From 78c268f3781e4b9706103def0cc011505e0c4332 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Mon, 26 Jan 2026 15:56:44 -0800 Subject: livepatch/klp-build: Fix klp-build vs CONFIG_MODULE_SRCVERSION_ALL When building a patch to a single-file kernel module with CONFIG_MODULE_SRCVERSION_ALL enabled, the klp-build module link fails in modpost: Diffing objects drivers/md/raid0.o: changed function: raid0_run Building patch module: livepatch-0001-patch-raid0_run.ko drivers/md/raid0.c: No such file or directory ... The problem here is that klp-build copied drivers/md/.raid0.o.cmd to the module build directory, but it didn't also copy over the input source file listed in the .cmd file: source_drivers/md/raid0.o := drivers/md/raid0.c So modpost dies due to the missing .c file which is needed for calculating checksums for CONFIG_MODULE_SRCVERSION_ALL. Instead of copying the original .cmd file, just create an empty one. Modpost only requires that it exists. The original object's build dependencies are irrelevant for the frankenobjects used by klp-build. Fixes: 24ebfcd65a87 ("livepatch/klp-build: Introduce klp-build script for generating livepatch modules") Reported-by: Song Liu Tested-by: Song Liu Link: https://patch.msgid.link/c41b6629e02775e4c1015259aa36065b3fe2f0f3.1769471792.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/livepatch') diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 882272120c9e..a73515a82272 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -555,13 +555,11 @@ copy_orig_objects() { local file_dir="$(dirname "$file")" local orig_file="$ORIG_DIR/$rel_file" local orig_dir="$(dirname "$orig_file")" - local cmd_file="$file_dir/.$(basename "$file").cmd" [[ ! -f "$file" ]] && die "missing $(basename "$file") for $_file" mkdir -p "$orig_dir" cp -f "$file" "$orig_dir" - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$orig_dir" done xtrace_restore @@ -740,15 +738,17 @@ build_patch_module() { local orig_dir="$(dirname "$orig_file")" local kmod_file="$KMOD_DIR/$rel_file" local kmod_dir="$(dirname "$kmod_file")" - local cmd_file="$orig_dir/.$(basename "$file").cmd" + local cmd_file="$kmod_dir/.$(basename "$file").cmd" mkdir -p "$kmod_dir" cp -f "$file" "$kmod_dir" - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$kmod_dir" # Tell kbuild this is a prebuilt object cp -f "$file" "${kmod_file}_shipped" + # Make modpost happy + touch "$cmd_file" + echo -n " $rel_file" >> "$makefile" done -- cgit v1.2.3 From a8ff29f0ca1d63a215ef445102662850a912d127 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Tue, 27 Jan 2026 17:12:05 -0800 Subject: livepatch/klp-build: Require Clang assembler >= 20 Some special sections specify their ELF section entsize, for example: .pushsection section, "M", @progbits, 8 The entsize (8 in this example) is needed by objtool klp-diff for extracting individual entries. Clang assembler versions older than 20 silently ignore the above construct and set entsize to 0, resulting in the following error: .discard.annotate_data: missing special section entsize or annotations Add a klp-build check to prevent the use of Clang assembler versions prior to 20. Fixes: 24ebfcd65a87 ("livepatch/klp-build: Introduce klp-build script for generating livepatch modules") Reported-by: Song Liu Acked-by: Song Liu Link: https://patch.msgid.link/957fd52e375d0e2cfa3ac729160da995084a7f5e.1769562556.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/livepatch') diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index a73515a82272..809e198a561d 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -249,6 +249,10 @@ validate_config() { [[ -v CONFIG_GCC_PLUGIN_RANDSTRUCT ]] && \ die "kernel option 'CONFIG_GCC_PLUGIN_RANDSTRUCT' not supported" + [[ -v CONFIG_AS_IS_LLVM ]] && \ + [[ "$CONFIG_AS_VERSION" -lt 200000 ]] && \ + die "Clang assembler version < 20 not supported" + return 0 } -- cgit v1.2.3 From ab10815472fcbc2c772dc21a979460b7f74f0145 Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Fri, 23 Jan 2026 11:26:56 +0100 Subject: livepatch: Fix having __klp_objects relics in non-livepatch modules The linker script scripts/module.lds.S specifies that all input __klp_objects sections should be consolidated into an output section of the same name, and start/stop symbols should be created to enable scripts/livepatch/init.c to locate this data. This start/stop pattern is not ideal for modules because the symbols are created even if no __klp_objects input sections are present. Consequently, a dummy __klp_objects section also appears in the resulting module. This unnecessarily pollutes non-livepatch modules. Instead, since modules are relocatable files, the usual method for locating consolidated data in a module is to read its section table. This approach avoids the aforementioned problem. The klp_modinfo already stores a copy of the entire section table with the final addresses. Introduce a helper function that scripts/livepatch/init.c can call to obtain the location of the __klp_objects section from this data. Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files") Signed-off-by: Petr Pavlu Acked-by: Joe Lawrence Acked-by: Miroslav Benes Reviewed-by: Aaron Tomlin Link: https://patch.msgid.link/20260123102825.3521961-2-petr.pavlu@suse.com Signed-off-by: Josh Poimboeuf --- include/linux/livepatch.h | 3 +++ kernel/livepatch/core.c | 19 +++++++++++++++++++ scripts/livepatch/init.c | 20 +++++++++----------- scripts/module.lds.S | 7 +------ 4 files changed, 32 insertions(+), 17 deletions(-) (limited to 'scripts/livepatch') diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index 772919e8096a..ba9e3988c07c 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -175,6 +175,9 @@ int klp_enable_patch(struct klp_patch *); int klp_module_coming(struct module *mod); void klp_module_going(struct module *mod); +void *klp_find_section_by_name(const struct module *mod, const char *name, + size_t *sec_size); + void klp_copy_process(struct task_struct *child); void klp_update_patch_state(struct task_struct *task); diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 9917756dae46..1acbad2dbfdf 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -1356,6 +1356,25 @@ void klp_module_going(struct module *mod) mutex_unlock(&klp_mutex); } +void *klp_find_section_by_name(const struct module *mod, const char *name, + size_t *sec_size) +{ + struct klp_modinfo *info = mod->klp_info; + + for (int i = 1; i < info->hdr.e_shnum; i++) { + Elf_Shdr *shdr = &info->sechdrs[i]; + + if (!strcmp(info->secstrings + shdr->sh_name, name)) { + *sec_size = shdr->sh_size; + return (void *)shdr->sh_addr; + } + } + + *sec_size = 0; + return NULL; +} +EXPORT_SYMBOL_GPL(klp_find_section_by_name); + static int __init klp_init(void) { klp_root_kobj = kobject_create_and_add("livepatch", kernel_kobj); diff --git a/scripts/livepatch/init.c b/scripts/livepatch/init.c index 2274d8f5a482..9e315fc857bd 100644 --- a/scripts/livepatch/init.c +++ b/scripts/livepatch/init.c @@ -9,19 +9,19 @@ #include #include -extern struct klp_object_ext __start_klp_objects[]; -extern struct klp_object_ext __stop_klp_objects[]; - static struct klp_patch *patch; static int __init livepatch_mod_init(void) { + struct klp_object_ext *obj_exts; + size_t obj_exts_sec_size; struct klp_object *objs; unsigned int nr_objs; int ret; - nr_objs = __stop_klp_objects - __start_klp_objects; - + obj_exts = klp_find_section_by_name(THIS_MODULE, "__klp_objects", + &obj_exts_sec_size); + nr_objs = obj_exts_sec_size / sizeof(*obj_exts); if (!nr_objs) { pr_err("nothing to patch!\n"); ret = -EINVAL; @@ -41,7 +41,7 @@ static int __init livepatch_mod_init(void) } for (int i = 0; i < nr_objs; i++) { - struct klp_object_ext *obj_ext = __start_klp_objects + i; + struct klp_object_ext *obj_ext = obj_exts + i; struct klp_func_ext *funcs_ext = obj_ext->funcs; unsigned int nr_funcs = obj_ext->nr_funcs; struct klp_func *funcs = objs[i].funcs; @@ -90,12 +90,10 @@ err: static void __exit livepatch_mod_exit(void) { - unsigned int nr_objs; - - nr_objs = __stop_klp_objects - __start_klp_objects; + struct klp_object *obj; - for (int i = 0; i < nr_objs; i++) - kfree(patch->objs[i].funcs); + klp_for_each_object_static(patch, obj) + kfree(obj->funcs); kfree(patch->objs); kfree(patch); diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 3037d5e5527c..383d19beffb4 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -35,12 +35,7 @@ SECTIONS { __patchable_function_entries : { *(__patchable_function_entries) } __klp_funcs 0: ALIGN(8) { KEEP(*(__klp_funcs)) } - - __klp_objects 0: ALIGN(8) { - __start_klp_objects = .; - KEEP(*(__klp_objects)) - __stop_klp_objects = .; - } + __klp_objects 0: ALIGN(8) { KEEP(*(__klp_objects)) } #ifdef CONFIG_ARCH_USES_CFI_TRAPS __kcfi_traps : { KEEP(*(.kcfi_traps)) } -- cgit v1.2.3 From b525fcaf0a76507f152d58c6f9e5ef67b3ff552c Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Fri, 23 Jan 2026 11:26:57 +0100 Subject: livepatch: Free klp_{object,func}_ext data after initialization The klp_object_ext and klp_func_ext data, which are stored in the __klp_objects and __klp_funcs sections, respectively, are not needed after they are used to create the actual klp_object and klp_func instances. This operation is implemented by the init function in scripts/livepatch/init.c. Prefix the two sections with ".init" so they are freed after the module is initializated. Signed-off-by: Petr Pavlu Acked-by: Joe Lawrence Acked-by: Miroslav Benes Reviewed-by: Aaron Tomlin Link: https://patch.msgid.link/20260123102825.3521961-3-petr.pavlu@suse.com Signed-off-by: Josh Poimboeuf --- scripts/livepatch/init.c | 2 +- scripts/module.lds.S | 4 ++-- tools/objtool/check.c | 2 +- tools/objtool/include/objtool/klp.h | 10 +++++----- tools/objtool/klp-diff.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'scripts/livepatch') diff --git a/scripts/livepatch/init.c b/scripts/livepatch/init.c index 9e315fc857bd..638c95cffe76 100644 --- a/scripts/livepatch/init.c +++ b/scripts/livepatch/init.c @@ -19,7 +19,7 @@ static int __init livepatch_mod_init(void) unsigned int nr_objs; int ret; - obj_exts = klp_find_section_by_name(THIS_MODULE, "__klp_objects", + obj_exts = klp_find_section_by_name(THIS_MODULE, ".init.klp_objects", &obj_exts_sec_size); nr_objs = obj_exts_sec_size / sizeof(*obj_exts); if (!nr_objs) { diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 383d19beffb4..054ef99e8288 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -34,8 +34,8 @@ SECTIONS { __patchable_function_entries : { *(__patchable_function_entries) } - __klp_funcs 0: ALIGN(8) { KEEP(*(__klp_funcs)) } - __klp_objects 0: ALIGN(8) { KEEP(*(__klp_objects)) } + .init.klp_funcs 0 : ALIGN(8) { KEEP(*(.init.klp_funcs)) } + .init.klp_objects 0 : ALIGN(8) { KEEP(*(.init.klp_objects)) } #ifdef CONFIG_ARCH_USES_CFI_TRAPS __kcfi_traps : { KEEP(*(.kcfi_traps)) } diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3f7999317f4d..933868ee3beb 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4761,7 +4761,7 @@ static int validate_ibt(struct objtool_file *file) !strcmp(sec->name, "__bug_table") || !strcmp(sec->name, "__ex_table") || !strcmp(sec->name, "__jump_table") || - !strcmp(sec->name, "__klp_funcs") || + !strcmp(sec->name, ".init.klp_funcs") || !strcmp(sec->name, "__mcount_loc") || !strcmp(sec->name, ".llvm.call-graph-profile") || !strcmp(sec->name, ".llvm_bb_addr_map") || diff --git a/tools/objtool/include/objtool/klp.h b/tools/objtool/include/objtool/klp.h index ad830a7ce55b..e32e5e8bc631 100644 --- a/tools/objtool/include/objtool/klp.h +++ b/tools/objtool/include/objtool/klp.h @@ -6,12 +6,12 @@ #define SHN_LIVEPATCH 0xff20 /* - * __klp_objects and __klp_funcs are created by klp diff and used by the patch - * module init code to build the klp_patch, klp_object and klp_func structs - * needed by the livepatch API. + * .init.klp_objects and .init.klp_funcs are created by klp diff and used by the + * patch module init code to build the klp_patch, klp_object and klp_func + * structs needed by the livepatch API. */ -#define KLP_OBJECTS_SEC "__klp_objects" -#define KLP_FUNCS_SEC "__klp_funcs" +#define KLP_OBJECTS_SEC ".init.klp_objects" +#define KLP_FUNCS_SEC ".init.klp_funcs" /* * __klp_relocs is an intermediate section which are created by klp diff and diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index d94531e3f64e..1e649a3eb4cd 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -1436,7 +1436,7 @@ static int clone_special_sections(struct elfs *e) } /* - * Create __klp_objects and __klp_funcs sections which are intermediate + * Create .init.klp_objects and .init.klp_funcs sections which are intermediate * sections provided as input to the patch module's init code for building the * klp_patch, klp_object and klp_func structs for the livepatch API. */ -- cgit v1.2.3 From 69050f8d6d075dc01af7a5f2f550a8067510366f Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 20 Feb 2026 23:49:23 -0800 Subject: treewide: Replace kmalloc with kmalloc_obj for non-scalar types This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid scalar types (which need careful case-by-case checking), and instead replace kmalloc-family calls that allocate struct or union object instances: Single allocations: kmalloc(sizeof(TYPE), ...) are replaced with: kmalloc_obj(TYPE, ...) Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...) are replaced with: kmalloc_objs(TYPE, COUNT, ...) Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...) are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...) (where TYPE may also be *VAR) The resulting allocations no longer return "void *", instead returning "TYPE *". Signed-off-by: Kees Cook --- arch/alpha/kernel/core_marvel.c | 4 +- arch/alpha/kernel/core_titan.c | 4 +- arch/alpha/kernel/module.c | 4 +- arch/alpha/kernel/pci.c | 2 +- arch/alpha/kernel/setup.c | 2 +- arch/arc/kernel/unwind.c | 2 +- arch/arc/net/bpf_jit_core.c | 2 +- arch/arm/common/locomo.c | 6 +- arch/arm/common/sa1111.c | 4 +- arch/arm/common/scoop.c | 2 +- arch/arm/kernel/atags_proc.c | 2 +- arch/arm/kernel/smp.c | 2 +- arch/arm/kernel/sys_oabi-compat.c | 2 +- arch/arm/kernel/unwind.c | 2 +- arch/arm/kernel/vdso.c | 3 +- arch/arm/mach-footbridge/dc21285.c | 2 +- arch/arm/mach-footbridge/ebsa285.c | 2 +- arch/arm/mach-footbridge/netwinder-hw.c | 2 +- arch/arm/mach-imx/mmdc.c | 2 +- arch/arm/mach-mvebu/board-v7.c | 2 +- arch/arm/mach-mvebu/coherency.c | 2 +- arch/arm/mach-mvebu/mvebu-soc-id.c | 2 +- arch/arm/mach-mxs/mach-mxs.c | 2 +- arch/arm/mach-omap1/dma.c | 2 +- arch/arm/mach-omap1/mcbsp.c | 4 +- arch/arm/mach-omap1/timer.c | 2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 2 +- arch/arm/mach-omap2/id.c | 2 +- arch/arm/mach-omap2/omap-iommu.c | 2 +- arch/arm/mach-omap2/omap_device.c | 4 +- arch/arm/mach-omap2/omap_hwmod.c | 8 +- arch/arm/mach-omap2/pm33xx-core.c | 2 +- arch/arm/mach-omap2/pm34xx.c | 2 +- arch/arm/mach-omap2/pm44xx.c | 2 +- arch/arm/mach-omap2/sr_device.c | 2 +- arch/arm/mach-orion5x/pci.c | 4 +- arch/arm/mach-rpc/ecard.c | 2 +- arch/arm/mach-sa1100/clock.c | 4 +- arch/arm/mach-sa1100/generic.c | 2 +- arch/arm/mach-sa1100/neponset.c | 2 +- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 2 +- arch/arm/mach-versatile/spc.c | 6 +- arch/arm/mach-versatile/versatile.c | 2 +- arch/arm/mach-zynq/common.c | 2 +- arch/arm/mm/cache-l2x0-pmu.c | 2 +- arch/arm/mm/cache-uniphier.c | 2 +- arch/arm/mm/dma-mapping.c | 6 +- arch/arm/mm/pgd.c | 2 +- arch/arm/probes/kprobes/test-core.c | 5 +- arch/arm/xen/enlighten.c | 4 +- arch/arm/xen/p2m.c | 2 +- arch/arm64/kernel/machine_kexec_file.c | 2 +- arch/arm64/kernel/vdso.c | 5 +- arch/arm64/kvm/arm.c | 4 +- arch/arm64/kvm/mmu.c | 9 +- arch/arm64/kvm/nested.c | 8 +- arch/arm64/kvm/pmu-emul.c | 2 +- arch/arm64/kvm/ptdump.c | 2 +- arch/arm64/kvm/vgic/vgic-debug.c | 4 +- arch/arm64/kvm/vgic/vgic-init.c | 10 +- arch/arm64/kvm/vgic/vgic-irqfd.c | 2 +- arch/arm64/kvm/vgic/vgic-its.c | 10 +- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +- arch/arm64/kvm/vgic/vgic-v4.c | 4 +- arch/arm64/net/bpf_jit_comp.c | 4 +- arch/csky/kernel/vdso.c | 2 +- arch/loongarch/kernel/machine_kexec_file.c | 2 +- arch/loongarch/kernel/setup.c | 2 +- arch/loongarch/kernel/vdso.c | 3 +- arch/loongarch/kvm/intc/eiointc.c | 2 +- arch/loongarch/kvm/intc/ipi.c | 2 +- arch/loongarch/kvm/intc/pch_pic.c | 4 +- arch/loongarch/kvm/main.c | 2 +- arch/loongarch/kvm/vcpu.c | 2 +- arch/loongarch/kvm/vm.c | 3 +- arch/loongarch/net/bpf_jit.c | 2 +- arch/loongarch/pci/acpi.c | 6 +- arch/m68k/amiga/chipram.c | 2 +- arch/m68k/atari/stram.c | 2 +- arch/m68k/emu/nfblock.c | 2 +- arch/m68k/mm/kmap.c | 2 +- arch/mips/alchemy/common/clock.c | 8 +- arch/mips/alchemy/common/dbdma.c | 8 +- arch/mips/alchemy/common/platform.c | 4 +- arch/mips/alchemy/devboards/platform.c | 8 +- arch/mips/bcm47xx/setup.c | 2 +- arch/mips/cavium-octeon/octeon-irq.c | 10 +- arch/mips/kernel/module.c | 2 +- arch/mips/kernel/smp-cps.c | 14 ++- arch/mips/kernel/vpe.c | 6 +- arch/mips/lantiq/falcon/sysctrl.c | 2 +- arch/mips/lantiq/xway/gptu.c | 2 +- arch/mips/lantiq/xway/sysctrl.c | 10 +- arch/mips/loongson64/init.c | 2 +- arch/mips/pci/pci-alchemy.c | 2 +- arch/mips/pci/pci-xtalk-bridge.c | 2 +- arch/mips/ralink/mt7620.c | 2 +- arch/mips/ralink/mt7621.c | 2 +- arch/mips/ralink/rt288x.c | 2 +- arch/mips/ralink/rt305x.c | 2 +- arch/mips/ralink/rt3883.c | 2 +- arch/mips/sgi-ip22/ip22-gio.c | 2 +- arch/mips/sgi-ip27/ip27-irq.c | 2 +- arch/mips/sgi-ip27/ip27-xtalk.c | 4 +- arch/mips/sgi-ip30/ip30-irq.c | 2 +- arch/mips/sgi-ip30/ip30-xtalk.c | 4 +- arch/mips/txx9/generic/pci.c | 2 +- arch/mips/txx9/generic/setup.c | 4 +- arch/nios2/platform/platform.c | 2 +- arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/inventory.c | 4 +- arch/parisc/kernel/processor.c | 2 +- arch/parisc/kernel/unwind.c | 4 +- arch/parisc/kernel/vdso.c | 2 +- arch/parisc/net/bpf_jit_core.c | 4 +- arch/powerpc/kernel/cacheinfo.c | 6 +- arch/powerpc/kernel/eeh_cache.c | 2 +- arch/powerpc/kernel/eeh_event.c | 2 +- arch/powerpc/kernel/nvram_64.c | 4 +- arch/powerpc/kernel/pci-common.c | 8 +- arch/powerpc/kernel/pci_dn.c | 6 +- arch/powerpc/kernel/secvar-sysfs.c | 2 +- arch/powerpc/kernel/smp-tbsync.c | 2 +- arch/powerpc/kernel/smp.c | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_64_mmu_radix.c | 2 +- arch/powerpc/kvm/book3s_64_vio.c | 4 +- arch/powerpc/kvm/book3s_hv.c | 8 +- arch/powerpc/kvm/book3s_hv_nested.c | 4 +- arch/powerpc/kvm/book3s_hv_uvmem.c | 4 +- arch/powerpc/kvm/book3s_pr.c | 4 +- arch/powerpc/kvm/book3s_rtas.c | 2 +- arch/powerpc/kvm/book3s_xics.c | 6 +- arch/powerpc/kvm/book3s_xive.c | 6 +- arch/powerpc/kvm/book3s_xive_native.c | 2 +- arch/powerpc/kvm/e500.c | 2 +- arch/powerpc/kvm/e500_mmu.c | 25 +++-- arch/powerpc/kvm/guest-state-buffer.c | 4 +- arch/powerpc/kvm/mpic.c | 4 +- arch/powerpc/lib/rheap.c | 4 +- arch/powerpc/mm/book3s64/iommu_api.c | 2 +- arch/powerpc/mm/book3s64/mmu_context.c | 8 +- arch/powerpc/mm/book3s64/subpage_prot.c | 2 +- arch/powerpc/mm/drmem.c | 8 +- arch/powerpc/mm/mem.c | 2 +- arch/powerpc/net/bpf_jit_comp.c | 2 +- arch/powerpc/perf/hv-24x7.c | 13 ++- arch/powerpc/perf/hv-gpci.c | 2 +- arch/powerpc/perf/imc-pmu.c | 30 +++--- arch/powerpc/perf/vpa-dtl.c | 2 +- arch/powerpc/platforms/44x/hsta_msi.c | 3 +- arch/powerpc/platforms/44x/pci.c | 3 +- arch/powerpc/platforms/44x/uic.c | 2 +- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 2 +- arch/powerpc/platforms/book3s/vas-api.c | 2 +- arch/powerpc/platforms/cell/spu_base.c | 2 +- arch/powerpc/platforms/cell/spufs/context.c | 2 +- arch/powerpc/platforms/cell/spufs/file.c | 6 +- arch/powerpc/platforms/cell/spufs/gang.c | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 4 +- arch/powerpc/platforms/cell/spufs/sched.c | 2 +- arch/powerpc/platforms/pasemi/gpio_mdio.c | 2 +- arch/powerpc/platforms/powermac/low_i2c.c | 6 +- arch/powerpc/platforms/powermac/pfunc_core.c | 4 +- arch/powerpc/platforms/powernv/idle.c | 4 +- arch/powerpc/platforms/powernv/memtrace.c | 4 +- arch/powerpc/platforms/powernv/ocxl.c | 4 +- arch/powerpc/platforms/powernv/opal-async.c | 4 +- arch/powerpc/platforms/powernv/opal-core.c | 4 +- arch/powerpc/platforms/powernv/opal-dump.c | 2 +- arch/powerpc/platforms/powernv/opal-elog.c | 2 +- arch/powerpc/platforms/powernv/opal-hmi.c | 2 +- arch/powerpc/platforms/powernv/opal-imc.c | 6 +- arch/powerpc/platforms/powernv/opal-irqchip.c | 2 +- arch/powerpc/platforms/powernv/opal-lpc.c | 2 +- .../powerpc/platforms/powernv/opal-memory-errors.c | 2 +- arch/powerpc/platforms/powernv/opal-powercap.c | 11 +-- arch/powerpc/platforms/powernv/opal-psr.c | 4 +- .../powerpc/platforms/powernv/opal-sensor-groups.c | 11 +-- arch/powerpc/platforms/powernv/opal-sysparam.c | 2 +- arch/powerpc/platforms/powernv/opal-xscom.c | 2 +- arch/powerpc/platforms/powernv/opal.c | 4 +- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- arch/powerpc/platforms/powernv/pci-sriov.c | 2 +- arch/powerpc/platforms/powernv/rng.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 2 +- arch/powerpc/platforms/powernv/vas.c | 2 +- arch/powerpc/platforms/ps3/device-init.c | 18 ++-- arch/powerpc/platforms/ps3/mm.c | 4 +- arch/powerpc/platforms/ps3/spu.c | 3 +- arch/powerpc/platforms/pseries/dlpar.c | 6 +- arch/powerpc/platforms/pseries/hotplug-memory.c | 2 +- arch/powerpc/platforms/pseries/hvcserver.c | 4 +- arch/powerpc/platforms/pseries/iommu.c | 14 +-- arch/powerpc/platforms/pseries/lparcfg.c | 2 +- arch/powerpc/platforms/pseries/mobility.c | 2 +- arch/powerpc/platforms/pseries/msi.c | 2 +- arch/powerpc/platforms/pseries/papr-hvpipe.c | 4 +- arch/powerpc/platforms/pseries/papr-phy-attest.c | 2 +- .../powerpc/platforms/pseries/papr-platform-dump.c | 4 +- arch/powerpc/platforms/pseries/papr-rtas-common.c | 2 +- arch/powerpc/platforms/pseries/papr-sysparm.c | 2 +- .../platforms/pseries/papr_platform_attributes.c | 8 +- arch/powerpc/platforms/pseries/papr_scm.c | 4 +- arch/powerpc/platforms/pseries/pci.c | 4 +- arch/powerpc/platforms/pseries/reconfig.c | 4 +- arch/powerpc/platforms/pseries/vas-sysfs.c | 2 +- arch/powerpc/platforms/pseries/vas.c | 4 +- arch/powerpc/platforms/pseries/vio.c | 7 +- arch/powerpc/sysdev/ehv_pic.c | 2 +- arch/powerpc/sysdev/fsl_gtm.c | 2 +- arch/powerpc/sysdev/fsl_lbc.c | 4 +- arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c | 2 +- arch/powerpc/sysdev/fsl_msi.c | 4 +- arch/powerpc/sysdev/fsl_pci.c | 2 +- arch/powerpc/sysdev/fsl_rio.c | 10 +- arch/powerpc/sysdev/fsl_rmu.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 9 +- arch/powerpc/sysdev/mpic_msgr.c | 6 +- arch/powerpc/sysdev/mpic_timer.c | 2 +- arch/powerpc/sysdev/of_rtc.c | 2 +- arch/powerpc/sysdev/xics/ics-native.c | 2 +- arch/powerpc/sysdev/xive/common.c | 5 +- arch/powerpc/sysdev/xive/spapr.c | 2 +- arch/riscv/kernel/hibernate.c | 2 +- arch/riscv/kernel/machine_kexec_file.c | 2 +- arch/riscv/kernel/module.c | 11 +-- arch/riscv/kernel/tests/kprobes/test-kprobes.c | 2 +- arch/riscv/kernel/unaligned_access_speed.c | 2 +- arch/riscv/kernel/vdso.c | 5 +- arch/riscv/kvm/aia_aplic.c | 5 +- arch/riscv/kvm/aia_imsic.c | 2 +- arch/riscv/kvm/vcpu_sbi_fwft.c | 4 +- arch/riscv/kvm/vm.c | 2 +- arch/riscv/net/bpf_jit_comp64.c | 2 +- arch/riscv/net/bpf_jit_core.c | 4 +- arch/s390/appldata/appldata_base.c | 4 +- arch/s390/appldata/appldata_mem.c | 2 +- arch/s390/appldata/appldata_net_sum.c | 2 +- arch/s390/hypfs/hypfs_dbfs.c | 2 +- arch/s390/hypfs/hypfs_diag0c.c | 7 +- arch/s390/hypfs/hypfs_sprp.c | 2 +- arch/s390/hypfs/inode.c | 2 +- arch/s390/include/asm/idals.h | 6 +- arch/s390/kernel/cert_store.c | 2 +- arch/s390/kernel/debug.c | 15 ++- arch/s390/kernel/guarded_storage.c | 4 +- arch/s390/kernel/irq.c | 2 +- arch/s390/kernel/os_info.c | 2 +- arch/s390/kernel/perf_cpum_cf.c | 4 +- arch/s390/kernel/perf_cpum_cf_events.c | 2 +- arch/s390/kernel/perf_cpum_sf.c | 2 +- arch/s390/kernel/perf_pai.c | 14 +-- arch/s390/kernel/ptrace.c | 6 +- arch/s390/kernel/runtime_instr.c | 2 +- arch/s390/kernel/smp.c | 2 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/kvm/dat.c | 2 +- arch/s390/kvm/dat.h | 4 +- arch/s390/kvm/gmap.c | 4 +- arch/s390/kvm/guestdbg.c | 8 +- arch/s390/kvm/interrupt.c | 8 +- arch/s390/kvm/kvm-s390.c | 6 +- arch/s390/kvm/pci.c | 10 +- arch/s390/kvm/pv.c | 2 +- arch/s390/mm/extmem.c | 8 +- arch/s390/net/bpf_jit_comp.c | 2 +- arch/s390/pci/pci.c | 8 +- arch/s390/pci/pci_bus.c | 2 +- arch/s390/pci/pci_irq.c | 5 +- arch/sh/drivers/dma/dmabrg.c | 3 +- arch/sh/drivers/heartbeat.c | 2 +- arch/sh/drivers/pci/pcie-sh7786.c | 4 +- arch/sh/drivers/push-switch.c | 2 +- arch/sh/kernel/cpu/sh4/sq.c | 2 +- arch/sh/kernel/dwarf.c | 4 +- arch/sparc/kernel/central.c | 4 +- arch/sparc/kernel/chmc.c | 4 +- arch/sparc/kernel/cpumap.c | 2 +- arch/sparc/kernel/ds.c | 2 +- arch/sparc/kernel/ioport.c | 2 +- arch/sparc/kernel/irq_64.c | 4 +- arch/sparc/kernel/ldc.c | 2 +- arch/sparc/kernel/leon_pci_grpci2.c | 2 +- arch/sparc/kernel/of_device_32.c | 2 +- arch/sparc/kernel/of_device_64.c | 2 +- arch/sparc/kernel/pci.c | 2 +- arch/sparc/kernel/pci_common.c | 2 +- arch/sparc/kernel/pci_fire.c | 4 +- arch/sparc/kernel/pci_psycho.c | 4 +- arch/sparc/kernel/pci_sabre.c | 4 +- arch/sparc/kernel/pci_schizo.c | 4 +- arch/sparc/kernel/pci_sun4v.c | 8 +- arch/sparc/kernel/pcic.c | 2 +- arch/sparc/kernel/sbus.c | 4 +- arch/sparc/kernel/setup_32.c | 2 +- arch/sparc/kernel/smp_64.c | 4 +- arch/sparc/kernel/starfire.c | 2 +- arch/sparc/kernel/sun4d_irq.c | 2 +- arch/sparc/kernel/sun4m_irq.c | 2 +- arch/sparc/kernel/sys_sparc_64.c | 9 +- arch/sparc/kernel/vio.c | 2 +- arch/sparc/mm/init_64.c | 2 +- arch/sparc/mm/io-unit.c | 2 +- arch/sparc/mm/iommu.c | 2 +- arch/sparc/net/bpf_jit_comp_64.c | 2 +- arch/sparc/vdso/vma.c | 4 +- arch/um/drivers/chan_kern.c | 2 +- arch/um/drivers/hostaudio_kern.c | 4 +- arch/um/drivers/line.c | 2 +- arch/um/drivers/mconsole_kern.c | 2 +- arch/um/drivers/port_kern.c | 6 +- arch/um/drivers/ubd_kern.c | 12 +-- arch/um/drivers/vector_kern.c | 18 ++-- arch/um/drivers/vector_transports.c | 5 +- arch/um/drivers/vfio_kern.c | 9 +- arch/um/drivers/virtio_pcidev.c | 2 +- arch/um/drivers/virtio_uml.c | 4 +- arch/um/drivers/xterm_kern.c | 2 +- arch/um/kernel/irq.c | 2 +- arch/x86/coco/sev/core.c | 6 +- arch/x86/events/amd/iommu.c | 4 +- arch/x86/events/amd/uncore.c | 4 +- arch/x86/events/core.c | 2 +- arch/x86/events/intel/core.c | 5 +- arch/x86/events/intel/uncore.c | 7 +- arch/x86/events/intel/uncore_discovery.c | 11 ++- arch/x86/events/intel/uncore_snbep.c | 13 +-- arch/x86/events/rapl.c | 4 +- arch/x86/hyperv/hv_init.c | 5 +- arch/x86/hyperv/irqdomain.c | 2 +- arch/x86/hyperv/ivm.c | 4 +- arch/x86/kernel/alternative.c | 2 +- arch/x86/kernel/amd_nb.c | 3 +- arch/x86/kernel/amd_node.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apm_32.c | 2 +- arch/x86/kernel/cpu/amd_cache_disable.c | 2 +- arch/x86/kernel/cpu/mce/amd.c | 6 +- arch/x86/kernel/cpu/mce/core.c | 2 +- arch/x86/kernel/cpu/mce/dev-mcelog.c | 2 +- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/legacy.c | 2 +- arch/x86/kernel/cpu/sgx/driver.c | 2 +- arch/x86/kernel/cpu/sgx/encl.c | 4 +- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- arch/x86/kernel/cpu/sgx/main.c | 3 +- arch/x86/kernel/cpu/sgx/virt.c | 2 +- arch/x86/kernel/hpet.c | 4 +- arch/x86/kernel/ioport.c | 2 +- arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kexec-bzimage64.c | 2 +- arch/x86/kernel/ksysfs.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/ldt.c | 2 +- arch/x86/kernel/uprobes.c | 2 +- arch/x86/kernel/vm86_32.c | 2 +- arch/x86/kvm/cpuid.c | 5 +- arch/x86/kvm/hyperv.c | 2 +- arch/x86/kvm/i8254.c | 2 +- arch/x86/kvm/i8259.c | 2 +- arch/x86/kvm/ioapic.c | 2 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu/mmu.c | 2 +- arch/x86/kvm/svm/nested.c | 2 +- arch/x86/kvm/svm/sev.c | 4 +- arch/x86/kvm/vmx/tdx.c | 10 +- arch/x86/kvm/x86.c | 10 +- arch/x86/kvm/xen.c | 7 +- arch/x86/mm/kmmio.c | 4 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/pat/memtype.c | 4 +- arch/x86/net/bpf_jit_comp.c | 4 +- arch/x86/net/bpf_jit_comp32.c | 2 +- arch/x86/pci/acpi.c | 2 +- arch/x86/pci/bus_numa.c | 4 +- arch/x86/pci/common.c | 2 +- arch/x86/pci/fixup.c | 2 +- arch/x86/pci/i386.c | 2 +- arch/x86/pci/mmconfig-shared.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/platform/efi/runtime-map.c | 4 +- arch/x86/platform/geode/geode-common.c | 4 +- arch/x86/power/cpu.c | 2 +- arch/x86/virt/svm/sev.c | 2 +- arch/x86/virt/vmx/tdx/tdx.c | 2 +- arch/x86/xen/grant-table.c | 2 +- arch/x86/xen/smp_pv.c | 2 +- arch/xtensa/kernel/ptrace.c | 4 +- arch/xtensa/platforms/iss/simdisk.c | 2 +- block/bfq-cgroup.c | 2 +- block/bfq-iosched.c | 6 +- block/bio-integrity.c | 4 +- block/bio.c | 2 +- block/blk-cgroup.c | 2 +- block/blk-crypto-fallback.c | 9 +- block/blk-crypto-profile.c | 7 +- block/blk-crypto-sysfs.c | 2 +- block/blk-iocost.c | 4 +- block/blk-iolatency.c | 2 +- block/blk-ioprio.c | 2 +- block/blk-map.c | 2 +- block/blk-mq-sched.c | 4 +- block/blk-mq.c | 4 +- block/blk-stat.c | 7 +- block/blk-wbt.c | 2 +- block/blk-zoned.c | 4 +- block/bsg-lib.c | 2 +- block/bsg.c | 2 +- block/disk-events.c | 2 +- block/fops.c | 3 +- block/genhd.c | 4 +- block/holder.c | 2 +- block/partitions/aix.c | 2 +- block/partitions/cmdline.c | 4 +- block/partitions/core.c | 2 +- block/partitions/efi.c | 2 +- block/partitions/ibm.c | 6 +- block/partitions/ldm.c | 10 +- block/sed-opal.c | 4 +- certs/blacklist.c | 2 +- certs/system_keyring.c | 2 +- crypto/af_alg.c | 2 +- crypto/algboss.c | 4 +- crypto/algif_rng.c | 2 +- crypto/api.c | 2 +- crypto/asymmetric_keys/asymmetric_type.c | 2 +- crypto/asymmetric_keys/pkcs7_parser.c | 14 ++- crypto/asymmetric_keys/pkcs8_parser.c | 2 +- crypto/asymmetric_keys/x509_cert_parser.c | 8 +- crypto/asymmetric_keys/x509_public_key.c | 2 +- crypto/deflate.c | 2 +- crypto/drbg.c | 4 +- crypto/ecc.c | 2 +- crypto/gcm.c | 2 +- crypto/simd.c | 4 +- crypto/tcrypt.c | 12 +-- crypto/testmgr.c | 10 +- crypto/zstd.c | 2 +- drivers/accel/amdxdna/aie2_ctx.c | 4 +- drivers/accel/amdxdna/aie2_error.c | 2 +- drivers/accel/amdxdna/aie2_pci.c | 6 +- drivers/accel/amdxdna/aie2_solver.c | 4 +- drivers/accel/amdxdna/amdxdna_ctx.c | 6 +- drivers/accel/amdxdna/amdxdna_gem.c | 8 +- drivers/accel/amdxdna/amdxdna_mailbox.c | 2 +- drivers/accel/amdxdna/amdxdna_pci_drv.c | 2 +- drivers/accel/amdxdna/amdxdna_ubuf.c | 8 +- drivers/accel/ethosu/ethosu_drv.c | 3 +- drivers/accel/ethosu/ethosu_gem.c | 5 +- drivers/accel/ethosu/ethosu_job.c | 6 +- drivers/accel/habanalabs/common/command_buffer.c | 4 +- .../accel/habanalabs/common/command_submission.c | 27 +++--- drivers/accel/habanalabs/common/context.c | 8 +- drivers/accel/habanalabs/common/debugfs.c | 3 +- drivers/accel/habanalabs/common/decoder.c | 2 +- drivers/accel/habanalabs/common/device.c | 30 +++--- drivers/accel/habanalabs/common/firmware_if.c | 2 +- drivers/accel/habanalabs/common/habanalabs_drv.c | 4 +- drivers/accel/habanalabs/common/habanalabs_ioctl.c | 10 +- drivers/accel/habanalabs/common/hldio.c | 2 +- drivers/accel/habanalabs/common/hw_queue.c | 7 +- drivers/accel/habanalabs/common/hwmon.c | 6 +- drivers/accel/habanalabs/common/irq.c | 12 ++- drivers/accel/habanalabs/common/memory.c | 24 ++--- drivers/accel/habanalabs/common/memory_mgr.c | 2 +- drivers/accel/habanalabs/common/mmu/mmu.c | 9 +- drivers/accel/habanalabs/common/security.c | 20 ++-- drivers/accel/habanalabs/common/state_dump.c | 2 +- drivers/accel/habanalabs/gaudi/gaudi.c | 11 +-- drivers/accel/habanalabs/gaudi2/gaudi2.c | 21 +++-- drivers/accel/habanalabs/gaudi2/gaudi2_security.c | 3 +- drivers/accel/habanalabs/goya/goya.c | 11 +-- drivers/accel/ivpu/ivpu_drv.c | 2 +- drivers/accel/ivpu/ivpu_gem_userptr.c | 4 +- drivers/accel/ivpu/ivpu_ipc.c | 2 +- drivers/accel/ivpu/ivpu_job.c | 6 +- drivers/accel/ivpu/ivpu_ms.c | 2 +- drivers/accel/qaic/qaic_control.c | 11 ++- drivers/accel/qaic/qaic_data.c | 12 +-- drivers/accel/qaic/qaic_drv.c | 2 +- drivers/accel/qaic/qaic_ras.c | 2 +- drivers/accel/qaic/qaic_ssr.c | 11 ++- drivers/accel/qaic/qaic_timesync.c | 8 +- drivers/accel/rocket/rocket_drv.c | 4 +- drivers/accel/rocket/rocket_gem.c | 2 +- drivers/accel/rocket/rocket_job.c | 14 +-- drivers/accessibility/speakup/main.c | 4 +- drivers/accessibility/speakup/spk_ttyio.c | 2 +- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_apd.c | 2 +- drivers/acpi/acpi_configfs.c | 2 +- drivers/acpi/acpi_ipmi.c | 4 +- drivers/acpi/acpi_lpat.c | 4 +- drivers/acpi/acpi_memhotplug.c | 4 +- drivers/acpi/acpi_mrrm.c | 6 +- drivers/acpi/acpi_pcc.c | 2 +- drivers/acpi/acpi_platform.c | 2 +- drivers/acpi/acpi_processor.c | 2 +- drivers/acpi/acpi_video.c | 17 ++-- drivers/acpi/acpi_watchdog.c | 2 +- drivers/acpi/apei/apei-base.c | 4 +- drivers/acpi/apei/einj-core.c | 3 +- drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/arm64/ffh.c | 2 +- drivers/acpi/arm64/iort.c | 8 +- drivers/acpi/button.c | 2 +- drivers/acpi/container.c | 2 +- drivers/acpi/cppc_acpi.c | 6 +- drivers/acpi/dock.c | 2 +- drivers/acpi/ec.c | 6 +- drivers/acpi/glue.c | 2 +- drivers/acpi/ioapic.c | 2 +- drivers/acpi/mipi-disco-img.c | 6 +- drivers/acpi/nfit/core.c | 4 +- drivers/acpi/numa/hmat.c | 8 +- drivers/acpi/nvs.c | 4 +- drivers/acpi/osl.c | 6 +- drivers/acpi/pci_irq.c | 2 +- drivers/acpi/pci_link.c | 2 +- drivers/acpi/pci_mcfg.c | 2 +- drivers/acpi/pci_root.c | 2 +- drivers/acpi/pci_slot.c | 2 +- drivers/acpi/platform_profile.c | 4 +- drivers/acpi/power.c | 6 +- drivers/acpi/prmt.c | 2 +- drivers/acpi/processor_idle.c | 4 +- drivers/acpi/processor_pdc.c | 4 +- drivers/acpi/processor_perflib.c | 5 +- drivers/acpi/processor_throttling.c | 5 +- drivers/acpi/property.c | 4 +- drivers/acpi/riscv/irq.c | 11 ++- drivers/acpi/riscv/rimt.c | 2 +- drivers/acpi/sbs.c | 2 +- drivers/acpi/sbshc.c | 2 +- drivers/acpi/scan.c | 16 ++-- drivers/acpi/sysfs.c | 12 +-- drivers/acpi/thermal.c | 2 +- drivers/acpi/utils.c | 2 +- drivers/acpi/viot.c | 4 +- drivers/acpi/wakeup.c | 2 +- drivers/acpi/x86/lpss.c | 2 +- drivers/acpi/x86/s2idle.c | 11 +-- drivers/amba/bus.c | 2 +- drivers/android/binder.c | 31 +++---- drivers/android/binder/rust_binderfs.c | 8 +- drivers/android/binder_alloc.c | 11 +-- drivers/android/binderfs.c | 8 +- drivers/ata/libahci_platform.c | 3 +- drivers/ata/libata-acpi.c | 4 +- drivers/ata/libata-core.c | 8 +- drivers/ata/libata-pmp.c | 4 +- drivers/ata/libata-sata.c | 2 +- drivers/ata/libata-transport.c | 2 +- drivers/ata/libata-zpodd.c | 2 +- drivers/ata/pata_parport/pata_parport.c | 2 +- drivers/ata/sata_dwc_460ex.c | 2 +- drivers/ata/sata_fsl.c | 4 +- drivers/atm/adummy.c | 3 +- drivers/atm/atmtcp.c | 2 +- drivers/atm/eni.c | 10 +- drivers/atm/fore200e.c | 13 ++- drivers/atm/he.c | 10 +- drivers/atm/idt77105.c | 2 +- drivers/atm/idt77252.c | 12 +-- drivers/atm/iphase.c | 29 +++--- drivers/atm/lanai.c | 4 +- drivers/atm/nicstar.c | 7 +- drivers/atm/solos-pci.c | 2 +- drivers/atm/suni.c | 2 +- drivers/auxdisplay/hd44780.c | 2 +- drivers/auxdisplay/line-display.c | 4 +- drivers/auxdisplay/panel.c | 2 +- drivers/base/arch_topology.c | 2 +- drivers/base/attribute_container.c | 2 +- drivers/base/auxiliary.c | 2 +- drivers/base/auxiliary_sysfs.c | 2 +- drivers/base/bus.c | 6 +- drivers/base/cacheinfo.c | 7 +- drivers/base/class.c | 6 +- drivers/base/component.c | 6 +- drivers/base/core.c | 14 +-- drivers/base/cpu.c | 2 +- drivers/base/devcoredump.c | 2 +- drivers/base/devres.c | 2 +- drivers/base/faux.c | 4 +- drivers/base/firmware_loader/main.c | 8 +- drivers/base/firmware_loader/sysfs.c | 2 +- drivers/base/firmware_loader/sysfs_upload.c | 4 +- drivers/base/isa.c | 2 +- drivers/base/map.c | 6 +- drivers/base/memory.c | 4 +- drivers/base/node.c | 8 +- drivers/base/physical_location.c | 4 +- drivers/base/power/clock_ops.c | 4 +- drivers/base/power/common.c | 4 +- drivers/base/power/qos.c | 10 +- drivers/base/power/wakeirq.c | 4 +- drivers/base/power/wakeup.c | 2 +- drivers/base/power/wakeup_stats.c | 2 +- drivers/base/regmap/regcache-flat.c | 2 +- drivers/base/regmap/regcache-maple.c | 2 +- drivers/base/regmap/regcache-rbtree.c | 4 +- drivers/base/regmap/regcache.c | 3 +- drivers/base/regmap/regmap-debugfs.c | 4 +- drivers/base/regmap/regmap-irq.c | 2 +- drivers/base/regmap/regmap-kunit.c | 4 +- drivers/base/regmap/regmap-mmio.c | 2 +- drivers/base/regmap/regmap-ram.c | 6 +- drivers/base/regmap/regmap-raw-ram.c | 6 +- drivers/base/regmap/regmap-spi-avmm.c | 2 +- drivers/base/regmap/regmap-spi.c | 2 +- drivers/base/regmap/regmap.c | 8 +- drivers/base/soc.c | 4 +- drivers/base/swnode.c | 6 +- drivers/bcma/driver_pci_host.c | 2 +- drivers/bcma/host_pci.c | 2 +- drivers/bcma/scan.c | 2 +- drivers/block/aoe/aoecmd.c | 12 +-- drivers/block/aoe/aoedev.c | 4 +- drivers/block/brd.c | 2 +- drivers/block/drbd/drbd_bitmap.c | 4 +- drivers/block/drbd/drbd_main.c | 10 +- drivers/block/drbd/drbd_nl.c | 12 +-- drivers/block/drbd/drbd_receiver.c | 17 ++-- drivers/block/drbd/drbd_state.c | 4 +- drivers/block/drbd/drbd_worker.c | 4 +- drivers/block/loop.c | 7 +- drivers/block/nbd.c | 12 +-- drivers/block/null_blk/main.c | 7 +- drivers/block/null_blk/zoned.c | 4 +- drivers/block/ps3disk.c | 2 +- drivers/block/ps3vram.c | 7 +- drivers/block/rbd.c | 20 ++-- drivers/block/rnbd/rnbd-clt-sysfs.c | 2 +- drivers/block/rnbd/rnbd-clt.c | 13 ++- drivers/block/rnbd/rnbd-srv.c | 8 +- drivers/block/sunvdc.c | 2 +- drivers/block/swim.c | 2 +- drivers/block/ublk_drv.c | 4 +- drivers/block/virtio_blk.c | 10 +- drivers/block/xen-blkback/blkback.c | 4 +- drivers/block/xen-blkback/xenbus.c | 16 ++-- drivers/block/xen-blkfront.c | 20 ++-- drivers/block/z2ram.c | 4 +- drivers/block/zloop.c | 4 +- drivers/block/zram/backend_deflate.c | 2 +- drivers/block/zram/backend_lz4.c | 6 +- drivers/block/zram/backend_lz4hc.c | 6 +- drivers/block/zram/backend_zstd.c | 4 +- drivers/block/zram/zcomp.c | 2 +- drivers/block/zram/zram_drv.c | 12 +-- drivers/bluetooth/bpa10x.c | 2 +- drivers/bluetooth/btintel.c | 2 +- drivers/bluetooth/btintel_pcie.c | 8 +- drivers/bluetooth/btmrvl_debugfs.c | 2 +- drivers/bluetooth/btmrvl_main.c | 4 +- drivers/bluetooth/btmtk.c | 2 +- drivers/bluetooth/btrsi.c | 2 +- drivers/bluetooth/btrtl.c | 6 +- drivers/bluetooth/btusb.c | 4 +- drivers/bluetooth/hci_ag6xx.c | 2 +- drivers/bluetooth/hci_aml.c | 2 +- drivers/bluetooth/hci_ath.c | 2 +- drivers/bluetooth/hci_bcm.c | 2 +- drivers/bluetooth/hci_bcsp.c | 2 +- drivers/bluetooth/hci_h4.c | 2 +- drivers/bluetooth/hci_h5.c | 4 +- drivers/bluetooth/hci_intel.c | 2 +- drivers/bluetooth/hci_ldisc.c | 2 +- drivers/bluetooth/hci_ll.c | 2 +- drivers/bluetooth/hci_mrvl.c | 2 +- drivers/bluetooth/hci_qca.c | 4 +- drivers/bluetooth/hci_vhci.c | 2 +- drivers/bluetooth/virtio_bt.c | 2 +- drivers/bus/arm-cci.c | 2 +- drivers/bus/fsl-mc/fsl-mc-bus.c | 7 +- drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +- drivers/bus/mhi/ep/main.c | 16 ++-- drivers/bus/mhi/ep/ring.c | 3 +- drivers/bus/mhi/host/boot.c | 10 +- drivers/bus/mhi/host/init.c | 14 +-- drivers/bus/mhi/host/pm.c | 2 +- drivers/bus/mips_cdmm.c | 4 +- drivers/bus/moxtet.c | 2 +- drivers/bus/omap_l3_smx.c | 2 +- drivers/bus/stm32_firewall.c | 2 +- drivers/bus/sunxi-rsb.c | 4 +- drivers/bus/ti-sysc.c | 8 +- drivers/bus/vexpress-config.c | 2 +- drivers/cdrom/cdrom.c | 8 +- drivers/cdrom/gdrom.c | 14 +-- drivers/cdx/cdx.c | 4 +- drivers/cdx/controller/cdx_controller.c | 4 +- drivers/cdx/controller/mcdi.c | 6 +- drivers/char/agp/amd-k7-agp.c | 5 +- drivers/char/agp/ati-agp.c | 5 +- drivers/char/agp/backend.c | 2 +- drivers/char/agp/generic.c | 4 +- drivers/char/agp/isoch.c | 6 +- drivers/char/agp/sworks-agp.c | 6 +- drivers/char/agp/uninorth-agp.c | 5 +- drivers/char/apm-emulation.c | 2 +- drivers/char/bsr.c | 3 +- drivers/char/hpet.c | 3 +- drivers/char/hw_random/amd-rng.c | 2 +- drivers/char/hw_random/geode-rng.c | 2 +- drivers/char/hw_random/intel-rng.c | 2 +- drivers/char/hw_random/virtio-rng.c | 2 +- drivers/char/ipmi/ipmb_dev_int.c | 2 +- drivers/char/ipmi/ipmi_devintf.c | 4 +- drivers/char/ipmi/ipmi_dmi.c | 2 +- drivers/char/ipmi/ipmi_msghandler.c | 16 ++-- drivers/char/ipmi/ipmi_si_intf.c | 2 +- drivers/char/ipmi/ipmi_ssif.c | 6 +- drivers/char/ipmi/kcs_bmc_serio.c | 2 +- drivers/char/powernv-op-panel.c | 2 +- drivers/char/ppdev.c | 2 +- drivers/char/ps3flash.c | 2 +- drivers/char/random.c | 2 +- drivers/char/tlclk.c | 2 +- drivers/char/tpm/tpm-chip.c | 2 +- drivers/char/tpm/tpm-dev.c | 2 +- drivers/char/tpm/tpm2-sessions.c | 2 +- drivers/char/tpm/tpm_crb_ffa.c | 2 +- drivers/char/tpm/tpm_ibmvtpm.c | 2 +- drivers/char/tpm/tpm_vtpm_proxy.c | 2 +- drivers/char/tpm/tpmrm-dev.c | 2 +- drivers/char/tpm/xen-tpmfront.c | 2 +- drivers/char/virtio_console.c | 15 ++- drivers/char/xillybus/xillybus_class.c | 2 +- drivers/char/xillybus/xillybus_core.c | 2 +- drivers/char/xillybus/xillyusb.c | 10 +- drivers/clk/aspeed/clk-aspeed.c | 7 +- drivers/clk/aspeed/clk-ast2600.c | 6 +- drivers/clk/aspeed/clk-ast2700.c | 2 +- drivers/clk/at91/clk-audio-pll.c | 6 +- drivers/clk/at91/clk-generated.c | 2 +- drivers/clk/at91/clk-h32mx.c | 2 +- drivers/clk/at91/clk-i2s-mux.c | 2 +- drivers/clk/at91/clk-main.c | 8 +- drivers/clk/at91/clk-master.c | 4 +- drivers/clk/at91/clk-peripheral.c | 4 +- drivers/clk/at91/clk-pll.c | 2 +- drivers/clk/at91/clk-plldiv.c | 2 +- drivers/clk/at91/clk-programmable.c | 2 +- drivers/clk/at91/clk-sam9x60-pll.c | 4 +- drivers/clk/at91/clk-slow.c | 2 +- drivers/clk/at91/clk-smd.c | 2 +- drivers/clk/at91/clk-system.c | 2 +- drivers/clk/at91/clk-usb.c | 6 +- drivers/clk/at91/clk-utmi.c | 2 +- drivers/clk/at91/dt-compat.c | 6 +- drivers/clk/at91/pmc.c | 3 +- drivers/clk/at91/sckc.c | 10 +- drivers/clk/axis/clk-artpec6.c | 2 +- drivers/clk/axs10x/pll_clock.c | 2 +- drivers/clk/baikal-t1/ccu-div.c | 8 +- drivers/clk/baikal-t1/ccu-pll.c | 6 +- drivers/clk/baikal-t1/ccu-rst.c | 2 +- drivers/clk/baikal-t1/clk-ccu-div.c | 4 +- drivers/clk/baikal-t1/clk-ccu-pll.c | 2 +- drivers/clk/bcm/clk-bcm2835.c | 2 +- drivers/clk/bcm/clk-bcm53573-ilp.c | 2 +- drivers/clk/bcm/clk-iproc-armpll.c | 2 +- drivers/clk/bcm/clk-iproc-asiu.c | 8 +- drivers/clk/bcm/clk-iproc-pll.c | 6 +- drivers/clk/berlin/berlin2-avpll.c | 4 +- drivers/clk/berlin/berlin2-div.c | 2 +- drivers/clk/berlin/berlin2-pll.c | 2 +- drivers/clk/berlin/bg2.c | 2 +- drivers/clk/berlin/bg2q.c | 2 +- drivers/clk/clk-asm9260.c | 2 +- drivers/clk/clk-bm1880.c | 6 +- drivers/clk/clk-bulk.c | 2 +- drivers/clk/clk-clps711x.c | 5 +- drivers/clk/clk-composite.c | 2 +- drivers/clk/clk-divider.c | 2 +- drivers/clk/clk-eyeq.c | 6 +- drivers/clk/clk-fixed-factor.c | 2 +- drivers/clk/clk-fixed-rate.c | 2 +- drivers/clk/clk-fractional-divider.c | 2 +- drivers/clk/clk-gate.c | 2 +- drivers/clk/clk-gemini.c | 7 +- drivers/clk/clk-highbank.c | 2 +- drivers/clk/clk-hsdk-pll.c | 2 +- drivers/clk/clk-k210.c | 2 +- drivers/clk/clk-milbeaut.c | 9 +- drivers/clk/clk-mux.c | 2 +- drivers/clk/clk-nomadik.c | 4 +- drivers/clk/clk-npcm7xx.c | 6 +- drivers/clk/clk-qoriq.c | 8 +- drivers/clk/clk-stm32f4.c | 20 ++-- drivers/clk/clk-stm32h7.c | 15 ++- drivers/clk/clk-vt8500.c | 4 +- drivers/clk/clk-xgene.c | 6 +- drivers/clk/clk.c | 14 +-- drivers/clk/clkdev.c | 2 +- drivers/clk/davinci/pll.c | 24 ++--- drivers/clk/davinci/psc.c | 8 +- drivers/clk/hisilicon/clk-hi3620.c | 6 +- drivers/clk/hisilicon/clk-hix5hd2.c | 2 +- drivers/clk/hisilicon/clk.c | 4 +- drivers/clk/hisilicon/clkdivider-hi6220.c | 4 +- drivers/clk/hisilicon/clkgate-separated.c | 2 +- drivers/clk/imgtec/clk-boston.c | 3 +- drivers/clk/imx/clk-busy.c | 4 +- drivers/clk/imx/clk-composite-7ulp.c | 6 +- drivers/clk/imx/clk-composite-8m.c | 6 +- drivers/clk/imx/clk-composite-93.c | 6 +- drivers/clk/imx/clk-cpu.c | 2 +- drivers/clk/imx/clk-divider-gate.c | 2 +- drivers/clk/imx/clk-fixup-div.c | 2 +- drivers/clk/imx/clk-fixup-mux.c | 2 +- drivers/clk/imx/clk-frac-pll.c | 2 +- drivers/clk/imx/clk-fracn-gppll.c | 2 +- drivers/clk/imx/clk-gate-93.c | 2 +- drivers/clk/imx/clk-gate-exclusive.c | 2 +- drivers/clk/imx/clk-gate2.c | 2 +- drivers/clk/imx/clk-gpr-mux.c | 2 +- drivers/clk/imx/clk-imx6q.c | 4 +- drivers/clk/imx/clk-imx6sl.c | 4 +- drivers/clk/imx/clk-imx6sll.c | 4 +- drivers/clk/imx/clk-imx6sx.c | 4 +- drivers/clk/imx/clk-imx6ul.c | 4 +- drivers/clk/imx/clk-imx7d.c | 3 +- drivers/clk/imx/clk-imx7ulp.c | 16 ++-- drivers/clk/imx/clk-imx8mm.c | 4 +- drivers/clk/imx/clk-lpcg-scu.c | 2 +- drivers/clk/imx/clk-pfd.c | 2 +- drivers/clk/imx/clk-pfdv2.c | 2 +- drivers/clk/imx/clk-pll14xx.c | 2 +- drivers/clk/imx/clk-pllv1.c | 2 +- drivers/clk/imx/clk-pllv2.c | 2 +- drivers/clk/imx/clk-pllv3.c | 2 +- drivers/clk/imx/clk-pllv4.c | 2 +- drivers/clk/imx/clk-scu.c | 6 +- drivers/clk/imx/clk-sscg-pll.c | 2 +- drivers/clk/imx/clk.c | 2 +- drivers/clk/ingenic/cgu.c | 8 +- drivers/clk/ingenic/tcu.c | 7 +- drivers/clk/keystone/gate.c | 4 +- drivers/clk/keystone/pll.c | 4 +- drivers/clk/mediatek/clk-apmixed.c | 2 +- drivers/clk/mediatek/clk-cpumux.c | 2 +- drivers/clk/mediatek/clk-gate.c | 2 +- drivers/clk/mediatek/clk-mtk.c | 8 +- drivers/clk/mediatek/clk-mux.c | 2 +- drivers/clk/mediatek/clk-pll.c | 2 +- drivers/clk/mediatek/clk-pllfh.c | 2 +- drivers/clk/meson/meson8b.c | 2 +- drivers/clk/mmp/clk-apbc.c | 2 +- drivers/clk/mmp/clk-apmu.c | 2 +- drivers/clk/mmp/clk-frac.c | 2 +- drivers/clk/mmp/clk-gate.c | 2 +- drivers/clk/mmp/clk-mix.c | 2 +- drivers/clk/mmp/clk-of-mmp2.c | 4 +- drivers/clk/mmp/clk-of-pxa168.c | 4 +- drivers/clk/mmp/clk-of-pxa1928.c | 8 +- drivers/clk/mmp/clk-of-pxa910.c | 4 +- drivers/clk/mmp/clk-pll.c | 2 +- drivers/clk/mmp/clk.c | 2 +- drivers/clk/mmp/pwr-island.c | 2 +- drivers/clk/mmp/reset.c | 2 +- drivers/clk/mvebu/clk-corediv.c | 6 +- drivers/clk/mvebu/clk-cpu.c | 4 +- drivers/clk/mvebu/common.c | 9 +- drivers/clk/mvebu/cp110-system-controller.c | 2 +- drivers/clk/mvebu/kirkwood.c | 5 +- drivers/clk/mxs/clk-div.c | 2 +- drivers/clk/mxs/clk-frac.c | 2 +- drivers/clk/mxs/clk-pll.c | 2 +- drivers/clk/mxs/clk-ref.c | 2 +- drivers/clk/nxp/clk-lpc18xx-ccu.c | 4 +- drivers/clk/pistachio/clk-pll.c | 2 +- drivers/clk/pistachio/clk.c | 4 +- drivers/clk/pxa/clk-pxa.c | 2 +- drivers/clk/qcom/clk-rcg2.c | 2 +- drivers/clk/ralink/clk-mt7621.c | 4 +- drivers/clk/ralink/clk-mtmips.c | 4 +- drivers/clk/renesas/clk-div6.c | 2 +- drivers/clk/renesas/clk-mstp.c | 6 +- drivers/clk/renesas/clk-r8a73a4.c | 4 +- drivers/clk/renesas/clk-r8a7740.c | 4 +- drivers/clk/renesas/clk-r8a7778.c | 4 +- drivers/clk/renesas/clk-r8a7779.c | 4 +- drivers/clk/renesas/clk-rz.c | 4 +- drivers/clk/renesas/clk-sh73a0.c | 4 +- drivers/clk/renesas/r9a06g032-clocks.c | 8 +- drivers/clk/renesas/rcar-cpg-lib.c | 6 +- drivers/clk/renesas/rcar-gen2-cpg.c | 10 +- drivers/clk/renesas/rcar-gen3-cpg.c | 6 +- drivers/clk/renesas/rcar-gen4-cpg.c | 4 +- drivers/clk/renesas/renesas-cpg-mssr.c | 4 +- drivers/clk/rockchip/clk-cpu.c | 8 +- drivers/clk/rockchip/clk-ddr.c | 2 +- drivers/clk/rockchip/clk-gate-grf.c | 2 +- drivers/clk/rockchip/clk-half-divider.c | 6 +- drivers/clk/rockchip/clk-inverter.c | 2 +- drivers/clk/rockchip/clk-mmc-phase.c | 2 +- drivers/clk/rockchip/clk-muxgrf.c | 2 +- drivers/clk/rockchip/clk-pll.c | 2 +- drivers/clk/rockchip/clk-rk3576.c | 4 +- drivers/clk/rockchip/clk.c | 16 ++-- drivers/clk/rockchip/softrst.c | 2 +- drivers/clk/samsung/clk-cpu.c | 2 +- drivers/clk/samsung/clk-pll.c | 2 +- drivers/clk/samsung/clk.c | 9 +- drivers/clk/socfpga/clk-gate-a10.c | 2 +- drivers/clk/socfpga/clk-gate-s10.c | 6 +- drivers/clk/socfpga/clk-gate.c | 2 +- drivers/clk/socfpga/clk-periph-a10.c | 2 +- drivers/clk/socfpga/clk-periph-s10.c | 8 +- drivers/clk/socfpga/clk-periph.c | 2 +- drivers/clk/socfpga/clk-pll-a10.c | 2 +- drivers/clk/socfpga/clk-pll-s10.c | 8 +- drivers/clk/socfpga/clk-pll.c | 2 +- drivers/clk/spacemit/ccu_common.c | 2 +- drivers/clk/spear/clk-aux-synth.c | 2 +- drivers/clk/spear/clk-frac-synth.c | 2 +- drivers/clk/spear/clk-gpt-synth.c | 2 +- drivers/clk/spear/clk-vco-pll.c | 4 +- drivers/clk/sprd/pll.c | 2 +- drivers/clk/st/clk-flexgen.c | 10 +- drivers/clk/st/clkgen-fsyn.c | 11 +-- drivers/clk/st/clkgen-pll.c | 12 +-- drivers/clk/starfive/clk-starfive-jh7110-sys.c | 2 +- drivers/clk/stm32/reset-stm32.c | 2 +- drivers/clk/sunxi-ng/ccu_common.c | 2 +- drivers/clk/sunxi/clk-a10-hosc.c | 4 +- drivers/clk/sunxi/clk-a10-mod1.c | 4 +- drivers/clk/sunxi/clk-a10-pll2.c | 8 +- drivers/clk/sunxi/clk-a10-ve.c | 6 +- drivers/clk/sunxi/clk-a20-gmac.c | 4 +- drivers/clk/sunxi/clk-factors.c | 6 +- drivers/clk/sunxi/clk-mod0.c | 6 +- drivers/clk/sunxi/clk-simple-gates.c | 4 +- drivers/clk/sunxi/clk-sun4i-display.c | 8 +- drivers/clk/sunxi/clk-sun4i-pll3.c | 4 +- drivers/clk/sunxi/clk-sun4i-tcon-ch1.c | 2 +- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 4 +- drivers/clk/sunxi/clk-sun8i-mbus.c | 6 +- drivers/clk/sunxi/clk-sun9i-cpus.c | 4 +- drivers/clk/sunxi/clk-sunxi.c | 10 +- drivers/clk/sunxi/clk-usb.c | 6 +- drivers/clk/tegra/clk-audio-sync.c | 2 +- drivers/clk/tegra/clk-bpmp.c | 2 +- drivers/clk/tegra/clk-divider.c | 2 +- drivers/clk/tegra/clk-periph-fixed.c | 2 +- drivers/clk/tegra/clk-periph-gate.c | 2 +- drivers/clk/tegra/clk-pll-out.c | 2 +- drivers/clk/tegra/clk-pll.c | 2 +- drivers/clk/tegra/clk-sdmmc-mux.c | 2 +- drivers/clk/tegra/clk-super.c | 4 +- drivers/clk/tegra/clk-tegra-super-cclk.c | 2 +- drivers/clk/tegra/clk-tegra124-emc.c | 2 +- drivers/clk/tegra/clk-tegra20-emc.c | 2 +- drivers/clk/tegra/clk-tegra210-emc.c | 2 +- drivers/clk/tegra/clk-tegra210.c | 3 +- drivers/clk/tegra/clk.c | 7 +- drivers/clk/ti/apll.c | 12 +-- drivers/clk/ti/autoidle.c | 2 +- drivers/clk/ti/clk-dra7-atl.c | 2 +- drivers/clk/ti/clk.c | 6 +- drivers/clk/ti/clkctrl.c | 14 +-- drivers/clk/ti/composite.c | 4 +- drivers/clk/ti/divider.c | 8 +- drivers/clk/ti/dpll.c | 6 +- drivers/clk/ti/fapll.c | 8 +- drivers/clk/ti/gate.c | 4 +- drivers/clk/ti/interface.c | 2 +- drivers/clk/ti/mux.c | 6 +- drivers/clk/ux500/clk-prcc.c | 2 +- drivers/clk/ux500/clk-prcmu.c | 4 +- drivers/clk/ux500/u8500_of_clk.c | 2 +- drivers/clk/versatile/clk-icst.c | 2 +- drivers/clk/versatile/clk-sp810.c | 2 +- drivers/clk/visconti/pll.c | 4 +- drivers/clk/zynq/clkc.c | 6 +- drivers/clk/zynq/pll.c | 2 +- drivers/clk/zynqmp/clk-gate-zynqmp.c | 2 +- drivers/clk/zynqmp/clk-mux-zynqmp.c | 2 +- drivers/clk/zynqmp/clkc.c | 5 +- drivers/clk/zynqmp/divider.c | 2 +- drivers/clk/zynqmp/pll.c | 2 +- drivers/clocksource/bcm2835_timer.c | 2 +- drivers/clocksource/clps711x-timer.c | 2 +- drivers/clocksource/dw_apb_timer.c | 6 +- drivers/clocksource/ingenic-sysost.c | 8 +- drivers/clocksource/ingenic-timer.c | 3 +- drivers/clocksource/mmio.c | 2 +- drivers/clocksource/mps2-timer.c | 2 +- drivers/clocksource/renesas-ostm.c | 2 +- drivers/clocksource/sh_cmt.c | 6 +- drivers/clocksource/sh_mtu2.c | 6 +- drivers/clocksource/sh_tmu.c | 6 +- drivers/clocksource/timer-atmel-pit.c | 2 +- drivers/clocksource/timer-cadence-ttc.c | 4 +- drivers/clocksource/timer-davinci.c | 2 +- drivers/clocksource/timer-ep93xx.c | 2 +- drivers/clocksource/timer-fsl-ftm.c | 2 +- drivers/clocksource/timer-fttmr010.c | 2 +- drivers/clocksource/timer-goldfish.c | 2 +- drivers/clocksource/timer-gxp.c | 2 +- drivers/clocksource/timer-imx-gpt.c | 2 +- drivers/clocksource/timer-imx-sysctr.c | 2 +- drivers/clocksource/timer-ixp4xx.c | 2 +- drivers/clocksource/timer-microchip-pit64b.c | 4 +- drivers/clocksource/timer-msc313e.c | 2 +- drivers/clocksource/timer-nxp-pit.c | 2 +- drivers/clocksource/timer-rockchip.c | 4 +- drivers/clocksource/timer-stm32.c | 5 +- drivers/clocksource/timer-ti-dm-systimer.c | 4 +- drivers/clocksource/timer-zevio.c | 2 +- drivers/comedi/comedi_buf.c | 2 +- drivers/comedi/comedi_fops.c | 8 +- drivers/comedi/drivers.c | 4 +- drivers/comedi/drivers/addi_apci_2032.c | 2 +- drivers/comedi/drivers/comedi_8254.c | 2 +- drivers/comedi/drivers/comedi_bond.c | 2 +- drivers/comedi/drivers/comedi_isadma.c | 4 +- drivers/comedi/drivers/dt9812.c | 4 +- drivers/comedi/drivers/mite.c | 4 +- drivers/comedi/drivers/ni_670x.c | 5 +- drivers/comedi/drivers/ni_tio.c | 9 +- drivers/comedi/drivers/usbduxsigma.c | 4 +- drivers/connector/cn_proc.c | 4 +- drivers/connector/cn_queue.c | 4 +- drivers/counter/counter-chrdev.c | 4 +- drivers/cpufreq/acpi-cpufreq.c | 6 +- drivers/cpufreq/amd-pstate.c | 4 +- drivers/cpufreq/apple-soc-cpufreq.c | 2 +- drivers/cpufreq/armada-37xx-cpufreq.c | 4 +- drivers/cpufreq/armada-8k-cpufreq.c | 2 +- drivers/cpufreq/bmips-cpufreq.c | 2 +- drivers/cpufreq/cppc_cpufreq.c | 2 +- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/cpufreq_conservative.c | 4 +- drivers/cpufreq/cpufreq_governor.c | 2 +- drivers/cpufreq/cpufreq_ondemand.c | 4 +- drivers/cpufreq/cpufreq_stats.c | 2 +- drivers/cpufreq/cpufreq_userspace.c | 2 +- drivers/cpufreq/e_powersaver.c | 6 +- drivers/cpufreq/gx-suspmod.c | 2 +- drivers/cpufreq/intel_pstate.c | 4 +- drivers/cpufreq/longhaul.c | 4 +- drivers/cpufreq/powernow-k7.c | 2 +- drivers/cpufreq/powernow-k8.c | 2 +- drivers/cpufreq/powernv-cpufreq.c | 8 +- drivers/cpufreq/pxa3xx-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- drivers/cpufreq/qoriq-cpufreq.c | 6 +- drivers/cpufreq/scmi-cpufreq.c | 2 +- drivers/cpufreq/scpi-cpufreq.c | 2 +- drivers/cpufreq/sparc-us2e-cpufreq.c | 4 +- drivers/cpufreq/sparc-us3-cpufreq.c | 4 +- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 3 +- drivers/cpufreq/tegra186-cpufreq.c | 2 +- drivers/cpufreq/tegra194-cpufreq.c | 2 +- drivers/cpufreq/vexpress-spc-cpufreq.c | 2 +- drivers/cpufreq/virtual-cpufreq.c | 2 +- drivers/cpuidle/coupled.c | 2 +- drivers/cpuidle/cpuidle-psci-domain.c | 2 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_genpd.c | 2 +- drivers/cpuidle/sysfs.c | 6 +- drivers/crypto/amcc/crypto4xx_core.c | 6 +- drivers/crypto/amcc/crypto4xx_trng.c | 2 +- drivers/crypto/atmel-ecc.c | 4 +- drivers/crypto/atmel-i2c.c | 2 +- drivers/crypto/atmel-sha.c | 2 +- drivers/crypto/atmel-sha204a.c | 2 +- drivers/crypto/bcm/cipher.c | 18 ++-- drivers/crypto/caam/caamalg_qi2.c | 6 +- drivers/crypto/caam/caamhash.c | 4 +- drivers/crypto/caam/qi.c | 6 +- drivers/crypto/cavium/cpt/cptvf_main.c | 6 +- drivers/crypto/cavium/cpt/cptvf_reqmanager.c | 2 +- drivers/crypto/cavium/nitrox/nitrox_isr.c | 4 +- drivers/crypto/cavium/nitrox/nitrox_lib.c | 2 +- drivers/crypto/cavium/nitrox/nitrox_main.c | 2 +- drivers/crypto/cavium/nitrox/nitrox_mbx.c | 8 +- drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-galois.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes.c | 2 +- drivers/crypto/ccp/ccp-crypto-des3.c | 2 +- drivers/crypto/ccp/ccp-crypto-main.c | 2 +- drivers/crypto/ccp/ccp-crypto-rsa.c | 2 +- drivers/crypto/ccp/ccp-crypto-sha.c | 4 +- drivers/crypto/ccp/ccp-ops.c | 2 +- drivers/crypto/ccp/hsti.c | 2 +- drivers/crypto/ccp/sev-dev-tio.c | 2 +- drivers/crypto/ccp/sev-dev-tsm.c | 4 +- drivers/crypto/ccp/sev-dev.c | 4 +- drivers/crypto/ccp/sfs.c | 2 +- drivers/crypto/ccp/tee-dev.c | 2 +- drivers/crypto/ccree/cc_request_mgr.c | 4 +- drivers/crypto/chelsio/chcr_core.c | 2 +- drivers/crypto/hifn_795x.c | 2 +- drivers/crypto/hisilicon/debugfs.c | 2 +- drivers/crypto/hisilicon/qm.c | 12 ++- drivers/crypto/hisilicon/sec/sec_algs.c | 8 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 8 +- drivers/crypto/hisilicon/sec2/sec_main.c | 2 +- drivers/crypto/hisilicon/sgl.c | 2 +- drivers/crypto/hisilicon/zip/zip_crypto.c | 4 +- drivers/crypto/inside-secure/eip93/eip93-aead.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-cipher.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-common.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-hash.c | 2 +- drivers/crypto/inside-secure/safexcel.c | 2 +- drivers/crypto/inside-secure/safexcel_hash.c | 2 +- drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 +- drivers/crypto/intel/keembay/ocs-hcu.c | 2 +- .../crypto/intel/qat/qat_common/adf_accel_engine.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_aer.c | 4 +- drivers/crypto/intel/qat/qat_common/adf_cfg.c | 6 +- drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c | 4 +- .../crypto/intel/qat/qat_common/adf_fw_counters.c | 3 +- drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c | 2 +- .../crypto/intel/qat/qat_common/adf_gen4_vf_mig.c | 2 +- .../crypto/intel/qat/qat_common/adf_heartbeat.c | 2 +- .../crypto/intel/qat/qat_common/adf_mstate_mgr.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_rl.c | 4 +- drivers/crypto/intel/qat/qat_common/adf_sriov.c | 6 +- .../crypto/intel/qat/qat_common/adf_telemetry.c | 5 +- drivers/crypto/intel/qat/qat_common/adf_timer.c | 2 +- .../intel/qat/qat_common/adf_transport_debug.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_vf_isr.c | 2 +- drivers/crypto/intel/qat/qat_common/qat_hal.c | 6 +- drivers/crypto/intel/qat/qat_common/qat_mig_dev.c | 2 +- drivers/crypto/intel/qat/qat_common/qat_uclo.c | 30 +++--- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 4 +- drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 6 +- drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 4 +- .../crypto/marvell/octeontx2/otx2_cptpf_ucode.c | 2 +- drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 2 +- drivers/crypto/nx/nx-842.c | 2 +- drivers/crypto/nx/nx-common-powernv.c | 4 +- drivers/crypto/nx/nx-common-pseries.c | 13 ++- drivers/crypto/omap-crypto.c | 2 +- drivers/crypto/omap-sham.c | 2 +- drivers/crypto/qce/aead.c | 2 +- drivers/crypto/qce/sha.c | 2 +- drivers/crypto/qce/skcipher.c | 2 +- drivers/crypto/s5p-sss.c | 4 +- drivers/crypto/sa2ul.c | 2 +- drivers/crypto/stm32/stm32-cryp.c | 3 +- drivers/crypto/tegra/tegra-se-main.c | 6 +- .../crypto/virtio/virtio_crypto_akcipher_algs.c | 4 +- drivers/crypto/virtio/virtio_crypto_core.c | 8 +- .../crypto/virtio/virtio_crypto_skcipher_algs.c | 4 +- drivers/cxl/acpi.c | 4 +- drivers/cxl/core/cdat.c | 18 ++-- drivers/cxl/core/edac.c | 3 +- drivers/cxl/core/features.c | 4 +- drivers/cxl/core/memdev.c | 4 +- drivers/cxl/core/pmem.c | 4 +- drivers/cxl/core/pmu.c | 2 +- drivers/cxl/core/port.c | 15 ++- drivers/cxl/core/region.c | 10 +- drivers/cxl/pmem.c | 4 +- drivers/dax/bus.c | 8 +- drivers/dax/kmem.c | 2 +- drivers/dca/dca-core.c | 2 +- drivers/devfreq/devfreq-event.c | 2 +- drivers/devfreq/devfreq.c | 2 +- drivers/devfreq/governor_passive.c | 3 +- drivers/devfreq/governor_userspace.c | 4 +- drivers/dibs/dibs_loopback.c | 4 +- drivers/dibs/dibs_main.c | 2 +- drivers/dio/dio.c | 2 +- drivers/dma-buf/dma-buf-mapping.c | 4 +- drivers/dma-buf/dma-buf.c | 4 +- drivers/dma-buf/dma-fence-array.c | 2 +- drivers/dma-buf/dma-fence-unwrap.c | 2 +- drivers/dma-buf/dma-fence.c | 4 +- drivers/dma-buf/dma-heap.c | 2 +- drivers/dma-buf/heaps/cma_heap.c | 8 +- drivers/dma-buf/heaps/system_heap.c | 4 +- drivers/dma-buf/st-dma-fence-chain.c | 8 +- drivers/dma-buf/st-dma-fence-unwrap.c | 4 +- drivers/dma-buf/st-dma-resv.c | 2 +- drivers/dma-buf/sw_sync.c | 4 +- drivers/dma-buf/sync_file.c | 2 +- drivers/dma-buf/udmabuf.c | 13 ++- drivers/dma/acpi-dma.c | 2 +- drivers/dma/altera-msgdma.c | 2 +- drivers/dma/amba-pl08x.c | 16 ++-- drivers/dma/amd/qdma/qdma.c | 2 +- drivers/dma/apple-admac.c | 2 +- drivers/dma/arm-dma350.c | 4 +- drivers/dma/at_hdmac.c | 14 +-- drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/bestcomm/bestcomm.c | 2 +- drivers/dma/bestcomm/sram.c | 2 +- drivers/dma/dma-axi-dmac.c | 2 +- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dmaengine.c | 2 +- drivers/dma/dmatest.c | 8 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +- drivers/dma/dw-edma/dw-edma-core.c | 6 +- drivers/dma/dw-edma/dw-edma-pcie.c | 2 +- drivers/dma/dw/rzn1-dmamux.c | 2 +- drivers/dma/ep93xx_dma.c | 2 +- drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 8 +- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-qdma.c | 2 +- drivers/dma/fsl_raid.c | 4 +- drivers/dma/fsldma.c | 4 +- drivers/dma/hisi_dma.c | 2 +- drivers/dma/hsu/hsu.c | 4 +- drivers/dma/idma64.c | 4 +- drivers/dma/idxd/cdev.c | 4 +- drivers/dma/idxd/irq.c | 4 +- drivers/dma/idxd/perfmon.c | 4 +- drivers/dma/img-mdc-dma.c | 6 +- drivers/dma/imx-dma.c | 6 +- drivers/dma/imx-sdma.c | 4 +- drivers/dma/ioat/dma.c | 2 +- drivers/dma/ioat/init.c | 4 +- drivers/dma/k3dma.c | 2 +- drivers/dma/lgm/lgm-dma.c | 4 +- drivers/dma/loongson1-apb-dma.c | 4 +- drivers/dma/loongson2-apb-dma.c | 4 +- drivers/dma/mediatek/mtk-cqdma.c | 4 +- drivers/dma/mediatek/mtk-hsdma.c | 4 +- drivers/dma/mediatek/mtk-uart-apdma.c | 2 +- drivers/dma/milbeaut-hdmac.c | 4 +- drivers/dma/milbeaut-xdmac.c | 2 +- drivers/dma/moxart-dma.c | 2 +- drivers/dma/mpc512x_dma.c | 2 +- drivers/dma/mv_xor.c | 2 +- drivers/dma/of-dma.c | 4 +- drivers/dma/owl-dma.c | 6 +- drivers/dma/pch_dma.c | 2 +- drivers/dma/pl330.c | 7 +- drivers/dma/plx_dma.c | 8 +- drivers/dma/ppc4xx/adma.c | 9 +- drivers/dma/pxa_dma.c | 6 +- drivers/dma/qcom/bam_dma.c | 3 +- drivers/dma/qcom/gpi.c | 2 +- drivers/dma/qcom/hidma.c | 2 +- drivers/dma/qcom/qcom_adm.c | 2 +- drivers/dma/sa11x0-dma.c | 8 +- drivers/dma/sf-pdma/sf-pdma.c | 2 +- drivers/dma/sh/rcar-dmac.c | 2 +- drivers/dma/sh/rz-dmac.c | 2 +- drivers/dma/sh/shdma-base.c | 4 +- drivers/dma/sh/usb-dmac.c | 2 +- drivers/dma/sprd-dma.c | 4 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/ste_dma40.c | 2 +- drivers/dma/stm32/stm32-dma.c | 6 +- drivers/dma/stm32/stm32-dma3.c | 2 +- drivers/dma/stm32/stm32-dmamux.c | 2 +- drivers/dma/stm32/stm32-mdma.c | 2 +- drivers/dma/sun4i-dma.c | 6 +- drivers/dma/sun6i-dma.c | 6 +- drivers/dma/tegra186-gpc-dma.c | 9 +- drivers/dma/tegra20-apb-dma.c | 4 +- drivers/dma/tegra210-adma.c | 2 +- drivers/dma/ti/dma-crossbar.c | 6 +- drivers/dma/ti/edma.c | 8 +- drivers/dma/ti/k3-udma.c | 10 +- drivers/dma/ti/omap-dma.c | 4 +- drivers/dma/timb_dma.c | 5 +- drivers/dma/txx9dmac.c | 2 +- drivers/dma/uniphier-mdmac.c | 2 +- drivers/dma/uniphier-xdmac.c | 4 +- drivers/dma/xilinx/xdma.c | 6 +- drivers/dma/xilinx/xilinx_dma.c | 2 +- drivers/dma/xilinx/xilinx_dpdma.c | 2 +- drivers/dma/xilinx/zynqmp_dma.c | 4 +- drivers/dpll/dpll_core.c | 14 +-- drivers/dpll/zl3073x/dpll.c | 4 +- drivers/dpll/zl3073x/fw.c | 4 +- drivers/dpll/zl3073x/prop.c | 4 +- drivers/edac/amd64_edac.c | 12 +-- drivers/edac/edac_device.c | 18 ++-- drivers/edac/edac_mc.c | 18 ++-- drivers/edac/edac_mc_sysfs.c | 2 +- drivers/edac/edac_pci.c | 2 +- drivers/edac/edac_pci_sysfs.c | 2 +- drivers/edac/i7core_edac.c | 12 +-- drivers/edac/igen6_edac.c | 2 +- drivers/edac/imh_base.c | 4 +- drivers/edac/sb_edac.c | 7 +- drivers/edac/skx_common.c | 2 +- drivers/edac/versalnet_edac.c | 4 +- drivers/eisa/eisa-bus.c | 4 +- drivers/extcon/extcon-usbc-cros-ec.c | 2 +- drivers/extcon/extcon.c | 24 ++--- drivers/firewire/core-cdev.c | 20 ++-- drivers/firewire/core-device.c | 4 +- drivers/firewire/core-iso.c | 9 +- drivers/firewire/core-topology.c | 2 +- drivers/firewire/net.c | 6 +- drivers/firewire/nosy.c | 4 +- drivers/firewire/sbp2.c | 8 +- drivers/firmware/arm_ffa/bus.c | 2 +- drivers/firmware/arm_ffa/driver.c | 10 +- drivers/firmware/arm_scmi/bus.c | 6 +- drivers/firmware/arm_scmi/notify.c | 2 +- drivers/firmware/arm_scmi/raw_mode.c | 2 +- drivers/firmware/arm_scpi.c | 4 +- drivers/firmware/arm_sdei.c | 4 +- drivers/firmware/cirrus/cs_dsp.c | 4 +- drivers/firmware/dmi-id.c | 2 +- drivers/firmware/dmi-sysfs.c | 4 +- drivers/firmware/edd.c | 2 +- drivers/firmware/efi/apple-properties.c | 4 +- drivers/firmware/efi/arm-runtime.c | 2 +- drivers/firmware/efi/capsule-loader.c | 4 +- drivers/firmware/efi/capsule.c | 2 +- drivers/firmware/efi/efi.c | 2 +- drivers/firmware/efi/efibc.c | 2 +- drivers/firmware/efi/embedded-firmware.c | 2 +- drivers/firmware/efi/esrt.c | 2 +- drivers/firmware/efi/mokvar-table.c | 2 +- drivers/firmware/efi/riscv-runtime.c | 2 +- drivers/firmware/efi/test/efi_test.c | 4 +- drivers/firmware/google/gsmi.c | 2 +- drivers/firmware/google/vpd.c | 2 +- drivers/firmware/iscsi_ibft.c | 4 +- drivers/firmware/memmap.c | 2 +- drivers/firmware/microchip/mpfs-auto-update.c | 8 +- drivers/firmware/psci/psci_checker.c | 6 +- drivers/firmware/qcom/qcom_qseecom.c | 2 +- drivers/firmware/qcom/qcom_tzmem.c | 4 +- drivers/firmware/qemu_fw_cfg.c | 8 +- drivers/firmware/raspberrypi.c | 2 +- drivers/firmware/smccc/soc_id.c | 2 +- drivers/firmware/stratix10-svc.c | 8 +- drivers/firmware/thead,th1520-aon.c | 2 +- drivers/firmware/xilinx/zynqmp.c | 2 +- drivers/fpga/dfl-afu-dma-region.c | 2 +- drivers/fpga/dfl-pci.c | 2 +- drivers/fpga/dfl.c | 9 +- drivers/fpga/fpga-bridge.c | 2 +- drivers/fpga/fpga-mgr.c | 4 +- drivers/fpga/fpga-region.c | 2 +- drivers/fsi/fsi-core.c | 4 +- drivers/fsi/fsi-master-aspeed.c | 2 +- drivers/fsi/fsi-master-ast-cf.c | 2 +- drivers/fsi/fsi-master-gpio.c | 2 +- drivers/fsi/fsi-master-hub.c | 2 +- drivers/fsi/fsi-master-i2cr.c | 2 +- drivers/fsi/fsi-occ.c | 2 +- drivers/fsi/fsi-sbefifo.c | 4 +- drivers/fsi/fsi-scom.c | 2 +- drivers/fwctl/mlx5/main.c | 2 +- drivers/fwctl/pds/main.c | 2 +- drivers/gnss/core.c | 2 +- drivers/gnss/usb.c | 2 +- drivers/gpib/agilent_82350b/agilent_82350b.c | 3 +- drivers/gpib/agilent_82357a/agilent_82357a.c | 3 +- drivers/gpib/cb7210/cb7210.c | 4 +- drivers/gpib/cec/cec_gpib.c | 2 +- drivers/gpib/common/gpib_os.c | 15 +-- drivers/gpib/eastwood/fluke_gpib.c | 2 +- drivers/gpib/fmh_gpib/fmh_gpib.c | 2 +- drivers/gpib/gpio/gpib_bitbang.c | 2 +- drivers/gpib/hp_82335/hp82335.c | 2 +- drivers/gpib/hp_82341/hp_82341.c | 2 +- drivers/gpib/ines/ines_gpib.c | 4 +- drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 4 +- drivers/gpib/ni_usb/ni_usb_gpib.c | 4 +- drivers/gpib/pc2/pc2_gpib.c | 2 +- drivers/gpib/tnt4882/mite.c | 2 +- drivers/gpib/tnt4882/tnt4882_gpib.c | 4 +- drivers/gpio/gpio-aggregator.c | 8 +- drivers/gpio/gpio-reg.c | 2 +- drivers/gpio/gpio-regmap.c | 2 +- drivers/gpio/gpio-sim.c | 12 +-- drivers/gpio/gpio-virtuser.c | 10 +- drivers/gpio/gpiolib-acpi-core.c | 6 +- drivers/gpio/gpiolib-cdev.c | 12 +-- drivers/gpio/gpiolib-shared.c | 9 +- drivers/gpio/gpiolib-sysfs.c | 4 +- drivers/gpio/gpiolib.c | 9 +- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 20 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 4 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 20 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 12 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 19 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 16 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 24 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 12 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 22 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 9 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 7 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 5 +- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 5 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 5 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 11 +-- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 11 +-- drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 +- drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 2 +- drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 2 +- drivers/gpu/drm/amd/amdgpu/umc_v12_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 ++- drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 14 +-- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 9 +- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 10 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 53 ++++++----- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 16 ++-- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 5 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 12 +-- .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 4 +- drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c | 18 ++-- drivers/gpu/drm/amd/display/dc/basics/vector.c | 4 +- drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 4 +- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 4 +- drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 42 ++++++--- .../amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 3 +- .../amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 3 +- .../amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 26 +++--- drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_state.c | 5 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 10 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c | 4 +- .../drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c | 11 +-- .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 10 +- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 8 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 +- .../drm/amd/display/dc/dce110/dce110_compressor.c | 2 +- .../drm/amd/display/dc/dce112/dce112_compressor.c | 2 +- .../dc/dio/virtual/virtual_stream_encoder.c | 2 +- .../drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 4 +- drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 +- .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../amd/display/dc/irq/dce110/irq_service_dce110.c | 3 +- .../amd/display/dc/irq/dce120/irq_service_dce120.c | 3 +- .../amd/display/dc/irq/dce60/irq_service_dce60.c | 3 +- .../amd/display/dc/irq/dce80/irq_service_dce80.c | 3 +- .../amd/display/dc/irq/dcn10/irq_service_dcn10.c | 3 +- .../amd/display/dc/irq/dcn20/irq_service_dcn20.c | 3 +- .../amd/display/dc/irq/dcn201/irq_service_dcn201.c | 3 +- .../amd/display/dc/irq/dcn21/irq_service_dcn21.c | 3 +- .../amd/display/dc/irq/dcn30/irq_service_dcn30.c | 3 +- .../amd/display/dc/irq/dcn302/irq_service_dcn302.c | 2 +- .../amd/display/dc/irq/dcn303/irq_service_dcn303.c | 2 +- .../amd/display/dc/irq/dcn31/irq_service_dcn31.c | 3 +- .../amd/display/dc/irq/dcn314/irq_service_dcn314.c | 3 +- .../amd/display/dc/irq/dcn315/irq_service_dcn315.c | 3 +- .../amd/display/dc/irq/dcn32/irq_service_dcn32.c | 3 +- .../amd/display/dc/irq/dcn35/irq_service_dcn35.c | 3 +- .../amd/display/dc/irq/dcn351/irq_service_dcn351.c | 3 +- .../amd/display/dc/irq/dcn36/irq_service_dcn36.c | 3 +- .../amd/display/dc/irq/dcn401/irq_service_dcn401.c | 3 +- drivers/gpu/drm/amd/display/dc/link/link_factory.c | 5 +- .../drm/amd/display/dc/link/protocols/link_ddc.c | 2 +- .../drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c | 2 +- .../display/dc/resource/dce100/dce100_resource.c | 28 +++--- .../display/dc/resource/dce110/dce110_resource.c | 42 ++++----- .../display/dc/resource/dce112/dce112_resource.c | 28 +++--- .../display/dc/resource/dce120/dce120_resource.c | 31 +++---- .../amd/display/dc/resource/dce60/dce60_resource.c | 34 +++---- .../amd/display/dc/resource/dce80/dce80_resource.c | 34 +++---- .../amd/display/dc/resource/dcn10/dcn10_resource.c | 35 ++++--- .../amd/display/dc/resource/dcn20/dcn20_resource.c | 46 ++++----- .../display/dc/resource/dcn201/dcn201_resource.c | 29 +++--- .../amd/display/dc/resource/dcn21/dcn21_resource.c | 40 ++++---- .../amd/display/dc/resource/dcn30/dcn30_resource.c | 50 +++++----- .../display/dc/resource/dcn301/dcn301_resource.c | 45 +++++---- .../display/dc/resource/dcn302/dcn302_resource.c | 47 ++++++---- .../display/dc/resource/dcn303/dcn303_resource.c | 47 ++++++---- .../amd/display/dc/resource/dcn31/dcn31_resource.c | 61 ++++++------ .../display/dc/resource/dcn314/dcn314_resource.c | 61 ++++++------ .../display/dc/resource/dcn315/dcn315_resource.c | 54 +++++------ .../display/dc/resource/dcn316/dcn316_resource.c | 54 +++++------ .../amd/display/dc/resource/dcn32/dcn32_resource.c | 57 ++++++------ .../display/dc/resource/dcn321/dcn321_resource.c | 50 +++++----- .../amd/display/dc/resource/dcn35/dcn35_resource.c | 53 +++++------ .../display/dc/resource/dcn351/dcn351_resource.c | 53 +++++------ .../amd/display/dc/resource/dcn36/dcn36_resource.c | 53 +++++------ .../display/dc/resource/dcn401/dcn401_resource.c | 52 +++++------ .../soc_and_ip_translator/soc_and_ip_translator.c | 2 +- .../drm/amd/display/modules/color/color_gamma.c | 37 ++++---- .../drm/amd/display/modules/freesync/freesync.c | 2 +- drivers/gpu/drm/amd/display/modules/vmid/vmid.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 10 +- drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 9 +- drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 10 +- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 22 ++--- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 2 +- .../amd/pm/powerplay/hwmgr/process_pptables_v1_0.c | 39 ++++---- .../drm/amd/pm/powerplay/hwmgr/processpptables.c | 34 +++---- .../gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 7 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 4 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 5 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c | 8 +- .../gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 5 +- .../pm/powerplay/hwmgr/vega10_processpptables.c | 35 ++++--- .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 2 +- .../pm/powerplay/hwmgr/vega12_processpptables.c | 2 +- .../gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 2 +- .../pm/powerplay/hwmgr/vega20_processpptables.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 4 +- .../gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 4 +- .../drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c | 4 +- .../drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/vega12_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/vega20_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 10 +- .../drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 11 +-- .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 8 +- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 10 +- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 10 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 14 +-- .../gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 4 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 10 +- drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 6 +- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 2 +- .../gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 5 +- drivers/gpu/drm/amd/ras/rascore/ras_core.c | 4 +- drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c | 2 +- drivers/gpu/drm/amd/ras/rascore/ras_umc.c | 9 +- drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 4 +- .../drm/arm/display/komeda/komeda_framebuffer.c | 2 +- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 6 +- .../drm/arm/display/komeda/komeda_private_obj.c | 16 ++-- .../drm/arm/display/komeda/komeda_wb_connector.c | 2 +- drivers/gpu/drm/arm/malidp_crtc.c | 5 +- drivers/gpu/drm/arm/malidp_mw.c | 6 +- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/armada/armada_crtc.c | 4 +- drivers/gpu/drm/armada/armada_fb.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/armada/armada_overlay.c | 4 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/ast/ast_dp.c | 6 +- drivers/gpu/drm/ast/ast_mode.c | 5 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 4 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +- drivers/gpu/drm/bridge/aux-bridge.c | 2 +- drivers/gpu/drm/bridge/aux-hpd-bridge.c | 2 +- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 +- .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 +- drivers/gpu/drm/bridge/display-connector.c | 4 +- drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 2 +- .../gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 2 +- drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 2 +- drivers/gpu/drm/bridge/ite-it6263.c | 2 +- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- drivers/gpu/drm/bridge/sil-sii8620.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/clients/drm_fbdev_client.c | 2 +- drivers/gpu/drm/clients/drm_log.c | 4 +- drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +- drivers/gpu/drm/display/drm_dp_aux_dev.c | 2 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 37 ++++---- drivers/gpu/drm/display/drm_dp_tunnel.c | 14 +-- drivers/gpu/drm/display/drm_hdmi_cec_helper.c | 2 +- drivers/gpu/drm/drm_atomic.c | 15 +-- drivers/gpu/drm/drm_atomic_helper.c | 10 +- drivers/gpu/drm/drm_atomic_state_helper.c | 18 ++-- drivers/gpu/drm/drm_atomic_uapi.c | 2 +- drivers/gpu/drm/drm_auth.c | 2 +- drivers/gpu/drm/drm_blend.c | 2 +- drivers/gpu/drm/drm_bridge.c | 2 +- drivers/gpu/drm/drm_buddy.c | 15 ++- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_client_modeset.c | 20 ++-- drivers/gpu/drm/drm_colorop.c | 4 +- drivers/gpu/drm/drm_connector.c | 2 +- drivers/gpu/drm/drm_crtc.c | 8 +- drivers/gpu/drm/drm_crtc_helper.c | 10 +- drivers/gpu/drm/drm_damage_helper.c | 2 +- drivers/gpu/drm/drm_debugfs_crc.c | 2 +- drivers/gpu/drm/drm_edid.c | 4 +- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_flip_work.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_gem.c | 4 +- drivers/gpu/drm/drm_gem_atomic_helper.c | 5 +- drivers/gpu/drm/drm_gem_dma_helper.c | 4 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 2 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +- drivers/gpu/drm/drm_gpusvm.c | 6 +- drivers/gpu/drm/drm_gpuvm.c | 14 +-- drivers/gpu/drm/drm_lease.c | 4 +- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- drivers/gpu/drm/drm_modes.c | 2 +- drivers/gpu/drm/drm_modeset_lock.c | 2 +- drivers/gpu/drm/drm_pagemap.c | 4 +- drivers/gpu/drm/drm_pagemap_util.c | 6 +- drivers/gpu/drm/drm_plane.c | 7 +- drivers/gpu/drm/drm_plane_helper.c | 4 +- drivers/gpu/drm/drm_prime.c | 8 +- drivers/gpu/drm/drm_privacy_screen.c | 2 +- drivers/gpu/drm/drm_property.c | 4 +- drivers/gpu/drm/drm_self_refresh_helper.c | 2 +- drivers/gpu/drm/drm_suballoc.c | 2 +- drivers/gpu/drm/drm_syncobj.c | 8 +- drivers/gpu/drm/drm_sysfs.c | 4 +- drivers/gpu/drm/drm_vblank.c | 4 +- drivers/gpu/drm/drm_vma_manager.c | 2 +- drivers/gpu/drm/drm_writeback.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 10 +- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_iommu.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 12 +-- drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_crt.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 8 +- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/intel_bios.c | 7 +- drivers/gpu/drm/gma500/intel_gmbus.c | 6 +- drivers/gpu/drm/gma500/intel_i2c.c | 2 +- drivers/gpu/drm/gma500/mid_bios.c | 2 +- drivers/gpu/drm/gma500/mmu.c | 6 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 6 +- drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 2 +- drivers/gpu/drm/gma500/oaktrail_lvds.c | 6 +- drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 4 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 14 ++- drivers/gpu/drm/gud/gud_connector.c | 10 +- drivers/gpu/drm/gud/gud_drv.c | 9 +- drivers/gpu/drm/i915/display/dvo_ch7017.c | 2 +- drivers/gpu/drm/i915/display/dvo_ch7xxx.c | 2 +- drivers/gpu/drm/i915/display/dvo_ivch.c | 2 +- drivers/gpu/drm/i915/display/dvo_ns2501.c | 2 +- drivers/gpu/drm/i915/display/dvo_sil164.c | 2 +- drivers/gpu/drm/i915/display/dvo_tfp410.c | 2 +- drivers/gpu/drm/i915/display/icl_dsi.c | 2 +- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- drivers/gpu/drm/i915/display/intel_bios.c | 14 +-- drivers/gpu/drm/i915/display/intel_bw.c | 2 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 2 +- drivers/gpu/drm/i915/display/intel_colorop.c | 2 +- drivers/gpu/drm/i915/display/intel_connector.c | 4 +- drivers/gpu/drm/i915/display/intel_crt.c | 2 +- drivers/gpu/drm/i915/display/intel_crtc.c | 4 +- drivers/gpu/drm/i915/display/intel_dbuf_bw.c | 2 +- drivers/gpu/drm/i915/display/intel_display.c | 2 +- .../gpu/drm/i915/display/intel_display_device.c | 2 +- drivers/gpu/drm/i915/display/intel_display_irq.c | 2 +- .../gpu/drm/i915/display/intel_display_power_map.c | 5 +- drivers/gpu/drm/i915/display/intel_display_rps.c | 2 +- .../gpu/drm/i915/display/intel_display_snapshot.c | 2 +- drivers/gpu/drm/i915/display/intel_dmc.c | 4 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/display/intel_dp_tunnel.c | 4 +- drivers/gpu/drm/i915/display/intel_dpt.c | 2 +- drivers/gpu/drm/i915/display/intel_dsb.c | 2 +- drivers/gpu/drm/i915/display/intel_dsb_buffer.c | 2 +- drivers/gpu/drm/i915/display/intel_dsi.c | 4 +- drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_encoder.c | 2 +- drivers/gpu/drm/i915/display/intel_fb.c | 4 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_global_state.c | 2 +- drivers/gpu/drm/i915/display/intel_gmbus.c | 2 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 6 +- .../gpu/drm/i915/display/intel_hdcp_gsc_message.c | 2 +- drivers/gpu/drm/i915/display/intel_lpe_audio.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- drivers/gpu/drm/i915/display/intel_opregion.c | 2 +- drivers/gpu/drm/i915/display/intel_overlay.c | 4 +- drivers/gpu/drm/i915/display/intel_plane.c | 4 +- drivers/gpu/drm/i915/display/intel_pmdemand.c | 2 +- drivers/gpu/drm/i915/display/intel_rom.c | 4 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 8 +- drivers/gpu/drm/i915/display/intel_tc.c | 2 +- drivers/gpu/drm/i915/display/intel_tv.c | 2 +- drivers/gpu/drm/i915/display/skl_watermark.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 14 ++- drivers/gpu/drm/i915/gem/i915_gem_create.c | 5 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +- .../gpu/drm/i915/gem/i915_gem_object_frontbuffer.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 6 +- drivers/gpu/drm/i915/gem/i915_gem_phys.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 6 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 4 +- .../gpu/drm/i915/gem/selftests/huge_gem_object.c | 2 +- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +- .../drm/i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 6 +- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 2 +- drivers/gpu/drm/i915/gem/selftests/mock_context.c | 2 +- drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c | 4 +- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 2 +- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +- .../gpu/drm/i915/gt/intel_execlists_submission.c | 4 +- drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 5 +- drivers/gpu/drm/i915/gt/intel_gsc.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 4 +- drivers/gpu/drm/i915/gt/intel_ppgtt.c | 6 +- drivers/gpu/drm/i915/gt/intel_ring.c | 2 +- drivers/gpu/drm/i915/gt/intel_timeline.c | 2 +- drivers/gpu/drm/i915/gt/intel_workarounds.c | 4 +- .../gpu/drm/i915/gt/selftest_engine_heartbeat.c | 2 +- drivers/gpu/drm/i915/gt/selftest_execlists.c | 7 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +- drivers/gpu/drm/i915/gt/selftest_migrate.c | 2 +- drivers/gpu/drm/i915/gt/selftest_rc6.c | 2 +- drivers/gpu/drm/i915/gt/selftest_slpc.c | 2 +- drivers/gpu/drm/i915/gt/selftest_timeline.c | 12 +-- drivers/gpu/drm/i915/gt/selftest_workarounds.c | 4 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 2 +- drivers/gpu/drm/i915/gt/sysfs_engines.c | 4 +- drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 14 +-- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 8 +- drivers/gpu/drm/i915/gt/uc/selftest_guc.c | 2 +- drivers/gpu/drm/i915/gvt/cmd_parser.c | 4 +- drivers/gpu/drm/i915/gvt/debugfs.c | 2 +- drivers/gpu/drm/i915/gvt/display.c | 4 +- drivers/gpu/drm/i915/gvt/dmabuf.c | 7 +- drivers/gpu/drm/i915/gvt/gtt.c | 8 +- drivers/gpu/drm/i915/gvt/handlers.c | 2 +- drivers/gpu/drm/i915/gvt/kvmgt.c | 11 +-- drivers/gpu/drm/i915/gvt/page_track.c | 2 +- drivers/gpu/drm/i915/gvt/sched_policy.c | 4 +- drivers/gpu/drm/i915/gvt/vgpu.c | 6 +- drivers/gpu/drm/i915/i915_active.c | 4 +- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 +- drivers/gpu/drm/i915/i915_deps.c | 2 +- drivers/gpu/drm/i915/i915_drm_client.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gpu_error.c | 14 +-- drivers/gpu/drm/i915/i915_hdcp_gsc.c | 2 +- drivers/gpu/drm/i915/i915_hwmon.c | 2 +- drivers/gpu/drm/i915/i915_perf.c | 10 +- drivers/gpu/drm/i915/i915_pmu.c | 6 +- drivers/gpu/drm/i915/i915_scatterlist.c | 4 +- drivers/gpu/drm/i915/i915_scheduler.c | 2 +- drivers/gpu/drm/i915/i915_sw_fence.c | 2 +- drivers/gpu/drm/i915/i915_syncmap.c | 5 +- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 4 +- drivers/gpu/drm/i915/i915_vma.c | 8 +- drivers/gpu/drm/i915/intel_memory_region.c | 2 +- drivers/gpu/drm/i915/intel_uncore.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp.c | 2 +- drivers/gpu/drm/i915/selftests/i915_active.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +- drivers/gpu/drm/i915/selftests/i915_perf.c | 4 +- drivers/gpu/drm/i915/selftests/i915_request.c | 27 +++--- drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 6 +- drivers/gpu/drm/i915/selftests/lib_sw_fence.c | 2 +- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +- drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 +- drivers/gpu/drm/i915/vlv_suspend.c | 3 +- drivers/gpu/drm/imagination/pvr_ccb.c | 2 +- drivers/gpu/drm/imagination/pvr_context.c | 2 +- drivers/gpu/drm/imagination/pvr_drv.c | 2 +- drivers/gpu/drm/imagination/pvr_free_list.c | 4 +- drivers/gpu/drm/imagination/pvr_fw.c | 2 +- drivers/gpu/drm/imagination/pvr_fw_trace.c | 2 +- drivers/gpu/drm/imagination/pvr_gem.c | 2 +- drivers/gpu/drm/imagination/pvr_hwrt.c | 2 +- drivers/gpu/drm/imagination/pvr_job.c | 6 +- drivers/gpu/drm/imagination/pvr_mmu.c | 11 +-- drivers/gpu/drm/imagination/pvr_power.c | 4 +- drivers/gpu/drm/imagination/pvr_queue.c | 4 +- drivers/gpu/drm/imagination/pvr_sync.c | 2 +- drivers/gpu/drm/imagination/pvr_vm.c | 12 +-- drivers/gpu/drm/imx/dcss/dcss-plane.c | 2 +- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c | 4 +- drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 4 +- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +- drivers/gpu/drm/ingenic/ingenic-ipu.c | 2 +- drivers/gpu/drm/kmb/kmb_dsi.c | 4 +- drivers/gpu/drm/lima/lima_ctx.c | 2 +- drivers/gpu/drm/lima/lima_drv.c | 2 +- drivers/gpu/drm/lima/lima_gem.c | 8 +- drivers/gpu/drm/lima/lima_vm.c | 4 +- drivers/gpu/drm/loongson/lsdc_crtc.c | 4 +- drivers/gpu/drm/loongson/lsdc_gfxpll.c | 2 +- drivers/gpu/drm/loongson/lsdc_i2c.c | 2 +- drivers/gpu/drm/loongson/lsdc_pixpll.c | 2 +- drivers/gpu/drm/loongson/lsdc_ttm.c | 4 +- drivers/gpu/drm/mediatek/mtk_crtc.c | 4 +- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- drivers/gpu/drm/mediatek/mtk_gem.c | 4 +- drivers/gpu/drm/mediatek/mtk_plane.c | 4 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +- drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a2xx_gpummu.c | 2 +- drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 3 +- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +- drivers/gpu/drm/msm/disp/msm_disp_snapshot.c | 2 +- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 2 +- drivers/gpu/drm/msm/dp/dp_ctrl.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 2 +- drivers/gpu/drm/msm/msm_debugfs.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_fb.c | 2 +- drivers/gpu/drm/msm/msm_fence.c | 4 +- drivers/gpu/drm/msm/msm_gem.c | 4 +- drivers/gpu/drm/msm/msm_gem_vma.c | 12 +-- drivers/gpu/drm/msm/msm_gpu.c | 3 +- drivers/gpu/drm/msm/msm_iommu.c | 6 +- drivers/gpu/drm/msm/msm_kms.c | 2 +- drivers/gpu/drm/msm/msm_perf.c | 2 +- drivers/gpu/drm/msm/msm_rd.c | 2 +- drivers/gpu/drm/msm/msm_ringbuffer.c | 2 +- drivers/gpu/drm/msm/msm_submitqueue.c | 4 +- drivers/gpu/drm/msm/msm_syncobj.c | 8 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/dac.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/overlay.c | 6 +- drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/core507d.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 16 ++-- drivers/gpu/drm/nouveau/dispnv50/head.c | 6 +- drivers/gpu/drm/nouveau/dispnv50/lut.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 8 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 10 +- drivers/gpu/drm/nouveau/nouveau_backlight.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 4 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 8 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 4 +- drivers/gpu/drm/nouveau/nouveau_exec.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_hwmon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_led.c | 2 +- drivers/gpu/drm/nouveau/nouveau_mem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_sched.c | 14 +-- drivers/gpu/drm/nouveau/nouveau_sgdma.c | 2 +- drivers/gpu/drm/nouveau/nouveau_svm.c | 13 +-- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 +- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 10 +- drivers/gpu/drm/nouveau/nouveau_vmm.c | 2 +- drivers/gpu/drm/nouveau/nv04_fence.c | 4 +- drivers/gpu/drm/nouveau/nv10_fence.c | 4 +- drivers/gpu/drm/nouveau/nv17_fence.c | 4 +- drivers/gpu/drm/nouveau/nv50_fence.c | 4 +- drivers/gpu/drm/nouveau/nv84_fence.c | 4 +- drivers/gpu/drm/nouveau/nvif/fifo.c | 6 +- drivers/gpu/drm/nouveau/nvif/mmu.c | 9 +- drivers/gpu/drm/nouveau/nvif/object.c | 2 +- drivers/gpu/drm/nouveau/nvif/outp.c | 2 +- drivers/gpu/drm/nouveau/nvif/vmm.c | 3 +- drivers/gpu/drm/nouveau/nvkm/core/client.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/engine.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c | 4 +- drivers/gpu/drm/nouveau/nvkm/core/intr.c | 4 +- drivers/gpu/drm/nouveau/nvkm/core/memory.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/mm.c | 8 +- drivers/gpu/drm/nouveau/nvkm/core/object.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/oproxy.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/subdev.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/uevent.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/user.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergf100.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergf119.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergv100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c | 6 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/chid.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 6 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c | 3 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c | 8 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 6 +- .../gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c | 10 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c | 2 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +- drivers/gpu/drm/omapdrm/dss/dss.c | 4 +- drivers/gpu/drm/omapdrm/omap_crtc.c | 6 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 14 +-- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 12 +-- drivers/gpu/drm/omapdrm/omap_irq.c | 2 +- drivers/gpu/drm/omapdrm/omap_overlay.c | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 6 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 11 +-- drivers/gpu/drm/panfrost/panfrost_gem.c | 4 +- drivers/gpu/drm/panfrost/panfrost_job.c | 4 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 10 +- drivers/gpu/drm/panthor/panthor_drv.c | 8 +- drivers/gpu/drm/panthor/panthor_gem.c | 4 +- drivers/gpu/drm/panthor/panthor_heap.c | 6 +- drivers/gpu/drm/panthor/panthor_mmu.c | 19 ++-- drivers/gpu/drm/panthor/panthor_sched.c | 10 +- drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 14 +-- drivers/gpu/drm/qxl/qxl_image.c | 4 +- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 +- drivers/gpu/drm/qxl/qxl_object.c | 2 +- drivers/gpu/drm/qxl/qxl_release.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- drivers/gpu/drm/radeon/atom.c | 2 +- drivers/gpu/drm/radeon/atombios_encoders.c | 10 +- drivers/gpu/drm/radeon/btc_dpm.c | 9 +- drivers/gpu/drm/radeon/ci_dpm.c | 16 ++-- drivers/gpu/drm/radeon/cypress_dpm.c | 2 +- drivers/gpu/drm/radeon/evergreen_cs.c | 2 +- drivers/gpu/drm/radeon/kv_dpm.c | 9 +- drivers/gpu/drm/radeon/ni_dpm.c | 21 ++--- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 16 ++-- drivers/gpu/drm/radeon/radeon_agp.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 50 +++++----- drivers/gpu/drm/radeon/radeon_combios.c | 19 ++-- drivers/gpu/drm/radeon/radeon_connectors.c | 22 +++-- drivers/gpu/drm/radeon/radeon_cs.c | 6 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 21 +++-- drivers/gpu/drm/radeon/radeon_fbdev.c | 2 +- drivers/gpu/drm/radeon/radeon_fence.c | 2 +- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 8 +- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- drivers/gpu/drm/radeon/radeon_test.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 4 +- drivers/gpu/drm/radeon/radeon_vm.c | 8 +- drivers/gpu/drm/radeon/rs780_dpm.c | 10 +- drivers/gpu/drm/radeon/rv6xx_dpm.c | 10 +- drivers/gpu/drm/radeon/rv770_dpm.c | 10 +- drivers/gpu/drm/radeon/si_dpm.c | 22 ++--- drivers/gpu/drm/radeon/sumo_dpm.c | 9 +- drivers/gpu/drm/radeon/trinity_dpm.c | 9 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 6 +- .../gpu/drm/renesas/rcar-du/rcar_du_writeback.c | 6 +- drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 2 +- drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c | 4 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 3 +- drivers/gpu/drm/scheduler/sched_main.c | 7 +- drivers/gpu/drm/sitronix/st7920.c | 8 +- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/sti/sti_drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_layer.c | 4 +- drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 8 +- drivers/gpu/drm/tegra/dc.c | 10 +- drivers/gpu/drm/tegra/drm.c | 8 +- drivers/gpu/drm/tegra/dsi.c | 2 +- drivers/gpu/drm/tegra/fb.c | 2 +- drivers/gpu/drm/tegra/gem.c | 10 +- drivers/gpu/drm/tegra/hub.c | 4 +- drivers/gpu/drm/tegra/plane.c | 4 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/tegra/submit.c | 10 +- drivers/gpu/drm/tegra/uapi.c | 4 +- drivers/gpu/drm/tests/drm_gem_shmem_test.c | 2 +- drivers/gpu/drm/tests/drm_mm_test.c | 2 +- drivers/gpu/drm/tests/drm_panic_test.c | 2 +- drivers/gpu/drm/tidss/tidss_crtc.c | 6 +- drivers/gpu/drm/tidss/tidss_plane.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- drivers/gpu/drm/tiny/appletbdrm.c | 11 ++- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 2 +- drivers/gpu/drm/ttm/tests/ttm_mock_manager.c | 6 +- drivers/gpu/drm/ttm/ttm_agp_backend.c | 2 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- drivers/gpu/drm/ttm/ttm_pool.c | 4 +- drivers/gpu/drm/ttm/ttm_range_manager.c | 4 +- drivers/gpu/drm/ttm/ttm_sys_manager.c | 2 +- drivers/gpu/drm/ttm/ttm_tt.c | 4 +- drivers/gpu/drm/udl/udl_main.c | 2 +- drivers/gpu/drm/v3d/v3d_bo.c | 2 +- drivers/gpu/drm/v3d/v3d_drv.c | 2 +- drivers/gpu/drm/v3d/v3d_fence.c | 2 +- drivers/gpu/drm/v3d/v3d_perfmon.c | 3 +- drivers/gpu/drm/v3d/v3d_submit.c | 34 +++---- drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 +- drivers/gpu/drm/vc4/vc4_bo.c | 9 +- drivers/gpu/drm/vc4/vc4_crtc.c | 6 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_gem.c | 12 +-- drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +- drivers/gpu/drm/vc4/vc4_kms.c | 10 +- drivers/gpu/drm/vc4/vc4_perfmon.c | 3 +- drivers/gpu/drm/vc4/vc4_plane.c | 2 +- drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +- drivers/gpu/drm/vgem/vgem_drv.c | 4 +- drivers/gpu/drm/vgem/vgem_fence.c | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/virtio/virtgpu_fence.c | 4 +- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 +- drivers/gpu/drm/virtio/virtgpu_object.c | 6 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- drivers/gpu/drm/virtio/virtgpu_prime.c | 7 +- drivers/gpu/drm/virtio/virtgpu_submit.c | 6 +- drivers/gpu/drm/virtio/virtgpu_vq.c | 17 ++-- drivers/gpu/drm/virtio/virtgpu_vram.c | 4 +- drivers/gpu/drm/vkms/vkms_colorop.c | 8 +- drivers/gpu/drm/vkms/vkms_config.c | 10 +- drivers/gpu/drm/vkms/vkms_configfs.c | 2 +- drivers/gpu/drm/vkms/vkms_crtc.c | 9 +- drivers/gpu/drm/vkms/vkms_plane.c | 6 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- drivers/gpu/drm/vmwgfx/ttm_object.c | 6 +- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 5 +- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 17 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 7 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 6 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c | 5 +- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- drivers/gpu/drm/xe/display/intel_bo.c | 2 +- drivers/gpu/drm/xe/display/xe_dsb_buffer.c | 2 +- drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 2 +- drivers/gpu/drm/xe/display/xe_panic.c | 2 +- drivers/gpu/drm/xe/display/xe_stolen.c | 2 +- drivers/gpu/drm/xe/tests/xe_bo.c | 2 +- drivers/gpu/drm/xe/xe_bb.c | 4 +- drivers/gpu/drm/xe/xe_bo.c | 4 +- drivers/gpu/drm/xe/xe_configfs.c | 2 +- drivers/gpu/drm/xe/xe_dep_scheduler.c | 2 +- drivers/gpu/drm/xe/xe_device.c | 2 +- drivers/gpu/drm/xe/xe_drm_client.c | 2 +- drivers/gpu/drm/xe/xe_eu_stall.c | 7 +- drivers/gpu/drm/xe/xe_exec.c | 2 +- drivers/gpu/drm/xe/xe_exec_queue.c | 4 +- drivers/gpu/drm/xe/xe_execlist.c | 2 +- drivers/gpu/drm/xe/xe_ggtt.c | 2 +- drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_guc_ct.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 6 +- drivers/gpu/drm/xe/xe_guc_submit.c | 16 ++-- drivers/gpu/drm/xe/xe_heci_gsc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 6 +- drivers/gpu/drm/xe/xe_lmtt.c | 2 +- drivers/gpu/drm/xe/xe_lrc.c | 4 +- drivers/gpu/drm/xe/xe_migrate.c | 2 +- drivers/gpu/drm/xe/xe_mmio_gem.c | 2 +- drivers/gpu/drm/xe/xe_nvm.c | 2 +- drivers/gpu/drm/xe/xe_oa.c | 13 +-- drivers/gpu/drm/xe/xe_pmu.c | 2 +- drivers/gpu/drm/xe/xe_preempt_fence.c | 2 +- drivers/gpu/drm/xe/xe_pt.c | 11 +-- drivers/gpu/drm/xe/xe_reg_sr.c | 2 +- drivers/gpu/drm/xe/xe_shrinker.c | 2 +- drivers/gpu/drm/xe/xe_sriov_packet.c | 2 +- drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_svm.c | 4 +- drivers/gpu/drm/xe/xe_sync.c | 5 +- drivers/gpu/drm/xe/xe_tile_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_tlb_inval_job.c | 4 +- drivers/gpu/drm/xe/xe_ttm_sys_mgr.c | 2 +- drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 4 +- drivers/gpu/drm/xe/xe_vm.c | 39 ++++---- drivers/gpu/drm/xe/xe_vm_madvise.c | 3 +- drivers/gpu/drm/xen/xen_drm_front.c | 4 +- drivers/gpu/drm/xen/xen_drm_front_evtchnl.c | 5 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 6 +- drivers/gpu/drm/xlnx/zynqmp_disp.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +- drivers/gpu/host1x/bus.c | 4 +- drivers/gpu/host1x/channel.c | 4 +- drivers/gpu/host1x/context.c | 2 +- drivers/gpu/host1x/fence.c | 2 +- drivers/gpu/host1x/mipi.c | 2 +- drivers/gpu/ipu-v3/ipu-common.c | 2 +- drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +- drivers/gpu/vga/vga_switcheroo.c | 2 +- drivers/greybus/bundle.c | 2 +- drivers/greybus/connection.c | 2 +- drivers/greybus/control.c | 2 +- drivers/greybus/es2.c | 8 +- drivers/greybus/interface.c | 2 +- drivers/greybus/manifest.c | 6 +- drivers/greybus/module.c | 3 +- drivers/greybus/svc.c | 8 +- drivers/greybus/svc_watchdog.c | 2 +- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 2 +- drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 2 +- drivers/hid/bpf/hid_bpf_dispatch.c | 2 +- drivers/hid/hid-apple.c | 2 +- drivers/hid/hid-axff.c | 2 +- drivers/hid/hid-betopff.c | 2 +- drivers/hid/hid-cmedia.c | 2 +- drivers/hid/hid-core.c | 13 +-- drivers/hid/hid-corsair.c | 4 +- drivers/hid/hid-cougar.c | 2 +- drivers/hid/hid-debug.c | 2 +- drivers/hid/hid-dr.c | 2 +- drivers/hid/hid-elo.c | 2 +- drivers/hid/hid-emsff.c | 2 +- drivers/hid/hid-gaff.c | 2 +- drivers/hid/hid-google-hammer.c | 4 +- drivers/hid/hid-haptic.c | 4 +- drivers/hid/hid-holtekff.c | 2 +- drivers/hid/hid-hyperv.c | 2 +- drivers/hid/hid-input.c | 4 +- drivers/hid/hid-lg.c | 2 +- drivers/hid/hid-lg2ff.c | 2 +- drivers/hid/hid-lg4ff.c | 2 +- drivers/hid/hid-logitech-dj.c | 8 +- drivers/hid/hid-logitech-hidpp.c | 8 +- drivers/hid/hid-megaworld.c | 2 +- drivers/hid/hid-mf.c | 2 +- drivers/hid/hid-ntrig.c | 2 +- drivers/hid/hid-picolcd_core.c | 4 +- drivers/hid/hid-pl.c | 2 +- drivers/hid/hid-playstation.c | 2 +- drivers/hid/hid-prodikeys.c | 2 +- drivers/hid/hid-quirks.c | 4 +- drivers/hid/hid-roccat-arvo.c | 2 +- drivers/hid/hid-roccat-isku.c | 2 +- drivers/hid/hid-roccat-kone.c | 2 +- drivers/hid/hid-roccat-koneplus.c | 2 +- drivers/hid/hid-roccat-konepure.c | 2 +- drivers/hid/hid-roccat-kovaplus.c | 2 +- drivers/hid/hid-roccat-lua.c | 2 +- drivers/hid/hid-roccat-pyra.c | 2 +- drivers/hid/hid-roccat-ryos.c | 2 +- drivers/hid/hid-roccat-savu.c | 2 +- drivers/hid/hid-roccat.c | 4 +- drivers/hid/hid-sensor-custom.c | 2 +- drivers/hid/hid-sensor-hub.c | 2 +- drivers/hid/hid-sjoy.c | 2 +- drivers/hid/hid-thrustmaster.c | 4 +- drivers/hid/hid-tmff.c | 2 +- drivers/hid/hid-uclogic-params.c | 4 +- drivers/hid/hid-wiimote-core.c | 2 +- drivers/hid/hid-wiimote-debug.c | 2 +- drivers/hid/hid-zpff.c | 2 +- drivers/hid/hidraw.c | 4 +- drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +- drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +- drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 4 +- drivers/hid/intel-ish-hid/ishtp/client.c | 2 +- drivers/hid/intel-ish-hid/ishtp/hbm.c | 4 +- drivers/hid/uhid.c | 14 +-- drivers/hid/usbhid/hid-core.c | 4 +- drivers/hid/usbhid/hid-pidff.c | 2 +- drivers/hid/usbhid/hiddev.c | 4 +- drivers/hid/usbhid/usbkbd.c | 4 +- drivers/hid/usbhid/usbmouse.c | 2 +- drivers/hid/wacom_sys.c | 2 +- drivers/hsi/clients/cmt_speech.c | 6 +- drivers/hsi/clients/hsi_char.c | 2 +- drivers/hsi/clients/ssi_protocol.c | 4 +- drivers/hsi/hsi_boardinfo.c | 2 +- drivers/hsi/hsi_core.c | 16 ++-- drivers/hte/hte.c | 2 +- drivers/hv/channel_mgmt.c | 2 +- drivers/hv/connection.c | 5 +- drivers/hv/hv.c | 4 +- drivers/hv/hv_balloon.c | 2 +- drivers/hv/hv_kvp.c | 4 +- drivers/hv/hv_proc.c | 2 +- drivers/hv/hv_snapshot.c | 4 +- drivers/hv/hv_utils_transport.c | 2 +- drivers/hv/mshv_debugfs.c | 16 ++-- drivers/hv/mshv_eventfd.c | 6 +- drivers/hv/mshv_irq.c | 4 +- drivers/hv/mshv_root_main.c | 6 +- drivers/hv/mshv_synic.c | 2 +- drivers/hv/mshv_vtl_main.c | 6 +- drivers/hv/ring_buffer.c | 5 +- drivers/hv/vmbus_drv.c | 10 +- drivers/hwmon/acpi_power_meter.c | 7 +- drivers/hwmon/applesmc.c | 4 +- drivers/hwmon/coretemp.c | 12 +-- drivers/hwmon/drivetemp.c | 2 +- drivers/hwmon/fschmd.c | 2 +- drivers/hwmon/hwmon.c | 8 +- drivers/hwmon/i5k_amb.c | 2 +- drivers/hwmon/ibmaem.c | 4 +- drivers/hwmon/ibmpex.c | 6 +- drivers/hwmon/sch56xx-common.c | 2 +- drivers/hwmon/via-cputemp.c | 2 +- drivers/hwmon/w83793.c | 2 +- drivers/hwtracing/coresight/coresight-catu.c | 2 +- drivers/hwtracing/coresight/coresight-core.c | 6 +- .../hwtracing/coresight/coresight-cti-platform.c | 2 +- drivers/hwtracing/coresight/coresight-etm-perf.c | 2 +- drivers/hwtracing/coresight/coresight-syscfg.c | 4 +- drivers/hwtracing/coresight/coresight-tmc-etr.c | 15 ++- drivers/hwtracing/coresight/coresight-trbe.c | 2 +- drivers/hwtracing/intel_th/core.c | 2 +- drivers/hwtracing/intel_th/msu-sink.c | 2 +- drivers/hwtracing/intel_th/msu.c | 6 +- drivers/hwtracing/ptt/hisi_ptt.c | 6 +- drivers/hwtracing/stm/core.c | 12 +-- drivers/hwtracing/stm/p_sys-t.c | 2 +- drivers/hwtracing/stm/policy.c | 2 +- drivers/i2c/busses/i2c-cp2615.c | 6 +- drivers/i2c/busses/i2c-cpm.c | 2 +- drivers/i2c/busses/i2c-designware-amdpsp.c | 2 +- drivers/i2c/busses/i2c-diolan-u2c.c | 2 +- drivers/i2c/busses/i2c-eg20t.c | 2 +- drivers/i2c/busses/i2c-fsi.c | 2 +- drivers/i2c/busses/i2c-highlander.c | 2 +- drivers/i2c/busses/i2c-ibm_iic.c | 2 +- drivers/i2c/busses/i2c-iop3xx.c | 4 +- drivers/i2c/busses/i2c-nforce2.c | 2 +- drivers/i2c/busses/i2c-parport.c | 2 +- drivers/i2c/busses/i2c-piix4.c | 4 +- drivers/i2c/busses/i2c-pxa-pci.c | 2 +- drivers/i2c/busses/i2c-qcom-geni.c | 3 +- drivers/i2c/busses/i2c-scmi.c | 2 +- drivers/i2c/busses/i2c-sh7760.c | 2 +- drivers/i2c/busses/i2c-simtec.c | 2 +- drivers/i2c/busses/i2c-stm32f7.c | 2 +- drivers/i2c/busses/i2c-taos-evm.c | 2 +- drivers/i2c/busses/i2c-tiny-usb.c | 6 +- drivers/i2c/busses/i2c-virtio.c | 2 +- drivers/i2c/busses/scx200_acb.c | 2 +- drivers/i2c/i2c-atr.c | 8 +- drivers/i2c/i2c-boardinfo.c | 2 +- drivers/i2c/i2c-core-acpi.c | 5 +- drivers/i2c/i2c-core-base.c | 4 +- drivers/i2c/i2c-core-of-prober.c | 2 +- drivers/i2c/i2c-dev.c | 8 +- drivers/i2c/i2c-mux.c | 2 +- drivers/i2c/i2c-smbus.c | 3 +- drivers/i2c/i2c-stub.c | 3 +- drivers/i3c/master.c | 15 +-- drivers/i3c/master/adi-i3c-master.c | 6 +- drivers/i3c/master/dw-i3c-master.c | 6 +- drivers/i3c/master/i3c-master-cdns.c | 6 +- drivers/i3c/master/mipi-i3c-hci/core.c | 4 +- drivers/i3c/master/mipi-i3c-hci/dma.c | 8 +- drivers/i3c/master/mipi-i3c-hci/hci.h | 2 +- drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 2 +- drivers/i3c/master/mipi-i3c-hci/pio.c | 2 +- drivers/i3c/master/renesas-i3c.c | 6 +- drivers/i3c/master/svc-i3c-master.c | 6 +- drivers/iio/adc/ti-tsc2046.c | 12 +-- drivers/iio/buffer/industrialio-buffer-cb.c | 2 +- drivers/iio/buffer/industrialio-buffer-dma.c | 2 +- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 +- drivers/iio/buffer/industrialio-hw-consumer.c | 4 +- drivers/iio/buffer/kfifo_buf.c | 2 +- drivers/iio/common/ssp_sensors/ssp_spi.c | 2 +- drivers/iio/dac/ad5360.c | 4 +- drivers/iio/dummy/iio_dummy_evgen.c | 2 +- drivers/iio/dummy/iio_simple_dummy.c | 2 +- drivers/iio/dummy/iio_simple_dummy_buffer.c | 2 +- drivers/iio/imu/adis_buffer.c | 4 +- drivers/iio/industrialio-buffer.c | 16 ++-- drivers/iio/industrialio-core.c | 9 +- drivers/iio/industrialio-event.c | 7 +- drivers/iio/industrialio-gts-helper.c | 6 +- drivers/iio/industrialio-trigger.c | 4 +- drivers/iio/inkern.c | 8 +- drivers/iio/trigger/iio-trig-hrtimer.c | 2 +- drivers/iio/trigger/iio-trig-interrupt.c | 2 +- drivers/iio/trigger/iio-trig-loop.c | 2 +- drivers/iio/trigger/iio-trig-sysfs.c | 2 +- drivers/infiniband/core/addr.c | 2 +- drivers/infiniband/core/agent.c | 2 +- drivers/infiniband/core/cache.c | 19 ++-- drivers/infiniband/core/cm.c | 14 +-- drivers/infiniband/core/cma.c | 48 +++++----- drivers/infiniband/core/cma_configfs.c | 5 +- drivers/infiniband/core/cq.c | 4 +- drivers/infiniband/core/device.c | 7 +- drivers/infiniband/core/ib_core_uverbs.c | 2 +- drivers/infiniband/core/iwcm.c | 4 +- drivers/infiniband/core/iwpm_msg.c | 2 +- drivers/infiniband/core/iwpm_util.c | 12 +-- drivers/infiniband/core/mad.c | 18 ++-- drivers/infiniband/core/mad_rmpp.c | 2 +- drivers/infiniband/core/multicast.c | 7 +- drivers/infiniband/core/restrack.c | 2 +- drivers/infiniband/core/roce_gid_mgmt.c | 12 +-- drivers/infiniband/core/rw.c | 17 ++-- drivers/infiniband/core/sa_query.c | 24 +++-- drivers/infiniband/core/security.c | 6 +- drivers/infiniband/core/sysfs.c | 34 +++---- drivers/infiniband/core/ucaps.c | 2 +- drivers/infiniband/core/ucma.c | 10 +- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_dmabuf.c | 2 +- drivers/infiniband/core/umem_odp.c | 6 +- drivers/infiniband/core/user_mad.c | 9 +- drivers/infiniband/core/uverbs_cmd.c | 22 ++--- drivers/infiniband/core/uverbs_ioctl.c | 2 +- drivers/infiniband/core/uverbs_main.c | 10 +- drivers/infiniband/core/uverbs_uapi.c | 6 +- drivers/infiniband/core/verbs.c | 6 +- drivers/infiniband/hw/bng_re/bng_dev.c | 8 +- drivers/infiniband/hw/bng_re/bng_fw.c | 4 +- drivers/infiniband/hw/bnxt_re/debugfs.c | 4 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 30 +++--- drivers/infiniband/hw/bnxt_re/main.c | 10 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 10 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 +- drivers/infiniband/hw/bnxt_re/qplib_res.c | 6 +- drivers/infiniband/hw/cxgb4/cq.c | 4 +- drivers/infiniband/hw/cxgb4/device.c | 18 ++-- drivers/infiniband/hw/cxgb4/mem.c | 8 +- drivers/infiniband/hw/cxgb4/provider.c | 2 +- drivers/infiniband/hw/cxgb4/qp.c | 34 +++---- drivers/infiniband/hw/cxgb4/resource.c | 16 ++-- drivers/infiniband/hw/cxgb4/restrack.c | 2 +- drivers/infiniband/hw/efa/efa_main.c | 2 +- drivers/infiniband/hw/efa/efa_verbs.c | 11 +-- drivers/infiniband/hw/erdma/erdma_cm.c | 6 +- drivers/infiniband/hw/erdma/erdma_verbs.c | 15 ++- drivers/infiniband/hw/hfi1/affinity.c | 8 +- drivers/infiniband/hw/hfi1/chip.c | 4 +- drivers/infiniband/hw/hfi1/efivar.c | 2 +- drivers/infiniband/hw/hfi1/fault.c | 2 +- drivers/infiniband/hw/hfi1/file_ops.c | 2 +- drivers/infiniband/hw/hfi1/init.c | 4 +- drivers/infiniband/hw/hfi1/mad.c | 4 +- drivers/infiniband/hw/hfi1/msix.c | 3 +- drivers/infiniband/hw/hfi1/pin_system.c | 4 +- drivers/infiniband/hw/hfi1/pio.c | 20 ++-- drivers/infiniband/hw/hfi1/qsfp.c | 2 +- drivers/infiniband/hw/hfi1/sdma.c | 6 +- drivers/infiniband/hw/hfi1/tid_rdma.c | 2 +- drivers/infiniband/hw/hfi1/user_exp_rcv.c | 15 ++- drivers/infiniband/hw/hfi1/user_sdma.c | 8 +- drivers/infiniband/hw/hns/hns_roce_alloc.c | 4 +- drivers/infiniband/hw/hns/hns_roce_bond.c | 4 +- drivers/infiniband/hw/hns/hns_roce_cmd.c | 4 +- drivers/infiniband/hw/hns/hns_roce_db.c | 4 +- drivers/infiniband/hw/hns/hns_roce_hem.c | 21 ++--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 20 ++-- drivers/infiniband/hw/hns/hns_roce_main.c | 6 +- drivers/infiniband/hw/hns/hns_roce_mr.c | 13 +-- drivers/infiniband/hw/ionic/ionic_admin.c | 16 ++-- drivers/infiniband/hw/ionic/ionic_controlpath.c | 22 ++--- drivers/infiniband/hw/ionic/ionic_hw_stats.c | 15 ++- drivers/infiniband/hw/irdma/cm.c | 16 ++-- drivers/infiniband/hw/irdma/hw.c | 9 +- drivers/infiniband/hw/irdma/i40iw_if.c | 2 +- drivers/infiniband/hw/irdma/icrdma_if.c | 6 +- drivers/infiniband/hw/irdma/ig3rdma_if.c | 6 +- drivers/infiniband/hw/irdma/utils.c | 8 +- drivers/infiniband/hw/irdma/verbs.c | 18 ++-- drivers/infiniband/hw/mana/cq.c | 2 +- drivers/infiniband/hw/mana/main.c | 4 +- drivers/infiniband/hw/mana/mr.c | 10 +- drivers/infiniband/hw/mana/qp.c | 3 +- drivers/infiniband/hw/mana/wq.c | 2 +- drivers/infiniband/hw/mlx4/alias_GUID.c | 8 +- drivers/infiniband/hw/mlx4/cm.c | 4 +- drivers/infiniband/hw/mlx4/cq.c | 4 +- drivers/infiniband/hw/mlx4/doorbell.c | 2 +- drivers/infiniband/hw/mlx4/mad.c | 19 ++-- drivers/infiniband/hw/mlx4/main.c | 63 ++++++------- drivers/infiniband/hw/mlx4/mcg.c | 8 +- drivers/infiniband/hw/mlx4/mr.c | 6 +- drivers/infiniband/hw/mlx4/qp.c | 20 ++-- drivers/infiniband/hw/mlx4/sysfs.c | 11 +-- drivers/infiniband/hw/mlx5/cong.c | 2 +- drivers/infiniband/hw/mlx5/counters.c | 12 +-- drivers/infiniband/hw/mlx5/cq.c | 4 +- drivers/infiniband/hw/mlx5/data_direct.c | 4 +- drivers/infiniband/hw/mlx5/devx.c | 6 +- drivers/infiniband/hw/mlx5/dm.c | 4 +- drivers/infiniband/hw/mlx5/doorbell.c | 2 +- drivers/infiniband/hw/mlx5/fs.c | 30 +++--- drivers/infiniband/hw/mlx5/gsi.c | 6 +- drivers/infiniband/hw/mlx5/ib_rep.c | 3 +- drivers/infiniband/hw/mlx5/ib_virt.c | 8 +- drivers/infiniband/hw/mlx5/macsec.c | 9 +- drivers/infiniband/hw/mlx5/mad.c | 32 +++---- drivers/infiniband/hw/mlx5/main.c | 24 ++--- drivers/infiniband/hw/mlx5/mr.c | 26 +++--- drivers/infiniband/hw/mlx5/odp.c | 4 +- drivers/infiniband/hw/mlx5/qp.c | 8 +- drivers/infiniband/hw/mlx5/srq.c | 2 +- drivers/infiniband/hw/mthca/mthca_allocator.c | 8 +- drivers/infiniband/hw/mthca/mthca_av.c | 4 +- drivers/infiniband/hw/mthca/mthca_cmd.c | 7 +- drivers/infiniband/hw/mthca/mthca_eq.c | 3 +- drivers/infiniband/hw/mthca/mthca_mad.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 17 ++-- drivers/infiniband/hw/mthca/mthca_mr.c | 6 +- drivers/infiniband/hw/mthca/mthca_profile.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 28 +++--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 11 +-- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 11 +-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 15 ++- drivers/infiniband/hw/qedr/main.c | 11 +-- drivers/infiniband/hw/qedr/qedr_iw_cm.c | 8 +- drivers/infiniband/hw/qedr/qedr_roce_cm.c | 8 +- drivers/infiniband/hw/qedr/verbs.c | 20 ++-- drivers/infiniband/hw/usnic/usnic_fwd.c | 4 +- drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 8 +- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 2 +- drivers/infiniband/hw/usnic/usnic_uiom.c | 14 +-- .../infiniband/hw/usnic/usnic_uiom_interval_tree.c | 2 +- drivers/infiniband/hw/usnic/usnic_vnic.c | 10 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 19 ++-- drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c | 3 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c | 6 +- drivers/infiniband/sw/rdmavt/mcast.c | 4 +- drivers/infiniband/sw/rdmavt/mr.c | 4 +- drivers/infiniband/sw/rdmavt/qp.c | 2 +- drivers/infiniband/sw/rdmavt/vt.c | 2 +- drivers/infiniband/sw/rxe/rxe_mcast.c | 4 +- drivers/infiniband/sw/rxe/rxe_mmap.c | 2 +- drivers/infiniband/sw/rxe/rxe_mr.c | 3 +- drivers/infiniband/sw/rxe/rxe_odp.c | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 2 +- drivers/infiniband/sw/rxe/rxe_queue.c | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +- drivers/infiniband/sw/siw/siw_cm.c | 6 +- drivers/infiniband/sw/siw/siw_main.c | 4 +- drivers/infiniband/sw/siw/siw_mem.c | 10 +- drivers/infiniband/sw/siw/siw_qp.c | 4 +- drivers/infiniband/sw/siw/siw_verbs.c | 8 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 6 +- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 4 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 21 ++--- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 4 +- drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 2 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- drivers/infiniband/ulp/iser/iser_initiator.c | 5 +- drivers/infiniband/ulp/iser/iser_verbs.c | 4 +- drivers/infiniband/ulp/isert/ib_isert.c | 15 ++- drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c | 4 +- drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c | 2 +- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 23 ++--- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 32 +++---- drivers/infiniband/ulp/rtrs/rtrs.c | 4 +- drivers/infiniband/ulp/srp/ib_srp.c | 25 +++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 29 +++--- drivers/input/apm-power.c | 2 +- drivers/input/evdev.c | 4 +- drivers/input/ff-core.c | 5 +- drivers/input/ff-memless.c | 2 +- drivers/input/gameport/emu10k1-gp.c | 2 +- drivers/input/gameport/fm801-gp.c | 2 +- drivers/input/gameport/gameport.c | 2 +- drivers/input/gameport/ns558.c | 4 +- drivers/input/input-leds.c | 2 +- drivers/input/input-mt.c | 4 +- drivers/input/input-poller.c | 2 +- drivers/input/input.c | 6 +- drivers/input/joydev.c | 4 +- drivers/input/joystick/a3d.c | 2 +- drivers/input/joystick/adi.c | 2 +- drivers/input/joystick/analog.c | 2 +- drivers/input/joystick/as5011.c | 2 +- drivers/input/joystick/cobra.c | 2 +- drivers/input/joystick/db9.c | 2 +- drivers/input/joystick/fsia6b.c | 2 +- drivers/input/joystick/gamecon.c | 4 +- drivers/input/joystick/gf2k.c | 2 +- drivers/input/joystick/grip.c | 2 +- drivers/input/joystick/grip_mp.c | 2 +- drivers/input/joystick/guillemot.c | 2 +- drivers/input/joystick/iforce/iforce-serio.c | 2 +- drivers/input/joystick/iforce/iforce-usb.c | 2 +- drivers/input/joystick/interact.c | 2 +- drivers/input/joystick/joydump.c | 2 +- drivers/input/joystick/magellan.c | 2 +- drivers/input/joystick/maplecontrol.c | 2 +- drivers/input/joystick/n64joy.c | 2 +- drivers/input/joystick/sidewinder.c | 2 +- drivers/input/joystick/spaceball.c | 2 +- drivers/input/joystick/spaceorb.c | 2 +- drivers/input/joystick/stinger.c | 2 +- drivers/input/joystick/tmdc.c | 4 +- drivers/input/joystick/turbografx.c | 2 +- drivers/input/joystick/twidjoy.c | 2 +- drivers/input/joystick/warrior.c | 2 +- drivers/input/joystick/xpad.c | 4 +- drivers/input/joystick/zhenhua.c | 2 +- drivers/input/keyboard/atkbd.c | 2 +- drivers/input/keyboard/hil_kbd.c | 2 +- drivers/input/keyboard/lkkbd.c | 2 +- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/maple_keyb.c | 2 +- drivers/input/keyboard/newtonkbd.c | 2 +- drivers/input/keyboard/omap-keypad.c | 2 +- drivers/input/keyboard/sh_keysc.c | 2 +- drivers/input/keyboard/stowaway.c | 2 +- drivers/input/keyboard/sunkbd.c | 2 +- drivers/input/keyboard/xtkbd.c | 2 +- drivers/input/misc/88pm80x_onkey.c | 2 +- drivers/input/misc/ati_remote2.c | 2 +- drivers/input/misc/cm109.c | 4 +- drivers/input/misc/cma3000_d0x.c | 2 +- drivers/input/misc/cs40l50-vibra.c | 4 +- drivers/input/misc/da9052_onkey.c | 2 +- drivers/input/misc/ims-pcu.c | 4 +- drivers/input/misc/keyspan_remote.c | 2 +- drivers/input/misc/max8997_haptic.c | 2 +- drivers/input/misc/mc13783-pwrbutton.c | 2 +- drivers/input/misc/palmas-pwrbutton.c | 2 +- drivers/input/misc/pcap_keys.c | 2 +- drivers/input/misc/pcf8574_keypad.c | 2 +- drivers/input/misc/powermate.c | 4 +- drivers/input/misc/uinput.c | 2 +- drivers/input/misc/xen-kbdfront.c | 2 +- drivers/input/misc/yealink.c | 4 +- drivers/input/mouse/alps.c | 2 +- drivers/input/mouse/appletouch.c | 2 +- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/byd.c | 2 +- drivers/input/mouse/cypress_ps2.c | 2 +- drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/focaltech.c | 2 +- drivers/input/mouse/hgpk.c | 2 +- drivers/input/mouse/lifebook.c | 2 +- drivers/input/mouse/maplemouse.c | 2 +- drivers/input/mouse/psmouse-base.c | 2 +- drivers/input/mouse/psmouse-smbus.c | 2 +- drivers/input/mouse/sentelic.c | 2 +- drivers/input/mouse/sermouse.c | 2 +- drivers/input/mouse/synaptics.c | 4 +- drivers/input/mouse/synaptics_usb.c | 2 +- drivers/input/mouse/trackpoint.c | 2 +- drivers/input/mouse/vmmouse.c | 2 +- drivers/input/mouse/vsxxxaa.c | 2 +- drivers/input/mousedev.c | 4 +- drivers/input/rmi4/rmi_bus.c | 2 +- drivers/input/rmi4/rmi_f03.c | 2 +- drivers/input/serio/altera_ps2.c | 2 +- drivers/input/serio/ambakmi.c | 4 +- drivers/input/serio/ams_delta_serio.c | 2 +- drivers/input/serio/apbps2.c | 2 +- drivers/input/serio/arc_ps2.c | 2 +- drivers/input/serio/ct82c710.c | 2 +- drivers/input/serio/gscps2.c | 4 +- drivers/input/serio/hil_mlc.c | 2 +- drivers/input/serio/hyperv-keyboard.c | 4 +- drivers/input/serio/i8042.c | 4 +- drivers/input/serio/ioc3kbd.c | 4 +- drivers/input/serio/maceps2.c | 2 +- drivers/input/serio/olpc_apsp.c | 4 +- drivers/input/serio/parkbd.c | 2 +- drivers/input/serio/pcips2.c | 4 +- drivers/input/serio/ps2-gpio.c | 2 +- drivers/input/serio/ps2mult.c | 4 +- drivers/input/serio/q40kbd.c | 4 +- drivers/input/serio/rpckbd.c | 4 +- drivers/input/serio/sa1111ps2.c | 4 +- drivers/input/serio/serio.c | 2 +- drivers/input/serio/serio_raw.c | 2 +- drivers/input/serio/serport.c | 4 +- drivers/input/serio/sun4i-ps2.c | 4 +- drivers/input/serio/userio.c | 4 +- drivers/input/serio/xilinx_ps2.c | 4 +- drivers/input/tablet/acecad.c | 2 +- drivers/input/tablet/aiptek.c | 2 +- drivers/input/tablet/hanwang.c | 2 +- drivers/input/tablet/kbtab.c | 2 +- drivers/input/tablet/pegasus_notetaker.c | 2 +- drivers/input/tablet/wacom_serial4.c | 2 +- drivers/input/touchscreen/ad7877.c | 6 +- drivers/input/touchscreen/ads7846.c | 4 +- drivers/input/touchscreen/da9052_tsi.c | 2 +- drivers/input/touchscreen/dynapro.c | 2 +- drivers/input/touchscreen/egalax_ts_serial.c | 2 +- drivers/input/touchscreen/elo.c | 2 +- drivers/input/touchscreen/fujitsu_ts.c | 2 +- drivers/input/touchscreen/gunze.c | 2 +- drivers/input/touchscreen/hampshire.c | 2 +- drivers/input/touchscreen/inexio.c | 2 +- drivers/input/touchscreen/mc13783_ts.c | 2 +- drivers/input/touchscreen/migor_ts.c | 2 +- drivers/input/touchscreen/mtouch.c | 2 +- drivers/input/touchscreen/pcap_ts.c | 2 +- drivers/input/touchscreen/penmount.c | 2 +- drivers/input/touchscreen/sur40.c | 2 +- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- drivers/input/touchscreen/touchit213.c | 2 +- drivers/input/touchscreen/touchright.c | 2 +- drivers/input/touchscreen/touchwin.c | 2 +- drivers/input/touchscreen/tsc40.c | 2 +- drivers/input/touchscreen/usbtouchscreen.c | 6 +- drivers/input/touchscreen/wacom_w8001.c | 2 +- drivers/interconnect/core.c | 6 +- drivers/interconnect/debugfs-client.c | 2 +- drivers/interconnect/qcom/icc-common.c | 2 +- drivers/iommu/amd/init.c | 29 +++--- drivers/iommu/amd/iommu.c | 15 ++- drivers/iommu/amd/iommufd.c | 2 +- drivers/iommu/amd/nested.c | 4 +- drivers/iommu/amd/pasid.c | 2 +- drivers/iommu/apple-dart.c | 4 +- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 8 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++-- drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 12 +-- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 2 +- drivers/iommu/dma-iommu.c | 12 +-- drivers/iommu/exynos-iommu.c | 4 +- drivers/iommu/fsl_pamu.c | 2 +- drivers/iommu/hyperv-iommu.c | 2 +- drivers/iommu/intel/cache.c | 4 +- drivers/iommu/intel/dmar.c | 8 +- drivers/iommu/intel/iommu.c | 12 +-- drivers/iommu/intel/irq_remapping.c | 6 +- drivers/iommu/intel/nested.c | 2 +- drivers/iommu/intel/pasid.c | 2 +- drivers/iommu/intel/perf.c | 4 +- drivers/iommu/intel/perfmon.c | 2 +- drivers/iommu/intel/svm.c | 2 +- drivers/iommu/io-pgfault.c | 8 +- drivers/iommu/io-pgtable-arm-v7s.c | 2 +- drivers/iommu/io-pgtable-arm.c | 2 +- drivers/iommu/io-pgtable-dart.c | 2 +- drivers/iommu/iommu-sva.c | 4 +- drivers/iommu/iommu-sysfs.c | 2 +- drivers/iommu/iommu.c | 12 +-- drivers/iommu/iommufd/device.c | 8 +- drivers/iommu/iommufd/driver.c | 4 +- drivers/iommu/iommufd/eventq.c | 2 +- drivers/iommu/iommufd/io_pagetable.c | 6 +- drivers/iommu/iommufd/ioas.c | 2 +- drivers/iommu/iommufd/iova_bitmap.c | 2 +- drivers/iommu/iommufd/main.c | 2 +- drivers/iommu/iommufd/pages.c | 6 +- drivers/iommu/iommufd/selftest.c | 18 ++-- drivers/iommu/iommufd/viommu.c | 2 +- drivers/iommu/iova.c | 5 +- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 4 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/iommu/omap-iommu-debug.c | 2 +- drivers/iommu/omap-iommu.c | 9 +- drivers/iommu/riscv/iommu.c | 6 +- drivers/iommu/rockchip-iommu.c | 2 +- drivers/iommu/s390-iommu.c | 2 +- drivers/iommu/sprd-iommu.c | 2 +- drivers/iommu/sun50i-iommu.c | 2 +- drivers/iommu/tegra-smmu.c | 4 +- drivers/iommu/virtio-iommu.c | 8 +- drivers/ipack/carriers/tpci200.c | 12 +-- drivers/ipack/devices/ipoctal.c | 2 +- drivers/ipack/ipack.c | 2 +- drivers/irqchip/exynos-combiner.c | 2 +- drivers/irqchip/irq-al-fic.c | 2 +- drivers/irqchip/irq-alpine-msi.c | 3 +- drivers/irqchip/irq-apple-aic.c | 4 +- drivers/irqchip/irq-armada-370-xp.c | 2 +- drivers/irqchip/irq-aspeed-i2c-ic.c | 2 +- drivers/irqchip/irq-aspeed-intc.c | 2 +- drivers/irqchip/irq-aspeed-scu-ic.c | 2 +- drivers/irqchip/irq-aspeed-vic.c | 2 +- drivers/irqchip/irq-atmel-aic-common.c | 2 +- drivers/irqchip/irq-bcm2712-mip.c | 2 +- drivers/irqchip/irq-bcm6345-l1.c | 6 +- drivers/irqchip/irq-bcm7038-l1.c | 6 +- drivers/irqchip/irq-bcm7120-l2.c | 6 +- drivers/irqchip/irq-brcmstb-l2.c | 2 +- drivers/irqchip/irq-clps711x.c | 2 +- drivers/irqchip/irq-crossbar.c | 4 +- drivers/irqchip/irq-gic-v2m.c | 2 +- drivers/irqchip/irq-gic-v3-its.c | 24 +++-- drivers/irqchip/irq-gic-v3-mbi.c | 2 +- drivers/irqchip/irq-gic-v3.c | 5 +- drivers/irqchip/irq-gic-v5-irs.c | 4 +- drivers/irqchip/irq-gic-v5-its.c | 6 +- drivers/irqchip/irq-gic-v5-iwb.c | 4 +- drivers/irqchip/irq-goldfish-pic.c | 2 +- drivers/irqchip/irq-idt3243x.c | 2 +- drivers/irqchip/irq-imx-gpcv2.c | 2 +- drivers/irqchip/irq-ingenic-tcu.c | 2 +- drivers/irqchip/irq-ingenic.c | 2 +- drivers/irqchip/irq-loongarch-avec.c | 2 +- drivers/irqchip/irq-loongson-eiointc.c | 4 +- drivers/irqchip/irq-loongson-htpic.c | 2 +- drivers/irqchip/irq-loongson-htvec.c | 2 +- drivers/irqchip/irq-loongson-liointc.c | 2 +- drivers/irqchip/irq-loongson-pch-lpc.c | 2 +- drivers/irqchip/irq-loongson-pch-msi.c | 2 +- drivers/irqchip/irq-loongson-pch-pic.c | 2 +- drivers/irqchip/irq-lpc32xx.c | 2 +- drivers/irqchip/irq-ls1x.c | 2 +- drivers/irqchip/irq-mchp-eic.c | 2 +- drivers/irqchip/irq-meson-gpio.c | 2 +- drivers/irqchip/irq-mips-cpu.c | 2 +- drivers/irqchip/irq-mst-intc.c | 2 +- drivers/irqchip/irq-mtk-cirq.c | 2 +- drivers/irqchip/irq-mtk-sysirq.c | 7 +- drivers/irqchip/irq-mvebu-odmi.c | 2 +- drivers/irqchip/irq-owl-sirq.c | 2 +- drivers/irqchip/irq-pic32-evic.c | 2 +- drivers/irqchip/irq-riscv-imsic-state.c | 10 +- drivers/irqchip/irq-riscv-intc.c | 5 +- drivers/irqchip/irq-sifive-plic.c | 2 +- drivers/irqchip/irq-sni-exiu.c | 2 +- drivers/irqchip/irq-starfive-jh8100-intc.c | 2 +- drivers/irqchip/irq-stm32-exti.c | 7 +- drivers/irqchip/irq-sun4i.c | 4 +- drivers/irqchip/irq-tegra.c | 2 +- drivers/irqchip/irq-ti-sci-inta.c | 2 +- drivers/irqchip/irq-vf610-mscm-ir.c | 2 +- drivers/irqchip/irq-vt8500.c | 2 +- drivers/irqchip/irq-wpcm450-aic.c | 2 +- drivers/irqchip/irq-xilinx-intc.c | 2 +- drivers/irqchip/qcom-pdc.c | 2 +- drivers/isdn/capi/capi.c | 12 +-- drivers/isdn/capi/capiutil.c | 8 +- drivers/isdn/capi/kcapi.c | 2 +- drivers/isdn/hardware/mISDN/avmfritz.c | 2 +- drivers/isdn/hardware/mISDN/hfcmulti.c | 10 +- drivers/isdn/hardware/mISDN/hfcpci.c | 2 +- drivers/isdn/hardware/mISDN/hfcsusb.c | 6 +- drivers/isdn/hardware/mISDN/mISDNinfineon.c | 4 +- drivers/isdn/hardware/mISDN/netjet.c | 2 +- drivers/isdn/hardware/mISDN/speedfax.c | 2 +- drivers/isdn/hardware/mISDN/w6692.c | 2 +- drivers/isdn/mISDN/clock.c | 2 +- drivers/isdn/mISDN/dsp_cmx.c | 4 +- drivers/isdn/mISDN/dsp_pipeline.c | 6 +- drivers/isdn/mISDN/l1oip_core.c | 6 +- drivers/isdn/mISDN/layer1.c | 2 +- drivers/isdn/mISDN/layer2.c | 2 +- drivers/isdn/mISDN/stack.c | 2 +- drivers/isdn/mISDN/tei.c | 6 +- drivers/isdn/mISDN/timerdev.c | 4 +- drivers/leds/led-triggers.c | 2 +- drivers/leds/rgb/leds-qcom-lpg.c | 2 +- drivers/leds/trigger/ledtrig-activity.c | 2 +- drivers/leds/trigger/ledtrig-backlight.c | 2 +- drivers/leds/trigger/ledtrig-gpio.c | 2 +- drivers/leds/trigger/ledtrig-heartbeat.c | 2 +- drivers/leds/trigger/ledtrig-input-events.c | 2 +- drivers/leds/trigger/ledtrig-netdev.c | 2 +- drivers/leds/trigger/ledtrig-oneshot.c | 2 +- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- drivers/leds/trigger/ledtrig-tty.c | 2 +- drivers/leds/uleds.c | 2 +- drivers/macintosh/adb.c | 5 +- drivers/macintosh/adbhid.c | 2 +- drivers/macintosh/mac_hid.c | 2 +- drivers/macintosh/macio_asic.c | 2 +- drivers/macintosh/rack-meter.c | 2 +- drivers/macintosh/smu.c | 2 +- drivers/macintosh/therm_adt746x.c | 2 +- drivers/macintosh/via-pmu.c | 2 +- drivers/macintosh/windfarm_ad7417_sensor.c | 2 +- drivers/macintosh/windfarm_cpufreq_clamp.c | 2 +- drivers/macintosh/windfarm_fcu_controls.c | 4 +- drivers/macintosh/windfarm_lm75_sensor.c | 2 +- drivers/macintosh/windfarm_lm87_sensor.c | 2 +- drivers/macintosh/windfarm_max6690_sensor.c | 2 +- drivers/macintosh/windfarm_pm121.c | 7 +- drivers/macintosh/windfarm_pm81.c | 6 +- drivers/macintosh/windfarm_pm91.c | 11 +-- drivers/macintosh/windfarm_smu_controls.c | 2 +- drivers/macintosh/windfarm_smu_sat.c | 2 +- drivers/macintosh/windfarm_smu_sensors.c | 4 +- drivers/mailbox/bcm74110-mailbox.c | 2 +- drivers/mailbox/mtk-cmdq-mailbox.c | 2 +- drivers/mcb/mcb-core.c | 4 +- drivers/mcb/mcb-parse.c | 5 +- drivers/md/bcache/alloc.c | 2 +- drivers/md/bcache/btree.c | 2 +- drivers/md/bcache/debug.c | 2 +- drivers/md/bcache/super.c | 15 ++- drivers/md/bcache/sysfs.c | 2 +- drivers/md/dm-bio-prison-v1.c | 4 +- drivers/md/dm-bio-prison-v2.c | 2 +- drivers/md/dm-cache-background-tracker.c | 2 +- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-cache-policy-smq.c | 2 +- drivers/md/dm-cache-target.c | 4 +- drivers/md/dm-clone-metadata.c | 2 +- drivers/md/dm-clone-target.c | 4 +- drivers/md/dm-crypt.c | 9 +- drivers/md/dm-delay.c | 2 +- drivers/md/dm-dust.c | 4 +- drivers/md/dm-ebs-target.c | 2 +- drivers/md/dm-era-target.c | 4 +- drivers/md/dm-exception-store.c | 2 +- drivers/md/dm-flakey.c | 2 +- drivers/md/dm-init.c | 4 +- drivers/md/dm-integrity.c | 27 +++--- drivers/md/dm-io.c | 2 +- drivers/md/dm-ioctl.c | 4 +- drivers/md/dm-kcopyd.c | 4 +- drivers/md/dm-linear.c | 2 +- drivers/md/dm-log-userspace-base.c | 2 +- drivers/md/dm-log-writes.c | 4 +- drivers/md/dm-log.c | 4 +- drivers/md/dm-mpath.c | 6 +- drivers/md/dm-path-selector.c | 2 +- drivers/md/dm-pcache/cache.c | 3 +- drivers/md/dm-pcache/cache_key.c | 3 +- drivers/md/dm-pcache/dm_pcache.c | 2 +- drivers/md/dm-ps-historical-service-time.c | 4 +- drivers/md/dm-ps-io-affinity.c | 7 +- drivers/md/dm-ps-queue-length.c | 4 +- drivers/md/dm-ps-round-robin.c | 4 +- drivers/md/dm-ps-service-time.c | 4 +- drivers/md/dm-raid.c | 2 +- drivers/md/dm-raid1.c | 2 +- drivers/md/dm-region-hash.c | 4 +- drivers/md/dm-snap-persistent.c | 6 +- drivers/md/dm-snap-transient.c | 2 +- drivers/md/dm-snap.c | 17 ++-- drivers/md/dm-stats.c | 5 +- drivers/md/dm-stripe.c | 2 +- drivers/md/dm-switch.c | 2 +- drivers/md/dm-table.c | 6 +- drivers/md/dm-target.c | 2 +- drivers/md/dm-thin-metadata.c | 4 +- drivers/md/dm-thin.c | 6 +- drivers/md/dm-unstripe.c | 2 +- drivers/md/dm-verity-fec.c | 2 +- drivers/md/dm-verity-target.c | 8 +- drivers/md/dm-writecache.c | 7 +- drivers/md/dm-zoned-metadata.c | 12 +-- drivers/md/dm-zoned-reclaim.c | 2 +- drivers/md/dm-zoned-target.c | 8 +- drivers/md/md-bitmap.c | 7 +- drivers/md/md-cluster.c | 8 +- drivers/md/md-linear.c | 2 +- drivers/md/md-llbitmap.c | 2 +- drivers/md/md.c | 14 +-- drivers/md/persistent-data/dm-block-manager.c | 2 +- drivers/md/persistent-data/dm-btree.c | 2 +- drivers/md/persistent-data/dm-space-map-disk.c | 4 +- drivers/md/persistent-data/dm-space-map-metadata.c | 2 +- .../md/persistent-data/dm-transaction-manager.c | 6 +- drivers/md/raid0.c | 7 +- drivers/md/raid1.c | 19 ++-- drivers/md/raid10.c | 18 ++-- drivers/md/raid5-cache.c | 4 +- drivers/md/raid5-ppl.c | 6 +- drivers/md/raid5.c | 18 ++-- drivers/media/cec/core/cec-adap.c | 6 +- drivers/media/cec/core/cec-api.c | 2 +- drivers/media/cec/core/cec-core.c | 2 +- drivers/media/cec/core/cec-notifier.c | 2 +- drivers/media/cec/core/cec-pin.c | 2 +- .../extron-da-hd-4k-plus/extron-da-hd-4k-plus.c | 4 +- drivers/media/cec/usb/pulse8/pulse8-cec.c | 2 +- drivers/media/cec/usb/rainshadow/rainshadow-cec.c | 2 +- drivers/media/common/b2c2/flexcop.c | 4 +- drivers/media/common/cypress_firmware.c | 2 +- drivers/media/common/saa7146/saa7146_core.c | 4 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/common/siano/smscoreapi.c | 12 +-- drivers/media/common/siano/smsdvb-debugfs.c | 2 +- drivers/media/common/siano/smsdvb-main.c | 2 +- drivers/media/common/videobuf2/videobuf2-core.c | 6 +- .../media/common/videobuf2/videobuf2-dma-contig.c | 12 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 10 +- drivers/media/common/videobuf2/videobuf2-dvb.c | 2 +- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 8 +- drivers/media/dvb-core/dmxdev.c | 2 +- drivers/media/dvb-core/dvb_ca_en50221.c | 5 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-core/dvbdev.c | 23 +++-- drivers/media/dvb-frontends/a8293.c | 2 +- drivers/media/dvb-frontends/af9013.c | 2 +- drivers/media/dvb-frontends/af9033.c | 2 +- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/ascot2e.c | 2 +- drivers/media/dvb-frontends/atbm8830.c | 2 +- drivers/media/dvb-frontends/bcm3510.c | 2 +- drivers/media/dvb-frontends/cx22700.c | 2 +- drivers/media/dvb-frontends/cx22702.c | 2 +- drivers/media/dvb-frontends/cx24110.c | 2 +- drivers/media/dvb-frontends/cx24113.c | 2 +- drivers/media/dvb-frontends/cx24116.c | 2 +- drivers/media/dvb-frontends/cx24117.c | 2 +- drivers/media/dvb-frontends/cx24120.c | 2 +- drivers/media/dvb-frontends/cx24123.c | 2 +- drivers/media/dvb-frontends/cxd2099.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/dvb-frontends/cxd2841er.c | 2 +- drivers/media/dvb-frontends/cxd2880/cxd2880_top.c | 2 +- drivers/media/dvb-frontends/dib0070.c | 3 +- drivers/media/dvb-frontends/dib0090.c | 5 +- drivers/media/dvb-frontends/dib3000mb.c | 2 +- drivers/media/dvb-frontends/dib3000mc.c | 4 +- drivers/media/dvb-frontends/dib7000m.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 4 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 4 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 +- drivers/media/dvb-frontends/drxd_hard.c | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 2 +- drivers/media/dvb-frontends/ds3000.c | 2 +- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/dvb_dummy_fe.c | 6 +- drivers/media/dvb-frontends/ec100.c | 2 +- drivers/media/dvb-frontends/gp8psk-fe.c | 2 +- drivers/media/dvb-frontends/helene.c | 4 +- drivers/media/dvb-frontends/horus3a.c | 2 +- drivers/media/dvb-frontends/isl6405.c | 2 +- drivers/media/dvb-frontends/isl6421.c | 2 +- drivers/media/dvb-frontends/isl6423.c | 2 +- drivers/media/dvb-frontends/itd1000.c | 2 +- drivers/media/dvb-frontends/ix2505v.c | 2 +- drivers/media/dvb-frontends/l64781.c | 2 +- drivers/media/dvb-frontends/lg2160.c | 2 +- drivers/media/dvb-frontends/lgdt3305.c | 2 +- drivers/media/dvb-frontends/lgdt3306a.c | 2 +- drivers/media/dvb-frontends/lgdt330x.c | 2 +- drivers/media/dvb-frontends/lgs8gl5.c | 2 +- drivers/media/dvb-frontends/lgs8gxx.c | 2 +- drivers/media/dvb-frontends/lnbh25.c | 2 +- drivers/media/dvb-frontends/lnbh29.c | 2 +- drivers/media/dvb-frontends/lnbp21.c | 2 +- drivers/media/dvb-frontends/lnbp22.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 2 +- drivers/media/dvb-frontends/m88rs2000.c | 2 +- drivers/media/dvb-frontends/mb86a16.c | 2 +- drivers/media/dvb-frontends/mb86a20s.c | 2 +- drivers/media/dvb-frontends/mn88472.c | 2 +- drivers/media/dvb-frontends/mn88473.c | 2 +- drivers/media/dvb-frontends/mt312.c | 2 +- drivers/media/dvb-frontends/mt352.c | 2 +- drivers/media/dvb-frontends/mxl5xx.c | 4 +- drivers/media/dvb-frontends/mxl692.c | 2 +- drivers/media/dvb-frontends/nxt200x.c | 2 +- drivers/media/dvb-frontends/nxt6000.c | 2 +- drivers/media/dvb-frontends/or51132.c | 2 +- drivers/media/dvb-frontends/or51211.c | 2 +- drivers/media/dvb-frontends/rtl2830.c | 2 +- drivers/media/dvb-frontends/rtl2832.c | 2 +- drivers/media/dvb-frontends/rtl2832_sdr.c | 2 +- drivers/media/dvb-frontends/s5h1409.c | 2 +- drivers/media/dvb-frontends/s5h1411.c | 2 +- drivers/media/dvb-frontends/s5h1420.c | 3 +- drivers/media/dvb-frontends/s5h1432.c | 2 +- drivers/media/dvb-frontends/s921.c | 2 +- drivers/media/dvb-frontends/si2165.c | 2 +- drivers/media/dvb-frontends/si2168.c | 2 +- drivers/media/dvb-frontends/si21xx.c | 2 +- drivers/media/dvb-frontends/sp2.c | 2 +- drivers/media/dvb-frontends/sp887x.c | 2 +- drivers/media/dvb-frontends/stb0899_drv.c | 2 +- drivers/media/dvb-frontends/stb6000.c | 2 +- drivers/media/dvb-frontends/stb6100.c | 2 +- drivers/media/dvb-frontends/stv0288.c | 2 +- drivers/media/dvb-frontends/stv0297.c | 2 +- drivers/media/dvb-frontends/stv0299.c | 2 +- drivers/media/dvb-frontends/stv0367.c | 14 +-- drivers/media/dvb-frontends/stv0900_core.c | 12 +-- drivers/media/dvb-frontends/stv090x.c | 8 +- drivers/media/dvb-frontends/stv0910.c | 4 +- drivers/media/dvb-frontends/stv6110.c | 2 +- drivers/media/dvb-frontends/stv6110x.c | 4 +- drivers/media/dvb-frontends/stv6111.c | 2 +- drivers/media/dvb-frontends/tc90522.c | 4 +- drivers/media/dvb-frontends/tda10021.c | 2 +- drivers/media/dvb-frontends/tda10023.c | 2 +- drivers/media/dvb-frontends/tda10048.c | 2 +- drivers/media/dvb-frontends/tda1004x.c | 4 +- drivers/media/dvb-frontends/tda10071.c | 2 +- drivers/media/dvb-frontends/tda10086.c | 2 +- drivers/media/dvb-frontends/tda18271c2dd.c | 2 +- drivers/media/dvb-frontends/tda665x.c | 2 +- drivers/media/dvb-frontends/tda8083.c | 2 +- drivers/media/dvb-frontends/tda8261.c | 2 +- drivers/media/dvb-frontends/tda826x.c | 2 +- drivers/media/dvb-frontends/ts2020.c | 2 +- drivers/media/dvb-frontends/tua6100.c | 2 +- drivers/media/dvb-frontends/ves1820.c | 2 +- drivers/media/dvb-frontends/ves1x93.c | 2 +- drivers/media/dvb-frontends/zd1301_demod.c | 2 +- drivers/media/dvb-frontends/zl10036.c | 2 +- drivers/media/dvb-frontends/zl10039.c | 2 +- drivers/media/dvb-frontends/zl10353.c | 2 +- drivers/media/firewire/firedtv-fw.c | 4 +- drivers/media/i2c/alvium-csi2.c | 2 +- drivers/media/i2c/cs3308.c | 2 +- drivers/media/i2c/ds90ub960.c | 4 +- drivers/media/i2c/tda1997x.c | 2 +- drivers/media/i2c/video-i2c.c | 2 +- drivers/media/mc/mc-dev-allocator.c | 2 +- drivers/media/mc/mc-device.c | 2 +- drivers/media/mc/mc-entity.c | 8 +- drivers/media/mc/mc-request.c | 2 +- drivers/media/mmc/siano/smssdio.c | 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/bt8xx/bttv-gpio.c | 2 +- drivers/media/pci/bt8xx/bttv-input.c | 2 +- drivers/media/pci/bt8xx/dst_ca.c | 8 +- drivers/media/pci/bt8xx/dvb-bt8xx.c | 4 +- drivers/media/pci/cobalt/cobalt-alsa-main.c | 2 +- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- drivers/media/pci/cx18/cx18-alsa-main.c | 2 +- drivers/media/pci/cx18/cx18-driver.c | 4 +- drivers/media/pci/cx18/cx18-fileops.c | 2 +- drivers/media/pci/cx18/cx18-queue.c | 5 +- drivers/media/pci/cx18/cx18-streams.c | 2 +- drivers/media/pci/cx23885/altera-ci.c | 12 +-- drivers/media/pci/cx23885/cimax2.c | 2 +- drivers/media/pci/cx23885/cx23885-alsa.c | 2 +- drivers/media/pci/cx23885/cx23885-core.c | 2 +- drivers/media/pci/cx23885/cx23885-input.c | 2 +- drivers/media/pci/cx23885/cx23888-ir.c | 2 +- drivers/media/pci/cx25821/cx25821-alsa.c | 2 +- drivers/media/pci/cx25821/cx25821-core.c | 2 +- drivers/media/pci/cx88/cx88-alsa.c | 2 +- drivers/media/pci/cx88/cx88-cards.c | 2 +- drivers/media/pci/cx88/cx88-dsp.c | 2 +- drivers/media/pci/cx88/cx88-input.c | 2 +- drivers/media/pci/cx88/cx88-mpeg.c | 4 +- drivers/media/pci/cx88/cx88-video.c | 2 +- drivers/media/pci/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/pci/ddbridge/ddbridge-ci.c | 4 +- drivers/media/pci/ddbridge/ddbridge-dummy-fe.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 2 +- drivers/media/pci/intel/ipu-bridge.c | 4 +- drivers/media/pci/intel/ipu6/ipu6-bus.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-buttress.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-dma.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-fw-com.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 +- drivers/media/pci/intel/ipu6/ipu6.c | 4 +- drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 +- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- drivers/media/pci/ivtv/ivtv-queue.c | 8 +- drivers/media/pci/ivtv/ivtvfb.c | 3 +- drivers/media/pci/mantis/hopper_cards.c | 2 +- drivers/media/pci/mantis/mantis_ca.c | 2 +- drivers/media/pci/mantis/mantis_cards.c | 2 +- drivers/media/pci/mgb4/mgb4_core.c | 2 +- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 2 +- drivers/media/pci/pt1/pt1.c | 4 +- drivers/media/pci/pt3/pt3.c | 2 +- drivers/media/pci/saa7134/saa7134-alsa.c | 2 +- drivers/media/pci/saa7134/saa7134-core.c | 4 +- drivers/media/pci/saa7134/saa7134-go7007.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 2 +- drivers/media/pci/saa7146/hexium_gemini.c | 2 +- drivers/media/pci/saa7146/hexium_orion.c | 2 +- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/saa7164/saa7164-buffer.c | 4 +- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/saa7164/saa7164-encoder.c | 2 +- drivers/media/pci/saa7164/saa7164-vbi.c | 2 +- drivers/media/pci/smipcie/smipcie-main.c | 2 +- drivers/media/pci/solo6x10/solo6x10-core.c | 2 +- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 2 +- drivers/media/pci/ttpci/budget-av.c | 2 +- drivers/media/pci/ttpci/budget-ci.c | 2 +- drivers/media/pci/ttpci/budget.c | 2 +- drivers/media/pci/tw686x/tw686x-core.c | 10 +- drivers/media/pci/zoran/videocodec.c | 4 +- drivers/media/pci/zoran/zr36016.c | 2 +- drivers/media/pci/zoran/zr36050.c | 2 +- drivers/media/pci/zoran/zr36060.c | 2 +- drivers/media/platform/allegro-dvt/allegro-core.c | 14 +-- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 2 +- drivers/media/platform/amphion/vdec.c | 9 +- drivers/media/platform/amphion/venc.c | 6 +- drivers/media/platform/amphion/vpu_cmds.c | 4 +- drivers/media/platform/broadcom/bcm2835-unicam.c | 2 +- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- drivers/media/platform/cadence/cdns-csi2tx.c | 2 +- drivers/media/platform/chips-media/coda/coda-bit.c | 2 +- .../media/platform/chips-media/coda/coda-common.c | 2 +- .../media/platform/chips-media/coda/coda-jpeg.c | 6 +- drivers/media/platform/chips-media/coda/imx-vdoa.c | 2 +- .../platform/chips-media/wave5/wave5-vpu-dec.c | 4 +- .../platform/chips-media/wave5/wave5-vpu-enc.c | 4 +- .../media/platform/imagination/e5010-jpeg-enc.c | 2 +- drivers/media/platform/intel/pxa_camera.c | 2 +- drivers/media/platform/m2m-deinterlace.c | 2 +- drivers/media/platform/marvell/cafe-driver.c | 4 +- .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 2 +- drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c | 2 +- .../media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 6 +- .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 +- .../media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 2 +- .../mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 2 +- .../mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 2 +- .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 2 +- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_h264_if.c | 2 +- .../vcodec/decoder/vdec/vdec_h264_req_if.c | 2 +- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 2 +- .../vcodec/decoder/vdec/vdec_hevc_req_multi_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_vp8_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c | 2 +- .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 2 +- .../mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c | 2 +- .../mediatek/vcodec/encoder/venc/venc_h264_if.c | 2 +- .../mediatek/vcodec/encoder/venc/venc_vp8_if.c | 2 +- drivers/media/platform/nuvoton/npcm-video.c | 6 +- .../media/platform/nvidia/tegra-vde/dmabuf-cache.c | 2 +- drivers/media/platform/nvidia/tegra-vde/v4l2.c | 3 +- drivers/media/platform/nvidia/tegra-vde/vde.c | 2 +- drivers/media/platform/nxp/dw100/dw100.c | 2 +- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 +- drivers/media/platform/nxp/imx-pxp.c | 2 +- .../media/platform/nxp/imx8-isi/imx8-isi-core.c | 4 +- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 7 +- drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c | 2 +- drivers/media/platform/nxp/mx2_emmaprp.c | 2 +- drivers/media/platform/qcom/iris/iris_buffer.c | 2 +- .../platform/qcom/iris/iris_hfi_gen1_command.c | 2 +- .../platform/qcom/iris/iris_hfi_gen2_command.c | 2 +- drivers/media/platform/qcom/iris/iris_vdec.c | 4 +- drivers/media/platform/qcom/iris/iris_venc.c | 4 +- drivers/media/platform/qcom/venus/core.c | 4 +- drivers/media/platform/qcom/venus/helpers.c | 4 +- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 2 +- drivers/media/platform/raspberrypi/rp1-cfe/cfe.c | 2 +- .../media/platform/renesas/rcar-vin/rcar-core.c | 2 +- drivers/media/platform/renesas/rcar_fdp1.c | 2 +- drivers/media/platform/renesas/rcar_jpu.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 2 +- drivers/media/platform/renesas/vsp1/vsp1_dl.c | 10 +- drivers/media/platform/renesas/vsp1/vsp1_video.c | 8 +- drivers/media/platform/rockchip/rga/rga.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-h264.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-hevc.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-vp9.c | 2 +- drivers/media/platform/rockchip/rkvdec/rkvdec.c | 2 +- .../media/platform/samsung/exynos-gsc/gsc-m2m.c | 2 +- .../platform/samsung/exynos4-is/fimc-capture.c | 2 +- .../media/platform/samsung/exynos4-is/fimc-m2m.c | 2 +- .../media/platform/samsung/exynos4-is/media-dev.c | 2 +- drivers/media/platform/samsung/s5p-g2d/g2d.c | 2 +- .../media/platform/samsung/s5p-jpeg/jpeg-core.c | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 2 +- drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 2 +- .../media/platform/st/sti/delta/delta-mjpeg-dec.c | 2 +- drivers/media/platform/st/sti/delta/delta-v4l2.c | 4 +- drivers/media/platform/st/sti/hva/hva-v4l2.c | 2 +- drivers/media/platform/st/stm32/dma2d/dma2d.c | 2 +- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 2 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 2 +- .../platform/st/stm32/stm32-dcmipp/dcmipp-common.c | 2 +- .../platform/st/stm32/stm32-dcmipp/dcmipp-input.c | 2 +- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 2 +- .../platform/sunxi/sun8i-rotate/sun8i_rotate.c | 2 +- drivers/media/platform/ti/cal/cal.c | 2 +- drivers/media/platform/ti/davinci/vpif.c | 6 +- drivers/media/platform/ti/davinci/vpif_capture.c | 5 +- drivers/media/platform/ti/davinci/vpif_display.c | 4 +- drivers/media/platform/ti/omap/omap_vout.c | 4 +- drivers/media/platform/ti/omap3isp/isp.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 2 +- drivers/media/platform/ti/omap3isp/isph3a_aewb.c | 4 +- drivers/media/platform/ti/omap3isp/isph3a_af.c | 4 +- drivers/media/platform/ti/omap3isp/isphist.c | 2 +- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 2 +- drivers/media/platform/ti/vpe/vip.c | 4 +- drivers/media/platform/ti/vpe/vpe.c | 2 +- drivers/media/platform/verisilicon/hantro_drv.c | 2 +- drivers/media/platform/via/via-camera.c | 2 +- drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/radio-aimslab.c | 2 +- drivers/media/radio/radio-aztech.c | 2 +- drivers/media/radio/radio-gemtek.c | 2 +- drivers/media/radio/radio-keene.c | 2 +- drivers/media/radio/radio-ma901.c | 2 +- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-mr800.c | 2 +- drivers/media/radio/radio-raremono.c | 2 +- drivers/media/radio/radio-rtrack2.c | 2 +- drivers/media/radio/radio-sf16fmr2.c | 4 +- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c | 2 +- drivers/media/radio/radio-tea5764.c | 2 +- drivers/media/radio/radio-terratec.c | 2 +- drivers/media/radio/radio-trust.c | 2 +- drivers/media/radio/radio-typhoon.c | 2 +- drivers/media/radio/radio-zoltrix.c | 2 +- drivers/media/radio/saa7706h.c | 2 +- drivers/media/radio/si470x/radio-si470x-usb.c | 2 +- drivers/media/radio/si4713/radio-usb-si4713.c | 2 +- drivers/media/radio/tef6862.c | 2 +- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/ene_ir.c | 2 +- drivers/media/rc/fintek-cir.c | 2 +- drivers/media/rc/iguanair.c | 2 +- drivers/media/rc/imon.c | 4 +- drivers/media/rc/ir_toy.c | 2 +- drivers/media/rc/ite-cir.c | 2 +- drivers/media/rc/lirc_dev.c | 4 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/nuvoton-cir.c | 2 +- drivers/media/rc/rc-ir-raw.c | 2 +- drivers/media/rc/rc-loopback.c | 2 +- drivers/media/rc/rc-main.c | 2 +- drivers/media/rc/redrat3.c | 10 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/rc/ttusbir.c | 2 +- drivers/media/rc/winbond-cir.c | 2 +- drivers/media/rc/xbox_remote.c | 2 +- drivers/media/spi/cxd2880-spi.c | 2 +- drivers/media/test-drivers/vicodec/vicodec-core.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 2 +- drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_demod.c | 2 +- drivers/media/test-drivers/vidtv/vidtv_mux.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_psi.c | 35 ++++--- drivers/media/test-drivers/vidtv/vidtv_s302m.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_tuner.c | 2 +- drivers/media/test-drivers/vim2m.c | 4 +- drivers/media/test-drivers/vimc/vimc-capture.c | 2 +- drivers/media/test-drivers/vimc/vimc-core.c | 6 +- drivers/media/test-drivers/vimc/vimc-debayer.c | 2 +- drivers/media/test-drivers/vimc/vimc-lens.c | 2 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 2 +- drivers/media/test-drivers/vimc/vimc-sensor.c | 2 +- drivers/media/test-drivers/visl/visl-core.c | 4 +- drivers/media/test-drivers/visl/visl-debugfs.c | 2 +- drivers/media/test-drivers/vivid/vivid-core.c | 2 +- drivers/media/tuners/e4000.c | 2 +- drivers/media/tuners/fc0011.c | 2 +- drivers/media/tuners/fc0012.c | 2 +- drivers/media/tuners/fc0013.c | 2 +- drivers/media/tuners/fc2580.c | 2 +- drivers/media/tuners/it913x.c | 2 +- drivers/media/tuners/m88rs6000t.c | 2 +- drivers/media/tuners/max2165.c | 2 +- drivers/media/tuners/mc44s803.c | 2 +- drivers/media/tuners/msi001.c | 2 +- drivers/media/tuners/mt2060.c | 2 +- drivers/media/tuners/mt2063.c | 2 +- drivers/media/tuners/mt20xx.c | 2 +- drivers/media/tuners/mt2131.c | 2 +- drivers/media/tuners/mt2266.c | 2 +- drivers/media/tuners/mxl301rf.c | 2 +- drivers/media/tuners/mxl5005s.c | 2 +- drivers/media/tuners/qm1d1b0004.c | 2 +- drivers/media/tuners/qm1d1c0042.c | 2 +- drivers/media/tuners/qt1010.c | 2 +- drivers/media/tuners/si2157.c | 2 +- drivers/media/tuners/tda18212.c | 2 +- drivers/media/tuners/tda18218.c | 2 +- drivers/media/tuners/tda18250.c | 2 +- drivers/media/tuners/tda827x.c | 2 +- drivers/media/tuners/tda8290.c | 2 +- drivers/media/tuners/tea5761.c | 2 +- drivers/media/tuners/tea5767.c | 2 +- drivers/media/tuners/tua9001.c | 2 +- drivers/media/tuners/tuner-i2c.h | 2 +- drivers/media/tuners/xc2028.c | 2 +- drivers/media/tuners/xc4000.c | 2 +- drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/as102/as102_fw.c | 2 +- drivers/media/usb/as102/as102_usb_drv.c | 2 +- drivers/media/usb/au0828/au0828-core.c | 2 +- drivers/media/usb/au0828/au0828-input.c | 2 +- drivers/media/usb/cx231xx/cx231xx-cards.c | 4 +- drivers/media/usb/cx231xx/cx231xx-dvb.c | 2 +- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 +- drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 2 +- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 2 +- drivers/media/usb/dvb-usb/af9005-fe.c | 2 +- drivers/media/usb/dvb-usb/cinergyT2-fe.c | 4 +- drivers/media/usb/dvb-usb/dtt200u-fe.c | 2 +- drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 2 +- drivers/media/usb/dvb-usb/dvb-usb-init.c | 2 +- drivers/media/usb/dvb-usb/vp702x-fe.c | 3 +- drivers/media/usb/dvb-usb/vp7045-fe.c | 3 +- drivers/media/usb/em28xx/em28xx-audio.c | 2 +- drivers/media/usb/em28xx/em28xx-cards.c | 4 +- drivers/media/usb/em28xx/em28xx-dvb.c | 2 +- drivers/media/usb/em28xx/em28xx-input.c | 4 +- drivers/media/usb/em28xx/em28xx-video.c | 2 +- drivers/media/usb/go7007/go7007-driver.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 2 +- drivers/media/usb/go7007/snd-go7007.c | 2 +- drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c | 4 +- drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/hdpvr/hdpvr-core.c | 2 +- drivers/media/usb/hdpvr/hdpvr-video.c | 4 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-context.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 11 +-- drivers/media/usb/pvrusb2/pvrusb2-io.c | 6 +- drivers/media/usb/pvrusb2/pvrusb2-ioread.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-sysfs.c | 8 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 8 +- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/s2255/s2255drv.c | 4 +- drivers/media/usb/siano/smsusb.c | 4 +- drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/usb/ttusb-dec/ttusb_dec.c | 8 +- drivers/media/usb/ttusb-dec/ttusbdecfe.c | 4 +- drivers/media/usb/usbtv/usbtv-core.c | 2 +- drivers/media/usb/uvc/uvc_ctrl.c | 5 +- drivers/media/usb/uvc/uvc_debugfs.c | 2 +- drivers/media/usb/uvc/uvc_driver.c | 6 +- drivers/media/usb/uvc/uvc_metadata.c | 2 +- drivers/media/usb/uvc/uvc_status.c | 2 +- drivers/media/usb/uvc/uvc_v4l2.c | 4 +- drivers/media/usb/uvc/uvc_video.c | 3 +- drivers/media/v4l2-core/tuner-core.c | 2 +- drivers/media/v4l2-core/v4l2-async.c | 2 +- drivers/media/v4l2-core/v4l2-ctrls-api.c | 6 +- drivers/media/v4l2-core/v4l2-ctrls-core.c | 4 +- drivers/media/v4l2-core/v4l2-ctrls-request.c | 4 +- drivers/media/v4l2-core/v4l2-dev.c | 2 +- drivers/media/v4l2-core/v4l2-device.c | 2 +- drivers/media/v4l2-core/v4l2-dv-timings.c | 2 +- drivers/media/v4l2-core/v4l2-event.c | 2 +- drivers/media/v4l2-core/v4l2-fh.c | 2 +- drivers/media/v4l2-core/v4l2-flash-led-class.c | 4 +- drivers/media/v4l2-core/v4l2-fwnode.c | 4 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 4 +- drivers/media/v4l2-core/v4l2-subdev.c | 14 +-- drivers/memory/samsung/exynos-srom.c | 2 +- drivers/memory/tegra/tegra124-emc.c | 2 +- drivers/memory/tegra/tegra124.c | 2 +- drivers/memory/tegra/tegra20-emc.c | 2 +- drivers/memory/tegra/tegra20.c | 4 +- drivers/memory/tegra/tegra30-emc.c | 2 +- drivers/memory/tegra/tegra30.c | 2 +- drivers/memstick/core/memstick.c | 3 +- drivers/memstick/core/ms_block.c | 7 +- drivers/memstick/core/mspro_block.c | 11 +-- drivers/memstick/host/jmb38x_ms.c | 2 +- drivers/message/fusion/mptbase.c | 5 +- drivers/message/fusion/mptfc.c | 6 +- drivers/message/fusion/mptlan.c | 15 ++- drivers/message/fusion/mptsas.c | 38 ++++---- drivers/message/fusion/mptspi.c | 8 +- drivers/mfd/cros_ec_dev.c | 2 +- drivers/mfd/dln2.c | 4 +- drivers/mfd/ezx-pcap.c | 2 +- drivers/mfd/sm501.c | 4 +- drivers/mfd/syscon.c | 4 +- drivers/mfd/timberdale.c | 6 +- drivers/mfd/twl4030-irq.c | 2 +- drivers/mfd/ucb1x00-core.c | 4 +- drivers/mfd/ucb1x00-ts.c | 2 +- drivers/mfd/viperboard.c | 2 +- drivers/mfd/wm831x-auxadc.c | 2 +- drivers/misc/ad525x_dpot.c | 2 +- drivers/misc/altera-stapl/altera.c | 13 ++- drivers/misc/apds9802als.c | 2 +- drivers/misc/apds990x.c | 2 +- drivers/misc/bcm-vk/bcm_vk_dev.c | 2 +- drivers/misc/bcm-vk/bcm_vk_msg.c | 2 +- drivers/misc/bcm-vk/bcm_vk_sg.c | 4 +- drivers/misc/c2port/core.c | 2 +- drivers/misc/cardreader/rtsx_pcr.c | 7 +- drivers/misc/cs5535-mfgpt.c | 2 +- drivers/misc/eeprom/max6875.c | 2 +- drivers/misc/enclosure.c | 2 +- drivers/misc/fastrpc.c | 26 +++--- drivers/misc/genwqe/card_base.c | 5 +- drivers/misc/genwqe/card_ddcb.c | 11 +-- drivers/misc/genwqe/card_debugfs.c | 4 +- drivers/misc/genwqe/card_dev.c | 6 +- drivers/misc/hpilo.c | 4 +- drivers/misc/ibmasm/command.c | 2 +- drivers/misc/ibmasm/event.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 6 +- drivers/misc/ibmasm/module.c | 2 +- drivers/misc/ibmvmc.c | 2 +- drivers/misc/ics932s401.c | 2 +- drivers/misc/isl29003.c | 2 +- drivers/misc/keba/cp500.c | 10 +- drivers/misc/lan966x_pci.c | 2 +- drivers/misc/lis3lv02d/lis3lv02d.c | 2 +- drivers/misc/lkdtm/bugs.c | 6 +- drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 8 +- drivers/misc/mei/bus.c | 2 +- drivers/misc/mei/client.c | 6 +- drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c | 2 +- drivers/misc/mei/hbm.c | 2 +- drivers/misc/mei/hdcp/mei_hdcp.c | 2 +- drivers/misc/mei/interrupt.c | 3 +- drivers/misc/mei/pxp/mei_pxp.c | 2 +- drivers/misc/mei/vsc-fw-loader.c | 2 +- drivers/misc/ntsync.c | 6 +- drivers/misc/ocxl/afu_irq.c | 2 +- drivers/misc/ocxl/context.c | 2 +- drivers/misc/ocxl/core.c | 4 +- drivers/misc/ocxl/file.c | 2 +- drivers/misc/ocxl/link.c | 6 +- drivers/misc/ocxl/pasid.c | 2 +- drivers/misc/pch_phub.c | 2 +- drivers/misc/phantom.c | 2 +- drivers/misc/rpmb-core.c | 2 +- drivers/misc/sgi-gru/grumain.c | 2 +- drivers/misc/sgi-gru/grutlbpurge.c | 2 +- drivers/misc/sgi-xp/xpc_main.c | 10 +- drivers/misc/sgi-xp/xpc_uv.c | 15 ++- drivers/misc/sgi-xp/xpnet.c | 2 +- drivers/misc/sram.c | 2 +- drivers/misc/tifm_core.c | 4 +- drivers/misc/tsl2550.c | 2 +- drivers/misc/uacce/uacce.c | 6 +- drivers/misc/vmw_balloon.c | 2 +- drivers/misc/vmw_vmci/vmci_context.c | 6 +- drivers/misc/vmw_vmci/vmci_datagram.c | 6 +- drivers/misc/vmw_vmci/vmci_doorbell.c | 2 +- drivers/misc/vmw_vmci/vmci_event.c | 2 +- drivers/misc/vmw_vmci/vmci_handle_array.c | 2 +- drivers/misc/vmw_vmci/vmci_host.c | 2 +- drivers/misc/vmw_vmci/vmci_queue_pair.c | 6 +- drivers/mmc/core/block.c | 12 +-- drivers/mmc/core/bus.c | 2 +- drivers/mmc/core/mmc_test.c | 19 ++-- drivers/mmc/core/queue.c | 2 +- drivers/mmc/core/sdio_bus.c | 2 +- drivers/mmc/core/sdio_uart.c | 2 +- drivers/mmc/host/dw_mmc-rockchip.c | 3 +- drivers/mmc/host/dw_mmc.c | 2 +- drivers/mmc/host/mmc_spi.c | 2 +- drivers/mmc/host/of_mmc_spi.c | 2 +- drivers/mmc/host/ushc.c | 6 +- drivers/most/configfs.c | 6 +- drivers/most/core.c | 6 +- drivers/most/most_cdev.c | 2 +- drivers/most/most_snd.c | 4 +- drivers/most/most_usb.c | 12 +-- drivers/mtd/chips/cfi_cmdset_0001.c | 15 ++- drivers/mtd/chips/cfi_cmdset_0002.c | 9 +- drivers/mtd/chips/cfi_cmdset_0020.c | 7 +- drivers/mtd/chips/cfi_probe.c | 3 +- drivers/mtd/chips/gen_probe.c | 2 +- drivers/mtd/chips/jedec_probe.c | 3 +- drivers/mtd/chips/map_absent.c | 2 +- drivers/mtd/chips/map_ram.c | 2 +- drivers/mtd/chips/map_rom.c | 2 +- drivers/mtd/devices/block2mtd.c | 2 +- drivers/mtd/devices/docg3.c | 4 +- drivers/mtd/devices/ms02-nv.c | 12 +-- drivers/mtd/devices/mtd_dataflash.c | 2 +- drivers/mtd/devices/mtd_intel_dg.c | 4 +- drivers/mtd/devices/mtdram.c | 2 +- drivers/mtd/devices/phram.c | 2 +- drivers/mtd/devices/pmc551.c | 4 +- drivers/mtd/devices/slram.c | 6 +- drivers/mtd/ftl.c | 12 +-- drivers/mtd/inftlcore.c | 2 +- drivers/mtd/lpddr/lpddr_cmds.c | 5 +- drivers/mtd/lpddr/qinfo_probe.c | 5 +- drivers/mtd/maps/amd76xrom.c | 2 +- drivers/mtd/maps/ck804xrom.c | 2 +- drivers/mtd/maps/esb2rom.c | 2 +- drivers/mtd/maps/ichxrom.c | 2 +- drivers/mtd/maps/pci.c | 2 +- drivers/mtd/maps/pcmciamtd.c | 2 +- drivers/mtd/maps/pismo.c | 2 +- drivers/mtd/maps/plat-ram.c | 2 +- drivers/mtd/maps/pxa2xx-flash.c | 2 +- drivers/mtd/maps/sa1100-flash.c | 4 +- drivers/mtd/maps/sun_uflash.c | 2 +- drivers/mtd/maps/vmu-flash.c | 14 ++- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/mtd/mtdblock.c | 2 +- drivers/mtd/mtdblock_ro.c | 2 +- drivers/mtd/mtdchar.c | 6 +- drivers/mtd/mtdconcat.c | 7 +- drivers/mtd/mtdpart.c | 2 +- drivers/mtd/mtdswap.c | 4 +- drivers/mtd/nand/ecc-sw-bch.c | 2 +- drivers/mtd/nand/ecc-sw-hamming.c | 2 +- drivers/mtd/nand/onenand/generic.c | 2 +- drivers/mtd/nand/onenand/onenand_base.c | 5 +- drivers/mtd/nand/onenand/onenand_bbt.c | 2 +- drivers/mtd/nand/qpic_common.c | 4 +- drivers/mtd/nand/raw/au1550nd.c | 2 +- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/cs553x_nand.c | 2 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 4 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 6 +- drivers/mtd/nand/raw/nand_bbt.c | 2 +- drivers/mtd/nand/raw/nand_hynix.c | 2 +- drivers/mtd/nand/raw/nand_jedec.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 2 +- drivers/mtd/nand/raw/nand_onfi.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 8 +- drivers/mtd/nand/raw/pasemi_nand.c | 2 +- drivers/mtd/nand/raw/r852.c | 4 +- drivers/mtd/nand/raw/sharpsl.c | 2 +- drivers/mtd/nand/raw/txx9ndfmc.c | 3 +- drivers/mtd/nand/spi/core.c | 2 +- drivers/mtd/nand/spi/gigadevice.c | 2 +- drivers/mtd/nand/spi/macronix.c | 2 +- drivers/mtd/nftlcore.c | 2 +- drivers/mtd/parsers/bcm47xxpart.c | 4 +- drivers/mtd/parsers/brcm_u-boot.c | 2 +- drivers/mtd/parsers/ofpart_core.c | 4 +- drivers/mtd/parsers/parser_trx.c | 4 +- drivers/mtd/parsers/qcomsmempart.c | 2 +- drivers/mtd/parsers/redboot.c | 2 +- drivers/mtd/parsers/scpart.c | 6 +- drivers/mtd/parsers/sharpslpart.c | 5 +- drivers/mtd/parsers/tplink_safeloader.c | 2 +- drivers/mtd/rfd_ftl.c | 8 +- drivers/mtd/sm_ftl.c | 15 ++- drivers/mtd/spi-nor/core.c | 2 +- drivers/mtd/spi-nor/sfdp.c | 2 +- drivers/mtd/ssfdc.c | 2 +- drivers/mtd/tests/stresstest.c | 2 +- drivers/mtd/ubi/attach.c | 4 +- drivers/mtd/ubi/block.c | 2 +- drivers/mtd/ubi/build.c | 2 +- drivers/mtd/ubi/cdev.c | 6 +- drivers/mtd/ubi/eba.c | 21 ++--- drivers/mtd/ubi/fastmap-wl.c | 2 +- drivers/mtd/ubi/fastmap.c | 8 +- drivers/mtd/ubi/gluebi.c | 2 +- drivers/mtd/ubi/kapi.c | 2 +- drivers/mtd/ubi/nvmem.c | 2 +- drivers/mtd/ubi/ubi.h | 2 +- drivers/mtd/ubi/vmt.c | 2 +- drivers/mtd/ubi/vtbl.c | 4 +- drivers/mtd/ubi/wl.c | 4 +- drivers/mux/core.c | 2 +- drivers/net/amt.c | 2 +- drivers/net/arcnet/com20020_cs.c | 2 +- drivers/net/bonding/bond_main.c | 19 ++-- drivers/net/caif/caif_virtio.c | 2 +- drivers/net/can/ctucanfd/ctucanfd_pci.c | 2 +- drivers/net/can/grcan.c | 3 +- drivers/net/can/sja1000/ems_pci.c | 2 +- drivers/net/can/sja1000/ems_pcmcia.c | 2 +- drivers/net/can/sja1000/peak_pci.c | 2 +- drivers/net/can/sja1000/peak_pcmcia.c | 2 +- drivers/net/can/sja1000/plx_pci.c | 2 +- drivers/net/can/softing/softing_cs.c | 2 +- drivers/net/can/softing/softing_main.c | 2 +- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 +- drivers/net/can/usb/esd_usb.c | 12 +-- drivers/net/can/usb/f81604.c | 6 +- drivers/net/can/usb/gs_usb.c | 2 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 24 ++--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 16 ++-- drivers/net/can/usb/nct6694_canfd.c | 6 +- drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 +- drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 7 +- drivers/net/can/usb/ucan.c | 5 +- drivers/net/dsa/bcm_sf2_cfp.c | 2 +- drivers/net/dsa/hirschmann/hellcreek.c | 4 +- drivers/net/dsa/microchip/ksz9477_acl.c | 2 +- drivers/net/dsa/microchip/ksz_common.c | 2 +- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/mv88e6xxx/devlink.c | 15 ++- drivers/net/dsa/mv88e6xxx/pcs-6185.c | 2 +- drivers/net/dsa/mv88e6xxx/pcs-6352.c | 2 +- drivers/net/dsa/mv88e6xxx/pcs-639x.c | 2 +- drivers/net/dsa/ocelot/felix.c | 11 +-- drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +- drivers/net/dsa/sja1105/sja1105_devlink.c | 4 +- drivers/net/dsa/sja1105/sja1105_flower.c | 4 +- drivers/net/dsa/sja1105/sja1105_tas.c | 2 +- drivers/net/dsa/sja1105/sja1105_vl.c | 11 +-- drivers/net/dsa/vitesse-vsc73xx-core.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ethernet/adi/adin1110.c | 2 +- drivers/net/ethernet/agere/et131x.c | 10 +- drivers/net/ethernet/airoha/airoha_npu.c | 10 +- drivers/net/ethernet/airoha/airoha_ppe.c | 4 +- drivers/net/ethernet/alacritech/slicoss.c | 6 +- drivers/net/ethernet/allwinner/sun4i-emac.c | 2 +- drivers/net/ethernet/alteon/acenic.c | 2 +- drivers/net/ethernet/altera/altera_tse_main.c | 6 +- drivers/net/ethernet/amd/lance.c | 2 +- drivers/net/ethernet/amd/pcnet32.c | 22 ++--- drivers/net/ethernet/amd/pds_core/auxbus.c | 2 +- drivers/net/ethernet/amd/pds_core/core.c | 6 +- drivers/net/ethernet/amd/pds_core/dev.c | 2 +- drivers/net/ethernet/amd/pds_core/main.c | 3 +- drivers/net/ethernet/amd/xgbe/xgbe-selftest.c | 2 +- drivers/net/ethernet/apm/xgene-v2/main.c | 6 +- .../net/ethernet/aquantia/atlantic/aq_filters.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_macsec.c | 2 +- .../net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 6 +- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 2 +- drivers/net/ethernet/atheros/ag71xx.c | 2 +- drivers/net/ethernet/atheros/alx/main.c | 10 +- drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 4 +- drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 8 +- drivers/net/ethernet/broadcom/bcmsysport.c | 6 +- drivers/net/ethernet/broadcom/bnge/bnge_auxr.c | 6 +- drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c | 2 +- drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c | 4 +- drivers/net/ethernet/broadcom/bnge/bnge_netdev.c | 42 ++++----- drivers/net/ethernet/broadcom/bnge/bnge_resc.c | 2 +- drivers/net/ethernet/broadcom/bnge/bnge_rmem.c | 6 +- drivers/net/ethernet/broadcom/bnx2.c | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 34 +++---- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 12 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 8 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 16 ++-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 3 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 68 +++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 8 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +- drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 5 +- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 2 +- drivers/net/ethernet/broadcom/cnic.c | 16 ++-- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +- drivers/net/ethernet/broadcom/sb1250-mac.c | 10 +- drivers/net/ethernet/broadcom/tg3.c | 5 +- drivers/net/ethernet/brocade/bna/bnad.c | 16 ++-- drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 8 +- drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 4 +- drivers/net/ethernet/cadence/macb_main.c | 2 +- drivers/net/ethernet/calxeda/xgmac.c | 8 +- drivers/net/ethernet/cavium/liquidio/lio_core.c | 19 ++-- .../net/ethernet/cavium/liquidio/octeon_device.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 8 +- drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 3 +- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 3 +- drivers/net/ethernet/chelsio/cxgb/espi.c | 2 +- drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c | 2 +- drivers/net/ethernet/chelsio/cxgb/mv88x201x.c | 2 +- drivers/net/ethernet/chelsio/cxgb/my3126.c | 2 +- drivers/net/ethernet/chelsio/cxgb/sge.c | 4 +- drivers/net/ethernet/chelsio/cxgb/tp.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/l2t.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c | 4 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 7 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 32 +++---- drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c | 2 +- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 2 +- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c | 7 +- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c | 23 ++--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 25 +++-- drivers/net/ethernet/chelsio/cxgb4/l2t.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/sched.c | 6 +- drivers/net/ethernet/chelsio/cxgb4/smt.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/srq.c | 2 +- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 +- .../chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c | 4 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 4 +- .../chelsio/inline_crypto/chtls/chtls_cm.c | 6 +- .../chelsio/inline_crypto/chtls/chtls_main.c | 8 +- drivers/net/ethernet/cisco/enic/enic_clsf.c | 4 +- drivers/net/ethernet/cisco/enic/enic_main.c | 24 ++--- drivers/net/ethernet/cisco/enic/vnic_dev.c | 4 +- drivers/net/ethernet/cortina/gemini.c | 5 +- drivers/net/ethernet/emulex/benet/be_main.c | 13 ++- drivers/net/ethernet/engleder/tsnep_main.c | 10 +- drivers/net/ethernet/engleder/tsnep_rxnfc.c | 2 +- drivers/net/ethernet/engleder/tsnep_selftests.c | 6 +- drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 2 +- .../ethernet/freescale/dpaa2/dpaa2-eth-devlink.c | 8 +- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 8 +- .../ethernet/freescale/dpaa2/dpaa2-switch-flower.c | 8 +- .../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 19 ++-- drivers/net/ethernet/freescale/enetc/enetc.c | 12 +-- drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 2 +- drivers/net/ethernet/freescale/enetc/enetc_pf.c | 6 +- drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 2 +- drivers/net/ethernet/freescale/enetc/enetc_qos.c | 6 +- drivers/net/ethernet/freescale/fec_main.c | 9 +- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 2 +- drivers/net/ethernet/freescale/fman/fman.c | 6 +- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 6 +- drivers/net/ethernet/freescale/fman/fman_keygen.c | 2 +- drivers/net/ethernet/freescale/fman/fman_mac.h | 5 +- drivers/net/ethernet/freescale/fman/fman_memac.c | 6 +- drivers/net/ethernet/freescale/fman/fman_muram.c | 2 +- drivers/net/ethernet/freescale/fman/fman_port.c | 4 +- drivers/net/ethernet/freescale/fman/fman_tgec.c | 6 +- .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 +- .../net/ethernet/freescale/fs_enet/mii-bitbang.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 2 +- drivers/net/ethernet/freescale/gianfar.c | 22 ++--- drivers/net/ethernet/freescale/gianfar_ethtool.c | 4 +- drivers/net/ethernet/freescale/ucc_geth.c | 10 +- drivers/net/ethernet/fungible/funcore/fun_dev.c | 2 +- drivers/net/ethernet/fungible/funcore/fun_queue.c | 2 +- drivers/net/ethernet/fungible/funeth/funeth_main.c | 8 +- drivers/net/ethernet/google/gve/gve_ethtool.c | 7 +- drivers/net/ethernet/google/gve/gve_flow_rule.c | 2 +- drivers/net/ethernet/google/gve/gve_main.c | 18 ++-- drivers/net/ethernet/google/gve/gve_ptp.c | 2 +- drivers/net/ethernet/google/gve/gve_rx.c | 4 +- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 4 +- drivers/net/ethernet/google/gve/gve_tx.c | 4 +- drivers/net/ethernet/google/gve/gve_tx_dqo.c | 15 ++- drivers/net/ethernet/hisilicon/hns/hnae.c | 4 +- drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 3 +- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 6 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 6 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 18 ++-- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_regs.c | 8 +- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 +- drivers/net/ethernet/huawei/hinic/hinic_debugfs.c | 4 +- drivers/net/ethernet/huawei/hinic/hinic_devlink.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c | 6 +- drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_port.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c | 8 +- drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_filter.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c | 5 +- drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_lld.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_main.c | 5 +- drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c | 4 +- .../net/ethernet/huawei/hinic3/hinic3_netdev_ops.c | 17 ++-- drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c | 6 +- .../ethernet/huawei/hinic3/hinic3_queue_common.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_rx.c | 6 +- drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 12 +-- drivers/net/ethernet/ibm/ehea/ehea_main.c | 10 +- drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 12 +-- drivers/net/ethernet/ibm/ibmveth.c | 2 +- drivers/net/ethernet/ibm/ibmvnic.c | 58 ++++++------ drivers/net/ethernet/intel/e100.c | 2 +- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 16 ++-- drivers/net/ethernet/intel/e1000/e1000_main.c | 8 +- drivers/net/ethernet/intel/e1000e/ethtool.c | 8 +- drivers/net/ethernet/intel/e1000e/netdev.c | 13 ++- drivers/net/ethernet/intel/fm10k/fm10k_main.c | 6 +- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 10 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 +-- drivers/net/ethernet/intel/i40e/i40e_main.c | 33 +++---- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 7 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 +- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 23 +++-- drivers/net/ethernet/intel/iavf/iavf_ptp.c | 2 +- drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 +- drivers/net/ethernet/intel/ice/devlink/port.c | 7 +- drivers/net/ethernet/intel/ice/ice_adapter.c | 2 +- drivers/net/ethernet/intel/ice/ice_arfs.c | 11 +-- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_common.c | 14 +-- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 8 +- drivers/net/ethernet/intel/ice/ice_dpll.c | 4 +- drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 22 ++--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 16 ++-- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 +- drivers/net/ethernet/intel/ice/ice_flow.c | 8 +- drivers/net/ethernet/intel/ice/ice_fw_update.c | 2 +- drivers/net/ethernet/intel/ice/ice_gnss.c | 2 +- drivers/net/ethernet/intel/ice/ice_idc.c | 6 +- drivers/net/ethernet/intel/ice/ice_irq.c | 2 +- drivers/net/ethernet/intel/ice/ice_lag.c | 8 +- drivers/net/ethernet/intel/ice/ice_lib.c | 28 +++--- drivers/net/ethernet/intel/ice/ice_main.c | 32 +++---- drivers/net/ethernet/intel/ice/ice_parser.c | 4 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- drivers/net/ethernet/intel/ice/ice_repr.c | 2 +- drivers/net/ethernet/intel/ice/ice_sf_eth.c | 2 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 2 +- drivers/net/ethernet/intel/ice/ice_switch.c | 14 +-- drivers/net/ethernet/intel/ice/ice_tc_lib.c | 6 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 2 +- drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c | 26 +++--- drivers/net/ethernet/intel/ice/ice_xsk.c | 5 +- drivers/net/ethernet/intel/ice/virt/fdir.c | 6 +- drivers/net/ethernet/intel/ice/virt/rss.c | 2 +- drivers/net/ethernet/intel/ice/virt/virtchnl.c | 4 +- drivers/net/ethernet/intel/idpf/idpf_controlq.c | 7 +- .../net/ethernet/intel/idpf/idpf_controlq_setup.c | 8 +- drivers/net/ethernet/intel/idpf/idpf_dev.c | 3 +- drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 6 +- drivers/net/ethernet/intel/idpf/idpf_idc.c | 15 ++- drivers/net/ethernet/intel/idpf/idpf_lib.c | 20 ++-- drivers/net/ethernet/intel/idpf/idpf_main.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_ptp.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 80 ++++++++-------- drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 3 +- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 64 ++++++------- .../net/ethernet/intel/idpf/idpf_virtchnl_ptp.c | 6 +- drivers/net/ethernet/intel/idpf/xdp.c | 2 +- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 17 ++-- drivers/net/ethernet/intel/igbvf/netdev.c | 7 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- drivers/net/ethernet/intel/igc/igc_leds.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 7 +- drivers/net/ethernet/intel/ixgbe/devlink/devlink.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 8 +- drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 8 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 21 ++--- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 7 +- drivers/net/ethernet/intel/ixgbevf/ipsec.c | 2 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 +- drivers/net/ethernet/intel/libie/fwlog.c | 16 ++-- drivers/net/ethernet/jme.c | 12 +-- drivers/net/ethernet/marvell/mv643xx_eth.c | 3 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 5 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 2 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 5 +- .../net/ethernet/marvell/octeon_ep/octep_main.c | 6 +- .../ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 5 +- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 4 +- .../net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 2 +- .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 4 +- .../ethernet/marvell/octeontx2/af/rvu_devlink.c | 8 +- .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 8 +- .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 +- .../ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 4 +- .../net/ethernet/marvell/octeontx2/af/rvu_rep.c | 2 +- .../ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 6 +- .../ethernet/marvell/octeontx2/nic/otx2_common.c | 4 +- .../ethernet/marvell/octeontx2/nic/otx2_flows.c | 4 +- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 14 +-- .../net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +- .../net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 2 +- drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 18 ++-- drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 6 +- .../net/ethernet/marvell/prestera/prestera_acl.c | 10 +- .../ethernet/marvell/prestera/prestera_counter.c | 10 +- .../ethernet/marvell/prestera/prestera_devlink.c | 7 +- .../net/ethernet/marvell/prestera/prestera_flow.c | 4 +- .../ethernet/marvell/prestera/prestera_flower.c | 2 +- .../net/ethernet/marvell/prestera/prestera_hw.c | 2 +- .../net/ethernet/marvell/prestera/prestera_main.c | 8 +- .../ethernet/marvell/prestera/prestera_router.c | 10 +- .../ethernet/marvell/prestera/prestera_router_hw.c | 10 +- .../net/ethernet/marvell/prestera/prestera_rxtx.c | 6 +- .../net/ethernet/marvell/prestera/prestera_span.c | 4 +- .../ethernet/marvell/prestera/prestera_switchdev.c | 16 ++-- drivers/net/ethernet/marvell/pxa168_eth.c | 4 +- drivers/net/ethernet/marvell/skge.c | 2 +- drivers/net/ethernet/marvell/sky2.c | 8 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +- drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 2 +- drivers/net/ethernet/mediatek/mtk_wed.c | 8 +- drivers/net/ethernet/mellanox/mlx4/alloc.c | 10 +- drivers/net/ethernet/mellanox/mlx4/cmd.c | 30 +++--- drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 16 ++-- drivers/net/ethernet/mellanox/mlx4/en_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 34 +++---- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +- drivers/net/ethernet/mellanox/mlx4/eq.c | 13 ++- drivers/net/ethernet/mellanox/mlx4/icm.c | 11 +-- drivers/net/ethernet/mellanox/mlx4/intf.c | 6 +- drivers/net/ethernet/mellanox/mlx4/main.c | 32 +++---- drivers/net/ethernet/mellanox/mlx4/mcg.c | 10 +- drivers/net/ethernet/mellanox/mlx4/pd.c | 2 +- drivers/net/ethernet/mellanox/mlx4/profile.c | 2 +- drivers/net/ethernet/mellanox/mlx4/qp.c | 8 +- .../net/ethernet/mellanox/mlx4/resource_tracker.c | 58 ++++++------ drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 3 +- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/dev.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 2 +- .../ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 4 +- .../ethernet/mellanox/mlx5/core/diag/rsc_dump.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/dpll.c | 2 +- .../mellanox/mlx5/core/en/fs_tt_redirect.c | 12 +-- drivers/net/ethernet/mellanox/mlx5/core/en/htb.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/mapping.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 14 +-- .../net/ethernet/mellanox/mlx5/core/en/rep/bond.c | 6 +- .../ethernet/mellanox/mlx5/core/en/rep/bridge.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en/rep/neigh.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/rss.c | 8 +- .../net/ethernet/mellanox/mlx5/core/en/rx_res.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/en/selq.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/act_stats.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c | 2 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c | 2 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/int_port.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/tc/meter.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/post_act.c | 6 +- .../ethernet/mellanox/mlx5/core/en/tc/post_meter.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/tc/sample.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 14 +-- .../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 12 +-- drivers/net/ethernet/mellanox/mlx5/core/en/tir.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/pool.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 2 +- .../ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 6 +- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 15 ++- .../mellanox/mlx5/core/en_accel/ipsec_fs.c | 34 +++---- .../mellanox/mlx5/core/en_accel/ipsec_offload.c | 4 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls.c | 2 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c | 6 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 4 +- .../ethernet/mellanox/mlx5/core/en_accel/macsec.c | 16 ++-- .../net/ethernet/mellanox/mlx5/core/en_accel/psp.c | 14 +-- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 9 +- .../net/ethernet/mellanox/mlx5/core/en_common.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 18 ++-- .../ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 12 +-- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 8 +- .../net/ethernet/mellanox/mlx5/core/en_selftest.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 16 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/acl/helper.c | 2 +- .../mellanox/mlx5/core/esw/acl/ingress_lgcy.c | 2 +- .../mellanox/mlx5/core/esw/acl/ingress_ofld.c | 2 +- .../net/ethernet/mellanox/mlx5/core/esw/bridge.c | 18 ++-- .../ethernet/mellanox/mlx5/core/esw/bridge_mcast.c | 16 ++-- .../ethernet/mellanox/mlx5/core/esw/devlink_port.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/indir_table.c | 6 +- .../net/ethernet/mellanox/mlx5/core/esw/legacy.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 9 +- .../net/ethernet/mellanox/mlx5/core/esw/vporttbl.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 +- .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 26 +++--- .../mellanox/mlx5/core/eswitch_offloads_termtbl.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/events.c | 2 +- .../net/ethernet/mellanox/mlx5/core/fpga/conn.c | 12 +-- .../net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 46 +++++---- .../net/ethernet/mellanox/mlx5/core/fs_counters.c | 12 +-- .../net/ethernet/mellanox/mlx5/core/fs_ft_pool.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/hwmon.c | 6 +- .../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 4 +- .../net/ethernet/mellanox/mlx5/core/irq_affinity.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/clock.c | 9 +- .../net/ethernet/mellanox/mlx5/core/lib/crypto.c | 8 +- .../net/ethernet/mellanox/mlx5/core/lib/devcom.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c | 2 +- .../ethernet/mellanox/mlx5/core/lib/fs_chains.c | 6 +- .../net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c | 16 ++-- .../net/ethernet/mellanox/mlx5/core/lib/geneve.c | 3 +- .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c | 8 +- .../mellanox/mlx5/core/lib/ipsec_fs_roce.c | 6 +- .../ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 36 +++---- drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/st.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/vxlan.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +- .../net/ethernet/mellanox/mlx5/core/pagealloc.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/rl.c | 4 +- .../net/ethernet/mellanox/mlx5/core/sf/dev/dev.c | 6 +- .../net/ethernet/mellanox/mlx5/core/sf/devlink.c | 4 +- .../net/ethernet/mellanox/mlx5/core/sf/hw_table.c | 4 +- .../ethernet/mellanox/mlx5/core/sf/vhca_event.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 4 +- .../mellanox/mlx5/core/steering/hws/action.c | 19 ++-- .../mlx5/core/steering/hws/action_ste_pool.c | 4 +- .../mellanox/mlx5/core/steering/hws/buddy.c | 2 +- .../ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 14 +-- .../ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 2 +- .../mellanox/mlx5/core/steering/hws/context.c | 4 +- .../mellanox/mlx5/core/steering/hws/definer.c | 8 +- .../mellanox/mlx5/core/steering/hws/fs_hws.c | 18 ++-- .../mellanox/mlx5/core/steering/hws/fs_hws_pools.c | 8 +- .../mellanox/mlx5/core/steering/hws/matcher.c | 12 +-- .../mellanox/mlx5/core/steering/hws/pat_arg.c | 4 +- .../mellanox/mlx5/core/steering/hws/pool.c | 4 +- .../mellanox/mlx5/core/steering/hws/rule.c | 2 +- .../mellanox/mlx5/core/steering/hws/send.c | 20 ++-- .../mellanox/mlx5/core/steering/hws/table.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_action.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_arg.c | 6 +- .../mellanox/mlx5/core/steering/sws/dr_buddy.c | 10 +- .../mellanox/mlx5/core/steering/sws/dr_dbg.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_definer.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_domain.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_fw.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_icm_pool.c | 15 ++- .../mellanox/mlx5/core/steering/sws/dr_matcher.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_ptrn.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_rule.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_send.c | 12 +-- .../mellanox/mlx5/core/steering/sws/dr_table.c | 2 +- .../mellanox/mlx5/core/steering/sws/fs_dr.c | 12 +-- drivers/net/ethernet/mellanox/mlx5/core/vport.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/wc.c | 2 +- drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/core.c | 14 +-- .../mellanox/mlxsw/core_acl_flex_actions.c | 22 ++--- .../ethernet/mellanox/mlxsw/core_acl_flex_keys.c | 8 +- drivers/net/ethernet/mellanox/mlxsw/core_env.c | 15 ++- drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 4 +- .../ethernet/mellanox/mlxsw/core_linecard_dev.c | 2 +- .../net/ethernet/mellanox/mlxsw/core_linecards.c | 13 ++- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 14 ++- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 14 +-- drivers/net/ethernet/mellanox/mlxsw/pci.c | 10 +- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 23 +++-- .../net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c | 3 +- .../ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c | 4 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 2 +- .../ethernet/mellanox/mlxsw/spectrum_acl_atcam.c | 6 +- .../mellanox/mlxsw/spectrum_acl_bloom_filter.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c | 10 +- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 15 ++- drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c | 3 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c | 12 +-- drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_flow.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_matchall.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c | 10 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c | 6 +- .../net/ethernet/mellanox/mlxsw/spectrum_policer.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_port_range.c | 4 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 10 +- .../net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 16 ++-- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 62 ++++++------- .../net/ethernet/mellanox/mlxsw/spectrum_span.c | 6 +- .../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 16 ++-- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +- drivers/net/ethernet/micrel/ksz884x.c | 8 +- drivers/net/ethernet/microchip/lan743x_main.c | 5 +- .../net/ethernet/microchip/lan966x/lan966x_fdb.c | 4 +- .../net/ethernet/microchip/lan966x/lan966x_fdma.c | 4 +- .../net/ethernet/microchip/lan966x/lan966x_mac.c | 2 +- .../net/ethernet/microchip/lan966x/lan966x_mdb.c | 4 +- .../ethernet/microchip/lan966x/lan966x_vcap_impl.c | 4 +- .../microchip/sparx5/lan969x/lan969x_fdma.c | 4 +- .../ethernet/microchip/sparx5/sparx5_calendar.c | 2 +- .../net/ethernet/microchip/sparx5/sparx5_main.c | 4 +- .../ethernet/microchip/sparx5/sparx5_switchdev.c | 4 +- .../ethernet/microchip/sparx5/sparx5_tc_flower.c | 2 +- .../ethernet/microchip/sparx5/sparx5_tc_matchall.c | 2 +- .../ethernet/microchip/sparx5/sparx5_vcap_impl.c | 4 +- drivers/net/ethernet/microchip/vcap/vcap_api.c | 14 +-- .../net/ethernet/microchip/vcap/vcap_api_kunit.c | 4 +- drivers/net/ethernet/microsoft/mana/gdma_main.c | 18 ++-- drivers/net/ethernet/microsoft/mana/hw_channel.c | 12 +-- drivers/net/ethernet/microsoft/mana/mana_en.c | 29 +++--- drivers/net/ethernet/mscc/ocelot.c | 12 +-- drivers/net/ethernet/mscc/ocelot_flower.c | 2 +- drivers/net/ethernet/mscc/ocelot_mrp.c | 2 +- drivers/net/ethernet/mscc/ocelot_vcap.c | 2 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 4 +- drivers/net/ethernet/netronome/nfp/abm/cls.c | 2 +- drivers/net/ethernet/netronome/nfp/abm/main.c | 4 +- drivers/net/ethernet/netronome/nfp/abm/qdisc.c | 2 +- drivers/net/ethernet/netronome/nfp/bpf/main.c | 4 +- drivers/net/ethernet/netronome/nfp/bpf/offload.c | 11 +-- drivers/net/ethernet/netronome/nfp/bpf/verifier.c | 4 +- .../net/ethernet/netronome/nfp/flower/conntrack.c | 6 +- .../net/ethernet/netronome/nfp/flower/lag_conf.c | 6 +- drivers/net/ethernet/netronome/nfp/flower/main.c | 6 +- .../net/ethernet/netronome/nfp/flower/metadata.c | 11 +-- .../net/ethernet/netronome/nfp/flower/offload.c | 12 +-- .../net/ethernet/netronome/nfp/flower/qos_conf.c | 2 +- .../ethernet/netronome/nfp/flower/tunnel_conf.c | 8 +- drivers/net/ethernet/netronome/nfp/nfd3/rings.c | 4 +- drivers/net/ethernet/netronome/nfp/nfdk/rings.c | 4 +- drivers/net/ethernet/netronome/nfp/nfp_app.c | 2 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 6 +- drivers/net/ethernet/netronome/nfp/nfp_net_dp.c | 6 +- .../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 4 +- drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +- .../net/ethernet/netronome/nfp/nfp_netvf_main.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_port.c | 2 +- .../net/ethernet/netronome/nfp/nfp_shared_buf.c | 4 +- .../ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c | 2 +- .../ethernet/netronome/nfp/nfpcore/nfp_cppcore.c | 4 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_mip.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 4 +- .../ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c | 4 +- .../ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c | 2 +- .../ethernet/netronome/nfp/nfpcore/nfp_resource.c | 2 +- drivers/net/ethernet/netronome/nfp/nic/main.c | 2 +- drivers/net/ethernet/nvidia/forcedeth.c | 6 +- drivers/net/ethernet/pasemi/pasemi_mac.c | 10 +- drivers/net/ethernet/pensando/ionic/ionic_aux.c | 2 +- .../net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 +- drivers/net/ethernet/pensando/ionic/ionic_dev.c | 4 +- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 10 +- drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +- .../net/ethernet/qlogic/netxen/netxen_nic_init.c | 8 +- .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 10 +- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_debug.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_dev.c | 34 +++---- drivers/net/ethernet/qlogic/qed/qed_fcoe.c | 10 +- drivers/net/ethernet/qlogic/qed/qed_hw.c | 2 +- .../net/ethernet/qlogic/qed/qed_init_fw_funcs.c | 4 +- drivers/net/ethernet/qlogic/qed/qed_init_ops.c | 3 +- drivers/net/ethernet/qlogic/qed/qed_int.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_iscsi.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 17 ++-- drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_ll2.c | 14 +-- drivers/net/ethernet/qlogic/qed/qed_main.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 9 +- drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_ooo.c | 18 ++-- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_spq.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 4 +- drivers/net/ethernet/qlogic/qed/qed_vf.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_filter.c | 8 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 22 ++--- drivers/net/ethernet/qlogic/qede/qede_ptp.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_rdma.c | 2 +- drivers/net/ethernet/qlogic/qla3xxx.c | 5 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 6 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c | 6 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 6 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 4 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 41 ++++---- .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 3 +- .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 14 +-- .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 +- drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 4 +- drivers/net/ethernet/realtek/r8169_leds.c | 4 +- drivers/net/ethernet/realtek/r8169_main.c | 2 +- drivers/net/ethernet/renesas/ravb_main.c | 10 +- drivers/net/ethernet/renesas/rswitch_main.c | 8 +- drivers/net/ethernet/renesas/rtsn.c | 4 +- drivers/net/ethernet/renesas/sh_eth.c | 8 +- drivers/net/ethernet/rocker/rocker_main.c | 16 ++-- drivers/net/ethernet/rocker/rocker_ofdpa.c | 28 +++--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 9 +- drivers/net/ethernet/sfc/ef10.c | 6 +- drivers/net/ethernet/sfc/ef100.c | 2 +- drivers/net/ethernet/sfc/ef100_nic.c | 4 +- drivers/net/ethernet/sfc/ef10_sriov.c | 3 +- drivers/net/ethernet/sfc/efx.c | 2 +- drivers/net/ethernet/sfc/efx_channels.c | 10 +- drivers/net/ethernet/sfc/efx_common.c | 4 +- drivers/net/ethernet/sfc/ethtool_common.c | 2 +- drivers/net/ethernet/sfc/falcon/efx.c | 4 +- drivers/net/ethernet/sfc/falcon/ethtool.c | 2 +- drivers/net/ethernet/sfc/falcon/falcon.c | 6 +- drivers/net/ethernet/sfc/falcon/farch.c | 2 +- drivers/net/ethernet/sfc/falcon/qt202x_phy.c | 2 +- drivers/net/ethernet/sfc/falcon/rx.c | 7 +- drivers/net/ethernet/sfc/falcon/selftest.c | 6 +- drivers/net/ethernet/sfc/falcon/tenxpress.c | 2 +- drivers/net/ethernet/sfc/falcon/tx.c | 8 +- drivers/net/ethernet/sfc/falcon/txc43128_phy.c | 2 +- drivers/net/ethernet/sfc/mae.c | 14 ++- drivers/net/ethernet/sfc/mcdi.c | 2 +- drivers/net/ethernet/sfc/mcdi_filters.c | 6 +- drivers/net/ethernet/sfc/mcdi_mon.c | 6 +- drivers/net/ethernet/sfc/mcdi_port_common.c | 2 +- drivers/net/ethernet/sfc/ptp.c | 4 +- drivers/net/ethernet/sfc/rx_common.c | 9 +- drivers/net/ethernet/sfc/selftest.c | 6 +- drivers/net/ethernet/sfc/siena/efx_channels.c | 10 +- drivers/net/ethernet/sfc/siena/efx_common.c | 4 +- drivers/net/ethernet/sfc/siena/ethtool_common.c | 2 +- drivers/net/ethernet/sfc/siena/farch.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi_mon.c | 6 +- drivers/net/ethernet/sfc/siena/mcdi_port_common.c | 2 +- drivers/net/ethernet/sfc/siena/ptp.c | 2 +- drivers/net/ethernet/sfc/siena/rx_common.c | 9 +- drivers/net/ethernet/sfc/siena/selftest.c | 6 +- drivers/net/ethernet/sfc/siena/siena.c | 4 +- drivers/net/ethernet/sfc/siena/siena_sriov.c | 5 +- drivers/net/ethernet/sfc/siena/tx_common.c | 8 +- drivers/net/ethernet/sfc/tc.c | 34 +++---- drivers/net/ethernet/sfc/tc_bindings.c | 2 +- drivers/net/ethernet/sfc/tc_conntrack.c | 4 +- drivers/net/ethernet/sfc/tc_counters.c | 4 +- drivers/net/ethernet/sfc/tc_encap_actions.c | 4 +- drivers/net/ethernet/sfc/tx_common.c | 8 +- drivers/net/ethernet/sis/sis190.c | 2 +- drivers/net/ethernet/sis/sis900.c | 2 +- drivers/net/ethernet/smsc/smsc9420.c | 10 +- drivers/net/ethernet/socionext/netsec.c | 2 +- drivers/net/ethernet/socionext/sni_ave.c | 6 +- drivers/net/ethernet/spacemit/k1_emac.c | 10 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 17 ++-- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 36 +++---- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/ldmvsw.c | 2 +- drivers/net/ethernet/sun/niu.c | 11 +-- drivers/net/ethernet/sun/sunhme.c | 4 +- drivers/net/ethernet/sun/sunqe.c | 2 +- drivers/net/ethernet/sun/sunvnet.c | 2 +- drivers/net/ethernet/sun/sunvnet_common.c | 2 +- drivers/net/ethernet/sunplus/spl2sw_desc.c | 5 +- drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c | 17 ++-- drivers/net/ethernet/ti/am65-cpsw-switchdev.c | 2 +- drivers/net/ethernet/ti/cpsw_switchdev.c | 2 +- drivers/net/ethernet/ti/icssg/icssg_switchdev.c | 2 +- .../net/ethernet/ti/icssm/icssm_prueth_switch.c | 6 +- drivers/net/ethernet/ti/icssm/icssm_switchdev.c | 2 +- drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 6 +- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 7 +- drivers/net/ethernet/via/via-velocity.c | 12 +-- drivers/net/ethernet/wangxun/libwx/wx_hw.c | 5 +- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 9 +- drivers/net/ethernet/wangxun/libwx/wx_mbx.c | 3 +- drivers/net/ethernet/wangxun/libwx/wx_sriov.c | 6 +- drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c | 2 +- drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c | 4 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 12 +-- drivers/net/fjes/fjes_hw.c | 3 +- drivers/net/geneve.c | 2 +- drivers/net/gtp.c | 10 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/hyperv/netvsc.c | 7 +- drivers/net/hyperv/netvsc_drv.c | 9 +- drivers/net/hyperv/rndis_filter.c | 4 +- drivers/net/ieee802154/at86rf230.c | 2 +- drivers/net/ieee802154/ca8210.c | 8 +- drivers/net/ieee802154/mac802154_hwsim.c | 10 +- drivers/net/ifb.c | 2 +- drivers/net/ipa/gsi_trans.c | 7 +- drivers/net/ipa/ipa_interrupt.c | 2 +- drivers/net/ipa/ipa_main.c | 2 +- drivers/net/ipa/ipa_smp2p.c | 2 +- drivers/net/ipvlan/ipvlan_main.c | 4 +- drivers/net/macsec.c | 8 +- drivers/net/macvlan.c | 6 +- drivers/net/mctp/mctp-i2c.c | 2 +- drivers/net/mctp/mctp-i3c.c | 2 +- drivers/net/netconsole.c | 4 +- drivers/net/netdevsim/bpf.c | 4 +- drivers/net/netdevsim/bus.c | 2 +- drivers/net/netdevsim/dev.c | 22 ++--- drivers/net/netdevsim/fib.c | 14 +-- drivers/net/netdevsim/hwstats.c | 2 +- drivers/net/netdevsim/netdev.c | 5 +- drivers/net/netdevsim/psample.c | 2 +- drivers/net/netkit.c | 2 +- drivers/net/ovpn/bind.c | 2 +- drivers/net/ovpn/crypto_aead.c | 2 +- drivers/net/ovpn/main.c | 2 +- drivers/net/ovpn/peer.c | 2 +- drivers/net/ovpn/socket.c | 2 +- drivers/net/pcs/pcs-lynx.c | 2 +- drivers/net/pcs/pcs-mtk-lynxi.c | 2 +- drivers/net/pcs/pcs-rzn1-miic.c | 6 +- drivers/net/pcs/pcs-xpcs.c | 2 +- drivers/net/phy/as21xxx.c | 2 +- drivers/net/phy/dp83640.c | 9 +- drivers/net/phy/mdio_device.c | 2 +- drivers/net/phy/micrel.c | 2 +- drivers/net/phy/microchip_rds_ptp.c | 2 +- drivers/net/phy/mii_timestamper.c | 2 +- drivers/net/phy/mscc/mscc_macsec.c | 2 +- drivers/net/phy/nxp-c45-tja11xx-macsec.c | 4 +- drivers/net/phy/phy.c | 2 +- drivers/net/phy/phy_device.c | 4 +- drivers/net/phy/phy_led_triggers.c | 9 +- drivers/net/phy/phy_link_topology.c | 4 +- drivers/net/phy/phy_package.c | 2 +- drivers/net/phy/phy_port.c | 2 +- drivers/net/phy/phylink.c | 2 +- drivers/net/phy/sfp-bus.c | 2 +- drivers/net/phy/sfp.c | 2 +- drivers/net/ppp/bsd_comp.c | 3 +- drivers/net/ppp/ppp_async.c | 2 +- drivers/net/ppp/ppp_deflate.c | 5 +- drivers/net/ppp/ppp_generic.c | 4 +- drivers/net/ppp/ppp_mppe.c | 2 +- drivers/net/ppp/ppp_synctty.c | 2 +- drivers/net/pse-pd/pd692x0.c | 8 +- drivers/net/pse-pd/pse_core.c | 4 +- drivers/net/pse-pd/tps23881.c | 3 +- drivers/net/rionet.c | 2 +- drivers/net/slip/slhc.c | 2 +- drivers/net/slip/slip.c | 3 +- drivers/net/tap.c | 4 +- drivers/net/team/team_core.c | 12 +-- drivers/net/team/team_mode_loadbalance.c | 4 +- drivers/net/tun.c | 6 +- drivers/net/usb/aqc111.c | 2 +- drivers/net/usb/asix_devices.c | 2 +- drivers/net/usb/ax88172a.c | 2 +- drivers/net/usb/ax88179_178a.c | 2 +- drivers/net/usb/cdc_ncm.c | 2 +- drivers/net/usb/cx82310_eth.c | 2 +- drivers/net/usb/hso.c | 15 ++- drivers/net/usb/lan78xx.c | 4 +- drivers/net/usb/lg-vl600.c | 2 +- drivers/net/usb/pegasus.c | 2 +- drivers/net/usb/r8152.c | 2 +- drivers/net/usb/rtl8150.c | 2 +- drivers/net/usb/sierra_net.c | 2 +- drivers/net/usb/smsc75xx.c | 4 +- drivers/net/usb/smsc95xx.c | 2 +- drivers/net/usb/usbnet.c | 5 +- drivers/net/veth.c | 4 +- drivers/net/virtio_net.c | 34 +++---- drivers/net/vrf.c | 2 +- drivers/net/vxlan/vxlan_core.c | 6 +- drivers/net/vxlan/vxlan_mdb.c | 10 +- drivers/net/vxlan/vxlan_vnifilter.c | 4 +- drivers/net/wan/c101.c | 2 +- drivers/net/wan/farsync.c | 2 +- drivers/net/wan/framer/framer-core.c | 4 +- drivers/net/wan/framer/pef2256/pef2256.c | 2 +- drivers/net/wan/fsl_ucc_hdlc.c | 17 ++-- drivers/net/wan/hdlc_fr.c | 2 +- drivers/net/wan/n2.c | 2 +- drivers/net/wan/pc300too.c | 2 +- drivers/net/wan/pci200syn.c | 2 +- drivers/net/wan/wanxl.c | 2 +- drivers/net/wireguard/noise.c | 2 +- drivers/net/wireguard/peerlookup.c | 4 +- drivers/net/wireguard/ratelimiter.c | 4 +- drivers/net/wireguard/selftest/allowedips.c | 10 +- drivers/net/wireguard/selftest/counter.c | 2 +- drivers/net/wireless/ath/ar5523/ar5523.c | 4 +- drivers/net/wireless/ath/ath10k/ce.c | 16 ++-- drivers/net/wireless/ath/ath10k/htt_rx.c | 3 +- drivers/net/wireless/ath/ath10k/mac.c | 11 +-- drivers/net/wireless/ath/ath10k/qmi.c | 10 +- drivers/net/wireless/ath/ath10k/sdio.c | 4 +- drivers/net/wireless/ath/ath10k/txrx.c | 2 +- drivers/net/wireless/ath/ath10k/usb.c | 2 +- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 10 +- drivers/net/wireless/ath/ath10k/wmi.c | 28 +++--- drivers/net/wireless/ath/ath10k/wow.c | 4 +- drivers/net/wireless/ath/ath11k/ce.c | 2 +- drivers/net/wireless/ath/ath11k/cfr.c | 3 +- drivers/net/wireless/ath/ath11k/dbring.c | 2 +- drivers/net/wireless/ath/ath11k/debugfs.c | 9 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +- drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- drivers/net/wireless/ath/ath11k/mac.c | 16 ++-- drivers/net/wireless/ath/ath11k/mhi.c | 2 +- drivers/net/wireless/ath/ath11k/peer.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.c | 12 +-- drivers/net/wireless/ath/ath11k/reg.c | 3 +- drivers/net/wireless/ath/ath11k/wmi.c | 20 ++-- drivers/net/wireless/ath/ath11k/wow.c | 4 +- drivers/net/wireless/ath/ath12k/ce.c | 2 +- drivers/net/wireless/ath/ath12k/core.c | 2 +- drivers/net/wireless/ath/ath12k/dp.c | 26 +++--- drivers/net/wireless/ath/ath12k/dp_htt.c | 2 +- drivers/net/wireless/ath/ath12k/dp_peer.c | 10 +- drivers/net/wireless/ath/ath12k/dp_rx.c | 4 +- drivers/net/wireless/ath/ath12k/mac.c | 37 ++++---- drivers/net/wireless/ath/ath12k/mhi.c | 2 +- drivers/net/wireless/ath/ath12k/peer.c | 2 +- drivers/net/wireless/ath/ath12k/qmi.c | 12 +-- drivers/net/wireless/ath/ath12k/reg.c | 2 +- drivers/net/wireless/ath/ath12k/wifi7/dp.c | 2 +- drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c | 8 +- drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c | 2 +- drivers/net/wireless/ath/ath12k/wmi.c | 13 ++- drivers/net/wireless/ath/ath12k/wow.c | 6 +- drivers/net/wireless/ath/ath5k/base.c | 4 +- drivers/net/wireless/ath/ath5k/debug.c | 2 +- drivers/net/wireless/ath/ath5k/eeprom.c | 33 ++++--- drivers/net/wireless/ath/ath6kl/core.c | 2 +- drivers/net/wireless/ath/ath6kl/htc_mbox.c | 6 +- drivers/net/wireless/ath/ath6kl/htc_pipe.c | 8 +- drivers/net/wireless/ath/ath6kl/main.c | 6 +- drivers/net/wireless/ath/ath6kl/sdio.c | 2 +- drivers/net/wireless/ath/ath6kl/txrx.c | 4 +- drivers/net/wireless/ath/ath6kl/usb.c | 5 +- drivers/net/wireless/ath/ath6kl/wmi.c | 2 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 12 +-- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 6 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/mci.c | 2 +- drivers/net/wireless/ath/ath9k/wmi.c | 2 +- drivers/net/wireless/ath/carl9170/cmd.c | 2 +- drivers/net/wireless/ath/carl9170/main.c | 3 +- drivers/net/wireless/ath/carl9170/tx.c | 2 +- drivers/net/wireless/ath/dfs_pattern_detector.c | 4 +- drivers/net/wireless/ath/dfs_pri_detector.c | 6 +- drivers/net/wireless/ath/wcn36xx/dxe.c | 2 +- drivers/net/wireless/ath/wcn36xx/main.c | 2 +- drivers/net/wireless/ath/wcn36xx/smd.c | 10 +- drivers/net/wireless/ath/wil6210/cfg80211.c | 4 +- drivers/net/wireless/ath/wil6210/debugfs.c | 7 +- drivers/net/wireless/ath/wil6210/fw_inc.c | 4 +- drivers/net/wireless/ath/wil6210/pmc.c | 5 +- drivers/net/wireless/ath/wil6210/rx_reorder.c | 4 +- drivers/net/wireless/ath/wil6210/txrx.c | 2 +- drivers/net/wireless/ath/wil6210/txrx_edma.c | 7 +- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- drivers/net/wireless/atmel/at76c50x-usb.c | 20 ++-- drivers/net/wireless/broadcom/b43/bus.c | 4 +- drivers/net/wireless/broadcom/b43/debugfs.c | 6 +- drivers/net/wireless/broadcom/b43/dma.c | 6 +- drivers/net/wireless/broadcom/b43/lo.c | 2 +- drivers/net/wireless/broadcom/b43/main.c | 4 +- drivers/net/wireless/broadcom/b43/phy_ac.c | 2 +- drivers/net/wireless/broadcom/b43/phy_g.c | 4 +- drivers/net/wireless/broadcom/b43/phy_ht.c | 2 +- drivers/net/wireless/broadcom/b43/phy_lcn.c | 2 +- drivers/net/wireless/broadcom/b43/phy_lp.c | 2 +- drivers/net/wireless/broadcom/b43/phy_n.c | 4 +- drivers/net/wireless/broadcom/b43/pio.c | 4 +- drivers/net/wireless/broadcom/b43/sdio.c | 2 +- drivers/net/wireless/broadcom/b43legacy/debugfs.c | 6 +- drivers/net/wireless/broadcom/b43legacy/dma.c | 6 +- drivers/net/wireless/broadcom/b43legacy/main.c | 7 +- drivers/net/wireless/broadcom/b43legacy/pio.c | 2 +- .../broadcom/brcm80211/brcmfmac/bca/core.c | 3 +- .../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +- .../wireless/broadcom/brcm80211/brcmfmac/btcoex.c | 2 +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 +++-- .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 4 +- .../wireless/broadcom/brcm80211/brcmfmac/common.c | 5 +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +- .../broadcom/brcm80211/brcmfmac/cyw/core.c | 3 +- .../broadcom/brcm80211/brcmfmac/firmware.c | 4 +- .../broadcom/brcm80211/brcmfmac/flowring.c | 9 +- .../wireless/broadcom/brcm80211/brcmfmac/fweh.c | 2 +- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 5 +- .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 12 +-- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 16 ++-- .../net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 4 +- .../wireless/broadcom/brcm80211/brcmfmac/proto.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +- .../broadcom/brcm80211/brcmfmac/wcc/core.c | 3 +- .../wireless/broadcom/brcm80211/brcmsmac/aiutils.c | 2 +- .../wireless/broadcom/brcm80211/brcmsmac/ampdu.c | 2 +- .../wireless/broadcom/brcm80211/brcmsmac/antsel.c | 2 +- .../wireless/broadcom/brcm80211/brcmsmac/channel.c | 2 +- .../net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 2 +- .../broadcom/brcm80211/brcmsmac/mac80211_if.c | 2 +- .../wireless/broadcom/brcm80211/brcmsmac/main.c | 29 +++--- .../broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 4 +- .../broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 6 +- .../broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 +- .../broadcom/brcm80211/brcmsmac/phy_shim.c | 2 +- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 20 ++-- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 22 ++--- drivers/net/wireless/intel/ipw2x00/libipw_crypto.c | 2 +- .../wireless/intel/ipw2x00/libipw_crypto_ccmp.c | 2 +- .../wireless/intel/ipw2x00/libipw_crypto_tkip.c | 2 +- .../net/wireless/intel/ipw2x00/libipw_crypto_wep.c | 2 +- drivers/net/wireless/intel/ipw2x00/libipw_module.c | 4 +- drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 2 +- drivers/net/wireless/intel/ipw2x00/libipw_wx.c | 5 +- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 +- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 4 +- drivers/net/wireless/intel/iwlegacy/common.c | 23 ++--- drivers/net/wireless/intel/iwlwifi/dvm/calib.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/devices.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c | 3 +- drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/rx.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/tt.c | 12 +-- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 8 +- drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 6 +- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 29 +++--- drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c | 15 ++- drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 4 +- drivers/net/wireless/intel/iwlwifi/mei/main.c | 4 +- drivers/net/wireless/intel/iwlwifi/mld/d3.c | 20 ++-- drivers/net/wireless/intel/iwlwifi/mld/iface.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/link.c | 2 +- .../net/wireless/intel/iwlwifi/mld/low_latency.c | 4 +- drivers/net/wireless/intel/iwlwifi/mld/mac80211.c | 3 +- drivers/net/wireless/intel/iwlwifi/mld/notif.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/scan.c | 6 +- drivers/net/wireless/intel/iwlwifi/mld/sta.c | 12 +-- drivers/net/wireless/intel/iwlwifi/mld/time_sync.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 12 +-- .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 +- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 7 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 +- .../net/wireless/intel/iwlwifi/pcie/ctxt-info.c | 4 +- .../net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c | 15 ++- .../net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c | 4 +- .../wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c | 4 +- .../net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c | 12 +-- drivers/net/wireless/intersil/p54/eeprom.c | 18 ++-- drivers/net/wireless/intersil/p54/p54usb.c | 2 +- drivers/net/wireless/marvell/libertas/cfg.c | 2 +- drivers/net/wireless/marvell/libertas/debugfs.c | 4 +- drivers/net/wireless/marvell/libertas/if_sdio.c | 2 +- drivers/net/wireless/marvell/libertas/if_spi.c | 2 +- drivers/net/wireless/marvell/libertas/if_usb.c | 2 +- drivers/net/wireless/marvell/libertas/mesh.c | 2 +- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 +- drivers/net/wireless/marvell/mwifiex/11n.c | 4 +- .../net/wireless/marvell/mwifiex/11n_rxreorder.c | 2 +- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 20 ++-- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 4 +- drivers/net/wireless/marvell/mwifiex/ie.c | 15 ++- drivers/net/wireless/marvell/mwifiex/init.c | 2 +- drivers/net/wireless/marvell/mwifiex/main.c | 8 +- drivers/net/wireless/marvell/mwifiex/scan.c | 24 +++-- drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 +- drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 2 +- drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 3 +- drivers/net/wireless/marvell/mwifiex/tdls.c | 2 +- drivers/net/wireless/marvell/mwifiex/uap_event.c | 2 +- drivers/net/wireless/marvell/mwifiex/util.c | 2 +- drivers/net/wireless/marvell/mwifiex/wmm.c | 2 +- drivers/net/wireless/marvell/mwl8k.c | 80 ++++++++-------- drivers/net/wireless/mediatek/mt76/agg-rx.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 14 +-- drivers/net/wireless/microchip/wilc1000/hif.c | 8 +- drivers/net/wireless/microchip/wilc1000/mon.c | 2 +- drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +- drivers/net/wireless/microchip/wilc1000/sdio.c | 2 +- drivers/net/wireless/microchip/wilc1000/spi.c | 2 +- drivers/net/wireless/microchip/wilc1000/wlan.c | 8 +- drivers/net/wireless/microchip/wilc1000/wlan_cfg.c | 2 +- drivers/net/wireless/purelifi/plfxlc/usb.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/commands.c | 23 +++-- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/event.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/util.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 +- drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00debug.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 4 +- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 4 +- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt61pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt73usb.c | 2 +- drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 4 +- drivers/net/wireless/realtek/rtl8xxxu/core.c | 6 +- drivers/net/wireless/realtek/rtlwifi/base.c | 2 +- .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 4 +- drivers/net/wireless/realtek/rtlwifi/rc.c | 2 +- .../net/wireless/realtek/rtlwifi/rtl8192du/sw.c | 8 +- drivers/net/wireless/realtek/rtw88/fw.c | 2 +- drivers/net/wireless/realtek/rtw88/sdio.c | 4 +- drivers/net/wireless/realtek/rtw88/usb.c | 2 +- drivers/net/wireless/realtek/rtw88/util.c | 4 +- drivers/net/wireless/realtek/rtw89/acpi.c | 2 +- drivers/net/wireless/realtek/rtw89/cam.c | 2 +- drivers/net/wireless/realtek/rtw89/core.c | 4 +- drivers/net/wireless/realtek/rtw89/debug.c | 2 +- drivers/net/wireless/realtek/rtw89/fw.c | 26 +++--- drivers/net/wireless/realtek/rtw89/mac80211.c | 2 +- drivers/net/wireless/realtek/rtw89/phy.c | 2 +- drivers/net/wireless/realtek/rtw89/sar.c | 2 +- drivers/net/wireless/realtek/rtw89/ser.c | 2 +- drivers/net/wireless/realtek/rtw89/usb.c | 6 +- drivers/net/wireless/realtek/rtw89/wow.c | 2 +- drivers/net/wireless/rsi/rsi_91x_coex.c | 2 +- drivers/net/wireless/rsi/rsi_91x_debugfs.c | 2 +- drivers/net/wireless/rsi/rsi_91x_hal.c | 2 +- drivers/net/wireless/rsi/rsi_91x_main.c | 4 +- drivers/net/wireless/rsi/rsi_91x_sdio.c | 2 +- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- drivers/net/wireless/silabs/wfx/debug.c | 2 +- drivers/net/wireless/st/cw1200/cw1200_sdio.c | 2 +- drivers/net/wireless/st/cw1200/debug.c | 4 +- drivers/net/wireless/st/cw1200/pm.c | 2 +- drivers/net/wireless/st/cw1200/queue.c | 11 +-- drivers/net/wireless/st/cw1200/scan.c | 5 +- drivers/net/wireless/st/cw1200/wsm.c | 2 +- drivers/net/wireless/ti/wl1251/acx.c | 70 +++++++------- drivers/net/wireless/ti/wl1251/cmd.c | 14 +-- drivers/net/wireless/ti/wl1251/debugfs.c | 2 +- drivers/net/wireless/ti/wl1251/event.c | 2 +- drivers/net/wireless/ti/wl1251/init.c | 9 +- drivers/net/wireless/ti/wl1251/io.c | 2 +- drivers/net/wireless/ti/wl1251/main.c | 6 +- drivers/net/wireless/ti/wl1251/sdio.c | 2 +- drivers/net/wireless/ti/wl1251/tx.c | 2 +- drivers/net/wireless/ti/wl12xx/acx.c | 2 +- drivers/net/wireless/ti/wl12xx/cmd.c | 12 +-- drivers/net/wireless/ti/wl12xx/main.c | 2 +- drivers/net/wireless/ti/wl12xx/scan.c | 14 +-- drivers/net/wireless/ti/wl18xx/acx.c | 20 ++-- drivers/net/wireless/ti/wl18xx/cmd.c | 14 +-- drivers/net/wireless/ti/wl18xx/scan.c | 10 +- drivers/net/wireless/ti/wlcore/acx.c | 103 ++++++++++----------- drivers/net/wireless/ti/wlcore/cmd.c | 52 +++++------ drivers/net/wireless/ti/wlcore/init.c | 6 +- drivers/net/wireless/ti/wlcore/main.c | 12 +-- drivers/net/wireless/ti/wlcore/scan.c | 2 +- drivers/net/wireless/ti/wlcore/testmode.c | 2 +- drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +- drivers/net/wireless/virtual/virt_wifi.c | 2 +- drivers/net/wireless/zydas/zd1211rw/zd_mac.c | 3 +- drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c | 2 +- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_imem.c | 5 +- drivers/net/wwan/iosm/iosm_ipc_mmio.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_mux.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_port.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_protocol.c | 4 +- drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_task_queue.c | 3 +- drivers/net/wwan/iosm/iosm_ipc_trace.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_uevent.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_wwan.c | 2 +- drivers/net/wwan/mhi_wwan_ctrl.c | 2 +- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 6 +- drivers/net/wwan/t7xx/t7xx_state_monitor.c | 7 +- drivers/net/wwan/wwan_core.c | 4 +- drivers/net/wwan/wwan_hwsim.c | 4 +- drivers/net/xen-netback/hash.c | 2 +- drivers/net/xen-netback/netback.c | 2 +- drivers/net/xen-netback/xenbus.c | 2 +- drivers/net/xen-netfront.c | 4 +- drivers/nfc/mei_phy.c | 2 +- drivers/nfc/microread/microread.c | 4 +- drivers/nfc/nfcmrvl/main.c | 2 +- drivers/nfc/nfcsim.c | 4 +- drivers/nfc/pn533/pn533.c | 10 +- drivers/nfc/pn533/uart.c | 2 +- drivers/nfc/pn544/pn544.c | 2 +- drivers/nfc/port100.c | 8 +- drivers/nfc/st21nfca/core.c | 2 +- drivers/nfc/virtual_ncidev.c | 2 +- drivers/ntb/test/ntb_msi_test.c | 2 +- drivers/nubus/nubus.c | 4 +- drivers/nubus/proc.c | 2 +- drivers/nvdimm/badrange.c | 4 +- drivers/nvdimm/btt.c | 14 +-- drivers/nvdimm/btt_devs.c | 2 +- drivers/nvdimm/bus.c | 4 +- drivers/nvdimm/core.c | 2 +- drivers/nvdimm/dax_devs.c | 2 +- drivers/nvdimm/dimm.c | 2 +- drivers/nvdimm/dimm_devs.c | 2 +- drivers/nvdimm/label.c | 2 +- drivers/nvdimm/namespace_devs.c | 16 ++-- drivers/nvdimm/nd_perf.c | 5 +- drivers/nvdimm/nd_virtio.c | 2 +- drivers/nvdimm/of_pmem.c | 2 +- drivers/nvdimm/pfn_devs.c | 2 +- drivers/nvdimm/ramdax.c | 4 +- drivers/nvdimm/region_devs.c | 4 +- drivers/nvme/host/auth.c | 4 +- drivers/nvme/host/core.c | 22 ++--- drivers/nvme/host/fabrics.c | 6 +- drivers/nvme/host/fc.c | 12 +-- drivers/nvme/host/hwmon.c | 4 +- drivers/nvme/host/pci.c | 2 +- drivers/nvme/host/rdma.c | 12 +-- drivers/nvme/host/tcp.c | 10 +- drivers/nvme/host/zns.c | 4 +- drivers/nvme/target/admin-cmd.c | 23 +++-- drivers/nvme/target/configfs.c | 16 ++-- drivers/nvme/target/core.c | 17 ++-- drivers/nvme/target/discovery.c | 2 +- drivers/nvme/target/fabrics-cmd.c | 4 +- drivers/nvme/target/fc.c | 14 +-- drivers/nvme/target/fcloop.c | 12 +-- drivers/nvme/target/io-cmd-file.c | 3 +- drivers/nvme/target/loop.c | 6 +- drivers/nvme/target/passthru.c | 4 +- drivers/nvme/target/pci-epf.c | 13 ++- drivers/nvme/target/pr.c | 12 +-- drivers/nvme/target/rdma.c | 21 ++--- drivers/nvme/target/tcp.c | 9 +- drivers/nvme/target/zns.c | 4 +- drivers/nvmem/core.c | 6 +- drivers/nvmem/layouts.c | 2 +- drivers/of/address.c | 2 +- drivers/of/dynamic.c | 6 +- drivers/of/irq.c | 2 +- drivers/of/of_reserved_mem.c | 2 +- drivers/of/overlay.c | 6 +- drivers/of/platform.c | 2 +- drivers/of/unittest.c | 8 +- drivers/opp/core.c | 12 +-- drivers/opp/cpu.c | 2 +- drivers/opp/of.c | 5 +- drivers/opp/ti-opp-supply.c | 3 +- drivers/parisc/ccio-dma.c | 4 +- drivers/parisc/dino.c | 2 +- drivers/parisc/eisa_enumerator.c | 4 +- drivers/parisc/hppb.c | 2 +- drivers/parisc/iosapic.c | 8 +- drivers/parisc/lasi.c | 2 +- drivers/parisc/lba_pci.c | 6 +- drivers/parisc/sba_iommu.c | 2 +- drivers/parisc/wax.c | 2 +- drivers/parport/daisy.c | 2 +- drivers/parport/parport_cs.c | 2 +- drivers/parport/parport_gsc.c | 2 +- drivers/parport/parport_ip32.c | 4 +- drivers/parport/parport_pc.c | 6 +- drivers/parport/share.c | 6 +- drivers/pci/bus.c | 2 +- drivers/pci/controller/pci-hyperv.c | 16 ++-- drivers/pci/controller/vmd.c | 2 +- drivers/pci/doe.c | 4 +- drivers/pci/ecam.c | 4 +- drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 +- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- drivers/pci/endpoint/pci-ep-cfs.c | 4 +- drivers/pci/endpoint/pci-ep-msi.c | 2 +- drivers/pci/endpoint/pci-epc-core.c | 2 +- drivers/pci/endpoint/pci-epc-mem.c | 4 +- drivers/pci/endpoint/pci-epf-core.c | 2 +- drivers/pci/hotplug/acpiphp_core.c | 2 +- drivers/pci/hotplug/acpiphp_glue.c | 8 +- drivers/pci/hotplug/acpiphp_ibm.c | 2 +- drivers/pci/hotplug/cpci_hotplug_core.c | 2 +- drivers/pci/hotplug/cpqphp_core.c | 4 +- drivers/pci/hotplug/cpqphp_ctrl.c | 24 ++--- drivers/pci/hotplug/cpqphp_nvram.c | 9 +- drivers/pci/hotplug/cpqphp_pci.c | 45 ++++----- drivers/pci/hotplug/cpqphp_sysfs.c | 2 +- drivers/pci/hotplug/ibmphp_core.c | 10 +- drivers/pci/hotplug/ibmphp_ebda.c | 27 +++--- drivers/pci/hotplug/ibmphp_pci.c | 54 ++++++----- drivers/pci/hotplug/ibmphp_res.c | 29 +++--- drivers/pci/hotplug/octep_hp.c | 4 +- drivers/pci/hotplug/pciehp_core.c | 2 +- drivers/pci/hotplug/pciehp_hpc.c | 2 +- drivers/pci/hotplug/pnv_php.c | 4 +- drivers/pci/hotplug/rpaphp_slot.c | 2 +- drivers/pci/hotplug/shpchp_core.c | 4 +- drivers/pci/hotplug/shpchp_ctrl.c | 4 +- drivers/pci/ide.c | 2 +- drivers/pci/iov.c | 2 +- drivers/pci/npem.c | 2 +- drivers/pci/of.c | 4 +- drivers/pci/of_property.c | 2 +- drivers/pci/p2pdma.c | 2 +- drivers/pci/pci-acpi.c | 4 +- drivers/pci/pci-driver.c | 4 +- drivers/pci/pci-sysfs.c | 3 +- drivers/pci/pci.c | 5 +- drivers/pci/pcie/aer.c | 2 +- drivers/pci/pcie/aer_inject.c | 6 +- drivers/pci/pcie/aspm.c | 2 +- drivers/pci/pcie/pme.c | 2 +- drivers/pci/pcie/portdrv.c | 2 +- drivers/pci/pcie/ptm.c | 2 +- drivers/pci/pcie/rcec.c | 2 +- drivers/pci/probe.c | 6 +- drivers/pci/proc.c | 2 +- drivers/pci/setup-bus.c | 4 +- drivers/pci/slot.c | 2 +- drivers/pci/switch/switchtec.c | 4 +- drivers/pci/vgaarb.c | 4 +- drivers/pci/xen-pcifront.c | 6 +- drivers/pcmcia/bcm63xx_pcmcia.c | 2 +- drivers/pcmcia/cistpl.c | 8 +- drivers/pcmcia/db1xxx_ss.c | 2 +- drivers/pcmcia/ds.c | 10 +- drivers/pcmcia/electra_cf.c | 2 +- drivers/pcmcia/omap_cf.c | 2 +- drivers/pcmcia/pcmcia_cis.c | 2 +- drivers/pcmcia/pd6729.c | 3 +- drivers/pcmcia/rsrc_mgr.c | 2 +- drivers/pcmcia/rsrc_nonstatic.c | 7 +- drivers/pcmcia/sa1111_generic.c | 2 +- drivers/pcmcia/xxs1500_ss.c | 2 +- drivers/pcmcia/yenta_socket.c | 2 +- drivers/peci/core.c | 2 +- drivers/peci/cpu.c | 2 +- drivers/peci/device.c | 2 +- drivers/peci/request.c | 2 +- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/riscv_pmu.c | 2 +- drivers/perf/riscv_pmu_sbi.c | 5 +- drivers/phy/phy-core.c | 6 +- drivers/phy/tegra/xusb-tegra124.c | 20 ++-- drivers/phy/tegra/xusb-tegra186.c | 8 +- drivers/phy/tegra/xusb-tegra210.c | 16 ++-- drivers/phy/tegra/xusb.c | 8 +- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 6 +- drivers/pinctrl/berlin/berlin.c | 3 +- drivers/pinctrl/core.c | 12 +-- drivers/pinctrl/devicetree.c | 4 +- drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 3 +- drivers/pinctrl/freescale/pinctrl-imx.c | 3 +- drivers/pinctrl/freescale/pinctrl-imx1-core.c | 3 +- drivers/pinctrl/freescale/pinctrl-mxs.c | 2 +- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 2 +- drivers/pinctrl/nuvoton/pinctrl-ma35.c | 2 +- drivers/pinctrl/nxp/pinctrl-s32cc.c | 2 +- drivers/pinctrl/pinctrl-apple-gpio.c | 4 +- drivers/pinctrl/pinctrl-k230.c | 2 +- drivers/pinctrl/pinctrl-ocelot.c | 2 +- drivers/pinctrl/pinctrl-rockchip.c | 4 +- drivers/pinctrl/pinctrl-rp1.c | 4 +- drivers/pinctrl/pinctrl-scmi.c | 2 +- drivers/pinctrl/pinctrl-th1520.c | 2 +- drivers/pinctrl/renesas/core.c | 3 +- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza2.c | 2 +- drivers/pinctrl/sophgo/pinctrl-sophgo-common.c | 2 +- drivers/pinctrl/spacemit/pinctrl-k1.c | 2 +- drivers/pinctrl/spear/pinctrl-spear.c | 2 +- drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 2 +- drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 2 +- drivers/pinctrl/sunplus/sppctl.c | 6 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 +- drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +- drivers/platform/arm64/huawei-gaokun-ec.c | 2 +- drivers/platform/chrome/chromeos_laptop.c | 7 +- drivers/platform/chrome/cros_ec_chardev.c | 2 +- drivers/platform/chrome/wilco_ec/event.c | 4 +- drivers/platform/chrome/wilco_ec/telemetry.c | 4 +- drivers/platform/goldfish/goldfish_pipe.c | 7 +- drivers/platform/mellanox/mlxbf-tmfifo.c | 2 +- drivers/platform/olpc/olpc-ec.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_arm.c | 7 +- .../raspberrypi/vchiq-interface/vchiq_bus.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_core.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_dev.c | 6 +- .../platform/raspberrypi/vchiq-mmal/mmal-vchiq.c | 4 +- drivers/platform/surface/aggregator/bus.c | 2 +- drivers/platform/surface/aggregator/controller.c | 4 +- drivers/platform/surface/aggregator/core.c | 2 +- drivers/platform/surface/surface3_power.c | 3 +- drivers/platform/surface/surface_aggregator_cdev.c | 4 +- drivers/platform/surface/surface_dtx.c | 4 +- drivers/platform/surface/surfacepro3_button.c | 2 +- drivers/platform/wmi/core.c | 2 +- drivers/platform/x86/amd/pmc/mp1_stb.c | 4 +- drivers/platform/x86/amd/wbrf.c | 4 +- drivers/platform/x86/apple-gmux.c | 2 +- drivers/platform/x86/asus-armoury.c | 8 +- drivers/platform/x86/asus-laptop.c | 2 +- drivers/platform/x86/asus-wmi.c | 2 +- drivers/platform/x86/classmate-laptop.c | 6 +- drivers/platform/x86/dell/dell-smbios-base.c | 5 +- drivers/platform/x86/dell/dell-wmi-base.c | 14 +-- drivers/platform/x86/dell/dell-wmi-privacy.c | 4 +- .../x86/dell/dell-wmi-sysman/enum-attributes.c | 5 +- .../x86/dell/dell-wmi-sysman/int-attributes.c | 5 +- .../x86/dell/dell-wmi-sysman/passobj-attributes.c | 3 +- .../x86/dell/dell-wmi-sysman/string-attributes.c | 5 +- drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 2 +- drivers/platform/x86/dell/dell_rbu.c | 2 +- drivers/platform/x86/eeepc-laptop.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 6 +- .../platform/x86/hp/hp-bioscfg/enum-attributes.c | 5 +- .../platform/x86/hp/hp-bioscfg/int-attributes.c | 5 +- .../x86/hp/hp-bioscfg/order-list-attributes.c | 6 +- .../x86/hp/hp-bioscfg/passwdobj-attributes.c | 5 +- .../platform/x86/hp/hp-bioscfg/string-attributes.c | 5 +- drivers/platform/x86/huawei-wmi.c | 2 +- drivers/platform/x86/intel/ifs/core.c | 2 +- drivers/platform/x86/intel/int1092/intel_sar.c | 6 +- drivers/platform/x86/intel/int3472/discrete.c | 2 +- drivers/platform/x86/intel/int3472/tps68470.c | 3 +- drivers/platform/x86/intel/pmc/pltdrv.c | 2 +- drivers/platform/x86/intel/pmt/telemetry.c | 2 +- .../x86/intel/speed_select_if/isst_if_common.c | 12 +-- .../x86/intel/speed_select_if/isst_tpmi_core.c | 7 +- drivers/platform/x86/intel/tpmi_power_domains.c | 5 +- .../x86/intel/uncore-frequency/uncore-frequency.c | 4 +- drivers/platform/x86/intel/vsec.c | 4 +- drivers/platform/x86/intel/vsec_tpmi.c | 4 +- drivers/platform/x86/intel_scu_ipc.c | 2 +- drivers/platform/x86/lenovo/ideapad-laptop.c | 2 +- drivers/platform/x86/lenovo/think-lmi.c | 4 +- drivers/platform/x86/lenovo/thinkpad_acpi.c | 7 +- drivers/platform/x86/panasonic-laptop.c | 2 +- drivers/platform/x86/pmc_atom.c | 2 +- drivers/platform/x86/samsung-laptop.c | 2 +- drivers/platform/x86/sony-laptop.c | 34 +++---- drivers/platform/x86/topstar-laptop.c | 2 +- drivers/platform/x86/toshiba_acpi.c | 2 +- drivers/platform/x86/toshiba_bluetooth.c | 2 +- drivers/platform/x86/uniwill/uniwill-acpi.c | 2 +- drivers/platform/x86/uv_sysfs.c | 22 +++-- drivers/platform/x86/wireless-hotkey.c | 2 +- drivers/platform/x86/x86-android-tablets/core.c | 11 ++- drivers/platform/x86/xo15-ebook.c | 2 +- drivers/pmdomain/core.c | 16 ++-- drivers/pmdomain/renesas/rcar-gen4-sysc.c | 2 +- drivers/pmdomain/renesas/rcar-sysc.c | 2 +- drivers/pmdomain/renesas/rmobile-sysc.c | 2 +- drivers/pmdomain/st/ste-ux500-pm-domain.c | 2 +- drivers/pmdomain/tegra/powergate-bpmp.c | 4 +- drivers/pnp/card.c | 6 +- drivers/pnp/core.c | 2 +- drivers/pnp/driver.c | 2 +- drivers/pnp/interface.c | 4 +- drivers/pnp/quirks.c | 5 +- drivers/pnp/resource.c | 4 +- drivers/power/sequencing/core.c | 9 +- drivers/power/sequencing/pwrseq-thead-gpu.c | 2 +- drivers/power/supply/cros_peripheral_charger.c | 2 +- drivers/power/supply/cros_usbpd-charger.c | 2 +- drivers/power/supply/pmu_battery.c | 3 +- drivers/power/supply/power_supply_core.c | 2 +- drivers/power/supply/power_supply_leds.c | 2 +- drivers/powercap/arm_scmi_powercap.c | 2 +- drivers/powercap/dtpm.c | 2 +- drivers/powercap/dtpm_cpu.c | 2 +- drivers/powercap/dtpm_devfreq.c | 2 +- drivers/powercap/intel_rapl_common.c | 6 +- drivers/powercap/intel_rapl_tpmi.c | 2 +- drivers/powercap/powercap_sys.c | 9 +- drivers/pps/clients/pps_parport.c | 2 +- drivers/pps/generators/pps_gen.c | 2 +- drivers/pps/kapi.c | 2 +- drivers/ps3/ps3-lpm.c | 2 +- drivers/ps3/ps3-vuart.c | 5 +- drivers/ps3/ps3av.c | 2 +- drivers/ptp/ptp_clock.c | 4 +- drivers/ptp/ptp_ines.c | 2 +- drivers/ptp/ptp_mock.c | 2 +- drivers/ptp/ptp_ocp.c | 7 +- drivers/ptp/ptp_qoriq.c | 2 +- drivers/ptp/ptp_sysfs.c | 5 +- drivers/ptp/ptp_vclock.c | 2 +- drivers/ptp/ptp_vmclock.c | 2 +- drivers/pwm/core.c | 4 +- drivers/rapidio/devices/rio_mport_cdev.c | 19 ++-- drivers/rapidio/devices/tsi721.c | 4 +- drivers/rapidio/devices/tsi721_dma.c | 3 +- drivers/rapidio/rio.c | 18 ++-- drivers/rapidio/rio_cm.c | 16 ++-- drivers/ras/amd/fmpm.c | 2 +- drivers/regulator/core.c | 17 ++-- drivers/regulator/fixed-helper.c | 2 +- drivers/regulator/of_regulator.c | 5 +- drivers/remoteproc/qcom_common.c | 4 +- drivers/remoteproc/qcom_sysmon.c | 2 +- drivers/remoteproc/qcom_wcnss_iris.c | 2 +- drivers/remoteproc/remoteproc_core.c | 10 +- drivers/remoteproc/remoteproc_coredump.c | 4 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/remoteproc/stm32_rproc.c | 2 +- drivers/remoteproc/xlnx_r5_remoteproc.c | 9 +- drivers/resctrl/mpam_devices.c | 14 +-- drivers/reset/core.c | 8 +- drivers/reset/reset-npcm.c | 2 +- drivers/reset/reset-socfpga.c | 2 +- drivers/reset/reset-sunxi.c | 2 +- drivers/rpmsg/mtk_rpmsg.c | 8 +- drivers/rpmsg/qcom_glink_native.c | 14 +-- drivers/rpmsg/qcom_glink_smem.c | 2 +- drivers/rpmsg/qcom_smd.c | 10 +- drivers/rpmsg/rpmsg_char.c | 2 +- drivers/rpmsg/rpmsg_ctrl.c | 2 +- drivers/rpmsg/virtio_rpmsg_bus.c | 10 +- drivers/rtc/class.c | 2 +- drivers/rtc/rtc-sun6i.c | 4 +- drivers/s390/block/dasd.c | 8 +- drivers/s390/block/dasd_alias.c | 13 ++- drivers/s390/block/dasd_devmap.c | 6 +- drivers/s390/block/dasd_diag.c | 4 +- drivers/s390/block/dasd_eckd.c | 29 +++--- drivers/s390/block/dasd_eer.c | 4 +- drivers/s390/block/dasd_fba.c | 2 +- drivers/s390/block/dasd_ioctl.c | 4 +- drivers/s390/block/dcssblk.c | 11 +-- drivers/s390/block/scm_blk.c | 6 +- drivers/s390/block/scm_drv.c | 2 +- drivers/s390/char/con3215.c | 4 +- drivers/s390/char/con3270.c | 7 +- drivers/s390/char/fs3270.c | 2 +- drivers/s390/char/keyboard.c | 4 +- drivers/s390/char/monreader.c | 5 +- drivers/s390/char/monwriter.c | 8 +- drivers/s390/char/raw3270.c | 6 +- drivers/s390/char/sclp_cmd.c | 4 +- drivers/s390/char/sclp_cpi_sys.c | 2 +- drivers/s390/char/sclp_ftp.c | 2 +- drivers/s390/char/sclp_mem.c | 4 +- drivers/s390/char/sclp_sd.c | 2 +- drivers/s390/char/tape_3490.c | 2 +- drivers/s390/char/tape_class.c | 2 +- drivers/s390/char/tape_core.c | 10 +- drivers/s390/char/uvdevice.c | 4 +- drivers/s390/char/vmcp.c | 2 +- drivers/s390/char/vmur.c | 11 +-- drivers/s390/cio/airq.c | 2 +- drivers/s390/cio/ccwgroup.c | 2 +- drivers/s390/cio/chp.c | 4 +- drivers/s390/cio/chsc_sch.c | 20 ++-- drivers/s390/cio/cmf.c | 8 +- drivers/s390/cio/css.c | 8 +- drivers/s390/cio/device.c | 10 +- drivers/s390/cio/eadm_sch.c | 2 +- drivers/s390/cio/qdio_debug.c | 2 +- drivers/s390/cio/qdio_main.c | 2 +- drivers/s390/cio/qdio_thinint.c | 4 +- drivers/s390/cio/scm.c | 2 +- drivers/s390/cio/vfio_ccw_cp.c | 12 +-- drivers/s390/cio/vfio_ccw_drv.c | 4 +- drivers/s390/cio/vfio_ccw_ops.c | 4 +- drivers/s390/crypto/ap_card.c | 2 +- drivers/s390/crypto/ap_queue.c | 2 +- drivers/s390/crypto/pkey_api.c | 10 +- drivers/s390/crypto/pkey_uv.c | 2 +- drivers/s390/crypto/vfio_ap_drv.c | 2 +- drivers/s390/crypto/vfio_ap_ops.c | 2 +- drivers/s390/crypto/zcrypt_api.c | 9 +- drivers/s390/crypto/zcrypt_card.c | 4 +- drivers/s390/crypto/zcrypt_queue.c | 2 +- drivers/s390/net/ctcm_main.c | 8 +- drivers/s390/net/ctcm_mpc.c | 4 +- drivers/s390/net/fsm.c | 6 +- drivers/s390/net/ism_drv.c | 2 +- drivers/s390/net/qeth_core_main.c | 24 ++--- drivers/s390/net/qeth_l2_main.c | 6 +- drivers/s390/net/qeth_l3_main.c | 2 +- drivers/s390/net/qeth_l3_sys.c | 2 +- drivers/s390/net/smsgiucv.c | 2 +- drivers/s390/net/smsgiucv_app.c | 2 +- drivers/s390/scsi/zfcp_aux.c | 4 +- drivers/s390/scsi/zfcp_dbf.c | 2 +- drivers/s390/scsi/zfcp_diag.c | 2 +- drivers/s390/scsi/zfcp_fc.c | 4 +- drivers/s390/scsi/zfcp_fsf.c | 2 +- drivers/s390/scsi/zfcp_qdio.c | 2 +- drivers/s390/scsi/zfcp_reqlist.h | 2 +- drivers/s390/scsi/zfcp_scsi.c | 6 +- drivers/s390/scsi/zfcp_sysfs.c | 5 +- drivers/s390/scsi/zfcp_unit.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 6 +- drivers/sbus/char/bbc_envctrl.c | 4 +- drivers/sbus/char/bbc_i2c.c | 4 +- drivers/sbus/char/openprom.c | 2 +- drivers/sbus/char/oradax.c | 5 +- drivers/sbus/char/uctrl.c | 2 +- drivers/scsi/3w-9xxx.c | 2 +- drivers/scsi/3w-sas.c | 2 +- drivers/scsi/53c700.c | 4 +- drivers/scsi/BusLogic.c | 6 +- drivers/scsi/a4000t.c | 3 +- drivers/scsi/aacraid/aachba.c | 8 +- drivers/scsi/aacraid/commctrl.c | 2 +- drivers/scsi/aacraid/comminit.c | 2 +- drivers/scsi/aacraid/commsup.c | 9 +- drivers/scsi/aacraid/dpcsup.c | 6 +- drivers/scsi/aacraid/linit.c | 5 +- drivers/scsi/advansys.c | 6 +- drivers/scsi/aic7xxx/aic79xx_core.c | 18 ++-- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 +- drivers/scsi/aic7xxx/aic79xx_proc.c | 4 +- drivers/scsi/aic7xxx/aic7xxx_core.c | 18 ++-- drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 +- drivers/scsi/aic7xxx/aic7xxx_proc.c | 4 +- drivers/scsi/aic94xx/aic94xx_hwi.c | 6 +- drivers/scsi/aic94xx/aic94xx_init.c | 6 +- drivers/scsi/aic94xx/aic94xx_sds.c | 6 +- drivers/scsi/am53c974.c | 2 +- drivers/scsi/arm/queue.c | 2 +- drivers/scsi/be2iscsi/be_main.c | 68 +++++++------- drivers/scsi/bfa/bfa_fcs_lport.c | 2 +- drivers/scsi/bfa/bfad.c | 10 +- drivers/scsi/bfa/bfad_attr.c | 5 +- drivers/scsi/bfa/bfad_bsg.c | 2 +- drivers/scsi/bfa/bfad_debugfs.c | 8 +- drivers/scsi/bfa/bfad_im.c | 8 +- drivers/scsi/bnx2fc/bnx2fc_els.c | 12 +-- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 10 +- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 4 +- drivers/scsi/bnx2fc/bnx2fc_io.c | 11 +-- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- drivers/scsi/bvme6000_scsi.c | 2 +- drivers/scsi/ch.c | 5 +- drivers/scsi/csiostor/csio_hw.c | 4 +- drivers/scsi/csiostor/csio_init.c | 2 +- drivers/scsi/csiostor/csio_lnode.c | 8 +- drivers/scsi/csiostor/csio_scsi.c | 4 +- drivers/scsi/csiostor/csio_wr.c | 9 +- drivers/scsi/cxgbi/libcxgbi.c | 2 +- drivers/scsi/dc395x.c | 2 +- drivers/scsi/device_handler/scsi_dh_alua.c | 6 +- drivers/scsi/device_handler/scsi_dh_emc.c | 2 +- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 2 +- drivers/scsi/device_handler/scsi_dh_rdac.c | 6 +- drivers/scsi/elx/efct/efct_driver.c | 2 +- drivers/scsi/elx/efct/efct_hw.c | 24 ++--- drivers/scsi/elx/efct/efct_hw_queues.c | 12 +-- drivers/scsi/elx/efct/efct_io.c | 4 +- drivers/scsi/elx/efct/efct_lio.c | 16 ++-- drivers/scsi/elx/efct/efct_xport.c | 2 +- drivers/scsi/elx/libefc/efc_domain.c | 2 +- drivers/scsi/elx/libefc/efc_fabric.c | 2 +- drivers/scsi/elx/libefc/efc_nport.c | 4 +- drivers/scsi/esas2r/esas2r_init.c | 16 ++-- drivers/scsi/esas2r/esas2r_main.c | 5 +- drivers/scsi/esp_scsi.c | 4 +- drivers/scsi/fcoe/fcoe.c | 2 +- drivers/scsi/fcoe/fcoe_ctlr.c | 7 +- drivers/scsi/fcoe/fcoe_sysfs.c | 2 +- drivers/scsi/fcoe/fcoe_transport.c | 2 +- drivers/scsi/fnic/fdls_disc.c | 12 +-- drivers/scsi/fnic/fip.c | 2 +- drivers/scsi/fnic/fnic_debugfs.c | 6 +- drivers/scsi/fnic/fnic_fcs.c | 2 +- drivers/scsi/fnic/fnic_main.c | 2 +- drivers/scsi/fnic/vnic_dev.c | 4 +- drivers/scsi/hpsa.c | 64 ++++++------- drivers/scsi/ibmvscsi/ibmvfc.c | 11 +-- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4 +- drivers/scsi/ibmvscsi_tgt/libsrp.c | 8 +- drivers/scsi/imm.c | 2 +- drivers/scsi/ipr.c | 21 +++-- drivers/scsi/ips.c | 10 +- drivers/scsi/iscsi_boot_sysfs.c | 4 +- drivers/scsi/lasi700.c | 2 +- drivers/scsi/libfc/fc_disc.c | 2 +- drivers/scsi/libfc/fc_exch.c | 4 +- drivers/scsi/libfc/fc_fcp.c | 2 +- drivers/scsi/libfc/fc_lport.c | 4 +- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_init.c | 4 +- drivers/scsi/libsas/sas_internal.h | 2 +- drivers/scsi/lpfc/lpfc_attr.c | 2 +- drivers/scsi/lpfc/lpfc_bsg.c | 36 +++---- drivers/scsi/lpfc/lpfc_ct.c | 18 ++-- drivers/scsi/lpfc/lpfc_debugfs.c | 41 ++++---- drivers/scsi/lpfc/lpfc_els.c | 25 +++-- drivers/scsi/lpfc/lpfc_hbadisc.c | 13 +-- drivers/scsi/lpfc/lpfc_init.c | 89 +++++++++--------- drivers/scsi/lpfc/lpfc_mbox.c | 6 +- drivers/scsi/lpfc/lpfc_mem.c | 11 +-- drivers/scsi/lpfc/lpfc_nportdisc.c | 4 +- drivers/scsi/lpfc/lpfc_nvme.c | 4 +- drivers/scsi/lpfc/lpfc_nvmet.c | 11 +-- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 25 +++-- drivers/scsi/lpfc/lpfc_vport.c | 4 +- drivers/scsi/mac53c94.c | 5 +- drivers/scsi/mac_esp.c | 2 +- drivers/scsi/megaraid.c | 3 +- drivers/scsi/megaraid/megaraid_mbox.c | 12 +-- drivers/scsi/megaraid/megaraid_mm.c | 12 +-- drivers/scsi/megaraid/megaraid_sas_base.c | 22 ++--- drivers/scsi/megaraid/megaraid_sas_debugfs.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 13 ++- drivers/scsi/mpi3mr/mpi3mr_fw.c | 15 +-- drivers/scsi/mpi3mr/mpi3mr_os.c | 15 ++- drivers/scsi/mpi3mr/mpi3mr_transport.c | 18 ++-- drivers/scsi/mpt3sas/mpt3sas_base.c | 37 ++++---- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 18 ++-- drivers/scsi/mpt3sas/mpt3sas_debugfs.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 66 +++++++------ drivers/scsi/mpt3sas/mpt3sas_transport.c | 3 +- drivers/scsi/mvme16x_scsi.c | 2 +- drivers/scsi/mvsas/mv_init.c | 4 +- drivers/scsi/mvsas/mv_sas.c | 2 +- drivers/scsi/mvumi.c | 16 ++-- drivers/scsi/myrb.c | 4 +- drivers/scsi/myrs.c | 8 +- drivers/scsi/pcmcia/aha152x_stub.c | 2 +- drivers/scsi/pcmcia/nsp_cs.c | 2 +- drivers/scsi/pcmcia/qlogic_stub.c | 2 +- drivers/scsi/pcmcia/sym53c500_cs.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.c | 8 +- drivers/scsi/pm8001/pm8001_init.c | 6 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- drivers/scsi/pmcraid.c | 7 +- drivers/scsi/ppa.c | 2 +- drivers/scsi/qedf/qedf_debugfs.c | 2 +- drivers/scsi/qedf/qedf_els.c | 10 +- drivers/scsi/qedf/qedf_io.c | 14 ++- drivers/scsi/qedf/qedf_main.c | 13 ++- drivers/scsi/qedi/qedi_fw.c | 4 +- drivers/scsi/qedi/qedi_iscsi.c | 4 +- drivers/scsi/qedi/qedi_main.c | 34 +++---- drivers/scsi/qla2xxx/qla_bsg.c | 12 +-- drivers/scsi/qla2xxx/qla_edif.c | 12 +-- drivers/scsi/qla2xxx/qla_init.c | 21 ++--- drivers/scsi/qla2xxx/qla_inline.h | 4 +- drivers/scsi/qla2xxx/qla_iocb.c | 16 ++-- drivers/scsi/qla2xxx/qla_isr.c | 5 +- drivers/scsi/qla2xxx/qla_mid.c | 7 +- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 39 ++++---- drivers/scsi/qla2xxx/qla_target.c | 17 ++-- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 8 +- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_nx.c | 2 +- drivers/scsi/raid_class.c | 5 +- drivers/scsi/scsi_debug.c | 18 ++-- drivers/scsi/scsi_devinfo.c | 6 +- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/scsi_proc.c | 2 +- drivers/scsi/scsi_scan.c | 2 +- drivers/scsi/scsi_transport_fc.c | 3 +- drivers/scsi/scsi_transport_iscsi.c | 2 +- drivers/scsi/scsi_transport_sas.c | 10 +- drivers/scsi/scsi_transport_spi.c | 5 +- drivers/scsi/scsi_transport_srp.c | 4 +- drivers/scsi/sd.c | 4 +- drivers/scsi/ses.c | 5 +- drivers/scsi/sg.c | 6 +- drivers/scsi/sim710.c | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 36 +++---- drivers/scsi/smartpqi/smartpqi_sas_transport.c | 8 +- drivers/scsi/sni_53c710.c | 2 +- drivers/scsi/snic/snic_disc.c | 2 +- drivers/scsi/snic/snic_main.c | 2 +- drivers/scsi/snic/vnic_dev.c | 4 +- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 13 ++- drivers/scsi/stex.c | 2 +- drivers/scsi/storvsc_drv.c | 4 +- drivers/scsi/sym53c8xx_2/sym_hipd.c | 6 +- drivers/scsi/virtio_scsi.c | 4 +- drivers/scsi/vmw_pvscsi.c | 4 +- drivers/scsi/xen-scsifront.c | 6 +- drivers/scsi/zorro7xx.c | 2 +- drivers/scsi/zorro_esp.c | 2 +- drivers/sh/clk/cpg.c | 2 +- drivers/sh/intc/core.c | 11 +-- drivers/sh/intc/virq.c | 4 +- drivers/sh/maple/maple.c | 4 +- drivers/siox/siox-core.c | 2 +- drivers/slimbus/core.c | 2 +- drivers/slimbus/qcom-ngd-ctrl.c | 2 +- drivers/slimbus/stream.c | 4 +- drivers/soc/amlogic/meson-gx-socinfo.c | 2 +- drivers/soc/amlogic/meson-mx-socinfo.c | 2 +- drivers/soc/apple/rtkit.c | 4 +- drivers/soc/aspeed/aspeed-p2a-ctrl.c | 2 +- drivers/soc/aspeed/aspeed-socinfo.c | 2 +- drivers/soc/atmel/soc.c | 2 +- drivers/soc/bcm/brcmstb/common.c | 2 +- drivers/soc/cirrus/soc-ep93xx.c | 2 +- drivers/soc/dove/pmu.c | 8 +- drivers/soc/fsl/dpaa2-console.c | 2 +- drivers/soc/fsl/dpio/dpio-service.c | 6 +- drivers/soc/fsl/dpio/qbman-portal.c | 2 +- drivers/soc/fsl/guts.c | 2 +- drivers/soc/fsl/qbman/bman.c | 2 +- drivers/soc/fsl/qbman/qman.c | 2 +- drivers/soc/fsl/qe/gpio.c | 2 +- drivers/soc/fsl/qe/qe_common.c | 2 +- drivers/soc/fsl/qe/ucc_fast.c | 2 +- drivers/soc/fsl/qe/ucc_slow.c | 2 +- drivers/soc/hisilicon/kunpeng_hccs.c | 3 +- drivers/soc/imx/soc-imx.c | 2 +- drivers/soc/mediatek/mtk-cmdq-helper.c | 2 +- drivers/soc/microchip/mpfs-sys-controller.c | 2 +- drivers/soc/nuvoton/wpcm450-soc.c | 2 +- drivers/soc/qcom/apr.c | 6 +- drivers/soc/qcom/llcc-qcom.c | 2 +- drivers/soc/qcom/ocmem.c | 2 +- drivers/soc/qcom/pdr_interface.c | 10 +- drivers/soc/qcom/qcom_pd_mapper.c | 8 +- drivers/soc/qcom/qmi_interface.c | 6 +- drivers/soc/qcom/rmtfs_mem.c | 2 +- drivers/soc/qcom/rpmh.c | 4 +- drivers/soc/qcom/smem_state.c | 2 +- drivers/soc/renesas/renesas-soc.c | 2 +- drivers/soc/renesas/rz-sysc.c | 3 +- drivers/soc/tegra/fuse/fuse-tegra.c | 2 +- drivers/soc/tegra/pmc.c | 8 +- drivers/soc/ti/k3-socinfo.c | 2 +- drivers/soc/ux500/ux500-soc-id.c | 2 +- drivers/soc/versatile/soc-integrator.c | 2 +- drivers/soc/xilinx/xlnx_event_manager.c | 10 +- drivers/soundwire/amd_init.c | 10 +- drivers/soundwire/amd_manager.c | 6 +- drivers/soundwire/cadence_master.c | 2 +- drivers/soundwire/debugfs.c | 2 +- drivers/soundwire/generic_bandwidth_allocation.c | 2 +- drivers/soundwire/intel.c | 4 +- drivers/soundwire/intel_ace2x.c | 6 +- drivers/soundwire/intel_init.c | 10 +- drivers/soundwire/master.c | 2 +- drivers/soundwire/qcom.c | 5 +- drivers/soundwire/slave.c | 2 +- drivers/soundwire/stream.c | 12 +-- drivers/spi/spi-amlogic-spifc-a4.c | 2 +- drivers/spi/spi-at91-usart.c | 2 +- drivers/spi/spi-atmel.c | 2 +- drivers/spi/spi-axi-spi-engine.c | 2 +- drivers/spi/spi-bcm-qspi.c | 6 +- drivers/spi/spi-bcm2835.c | 2 +- drivers/spi/spi-bitbang.c | 2 +- drivers/spi/spi-davinci.c | 2 +- drivers/spi/spi-dw-core.c | 2 +- drivers/spi/spi-fsl-dspi.c | 2 +- drivers/spi/spi-fsl-espi.c | 2 +- drivers/spi/spi-fsl-spi.c | 2 +- drivers/spi/spi-hisi-kunpeng.c | 2 +- drivers/spi/spi-imx.c | 6 +- drivers/spi/spi-mem.c | 2 +- drivers/spi/spi-mpc512x-psc.c | 2 +- drivers/spi/spi-mpc52xx-psc.c | 2 +- drivers/spi/spi-mpc52xx.c | 5 +- drivers/spi/spi-mtk-snfi.c | 2 +- drivers/spi/spi-mxs.c | 2 +- drivers/spi/spi-offload.c | 2 +- drivers/spi/spi-omap-uwire.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 2 +- drivers/spi/spi-pic32-sqi.c | 2 +- drivers/spi/spi-pl022.c | 2 +- drivers/spi/spi-ppc4xx.c | 2 +- drivers/spi/spi-pxa2xx.c | 2 +- drivers/spi/spi-qpic-snand.c | 2 +- drivers/spi/spi-s3c64xx.c | 2 +- drivers/spi/spi-tegra114.c | 2 +- drivers/spi/spi-tle62x0.c | 2 +- drivers/spi/spi-topcliff-pch.c | 8 +- drivers/spi/spi-virtio.c | 4 +- drivers/spi/spi.c | 4 +- drivers/spi/spidev.c | 4 +- drivers/spmi/spmi.c | 2 +- drivers/ssb/bridge_pcmcia_80211.c | 2 +- drivers/ssb/driver_gige.c | 2 +- drivers/ssb/main.c | 2 +- drivers/ssb/pcihost_wrapper.c | 2 +- drivers/staging/fbtft/fb_agm1264k-fl.c | 5 +- drivers/staging/greybus/audio_manager_module.c | 2 +- drivers/staging/greybus/authentication.c | 2 +- drivers/staging/greybus/bootrom.c | 2 +- drivers/staging/greybus/camera.c | 6 +- drivers/staging/greybus/fw-core.c | 2 +- drivers/staging/greybus/fw-download.c | 4 +- drivers/staging/greybus/fw-management.c | 2 +- drivers/staging/greybus/gbphy.c | 4 +- drivers/staging/greybus/gpio.c | 5 +- drivers/staging/greybus/hid.c | 2 +- drivers/staging/greybus/i2c.c | 2 +- drivers/staging/greybus/light.c | 18 ++-- drivers/staging/greybus/log.c | 2 +- drivers/staging/greybus/loopback.c | 4 +- drivers/staging/greybus/power_supply.c | 15 ++- drivers/staging/greybus/raw.c | 4 +- drivers/staging/greybus/uart.c | 2 +- drivers/staging/greybus/vibrator.c | 2 +- drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +- drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 2 +- .../media/atomisp/pci/atomisp_csi2_bridge.c | 4 +- .../media/atomisp/pci/atomisp_gmin_platform.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 10 +- drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 2 +- .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c | 4 +- .../isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c | 2 +- .../media/atomisp/pci/runtime/frame/src/frame.c | 2 +- .../atomisp/pci/runtime/pipeline/src/pipeline.c | 2 +- drivers/staging/media/atomisp/pci/sh_css.c | 50 +++++----- .../staging/media/atomisp/pci/sh_css_firmware.c | 4 +- .../staging/media/atomisp/pci/sh_css_host_data.c | 2 +- .../staging/media/atomisp/pci/sh_css_param_dvs.c | 3 +- .../media/atomisp/pci/sh_css_param_shading.c | 2 +- drivers/staging/media/atomisp/pci/sh_css_params.c | 24 ++--- drivers/staging/media/av7110/av7110.c | 2 +- drivers/staging/media/av7110/sp8870.c | 2 +- drivers/staging/media/imx/imx-media-csc-scaler.c | 6 +- drivers/staging/media/ipu3/ipu3-css-fw.c | 2 +- drivers/staging/media/ipu3/ipu3-css.c | 2 +- drivers/staging/media/ipu3/ipu3-dmamap.c | 2 +- drivers/staging/media/ipu3/ipu3-mmu.c | 2 +- drivers/staging/media/ipu7/ipu7-bus.c | 2 +- drivers/staging/media/ipu7/ipu7-dma.c | 2 +- drivers/staging/media/ipu7/ipu7-mmu.c | 4 +- drivers/staging/media/ipu7/ipu7.c | 6 +- drivers/staging/media/meson/vdec/codec_h264.c | 2 +- drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +- drivers/staging/media/meson/vdec/codec_vp9.c | 4 +- drivers/staging/media/meson/vdec/vdec.c | 4 +- drivers/staging/media/meson/vdec/vdec_helpers.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 2 +- drivers/staging/media/tegra-video/csi.c | 2 +- drivers/staging/media/tegra-video/vi.c | 2 +- drivers/staging/media/tegra-video/video.c | 2 +- drivers/staging/most/dim2/dim2.c | 2 +- drivers/staging/most/video/video.c | 4 +- drivers/staging/nvec/nvec_ps2.c | 2 +- drivers/staging/rtl8723bs/core/rtw_ap.c | 8 +- drivers/staging/rtl8723bs/core/rtw_cmd.c | 75 +++++++-------- drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 24 ++--- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 4 +- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 6 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +- drivers/staging/rtl8723bs/os_dep/osdep_service.c | 2 +- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +- .../vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +- drivers/staging/vme_user/vme.c | 26 +++--- drivers/staging/vme_user/vme_fake.c | 10 +- drivers/staging/vme_user/vme_tsi148.c | 19 ++-- drivers/staging/vme_user/vme_user.c | 2 +- drivers/target/iscsi/cxgbit/cxgbit_cm.c | 6 +- drivers/target/iscsi/cxgbit/cxgbit_main.c | 4 +- drivers/target/iscsi/iscsi_target.c | 10 +- drivers/target/iscsi/iscsi_target_auth.c | 2 +- drivers/target/iscsi/iscsi_target_erl2.c | 2 +- drivers/target/iscsi/iscsi_target_login.c | 10 +- drivers/target/iscsi/iscsi_target_parameters.c | 10 +- drivers/target/iscsi/iscsi_target_seq_pdu_list.c | 4 +- drivers/target/iscsi/iscsi_target_tpg.c | 4 +- drivers/target/loopback/tcm_loop.c | 4 +- drivers/target/sbp/sbp_target.c | 16 ++-- drivers/target/target_core_configfs.c | 4 +- drivers/target/target_core_device.c | 6 +- drivers/target/target_core_fabric_configfs.c | 2 +- drivers/target/target_core_file.c | 10 +- drivers/target/target_core_hba.c | 4 +- drivers/target/target_core_iblock.c | 10 +- drivers/target/target_core_pr.c | 6 +- drivers/target/target_core_pscsi.c | 6 +- drivers/target/target_core_rd.c | 11 +-- drivers/target/target_core_tmr.c | 2 +- drivers/target/target_core_tpg.c | 2 +- drivers/target/target_core_transport.c | 4 +- drivers/target/target_core_user.c | 6 +- drivers/target/target_core_xcopy.c | 2 +- drivers/target/tcm_fc/tfc_conf.c | 4 +- drivers/target/tcm_fc/tfc_sess.c | 4 +- drivers/target/tcm_remote/tcm_remote.c | 2 +- drivers/tc/tc.c | 2 +- drivers/tee/amdtee/call.c | 4 +- drivers/tee/amdtee/core.c | 10 +- drivers/tee/amdtee/shm_pool.c | 2 +- drivers/tee/optee/call.c | 4 +- drivers/tee/optee/core.c | 2 +- drivers/tee/optee/device.c | 2 +- drivers/tee/optee/ffa_abi.c | 8 +- drivers/tee/optee/notif.c | 2 +- drivers/tee/optee/protmem.c | 2 +- drivers/tee/optee/rpc.c | 6 +- drivers/tee/optee/smc_abi.c | 4 +- drivers/tee/optee/supp.c | 2 +- drivers/tee/qcomtee/call.c | 11 ++- drivers/tee/qcomtee/core.c | 2 +- drivers/tee/qcomtee/mem_obj.c | 4 +- drivers/tee/qcomtee/qcomtee_object.h | 2 +- drivers/tee/qcomtee/shm.c | 2 +- drivers/tee/qcomtee/user_obj.c | 4 +- drivers/tee/tee_core.c | 20 ++-- drivers/tee/tee_heap.c | 8 +- drivers/tee/tee_shm.c | 12 +-- drivers/tee/tee_shm_pool.c | 2 +- drivers/tee/tstee/core.c | 8 +- drivers/thermal/cpufreq_cooling.c | 7 +- drivers/thermal/cpuidle_cooling.c | 2 +- drivers/thermal/devfreq_cooling.c | 2 +- drivers/thermal/gov_power_allocator.c | 7 +- .../intel/int340x_thermal/acpi_thermal_rel.c | 6 +- .../intel/int340x_thermal/int3400_thermal.c | 10 +- .../intel/int340x_thermal/int340x_thermal_zone.c | 7 +- drivers/thermal/intel/intel_hfi.c | 6 +- drivers/thermal/intel/intel_quark_dts_thermal.c | 2 +- drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- drivers/thermal/intel/x86_pkg_temp_thermal.c | 5 +- drivers/thermal/k3_j72xx_bandgap.c | 2 +- drivers/thermal/testing/zone.c | 21 +++-- drivers/thermal/thermal_core.c | 8 +- drivers/thermal/thermal_debugfs.c | 8 +- drivers/thermal/thermal_hwmon.c | 4 +- drivers/thermal/thermal_of.c | 3 +- drivers/thermal/thermal_sysfs.c | 4 +- drivers/thermal/thermal_thresholds.c | 2 +- drivers/thunderbolt/ctl.c | 6 +- drivers/thunderbolt/debugfs.c | 2 +- drivers/thunderbolt/dma_port.c | 2 +- drivers/thunderbolt/dma_test.c | 4 +- drivers/thunderbolt/domain.c | 4 +- drivers/thunderbolt/icm.c | 6 +- drivers/thunderbolt/nhi.c | 2 +- drivers/thunderbolt/nvm.c | 2 +- drivers/thunderbolt/path.c | 8 +- drivers/thunderbolt/property.c | 6 +- drivers/thunderbolt/retimer.c | 2 +- drivers/thunderbolt/switch.c | 10 +- drivers/thunderbolt/tb.c | 4 +- drivers/thunderbolt/tunnel.c | 4 +- drivers/thunderbolt/usb4_port.c | 2 +- drivers/thunderbolt/xdomain.c | 6 +- drivers/tty/ehv_bytechan.c | 2 +- drivers/tty/goldfish.c | 5 +- drivers/tty/hvc/hvc_console.c | 2 +- drivers/tty/hvc/hvc_iucv.c | 2 +- drivers/tty/hvc/hvc_opal.c | 2 +- drivers/tty/hvc/hvc_vio.c | 2 +- drivers/tty/hvc/hvc_xen.c | 8 +- drivers/tty/hvc/hvcs.c | 5 +- drivers/tty/ipwireless/hardware.c | 2 +- drivers/tty/ipwireless/main.c | 2 +- drivers/tty/ipwireless/network.c | 4 +- drivers/tty/ipwireless/tty.c | 2 +- drivers/tty/n_gsm.c | 7 +- drivers/tty/n_hdlc.c | 7 +- drivers/tty/nozomi.c | 2 +- drivers/tty/pty.c | 4 +- drivers/tty/rpmsg_tty.c | 2 +- drivers/tty/serdev/core.c | 2 +- drivers/tty/serial/8250/8250_acorn.c | 2 +- drivers/tty/serial/8250/8250_core.c | 2 +- drivers/tty/serial/8250/8250_hp300.c | 2 +- drivers/tty/serial/8250/8250_ni.c | 2 +- drivers/tty/serial/8250/8250_of.c | 2 +- drivers/tty/serial/8250/8250_pci.c | 2 +- drivers/tty/serial/8250/8250_platform.c | 6 +- drivers/tty/serial/8250/8250_port.c | 2 +- drivers/tty/serial/8250/serial_cs.c | 2 +- drivers/tty/serial/icom.c | 2 +- drivers/tty/serial/jsm/jsm_driver.c | 2 +- drivers/tty/serial/jsm/jsm_tty.c | 3 +- drivers/tty/serial/max3100.c | 2 +- drivers/tty/serial/pch_uart.c | 4 +- drivers/tty/serial/pxa.c | 2 +- drivers/tty/serial/serial_base_bus.c | 4 +- drivers/tty/serial/serial_core.c | 6 +- drivers/tty/serial/sunhv.c | 2 +- drivers/tty/serial/sunsab.c | 5 +- drivers/tty/serial/sunsu.c | 2 +- drivers/tty/serial/timbuart.c | 2 +- drivers/tty/serial/ucc_uart.c | 2 +- drivers/tty/synclink_gt.c | 2 +- drivers/tty/sysrq.c | 2 +- drivers/tty/tty_audit.c | 2 +- drivers/tty/tty_buffer.c | 2 +- drivers/tty/tty_io.c | 22 ++--- drivers/tty/tty_ldisc.c | 2 +- drivers/tty/vcc.c | 4 +- drivers/tty/vt/consolemap.c | 2 +- drivers/tty/vt/keyboard.c | 3 +- drivers/tty/vt/vc_screen.c | 2 +- drivers/tty/vt/vt.c | 5 +- drivers/ufs/core/ufs-hwmon.c | 2 +- drivers/uio/uio.c | 8 +- drivers/usb/atm/cxacru.c | 2 +- drivers/usb/atm/speedtch.c | 2 +- drivers/usb/atm/ueagle-atm.c | 2 +- drivers/usb/atm/usbatm.c | 2 +- drivers/usb/c67x00/c67x00-drv.c | 2 +- drivers/usb/c67x00/c67x00-sched.c | 6 +- drivers/usb/cdns3/cdns3-gadget.c | 6 +- drivers/usb/cdns3/cdns3-pci-wrap.c | 2 +- drivers/usb/cdns3/cdnsp-gadget.c | 4 +- drivers/usb/cdns3/cdnsp-mem.c | 9 +- drivers/usb/cdns3/cdnsp-pci.c | 2 +- drivers/usb/chipidea/udc.c | 6 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/class/cdc-wdm.c | 6 +- drivers/usb/class/usblp.c | 2 +- drivers/usb/class/usbtmc.c | 4 +- drivers/usb/common/ulpi.c | 2 +- drivers/usb/core/config.c | 6 +- drivers/usb/core/devio.c | 17 ++-- drivers/usb/core/driver.c | 2 +- drivers/usb/core/endpoint.c | 2 +- drivers/usb/core/hcd.c | 10 +- drivers/usb/core/hub.c | 16 ++-- drivers/usb/core/ledtrig-usbport.c | 4 +- drivers/usb/core/message.c | 16 ++-- drivers/usb/core/port.c | 4 +- drivers/usb/core/quirks.c | 3 +- drivers/usb/core/urb.c | 3 +- drivers/usb/core/usb.c | 2 +- drivers/usb/dwc2/gadget.c | 2 +- drivers/usb/dwc2/hcd.c | 6 +- drivers/usb/dwc2/hcd_queue.c | 2 +- drivers/usb/dwc3/debugfs.c | 2 +- drivers/usb/dwc3/gadget.c | 6 +- drivers/usb/fotg210/fotg210-hcd.c | 10 +- drivers/usb/fotg210/fotg210-udc.c | 6 +- drivers/usb/gadget/composite.c | 2 +- drivers/usb/gadget/configfs.c | 16 ++-- drivers/usb/gadget/function/f_acm.c | 4 +- drivers/usb/gadget/function/f_ecm.c | 4 +- drivers/usb/gadget/function/f_eem.c | 6 +- drivers/usb/gadget/function/f_fs.c | 24 ++--- drivers/usb/gadget/function/f_hid.c | 8 +- drivers/usb/gadget/function/f_loopback.c | 4 +- drivers/usb/gadget/function/f_mass_storage.c | 12 +-- drivers/usb/gadget/function/f_midi.c | 9 +- drivers/usb/gadget/function/f_midi2.c | 16 ++-- drivers/usb/gadget/function/f_ncm.c | 2 +- drivers/usb/gadget/function/f_obex.c | 4 +- drivers/usb/gadget/function/f_phonet.c | 4 +- drivers/usb/gadget/function/f_printer.c | 4 +- drivers/usb/gadget/function/f_rndis.c | 6 +- drivers/usb/gadget/function/f_serial.c | 4 +- drivers/usb/gadget/function/f_sourcesink.c | 4 +- drivers/usb/gadget/function/f_subset.c | 4 +- drivers/usb/gadget/function/f_tcm.c | 12 +-- drivers/usb/gadget/function/f_uac1.c | 6 +- drivers/usb/gadget/function/f_uac1_legacy.c | 6 +- drivers/usb/gadget/function/f_uac2.c | 6 +- drivers/usb/gadget/function/f_uvc.c | 4 +- drivers/usb/gadget/function/rndis.c | 2 +- drivers/usb/gadget/function/u_audio.c | 12 +-- drivers/usb/gadget/function/u_serial.c | 4 +- drivers/usb/gadget/function/u_uac1_legacy.c | 2 +- drivers/usb/gadget/function/uvc_configfs.c | 28 +++--- drivers/usb/gadget/function/uvc_v4l2.c | 2 +- drivers/usb/gadget/function/uvc_video.c | 2 +- drivers/usb/gadget/legacy/dbgp.c | 2 +- drivers/usb/gadget/legacy/g_ffs.c | 4 +- drivers/usb/gadget/legacy/hid.c | 2 +- drivers/usb/gadget/legacy/inode.c | 8 +- drivers/usb/gadget/legacy/raw_gadget.c | 4 +- drivers/usb/gadget/udc/amd5536udc_pci.c | 2 +- drivers/usb/gadget/udc/aspeed-vhub/core.c | 2 +- drivers/usb/gadget/udc/aspeed-vhub/dev.c | 4 +- drivers/usb/gadget/udc/aspeed_udc.c | 2 +- drivers/usb/gadget/udc/at91_udc.c | 2 +- drivers/usb/gadget/udc/atmel_usba_udc.c | 4 +- drivers/usb/gadget/udc/bcm63xx_udc.c | 2 +- drivers/usb/gadget/udc/bdc/bdc_core.c | 4 +- drivers/usb/gadget/udc/bdc/bdc_ep.c | 11 +-- drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 2 +- drivers/usb/gadget/udc/core.c | 2 +- drivers/usb/gadget/udc/dummy_hcd.c | 6 +- drivers/usb/gadget/udc/fsl_qe_udc.c | 8 +- drivers/usb/gadget/udc/fsl_udc_core.c | 6 +- drivers/usb/gadget/udc/goku_udc.c | 4 +- drivers/usb/gadget/udc/gr_udc.c | 2 +- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- drivers/usb/gadget/udc/m66592-udc.c | 4 +- drivers/usb/gadget/udc/max3420_udc.c | 2 +- drivers/usb/gadget/udc/net2280.c | 4 +- drivers/usb/gadget/udc/omap_udc.c | 4 +- drivers/usb/gadget/udc/pch_udc.c | 2 +- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- drivers/usb/gadget/udc/pxa27x_udc.c | 2 +- drivers/usb/gadget/udc/r8a66597-udc.c | 2 +- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- drivers/usb/gadget/udc/renesas_usbf.c | 2 +- drivers/usb/gadget/udc/snps_udc_core.c | 2 +- drivers/usb/gadget/udc/tegra-xudc.c | 2 +- drivers/usb/gadget/udc/udc-xilinx.c | 2 +- drivers/usb/host/ehci-dbg.c | 4 +- drivers/usb/host/ehci-mem.c | 2 +- drivers/usb/host/ehci-sched.c | 11 +-- drivers/usb/host/fhci-hcd.c | 16 ++-- drivers/usb/host/fhci-mem.c | 4 +- drivers/usb/host/fhci-tds.c | 4 +- drivers/usb/host/isp116x-hcd.c | 2 +- drivers/usb/host/max3421-hcd.c | 6 +- drivers/usb/host/octeon-hcd.c | 9 +- drivers/usb/host/ohci-dbg.c | 4 +- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/oxu210hp-hcd.c | 2 +- drivers/usb/host/r8a66597-hcd.c | 7 +- drivers/usb/host/sl811-hcd.c | 2 +- drivers/usb/host/sl811_cs.c | 2 +- drivers/usb/host/uhci-debug.c | 2 +- drivers/usb/host/uhci-hcd.c | 4 +- drivers/usb/host/xhci-dbgcap.c | 10 +- drivers/usb/host/xhci-dbgtty.c | 2 +- drivers/usb/host/xhci-debugfs.c | 6 +- drivers/usb/host/xhci-mem.c | 2 +- drivers/usb/host/xhci-mtk-sch.c | 10 +- drivers/usb/host/xhci-sideband.c | 4 +- drivers/usb/host/xhci.c | 2 +- drivers/usb/image/mdc800.c | 2 +- drivers/usb/image/microtek.c | 2 +- drivers/usb/isp1760/isp1760-hcd.c | 8 +- drivers/usb/isp1760/isp1760-udc.c | 2 +- drivers/usb/misc/adutux.c | 2 +- drivers/usb/misc/apple-mfi-fastcharge.c | 2 +- drivers/usb/misc/appledisplay.c | 2 +- drivers/usb/misc/chaoskey.c | 2 +- drivers/usb/misc/cypress_cy7c63.c | 2 +- drivers/usb/misc/cytherm.c | 2 +- drivers/usb/misc/idmouse.c | 2 +- drivers/usb/misc/iowarrior.c | 2 +- drivers/usb/misc/ldusb.c | 2 +- drivers/usb/misc/legousbtower.c | 2 +- drivers/usb/misc/lvstest.c | 2 +- drivers/usb/misc/onboard_usb_dev.c | 2 +- drivers/usb/misc/onboard_usb_dev_pdevs.c | 2 +- drivers/usb/misc/sisusbvga/sisusbvga.c | 2 +- drivers/usb/misc/trancevibrator.c | 2 +- drivers/usb/misc/usb-ljca.c | 8 +- drivers/usb/misc/usbio.c | 2 +- drivers/usb/misc/usblcd.c | 2 +- drivers/usb/misc/usbsevseg.c | 2 +- drivers/usb/misc/usbtest.c | 12 +-- drivers/usb/misc/uss720.c | 6 +- drivers/usb/misc/yurex.c | 2 +- drivers/usb/mon/mon_bin.c | 6 +- drivers/usb/mon/mon_main.c | 2 +- drivers/usb/mon/mon_stat.c | 2 +- drivers/usb/mon/mon_text.c | 2 +- drivers/usb/mtu3/mtu3_core.c | 2 +- drivers/usb/mtu3/mtu3_gadget.c | 2 +- drivers/usb/musb/musb_cppi41.c | 2 +- drivers/usb/musb/musb_gadget.c | 2 +- drivers/usb/musb/musb_host.c | 2 +- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/musb/tusb6010_omap.c | 6 +- drivers/usb/musb/ux500_dma.c | 2 +- drivers/usb/phy/phy-fsl-usb.c | 4 +- drivers/usb/phy/phy-fsl-usb.h | 2 +- drivers/usb/renesas_usbhs/mod_gadget.c | 8 +- drivers/usb/renesas_usbhs/mod_host.c | 4 +- drivers/usb/renesas_usbhs/pipe.c | 3 +- drivers/usb/roles/class.c | 2 +- drivers/usb/serial/ark3116.c | 2 +- drivers/usb/serial/belkin_sa.c | 2 +- drivers/usb/serial/ch341.c | 2 +- drivers/usb/serial/console.c | 2 +- drivers/usb/serial/cp210x.c | 4 +- drivers/usb/serial/cyberjack.c | 2 +- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/digi_acceleport.c | 4 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/garmin_gps.c | 4 +- drivers/usb/serial/io_edgeport.c | 6 +- drivers/usb/serial/io_ti.c | 23 +++-- drivers/usb/serial/ipw.c | 2 +- drivers/usb/serial/ir-usb.c | 2 +- drivers/usb/serial/iuu_phoenix.c | 2 +- drivers/usb/serial/keyspan.c | 4 +- drivers/usb/serial/keyspan_pda.c | 2 +- drivers/usb/serial/kl5kusb105.c | 4 +- drivers/usb/serial/kobil_sct.c | 2 +- drivers/usb/serial/mct_u232.c | 2 +- drivers/usb/serial/metro-usb.c | 2 +- drivers/usb/serial/mos7720.c | 4 +- drivers/usb/serial/mos7840.c | 6 +- drivers/usb/serial/omninet.c | 2 +- drivers/usb/serial/opticon.c | 4 +- drivers/usb/serial/option.c | 2 +- drivers/usb/serial/oti6858.c | 2 +- drivers/usb/serial/pl2303.c | 4 +- drivers/usb/serial/qcserial.c | 2 +- drivers/usb/serial/quatech2.c | 4 +- drivers/usb/serial/sierra.c | 4 +- drivers/usb/serial/spcp8x5.c | 2 +- drivers/usb/serial/ssu100.c | 2 +- drivers/usb/serial/symbolserial.c | 2 +- drivers/usb/serial/ti_usb_3410_5052.c | 6 +- drivers/usb/serial/upd78f0730.c | 2 +- drivers/usb/serial/usb-serial.c | 8 +- drivers/usb/serial/usb_wwan.c | 2 +- drivers/usb/serial/whiteheat.c | 5 +- drivers/usb/serial/xr_serial.c | 4 +- drivers/usb/storage/alauda.c | 2 +- drivers/usb/storage/datafab.c | 2 +- drivers/usb/storage/ene_ub6250.c | 8 +- drivers/usb/storage/isd200.c | 2 +- drivers/usb/storage/jumpshot.c | 2 +- drivers/usb/storage/karma.c | 2 +- drivers/usb/storage/onetouch.c | 2 +- drivers/usb/storage/realtek_cr.c | 2 +- drivers/usb/storage/sddr09.c | 6 +- drivers/usb/storage/sddr55.c | 7 +- drivers/usb/storage/shuttle_usbat.c | 2 +- drivers/usb/storage/sierra_ms.c | 5 +- drivers/usb/storage/uas.c | 2 +- drivers/usb/storage/usb.c | 2 +- drivers/usb/typec/class.c | 10 +- drivers/usb/typec/mode_selection.c | 4 +- drivers/usb/typec/mux.c | 8 +- drivers/usb/typec/pd.c | 6 +- drivers/usb/typec/retimer.c | 2 +- drivers/usb/typec/tcpm/tcpm.c | 4 +- drivers/usb/typec/ucsi/debugfs.c | 2 +- drivers/usb/typec/ucsi/ucsi.c | 7 +- drivers/usb/usb-skeleton.c | 2 +- drivers/usb/usbip/stub_dev.c | 2 +- drivers/usb/usbip/stub_rx.c | 2 +- drivers/usb/usbip/stub_tx.c | 4 +- drivers/usb/usbip/usbip_event.c | 2 +- drivers/usb/usbip/vhci_hcd.c | 6 +- drivers/usb/usbip/vhci_sysfs.c | 8 +- drivers/usb/usbip/vhci_tx.c | 2 +- drivers/usb/usbip/vudc_dev.c | 10 +- drivers/usb/usbip/vudc_tx.c | 8 +- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/mlx5/core/mr.c | 10 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 26 +++--- drivers/vdpa/pds/aux_drv.c | 2 +- drivers/vdpa/solidrun/snet_main.c | 6 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 +-- drivers/vdpa/vdpa_user/iova_domain.c | 4 +- drivers/vdpa/vdpa_user/vduse_dev.c | 17 ++-- drivers/vdpa/virtio_pci/vp_vdpa.c | 6 +- drivers/vfio/cdx/intr.c | 2 +- drivers/vfio/cdx/main.c | 4 +- drivers/vfio/container.c | 4 +- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 4 +- drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c | 2 +- drivers/vfio/group.c | 2 +- drivers/vfio/mdev/mdev_core.c | 2 +- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 8 +- drivers/vfio/pci/mlx5/cmd.c | 6 +- drivers/vfio/pci/mlx5/main.c | 4 +- drivers/vfio/pci/pds/dirty.c | 9 +- drivers/vfio/pci/pds/lm.c | 4 +- drivers/vfio/pci/qat/main.c | 4 +- drivers/vfio/pci/vfio_pci_config.c | 2 +- drivers/vfio/pci/vfio_pci_core.c | 13 ++- drivers/vfio/pci/vfio_pci_dmabuf.c | 6 +- drivers/vfio/pci/vfio_pci_igd.c | 2 +- drivers/vfio/pci/vfio_pci_intrs.c | 2 +- drivers/vfio/pci/vfio_pci_rdwr.c | 2 +- drivers/vfio/pci/virtio/migrate.c | 8 +- drivers/vfio/pci/xe/main.c | 2 +- drivers/vfio/platform/vfio_platform_common.c | 4 +- drivers/vfio/platform/vfio_platform_irq.c | 4 +- drivers/vfio/vfio_iommu_spapr_tce.c | 6 +- drivers/vfio/vfio_iommu_type1.c | 14 +-- drivers/vfio/vfio_main.c | 7 +- drivers/vfio/virqfd.c | 2 +- drivers/vhost/iotlb.c | 4 +- drivers/vhost/net.c | 13 ++- drivers/vhost/scsi.c | 52 +++++------ drivers/vhost/test.c | 4 +- drivers/vhost/vdpa.c | 11 +-- drivers/vhost/vhost.c | 18 ++-- drivers/vhost/vringh.c | 2 +- drivers/vhost/vsock.c | 4 +- drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 +- drivers/video/console/sticon.c | 2 +- drivers/video/fbdev/arkfb.c | 3 +- drivers/video/fbdev/aty/atyfb_base.c | 2 +- drivers/video/fbdev/aty/radeon_backlight.c | 2 +- drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/carminefb.c | 2 +- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/core/fb_defio.c | 2 +- drivers/video/fbdev/core/fbcon.c | 2 +- drivers/video/fbdev/core/fbmon.c | 8 +- drivers/video/fbdev/core/modedb.c | 3 +- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/goldfishfb.c | 2 +- drivers/video/fbdev/matrox/i2c-matroxfb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_base.c | 2 +- drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +- drivers/video/fbdev/matrox/matroxfb_maven.c | 2 +- drivers/video/fbdev/mmp/core.c | 3 +- drivers/video/fbdev/mmp/fb/mmpfb.c | 4 +- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c | 2 +- drivers/video/fbdev/neofb.c | 2 +- drivers/video/fbdev/nvidia/nv_setup.c | 6 +- drivers/video/fbdev/omap/lcd_mipid.c | 2 +- drivers/video/fbdev/omap/omapfb_main.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/manager.c | 4 +- .../fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 5 +- drivers/video/fbdev/omap2/omapfb/dss/overlay.c | 3 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 8 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/pxa3xx-gcu.c | 2 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 2 +- drivers/video/fbdev/simplefb.c | 2 +- drivers/video/fbdev/sm501fb.c | 2 +- drivers/video/fbdev/smscufx.c | 9 +- drivers/video/fbdev/udlfb.c | 9 +- drivers/video/fbdev/uvesafb.c | 16 ++-- drivers/video/fbdev/valkyriefb.c | 2 +- drivers/video/fbdev/via/via_aux.c | 2 +- drivers/video/fbdev/via/via_aux.h | 2 +- drivers/video/fbdev/via/via_aux_edid.c | 2 +- drivers/video/fbdev/via/viafbdev.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- drivers/video/of_display_timing.c | 9 +- drivers/video/sticore.c | 10 +- drivers/video/vgastate.c | 2 +- drivers/virt/acrn/hsm.c | 6 +- drivers/virt/acrn/ioeventfd.c | 2 +- drivers/virt/acrn/ioreq.c | 6 +- drivers/virt/acrn/irqfd.c | 2 +- drivers/virt/acrn/mm.c | 10 +- drivers/virt/acrn/vm.c | 2 +- drivers/virt/coco/guest/report.c | 2 +- drivers/virt/coco/guest/tsm-mr.c | 2 +- drivers/virt/coco/sev-guest/sev-guest.c | 6 +- drivers/virt/coco/tsm-core.c | 2 +- drivers/virt/fsl_hypervisor.c | 6 +- drivers/virt/nitro_enclaves/ne_misc_dev.c | 25 +++-- drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 +- drivers/virt/vboxguest/vboxguest_core.c | 9 +- drivers/virtio/virtio_balloon.c | 2 +- drivers/virtio/virtio_input.c | 4 +- drivers/virtio/virtio_mem.c | 2 +- drivers/virtio/virtio_mmio.c | 2 +- drivers/virtio/virtio_pci_admin_legacy_io.c | 4 +- drivers/virtio/virtio_pci_common.c | 17 ++-- drivers/virtio/virtio_pci_modern.c | 22 ++--- drivers/virtio/virtio_ring.c | 11 +-- drivers/virtio/virtio_vdpa.c | 4 +- drivers/w1/masters/ds2490.c | 2 +- drivers/w1/slaves/w1_ds2433.c | 2 +- drivers/w1/slaves/w1_ds28e04.c | 2 +- drivers/w1/slaves/w1_therm.c | 3 +- drivers/w1/w1.c | 2 +- drivers/watchdog/exar_wdt.c | 2 +- drivers/watchdog/mei_wdt.c | 2 +- drivers/watchdog/pcwd_usb.c | 2 +- drivers/watchdog/watchdog_dev.c | 2 +- drivers/watchdog/watchdog_pretimeout.c | 4 +- drivers/xen/arm-device.c | 6 +- drivers/xen/balloon.c | 2 +- drivers/xen/events/events_base.c | 7 +- drivers/xen/evtchn.c | 6 +- drivers/xen/gntalloc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 18 ++-- drivers/xen/gntdev.c | 30 +++--- drivers/xen/grant-table.c | 11 +-- drivers/xen/mcelog.c | 3 +- drivers/xen/pci.c | 2 +- drivers/xen/pcpu.c | 2 +- drivers/xen/privcmd-buf.c | 4 +- drivers/xen/privcmd.c | 14 +-- drivers/xen/pvcalls-back.c | 6 +- drivers/xen/pvcalls-front.c | 6 +- drivers/xen/sys-hypervisor.c | 8 +- drivers/xen/time.c | 5 +- drivers/xen/unpopulated-alloc.c | 6 +- drivers/xen/xen-acpi-processor.c | 12 +-- drivers/xen/xen-front-pgdir-shbuf.c | 12 +-- drivers/xen/xen-pciback/conf_space.c | 2 +- drivers/xen/xen-pciback/conf_space_header.c | 4 +- drivers/xen/xen-pciback/conf_space_quirks.c | 2 +- drivers/xen/xen-pciback/passthrough.c | 4 +- drivers/xen/xen-pciback/pci_stub.c | 8 +- drivers/xen/xen-pciback/pciback_ops.c | 2 +- drivers/xen/xen-pciback/vpci.c | 4 +- drivers/xen/xen-pciback/xenbus.c | 2 +- drivers/xen/xen-scsiback.c | 15 ++- drivers/xen/xenbus/xenbus_client.c | 4 +- drivers/xen/xenbus/xenbus_dev_frontend.c | 8 +- drivers/xen/xenbus/xenbus_xs.c | 2 +- drivers/xen/xlate_mmu.c | 4 +- drivers/zorro/zorro.c | 3 +- fs/9p/vfs_super.c | 4 +- fs/adfs/dir.c | 2 +- fs/adfs/map.c | 2 +- fs/adfs/super.c | 2 +- fs/affs/dir.c | 2 +- fs/affs/super.c | 4 +- fs/afs/addr_list.c | 2 +- fs/afs/addr_prefs.c | 2 +- fs/afs/cell.c | 2 +- fs/afs/cmservice.c | 14 ++- fs/afs/dir.c | 9 +- fs/afs/dir_silly.c | 2 +- fs/afs/file.c | 4 +- fs/afs/fs_operation.c | 2 +- fs/afs/fs_probe.c | 2 +- fs/afs/fsclient.c | 2 +- fs/afs/main.c | 2 +- fs/afs/proc.c | 2 +- fs/afs/rotate.c | 5 +- fs/afs/rxrpc.c | 2 +- fs/afs/security.c | 2 +- fs/afs/server.c | 2 +- fs/afs/server_list.c | 2 +- fs/afs/super.c | 4 +- fs/afs/vl_list.c | 5 +- fs/afs/vlclient.c | 2 +- fs/afs/volume.c | 2 +- fs/afs/xattr.c | 4 +- fs/afs/yfsclient.c | 4 +- fs/aio.c | 6 +- fs/autofs/inode.c | 6 +- fs/autofs/waitq.c | 2 +- fs/befs/btree.c | 5 +- fs/befs/linuxvfs.c | 4 +- fs/bfs/inode.c | 2 +- fs/binfmt_elf.c | 17 ++-- fs/binfmt_elf_fdpic.c | 12 +-- fs/binfmt_misc.c | 2 +- fs/btrfs/async-thread.c | 4 +- fs/btrfs/backref.c | 12 +-- fs/btrfs/bio.c | 2 +- fs/btrfs/block-group.c | 7 +- fs/btrfs/block-rsv.c | 2 +- fs/btrfs/compression.c | 8 +- fs/btrfs/defrag.c | 4 +- fs/btrfs/delayed-inode.c | 4 +- fs/btrfs/delayed-ref.c | 2 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent_io.h | 2 +- fs/btrfs/fiemap.c | 5 +- fs/btrfs/file-item.c | 2 +- fs/btrfs/file.c | 4 +- fs/btrfs/free-space-cache.c | 2 +- fs/btrfs/inode.c | 18 ++-- fs/btrfs/ioctl.c | 24 ++--- fs/btrfs/lru_cache.c | 2 +- fs/btrfs/lzo.c | 2 +- fs/btrfs/qgroup.c | 25 +++-- fs/btrfs/raid56.c | 14 +-- fs/btrfs/ref-verify.c | 16 ++-- fs/btrfs/relocation.c | 8 +- fs/btrfs/scrub.c | 13 ++- fs/btrfs/send.c | 30 +++--- fs/btrfs/space-info.c | 4 +- fs/btrfs/super.c | 4 +- fs/btrfs/sysfs.c | 4 +- fs/btrfs/tests/btrfs-tests.c | 17 ++-- fs/btrfs/tests/delayed-refs-tests.c | 2 +- fs/btrfs/transaction.c | 2 +- fs/btrfs/tree-log.c | 6 +- fs/btrfs/tree-mod-log.c | 17 ++-- fs/btrfs/ulist.c | 6 +- fs/btrfs/volumes.c | 12 +-- fs/btrfs/zlib.c | 2 +- fs/btrfs/zoned.c | 5 +- fs/btrfs/zstd.c | 4 +- fs/buffer.c | 3 +- fs/cachefiles/daemon.c | 2 +- fs/cachefiles/io.c | 4 +- fs/cachefiles/ondemand.c | 4 +- fs/cachefiles/volume.c | 2 +- fs/ceph/addr.c | 8 +- fs/ceph/caps.c | 2 +- fs/ceph/crypto.c | 4 +- fs/ceph/file.c | 6 +- fs/ceph/inode.c | 2 +- fs/ceph/mds_client.c | 17 ++-- fs/ceph/mdsmap.c | 4 +- fs/ceph/quota.c | 2 +- fs/ceph/snap.c | 4 +- fs/ceph/super.c | 6 +- fs/ceph/xattr.c | 10 +- fs/char_dev.c | 4 +- fs/coda/dir.c | 2 +- fs/coda/file.c | 4 +- fs/coda/inode.c | 2 +- fs/coda/upcall.c | 6 +- fs/configfs/dir.c | 4 +- fs/configfs/file.c | 2 +- fs/configfs/inode.c | 2 +- fs/coredump.c | 5 +- fs/cramfs/inode.c | 4 +- fs/crypto/inline_crypt.c | 4 +- fs/crypto/keyring.c | 4 +- fs/crypto/keysetup_v1.c | 2 +- fs/crypto/policy.c | 2 +- fs/debugfs/file.c | 2 +- fs/debugfs/inode.c | 2 +- fs/devpts/inode.c | 2 +- fs/dlm/config.c | 20 ++-- fs/dlm/dir.c | 2 +- fs/dlm/lock.c | 4 +- fs/dlm/lockspace.c | 2 +- fs/dlm/lowcomms.c | 6 +- fs/dlm/member.c | 10 +- fs/dlm/midcomms.c | 2 +- fs/dlm/plock.c | 10 +- fs/dlm/user.c | 6 +- fs/ecryptfs/crypto.c | 2 +- fs/ecryptfs/keystore.c | 4 +- fs/ecryptfs/main.c | 2 +- fs/ecryptfs/messaging.c | 2 +- fs/efivarfs/super.c | 4 +- fs/efs/super.c | 2 +- fs/erofs/decompressor_deflate.c | 2 +- fs/erofs/decompressor_lzma.c | 2 +- fs/erofs/decompressor_zstd.c | 2 +- fs/erofs/fileio.c | 3 +- fs/erofs/fscache.c | 10 +- fs/erofs/super.c | 8 +- fs/erofs/xattr.c | 6 +- fs/erofs/zdata.c | 16 ++-- fs/erofs/zutil.c | 10 +- fs/eventfd.c | 2 +- fs/eventpoll.c | 2 +- fs/exec.c | 2 +- fs/exfat/balloc.c | 4 +- fs/exfat/dir.c | 2 +- fs/exfat/super.c | 2 +- fs/ext2/balloc.c | 2 +- fs/ext2/super.c | 11 +-- fs/ext4/block_validity.c | 2 +- fs/ext4/dir.c | 5 +- fs/ext4/extents-test.c | 4 +- fs/ext4/extents.c | 12 +-- fs/ext4/fsmap.c | 2 +- fs/ext4/mballoc-test.c | 13 ++- fs/ext4/mballoc.c | 11 +-- fs/ext4/orphan.c | 3 +- fs/ext4/resize.c | 11 +-- fs/ext4/super.c | 18 ++-- fs/ext4/sysfs.c | 2 +- fs/ext4/xattr.c | 18 ++-- fs/f2fs/super.c | 8 +- fs/fat/inode.c | 4 +- fs/fat/namei_vfat.c | 2 +- fs/fcntl.c | 2 +- fs/fhandle.c | 8 +- fs/file.c | 4 +- fs/freevxfs/vxfs_fshead.c | 2 +- fs/freevxfs/vxfs_super.c | 2 +- fs/fs-writeback.c | 9 +- fs/fs_context.c | 2 +- fs/fsopen.c | 2 +- fs/fuse/backing.c | 2 +- fs/fuse/cuse.c | 6 +- fs/fuse/dax.c | 8 +- fs/fuse/dev.c | 5 +- fs/fuse/dev_uring.c | 12 +-- fs/fuse/dir.c | 4 +- fs/fuse/file.c | 10 +- fs/fuse/inode.c | 20 ++-- fs/fuse/virtio_fs.c | 22 ++--- fs/gfs2/bmap.c | 2 +- fs/gfs2/dir.c | 2 +- fs/gfs2/file.c | 4 +- fs/gfs2/glock.c | 3 +- fs/gfs2/ops_fstype.c | 8 +- fs/gfs2/quota.c | 4 +- fs/gfs2/recovery.c | 2 +- fs/gfs2/rgrp.c | 11 +-- fs/gfs2/super.c | 4 +- fs/gfs2/xattr.c | 2 +- fs/hfs/btree.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfs/super.c | 2 +- fs/hfsplus/btree.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hfsplus/super.c | 2 +- fs/hfsplus/unicode_test.c | 4 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/dnode.c | 2 +- fs/hpfs/super.c | 4 +- fs/hugetlbfs/inode.c | 4 +- fs/iomap/buffered-io.c | 3 +- fs/iomap/direct-io.c | 2 +- fs/isofs/compress.c | 7 +- fs/isofs/inode.c | 4 +- fs/jbd2/journal.c | 11 +-- fs/jbd2/revoke.c | 2 +- fs/jffs2/acl.c | 3 +- fs/jffs2/erase.c | 2 +- fs/jffs2/fs.c | 3 +- fs/jffs2/readinode.c | 2 +- fs/jffs2/scan.c | 2 +- fs/jffs2/summary.c | 18 ++-- fs/jffs2/super.c | 2 +- fs/jffs2/wbuf.c | 2 +- fs/jffs2/xattr.c | 4 +- fs/jfs/jfs_dmap.c | 4 +- fs/jfs/jfs_imap.c | 2 +- fs/jfs/jfs_logmgr.c | 8 +- fs/jfs/jfs_metapage.c | 2 +- fs/jfs/super.c | 4 +- fs/kernfs/dir.c | 2 +- fs/kernfs/file.c | 4 +- fs/kernfs/mount.c | 4 +- fs/libfs.c | 4 +- fs/lockd/clntlock.c | 2 +- fs/lockd/clntproc.c | 4 +- fs/lockd/host.c | 2 +- fs/lockd/svclock.c | 4 +- fs/lockd/svcsubs.c | 2 +- fs/mbcache.c | 7 +- fs/minix/inode.c | 2 +- fs/mnt_idmapping.c | 2 +- fs/namei.c | 4 +- fs/namespace.c | 6 +- fs/netfs/buffered_read.c | 2 +- fs/netfs/buffered_write.c | 2 +- fs/netfs/fscache_cache.c | 2 +- fs/netfs/fscache_io.c | 2 +- fs/netfs/fscache_volume.c | 3 +- fs/netfs/rolling_buffer.c | 2 +- fs/nfs/blocklayout/blocklayout.c | 8 +- fs/nfs/blocklayout/dev.c | 13 ++- fs/nfs/blocklayout/extent_tree.c | 9 +- fs/nfs/cache_lib.c | 2 +- fs/nfs/callback_proc.c | 2 +- fs/nfs/callback_xdr.c | 13 ++- fs/nfs/client.c | 4 +- fs/nfs/delegation.c | 7 +- fs/nfs/dir.c | 12 +-- fs/nfs/dns_resolve.c | 2 +- fs/nfs/filelayout/filelayout.c | 10 +- fs/nfs/filelayout/filelayoutdev.c | 2 +- fs/nfs/flexfilelayout/flexfilelayout.c | 23 ++--- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 9 +- fs/nfs/fs_context.c | 2 +- fs/nfs/fscache.c | 2 +- fs/nfs/inode.c | 12 +-- fs/nfs/localio.c | 7 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs40client.c | 2 +- fs/nfs/nfs40proc.c | 4 +- fs/nfs/nfs42proc.c | 18 ++-- fs/nfs/nfs42xdr.c | 2 +- fs/nfs/nfs4client.c | 2 +- fs/nfs/nfs4file.c | 3 +- fs/nfs/nfs4idmap.c | 4 +- fs/nfs/nfs4namespace.c | 4 +- fs/nfs/nfs4proc.c | 38 ++++---- fs/nfs/nfs4session.c | 4 +- fs/nfs/nfs4state.c | 10 +- fs/nfs/nfs4super.c | 2 +- fs/nfs/pagelist.c | 5 +- fs/nfs/pnfs.c | 12 +-- fs/nfs/pnfs_dev.c | 4 +- fs/nfs/pnfs_nfs.c | 6 +- fs/nfs/proc.c | 2 +- fs/nfs/sysfs.c | 4 +- fs/nfs/unlink.c | 4 +- fs/nfs/write.c | 2 +- fs/nfsd/blocklayout.c | 6 +- fs/nfsd/blocklayoutxdr.c | 4 +- fs/nfsd/export.c | 11 +-- fs/nfsd/filecache.c | 2 +- fs/nfsd/flexfilelayout.c | 4 +- fs/nfsd/nfs4callback.c | 4 +- fs/nfsd/nfs4idmap.c | 2 +- fs/nfsd/nfs4proc.c | 9 +- fs/nfsd/nfs4recover.c | 16 ++-- fs/nfsd/nfs4state.c | 34 +++---- fs/nfsd/nfs4xdr.c | 6 +- fs/nfsd/nfsctl.c | 4 +- fs/nilfs2/alloc.c | 2 +- fs/nilfs2/recovery.c | 4 +- fs/nilfs2/segment.c | 2 +- fs/nilfs2/super.c | 2 +- fs/nilfs2/the_nilfs.c | 4 +- fs/notify/fanotify/fanotify_user.c | 2 +- fs/notify/group.c | 2 +- fs/notify/inotify/inotify_user.c | 2 +- fs/notify/mark.c | 2 +- fs/ntfs3/bitmap.c | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/frecord.c | 6 +- fs/ntfs3/fslog.c | 9 +- fs/ntfs3/index.c | 4 +- fs/ntfs3/lib/lzx_decompress.c | 2 +- fs/ntfs3/lib/xpress_decompress.c | 2 +- fs/ntfs3/ntfs_fs.h | 4 +- fs/ntfs3/record.c | 2 +- fs/ntfs3/super.c | 4 +- fs/ocfs2/alloc.c | 15 ++- fs/ocfs2/aops.c | 7 +- fs/ocfs2/cluster/heartbeat.c | 12 +-- fs/ocfs2/cluster/netdebug.c | 2 +- fs/ocfs2/cluster/nodemanager.c | 6 +- fs/ocfs2/cluster/tcp.c | 8 +- fs/ocfs2/dcache.c | 2 +- fs/ocfs2/dir.c | 3 +- fs/ocfs2/dlm/dlmdomain.c | 8 +- fs/ocfs2/dlm/dlmlock.c | 2 +- fs/ocfs2/dlm/dlmmaster.c | 4 +- fs/ocfs2/dlm/dlmrecovery.c | 6 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/extent_map.c | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/filecheck.c | 4 +- fs/ocfs2/ioctl.c | 4 +- fs/ocfs2/journal.c | 14 ++- fs/ocfs2/localalloc.c | 2 +- fs/ocfs2/move_extents.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/ocfs2/quota_local.c | 6 +- fs/ocfs2/refcounttree.c | 6 +- fs/ocfs2/slot_map.c | 6 +- fs/ocfs2/stack_o2cb.c | 2 +- fs/ocfs2/stack_user.c | 4 +- fs/ocfs2/stackglue.c | 3 +- fs/ocfs2/suballoc.c | 8 +- fs/ocfs2/super.c | 4 +- fs/ocfs2/xattr.c | 2 +- fs/omfs/inode.c | 4 +- fs/orangefs/dir.c | 3 +- fs/orangefs/inode.c | 10 +- fs/orangefs/orangefs-bufmap.c | 8 +- fs/orangefs/orangefs-debugfs.c | 2 +- fs/orangefs/orangefs-mod.c | 2 +- fs/orangefs/orangefs-sysfs.c | 16 ++-- fs/orangefs/super.c | 2 +- fs/orangefs/xattr.c | 4 +- fs/overlayfs/file.c | 2 +- fs/overlayfs/namei.c | 2 +- fs/overlayfs/params.c | 6 +- fs/overlayfs/readdir.c | 6 +- fs/overlayfs/super.c | 4 +- fs/overlayfs/util.c | 4 +- fs/pipe.c | 9 +- fs/posix_acl.c | 2 +- fs/proc/kcore.c | 6 +- fs/proc/root.c | 4 +- fs/proc/task_mmu.c | 5 +- fs/pstore/blk.c | 2 +- fs/pstore/inode.c | 6 +- fs/pstore/platform.c | 2 +- fs/pstore/ram.c | 6 +- fs/pstore/ram_core.c | 9 +- fs/pstore/zone.c | 4 +- fs/qnx4/inode.c | 2 +- fs/qnx6/inode.c | 4 +- fs/qnx6/super_mmi.c | 2 +- fs/quota/quota_v2.c | 2 +- fs/ramfs/inode.c | 2 +- fs/resctrl/monitor.c | 2 +- fs/resctrl/pseudo_lock.c | 4 +- fs/resctrl/rdtgroup.c | 8 +- fs/select.c | 4 +- fs/seq_file.c | 2 +- fs/signalfd.c | 2 +- fs/smb/client/cached_dir.c | 6 +- fs/smb/client/cifs_swn.c | 2 +- fs/smb/client/cifsacl.c | 9 +- fs/smb/client/cifsencrypt.c | 2 +- fs/smb/client/cifsfs.c | 4 +- fs/smb/client/compress.c | 2 +- fs/smb/client/connect.c | 10 +- fs/smb/client/dfs.h | 2 +- fs/smb/client/dfs_cache.c | 4 +- fs/smb/client/file.c | 16 ++-- fs/smb/client/fs_context.c | 2 +- fs/smb/client/inode.c | 11 +-- fs/smb/client/ioctl.c | 2 +- fs/smb/client/misc.c | 16 ++-- fs/smb/client/readdir.c | 4 +- fs/smb/client/sess.c | 2 +- fs/smb/client/smb1ops.c | 2 +- fs/smb/client/smb1session.c | 4 +- fs/smb/client/smb2file.c | 4 +- fs/smb/client/smb2inode.c | 2 +- fs/smb/client/smb2misc.c | 4 +- fs/smb/client/smb2ops.c | 17 ++-- fs/smb/client/smb2pdu.c | 24 +++-- fs/smb/client/smbdirect.c | 9 +- fs/smb/server/auth.c | 7 +- fs/smb/server/connection.c | 2 +- fs/smb/server/crypto_ctx.c | 4 +- fs/smb/server/ksmbd_work.c | 6 +- fs/smb/server/mgmt/share_config.c | 4 +- fs/smb/server/mgmt/tree_connect.c | 3 +- fs/smb/server/mgmt/user_config.c | 2 +- fs/smb/server/mgmt/user_session.c | 6 +- fs/smb/server/oplock.c | 12 +-- fs/smb/server/server.c | 2 +- fs/smb/server/smb2pdu.c | 10 +- fs/smb/server/smbacl.c | 10 +- fs/smb/server/transport_rdma.c | 8 +- fs/smb/server/transport_tcp.c | 6 +- fs/smb/server/vfs_cache.c | 4 +- fs/splice.c | 10 +- fs/squashfs/block.c | 4 +- fs/squashfs/cache.c | 4 +- fs/squashfs/decompressor_multi.c | 6 +- fs/squashfs/decompressor_single.c | 2 +- fs/squashfs/file.c | 5 +- fs/squashfs/lz4_wrapper.c | 2 +- fs/squashfs/lzo_wrapper.c | 2 +- fs/squashfs/page_actor.c | 4 +- fs/squashfs/super.c | 4 +- fs/squashfs/xz_wrapper.c | 4 +- fs/squashfs/zlib_wrapper.c | 2 +- fs/squashfs/zstd_wrapper.c | 2 +- fs/super.c | 6 +- fs/sync.c | 2 +- fs/sysfs/mount.c | 2 +- fs/timerfd.c | 2 +- fs/tracefs/event_inode.c | 8 +- fs/tracefs/inode.c | 2 +- fs/ubifs/debug.c | 4 +- fs/ubifs/dir.c | 6 +- fs/ubifs/file.c | 2 +- fs/ubifs/gc.c | 4 +- fs/ubifs/log.c | 4 +- fs/ubifs/lpt.c | 15 ++- fs/ubifs/orphan.c | 4 +- fs/ubifs/recovery.c | 4 +- fs/ubifs/replay.c | 8 +- fs/ubifs/scan.c | 4 +- fs/ubifs/super.c | 12 +-- fs/ubifs/sysfs.c | 2 +- fs/ubifs/tnc.c | 9 +- fs/ubifs/tnc_commit.c | 5 +- fs/udf/super.c | 16 ++-- fs/ufs/super.c | 11 +-- fs/ufs/util.c | 2 +- fs/unicode/utf8-core.c | 2 +- fs/userfaultfd.c | 4 +- fs/vboxsf/file.c | 2 +- fs/vboxsf/super.c | 4 +- fs/vboxsf/utils.c | 4 +- fs/xfs/libxfs/xfs_ag.c | 2 +- fs/xfs/libxfs/xfs_defer.c | 2 +- fs/xfs/libxfs/xfs_dir2.c | 19 ++-- fs/xfs/libxfs/xfs_refcount.c | 4 +- fs/xfs/libxfs/xfs_rtgroup.c | 2 +- fs/xfs/scrub/agheader.c | 4 +- fs/xfs/scrub/agheader_repair.c | 2 +- fs/xfs/scrub/alloc_repair.c | 2 +- fs/xfs/scrub/attr.c | 2 +- fs/xfs/scrub/attr_repair.c | 2 +- fs/xfs/scrub/bitmap.c | 12 +-- fs/xfs/scrub/bmap_repair.c | 2 +- fs/xfs/scrub/btree.c | 2 +- fs/xfs/scrub/cow_repair.c | 2 +- fs/xfs/scrub/dabtree.c | 2 +- fs/xfs/scrub/dir.c | 2 +- fs/xfs/scrub/dir_repair.c | 2 +- fs/xfs/scrub/dirtree.c | 4 +- fs/xfs/scrub/dirtree_repair.c | 2 +- fs/xfs/scrub/fscounters.c | 2 +- fs/xfs/scrub/ialloc_repair.c | 2 +- fs/xfs/scrub/inode_repair.c | 2 +- fs/xfs/scrub/metapath.c | 2 +- fs/xfs/scrub/newbt.c | 2 +- fs/xfs/scrub/nlinks.c | 2 +- fs/xfs/scrub/parent.c | 2 +- fs/xfs/scrub/parent_repair.c | 2 +- fs/xfs/scrub/quotacheck.c | 4 +- fs/xfs/scrub/rcbag.c | 2 +- fs/xfs/scrub/refcount.c | 3 +- fs/xfs/scrub/refcount_repair.c | 2 +- fs/xfs/scrub/rmap.c | 2 +- fs/xfs/scrub/rmap_repair.c | 2 +- fs/xfs/scrub/rtbitmap.c | 4 +- fs/xfs/scrub/rtrefcount.c | 3 +- fs/xfs/scrub/rtrefcount_repair.c | 2 +- fs/xfs/scrub/rtrmap_repair.c | 2 +- fs/xfs/scrub/rtsummary.c | 3 +- fs/xfs/scrub/scrub.c | 4 +- fs/xfs/scrub/stats.c | 2 +- fs/xfs/scrub/xfblob.c | 2 +- fs/xfs/scrub/xfile.c | 2 +- fs/xfs/xfs_buf.c | 6 +- fs/xfs/xfs_buf_item_recover.c | 5 +- fs/xfs/xfs_buf_mem.c | 2 +- fs/xfs/xfs_discard.c | 6 +- fs/xfs/xfs_extent_busy.c | 5 +- fs/xfs/xfs_filestream.c | 2 +- fs/xfs/xfs_fsmap.c | 4 +- fs/xfs/xfs_healthmon.c | 7 +- fs/xfs/xfs_inode_item_recover.c | 4 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_itable.c | 8 +- fs/xfs/xfs_iwalk.c | 4 +- fs/xfs/xfs_log.c | 2 +- fs/xfs/xfs_log_cil.c | 4 +- fs/xfs/xfs_log_recover.c | 9 +- fs/xfs/xfs_mru_cache.c | 2 +- fs/xfs/xfs_qm.c | 4 +- fs/xfs/xfs_super.c | 6 +- fs/xfs/xfs_trans_ail.c | 3 +- fs/xfs/xfs_zone_alloc.c | 4 +- fs/xfs/xfs_zone_gc.c | 6 +- fs/zonefs/super.c | 12 +-- include/kunit/resource.h | 4 +- include/linux/acpi.h | 2 +- include/linux/bpf.h | 2 +- include/linux/crash_dump.h | 2 +- include/linux/dma-fence-chain.h | 2 +- include/linux/gameport.h | 2 +- include/linux/io-mapping.h | 2 +- include/linux/kvm_host.h | 2 +- include/linux/skmsg.h | 3 +- include/linux/spi/spi.h | 2 +- include/net/act_api.h | 2 +- include/net/fq_impl.h | 2 +- include/net/iucv/iucv.h | 2 +- include/net/tc_act/tc_gate.h | 2 +- include/net/udp.h | 4 +- init/initramfs.c | 6 +- init/initramfs_test.c | 4 +- io_uring/bpf_filter.c | 9 +- io_uring/eventfd.c | 2 +- io_uring/futex.c | 4 +- io_uring/io-wq.c | 4 +- io_uring/io_uring.c | 8 +- io_uring/kbuf.c | 8 +- io_uring/memmap.c | 4 +- io_uring/mock_file.c | 4 +- io_uring/poll.c | 4 +- io_uring/register.c | 4 +- io_uring/rsrc.c | 11 +-- io_uring/sqpoll.c | 2 +- io_uring/tctx.c | 8 +- io_uring/xattr.c | 4 +- io_uring/zcrx.c | 10 +- ipc/mqueue.c | 8 +- ipc/msg.c | 2 +- ipc/namespace.c | 2 +- ipc/sem.c | 8 +- ipc/shm.c | 4 +- ipc/util.c | 2 +- kernel/acct.c | 2 +- kernel/async.c | 4 +- kernel/audit.c | 7 +- kernel/audit_fsnotify.c | 2 +- kernel/audit_tree.c | 4 +- kernel/audit_watch.c | 4 +- kernel/auditfilter.c | 8 +- kernel/auditsc.c | 12 +-- kernel/bpf/arena.c | 2 +- kernel/bpf/arraymap.c | 6 +- kernel/bpf/bpf_iter.c | 4 +- kernel/bpf/bpf_struct_ops.c | 13 ++- kernel/bpf/btf.c | 35 +++---- kernel/bpf/cgroup.c | 4 +- kernel/bpf/core.c | 14 +-- kernel/bpf/crypto.c | 4 +- kernel/bpf/helpers.c | 4 +- kernel/bpf/inode.c | 4 +- kernel/bpf/liveness.c | 9 +- kernel/bpf/lpm_trie.c | 6 +- kernel/bpf/net_namespace.c | 2 +- kernel/bpf/offload.c | 6 +- kernel/bpf/syscall.c | 13 ++- kernel/bpf/tcx.c | 2 +- kernel/bpf/token.c | 2 +- kernel/bpf/trampoline.c | 10 +- kernel/bpf/verifier.c | 69 +++++++------- kernel/cgroup/cgroup-v1.c | 6 +- kernel/cgroup/cgroup.c | 10 +- kernel/cgroup/cpuset-v1.c | 9 +- kernel/cgroup/cpuset.c | 11 +-- kernel/cgroup/debug.c | 2 +- kernel/cgroup/dmem.c | 8 +- kernel/cgroup/legacy_freezer.c | 2 +- kernel/cgroup/misc.c | 2 +- kernel/cgroup/namespace.c | 2 +- kernel/cgroup/pids.c | 2 +- kernel/cgroup/rdma.c | 6 +- kernel/crash_core.c | 2 +- kernel/crash_dump_dm_crypt.c | 2 +- kernel/debug/kdb/kdb_main.c | 4 +- kernel/dma/coherent.c | 2 +- kernel/dma/debug.c | 2 +- kernel/dma/direct.c | 2 +- kernel/dma/map_benchmark.c | 2 +- kernel/dma/mapping.c | 2 +- kernel/dma/remap.c | 2 +- kernel/dma/swiotlb.c | 7 +- kernel/events/core.c | 12 +-- kernel/events/hw_breakpoint.c | 3 +- kernel/events/uprobes.c | 16 ++-- kernel/fail_function.c | 2 +- kernel/futex/pi.c | 2 +- kernel/futex/syscalls.c | 2 +- kernel/gcov/clang.c | 4 +- kernel/gcov/fs.c | 10 +- kernel/gcov/gcc_4_7.c | 4 +- kernel/groups.c | 2 +- kernel/irq/affinity.c | 2 +- kernel/irq/generic-chip.c | 2 +- kernel/irq/irq_sim.c | 4 +- kernel/irq/irqdesc.c | 2 +- kernel/irq/irqdomain.c | 2 +- kernel/irq/manage.c | 6 +- kernel/irq/matrix.c | 2 +- kernel/irq/msi.c | 4 +- kernel/kallsyms_selftest.c | 2 +- kernel/kcov.c | 4 +- kernel/kcsan/kcsan_test.c | 4 +- kernel/kexec.c | 3 +- kernel/kexec_core.c | 4 +- kernel/kprobes.c | 10 +- kernel/kthread.c | 7 +- kernel/livepatch/core.c | 4 +- kernel/livepatch/patch.c | 2 +- kernel/liveupdate/kexec_handover.c | 4 +- kernel/liveupdate/kexec_handover_debugfs.c | 2 +- kernel/liveupdate/luo_file.c | 4 +- kernel/liveupdate/luo_flb.c | 2 +- kernel/liveupdate/luo_session.c | 2 +- kernel/locking/locktorture.c | 29 +++--- kernel/locking/test-ww_mutex.c | 11 +-- kernel/module/dups.c | 2 +- kernel/module/main.c | 4 +- kernel/module/stats.c | 2 +- kernel/module/sysfs.c | 9 +- kernel/module/tracking.c | 2 +- kernel/padata.c | 10 +- kernel/params.c | 8 +- kernel/power/console.c | 2 +- kernel/power/energy_model.c | 2 +- kernel/power/qos.c | 4 +- kernel/power/snapshot.c | 6 +- kernel/power/swap.c | 8 +- kernel/power/wakelock.c | 2 +- kernel/printk/nbcon.c | 2 +- kernel/printk/printk.c | 2 +- kernel/rcu/rcuscale.c | 25 ++--- kernel/rcu/rcutorture.c | 36 ++++--- kernel/rcu/refscale.c | 5 +- kernel/rcu/srcutree.c | 5 +- kernel/rcu/tasks.h | 3 +- kernel/rcu/update.c | 2 +- kernel/reboot.c | 2 +- kernel/relay.c | 9 +- kernel/resource.c | 4 +- kernel/resource_kunit.c | 2 +- kernel/scftorture.c | 4 +- kernel/sched/autogroup.c | 2 +- kernel/sched/core_sched.c | 2 +- kernel/sched/cpuacct.c | 2 +- kernel/sched/cpudeadline.c | 4 +- kernel/sched/cpufreq_schedutil.c | 4 +- kernel/sched/cpupri.c | 2 +- kernel/sched/ext.c | 10 +- kernel/sched/ext_idle.c | 4 +- kernel/sched/fair.c | 6 +- kernel/sched/psi.c | 4 +- kernel/sched/rt.c | 4 +- kernel/sched/topology.c | 8 +- kernel/seccomp.c | 4 +- kernel/static_call_inline.c | 4 +- kernel/time/namespace.c | 2 +- kernel/time/posix-clock.c | 2 +- kernel/time/timer_migration.c | 5 +- kernel/torture.c | 2 +- kernel/trace/blktrace.c | 4 +- kernel/trace/bpf_trace.c | 8 +- kernel/trace/fprobe.c | 4 +- kernel/trace/ftrace.c | 30 +++--- kernel/trace/pid_list.c | 10 +- kernel/trace/rethook.c | 2 +- kernel/trace/ring_buffer.c | 6 +- kernel/trace/trace.c | 39 ++++---- kernel/trace/trace_btf.c | 2 +- kernel/trace/trace_eprobe.c | 6 +- kernel/trace/trace_events.c | 24 ++--- kernel/trace/trace_events_filter.c | 32 +++---- kernel/trace/trace_events_hist.c | 32 +++---- kernel/trace/trace_events_synth.c | 14 +-- kernel/trace/trace_events_trigger.c | 4 +- kernel/trace/trace_events_user.c | 16 ++-- kernel/trace/trace_fprobe.c | 6 +- kernel/trace/trace_functions.c | 2 +- kernel/trace/trace_functions_graph.c | 4 +- kernel/trace/trace_kprobe.c | 4 +- kernel/trace/trace_mmiotrace.c | 2 +- kernel/trace/trace_osnoise.c | 2 +- kernel/trace/trace_printk.c | 2 +- kernel/trace/trace_probe.c | 12 +-- kernel/trace/trace_recursion_record.c | 2 +- kernel/trace/trace_sched_switch.c | 3 +- kernel/trace/trace_selftest.c | 2 +- kernel/trace/trace_stat.c | 4 +- kernel/trace/trace_syscalls.c | 7 +- kernel/trace/trace_uprobe.c | 4 +- kernel/trace/tracing_map.c | 14 +-- kernel/tracepoint.c | 5 +- kernel/ucount.c | 2 +- kernel/umh.c | 2 +- kernel/unwind/deferred.c | 4 +- kernel/user_namespace.c | 5 +- kernel/vhost_task.c | 2 +- kernel/watch_queue.c | 6 +- kernel/workqueue.c | 18 ++-- lib/alloc_tag.c | 5 +- lib/assoc_array.c | 32 +++---- lib/bch.c | 2 +- lib/bucket_locks.c | 2 +- lib/codetag.c | 4 +- lib/cpu_rmap.c | 2 +- lib/crypto/gf128mul.c | 6 +- lib/crypto/mpi/mpih-mul.c | 2 +- lib/crypto/mpi/mpiutil.c | 6 +- lib/dhry_1.c | 4 +- lib/dim/net_dim.c | 2 +- lib/dynamic_debug.c | 2 +- lib/error-inject.c | 2 +- lib/group_cpus.c | 14 ++- lib/idr.c | 6 +- lib/interval_tree_test.c | 3 +- lib/iov_iter.c | 4 +- lib/kobject.c | 4 +- lib/kobject_uevent.c | 6 +- lib/kunit/attributes.c | 2 +- lib/kunit/device.c | 2 +- lib/kunit/executor.c | 7 +- lib/kunit/executor_test.c | 2 +- lib/kunit/kunit-example-test.c | 2 +- lib/kunit/kunit-test.c | 3 +- lib/kunit/resource.c | 2 +- lib/kunit/static_stub.c | 2 +- lib/kunit/string-stream.c | 4 +- lib/logic_iomem.c | 2 +- lib/lru_cache.c | 6 +- lib/lwq.c | 2 +- lib/objagg.c | 17 ++-- lib/once.c | 2 +- lib/parman.c | 2 +- lib/percpu-refcount.c | 2 +- lib/pldmfw/pldmfw.c | 8 +- lib/rbtree_test.c | 2 +- lib/reed_solomon/reed_solomon.c | 2 +- lib/reed_solomon/test_rslib.c | 4 +- lib/ref_tracker.c | 5 +- lib/scatterlist.c | 6 +- lib/sg_split.c | 7 +- lib/stackdepot.c | 2 +- lib/string_helpers.c | 2 +- lib/test_bpf.c | 50 +++++----- lib/test_debug_virtual.c | 2 +- lib/test_firmware.c | 4 +- lib/test_hmm.c | 4 +- lib/test_kho.c | 2 +- lib/test_memcat_p.c | 8 +- lib/test_objagg.c | 4 +- lib/test_parman.c | 2 +- lib/test_rhashtable.c | 2 +- lib/test_vmalloc.c | 4 +- lib/tests/kunit_iov_iter.c | 6 +- lib/tests/list-test.c | 8 +- lib/tests/test_ratelimit.c | 3 +- lib/xz/xz_dec_bcj.c | 2 +- lib/xz/xz_dec_lzma2.c | 4 +- lib/xz/xz_dec_stream.c | 2 +- lib/zlib_inflate/infutil.c | 2 +- mm/backing-dev.c | 2 +- mm/cma_debug.c | 2 +- mm/cma_sysfs.c | 2 +- mm/damon/core.c | 12 +-- mm/damon/stat.c | 4 +- mm/damon/sysfs-common.c | 3 +- mm/damon/sysfs-schemes.c | 64 +++++++------ mm/damon/sysfs.c | 52 +++++------ mm/damon/tests/core-kunit.h | 8 +- mm/damon/tests/sysfs-kunit.h | 4 +- mm/damon/vaddr.c | 4 +- mm/dmapool_test.c | 2 +- mm/hmm.c | 4 +- mm/huge_memory.c | 2 +- mm/hugetlb.c | 15 ++- mm/hugetlb_cgroup.c | 7 +- mm/kasan/kasan_test_c.c | 12 +-- mm/khugepaged.c | 2 +- mm/kmsan/kmsan_test.c | 8 +- mm/kmsan/shadow.c | 4 +- mm/ksm.c | 4 +- mm/list_lru.c | 4 +- mm/madvise.c | 2 +- mm/memcontrol-v1.c | 6 +- mm/memcontrol.c | 5 +- mm/memfd_luo.c | 2 +- mm/memory-failure.c | 6 +- mm/memory-tiers.c | 8 +- mm/memory.c | 2 +- mm/mempolicy.c | 17 ++-- mm/mempool.c | 3 +- mm/mmu_notifier.c | 4 +- mm/page_owner.c | 2 +- mm/page_reporting.c | 2 +- mm/shmem.c | 2 +- mm/shmem_quota.c | 4 +- mm/shrinker.c | 2 +- mm/slub.c | 8 +- mm/swapfile.c | 10 +- mm/vmalloc.c | 8 +- mm/vmpressure.c | 2 +- mm/vmscan.c | 3 +- mm/zsmalloc.c | 4 +- mm/zswap.c | 4 +- net/802/garp.c | 4 +- net/802/mrp.c | 4 +- net/802/psnap.c | 2 +- net/8021q/vlan_core.c | 4 +- net/8021q/vlan_dev.c | 4 +- net/9p/client.c | 8 +- net/9p/protocol.c | 5 +- net/9p/trans_fd.c | 5 +- net/9p/trans_rdma.c | 6 +- net/9p/trans_usbg.c | 6 +- net/9p/trans_virtio.c | 7 +- net/9p/trans_xen.c | 5 +- net/appletalk/aarp.c | 2 +- net/appletalk/ddp.c | 4 +- net/atm/addr.c | 2 +- net/atm/br2684.c | 2 +- net/atm/clip.c | 2 +- net/atm/lec.c | 6 +- net/atm/mpc.c | 4 +- net/atm/mpoa_caches.c | 4 +- net/atm/pppoatm.c | 2 +- net/atm/resources.c | 2 +- net/ax25/af_ax25.c | 4 +- net/ax25/ax25_dev.c | 2 +- net/ax25/ax25_iface.c | 2 +- net/ax25/ax25_in.c | 2 +- net/ax25/ax25_route.c | 6 +- net/ax25/ax25_uid.c | 2 +- net/batman-adv/bat_v_elp.c | 2 +- net/batman-adv/bridge_loop_avoidance.c | 4 +- net/batman-adv/distributed-arp-table.c | 5 +- net/batman-adv/fragmentation.c | 2 +- net/batman-adv/gateway_client.c | 2 +- net/batman-adv/hard-interface.c | 2 +- net/batman-adv/hash.c | 7 +- net/batman-adv/mesh-interface.c | 2 +- net/batman-adv/multicast.c | 6 +- net/batman-adv/originator.c | 12 +-- net/batman-adv/send.c | 2 +- net/batman-adv/tp_meter.c | 6 +- net/batman-adv/tvlv.c | 2 +- net/bluetooth/6lowpan.c | 6 +- net/bluetooth/cmtp/capi.c | 2 +- net/bluetooth/cmtp/core.c | 2 +- net/bluetooth/hci_conn.c | 12 +-- net/bluetooth/hci_core.c | 22 ++--- net/bluetooth/hci_sync.c | 10 +- net/bluetooth/hidp/core.c | 2 +- net/bluetooth/iso.c | 2 +- net/bluetooth/l2cap_core.c | 4 +- net/bluetooth/l2cap_sock.c | 4 +- net/bluetooth/mgmt.c | 14 +-- net/bluetooth/mgmt_util.c | 4 +- net/bluetooth/msft.c | 8 +- net/bluetooth/rfcomm/core.c | 4 +- net/bluetooth/rfcomm/tty.c | 4 +- net/bluetooth/sco.c | 2 +- net/bluetooth/smp.c | 8 +- net/bpf/bpf_dummy_struct_ops.c | 6 +- net/bridge/br_cfm.c | 4 +- net/bridge/br_device.c | 2 +- net/bridge/br_if.c | 2 +- net/bridge/br_ioctl.c | 4 +- net/bridge/br_mdb.c | 4 +- net/bridge/br_mrp.c | 2 +- net/bridge/br_multicast.c | 8 +- net/bridge/br_multicast_eht.c | 6 +- net/bridge/br_switchdev.c | 2 +- net/bridge/br_vlan.c | 8 +- net/bridge/netfilter/ebtables.c | 2 +- net/caif/caif_dev.c | 2 +- net/caif/caif_usb.c | 2 +- net/caif/cfcnfg.c | 4 +- net/caif/cfctrl.c | 4 +- net/caif/cfdbgl.c | 2 +- net/caif/cfdgml.c | 2 +- net/caif/cffrml.c | 2 +- net/caif/cfmuxl.c | 2 +- net/caif/cfrfml.c | 2 +- net/caif/cfserl.c | 2 +- net/caif/cfutill.c | 2 +- net/caif/cfveil.c | 2 +- net/caif/cfvidl.c | 2 +- net/can/af_can.c | 9 +- net/can/gw.c | 2 +- net/can/j1939/bus.c | 2 +- net/can/j1939/main.c | 2 +- net/can/j1939/transport.c | 2 +- net/ceph/auth.c | 2 +- net/ceph/auth_none.c | 4 +- net/ceph/auth_x.c | 6 +- net/ceph/buffer.c | 2 +- net/ceph/ceph_common.c | 11 +-- net/ceph/cls_lock_client.c | 2 +- net/ceph/crypto.c | 2 +- net/ceph/messenger.c | 3 +- net/ceph/mon_client.c | 8 +- net/ceph/osd_client.c | 28 +++--- net/ceph/osdmap.c | 25 +++-- net/ceph/pagelist.c | 2 +- net/ceph/pagevec.c | 2 +- net/ceph/striper.c | 4 +- net/core/bpf_sk_storage.c | 2 +- net/core/dev.c | 25 +++-- net/core/devmem.c | 12 +-- net/core/drop_monitor.c | 8 +- net/core/dst.c | 5 +- net/core/failover.c | 2 +- net/core/filter.c | 7 +- net/core/flow_offload.c | 13 ++- net/core/gen_estimator.c | 2 +- net/core/gro_cells.c | 2 +- net/core/neighbour.c | 2 +- net/core/net_namespace.c | 2 +- net/core/netclassid_cgroup.c | 2 +- net/core/netpoll.c | 2 +- net/core/netprio_cgroup.c | 2 +- net/core/rtnetlink.c | 4 +- net/core/scm.c | 2 +- net/core/selftests.c | 2 +- net/core/skmsg.c | 2 +- net/core/sock.c | 2 +- net/core/sock_diag.c | 2 +- net/core/sock_map.c | 2 +- net/core/sock_reuseport.c | 2 +- net/core/xdp.c | 4 +- net/dcb/dcbnl.c | 5 +- net/devlink/core.c | 4 +- net/devlink/dpipe.c | 2 +- net/devlink/health.c | 6 +- net/devlink/linecard.c | 5 +- net/devlink/param.c | 2 +- net/devlink/rate.c | 6 +- net/devlink/region.c | 6 +- net/devlink/resource.c | 2 +- net/devlink/sb.c | 2 +- net/devlink/trap.c | 6 +- net/dsa/dsa.c | 8 +- net/dsa/port.c | 4 +- net/dsa/switch.c | 8 +- net/dsa/tag_8021q.c | 4 +- net/dsa/tag_ksz.c | 4 +- net/dsa/tag_ocelot_8021q.c | 4 +- net/dsa/tag_qca.c | 2 +- net/dsa/tag_sja1105.c | 4 +- net/dsa/user.c | 14 +-- net/ethtool/cmis_cdb.c | 2 +- net/ethtool/common.c | 6 +- net/ethtool/ioctl.c | 4 +- net/ethtool/module.c | 2 +- net/ethtool/mse.c | 4 +- net/ethtool/tsconfig.c | 6 +- net/ethtool/tsinfo.c | 4 +- net/handshake/request.c | 2 +- net/hsr/hsr_framereg.c | 4 +- net/hsr/hsr_slave.c | 2 +- net/ieee802154/nl802154.c | 6 +- net/ipv4/af_inet.c | 4 +- net/ipv4/ah4.c | 2 +- net/ipv4/cipso_ipv4.c | 7 +- net/ipv4/devinet.c | 9 +- net/ipv4/fib_semantics.c | 6 +- net/ipv4/fou_core.c | 2 +- net/ipv4/igmp.c | 8 +- net/ipv4/inet_diag.c | 2 +- net/ipv4/inet_fragment.c | 2 +- net/ipv4/inet_hashtables.c | 2 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/ipconfig.c | 2 +- net/ipv4/ipmr_base.c | 2 +- net/ipv4/metrics.c | 2 +- net/ipv4/nexthop.c | 20 ++-- net/ipv4/route.c | 8 +- net/ipv4/tcp.c | 4 +- net/ipv4/tcp_ao.c | 2 +- net/ipv4/tcp_bpf.c | 6 +- net/ipv4/tcp_cdg.c | 4 +- net/ipv4/tcp_fastopen.c | 6 +- net/ipv4/tcp_input.c | 3 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_metrics.c | 2 +- net/ipv4/udp.c | 6 +- net/ipv4/udp_tunnel_nic.c | 9 +- net/ipv6/addrconf.c | 17 ++-- net/ipv6/addrlabel.c | 2 +- net/ipv6/af_inet6.c | 4 +- net/ipv6/ah6.c | 2 +- net/ipv6/anycast.c | 2 +- net/ipv6/calipso.c | 7 +- net/ipv6/ila/ila_xlat.c | 4 +- net/ipv6/ioam6.c | 8 +- net/ipv6/ip6_fib.c | 18 ++-- net/ipv6/ip6_flowlabel.c | 4 +- net/ipv6/ip6_output.c | 2 +- net/ipv6/ipv6_sockglue.c | 2 +- net/ipv6/mcast.c | 8 +- net/ipv6/route.c | 14 +-- net/ipv6/seg6.c | 8 +- net/ipv6/sit.c | 8 +- net/iucv/af_iucv.c | 2 +- net/iucv/iucv.c | 6 +- net/key/af_key.c | 6 +- net/l2tp/l2tp_core.c | 4 +- net/l2tp/l2tp_debugfs.c | 2 +- net/lapb/lapb_iface.c | 2 +- net/llc/llc_core.c | 2 +- net/mac80211/agg-rx.c | 4 +- net/mac80211/agg-tx.c | 2 +- net/mac80211/cfg.c | 12 +-- net/mac80211/chan.c | 2 +- net/mac80211/led.c | 2 +- net/mac80211/link.c | 2 +- net/mac80211/main.c | 5 +- net/mac80211/mesh.c | 5 +- net/mac80211/mesh_hwmp.c | 2 +- net/mac80211/mesh_pathtbl.c | 2 +- net/mac80211/mlme.c | 2 +- net/mac80211/offchannel.c | 2 +- net/mac80211/parse.c | 4 +- net/mac80211/rate.c | 4 +- net/mac80211/rc80211_minstrel_ht.c | 6 +- net/mac80211/sta_info.c | 8 +- net/mac80211/tests/util.c | 6 +- net/mac80211/tx.c | 6 +- net/mac80211/util.c | 5 +- net/mac802154/cfg.c | 2 +- net/mac802154/llsec.c | 12 +-- net/mac802154/rx.c | 4 +- net/mac802154/scan.c | 2 +- net/mctp/device.c | 2 +- net/mctp/neigh.c | 2 +- net/mctp/route.c | 4 +- net/mctp/test/utils.c | 2 +- net/mpls/af_mpls.c | 6 +- net/mptcp/pm.c | 2 +- net/mptcp/subflow.c | 2 +- net/ncsi/ncsi-manage.c | 8 +- net/netfilter/ipset/ip_set_core.c | 6 +- net/netfilter/ipset/ip_set_hash_gen.h | 5 +- net/netfilter/ipset/ip_set_list_set.c | 2 +- net/netfilter/ipvs/ip_vs_conn.c | 4 +- net/netfilter/ipvs/ip_vs_ctl.c | 8 +- net/netfilter/ipvs/ip_vs_dh.c | 2 +- net/netfilter/ipvs/ip_vs_est.c | 4 +- net/netfilter/ipvs/ip_vs_lblc.c | 4 +- net/netfilter/ipvs/ip_vs_lblcr.c | 6 +- net/netfilter/ipvs/ip_vs_mh.c | 11 +-- net/netfilter/ipvs/ip_vs_proto.c | 2 +- net/netfilter/ipvs/ip_vs_sh.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 9 +- net/netfilter/ipvs/ip_vs_wrr.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 2 +- net/netfilter/nf_bpf_link.c | 2 +- net/netfilter/nf_conncount.c | 2 +- net/netfilter/nf_conntrack_core.c | 4 +- net/netfilter/nf_conntrack_netlink.c | 2 +- net/netfilter/nf_conntrack_proto_gre.c | 2 +- net/netfilter/nf_flow_table_offload.c | 4 +- net/netfilter/nf_flow_table_xdp.c | 4 +- net/netfilter/nf_log.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nf_nat_masquerade.c | 2 +- net/netfilter/nf_tables_api.c | 33 ++++--- net/netfilter/nf_tables_offload.c | 4 +- net/netfilter/nfnetlink.c | 2 +- net/netfilter/nfnetlink_acct.c | 2 +- net/netfilter/nfnetlink_cthelper.c | 11 +-- net/netfilter/nfnetlink_cttimeout.c | 3 +- net/netfilter/nfnetlink_hook.c | 2 +- net/netfilter/nfnetlink_log.c | 2 +- net/netfilter/nfnetlink_osf.c | 2 +- net/netfilter/nfnetlink_queue.c | 2 +- net/netfilter/nft_compat.c | 4 +- net/netfilter/nft_connlimit.c | 4 +- net/netfilter/nft_ct.c | 3 +- net/netfilter/nft_last.c | 4 +- net/netfilter/nft_limit.c | 4 +- net/netfilter/nft_numgen.c | 2 +- net/netfilter/nft_quota.c | 4 +- net/netfilter/nft_set_pipapo.c | 11 +-- net/netfilter/nft_set_rbtree.c | 6 +- net/netfilter/x_tables.c | 6 +- net/netfilter/xt_IDLETIMER.c | 4 +- net/netfilter/xt_LED.c | 2 +- net/netfilter/xt_RATEEST.c | 2 +- net/netfilter/xt_TEE.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/netfilter/xt_limit.c | 2 +- net/netfilter/xt_quota.c | 2 +- net/netfilter/xt_recent.c | 4 +- net/netfilter/xt_statistic.c | 2 +- net/netlabel/netlabel_calipso.c | 2 +- net/netlabel/netlabel_cipso_v4.c | 8 +- net/netlabel/netlabel_domainhash.c | 8 +- net/netlabel/netlabel_kapi.c | 20 ++-- net/netlabel/netlabel_mgmt.c | 10 +- net/netlabel/netlabel_unlabeled.c | 14 ++- net/netlink/af_netlink.c | 2 +- net/netlink/diag.c | 2 +- net/netlink/genetlink.c | 9 +- net/netlink/policy.c | 4 +- net/netrom/af_netrom.c | 2 +- net/nfc/core.c | 4 +- net/nfc/digital_core.c | 8 +- net/nfc/digital_technology.c | 6 +- net/nfc/hci/core.c | 4 +- net/nfc/hci/hcp.c | 2 +- net/nfc/hci/llc.c | 4 +- net/nfc/hci/llc_nop.c | 2 +- net/nfc/hci/llc_shdlc.c | 2 +- net/nfc/llcp_commands.c | 4 +- net/nfc/llcp_core.c | 2 +- net/nfc/nci/core.c | 2 +- net/nfc/nci/hci.c | 2 +- net/nfc/nci/uart.c | 2 +- net/nfc/netlink.c | 8 +- net/openvswitch/conntrack.c | 11 +-- net/openvswitch/datapath.c | 9 +- net/openvswitch/flow_netlink.c | 2 +- net/openvswitch/flow_table.c | 12 +-- net/openvswitch/meter.c | 4 +- net/openvswitch/vport.c | 4 +- net/packet/af_packet.c | 10 +- net/phonet/pn_dev.c | 2 +- net/psample/psample.c | 2 +- net/psp/psp_main.c | 2 +- net/psp/psp_sock.c | 4 +- net/qrtr/af_qrtr.c | 4 +- net/qrtr/ns.c | 6 +- net/qrtr/tun.c | 2 +- net/rds/cong.c | 2 +- net/rds/connection.c | 2 +- net/rds/ib.c | 5 +- net/rds/ib_cm.c | 2 +- net/rds/ib_rdma.c | 6 +- net/rds/info.c | 2 +- net/rds/loop.c | 2 +- net/rds/message.c | 2 +- net/rds/rdma.c | 20 ++-- net/rfkill/core.c | 6 +- net/rfkill/input.c | 2 +- net/rose/af_rose.c | 3 +- net/rose/rose_route.c | 12 +-- net/rxrpc/call_accept.c | 2 +- net/rxrpc/conn_client.c | 2 +- net/rxrpc/conn_object.c | 2 +- net/rxrpc/key.c | 6 +- net/rxrpc/local_object.c | 2 +- net/rxrpc/peer_object.c | 2 +- net/rxrpc/rxgk.c | 4 +- net/rxrpc/rxgk_kdf.c | 2 +- net/rxrpc/rxkad.c | 4 +- net/rxrpc/rxperf.c | 2 +- net/rxrpc/sendmsg.c | 2 +- net/rxrpc/txbuf.c | 2 +- net/sched/act_api.c | 4 +- net/sched/act_connmark.c | 2 +- net/sched/act_csum.c | 2 +- net/sched/act_ct.c | 4 +- net/sched/act_ctinfo.c | 2 +- net/sched/act_gate.c | 2 +- net/sched/act_ife.c | 4 +- net/sched/act_mpls.c | 2 +- net/sched/act_nat.c | 2 +- net/sched/act_pedit.c | 4 +- net/sched/act_police.c | 2 +- net/sched/act_skbedit.c | 2 +- net/sched/act_skbmod.c | 2 +- net/sched/act_vlan.c | 2 +- net/sched/cls_api.c | 16 ++-- net/sched/cls_basic.c | 4 +- net/sched/cls_bpf.c | 4 +- net/sched/cls_cgroup.c | 2 +- net/sched/cls_flow.c | 4 +- net/sched/cls_flower.c | 14 +-- net/sched/cls_fw.c | 6 +- net/sched/cls_matchall.c | 2 +- net/sched/cls_route.c | 6 +- net/sched/cls_u32.c | 17 ++-- net/sched/em_meta.c | 2 +- net/sched/em_text.c | 2 +- net/sched/sch_api.c | 6 +- net/sched/sch_cake.c | 4 +- net/sched/sch_choke.c | 2 +- net/sched/sch_drr.c | 2 +- net/sched/sch_fq_codel.c | 5 +- net/sched/sch_fq_pie.c | 3 +- net/sched/sch_gred.c | 6 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_hhf.c | 6 +- net/sched/sch_htb.c | 8 +- net/sched/sch_mq.c | 4 +- net/sched/sch_mqprio.c | 4 +- net/sched/sch_multiq.c | 2 +- net/sched/sch_netem.c | 2 +- net/sched/sch_qfq.c | 6 +- net/sched/sch_sfq.c | 2 +- net/sched/sch_taprio.c | 11 +-- net/sctp/associola.c | 2 +- net/sctp/auth.c | 6 +- net/sctp/bind_addr.c | 2 +- net/sctp/chunk.c | 2 +- net/sctp/endpointola.c | 2 +- net/sctp/ipv6.c | 4 +- net/sctp/protocol.c | 6 +- net/sctp/socket.c | 2 +- net/sctp/stream.c | 2 +- net/sctp/stream_sched_prio.c | 2 +- net/sctp/transport.c | 2 +- net/shaper/shaper.c | 7 +- net/smc/af_smc.c | 8 +- net/smc/smc_clc.c | 4 +- net/smc/smc_core.c | 8 +- net/smc/smc_ib.c | 2 +- net/smc/smc_ism.c | 9 +- net/smc/smc_llc.c | 8 +- net/smc/smc_pnet.c | 6 +- net/smc/smc_rx.c | 8 +- net/smc/smc_stats.c | 4 +- net/smc/smc_wr.c | 44 ++++----- net/sunrpc/auth.c | 4 +- net/sunrpc/auth_gss/auth_gss.c | 17 ++-- net/sunrpc/auth_gss/gss_krb5_mech.c | 2 +- net/sunrpc/auth_gss/gss_mech_switch.c | 2 +- net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- net/sunrpc/auth_gss/gss_rpc_xdr.c | 4 +- net/sunrpc/auth_gss/svcauth_gss.c | 10 +- net/sunrpc/auth_unix.c | 2 +- net/sunrpc/backchannel_rqst.c | 2 +- net/sunrpc/cache.c | 8 +- net/sunrpc/clnt.c | 4 +- net/sunrpc/rpc_pipe.c | 2 +- net/sunrpc/rpcb_clnt.c | 2 +- net/sunrpc/stats.c | 2 +- net/sunrpc/svc.c | 5 +- net/sunrpc/svcauth_unix.c | 6 +- net/sunrpc/svcsock.c | 5 +- net/sunrpc/sysfs.c | 10 +- net/sunrpc/xdr.c | 2 +- net/sunrpc/xprt.c | 4 +- net/sunrpc/xprtmultipath.c | 2 +- net/sunrpc/xprtrdma/ib_client.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_pcl.c | 2 +- net/sunrpc/xprtrdma/verbs.c | 12 +-- net/switchdev/switchdev.c | 2 +- net/tipc/bcast.c | 2 +- net/tipc/bearer.c | 2 +- net/tipc/crypto.c | 8 +- net/tipc/discover.c | 2 +- net/tipc/group.c | 4 +- net/tipc/link.c | 2 +- net/tipc/monitor.c | 8 +- net/tipc/name_table.c | 10 +- net/tipc/netlink_compat.c | 9 +- net/tipc/node.c | 4 +- net/tipc/socket.c | 2 +- net/tipc/subscr.c | 2 +- net/tipc/topsrv.c | 6 +- net/tipc/udp_media.c | 4 +- net/tls/tls_device.c | 8 +- net/tls/tls_device_fallback.c | 2 +- net/tls/tls_main.c | 2 +- net/tls/tls_sw.c | 4 +- net/unix/af_unix.c | 9 +- net/unix/garbage.c | 6 +- net/vmw_vsock/hyperv_transport.c | 4 +- net/vmw_vsock/virtio_transport.c | 2 +- net/vmw_vsock/virtio_transport_common.c | 2 +- net/vmw_vsock/vmci_transport.c | 6 +- net/wireless/core.c | 7 +- net/wireless/ibss.c | 2 +- net/wireless/nl80211.c | 76 +++++++-------- net/wireless/of.c | 2 +- net/wireless/pmsr.c | 2 +- net/wireless/reg.c | 22 ++--- net/wireless/scan.c | 14 ++- net/wireless/sme.c | 2 +- net/wireless/tests/util.c | 2 +- net/wireless/util.c | 9 +- net/wireless/wext-compat.c | 3 +- net/x25/x25_forward.c | 3 +- net/x25/x25_link.c | 2 +- net/x25/x25_route.c | 2 +- net/xdp/xdp_umem.c | 5 +- net/xdp/xsk_buff_pool.c | 16 ++-- net/xdp/xsk_queue.c | 2 +- net/xfrm/espintcp.c | 2 +- net/xfrm/xfrm_ipcomp.c | 2 +- net/xfrm/xfrm_iptfs.c | 11 ++- net/xfrm/xfrm_policy.c | 6 +- scripts/livepatch/init.c | 2 +- security/apparmor/apparmorfs.c | 2 +- security/apparmor/audit.c | 2 +- security/apparmor/label.c | 4 +- security/apparmor/lib.c | 4 +- security/apparmor/lsm.c | 2 +- security/apparmor/match.c | 2 +- security/apparmor/policy.c | 6 +- security/apparmor/policy_compat.c | 6 +- security/apparmor/policy_ns.c | 2 +- security/apparmor/policy_unpack.c | 19 ++-- security/device_cgroup.c | 2 +- security/integrity/digsig.c | 2 +- security/integrity/evm/evm_main.c | 2 +- security/integrity/evm/evm_secfs.c | 2 +- security/integrity/ima/ima_api.c | 9 +- security/integrity/ima/ima_crypto.c | 5 +- security/integrity/ima/ima_modsig.c | 2 +- security/integrity/ima/ima_mok.c | 2 +- security/integrity/ima/ima_policy.c | 8 +- security/integrity/ima/ima_queue.c | 6 +- security/integrity/ima/ima_queue_keys.c | 2 +- security/integrity/ima/ima_template.c | 13 +-- security/ipe/digest.c | 2 +- security/ipe/hooks.c | 2 +- security/ipe/policy.c | 2 +- security/ipe/policy_parser.c | 6 +- security/keys/key.c | 2 +- security/keys/keyctl.c | 4 +- security/keys/keyring.c | 2 +- security/keys/request_key_auth.c | 2 +- security/keys/trusted-keys/trusted_core.c | 2 +- security/keys/trusted-keys/trusted_pkwm.c | 4 +- security/keys/trusted-keys/trusted_tpm1.c | 7 +- security/landlock/domain.c | 2 +- security/landlock/object.c | 2 +- security/landlock/ruleset.c | 12 +-- security/landlock/tsync.c | 2 +- security/loadpin/loadpin.c | 2 +- security/safesetid/securityfs.c | 6 +- security/selinux/avc.c | 2 +- security/selinux/hooks.c | 4 +- security/selinux/ibpkey.c | 2 +- security/selinux/netif.c | 2 +- security/selinux/netnode.c | 2 +- security/selinux/netport.c | 2 +- security/selinux/selinuxfs.c | 4 +- security/selinux/ss/conditional.c | 23 +++-- security/selinux/ss/hashtab.c | 6 +- security/selinux/ss/policydb.c | 70 +++++++------- security/selinux/ss/services.c | 14 +-- security/selinux/ss/sidtab.c | 2 +- security/selinux/xfrm.c | 4 +- security/smack/smack_access.c | 2 +- security/smack/smack_lsm.c | 10 +- security/smack/smackfs.c | 8 +- security/tomoyo/audit.c | 2 +- security/tomoyo/common.c | 4 +- security/tomoyo/domain.c | 2 +- security/yama/yama_lsm.c | 4 +- sound/ac97/bus.c | 4 +- sound/ac97/snd_ac97_compat.c | 2 +- sound/aoa/codecs/onyx.c | 8 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/codecs/toonie.c | 2 +- sound/aoa/core/gpio-pmf.c | 3 +- sound/aoa/fabrics/layout.c | 2 +- sound/aoa/soundbus/i2sbus/control.c | 2 +- sound/aoa/soundbus/i2sbus/core.c | 2 +- sound/aoa/soundbus/i2sbus/pcm.c | 2 +- sound/core/compress_offload.c | 8 +- sound/core/control.c | 4 +- sound/core/control_compat.c | 10 +- sound/core/control_led.c | 2 +- sound/core/device.c | 2 +- sound/core/hrtimer.c | 2 +- sound/core/hwdep.c | 2 +- sound/core/info.c | 8 +- sound/core/init.c | 4 +- sound/core/jack.c | 4 +- sound/core/memalloc.c | 4 +- sound/core/oss/mixer_oss.c | 32 +++---- sound/core/oss/pcm_oss.c | 18 ++-- sound/core/oss/pcm_plugin.c | 3 +- sound/core/pcm.c | 8 +- sound/core/pcm_compat.c | 2 +- sound/core/pcm_dmaengine.c | 2 +- sound/core/pcm_lib.c | 2 +- sound/core/pcm_memory.c | 2 +- sound/core/pcm_native.c | 8 +- sound/core/rawmidi.c | 8 +- sound/core/seq/oss/seq_oss_init.c | 4 +- sound/core/seq/oss/seq_oss_midi.c | 6 +- sound/core/seq/oss/seq_oss_readq.c | 4 +- sound/core/seq/oss/seq_oss_synth.c | 3 +- sound/core/seq/oss/seq_oss_timer.c | 2 +- sound/core/seq/oss/seq_oss_writeq.c | 2 +- sound/core/seq/seq_compat.c | 2 +- sound/core/seq/seq_dummy.c | 2 +- sound/core/seq/seq_fifo.c | 2 +- sound/core/seq/seq_memory.c | 7 +- sound/core/seq/seq_midi.c | 8 +- sound/core/seq/seq_midi_emul.c | 4 +- sound/core/seq/seq_midi_event.c | 2 +- sound/core/seq/seq_ports.c | 4 +- sound/core/seq/seq_prioq.c | 2 +- sound/core/seq/seq_queue.c | 2 +- sound/core/seq/seq_system.c | 2 +- sound/core/seq/seq_timer.c | 2 +- sound/core/seq/seq_ump_client.c | 10 +- sound/core/seq/seq_virmidi.c | 6 +- sound/core/sound.c | 2 +- sound/core/sound_oss.c | 2 +- sound/core/timer.c | 14 +-- sound/core/ump.c | 8 +- sound/core/vmaster.c | 11 +-- sound/drivers/dummy.c | 4 +- sound/drivers/mpu401/mpu401_uart.c | 2 +- sound/drivers/mts64.c | 2 +- sound/drivers/opl3/opl3_lib.c | 2 +- sound/drivers/opl3/opl3_synth.c | 2 +- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/pcmtest.c | 4 +- sound/drivers/portman2x4.c | 2 +- sound/drivers/vx/vx_pcm.c | 8 +- sound/firewire/amdtp-stream.c | 10 +- sound/firewire/bebob/bebob_proc.c | 2 +- sound/firewire/fireworks/fireworks.c | 2 +- sound/firewire/fireworks/fireworks_proc.c | 2 +- sound/firewire/motu/motu-hwdep.c | 6 +- sound/firewire/packets-buffer.c | 2 +- sound/hda/codecs/analog.c | 2 +- sound/hda/codecs/ca0110.c | 2 +- sound/hda/codecs/ca0132.c | 11 +-- sound/hda/codecs/cirrus/cs420x.c | 2 +- sound/hda/codecs/cirrus/cs421x.c | 2 +- sound/hda/codecs/cirrus/cs8409.c | 2 +- sound/hda/codecs/cm9825.c | 2 +- sound/hda/codecs/cmedia.c | 2 +- sound/hda/codecs/conexant.c | 2 +- sound/hda/codecs/generic.c | 4 +- sound/hda/codecs/hdmi/hdmi.c | 2 +- sound/hda/codecs/hdmi/simplehdmi.c | 2 +- sound/hda/codecs/realtek/realtek.c | 4 +- sound/hda/codecs/senarytech.c | 2 +- sound/hda/codecs/si3054.c | 2 +- sound/hda/codecs/sigmatel.c | 2 +- sound/hda/codecs/via.c | 2 +- sound/hda/common/beep.c | 2 +- sound/hda/common/codec.c | 10 +- sound/hda/common/controller.c | 4 +- sound/hda/common/jack.c | 2 +- sound/hda/common/proc.c | 7 +- sound/hda/core/ext/controller.c | 2 +- sound/hda/core/ext/stream.c | 4 +- sound/hda/core/sysfs.c | 10 +- sound/i2c/cs8427.c | 2 +- sound/i2c/i2c.c | 4 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- sound/i2c/tea6330t.c | 2 +- sound/isa/gus/gus_main.c | 2 +- sound/isa/gus/gus_mem.c | 2 +- sound/isa/gus/gus_mem_proc.c | 4 +- sound/isa/gus/gus_pcm.c | 2 +- sound/isa/sb/emu8000_pcm.c | 2 +- sound/isa/sb/sb16_csp.c | 2 +- sound/isa/wavefront/wavefront_synth.c | 2 +- sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- sound/parisc/harmony.c | 2 +- sound/pci/ac97/ac97_codec.c | 4 +- sound/pci/ac97/ac97_pcm.c | 2 +- sound/pci/ak4531_codec.c | 2 +- sound/pci/als300.c | 6 +- sound/pci/asihpi/asihpi.c | 4 +- sound/pci/asihpi/hpi6000.c | 2 +- sound/pci/asihpi/hpi6205.c | 2 +- sound/pci/asihpi/hpicmn.c | 5 +- sound/pci/asihpi/hpidspcd.c | 2 +- sound/pci/asihpi/hpioctl.c | 4 +- sound/pci/ca0106/ca0106_main.c | 4 +- sound/pci/cmipci.c | 4 +- sound/pci/cs46xx/cs46xx_lib.c | 6 +- sound/pci/cs46xx/dsp_spos.c | 8 +- sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 +- sound/pci/ctxfi/ctamixer.c | 4 +- sound/pci/ctxfi/ctatc.c | 2 +- sound/pci/ctxfi/ctdaio.c | 8 +- sound/pci/ctxfi/cthw20k1.c | 16 ++-- sound/pci/ctxfi/cthw20k2.c | 16 ++-- sound/pci/ctxfi/ctmixer.c | 2 +- sound/pci/ctxfi/ctpcm.c | 4 +- sound/pci/ctxfi/ctsrc.c | 9 +- sound/pci/ctxfi/cttimer.c | 2 +- sound/pci/ctxfi/ctvmem.c | 6 +- sound/pci/echoaudio/echoaudio.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 4 +- sound/pci/emu10k1/emufx.c | 34 ++++--- sound/pci/emu10k1/emupcm.c | 10 +- sound/pci/es1968.c | 8 +- sound/pci/ice1712/ak4xxx.c | 2 +- sound/pci/ice1712/aureon.c | 4 +- sound/pci/ice1712/delta.c | 2 +- sound/pci/ice1712/ews.c | 4 +- sound/pci/ice1712/hoontech.c | 4 +- sound/pci/ice1712/juli.c | 4 +- sound/pci/ice1712/maya44.c | 2 +- sound/pci/ice1712/phase.c | 6 +- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 2 +- sound/pci/ice1712/prodigy_hifi.c | 8 +- sound/pci/ice1712/psc724.c | 2 +- sound/pci/ice1712/quartet.c | 4 +- sound/pci/ice1712/revo.c | 6 +- sound/pci/ice1712/se.c | 2 +- sound/pci/ice1712/wtm.c | 2 +- sound/pci/mixart/mixart.c | 6 +- sound/pci/mixart/mixart_hwdep.c | 6 +- sound/pci/pcxhr/pcxhr.c | 4 +- sound/pci/riptide/riptide.c | 6 +- sound/pci/rme9652/hdspm.c | 4 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/via82xx.c | 5 +- sound/pci/via82xx_modem.c | 5 +- sound/pci/ymfpci/ymfpci_main.c | 4 +- sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 2 +- sound/ppc/awacs.c | 2 +- sound/ppc/beep.c | 2 +- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/tumbler.c | 2 +- sound/sh/aica.c | 4 +- sound/sh/sh_dac_audio.c | 2 +- sound/soc/amd/acp-pcm-dma.c | 2 +- sound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 +- sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 +- sound/soc/amd/ps/ps-pdm-dma.c | 2 +- sound/soc/amd/ps/ps-sdw-dma.c | 2 +- sound/soc/amd/raven/acp3x-pcm-dma.c | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +- sound/soc/atmel/atmel-pcm-pdc.c | 2 +- sound/soc/atmel/mchp-pdmc.c | 2 +- sound/soc/au1x/dma.c | 6 +- sound/soc/bcm/bcm63xx-pcm-whistler.c | 4 +- sound/soc/codecs/aw88395/aw88395_lib.c | 4 +- sound/soc/codecs/cx20442.c | 2 +- sound/soc/codecs/da7219.c | 4 +- sound/soc/codecs/lpass-rx-macro.c | 6 +- sound/soc/codecs/lpass-wsa-macro.c | 8 +- sound/soc/codecs/pcm6240.c | 11 +-- sound/soc/codecs/sigmadsp.c | 5 +- sound/soc/codecs/tas2781-fmwlib.c | 45 ++++----- sound/soc/codecs/tas2783-sdw.c | 4 +- sound/soc/codecs/wcd-clsh-v2.c | 2 +- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- sound/soc/codecs/wm0010.c | 2 +- sound/soc/codecs/wm_adsp.c | 12 +-- sound/soc/fsl/fsl_asrc_m2m.c | 4 +- sound/soc/fsl/fsl_dma.c | 2 +- sound/soc/fsl/fsl_qmc_audio.c | 2 +- sound/soc/fsl/imx-pcm-fiq.c | 2 +- sound/soc/fsl/mpc5200_dma.c | 2 +- sound/soc/fsl/p1022_ds.c | 2 +- sound/soc/fsl/p1022_rdk.c | 2 +- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/audio-graph-card2.c | 2 +- sound/soc/generic/simple-card.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-compress.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- sound/soc/intel/atom/sst/sst.c | 2 +- sound/soc/intel/atom/sst/sst_ipc.c | 2 +- sound/soc/intel/atom/sst/sst_loader.c | 2 +- sound/soc/intel/atom/sst/sst_pvt.c | 2 +- sound/soc/intel/avs/path.c | 8 +- sound/soc/intel/avs/pcm.c | 2 +- sound/soc/intel/avs/utils.c | 6 +- sound/soc/intel/boards/sof_sdw.c | 4 +- sound/soc/intel/catpt/pcm.c | 2 +- sound/soc/loongson/loongson_dma.c | 2 +- sound/soc/mediatek/mt8186/mt8186-audsys-clk.c | 2 +- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 2 +- sound/soc/mediatek/mt8195/mt8195-audsys-clk.c | 2 +- sound/soc/meson/aiu-fifo.c | 2 +- sound/soc/meson/axg-tdm-formatter.c | 2 +- sound/soc/meson/meson-codec-glue.c | 2 +- sound/soc/pxa/pxa-ssp.c | 4 +- sound/soc/qcom/lpass-platform.c | 2 +- sound/soc/qcom/qdsp6/q6adm.c | 2 +- sound/soc/qcom/qdsp6/q6afe.c | 2 +- sound/soc/qcom/qdsp6/q6apm-dai.c | 4 +- sound/soc/qcom/qdsp6/q6apm.c | 6 +- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 +- sound/soc/qcom/qdsp6/q6asm.c | 4 +- sound/soc/qcom/qdsp6/q6core.c | 2 +- sound/soc/qcom/qdsp6/q6routing.c | 2 +- sound/soc/qcom/qdsp6/topology.c | 17 ++-- sound/soc/renesas/siu_dai.c | 2 +- sound/soc/samsung/idma.c | 2 +- sound/soc/sdca/sdca_asoc.c | 2 +- sound/soc/sdca/sdca_function_device.c | 2 +- sound/soc/sdca/sdca_jack.c | 2 +- sound/soc/soc-ac97.c | 2 +- sound/soc/soc-core.c | 2 +- sound/soc/soc-dapm.c | 18 ++-- sound/soc/soc-generic-dmaengine-pcm.c | 2 +- sound/soc/soc-ops-test.c | 2 +- sound/soc/soc-ops.c | 2 +- sound/soc/soc-pcm.c | 2 +- sound/soc/soc-usb.c | 2 +- sound/soc/sof/compress.c | 2 +- sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/cnl.c | 2 +- sound/soc/sof/intel/hda-mlink.c | 2 +- sound/soc/sof/intel/icl.c | 2 +- sound/soc/sof/intel/mtl.c | 2 +- sound/soc/sof/intel/skl.c | 2 +- sound/soc/sof/intel/telemetry.c | 6 +- sound/soc/sof/intel/tgl.c | 2 +- sound/soc/sof/ipc3-dtrace.c | 2 +- sound/soc/sof/ipc3-topology.c | 11 ++- sound/soc/sof/ipc4-pcm.c | 14 +-- sound/soc/sof/ipc4-topology.c | 33 ++++--- sound/soc/sof/sof-client-probes-ipc4.c | 2 +- sound/soc/sof/sof-client.c | 4 +- sound/soc/sof/stream-ipc.c | 2 +- sound/soc/sof/topology.c | 22 ++--- sound/soc/sprd/sprd-pcm-compress.c | 2 +- sound/soc/xilinx/xlnx_formatter_pcm.c | 2 +- sound/sound_core.c | 2 +- sound/synth/emux/emux.c | 6 +- sound/synth/emux/emux_effect.c | 4 +- sound/synth/emux/emux_seq.c | 8 +- sound/synth/emux/soundfont.c | 8 +- sound/synth/util_mem.c | 2 +- sound/usb/6fire/comm.c | 3 +- sound/usb/6fire/control.c | 4 +- sound/usb/6fire/firmware.c | 3 +- sound/usb/6fire/midi.c | 3 +- sound/usb/6fire/pcm.c | 2 +- sound/usb/caiaq/audio.c | 5 +- sound/usb/endpoint.c | 6 +- sound/usb/fcp.c | 6 +- sound/usb/hiface/pcm.c | 2 +- sound/usb/line6/capture.c | 4 +- sound/usb/line6/driver.c | 2 +- sound/usb/line6/midi.c | 2 +- sound/usb/line6/pcm.c | 2 +- sound/usb/line6/playback.c | 4 +- sound/usb/line6/toneport.c | 2 +- sound/usb/media.c | 4 +- sound/usb/midi.c | 6 +- sound/usb/midi2.c | 6 +- sound/usb/misc/ua101.c | 2 +- sound/usb/mixer.c | 18 ++-- sound/usb/mixer_quirks.c | 13 +-- sound/usb/mixer_s1810c.c | 4 +- sound/usb/mixer_scarlett.c | 2 +- sound/usb/mixer_scarlett2.c | 4 +- sound/usb/mixer_us16x08.c | 8 +- sound/usb/power.c | 2 +- sound/usb/qcom/qc_audio_offload.c | 16 ++-- sound/usb/quirks.c | 6 +- sound/usb/stream.c | 12 +-- sound/usb/usx2y/usbusx2yaudio.c | 9 +- sound/virtio/virtio_card.c | 3 +- sound/virtio/virtio_jack.c | 2 +- sound/virtio/virtio_pcm.c | 2 +- sound/virtio/virtio_pcm_msg.c | 4 +- sound/x86/intel_hdmi_audio.c | 2 +- sound/xen/xen_snd_front_alsa.c | 4 +- sound/xen/xen_snd_front_evtchnl.c | 5 +- virt/kvm/coalesced_mmio.c | 3 +- virt/kvm/eventfd.c | 7 +- virt/kvm/guest_memfd.c | 2 +- virt/kvm/irqchip.c | 6 +- virt/kvm/kvm_main.c | 34 +++---- virt/kvm/vfio.c | 4 +- 8016 files changed, 20055 insertions(+), 20913 deletions(-) (limited to 'scripts/livepatch') diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index d38f4d6759e4..b5b547732398 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c @@ -861,7 +861,7 @@ marvel_agp_setup(alpha_agp_info *agp) if (!alpha_agpgart_size) return -ENOMEM; - aper = kmalloc(sizeof(*aper), GFP_KERNEL); + aper = kmalloc_obj(*aper, GFP_KERNEL); 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(sizeof(*agp), GFP_KERNEL); + agp = kmalloc_obj(*agp, GFP_KERNEL); if (!agp) return NULL; diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c index 77f5d68ed04b..ddaef7b75ba7 100644 --- a/arch/alpha/kernel/core_titan.c +++ b/arch/alpha/kernel/core_titan.c @@ -594,7 +594,7 @@ titan_agp_setup(alpha_agp_info *agp) if (!alpha_agpgart_size) return -ENOMEM; - aper = kmalloc(sizeof(struct titan_agp_aperture), GFP_KERNEL); + aper = kmalloc_obj(struct titan_agp_aperture, GFP_KERNEL); if (aper == NULL) return -ENOMEM; @@ -760,7 +760,7 @@ titan_agp_info(void) /* * Allocate the info structure. */ - agp = kmalloc(sizeof(*agp), GFP_KERNEL); + agp = kmalloc_obj(*agp, GFP_KERNEL); if (!agp) return NULL; diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index cbefa5a77384..6fbc2d179e93 100644 --- a/arch/alpha/kernel/module.c +++ b/arch/alpha/kernel/module.c @@ -46,7 +46,7 @@ process_reloc_for_got(Elf64_Rela *rela, goto found_entry; } - g = kmalloc (sizeof (*g), GFP_KERNEL); + g = kmalloc_obj(*g, GFP_KERNEL); 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 = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL); + chains = kzalloc_objs(struct got_entry, nsyms, GFP_KERNEL); if (!chains) { printk(KERN_ERR "module %s: no memory for symbol chain buffer\n", diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 8e9b4ac86b7e..93eb07018e6b 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -220,7 +220,7 @@ static void pdev_save_srm_config(struct pci_dev *dev) printed = 1; } - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kmalloc_obj(*tmp, GFP_KERNEL); if (!tmp) { printk(KERN_ERR "%s: kmalloc() failed!\n", __func__); return; diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index f0af444a69a4..ea4e7243c0e9 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -392,7 +392,7 @@ register_cpus(void) int i; for_each_possible_cpu(i) { - struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct cpu *p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; register_cpu(p, i); diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 789cfb9ea14e..dcdc8bd916db 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -366,7 +366,7 @@ void *unwind_add_table(struct module *module, const void *table_start, if (table_size <= 0) return NULL; - table = kmalloc(sizeof(*table), GFP_KERNEL); + table = kmalloc_obj(*table, GFP_KERNEL); if (!table) return NULL; diff --git a/arch/arc/net/bpf_jit_core.c b/arch/arc/net/bpf_jit_core.c index e3628922c24a..5695da795536 100644 --- a/arch/arc/net/bpf_jit_core.c +++ b/arch/arc/net/bpf_jit_core.c @@ -1140,7 +1140,7 @@ static int jit_prepare_final_mem_alloc(struct jit_context *ctx) } if (ctx->need_extra_pass) { - ctx->jit_data = kzalloc(sizeof(*ctx->jit_data), GFP_KERNEL); + ctx->jit_data = kzalloc_obj(*ctx->jit_data, GFP_KERNEL); if (!ctx->jit_data) return -ENOMEM; } diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index cb6ef449b987..4820b1094dfa 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -222,7 +222,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) struct locomo_dev *dev; int ret; - dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL); + dev = kzalloc_obj(struct locomo_dev, GFP_KERNEL); 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(sizeof(struct locomo_save_data), GFP_KERNEL); + save = kmalloc_obj(struct locomo_save_data, GFP_KERNEL); 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(sizeof(struct locomo), GFP_KERNEL); + lchip = kzalloc_obj(struct locomo, GFP_KERNEL); if (!lchip) return -ENOMEM; diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 04ff75dcc20e..8bd217789439 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -737,7 +737,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, unsigned i; int ret; - dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL); + dev = kzalloc_obj(struct sa1111_dev, GFP_KERNEL); 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(sizeof(struct sa1111_save_data), GFP_KERNEL); + save = kmalloc_obj(struct sa1111_save_data, GFP_KERNEL); if (!save) return -ENOMEM; sachip->saved_state = save; diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index dddb73c96826..10e8e9716bd3 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -185,7 +185,7 @@ static int scoop_probe(struct platform_device *pdev) if (!mem) return -EINVAL; - devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL); + devptr = kzalloc_obj(struct scoop_dev, GFP_KERNEL); if (!devptr) return -ENOMEM; diff --git a/arch/arm/kernel/atags_proc.c b/arch/arm/kernel/atags_proc.c index cd09f8ab93e3..6106385d25a0 100644 --- a/arch/arm/kernel/atags_proc.c +++ b/arch/arm/kernel/atags_proc.c @@ -54,7 +54,7 @@ static int __init init_atags_procfs(void) WARN_ON(tag->hdr.tag != ATAG_NONE); - b = kmalloc(struct_size(b, data, size), GFP_KERNEL); + b = kmalloc_flex(*b, data, size, GFP_KERNEL); if (!b) goto nomem; diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 50999886a8b5..504f22b420a8 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -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(sizeof(*cpu_vtable[cpu]), GFP_KERNEL); + cpu_vtable[cpu] = kzalloc_obj(*cpu_vtable[cpu], GFP_KERNEL); return cpu_vtable[cpu] ? 0 : -ENOMEM; } diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index 2944721e82a2..fe73d759d078 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c @@ -349,7 +349,7 @@ asmlinkage long sys_oabi_semtimedop(int semid, return -E2BIG; if (nsops < 1 || nsops > SEMOPM) return -EINVAL; - sops = kvmalloc_array(nsops, sizeof(*sops), GFP_KERNEL); + sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL); if (!sops) return -ENOMEM; err = 0; diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index f60547dadc93..2b40c22234a9 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -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(sizeof(*tab), GFP_KERNEL); + struct unwind_table *tab = kmalloc_obj(*tab, GFP_KERNEL); pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size, text_addr, text_size); diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index 0108f33d6bed..884f1899dfba 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -179,8 +179,7 @@ static int __init vdso_init(void) text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; /* Allocate the VDSO text pagelist */ - vdso_text_pagelist = kcalloc(text_pages, sizeof(struct page *), - GFP_KERNEL); + vdso_text_pagelist = kzalloc_objs(struct page *, text_pages, GFP_KERNEL); if (vdso_text_pagelist == NULL) return -ENOMEM; diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 6521ab3d24fa..765a97a30b8a 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -262,7 +262,7 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys) { struct resource *res; - res = kcalloc(2, sizeof(struct resource), GFP_KERNEL); + res = kzalloc_objs(struct resource, 2, GFP_KERNEL); if (!res) { printk("out of memory for root bus resources"); return 0; diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c index 21cf9a358b90..d75fc4b541f1 100644 --- a/arch/arm/mach-footbridge/ebsa285.c +++ b/arch/arm/mach-footbridge/ebsa285.c @@ -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(sizeof(*led), GFP_KERNEL); + led = kzalloc_obj(*led, GFP_KERNEL); if (!led) break; diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c index 5f7265b1b34c..ae5cf7f1f74a 100644 --- a/arch/arm/mach-footbridge/netwinder-hw.c +++ b/arch/arm/mach-footbridge/netwinder-hw.c @@ -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(sizeof(*led), GFP_KERNEL); + led = kzalloc_obj(*led, GFP_KERNEL); if (!led) break; diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 94e4f4a2f73f..d1d1ef3aa927 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -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(sizeof(*pmu_mmdc), GFP_KERNEL); + pmu_mmdc = kzalloc_obj(*pmu_mmdc, GFP_KERNEL); if (!pmu_mmdc) { pr_err("failed to allocate PMU device!\n"); return -ENOMEM; diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index 04ad651d13a0..f7f142d6e49e 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -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(sizeof(*new_compat), GFP_KERNEL); + new_compat = kzalloc_obj(*new_compat, GFP_KERNEL); new_compat->name = kstrdup("compatible", GFP_KERNEL); new_compat->length = sizeof("marvell,mv78230-a0-i2c"); diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index a6b621ff0b87..4af0df12f654 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -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(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); p->name = kstrdup("arm,io-coherent", GFP_KERNEL); of_add_property(cache_dn, p); } diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index f436c7b8c7ae..ea4159a5b567 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c @@ -154,7 +154,7 @@ static int __init mvebu_soc_device(void) if (!is_id_valid) return 0; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 6e017fa306c8..24dd8a0c6567 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -387,7 +387,7 @@ static void __init mxs_machine_init(void) const u32 *ocotp = mxs_get_ocotp(); int ret; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return; diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 756966cb715f..491254010c0c 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -319,7 +319,7 @@ static int __init omap1_system_dma_init(void) goto exit_iounmap; } - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { ret = -ENOMEM; goto exit_iounmap; diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index 37863bdce9ea..a4dae1baae99 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c @@ -294,8 +294,8 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, { int i; - omap_mcbsp_devices = kcalloc(size, sizeof(struct platform_device *), - GFP_KERNEL); + omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size, + GFP_KERNEL); if (!omap_mcbsp_devices) { printk(KERN_ERR "Could not register McBSP devices\n"); return; diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c index 81a912c1145a..09dab51d5728 100644 --- a/arch/arm/mach-omap1/timer.c +++ b/arch/arm/mach-omap1/timer.c @@ -125,7 +125,7 @@ static int __init omap1_dm_timer_init(void) goto err_free_pdev; } - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) { ret = -ENOMEM; goto err_free_pdata; diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 96c5cdc718c8..0b9d4c7b6711 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -237,7 +237,7 @@ void omap2xxx_clkt_vps_init(void) omap2xxx_clkt_vps_late_init(); omap2xxx_clkt_vps_check_bootloader_rates(); - hw = kzalloc(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) return; init.name = "virt_prcm_set"; diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 7f387706368a..fd9e4146db35 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return; diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index 9c8a85198e16..debc3f0d0184 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c @@ -99,7 +99,7 @@ static struct powerdomain *_get_pwrdm(struct device *dev) return NULL; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (entry) { entry->dev = dev; entry->pwrdm = pwrdm; diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 800980057373..ab8adccbd7dd 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -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 = kcalloc(oh_cnt, sizeof(struct omap_hwmod *), GFP_KERNEL); + hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt, GFP_KERNEL); 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(sizeof(struct omap_device), GFP_KERNEL); + od = kzalloc_obj(struct omap_device, GFP_KERNEL); if (!od) goto oda_exit1; diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 111677878d9c..3591ca1f59c6 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -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(sizeof(*sysc), GFP_KERNEL); + sysc = kzalloc_obj(*sysc, GFP_KERNEL); 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(sizeof(*oi), GFP_KERNEL); + oi = kzalloc_obj(*oi, GFP_KERNEL); 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(sizeof(*oh), GFP_KERNEL); + oh = kzalloc_obj(*oh, GFP_KERNEL); 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(sizeof(*oh->class), GFP_KERNEL); + oh->class = kzalloc_obj(*oh->class, GFP_KERNEL); if (!oh->class) { kfree(oh); return -ENOMEM; diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c index 4abb86dc98fd..e3f47fb2d4ef 100644 --- a/arch/arm/mach-omap2/pm33xx-core.c +++ b/arch/arm/mach-omap2/pm33xx-core.c @@ -410,7 +410,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu) state_count++; } - idle_states = kcalloc(state_count, sizeof(*idle_states), GFP_KERNEL); + idle_states = kzalloc_objs(*idle_states, state_count, GFP_KERNEL); if (!idle_states) return -ENOMEM; diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 68975771e633..9992549c7336 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -410,7 +410,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (!pwrdm->pwrsts) return 0; - pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); + pwrst = kmalloc_obj(struct power_state, GFP_ATOMIC); if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 37b168119fe4..554352e9e1c6 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -132,7 +132,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) !strncmp(pwrdm->name, "l4per", 5)) pwrdm_set_logic_retst(pwrdm, PWRDM_POWER_OFF); - pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); + pwrst = kmalloc_obj(struct power_state, GFP_ATOMIC); if (!pwrst) return -ENOMEM; diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index d2133423b0c9..9d1a14771590 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -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 = kcalloc(count, sizeof(*nvalue_table), GFP_KERNEL); + nvalue_table = kzalloc_objs(*nvalue_table, count, GFP_KERNEL); if (!nvalue_table) return; diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 3313bc5a63ea..2ee1ff7335db 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -169,7 +169,7 @@ static int __init pcie_setup(struct pci_sys_data *sys) /* * Request resources. */ - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); 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(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); if (!res) panic("pci_setup unable to alloc resources"); diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index 2cde4c83b7f9..9f0edac1697c 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c @@ -692,7 +692,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) unsigned long base; int i; - ec = kzalloc(sizeof(ecard_t), GFP_KERNEL); + ec = kzalloc_obj(ecard_t, GFP_KERNEL); if (!ec) { ec = ERR_PTR(-ENOMEM); goto nomem; diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index e8691921c69a..e4c7a0b78783 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -107,7 +107,7 @@ int __init sa11xx_clk_init(void) clk_hw_register_clkdev(hw, "OSTIMER0", NULL); - hw = kzalloc(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); 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(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) return -ENOMEM; hw->init = &clk_gpio27_init_data; diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 5383a26f5116..078667b52b8a 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -321,7 +321,7 @@ int __init sa11x0_register_fixed_regulator(int n, { struct regulator_init_data *id; - cfg->init_data = id = kzalloc(sizeof(*cfg->init_data), GFP_KERNEL); + cfg->init_data = id = kzalloc_obj(*cfg->init_data, GFP_KERNEL); if (!cfg->init_data) return -ENOMEM; diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 88fe79f0a4ed..f8960373fa06 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -276,7 +276,7 @@ static int neponset_probe(struct platform_device *dev) goto err_alloc; } - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { ret = -ENOMEM; goto err_alloc; diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c index 117e7b07995b..c6659131f21b 100644 --- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c @@ -164,7 +164,7 @@ static int __init rcar_gen2_regulator_quirk(void) if (ret) /* Skip invalid entry and continue */ continue; - quirk = kzalloc(sizeof(*quirk), GFP_KERNEL); + quirk = kzalloc_obj(*quirk, GFP_KERNEL); if (!quirk) { ret = -ENOMEM; of_node_put(np); diff --git a/arch/arm/mach-versatile/spc.c b/arch/arm/mach-versatile/spc.c index 2d27777a00d3..d77ed8ce5f32 100644 --- a/arch/arm/mach-versatile/spc.c +++ b/arch/arm/mach-versatile/spc.c @@ -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 = kcalloc(MAX_OPPS, sizeof(*opps), GFP_KERNEL); + opps = kzalloc_objs(*opps, MAX_OPPS, GFP_KERNEL); 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(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); 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(sizeof(*spc), GFP_KERNEL); + spc = kzalloc_obj(*spc, GFP_KERNEL); if (!spc) return ERR_PTR(-ENOMEM); diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c index f0c80d4663ca..53d02ce2ad43 100644 --- a/arch/arm/mach-versatile/versatile.c +++ b/arch/arm/mach-versatile/versatile.c @@ -142,7 +142,7 @@ static void __init versatile_dt_pci_init(void) goto out_put_node; } - newprop = kzalloc(sizeof(*newprop), GFP_KERNEL); + newprop = kzalloc_obj(*newprop, GFP_KERNEL); if (!newprop) goto out_put_node; diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 15e8a321a713..ddb06d5ca55d 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -108,7 +108,7 @@ static void __init zynq_init_machine(void) struct soc_device *soc_dev; struct device *parent = NULL; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) goto out; diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 93ef0502b7ff..3d62bd48086b 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -507,7 +507,7 @@ static __init int l2x0_pmu_init(void) if (!l2x0_base) return 0; - l2x0_pmu = kzalloc(sizeof(*l2x0_pmu), GFP_KERNEL); + l2x0_pmu = kzalloc_obj(*l2x0_pmu, GFP_KERNEL); if (!l2x0_pmu) { pr_warn("Unable to allocate L2x0 PMU\n"); return -ENOMEM; diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c index 84a2f17ff32d..c601532f7a77 100644 --- a/arch/arm/mm/cache-uniphier.c +++ b/arch/arm/mm/cache-uniphier.c @@ -342,7 +342,7 @@ static int __init __uniphier_cache_init(struct device_node *np, return -EINVAL; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index a4c765d24692..7aca3e747ad5 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -558,8 +558,8 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, } #endif - buf = kzalloc(sizeof(*buf), - gfp & ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM)); + buf = kzalloc_obj(*buf, + gfp & ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM)); if (!buf) return NULL; @@ -1504,7 +1504,7 @@ arm_iommu_create_mapping(struct device *dev, dma_addr_t base, u64 size) bitmap_size = PAGE_SIZE; } - mapping = kzalloc(sizeof(struct dma_iommu_mapping), GFP_KERNEL); + mapping = kzalloc_obj(struct dma_iommu_mapping, GFP_KERNEL); if (!mapping) goto err; diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index 4eb81b7ed03a..447945836c3f 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c @@ -17,7 +17,7 @@ #include "mm.h" #ifdef CONFIG_ARM_LPAE -#define _pgd_alloc(mm) kmalloc_array(PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL | __GFP_ZERO) +#define _pgd_alloc(mm) kmalloc_objs(pgd_t, PTRS_PER_PGD, GFP_KERNEL | __GFP_ZERO) #define _pgd_free(mm, pgd) kfree(pgd) #else #define _pgd_alloc(mm) __pgd_alloc(mm, 2) diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c index 171c7076b89f..ef93f2f1db62 100644 --- a/arch/arm/probes/kprobes/test-core.c +++ b/arch/arm/probes/kprobes/test-core.c @@ -763,9 +763,8 @@ static int coverage_start_fn(const struct decode_header *h, void *args) static int coverage_start(const union decode_item *table) { - coverage.base = kmalloc_array(MAX_COVERAGE_ENTRIES, - sizeof(struct coverage_entry), - GFP_KERNEL); + coverage.base = kmalloc_objs(struct coverage_entry, + MAX_COVERAGE_ENTRIES, GFP_KERNEL); coverage.num_entries = 0; coverage.nesting = 0; return table_iter(table, coverage_start_fn, &coverage); diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 8655bc3d3634..9c3e6145b810 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -339,7 +339,7 @@ int __init arch_xen_unpopulated_init(struct resource **res) return -EINVAL; } - regs = kcalloc(nr_reg, sizeof(*regs), GFP_KERNEL); + regs = kzalloc_objs(*regs, nr_reg, GFP_KERNEL); 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(sizeof(*tmp_res), GFP_KERNEL); + tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL); if (!tmp_res) { rc = -ENOMEM; goto err; diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c index 9da57a5b81c7..d911d91d5832 100644 --- a/arch/arm/xen/p2m.c +++ b/arch/arm/xen/p2m.c @@ -176,7 +176,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn, return true; } - p2m_entry = kzalloc(sizeof(*p2m_entry), GFP_NOWAIT); + p2m_entry = kzalloc_obj(*p2m_entry, GFP_NOWAIT); if (!p2m_entry) return false; diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c index 410060ebd86d..9038d46dacf5 100644 --- a/arch/arm64/kernel/machine_kexec_file.c +++ b/arch/arm64/kernel/machine_kexec_file.c @@ -52,7 +52,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) for_each_mem_range(i, &start, &end) nr_ranges++; - cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL); + cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL); if (!cmem) return -ENOMEM; diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index 78ddf6bdecad..34d761ef08b0 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -81,9 +81,8 @@ static int __init __vdso_init(enum vdso_abi abi) vdso_info[abi].vdso_code_start) >> PAGE_SHIFT; - vdso_pagelist = kcalloc(vdso_info[abi].vdso_pages, - sizeof(struct page *), - GFP_KERNEL); + vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages, + GFP_KERNEL); if (vdso_pagelist == NULL) return -ENOMEM; diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 94d5b0b99fd1..29f0326f7e00 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -854,8 +854,8 @@ static void kvm_init_mpidr_data(struct kvm *kvm) * iterative method. Single vcpu VMs do not need this either. */ if (struct_size(data, cmpidr_to_idx, nr_entries) <= PAGE_SIZE) - data = kzalloc(struct_size(data, cmpidr_to_idx, nr_entries), - GFP_KERNEL_ACCOUNT); + data = kzalloc_flex(*data, cmpidr_to_idx, nr_entries, + GFP_KERNEL_ACCOUNT); if (!data) goto out; diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 8c5d259810b2..f6d8b294525d 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -487,7 +487,7 @@ static int share_pfn_hyp(u64 pfn) goto unlock; } - this = kzalloc(sizeof(*this), GFP_KERNEL); + this = kzalloc_obj(*this, GFP_KERNEL); if (!this) { ret = -ENOMEM; goto unlock; @@ -978,7 +978,7 @@ int kvm_init_stage2_mmu(struct kvm *kvm, struct kvm_s2_mmu *mmu, unsigned long t if (err) return err; - pgt = kzalloc(sizeof(*pgt), GFP_KERNEL_ACCOUNT); + pgt = kzalloc_obj(*pgt, GFP_KERNEL_ACCOUNT); if (!pgt) return -ENOMEM; @@ -1155,7 +1155,8 @@ int topup_hyp_memcache(struct kvm_hyp_memcache *mc, unsigned long min_pages) return 0; if (!mc->mapping) { - mc->mapping = kzalloc(sizeof(struct pkvm_mapping), GFP_KERNEL_ACCOUNT); + mc->mapping = kzalloc_obj(struct pkvm_mapping, + GFP_KERNEL_ACCOUNT); if (!mc->mapping) return -ENOMEM; } @@ -2328,7 +2329,7 @@ int __init kvm_mmu_init(u32 hyp_va_bits) goto out; } - hyp_pgtable = kzalloc(sizeof(*hyp_pgtable), GFP_KERNEL); + hyp_pgtable = kzalloc_obj(*hyp_pgtable, GFP_KERNEL); if (!hyp_pgtable) { kvm_err("Hyp mode page-table not allocated\n"); err = -ENOMEM; diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index eeea5e692370..620126d1f0dc 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -1215,8 +1215,8 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu) if (!kvm_has_feat(vcpu->kvm, ID_AA64MMFR4_EL1, NV_frac, NV2_ONLY)) return 0; - vcpu->arch.vncr_tlb = kzalloc(sizeof(*vcpu->arch.vncr_tlb), - GFP_KERNEL_ACCOUNT); + vcpu->arch.vncr_tlb = kzalloc_obj(*vcpu->arch.vncr_tlb, + GFP_KERNEL_ACCOUNT); if (!vcpu->arch.vncr_tlb) return -ENOMEM; @@ -1704,8 +1704,8 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu) if (kvm->arch.sysreg_masks) goto out; - kvm->arch.sysreg_masks = kzalloc(sizeof(*(kvm->arch.sysreg_masks)), - GFP_KERNEL_ACCOUNT); + kvm->arch.sysreg_masks = kzalloc_obj(*(kvm->arch.sysreg_masks), + GFP_KERNEL_ACCOUNT); if (!kvm->arch.sysreg_masks) return -ENOMEM; diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index b03dbda7f1ab..3a7b6e78a949 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -797,7 +797,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu) guard(mutex)(&arm_pmus_lock); - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return; diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c index 6cbe018fd6fd..6a8836207a79 100644 --- a/arch/arm64/kvm/ptdump.c +++ b/arch/arm64/kvm/ptdump.c @@ -119,7 +119,7 @@ static struct kvm_ptdump_guest_state *kvm_ptdump_parser_create(struct kvm *kvm) struct kvm_pgtable *pgtable = mmu->pgt; int ret; - st = kzalloc(sizeof(struct kvm_ptdump_guest_state), GFP_KERNEL_ACCOUNT); + st = kzalloc_obj(struct kvm_ptdump_guest_state, GFP_KERNEL_ACCOUNT); if (!st) return ERR_PTR(-ENOMEM); diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index 2c6776a1779b..fa1de8784617 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -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(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); 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(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return ERR_PTR(-ENOMEM); diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index a53f93546aa0..6eb273100ade 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -199,7 +199,7 @@ static int kvm_vgic_dist_init(struct kvm *kvm, unsigned int nr_spis) int i; dist->active_spis = (atomic_t)ATOMIC_INIT(0); - dist->spis = kcalloc(nr_spis, sizeof(struct vgic_irq), GFP_KERNEL_ACCOUNT); + dist->spis = kzalloc_objs(struct vgic_irq, nr_spis, GFP_KERNEL_ACCOUNT); if (!dist->spis) return -ENOMEM; @@ -269,9 +269,9 @@ static int vgic_allocate_private_irqs_locked(struct kvm_vcpu *vcpu, u32 type) if (vgic_cpu->private_irqs) return 0; - vgic_cpu->private_irqs = kcalloc(VGIC_NR_PRIVATE_IRQS, - sizeof(struct vgic_irq), - GFP_KERNEL_ACCOUNT); + vgic_cpu->private_irqs = kzalloc_objs(struct vgic_irq, + VGIC_NR_PRIVATE_IRQS, + GFP_KERNEL_ACCOUNT); if (!vgic_cpu->private_irqs) return -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(sizeof(*gic_kvm_info), GFP_KERNEL); + gic_kvm_info = kmalloc_obj(*gic_kvm_info, GFP_KERNEL); if (gic_kvm_info) *gic_kvm_info = *info; } diff --git a/arch/arm64/kvm/vgic/vgic-irqfd.c b/arch/arm64/kvm/vgic/vgic-irqfd.c index c314c016659a..b9b86e3a6c86 100644 --- a/arch/arm64/kvm/vgic/vgic-irqfd.c +++ b/arch/arm64/kvm/vgic/vgic-irqfd.c @@ -140,7 +140,7 @@ int kvm_vgic_setup_default_irq_routing(struct kvm *kvm) u32 nr = dist->nr_spis; int i, ret; - entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL_ACCOUNT); + entries = kzalloc_objs(*entries, nr, GFP_KERNEL_ACCOUNT); if (!entries) return -ENOMEM; diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index 3f1c4b10fed9..2ea9f1c7ebcd 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -85,7 +85,7 @@ static struct vgic_irq *vgic_add_lpi(struct kvm *kvm, u32 intid, if (irq) return irq; - irq = kzalloc(sizeof(struct vgic_irq), GFP_KERNEL_ACCOUNT); + irq = kzalloc_obj(struct vgic_irq, GFP_KERNEL_ACCOUNT); if (!irq) return ERR_PTR(-ENOMEM); @@ -960,7 +960,7 @@ static int vgic_its_alloc_collection(struct vgic_its *its, { struct its_collection *collection; - collection = kzalloc(sizeof(*collection), GFP_KERNEL_ACCOUNT); + collection = kzalloc_obj(*collection, GFP_KERNEL_ACCOUNT); if (!collection) return -ENOMEM; @@ -1004,7 +1004,7 @@ static struct its_ite *vgic_its_alloc_ite(struct its_device *device, { struct its_ite *ite; - ite = kzalloc(sizeof(*ite), GFP_KERNEL_ACCOUNT); + ite = kzalloc_obj(*ite, GFP_KERNEL_ACCOUNT); if (!ite) return ERR_PTR(-ENOMEM); @@ -1131,7 +1131,7 @@ static struct its_device *vgic_its_alloc_device(struct vgic_its *its, { struct its_device *device; - device = kzalloc(sizeof(*device), GFP_KERNEL_ACCOUNT); + device = kzalloc_obj(*device, GFP_KERNEL_ACCOUNT); if (!device) return ERR_PTR(-ENOMEM); @@ -1846,7 +1846,7 @@ static int vgic_its_create(struct kvm_device *dev, u32 type) if (type != KVM_DEV_TYPE_ARM_VGIC_ITS) return -ENODEV; - its = kzalloc(sizeof(struct vgic_its), GFP_KERNEL_ACCOUNT); + its = kzalloc_obj(struct vgic_its, GFP_KERNEL_ACCOUNT); if (!its) return -ENOMEM; diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c index 70d50c77e5dc..89edb84d1ac6 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c @@ -929,7 +929,7 @@ static int vgic_v3_alloc_redist_region(struct kvm *kvm, uint32_t index, if (vgic_v3_rdist_overlap(kvm, base, size)) return -EINVAL; - rdreg = kzalloc(sizeof(*rdreg), GFP_KERNEL_ACCOUNT); + rdreg = kzalloc_obj(*rdreg, GFP_KERNEL_ACCOUNT); if (!rdreg) return -ENOMEM; diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c index 09c3e9eb23f8..ed236f083f0d 100644 --- a/arch/arm64/kvm/vgic/vgic-v4.c +++ b/arch/arm64/kvm/vgic/vgic-v4.c @@ -256,8 +256,8 @@ int vgic_v4_init(struct kvm *kvm) nr_vcpus = atomic_read(&kvm->online_vcpus); - dist->its_vm.vpes = kcalloc(nr_vcpus, sizeof(*dist->its_vm.vpes), - GFP_KERNEL_ACCOUNT); + dist->its_vm.vpes = kzalloc_objs(*dist->its_vm.vpes, nr_vcpus, + GFP_KERNEL_ACCOUNT); if (!dist->its_vm.vpes) return -ENOMEM; diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7a530ea4f5ae..da036853ee8a 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -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(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); 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 = kvcalloc(prog->len + 1, sizeof(int), GFP_KERNEL); + ctx.offset = kvzalloc_objs(int, prog->len + 1, GFP_KERNEL); if (ctx.offset == NULL) { prog = orig_prog; goto out_off; diff --git a/arch/csky/kernel/vdso.c b/arch/csky/kernel/vdso.c index c54d019d66bc..0f49ce6919e6 100644 --- a/arch/csky/kernel/vdso.c +++ b/arch/csky/kernel/vdso.c @@ -20,7 +20,7 @@ static int __init vdso_init(void) vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; vdso_pagelist = - kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL); + kzalloc_objs(struct page *, vdso_pages, GFP_KERNEL); if (unlikely(vdso_pagelist == NULL)) { pr_err("vdso: pagelist allocation failed\n"); return -ENOMEM; diff --git a/arch/loongarch/kernel/machine_kexec_file.c b/arch/loongarch/kernel/machine_kexec_file.c index fb57026f5f25..602fe9105381 100644 --- a/arch/loongarch/kernel/machine_kexec_file.c +++ b/arch/loongarch/kernel/machine_kexec_file.c @@ -68,7 +68,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) for_each_mem_range(i, &start, &end) nr_ranges++; - cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL); + cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL); if (!cmem) return -ENOMEM; diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index 50a12c518dee..839b23edee87 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -470,7 +470,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode, unsigned long vaddr; struct logic_pio_hwaddr *range; - range = kzalloc(sizeof(*range), GFP_ATOMIC); + range = kzalloc_obj(*range, GFP_ATOMIC); if (!range) return -ENOMEM; diff --git a/arch/loongarch/kernel/vdso.c b/arch/loongarch/kernel/vdso.c index dee1a15d7f4c..222be8fc4aec 100644 --- a/arch/loongarch/kernel/vdso.c +++ b/arch/loongarch/kernel/vdso.c @@ -52,7 +52,8 @@ static int __init init_vdso(void) vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start); vdso_info.code_mapping.pages = - kcalloc(vdso_info.size / PAGE_SIZE, sizeof(struct page *), GFP_KERNEL); + kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE, + GFP_KERNEL); if (!vdso_info.code_mapping.pages) return -ENOMEM; diff --git a/arch/loongarch/kvm/intc/eiointc.c b/arch/loongarch/kvm/intc/eiointc.c index e498a3f1e136..fe4173b4a102 100644 --- a/arch/loongarch/kvm/intc/eiointc.c +++ b/arch/loongarch/kvm/intc/eiointc.c @@ -622,7 +622,7 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type) if (kvm->arch.eiointc) return -EINVAL; - s = kzalloc(sizeof(struct loongarch_eiointc), GFP_KERNEL); + s = kzalloc_obj(struct loongarch_eiointc, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/arch/loongarch/kvm/intc/ipi.c b/arch/loongarch/kvm/intc/ipi.c index 6a044a74c095..6e87cefbb3e2 100644 --- a/arch/loongarch/kvm/intc/ipi.c +++ b/arch/loongarch/kvm/intc/ipi.c @@ -409,7 +409,7 @@ static int kvm_ipi_create(struct kvm_device *dev, u32 type) return -EINVAL; } - s = kzalloc(sizeof(struct loongarch_ipi), GFP_KERNEL); + s = kzalloc_obj(struct loongarch_ipi, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c index a175f52fcf7f..1fead3f36f4d 100644 --- a/arch/loongarch/kvm/intc/pch_pic.c +++ b/arch/loongarch/kvm/intc/pch_pic.c @@ -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 = kcalloc(nr, sizeof(*entries), GFP_KERNEL); + entries = kzalloc_objs(*entries, nr, GFP_KERNEL); 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(sizeof(struct loongarch_pch_pic), GFP_KERNEL); + s = kzalloc_obj(struct loongarch_pch_pic, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/arch/loongarch/kvm/main.c b/arch/loongarch/kvm/main.c index ac38d0f19dd3..c86f9f5fedb5 100644 --- a/arch/loongarch/kvm/main.c +++ b/arch/loongarch/kvm/main.c @@ -358,7 +358,7 @@ static int kvm_loongarch_env_init(void) return -ENOMEM; } - kvm_loongarch_ops = kzalloc(sizeof(*kvm_loongarch_ops), GFP_KERNEL); + kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops, GFP_KERNEL); if (!kvm_loongarch_ops) { free_percpu(vmcs); vmcs = NULL; diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index 550c0d05666a..483ed31f2008 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -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(sizeof(struct loongarch_csrs), GFP_KERNEL); + vcpu->arch.csr = kzalloc_obj(struct loongarch_csrs, GFP_KERNEL); if (!vcpu->arch.csr) return -ENOMEM; diff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c index 9681ade890c6..63fd40530aa9 100644 --- a/arch/loongarch/kvm/vm.c +++ b/arch/loongarch/kvm/vm.c @@ -68,7 +68,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) if (!kvm->arch.pgd) return -ENOMEM; - kvm->arch.phyid_map = kvzalloc(sizeof(struct kvm_phyid_map), GFP_KERNEL_ACCOUNT); + kvm->arch.phyid_map = kvzalloc_obj(struct kvm_phyid_map, + GFP_KERNEL_ACCOUNT); if (!kvm->arch.phyid_map) { free_page((unsigned long)kvm->arch.pgd); kvm->arch.pgd = NULL; diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index d7de5a87d081..07f876834b24 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -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(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { prog = orig_prog; goto out; diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c index 50c9016641a4..324a19d88ca1 100644 --- a/arch/loongarch/pci/acpi.c +++ b/arch/loongarch/pci/acpi.c @@ -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(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); 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(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { pr_warn("pci_bus %04x:%02x: ignored (out of memory)\n", domain, busnum); return NULL; } - root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL); + root_ops = kzalloc_obj(*root_ops, GFP_KERNEL); if (!root_ops) { kfree(info); return NULL; diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c index a537953bc10c..388cb652e51e 100644 --- a/arch/m68k/amiga/chipram.c +++ b/arch/m68k/amiga/chipram.c @@ -47,7 +47,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name) struct resource *res; void *p; - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); if (!res) return NULL; diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index 922e53bcb853..958c12a29884 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -161,7 +161,7 @@ void *atari_stram_alloc(unsigned long size, const char *owner) /* round up */ size = PAGE_ALIGN(size); - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); if (!res) return NULL; diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index 94a4fadc651a..921a96ea83df 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c @@ -112,7 +112,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) return -EINVAL; } - dev = kmalloc(sizeof(struct nfhd_device), GFP_KERNEL); + dev = kmalloc_obj(struct nfhd_device, GFP_KERNEL); if (!dev) goto out; diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 7594a945732b..0ef6e6894a96 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -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(sizeof(*area), GFP_KERNEL); + area = kmalloc_obj(*area, GFP_KERNEL); if (!area) return NULL; addr = KMAP_START; diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c index 551b0d21d9dc..7ed84f26ac40 100644 --- a/arch/mips/alchemy/common/clock.c +++ b/arch/mips/alchemy/common/clock.c @@ -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(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); 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(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); 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 = kcalloc(6, sizeof(*a), GFP_KERNEL); + a = kzalloc_objs(*a, 6, GFP_KERNEL); if (!a) return -ENOMEM; @@ -996,7 +996,7 @@ static int __init alchemy_clk_setup_imux(int ctype) return -ENODEV; } - a = kcalloc(6, sizeof(*a), GFP_KERNEL); + a = kzalloc_objs(*a, 6, GFP_KERNEL); if (!a) return -ENOMEM; diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index 6c2c2010bbae..eb420a6f2f9f 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c @@ -310,7 +310,7 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, * If kmalloc fails, it is caught below same * as a channel not available. */ - ctp = kmalloc(sizeof(chan_tab_t), GFP_ATOMIC); + ctp = kmalloc_obj(chan_tab_t, GFP_ATOMIC); chan_tab_ptr[i] = ctp; break; } @@ -412,8 +412,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries) * and if we try that first we are likely to not waste larger * slabs of memory. */ - desc_base = (u32)kmalloc_array(entries, sizeof(au1x_ddma_desc_t), - GFP_KERNEL|GFP_DMA); + desc_base = (u32) kmalloc_objs(au1x_ddma_desc_t, entries, + GFP_KERNEL | GFP_DMA); if (desc_base == 0) return 0; @@ -1057,7 +1057,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable) { int ret; - dbdev_tab = kcalloc(DBDEV_TAB_SIZE, sizeof(dbdev_tab_t), GFP_KERNEL); + dbdev_tab = kzalloc_objs(dbdev_tab_t, DBDEV_TAB_SIZE, GFP_KERNEL); if (!dbdev_tab) return -ENOMEM; diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index da74cae6b43a..931cf459facb 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c @@ -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 = kcalloc(2, sizeof(struct resource), GFP_KERNEL); + *r = kzalloc_objs(struct resource, 2, GFP_KERNEL); if (!*r) return -ENOMEM; - *d = kzalloc(sizeof(struct platform_device), GFP_KERNEL); + *d = kzalloc_obj(struct platform_device, GFP_KERNEL); if (!*d) { kfree(*r); return -ENOMEM; diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c index 754bdd2ca630..40e804a898ec 100644 --- a/arch/mips/alchemy/devboards/platform.c +++ b/arch/mips/alchemy/devboards/platform.c @@ -87,7 +87,7 @@ int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start, if (stschg_irq) cnt++; - sr = kcalloc(cnt, sizeof(struct resource), GFP_KERNEL); + sr = kzalloc_objs(struct resource, cnt, GFP_KERNEL); if (!sr) return -ENOMEM; @@ -162,15 +162,15 @@ int __init db1x_register_norflash(unsigned long size, int width, return -EINVAL; ret = -ENOMEM; - parts = kcalloc(5, sizeof(struct mtd_partition), GFP_KERNEL); + parts = kzalloc_objs(struct mtd_partition, 5, GFP_KERNEL); if (!parts) goto out; - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); if (!res) goto out1; - pfd = kzalloc(sizeof(struct physmap_flash_data), GFP_KERNEL); + pfd = kzalloc_obj(struct physmap_flash_data, GFP_KERNEL); if (!pfd) goto out2; diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 38ed61b4bd96..d9e569af0d86 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c @@ -187,7 +187,7 @@ static struct device * __init bcm47xx_setup_device(void) struct device *dev; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 5c3de175ef5b..2a91e678fc1a 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c @@ -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(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); 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(sizeof(*dd), GFP_KERNEL); + dd = kzalloc_obj(*dd, GFP_KERNEL); if (!dd) return -ENOMEM; @@ -1633,7 +1633,7 @@ static int __init octeon_irq_init_gpio( return -EINVAL; } - gpiod = kzalloc(sizeof(*gpiod), GFP_KERNEL); + gpiod = kzalloc_obj(*gpiod, GFP_KERNEL); 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(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); 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(sizeof(*host_data), GFP_KERNEL); + host_data = kzalloc_obj(*host_data, GFP_KERNEL); if (!host_data) return -ENOMEM; raw_spin_lock_init(&host_data->lock); diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index ba0f62d8eff5..9ef50013c818 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c @@ -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(sizeof *n, GFP_KERNEL); + n = kmalloc_obj(*n, GFP_KERNEL); if (!n) return -ENOMEM; diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 22d4f9ff3ae2..ef5dca1313b2 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -341,9 +341,8 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) /* Allocate cluster boot configuration structs */ nclusters = mips_cps_numclusters(); - mips_cps_cluster_bootcfg = kcalloc(nclusters, - sizeof(*mips_cps_cluster_bootcfg), - GFP_KERNEL); + mips_cps_cluster_bootcfg = kzalloc_objs(*mips_cps_cluster_bootcfg, + nclusters, GFP_KERNEL); if (!mips_cps_cluster_bootcfg) goto err_out; @@ -353,8 +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 = kcalloc(ncores, sizeof(*core_bootcfg), - GFP_KERNEL); + core_bootcfg = kzalloc_objs(*core_bootcfg, ncores, GFP_KERNEL); if (!core_bootcfg) goto err_out; mips_cps_cluster_bootcfg[cl].core_config = core_bootcfg; @@ -369,9 +367,9 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) for (c = 0; c < ncores; c++) { int v; core_vpes = core_vpe_count(cl, c); - core_bootcfg[c].vpe_config = kcalloc(core_vpes, - sizeof(*core_bootcfg[c].vpe_config), - GFP_KERNEL); + core_bootcfg[c].vpe_config = kzalloc_objs(*core_bootcfg[c].vpe_config, + core_vpes, + GFP_KERNEL); for (v = 0; v < core_vpes; v++) cpumask_set_cpu(nvpe++, &mips_cps_cluster_bootcfg[cl].cpumask); if (!core_bootcfg[c].vpe_config) diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 2b67c44adab9..fdbb5c4de834 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -94,7 +94,7 @@ struct vpe *alloc_vpe(int minor) { struct vpe *v; - v = kzalloc(sizeof(struct vpe), GFP_KERNEL); + v = kzalloc_obj(struct vpe, GFP_KERNEL); if (v == NULL) goto out; @@ -115,7 +115,7 @@ struct tc *alloc_tc(int index) { struct tc *tc; - tc = kzalloc(sizeof(struct tc), GFP_KERNEL); + tc = kzalloc_obj(struct tc, GFP_KERNEL); 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(sizeof(*n), GFP_KERNEL); + n = kmalloc_obj(*n, GFP_KERNEL); if (!n) return -ENOMEM; diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sysctrl.c index 577e6e6309a6..ee0e634f6fe1 100644 --- a/arch/mips/lantiq/falcon/sysctrl.c +++ b/arch/mips/lantiq/falcon/sysctrl.c @@ -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(sizeof(struct clk), GFP_KERNEL); + struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); if (!clk) return; diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c index 484c9e3000c1..f8f3f5383a34 100644 --- a/arch/mips/lantiq/xway/gptu.c +++ b/arch/mips/lantiq/xway/gptu.c @@ -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(sizeof(struct clk), GFP_KERNEL); + struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); if (!clk) return; diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index d9aa80afdf9d..b7be6c710a15 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c @@ -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(sizeof(struct clk), GFP_KERNEL); + struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); 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(sizeof(struct clk), GFP_KERNEL); + struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); 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(sizeof(struct clk), GFP_KERNEL); - struct clk *clk_ext = kzalloc(sizeof(struct clk), GFP_KERNEL); + struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); + struct clk *clk_ext = kzalloc_obj(struct clk, GFP_KERNEL); /* main pci clock */ if (clk) { @@ -423,7 +423,7 @@ static void clkdev_add_clkout(void) continue; sprintf(name, "clkout%d", i); - clk = kzalloc(sizeof(struct clk), GFP_KERNEL); + clk = kzalloc_obj(struct clk, GFP_KERNEL); if (!clk) { kfree(name); continue; diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index b9f90f33fc9a..5f73f8663ab2 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -156,7 +156,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode, resource_size_ struct logic_pio_hwaddr *range; unsigned long vaddr; - range = kzalloc(sizeof(*range), GFP_ATOMIC); + range = kzalloc_obj(*range, GFP_ATOMIC); if (!range) return -ENOMEM; diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index 6bfee0f71803..d5b4f0e6bee3 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c @@ -380,7 +380,7 @@ static int alchemy_pci_probe(struct platform_device *pdev) goto out; } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { dev_err(&pdev->dev, "no memory for pcictl context\n"); ret = -ENOMEM; diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c index e00c38620d14..c78f99eebe1a 100644 --- a/arch/mips/pci/pci-xtalk-bridge.c +++ b/arch/mips/pci/pci-xtalk-bridge.c @@ -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(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c index 672249a13a09..c493fe67802c 100644 --- a/arch/mips/ralink/mt7620.c +++ b/arch/mips/ralink/mt7620.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/mips/ralink/mt7621.c b/arch/mips/ralink/mt7621.c index 5a9fd3fe41d7..ca70966da6f7 100644 --- a/arch/mips/ralink/mt7621.c +++ b/arch/mips/ralink/mt7621.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c index ce8b5b6025bb..d60fd84e4b9c 100644 --- a/arch/mips/ralink/rt288x.c +++ b/arch/mips/ralink/rt288x.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/mips/ralink/rt305x.c b/arch/mips/ralink/rt305x.c index 1f422470b029..6abd2a56ba27 100644 --- a/arch/mips/ralink/rt305x.c +++ b/arch/mips/ralink/rt305x.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c index 21ce00da5758..60605941b4b2 100644 --- a/arch/mips/ralink/rt3883.c +++ b/arch/mips/ralink/rt3883.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c index 19b70928d6dc..08604e5836bc 100644 --- a/arch/mips/sgi-ip22/ip22-gio.c +++ b/arch/mips/sgi-ip22/ip22-gio.c @@ -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(sizeof *gio_dev, GFP_KERNEL); + gio_dev = kzalloc_obj(*gio_dev, GFP_KERNEL); if (!gio_dev) return; gio_dev->name = name; diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 20ef663af16e..fb3e9bfa6abf 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -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(sizeof(*hd), GFP_KERNEL); + hd = kzalloc_obj(*hd, GFP_KERNEL); if (!hd) return -ENOMEM; diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c index 5143d1cf8984..5504c3234d5a 100644 --- a/arch/mips/sgi-ip27/ip27-xtalk.c +++ b/arch/mips/sgi-ip27/ip27-xtalk.c @@ -34,7 +34,7 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid) offset = NODE_OFFSET(nasid); - wd = kzalloc(sizeof(*wd), GFP_KERNEL); + wd = kzalloc_obj(*wd, GFP_KERNEL); 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(sizeof(*bd), GFP_KERNEL); + bd = kzalloc_obj(*bd, GFP_KERNEL); if (!bd) { pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget); goto err_unregister_pdev_wd; diff --git a/arch/mips/sgi-ip30/ip30-irq.c b/arch/mips/sgi-ip30/ip30-irq.c index 9fb905e2cf14..1ffa97c578fa 100644 --- a/arch/mips/sgi-ip30/ip30-irq.c +++ b/arch/mips/sgi-ip30/ip30-irq.c @@ -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(sizeof(*hd), GFP_KERNEL); + hd = kzalloc_obj(*hd, GFP_KERNEL); if (!hd) return -ENOMEM; diff --git a/arch/mips/sgi-ip30/ip30-xtalk.c b/arch/mips/sgi-ip30/ip30-xtalk.c index d798ee8c998c..e5525f1b617e 100644 --- a/arch/mips/sgi-ip30/ip30-xtalk.c +++ b/arch/mips/sgi-ip30/ip30-xtalk.c @@ -44,7 +44,7 @@ static void bridge_platform_create(int widget, int masterwid) struct platform_device *pdev_bd; struct resource w1_res; - wd = kzalloc(sizeof(*wd), GFP_KERNEL); + wd = kzalloc_obj(*wd, GFP_KERNEL); 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(sizeof(*bd), GFP_KERNEL); + bd = kzalloc_obj(*bd, GFP_KERNEL); if (!bd) { pr_warn("xtalk:%x bridge create out of memory\n", widget); goto err_unregister_pdev_wd; diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index d9249f5a632e..1976c06ee667 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -120,7 +120,7 @@ txx9_alloc_pci_controller(struct pci_controller *pcic, int min_size = 0x10000; if (!pcic) { - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; new->r_mem[0].name = "PCI mem"; diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 03f8a3a95637..5cf490edea5a 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c @@ -648,7 +648,7 @@ void __init txx9_iocled_init(unsigned long baseaddr, if (!deftriggers) deftriggers = default_triggers; - iocled = kzalloc(sizeof(*iocled), GFP_KERNEL); + iocled = kzalloc_obj(*iocled, GFP_KERNEL); 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(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return; size = resource_size(r); diff --git a/arch/nios2/platform/platform.c b/arch/nios2/platform/platform.c index 9737a87121fa..567e41095a40 100644 --- a/arch/nios2/platform/platform.c +++ b/arch/nios2/platform/platform.c @@ -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(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (soc_dev_attr) { machine = of_flat_dt_get_machine_name(); if (machine) diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 7707158a7840..0a5868035ff0 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -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(sizeof(*dev), GFP_KERNEL); + struct parisc_device *dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index 05798355cff4..af827d32bcca 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -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(sizeof (*pa_pdc_cell), GFP_KERNEL); + pa_pdc_cell = kmalloc_obj(*pa_pdc_cell, GFP_KERNEL); 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_array(num_addrs, sizeof(*dev->addr), GFP_KERNEL); + dev->addr = kmalloc_objs(*dev->addr, num_addrs, GFP_KERNEL); if(!dev->addr) { printk(KERN_ERR "%s %s(): memory allocation failure\n", __FILE__, __func__); diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index beb30c5de097..742e831de73c 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -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(sizeof (*pa_pdc_cell), GFP_KERNEL); + pa_pdc_cell = kmalloc_obj(*pa_pdc_cell, GFP_KERNEL); if (!pa_pdc_cell) panic("couldn't allocate memory for PDC_PAT_CELL!"); diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 7ac88ff13d3c..32103a270a8e 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -157,7 +157,7 @@ unwind_table_add(const char *name, unsigned long base_addr, unwind_table_sort(s, e); - table = kmalloc(sizeof(struct unwind_table), GFP_USER); + table = kmalloc_obj(struct unwind_table, GFP_USER); if (table == NULL) return NULL; unwind_table_init(table, name, base_addr, gp, start, end); @@ -408,7 +408,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct struct pt_regs *r = &t->thread.regs; struct pt_regs *r2; - r2 = kmalloc(sizeof(struct pt_regs), GFP_ATOMIC); + r2 = kmalloc_obj(struct pt_regs, GFP_ATOMIC); if (!r2) return; *r2 = *r; diff --git a/arch/parisc/kernel/vdso.c b/arch/parisc/kernel/vdso.c index c5cbfce7a84c..a91a6a67d680 100644 --- a/arch/parisc/kernel/vdso.c +++ b/arch/parisc/kernel/vdso.c @@ -102,7 +102,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end) struct page **pagelist; int i; - pagelist = kcalloc(pages + 1, sizeof(struct page *), GFP_KERNEL); + pagelist = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); if (!pagelist) panic("%s: Cannot allocate page list for VDSO", __func__); for (i = 0; i < pages; i++) diff --git a/arch/parisc/net/bpf_jit_core.c b/arch/parisc/net/bpf_jit_core.c index 06cbcd6fe87b..af852116adf8 100644 --- a/arch/parisc/net/bpf_jit_core.c +++ b/arch/parisc/net/bpf_jit_core.c @@ -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(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); 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 = kcalloc(prog->len, sizeof(int), GFP_KERNEL); + ctx->offset = kzalloc_objs(int, prog->len, GFP_KERNEL); if (!ctx->offset) { prog = orig_prog; goto out_offset; diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index 0fcc463b02e2..1298c868f9b6 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c @@ -157,7 +157,7 @@ static struct cache *new_cache(int type, int level, { struct cache *cache; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); 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(sizeof(*cache_dir), GFP_KERNEL); + cache_dir = kzalloc_obj(*cache_dir, GFP_KERNEL); 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(sizeof(*index_dir), GFP_KERNEL); + index_dir = kzalloc_obj(*index_dir, GFP_KERNEL); if (!index_dir) return; diff --git a/arch/powerpc/kernel/eeh_cache.c b/arch/powerpc/kernel/eeh_cache.c index 2f9dbf8ad2ee..57e5382f790a 100644 --- a/arch/powerpc/kernel/eeh_cache.c +++ b/arch/powerpc/kernel/eeh_cache.c @@ -138,7 +138,7 @@ eeh_addr_cache_insert(struct pci_dev *dev, resource_size_t alo, return piar; } } - piar = kzalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC); + piar = kzalloc_obj(struct pci_io_addr_range, GFP_ATOMIC); if (!piar) return NULL; diff --git a/arch/powerpc/kernel/eeh_event.c b/arch/powerpc/kernel/eeh_event.c index c23a454af08a..279c1ceccd6d 100644 --- a/arch/powerpc/kernel/eeh_event.c +++ b/arch/powerpc/kernel/eeh_event.c @@ -104,7 +104,7 @@ int __eeh_send_failure_event(struct eeh_pe *pe) unsigned long flags; struct eeh_event *event; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) { pr_err("EEH: out of memory, event not handled\n"); return -ENOMEM; diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index f9c6568a9137..0c0d3c30432b 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -890,7 +890,7 @@ loff_t __init nvram_create_partition(const char *name, int sig, return -ENOSPC; /* Create our OS partition */ - new_part = kzalloc(sizeof(*new_part), GFP_KERNEL); + new_part = kzalloc_obj(*new_part, GFP_KERNEL); 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(sizeof(*tmp_part), GFP_KERNEL); + tmp_part = kmalloc_obj(*tmp_part, GFP_KERNEL); err = -ENOMEM; if (!tmp_part) { printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n"); diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index eac84d687b53..7845c9c7f136 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -125,7 +125,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev) { struct pci_controller *phb; - phb = kzalloc(sizeof(struct pci_controller), GFP_KERNEL); + phb = kzalloc_obj(struct pci_controller, GFP_KERNEL); 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(sizeof(struct pci_intx_virq), GFP_KERNEL); + vi = kzalloc_obj(struct pci_intx_virq, GFP_KERNEL); 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(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); 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(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); BUG_ON(res == NULL); res->name = "Legacy VGA memory"; res->flags = IORESOURCE_MEM; diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 38561d6a2079..25310680fcc5 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -130,7 +130,7 @@ static struct eeh_dev *eeh_dev_init(struct pci_dn *pdn) struct eeh_dev *edev; /* Allocate EEH device */ - edev = kzalloc(sizeof(*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); 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(sizeof(*pdn), GFP_KERNEL); + pdn = kzalloc_obj(*pdn, GFP_KERNEL); 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(sizeof(*pdn), GFP_KERNEL); + pdn = kzalloc_obj(*pdn, GFP_KERNEL); if (pdn == NULL) return NULL; dn->data = pdn; diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 4111b21962eb..6b2a7ab69d78 100644 --- a/arch/powerpc/kernel/secvar-sysfs.c +++ b/arch/powerpc/kernel/secvar-sysfs.c @@ -151,7 +151,7 @@ static __init int add_var(const char *name) struct kobject *kobj; int rc; - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + kobj = kzalloc_obj(*kobj, GFP_KERNEL); if (!kobj) return -ENOMEM; diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index 21c39355b25e..5f26c0352538 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c @@ -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( sizeof(*tbsync), GFP_KERNEL ); + tbsync = kzalloc_obj(*tbsync, GFP_KERNEL); mb(); running = 1; diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index cad3358fa4c3..288763d59adb 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -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 = kcalloc(idx, sizeof(int), GFP_KERNEL); + chip_id_lookup_table = kzalloc_objs(int, idx, GFP_KERNEL); if (chip_id_lookup_table) memset(chip_id_lookup_table, -1, sizeof(int) * idx); } diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index ab7c4cc80943..2729631d9d07 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -245,7 +245,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end) struct page **pagelist; int pages = (end - start) >> PAGE_SHIFT; - pagelist = kcalloc(pages + 1, sizeof(struct page *), GFP_KERNEL); + pagelist = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); if (!pagelist) panic("%s: Cannot allocate page list for VDSO", __func__); diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index f305395cf26e..347847aec315 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c @@ -1494,7 +1494,7 @@ int kvm_vm_ioctl_resize_hpt_prepare(struct kvm *kvm, /* start new resize */ - resize = kzalloc(sizeof(*resize), GFP_KERNEL); + resize = kzalloc_obj(*resize, GFP_KERNEL); if (!resize) { ret = -ENOMEM; goto out; @@ -1943,7 +1943,7 @@ int kvm_vm_ioctl_get_htab_fd(struct kvm *kvm, struct kvm_get_htab_fd *ghf) /* reject flags we don't recognize */ if (ghf->flags & ~(KVM_GET_HTAB_BOLTED_ONLY | KVM_GET_HTAB_WRITE)) return -EINVAL; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; kvm_get_kvm(kvm); @@ -1985,7 +1985,7 @@ static int debugfs_htab_open(struct inode *inode, struct file *file) struct kvm *kvm = inode->i_private; struct debugfs_htab_state *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c index b3e6e73d6a08..82af0508993c 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_radix.c +++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c @@ -1256,7 +1256,7 @@ static int debugfs_radix_open(struct inode *inode, struct file *file) struct kvm *kvm = inode->i_private; struct debugfs_radix_state *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c index 742aa58a7c7e..70c73864aab8 100644 --- a/arch/powerpc/kvm/book3s_64_vio.c +++ b/arch/powerpc/kvm/book3s_64_vio.c @@ -178,7 +178,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, } rcu_read_unlock(); - stit = kzalloc(sizeof(*stit), GFP_KERNEL); + stit = kzalloc_obj(*stit, GFP_KERNEL); if (!stit) { iommu_tce_table_put(tbl); return -ENOMEM; @@ -305,7 +305,7 @@ int kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm, return ret; ret = -ENOMEM; - stt = kzalloc(struct_size(stt, pages, npages), GFP_KERNEL | __GFP_NOWARN); + stt = kzalloc_flex(*stt, pages, npages, GFP_KERNEL | __GFP_NOWARN); if (!stt) goto fail_acct; diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 7667563fb9ff..e6f6a58c5e36 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -2790,7 +2790,7 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int id) { struct kvmppc_vcore *vcore; - vcore = kzalloc(sizeof(struct kvmppc_vcore), GFP_KERNEL); + vcore = kzalloc_obj(struct kvmppc_vcore, GFP_KERNEL); if (vcore == NULL) return NULL; @@ -2842,7 +2842,7 @@ static int debugfs_timings_open(struct inode *inode, struct file *file) struct kvm_vcpu *vcpu = inode->i_private; struct debugfs_timings_state *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; @@ -5637,7 +5637,7 @@ void kvmppc_alloc_host_rm_ops(void) if (kvmppc_host_rm_ops_hv != NULL) return; - ops = kzalloc(sizeof(struct kvmppc_host_rm_ops), GFP_KERNEL); + ops = kzalloc_obj(struct kvmppc_host_rm_ops, GFP_KERNEL); if (!ops) return; @@ -5960,7 +5960,7 @@ void kvmppc_free_pimap(struct kvm *kvm) static struct kvmppc_passthru_irqmap *kvmppc_alloc_pimap(void) { - return kzalloc(sizeof(struct kvmppc_passthru_irqmap), GFP_KERNEL); + return kzalloc_obj(struct kvmppc_passthru_irqmap, GFP_KERNEL); } static int kvmppc_set_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi) diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c index 5f8c2321cfb5..9bbac7fe2046 100644 --- a/arch/powerpc/kvm/book3s_hv_nested.c +++ b/arch/powerpc/kvm/book3s_hv_nested.c @@ -726,7 +726,7 @@ static struct kvm_nested_guest *kvmhv_alloc_nested(struct kvm *kvm, unsigned int struct kvm_nested_guest *gp; long shadow_lpid; - gp = kzalloc(sizeof(*gp), GFP_KERNEL); + gp = kzalloc_obj(*gp, GFP_KERNEL); if (!gp) return NULL; gp->l1_host = kvm; @@ -1671,7 +1671,7 @@ static long int __kvmhv_nested_page_fault(struct kvm_vcpu *vcpu, /* 4. Insert the pte into our shadow_pgtable */ - n_rmap = kzalloc(sizeof(*n_rmap), GFP_KERNEL); + n_rmap = kzalloc_obj(*n_rmap, GFP_KERNEL); if (!n_rmap) return RESUME_GUEST; /* Let the guest try again */ n_rmap->rmap = (n_gpa & RMAP_NESTED_GPA_MASK) | diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c index 7cf9310de0ec..f960294dfc79 100644 --- a/arch/powerpc/kvm/book3s_hv_uvmem.c +++ b/arch/powerpc/kvm/book3s_hv_uvmem.c @@ -249,7 +249,7 @@ int kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot) { struct kvmppc_uvmem_slot *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; p->pfns = vcalloc(slot->npages, sizeof(*p->pfns)); @@ -711,7 +711,7 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm) bitmap_set(kvmppc_uvmem_bitmap, bit, 1); spin_unlock(&kvmppc_uvmem_bitmap_lock); - pvt = kzalloc(sizeof(*pvt), GFP_KERNEL); + pvt = kzalloc_obj(*pvt, GFP_KERNEL); if (!pvt) goto out_clear; diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 83bcdc80ce51..b7fdb089f2af 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -1738,8 +1738,8 @@ static int kvmppc_core_vcpu_create_pr(struct kvm_vcpu *vcpu) vcpu->arch.book3s = vcpu_book3s; #ifdef CONFIG_KVM_BOOK3S_32_HANDLER - vcpu->arch.shadow_vcpu = - kzalloc(sizeof(*vcpu->arch.shadow_vcpu), GFP_KERNEL); + vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu, + GFP_KERNEL); if (!vcpu->arch.shadow_vcpu) goto free_vcpu3s; #endif diff --git a/arch/powerpc/kvm/book3s_rtas.c b/arch/powerpc/kvm/book3s_rtas.c index 6808bda0dbc1..d6f8f33cc98b 100644 --- a/arch/powerpc/kvm/book3s_rtas.c +++ b/arch/powerpc/kvm/book3s_rtas.c @@ -183,7 +183,7 @@ static int rtas_token_define(struct kvm *kvm, char *name, u64 token) if (!found) return -ENOENT; - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index 589a8f257120..3ba148b1d22f 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c @@ -1037,7 +1037,7 @@ static struct kvmppc_ics *kvmppc_xics_create_ics(struct kvm *kvm, goto out; /* Create the ICS */ - ics = kzalloc(sizeof(struct kvmppc_ics), GFP_KERNEL); + ics = kzalloc_obj(struct kvmppc_ics, GFP_KERNEL); if (!ics) goto out; @@ -1069,7 +1069,7 @@ static int kvmppc_xics_create_icp(struct kvm_vcpu *vcpu, unsigned long server_nu if (kvmppc_xics_find_server(vcpu->kvm, server_num)) return -EEXIST; - icp = kzalloc(sizeof(struct kvmppc_icp), GFP_KERNEL); + icp = kzalloc_obj(struct kvmppc_icp, GFP_KERNEL); if (!icp) return -ENOMEM; @@ -1388,7 +1388,7 @@ static struct kvmppc_xics *kvmppc_xics_get_device(struct kvm *kvm) struct kvmppc_xics *xics = *kvm_xics_device; if (!xics) { - xics = kzalloc(sizeof(*xics), GFP_KERNEL); + xics = kzalloc_obj(*xics, GFP_KERNEL); *kvm_xics_device = xics; } else { memset(xics, 0, sizeof(*xics)); diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index 89a1b8c21ab4..ae69a1e1dd17 100644 --- a/arch/powerpc/kvm/book3s_xive.c +++ b/arch/powerpc/kvm/book3s_xive.c @@ -1924,7 +1924,7 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev, if (r) goto bail; - xc = kzalloc(sizeof(*xc), GFP_KERNEL); + xc = kzalloc_obj(*xc, GFP_KERNEL); if (!xc) { r = -ENOMEM; goto bail; @@ -2276,7 +2276,7 @@ struct kvmppc_xive_src_block *kvmppc_xive_create_src_block( goto out; /* Create the ICS */ - sb = kzalloc(sizeof(*sb), GFP_KERNEL); + sb = kzalloc_obj(*sb, GFP_KERNEL); if (!sb) goto out; @@ -2719,7 +2719,7 @@ struct kvmppc_xive *kvmppc_xive_get_device(struct kvm *kvm, u32 type) struct kvmppc_xive *xive = *kvm_xive_device; if (!xive) { - xive = kzalloc(sizeof(*xive), GFP_KERNEL); + xive = kzalloc_obj(*xive, GFP_KERNEL); *kvm_xive_device = xive; } else { memset(xive, 0, sizeof(*xive)); diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c index d9bf1bc3ff61..179bd6094d62 100644 --- a/arch/powerpc/kvm/book3s_xive_native.c +++ b/arch/powerpc/kvm/book3s_xive_native.c @@ -145,7 +145,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev, if (rc) goto bail; - xc = kzalloc(sizeof(*xc), GFP_KERNEL); + xc = kzalloc_obj(*xc, GFP_KERNEL); if (!xc) { rc = -ENOMEM; goto bail; diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index b0f695428733..891c936af1df 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c @@ -119,7 +119,7 @@ static inline void local_sid_destroy_all(void) static void *kvmppc_e500_id_table_alloc(struct kvmppc_vcpu_e500 *vcpu_e500) { - vcpu_e500->idt = kzalloc(sizeof(struct vcpu_id_table), GFP_KERNEL); + vcpu_e500->idt = kzalloc_obj(struct vcpu_id_table, GFP_KERNEL); return vcpu_e500->idt; } diff --git a/arch/powerpc/kvm/e500_mmu.c b/arch/powerpc/kvm/e500_mmu.c index e131fbecdcc4..ecbd7c4cd93d 100644 --- a/arch/powerpc/kvm/e500_mmu.c +++ b/arch/powerpc/kvm/e500_mmu.c @@ -772,7 +772,7 @@ int kvm_vcpu_ioctl_config_tlb(struct kvm_vcpu *vcpu, num_pages = DIV_ROUND_UP(cfg->array + array_len - 1, PAGE_SIZE) - cfg->array / PAGE_SIZE; - pages = kmalloc_array(num_pages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, num_pages, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -792,13 +792,13 @@ int kvm_vcpu_ioctl_config_tlb(struct kvm_vcpu *vcpu, goto put_pages; } - privs[0] = kcalloc(params.tlb_sizes[0], sizeof(*privs[0]), GFP_KERNEL); + privs[0] = kzalloc_objs(*privs[0], params.tlb_sizes[0], GFP_KERNEL); if (!privs[0]) { ret = -ENOMEM; goto put_pages; } - privs[1] = kcalloc(params.tlb_sizes[1], sizeof(*privs[1]), GFP_KERNEL); + privs[1] = kzalloc_objs(*privs[1], params.tlb_sizes[1], GFP_KERNEL); if (!privs[1]) { ret = -ENOMEM; goto free_privs_first; @@ -912,25 +912,24 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500) vcpu_e500->gtlb_params[1].ways = KVM_E500_TLB1_SIZE; vcpu_e500->gtlb_params[1].sets = 1; - vcpu_e500->gtlb_arch = kmalloc_array(KVM_E500_TLB0_SIZE + - KVM_E500_TLB1_SIZE, - sizeof(*vcpu_e500->gtlb_arch), - GFP_KERNEL); + vcpu_e500->gtlb_arch = kmalloc_objs(*vcpu_e500->gtlb_arch, + KVM_E500_TLB0_SIZE + KVM_E500_TLB1_SIZE, + GFP_KERNEL); if (!vcpu_e500->gtlb_arch) return -ENOMEM; vcpu_e500->gtlb_offset[0] = 0; vcpu_e500->gtlb_offset[1] = KVM_E500_TLB0_SIZE; - vcpu_e500->gtlb_priv[0] = kcalloc(vcpu_e500->gtlb_params[0].entries, - sizeof(struct tlbe_ref), - GFP_KERNEL); + vcpu_e500->gtlb_priv[0] = kzalloc_objs(struct tlbe_ref, + vcpu_e500->gtlb_params[0].entries, + GFP_KERNEL); if (!vcpu_e500->gtlb_priv[0]) goto free_vcpu; - vcpu_e500->gtlb_priv[1] = kcalloc(vcpu_e500->gtlb_params[1].entries, - sizeof(struct tlbe_ref), - GFP_KERNEL); + vcpu_e500->gtlb_priv[1] = kzalloc_objs(struct tlbe_ref, + vcpu_e500->gtlb_params[1].entries, + GFP_KERNEL); if (!vcpu_e500->gtlb_priv[1]) goto free_vcpu; diff --git a/arch/powerpc/kvm/guest-state-buffer.c b/arch/powerpc/kvm/guest-state-buffer.c index 871cf60ddeb6..42843eca6727 100644 --- a/arch/powerpc/kvm/guest-state-buffer.c +++ b/arch/powerpc/kvm/guest-state-buffer.c @@ -28,7 +28,7 @@ struct kvmppc_gs_buff *kvmppc_gsb_new(size_t size, unsigned long guest_id, { struct kvmppc_gs_buff *gsb; - gsb = kzalloc(sizeof(*gsb), flags); + gsb = kzalloc_obj(*gsb, flags); if (!gsb) return NULL; @@ -540,7 +540,7 @@ struct kvmppc_gs_msg *kvmppc_gsm_new(struct kvmppc_gs_msg_ops *ops, void *data, { struct kvmppc_gs_msg *gsm; - gsm = kzalloc(sizeof(*gsm), gfp_flags); + gsm = kzalloc_obj(*gsm, gfp_flags); if (!gsm) return NULL; diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c index 23e9c2bd9f27..a8ee6204cc08 100644 --- a/arch/powerpc/kvm/mpic.c +++ b/arch/powerpc/kvm/mpic.c @@ -1642,7 +1642,7 @@ static int mpic_set_default_irq_routing(struct openpic *opp) struct kvm_irq_routing_entry *routing; /* Create a nop default map, so that dereferencing it still works */ - routing = kzalloc((sizeof(*routing)), GFP_KERNEL); + routing = kzalloc_obj(*routing, GFP_KERNEL); if (!routing) return -ENOMEM; @@ -1661,7 +1661,7 @@ static int mpic_create(struct kvm_device *dev, u32 type) if (dev->kvm->arch.mpic) return -EINVAL; - opp = kzalloc(sizeof(struct openpic), GFP_KERNEL); + opp = kzalloc_obj(struct openpic, GFP_KERNEL); if (!opp) return -ENOMEM; diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c index 6aa774aa5b16..d6d72719801b 100644 --- a/arch/powerpc/lib/rheap.c +++ b/arch/powerpc/lib/rheap.c @@ -54,7 +54,7 @@ static int grow(rh_info_t * info, int max_blocks) new_blocks = max_blocks - info->max_blocks; - block = kmalloc_array(max_blocks, sizeof(rh_block_t), GFP_ATOMIC); + block = kmalloc_objs(rh_block_t, max_blocks, GFP_ATOMIC); if (block == NULL) return -ENOMEM; @@ -258,7 +258,7 @@ rh_info_t *rh_create(unsigned int alignment) if ((alignment & (alignment - 1)) != 0) return ERR_PTR(-EINVAL); - info = kmalloc(sizeof(*info), GFP_ATOMIC); + info = kmalloc_obj(*info, GFP_ATOMIC); if (info == NULL) return ERR_PTR(-ENOMEM); diff --git a/arch/powerpc/mm/book3s64/iommu_api.c b/arch/powerpc/mm/book3s64/iommu_api.c index c0e8d597e4cb..f9aa4e08b5bb 100644 --- a/arch/powerpc/mm/book3s64/iommu_api.c +++ b/arch/powerpc/mm/book3s64/iommu_api.c @@ -70,7 +70,7 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua, locked_entries = entries; } - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) { ret = -ENOMEM; goto unlock_exit; diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c index fb9dcf9ca599..c7302dd2ef25 100644 --- a/arch/powerpc/mm/book3s64/mmu_context.c +++ b/arch/powerpc/mm/book3s64/mmu_context.c @@ -96,8 +96,8 @@ static int hash__init_new_context(struct mm_struct *mm) { int index; - mm->context.hash_context = kmalloc(sizeof(struct hash_mm_context), - GFP_KERNEL); + mm->context.hash_context = kmalloc_obj(struct hash_mm_context, + GFP_KERNEL); if (!mm->context.hash_context) return -ENOMEM; @@ -124,8 +124,8 @@ static int hash__init_new_context(struct mm_struct *mm) #ifdef CONFIG_PPC_SUBPAGE_PROT /* inherit subpage prot details if we have one. */ if (current->mm->context.hash_context->spt) { - mm->context.hash_context->spt = kmalloc(sizeof(struct subpage_prot_table), - GFP_KERNEL); + mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table, + GFP_KERNEL); if (!mm->context.hash_context->spt) { kfree(mm->context.hash_context); return -ENOMEM; diff --git a/arch/powerpc/mm/book3s64/subpage_prot.c b/arch/powerpc/mm/book3s64/subpage_prot.c index 07c47673bba2..240880a38965 100644 --- a/arch/powerpc/mm/book3s64/subpage_prot.c +++ b/arch/powerpc/mm/book3s64/subpage_prot.c @@ -221,7 +221,7 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, * Allocate subpage prot table if not already done. * Do this with mmap_lock held */ - spt = kzalloc(sizeof(struct subpage_prot_table), GFP_KERNEL); + spt = kzalloc_obj(struct subpage_prot_table, GFP_KERNEL); if (!spt) { err = -ENOMEM; goto out; diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c index 8dd7b340d51f..45c1d47ec458 100644 --- a/arch/powerpc/mm/drmem.c +++ b/arch/powerpc/mm/drmem.c @@ -41,7 +41,7 @@ static struct property *clone_property(struct property *prop, u32 prop_sz) { struct property *new_prop; - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); if (!new_prop) return NULL; @@ -430,8 +430,7 @@ static void __init init_drmem_v1_lmbs(const __be32 *prop) if (drmem_info->n_lmbs == 0) return; - drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb), - GFP_KERNEL); + drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs, GFP_KERNEL); if (!drmem_info->lmbs) return; @@ -458,8 +457,7 @@ static void __init init_drmem_v2_lmbs(const __be32 *prop) drmem_info->n_lmbs += dr_cell.seq_lmbs; } - drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb), - GFP_KERNEL); + drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs, GFP_KERNEL); if (!drmem_info->lmbs) return; diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 29bf347f6012..bab22aabbb9b 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -318,7 +318,7 @@ static int __init add_system_ram_resources(void) for_each_mem_range(i, &start, &end) { struct resource *res; - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); WARN_ON(!res); if (res) { diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index b75dd53584d5..baf5b6e69647 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c @@ -165,7 +165,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit_data = fp->aux->jit_data; if (!jit_data) { - jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { fp = org_fp; goto out; diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index e42677cc254a..210d16c76b40 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -451,7 +451,7 @@ static ssize_t coresperchip_show(struct device *dev, static struct attribute *device_str_attr_create_(char *name, char *str) { - struct dev_ext_attribute *attr = kzalloc(sizeof(*attr), GFP_KERNEL); + struct dev_ext_attribute *attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return NULL; @@ -647,7 +647,7 @@ static int event_uniq_add(struct rb_root *root, const char *name, int nl, } } - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -905,21 +905,20 @@ static int create_events_from_catalog(struct attribute ***events_, pr_warn("event buffer ended before listed # of events were parsed (got %zu, wanted %zu, junk %zu)\n", event_idx_last, event_entry_count, junk_events); - events = kmalloc_array(attr_max + 1, sizeof(*events), GFP_KERNEL); + events = kmalloc_objs(*events, attr_max + 1, GFP_KERNEL); if (!events) { ret = -ENOMEM; goto e_event_data; } - event_descs = kmalloc_array(event_idx + 1, sizeof(*event_descs), - GFP_KERNEL); + event_descs = kmalloc_objs(*event_descs, event_idx + 1, GFP_KERNEL); if (!event_descs) { ret = -ENOMEM; goto e_event_attrs; } - event_long_descs = kmalloc_array(event_idx + 1, - sizeof(*event_long_descs), GFP_KERNEL); + event_long_descs = kmalloc_objs(*event_long_descs, event_idx + 1, + GFP_KERNEL); if (!event_long_descs) { ret = -ENOMEM; goto e_event_descs; diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c index 241551d1282f..11e774857030 100644 --- a/arch/powerpc/perf/hv-gpci.c +++ b/arch/powerpc/perf/hv-gpci.c @@ -910,7 +910,7 @@ static struct device_attribute *sysinfo_device_attr_create(int * attribute array, only for valid return types. */ if (!ret || ret == H_AUTHORITY || ret == H_PARAMETER) { - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return NULL; diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 8664a7d297ad..c4b2c0a19f58 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -136,7 +136,7 @@ static struct attribute *device_str_attr_create(const char *name, const char *st { struct perf_pmu_events_attr *attr; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return NULL; sysfs_attr_init(&attr->attr.attr); @@ -257,7 +257,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) of_property_read_u32(node, "reg", &base_reg); /* Allocate memory for the events */ - pmu->events = kcalloc(ct, sizeof(struct imc_events), GFP_KERNEL); + pmu->events = kzalloc_objs(struct imc_events, ct, GFP_KERNEL); if (!pmu->events) { of_node_put(pmu_events); return -ENOMEM; @@ -274,7 +274,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) of_node_put(pmu_events); /* Allocate memory for attribute group */ - attr_group = kzalloc(sizeof(*attr_group), GFP_KERNEL); + attr_group = kzalloc_obj(*attr_group, GFP_KERNEL); if (!attr_group) { imc_free_events(pmu->events, ct); return -ENOMEM; @@ -288,7 +288,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) * So allocate three times the "ct" (this includes event, event_scale and * event_unit). */ - attrs = kcalloc(((ct * 3) + 1), sizeof(struct attribute *), GFP_KERNEL); + attrs = kzalloc_objs(struct attribute *, ((ct * 3) + 1), GFP_KERNEL); if (!attrs) { kfree(attr_group); imc_free_events(pmu->events, ct); @@ -1527,8 +1527,8 @@ static int init_nest_pmu_ref(void) { int nid, i, cpu; - nest_imc_refc = kcalloc(num_possible_nodes(), sizeof(*nest_imc_refc), - GFP_KERNEL); + nest_imc_refc = kzalloc_objs(*nest_imc_refc, num_possible_nodes(), + GFP_KERNEL); if (!nest_imc_refc) return -ENOMEM; @@ -1699,9 +1699,9 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent, /* Needed for hotplug/migration */ if (!per_nest_pmu_arr) { - per_nest_pmu_arr = kcalloc(get_max_nest_dev() + 1, - sizeof(struct imc_pmu *), - GFP_KERNEL); + per_nest_pmu_arr = kzalloc_objs(struct imc_pmu *, + get_max_nest_dev() + 1, + GFP_KERNEL); if (!per_nest_pmu_arr) goto err; } @@ -1714,14 +1714,14 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent, goto err; nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core); - pmu_ptr->mem_info = kcalloc(nr_cores, sizeof(struct imc_mem_info), - GFP_KERNEL); + pmu_ptr->mem_info = kzalloc_objs(struct imc_mem_info, nr_cores, + GFP_KERNEL); if (!pmu_ptr->mem_info) goto err; - core_imc_refc = kcalloc(nr_cores, sizeof(struct imc_pmu_ref), - GFP_KERNEL); + core_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores, + GFP_KERNEL); if (!core_imc_refc) { kfree(pmu_ptr->mem_info); @@ -1754,8 +1754,8 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent, return -ENOMEM; nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core); - trace_imc_refc = kcalloc(nr_cores, sizeof(struct imc_pmu_ref), - GFP_KERNEL); + trace_imc_refc = kzalloc_objs(struct imc_pmu_ref, nr_cores, + GFP_KERNEL); if (!trace_imc_refc) return -ENOMEM; diff --git a/arch/powerpc/perf/vpa-dtl.c b/arch/powerpc/perf/vpa-dtl.c index 3c1d1c28deb9..ab19101a8928 100644 --- a/arch/powerpc/perf/vpa-dtl.c +++ b/arch/powerpc/perf/vpa-dtl.c @@ -523,7 +523,7 @@ static void *vpa_dtl_setup_aux(struct perf_event *event, void **pages, if (!buf) return NULL; - pglist = kcalloc(nr_pages, sizeof(*pglist), GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); if (!pglist) return NULL; diff --git a/arch/powerpc/platforms/44x/hsta_msi.c b/arch/powerpc/platforms/44x/hsta_msi.c index c6bd846b0d65..a6b1c004888e 100644 --- a/arch/powerpc/platforms/44x/hsta_msi.c +++ b/arch/powerpc/platforms/44x/hsta_msi.c @@ -151,8 +151,7 @@ static int hsta_msi_probe(struct platform_device *pdev) if (ret) goto out; - ppc4xx_hsta_msi.irq_map = kmalloc_array(irq_count, sizeof(int), - GFP_KERNEL); + ppc4xx_hsta_msi.irq_map = kmalloc_objs(int, irq_count, GFP_KERNEL); if (!ppc4xx_hsta_msi.irq_map) { ret = -ENOMEM; goto out1; diff --git a/arch/powerpc/platforms/44x/pci.c b/arch/powerpc/platforms/44x/pci.c index 364aeb86ab64..6ac53865b872 100644 --- a/arch/powerpc/platforms/44x/pci.c +++ b/arch/powerpc/platforms/44x/pci.c @@ -1339,8 +1339,7 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np) count = ppc4xx_pciex_hwops->core_init(np); if (count > 0) { ppc4xx_pciex_ports = - kcalloc(count, sizeof(struct ppc4xx_pciex_port), - GFP_KERNEL); + kzalloc_objs(struct ppc4xx_pciex_port, count, GFP_KERNEL); if (ppc4xx_pciex_ports) { ppc4xx_pciex_port_count = count; return 0; diff --git a/arch/powerpc/platforms/44x/uic.c b/arch/powerpc/platforms/44x/uic.c index 85daf841fd3f..a484474df432 100644 --- a/arch/powerpc/platforms/44x/uic.c +++ b/arch/powerpc/platforms/44x/uic.c @@ -233,7 +233,7 @@ static struct uic * __init uic_init_one(struct device_node *node) BUG_ON(! of_device_is_compatible(node, "ibm,uic")); - uic = kzalloc(sizeof(*uic), GFP_KERNEL); + uic = kzalloc_obj(*uic, GFP_KERNEL); if (! uic) return NULL; /* FIXME: panic? */ diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index 80d944f29288..d8cdd077a554 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c @@ -146,7 +146,7 @@ static int mcu_probe(struct i2c_client *client) struct mcu *mcu; int ret; - mcu = kzalloc(sizeof(*mcu), GFP_KERNEL); + mcu = kzalloc_obj(*mcu, GFP_KERNEL); if (!mcu) return -ENOMEM; diff --git a/arch/powerpc/platforms/book3s/vas-api.c b/arch/powerpc/platforms/book3s/vas-api.c index 49b15e7a8265..6f6c9d776dd7 100644 --- a/arch/powerpc/platforms/book3s/vas-api.c +++ b/arch/powerpc/platforms/book3s/vas-api.c @@ -266,7 +266,7 @@ static int coproc_open(struct inode *inode, struct file *fp) { struct coproc_instance *cp_inst; - cp_inst = kzalloc(sizeof(*cp_inst), GFP_KERNEL); + cp_inst = kzalloc_obj(*cp_inst, GFP_KERNEL); if (!cp_inst) return -ENOMEM; diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 3c8624870967..2c536040ae0a 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -558,7 +558,7 @@ static int __init create_spu(void *data) unsigned long flags; ret = -ENOMEM; - spu = kzalloc(sizeof (*spu), GFP_KERNEL); + spu = kzalloc_obj(*spu, GFP_KERNEL); if (!spu) goto out; diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 7a39cc414f09..ade2a5e041a3 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -26,7 +26,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) { struct spu_context *ctx; - ctx = kzalloc(sizeof *ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) goto out; /* Binding to physical processor deferred diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index ce839783c0df..60d9b9154997 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -47,7 +47,7 @@ static int spufs_attr_open(struct inode *inode, struct file *file, { struct spufs_attr *attr; - attr = kmalloc(sizeof(*attr), GFP_KERNEL); + attr = kmalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; @@ -2281,8 +2281,8 @@ static int spufs_switch_log_open(struct inode *inode, struct file *file) goto out; } - ctx->switch_log = kmalloc(struct_size(ctx->switch_log, log, - SWITCH_LOG_BUFSIZE), GFP_KERNEL); + ctx->switch_log = kmalloc_flex(*ctx->switch_log, log, + SWITCH_LOG_BUFSIZE, GFP_KERNEL); if (!ctx->switch_log) { rc = -ENOMEM; diff --git a/arch/powerpc/platforms/cell/spufs/gang.c b/arch/powerpc/platforms/cell/spufs/gang.c index 2c2999de6bfa..6ab8122bc833 100644 --- a/arch/powerpc/platforms/cell/spufs/gang.c +++ b/arch/powerpc/platforms/cell/spufs/gang.c @@ -16,7 +16,7 @@ struct spu_gang *alloc_spu_gang(void) { struct spu_gang *gang; - gang = kzalloc(sizeof *gang, GFP_KERNEL); + gang = kzalloc_obj(*gang, GFP_KERNEL); if (!gang) goto out; diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 577a00c25217..419ce7fee040 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -727,11 +727,11 @@ static int spufs_init_fs_context(struct fs_context *fc) struct spufs_fs_context *ctx; struct spufs_sb_info *sbi; - ctx = kzalloc(sizeof(struct spufs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct spufs_fs_context, GFP_KERNEL); if (!ctx) goto nomem; - sbi = kzalloc(sizeof(struct spufs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct spufs_sb_info, GFP_KERNEL); if (!sbi) goto nomem_ctx; diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 8e7ed010bfde..f61fa34b62f1 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -1082,7 +1082,7 @@ int __init spu_sched_init(void) struct proc_dir_entry *entry; int err = -ENOMEM, i; - spu_prio = kzalloc(sizeof(struct spu_prio_array), GFP_KERNEL); + spu_prio = kzalloc_obj(struct spu_prio_array, GFP_KERNEL); if (!spu_prio) goto out; diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index e4538d471256..fd31677b38e2 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -214,7 +214,7 @@ static int gpio_mdio_probe(struct platform_device *ofdev) int err; err = -ENOMEM; - priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); + priv = kzalloc_obj(struct gpio_priv, GFP_KERNEL); if (!priv) goto out; diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index 02474e27df9b..ec4b03fbfab2 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c @@ -489,7 +489,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) const u32 *psteps, *prate, *addrp; u32 steps; - host = kzalloc(sizeof(*host), GFP_KERNEL); + host = kzalloc_obj(*host, GFP_KERNEL); if (host == NULL) { printk(KERN_ERR "low_i2c: Can't allocate host for %pOF\n", np); @@ -569,7 +569,7 @@ static void __init kw_i2c_add(struct pmac_i2c_host_kw *host, { struct pmac_i2c_bus *bus; - bus = kzalloc(sizeof(struct pmac_i2c_bus), GFP_KERNEL); + bus = kzalloc_obj(struct pmac_i2c_bus, GFP_KERNEL); if (bus == NULL) return; @@ -1254,7 +1254,7 @@ static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args) * near OOM that need to be resolved, the allocator itself should * probably make GFP_NOIO implicit during suspend */ - inst = kzalloc(sizeof(struct pmac_i2c_pf_inst), GFP_KERNEL); + inst = kzalloc_obj(struct pmac_i2c_pf_inst, GFP_KERNEL); if (inst == NULL) { pmac_i2c_close(bus); return NULL; diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index 22741ddfd5b2..d1e2e557de15 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c @@ -644,7 +644,7 @@ static int pmf_add_function_prop(struct pmf_device *dev, void *driverdata, while (length >= 12) { /* Allocate a structure */ - func = kzalloc(sizeof(*func), GFP_KERNEL); + func = kzalloc_obj(*func, GFP_KERNEL); if (func == NULL) goto bail; kref_init(&func->ref); @@ -720,7 +720,7 @@ int pmf_register_driver(struct device_node *np, return -EBUSY; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { DBG("pmf: no memory !\n"); return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c index e4f4e907f6e3..1389a3131993 100644 --- a/arch/powerpc/platforms/powernv/idle.c +++ b/arch/powerpc/platforms/powernv/idle.c @@ -1336,8 +1336,8 @@ static int __init pnv_parse_cpuidle_dt(void) nr_idle_states = of_property_count_u32_elems(np, "ibm,cpu-idle-state-flags"); - pnv_idle_states = kcalloc(nr_idle_states, sizeof(*pnv_idle_states), - GFP_KERNEL); + pnv_idle_states = kzalloc_objs(*pnv_idle_states, nr_idle_states, + GFP_KERNEL); temp_u32 = kcalloc(nr_idle_states, sizeof(u32), GFP_KERNEL); temp_u64 = kcalloc(nr_idle_states, sizeof(u64), GFP_KERNEL); temp_string = kcalloc(nr_idle_states, sizeof(char *), GFP_KERNEL); diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c index 2ea30b343354..5214e2d43e78 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -133,8 +133,8 @@ static int memtrace_init_regions_runtime(u64 size) u32 nid; u64 m; - memtrace_array = kcalloc(num_online_nodes(), - sizeof(struct memtrace_entry), GFP_KERNEL); + memtrace_array = kzalloc_objs(struct memtrace_entry, num_online_nodes(), + GFP_KERNEL); if (!memtrace_array) { pr_err("Failed to allocate memtrace_array\n"); return -EINVAL; diff --git a/arch/powerpc/platforms/powernv/ocxl.c b/arch/powerpc/platforms/powernv/ocxl.c index f8139948348e..5ae7e3960364 100644 --- a/arch/powerpc/platforms/powernv/ocxl.c +++ b/arch/powerpc/platforms/powernv/ocxl.c @@ -149,7 +149,7 @@ static struct npu_link *find_link(struct pci_dev *dev) } /* link doesn't exist yet. Allocate one */ - link = kzalloc(sizeof(struct npu_link), GFP_KERNEL); + link = kzalloc_obj(struct npu_link, GFP_KERNEL); if (!link) return NULL; link->domain = pci_domain_nr(dev->bus); @@ -439,7 +439,7 @@ int pnv_ocxl_spa_setup(struct pci_dev *dev, void *spa_mem, int PE_mask, u32 bdfn; int rc; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/opal-async.c b/arch/powerpc/platforms/powernv/opal-async.c index c094fdf5825c..2cacfe5407c9 100644 --- a/arch/powerpc/platforms/powernv/opal-async.c +++ b/arch/powerpc/platforms/powernv/opal-async.c @@ -265,8 +265,8 @@ int __init opal_async_comp_init(void) } opal_max_async_tokens = be32_to_cpup(async); - opal_async_tokens = kcalloc(opal_max_async_tokens, - sizeof(*opal_async_tokens), GFP_KERNEL); + opal_async_tokens = kzalloc_objs(*opal_async_tokens, + opal_max_async_tokens, GFP_KERNEL); if (!opal_async_tokens) { err = -ENOMEM; goto out_opal_node; diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c index 784602a48afb..4f1533bcaa10 100644 --- a/arch/powerpc/platforms/powernv/opal-core.c +++ b/arch/powerpc/platforms/powernv/opal-core.c @@ -81,7 +81,7 @@ bool kernel_initiated; static struct opalcore * __init get_new_element(void) { - return kzalloc(sizeof(struct opalcore), GFP_KERNEL); + return kzalloc_obj(struct opalcore, GFP_KERNEL); } static inline int is_opalcore_usable(void) @@ -497,7 +497,7 @@ static void __init opalcore_config_init(void) opalc_cpu_metadata = __va(addr); /* Allocate memory for config buffer */ - oc_conf = kzalloc(sizeof(struct opalcore_config), GFP_KERNEL); + oc_conf = kzalloc_obj(struct opalcore_config, GFP_KERNEL); if (oc_conf == NULL) goto error_out; diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c index cc3cc9ddf9d1..a832afb4cbf5 100644 --- a/arch/powerpc/platforms/powernv/opal-dump.c +++ b/arch/powerpc/platforms/powernv/opal-dump.c @@ -329,7 +329,7 @@ static void create_dump_obj(uint32_t id, size_t size, uint32_t type) struct dump_obj *dump; int rc; - dump = kzalloc(sizeof(*dump), GFP_KERNEL); + dump = kzalloc_obj(*dump, GFP_KERNEL); if (!dump) return; diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c index c3fc5d258146..39e9eb162ed7 100644 --- a/arch/powerpc/platforms/powernv/opal-elog.c +++ b/arch/powerpc/platforms/powernv/opal-elog.c @@ -190,7 +190,7 @@ static void create_elog_obj(uint64_t id, size_t size, uint64_t type) struct elog_obj *elog; int rc; - elog = kzalloc(sizeof(*elog), GFP_KERNEL); + elog = kzalloc_obj(*elog, GFP_KERNEL); if (!elog) return; diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c index f0c1830deb51..182719995d05 100644 --- a/arch/powerpc/platforms/powernv/opal-hmi.c +++ b/arch/powerpc/platforms/powernv/opal-hmi.c @@ -342,7 +342,7 @@ static int opal_handle_hmi_event(struct notifier_block *nb, hmi_evt = (struct OpalHMIEvent *)&hmi_msg->params[0]; /* Delay the logging of HMI events to workqueue. */ - msg_node = kzalloc(sizeof(*msg_node), GFP_ATOMIC); + msg_node = kzalloc_obj(*msg_node, GFP_ATOMIC); if (!msg_node) { pr_err("HMI: out of memory, Opal message event not handled\n"); return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index 828fc4d88471..c57525c1fecd 100644 --- a/arch/powerpc/platforms/powernv/opal-imc.c +++ b/arch/powerpc/platforms/powernv/opal-imc.c @@ -108,8 +108,8 @@ static int imc_get_mem_addr_nest(struct device_node *node, nr_chips)) goto error; - pmu_ptr->mem_info = kcalloc(nr_chips + 1, sizeof(*pmu_ptr->mem_info), - GFP_KERNEL); + pmu_ptr->mem_info = kzalloc_objs(*pmu_ptr->mem_info, nr_chips + 1, + GFP_KERNEL); if (!pmu_ptr->mem_info) goto error; @@ -146,7 +146,7 @@ static struct imc_pmu *imc_pmu_create(struct device_node *parent, int pmu_index, return NULL; /* memory for pmu */ - pmu_ptr = kzalloc(sizeof(*pmu_ptr), GFP_KERNEL); + pmu_ptr = kzalloc_obj(*pmu_ptr, GFP_KERNEL); if (!pmu_ptr) return NULL; diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c index e180bd8e1400..7cf5cae6ef42 100644 --- a/arch/powerpc/platforms/powernv/opal-irqchip.c +++ b/arch/powerpc/platforms/powernv/opal-irqchip.c @@ -221,7 +221,7 @@ int __init opal_event_init(void) opal_irq_count, old_style ? "old" : "new"); /* Allocate an IRQ resources array */ - opal_irqs = kcalloc(opal_irq_count, sizeof(struct resource), GFP_KERNEL); + opal_irqs = kzalloc_objs(struct resource, opal_irq_count, GFP_KERNEL); if (WARN_ON(!opal_irqs)) { rc = -ENOMEM; goto out; diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c index 8a7f39e106bd..c41ca500669d 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c @@ -355,7 +355,7 @@ static int opal_lpc_debugfs_create_type(struct dentry *folder, enum OpalLPCAddressType type) { struct lpc_debugfs_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; entry->lpc_type = type; diff --git a/arch/powerpc/platforms/powernv/opal-memory-errors.c b/arch/powerpc/platforms/powernv/opal-memory-errors.c index a1754a28265d..54815882d7c0 100644 --- a/arch/powerpc/platforms/powernv/opal-memory-errors.c +++ b/arch/powerpc/platforms/powernv/opal-memory-errors.c @@ -93,7 +93,7 @@ static int opal_memory_err_event(struct notifier_block *nb, if (msg_type != OPAL_MSG_MEM_ERR) return 0; - msg_node = kzalloc(sizeof(*msg_node), GFP_ATOMIC); + msg_node = kzalloc_obj(*msg_node, GFP_ATOMIC); if (!msg_node) { pr_err("MEMORY_ERROR: out of memory, Opal message event not" "handled\n"); diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c index ea917266aa17..d530ac77b0e2 100644 --- a/arch/powerpc/platforms/powernv/opal-powercap.c +++ b/arch/powerpc/platforms/powernv/opal-powercap.c @@ -150,8 +150,7 @@ void __init opal_powercap_init(void) return; } - pcaps = kcalloc(of_get_child_count(powercap), sizeof(*pcaps), - GFP_KERNEL); + pcaps = kzalloc_objs(*pcaps, of_get_child_count(powercap), GFP_KERNEL); if (!pcaps) goto out_put_powercap; @@ -182,13 +181,13 @@ void __init opal_powercap_init(void) has_cur = true; } - pcaps[i].pattrs = kcalloc(j, sizeof(struct powercap_attr), - GFP_KERNEL); + pcaps[i].pattrs = kzalloc_objs(struct powercap_attr, j, + GFP_KERNEL); if (!pcaps[i].pattrs) goto out_pcaps_pattrs; - pcaps[i].pg.attrs = kcalloc(j + 1, sizeof(struct attribute *), - GFP_KERNEL); + pcaps[i].pg.attrs = kzalloc_objs(struct attribute *, j + 1, + GFP_KERNEL); if (!pcaps[i].pg.attrs) { kfree(pcaps[i].pattrs); goto out_pcaps_pattrs; diff --git a/arch/powerpc/platforms/powernv/opal-psr.c b/arch/powerpc/platforms/powernv/opal-psr.c index 6441e17b6996..731d8b355343 100644 --- a/arch/powerpc/platforms/powernv/opal-psr.c +++ b/arch/powerpc/platforms/powernv/opal-psr.c @@ -132,8 +132,8 @@ void __init opal_psr_init(void) return; } - psr_attrs = kcalloc(of_get_child_count(psr), sizeof(*psr_attrs), - GFP_KERNEL); + psr_attrs = kzalloc_objs(*psr_attrs, of_get_child_count(psr), + GFP_KERNEL); if (!psr_attrs) goto out_put_psr; diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c index 9944376b115c..c91e48d773ff 100644 --- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c +++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c @@ -168,7 +168,7 @@ void __init opal_sensor_groups_init(void) return; } - sgs = kcalloc(of_get_child_count(sg), sizeof(*sgs), GFP_KERNEL); + sgs = kzalloc_objs(*sgs, of_get_child_count(sg), GFP_KERNEL); if (!sgs) goto out_sg_put; @@ -190,14 +190,13 @@ void __init opal_sensor_groups_init(void) if (!nr_attrs) continue; - sgs[i].sgattrs = kcalloc(nr_attrs, sizeof(*sgs[i].sgattrs), - GFP_KERNEL); + sgs[i].sgattrs = kzalloc_objs(*sgs[i].sgattrs, nr_attrs, + GFP_KERNEL); if (!sgs[i].sgattrs) goto out_sgs_sgattrs; - sgs[i].sg.attrs = kcalloc(nr_attrs + 1, - sizeof(*sgs[i].sg.attrs), - GFP_KERNEL); + sgs[i].sg.attrs = kzalloc_objs(*sgs[i].sg.attrs, nr_attrs + 1, + GFP_KERNEL); if (!sgs[i].sg.attrs) { kfree(sgs[i].sgattrs); diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c index a12312afe4ef..358d1b8a3e86 100644 --- a/arch/powerpc/platforms/powernv/opal-sysparam.c +++ b/arch/powerpc/platforms/powernv/opal-sysparam.c @@ -222,7 +222,7 @@ void __init opal_sys_param_init(void) goto out_free_perm; } - attr = kcalloc(count, sizeof(*attr), GFP_KERNEL); + attr = kzalloc_objs(*attr, count, GFP_KERNEL); if (!attr) { pr_err("SYSPARAM: Failed to allocate memory for parameter " "attributes\n"); diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 748c2b97fa53..bd788d62af5f 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c @@ -158,7 +158,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, struct scom_debug_entry *ent; struct dentry *dir; - ent = kzalloc(sizeof(*ent), GFP_KERNEL); + ent = kzalloc_obj(*ent, GFP_KERNEL); if (!ent) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 09bd93464b4f..b1b1d3496739 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -251,7 +251,7 @@ static void queue_replay_msg(void *msg) struct opal_msg_node *msg_node; if (msg_list_size < OPAL_MSG_QUEUE_MAX) { - msg_node = kzalloc(sizeof(*msg_node), GFP_ATOMIC); + msg_node = kzalloc_obj(*msg_node, GFP_ATOMIC); if (msg_node) { INIT_LIST_HEAD(&msg_node->list); memcpy(&msg_node->msg, msg, sizeof(struct opal_msg)); @@ -801,7 +801,7 @@ static int opal_add_one_export(struct kobject *parent, const char *export_name, if (rc) goto out; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) { rc = -ENOMEM; goto out; diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 1c78fdfb7b03..d77ff328eb37 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -2522,7 +2522,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, phb_id = be64_to_cpup(prop64); pr_debug(" PHB-ID : 0x%016llx\n", phb_id); - phb = kzalloc(sizeof(*phb), GFP_KERNEL); + phb = kzalloc_obj(*phb, GFP_KERNEL); if (!phb) panic("%s: Failed to allocate %zu bytes\n", __func__, sizeof(*phb)); diff --git a/arch/powerpc/platforms/powernv/pci-sriov.c b/arch/powerpc/platforms/powernv/pci-sriov.c index cc7b1dd54ac6..f1a8fcfdb2ba 100644 --- a/arch/powerpc/platforms/powernv/pci-sriov.c +++ b/arch/powerpc/platforms/powernv/pci-sriov.c @@ -149,7 +149,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) struct pnv_iov_data *iov; int mul; - iov = kzalloc(sizeof(*iov), GFP_KERNEL); + iov = kzalloc_obj(*iov, GFP_KERNEL); if (!iov) goto disable_iov; pdev->dev.archdata.iov_data = iov; diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c index 196aa70fe043..6034f2cdcaf2 100644 --- a/arch/powerpc/platforms/powernv/rng.c +++ b/arch/powerpc/platforms/powernv/rng.c @@ -120,7 +120,7 @@ static __init int rng_create(struct device_node *dn) struct resource res; unsigned long val; - rng = kzalloc(sizeof(*rng), GFP_KERNEL); + rng = kzalloc_obj(*rng, GFP_KERNEL); if (!rng) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c index 5147df3a18ac..06748e0d5c32 100644 --- a/arch/powerpc/platforms/powernv/vas-window.c +++ b/arch/powerpc/platforms/powernv/vas-window.c @@ -543,7 +543,7 @@ static struct pnv_vas_window *vas_window_alloc(struct vas_instance *vinst) if (winid < 0) return ERR_PTR(winid); - window = kzalloc(sizeof(*window), GFP_KERNEL); + window = kzalloc_obj(*window, GFP_KERNEL); if (!window) goto out_free; diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c index 9c9650319f3b..ca3553003b7c 100644 --- a/arch/powerpc/platforms/powernv/vas.c +++ b/arch/powerpc/platforms/powernv/vas.c @@ -74,7 +74,7 @@ static int init_vas_instance(struct platform_device *pdev) return -ENODEV; } - vinst = kzalloc(sizeof(*vinst), GFP_KERNEL); + vinst = kzalloc_obj(*vinst, GFP_KERNEL); if (!vinst) return -ENOMEM; diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 22d91ac424dd..74e7fb0adcdb 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -31,7 +31,7 @@ static int __init ps3_register_lpm_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -126,7 +126,7 @@ static int __init ps3_setup_gelic_device( BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB); BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_GELIC); - p = kzalloc(sizeof(struct layout), GFP_KERNEL); + p = kzalloc_obj(struct layout, GFP_KERNEL); if (!p) { result = -ENOMEM; @@ -197,7 +197,7 @@ static int __init ps3_setup_uhc_device( BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB); BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_USB); - p = kzalloc(sizeof(struct layout), GFP_KERNEL); + p = kzalloc_obj(struct layout, GFP_KERNEL); if (!p) { result = -ENOMEM; @@ -294,7 +294,7 @@ static int __init ps3_setup_vuart_device(enum ps3_match_id match_id, pr_debug(" -> %s:%d: match_id %u, port %u\n", __func__, __LINE__, match_id, port_number); - p = kzalloc(sizeof(struct layout), GFP_KERNEL); + p = kzalloc_obj(struct layout, GFP_KERNEL); if (!p) return -ENOMEM; @@ -344,7 +344,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo, repo->dev_index, repo->dev_type, port, blk_size, num_blocks, num_regions); - p = kzalloc(struct_size(p, regions, num_regions), GFP_KERNEL); + p = kzalloc_flex(*p, regions, num_regions, GFP_KERNEL); if (!p) { result = -ENOMEM; goto fail_malloc; @@ -447,7 +447,7 @@ static int __init ps3_register_sound_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; @@ -481,7 +481,7 @@ static int __init ps3_register_graphics_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc(sizeof(struct layout), GFP_KERNEL); + p = kzalloc_obj(struct layout, GFP_KERNEL); if (!p) return -ENOMEM; @@ -516,7 +516,7 @@ static int __init ps3_register_ramdisk_device(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc(sizeof(struct layout), GFP_KERNEL); + p = kzalloc_obj(struct layout, GFP_KERNEL); if (!p) return -ENOMEM; @@ -783,7 +783,7 @@ static int ps3_probe_thread(void *data) pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__); - local = kzalloc(sizeof(*local), GFP_KERNEL); + local = kzalloc_obj(*local, GFP_KERNEL); if (!local) return -ENOMEM; diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 1326de55fda6..20fc5b68faee 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c @@ -516,7 +516,7 @@ static int dma_sb_map_pages(struct ps3_dma_region *r, unsigned long phys_addr, int result; struct dma_chunk *c; - c = kzalloc(sizeof(*c), GFP_ATOMIC); + c = kzalloc_obj(*c, GFP_ATOMIC); if (!c) { result = -ENOMEM; goto fail_alloc; @@ -561,7 +561,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr, DBG(KERN_ERR "%s: phy=%#lx, lpar%#lx, len=%#lx\n", __func__, phys_addr, ps3_mm_phys_to_lpar(phys_addr), len); - c = kzalloc(sizeof(*c), GFP_ATOMIC); + c = kzalloc_obj(*c, GFP_ATOMIC); if (!c) { result = -ENOMEM; goto fail_alloc; diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c index 61b37c9400b2..cd4ff2032cb0 100644 --- a/arch/powerpc/platforms/ps3/spu.c +++ b/arch/powerpc/platforms/ps3/spu.c @@ -336,8 +336,7 @@ static int __init ps3_create_spu(struct spu *spu, void *data) pr_debug("%s:%d spu_%d\n", __func__, __LINE__, spu->number); - spu->pdata = kzalloc(sizeof(struct spu_pdata), - GFP_KERNEL); + spu->pdata = kzalloc_obj(struct spu_pdata, GFP_KERNEL); if (!spu->pdata) { result = -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 979487da6522..ea5e97f1f054 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -53,7 +53,7 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa) char *name; char *value; - prop = kzalloc(sizeof(*prop), GFP_KERNEL); + prop = kzalloc_obj(*prop, GFP_KERNEL); if (!prop) return NULL; @@ -80,7 +80,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa) struct device_node *dn; const char *name; - dn = kzalloc(sizeof(*dn), GFP_KERNEL); + dn = kzalloc_obj(*dn, GFP_KERNEL); if (!dn) return NULL; @@ -633,7 +633,7 @@ void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog) if (!hp_errlog_copy) return; - work = kmalloc(sizeof(struct pseries_hp_work), GFP_ATOMIC); + work = kmalloc_obj(struct pseries_hp_work, GFP_ATOMIC); if (work) { INIT_WORK((struct work_struct *)work, pseries_hp_work_fn); work->errlog = hp_errlog_copy; diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 38dc4f7c9296..a040d34c4e40 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -33,7 +33,7 @@ static struct property *dlpar_clone_property(struct property *prop, { struct property *new_prop; - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); if (!new_prop) return NULL; diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c index d48c9c7ce10f..80e310a45f14 100644 --- a/arch/powerpc/platforms/pseries/hvcserver.c +++ b/arch/powerpc/platforms/pseries/hvcserver.c @@ -160,8 +160,8 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head, /* This is a very small struct and will be freed soon in * hvcs_free_partner_info(). */ - next_partner_info = kmalloc(sizeof(struct hvcs_partner_info), - GFP_ATOMIC); + next_partner_info = kmalloc_obj(struct hvcs_partner_info, + GFP_ATOMIC); if (!next_partner_info) { printk(KERN_WARNING "HVCONSOLE: kmalloc() failed to" diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 5497b130e026..27de08d8fa15 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -1000,7 +1000,7 @@ static void copy_property(struct device_node *pdn, const char *from, const char if (!src) return; - dst = kzalloc(sizeof(*dst), GFP_KERNEL); + dst = kzalloc_obj(*dst, GFP_KERNEL); if (!dst) return; @@ -1089,7 +1089,7 @@ static struct dma_win *ddw_list_new_entry(struct device_node *pdn, { struct dma_win *window; - window = kzalloc(sizeof(*window), GFP_KERNEL); + window = kzalloc_obj(*window, GFP_KERNEL); if (!window) return NULL; @@ -1409,12 +1409,12 @@ static struct property *ddw_property_create(const char *propname, u32 liobn, u64 struct dynamic_dma_window_prop *ddwprop; struct property *win64; - win64 = kzalloc(sizeof(*win64), GFP_KERNEL); + win64 = kzalloc_obj(*win64, GFP_KERNEL); if (!win64) return NULL; win64->name = kstrdup(propname, GFP_KERNEL); - ddwprop = kzalloc(sizeof(*ddwprop), GFP_KERNEL); + ddwprop = kzalloc_obj(*ddwprop, GFP_KERNEL); win64->value = ddwprop; win64->length = sizeof(*ddwprop); if (!win64->name || !win64->value) { @@ -1760,7 +1760,7 @@ out_failed: if (default_win_removed || limited_addr_enabled) reset_dma_window(dev, pdn); - fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; @@ -2235,7 +2235,7 @@ remove_window: __remove_dma_window(pdn, ddw_avail, create.liobn); out_failed: - fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; @@ -2322,7 +2322,7 @@ static long spapr_tce_unset_window(struct iommu_table_group *table_group, int nu goto out_unlock; out_failed: - fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c index 6554537984fb..bf6f9789167f 100644 --- a/arch/powerpc/platforms/pseries/lparcfg.c +++ b/arch/powerpc/platforms/pseries/lparcfg.c @@ -146,7 +146,7 @@ static void show_gpci_data(struct seq_file *m) unsigned int affinity_score; long ret; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (buf == NULL) return; diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 95fe802ccdfd..892f59c41d83 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -146,7 +146,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, new_prop->value = new_data; new_prop->length += vd; } else { - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); if (!new_prop) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 4cd70a8201f1..3bc617a96671 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -441,7 +441,7 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev int ret; struct pseries_msi_device *pseries_dev __free(kfree) - = kmalloc(sizeof(*pseries_dev), GFP_KERNEL); + = kmalloc_obj(*pseries_dev, GFP_KERNEL); if (!pseries_dev) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/papr-hvpipe.c b/arch/powerpc/platforms/pseries/papr-hvpipe.c index dd7b668799d9..14ae480d060a 100644 --- a/arch/powerpc/platforms/pseries/papr-hvpipe.c +++ b/arch/powerpc/platforms/pseries/papr-hvpipe.c @@ -495,7 +495,7 @@ static int papr_hvpipe_dev_create_handle(u32 srcID) } spin_unlock(&hvpipe_src_list_lock); - src_info = kzalloc(sizeof(*src_info), GFP_KERNEL_ACCOUNT); + src_info = kzalloc_obj(*src_info, GFP_KERNEL_ACCOUNT); if (!src_info) return -ENOMEM; @@ -762,7 +762,7 @@ static int __init papr_hvpipe_init(void) !rtas_function_implemented(RTAS_FN_IBM_RECEIVE_HVPIPE_MSG)) return -ENODEV; - papr_hvpipe_work = kzalloc(sizeof(struct work_struct), GFP_ATOMIC); + papr_hvpipe_work = kzalloc_obj(struct work_struct, GFP_ATOMIC); if (!papr_hvpipe_work) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/papr-phy-attest.c b/arch/powerpc/platforms/pseries/papr-phy-attest.c index 1907f2411567..20a0e1581302 100644 --- a/arch/powerpc/platforms/pseries/papr-phy-attest.c +++ b/arch/powerpc/platforms/pseries/papr-phy-attest.c @@ -225,7 +225,7 @@ static long papr_phy_attest_create_handle(struct papr_phy_attest_io_block __user /* * Freed in phy_attest_sequence_end(). */ - params = kzalloc(sizeof(*params), GFP_KERNEL_ACCOUNT); + params = kzalloc_obj(*params, GFP_KERNEL_ACCOUNT); if (!params) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/papr-platform-dump.c b/arch/powerpc/platforms/pseries/papr-platform-dump.c index be633c9a0e75..fb7ea84bf98a 100644 --- a/arch/powerpc/platforms/pseries/papr-platform-dump.c +++ b/arch/powerpc/platforms/pseries/papr-platform-dump.c @@ -321,8 +321,8 @@ static long papr_platform_dump_create_handle(u64 dump_tag) } } - params = kzalloc(sizeof(struct ibm_platform_dump_params), - GFP_KERNEL_ACCOUNT); + params = kzalloc_obj(struct ibm_platform_dump_params, + GFP_KERNEL_ACCOUNT); if (!params) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/papr-rtas-common.c b/arch/powerpc/platforms/pseries/papr-rtas-common.c index 1630e0cd210c..6bf4d1f15000 100644 --- a/arch/powerpc/platforms/pseries/papr-rtas-common.c +++ b/arch/powerpc/platforms/pseries/papr-rtas-common.c @@ -83,7 +83,7 @@ papr_rtas_blob_generate(struct papr_rtas_sequence *seq) size_t len; int err = 0; - blob = kzalloc(sizeof(*blob), GFP_KERNEL_ACCOUNT); + blob = kzalloc_obj(*blob, GFP_KERNEL_ACCOUNT); if (!blob) return NULL; diff --git a/arch/powerpc/platforms/pseries/papr-sysparm.c b/arch/powerpc/platforms/pseries/papr-sysparm.c index 7063ce8884e4..7974750ab868 100644 --- a/arch/powerpc/platforms/pseries/papr-sysparm.c +++ b/arch/powerpc/platforms/pseries/papr-sysparm.c @@ -19,7 +19,7 @@ struct papr_sysparm_buf *papr_sysparm_buf_alloc(void) { - struct papr_sysparm_buf *buf = kzalloc(sizeof(*buf), GFP_KERNEL); + struct papr_sysparm_buf *buf = kzalloc_obj(*buf, GFP_KERNEL); return buf; } diff --git a/arch/powerpc/platforms/pseries/papr_platform_attributes.c b/arch/powerpc/platforms/pseries/papr_platform_attributes.c index eea2041b270b..a7821279661a 100644 --- a/arch/powerpc/platforms/pseries/papr_platform_attributes.c +++ b/arch/powerpc/platforms/pseries/papr_platform_attributes.c @@ -295,7 +295,7 @@ retry: goto out_free_esi_buf; } - papr_groups = kcalloc(num_attrs, sizeof(*papr_groups), GFP_KERNEL); + papr_groups = kzalloc_objs(*papr_groups, num_attrs, GFP_KERNEL); if (!papr_groups) goto out_free_esi_buf; @@ -313,9 +313,9 @@ retry: /* Allocate the groups before registering */ for (idx = 0; idx < num_attrs; idx++) { - papr_groups[idx].pg.attrs = kcalloc(KOBJ_MAX_ATTRS + 1, - sizeof(*papr_groups[idx].pg.attrs), - GFP_KERNEL); + papr_groups[idx].pg.attrs = kzalloc_objs(*papr_groups[idx].pg.attrs, + KOBJ_MAX_ATTRS + 1, + GFP_KERNEL); if (!papr_groups[idx].pg.attrs) goto out_pgattrs; diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index f7c9271bda58..5d41c0223f10 100644 --- a/arch/powerpc/platforms/pseries/papr_scm.c +++ b/arch/powerpc/platforms/pseries/papr_scm.c @@ -445,7 +445,7 @@ static void papr_scm_pmu_register(struct papr_scm_priv *p) struct nvdimm_pmu *nd_pmu; int rc, nodeid; - nd_pmu = kzalloc(sizeof(*nd_pmu), GFP_KERNEL); + nd_pmu = kzalloc_obj(*nd_pmu, GFP_KERNEL); if (!nd_pmu) { rc = -ENOMEM; goto pmu_err_print; @@ -1398,7 +1398,7 @@ static int papr_scm_probe(struct platform_device *pdev) */ update_numa_distance(dn); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 6dbc73eb2ca2..8ce3f591a2b4 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c @@ -141,9 +141,7 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) } pdn = pci_get_pdn(pdev); - pdn->pe_num_map = kmalloc_array(num_vfs, - sizeof(*pdn->pe_num_map), - GFP_KERNEL); + pdn->pe_num_map = kmalloc_objs(*pdn->pe_num_map, num_vfs, GFP_KERNEL); if (!pdn->pe_num_map) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 599bd2c78514..38f4312f5210 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -25,7 +25,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist struct device_node *np; int err = -ENOMEM; - np = kzalloc(sizeof(*np), GFP_KERNEL); + np = kzalloc_obj(*np, GFP_KERNEL); if (!np) goto out_err; @@ -168,7 +168,7 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last) { - struct property *new = kzalloc(sizeof(*new), GFP_KERNEL); + struct property *new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c index 9e05a0e99cad..44ed41dd4b5f 100644 --- a/arch/powerpc/platforms/pseries/vas-sysfs.c +++ b/arch/powerpc/platforms/pseries/vas-sysfs.c @@ -202,7 +202,7 @@ int sysfs_add_vas_caps(struct vas_cop_feat_caps *caps) int ret = 0; char *name; - centry = kzalloc(sizeof(*centry), GFP_KERNEL); + centry = kzalloc_obj(*centry, GFP_KERNEL); if (!centry) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index c25eb1a38185..d8890b62197b 100644 --- a/arch/powerpc/platforms/pseries/vas.c +++ b/arch/powerpc/platforms/pseries/vas.c @@ -324,7 +324,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags, struct pseries_vas_window *txwin; int rc; - txwin = kzalloc(sizeof(*txwin), GFP_KERNEL); + txwin = kzalloc_obj(*txwin, GFP_KERNEL); if (!txwin) return ERR_PTR(-ENOMEM); @@ -1087,7 +1087,7 @@ static int __init pseries_vas_init(void) return -ENOTSUPP; } - hv_caps = kmalloc(sizeof(*hv_caps), GFP_KERNEL); + hv_caps = kmalloc_obj(*hv_caps, GFP_KERNEL); if (!hv_caps) return -ENOMEM; /* diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c index 18cffac5468f..4cb192cd5aa9 100644 --- a/arch/powerpc/platforms/pseries/vio.c +++ b/arch/powerpc/platforms/pseries/vio.c @@ -744,8 +744,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev) viodev->cmo.desired = VIO_CMO_MIN_ENT; size = VIO_CMO_MIN_ENT; - dev_ent = kmalloc(sizeof(struct vio_cmo_dev_entry), - GFP_KERNEL); + dev_ent = kmalloc_obj(struct vio_cmo_dev_entry, GFP_KERNEL); if (!dev_ent) return -ENOMEM; @@ -1165,7 +1164,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) if (!dma_window) return NULL; - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (tbl == NULL) return NULL; @@ -1376,7 +1375,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) } /* allocate a vio_dev for this node */ - viodev = kzalloc(sizeof(struct vio_dev), GFP_KERNEL); + viodev = kzalloc_obj(struct vio_dev, GFP_KERNEL); if (viodev == NULL) { pr_warn("%s: allocation failure for VIO device.\n", __func__); return NULL; diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c index b6f9774038e1..c4c61216b96a 100644 --- a/arch/powerpc/sysdev/ehv_pic.c +++ b/arch/powerpc/sysdev/ehv_pic.c @@ -263,7 +263,7 @@ void __init ehv_pic_init(void) return; } - ehv_pic = kzalloc(sizeof(struct ehv_pic), GFP_KERNEL); + ehv_pic = kzalloc_obj(struct ehv_pic, GFP_KERNEL); if (!ehv_pic) { of_node_put(np); return; diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index 3dabc9621810..fabf39586eba 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c @@ -382,7 +382,7 @@ static int __init fsl_gtm_init(void) const u32 *clock; int size; - gtm = kzalloc(sizeof(*gtm), GFP_KERNEL); + gtm = kzalloc_obj(*gtm, GFP_KERNEL); if (!gtm) { pr_err("%pOF: unable to allocate memory\n", np); diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c index 7ed07232a69a..01ddc6ac8277 100644 --- a/arch/powerpc/sysdev/fsl_lbc.c +++ b/arch/powerpc/sysdev/fsl_lbc.c @@ -283,7 +283,7 @@ static int fsl_lbc_ctrl_probe(struct platform_device *dev) return -EFAULT; } - fsl_lbc_ctrl_dev = kzalloc(sizeof(*fsl_lbc_ctrl_dev), GFP_KERNEL); + fsl_lbc_ctrl_dev = kzalloc_obj(*fsl_lbc_ctrl_dev, GFP_KERNEL); if (!fsl_lbc_ctrl_dev) return -ENOMEM; @@ -363,7 +363,7 @@ static int fsl_lbc_syscore_suspend(void *data) if (!lbc) goto out; - ctrl->saved_regs = kmalloc(sizeof(struct fsl_lbc_regs), GFP_KERNEL); + ctrl->saved_regs = kmalloc_obj(struct fsl_lbc_regs, GFP_KERNEL); if (!ctrl->saved_regs) return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c b/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c index 06d9101a5d49..43d6fba2bd42 100644 --- a/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c +++ b/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c @@ -111,7 +111,7 @@ static int __init fsl_wakeup_sys_init(void) struct device *dev_root; int ret = -EINVAL; - fsl_wakeup = kzalloc(sizeof(struct fsl_mpic_timer_wakeup), GFP_KERNEL); + fsl_wakeup = kzalloc_obj(struct fsl_mpic_timer_wakeup, GFP_KERNEL); if (!fsl_wakeup) return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 2a007bfb038d..525ea894c14a 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -361,7 +361,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev, return 0; } - cascade_data = kzalloc(sizeof(struct fsl_msi_cascade_data), GFP_KERNEL); + cascade_data = kzalloc_obj(struct fsl_msi_cascade_data, GFP_KERNEL); if (!cascade_data) { dev_err(&dev->dev, "No memory for MSI cascade data\n"); return -ENOMEM; @@ -405,7 +405,7 @@ static int fsl_of_msi_probe(struct platform_device *dev) printk(KERN_DEBUG "Setting up Freescale MSI support\n"); - msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL); + msi = kzalloc_obj(struct fsl_msi, GFP_KERNEL); if (!msi) { dev_err(&dev->dev, "No memory for MSI structure\n"); return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 4e501654cb41..0952b5ff8a16 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -767,7 +767,7 @@ static int __init mpc83xx_pcie_setup(struct pci_controller *hose, u32 cfg_bar; int ret = -ENOMEM; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return ret; diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index f9b214b299e7..249b876daaee 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -470,7 +470,7 @@ static int fsl_rio_setup(struct platform_device *dev) goto err_rio_regs; } - ops = kzalloc(sizeof(struct rio_ops), GFP_KERNEL); + ops = kzalloc_obj(struct rio_ops, GFP_KERNEL); if (!ops) { rc = -ENOMEM; goto err_ops; @@ -517,7 +517,7 @@ static int fsl_rio_setup(struct platform_device *dev) rc = -ENODEV; goto err_dbell; } - dbell = kzalloc(sizeof(struct fsl_rio_dbell), GFP_KERNEL); + dbell = kzalloc_obj(struct fsl_rio_dbell, GFP_KERNEL); if (!(dbell)) { dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_dbell'\n"); rc = -ENOMEM; @@ -543,7 +543,7 @@ static int fsl_rio_setup(struct platform_device *dev) rc = -ENODEV; goto err_pw; } - pw = kzalloc(sizeof(struct fsl_rio_pw), GFP_KERNEL); + pw = kzalloc_obj(struct fsl_rio_pw, GFP_KERNEL); if (!(pw)) { dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_pw'\n"); rc = -ENOMEM; @@ -580,7 +580,7 @@ static int fsl_rio_setup(struct platform_device *dev) dev_info(&dev->dev, "%pOF: LAW %pR\n", np, &res); - port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); + port = kzalloc_obj(struct rio_mport, GFP_KERNEL); if (!port) continue; @@ -593,7 +593,7 @@ static int fsl_rio_setup(struct platform_device *dev) i = *port_index - 1; port->index = (unsigned char)i; - priv = kzalloc(sizeof(struct rio_priv), GFP_KERNEL); + priv = kzalloc_obj(struct rio_priv, GFP_KERNEL); if (!priv) { dev_err(&dev->dev, "Can't alloc memory for 'priv'\n"); kfree(port); diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index f956591cb64e..c0e358cf7822 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -1079,7 +1079,7 @@ int fsl_rio_setup_rmu(struct rio_mport *mport, struct device_node *node) return -EINVAL; } - rmu = kzalloc(sizeof(struct fsl_rmu), GFP_KERNEL); + rmu = kzalloc_obj(struct fsl_rmu, GFP_KERNEL); if (!rmu) return -ENOMEM; diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 290ba8427239..2351604cc24a 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c @@ -707,7 +707,7 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) if (ret) return NULL; - ipic = kzalloc(sizeof(*ipic), GFP_KERNEL); + ipic = kzalloc_obj(*ipic, GFP_KERNEL); if (ipic == NULL) return NULL; diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 67e51998d1ae..cb4cdd853cc8 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -547,7 +547,7 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n"); /* Allocate fixups array */ - mpic->fixups = kcalloc(128, sizeof(*mpic->fixups), GFP_KERNEL); + mpic->fixups = kzalloc_objs(*mpic->fixups, 128, GFP_KERNEL); BUG_ON(mpic->fixups == NULL); /* Init spinlock */ @@ -1273,7 +1273,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, mpic_tm_chip.flags |= IRQCHIP_SKIP_SET_WAKE; } - mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); + mpic = kzalloc_obj(struct mpic, GFP_KERNEL); if (mpic == NULL) goto err_of_node_put; @@ -1639,9 +1639,8 @@ void __init mpic_init(struct mpic *mpic) #ifdef CONFIG_PM /* allocate memory to save mpic state */ - mpic->save_data = kmalloc_array(mpic->num_sources, - sizeof(*mpic->save_data), - GFP_KERNEL); + mpic->save_data = kmalloc_objs(*mpic->save_data, mpic->num_sources, + GFP_KERNEL); BUG_ON(mpic->save_data == NULL); #endif diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index 7b449cc51aef..8b1c02f5b1b3 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -188,8 +188,8 @@ static int mpic_msgr_probe(struct platform_device *dev) dev_info(&dev->dev, "Found %d message registers\n", mpic_msgr_count); - mpic_msgrs = kcalloc(mpic_msgr_count, sizeof(*mpic_msgrs), - GFP_KERNEL); + mpic_msgrs = kzalloc_objs(*mpic_msgrs, mpic_msgr_count, + GFP_KERNEL); if (!mpic_msgrs) { dev_err(&dev->dev, "No memory for message register blocks\n"); @@ -227,7 +227,7 @@ static int mpic_msgr_probe(struct platform_device *dev) struct mpic_msgr *msgr; unsigned int reg_number; - msgr = kzalloc(sizeof(struct mpic_msgr), GFP_KERNEL); + msgr = kzalloc_obj(struct mpic_msgr, GFP_KERNEL); if (!msgr) { dev_err(&dev->dev, "No memory for message register\n"); return -ENOMEM; diff --git a/arch/powerpc/sysdev/mpic_timer.c b/arch/powerpc/sysdev/mpic_timer.c index 60f5b3934b51..7b237b6f7151 100644 --- a/arch/powerpc/sysdev/mpic_timer.c +++ b/arch/powerpc/sysdev/mpic_timer.c @@ -464,7 +464,7 @@ static void __init timer_group_init(struct device_node *np) unsigned int i = 0; int ret; - priv = kzalloc(sizeof(struct timer_group_priv), GFP_KERNEL); + priv = kzalloc_obj(struct timer_group_priv, GFP_KERNEL); if (!priv) { pr_err("%pOF: cannot allocate memory for group.\n", np); return; diff --git a/arch/powerpc/sysdev/of_rtc.c b/arch/powerpc/sysdev/of_rtc.c index 2211937d3788..6c2ba4c44b11 100644 --- a/arch/powerpc/sysdev/of_rtc.c +++ b/arch/powerpc/sysdev/of_rtc.c @@ -33,7 +33,7 @@ void __init of_instantiate_rtc(void) of_rtc_table[i].compatible) { struct resource *res; - res = kmalloc(sizeof(*res), GFP_KERNEL); + res = kmalloc_obj(*res, GFP_KERNEL); if (!res) { printk(KERN_ERR "OF RTC: Out of memory " "allocating resource structure for %pOF\n", diff --git a/arch/powerpc/sysdev/xics/ics-native.c b/arch/powerpc/sysdev/xics/ics-native.c index 112c8a1e8159..50634a0ae478 100644 --- a/arch/powerpc/sysdev/xics/ics-native.c +++ b/arch/powerpc/sysdev/xics/ics-native.c @@ -186,7 +186,7 @@ static int __init ics_native_add_one(struct device_node *np) u32 ranges[2]; int rc, count; - ics = kzalloc(sizeof(struct ics_native), GFP_KERNEL); + ics = kzalloc_obj(struct ics_native, GFP_KERNEL); if (!ics) return -ENOMEM; ics->node = of_node_get(np); diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 8d0123b0ae84..f0fbee162f47 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1016,7 +1016,7 @@ static struct xive_irq_data *xive_irq_alloc_data(unsigned int virq, irq_hw_numbe struct xive_irq_data *xd; int rc; - xd = kzalloc(sizeof(struct xive_irq_data), GFP_KERNEL); + xd = kzalloc_obj(struct xive_irq_data, GFP_KERNEL); if (!xd) return ERR_PTR(-ENOMEM); rc = xive_ops->populate_irq_data(hw, xd); @@ -1144,7 +1144,8 @@ static int __init xive_init_ipis(void) if (!ipi_domain) goto out_free_fwnode; - xive_ipis = kcalloc(nr_node_ids, sizeof(*xive_ipis), GFP_KERNEL | __GFP_NOFAIL); + xive_ipis = kzalloc_objs(*xive_ipis, nr_node_ids, + GFP_KERNEL | __GFP_NOFAIL); if (!xive_ipis) goto out_free_domain; diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index 5aedbe3e8e6a..dca293f07303 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -52,7 +52,7 @@ static int __init xive_irq_bitmap_add(int base, int count) { struct xive_irq_bitmap *xibm; - xibm = kzalloc(sizeof(*xibm), GFP_KERNEL); + xibm = kzalloc_obj(*xibm, GFP_KERNEL); if (!xibm) return -ENOMEM; diff --git a/arch/riscv/kernel/hibernate.c b/arch/riscv/kernel/hibernate.c index 671b686c0158..0e31c02cb554 100644 --- a/arch/riscv/kernel/hibernate.c +++ b/arch/riscv/kernel/hibernate.c @@ -415,7 +415,7 @@ int hibernate_resume_nonboot_cpu_disable(void) static int __init riscv_hibernate_init(void) { - hibernate_cpu_context = kzalloc(sizeof(*hibernate_cpu_context), GFP_KERNEL); + hibernate_cpu_context = kzalloc_obj(*hibernate_cpu_context, GFP_KERNEL); if (WARN_ON(!hibernate_cpu_context)) return -ENOMEM; diff --git a/arch/riscv/kernel/machine_kexec_file.c b/arch/riscv/kernel/machine_kexec_file.c index dd9d92a96517..a780d3e0955c 100644 --- a/arch/riscv/kernel/machine_kexec_file.c +++ b/arch/riscv/kernel/machine_kexec_file.c @@ -64,7 +64,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) nr_ranges = 1; /* For exclusion of crashkernel region */ walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback); - cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL); + cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL); if (!cmem) return -ENOMEM; diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 7f6147c18033..addc7dac2424 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -663,7 +663,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, struct used_bucket *bucket; unsigned long hash; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -697,7 +697,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, * relocation_entry. */ if (!found) { - rel_head = kmalloc(sizeof(*rel_head), GFP_KERNEL); + rel_head = kmalloc_obj(*rel_head, GFP_KERNEL); if (!rel_head) { kfree(entry); @@ -709,7 +709,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, INIT_HLIST_NODE(&rel_head->node); if (!current_head->first) { bucket = - kmalloc(sizeof(struct used_bucket), GFP_KERNEL); + kmalloc_obj(struct used_bucket, GFP_KERNEL); if (!bucket) { kfree(entry); @@ -753,9 +753,8 @@ initialize_relocation_hashtable(unsigned int num_relocations, hashtable_size <<= should_double_size; /* Number of relocations may be large, so kvmalloc it */ - *relocation_hashtable = kvmalloc_array(hashtable_size, - sizeof(**relocation_hashtable), - GFP_KERNEL); + *relocation_hashtable = kvmalloc_objs(**relocation_hashtable, + hashtable_size, GFP_KERNEL); if (!*relocation_hashtable) return 0; diff --git a/arch/riscv/kernel/tests/kprobes/test-kprobes.c b/arch/riscv/kernel/tests/kprobes/test-kprobes.c index 664535ca0a98..c0526c0c7527 100644 --- a/arch/riscv/kernel/tests/kprobes/test-kprobes.c +++ b/arch/riscv/kernel/tests/kprobes/test-kprobes.c @@ -20,7 +20,7 @@ static void test_kprobe_riscv(struct kunit *test) while (test_kprobes_addresses[num_kprobe]) num_kprobe++; - kp = kcalloc(num_kprobe, sizeof(*kp), GFP_KERNEL); + kp = kzalloc_objs(*kp, num_kprobe, GFP_KERNEL); KUNIT_EXPECT_TRUE(test, kp); if (!kp) return; diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 70b5e6927620..63ed6e6b24eb 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -139,7 +139,7 @@ static void __init check_unaligned_access_speed_all_cpus(void) { unsigned int cpu; unsigned int cpu_count = num_possible_cpus(); - struct page **bufs = kcalloc(cpu_count, sizeof(*bufs), GFP_KERNEL); + struct page **bufs = kzalloc_objs(*bufs, cpu_count, GFP_KERNEL); if (!bufs) { pr_warn("Allocation failure, not measuring misaligned performance\n"); diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index 43f70198ac3c..7e3749131c59 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -55,9 +55,8 @@ static void __init __vdso_init(struct __vdso_info *vdso_info) vdso_info->vdso_code_start) >> PAGE_SHIFT; - vdso_pagelist = kcalloc(vdso_info->vdso_pages, - sizeof(struct page *), - GFP_KERNEL); + vdso_pagelist = kzalloc_objs(struct page *, vdso_info->vdso_pages, + GFP_KERNEL); if (vdso_pagelist == NULL) panic("vDSO kcalloc failed!\n"); diff --git a/arch/riscv/kvm/aia_aplic.c b/arch/riscv/kvm/aia_aplic.c index f59d1c0c8c43..25d9c2a3a85a 100644 --- a/arch/riscv/kvm/aia_aplic.c +++ b/arch/riscv/kvm/aia_aplic.c @@ -580,7 +580,7 @@ int kvm_riscv_aia_aplic_init(struct kvm *kvm) return 0; /* Allocate APLIC global state */ - aplic = kzalloc(sizeof(*aplic), GFP_KERNEL); + aplic = kzalloc_obj(*aplic, GFP_KERNEL); if (!aplic) return -ENOMEM; kvm->arch.aia.aplic_state = aplic; @@ -588,8 +588,7 @@ int kvm_riscv_aia_aplic_init(struct kvm *kvm) /* Setup APLIC IRQs */ aplic->nr_irqs = kvm->arch.aia.nr_sources + 1; aplic->nr_words = DIV_ROUND_UP(aplic->nr_irqs, 32); - aplic->irqs = kcalloc(aplic->nr_irqs, - sizeof(*aplic->irqs), GFP_KERNEL); + aplic->irqs = kzalloc_objs(*aplic->irqs, aplic->nr_irqs, GFP_KERNEL); if (!aplic->irqs) { ret = -ENOMEM; goto fail_free_aplic; diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index 60da5fa155a6..aafa19629524 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -1095,7 +1095,7 @@ int kvm_riscv_vcpu_aia_imsic_init(struct kvm_vcpu *vcpu) return -EINVAL; /* Allocate IMSIC context */ - imsic = kzalloc(sizeof(*imsic), GFP_KERNEL); + imsic = kzalloc_obj(*imsic, GFP_KERNEL); if (!imsic) return -ENOMEM; vcpu->arch.aia_context.imsic_state = imsic; diff --git a/arch/riscv/kvm/vcpu_sbi_fwft.c b/arch/riscv/kvm/vcpu_sbi_fwft.c index 62cc9c3d5759..14cea431b863 100644 --- a/arch/riscv/kvm/vcpu_sbi_fwft.c +++ b/arch/riscv/kvm/vcpu_sbi_fwft.c @@ -352,8 +352,8 @@ static int kvm_sbi_ext_fwft_init(struct kvm_vcpu *vcpu) struct kvm_sbi_fwft_config *conf; int i; - fwft->configs = kcalloc(ARRAY_SIZE(features), sizeof(struct kvm_sbi_fwft_config), - GFP_KERNEL); + fwft->configs = kzalloc_objs(struct kvm_sbi_fwft_config, + ARRAY_SIZE(features), GFP_KERNEL); if (!fwft->configs) return -ENOMEM; diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c index 66d91ae6e9b2..ca3da58dc968 100644 --- a/arch/riscv/kvm/vm.c +++ b/arch/riscv/kvm/vm.c @@ -95,7 +95,7 @@ int kvm_riscv_setup_default_irq_routing(struct kvm *kvm, u32 lines) struct kvm_irq_routing_entry *ents; int i, rc; - ents = kcalloc(lines, sizeof(*ents), GFP_KERNEL); + ents = kzalloc_objs(*ents, lines, GFP_KERNEL); if (!ents) return -ENOMEM; diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index f065b45e8d8f..4d1c2639a64f 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -1195,7 +1195,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, } if (fmod_ret->nr_links) { - branches_off = kcalloc(fmod_ret->nr_links, sizeof(int), GFP_KERNEL); + branches_off = kzalloc_objs(int, fmod_ret->nr_links, GFP_KERNEL); if (!branches_off) return -ENOMEM; diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c index f6ca5cfa6b2f..af48c94e300a 100644 --- a/arch/riscv/net/bpf_jit_core.c +++ b/arch/riscv/net/bpf_jit_core.c @@ -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(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { prog = orig_prog; goto out; @@ -82,7 +82,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) ctx->arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena); ctx->user_vm_start = bpf_arena_get_user_vm_start(prog->aux->arena); ctx->prog = prog; - ctx->offset = kcalloc(prog->len, sizeof(int), GFP_KERNEL); + ctx->offset = kzalloc_objs(int, prog->len, GFP_KERNEL); if (!ctx->offset) { prog = orig_prog; goto out_offset; diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index feb43db63f30..0d6725fd881e 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -140,7 +140,7 @@ int appldata_diag(char record_nr, u16 function, unsigned long buffer, struct appldata_product_id *id; int rc; - parm_list = kmalloc(sizeof(*parm_list), GFP_KERNEL); + parm_list = kmalloc_obj(*parm_list, GFP_KERNEL); id = kmemdup(&appldata_id, sizeof(appldata_id), GFP_KERNEL); rc = -ENOMEM; if (parm_list && id) { @@ -350,7 +350,7 @@ int appldata_register_ops(struct appldata_ops *ops) if (ops->size > APPLDATA_MAX_REC_SIZE) return -EINVAL; - ops->ctl_table = kcalloc(1, sizeof(struct ctl_table), GFP_KERNEL); + ops->ctl_table = kzalloc_objs(struct ctl_table, 1, GFP_KERNEL); if (!ops->ctl_table) return -ENOMEM; diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index fc608f9b79ab..e24369ec3134 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c @@ -130,7 +130,7 @@ static int __init appldata_mem_init(void) { int ret; - ops.data = kzalloc(sizeof(struct appldata_mem_data), GFP_KERNEL); + ops.data = kzalloc_obj(struct appldata_mem_data, GFP_KERNEL); if (!ops.data) return -ENOMEM; diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index 59c282ca002f..3a0574f33664 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c @@ -132,7 +132,7 @@ static int __init appldata_net_init(void) { int ret; - ops.data = kzalloc(sizeof(struct appldata_net_sum_data), GFP_KERNEL); + ops.data = kzalloc_obj(struct appldata_net_sum_data, GFP_KERNEL); if (!ops.data) return -ENOMEM; diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c index 41a0d2066fa0..8002bdc692d6 100644 --- a/arch/s390/hypfs/hypfs_dbfs.c +++ b/arch/s390/hypfs/hypfs_dbfs.c @@ -16,7 +16,7 @@ static struct hypfs_dbfs_data *hypfs_dbfs_data_alloc(struct hypfs_dbfs_file *f) { struct hypfs_dbfs_data *data; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; data->dbfs_file = f; diff --git a/arch/s390/hypfs/hypfs_diag0c.c b/arch/s390/hypfs/hypfs_diag0c.c index 61220e717af0..5e27dc7a7569 100644 --- a/arch/s390/hypfs/hypfs_diag0c.c +++ b/arch/s390/hypfs/hypfs_diag0c.c @@ -35,13 +35,12 @@ static void *diag0c_store(unsigned int *count) cpus_read_lock(); cpu_count = num_online_cpus(); - cpu_vec = kmalloc_array(num_possible_cpus(), sizeof(*cpu_vec), - GFP_KERNEL); + cpu_vec = kmalloc_objs(*cpu_vec, num_possible_cpus(), GFP_KERNEL); if (!cpu_vec) goto fail_unlock_cpus; /* Note: Diag 0c needs 8 byte alignment and real storage */ - diag0c_data = kzalloc(struct_size(diag0c_data, entry, cpu_count), - GFP_KERNEL | GFP_DMA); + diag0c_data = kzalloc_flex(*diag0c_data, entry, cpu_count, + GFP_KERNEL | GFP_DMA); if (!diag0c_data) goto fail_kfree_cpu_vec; i = 0; diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c index a72576221cab..2e8847048dc1 100644 --- a/arch/s390/hypfs/hypfs_sprp.c +++ b/arch/s390/hypfs/hypfs_sprp.c @@ -74,7 +74,7 @@ static int __hypfs_sprp_ioctl(void __user *user_area) rc = -ENOMEM; data = (void *)get_zeroed_page(GFP_KERNEL); - diag304 = kzalloc(sizeof(*diag304), GFP_KERNEL); + diag304 = kzalloc_obj(*diag304, GFP_KERNEL); if (!data || !diag304) goto out; diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 3a47c2e24b6e..0f4a9113ec1a 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -292,7 +292,7 @@ static int hypfs_init_fs_context(struct fs_context *fc) { struct hypfs_sb_info *sbi; - sbi = kzalloc(sizeof(struct hypfs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct hypfs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h index e5000ee6cdc6..94de4ddf503f 100644 --- a/arch/s390/include/asm/idals.h +++ b/arch/s390/include/asm/idals.h @@ -94,7 +94,7 @@ static inline int set_normalized_cda(struct ccw1 *ccw, void *vaddr) return -EINVAL; nridaws = idal_nr_words(vaddr, ccw->count); if (nridaws > 0) { - idal = kcalloc(nridaws, sizeof(*idal), GFP_ATOMIC | GFP_DMA); + idal = kzalloc_objs(*idal, nridaws, GFP_ATOMIC | GFP_DMA); if (!idal) return -ENOMEM; idal_create_words(idal, vaddr, ccw->count); @@ -137,7 +137,7 @@ static inline struct idal_buffer *idal_buffer_alloc(size_t size, int page_order) nr_ptrs = (size + IDA_BLOCK_SIZE - 1) >> IDA_SIZE_SHIFT; nr_chunks = (PAGE_SIZE << page_order) >> IDA_SIZE_SHIFT; - ib = kmalloc(struct_size(ib, data, nr_ptrs), GFP_DMA | GFP_KERNEL); + ib = kmalloc_flex(*ib, data, nr_ptrs, GFP_DMA | GFP_KERNEL); if (!ib) return ERR_PTR(-ENOMEM); ib->size = size; @@ -195,7 +195,7 @@ static inline struct idal_buffer **idal_buffer_array_alloc(size_t size, int page int i; count = (size + CCW_MAX_BYTE_COUNT - 1) / CCW_MAX_BYTE_COUNT; - ibs = kmalloc_array(count + 1, sizeof(*ibs), GFP_KERNEL); + ibs = kmalloc_objs(*ibs, count + 1, GFP_KERNEL); for (i = 0; i < count; i++) { /* Determine size for the current idal buffer */ ib_size = min(size, CCW_MAX_BYTE_COUNT); diff --git a/arch/s390/kernel/cert_store.c b/arch/s390/kernel/cert_store.c index c217a5e64094..8e3964c33ebb 100644 --- a/arch/s390/kernel/cert_store.c +++ b/arch/s390/kernel/cert_store.c @@ -322,7 +322,7 @@ static int invalidate_keyring_keys(struct key *keyring) keyring_payload_len = key_type_keyring.read(keyring, NULL, 0); num_keys = keyring_payload_len / sizeof(key_serial_t); - key_array = kcalloc(num_keys, sizeof(key_serial_t), GFP_KERNEL); + key_array = kzalloc_objs(key_serial_t, num_keys, GFP_KERNEL); if (!key_array) return -ENOMEM; diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index e722243841f8..a917b4c899ef 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -181,14 +181,13 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas) debug_entry_t ***areas; int i, j; - areas = kmalloc_array(nr_areas, sizeof(debug_entry_t **), GFP_KERNEL); + areas = kmalloc_objs(debug_entry_t **, nr_areas, GFP_KERNEL); if (!areas) goto fail_malloc_areas; for (i = 0; i < nr_areas; i++) { /* GFP_NOWARN to avoid user triggerable WARN, we handle fails */ - areas[i] = kmalloc_array(pages_per_area, - sizeof(debug_entry_t *), - GFP_KERNEL | __GFP_NOWARN); + areas[i] = kmalloc_objs(debug_entry_t *, pages_per_area, + GFP_KERNEL | __GFP_NOWARN); if (!areas[i]) goto fail_malloc_areas2; for (j = 0; j < pages_per_area; j++) { @@ -225,13 +224,13 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area, debug_info_t *rc; /* alloc everything */ - rc = kmalloc(sizeof(debug_info_t), GFP_KERNEL); + rc = kmalloc_obj(debug_info_t, GFP_KERNEL); if (!rc) goto fail_malloc_rc; - rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL); + rc->active_entries = kzalloc_objs(int, nr_areas, GFP_KERNEL); if (!rc->active_entries) goto fail_malloc_active_entries; - rc->active_pages = kcalloc(nr_areas, sizeof(int), GFP_KERNEL); + rc->active_pages = kzalloc_objs(int, nr_areas, GFP_KERNEL); if (!rc->active_pages) goto fail_malloc_active_pages; if ((mode == ALL_AREAS) && (pages_per_area != 0)) { @@ -631,7 +630,7 @@ static file_private_info_t *debug_file_private_alloc(debug_info_t *debug_info, if (!debug_info_snapshot) return NULL; - p_info = kmalloc(sizeof(file_private_info_t), GFP_KERNEL); + p_info = kmalloc_obj(file_private_info_t, GFP_KERNEL); if (!p_info) { debug_info_free(debug_info_snapshot); return NULL; diff --git a/arch/s390/kernel/guarded_storage.c b/arch/s390/kernel/guarded_storage.c index cf26d7a37425..4d4101f19e3c 100644 --- a/arch/s390/kernel/guarded_storage.c +++ b/arch/s390/kernel/guarded_storage.c @@ -24,7 +24,7 @@ static int gs_enable(void) struct gs_cb *gs_cb; if (!current->thread.gs_cb) { - gs_cb = kzalloc(sizeof(*gs_cb), GFP_KERNEL); + gs_cb = kzalloc_obj(*gs_cb, GFP_KERNEL); if (!gs_cb) return -ENOMEM; gs_cb->gsd = 25; @@ -55,7 +55,7 @@ static int gs_set_bc_cb(struct gs_cb __user *u_gs_cb) gs_cb = current->thread.gs_bc_cb; if (!gs_cb) { - gs_cb = kzalloc(sizeof(*gs_cb), GFP_KERNEL); + gs_cb = kzalloc_obj(*gs_cb, GFP_KERNEL); if (!gs_cb) return -ENOMEM; current->thread.gs_bc_cb = gs_cb; diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index bdf9c7cb5685..f81723bc8856 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -312,7 +312,7 @@ int register_external_irq(u16 code, ext_int_handler_t handler) unsigned long flags; int index; - p = kmalloc(sizeof(*p), GFP_ATOMIC); + p = kmalloc_obj(*p, GFP_ATOMIC); if (!p) return -ENOMEM; p->code = code; diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c index 94fa44776d0c..37ab1c671b4d 100644 --- a/arch/s390/kernel/os_info.c +++ b/arch/s390/kernel/os_info.c @@ -154,7 +154,7 @@ static void os_info_old_init(void) goto fail; if (addr == 0 || addr % PAGE_SIZE) goto fail; - os_info_old = kzalloc(sizeof(*os_info_old), GFP_KERNEL); + os_info_old = kzalloc_obj(*os_info_old, GFP_KERNEL); if (!os_info_old) goto fail; if (copy_oldmem_kernel(os_info_old, addr, sizeof(*os_info_old))) diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 408ab93112bf..0c4074e717d4 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -252,7 +252,7 @@ static int cpum_cf_alloc_cpu(int cpu) cpuhw = p->cpucf; if (!cpuhw) { - cpuhw = kzalloc(sizeof(*cpuhw), GFP_KERNEL); + cpuhw = kzalloc_obj(*cpuhw, GFP_KERNEL); if (cpuhw) { p->cpucf = cpuhw; refcount_set(&cpuhw->refcnt, 1); @@ -1616,7 +1616,7 @@ static long cfset_ioctl_start(unsigned long arg, struct file *file) if (!start.counter_sets) return -EINVAL; /* No counter set at all? */ - preq = kzalloc(sizeof(*preq), GFP_KERNEL); + preq = kzalloc_obj(*preq, GFP_KERNEL); if (!preq) return -ENOMEM; cpumask_clear(&preq->mask); diff --git a/arch/s390/kernel/perf_cpum_cf_events.c b/arch/s390/kernel/perf_cpum_cf_events.c index 7ace1f9e4ccf..eb067beb5c51 100644 --- a/arch/s390/kernel/perf_cpum_cf_events.c +++ b/arch/s390/kernel/perf_cpum_cf_events.c @@ -976,7 +976,7 @@ static __init struct attribute **merge_attr(struct attribute **a, j++; j++; - new = kmalloc_array(j, sizeof(struct attribute *), GFP_KERNEL); + new = kmalloc_objs(struct attribute *, j, GFP_KERNEL); if (!new) return NULL; j = 0; diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index e8bd19ac82c7..d0adeabfce0c 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -1609,7 +1609,7 @@ static void *aux_buffer_setup(struct perf_event *event, void **pages, } /* Allocate aux_buffer struct for the event */ - aux = kzalloc(sizeof(struct aux_buffer), GFP_KERNEL); + aux = kzalloc_obj(struct aux_buffer, GFP_KERNEL); if (!aux) goto no_aux; sfb = &aux->sfb; diff --git a/arch/s390/kernel/perf_pai.c b/arch/s390/kernel/perf_pai.c index 810f5b6c5e01..4c2ce0a2a8e4 100644 --- a/arch/s390/kernel/perf_pai.c +++ b/arch/s390/kernel/perf_pai.c @@ -252,7 +252,7 @@ static int pai_alloc_cpu(struct perf_event *event, int cpu) cpump = mp->mapptr; if (!cpump) { /* Paicrypt_map allocated? */ rc = -ENOMEM; - cpump = kzalloc(sizeof(*cpump), GFP_KERNEL); + cpump = kzalloc_obj(*cpump, GFP_KERNEL); if (!cpump) goto undo; /* Allocate memory for counter page and counter extraction. @@ -281,9 +281,9 @@ static int pai_alloc_cpu(struct perf_event *event, int cpu) cpump->paiext_cb = kzalloc(PAIE1_CB_SZ, GFP_KERNEL); need_paiext_cb = true; } - cpump->save = kvmalloc_array(pai_pmu[idx].num_avail + 1, - sizeof(struct pai_userdata), - GFP_KERNEL); + cpump->save = kvmalloc_objs(struct pai_userdata, + pai_pmu[idx].num_avail + 1, + GFP_KERNEL); if (!cpump->area || !cpump->save || (need_paiext_cb && !cpump->paiext_cb)) { pai_free(mp); @@ -315,7 +315,7 @@ static int pai_alloc(struct perf_event *event) struct cpumask *maskptr; int cpu, rc = -ENOMEM; - maskptr = kzalloc(sizeof(*maskptr), GFP_KERNEL); + maskptr = kzalloc_obj(*maskptr, GFP_KERNEL); if (!maskptr) goto out; @@ -1070,7 +1070,7 @@ static struct attribute * __init attr_event_init_one(int num, { struct perf_pmu_events_attr *pa; - pa = kzalloc(sizeof(*pa), GFP_KERNEL); + pa = kzalloc_obj(*pa, GFP_KERNEL); if (!pa) return NULL; @@ -1089,7 +1089,7 @@ static struct attribute ** __init attr_event_init(struct pai_pmu *p) struct attribute **attrs; unsigned int i; - attrs = kmalloc_array(min_attr + 1, sizeof(*attrs), GFP_KERNEL | __GFP_ZERO); + attrs = kmalloc_objs(*attrs, min_attr + 1, GFP_KERNEL | __GFP_ZERO); if (!attrs) goto out; for (i = 0; i < min_attr; i++) { diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index ceaa1726e328..3a08f8f6c865 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -749,7 +749,7 @@ static int s390_gs_cb_set(struct task_struct *target, if (!cpu_has_gs()) return -ENODEV; if (!target->thread.gs_cb) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; } @@ -800,7 +800,7 @@ static int s390_gs_bc_set(struct task_struct *target, if (!cpu_has_gs()) return -ENODEV; if (!data) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; target->thread.gs_bc_cb = data; @@ -861,7 +861,7 @@ static int s390_runtime_instr_set(struct task_struct *target, return -ENODEV; if (!target->thread.ri_cb) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; } diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c index 1788a5454b6f..0331ee7af39d 100644 --- a/arch/s390/kernel/runtime_instr.c +++ b/arch/s390/kernel/runtime_instr.c @@ -83,7 +83,7 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum) return -EINVAL; if (!current->thread.ri_cb) { - cb = kzalloc(sizeof(*cb), GFP_KERNEL); + cb = kzalloc_obj(*cb, GFP_KERNEL); if (!cb) return -ENOMEM; } else { diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index eb334539444a..615b76a7f2a0 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -1145,7 +1145,7 @@ int __ref smp_rescan_cpus(bool early) struct sclp_core_info *info; int nr; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; smp_get_core_info(info, 0); diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index a27a90a199be..1838a4696747 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -132,7 +132,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end) struct page **pagelist; int i; - pagelist = kcalloc(pages + 1, sizeof(struct page *), GFP_KERNEL); + pagelist = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); if (!pagelist) panic("%s: Cannot allocate page list for VDSO", __func__); for (i = 0; i < pages; i++) diff --git a/arch/s390/kvm/dat.c b/arch/s390/kvm/dat.c index 129dc55a4a0d..670404d4fa44 100644 --- a/arch/s390/kvm/dat.c +++ b/arch/s390/kvm/dat.c @@ -45,7 +45,7 @@ int kvm_s390_mmu_cache_topup(struct kvm_s390_mmu_cache *mc) mc->pts[mc->n_pts] = o; } for ( ; mc->n_rmaps < KVM_S390_MMU_CACHE_N_RMAPS; mc->n_rmaps++) { - o = kzalloc(sizeof(*mc->rmaps[0]), GFP_KERNEL_ACCOUNT); + o = kzalloc_obj(*mc->rmaps[0], GFP_KERNEL_ACCOUNT); if (!o) return -ENOMEM; mc->rmaps[mc->n_rmaps] = o; diff --git a/arch/s390/kvm/dat.h b/arch/s390/kvm/dat.h index 8c7ae07dcc28..123e11dcd70d 100644 --- a/arch/s390/kvm/dat.h +++ b/arch/s390/kvm/dat.h @@ -572,7 +572,7 @@ static inline struct vsie_rmap *kvm_s390_mmu_cache_alloc_rmap(struct kvm_s390_mm { if (mc->n_rmaps) return mc->rmaps[--mc->n_rmaps]; - return kzalloc(sizeof(struct vsie_rmap), GFP_KVM_S390_MMU_CACHE); + return kzalloc_obj(struct vsie_rmap, GFP_KVM_S390_MMU_CACHE); } static inline struct crst_table *crste_table_start(union crste *crstep) @@ -920,7 +920,7 @@ static inline struct kvm_s390_mmu_cache *kvm_s390_new_mmu_cache(void) { struct kvm_s390_mmu_cache *mc __free(kvm_s390_mmu_cache) = NULL; - mc = kzalloc(sizeof(*mc), GFP_KERNEL_ACCOUNT); + mc = kzalloc_obj(*mc, GFP_KERNEL_ACCOUNT); if (mc && !kvm_s390_mmu_cache_topup(mc)) return_ptr(mc); return NULL; diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c index 26cd2b208b6f..ef0c6ebfdde2 100644 --- a/arch/s390/kvm/gmap.c +++ b/arch/s390/kvm/gmap.c @@ -57,7 +57,7 @@ struct gmap *gmap_new(struct kvm *kvm, gfn_t limit) type = gmap_limit_to_type(limit); - gmap = kzalloc(sizeof(*gmap), GFP_KERNEL_ACCOUNT); + gmap = kzalloc_obj(*gmap, GFP_KERNEL_ACCOUNT); if (!gmap) return NULL; INIT_LIST_HEAD(&gmap->children); @@ -918,7 +918,7 @@ int gmap_insert_rmap(struct gmap *sg, gfn_t p_gfn, gfn_t r_gfn, int level) KVM_BUG_ON(!is_shadow(sg), sg->kvm); lockdep_assert_held(&sg->host_to_rmap_lock); - rmap = kzalloc(sizeof(*rmap), GFP_ATOMIC); + rmap = kzalloc_obj(*rmap, GFP_ATOMIC); if (!rmap) return -ENOMEM; diff --git a/arch/s390/kvm/guestdbg.c b/arch/s390/kvm/guestdbg.c index 80879fc73c90..69835e1d4f20 100644 --- a/arch/s390/kvm/guestdbg.c +++ b/arch/s390/kvm/guestdbg.c @@ -232,18 +232,14 @@ int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu, } if (nr_wp > 0) { - wp_info = kmalloc_array(nr_wp, - sizeof(*wp_info), - GFP_KERNEL_ACCOUNT); + wp_info = kmalloc_objs(*wp_info, nr_wp, GFP_KERNEL_ACCOUNT); if (!wp_info) { ret = -ENOMEM; goto error; } } if (nr_bp > 0) { - bp_info = kmalloc_array(nr_bp, - sizeof(*bp_info), - GFP_KERNEL_ACCOUNT); + bp_info = kmalloc_objs(*bp_info, nr_bp, GFP_KERNEL_ACCOUNT); if (!bp_info) { ret = -ENOMEM; goto error; diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 1c2bb5cd7e12..18932a65ca68 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -1749,7 +1749,7 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, goto out; } gisa_out: - tmp_inti = kzalloc(sizeof(*inti), GFP_KERNEL_ACCOUNT); + tmp_inti = kzalloc_obj(*inti, GFP_KERNEL_ACCOUNT); if (tmp_inti) { tmp_inti->type = KVM_S390_INT_IO(1, 0, 0, 0); tmp_inti->io.io_int_word = isc_to_int_word(isc); @@ -1968,7 +1968,7 @@ int kvm_s390_inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti; int rc; - inti = kzalloc(sizeof(*inti), GFP_KERNEL_ACCOUNT); + inti = kzalloc_obj(*inti, GFP_KERNEL_ACCOUNT); if (!inti) return -ENOMEM; @@ -2374,7 +2374,7 @@ static int enqueue_floating_irq(struct kvm_device *dev, return -EINVAL; while (len >= sizeof(struct kvm_s390_irq)) { - inti = kzalloc(sizeof(*inti), GFP_KERNEL_ACCOUNT); + inti = kzalloc_obj(*inti, GFP_KERNEL_ACCOUNT); if (!inti) return -ENOMEM; @@ -2422,7 +2422,7 @@ static int register_io_adapter(struct kvm_device *dev, if (dev->kvm->arch.adapters[adapter_info.id] != NULL) return -EINVAL; - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL_ACCOUNT); + adapter = kzalloc_obj(*adapter, GFP_KERNEL_ACCOUNT); if (!adapter) return -ENOMEM; diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index de645025db0f..7a175d86cef0 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -1418,7 +1418,7 @@ static int kvm_s390_set_processor(struct kvm *kvm, struct kvm_device_attr *attr) ret = -EBUSY; goto out; } - proc = kzalloc(sizeof(*proc), GFP_KERNEL_ACCOUNT); + proc = kzalloc_obj(*proc, GFP_KERNEL_ACCOUNT); if (!proc) { ret = -ENOMEM; goto out; @@ -1618,7 +1618,7 @@ static int kvm_s390_get_processor(struct kvm *kvm, struct kvm_device_attr *attr) struct kvm_s390_vm_cpu_processor *proc; int ret = 0; - proc = kzalloc(sizeof(*proc), GFP_KERNEL_ACCOUNT); + proc = kzalloc_obj(*proc, GFP_KERNEL_ACCOUNT); if (!proc) { ret = -ENOMEM; goto out; @@ -1646,7 +1646,7 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr) struct kvm_s390_vm_cpu_machine *mach; int ret = 0; - mach = kzalloc(sizeof(*mach), GFP_KERNEL_ACCOUNT); + mach = kzalloc_obj(*mach, GFP_KERNEL_ACCOUNT); if (!mach) { ret = -ENOMEM; goto out; diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c index 8c40154ff50f..2ac911e388bd 100644 --- a/arch/s390/kvm/pci.c +++ b/arch/s390/kvm/pci.c @@ -54,7 +54,7 @@ static int zpci_setup_aipb(u8 nisc) struct page *page; int size, rc; - zpci_aipb = kzalloc(sizeof(union zpci_sic_iib), GFP_KERNEL); + zpci_aipb = kzalloc_obj(union zpci_sic_iib, GFP_KERNEL); if (!zpci_aipb) return -ENOMEM; @@ -126,8 +126,8 @@ int kvm_s390_pci_aen_init(u8 nisc) return -EPERM; mutex_lock(&aift->aift_lock); - aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev *), - GFP_KERNEL); + aift->kzdev = kzalloc_objs(struct kvm_zdev *, ZPCI_NR_DEVICES, + GFP_KERNEL); if (!aift->kzdev) { rc = -ENOMEM; goto unlock; @@ -404,7 +404,7 @@ static int kvm_s390_pci_dev_open(struct zpci_dev *zdev) { struct kvm_zdev *kzdev; - kzdev = kzalloc(sizeof(struct kvm_zdev), GFP_KERNEL); + kzdev = kzalloc_obj(struct kvm_zdev, GFP_KERNEL); if (!kzdev) return -ENOMEM; @@ -666,7 +666,7 @@ int __init kvm_s390_pci_init(void) if (!kvm_s390_pci_interp_allowed()) return 0; - aift = kzalloc(sizeof(struct zpci_aift), GFP_KERNEL); + aift = kzalloc_obj(struct zpci_aift, GFP_KERNEL); if (!aift) return -ENOMEM; diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c index 461b413c76a3..fd34a2f46ce3 100644 --- a/arch/s390/kvm/pv.c +++ b/arch/s390/kvm/pv.c @@ -466,7 +466,7 @@ int kvm_s390_pv_set_aside(struct kvm *kvm, u16 *rc, u16 *rrc) if (kvm->arch.gmap->asce.dt == TABLE_TYPE_SEGMENT) return -EINVAL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c index 6cc33c705de2..db1ef34ad03e 100644 --- a/arch/s390/mm/extmem.c +++ b/arch/s390/mm/extmem.c @@ -171,8 +171,8 @@ query_segment_type (struct dcss_segment *seg) struct qout64 *qout; struct qin64 *qin; - qin = kmalloc(sizeof(*qin), GFP_KERNEL | GFP_DMA); - qout = kmalloc(sizeof(*qout), GFP_KERNEL | GFP_DMA); + qin = kmalloc_obj(*qin, GFP_KERNEL | GFP_DMA); + qout = kmalloc_obj(*qout, GFP_KERNEL | GFP_DMA); if ((qin == NULL) || (qout == NULL)) { rc = -ENOMEM; goto out_free; @@ -302,7 +302,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long start_addr = end_addr = 0; segtype = -1; - seg = kmalloc(sizeof(*seg), GFP_KERNEL | GFP_DMA); + seg = kmalloc_obj(*seg, GFP_KERNEL | GFP_DMA); if (seg == NULL) { rc = -ENOMEM; goto out; @@ -317,7 +317,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long goto out_free; } - seg->res = kzalloc(sizeof(struct resource), GFP_KERNEL); + seg->res = kzalloc_obj(struct resource, GFP_KERNEL); if (seg->res == NULL) { rc = -ENOMEM; goto out_free; diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 579461d471bb..582afb486093 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -2323,7 +2323,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit_data = fp->aux->jit_data; if (!jit_data) { - jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { fp = orig_fp; goto out; diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 97bab20bc163..b75065130639 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -523,7 +523,7 @@ static struct resource *__alloc_res(struct zpci_dev *zdev, unsigned long start, { struct resource *r; - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return NULL; @@ -824,7 +824,7 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state) struct zpci_dev *zdev; int rc; - zdev = kzalloc(sizeof(*zdev), GFP_KERNEL); + zdev = kzalloc_obj(*zdev, GFP_KERNEL); if (!zdev) return ERR_PTR(-ENOMEM); @@ -1073,8 +1073,8 @@ static int zpci_mem_init(void) if (!zdev_fmb_cache) goto error_fmb; - zpci_iomap_start = kcalloc(ZPCI_IOMAP_ENTRIES, - sizeof(*zpci_iomap_start), GFP_KERNEL); + zpci_iomap_start = kzalloc_objs(*zpci_iomap_start, ZPCI_IOMAP_ENTRIES, + GFP_KERNEL); if (!zpci_iomap_start) goto error_iomap; diff --git a/arch/s390/pci/pci_bus.c b/arch/s390/pci/pci_bus.c index 42a13e451f64..3eba87a036b1 100644 --- a/arch/s390/pci/pci_bus.c +++ b/arch/s390/pci/pci_bus.c @@ -315,7 +315,7 @@ static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid) { struct zpci_bus *zbus; - zbus = kzalloc(sizeof(*zbus), GFP_KERNEL); + zbus = kzalloc_obj(*zbus, GFP_KERNEL); if (!zbus) return NULL; diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c index e9dd45f3c09d..441356767437 100644 --- a/arch/s390/pci/pci_irq.c +++ b/arch/s390/pci/pci_irq.c @@ -563,8 +563,7 @@ static int __init zpci_directed_irq_init(void) iib.diib.disb_addr = virt_to_phys(zpci_sbv->vector); zpci_set_irq_ctrl(SIC_IRQ_MODE_DIRECT, 0, &iib); - zpci_ibv = kcalloc(num_possible_cpus(), sizeof(*zpci_ibv), - GFP_KERNEL); + zpci_ibv = kzalloc_objs(*zpci_ibv, num_possible_cpus(), GFP_KERNEL); if (!zpci_ibv) return -ENOMEM; @@ -590,7 +589,7 @@ static int __init zpci_directed_irq_init(void) static int __init zpci_floating_irq_init(void) { - zpci_ibv = kcalloc(ZPCI_NR_DEVICES, sizeof(*zpci_ibv), GFP_KERNEL); + zpci_ibv = kzalloc_objs(*zpci_ibv, ZPCI_NR_DEVICES, GFP_KERNEL); if (!zpci_ibv) return -ENOMEM; diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c index 5b2c1fd254d7..72f90f0c799e 100644 --- a/arch/sh/drivers/dma/dmabrg.c +++ b/arch/sh/drivers/dma/dmabrg.c @@ -153,8 +153,7 @@ static int __init dmabrg_init(void) unsigned long or; int ret; - dmabrg_handlers = kcalloc(10, sizeof(struct dmabrg_handler), - GFP_KERNEL); + dmabrg_handlers = kzalloc_objs(struct dmabrg_handler, 10, GFP_KERNEL); if (!dmabrg_handlers) return -ENOMEM; diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c index 42103038a7d0..aae320cef692 100644 --- a/arch/sh/drivers/heartbeat.c +++ b/arch/sh/drivers/heartbeat.c @@ -91,7 +91,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev) if (pdev->dev.platform_data) { hd = pdev->dev.platform_data; } else { - hd = kzalloc(sizeof(struct heartbeat_data), GFP_KERNEL); + hd = kzalloc_obj(struct heartbeat_data, GFP_KERNEL); if (unlikely(!hd)) return -ENOMEM; } diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index a78b9a935585..1e67082eb3b4 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c @@ -558,8 +558,8 @@ static int __init sh7786_pcie_init(void) if (unlikely(nr_ports == 0)) return -ENODEV; - sh7786_pcie_ports = kcalloc(nr_ports, sizeof(struct sh7786_pcie_port), - GFP_KERNEL); + sh7786_pcie_ports = kzalloc_objs(struct sh7786_pcie_port, nr_ports, + GFP_KERNEL); if (unlikely(!sh7786_pcie_ports)) return -ENOMEM; diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c index 443cc6fd26a8..492315fc96fd 100644 --- a/arch/sh/drivers/push-switch.c +++ b/arch/sh/drivers/push-switch.c @@ -46,7 +46,7 @@ static int switch_drv_probe(struct platform_device *pdev) struct push_switch *psw; int ret, irq; - psw = kzalloc(sizeof(struct push_switch), GFP_KERNEL); + psw = kzalloc_obj(struct push_switch, GFP_KERNEL); if (unlikely(!psw)) return -ENOMEM; diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index d289e99dc118..2a465c440168 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -342,7 +342,7 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif) struct kobject *kobj; int error; - sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL); + sq_kobject[cpu] = kzalloc_obj(struct kobject, GFP_KERNEL); if (unlikely(!sq_kobject[cpu])) return -ENOMEM; diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index a1b54bedc929..46df80942418 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c @@ -741,7 +741,7 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len, unsigned long flags; int count; - cie = kzalloc(sizeof(*cie), GFP_KERNEL); + cie = kzalloc_obj(*cie, GFP_KERNEL); if (!cie) return -ENOMEM; @@ -874,7 +874,7 @@ static int dwarf_parse_fde(void *entry, u32 entry_type, int count; void *p = start; - fde = kzalloc(sizeof(*fde), GFP_KERNEL); + fde = kzalloc_obj(*fde, GFP_KERNEL); if (!fde) return -ENOMEM; diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index a1a6485c9183..904c4223230f 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c @@ -63,7 +63,7 @@ static int clock_board_calc_nslots(struct clock_board *p) static int clock_board_probe(struct platform_device *op) { - struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct clock_board *p = kzalloc_obj(*p, GFP_KERNEL); int err = -ENOMEM; if (!p) { @@ -159,7 +159,7 @@ static struct platform_driver clock_board_driver = { static int fhc_probe(struct platform_device *op) { - struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct fhc *p = kzalloc_obj(*p, GFP_KERNEL); int err = -ENOMEM; u32 reg; diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index d4c74d6b2e1b..663b2d7ff7bc 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c @@ -417,7 +417,7 @@ static int jbusmc_probe(struct platform_device *op) num_mem_regs = len / sizeof(*mem_regs); err = -ENOMEM; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { printk(KERN_ERR PFX "Cannot allocate struct jbusmc.\n"); goto out; @@ -718,7 +718,7 @@ static int chmc_probe(struct platform_device *op) } err = -ENOMEM; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { printk(KERN_ERR PFX "Could not allocate struct chmc.\n"); goto out; diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c index 8fcf2d8c6bd2..d51ff010176c 100644 --- a/arch/sparc/kernel/cpumap.c +++ b/arch/sparc/kernel/cpumap.c @@ -194,7 +194,7 @@ static struct cpuinfo_tree *build_cpuinfo_tree(void) n = enumerate_cpuinfo_nodes(tmp_level); - new_tree = kzalloc(struct_size(new_tree, nodes, n), GFP_ATOMIC); + new_tree = kzalloc_flex(*new_tree, nodes, n, GFP_ATOMIC); if (!new_tree) return NULL; diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index f7fc6f2af2f2..df3fa6d96074 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -1175,7 +1175,7 @@ static int ds_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (ds_version_printed++ == 0) printk(KERN_INFO "%s", version); - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); err = -ENOMEM; if (!dp) goto out_err; diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 5ebca5c7af1e..82d248e6b822 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -238,7 +238,7 @@ unsigned long sparc_dma_alloc_resource(struct device *dev, size_t len) { struct resource *res; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return 0; res->name = dev->of_node->full_name; diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index ded463c82abd..c5466a9fd560 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -628,7 +628,7 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap) if (unlikely(handler_data)) goto out; - handler_data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC); + handler_data = kzalloc_obj(struct irq_handler_data, GFP_ATOMIC); if (unlikely(!handler_data)) { prom_printf("IRQ: kzalloc(irq_handler_data) failed.\n"); prom_halt(); @@ -654,7 +654,7 @@ static unsigned int sun4v_build_common(u32 devhandle, unsigned int devino, if (!irq) goto out; - data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC); + data = kzalloc_obj(struct irq_handler_data, GFP_ATOMIC); if (unlikely(!data)) { pr_err("IRQ handler data allocation failed.\n"); irq_free(irq); diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index 7f3cdb6f644d..4fd357d5fc29 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -1171,7 +1171,7 @@ struct ldc_channel *ldc_alloc(unsigned long id, mssbuf = NULL; - lp = kzalloc(sizeof(*lp), GFP_KERNEL); + lp = kzalloc_obj(*lp, GFP_KERNEL); err = -ENOMEM; if (!lp) goto out_err; diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index 9f662340b5b2..c6d5cec12b67 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c @@ -721,7 +721,7 @@ static int grpci2_of_probe(struct platform_device *ofdev) goto err1; } - priv = grpci2priv = kzalloc(sizeof(struct grpci2_priv), GFP_KERNEL); + priv = grpci2priv = kzalloc_obj(struct grpci2_priv, GFP_KERNEL); if (grpci2priv == NULL) { err = -ENOMEM; goto err1; diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 284a4cafa432..51e90a093ee0 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c @@ -340,7 +340,7 @@ static void __init build_device_resources(struct platform_device *op, static struct platform_device * __init scan_one_device(struct device_node *dp, struct device *parent) { - struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL); + struct platform_device *op = kzalloc_obj(*op, GFP_KERNEL); const struct linux_prom_irqs *intr; struct dev_archdata *sd; int len, i; diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index f53092b07b9e..c30ad34525bd 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c @@ -633,7 +633,7 @@ out: static struct platform_device * __init scan_one_device(struct device_node *dp, struct device *parent) { - struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL); + struct platform_device *op = kzalloc_obj(*op, GFP_KERNEL); const unsigned int *irq; struct dev_archdata *sd; int len, i; diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index b290107170e9..432f83cf61aa 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -650,7 +650,7 @@ static void pci_claim_legacy_resources(struct pci_dev *dev) if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) return; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return; diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 2576f4f31309..588cfc595b84 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c @@ -336,7 +336,7 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) NULL); if (vdma) { - struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); + struct resource *rp = kzalloc_obj(*rp, GFP_KERNEL); if (!rp) { pr_info("%s: Cannot allocate IOMMU resource.\n", diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index 0b91bde80fdc..b72cf5acbdba 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c @@ -468,13 +468,13 @@ static int fire_probe(struct platform_device *op) portid = of_getintprop_default(dp, "portid", 0xff); err = -ENOMEM; - pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); + pbm = kzalloc_obj(*pbm, GFP_KERNEL); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbminfo.\n"); goto out_err; } - iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL); + iommu = kzalloc_obj(struct iommu, GFP_KERNEL); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index 1efc98305ec7..9880b341a631 100644 --- a/arch/sparc/kernel/pci_psycho.c +++ b/arch/sparc/kernel/pci_psycho.c @@ -519,7 +519,7 @@ static int psycho_probe(struct platform_device *op) upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); err = -ENOMEM; - pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); + pbm = kzalloc_obj(*pbm, GFP_KERNEL); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; @@ -529,7 +529,7 @@ static int psycho_probe(struct platform_device *op) if (pbm->sibling) { iommu = pbm->sibling->iommu; } else { - iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL); + iommu = kzalloc_obj(struct iommu, GFP_KERNEL); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index a84598568300..3b4116f23862 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c @@ -482,13 +482,13 @@ static int sabre_probe(struct platform_device *op) } err = -ENOMEM; - pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); + pbm = kzalloc_obj(*pbm, GFP_KERNEL); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; } - iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); + iommu = kzalloc_obj(*iommu, GFP_KERNEL); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 93cd9e5a8099..519a80a639d6 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c @@ -1426,7 +1426,7 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type) portid = of_getintprop_default(dp, "portid", 0xff); err = -ENOMEM; - pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); + pbm = kzalloc_obj(*pbm, GFP_KERNEL); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; @@ -1434,7 +1434,7 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type) pbm->sibling = schizo_find_sibling(portid, chip_type); - iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL); + iommu = kzalloc_obj(struct iommu, GFP_KERNEL); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM A iommu.\n"); goto out_free_pbm; diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 791f0a76665f..4e842fb48602 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c @@ -754,7 +754,7 @@ static int pci_sun4v_atu_alloc_iotsb(struct pci_pbm_info *pbm) unsigned long order; unsigned long err; - iotsb = kzalloc(sizeof(*iotsb), GFP_KERNEL); + iotsb = kzalloc_obj(*iotsb, GFP_KERNEL); if (!iotsb) { err = -ENOMEM; goto out_err; @@ -1292,13 +1292,13 @@ static int pci_sun4v_probe(struct platform_device *op) iommu_batch_initialized = 1; } - pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); + pbm = kzalloc_obj(*pbm, GFP_KERNEL); if (!pbm) { printk(KERN_ERR PFX "Could not allocate pci_pbm_info\n"); goto out_err; } - iommu = kzalloc(sizeof(struct iommu), GFP_KERNEL); + iommu = kzalloc_obj(struct iommu, GFP_KERNEL); if (!iommu) { printk(KERN_ERR PFX "Could not allocate pbm iommu\n"); goto out_free_controller; @@ -1307,7 +1307,7 @@ static int pci_sun4v_probe(struct platform_device *op) pbm->iommu = iommu; iommu->atu = NULL; if (hv_atu) { - atu = kzalloc(sizeof(*atu), GFP_KERNEL); + atu = kzalloc_obj(*atu, GFP_KERNEL); if (!atu) pr_err(PFX "Could not allocate atu\n"); else diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index d7c911724435..4cd32ccc5191 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -466,7 +466,7 @@ static int pdev_to_pnode(struct linux_pbm_info *pbm, struct pci_dev *pdev) static inline struct pcidev_cookie *pci_devcookie_alloc(void) { - return kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC); + return kmalloc_obj(struct pcidev_cookie, GFP_ATOMIC); } static void pcic_map_pci_device(struct linux_pcic *pcic, diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c index 0bababf6f2bc..bb2794ce7aad 100644 --- a/arch/sparc/kernel/sbus.c +++ b/arch/sparc/kernel/sbus.c @@ -556,8 +556,8 @@ static void __init sbus_iommu_init(struct platform_device *op) } regs = pr->phys_addr; - iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC); - strbuf = kzalloc(sizeof(*strbuf), GFP_ATOMIC); + iommu = kzalloc_obj(*iommu, GFP_ATOMIC); + strbuf = kzalloc_obj(*strbuf, GFP_ATOMIC); if (!iommu || !strbuf) goto fatal_memory_error; diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 704375c061e7..46a7b53737d4 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -388,7 +388,7 @@ static int __init topology_init(void) err = 0; for_each_online_cpu(i) { - struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct cpu *p = kzalloc_obj(*p, GFP_KERNEL); if (!p) err = -ENOMEM; else diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index 5cbd6ed5ef6f..81f0be76f48a 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -297,8 +297,8 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, unsigned long hv_err; int i; - hdesc = kzalloc(struct_size(hdesc, maps, num_kernel_image_mappings), - GFP_KERNEL); + hdesc = kzalloc_flex(*hdesc, maps, num_kernel_image_mappings, + GFP_KERNEL); if (!hdesc) { printk(KERN_ERR "ldom_startcpu_cpuid: Cannot allocate " "hvtramp_descr.\n"); diff --git a/arch/sparc/kernel/starfire.c b/arch/sparc/kernel/starfire.c index b8cd57d9182b..7736dc34f6ad 100644 --- a/arch/sparc/kernel/starfire.c +++ b/arch/sparc/kernel/starfire.c @@ -50,7 +50,7 @@ void starfire_hookup(int upaid) struct starfire_irqinfo *p; unsigned long treg_base, hwmid, i; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) { prom_printf("starfire_hookup: No memory, this is insane.\n"); prom_halt(); diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 9a137c70e8d1..95683ecdc590 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c @@ -304,7 +304,7 @@ static unsigned int _sun4d_build_device_irq(unsigned int real_irq, if (unlikely(handler_data)) goto err_out; - handler_data = kzalloc(sizeof(struct sun4d_handler_data), GFP_ATOMIC); + handler_data = kzalloc_obj(struct sun4d_handler_data, GFP_ATOMIC); if (unlikely(!handler_data)) { prom_printf("IRQ: kzalloc(sun4d_handler_data) failed.\n"); prom_halt(); diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 1079638986b5..fe8cfb1cdd3a 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c @@ -268,7 +268,7 @@ static unsigned int sun4m_build_device_irq(struct platform_device *op, if (unlikely(handler_data)) goto out; - handler_data = kzalloc(sizeof(struct sun4m_handler_data), GFP_ATOMIC); + handler_data = kzalloc_obj(struct sun4m_handler_data, GFP_ATOMIC); if (unlikely(!handler_data)) { prom_printf("IRQ: kzalloc(sun4m_handler_data) failed.\n"); prom_halt(); diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index dbf118b40601..8d5e2d5c0bc5 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -647,8 +647,8 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type, } if (!current_thread_info()->utraps) { current_thread_info()->utraps = - kcalloc(UT_TRAP_INSTRUCTION_31 + 1, sizeof(long), - GFP_KERNEL); + kzalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1, + GFP_KERNEL); if (!current_thread_info()->utraps) return -ENOMEM; current_thread_info()->utraps[0] = 1; @@ -658,9 +658,8 @@ SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type, unsigned long *p = current_thread_info()->utraps; current_thread_info()->utraps = - kmalloc_array(UT_TRAP_INSTRUCTION_31 + 1, - sizeof(long), - GFP_KERNEL); + kmalloc_objs(long, UT_TRAP_INSTRUCTION_31 + 1, + GFP_KERNEL); if (!current_thread_info()->utraps) { current_thread_info()->utraps = p; return -ENOMEM; diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index 8c7dd72ef334..0d21a8e567da 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -325,7 +325,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, return NULL; } - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) { printk(KERN_ERR "VIO: Could not allocate vio_dev\n"); return NULL; diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 3c3a6607fa51..2c4986e95713 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -3070,7 +3070,7 @@ static int __init report_memory(void) kernel_lds_init(); for (i = 0; i < pavail_ents; i++) { - res = kzalloc(sizeof(struct resource), GFP_KERNEL); + res = kzalloc_obj(struct resource, GFP_KERNEL); if (!res) { pr_warn("Failed to allocate source.\n"); diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index d409cb450de4..2b5e40cc9d58 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -44,7 +44,7 @@ static void __init iounit_iommu_init(struct platform_device *op) iopte_t __iomem *xpt; iopte_t __iomem *xptend; - iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); + iounit = kzalloc_obj(struct iounit_struct, GFP_ATOMIC); if (!iounit) { prom_printf("SUN4D: Cannot alloc iounit, halting.\n"); prom_halt(); diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index f48adf62724a..3ca7cc2b9bfb 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -64,7 +64,7 @@ static void __init sbus_iommu_init(struct platform_device *op) unsigned long base; unsigned long tmp; - iommu = kmalloc(sizeof(struct iommu_struct), GFP_KERNEL); + iommu = kmalloc_obj(struct iommu_struct, GFP_KERNEL); if (!iommu) { prom_printf("Unable to allocate iommu structure\n"); prom_halt(); diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 73bf0aea8baf..884b201259d6 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +++ b/arch/sparc/net/bpf_jit_comp_64.c @@ -1505,7 +1505,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) jit_data = prog->aux->jit_data; if (!jit_data) { - jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { prog = orig_prog; goto out; diff --git a/arch/sparc/vdso/vma.c b/arch/sparc/vdso/vma.c index bab7a59575e8..bba84959c69d 100644 --- a/arch/sparc/vdso/vma.c +++ b/arch/sparc/vdso/vma.c @@ -266,7 +266,7 @@ static int __init init_vdso_image(const struct vdso_image *image, if (WARN_ON(image->size % PAGE_SIZE != 0)) goto oom; - cpp = kcalloc(cnpages, sizeof(struct page *), GFP_KERNEL); + cpp = kzalloc_objs(struct page *, cnpages, GFP_KERNEL); vdso_mapping->pages = cpp; if (!cpp) @@ -288,7 +288,7 @@ static int __init init_vdso_image(const struct vdso_image *image, dnpages = (sizeof(struct vvar_data) / PAGE_SIZE) + 1; if (WARN_ON(dnpages != 1)) goto oom; - dpp = kcalloc(dnpages, sizeof(struct page *), GFP_KERNEL); + dpp = kzalloc_objs(struct page *, dnpages, GFP_KERNEL); vvar_mapping.pages = dpp; if (!dpp) diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 26442db7d608..db2bb032be30 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -504,7 +504,7 @@ static struct chan *parse_chan(struct line *line, char *str, int device, return NULL; } - chan = kmalloc(sizeof(*chan), GFP_ATOMIC); + chan = kmalloc_obj(*chan, GFP_ATOMIC); if (chan == NULL) { *error_out = "Memory allocation failed"; return NULL; diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 0ac149de1ac0..6983a35a9ead 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c @@ -186,7 +186,7 @@ static int hostaudio_open(struct inode *inode, struct file *file) kernel_param_unlock(THIS_MODULE); #endif - state = kmalloc(sizeof(struct hostaudio_state), GFP_KERNEL); + state = kmalloc_obj(struct hostaudio_state, GFP_KERNEL); if (state == NULL) return -ENOMEM; @@ -247,7 +247,7 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file) printk(KERN_DEBUG "hostmixer: open called (host: %s)\n", mixer); #endif - state = kmalloc(sizeof(struct hostmixer_state), GFP_KERNEL); + state = kmalloc_obj(struct hostmixer_state, GFP_KERNEL); if (state == NULL) return -ENOMEM; diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 43d8959cc746..62545319d0eb 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -672,7 +672,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port, { struct winch *winch; - winch = kmalloc(sizeof(*winch), GFP_KERNEL); + winch = kmalloc_obj(*winch, GFP_KERNEL); if (winch == NULL) { printk(KERN_ERR "register_winch_irq - kmalloc failed\n"); goto cleanup; diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index ff4bda95b9c7..e2a9e8879f58 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -87,7 +87,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id) if (req.cmd->context == MCONSOLE_INTR) (*req.cmd->handler)(&req); else { - new = kmalloc(sizeof(*new), GFP_NOWAIT); + new = kmalloc_obj(*new, GFP_NOWAIT); if (new == NULL) mconsole_reply(&req, "Out of memory", 1, 0); else { diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index a4508470df78..c51d6ca4de70 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -88,7 +88,7 @@ static int port_accept(struct port_list *port) goto out; } - conn = kmalloc(sizeof(*conn), GFP_ATOMIC); + conn = kmalloc_obj(*conn, GFP_ATOMIC); if (conn == NULL) { printk(KERN_ERR "port_accept : failed to allocate " "connection\n"); @@ -170,7 +170,7 @@ void *port_data(int port_num) if (port->port == port_num) goto found; } - port = kmalloc(sizeof(struct port_list), GFP_KERNEL); + port = kmalloc_obj(struct port_list, GFP_KERNEL); if (port == NULL) { printk(KERN_ERR "Allocation of port list failed\n"); goto out; @@ -202,7 +202,7 @@ void *port_data(int port_num) list_add(&port->list, &ports); found: - dev = kmalloc(sizeof(struct port_dev), GFP_KERNEL); + dev = kmalloc_obj(struct port_dev, GFP_KERNEL); if (dev == NULL) { printk(KERN_ERR "Allocation of port device entry failed\n"); goto out; diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 37455e74d314..42f392e6add3 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1069,20 +1069,16 @@ static int __init ubd_init(void) if (register_blkdev(UBD_MAJOR, "ubd")) return -1; - irq_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE, - sizeof(struct io_thread_req *), - GFP_KERNEL - ); + irq_req_buffer = kmalloc_objs(struct io_thread_req *, + UBD_REQ_BUFFER_SIZE, GFP_KERNEL); irq_remainder = 0; if (irq_req_buffer == NULL) { printk(KERN_ERR "Failed to initialize ubd buffering\n"); return -ENOMEM; } - io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE, - sizeof(struct io_thread_req *), - GFP_KERNEL - ); + io_req_buffer = kmalloc_objs(struct io_thread_req *, + UBD_REQ_BUFFER_SIZE, GFP_KERNEL); io_remainder = 0; diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 28cfe1c700f0..8882ad7c983a 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -515,7 +515,7 @@ static struct vector_queue *create_queue( struct iovec *iov; struct mmsghdr *mmsg_vector; - result = kmalloc(sizeof(struct vector_queue), GFP_KERNEL); + result = kmalloc_obj(struct vector_queue, GFP_KERNEL); if (result == NULL) return NULL; result->max_depth = max_size; @@ -544,15 +544,11 @@ static struct vector_queue *create_queue( result->max_iov_frags = num_extra_frags; for (i = 0; i < max_size; i++) { if (vp->header_size > 0) - iov = kmalloc_array(3 + num_extra_frags, - sizeof(struct iovec), - GFP_KERNEL - ); + iov = kmalloc_objs(struct iovec, 3 + num_extra_frags, + GFP_KERNEL); else - iov = kmalloc_array(2 + num_extra_frags, - sizeof(struct iovec), - GFP_KERNEL - ); + iov = kmalloc_objs(struct iovec, 2 + num_extra_frags, + GFP_KERNEL); if (iov == NULL) goto out_fail; mmsg_vector->msg_hdr.msg_iov = iov; @@ -1385,7 +1381,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev, kfree(vp->bpf->filter); vp->bpf->filter = NULL; } else { - vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_ATOMIC); + vp->bpf = kmalloc_obj(struct sock_fprog, GFP_ATOMIC); if (vp->bpf == NULL) { netdev_err(dev, "failed to allocate memory for firmware\n"); goto flash_fail; @@ -1587,7 +1583,7 @@ static void vector_eth_configure( struct vector_private *vp; int err; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (device == NULL) { pr_err("Failed to allocate struct vector_device for vec%d\n", n); return; diff --git a/arch/um/drivers/vector_transports.c b/arch/um/drivers/vector_transports.c index 0794d23f07cb..da5d2083ed49 100644 --- a/arch/um/drivers/vector_transports.c +++ b/arch/um/drivers/vector_transports.c @@ -245,7 +245,7 @@ static int build_gre_transport_data(struct vector_private *vp) int temp_rx; int temp_tx; - vp->transport_data = kmalloc(sizeof(struct uml_gre_data), GFP_KERNEL); + vp->transport_data = kmalloc_obj(struct uml_gre_data, GFP_KERNEL); if (vp->transport_data == NULL) return -ENOMEM; td = vp->transport_data; @@ -307,8 +307,7 @@ static int build_l2tpv3_transport_data(struct vector_private *vp) unsigned long temp_rx; unsigned long temp_tx; - vp->transport_data = kmalloc( - sizeof(struct uml_l2tpv3_data), GFP_KERNEL); + vp->transport_data = kmalloc_obj(struct uml_l2tpv3_data, GFP_KERNEL); if (vp->transport_data == NULL) return -ENOMEM; diff --git a/arch/um/drivers/vfio_kern.c b/arch/um/drivers/vfio_kern.c index 915812a79bfc..5f349be2fce7 100644 --- a/arch/um/drivers/vfio_kern.c +++ b/arch/um/drivers/vfio_kern.c @@ -107,7 +107,7 @@ static int uml_vfio_open_group(int group_id) } } - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; @@ -514,9 +514,8 @@ static void uml_vfio_open_device(struct uml_vfio_device *dev) goto teardown_udev; } - dev->intr_ctx = kmalloc_array(dev->udev.irq_count, - sizeof(struct uml_vfio_intr_ctx), - GFP_KERNEL); + dev->intr_ctx = kmalloc_objs(struct uml_vfio_intr_ctx, + dev->udev.irq_count, GFP_KERNEL); if (!dev->intr_ctx) { pr_err("Failed to allocate interrupt context (%s)\n", dev->name); @@ -600,7 +599,7 @@ static struct uml_vfio_device *uml_vfio_add_device(const char *device) if (uml_vfio_find_device(device)) return ERR_PTR(-EEXIST); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/arch/um/drivers/virtio_pcidev.c b/arch/um/drivers/virtio_pcidev.c index f9b4b6f7582c..5db9a4461766 100644 --- a/arch/um/drivers/virtio_pcidev.c +++ b/arch/um/drivers/virtio_pcidev.c @@ -537,7 +537,7 @@ static int virtio_pcidev_virtio_probe(struct virtio_device *vdev) struct virtio_pcidev_device *dev; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index c24da0cf1627..ac269e6148fc 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -965,7 +965,7 @@ static struct virtqueue *vu_setup_vq(struct virtio_device *vdev, int num = MAX_SUPPORTED_QUEUE_SIZE; int rc; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { rc = -ENOMEM; goto error_kzalloc; @@ -1217,7 +1217,7 @@ static int virtio_uml_probe(struct platform_device *pdev) return PTR_ERR(pdata); } - vu_dev = kzalloc(sizeof(*vu_dev), GFP_KERNEL); + vu_dev = kzalloc_obj(*vu_dev, GFP_KERNEL); if (!vu_dev) return -ENOMEM; diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c index 3971252cb1a6..7740d9a3b090 100644 --- a/arch/um/drivers/xterm_kern.c +++ b/arch/um/drivers/xterm_kern.c @@ -45,7 +45,7 @@ int xterm_fd(int socket, int *pid_out) struct xterm_wait *data; int err, ret; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (data == NULL) { printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n"); return -ENOMEM; diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index f4b13f15a9c1..5929d498b65f 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -326,7 +326,7 @@ already: /* don't restore interrupts */ raw_spin_unlock(&irq_lock); - new = kzalloc(sizeof(*irq_entry), GFP_ATOMIC); + new = kzalloc_obj(*irq_entry, GFP_ATOMIC); if (!new) { local_irq_restore(flags); return -ENOMEM; diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index 1b86f48c7e84..7bf44927519d 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -1542,7 +1542,7 @@ static struct aesgcm_ctx *snp_init_crypto(u8 *key, size_t keylen) { struct aesgcm_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -1590,7 +1590,7 @@ struct snp_msg_desc *snp_msg_alloc(void) BUILD_BUG_ON(sizeof(struct snp_guest_msg) > PAGE_SIZE); - mdesc = kzalloc(sizeof(struct snp_msg_desc), GFP_KERNEL); + mdesc = kzalloc_obj(struct snp_msg_desc, GFP_KERNEL); if (!mdesc) return ERR_PTR(-ENOMEM); @@ -1945,7 +1945,7 @@ static int __init snp_get_tsc_info(void) struct snp_guest_req req = {}; int rc = -ENOMEM; - tsc_req = kzalloc(sizeof(*tsc_req), GFP_KERNEL); + tsc_req = kzalloc_obj(*tsc_req, GFP_KERNEL); if (!tsc_req) return rc; diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index a721da9987dd..17e383c20271 100644 --- a/arch/x86/events/amd/iommu.c +++ b/arch/x86/events/amd/iommu.c @@ -387,7 +387,7 @@ static __init int _init_events_attrs(void) while (amd_iommu_v2_event_descs[i].attr.attr.name) i++; - attrs = kcalloc(i + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, i + 1, GFP_KERNEL); if (!attrs) return -ENOMEM; @@ -422,7 +422,7 @@ static __init int init_one_iommu(unsigned int idx) struct perf_amd_iommu *perf_iommu; int ret; - perf_iommu = kzalloc(sizeof(struct perf_amd_iommu), GFP_KERNEL); + perf_iommu = kzalloc_obj(struct perf_amd_iommu, GFP_KERNEL); if (!perf_iommu) return -ENOMEM; diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index 9293ce50574d..c0ed0dfbaeaa 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -726,7 +726,7 @@ int amd_uncore_df_ctx_init(struct amd_uncore *uncore, unsigned int cpu) goto done; /* No grouping, single instance for a system */ - uncore->pmus = kzalloc(sizeof(*uncore->pmus), GFP_KERNEL); + uncore->pmus = kzalloc_obj(*uncore->pmus, GFP_KERNEL); if (!uncore->pmus) goto done; @@ -860,7 +860,7 @@ int amd_uncore_l3_ctx_init(struct amd_uncore *uncore, unsigned int cpu) goto done; /* No grouping, single instance for a system */ - uncore->pmus = kzalloc(sizeof(*uncore->pmus), GFP_KERNEL); + uncore->pmus = kzalloc_obj(*uncore->pmus, GFP_KERNEL); if (!uncore->pmus) goto done; diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index d4468efbdcd9..52f7ad5adeb1 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2389,7 +2389,7 @@ static struct cpu_hw_events *allocate_fake_cpuc(struct pmu *event_pmu) struct cpu_hw_events *cpuc; int cpu; - cpuc = kzalloc(sizeof(*cpuc), GFP_KERNEL); + cpuc = kzalloc_obj(*cpuc, GFP_KERNEL); if (!cpuc) return ERR_PTR(-ENOMEM); cpuc->is_fake = 1; diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index f3ae1f8ee3cd..41f571040145 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -7378,9 +7378,8 @@ static __always_inline int intel_pmu_init_hybrid(enum hybrid_pmu_type pmus) int idx = 0, bit; x86_pmu.num_hybrid_pmus = hweight_long(pmus_mask); - x86_pmu.hybrid_pmu = kcalloc(x86_pmu.num_hybrid_pmus, - sizeof(struct x86_hybrid_pmu), - GFP_KERNEL); + x86_pmu.hybrid_pmu = kzalloc_objs(struct x86_hybrid_pmu, + x86_pmu.num_hybrid_pmus, GFP_KERNEL); if (!x86_pmu.hybrid_pmu) return -ENOMEM; diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index 4684649109d9..9095f1eeff6e 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -107,7 +107,7 @@ lookup: if (!alloc) { raw_spin_unlock(&pci2phy_map_lock); - alloc = kmalloc(sizeof(struct pci2phy_map), GFP_KERNEL); + alloc = kmalloc_obj(struct pci2phy_map, GFP_KERNEL); raw_spin_lock(&pci2phy_map_lock); if (!alloc) @@ -990,7 +990,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type) size_t size; int i, j; - pmus = kcalloc(type->num_boxes, sizeof(*pmus), GFP_KERNEL); + pmus = kzalloc_objs(*pmus, type->num_boxes, GFP_KERNEL); if (!pmus) return -ENOMEM; @@ -1016,8 +1016,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type) } *attr_group; for (i = 0; type->event_descs[i].attr.attr.name; i++); - attr_group = kzalloc(struct_size(attr_group, attrs, i + 1), - GFP_KERNEL); + attr_group = kzalloc_flex(*attr_group, attrs, i + 1, GFP_KERNEL); if (!attr_group) goto err; diff --git a/arch/x86/events/intel/uncore_discovery.c b/arch/x86/events/intel/uncore_discovery.c index b46575254dbe..f8d1328d8346 100644 --- a/arch/x86/events/intel/uncore_discovery.c +++ b/arch/x86/events/intel/uncore_discovery.c @@ -68,7 +68,7 @@ add_uncore_discovery_type(struct uncore_unit_discovery *unit) return NULL; } - type = kzalloc(sizeof(struct intel_uncore_discovery_type), GFP_KERNEL); + type = kzalloc_obj(struct intel_uncore_discovery_type, GFP_KERNEL); if (!type) return NULL; @@ -215,7 +215,7 @@ uncore_insert_box_info(struct uncore_unit_discovery *unit, return; } - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return; @@ -744,8 +744,9 @@ intel_uncore_generic_init_uncores(enum uncore_access_type type_id, int num_extra struct rb_node *node; int i = 0; - uncores = kcalloc(num_discovered_types[type_id] + num_extra + 1, - sizeof(struct intel_uncore_type *), GFP_KERNEL); + uncores = kzalloc_objs(struct intel_uncore_type *, + num_discovered_types[type_id] + num_extra + 1, + GFP_KERNEL); if (!uncores) return empty_uncore; @@ -754,7 +755,7 @@ intel_uncore_generic_init_uncores(enum uncore_access_type type_id, int num_extra if (type->access_type != type_id) continue; - uncore = kzalloc(sizeof(struct intel_uncore_type), GFP_KERNEL); + uncore = kzalloc_obj(struct intel_uncore_type, GFP_KERNEL); if (!uncore) break; diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 7ca0429c4004..94682b067e35 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3748,12 +3748,13 @@ static int pmu_alloc_topology(struct intel_uncore_type *type, int topology_type) if (!type->num_boxes) return -EPERM; - topology = kcalloc(uncore_max_dies(), sizeof(*topology), GFP_KERNEL); + topology = kzalloc_objs(*topology, uncore_max_dies(), GFP_KERNEL); if (!topology) goto err; for (die = 0; die < uncore_max_dies(); die++) { - topology[die] = kcalloc(type->num_boxes, sizeof(**topology), GFP_KERNEL); + topology[die] = kzalloc_objs(**topology, type->num_boxes, + GFP_KERNEL); if (!topology[die]) goto clear; for (idx = 0; idx < type->num_boxes; idx++) { @@ -3882,11 +3883,11 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag, goto clear_topology; /* One more for NULL. */ - attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, (uncore_max_dies() + 1), GFP_KERNEL); if (!attrs) goto clear_topology; - eas = kcalloc(uncore_max_dies(), sizeof(*eas), GFP_KERNEL); + eas = kzalloc_objs(*eas, uncore_max_dies(), GFP_KERNEL); if (!eas) goto clear_attrs; @@ -6411,7 +6412,7 @@ static void spr_update_device_location(int type_id) } else return; - root = kzalloc(sizeof(struct rb_root), GFP_KERNEL); + root = kzalloc_obj(struct rb_root, GFP_KERNEL); if (!root) { type->num_boxes = 0; return; @@ -6424,7 +6425,7 @@ static void spr_update_device_location(int type_id) if (die < 0) continue; - unit = kzalloc(sizeof(*unit), GFP_KERNEL); + unit = kzalloc_obj(*unit, GFP_KERNEL); if (!unit) continue; unit->die = die; diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index defd86137f12..27b3fd6e663c 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -704,7 +704,7 @@ static int __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) int idx; for (idx = 0; idx < rapl_pmus->nr_rapl_pmu; idx++) { - rapl_pmu = kzalloc(sizeof(*rapl_pmu), GFP_KERNEL); + rapl_pmu = kzalloc_obj(*rapl_pmu, GFP_KERNEL); if (!rapl_pmu) goto free; @@ -742,7 +742,7 @@ static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_ else if (rapl_pmu_scope != PERF_PMU_SCOPE_PKG) return -EINVAL; - rapl_pmus = kzalloc(struct_size(rapl_pmus, rapl_pmu, nr_rapl_pmu), GFP_KERNEL); + rapl_pmus = kzalloc_flex(*rapl_pmus, rapl_pmu, nr_rapl_pmu, GFP_KERNEL); if (!rapl_pmus) return -ENOMEM; diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 5dbe9bd67891..e945ed623027 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -467,9 +467,8 @@ void __init hyperv_init(void) if (hv_isolation_type_tdx()) hv_vp_assist_page = NULL; else - hv_vp_assist_page = kcalloc(nr_cpu_ids, - sizeof(*hv_vp_assist_page), - GFP_KERNEL); + hv_vp_assist_page = kzalloc_objs(*hv_vp_assist_page, nr_cpu_ids, + GFP_KERNEL); if (!hv_vp_assist_page) { ms_hyperv.hints &= ~HV_X64_ENLIGHTENED_VMCS_RECOMMENDED; diff --git a/arch/x86/hyperv/irqdomain.c b/arch/x86/hyperv/irqdomain.c index c3ba12b1bc07..365e364268d9 100644 --- a/arch/x86/hyperv/irqdomain.c +++ b/arch/x86/hyperv/irqdomain.c @@ -248,7 +248,7 @@ static void hv_irq_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) return; } - stored_entry = kzalloc(sizeof(*stored_entry), GFP_ATOMIC); + stored_entry = kzalloc_obj(*stored_entry, GFP_ATOMIC); if (!stored_entry) { pr_debug("%s: failed to allocate chip data\n", __func__); return; diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index be7fad43a88d..07f125668852 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c @@ -531,7 +531,7 @@ static int hv_list_enc_add(const u64 *pfn_list, int count) raw_spin_unlock_irqrestore(&hv_list_enc_lock, flags); /* No adjacent region found -- create a new one */ - ent = kzalloc(sizeof(struct hv_enc_pfn_region), GFP_KERNEL); + ent = kzalloc_obj(struct hv_enc_pfn_region, GFP_KERNEL); if (!ent) return -ENOMEM; @@ -598,7 +598,7 @@ unlock_done: unlock_split: raw_spin_unlock_irqrestore(&hv_list_enc_lock, flags); - ent = kzalloc(sizeof(struct hv_enc_pfn_region), GFP_KERNEL); + ent = kzalloc_obj(struct hv_enc_pfn_region, GFP_KERNEL); if (!ent) return -ENOMEM; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 693b59b2f7d0..0ffc7de200b1 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -2160,7 +2160,7 @@ void __init_or_module alternatives_smp_module_add(struct module *mod, /* Don't bother remembering, we'll never have to undo it. */ goto smp_unlock; - smp = kzalloc(sizeof(*smp), GFP_KERNEL); + smp = kzalloc_obj(*smp, GFP_KERNEL); if (NULL == smp) /* we'll run the (safe but slow) SMP code then ... */ goto unlock; diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index c1acead6227a..852e8ff5ebd9 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -68,7 +68,8 @@ static int amd_cache_northbridges(void) amd_northbridges.num = amd_num_nodes(); - nb = kcalloc(amd_northbridges.num, sizeof(struct amd_northbridge), GFP_KERNEL); + nb = kzalloc_objs(struct amd_northbridge, amd_northbridges.num, + GFP_KERNEL); if (!nb) return -ENOMEM; diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c index 3d0a4768d603..2091cb1089a2 100644 --- a/arch/x86/kernel/amd_node.c +++ b/arch/x86/kernel/amd_node.c @@ -282,7 +282,7 @@ static int __init amd_smn_init(void) return -ENODEV; num_nodes = amd_num_nodes(); - amd_roots = kcalloc(num_nodes, sizeof(*amd_roots), GFP_KERNEL); + amd_roots = kzalloc_objs(*amd_roots, num_nodes, GFP_KERNEL); if (!amd_roots) return -ENOMEM; diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 28f934f05a85..aa3675ba08bb 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2876,7 +2876,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, if (irq_resolve_mapping(domain, (irq_hw_number_t)pin)) return -EEXIST; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 3175d7c134e9..13efc166bd3f 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -1576,7 +1576,7 @@ static int do_open(struct inode *inode, struct file *filp) { struct apm_user *as; - as = kmalloc(sizeof(*as), GFP_KERNEL); + as = kmalloc_obj(*as, GFP_KERNEL); if (as == NULL) return -ENOMEM; diff --git a/arch/x86/kernel/cpu/amd_cache_disable.c b/arch/x86/kernel/cpu/amd_cache_disable.c index 8843b9557aea..13985d2f8b1d 100644 --- a/arch/x86/kernel/cpu/amd_cache_disable.c +++ b/arch/x86/kernel/cpu/amd_cache_disable.c @@ -255,7 +255,7 @@ static void init_amd_l3_attrs(void) if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) n += 1; - amd_l3_attrs = kcalloc(n, sizeof(*amd_l3_attrs), GFP_KERNEL); + amd_l3_attrs = kzalloc_objs(*amd_l3_attrs, n, GFP_KERNEL); if (!amd_l3_attrs) return; diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index 3f1dda355307..4e7a6101e7ed 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -1088,7 +1088,7 @@ static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb (high & MASK_LOCKED_HI)) goto recurse; - b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL); + b = kzalloc_obj(struct threshold_block, GFP_KERNEL); if (!b) return -ENOMEM; @@ -1147,7 +1147,7 @@ static int threshold_create_bank(struct threshold_bank **bp, unsigned int cpu, if (!dev) return -ENODEV; - b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL); + b = kzalloc_obj(struct threshold_bank, GFP_KERNEL); if (!b) { err = -ENOMEM; goto out; @@ -1250,7 +1250,7 @@ void mce_threshold_create_device(unsigned int cpu) return; numbanks = this_cpu_read(mce_num_banks); - bp = kcalloc(numbanks, sizeof(*bp), GFP_KERNEL); + bp = kzalloc_objs(*bp, numbanks, GFP_KERNEL); if (!bp) return; diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 34440021e8cf..dd6a06ab5270 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2692,7 +2692,7 @@ static int mce_device_create(unsigned int cpu) if (dev) return 0; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->id = cpu; diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c index 8d023239ce18..ec603e2c089a 100644 --- a/arch/x86/kernel/cpu/mce/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c @@ -338,7 +338,7 @@ static __init int dev_mcelog_init_device(void) int err; mce_log_len = max(MCE_LOG_MIN_LEN, num_online_cpus()); - mcelog = kzalloc(struct_size(mcelog, entry, mce_log_len), GFP_KERNEL); + mcelog = kzalloc_flex(*mcelog, entry, mce_log_len, GFP_KERNEL); if (!mcelog) return -ENOMEM; diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index caa0f595abcf..e58a73ae431b 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -1086,7 +1086,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover, if (ret) return ret; - patch = kzalloc(sizeof(*patch), GFP_KERNEL); + patch = kzalloc_obj(*patch, GFP_KERNEL); if (!patch) { pr_err("Patch allocation failure.\n"); return -EINVAL; diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 0863733858dc..d7db12c06950 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -410,7 +410,7 @@ void __init mtrr_copy_map(void) mutex_lock(&mtrr_mutex); - cache_map = kcalloc(new_size, sizeof(*cache_map), GFP_KERNEL); + cache_map = kzalloc_objs(*cache_map, new_size, GFP_KERNEL); if (cache_map) { memmove(cache_map, init_cache_map, cache_map_n * sizeof(*cache_map)); diff --git a/arch/x86/kernel/cpu/mtrr/legacy.c b/arch/x86/kernel/cpu/mtrr/legacy.c index 2415ffaaf02c..ee7bc7b5ce96 100644 --- a/arch/x86/kernel/cpu/mtrr/legacy.c +++ b/arch/x86/kernel/cpu/mtrr/legacy.c @@ -80,7 +80,7 @@ static struct syscore mtrr_syscore = { void mtrr_register_syscore(void) { - mtrr_value = kcalloc(num_var_ranges, sizeof(*mtrr_value), GFP_KERNEL); + mtrr_value = kzalloc_objs(*mtrr_value, num_var_ranges, GFP_KERNEL); /* * The CPU has no MTRR and seems to not support SMP. They have diff --git a/arch/x86/kernel/cpu/sgx/driver.c b/arch/x86/kernel/cpu/sgx/driver.c index a42c7180900b..74fb59d96730 100644 --- a/arch/x86/kernel/cpu/sgx/driver.c +++ b/arch/x86/kernel/cpu/sgx/driver.c @@ -19,7 +19,7 @@ static int __sgx_open(struct inode *inode, struct file *file) struct sgx_encl *encl; int ret; - encl = kzalloc(sizeof(*encl), GFP_KERNEL); + encl = kzalloc_obj(*encl, GFP_KERNEL); if (!encl) return -ENOMEM; diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index cf149b9f4916..8b6c400c4008 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -854,7 +854,7 @@ int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm) if (sgx_encl_find_mm(encl, mm)) return 0; - encl_mm = kzalloc(sizeof(*encl_mm), GFP_KERNEL); + encl_mm = kzalloc_obj(*encl_mm, GFP_KERNEL); if (!encl_mm) return -ENOMEM; @@ -1163,7 +1163,7 @@ struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl, struct sgx_encl_page *encl_page; unsigned long prot; - encl_page = kzalloc(sizeof(*encl_page), GFP_KERNEL); + encl_page = kzalloc_obj(*encl_page, GFP_KERNEL); if (!encl_page) return ERR_PTR(-ENOMEM); diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index 0bc36957979d..ef6674067d80 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -27,7 +27,7 @@ struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl, bool reclaim) (SGX_ENCL_PAGE_VA_OFFSET_MASK >> 3) + 1); if (!(encl->page_cnt % SGX_VA_SLOT_COUNT)) { - va_page = kzalloc(sizeof(*va_page), GFP_KERNEL); + va_page = kzalloc_obj(*va_page, GFP_KERNEL); if (!va_page) return ERR_PTR(-ENOMEM); diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c index dc73194416ac..1021a4e33ac6 100644 --- a/arch/x86/kernel/cpu/sgx/main.c +++ b/arch/x86/kernel/cpu/sgx/main.c @@ -798,7 +798,8 @@ static bool __init sgx_page_cache_init(void) int nid; int i; - sgx_numa_nodes = kmalloc_array(num_possible_nodes(), sizeof(*sgx_numa_nodes), GFP_KERNEL); + sgx_numa_nodes = kmalloc_objs(*sgx_numa_nodes, num_possible_nodes(), + GFP_KERNEL); if (!sgx_numa_nodes) return false; diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c index 8de1f1a755f2..c7be8d0ea869 100644 --- a/arch/x86/kernel/cpu/sgx/virt.c +++ b/arch/x86/kernel/cpu/sgx/virt.c @@ -264,7 +264,7 @@ static int __sgx_vepc_open(struct inode *inode, struct file *file) { struct sgx_vepc *vepc; - vepc = kzalloc(sizeof(struct sgx_vepc), GFP_KERNEL); + vepc = kzalloc_obj(struct sgx_vepc, GFP_KERNEL); if (!vepc) return -ENOMEM; mutex_init(&vepc->lock); diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index d6387dde3ff9..43884229c421 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -544,7 +544,7 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id) if (x86_vector_domain == NULL) return NULL; - domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL); + domain_info = kzalloc_obj(*domain_info, GFP_KERNEL); if (!domain_info) return NULL; @@ -1038,7 +1038,7 @@ int __init hpet_enable(void) if (IS_ENABLED(CONFIG_HPET_EMULATE_RTC) && channels < 2) goto out_nohpet; - hc = kcalloc(channels, sizeof(*hc), GFP_KERNEL); + hc = kzalloc_objs(*hc, channels, GFP_KERNEL); if (!hc) { pr_warn("Disabling HPET.\n"); goto out_nohpet; diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index ff40f09ad911..30ab130329dc 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -90,7 +90,7 @@ long ksys_ioperm(unsigned long from, unsigned long num, int turn_on) /* No point to allocate a bitmap just to clear permissions */ if (!turn_on) return 0; - iobm = kmalloc(sizeof(*iobm), GFP_KERNEL); + iobm = kmalloc_obj(*iobm, GFP_KERNEL); if (!iobm) return -ENOMEM; diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index e2e89bebcbc3..4d7bf56524d8 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c @@ -102,7 +102,7 @@ static int __init create_setup_data_nodes(struct dentry *parent) pa_data = boot_params.hdr.setup_data; while (pa_data) { - node = kmalloc(sizeof(*node), GFP_KERNEL); + node = kmalloc_obj(*node, GFP_KERNEL); if (!node) { error = -ENOMEM; goto err_dir; diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 251edc5a040f..b7ba1ec486f9 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -682,7 +682,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, goto out_free_params; /* Allocate loader specific data */ - ldata = kzalloc(sizeof(struct bzimage64_data), GFP_KERNEL); + ldata = kzalloc_obj(struct bzimage64_data, GFP_KERNEL); if (!ldata) { ret = -ENOMEM; goto out_free_params; diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c index d547de9b3ed8..c5614b59be4a 100644 --- a/arch/x86/kernel/ksysfs.c +++ b/arch/x86/kernel/ksysfs.c @@ -344,7 +344,7 @@ static int __init create_setup_data_nodes(struct kobject *parent) if (ret) goto out_setup_data_kobj; - kobjp = kmalloc_array(nr, sizeof(*kobjp), GFP_KERNEL); + kobjp = kmalloc_objs(*kobjp, nr, GFP_KERNEL); if (!kobjp) { ret = -ENOMEM; goto out_setup_data_kobj; diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 26ab6f8e36df..3bc062363814 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -226,7 +226,7 @@ again: */ if (!dummy) { raw_spin_unlock(&b->lock); - dummy = kzalloc(sizeof(*dummy), GFP_ATOMIC); + dummy = kzalloc_obj(*dummy, GFP_ATOMIC); /* * Continue looping on allocation failure, eventually diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 0f19ef355f5f..40c5bf97dd5c 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -154,7 +154,7 @@ static struct ldt_struct *alloc_ldt_struct(unsigned int num_entries) if (num_entries > LDT_ENTRIES) return NULL; - new_ldt = kmalloc(sizeof(struct ldt_struct), GFP_KERNEL_ACCOUNT); + new_ldt = kmalloc_obj(struct ldt_struct, GFP_KERNEL_ACCOUNT); if (!new_ldt) return NULL; diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 619dddf54424..61d37f5a5ff9 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c @@ -696,7 +696,7 @@ static struct uprobe_trampoline *create_uprobe_trampoline(unsigned long vaddr) if (IS_ERR_VALUE(vaddr)) return NULL; - tramp = kzalloc(sizeof(*tramp), GFP_KERNEL); + tramp = kzalloc_obj(*tramp, GFP_KERNEL); if (unlikely(!tramp)) return NULL; diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index e6cc84143f3e..3bb70763af9c 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -232,7 +232,7 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus) } if (!vm86) { - if (!(vm86 = kzalloc(sizeof(*vm86), GFP_KERNEL))) + if (!(vm86 = kzalloc_obj(*vm86, GFP_KERNEL))) return -ENOMEM; tsk->thread.vm86 = vm86; } diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 7fe4e58a6ebf..c196aa0c1bd1 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -602,7 +602,7 @@ int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu, if (IS_ERR(e)) return PTR_ERR(e); - e2 = kvmalloc_array(cpuid->nent, sizeof(*e2), GFP_KERNEL_ACCOUNT); + e2 = kvmalloc_objs(*e2, cpuid->nent, GFP_KERNEL_ACCOUNT); if (!e2) { r = -ENOMEM; goto out_free_cpuid; @@ -1991,7 +1991,8 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid, if (sanity_check_entries(entries, cpuid->nent, type)) return -EINVAL; - array.entries = kvcalloc(cpuid->nent, sizeof(struct kvm_cpuid_entry2), GFP_KERNEL); + array.entries = kvzalloc_objs(struct kvm_cpuid_entry2, cpuid->nent, + GFP_KERNEL); if (!array.entries) return -ENOMEM; diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 49bf744ca8e3..30202942289a 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -968,7 +968,7 @@ int kvm_hv_vcpu_init(struct kvm_vcpu *vcpu) if (hv_vcpu) return 0; - hv_vcpu = kzalloc(sizeof(struct kvm_vcpu_hv), GFP_KERNEL_ACCOUNT); + hv_vcpu = kzalloc_obj(struct kvm_vcpu_hv, GFP_KERNEL_ACCOUNT); if (!hv_vcpu) return -ENOMEM; diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 850972deac8e..1982b0077ddd 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -740,7 +740,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags) pid_t pid_nr; int ret; - pit = kzalloc(sizeof(struct kvm_pit), GFP_KERNEL_ACCOUNT); + pit = kzalloc_obj(struct kvm_pit, GFP_KERNEL_ACCOUNT); if (!pit) return NULL; diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 2ac7f1678c46..59e28c45d7dc 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c @@ -587,7 +587,7 @@ int kvm_pic_init(struct kvm *kvm) struct kvm_pic *s; int ret; - s = kzalloc(sizeof(struct kvm_pic), GFP_KERNEL_ACCOUNT); + s = kzalloc_obj(struct kvm_pic, GFP_KERNEL_ACCOUNT); if (!s) return -ENOMEM; spin_lock_init(&s->lock); diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index a38a8e2ac70b..bb257793b6cb 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c @@ -717,7 +717,7 @@ int kvm_ioapic_init(struct kvm *kvm) struct kvm_ioapic *ioapic; int ret; - ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL_ACCOUNT); + ioapic = kzalloc_obj(struct kvm_ioapic, GFP_KERNEL_ACCOUNT); if (!ioapic) return -ENOMEM; spin_lock_init(&ioapic->lock); diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 2332a258de91..9381c58d4c85 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -3058,7 +3058,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) return 0; } - apic = kzalloc(sizeof(*apic), GFP_KERNEL_ACCOUNT); + apic = kzalloc_obj(*apic, GFP_KERNEL_ACCOUNT); if (!apic) goto nomem; diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 3911ac9bddfd..b922a8b00057 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3971,7 +3971,7 @@ static int kvm_mmu_alloc_page_hash(struct kvm *kvm) if (kvm->arch.mmu_page_hash) return 0; - h = kvcalloc(KVM_NUM_MMU_PAGES, sizeof(*h), GFP_KERNEL_ACCOUNT); + h = kvzalloc_objs(*h, KVM_NUM_MMU_PAGES, GFP_KERNEL_ACCOUNT); if (!h) return -ENOMEM; diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index de90b104a0dd..999fd3373dba 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1781,7 +1781,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu, if (clear_user(user_vmcb, KVM_STATE_NESTED_SVM_VMCB_SIZE)) return -EFAULT; - ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kzalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return -ENOMEM; diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index ea515cf41168..3f9c1aa39a0a 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2512,7 +2512,7 @@ static int snp_launch_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) if (ret) return ret; - data = kzalloc(sizeof(*data), GFP_KERNEL_ACCOUNT); + data = kzalloc_obj(*data, GFP_KERNEL_ACCOUNT); if (!data) return -ENOMEM; @@ -2711,7 +2711,7 @@ int sev_mem_enc_register_region(struct kvm *kvm, if (range->addr > ULONG_MAX || range->size > ULONG_MAX) return -EINVAL; - region = kzalloc(sizeof(*region), GFP_KERNEL_ACCOUNT); + region = kzalloc_obj(*region, GFP_KERNEL_ACCOUNT); if (!region) return -ENOMEM; diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c index 5df9d32d2058..adbb3060ae2f 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -2218,8 +2218,8 @@ static int tdx_get_capabilities(struct kvm_tdx_cmd *cmd) if (nr_user_entries < td_conf->num_cpuid_config) return -E2BIG; - caps = kzalloc(struct_size(caps, cpuid.entries, - td_conf->num_cpuid_config), GFP_KERNEL); + caps = kzalloc_flex(*caps, cpuid.entries, td_conf->num_cpuid_config, + GFP_KERNEL); if (!caps) return -ENOMEM; @@ -2407,8 +2407,8 @@ static int __tdx_td_init(struct kvm *kvm, struct td_params *td_params, kvm_tdx->td.tdcs_nr_pages = tdx_sysinfo->td_ctrl.tdcs_base_size / PAGE_SIZE; /* TDVPS = TDVPR(4K page) + TDCX(multiple 4K pages), -1 for TDVPR. */ kvm_tdx->td.tdcx_nr_pages = tdx_sysinfo->td_ctrl.tdvps_base_size / PAGE_SIZE - 1; - tdcs_pages = kcalloc(kvm_tdx->td.tdcs_nr_pages, sizeof(*kvm_tdx->td.tdcs_pages), - GFP_KERNEL); + tdcs_pages = kzalloc_objs(*kvm_tdx->td.tdcs_pages, + kvm_tdx->td.tdcs_nr_pages, GFP_KERNEL); if (!tdcs_pages) goto free_tdr; @@ -2743,7 +2743,7 @@ static int tdx_td_init(struct kvm *kvm, struct kvm_tdx_cmd *cmd) goto out; } - td_params = kzalloc(sizeof(struct td_params), GFP_KERNEL); + td_params = kzalloc_obj(struct td_params, GFP_KERNEL); if (!td_params) { ret = -ENOMEM; goto out; diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 391f4a5ce6dd..4344847f7119 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6208,7 +6208,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, r = -EINVAL; if (!lapic_in_kernel(vcpu)) goto out; - u.lapic = kzalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL); + u.lapic = kzalloc_obj(struct kvm_lapic_state, GFP_KERNEL); r = -ENOMEM; if (!u.lapic) @@ -6410,7 +6410,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, if (vcpu->arch.guest_fpu.uabi_size > sizeof(struct kvm_xsave)) break; - u.xsave = kzalloc(sizeof(struct kvm_xsave), GFP_KERNEL); + u.xsave = kzalloc_obj(struct kvm_xsave, GFP_KERNEL); r = -ENOMEM; if (!u.xsave) break; @@ -6459,7 +6459,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, } case KVM_GET_XCRS: { - u.xcrs = kzalloc(sizeof(struct kvm_xcrs), GFP_KERNEL); + u.xcrs = kzalloc_obj(struct kvm_xcrs, GFP_KERNEL); r = -ENOMEM; if (!u.xcrs) break; @@ -6619,7 +6619,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, vcpu->arch.guest_state_protected) goto out; - u.sregs2 = kzalloc(sizeof(struct kvm_sregs2), GFP_KERNEL); + u.sregs2 = kzalloc_obj(struct kvm_sregs2, GFP_KERNEL); r = -ENOMEM; if (!u.sregs2) goto out; @@ -6994,7 +6994,7 @@ static struct kvm_x86_msr_filter *kvm_alloc_msr_filter(bool default_allow) { struct kvm_x86_msr_filter *msr_filter; - msr_filter = kzalloc(sizeof(*msr_filter), GFP_KERNEL_ACCOUNT); + msr_filter = kzalloc_obj(*msr_filter, GFP_KERNEL_ACCOUNT); if (!msr_filter) return NULL; diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 28eeb1b2a16c..1838a49eee76 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -1514,8 +1514,7 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode, return true; } - ports = kmalloc_array(sched_poll.nr_ports, - sizeof(*ports), GFP_KERNEL); + ports = kmalloc_objs(*ports, sched_poll.nr_ports, GFP_KERNEL); if (!ports) { *r = -ENOMEM; return true; @@ -2116,7 +2115,7 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm, struct evtchnfd *evtchnfd; int ret = -EINVAL; - evtchnfd = kzalloc(sizeof(struct evtchnfd), GFP_KERNEL); + evtchnfd = kzalloc_obj(struct evtchnfd, GFP_KERNEL); if (!evtchnfd) return -ENOMEM; @@ -2214,7 +2213,7 @@ static int kvm_xen_eventfd_reset(struct kvm *kvm) idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) n++; - all_evtchnfds = kmalloc_array(n, sizeof(struct evtchnfd *), GFP_KERNEL); + all_evtchnfds = kmalloc_objs(struct evtchnfd *, n, GFP_KERNEL); if (!all_evtchnfds) { mutex_unlock(&kvm->arch.xen.xen_lock); return -ENOMEM; diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 9f82019179e1..6ac981cec652 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c @@ -387,7 +387,7 @@ static int add_kmmio_fault_page(unsigned long addr) return 0; } - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return -1; @@ -562,7 +562,7 @@ void unregister_kmmio_probe(struct kmmio_probe *p) if (!release_list) return; - drelease = kmalloc(sizeof(*drelease), GFP_ATOMIC); + drelease = kmalloc_obj(*drelease, GFP_ATOMIC); if (!drelease) { pr_crit("leaking kmmio_fault_page objects.\n"); return; diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index c3317f0650d8..63294d590346 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -220,7 +220,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size, void __iomem *addr) { static atomic_t next_id; - struct remap_trace *trace = kmalloc(sizeof(*trace), GFP_KERNEL); + struct remap_trace *trace = kmalloc_obj(*trace, GFP_KERNEL); /* These are page-unaligned. */ struct mmiotrace_map map = { .phys = offset, diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index 8a3d9722f602..fdf6ed96cbd0 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -574,7 +574,7 @@ int memtype_reserve(u64 start, u64 end, enum page_cache_mode req_type, return -EINVAL; } - entry_new = kzalloc(sizeof(struct memtype), GFP_KERNEL); + entry_new = kzalloc_obj(struct memtype, GFP_KERNEL); if (!entry_new) return -ENOMEM; @@ -966,7 +966,7 @@ static struct memtype *memtype_get_idx(loff_t pos) struct memtype *entry_print; int ret; - entry_print = kzalloc(sizeof(struct memtype), GFP_KERNEL); + entry_print = kzalloc_obj(struct memtype, GFP_KERNEL); if (!entry_print) return NULL; diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 070ba80e39d7..0a0127c9e2e2 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -3758,7 +3758,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) jit_data = prog->aux->jit_data; if (!jit_data) { - jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); if (!jit_data) { prog = orig_prog; goto out; @@ -3794,7 +3794,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) padding = true; goto skip_init_addrs; } - addrs = kvmalloc_array(prog->len + 1, sizeof(*addrs), GFP_KERNEL); + addrs = kvmalloc_objs(*addrs, prog->len + 1, GFP_KERNEL); if (!addrs) { prog = orig_prog; goto out_addrs; diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index de0f9e5f9f73..e6f3475bb773 100644 --- a/arch/x86/net/bpf_jit_comp32.c +++ b/arch/x86/net/bpf_jit_comp32.c @@ -2545,7 +2545,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) prog = tmp; } - addrs = kmalloc_array(prog->len, sizeof(*addrs), GFP_KERNEL); + addrs = kmalloc_objs(*addrs, prog->len, GFP_KERNEL); if (!addrs) { prog = orig_prog; goto out; diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 0c316bae1726..d0e1cd677eba 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -562,7 +562,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) } else { struct pci_root_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) dev_err(&root->device->dev, "pci_bus %04x:%02x: ignored (out of memory)\n", diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index e4a525e59eaf..53037dba4c97 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c @@ -72,7 +72,7 @@ struct pci_root_info __init *alloc_pci_root_info(int bus_min, int bus_max, { struct pci_root_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return info; @@ -132,7 +132,7 @@ void update_res(struct pci_root_info *info, resource_size_t start, addit: /* need to add that */ - root_res = kzalloc(sizeof(*root_res), GFP_KERNEL); + root_res = kzalloc_obj(*root_res, GFP_KERNEL); if (!root_res) return; diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index ddb798603201..12d4e522d863 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -461,7 +461,7 @@ void pcibios_scan_root(int busnum) struct pci_sysdata *sd; LIST_HEAD(resources); - sd = kzalloc(sizeof(*sd), GFP_KERNEL); + sd = kzalloc_obj(*sd, GFP_KERNEL); if (!sd) { printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum); return; diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 25076a5acd96..3c92893ba725 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -771,7 +771,7 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) if (i == 8) return; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return; diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index f2f4a5d50b27..5e99b12300c9 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -81,7 +81,7 @@ pcibios_save_fw_addr(struct pci_dev *dev, int idx, resource_size_t fw_addr) map = pcibios_fwaddrmap_lookup(dev); if (!map) { spin_unlock_irqrestore(&pcibios_fwaddrmap_lock, flags); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return; diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 1f4522325920..14098363b841 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -77,7 +77,7 @@ static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, if (addr == 0) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index b8755cde2419..4f356d67cc31 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -173,7 +173,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) if (type == PCI_CAP_ID_MSI && nvec > 1) return 1; - v = kcalloc(max(1, nvec), sizeof(int), GFP_KERNEL); + v = kzalloc_objs(int, max(1, nvec), GFP_KERNEL); if (!v) return -ENOMEM; diff --git a/arch/x86/platform/efi/runtime-map.c b/arch/x86/platform/efi/runtime-map.c index a6f02cef3ca2..77699893b5bb 100644 --- a/arch/x86/platform/efi/runtime-map.c +++ b/arch/x86/platform/efi/runtime-map.c @@ -114,7 +114,7 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr, return ERR_PTR(-ENOMEM); } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { kset_unregister(map_kset); map_kset = NULL; @@ -166,7 +166,7 @@ static int __init efi_runtime_map_init(void) if (!efi_enabled(EFI_MEMMAP) || !efi_kobj) return 0; - map_entries = kcalloc(efi.memmap.nr_map, sizeof(entry), GFP_KERNEL); + map_entries = kzalloc_objs(entry, efi.memmap.nr_map, GFP_KERNEL); if (!map_entries) { ret = -ENOMEM; goto out; diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geode/geode-common.c index 8fd78e60bf15..f3c9eff2d374 100644 --- a/arch/x86/platform/geode/geode-common.c +++ b/arch/x86/platform/geode/geode-common.c @@ -113,7 +113,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds, return -EINVAL; } - swnodes = kcalloc(n_leds, sizeof(*swnodes), GFP_KERNEL); + swnodes = kzalloc_objs(*swnodes, n_leds, GFP_KERNEL); if (!swnodes) return -ENOMEM; @@ -121,7 +121,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds, * Each LED is represented by 3 properties: "gpios", * "linux,default-trigger", and am empty terminator. */ - props = kcalloc(n_leds * 3, sizeof(*props), GFP_KERNEL); + props = kzalloc_objs(*props, n_leds * 3, GFP_KERNEL); if (!props) { err = -ENOMEM; goto err_free_swnodes; diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 916441f5e85c..5a7d96bbd6d8 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -394,7 +394,7 @@ static int msr_build_context(const u32 *msr_id, const int num) total_num = saved_msrs->num + num; - msr_array = kmalloc_array(total_num, sizeof(struct saved_msr), GFP_KERNEL); + msr_array = kmalloc_objs(struct saved_msr, total_num, GFP_KERNEL); if (!msr_array) { pr_err("x86/pm: Can not allocate memory to save/restore MSRs during suspend.\n"); return -ENOMEM; diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index ee643a6cd691..5a31ced2788c 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -313,7 +313,7 @@ static bool __init alloc_rmp_segment_desc(u64 segment_pa, u64 segment_size, u64 return false; } - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) { memunmap(rmp_segment); return false; diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index 5ce4ebe99774..047cb2063202 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -194,7 +194,7 @@ static int add_tdx_memblock(struct list_head *tmb_list, unsigned long start_pfn, { struct tdx_memblock *tmb; - tmb = kmalloc(sizeof(*tmb), GFP_KERNEL); + tmb = kmalloc_obj(*tmb, GFP_KERNEL); if (!tmb) return -ENOMEM; diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c index 1e681bf62561..d8149572b4f7 100644 --- a/arch/x86/xen/grant-table.c +++ b/arch/x86/xen/grant-table.c @@ -101,7 +101,7 @@ static int gnttab_apply(pte_t *pte, unsigned long addr, void *data) static int arch_gnttab_valloc(struct gnttab_vm_area *area, unsigned nr_frames) { - area->ptes = kmalloc_array(nr_frames, sizeof(*area->ptes), GFP_KERNEL); + area->ptes = kmalloc_objs(*area->ptes, nr_frames, GFP_KERNEL); if (area->ptes == NULL) return -ENOMEM; area->area = get_vm_area(PAGE_SIZE * nr_frames, VM_IOREMAP); diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c index c40f326f0c3a..82894426cb99 100644 --- a/arch/x86/xen/smp_pv.c +++ b/arch/x86/xen/smp_pv.c @@ -230,7 +230,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map)) return 0; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (ctxt == NULL) { cpumask_clear_cpu(cpu, xen_cpu_initialized_map); return -ENOMEM; diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index ff0600a0584c..b5de377dc96f 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c @@ -123,7 +123,7 @@ static int tie_get(struct task_struct *target, int ret; struct pt_regs *regs = task_pt_regs(target); struct thread_info *ti = task_thread_info(target); - elf_xtregs_t *newregs = kzalloc(sizeof(elf_xtregs_t), GFP_KERNEL); + elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t, GFP_KERNEL); if (!newregs) return -ENOMEM; @@ -156,7 +156,7 @@ static int tie_set(struct task_struct *target, int ret; struct pt_regs *regs = task_pt_regs(target); struct thread_info *ti = task_thread_info(target); - elf_xtregs_t *newregs = kzalloc(sizeof(elf_xtregs_t), GFP_KERNEL); + elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t, GFP_KERNEL); if (!newregs) return -ENOMEM; diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index 3cafc8feddee..3e54f6377c81 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c @@ -320,7 +320,7 @@ static int __init simdisk_init(void) if (simdisk_count > MAX_SIMDISK_COUNT) simdisk_count = MAX_SIMDISK_COUNT; - sddev = kmalloc_array(simdisk_count, sizeof(*sddev), GFP_KERNEL); + sddev = kmalloc_objs(*sddev, simdisk_count, GFP_KERNEL); if (sddev == NULL) goto out_unregister; diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 6a75fe1c7a5c..ac83b0668764 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -494,7 +494,7 @@ static struct blkcg_policy_data *bfq_cpd_alloc(gfp_t gfp) { struct bfq_group_data *bgd; - bgd = kzalloc(sizeof(*bgd), gfp); + bgd = kzalloc_obj(*bgd, gfp); if (!bgd) return NULL; diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index b180ce583951..141c602d5e85 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -606,7 +606,7 @@ retry: spin_unlock_irq(&bfqd->lock); if (entities != inline_entities) kfree(entities); - entities = kmalloc_array(depth, sizeof(*entities), GFP_NOIO); + entities = kmalloc_objs(*entities, depth, GFP_NOIO); if (!entities) return false; alloc_depth = depth; @@ -938,8 +938,8 @@ void bfq_weights_tree_add(struct bfq_queue *bfqq) } } - bfqq->weight_counter = kzalloc(sizeof(struct bfq_weight_counter), - GFP_ATOMIC); + bfqq->weight_counter = kzalloc_obj(struct bfq_weight_counter, + GFP_ATOMIC); /* * In the unlucky event of an allocation failure, we just diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 09eeaf6e74b8..dc2e771f11ae 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -97,7 +97,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, if (WARN_ON_ONCE(bio_has_crypt_ctx(bio))) return ERR_PTR(-EOPNOTSUPP); - bia = kmalloc(struct_size(bia, bvecs, nr_vecs), gfp_mask); + bia = kmalloc_flex(*bia, bvecs, nr_vecs, gfp_mask); if (unlikely(!bia)) return ERR_PTR(-ENOMEM); bio_integrity_init(bio, &bia->bip, bia->bvecs, nr_vecs); @@ -322,7 +322,7 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter) if (nr_vecs > BIO_MAX_VECS) return -E2BIG; if (nr_vecs > UIO_FASTIOV) { - bvec = kcalloc(nr_vecs, sizeof(*bvec), GFP_KERNEL); + bvec = kzalloc_objs(*bvec, nr_vecs, GFP_KERNEL); if (!bvec) return -ENOMEM; pages = NULL; diff --git a/block/bio.c b/block/bio.c index 8203bb7455a9..c8e14c330a35 100644 --- a/block/bio.c +++ b/block/bio.c @@ -84,7 +84,7 @@ static DEFINE_XARRAY(bio_slabs); static struct bio_slab *create_bio_slab(unsigned int size) { - struct bio_slab *bslab = kzalloc(sizeof(*bslab), GFP_KERNEL); + struct bio_slab *bslab = kzalloc_obj(*bslab, GFP_KERNEL); if (!bslab) return NULL; diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 3cffb68ba5d8..de609a3e0228 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1417,7 +1417,7 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) { blkcg = &blkcg_root; } else { - blkcg = kzalloc(sizeof(*blkcg), GFP_KERNEL); + blkcg = kzalloc_obj(*blkcg, GFP_KERNEL); if (!blkcg) goto unlock; } diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c index a331b061dbf4..9a05abe8d43f 100644 --- a/block/blk-crypto-fallback.c +++ b/block/blk-crypto-fallback.c @@ -546,8 +546,8 @@ static int blk_crypto_fallback_init(void) goto out; /* Dynamic allocation is needed because of lockdep_register_key(). */ - blk_crypto_fallback_profile = - kzalloc(sizeof(*blk_crypto_fallback_profile), GFP_KERNEL); + blk_crypto_fallback_profile = kzalloc_obj(*blk_crypto_fallback_profile, + GFP_KERNEL); if (!blk_crypto_fallback_profile) { err = -ENOMEM; goto fail_free_bioset; @@ -574,9 +574,8 @@ static int blk_crypto_fallback_init(void) if (!blk_crypto_wq) goto fail_destroy_profile; - blk_crypto_keyslots = kcalloc(blk_crypto_num_keyslots, - sizeof(blk_crypto_keyslots[0]), - GFP_KERNEL); + blk_crypto_keyslots = kzalloc_objs(blk_crypto_keyslots[0], + blk_crypto_num_keyslots, GFP_KERNEL); if (!blk_crypto_keyslots) goto fail_free_wq; diff --git a/block/blk-crypto-profile.c b/block/blk-crypto-profile.c index 81918f6e0cae..58032fd7faff 100644 --- a/block/blk-crypto-profile.c +++ b/block/blk-crypto-profile.c @@ -93,8 +93,7 @@ int blk_crypto_profile_init(struct blk_crypto_profile *profile, /* Initialize keyslot management data. */ - profile->slots = kvcalloc(num_slots, sizeof(profile->slots[0]), - GFP_KERNEL); + profile->slots = kvzalloc_objs(profile->slots[0], num_slots, GFP_KERNEL); if (!profile->slots) goto err_destroy; @@ -121,8 +120,8 @@ int blk_crypto_profile_init(struct blk_crypto_profile *profile, profile->log_slot_ht_size = ilog2(slot_hashtable_size); profile->slot_hashtable = - kvmalloc_array(slot_hashtable_size, - sizeof(profile->slot_hashtable[0]), GFP_KERNEL); + kvmalloc_objs(profile->slot_hashtable[0], slot_hashtable_size, + GFP_KERNEL); if (!profile->slot_hashtable) goto err_destroy; for (i = 0; i < slot_hashtable_size; i++) diff --git a/block/blk-crypto-sysfs.c b/block/blk-crypto-sysfs.c index e832f403f200..e6c76d672829 100644 --- a/block/blk-crypto-sysfs.c +++ b/block/blk-crypto-sysfs.c @@ -170,7 +170,7 @@ int blk_crypto_sysfs_register(struct gendisk *disk) if (!q->crypto_profile) return 0; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return -ENOMEM; obj->profile = q->crypto_profile; diff --git a/block/blk-iocost.c b/block/blk-iocost.c index ef543d163d46..32faf0a56bd3 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -2882,7 +2882,7 @@ static int blk_iocost_init(struct gendisk *disk) struct ioc *ioc; int i, cpu, ret; - ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); + ioc = kzalloc_obj(*ioc, GFP_KERNEL); if (!ioc) return -ENOMEM; @@ -2946,7 +2946,7 @@ static struct blkcg_policy_data *ioc_cpd_alloc(gfp_t gfp) { struct ioc_cgrp *iocc; - iocc = kzalloc(sizeof(struct ioc_cgrp), gfp); + iocc = kzalloc_obj(struct ioc_cgrp, gfp); if (!iocc) return NULL; diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index f7434278cd29..609a71476bff 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -760,7 +760,7 @@ static int blk_iolatency_init(struct gendisk *disk) struct blk_iolatency *blkiolat; int ret; - blkiolat = kzalloc(sizeof(*blkiolat), GFP_KERNEL); + blkiolat = kzalloc_obj(*blkiolat, GFP_KERNEL); if (!blkiolat) return -ENOMEM; diff --git a/block/blk-ioprio.c b/block/blk-ioprio.c index 13659dc15c3f..8fa8bca35062 100644 --- a/block/blk-ioprio.c +++ b/block/blk-ioprio.c @@ -99,7 +99,7 @@ static struct blkcg_policy_data *ioprio_alloc_cpd(gfp_t gfp) { struct ioprio_blkcg *blkcg; - blkcg = kzalloc(sizeof(*blkcg), gfp); + blkcg = kzalloc_obj(*blkcg, gfp); if (!blkcg) return NULL; blkcg->prio_policy = POLICY_NO_CHANGE; diff --git a/block/blk-map.c b/block/blk-map.c index 4533094d9458..53bdd100aa4b 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -26,7 +26,7 @@ static struct bio_map_data *bio_alloc_map_data(struct iov_iter *data, if (data->nr_segs > UIO_MAXIOV) return NULL; - bmd = kmalloc(struct_size(bmd, iov, data->nr_segs), gfp_mask); + bmd = kmalloc_flex(*bmd, iov, data->nr_segs, gfp_mask); if (!bmd) return NULL; bmd->iter = *data; diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 97c3c8f45a9b..0d085a53f0d7 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -489,7 +489,7 @@ int blk_mq_alloc_sched_ctx_batch(struct xarray *elv_tbl, lockdep_assert_held_write(&set->update_nr_hwq_lock); list_for_each_entry(q, &set->tag_list, tag_set_list) { - ctx = kzalloc(sizeof(struct elv_change_ctx), GFP_KERNEL); + ctx = kzalloc_obj(struct elv_change_ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -514,7 +514,7 @@ struct elevator_tags *blk_mq_alloc_sched_tags(struct blk_mq_tag_set *set, else nr_tags = nr_hw_queues; - et = kmalloc(struct_size(et, tags, nr_tags), gfp); + et = kmalloc_flex(*et, tags, nr_tags, gfp); if (!et) return NULL; diff --git a/block/blk-mq.c b/block/blk-mq.c index d5602ff62c7c..e0bbe087766f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4362,7 +4362,7 @@ static int blk_mq_alloc_ctxs(struct request_queue *q) struct blk_mq_ctxs *ctxs; int cpu; - ctxs = kzalloc(sizeof(*ctxs), GFP_KERNEL); + ctxs = kzalloc_obj(*ctxs, GFP_KERNEL); if (!ctxs) return -ENOMEM; @@ -4879,7 +4879,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) set->nr_hw_queues = nr_cpu_ids; if (set->flags & BLK_MQ_F_BLOCKING) { - set->srcu = kmalloc(sizeof(*set->srcu), GFP_KERNEL); + set->srcu = kmalloc_obj(*set->srcu, GFP_KERNEL); if (!set->srcu) return -ENOMEM; ret = init_srcu_struct(set->srcu); diff --git a/block/blk-stat.c b/block/blk-stat.c index 682a8ddb1173..2eaa5e27cdb8 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -103,12 +103,11 @@ blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *), { struct blk_stat_callback *cb; - cb = kmalloc(sizeof(*cb), GFP_KERNEL); + cb = kmalloc_obj(*cb, GFP_KERNEL); if (!cb) return NULL; - cb->stat = kmalloc_array(buckets, sizeof(struct blk_rq_stat), - GFP_KERNEL); + cb->stat = kmalloc_objs(struct blk_rq_stat, buckets, GFP_KERNEL); if (!cb->stat) { kfree(cb); return NULL; @@ -207,7 +206,7 @@ struct blk_queue_stats *blk_alloc_queue_stats(void) { struct blk_queue_stats *stats; - stats = kmalloc(sizeof(*stats), GFP_KERNEL); + stats = kmalloc_obj(*stats, GFP_KERNEL); if (!stats) return NULL; diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 6dba71e87387..91115508179b 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -713,7 +713,7 @@ static int wbt_data_dir(const struct request *rq) static struct rq_wb *wbt_alloc(void) { - struct rq_wb *rwb = kzalloc(sizeof(*rwb), GFP_KERNEL); + struct rq_wb *rwb = kzalloc_obj(*rwb, GFP_KERNEL); if (!rwb) return NULL; diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 846b8844f04a..54ee346ddb5a 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -1804,8 +1804,8 @@ static int disk_alloc_zone_resources(struct gendisk *disk, min(ilog2(pool_size) + 1, BLK_ZONE_WPLUG_MAX_HASH_BITS); disk->zone_wplugs_hash = - kcalloc(disk_zone_wplugs_hash_size(disk), - sizeof(struct hlist_head), GFP_KERNEL); + kzalloc_objs(struct hlist_head, + disk_zone_wplugs_hash_size(disk), GFP_KERNEL); if (!disk->zone_wplugs_hash) return -ENOMEM; diff --git a/block/bsg-lib.c b/block/bsg-lib.c index 9ceb5d0832f5..ca08c6b7fb9c 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -368,7 +368,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name, struct request_queue *q; int ret = -ENOMEM; - bset = kzalloc(sizeof(*bset), GFP_KERNEL); + bset = kzalloc_obj(*bset, GFP_KERNEL); if (!bset) return ERR_PTR(-ENOMEM); diff --git a/block/bsg.c b/block/bsg.c index 72157a59b788..5f87ea8d5f64 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -192,7 +192,7 @@ struct bsg_device *bsg_register_queue(struct request_queue *q, struct bsg_device *bd; int ret; - bd = kzalloc(sizeof(*bd), GFP_KERNEL); + bd = kzalloc_obj(*bd, GFP_KERNEL); if (!bd) return ERR_PTR(-ENOMEM); bd->max_queue = BSG_DEFAULT_CMDS; diff --git a/block/disk-events.c b/block/disk-events.c index 2f697224386a..04d44d05ed53 100644 --- a/block/disk-events.c +++ b/block/disk-events.c @@ -436,7 +436,7 @@ int disk_alloc_events(struct gendisk *disk) if (!disk->fops->check_events || !disk->events) return 0; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) { pr_warn("%s: failed to initialize events\n", disk->disk_name); return -ENOMEM; diff --git a/block/fops.c b/block/fops.c index 4d32785b31d9..57a53e0d1016 100644 --- a/block/fops.c +++ b/block/fops.c @@ -65,8 +65,7 @@ static ssize_t __blkdev_direct_IO_simple(struct kiocb *iocb, if (nr_pages <= DIO_INLINE_BIO_VECS) vecs = inline_vecs; else { - vecs = kmalloc_array(nr_pages, sizeof(struct bio_vec), - GFP_KERNEL); + vecs = kmalloc_objs(struct bio_vec, nr_pages, GFP_KERNEL); if (!vecs) return -ENOMEM; } diff --git a/block/genhd.c b/block/genhd.c index 69c75117ba2c..15866ccf5c33 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -264,7 +264,7 @@ int __register_blkdev(unsigned int major, const char *name, goto out; } - p = kmalloc(sizeof(struct blk_major_name), GFP_KERNEL); + p = kmalloc_obj(struct blk_major_name, GFP_KERNEL); if (p == NULL) { ret = -ENOMEM; goto out; @@ -914,7 +914,7 @@ static void *disk_seqf_start(struct seq_file *seqf, loff_t *pos) struct class_dev_iter *iter; struct device *dev; - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return ERR_PTR(-ENOMEM); diff --git a/block/holder.c b/block/holder.c index 791091a7eac2..1e7b88815323 100644 --- a/block/holder.c +++ b/block/holder.c @@ -92,7 +92,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) goto out_unlock; } - holder = kzalloc(sizeof(*holder), GFP_KERNEL); + holder = kzalloc_obj(*holder, GFP_KERNEL); if (!holder) { ret = -ENOMEM; goto out_unlock; diff --git a/block/partitions/aix.c b/block/partitions/aix.c index 85f4b967565e..97c8fa2a866f 100644 --- a/block/partitions/aix.c +++ b/block/partitions/aix.c @@ -199,7 +199,7 @@ int aix_partition(struct parsed_partitions *state) numlvs = be16_to_cpu(p->numlvs); put_dev_sector(sect); } - lvip = kcalloc(state->limit, sizeof(struct lv_info), GFP_KERNEL); + lvip = kzalloc_objs(struct lv_info, state->limit, GFP_KERNEL); if (!lvip) return 0; if (numlvs && (d = read_part_sector(state, vgda_sector + 1, §))) { diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c index da3e719d8e51..5d604a64842e 100644 --- a/block/partitions/cmdline.c +++ b/block/partitions/cmdline.c @@ -46,7 +46,7 @@ static int parse_subpart(struct cmdline_subpart **subpart, char *partdef) *subpart = NULL; - new_subpart = kzalloc(sizeof(struct cmdline_subpart), GFP_KERNEL); + new_subpart = kzalloc_obj(struct cmdline_subpart, GFP_KERNEL); if (!new_subpart) return -ENOMEM; @@ -122,7 +122,7 @@ static int parse_parts(struct cmdline_parts **parts, char *bdevdef) *parts = NULL; - newparts = kzalloc(sizeof(struct cmdline_parts), GFP_KERNEL); + newparts = kzalloc_obj(struct cmdline_parts, GFP_KERNEL); if (!newparts) return -ENOMEM; diff --git a/block/partitions/core.c b/block/partitions/core.c index 079057ab535a..189ab5650351 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -94,7 +94,7 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd) struct parsed_partitions *state; int nr = DISK_MAX_PARTS; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 638261e9f2fb..ff145c6306e0 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -595,7 +595,7 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt, lastlba = last_lba(state->disk); if (!force_gpt) { /* This will be added to the EFI Spec. per Intel after v1.02. */ - legacymbr = kzalloc(sizeof(*legacymbr), GFP_KERNEL); + legacymbr = kzalloc_obj(*legacymbr, GFP_KERNEL); if (!legacymbr) goto fail; diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c index 631291fbb356..b81b7a690787 100644 --- a/block/partitions/ibm.c +++ b/block/partitions/ibm.c @@ -347,13 +347,13 @@ int ibm_partition(struct parsed_partitions *state) nr_sectors = bdev_nr_sectors(bdev); if (nr_sectors == 0) goto out_symbol; - info = kmalloc(sizeof(dasd_information2_t), GFP_KERNEL); + info = kmalloc_obj(dasd_information2_t, GFP_KERNEL); if (info == NULL) goto out_symbol; - geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL); + geo = kmalloc_obj(struct hd_geometry, GFP_KERNEL); if (geo == NULL) goto out_nogeo; - label = kmalloc(sizeof(union label_t), GFP_KERNEL); + label = kmalloc_obj(union label_t, GFP_KERNEL); if (label == NULL) goto out_nolab; /* set start if not filled by getgeo function e.g. virtblk */ diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index 2bd42fedb907..27ffddd74e11 100644 --- a/block/partitions/ldm.c +++ b/block/partitions/ldm.c @@ -273,8 +273,8 @@ static bool ldm_validate_privheads(struct parsed_partitions *state, BUG_ON (!state || !ph1); - ph[1] = kmalloc (sizeof (*ph[1]), GFP_KERNEL); - ph[2] = kmalloc (sizeof (*ph[2]), GFP_KERNEL); + ph[1] = kmalloc_obj(*ph[1], GFP_KERNEL); + ph[2] = kmalloc_obj(*ph[2], GFP_KERNEL); if (!ph[1] || !ph[2]) { ldm_crit ("Out of memory."); goto out; @@ -362,7 +362,7 @@ static bool ldm_validate_tocblocks(struct parsed_partitions *state, BUG_ON(!state || !ldb); ph = &ldb->ph; tb[0] = &ldb->toc; - tb[1] = kmalloc_array(3, sizeof(*tb[1]), GFP_KERNEL); + tb[1] = kmalloc_objs(*tb[1], 3, GFP_KERNEL); if (!tb[1]) { ldm_crit("Out of memory."); goto err; @@ -1158,7 +1158,7 @@ static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb) BUG_ON (!data || !ldb); - vb = kmalloc (sizeof (*vb), GFP_KERNEL); + vb = kmalloc_obj(*vb, GFP_KERNEL); if (!vb) { ldm_crit ("Out of memory."); return false; @@ -1438,7 +1438,7 @@ int ldm_partition(struct parsed_partitions *state) if (!ldm_validate_partition_table(state)) return 0; - ldb = kmalloc (sizeof (*ldb), GFP_KERNEL); + ldb = kmalloc_obj(*ldb, GFP_KERNEL); if (!ldb) { ldm_crit ("Out of memory."); goto out; diff --git a/block/sed-opal.c b/block/sed-opal.c index 23a19c92d791..fbe0fe4dce8a 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -2512,7 +2512,7 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv) { struct opal_dev *dev; - dev = kmalloc(sizeof(*dev), GFP_KERNEL); + dev = kmalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -2719,7 +2719,7 @@ static int opal_save(struct opal_dev *dev, struct opal_lock_unlock *lk_unlk) { struct opal_suspend_data *suspend; - suspend = kzalloc(sizeof(*suspend), GFP_KERNEL); + suspend = kzalloc_obj(*suspend, GFP_KERNEL); if (!suspend) return -ENOMEM; diff --git a/certs/blacklist.c b/certs/blacklist.c index 11fc858b2921..725c2f18fa31 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -328,7 +328,7 @@ static int __init blacklist_init(void) if (register_key_type(&key_type_blacklist) < 0) panic("Can't allocate system blacklist key type\n"); - restriction = kzalloc(sizeof(*restriction), GFP_KERNEL); + restriction = kzalloc_obj(*restriction, GFP_KERNEL); if (!restriction) panic("Can't allocate blacklist keyring restriction\n"); restriction->check = restrict_link_for_blacklist; diff --git a/certs/system_keyring.c b/certs/system_keyring.c index 9de610bf1f4b..afe67e2a47ed 100644 --- a/certs/system_keyring.c +++ b/certs/system_keyring.c @@ -140,7 +140,7 @@ static __init struct key_restriction *get_builtin_and_secondary_restriction(void { struct key_restriction *restriction; - restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); if (!restriction) panic("Can't allocate secondary trusted keyring restriction\n"); diff --git a/crypto/af_alg.c b/crypto/af_alg.c index e468714f539d..d6f14649bd13 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -70,7 +70,7 @@ int af_alg_register_type(const struct af_alg_type *type) goto unlock; } - node = kmalloc(sizeof(*node), GFP_KERNEL); + node = kmalloc_obj(*node, GFP_KERNEL); err = -ENOMEM; if (!node) goto unlock; diff --git a/crypto/algboss.c b/crypto/algboss.c index 846f586889ee..09ceeb0db431 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -84,7 +84,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) if (!try_module_get(THIS_MODULE)) goto err; - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) goto err_put_module; @@ -195,7 +195,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) if (!try_module_get(THIS_MODULE)) goto err; - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) goto err_put_module; diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c index 1a86e40c8372..8578b9d1c569 100644 --- a/crypto/algif_rng.c +++ b/crypto/algif_rng.c @@ -202,7 +202,7 @@ static void *rng_bind(const char *name, u32 type, u32 mask) struct rng_parent_ctx *pctx; struct crypto_rng *rng; - pctx = kzalloc(sizeof(*pctx), GFP_KERNEL); + pctx = kzalloc_obj(*pctx, GFP_KERNEL); if (!pctx) return ERR_PTR(-ENOMEM); diff --git a/crypto/api.c b/crypto/api.c index 05629644a688..b0b69ca789f3 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -105,7 +105,7 @@ struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask) { struct crypto_larval *larval; - larval = kzalloc(sizeof(*larval), GFP_KERNEL); + larval = kzalloc_obj(*larval, GFP_KERNEL); if (!larval) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c index 1f1d92547dfc..33c9e68ab28d 100644 --- a/crypto/asymmetric_keys/asymmetric_type.c +++ b/crypto/asymmetric_keys/asymmetric_type.c @@ -486,7 +486,7 @@ static struct key_restriction *asymmetric_restriction_alloc( struct key *key) { struct key_restriction *keyres = - kzalloc(sizeof(struct key_restriction), GFP_KERNEL); + kzalloc_obj(struct key_restriction, GFP_KERNEL); if (!keyres) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c index db1c90ca6fc1..ab400d62c587 100644 --- a/crypto/asymmetric_keys/pkcs7_parser.c +++ b/crypto/asymmetric_keys/pkcs7_parser.c @@ -133,17 +133,16 @@ struct pkcs7_message *pkcs7_parse_message(const void *data, size_t datalen) struct pkcs7_message *msg = ERR_PTR(-ENOMEM); int ret; - ctx = kzalloc(sizeof(struct pkcs7_parse_context), GFP_KERNEL); + ctx = kzalloc_obj(struct pkcs7_parse_context, GFP_KERNEL); if (!ctx) goto out_no_ctx; - ctx->msg = kzalloc(sizeof(struct pkcs7_message), GFP_KERNEL); + ctx->msg = kzalloc_obj(struct pkcs7_message, GFP_KERNEL); if (!ctx->msg) goto out_no_msg; - ctx->sinfo = kzalloc(sizeof(struct pkcs7_signed_info), GFP_KERNEL); + ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info, GFP_KERNEL); if (!ctx->sinfo) goto out_no_sinfo; - ctx->sinfo->sig = kzalloc(sizeof(struct public_key_signature), - GFP_KERNEL); + ctx->sinfo->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); if (!ctx->sinfo->sig) goto out_no_sig; @@ -729,11 +728,10 @@ int pkcs7_note_signed_info(void *context, size_t hdrlen, sinfo->index = ++ctx->sinfo_index; *ctx->ppsinfo = sinfo; ctx->ppsinfo = &sinfo->next; - ctx->sinfo = kzalloc(sizeof(struct pkcs7_signed_info), GFP_KERNEL); + ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info, GFP_KERNEL); if (!ctx->sinfo) return -ENOMEM; - ctx->sinfo->sig = kzalloc(sizeof(struct public_key_signature), - GFP_KERNEL); + ctx->sinfo->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); if (!ctx->sinfo->sig) return -ENOMEM; return 0; diff --git a/crypto/asymmetric_keys/pkcs8_parser.c b/crypto/asymmetric_keys/pkcs8_parser.c index 105dcce27f71..c7f04dbadbd1 100644 --- a/crypto/asymmetric_keys/pkcs8_parser.c +++ b/crypto/asymmetric_keys/pkcs8_parser.c @@ -103,7 +103,7 @@ static struct public_key *pkcs8_parse(const void *data, size_t datalen) memset(&ctx, 0, sizeof(ctx)); ret = -ENOMEM; - ctx.pub = kzalloc(sizeof(struct public_key), GFP_KERNEL); + ctx.pub = kzalloc_obj(struct public_key, GFP_KERNEL); if (!ctx.pub) goto error; diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 2fe094f5caf3..ba446683358a 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -65,16 +65,16 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen) struct asymmetric_key_id *kid; long ret; - cert = kzalloc(sizeof(struct x509_certificate), GFP_KERNEL); + cert = kzalloc_obj(struct x509_certificate, GFP_KERNEL); if (!cert) return ERR_PTR(-ENOMEM); - cert->pub = kzalloc(sizeof(struct public_key), GFP_KERNEL); + cert->pub = kzalloc_obj(struct public_key, GFP_KERNEL); if (!cert->pub) return ERR_PTR(-ENOMEM); - cert->sig = kzalloc(sizeof(struct public_key_signature), GFP_KERNEL); + cert->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); if (!cert->sig) return ERR_PTR(-ENOMEM); - ctx = kzalloc(sizeof(struct x509_parse_context), GFP_KERNEL); + ctx = kzalloc_obj(struct x509_parse_context, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index b695e59fd9e4..9a936e255397 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c @@ -210,7 +210,7 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) p = bin2hex(p, q, srlen); *p = 0; - kids = kmalloc(sizeof(struct asymmetric_key_ids), GFP_KERNEL); + kids = kmalloc_obj(struct asymmetric_key_ids, GFP_KERNEL); if (!kids) return -ENOMEM; kids->id[0] = cert->id; diff --git a/crypto/deflate.c b/crypto/deflate.c index a3e1fff55661..644daf558ad0 100644 --- a/crypto/deflate.c +++ b/crypto/deflate.c @@ -40,7 +40,7 @@ static void *deflate_alloc_stream(void) DEFLATE_DEF_MEMLEVEL)); struct deflate_stream *ctx; - ctx = kvmalloc(struct_size(ctx, workspace, size), GFP_KERNEL); + ctx = kvmalloc_flex(*ctx, workspace, size, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/crypto/drbg.c b/crypto/drbg.c index 5e7ed5f5c192..8a915da08fa9 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1522,7 +1522,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) unsigned int alignmask; char ctr_name[CRYPTO_MAX_ALG_NAME]; - aeskey = kzalloc(sizeof(*aeskey), GFP_KERNEL); + aeskey = kzalloc_obj(*aeskey, GFP_KERNEL); if (!aeskey) return -ENOMEM; drbg->priv_data = aeskey; @@ -1761,7 +1761,7 @@ static inline int __init drbg_healthcheck_sanity(void) drbg_convert_tfm_core("drbg_nopr_hmac_sha512", &coreref, &pr); #endif - drbg = kzalloc(sizeof(struct drbg_state), GFP_KERNEL); + drbg = kzalloc_obj(struct drbg_state, GFP_KERNEL); if (!drbg) return -ENOMEM; diff --git a/crypto/ecc.c b/crypto/ecc.c index 2808b3d5f483..3d07383a26f4 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c @@ -98,7 +98,7 @@ struct ecc_point *ecc_alloc_point(unsigned int ndigits) if (!ndigits) return NULL; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return NULL; diff --git a/crypto/gcm.c b/crypto/gcm.c index 97716482bed0..154138dbf19a 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c @@ -1098,7 +1098,7 @@ static int __init crypto_gcm_module_init(void) { int err; - gcm_zeroes = kzalloc(sizeof(*gcm_zeroes), GFP_KERNEL); + gcm_zeroes = kzalloc_obj(*gcm_zeroes, GFP_KERNEL); if (!gcm_zeroes) return -ENOMEM; diff --git a/crypto/simd.c b/crypto/simd.c index 2a7549e280ca..e343bda70fc8 100644 --- a/crypto/simd.c +++ b/crypto/simd.c @@ -145,7 +145,7 @@ struct simd_skcipher_alg *simd_skcipher_create_compat(struct skcipher_alg *ialg, struct skcipher_alg *alg; int err; - salg = kzalloc(sizeof(*salg), GFP_KERNEL); + salg = kzalloc_obj(*salg, GFP_KERNEL); if (!salg) { salg = ERR_PTR(-ENOMEM); goto out; @@ -370,7 +370,7 @@ static struct simd_aead_alg *simd_aead_create_compat(struct aead_alg *ialg, struct aead_alg *alg; int err; - salg = kzalloc(sizeof(*salg), GFP_KERNEL); + salg = kzalloc_obj(*salg, GFP_KERNEL); if (!salg) { salg = ERR_PTR(-ENOMEM); goto out; diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 62fef100e599..4217d3d1ca41 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -180,7 +180,7 @@ static int test_mb_aead_jiffies(struct test_mb_aead_data *data, int enc, int ret = 0; int *rc; - rc = kcalloc(num_mb, sizeof(*rc), GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); if (!rc) return -ENOMEM; @@ -207,7 +207,7 @@ static int test_mb_aead_cycles(struct test_mb_aead_data *data, int enc, int i; int *rc; - rc = kcalloc(num_mb, sizeof(*rc), GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); if (!rc) return -ENOMEM; @@ -270,7 +270,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs, else e = "decryption"; - data = kcalloc(num_mb, sizeof(*data), GFP_KERNEL); + data = kzalloc_objs(*data, num_mb, GFP_KERNEL); if (!data) goto out_free_iv; @@ -997,7 +997,7 @@ static int test_mb_acipher_jiffies(struct test_mb_skcipher_data *data, int enc, int ret = 0; int *rc; - rc = kcalloc(num_mb, sizeof(*rc), GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); if (!rc) return -ENOMEM; @@ -1024,7 +1024,7 @@ static int test_mb_acipher_cycles(struct test_mb_skcipher_data *data, int enc, int i; int *rc; - rc = kcalloc(num_mb, sizeof(*rc), GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); if (!rc) return -ENOMEM; @@ -1075,7 +1075,7 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs, else e = "decryption"; - data = kcalloc(num_mb, sizeof(*data), GFP_KERNEL); + data = kzalloc_objs(*data, num_mb, GFP_KERNEL); if (!data) return; diff --git a/crypto/testmgr.c b/crypto/testmgr.c index b940721447fa..c13aa351898d 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -739,7 +739,7 @@ static struct cipher_test_sglists *alloc_cipher_test_sglists(void) { struct cipher_test_sglists *tsgls; - tsgls = kmalloc(sizeof(*tsgls), GFP_KERNEL); + tsgls = kmalloc_obj(*tsgls, GFP_KERNEL); if (!tsgls) return NULL; @@ -1796,7 +1796,7 @@ static int test_hash_vs_generic_impl(const char *generic_driver, return err; } - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) { err = -ENOMEM; goto out; @@ -1941,7 +1941,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, if (err) goto out; - tsgl = kmalloc(sizeof(*tsgl), GFP_KERNEL); + tsgl = kmalloc_obj(*tsgl, GFP_KERNEL); if (!tsgl || init_test_sglist(tsgl) != 0) { pr_err("alg: hash: failed to allocate test buffers for %s\n", driver); @@ -2598,7 +2598,7 @@ static int test_aead_slow(const struct alg_test_desc *test_desc, if (noslowtests) return 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; init_rnd_state(&ctx->rng); @@ -3106,7 +3106,7 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, return err; } - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) { err = -ENOMEM; goto out; diff --git a/crypto/zstd.c b/crypto/zstd.c index cbbd0413751a..f0c5c4ee7d29 100644 --- a/crypto/zstd.c +++ b/crypto/zstd.c @@ -44,7 +44,7 @@ static void *zstd_alloc_stream(void) if (!wksp_size) return ERR_PTR(-EINVAL); - ctx = kvmalloc(struct_size(ctx, wksp, wksp_size), GFP_KERNEL); + ctx = kvmalloc_flex(*ctx, wksp, wksp_size, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index 37d05f2e986f..d4869f2fef02 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -464,7 +464,7 @@ static int aie2_alloc_resource(struct amdxdna_hwctx *hwctx) return aie2_create_context(xdna->dev_handle, hwctx); } - xrs_req = kzalloc(sizeof(*xrs_req), GFP_KERNEL); + xrs_req = kzalloc_obj(*xrs_req, GFP_KERNEL); if (!xrs_req) return -ENOMEM; @@ -559,7 +559,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx) struct amdxdna_gem_obj *heap; int i, ret; - priv = kzalloc(sizeof(*hwctx->priv), GFP_KERNEL); + priv = kzalloc_obj(*hwctx->priv, GFP_KERNEL); if (!priv) return -ENOMEM; hwctx->priv = priv; diff --git a/drivers/accel/amdxdna/aie2_error.c b/drivers/accel/amdxdna/aie2_error.c index 5e82df2b7cf6..a311231834f0 100644 --- a/drivers/accel/amdxdna/aie2_error.c +++ b/drivers/accel/amdxdna/aie2_error.c @@ -350,7 +350,7 @@ int aie2_error_async_events_alloc(struct amdxdna_dev_hdl *ndev) struct async_events *events; int i, ret; - events = kzalloc(struct_size(events, event, total_col), GFP_KERNEL); + events = kzalloc_flex(*events, event, total_col, GFP_KERNEL); if (!events) return -ENOMEM; diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index f70ccf0f3c01..47346684bb75 100644 --- a/drivers/accel/amdxdna/aie2_pci.c +++ b/drivers/accel/amdxdna/aie2_pci.c @@ -653,7 +653,7 @@ static int aie2_get_aie_metadata(struct amdxdna_client *client, int ret = 0; ndev = xdna->dev_handle; - meta = kzalloc(sizeof(*meta), GFP_KERNEL); + meta = kzalloc_obj(*meta, GFP_KERNEL); if (!meta) return -ENOMEM; @@ -748,7 +748,7 @@ static int aie2_get_clock_metadata(struct amdxdna_client *client, int ret = 0; ndev = xdna->dev_handle; - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) return -ENOMEM; @@ -775,7 +775,7 @@ static int aie2_hwctx_status_cb(struct amdxdna_hwctx *hwctx, void *arg) if (!array_args->num_element) return -EINVAL; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/accel/amdxdna/aie2_solver.c b/drivers/accel/amdxdna/aie2_solver.c index 2013d1f13aae..6154ef9f9e9d 100644 --- a/drivers/accel/amdxdna/aie2_solver.c +++ b/drivers/accel/amdxdna/aie2_solver.c @@ -197,7 +197,7 @@ static int get_free_partition(struct solver_state *xrs, if (i == snode->cols_len) return -ENODEV; - pt_node = kzalloc(sizeof(*pt_node), GFP_KERNEL); + pt_node = kzalloc_obj(*pt_node, GFP_KERNEL); if (!pt_node) return -ENOMEM; @@ -266,7 +266,7 @@ static struct solver_node *create_solver_node(struct solver_state *xrs, struct solver_node *node; int ret; - node = kzalloc(struct_size(node, start_cols, cdop->cols_len), GFP_KERNEL); + node = kzalloc_flex(*node, start_cols, cdop->cols_len, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c index d17aef89a0ad..edbac9f4054c 100644 --- a/drivers/accel/amdxdna/amdxdna_ctx.c +++ b/drivers/accel/amdxdna/amdxdna_ctx.c @@ -50,7 +50,7 @@ static struct dma_fence *amdxdna_fence_create(struct amdxdna_hwctx *hwctx) { struct amdxdna_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; @@ -161,7 +161,7 @@ int amdxdna_drm_create_hwctx_ioctl(struct drm_device *dev, void *data, struct dr if (args->ext || args->ext_flags) return -EINVAL; - hwctx = kzalloc(sizeof(*hwctx), GFP_KERNEL); + hwctx = kzalloc_obj(*hwctx, GFP_KERNEL); if (!hwctx) return -ENOMEM; @@ -436,7 +436,7 @@ int amdxdna_cmd_submit(struct amdxdna_client *client, int ret, idx; XDNA_DBG(xdna, "Command BO hdl %d, Arg BO count %d", cmd_bo_hdl, arg_bo_cnt); - job = kzalloc(struct_size(job, bos, arg_bo_cnt), GFP_KERNEL); + job = kzalloc_flex(*job, bos, arg_bo_cnt, GFP_KERNEL); if (!job) return -ENOMEM; diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index dfa916eeb2d9..d862d5fe5385 100644 --- a/drivers/accel/amdxdna/amdxdna_gem.c +++ b/drivers/accel/amdxdna/amdxdna_gem.c @@ -205,13 +205,13 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo, if (!xdna->dev_info->ops->hmm_invalidate) return 0; - mapp = kzalloc(sizeof(*mapp), GFP_KERNEL); + mapp = kzalloc_obj(*mapp, GFP_KERNEL); if (!mapp) return -ENOMEM; nr_pages = (PAGE_ALIGN(addr + len) - (addr & PAGE_MASK)) >> PAGE_SHIFT; - mapp->range.hmm_pfns = kvcalloc(nr_pages, sizeof(*mapp->range.hmm_pfns), - GFP_KERNEL); + mapp->range.hmm_pfns = kvzalloc_objs(*mapp->range.hmm_pfns, nr_pages, + GFP_KERNEL); if (!mapp->range.hmm_pfns) { ret = -ENOMEM; goto free_map; @@ -499,7 +499,7 @@ amdxdna_gem_create_obj(struct drm_device *dev, size_t size) { struct amdxdna_gem_obj *abo; - abo = kzalloc(sizeof(*abo), GFP_KERNEL); + abo = kzalloc_obj(*abo, GFP_KERNEL); if (!abo) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c b/drivers/accel/amdxdna/amdxdna_mailbox.c index 469242ed8224..04d1d30184ca 100644 --- a/drivers/accel/amdxdna/amdxdna_mailbox.c +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c @@ -475,7 +475,7 @@ xdna_mailbox_create_channel(struct mailbox *mb, return NULL; } - mb_chann = kzalloc(sizeof(*mb_chann), GFP_KERNEL); + mb_chann = kzalloc_obj(*mb_chann, GFP_KERNEL); if (!mb_chann) return NULL; diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index fdefd9ec2066..86f46f59b9dc 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -63,7 +63,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp) struct amdxdna_client *client; int ret; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/drivers/accel/amdxdna/amdxdna_ubuf.c b/drivers/accel/amdxdna/amdxdna_ubuf.c index 9e3b3b055caa..44db2cef40cb 100644 --- a/drivers/accel/amdxdna/amdxdna_ubuf.c +++ b/drivers/accel/amdxdna/amdxdna_ubuf.c @@ -27,7 +27,7 @@ static struct sg_table *amdxdna_ubuf_map(struct dma_buf_attachment *attach, struct sg_table *sg; int ret; - sg = kzalloc(sizeof(*sg), GFP_KERNEL); + sg = kzalloc_obj(*sg, GFP_KERNEL); if (!sg) return ERR_PTR(-ENOMEM); @@ -147,7 +147,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, if (!can_do_mlock()) return ERR_PTR(-EPERM); - ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL); + ubuf = kzalloc_obj(*ubuf, GFP_KERNEL); if (!ubuf) return ERR_PTR(-ENOMEM); @@ -155,7 +155,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, ubuf->mm = current->mm; mmgrab(ubuf->mm); - va_ent = kvcalloc(num_entries, sizeof(*va_ent), GFP_KERNEL); + va_ent = kvzalloc_objs(*va_ent, num_entries, GFP_KERNEL); if (!va_ent) { ret = -ENOMEM; goto free_ubuf; @@ -189,7 +189,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, goto sub_pin_cnt; } - ubuf->pages = kvmalloc_array(ubuf->nr_pages, sizeof(*ubuf->pages), GFP_KERNEL); + ubuf->pages = kvmalloc_objs(*ubuf->pages, ubuf->nr_pages, GFP_KERNEL); if (!ubuf->pages) { ret = -ENOMEM; goto sub_pin_cnt; diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c index e05a69bf5574..ae5e6b15e7de 100644 --- a/drivers/accel/ethosu/ethosu_drv.c +++ b/drivers/accel/ethosu/ethosu_drv.c @@ -144,7 +144,8 @@ static int ethosu_open(struct drm_device *ddev, struct drm_file *file) if (!try_module_get(THIS_MODULE)) return -EINVAL; - struct ethosu_file_priv __free(kfree) *priv = kzalloc(sizeof(*priv), GFP_KERNEL); + struct ethosu_file_priv __free(kfree) *priv = kzalloc_obj(*priv, + GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto err_put_mod; diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 473b5f5d7514..7a5405db5a6c 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -50,7 +50,7 @@ struct drm_gem_object *ethosu_gem_create_object(struct drm_device *ddev, size_t { struct ethosu_gem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); @@ -352,7 +352,8 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, struct ethosu_gem_object *bo, u32 size) { - struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc(sizeof(*info), GFP_KERNEL); + struct ethosu_validated_cmdstream_info __free(kfree) *info = kzalloc_obj(*info, + GFP_KERNEL); struct ethosu_device *edev = to_ethosu_device(ddev); u32 *bocmds = bo->base.vaddr; struct cmd_state st; diff --git a/drivers/accel/ethosu/ethosu_job.c b/drivers/accel/ethosu/ethosu_job.c index 26e7a2f64d71..91d1b996852e 100644 --- a/drivers/accel/ethosu/ethosu_job.c +++ b/drivers/accel/ethosu/ethosu_job.c @@ -375,7 +375,7 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file if (edev->npu_info.sram_size < job->sram_size) return -EINVAL; - ejob = kzalloc(sizeof(*ejob), GFP_KERNEL); + ejob = kzalloc_obj(*ejob, GFP_KERNEL); if (!ejob) return -ENOMEM; @@ -384,7 +384,7 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file ejob->dev = edev; ejob->sram_size = job->sram_size; - ejob->done_fence = kzalloc(sizeof(*ejob->done_fence), GFP_KERNEL); + ejob->done_fence = kzalloc_obj(*ejob->done_fence, GFP_KERNEL); if (!ejob->done_fence) { ret = -ENOMEM; goto out_cleanup_job; @@ -476,7 +476,7 @@ int ethosu_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil } struct drm_ethosu_job __free(kvfree) *jobs = - kvmalloc_array(args->job_count, sizeof(*jobs), GFP_KERNEL); + kvmalloc_objs(*jobs, args->job_count, GFP_KERNEL); if (!jobs) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/command_buffer.c b/drivers/accel/habanalabs/common/command_buffer.c index 0f0d295116e7..b27323afd12d 100644 --- a/drivers/accel/habanalabs/common/command_buffer.c +++ b/drivers/accel/habanalabs/common/command_buffer.c @@ -116,10 +116,10 @@ static struct hl_cb *hl_cb_alloc(struct hl_device *hdev, u32 cb_size, * and must use GFP_ATOMIC for all memory allocations. */ if (ctx_id == HL_KERNEL_ASID_ID && !hdev->disabled) - cb = kzalloc(sizeof(*cb), GFP_ATOMIC); + cb = kzalloc_obj(*cb, GFP_ATOMIC); if (!cb) - cb = kzalloc(sizeof(*cb), GFP_KERNEL); + cb = kzalloc_obj(*cb, GFP_KERNEL); if (!cb) return NULL; diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index dee487724918..f990d16f6c2f 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -907,9 +907,9 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, cntr = &hdev->aggregated_cs_counters; - cs = kzalloc(sizeof(*cs), GFP_ATOMIC); + cs = kzalloc_obj(*cs, GFP_ATOMIC); if (!cs) - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) { atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt); @@ -936,9 +936,9 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, kref_init(&cs->refcount); spin_lock_init(&cs->job_lock); - cs_cmpl = kzalloc(sizeof(*cs_cmpl), GFP_ATOMIC); + cs_cmpl = kzalloc_obj(*cs_cmpl, GFP_ATOMIC); if (!cs_cmpl) - cs_cmpl = kzalloc(sizeof(*cs_cmpl), GFP_KERNEL); + cs_cmpl = kzalloc_obj(*cs_cmpl, GFP_KERNEL); if (!cs_cmpl) { atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt); @@ -1302,9 +1302,9 @@ struct hl_cs_job *hl_cs_allocate_job(struct hl_device *hdev, { struct hl_cs_job *job; - job = kzalloc(sizeof(*job), GFP_ATOMIC); + job = kzalloc_obj(*job, GFP_ATOMIC); if (!job) - job = kzalloc(sizeof(*job), GFP_KERNEL); + job = kzalloc_obj(*job, GFP_KERNEL); if (!job) return NULL; @@ -1420,11 +1420,10 @@ static int hl_cs_copy_chunk_array(struct hl_device *hdev, return -EINVAL; } - *cs_chunk_array = kmalloc_array(num_chunks, sizeof(**cs_chunk_array), - GFP_ATOMIC); + *cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks, GFP_ATOMIC); if (!*cs_chunk_array) - *cs_chunk_array = kmalloc_array(num_chunks, - sizeof(**cs_chunk_array), GFP_KERNEL); + *cs_chunk_array = kmalloc_objs(**cs_chunk_array, num_chunks, + GFP_KERNEL); if (!*cs_chunk_array) { atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt); atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt); @@ -2040,7 +2039,7 @@ static int cs_ioctl_reserve_signals(struct hl_fpriv *hpriv, prop = &hdev->kernel_queues[q_idx].sync_stream_prop; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) { rc = -ENOMEM; goto out; @@ -3053,7 +3052,7 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data) } /* allocate array for the fences */ - fence_arr = kmalloc_array(seq_arr_len, sizeof(struct hl_fence *), GFP_KERNEL); + fence_arr = kmalloc_objs(struct hl_fence *, seq_arr_len, GFP_KERNEL); if (!fence_arr) { rc = -ENOMEM; goto free_seq_arr; @@ -3412,7 +3411,7 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx, goto put_cq_cb; } - pend = kzalloc(sizeof(*pend), GFP_KERNEL); + pend = kzalloc_obj(*pend, GFP_KERNEL); if (!pend) { rc = -ENOMEM; goto put_cq_cb; @@ -3521,7 +3520,7 @@ static int _hl_interrupt_wait_ioctl_user_addr(struct hl_device *hdev, struct hl_ hl_ctx_get(ctx); - pend = kzalloc(sizeof(*pend), GFP_KERNEL); + pend = kzalloc_obj(*pend, GFP_KERNEL); if (!pend) { hl_ctx_put(ctx); return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/context.c b/drivers/accel/habanalabs/common/context.c index 9f212b17611a..4d69a3f48616 100644 --- a/drivers/accel/habanalabs/common/context.c +++ b/drivers/accel/habanalabs/common/context.c @@ -155,7 +155,7 @@ int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv) struct hl_ctx *ctx; int rc; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto out_err; @@ -209,9 +209,9 @@ int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx) spin_lock_init(&ctx->cs_lock); atomic_set(&ctx->thread_ctx_switch_token, 1); ctx->thread_ctx_switch_wait_token = 0; - ctx->cs_pending = kcalloc(hdev->asic_prop.max_pending_cs, - sizeof(struct hl_fence *), - GFP_KERNEL); + ctx->cs_pending = kzalloc_objs(struct hl_fence *, + hdev->asic_prop.max_pending_cs, + GFP_KERNEL); if (!ctx->cs_pending) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c index 5f0820b19ccb..05b1cc7918c5 100644 --- a/drivers/accel/habanalabs/common/debugfs.c +++ b/drivers/accel/habanalabs/common/debugfs.c @@ -2052,7 +2052,8 @@ int hl_debugfs_device_init(struct hl_device *hdev) int count = ARRAY_SIZE(hl_debugfs_list); dev_entry->hdev = hdev; - dev_entry->entry_arr = kmalloc_array(count, sizeof(struct hl_debugfs_entry), GFP_KERNEL); + dev_entry->entry_arr = kmalloc_objs(struct hl_debugfs_entry, count, + GFP_KERNEL); if (!dev_entry->entry_arr) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/decoder.c b/drivers/accel/habanalabs/common/decoder.c index c03a6da45d00..602e53f963ca 100644 --- a/drivers/accel/habanalabs/common/decoder.c +++ b/drivers/accel/habanalabs/common/decoder.c @@ -98,7 +98,7 @@ int hl_dec_init(struct hl_device *hdev) if (!prop->max_dec) return 0; - hdev->dec = kcalloc(prop->max_dec, sizeof(struct hl_dec), GFP_KERNEL); + hdev->dec = kzalloc_objs(struct hl_dec, prop->max_dec, GFP_KERNEL); if (!hdev->dec) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 999c92d7036e..20ddf6617e02 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -722,7 +722,7 @@ static int device_init_cdev(struct hl_device *hdev, const struct class *class, cdev_init(cdev, fops); cdev->owner = THIS_MODULE; - *dev = kzalloc(sizeof(**dev), GFP_KERNEL); + *dev = kzalloc_obj(**dev, GFP_KERNEL); if (!*dev) return -ENOMEM; @@ -892,9 +892,9 @@ static int device_early_init(struct hl_device *hdev) goto early_fini; if (hdev->asic_prop.completion_queues_count) { - hdev->cq_wq = kcalloc(hdev->asic_prop.completion_queues_count, - sizeof(struct workqueue_struct *), - GFP_KERNEL); + hdev->cq_wq = kzalloc_objs(struct workqueue_struct *, + hdev->asic_prop.completion_queues_count, + GFP_KERNEL); if (!hdev->cq_wq) { rc = -ENOMEM; goto asid_fini; @@ -945,7 +945,7 @@ static int device_early_init(struct hl_device *hdev) goto free_ts_free_wq; } - hdev->hl_chip_info = kzalloc(sizeof(struct hwmon_chip_info), GFP_KERNEL); + hdev->hl_chip_info = kzalloc_obj(struct hwmon_chip_info, GFP_KERNEL); if (!hdev->hl_chip_info) { rc = -ENOMEM; goto free_prefetch_wq; @@ -1851,8 +1851,7 @@ kill_processes: } /* Allocate the kernel context */ - hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx), - GFP_KERNEL); + hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx, GFP_KERNEL); if (!hdev->kernel_ctx) { rc = -ENOMEM; hl_mmu_fini(hdev); @@ -2159,8 +2158,9 @@ int hl_device_init(struct hl_device *hdev) hdev->asic_prop.user_interrupt_count; if (user_interrupt_cnt) { - hdev->user_interrupt = kcalloc(user_interrupt_cnt, sizeof(*hdev->user_interrupt), - GFP_KERNEL); + hdev->user_interrupt = kzalloc_objs(*hdev->user_interrupt, + user_interrupt_cnt, + GFP_KERNEL); if (!hdev->user_interrupt) { rc = -ENOMEM; goto early_fini; @@ -2226,9 +2226,8 @@ int hl_device_init(struct hl_device *hdev) * passed as arguments to request_irq */ if (cq_cnt) { - hdev->completion_queue = kcalloc(cq_cnt, - sizeof(*hdev->completion_queue), - GFP_KERNEL); + hdev->completion_queue = kzalloc_objs(*hdev->completion_queue, + cq_cnt, GFP_KERNEL); if (!hdev->completion_queue) { dev_err(hdev->dev, @@ -2249,8 +2248,9 @@ int hl_device_init(struct hl_device *hdev) hdev->completion_queue[i].cq_idx = i; } - hdev->shadow_cs_queue = kcalloc(hdev->asic_prop.max_pending_cs, - sizeof(struct hl_cs *), GFP_KERNEL); + hdev->shadow_cs_queue = kzalloc_objs(struct hl_cs *, + hdev->asic_prop.max_pending_cs, + GFP_KERNEL); if (!hdev->shadow_cs_queue) { rc = -ENOMEM; goto cq_fini; @@ -2275,7 +2275,7 @@ int hl_device_init(struct hl_device *hdev) } /* Allocate the kernel context */ - hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx), GFP_KERNEL); + hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx, GFP_KERNEL); if (!hdev->kernel_ctx) { rc = -ENOMEM; goto mmu_fini; diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c index eeb6b2a80fc7..f6a2c48ad74e 100644 --- a/drivers/accel/habanalabs/common/firmware_if.c +++ b/drivers/accel/habanalabs/common/firmware_if.c @@ -2681,7 +2681,7 @@ static int hl_fw_dynamic_send_msg(struct hl_device *hdev, struct lkd_msg_comms *msg; int rc; - msg = kzalloc(sizeof(*msg), GFP_KERNEL); + msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c index 0035748f3228..63b4a91e291c 100644 --- a/drivers/accel/habanalabs/common/habanalabs_drv.c +++ b/drivers/accel/habanalabs/common/habanalabs_drv.c @@ -181,7 +181,7 @@ int hl_device_open(struct drm_device *ddev, struct drm_file *file_priv) struct hl_fpriv *hpriv; int rc; - hpriv = kzalloc(sizeof(*hpriv), GFP_KERNEL); + hpriv = kzalloc_obj(*hpriv, GFP_KERNEL); if (!hpriv) return -ENOMEM; @@ -291,7 +291,7 @@ int hl_device_open_ctrl(struct inode *inode, struct file *filp) return -ENXIO; } - hpriv = kzalloc(sizeof(*hpriv), GFP_KERNEL); + hpriv = kzalloc_obj(*hpriv, GFP_KERNEL); if (!hpriv) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index fdfdabc85e54..ace0aaa7b836 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -201,7 +201,7 @@ static int debug_coresight(struct hl_device *hdev, struct hl_ctx *ctx, struct hl void *input = NULL, *output = NULL; int rc; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -682,11 +682,11 @@ static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args) if ((!max_size) || (!out)) return -EINVAL; - sec_attest_info = kmalloc(sizeof(*sec_attest_info), GFP_KERNEL); + sec_attest_info = kmalloc_obj(*sec_attest_info, GFP_KERNEL); if (!sec_attest_info) return -ENOMEM; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { rc = -ENOMEM; goto free_sec_attest_info; @@ -731,11 +731,11 @@ static int dev_info_signed(struct hl_fpriv *hpriv, struct hl_info_args *args) if ((!max_size) || (!out)) return -EINVAL; - dev_info_signed = kzalloc(sizeof(*dev_info_signed), GFP_KERNEL); + dev_info_signed = kzalloc_obj(*dev_info_signed, GFP_KERNEL); if (!dev_info_signed) return -ENOMEM; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { rc = -ENOMEM; goto free_dev_info_signed; diff --git a/drivers/accel/habanalabs/common/hldio.c b/drivers/accel/habanalabs/common/hldio.c index 083ae5610875..2cef50bbfa9b 100644 --- a/drivers/accel/habanalabs/common/hldio.c +++ b/drivers/accel/habanalabs/common/hldio.c @@ -308,7 +308,7 @@ int hl_dio_ssd2hl(struct hl_device *hdev, struct hl_ctx *ctx, int fd, dev_dbg(hdev->dev, "SSD2HL fd=%d va=%#llx len=%#lx\n", fd, device_va, len_bytes); - io = kzalloc(sizeof(*io), GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!io) { rc = -ENOMEM; goto out; diff --git a/drivers/accel/habanalabs/common/hw_queue.c b/drivers/accel/habanalabs/common/hw_queue.c index 3d04a7507cce..d499063a79ec 100644 --- a/drivers/accel/habanalabs/common/hw_queue.c +++ b/drivers/accel/habanalabs/common/hw_queue.c @@ -837,7 +837,8 @@ static int ext_and_cpu_queue_init(struct hl_device *hdev, struct hl_hw_queue *q, q->kernel_address = p; - q->shadow_queue = kmalloc_array(HL_QUEUE_LENGTH, sizeof(struct hl_cs_job *), GFP_KERNEL); + q->shadow_queue = kmalloc_objs(struct hl_cs_job *, HL_QUEUE_LENGTH, + GFP_KERNEL); if (!q->shadow_queue) { dev_err(hdev->dev, "Failed to allocate shadow queue for H/W queue %d\n", @@ -1082,8 +1083,8 @@ int hl_hw_queues_create(struct hl_device *hdev) struct hl_hw_queue *q; int i, rc, q_ready_cnt; - hdev->kernel_queues = kcalloc(asic->max_queues, - sizeof(*hdev->kernel_queues), GFP_KERNEL); + hdev->kernel_queues = kzalloc_objs(*hdev->kernel_queues, + asic->max_queues, GFP_KERNEL); if (!hdev->kernel_queues) { dev_err(hdev->dev, "Not enough memory for H/W queues\n"); diff --git a/drivers/accel/habanalabs/common/hwmon.c b/drivers/accel/habanalabs/common/hwmon.c index 52d1e6bf10dc..a8b00a80fa10 100644 --- a/drivers/accel/habanalabs/common/hwmon.c +++ b/drivers/accel/habanalabs/common/hwmon.c @@ -195,15 +195,15 @@ int hl_build_hwmon_channel_info(struct hl_device *hdev, struct cpucp_sensor *sen curr_arr[sensors_by_type_next_index[type]++] = flags; } - channels_info = kcalloc(num_active_sensor_types + 1, sizeof(struct hwmon_channel_info *), - GFP_KERNEL); + channels_info = kzalloc_objs(struct hwmon_channel_info *, + num_active_sensor_types + 1, GFP_KERNEL); if (!channels_info) { rc = -ENOMEM; goto channels_info_array_err; } for (i = 0 ; i < num_active_sensor_types ; i++) { - channels_info[i] = kzalloc(sizeof(*channels_info[i]), GFP_KERNEL); + channels_info[i] = kzalloc_obj(*channels_info[i], GFP_KERNEL); if (!channels_info[i]) { rc = -ENOMEM; goto channel_info_err; diff --git a/drivers/accel/habanalabs/common/irq.c b/drivers/accel/habanalabs/common/irq.c index 7c9f2f6a2870..023dd3f1c82c 100644 --- a/drivers/accel/habanalabs/common/irq.c +++ b/drivers/accel/habanalabs/common/irq.c @@ -267,7 +267,7 @@ static int handle_registration_node(struct hl_device *hdev, struct hl_user_pendi if (!(*free_list)) { /* Alloc/Init the timestamp registration free objects list */ - *free_list = kmalloc(sizeof(struct list_head), GFP_ATOMIC); + *free_list = kmalloc_obj(struct list_head, GFP_ATOMIC); if (!(*free_list)) return -ENOMEM; @@ -283,14 +283,16 @@ static int handle_registration_node(struct hl_device *hdev, struct hl_user_pendi intr->interrupt_id); if (!(*dynamic_alloc_list)) { - *dynamic_alloc_list = kmalloc(sizeof(struct list_head), GFP_ATOMIC); + *dynamic_alloc_list = kmalloc_obj(struct list_head, + GFP_ATOMIC); if (!(*dynamic_alloc_list)) return -ENOMEM; INIT_LIST_HEAD(*dynamic_alloc_list); } - free_node = kmalloc(sizeof(struct timestamp_reg_free_node), GFP_ATOMIC); + free_node = kmalloc_obj(struct timestamp_reg_free_node, + GFP_ATOMIC); if (!free_node) return -ENOMEM; @@ -344,7 +346,7 @@ static void handle_user_interrupt_ts_list(struct hl_device *hdev, struct hl_user * and move nodes hanged on the free list back to the interrupt ts list * we always alloc the job of the WQ at the beginning. */ - job = kmalloc(sizeof(*job), GFP_ATOMIC); + job = kmalloc_obj(*job, GFP_ATOMIC); if (!job) return; @@ -542,7 +544,7 @@ irqreturn_t hl_irq_handler_eq(int irq, void *arg) goto skip_irq; } - handle_eqe_work = kmalloc(sizeof(*handle_eqe_work), GFP_ATOMIC); + handle_eqe_work = kmalloc_obj(*handle_eqe_work, GFP_ATOMIC); if (handle_eqe_work) { INIT_WORK(&handle_eqe_work->eq_work, irq_handle_eqe); handle_eqe_work->hdev = hdev; diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index 633db4bff46f..8700e341ff94 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -125,7 +125,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args, } } - phys_pg_pack = kzalloc(sizeof(*phys_pg_pack), GFP_KERNEL); + phys_pg_pack = kzalloc_obj(*phys_pg_pack, GFP_KERNEL); if (!phys_pg_pack) { rc = -ENOMEM; goto pages_pack_err; @@ -228,7 +228,7 @@ static int dma_map_host_va(struct hl_device *hdev, u64 addr, u64 size, struct hl_userptr *userptr; int rc; - userptr = kzalloc(sizeof(*userptr), GFP_KERNEL); + userptr = kzalloc_obj(*userptr, GFP_KERNEL); if (!userptr) { rc = -ENOMEM; goto userptr_err; @@ -501,7 +501,7 @@ static int add_va_block_locked(struct hl_device *hdev, res = va_block; } - va_block = kmalloc(sizeof(*va_block), GFP_KERNEL); + va_block = kmalloc_obj(*va_block, GFP_KERNEL); if (!va_block) return -ENOMEM; @@ -850,7 +850,7 @@ static int init_phys_pg_pack_from_userptr(struct hl_ctx *ctx, dma_addr_t dma_addr; int rc, i, j; - phys_pg_pack = kzalloc(sizeof(*phys_pg_pack), GFP_KERNEL); + phys_pg_pack = kzalloc_obj(*phys_pg_pack, GFP_KERNEL); if (!phys_pg_pack) return -ENOMEM; @@ -1152,7 +1152,7 @@ static int map_device_va(struct hl_ctx *ctx, struct hl_mem_in *args, u64 *device goto shared_err; } - hnode = kzalloc(sizeof(*hnode), GFP_KERNEL); + hnode = kzalloc_obj(*hnode, GFP_KERNEL); if (!hnode) { rc = -ENOMEM; goto hnode_err; @@ -1482,7 +1482,7 @@ int hl_hw_block_mmap(struct hl_fpriv *hpriv, struct vm_area_struct *vma) return -EINVAL; } - lnode = kzalloc(sizeof(*lnode), GFP_KERNEL); + lnode = kzalloc_obj(*lnode, GFP_KERNEL); if (!lnode) return -ENOMEM; @@ -1553,7 +1553,7 @@ static struct sg_table *alloc_sgt_from_device_pages(struct hl_device *hdev, u64 return ERR_PTR(-EINVAL); } - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); @@ -2046,7 +2046,7 @@ static int export_dmabuf_from_addr(struct hl_ctx *ctx, u64 addr, u64 size, u64 o return -EINVAL; } - hl_dmabuf = kzalloc(sizeof(*hl_dmabuf), GFP_KERNEL); + hl_dmabuf = kzalloc_obj(*hl_dmabuf, GFP_KERNEL); if (!hl_dmabuf) return -ENOMEM; @@ -2116,7 +2116,7 @@ static int hl_ts_alloc_buf(struct hl_mmap_mem_buf *buf, gfp_t gfp, void *args) num_elements = *(u32 *)args; - ts_buff = kzalloc(sizeof(*ts_buff), gfp); + ts_buff = kzalloc_obj(*ts_buff, gfp); if (!ts_buff) return -ENOMEM; @@ -2323,7 +2323,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size, return -EFAULT; } - userptr->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + userptr->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); if (!userptr->pages) return -ENOMEM; @@ -2395,7 +2395,7 @@ int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size, } userptr->pid = current->pid; - userptr->sgt = kzalloc(sizeof(*userptr->sgt), GFP_KERNEL); + userptr->sgt = kzalloc_obj(*userptr->sgt, GFP_KERNEL); if (!userptr->sgt) return -ENOMEM; @@ -2611,7 +2611,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx, for (i = 0 ; i < HL_VA_RANGE_TYPE_MAX ; i++) { ctx->va_range[i] = - kzalloc(sizeof(struct hl_va_range), GFP_KERNEL); + kzalloc_obj(struct hl_va_range, GFP_KERNEL); if (!ctx->va_range[i]) { rc = -ENOMEM; goto free_va_range; diff --git a/drivers/accel/habanalabs/common/memory_mgr.c b/drivers/accel/habanalabs/common/memory_mgr.c index 4401beb99e42..9fdd34acf389 100644 --- a/drivers/accel/habanalabs/common/memory_mgr.c +++ b/drivers/accel/habanalabs/common/memory_mgr.c @@ -152,7 +152,7 @@ hl_mmap_mem_buf_alloc(struct hl_mem_mgr *mmg, struct hl_mmap_mem_buf *buf; int rc; - buf = kzalloc(sizeof(*buf), gfp); + buf = kzalloc_obj(*buf, gfp); if (!buf) return NULL; diff --git a/drivers/accel/habanalabs/common/mmu/mmu.c b/drivers/accel/habanalabs/common/mmu/mmu.c index 79823facce7f..8a661408af20 100644 --- a/drivers/accel/habanalabs/common/mmu/mmu.c +++ b/drivers/accel/habanalabs/common/mmu/mmu.c @@ -697,7 +697,7 @@ int hl_mmu_prefetch_cache_range(struct hl_ctx *ctx, u32 flags, u32 asid, u64 va, { struct hl_prefetch_work *handle_prefetch_work; - handle_prefetch_work = kmalloc(sizeof(*handle_prefetch_work), GFP_KERNEL); + handle_prefetch_work = kmalloc_obj(*handle_prefetch_work, GFP_KERNEL); if (!handle_prefetch_work) return -ENOMEM; @@ -843,7 +843,8 @@ int hl_mmu_hr_init(struct hl_device *hdev, struct hl_mmu_hr_priv *hr_priv, u32 h return -ENOMEM; } - hr_priv->mmu_asid_hop0 = kvcalloc(prop->max_asid, sizeof(struct pgt_info), GFP_KERNEL); + hr_priv->mmu_asid_hop0 = kvzalloc_objs(struct pgt_info, prop->max_asid, + GFP_KERNEL); if (ZERO_OR_NULL_PTR(hr_priv->mmu_asid_hop0)) { dev_err(hdev->dev, "Failed to allocate hr-mmu hop0 table\n"); rc = -ENOMEM; @@ -1071,7 +1072,7 @@ struct pgt_info *hl_mmu_hr_alloc_hop(struct hl_ctx *ctx, struct hl_mmu_hr_priv * void *virt_addr; int i, retry = 1; - pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL); + pgt_info = kmalloc_obj(*pgt_info, GFP_KERNEL); if (!pgt_info) return NULL; @@ -1325,7 +1326,7 @@ u64 hl_mmu_dr_alloc_hop(struct hl_ctx *ctx) struct pgt_info *pgt_info; u64 phys_addr, shadow_addr; - pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL); + pgt_info = kmalloc_obj(*pgt_info, GFP_KERNEL); if (!pgt_info) return ULLONG_MAX; diff --git a/drivers/accel/habanalabs/common/security.c b/drivers/accel/habanalabs/common/security.c index 5402a3cd0491..8a0da0194cab 100644 --- a/drivers/accel/habanalabs/common/security.c +++ b/drivers/accel/habanalabs/common/security.c @@ -312,9 +312,8 @@ int hl_init_pb_with_mask(struct hl_device *hdev, u32 num_dcores, int i, j; struct hl_block_glbl_sec *glbl_sec; - glbl_sec = kcalloc(blocks_array_size, - sizeof(struct hl_block_glbl_sec), - GFP_KERNEL); + glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size, + GFP_KERNEL); if (!glbl_sec) return -ENOMEM; @@ -393,9 +392,8 @@ int hl_init_pb_ranges_with_mask(struct hl_device *hdev, u32 num_dcores, int i, j, rc = 0; struct hl_block_glbl_sec *glbl_sec; - glbl_sec = kcalloc(blocks_array_size, - sizeof(struct hl_block_glbl_sec), - GFP_KERNEL); + glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size, + GFP_KERNEL); if (!glbl_sec) return -ENOMEM; @@ -476,9 +474,8 @@ int hl_init_pb_single_dcore(struct hl_device *hdev, u32 dcore_offset, int i, rc = 0; struct hl_block_glbl_sec *glbl_sec; - glbl_sec = kcalloc(blocks_array_size, - sizeof(struct hl_block_glbl_sec), - GFP_KERNEL); + glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size, + GFP_KERNEL); if (!glbl_sec) return -ENOMEM; @@ -524,9 +521,8 @@ int hl_init_pb_ranges_single_dcore(struct hl_device *hdev, u32 dcore_offset, int i; struct hl_block_glbl_sec *glbl_sec; - glbl_sec = kcalloc(blocks_array_size, - sizeof(struct hl_block_glbl_sec), - GFP_KERNEL); + glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, blocks_array_size, + GFP_KERNEL); if (!glbl_sec) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/state_dump.c b/drivers/accel/habanalabs/common/state_dump.c index 3a9931f24259..ec25d55d89e2 100644 --- a/drivers/accel/habanalabs/common/state_dump.c +++ b/drivers/accel/habanalabs/common/state_dump.c @@ -400,7 +400,7 @@ static int hl_state_dump_print_syncs(struct hl_device *hdev, u32 index; int rc = 0; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c b/drivers/accel/habanalabs/gaudi/gaudi.c index 34771d75da9d..e7dce0d57692 100644 --- a/drivers/accel/habanalabs/gaudi/gaudi.c +++ b/drivers/accel/habanalabs/gaudi/gaudi.c @@ -539,9 +539,8 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev) int i; prop->max_queues = GAUDI_QUEUE_ID_SIZE; - prop->hw_queues_props = kcalloc(prop->max_queues, - sizeof(struct hw_queue_properties), - GFP_KERNEL); + prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties, + prop->max_queues, GFP_KERNEL); if (!prop->hw_queues_props) return -ENOMEM; @@ -1853,7 +1852,7 @@ static int gaudi_sw_init(struct hl_device *hdev) int rc; /* Allocate device structure */ - gaudi = kzalloc(sizeof(*gaudi), GFP_KERNEL); + gaudi = kzalloc_obj(*gaudi, GFP_KERNEL); if (!gaudi) return -ENOMEM; @@ -4906,7 +4905,7 @@ static int gaudi_pin_memory_before_cs(struct hl_device *hdev, parser->job_userptr_list, &userptr)) goto already_pinned; - userptr = kzalloc(sizeof(*userptr), GFP_KERNEL); + userptr = kzalloc_obj(*userptr, GFP_KERNEL); if (!userptr) return -ENOMEM; @@ -8843,7 +8842,7 @@ static int gaudi_add_sync_to_engine_map_entry( reg_value -= lower_32_bits(CFG_BASE); /* create a new hash entry */ - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; entry->engine_type = engine_type; diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index b8c0689dba64..e6690698cde4 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -2762,8 +2762,8 @@ static int gaudi2_set_fixed_properties(struct hl_device *hdev) int i, rc; prop->max_queues = GAUDI2_QUEUE_ID_SIZE; - prop->hw_queues_props = kcalloc(prop->max_queues, sizeof(struct hw_queue_properties), - GFP_KERNEL); + prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties, + prop->max_queues, GFP_KERNEL); if (!prop->hw_queues_props) return -ENOMEM; @@ -3943,8 +3943,9 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev) /* Configure Special blocks */ prop->glbl_err_max_cause_num = GAUDI2_GLBL_ERR_MAX_CAUSE_NUM; prop->num_of_special_blocks = ARRAY_SIZE(gaudi2_special_blocks); - prop->special_blocks = kmalloc_array(prop->num_of_special_blocks, - sizeof(*prop->special_blocks), GFP_KERNEL); + prop->special_blocks = kmalloc_objs(*prop->special_blocks, + prop->num_of_special_blocks, + GFP_KERNEL); if (!prop->special_blocks) return -ENOMEM; @@ -3958,8 +3959,9 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev) if (ARRAY_SIZE(gaudi2_iterator_skip_block_types)) { prop->skip_special_blocks_cfg.block_types = - kmalloc_array(ARRAY_SIZE(gaudi2_iterator_skip_block_types), - sizeof(gaudi2_iterator_skip_block_types[0]), GFP_KERNEL); + kmalloc_objs(gaudi2_iterator_skip_block_types[0], + ARRAY_SIZE(gaudi2_iterator_skip_block_types), + GFP_KERNEL); if (!prop->skip_special_blocks_cfg.block_types) { rc = -ENOMEM; goto free_special_blocks; @@ -3974,8 +3976,9 @@ static int gaudi2_special_blocks_config(struct hl_device *hdev) if (ARRAY_SIZE(gaudi2_iterator_skip_block_ranges)) { prop->skip_special_blocks_cfg.block_ranges = - kmalloc_array(ARRAY_SIZE(gaudi2_iterator_skip_block_ranges), - sizeof(gaudi2_iterator_skip_block_ranges[0]), GFP_KERNEL); + kmalloc_objs(gaudi2_iterator_skip_block_ranges[0], + ARRAY_SIZE(gaudi2_iterator_skip_block_ranges), + GFP_KERNEL); if (!prop->skip_special_blocks_cfg.block_ranges) { rc = -ENOMEM; goto free_skip_special_blocks_types; @@ -4054,7 +4057,7 @@ static int gaudi2_sw_init(struct hl_device *hdev) int i, rc; /* Allocate device structure */ - gaudi2 = kzalloc(sizeof(*gaudi2), GFP_KERNEL); + gaudi2 = kzalloc_obj(*gaudi2, GFP_KERNEL); if (!gaudi2) return -ENOMEM; diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c index 307ccb912ccd..f4f8f9122f5c 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2_security.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2_security.c @@ -2620,7 +2620,8 @@ static int gaudi2_init_pb_tpc(struct hl_device *hdev) block_array_size = ARRAY_SIZE(gaudi2_pb_dcr0_tpc0); - glbl_sec = kcalloc(block_array_size, sizeof(struct hl_block_glbl_sec), GFP_KERNEL); + glbl_sec = kzalloc_objs(struct hl_block_glbl_sec, block_array_size, + GFP_KERNEL); if (!glbl_sec) return -ENOMEM; diff --git a/drivers/accel/habanalabs/goya/goya.c b/drivers/accel/habanalabs/goya/goya.c index 84768e306269..fb37a2339f12 100644 --- a/drivers/accel/habanalabs/goya/goya.c +++ b/drivers/accel/habanalabs/goya/goya.c @@ -363,9 +363,8 @@ int goya_set_fixed_properties(struct hl_device *hdev) int i; prop->max_queues = GOYA_QUEUE_ID_SIZE; - prop->hw_queues_props = kcalloc(prop->max_queues, - sizeof(struct hw_queue_properties), - GFP_KERNEL); + prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties, + prop->max_queues, GFP_KERNEL); if (!prop->hw_queues_props) return -ENOMEM; @@ -970,7 +969,7 @@ static int goya_sw_init(struct hl_device *hdev) int rc; /* Allocate device structure */ - goya = kzalloc(sizeof(*goya), GFP_KERNEL); + goya = kzalloc_obj(*goya, GFP_KERNEL); if (!goya) return -ENOMEM; @@ -1031,7 +1030,7 @@ static int goya_sw_init(struct hl_device *hdev) hdev->asic_funcs->set_pci_memory_regions(hdev); - goya->goya_work = kmalloc(sizeof(struct goya_work_freq), GFP_KERNEL); + goya->goya_work = kmalloc_obj(struct goya_work_freq, GFP_KERNEL); if (!goya->goya_work) { rc = -ENOMEM; goto free_cpu_accessible_dma_pool; @@ -3336,7 +3335,7 @@ static int goya_pin_memory_before_cs(struct hl_device *hdev, parser->job_userptr_list, &userptr)) goto already_pinned; - userptr = kzalloc(sizeof(*userptr), GFP_KERNEL); + userptr = kzalloc_obj(*userptr, GFP_KERNEL); if (!userptr) return -ENOMEM; diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c index 8ffda57459df..ab910d201e68 100644 --- a/drivers/accel/ivpu/ivpu_drv.c +++ b/drivers/accel/ivpu/ivpu_drv.c @@ -237,7 +237,7 @@ static int ivpu_open(struct drm_device *dev, struct drm_file *file) if (!drm_dev_enter(dev, &idx)) return -ENODEV; - file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); if (!file_priv) { ret = -ENOMEM; goto err_dev_exit; diff --git a/drivers/accel/ivpu/ivpu_gem_userptr.c b/drivers/accel/ivpu/ivpu_gem_userptr.c index 25ba606164c0..7dcd127471bb 100644 --- a/drivers/accel/ivpu/ivpu_gem_userptr.c +++ b/drivers/accel/ivpu/ivpu_gem_userptr.c @@ -77,7 +77,7 @@ ivpu_create_userptr_dmabuf(struct ivpu_device *vdev, void __user *user_ptr, if (!(flags & DRM_IVPU_BO_READ_ONLY)) gup_flags |= FOLL_WRITE; - pages = kvmalloc_array(nr_pages, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, nr_pages, GFP_KERNEL); if (!pages) return ERR_PTR(-ENOMEM); @@ -94,7 +94,7 @@ ivpu_create_userptr_dmabuf(struct ivpu_device *vdev, void __user *user_ptr, goto unpin_pages; } - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto unpin_pages; diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c index 1f13bf95b2b3..f47df092bb0d 100644 --- a/drivers/accel/ivpu/ivpu_ipc.c +++ b/drivers/accel/ivpu/ivpu_ipc.c @@ -142,7 +142,7 @@ ivpu_ipc_rx_msg_add(struct ivpu_device *vdev, struct ivpu_ipc_consumer *cons, lockdep_assert_held(&ipc->cons_lock); - rx_msg = kzalloc(sizeof(*rx_msg), GFP_ATOMIC); + rx_msg = kzalloc_obj(*rx_msg, GFP_ATOMIC); if (!rx_msg) { ivpu_ipc_rx_mark_free(vdev, ipc_hdr, jsm_msg); return; diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 4f8564e2878a..cb478d946ae9 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -98,7 +98,7 @@ static struct ivpu_cmdq *ivpu_cmdq_alloc(struct ivpu_file_priv *file_priv) struct ivpu_device *vdev = file_priv->vdev; struct ivpu_cmdq *cmdq; - cmdq = kzalloc(sizeof(*cmdq), GFP_KERNEL); + cmdq = kzalloc_obj(*cmdq, GFP_KERNEL); if (!cmdq) return NULL; @@ -491,7 +491,7 @@ static struct dma_fence *ivpu_fence_create(struct ivpu_device *vdev) { struct ivpu_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; @@ -525,7 +525,7 @@ ivpu_job_create(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count) struct ivpu_device *vdev = file_priv->vdev; struct ivpu_job *job; - job = kzalloc(struct_size(job, bos, bo_count), GFP_KERNEL); + job = kzalloc_flex(*job, bos, bo_count, GFP_KERNEL); if (!job) return NULL; diff --git a/drivers/accel/ivpu/ivpu_ms.c b/drivers/accel/ivpu/ivpu_ms.c index 1d9c1cb17924..f3468c9533ca 100644 --- a/drivers/accel/ivpu/ivpu_ms.c +++ b/drivers/accel/ivpu/ivpu_ms.c @@ -59,7 +59,7 @@ int ivpu_ms_start_ioctl(struct drm_device *dev, void *data, struct drm_file *fil goto unlock; } - ms = kzalloc(sizeof(*ms), GFP_KERNEL); + ms = kzalloc_obj(*ms, GFP_KERNEL); if (!ms) { ret = -ENOMEM; goto unlock; diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_control.c index 428d8f65bff3..517cd3a9cab2 100644 --- a/drivers/accel/qaic/qaic_control.c +++ b/drivers/accel/qaic/qaic_control.c @@ -423,7 +423,8 @@ static int find_and_map_user_pages(struct qaic_device *qdev, nr_pages = need_pages; while (1) { - page_list = kmalloc_array(nr_pages, sizeof(*page_list), GFP_KERNEL | __GFP_NOWARN); + page_list = kmalloc_objs(*page_list, nr_pages, + GFP_KERNEL | __GFP_NOWARN); if (!page_list) { nr_pages = nr_pages / 2; if (!nr_pages) @@ -442,7 +443,7 @@ static int find_and_map_user_pages(struct qaic_device *qdev, goto put_pages; } - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto put_pages; @@ -581,7 +582,7 @@ static int encode_dma(struct qaic_device *qdev, void *trans, struct wrapper_list QAIC_MANAGE_WIRE_MSG_LENGTH) return -ENOMEM; - xfer = kmalloc(sizeof(*xfer), GFP_KERNEL); + xfer = kmalloc_obj(*xfer, GFP_KERNEL); if (!xfer) return -ENOMEM; @@ -1165,7 +1166,7 @@ static struct wrapper_list *alloc_wrapper_list(void) { struct wrapper_list *wrappers; - wrappers = kmalloc(sizeof(*wrappers), GFP_KERNEL); + wrappers = kmalloc_obj(*wrappers, GFP_KERNEL); if (!wrappers) return NULL; INIT_LIST_HEAD(&wrappers->list); @@ -1457,7 +1458,7 @@ void qaic_mhi_dl_xfer_cb(struct mhi_device *mhi_dev, struct mhi_result *mhi_resu return; } - resp = kmalloc(sizeof(*resp), GFP_ATOMIC); + resp = kmalloc_obj(*resp, GFP_ATOMIC); if (!resp) { kfree(msg); return; diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c index 60cb4d65d48e..6405f849ad5f 100644 --- a/drivers/accel/qaic/qaic_data.c +++ b/drivers/accel/qaic/qaic_data.c @@ -213,7 +213,7 @@ static int clone_range_of_sgt_for_slice(struct qaic_device *qdev, struct sg_tabl goto out; } - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto out; @@ -399,13 +399,13 @@ static int qaic_map_one_slice(struct qaic_device *qdev, struct qaic_bo *bo, if (ret) goto out; - slice = kmalloc(sizeof(*slice), GFP_KERNEL); + slice = kmalloc_obj(*slice, GFP_KERNEL); if (!slice) { ret = -ENOMEM; goto free_sgt; } - slice->reqs = kvcalloc(sgt->nents, sizeof(*slice->reqs), GFP_KERNEL); + slice->reqs = kvzalloc_objs(*slice->reqs, sgt->nents, GFP_KERNEL); if (!slice->reqs) { ret = -ENOMEM; goto free_slice; @@ -507,7 +507,7 @@ static int create_sgt(struct qaic_device *qdev, struct sg_table **sgt_out, u64 s i++; } - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto free_partial_alloc; @@ -653,7 +653,7 @@ static struct sg_table *qaic_get_sg_table(struct drm_gem_object *obj) sgt_in = bo->sgt; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ static struct qaic_bo *qaic_alloc_init_bo(void) { struct qaic_bo *bo; - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c index 4c70bd949d53..7127364068ae 100644 --- a/drivers/accel/qaic/qaic_drv.c +++ b/drivers/accel/qaic/qaic_drv.c @@ -152,7 +152,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file) goto dev_unlock; } - usr = kmalloc(sizeof(*usr), GFP_KERNEL); + usr = kmalloc_obj(*usr, GFP_KERNEL); if (!usr) { ret = -ENOMEM; goto dev_unlock; diff --git a/drivers/accel/qaic/qaic_ras.c b/drivers/accel/qaic/qaic_ras.c index f1d52a710136..b488e6ef66c5 100644 --- a/drivers/accel/qaic/qaic_ras.c +++ b/drivers/accel/qaic/qaic_ras.c @@ -556,7 +556,7 @@ static int qaic_ras_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_devic if (ret) return ret; - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) { mhi_unprepare_from_transfer(mhi_dev); return -ENOMEM; diff --git a/drivers/accel/qaic/qaic_ssr.c b/drivers/accel/qaic/qaic_ssr.c index 9b662d690371..77ac30498ad0 100644 --- a/drivers/accel/qaic/qaic_ssr.c +++ b/drivers/accel/qaic/qaic_ssr.c @@ -260,7 +260,7 @@ static int send_xfer_done(struct qaic_device *qdev, void *resp, u32 dbc_id) struct ssr_debug_transfer_done *xfer_done; int ret; - xfer_done = kmalloc(sizeof(*xfer_done), GFP_KERNEL); + xfer_done = kmalloc_obj(*xfer_done, GFP_KERNEL); if (!xfer_done) { ret = -ENOMEM; goto out; @@ -450,14 +450,15 @@ static struct ssr_dump_info *alloc_dump_info(struct qaic_device *qdev, } /* Allocate SSR crashdump book keeping structure */ - dump_info = kzalloc(sizeof(*dump_info), GFP_KERNEL); + dump_info = kzalloc_obj(*dump_info, GFP_KERNEL); if (!dump_info) { ret = -ENOMEM; goto out; } /* Buffer used to send MEMORY READ request to device via MHI */ - dump_info->read_buf_req = kzalloc(sizeof(*dump_info->read_buf_req), GFP_KERNEL); + dump_info->read_buf_req = kzalloc_obj(*dump_info->read_buf_req, + GFP_KERNEL); if (!dump_info->read_buf_req) { ret = -ENOMEM; goto free_dump_info; @@ -490,7 +491,7 @@ static int dbg_xfer_info_rsp(struct qaic_device *qdev, struct dma_bridge_chan *d struct ssr_crashdump *ssr_crash = NULL; int ret = 0, ret2; - debug_rsp = kmalloc(sizeof(*debug_rsp), GFP_KERNEL); + debug_rsp = kmalloc_obj(*debug_rsp, GFP_KERNEL); if (!debug_rsp) return -ENOMEM; @@ -640,7 +641,7 @@ static void ssr_worker(struct work_struct *work) break; } - event_rsp = kmalloc(sizeof(*event_rsp), GFP_KERNEL); + event_rsp = kmalloc_obj(*event_rsp, GFP_KERNEL); if (!event_rsp) break; diff --git a/drivers/accel/qaic/qaic_timesync.c b/drivers/accel/qaic/qaic_timesync.c index 8af2475f4f36..b2400d6b2f4f 100644 --- a/drivers/accel/qaic/qaic_timesync.c +++ b/drivers/accel/qaic/qaic_timesync.c @@ -185,7 +185,7 @@ static int qaic_timesync_probe(struct mhi_device *mhi_dev, const struct mhi_devi struct timer_list *timer; int ret; - mqtsdev = kzalloc(sizeof(*mqtsdev), GFP_KERNEL); + mqtsdev = kzalloc_obj(*mqtsdev, GFP_KERNEL); if (!mqtsdev) { ret = -ENOMEM; goto out; @@ -196,7 +196,7 @@ static int qaic_timesync_probe(struct mhi_device *mhi_dev, const struct mhi_devi mqtsdev->qdev = qdev; mqtsdev->dev = &qdev->pdev->dev; - mqtsdev->sync_msg = kzalloc(sizeof(*mqtsdev->sync_msg), GFP_KERNEL); + mqtsdev->sync_msg = kzalloc_obj(*mqtsdev->sync_msg, GFP_KERNEL); if (!mqtsdev->sync_msg) { ret = -ENOMEM; goto free_mqts_dev; @@ -275,7 +275,7 @@ static void qaic_boot_timesync_worker(struct work_struct *work) switch (data.hdr.msg_type) { case QAIC_TS_CMD_TO_HOST: - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) break; @@ -304,7 +304,7 @@ static int qaic_boot_timesync_queue_resp(struct mhi_device *mhi_dev, struct qaic struct qts_resp *resp; int ret; - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) return -ENOMEM; diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c index e4cb2efeb55a..f09c3800ab31 100644 --- a/drivers/accel/rocket/rocket_drv.c +++ b/drivers/accel/rocket/rocket_drv.c @@ -38,7 +38,7 @@ rocket_iommu_domain_destroy(struct kref *kref) static struct rocket_iommu_domain* rocket_iommu_domain_create(struct device *dev) { - struct rocket_iommu_domain *domain = kmalloc(sizeof(*domain), GFP_KERNEL); + struct rocket_iommu_domain *domain = kmalloc_obj(*domain, GFP_KERNEL); void *err; if (!domain) @@ -79,7 +79,7 @@ rocket_open(struct drm_device *dev, struct drm_file *file) if (!try_module_get(THIS_MODULE)) return -EINVAL; - rocket_priv = kzalloc(sizeof(*rocket_priv), GFP_KERNEL); + rocket_priv = kzalloc_obj(*rocket_priv, GFP_KERNEL); if (!rocket_priv) { ret = -ENOMEM; goto err_put_mod; diff --git a/drivers/accel/rocket/rocket_gem.c b/drivers/accel/rocket/rocket_gem.c index 624c4ecf5a34..3808dfc97916 100644 --- a/drivers/accel/rocket/rocket_gem.c +++ b/drivers/accel/rocket/rocket_gem.c @@ -48,7 +48,7 @@ struct drm_gem_object *rocket_gem_create_object(struct drm_device *dev, size_t s { struct rocket_gem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c index acd606160dc9..518dd5779016 100644 --- a/drivers/accel/rocket/rocket_job.c +++ b/drivers/accel/rocket/rocket_job.c @@ -45,7 +45,7 @@ static struct dma_fence *rocket_fence_create(struct rocket_core *core) { struct dma_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return ERR_PTR(-ENOMEM); @@ -71,7 +71,7 @@ rocket_copy_tasks(struct drm_device *dev, if (!rjob->task_count) return 0; - rjob->tasks = kvmalloc_array(job->task_count, sizeof(*rjob->tasks), GFP_KERNEL); + rjob->tasks = kvmalloc_objs(*rjob->tasks, job->task_count, GFP_KERNEL); if (!rjob->tasks) { drm_dbg(dev, "Failed to allocate task array\n"); return -ENOMEM; @@ -496,9 +496,9 @@ void rocket_job_fini(struct rocket_core *core) int rocket_job_open(struct rocket_file_priv *rocket_priv) { struct rocket_device *rdev = rocket_priv->rdev; - struct drm_gpu_scheduler **scheds = kmalloc_array(rdev->num_cores, - sizeof(*scheds), - GFP_KERNEL); + struct drm_gpu_scheduler **scheds = kmalloc_objs(*scheds, + rdev->num_cores, + GFP_KERNEL); unsigned int core; int ret; @@ -543,7 +543,7 @@ static int rocket_ioctl_submit_job(struct drm_device *dev, struct drm_file *file if (job->task_count == 0) return -EINVAL; - rjob = kzalloc(sizeof(*rjob), GFP_KERNEL); + rjob = kzalloc_obj(*rjob, GFP_KERNEL); if (!rjob) return -ENOMEM; @@ -610,7 +610,7 @@ int rocket_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil return -EINVAL; } - jobs = kvmalloc_array(args->job_count, sizeof(*jobs), GFP_KERNEL); + jobs = kvmalloc_objs(*jobs, args->job_count, GFP_KERNEL); if (!jobs) { drm_dbg(dev, "Failed to allocate incoming job array\n"); return -ENOMEM; diff --git a/drivers/accessibility/speakup/main.c b/drivers/accessibility/speakup/main.c index e68cf1d83787..78a77dd789a2 100644 --- a/drivers/accessibility/speakup/main.c +++ b/drivers/accessibility/speakup/main.c @@ -1353,8 +1353,8 @@ static int speakup_allocate(struct vc_data *vc, gfp_t gfp_flags) vc_num = vc->vc_num; if (!speakup_console[vc_num]) { - speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]), - gfp_flags); + speakup_console[vc_num] = kzalloc_obj(*speakup_console[0], + gfp_flags); if (!speakup_console[vc_num]) return -ENOMEM; speakup_date(vc); diff --git a/drivers/accessibility/speakup/spk_ttyio.c b/drivers/accessibility/speakup/spk_ttyio.c index 4c0a6e1f019d..a9aab12a7836 100644 --- a/drivers/accessibility/speakup/spk_ttyio.c +++ b/drivers/accessibility/speakup/spk_ttyio.c @@ -55,7 +55,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty) if (!tty->ops->write) return -EOPNOTSUPP; - ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL); + ldisc_data = kmalloc_obj(*ldisc_data, GFP_KERNEL); if (!ldisc_data) return -ENOMEM; diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 1f69be8f51a2..94049a15f7b9 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -208,7 +208,7 @@ static int acpi_ac_probe(struct platform_device *pdev) struct acpi_ac *ac; int result; - ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL); + ac = kzalloc_obj(struct acpi_ac, GFP_KERNEL); if (!ac) return -ENOMEM; diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 49539f7528c6..d9cd3f97aa00 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -202,7 +202,7 @@ static int acpi_apd_create_device(struct acpi_device *adev, return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1; } - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c index c970792b11a4..c20bedff2c04 100644 --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c @@ -210,7 +210,7 @@ static struct config_item *acpi_table_make_item(struct config_group *group, { struct acpi_table *table; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 5fba4dab5d08..5ec5a841afce 100644 --- a/drivers/acpi/acpi_ipmi.c +++ b/drivers/acpi/acpi_ipmi.c @@ -117,7 +117,7 @@ ipmi_dev_alloc(int iface, struct device *dev, acpi_handle handle) int err; struct ipmi_user *user; - ipmi_device = kzalloc(sizeof(*ipmi_device), GFP_KERNEL); + ipmi_device = kzalloc_obj(*ipmi_device, GFP_KERNEL); if (!ipmi_device) return NULL; @@ -197,7 +197,7 @@ static struct acpi_ipmi_msg *ipmi_msg_alloc(void) if (!ipmi) return NULL; - ipmi_msg = kzalloc(sizeof(struct acpi_ipmi_msg), GFP_KERNEL); + ipmi_msg = kzalloc_obj(struct acpi_ipmi_msg, GFP_KERNEL); if (!ipmi_msg) { acpi_ipmi_dev_put(ipmi); return NULL; diff --git a/drivers/acpi/acpi_lpat.c b/drivers/acpi/acpi_lpat.c index 851f67c96097..b238f9f371dd 100644 --- a/drivers/acpi/acpi_lpat.c +++ b/drivers/acpi/acpi_lpat.c @@ -104,7 +104,7 @@ struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle (obj_p->package.count % 2) || (obj_p->package.count < 4)) goto out; - lpat = kcalloc(obj_p->package.count, sizeof(int), GFP_KERNEL); + lpat = kzalloc_objs(int, obj_p->package.count, GFP_KERNEL); if (!lpat) goto out; @@ -117,7 +117,7 @@ struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle lpat[i] = (s64)obj_e->integer.value; } - lpat_table = kzalloc(sizeof(*lpat_table), GFP_KERNEL); + lpat_table = kzalloc_obj(*lpat_table, GFP_KERNEL); if (!lpat_table) { kfree(lpat); goto out; diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index d0c1a71007d0..f12a9766696b 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -80,7 +80,7 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context) } } - new = kzalloc(sizeof(struct acpi_memory_info), GFP_KERNEL); + new = kzalloc_obj(struct acpi_memory_info, GFP_KERNEL); if (!new) return AE_ERROR; @@ -290,7 +290,7 @@ static int acpi_memory_device_add(struct acpi_device *device, if (!device) return -EINVAL; - mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); + mem_device = kzalloc_obj(struct acpi_memory_device, GFP_KERNEL); if (!mem_device) return -ENOMEM; diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c index 6d69554c940e..df771e49333f 100644 --- a/drivers/acpi/acpi_mrrm.c +++ b/drivers/acpi/acpi_mrrm.c @@ -81,8 +81,8 @@ static __init int acpi_parse_mrrm(struct acpi_table_header *table) return -EINVAL; } - mrrm_mem_range_entry = kmalloc_array(mre_count, sizeof(*mrrm_mem_range_entry), - GFP_KERNEL | __GFP_ZERO); + mrrm_mem_range_entry = kmalloc_objs(*mrrm_mem_range_entry, mre_count, + GFP_KERNEL | __GFP_ZERO); if (!mrrm_mem_range_entry) return -ENOMEM; @@ -161,7 +161,7 @@ static __init int add_boot_memory_ranges(void) if (!pkobj) return -ENOMEM; - kobjs = kcalloc(mrrm_mem_entry_num, sizeof(*kobjs), GFP_KERNEL); + kobjs = kzalloc_objs(*kobjs, mrrm_mem_entry_num, GFP_KERNEL); if (!kobjs) { kobject_put(pkobj); return -ENOMEM; diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c index e3f302b9dee5..6914071d640b 100644 --- a/drivers/acpi/acpi_pcc.c +++ b/drivers/acpi/acpi_pcc.c @@ -54,7 +54,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, struct pcc_mbox_chan *pcc_chan; acpi_status ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return AE_NO_MEMORY; diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 0ec1afc744f5..3ea6d941aabd 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -145,7 +145,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, if (count > 0) { struct resource_entry *rentry; - resources = kcalloc(count, sizeof(*resources), GFP_KERNEL); + resources = kzalloc_objs(*resources, count, GFP_KERNEL); if (!resources) { acpi_dev_free_resource_list(&resource_list); return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 85096ce7b658..02a80803962c 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -428,7 +428,7 @@ static int acpi_processor_add(struct acpi_device *device, if (!acpi_device_is_enabled(device)) return -ENODEV; - pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); + pr = kzalloc_obj(struct acpi_processor, GFP_KERNEL); if (!pr) return -ENOMEM; diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index 3d6e7306f29a..a2e07d946ce3 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -825,7 +825,7 @@ int acpi_video_get_levels(struct acpi_device *device, goto out; } - br = kzalloc(sizeof(*br), GFP_KERNEL); + br = kzalloc_obj(*br, GFP_KERNEL); if (!br) { result = -ENOMEM; goto out; @@ -836,9 +836,9 @@ int acpi_video_get_levels(struct acpi_device *device, * in order to account for buggy BIOS which don't export the first two * special levels (see below) */ - br->levels = kmalloc_array(obj->package.count + ACPI_VIDEO_FIRST_LEVEL, - sizeof(*br->levels), - GFP_KERNEL); + br->levels = kmalloc_objs(*br->levels, + obj->package.count + ACPI_VIDEO_FIRST_LEVEL, + GFP_KERNEL); if (!br->levels) { result = -ENOMEM; goto out_free; @@ -1141,7 +1141,7 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg) if (acpi_get_local_u64_address(device->handle, &device_id)) goto exit; - data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL); + data = kzalloc_obj(struct acpi_video_device, GFP_KERNEL); if (!data) { dev_dbg(&device->dev, "Cannot attach\n"); return -ENOMEM; @@ -1330,9 +1330,8 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) acpi_handle_debug(video->device->handle, "Found %d video heads in _DOD\n", dod->package.count); - active_list = kcalloc(1 + dod->package.count, - sizeof(struct acpi_video_enumerated_device), - GFP_KERNEL); + active_list = kzalloc_objs(struct acpi_video_enumerated_device, + 1 + dod->package.count, GFP_KERNEL); if (!active_list) { status = -ENOMEM; goto out; @@ -2004,7 +2003,7 @@ static int acpi_video_bus_probe(struct platform_device *pdev) return -ENODEV; } - video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); + video = kzalloc_obj(struct acpi_video_bus, GFP_KERNEL); if (!video) return -ENOMEM; diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 709993c535d1..7e22fc35ed6d 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c @@ -166,7 +166,7 @@ void __init acpi_watchdog_init(void) } } - resources = kcalloc(nresources, sizeof(*resources), GFP_KERNEL); + resources = kzalloc_objs(*resources, nresources, GFP_KERNEL); if (!resources) goto fail_free_resource_list; diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 9c84f3da7c09..95b8483b9e98 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c @@ -316,7 +316,7 @@ repeat: if (res_ins) list_add(&res_ins->list, res_list); else { - res_ins = kmalloc(sizeof(*res_ins), GFP_KERNEL); + res_ins = kmalloc_obj(*res_ins, GFP_KERNEL); if (!res_ins) return -ENOMEM; res_ins->start = start; @@ -345,7 +345,7 @@ static int apei_res_sub(struct list_head *res_list1, break; } else if (res1->end > res2->end && res1->start < res2->start) { - res = kmalloc(sizeof(*res), GFP_KERNEL); + res = kmalloc_obj(*res, GFP_KERNEL); if (!res) return -ENOMEM; res->start = res2->end; diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index f5bfdffe1e43..751697899a98 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -1021,7 +1021,8 @@ static bool setup_einjv2_component_files(void) { char name[32]; - syndrome_data = kcalloc(max_nr_components, sizeof(syndrome_data[0]), GFP_KERNEL); + syndrome_data = kzalloc_objs(syndrome_data[0], max_nr_components, + GFP_KERNEL); if (!syndrome_data) return false; diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index f96aede5d9a3..442561637f88 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -272,7 +272,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic) unsigned int error_block_length; int rc; - ghes = kzalloc(sizeof(*ghes), GFP_KERNEL); + ghes = kzalloc_obj(*ghes, GFP_KERNEL); if (!ghes) return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/arm64/ffh.c b/drivers/acpi/arm64/ffh.c index 877edc6557e9..d850af765ba1 100644 --- a/drivers/acpi/arm64/ffh.c +++ b/drivers/acpi/arm64/ffh.c @@ -33,7 +33,7 @@ int acpi_ffh_address_space_arch_setup(void *handler_ctxt, void **region_ctxt) return -EOPNOTSUPP; } - ffh_ctxt = kzalloc(sizeof(*ffh_ctxt), GFP_KERNEL); + ffh_ctxt = kzalloc_obj(*ffh_ctxt, GFP_KERNEL); if (!ffh_ctxt) return -ENOMEM; diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index ed827b2fc437..8e74b4eaf9bd 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -56,7 +56,7 @@ static inline int iort_set_fwnode(struct acpi_iort_node *iort_node, { struct iort_fwnode *np; - np = kzalloc(sizeof(struct iort_fwnode), GFP_ATOMIC); + np = kzalloc_obj(struct iort_fwnode, GFP_ATOMIC); if (WARN_ON(!np)) return -ENOMEM; @@ -165,7 +165,7 @@ int iort_register_domain_token(int trans_id, phys_addr_t base, { struct iort_its_msi_chip *its_msi_chip; - its_msi_chip = kzalloc(sizeof(*its_msi_chip), GFP_KERNEL); + its_msi_chip = kzalloc_obj(*its_msi_chip, GFP_KERNEL); if (!its_msi_chip) return -ENOMEM; @@ -938,7 +938,7 @@ static struct iommu_iort_rmr_data *iort_rmr_alloc( u32 *sids_copy; u64 addr = rmr_desc->base_address, size = rmr_desc->length; - rmr_data = kmalloc(sizeof(*rmr_data), GFP_KERNEL); + rmr_data = kmalloc_obj(*rmr_data, GFP_KERNEL); if (!rmr_data) return NULL; @@ -1942,7 +1942,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node, count = ops->dev_count_resources(node); - r = kcalloc(count, sizeof(*r), GFP_KERNEL); + r = kzalloc_objs(*r, count, GFP_KERNEL); if (!r) { ret = -ENOMEM; goto dev_put; diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 7a06194d078b..b9929b6ef62d 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -544,7 +544,7 @@ static int acpi_button_probe(struct platform_device *pdev) lid_init_state == ACPI_BUTTON_LID_INIT_DISABLED) return -ENODEV; - button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); + button = kzalloc_obj(struct acpi_button, GFP_KERNEL); if (!button) return -ENOMEM; diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 5b7e3b9ae370..055ad5f4782d 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c @@ -52,7 +52,7 @@ static int container_device_attach(struct acpi_device *adev, if (adev->flags.is_dock_station) return 0; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return -ENOMEM; diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 0e6ffb188fe7..d2e13252fce6 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -636,8 +636,8 @@ static int pcc_data_alloc(int pcc_ss_id) if (pcc_data[pcc_ss_id]) { pcc_data[pcc_ss_id]->refcount++; } else { - pcc_data[pcc_ss_id] = kzalloc(sizeof(struct cppc_pcc_data), - GFP_KERNEL); + pcc_data[pcc_ss_id] = kzalloc_obj(struct cppc_pcc_data, + GFP_KERNEL); if (!pcc_data[pcc_ss_id]) return -ENOMEM; pcc_data[pcc_ss_id]->refcount++; @@ -712,7 +712,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) out_obj = (union acpi_object *) output.pointer; - cpc_ptr = kzalloc(sizeof(struct cpc_desc), GFP_KERNEL); + cpc_ptr = kzalloc_obj(struct cpc_desc, GFP_KERNEL); if (!cpc_ptr) { ret = -ENOMEM; goto out_buf_free; diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 34affbda295e..e2239d4bb9df 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -73,7 +73,7 @@ static int add_dock_dependent_device(struct dock_station *ds, { struct dock_dependent_device *dd; - dd = kzalloc(sizeof(*dd), GFP_KERNEL); + dd = kzalloc_obj(*dd, GFP_KERNEL); if (!dd) return -ENOMEM; diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index f7edc664e064..8da0971f2238 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1100,7 +1100,7 @@ int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, if (!handle && !func) return -EINVAL; - handler = kzalloc(sizeof(*handler), GFP_KERNEL); + handler = kzalloc_obj(*handler, GFP_KERNEL); if (!handler) return -ENOMEM; @@ -1177,7 +1177,7 @@ static struct acpi_ec_query *acpi_ec_create_query(struct acpi_ec *ec, u8 *pval) struct acpi_ec_query *q; struct transaction *t; - q = kzalloc(sizeof (struct acpi_ec_query), GFP_KERNEL); + q = kzalloc_obj(struct acpi_ec_query, GFP_KERNEL); if (!q) return NULL; @@ -1422,7 +1422,7 @@ static void acpi_ec_free(struct acpi_ec *ec) static struct acpi_ec *acpi_ec_alloc(void) { - struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL); + struct acpi_ec *ec = kzalloc_obj(struct acpi_ec, GFP_KERNEL); if (!ec) return NULL; diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index a194f30876c5..e96def7db715 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -246,7 +246,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) acpi_dev_get(acpi_dev); get_device(dev); - physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL); + physical_node = kzalloc_obj(*physical_node, GFP_KERNEL); if (!physical_node) { retval = -ENOMEM; goto err; diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 6677955b4a8e..5a432899875b 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -120,7 +120,7 @@ static acpi_status handle_ioapic_add(acpi_handle handle, u32 lvl, goto exit; } - ioapic = kzalloc(sizeof(*ioapic), GFP_KERNEL); + ioapic = kzalloc_obj(*ioapic, GFP_KERNEL); if (!ioapic) { pr_err("cannot allocate memory for new IOAPIC\n"); goto exit; diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index 5b85989f96be..6351a66c555d 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -91,8 +91,8 @@ static acpi_status parse_csi2_resource(struct acpi_resource *res, void *context) return AE_OK; } - conn = kmalloc(struct_size(conn, remote_name, csi2_res_src_length + 1), - GFP_KERNEL); + conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1, + GFP_KERNEL); if (!conn) return AE_OK; @@ -111,7 +111,7 @@ static struct crs_csi2 *acpi_mipi_add_crs_csi2(acpi_handle handle, { struct crs_csi2 *csi2; - csi2 = kzalloc(sizeof(*csi2), GFP_KERNEL); + csi2 = kzalloc_obj(*csi2, GFP_KERNEL); if (!csi2) return NULL; diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index e19aba02b800..b59dcbff25c1 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2271,9 +2271,9 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, { u16 nr = ndr_desc->num_mappings; struct nfit_set_info2 *info2 __free(kfree) = - kcalloc(nr, sizeof(*info2), GFP_KERNEL); + kzalloc_objs(*info2, nr, GFP_KERNEL); struct nfit_set_info *info __free(kfree) = - kcalloc(nr, sizeof(*info), GFP_KERNEL); + kzalloc_objs(*info, nr, GFP_KERNEL); struct device *dev = acpi_desc->dev; struct nd_interleave_set *nd_set; int i; diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 77a81627aaef..3f68ba64537d 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -202,7 +202,7 @@ static __init void alloc_memory_initiator(unsigned int cpu_pxm) if (initiator) return; - initiator = kzalloc(sizeof(*initiator), GFP_KERNEL); + initiator = kzalloc_obj(*initiator, GFP_KERNEL); if (!initiator) return; @@ -217,7 +217,7 @@ static __init struct memory_target *alloc_target(unsigned int mem_pxm) target = find_mem_target(mem_pxm); if (!target) { - target = kzalloc(sizeof(*target), GFP_KERNEL); + target = kzalloc_obj(*target, GFP_KERNEL); if (!target) return NULL; target->memory_pxm = mem_pxm; @@ -371,7 +371,7 @@ static __init void hmat_add_locality(struct acpi_hmat_locality *hmat_loc) { struct memory_locality *loc; - loc = kzalloc(sizeof(*loc), GFP_KERNEL); + loc = kzalloc_obj(*loc, GFP_KERNEL); if (!loc) { pr_notice_once("Failed to allocate HMAT locality\n"); return; @@ -502,7 +502,7 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header, if (!target) return 0; - tcache = kzalloc(sizeof(*tcache), GFP_KERNEL); + tcache = kzalloc_obj(*tcache, GFP_KERNEL); if (!tcache) { pr_notice_once("Failed to allocate HMAT cache info\n"); return 0; diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c index a2b11069e792..354783ede8f1 100644 --- a/drivers/acpi/nvs.c +++ b/drivers/acpi/nvs.c @@ -39,7 +39,7 @@ int acpi_nvs_register(__u64 start, __u64 size) { struct nvs_region *region; - region = kmalloc(sizeof(*region), GFP_KERNEL); + region = kmalloc_obj(*region, GFP_KERNEL); if (!region) return -ENOMEM; region->phys_start = start; @@ -102,7 +102,7 @@ static int suspend_nvs_register(unsigned long start, unsigned long size) while (size > 0) { unsigned int nr_bytes; - entry = kzalloc(sizeof(struct nvs_page), GFP_KERNEL); + entry = kzalloc_obj(struct nvs_page, GFP_KERNEL); if (!entry) goto Error; diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 05393a7315fe..0fa12dd40840 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -344,7 +344,7 @@ void __iomem __ref goto out; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { mutex_unlock(&acpi_ioremap_lock); return NULL; @@ -1117,7 +1117,7 @@ acpi_status acpi_os_execute(acpi_execute_type type, * having a static work_struct. */ - dpc = kzalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC); + dpc = kzalloc_obj(struct acpi_os_dpc, GFP_ATOMIC); if (!dpc) return AE_NO_MEMORY; @@ -1197,7 +1197,7 @@ acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src) "Scheduling hotplug event %u for deferred handling\n", src); - hpw = kmalloc(sizeof(*hpw), GFP_KERNEL); + hpw = kmalloc_obj(*hpw, GFP_KERNEL); if (!hpw) return AE_NO_MEMORY; diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index c416942ff3e2..5a4169db5ea6 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -147,7 +147,7 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev, prt->pin + 1 != pin) return -ENODEV; - entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); + entry = kzalloc_obj(struct acpi_prt_entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index b91b039a3d20..e3b03237fa57 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -720,7 +720,7 @@ static int acpi_pci_link_add(struct acpi_device *device, int result; int i; - link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); + link = kzalloc_obj(struct acpi_pci_link, GFP_KERNEL); if (!link) return -ENOMEM; diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index 58e10a980114..99a50e9c12dd 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -304,7 +304,7 @@ static __init int pci_mcfg_parse(struct acpi_table_header *header) mcfg = (struct acpi_table_mcfg *)header; mptr = (struct acpi_mcfg_allocation *) &mcfg[1]; - arr = kcalloc(n, sizeof(*arr), GFP_KERNEL); + arr = kzalloc_objs(*arr, n, GFP_KERNEL); if (!arr) return -ENOMEM; diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 9d7f85dadc48..bd2525fcda8e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -648,7 +648,7 @@ static int acpi_pci_root_add(struct acpi_device *device, bool hotadd = system_state == SYSTEM_RUNNING; const char *acpi_hid; - root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); + root = kzalloc_obj(struct acpi_pci_root, GFP_KERNEL); if (!root) return -ENOMEM; diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index 15234b65ea22..031d00a4a75f 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -104,7 +104,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) return AE_OK; } - slot = kmalloc(sizeof(*slot), GFP_KERNEL); + slot = kmalloc_obj(*slot, GFP_KERNEL); if (!slot) return AE_OK; diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c index ea04a8c69215..bd4d332520bb 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -560,8 +560,8 @@ struct device *platform_profile_register(struct device *dev, const char *name, !ops->profile_set || !ops->probe)) return ERR_PTR(-EINVAL); - struct platform_profile_handler *pprof __free(kfree) = kzalloc( - sizeof(*pprof), GFP_KERNEL); + struct platform_profile_handler *pprof __free(kfree) = kzalloc_obj(*pprof, + GFP_KERNEL); if (!pprof) return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 7da5ae5594a7..e377446b5cce 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -104,7 +104,7 @@ static int acpi_power_resources_list_add(acpi_handle handle, if (!resource || !list) return -EINVAL; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -265,7 +265,7 @@ acpi_power_resource_add_dependent(struct acpi_power_resource *resource, goto unlock; } - dep = kzalloc(sizeof(*dep), GFP_KERNEL); + dep = kzalloc_obj(*dep, GFP_KERNEL); if (!dep) { ret = -ENOMEM; goto unlock; @@ -945,7 +945,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) if (device) return device; - resource = kzalloc(sizeof(*resource), GFP_KERNEL); + resource = kzalloc_obj(*resource, GFP_KERNEL); if (!resource) return NULL; diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index 7b8b5d2015ec..5d4b0f7904d6 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -135,7 +135,7 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) goto parse_prmt_out4; memmove(tm->mmio_info, temp_mmio, mmio_range_size); } else { - tm->mmio_info = kmalloc(sizeof(*tm->mmio_info), GFP_KERNEL); + tm->mmio_info = kmalloc_obj(*tm->mmio_info, GFP_KERNEL); if (!tm->mmio_info) goto parse_prmt_out2; diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 81f372c64074..aa7020d71b55 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -910,7 +910,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle, goto end; } - lpi_state = kcalloc(pkg_count, sizeof(*lpi_state), GFP_KERNEL); + lpi_state = kzalloc_objs(*lpi_state, pkg_count, GFP_KERNEL); if (!lpi_state) { ret = -ENOMEM; goto end; @@ -1417,7 +1417,7 @@ void acpi_processor_power_init(struct acpi_processor *pr) if (!pr->flags.power) return; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return; diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 994091bd52de..e174d144f1d9 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c @@ -32,11 +32,11 @@ static struct acpi_object_list *acpi_processor_alloc_pdc(void) u32 *buf; /* allocate and initialize pdc. It will be used later. */ - obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); + obj_list = kmalloc_obj(struct acpi_object_list, GFP_KERNEL); if (!obj_list) goto out; - obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); + obj = kmalloc_obj(union acpi_object, GFP_KERNEL); if (!obj) { kfree(obj_list); goto out; diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 8972446b7162..f1c7c2ad5094 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -341,9 +341,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) pr->performance->state_count = pss->package.count; pr->performance->states = - kmalloc_array(pss->package.count, - sizeof(struct acpi_processor_px), - GFP_KERNEL); + kmalloc_objs(struct acpi_processor_px, pss->package.count, + GFP_KERNEL); if (!pr->performance->states) { result = -ENOMEM; goto end; diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index f9c2bc1d4a3a..2d398ae5c662 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -512,9 +512,8 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) pr->throttling.state_count = tss->package.count; pr->throttling.states_tss = - kmalloc_array(tss->package.count, - sizeof(struct acpi_processor_tx_tss), - GFP_KERNEL); + kmalloc_objs(struct acpi_processor_tx_tss, tss->package.count, + GFP_KERNEL); if (!pr->throttling.states_tss) { result = -ENOMEM; goto end; diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 18e90067d567..710dccae595b 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -89,7 +89,7 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc, if (acpi_graph_ignore_port(handle)) return false; - dn = kzalloc(sizeof(*dn), GFP_KERNEL); + dn = kzalloc_obj(*dn, GFP_KERNEL); if (!dn) return false; @@ -383,7 +383,7 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid, { struct acpi_device_properties *props; - props = kzalloc(sizeof(*props), GFP_KERNEL); + props = kzalloc_obj(*props, GFP_KERNEL); if (props) { INIT_LIST_HEAD(&props->list); props->guid = guid; diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c index d9a2154d6c6a..f3cef56ff59e 100644 --- a/drivers/acpi/riscv/irq.c +++ b/drivers/acpi/riscv/irq.c @@ -136,7 +136,7 @@ static int __init riscv_acpi_register_ext_intc(u32 gsi_base, u32 nr_irqs, u32 nr { struct riscv_ext_intc_list *ext_intc_element, *node, *prev; - ext_intc_element = kzalloc(sizeof(*ext_intc_element), GFP_KERNEL); + ext_intc_element = kzalloc_obj(*ext_intc_element, GFP_KERNEL); if (!ext_intc_element) return -ENOMEM; @@ -342,7 +342,8 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle) if (entry->source[0]) { acpi_get_handle(handle, entry->source, &link_handle); dep_devices.count = 1; - dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); + dep_devices.handles = kzalloc_objs(*dep_devices.handles, + 1, GFP_KERNEL); if (!dep_devices.handles) { acpi_handle_err(handle, "failed to allocate memory\n"); continue; @@ -353,7 +354,8 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle) } else { gsi_handle = riscv_acpi_get_gsi_handle(entry->source_index); dep_devices.count = 1; - dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); + dep_devices.handles = kzalloc_objs(*dep_devices.handles, + 1, GFP_KERNEL); if (!dep_devices.handles) { acpi_handle_err(handle, "failed to allocate memory\n"); continue; @@ -382,7 +384,8 @@ static u32 riscv_acpi_add_irq_dep(acpi_handle handle) riscv_acpi_irq_get_dep(handle, i, &gsi_handle); i++) { dep_devices.count = 1; - dep_devices.handles = kcalloc(1, sizeof(*dep_devices.handles), GFP_KERNEL); + dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1, + GFP_KERNEL); if (!dep_devices.handles) { acpi_handle_err(handle, "failed to allocate memory\n"); continue; diff --git a/drivers/acpi/riscv/rimt.c b/drivers/acpi/riscv/rimt.c index 7f423405e5ef..229c4a0d47a3 100644 --- a/drivers/acpi/riscv/rimt.c +++ b/drivers/acpi/riscv/rimt.c @@ -45,7 +45,7 @@ static int rimt_set_fwnode(struct acpi_rimt_node *rimt_node, { struct rimt_fwnode *np; - np = kzalloc(sizeof(*np), GFP_ATOMIC); + np = kzalloc_obj(*np, GFP_ATOMIC); if (WARN_ON(!np)) return -ENOMEM; diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 85160e475c97..bcbd02d665d5 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -636,7 +636,7 @@ static int acpi_sbs_probe(struct platform_device *pdev) int result = 0; int id; - sbs = kzalloc(sizeof(struct acpi_sbs), GFP_KERNEL); + sbs = kzalloc_obj(struct acpi_sbs, GFP_KERNEL); if (!sbs) { result = -ENOMEM; goto end; diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index cb60d1d52e3e..969c1da7a015 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c @@ -254,7 +254,7 @@ static int acpi_smbus_hc_probe(struct platform_device *pdev) strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); - hc = kzalloc(sizeof(struct acpi_smb_hc), GFP_KERNEL); + hc = kzalloc_obj(struct acpi_smb_hc, GFP_KERNEL); if (!hc) return -ENOMEM; mutex_init(&hc->lock); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 565a84a7d7bc..490242bf161b 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -757,8 +757,8 @@ int acpi_device_add(struct acpi_device *device) if (result) goto err_unlock; } else { - acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), - GFP_KERNEL); + acpi_device_bus_id = kzalloc_obj(*acpi_device_bus_id, + GFP_KERNEL); if (!acpi_device_bus_id) { result = -ENOMEM; goto err_unlock; @@ -1330,7 +1330,7 @@ static void acpi_add_id(struct acpi_device_pnp *pnp, const char *dev_id) { struct acpi_hardware_id *id; - id = kmalloc(sizeof(*id), GFP_KERNEL); + id = kmalloc_obj(*id, GFP_KERNEL); if (!id) return; @@ -1568,7 +1568,7 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map) ret = acpi_dev_get_dma_resources(adev, &list); if (ret > 0) { - r = kcalloc(ret + 1, sizeof(*r), GFP_KERNEL); + r = kzalloc_objs(*r, ret + 1, GFP_KERNEL); if (!r) { ret = -ENOMEM; goto out; @@ -1863,7 +1863,7 @@ static int acpi_add_single_object(struct acpi_device **child, bool release_dep_lock = false; int result; - device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); + device = kzalloc_obj(struct acpi_device, GFP_KERNEL); if (!device) return -ENOMEM; @@ -2028,7 +2028,7 @@ int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices) if (skip) continue; - dep = kzalloc(sizeof(*dep), GFP_KERNEL); + dep = kzalloc_obj(*dep, GFP_KERNEL); if (!dep) continue; @@ -2225,7 +2225,7 @@ static void acpi_default_enumeration(struct acpi_device *device) * other device objects have been processed and PCI has claimed * BARs in case there are resource conflicts. */ - sd = kmalloc(sizeof(*sd), GFP_KERNEL); + sd = kmalloc_obj(*sd, GFP_KERNEL); if (sd) { sd->adev = device; list_add_tail(&sd->node, &acpi_scan_system_dev_list); @@ -2899,7 +2899,7 @@ void acpi_scan_table_notify(void) if (!acpi_scan_initialized) return; - work = kmalloc(sizeof(*work), GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) return; diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 1bd2f555e673..44ea37f998e6 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -385,7 +385,7 @@ acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context) switch (event) { case ACPI_TABLE_EVENT_INSTALL: - table_attr = kzalloc(sizeof(*table_attr), GFP_KERNEL); + table_attr = kzalloc_obj(*table_attr, GFP_KERNEL); if (!table_attr) return AE_NO_MEMORY; @@ -491,7 +491,7 @@ static int acpi_table_data_init(struct acpi_table_header *th) for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) { if (ACPI_COMPARE_NAMESEG(th->signature, acpi_data_objs[i].name)) { - data_attr = kzalloc(sizeof(*data_attr), GFP_KERNEL); + data_attr = kzalloc_obj(*data_attr, GFP_KERNEL); if (!data_attr) return -ENOMEM; sysfs_attr_init(&data_attr->attr.attr); @@ -532,7 +532,7 @@ static int acpi_tables_sysfs_init(void) if (ACPI_FAILURE(status)) continue; - table_attr = kzalloc(sizeof(*table_attr), GFP_KERNEL); + table_attr = kzalloc_obj(*table_attr, GFP_KERNEL); if (!table_attr) return -ENOMEM; @@ -864,11 +864,11 @@ void acpi_irq_stats_init(void) num_gpes = acpi_current_gpe_count; num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA; - all_attrs = kcalloc(num_counters + 1, sizeof(*all_attrs), GFP_KERNEL); + all_attrs = kzalloc_objs(*all_attrs, num_counters + 1, GFP_KERNEL); if (all_attrs == NULL) return; - all_counters = kcalloc(num_counters, sizeof(*all_counters), GFP_KERNEL); + all_counters = kzalloc_objs(*all_counters, num_counters, GFP_KERNEL); if (all_counters == NULL) goto fail; @@ -876,7 +876,7 @@ void acpi_irq_stats_init(void) if (ACPI_FAILURE(status)) goto fail; - counter_attrs = kcalloc(num_counters, sizeof(*counter_attrs), GFP_KERNEL); + counter_attrs = kzalloc_objs(*counter_attrs, num_counters, GFP_KERNEL); if (counter_attrs == NULL) goto fail; diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index e9d3ab18b404..b2a1e1773840 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -792,7 +792,7 @@ static int acpi_thermal_probe(struct platform_device *pdev) if (!device) return -EINVAL; - tz = kzalloc(sizeof(struct acpi_thermal), GFP_KERNEL); + tz = kzalloc_obj(struct acpi_thermal, GFP_KERNEL); if (!tz) return -ENOMEM; diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 526563a0d188..67b9a17e33ec 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -365,7 +365,7 @@ bool acpi_evaluate_reference(acpi_handle handle, acpi_string pathname, goto err; list->count = package->package.count; - list->handles = kcalloc(list->count, sizeof(*list->handles), GFP_KERNEL); + list->handles = kzalloc_objs(*list->handles, list->count, GFP_KERNEL); if (!list->handles) goto err_clear; diff --git a/drivers/acpi/viot.c b/drivers/acpi/viot.c index c13a20365c2c..26fe65dd4a6c 100644 --- a/drivers/acpi/viot.c +++ b/drivers/acpi/viot.c @@ -142,7 +142,7 @@ static struct viot_iommu * __init viot_get_iommu(unsigned int offset) if (viot_check_bounds(hdr)) return NULL; - viommu = kzalloc(sizeof(*viommu), GFP_KERNEL); + viommu = kzalloc_obj(*viommu, GFP_KERNEL); if (!viommu) return NULL; @@ -193,7 +193,7 @@ static int __init viot_parse_node(const struct acpi_viot_header *hdr) hdr->type == ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO) return 0; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c index ff6dc957bc11..f82e6f3127b6 100644 --- a/drivers/acpi/wakeup.c +++ b/drivers/acpi/wakeup.c @@ -120,7 +120,7 @@ int acpi_register_wakeup_handler(int wake_irq, bool (*wakeup)(void *context), if (!acpi_sci_irq_valid() || wake_irq != acpi_sci_irq) return 0; - handler = kmalloc(sizeof(*handler), GFP_KERNEL); + handler = kmalloc_obj(*handler, GFP_KERNEL); if (!handler) return -ENOMEM; diff --git a/drivers/acpi/x86/lpss.c b/drivers/acpi/x86/lpss.c index 1dcb80ab0d23..3dfb8c2400f5 100644 --- a/drivers/acpi/x86/lpss.c +++ b/drivers/acpi/x86/lpss.c @@ -623,7 +623,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev, if (!dev_desc) return -EINVAL; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index b43d10f986a2..82075543a1ed 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -129,9 +129,9 @@ static void lpi_device_get_constraints_amd(void) goto free_acpi_buffer; } - lpi_constraints_table = kcalloc(package->package.count, - sizeof(*lpi_constraints_table), - GFP_KERNEL); + lpi_constraints_table = kzalloc_objs(*lpi_constraints_table, + package->package.count, + GFP_KERNEL); if (!lpi_constraints_table) goto free_acpi_buffer; @@ -209,9 +209,8 @@ static void lpi_device_get_constraints(void) if (!out_obj) return; - lpi_constraints_table = kcalloc(out_obj->package.count, - sizeof(*lpi_constraints_table), - GFP_KERNEL); + lpi_constraints_table = kzalloc_objs(*lpi_constraints_table, + out_obj->package.count, GFP_KERNEL); if (!lpi_constraints_table) goto free_acpi_buffer; diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 952c45ca6e48..9d3d4607c5f2 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -611,7 +611,7 @@ struct amba_device *amba_device_alloc(const char *name, resource_size_t base, { struct amba_device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev) { amba_device_initialize(dev, name); dev->res.start = base; diff --git a/drivers/android/binder.c b/drivers/android/binder.c index f43edb11bef4..3cb7798873bb 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -795,7 +795,7 @@ static struct binder_node *binder_new_node(struct binder_proc *proc, struct flat_binder_object *fp) { struct binder_node *node; - struct binder_node *new_node = kzalloc(sizeof(*node), GFP_KERNEL); + struct binder_node *new_node = kzalloc_obj(*node, GFP_KERNEL); if (!new_node) return NULL; @@ -1469,7 +1469,7 @@ static int binder_inc_ref_for_node(struct binder_proc *proc, ref = binder_get_ref_for_node_olocked(proc, node, NULL); if (!ref) { binder_proc_unlock(proc); - new_ref = kzalloc(sizeof(*ref), GFP_KERNEL); + new_ref = kzalloc_obj(*ref, GFP_KERNEL); if (!new_ref) return -ENOMEM; binder_proc_lock(proc); @@ -2009,7 +2009,7 @@ static void binder_deferred_fd_close(int fd) { struct binder_task_work_cb *twcb; - twcb = kzalloc(sizeof(*twcb), GFP_KERNEL); + twcb = kzalloc_obj(*twcb, GFP_KERNEL); if (!twcb) return; init_task_work(&twcb->twork, binder_do_fd_close); @@ -2386,7 +2386,7 @@ static int binder_translate_fd(u32 fd, binder_size_t fd_offset, * of the fd in the target needs to be done from a * target thread. */ - fixup = kzalloc(sizeof(*fixup), GFP_KERNEL); + fixup = kzalloc_obj(*fixup, GFP_KERNEL); if (!fixup) { ret = -ENOMEM; goto err_alloc; @@ -2579,7 +2579,7 @@ static void binder_cleanup_deferred_txn_lists(struct list_head *sgc_head, static int binder_defer_copy(struct list_head *sgc_head, binder_size_t offset, const void __user *sender_uaddr, size_t length) { - struct binder_sg_copy *bc = kzalloc(sizeof(*bc), GFP_KERNEL); + struct binder_sg_copy *bc = kzalloc_obj(*bc, GFP_KERNEL); if (!bc) return -ENOMEM; @@ -2622,7 +2622,7 @@ static int binder_defer_copy(struct list_head *sgc_head, binder_size_t offset, static int binder_add_fixup(struct list_head *pf_head, binder_size_t offset, binder_uintptr_t fixup, size_t skip_size) { - struct binder_ptr_fixup *pf = kzalloc(sizeof(*pf), GFP_KERNEL); + struct binder_ptr_fixup *pf = kzalloc_obj(*pf, GFP_KERNEL); struct binder_ptr_fixup *tmppf; if (!pf) @@ -3101,7 +3101,7 @@ static void binder_transaction(struct binder_proc *proc, binder_set_extended_error(&thread->ee, t_debug_id, BR_OK, 0); binder_inner_proc_unlock(proc); - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) { binder_txn_error("%d:%d cannot allocate transaction\n", thread->pid, proc->pid); @@ -3320,7 +3320,7 @@ static void binder_transaction(struct binder_proc *proc, e->to_thread = target_thread->pid; e->to_proc = target_proc->pid; - tcomplete = kzalloc(sizeof(*tcomplete), GFP_KERNEL); + tcomplete = kzalloc_obj(*tcomplete, GFP_KERNEL); if (tcomplete == NULL) { binder_txn_error("%d:%d cannot allocate work for transaction\n", thread->pid, proc->pid); @@ -3926,7 +3926,7 @@ binder_request_freeze_notification(struct binder_proc *proc, struct binder_ref_freeze *freeze; struct binder_ref *ref; - freeze = kzalloc(sizeof(*freeze), GFP_KERNEL); + freeze = kzalloc_obj(*freeze, GFP_KERNEL); if (!freeze) return -ENOMEM; binder_proc_lock(proc); @@ -4394,7 +4394,7 @@ static int binder_thread_write(struct binder_proc *proc, * Allocate memory for death notification * before taking lock */ - death = kzalloc(sizeof(*death), GFP_KERNEL); + death = kzalloc_obj(*death, GFP_KERNEL); if (death == NULL) { WARN_ON(thread->return_error.cmd != BR_OK); @@ -5293,7 +5293,7 @@ static struct binder_thread *binder_get_thread(struct binder_proc *proc) thread = binder_get_thread_ilocked(proc, NULL); binder_inner_proc_unlock(proc); if (!thread) { - new_thread = kzalloc(sizeof(*thread), GFP_KERNEL); + new_thread = kzalloc_obj(*thread, GFP_KERNEL); if (new_thread == NULL) return NULL; binder_inner_proc_lock(proc); @@ -5902,9 +5902,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) goto err; } - target_procs = kcalloc(target_procs_count, - sizeof(struct binder_proc *), - GFP_KERNEL); + target_procs = kzalloc_objs(struct binder_proc *, + target_procs_count, GFP_KERNEL); if (!target_procs) { mutex_unlock(&binder_procs_lock); @@ -6061,7 +6060,7 @@ static int binder_open(struct inode *nodp, struct file *filp) binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__, current->tgid, current->pid); - proc = kzalloc(sizeof(*proc), GFP_KERNEL); + proc = kzalloc_obj(*proc, GFP_KERNEL); if (proc == NULL) return -ENOMEM; @@ -7065,7 +7064,7 @@ static int __init init_binder_device(const char *name) int ret; struct binder_device *binder_device; - binder_device = kzalloc(sizeof(*binder_device), GFP_KERNEL); + binder_device = kzalloc_obj(*binder_device, GFP_KERNEL); if (!binder_device) return -ENOMEM; diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c index 5c1319d80036..2b640f6eddc2 100644 --- a/drivers/android/binder/rust_binderfs.c +++ b/drivers/android/binder/rust_binderfs.c @@ -145,7 +145,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, mutex_unlock(&binderfs_minors_mutex); ret = -ENOMEM; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) goto err; @@ -387,7 +387,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) bool use_reserve = true; #endif - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return -ENOMEM; @@ -642,7 +642,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_op = &binderfs_super_ops; sb->s_time_gran = 1; - sb->s_fs_info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(struct binderfs_info, GFP_KERNEL); if (!sb->s_fs_info) return -ENOMEM; info = sb->s_fs_info; @@ -721,7 +721,7 @@ static int binderfs_init_fs_context(struct fs_context *fc) { struct binderfs_mount_opts *ctx; - ctx = kzalloc(sizeof(struct binderfs_mount_opts), GFP_KERNEL); + ctx = kzalloc_obj(struct binderfs_mount_opts, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 67a068c075c0..aab88f2347eb 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -289,7 +289,7 @@ static struct page *binder_page_alloc(struct binder_alloc *alloc, return NULL; /* allocate and install shrinker metadata under page->private */ - mdata = kzalloc(sizeof(*mdata), GFP_KERNEL); + mdata = kzalloc_obj(*mdata, GFP_KERNEL); if (!mdata) { __free_page(page); return NULL; @@ -672,7 +672,7 @@ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, } /* Preallocate the next buffer */ - next = kzalloc(sizeof(*next), GFP_KERNEL); + next = kzalloc_obj(*next, GFP_KERNEL); if (!next) return ERR_PTR(-ENOMEM); @@ -916,16 +916,15 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, alloc->vm_start = vma->vm_start; - alloc->pages = kvcalloc(alloc->buffer_size / PAGE_SIZE, - sizeof(alloc->pages[0]), - GFP_KERNEL); + alloc->pages = kvzalloc_objs(alloc->pages[0], + alloc->buffer_size / PAGE_SIZE, GFP_KERNEL); if (!alloc->pages) { ret = -ENOMEM; failure_string = "alloc page array"; goto err_alloc_pages_failed; } - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) { ret = -ENOMEM; failure_string = "alloc buffer struct"; diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 9f8a18c88d66..73a7c3b54f21 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -145,7 +145,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, mutex_unlock(&binderfs_minors_mutex); ret = -ENOMEM; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) goto err; @@ -396,7 +396,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) bool use_reserve = true; #endif - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return -ENOMEM; @@ -638,7 +638,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_op = &binderfs_super_ops; sb->s_time_gran = 1; - sb->s_fs_info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(struct binderfs_info, GFP_KERNEL); if (!sb->s_fs_info) return -ENOMEM; info = sb->s_fs_info; @@ -717,7 +717,7 @@ static int binderfs_init_fs_context(struct fs_context *fc) { struct binderfs_mount_opts *ctx; - ctx = kzalloc(sizeof(struct binderfs_mount_opts), GFP_KERNEL); + ctx = kzalloc_obj(struct binderfs_mount_opts, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 91d44302eac9..12c3a0330f67 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -594,7 +594,8 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, * We cannot use devm_ here, since ahci_platform_put_resources() uses * target_pwrs after devm_ have freed memory */ - hpriv->target_pwrs = kcalloc(hpriv->nports, sizeof(*hpriv->target_pwrs), GFP_KERNEL); + hpriv->target_pwrs = kzalloc_objs(*hpriv->target_pwrs, hpriv->nports, + GFP_KERNEL); if (!hpriv->target_pwrs) { rc = -ENOMEM; goto err_out; diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 15e18d50dcc6..a618313dea03 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -194,7 +194,7 @@ void ata_acpi_bind_port(struct ata_port *ap) if (!adev || adev->hp) return; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return; @@ -236,7 +236,7 @@ void ata_acpi_bind_dev(struct ata_device *dev) if (!adev || adev->hp) return; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return; diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index beb6984b379a..02dde2517122 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2557,7 +2557,7 @@ static int ata_dev_init_cdl_resources(struct ata_device *dev) unsigned int err_mask; if (!cdl) { - cdl = kzalloc(sizeof(*cdl), GFP_KERNEL); + cdl = kzalloc_obj(*cdl, GFP_KERNEL); if (!cdl) return -ENOMEM; dev->cdl = cdl; @@ -2832,7 +2832,7 @@ static void ata_dev_config_cpr(struct ata_device *dev) if (!nr_cpr) goto out; - cpr_log = kzalloc(struct_size(cpr_log, cpr, nr_cpr), GFP_KERNEL); + cpr_log = kzalloc_flex(*cpr_log, cpr, nr_cpr, GFP_KERNEL); if (!cpr_log) goto out; @@ -5638,7 +5638,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) struct ata_port *ap; int id; - ap = kzalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc_obj(*ap, GFP_KERNEL); if (!ap) return NULL; @@ -6714,7 +6714,7 @@ static void __init ata_parse_force_param(void) if (*p == ',') size++; - ata_force_tbl = kcalloc(size, sizeof(ata_force_tbl[0]), GFP_KERNEL); + ata_force_tbl = kzalloc_objs(ata_force_tbl[0], size, GFP_KERNEL); if (!ata_force_tbl) { printk(KERN_WARNING "ata: failed to extend force table, " "libata.force ignored\n"); diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index 57023324a56f..e3adc008fed1 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c @@ -339,8 +339,8 @@ static int sata_pmp_init_links (struct ata_port *ap, int nr_ports) int i, err; if (!pmp_link) { - pmp_link = kcalloc(SATA_PMP_MAX_PORTS, sizeof(pmp_link[0]), - GFP_NOIO); + pmp_link = kzalloc_objs(pmp_link[0], SATA_PMP_MAX_PORTS, + GFP_NOIO); if (!pmp_link) return -ENOMEM; diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 04e1e774645e..04a0ad66958e 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -849,7 +849,7 @@ int ata_slave_link_init(struct ata_port *ap) WARN_ON(ap->slave_link); WARN_ON(ap->flags & ATA_FLAG_PMP); - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index 62415fe67a11..85340ef98be3 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -758,7 +758,7 @@ struct scsi_transport_template *ata_attach_transport(void) struct ata_internal *i; int count; - i = kzalloc(sizeof(struct ata_internal), GFP_KERNEL); + i = kzalloc_obj(struct ata_internal, GFP_KERNEL); if (!i) return NULL; diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index 799531218ea2..e550327e7bd9 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -274,7 +274,7 @@ void zpodd_init(struct ata_device *dev) if (mech_type == ODD_MECH_TYPE_UNSUPPORTED) return; - zpodd = kzalloc(sizeof(struct zpodd), GFP_KERNEL); + zpodd = kzalloc_obj(struct zpodd, GFP_KERNEL); if (!zpodd) return; diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c index 22bd3ff6b7ae..93ca62cc6390 100644 --- a/drivers/ata/pata_parport/pata_parport.c +++ b/drivers/ata/pata_parport/pata_parport.c @@ -511,7 +511,7 @@ static struct pi_adapter *pi_init_one(struct parport *parport, if (id < 0) return NULL; - pi = kzalloc(sizeof(struct pi_adapter), GFP_KERNEL); + pi = kzalloc_obj(struct pi_adapter, GFP_KERNEL); if (!pi) { ida_free(&pata_parport_bus_dev_ids, id); return NULL; diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 7a4f59202156..e4fe47c8fa75 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -850,7 +850,7 @@ static int sata_dwc_port_start(struct ata_port *ap) } /* Allocate Port Struct */ - hsdevp = kzalloc(sizeof(*hsdevp), GFP_KERNEL); + hsdevp = kzalloc_obj(*hsdevp, GFP_KERNEL); if (!hsdevp) { err = -ENOMEM; goto CLEANUP; diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 84da8d6ef28e..703febbe0c03 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -706,7 +706,7 @@ static int sata_fsl_port_start(struct ata_port *ap) void __iomem *hcr_base = host_priv->hcr_base; u32 temp; - pp = kzalloc(sizeof(*pp), GFP_KERNEL); + pp = kzalloc_obj(*pp, GFP_KERNEL); if (!pp) return -ENOMEM; @@ -1451,7 +1451,7 @@ static int sata_fsl_probe(struct platform_device *ofdev) dev_dbg(&ofdev->dev, "@reset i/o = 0x%x\n", ioread32(csr_base + TRANSCFG)); - host_priv = kzalloc(sizeof(struct sata_fsl_host_priv), GFP_KERNEL); + host_priv = kzalloc_obj(struct sata_fsl_host_priv, GFP_KERNEL); if (!host_priv) goto error_exit_with_cleanup; diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c index 8157925af824..c85bca1af835 100644 --- a/drivers/atm/adummy.c +++ b/drivers/atm/adummy.c @@ -148,8 +148,7 @@ static int __init adummy_init(void) printk(KERN_ERR "adummy: version %s\n", DRV_VERSION); - adummy_dev = kzalloc(sizeof(struct adummy_dev), - GFP_KERNEL); + adummy_dev = kzalloc_obj(struct adummy_dev, GFP_KERNEL); if (!adummy_dev) { printk(KERN_ERR DEV_LABEL ": kzalloc() failed\n"); err = -ENOMEM; diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index fa3c76a2b49d..da7226b1aa66 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c @@ -375,7 +375,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) struct atmtcp_dev_data *dev_data; struct atm_dev *dev; - dev_data = kmalloc(sizeof(*dev_data),GFP_KERNEL); + dev_data = kmalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) return -ENOMEM; diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 3011cf1a84a9..b00ddead5390 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -1845,9 +1845,9 @@ static int eni_start(struct atm_dev *dev) /* initialize memory management */ buffer_mem = eni_dev->mem - (buf - eni_dev->ram); eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2; - eni_dev->free_list = kmalloc_array(eni_dev->free_list_size + 1, - sizeof(*eni_dev->free_list), - GFP_KERNEL); + eni_dev->free_list = kmalloc_objs(*eni_dev->free_list, + eni_dev->free_list_size + 1, + GFP_KERNEL); if (!eni_dev->free_list) { printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n", dev->number); @@ -1925,7 +1925,7 @@ static int eni_open(struct atm_vcc *vcc) DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi, vcc->vci); if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) { - eni_vcc = kmalloc(sizeof(struct eni_vcc),GFP_KERNEL); + eni_vcc = kmalloc_obj(struct eni_vcc, GFP_KERNEL); if (!eni_vcc) return -ENOMEM; vcc->dev_data = eni_vcc; eni_vcc->tx = NULL; /* for eni_close after open_rx */ @@ -2229,7 +2229,7 @@ static int eni_init_one(struct pci_dev *pci_dev, goto err_disable; rc = -ENOMEM; - eni_dev = kmalloc(sizeof(struct eni_dev), GFP_KERNEL); + eni_dev = kmalloc_obj(struct eni_dev, GFP_KERNEL); if (!eni_dev) goto err_disable; diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index fec081db36dc..0a3e9abd72f2 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -1331,7 +1331,7 @@ fore200e_open(struct atm_vcc *vcc) spin_unlock_irqrestore(&fore200e->q_lock, flags); - fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); + fore200e_vcc = kzalloc_obj(struct fore200e_vcc, GFP_ATOMIC); if (fore200e_vcc == NULL) { vc_map->vcc = NULL; return -ENOMEM; @@ -1676,7 +1676,7 @@ fore200e_getstats(struct fore200e* fore200e) u32 stats_dma_addr; if (fore200e->stats == NULL) { - fore200e->stats = kzalloc(sizeof(struct stats), GFP_KERNEL); + fore200e->stats = kzalloc_obj(struct stats, GFP_KERNEL); if (fore200e->stats == NULL) return -ENOMEM; } @@ -1955,7 +1955,7 @@ static int fore200e_irq_request(struct fore200e *fore200e) static int fore200e_get_esi(struct fore200e *fore200e) { - struct prom_data* prom = kzalloc(sizeof(struct prom_data), GFP_KERNEL); + struct prom_data* prom = kzalloc_obj(struct prom_data, GFP_KERNEL); int ok, i; if (!prom) @@ -2000,8 +2000,7 @@ static int fore200e_alloc_rx_buf(struct fore200e *fore200e) DPRINTK(2, "rx buffers %d / %d are being allocated\n", scheme, magn); /* allocate the array of receive buffers */ - buffer = bsq->buffer = kcalloc(nbr, sizeof(struct buffer), - GFP_KERNEL); + buffer = bsq->buffer = kzalloc_objs(struct buffer, nbr, GFP_KERNEL); if (buffer == NULL) return -ENOMEM; @@ -2529,7 +2528,7 @@ static int fore200e_sba_probe(struct platform_device *op) static int index = 0; int err; - fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); + fore200e = kzalloc_obj(struct fore200e, GFP_KERNEL); if (!fore200e) return -ENOMEM; @@ -2597,7 +2596,7 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev, goto out; } - fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); + fore200e = kzalloc_obj(struct fore200e, GFP_KERNEL); if (fore200e == NULL) { err = -ENOMEM; goto out_disable; diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 92a041d5387b..d2e41a7aaa3a 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c @@ -372,8 +372,7 @@ static int he_init_one(struct pci_dev *pci_dev, } pci_set_drvdata(pci_dev, atm_dev); - he_dev = kzalloc(sizeof(struct he_dev), - GFP_KERNEL); + he_dev = kzalloc_obj(struct he_dev, GFP_KERNEL); if (!he_dev) { err = -ENOMEM; goto init_one_failure; @@ -787,9 +786,8 @@ static int he_init_group(struct he_dev *he_dev, int group) } /* rbpl_virt 64-bit pointers */ - he_dev->rbpl_virt = kmalloc_array(RBPL_TABLE_SIZE, - sizeof(*he_dev->rbpl_virt), - GFP_KERNEL); + he_dev->rbpl_virt = kmalloc_objs(*he_dev->rbpl_virt, RBPL_TABLE_SIZE, + GFP_KERNEL); if (!he_dev->rbpl_virt) { hprintk("unable to allocate rbpl virt table\n"); goto out_free_rbpl_table; @@ -2132,7 +2130,7 @@ he_open(struct atm_vcc *vcc) cid = he_mkcid(he_dev, vpi, vci); - he_vcc = kmalloc(sizeof(struct he_vcc), GFP_ATOMIC); + he_vcc = kmalloc_obj(struct he_vcc, GFP_ATOMIC); if (he_vcc == NULL) { hprintk("unable to allocate he_vcc during open\n"); return -ENOMEM; diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index e6a300203e6c..7ac597f9c673 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev) { unsigned long flags; - if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) + if (!(dev->phy_data = kmalloc_obj(struct idt77105_priv, GFP_KERNEL))) return -ENOMEM; PRIV(dev)->dev = dev; spin_lock_irqsave(&idt77105_priv_lock, flags); diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 888695ccc2a7..d984d0766301 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -638,7 +638,7 @@ alloc_scq(struct idt77252_dev *card, int class) { struct scq_info *scq; - scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL); + scq = kzalloc_obj(struct scq_info, GFP_KERNEL); if (!scq) return NULL; scq->base = dma_alloc_coherent(&card->pcidev->dev, SCQ_SIZE, @@ -2116,7 +2116,7 @@ idt77252_init_est(struct vc_map *vc, int pcr) { struct rate_estimator *est; - est = kzalloc(sizeof(struct rate_estimator), GFP_KERNEL); + est = kzalloc_obj(struct rate_estimator, GFP_KERNEL); if (!est) return NULL; est->maxcps = pcr < 0 ? -pcr : pcr; @@ -2424,7 +2424,7 @@ idt77252_open(struct atm_vcc *vcc) index = VPCI2VC(card, vpi, vci); if (!card->vcs[index]) { - card->vcs[index] = kzalloc(sizeof(struct vc_map), GFP_KERNEL); + card->vcs[index] = kzalloc_obj(struct vc_map, GFP_KERNEL); if (!card->vcs[index]) { printk("%s: can't alloc vc in open()\n", card->name); mutex_unlock(&card->mutex); @@ -2855,7 +2855,7 @@ open_card_oam(struct idt77252_dev *card) for (vci = 3; vci < 5; vci++) { index = VPCI2VC(card, vpi, vci); - vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); + vc = kzalloc_obj(struct vc_map, GFP_KERNEL); if (!vc) { printk("%s: can't alloc vc\n", card->name); return -ENOMEM; @@ -2923,7 +2923,7 @@ open_card_ubr0(struct idt77252_dev *card) { struct vc_map *vc; - vc = kzalloc(sizeof(struct vc_map), GFP_KERNEL); + vc = kzalloc_obj(struct vc_map, GFP_KERNEL); if (!vc) { printk("%s: can't alloc vc\n", card->name); return -ENOMEM; @@ -3621,7 +3621,7 @@ static int idt77252_init_one(struct pci_dev *pcidev, goto err_out_disable_pdev; } - card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL); + card = kzalloc_obj(struct idt77252_dev, GFP_KERNEL); if (!card) { printk("idt77252-%d: can't allocate private data\n", index); err = -ENOMEM; diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 301e697e22ad..727b5d044115 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -114,7 +114,7 @@ static void ia_enque_head_rtn_q (IARTN_Q *que, IARTN_Q * data) } static int ia_enque_rtn_q (IARTN_Q *que, struct desc_tbl_t data) { - IARTN_Q *entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + IARTN_Q *entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; entry->data = data; @@ -1978,9 +1978,8 @@ static int tx_init(struct atm_dev *dev) buf_desc_ptr++; tx_pkt_start += iadev->tx_buf_sz; } - iadev->tx_buf = kmalloc_array(iadev->num_tx_desc, - sizeof(*iadev->tx_buf), - GFP_KERNEL); + iadev->tx_buf = kmalloc_objs(*iadev->tx_buf, iadev->num_tx_desc, + GFP_KERNEL); if (!iadev->tx_buf) { printk(KERN_ERR DEV_LABEL " couldn't get mem\n"); goto err_free_dle; @@ -1989,7 +1988,7 @@ static int tx_init(struct atm_dev *dev) { struct cpcs_trailer *cpcs; - cpcs = kmalloc(sizeof(*cpcs), GFP_KERNEL|GFP_DMA); + cpcs = kmalloc_obj(*cpcs, GFP_KERNEL | GFP_DMA); if(!cpcs) { printk(KERN_ERR DEV_LABEL " couldn't get freepage\n"); goto err_free_tx_bufs; @@ -2000,9 +1999,8 @@ static int tx_init(struct atm_dev *dev) sizeof(*cpcs), DMA_TO_DEVICE); } - iadev->desc_tbl = kmalloc_array(iadev->num_tx_desc, - sizeof(*iadev->desc_tbl), - GFP_KERNEL); + iadev->desc_tbl = kmalloc_objs(*iadev->desc_tbl, iadev->num_tx_desc, + GFP_KERNEL); if (!iadev->desc_tbl) { printk(KERN_ERR DEV_LABEL " couldn't get mem\n"); goto err_free_all_tx_bufs; @@ -2130,9 +2128,8 @@ static int tx_init(struct atm_dev *dev) memset((caddr_t)(iadev->seg_ram+i), 0, iadev->num_vc*4); vc = (struct main_vc *)iadev->MAIN_VC_TABLE_ADDR; evc = (struct ext_vc *)iadev->EXT_VC_TABLE_ADDR; - iadev->testTable = kmalloc_array(iadev->num_vc, - sizeof(*iadev->testTable), - GFP_KERNEL); + iadev->testTable = kmalloc_objs(*iadev->testTable, iadev->num_vc, + GFP_KERNEL); if (!iadev->testTable) { printk("Get freepage failed\n"); goto err_free_desc_tbl; @@ -2141,8 +2138,8 @@ static int tx_init(struct atm_dev *dev) { memset((caddr_t)vc, 0, sizeof(*vc)); memset((caddr_t)evc, 0, sizeof(*evc)); - iadev->testTable[i] = kmalloc(sizeof(struct testTable_t), - GFP_KERNEL); + iadev->testTable[i] = kmalloc_obj(struct testTable_t, + GFP_KERNEL); if (!iadev->testTable[i]) goto err_free_test_tables; iadev->testTable[i]->lastTime = 0; @@ -2712,7 +2709,7 @@ static int ia_open(struct atm_vcc *vcc) vcc->dev->number, vcc->vpi, vcc->vci);) /* Device dependent initialization */ - ia_vcc = kmalloc(sizeof(*ia_vcc), GFP_KERNEL); + ia_vcc = kmalloc_obj(*ia_vcc, GFP_KERNEL); if (!ia_vcc) return -ENOMEM; vcc->dev_data = ia_vcc; @@ -2798,7 +2795,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) rfredn_t *rfL; if (!capable(CAP_NET_ADMIN)) return -EPERM; - regs_local = kmalloc(sizeof(*regs_local), GFP_KERNEL); + regs_local = kmalloc_obj(*regs_local, GFP_KERNEL); if (!regs_local) return -ENOMEM; ffL = ®s_local->ffredn; rfL = ®s_local->rfredn; @@ -3168,7 +3165,7 @@ static int ia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) IADEV *iadev; int ret; - iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); + iadev = kzalloc_obj(*iadev, GFP_KERNEL); if (!iadev) { ret = -ENOMEM; goto err_out; diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 0dfa2cdc897c..682089aedbe4 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1464,7 +1464,7 @@ static inline void vcc_table_deallocate(const struct lanai_dev *lanai) static inline struct lanai_vcc *new_lanai_vcc(void) { struct lanai_vcc *lvcc; - lvcc = kzalloc(sizeof(*lvcc), GFP_KERNEL); + lvcc = kzalloc_obj(*lvcc, GFP_KERNEL); if (likely(lvcc != NULL)) { skb_queue_head_init(&lvcc->tx.backlog); #ifdef DEBUG @@ -2555,7 +2555,7 @@ static int lanai_init_one(struct pci_dev *pci, struct atm_dev *atmdev; int result; - lanai = kzalloc(sizeof(*lanai), GFP_KERNEL); + lanai = kzalloc_obj(*lanai, GFP_KERNEL); if (lanai == NULL) { printk(KERN_ERR DEV_LABEL ": couldn't allocate dev_data structure!\n"); diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index bc8dbba77b87..67486f363c2c 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -373,7 +373,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev) return error; } - card = kmalloc(sizeof(*card), GFP_KERNEL); + card = kmalloc_obj(*card, GFP_KERNEL); if (!card) { printk ("nicstar%d: can't allocate memory for device structure.\n", @@ -867,7 +867,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd) if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) return NULL; - scq = kmalloc(sizeof(*scq), GFP_KERNEL); + scq = kmalloc_obj(*scq, GFP_KERNEL); if (!scq) return NULL; scq->org = dma_alloc_coherent(&card->pcidev->dev, @@ -876,8 +876,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd) kfree(scq); return NULL; } - scq->skb = kcalloc(size / NS_SCQE_SIZE, sizeof(*scq->skb), - GFP_KERNEL); + scq->skb = kzalloc_objs(*scq->skb, size / NS_SCQE_SIZE, GFP_KERNEL); if (!scq->skb) { dma_free_coherent(&card->pcidev->dev, 2 * size, scq->org, scq->dma); diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index d3c30a28c410..1c86cd84ce69 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -1196,7 +1196,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) uint32_t data32; struct solos_card *card; - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) return -ENOMEM; diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c index 7d0fa729c2fe..0eb3ad488d1e 100644 --- a/drivers/atm/suni.c +++ b/drivers/atm/suni.c @@ -367,7 +367,7 @@ int suni_init(struct atm_dev *dev) { unsigned char mri; - if (!(dev->phy_data = kmalloc(sizeof(struct suni_priv),GFP_KERNEL))) + if (!(dev->phy_data = kmalloc_obj(struct suni_priv, GFP_KERNEL))) return -ENOMEM; PRIV(dev)->dev = dev; diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index cef42656c4b0..aee1f5a60c0d 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -226,7 +226,7 @@ static int hd44780_probe(struct platform_device *pdev) if (!lcd) return -ENOMEM; - hd = kzalloc(sizeof(*hd), GFP_KERNEL); + hd = kzalloc_obj(*hd, GFP_KERNEL); if (!hd) goto fail2; diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index 4e22373fcc1a..d3860953b0de 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -56,7 +56,7 @@ static int create_attachment(struct device *dev, struct linedisp *linedisp, bool { struct linedisp_attachment *attachment; - attachment = kzalloc(sizeof(*attachment), GFP_KERNEL); + attachment = kzalloc_obj(*attachment, GFP_KERNEL); if (!attachment) return -ENOMEM; @@ -390,7 +390,7 @@ static int linedisp_init_map(struct linedisp *linedisp) if (err < 0) return err; - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 958c0e31e84a..8aad34f96068 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -1428,7 +1428,7 @@ static struct logical_input *panel_bind_key(const char *name, const char *press, { struct logical_input *key; - key = kzalloc(sizeof(*key), GFP_KERNEL); + key = kzalloc_obj(*key, GFP_KERNEL); if (!key) return NULL; diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index c0ef6ea9c111..0a2a19d50b54 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -892,7 +892,7 @@ __weak int __init parse_acpi_topology(void) hetero_id = find_acpi_cpu_topology_hetero_id(cpu); entry = xa_load(&hetero_cpu, hetero_id); if (!entry) { - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); WARN_ON_ONCE(!entry); if (entry) { diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 72adbacc6554..2264c3647247 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c @@ -153,7 +153,7 @@ attribute_container_add_device(struct device *dev, if (!cont->match(cont, dev)) continue; - ic = kzalloc(sizeof(*ic), GFP_KERNEL); + ic = kzalloc_obj(*ic, GFP_KERNEL); if (!ic) { dev_err(dev, "failed to allocate class container\n"); continue; diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index 04bdbff4dbe5..8e7bae67f3c0 100644 --- a/drivers/base/auxiliary.c +++ b/drivers/base/auxiliary.c @@ -420,7 +420,7 @@ struct auxiliary_device *auxiliary_device_create(struct device *dev, struct auxiliary_device *auxdev; int ret; - auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL); + auxdev = kzalloc_obj(*auxdev, GFP_KERNEL); if (!auxdev) return NULL; diff --git a/drivers/base/auxiliary_sysfs.c b/drivers/base/auxiliary_sysfs.c index 754f21730afd..e432fa6b4ce9 100644 --- a/drivers/base/auxiliary_sysfs.c +++ b/drivers/base/auxiliary_sysfs.c @@ -63,7 +63,7 @@ int auxiliary_device_sysfs_irq_add(struct auxiliary_device *auxdev, int irq) if (ret) return ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 9eb7771706f0..5745f51f5901 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -696,7 +696,7 @@ int bus_add_driver(struct device_driver *drv) */ pr_debug("bus: '%s': add driver %s\n", sp->bus->name, drv->name); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { error = -ENOMEM; goto out_put_bus; @@ -897,7 +897,7 @@ int bus_register(const struct bus_type *bus) struct kobject *bus_kobj; struct lock_class_key *key; - priv = kzalloc(sizeof(struct subsys_private), GFP_KERNEL); + priv = kzalloc_obj(struct subsys_private, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1263,7 +1263,7 @@ static int subsys_register(const struct bus_type *subsys, goto err_sp; } - dev = kzalloc(sizeof(struct device), GFP_KERNEL); + dev = kzalloc_obj(struct device, GFP_KERNEL); if (!dev) { err = -ENOMEM; goto err_dev; diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 613410705a47..eb16451ba0a3 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -510,7 +510,8 @@ int __weak populate_cache_leaves(unsigned int cpu) static inline int allocate_cache_info(int cpu) { - per_cpu_cacheinfo(cpu) = kcalloc(cache_leaves(cpu), sizeof(struct cacheinfo), GFP_ATOMIC); + per_cpu_cacheinfo(cpu) = kzalloc_objs(struct cacheinfo, + cache_leaves(cpu), GFP_ATOMIC); if (!per_cpu_cacheinfo(cpu)) { cache_leaves(cpu) = 0; return -ENOMEM; @@ -882,8 +883,8 @@ static int cpu_cache_sysfs_init(unsigned int cpu) return PTR_ERR(per_cpu_cache_dev(cpu)); /* Allocate all required memory */ - per_cpu_index_dev(cpu) = kcalloc(cache_leaves(cpu), - sizeof(struct device *), GFP_KERNEL); + per_cpu_index_dev(cpu) = kzalloc_objs(struct device *, + cache_leaves(cpu), GFP_KERNEL); if (unlikely(per_cpu_index_dev(cpu) == NULL)) goto err_out; diff --git a/drivers/base/class.c b/drivers/base/class.c index 2526c57d924e..2650dead5af1 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -194,7 +194,7 @@ int class_register(const struct class *cls) return -EINVAL; } - cp = kzalloc(sizeof(*cp), GFP_KERNEL); + cp = kzalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); @@ -268,7 +268,7 @@ struct class *class_create(const char *name) struct class *cls; int retval; - cls = kzalloc(sizeof(*cls), GFP_KERNEL); + cls = kzalloc_obj(*cls, GFP_KERNEL); if (!cls) { retval = -ENOMEM; goto error; @@ -573,7 +573,7 @@ struct class_compat *class_compat_register(const char *name) { struct class_compat *cls; - cls = kmalloc(sizeof(struct class_compat), GFP_KERNEL); + cls = kmalloc_obj(struct class_compat, GFP_KERNEL); if (!cls) return NULL; cls->kobj = kobject_create_and_add(name, &class_kset->kobj); diff --git a/drivers/base/component.c b/drivers/base/component.c index 024ad9471b8a..fef563aa13e5 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -363,7 +363,7 @@ static int component_match_realloc(struct component_match *match, size_t num) if (match->alloc == num) return 0; - new = kmalloc_array(num, sizeof(*new), GFP_KERNEL); + new = kmalloc_objs(*new, num, GFP_KERNEL); if (!new) return -ENOMEM; @@ -521,7 +521,7 @@ int component_master_add_with_match(struct device *parent, if (ret) return ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; @@ -732,7 +732,7 @@ static int __component_add(struct device *dev, const struct component_ops *ops, struct component *component; int ret; - component = kzalloc(sizeof(*component), GFP_KERNEL); + component = kzalloc_obj(*component, GFP_KERNEL); if (!component) return -ENOMEM; diff --git a/drivers/base/core.c b/drivers/base/core.c index f599a1384eec..a8ea302c504c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -76,7 +76,7 @@ static int __fwnode_link_add(struct fwnode_handle *con, return 0; } - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; @@ -844,7 +844,7 @@ struct device_link *device_link_add(struct device *consumer, goto out; } - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) goto out; @@ -2748,7 +2748,7 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr, if (!kset->uevent_ops->filter(&dev->kobj)) goto out; - env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); if (!env) return -ENOMEM; @@ -3220,7 +3220,7 @@ static struct kobject *class_dir_create_and_add(struct subsys_private *sp, struct class_dir *dir; int retval; - dir = kzalloc(sizeof(*dir), GFP_KERNEL); + dir = kzalloc_obj(*dir, GFP_KERNEL); if (!dir) return ERR_PTR(-ENOMEM); @@ -3531,7 +3531,7 @@ static void device_remove_sys_dev_entry(struct device *dev) static int device_private_init(struct device *dev) { - dev->p = kzalloc(sizeof(*dev->p), GFP_KERNEL); + dev->p = kzalloc_obj(*dev->p, GFP_KERNEL); if (!dev->p) return -ENOMEM; dev->p->device = dev; @@ -4278,7 +4278,7 @@ struct device *__root_device_register(const char *name, struct module *owner) struct root_device *root; int err = -ENOMEM; - root = kzalloc(sizeof(struct root_device), GFP_KERNEL); + root = kzalloc_obj(struct root_device, GFP_KERNEL); if (!root) return ERR_PTR(err); @@ -4350,7 +4350,7 @@ device_create_groups_vargs(const struct class *class, struct device *parent, if (IS_ERR_OR_NULL(class)) goto error; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 3e3fa031e605..517609371f4c 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -466,7 +466,7 @@ __cpu_device_create(struct device *parent, void *drvdata, struct device *dev = NULL; int retval = -ENOMEM; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto error; diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c index 55bdc7f5e59d..7e4a491bf15e 100644 --- a/drivers/base/devcoredump.c +++ b/drivers/base/devcoredump.c @@ -381,7 +381,7 @@ void dev_coredumpm_timeout(struct device *dev, struct module *owner, if (!try_module_get(owner)) goto free; - devcd = kzalloc(sizeof(*devcd), gfp); + devcd = kzalloc_obj(*devcd, gfp); if (!devcd) goto put_module; diff --git a/drivers/base/devres.c b/drivers/base/devres.c index f54db6d138ab..171750c1f691 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -554,7 +554,7 @@ void *devres_open_group(struct device *dev, void *id, gfp_t gfp) struct devres_group *grp; unsigned long flags; - grp = kmalloc(sizeof(*grp), gfp); + grp = kmalloc_obj(*grp, gfp); if (unlikely(!grp)) return NULL; diff --git a/drivers/base/faux.c b/drivers/base/faux.c index 23d725817232..33dd8efdd541 100644 --- a/drivers/base/faux.c +++ b/drivers/base/faux.c @@ -133,7 +133,7 @@ struct faux_device *faux_device_create_with_groups(const char *name, struct device *dev; int ret; - faux_obj = kzalloc(sizeof(*faux_obj), GFP_KERNEL); + faux_obj = kzalloc_obj(*faux_obj, GFP_KERNEL); if (!faux_obj) return NULL; @@ -234,7 +234,7 @@ int __init faux_bus_init(void) { int ret; - faux_bus_root = kzalloc(sizeof(*faux_bus_root), GFP_KERNEL); + faux_bus_root = kzalloc_obj(*faux_bus_root, GFP_KERNEL); if (!faux_bus_root) return -ENOMEM; diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 4ebdca9e4da4..49eabc50c66d 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -127,7 +127,7 @@ static struct fw_priv *__allocate_fw_priv(const char *fw_name, if (offset != 0 && !(opt_flags & FW_OPT_PARTIAL)) return NULL; - fw_priv = kzalloc(sizeof(*fw_priv), GFP_ATOMIC); + fw_priv = kzalloc_obj(*fw_priv, GFP_ATOMIC); if (!fw_priv) return NULL; @@ -747,7 +747,7 @@ _request_firmware_prepare(struct firmware **firmware_p, const char *name, struct fw_priv *fw_priv; int ret; - *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); + *firmware_p = firmware = kzalloc_obj(*firmware, GFP_KERNEL); if (!firmware) { dev_err(device, "%s: kmalloc(struct firmware) failed\n", __func__); @@ -1165,7 +1165,7 @@ static int _request_firmware_nowait( { struct firmware_work *fw_work; - fw_work = kzalloc(sizeof(struct firmware_work), gfp); + fw_work = kzalloc_obj(struct firmware_work, gfp); if (!fw_work) return -ENOMEM; @@ -1338,7 +1338,7 @@ static struct fw_cache_entry *alloc_fw_cache_entry(const char *name) { struct fw_cache_entry *fce; - fce = kzalloc(sizeof(*fce), GFP_ATOMIC); + fce = kzalloc_obj(*fce, GFP_ATOMIC); if (!fce) goto exit; diff --git a/drivers/base/firmware_loader/sysfs.c b/drivers/base/firmware_loader/sysfs.c index 92e91050f96a..d921570026cc 100644 --- a/drivers/base/firmware_loader/sysfs.c +++ b/drivers/base/firmware_loader/sysfs.c @@ -405,7 +405,7 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, struct fw_sysfs *fw_sysfs; struct device *f_dev; - fw_sysfs = kzalloc(sizeof(*fw_sysfs), GFP_KERNEL); + fw_sysfs = kzalloc_obj(*fw_sysfs, GFP_KERNEL); if (!fw_sysfs) { fw_sysfs = ERR_PTR(-ENOMEM); goto exit; diff --git a/drivers/base/firmware_loader/sysfs_upload.c b/drivers/base/firmware_loader/sysfs_upload.c index c3797b93c5f5..fdc928b8cd1d 100644 --- a/drivers/base/firmware_loader/sysfs_upload.c +++ b/drivers/base/firmware_loader/sysfs_upload.c @@ -315,13 +315,13 @@ firmware_upload_register(struct module *module, struct device *parent, if (!try_module_get(module)) return ERR_PTR(-EFAULT); - fw_upload = kzalloc(sizeof(*fw_upload), GFP_KERNEL); + fw_upload = kzalloc_obj(*fw_upload, GFP_KERNEL); if (!fw_upload) { ret = -ENOMEM; goto exit_module_put; } - fw_upload_priv = kzalloc(sizeof(*fw_upload_priv), GFP_KERNEL); + fw_upload_priv = kzalloc_obj(*fw_upload_priv, GFP_KERNEL); if (!fw_upload_priv) { ret = -ENOMEM; goto free_fw_upload; diff --git a/drivers/base/isa.c b/drivers/base/isa.c index bfd9215c9070..ca2765ef9ab9 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -125,7 +125,7 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) for (id = 0; id < ndev; id++) { struct isa_dev *isa_dev; - isa_dev = kzalloc(sizeof *isa_dev, GFP_KERNEL); + isa_dev = kzalloc_obj(*isa_dev, GFP_KERNEL); if (!isa_dev) { error = -ENOMEM; break; diff --git a/drivers/base/map.c b/drivers/base/map.c index 83aeb09ca161..f5c01efe6b55 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c @@ -41,7 +41,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, if (n > 255) n = 255; - p = kmalloc_array(n, sizeof(struct probe), GFP_KERNEL); + p = kmalloc_objs(struct probe, n, GFP_KERNEL); if (p == NULL) return -ENOMEM; @@ -134,8 +134,8 @@ retry: struct kobj_map *kobj_map_init(kobj_probe_t *base_probe, struct mutex *lock) { - struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL); - struct probe *base = kzalloc(sizeof(*base), GFP_KERNEL); + struct kobj_map *p = kmalloc_obj(struct kobj_map, GFP_KERNEL); + struct probe *base = kzalloc_obj(*base, GFP_KERNEL); int i; if ((p == NULL) || (base == NULL)) { diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 751f248ca4a8..ea915e6a4781 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -800,7 +800,7 @@ static int add_memory_block(unsigned long block_id, int nid, unsigned long state put_device(&mem->dev); return -EEXIST; } - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return -ENOMEM; @@ -1078,7 +1078,7 @@ static int memory_group_register(struct memory_group group) if (!node_possible(group.nid)) return -EINVAL; - new_group = kzalloc(sizeof(group), GFP_KERNEL); + new_group = kzalloc_obj(group, GFP_KERNEL); if (!new_group) return -ENOMEM; *new_group = group; diff --git a/drivers/base/node.c b/drivers/base/node.c index 00cf4532f121..2b65b5eba708 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -158,7 +158,7 @@ static struct node_access_nodes *node_init_node_access(struct node *node, if (access_node->access == access) return access_node; - access_node = kzalloc(sizeof(*access_node), GFP_KERNEL); + access_node = kzalloc_obj(*access_node, GFP_KERNEL); if (!access_node) return NULL; @@ -340,7 +340,7 @@ static void node_init_cache_dev(struct node *node) { struct device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return; @@ -389,7 +389,7 @@ void node_add_cache(unsigned int nid, struct node_cache_attrs *cache_attrs) if (!node->cache_dev) return; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return; @@ -875,7 +875,7 @@ int register_node(int nid) int cpu; struct node *node; - node = kzalloc(sizeof(struct node), GFP_KERNEL); + node = kzalloc_obj(struct node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/base/physical_location.c b/drivers/base/physical_location.c index a5539e294d4d..06a2797e0213 100644 --- a/drivers/base/physical_location.c +++ b/drivers/base/physical_location.c @@ -21,8 +21,8 @@ bool dev_add_physical_location(struct device *dev) if (!acpi_get_physical_device_location(ACPI_HANDLE(dev), &pld)) return false; - dev->physical_location = - kzalloc(sizeof(*dev->physical_location), GFP_KERNEL); + dev->physical_location = kzalloc_obj(*dev->physical_location, + GFP_KERNEL); if (!dev->physical_location) { ACPI_FREE(pld); return false; diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index b69bcb37c830..0ac1e6757ec5 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c @@ -201,7 +201,7 @@ static int __pm_clk_add(struct device *dev, const char *con_id, if (!psd) return -EINVAL; - ce = kzalloc(sizeof(*ce), GFP_KERNEL); + ce = kzalloc_obj(*ce, GFP_KERNEL); if (!ce) return -ENOMEM; @@ -282,7 +282,7 @@ int of_pm_clk_add_clks(struct device *dev) if (count <= 0) return -ENODEV; - clks = kcalloc(count, sizeof(*clks), GFP_KERNEL); + clks = kzalloc_objs(*clks, count, GFP_KERNEL); if (!clks) return -ENOMEM; diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index 6ecf9ce4a4e6..5902658ee94f 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -27,7 +27,7 @@ int dev_pm_get_subsys_data(struct device *dev) { struct pm_subsys_data *psd; - psd = kzalloc(sizeof(*psd), GFP_KERNEL); + psd = kzalloc_obj(*psd, GFP_KERNEL); if (!psd) return -ENOMEM; @@ -222,7 +222,7 @@ int dev_pm_domain_attach_list(struct device *dev, if (num_pds <= 0) return 0; - pds = kzalloc(sizeof(*pds), GFP_KERNEL); + pds = kzalloc_obj(*pds, GFP_KERNEL); if (!pds) return -ENOMEM; diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index ff393cba7649..31acf7ef5d87 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -198,11 +198,11 @@ static int dev_pm_qos_constraints_allocate(struct device *dev) struct pm_qos_constraints *c; struct blocking_notifier_head *n; - qos = kzalloc(sizeof(*qos), GFP_KERNEL); + qos = kzalloc_obj(*qos, GFP_KERNEL); if (!qos) return -ENOMEM; - n = kcalloc(3, sizeof(*n), GFP_KERNEL); + n = kzalloc_objs(*n, 3, GFP_KERNEL); if (!n) { kfree(qos); return -ENOMEM; @@ -704,7 +704,7 @@ int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) if (!device_is_registered(dev) || value < 0) return -EINVAL; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -780,7 +780,7 @@ int dev_pm_qos_expose_flags(struct device *dev, s32 val) if (!device_is_registered(dev)) return -EINVAL; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -919,7 +919,7 @@ int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val) ret = -EINVAL; goto out; } - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) { ret = -ENOMEM; goto out; diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index aab843f6dfcc..19abc6a8eaa3 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -55,7 +55,7 @@ int dev_pm_set_wake_irq(struct device *dev, int irq) if (irq < 0) return -EINVAL; - wirq = kzalloc(sizeof(*wirq), GFP_KERNEL); + wirq = kzalloc_obj(*wirq, GFP_KERNEL); if (!wirq) return -ENOMEM; @@ -179,7 +179,7 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned if (irq < 0) return -EINVAL; - wirq = kzalloc(sizeof(*wirq), GFP_KERNEL); + wirq = kzalloc_obj(*wirq, GFP_KERNEL); if (!wirq) return -ENOMEM; diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index e69033d16fba..a3714a9e4e46 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -83,7 +83,7 @@ static struct wakeup_source *wakeup_source_create(const char *name) const char *ws_name; int id; - ws = kzalloc(sizeof(*ws), GFP_KERNEL); + ws = kzalloc_obj(*ws, GFP_KERNEL); if (!ws) goto err_ws; diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c index 3ffd427248e8..af888678156f 100644 --- a/drivers/base/power/wakeup_stats.c +++ b/drivers/base/power/wakeup_stats.c @@ -141,7 +141,7 @@ static struct device *wakeup_source_device_create(struct device *parent, struct device *dev = NULL; int retval; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/base/regmap/regcache-flat.c b/drivers/base/regmap/regcache-flat.c index c924817e19b1..025e6749bb24 100644 --- a/drivers/base/regmap/regcache-flat.c +++ b/drivers/base/regmap/regcache-flat.c @@ -36,7 +36,7 @@ static int regcache_flat_init(struct regmap *map) return -EINVAL; cache_size = regcache_flat_get_index(map, map->max_register) + 1; - cache = kzalloc(struct_size(cache, data, cache_size), map->alloc_flags); + cache = kzalloc_flex(*cache, data, cache_size, map->alloc_flags); if (!cache) return -ENOMEM; diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c index 4134a77ae1d6..49ba7282e4b8 100644 --- a/drivers/base/regmap/regcache-maple.c +++ b/drivers/base/regmap/regcache-maple.c @@ -294,7 +294,7 @@ static int regcache_maple_init(struct regmap *map) { struct maple_tree *mt; - mt = kmalloc(sizeof(*mt), map->alloc_flags); + mt = kmalloc_obj(*mt, map->alloc_flags); if (!mt) return -ENOMEM; map->cache = mt; diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c index 3344b82c3799..a69e8b4c359b 100644 --- a/drivers/base/regmap/regcache-rbtree.c +++ b/drivers/base/regmap/regcache-rbtree.c @@ -185,7 +185,7 @@ static int regcache_rbtree_init(struct regmap *map) { struct regcache_rbtree_ctx *rbtree_ctx; - map->cache = kmalloc(sizeof *rbtree_ctx, map->alloc_flags); + map->cache = kmalloc_obj(*rbtree_ctx, map->alloc_flags); if (!map->cache) return -ENOMEM; @@ -320,7 +320,7 @@ regcache_rbtree_node_alloc(struct regmap *map, unsigned int reg) const struct regmap_range *range; int i; - rbnode = kzalloc(sizeof(*rbnode), map->alloc_flags); + rbnode = kzalloc_obj(*rbnode, map->alloc_flags); if (!rbnode) return NULL; diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index d596526dccbb..750a4c4b755e 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -66,8 +66,7 @@ static int regcache_hw_init(struct regmap *map) } map->num_reg_defaults = count; - map->reg_defaults = kmalloc_array(count, sizeof(struct reg_default), - GFP_KERNEL); + map->reg_defaults = kmalloc_objs(struct reg_default, count, GFP_KERNEL); if (!map->reg_defaults) return -ENOMEM; diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index c9b4c04b1cf6..611ab7bbdeda 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -130,7 +130,7 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, /* No cache entry? Start a new one */ if (!c) { - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) { regmap_debugfs_free_dump_cache(map); mutex_unlock(&map->cache_lock); @@ -555,7 +555,7 @@ void regmap_debugfs_init(struct regmap *map) /* If we don't have the debugfs root yet, postpone init */ if (!regmap_debugfs_root) { struct regmap_debugfs_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return; node->map = map; diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 6112d942499b..d3e9c6fef37d 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -706,7 +706,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, } } - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/drivers/base/regmap/regmap-kunit.c b/drivers/base/regmap/regmap-kunit.c index 6d8279de3ff2..e22bc2a0ea27 100644 --- a/drivers/base/regmap/regmap-kunit.c +++ b/drivers/base/regmap/regmap-kunit.c @@ -211,7 +211,7 @@ static struct regmap *gen_regmap(struct kunit *test, get_random_bytes(buf, size); - *data = kzalloc(sizeof(**data), GFP_KERNEL); + *data = kzalloc_obj(**data, GFP_KERNEL); if (!(*data)) goto out_free; (*data)->vals = buf; @@ -1759,7 +1759,7 @@ static struct regmap *gen_raw_regmap(struct kunit *test, get_random_bytes(buf, size); - *data = kzalloc(sizeof(**data), GFP_KERNEL); + *data = kzalloc_obj(**data, GFP_KERNEL); if (!(*data)) goto out_free; (*data)->vals = (void *)buf; diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c index 29e5f3175301..983ffe7f035a 100644 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c @@ -430,7 +430,7 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev, if (config->use_relaxed_mmio && config->io_port) return ERR_PTR(-EINVAL); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-ram.c b/drivers/base/regmap/regmap-ram.c index 4e5b4518ce4d..300745d400ee 100644 --- a/drivers/base/regmap/regmap-ram.c +++ b/drivers/base/regmap/regmap-ram.c @@ -66,13 +66,11 @@ struct regmap *__regmap_init_ram(struct device *dev, return ERR_PTR(-EINVAL); } - data->read = kcalloc(config->max_register + 1, sizeof(bool), - GFP_KERNEL); + data->read = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); if (!data->read) return ERR_PTR(-ENOMEM); - data->written = kcalloc(config->max_register + 1, sizeof(bool), - GFP_KERNEL); + data->written = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); if (!data->written) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-raw-ram.c b/drivers/base/regmap/regmap-raw-ram.c index 76c98814fb8a..6a87df7269c6 100644 --- a/drivers/base/regmap/regmap-raw-ram.c +++ b/drivers/base/regmap/regmap-raw-ram.c @@ -123,13 +123,11 @@ struct regmap *__regmap_init_raw_ram(struct device *dev, return ERR_PTR(-EINVAL); } - data->read = kcalloc(config->max_register + 1, sizeof(bool), - GFP_KERNEL); + data->read = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); if (!data->read) return ERR_PTR(-ENOMEM); - data->written = kcalloc(config->max_register + 1, sizeof(bool), - GFP_KERNEL); + data->written = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); if (!data->written) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-spi-avmm.c b/drivers/base/regmap/regmap-spi-avmm.c index d86a06cadcdb..d5cfa8eeffdc 100644 --- a/drivers/base/regmap/regmap-spi-avmm.c +++ b/drivers/base/regmap/regmap-spi-avmm.c @@ -630,7 +630,7 @@ spi_avmm_bridge_ctx_gen(struct spi_device *spi) return ERR_PTR(-EINVAL); } - br = kzalloc(sizeof(*br), GFP_KERNEL); + br = kzalloc_obj(*br, GFP_KERNEL); if (!br) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 14b1d88997cb..56cad7763f56 100644 --- a/drivers/base/regmap/regmap-spi.c +++ b/drivers/base/regmap/regmap-spi.c @@ -81,7 +81,7 @@ static struct regmap_async *regmap_spi_async_alloc(void) { struct regmap_async_spi *async_spi; - async_spi = kzalloc(sizeof(*async_spi), GFP_KERNEL); + async_spi = kzalloc_obj(*async_spi, GFP_KERNEL); if (!async_spi) return NULL; diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 4231e9d4b8ff..443dc31f69d3 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -689,7 +689,7 @@ struct regmap *__regmap_init(struct device *dev, if (!config) goto err; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { ret = -ENOMEM; goto err; @@ -1117,7 +1117,7 @@ skip_format_initialization: } } - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (new == NULL) { ret = -ENOMEM; goto err_range; @@ -1274,7 +1274,7 @@ int regmap_field_bulk_alloc(struct regmap *regmap, struct regmap_field *rf; int i; - rf = kcalloc(num_fields, sizeof(*rf), GFP_KERNEL); + rf = kzalloc_objs(*rf, num_fields, GFP_KERNEL); if (!rf) return -ENOMEM; @@ -1384,7 +1384,7 @@ EXPORT_SYMBOL_GPL(devm_regmap_field_free); struct regmap_field *regmap_field_alloc(struct regmap *regmap, struct reg_field reg_field) { - struct regmap_field *rm_field = kzalloc(sizeof(*rm_field), GFP_KERNEL); + struct regmap_field *rm_field = kzalloc_obj(*rm_field, GFP_KERNEL); if (!rm_field) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 282c38aece0d..89326dbbf172 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -140,13 +140,13 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr return NULL; } - soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL); + soc_dev = kzalloc_obj(*soc_dev, GFP_KERNEL); if (!soc_dev) { ret = -ENOMEM; goto out1; } - soc_attr_groups = kcalloc(3, sizeof(*soc_attr_groups), GFP_KERNEL); + soc_attr_groups = kzalloc_objs(*soc_attr_groups, 3, GFP_KERNEL); if (!soc_attr_groups) { ret = -ENOMEM; goto out2; diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 16a8301c25d6..6fcb0c4f13ff 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -332,7 +332,7 @@ property_entries_dup(const struct property_entry *properties) while (properties[n].name) n++; - p = kcalloc(n + 1, sizeof(*p), GFP_KERNEL); + p = kzalloc_objs(*p, n + 1, GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -758,7 +758,7 @@ static struct software_node *software_node_alloc(const struct property_entry *pr if (IS_ERR(props)) return ERR_CAST(props); - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) { property_entries_free(props); return ERR_PTR(-ENOMEM); @@ -805,7 +805,7 @@ swnode_register(const struct software_node *node, struct swnode *parent, struct swnode *swnode; int ret; - swnode = kzalloc(sizeof(*swnode), GFP_KERNEL); + swnode = kzalloc_obj(*swnode, GFP_KERNEL); if (!swnode) return ERR_PTR(-ENOMEM); diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c index 8540052d37c5..2acf87f8de9a 100644 --- a/drivers/bcma/driver_pci_host.c +++ b/drivers/bcma/driver_pci_host.c @@ -399,7 +399,7 @@ void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) return; } - pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL); + pc_host = kzalloc_obj(*pc_host, GFP_KERNEL); if (!pc_host) { bcma_err(bus, "can not allocate memory"); return; diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index 960632197b05..55a4ad2c704a 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c @@ -165,7 +165,7 @@ static int bcma_host_pci_probe(struct pci_dev *dev, u32 val; /* Alloc */ - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) goto out; diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index 26d12a7e6ca0..5e77d570767c 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c @@ -479,7 +479,7 @@ int bcma_bus_scan(struct bcma_bus *bus) while (eromptr < eromend) { struct bcma_device *other_core; - struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL); + struct bcma_device *core = kzalloc_obj(*core, GFP_KERNEL); if (!core) { err = -ENOMEM; goto out; diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index a9affb7c264d..9897dc9ae678 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -211,7 +211,7 @@ newtframe(struct aoedev *d, struct aoetgt *t) if (list_empty(&t->ffree)) { if (t->falloc >= NSKBPOOLMAX*2) return NULL; - f = kcalloc(1, sizeof(*f), GFP_ATOMIC); + f = kzalloc_objs(*f, 1, GFP_ATOMIC); if (f == NULL) return NULL; t->falloc++; @@ -1431,7 +1431,7 @@ grow_targets(struct aoedev *d) oldn = d->ntargets; newn = oldn * 2; - tt = kcalloc(newn, sizeof(*d->targets), GFP_ATOMIC); + tt = kzalloc_objs(*d->targets, newn, GFP_ATOMIC); if (!tt) return NULL; memmove(tt, d->targets, sizeof(*d->targets) * oldn); @@ -1458,7 +1458,7 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) if (!tt) goto nomem; } - t = kzalloc(sizeof(*t), GFP_ATOMIC); + t = kzalloc_obj(*t, GFP_ATOMIC); if (!t) goto nomem; t->nframes = nframes; @@ -1699,17 +1699,17 @@ aoecmd_init(void) ncpus = num_online_cpus(); - iocq = kcalloc(ncpus, sizeof(struct iocq_ktio), GFP_KERNEL); + iocq = kzalloc_objs(struct iocq_ktio, ncpus, GFP_KERNEL); if (!iocq) return -ENOMEM; - kts = kcalloc(ncpus, sizeof(struct ktstate), GFP_KERNEL); + kts = kzalloc_objs(struct ktstate, ncpus, GFP_KERNEL); if (!kts) { ret = -ENOMEM; goto kts_fail; } - ktiowq = kcalloc(ncpus, sizeof(wait_queue_head_t), GFP_KERNEL); + ktiowq = kzalloc_objs(wait_queue_head_t, ncpus, GFP_KERNEL); if (!ktiowq) { ret = -ENOMEM; goto ktiowq_fail; diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index 3a240755045b..6e8b3807c1c8 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c @@ -471,10 +471,10 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc) } if (d || !do_alloc || minor_get(&sysminor, maj, min) < 0) goto out; - d = kcalloc(1, sizeof *d, GFP_ATOMIC); + d = kzalloc_objs(*d, 1, GFP_ATOMIC); if (!d) goto out; - d->targets = kcalloc(NTARGETS, sizeof(*d->targets), GFP_ATOMIC); + d->targets = kzalloc_objs(*d->targets, NTARGETS, GFP_ATOMIC); if (!d->targets) { kfree(d); d = NULL; diff --git a/drivers/block/brd.c b/drivers/block/brd.c index a5104cf96609..fe9b3b70f22d 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -272,7 +272,7 @@ static struct brd_device *brd_find_or_alloc_device(int i) } } - brd = kzalloc(sizeof(*brd), GFP_KERNEL); + brd = kzalloc_obj(*brd, GFP_KERNEL); if (!brd) { mutex_unlock(&brd_devices_mutex); return ERR_PTR(-ENOMEM); diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index d90fa3e7f4cf..2735ddb58b91 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -434,7 +434,7 @@ int drbd_bm_init(struct drbd_device *device) { struct drbd_bitmap *b = device->bitmap; WARN_ON(b != NULL); - b = kzalloc(sizeof(struct drbd_bitmap), GFP_KERNEL); + b = kzalloc_obj(struct drbd_bitmap, GFP_KERNEL); if (!b) return -ENOMEM; spin_lock_init(&b->bm_lock); @@ -1078,7 +1078,7 @@ static int bm_rw(struct drbd_device *device, const unsigned int flags, unsigned * as we submit copies of pages anyways. */ - ctx = kmalloc(sizeof(struct drbd_bm_aio_ctx), GFP_NOIO); + ctx = kmalloc_obj(struct drbd_bm_aio_ctx, GFP_NOIO); if (!ctx) return -ENOMEM; diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 1f6ac9202b66..64c545f5788c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2510,7 +2510,7 @@ struct drbd_resource *drbd_create_resource(const char *name) { struct drbd_resource *resource; - resource = kzalloc(sizeof(struct drbd_resource), GFP_KERNEL); + resource = kzalloc_obj(struct drbd_resource, GFP_KERNEL); if (!resource) goto fail; resource->name = kstrdup(name, GFP_KERNEL); @@ -2543,7 +2543,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) struct drbd_resource *resource; struct drbd_connection *connection; - connection = kzalloc(sizeof(struct drbd_connection), GFP_KERNEL); + connection = kzalloc_obj(struct drbd_connection, GFP_KERNEL); if (!connection) return NULL; @@ -2552,7 +2552,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) if (drbd_alloc_socket(&connection->meta)) goto fail; - connection->current_epoch = kzalloc(sizeof(struct drbd_epoch), GFP_KERNEL); + connection->current_epoch = kzalloc_obj(struct drbd_epoch, GFP_KERNEL); if (!connection->current_epoch) goto fail; @@ -2666,7 +2666,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig return ERR_MINOR_OR_VOLUME_EXISTS; /* GFP_KERNEL, we are outside of all write-out paths */ - device = kzalloc(sizeof(struct drbd_device), GFP_KERNEL); + device = kzalloc_obj(struct drbd_device, GFP_KERNEL); if (!device) return ERR_NOMEM; kref_init(&device->kref); @@ -2725,7 +2725,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig INIT_LIST_HEAD(&device->peer_devices); INIT_LIST_HEAD(&device->pending_bitmap_io); for_each_connection(connection, resource) { - peer_device = kzalloc(sizeof(struct drbd_peer_device), GFP_KERNEL); + peer_device = kzalloc_obj(struct drbd_peer_device, GFP_KERNEL); if (!peer_device) goto out_idr_remove_from_resource; peer_device->connection = connection; diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index b502038be0a9..fbeb8061e549 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1536,7 +1536,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info) goto out; } - new_disk_conf = kmalloc(sizeof(struct disk_conf), GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -1785,14 +1785,14 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) atomic_set(&device->rs_pending_cnt, 0); /* allocation not in the IO path, drbdsetup context */ - nbc = kzalloc(sizeof(struct drbd_backing_dev), GFP_KERNEL); + nbc = kzalloc_obj(struct drbd_backing_dev, GFP_KERNEL); if (!nbc) { retcode = ERR_NOMEM; goto fail; } spin_lock_init(&nbc->md.uuid_lock); - new_disk_conf = kzalloc(sizeof(struct disk_conf), GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -2390,7 +2390,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) connection = adm_ctx.connection; mutex_lock(&adm_ctx.resource->adm_mutex); - new_net_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); if (!new_net_conf) { retcode = ERR_NOMEM; goto out; @@ -2570,7 +2570,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) } /* allocation not in the IO path, drbdsetup / netlink process context */ - new_net_conf = kzalloc(sizeof(*new_net_conf), GFP_KERNEL); + new_net_conf = kzalloc_obj(*new_net_conf, GFP_KERNEL); if (!new_net_conf) { retcode = ERR_NOMEM; goto fail; @@ -2840,7 +2840,7 @@ int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info) u_size = rcu_dereference(device->ldev->disk_conf)->disk_size; rcu_read_unlock(); if (u_size != (sector_t)rs.resize_size) { - new_disk_conf = kmalloc(sizeof(struct disk_conf), GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail_ldev; diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 3de919b6f0e1..2545f949ce45 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1095,7 +1095,7 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont { struct bio *bio = bio_alloc(device->ldev->backing_bdev, 0, REQ_OP_WRITE | REQ_PREFLUSH, GFP_NOIO); - struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO); + struct one_flush_context *octx = kmalloc_obj(*octx, GFP_NOIO); if (!octx) { drbd_warn(device, "Could not allocate a octx, CANNOT ISSUE FLUSH\n"); @@ -1592,7 +1592,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf /* receiver context, in the writeout path of the other node. * avoid potential distributed deadlock */ - epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO); + epoch = kmalloc_obj(struct drbd_epoch, GFP_NOIO); if (epoch) break; else @@ -1605,7 +1605,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf drbd_flush(connection); if (atomic_read(&connection->current_epoch->epoch_size)) { - epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO); + epoch = kmalloc_obj(struct drbd_epoch, GFP_NOIO); if (epoch) break; } @@ -3547,7 +3547,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in } } - new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL); + new_net_conf = kmalloc_obj(struct net_conf, GFP_KERNEL); if (!new_net_conf) goto disconnect; @@ -3708,7 +3708,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i mutex_lock(&connection->resource->conf_update); old_net_conf = peer_device->connection->net_conf; if (get_ldev(device)) { - new_disk_conf = kzalloc(sizeof(struct disk_conf), GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); if (!new_disk_conf) { put_ldev(device); mutex_unlock(&connection->resource->conf_update); @@ -3794,7 +3794,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i } if (verify_tfm || csums_tfm) { - new_net_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); if (!new_net_conf) goto disconnect; @@ -3932,7 +3932,8 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info if (my_usize != p_usize) { struct disk_conf *old_disk_conf, *new_disk_conf = NULL; - new_disk_conf = kzalloc(sizeof(struct disk_conf), GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf, + GFP_KERNEL); if (!new_disk_conf) { put_ldev(device); return -ENOMEM; @@ -5692,7 +5693,7 @@ static int got_OVResult(struct drbd_connection *connection, struct packet_info * drbd_advance_rs_marks(peer_device, device->ov_left); if (device->ov_left == 0) { - dw = kmalloc(sizeof(*dw), GFP_NOIO); + dw = kmalloc_obj(*dw, GFP_NOIO); if (dw) { dw->w.cb = w_ov_finished; dw->device = device; diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index c2b6c4d9729d..adcba7f1d8ea 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -1468,7 +1468,7 @@ _drbd_set_state(struct drbd_device *device, union drbd_state ns, ns.disk > D_NEGOTIATING) device->last_reattach_jif = jiffies; - ascw = kmalloc(sizeof(*ascw), GFP_ATOMIC); + ascw = kmalloc_obj(*ascw, GFP_ATOMIC); if (ascw) { ascw->os = os; ascw->ns = ns; @@ -2351,7 +2351,7 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u conn_pr_state_change(connection, os, ns_max, flags); remember_new_state(state_change); - acscw = kmalloc(sizeof(*acscw), GFP_ATOMIC); + acscw = kmalloc_obj(*acscw, GFP_ATOMIC); if (acscw) { acscw->oc = os.conn; acscw->ns_min = ns_min; diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index dea3e79d044f..0697f99fed18 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -483,7 +483,7 @@ struct fifo_buffer *fifo_alloc(unsigned int fifo_size) { struct fifo_buffer *fb; - fb = kzalloc(struct_size(fb, values, fifo_size), GFP_NOIO); + fb = kzalloc_flex(*fb, values, fifo_size, GFP_NOIO); if (!fb) return NULL; @@ -871,7 +871,7 @@ int drbd_resync_finished(struct drbd_peer_device *peer_device) * is not finished by now). Retry in 100ms. */ schedule_timeout_interruptible(HZ / 10); - dw = kmalloc(sizeof(struct drbd_device_work), GFP_ATOMIC); + dw = kmalloc_obj(struct drbd_device_work, GFP_ATOMIC); if (dw) { dw->w.cb = w_resync_finished; dw->device = device; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 98789a5297f2..949bb4adc4bf 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -355,8 +355,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, if (rq->bio != rq->biotail) { - bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec), - GFP_NOIO); + bvec = kmalloc_objs(struct bio_vec, nr_bvec, GFP_NOIO); if (!bvec) return -EIO; cmd->bvec = bvec; @@ -823,7 +822,7 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd) if (worker) goto queue_work; - worker = kzalloc(sizeof(struct loop_worker), GFP_NOWAIT); + worker = kzalloc_obj(struct loop_worker, GFP_NOWAIT); /* * In the event we cannot allocate a worker, just queue on the * rootcg worker and issue the I/O as the rootcg @@ -2010,7 +2009,7 @@ static int loop_add(int i) int err; err = -ENOMEM; - lo = kzalloc(sizeof(*lo), GFP_KERNEL); + lo = kzalloc_obj(*lo, GFP_KERNEL); if (!lo) goto out; lo->worker_tree = RB_ROOT; diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index f6c33b21f69e..d4993d7355dc 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -307,7 +307,7 @@ static void nbd_mark_nsock_dead(struct nbd_device *nbd, struct nbd_sock *nsock, { if (!nsock->dead && notify && !nbd_disconnected(nbd->config)) { struct link_dead_args *args; - args = kmalloc(sizeof(struct link_dead_args), GFP_NOIO); + args = kmalloc_obj(struct link_dead_args, GFP_NOIO); if (args) { INIT_WORK(&args->work, nbd_dead_link_work); args->index = nbd->index; @@ -1274,7 +1274,7 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, goto put_socket; } - nsock = kzalloc(sizeof(*nsock), GFP_KERNEL); + nsock = kzalloc_obj(*nsock, GFP_KERNEL); if (!nsock) { err = -ENOMEM; goto put_socket; @@ -1322,7 +1322,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) if (!sock) return err; - args = kzalloc(sizeof(*args), GFP_KERNEL); + args = kzalloc_obj(*args, GFP_KERNEL); if (!args) { sockfd_put(sock); return -ENOMEM; @@ -1510,7 +1510,7 @@ retry: for (i = 0; i < num_connections; i++) { struct recv_thread_args *args; - args = kzalloc(sizeof(*args), GFP_KERNEL); + args = kzalloc_obj(*args, GFP_KERNEL); if (!args) { sock_shutdown(nbd); /* @@ -1677,7 +1677,7 @@ static int nbd_alloc_and_init_config(struct nbd_device *nbd) if (!try_module_get(THIS_MODULE)) return -ENODEV; - config = kzalloc(sizeof(struct nbd_config), GFP_NOFS); + config = kzalloc_obj(struct nbd_config, GFP_NOFS); if (!config) { module_put(THIS_MODULE); return -ENOMEM; @@ -1916,7 +1916,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) struct gendisk *disk; int err = -ENOMEM; - nbd = kzalloc(sizeof(struct nbd_device), GFP_KERNEL); + nbd = kzalloc_obj(struct nbd_device, GFP_KERNEL); if (!nbd) goto out; diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 740a8ac42075..6eab18d814e5 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -778,7 +778,7 @@ static struct nullb_device *null_alloc_dev(void) { struct nullb_device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -867,7 +867,7 @@ static struct nullb_page *null_alloc_page(void) { struct nullb_page *t_page; - t_page = kmalloc(sizeof(struct nullb_page), GFP_NOIO); + t_page = kmalloc_obj(struct nullb_page, GFP_NOIO); if (!t_page) return NULL; @@ -1818,8 +1818,7 @@ static int setup_queues(struct nullb *nullb) if (g_poll_queues) nqueues += g_poll_queues; - nullb->queues = kcalloc(nqueues, sizeof(struct nullb_queue), - GFP_KERNEL); + nullb->queues = kzalloc_objs(struct nullb_queue, nqueues, GFP_KERNEL); if (!nullb->queues) return -ENOMEM; diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c index 0ada35dc0989..384bdce6a9b7 100644 --- a/drivers/block/null_blk/zoned.c +++ b/drivers/block/null_blk/zoned.c @@ -91,8 +91,8 @@ int null_init_zoned_dev(struct nullb_device *dev, dev->nr_zones = round_up(dev_capacity_sects, dev->zone_size_sects) >> ilog2(dev->zone_size_sects); - dev->zones = kvmalloc_array(dev->nr_zones, sizeof(struct nullb_zone), - GFP_KERNEL | __GFP_ZERO); + dev->zones = kvmalloc_objs(struct nullb_zone, dev->nr_zones, + GFP_KERNEL | __GFP_ZERO); if (!dev->zones) return -ENOMEM; diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 8892f218a814..4d4b6bcbfa5f 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -416,7 +416,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) __set_bit(devidx, &ps3disk_mask); mutex_unlock(&ps3disk_mask_mutex); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index bdcf083b45e2..01c743c092be 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -401,9 +401,8 @@ static int ps3vram_cache_init(struct ps3_system_bus_device *dev) priv->cache.page_count = CACHE_PAGE_COUNT; priv->cache.page_size = CACHE_PAGE_SIZE; - priv->cache.tags = kcalloc(CACHE_PAGE_COUNT, - sizeof(struct ps3vram_tag), - GFP_KERNEL); + priv->cache.tags = kzalloc_objs(struct ps3vram_tag, CACHE_PAGE_COUNT, + GFP_KERNEL); if (!priv->cache.tags) return -ENOMEM; @@ -613,7 +612,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev) reports_size, xdr_lpar; char *rest; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8f441eb8b192..c9cf07416fa5 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -707,7 +707,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts) int ret = -ENOMEM; dout("%s:\n", __func__); - rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL); + rbdc = kmalloc_obj(struct rbd_client, GFP_KERNEL); if (!rbdc) goto out_opt; @@ -2572,9 +2572,9 @@ static int rbd_img_fill_request(struct rbd_img_request *img_req, } for_each_obj_request(img_req, obj_req) { - obj_req->bvec_pos.bvecs = kmalloc_array(obj_req->bvec_count, - sizeof(*obj_req->bvec_pos.bvecs), - GFP_NOIO); + obj_req->bvec_pos.bvecs = kmalloc_objs(*obj_req->bvec_pos.bvecs, + obj_req->bvec_count, + GFP_NOIO); if (!obj_req->bvec_pos.bvecs) return -ENOMEM; } @@ -3078,9 +3078,9 @@ static int setup_copyup_bvecs(struct rbd_obj_request *obj_req, u64 obj_overlap) rbd_assert(!obj_req->copyup_bvecs); obj_req->copyup_bvec_count = calc_pages_for(0, obj_overlap); - obj_req->copyup_bvecs = kcalloc(obj_req->copyup_bvec_count, - sizeof(*obj_req->copyup_bvecs), - GFP_NOIO); + obj_req->copyup_bvecs = kzalloc_objs(*obj_req->copyup_bvecs, + obj_req->copyup_bvec_count, + GFP_NOIO); if (!obj_req->copyup_bvecs) return -ENOMEM; @@ -5289,7 +5289,7 @@ static struct rbd_spec *rbd_spec_alloc(void) { struct rbd_spec *spec; - spec = kzalloc(sizeof (*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; @@ -5352,7 +5352,7 @@ static struct rbd_device *__rbd_dev_create(struct rbd_spec *spec) { struct rbd_device *rbd_dev; - rbd_dev = kzalloc(sizeof(*rbd_dev), GFP_KERNEL); + rbd_dev = kzalloc_obj(*rbd_dev, GFP_KERNEL); if (!rbd_dev) return NULL; @@ -6509,7 +6509,7 @@ static int rbd_add_parse_args(const char *buf, /* Initialize all rbd options to the defaults */ - pctx.opts = kzalloc(sizeof(*pctx.opts), GFP_KERNEL); + pctx.opts = kzalloc_obj(*pctx.opts, GFP_KERNEL); if (!pctx.opts) goto out_mem; diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c index 144aea1466a4..6ca1221693ff 100644 --- a/drivers/block/rnbd/rnbd-clt-sysfs.c +++ b/drivers/block/rnbd/rnbd-clt-sysfs.c @@ -591,7 +591,7 @@ static ssize_t rnbd_clt_map_device_store(struct kobject *kobj, opt.dest_port = &port_nr; opt.access_mode = &access_mode; opt.nr_poll_queues = &nr_poll_queues; - addrs = kcalloc(ARRAY_SIZE(paths) * 2, sizeof(*addrs), GFP_KERNEL); + addrs = kzalloc_objs(*addrs, ARRAY_SIZE(paths) * 2, GFP_KERNEL); if (!addrs) return -ENOMEM; diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c index 757df2896aeb..59896090d856 100644 --- a/drivers/block/rnbd/rnbd-clt.c +++ b/drivers/block/rnbd/rnbd-clt.c @@ -324,7 +324,7 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess, struct rnbd_iu *iu; struct rtrs_permit *permit; - iu = kzalloc(sizeof(*iu), GFP_KERNEL); + iu = kzalloc_obj(*iu, GFP_KERNEL); if (!iu) return NULL; @@ -541,7 +541,7 @@ static int send_msg_open(struct rnbd_clt_dev *dev, enum wait_type wait) }; int err, errno; - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); if (!rsp) return -ENOMEM; @@ -587,7 +587,7 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, enum wait_type wait }; int err, errno; - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); if (!rsp) return -ENOMEM; @@ -1417,9 +1417,8 @@ static struct rnbd_clt_dev *init_dev(struct rnbd_clt_session *sess, * nr_cpu_ids: the number of softirq queues * nr_poll_queues: the number of polling queues */ - dev->hw_queues = kcalloc(nr_cpu_ids + nr_poll_queues, - sizeof(*dev->hw_queues), - GFP_KERNEL); + dev->hw_queues = kzalloc_objs(*dev->hw_queues, + nr_cpu_ids + nr_poll_queues, GFP_KERNEL); if (!dev->hw_queues) { ret = -ENOMEM; goto out_alloc; @@ -1565,7 +1564,7 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname, goto put_dev; } - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); if (!rsp) { ret = -ENOMEM; goto del_dev; diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c index 7eeb321d6140..d644e59529ca 100644 --- a/drivers/block/rnbd/rnbd-srv.c +++ b/drivers/block/rnbd/rnbd-srv.c @@ -128,7 +128,7 @@ static int process_rdma(struct rnbd_srv_session *srv_sess, trace_process_rdma(srv_sess, msg, id, datalen, usrlen); - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -287,7 +287,7 @@ static int create_sess(struct rtrs_srv_sess *rtrs) return err; } - srv_sess = kzalloc(sizeof(*srv_sess), GFP_KERNEL); + srv_sess = kzalloc_obj(*srv_sess, GFP_KERNEL); if (!srv_sess) return -ENOMEM; @@ -422,7 +422,7 @@ static struct rnbd_srv_sess_dev struct rnbd_srv_sess_dev *sess_dev; int error; - sess_dev = kzalloc(sizeof(*sess_dev), GFP_KERNEL); + sess_dev = kzalloc_obj(*sess_dev, GFP_KERNEL); if (!sess_dev) return ERR_PTR(-ENOMEM); @@ -441,7 +441,7 @@ static struct rnbd_srv_dev *rnbd_srv_init_srv_dev(struct block_device *bdev) { struct rnbd_srv_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index db1fe9772a4d..7cf8f8899892 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -992,7 +992,7 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto err_out_release_mdesc; } - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) { err = -ENOMEM; goto err_out_release_mdesc; diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 416015947ae6..3b015a9c752f 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -896,7 +896,7 @@ static int swim_probe(struct platform_device *dev) /* set platform driver data */ - swd = kzalloc(sizeof(struct swim_priv), GFP_KERNEL); + swd = kzalloc_obj(struct swim_priv, GFP_KERNEL); if (!swd) { ret = -ENOMEM; goto out_release_io; diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c13cda58a7c6..c47dc9814e36 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -710,7 +710,7 @@ static DEFINE_MUTEX(ublk_ctl_mutex); static struct ublk_batch_fetch_cmd * ublk_batch_alloc_fcmd(struct io_uring_cmd *cmd) { - struct ublk_batch_fetch_cmd *fcmd = kzalloc(sizeof(*fcmd), GFP_NOIO); + struct ublk_batch_fetch_cmd *fcmd = kzalloc_obj(*fcmd, GFP_NOIO); if (fcmd) { fcmd->cmd = cmd; @@ -4610,7 +4610,7 @@ static int ublk_ctrl_add_dev(const struct ublksrv_ctrl_cmd *header) goto out_unlock; ret = -ENOMEM; - ub = kzalloc(struct_size(ub, queues, info.nr_hw_queues), GFP_KERNEL); + ub = kzalloc_flex(*ub, queues, info.nr_hw_queues, GFP_KERNEL); if (!ub) goto out_unlock; mutex_init(&ub->mutex); diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 357434bdae99..1ee1ebe693bf 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -168,7 +168,7 @@ static int virtblk_setup_discard_write_zeroes_erase(struct request *req, bool un if (unmap) flags |= VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP; - range = kmalloc_array(segments, sizeof(*range), GFP_ATOMIC); + range = kmalloc_objs(*range, segments, GFP_ATOMIC); if (!range) return -ENOMEM; @@ -991,12 +991,12 @@ static int init_vq(struct virtio_blk *vblk) vblk->io_queues[HCTX_TYPE_READ], vblk->io_queues[HCTX_TYPE_POLL]); - vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL); + vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs, GFP_KERNEL); if (!vblk->vqs) return -ENOMEM; - vqs_info = kcalloc(num_vqs, sizeof(*vqs_info), GFP_KERNEL); - vqs = kmalloc_array(num_vqs, sizeof(*vqs), GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, num_vqs, GFP_KERNEL); + vqs = kmalloc_objs(*vqs, num_vqs, GFP_KERNEL); if (!vqs_info || !vqs) { err = -ENOMEM; goto out; @@ -1455,7 +1455,7 @@ static int virtblk_probe(struct virtio_device *vdev) goto out; index = err; - vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL); + vdev->priv = vblk = kmalloc_obj(*vblk, GFP_KERNEL); if (!vblk) { err = -ENOMEM; goto out_free_index; diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index a7c2b04ab943..bc665b8abd7b 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -846,8 +846,8 @@ again: * We are using persistent grants, the grant is * not mapped but we might have room for it. */ - persistent_gnt = kmalloc(sizeof(struct persistent_gnt), - GFP_KERNEL); + persistent_gnt = kmalloc_obj(struct persistent_gnt, + GFP_KERNEL); if (!persistent_gnt) { /* * If we don't have enough memory to diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 0621878940ae..448417097837 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -131,8 +131,8 @@ static int xen_blkif_alloc_rings(struct xen_blkif *blkif) { unsigned int r; - blkif->rings = kcalloc(blkif->nr_rings, sizeof(struct xen_blkif_ring), - GFP_KERNEL); + blkif->rings = kzalloc_objs(struct xen_blkif_ring, blkif->nr_rings, + GFP_KERNEL); if (!blkif->rings) return -ENOMEM; @@ -628,8 +628,7 @@ static int xen_blkbk_probe(struct xenbus_device *dev, const struct xenbus_device_id *id) { int err; - struct backend_info *be = kzalloc(sizeof(struct backend_info), - GFP_KERNEL); + struct backend_info *be = kzalloc_obj(struct backend_info, GFP_KERNEL); /* match the pr_debug in xen_blkbk_remove */ pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id); @@ -1010,18 +1009,19 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir) err = -ENOMEM; for (i = 0; i < nr_grefs * XEN_BLKIF_REQS_PER_PAGE; i++) { - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) goto fail; list_add_tail(&req->free_list, &ring->pending_free); for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++) { - req->segments[j] = kzalloc(sizeof(*req->segments[0]), GFP_KERNEL); + req->segments[j] = kzalloc_obj(*req->segments[0], + GFP_KERNEL); if (!req->segments[j]) goto fail; } for (j = 0; j < MAX_INDIRECT_PAGES; j++) { - req->indirect_pages[j] = kzalloc(sizeof(*req->indirect_pages[0]), - GFP_KERNEL); + req->indirect_pages[j] = kzalloc_obj(*req->indirect_pages[0], + GFP_KERNEL); if (!req->indirect_pages[j]) goto fail; } diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 04fc6b552c04..e8aec3857dd5 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -314,7 +314,7 @@ static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) int i = 0; while (i < num) { - gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO); + gnt_list_entry = kzalloc_obj(struct grant, GFP_NOIO); if (!gnt_list_entry) goto out_of_memory; @@ -1980,7 +1980,7 @@ static int blkfront_probe(struct xenbus_device *dev, } kfree(type); } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; @@ -2207,17 +2207,15 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) for (i = 0; i < BLK_RING_SIZE(info); i++) { rinfo->shadow[i].grants_used = - kvcalloc(grants, - sizeof(rinfo->shadow[i].grants_used[0]), - GFP_KERNEL); - rinfo->shadow[i].sg = kvcalloc(psegs, - sizeof(rinfo->shadow[i].sg[0]), - GFP_KERNEL); + kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants, + GFP_KERNEL); + rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0], + psegs, GFP_KERNEL); if (info->max_indirect_segments) rinfo->shadow[i].indirect_grants = - kvcalloc(INDIRECT_GREFS(grants), - sizeof(rinfo->shadow[i].indirect_grants[0]), - GFP_KERNEL); + kvzalloc_objs(rinfo->shadow[i].indirect_grants[0], + INDIRECT_GREFS(grants), + GFP_KERNEL); if ((rinfo->shadow[i].grants_used == NULL) || (rinfo->shadow[i].sg == NULL) || (info->max_indirect_segments && diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index 8c1c7f4211eb..e12abdec2647 100644 --- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c @@ -187,8 +187,8 @@ static int z2_open(struct gendisk *disk, blk_mode_t mode) (unsigned long)z_remap_nocache_nonser(paddr, size); #endif z2ram_map = - kmalloc_array(size / Z2RAM_CHUNKSIZE, - sizeof(z2ram_map[0]), GFP_KERNEL); + kmalloc_objs(z2ram_map[0], size / Z2RAM_CHUNKSIZE, + GFP_KERNEL); if (z2ram_map == NULL) { printk(KERN_ERR DEVICE_NAME ": cannot get mem for z2ram_map\n"); diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c index 8e334f5025fc..9da9855dd6e0 100644 --- a/drivers/block/zloop.c +++ b/drivers/block/zloop.c @@ -492,7 +492,7 @@ static void zloop_rw(struct zloop_cmd *cmd) if (rq->bio != rq->biotail) { struct bio_vec *bvec; - cmd->bvec = kmalloc_array(nr_bvec, sizeof(*cmd->bvec), GFP_NOIO); + cmd->bvec = kmalloc_objs(*cmd->bvec, nr_bvec, GFP_NOIO); if (!cmd->bvec) { ret = -EIO; goto unlock; @@ -997,7 +997,7 @@ static int zloop_ctl_add(struct zloop_options *opts) goto out; } - zlo = kvzalloc(struct_size(zlo, zones, nr_zones), GFP_KERNEL); + zlo = kvzalloc_flex(*zlo, zones, nr_zones, GFP_KERNEL); if (!zlo) { ret = -ENOMEM; goto out; diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index b75016e0e654..7dee3aacb2d8 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -54,7 +54,7 @@ static int deflate_create(struct zcomp_params *params, struct zcomp_ctx *ctx) size_t sz; int ret; - zctx = kzalloc(sizeof(*zctx), GFP_KERNEL); + zctx = kzalloc_obj(*zctx, GFP_KERNEL); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c index daccd60857eb..3416fec9e982 100644 --- a/drivers/block/zram/backend_lz4.c +++ b/drivers/block/zram/backend_lz4.c @@ -41,7 +41,7 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4_ctx *zctx; - zctx = kzalloc(sizeof(*zctx), GFP_KERNEL); + zctx = kzalloc_obj(*zctx, GFP_KERNEL); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc(sizeof(*zctx->dstrm), GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc(sizeof(*zctx->cstrm), GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c index 9e8a35dfa56d..fd94df9193d3 100644 --- a/drivers/block/zram/backend_lz4hc.c +++ b/drivers/block/zram/backend_lz4hc.c @@ -41,7 +41,7 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4hc_ctx *zctx; - zctx = kzalloc(sizeof(*zctx), GFP_KERNEL); + zctx = kzalloc_obj(*zctx, GFP_KERNEL); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc(sizeof(*zctx->dstrm), GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc(sizeof(*zctx->cstrm), GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index 81defb98ed09..d9303269b90d 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -53,7 +53,7 @@ static int zstd_setup_params(struct zcomp_params *params) zstd_compression_parameters prm; struct zstd_params *zp; - zp = kzalloc(sizeof(*zp), GFP_KERNEL); + zp = kzalloc_obj(*zp, GFP_KERNEL); if (!zp) return -ENOMEM; @@ -122,7 +122,7 @@ static int zstd_create(struct zcomp_params *params, struct zcomp_ctx *ctx) zstd_parameters prm; size_t sz; - zctx = kzalloc(sizeof(*zctx), GFP_KERNEL); + zctx = kzalloc_obj(*zctx, GFP_KERNEL); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index b1bd1daa0060..b53fb5fbc041 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c @@ -238,7 +238,7 @@ struct zcomp *zcomp_create(const char *alg, struct zcomp_params *params) */ BUILD_BUG_ON(ARRAY_SIZE(backends) <= 1); - comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); + comp = kzalloc_obj(struct zcomp, GFP_KERNEL); if (!comp) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 61d3e2c74901..3cc82b88b07e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -250,7 +250,7 @@ static struct zram_pp_ctl *init_pp_ctl(void) struct zram_pp_ctl *ctl; u32 idx; - ctl = kmalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kmalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return NULL; @@ -297,7 +297,7 @@ static bool place_pp_slot(struct zram *zram, struct zram_pp_ctl *ctl, struct zram_pp_slot *pps; u32 bid; - pps = kmalloc(sizeof(*pps), GFP_NOIO | __GFP_NOWARN); + pps = kmalloc_obj(*pps, GFP_NOIO | __GFP_NOWARN); if (!pps) return false; @@ -855,7 +855,7 @@ static struct zram_wb_ctl *init_wb_ctl(struct zram *zram) struct zram_wb_ctl *wb_ctl; int i; - wb_ctl = kmalloc(sizeof(*wb_ctl), GFP_KERNEL); + wb_ctl = kmalloc_obj(*wb_ctl, GFP_KERNEL); if (!wb_ctl) return NULL; @@ -875,7 +875,7 @@ static struct zram_wb_ctl *init_wb_ctl(struct zram *zram) * writeback can still proceed, even if there is only one * request on the idle list. */ - req = kzalloc(sizeof(*req), GFP_KERNEL | __GFP_NOWARN); + req = kzalloc_obj(*req, GFP_KERNEL | __GFP_NOWARN); if (!req) break; @@ -1452,7 +1452,7 @@ static void read_from_bdev_async(struct zram *zram, struct page *page, struct zram_rb_req *req; struct bio *bio; - req = kmalloc(sizeof(*req), GFP_NOIO); + req = kmalloc_obj(*req, GFP_NOIO); if (!req) return; @@ -3079,7 +3079,7 @@ static int zram_add(void) struct zram *zram; int ret, device_id; - zram = kzalloc(sizeof(struct zram), GFP_KERNEL); + zram = kzalloc_obj(struct zram, GFP_KERNEL); if (!zram) return -ENOMEM; diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index e305d04aac9d..af7cd7b217ca 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -284,7 +284,7 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) switch (hci_skb_pkt_type(skb)) { case HCI_COMMAND_PKT: - dr = kmalloc(sizeof(*dr), GFP_KERNEL); + dr = kmalloc_obj(*dr, GFP_KERNEL); if (!dr) { usb_free_urb(urb); return -ENOMEM; diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 9d29ab811f80..b810c748f4d5 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -871,7 +871,7 @@ struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, opcode_write); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index eaf5de46a702..54a3705e9063 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -1665,7 +1665,7 @@ static int btintel_pcie_setup_txq_bufs(struct btintel_pcie_data *data, struct data_buf *buf; /* Allocate the same number of buffers as the descriptor */ - txq->bufs = kmalloc_array(txq->count, sizeof(*buf), GFP_KERNEL); + txq->bufs = kmalloc_objs(*buf, txq->count, GFP_KERNEL); if (!txq->bufs) return -ENOMEM; @@ -1709,7 +1709,7 @@ static int btintel_pcie_setup_rxq_bufs(struct btintel_pcie_data *data, struct data_buf *buf; /* Allocate the same number of buffers as the descriptor */ - rxq->bufs = kmalloc_array(rxq->count, sizeof(*buf), GFP_KERNEL); + rxq->bufs = kmalloc_objs(*buf, rxq->count, GFP_KERNEL); if (!rxq->bufs) return -ENOMEM; @@ -2191,7 +2191,7 @@ btintel_pcie_get_recovery(struct pci_dev *pdev, struct device *dev) return data; } - data = kzalloc(struct_size(data, name, name_len), GFP_ATOMIC); + data = kzalloc_flex(*data, name, name_len, GFP_ATOMIC); if (!data) return NULL; @@ -2306,7 +2306,7 @@ static void btintel_pcie_reset(struct hci_dev *hdev) if (test_and_set_bit(BTINTEL_PCIE_RECOVERY_IN_PROGRESS, &data->flags)) return; - removal = kzalloc(sizeof(*removal), GFP_ATOMIC); + removal = kzalloc_obj(*removal, GFP_ATOMIC); if (!removal) return; diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c index 32329a2e526f..3ffb54501b11 100644 --- a/drivers/bluetooth/btmrvl_debugfs.c +++ b/drivers/bluetooth/btmrvl_debugfs.c @@ -144,7 +144,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) if (!hdev->debugfs) return; - dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); + dbg = kzalloc_obj(*dbg, GFP_KERNEL); priv->debugfs_data = dbg; if (!dbg) { diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index e26b07a9387d..78be98c029bf 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c @@ -710,13 +710,13 @@ struct btmrvl_private *btmrvl_add_card(void *card) { struct btmrvl_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { BT_ERR("Can not allocate priv"); goto err_priv; } - priv->adapter = kzalloc(sizeof(*priv->adapter), GFP_KERNEL); + priv->adapter = kzalloc_obj(*priv->adapter, GFP_KERNEL); if (!priv->adapter) { BT_ERR("Allocate buffer for btmrvl_adapter failed!"); goto err_adapter; diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index a8c520dc09e1..9e75e06607b4 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -537,7 +537,7 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev) if (!urb) return -ENOMEM; - dr = kmalloc(sizeof(*dr), GFP_KERNEL); + dr = kmalloc_obj(*dr, GFP_KERNEL); if (!dr) { usb_free_urb(urb); return -ENOMEM; diff --git a/drivers/bluetooth/btrsi.c b/drivers/bluetooth/btrsi.c index 6c1f584c8a33..9710655472fe 100644 --- a/drivers/bluetooth/btrsi.c +++ b/drivers/bluetooth/btrsi.c @@ -112,7 +112,7 @@ static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops) struct hci_dev *hdev; int err = 0; - h_adapter = kzalloc(sizeof(*h_adapter), GFP_KERNEL); + h_adapter = kzalloc_obj(*h_adapter, GFP_KERNEL); if (!h_adapter) return -ENOMEM; diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 5603b282f9bc..d8a29e8ff524 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -524,7 +524,7 @@ static int btrtl_parse_section(struct hci_dev *hdev, break; } - subsec = kzalloc(sizeof(*subsec), GFP_KERNEL); + subsec = kzalloc_obj(*subsec, GFP_KERNEL); if (!subsec) return -ENOMEM; subsec->opcode = opcode; @@ -828,7 +828,7 @@ static int rtl_download_firmware(struct hci_dev *hdev, struct sk_buff *skb; struct hci_rp_read_local_version *rp; - dl_cmd = kmalloc(sizeof(*dl_cmd), GFP_KERNEL); + dl_cmd = kmalloc_obj(*dl_cmd, GFP_KERNEL); if (!dl_cmd) return -ENOMEM; @@ -1077,7 +1077,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, u8 key_id; u8 reg_val[2]; - btrtl_dev = kzalloc(sizeof(*btrtl_dev), GFP_KERNEL); + btrtl_dev = kzalloc_obj(*btrtl_dev, GFP_KERNEL); if (!btrtl_dev) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index fcec8e589e81..21fd5e7914f6 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2071,7 +2071,7 @@ static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb) if (!urb) return ERR_PTR(-ENOMEM); - dr = kmalloc(sizeof(*dr), GFP_KERNEL); + dr = kmalloc_obj(*dr, GFP_KERNEL); if (!dr) { usb_free_urb(urb); return ERR_PTR(-ENOMEM); @@ -4059,7 +4059,7 @@ static int btusb_probe(struct usb_interface *intf, return -ENODEV; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ag6xx.c b/drivers/bluetooth/hci_ag6xx.c index 94588676510f..1ee31387c0be 100644 --- a/drivers/bluetooth/hci_ag6xx.c +++ b/drivers/bluetooth/hci_ag6xx.c @@ -36,7 +36,7 @@ static int ag6xx_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - ag6xx = kzalloc(sizeof(*ag6xx), GFP_KERNEL); + ag6xx = kzalloc_obj(*ag6xx, GFP_KERNEL); if (!ag6xx) return -ENOMEM; diff --git a/drivers/bluetooth/hci_aml.c b/drivers/bluetooth/hci_aml.c index 4981c82d634d..0d874aaca316 100644 --- a/drivers/bluetooth/hci_aml.c +++ b/drivers/bluetooth/hci_aml.c @@ -541,7 +541,7 @@ static int aml_open(struct hci_uart *hu) return -EOPNOTSUPP; } - aml_data = kzalloc(sizeof(*aml_data), GFP_KERNEL); + aml_data = kzalloc_obj(*aml_data, GFP_KERNEL); if (!aml_data) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c index 8d2b5e7f0d6a..f8d794ea81ef 100644 --- a/drivers/bluetooth/hci_ath.c +++ b/drivers/bluetooth/hci_ath.c @@ -101,7 +101,7 @@ static int ath_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - ath = kzalloc(sizeof(*ath), GFP_KERNEL); + ath = kzalloc_obj(*ath, GFP_KERNEL); if (!ath) return -ENOMEM; diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 9286a5f40f55..97068809a713 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -448,7 +448,7 @@ static int bcm_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - bcm = kzalloc(sizeof(*bcm), GFP_KERNEL); + bcm = kzalloc_obj(*bcm, GFP_KERNEL); if (!bcm) return -ENOMEM; diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 591abe6d63dd..09416cc468d4 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -716,7 +716,7 @@ static int bcsp_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - bcsp = kzalloc(sizeof(*bcsp), GFP_KERNEL); + bcsp = kzalloc_obj(*bcsp, GFP_KERNEL); if (!bcsp) return -ENOMEM; diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index ec017df8572c..2ee2eef954e0 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c @@ -44,7 +44,7 @@ static int h4_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - h4 = kzalloc(sizeof(*h4), GFP_KERNEL); + h4 = kzalloc_obj(*h4, GFP_KERNEL); if (!h4) return -ENOMEM; diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index 96e20a66ecd1..c31403acb9df 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -222,7 +222,7 @@ static int h5_open(struct hci_uart *hu) if (hu->serdev) { h5 = serdev_device_get_drvdata(hu->serdev); } else { - h5 = kzalloc(sizeof(*h5), GFP_KERNEL); + h5 = kzalloc_obj(*h5, GFP_KERNEL); if (!h5) return -ENOMEM; } @@ -1069,7 +1069,7 @@ static int h5_btrtl_resume(struct h5 *h5) if (test_bit(H5_WAKEUP_DISABLE, &h5->flags)) { struct h5_btrtl_reprobe *reprobe; - reprobe = kzalloc(sizeof(*reprobe), GFP_KERNEL); + reprobe = kzalloc_obj(*reprobe, GFP_KERNEL); if (!reprobe) return -ENOMEM; diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index f7570c2eaa46..989e87f24273 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -384,7 +384,7 @@ static int intel_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - intel = kzalloc(sizeof(*intel), GFP_KERNEL); + intel = kzalloc_obj(*intel, GFP_KERNEL); if (!intel) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 2b28515de92c..7638bf6d6b09 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -491,7 +491,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) if (tty->ops->write == NULL) return -EOPNOTSUPP; - hu = kzalloc(sizeof(*hu), GFP_KERNEL); + hu = kzalloc_obj(*hu, GFP_KERNEL); if (!hu) { BT_ERR("Can't allocate control structure"); return -ENFILE; diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index 6f4e25917b86..9c3b24d90462 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -114,7 +114,7 @@ static int ll_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - ll = kzalloc(sizeof(*ll), GFP_KERNEL); + ll = kzalloc_obj(*ll, GFP_KERNEL); if (!ll) return -ENOMEM; diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c index 8767522ec4c6..8e8a283e4cb9 100644 --- a/drivers/bluetooth/hci_mrvl.c +++ b/drivers/bluetooth/hci_mrvl.c @@ -64,7 +64,7 @@ static int mrvl_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - mrvl = kzalloc(sizeof(*mrvl), GFP_KERNEL); + mrvl = kzalloc_obj(*mrvl, GFP_KERNEL); if (!mrvl) return -ENOMEM; diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index c511546f793e..cac861991b52 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -585,7 +585,7 @@ static int qca_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - qca = kzalloc(sizeof(*qca), GFP_KERNEL); + qca = kzalloc_obj(*qca, GFP_KERNEL); if (!qca) return -ENOMEM; @@ -1057,7 +1057,7 @@ static void qca_controller_memdump(struct work_struct *work) } if (!qca_memdump) { - qca_memdump = kzalloc(sizeof(*qca_memdump), GFP_ATOMIC); + qca_memdump = kzalloc_obj(*qca_memdump, GFP_ATOMIC); if (!qca_memdump) { mutex_unlock(&qca->hci_memdump_lock); return; diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 2fef08254d78..6e653bb8efcc 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -640,7 +640,7 @@ static int vhci_open(struct inode *inode, struct file *file) { struct vhci_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c index 6f1a37e85c6a..bc33d2755ced 100644 --- a/drivers/bluetooth/virtio_bt.c +++ b/drivers/bluetooth/virtio_bt.c @@ -275,7 +275,7 @@ static int virtbt_probe(struct virtio_device *vdev) return -EINVAL; } - vbt = kzalloc(sizeof(*vbt), GFP_KERNEL); + vbt = kzalloc_obj(*vbt, GFP_KERNEL); if (!vbt) return -ENOMEM; diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index b8184a903583..bc7698cbf5e1 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -451,7 +451,7 @@ static int cci_probe_ports(struct device_node *np) nb_cci_ports = cci_config->nb_ace + cci_config->nb_ace_lite; - ports = kcalloc(nb_cci_ports, sizeof(*ports), GFP_KERNEL); + ports = kzalloc_objs(*ports, nb_cci_ports, GFP_KERNEL); if (!ports) return -ENOMEM; diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 290ce13bcb09..3e12cde4443b 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -672,8 +672,7 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, return -EINVAL; } - regions = kmalloc_array(obj_desc->region_count, - sizeof(regions[0]), GFP_KERNEL); + regions = kmalloc_objs(regions[0], obj_desc->region_count, GFP_KERNEL); if (!regions) return -ENOMEM; @@ -788,7 +787,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, /* * Allocate an MC bus device object: */ - mc_bus = kzalloc(sizeof(*mc_bus), GFP_KERNEL); + mc_bus = kzalloc_obj(*mc_bus, GFP_KERNEL); if (!mc_bus) return -ENOMEM; @@ -798,7 +797,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, /* * Allocate a regular fsl_mc_device object: */ - mc_dev = kzalloc(sizeof(*mc_dev), GFP_KERNEL); + mc_dev = kzalloc_obj(*mc_dev, GFP_KERNEL); if (!mc_dev) return -ENOMEM; } diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c index 823969e4159c..db20ea5ade01 100644 --- a/drivers/bus/fsl-mc/fsl-mc-uapi.c +++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c @@ -483,7 +483,7 @@ static int fsl_mc_uapi_dev_open(struct inode *inode, struct file *filep) struct fsl_mc_bus *mc_bus; int error; - priv_data = kzalloc(sizeof(*priv_data), GFP_KERNEL); + priv_data = kzalloc_obj(*priv_data, GFP_KERNEL); if (!priv_data) return -ENOMEM; diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 35922e7a24c1..48f76438a138 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -963,7 +963,7 @@ static void mhi_ep_process_ctrl_interrupt(struct mhi_ep_cntrl *mhi_cntrl, { struct mhi_ep_state_transition *item; - item = kzalloc(sizeof(*item), GFP_ATOMIC); + item = kzalloc_obj(*item, GFP_ATOMIC); if (!item) return; @@ -1136,9 +1136,8 @@ int mhi_ep_power_up(struct mhi_ep_cntrl *mhi_cntrl) mhi_ep_mmio_mask_interrupts(mhi_cntrl); mhi_ep_mmio_init(mhi_cntrl); - mhi_cntrl->mhi_event = kcalloc(mhi_cntrl->event_rings, - sizeof(*mhi_cntrl->mhi_event), - GFP_KERNEL); + mhi_cntrl->mhi_event = kzalloc_objs(*mhi_cntrl->mhi_event, + mhi_cntrl->event_rings, GFP_KERNEL); if (!mhi_cntrl->mhi_event) return -ENOMEM; @@ -1276,7 +1275,7 @@ static struct mhi_ep_device *mhi_ep_alloc_device(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_device *mhi_dev; struct device *dev; - mhi_dev = kzalloc(sizeof(*mhi_dev), GFP_KERNEL); + mhi_dev = kzalloc_obj(*mhi_dev, GFP_KERNEL); if (!mhi_dev) return ERR_PTR(-ENOMEM); @@ -1400,8 +1399,8 @@ static int mhi_ep_chan_init(struct mhi_ep_cntrl *mhi_cntrl, * Allocate max_channels supported by the MHI endpoint and populate * only the defined channels */ - mhi_cntrl->mhi_chan = kcalloc(mhi_cntrl->max_chan, sizeof(*mhi_cntrl->mhi_chan), - GFP_KERNEL); + mhi_cntrl->mhi_chan = kzalloc_objs(*mhi_cntrl->mhi_chan, + mhi_cntrl->max_chan, GFP_KERNEL); if (!mhi_cntrl->mhi_chan) return -ENOMEM; @@ -1460,7 +1459,8 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl, if (ret) return ret; - mhi_cntrl->mhi_cmd = kcalloc(NR_OF_CMD_RINGS, sizeof(*mhi_cntrl->mhi_cmd), GFP_KERNEL); + mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS, + GFP_KERNEL); if (!mhi_cntrl->mhi_cmd) { ret = -ENOMEM; goto err_free_ch; diff --git a/drivers/bus/mhi/ep/ring.c b/drivers/bus/mhi/ep/ring.c index 26357ee68dee..ee5b7f4755c5 100644 --- a/drivers/bus/mhi/ep/ring.c +++ b/drivers/bus/mhi/ep/ring.c @@ -205,7 +205,8 @@ int mhi_ep_ring_start(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_ring *ring, ring->wr_offset = mhi_ep_ring_addr2offset(ring, le64_to_cpu(val)); /* Allocate ring cache memory for holding the copy of host ring */ - ring->ring_cache = kcalloc(ring->ring_size, sizeof(struct mhi_ring_element), GFP_KERNEL); + ring->ring_cache = kzalloc_objs(struct mhi_ring_element, + ring->ring_size, GFP_KERNEL); if (!ring->ring_cache) return -ENOMEM; diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c index c76db35bc29a..b295992476e4 100644 --- a/drivers/bus/mhi/host/boot.c +++ b/drivers/bus/mhi/host/boot.c @@ -333,12 +333,12 @@ static int mhi_alloc_bhi_buffer(struct mhi_controller *mhi_cntrl, struct image_info *img_info; struct mhi_buf *mhi_buf; - img_info = kzalloc(sizeof(*img_info), GFP_KERNEL); + img_info = kzalloc_obj(*img_info, GFP_KERNEL); if (!img_info) return -ENOMEM; /* Allocate memory for entry */ - img_info->mhi_buf = kzalloc(sizeof(*img_info->mhi_buf), GFP_KERNEL); + img_info->mhi_buf = kzalloc_obj(*img_info->mhi_buf, GFP_KERNEL); if (!img_info->mhi_buf) goto error_alloc_mhi_buf; @@ -375,13 +375,13 @@ int mhi_alloc_bhie_table(struct mhi_controller *mhi_cntrl, struct image_info *img_info; struct mhi_buf *mhi_buf; - img_info = kzalloc(sizeof(*img_info), GFP_KERNEL); + img_info = kzalloc_obj(*img_info, GFP_KERNEL); if (!img_info) return -ENOMEM; /* Allocate memory for entries */ - img_info->mhi_buf = kcalloc(segments, sizeof(*img_info->mhi_buf), - GFP_KERNEL); + img_info->mhi_buf = kzalloc_objs(*img_info->mhi_buf, segments, + GFP_KERNEL); if (!img_info->mhi_buf) goto error_alloc_mhi_buf; diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c index c47f66833cda..fa62f8219510 100644 --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -313,7 +313,7 @@ static int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) atomic_set(&mhi_cntrl->dev_wake, 0); atomic_set(&mhi_cntrl->pending_pkts, 0); - mhi_ctxt = kzalloc(sizeof(*mhi_ctxt), GFP_KERNEL); + mhi_ctxt = kzalloc_obj(*mhi_ctxt, GFP_KERNEL); if (!mhi_ctxt) return -ENOMEM; @@ -699,8 +699,8 @@ static int parse_ev_cfg(struct mhi_controller *mhi_cntrl, num = config->num_events; mhi_cntrl->total_ev_rings = num; - mhi_cntrl->mhi_event = kcalloc(num, sizeof(*mhi_cntrl->mhi_event), - GFP_KERNEL); + mhi_cntrl->mhi_event = kzalloc_objs(*mhi_cntrl->mhi_event, num, + GFP_KERNEL); if (!mhi_cntrl->mhi_event) return -ENOMEM; @@ -938,8 +938,8 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl, if (ret) return -EINVAL; - mhi_cntrl->mhi_cmd = kcalloc(NR_OF_CMD_RINGS, - sizeof(*mhi_cntrl->mhi_cmd), GFP_KERNEL); + mhi_cntrl->mhi_cmd = kzalloc_objs(*mhi_cntrl->mhi_cmd, NR_OF_CMD_RINGS, + GFP_KERNEL); if (!mhi_cntrl->mhi_cmd) { ret = -ENOMEM; goto err_free_event; @@ -1095,7 +1095,7 @@ struct mhi_controller *mhi_alloc_controller(void) { struct mhi_controller *mhi_cntrl; - mhi_cntrl = kzalloc(sizeof(*mhi_cntrl), GFP_KERNEL); + mhi_cntrl = kzalloc_obj(*mhi_cntrl, GFP_KERNEL); return mhi_cntrl; } @@ -1232,7 +1232,7 @@ struct mhi_device *mhi_alloc_device(struct mhi_controller *mhi_cntrl) struct mhi_device *mhi_dev; struct device *dev; - mhi_dev = kzalloc(sizeof(*mhi_dev), GFP_KERNEL); + mhi_dev = kzalloc_obj(*mhi_dev, GFP_KERNEL); if (!mhi_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index b4ef115189b5..f799503c8f36 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -764,7 +764,7 @@ exit_sys_error_transition: int mhi_queue_state_transition(struct mhi_controller *mhi_cntrl, enum dev_st_transition state) { - struct state_transition *item = kmalloc(sizeof(*item), GFP_ATOMIC); + struct state_transition *item = kmalloc_obj(*item, GFP_ATOMIC); unsigned long flags; if (!item) diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c index 12dd32fd0b62..7d43ecc9d2fa 100644 --- a/drivers/bus/mips_cdmm.c +++ b/drivers/bus/mips_cdmm.c @@ -306,7 +306,7 @@ static struct mips_cdmm_bus *mips_cdmm_get_bus(void) bus = *bus_p; /* Attempt allocation if NULL */ if (unlikely(!bus)) { - bus = kzalloc(sizeof(*bus), GFP_ATOMIC); + bus = kzalloc_obj(*bus, GFP_ATOMIC); if (unlikely(!bus)) bus = ERR_PTR(-ENOMEM); else @@ -541,7 +541,7 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus) (drb + size + 1) * CDMM_DRB_SIZE - 1, type, rev); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) break; diff --git a/drivers/bus/moxtet.c b/drivers/bus/moxtet.c index 5a53bfab470a..e7caa6b63318 100644 --- a/drivers/bus/moxtet.c +++ b/drivers/bus/moxtet.c @@ -145,7 +145,7 @@ moxtet_alloc_device(struct moxtet *moxtet) if (!get_device(moxtet->dev)) return NULL; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { put_device(moxtet->dev); return NULL; diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c index 7f0a8f8b3f4c..63b64da191b1 100644 --- a/drivers/bus/omap_l3_smx.c +++ b/drivers/bus/omap_l3_smx.c @@ -215,7 +215,7 @@ static int omap3_l3_probe(struct platform_device *pdev) struct resource *res; int ret; - l3 = kzalloc(sizeof(*l3), GFP_KERNEL); + l3 = kzalloc_obj(*l3, GFP_KERNEL); if (!l3) return -ENOMEM; diff --git a/drivers/bus/stm32_firewall.c b/drivers/bus/stm32_firewall.c index 2fc9761dadec..aa282083c8cd 100644 --- a/drivers/bus/stm32_firewall.c +++ b/drivers/bus/stm32_firewall.c @@ -260,7 +260,7 @@ int stm32_firewall_populate_bus(struct stm32_firewall_controller *firewall_contr return -EINVAL; } - firewalls = kcalloc(len, sizeof(*firewalls), GFP_KERNEL); + firewalls = kzalloc_objs(*firewalls, len, GFP_KERNEL); if (!firewalls) { of_node_put(child); return -ENOMEM; diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index 82735c58be11..df9c0a0adfbb 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -205,7 +205,7 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, int err; struct sunxi_rsb_device *rdev; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return ERR_PTR(-ENOMEM); @@ -477,7 +477,7 @@ static struct sunxi_rsb_ctx *regmap_sunxi_rsb_init_ctx(struct sunxi_rsb_device * return ERR_PTR(-EINVAL); } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 610354ce7f8f..931948d05a03 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -354,7 +354,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata, * limit for clk_get(). If cl ever needs to be freed, it should be done * with clkdev_drop(). */ - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return -ENOMEM; @@ -2470,7 +2470,7 @@ static void sysc_add_restored(struct sysc *ddata) { struct sysc_module *restored_module; - restored_module = kzalloc(sizeof(*restored_module), GFP_KERNEL); + restored_module = kzalloc_obj(*restored_module, GFP_KERNEL); if (!restored_module) return; @@ -2953,7 +2953,7 @@ static int sysc_add_disabled(unsigned long base) { struct sysc_address *disabled_module; - disabled_module = kzalloc(sizeof(*disabled_module), GFP_KERNEL); + disabled_module = kzalloc_obj(*disabled_module, GFP_KERNEL); if (!disabled_module) return -ENOMEM; @@ -2984,7 +2984,7 @@ static int sysc_init_static_data(struct sysc *ddata) if (sysc_soc) return 0; - sysc_soc = kzalloc(sizeof(*sysc_soc), GFP_KERNEL); + sysc_soc = kzalloc_obj(*sysc_soc, GFP_KERNEL); if (!sysc_soc) return -ENOMEM; diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c index 64ee920721ee..074918ed86fd 100644 --- a/drivers/bus/vexpress-config.c +++ b/drivers/bus/vexpress-config.c @@ -284,7 +284,7 @@ static struct regmap *vexpress_syscfg_regmap_init(struct device *dev, val = energy_quirk; } - func = kzalloc(struct_size(func, template, num), GFP_KERNEL); + func = kzalloc_flex(*func, template, num, GFP_KERNEL); if (!func) return ERR_PTR(-ENOMEM); diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 31ba1f8c1f78..fe0f633bc655 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -1318,7 +1318,7 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot) if (cdi->sanyo_slot) return CDS_NO_INFO; - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1347,7 +1347,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi) /* cdrom_read_mech_status requires a valid value for capacity: */ cdi->capacity = 0; - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1406,7 +1406,7 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot) return cdrom_load_unload(cdi, -1); } - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -2311,7 +2311,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi, /* Prevent arg from speculatively bypassing the length check */ arg = array_index_nospec(arg, cdi->capacity); - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 85aceab5eac6..1a59241cbd23 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c @@ -227,7 +227,7 @@ static char gdrom_execute_diagnostic(void) static int gdrom_preparedisk_cmd(void) { struct packet_command *spin_command; - spin_command = kzalloc(sizeof(struct packet_command), GFP_KERNEL); + spin_command = kzalloc_obj(struct packet_command, GFP_KERNEL); if (!spin_command) return -ENOMEM; spin_command->cmd[0] = 0x70; @@ -261,7 +261,7 @@ static int gdrom_readtoc_cmd(struct gdromtoc *toc, int session) struct packet_command *toc_command; int err = 0; - toc_command = kzalloc(sizeof(struct packet_command), GFP_KERNEL); + toc_command = kzalloc_obj(struct packet_command, GFP_KERNEL); if (!toc_command) return -ENOMEM; tocsize = sizeof(struct gdromtoc); @@ -415,7 +415,7 @@ static int gdrom_getsense(short *bufstring) int sense_key; int err = -EIO; - sense_command = kzalloc(sizeof(struct packet_command), GFP_KERNEL); + sense_command = kzalloc_obj(struct packet_command, GFP_KERNEL); if (!sense_command) return -ENOMEM; sense_command->cmd[0] = 0x13; @@ -574,7 +574,7 @@ static blk_status_t gdrom_readdisk_dma(struct request *req) struct packet_command *read_command; unsigned long timeout; - read_command = kzalloc(sizeof(struct packet_command), GFP_KERNEL); + read_command = kzalloc_obj(struct packet_command, GFP_KERNEL); if (!read_command) return BLK_STS_RESOURCE; @@ -656,7 +656,7 @@ static int gdrom_outputversion(void) int err = -ENOMEM; /* query device ID */ - id = kzalloc(sizeof(struct gdrom_id), GFP_KERNEL); + id = kzalloc_obj(struct gdrom_id, GFP_KERNEL); if (!id) return err; gdrom_identifydevice(id); @@ -769,7 +769,7 @@ static int probe_gdrom(struct platform_device *devptr) pr_info("Registered with major number %d\n", gdrom_major); /* Specify basic properties of drive */ - gd.cd_info = kzalloc(sizeof(struct cdrom_device_info), GFP_KERNEL); + gd.cd_info = kzalloc_obj(struct cdrom_device_info, GFP_KERNEL); if (!gd.cd_info) { err = -ENOMEM; goto probe_fail_no_mem; @@ -803,7 +803,7 @@ static int probe_gdrom(struct platform_device *devptr) if (err) goto probe_fail_free_irqs; - gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL); + gd.toc = kzalloc_obj(struct gdromtoc, GFP_KERNEL); if (!gd.toc) { err = -ENOMEM; goto probe_fail_free_irqs; diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c index 588dd12e8105..236403a269b6 100644 --- a/drivers/cdx/cdx.c +++ b/drivers/cdx/cdx.c @@ -789,7 +789,7 @@ int cdx_device_add(struct cdx_dev_params *dev_params) struct cdx_device *cdx_dev; int ret, i; - cdx_dev = kzalloc(sizeof(*cdx_dev), GFP_KERNEL); + cdx_dev = kzalloc_obj(*cdx_dev, GFP_KERNEL); if (!cdx_dev) return -ENOMEM; @@ -876,7 +876,7 @@ struct device *cdx_bus_add(struct cdx_controller *cdx, u8 bus_num) struct cdx_device *cdx_dev; int ret; - cdx_dev = kzalloc(sizeof(*cdx_dev), GFP_KERNEL); + cdx_dev = kzalloc_obj(*cdx_dev, GFP_KERNEL); if (!cdx_dev) return NULL; diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c index 280f207735da..abd8f9cdb0b5 100644 --- a/drivers/cdx/controller/cdx_controller.c +++ b/drivers/cdx/controller/cdx_controller.c @@ -168,7 +168,7 @@ static int xlnx_cdx_probe(struct platform_device *pdev) struct cdx_mcdi *cdx_mcdi; int ret; - cdx_mcdi = kzalloc(sizeof(*cdx_mcdi), GFP_KERNEL); + cdx_mcdi = kzalloc_obj(*cdx_mcdi, GFP_KERNEL); if (!cdx_mcdi) return -ENOMEM; @@ -181,7 +181,7 @@ static int xlnx_cdx_probe(struct platform_device *pdev) goto mcdi_init_fail; } - cdx = kzalloc(sizeof(*cdx), GFP_KERNEL); + cdx = kzalloc_obj(*cdx, GFP_KERNEL); if (!cdx) { ret = -ENOMEM; goto cdx_alloc_fail; diff --git a/drivers/cdx/controller/mcdi.c b/drivers/cdx/controller/mcdi.c index 2e82ffc18d89..4b3d8f1ef964 100644 --- a/drivers/cdx/controller/mcdi.c +++ b/drivers/cdx/controller/mcdi.c @@ -118,7 +118,7 @@ int cdx_mcdi_init(struct cdx_mcdi *cdx) struct cdx_mcdi_iface *mcdi; int rc = -ENOMEM; - cdx->mcdi = kzalloc(sizeof(*cdx->mcdi), GFP_KERNEL); + cdx->mcdi = kzalloc_obj(*cdx->mcdi, GFP_KERNEL); if (!cdx->mcdi) goto fail; @@ -456,11 +456,11 @@ static int cdx_mcdi_rpc_sync(struct cdx_mcdi *cdx, unsigned int cmd, if (outlen_actual) *outlen_actual = 0; - wait_data = kmalloc(sizeof(*wait_data), GFP_KERNEL); + wait_data = kmalloc_obj(*wait_data, GFP_KERNEL); if (!wait_data) return -ENOMEM; - cmd_item = kmalloc(sizeof(*cmd_item), GFP_KERNEL); + cmd_item = kmalloc_obj(*cmd_item, GFP_KERNEL); if (!cmd_item) { kfree(wait_data); return -ENOMEM; diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 795c8c9ff680..7cf521d36e3b 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -85,13 +85,12 @@ static int amd_create_gatt_pages(int nr_tables) int retval = 0; int i; - tables = kcalloc(nr_tables + 1, sizeof(struct amd_page_map *), - GFP_KERNEL); + tables = kzalloc_objs(struct amd_page_map *, nr_tables + 1, GFP_KERNEL); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL); + entry = kzalloc_obj(struct amd_page_map, GFP_KERNEL); tables[i] = entry; if (entry == NULL) { retval = -ENOMEM; diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index f7871afe08cf..65afee75d8e3 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c @@ -112,13 +112,12 @@ static int ati_create_gatt_pages(int nr_tables) int retval = 0; int i; - tables = kcalloc(nr_tables + 1, sizeof(struct ati_page_map *), - GFP_KERNEL); + tables = kzalloc_objs(struct ati_page_map *, nr_tables + 1, GFP_KERNEL); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL); + entry = kzalloc_obj(struct ati_page_map, GFP_KERNEL); tables[i] = entry; if (entry == NULL) { retval = -ENOMEM; diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 1776afd3ee07..90554f4f2146 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -238,7 +238,7 @@ struct agp_bridge_data *agp_alloc_bridge(void) { struct agp_bridge_data *bridge; - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return NULL; diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 3ffbb1c80c5c..66ba14eac583 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -101,7 +101,7 @@ static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) if (INT_MAX/sizeof(struct page *) < num_agp_pages) return NULL; - new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); + new = kzalloc_obj(struct agp_memory, GFP_KERNEL); if (new == NULL) return NULL; @@ -127,7 +127,7 @@ struct agp_memory *agp_create_memory(int scratch_pages) { struct agp_memory *new; - new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); + new = kzalloc_obj(struct agp_memory, GFP_KERNEL); if (new == NULL) return NULL; diff --git a/drivers/char/agp/isoch.c b/drivers/char/agp/isoch.c index 7ecf20a6d19c..b7deecb40922 100644 --- a/drivers/char/agp/isoch.c +++ b/drivers/char/agp/isoch.c @@ -92,7 +92,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge, * We'll work with an array of isoch_data's (one for each * device in dev_list) throughout this function. */ - master = kmalloc_array(ndevs, sizeof(*master), GFP_KERNEL); + master = kmalloc_objs(*master, ndevs, GFP_KERNEL); if (master == NULL) { ret = -ENOMEM; goto get_out; @@ -333,7 +333,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge) * Allocate a head for our AGP 3.5 device list * (multiple AGP v3 devices are allowed behind a single bridge). */ - if ((dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL)) == NULL) { + if ((dev_list = kmalloc_obj(*dev_list, GFP_KERNEL)) == NULL) { ret = -ENOMEM; goto get_out; } @@ -362,7 +362,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge) case 0x0300: /* Display controller */ case 0x0400: /* Multimedia controller */ - if ((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) { + if ((cur = kmalloc_obj(*cur, GFP_KERNEL)) == NULL) { ret = -ENOMEM; goto free_and_exit; } diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index 0ab7562d17c9..03f21b90d368 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c @@ -96,13 +96,13 @@ static int serverworks_create_gatt_pages(int nr_tables) int retval = 0; int i; - tables = kcalloc(nr_tables + 1, sizeof(struct serverworks_page_map *), - GFP_KERNEL); + tables = kzalloc_objs(struct serverworks_page_map *, nr_tables + 1, + GFP_KERNEL); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc(sizeof(struct serverworks_page_map), GFP_KERNEL); + entry = kzalloc_obj(struct serverworks_page_map, GFP_KERNEL); if (entry == NULL) { retval = -ENOMEM; break; diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index b8d7115b8c9e..5d5ba7c7d9ba 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -404,9 +404,8 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge) if (table == NULL) return -ENOMEM; - uninorth_priv.pages_arr = kmalloc_array(1 << page_order, - sizeof(struct page *), - GFP_KERNEL); + uninorth_priv.pages_arr = kmalloc_objs(struct page *, 1 << page_order, + GFP_KERNEL); if (uninorth_priv.pages_arr == NULL) goto enomem; diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index 4aa5d1c76f83..54e921eac4d3 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c @@ -343,7 +343,7 @@ static int apm_open(struct inode * inode, struct file * filp) { struct apm_user *as; - as = kzalloc(sizeof(*as), GFP_KERNEL); + as = kzalloc_obj(*as, GFP_KERNEL); if (as) { /* * XXX - this is a tiny bit broken, when we consider BSD diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 837109ef6766..57d236398a81 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c @@ -186,8 +186,7 @@ static int bsr_add_node(struct device_node *bn) num_bsr_devs = bsr_bytes_len / sizeof(u32); for (i = 0 ; i < num_bsr_devs; i++) { - struct bsr_dev *cur = kzalloc(sizeof(struct bsr_dev), - GFP_KERNEL); + struct bsr_dev *cur = kzalloc_obj(struct bsr_dev, GFP_KERNEL); struct resource res; int result; diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 4f5ccd3a1f56..1813e931c2b0 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -823,8 +823,7 @@ int hpet_alloc(struct hpet_data *hdp) return 0; } - hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs), - GFP_KERNEL); + hpetp = kzalloc_flex(*hpetp, hp_dev, hdp->hd_nirqs, GFP_KERNEL); if (!hpetp) return -ENOMEM; diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index 9a24d19236dc..bc228e26929e 100644 --- a/drivers/char/hw_random/amd-rng.c +++ b/drivers/char/hw_random/amd-rng.c @@ -154,7 +154,7 @@ found: goto put_dev; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { err = -ENOMEM; goto put_dev; diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index 159baf00a867..45e2696fad23 100644 --- a/drivers/char/hw_random/geode-rng.c +++ b/drivers/char/hw_random/geode-rng.c @@ -107,7 +107,7 @@ static int __init geode_rng_init(void) return err; found: - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { err = -ENOMEM; goto put_dev; diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index 7b171cb3b825..e18041c2610d 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c @@ -346,7 +346,7 @@ static int __init intel_rng_mod_init(void) goto fwh_done; } - intel_rng_hw = kmalloc(sizeof(*intel_rng_hw), GFP_KERNEL); + intel_rng_hw = kmalloc_obj(*intel_rng_hw, GFP_KERNEL); if (!intel_rng_hw) { pci_dev_put(dev); goto out; diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index eb80a031c7be..ba35f83d5c31 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -134,7 +134,7 @@ static int probe_common(struct virtio_device *vdev) int err, index; struct virtrng_info *vi = NULL; - vi = kzalloc(sizeof(struct virtrng_info), GFP_KERNEL); + vi = kzalloc_obj(struct virtrng_info, GFP_KERNEL); if (!vi) return -ENOMEM; diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c index ee2bdc7ed0da..2fe1d205ce4e 100644 --- a/drivers/char/ipmi/ipmb_dev_int.c +++ b/drivers/char/ipmi/ipmb_dev_int.c @@ -208,7 +208,7 @@ static void ipmb_handle_request(struct ipmb_dev *ipmb_dev) REQUEST_QUEUE_MAX_LEN) return; - queue_elem = kmalloc(sizeof(*queue_elem), GFP_ATOMIC); + queue_elem = kmalloc_obj(*queue_elem, GFP_ATOMIC); if (!queue_elem) return; diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index e6ba35b71f10..c8a4f261bd58 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c @@ -90,7 +90,7 @@ static int ipmi_open(struct inode *inode, struct file *file) int rv; struct ipmi_file_private *priv; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -813,7 +813,7 @@ static void ipmi_new_smi(int if_num, struct device *device) dev_t dev = MKDEV(ipmi_major, if_num); struct ipmi_reg_list *entry; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { pr_err("ipmi_devintf: Unable to create the ipmi class device link\n"); return; diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c index bbf7029e224b..2462d2557331 100644 --- a/drivers/char/ipmi/ipmi_dmi.c +++ b/drivers/char/ipmi/ipmi_dmi.c @@ -74,7 +74,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr, p.slave_addr = slave_addr; p.addr_source = SI_SMBIOS; - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) { pr_warn("Could not allocate dmi info\n"); } else { diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 3f48fc6ab596..b4f05d15d2df 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -761,13 +761,11 @@ int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher) list_for_each_entry(intf, &ipmi_interfaces, link) count++; if (count > 0) { - interfaces = kmalloc_array(count, sizeof(*interfaces), - GFP_KERNEL); + interfaces = kmalloc_objs(*interfaces, count, GFP_KERNEL); if (!interfaces) { rv = -ENOMEM; } else { - devices = kmalloc_array(count, sizeof(*devices), - GFP_KERNEL); + devices = kmalloc_objs(*devices, count, GFP_KERNEL); if (!devices) { kfree(interfaces); interfaces = NULL; @@ -1686,7 +1684,7 @@ int ipmi_register_for_cmd(struct ipmi_user *user, if (!user) return -ENODEV; - rcvr = kmalloc(sizeof(*rcvr), GFP_KERNEL); + rcvr = kmalloc_obj(*rcvr, GFP_KERNEL); if (!rcvr) { rv = -ENOMEM; goto out_release; @@ -3146,7 +3144,7 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, bmc->id.product_id, bmc->id.device_id); } else { - bmc = kzalloc(sizeof(*bmc), GFP_KERNEL); + bmc = kzalloc_obj(*bmc, GFP_KERNEL); if (!bmc) { rv = -ENOMEM; goto out; @@ -3582,7 +3580,7 @@ int ipmi_add_smi(struct module *owner, if (rv) return rv; - intf = kzalloc(sizeof(*intf), GFP_KERNEL); + intf = kzalloc_obj(*intf, GFP_KERNEL); if (!intf) return -ENOMEM; @@ -5195,7 +5193,7 @@ static void free_smi_msg(struct ipmi_smi_msg *msg) struct ipmi_smi_msg *ipmi_alloc_smi_msg(void) { struct ipmi_smi_msg *rv; - rv = kmalloc(sizeof(struct ipmi_smi_msg), GFP_ATOMIC); + rv = kmalloc_obj(struct ipmi_smi_msg, GFP_ATOMIC); if (rv) { rv->done = free_smi_msg; rv->recv_msg = NULL; @@ -5225,7 +5223,7 @@ static struct ipmi_recv_msg *ipmi_alloc_recv_msg(struct ipmi_user *user) } } - rv = kmalloc(sizeof(struct ipmi_recv_msg), GFP_ATOMIC); + rv = kmalloc_obj(struct ipmi_recv_msg, GFP_ATOMIC); if (!rv) { if (user) atomic_dec(&user->nr_msgs); diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 5459ffdde8dc..c6137eb56548 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -1914,7 +1914,7 @@ int ipmi_si_add_smi(struct si_sm_io *io) } } - new_smi = kzalloc(sizeof(*new_smi), GFP_KERNEL); + new_smi = kzalloc_obj(*new_smi, GFP_KERNEL); if (!new_smi) return -ENOMEM; spin_lock_init(&new_smi->si_lock); diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index ef1582a029f4..579cf30cd52f 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1602,7 +1602,7 @@ static int ssif_add_infos(struct i2c_client *client) { struct ssif_addr_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->addr_src = SI_ACPI; @@ -1667,7 +1667,7 @@ static int ssif_probe(struct i2c_client *client) return -ENOMEM; } - ssif_info = kzalloc(sizeof(*ssif_info), GFP_KERNEL); + ssif_info = kzalloc_obj(*ssif_info, GFP_KERNEL); if (!ssif_info) { kfree(resp); mutex_unlock(&ssif_infos_mutex); @@ -1948,7 +1948,7 @@ static int new_ssif_client(int addr, char *adapter_name, goto out_unlock; } - addr_info = kzalloc(sizeof(*addr_info), GFP_KERNEL); + addr_info = kzalloc_obj(*addr_info, GFP_KERNEL); if (!addr_info) { rv = -ENOMEM; goto out_unlock; diff --git a/drivers/char/ipmi/kcs_bmc_serio.c b/drivers/char/ipmi/kcs_bmc_serio.c index 1793358be782..4c3a70dc7425 100644 --- a/drivers/char/ipmi/kcs_bmc_serio.c +++ b/drivers/char/ipmi/kcs_bmc_serio.c @@ -77,7 +77,7 @@ static int kcs_bmc_serio_add_device(struct kcs_bmc_device *kcs_bmc) return -ENOMEM; /* Use kzalloc() as the allocation is cleaned up with kfree() via serio_unregister_port() */ - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/char/powernv-op-panel.c b/drivers/char/powernv-op-panel.c index 53467b0a6187..7405d645ff62 100644 --- a/drivers/char/powernv-op-panel.c +++ b/drivers/char/powernv-op-panel.c @@ -167,7 +167,7 @@ static int oppanel_probe(struct platform_device *pdev) if (!oppanel_data) return -ENOMEM; - oppanel_lines = kcalloc(num_lines, sizeof(oppanel_line_t), GFP_KERNEL); + oppanel_lines = kzalloc_objs(oppanel_line_t, num_lines, GFP_KERNEL); if (!oppanel_lines) { rc = -ENOMEM; goto free_oppanel_data; diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index d1dfbd8d4d42..2468040d745f 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -689,7 +689,7 @@ static int pp_open(struct inode *inode, struct file *file) if (minor >= PARPORT_MAX) return -ENXIO; - pp = kmalloc(sizeof(struct pp_struct), GFP_KERNEL); + pp = kmalloc_obj(struct pp_struct, GFP_KERNEL); if (!pp) return -ENOMEM; diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index 23871cde41fb..5892d2b1cb72 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c @@ -361,7 +361,7 @@ static int ps3flash_probe(struct ps3_system_bus_device *_dev) ps3flash_dev = dev; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/char/random.c b/drivers/char/random.c index bab03c7c4194..91dc486b9ffa 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1248,7 +1248,7 @@ void __cold rand_initialize_disk(struct gendisk *disk) * If kzalloc returns null, we just won't use that entropy * source. */ - state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL); + state = kzalloc_obj(struct timer_rand_state, GFP_KERNEL); if (state) { state->last_time = INITIAL_JIFFIES; disk->random = state; diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index b381ea7e85d2..8f3dd530f56c 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c @@ -776,7 +776,7 @@ static int __init tlclk_init(void) telclk_interrupt = (inb(TLCLK_REG7) & 0x0f); - alarm_events = kzalloc( sizeof(struct tlclk_alarms), GFP_KERNEL); + alarm_events = kzalloc_obj(struct tlclk_alarms, GFP_KERNEL); if (!alarm_events) { ret = -ENOMEM; goto out1; diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 082b910ddf0d..986990723db2 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -295,7 +295,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev, struct tpm_chip *chip; int rc; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c index 97c94b5e9340..bd197be15923 100644 --- a/drivers/char/tpm/tpm-dev.c +++ b/drivers/char/tpm/tpm-dev.c @@ -30,7 +30,7 @@ static int tpm_open(struct inode *inode, struct file *file) return -EBUSY; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) goto out; diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c index 09df6353ef04..c00817faf88e 100644 --- a/drivers/char/tpm/tpm2-sessions.c +++ b/drivers/char/tpm/tpm2-sessions.c @@ -991,7 +991,7 @@ int tpm2_start_auth_session(struct tpm_chip *chip) return 0; } - auth = kzalloc(sizeof(*auth), GFP_KERNEL); + auth = kzalloc_obj(*auth, GFP_KERNEL); if (!auth) return -ENOMEM; diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c index 755b77b32ea4..1bc1c6c2f257 100644 --- a/drivers/char/tpm/tpm_crb_ffa.c +++ b/drivers/char/tpm/tpm_crb_ffa.c @@ -346,7 +346,7 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev) return -EINVAL; } - p = kzalloc(sizeof(*tpm_crb_ffa), GFP_KERNEL); + p = kzalloc_obj(*tpm_crb_ffa, GFP_KERNEL); if (!p) return -ENOMEM; tpm_crb_ffa = p; diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 4734a69406ce..2bd4e1dce322 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -611,7 +611,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, if (IS_ERR(chip)) return PTR_ERR(chip); - ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL); + ibmvtpm = kzalloc_obj(struct ibmvtpm_dev, GFP_KERNEL); if (!ibmvtpm) { dev_err(dev, "kzalloc for ibmvtpm failed\n"); goto cleanup; diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c index 0818bb517805..b84d745a9797 100644 --- a/drivers/char/tpm/tpm_vtpm_proxy.c +++ b/drivers/char/tpm/tpm_vtpm_proxy.c @@ -491,7 +491,7 @@ static struct proxy_dev *vtpm_proxy_create_proxy_dev(void) struct tpm_chip *chip; int err; - proxy_dev = kzalloc(sizeof(*proxy_dev), GFP_KERNEL); + proxy_dev = kzalloc_obj(*proxy_dev, GFP_KERNEL); if (proxy_dev == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/char/tpm/tpmrm-dev.c b/drivers/char/tpm/tpmrm-dev.c index c25df7ea064e..cace5bc7369a 100644 --- a/drivers/char/tpm/tpmrm-dev.c +++ b/drivers/char/tpm/tpmrm-dev.c @@ -17,7 +17,7 @@ static int tpmrm_open(struct inode *inode, struct file *file) int rc; chip = container_of(inode->i_cdev, struct tpm_chip, cdevs); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c index 556bf2256716..c1a4a5531b0a 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c @@ -338,7 +338,7 @@ static int tpmfront_probe(struct xenbus_device *dev, struct tpm_private *priv; int rv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { xenbus_dev_fatal(dev, -ENOMEM, "allocating priv structure"); return -ENOMEM; diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 088182e54deb..2c1c864a9de9 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -412,7 +412,7 @@ static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size * Allocate buffer and the sg list. The sg list array is allocated * directly after the port_buffer struct. */ - buf = kmalloc(struct_size(buf, sg, pages), GFP_KERNEL); + buf = kmalloc_flex(*buf, sg, pages, GFP_KERNEL); if (!buf) goto fail; @@ -1325,7 +1325,7 @@ static int add_port(struct ports_device *portdev, u32 id) dev_t devt; int err; - port = kmalloc(sizeof(*port), GFP_KERNEL); + port = kmalloc_obj(*port, GFP_KERNEL); if (!port) { err = -ENOMEM; goto fail; @@ -1809,12 +1809,11 @@ static int init_vqs(struct ports_device *portdev) nr_ports = portdev->max_nr_ports; nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2; - vqs = kmalloc_array(nr_queues, sizeof(struct virtqueue *), GFP_KERNEL); - vqs_info = kcalloc(nr_queues, sizeof(*vqs_info), GFP_KERNEL); - portdev->in_vqs = kmalloc_array(nr_ports, sizeof(struct virtqueue *), + vqs = kmalloc_objs(struct virtqueue *, nr_queues, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, nr_queues, GFP_KERNEL); + portdev->in_vqs = kmalloc_objs(struct virtqueue *, nr_ports, GFP_KERNEL); + portdev->out_vqs = kmalloc_objs(struct virtqueue *, nr_ports, GFP_KERNEL); - portdev->out_vqs = kmalloc_array(nr_ports, sizeof(struct virtqueue *), - GFP_KERNEL); if (!vqs || !vqs_info || !portdev->in_vqs || !portdev->out_vqs) { err = -ENOMEM; goto free; @@ -1965,7 +1964,7 @@ static int virtcons_probe(struct virtio_device *vdev) return -EINVAL; } - portdev = kmalloc(sizeof(*portdev), GFP_KERNEL); + portdev = kmalloc_obj(*portdev, GFP_KERNEL); if (!portdev) { err = -ENOMEM; goto fail; diff --git a/drivers/char/xillybus/xillybus_class.c b/drivers/char/xillybus/xillybus_class.c index c92a628e389e..4bc5a2152abb 100644 --- a/drivers/char/xillybus/xillybus_class.c +++ b/drivers/char/xillybus/xillybus_class.c @@ -57,7 +57,7 @@ int xillybus_init_chrdev(struct device *dev, size_t namelen; struct xilly_unit *unit, *u; - unit = kzalloc(sizeof(*unit), GFP_KERNEL); + unit = kzalloc_obj(*unit, GFP_KERNEL); if (!unit) return -ENOMEM; diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c index fc4e69b5cb6a..86dccc6009f8 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c @@ -319,7 +319,7 @@ static int xilly_map_single(struct xilly_endpoint *ep, dma_addr_t addr; struct xilly_mapping *this; - this = kzalloc(sizeof(*this), GFP_KERNEL); + this = kzalloc_obj(*this, GFP_KERNEL); if (!this) return -ENOMEM; diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xillyusb.c index 386531474213..568e82b73823 100644 --- a/drivers/char/xillybus/xillyusb.c +++ b/drivers/char/xillybus/xillyusb.c @@ -495,7 +495,7 @@ static struct xillyusb_endpoint struct xillyusb_endpoint *ep; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return NULL; @@ -522,7 +522,7 @@ static struct xillyusb_endpoint struct xillybuffer *xb; unsigned long addr; - xb = kzalloc(sizeof(*xb), GFP_KERNEL); + xb = kzalloc_obj(*xb, GFP_KERNEL); if (!xb) { endpoint_dealloc(ep); @@ -1336,7 +1336,7 @@ static int xillyusb_open(struct inode *inode, struct file *filp) } if (filp->f_mode & FMODE_READ) { - in_fifo = kzalloc(sizeof(*in_fifo), GFP_KERNEL); + in_fifo = kzalloc_obj(*in_fifo, GFP_KERNEL); if (!in_fifo) { rc = -ENOMEM; @@ -1943,7 +1943,7 @@ static int setup_channels(struct xillyusb_dev *xdev, struct xillyusb_channel *chan, *new_channels; int i; - chan = kcalloc(num_channels, sizeof(*chan), GFP_KERNEL); + chan = kzalloc_objs(*chan, num_channels, GFP_KERNEL); if (!chan) return -ENOMEM; @@ -2149,7 +2149,7 @@ static int xillyusb_probe(struct usb_interface *interface, struct xillyusb_dev *xdev; int rc; - xdev = kzalloc(sizeof(*xdev), GFP_KERNEL); + xdev = kzalloc_obj(*xdev, GFP_KERNEL); if (!xdev) return -ENOMEM; diff --git a/drivers/clk/aspeed/clk-aspeed.c b/drivers/clk/aspeed/clk-aspeed.c index 74c8c1377b70..c8449e49ea08 100644 --- a/drivers/clk/aspeed/clk-aspeed.c +++ b/drivers/clk/aspeed/clk-aspeed.c @@ -354,7 +354,7 @@ static struct clk_hw *aspeed_clk_hw_register_gate(struct device *dev, struct clk_hw *hw; int ret; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -698,9 +698,8 @@ static void __init aspeed_cc_init(struct device_node *np) if (!scu_base) return; - aspeed_clk_data = kzalloc(struct_size(aspeed_clk_data, hws, - ASPEED_NUM_CLKS), - GFP_KERNEL); + aspeed_clk_data = kzalloc_flex(*aspeed_clk_data, hws, ASPEED_NUM_CLKS, + GFP_KERNEL); if (!aspeed_clk_data) return; aspeed_clk_data->num = ASPEED_NUM_CLKS; diff --git a/drivers/clk/aspeed/clk-ast2600.c b/drivers/clk/aspeed/clk-ast2600.c index 114afc13d640..e24b536e68ce 100644 --- a/drivers/clk/aspeed/clk-ast2600.c +++ b/drivers/clk/aspeed/clk-ast2600.c @@ -431,7 +431,7 @@ static struct clk_hw *aspeed_g6_clk_hw_register_gate(struct device *dev, struct clk_hw *hw; int ret; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -838,8 +838,8 @@ static void __init aspeed_g6_cc_init(struct device_node *np) soc_rev = (readl(scu_g6_base + ASPEED_G6_SILICON_REV) & CHIP_REVISION_ID) >> 16; - aspeed_g6_clk_data = kzalloc(struct_size(aspeed_g6_clk_data, hws, - ASPEED_G6_NUM_CLKS), GFP_KERNEL); + aspeed_g6_clk_data = kzalloc_flex(*aspeed_g6_clk_data, hws, + ASPEED_G6_NUM_CLKS, GFP_KERNEL); if (!aspeed_g6_clk_data) return; aspeed_g6_clk_data->num = ASPEED_G6_NUM_CLKS; diff --git a/drivers/clk/aspeed/clk-ast2700.c b/drivers/clk/aspeed/clk-ast2700.c index bbb2b571eb72..df491bae39b7 100644 --- a/drivers/clk/aspeed/clk-ast2700.c +++ b/drivers/clk/aspeed/clk-ast2700.c @@ -820,7 +820,7 @@ static struct clk_hw *ast2700_clk_hw_register_gate(struct device *dev, const cha struct clk_hw *hw; int ret = -EINVAL; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-pll.c index bf9b635ac9d6..9133c0ec7f08 100644 --- a/drivers/clk/at91/clk-audio-pll.c +++ b/drivers/clk/at91/clk-audio-pll.c @@ -460,7 +460,7 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, struct clk_init_data init = {}; int ret; - frac_ck = kzalloc(sizeof(*frac_ck), GFP_KERNEL); + frac_ck = kzalloc_obj(*frac_ck, GFP_KERNEL); if (!frac_ck) return ERR_PTR(-ENOMEM); @@ -490,7 +490,7 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - apad_ck = kzalloc(sizeof(*apad_ck), GFP_KERNEL); + apad_ck = kzalloc_obj(*apad_ck, GFP_KERNEL); if (!apad_ck) return ERR_PTR(-ENOMEM); @@ -521,7 +521,7 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - apmc_ck = kzalloc(sizeof(*apmc_ck), GFP_KERNEL); + apmc_ck = kzalloc_obj(*apmc_ck, GFP_KERNEL); if (!apmc_ck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c index 4b4edeecc889..0427f112829b 100644 --- a/drivers/clk/at91/clk-generated.c +++ b/drivers/clk/at91/clk-generated.c @@ -332,7 +332,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, if (!(parent_names || parent_hws)) return ERR_PTR(-ENOMEM); - gck = kzalloc(sizeof(*gck), GFP_KERNEL); + gck = kzalloc_obj(*gck, GFP_KERNEL); if (!gck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c index a9aa93b5a870..a56e65eb2333 100644 --- a/drivers/clk/at91/clk-h32mx.c +++ b/drivers/clk/at91/clk-h32mx.c @@ -100,7 +100,7 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - h32mxclk = kzalloc(sizeof(*h32mxclk), GFP_KERNEL); + h32mxclk = kzalloc_obj(*h32mxclk, GFP_KERNEL); if (!h32mxclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-i2s-mux.c b/drivers/clk/at91/clk-i2s-mux.c index fe6ce172b8b0..309a8d6136d5 100644 --- a/drivers/clk/at91/clk-i2s-mux.c +++ b/drivers/clk/at91/clk-i2s-mux.c @@ -57,7 +57,7 @@ at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, struct clk_i2s_mux *i2s_ck; int ret; - i2s_ck = kzalloc(sizeof(*i2s_ck), GFP_KERNEL); + i2s_ck = kzalloc_obj(*i2s_ck, GFP_KERNEL); if (!i2s_ck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 9b462becc693..51b0421d01e3 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -163,7 +163,7 @@ at91_clk_register_main_osc(struct regmap *regmap, if (!name || !(parent_name || parent_data)) return ERR_PTR(-EINVAL); - osc = kzalloc(sizeof(*osc), GFP_KERNEL); + osc = kzalloc_obj(*osc, GFP_KERNEL); if (!osc) return ERR_PTR(-ENOMEM); @@ -306,7 +306,7 @@ at91_clk_register_main_rc_osc(struct regmap *regmap, if (!name || !frequency) return ERR_PTR(-EINVAL); - osc = kzalloc(sizeof(*osc), GFP_KERNEL); + osc = kzalloc_obj(*osc, GFP_KERNEL); if (!osc) return ERR_PTR(-ENOMEM); @@ -415,7 +415,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap, if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); + clkmain = kzalloc_obj(*clkmain, GFP_KERNEL); if (!clkmain) return ERR_PTR(-ENOMEM); @@ -567,7 +567,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, if (!(parent_hws || parent_names) || !num_parents) return ERR_PTR(-EINVAL); - clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); + clkmain = kzalloc_obj(*clkmain, GFP_KERNEL); if (!clkmain) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index d5ea2069ec83..5e4f5fcc0645 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -488,7 +488,7 @@ at91_clk_register_master_internal(struct regmap *regmap, if (!name || !num_parents || !(parent_names || parent_hws) || !lock) return ERR_PTR(-EINVAL); - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return ERR_PTR(-ENOMEM); @@ -831,7 +831,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, !lock || id > MASTER_MAX_ID) return ERR_PTR(-EINVAL); - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c index e7208c47268b..dda4217aaf85 100644 --- a/drivers/clk/at91/clk-peripheral.c +++ b/drivers/clk/at91/clk-peripheral.c @@ -109,7 +109,7 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name, if (!name || !(parent_name || parent_hw) || id > PERIPHERAL_ID_MAX) return ERR_PTR(-EINVAL); - periph = kzalloc(sizeof(*periph), GFP_KERNEL); + periph = kzalloc_obj(*periph, GFP_KERNEL); if (!periph) return ERR_PTR(-ENOMEM); @@ -471,7 +471,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, if (!name || !(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - periph = kzalloc(sizeof(*periph), GFP_KERNEL); + periph = kzalloc_obj(*periph, GFP_KERNEL); if (!periph) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index 5c5f7398effe..083e7524ff8f 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -326,7 +326,7 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, if (id > PLL_MAX_ID) return ERR_PTR(-EINVAL); - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c index 3ac09fecc54e..27feb5207b40 100644 --- a/drivers/clk/at91/clk-plldiv.c +++ b/drivers/clk/at91/clk-plldiv.c @@ -91,7 +91,7 @@ at91_clk_register_plldiv(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - plldiv = kzalloc(sizeof(*plldiv), GFP_KERNEL); + plldiv = kzalloc_obj(*plldiv, GFP_KERNEL); if (!plldiv) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 1195fb405503..a87e63f4c3f8 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -227,7 +227,7 @@ at91_clk_register_programmable(struct regmap *regmap, if (id > PROG_ID_MAX || !(parent_names || parent_hws)) return ERR_PTR(-EINVAL); - prog = kzalloc(sizeof(*prog), GFP_KERNEL); + prog = kzalloc_obj(*prog, GFP_KERNEL); if (!prog) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c index 3b965057ba0d..5f5cecbcf207 100644 --- a/drivers/clk/at91/clk-sam9x60-pll.c +++ b/drivers/clk/at91/clk-sam9x60-pll.c @@ -652,7 +652,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, if (id > PLL_MAX_ID || !lock || !parent_hw) return ERR_PTR(-EINVAL); - frac = kzalloc(sizeof(*frac), GFP_KERNEL); + frac = kzalloc_obj(*frac, GFP_KERNEL); if (!frac) return ERR_PTR(-ENOMEM); @@ -744,7 +744,7 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, if (safe_div >= PLL_DIV_MAX) safe_div = PLL_DIV_MAX - 1; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index ac9f7a48b76e..e39db89e2a37 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -52,7 +52,7 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, if (!parent_names || !num_parents) return ERR_PTR(-EINVAL); - slowck = kzalloc(sizeof(*slowck), GFP_KERNEL); + slowck = kzalloc_obj(*slowck, GFP_KERNEL); if (!slowck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 09c649c8598e..3c07dcd3cc2c 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -118,7 +118,7 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - smd = kzalloc(sizeof(*smd), GFP_KERNEL); + smd = kzalloc_obj(*smd, GFP_KERNEL); if (!smd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c index 90eed39d0785..c3de1dabf283 100644 --- a/drivers/clk/at91/clk-system.c +++ b/drivers/clk/at91/clk-system.c @@ -116,7 +116,7 @@ at91_clk_register_system(struct regmap *regmap, const char *name, if (!(parent_name || parent_hw) || id > SYSTEM_MAX_ID) return ERR_PTR(-EINVAL); - sys = kzalloc(sizeof(*sys), GFP_KERNEL); + sys = kzalloc_obj(*sys, GFP_KERNEL); if (!sys) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c index e906928cfbf0..e5107d0cf383 100644 --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -229,7 +229,7 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc(sizeof(*usb), GFP_KERNEL); + usb = kzalloc_obj(*usb, GFP_KERNEL); if (!usb) return ERR_PTR(-ENOMEM); @@ -280,7 +280,7 @@ at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc(sizeof(*usb), GFP_KERNEL); + usb = kzalloc_obj(*usb, GFP_KERNEL); if (!usb) return ERR_PTR(-ENOMEM); @@ -399,7 +399,7 @@ at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc(sizeof(*usb), GFP_KERNEL); + usb = kzalloc_obj(*usb, GFP_KERNEL); if (!usb) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c index b991180beea1..f318c11bbc44 100644 --- a/drivers/clk/at91/clk-utmi.c +++ b/drivers/clk/at91/clk-utmi.c @@ -155,7 +155,7 @@ at91_clk_register_utmi_internal(struct regmap *regmap_pmc, if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - utmi = kzalloc(sizeof(*utmi), GFP_KERNEL); + utmi = kzalloc_obj(*utmi, GFP_KERNEL); if (!utmi) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index f5a5f9ba7634..dddcfcf453a1 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -369,7 +369,7 @@ of_at91_clk_master_get_characteristics(struct device_node *np) { struct clk_master_characteristics *characteristics; - characteristics = kzalloc(sizeof(*characteristics), GFP_KERNEL); + characteristics = kzalloc_obj(*characteristics, GFP_KERNEL); if (!characteristics) return NULL; @@ -568,11 +568,11 @@ of_at91_clk_pll_get_characteristics(struct device_node *np) return NULL; num_output /= num_cells; - characteristics = kzalloc(sizeof(*characteristics), GFP_KERNEL); + characteristics = kzalloc_obj(*characteristics, GFP_KERNEL); if (!characteristics) return NULL; - output = kcalloc(num_output, sizeof(*output), GFP_KERNEL); + output = kzalloc_objs(*output, num_output, GFP_KERNEL); if (!output) goto out_free_characteristics; diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 2310f6f73162..261c91d449e7 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -87,8 +87,7 @@ struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem, unsigned int num_clks = ncore + nsystem + nperiph + ngck + npck; struct pmc_data *pmc_data; - pmc_data = kzalloc(struct_size(pmc_data, hwtable, num_clks), - GFP_KERNEL); + pmc_data = kzalloc_flex(*pmc_data, hwtable, num_clks, GFP_KERNEL); if (!pmc_data) return NULL; diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c index 021d1b412af4..8ce851dc3e3f 100644 --- a/drivers/clk/at91/sckc.c +++ b/drivers/clk/at91/sckc.c @@ -132,7 +132,7 @@ at91_clk_register_slow_osc(void __iomem *sckcr, if (!sckcr || !name || !parent_data) return ERR_PTR(-EINVAL); - osc = kzalloc(sizeof(*osc), GFP_KERNEL); + osc = kzalloc_obj(*osc, GFP_KERNEL); if (!osc) return ERR_PTR(-ENOMEM); @@ -239,7 +239,7 @@ at91_clk_register_slow_rc_osc(void __iomem *sckcr, if (!sckcr || !name) return ERR_PTR(-EINVAL); - osc = kzalloc(sizeof(*osc), GFP_KERNEL); + osc = kzalloc_obj(*osc, GFP_KERNEL); if (!osc) return ERR_PTR(-ENOMEM); @@ -332,7 +332,7 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr, if (!sckcr || !name || !parent_hws || !num_parents) return ERR_PTR(-EINVAL); - slowck = kzalloc(sizeof(*slowck), GFP_KERNEL); + slowck = kzalloc_obj(*slowck, GFP_KERNEL); if (!slowck) return ERR_PTR(-ENOMEM); @@ -502,7 +502,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np) if (IS_ERR(slow_osc)) goto unregister_slow_rc; - clk_data = kzalloc(struct_size(clk_data, hws, 2), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, 2, GFP_KERNEL); if (!clk_data) goto unregister_slow_osc; @@ -611,7 +611,7 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np) goto unregister_slow_rc; parent_data.fw_name = xtal_name; - osc = kzalloc(sizeof(*osc), GFP_KERNEL); + osc = kzalloc_obj(*osc, GFP_KERNEL); if (!osc) goto unregister_slow_rc; diff --git a/drivers/clk/axis/clk-artpec6.c b/drivers/clk/axis/clk-artpec6.c index a3f349d4624d..792f00b7c94e 100644 --- a/drivers/clk/axis/clk-artpec6.c +++ b/drivers/clk/axis/clk-artpec6.c @@ -49,7 +49,7 @@ static void of_artpec6_clkctrl_setup(struct device_node *np) sys_refclk_name = of_clk_get_parent_name(np, i); - clkdata = kzalloc(sizeof(*clkdata), GFP_KERNEL); + clkdata = kzalloc_obj(*clkdata, GFP_KERNEL); if (!clkdata) return; diff --git a/drivers/clk/axs10x/pll_clock.c b/drivers/clk/axs10x/pll_clock.c index c7ca473ee76c..594455f0918a 100644 --- a/drivers/clk/axs10x/pll_clock.c +++ b/drivers/clk/axs10x/pll_clock.c @@ -265,7 +265,7 @@ static void __init of_axs10x_pll_clk_setup(struct device_node *node) struct clk_init_data init = { }; int ret; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (!pll_clk) return; diff --git a/drivers/clk/baikal-t1/ccu-div.c b/drivers/clk/baikal-t1/ccu-div.c index 849d1f55765f..c9dd59b1c551 100644 --- a/drivers/clk/baikal-t1/ccu-div.c +++ b/drivers/clk/baikal-t1/ccu-div.c @@ -447,7 +447,7 @@ static void ccu_div_var_debug_init(struct clk_hw *hw, struct dentry *dentry) num += !!(div->flags & CLK_SET_RATE_GATE) + !!(div->features & CCU_DIV_RESET_DOMAIN); - bits = kcalloc(num, sizeof(*bits), GFP_KERNEL); + bits = kzalloc_objs(*bits, num, GFP_KERNEL); if (!bits) return; @@ -489,7 +489,7 @@ static void ccu_div_gate_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_div *div = to_ccu_div(hw); struct ccu_div_dbgfs_bit *bit; - bit = kmalloc(sizeof(*bit), GFP_KERNEL); + bit = kmalloc_obj(*bit, GFP_KERNEL); if (!bit) return; @@ -507,7 +507,7 @@ static void ccu_div_buf_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_div *div = to_ccu_div(hw); struct ccu_div_dbgfs_bit *bit; - bit = kmalloc(sizeof(*bit), GFP_KERNEL); + bit = kmalloc_obj(*bit, GFP_KERNEL); if (!bit) return; @@ -585,7 +585,7 @@ struct ccu_div *ccu_div_hw_register(const struct ccu_div_init_data *div_init) if (!div_init) return ERR_PTR(-EINVAL); - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/ccu-pll.c b/drivers/clk/baikal-t1/ccu-pll.c index 357269f41cdc..02b3390cf87f 100644 --- a/drivers/clk/baikal-t1/ccu-pll.c +++ b/drivers/clk/baikal-t1/ccu-pll.c @@ -445,7 +445,7 @@ static void ccu_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_pll_dbgfs_fld *flds; int idx; - bits = kcalloc(CCU_PLL_DBGFS_BIT_NUM, sizeof(*bits), GFP_KERNEL); + bits = kzalloc_objs(*bits, CCU_PLL_DBGFS_BIT_NUM, GFP_KERNEL); if (!bits) return; @@ -458,7 +458,7 @@ static void ccu_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) &ccu_pll_dbgfs_bit_fops); } - flds = kcalloc(CCU_PLL_DBGFS_FLD_NUM, sizeof(*flds), GFP_KERNEL); + flds = kzalloc_objs(*flds, CCU_PLL_DBGFS_FLD_NUM, GFP_KERNEL); if (!flds) return; @@ -508,7 +508,7 @@ struct ccu_pll *ccu_pll_hw_register(const struct ccu_pll_init_data *pll_init) if (!pll_init) return ERR_PTR(-EINVAL); - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/ccu-rst.c b/drivers/clk/baikal-t1/ccu-rst.c index 40023ea67463..18a60273a174 100644 --- a/drivers/clk/baikal-t1/ccu-rst.c +++ b/drivers/clk/baikal-t1/ccu-rst.c @@ -172,7 +172,7 @@ struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *rst_init) if (!rst_init) return ERR_PTR(-EINVAL); - rst = kzalloc(sizeof(*rst), GFP_KERNEL); + rst = kzalloc_obj(*rst, GFP_KERNEL); if (!rst) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/clk-ccu-div.c b/drivers/clk/baikal-t1/clk-ccu-div.c index 17d75e8e2e8f..addccc4014f9 100644 --- a/drivers/clk/baikal-t1/clk-ccu-div.c +++ b/drivers/clk/baikal-t1/clk-ccu-div.c @@ -271,7 +271,7 @@ static struct ccu_div_data *ccu_div_create_data(struct device_node *np) struct ccu_div_data *data; int ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); @@ -289,7 +289,7 @@ static struct ccu_div_data *ccu_div_create_data(struct device_node *np) goto err_kfree_data; } - data->divs = kcalloc(data->divs_num, sizeof(*data->divs), GFP_KERNEL); + data->divs = kzalloc_objs(*data->divs, data->divs_num, GFP_KERNEL); if (!data->divs) { ret = -ENOMEM; goto err_kfree_data; diff --git a/drivers/clk/baikal-t1/clk-ccu-pll.c b/drivers/clk/baikal-t1/clk-ccu-pll.c index 921b87024feb..ace46b60497e 100644 --- a/drivers/clk/baikal-t1/clk-ccu-pll.c +++ b/drivers/clk/baikal-t1/clk-ccu-pll.c @@ -100,7 +100,7 @@ static struct ccu_pll_data *ccu_pll_create_data(struct device_node *np) { struct ccu_pll_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 02215ea79403..971131677b5a 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1357,7 +1357,7 @@ static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman, init.ops = &bcm2835_pll_clk_ops; init.flags = pll_data->flags | CLK_IGNORE_UNUSED; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return NULL; diff --git a/drivers/clk/bcm/clk-bcm53573-ilp.c b/drivers/clk/bcm/clk-bcm53573-ilp.c index b2fc05b60783..e12a5384b95f 100644 --- a/drivers/clk/bcm/clk-bcm53573-ilp.c +++ b/drivers/clk/bcm/clk-bcm53573-ilp.c @@ -102,7 +102,7 @@ static void bcm53573_ilp_init(struct device_node *np) const char *parent_name; int err; - ilp = kzalloc(sizeof(*ilp), GFP_KERNEL); + ilp = kzalloc_obj(*ilp, GFP_KERNEL); if (!ilp) return; diff --git a/drivers/clk/bcm/clk-iproc-armpll.c b/drivers/clk/bcm/clk-iproc-armpll.c index 9e86c0c10b57..e08e828666ea 100644 --- a/drivers/clk/bcm/clk-iproc-armpll.c +++ b/drivers/clk/bcm/clk-iproc-armpll.c @@ -238,7 +238,7 @@ void __init iproc_armpll_setup(struct device_node *node) struct clk_init_data init; const char *parent_name; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (WARN_ON(!pll)) return; diff --git a/drivers/clk/bcm/clk-iproc-asiu.c b/drivers/clk/bcm/clk-iproc-asiu.c index 83ec13da9b2e..258c6b2921bd 100644 --- a/drivers/clk/bcm/clk-iproc-asiu.c +++ b/drivers/clk/bcm/clk-iproc-asiu.c @@ -188,17 +188,17 @@ void __init iproc_asiu_setup(struct device_node *node, if (WARN_ON(!gate || !div)) return; - asiu = kzalloc(sizeof(*asiu), GFP_KERNEL); + asiu = kzalloc_obj(*asiu, GFP_KERNEL); if (WARN_ON(!asiu)) return; - asiu->clk_data = kzalloc(struct_size(asiu->clk_data, hws, num_clks), - GFP_KERNEL); + asiu->clk_data = kzalloc_flex(*asiu->clk_data, hws, num_clks, + GFP_KERNEL); if (WARN_ON(!asiu->clk_data)) goto err_clks; asiu->clk_data->num = num_clks; - asiu->clks = kcalloc(num_clks, sizeof(*asiu->clks), GFP_KERNEL); + asiu->clks = kzalloc_objs(*asiu->clks, num_clks, GFP_KERNEL); if (WARN_ON(!asiu->clks)) goto err_asiu_clks; diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c index 680f9d8d357c..3eab95a59b50 100644 --- a/drivers/clk/bcm/clk-iproc-pll.c +++ b/drivers/clk/bcm/clk-iproc-pll.c @@ -731,16 +731,16 @@ void iproc_pll_clk_setup(struct device_node *node, if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl)) return; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (WARN_ON(!pll)) return; - clk_data = kzalloc(struct_size(clk_data, hws, num_clks), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, num_clks, GFP_KERNEL); if (WARN_ON(!clk_data)) goto err_clk_data; clk_data->num = num_clks; - iclk_array = kcalloc(num_clks, sizeof(struct iproc_clk), GFP_KERNEL); + iclk_array = kzalloc_objs(struct iproc_clk, num_clks, GFP_KERNEL); if (WARN_ON(!iclk_array)) goto err_clks; diff --git a/drivers/clk/berlin/berlin2-avpll.c b/drivers/clk/berlin/berlin2-avpll.c index 79f3d37a0ee0..4c5881baf027 100644 --- a/drivers/clk/berlin/berlin2-avpll.c +++ b/drivers/clk/berlin/berlin2-avpll.c @@ -184,7 +184,7 @@ int __init berlin2_avpll_vco_register(void __iomem *base, struct berlin2_avpll_vco *vco; struct clk_init_data init; - vco = kzalloc(sizeof(*vco), GFP_KERNEL); + vco = kzalloc_obj(*vco, GFP_KERNEL); if (!vco) return -ENOMEM; @@ -360,7 +360,7 @@ int __init berlin2_avpll_channel_register(void __iomem *base, struct berlin2_avpll_channel *ch; struct clk_init_data init; - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) return -ENOMEM; diff --git a/drivers/clk/berlin/berlin2-div.c b/drivers/clk/berlin/berlin2-div.c index 0a248bfe2193..6498823133c0 100644 --- a/drivers/clk/berlin/berlin2-div.c +++ b/drivers/clk/berlin/berlin2-div.c @@ -236,7 +236,7 @@ berlin2_div_register(const struct berlin2_div_map *map, const struct clk_ops *gate_ops = &berlin2_div_gate_ops; struct berlin2_div *div; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/berlin/berlin2-pll.c b/drivers/clk/berlin/berlin2-pll.c index 9661820717a5..6557b275a718 100644 --- a/drivers/clk/berlin/berlin2-pll.c +++ b/drivers/clk/berlin/berlin2-pll.c @@ -81,7 +81,7 @@ berlin2_pll_register(const struct berlin2_pll_map *map, struct clk_init_data init; struct berlin2_pll *pll; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return -ENOMEM; diff --git a/drivers/clk/berlin/bg2.c b/drivers/clk/berlin/bg2.c index 67a9edbba29c..9a08a16b2026 100644 --- a/drivers/clk/berlin/bg2.c +++ b/drivers/clk/berlin/bg2.c @@ -499,7 +499,7 @@ static void __init berlin2_clock_setup(struct device_node *np) u8 avpll_flags = 0; int n, ret; - clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, MAX_CLKS, GFP_KERNEL); if (!clk_data) { of_node_put(parent_np); return; diff --git a/drivers/clk/berlin/bg2q.c b/drivers/clk/berlin/bg2q.c index dd2784bb75b6..58611495ae1d 100644 --- a/drivers/clk/berlin/bg2q.c +++ b/drivers/clk/berlin/bg2q.c @@ -285,7 +285,7 @@ static void __init berlin2q_clock_setup(struct device_node *np) struct clk_hw **hws; int n, ret; - clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, MAX_CLKS, GFP_KERNEL); if (!clk_data) { of_node_put(parent_np); return; diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c index 595cfa533fb9..08e69d69d1fb 100644 --- a/drivers/clk/clk-asm9260.c +++ b/drivers/clk/clk-asm9260.c @@ -262,7 +262,7 @@ static void __init asm9260_acc_init(struct device_node *np) u32 rate; int n; - clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, MAX_CLKS, GFP_KERNEL); if (!clk_data) return; clk_data->num = MAX_CLKS; diff --git a/drivers/clk/clk-bm1880.c b/drivers/clk/clk-bm1880.c index 1bdceb36fa87..47c64f16e129 100644 --- a/drivers/clk/clk-bm1880.c +++ b/drivers/clk/clk-bm1880.c @@ -764,7 +764,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc int ret; if (clks->mux_shift >= 0) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -784,7 +784,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc } if (clks->gate_shift >= 0) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { ret = -ENOMEM; goto err_out; @@ -799,7 +799,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc } if (clks->div_shift >= 0) { - div_hws = kzalloc(sizeof(*div_hws), GFP_KERNEL); + div_hws = kzalloc_obj(*div_hws, GFP_KERNEL); if (!div_hws) { ret = -ENOMEM; goto err_out; diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index 826b3ff99433..1039cf038850 100644 --- a/drivers/clk/clk-bulk.c +++ b/drivers/clk/clk-bulk.c @@ -54,7 +54,7 @@ static int __must_check of_clk_bulk_get_all(struct device_node *np, if (!num_clks) return 0; - clk_bulk = kmalloc_array(num_clks, sizeof(*clk_bulk), GFP_KERNEL); + clk_bulk = kmalloc_objs(*clk_bulk, num_clks, GFP_KERNEL); if (!clk_bulk) return -ENOMEM; diff --git a/drivers/clk/clk-clps711x.c b/drivers/clk/clk-clps711x.c index 402ab74d9bfb..babe42e59533 100644 --- a/drivers/clk/clk-clps711x.c +++ b/drivers/clk/clk-clps711x.c @@ -53,9 +53,8 @@ static void __init clps711x_clk_init_dt(struct device_node *np) base = of_iomap(np, 0); BUG_ON(!base); - clps711x_clk = kzalloc(struct_size(clps711x_clk, clk_data.hws, - CLPS711X_CLK_MAX), - GFP_KERNEL); + clps711x_clk = kzalloc_flex(*clps711x_clk, clk_data.hws, + CLPS711X_CLK_MAX, GFP_KERNEL); BUG_ON(!clps711x_clk); spin_lock_init(&clps711x_clk->lock); diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c index 66759fe28fad..20e45856e8d6 100644 --- a/drivers/clk/clk-composite.c +++ b/drivers/clk/clk-composite.c @@ -248,7 +248,7 @@ static struct clk_hw *__clk_hw_register_composite(struct device *dev, struct clk_ops *clk_composite_ops; int ret; - composite = kzalloc(sizeof(*composite), GFP_KERNEL); + composite = kzalloc_obj(*composite, GFP_KERNEL); if (!composite) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 2601b6155afb..e91bcdb092db 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -538,7 +538,7 @@ struct clk_hw *__clk_hw_register_divider(struct device *dev, } /* allocate the divider */ - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index ea1c3d78e7cd..a41f8706df18 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -335,7 +335,7 @@ static int eqc_auxdev_create(struct device *dev, void __iomem *base, struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; @@ -400,7 +400,7 @@ static int eqc_probe(struct platform_device *pdev) clk_count = data->pll_count + data->div_count + data->fixed_factor_count + data->early_clk_count; - cells = kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); + cells = kzalloc_flex(*cells, hws, clk_count, GFP_KERNEL); if (!cells) return -ENOMEM; @@ -738,7 +738,7 @@ static void __init eqc_early_init(struct device_node *np, clk_count = early_data->early_pll_count + early_data->early_fixed_factor_count + early_data->late_clk_count; - cells = kzalloc(struct_size(cells, hws, clk_count), GFP_KERNEL); + cells = kzalloc_flex(*cells, hws, clk_count, GFP_KERNEL); if (!cells) { ret = -ENOMEM; goto err; diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index de658c9e4c53..40cfb6af38bb 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -110,7 +110,7 @@ __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np, fix = devres_alloc(devm_clk_hw_register_fixed_factor_release, sizeof(*fix), GFP_KERNEL); else - fix = kmalloc(sizeof(*fix), GFP_KERNEL); + fix = kmalloc_obj(*fix, GFP_KERNEL); if (!fix) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index 6b4f76b9c4da..ef48ee88df46 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -78,7 +78,7 @@ struct clk_hw *__clk_hw_register_fixed_rate(struct device *dev, fixed = devres_alloc(devm_clk_hw_register_fixed_rate_release, sizeof(*fixed), GFP_KERNEL); else - fixed = kzalloc(sizeof(*fixed), GFP_KERNEL); + fixed = kzalloc_obj(*fixed, GFP_KERNEL); if (!fixed) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index cd36a6e27f25..065ceb9b3a49 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -275,7 +275,7 @@ struct clk_hw *clk_hw_register_fractional_divider(struct device *dev, struct clk_hw *hw; int ret; - fd = kzalloc(sizeof(*fd), GFP_KERNEL); + fd = kzalloc_obj(*fd, GFP_KERNEL); if (!fd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 4746f8219132..0c5cbb3f3e75 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -145,7 +145,7 @@ struct clk_hw *__clk_hw_register_gate(struct device *dev, } /* allocate the gate */ - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c index e94589c38568..877db2e6efd1 100644 --- a/drivers/clk/clk-gemini.c +++ b/drivers/clk/clk-gemini.c @@ -197,7 +197,7 @@ static struct clk_hw *gemini_pci_clk_setup(const char *name, struct clk_init_data init; int ret; - pciclk = kzalloc(sizeof(*pciclk), GFP_KERNEL); + pciclk = kzalloc_obj(*pciclk, GFP_KERNEL); if (!pciclk) return ERR_PTR(-ENOMEM); @@ -398,9 +398,8 @@ static void __init gemini_cc_init(struct device_node *np) int ret; int i; - gemini_clk_data = kzalloc(struct_size(gemini_clk_data, hws, - GEMINI_NUM_CLKS), - GFP_KERNEL); + gemini_clk_data = kzalloc_flex(*gemini_clk_data, hws, GEMINI_NUM_CLKS, + GFP_KERNEL); if (!gemini_clk_data) return; gemini_clk_data->num = GEMINI_NUM_CLKS; diff --git a/drivers/clk/clk-highbank.c b/drivers/clk/clk-highbank.c index cc583934ecf2..2642314b4735 100644 --- a/drivers/clk/clk-highbank.c +++ b/drivers/clk/clk-highbank.c @@ -277,7 +277,7 @@ static void __init hb_clk_init(struct device_node *node, const struct clk_ops *o if (WARN_ON(rc)) return; - hb_clk = kzalloc(sizeof(*hb_clk), GFP_KERNEL); + hb_clk = kzalloc_obj(*hb_clk, GFP_KERNEL); if (WARN_ON(!hb_clk)) return; diff --git a/drivers/clk/clk-hsdk-pll.c b/drivers/clk/clk-hsdk-pll.c index 7d56a47c2aa7..0ea108366136 100644 --- a/drivers/clk/clk-hsdk-pll.c +++ b/drivers/clk/clk-hsdk-pll.c @@ -357,7 +357,7 @@ static void __init of_hsdk_pll_clk_setup(struct device_node *node) struct hsdk_pll_clk *pll_clk; struct clk_init_data init = { }; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (!pll_clk) return; diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c index 7b7329a907ab..ffcb4e1b3488 100644 --- a/drivers/clk/clk-k210.c +++ b/drivers/clk/clk-k210.c @@ -893,7 +893,7 @@ static void __init k210_clk_init(struct device_node *np) struct k210_sysclk *ksc; int i, ret; - ksc = kzalloc(sizeof(*ksc), GFP_KERNEL); + ksc = kzalloc_obj(*ksc, GFP_KERNEL); if (!ksc) return; diff --git a/drivers/clk/clk-milbeaut.c b/drivers/clk/clk-milbeaut.c index 45389db652e0..6a27411c9f9f 100644 --- a/drivers/clk/clk-milbeaut.c +++ b/drivers/clk/clk-milbeaut.c @@ -333,7 +333,7 @@ static struct clk_hw *m10v_clk_hw_register_mux(struct device *dev, struct clk_init_data init; int ret; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -464,7 +464,7 @@ static struct clk_hw *m10v_clk_hw_register_divider(struct device *dev, struct clk_init_data init; int ret; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); @@ -611,9 +611,8 @@ static void __init m10v_cc_init(struct device_node *np) const char *parent_name; struct clk_hw *hw; - m10v_clk_data = kzalloc(struct_size(m10v_clk_data, hws, - M10V_NUM_CLKS), - GFP_KERNEL); + m10v_clk_data = kzalloc_flex(*m10v_clk_data, hws, M10V_NUM_CLKS, + GFP_KERNEL); if (!m10v_clk_data) return; diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index fa817c317c2a..ee4a7065817f 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -169,7 +169,7 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np, } /* allocate the mux */ - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index fc0aeb4247f2..d165ef6f320d 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -270,7 +270,7 @@ pll_clk_register(struct device *dev, const char *name, return ERR_PTR(-EINVAL); } - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -357,7 +357,7 @@ src_clk_register(struct device *dev, const char *name, struct clk_src *sclk; struct clk_init_data init; - sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); + sclk = kzalloc_obj(*sclk, GFP_KERNEL); if (!sclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c index 030186def9c6..e02f3f1d5ea7 100644 --- a/drivers/clk/clk-npcm7xx.c +++ b/drivers/clk/clk-npcm7xx.c @@ -74,7 +74,7 @@ npcm7xx_clk_register_pll(void __iomem *pllcon, const char *name, struct clk_hw *hw; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -421,8 +421,8 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np) if (!clk_base) goto npcm7xx_init_error; - npcm7xx_clk_data = kzalloc(struct_size(npcm7xx_clk_data, hws, - NPCM7XX_NUM_CLOCKS), GFP_KERNEL); + npcm7xx_clk_data = kzalloc_flex(*npcm7xx_clk_data, hws, + NPCM7XX_NUM_CLOCKS, GFP_KERNEL); if (!npcm7xx_clk_data) goto npcm7xx_init_np_err; diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index a560edeb4b55..c1e0b0a80da7 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c @@ -976,7 +976,7 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) u64 max_rate, pct80_rate; u32 clksel; - hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); + hwc = kzalloc_obj(*hwc, GFP_KERNEL); if (!hwc) return NULL; @@ -1020,7 +1020,7 @@ static struct clk * __init create_one_hwaccel(struct clockgen *cg, int idx) { struct mux_hwclock *hwc; - hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); + hwc = kzalloc_obj(*hwc, GFP_KERNEL); if (!hwc) return NULL; @@ -1319,11 +1319,11 @@ static void __init legacy_pll_init(struct device_node *np, int idx) count = of_property_count_strings(np, "clock-output-names"); BUILD_BUG_ON(ARRAY_SIZE(pll->div) < 4); - subclks = kcalloc(4, sizeof(struct clk *), GFP_KERNEL); + subclks = kzalloc_objs(struct clk *, 4, GFP_KERNEL); if (!subclks) return; - onecell_data = kmalloc(sizeof(*onecell_data), GFP_KERNEL); + onecell_data = kmalloc_obj(*onecell_data, GFP_KERNEL); if (!onecell_data) goto err_clks; diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c index b5d4d48432a0..4e518b92797b 100644 --- a/drivers/clk/clk-stm32f4.c +++ b/drivers/clk/clk-stm32f4.c @@ -489,7 +489,7 @@ static struct clk *clk_register_apb_mul(struct device *dev, const char *name, struct clk_init_data init; struct clk *clk; - am = kzalloc(sizeof(*am), GFP_KERNEL); + am = kzalloc_obj(*am, GFP_KERNEL); if (!am) return ERR_PTR(-ENOMEM); @@ -815,7 +815,7 @@ static struct clk_hw *clk_register_pll_div(const char *name, int ret; /* allocate the divider */ - pll_div = kzalloc(sizeof(*pll_div), GFP_KERNEL); + pll_div = kzalloc_obj(*pll_div, GFP_KERNEL); if (!pll_div) return ERR_PTR(-ENOMEM); @@ -937,7 +937,7 @@ static struct clk_hw *stm32f4_rcc_register_pll(const char *pllsrc, const struct stm32f4_vco_data *vco; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -1107,7 +1107,7 @@ static struct clk_hw *clk_register_rgate(struct device *dev, const char *name, struct clk_hw *hw; int ret; - rgate = kzalloc(sizeof(*rgate), GFP_KERNEL); + rgate = kzalloc_obj(*rgate, GFP_KERNEL); if (!rgate) return ERR_PTR(-ENOMEM); @@ -1202,13 +1202,13 @@ static struct clk_hw *stm32_register_cclk(struct device *dev, const char *name, struct clk_gate *gate; struct clk_mux *mux; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { hw = ERR_PTR(-EINVAL); goto fail; } - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) { kfree(gate); hw = ERR_PTR(-EINVAL); @@ -1776,7 +1776,7 @@ static struct clk_hw *stm32_register_aux_clk(const char *name, const struct clk_ops *mux_ops = NULL, *gate_ops = NULL; if (offset_gate != NO_GATE) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { hw = ERR_PTR(-EINVAL); goto fail; @@ -1791,7 +1791,7 @@ static struct clk_hw *stm32_register_aux_clk(const char *name, } if (offset_mux != NO_MUX) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) { hw = ERR_PTR(-EINVAL); goto fail; @@ -1855,8 +1855,8 @@ static void __init stm32f4_rcc_init(struct device_node *np) stm32fx_end_primary_clk = data->end_primary; - clks = kmalloc_array(data->gates_num + stm32fx_end_primary_clk, - sizeof(*clks), GFP_KERNEL); + clks = kmalloc_objs(*clks, data->gates_num + stm32fx_end_primary_clk, + GFP_KERNEL); if (!clks) goto fail; diff --git a/drivers/clk/clk-stm32h7.c b/drivers/clk/clk-stm32h7.c index 04c18a1d45d3..66fd934070b7 100644 --- a/drivers/clk/clk-stm32h7.c +++ b/drivers/clk/clk-stm32h7.c @@ -222,7 +222,7 @@ static struct clk_hw *clk_register_ready_gate(struct device *dev, struct clk_hw *hw; int ret; - rgate = kzalloc(sizeof(*rgate), GFP_KERNEL); + rgate = kzalloc_obj(*rgate, GFP_KERNEL); if (!rgate) return ERR_PTR(-ENOMEM); @@ -297,7 +297,7 @@ static struct clk_mux *_get_cmux(void __iomem *reg, u8 shift, u8 width, { struct clk_mux *mux; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -315,7 +315,7 @@ static struct clk_divider *_get_cdiv(void __iomem *reg, u8 shift, u8 width, { struct clk_divider *div; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); @@ -334,7 +334,7 @@ static struct clk_gate *_get_cgate(void __iomem *reg, u8 bit_idx, u32 flags, { struct clk_gate *gate; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -467,7 +467,7 @@ static struct clk_hw *clk_register_stm32_timer_ker(struct device *dev, struct clk_hw *hw; int err; - element = kzalloc(sizeof(*element), GFP_KERNEL); + element = kzalloc_obj(*element, GFP_KERNEL); if (!element) return ERR_PTR(-ENOMEM); @@ -792,7 +792,7 @@ static struct clk_hw *clk_register_stm32_pll(struct device *dev, struct stm32_fractional_divider *div = NULL; struct stm32_ready_gate *rgate; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -1200,8 +1200,7 @@ static void __init stm32h7_rcc_init(struct device_node *np) const char *hse_clk, *lse_clk, *i2s_clk; struct regmap *pdrm; - clk_data = kzalloc(struct_size(clk_data, hws, STM32H7_MAX_CLKS), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, STM32H7_MAX_CLKS, GFP_KERNEL); if (!clk_data) return; diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index eae5b3fbfb82..6065141750af 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c @@ -235,7 +235,7 @@ static __init void vtwm_device_clk_init(struct device_node *node) if (!pmc_base) vtwm_set_pmc_base(); - dev_clk = kzalloc(sizeof(*dev_clk), GFP_KERNEL); + dev_clk = kzalloc_obj(*dev_clk, GFP_KERNEL); if (WARN_ON(!dev_clk)) return; @@ -698,7 +698,7 @@ static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) if (WARN_ON(rc)) return; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c index 92e39f3237c2..ebf47b1f5433 100644 --- a/drivers/clk/clk-xgene.c +++ b/drivers/clk/clk-xgene.c @@ -131,7 +131,7 @@ static struct clk *xgene_register_clk_pll(struct device *dev, struct clk_init_data init; /* allocate the APM clock structure */ - apmclk = kzalloc(sizeof(*apmclk), GFP_KERNEL); + apmclk = kzalloc_obj(*apmclk, GFP_KERNEL); if (!apmclk) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ xgene_register_clk_pmd(struct device *dev, struct clk_init_data init; struct clk *clk; - fd = kzalloc(sizeof(*fd), GFP_KERNEL); + fd = kzalloc_obj(*fd, GFP_KERNEL); if (!fd) return ERR_PTR(-ENOMEM); @@ -638,7 +638,7 @@ static struct clk *xgene_register_clk(struct device *dev, int rc; /* allocate the APM clock structure */ - apmclk = kzalloc(sizeof(*apmclk), GFP_KERNEL); + apmclk = kzalloc_obj(*apmclk, GFP_KERNEL); if (!apmclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 85d2f2481acf..5789cd93bfc2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -4121,7 +4121,7 @@ static struct clk *alloc_clk(struct clk_core *core, const char *dev_id, { struct clk *clk; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); @@ -4238,7 +4238,7 @@ static int clk_core_populate_parent_map(struct clk_core *core, * Avoid unnecessary string look-ups of clk_core's possible parents by * having a cache of names/clk_hw pointers to clk_core pointers. */ - parents = kcalloc(num_parents, sizeof(*parents), GFP_KERNEL); + parents = kzalloc_objs(*parents, num_parents, GFP_KERNEL); core->parents = parents; if (!parents) return -ENOMEM; @@ -4328,7 +4328,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) */ hw->init = NULL; - core = kzalloc(sizeof(*core), GFP_KERNEL); + core = kzalloc_obj(*core, GFP_KERNEL); if (!core) { ret = -ENOMEM; goto fail_out; @@ -4813,7 +4813,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) goto found; /* if clk wasn't in the notifier list, allocate new clk_notifier */ - cn = kzalloc(sizeof(*cn), GFP_KERNEL); + cn = kzalloc_obj(*cn, GFP_KERNEL); if (!cn) goto out; @@ -5009,7 +5009,7 @@ int of_clk_add_provider(struct device_node *np, if (!np) return 0; - cp = kzalloc(sizeof(*cp), GFP_KERNEL); + cp = kzalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; @@ -5051,7 +5051,7 @@ int of_clk_add_hw_provider(struct device_node *np, if (!np) return 0; - cp = kzalloc(sizeof(*cp), GFP_KERNEL); + cp = kzalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; @@ -5548,7 +5548,7 @@ void __init of_clk_init(const struct of_device_id *matches) if (!of_device_is_available(np)) continue; - parent = kzalloc(sizeof(*parent), GFP_KERNEL); + parent = kzalloc_obj(*parent, GFP_KERNEL); if (!parent) { list_for_each_entry_safe(clk_provider, next, &clk_provider_list, node) { diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index e0bede6350e1..4d1dbd9fb807 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -164,7 +164,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt, size_t max_size; ssize_t res; - cla = kzalloc(sizeof(*cla), GFP_KERNEL); + cla = kzalloc_obj(*cla, GFP_KERNEL); if (!cla) return NULL; diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c index bfb6bbdc036c..eda3c3a45c52 100644 --- a/drivers/clk/davinci/pll.c +++ b/drivers/clk/davinci/pll.c @@ -243,14 +243,14 @@ static struct clk *davinci_pll_div_register(struct device *dev, struct clk *clk; int ret; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); gate->reg = reg; gate->bit_idx = DIV_ENABLE_SHIFT; - divider = kzalloc(sizeof(*divider), GFP_KERNEL); + divider = kzalloc_obj(*divider, GFP_KERNEL); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -433,7 +433,7 @@ struct clk *davinci_pll_clk_register(struct device *dev, info->unlock_mask, 0); } - pllout = kzalloc(sizeof(*pllout), GFP_KERNEL); + pllout = kzalloc_obj(*pllout, GFP_KERNEL); if (!pllout) { ret = -ENOMEM; goto err_unregister_prediv; @@ -489,7 +489,7 @@ struct clk *davinci_pll_clk_register(struct device *dev, parent_name = postdiv_name; } - pllen = kzalloc(sizeof(*pllen), GFP_KERNEL); + pllen = kzalloc_obj(*pllen, GFP_KERNEL); if (!pllen) { ret = -ENOMEM; goto err_unregister_postdiv; @@ -579,7 +579,7 @@ davinci_pll_obsclk_register(struct device *dev, u32 oscdiv; int ret; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -587,7 +587,7 @@ davinci_pll_obsclk_register(struct device *dev, mux->table = info->table; mux->mask = info->ocsrc_mask; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { ret = -ENOMEM; goto err_free_mux; @@ -596,7 +596,7 @@ davinci_pll_obsclk_register(struct device *dev, gate->reg = base + CKEN; gate->bit_idx = CKEN_OBSCLK_SHIFT; - divider = kzalloc(sizeof(*divider), GFP_KERNEL); + divider = kzalloc_obj(*divider, GFP_KERNEL); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -690,14 +690,14 @@ davinci_pll_sysclk_register(struct device *dev, else reg = PLLDIV4 + 4 * (info->id - 4); - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); gate->reg = base + reg; gate->bit_idx = DIV_ENABLE_SHIFT; - divider = kzalloc(sizeof(*divider), GFP_KERNEL); + divider = kzalloc_obj(*divider, GFP_KERNEL); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -776,13 +776,13 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node, int n_clks = max_sysclk_id + 1; int i; - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) { of_node_put(child); return -ENOMEM; } - clks = kmalloc_array(n_clks, sizeof(*clks), GFP_KERNEL); + clks = kmalloc_objs(*clks, n_clks, GFP_KERNEL); if (!clks) { kfree(clk_data); of_node_put(child); @@ -942,7 +942,7 @@ static void davinci_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) struct davinci_pll_clk *pll = to_davinci_pll_clk(hw); struct debugfs_regset32 *regset; - regset = kzalloc(sizeof(*regset), GFP_KERNEL); + regset = kzalloc_obj(*regset, GFP_KERNEL); if (!regset) return; diff --git a/drivers/clk/davinci/psc.c b/drivers/clk/davinci/psc.c index f3ee9397bb0c..5a593f20ce81 100644 --- a/drivers/clk/davinci/psc.c +++ b/drivers/clk/davinci/psc.c @@ -239,7 +239,7 @@ davinci_lpsc_clk_register(struct device *dev, const char *name, int ret; bool is_on; - lpsc = kzalloc(sizeof(*lpsc), GFP_KERNEL); + lpsc = kzalloc_obj(*lpsc, GFP_KERNEL); if (!lpsc) return ERR_PTR(-ENOMEM); @@ -372,11 +372,11 @@ __davinci_psc_register_clocks(struct device *dev, struct regmap *regmap; int i, ret; - psc = kzalloc(sizeof(*psc), GFP_KERNEL); + psc = kzalloc_obj(*psc, GFP_KERNEL); if (!psc) return ERR_PTR(-ENOMEM); - clks = kmalloc_array(num_clks, sizeof(*clks), GFP_KERNEL); + clks = kmalloc_objs(*clks, num_clks, GFP_KERNEL); if (!clks) { ret = -ENOMEM; goto err_free_psc; @@ -392,7 +392,7 @@ __davinci_psc_register_clocks(struct device *dev, for (i = 0; i < num_clks; i++) clks[i] = ERR_PTR(-ENOENT); - pm_domains = kcalloc(num_clks, sizeof(*pm_domains), GFP_KERNEL); + pm_domains = kzalloc_objs(*pm_domains, num_clks, GFP_KERNEL); if (!pm_domains) { ret = -ENOMEM; goto err_free_clks; diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c index 5d0226530fdb..069ea7b56c09 100644 --- a/drivers/clk/hisilicon/clk-hi3620.c +++ b/drivers/clk/hisilicon/clk-hi3620.c @@ -414,7 +414,7 @@ static struct clk *hisi_register_clk_mmc(struct hisi_mmc_clock *mmc_clk, struct clk *clk; struct clk_init_data init; - mclk = kzalloc(sizeof(*mclk), GFP_KERNEL); + mclk = kzalloc_obj(*mclk, GFP_KERNEL); if (!mclk) return ERR_PTR(-ENOMEM); @@ -461,11 +461,11 @@ static void __init hi3620_mmc_clk_init(struct device_node *node) return; } - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (WARN_ON(!clk_data)) return; - clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL); + clk_data->clks = kzalloc_objs(*clk_data->clks, num, GFP_KERNEL); if (!clk_data->clks) { kfree(clk_data); return; diff --git a/drivers/clk/hisilicon/clk-hix5hd2.c b/drivers/clk/hisilicon/clk-hix5hd2.c index 64bdd3f05725..31a9ab1758f1 100644 --- a/drivers/clk/hisilicon/clk-hix5hd2.c +++ b/drivers/clk/hisilicon/clk-hix5hd2.c @@ -261,7 +261,7 @@ hix5hd2_clk_register_complex(struct hix5hd2_complex_clock *clks, int nums, struct clk *clk; struct clk_init_data init; - p_clk = kzalloc(sizeof(*p_clk), GFP_KERNEL); + p_clk = kzalloc_obj(*p_clk, GFP_KERNEL); if (!p_clk) return; diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index 09368fd32bef..8b37a6310289 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -68,12 +68,12 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np, goto err; } - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) goto err; clk_data->base = base; - clk_table = kcalloc(nr_clks, sizeof(*clk_table), GFP_KERNEL); + clk_table = kzalloc_objs(*clk_table, nr_clks, GFP_KERNEL); if (!clk_table) goto err_data; diff --git a/drivers/clk/hisilicon/clkdivider-hi6220.c b/drivers/clk/hisilicon/clkdivider-hi6220.c index fd7ceb92d651..c59c2c38812b 100644 --- a/drivers/clk/hisilicon/clkdivider-hi6220.c +++ b/drivers/clk/hisilicon/clkdivider-hi6220.c @@ -109,7 +109,7 @@ struct clk *hi6220_register_clkdiv(struct device *dev, const char *name, int i; /* allocate the divider */ - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); @@ -117,7 +117,7 @@ struct clk *hi6220_register_clkdiv(struct device *dev, const char *name, max_div = div_mask(width) + 1; min_div = 1; - table = kcalloc(max_div + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, max_div + 1, GFP_KERNEL); if (!table) { kfree(div); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/hisilicon/clkgate-separated.c b/drivers/clk/hisilicon/clkgate-separated.c index 21d4297f3225..cb4fd20f7639 100644 --- a/drivers/clk/hisilicon/clkgate-separated.c +++ b/drivers/clk/hisilicon/clkgate-separated.c @@ -90,7 +90,7 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name, struct clk *clk; struct clk_init_data init; - sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); + sclk = kzalloc_obj(*sclk, GFP_KERNEL); if (!sclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imgtec/clk-boston.c b/drivers/clk/imgtec/clk-boston.c index db96f8bea630..23360ba5c852 100644 --- a/drivers/clk/imgtec/clk-boston.c +++ b/drivers/clk/imgtec/clk-boston.c @@ -58,8 +58,7 @@ static void __init clk_boston_setup(struct device_node *np) cpu_div = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_CLK1DIV); cpu_freq = mult_frac(in_freq, mul, cpu_div); - onecell = kzalloc(struct_size(onecell, hws, BOSTON_CLK_COUNT), - GFP_KERNEL); + onecell = kzalloc_flex(*onecell, hws, BOSTON_CLK_COUNT, GFP_KERNEL); if (!onecell) return; diff --git a/drivers/clk/imx/clk-busy.c b/drivers/clk/imx/clk-busy.c index eb27c6fee359..a6886a73aa24 100644 --- a/drivers/clk/imx/clk-busy.c +++ b/drivers/clk/imx/clk-busy.c @@ -82,7 +82,7 @@ struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name struct clk_init_data init; int ret; - busy = kzalloc(sizeof(*busy), GFP_KERNEL); + busy = kzalloc_obj(*busy, GFP_KERNEL); if (!busy) return ERR_PTR(-ENOMEM); @@ -162,7 +162,7 @@ struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift struct clk_init_data init; int ret; - busy = kzalloc(sizeof(*busy), GFP_KERNEL); + busy = kzalloc_obj(*busy, GFP_KERNEL); if (!busy) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index 37d2fc197be6..59c2b392db44 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -99,7 +99,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (mux_present) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); mux_hw = &mux->hw; @@ -111,7 +111,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (rate_present) { - fd = kzalloc(sizeof(*fd), GFP_KERNEL); + fd = kzalloc_obj(*fd, GFP_KERNEL); if (!fd) { kfree(mux); return ERR_PTR(-ENOMEM); @@ -128,7 +128,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (gate_present) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { kfree(mux); kfree(fd); diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index 1467d0a1b934..e5ccb6810822 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -231,7 +231,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, const struct clk_ops *mux_ops; const struct clk_ops *gate_ops; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_CAST(hw); @@ -241,7 +241,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, mux->mask = PCG_PCS_MASK; mux->lock = &imx_ccm_lock; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto free_mux; @@ -270,7 +270,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, div->flags = CLK_DIVIDER_ROUND_CLOSEST; /* skip registering the gate ops if M4 is enabled */ - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto free_div; diff --git a/drivers/clk/imx/clk-composite-93.c b/drivers/clk/imx/clk-composite-93.c index 513d74a39d3b..db006eba18f8 100644 --- a/drivers/clk/imx/clk-composite-93.c +++ b/drivers/clk/imx/clk-composite-93.c @@ -193,7 +193,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p bool clk_ro = false; u32 authen; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) goto fail; @@ -203,7 +203,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p mux->mask = CCM_MUX_MASK; mux->lock = &imx_ccm_lock; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto fail; @@ -223,7 +223,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p mux_hw, &clk_mux_ro_ops, div_hw, &clk_divider_ro_ops, NULL, NULL, flags); } else { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto fail; diff --git a/drivers/clk/imx/clk-cpu.c b/drivers/clk/imx/clk-cpu.c index 43637cb61693..e63296483504 100644 --- a/drivers/clk/imx/clk-cpu.c +++ b/drivers/clk/imx/clk-cpu.c @@ -81,7 +81,7 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name, struct clk_init_data init; int ret; - cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); + cpu = kzalloc_obj(*cpu, GFP_KERNEL); if (!cpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-divider-gate.c b/drivers/clk/imx/clk-divider-gate.c index 26b210cba9be..51042ba556d0 100644 --- a/drivers/clk/imx/clk-divider-gate.c +++ b/drivers/clk/imx/clk-divider-gate.c @@ -185,7 +185,7 @@ struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name u32 val; int ret; - div_gate = kzalloc(sizeof(*div_gate), GFP_KERNEL); + div_gate = kzalloc_obj(*div_gate, GFP_KERNEL); if (!div_gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fixup-div.c b/drivers/clk/imx/clk-fixup-div.c index aa6addbeb5a8..a90609aec218 100644 --- a/drivers/clk/imx/clk-fixup-div.c +++ b/drivers/clk/imx/clk-fixup-div.c @@ -97,7 +97,7 @@ struct clk_hw *imx_clk_hw_fixup_divider(const char *name, const char *parent, if (!fixup) return ERR_PTR(-EINVAL); - fixup_div = kzalloc(sizeof(*fixup_div), GFP_KERNEL); + fixup_div = kzalloc_obj(*fixup_div, GFP_KERNEL); if (!fixup_div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fixup-mux.c b/drivers/clk/imx/clk-fixup-mux.c index 418ac9fe2c26..b1c887fc99c4 100644 --- a/drivers/clk/imx/clk-fixup-mux.c +++ b/drivers/clk/imx/clk-fixup-mux.c @@ -77,7 +77,7 @@ struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg, if (!fixup) return ERR_PTR(-EINVAL); - fixup_mux = kzalloc(sizeof(*fixup_mux), GFP_KERNEL); + fixup_mux = kzalloc_obj(*fixup_mux, GFP_KERNEL); if (!fixup_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-frac-pll.c b/drivers/clk/imx/clk-frac-pll.c index eb668faaa38f..fba0c0f449df 100644 --- a/drivers/clk/imx/clk-frac-pll.c +++ b/drivers/clk/imx/clk-frac-pll.c @@ -213,7 +213,7 @@ struct clk_hw *imx_clk_hw_frac_pll(const char *name, struct clk_hw *hw; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c index 6de5349adf70..3cd1fd106aac 100644 --- a/drivers/clk/imx/clk-fracn-gppll.c +++ b/drivers/clk/imx/clk-fracn-gppll.c @@ -366,7 +366,7 @@ static struct clk_hw *_imx_clk_fracn_gppll(const char *name, const char *parent_ struct clk_init_data init; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gate-93.c b/drivers/clk/imx/clk-gate-93.c index ceb56b290394..0422e17a8233 100644 --- a/drivers/clk/imx/clk-gate-93.c +++ b/drivers/clk/imx/clk-gate-93.c @@ -164,7 +164,7 @@ struct clk_hw *imx93_clk_gate(struct device *dev, const char *name, const char * int ret; u32 authen; - gate = kzalloc(sizeof(struct imx93_clk_gate), GFP_KERNEL); + gate = kzalloc_obj(struct imx93_clk_gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gate-exclusive.c b/drivers/clk/imx/clk-gate-exclusive.c index 7017e9d4e188..2f0db88cbbcf 100644 --- a/drivers/clk/imx/clk-gate-exclusive.c +++ b/drivers/clk/imx/clk-gate-exclusive.c @@ -67,7 +67,7 @@ struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent, if (exclusive_mask == 0) return ERR_PTR(-EINVAL); - exgate = kzalloc(sizeof(*exgate), GFP_KERNEL); + exgate = kzalloc_obj(*exgate, GFP_KERNEL); if (!exgate) return ERR_PTR(-ENOMEM); gate = &exgate->gate; diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c index f16c4019f402..d57c146a66cf 100644 --- a/drivers/clk/imx/clk-gate2.c +++ b/drivers/clk/imx/clk-gate2.c @@ -144,7 +144,7 @@ struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name, struct clk_init_data init; int ret; - gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate2, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gpr-mux.c b/drivers/clk/imx/clk-gpr-mux.c index 0e14b61cba84..01f7142e7a98 100644 --- a/drivers/clk/imx/clk-gpr-mux.c +++ b/drivers/clk/imx/clk-gpr-mux.c @@ -87,7 +87,7 @@ struct clk_hw *imx_clk_gpr_mux(const char *name, const char *compatible, return ERR_CAST(regmap); } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index bf4c1d9c9928..7d8a811e5de4 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -439,8 +439,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) void __iomem *anatop_base, *base; int ret; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX6QDL_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX6QDL_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c index 47b8667cfa3f..de7392fb59a4 100644 --- a/drivers/clk/imx/clk-imx6sl.c +++ b/drivers/clk/imx/clk-imx6sl.c @@ -185,8 +185,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) void __iomem *base; int ret; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX6SL_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX6SL_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx6sll.c b/drivers/clk/imx/clk-imx6sll.c index 2fa70bf35e45..96c1fbb74d82 100644 --- a/drivers/clk/imx/clk-imx6sll.c +++ b/drivers/clk/imx/clk-imx6sll.c @@ -81,8 +81,8 @@ static void __init imx6sll_clocks_init(struct device_node *ccm_node) struct device_node *np; void __iomem *base; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX6SLL_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX6SLL_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c index 69f8f6f9ca49..c96606f76947 100644 --- a/drivers/clk/imx/clk-imx6sx.c +++ b/drivers/clk/imx/clk-imx6sx.c @@ -123,8 +123,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) void __iomem *base; bool lcdif1_assigned_clk; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX6SX_CLK_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX6SX_CLK_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index 05c7a82b751f..4ccc272b3c4f 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -130,8 +130,8 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) struct device_node *np; void __iomem *base; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX6UL_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX6UL_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c index 99adc55e3f5d..21c6daa221cc 100644 --- a/drivers/clk/imx/clk-imx7d.c +++ b/drivers/clk/imx/clk-imx7d.c @@ -382,8 +382,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) struct device_node *np; void __iomem *base; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX7D_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX7D_CLK_END, GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return; diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c index f4a48a42637f..322c84d49f44 100644 --- a/drivers/clk/imx/clk-imx7ulp.c +++ b/drivers/clk/imx/clk-imx7ulp.c @@ -49,8 +49,8 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) struct clk_hw **hws; void __iomem *base; - clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_SCG1_END), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, IMX7ULP_CLK_SCG1_END, + GFP_KERNEL); if (!clk_data) return; @@ -138,8 +138,8 @@ static void __init imx7ulp_clk_pcc2_init(struct device_node *np) struct clk_hw **hws; void __iomem *base; - clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_PCC2_END), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, IMX7ULP_CLK_PCC2_END, + GFP_KERNEL); if (!clk_data) return; @@ -186,8 +186,8 @@ static void __init imx7ulp_clk_pcc3_init(struct device_node *np) struct clk_hw **hws; void __iomem *base; - clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_PCC3_END), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, IMX7ULP_CLK_PCC3_END, + GFP_KERNEL); if (!clk_data) return; @@ -233,8 +233,8 @@ static void __init imx7ulp_clk_smc1_init(struct device_node *np) struct clk_hw **hws; void __iomem *base; - clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_SMC1_END), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, IMX7ULP_CLK_SMC1_END, + GFP_KERNEL); if (!clk_data) return; diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index 342049b847b9..fb9b199ff289 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -303,8 +303,8 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) void __iomem *base; int ret; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX8MM_CLK_END), GFP_KERNEL); + clk_hw_data = kzalloc_flex(*clk_hw_data, hws, IMX8MM_CLK_END, + GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return -ENOMEM; diff --git a/drivers/clk/imx/clk-lpcg-scu.c b/drivers/clk/imx/clk-lpcg-scu.c index 6376557a3c3d..9e1247bb1edd 100644 --- a/drivers/clk/imx/clk-lpcg-scu.c +++ b/drivers/clk/imx/clk-lpcg-scu.c @@ -119,7 +119,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name, struct clk_hw *hw; int ret; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c index 31220fa7882b..5222e5ee37d1 100644 --- a/drivers/clk/imx/clk-pfd.c +++ b/drivers/clk/imx/clk-pfd.c @@ -132,7 +132,7 @@ struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name, struct clk_init_data init; int ret; - pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); + pfd = kzalloc_obj(*pfd, GFP_KERNEL); if (!pfd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c index 6ca53a960eb7..ce37a151c745 100644 --- a/drivers/clk/imx/clk-pfdv2.c +++ b/drivers/clk/imx/clk-pfdv2.c @@ -210,7 +210,7 @@ struct clk_hw *imx_clk_hw_pfdv2(enum imx_pfdv2_type type, const char *name, WARN_ON(idx > 3); - pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); + pfd = kzalloc_obj(*pfd, GFP_KERNEL); if (!pfd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index 36d0e80b55b8..33974d762e4d 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -504,7 +504,7 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, int ret; u32 val; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv1.c b/drivers/clk/imx/clk-pllv1.c index 93ee81b28fc7..502f29d44f52 100644 --- a/drivers/clk/imx/clk-pllv1.c +++ b/drivers/clk/imx/clk-pllv1.c @@ -119,7 +119,7 @@ struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, struct clk_init_data init; int ret; - pll = kmalloc(sizeof(*pll), GFP_KERNEL); + pll = kmalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c index bb497ad5e0ae..1faa289b8e69 100644 --- a/drivers/clk/imx/clk-pllv2.c +++ b/drivers/clk/imx/clk-pllv2.c @@ -254,7 +254,7 @@ struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent, struct clk_init_data init; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c index b99508367bcb..78d40dad7b4a 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -426,7 +426,7 @@ struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name, struct clk_init_data init; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv4.c b/drivers/clk/imx/clk-pllv4.c index 01d05b5d5438..d7a4e9ed55b3 100644 --- a/drivers/clk/imx/clk-pllv4.c +++ b/drivers/clk/imx/clk-pllv4.c @@ -251,7 +251,7 @@ struct clk_hw *imx_clk_hw_pllv4(enum imx_pllv4_type type, const char *name, struct clk_init_data init; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index 34c9dc1fb20e..9ec9fe99c391 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -457,7 +457,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name, struct clk_hw *hw; int ret; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); @@ -856,7 +856,7 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na if (rsrc_id >= IMX_SC_R_LAST || gpr_id >= IMX_SC_C_LAST) return ERR_PTR(-EINVAL); - clk_node = kzalloc(sizeof(*clk_node), GFP_KERNEL); + clk_node = kzalloc_obj(*clk_node, GFP_KERNEL); if (!clk_node) return ERR_PTR(-ENOMEM); @@ -870,7 +870,7 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na return NULL; } - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) { kfree(clk_node); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-sscg-pll.c b/drivers/clk/imx/clk-sscg-pll.c index 81f304fae908..4017b194e085 100644 --- a/drivers/clk/imx/clk-sscg-pll.c +++ b/drivers/clk/imx/clk-sscg-pll.c @@ -509,7 +509,7 @@ struct clk_hw *imx_clk_hw_sscg_pll(const char *name, struct clk_hw *hw; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index df83bd939492..c9c8397e9149 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -189,7 +189,7 @@ void imx_register_uart_clocks(void) if (!of_stdout) return; - imx_uart_clocks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); + imx_uart_clocks = kzalloc_objs(struct clk *, num, GFP_KERNEL); if (!imx_uart_clocks) return; diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c index 91e7ac0cc334..69055ef880eb 100644 --- a/drivers/clk/ingenic/cgu.c +++ b/drivers/clk/ingenic/cgu.c @@ -676,7 +676,7 @@ static int ingenic_register_clock(struct ingenic_cgu *cgu, unsigned idx) goto out; } - ingenic_clk = kzalloc(sizeof(*ingenic_clk), GFP_KERNEL); + ingenic_clk = kzalloc_obj(*ingenic_clk, GFP_KERNEL); if (!ingenic_clk) { err = -ENOMEM; goto out; @@ -790,7 +790,7 @@ ingenic_cgu_new(const struct ingenic_cgu_clk_info *clock_info, { struct ingenic_cgu *cgu; - cgu = kzalloc(sizeof(*cgu), GFP_KERNEL); + cgu = kzalloc_obj(*cgu, GFP_KERNEL); if (!cgu) goto err_out; @@ -819,8 +819,8 @@ int ingenic_cgu_register_clocks(struct ingenic_cgu *cgu) unsigned i; int err; - cgu->clocks.clks = kcalloc(cgu->clocks.clk_num, sizeof(struct clk *), - GFP_KERNEL); + cgu->clocks.clks = kzalloc_objs(struct clk *, cgu->clocks.clk_num, + GFP_KERNEL); if (!cgu->clocks.clks) { err = -ENOMEM; goto err_out; diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c index bc6a51da2072..6ae7c2f66824 100644 --- a/drivers/clk/ingenic/tcu.c +++ b/drivers/clk/ingenic/tcu.c @@ -273,7 +273,7 @@ static int __init ingenic_tcu_register_clock(struct ingenic_tcu *tcu, struct ingenic_tcu_clk *tcu_clk; int err; - tcu_clk = kzalloc(sizeof(*tcu_clk), GFP_KERNEL); + tcu_clk = kzalloc_obj(*tcu_clk, GFP_KERNEL); if (!tcu_clk) return -ENOMEM; @@ -344,7 +344,7 @@ static int __init ingenic_tcu_probe(struct device_node *np) if (IS_ERR(map)) return PTR_ERR(map); - tcu = kzalloc(sizeof(*tcu), GFP_KERNEL); + tcu = kzalloc_obj(*tcu, GFP_KERNEL); if (!tcu) return -ENOMEM; @@ -379,8 +379,7 @@ static int __init ingenic_tcu_probe(struct device_node *np) } } - tcu->clocks = kzalloc(struct_size(tcu->clocks, hws, TCU_CLK_COUNT), - GFP_KERNEL); + tcu->clocks = kzalloc_flex(*tcu->clocks, hws, TCU_CLK_COUNT, GFP_KERNEL); if (!tcu->clocks) { ret = -ENOMEM; goto err_clk_disable; diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c index 13ea047489eb..dff8ed64df85 100644 --- a/drivers/clk/keystone/gate.c +++ b/drivers/clk/keystone/gate.c @@ -168,7 +168,7 @@ static struct clk *clk_register_psc(struct device *dev, struct clk_psc *psc; struct clk *clk; - psc = kzalloc(sizeof(*psc), GFP_KERNEL); + psc = kzalloc_obj(*psc, GFP_KERNEL); if (!psc) return ERR_PTR(-ENOMEM); @@ -202,7 +202,7 @@ static void __init of_psc_clk_init(struct device_node *node, spinlock_t *lock) struct clk *clk; int i; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { pr_err("%s: Out of memory\n", __func__); return; diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c index 6bbdd4705d71..9cdf1ecad45c 100644 --- a/drivers/clk/keystone/pll.c +++ b/drivers/clk/keystone/pll.c @@ -126,7 +126,7 @@ static struct clk *clk_register_pll(struct device *dev, struct clk_pll *pll; struct clk *clk; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -162,7 +162,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl) struct clk *clk; int i; - pll_data = kzalloc(sizeof(*pll_data), GFP_KERNEL); + pll_data = kzalloc_obj(*pll_data, GFP_KERNEL); if (!pll_data) { pr_err("%s: Out of memory\n", __func__); return; diff --git a/drivers/clk/mediatek/clk-apmixed.c b/drivers/clk/mediatek/clk-apmixed.c index 60e34f124250..43c72621f4c9 100644 --- a/drivers/clk/mediatek/clk-apmixed.c +++ b/drivers/clk/mediatek/clk-apmixed.c @@ -77,7 +77,7 @@ struct clk_hw *mtk_clk_register_ref2usb_tx(const char *name, struct clk_init_data init = {}; int ret; - tx = kzalloc(sizeof(*tx), GFP_KERNEL); + tx = kzalloc_obj(*tx, GFP_KERNEL); if (!tx) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c index a03826db4dcb..abcc1c41a6f9 100644 --- a/drivers/clk/mediatek/clk-cpumux.c +++ b/drivers/clk/mediatek/clk-cpumux.c @@ -66,7 +66,7 @@ mtk_clk_register_cpumux(struct device *dev, const struct mtk_composite *mux, int ret; struct clk_init_data init; - cpumux = kzalloc(sizeof(*cpumux), GFP_KERNEL); + cpumux = kzalloc_obj(*cpumux, GFP_KERNEL); if (!cpumux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c index f6b1429ff757..3689ec69da5d 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c @@ -212,7 +212,7 @@ static struct clk_hw *mtk_clk_register_gate(struct device *dev, int ret; struct clk_init_data init = {}; - cg = kzalloc(sizeof(*cg), GFP_KERNEL); + cg = kzalloc_obj(*cg, GFP_KERNEL); if (!cg) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index deafe55a96cb..de093f9665af 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -67,7 +67,7 @@ struct clk_hw_onecell_data *mtk_alloc_clk_data(unsigned int clk_num) { struct clk_hw_onecell_data *clk_data; - clk_data = kzalloc(struct_size(clk_data, hws, clk_num), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, clk_num, GFP_KERNEL); if (!clk_data) return NULL; @@ -230,7 +230,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, int ret; if (mc->mux_shift >= 0) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -251,7 +251,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, } if (mc->gate_shift >= 0) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { ret = -ENOMEM; goto err_out; @@ -267,7 +267,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, } if (mc->divider_shift >= 0) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) { ret = -ENOMEM; goto err_out; diff --git a/drivers/clk/mediatek/clk-mux.c b/drivers/clk/mediatek/clk-mux.c index c5af6dc078a3..0cc6de7ab29b 100644 --- a/drivers/clk/mediatek/clk-mux.c +++ b/drivers/clk/mediatek/clk-mux.c @@ -281,7 +281,7 @@ static struct clk_hw *mtk_clk_register_mux(struct device *dev, struct clk_init_data init = {}; int ret; - clk_mux = kzalloc(sizeof(*clk_mux), GFP_KERNEL); + clk_mux = kzalloc_obj(*clk_mux, GFP_KERNEL); if (!clk_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index 0f3759fcd9d0..ff414d9b560a 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -385,7 +385,7 @@ struct clk_hw *mtk_clk_register_pll(struct device *dev, struct clk_hw *hw; const struct clk_ops *pll_ops = data->ops ? data->ops : &mtk_pll_ops; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-pllfh.c b/drivers/clk/mediatek/clk-pllfh.c index 8ad11023d911..6b9f43ddd57f 100644 --- a/drivers/clk/mediatek/clk-pllfh.c +++ b/drivers/clk/mediatek/clk-pllfh.c @@ -157,7 +157,7 @@ mtk_clk_register_pllfh(struct device *dev, const struct mtk_pll_data *pll_data, struct mtk_fh *fh; int ret; - fh = kzalloc(sizeof(*fh), GFP_KERNEL); + fh = kzalloc_obj(*fh, GFP_KERNEL); if (!fh) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 95d0b9cbd904..d56be70ab02f 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -3646,7 +3646,7 @@ static void __init meson8b_clkc_init_common(struct device_node *np, return; } - rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); + rstc = kzalloc_obj(*rstc, GFP_KERNEL); if (!rstc) return; diff --git a/drivers/clk/mmp/clk-apbc.c b/drivers/clk/mmp/clk-apbc.c index 23c43a46604e..1d6fd5e5d6c0 100644 --- a/drivers/clk/mmp/clk-apbc.c +++ b/drivers/clk/mmp/clk-apbc.c @@ -124,7 +124,7 @@ struct clk *mmp_clk_register_apbc(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - apbc = kzalloc(sizeof(*apbc), GFP_KERNEL); + apbc = kzalloc_obj(*apbc, GFP_KERNEL); if (!apbc) return NULL; diff --git a/drivers/clk/mmp/clk-apmu.c b/drivers/clk/mmp/clk-apmu.c index 9313428b083a..e457436c522c 100644 --- a/drivers/clk/mmp/clk-apmu.c +++ b/drivers/clk/mmp/clk-apmu.c @@ -69,7 +69,7 @@ struct clk *mmp_clk_register_apmu(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - apmu = kzalloc(sizeof(*apmu), GFP_KERNEL); + apmu = kzalloc_obj(*apmu, GFP_KERNEL); if (!apmu) return NULL; diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c index 0b1bb01346f0..4307698741c6 100644 --- a/drivers/clk/mmp/clk-frac.c +++ b/drivers/clk/mmp/clk-frac.c @@ -180,7 +180,7 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name, return ERR_PTR(-EINVAL); } - factor = kzalloc(sizeof(*factor), GFP_KERNEL); + factor = kzalloc_obj(*factor, GFP_KERNEL); if (!factor) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-gate.c b/drivers/clk/mmp/clk-gate.c index 6855815ee8be..59f4070be33c 100644 --- a/drivers/clk/mmp/clk-gate.c +++ b/drivers/clk/mmp/clk-gate.c @@ -99,7 +99,7 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name, struct clk_init_data init; /* allocate the gate */ - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c index 07ac9e6937e5..14aa90342664 100644 --- a/drivers/clk/mmp/clk-mix.c +++ b/drivers/clk/mmp/clk-mix.c @@ -448,7 +448,7 @@ struct clk *mmp_clk_register_mix(struct device *dev, struct clk *clk; struct clk_init_data init; - mix = kzalloc(sizeof(*mix), GFP_KERNEL); + mix = kzalloc_obj(*mix, GFP_KERNEL); if (!mix) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c index a4f15cee630e..2067b4bb261d 100644 --- a/drivers/clk/mmp/clk-of-mmp2.c +++ b/drivers/clk/mmp/clk-of-mmp2.c @@ -462,7 +462,7 @@ static void mmp2_clk_reset_init(struct device_node *np, int i, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kcalloc(nr_resets, sizeof(*cells), GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); if (!cells) return; @@ -516,7 +516,7 @@ static void __init mmp2_clk_init(struct device_node *np) { struct mmp2_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa168.c b/drivers/clk/mmp/clk-of-pxa168.c index 5f250427e60d..f5b8a6749829 100644 --- a/drivers/clk/mmp/clk-of-pxa168.c +++ b/drivers/clk/mmp/clk-of-pxa168.c @@ -282,7 +282,7 @@ static void pxa168_clk_reset_init(struct device_node *np, int i, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kcalloc(nr_resets, sizeof(*cells), GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); if (!cells) return; @@ -301,7 +301,7 @@ static void __init pxa168_clk_init(struct device_node *np) { struct pxa168_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa1928.c b/drivers/clk/mmp/clk-of-pxa1928.c index ebb6e278eda3..24fc9054a667 100644 --- a/drivers/clk/mmp/clk-of-pxa1928.c +++ b/drivers/clk/mmp/clk-of-pxa1928.c @@ -187,7 +187,7 @@ static void pxa1928_clk_reset_init(struct device_node *np, int i, base, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kcalloc(nr_resets, sizeof(*cells), GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); if (!cells) return; @@ -208,7 +208,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; @@ -227,7 +227,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; @@ -248,7 +248,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa910.c b/drivers/clk/mmp/clk-of-pxa910.c index fe65e7bdb411..43c40b949326 100644 --- a/drivers/clk/mmp/clk-of-pxa910.c +++ b/drivers/clk/mmp/clk-of-pxa910.c @@ -239,7 +239,7 @@ static void pxa910_clk_reset_init(struct device_node *np, nr_resets_apbc = ARRAY_SIZE(apbc_gate_clks); nr_resets_apbcp = ARRAY_SIZE(apbcp_gate_clks); nr_resets = nr_resets_apbc + nr_resets_apbcp; - cells = kcalloc(nr_resets, sizeof(*cells), GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); if (!cells) return; @@ -270,7 +270,7 @@ static void __init pxa910_clk_init(struct device_node *np) { struct pxa910_clk_unit *pxa_unit; - pxa_unit = kzalloc(sizeof(*pxa_unit), GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-pll.c b/drivers/clk/mmp/clk-pll.c index 962014cfdc44..bf2d691fcc92 100644 --- a/drivers/clk/mmp/clk-pll.c +++ b/drivers/clk/mmp/clk-pll.c @@ -108,7 +108,7 @@ static struct clk *mmp_clk_register_pll(char *name, struct clk *clk; struct clk_init_data init; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk.c b/drivers/clk/mmp/clk.c index ca7d37e2c7be..c31c3a9f4f57 100644 --- a/drivers/clk/mmp/clk.c +++ b/drivers/clk/mmp/clk.c @@ -12,7 +12,7 @@ void mmp_clk_init(struct device_node *np, struct mmp_clk_unit *unit, { struct clk **clk_table; - clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); + clk_table = kzalloc_objs(struct clk *, nr_clks, GFP_KERNEL); if (!clk_table) return; diff --git a/drivers/clk/mmp/pwr-island.c b/drivers/clk/mmp/pwr-island.c index eaf5d2c5e593..1253e383aa44 100644 --- a/drivers/clk/mmp/pwr-island.c +++ b/drivers/clk/mmp/pwr-island.c @@ -95,7 +95,7 @@ struct generic_pm_domain *mmp_pm_domain_register(const char *name, { struct mmp_pm_domain *pm_domain; - pm_domain = kzalloc(sizeof(*pm_domain), GFP_KERNEL); + pm_domain = kzalloc_obj(*pm_domain, GFP_KERNEL); if (!pm_domain) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/reset.c b/drivers/clk/mmp/reset.c index ded7e391c737..c7068976a378 100644 --- a/drivers/clk/mmp/reset.c +++ b/drivers/clk/mmp/reset.c @@ -85,7 +85,7 @@ void mmp_clk_reset_register(struct device_node *np, { struct mmp_clk_reset_unit *unit; - unit = kzalloc(sizeof(*unit), GFP_KERNEL); + unit = kzalloc_obj(*unit, GFP_KERNEL); if (!unit) return; diff --git a/drivers/clk/mvebu/clk-corediv.c b/drivers/clk/mvebu/clk-corediv.c index 628032341cbb..487542d61662 100644 --- a/drivers/clk/mvebu/clk-corediv.c +++ b/drivers/clk/mvebu/clk-corediv.c @@ -270,13 +270,11 @@ mvebu_corediv_clk_init(struct device_node *node, clk_data.clk_num = soc_desc->ndescs; /* clks holds the clock array */ - clks = kcalloc(clk_data.clk_num, sizeof(struct clk *), - GFP_KERNEL); + clks = kzalloc_objs(struct clk *, clk_data.clk_num, GFP_KERNEL); if (WARN_ON(!clks)) goto err_unmap; /* corediv holds the clock specific array */ - corediv = kcalloc(clk_data.clk_num, sizeof(struct clk_corediv), - GFP_KERNEL); + corediv = kzalloc_objs(struct clk_corediv, clk_data.clk_num, GFP_KERNEL); if (WARN_ON(!corediv)) goto err_free_clks; diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index 0de7660e73d2..8c74edbcce9a 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c @@ -183,11 +183,11 @@ static void __init of_cpu_clk_setup(struct device_node *node) pr_warn("%s: pmu-dfs base register not set, dynamic frequency scaling not available\n", __func__); - cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL); + cpuclk = kzalloc_objs(*cpuclk, ncpus, GFP_KERNEL); if (WARN_ON(!cpuclk)) goto cpuclk_out; - clks = kcalloc(ncpus, sizeof(*clks), GFP_KERNEL); + clks = kzalloc_objs(*clks, ncpus, GFP_KERNEL); if (WARN_ON(!clks)) goto clks_out; diff --git a/drivers/clk/mvebu/common.c b/drivers/clk/mvebu/common.c index 5adbbd91a6db..41c5cd7739b2 100644 --- a/drivers/clk/mvebu/common.c +++ b/drivers/clk/mvebu/common.c @@ -124,8 +124,8 @@ void __init mvebu_coreclk_setup(struct device_node *np, if (desc->get_refclk_freq) clk_data.clk_num += 1; - clk_data.clks = kcalloc(clk_data.clk_num, sizeof(*clk_data.clks), - GFP_KERNEL); + clk_data.clks = kzalloc_objs(*clk_data.clks, clk_data.clk_num, + GFP_KERNEL); if (WARN_ON(!clk_data.clks)) { iounmap(base); return; @@ -258,7 +258,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, clk_put(clk); } - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (WARN_ON(!ctrl)) goto ctrl_out; @@ -272,8 +272,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, n++; ctrl->num_gates = n; - ctrl->gates = kcalloc(ctrl->num_gates, sizeof(*ctrl->gates), - GFP_KERNEL); + ctrl->gates = kzalloc_objs(*ctrl->gates, ctrl->num_gates, GFP_KERNEL); if (WARN_ON(!ctrl->gates)) goto gates_out; diff --git a/drivers/clk/mvebu/cp110-system-controller.c b/drivers/clk/mvebu/cp110-system-controller.c index b47c86906046..c6b5b2205f2e 100644 --- a/drivers/clk/mvebu/cp110-system-controller.c +++ b/drivers/clk/mvebu/cp110-system-controller.c @@ -180,7 +180,7 @@ static struct clk_hw *cp110_register_gate(const char *name, struct clk_init_data init; int ret; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mvebu/kirkwood.c b/drivers/clk/mvebu/kirkwood.c index 8bc893df4736..967f0be794ab 100644 --- a/drivers/clk/mvebu/kirkwood.c +++ b/drivers/clk/mvebu/kirkwood.c @@ -297,7 +297,7 @@ static void __init kirkwood_clk_muxing_setup(struct device_node *np, if (WARN_ON(!base)) return; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (WARN_ON(!ctrl)) goto ctrl_out; @@ -309,8 +309,7 @@ static void __init kirkwood_clk_muxing_setup(struct device_node *np, n++; ctrl->num_muxes = n; - ctrl->muxes = kcalloc(ctrl->num_muxes, sizeof(struct clk *), - GFP_KERNEL); + ctrl->muxes = kzalloc_objs(struct clk *, ctrl->num_muxes, GFP_KERNEL); if (WARN_ON(!ctrl->muxes)) goto muxes_out; diff --git a/drivers/clk/mxs/clk-div.c b/drivers/clk/mxs/clk-div.c index 8afe1a9c1552..47c5c2fe8e5e 100644 --- a/drivers/clk/mxs/clk-div.c +++ b/drivers/clk/mxs/clk-div.c @@ -74,7 +74,7 @@ struct clk *mxs_clk_div(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-frac.c b/drivers/clk/mxs/clk-frac.c index 73f514fb84ff..7de0c20baabb 100644 --- a/drivers/clk/mxs/clk-frac.c +++ b/drivers/clk/mxs/clk-frac.c @@ -116,7 +116,7 @@ struct clk *mxs_clk_frac(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - frac = kzalloc(sizeof(*frac), GFP_KERNEL); + frac = kzalloc_obj(*frac, GFP_KERNEL); if (!frac) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-pll.c b/drivers/clk/mxs/clk-pll.c index 431cf6f2c936..f67bfe743479 100644 --- a/drivers/clk/mxs/clk-pll.c +++ b/drivers/clk/mxs/clk-pll.c @@ -86,7 +86,7 @@ struct clk *mxs_clk_pll(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-ref.c b/drivers/clk/mxs/clk-ref.c index a99ee4cd2ece..e6674fb58add 100644 --- a/drivers/clk/mxs/clk-ref.c +++ b/drivers/clk/mxs/clk-ref.c @@ -117,7 +117,7 @@ struct clk *mxs_clk_ref(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/nxp/clk-lpc18xx-ccu.c b/drivers/clk/nxp/clk-lpc18xx-ccu.c index 751b786d73f8..8bb5a44c9b59 100644 --- a/drivers/clk/nxp/clk-lpc18xx-ccu.c +++ b/drivers/clk/nxp/clk-lpc18xx-ccu.c @@ -208,7 +208,7 @@ static void lpc18xx_ccu_register_branch_gate_div(struct lpc18xx_clk_branch *bran struct clk_hw *div_hw = NULL; if (branch->flags & CCU_BRANCH_HAVE_DIV2) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return; @@ -274,7 +274,7 @@ static void __init lpc18xx_ccu_init(struct device_node *np) return; } - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) { iounmap(reg_base); return; diff --git a/drivers/clk/pistachio/clk-pll.c b/drivers/clk/pistachio/clk-pll.c index d05337915e2b..dd4fe9a114a7 100644 --- a/drivers/clk/pistachio/clk-pll.c +++ b/drivers/clk/pistachio/clk-pll.c @@ -457,7 +457,7 @@ static struct clk *pll_register(const char *name, const char *parent_name, struct clk_init_data init; struct clk *clk; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/pistachio/clk.c b/drivers/clk/pistachio/clk.c index 23d076a2b133..80f60f2ce7de 100644 --- a/drivers/clk/pistachio/clk.c +++ b/drivers/clk/pistachio/clk.c @@ -17,11 +17,11 @@ pistachio_clk_alloc_provider(struct device_node *node, unsigned int num_clks) { struct pistachio_clk_provider *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return p; - p->clk_data.clks = kcalloc(num_clks, sizeof(struct clk *), GFP_KERNEL); + p->clk_data.clks = kzalloc_objs(struct clk *, num_clks, GFP_KERNEL); if (!p->clk_data.clks) goto free_provider; p->clk_data.clk_num = num_clks; diff --git a/drivers/clk/pxa/clk-pxa.c b/drivers/clk/pxa/clk-pxa.c index ebee2afd05de..1c5dedaefec8 100644 --- a/drivers/clk/pxa/clk-pxa.c +++ b/drivers/clk/pxa/clk-pxa.c @@ -104,7 +104,7 @@ int __init clk_pxa_cken_init(const struct desc_clk_cken *clks, struct clk *clk; for (i = 0; i < nb_clks; i++) { - pxa_clk = kzalloc(sizeof(*pxa_clk), GFP_KERNEL); + pxa_clk = kzalloc_obj(*pxa_clk, GFP_KERNEL); if (!pxa_clk) return -ENOMEM; pxa_clk->is_in_low_power = clks[i].is_in_low_power; diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index d0a5847f9111..0977b61f242e 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -1650,7 +1650,7 @@ static int clk_rcg2_dfs_populate_freq_table(struct clk_rcg2 *rcg) int i; /* Allocate space for 1 extra since table is NULL terminated */ - freq_tbl = kcalloc(MAX_PERF_LEVEL + 1, sizeof(*freq_tbl), GFP_KERNEL); + freq_tbl = kzalloc_objs(*freq_tbl, MAX_PERF_LEVEL + 1, GFP_KERNEL); if (!freq_tbl) return -ENOMEM; rcg->freq_tbl = freq_tbl; diff --git a/drivers/clk/ralink/clk-mt7621.c b/drivers/clk/ralink/clk-mt7621.c index 92d14350c4b3..3079d7ce0e57 100644 --- a/drivers/clk/ralink/clk-mt7621.c +++ b/drivers/clk/ralink/clk-mt7621.c @@ -354,7 +354,7 @@ static void __init mt7621_clk_init(struct device_node *node) struct clk_hw_onecell_data *clk_data; int ret, i, count; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return; @@ -372,7 +372,7 @@ static void __init mt7621_clk_init(struct device_node *node) count = ARRAY_SIZE(mt7621_clks_base) + ARRAY_SIZE(mt7621_fixed_clks) + ARRAY_SIZE(mt7621_gates); - clk_data = kzalloc(struct_size(clk_data, hws, count), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, count, GFP_KERNEL); if (!clk_data) goto free_clk_priv; diff --git a/drivers/clk/ralink/clk-mtmips.c b/drivers/clk/ralink/clk-mtmips.c index 19d433034884..c6ee73a8fa22 100644 --- a/drivers/clk/ralink/clk-mtmips.c +++ b/drivers/clk/ralink/clk-mtmips.c @@ -916,7 +916,7 @@ static void __init mtmips_clk_init(struct device_node *node) struct clk_hw_onecell_data *clk_data; int ret, i, count; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return; @@ -936,7 +936,7 @@ static void __init mtmips_clk_init(struct device_node *node) priv->data = data; count = priv->data->num_clk_base + priv->data->num_clk_fixed + priv->data->num_clk_factor + priv->data->num_clk_periph; - clk_data = kzalloc(struct_size(clk_data, hws, count), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, count, GFP_KERNEL); if (!clk_data) goto free_clk_priv; diff --git a/drivers/clk/renesas/clk-div6.c b/drivers/clk/renesas/clk-div6.c index f7b827b5e9b2..051515695c52 100644 --- a/drivers/clk/renesas/clk-div6.c +++ b/drivers/clk/renesas/clk-div6.c @@ -251,7 +251,7 @@ struct clk * __init cpg_div6_register(const char *name, struct clk *clk; unsigned int i; - clock = kzalloc(struct_size(clock, parents, num_parents), GFP_KERNEL); + clock = kzalloc_flex(*clock, parents, num_parents, GFP_KERNEL); if (!clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c index 2f65fe2c6bdf..79414c2c2e9c 100644 --- a/drivers/clk/renesas/clk-mstp.c +++ b/drivers/clk/renesas/clk-mstp.c @@ -150,7 +150,7 @@ static struct clk * __init cpg_mstp_clock_register(const char *name, struct mstp_clock *clock; struct clk *clk; - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) return ERR_PTR(-ENOMEM); @@ -184,7 +184,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np) struct clk **clks; unsigned int i; - group = kzalloc(struct_size(group, clks, MSTP_MAX_CLOCKS), GFP_KERNEL); + group = kzalloc_flex(*group, clks, MSTP_MAX_CLOCKS, GFP_KERNEL); if (!group) return; @@ -316,7 +316,7 @@ void __init cpg_mstp_add_clk_domain(struct device_node *np) return; } - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return; diff --git a/drivers/clk/renesas/clk-r8a73a4.c b/drivers/clk/renesas/clk-r8a73a4.c index f331d8bc9daf..708506671a78 100644 --- a/drivers/clk/renesas/clk-r8a73a4.c +++ b/drivers/clk/renesas/clk-r8a73a4.c @@ -196,8 +196,8 @@ static void __init r8a73a4_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); - clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); + cpg = kzalloc_obj(*cpg, GFP_KERNEL); + clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7740.c b/drivers/clk/renesas/clk-r8a7740.c index 22e9be7240bb..f4c4ef44cff9 100644 --- a/drivers/clk/renesas/clk-r8a7740.c +++ b/drivers/clk/renesas/clk-r8a7740.c @@ -155,8 +155,8 @@ static void __init r8a7740_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); - clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); + cpg = kzalloc_obj(*cpg, GFP_KERNEL); + clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c index 6ea173f22251..2f664c7efba5 100644 --- a/drivers/clk/renesas/clk-r8a7778.c +++ b/drivers/clk/renesas/clk-r8a7778.c @@ -92,8 +92,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np) return; } - data = kzalloc(sizeof(*data), GFP_KERNEL); - clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); + clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); if (data == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7779.c b/drivers/clk/renesas/clk-r8a7779.c index 9a2fea8cf4d7..9243848863f2 100644 --- a/drivers/clk/renesas/clk-r8a7779.c +++ b/drivers/clk/renesas/clk-r8a7779.c @@ -128,8 +128,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np) return; } - data = kzalloc(sizeof(*data), GFP_KERNEL); - clks = kcalloc(CPG_NUM_CLOCKS, sizeof(*clks), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); + clks = kzalloc_objs(*clks, CPG_NUM_CLOCKS, GFP_KERNEL); if (data == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-rz.c b/drivers/clk/renesas/clk-rz.c index e770f09a27ed..0a89be1fce79 100644 --- a/drivers/clk/renesas/clk-rz.c +++ b/drivers/clk/renesas/clk-rz.c @@ -91,8 +91,8 @@ static void __init rz_cpg_clocks_init(struct device_node *np) if (WARN(num_clks <= 0, "can't count CPG clocks\n")) return; - data = kzalloc(sizeof(*data), GFP_KERNEL); - clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); + clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); BUG_ON(!data || !clks); data->clks = clks; diff --git a/drivers/clk/renesas/clk-sh73a0.c b/drivers/clk/renesas/clk-sh73a0.c index 47fc99ccd283..a3bbd8a0ac4d 100644 --- a/drivers/clk/renesas/clk-sh73a0.c +++ b/drivers/clk/renesas/clk-sh73a0.c @@ -170,8 +170,8 @@ static void __init sh73a0_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); - clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); + cpg = kzalloc_obj(*cpg, GFP_KERNEL); + clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c index 0f5c91b5dfa9..58255bf6da83 100644 --- a/drivers/clk/renesas/r9a06g032-clocks.c +++ b/drivers/clk/renesas/r9a06g032-clocks.c @@ -891,7 +891,7 @@ r9a06g032_register_gate(struct r9a06g032_priv *clocks, struct r9a06g032_clk_gate *g; struct clk_init_data init = {}; - g = kzalloc(sizeof(*g), GFP_KERNEL); + g = kzalloc_obj(*g, GFP_KERNEL); if (!g) return NULL; @@ -1063,7 +1063,7 @@ r9a06g032_register_div(struct r9a06g032_priv *clocks, struct clk_init_data init = {}; unsigned int i; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return NULL; @@ -1149,7 +1149,7 @@ r9a06g032_register_bitsel(struct r9a06g032_priv *clocks, const char *names[2]; /* allocate the gate */ - g = kzalloc(sizeof(*g), GFP_KERNEL); + g = kzalloc_obj(*g, GFP_KERNEL); if (!g) return NULL; @@ -1239,7 +1239,7 @@ r9a06g032_register_dualgate(struct r9a06g032_priv *clocks, struct clk_init_data init = {}; /* allocate the gate */ - g = kzalloc(sizeof(*g), GFP_KERNEL); + g = kzalloc_obj(*g, GFP_KERNEL); if (!g) return NULL; g->clocks = clocks; diff --git a/drivers/clk/renesas/rcar-cpg-lib.c b/drivers/clk/renesas/rcar-cpg-lib.c index 7b271de7037a..f4279af8787f 100644 --- a/drivers/clk/renesas/rcar-cpg-lib.c +++ b/drivers/clk/renesas/rcar-cpg-lib.c @@ -94,7 +94,7 @@ struct clk * __init cpg_sdh_clk_register(const char *name, struct cpg_simple_notifier *csn; struct clk *clk; - csn = kzalloc(sizeof(*csn), GFP_KERNEL); + csn = kzalloc_obj(*csn, GFP_KERNEL); if (!csn) return ERR_PTR(-ENOMEM); @@ -144,7 +144,7 @@ struct clk * __init cpg_rpc_clk_register(const char *name, struct rpc_clock *rpc; struct clk *clk; - rpc = kzalloc(sizeof(*rpc), GFP_KERNEL); + rpc = kzalloc_obj(*rpc, GFP_KERNEL); if (!rpc) return ERR_PTR(-ENOMEM); @@ -185,7 +185,7 @@ struct clk * __init cpg_rpcd2_clk_register(const char *name, struct rpcd2_clock *rpcd2; struct clk *clk; - rpcd2 = kzalloc(sizeof(*rpcd2), GFP_KERNEL); + rpcd2 = kzalloc_obj(*rpcd2, GFP_KERNEL); if (!rpcd2) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen2-cpg.c b/drivers/clk/renesas/rcar-gen2-cpg.c index ab34bb8c3e07..69618ec0b638 100644 --- a/drivers/clk/renesas/rcar-gen2-cpg.c +++ b/drivers/clk/renesas/rcar-gen2-cpg.c @@ -141,7 +141,7 @@ static struct clk * __init cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc(sizeof(*zclk), GFP_KERNEL); + zclk = kzalloc_obj(*zclk, GFP_KERNEL); if (!zclk) return ERR_PTR(-ENOMEM); @@ -169,14 +169,14 @@ static struct clk * __init cpg_rcan_clk_register(const char *name, struct clk_gate *gate; struct clk *clk; - fixed = kzalloc(sizeof(*fixed), GFP_KERNEL); + fixed = kzalloc_obj(*fixed, GFP_KERNEL); if (!fixed) return ERR_PTR(-ENOMEM); fixed->mult = 1; fixed->div = 6; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { kfree(fixed); return ERR_PTR(-ENOMEM); @@ -213,7 +213,7 @@ static struct clk * __init cpg_adsp_clk_register(const char *name, struct clk_gate *gate; struct clk *clk; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); @@ -222,7 +222,7 @@ static struct clk * __init cpg_adsp_clk_register(const char *name, div->table = cpg_adsp_div_table; div->lock = &cpg_lock; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { kfree(div); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c index b954278ddd9d..605854200b04 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -123,7 +123,7 @@ static struct clk * __init cpg_pll_clk_register(const char *name, struct clk_init_data init = {}; struct clk *clk; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (!pll_clk) return ERR_PTR(-ENOMEM); @@ -271,7 +271,7 @@ static struct clk * __init __cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc(sizeof(*zclk), GFP_KERNEL); + zclk = kzalloc_obj(*zclk, GFP_KERNEL); if (!zclk) return ERR_PTR(-ENOMEM); @@ -410,7 +410,7 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev, if (cpg_quirks & RCKCR_CKSEL) { struct cpg_simple_notifier *csn; - csn = kzalloc(sizeof(*csn), GFP_KERNEL); + csn = kzalloc_obj(*csn, GFP_KERNEL); if (!csn) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen4-cpg.c b/drivers/clk/renesas/rcar-gen4-cpg.c index ac2b5afec46d..7168939ddb65 100644 --- a/drivers/clk/renesas/rcar-gen4-cpg.c +++ b/drivers/clk/renesas/rcar-gen4-cpg.c @@ -234,7 +234,7 @@ static struct clk * __init cpg_pll_clk_register(const char *name, struct cpg_pll_clk *pll_clk; struct clk *clk; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (!pll_clk) return ERR_PTR(-ENOMEM); @@ -374,7 +374,7 @@ static struct clk * __init cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc(sizeof(*zclk), GFP_KERNEL); + zclk = kzalloc_obj(*zclk, GFP_KERNEL); if (!zclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c index 4824607d56c0..48105ee90c83 100644 --- a/drivers/clk/renesas/renesas-cpg-mssr.c +++ b/drivers/clk/renesas/renesas-cpg-mssr.c @@ -512,7 +512,7 @@ static void __init cpg_mssr_register_mod_clk(const struct mssr_mod_clk *mod, goto fail; } - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) { clk = ERR_PTR(-ENOMEM); goto fail; @@ -1258,7 +1258,7 @@ static int __init cpg_mssr_common_init(struct device *dev, } nclks = info->num_total_core_clks + info->num_hw_mod_clks; - priv = kzalloc(struct_size(priv, clks, nclks), GFP_KERNEL); + priv = kzalloc_flex(*priv, clks, nclks, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c index 6e91a3041a03..456b23e6be42 100644 --- a/drivers/clk/rockchip/clk-cpu.c +++ b/drivers/clk/rockchip/clk-cpu.c @@ -313,7 +313,7 @@ struct clk *rockchip_clk_register_cpuclk(const char *name, return ERR_PTR(-EINVAL); } - cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); if (!cpuclk) return ERR_PTR(-ENOMEM); @@ -479,7 +479,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, int ret; if (num_parents > 1) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -493,7 +493,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, } if (div_width > 0) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) { ret = -ENOMEM; goto free_mux; @@ -521,7 +521,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, goto free_div; } - cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); if (!cpuclk) { ret = -ENOMEM; goto unregister_clk; diff --git a/drivers/clk/rockchip/clk-ddr.c b/drivers/clk/rockchip/clk-ddr.c index 8866a65982a0..96985682b98c 100644 --- a/drivers/clk/rockchip/clk-ddr.c +++ b/drivers/clk/rockchip/clk-ddr.c @@ -100,7 +100,7 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags, struct clk_init_data init; struct clk *clk; - ddrclk = kzalloc(sizeof(*ddrclk), GFP_KERNEL); + ddrclk = kzalloc_obj(*ddrclk, GFP_KERNEL); if (!ddrclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-gate-grf.c b/drivers/clk/rockchip/clk-gate-grf.c index 8122f471f391..b3df39f9b317 100644 --- a/drivers/clk/rockchip/clk-gate-grf.c +++ b/drivers/clk/rockchip/clk-gate-grf.c @@ -81,7 +81,7 @@ struct clk *rockchip_clk_register_gate_grf(const char *name, return ERR_PTR(-EOPNOTSUPP); } - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c index fbc018e8afa4..ac77911fa058 100644 --- a/drivers/clk/rockchip/clk-half-divider.c +++ b/drivers/clk/rockchip/clk-half-divider.c @@ -176,7 +176,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, *gate_ops = NULL; if (num_parents > 1) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -190,7 +190,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, } if (gate_offset >= 0) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto err_gate; @@ -202,7 +202,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, } if (div_width > 0) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto err_div; diff --git a/drivers/clk/rockchip/clk-inverter.c b/drivers/clk/rockchip/clk-inverter.c index 5dfbdce18b48..53c17047077c 100644 --- a/drivers/clk/rockchip/clk-inverter.c +++ b/drivers/clk/rockchip/clk-inverter.c @@ -79,7 +79,7 @@ struct clk *rockchip_clk_register_inverter(const char *name, struct rockchip_inv_clock *inv_clock; struct clk *clk; - inv_clock = kmalloc(sizeof(*inv_clock), GFP_KERNEL); + inv_clock = kmalloc_obj(*inv_clock, GFP_KERNEL); if (!inv_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c index 8b1292c56863..c8bb8a217eaa 100644 --- a/drivers/clk/rockchip/clk-mmc-phase.c +++ b/drivers/clk/rockchip/clk-mmc-phase.c @@ -210,7 +210,7 @@ struct clk *rockchip_clk_register_mmc(const char *name, struct clk *clk; int ret; - mmc_clock = kmalloc(sizeof(*mmc_clock), GFP_KERNEL); + mmc_clock = kmalloc_obj(*mmc_clock, GFP_KERNEL); if (!mmc_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-muxgrf.c b/drivers/clk/rockchip/clk-muxgrf.c index 4a335a5f4633..7545df0adabe 100644 --- a/drivers/clk/rockchip/clk-muxgrf.c +++ b/drivers/clk/rockchip/clk-muxgrf.c @@ -67,7 +67,7 @@ struct clk *rockchip_clk_register_muxgrf(const char *name, return ERR_PTR(-ENOTSUPP); } - muxgrf_clock = kmalloc(sizeof(*muxgrf_clock), GFP_KERNEL); + muxgrf_clock = kmalloc_obj(*muxgrf_clock, GFP_KERNEL); if (!muxgrf_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c index 86dba3826a77..865151d88b9f 100644 --- a/drivers/clk/rockchip/clk-pll.c +++ b/drivers/clk/rockchip/clk-pll.c @@ -1076,7 +1076,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx, /* name the actual pll */ snprintf(pll_name, sizeof(pll_name), "pll_%s", name); - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-rk3576.c b/drivers/clk/rockchip/clk-rk3576.c index 9bc0ef51ef68..59285a784cd0 100644 --- a/drivers/clk/rockchip/clk-rk3576.c +++ b/drivers/clk/rockchip/clk-rk3576.c @@ -1769,7 +1769,7 @@ static void __init rk3576_clk_init(struct device_node *np) goto err_unmap; } - pmu0_grf_e = kzalloc(sizeof(*pmu0_grf_e), GFP_KERNEL); + pmu0_grf_e = kzalloc_obj(*pmu0_grf_e, GFP_KERNEL); if (!pmu0_grf_e) goto err_unmap; @@ -1777,7 +1777,7 @@ static void __init rk3576_clk_init(struct device_node *np) pmu0_grf_e->type = grf_type_pmu0; hash_add(ctx->aux_grf_table, &pmu0_grf_e->node, grf_type_pmu0); - ioc_grf_e = kzalloc(sizeof(*ioc_grf_e), GFP_KERNEL); + ioc_grf_e = kzalloc_obj(*ioc_grf_e, GFP_KERNEL); if (!ioc_grf_e) goto err_free_pmu0; diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index 9ac9d13e87de..ec9517d7c2b7 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c @@ -55,7 +55,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, int ret; if (num_parents > 1) { - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -70,7 +70,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, } if (gate_offset >= 0) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { ret = -ENOMEM; goto err_gate; @@ -84,7 +84,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, } if (div_width > 0) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) { ret = -ENOMEM; goto err_div; @@ -221,7 +221,7 @@ static struct clk *rockchip_clk_register_frac_branch( return ERR_PTR(-EINVAL); } - frac = kzalloc(sizeof(*frac), GFP_KERNEL); + frac = kzalloc_obj(*frac, GFP_KERNEL); if (!frac) return ERR_PTR(-ENOMEM); @@ -323,7 +323,7 @@ static struct clk *rockchip_clk_register_factor_branch(const char *name, div); } - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -332,7 +332,7 @@ static struct clk *rockchip_clk_register_factor_branch(const char *name, gate->bit_idx = gate_shift; gate->lock = lock; - fix = kzalloc(sizeof(*fix), GFP_KERNEL); + fix = kzalloc_obj(*fix, GFP_KERNEL); if (!fix) { kfree(gate); return ERR_PTR(-ENOMEM); @@ -365,11 +365,11 @@ static struct rockchip_clk_provider *rockchip_clk_init_base( default_clk_val = ERR_PTR(has_late_clocks ? -EPROBE_DEFER : -ENOENT); - ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); + ctx = kzalloc_obj(struct rockchip_clk_provider, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); - clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); + clk_table = kzalloc_objs(struct clk *, nr_clks, GFP_KERNEL); if (!clk_table) goto err_free; diff --git a/drivers/clk/rockchip/softrst.c b/drivers/clk/rockchip/softrst.c index fd56aaefe6d1..01caa91e7ce3 100644 --- a/drivers/clk/rockchip/softrst.c +++ b/drivers/clk/rockchip/softrst.c @@ -96,7 +96,7 @@ void rockchip_register_softrst_lut(struct device_node *np, struct rockchip_softrst *softrst; int ret; - softrst = kzalloc(sizeof(*softrst), GFP_KERNEL); + softrst = kzalloc_obj(*softrst, GFP_KERNEL); if (!softrst) return; diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index 300f8d5d3c48..d8729dceabb0 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -660,7 +660,7 @@ static int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, return -EINVAL; } - cpuclk = kzalloc(sizeof(*cpuclk), GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); if (!cpuclk) return -ENOMEM; diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 0a8fc9649ae2..1bd8def3973e 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -1435,7 +1435,7 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, struct clk_init_data init; int ret, len; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) { pr_err("%s: could not allocate pll clk %s\n", __func__, pll_clk->name); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 9f68f079fd55..39580d82077b 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -55,7 +55,7 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( struct samsung_clk_reg_dump *rd; unsigned int i; - rd = kcalloc(nr_rdump, sizeof(*rd), GFP_KERNEL); + rd = kzalloc_objs(*rd, nr_rdump, GFP_KERNEL); if (!rd) return NULL; @@ -82,7 +82,7 @@ struct samsung_clk_provider * __init samsung_clk_init(struct device *dev, struct samsung_clk_provider *ctx; int i; - ctx = kzalloc(struct_size(ctx, clk_data.hws, nr_clks), GFP_KERNEL); + ctx = kzalloc_flex(*ctx, clk_data.hws, nr_clks, GFP_KERNEL); if (!ctx) panic("could not allocate clock provider context.\n"); @@ -301,7 +301,7 @@ struct clk_hw *samsung_register_auto_gate(struct device *dev, int ret = -EINVAL; /* allocate the gate */ - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -431,8 +431,7 @@ void samsung_clk_extended_sleep_init(void __iomem *reg_base, { struct samsung_clock_reg_cache *reg_cache; - reg_cache = kzalloc(sizeof(struct samsung_clock_reg_cache), - GFP_KERNEL); + reg_cache = kzalloc_obj(struct samsung_clock_reg_cache, GFP_KERNEL); if (!reg_cache) panic("could not allocate register reg_cache.\n"); reg_cache->rdump = samsung_clk_alloc_reg_dump(rdump, nr_rdump); diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c index 06f129c160bc..c6505046b63b 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -52,7 +52,7 @@ static void __init __socfpga_gate_init(struct device_node *node, struct clk_init_data init; int rc; - socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); if (WARN_ON(!socfpga_clk)) return; diff --git a/drivers/clk/socfpga/clk-gate-s10.c b/drivers/clk/socfpga/clk-gate-s10.c index dce3ef137bf3..913c31d94319 100644 --- a/drivers/clk/socfpga/clk-gate-s10.c +++ b/drivers/clk/socfpga/clk-gate-s10.c @@ -132,7 +132,7 @@ struct clk_hw *s10_register_gate(const struct stratix10_gate_clock *clks, void _ const char *parent_name = clks->parent_name; int ret; - socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); if (!socfpga_clk) return NULL; @@ -190,7 +190,7 @@ struct clk_hw *agilex_register_gate(const struct stratix10_gate_clock *clks, voi const char *parent_name = clks->parent_name; int ret; - socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); if (!socfpga_clk) return NULL; @@ -247,7 +247,7 @@ struct clk_hw *agilex5_register_gate(const struct agilex5_gate_clock *clks, void struct clk_init_data init; int ret; - socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); if (!socfpga_clk) return NULL; diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c index 0a5a95e0267f..52dd6e2f19f9 100644 --- a/drivers/clk/socfpga/clk-gate.c +++ b/drivers/clk/socfpga/clk-gate.c @@ -147,7 +147,7 @@ void __init socfpga_gate_init(struct device_node *node) struct clk_ops *ops; int rc; - socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); if (WARN_ON(!socfpga_clk)) return; diff --git a/drivers/clk/socfpga/clk-periph-a10.c b/drivers/clk/socfpga/clk-periph-a10.c index 64cc70b970b7..7f61ce1793b2 100644 --- a/drivers/clk/socfpga/clk-periph-a10.c +++ b/drivers/clk/socfpga/clk-periph-a10.c @@ -72,7 +72,7 @@ static void __init __socfpga_periph_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return; diff --git a/drivers/clk/socfpga/clk-periph-s10.c b/drivers/clk/socfpga/clk-periph-s10.c index f12ca43ffe7c..f43ffd4dfa82 100644 --- a/drivers/clk/socfpga/clk-periph-s10.c +++ b/drivers/clk/socfpga/clk-periph-s10.c @@ -108,7 +108,7 @@ struct clk_hw *s10_register_periph(const struct stratix10_perip_c_clock *clks, const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return NULL; @@ -144,7 +144,7 @@ struct clk_hw *n5x_register_periph(const struct n5x_perip_c_clock *clks, const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return NULL; @@ -179,7 +179,7 @@ struct clk_hw *s10_register_cnt_periph(const struct stratix10_perip_cnt_clock *c const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return NULL; @@ -224,7 +224,7 @@ struct clk_hw *agilex5_register_cnt_periph(const struct agilex5_perip_cnt_clock const char *name = clks->name; int ret; - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return NULL; diff --git a/drivers/clk/socfpga/clk-periph.c b/drivers/clk/socfpga/clk-periph.c index 6a4075147b9c..2719af1502c1 100644 --- a/drivers/clk/socfpga/clk-periph.c +++ b/drivers/clk/socfpga/clk-periph.c @@ -62,7 +62,7 @@ static void __init __socfpga_periph_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - periph_clk = kzalloc(sizeof(*periph_clk), GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); if (WARN_ON(!periph_clk)) return; diff --git a/drivers/clk/socfpga/clk-pll-a10.c b/drivers/clk/socfpga/clk-pll-a10.c index 62eed964c3d0..633c30b70d25 100644 --- a/drivers/clk/socfpga/clk-pll-a10.c +++ b/drivers/clk/socfpga/clk-pll-a10.c @@ -78,7 +78,7 @@ static void __init __socfpga_pll_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c index 1be92827cd93..3c8302a7ec5b 100644 --- a/drivers/clk/socfpga/clk-pll-s10.c +++ b/drivers/clk/socfpga/clk-pll-s10.c @@ -196,7 +196,7 @@ struct clk_hw *s10_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return NULL; @@ -236,7 +236,7 @@ struct clk_hw *agilex_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return NULL; @@ -275,7 +275,7 @@ struct clk_hw *n5x_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return NULL; @@ -314,7 +314,7 @@ struct clk_hw *agilex5_register_pll(const struct agilex5_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return NULL; diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c index 03a96139a576..877c7f1a4216 100644 --- a/drivers/clk/socfpga/clk-pll.c +++ b/drivers/clk/socfpga/clk-pll.c @@ -84,7 +84,7 @@ static void __init __socfpga_pll_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - pll_clk = kzalloc(sizeof(*pll_clk), GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/spacemit/ccu_common.c b/drivers/clk/spacemit/ccu_common.c index 5f05b17f8452..cbe11eb49f0b 100644 --- a/drivers/clk/spacemit/ccu_common.c +++ b/drivers/clk/spacemit/ccu_common.c @@ -91,7 +91,7 @@ static int spacemit_ccu_reset_register(struct device *dev, if (!reset_name) return 0; - cadev = kzalloc(sizeof(*cadev), GFP_KERNEL); + cadev = kzalloc_obj(*cadev, GFP_KERNEL); if (!cadev) return -ENOMEM; diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c index d0d063147af8..6358c9d87f4d 100644 --- a/drivers/clk/spear/clk-aux-synth.c +++ b/drivers/clk/spear/clk-aux-synth.c @@ -147,7 +147,7 @@ struct clk *clk_register_aux(const char *aux_name, const char *gate_name, return ERR_PTR(-EINVAL); } - aux = kzalloc(sizeof(*aux), GFP_KERNEL); + aux = kzalloc_obj(*aux, GFP_KERNEL); if (!aux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c index 150f051d28e0..37457eb1df1d 100644 --- a/drivers/clk/spear/clk-frac-synth.c +++ b/drivers/clk/spear/clk-frac-synth.c @@ -134,7 +134,7 @@ struct clk *clk_register_frac(const char *name, const char *parent_name, return ERR_PTR(-EINVAL); } - frac = kzalloc(sizeof(*frac), GFP_KERNEL); + frac = kzalloc_obj(*frac, GFP_KERNEL); if (!frac) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c index cf9659dc9073..dfc8c01d8a41 100644 --- a/drivers/clk/spear/clk-gpt-synth.c +++ b/drivers/clk/spear/clk-gpt-synth.c @@ -123,7 +123,7 @@ struct clk *clk_register_gpt(const char *name, const char *parent_name, unsigned return ERR_PTR(-EINVAL); } - gpt = kzalloc(sizeof(*gpt), GFP_KERNEL); + gpt = kzalloc_obj(*gpt, GFP_KERNEL); if (!gpt) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c index 723a6eb67754..8b1fab349a1c 100644 --- a/drivers/clk/spear/clk-vco-pll.c +++ b/drivers/clk/spear/clk-vco-pll.c @@ -293,11 +293,11 @@ struct clk *clk_register_vco_pll(const char *vco_name, const char *pll_name, return ERR_PTR(-EINVAL); } - vco = kzalloc(sizeof(*vco), GFP_KERNEL); + vco = kzalloc_obj(*vco, GFP_KERNEL); if (!vco) return ERR_PTR(-ENOMEM); - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) goto free_vco; diff --git a/drivers/clk/sprd/pll.c b/drivers/clk/sprd/pll.c index bc6610d5fcb7..3c70a32e993f 100644 --- a/drivers/clk/sprd/pll.c +++ b/drivers/clk/sprd/pll.c @@ -155,7 +155,7 @@ static int _sprd_pll_set_rate(const struct sprd_pll *pll, unsigned long kint, nint; u64 tmp, refin, fvco = rate; - cfg = kcalloc(regs_num, sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_objs(*cfg, regs_num, GFP_KERNEL); if (!cfg) return -ENOMEM; diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index e8e7626c76db..ea14dec68fef 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -213,7 +213,7 @@ static struct clk *clk_register_flexgen(const char *name, u32 xbar_shift; void __iomem *xbar_reg, *fdiv_reg; - fgxbar = kzalloc(sizeof(struct flexgen), GFP_KERNEL); + fgxbar = kzalloc_obj(struct flexgen, GFP_KERNEL); if (!fgxbar) return ERR_PTR(-ENOMEM); @@ -596,7 +596,7 @@ static void __init st_of_flexgen_setup(struct device_node *np) clk_mode = data->mode; } - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) goto err; @@ -612,12 +612,12 @@ static void __init st_of_flexgen_setup(struct device_node *np) } else clk_data->clk_num = data->outputs_nb; - clk_data->clks = kcalloc(clk_data->clk_num, sizeof(struct clk *), - GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, clk_data->clk_num, + GFP_KERNEL); if (!clk_data->clks) goto err; - rlock = kzalloc(sizeof(spinlock_t), GFP_KERNEL); + rlock = kzalloc_obj(spinlock_t, GFP_KERNEL); if (!rlock) goto err; diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c index e06e7e5cc1a5..74dd344eba4f 100644 --- a/drivers/clk/st/clkgen-fsyn.c +++ b/drivers/clk/st/clkgen-fsyn.c @@ -454,7 +454,7 @@ static struct clk * __init st_clk_register_quadfs_pll( if (WARN_ON(!name || !parent_name)) return ERR_PTR(-EINVAL); - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -894,7 +894,7 @@ static struct clk * __init st_clk_register_quadfs_fsynth( if (WARN_ON(!name || !parent_name)) return ERR_PTR(-EINVAL); - fs = kzalloc(sizeof(*fs), GFP_KERNEL); + fs = kzalloc_obj(*fs, GFP_KERNEL); if (!fs) return ERR_PTR(-ENOMEM); @@ -926,13 +926,12 @@ static void __init st_of_create_quadfs_fsynths( struct clk_onecell_data *clk_data; int fschan; - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) return; clk_data->clk_num = QUADFS_MAX_CHAN; - clk_data->clks = kcalloc(QUADFS_MAX_CHAN, sizeof(struct clk *), - GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, QUADFS_MAX_CHAN, GFP_KERNEL); if (!clk_data->clks) { kfree(clk_data); @@ -1013,7 +1012,7 @@ static void __init st_of_quadfs_setup(struct device_node *np, if (!pll_name) return; - lock = kzalloc(sizeof(*lock), GFP_KERNEL); + lock = kzalloc_obj(*lock, GFP_KERNEL); if (!lock) goto err_exit; diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c index c258ff87a171..9a6b0df5aabc 100644 --- a/drivers/clk/st/clkgen-pll.c +++ b/drivers/clk/st/clkgen-pll.c @@ -656,7 +656,7 @@ static struct clk * __init clkgen_pll_register(const char *parent_name, struct clk *clk; struct clk_init_data init; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -716,7 +716,7 @@ static struct clk * __init clkgen_odf_register(const char *parent_name, flags = pll_flags | CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); @@ -725,7 +725,7 @@ static struct clk * __init clkgen_odf_register(const char *parent_name, gate->bit_idx = pll_data->odf_gate[odf].shift; gate->lock = odf_lock; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) { kfree(gate); return ERR_PTR(-ENOMEM); @@ -783,13 +783,13 @@ static void __init clkgen_c32_pll_setup(struct device_node *np, num_odfs = datac->data->num_odfs; - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) return; clk_data->clk_num = num_odfs; - clk_data->clks = kcalloc(clk_data->clk_num, sizeof(struct clk *), - GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, clk_data->clk_num, + GFP_KERNEL); if (!clk_data->clks) goto err; diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c index 52833d4241c5..d8a1e45fc6bd 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c @@ -347,7 +347,7 @@ int jh7110_reset_controller_register(struct jh71x0_clk_priv *priv, struct auxiliary_device *adev; int ret; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return -ENOMEM; diff --git a/drivers/clk/stm32/reset-stm32.c b/drivers/clk/stm32/reset-stm32.c index 5a8f525842ce..6c4a3a1bfa38 100644 --- a/drivers/clk/stm32/reset-stm32.c +++ b/drivers/clk/stm32/reset-stm32.c @@ -130,7 +130,7 @@ int stm32_rcc_reset_init(struct device *dev, struct clk_stm32_reset_data *data, { struct stm32_reset_data *reset_data; - reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); if (!reset_data) return -ENOMEM; diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c index c7e00f0c29a5..eff61cb0d8a5 100644 --- a/drivers/clk/sunxi-ng/ccu_common.c +++ b/drivers/clk/sunxi-ng/ccu_common.c @@ -242,7 +242,7 @@ void of_sunxi_ccu_probe(struct device_node *node, void __iomem *reg, struct sunxi_ccu *ccu; int ret; - ccu = kzalloc(sizeof(*ccu), GFP_KERNEL); + ccu = kzalloc_obj(*ccu, GFP_KERNEL); if (!ccu) return; diff --git a/drivers/clk/sunxi/clk-a10-hosc.c b/drivers/clk/sunxi/clk-a10-hosc.c index f07e976839eb..3a0d899c395a 100644 --- a/drivers/clk/sunxi/clk-a10-hosc.c +++ b/drivers/clk/sunxi/clk-a10-hosc.c @@ -26,10 +26,10 @@ static void __init sun4i_osc_clk_setup(struct device_node *node) return; /* allocate fixed-rate and gate clock structs */ - fixed = kzalloc(sizeof(struct clk_fixed_rate), GFP_KERNEL); + fixed = kzalloc_obj(struct clk_fixed_rate, GFP_KERNEL); if (!fixed) return; - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); if (!gate) goto err_free_fixed; diff --git a/drivers/clk/sunxi/clk-a10-mod1.c b/drivers/clk/sunxi/clk-a10-mod1.c index 39ad56d753ba..45dfe0b2e8d1 100644 --- a/drivers/clk/sunxi/clk-a10-mod1.c +++ b/drivers/clk/sunxi/clk-a10-mod1.c @@ -32,11 +32,11 @@ static void __init sun4i_mod1_clk_setup(struct device_node *node) if (IS_ERR(reg)) return; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) goto err_unmap; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto err_free_mux; diff --git a/drivers/clk/sunxi/clk-a10-pll2.c b/drivers/clk/sunxi/clk-a10-pll2.c index 2ea3b42320a6..046e23831fc2 100644 --- a/drivers/clk/sunxi/clk-a10-pll2.c +++ b/drivers/clk/sunxi/clk-a10-pll2.c @@ -50,11 +50,11 @@ static void __init sun4i_pll2_setup(struct device_node *node, if (IS_ERR(reg)) return; - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) goto err_unmap; - clks = kcalloc(SUN4I_PLL2_OUTPUTS, sizeof(struct clk *), GFP_KERNEL); + clks = kzalloc_objs(struct clk *, SUN4I_PLL2_OUTPUTS, GFP_KERNEL); if (!clks) goto err_free_data; @@ -71,7 +71,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, } /* Setup the gate part of the PLL2 */ - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); if (!gate) goto err_unregister_prediv; @@ -80,7 +80,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, gate->lock = &sun4i_a10_pll2_lock; /* Setup the multiplier part of the PLL2 */ - mult = kzalloc(sizeof(struct clk_multiplier), GFP_KERNEL); + mult = kzalloc_obj(struct clk_multiplier, GFP_KERNEL); if (!mult) goto err_free_gate; diff --git a/drivers/clk/sunxi/clk-a10-ve.c b/drivers/clk/sunxi/clk-a10-ve.c index 65810937a13a..d353d0d1200a 100644 --- a/drivers/clk/sunxi/clk-a10-ve.c +++ b/drivers/clk/sunxi/clk-a10-ve.c @@ -97,11 +97,11 @@ static void __init sun4i_ve_clk_setup(struct device_node *node) if (IS_ERR(reg)) return; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto err_unmap; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto err_free_div; @@ -129,7 +129,7 @@ static void __init sun4i_ve_clk_setup(struct device_node *node) if (err) goto err_unregister_clk; - reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); if (!reset_data) goto err_del_provider; diff --git a/drivers/clk/sunxi/clk-a20-gmac.c b/drivers/clk/sunxi/clk-a20-gmac.c index 43080c7d045b..3ef842034fa2 100644 --- a/drivers/clk/sunxi/clk-a20-gmac.c +++ b/drivers/clk/sunxi/clk-a20-gmac.c @@ -63,11 +63,11 @@ static void __init sun7i_a20_gmac_clk_setup(struct device_node *node) return; /* allocate mux and gate clock structs */ - mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); + mux = kzalloc_obj(struct clk_mux, GFP_KERNEL); if (!mux) return; - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); if (!gate) goto free_mux; diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c index 4d8f0422b876..0b4a25305e93 100644 --- a/drivers/clk/sunxi/clk-factors.c +++ b/drivers/clk/sunxi/clk-factors.c @@ -200,7 +200,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, else of_property_read_string(node, "clock-output-names", &clk_name); - factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); + factors = kzalloc_obj(struct clk_factors, GFP_KERNEL); if (!factors) goto err_factors; @@ -213,7 +213,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, /* Add a gate if this factor clock can be gated */ if (data->enable) { - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); if (!gate) goto err_gate; @@ -228,7 +228,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, /* Add a mux if this factor clock can be muxed */ if (data->mux) { - mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); + mux = kzalloc_obj(struct clk_mux, GFP_KERNEL); if (!mux) goto err_mux; diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c index 51800289ada9..dcfaa8a936c4 100644 --- a/drivers/clk/sunxi/clk-mod0.c +++ b/drivers/clk/sunxi/clk-mod0.c @@ -300,11 +300,11 @@ static void __init sunxi_mmc_setup(struct device_node *node, return; } - clk_data = kmalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kmalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) return; - clk_data->clks = kcalloc(3, sizeof(*clk_data->clks), GFP_KERNEL); + clk_data->clks = kzalloc_objs(*clk_data->clks, 3, GFP_KERNEL); if (!clk_data->clks) goto err_free_data; @@ -323,7 +323,7 @@ static void __init sunxi_mmc_setup(struct device_node *node, }; struct mmc_phase *phase; - phase = kmalloc(sizeof(*phase), GFP_KERNEL); + phase = kmalloc_obj(*phase, GFP_KERNEL); if (!phase) continue; diff --git a/drivers/clk/sunxi/clk-simple-gates.c b/drivers/clk/sunxi/clk-simple-gates.c index 845efc1ec800..3852972a8600 100644 --- a/drivers/clk/sunxi/clk-simple-gates.c +++ b/drivers/clk/sunxi/clk-simple-gates.c @@ -34,14 +34,14 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, clk_parent = of_clk_get_parent_name(node, 0); - clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); if (!clk_data) goto err_unmap; number = of_property_count_u32_elems(node, "clock-indices"); of_property_read_u32_index(node, "clock-indices", number - 1, &number); - clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, number + 1, GFP_KERNEL); if (!clk_data->clks) goto err_free_data; diff --git a/drivers/clk/sunxi/clk-sun4i-display.c b/drivers/clk/sunxi/clk-sun4i-display.c index 35d1541bedd9..a4e00d516b68 100644 --- a/drivers/clk/sunxi/clk-sun4i-display.c +++ b/drivers/clk/sunxi/clk-sun4i-display.c @@ -126,7 +126,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, goto unmap; } - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) goto unmap; @@ -135,7 +135,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, mux->mask = (1 << data->width_mux) - 1; mux->lock = &sun4i_a10_display_lock; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto free_mux; @@ -144,7 +144,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, gate->lock = &sun4i_a10_display_lock; if (data->has_div) { - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto free_gate; @@ -175,7 +175,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, if (!data->num_rst) return; - reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); if (!reset_data) goto free_of_clk; diff --git a/drivers/clk/sunxi/clk-sun4i-pll3.c b/drivers/clk/sunxi/clk-sun4i-pll3.c index 5328588fa2de..2977e71ea35a 100644 --- a/drivers/clk/sunxi/clk-sun4i-pll3.c +++ b/drivers/clk/sunxi/clk-sun4i-pll3.c @@ -37,7 +37,7 @@ static void __init sun4i_a10_pll3_setup(struct device_node *node) return; } - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto err_unmap; @@ -45,7 +45,7 @@ static void __init sun4i_a10_pll3_setup(struct device_node *node) gate->bit_idx = SUN4I_A10_PLL3_GATE_BIT; gate->lock = &sun4i_a10_pll3_lock; - mult = kzalloc(sizeof(*mult), GFP_KERNEL); + mult = kzalloc_obj(*mult, GFP_KERNEL); if (!mult) goto err_free_gate; diff --git a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c index 277a240b65a1..6e4c9db335e6 100644 --- a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c +++ b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c @@ -246,7 +246,7 @@ static void __init tcon_ch1_setup(struct device_node *node) goto err_unmap; } - tclk = kzalloc(sizeof(*tclk), GFP_KERNEL); + tclk = kzalloc_obj(*tclk, GFP_KERNEL); if (!tclk) goto err_unmap; diff --git a/drivers/clk/sunxi/clk-sun8i-bus-gates.c b/drivers/clk/sunxi/clk-sun8i-bus-gates.c index 8482ac8e5898..c212200d49f4 100644 --- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c +++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c @@ -44,14 +44,14 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node) parents[i] = of_clk_get_parent_name(node, idx); } - clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); if (!clk_data) goto err_unmap; number = of_property_count_u32_elems(node, "clock-indices"); of_property_read_u32_index(node, "clock-indices", number - 1, &number); - clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, number + 1, GFP_KERNEL); if (!clk_data->clks) goto err_free_data; diff --git a/drivers/clk/sunxi/clk-sun8i-mbus.c b/drivers/clk/sunxi/clk-sun8i-mbus.c index 539ea278823d..9156830f04a6 100644 --- a/drivers/clk/sunxi/clk-sun8i-mbus.c +++ b/drivers/clk/sunxi/clk-sun8i-mbus.c @@ -44,15 +44,15 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node) goto err_free_parents; } - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) goto err_unmap; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) goto err_free_div; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto err_free_mux; diff --git a/drivers/clk/sunxi/clk-sun9i-cpus.c b/drivers/clk/sunxi/clk-sun9i-cpus.c index 48bf899bb2bc..f49f4df71bc2 100644 --- a/drivers/clk/sunxi/clk-sun9i-cpus.c +++ b/drivers/clk/sunxi/clk-sun9i-cpus.c @@ -191,7 +191,7 @@ static void sun9i_a80_cpus_setup(struct device_node *node) struct clk *clk; int ret; - cpus = kzalloc(sizeof(*cpus), GFP_KERNEL); + cpus = kzalloc_obj(*cpus, GFP_KERNEL); if (!cpus) return; @@ -204,7 +204,7 @@ static void sun9i_a80_cpus_setup(struct device_node *node) /* we have a mux, we will have >1 parents */ ret = of_clk_parent_fill(node, parents, SUN9I_CPUS_MAX_PARENTS); - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) goto err_unmap; diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 4999504f7e60..1451ebec1ac6 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -991,11 +991,11 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, return NULL; } - clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); if (!clk_data) goto out_unmap; - clks = kcalloc(ndivs, sizeof(*clks), GFP_KERNEL); + clks = kzalloc_objs(*clks, ndivs, GFP_KERNEL); if (!clks) goto free_clkdata; @@ -1022,7 +1022,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, /* If this leaf clock can be gated, create a gate */ if (data->div[i].gate) { - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) goto free_clks; @@ -1035,7 +1035,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, /* Leaves can be fixed or configurable divisors */ if (data->div[i].fixed) { - fix_factor = kzalloc(sizeof(*fix_factor), GFP_KERNEL); + fix_factor = kzalloc_obj(*fix_factor, GFP_KERNEL); if (!fix_factor) goto free_gate; @@ -1045,7 +1045,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, rate_hw = &fix_factor->hw; rate_ops = &clk_fixed_factor_ops; } else { - divider = kzalloc(sizeof(*divider), GFP_KERNEL); + divider = kzalloc_obj(*divider, GFP_KERNEL); if (!divider) goto free_gate; diff --git a/drivers/clk/sunxi/clk-usb.c b/drivers/clk/sunxi/clk-usb.c index 3c53f65002a2..f993884c58d6 100644 --- a/drivers/clk/sunxi/clk-usb.c +++ b/drivers/clk/sunxi/clk-usb.c @@ -113,11 +113,11 @@ static void __init sunxi_usb_clk_setup(struct device_node *node, qty = find_last_bit((unsigned long *)&data->clk_mask, SUNXI_USB_MAX_SIZE); - clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); if (!clk_data) return; - clk_data->clks = kcalloc(qty + 1, sizeof(struct clk *), GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, qty + 1, GFP_KERNEL); if (!clk_data->clks) { kfree(clk_data); return; @@ -144,7 +144,7 @@ static void __init sunxi_usb_clk_setup(struct device_node *node, if (data->reset_mask == 0) return; - reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); if (!reset_data) return; diff --git a/drivers/clk/tegra/clk-audio-sync.c b/drivers/clk/tegra/clk-audio-sync.c index 468a4403f147..41db1d5978e3 100644 --- a/drivers/clk/tegra/clk-audio-sync.c +++ b/drivers/clk/tegra/clk-audio-sync.c @@ -50,7 +50,7 @@ struct clk *tegra_clk_register_sync_source(const char *name, struct clk_init_data init; struct clk *clk; - sync = kzalloc(sizeof(*sync), GFP_KERNEL); + sync = kzalloc_obj(*sync, GFP_KERNEL); if (!sync) { pr_err("%s: could not allocate sync source clk\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-bpmp.c b/drivers/clk/tegra/clk-bpmp.c index 77a2586dbe00..064d9ee431e5 100644 --- a/drivers/clk/tegra/clk-bpmp.c +++ b/drivers/clk/tegra/clk-bpmp.c @@ -434,7 +434,7 @@ static int tegra_bpmp_probe_clocks(struct tegra_bpmp *bpmp, dev_dbg(bpmp->dev, "maximum clock ID: %u\n", max_id); - clocks = kcalloc(max_id + 1, sizeof(*clocks), GFP_KERNEL); + clocks = kzalloc_objs(*clocks, max_id + 1, GFP_KERNEL); if (!clocks) return -ENOMEM; diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c index 37439fcb3ac0..62fd39a849b1 100644 --- a/drivers/clk/tegra/clk-divider.c +++ b/drivers/clk/tegra/clk-divider.c @@ -148,7 +148,7 @@ struct clk *tegra_clk_register_divider(const char *name, struct clk *clk; struct clk_init_data init; - divider = kzalloc(sizeof(*divider), GFP_KERNEL); + divider = kzalloc_obj(*divider, GFP_KERNEL); if (!divider) { pr_err("%s: could not allocate fractional divider clk\n", __func__); diff --git a/drivers/clk/tegra/clk-periph-fixed.c b/drivers/clk/tegra/clk-periph-fixed.c index c088e7a280df..363a0e0aed3d 100644 --- a/drivers/clk/tegra/clk-periph-fixed.c +++ b/drivers/clk/tegra/clk-periph-fixed.c @@ -84,7 +84,7 @@ struct clk *tegra_clk_register_periph_fixed(const char *name, if (!regs) return ERR_PTR(-EINVAL); - fixed = kzalloc(sizeof(*fixed), GFP_KERNEL); + fixed = kzalloc_obj(*fixed, GFP_KERNEL); if (!fixed) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-periph-gate.c b/drivers/clk/tegra/clk-periph-gate.c index 2091fc9b0ca9..1892a5b78fc7 100644 --- a/drivers/clk/tegra/clk-periph-gate.c +++ b/drivers/clk/tegra/clk-periph-gate.c @@ -146,7 +146,7 @@ struct clk *tegra_clk_register_periph_gate(const char *name, if (!pregs) return ERR_PTR(-EINVAL); - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) { pr_err("%s: could not allocate periph gate clk\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-pll-out.c b/drivers/clk/tegra/clk-pll-out.c index d8bf89a81e6d..cf10c7bea32d 100644 --- a/drivers/clk/tegra/clk-pll-out.c +++ b/drivers/clk/tegra/clk-pll-out.c @@ -93,7 +93,7 @@ struct clk *tegra_clk_register_pll_out(const char *name, struct clk *clk; struct clk_init_data init; - pll_out = kzalloc(sizeof(*pll_out), GFP_KERNEL); + pll_out = kzalloc_obj(*pll_out, GFP_KERNEL); if (!pll_out) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c index 591b9f0c155a..3031725e2a9d 100644 --- a/drivers/clk/tegra/clk-pll.c +++ b/drivers/clk/tegra/clk-pll.c @@ -1882,7 +1882,7 @@ static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base, { struct tegra_clk_pll *pll; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-sdmmc-mux.c b/drivers/clk/tegra/clk-sdmmc-mux.c index 4f2c3309eea4..524469ff0805 100644 --- a/drivers/clk/tegra/clk-sdmmc-mux.c +++ b/drivers/clk/tegra/clk-sdmmc-mux.c @@ -250,7 +250,7 @@ struct clk *tegra_clk_register_sdmmc_mux_div(const char *name, if (!bank) return ERR_PTR(-EINVAL); - sdmmc_mux = kzalloc(sizeof(*sdmmc_mux), GFP_KERNEL); + sdmmc_mux = kzalloc_obj(*sdmmc_mux, GFP_KERNEL); if (!sdmmc_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-super.c b/drivers/clk/tegra/clk-super.c index 51fb356e770e..3882efd05427 100644 --- a/drivers/clk/tegra/clk-super.c +++ b/drivers/clk/tegra/clk-super.c @@ -207,7 +207,7 @@ struct clk *tegra_clk_register_super_mux(const char *name, struct clk *clk; struct clk_init_data init; - super = kzalloc(sizeof(*super), GFP_KERNEL); + super = kzalloc_obj(*super, GFP_KERNEL); if (!super) return ERR_PTR(-ENOMEM); @@ -243,7 +243,7 @@ struct clk *tegra_clk_register_super_clk(const char *name, struct clk *clk; struct clk_init_data init; - super = kzalloc(sizeof(*super), GFP_KERNEL); + super = kzalloc_obj(*super, GFP_KERNEL); if (!super) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra-super-cclk.c b/drivers/clk/tegra/clk-tegra-super-cclk.c index 3b22a4d0dffc..0f4ec781024c 100644 --- a/drivers/clk/tegra/clk-tegra-super-cclk.c +++ b/drivers/clk/tegra/clk-tegra-super-cclk.c @@ -142,7 +142,7 @@ struct clk *tegra_clk_register_super_cclk(const char *name, if (WARN_ON(cclk_super)) return ERR_PTR(-EBUSY); - super = kzalloc(sizeof(*super), GFP_KERNEL); + super = kzalloc_obj(*super, GFP_KERNEL); if (!super) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c index 8aec327fa1f4..c92fc64c79dc 100644 --- a/drivers/clk/tegra/clk-tegra124-emc.c +++ b/drivers/clk/tegra/clk-tegra124-emc.c @@ -492,7 +492,7 @@ struct clk *tegra124_clk_register_emc(void __iomem *base, struct device_node *np struct clk *clk; int err; - tegra = kcalloc(1, sizeof(*tegra), GFP_KERNEL); + tegra = kzalloc_objs(*tegra, 1, GFP_KERNEL); if (!tegra) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra20-emc.c b/drivers/clk/tegra/clk-tegra20-emc.c index dd74b8543bf1..20efe7827d27 100644 --- a/drivers/clk/tegra/clk-tegra20-emc.c +++ b/drivers/clk/tegra/clk-tegra20-emc.c @@ -249,7 +249,7 @@ struct clk *tegra20_clk_register_emc(void __iomem *ioaddr, bool low_jitter) struct clk_init_data init; struct clk *clk; - emc = kzalloc(sizeof(*emc), GFP_KERNEL); + emc = kzalloc_obj(*emc, GFP_KERNEL); if (!emc) return NULL; diff --git a/drivers/clk/tegra/clk-tegra210-emc.c b/drivers/clk/tegra/clk-tegra210-emc.c index fbf3c894eb56..9e88cd587183 100644 --- a/drivers/clk/tegra/clk-tegra210-emc.c +++ b/drivers/clk/tegra/clk-tegra210-emc.c @@ -278,7 +278,7 @@ struct clk *tegra210_clk_register_emc(struct device_node *np, struct clk_init_data init; struct clk *clk; - emc = kzalloc(sizeof(*emc), GFP_KERNEL); + emc = kzalloc_obj(*emc, GFP_KERNEL); if (!emc) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index 504d0ea997a5..ad21a735723e 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3705,8 +3705,7 @@ static void tegra210_mbist_clk_init(void) if (!num_clks) continue; - clk_data = kmalloc_array(num_clks, sizeof(*clk_data), - GFP_KERNEL); + clk_data = kmalloc_objs(*clk_data, num_clks, GFP_KERNEL); if (WARN_ON(!clk_data)) return; diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c index 19037346f522..7f11d1795d79 100644 --- a/drivers/clk/tegra/clk.c +++ b/drivers/clk/tegra/clk.c @@ -227,15 +227,14 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) if (WARN_ON(banks > ARRAY_SIZE(periph_regs))) return NULL; - periph_clk_enb_refcnt = kcalloc(32 * banks, - sizeof(*periph_clk_enb_refcnt), - GFP_KERNEL); + periph_clk_enb_refcnt = kzalloc_objs(*periph_clk_enb_refcnt, 32 * banks, + GFP_KERNEL); if (!periph_clk_enb_refcnt) return NULL; periph_banks = banks; - clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); + clks = kzalloc_objs(struct clk *, num, GFP_KERNEL); if (!clks) { kfree(periph_clk_enb_refcnt); return NULL; diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 43514e6f3b78..5ec7cfd5e669 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -183,9 +183,9 @@ static void __init of_dra7_apll_setup(struct device_node *node) const char **parent_names = NULL; int ret; - ad = kzalloc(sizeof(*ad), GFP_KERNEL); - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); - init = kzalloc(sizeof(*init), GFP_KERNEL); + ad = kzalloc_obj(*ad, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + init = kzalloc_obj(*init, GFP_KERNEL); if (!ad || !clk_hw || !init) goto cleanup; @@ -347,9 +347,9 @@ static void __init of_omap2_apll_setup(struct device_node *node) u32 val; int ret; - ad = kzalloc(sizeof(*ad), GFP_KERNEL); - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); - init = kzalloc(sizeof(*init), GFP_KERNEL); + ad = kzalloc_obj(*ad, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + init = kzalloc_obj(*init, GFP_KERNEL); if (!ad || !clk_hw || !init) goto cleanup; diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c index a99aaf2e7684..62b136861f95 100644 --- a/drivers/clk/ti/autoidle.c +++ b/drivers/clk/ti/autoidle.c @@ -191,7 +191,7 @@ int __init of_ti_clk_autoidle_setup(struct device_node *node) if (of_property_read_u32(node, "ti,autoidle-shift", &shift)) return 0; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return -ENOMEM; diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index b02f84d49b96..fd41aa9fbab1 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -170,7 +170,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node) const char *name; struct clk *clk; - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); if (!clk_hw) { pr_err("%s: could not allocate dra7_atl_desc\n", __func__); return; diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 693a4459a01b..23ab4f380956 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c @@ -268,7 +268,7 @@ int __init ti_clk_retry_init(struct device_node *node, void *user, struct clk_init_item *retry; pr_debug("%pOFn: adding to retry list...\n", node); - retry = kzalloc(sizeof(*retry), GFP_KERNEL); + retry = kzalloc_obj(*retry, GFP_KERNEL); if (!retry) return -ENOMEM; @@ -411,7 +411,7 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index, /* add clocks node info */ clocks_node_ptr[index] = clocks; - io = kzalloc(sizeof(*io), GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!io) return -ENOMEM; @@ -576,7 +576,7 @@ int ti_clk_add_alias(struct clk *clk, const char *con) if (IS_ERR(clk)) return PTR_ERR(clk); - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return -ENOMEM; diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 607e34d8e289..06a39d981733 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -297,7 +297,7 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider, ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT); - clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL); + clkctrl_clk = kzalloc_obj(*clkctrl_clk, GFP_KERNEL); if (!init.name || !clkctrl_clk) { ret = -ENOMEM; goto cleanup; @@ -337,7 +337,7 @@ _ti_clkctrl_setup_gate(struct omap_clkctrl_provider *provider, { struct clk_hw_omap *clk_hw; - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); if (!clk_hw) return; @@ -360,7 +360,7 @@ _ti_clkctrl_setup_mux(struct omap_clkctrl_provider *provider, int num_parents = 0; const char * const *pname; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return; @@ -395,7 +395,7 @@ _ti_clkctrl_setup_div(struct omap_clkctrl_provider *provider, const struct omap_clkctrl_div_data *div_data = data->data; u8 div_flags = 0; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return; @@ -579,7 +579,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) return; } - provider = kzalloc(sizeof(*provider), GFP_KERNEL); + provider = kzalloc_obj(*provider, GFP_KERNEL); if (!provider) return; @@ -650,7 +650,7 @@ clkdm_found: continue; } - hw = kzalloc(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) return; @@ -683,7 +683,7 @@ clkdm_found: if (!init.name) goto cleanup; - clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL); + clkctrl_clk = kzalloc_obj(*clkctrl_clk, GFP_KERNEL); if (!clkctrl_clk) goto cleanup; diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c index 8cba259188d4..0403995cd8ac 100644 --- a/drivers/clk/ti/composite.c +++ b/drivers/clk/ti/composite.c @@ -211,7 +211,7 @@ static void __init of_ti_composite_clk_setup(struct device_node *node) return; } - cclk = kzalloc(sizeof(*cclk), GFP_KERNEL); + cclk = kzalloc_obj(*cclk, GFP_KERNEL); if (!cclk) return; @@ -253,7 +253,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, of_clk_parent_fill(node, parent_names, num_parents); - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) { kfree(parent_names); return -ENOMEM; diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c index 6f58a0f2e74a..af2776f13413 100644 --- a/drivers/clk/ti/divider.c +++ b/drivers/clk/ti/divider.c @@ -357,7 +357,7 @@ int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div, num_dividers = i; - tmp = kcalloc(valid_div + 1, sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_objs(*tmp, valid_div + 1, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -413,7 +413,7 @@ static int __init ti_clk_get_div_table(struct device_node *node, return -EINVAL; } - table = kcalloc(valid_div + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, valid_div + 1, GFP_KERNEL); if (!table) return -ENOMEM; @@ -517,7 +517,7 @@ static void __init of_ti_divider_clk_setup(struct device_node *node) u32 flags = 0; struct clk_omap_divider *div; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return; @@ -542,7 +542,7 @@ static void __init of_ti_composite_divider_clk_setup(struct device_node *node) struct clk_omap_divider *div; u32 tmp; - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return; diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index 971adafd9a8b..bce9af95d7aa 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c @@ -222,7 +222,7 @@ static void _register_dpll_x2(struct device_node *node, return; } - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); if (!clk_hw) return; @@ -281,8 +281,8 @@ static void __init of_ti_dpll_setup(struct device_node *node, u32 min_div; dd = kmemdup(ddt, sizeof(*dd), GFP_KERNEL); - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); - init = kzalloc(sizeof(*init), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + init = kzalloc_obj(*init, GFP_KERNEL); if (!dd || !clk_hw || !init) goto cleanup; diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c index 4f28138d2d8a..22be4570b038 100644 --- a/drivers/clk/ti/fapll.c +++ b/drivers/clk/ti/fapll.c @@ -499,7 +499,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, struct fapll_synth *synth; struct clk *clk = ERR_PTR(-ENOMEM); - init = kzalloc(sizeof(*init), GFP_KERNEL); + init = kzalloc_obj(*init, GFP_KERNEL); if (!init) return ERR_PTR(-ENOMEM); @@ -508,7 +508,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, init->parent_names = &parent; init->num_parents = 1; - synth = kzalloc(sizeof(*synth), GFP_KERNEL); + synth = kzalloc_obj(*synth, GFP_KERNEL); if (!synth) goto free; @@ -544,7 +544,7 @@ static void __init ti_fapll_setup(struct device_node *node) const char *name; int i; - fd = kzalloc(sizeof(*fd), GFP_KERNEL); + fd = kzalloc_obj(*fd, GFP_KERNEL); if (!fd) return; @@ -554,7 +554,7 @@ static void __init ti_fapll_setup(struct device_node *node) if (!fd->outputs.clks) goto free; - init = kzalloc(sizeof(*init), GFP_KERNEL); + init = kzalloc_obj(*init, GFP_KERNEL); if (!init) goto free; diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c index a9febd6356b8..73986d78492a 100644 --- a/drivers/clk/ti/gate.c +++ b/drivers/clk/ti/gate.c @@ -95,7 +95,7 @@ static struct clk *_register_gate(struct device_node *node, const char *name, struct clk_hw_omap *clk_hw; struct clk *clk; - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); if (!clk_hw) return ERR_PTR(-ENOMEM); @@ -169,7 +169,7 @@ _of_ti_composite_gate_clk_setup(struct device_node *node, { struct clk_hw_omap *gate; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return; diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c index 3eb35c87c0ed..999e230d7414 100644 --- a/drivers/clk/ti/interface.c +++ b/drivers/clk/ti/interface.c @@ -34,7 +34,7 @@ static struct clk *_register_interface(struct device_node *node, struct clk_hw_omap *clk_hw; struct clk *clk; - clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); if (!clk_hw) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index d6d247ff2be5..3911e43a6716 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -129,7 +129,7 @@ static struct clk *_register_mux(struct device_node *node, const char *name, struct clk_init_data init; /* allocate the mux */ - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -227,7 +227,7 @@ struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup) if (!setup) return NULL; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -253,7 +253,7 @@ static void __init of_ti_composite_mux_clk_setup(struct device_node *node) struct clk_omap_mux *mux; unsigned int num_parents; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return; diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c index b85ee0930369..5639474557fe 100644 --- a/drivers/clk/ux500/clk-prcc.c +++ b/drivers/clk/ux500/clk-prcc.c @@ -106,7 +106,7 @@ static struct clk *clk_reg_prcc(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c index f775e18acd46..95efbc4f84a7 100644 --- a/drivers/clk/ux500/clk-prcmu.c +++ b/drivers/clk/ux500/clk-prcmu.c @@ -209,7 +209,7 @@ static struct clk_hw *clk_reg_prcmu(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ struct clk_hw *clk_reg_prcmu_clkout(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c index 8e2f6c65db2a..42c1df2382ee 100644 --- a/drivers/clk/ux500/u8500_of_clk.c +++ b/drivers/clk/ux500/u8500_of_clk.c @@ -137,7 +137,7 @@ static void u8500_clk_init(struct device_node *np) * base addresses properly and pass to the reset controller init * function later on. */ - rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); + rstc = kzalloc_obj(*rstc, GFP_KERNEL); if (!rstc) return; diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index 86ca04ad9fab..d95d66cd5b6a 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -363,7 +363,7 @@ struct clk *icst_clk_setup(struct device *dev, struct clk_init_data init; struct icst_params *pclone; - icst = kzalloc(sizeof(*icst), GFP_KERNEL); + icst = kzalloc_obj(*icst, GFP_KERNEL); if (!icst) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c index 033d4f78edc8..5f83760b68d4 100644 --- a/drivers/clk/versatile/clk-sp810.c +++ b/drivers/clk/versatile/clk-sp810.c @@ -82,7 +82,7 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec, static void __init clk_sp810_of_setup(struct device_node *node) { - struct clk_sp810 *sp810 = kzalloc(sizeof(*sp810), GFP_KERNEL); + struct clk_sp810 *sp810 = kzalloc_obj(*sp810, GFP_KERNEL); const char *parent_names[2]; int num = ARRAY_SIZE(parent_names); char name[12]; diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c index 681721d85032..7494a24134de 100644 --- a/drivers/clk/visconti/pll.c +++ b/drivers/clk/visconti/pll.c @@ -255,7 +255,7 @@ static struct clk_hw *visconti_register_pll(struct visconti_pll_provider *ctx, size_t len; int ret; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); @@ -330,7 +330,7 @@ struct visconti_pll_provider * __init visconti_init_pll(struct device_node *np, struct visconti_pll_provider *ctx; int i; - ctx = kzalloc(struct_size(ctx, clk_data.hws, nr_plls), GFP_KERNEL); + ctx = kzalloc_flex(*ctx, clk_data.hws, nr_plls, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c index c28d3dacf0fb..4a5f2b6267c0 100644 --- a/drivers/clk/zynq/clkc.c +++ b/drivers/clk/zynq/clkc.c @@ -112,10 +112,10 @@ static void __init zynq_clk_register_fclk(enum zynq_clk fclk, spinlock_t *fclk_gate_lock; void __iomem *fclk_gate_reg = fclk_ctrl_reg + 8; - fclk_lock = kmalloc(sizeof(*fclk_lock), GFP_KERNEL); + fclk_lock = kmalloc_obj(*fclk_lock, GFP_KERNEL); if (!fclk_lock) goto err; - fclk_gate_lock = kmalloc(sizeof(*fclk_gate_lock), GFP_KERNEL); + fclk_gate_lock = kmalloc_obj(*fclk_gate_lock, GFP_KERNEL); if (!fclk_gate_lock) goto err_fclk_gate_lock; spin_lock_init(fclk_lock); @@ -180,7 +180,7 @@ static void __init zynq_clk_register_periph_clk(enum zynq_clk clk0, char *div_name; spinlock_t *lock; - lock = kmalloc(sizeof(*lock), GFP_KERNEL); + lock = kmalloc_obj(*lock, GFP_KERNEL); if (!lock) goto err; spin_lock_init(lock); diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c index 5eca1c14981a..0c411ad86575 100644 --- a/drivers/clk/zynq/pll.c +++ b/drivers/clk/zynq/pll.c @@ -200,7 +200,7 @@ struct clk *clk_register_zynq_pll(const char *name, const char *parent, .flags = 0 }; - pll = kmalloc(sizeof(*pll), GFP_KERNEL); + pll = kmalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index b89e55737198..2e36f14d0a52 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -115,7 +115,7 @@ struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id, struct clk_init_data init; /* allocate the gate */ - gate = kzalloc(sizeof(*gate), GFP_KERNEL); + gate = kzalloc_obj(*gate, GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c index 9b5d3050b742..f8d67adfd258 100644 --- a/drivers/clk/zynqmp/clk-mux-zynqmp.c +++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c @@ -138,7 +138,7 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id, struct clk_init_data init; int ret; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c index a91d98e238c2..c71401b3aa1f 100644 --- a/drivers/clk/zynqmp/clkc.c +++ b/drivers/clk/zynqmp/clkc.c @@ -759,12 +759,11 @@ static int zynqmp_clk_setup(struct device_node *np) if (ret) return ret; - zynqmp_data = kzalloc(struct_size(zynqmp_data, hws, clock_max_idx), - GFP_KERNEL); + zynqmp_data = kzalloc_flex(*zynqmp_data, hws, clock_max_idx, GFP_KERNEL); if (!zynqmp_data) return -ENOMEM; - clock = kcalloc(clock_max_idx, sizeof(*clock), GFP_KERNEL); + clock = kzalloc_objs(*clock, clock_max_idx, GFP_KERNEL); if (!clock) { kfree(zynqmp_data); return -ENOMEM; diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index 984e577ea671..3c147ba7dbcc 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -284,7 +284,7 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, int ret; /* allocate the divider */ - div = kzalloc(sizeof(*div), GFP_KERNEL); + div = kzalloc_obj(*div, GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 6bc2c3934f56..1cd5e0493e98 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -326,7 +326,7 @@ struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, init.parent_names = parents; init.num_parents = 1; - pll = kzalloc(sizeof(*pll), GFP_KERNEL); + pll = kzalloc_obj(*pll, GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index 319c0c780a15..ff0e21edd9c1 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c @@ -98,7 +98,7 @@ static int __init bcm2835_timer_init(struct device_node *node) goto err_iounmap; } - timer = kzalloc(sizeof(*timer), GFP_KERNEL); + timer = kzalloc_obj(*timer, GFP_KERNEL); if (!timer) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c index bbceb0289d45..75c17eeef689 100644 --- a/drivers/clocksource/clps711x-timer.c +++ b/drivers/clocksource/clps711x-timer.c @@ -54,7 +54,7 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, struct clock_event_device *clkevt; unsigned long rate; - clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL); + clkevt = kzalloc_obj(*clkevt, GFP_KERNEL); if (!clkevt) return -ENOMEM; diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c index 3a55ae5fe225..043793728e23 100644 --- a/drivers/clocksource/dw_apb_timer.c +++ b/drivers/clocksource/dw_apb_timer.c @@ -222,8 +222,8 @@ struct dw_apb_clock_event_device * dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, void __iomem *base, int irq, unsigned long freq) { - struct dw_apb_clock_event_device *dw_ced = - kzalloc(sizeof(*dw_ced), GFP_KERNEL); + struct dw_apb_clock_event_device *dw_ced = kzalloc_obj(*dw_ced, + GFP_KERNEL); int err; if (!dw_ced) @@ -340,7 +340,7 @@ struct dw_apb_clocksource * dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base, unsigned long freq) { - struct dw_apb_clocksource *dw_cs = kzalloc(sizeof(*dw_cs), GFP_KERNEL); + struct dw_apb_clocksource *dw_cs = kzalloc_obj(*dw_cs, GFP_KERNEL); if (!dw_cs) return NULL; diff --git a/drivers/clocksource/ingenic-sysost.c b/drivers/clocksource/ingenic-sysost.c index e79cfb0b8e05..22caa69197a2 100644 --- a/drivers/clocksource/ingenic-sysost.c +++ b/drivers/clocksource/ingenic-sysost.c @@ -279,7 +279,7 @@ static int __init ingenic_ost_register_clock(struct ingenic_ost *ost, struct ingenic_ost_clk *ost_clk; int val, err; - ost_clk = kzalloc(sizeof(*ost_clk), GFP_KERNEL); + ost_clk = kzalloc_obj(*ost_clk, GFP_KERNEL); if (!ost_clk) return -ENOMEM; @@ -432,7 +432,7 @@ static int __init ingenic_ost_probe(struct device_node *np) unsigned int i; int ret; - ost = kzalloc(sizeof(*ost), GFP_KERNEL); + ost = kzalloc_obj(*ost, GFP_KERNEL); if (!ost) return -ENOMEM; @@ -458,8 +458,8 @@ static int __init ingenic_ost_probe(struct device_node *np) ost->soc_info = id->data; - ost->clocks = kzalloc(struct_size(ost->clocks, hws, ost->soc_info->num_channels), - GFP_KERNEL); + ost->clocks = kzalloc_flex(*ost->clocks, hws, + ost->soc_info->num_channels, GFP_KERNEL); if (!ost->clocks) { ret = -ENOMEM; goto err_clk_disable; diff --git a/drivers/clocksource/ingenic-timer.c b/drivers/clocksource/ingenic-timer.c index 154ee5f7954a..3c545cb756af 100644 --- a/drivers/clocksource/ingenic-timer.c +++ b/drivers/clocksource/ingenic-timer.c @@ -286,8 +286,7 @@ static int __init ingenic_tcu_init(struct device_node *np) if (IS_ERR(map)) return PTR_ERR(map); - tcu = kzalloc(struct_size(tcu, timers, num_possible_cpus()), - GFP_KERNEL); + tcu = kzalloc_flex(*tcu, timers, num_possible_cpus(), GFP_KERNEL); if (!tcu) return -ENOMEM; diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c index 9de751531831..286513486542 100644 --- a/drivers/clocksource/mmio.c +++ b/drivers/clocksource/mmio.c @@ -55,7 +55,7 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name, if (bits > 64 || bits < 16) return -EINVAL; - cs = kzalloc(sizeof(struct clocksource_mmio), GFP_KERNEL); + cs = kzalloc_obj(struct clocksource_mmio, GFP_KERNEL); if (!cs) return -ENOMEM; diff --git a/drivers/clocksource/mps2-timer.c b/drivers/clocksource/mps2-timer.c index efe8cad8f2a5..53c484d29195 100644 --- a/drivers/clocksource/mps2-timer.c +++ b/drivers/clocksource/mps2-timer.c @@ -136,7 +136,7 @@ static int __init mps2_clockevent_init(struct device_node *np) goto out_iounmap; } - ce = kzalloc(sizeof(*ce), GFP_KERNEL); + ce = kzalloc_obj(*ce, GFP_KERNEL); if (!ce) { ret = -ENOMEM; goto out_iounmap; diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c index 2089aeaae225..36132692bae5 100644 --- a/drivers/clocksource/renesas-ostm.c +++ b/drivers/clocksource/renesas-ostm.c @@ -165,7 +165,7 @@ static int __init ostm_init(struct device_node *np) struct timer_of *to; int ret; - to = kzalloc(sizeof(*to), GFP_KERNEL); + to = kzalloc_obj(*to, GFP_KERNEL); if (!to) return -ENOMEM; diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 791b298c995b..fd8cdabef9bc 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -1084,8 +1084,8 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) /* Allocate and setup the channels. */ cmt->num_channels = hweight8(cmt->hw_channels); - cmt->channels = kcalloc(cmt->num_channels, sizeof(*cmt->channels), - GFP_KERNEL); + cmt->channels = kzalloc_objs(*cmt->channels, cmt->num_channels, + GFP_KERNEL); if (cmt->channels == NULL) { ret = -ENOMEM; goto err_unmap; @@ -1139,7 +1139,7 @@ static int sh_cmt_probe(struct platform_device *pdev) goto out; } - cmt = kzalloc(sizeof(*cmt), GFP_KERNEL); + cmt = kzalloc_obj(*cmt, GFP_KERNEL); if (cmt == NULL) return -ENOMEM; diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 34872df5458a..333548989ed5 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -420,8 +420,8 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, mtu->num_channels = min_t(unsigned int, ret, ARRAY_SIZE(sh_mtu2_channel_offsets)); - mtu->channels = kcalloc(mtu->num_channels, sizeof(*mtu->channels), - GFP_KERNEL); + mtu->channels = kzalloc_objs(*mtu->channels, mtu->num_channels, + GFP_KERNEL); if (mtu->channels == NULL) { ret = -ENOMEM; goto err_unmap; @@ -462,7 +462,7 @@ static int sh_mtu2_probe(struct platform_device *pdev) goto out; } - mtu = kzalloc(sizeof(*mtu), GFP_KERNEL); + mtu = kzalloc_obj(*mtu, GFP_KERNEL); if (mtu == NULL) return -ENOMEM; diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 3fc6ed9b5630..365739e1fbad 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -546,8 +546,8 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) } /* Allocate and setup the channels. */ - tmu->channels = kcalloc(tmu->num_channels, sizeof(*tmu->channels), - GFP_KERNEL); + tmu->channels = kzalloc_objs(*tmu->channels, tmu->num_channels, + GFP_KERNEL); if (tmu->channels == NULL) { ret = -ENOMEM; goto err_unmap; @@ -593,7 +593,7 @@ static int sh_tmu_probe(struct platform_device *pdev) goto out; } - tmu = kzalloc(sizeof(*tmu), GFP_KERNEL); + tmu = kzalloc_obj(*tmu, GFP_KERNEL); if (tmu == NULL) return -ENOMEM; diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c index b4f264ed1937..253c3e4d0296 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c @@ -170,7 +170,7 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) int ret; struct pit_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c index b8a1cf59b9d6..836141e51118 100644 --- a/drivers/clocksource/timer-cadence-ttc.c +++ b/drivers/clocksource/timer-cadence-ttc.c @@ -334,7 +334,7 @@ static int __init ttc_setup_clocksource(struct clk *clk, void __iomem *base, struct ttc_timer_clocksource *ttccs; int err; - ttccs = kzalloc(sizeof(*ttccs), GFP_KERNEL); + ttccs = kzalloc_obj(*ttccs, GFP_KERNEL); if (!ttccs) return -ENOMEM; @@ -417,7 +417,7 @@ static int __init ttc_setup_clockevent(struct clk *clk, struct ttc_timer_clockevent *ttcce; int err; - ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL); + ttcce = kzalloc_obj(*ttcce, GFP_KERNEL); if (!ttcce) return -ENOMEM; diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c index b1c248498be4..9bf1728a87dc 100644 --- a/drivers/clocksource/timer-davinci.c +++ b/drivers/clocksource/timer-davinci.c @@ -271,7 +271,7 @@ int __init davinci_timer_register(struct clk *clk, davinci_timer_init(base); tick_rate = clk_get_rate(clk); - clockevent = kzalloc(sizeof(*clockevent), GFP_KERNEL); + clockevent = kzalloc_obj(*clockevent, GFP_KERNEL); if (!clockevent) { rv = -ENOMEM; goto exit_iounmap_base; diff --git a/drivers/clocksource/timer-ep93xx.c b/drivers/clocksource/timer-ep93xx.c index 6981ff3ac8a9..04eeda15d997 100644 --- a/drivers/clocksource/timer-ep93xx.c +++ b/drivers/clocksource/timer-ep93xx.c @@ -141,7 +141,7 @@ static int __init ep93xx_timer_of_init(struct device_node *np) struct ep93xx_tcu *tcu; int ret; - tcu = kzalloc(sizeof(*tcu), GFP_KERNEL); + tcu = kzalloc_obj(*tcu, GFP_KERNEL); if (!tcu) return -ENOMEM; diff --git a/drivers/clocksource/timer-fsl-ftm.c b/drivers/clocksource/timer-fsl-ftm.c index 93f336ec875a..df82307e690c 100644 --- a/drivers/clocksource/timer-fsl-ftm.c +++ b/drivers/clocksource/timer-fsl-ftm.c @@ -300,7 +300,7 @@ static int __init ftm_timer_init(struct device_node *np) unsigned long freq; int ret, irq; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index 126fb1f259b2..e0f7d5976518 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -295,7 +295,7 @@ static int __init fttmr010_common_init(struct device_node *np, return ret; } - fttmr010 = kzalloc(sizeof(*fttmr010), GFP_KERNEL); + fttmr010 = kzalloc_obj(*fttmr010, GFP_KERNEL); if (!fttmr010) { ret = -ENOMEM; goto out_disable_clock; diff --git a/drivers/clocksource/timer-goldfish.c b/drivers/clocksource/timer-goldfish.c index 0512d5eabc82..60982561e8b6 100644 --- a/drivers/clocksource/timer-goldfish.c +++ b/drivers/clocksource/timer-goldfish.c @@ -102,7 +102,7 @@ int __init goldfish_timer_init(int irq, void __iomem *base) struct goldfish_timer *timerdrv; int ret; - timerdrv = kzalloc(sizeof(*timerdrv), GFP_KERNEL); + timerdrv = kzalloc_obj(*timerdrv, GFP_KERNEL); if (!timerdrv) return -ENOMEM; diff --git a/drivers/clocksource/timer-gxp.c b/drivers/clocksource/timer-gxp.c index 48a73c101eb8..7442e9bdd0d5 100644 --- a/drivers/clocksource/timer-gxp.c +++ b/drivers/clocksource/timer-gxp.c @@ -76,7 +76,7 @@ static int __init gxp_timer_init(struct device_node *node) u32 freq; int ret, irq; - gxp_timer = kzalloc(sizeof(*gxp_timer), GFP_KERNEL); + gxp_timer = kzalloc_obj(*gxp_timer, GFP_KERNEL); if (!gxp_timer) { ret = -ENOMEM; pr_err("Can't allocate gxp_timer"); diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c index 489e69169ed4..ad310be44cb6 100644 --- a/drivers/clocksource/timer-imx-gpt.c +++ b/drivers/clocksource/timer-imx-gpt.c @@ -428,7 +428,7 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t if (initialized) return 0; - imxtm = kzalloc(sizeof(*imxtm), GFP_KERNEL); + imxtm = kzalloc_obj(*imxtm, GFP_KERNEL); if (!imxtm) return -ENOMEM; diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index 44525813be1e..5eb3b3c6d0ad 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -139,7 +139,7 @@ static int __init __sysctr_timer_init(struct device_node *np) void __iomem *base; int ret; - priv = kzalloc(sizeof(struct sysctr_private), GFP_KERNEL); + priv = kzalloc_obj(struct sysctr_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/clocksource/timer-ixp4xx.c b/drivers/clocksource/timer-ixp4xx.c index 720ed70a2964..42f679b1165b 100644 --- a/drivers/clocksource/timer-ixp4xx.c +++ b/drivers/clocksource/timer-ixp4xx.c @@ -166,7 +166,7 @@ static __init int ixp4xx_timer_register(void __iomem *base, struct ixp4xx_timer *tmr; int ret; - tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); + tmr = kzalloc_obj(*tmr, GFP_KERNEL); if (!tmr) return -ENOMEM; tmr->base = base; diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c index 57209bb38c70..d54a1c91781f 100644 --- a/drivers/clocksource/timer-microchip-pit64b.c +++ b/drivers/clocksource/timer-microchip-pit64b.c @@ -350,7 +350,7 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer, struct mchp_pit64b_clksrc *cs; int ret; - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; @@ -397,7 +397,7 @@ static int __init mchp_pit64b_init_clkevt(struct mchp_pit64b_timer *timer, struct mchp_pit64b_clkevt *ce; int ret; - ce = kzalloc(sizeof(*ce), GFP_KERNEL); + ce = kzalloc_obj(*ce, GFP_KERNEL); if (!ce) return -ENOMEM; diff --git a/drivers/clocksource/timer-msc313e.c b/drivers/clocksource/timer-msc313e.c index 54c54ca7c786..33822f0bc339 100644 --- a/drivers/clocksource/timer-msc313e.c +++ b/drivers/clocksource/timer-msc313e.c @@ -171,7 +171,7 @@ static int __init msc313e_clkevt_init(struct device_node *np) int ret; struct timer_of *to; - to = kzalloc(sizeof(*to), GFP_KERNEL); + to = kzalloc_obj(*to, GFP_KERNEL); if (!to) return -ENOMEM; diff --git a/drivers/clocksource/timer-nxp-pit.c b/drivers/clocksource/timer-nxp-pit.c index d1740f18f718..9109dedab08c 100644 --- a/drivers/clocksource/timer-nxp-pit.c +++ b/drivers/clocksource/timer-nxp-pit.c @@ -276,7 +276,7 @@ static int pit_timer_init(struct device_node *np) unsigned long clk_rate; int irq, ret; - pit = kzalloc(sizeof(*pit), GFP_KERNEL); + pit = kzalloc_obj(*pit, GFP_KERNEL); if (!pit) return -ENOMEM; diff --git a/drivers/clocksource/timer-rockchip.c b/drivers/clocksource/timer-rockchip.c index 1f95d0aca08f..c866127ee1e5 100644 --- a/drivers/clocksource/timer-rockchip.c +++ b/drivers/clocksource/timer-rockchip.c @@ -207,7 +207,7 @@ static int __init rk_clkevt_init(struct device_node *np) struct clock_event_device *ce; int ret = -EINVAL; - rk_clkevt = kzalloc(sizeof(struct rk_clkevt), GFP_KERNEL); + rk_clkevt = kzalloc_obj(struct rk_clkevt, GFP_KERNEL); if (!rk_clkevt) { ret = -ENOMEM; goto out; @@ -254,7 +254,7 @@ static int __init rk_clksrc_init(struct device_node *np) { int ret = -EINVAL; - rk_clksrc = kzalloc(sizeof(struct rk_timer), GFP_KERNEL); + rk_clksrc = kzalloc_obj(struct rk_timer, GFP_KERNEL); if (!rk_clksrc) { ret = -ENOMEM; goto out; diff --git a/drivers/clocksource/timer-stm32.c b/drivers/clocksource/timer-stm32.c index 0a4ea3288bfb..4a0f06a419d7 100644 --- a/drivers/clocksource/timer-stm32.c +++ b/drivers/clocksource/timer-stm32.c @@ -291,7 +291,7 @@ static int __init stm32_timer_init(struct device_node *node) struct timer_of *to; int ret; - to = kzalloc(sizeof(*to), GFP_KERNEL); + to = kzalloc_obj(*to, GFP_KERNEL); if (!to) return -ENOMEM; @@ -302,8 +302,7 @@ static int __init stm32_timer_init(struct device_node *node) if (ret) goto err; - to->private_data = kzalloc(sizeof(struct stm32_timer_private), - GFP_KERNEL); + to->private_data = kzalloc_obj(struct stm32_timer_private, GFP_KERNEL); if (!to->private_data) { ret = -ENOMEM; goto deinit; diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c index 985a6d08512b..3bffd7198a38 100644 --- a/drivers/clocksource/timer-ti-dm-systimer.c +++ b/drivers/clocksource/timer-ti-dm-systimer.c @@ -600,7 +600,7 @@ static int __init dmtimer_clockevent_init(struct device_node *np) struct dmtimer_clockevent *clkevt; int error; - clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL); + clkevt = kzalloc_obj(*clkevt, GFP_KERNEL); if (!clkevt) return -ENOMEM; @@ -757,7 +757,7 @@ static int __init dmtimer_clocksource_init(struct device_node *np) struct clocksource *dev; int error; - clksrc = kzalloc(sizeof(*clksrc), GFP_KERNEL); + clksrc = kzalloc_obj(*clksrc, GFP_KERNEL); if (!clksrc) return -ENOMEM; diff --git a/drivers/clocksource/timer-zevio.c b/drivers/clocksource/timer-zevio.c index ecaa3568841c..db1ba9b2c2c9 100644 --- a/drivers/clocksource/timer-zevio.c +++ b/drivers/clocksource/timer-zevio.c @@ -119,7 +119,7 @@ static int __init zevio_timer_add(struct device_node *node) struct resource res; int irqnr, ret; - timer = kzalloc(sizeof(*timer), GFP_KERNEL); + timer = kzalloc_obj(*timer, GFP_KERNEL); if (!timer) return -ENOMEM; diff --git a/drivers/comedi/comedi_buf.c b/drivers/comedi/comedi_buf.c index 785977b40a93..7215d4b9152b 100644 --- a/drivers/comedi/comedi_buf.c +++ b/drivers/comedi/comedi_buf.c @@ -70,7 +70,7 @@ comedi_buf_map_alloc(struct comedi_device *dev, enum dma_data_direction dma_dir, struct comedi_buf_page *buf; unsigned int i; - bm = kzalloc(sizeof(*bm), GFP_KERNEL); + bm = kzalloc_obj(*bm, GFP_KERNEL); if (!bm) return NULL; diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c index 25aa4296f3b0..627680057812 100644 --- a/drivers/comedi/comedi_fops.c +++ b/drivers/comedi/comedi_fops.c @@ -1058,7 +1058,7 @@ static int do_subdinfo_ioctl(struct comedi_device *dev, struct comedi_subdevice *s; lockdep_assert_held(&dev->mutex); - tmp = kcalloc(dev->n_subdevices, sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_objs(*tmp, dev->n_subdevices, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -2969,7 +2969,7 @@ static int comedi_open(struct inode *inode, struct file *file) return -ENODEV; } - cfp = kzalloc(sizeof(*cfp), GFP_KERNEL); + cfp = kzalloc_obj(*cfp, GFP_KERNEL); if (!cfp) { comedi_dev_put(dev); return -ENOMEM; @@ -3322,7 +3322,7 @@ static int compat_insnlist(struct file *file, unsigned long arg) rc = check_insnlist_len(dev, insnlist32.n_insns); if (rc) return rc; - insns = kcalloc(insnlist32.n_insns, sizeof(*insns), GFP_KERNEL); + insns = kzalloc_objs(*insns, insnlist32.n_insns, GFP_KERNEL); if (!insns) return -ENOMEM; @@ -3505,7 +3505,7 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device) struct device *csdev; unsigned int i; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); comedi_device_init(dev); diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c index 69cd2a253c66..b0e39a04f0b3 100644 --- a/drivers/comedi/drivers.c +++ b/drivers/comedi/drivers.c @@ -101,7 +101,7 @@ int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices) if (num_subdevices < 1) return -EINVAL; - s = kcalloc(num_subdevices, sizeof(*s), GFP_KERNEL); + s = kzalloc_objs(*s, num_subdevices, GFP_KERNEL); if (!s) return -ENOMEM; dev->subdevices = s; @@ -733,7 +733,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev, dev_warn(dev->class_dev, "async subdevices should have a cancel() function\n"); - async = kzalloc(sizeof(*async), GFP_KERNEL); + async = kzalloc_obj(*async, GFP_KERNEL); if (!async) return -ENOMEM; diff --git a/drivers/comedi/drivers/addi_apci_2032.c b/drivers/comedi/drivers/addi_apci_2032.c index e048dfc3ec77..b81837cd4ad5 100644 --- a/drivers/comedi/drivers/addi_apci_2032.c +++ b/drivers/comedi/drivers/addi_apci_2032.c @@ -274,7 +274,7 @@ static int apci2032_auto_attach(struct comedi_device *dev, struct apci2032_int_private *subpriv; dev->read_subdev = s; - subpriv = kzalloc(sizeof(*subpriv), GFP_KERNEL); + subpriv = kzalloc_obj(*subpriv, GFP_KERNEL); if (!subpriv) return -ENOMEM; spin_lock_init(&subpriv->spinlock); diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c index 6beca2a6d66e..a748b452d76d 100644 --- a/drivers/comedi/drivers/comedi_8254.c +++ b/drivers/comedi/drivers/comedi_8254.c @@ -633,7 +633,7 @@ static struct comedi_8254 *__i8254_init(comedi_8254_iocb_fn *iocb, if (!iocb) return ERR_PTR(-EINVAL); - i8254 = kzalloc(sizeof(*i8254), GFP_KERNEL); + i8254 = kzalloc_obj(*i8254, GFP_KERNEL); if (!i8254) return ERR_PTR(-ENOMEM); diff --git a/drivers/comedi/drivers/comedi_bond.c b/drivers/comedi/drivers/comedi_bond.c index 30650fa36fff..1b530c819fc0 100644 --- a/drivers/comedi/drivers/comedi_bond.c +++ b/drivers/comedi/drivers/comedi_bond.c @@ -223,7 +223,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) nchans, minor, sdev); return -EINVAL; } - bdev = kmalloc(sizeof(*bdev), GFP_KERNEL); + bdev = kmalloc_obj(*bdev, GFP_KERNEL); if (!bdev) return -ENOMEM; diff --git a/drivers/comedi/drivers/comedi_isadma.c b/drivers/comedi/drivers/comedi_isadma.c index 020b3d1e1ac0..259678bfd1f3 100644 --- a/drivers/comedi/drivers/comedi_isadma.c +++ b/drivers/comedi/drivers/comedi_isadma.c @@ -161,11 +161,11 @@ struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *dev, if (n_desc < 1 || n_desc > 2) goto no_dma; - dma = kzalloc(sizeof(*dma), GFP_KERNEL); + dma = kzalloc_obj(*dma, GFP_KERNEL); if (!dma) goto no_dma; - desc = kcalloc(n_desc, sizeof(*desc), GFP_KERNEL); + desc = kzalloc_objs(*desc, n_desc, GFP_KERNEL); if (!desc) goto no_dma; dma->desc = desc; diff --git a/drivers/comedi/drivers/dt9812.c b/drivers/comedi/drivers/dt9812.c index b37b9d8eca0d..cace17d6e70e 100644 --- a/drivers/comedi/drivers/dt9812.c +++ b/drivers/comedi/drivers/dt9812.c @@ -329,7 +329,7 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev, int i, count; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -358,7 +358,7 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev, int i, count; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/comedi/drivers/mite.c b/drivers/comedi/drivers/mite.c index 88f3cd6f54f1..3a16f4b6a292 100644 --- a/drivers/comedi/drivers/mite.c +++ b/drivers/comedi/drivers/mite.c @@ -749,7 +749,7 @@ struct mite_ring *mite_alloc_ring(struct mite *mite) { struct mite_ring *ring; - ring = kmalloc(sizeof(*ring), GFP_KERNEL); + ring = kmalloc_obj(*ring, GFP_KERNEL); if (!ring) return NULL; ring->hw_dev = get_device(&mite->pcidev->dev); @@ -879,7 +879,7 @@ struct mite *mite_attach(struct comedi_device *dev, bool use_win1) unsigned int i; int ret; - mite = kzalloc(sizeof(*mite), GFP_KERNEL); + mite = kzalloc_obj(*mite, GFP_KERNEL); if (!mite) return NULL; diff --git a/drivers/comedi/drivers/ni_670x.c b/drivers/comedi/drivers/ni_670x.c index 563a9c790f12..bc0344d9a07b 100644 --- a/drivers/comedi/drivers/ni_670x.c +++ b/drivers/comedi/drivers/ni_670x.c @@ -198,9 +198,8 @@ static int ni_670x_auto_attach(struct comedi_device *dev, if (s->n_chan == 32) { const struct comedi_lrange **range_table_list; - range_table_list = kmalloc_array(32, - sizeof(*range_table_list), - GFP_KERNEL); + range_table_list = kmalloc_objs(*range_table_list, 32, + GFP_KERNEL); if (!range_table_list) return -ENOMEM; s->range_table_list = range_table_list; diff --git a/drivers/comedi/drivers/ni_tio.c b/drivers/comedi/drivers/ni_tio.c index da6826d77e60..56b5995e2c58 100644 --- a/drivers/comedi/drivers/ni_tio.c +++ b/drivers/comedi/drivers/ni_tio.c @@ -1778,7 +1778,7 @@ ni_gpct_device_construct(struct comedi_device *dev, if (num_counters == 0 || counters_per_chip == 0) return NULL; - counter_dev = kzalloc(sizeof(*counter_dev), GFP_KERNEL); + counter_dev = kzalloc_obj(*counter_dev, GFP_KERNEL); if (!counter_dev) return NULL; @@ -1793,10 +1793,9 @@ ni_gpct_device_construct(struct comedi_device *dev, counter_dev->num_counters = num_counters; counter_dev->num_chips = DIV_ROUND_UP(num_counters, counters_per_chip); - counter_dev->counters = kcalloc(num_counters, sizeof(*counter), - GFP_KERNEL); - counter_dev->regs = kcalloc(counter_dev->num_chips, - sizeof(*counter_dev->regs), GFP_KERNEL); + counter_dev->counters = kzalloc_objs(*counter, num_counters, GFP_KERNEL); + counter_dev->regs = kzalloc_objs(*counter_dev->regs, + counter_dev->num_chips, GFP_KERNEL); if (!counter_dev->regs || !counter_dev->counters) { kfree(counter_dev->regs); kfree(counter_dev->counters); diff --git a/drivers/comedi/drivers/usbduxsigma.c b/drivers/comedi/drivers/usbduxsigma.c index 3f215ae228b2..bcf9116c4bd7 100644 --- a/drivers/comedi/drivers/usbduxsigma.c +++ b/drivers/comedi/drivers/usbduxsigma.c @@ -1336,8 +1336,8 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev) devpriv->dux_commands = kzalloc(SIZEOFDUXBUFFER, GFP_KERNEL); devpriv->in_buf = kzalloc(SIZEINBUF, GFP_KERNEL); devpriv->insn_buf = kzalloc(SIZEINSNBUF, GFP_KERNEL); - devpriv->ai_urbs = kcalloc(devpriv->n_ai_urbs, sizeof(urb), GFP_KERNEL); - devpriv->ao_urbs = kcalloc(devpriv->n_ao_urbs, sizeof(urb), GFP_KERNEL); + devpriv->ai_urbs = kzalloc_objs(urb, devpriv->n_ai_urbs, GFP_KERNEL); + devpriv->ao_urbs = kzalloc_objs(urb, devpriv->n_ao_urbs, GFP_KERNEL); if (!devpriv->dux_commands || !devpriv->in_buf || !devpriv->insn_buf || !devpriv->ai_urbs || !devpriv->ao_urbs) return -ENOMEM; diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 44b19e696176..7f8bd500eae2 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -429,8 +429,8 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, if (nsp->sk) { sk = nsp->sk; if (sk->sk_user_data == NULL) { - sk->sk_user_data = kzalloc(sizeof(struct proc_input), - GFP_KERNEL); + sk->sk_user_data = kzalloc_obj(struct proc_input, + GFP_KERNEL); if (sk->sk_user_data == NULL) { err = ENOMEM; goto out; diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 996f025eb63c..3ef917ebc49b 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c @@ -25,7 +25,7 @@ cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name, { struct cn_callback_entry *cbq; - cbq = kzalloc(sizeof(*cbq), GFP_KERNEL); + cbq = kzalloc_obj(*cbq, GFP_KERNEL); if (!cbq) { pr_err("Failed to create new callback queue.\n"); return NULL; @@ -113,7 +113,7 @@ struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *nls) { struct cn_queue_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/counter/counter-chrdev.c b/drivers/counter/counter-chrdev.c index 23fdf0caf712..0a4af153e049 100644 --- a/drivers/counter/counter-chrdev.c +++ b/drivers/counter/counter-chrdev.c @@ -152,7 +152,7 @@ static int counter_set_event_node(struct counter_device *const counter, /* If event is not already in the list */ if (&event_node->l == &counter->next_events_list) { /* Allocate new event node */ - event_node = kmalloc(sizeof(*event_node), GFP_KERNEL); + event_node = kmalloc_obj(*event_node, GFP_KERNEL); if (!event_node) return -ENOMEM; @@ -172,7 +172,7 @@ static int counter_set_event_node(struct counter_device *const counter, } /* Allocate component node */ - comp_node = kmalloc(sizeof(*comp_node), GFP_KERNEL); + comp_node = kmalloc_obj(*comp_node, GFP_KERNEL); if (!comp_node) { err = -ENOMEM; goto exit_free_event_node; diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index e73a66785d69..8576c8290ea5 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -700,7 +700,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) return blacklisted; #endif - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -798,8 +798,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) goto err_unreg; } - freq_table = kcalloc(perf->state_count + 1, sizeof(*freq_table), - GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, perf->state_count + 1, + GFP_KERNEL); if (!freq_table) { result = -ENOMEM; goto err_unreg; diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index ec9f38b219de..dec47f7ce192 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -993,7 +993,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) if (!dev) return -ENODEV; - cpudata = kzalloc(sizeof(*cpudata), GFP_KERNEL); + cpudata = kzalloc_obj(*cpudata, GFP_KERNEL); if (!cpudata) return -ENOMEM; @@ -1478,7 +1478,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) if (!dev) return -ENODEV; - cpudata = kzalloc(sizeof(*cpudata), GFP_KERNEL); + cpudata = kzalloc_obj(*cpudata, GFP_KERNEL); if (!cpudata) return -ENOMEM; diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index b1d29b7af232..bf6061e2089a 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -276,7 +276,7 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto out_free_opp; diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c index 0efe403a5980..1b252074b926 100644 --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -467,8 +467,8 @@ static int __init armada37xx_cpufreq_driver_init(void) return -EINVAL; } - armada37xx_cpufreq_state = kmalloc(sizeof(*armada37xx_cpufreq_state), - GFP_KERNEL); + armada37xx_cpufreq_state = kmalloc_obj(*armada37xx_cpufreq_state, + GFP_KERNEL); if (!armada37xx_cpufreq_state) { clk_put(clk); return -ENOMEM; diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index d96c1718f7f8..c7d4a15f10bc 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -143,7 +143,7 @@ static int __init armada_8k_cpufreq_init(void) of_node_put(node); nb_cpus = num_possible_cpus(); - freq_tables = kcalloc(nb_cpus, sizeof(*freq_tables), GFP_KERNEL); + freq_tables = kzalloc_objs(*freq_tables, nb_cpus, GFP_KERNEL); if (!freq_tables) return -ENOMEM; cpumask_copy(&cpus, cpu_possible_mask); diff --git a/drivers/cpufreq/bmips-cpufreq.c b/drivers/cpufreq/bmips-cpufreq.c index 36051880640b..f8c91796b498 100644 --- a/drivers/cpufreq/bmips-cpufreq.c +++ b/drivers/cpufreq/bmips-cpufreq.c @@ -71,7 +71,7 @@ bmips_cpufreq_get_freq_table(const struct cpufreq_policy *policy) cpu_freq = htp_freq_to_cpu_freq(priv->clk_mult); - table = kmalloc_array(priv->max_freqs + 1, sizeof(*table), GFP_KERNEL); + table = kmalloc_objs(*table, priv->max_freqs + 1, GFP_KERNEL); if (!table) return ERR_PTR(-ENOMEM); diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 7e8042efedd1..7abfd2753946 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -575,7 +575,7 @@ static struct cppc_cpudata *cppc_cpufreq_get_cpu_data(unsigned int cpu) struct cppc_cpudata *cpu_data; int ret; - cpu_data = kzalloc(sizeof(struct cppc_cpudata), GFP_KERNEL); + cpu_data = kzalloc_obj(struct cppc_cpudata, GFP_KERNEL); if (!cpu_data) goto out; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index a7a69f4d7675..98035c9fbc17 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1263,7 +1263,7 @@ static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu) if (!dev) return NULL; - policy = kzalloc(sizeof(*policy), GFP_KERNEL); + policy = kzalloc_obj(*policy, GFP_KERNEL); if (!policy) return NULL; diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index cce6a8d113e1..f0c16e615a46 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -273,7 +273,7 @@ static struct policy_dbs_info *cs_alloc(void) { struct cs_policy_dbs_info *dbs_info; - dbs_info = kzalloc(sizeof(*dbs_info), GFP_KERNEL); + dbs_info = kzalloc_obj(*dbs_info, GFP_KERNEL); return dbs_info ? &dbs_info->policy_dbs : NULL; } @@ -286,7 +286,7 @@ static int cs_init(struct dbs_data *dbs_data) { struct cs_dbs_tuners *tuners; - tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); + tuners = kzalloc_obj(*tuners, GFP_KERNEL); if (!tuners) return -ENOMEM; diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 1a7fcaf39cc9..1dbb3b10ee83 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -429,7 +429,7 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy) goto out; } - dbs_data = kzalloc(sizeof(*dbs_data), GFP_KERNEL); + dbs_data = kzalloc_obj(*dbs_data, GFP_KERNEL); if (!dbs_data) { ret = -ENOMEM; goto free_policy_dbs_info; diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index bb7db82930e4..ecb5021f46bd 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -322,7 +322,7 @@ static struct policy_dbs_info *od_alloc(void) { struct od_policy_dbs_info *dbs_info; - dbs_info = kzalloc(sizeof(*dbs_info), GFP_KERNEL); + dbs_info = kzalloc_obj(*dbs_info, GFP_KERNEL); return dbs_info ? &dbs_info->policy_dbs : NULL; } @@ -335,7 +335,7 @@ static int od_init(struct dbs_data *dbs_data) { struct od_dbs_tuners *tuners; - tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); + tuners = kzalloc_obj(*tuners, GFP_KERNEL); if (!tuners) return -ENOMEM; diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 40a9ff18da06..407b8fcf0723 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -222,7 +222,7 @@ void cpufreq_stats_create_table(struct cpufreq_policy *policy) if (policy->stats) return; - stats = kzalloc(sizeof(*stats), GFP_KERNEL); + stats = kzalloc_obj(*stats, GFP_KERNEL); if (!stats) return; diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 4bd62e6c5c51..c8e941b4ec03 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c @@ -58,7 +58,7 @@ static int cpufreq_userspace_policy_init(struct cpufreq_policy *policy) { struct userspace_policy *userspace; - userspace = kzalloc(sizeof(*userspace), GFP_KERNEL); + userspace = kzalloc_obj(*userspace, GFP_KERNEL); if (!userspace) return -ENOMEM; diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index 320a0af2266a..e079f1fed352 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -55,8 +55,7 @@ static struct acpi_processor_performance *eps_acpi_cpu_perf; /* Minimum necessary to get acpi_processor_get_bios_limit() working */ static int eps_acpi_init(void) { - eps_acpi_cpu_perf = kzalloc(sizeof(*eps_acpi_cpu_perf), - GFP_KERNEL); + eps_acpi_cpu_perf = kzalloc_obj(*eps_acpi_cpu_perf, GFP_KERNEL); if (!eps_acpi_cpu_perf) return -ENOMEM; @@ -321,8 +320,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy) states = 2; /* Allocate private data and frequency table for current cpu */ - centaur = kzalloc(struct_size(centaur, freq_table, states + 1), - GFP_KERNEL); + centaur = kzalloc_flex(*centaur, freq_table, states + 1, GFP_KERNEL); if (!centaur) return -ENOMEM; eps_cpu[0] = centaur; diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c index 75b3ef7ec679..ceadf0654838 100644 --- a/drivers/cpufreq/gx-suspmod.c +++ b/drivers/cpufreq/gx-suspmod.c @@ -458,7 +458,7 @@ static int __init cpufreq_gx_init(void) pr_debug("geode suspend modulation available.\n"); - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (params == NULL) return -ENOMEM; diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 1625ec2d0d06..00232f178630 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2745,7 +2745,7 @@ static int intel_pstate_init_cpu(unsigned int cpunum) cpu = all_cpu_data[cpunum]; if (!cpu) { - cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); + cpu = kzalloc_obj(*cpu, GFP_KERNEL); if (!cpu) return -ENOMEM; @@ -3301,7 +3301,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy) /* This reflects the intel_pstate_get_cpu_pstates() setting. */ policy->cur = policy->cpuinfo.min_freq; - req = kcalloc(2, sizeof(*req), GFP_KERNEL); + req = kzalloc_objs(*req, 2, GFP_KERNEL); if (!req) { ret = -ENOMEM; goto pstate_exit; diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 49e76b44468a..d9d9d1c605f7 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -475,8 +475,8 @@ static int longhaul_get_ranges(void) return -EINVAL; } - longhaul_table = kcalloc(numscales + 1, sizeof(*longhaul_table), - GFP_KERNEL); + longhaul_table = kzalloc_objs(*longhaul_table, numscales + 1, + GFP_KERNEL); if (!longhaul_table) return -ENOMEM; diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 31039330a3ba..77847b52d613 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -304,7 +304,7 @@ static int powernow_acpi_init(void) goto err0; } - acpi_processor_perf = kzalloc(sizeof(*acpi_processor_perf), GFP_KERNEL); + acpi_processor_perf = kzalloc_obj(*acpi_processor_perf, GFP_KERNEL); if (!acpi_processor_perf) { retval = -ENOMEM; goto err0; diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index f7512b4e923e..b7c9676c96ef 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1029,7 +1029,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) if (rc) return -ENODEV; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 7d9a5f656de8..7ab29fd8e4e5 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -323,7 +323,7 @@ next: powernv_freqs[i].frequency = freq * 1000; /* kHz */ powernv_freqs[i].driver_data = id & 0xFF; - revmap_data = kmalloc(sizeof(*revmap_data), GFP_KERNEL); + revmap_data = kmalloc_obj(*revmap_data, GFP_KERNEL); if (!revmap_data) { rc = -ENOMEM; goto out; @@ -857,7 +857,7 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) return 0; /* Initialise Gpstate ramp-down timer only on POWER8 */ - gpstates = kzalloc(sizeof(*gpstates), GFP_KERNEL); + gpstates = kzalloc_obj(*gpstates, GFP_KERNEL); if (!gpstates) return -ENOMEM; @@ -1053,7 +1053,7 @@ static int init_chip_info(void) return -ENOMEM; /* Allocate a chip cpu mask large enough to fit mask for all chips */ - chip_cpu_mask = kcalloc(MAX_NR_CHIPS, sizeof(cpumask_t), GFP_KERNEL); + chip_cpu_mask = kzalloc_objs(cpumask_t, MAX_NR_CHIPS, GFP_KERNEL); if (!chip_cpu_mask) { ret = -ENOMEM; goto free_and_return; @@ -1069,7 +1069,7 @@ static int init_chip_info(void) cpumask_set_cpu(cpu, &chip_cpu_mask[nr_chips-1]); } - chips = kcalloc(nr_chips, sizeof(struct chip), GFP_KERNEL); + chips = kzalloc_objs(struct chip, nr_chips, GFP_KERNEL); if (!chips) { ret = -ENOMEM; goto out_free_chip_cpu_mask; diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 4afa48d172db..839a55bee151 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -110,7 +110,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table; int i; - table = kcalloc(num + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, num + 1, GFP_KERNEL); if (table == NULL) return -ENOMEM; diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 8422704a3b10..3dbf432efaeb 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -211,7 +211,7 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev, struct qcom_cpufreq_data *drv_data = policy->driver_data; const struct qcom_cpufreq_soc_data *soc_data = qcom_cpufreq.soc_data; - table = kcalloc(LUT_MAX_ENTRIES + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, LUT_MAX_ENTRIES + 1, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 8d1f5ac59132..df560851ffa8 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -168,7 +168,7 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) if (!np) return -ENODEV; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto err_np; @@ -181,11 +181,11 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) hwclk = __clk_get_hw(policy->clk); count = clk_hw_get_num_parents(hwclk); - data->pclk = kcalloc(count, sizeof(struct clk *), GFP_KERNEL); + data->pclk = kzalloc_objs(struct clk *, count, GFP_KERNEL); if (!data->pclk) goto err_nomem2; - table = kcalloc(count + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, count + 1, GFP_KERNEL); if (!table) goto err_pclk; diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index c7a3b038385b..9c0a903f4fb0 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -214,7 +214,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) if (domain < 0) return domain; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index e530345baddf..1799e40596b7 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -128,7 +128,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto out_free_opp; diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index 15899dd77c08..6c26cf0a7f64 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c @@ -323,8 +323,8 @@ static int __init us2e_freq_init(void) impl = ((ver >> 32) & 0xffff); if (manuf == 0x17 && impl == 0x13) { - us2e_freq_table = kcalloc(NR_CPUS, sizeof(*us2e_freq_table), - GFP_KERNEL); + us2e_freq_table = kzalloc_objs(*us2e_freq_table, NR_CPUS, + GFP_KERNEL); if (!us2e_freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index de50a2f3b124..ae0f4f92c610 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -171,8 +171,8 @@ static int __init us3_freq_init(void) impl == CHEETAH_PLUS_IMPL || impl == JAGUAR_IMPL || impl == PANTHER_IMPL)) { - us3_freq_table = kcalloc(NR_CPUS, sizeof(*us3_freq_table), - GFP_KERNEL); + us3_freq_table = kzalloc_objs(*us3_freq_table, NR_CPUS, + GFP_KERNEL); if (!us3_freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 2a1550e1aa21..9a52d8030449 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -191,7 +191,7 @@ static int spear_cpufreq_probe(struct platform_device *pdev) goto out_put_node; } - freq_tbl = kcalloc(cnt + 1, sizeof(*freq_tbl), GFP_KERNEL); + freq_tbl = kzalloc_objs(*freq_tbl, cnt + 1, GFP_KERNEL); if (!freq_tbl) { ret = -ENOMEM; goto out_put_node; diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 4fffc8e83692..f4e5a09103d2 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -244,8 +244,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) int speed; int ret; - opp_tokens = kcalloc(num_possible_cpus(), sizeof(*opp_tokens), - GFP_KERNEL); + opp_tokens = kzalloc_objs(*opp_tokens, num_possible_cpus(), GFP_KERNEL); if (!opp_tokens) return -ENOMEM; diff --git a/drivers/cpufreq/tegra186-cpufreq.c b/drivers/cpufreq/tegra186-cpufreq.c index 34ed943c5f34..5c2f134f8033 100644 --- a/drivers/cpufreq/tegra186-cpufreq.c +++ b/drivers/cpufreq/tegra186-cpufreq.c @@ -135,7 +135,7 @@ static int tegra_cpufreq_init_cpufreq_table(struct cpufreq_policy *policy, dev_pm_opp_disable(cpu_dev, rate); } - freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); if (!freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c index 695599e1001f..22f51dc2fa67 100644 --- a/drivers/cpufreq/tegra194-cpufreq.c +++ b/drivers/cpufreq/tegra194-cpufreq.c @@ -463,7 +463,7 @@ static int tegra_cpufreq_init_cpufreq_table(struct cpufreq_policy *policy, return ret; } - freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); if (!freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index 65fea47b82e6..894f801b1b41 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -252,7 +252,7 @@ static int merge_cluster_tables(void) for (i = 0; i < MAX_CLUSTERS; i++) count += get_table_count(freq_table[i]); - table = kcalloc(count, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, count, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cpufreq.c index 6ffa16d239b2..92da4d5606e1 100644 --- a/drivers/cpufreq/virtual-cpufreq.c +++ b/drivers/cpufreq/virtual-cpufreq.c @@ -171,7 +171,7 @@ static int virt_cpufreq_get_freq_info(struct cpufreq_policy *policy) return 0; } - table = kcalloc(num_perftbl_entries + 1, sizeof(*table), GFP_KERNEL); + table = kzalloc_objs(*table, num_perftbl_entries + 1, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c index bb8761c8a42e..e22df988bb07 100644 --- a/drivers/cpuidle/coupled.c +++ b/drivers/cpuidle/coupled.c @@ -651,7 +651,7 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev) } /* No existing coupled info found, create a new one */ - coupled = kzalloc(sizeof(struct cpuidle_coupled), GFP_KERNEL); + coupled = kzalloc_obj(struct cpuidle_coupled, GFP_KERNEL); if (!coupled) return -ENOMEM; diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index 37c41209eaf9..a53ad31f9b3d 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -55,7 +55,7 @@ static int psci_pd_init(struct device_node *np, bool use_osi) if (!pd) goto out; - pd_provider = kzalloc(sizeof(*pd_provider), GFP_KERNEL); + pd_provider = kzalloc_obj(*pd_provider, GFP_KERNEL); if (!pd_provider) goto free_pd; diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c index 19be6475d356..875c4697b953 100644 --- a/drivers/cpuidle/cpuidle-riscv-sbi.c +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c @@ -380,7 +380,7 @@ static int sbi_pd_init(struct device_node *np) if (!pd) goto out; - pd_provider = kzalloc(sizeof(*pd_provider), GFP_KERNEL); + pd_provider = kzalloc_obj(*pd_provider, GFP_KERNEL); if (!pd_provider) goto free_pd; diff --git a/drivers/cpuidle/dt_idle_genpd.c b/drivers/cpuidle/dt_idle_genpd.c index 203e9b754aea..6b1f6d4686a7 100644 --- a/drivers/cpuidle/dt_idle_genpd.c +++ b/drivers/cpuidle/dt_idle_genpd.c @@ -95,7 +95,7 @@ struct generic_pm_domain *dt_idle_pd_alloc(struct device_node *np, struct genpd_power_state *states = NULL; int ret, state_count = 0; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) goto out; diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 61de64817604..abee6f73a6e1 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -482,7 +482,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device) /* state statistics */ for (i = 0; i < drv->state_count; i++) { - kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); + kobj = kzalloc_obj(struct cpuidle_state_kobj, GFP_KERNEL); if (!kobj) { ret = -ENOMEM; goto error_state; @@ -618,7 +618,7 @@ static int cpuidle_add_driver_sysfs(struct cpuidle_device *dev) struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); int ret; - kdrv = kzalloc(sizeof(*kdrv), GFP_KERNEL); + kdrv = kzalloc_obj(*kdrv, GFP_KERNEL); if (!kdrv) return -ENOMEM; @@ -712,7 +712,7 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev) if (!cpu_dev) return -ENODEV; - kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); + kdev = kzalloc_obj(*kdev, GFP_KERNEL); if (!kdev) return -ENOMEM; kdev->dev = dev; diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 8cdc66d520c9..772509993079 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -173,8 +173,8 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev) if (!dev->pdr) return -ENOMEM; - dev->pdr_uinfo = kcalloc(PPC4XX_NUM_PD, sizeof(struct pd_uinfo), - GFP_KERNEL); + dev->pdr_uinfo = kzalloc_objs(struct pd_uinfo, PPC4XX_NUM_PD, + GFP_KERNEL); if (!dev->pdr_uinfo) { dma_free_coherent(dev->core_dev->device, sizeof(struct ce_pd) * PPC4XX_NUM_PD, @@ -974,7 +974,7 @@ static int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, int rc = 0; for (i = 0; i < array_size; i++) { - alg = kzalloc(sizeof(struct crypto4xx_alg), GFP_KERNEL); + alg = kzalloc_obj(struct crypto4xx_alg, GFP_KERNEL); if (!alg) return -ENOMEM; diff --git a/drivers/crypto/amcc/crypto4xx_trng.c b/drivers/crypto/amcc/crypto4xx_trng.c index f10a87e541ed..6738cdbaded9 100644 --- a/drivers/crypto/amcc/crypto4xx_trng.c +++ b/drivers/crypto/amcc/crypto4xx_trng.c @@ -87,7 +87,7 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev) if (!dev->trng_base) goto err_out; - rng = kzalloc(sizeof(*rng), GFP_KERNEL); + rng = kzalloc_obj(*rng, GFP_KERNEL); if (!rng) goto err_out; diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index 0d48e64d28b1..d19694400693 100644 --- a/drivers/crypto/atmel-ecc.c +++ b/drivers/crypto/atmel-ecc.c @@ -99,7 +99,7 @@ static int atmel_ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, return crypto_kpp_set_secret(ctx->fallback, buf, len); } - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kmalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -182,7 +182,7 @@ static int atmel_ecdh_compute_shared_secret(struct kpp_request *req) gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? GFP_KERNEL : GFP_ATOMIC; - work_data = kmalloc(sizeof(*work_data), gfp); + work_data = kmalloc_obj(*work_data, gfp); if (!work_data) return -ENOMEM; diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.c index 9688d116d07e..27dd37997872 100644 --- a/drivers/crypto/atmel-i2c.c +++ b/drivers/crypto/atmel-i2c.c @@ -321,7 +321,7 @@ static int device_sanity_check(struct i2c_client *client) struct atmel_i2c_cmd *cmd; int ret; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kmalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index b02a71061708..a925c7afbbdb 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2207,7 +2207,7 @@ struct atmel_sha_authenc_ctx *atmel_sha_authenc_spawn(unsigned long mode) tctx->start = atmel_sha_authenc_start; tctx->flags = mode; - auth = kzalloc(sizeof(*auth), GFP_KERNEL); + auth = kzalloc_obj(*auth, GFP_KERNEL); if (!auth) { err = -ENOMEM; goto err_free_ahash; diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c index 0fcf4a39de27..8adc7fe71c04 100644 --- a/drivers/crypto/atmel-sha204a.c +++ b/drivers/crypto/atmel-sha204a.c @@ -51,7 +51,7 @@ static int atmel_sha204a_rng_read_nonblocking(struct hwrng *rng, void *data, memcpy(data, &work_data->cmd.data, max); rng->priv = 0; } else { - work_data = kmalloc(sizeof(*work_data), GFP_ATOMIC); + work_data = kmalloc_obj(*work_data, GFP_ATOMIC); if (!work_data) return -ENOMEM; diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 6b80d033648e..2bce15dc0aa8 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -141,8 +141,7 @@ spu_skcipher_rx_sg_create(struct brcm_message *mssg, struct iproc_ctx_s *ctx = rctx->ctx; u32 datalen; /* Number of bytes of response data expected */ - mssg->spu.dst = kmalloc_array(rx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.dst = kmalloc_objs(struct scatterlist, rx_frag_num, rctx->gfp); if (!mssg->spu.dst) return -ENOMEM; @@ -205,8 +204,7 @@ spu_skcipher_tx_sg_create(struct brcm_message *mssg, u32 datalen; /* Number of bytes of response data expected */ u32 stat_len; - mssg->spu.src = kmalloc_array(tx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.src = kmalloc_objs(struct scatterlist, tx_frag_num, rctx->gfp); if (unlikely(!mssg->spu.src)) return -ENOMEM; @@ -532,8 +530,7 @@ spu_ahash_rx_sg_create(struct brcm_message *mssg, struct scatterlist *sg; /* used to build sgs in mbox message */ struct iproc_ctx_s *ctx = rctx->ctx; - mssg->spu.dst = kmalloc_array(rx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.dst = kmalloc_objs(struct scatterlist, rx_frag_num, rctx->gfp); if (!mssg->spu.dst) return -ENOMEM; @@ -587,8 +584,7 @@ spu_ahash_tx_sg_create(struct brcm_message *mssg, u32 datalen; /* Number of bytes of response data expected */ u32 stat_len; - mssg->spu.src = kmalloc_array(tx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.src = kmalloc_objs(struct scatterlist, tx_frag_num, rctx->gfp); if (!mssg->spu.src) return -ENOMEM; @@ -1077,8 +1073,7 @@ static int spu_aead_rx_sg_create(struct brcm_message *mssg, /* have to catch gcm pad in separate buffer */ rx_frag_num++; - mssg->spu.dst = kmalloc_array(rx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.dst = kmalloc_objs(struct scatterlist, rx_frag_num, rctx->gfp); if (!mssg->spu.dst) return -ENOMEM; @@ -1179,8 +1174,7 @@ static int spu_aead_tx_sg_create(struct brcm_message *mssg, u32 assoc_offset = 0; u32 stat_len; - mssg->spu.src = kmalloc_array(tx_frag_num, sizeof(struct scatterlist), - rctx->gfp); + mssg->spu.src = kmalloc_objs(struct scatterlist, tx_frag_num, rctx->gfp); if (!mssg->spu.src) return -ENOMEM; diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c index c6117c23eb25..810917475c4f 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -3224,14 +3224,14 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, int ret = -ENOMEM; struct dpaa2_fl_entry *in_fle, *out_fle; - req_ctx = kzalloc(sizeof(*req_ctx), GFP_KERNEL); + req_ctx = kzalloc_obj(*req_ctx, GFP_KERNEL); if (!req_ctx) return -ENOMEM; in_fle = &req_ctx->fd_flt[1]; out_fle = &req_ctx->fd_flt[0]; - flc = kzalloc(sizeof(*flc), GFP_KERNEL); + flc = kzalloc_obj(*flc, GFP_KERNEL); if (!flc) goto err_flc; @@ -4635,7 +4635,7 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev, struct ahash_alg *halg; struct crypto_alg *alg; - t_alg = kzalloc(sizeof(*t_alg), GFP_KERNEL); + t_alg = kzalloc_obj(*t_alg, GFP_KERNEL); if (!t_alg) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 25c02e267258..cee9034aa87b 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -709,7 +709,7 @@ static struct ahash_edesc *ahash_edesc_alloc(struct ahash_request *req, struct ahash_edesc *edesc; sg_num = pad_sg_nents(sg_num); - edesc = kzalloc(struct_size(edesc, sec4_sg, sg_num), flags); + edesc = kzalloc_flex(*edesc, sec4_sg, sg_num, flags); if (!edesc) return NULL; @@ -1904,7 +1904,7 @@ caam_hash_alloc(struct caam_hash_template *template, struct ahash_alg *halg; struct crypto_alg *alg; - t_alg = kzalloc(sizeof(*t_alg), GFP_KERNEL); + t_alg = kzalloc_obj(*t_alg, GFP_KERNEL); if (!t_alg) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index 1e731ed8702b..a4e1984053da 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -181,7 +181,7 @@ static struct qman_fq *create_caam_req_fq(struct device *qidev, struct qman_fq *req_fq; struct qm_mcc_initfq opts; - req_fq = kzalloc(sizeof(*req_fq), GFP_ATOMIC); + req_fq = kzalloc_obj(*req_fq, GFP_ATOMIC); if (!req_fq) return ERR_PTR(-ENOMEM); @@ -416,7 +416,7 @@ struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev, return ERR_PTR(-EINVAL); } - drv_ctx = kzalloc(sizeof(*drv_ctx), GFP_ATOMIC); + drv_ctx = kzalloc_obj(*drv_ctx, GFP_ATOMIC); if (!drv_ctx) return ERR_PTR(-ENOMEM); @@ -619,7 +619,7 @@ static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu) struct qman_fq *fq; int ret; - fq = kzalloc(sizeof(*fq), GFP_KERNEL); + fq = kzalloc_obj(*fq, GFP_KERNEL); if (!fq) return -ENOMEM; diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c index bccd680c7f7e..41084767c577 100644 --- a/drivers/crypto/cavium/cpt/cptvf_main.c +++ b/drivers/crypto/cavium/cpt/cptvf_main.c @@ -35,7 +35,7 @@ static int init_worker_threads(struct cpt_vf *cptvf) struct cptvf_wqe_info *cwqe_info; int i; - cwqe_info = kzalloc(sizeof(*cwqe_info), GFP_KERNEL); + cwqe_info = kzalloc_obj(*cwqe_info, GFP_KERNEL); if (!cwqe_info) return -ENOMEM; @@ -111,7 +111,7 @@ static int alloc_pending_queues(struct pending_qinfo *pqinfo, u32 qlen, pqinfo->qlen = qlen; for_each_pending_queue(pqinfo, queue, i) { - queue->head = kcalloc(qlen, sizeof(*queue->head), GFP_KERNEL); + queue->head = kzalloc_objs(*queue->head, qlen, GFP_KERNEL); if (!queue->head) { ret = -ENOMEM; goto pending_qfail; @@ -225,7 +225,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf, queue = &cqinfo->queue[i]; INIT_HLIST_HEAD(&cqinfo->queue[i].chead); do { - curr = kzalloc(sizeof(*curr), GFP_KERNEL); + curr = kzalloc_obj(*curr, GFP_KERNEL); if (!curr) goto cmd_qfail; diff --git a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c index fb59bb282455..e183b60277ff 100644 --- a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c +++ b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c @@ -417,7 +417,7 @@ int process_request(struct cpt_vf *cptvf, struct cpt_request_info *req) struct cpt_vq_command vq_cmd; union cpt_inst_s cptinst; - info = kzalloc(sizeof(*info), req->may_sleep ? GFP_KERNEL : GFP_ATOMIC); + info = kzalloc_obj(*info, req->may_sleep ? GFP_KERNEL : GFP_ATOMIC); if (unlikely(!info)) { dev_err(&pdev->dev, "Unable to allocate memory for info_buffer\n"); return -ENOMEM; diff --git a/drivers/crypto/cavium/nitrox/nitrox_isr.c b/drivers/crypto/cavium/nitrox/nitrox_isr.c index f19e520da6d0..5ffb1aa90cba 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_isr.c +++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c @@ -320,7 +320,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev) } ndev->num_vecs = nr_vecs; - ndev->qvec = kcalloc(nr_vecs, sizeof(*qvec), GFP_KERNEL); + ndev->qvec = kzalloc_objs(*qvec, nr_vecs, GFP_KERNEL); if (!ndev->qvec) { pci_free_irq_vectors(pdev); return -ENOMEM; @@ -424,7 +424,7 @@ int nitrox_sriov_register_interupts(struct nitrox_device *ndev) return ret; } - qvec = kcalloc(NR_NON_RING_VECTORS, sizeof(*qvec), GFP_KERNEL); + qvec = kzalloc_objs(*qvec, NR_NON_RING_VECTORS, GFP_KERNEL); if (!qvec) { pci_disable_msix(pdev); return -ENOMEM; diff --git a/drivers/crypto/cavium/nitrox/nitrox_lib.c b/drivers/crypto/cavium/nitrox/nitrox_lib.c index 068265207ddd..31eb8c874257 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_lib.c +++ b/drivers/crypto/cavium/nitrox/nitrox_lib.c @@ -219,7 +219,7 @@ void *crypto_alloc_context(struct nitrox_device *ndev) void *vaddr; dma_addr_t dma; - chdr = kmalloc(sizeof(*chdr), GFP_KERNEL); + chdr = kmalloc_obj(*chdr, GFP_KERNEL); if (!chdr) return NULL; diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c index 65114f766e7d..d0e1e34a7b8b 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_main.c +++ b/drivers/crypto/cavium/nitrox/nitrox_main.c @@ -441,7 +441,7 @@ static int nitrox_probe(struct pci_dev *pdev, goto flr_fail; pci_set_master(pdev); - ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); + ndev = kzalloc_obj(*ndev, GFP_KERNEL); if (!ndev) { err = -ENOMEM; goto ndev_fail; diff --git a/drivers/crypto/cavium/nitrox/nitrox_mbx.c b/drivers/crypto/cavium/nitrox/nitrox_mbx.c index a6a76e50ba84..a9e290a23dfe 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_mbx.c +++ b/drivers/crypto/cavium/nitrox/nitrox_mbx.c @@ -139,7 +139,7 @@ void nitrox_pf2vf_mbox_handler(struct nitrox_device *ndev) vfdev->ring = i; /* fill the vf mailbox data */ vfdev->msg.value = pf2vf_read_mbox(ndev, vfdev->ring); - pfwork = kzalloc(sizeof(*pfwork), GFP_ATOMIC); + pfwork = kzalloc_obj(*pfwork, GFP_ATOMIC); if (!pfwork) continue; @@ -163,7 +163,7 @@ void nitrox_pf2vf_mbox_handler(struct nitrox_device *ndev) /* fill the vf mailbox data */ vfdev->msg.value = pf2vf_read_mbox(ndev, vfdev->ring); - pfwork = kzalloc(sizeof(*pfwork), GFP_ATOMIC); + pfwork = kzalloc_obj(*pfwork, GFP_ATOMIC); if (!pfwork) continue; @@ -181,8 +181,8 @@ int nitrox_mbox_init(struct nitrox_device *ndev) struct nitrox_vfdev *vfdev; int i; - ndev->iov.vfdev = kcalloc(ndev->iov.num_vfs, - sizeof(struct nitrox_vfdev), GFP_KERNEL); + ndev->iov.vfdev = kzalloc_objs(struct nitrox_vfdev, ndev->iov.num_vfs, + GFP_KERNEL); if (!ndev->iov.vfdev) return -ENOMEM; diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c index 55c18da4a500..6a1bdae73d1a 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c @@ -390,7 +390,7 @@ int nitrox_process_se_request(struct nitrox_device *ndev, if (!nitrox_ready(ndev)) return -ENODEV; - sr = kzalloc(sizeof(*sr), req->gfp); + sr = kzalloc_obj(*sr, req->gfp); if (!sr) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index 71480f7e6f6b..240bcfa26c62 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c @@ -354,7 +354,7 @@ int ccp_register_aes_cmac_algs(struct list_head *head) struct crypto_alg *base; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-galois.c b/drivers/crypto/ccp/ccp-crypto-aes-galois.c index b1dbb8cea559..db5c498f379b 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-galois.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-galois.c @@ -212,7 +212,7 @@ static int ccp_register_aes_aead(struct list_head *head, struct aead_alg *alg; int ret; - ccp_aead = kzalloc(sizeof(*ccp_aead), GFP_KERNEL); + ccp_aead = kzalloc_obj(*ccp_aead, GFP_KERNEL); if (!ccp_aead) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index 93f735d6b02b..5cd8c2d270c3 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c @@ -231,7 +231,7 @@ static int ccp_register_aes_xts_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes.c b/drivers/crypto/ccp/ccp-crypto-aes.c index 685d42ec7ade..97ce93434953 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes.c +++ b/drivers/crypto/ccp/ccp-crypto-aes.c @@ -294,7 +294,7 @@ static int ccp_register_aes_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-des3.c b/drivers/crypto/ccp/ccp-crypto-des3.c index 91b1189c47de..8c0f903c3330 100644 --- a/drivers/crypto/ccp/ccp-crypto-des3.c +++ b/drivers/crypto/ccp/ccp-crypto-des3.c @@ -182,7 +182,7 @@ static int ccp_register_des3_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c index bc90aba5162a..698e39ab107f 100644 --- a/drivers/crypto/ccp/ccp-crypto-main.c +++ b/drivers/crypto/ccp/ccp-crypto-main.c @@ -275,7 +275,7 @@ int ccp_crypto_enqueue_request(struct crypto_async_request *req, gfp = req->flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : GFP_ATOMIC; - crypto_cmd = kzalloc(sizeof(*crypto_cmd), gfp); + crypto_cmd = kzalloc_obj(*crypto_cmd, gfp); if (!crypto_cmd) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-rsa.c b/drivers/crypto/ccp/ccp-crypto-rsa.c index a14f85512cf4..80d9ddc1f644 100644 --- a/drivers/crypto/ccp/ccp-crypto-rsa.c +++ b/drivers/crypto/ccp/ccp-crypto-rsa.c @@ -249,7 +249,7 @@ static int ccp_register_rsa_alg(struct list_head *head, struct akcipher_alg *alg; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index fa3ae8e78f6f..91d0d8ea182b 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c @@ -418,7 +418,7 @@ static int ccp_register_hmac_alg(struct list_head *head, struct crypto_alg *base; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; @@ -462,7 +462,7 @@ static int ccp_register_sha_alg(struct list_head *head, struct crypto_alg *base; int ret; - ccp_alg = kzalloc(sizeof(*ccp_alg), GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index d0412e584762..0170edef5b43 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -642,7 +642,7 @@ ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd) struct ccp_data dst; struct ccp_data aad; struct ccp_op op; - } *wa __free(kfree) = kzalloc(sizeof(*wa), GFP_KERNEL); + } *wa __free(kfree) = kzalloc_obj(*wa, GFP_KERNEL); unsigned int dm_offset; unsigned int authsize; unsigned int jobid; diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 4b44729a019e..404829c41a13 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -87,7 +87,7 @@ static int psp_populate_hsti(struct psp_device *psp) return 0; /* Allocate command-response buffer */ - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/crypto/ccp/sev-dev-tio.c b/drivers/crypto/ccp/sev-dev-tio.c index 9a98f98c20a7..d51bb67460b0 100644 --- a/drivers/crypto/ccp/sev-dev-tio.c +++ b/drivers/crypto/ccp/sev-dev-tio.c @@ -330,7 +330,7 @@ static struct sla_buffer_hdr *sla_buffer_map(struct sla_addr_t sla) if (WARN_ON_ONCE(!npages)) return NULL; - struct page **pp = kmalloc_array(npages, sizeof(pp[0]), GFP_KERNEL); + struct page **pp = kmalloc_objs(pp[0], npages, GFP_KERNEL); if (!pp) return NULL; diff --git a/drivers/crypto/ccp/sev-dev-tsm.c b/drivers/crypto/ccp/sev-dev-tsm.c index 3cdc38e84500..a3e7a9bca95b 100644 --- a/drivers/crypto/ccp/sev-dev-tsm.c +++ b/drivers/crypto/ccp/sev-dev-tsm.c @@ -207,7 +207,7 @@ static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide, static struct pci_tsm *tio_pf0_probe(struct pci_dev *pdev, struct sev_device *sev) { - struct tio_dsm *dsm __free(kfree) = kzalloc(sizeof(*dsm), GFP_KERNEL); + struct tio_dsm *dsm __free(kfree) = kzalloc_obj(*dsm, GFP_KERNEL); int rc; if (!dsm) @@ -341,7 +341,7 @@ static struct pci_tsm_ops sev_tsm_ops = { void sev_tsm_init_locked(struct sev_device *sev, void *tio_status_page) { - struct sev_tio_status *t = kzalloc(sizeof(*t), GFP_KERNEL); + struct sev_tio_status *t = kzalloc_obj(*t, GFP_KERNEL); struct tsm_dev *tsmdev; int ret; diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 1cdadddb744e..4dc642ecde76 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1144,7 +1144,7 @@ struct page *snp_alloc_hv_fixed_pages(unsigned int num_2mb_pages) if (!page) return NULL; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { __free_pages(page, order); return NULL; @@ -2658,7 +2658,7 @@ static int sev_misc_init(struct sev_device *sev) if (!misc_dev) { struct miscdevice *misc; - misc_dev = kzalloc(sizeof(*misc_dev), GFP_KERNEL); + misc_dev = kzalloc_obj(*misc_dev, GFP_KERNEL); if (!misc_dev) return -ENOMEM; diff --git a/drivers/crypto/ccp/sfs.c b/drivers/crypto/ccp/sfs.c index 2f4beaafe7ec..c98900672ea8 100644 --- a/drivers/crypto/ccp/sfs.c +++ b/drivers/crypto/ccp/sfs.c @@ -223,7 +223,7 @@ static int sfs_misc_init(struct sfs_device *sfs) if (!misc_dev) { struct miscdevice *misc; - misc_dev = kzalloc(sizeof(*misc_dev), GFP_KERNEL); + misc_dev = kzalloc_obj(*misc_dev, GFP_KERNEL); if (!misc_dev) return -ENOMEM; diff --git a/drivers/crypto/ccp/tee-dev.c b/drivers/crypto/ccp/tee-dev.c index 92ffa412622a..50716472586a 100644 --- a/drivers/crypto/ccp/tee-dev.c +++ b/drivers/crypto/ccp/tee-dev.c @@ -67,7 +67,7 @@ struct tee_init_ring_cmd *tee_alloc_cmd_buffer(struct psp_tee_device *tee) { struct tee_init_ring_cmd *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return NULL; diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c index 887162df50f9..31fc0d37db21 100644 --- a/drivers/crypto/ccree/cc_request_mgr.c +++ b/drivers/crypto/ccree/cc_request_mgr.c @@ -116,7 +116,7 @@ int cc_req_mgr_init(struct cc_drvdata *drvdata) struct device *dev = drvdata_to_dev(drvdata); int rc = 0; - req_mgr_h = kzalloc(sizeof(*req_mgr_h), GFP_KERNEL); + req_mgr_h = kzalloc_obj(*req_mgr_h, GFP_KERNEL); if (!req_mgr_h) { rc = -ENOMEM; goto req_mgr_init_err; @@ -426,7 +426,7 @@ int cc_send_request(struct cc_drvdata *drvdata, struct cc_crypto_req *cc_req, if (rc == -ENOSPC && backlog_ok) { spin_unlock_bh(&mgr->hw_lock); - bli = kmalloc(sizeof(*bli), flags); + bli = kmalloc_obj(*bli, flags); if (!bli) { cc_pm_put_suspend(dev); return -ENOMEM; diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index 39c70e6255f9..a1a0034780c5 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -189,7 +189,7 @@ static void *chcr_uld_add(const struct cxgb4_lld_info *lld) return ERR_PTR(-EOPNOTSUPP); /* Create the device and add it in the device list */ - u_ctx = kzalloc(sizeof(*u_ctx), GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index edf36f6add52..19f0bf3f3f92 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -2248,7 +2248,7 @@ static int hifn_alg_alloc(struct hifn_device *dev, const struct hifn_alg_templat struct hifn_crypto_alg *alg; int err; - alg = kzalloc(sizeof(*alg), GFP_KERNEL); + alg = kzalloc_obj(*alg, GFP_KERNEL); if (!alg) return -ENOMEM; diff --git a/drivers/crypto/hisilicon/debugfs.c b/drivers/crypto/hisilicon/debugfs.c index 17eb236e9ee4..b7c5c4ade11f 100644 --- a/drivers/crypto/hisilicon/debugfs.c +++ b/drivers/crypto/hisilicon/debugfs.c @@ -838,7 +838,7 @@ static struct dfx_diff_registers *dfx_regs_init(struct hisi_qm *qm, u32 j, base_offset; int i; - diff_regs = kcalloc(reg_len, sizeof(*diff_regs), GFP_KERNEL); + diff_regs = kzalloc_objs(*diff_regs, reg_len, GFP_KERNEL); if (!diff_regs) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 571d0d250242..07421f53a7ee 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -2722,7 +2722,7 @@ static int qm_hw_err_isolate(struct hisi_qm *qm) if (qm->uacce->is_vf || isolate->is_isolate || !isolate->err_threshold) return 0; - hw_err = kzalloc(sizeof(*hw_err), GFP_KERNEL); + hw_err = kzalloc_obj(*hw_err, GFP_KERNEL); if (!hw_err) return -ENOMEM; @@ -3747,7 +3747,7 @@ static int hisi_qm_sort_devices(int node, struct list_head *head, if (dev_node < 0) dev_node = 0; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return -ENOMEM; @@ -5767,11 +5767,12 @@ static int hisi_qp_alloc_memory(struct hisi_qm *qm) size_t qp_dma_size; int i, ret; - qm->qp_array = kcalloc(qm->qp_num, sizeof(struct hisi_qp), GFP_KERNEL); + qm->qp_array = kzalloc_objs(struct hisi_qp, qm->qp_num, GFP_KERNEL); if (!qm->qp_array) return -ENOMEM; - qm->poll_data = kcalloc(qm->qp_num, sizeof(struct hisi_qm_poll_data), GFP_KERNEL); + qm->poll_data = kzalloc_objs(struct hisi_qm_poll_data, qm->qp_num, + GFP_KERNEL); if (!qm->poll_data) { kfree(qm->qp_array); return -ENOMEM; @@ -5836,7 +5837,8 @@ static int hisi_qm_memory_init(struct hisi_qm *qm) if (test_bit(QM_SUPPORT_FUNC_QOS, &qm->caps)) { total_func = pci_sriov_get_totalvfs(qm->pdev) + 1; - qm->factor = kcalloc(total_func, sizeof(struct qm_shaper_factor), GFP_KERNEL); + qm->factor = kzalloc_objs(struct qm_shaper_factor, total_func, + GFP_KERNEL); if (!qm->factor) return -ENOMEM; diff --git a/drivers/crypto/hisilicon/sec/sec_algs.c b/drivers/crypto/hisilicon/sec/sec_algs.c index 1189effcdad0..54e24fd7b9be 100644 --- a/drivers/crypto/hisilicon/sec/sec_algs.c +++ b/drivers/crypto/hisilicon/sec/sec_algs.c @@ -553,7 +553,7 @@ static int sec_alg_alloc_and_calc_split_sizes(int length, size_t **split_sizes, /* Split into suitable sized blocks */ *steps = roundup(length, SEC_REQ_LIMIT) / SEC_REQ_LIMIT; - sizes = kcalloc(*steps, sizeof(*sizes), gfp); + sizes = kzalloc_objs(*sizes, *steps, gfp); if (!sizes) return -ENOMEM; @@ -577,12 +577,12 @@ static int sec_map_and_split_sg(struct scatterlist *sgl, size_t *split_sizes, if (!count) return -EINVAL; - *splits = kcalloc(steps, sizeof(struct scatterlist *), gfp); + *splits = kzalloc_objs(struct scatterlist *, steps, gfp); if (!*splits) { ret = -ENOMEM; goto err_unmap_sg; } - *splits_nents = kcalloc(steps, sizeof(int), gfp); + *splits_nents = kzalloc_objs(int, steps, gfp); if (!*splits_nents) { ret = -ENOMEM; goto err_free_splits; @@ -637,7 +637,7 @@ static struct sec_request_el struct sec_bd_info *req; int ret; - el = kzalloc(sizeof(*el), gfp); + el = kzalloc_obj(*el, gfp); if (!el) return ERR_PTR(-ENOMEM); el->el_length = el_size; diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index c462b58d3034..c8b71945f9f8 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -569,11 +569,11 @@ static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ struct device *dev = ctx->dev; int ret = -ENOMEM; - qp_ctx->req_list = kcalloc(q_depth, sizeof(struct sec_req *), GFP_KERNEL); + qp_ctx->req_list = kzalloc_objs(struct sec_req *, q_depth, GFP_KERNEL); if (!qp_ctx->req_list) return ret; - qp_ctx->res = kcalloc(q_depth, sizeof(struct sec_alg_res), GFP_KERNEL); + qp_ctx->res = kzalloc_objs(struct sec_alg_res, q_depth, GFP_KERNEL); if (!qp_ctx->res) goto err_free_req_list; qp_ctx->res->depth = q_depth; @@ -672,8 +672,8 @@ static int sec_ctx_base_init(struct sec_ctx *ctx) ctx->hlf_q_num = sec->ctx_q_num >> 1; ctx->pbuf_supported = ctx->sec->iommu_used; - ctx->qp_ctx = kcalloc(sec->ctx_q_num, sizeof(struct sec_qp_ctx), - GFP_KERNEL); + ctx->qp_ctx = kzalloc_objs(struct sec_qp_ctx, sec->ctx_q_num, + GFP_KERNEL); if (!ctx->qp_ctx) { ret = -ENOMEM; goto err_destroy_qps; diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index 7dd125f5f511..a4db14adc6da 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -420,7 +420,7 @@ struct hisi_qp **sec_create_qps(void) u8 *type; int ret; - qps = kcalloc(ctx_num, sizeof(struct hisi_qp *), GFP_KERNEL); + qps = kzalloc_objs(struct hisi_qp *, ctx_num, GFP_KERNEL); if (!qps) return NULL; diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c index d41b34405c21..ab20665cbfbc 100644 --- a/drivers/crypto/hisilicon/sgl.c +++ b/drivers/crypto/hisilicon/sgl.c @@ -83,7 +83,7 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev, (remain_sgl > 0 && block_num > HISI_ACC_MEM_BLOCK_NR - 1)) return ERR_PTR(-EINVAL); - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); block = pool->mem_block; diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index 98a68e44ac34..0bb65e140809 100644 --- a/drivers/crypto/hisilicon/zip/zip_crypto.c +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c @@ -479,8 +479,8 @@ static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx) } spin_lock_init(&req_q->req_lock); - req_q->q = kcalloc(req_q->size, sizeof(struct hisi_zip_req), - GFP_KERNEL); + req_q->q = kzalloc_objs(struct hisi_zip_req, req_q->size, + GFP_KERNEL); if (!req_q->q) { ret = -ENOMEM; if (i == 0) diff --git a/drivers/crypto/inside-secure/eip93/eip93-aead.c b/drivers/crypto/inside-secure/eip93/eip93-aead.c index 18dd8a9a5165..8d72644fdc74 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-aead.c +++ b/drivers/crypto/inside-secure/eip93/eip93-aead.c @@ -70,7 +70,7 @@ static int eip93_aead_cra_init(struct crypto_tfm *tfm) ctx->type = tmpl->type; ctx->set_assoc = true; - ctx->sa_record = kzalloc(sizeof(*ctx->sa_record), GFP_KERNEL); + ctx->sa_record = kzalloc_obj(*ctx->sa_record, GFP_KERNEL); if (!ctx->sa_record) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/eip93/eip93-cipher.c b/drivers/crypto/inside-secure/eip93/eip93-cipher.c index 1f2d6846610f..74f4abeba646 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-cipher.c +++ b/drivers/crypto/inside-secure/eip93/eip93-cipher.c @@ -61,7 +61,7 @@ static int eip93_skcipher_cra_init(struct crypto_tfm *tfm) ctx->eip93 = tmpl->eip93; ctx->type = tmpl->type; - ctx->sa_record = kzalloc(sizeof(*ctx->sa_record), GFP_KERNEL); + ctx->sa_record = kzalloc_obj(*ctx->sa_record, GFP_KERNEL); if (!ctx->sa_record) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/eip93/eip93-common.c b/drivers/crypto/inside-secure/eip93/eip93-common.c index 66153aa2493f..b19afd311c84 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-common.c +++ b/drivers/crypto/inside-secure/eip93/eip93-common.c @@ -152,7 +152,7 @@ static int eip93_make_sg_copy(struct scatterlist *src, struct scatterlist **dst, { void *pages; - *dst = kmalloc(sizeof(**dst), GFP_KERNEL); + *dst = kmalloc_obj(**dst, GFP_KERNEL); if (!*dst) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/eip93/eip93-hash.c b/drivers/crypto/inside-secure/eip93/eip93-hash.c index ac13d90a2b7c..2705855475b2 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-hash.c +++ b/drivers/crypto/inside-secure/eip93/eip93-hash.c @@ -332,7 +332,7 @@ static int __eip93_hash_update(struct ahash_request *req, bool complete_req) * and then reset to SHA256_BLOCK_SIZE. */ while (to_consume > max_read) { - block = kzalloc(sizeof(*block), GFP_ATOMIC); + block = kzalloc_obj(*block, GFP_ATOMIC); if (!block) { ret = -ENOMEM; goto free_blocks; diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index c3b2b22934b7..077da171fdf2 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -1889,7 +1889,7 @@ static int safexcel_pci_probe(struct pci_dev *pdev, ent->vendor, ent->device, ent->subvendor, ent->subdevice, ent->driver_data); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index e534b7a200cf..f84def61ceb0 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -2008,7 +2008,7 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm) struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); safexcel_ahash_cra_init(tfm); - ctx->aes = kmalloc(sizeof(*ctx->aes), GFP_KERNEL); + ctx->aes = kmalloc_obj(*ctx->aes, GFP_KERNEL); return ctx->aes == NULL ? -ENOMEM : 0; } diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index f79ea22e9abe..bcd2bfcc19af 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -335,7 +335,7 @@ int add_iaa_compression_mode(const char *name, goto out; } - mode = kzalloc(sizeof(*mode), GFP_KERNEL); + mode = kzalloc_obj(*mode, GFP_KERNEL); if (!mode) goto out; @@ -422,7 +422,7 @@ static int init_device_compression_mode(struct iaa_device *iaa_device, struct iaa_device_compression_mode *device_mode; int ret = -ENOMEM; - device_mode = kzalloc(sizeof(*device_mode), GFP_KERNEL); + device_mode = kzalloc_obj(*device_mode, GFP_KERNEL); if (!device_mode) return -ENOMEM; @@ -503,7 +503,7 @@ static struct iaa_device *iaa_device_alloc(void) { struct iaa_device *iaa_device; - iaa_device = kzalloc(sizeof(*iaa_device), GFP_KERNEL); + iaa_device = kzalloc_obj(*iaa_device, GFP_KERNEL); if (!iaa_device) return NULL; @@ -561,7 +561,7 @@ static int add_iaa_wq(struct iaa_device *iaa_device, struct idxd_wq *wq, struct device *dev = &pdev->dev; struct iaa_wq *iaa_wq; - iaa_wq = kzalloc(sizeof(*iaa_wq), GFP_KERNEL); + iaa_wq = kzalloc_obj(*iaa_wq, GFP_KERNEL); if (!iaa_wq) return -ENOMEM; @@ -718,7 +718,7 @@ static int alloc_wq_table(int max_wqs) for (cpu = 0; cpu < nr_cpus; cpu++) { entry = per_cpu_ptr(wq_table, cpu); - entry->wqs = kcalloc(max_wqs, sizeof(*entry->wqs), GFP_KERNEL); + entry->wqs = kzalloc_objs(*entry->wqs, max_wqs, GFP_KERNEL); if (!entry->wqs) { free_wq_table(); return -ENOMEM; diff --git a/drivers/crypto/intel/keembay/ocs-hcu.c b/drivers/crypto/intel/keembay/ocs-hcu.c index 55a41e6ab103..2c9e523361df 100644 --- a/drivers/crypto/intel/keembay/ocs-hcu.c +++ b/drivers/crypto/intel/keembay/ocs-hcu.c @@ -491,7 +491,7 @@ struct ocs_hcu_dma_list *ocs_hcu_dma_list_alloc(struct ocs_hcu_dev *hcu_dev, { struct ocs_hcu_dma_list *dma_list; - dma_list = kmalloc(sizeof(*dma_list), GFP_KERNEL); + dma_list = kmalloc_obj(*dma_list, GFP_KERNEL); if (!dma_list) return NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c b/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c index 4b5d0350fc2e..935f4f9d8a7c 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c +++ b/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c @@ -178,7 +178,7 @@ int adf_ae_init(struct adf_accel_dev *accel_dev) if (!hw_device->fw_name) return 0; - loader_data = kzalloc(sizeof(*loader_data), GFP_KERNEL); + loader_data = kzalloc_obj(*loader_data, GFP_KERNEL); if (!loader_data) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_aer.c b/drivers/crypto/intel/qat/qat_common/adf_aer.c index a5964fd8204c..a65e88d28f53 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_aer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_aer.c @@ -160,7 +160,7 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev, return 0; set_bit(ADF_STATUS_RESTARTING, &accel_dev->status); - reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); if (!reset_data) return -ENOMEM; reset_data->accel_dev = accel_dev; @@ -258,7 +258,7 @@ int adf_notify_fatal_error(struct adf_accel_dev *accel_dev) { struct adf_fatal_error_data *wq_data; - wq_data = kzalloc(sizeof(*wq_data), GFP_ATOMIC); + wq_data = kzalloc_obj(*wq_data, GFP_ATOMIC); if (!wq_data) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_cfg.c b/drivers/crypto/intel/qat/qat_common/adf_cfg.c index b0fc453fa3fb..c348d290fc51 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_cfg.c +++ b/drivers/crypto/intel/qat/qat_common/adf_cfg.c @@ -68,7 +68,7 @@ int adf_cfg_dev_add(struct adf_accel_dev *accel_dev) { struct adf_cfg_device_data *dev_cfg_data; - dev_cfg_data = kzalloc(sizeof(*dev_cfg_data), GFP_KERNEL); + dev_cfg_data = kzalloc_obj(*dev_cfg_data, GFP_KERNEL); if (!dev_cfg_data) return -ENOMEM; INIT_LIST_HEAD(&dev_cfg_data->sec_list); @@ -289,7 +289,7 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev, if (!section) return -EFAULT; - key_val = kzalloc(sizeof(*key_val), GFP_KERNEL); + key_val = kzalloc_obj(*key_val, GFP_KERNEL); if (!key_val) return -ENOMEM; @@ -356,7 +356,7 @@ int adf_cfg_section_add(struct adf_accel_dev *accel_dev, const char *name) if (sec) return 0; - sec = kzalloc(sizeof(*sec), GFP_KERNEL); + sec = kzalloc_obj(*sec, GFP_KERNEL); if (!sec) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c b/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c index 34b9f7731c78..2068fe29a24c 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c @@ -172,7 +172,7 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, goto unlock; } num_devices++; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { ret = -ENOMEM; goto unlock; @@ -204,7 +204,7 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, goto unlock; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { ret = -ENOMEM; goto unlock; diff --git a/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c b/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c index 98fb7ccfed9f..fe37f53f2d29 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c +++ b/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c @@ -83,7 +83,8 @@ static struct adf_fw_counters *adf_fw_counters_allocate(unsigned long ae_count) if (unlikely(!ae_count)) return ERR_PTR(-EINVAL); - fw_counters = kmalloc(struct_size(fw_counters, ae_counters, ae_count), GFP_KERNEL); + fw_counters = kmalloc_flex(*fw_counters, ae_counters, ae_count, + GFP_KERNEL); if (!fw_counters) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c index 5dafd9a270db..efeb3d06b606 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c +++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_pm.c @@ -119,7 +119,7 @@ bool adf_gen4_handle_pm_interrupt(struct adf_accel_dev *accel_dev) val = ADF_CSR_RD(pmisc, ADF_GEN4_PM_INTERRUPT); - pm_data = kzalloc(sizeof(*pm_data), GFP_ATOMIC); + pm_data = kzalloc_obj(*pm_data, GFP_ATOMIC); if (!pm_data) return false; diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c index adb21656a3ba..622da38ce385 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c +++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c @@ -59,7 +59,7 @@ static int adf_gen4_vfmig_open_device(struct qat_mig_dev *mdev) vf_info = &accel_dev->pf.vf_info[mdev->vf_id]; - vfmig = kzalloc(sizeof(*vfmig), GFP_KERNEL); + vfmig = kzalloc_obj(*vfmig, GFP_KERNEL); if (!vfmig) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c b/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c index b19aa1ef8eee..95a9efceda6d 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c +++ b/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c @@ -281,7 +281,7 @@ int adf_heartbeat_init(struct adf_accel_dev *accel_dev) { struct adf_heartbeat *hb; - hb = kzalloc(sizeof(*hb), GFP_KERNEL); + hb = kzalloc_obj(*hb, GFP_KERNEL); if (!hb) goto err_ret; diff --git a/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c b/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c index 41cc763a74aa..1fbade552370 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c @@ -37,7 +37,7 @@ struct adf_mstate_mgr *adf_mstate_mgr_new(u8 *buf, u32 size) { struct adf_mstate_mgr *mgr; - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (!mgr) return NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_rl.c b/drivers/crypto/intel/qat/qat_common/adf_rl.c index c6a54e465931..2e037df286cc 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_rl.c +++ b/drivers/crypto/intel/qat/qat_common/adf_rl.c @@ -622,7 +622,7 @@ static int add_new_sla_entry(struct adf_accel_dev *accel_dev, struct rl_sla *sla; int ret = 0; - sla = kzalloc(sizeof(*sla), GFP_KERNEL); + sla = kzalloc_obj(*sla, GFP_KERNEL); if (!sla) { ret = -ENOMEM; goto ret_err; @@ -1065,7 +1065,7 @@ int adf_rl_init(struct adf_accel_dev *accel_dev) goto err_ret; } - rl = kzalloc(sizeof(*rl), GFP_KERNEL); + rl = kzalloc_obj(*rl, GFP_KERNEL); if (!rl) { ret = -ENOMEM; goto err_ret; diff --git a/drivers/crypto/intel/qat/qat_common/adf_sriov.c b/drivers/crypto/intel/qat/qat_common/adf_sriov.c index bb904ba4bf84..bacaa4a1a20d 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_sriov.c +++ b/drivers/crypto/intel/qat/qat_common/adf_sriov.c @@ -40,7 +40,7 @@ void adf_schedule_vf2pf_handler(struct adf_accel_vf_info *vf_info) { struct adf_pf2vf_resp *pf2vf_resp; - pf2vf_resp = kzalloc(sizeof(*pf2vf_resp), GFP_ATOMIC); + pf2vf_resp = kzalloc_obj(*pf2vf_resp, GFP_ATOMIC); if (!pf2vf_resp) return; @@ -173,8 +173,8 @@ static int adf_do_enable_sriov(struct adf_accel_dev *accel_dev) goto err_del_cfg; /* Allocate memory for VF info structs */ - accel_dev->pf.vf_info = kcalloc(totalvfs, sizeof(struct adf_accel_vf_info), - GFP_KERNEL); + accel_dev->pf.vf_info = kzalloc_objs(struct adf_accel_vf_info, totalvfs, + GFP_KERNEL); ret = -ENOMEM; if (!accel_dev->pf.vf_info) goto err_del_cfg; diff --git a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c index b64142db1f0d..a745c1ca4048 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c +++ b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c @@ -75,9 +75,8 @@ static int adf_tl_alloc_mem(struct adf_accel_dev *accel_dev) if (!telemetry->rp_num_indexes) goto err_free_tl; - telemetry->regs_hist_buff = kmalloc_array(tl_data->num_hbuff, - sizeof(*telemetry->regs_hist_buff), - GFP_KERNEL); + telemetry->regs_hist_buff = kmalloc_objs(*telemetry->regs_hist_buff, + tl_data->num_hbuff, GFP_KERNEL); if (!telemetry->regs_hist_buff) goto err_free_rp_indexes; diff --git a/drivers/crypto/intel/qat/qat_common/adf_timer.c b/drivers/crypto/intel/qat/qat_common/adf_timer.c index 8962a49f145a..3f5267c98ff3 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_timer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_timer.c @@ -40,7 +40,7 @@ int adf_timer_start(struct adf_accel_dev *accel_dev) { struct adf_timer *timer_ctx; - timer_ctx = kzalloc(sizeof(*timer_ctx), GFP_KERNEL); + timer_ctx = kzalloc_obj(*timer_ctx, GFP_KERNEL); if (!timer_ctx) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c b/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c index 6c22bc9b28e4..a27f1d76998e 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c +++ b/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c @@ -99,7 +99,7 @@ int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name) struct adf_etr_ring_debug_entry *ring_debug; char entry_name[16]; - ring_debug = kzalloc(sizeof(*ring_debug), GFP_KERNEL); + ring_debug = kzalloc_obj(*ring_debug, GFP_KERNEL); if (!ring_debug) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c b/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c index d0fef20a3df4..9ffaa56def67 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c @@ -85,7 +85,7 @@ int adf_pf2vf_handle_pf_restarting(struct adf_accel_dev *accel_dev) struct adf_vf_stop_data *stop_data; clear_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status); - stop_data = kzalloc(sizeof(*stop_data), GFP_ATOMIC); + stop_data = kzalloc_obj(*stop_data, GFP_ATOMIC); if (!stop_data) { dev_err(&GET_DEV(accel_dev), "Couldn't schedule stop for vf_%d\n", diff --git a/drivers/crypto/intel/qat/qat_common/qat_hal.c b/drivers/crypto/intel/qat/qat_common/qat_hal.c index da4eca6e1633..86523a70b3a9 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_hal.c +++ b/drivers/crypto/intel/qat/qat_common/qat_hal.c @@ -832,17 +832,17 @@ int qat_hal_init(struct adf_accel_dev *accel_dev) struct icp_qat_fw_loader_handle *handle; int ret = 0; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; - handle->hal_handle = kzalloc(sizeof(*handle->hal_handle), GFP_KERNEL); + handle->hal_handle = kzalloc_obj(*handle->hal_handle, GFP_KERNEL); if (!handle->hal_handle) { ret = -ENOMEM; goto out_hal_handle; } - handle->chip_info = kzalloc(sizeof(*handle->chip_info), GFP_KERNEL); + handle->chip_info = kzalloc_obj(*handle->chip_info, GFP_KERNEL); if (!handle->chip_info) { ret = -ENOMEM; goto out_chip_info; diff --git a/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c b/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c index 892c2283a50e..4fb4b0cac64e 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c +++ b/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c @@ -24,7 +24,7 @@ struct qat_mig_dev *qat_vfmig_create(struct pci_dev *pdev, int vf_id) !ops->load_state || !ops->save_setup || !ops->load_setup) return ERR_PTR(-EINVAL); - mdev = kmalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kmalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/intel/qat/qat_common/qat_uclo.c b/drivers/crypto/intel/qat/qat_common/qat_uclo.c index 06d49cb781ae..be0cfd9dd09a 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/intel/qat/qat_common/qat_uclo.c @@ -42,10 +42,10 @@ static int qat_uclo_init_ae_data(struct icp_qat_uclo_objhandle *obj_handle, } else { ae_slice->ctx_mask_assigned = 0; } - ae_slice->region = kzalloc(sizeof(*ae_slice->region), GFP_KERNEL); + ae_slice->region = kzalloc_obj(*ae_slice->region, GFP_KERNEL); if (!ae_slice->region) return -ENOMEM; - ae_slice->page = kzalloc(sizeof(*ae_slice->page), GFP_KERNEL); + ae_slice->page = kzalloc_obj(*ae_slice->page, GFP_KERNEL); if (!ae_slice->page) goto out_err; page = ae_slice->page; @@ -258,7 +258,7 @@ static int qat_uclo_create_batch_init_list(struct icp_qat_fw_loader_handle init_header = *init_tab_base; if (!init_header) { - init_header = kzalloc(sizeof(*init_header), GFP_KERNEL); + init_header = kzalloc_obj(*init_header, GFP_KERNEL); if (!init_header) return -ENOMEM; init_header->size = 1; @@ -270,7 +270,7 @@ static int qat_uclo_create_batch_init_list(struct icp_qat_fw_loader_handle tail_old = tail_old->next; tail = tail_old; for (i = 0; i < init_mem->val_attr_num; i++) { - mem_init = kzalloc(sizeof(*mem_init), GFP_KERNEL); + mem_init = kzalloc_obj(*mem_init, GFP_KERNEL); if (!mem_init) goto out_err; mem_init->ae = ae; @@ -501,7 +501,7 @@ qat_uclo_map_chunk(char *buf, struct icp_qat_uof_filehdr *file_hdr, if (file_chunk->checksum != qat_uclo_calc_str_checksum( chunk, file_chunk->size)) break; - obj_hdr = kzalloc(sizeof(*obj_hdr), GFP_KERNEL); + obj_hdr = kzalloc_obj(*obj_hdr, GFP_KERNEL); if (!obj_hdr) break; obj_hdr->file_buff = chunk; @@ -634,8 +634,7 @@ static int qat_uclo_map_uimage(struct icp_qat_uclo_objhandle *obj_handle, if (qat_uclo_check_image_compat(encap_uof_obj, image)) goto out_err; ae_uimage[j].page = - kzalloc(sizeof(struct icp_qat_uclo_encap_page), - GFP_KERNEL); + kzalloc_obj(struct icp_qat_uclo_encap_page, GFP_KERNEL); if (!ae_uimage[j].page) goto out_err; qat_uclo_map_image_page(encap_uof_obj, image, @@ -1200,9 +1199,9 @@ static int qat_uclo_map_suof(struct icp_qat_fw_loader_handle *handle, suof_handle->img_table.num_simgs = suof_ptr->num_chunks - 1; if (suof_handle->img_table.num_simgs != 0) { - suof_img_hdr = kcalloc(suof_handle->img_table.num_simgs, - sizeof(img_header), - GFP_KERNEL); + suof_img_hdr = kzalloc_objs(img_header, + suof_handle->img_table.num_simgs, + GFP_KERNEL); if (!suof_img_hdr) return -ENOMEM; suof_handle->img_table.simg_hdr = suof_img_hdr; @@ -1720,7 +1719,7 @@ static int qat_uclo_map_suof_obj(struct icp_qat_fw_loader_handle *handle, { struct icp_qat_suof_handle *suof_handle; - suof_handle = kzalloc(sizeof(*suof_handle), GFP_KERNEL); + suof_handle = kzalloc_obj(*suof_handle, GFP_KERNEL); if (!suof_handle) return -ENOMEM; handle->sobj_handle = suof_handle; @@ -1764,7 +1763,7 @@ static int qat_uclo_map_uof_obj(struct icp_qat_fw_loader_handle *handle, struct icp_qat_uof_filehdr *filehdr; struct icp_qat_uclo_objhandle *objhdl; - objhdl = kzalloc(sizeof(*objhdl), GFP_KERNEL); + objhdl = kzalloc_obj(*objhdl, GFP_KERNEL); if (!objhdl) return -ENOMEM; objhdl->obj_buf = kmemdup(addr_ptr, mem_size, GFP_KERNEL); @@ -1892,8 +1891,9 @@ static int qat_uclo_map_objs_from_mof(struct icp_qat_mof_handle *mobj_handle) if (sobj_hdr) sobj_chunk_num = sobj_hdr->num_chunks; - mobj_hdr = kcalloc(size_add(uobj_chunk_num, sobj_chunk_num), - sizeof(*mobj_hdr), GFP_KERNEL); + mobj_hdr = kzalloc_objs(*mobj_hdr, + size_add(uobj_chunk_num, sobj_chunk_num), + GFP_KERNEL); if (!mobj_hdr) return -ENOMEM; @@ -2003,7 +2003,7 @@ static int qat_uclo_map_mof_obj(struct icp_qat_fw_loader_handle *handle, if (qat_uclo_check_mof_format(mof_ptr)) return -EINVAL; - mobj_handle = kzalloc(sizeof(*mobj_handle), GFP_KERNEL); + mobj_handle = kzalloc_obj(*mobj_handle, GFP_KERNEL); if (!mobj_handle) return -ENOMEM; diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c index 417a48f41350..b35c57a868e7 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c @@ -318,7 +318,7 @@ static int process_tar_file(struct device *dev, return -EINVAL; } - tar_info = kzalloc(sizeof(struct tar_ucode_info_t), GFP_KERNEL); + tar_info = kzalloc_obj(struct tar_ucode_info_t, GFP_KERNEL); if (!tar_info) return -ENOMEM; @@ -412,7 +412,7 @@ static struct tar_arch_info_t *load_tar_archive(struct device *dev, size_t tar_size; int ret; - tar_arch = kzalloc(sizeof(struct tar_arch_info_t), GFP_KERNEL); + tar_arch = kzalloc_obj(struct tar_arch_info_t, GFP_KERNEL); if (!tar_arch) return NULL; diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c index 6c0bfb3ea1c9..32f6616a60eb 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c +++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c @@ -31,7 +31,7 @@ static int init_worker_threads(struct otx_cptvf *cptvf) struct otx_cptvf_wqe_info *cwqe_info; int i; - cwqe_info = kzalloc(sizeof(*cwqe_info), GFP_KERNEL); + cwqe_info = kzalloc_obj(*cwqe_info, GFP_KERNEL); if (!cwqe_info) return -ENOMEM; @@ -100,7 +100,7 @@ static int alloc_pending_queues(struct otx_cpt_pending_qinfo *pqinfo, u32 qlen, pqinfo->num_queues = num_queues; for_each_pending_queue(pqinfo, queue, i) { - queue->head = kcalloc(qlen, sizeof(*queue->head), GFP_KERNEL); + queue->head = kzalloc_objs(*queue->head, qlen, GFP_KERNEL); if (!queue->head) { ret = -ENOMEM; goto pending_qfail; @@ -212,7 +212,7 @@ static int alloc_command_queues(struct otx_cptvf *cptvf, queue = &cqinfo->queue[i]; INIT_LIST_HEAD(&queue->chead); do { - curr = kzalloc(sizeof(*curr), GFP_KERNEL); + curr = kzalloc_obj(*curr, GFP_KERNEL); if (!curr) goto cmd_qfail; diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c index f54f90588d86..37eb56ab7832 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c @@ -340,8 +340,8 @@ static int cptpf_flr_wq_init(struct otx2_cptpf_dev *cptpf, int num_vfs) if (!cptpf->flr_wq) return -ENOMEM; - cptpf->flr_work = kcalloc(num_vfs, sizeof(struct cptpf_flr_work), - GFP_KERNEL); + cptpf->flr_work = kzalloc_objs(struct cptpf_flr_work, num_vfs, + GFP_KERNEL); if (!cptpf->flr_work) goto destroy_wq; diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c index b5cc5401f704..97d948fbc4b3 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c @@ -372,7 +372,7 @@ static int load_fw(struct device *dev, struct fw_info_t *fw_info, int ucode_type, ucode_size; int ret; - uc_info = kzalloc(sizeof(*uc_info), GFP_KERNEL); + uc_info = kzalloc_obj(*uc_info, GFP_KERNEL); if (!uc_info) return -ENOMEM; diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c index c1c44a7b89fa..bec0a4cd2662 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c @@ -150,7 +150,7 @@ static int init_tasklet_work(struct otx2_cptlfs_info *lfs) int i, ret = 0; for (i = 0; i < lfs->lfs_num; i++) { - wqe = kzalloc(sizeof(struct otx2_cptlf_wqe), GFP_KERNEL); + wqe = kzalloc_obj(struct otx2_cptlf_wqe, GFP_KERNEL); if (!wqe) { ret = -ENOMEM; goto cleanup_tasklet; diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c index b950fcce8a9b..f388027b1256 100644 --- a/drivers/crypto/nx/nx-842.c +++ b/drivers/crypto/nx/nx-842.c @@ -105,7 +105,7 @@ void *nx842_crypto_alloc_ctx(struct nx842_driver *driver) { struct nx842_crypto_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/nx/nx-common-powernv.c b/drivers/crypto/nx/nx-common-powernv.c index 56aa1c29d782..a9253e34a0e5 100644 --- a/drivers/crypto/nx/nx-common-powernv.c +++ b/drivers/crypto/nx/nx-common-powernv.c @@ -810,7 +810,7 @@ static int __init vas_cfg_coproc_info(struct device_node *dn, int chip_id, return ret; } - coproc = kzalloc(sizeof(*coproc), GFP_KERNEL); + coproc = kzalloc_obj(*coproc, GFP_KERNEL); if (!coproc) return -ENOMEM; @@ -968,7 +968,7 @@ static int __init nx842_powernv_probe(struct device_node *dn) return -EINVAL; } - coproc = kzalloc(sizeof(*coproc), GFP_KERNEL); + coproc = kzalloc_obj(*coproc, GFP_KERNEL); if (!coproc) return -ENOMEM; diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c index fc0222ebe807..ecf84448b797 100644 --- a/drivers/crypto/nx/nx-common-pseries.c +++ b/drivers/crypto/nx/nx-common-pseries.c @@ -747,7 +747,7 @@ static int nx842_OF_upd(struct property *new_prop) int ret = 0; unsigned long flags; - new_devdata = kzalloc(sizeof(*new_devdata), GFP_NOFS); + new_devdata = kzalloc_obj(*new_devdata, GFP_NOFS); if (!new_devdata) return -ENOMEM; @@ -1035,12 +1035,11 @@ static int nx842_probe(struct vio_dev *viodev, unsigned long flags; int ret = 0; - new_devdata = kzalloc(sizeof(*new_devdata), GFP_NOFS); + new_devdata = kzalloc_obj(*new_devdata, GFP_NOFS); if (!new_devdata) return -ENOMEM; - new_devdata->counters = kzalloc(sizeof(*new_devdata->counters), - GFP_NOFS); + new_devdata->counters = kzalloc_obj(*new_devdata->counters, GFP_NOFS); if (!new_devdata->counters) { kfree(new_devdata); return -ENOMEM; @@ -1149,7 +1148,7 @@ static void __init nxcop_get_capabilities(void) u64 feat; int rc; - hv_caps = kmalloc(sizeof(*hv_caps), GFP_KERNEL); + hv_caps = kmalloc_obj(*hv_caps, GFP_KERNEL); if (!hv_caps) return; /* @@ -1168,7 +1167,7 @@ static void __init nxcop_get_capabilities(void) /* * NX-GZIP feature available */ - hv_nxc = kmalloc(sizeof(*hv_nxc), GFP_KERNEL); + hv_nxc = kmalloc_obj(*hv_nxc, GFP_KERNEL); if (!hv_nxc) return; /* @@ -1218,7 +1217,7 @@ static int __init nx842_pseries_init(void) of_node_put(np); RCU_INIT_POINTER(devdata, NULL); - new_devdata = kzalloc(sizeof(*new_devdata), GFP_KERNEL); + new_devdata = kzalloc_obj(*new_devdata, GFP_KERNEL); if (!new_devdata) return -ENOMEM; diff --git a/drivers/crypto/omap-crypto.c b/drivers/crypto/omap-crypto.c index 0345c9383d50..441f0e5eb458 100644 --- a/drivers/crypto/omap-crypto.c +++ b/drivers/crypto/omap-crypto.c @@ -21,7 +21,7 @@ static int omap_crypto_copy_sg_lists(int total, int bs, struct scatterlist *tmp; if (!(flags & OMAP_CRYPTO_FORCE_SINGLE_ENTRY)) { - new_sg = kmalloc_array(n, sizeof(*new_sg), GFP_KERNEL); + new_sg = kmalloc_objs(*new_sg, n, GFP_KERNEL); if (!new_sg) return -ENOMEM; diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 1ffc240e016a..48f6ba92ee93 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -636,7 +636,7 @@ static int omap_sham_copy_sg_lists(struct omap_sham_reqctx *ctx, if (ctx->bufcnt) n++; - ctx->sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); + ctx->sg = kmalloc_objs(*sg, n, GFP_KERNEL); if (!ctx->sg) return -ENOMEM; diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c index 97b56e92ea33..ffc31a1d72c5 100644 --- a/drivers/crypto/qce/aead.c +++ b/drivers/crypto/qce/aead.c @@ -762,7 +762,7 @@ static int qce_aead_register_one(const struct qce_aead_def *def, struct qce_devi struct aead_alg *alg; int ret; - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index 71b748183cfa..f09d0d7da518 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -457,7 +457,7 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def, struct crypto_alg *base; int ret; - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c index ffb334eb5b34..1571ede06b86 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -440,7 +440,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, struct skcipher_alg *alg; int ret; - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index b829c84f60f2..ea13b0fd4d89 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -499,7 +499,7 @@ static int s5p_make_sg_cpy(struct s5p_aes_dev *dev, struct scatterlist *src, void *pages; int len; - *dst = kmalloc(sizeof(**dst), GFP_ATOMIC); + *dst = kmalloc_obj(**dst, GFP_ATOMIC); if (!*dst) return -ENOMEM; @@ -1056,7 +1056,7 @@ static int s5p_hash_copy_sg_lists(struct s5p_hash_reqctx *ctx, if (ctx->bufcnt) n++; - ctx->sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); + ctx->sg = kmalloc_objs(*sg, n, GFP_KERNEL); if (!ctx->sg) { ctx->error = true; return -ENOMEM; diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index fdc0b2486069..df3defa1ef4b 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -1099,7 +1099,7 @@ static int sa_run(struct sa_req *req) gfp_flags = req->base->flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : GFP_ATOMIC; - rxd = kzalloc(sizeof(*rxd), gfp_flags); + rxd = kzalloc_obj(*rxd, gfp_flags); if (!rxd) return -ENOMEM; diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c index d206eddb67bf..9818b9e69aff 100644 --- a/drivers/crypto/stm32/stm32-cryp.c +++ b/drivers/crypto/stm32/stm32-cryp.c @@ -1498,7 +1498,8 @@ static int stm32_cryp_truncate_sg(struct scatterlist **new_sg, size_t *new_sg_le return alloc_sg_len; /* We allocate to much sg entry, but it is easier */ - *new_sg = kmalloc_array((size_t)alloc_sg_len, sizeof(struct scatterlist), GFP_KERNEL); + *new_sg = kmalloc_objs(struct scatterlist, (size_t)alloc_sg_len, + GFP_KERNEL); if (!*new_sg) return -ENOMEM; diff --git a/drivers/crypto/tegra/tegra-se-main.c b/drivers/crypto/tegra/tegra-se-main.c index 4e7115b247e7..caca5e365f8b 100644 --- a/drivers/crypto/tegra/tegra-se-main.c +++ b/drivers/crypto/tegra/tegra-se-main.c @@ -47,7 +47,7 @@ tegra_se_cmdbuf_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_dire struct host1x_bo_mapping *map; int err; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return ERR_PTR(-ENOMEM); @@ -56,7 +56,7 @@ tegra_se_cmdbuf_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_dire map->direction = direction; map->dev = dev; - map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); if (!map->sgt) { err = -ENOMEM; goto free; @@ -123,7 +123,7 @@ static struct tegra_se_cmdbuf *tegra_se_host1x_bo_alloc(struct tegra_se *se, ssi struct tegra_se_cmdbuf *cmdbuf; struct device *dev = se->dev->parent; - cmdbuf = kzalloc(sizeof(*cmdbuf), GFP_KERNEL); + cmdbuf = kzalloc_obj(*cmdbuf, GFP_KERNEL); if (!cmdbuf) return NULL; diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c index 2e44915c9f23..01077166b2f1 100644 --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c @@ -112,7 +112,7 @@ static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher if (!pkey) return -ENOMEM; - vc_ctrl_req = kzalloc(sizeof(*vc_ctrl_req), GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); if (!vc_ctrl_req) { err = -ENOMEM; goto out; @@ -169,7 +169,7 @@ static int virtio_crypto_alg_akcipher_close_session(struct virtio_crypto_akciphe if (!ctx->session_valid) return 0; - vc_ctrl_req = kzalloc(sizeof(*vc_ctrl_req), GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); if (!vc_ctrl_req) return -ENOMEM; diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c index ccc6b5c1b24b..ae100e315185 100644 --- a/drivers/crypto/virtio/virtio_crypto_core.c +++ b/drivers/crypto/virtio/virtio_crypto_core.c @@ -115,10 +115,10 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi) total_vqs = vi->max_data_queues + 1; /* Allocate space for find_vqs parameters */ - vqs = kcalloc(total_vqs, sizeof(*vqs), GFP_KERNEL); + vqs = kzalloc_objs(*vqs, total_vqs, GFP_KERNEL); if (!vqs) goto err_vq; - vqs_info = kcalloc(total_vqs, sizeof(*vqs_info), GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, total_vqs, GFP_KERNEL); if (!vqs_info) goto err_vqs_info; @@ -170,8 +170,8 @@ err_vq: static int virtcrypto_alloc_queues(struct virtio_crypto *vi) { - vi->data_vq = kcalloc(vi->max_data_queues, sizeof(*vi->data_vq), - GFP_KERNEL); + vi->data_vq = kzalloc_objs(*vi->data_vq, vi->max_data_queues, + GFP_KERNEL); if (!vi->data_vq) return -ENOMEM; diff --git a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c index 11053d1786d4..b25b7982c942 100644 --- a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c @@ -131,7 +131,7 @@ static int virtio_crypto_alg_skcipher_init_session( if (!cipher_key) return -ENOMEM; - vc_ctrl_req = kzalloc(sizeof(*vc_ctrl_req), GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); if (!vc_ctrl_req) { err = -ENOMEM; goto out; @@ -200,7 +200,7 @@ static int virtio_crypto_alg_skcipher_close_session( struct virtio_crypto_inhdr *ctrl_status; struct virtio_crypto_ctrl_request *vc_ctrl_req; - vc_ctrl_req = kzalloc(sizeof(*vc_ctrl_req), GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); if (!vc_ctrl_req) return -ENOMEM; diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index d78f005bd994..11320e88eb09 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -336,7 +336,7 @@ static void del_cxl_resource(struct resource *res) static struct resource *alloc_cxl_resource(resource_size_t base, resource_size_t n, int id) { - struct resource *res __free(kfree) = kzalloc(sizeof(*res), GFP_KERNEL); + struct resource *res __free(kfree) = kzalloc_obj(*res, GFP_KERNEL); if (!res) return NULL; @@ -825,7 +825,7 @@ static int add_cxl_resources(struct resource *cxl_res) struct resource *res, *new, *next; for (res = cxl_res->child; res; res = next) { - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; new->name = res->name; diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c index 18f0f2a25113..a024083bae2d 100644 --- a/drivers/cxl/core/cdat.c +++ b/drivers/cxl/core/cdat.c @@ -69,7 +69,7 @@ static int cdat_dsmas_handler(union acpi_subtable_headers *header, void *arg, /* Skip common header */ dsmas = (struct acpi_cdat_dsmas *)(hdr + 1); - dent = kzalloc(sizeof(*dent), GFP_KERNEL); + dent = kzalloc_obj(*dent, GFP_KERNEL); if (!dent) return -ENOMEM; @@ -669,7 +669,7 @@ static int cxl_endpoint_gather_bandwidth(struct cxl_region *cxlr, perf_ctx = xa_load(usp_xa, index); if (!perf_ctx) { struct cxl_perf_ctx *c __free(kfree) = - kzalloc(sizeof(*perf_ctx), GFP_KERNEL); + kzalloc_obj(*perf_ctx, GFP_KERNEL); if (!c) return -ENOMEM; @@ -756,7 +756,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, bool *gp_is_root) { struct xarray *res_xa __free(free_perf_xa) = - kzalloc(sizeof(*res_xa), GFP_KERNEL); + kzalloc_obj(*res_xa, GFP_KERNEL); struct access_coordinate coords[ACCESS_COORDINATE_MAX]; struct cxl_perf_ctx *ctx, *us_ctx; unsigned long index, us_index; @@ -795,7 +795,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, us_ctx = xa_load(res_xa, us_index); if (!us_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc(sizeof(*n), GFP_KERNEL); + kzalloc_obj(*n, GFP_KERNEL); if (!n) return ERR_PTR(-ENOMEM); @@ -862,7 +862,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) { struct xarray *hb_xa __free(free_perf_xa) = - kzalloc(sizeof(*hb_xa), GFP_KERNEL); + kzalloc_obj(*hb_xa, GFP_KERNEL); struct cxl_perf_ctx *ctx; unsigned long index; @@ -879,7 +879,7 @@ static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) hb_ctx = xa_load(hb_xa, hb_index); if (!hb_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc(sizeof(*n), GFP_KERNEL); + kzalloc_obj(*n, GFP_KERNEL); if (!n) return ERR_PTR(-ENOMEM); @@ -906,7 +906,7 @@ static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) static struct xarray *cxl_hb_gather_bandwidth(struct xarray *xa) { struct xarray *mw_xa __free(free_perf_xa) = - kzalloc(sizeof(*mw_xa), GFP_KERNEL); + kzalloc_obj(*mw_xa, GFP_KERNEL); struct cxl_perf_ctx *ctx; unsigned long index; @@ -928,7 +928,7 @@ static struct xarray *cxl_hb_gather_bandwidth(struct xarray *xa) mw_ctx = xa_load(mw_xa, mw_index); if (!mw_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc(sizeof(*n), GFP_KERNEL); + kzalloc_obj(*n, GFP_KERNEL); if (!n) return ERR_PTR(-ENOMEM); @@ -987,7 +987,7 @@ void cxl_region_shared_upstream_bandwidth_update(struct cxl_region *cxlr) lockdep_assert_held(&cxl_rwsem.dpa); struct xarray *usp_xa __free(free_perf_xa) = - kzalloc(sizeof(*usp_xa), GFP_KERNEL); + kzalloc_obj(*usp_xa, GFP_KERNEL); if (!usp_xa) return; diff --git a/drivers/cxl/core/edac.c b/drivers/cxl/core/edac.c index 81160260e26b..7f5457adb26c 100644 --- a/drivers/cxl/core/edac.c +++ b/drivers/cxl/core/edac.c @@ -2009,8 +2009,7 @@ static void err_rec_free(void *_cxlmd) static int devm_cxl_memdev_setup_err_rec(struct cxl_memdev *cxlmd) { - struct cxl_mem_err_rec *array_rec = - kzalloc(sizeof(*array_rec), GFP_KERNEL); + struct cxl_mem_err_rec *array_rec = kzalloc_obj(*array_rec, GFP_KERNEL); if (!array_rec) return -ENOMEM; diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c index 4bc484b46f43..2007d8ebe1c4 100644 --- a/drivers/cxl/core/features.c +++ b/drivers/cxl/core/features.c @@ -94,7 +94,7 @@ get_supported_features(struct cxl_features_state *cxlfs) return NULL; struct cxl_feat_entries *entries __free(kvfree) = - kvmalloc(struct_size(entries, ent, count), GFP_KERNEL); + kvmalloc_flex(*entries, ent, count, GFP_KERNEL); if (!entries) return NULL; @@ -204,7 +204,7 @@ int devm_cxl_setup_features(struct cxl_dev_state *cxlds) return -ENODEV; struct cxl_features_state *cxlfs __free(kfree) = - kzalloc(sizeof(*cxlfs), GFP_KERNEL); + kzalloc_obj(*cxlfs, GFP_KERNEL); if (!cxlfs) return -ENOMEM; diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c index af3d0cc65138..a81df0de4889 100644 --- a/drivers/cxl/core/memdev.c +++ b/drivers/cxl/core/memdev.c @@ -665,7 +665,7 @@ static struct cxl_memdev *cxl_memdev_alloc(struct cxl_dev_state *cxlds, struct cdev *cdev; int rc; - cxlmd = kzalloc(sizeof(*cxlmd), GFP_KERNEL); + cxlmd = kzalloc_obj(*cxlmd, GFP_KERNEL); if (!cxlmd) return ERR_PTR(-ENOMEM); @@ -831,7 +831,7 @@ static int cxl_mem_abort_fw_xfer(struct cxl_memdev_state *mds) struct cxl_mbox_cmd mbox_cmd; int rc; - transfer = kzalloc(struct_size(transfer, data, 0), GFP_KERNEL); + transfer = kzalloc_flex(*transfer, data, 0, GFP_KERNEL); if (!transfer) return -ENOMEM; diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c index e7b1e6fa0ea0..be7538e58b9c 100644 --- a/drivers/cxl/core/pmem.c +++ b/drivers/cxl/core/pmem.c @@ -83,7 +83,7 @@ static struct cxl_nvdimm_bridge *cxl_nvdimm_bridge_alloc(struct cxl_port *port) struct device *dev; int rc; - cxl_nvb = kzalloc(sizeof(*cxl_nvb), GFP_KERNEL); + cxl_nvb = kzalloc_obj(*cxl_nvb, GFP_KERNEL); if (!cxl_nvb) return ERR_PTR(-ENOMEM); @@ -198,7 +198,7 @@ static struct cxl_nvdimm *cxl_nvdimm_alloc(struct cxl_nvdimm_bridge *cxl_nvb, struct cxl_nvdimm *cxl_nvd; struct device *dev; - cxl_nvd = kzalloc(sizeof(*cxl_nvd), GFP_KERNEL); + cxl_nvd = kzalloc_obj(*cxl_nvd, GFP_KERNEL); if (!cxl_nvd) return ERR_PTR(-ENOMEM); diff --git a/drivers/cxl/core/pmu.c b/drivers/cxl/core/pmu.c index b3136d7664ab..8eb175c3ff22 100644 --- a/drivers/cxl/core/pmu.c +++ b/drivers/cxl/core/pmu.c @@ -33,7 +33,7 @@ int devm_cxl_pmu_add(struct device *parent, struct cxl_pmu_regs *regs, struct device *dev; int rc; - pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); + pmu = kzalloc_obj(*pmu, GFP_KERNEL); if (!pmu) return -ENOMEM; diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index fea8d5f5f331..491c7485db60 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -688,11 +688,11 @@ static struct cxl_port *cxl_port_alloc(struct device *uport_dev, /* No parent_dport, root cxl_port */ if (!parent_dport) { - cxl_root = kzalloc(sizeof(*cxl_root), GFP_KERNEL); + cxl_root = kzalloc_obj(*cxl_root, GFP_KERNEL); if (!cxl_root) return ERR_PTR(-ENOMEM); } else { - _port = kzalloc(sizeof(*port), GFP_KERNEL); + _port = kzalloc_obj(*port, GFP_KERNEL); if (!_port) return ERR_PTR(-ENOMEM); } @@ -1184,7 +1184,7 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, CXL_TARGET_STRLEN) return ERR_PTR(-EINVAL); - dport = kzalloc(sizeof(*dport), GFP_KERNEL); + dport = kzalloc_obj(*dport, GFP_KERNEL); if (!dport) return ERR_PTR(-ENOMEM); @@ -1350,7 +1350,7 @@ static int cxl_add_ep(struct cxl_dport *dport, struct device *ep_dev) struct cxl_ep *ep; int rc; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; @@ -2017,8 +2017,7 @@ struct cxl_root_decoder *cxl_root_decoder_alloc(struct cxl_port *port, if (!is_cxl_root(port)) return ERR_PTR(-EINVAL); - cxlrd = kzalloc(struct_size(cxlrd, cxlsd.target, nr_targets), - GFP_KERNEL); + cxlrd = kzalloc_flex(*cxlrd, cxlsd.target, nr_targets, GFP_KERNEL); if (!cxlrd) return ERR_PTR(-ENOMEM); @@ -2071,7 +2070,7 @@ struct cxl_switch_decoder *cxl_switch_decoder_alloc(struct cxl_port *port, if (is_cxl_root(port) || is_cxl_endpoint(port)) return ERR_PTR(-EINVAL); - cxlsd = kzalloc(struct_size(cxlsd, target, nr_targets), GFP_KERNEL); + cxlsd = kzalloc_flex(*cxlsd, target, nr_targets, GFP_KERNEL); if (!cxlsd) return ERR_PTR(-ENOMEM); @@ -2102,7 +2101,7 @@ struct cxl_endpoint_decoder *cxl_endpoint_decoder_alloc(struct cxl_port *port) if (!is_cxl_endpoint(port)) return ERR_PTR(-EINVAL); - cxled = kzalloc(sizeof(*cxled), GFP_KERNEL); + cxled = kzalloc_obj(*cxled, GFP_KERNEL); if (!cxled) return ERR_PTR(-ENOMEM); diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 08fa3deef70a..288448cff91b 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -998,7 +998,7 @@ alloc_region_ref(struct cxl_port *port, struct cxl_region *cxlr, return ERR_PTR(-EBUSY); } - cxl_rr = kzalloc(sizeof(*cxl_rr), GFP_KERNEL); + cxl_rr = kzalloc_obj(*cxl_rr, GFP_KERNEL); if (!cxl_rr) return ERR_PTR(-ENOMEM); cxl_rr->port = port; @@ -2474,7 +2474,7 @@ static struct cxl_region *cxl_region_alloc(struct cxl_root_decoder *cxlrd, int i struct cxl_region *cxlr; struct device *dev; - cxlr = kzalloc(sizeof(*cxlr), GFP_KERNEL); + cxlr = kzalloc_obj(*cxlr, GFP_KERNEL); if (!cxlr) { memregion_free(id); return ERR_PTR(-ENOMEM); @@ -3464,7 +3464,7 @@ static int cxl_pmem_region_alloc(struct cxl_region *cxlr) return -ENXIO; struct cxl_pmem_region *cxlr_pmem __free(kfree) = - kzalloc(struct_size(cxlr_pmem, mapping, p->nr_targets), GFP_KERNEL); + kzalloc_flex(*cxlr_pmem, mapping, p->nr_targets, GFP_KERNEL); if (!cxlr_pmem) return -ENOMEM; @@ -3552,7 +3552,7 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr) if (p->state != CXL_CONFIG_COMMIT) return ERR_PTR(-ENXIO); - cxlr_dax = kzalloc(sizeof(*cxlr_dax), GFP_KERNEL); + cxlr_dax = kzalloc_obj(*cxlr_dax, GFP_KERNEL); if (!cxlr_dax) return ERR_PTR(-ENOMEM); @@ -3835,7 +3835,7 @@ static int __construct_region(struct cxl_region *cxlr, set_bit(CXL_REGION_F_AUTO, &cxlr->flags); cxlr->hpa_range = *hpa_range; - res = kmalloc(sizeof(*res), GFP_KERNEL); + res = kmalloc_obj(*res, GFP_KERNEL); if (!res) return -ENOMEM; diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c index e197883690ef..ead92ca37a4e 100644 --- a/drivers/cxl/pmem.c +++ b/drivers/cxl/pmem.c @@ -234,7 +234,7 @@ static int cxl_pmem_set_config_data(struct cxl_memdev_state *mds, return -EINVAL; set_lsa = - kvzalloc(struct_size(set_lsa, data, cmd->in_length), GFP_KERNEL); + kvzalloc_flex(*set_lsa, data, cmd->in_length, GFP_KERNEL); if (!set_lsa) return -ENOMEM; @@ -426,7 +426,7 @@ static int cxl_pmem_region_probe(struct device *dev) set_bit(ND_REGION_CXL, &ndr_desc.flags); set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags); - info = kmalloc_array(cxlr_pmem->nr_mappings, sizeof(*info), GFP_KERNEL); + info = kmalloc_objs(*info, cxlr_pmem->nr_mappings, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index fde29e0ad68b..3faaaa7a507b 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -110,7 +110,7 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf, dax_id = __dax_match_id(dax_drv, buf); if (!dax_id) { if (action == ID_ADD) { - dax_id = kzalloc(sizeof(*dax_id), GFP_KERNEL); + dax_id = kzalloc_obj(*dax_id, GFP_KERNEL); if (dax_id) { strscpy(dax_id->dev_name, buf, DAX_NAME_LEN); list_add(&dax_id->list, &dax_drv->ids); @@ -650,7 +650,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id, || !IS_ALIGNED(range_len(range), align)) return NULL; - dax_region = kzalloc(sizeof(*dax_region), GFP_KERNEL); + dax_region = kzalloc_obj(*dax_region, GFP_KERNEL); if (!dax_region) return NULL; @@ -807,7 +807,7 @@ static int devm_register_dax_mapping(struct dev_dax *dev_dax, int range_id) "region disabled\n")) return -ENXIO; - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) return -ENOMEM; mapping->range_id = range_id; @@ -1427,7 +1427,7 @@ static struct dev_dax *__devm_create_dev_dax(struct dev_dax_data *data) struct device *dev; int rc; - dev_dax = kzalloc(sizeof(*dev_dax), GFP_KERNEL); + dev_dax = kzalloc_obj(*dev_dax, GFP_KERNEL); if (!dev_dax) return ERR_PTR(-ENOMEM); diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index c036e4d0b610..8618115cc56f 100644 --- a/drivers/dax/kmem.c +++ b/drivers/dax/kmem.c @@ -121,7 +121,7 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) init_node_memory_type(numa_node, mtype); rc = -ENOMEM; - data = kzalloc(struct_size(data, res, dev_dax->nr_range), GFP_KERNEL); + data = kzalloc_flex(*data, res, dev_dax->nr_range, GFP_KERNEL); if (!data) goto err_dax_kmem_data; diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c index f5cedf816be1..583510850fad 100644 --- a/drivers/dca/dca-core.c +++ b/drivers/dca/dca-core.c @@ -44,7 +44,7 @@ static struct dca_domain *dca_allocate_domain(struct pci_bus *rc) { struct dca_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_NOWAIT); + domain = kzalloc_obj(*domain, GFP_NOWAIT); if (!domain) return NULL; diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 70219099c604..36bb954e27ca 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -313,7 +313,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, if (!desc->ops->set_event || !desc->ops->get_event) return ERR_PTR(-EINVAL); - edev = kzalloc(sizeof(struct devfreq_event_dev), GFP_KERNEL); + edev = kzalloc_obj(struct devfreq_event_dev, GFP_KERNEL); if (!edev) return ERR_PTR(-ENOMEM); diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 00979f2e0e27..5c094c884aba 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -821,7 +821,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_out; } - devfreq = kzalloc(sizeof(struct devfreq), GFP_KERNEL); + devfreq = kzalloc_obj(struct devfreq, GFP_KERNEL); if (!devfreq) { err = -ENOMEM; goto err_out; diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 8cd6f9a59f64..c0271cc76bd9 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -310,8 +310,7 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq) continue; } - parent_cpu_data = kzalloc(sizeof(*parent_cpu_data), - GFP_KERNEL); + parent_cpu_data = kzalloc_obj(*parent_cpu_data, GFP_KERNEL); if (!parent_cpu_data) { ret = -ENOMEM; goto err_put_policy; diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 395174f93960..70509a1ceecd 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -87,8 +87,8 @@ static const struct attribute_group dev_attr_group = { static int userspace_init(struct devfreq *devfreq) { int err = 0; - struct userspace_data *data = kzalloc(sizeof(struct userspace_data), - GFP_KERNEL); + struct userspace_data *data = kzalloc_obj(struct userspace_data, + GFP_KERNEL); if (!data) { err = -ENOMEM; diff --git a/drivers/dibs/dibs_loopback.c b/drivers/dibs/dibs_loopback.c index aa029e29c6b2..95ddc7712a89 100644 --- a/drivers/dibs/dibs_loopback.c +++ b/drivers/dibs/dibs_loopback.c @@ -64,7 +64,7 @@ static int dibs_lo_register_dmb(struct dibs_dev *dibs, struct dibs_dmb *dmb, if (sba_idx == DIBS_LO_MAX_DMBS) return -ENOSPC; - dmb_node = kzalloc(sizeof(*dmb_node), GFP_KERNEL); + dmb_node = kzalloc_obj(*dmb_node, GFP_KERNEL); if (!dmb_node) { rc = -ENOMEM; goto err_bit; @@ -303,7 +303,7 @@ static int dibs_lo_dev_probe(void) struct dibs_dev *dibs; int ret; - ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); + ldev = kzalloc_obj(*ldev, GFP_KERNEL); if (!ldev) return -ENOMEM; diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c index b8c16586706c..b763c4ab1a4e 100644 --- a/drivers/dibs/dibs_main.c +++ b/drivers/dibs/dibs_main.c @@ -133,7 +133,7 @@ struct dibs_dev *dibs_dev_alloc(void) { struct dibs_dev *dibs; - dibs = kzalloc(sizeof(*dibs), GFP_KERNEL); + dibs = kzalloc_obj(*dibs, GFP_KERNEL); if (!dibs) return dibs; dibs->dev.release = dibs_dev_release; diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index 0a051d656880..86500b6c4c53 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c @@ -221,7 +221,7 @@ static int __init dio_init(void) } /* Found a board, allocate it an entry in the list */ - dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); + dev = kzalloc_obj(struct dio_dev, GFP_KERNEL); if (!dev) { if (scode >= DIOII_SCBASE) iounmap(va); diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c index 174677faa577..d9374f2ff0ca 100644 --- a/drivers/dma-buf/dma-buf-mapping.c +++ b/drivers/dma-buf/dma-buf-mapping.c @@ -108,7 +108,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach, /* This function is supposed to work on MMIO memory only */ return ERR_PTR(-EINVAL); - dma = kzalloc(sizeof(*dma), GFP_KERNEL); + dma = kzalloc_obj(*dma, GFP_KERNEL); if (!dma) return ERR_PTR(-ENOMEM); @@ -119,7 +119,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach, */ break; case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE: - dma->state = kzalloc(sizeof(*dma->state), GFP_KERNEL); + dma->state = kzalloc_obj(*dma->state, GFP_KERNEL); if (!dma->state) { ret = -ENOMEM; goto err_free_dma; diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 77555096e4c7..71d5e7e42653 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -866,7 +866,7 @@ static int dma_buf_wrap_sg_table(struct sg_table **sg_table) * sg_table without copying the page_link and give only the copy back to * the importer. */ - to = kzalloc(sizeof(*to), GFP_KERNEL); + to = kzalloc_obj(*to, GFP_KERNEL); if (!to) return -ENOMEM; @@ -1020,7 +1020,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, if (WARN_ON(importer_ops && !importer_ops->move_notify)) return ERR_PTR(-EINVAL); - attach = kzalloc(sizeof(*attach), GFP_KERNEL); + attach = kzalloc_obj(*attach, GFP_KERNEL); if (!attach) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c index 6657d4b30af9..eb27fcc0aad5 100644 --- a/drivers/dma-buf/dma-fence-array.c +++ b/drivers/dma-buf/dma-fence-array.c @@ -179,7 +179,7 @@ struct dma_fence_array *dma_fence_array_alloc(int num_fences) { struct dma_fence_array *array; - return kzalloc(struct_size(array, callbacks, num_fences), GFP_KERNEL); + return kzalloc_flex(*array, callbacks, num_fences, GFP_KERNEL); } EXPORT_SYMBOL(dma_fence_array_alloc); diff --git a/drivers/dma-buf/dma-fence-unwrap.c b/drivers/dma-buf/dma-fence-unwrap.c index a495d8a6c2e3..dc2525b2a03f 100644 --- a/drivers/dma-buf/dma-fence-unwrap.c +++ b/drivers/dma-buf/dma-fence-unwrap.c @@ -155,7 +155,7 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences, dma_fence_put(unsignaled); - array = kmalloc_array(count, sizeof(*array), GFP_KERNEL); + array = kmalloc_objs(*array, count, GFP_KERNEL); if (!array) return NULL; diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 21c5c30b4f34..97f0f150e49a 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -156,7 +156,7 @@ struct dma_fence *dma_fence_allocate_private_stub(ktime_t timestamp) { struct dma_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (fence == NULL) return NULL; @@ -905,7 +905,7 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, return 0; } - cb = kcalloc(count, sizeof(struct default_wait_cb), GFP_KERNEL); + cb = kzalloc_objs(struct default_wait_cb, count, GFP_KERNEL); if (cb == NULL) { ret = -ENOMEM; goto err_free_cb; diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index d230ddeb24e0..e0b9eb871c35 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -244,7 +244,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) return ERR_PTR(-EINVAL); } - heap = kzalloc(sizeof(*heap), GFP_KERNEL); + heap = kzalloc_obj(*heap, GFP_KERNEL); if (!heap) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 49cc45fb42dd..06ed40c9d528 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -74,7 +74,7 @@ static int cma_heap_attach(struct dma_buf *dmabuf, struct dma_heap_attachment *a; int ret; - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) return -ENOMEM; @@ -308,7 +308,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, int ret = -ENOMEM; pgoff_t pg; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return ERR_PTR(-ENOMEM); @@ -346,7 +346,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, memset(page_address(cma_pages), 0, size); } - buffer->pages = kmalloc_array(pagecount, sizeof(*buffer->pages), GFP_KERNEL); + buffer->pages = kmalloc_objs(*buffer->pages, pagecount, GFP_KERNEL); if (!buffer->pages) { ret = -ENOMEM; goto free_cma; @@ -391,7 +391,7 @@ static int __init __add_cma_heap(struct cma *cma, const char *name) struct dma_heap_export_info exp_info; struct cma_heap *cma_heap; - cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL); + cma_heap = kzalloc_obj(*cma_heap, GFP_KERNEL); if (!cma_heap) return -ENOMEM; cma_heap->cma = cma; diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 4049d042afa1..27ba8e55d909 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -77,7 +77,7 @@ static int system_heap_attach(struct dma_buf *dmabuf, struct dma_heap_attachment *a; int ret; - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) return -ENOMEM; @@ -354,7 +354,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap, struct page *page, *tmp_page; int i, ret = -ENOMEM; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-fence-chain.c index ed4b323886e4..4ae7a6257e57 100644 --- a/drivers/dma-buf/st-dma-fence-chain.c +++ b/drivers/dma-buf/st-dma-fence-chain.c @@ -116,13 +116,11 @@ static int fence_chains_init(struct fence_chains *fc, unsigned int count, unsigned int i; int err = 0; - fc->chains = kvmalloc_array(count, sizeof(*fc->chains), - GFP_KERNEL | __GFP_ZERO); + fc->chains = kvmalloc_objs(*fc->chains, count, GFP_KERNEL | __GFP_ZERO); if (!fc->chains) return -ENOMEM; - fc->fences = kvmalloc_array(count, sizeof(*fc->fences), - GFP_KERNEL | __GFP_ZERO); + fc->fences = kvmalloc_objs(*fc->fences, count, GFP_KERNEL | __GFP_ZERO); if (!fc->fences) { err = -ENOMEM; goto err_chains; @@ -452,7 +450,7 @@ static int find_race(void *arg) if (err) return err; - threads = kmalloc_array(ncpus, sizeof(*threads), GFP_KERNEL); + threads = kmalloc_objs(*threads, ncpus, GFP_KERNEL); if (!threads) { err = -ENOMEM; goto err; diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c index a3be888ae2e8..56802a39874e 100644 --- a/drivers/dma-buf/st-dma-fence-unwrap.c +++ b/drivers/dma-buf/st-dma-fence-unwrap.c @@ -32,7 +32,7 @@ static struct dma_fence *__mock_fence(u64 context, u64 seqno) { struct mock_fence *f; - f = kmalloc(sizeof(*f), GFP_KERNEL); + f = kmalloc_obj(*f, GFP_KERNEL); if (!f) return NULL; @@ -54,7 +54,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...) va_list valist; int i; - fences = kcalloc(num_fences, sizeof(*fences), GFP_KERNEL); + fences = kzalloc_objs(*fences, num_fences, GFP_KERNEL); if (!fences) goto error_put; diff --git a/drivers/dma-buf/st-dma-resv.c b/drivers/dma-buf/st-dma-resv.c index 15dbea1462ed..fad024820f85 100644 --- a/drivers/dma-buf/st-dma-resv.c +++ b/drivers/dma-buf/st-dma-resv.c @@ -27,7 +27,7 @@ static struct dma_fence *alloc_fence(void) { struct dma_fence *f; - f = kmalloc(sizeof(*f), GFP_KERNEL); + f = kmalloc_obj(*f, GFP_KERNEL); if (!f) return NULL; diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index 6f09d13be6b6..d04f479edaee 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -101,7 +101,7 @@ static struct sync_timeline *sync_timeline_create(const char *name) { struct sync_timeline *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; @@ -252,7 +252,7 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj, { struct sync_pt *pt; - pt = kzalloc(sizeof(*pt), GFP_KERNEL); + pt = kzalloc_obj(*pt, GFP_KERNEL); if (!pt) return NULL; diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 747e377fb954..ad2c3e9e23bc 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -24,7 +24,7 @@ static struct sync_file *sync_file_alloc(void) { struct sync_file *sync_file; - sync_file = kzalloc(sizeof(*sync_file), GFP_KERNEL); + sync_file = kzalloc_obj(*sync_file, GFP_KERNEL); if (!sync_file) return NULL; diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 40399c26e6be..816ee45f4f99 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -115,7 +115,7 @@ static int vmap_udmabuf(struct dma_buf *buf, struct iosys_map *map) dma_resv_assert_held(buf->resv); - pages = kvmalloc_array(ubuf->pagecount, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, ubuf->pagecount, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -150,7 +150,7 @@ static struct sg_table *get_sg_table(struct device *dev, struct dma_buf *buf, unsigned int i = 0; int ret; - sg = kzalloc(sizeof(*sg), GFP_KERNEL); + sg = kzalloc_obj(*sg, GFP_KERNEL); if (!sg) return ERR_PTR(-ENOMEM); @@ -207,17 +207,16 @@ static void unpin_all_folios(struct udmabuf *ubuf) static __always_inline int init_udmabuf(struct udmabuf *ubuf, pgoff_t pgcnt) { - ubuf->folios = kvmalloc_array(pgcnt, sizeof(*ubuf->folios), GFP_KERNEL); + ubuf->folios = kvmalloc_objs(*ubuf->folios, pgcnt, GFP_KERNEL); if (!ubuf->folios) return -ENOMEM; - ubuf->offsets = kvcalloc(pgcnt, sizeof(*ubuf->offsets), GFP_KERNEL); + ubuf->offsets = kvzalloc_objs(*ubuf->offsets, pgcnt, GFP_KERNEL); if (!ubuf->offsets) return -ENOMEM; - ubuf->pinned_folios = kvmalloc_array(pgcnt, - sizeof(*ubuf->pinned_folios), - GFP_KERNEL); + ubuf->pinned_folios = kvmalloc_objs(*ubuf->pinned_folios, pgcnt, + GFP_KERNEL); if (!ubuf->pinned_folios) return -ENOMEM; diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index 2abbe11e797e..d7a033822045 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -189,7 +189,7 @@ int acpi_dma_controller_register(struct device *dev, if (!adev) return -EINVAL; - adma = kzalloc(sizeof(*adma), GFP_KERNEL); + adma = kzalloc_obj(*adma, GFP_KERNEL); if (!adma) return -ENOMEM; diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c index 50534a6045a0..b46999c81df0 100644 --- a/drivers/dma/altera-msgdma.c +++ b/drivers/dma/altera-msgdma.c @@ -657,7 +657,7 @@ static int msgdma_alloc_chan_resources(struct dma_chan *dchan) struct msgdma_sw_desc *desc; int i; - mdev->sw_desq = kcalloc(MSGDMA_DESC_NUM, sizeof(*desc), GFP_NOWAIT); + mdev->sw_desq = kzalloc_objs(*desc, MSGDMA_DESC_NUM, GFP_NOWAIT); if (!mdev->sw_desq) return -ENOMEM; diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index f16a70937200..fb9dad69c314 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1743,7 +1743,7 @@ static void pl08x_issue_pending(struct dma_chan *chan) static struct pl08x_txd *pl08x_get_txd(struct pl08x_dma_chan *plchan) { - struct pl08x_txd *txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + struct pl08x_txd *txd = kzalloc_obj(*txd, GFP_NOWAIT); if (txd) INIT_LIST_HEAD(&txd->dsg_list); @@ -1895,7 +1895,7 @@ static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy( return NULL; } - dsg = kzalloc(sizeof(struct pl08x_sg), GFP_NOWAIT); + dsg = kzalloc_obj(struct pl08x_sg, GFP_NOWAIT); if (!dsg) { pl08x_free_txd(pl08x, txd); return NULL; @@ -2020,7 +2020,7 @@ static int pl08x_tx_add_sg(struct pl08x_txd *txd, { struct pl08x_sg *dsg; - dsg = kzalloc(sizeof(struct pl08x_sg), GFP_NOWAIT); + dsg = kzalloc_obj(struct pl08x_sg, GFP_NOWAIT); if (!dsg) return -ENOMEM; @@ -2372,7 +2372,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, * to cope with that situation. */ for (i = 0; i < channels; i++) { - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return -ENOMEM; @@ -2390,7 +2390,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, chan->signal = i; pl08x_dma_slave_init(chan); } else { - chan->cd = kzalloc(sizeof(*chan->cd), GFP_KERNEL); + chan->cd = kzalloc_obj(*chan->cd, GFP_KERNEL); if (!chan->cd) { kfree(chan); return -ENOMEM; @@ -2709,7 +2709,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id) goto out_no_pl08x; /* Create the driver state holder */ - pl08x = kzalloc(sizeof(*pl08x), GFP_KERNEL); + pl08x = kzalloc_obj(*pl08x, GFP_KERNEL); if (!pl08x) { ret = -ENOMEM; goto out_no_pl08x; @@ -2855,8 +2855,8 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id) } /* Initialize physical channels */ - pl08x->phy_chans = kcalloc(vd->channels, sizeof(*pl08x->phy_chans), - GFP_KERNEL); + pl08x->phy_chans = kzalloc_objs(*pl08x->phy_chans, vd->channels, + GFP_KERNEL); if (!pl08x->phy_chans) { ret = -ENOMEM; goto out_no_phychans; diff --git a/drivers/dma/amd/qdma/qdma.c b/drivers/dma/amd/qdma/qdma.c index 8fb2d5e1df20..f5a02c6ed348 100644 --- a/drivers/dma/amd/qdma/qdma.c +++ b/drivers/dma/amd/qdma/qdma.c @@ -769,7 +769,7 @@ qdma_prep_device_sg(struct dma_chan *chan, struct scatterlist *sgl, struct dma_async_tx_descriptor *tx; struct qdma_mm_vdesc *vdesc; - vdesc = kzalloc(sizeof(*vdesc), GFP_NOWAIT); + vdesc = kzalloc_obj(*vdesc, GFP_NOWAIT); if (!vdesc) return NULL; vdesc->sgl = sgl; diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c index 04bbd774b3b4..14a5ee14a481 100644 --- a/drivers/dma/apple-admac.c +++ b/drivers/dma/apple-admac.c @@ -260,7 +260,7 @@ static struct dma_async_tx_descriptor *admac_prep_dma_cyclic( if (direction != admac_chan_direction(adchan->no)) return NULL; - adtx = kzalloc(sizeof(*adtx), GFP_NOWAIT); + adtx = kzalloc_obj(*adtx, GFP_NOWAIT); if (!adtx) return NULL; diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c index 9efe2ca7d5ec..84220fa83029 100644 --- a/drivers/dma/arm-dma350.c +++ b/drivers/dma/arm-dma350.c @@ -219,7 +219,7 @@ static struct dma_async_tx_descriptor *d350_prep_memcpy(struct dma_chan *chan, struct d350_desc *desc; u32 *cmd; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; @@ -257,7 +257,7 @@ static struct dma_async_tx_descriptor *d350_prep_memset(struct dma_chan *chan, struct d350_desc *desc; u32 *cmd; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 22bb604a3f97..935e3264ccec 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -929,7 +929,7 @@ atc_prep_dma_interleaved(struct dma_chan *chan, ATC_SRC_PIP | ATC_DST_PIP | FIELD_PREP(ATC_FC, ATC_FC_MEM2MEM); - desc = kzalloc(struct_size(desc, sg, 1), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, 1, GFP_ATOMIC); if (!desc) return NULL; desc->sglen = 1; @@ -992,7 +992,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, } sg_len = DIV_ROUND_UP(len, ATC_BTSIZE_MAX); - desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, sg_len, GFP_ATOMIC); if (!desc) return NULL; desc->sglen = sg_len; @@ -1131,7 +1131,7 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value, (fill_pattern << 8) | fill_pattern; - desc = kzalloc(struct_size(desc, sg, 1), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, 1, GFP_ATOMIC); if (!desc) goto err_free_buffer; desc->sglen = 1; @@ -1191,7 +1191,7 @@ atc_prep_dma_memset_sg(struct dma_chan *chan, } *(u32*)vaddr = value; - desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, sg_len, GFP_ATOMIC); if (!desc) goto err_free_dma_buf; desc->sglen = sg_len; @@ -1274,7 +1274,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, return NULL; } - desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, sg_len, GFP_ATOMIC); if (!desc) return NULL; desc->sglen = sg_len; @@ -1531,7 +1531,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, if (atc_dma_cyclic_check_values(reg_width, buf_addr, period_len)) goto err_out; - desc = kzalloc(struct_size(desc, sg, periods), GFP_ATOMIC); + desc = kzalloc_flex(*desc, sg, periods, GFP_ATOMIC); if (!desc) goto err_out; desc->sglen = periods; @@ -1818,7 +1818,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - atslave = kmalloc(sizeof(*atslave), GFP_KERNEL); + atslave = kmalloc_obj(*atslave, GFP_KERNEL); if (!atslave) { put_device(&dmac_pdev->dev); return NULL; diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 3f638c3e81cd..06d830d36882 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -297,7 +297,7 @@ static struct bcm2835_desc *bcm2835_dma_create_cb_chain( return NULL; /* allocate and setup the descriptor. */ - d = kzalloc(struct_size(d, cb_list, frames), gfp); + d = kzalloc_flex(*d, cb_list, frames, gfp); if (!d) return NULL; diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c index 6c4d655ffe77..e1b259c781ca 100644 --- a/drivers/dma/bestcomm/bestcomm.c +++ b/drivers/dma/bestcomm/bestcomm.c @@ -393,7 +393,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op) } /* Get a clean struct */ - bcom_eng = kzalloc(sizeof(struct bcom_engine), GFP_KERNEL); + bcom_eng = kzalloc_obj(struct bcom_engine, GFP_KERNEL); if (!bcom_eng) { rv = -ENOMEM; goto error_sramclean; diff --git a/drivers/dma/bestcomm/sram.c b/drivers/dma/bestcomm/sram.c index ad74d57cc3ab..c34639c30986 100644 --- a/drivers/dma/bestcomm/sram.c +++ b/drivers/dma/bestcomm/sram.c @@ -48,7 +48,7 @@ int bcom_sram_init(struct device_node *sram_node, char *owner) return -EBUSY; } - bcom_sram = kmalloc(sizeof(struct bcom_sram), GFP_KERNEL); + bcom_sram = kmalloc_obj(struct bcom_sram, GFP_KERNEL); if (!bcom_sram) { printk(KERN_ERR "%s: bcom_sram_init: " "Couldn't allocate internal state !\n", owner); diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index f5caf75dc0e7..eb65872c5d5c 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -540,7 +540,7 @@ axi_dmac_alloc_desc(struct axi_dmac_chan *chan, unsigned int num_sgs) dma_addr_t hw_phys; unsigned int i; - desc = kzalloc(struct_size(desc, sg, num_sgs), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg, num_sgs, GFP_NOWAIT); if (!desc) return NULL; desc->num_sgs = num_sgs; diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 100057603fd4..6070dfdb7114 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -237,7 +237,7 @@ jz4780_dma_desc_alloc(struct jz4780_dma_chan *jzchan, unsigned int count, if (count > JZ_DMA_MAX_DESC) return NULL; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index ca13cd39330b..b43a7b3a6a8d 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -1075,7 +1075,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, chan->local = alloc_percpu(typeof(*chan->local)); if (!chan->local) return -ENOMEM; - chan->dev = kzalloc(sizeof(*chan->dev), GFP_KERNEL); + chan->dev = kzalloc_obj(*chan->dev, GFP_KERNEL); if (!chan->dev) { rc = -ENOMEM; goto err_free_local; diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 91b2fbc0b864..1a18b8985afc 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -677,11 +677,11 @@ static int dmatest_func(void *data) set_user_nice(current, 10); - srcs = kcalloc(src->cnt, sizeof(dma_addr_t), GFP_KERNEL); + srcs = kzalloc_objs(dma_addr_t, src->cnt, GFP_KERNEL); if (!srcs) goto err_dst; - dma_pq = kcalloc(dst->cnt, sizeof(dma_addr_t), GFP_KERNEL); + dma_pq = kzalloc_objs(dma_addr_t, dst->cnt, GFP_KERNEL); if (!dma_pq) goto err_srcs_array; @@ -987,7 +987,7 @@ static int dmatest_add_threads(struct dmatest_info *info, return -EINVAL; for (i = 0; i < params->threads_per_chan; i++) { - thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL); + thread = kzalloc_obj(struct dmatest_thread, GFP_KERNEL); if (!thread) { pr_warn("No memory for %s-%s%u\n", dma_chan_name(chan), op, i); @@ -1025,7 +1025,7 @@ static int dmatest_add_channel(struct dmatest_info *info, unsigned int thread_count = 0; int cnt; - dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL); + dtc = kmalloc_obj(struct dmatest_chan, GFP_KERNEL); if (!dtc) { pr_warn("No memory for %s\n", dma_chan_name(chan)); return -ENOMEM; diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c index 493c2a32b0fe..5d74bc29cf89 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -293,11 +293,11 @@ static struct axi_dma_desc *axi_desc_alloc(u32 num) { struct axi_dma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; - desc->hw_desc = kcalloc(num, sizeof(*desc->hw_desc), GFP_NOWAIT); + desc->hw_desc = kzalloc_objs(*desc->hw_desc, num, GFP_NOWAIT); if (!desc->hw_desc) { kfree(desc); return NULL; diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 8e5f7defa6b6..e7d698b352d3 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -44,7 +44,7 @@ static struct dw_edma_burst *dw_edma_alloc_burst(struct dw_edma_chunk *chunk) { struct dw_edma_burst *burst; - burst = kzalloc(sizeof(*burst), GFP_NOWAIT); + burst = kzalloc_obj(*burst, GFP_NOWAIT); if (unlikely(!burst)) return NULL; @@ -68,7 +68,7 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc) struct dw_edma_chan *chan = desc->chan; struct dw_edma_chunk *chunk; - chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT); + chunk = kzalloc_obj(*chunk, GFP_NOWAIT); if (unlikely(!chunk)) return NULL; @@ -111,7 +111,7 @@ static struct dw_edma_desc *dw_edma_alloc_desc(struct dw_edma_chan *chan) { struct dw_edma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (unlikely(!desc)) return NULL; diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index e9caf8adca1f..df599b563124 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -167,7 +167,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, int i, mask; struct dw_edma_pcie_data *vsec_data __free(kfree) = - kmalloc(sizeof(*vsec_data), GFP_KERNEL); + kmalloc_obj(*vsec_data, GFP_KERNEL); if (!vsec_data) return -ENOMEM; diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c index cbec277af4dd..b0b4ccae2c77 100644 --- a/drivers/dma/dw/rzn1-dmamux.c +++ b/drivers/dma/dw/rzn1-dmamux.c @@ -53,7 +53,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec, goto put_device; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { ret = -ENOMEM; goto put_device; diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index e424bb5c40e7..375f608c8266 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -966,7 +966,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan) for (i = 0; i < DMA_MAX_CHAN_DESCRIPTORS; i++) { struct ep93xx_dma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) { dev_warn(chan2dev(edmac), "not enough descriptors\n"); break; diff --git a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c index 36384d019263..206e6bdaf99d 100644 --- a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +++ b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c @@ -99,7 +99,7 @@ dpaa2_qdma_request_desc(struct dpaa2_qdma_chan *dpaa2_chan) spin_lock_irqsave(&dpaa2_chan->queue_lock, flags); if (list_empty(&dpaa2_chan->comp_free)) { spin_unlock_irqrestore(&dpaa2_chan->queue_lock, flags); - comp_temp = kzalloc(sizeof(*comp_temp), GFP_NOWAIT); + comp_temp = kzalloc_obj(*comp_temp, GFP_NOWAIT); if (!comp_temp) goto err; comp_temp->fd_virt_addr = @@ -353,7 +353,7 @@ static int __cold dpaa2_qdma_setup(struct fsl_mc_device *ls_dev) } priv->num_pairs = min(priv->dpdmai_attr.num_of_priorities, prio_def); - ppriv = kcalloc(priv->num_pairs, sizeof(*ppriv), GFP_KERNEL); + ppriv = kzalloc_objs(*ppriv, priv->num_pairs, GFP_KERNEL); if (!ppriv) { err = -ENOMEM; goto exit; @@ -659,7 +659,7 @@ static int dpaa2_qdma_probe(struct fsl_mc_device *dpdmai_dev) struct dpaa2_qdma_priv *priv; int err; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; dev_set_drvdata(dev, priv); @@ -707,7 +707,7 @@ static int dpaa2_qdma_probe(struct fsl_mc_device *dpdmai_dev) goto err_enable; } - dpaa2_qdma = kzalloc(sizeof(*dpaa2_qdma), GFP_KERNEL); + dpaa2_qdma = kzalloc_obj(*dpaa2_qdma, GFP_KERNEL); if (!dpaa2_qdma) { err = -ENOMEM; goto err_eng; diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 7137f51ff6a0..6a38738e56e2 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -565,7 +565,7 @@ static struct fsl_edma_desc *fsl_edma_alloc_desc(struct fsl_edma_chan *fsl_chan, struct fsl_edma_desc *fsl_desc; int i; - fsl_desc = kzalloc(struct_size(fsl_desc, tcd, sg_len), GFP_NOWAIT); + fsl_desc = kzalloc_flex(*fsl_desc, tcd, sg_len, GFP_NOWAIT); if (!fsl_desc) return NULL; diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index 6ace5bf80c40..db863bf7b0e6 100644 --- a/drivers/dma/fsl-qdma.c +++ b/drivers/dma/fsl-qdma.c @@ -406,7 +406,7 @@ static int fsl_qdma_pre_request_enqueue_desc(struct fsl_qdma_queue *queue) struct fsl_qdma_comp *comp_temp, *_comp_temp; for (i = 0; i < queue->n_cq + FSL_COMMAND_QUEUE_OVERFLLOW; i++) { - comp_temp = kzalloc(sizeof(*comp_temp), GFP_KERNEL); + comp_temp = kzalloc_obj(*comp_temp, GFP_KERNEL); if (!comp_temp) goto err_alloc; comp_temp->virt_addr = diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c index 6e6d7e0e475e..5ba9a14bb78a 100644 --- a/drivers/dma/fsl_raid.c +++ b/drivers/dma/fsl_raid.c @@ -290,7 +290,7 @@ static struct fsl_re_desc *fsl_re_chan_alloc_desc(struct fsl_re_chan *re_chan, spin_unlock_irqrestore(&re_chan->desc_lock, lock_flag); if (!desc) { - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; @@ -579,7 +579,7 @@ static int fsl_re_alloc_chan_resources(struct dma_chan *chan) re_chan = container_of(chan, struct fsl_re_chan, chan); for (i = 0; i < FSL_RE_MIN_DESCS; i++) { - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) break; diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 9b126a260267..1525b6fe54b4 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -1111,7 +1111,7 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev, int err; /* alloc channel */ - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) { err = -ENOMEM; goto out_return; @@ -1218,7 +1218,7 @@ static int fsldma_of_probe(struct platform_device *op) unsigned int i; int err; - fdev = kzalloc(sizeof(*fdev), GFP_KERNEL); + fdev = kzalloc_obj(*fdev, GFP_KERNEL); if (!fdev) { err = -ENOMEM; goto out_return; diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c index 25a4134be36b..32a0e95c6a20 100644 --- a/drivers/dma/hisi_dma.c +++ b/drivers/dma/hisi_dma.c @@ -485,7 +485,7 @@ hisi_dma_prep_dma_memcpy(struct dma_chan *c, dma_addr_t dst, dma_addr_t src, struct hisi_dma_chan *chan = to_hisi_dma_chan(c); struct hisi_dma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index af5a2e252c25..f62d60d7bc6b 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -245,11 +245,11 @@ static struct hsu_dma_desc *hsu_dma_alloc_desc(unsigned int nents) { struct hsu_dma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; - desc->sg = kcalloc(nents, sizeof(*desc->sg), GFP_NOWAIT); + desc->sg = kzalloc_objs(*desc->sg, nents, GFP_NOWAIT); if (!desc->sg) { kfree(desc); return NULL; diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index d147353d47ab..5fcd1befc92d 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -196,11 +196,11 @@ static struct idma64_desc *idma64_alloc_desc(unsigned int ndesc) { struct idma64_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; - desc->hw = kcalloc(ndesc, sizeof(*desc->hw), GFP_NOWAIT); + desc->hw = kzalloc_objs(*desc->hw, ndesc, GFP_NOWAIT); if (!desc->hw) { kfree(desc); return NULL; diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c index 7e4715f92773..49fcc429d262 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -232,7 +232,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq)); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -538,7 +538,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq) struct idxd_cdev_context *cdev_ctx; int rc, minor; - idxd_cdev = kzalloc(sizeof(*idxd_cdev), GFP_KERNEL); + idxd_cdev = kzalloc_obj(*idxd_cdev, GFP_KERNEL); if (!idxd_cdev) return -ENOMEM; diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c index 1107db3ce0a3..976d8aaa4517 100644 --- a/drivers/dma/idxd/irq.c +++ b/drivers/dma/idxd/irq.c @@ -492,7 +492,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) val |= IDXD_INTC_INT_HANDLE_REVOKED; - revoke = kzalloc(sizeof(*revoke), GFP_ATOMIC); + revoke = kzalloc_obj(*revoke, GFP_ATOMIC); if (revoke) { revoke->idxd = idxd; INIT_WORK(&revoke->work, idxd_int_handle_revoke); @@ -567,7 +567,7 @@ bool idxd_queue_int_handle_resubmit(struct idxd_desc *desc) struct idxd_device *idxd = wq->idxd; struct idxd_resubmit *irw; - irw = kzalloc(sizeof(*irw), GFP_KERNEL); + irw = kzalloc_obj(*irw, GFP_KERNEL); if (!irw) return false; diff --git a/drivers/dma/idxd/perfmon.c b/drivers/dma/idxd/perfmon.c index 4b6af2f15d8a..3283841d3ddc 100644 --- a/drivers/dma/idxd/perfmon.c +++ b/drivers/dma/idxd/perfmon.c @@ -128,7 +128,7 @@ static int perfmon_validate_group(struct idxd_pmu *pmu, struct idxd_pmu *fake_pmu; int i, ret = 0, n, idx; - fake_pmu = kzalloc(sizeof(*fake_pmu), GFP_KERNEL); + fake_pmu = kzalloc_obj(*fake_pmu, GFP_KERNEL); if (!fake_pmu) return -ENOMEM; @@ -484,7 +484,7 @@ int perfmon_pmu_init(struct idxd_device *idxd) if (idxd->perfmon_offset == 0) return -ENODEV; - idxd_pmu = kzalloc(sizeof(*idxd_pmu), GFP_KERNEL); + idxd_pmu = kzalloc_obj(*idxd_pmu, GFP_KERNEL); if (!idxd_pmu) return -ENOMEM; diff --git a/drivers/dma/img-mdc-dma.c b/drivers/dma/img-mdc-dma.c index fd55bcd060ab..b3765ba15803 100644 --- a/drivers/dma/img-mdc-dma.c +++ b/drivers/dma/img-mdc-dma.c @@ -294,7 +294,7 @@ static struct dma_async_tx_descriptor *mdc_prep_dma_memcpy( if (!len) return NULL; - mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); + mdesc = kzalloc_obj(*mdesc, GFP_NOWAIT); if (!mdesc) return NULL; mdesc->chan = mchan; @@ -382,7 +382,7 @@ static struct dma_async_tx_descriptor *mdc_prep_dma_cyclic( if (mdc_check_slave_width(mchan, dir) < 0) return NULL; - mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); + mdesc = kzalloc_obj(*mdesc, GFP_NOWAIT); if (!mdesc) return NULL; mdesc->chan = mchan; @@ -465,7 +465,7 @@ static struct dma_async_tx_descriptor *mdc_prep_slave_sg( if (mdc_check_slave_width(mchan, dir) < 0) return NULL; - mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); + mdesc = kzalloc_obj(*mdesc, GFP_NOWAIT); if (!mdesc) return NULL; mdesc->chan = mchan; diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index ba434657059a..d20c14f297a7 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -746,7 +746,7 @@ static int imxdma_alloc_chan_resources(struct dma_chan *chan) while (imxdmac->descs_allocated < IMXDMA_MAX_CHAN_DESCRIPTORS) { struct imxdma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) break; dma_async_tx_descriptor_init(&desc->desc, chan); @@ -865,8 +865,8 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( kfree(imxdmac->sg_list); - imxdmac->sg_list = kcalloc(periods + 1, - sizeof(struct scatterlist), GFP_ATOMIC); + imxdmac->sg_list = kzalloc_objs(struct scatterlist, periods + 1, + GFP_ATOMIC); if (!imxdmac->sg_list) return NULL; diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index ed9e56de5a9b..4093fba9cc23 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1544,7 +1544,7 @@ static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac, goto err_out; } - desc = kzalloc((sizeof(*desc)), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) goto err_out; @@ -2288,7 +2288,7 @@ static int sdma_probe(struct platform_device *pdev) sdma->irq = irq; - sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL); + sdma->script_addrs = kzalloc_obj(*sdma->script_addrs, GFP_KERNEL); if (!sdma->script_addrs) { ret = -ENOMEM; goto err_irq; diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index b8fff8333aef..ee93b029f9e3 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -378,7 +378,7 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) int i, chunks; /* allocate the array to hold the software ring */ - ring = kcalloc(total_descs, sizeof(*ring), flags); + ring = kzalloc_objs(*ring, total_descs, flags); if (!ring) return NULL; diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index 227398673b73..a4e539e48444 100644 --- a/drivers/dma/ioat/init.c +++ b/drivers/dma/ioat/init.c @@ -574,7 +574,7 @@ static void ioat_enumerate_channels(struct ioatdma_device *ioat_dma) dev_dbg(dev, "%s: xfercap = %d\n", __func__, 1 << xfercap_log); for (i = 0; i < chancnt; i++) { - ioat_chan = kzalloc(sizeof(*ioat_chan), GFP_KERNEL); + ioat_chan = kzalloc_obj(*ioat_chan, GFP_KERNEL); if (!ioat_chan) break; @@ -1332,7 +1332,7 @@ static void release_ioatdma(struct dma_device *device) static struct ioatdma_device * alloc_ioatdma(struct pci_dev *pdev, void __iomem *iobase) { - struct ioatdma_device *d = kzalloc(sizeof(*d), GFP_KERNEL); + struct ioatdma_device *d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return NULL; diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index 63677c0b6f18..e84f197fea76 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -471,7 +471,7 @@ static struct k3_dma_desc_sw *k3_dma_alloc_desc_resource(int num, return NULL; } - ds = kzalloc(sizeof(*ds), GFP_NOWAIT); + ds = kzalloc_obj(*ds, GFP_NOWAIT); if (!ds) return NULL; diff --git a/drivers/dma/lgm/lgm-dma.c b/drivers/dma/lgm/lgm-dma.c index a7b9cf30f6ad..c1f859472a96 100644 --- a/drivers/dma/lgm/lgm-dma.c +++ b/drivers/dma/lgm/lgm-dma.c @@ -681,7 +681,7 @@ ldma_chan_desc_cfg(struct dma_chan *chan, dma_addr_t desc_base, int desc_num) c->desc_cnt = desc_num; c->desc_phys = desc_base; - ds = kzalloc(sizeof(*ds), GFP_NOWAIT); + ds = kzalloc_obj(*ds, GFP_NOWAIT); if (!ds) return NULL; @@ -982,7 +982,7 @@ dma_alloc_desc_resource(int num, struct ldma_chan *c) return NULL; } - ds = kzalloc(sizeof(*ds), GFP_NOWAIT); + ds = kzalloc_obj(*ds, GFP_NOWAIT); if (!ds) return NULL; diff --git a/drivers/dma/loongson1-apb-dma.c b/drivers/dma/loongson1-apb-dma.c index 255fe7eca212..2e347aba9af8 100644 --- a/drivers/dma/loongson1-apb-dma.c +++ b/drivers/dma/loongson1-apb-dma.c @@ -204,7 +204,7 @@ static struct ls1x_dma_desc *ls1x_dma_alloc_desc(void) { struct ls1x_dma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; @@ -335,7 +335,7 @@ ls1x_dma_prep_dma_cyclic(struct dma_chan *dchan, dma_addr_t buf_addr, /* allocate the scatterlist */ sg_len = buf_len / period_len; - sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_NOWAIT); + sgl = kmalloc_objs(*sgl, sg_len, GFP_NOWAIT); if (!sgl) return NULL; diff --git a/drivers/dma/loongson2-apb-dma.c b/drivers/dma/loongson2-apb-dma.c index c528f02b9f84..b981475e6779 100644 --- a/drivers/dma/loongson2-apb-dma.c +++ b/drivers/dma/loongson2-apb-dma.c @@ -335,7 +335,7 @@ ls2x_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (!burst_size) return NULL; - desc = kzalloc(struct_size(desc, sg, sg_len), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg, sg_len, GFP_NOWAIT); if (!desc) return NULL; @@ -400,7 +400,7 @@ ls2x_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_ return NULL; num_periods = buf_len / period_len; - desc = kzalloc(struct_size(desc, sg, num_periods), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg, num_periods, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c index 9f0c41ca7770..80791e30aec2 100644 --- a/drivers/dma/mediatek/mtk-cqdma.c +++ b/drivers/dma/mediatek/mtk-cqdma.c @@ -501,12 +501,12 @@ mtk_cqdma_prep_dma_memcpy(struct dma_chan *c, dma_addr_t dest, * until all the child CVDs completed. */ nr_vd = DIV_ROUND_UP(len, MTK_CQDMA_MAX_LEN); - cvd = kcalloc(nr_vd, sizeof(*cvd), GFP_NOWAIT); + cvd = kzalloc_objs(*cvd, nr_vd, GFP_NOWAIT); if (!cvd) return NULL; for (i = 0; i < nr_vd; ++i) { - cvd[i] = kzalloc(sizeof(*cvd[i]), GFP_NOWAIT); + cvd[i] = kzalloc_obj(*cvd[i], GFP_NOWAIT); if (!cvd[i]) { for (; i > 0; --i) kfree(cvd[i - 1]); diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c index fa77bb24a430..a43412ff5edd 100644 --- a/drivers/dma/mediatek/mtk-hsdma.c +++ b/drivers/dma/mediatek/mtk-hsdma.c @@ -334,7 +334,7 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma, ring->cur_tptr = 0; ring->cur_rptr = MTK_DMA_SIZE - 1; - ring->cb = kcalloc(MTK_DMA_SIZE, sizeof(*ring->cb), GFP_NOWAIT); + ring->cb = kzalloc_objs(*ring->cb, MTK_DMA_SIZE, GFP_NOWAIT); if (!ring->cb) { err = -ENOMEM; goto err_free_dma; @@ -722,7 +722,7 @@ mtk_hsdma_prep_dma_memcpy(struct dma_chan *c, dma_addr_t dest, { struct mtk_hsdma_vdesc *hvd; - hvd = kzalloc(sizeof(*hvd), GFP_NOWAIT); + hvd = kzalloc_obj(*hvd, GFP_NOWAIT); if (!hvd) return NULL; diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c index 3b9761f4e8a1..c269d84d7bd2 100644 --- a/drivers/dma/mediatek/mtk-uart-apdma.c +++ b/drivers/dma/mediatek/mtk-uart-apdma.c @@ -351,7 +351,7 @@ static struct dma_async_tx_descriptor *mtk_uart_apdma_prep_slave_sg return NULL; /* Now allocate and setup the descriptor */ - d = kzalloc(sizeof(*d), GFP_NOWAIT); + d = kzalloc_obj(*d, GFP_NOWAIT); if (!d) return NULL; diff --git a/drivers/dma/milbeaut-hdmac.c b/drivers/dma/milbeaut-hdmac.c index 9a5ec247ed6d..b4ebc09e80d0 100644 --- a/drivers/dma/milbeaut-hdmac.c +++ b/drivers/dma/milbeaut-hdmac.c @@ -265,11 +265,11 @@ milbeaut_hdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (!is_slave_direction(direction)) return NULL; - md = kzalloc(sizeof(*md), GFP_NOWAIT); + md = kzalloc_obj(*md, GFP_NOWAIT); if (!md) return NULL; - md->sgl = kcalloc(sg_len, sizeof(*sgl), GFP_NOWAIT); + md->sgl = kzalloc_objs(*sgl, sg_len, GFP_NOWAIT); if (!md->sgl) { kfree(md); return NULL; diff --git a/drivers/dma/milbeaut-xdmac.c b/drivers/dma/milbeaut-xdmac.c index 58d4fd6df0bf..0bfa247e746e 100644 --- a/drivers/dma/milbeaut-xdmac.c +++ b/drivers/dma/milbeaut-xdmac.c @@ -192,7 +192,7 @@ milbeaut_xdmac_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, struct virt_dma_chan *vc = to_virt_chan(chan); struct milbeaut_xdmac_desc *md; - md = kzalloc(sizeof(*md), GFP_NOWAIT); + md = kzalloc_obj(*md, GFP_NOWAIT); if (!md) return NULL; diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c index de09e1ab7767..442f5aa16031 100644 --- a/drivers/dma/moxart-dma.c +++ b/drivers/dma/moxart-dma.c @@ -301,7 +301,7 @@ static struct dma_async_tx_descriptor *moxart_prep_slave_sg( return NULL; } - d = kzalloc(struct_size(d, sg, sg_len), GFP_ATOMIC); + d = kzalloc_flex(*d, sg, sg_len, GFP_ATOMIC); if (!d) return NULL; d->sglen = sg_len; diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index bf131cb5db66..37550b42c30e 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -503,7 +503,7 @@ static int mpc_dma_alloc_chan_resources(struct dma_chan *chan) /* Alloc descriptors for this channel */ for (i = 0; i < MPC_DMA_DESCRIPTORS; i++) { - mdesc = kzalloc(sizeof(struct mpc_dma_desc), GFP_KERNEL); + mdesc = kzalloc_obj(struct mpc_dma_desc, GFP_KERNEL); if (!mdesc) { dev_notice(mdma->dma.dev, "Memory allocation error. Allocated only %u descriptors\n", i); diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 5e8386296046..f4f65ef44234 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c @@ -443,7 +443,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) /* Allocate descriptor slots */ idx = mv_chan->slots_allocated; while (idx < num_descs_in_pool) { - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) { dev_info(mv_chan_to_devp(mv_chan), "channel only initialized %d descriptor slots", diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index 423442e55d36..d27c74f1669b 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -127,7 +127,7 @@ int of_dma_controller_register(struct device_node *np, return -EINVAL; } - ofdma = kzalloc(sizeof(*ofdma), GFP_KERNEL); + ofdma = kzalloc_obj(*ofdma, GFP_KERNEL); if (!ofdma) return -ENOMEM; @@ -194,7 +194,7 @@ int of_dma_router_register(struct device_node *np, return -EINVAL; } - ofdma = kzalloc(sizeof(*ofdma), GFP_KERNEL); + ofdma = kzalloc_obj(*ofdma, GFP_KERNEL); if (!ofdma) return -ENOMEM; diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c index 57cec757d8f5..7c80572fc71d 100644 --- a/drivers/dma/owl-dma.c +++ b/drivers/dma/owl-dma.c @@ -878,7 +878,7 @@ static struct dma_async_tx_descriptor if (!len) return NULL; - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; @@ -929,7 +929,7 @@ static struct dma_async_tx_descriptor size_t len; int ret, i; - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; @@ -993,7 +993,7 @@ static struct dma_async_tx_descriptor unsigned int periods = buf_len / period_len; int ret, i; - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index 6b2793b07694..69560dd8c365 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -806,7 +806,7 @@ static int pch_dma_probe(struct pci_dev *pdev, int i; nr_channels = id->driver_data; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return -ENOMEM; diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 72f260328ae9..996c259107e3 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1887,8 +1887,7 @@ static int dmac_alloc_threads(struct pl330_dmac *pl330) int i; /* Allocate 1 Manager and 'chans' Channel threads */ - pl330->channels = kcalloc(1 + chans, sizeof(*thrd), - GFP_KERNEL); + pl330->channels = kzalloc_objs(*thrd, 1 + chans, GFP_KERNEL); if (!pl330->channels) return -ENOMEM; @@ -2548,7 +2547,7 @@ static int add_desc(struct list_head *pool, spinlock_t *lock, unsigned long flags; int i; - desc = kcalloc(count, sizeof(*desc), flg); + desc = kzalloc_objs(*desc, count, flg); if (!desc) return 0; @@ -3093,7 +3092,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) pl330->num_peripherals = num_chan; - pl330->peripherals = kcalloc(num_chan, sizeof(*pch), GFP_KERNEL); + pl330->peripherals = kzalloc_objs(*pch, num_chan, GFP_KERNEL); if (!pl330->peripherals) { ret = -ENOMEM; goto probe_err2; diff --git a/drivers/dma/plx_dma.c b/drivers/dma/plx_dma.c index 34b6416c3287..1958fa8f96e4 100644 --- a/drivers/dma/plx_dma.c +++ b/drivers/dma/plx_dma.c @@ -378,13 +378,13 @@ static int plx_dma_alloc_desc(struct plx_dma_dev *plxdev) struct plx_dma_desc *desc; int i; - plxdev->desc_ring = kcalloc(PLX_DMA_RING_COUNT, - sizeof(*plxdev->desc_ring), GFP_KERNEL); + plxdev->desc_ring = kzalloc_objs(*plxdev->desc_ring, PLX_DMA_RING_COUNT, + GFP_KERNEL); if (!plxdev->desc_ring) return -ENOMEM; for (i = 0; i < PLX_DMA_RING_COUNT; i++) { - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) goto free_and_exit; @@ -501,7 +501,7 @@ static int plx_dma_create(struct pci_dev *pdev) struct dma_chan *chan; int rc; - plxdev = kzalloc(sizeof(*plxdev), GFP_KERNEL); + plxdev = kzalloc_obj(*plxdev, GFP_KERNEL); if (!plxdev) return -ENOMEM; diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index 61500ad7c850..7c08e80dcc4c 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -1781,8 +1781,7 @@ static int ppc440spe_adma_alloc_chan_resources(struct dma_chan *chan) db_sz = sizeof(struct xor_cb); for (; i < (ppc440spe_chan->device->pool_size / db_sz); i++) { - slot = kzalloc(sizeof(struct ppc440spe_adma_desc_slot), - GFP_KERNEL); + slot = kzalloc_obj(struct ppc440spe_adma_desc_slot, GFP_KERNEL); if (!slot) { printk(KERN_INFO "SPE ADMA Channel only initialized" " %d descriptor slots", i--); @@ -4064,7 +4063,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) } /* create a device */ - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) { initcode = PPC_ADMA_INIT_ALLOC; ret = -ENOMEM; @@ -4124,7 +4123,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) platform_set_drvdata(ofdev, adev); /* create a channel */ - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) { initcode = PPC_ADMA_INIT_CHANNEL; ret = -ENOMEM; @@ -4161,7 +4160,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) PAGE_SIZE, DMA_BIDIRECTIONAL); } - ref = kmalloc(sizeof(*ref), GFP_KERNEL); + ref = kmalloc_obj(*ref, GFP_KERNEL); if (ref) { ref->chan = &chan->common; INIT_LIST_HEAD(&ref->node); diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index b639c8b51e87..a48ba9fc9f49 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -342,8 +342,7 @@ static void pxad_init_debugfs(struct pxad_device *pdev) struct dentry *chandir; pdev->dbgfs_chan = - kmalloc_array(pdev->nr_chans, sizeof(struct dentry *), - GFP_KERNEL); + kmalloc_objs(struct dentry *, pdev->nr_chans, GFP_KERNEL); if (!pdev->dbgfs_chan) return; @@ -742,8 +741,7 @@ pxad_alloc_desc(struct pxad_chan *chan, unsigned int nb_hw_desc) void *desc; int i; - sw_desc = kzalloc(struct_size(sw_desc, hw_desc, nb_hw_desc), - GFP_NOWAIT); + sw_desc = kzalloc_flex(*sw_desc, hw_desc, nb_hw_desc, GFP_NOWAIT); if (!sw_desc) return NULL; sw_desc->desc_pool = chan->desc_pool; diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index e184cebbface..19116295f832 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -662,8 +662,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, /* allocate enough room to accommodate the number of entries */ num_alloc = sg_nents_for_dma(sgl, sg_len, BAM_FIFO_SIZE); - async_desc = kzalloc(struct_size(async_desc, desc, num_alloc), - GFP_NOWAIT); + async_desc = kzalloc_flex(*async_desc, desc, num_alloc, GFP_NOWAIT); if (!async_desc) return NULL; diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c index 6e30f3aa401e..c9a6f610ffd9 100644 --- a/drivers/dma/qcom/gpi.c +++ b/drivers/dma/qcom/gpi.c @@ -1836,7 +1836,7 @@ gpi_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (!(flags & DMA_PREP_INTERRUPT) && (nr - nr_tre < 2)) return NULL; - gpi_desc = kzalloc(sizeof(*gpi_desc), GFP_NOWAIT); + gpi_desc = kzalloc_obj(*gpi_desc, GFP_NOWAIT); if (!gpi_desc) return NULL; diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index c2b3e4452e71..5a8dca8db5ce 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -352,7 +352,7 @@ static int hidma_alloc_chan_resources(struct dma_chan *dmach) /* Alloc descriptors for this channel */ for (i = 0; i < dmadev->nr_descriptors; i++) { - mdesc = kzalloc(sizeof(struct hidma_desc), GFP_NOWAIT); + mdesc = kzalloc_obj(struct hidma_desc, GFP_NOWAIT); if (!mdesc) { rc = -ENOMEM; break; diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c index 490edad20ae6..07fbe32d31fa 100644 --- a/drivers/dma/qcom/qcom_adm.c +++ b/drivers/dma/qcom/qcom_adm.c @@ -401,7 +401,7 @@ static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan, single_count = sg_nents_for_dma(sgl, sg_len, ADM_MAX_XFER); } - async_desc = kzalloc(sizeof(*async_desc), GFP_NOWAIT); + async_desc = kzalloc_obj(*async_desc, GFP_NOWAIT); if (!async_desc) { dev_err(adev->dev, "not enough memory for async_desc struct\n"); return NULL; diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index 86f1d7461f56..bcbdaf75db15 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c @@ -551,7 +551,7 @@ static struct dma_async_tx_descriptor *sa11x0_dma_prep_slave_sg( } j = sg_nents_for_dma(sg, sglen, DMA_MAX_SIZE & ~DMA_ALIGN); - txd = kzalloc(struct_size(txd, sg, j), GFP_ATOMIC); + txd = kzalloc_flex(*txd, sg, j, GFP_ATOMIC); if (!txd) { dev_dbg(chan->device->dev, "vchan %p: kzalloc failed\n", &c->vc); return NULL; @@ -621,7 +621,7 @@ static struct dma_async_tx_descriptor *sa11x0_dma_prep_dma_cyclic( if (sglen == 0) return NULL; - txd = kzalloc(struct_size(txd, sg, sglen), GFP_ATOMIC); + txd = kzalloc_flex(*txd, sg, sglen, GFP_ATOMIC); if (!txd) { dev_dbg(chan->device->dev, "vchan %p: kzalloc failed\n", &c->vc); return NULL; @@ -848,7 +848,7 @@ static int sa11x0_dma_init_dmadev(struct dma_device *dmadev, for (i = 0; i < ARRAY_SIZE(chan_desc); i++) { struct sa11x0_dma_chan *c; - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) { dev_err(dev, "no memory for channel %u\n", i); return -ENOMEM; @@ -907,7 +907,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev) if (!res) return -ENXIO; - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c index 7ad3c29be146..b3cba11b6203 100644 --- a/drivers/dma/sf-pdma/sf-pdma.c +++ b/drivers/dma/sf-pdma/sf-pdma.c @@ -56,7 +56,7 @@ static struct sf_pdma_desc *sf_pdma_alloc_desc(struct sf_pdma_chan *chan) { struct sf_pdma_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 475a347cae1b..44eab2d21d54 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1254,7 +1254,7 @@ rcar_dmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, * Allocate the sg list dynamically as it would consume too much stack * space. */ - sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_NOWAIT); + sgl = kmalloc_objs(*sgl, sg_len, GFP_NOWAIT); if (!sgl) return NULL; diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 7736d33a9641..7f9b45c4553d 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -443,7 +443,7 @@ static int rz_dmac_alloc_chan_resources(struct dma_chan *chan) while (channel->descs_allocated < RZ_DMAC_MAX_CHAN_DESCRIPTORS) { struct rz_dmac_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) break; diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c index 3ff2a8be8faa..59eab919a3e3 100644 --- a/drivers/dma/sh/shdma-base.c +++ b/drivers/dma/sh/shdma-base.c @@ -740,7 +740,7 @@ static struct dma_async_tx_descriptor *shdma_prep_dma_cyclic( * Allocate the sg list dynamically as it would consume too much stack * space. */ - sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_KERNEL); + sgl = kmalloc_objs(*sgl, sg_len, GFP_KERNEL); if (!sgl) return NULL; @@ -1012,7 +1012,7 @@ int shdma_init(struct device *dev, struct shdma_dev *sdev, !sdev->ops->desc_completed) return -EINVAL; - sdev->schan = kcalloc(chan_num, sizeof(*sdev->schan), GFP_KERNEL); + sdev->schan = kzalloc_objs(*sdev->schan, chan_num, GFP_KERNEL); if (!sdev->schan) return -ENOMEM; diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index b42e5a66fd95..16509be0d360 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -266,7 +266,7 @@ static int usb_dmac_desc_alloc(struct usb_dmac_chan *chan, unsigned int sg_len, struct usb_dmac_desc *desc; unsigned long flags; - desc = kzalloc(struct_size(desc, sg, sg_len), gfp); + desc = kzalloc_flex(*desc, sg, sg_len, gfp); if (!desc) return -ENOMEM; diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 6207e0b185e1..087fea3af2e4 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -901,7 +901,7 @@ sprd_dma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, enum sprd_dma_datawidth datawidth; u32 step, temp; - sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT); + sdesc = kzalloc_obj(*sdesc, GFP_NOWAIT); if (!sdesc) return NULL; @@ -986,7 +986,7 @@ sprd_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; schan->int_type = flags & SPRD_DMA_INT_TYPE_MASK; - sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT); + sdesc = kzalloc_obj(*sdesc, GFP_NOWAIT); if (!sdesc) return NULL; diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index 0f42a3c30bdb..d9547017f3bd 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -241,7 +241,7 @@ static struct st_fdma_desc *st_fdma_alloc_desc(struct st_fdma_chan *fchan, struct st_fdma_desc *fdesc; int i; - fdesc = kzalloc(struct_size(fdesc, node, sg_len), GFP_NOWAIT); + fdesc = kzalloc_flex(*fdesc, node, sg_len, GFP_NOWAIT); if (!fdesc) return NULL; diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index e67e0d66e6e8..9b803c0aec25 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2529,7 +2529,7 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, struct scatterlist *sg; int i; - sg = kcalloc(periods + 1, sizeof(struct scatterlist), GFP_NOWAIT); + sg = kzalloc_objs(struct scatterlist, periods + 1, GFP_NOWAIT); if (!sg) return NULL; diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c index 04389936c8a6..d3ad78562a14 100644 --- a/drivers/dma/stm32/stm32-dma.c +++ b/drivers/dma/stm32/stm32-dma.c @@ -1101,7 +1101,7 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_slave_sg( return NULL; } - desc = kzalloc(struct_size(desc, sg_req, sg_len), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg_req, sg_len, GFP_NOWAIT); if (!desc) return NULL; desc->num_sgs = sg_len; @@ -1213,7 +1213,7 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_dma_cyclic( num_periods = buf_len / period_len; - desc = kzalloc(struct_size(desc, sg_req, num_periods), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg_req, num_periods, GFP_NOWAIT); if (!desc) return NULL; desc->num_sgs = num_periods; @@ -1250,7 +1250,7 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_dma_memcpy( int dma_burst, i; num_sgs = DIV_ROUND_UP(len, STM32_DMA_ALIGNED_MAX_DATA_ITEMS); - desc = kzalloc(struct_size(desc, sg_req, num_sgs), GFP_NOWAIT); + desc = kzalloc_flex(*desc, sg_req, num_sgs, GFP_NOWAIT); if (!desc) return NULL; desc->num_sgs = num_sgs; diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c index 84b00c436134..4724e7fa0008 100644 --- a/drivers/dma/stm32/stm32-dma3.c +++ b/drivers/dma/stm32/stm32-dma3.c @@ -415,7 +415,7 @@ static struct stm32_dma3_swdesc *stm32_dma3_chan_desc_alloc(struct stm32_dma3_ch return NULL; } - swdesc = kzalloc(struct_size(swdesc, lli, count), GFP_NOWAIT); + swdesc = kzalloc_flex(*swdesc, lli, count, GFP_NOWAIT); if (!swdesc) return NULL; swdesc->lli_size = count; diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c index db13498b9c9f..4abd5ba32969 100644 --- a/drivers/dma/stm32/stm32-dmamux.c +++ b/drivers/dma/stm32/stm32-dmamux.c @@ -104,7 +104,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec, goto err_put_pdev; } - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) { ret = -ENOMEM; goto err_put_pdev; diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c index b87d41b234df..e3bbdc9ee36e 100644 --- a/drivers/dma/stm32/stm32-mdma.c +++ b/drivers/dma/stm32/stm32-mdma.c @@ -318,7 +318,7 @@ static struct stm32_mdma_desc *stm32_mdma_alloc_desc( struct stm32_mdma_desc *desc; int i; - desc = kzalloc(struct_size(desc, node, count), GFP_NOWAIT); + desc = kzalloc_flex(*desc, node, count, GFP_NOWAIT); if (!desc) return NULL; desc->count = count; diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c index 00d2fd38d17f..d2321f7287d2 100644 --- a/drivers/dma/sun4i-dma.c +++ b/drivers/dma/sun4i-dma.c @@ -532,7 +532,7 @@ generate_ndma_promise(struct dma_chan *chan, dma_addr_t src, dma_addr_t dest, if (ret) return NULL; - promise = kzalloc(sizeof(*promise), GFP_NOWAIT); + promise = kzalloc_obj(*promise, GFP_NOWAIT); if (!promise) return NULL; @@ -595,7 +595,7 @@ generate_ddma_promise(struct dma_chan *chan, dma_addr_t src, dma_addr_t dest, struct sun4i_dma_promise *promise; int ret; - promise = kzalloc(sizeof(*promise), GFP_NOWAIT); + promise = kzalloc_obj(*promise, GFP_NOWAIT); if (!promise) return NULL; @@ -648,7 +648,7 @@ static struct sun4i_dma_contract *generate_dma_contract(void) { struct sun4i_dma_contract *contract; - contract = kzalloc(sizeof(*contract), GFP_NOWAIT); + contract = kzalloc_obj(*contract, GFP_NOWAIT); if (!contract) return NULL; diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index c33f151953eb..a9a254dbf8cb 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -678,7 +678,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_dma_memcpy( if (!len) return NULL; - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; @@ -736,7 +736,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_slave_sg( return NULL; } - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; @@ -819,7 +819,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_dma_cyclic( return NULL; } - txd = kzalloc(sizeof(*txd), GFP_NOWAIT); + txd = kzalloc_obj(*txd, GFP_NOWAIT); if (!txd) return NULL; diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index 4d6fe0efa76e..5948fbf32c21 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -908,7 +908,7 @@ tegra_dma_prep_dma_memset(struct dma_chan *dc, dma_addr_t dest, int value, /* Set burst size */ mc_seq |= TEGRA_GPCDMA_MCSEQ_BURST_16; - dma_desc = kzalloc(struct_size(dma_desc, sg_req, 1), GFP_NOWAIT); + dma_desc = kzalloc_flex(*dma_desc, sg_req, 1, GFP_NOWAIT); if (!dma_desc) return NULL; @@ -977,7 +977,7 @@ tegra_dma_prep_dma_memcpy(struct dma_chan *dc, dma_addr_t dest, /* Set burst size */ mc_seq |= TEGRA_GPCDMA_MCSEQ_BURST_16; - dma_desc = kzalloc(struct_size(dma_desc, sg_req, 1), GFP_NOWAIT); + dma_desc = kzalloc_flex(*dma_desc, sg_req, 1, GFP_NOWAIT); if (!dma_desc) return NULL; @@ -1070,7 +1070,7 @@ tegra_dma_prep_slave_sg(struct dma_chan *dc, struct scatterlist *sgl, else mc_seq |= TEGRA_GPCDMA_MCSEQ_BURST_2; - dma_desc = kzalloc(struct_size(dma_desc, sg_req, sg_len), GFP_NOWAIT); + dma_desc = kzalloc_flex(*dma_desc, sg_req, sg_len, GFP_NOWAIT); if (!dma_desc) return NULL; @@ -1205,8 +1205,7 @@ tegra_dma_prep_dma_cyclic(struct dma_chan *dc, dma_addr_t buf_addr, size_t buf_l mc_seq |= TEGRA_GPCDMA_MCSEQ_BURST_2; period_count = buf_len / period_len; - dma_desc = kzalloc(struct_size(dma_desc, sg_req, period_count), - GFP_NOWAIT); + dma_desc = kzalloc_flex(*dma_desc, sg_req, period_count, GFP_NOWAIT); if (!dma_desc) return NULL; diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 14a61e53a41b..640b8a218c9a 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -282,7 +282,7 @@ static struct tegra_dma_desc *tegra_dma_desc_get(struct tegra_dma_channel *tdc) spin_unlock_irqrestore(&tdc->lock, flags); /* Allocate DMA desc */ - dma_desc = kzalloc(sizeof(*dma_desc), GFP_NOWAIT); + dma_desc = kzalloc_obj(*dma_desc, GFP_NOWAIT); if (!dma_desc) return NULL; @@ -321,7 +321,7 @@ tegra_dma_sg_req_get(struct tegra_dma_channel *tdc) } spin_unlock_irqrestore(&tdc->lock, flags); - sg_req = kzalloc(sizeof(*sg_req), GFP_NOWAIT); + sg_req = kzalloc_obj(*sg_req, GFP_NOWAIT); return sg_req; } diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index 215bfef37ec6..14e0c408ed1e 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -755,7 +755,7 @@ static struct dma_async_tx_descriptor *tegra_adma_prep_dma_cyclic( return NULL; } - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c index e04077d542d2..cf1ceab10f14 100644 --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -103,7 +103,7 @@ static void *ti_am335x_xbar_route_allocate(struct of_phandle_args *dma_spec, goto out_put_pdev; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { of_node_put(dma_spec->np); map = ERR_PTR(-ENOMEM); @@ -260,7 +260,7 @@ static void *ti_dra7_xbar_route_allocate(struct of_phandle_args *dma_spec, goto out_put_pdev; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { of_node_put(dma_spec->np); map = ERR_PTR(-ENOMEM); @@ -393,7 +393,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev) if (!nelm) return -EINVAL; - rsv_events = kcalloc(nelm, sizeof(*rsv_events), GFP_KERNEL); + rsv_events = kzalloc_objs(*rsv_events, nelm, GFP_KERNEL); if (!rsv_events) return -ENOMEM; diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c index 552be71db6c4..d97db5af3555 100644 --- a/drivers/dma/ti/edma.c +++ b/drivers/dma/ti/edma.c @@ -1041,7 +1041,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( return NULL; } - edesc = kzalloc(struct_size(edesc, pset, sg_len), GFP_ATOMIC); + edesc = kzalloc_flex(*edesc, pset, sg_len, GFP_ATOMIC); if (!edesc) return NULL; @@ -1158,7 +1158,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy( nslots = 2; } - edesc = kzalloc(struct_size(edesc, pset, nslots), GFP_ATOMIC); + edesc = kzalloc_flex(*edesc, pset, nslots, GFP_ATOMIC); if (!edesc) return NULL; @@ -1265,7 +1265,7 @@ edma_prep_dma_interleaved(struct dma_chan *chan, if (src_bidx > SZ_64K || dst_bidx > SZ_64K) return NULL; - edesc = kzalloc(struct_size(edesc, pset, 1), GFP_ATOMIC); + edesc = kzalloc_flex(*edesc, pset, 1, GFP_ATOMIC); if (!edesc) return NULL; @@ -1361,7 +1361,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_cyclic( } } - edesc = kzalloc(struct_size(edesc, pset, nslots), GFP_ATOMIC); + edesc = kzalloc_flex(*edesc, pset, nslots, GFP_ATOMIC); if (!edesc) return NULL; diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index aa2dc762140f..b547b19bc9d8 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -3241,7 +3241,7 @@ udma_prep_slave_sg_pkt(struct udma_chan *uc, struct scatterlist *sgl, unsigned int i; u64 asel; - d = kzalloc(struct_size(d, hwdesc, sglen), GFP_NOWAIT); + d = kzalloc_flex(*d, hwdesc, sglen, GFP_NOWAIT); if (!d) return NULL; @@ -3588,7 +3588,7 @@ udma_prep_dma_cyclic_pkt(struct udma_chan *uc, dma_addr_t buf_addr, if (period_len >= SZ_4M) return NULL; - d = kzalloc(struct_size(d, hwdesc, periods), GFP_NOWAIT); + d = kzalloc_flex(*d, hwdesc, periods, GFP_NOWAIT); if (!d) return NULL; @@ -4686,7 +4686,7 @@ static int udma_setup_resources(struct udma_dev *ud) irq_res.sets += rm_res->sets; } - irq_res.desc = kcalloc(irq_res.sets, sizeof(*irq_res.desc), GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); if (!irq_res.desc) return -ENOMEM; rm_res = tisci_rm->rm_ranges[RM_RANGE_TCHAN]; @@ -4878,7 +4878,7 @@ static int bcdma_setup_resources(struct udma_dev *ud) } } - irq_res.desc = kcalloc(irq_res.sets, sizeof(*irq_res.desc), GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); if (!irq_res.desc) return -ENOMEM; if (ud->bchan_cnt) { @@ -5080,7 +5080,7 @@ static int pktdma_setup_resources(struct udma_dev *ud) irq_res.sets += rm_res->sets; } - irq_res.desc = kcalloc(irq_res.sets, sizeof(*irq_res.desc), GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); if (!irq_res.desc) return -ENOMEM; rm_res = tisci_rm->rm_ranges[RM_RANGE_TFLOW]; diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index 73ed4b794630..70591c2bf92a 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -1002,7 +1002,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( } /* Now allocate and setup the descriptor. */ - d = kzalloc(struct_size(d, sg, sglen), GFP_ATOMIC); + d = kzalloc_flex(*d, sg, sglen, GFP_ATOMIC); if (!d) return NULL; d->sglen = sglen; @@ -1503,7 +1503,7 @@ static int omap_dma_chan_init(struct omap_dmadev *od) { struct omap_chan *c; - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) return -ENOMEM; diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index ecaf002558af..968f8cf19ec0 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -325,7 +325,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan) struct timb_dma_desc *td_desc; int err; - td_desc = kzalloc(sizeof(struct timb_dma_desc), GFP_KERNEL); + td_desc = kzalloc_obj(struct timb_dma_desc, GFP_KERNEL); if (!td_desc) goto out; @@ -635,8 +635,7 @@ static int td_probe(struct platform_device *pdev) DRIVER_NAME)) return -EBUSY; - td = kzalloc(struct_size(td, channels, pdata->nr_channels), - GFP_KERNEL); + td = kzalloc_flex(*td, channels, pdata->nr_channels, GFP_KERNEL); if (!td) { err = -ENOMEM; goto err_release_region; diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 35d5221683b2..05622b68a936 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c @@ -192,7 +192,7 @@ static struct txx9dmac_desc *txx9dmac_desc_alloc(struct txx9dmac_chan *dc, struct txx9dmac_dev *ddev = dc->ddev; struct txx9dmac_desc *desc; - desc = kzalloc(sizeof(*desc), flags); + desc = kzalloc_obj(*desc, flags); if (!desc) return NULL; INIT_LIST_HEAD(&desc->tx_list); diff --git a/drivers/dma/uniphier-mdmac.c b/drivers/dma/uniphier-mdmac.c index 7a99f86ecb5a..a8aa904b88be 100644 --- a/drivers/dma/uniphier-mdmac.c +++ b/drivers/dma/uniphier-mdmac.c @@ -238,7 +238,7 @@ uniphier_mdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (!is_slave_direction(direction)) return NULL; - md = kzalloc(sizeof(*md), GFP_NOWAIT); + md = kzalloc_obj(*md, GFP_NOWAIT); if (!md) return NULL; diff --git a/drivers/dma/uniphier-xdmac.c b/drivers/dma/uniphier-xdmac.c index ceeb6171c9d1..120c0d4f12dd 100644 --- a/drivers/dma/uniphier-xdmac.c +++ b/drivers/dma/uniphier-xdmac.c @@ -292,7 +292,7 @@ uniphier_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, nr = 1 + len / XDMAC_MAX_WORD_SIZE; - xd = kzalloc(struct_size(xd, nodes, nr), GFP_NOWAIT); + xd = kzalloc_flex(*xd, nodes, nr, GFP_NOWAIT); if (!xd) return NULL; xd->nr_node = nr; @@ -348,7 +348,7 @@ uniphier_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, return NULL; } - xd = kzalloc(struct_size(xd, nodes, sg_len), GFP_NOWAIT); + xd = kzalloc_flex(*xd, nodes, sg_len, GFP_NOWAIT); if (!xd) return NULL; xd->nr_node = sg_len; diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index 118199a04902..d02a4dac2291 100644 --- a/drivers/dma/xilinx/xdma.c +++ b/drivers/dma/xilinx/xdma.c @@ -275,7 +275,7 @@ xdma_alloc_desc(struct xdma_chan *chan, u32 desc_num, bool cyclic) void *addr; int i, j; - sw_desc = kzalloc(sizeof(*sw_desc), GFP_NOWAIT); + sw_desc = kzalloc_obj(*sw_desc, GFP_NOWAIT); if (!sw_desc) return NULL; @@ -284,8 +284,8 @@ xdma_alloc_desc(struct xdma_chan *chan, u32 desc_num, bool cyclic) sw_desc->cyclic = cyclic; sw_desc->error = false; dblk_num = DIV_ROUND_UP(desc_num, XDMA_DESC_ADJACENT); - sw_desc->desc_blocks = kcalloc(dblk_num, sizeof(*sw_desc->desc_blocks), - GFP_NOWAIT); + sw_desc->desc_blocks = kzalloc_objs(*sw_desc->desc_blocks, dblk_num, + GFP_NOWAIT); if (!sw_desc->desc_blocks) goto failed; diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 53229d8ebc52..b53292e02448 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -836,7 +836,7 @@ xilinx_dma_alloc_tx_descriptor(struct xilinx_dma_chan *chan) { struct xilinx_dma_tx_descriptor *desc; - desc = kzalloc(sizeof(*desc), GFP_NOWAIT); + desc = kzalloc_obj(*desc, GFP_NOWAIT); if (!desc) return NULL; diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index ee5d9fdbfd7f..d9a3542c4531 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -635,7 +635,7 @@ xilinx_dpdma_chan_alloc_tx_desc(struct xilinx_dpdma_chan *chan) { struct xilinx_dpdma_tx_desc *tx_desc; - tx_desc = kzalloc(sizeof(*tx_desc), GFP_NOWAIT); + tx_desc = kzalloc_obj(*tx_desc, GFP_NOWAIT); if (!tx_desc) return NULL; diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index 7bb3716e60da..b9133f4fc3f9 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -482,8 +482,8 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan) if (ret < 0) return ret; - chan->sw_desc_pool = kcalloc(ZYNQMP_DMA_NUM_DESCS, sizeof(*desc), - GFP_KERNEL); + chan->sw_desc_pool = kzalloc_objs(*desc, ZYNQMP_DMA_NUM_DESCS, + GFP_KERNEL); if (!chan->sw_desc_pool) return -ENOMEM; diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 627a5b39a0ef..cd41fbedd9fe 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -205,7 +205,7 @@ dpll_xa_ref_pin_add(struct xarray *xa_pins, struct dpll_pin *pin, } if (!ref_exists) { - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) return -ENOMEM; ref->pin = pin; @@ -218,7 +218,7 @@ dpll_xa_ref_pin_add(struct xarray *xa_pins, struct dpll_pin *pin, refcount_set(&ref->refcount, 1); } - reg = kzalloc(sizeof(*reg), GFP_KERNEL); + reg = kzalloc_obj(*reg, GFP_KERNEL); if (!reg) { if (!ref_exists) { xa_erase(xa_pins, pin->pin_idx); @@ -286,7 +286,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll, } if (!ref_exists) { - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) return -ENOMEM; ref->dpll = dpll; @@ -299,7 +299,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll, refcount_set(&ref->refcount, 1); } - reg = kzalloc(sizeof(*reg), GFP_KERNEL); + reg = kzalloc_obj(*reg, GFP_KERNEL); if (!reg) { if (!ref_exists) { xa_erase(xa_dplls, dpll->id); @@ -360,7 +360,7 @@ dpll_device_alloc(const u64 clock_id, u32 device_idx, struct module *module) struct dpll_device *dpll; int ret; - dpll = kzalloc(sizeof(*dpll), GFP_KERNEL); + dpll = kzalloc_obj(*dpll, GFP_KERNEL); if (!dpll) return ERR_PTR(-ENOMEM); refcount_set(&dpll->refcount, 1); @@ -490,7 +490,7 @@ int dpll_device_register(struct dpll_device *dpll, enum dpll_type type, return -EEXIST; } - reg = kzalloc(sizeof(*reg), GFP_KERNEL); + reg = kzalloc_obj(*reg, GFP_KERNEL); if (!reg) { mutex_unlock(&dpll_lock); return -ENOMEM; @@ -644,7 +644,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module, } else if (pin_idx > INT_MAX) { return ERR_PTR(-EINVAL); } - pin = kzalloc(sizeof(*pin), GFP_KERNEL); + pin = kzalloc_obj(*pin, GFP_KERNEL); if (!pin) { ret = -ENOMEM; goto err_pin_alloc; diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c index 78edc36b17fb..e532fedf0d36 100644 --- a/drivers/dpll/zl3073x/dpll.c +++ b/drivers/dpll/zl3073x/dpll.c @@ -1372,7 +1372,7 @@ zl3073x_dpll_pin_alloc(struct zl3073x_dpll *zldpll, enum dpll_pin_direction dir, { struct zl3073x_dpll_pin *pin; - pin = kzalloc(sizeof(*pin), GFP_KERNEL); + pin = kzalloc_obj(*pin, GFP_KERNEL); if (!pin) return ERR_PTR(-ENOMEM); @@ -1944,7 +1944,7 @@ zl3073x_dpll_alloc(struct zl3073x_dev *zldev, u8 ch) { struct zl3073x_dpll *zldpll; - zldpll = kzalloc(sizeof(*zldpll), GFP_KERNEL); + zldpll = kzalloc_obj(*zldpll, GFP_KERNEL); if (!zldpll) return ERR_PTR(-ENOMEM); diff --git a/drivers/dpll/zl3073x/fw.c b/drivers/dpll/zl3073x/fw.c index 55b638247f4b..56b4eeadf4e3 100644 --- a/drivers/dpll/zl3073x/fw.c +++ b/drivers/dpll/zl3073x/fw.c @@ -129,7 +129,7 @@ zl3073x_fw_component_alloc(size_t size) { struct zl3073x_fw_component *comp; - comp = kzalloc(sizeof(*comp), GFP_KERNEL); + comp = kzalloc_obj(*comp, GFP_KERNEL); if (!comp) return NULL; @@ -313,7 +313,7 @@ struct zl3073x_fw *zl3073x_fw_load(struct zl3073x_dev *zldev, const char *data, ssize_t rc; /* Allocate firmware structure */ - fw = kzalloc(sizeof(*fw), GFP_KERNEL); + fw = kzalloc_obj(*fw, GFP_KERNEL); if (!fw) return ERR_PTR(-ENOMEM); diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c index 8523dc8c226e..36b843f17156 100644 --- a/drivers/dpll/zl3073x/prop.c +++ b/drivers/dpll/zl3073x/prop.c @@ -198,7 +198,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, const char *type; u32 curr_freq; - props = kzalloc(sizeof(*props), GFP_KERNEL); + props = kzalloc_obj(*props, GFP_KERNEL); if (!props) return ERR_PTR(-ENOMEM); @@ -289,7 +289,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, skip_fwnode_props: /* Allocate frequency ranges list - extra slot for current frequency */ - ranges = kcalloc(num_freqs + 1, sizeof(*ranges), GFP_KERNEL); + ranges = kzalloc_objs(*ranges, num_freqs + 1, GFP_KERNEL); if (!ranges) { rc = -ENOMEM; goto err_alloc_ranges; diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 63fca0ee2c23..183357b9f99a 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3485,7 +3485,7 @@ static int dct_hw_info_get(struct amd64_pvt *pvt) static int umc_hw_info_get(struct amd64_pvt *pvt) { - pvt->umc = kcalloc(pvt->max_mcs, sizeof(struct amd64_umc), GFP_KERNEL); + pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs, GFP_KERNEL); if (!pvt->umc) return -ENOMEM; @@ -3716,7 +3716,7 @@ static int gpu_hw_info_get(struct amd64_pvt *pvt) if (ret) return ret; - pvt->umc = kcalloc(pvt->max_mcs, sizeof(struct amd64_umc), GFP_KERNEL); + pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs, GFP_KERNEL); if (!pvt->umc) return -ENOMEM; @@ -3916,7 +3916,7 @@ static int per_family_init(struct amd64_pvt *pvt) scnprintf(pvt->ctl_name, sizeof(pvt->ctl_name), "F%02Xh_M%02Xh", pvt->fam, pvt->model); - pvt->csels = kcalloc(pvt->max_mcs, sizeof(*pvt->csels), GFP_KERNEL); + pvt->csels = kzalloc_objs(*pvt->csels, pvt->max_mcs, GFP_KERNEL); if (!pvt->csels) return -ENOMEM; @@ -4000,13 +4000,13 @@ static int probe_one_instance(unsigned int nid) int ret; ret = -ENOMEM; - s = kzalloc(sizeof(struct ecc_settings), GFP_KERNEL); + s = kzalloc_obj(struct ecc_settings, GFP_KERNEL); if (!s) goto err_out; ecc_stngs[nid] = s; - pvt = kzalloc(sizeof(struct amd64_pvt), GFP_KERNEL); + pvt = kzalloc_obj(struct amd64_pvt, GFP_KERNEL); if (!pvt) goto err_settings; @@ -4146,7 +4146,7 @@ static int __init amd64_edac_init(void) opstate_init(); err = -ENOMEM; - ecc_stngs = kcalloc(amd_nb_num(), sizeof(ecc_stngs[0]), GFP_KERNEL); + ecc_stngs = kzalloc_objs(ecc_stngs[0], amd_nb_num(), GFP_KERNEL); if (!ecc_stngs) goto err_free; diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 0734909b08a4..6bb6e4d435a4 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -67,17 +67,19 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance edac_dbg(4, "instances=%d blocks=%d\n", nr_instances, nr_blocks); - dev_ctl = kzalloc(sizeof(struct edac_device_ctl_info), GFP_KERNEL); + dev_ctl = kzalloc_obj(struct edac_device_ctl_info, GFP_KERNEL); if (!dev_ctl) return NULL; - dev_inst = kcalloc(nr_instances, sizeof(struct edac_device_instance), GFP_KERNEL); + dev_inst = kzalloc_objs(struct edac_device_instance, nr_instances, + GFP_KERNEL); if (!dev_inst) goto free; dev_ctl->instances = dev_inst; - dev_blk = kcalloc(nr_instances * nr_blocks, sizeof(struct edac_device_block), GFP_KERNEL); + dev_blk = kzalloc_objs(struct edac_device_block, + nr_instances * nr_blocks, GFP_KERNEL); if (!dev_blk) goto free; @@ -642,22 +644,24 @@ int edac_dev_register(struct device *parent, char *name, } } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; - ras_attr_groups = kcalloc(attr_gcnt + 1, sizeof(*ras_attr_groups), GFP_KERNEL); + ras_attr_groups = kzalloc_objs(*ras_attr_groups, attr_gcnt + 1, + GFP_KERNEL); if (!ras_attr_groups) goto ctx_free; if (scrub_cnt) { - ctx->scrub = kcalloc(scrub_cnt, sizeof(*ctx->scrub), GFP_KERNEL); + ctx->scrub = kzalloc_objs(*ctx->scrub, scrub_cnt, GFP_KERNEL); if (!ctx->scrub) goto groups_free; } if (mem_repair_cnt) { - ctx->mem_repair = kcalloc(mem_repair_cnt, sizeof(*ctx->mem_repair), GFP_KERNEL); + ctx->mem_repair = kzalloc_objs(*ctx->mem_repair, mem_repair_cnt, + GFP_KERNEL); if (!ctx->mem_repair) goto data_mem_free; } diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 0959320fe51c..2d74438837f4 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -216,14 +216,14 @@ static int edac_mc_alloc_csrows(struct mem_ctl_info *mci) /* * Allocate and fill the csrow/channels structs */ - mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL); + mci->csrows = kzalloc_objs(*mci->csrows, tot_csrows, GFP_KERNEL); if (!mci->csrows) return -ENOMEM; for (row = 0; row < tot_csrows; row++) { struct csrow_info *csr; - csr = kzalloc(sizeof(**mci->csrows), GFP_KERNEL); + csr = kzalloc_obj(**mci->csrows, GFP_KERNEL); if (!csr) return -ENOMEM; @@ -231,15 +231,15 @@ static int edac_mc_alloc_csrows(struct mem_ctl_info *mci) csr->csrow_idx = row; csr->mci = mci; csr->nr_channels = tot_channels; - csr->channels = kcalloc(tot_channels, sizeof(*csr->channels), - GFP_KERNEL); + csr->channels = kzalloc_objs(*csr->channels, tot_channels, + GFP_KERNEL); if (!csr->channels) return -ENOMEM; for (chn = 0; chn < tot_channels; chn++) { struct rank_info *chan; - chan = kzalloc(sizeof(**csr->channels), GFP_KERNEL); + chan = kzalloc_obj(**csr->channels, GFP_KERNEL); if (!chan) return -ENOMEM; @@ -262,7 +262,7 @@ static int edac_mc_alloc_dimms(struct mem_ctl_info *mci) /* * Allocate and fill the dimm structs */ - mci->dimms = kcalloc(mci->tot_dimms, sizeof(*mci->dimms), GFP_KERNEL); + mci->dimms = kzalloc_objs(*mci->dimms, mci->tot_dimms, GFP_KERNEL); if (!mci->dimms) return -ENOMEM; @@ -276,7 +276,7 @@ static int edac_mc_alloc_dimms(struct mem_ctl_info *mci) chan = mci->csrows[row]->channels[chn]; - dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL); + dimm = kzalloc_obj(**mci->dimms, GFP_KERNEL); if (!dimm) return -ENOMEM; mci->dimms[idx] = dimm; @@ -362,11 +362,11 @@ struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num, per_rank = true; } - mci = kzalloc(sizeof(struct mem_ctl_info), GFP_KERNEL); + mci = kzalloc_obj(struct mem_ctl_info, GFP_KERNEL); if (!mci) return NULL; - mci->layers = kcalloc(n_layers, sizeof(struct edac_mc_layer), GFP_KERNEL); + mci->layers = kzalloc_objs(struct edac_mc_layer, n_layers, GFP_KERNEL); if (!mci->layers) goto error; diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 091cc6aae8a9..629158cd505c 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -648,7 +648,7 @@ int __init edac_mc_sysfs_init(void) { int err; - mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL); + mci_pdev = kzalloc_obj(*mci_pdev, GFP_KERNEL); if (!mci_pdev) return -ENOMEM; diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 64c142aecca7..c1c9dc6ffa2f 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c @@ -32,7 +32,7 @@ struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, edac_dbg(1, "\n"); - pci = kzalloc(sizeof(struct edac_pci_ctl_info), GFP_KERNEL); + pci = kzalloc_obj(struct edac_pci_ctl_info, GFP_KERNEL); if (!pci) return NULL; diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index 7b44afcf48db..f1b0f3ba7f72 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c @@ -361,7 +361,7 @@ static int edac_pci_main_kobj_setup(void) goto decrement_count_fail; } - edac_pci_top_main_kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + edac_pci_top_main_kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!edac_pci_top_main_kobj) { edac_dbg(1, "Failed to allocate\n"); err = -ENOMEM; diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 91e0a88ef904..dd1a5e575230 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -455,12 +455,12 @@ static struct i7core_dev *alloc_i7core_dev(u8 socket, { struct i7core_dev *i7core_dev; - i7core_dev = kzalloc(sizeof(*i7core_dev), GFP_KERNEL); + i7core_dev = kzalloc_obj(*i7core_dev, GFP_KERNEL); if (!i7core_dev) return NULL; - i7core_dev->pdev = kcalloc(table->n_devs, sizeof(*i7core_dev->pdev), - GFP_KERNEL); + i7core_dev->pdev = kzalloc_objs(*i7core_dev->pdev, table->n_devs, + GFP_KERNEL); if (!i7core_dev->pdev) { kfree(i7core_dev); return NULL; @@ -1159,7 +1159,7 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) struct i7core_pvt *pvt = mci->pvt_info; int rc; - pvt->addrmatch_dev = kzalloc(sizeof(*pvt->addrmatch_dev), GFP_KERNEL); + pvt->addrmatch_dev = kzalloc_obj(*pvt->addrmatch_dev, GFP_KERNEL); if (!pvt->addrmatch_dev) return -ENOMEM; @@ -1177,8 +1177,8 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) goto err_put_addrmatch; if (!pvt->is_registered) { - pvt->chancounts_dev = kzalloc(sizeof(*pvt->chancounts_dev), - GFP_KERNEL); + pvt->chancounts_dev = kzalloc_obj(*pvt->chancounts_dev, + GFP_KERNEL); if (!pvt->chancounts_dev) { rc = -ENOMEM; goto err_del_addrmatch; diff --git a/drivers/edac/igen6_edac.c b/drivers/edac/igen6_edac.c index 045c20179cd3..fa1cabfe6909 100644 --- a/drivers/edac/igen6_edac.c +++ b/drivers/edac/igen6_edac.c @@ -1549,7 +1549,7 @@ static int igen6_probe(struct pci_dev *pdev, const struct pci_device_id *ent) edac_dbg(2, "\n"); - igen6_pvt = kzalloc(sizeof(*igen6_pvt), GFP_KERNEL); + igen6_pvt = kzalloc_obj(*igen6_pvt, GFP_KERNEL); if (!igen6_pvt) return -ENOMEM; diff --git a/drivers/edac/imh_base.c b/drivers/edac/imh_base.c index 4348b3883b45..a37be2372764 100644 --- a/drivers/edac/imh_base.c +++ b/drivers/edac/imh_base.c @@ -171,7 +171,7 @@ static int __get_ddr_munits(struct res_config *cfg, struct skx_dev *d, d->imc[lmc].lmc = lmc; /* Create the imc device instance. */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -257,7 +257,7 @@ static int imh_get_all_mmio_base_h(struct res_config *cfg, struct list_head *eda struct skx_dev *d; for (i = 0; i < n; i++) { - d = kzalloc(struct_size(d, imc, imc_num), GFP_KERNEL); + d = kzalloc_flex(*d, imc, imc_num, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index d5f12219598a..79fc3ace6a10 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -771,13 +771,12 @@ static struct sbridge_dev *alloc_sbridge_dev(int seg, u8 bus, enum domain dom, { struct sbridge_dev *sbridge_dev; - sbridge_dev = kzalloc(sizeof(*sbridge_dev), GFP_KERNEL); + sbridge_dev = kzalloc_obj(*sbridge_dev, GFP_KERNEL); if (!sbridge_dev) return NULL; - sbridge_dev->pdev = kcalloc(table->n_devs_per_imc, - sizeof(*sbridge_dev->pdev), - GFP_KERNEL); + sbridge_dev->pdev = kzalloc_objs(*sbridge_dev->pdev, + table->n_devs_per_imc, GFP_KERNEL); if (!sbridge_dev->pdev) { kfree(sbridge_dev); return NULL; diff --git a/drivers/edac/skx_common.c b/drivers/edac/skx_common.c index 3276afe43922..709c939e5919 100644 --- a/drivers/edac/skx_common.c +++ b/drivers/edac/skx_common.c @@ -346,7 +346,7 @@ int skx_get_all_bus_mappings(struct res_config *cfg, struct list_head **list) if (!pdev) break; ndev++; - d = kzalloc(struct_size(d, imc, imc_num), GFP_KERNEL); + d = kzalloc_flex(*d, imc, imc_num, GFP_KERNEL); if (!d) { pci_dev_put(pdev); return -ENOMEM; diff --git a/drivers/edac/versalnet_edac.c b/drivers/edac/versalnet_edac.c index 1a1092793092..3cc885fa384c 100644 --- a/drivers/edac/versalnet_edac.c +++ b/drivers/edac/versalnet_edac.c @@ -559,7 +559,7 @@ static int setup_mcdi(struct mc_priv *mc_priv) struct cdx_mcdi *amd_mcdi; int ret, i; - amd_mcdi = kzalloc(sizeof(*amd_mcdi), GFP_KERNEL); + amd_mcdi = kzalloc_obj(*amd_mcdi, GFP_KERNEL); if (!amd_mcdi) return -ENOMEM; @@ -812,7 +812,7 @@ static int init_versalnet(struct mc_priv *priv, struct platform_device *pdev) priv->mci[i] = mci; priv->dwidth = dt; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); dev->release = versal_edac_release; name = kmalloc(32, GFP_KERNEL); sprintf(name, "versal-net-ddrmc5-edac-%d", i); diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c index bd76d599109c..ffabe1bf4c13 100644 --- a/drivers/eisa/eisa-bus.c +++ b/drivers/eisa/eisa-bus.c @@ -317,7 +317,7 @@ static int __init eisa_probe(struct eisa_root_device *root) /* First try to get hold of slot 0. If there is no device * here, simply fail, unless root->force_probe is set. */ - edev = kzalloc(sizeof(*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); if (!edev) return -ENOMEM; @@ -350,7 +350,7 @@ static int __init eisa_probe(struct eisa_root_device *root) force_probe: for (c = 0, i = 1; i <= root->slots; i++) { - edev = kzalloc(sizeof(*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); if (!edev) { dev_err(root->dev, "EISA: Out of memory for slot %d\n", i); diff --git a/drivers/extcon/extcon-usbc-cros-ec.c b/drivers/extcon/extcon-usbc-cros-ec.c index 1fb627ea8b50..cf30d54fb418 100644 --- a/drivers/extcon/extcon-usbc-cros-ec.c +++ b/drivers/extcon/extcon-usbc-cros-ec.c @@ -68,7 +68,7 @@ static int cros_ec_pd_command(struct cros_ec_extcon_info *info, struct cros_ec_command *msg; int ret; - msg = kzalloc(struct_size(msg, data, max(outsize, insize)), GFP_KERNEL); + msg = kzalloc_flex(*msg, data, max(outsize, insize), GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index e7f55c021e56..8fc412ad3cf2 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1060,7 +1060,7 @@ struct extcon_dev *extcon_dev_allocate(const unsigned int *supported_cable) if (!supported_cable) return ERR_PTR(-EINVAL); - edev = kzalloc(sizeof(*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); if (!edev) return ERR_PTR(-ENOMEM); @@ -1098,8 +1098,8 @@ static int extcon_alloc_cables(struct extcon_dev *edev) if (!edev->max_supported) return 0; - edev->cables = kcalloc(edev->max_supported, sizeof(*edev->cables), - GFP_KERNEL); + edev->cables = kzalloc_objs(*edev->cables, edev->max_supported, + GFP_KERNEL); if (!edev->cables) return -ENOMEM; @@ -1160,13 +1160,13 @@ static int extcon_alloc_muex(struct extcon_dev *edev) for (index = 0; edev->mutually_exclusive[index]; index++) ; - edev->attrs_muex = kcalloc(index + 1, sizeof(*edev->attrs_muex), - GFP_KERNEL); + edev->attrs_muex = kzalloc_objs(*edev->attrs_muex, index + 1, + GFP_KERNEL); if (!edev->attrs_muex) return -ENOMEM; - edev->d_attrs_muex = kcalloc(index, sizeof(*edev->d_attrs_muex), - GFP_KERNEL); + edev->d_attrs_muex = kzalloc_objs(*edev->d_attrs_muex, index, + GFP_KERNEL); if (!edev->d_attrs_muex) { kfree(edev->attrs_muex); return -ENOMEM; @@ -1210,9 +1210,9 @@ static int extcon_alloc_groups(struct extcon_dev *edev) if (!edev->max_supported) return 0; - edev->extcon_dev_type.groups = kcalloc(edev->max_supported + 2, - sizeof(*edev->extcon_dev_type.groups), - GFP_KERNEL); + edev->extcon_dev_type.groups = kzalloc_objs(*edev->extcon_dev_type.groups, + edev->max_supported + 2, + GFP_KERNEL); if (!edev->extcon_dev_type.groups) return -ENOMEM; @@ -1294,8 +1294,8 @@ int extcon_dev_register(struct extcon_dev *edev) spin_lock_init(&edev->lock); if (edev->max_supported) { - edev->nh = kcalloc(edev->max_supported, sizeof(*edev->nh), - GFP_KERNEL); + edev->nh = kzalloc_objs(*edev->nh, edev->max_supported, + GFP_KERNEL); if (!edev->nh) { ret = -ENOMEM; goto err_alloc_nh; diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 9e964fdd175c..6d1a59e33d2e 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -291,7 +291,7 @@ static int fw_device_op_open(struct inode *inode, struct file *file) return -ENODEV; } - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (client == NULL) { fw_device_put(device); return -ENOMEM; @@ -412,7 +412,7 @@ static void queue_bus_reset_event(struct client *client) struct client_resource *resource; unsigned long index; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (e == NULL) return; @@ -745,8 +745,8 @@ static void handle_request(struct fw_card *card, struct fw_request *request, if (is_fcp) fw_request_get(request); - r = kmalloc(sizeof(*r), GFP_ATOMIC); - e = kmalloc(sizeof(*e), GFP_ATOMIC); + r = kmalloc_obj(*r, GFP_ATOMIC); + e = kmalloc_obj(*e, GFP_ATOMIC); if (r == NULL || e == NULL) goto failed; @@ -837,7 +837,7 @@ static int ioctl_allocate(struct client *client, union ioctl_arg *arg) struct fw_address_region region; int ret; - r = kmalloc(sizeof(*r), GFP_KERNEL); + r = kmalloc_obj(*r, GFP_KERNEL); if (r == NULL) return -ENOMEM; @@ -941,7 +941,7 @@ static int ioctl_add_descriptor(struct client *client, union ioctl_arg *arg) if (a->length > 256) return -EINVAL; - r = kmalloc(struct_size(r, data, a->length), GFP_KERNEL); + r = kmalloc_flex(*r, data, a->length, GFP_KERNEL); if (r == NULL) return -ENOMEM; @@ -1006,7 +1006,7 @@ static void iso_mc_callback(struct fw_iso_context *context, struct client *client = data; struct iso_interrupt_mc_event *e; - e = kmalloc(sizeof(*e), GFP_KERNEL); + e = kmalloc_obj(*e, GFP_KERNEL); if (e == NULL) return; @@ -1409,9 +1409,9 @@ static int init_iso_resource(struct client *client, request->bandwidth > BANDWIDTH_AVAILABLE_INITIAL) return -EINVAL; - r = kmalloc(sizeof(*r), GFP_KERNEL); - e1 = kmalloc(sizeof(*e1), GFP_KERNEL); - e2 = kmalloc(sizeof(*e2), GFP_KERNEL); + r = kmalloc_obj(*r, GFP_KERNEL); + e1 = kmalloc_obj(*e1, GFP_KERNEL); + e2 = kmalloc_obj(*e2, GFP_KERNEL); if (r == NULL || e1 == NULL || e2 == NULL) { ret = -ENOMEM; goto fail; diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 9b0080397154..3281f6c6bedb 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -849,7 +849,7 @@ static void create_units(struct fw_device *device) * Get the address of the unit directory and try to * match the drivers id_tables against it. */ - unit = kzalloc(sizeof(*unit), GFP_KERNEL); + unit = kzalloc_obj(*unit, GFP_KERNEL); if (unit == NULL) continue; @@ -1339,7 +1339,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event) * without actually having a link. */ create: - device = kzalloc(sizeof(*device), GFP_ATOMIC); + device = kzalloc_obj(*device, GFP_ATOMIC); if (device == NULL) break; diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 3190b2ca1298..21c61405f794 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -30,7 +30,9 @@ int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count) { - struct page **page_array __free(kfree) = kcalloc(page_count, sizeof(page_array[0]), GFP_KERNEL); + struct page **page_array __free(kfree) = kzalloc_objs(page_array[0], + page_count, + GFP_KERNEL); if (!page_array) return -ENOMEM; @@ -55,8 +57,9 @@ int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count) int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card, enum dma_data_direction direction) { - dma_addr_t *dma_addrs __free(kfree) = kcalloc(buffer->page_count, sizeof(dma_addrs[0]), - GFP_KERNEL); + dma_addr_t *dma_addrs __free(kfree) = kzalloc_objs(dma_addrs[0], + buffer->page_count, + GFP_KERNEL); int i; if (!dma_addrs) diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index ed3ae8cdb0cd..bb2d2db30795 100644 --- a/drivers/firewire/core-topology.c +++ b/drivers/firewire/core-topology.c @@ -27,7 +27,7 @@ static struct fw_node *fw_node_create(u32 sid, int port_count, int color) { struct fw_node *node; - node = kzalloc(struct_size(node, ports, port_count), GFP_ATOMIC); + node = kzalloc_flex(*node, ports, port_count, GFP_ATOMIC); if (node == NULL) return NULL; diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 6d6446713539..b9f01e871fe3 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -338,7 +338,7 @@ static struct fwnet_fragment_info *fwnet_frag_new( } } - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) return NULL; @@ -356,7 +356,7 @@ static struct fwnet_partial_datagram *fwnet_pd_new(struct net_device *net, struct fwnet_partial_datagram *new; struct fwnet_fragment_info *fi; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) goto fail; @@ -1402,7 +1402,7 @@ static int fwnet_add_peer(struct fwnet_device *dev, { struct fwnet_peer *peer; - peer = kmalloc(sizeof(*peer), GFP_KERNEL); + peer = kmalloc_obj(*peer, GFP_KERNEL); if (!peer) return -ENOMEM; diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index e59053738a43..547d560f353f 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c @@ -281,7 +281,7 @@ nosy_open(struct inode *inode, struct file *file) if (lynx == NULL) return -ENODEV; - client = kmalloc(sizeof *client, GFP_KERNEL); + client = kmalloc_obj(*client, GFP_KERNEL); if (client == NULL) goto fail; @@ -545,7 +545,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) } pci_set_master(dev); - lynx = kzalloc(sizeof *lynx, GFP_KERNEL); + lynx = kzalloc_obj(*lynx, GFP_KERNEL); if (lynx == NULL) { dev_err(&dev->dev, "Failed to allocate control structure\n"); ret = -ENOMEM; diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index bb1a510b6423..89e0873501f5 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -558,7 +558,7 @@ static int sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, if (function == SBP2_LOGOUT_REQUEST && fw_device_is_shutdown(device)) return 0; - orb = kzalloc(sizeof(*orb), GFP_NOIO); + orb = kzalloc_obj(*orb, GFP_NOIO); if (orb == NULL) return -ENOMEM; @@ -667,7 +667,7 @@ static void sbp2_agent_reset_no_wait(struct sbp2_logical_unit *lu) struct fw_transaction *t; static __be32 d; - t = kmalloc(sizeof(*t), GFP_ATOMIC); + t = kmalloc_obj(*t, GFP_ATOMIC); if (t == NULL) return; @@ -966,7 +966,7 @@ static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) { struct sbp2_logical_unit *lu; - lu = kmalloc(sizeof(*lu), GFP_KERNEL); + lu = kmalloc_obj(*lu, GFP_KERNEL); if (!lu) return -ENOMEM; @@ -1449,7 +1449,7 @@ static enum scsi_qc_status sbp2_scsi_queuecommand(struct Scsi_Host *shost, struct sbp2_command_orb *orb; int generation; - orb = kzalloc(sizeof(*orb), GFP_ATOMIC); + orb = kzalloc_obj(*orb, GFP_ATOMIC); if (orb == NULL) return SCSI_MLQUEUE_HOST_BUSY; diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index 50bfe56c755e..fbd9af875a69 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -203,7 +203,7 @@ ffa_device_register(const struct ffa_partition_info *part_info, if (id < 0) return NULL; - ffa_dev = kzalloc(sizeof(*ffa_dev), GFP_KERNEL); + ffa_dev = kzalloc_obj(*ffa_dev, GFP_KERNEL); if (!ffa_dev) { ida_free(&ffa_bus_id, id); return NULL; diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 8144f6a9f0e9..8962212ad218 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -410,7 +410,7 @@ ffa_partition_probe(const uuid_t *uuid, struct ffa_partition_info **buffer) if (count <= 0) return count; - pbuf = kcalloc(count, sizeof(*pbuf), GFP_KERNEL); + pbuf = kzalloc_objs(*pbuf, count, GFP_KERNEL); if (!pbuf) return -ENOMEM; @@ -1376,7 +1376,7 @@ static int __ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu, if (notify_id >= FFA_MAX_NOTIFICATIONS) return -EINVAL; - cb_info = kzalloc(sizeof(*cb_info), GFP_KERNEL); + cb_info = kzalloc_obj(*cb_info, GFP_KERNEL); if (!cb_info) return -ENOMEM; @@ -1647,7 +1647,7 @@ static int ffa_xa_add_partition_info(struct ffa_device *dev) } } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ret; @@ -1655,7 +1655,7 @@ static int ffa_xa_add_partition_info(struct ffa_device *dev) info->dev = dev; if (!phead) { - phead = kzalloc(sizeof(*phead), GFP_KERNEL); + phead = kzalloc_obj(*phead, GFP_KERNEL); if (!phead) goto free_out; @@ -2039,7 +2039,7 @@ static int __init ffa_init(void) if (ret) return ret; - drv_info = kzalloc(sizeof(*drv_info), GFP_KERNEL); + drv_info = kzalloc_obj(*drv_info, GFP_KERNEL); if (!drv_info) return -ENOMEM; diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index c7698cfaa4e8..49a168c5ff85 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -90,7 +90,7 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table) * No duplicate found for requested id_table, so let's create a new * requested device entry for this new valid request. */ - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) { ret = -ENOMEM; goto out; @@ -103,7 +103,7 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table) * there. */ if (!phead) { - phead = kzalloc(sizeof(*phead), GFP_KERNEL); + phead = kzalloc_obj(*phead, GFP_KERNEL); if (!phead) { kfree(rdev); ret = -ENOMEM; @@ -445,7 +445,7 @@ __scmi_device_create(struct device_node *np, struct device *parent, return NULL; } - scmi_dev = kzalloc(sizeof(*scmi_dev), GFP_KERNEL); + scmi_dev = kzalloc_obj(*scmi_dev, GFP_KERNEL); if (!scmi_dev) return NULL; diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c index dee9f238f6fd..d2a6390cbc5c 100644 --- a/drivers/firmware/arm_scmi/notify.c +++ b/drivers/firmware/arm_scmi/notify.c @@ -897,7 +897,7 @@ scmi_allocate_event_handler(struct scmi_notify_instance *ni, u32 evt_key) { struct scmi_event_handler *hndl; - hndl = kzalloc(sizeof(*hndl), GFP_KERNEL); + hndl = kzalloc_obj(*hndl, GFP_KERNEL); if (!hndl) return NULL; hndl->key = evt_key; diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 73db5492ab44..99a4a70cf117 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -908,7 +908,7 @@ static int scmi_dbg_raw_mode_open(struct inode *inode, struct file *filp) return -ENODEV; raw = inode->i_private; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 87c323de17b9..70a1697a1e6b 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -633,14 +633,14 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain) if (!buf.opp_count) return ERR_PTR(-ENOENT); - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); info->count = buf.opp_count; info->latency = le16_to_cpu(buf.latency) * 1000; /* uS to nS */ - info->opps = kcalloc(info->count, sizeof(*opp), GFP_KERNEL); + info->opps = kzalloc_objs(*opp, info->count, GFP_KERNEL); if (!info->opps) { kfree(info); return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 71e2a9a89f6a..c8d737e754e6 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -205,7 +205,7 @@ static struct sdei_event *sdei_event_create(u32 event_num, lockdep_assert_held(&sdei_events_lock); - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) { err = -ENOMEM; goto fail; @@ -227,7 +227,7 @@ static struct sdei_event *sdei_event_create(u32 event_num, event->type = result; if (event->type == SDEI_EVENT_TYPE_SHARED) { - reg = kzalloc(sizeof(*reg), GFP_KERNEL); + reg = kzalloc_obj(*reg, GFP_KERNEL); if (!reg) { err = -ENOMEM; goto fail; diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c index 9fdb50f3fec6..148d31eea977 100644 --- a/drivers/firmware/cirrus/cs_dsp.c +++ b/drivers/firmware/cirrus/cs_dsp.c @@ -1059,7 +1059,7 @@ static int cs_dsp_create_control(struct cs_dsp *dsp, } } - ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kzalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return -ENOMEM; @@ -1781,7 +1781,7 @@ static struct cs_dsp_alg_region *cs_dsp_create_region(struct cs_dsp *dsp, { struct cs_dsp_alg_region_list_item *item; - item = kzalloc(sizeof(*item), GFP_KERNEL); + item = kzalloc_obj(*item, GFP_KERNEL); if (!item) return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index 08e1552c2f74..dddddfbc479d 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -237,7 +237,7 @@ static int __init dmi_id_init(void) if (ret) return ret; - dmi_dev = kzalloc(sizeof(*dmi_dev), GFP_KERNEL); + dmi_dev = kzalloc_obj(*dmi_dev, GFP_KERNEL); if (!dmi_dev) { ret = -ENOMEM; goto fail_class_unregister; diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index 9cc963b2edc0..4424ad075aff 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -451,7 +451,7 @@ static int dmi_system_event_log(struct dmi_sysfs_entry *entry) { int ret; - entry->child = kzalloc(sizeof(*entry->child), GFP_KERNEL); + entry->child = kzalloc_obj(*entry->child, GFP_KERNEL); if (!entry->child) return -ENOMEM; ret = kobject_init_and_add(entry->child, @@ -586,7 +586,7 @@ static void __init dmi_sysfs_register_handle(const struct dmi_header *dh, return; /* Allocate and register a new entry into the entries set */ - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { *ret = -ENOMEM; return; diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 55dec4eb2c00..631fbd3ea60c 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c @@ -740,7 +740,7 @@ edd_init(void) return -ENOMEM; for (i = 0; i < edd_num_devices(); i++) { - edev = kzalloc(sizeof (*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); if (!edev) { rc = -ENOMEM; goto out; diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c index ea84108035eb..c458852cea76 100644 --- a/drivers/firmware/efi/apple-properties.c +++ b/drivers/firmware/efi/apple-properties.c @@ -146,8 +146,8 @@ static int __init unmarshal_devices(struct properties_header *properties) goto skip_device; } - entry = kcalloc(dev_header->prop_count + 1, sizeof(*entry), - GFP_KERNEL); + entry = kzalloc_objs(*entry, dev_header->prop_count + 1, + GFP_KERNEL); if (!entry) { dev_err(dev, "cannot allocate properties\n"); goto skip_device; diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 53a5336cde5a..35b69e629d6d 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -113,7 +113,7 @@ static int __init arm_enable_runtime_services(void) if (!(md->attribute & EFI_MEMORY_SP)) continue; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (WARN_ON(!res)) break; diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c index 0c17bdd388e1..609637f88acc 100644 --- a/drivers/firmware/efi/capsule-loader.c +++ b/drivers/firmware/efi/capsule-loader.c @@ -282,7 +282,7 @@ static int efi_capsule_open(struct inode *inode, struct file *file) { struct capsule_info *cap_info; - cap_info = kzalloc(sizeof(*cap_info), GFP_KERNEL); + cap_info = kzalloc_obj(*cap_info, GFP_KERNEL); if (!cap_info) return -ENOMEM; @@ -292,7 +292,7 @@ static int efi_capsule_open(struct inode *inode, struct file *file) return -ENOMEM; } - cap_info->phys = kzalloc(sizeof(phys_addr_t), GFP_KERNEL); + cap_info->phys = kzalloc_obj(phys_addr_t, GFP_KERNEL); if (!cap_info->phys) { kfree(cap_info->pages); kfree(cap_info); diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c index 768430293669..dbbff6ade4e3 100644 --- a/drivers/firmware/efi/capsule.c +++ b/drivers/firmware/efi/capsule.c @@ -230,7 +230,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages) count = DIV_ROUND_UP(imagesize, PAGE_SIZE); sg_count = sg_pages_num(count); - sg_pages = kcalloc(sg_count, sizeof(*sg_pages), GFP_KERNEL); + sg_pages = kzalloc_objs(*sg_pages, sg_count, GFP_KERNEL); if (!sg_pages) return -ENOMEM; diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 56e9d73412fa..b2fb92a4bbd1 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -1079,7 +1079,7 @@ static int efi_mem_reserve_iomem(phys_addr_t addr, u64 size) struct resource *res, *parent; int ret; - res = kzalloc(sizeof(struct resource), GFP_ATOMIC); + res = kzalloc_obj(struct resource, GFP_ATOMIC); if (!res) return -ENOMEM; diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 0a7c764dcc61..99268c14e01e 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -47,7 +47,7 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier, if (ret || !data) return NOTIFY_DONE; - wdata = kmalloc_array(MAX_DATA_LEN, sizeof(efi_char16_t), GFP_KERNEL); + wdata = kmalloc_objs(efi_char16_t, MAX_DATA_LEN, GFP_KERNEL); if (!wdata) return NOTIFY_DONE; diff --git a/drivers/firmware/efi/embedded-firmware.c b/drivers/firmware/efi/embedded-firmware.c index b49a09d7e665..e750ef2b57e8 100644 --- a/drivers/firmware/efi/embedded-firmware.c +++ b/drivers/firmware/efi/embedded-firmware.c @@ -64,7 +64,7 @@ static int __init efi_check_md_for_embedded_firmware( pr_info("Found EFI embedded fw '%s'\n", desc->name); - fw = kmalloc(sizeof(*fw), GFP_KERNEL); + fw = kmalloc_obj(*fw, GFP_KERNEL); if (!fw) { memunmap(map); return -ENOMEM; diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index 4bb7b0584bc9..74f38a2df8d7 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -164,7 +164,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num) { struct esre_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c index aedbbd627706..78afd0fa2919 100644 --- a/drivers/firmware/efi/mokvar-table.c +++ b/drivers/firmware/efi/mokvar-table.c @@ -329,7 +329,7 @@ static int __init efi_mokvar_sysfs_init(void) } while (efi_mokvar_entry_next(&mokvar_entry)) { - mokvar_sysfs = kzalloc(sizeof(*mokvar_sysfs), GFP_KERNEL); + mokvar_sysfs = kzalloc_obj(*mokvar_sysfs, GFP_KERNEL); if (!mokvar_sysfs) { err = -ENOMEM; break; diff --git a/drivers/firmware/efi/riscv-runtime.c b/drivers/firmware/efi/riscv-runtime.c index 66f584a228d0..ee799399da62 100644 --- a/drivers/firmware/efi/riscv-runtime.c +++ b/drivers/firmware/efi/riscv-runtime.c @@ -83,7 +83,7 @@ static int __init riscv_enable_runtime_services(void) if (!(md->attribute & EFI_MEMORY_SP)) continue; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (WARN_ON(!res)) break; diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index 77b5f7ac3e20..0e3b00a572b2 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -614,8 +614,8 @@ static long efi_runtime_query_capsulecaps(unsigned long arg) if (qcaps.capsule_count == ULONG_MAX) return -EINVAL; - capsules = kcalloc(qcaps.capsule_count + 1, - sizeof(efi_capsule_header_t), GFP_KERNEL); + capsules = kzalloc_objs(efi_capsule_header_t, qcaps.capsule_count + 1, + GFP_KERNEL); if (!capsules) return -ENOMEM; diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index 0ceccde5a302..a142ce5c7288 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -153,7 +153,7 @@ static struct gsmi_buf *gsmi_buf_alloc(void) { struct gsmi_buf *smibuf; - smibuf = kzalloc(sizeof(*smibuf), GFP_KERNEL); + smibuf = kzalloc_obj(*smibuf, GFP_KERNEL); if (!smibuf) { printk(KERN_ERR "gsmi: out of memory\n"); return NULL; diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c index 339a3f74b247..721dfa756c45 100644 --- a/drivers/firmware/google/vpd.c +++ b/drivers/firmware/google/vpd.c @@ -107,7 +107,7 @@ static int vpd_section_attrib_add(const u8 *key, u32 key_len, if (vpd_section_check_key_name(key, key_len) != VPD_OK) return VPD_OK; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 371f24569b3b..1af5a9ef4474 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -634,7 +634,7 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header, struct pci_dev *pci_dev; int rc = 0; - ibft_kobj = kzalloc(sizeof(*ibft_kobj), GFP_KERNEL); + ibft_kobj = kzalloc_obj(*ibft_kobj, GFP_KERNEL); if (!ibft_kobj) return -ENOMEM; @@ -773,7 +773,7 @@ static int __init ibft_register_kobjects(struct acpi_table_ibft *header) if (rc) return rc; - ibft_kobj = kzalloc(sizeof(*ibft_kobj), GFP_KERNEL); + ibft_kobj = kzalloc_obj(*ibft_kobj, GFP_KERNEL); if (!ibft_kobj) return -ENOMEM; diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c index 55b9cfad8a04..5862fbae9b78 100644 --- a/drivers/firmware/memmap.c +++ b/drivers/firmware/memmap.c @@ -289,7 +289,7 @@ int __meminit firmware_map_add_hotplug(u64 start, u64 end, const char *type) entry = firmware_map_find_entry_bootmem(start, end - 1, type); if (!entry) { - entry = kzalloc(sizeof(struct firmware_map_entry), GFP_ATOMIC); + entry = kzalloc_obj(struct firmware_map_entry, GFP_ATOMIC); if (!entry) return -ENOMEM; } else { diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index e194f7acb2a9..5fa85af40c33 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -162,9 +162,9 @@ static int mpfs_auto_update_verify_image(struct fw_upload *fw_uploader) u32 *response_msg __free(kfree) = kzalloc(AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); struct mpfs_mss_response *response __free(kfree) = - kzalloc(sizeof(struct mpfs_mss_response), GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_response, GFP_KERNEL); struct mpfs_mss_msg *message __free(kfree) = - kzalloc(sizeof(struct mpfs_mss_msg), GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_msg, GFP_KERNEL); int ret; if (!response_msg || !response || !message) @@ -364,9 +364,9 @@ static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv) u32 *response_msg __free(kfree) = kzalloc(AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); struct mpfs_mss_response *response __free(kfree) = - kzalloc(sizeof(struct mpfs_mss_response), GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_response, GFP_KERNEL); struct mpfs_mss_msg *message __free(kfree) = - kzalloc(sizeof(struct mpfs_mss_msg), GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_msg, GFP_KERNEL); int ret; if (!response_msg || !response || !message) diff --git a/drivers/firmware/psci/psci_checker.c b/drivers/firmware/psci/psci_checker.c index df02a4ec3398..2aaf3519cdfb 100644 --- a/drivers/firmware/psci/psci_checker.c +++ b/drivers/firmware/psci/psci_checker.c @@ -155,8 +155,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) return -ENOMEM; - cpu_groups = kcalloc(nb_available_cpus, sizeof(*cpu_groups), - GFP_KERNEL); + cpu_groups = kzalloc_objs(*cpu_groups, nb_available_cpus, GFP_KERNEL); if (!cpu_groups) { free_cpumask_var(tmp); return -ENOMEM; @@ -370,8 +369,7 @@ static int suspend_tests(void) struct task_struct **threads; int nb_threads = 0; - threads = kmalloc_array(nb_available_cpus, sizeof(*threads), - GFP_KERNEL); + threads = kmalloc_objs(*threads, nb_available_cpus, GFP_KERNEL); if (!threads) return -ENOMEM; diff --git a/drivers/firmware/qcom/qcom_qseecom.c b/drivers/firmware/qcom/qcom_qseecom.c index 731e6d5719f9..7eed43fc8174 100644 --- a/drivers/firmware/qcom/qcom_qseecom.c +++ b/drivers/firmware/qcom/qcom_qseecom.c @@ -50,7 +50,7 @@ static int qseecom_client_register(struct platform_device *qseecom_dev, dev_info(&qseecom_dev->dev, "setting up client for %s\n", desc->app_name); /* Allocate and set-up the client device */ - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/drivers/firmware/qcom/qcom_tzmem.c b/drivers/firmware/qcom/qcom_tzmem.c index 9f232e53115e..74ea67a49cab 100644 --- a/drivers/firmware/qcom/qcom_tzmem.c +++ b/drivers/firmware/qcom/qcom_tzmem.c @@ -262,8 +262,8 @@ qcom_tzmem_pool_new(const struct qcom_tzmem_pool_config *config) return ERR_PTR(-EINVAL); } - struct qcom_tzmem_pool *pool __free(kfree) = kzalloc(sizeof(*pool), - GFP_KERNEL); + struct qcom_tzmem_pool *pool __free(kfree) = kzalloc_obj(*pool, + GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 0eebd572f9a5..50224b95d22b 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -94,7 +94,7 @@ static ssize_t fw_cfg_dma_transfer(void *address, u32 length, u32 control) struct fw_cfg_dma_access *d = NULL; ssize_t ret = length; - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { ret = -ENOMEM; goto end; @@ -325,7 +325,7 @@ static ssize_t fw_cfg_write_vmcoreinfo(const struct fw_cfg_file *f) static struct fw_cfg_vmcoreinfo *data; ssize_t ret; - data = kmalloc(sizeof(struct fw_cfg_vmcoreinfo), GFP_KERNEL); + data = kmalloc_obj(struct fw_cfg_vmcoreinfo, GFP_KERNEL); if (!data) return -ENOMEM; @@ -530,7 +530,7 @@ static int fw_cfg_build_symlink(struct kset *dir, dir = to_kset(ko); } else { /* create new subdirectory kset */ - subdir = kzalloc(sizeof(struct kset), GFP_KERNEL); + subdir = kzalloc_obj(struct kset, GFP_KERNEL); if (!subdir) { ret = -ENOMEM; break; @@ -593,7 +593,7 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) #endif /* allocate new entry */ - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index 7ecde6921a0a..3b45bb74d312 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -282,7 +282,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) * Memory will be freed by rpi_firmware_delete() once all users have * released their firmware handles. Don't use devm_kzalloc() here. */ - fw = kzalloc(sizeof(*fw), GFP_KERNEL); + fw = kzalloc_obj(*fw, GFP_KERNEL); if (!fw) return -ENOMEM; diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c index c24b3fca1cfe..95f9163058bb 100644 --- a/drivers/firmware/smccc/soc_id.c +++ b/drivers/firmware/smccc/soc_id.c @@ -137,7 +137,7 @@ static int __init smccc_soc_init(void) return -EINVAL; } - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index dbed404a71fc..aefb28933990 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -535,11 +535,11 @@ static int svc_normal_to_secure_thread(void *data) unsigned long a0, a1, a2, a3, a4, a5, a6, a7; int ret_fifo = 0; - pdata = kmalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kmalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; - cbdata = kmalloc(sizeof(*cbdata), GFP_KERNEL); + cbdata = kmalloc_obj(*cbdata, GFP_KERNEL); if (!cbdata) { kfree(pdata); return -ENOMEM; @@ -1119,7 +1119,7 @@ int stratix10_svc_add_async_client(struct stratix10_svc_chan *chan, return 0; } - achan = kzalloc(sizeof(*achan), GFP_KERNEL); + achan = kzalloc_obj(*achan, GFP_KERNEL); if (!achan) return -ENOMEM; @@ -1692,7 +1692,7 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg) int ret = 0; unsigned int cpu = 0; - p_data = kzalloc(sizeof(*p_data), GFP_KERNEL); + p_data = kzalloc_obj(*p_data, GFP_KERNEL); if (!p_data) return -ENOMEM; diff --git a/drivers/firmware/thead,th1520-aon.c b/drivers/firmware/thead,th1520-aon.c index 38f812ac9920..7dc871060c38 100644 --- a/drivers/firmware/thead,th1520-aon.c +++ b/drivers/firmware/thead,th1520-aon.c @@ -205,7 +205,7 @@ struct th1520_aon_chan *th1520_aon_init(struct device *dev) struct mbox_client *cl; int ret; - aon_chan = kzalloc(sizeof(*aon_chan), GFP_KERNEL); + aon_chan = kzalloc_obj(*aon_chan, GFP_KERNEL); if (!aon_chan) return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f15db1a818dc..fbe8510f4927 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -267,7 +267,7 @@ static int do_feature_check_call(const u32 api_id) } /* Add new entry if not present */ - feature_data = kmalloc(sizeof(*feature_data), GFP_ATOMIC); + feature_data = kmalloc_obj(*feature_data, GFP_ATOMIC); if (!feature_data) return -ENOMEM; diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c index 5aa7b8884374..c71a93d8aee3 100644 --- a/drivers/fpga/dfl-afu-dma-region.c +++ b/drivers/fpga/dfl-afu-dma-region.c @@ -42,7 +42,7 @@ static int afu_dma_pin_pages(struct dfl_feature_dev_data *fdata, if (ret) return ret; - region->pages = kcalloc(npages, sizeof(struct page *), GFP_KERNEL); + region->pages = kzalloc_objs(struct page *, npages, GFP_KERNEL); if (!region->pages) { ret = -ENOMEM; goto unlock_vm; diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c index 602807d6afcc..3e560e5d7241 100644 --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -139,7 +139,7 @@ static int *cci_pci_create_irq_table(struct pci_dev *pcidev, unsigned int nvec) unsigned int i; int *table; - table = kcalloc(nvec, sizeof(int), GFP_KERNEL); + table = kzalloc_objs(int, nvec, GFP_KERNEL); if (!table) return table; diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c index 449c3a082e23..d26003d3c931 100644 --- a/drivers/fpga/dfl.c +++ b/drivers/fpga/dfl.c @@ -347,7 +347,7 @@ dfl_dev_add(struct dfl_feature_dev_data *fdata, struct dfl_device *ddev; int id, i, ret; - ddev = kzalloc(sizeof(*ddev), GFP_KERNEL); + ddev = kzalloc_obj(*ddev, GFP_KERNEL); if (!ddev) return ERR_PTR(-ENOMEM); @@ -397,8 +397,8 @@ dfl_dev_add(struct dfl_feature_dev_data *fdata, /* then add irq resource */ if (feature->nr_irqs) { - ddev->irqs = kcalloc(feature->nr_irqs, - sizeof(*ddev->irqs), GFP_KERNEL); + ddev->irqs = kzalloc_objs(*ddev->irqs, feature->nr_irqs, + GFP_KERNEL); if (!ddev->irqs) { ret = -ENOMEM; goto put_dev; @@ -1182,7 +1182,8 @@ create_feature_instance(struct build_feature_devs_info *binfo, if (binfo->len - ofst < size) return -EINVAL; - finfo = kzalloc(struct_size(finfo, params, dfh_psize / sizeof(u64)), GFP_KERNEL); + finfo = kzalloc_flex(*finfo, params, dfh_psize / sizeof(u64), + GFP_KERNEL); if (!finfo) return -ENOMEM; diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 8ef395b49bf8..c709aa3ef04c 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -346,7 +346,7 @@ __fpga_bridge_register(struct device *parent, const char *name, return ERR_PTR(-EINVAL); } - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index 0f4035b089a2..215303dd6a64 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c @@ -486,7 +486,7 @@ static int fpga_mgr_buf_load(struct fpga_manager *mgr, */ nr_pages = DIV_ROUND_UP((unsigned long)buf + count, PAGE_SIZE) - (unsigned long)buf / PAGE_SIZE; - pages = kmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -801,7 +801,7 @@ __fpga_mgr_register_full(struct device *parent, const struct fpga_manager_info * return ERR_PTR(-EINVAL); } - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (!mgr) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index 753cd142503e..43dbdacfd87e 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -201,7 +201,7 @@ __fpga_region_register_full(struct device *parent, const struct fpga_region_info return ERR_PTR(-EINVAL); } - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) return ERR_PTR(-ENOMEM); diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 83599a1c548b..abc3cf7f4ae4 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -211,7 +211,7 @@ static struct fsi_device *fsi_create_device(struct fsi_slave *slave) { struct fsi_device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -1083,7 +1083,7 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) /* We can communicate with a slave; create the slave device and * register. */ - slave = kzalloc(sizeof(*slave), GFP_KERNEL); + slave = kzalloc_obj(*slave, GFP_KERNEL); if (!slave) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index bff897f77fe5..2589f04c8d5b 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -546,7 +546,7 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev) return rc; } - aspeed = kzalloc(sizeof(*aspeed), GFP_KERNEL); + aspeed = kzalloc_obj(*aspeed, GFP_KERNEL); if (!aspeed) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c index e67d7cd30fca..3b83ebeaf7c1 100644 --- a/drivers/fsi/fsi-master-ast-cf.c +++ b/drivers/fsi/fsi-master-ast-cf.c @@ -1220,7 +1220,7 @@ static int fsi_master_acf_probe(struct platform_device *pdev) uint32_t cf_mem_align; int rc; - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index 69de0b5b9cbd..8c78ab1051d0 100644 --- a/drivers/fsi/fsi-master-gpio.c +++ b/drivers/fsi/fsi-master-gpio.c @@ -774,7 +774,7 @@ static int fsi_master_gpio_probe(struct platform_device *pdev) struct gpio_desc *gpio; int rc; - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c index a84955bb23b1..6cee9f1a1d3a 100644 --- a/drivers/fsi/fsi-master-hub.c +++ b/drivers/fsi/fsi-master-hub.c @@ -215,7 +215,7 @@ static int hub_master_probe(struct fsi_device *fsi_dev) return rc; } - hub = kzalloc(sizeof(*hub), GFP_KERNEL); + hub = kzalloc_obj(*hub, GFP_KERNEL); if (!hub) { rc = -ENOMEM; goto err_release; diff --git a/drivers/fsi/fsi-master-i2cr.c b/drivers/fsi/fsi-master-i2cr.c index 40f1f4d231e5..055e850a8115 100644 --- a/drivers/fsi/fsi-master-i2cr.c +++ b/drivers/fsi/fsi-master-i2cr.c @@ -261,7 +261,7 @@ static int i2cr_probe(struct i2c_client *client) struct fsi_master_i2cr *i2cr; int ret; - i2cr = kzalloc(sizeof(*i2cr), GFP_KERNEL); + i2cr = kzalloc_obj(*i2cr, GFP_KERNEL); if (!i2cr) return -ENOMEM; diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index e41ef12fa095..0ef1eccff91a 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -79,7 +79,7 @@ static DEFINE_IDA(occ_ida); static int occ_open(struct inode *inode, struct file *file) { - struct occ_client *client = kzalloc(sizeof(*client), GFP_KERNEL); + struct occ_client *client = kzalloc_obj(*client, GFP_KERNEL); struct miscdevice *mdev = file->private_data; struct occ *occ = to_occ(mdev); diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c index 6ca5817910cd..5e62212f5ae4 100644 --- a/drivers/fsi/fsi-sbefifo.c +++ b/drivers/fsi/fsi-sbefifo.c @@ -792,7 +792,7 @@ static int sbefifo_user_open(struct inode *inode, struct file *file) struct sbefifo *sbefifo = container_of(inode->i_cdev, struct sbefifo, cdev); struct sbefifo_user *user; - user = kzalloc(sizeof(struct sbefifo_user), GFP_KERNEL); + user = kzalloc_obj(struct sbefifo_user, GFP_KERNEL); if (!user) return -ENOMEM; @@ -1033,7 +1033,7 @@ static int sbefifo_probe(struct fsi_device *fsi_dev) dev_dbg(dev, "Found sbefifo device\n"); - sbefifo = kzalloc(sizeof(*sbefifo), GFP_KERNEL); + sbefifo = kzalloc_obj(*sbefifo, GFP_KERNEL); if (!sbefifo) return -ENOMEM; diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index 67cd45605fe4..bbdbc75ae192 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -533,7 +533,7 @@ static int scom_probe(struct fsi_device *fsi_dev) struct scom_device *scom; int rc, didx; - scom = kzalloc(sizeof(*scom), GFP_KERNEL); + scom = kzalloc_obj(*scom, GFP_KERNEL); if (!scom) return -ENOMEM; fsi_set_drvdata(fsi_dev, scom); diff --git a/drivers/fwctl/mlx5/main.c b/drivers/fwctl/mlx5/main.c index 3dacccf7855c..c4262abfd77a 100644 --- a/drivers/fwctl/mlx5/main.c +++ b/drivers/fwctl/mlx5/main.c @@ -167,7 +167,7 @@ static void *mlx5ctl_info(struct fwctl_uctx *uctx, size_t *length) container_of(uctx, struct mlx5ctl_uctx, uctx); struct fwctl_info_mlx5 *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c index 1809853f6353..8c622267782f 100644 --- a/drivers/fwctl/pds/main.c +++ b/drivers/fwctl/pds/main.c @@ -58,7 +58,7 @@ static void *pdsfc_info(struct fwctl_uctx *uctx, size_t *length) struct pdsfc_uctx *pdsfc_uctx = container_of(uctx, struct pdsfc_uctx, uctx); struct fwctl_info_pds *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c index 883ef86ad3fc..fb17b7811025 100644 --- a/drivers/gnss/core.c +++ b/drivers/gnss/core.c @@ -227,7 +227,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent) int id; int ret; - gdev = kzalloc(sizeof(*gdev), GFP_KERNEL); + gdev = kzalloc_obj(*gdev, GFP_KERNEL); if (!gdev) return NULL; diff --git a/drivers/gnss/usb.c b/drivers/gnss/usb.c index 028ce56b20ea..919ea2ab4572 100644 --- a/drivers/gnss/usb.c +++ b/drivers/gnss/usb.c @@ -131,7 +131,7 @@ static int gnss_usb_probe(struct usb_interface *intf, const struct usb_device_id if (ret) return ret; - gusb = kzalloc(sizeof(*gusb), GFP_KERNEL); + gusb = kzalloc_obj(*gusb, GFP_KERNEL); if (!gusb) return -ENOMEM; diff --git a/drivers/gpib/agilent_82350b/agilent_82350b.c b/drivers/gpib/agilent_82350b/agilent_82350b.c index d55d097aa6f0..021da74d0296 100644 --- a/drivers/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/gpib/agilent_82350b/agilent_82350b.c @@ -481,7 +481,8 @@ static void agilent_82350b_return_to_local(struct gpib_board *board) static int agilent_82350b_allocate_private(struct gpib_board *board) { - board->private_data = kzalloc(sizeof(struct agilent_82350b_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct agilent_82350b_priv, + GFP_KERNEL); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/agilent_82357a/agilent_82357a.c b/drivers/gpib/agilent_82357a/agilent_82357a.c index 26d2830c3fa3..2904bb016c92 100644 --- a/drivers/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/gpib/agilent_82357a/agilent_82357a.c @@ -1196,7 +1196,8 @@ static int agilent_82357a_allocate_private(struct gpib_board *board) { struct agilent_82357a_priv *a_priv; - board->private_data = kzalloc(sizeof(struct agilent_82357a_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct agilent_82357a_priv, + GFP_KERNEL); if (!board->private_data) return -ENOMEM; a_priv = board->private_data; diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index e9d5fd19b495..e8ea37ff4fbf 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -856,7 +856,7 @@ static int cb7210_allocate_private(struct gpib_board *board) { struct cb7210_priv *priv; - board->private_data = kzalloc(sizeof(struct cb7210_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct cb7210_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; @@ -1188,7 +1188,7 @@ static int cb_gpib_probe(struct pcmcia_device *link) int ret; /* Allocate space for private device-specific data */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/gpib/cec/cec_gpib.c b/drivers/gpib/cec/cec_gpib.c index 7e57d65d6c32..45db380aeebe 100644 --- a/drivers/gpib/cec/cec_gpib.c +++ b/drivers/gpib/cec/cec_gpib.c @@ -220,7 +220,7 @@ static int cec_allocate_private(struct gpib_board *board) { struct cec_priv *priv; - board->private_data = kzalloc(sizeof(struct cec_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct cec_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/common/gpib_os.c b/drivers/gpib/common/gpib_os.c index 9dbbac8b8436..08da67543bac 100644 --- a/drivers/gpib/common/gpib_os.c +++ b/drivers/gpib/common/gpib_os.c @@ -199,7 +199,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, return retval; } - status = kmalloc(sizeof(*status), GFP_KERNEL); + status = kmalloc_obj(*status, GFP_KERNEL); if (!status) return -ENOMEM; @@ -513,7 +513,7 @@ static int init_gpib_file_private(struct gpib_file_private *priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); - priv->descriptors[0] = kmalloc(sizeof(struct gpib_descriptor), GFP_KERNEL); + priv->descriptors[0] = kmalloc_obj(struct gpib_descriptor, GFP_KERNEL); if (!priv->descriptors[0]) { pr_err("gpib: failed to allocate default board descriptor\n"); return -ENOMEM; @@ -537,7 +537,7 @@ int ibopen(struct inode *inode, struct file *filep) board = &board_array[minor]; - filep->private_data = kmalloc(sizeof(struct gpib_file_private), GFP_KERNEL); + filep->private_data = kmalloc_obj(struct gpib_file_private, GFP_KERNEL); if (!filep->private_data) return -ENOMEM; @@ -1146,7 +1146,7 @@ static int increment_open_device_count(struct gpib_board *board, struct list_hea } /* otherwise we need to allocate a new struct gpib_status_queue */ - device = kmalloc(sizeof(struct gpib_status_queue), GFP_ATOMIC); + device = kmalloc_obj(struct gpib_status_queue, GFP_ATOMIC); if (!device) return -ENOMEM; init_gpib_status_queue(device); @@ -1241,7 +1241,8 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned mutex_unlock(&file_priv->descriptors_mutex); return -ERANGE; } - file_priv->descriptors[i] = kmalloc(sizeof(struct gpib_descriptor), GFP_KERNEL); + file_priv->descriptors[i] = kmalloc_obj(struct gpib_descriptor, + GFP_KERNEL); if (!file_priv->descriptors[i]) { mutex_unlock(&file_priv->descriptors_mutex); return -ENOMEM; @@ -1876,7 +1877,7 @@ static int push_gpib_event_nolock(struct gpib_board *board, short event_type) return retval; } - event = kmalloc(sizeof(struct gpib_event), GFP_ATOMIC); + event = kmalloc_obj(struct gpib_event, GFP_ATOMIC); if (!event) { queue->dropped_event = 1; dev_err(board->gpib_dev, "failed to allocate memory for event\n"); @@ -2041,7 +2042,7 @@ int gpib_register_driver(struct gpib_interface *interface, struct module *provid { struct gpib_interface_list *entry; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/gpib/eastwood/fluke_gpib.c b/drivers/gpib/eastwood/fluke_gpib.c index 56153b8a1cb2..ae4d99dcae04 100644 --- a/drivers/gpib/eastwood/fluke_gpib.c +++ b/drivers/gpib/eastwood/fluke_gpib.c @@ -853,7 +853,7 @@ static int fluke_allocate_private(struct gpib_board *board) { struct fluke_priv *priv; - board->private_data = kzalloc(sizeof(struct fluke_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct fluke_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/fmh_gpib/fmh_gpib.c b/drivers/gpib/fmh_gpib/fmh_gpib.c index d82ec06b3085..0858cf5ab557 100644 --- a/drivers/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/gpib/fmh_gpib/fmh_gpib.c @@ -1250,7 +1250,7 @@ static int fmh_gpib_allocate_private(struct gpib_board *board) { struct fmh_priv *priv; - board->private_data = kzalloc(sizeof(struct fmh_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct fmh_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/gpio/gpib_bitbang.c b/drivers/gpib/gpio/gpib_bitbang.c index ba99d6c95ddf..a3b63fd33bd8 100644 --- a/drivers/gpib/gpio/gpib_bitbang.c +++ b/drivers/gpib/gpio/gpib_bitbang.c @@ -1066,7 +1066,7 @@ static int bb_line_status(const struct gpib_board *board) static int allocate_private(struct gpib_board *board) { - board->private_data = kzalloc(sizeof(struct bb_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct bb_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/hp_82335/hp82335.c b/drivers/gpib/hp_82335/hp82335.c index 9baf1d3b6751..d5e158c4dd72 100644 --- a/drivers/gpib/hp_82335/hp82335.c +++ b/drivers/gpib/hp_82335/hp82335.c @@ -210,7 +210,7 @@ static struct gpib_interface hp82335_interface = { static int hp82335_allocate_private(struct gpib_board *board) { - board->private_data = kzalloc(sizeof(struct hp82335_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct hp82335_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/hp_82341/hp_82341.c b/drivers/gpib/hp_82341/hp_82341.c index 5aaf5b15b98b..6755982d8a2a 100644 --- a/drivers/gpib/hp_82341/hp_82341.c +++ b/drivers/gpib/hp_82341/hp_82341.c @@ -462,7 +462,7 @@ static struct gpib_interface hp_82341_interface = { static int hp_82341_allocate_private(struct gpib_board *board) { - board->private_data = kzalloc(sizeof(struct hp_82341_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct hp_82341_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c index 737de5fef4b3..7fbe3beb1d67 100644 --- a/drivers/gpib/ines/ines_gpib.c +++ b/drivers/gpib/ines/ines_gpib.c @@ -657,7 +657,7 @@ static int ines_allocate_private(struct gpib_board *board) { struct ines_priv *priv; - board->private_data = kzalloc(sizeof(struct ines_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct ines_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; @@ -1061,7 +1061,7 @@ static int ines_gpib_probe(struct pcmcia_device *link) // int ret, i; /* Allocate space for private device-specific data */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index dd68c4843490..5c189e6f22dc 100644 --- a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -440,7 +440,7 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con return -EIO; } - board->private_data = kzalloc(sizeof(struct usb_gpib_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct usb_gpib_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; @@ -1864,7 +1864,7 @@ static int skel_probe(struct usb_interface *interface, mutex_init(&minors_lock); /* required for handling minor numbers table */ /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/gpib/ni_usb/ni_usb_gpib.c b/drivers/gpib/ni_usb/ni_usb_gpib.c index c6f1a70d44f5..e9d7dd6e2fa7 100644 --- a/drivers/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/gpib/ni_usb/ni_usb_gpib.c @@ -1659,7 +1659,7 @@ static int ni_usb_allocate_private(struct gpib_board *board) { struct ni_usb_priv *ni_priv; - board->private_data = kzalloc(sizeof(struct ni_usb_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct ni_usb_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; ni_priv = board->private_data; @@ -1793,7 +1793,7 @@ static int ni_usb_init(struct gpib_board *board) unsigned int ibsta; int writes_len; - writes = kmalloc_array(NUM_INIT_WRITES, sizeof(*writes), GFP_KERNEL); + writes = kmalloc_objs(*writes, NUM_INIT_WRITES, GFP_KERNEL); if (!writes) return -ENOMEM; diff --git a/drivers/gpib/pc2/pc2_gpib.c b/drivers/gpib/pc2/pc2_gpib.c index 1664861d360d..2c0b464025b5 100644 --- a/drivers/gpib/pc2/pc2_gpib.c +++ b/drivers/gpib/pc2/pc2_gpib.c @@ -237,7 +237,7 @@ static int allocate_private(struct gpib_board *board) { struct pc2_priv *priv; - board->private_data = kzalloc(sizeof(struct pc2_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct pc2_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/tnt4882/mite.c b/drivers/gpib/tnt4882/mite.c index 847b96f411bd..8906f5c41494 100644 --- a/drivers/gpib/tnt4882/mite.c +++ b/drivers/gpib/tnt4882/mite.c @@ -57,7 +57,7 @@ void mite_init(void) for (pcidev = pci_get_device(PCI_VENDOR_ID_NATINST, PCI_ANY_ID, NULL); pcidev; pcidev = pci_get_device(PCI_VENDOR_ID_NATINST, PCI_ANY_ID, pcidev)) { - mite = kzalloc(sizeof(*mite), GFP_KERNEL); + mite = kzalloc_obj(*mite, GFP_KERNEL); if (!mite) return; diff --git a/drivers/gpib/tnt4882/tnt4882_gpib.c b/drivers/gpib/tnt4882/tnt4882_gpib.c index 6d241509419e..8d593d3489ad 100644 --- a/drivers/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/gpib/tnt4882/tnt4882_gpib.c @@ -843,7 +843,7 @@ static int tnt4882_allocate_private(struct gpib_board *board) { struct tnt4882_priv *tnt_priv; - board->private_data = kzalloc(sizeof(struct tnt4882_priv), GFP_KERNEL); + board->private_data = kzalloc_obj(struct tnt4882_priv, GFP_KERNEL); if (!board->private_data) return -ENOMEM; tnt_priv = board->private_data; @@ -1567,7 +1567,7 @@ static int ni_gpib_probe(struct pcmcia_device *link) //struct struct gpib_board *dev; /* Allocate space for private device-specific data */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c index a4cd32674a96..19857285f28c 100644 --- a/drivers/gpio/gpio-aggregator.c +++ b/drivers/gpio/gpio-aggregator.c @@ -159,7 +159,7 @@ gpio_aggregator_line_alloc(struct gpio_aggregator *parent, unsigned int idx, { struct gpio_aggregator_line *line; - line = kzalloc(sizeof(*line), GFP_KERNEL); + line = kzalloc_obj(*line, GFP_KERNEL); if (!line) return ERR_PTR(-ENOMEM); @@ -916,8 +916,7 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr) if (gpio_aggregator_count_lines(aggr) == 0) return -EINVAL; - aggr->lookups = kzalloc(struct_size(aggr->lookups, table, 1), - GFP_KERNEL); + aggr->lookups = kzalloc_flex(*aggr->lookups, table, 1, GFP_KERNEL); if (!aggr->lookups) return -ENOMEM; @@ -1457,8 +1456,7 @@ static ssize_t gpio_aggregator_new_device_store(struct device_driver *driver, memcpy(aggr->args, buf, count + 1); aggr->init_via_sysfs = true; - aggr->lookups = kzalloc(struct_size(aggr->lookups, table, 1), - GFP_KERNEL); + aggr->lookups = kzalloc_flex(*aggr->lookups, table, 1, GFP_KERNEL); if (!aggr->lookups) { res = -ENOMEM; goto free_ga; diff --git a/drivers/gpio/gpio-reg.c b/drivers/gpio/gpio-reg.c index f2238196faf1..1daa05bbf35b 100644 --- a/drivers/gpio/gpio-reg.c +++ b/drivers/gpio/gpio-reg.c @@ -150,7 +150,7 @@ struct gpio_chip *gpio_reg_init(struct device *dev, void __iomem *reg, if (dev) r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL); else - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 9581bd5ca947..5891983810af 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -259,7 +259,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config if (config->reg_dir_out_base && config->reg_dir_in_base) return ERR_PTR(-EINVAL); - gpio = kzalloc(sizeof(*gpio), GFP_KERNEL); + gpio = kzalloc_obj(*gpio, GFP_KERNEL); if (!gpio) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 437b4500f56b..5299500e7617 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -813,7 +813,7 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev) return 0; /* Allocate one more for the sentinel. */ - dev->hogs = kcalloc(num_hogs + 1, sizeof(*dev->hogs), GFP_KERNEL); + dev->hogs = kzalloc_objs(*dev->hogs, num_hogs + 1, GFP_KERNEL); if (!dev->hogs) return -ENOMEM; @@ -1406,7 +1406,7 @@ gpio_sim_line_config_make_hog_item(struct config_group *group, const char *name) guard(mutex)(&dev->lock); - hog = kzalloc(sizeof(*hog), GFP_KERNEL); + hog = kzalloc_obj(*hog, GFP_KERNEL); if (!hog) return ERR_PTR(-ENOMEM); @@ -1467,7 +1467,7 @@ gpio_sim_bank_config_make_line_group(struct config_group *group, if (gpio_sim_device_is_live(dev)) return ERR_PTR(-EBUSY); - line = kzalloc(sizeof(*line), GFP_KERNEL); + line = kzalloc_obj(*line, GFP_KERNEL); if (!line) return ERR_PTR(-ENOMEM); @@ -1521,7 +1521,7 @@ gpio_sim_device_config_make_bank_group(struct config_group *group, if (gpio_sim_device_is_live(dev)) return ERR_PTR(-EBUSY); - bank = kzalloc(sizeof(*bank), GFP_KERNEL); + bank = kzalloc_obj(*bank, GFP_KERNEL); if (!bank) return ERR_PTR(-ENOMEM); @@ -1569,8 +1569,8 @@ gpio_sim_config_make_device_group(struct config_group *group, const char *name) { int id; - struct gpio_sim_device *dev __free(kfree) = kzalloc(sizeof(*dev), - GFP_KERNEL); + struct gpio_sim_device *dev __free(kfree) = kzalloc_obj(*dev, + GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index b6c515e7a876..5b8cb4e65e56 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -1388,7 +1388,7 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev) lockdep_assert_held(&dev->lock); struct gpiod_lookup_table *table __free(kfree) = - kzalloc(struct_size(table, table, num_entries + 1), GFP_KERNEL); + kzalloc_flex(*table, table, num_entries + 1, GFP_KERNEL); if (!table) return -ENOMEM; @@ -1605,7 +1605,7 @@ gpio_virtuser_make_lookup_entry_group(struct config_group *group, return ERR_PTR(-EBUSY); struct gpio_virtuser_lookup_entry *entry __free(kfree) = - kzalloc(sizeof(*entry), GFP_KERNEL); + kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -1661,7 +1661,7 @@ gpio_virtuser_make_lookup_group(struct config_group *group, const char *name) return ERR_PTR(-EBUSY); struct gpio_virtuser_lookup *lookup __free(kfree) = - kzalloc(sizeof(*lookup), GFP_KERNEL); + kzalloc_obj(*lookup, GFP_KERNEL); if (!lookup) return ERR_PTR(-ENOMEM); @@ -1711,8 +1711,8 @@ static struct config_group * gpio_virtuser_config_make_device_group(struct config_group *group, const char *name) { - struct gpio_virtuser_device *dev __free(kfree) = kzalloc(sizeof(*dev), - GFP_KERNEL); + struct gpio_virtuser_device *dev __free(kfree) = kzalloc_obj(*dev, + GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c index 5e709ba35ec2..df60f6eac137 100644 --- a/drivers/gpio/gpiolib-acpi-core.c +++ b/drivers/gpio/gpiolib-acpi-core.c @@ -403,7 +403,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, goto fail_unlock_irq; } - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) goto fail_unlock_irq; @@ -1144,7 +1144,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, goto out; } - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) { gpiochip_free_own_desc(desc); mutex_unlock(&achip->conn_lock); @@ -1302,7 +1302,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip) if (!adev) return; - acpi_gpio = kzalloc(sizeof(*acpi_gpio), GFP_KERNEL); + acpi_gpio = kzalloc_obj(*acpi_gpio, GFP_KERNEL); if (!acpi_gpio) { dev_err(chip->parent, "Failed to allocate memory for ACPI GPIO chip\n"); diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 189127721e38..f50b067e1de3 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -318,7 +318,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) if (ret) return ret; - lh = kzalloc(sizeof(*lh), GFP_KERNEL); + lh = kzalloc_obj(*lh, GFP_KERNEL); if (!lh) return -ENOMEM; lh->gdev = gpio_device_get(gdev); @@ -1280,7 +1280,7 @@ static long linereq_get_values(struct linereq *lr, void __user *ip) if (num_get != 1) { /* build compacted desc array */ - descs = kmalloc_array(num_get, sizeof(*descs), GFP_KERNEL); + descs = kmalloc_objs(*descs, num_get, GFP_KERNEL); if (!descs) return -ENOMEM; for (didx = 0, i = 0; i < lr->num_lines; i++) { @@ -1355,7 +1355,7 @@ static long linereq_set_values(struct linereq *lr, void __user *ip) if (num_set != 1) { /* build compacted desc array */ - descs = kmalloc_array(num_set, sizeof(*descs), GFP_KERNEL); + descs = kmalloc_objs(*descs, num_set, GFP_KERNEL); if (!descs) return -ENOMEM; for (didx = 0, i = 0; i < lr->num_lines; i++) { @@ -1610,7 +1610,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip) if (ret) return ret; - lr = kvzalloc(struct_size(lr, lines, ulr.num_lines), GFP_KERNEL); + lr = kvzalloc_flex(*lr, lines, ulr.num_lines, GFP_KERNEL); if (!lr) return -ENOMEM; lr->num_lines = ulr.num_lines; @@ -2054,7 +2054,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) (lflags & GPIOHANDLE_REQUEST_BIAS_PULL_UP))) return -EINVAL; - le = kzalloc(sizeof(*le), GFP_KERNEL); + le = kzalloc_obj(*le, GFP_KERNEL); if (!le) return -ENOMEM; le->gdev = gpio_device_get(gdev); @@ -2546,7 +2546,7 @@ static int lineinfo_changed_notify(struct notifier_block *nb, * is executed. */ - ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC); + ctx = kzalloc_obj(*ctx, GFP_ATOMIC); if (!ctx) { pr_err("Failed to allocate memory for line info notification\n"); fput(fp); diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c index b3525d1f06a4..bb53f803b2e3 100644 --- a/drivers/gpio/gpiolib-shared.c +++ b/drivers/gpio/gpiolib-shared.c @@ -84,7 +84,8 @@ static struct gpio_shared_ref *gpio_shared_make_ref(struct fwnode_handle *fwnode { char *con_id_cpy __free(kfree) = NULL; - struct gpio_shared_ref *ref __free(kfree) = kzalloc(sizeof(*ref), GFP_KERNEL); + struct gpio_shared_ref *ref __free(kfree) = kzalloc_obj(*ref, + GFP_KERNEL); if (!ref) return NULL; @@ -227,7 +228,7 @@ static int gpio_shared_of_traverse(struct device_node *curr) entry = gpio_shared_find_entry(fwnode, offset); if (!entry) { - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -477,7 +478,7 @@ int gpio_shared_add_proxy_lookup(struct device *consumer, const char *con_id, if (!key) return -ENOMEM; - lookup = kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); + lookup = kzalloc_flex(*lookup, table, 2, GFP_KERNEL); if (!lookup) return -ENOMEM; @@ -626,7 +627,7 @@ gpiod_shared_desc_create(struct gpio_shared_entry *entry) lockdep_assert_held(&entry->lock); - shared_desc = kzalloc(sizeof(*shared_desc), GFP_KERNEL); + shared_desc = kzalloc_obj(*shared_desc, GFP_KERNEL); if (!shared_desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index d4a46a0a37d8..99e0cf963b19 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -761,7 +761,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change) goto err_clear_bit; } - desc_data = kzalloc(sizeof(*desc_data), GFP_KERNEL); + desc_data = kzalloc_obj(*desc_data, GFP_KERNEL); if (!desc_data) { status = -ENOMEM; goto err_clear_bit; @@ -1014,7 +1014,7 @@ int gpiochip_sysfs_register(struct gpio_device *gdev) else parent = &gdev->dev; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index c52200eaaaff..654505cd21da 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -147,8 +147,7 @@ static int desc_set_label(struct gpio_desc *desc, const char *label) struct gpio_desc_label *new = NULL, *old; if (label) { - new = kzalloc(struct_size(new, str, strlen(label) + 1), - GFP_KERNEL); + new = kzalloc_flex(*new, str, strlen(label) + 1, GFP_KERNEL); if (!new) return -ENOMEM; @@ -2333,7 +2332,7 @@ int gpiochip_add_pingroup_range(struct gpio_chip *gc, struct gpio_device *gdev = gc->gpiodev; int ret; - pin_range = kzalloc(sizeof(*pin_range), GFP_KERNEL); + pin_range = kzalloc_obj(*pin_range, GFP_KERNEL); if (!pin_range) return -ENOMEM; @@ -2394,7 +2393,7 @@ int gpiochip_add_pin_range_with_pins(struct gpio_chip *gc, struct gpio_device *gdev = gc->gpiodev; int ret; - pin_range = kzalloc(sizeof(*pin_range), GFP_KERNEL); + pin_range = kzalloc_obj(*pin_range, GFP_KERNEL); if (!pin_range) return -ENOMEM; @@ -5370,7 +5369,7 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos) s->private = NULL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c index daa7b23bc775..5d8d9c73434a 100644 --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c @@ -447,7 +447,7 @@ int aldebaran_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc(sizeof(*reset_ctl), GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c index 9b3180449150..1c7597c19249 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c @@ -52,7 +52,7 @@ static int aca_banks_add_bank(struct aca_banks *banks, struct aca_bank *bank) if (!bank) return -EINVAL; - node = kvzalloc(sizeof(*node), GFP_KERNEL); + node = kvzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; @@ -230,7 +230,7 @@ static struct aca_bank_error *new_bank_error(struct aca_error *aerr, struct aca_ { struct aca_bank_error *bank_error; - bank_error = kvzalloc(sizeof(*bank_error), GFP_KERNEL); + bank_error = kvzalloc_obj(*bank_error, GFP_KERNEL); if (!bank_error) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index 381ef205b0df..c544f0dbb93f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -246,7 +246,7 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) return -EINVAL; acp_base = adev->rmmio_base; - adev->acp.acp_genpd = kzalloc(sizeof(struct acp_pm_domain), GFP_KERNEL); + adev->acp.acp_genpd = kzalloc_obj(struct acp_pm_domain, GFP_KERNEL); if (!adev->acp.acp_genpd) return -ENOMEM; @@ -260,20 +260,21 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) switch (acp_machine_id) { case ST_JADEITE: { - adev->acp.acp_cell = kcalloc(2, sizeof(struct mfd_cell), - GFP_KERNEL); + adev->acp.acp_cell = kzalloc_objs(struct mfd_cell, 2, + GFP_KERNEL); if (!adev->acp.acp_cell) { r = -ENOMEM; goto failure; } - adev->acp.acp_res = kcalloc(3, sizeof(struct resource), GFP_KERNEL); + adev->acp.acp_res = kzalloc_objs(struct resource, 3, GFP_KERNEL); if (!adev->acp.acp_res) { r = -ENOMEM; goto failure; } - i2s_pdata = kcalloc(1, sizeof(struct i2s_platform_data), GFP_KERNEL); + i2s_pdata = kzalloc_objs(struct i2s_platform_data, 1, + GFP_KERNEL); if (!i2s_pdata) { r = -ENOMEM; goto failure; @@ -324,21 +325,22 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) break; } default: - adev->acp.acp_cell = kcalloc(ACP_DEVS, sizeof(struct mfd_cell), - GFP_KERNEL); + adev->acp.acp_cell = kzalloc_objs(struct mfd_cell, ACP_DEVS, + GFP_KERNEL); if (!adev->acp.acp_cell) { r = -ENOMEM; goto failure; } - adev->acp.acp_res = kcalloc(5, sizeof(struct resource), GFP_KERNEL); + adev->acp.acp_res = kzalloc_objs(struct resource, 5, GFP_KERNEL); if (!adev->acp.acp_res) { r = -ENOMEM; goto failure; } - i2s_pdata = kcalloc(3, sizeof(struct i2s_platform_data), GFP_KERNEL); + i2s_pdata = kzalloc_objs(struct i2s_platform_data, 3, + GFP_KERNEL); if (!i2s_pdata) { r = -ENOMEM; goto failure; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 02d5abf9df2b..742fc381149e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -897,7 +897,7 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm) if (!numa_info) { struct sysinfo info; - numa_info = kzalloc(sizeof(*numa_info), GFP_KERNEL); + numa_info = kzalloc_obj(*numa_info, GFP_KERNEL); if (!numa_info) return NULL; @@ -1016,7 +1016,7 @@ static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info, int ret = -ENOENT; *dev_info = NULL; - tmp = kzalloc(sizeof(struct amdgpu_acpi_dev_info), GFP_KERNEL); + tmp = kzalloc_obj(struct amdgpu_acpi_dev_info, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -1166,8 +1166,7 @@ int amdgpu_acpi_enumerate_xcc(void) break; } - xcc_info = kzalloc(sizeof(struct amdgpu_acpi_xcc_info), - GFP_KERNEL); + xcc_info = kzalloc_obj(struct amdgpu_acpi_xcc_info, GFP_KERNEL); if (!xcc_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 3bfd79c89df3..16baf713be78 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -829,11 +829,11 @@ int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off, if (!kiq_ring->sched.ready || amdgpu_in_reset(adev)) return 0; - ring_funcs = kzalloc(sizeof(*ring_funcs), GFP_KERNEL); + ring_funcs = kzalloc_obj(*ring_funcs, GFP_KERNEL); if (!ring_funcs) return -ENOMEM; - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) { r = -ENOMEM; goto free_ring_funcs; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c index 1105a09e55dc..c74e3866ffb8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c @@ -199,7 +199,7 @@ int kgd_arcturus_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c index 31b8fa52b42f..fff60109cf9c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c @@ -67,7 +67,7 @@ struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context, { struct amdgpu_amdkfd_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (fence == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c index 89a45a9218f3..a2e00dd114a6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c @@ -141,7 +141,7 @@ static int kgd_gfx_v9_4_3_hqd_sdma_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c index 0239114fb6c4..70d63690dccd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c @@ -352,7 +352,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32_SOC15_IP(GC, addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -449,7 +449,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c index f2278a0937ff..41564319441e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c @@ -338,7 +338,7 @@ static int hqd_dump_v10_3(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32_SOC15_IP(GC, addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -435,7 +435,7 @@ static int hqd_sdma_dump_v10_3(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+12) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c index aaccf0b9947d..50c57914c90c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c @@ -323,7 +323,7 @@ static int hqd_dump_v11(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -420,7 +420,7 @@ static int hqd_sdma_dump_v11(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (7+11+1+12+12) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c index e0ceab400b2d..4e43ad423713 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c @@ -115,7 +115,7 @@ static int hqd_dump_v12(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -146,7 +146,7 @@ static int hqd_sdma_dump_v12(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (last_reg - first_reg + 1) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c index df77558e03ef..ba7e901322b3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c @@ -214,7 +214,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -301,7 +301,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+4) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c index e68c0fa8d751..9f51fd11c5ae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c @@ -238,7 +238,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -324,7 +324,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+4+2+3+7) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c index 088d09cc7a72..cc2073cf43f4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c @@ -363,7 +363,7 @@ int kgd_gfx_v9_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; @@ -460,7 +460,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_array(HQD_N_REGS, sizeof(**dump), GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index d8d834cf96e7..fd7bfe418099 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -540,7 +540,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct amdgpu_vm *vm, */ static struct sg_table *create_sg_table(uint64_t addr, uint32_t size) { - struct sg_table *sg = kmalloc(sizeof(*sg), GFP_KERNEL); + struct sg_table *sg = kmalloc_obj(*sg, GFP_KERNEL); if (!sg) return NULL; @@ -573,7 +573,7 @@ kfd_mem_dmamap_userptr(struct kgd_mem *mem, if (WARN_ON(ttm->num_pages != src_ttm->num_pages)) return -EINVAL; - ttm->sg = kmalloc(sizeof(*ttm->sg), GFP_KERNEL); + ttm->sg = kmalloc_obj(*ttm->sg, GFP_KERNEL); if (unlikely(!ttm->sg)) return -ENOMEM; @@ -1409,7 +1409,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, process = container_of(process_info, struct kfd_process, kgd_process_info); if (!*process_info) { - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1773,7 +1773,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( if (flags & KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED) alloc_flags |= AMDGPU_GEM_CREATE_UNCACHED; - *mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); if (!*mem) { ret = -ENOMEM; goto err; @@ -2374,7 +2374,7 @@ static int import_obj_create(struct amdgpu_device *adev, /* Only VRAM and GTT BOs are supported */ return -EINVAL; - *mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); if (!*mem) return -ENOMEM; @@ -3129,7 +3129,7 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem if (!info || !gws) return -EINVAL; - *mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); if (!*mem) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 763f2b8dcf13..59ddc14cbb7d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1897,7 +1897,7 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev) int amdgpu_atombios_init(struct amdgpu_device *adev) { struct card_info *atom_card_info = - kzalloc(sizeof(struct card_info), GFP_KERNEL); + kzalloc_obj(struct card_info, GFP_KERNEL); if (!atom_card_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index 87ec46c56a6e..3785c0645751 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -76,7 +76,7 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp, unsigned i; int r; - list = kvzalloc(struct_size(list, entries, num_entries), GFP_KERNEL); + list = kvzalloc_flex(*list, entries, num_entries, GFP_KERNEL); if (!list) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index 09c8942c22d3..c9c82fc9604a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c @@ -399,8 +399,8 @@ static const struct cgs_ops amdgpu_cgs_ops = { struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev) { - struct amdgpu_cgs_device *cgs_device = - kmalloc(sizeof(*cgs_device), GFP_KERNEL); + struct amdgpu_cgs_device *cgs_device = kmalloc_obj(*cgs_device, + GFP_KERNEL); if (!cgs_device) { drm_err(adev_to_drm(adev), "Couldn't allocate CGS device structure\n"); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index d3e312bda4ed..198ad026222d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1652,7 +1652,7 @@ amdgpu_connector_add(struct amdgpu_device *adev, } } - amdgpu_connector = kzalloc(sizeof(struct amdgpu_connector), GFP_KERNEL); + amdgpu_connector = kzalloc_obj(struct amdgpu_connector, GFP_KERNEL); if (!amdgpu_connector) return; @@ -1673,7 +1673,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, } if (is_dp_bridge) { - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; @@ -1828,7 +1829,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, break; case DRM_MODE_CONNECTOR_DVII: case DRM_MODE_CONNECTOR_DVID: - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; @@ -1885,7 +1887,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, break; case DRM_MODE_CONNECTOR_HDMIA: case DRM_MODE_CONNECTOR_HDMIB: - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; @@ -1934,7 +1937,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_DisplayPort: - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; @@ -1983,7 +1987,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_eDP: - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; @@ -2010,7 +2015,8 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_LVDS: - amdgpu_dig_connector = kzalloc(sizeof(struct amdgpu_connector_atom_dig), GFP_KERNEL); + amdgpu_dig_connector = kzalloc_obj(struct amdgpu_connector_atom_dig, + GFP_KERNEL); if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index f3b5bcdbf2ae..c9345783ac26 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -192,8 +192,8 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, return PTR_ERR(chunk_array); p->nchunks = cs->in.num_chunks; - p->chunks = kvmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk), - GFP_KERNEL); + p->chunks = kvmalloc_objs(struct amdgpu_cs_chunk, p->nchunks, + GFP_KERNEL); if (!p->chunks) { ret = -ENOMEM; goto free_chunk; @@ -523,8 +523,7 @@ static int amdgpu_cs_p2_syncobj_out(struct amdgpu_cs_parser *p, if (p->post_deps) return -EINVAL; - p->post_deps = kmalloc_array(num_deps, sizeof(*p->post_deps), - GFP_KERNEL); + p->post_deps = kmalloc_objs(*p->post_deps, num_deps, GFP_KERNEL); p->num_post_deps = 0; if (!p->post_deps) @@ -557,8 +556,7 @@ static int amdgpu_cs_p2_syncobj_timeline_signal(struct amdgpu_cs_parser *p, if (p->post_deps) return -EINVAL; - p->post_deps = kmalloc_array(num_deps, sizeof(*p->post_deps), - GFP_KERNEL); + p->post_deps = kmalloc_objs(*p->post_deps, num_deps, GFP_KERNEL); p->num_post_deps = 0; if (!p->post_deps) @@ -1691,7 +1689,7 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, long r; /* Prepare the fence array */ - array = kcalloc(fence_count, sizeof(struct dma_fence *), GFP_KERNEL); + array = kzalloc_objs(struct dma_fence *, fence_count, GFP_KERNEL); if (array == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 5c344665b43c..1eb2e89fcdeb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -212,8 +212,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip, int32_t ctx_prio; int r; - entity = kzalloc(struct_size(entity, fences, amdgpu_sched_jobs), - GFP_KERNEL); + entity = kzalloc_flex(*entity, fences, amdgpu_sched_jobs, GFP_KERNEL); if (!entity) return -ENOMEM; @@ -483,7 +482,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev, struct amdgpu_ctx *ctx; int r; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index aeb90708f229..56a13637bb8c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -206,7 +206,7 @@ static int amdgpu_debugfs_regs2_open(struct inode *inode, struct file *file) { struct amdgpu_debugfs_regs2_data *rd; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; rd->adev = file_inode(file)->i_private; @@ -371,7 +371,7 @@ static int amdgpu_debugfs_gprwave_open(struct inode *inode, struct file *file) { struct amdgpu_debugfs_gprwave_data *rd; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; rd->adev = file_inode(file)->i_private; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c index ca71c2948227..c38e7371bafc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c @@ -332,7 +332,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check, struct amdgpu_coredump_info *coredump; struct drm_sched_job *s_job; - coredump = kzalloc(sizeof(*coredump), GFP_NOWAIT); + coredump = kzalloc_obj(*coredump, GFP_NOWAIT); if (!coredump) return; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c3cb9570f0ba..c57cbf497eba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2596,7 +2596,7 @@ out: static void amdgpu_uid_init(struct amdgpu_device *adev) { /* Initialize the UID for the device */ - adev->uid_info = kzalloc(sizeof(struct amdgpu_uid), GFP_KERNEL); + adev->uid_info = kzalloc_obj(struct amdgpu_uid, GFP_KERNEL); if (!adev->uid_info) { dev_warn(adev->dev, "Failed to allocate memory for UID\n"); return; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index fc8c1f36be58..c51eedd96fb0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -1149,7 +1149,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev, * block if not yet registered. */ if (!ip_hw_id) { - ip_hw_id = kzalloc(sizeof(*ip_hw_id), GFP_KERNEL); + ip_hw_id = kzalloc_obj(*ip_hw_id, GFP_KERNEL); if (!ip_hw_id) return -ENOMEM; ip_hw_id->hw_id = ii; @@ -1177,10 +1177,10 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev, /* Now register its instance. */ - ip_hw_instance = kzalloc(struct_size(ip_hw_instance, - base_addr, - ip->num_base_address), - GFP_KERNEL); + ip_hw_instance = kzalloc_flex(*ip_hw_instance, + base_addr, + ip->num_base_address, + GFP_KERNEL); if (!ip_hw_instance) { DRM_ERROR("no memory for ip_hw_instance"); return -ENOMEM; @@ -1255,7 +1255,7 @@ static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev) * amdgpu_discovery_reg_base_init(). */ - ip_die_entry = kzalloc(sizeof(*ip_die_entry), GFP_KERNEL); + ip_die_entry = kzalloc_obj(*ip_die_entry, GFP_KERNEL); if (!ip_die_entry) return -ENOMEM; @@ -1287,7 +1287,7 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev) if (!discovery_bin) return -EINVAL; - ip_top = kzalloc(sizeof(*ip_top), GFP_KERNEL); + ip_top = kzalloc_obj(*ip_top, GFP_KERNEL); if (!ip_top) return -ENOMEM; @@ -1931,9 +1931,8 @@ int amdgpu_discovery_get_nps_info(struct amdgpu_device *adev, switch (le16_to_cpu(nps_info->v1.header.version_major)) { case 1: - mem_ranges = kvcalloc(nps_info->v1.count, - sizeof(*mem_ranges), - GFP_KERNEL); + mem_ranges = kvzalloc_objs(*mem_ranges, nps_info->v1.count, + GFP_KERNEL); if (!mem_ranges) return -ENOMEM; *nps_type = nps_info->v1.nps_type; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 48b6f6077992..eb94a0b97b94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -204,7 +204,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, u64 tiling_flags; int i, r; - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (work == NULL) return -ENOMEM; @@ -1323,7 +1323,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL); + amdgpu_fb = kzalloc_obj(*amdgpu_fb, GFP_KERNEL); if (amdgpu_fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c index 23d7d0b0d625..432de34d177f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c @@ -161,7 +161,7 @@ amdgpu_eviction_fence_create(struct amdgpu_eviction_fence_mgr *evf_mgr) { struct amdgpu_eviction_fence *ev_fence; - ev_fence = kzalloc(sizeof(*ev_fence), GFP_KERNEL); + ev_fence = kzalloc_obj(*ev_fence, GFP_KERNEL); if (!ev_fence) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c index b0082aa7f3c6..cb33a04d94c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c @@ -130,7 +130,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev) return 0; if (!adev->fru_info) { - adev->fru_info = kzalloc(sizeof(*adev->fru_info), GFP_KERNEL); + adev->fru_info = kzalloc_obj(*adev->fru_info, GFP_KERNEL); if (!adev->fru_info) return -ENOMEM; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index ec911dce345f..07e43b446e44 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c @@ -153,7 +153,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev) dev_info(adev->dev, "%s dma_addr:%pad\n", __func__, &dma_addr); /* Create SG table */ - sg = kmalloc(sizeof(*sg), GFP_KERNEL); + sg = kmalloc_obj(*sg, GFP_KERNEL); if (!sg) { ret = -ENOMEM; goto error; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 5c90de58cc28..27b77a82b174 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -1183,7 +1183,7 @@ int amdgpu_gem_list_handles_ioctl(struct drm_device *dev, void *data, return 0; } - bo_entries = kvcalloc(num_bos, sizeof(*bo_entries), GFP_KERNEL); + bo_entries = kvzalloc_objs(*bo_entries, num_bos, GFP_KERNEL); if (!bo_entries) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index 6a6b334428f6..d9b2252db00e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -1727,9 +1727,9 @@ int amdgpu_gmc_init_mem_ranges(struct amdgpu_device *adev) { bool valid; - adev->gmc.mem_partitions = kcalloc(AMDGPU_MAX_MEM_RANGES, - sizeof(struct amdgpu_mem_partition_info), - GFP_KERNEL); + adev->gmc.mem_partitions = kzalloc_objs(struct amdgpu_mem_partition_info, + AMDGPU_MAX_MEM_RANGES, + GFP_KERNEL); if (!adev->gmc.mem_partitions) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index dd9b845d5783..33e209818ced 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c @@ -122,7 +122,7 @@ static int amdgpu_gtt_mgr_new(struct ttm_resource_manager *man, struct ttm_range_mgr_node *node; int r; - node = kzalloc(struct_size(node, mm_nodes, 1), GFP_KERNEL); + node = kzalloc_flex(*node, mm_nodes, 1, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c index 90d26d820bac..4cc345f77db0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c @@ -265,7 +265,7 @@ struct amdgpu_hmm_range *amdgpu_hmm_range_alloc(struct amdgpu_bo *bo) { struct amdgpu_hmm_range *range; - range = kzalloc(sizeof(*range), GFP_KERNEL); + range = kzalloc_obj(*range, GFP_KERNEL); if (!range) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c index 9cb72f0c5277..9dc4a5f426eb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c @@ -168,7 +168,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev, if (rec->mm_i2c && (amdgpu_hw_i2c == 0)) return NULL; - i2c = kzalloc(sizeof(struct amdgpu_i2c_chan), GFP_KERNEL); + i2c = kzalloc_obj(struct amdgpu_i2c_chan, GFP_KERNEL); if (i2c == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index bfa64cd7a62d..3a7bab87b5d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -169,7 +169,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs, csa_va = 0; gds_va = 0; init_shadow = false; - af = kzalloc(sizeof(*af), GFP_ATOMIC); + af = kzalloc_obj(*af, GFP_ATOMIC); if (!af) return -ENOMEM; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c index 9cab36322c16..52bad6d28915 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c @@ -119,7 +119,7 @@ void amdgpu_pasid_free_delayed(struct dma_resv *resv, return; } - cb = kmalloc(sizeof(*cb), GFP_KERNEL); + cb = kmalloc_obj(*cb, GFP_KERNEL); if (!cb) { /* Last resort when we are OOM */ dma_fence_wait(fence, false); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c index 82bc6d657e5a..d51ce25474f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c @@ -436,9 +436,8 @@ int amdgpu_irq_add_id(struct amdgpu_device *adev, if (!adev->irq.client[client_id].sources) { adev->irq.client[client_id].sources = - kcalloc(AMDGPU_MAX_IRQ_SRC_ID, - sizeof(struct amdgpu_irq_src *), - GFP_KERNEL); + kzalloc_objs(struct amdgpu_irq_src *, + AMDGPU_MAX_IRQ_SRC_ID, GFP_KERNEL); if (!adev->irq.client[client_id].sources) return -ENOMEM; } @@ -449,8 +448,7 @@ int amdgpu_irq_add_id(struct amdgpu_device *adev, if (source->num_types && !source->enabled_types) { atomic_t *types; - types = kcalloc(source->num_types, sizeof(atomic_t), - GFP_KERNEL); + types = kzalloc_objs(atomic_t, source->num_types, GFP_KERNEL); if (!types) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 2c82d9e8c0be..8865b4802963 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -198,18 +198,18 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (num_ibs == 0) return -EINVAL; - *job = kzalloc(struct_size(*job, ibs, num_ibs), GFP_KERNEL); + *job = kzalloc_flex(**job, ibs, num_ibs, GFP_KERNEL); if (!*job) return -ENOMEM; - af = kzalloc(sizeof(struct amdgpu_fence), GFP_KERNEL); + af = kzalloc_obj(struct amdgpu_fence, GFP_KERNEL); if (!af) { r = -ENOMEM; goto err_job; } (*job)->hw_fence = af; - af = kzalloc(sizeof(struct amdgpu_fence), GFP_KERNEL); + af = kzalloc_obj(struct amdgpu_fence, GFP_KERNEL); if (!af) { r = -ENOMEM; goto err_fence; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index f69332eed051..a5b72ed77162 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -942,7 +942,7 @@ out: uint64_t vm_size; uint32_t pcie_gen_mask, pcie_width_mask; - dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL); + dev_info = kzalloc_obj(*dev_info, GFP_KERNEL); if (!dev_info) return -ENOMEM; @@ -1329,7 +1329,7 @@ out: return -EINVAL; } - caps = kzalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc_obj(*caps, GFP_KERNEL); if (!caps) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c index 3ca03b5e0f91..6b52dbdb7e54 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c @@ -169,7 +169,7 @@ static int amdgpu_mca_bank_set_add_entry(struct mca_bank_set *mca_set, struct mc if (!entry) return -EINVAL; - node = kvzalloc(sizeof(*node), GFP_KERNEL); + node = kvzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c index 6e91ea1de5aa..0cfe3a91db84 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c @@ -446,25 +446,25 @@ static int amdgpu_pmu_alloc_pmu_attrs( struct amdgpu_pmu_event_attribute **evt_attr, struct amdgpu_pmu_config *config) { - *fmt_attr = kcalloc(config->num_formats, sizeof(**fmt_attr), - GFP_KERNEL); + *fmt_attr = kzalloc_objs(**fmt_attr, config->num_formats, GFP_KERNEL); if (!(*fmt_attr)) return -ENOMEM; - fmt_attr_group->attrs = kcalloc(config->num_formats + 1, - sizeof(*fmt_attr_group->attrs), GFP_KERNEL); + fmt_attr_group->attrs = kzalloc_objs(*fmt_attr_group->attrs, + config->num_formats + 1, + GFP_KERNEL); if (!fmt_attr_group->attrs) goto err_fmt_attr_grp; - *evt_attr = kcalloc(config->num_events, sizeof(**evt_attr), GFP_KERNEL); + *evt_attr = kzalloc_objs(**evt_attr, config->num_events, GFP_KERNEL); if (!(*evt_attr)) goto err_evt_attr; - evt_attr_group->attrs = kcalloc(config->num_events + 1, - sizeof(*evt_attr_group->attrs), GFP_KERNEL); + evt_attr_group->attrs = kzalloc_objs(*evt_attr_group->attrs, + config->num_events + 1, GFP_KERNEL); if (!evt_attr_group->attrs) goto err_evt_attr_grp; @@ -599,7 +599,7 @@ static struct amdgpu_pmu_entry *create_pmu_entry(struct amdgpu_device *adev, { struct amdgpu_pmu_entry *pmu_entry; - pmu_entry = kzalloc(sizeof(struct amdgpu_pmu_entry), GFP_KERNEL); + pmu_entry = kzalloc_obj(struct amdgpu_pmu_entry, GFP_KERNEL); if (!pmu_entry) return pmu_entry; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c index 34b5e22b44e5..5420362b4261 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c @@ -61,7 +61,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc(sizeof(**res), GFP_KERNEL); + *res = kzalloc_obj(**res, GFP_KERNEL); if (!*res) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index a7c7b378c696..01ce996bfacd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -457,7 +457,7 @@ static int psp_sw_init(struct amdgpu_ip_block *ip_block) struct psp_memory_training_context *mem_training_ctx = &psp->mem_train_ctx; struct psp_runtime_scpm_entry scpm_entry; - psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL); + psp->cmd = kzalloc_obj(struct psp_gfx_cmd_resp, GFP_KERNEL); if (!psp->cmd) { dev_err(adev->dev, "Failed to allocate memory to command buffer!\n"); return -ENOMEM; @@ -4384,7 +4384,7 @@ static int psp_read_spirom_debugfs_open(struct inode *inode, struct file *filp) return -EBUSY; } - bo_triplet = kzalloc(sizeof(struct spirom_bo), GFP_KERNEL); + bo_triplet = kzalloc_obj(struct spirom_bo, GFP_KERNEL); if (!bo_triplet) { mutex_unlock(&adev->psp.mutex); return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 856b1bf83533..c363953c2a74 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -891,7 +891,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, if (head->block == AMDGPU_RAS_BLOCK__GFX && !amdgpu_sriov_vf(adev) && !amdgpu_ras_intr_triggered()) { - info = kzalloc(sizeof(union ta_ras_cmd_input), GFP_KERNEL); + info = kzalloc_obj(union ta_ras_cmd_input, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1904,7 +1904,7 @@ static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f, memset(buf, 0, count); bps_count = end - start; - bps = kmalloc_array(bps_count, sizeof(*bps), GFP_KERNEL); + bps = kmalloc_objs(*bps, bps_count, GFP_KERNEL); if (!bps) return 0; @@ -2811,7 +2811,7 @@ static int amdgpu_uniras_badpages_read(struct amdgpu_device *adev, if (!bps || !count) return -EINVAL; - output = kmalloc(sizeof(*output), GFP_KERNEL); + output = kmalloc_obj(*output, GFP_KERNEL); if (!output) return -ENOMEM; @@ -2991,7 +2991,7 @@ static int amdgpu_ras_realloc_eh_data_space(struct amdgpu_device *adev, unsigned int old_space = data->count + data->space_left; unsigned int new_space = old_space + pages; unsigned int align_space = ALIGN(new_space, 512); - void *bps = kmalloc_array(align_space, sizeof(*data->bps), GFP_KERNEL); + void *bps = kmalloc_objs(*data->bps, align_space, GFP_KERNEL); if (!bps) { return -ENOMEM; @@ -3238,8 +3238,8 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev, if (from_rom) { err_data.err_addr = - kcalloc(adev->umc.retire_unit, - sizeof(struct eeprom_table_record), GFP_KERNEL); + kzalloc_objs(struct eeprom_table_record, + adev->umc.retire_unit, GFP_KERNEL); if (!err_data.err_addr) { dev_warn(adev->dev, "Failed to alloc UMC error address record in mca2pa conversion!\n"); return -ENOMEM; @@ -3375,7 +3375,7 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev) if (control->ras_num_recs == 0 || amdgpu_bad_page_threshold == 0) return 0; - bps = kcalloc(control->ras_num_recs, sizeof(*bps), GFP_KERNEL); + bps = kzalloc_objs(*bps, control->ras_num_recs, GFP_KERNEL); if (!bps) return -ENOMEM; @@ -3863,7 +3863,7 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev, bool init_bp_info) return 0; data = &con->eh_data; - *data = kzalloc(sizeof(**data), GFP_KERNEL); + *data = kzalloc_obj(**data, GFP_KERNEL); if (!*data) { ret = -ENOMEM; goto out; @@ -4499,7 +4499,7 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev, /* Those are the cached values at init. */ - query_info = kzalloc(sizeof(*query_info), GFP_KERNEL); + query_info = kzalloc_obj(*query_info, GFP_KERNEL); if (!query_info) return -ENOMEM; memcpy(&query_info->head, ras_block, sizeof(struct ras_common_if)); @@ -5188,7 +5188,7 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, if (!adev || !ras_block_obj) return -EINVAL; - ras_node = kzalloc(sizeof(*ras_node), GFP_KERNEL); + ras_node = kzalloc_obj(*ras_node, GFP_KERNEL); if (!ras_node) return -ENOMEM; @@ -5389,7 +5389,7 @@ static struct ras_err_node *amdgpu_ras_error_node_new(void) { struct ras_err_node *err_node; - err_node = kvzalloc(sizeof(*err_node), GFP_KERNEL); + err_node = kvzalloc_obj(*err_node, GFP_KERNEL); if (!err_node) return NULL; @@ -5682,7 +5682,7 @@ int amdgpu_ras_add_critical_region(struct amdgpu_device *adev, /* Record new critical amdgpu bo */ list_for_each_entry(block, &vres->blocks, link) { - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c index 28c4ad62f50e..d3413d1b9fb0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c @@ -276,7 +276,7 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d { struct amdgpu_reset_domain *reset_domain; - reset_domain = kvzalloc(sizeof(struct amdgpu_reset_domain), GFP_KERNEL); + reset_domain = kvzalloc_obj(struct amdgpu_reset_domain, GFP_KERNEL); if (!reset_domain) { DRM_ERROR("Failed to allocate amdgpu_reset_domain!"); return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 129ad5138653..ac71b2d7e139 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -507,13 +507,13 @@ static ssize_t amdgpu_ras_cper_debugfs_read(struct file *f, char __user *buf, const uint8_t ring_header_size = 12; struct amdgpu_ring *ring = file_inode(f)->i_private; struct ras_cmd_cper_snapshot_req *snapshot_req __free(kfree) = - kzalloc(sizeof(struct ras_cmd_cper_snapshot_req), GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_snapshot_req, GFP_KERNEL); struct ras_cmd_cper_snapshot_rsp *snapshot_rsp __free(kfree) = - kzalloc(sizeof(struct ras_cmd_cper_snapshot_rsp), GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_snapshot_rsp, GFP_KERNEL); struct ras_cmd_cper_record_req *record_req __free(kfree) = - kzalloc(sizeof(struct ras_cmd_cper_record_req), GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_record_req, GFP_KERNEL); struct ras_cmd_cper_record_rsp *record_rsp __free(kfree) = - kzalloc(sizeof(struct ras_cmd_cper_record_rsp), GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_record_rsp, GFP_KERNEL); uint8_t *ring_header __free(kfree) = kzalloc(ring_header_size, GFP_KERNEL); uint32_t total_cper_num; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c index 7e7d6c3865bc..7ab8c2ff220a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c @@ -153,7 +153,8 @@ int amdgpu_ring_mux_init(struct amdgpu_ring_mux *mux, struct amdgpu_ring *ring, mux->real_ring = ring; mux->num_ring_entries = 0; - mux->ring_entry = kcalloc(entry_size, sizeof(struct amdgpu_mux_entry), GFP_KERNEL); + mux->ring_entry = kzalloc_objs(struct amdgpu_mux_entry, entry_size, + GFP_KERNEL); if (!mux->ring_entry) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 15d561e3d87f..dd412186c4f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1122,7 +1122,7 @@ int amdgpu_ttm_mmio_remap_alloc_sgt(struct amdgpu_device *adev, phys = adev->rmmio_remap.bus_addr + cur.start; /* Build a single-entry sg_table mapped as I/O (no struct page backing). */ - *sgt = kzalloc(sizeof(**sgt), GFP_KERNEL); + *sgt = kzalloc_obj(**sgt, GFP_KERNEL); if (!*sgt) return -ENOMEM; r = sg_alloc_table(*sgt, 1, GFP_KERNEL); @@ -1172,7 +1172,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo, struct amdgpu_ttm_tt *gtt; enum ttm_caching caching; - gtt = kzalloc(sizeof(struct amdgpu_ttm_tt), GFP_KERNEL); + gtt = kzalloc_obj(struct amdgpu_ttm_tt, GFP_KERNEL); if (!gtt) return NULL; @@ -1213,7 +1213,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev, /* user pages are bound by amdgpu_ttm_tt_pin_userptr() */ if (gtt->userptr) { - ttm->sg = kzalloc(sizeof(struct sg_table), GFP_KERNEL); + ttm->sg = kzalloc_obj(struct sg_table, GFP_KERNEL); if (!ttm->sg) return -ENOMEM; return 0; @@ -1880,9 +1880,9 @@ static int amdgpu_ttm_pools_init(struct amdgpu_device *adev) if (!adev->gmc.is_app_apu || !adev->gmc.num_mem_partitions) return 0; - adev->mman.ttm_pools = kcalloc(adev->gmc.num_mem_partitions, - sizeof(*adev->mman.ttm_pools), - GFP_KERNEL); + adev->mman.ttm_pools = kzalloc_objs(*adev->mman.ttm_pools, + adev->gmc.num_mem_partitions, + GFP_KERNEL); if (!adev->mman.ttm_pools) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c index 3f0b0e9af4f3..8da772ec4b40 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c @@ -58,8 +58,8 @@ int amdgpu_umc_page_retirement_mca(struct amdgpu_device *adev, return ret; err_data.err_addr = - kcalloc(adev->umc.max_ras_err_cnt_per_query, - sizeof(struct eeprom_table_record), GFP_KERNEL); + kzalloc_objs(struct eeprom_table_record, + adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL); if (!err_data.err_addr) { dev_warn(adev->dev, "Failed to alloc memory for umc error record in MCA notifier!\n"); @@ -105,8 +105,8 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev, amdgpu_ras_get_error_query_mode(adev, &error_query_mode); err_data->err_addr = - kcalloc(adev->umc.max_ras_err_cnt_per_query, - sizeof(struct eeprom_table_record), GFP_KERNEL); + kzalloc_objs(struct eeprom_table_record, + adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL); /* still call query_ras_error_address to clear error status * even NOMEM error is encountered @@ -131,8 +131,9 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev, adev->umc.ras->ras_block.hw_ops->query_ras_error_address && adev->umc.max_ras_err_cnt_per_query) { err_data->err_addr = - kcalloc(adev->umc.max_ras_err_cnt_per_query, - sizeof(struct eeprom_table_record), GFP_KERNEL); + kzalloc_objs(struct eeprom_table_record, + adev->umc.max_ras_err_cnt_per_query, + GFP_KERNEL); /* still call query_ras_error_address to clear error status * even NOMEM error is encountered @@ -161,8 +162,9 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev, adev->umc.ras->ecc_info_query_ras_error_address && adev->umc.max_ras_err_cnt_per_query) { err_data->err_addr = - kcalloc(adev->umc.max_ras_err_cnt_per_query, - sizeof(struct eeprom_table_record), GFP_KERNEL); + kzalloc_objs(struct eeprom_table_record, + adev->umc.max_ras_err_cnt_per_query, + GFP_KERNEL); /* still call query_ras_error_address to clear error status * even NOMEM error is encountered @@ -551,8 +553,8 @@ int amdgpu_umc_lookup_bad_pages_in_a_row(struct amdgpu_device *adev, int i, ret; struct ras_err_data err_data; - err_data.err_addr = kcalloc(adev->umc.retire_unit, - sizeof(struct eeprom_table_record), GFP_KERNEL); + err_data.err_addr = kzalloc_objs(struct eeprom_table_record, + adev->umc.retire_unit, GFP_KERNEL); if (!err_data.err_addr) { dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n"); return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index b700c2b91465..97352c56e7a2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -217,7 +217,7 @@ static int amdgpu_userq_buffer_va_list_add(struct amdgpu_usermode_queue *queue, struct amdgpu_userq_va_cursor *va_cursor; struct userq_va_list; - va_cursor = kzalloc(sizeof(*va_cursor), GFP_KERNEL); + va_cursor = kzalloc_obj(*va_cursor, GFP_KERNEL); if (!va_cursor) return -ENOMEM; @@ -781,7 +781,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) goto unlock; } - queue = kzalloc(sizeof(struct amdgpu_usermode_queue), GFP_KERNEL); + queue = kzalloc_obj(struct amdgpu_usermode_queue, GFP_KERNEL); if (!queue) { drm_file_err(uq_mgr->file, "Failed to allocate memory for queue\n"); r = -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 212056d4ddf0..38693bb7f8d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c @@ -82,7 +82,7 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev, unsigned long flags; int r; - fence_drv = kzalloc(sizeof(*fence_drv), GFP_KERNEL); + fence_drv = kzalloc_obj(*fence_drv, GFP_KERNEL); if (!fence_drv) return -ENOMEM; @@ -266,9 +266,8 @@ static int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq, count++; userq_fence->fence_drv_array = - kvmalloc_array(count, - sizeof(struct amdgpu_userq_fence_driver *), - GFP_ATOMIC); + kvmalloc_objs(struct amdgpu_userq_fence_driver *, count, + GFP_ATOMIC); if (userq_fence->fence_drv_array) { xa_for_each(&userq->fence_drv_xa, index, stored_fence_drv) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index f01f38509108..50b75c562281 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -294,15 +294,15 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev) void *bps = NULL; struct amdgpu_bo **bps_bo = NULL; - *data = kmalloc(sizeof(struct amdgpu_virt_ras_err_handler_data), GFP_KERNEL); + *data = kmalloc_obj(struct amdgpu_virt_ras_err_handler_data, GFP_KERNEL); if (!*data) goto data_failure; - bps = kmalloc_array(align_space, sizeof(*(*data)->bps), GFP_KERNEL); + bps = kmalloc_objs(*(*data)->bps, align_space, GFP_KERNEL); if (!bps) goto bps_failure; - bps_bo = kmalloc_array(align_space, sizeof(*(*data)->bps_bo), GFP_KERNEL); + bps_bo = kmalloc_objs(*(*data)->bps_bo, align_space, GFP_KERNEL); if (!bps_bo) goto bps_bo_failure; @@ -966,7 +966,8 @@ int amdgpu_virt_init_critical_region(struct amdgpu_device *adev) } /* Allocate for init_data_hdr */ - init_data_hdr = kzalloc(sizeof(struct amd_sriov_msg_init_data_header), GFP_KERNEL); + init_data_hdr = kzalloc_obj(struct amd_sriov_msg_init_data_header, + GFP_KERNEL); if (!init_data_hdr) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index e548dc9708a2..8931279cdea6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -411,7 +411,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev, struct drm_plane *plane; int ret; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -499,8 +499,9 @@ static int amdgpu_vkms_sw_init(struct amdgpu_ip_block *ip_block) int r, i; struct amdgpu_device *adev = ip_block->adev; - adev->amdgpu_vkms_output = kcalloc(adev->mode_info.num_crtc, - sizeof(struct amdgpu_vkms_output), GFP_KERNEL); + adev->amdgpu_vkms_output = kzalloc_objs(struct amdgpu_vkms_output, + adev->mode_info.num_crtc, + GFP_KERNEL); if (!adev->amdgpu_vkms_output) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9a1db36e73b1..d946c39c4acb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1118,7 +1118,7 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (!drm_dev_enter(adev_to_drm(adev), &idx)) return -ENODEV; - tlb_cb = kmalloc(sizeof(*tlb_cb), GFP_KERNEL); + tlb_cb = kmalloc_obj(*tlb_cb, GFP_KERNEL); if (!tlb_cb) { drm_dev_exit(idx); return -ENOMEM; @@ -1471,7 +1471,7 @@ static void amdgpu_vm_add_prt_cb(struct amdgpu_device *adev, if (!adev->gmc.gmc_funcs->set_prt) return; - cb = kmalloc(sizeof(struct amdgpu_prt_cb), GFP_KERNEL); + cb = kmalloc_obj(struct amdgpu_prt_cb, GFP_KERNEL); if (!cb) { /* Last resort when we are OOM */ if (fence) @@ -1737,7 +1737,7 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev, amdgpu_vm_assert_locked(vm); - bo_va = kzalloc(sizeof(struct amdgpu_bo_va), GFP_KERNEL); + bo_va = kzalloc_obj(struct amdgpu_bo_va, GFP_KERNEL); if (bo_va == NULL) { return NULL; } @@ -1866,7 +1866,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, return -EINVAL; } - mapping = kmalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kmalloc_obj(*mapping, GFP_KERNEL); if (!mapping) return -ENOMEM; @@ -1913,7 +1913,7 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev, return r; /* Allocate all the needed memory */ - mapping = kmalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kmalloc_obj(*mapping, GFP_KERNEL); if (!mapping) return -ENOMEM; @@ -2033,12 +2033,12 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev, eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE; /* Allocate all the needed memory */ - before = kzalloc(sizeof(*before), GFP_KERNEL); + before = kzalloc_obj(*before, GFP_KERNEL); if (!before) return -ENOMEM; INIT_LIST_HEAD(&before->list); - after = kzalloc(sizeof(*after), GFP_KERNEL); + after = kzalloc_obj(*after, GFP_KERNEL); if (!after) { kfree(before); return -ENOMEM; @@ -2533,7 +2533,7 @@ amdgpu_vm_get_task_info_pasid(struct amdgpu_device *adev, u32 pasid) static int amdgpu_vm_create_task_info(struct amdgpu_vm *vm) { - vm->task_info = kzalloc(sizeof(struct amdgpu_task_info), GFP_KERNEL); + vm->task_info = kzalloc_obj(struct amdgpu_task_info, GFP_KERNEL); if (!vm->task_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c index 5d26797356a3..b3e47efeef62 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c @@ -80,7 +80,7 @@ void amdgpu_vm_tlb_fence_create(struct amdgpu_device *adev, struct amdgpu_vm *vm { struct amdgpu_tlb_fence *f; - f = kmalloc(sizeof(*f), GFP_KERNEL); + f = kmalloc_obj(*f, GFP_KERNEL); if (!f) { /* * We can't fail since the PDEs and PTEs are already updated, so diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 9d934c07fa6b..6252246dcd68 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -340,7 +340,7 @@ int amdgpu_vram_mgr_reserve_range(struct amdgpu_vram_mgr *mgr, { struct amdgpu_vram_reservation *rsv; - rsv = kzalloc(sizeof(*rsv), GFP_KERNEL); + rsv = kzalloc_obj(*rsv, GFP_KERNEL); if (!rsv) return -ENOMEM; @@ -478,7 +478,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, tbo->page_alignment); } - vres = kzalloc(sizeof(*vres), GFP_KERNEL); + vres = kzalloc_obj(*vres, GFP_KERNEL); if (!vres) return -ENOMEM; @@ -684,7 +684,7 @@ int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev, int num_entries = 0; int i, r; - *sgt = kmalloc(sizeof(**sgt), GFP_KERNEL); + *sgt = kmalloc_obj(**sgt, GFP_KERNEL); if (!*sgt) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index 73250ab45f20..df5b70c9f911 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@ -334,7 +334,7 @@ int amdgpu_xcp_mgr_init(struct amdgpu_device *adev, int init_mode, if (!xcp_funcs || !xcp_funcs->get_ip_details) return -EINVAL; - xcp_mgr = kzalloc(sizeof(*xcp_mgr), GFP_KERNEL); + xcp_mgr = kzalloc_obj(*xcp_mgr, GFP_KERNEL); if (!xcp_mgr) return -ENOMEM; @@ -907,7 +907,7 @@ static void amdgpu_xcp_cfg_sysfs_init(struct amdgpu_device *adev) if (!adev->xcp_mgr) return; - xcp_cfg = kzalloc(sizeof(*xcp_cfg), GFP_KERNEL); + xcp_cfg = kzalloc_obj(*xcp_cfg, GFP_KERNEL); if (!xcp_cfg) return; xcp_cfg->xcp_mgr = adev->xcp_mgr; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index 0ca6fa40a87c..fe06ab35ba76 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -690,7 +690,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev) goto pro_end; } - hive = kzalloc(sizeof(*hive), GFP_KERNEL); + hive = kzalloc_obj(*hive, GFP_KERNEL); if (!hive) { dev_err(adev->dev, "XGMI: allocation failed\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c index 371ee82a8912..51fa402e8b64 100644 --- a/drivers/gpu/drm/amd/amdgpu/atom.c +++ b/drivers/gpu/drm/amd/amdgpu/atom.c @@ -1524,7 +1524,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios) { int base; struct atom_context *ctx = - kzalloc(sizeof(struct atom_context), GFP_KERNEL); + kzalloc_obj(struct atom_context, GFP_KERNEL); struct _ATOM_ROM_HEADER *atom_rom_header; struct _ATOM_MASTER_DATA_TABLE *master_table; struct _ATOM_FIRMWARE_INFO *atom_fw_info; diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 34644cab6cff..8e0841d3ca75 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -191,7 +191,7 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode goto register_acpi_backlight; } - pdata = kmalloc(sizeof(struct amdgpu_backlight_privdata), GFP_KERNEL); + pdata = kmalloc_obj(struct amdgpu_backlight_privdata, GFP_KERNEL); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -1980,7 +1980,7 @@ amdgpu_atombios_encoder_get_lcd_info(struct amdgpu_encoder *encoder) lvds_info = (union lvds_info *)(mode_info->atom_context->bios + data_offset); lvds = - kzalloc(sizeof(struct amdgpu_encoder_atom_dig), GFP_KERNEL); + kzalloc_obj(struct amdgpu_encoder_atom_dig, GFP_KERNEL); if (!lvds) return NULL; @@ -2107,7 +2107,8 @@ struct amdgpu_encoder_atom_dig * amdgpu_atombios_encoder_get_dig_info(struct amdgpu_encoder *amdgpu_encoder) { int encoder_enum = (amdgpu_encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT; - struct amdgpu_encoder_atom_dig *dig = kzalloc(sizeof(struct amdgpu_encoder_atom_dig), GFP_KERNEL); + struct amdgpu_encoder_atom_dig *dig = kzalloc_obj(struct amdgpu_encoder_atom_dig, + GFP_KERNEL); if (!dig) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 61302204e9b4..de1ccfe584d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -1775,7 +1775,8 @@ static int dce_v10_0_afmt_init(struct amdgpu_device *adev) /* DCE10 has audio blocks tied to DIG encoders */ for (i = 0; i < adev->mode_info.num_dig; i++) { - adev->mode_info.afmt[i] = kzalloc(sizeof(struct amdgpu_afmt), GFP_KERNEL); + adev->mode_info.afmt[i] = kzalloc_obj(struct amdgpu_afmt, + GFP_KERNEL); if (adev->mode_info.afmt[i]) { adev->mode_info.afmt[i]->offset = dig_offsets[i]; adev->mode_info.afmt[i]->id = i; @@ -3516,7 +3517,7 @@ static void dce_v10_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc(sizeof(struct amdgpu_encoder), GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 8f4b4c2e36b9..723a71c8bd38 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -1818,7 +1818,8 @@ static int dce_v6_0_afmt_init(struct amdgpu_device *adev) /* DCE6 has audio blocks tied to DIG encoders */ for (i = 0; i < adev->mode_info.num_dig; i++) { - adev->mode_info.afmt[i] = kzalloc(sizeof(struct amdgpu_afmt), GFP_KERNEL); + adev->mode_info.afmt[i] = kzalloc_obj(struct amdgpu_afmt, + GFP_KERNEL); if (adev->mode_info.afmt[i]) { adev->mode_info.afmt[i]->offset = dig_offsets[i]; adev->mode_info.afmt[i]->id = i; @@ -3413,7 +3414,7 @@ static void dce_v6_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc(sizeof(struct amdgpu_encoder), GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 9d1853c41fcd..0a4a8f0084b1 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -1722,7 +1722,8 @@ static int dce_v8_0_afmt_init(struct amdgpu_device *adev) /* DCE8 has audio blocks tied to DIG encoders */ for (i = 0; i < adev->mode_info.num_dig; i++) { - adev->mode_info.afmt[i] = kzalloc(sizeof(struct amdgpu_afmt), GFP_KERNEL); + adev->mode_info.afmt[i] = kzalloc_obj(struct amdgpu_afmt, + GFP_KERNEL); if (adev->mode_info.afmt[i]) { adev->mode_info.afmt[i]->offset = dig_offsets[i]; adev->mode_info.afmt[i]->id = i; @@ -3424,7 +3425,7 @@ static void dce_v8_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc(sizeof(struct amdgpu_encoder), GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c index b2e87d3aa203..f4f2929c6823 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c @@ -1064,8 +1064,8 @@ static int gmc_v7_0_sw_init(struct amdgpu_ip_block *ip_block) adev->vm_manager.vram_base_offset = 0; } - adev->gmc.vm_fault_info = kmalloc(sizeof(struct kfd_vm_fault_info), - GFP_KERNEL); + adev->gmc.vm_fault_info = kmalloc_obj(struct kfd_vm_fault_info, + GFP_KERNEL); if (!adev->gmc.vm_fault_info) return -ENOMEM; atomic_set_release(&adev->gmc.vm_fault_info_updated, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c index 1d5bd90ac57f..fe61f05af876 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c @@ -1179,8 +1179,8 @@ static int gmc_v8_0_sw_init(struct amdgpu_ip_block *ip_block) adev->vm_manager.vram_base_offset = 0; } - adev->gmc.vm_fault_info = kmalloc(sizeof(struct kfd_vm_fault_info), - GFP_KERNEL); + adev->gmc.vm_fault_info = kmalloc_obj(struct kfd_vm_fault_info, + GFP_KERNEL); if (!adev->gmc.vm_fault_info) return -ENOMEM; atomic_set_release(&adev->gmc.vm_fault_info_updated, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c index 0027a639c7e6..f5785d9c6212 100644 --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c @@ -50,7 +50,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp_base = adev->rmmio_base; - isp->isp_cell = kcalloc(3, sizeof(struct mfd_cell), GFP_KERNEL); + isp->isp_cell = kzalloc_objs(struct mfd_cell, 3, GFP_KERNEL); if (!isp->isp_cell) { r = -ENOMEM; drm_err(&adev->ddev, @@ -59,8 +59,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) } num_res = MAX_ISP410_MEM_RES + MAX_ISP410_INT_SRC; - isp->isp_res = kcalloc(num_res, sizeof(struct resource), - GFP_KERNEL); + isp->isp_res = kzalloc_objs(struct resource, num_res, GFP_KERNEL); if (!isp->isp_res) { r = -ENOMEM; drm_err(&adev->ddev, @@ -68,7 +67,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) goto failure; } - isp->isp_pdata = kzalloc(sizeof(*isp->isp_pdata), GFP_KERNEL); + isp->isp_pdata = kzalloc_obj(*isp->isp_pdata, GFP_KERNEL); if (!isp->isp_pdata) { r = -ENOMEM; drm_err(&adev->ddev, @@ -107,7 +106,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data); /* initialize isp i2c platform data */ - isp->isp_i2c_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL); + isp->isp_i2c_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); if (!isp->isp_i2c_res) { r = -ENOMEM; drm_err(&adev->ddev, @@ -127,7 +126,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp->isp_cell[1].pdata_size = sizeof(struct isp_platform_data); /* initialize isp gpiochip platform data */ - isp->isp_gpio_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL); + isp->isp_gpio_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); if (!isp->isp_gpio_res) { r = -ENOMEM; drm_err(&adev->ddev, diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c index 0002bcc6c4ec..e757087d51d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c @@ -259,7 +259,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) return -EINVAL; } - isp->isp_cell = kcalloc(3, sizeof(struct mfd_cell), GFP_KERNEL); + isp->isp_cell = kzalloc_objs(struct mfd_cell, 3, GFP_KERNEL); if (!isp->isp_cell) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd cell alloc failed (%d)\n", r); @@ -268,15 +268,14 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) num_res = MAX_ISP411_MEM_RES + MAX_ISP411_INT_SRC; - isp->isp_res = kcalloc(num_res, sizeof(struct resource), - GFP_KERNEL); + isp->isp_res = kzalloc_objs(struct resource, num_res, GFP_KERNEL); if (!isp->isp_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd resource alloc failed (%d)\n", r); goto failure; } - isp->isp_pdata = kzalloc(sizeof(*isp->isp_pdata), GFP_KERNEL); + isp->isp_pdata = kzalloc_obj(*isp->isp_pdata, GFP_KERNEL); if (!isp->isp_pdata) { r = -ENOMEM; drm_err(&adev->ddev, "isp platform data alloc failed (%d)\n", r); @@ -318,7 +317,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data); /* initialize isp i2c platform data */ - isp->isp_i2c_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL); + isp->isp_i2c_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); if (!isp->isp_i2c_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd res alloc failed (%d)\n", r); @@ -337,7 +336,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) isp->isp_cell[1].pdata_size = sizeof(struct isp_platform_data); /* initialize isp gpiochip platform data */ - isp->isp_gpio_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL); + isp->isp_gpio_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); if (!isp->isp_gpio_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp gpio resource alloc failed (%d)\n", r); diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c index 9508709abd49..9e9a8e354c06 100644 --- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c +++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c @@ -283,7 +283,7 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, int r; /* Structure to initialize MQD for userqueue using generic MQD init function */ - userq_props = kzalloc(sizeof(struct amdgpu_mqd_prop), GFP_KERNEL); + userq_props = kzalloc_obj(struct amdgpu_mqd_prop, GFP_KERNEL); if (!userq_props) { DRM_ERROR("Failed to allocate memory for userq_props\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c index 2594467bdd87..4de461fa9cdd 100644 --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c @@ -273,7 +273,7 @@ int sienna_cichlid_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc(sizeof(*reset_ctl), GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c index 70569ea906bc..e91e70844e49 100644 --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c @@ -270,7 +270,7 @@ int smu_v13_0_10_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc(sizeof(*reset_ctl), GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c index 0f5b1719fda5..25af2707b5ca 100644 --- a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c @@ -567,7 +567,7 @@ static int umc_v12_0_update_ecc_status(struct amdgpu_device *adev, if (ret) return ret; - ecc_err = kzalloc(sizeof(*ecc_err), GFP_KERNEL); + ecc_err = kzalloc_obj(*ecc_err, GFP_KERNEL); if (!ecc_err) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 732ad1224a61..f8c9ccbc4851 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -780,8 +780,8 @@ static int kfd_ioctl_get_process_apertures_new(struct file *filp, * nodes, but not more than args->num_of_nodes as that is * the amount of memory allocated by user */ - pa = kcalloc(args->num_of_nodes, sizeof(struct kfd_process_device_apertures), - GFP_KERNEL); + pa = kzalloc_objs(struct kfd_process_device_apertures, + args->num_of_nodes, GFP_KERNEL); if (!pa) return -ENOMEM; @@ -2224,7 +2224,8 @@ static int criu_restore_devices(struct kfd_process *p, if (*priv_offset + (args->num_devices * sizeof(*device_privs)) > max_priv_data_size) return -EINVAL; - device_buckets = kmalloc_array(args->num_devices, sizeof(*device_buckets), GFP_KERNEL); + device_buckets = kmalloc_objs(*device_buckets, args->num_devices, + GFP_KERNEL); if (!device_buckets) return -ENOMEM; @@ -2467,7 +2468,7 @@ static int criu_restore_bos(struct kfd_process *p, /* Prevent MMU notifications until stage-4 IOCTL (CRIU_RESUME) is received */ amdgpu_amdkfd_block_mmu_notifications(p->kgd_process_info); - bo_buckets = kvmalloc_array(args->num_bos, sizeof(*bo_buckets), GFP_KERNEL); + bo_buckets = kvmalloc_objs(*bo_buckets, args->num_bos, GFP_KERNEL); if (!bo_buckets) return -ENOMEM; @@ -2485,7 +2486,7 @@ static int criu_restore_bos(struct kfd_process *p, goto exit; } - bo_privs = kvmalloc_array(args->num_bos, sizeof(*bo_privs), GFP_KERNEL); + bo_privs = kvmalloc_objs(*bo_privs, args->num_bos, GFP_KERNEL); if (!bo_privs) { ret = -ENOMEM; goto exit; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c index 9bde2c64540f..46ea876629bc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c @@ -146,7 +146,7 @@ void kfd_debugfs_add_process(struct kfd_process *p) char name[MAX_DEBUGFS_FILENAME_LEN]; struct debugfs_proc_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 9a66ee661e57..d03c3398695b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -478,7 +478,7 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf) return NULL; } - kfd = kzalloc(sizeof(*kfd), GFP_KERNEL); + kfd = kzalloc_obj(*kfd, GFP_KERNEL); if (!kfd) return NULL; @@ -864,7 +864,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, /* Allocate the KFD nodes */ for (i = 0, xcp_idx = 0; i < kfd->num_nodes; i++) { - node = kzalloc(sizeof(struct kfd_node), GFP_KERNEL); + node = kzalloc_obj(struct kfd_node, GFP_KERNEL); if (!node) goto node_alloc_error; @@ -1328,7 +1328,7 @@ int kfd_gtt_sa_allocate(struct kfd_node *node, unsigned int size, if (size > kfd->gtt_sa_num_of_chunks * kfd->gtt_sa_chunk_size) return -ENOMEM; - *mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL); + *mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); if (!(*mem_obj)) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 804851632c4c..7707496761ea 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1401,7 +1401,7 @@ static int register_process(struct device_queue_manager *dqm, uint64_t pd_base; int retval; - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) return -ENOMEM; @@ -2921,7 +2921,7 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_node *dev) pr_debug("Loading device queue manager\n"); - dqm = kzalloc(sizeof(*dqm), GFP_KERNEL); + dqm = kzalloc_obj(*dqm, GFP_KERNEL); if (!dqm) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index 13416bff7763..950717576e20 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -67,7 +67,7 @@ static struct kfd_signal_page *allocate_signal_page(struct kfd_process *p) void *backing_store; struct kfd_signal_page *page; - page = kzalloc(sizeof(*page), GFP_KERNEL); + page = kzalloc_obj(*page, GFP_KERNEL); if (!page) return NULL; @@ -337,7 +337,7 @@ static int kfd_event_page_set(struct kfd_process *p, void *kernel_address, return -EINVAL; } - page = kzalloc(sizeof(*page), GFP_KERNEL); + page = kzalloc_obj(*page, GFP_KERNEL); if (!page) return -ENOMEM; @@ -405,7 +405,7 @@ int kfd_event_create(struct file *devkfd, struct kfd_process *p, uint64_t *event_page_offset, uint32_t *event_slot_index) { int ret = 0; - struct kfd_event *ev = kzalloc(sizeof(*ev), GFP_KERNEL); + struct kfd_event *ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -458,11 +458,11 @@ int kfd_criu_restore_event(struct file *devkfd, struct kfd_event *ev = NULL; int ret = 0; - ev_priv = kmalloc(sizeof(*ev_priv), GFP_KERNEL); + ev_priv = kmalloc_obj(*ev_priv, GFP_KERNEL); if (!ev_priv) return -ENOMEM; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) { ret = -ENOMEM; goto exit; @@ -791,8 +791,8 @@ static struct kfd_event_waiter *alloc_event_waiters(uint32_t num_events) struct kfd_event_waiter *event_waiters; uint32_t i; - event_waiters = kcalloc(num_events, sizeof(struct kfd_event_waiter), - GFP_KERNEL); + event_waiters = kzalloc_objs(struct kfd_event_waiter, num_events, + GFP_KERNEL); if (!event_waiters) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index d987ff7ccfc9..9e28dda09285 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c @@ -309,7 +309,7 @@ struct kernel_queue *kernel_queue_init(struct kfd_node *dev, { struct kernel_queue *kq; - kq = kzalloc(sizeof(*kq), GFP_KERNEL); + kq = kzalloc_obj(*kq, GFP_KERNEL); if (!kq) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c index d88d0de58edd..93f389ba8cc9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c @@ -51,7 +51,7 @@ struct kfd_mem_obj *allocate_hiq_mqd(struct mqd_manager *mm, struct queue_proper struct kfd_mem_obj *mqd_mem_obj; struct kfd_node *dev = mm->dev; - mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); if (!mqd_mem_obj) return NULL; @@ -69,7 +69,7 @@ struct kfd_mem_obj *allocate_sdma_mqd(struct mqd_manager *mm, struct kfd_node *dev = mm->dev; uint64_t offset; - mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); if (!mqd_mem_obj) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c index 76483d91af98..575aebee8ad1 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c @@ -389,7 +389,7 @@ struct mqd_manager *mqd_manager_init_cik(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c index 0186b3de67c0..daf5e487d87e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c @@ -451,7 +451,7 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c index c9e397366782..fd258bbc37b4 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c @@ -465,7 +465,7 @@ struct mqd_manager *mqd_manager_init_v11(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c index 3bbc2648f51d..e826a4149ff0 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c @@ -385,7 +385,7 @@ struct mqd_manager *mqd_manager_init_v12(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c index 0d6b601962eb..6fa17465d3fa 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c @@ -646,7 +646,7 @@ struct mqd_manager *mqd_manager_init_v12_1(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c index 3622d8392cb3..5d3b500a4146 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c @@ -147,7 +147,7 @@ static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, * amdgpu memory functions to do so. */ if (node->kfd->cwsr_enabled && (q->type == KFD_QUEUE_TYPE_COMPUTE)) { - mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); if (!mqd_mem_obj) return NULL; retval = amdgpu_amdkfd_alloc_kernel_mem(node->adev, @@ -960,7 +960,7 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c index e63ef6442b35..27875d88a5ea 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c @@ -446,7 +446,7 @@ struct mqd_manager *mqd_manager_init_vi(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc(sizeof(*mqd), GFP_KERNEL); + mqd = kzalloc_obj(*mqd, GFP_KERNEL); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 9849b54f54ba..a5f479af3607 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -91,7 +91,7 @@ /* Macro for allocating structures */ #define kfd_alloc_struct(ptr_to_struct) \ - ((typeof(ptr_to_struct)) kzalloc(sizeof(*ptr_to_struct), GFP_KERNEL)) + ((typeof(ptr_to_struct)) kzalloc_obj(*ptr_to_struct, GFP_KERNEL)) #define KFD_MAX_NUM_OF_PROCESSES 512 #define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024 diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 8dc6ca8e9062..ff64bde0acd2 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -153,7 +153,7 @@ static void kfd_sdma_activity_worker(struct work_struct *work) (q->properties.type != KFD_QUEUE_TYPE_SDMA_XGMI)) continue; - sdma_q = kzalloc(sizeof(struct temp_sdma_queue_list), GFP_KERNEL); + sdma_q = kzalloc_obj(struct temp_sdma_queue_list, GFP_KERNEL); if (!sdma_q) { dqm_unlock(dqm); goto cleanup; @@ -291,7 +291,8 @@ static int kfd_get_cu_occupancy(struct attribute *attr, char *buffer) wave_cnt = 0; max_waves_per_cu = 0; - cu_occupancy = kcalloc(AMDGPU_MAX_QUEUES, sizeof(*cu_occupancy), GFP_KERNEL); + cu_occupancy = kzalloc_objs(*cu_occupancy, AMDGPU_MAX_QUEUES, + GFP_KERNEL); if (!cu_occupancy) return -ENOMEM; @@ -1592,7 +1593,7 @@ struct kfd_process *create_process(const struct task_struct *thread, bool primar struct mmu_notifier *mn; int err = -ENOMEM; - process = kzalloc(sizeof(*process), GFP_KERNEL); + process = kzalloc_obj(*process, GFP_KERNEL); if (!process) goto err_alloc_process; @@ -1708,7 +1709,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, if (WARN_ON_ONCE(p->n_pdds >= MAX_GPU_INSTANCE)) return NULL; - pdd = kzalloc(sizeof(*pdd), GFP_KERNEL); + pdd = kzalloc_obj(*pdd, GFP_KERNEL); if (!pdd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index 449be58e884c..dac1f9604d8e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -383,7 +383,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, memset(pdd->proc_ctx_cpu_ptr, 0, AMDGPU_MES_PROC_CTX_SIZE); } - pqn = kzalloc(sizeof(*pqn), GFP_KERNEL); + pqn = kzalloc_obj(*pqn, GFP_KERNEL); if (!pqn) { retval = -ENOMEM; goto err_allocate_pqn; @@ -991,7 +991,7 @@ int kfd_criu_restore_queue(struct kfd_process *p, if (*priv_data_offset + sizeof(*q_data) > max_priv_data_size) return -EINVAL; - q_data = kmalloc(sizeof(*q_data), GFP_KERNEL); + q_data = kmalloc_obj(*q_data, GFP_KERNEL); if (!q_data) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c index d1978e3f68be..1285c70a1c3b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c @@ -70,7 +70,7 @@ int init_queue(struct queue **q, const struct queue_properties *properties) { struct queue *tmp_q; - tmp_q = kzalloc(sizeof(*tmp_q), GFP_KERNEL); + tmp_q = kzalloc_obj(*tmp_q, GFP_KERNEL); if (!tmp_q) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c index d2bc169e84b0..242e58fea05e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c @@ -370,7 +370,7 @@ int kfd_smi_event_open(struct kfd_node *dev, uint32_t *fd) struct kfd_smi_client *client; int ret; - client = kzalloc(sizeof(struct kfd_smi_client), GFP_KERNEL); + client = kzalloc_obj(struct kfd_smi_client, GFP_KERNEL); if (!client) return -ENOMEM; INIT_LIST_HEAD(&client->list); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index fcddb54a439f..e168a74190e3 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -168,7 +168,7 @@ svm_range_dma_map_dev(struct amdgpu_device *adev, struct svm_range *prange, int i, r; if (!addr) { - addr = kvcalloc(prange->npages, sizeof(*addr), GFP_KERNEL); + addr = kvzalloc_objs(*addr, prange->npages, GFP_KERNEL); if (!addr) return -ENOMEM; prange->dma_addr[gpuidx] = addr; @@ -329,7 +329,7 @@ svm_range *svm_range_new(struct svm_range_list *svms, uint64_t start, struct svm_range *prange; struct kfd_process *p; - prange = kzalloc(sizeof(*prange), GFP_KERNEL); + prange = kzalloc_obj(*prange, GFP_KERNEL); if (!prange) return NULL; @@ -539,7 +539,7 @@ static struct svm_range_bo *svm_range_bo_new(void) { struct svm_range_bo *svm_bo; - svm_bo = kzalloc(sizeof(*svm_bo), GFP_KERNEL); + svm_bo = kzalloc_obj(*svm_bo, GFP_KERNEL); if (!svm_bo) return NULL; @@ -1674,7 +1674,7 @@ static int svm_range_validate_and_map(struct mm_struct *mm, int32_t idx; int r = 0; - ctx = kzalloc(sizeof(struct svm_validate_context), GFP_KERNEL); + ctx = kzalloc_obj(struct svm_validate_context, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->process = container_of(prange->svms, struct kfd_process, svms); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 1ccd4514d3ee..8aa86502fceb 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -711,7 +711,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(mem, &dev->mem_props, list) { - mem->kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + mem->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!mem->kobj) return -ENOMEM; ret = kobject_init_and_add(mem->kobj, &mem_type, @@ -732,7 +732,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(cache, &dev->cache_props, list) { - cache->kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + cache->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!cache->kobj) return -ENOMEM; ret = kobject_init_and_add(cache->kobj, &cache_type, @@ -753,7 +753,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(iolink, &dev->io_link_props, list) { - iolink->kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + iolink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!iolink->kobj) return -ENOMEM; ret = kobject_init_and_add(iolink->kobj, &iolink_type, @@ -774,7 +774,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(p2plink, &dev->p2p_link_props, list) { - p2plink->kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + p2plink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!p2plink->kobj) return -ENOMEM; ret = kobject_init_and_add(p2plink->kobj, &iolink_type, @@ -1381,7 +1381,7 @@ static int kfd_build_p2p_node_entry(struct kfd_topology_device *dev, { int ret; - p2plink->kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + p2plink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!p2plink->kobj) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index c3c045c8144f..10bc1d252b1f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -545,13 +545,15 @@ static void schedule_dc_vmin_vmax(struct amdgpu_device *adev, struct dc_stream_state *stream, struct dc_crtc_timing_adjust *adjust) { - struct vupdate_offload_work *offload_work = kzalloc(sizeof(*offload_work), GFP_NOWAIT); + struct vupdate_offload_work *offload_work = kzalloc_obj(*offload_work, + GFP_NOWAIT); if (!offload_work) { drm_dbg_driver(adev_to_drm(adev), "Failed to allocate vupdate_offload_work\n"); return; } - struct dc_crtc_timing_adjust *adjust_copy = kzalloc(sizeof(*adjust_copy), GFP_NOWAIT); + struct dc_crtc_timing_adjust *adjust_copy = kzalloc_obj(*adjust_copy, + GFP_NOWAIT); if (!adjust_copy) { drm_dbg_driver(adev_to_drm(adev), "Failed to allocate adjust_copy\n"); kfree(offload_work); @@ -1023,7 +1025,8 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params) continue; } if (dm->dmub_thread_offload[notify.type] == true) { - dmub_hpd_wrk = kzalloc(sizeof(*dmub_hpd_wrk), GFP_ATOMIC); + dmub_hpd_wrk = kzalloc_obj(*dmub_hpd_wrk, + GFP_ATOMIC); if (!dmub_hpd_wrk) { drm_err(adev_to_drm(adev), "Failed to allocate dmub_hpd_wrk"); return; @@ -1647,7 +1650,8 @@ static struct hpd_rx_irq_offload_work_queue *hpd_rx_irq_create_workqueue(struct int i = 0; struct hpd_rx_irq_offload_work_queue *hpd_rx_offload_wq = NULL; - hpd_rx_offload_wq = kcalloc(max_caps, sizeof(*hpd_rx_offload_wq), GFP_KERNEL); + hpd_rx_offload_wq = kzalloc_objs(*hpd_rx_offload_wq, max_caps, + GFP_KERNEL); if (!hpd_rx_offload_wq) return NULL; @@ -1720,7 +1724,7 @@ dm_allocate_gpu_mem( AMDGPU_GEM_DOMAIN_GTT : AMDGPU_GEM_DOMAIN_VRAM; int ret; - da = kzalloc(sizeof(struct dal_allocation), GFP_KERNEL); + da = kzalloc_obj(struct dal_allocation, GFP_KERNEL); if (!da) return NULL; @@ -2126,7 +2130,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) } if (dc_is_dmub_outbox_supported(adev->dm.dc)) { init_completion(&adev->dm.dmub_aux_transfer_done); - adev->dm.dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_KERNEL); + adev->dm.dmub_notify = kzalloc_obj(struct dmub_notification, + GFP_KERNEL); if (!adev->dm.dmub_notify) { drm_info(adev_to_drm(adev), "fail to allocate adev->dm.dmub_notify"); goto error; @@ -2521,7 +2526,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) } - adev->dm.dmub_srv = kzalloc(sizeof(*adev->dm.dmub_srv), GFP_KERNEL); + adev->dm.dmub_srv = kzalloc_obj(*adev->dm.dmub_srv, GFP_KERNEL); dmub_srv = adev->dm.dmub_srv; if (!dmub_srv) { @@ -2602,8 +2607,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) memory_params.region_info = ®ion_info; memory_params.window_memory_type = window_memory_type; - adev->dm.dmub_fb_info = - kzalloc(sizeof(*adev->dm.dmub_fb_info), GFP_KERNEL); + adev->dm.dmub_fb_info = kzalloc_obj(*adev->dm.dmub_fb_info, GFP_KERNEL); fb_info = adev->dm.dmub_fb_info; if (!fb_info) { @@ -3359,7 +3363,7 @@ static void dm_gpureset_commit_state(struct dc_state *dc_state, } *bundle __free(kfree); int k, m; - bundle = kzalloc(sizeof(*bundle), GFP_KERNEL); + bundle = kzalloc_obj(*bundle, GFP_KERNEL); if (!bundle) { drm_err(dm->ddev, "Failed to allocate update bundle\n"); @@ -3927,7 +3931,7 @@ void amdgpu_dm_update_connector_after_detect( if (!aconnector->timing_requested) { aconnector->timing_requested = - kzalloc(sizeof(struct dc_crtc_timing), GFP_KERNEL); + kzalloc_obj(struct dc_crtc_timing, GFP_KERNEL); if (!aconnector->timing_requested) drm_err(dev, "failed to create aconnector->requested_timing\n"); @@ -4156,8 +4160,8 @@ static void handle_hpd_irq(void *param) static void schedule_hpd_rx_offload_work(struct amdgpu_device *adev, struct hpd_rx_irq_offload_work_queue *offload_wq, union hpd_irq_data hpd_irq_data) { - struct hpd_rx_irq_offload_work *offload_work = - kzalloc(sizeof(*offload_work), GFP_KERNEL); + struct hpd_rx_irq_offload_work *offload_work = kzalloc_obj(*offload_work, + GFP_KERNEL); if (!offload_work) { drm_err(adev_to_drm(adev), "Failed to allocate hpd_rx_irq_offload_work.\n"); @@ -4878,7 +4882,7 @@ dm_atomic_duplicate_state(struct drm_private_obj *obj) { struct dm_atomic_state *old_state, *new_state; - new_state = kzalloc(sizeof(*new_state), GFP_KERNEL); + new_state = kzalloc_obj(*new_state, GFP_KERNEL); if (!new_state) return NULL; @@ -4935,7 +4939,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) /* indicates support for immediate flip */ adev_to_drm(adev)->mode_config.async_page_flip = true; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; @@ -5363,7 +5367,7 @@ static int initialize_plane(struct amdgpu_display_manager *dm, unsigned long possible_crtcs; int ret = 0; - plane = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); + plane = kzalloc_obj(struct drm_plane, GFP_KERNEL); if (!plane) { drm_err(adev_to_drm(dm->adev), "KMS: Failed to allocate plane\n"); return -ENOMEM; @@ -5602,7 +5606,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) link = dc_get_link_at_index(dm->dc, i); if (link->connector_signal == SIGNAL_TYPE_VIRTUAL) { - struct amdgpu_dm_wb_connector *wbcon = kzalloc(sizeof(*wbcon), GFP_KERNEL); + struct amdgpu_dm_wb_connector *wbcon = kzalloc_obj(*wbcon, + GFP_KERNEL); if (!wbcon) { drm_err(adev_to_drm(adev), "KMS: Failed to allocate writeback connector\n"); @@ -5621,11 +5626,11 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) continue; } - aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL); + aconnector = kzalloc_obj(*aconnector, GFP_KERNEL); if (!aconnector) goto fail; - aencoder = kzalloc(sizeof(*aencoder), GFP_KERNEL); + aencoder = kzalloc_obj(*aencoder, GFP_KERNEL); if (!aencoder) goto fail; @@ -7819,7 +7824,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) kfree(state); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) { state->scaling = RMX_OFF; @@ -9094,7 +9099,7 @@ static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap, if (!ddc_service->ddc_pin) return result; - cmd.payloads = kcalloc(num, sizeof(struct i2c_payload), GFP_KERNEL); + cmd.payloads = kzalloc_objs(struct i2c_payload, num, GFP_KERNEL); if (!cmd.payloads) return result; @@ -9143,7 +9148,7 @@ create_i2c(struct ddc_service *ddc_service, bool oem) struct amdgpu_device *adev = ddc_service->ctx->driver_context; struct amdgpu_i2c_adapter *i2c; - i2c = kzalloc(sizeof(struct amdgpu_i2c_adapter), GFP_KERNEL); + i2c = kzalloc_obj(struct amdgpu_i2c_adapter, GFP_KERNEL); if (!i2c) return NULL; i2c->base.owner = THIS_MODULE; @@ -9944,7 +9949,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, struct dc_stream_update stream_update; } *bundle; - bundle = kzalloc(sizeof(*bundle), GFP_KERNEL); + bundle = kzalloc_obj(*bundle, GFP_KERNEL); if (!bundle) { drm_err(dev, "Failed to allocate update bundle\n"); @@ -10619,7 +10624,7 @@ static void dm_set_writeback(struct amdgpu_display_manager *dm, struct amdgpu_framebuffer *afb; int i = 0; - wb_info = kzalloc(sizeof(*wb_info), GFP_KERNEL); + wb_info = kzalloc_obj(*wb_info, GFP_KERNEL); if (!wb_info) { drm_err(adev_to_drm(adev), "Failed to allocate wb_info\n"); return; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index 20a76d81d532..76405a351111 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -1227,7 +1227,7 @@ int amdgpu_dm_check_crtc_color_mgmt(struct dm_crtc_state *crtc, crtc->cm_is_degamma_srgb = false; if (check_only) { - out_tf = kvzalloc(sizeof(*out_tf), GFP_KERNEL); + out_tf = kvzalloc_obj(*out_tf, GFP_KERNEL); if (!out_tf) return -ENOMEM; } else { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c index a2de3bba8346..2f072167bcc5 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c @@ -66,7 +66,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr memset(ops, 0, sizeof(ops)); /* 1D curve - DEGAM TF */ - ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -83,7 +83,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* Multiplier */ - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -98,7 +98,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3x4 matrix */ - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -114,7 +114,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr if (adev->dm.dc->caps.color.dpp.hw_3d_lut) { /* 1D curve - SHAPER TF */ - ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -131,7 +131,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 1D LUT - SHAPER LUT */ - ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -148,7 +148,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3D LUT */ - ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -166,7 +166,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr } /* 1D curve - BLND TF */ - ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -183,7 +183,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 1D LUT - BLND LUT */ - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); if (!ops[i]) { ret = -ENOMEM; goto cleanup; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c index 1b03f2bf8d7a..212f613fad1e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c @@ -958,9 +958,8 @@ void amdgpu_dm_crtc_secure_display_create_contexts(struct amdgpu_device *adev) struct secure_display_crtc_context *crtc_ctx = NULL; int i; - crtc_ctx = kcalloc(adev->mode_info.num_crtc, - sizeof(struct secure_display_crtc_context), - GFP_KERNEL); + crtc_ctx = kzalloc_objs(struct secure_display_crtc_context, + adev->mode_info.num_crtc, GFP_KERNEL); if (!crtc_ctx) { adev->dm.secure_display_ctx.crtc_ctx = NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 9fcd72d87d25..49f68ddcfec8 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -231,7 +231,7 @@ struct idle_workqueue *idle_create_workqueue(struct amdgpu_device *adev) { struct idle_workqueue *idle_work; - idle_work = kzalloc(sizeof(*idle_work), GFP_KERNEL); + idle_work = kzalloc_obj(*idle_work, GFP_KERNEL); if (ZERO_OR_NULL_PTR(idle_work)) return NULL; @@ -392,7 +392,7 @@ static inline int amdgpu_dm_crtc_set_vblank(struct drm_crtc *crtc, bool enable) return 0; if (dm->vblank_control_workqueue) { - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return -ENOMEM; @@ -447,7 +447,7 @@ static struct drm_crtc_state *amdgpu_dm_crtc_duplicate_state(struct drm_crtc *cr if (WARN_ON(!crtc->state)) return NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -487,7 +487,7 @@ static void amdgpu_dm_crtc_reset_state(struct drm_crtc *crtc) if (crtc->state) amdgpu_dm_crtc_destroy_state(crtc, crtc->state); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (WARN_ON(!state)) return; @@ -728,14 +728,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, bool has_degamma; int res = -ENOMEM; - cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL); + cursor_plane = kzalloc_obj(*cursor_plane, GFP_KERNEL); if (!cursor_plane) goto fail; cursor_plane->type = DRM_PLANE_TYPE_CURSOR; res = amdgpu_dm_plane_init(dm, cursor_plane, 0, NULL); - acrtc = kzalloc(sizeof(struct amdgpu_crtc), GFP_KERNEL); + acrtc = kzalloc_obj(struct amdgpu_crtc, GFP_KERNEL); if (!acrtc) goto fail; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index d6d43f1bf6d2..b43ec19848fd 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -4301,7 +4301,7 @@ static ssize_t dcc_en_bits_read( int *dcc_en_bits; int i, r; - dcc_en_bits = kcalloc(num_pipes, sizeof(int), GFP_KERNEL); + dcc_en_bits = kzalloc_objs(int, num_pipes, GFP_KERNEL); if (!dcc_en_bits) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c index a10401675f53..3b26797c9d03 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c @@ -746,7 +746,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct hdcp_workqueue *hdcp_work; int i = 0; - hdcp_work = kcalloc(max_caps, sizeof(*hdcp_work), GFP_KERNEL); + hdcp_work = kzalloc_objs(*hdcp_work, max_caps, GFP_KERNEL); if (ZERO_OR_NULL_PTR(hdcp_work)) return NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index bf2a356b3475..d26003d2a2cc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -617,7 +617,7 @@ bool dm_helpers_submit_i2c( return false; } - msgs = kcalloc(num, sizeof(struct i2c_msg), GFP_KERNEL); + msgs = kzalloc_objs(struct i2c_msg, num, GFP_KERNEL); if (!msgs) return false; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c index 5948e2a6219e..dfb80689d889 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c @@ -313,7 +313,7 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev, if (false == validate_irq_registration_params(int_params, ih)) return DAL_INVALID_IRQ_HANDLER_IDX; - handler_data = kzalloc(sizeof(*handler_data), GFP_KERNEL); + handler_data = kzalloc_obj(*handler_data, GFP_KERNEL); if (!handler_data) { DRM_ERROR("DM_IRQ: failed to allocate irq handler!\n"); return DAL_INVALID_IRQ_HANDLER_IDX; @@ -594,7 +594,7 @@ static void amdgpu_dm_irq_schedule_work(struct amdgpu_device *adev, handler_data = container_of(handler_list->next, struct amdgpu_dm_irq_handler_data, list); /*allocate a new amdgpu_dm_irq_handler_data*/ - handler_data_add = kzalloc(sizeof(*handler_data), GFP_ATOMIC); + handler_data_add = kzalloc_obj(*handler_data, GFP_ATOMIC); if (!handler_data_add) { DRM_ERROR("DM_IRQ: failed to allocate irq handler!\n"); return; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 5e92eaa67aa3..781163d6b23b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -640,7 +640,7 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_connector *connector; int i; - aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL); + aconnector = kzalloc_obj(*aconnector, GFP_KERNEL); if (!aconnector) return NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 198064acf9f6..c50583a05ce3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1470,7 +1470,7 @@ static void amdgpu_dm_plane_drm_plane_reset(struct drm_plane *plane) if (plane->state) plane->funcs->atomic_destroy_state(plane, plane->state); - amdgpu_state = kzalloc(sizeof(*amdgpu_state), GFP_KERNEL); + amdgpu_state = kzalloc_obj(*amdgpu_state, GFP_KERNEL); WARN_ON(amdgpu_state == NULL); if (!amdgpu_state) @@ -1488,7 +1488,7 @@ static struct drm_plane_state *amdgpu_dm_plane_drm_plane_duplicate_state(struct struct dm_plane_state *dm_plane_state, *old_dm_plane_state; old_dm_plane_state = to_dm_plane_state(plane->state); - dm_plane_state = kzalloc(sizeof(*dm_plane_state), GFP_KERNEL); + dm_plane_state = kzalloc_obj(*dm_plane_state, GFP_KERNEL); if (!dm_plane_state) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c index 4da5adab799c..dbc4c2e0e514 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c @@ -120,19 +120,21 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; - yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); + yclk = kzalloc_objs(*yclk, 3, GFP_KERNEL); if (!yclk) return; - sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); + sclk = kzalloc_objs(*sclk, 8, GFP_KERNEL); if (!sclk) goto free_yclk; - tiling_mode = kcalloc(maximum_number_of_surfaces, sizeof(*tiling_mode), GFP_KERNEL); + tiling_mode = kzalloc_objs(*tiling_mode, maximum_number_of_surfaces, + GFP_KERNEL); if (!tiling_mode) goto free_sclk; - surface_type = kcalloc(maximum_number_of_surfaces, sizeof(*surface_type), GFP_KERNEL); + surface_type = kzalloc_objs(*surface_type, maximum_number_of_surfaces, + GFP_KERNEL); if (!surface_type) goto free_tiling_mode; @@ -2049,11 +2051,11 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id); - dceip = kzalloc(sizeof(*dceip), GFP_KERNEL); + dceip = kzalloc_obj(*dceip, GFP_KERNEL); if (!dceip) return; - vbios = kzalloc(sizeof(*vbios), GFP_KERNEL); + vbios = kzalloc_obj(*vbios, GFP_KERNEL); if (!vbios) { kfree(dceip); return; @@ -3045,8 +3047,8 @@ bool bw_calcs(struct dc_context *ctx, int pipe_count, struct dce_bw_output *calcs_output) { - struct bw_calcs_data *data = kzalloc(sizeof(struct bw_calcs_data), - GFP_KERNEL); + struct bw_calcs_data *data = kzalloc_obj(struct bw_calcs_data, + GFP_KERNEL); if (!data) return false; diff --git a/drivers/gpu/drm/amd/display/dc/basics/vector.c b/drivers/gpu/drm/amd/display/dc/basics/vector.c index b413a672c2c0..8f6b780b7778 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/vector.c +++ b/drivers/gpu/drm/amd/display/dc/basics/vector.c @@ -94,7 +94,7 @@ struct vector *dal_vector_presized_create( void *initial_value, uint32_t struct_size) { - struct vector *vector = kzalloc(sizeof(struct vector), GFP_KERNEL); + struct vector *vector = kzalloc_obj(struct vector, GFP_KERNEL); if (vector == NULL) return NULL; @@ -113,7 +113,7 @@ struct vector *dal_vector_create( uint32_t capacity, uint32_t struct_size) { - struct vector *vector = kzalloc(sizeof(struct vector), GFP_KERNEL); + struct vector *vector = kzalloc_obj(struct vector, GFP_KERNEL); if (vector == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c index 9f11e6ca4051..65993314c5cd 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c @@ -98,7 +98,7 @@ struct dc_bios *bios_parser_create( { struct bios_parser *bp; - bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL); + bp = kzalloc_obj(struct bios_parser, GFP_KERNEL); if (!bp) return NULL; @@ -2667,7 +2667,7 @@ static struct integrated_info *bios_parser_create_integrated_info( struct bios_parser *bp = BP_FROM_DCB(dcb); struct integrated_info *info; - info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL); + info = kzalloc_obj(struct integrated_info, GFP_KERNEL); if (info == NULL) { ASSERT_CRITICAL(0); diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c index 550a9f1d03f8..9da95c59a68b 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c @@ -3207,7 +3207,7 @@ static struct integrated_info *bios_parser_create_integrated_info( struct bios_parser *bp = BP_FROM_DCB(dcb); struct integrated_info *info; - info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL); + info = kzalloc_obj(struct integrated_info, GFP_KERNEL); if (info == NULL) { ASSERT_CRITICAL(0); @@ -3793,7 +3793,7 @@ struct dc_bios *firmware_parser_create( { struct bios_parser *bp; - bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL); + bp = kzalloc_obj(struct bios_parser, GFP_KERNEL); if (!bp) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c index 15cf13ec5302..451d596783e0 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c @@ -151,7 +151,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p switch (asic_id.chip_family) { #if defined(CONFIG_DRM_AMD_DC_SI) case FAMILY_SI: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -163,7 +164,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p #endif case FAMILY_CI: case FAMILY_KV: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -173,7 +175,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p return &clk_mgr->base; } case FAMILY_CZ: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -183,7 +186,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p return &clk_mgr->base; } case FAMILY_VI: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -207,7 +211,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p return &clk_mgr->base; } case FAMILY_AI: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -221,7 +226,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } #if defined(CONFIG_DRM_AMD_DC_FP) case FAMILY_RV: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -249,7 +255,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p return &clk_mgr->base; } case FAMILY_NV: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -276,7 +283,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } case FAMILY_VGH: if (ASICREV_IS_VANGOGH(asic_id.hw_internal_rev)) { - struct clk_mgr_vgh *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_vgh *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -288,7 +296,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p break; case FAMILY_YELLOW_CARP: { - struct clk_mgr_dcn31 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_dcn31 *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -300,7 +309,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } break; case AMDGPU_FAMILY_GC_10_3_6: { - struct clk_mgr_dcn315 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_dcn315 *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -312,7 +322,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } break; case AMDGPU_FAMILY_GC_10_3_7: { - struct clk_mgr_dcn316 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_dcn316 *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -324,7 +335,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } break; case AMDGPU_FAMILY_GC_11_0_0: { - struct clk_mgr_internal *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_internal *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -335,7 +347,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p } case AMDGPU_FAMILY_GC_11_0_1: { - struct clk_mgr_dcn314 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_dcn314 *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); @@ -348,7 +361,8 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p break; case AMDGPU_FAMILY_GC_11_5_0: { - struct clk_mgr_dcn35 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL); + struct clk_mgr_dcn35 *clk_mgr = kzalloc_obj(*clk_mgr, + GFP_KERNEL); if (clk_mgr == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c index ef77fcd164ed..0684d2e68827 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c @@ -561,7 +561,8 @@ void dcn3_clk_mgr_construct( dce_clock_read_ss_info(clk_mgr); - clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL); + clk_mgr->base.bw_params = kzalloc_obj(*clk_mgr->base.bw_params, + GFP_KERNEL); if (!clk_mgr->base.bw_params) { BREAK_TO_DEBUGGER(); return; diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c index 7da7b41bd092..820656aef040 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c @@ -1206,7 +1206,8 @@ void dcn32_clk_mgr_construct( clk_mgr->smu_present = false; - clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL); + clk_mgr->base.bw_params = kzalloc_obj(*clk_mgr->base.bw_params, + GFP_KERNEL); if (!clk_mgr->base.bw_params) { BREAK_TO_DEBUGGER(); return; diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c index 306016c1f109..01c8e2dd64ed 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c @@ -1549,7 +1549,8 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct( struct dccg *dccg) { struct clk_log_info log_info = {0}; - struct dcn401_clk_mgr *clk_mgr401 = kzalloc(sizeof(struct dcn401_clk_mgr), GFP_KERNEL); + struct dcn401_clk_mgr *clk_mgr401 = kzalloc_obj(struct dcn401_clk_mgr, + GFP_KERNEL); struct clk_mgr_internal *clk_mgr; if (!clk_mgr401) @@ -1599,7 +1600,8 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct( clk_mgr->smu_present = false; - clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL); + clk_mgr->base.bw_params = kzalloc_obj(*clk_mgr->base.bw_params, + GFP_KERNEL); if (!clk_mgr->base.bw_params) { BREAK_TO_DEBUGGER(); kfree(clk_mgr401); diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 984b4bc5f53c..e05a6a9d66ff 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -284,7 +284,7 @@ static bool create_links( } for (i = 0; i < num_virtual_links; i++) { - struct dc_link *link = kzalloc(sizeof(*link), GFP_KERNEL); + struct dc_link *link = kzalloc_obj(*link, GFP_KERNEL); struct encoder_init_data enc_init = {0}; if (link == NULL) { @@ -304,7 +304,7 @@ static bool create_links( link->link_id.enum_id = ENUM_ID_1; link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED; link->replay_settings.config.replay_version = DC_REPLAY_VERSION_UNSUPPORTED; - link->link_enc = kzalloc(sizeof(*link->link_enc), GFP_KERNEL); + link->link_enc = kzalloc_obj(*link->link_enc, GFP_KERNEL); if (!link->link_enc) { BREAK_TO_DEBUGGER(); @@ -409,7 +409,7 @@ static void destroy_link_encoders(struct dc *dc) static struct dc_perf_trace *dc_perf_trace_create(void) { - return kzalloc(sizeof(struct dc_perf_trace), GFP_KERNEL); + return kzalloc_obj(struct dc_perf_trace, GFP_KERNEL); } static void dc_perf_trace_destroy(struct dc_perf_trace **perf_trace) @@ -1005,7 +1005,7 @@ static bool dc_construct_ctx(struct dc *dc, { struct dc_context *dc_ctx; - dc_ctx = kzalloc(sizeof(*dc_ctx), GFP_KERNEL); + dc_ctx = kzalloc_obj(*dc_ctx, GFP_KERNEL); if (!dc_ctx) return false; @@ -1023,7 +1023,7 @@ static bool dc_construct_ctx(struct dc *dc, dc_ctx->clk_reg_offsets = init_params->clk_reg_offsets; /* Create logger */ - dc_ctx->logger = kmalloc(sizeof(*dc_ctx->logger), GFP_KERNEL); + dc_ctx->logger = kmalloc_obj(*dc_ctx->logger, GFP_KERNEL); if (!dc_ctx->logger) { kfree(dc_ctx); @@ -1063,7 +1063,7 @@ static bool dc_construct(struct dc *dc, dc->config = init_params->flags; // Allocate memory for the vm_helper - dc->vm_helper = kzalloc(sizeof(struct vm_helper), GFP_KERNEL); + dc->vm_helper = kzalloc_obj(struct vm_helper, GFP_KERNEL); if (!dc->vm_helper) { dm_error("%s: failed to create dc->vm_helper\n", __func__); goto fail; @@ -1071,7 +1071,7 @@ static bool dc_construct(struct dc *dc, memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides)); - dc_dceip = kzalloc(sizeof(*dc_dceip), GFP_KERNEL); + dc_dceip = kzalloc_obj(*dc_dceip, GFP_KERNEL); if (!dc_dceip) { dm_error("%s: failed to create dceip\n", __func__); goto fail; @@ -1079,14 +1079,14 @@ static bool dc_construct(struct dc *dc, dc->bw_dceip = dc_dceip; - dc_vbios = kzalloc(sizeof(*dc_vbios), GFP_KERNEL); + dc_vbios = kzalloc_obj(*dc_vbios, GFP_KERNEL); if (!dc_vbios) { dm_error("%s: failed to create vbios\n", __func__); goto fail; } dc->bw_vbios = dc_vbios; - dcn_soc = kzalloc(sizeof(*dcn_soc), GFP_KERNEL); + dcn_soc = kzalloc_obj(*dcn_soc, GFP_KERNEL); if (!dcn_soc) { dm_error("%s: failed to create dcn_soc\n", __func__); goto fail; @@ -1094,7 +1094,7 @@ static bool dc_construct(struct dc *dc, dc->dcn_soc = dcn_soc; - dcn_ip = kzalloc(sizeof(*dcn_ip), GFP_KERNEL); + dcn_ip = kzalloc_obj(*dcn_ip, GFP_KERNEL); if (!dcn_ip) { dm_error("%s: failed to create dcn_ip\n", __func__); goto fail; @@ -1496,7 +1496,7 @@ static void disable_vbios_mode_if_required( struct dc *dc_create(const struct dc_init_data *init_params) { - struct dc *dc = kzalloc(sizeof(*dc), GFP_KERNEL); + struct dc *dc = kzalloc_obj(*dc, GFP_KERNEL); unsigned int full_pipe_count; if (!dc) @@ -2613,8 +2613,8 @@ bool dc_set_generic_gpio_for_stereo(bool enable, enum gpio_result gpio_result = GPIO_RESULT_NON_SPECIFIC_ERROR; struct gpio_pin_info pin_info; struct gpio *generic; - struct gpio_generic_mux_config *config = kzalloc(sizeof(struct gpio_generic_mux_config), - GFP_KERNEL); + struct gpio_generic_mux_config *config = kzalloc_obj(struct gpio_generic_mux_config, + GFP_KERNEL); if (!config) return false; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c index 455fa5dd1420..0bcd7445fe97 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c @@ -76,7 +76,7 @@ void dc_sink_release(struct dc_sink *sink) struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) { - struct dc_sink *sink = kzalloc(sizeof(*sink), GFP_KERNEL); + struct dc_sink *sink = kzalloc_obj(*sink, GFP_KERNEL); if (NULL == sink) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c index 2de8ef4a58ec..c85b8915bbd3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c @@ -195,7 +195,7 @@ struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *p { struct dc_state *state; - state = kvzalloc(sizeof(struct dc_state), GFP_KERNEL); + state = kvzalloc_obj(struct dc_state, GFP_KERNEL); if (!state) return NULL; @@ -251,8 +251,7 @@ struct dc_state *dc_state_create_copy(struct dc_state *src_state) { struct dc_state *new_state; - new_state = kvmalloc(sizeof(struct dc_state), - GFP_KERNEL); + new_state = kvmalloc_obj(struct dc_state, GFP_KERNEL); if (!new_state) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index 191f6435e7c6..def02e26cb1f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -170,7 +170,7 @@ struct dc_stream_state *dc_create_stream_for_sink( if (sink == NULL) goto fail; - stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL); + stream = kzalloc_obj(struct dc_stream_state, GFP_KERNEL); if (stream == NULL) goto fail; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c index 0971dfa25845..11c237720bd2 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c @@ -85,8 +85,8 @@ uint8_t dc_plane_get_pipe_mask(struct dc_state *dc_state, const struct dc_plane ******************************************************************************/ struct dc_plane_state *dc_create_plane_state(const struct dc *dc) { - struct dc_plane_state *plane_state = kvzalloc(sizeof(*plane_state), - GFP_ATOMIC); + struct dc_plane_state *plane_state = kvzalloc_obj(*plane_state, + GFP_ATOMIC); if (NULL == plane_state) return NULL; @@ -195,7 +195,7 @@ void dc_gamma_release(struct dc_gamma **gamma) struct dc_gamma *dc_create_gamma(void) { - struct dc_gamma *gamma = kvzalloc(sizeof(*gamma), GFP_KERNEL); + struct dc_gamma *gamma = kvzalloc_obj(*gamma, GFP_KERNEL); if (gamma == NULL) goto alloc_fail; @@ -225,7 +225,7 @@ void dc_transfer_func_release(struct dc_transfer_func *tf) struct dc_transfer_func *dc_create_transfer_func(void) { - struct dc_transfer_func *tf = kvzalloc(sizeof(*tf), GFP_KERNEL); + struct dc_transfer_func *tf = kvzalloc_obj(*tf, GFP_KERNEL); if (tf == NULL) goto alloc_fail; @@ -247,7 +247,7 @@ static void dc_3dlut_func_free(struct kref *kref) struct dc_3dlut *dc_create_3dlut_func(void) { - struct dc_3dlut *lut = kvzalloc(sizeof(*lut), GFP_KERNEL); + struct dc_3dlut *lut = kvzalloc_obj(*lut, GFP_KERNEL); if (lut == NULL) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c index e4dd5ca70987..9b70c4e96ffe 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c @@ -60,7 +60,7 @@ static void dc_dmub_srv_handle_failure(struct dc_dmub_srv *dc_dmub_srv) struct dc_dmub_srv *dc_dmub_srv_create(struct dc *dc, struct dmub_srv *dmub) { struct dc_dmub_srv *dc_srv = - kzalloc(sizeof(struct dc_dmub_srv), GFP_KERNEL); + kzalloc_obj(struct dc_dmub_srv, GFP_KERNEL); if (dc_srv == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c index 733b85d450d9..7c578d10cbca 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c @@ -200,7 +200,7 @@ struct dccg *dccg2_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c index 79d14ce19393..b147456a8cd4 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c @@ -70,7 +70,7 @@ struct dccg *dccg201_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c index b48dcafbae66..f14abe712f2d 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c @@ -116,7 +116,7 @@ struct dccg *dccg21_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c index adec7c3c2d49..f264cf2285ce 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c @@ -62,7 +62,7 @@ struct dccg *dccg3_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { @@ -87,7 +87,7 @@ struct dccg *dccg30_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c index fc9bddd94b50..93ff864def88 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c @@ -61,7 +61,7 @@ struct dccg *dccg301_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c index c647dff5234a..5ab0325f3615 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c @@ -863,7 +863,7 @@ struct dccg *dccg31_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c index 2e9c4b13988a..5193883bfb41 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c @@ -392,7 +392,7 @@ struct dccg *dccg314_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c index ce697c3249fb..be44bc057bee 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c @@ -360,7 +360,7 @@ struct dccg *dccg32_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c index 943ec1983076..34414be7efb6 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c @@ -2461,7 +2461,7 @@ struct dccg *dccg35_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c index f1d394560892..9554d24b882b 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c @@ -892,7 +892,7 @@ struct dccg *dccg401_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c index 2dcf394edf22..71bb5794a513 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c @@ -283,7 +283,7 @@ struct abm *dce_abm_create( const struct dce_abm_shift *abm_shift, const struct dce_abm_mask *abm_mask) { - struct dce_abm *abm_dce = kzalloc(sizeof(*abm_dce), GFP_KERNEL); + struct dce_abm *abm_dce = kzalloc_obj(*abm_dce, GFP_KERNEL); if (abm_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c index fcad61c618a1..ba30394b828f 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c @@ -1331,7 +1331,7 @@ struct audio *dce_audio_create( const struct dce_audio_mask *masks ) { - struct dce_audio *audio = kzalloc(sizeof(*audio), GFP_KERNEL); + struct dce_audio *audio = kzalloc_obj(*audio, GFP_KERNEL); if (audio == NULL) { ASSERT_CRITICAL(audio); @@ -1357,7 +1357,7 @@ struct audio *dce60_audio_create( const struct dce_audio_mask *masks ) { - struct dce_audio *audio = kzalloc(sizeof(*audio), GFP_KERNEL); + struct dce_audio *audio = kzalloc_obj(*audio, GFP_KERNEL); if (audio == NULL) { ASSERT_CRITICAL(audio); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c index e7acd6eec1fd..405758106101 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c @@ -848,7 +848,7 @@ struct clk_mgr *dce_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc(sizeof(*clk_mgr_dce), GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -871,7 +871,7 @@ struct clk_mgr *dce110_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc(sizeof(*clk_mgr_dce), GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -896,7 +896,7 @@ struct clk_mgr *dce112_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc(sizeof(*clk_mgr_dce), GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -917,7 +917,7 @@ struct clk_mgr *dce112_clk_mgr_create( struct clk_mgr *dce120_clk_mgr_create(struct dc_context *ctx) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc(sizeof(*clk_mgr_dce), GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -939,8 +939,7 @@ struct clk_mgr *dce120_clk_mgr_create(struct dc_context *ctx) struct clk_mgr *dce121_clk_mgr_create(struct dc_context *ctx) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc(sizeof(*clk_mgr_dce), - GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c index b4f5b4a6331a..2b242df1b952 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c @@ -1476,16 +1476,14 @@ static void get_ss_info_from_atombios( if (*ss_entries_num == 0) return; - ss_info = kcalloc(*ss_entries_num, - sizeof(struct spread_spectrum_info), - GFP_KERNEL); + ss_info = kzalloc_objs(struct spread_spectrum_info, *ss_entries_num, + GFP_KERNEL); ss_info_cur = ss_info; if (ss_info == NULL) return; - ss_data = kcalloc(*ss_entries_num, - sizeof(struct spread_spectrum_data), - GFP_KERNEL); + ss_data = kzalloc_objs(struct spread_spectrum_data, *ss_entries_num, + GFP_KERNEL); if (ss_data == NULL) goto out_free_info; diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c index 5f8fba45d98d..dd33218dcbab 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c @@ -1105,7 +1105,7 @@ struct dmcu *dce_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1126,7 +1126,7 @@ struct dmcu *dcn10_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1147,7 +1147,7 @@ struct dmcu *dcn20_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1168,7 +1168,7 @@ struct dmcu *dcn21_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c index 3b9011ef9b68..11ba6e59f5b5 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c @@ -222,7 +222,7 @@ struct abm *dmub_abm_create( const struct dce_abm_mask *abm_mask) { if (ctx->dc->caps.dmcub_support) { - struct dce_abm *abm_dce = kzalloc(sizeof(*abm_dce), GFP_KERNEL); + struct dce_abm *abm_dce = kzalloc_obj(*abm_dce, GFP_KERNEL); if (abm_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c index 87af4fdc04a6..4527e35a0666 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c @@ -488,7 +488,7 @@ static void dmub_psr_construct(struct dmub_psr *psr, struct dc_context *ctx) */ struct dmub_psr *dmub_psr_create(struct dc_context *ctx) { - struct dmub_psr *psr = kzalloc(sizeof(struct dmub_psr), GFP_KERNEL); + struct dmub_psr *psr = kzalloc_obj(struct dmub_psr, GFP_KERNEL); if (psr == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c index fd8244c94687..c590c9274f21 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c @@ -438,7 +438,7 @@ static void dmub_replay_construct(struct dmub_replay *replay, struct dc_context */ struct dmub_replay *dmub_replay_create(struct dc_context *ctx) { - struct dmub_replay *replay = kzalloc(sizeof(struct dmub_replay), GFP_KERNEL); + struct dmub_replay *replay = kzalloc_obj(struct dmub_replay, GFP_KERNEL); if (replay == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c index 59a0961b49da..68849d518e76 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c @@ -394,7 +394,7 @@ void dce110_compressor_set_fbc_invalidation_triggers( struct compressor *dce110_compressor_create(struct dc_context *ctx) { struct dce110_compressor *cp110 = - kzalloc(sizeof(struct dce110_compressor), GFP_KERNEL); + kzalloc_obj(struct dce110_compressor, GFP_KERNEL); if (!cp110) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c index faae12cf7968..24effd7d3ea3 100644 --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c @@ -831,7 +831,7 @@ void dce112_compressor_construct(struct dce112_compressor *compressor, struct compressor *dce112_compressor_create(struct dc_context *ctx) { struct dce112_compressor *cp110 = - kzalloc(sizeof(struct dce112_compressor), GFP_KERNEL); + kzalloc_obj(struct dce112_compressor, GFP_KERNEL); if (!cp110) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c index c5d2e9404d94..f30eeda44842 100644 --- a/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c @@ -159,7 +159,7 @@ bool virtual_stream_encoder_construct( struct stream_encoder *virtual_stream_encoder_create( struct dc_context *ctx, struct dc_bios *bp) { - struct stream_encoder *enc = kzalloc(sizeof(*enc), GFP_KERNEL); + struct stream_encoder *enc = kzalloc_obj(*enc, GFP_KERNEL); if (!enc) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c index 03a50c32fcfe..c4b1a337ac92 100644 --- a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c +++ b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c @@ -280,7 +280,7 @@ bool dwb3_ogam_set_input_transfer_func( if (in_transfer_func_dwb_ogam == NULL) return result; - dwb_ogam_lut = kzalloc(sizeof(*dwb_ogam_lut), GFP_KERNEL); + dwb_ogam_lut = kzalloc_obj(*dwb_ogam_lut, GFP_KERNEL); if (dwb_ogam_lut) { cm_helper_translate_curve_to_hw_format(dwbc->ctx, diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c index 8183cdf517b8..4e3a5b3513d8 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c @@ -270,7 +270,7 @@ struct gpio *dal_gpio_create( uint32_t en, enum gpio_pin_output_state output_state) { - struct gpio *gpio = kzalloc(sizeof(struct gpio), GFP_KERNEL); + struct gpio *gpio = kzalloc_obj(struct gpio, GFP_KERNEL); if (!gpio) { ASSERT_CRITICAL(false); diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c index 942d9f0b6df2..fd7be0a35d0f 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c @@ -58,7 +58,7 @@ struct gpio_service *dal_gpio_service_create( struct gpio_service *service; int32_t index_of_id; - service = kzalloc(sizeof(struct gpio_service), GFP_KERNEL); + service = kzalloc_obj(struct gpio_service, GFP_KERNEL); if (!service) { BREAK_TO_DEBUGGER(); @@ -498,7 +498,7 @@ struct ddc *dal_gpio_create_ddc( if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) return NULL; - ddc = kzalloc(sizeof(struct ddc), GFP_KERNEL); + ddc = kzalloc_obj(struct ddc, GFP_KERNEL); if (!ddc) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c index d9e6e70dc394..05fa4119bf55 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c @@ -233,7 +233,7 @@ void dal_hw_ddc_init( *hw_ddc = NULL; } - *hw_ddc = kzalloc(sizeof(struct hw_ddc), GFP_KERNEL); + *hw_ddc = kzalloc_obj(struct hw_ddc, GFP_KERNEL); if (!*hw_ddc) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c index 6cd50232c432..61bbcade18cb 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c @@ -111,7 +111,7 @@ void dal_hw_generic_init( *hw_generic = NULL; } - *hw_generic = kzalloc(sizeof(struct hw_generic), GFP_KERNEL); + *hw_generic = kzalloc_obj(struct hw_generic, GFP_KERNEL); if (!*hw_generic) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c index 01ec451004f7..ee7d794a8c60 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c @@ -132,7 +132,7 @@ void dal_hw_hpd_init( *hw_hpd = NULL; } - *hw_hpd = kzalloc(sizeof(struct hw_hpd), GFP_KERNEL); + *hw_hpd = kzalloc_obj(struct hw_hpd, GFP_KERNEL); if (!*hw_hpd) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c index 5243177c1faa..7083c57da007 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c @@ -2399,7 +2399,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size, DC_LOGGER_INIT(dc_ctx->logger); - hw_crtc_timing = kcalloc(MAX_PIPES, sizeof(*hw_crtc_timing), GFP_KERNEL); + hw_crtc_timing = kzalloc_objs(*hw_crtc_timing, MAX_PIPES, GFP_KERNEL); if (!hw_crtc_timing) return master; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c index bb576a9c5fdb..002210b6bb62 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c @@ -419,8 +419,7 @@ static void dce110_irq_construct(struct irq_service *irq_service, struct irq_service * dal_irq_service_dce110_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c index 33ce470e4c88..47714407252d 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c @@ -257,8 +257,7 @@ static void dce120_irq_construct( struct irq_service *dal_irq_service_dce120_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c b/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c index d777b85e70da..47a2a53979db 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c @@ -355,8 +355,7 @@ static void dce60_irq_construct( struct irq_service *dal_irq_service_dce60_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c index 3a9163acb49b..bad0e02713f8 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c @@ -267,8 +267,7 @@ static void dce80_irq_construct( struct irq_service *dal_irq_service_dce80_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c index 4ce9edd16344..51f3a5042788 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c @@ -369,8 +369,7 @@ static void dcn10_irq_construct( struct irq_service *dal_irq_service_dcn10_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c b/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c index 5847af0e66cb..cd09fa6e6706 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c @@ -374,8 +374,7 @@ static void dcn20_irq_construct( struct irq_service *dal_irq_service_dcn20_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c index 6417011d2246..7ca085b418e3 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c @@ -328,8 +328,7 @@ static void dcn201_irq_construct( struct irq_service *dal_irq_service_dcn201_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c b/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c index 71d2f065140b..67fbcce3409f 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c @@ -402,8 +402,7 @@ static void dcn21_irq_construct( struct irq_service *dal_irq_service_dcn21_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c b/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c index 2a4080bdcf6b..10a16dc17487 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c @@ -411,8 +411,7 @@ static void dcn30_irq_construct( struct irq_service *dal_irq_service_dcn30_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c b/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c index 624f1ac309f8..55c863790402 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c @@ -377,7 +377,7 @@ static void dcn302_irq_construct(struct irq_service *irq_service, struct irq_ser struct irq_service *dal_irq_service_dcn302_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c b/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c index 137caffae916..2ce7c829a445 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c @@ -273,7 +273,7 @@ static void dcn303_irq_construct(struct irq_service *irq_service, struct irq_ser struct irq_service *dal_irq_service_dcn303_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c b/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c index 921cb167d920..710cda204bee 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c @@ -393,8 +393,7 @@ static void dcn31_irq_construct( struct irq_service *dal_irq_service_dcn31_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c b/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c index 0118fd6e5db0..8cb120a3ceb7 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c @@ -395,8 +395,7 @@ static void dcn314_irq_construct( struct irq_service *dal_irq_service_dcn314_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c b/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c index adebfc888618..f3a0f8f176d8 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c @@ -400,8 +400,7 @@ static void dcn315_irq_construct( struct irq_service *dal_irq_service_dcn315_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c b/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c index e9e315c75d76..80b388ac3511 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c @@ -425,8 +425,7 @@ static void dcn32_irq_construct( struct irq_service *dal_irq_service_dcn32_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c b/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c index 79e5e8c137ca..44b3c3b0c657 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c @@ -389,8 +389,7 @@ static void dcn35_irq_construct( struct irq_service *dal_irq_service_dcn35_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c b/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c index 163b8ee9ebf7..e4600282cf18 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c @@ -371,8 +371,7 @@ static void dcn351_irq_construct( struct irq_service *dal_irq_service_dcn351_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c b/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c index f716ab0fd30e..e81077f764df 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c @@ -370,8 +370,7 @@ static void dcn36_irq_construct( struct irq_service *dal_irq_service_dcn36_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c b/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c index fd9bb1950c20..97c80aa30e8b 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c @@ -403,8 +403,7 @@ static void dcn401_irq_construct( struct irq_service *dal_irq_service_dcn401_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc(sizeof(*irq_service), - GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c index 49db8123f08c..e1cf56cdc8c0 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c @@ -302,7 +302,7 @@ static void construct_link_service(struct link_service *link_srv) struct link_service *link_create_link_service(void) { - struct link_service *link_srv = kzalloc(sizeof(*link_srv), GFP_KERNEL); + struct link_service *link_srv = kzalloc_obj(*link_srv, GFP_KERNEL); if (link_srv == NULL) goto fail; @@ -897,8 +897,7 @@ static bool link_construct(struct dc_link *link, struct dc_link *link_create(const struct link_init_data *init_params) { - struct dc_link *link = - kzalloc(sizeof(*link), GFP_KERNEL); + struct dc_link *link = kzalloc_obj(*link, GFP_KERNEL); if (NULL == link) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c index 5d2bcce2f669..1a7c73263615 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c @@ -156,7 +156,7 @@ struct ddc_service *link_create_ddc_service( { struct ddc_service *ddc_service; - ddc_service = kzalloc(sizeof(struct ddc_service), GFP_KERNEL); + ddc_service = kzalloc_obj(struct ddc_service, GFP_KERNEL); if (!ddc_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c b/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c index 72bd43f9bbe2..0df983c70ba3 100644 --- a/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c +++ b/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c @@ -542,7 +542,7 @@ struct pg_cntl *pg_cntl35_create( const struct pg_cntl_shift *pg_cntl_shift, const struct pg_cntl_mask *pg_cntl_mask) { - struct dcn_pg_cntl *pg_cntl_dcn = kzalloc(sizeof(*pg_cntl_dcn), GFP_KERNEL); + struct dcn_pg_cntl *pg_cntl_dcn = kzalloc_obj(*pg_cntl_dcn, GFP_KERNEL); struct pg_cntl *base; if (pg_cntl_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c index 05f7ff60f8f5..e562c71fb432 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c @@ -472,7 +472,7 @@ static struct timing_generator *dce100_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -486,7 +486,7 @@ static struct stream_encoder *dce100_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -520,7 +520,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce100_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -573,8 +573,8 @@ static struct mem_input *dce100_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -597,7 +597,7 @@ static struct transform *dce100_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -610,7 +610,7 @@ static struct transform *dce100_transform_create( static struct input_pixel_processor *dce100_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -634,7 +634,7 @@ static struct link_encoder *dce100_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110) @@ -669,7 +669,7 @@ static struct link_encoder *dce100_link_encoder_create( static struct panel_cntl *dce100_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -688,7 +688,7 @@ static struct output_pixel_processor *dce100_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -703,7 +703,7 @@ static struct dce_aux *dce100_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -741,7 +741,7 @@ static struct dce_i2c_hw *dce100_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -759,7 +759,7 @@ static struct clock_source *dce100_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1215,7 +1215,7 @@ struct resource_pool *dce100_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c index 7c09825cd9bd..68964e8ce10b 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c @@ -516,7 +516,7 @@ static struct timing_generator *dce110_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -530,7 +530,7 @@ static struct stream_encoder *dce110_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -563,7 +563,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce110_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -608,8 +608,8 @@ static struct mem_input *dce110_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -632,7 +632,7 @@ static struct transform *dce110_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -645,7 +645,7 @@ static struct transform *dce110_transform_create( static struct input_pixel_processor *dce110_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -669,7 +669,7 @@ static struct link_encoder *dce110_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -690,7 +690,7 @@ static struct link_encoder *dce110_link_encoder_create( static struct panel_cntl *dce110_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -709,7 +709,7 @@ static struct output_pixel_processor *dce110_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -724,7 +724,7 @@ static struct dce_aux *dce110_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -762,7 +762,7 @@ static struct dce_i2c_hw *dce110_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -780,7 +780,7 @@ static struct clock_source *dce110_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1250,14 +1250,12 @@ static const struct resource_funcs dce110_res_pool_funcs = { static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool) { - struct dce110_timing_generator *dce110_tgv = kzalloc(sizeof(*dce110_tgv), - GFP_KERNEL); - struct dce_transform *dce110_xfmv = kzalloc(sizeof(*dce110_xfmv), - GFP_KERNEL); - struct dce_mem_input *dce110_miv = kzalloc(sizeof(*dce110_miv), - GFP_KERNEL); - struct dce110_opp *dce110_oppv = kzalloc(sizeof(*dce110_oppv), - GFP_KERNEL); + struct dce110_timing_generator *dce110_tgv = kzalloc_obj(*dce110_tgv, + GFP_KERNEL); + struct dce_transform *dce110_xfmv = kzalloc_obj(*dce110_xfmv, + GFP_KERNEL); + struct dce_mem_input *dce110_miv = kzalloc_obj(*dce110_miv, GFP_KERNEL); + struct dce110_opp *dce110_oppv = kzalloc_obj(*dce110_oppv, GFP_KERNEL); if (!dce110_tgv || !dce110_xfmv || !dce110_miv || !dce110_oppv) { kfree(dce110_tgv); @@ -1545,7 +1543,7 @@ struct resource_pool *dce110_create_resource_pool( struct hw_asic_id asic_id) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c index 3f0a6bc4dcc2..9c3f6e96f0ae 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c @@ -497,7 +497,7 @@ static struct timing_generator *dce112_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -511,7 +511,7 @@ static struct stream_encoder *dce112_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -540,7 +540,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce112_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -580,8 +580,8 @@ static struct mem_input *dce112_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -603,7 +603,7 @@ static struct transform *dce112_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -630,7 +630,7 @@ static struct link_encoder *dce112_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -651,7 +651,7 @@ static struct link_encoder *dce112_link_encoder_create( static struct panel_cntl *dce112_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -668,7 +668,7 @@ static struct panel_cntl *dce112_panel_cntl_create(const struct panel_cntl_init_ static struct input_pixel_processor *dce112_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -685,7 +685,7 @@ static struct output_pixel_processor *dce112_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -700,7 +700,7 @@ static struct dce_aux *dce112_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -738,7 +738,7 @@ static struct dce_i2c_hw *dce112_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -756,7 +756,7 @@ static struct clock_source *dce112_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1423,7 +1423,7 @@ struct resource_pool *dce112_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c index 92890784caa6..48f8a418f324 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c @@ -428,7 +428,7 @@ static struct output_pixel_processor *dce120_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -442,7 +442,7 @@ static struct dce_aux *dce120_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -480,7 +480,7 @@ static struct dce_i2c_hw *dce120_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -541,8 +541,7 @@ static struct clock_source *dce120_clock_source_create( const struct dce110_clk_src_regs *regs, bool dp_clk_src) { - struct dce110_clk_src *clk_src = - kzalloc(sizeof(*clk_src), GFP_KERNEL); + struct dce110_clk_src *clk_src = kzalloc_obj(*clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -583,7 +582,7 @@ static struct timing_generator *dce120_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -714,7 +713,7 @@ static struct link_encoder *dce120_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -736,7 +735,7 @@ static struct link_encoder *dce120_link_encoder_create( static struct panel_cntl *dce120_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -753,7 +752,7 @@ static struct panel_cntl *dce120_panel_cntl_create(const struct panel_cntl_init_ static struct input_pixel_processor *dce120_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -770,7 +769,7 @@ static struct stream_encoder *dce120_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -813,7 +812,7 @@ static const struct dce_hwseq_mask dce121_hwseq_mask = { static struct dce_hwseq *dce120_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -827,7 +826,7 @@ static struct dce_hwseq *dce120_hwseq_create( static struct dce_hwseq *dce121_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -875,8 +874,8 @@ static struct mem_input *dce120_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -892,7 +891,7 @@ static struct transform *dce120_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -1296,7 +1295,7 @@ struct resource_pool *dce120_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c index 8d810d5c8781..621739d0b024 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c @@ -507,7 +507,7 @@ static struct timing_generator *dce60_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -521,7 +521,7 @@ static struct output_pixel_processor *dce60_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -536,7 +536,7 @@ static struct dce_aux *dce60_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -574,7 +574,7 @@ static struct dce_i2c_hw *dce60_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -589,7 +589,7 @@ static struct dce_i2c_sw *dce60_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = - kzalloc(sizeof(struct dce_i2c_sw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_sw, GFP_KERNEL); if (!dce_i2c_sw) return NULL; @@ -603,7 +603,7 @@ static struct stream_encoder *dce60_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -638,7 +638,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce60_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -683,8 +683,8 @@ static struct mem_input *dce60_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -707,7 +707,7 @@ static struct transform *dce60_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -730,7 +730,7 @@ static struct link_encoder *dce60_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110) @@ -765,7 +765,7 @@ static struct link_encoder *dce60_link_encoder_create( static struct panel_cntl *dce60_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -787,7 +787,7 @@ static struct clock_source *dce60_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -812,7 +812,7 @@ static void dce60_clock_source_destroy(struct clock_source **clk_src) static struct input_pixel_processor *dce60_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -1098,7 +1098,7 @@ struct resource_pool *dce60_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; @@ -1296,7 +1296,7 @@ struct resource_pool *dce61_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; @@ -1493,7 +1493,7 @@ struct resource_pool *dce64_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c index a68e799d5885..bef4a30caf7e 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c @@ -513,7 +513,7 @@ static struct timing_generator *dce80_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc(sizeof(struct dce110_timing_generator), GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); if (!tg110) return NULL; @@ -527,7 +527,7 @@ static struct output_pixel_processor *dce80_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc(sizeof(struct dce110_opp), GFP_KERNEL); + kzalloc_obj(struct dce110_opp, GFP_KERNEL); if (!opp) return NULL; @@ -542,7 +542,7 @@ static struct dce_aux *dce80_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -580,7 +580,7 @@ static struct dce_i2c_hw *dce80_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -595,7 +595,7 @@ static struct dce_i2c_sw *dce80_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = - kzalloc(sizeof(struct dce_i2c_sw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_sw, GFP_KERNEL); if (!dce_i2c_sw) return NULL; @@ -609,7 +609,7 @@ static struct stream_encoder *dce80_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc(sizeof(struct dce110_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); if (!enc110) return NULL; @@ -644,7 +644,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce80_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -689,8 +689,8 @@ static struct mem_input *dce80_mem_input_create( struct dc_context *ctx, uint32_t inst) { - struct dce_mem_input *dce_mi = kzalloc(sizeof(struct dce_mem_input), - GFP_KERNEL); + struct dce_mem_input *dce_mi = kzalloc_obj(struct dce_mem_input, + GFP_KERNEL); if (!dce_mi) { BREAK_TO_DEBUGGER(); @@ -713,7 +713,7 @@ static struct transform *dce80_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc(sizeof(struct dce_transform), GFP_KERNEL); + kzalloc_obj(struct dce_transform, GFP_KERNEL); if (!transform) return NULL; @@ -736,7 +736,7 @@ static struct link_encoder *dce80_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc(sizeof(struct dce110_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc110) @@ -771,7 +771,7 @@ static struct link_encoder *dce80_link_encoder_create( static struct panel_cntl *dce80_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -793,7 +793,7 @@ static struct clock_source *dce80_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -818,7 +818,7 @@ static void dce80_clock_source_destroy(struct clock_source **clk_src) static struct input_pixel_processor *dce80_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc(sizeof(struct dce_ipp), GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -1109,7 +1109,7 @@ struct resource_pool *dce80_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; @@ -1309,7 +1309,7 @@ struct resource_pool *dce81_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; @@ -1507,7 +1507,7 @@ struct resource_pool *dce83_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c index 476780a5450f..6c066576a5a5 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c @@ -574,7 +574,7 @@ static struct dpp *dcn10_dpp_create( uint32_t inst) { struct dcn10_dpp *dpp = - kzalloc(sizeof(struct dcn10_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn10_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -588,7 +588,7 @@ static struct input_pixel_processor *dcn10_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -605,7 +605,7 @@ static struct output_pixel_processor *dcn10_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_opp *opp = - kzalloc(sizeof(struct dcn10_opp), GFP_KERNEL); + kzalloc_obj(struct dcn10_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -621,7 +621,7 @@ static struct dce_aux *dcn10_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -658,7 +658,7 @@ static struct dce_i2c_hw *dcn10_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -670,8 +670,7 @@ static struct dce_i2c_hw *dcn10_i2c_hw_create(struct dc_context *ctx, } static struct mpc *dcn10_mpc_create(struct dc_context *ctx) { - struct dcn10_mpc *mpc10 = kzalloc(sizeof(struct dcn10_mpc), - GFP_KERNEL); + struct dcn10_mpc *mpc10 = kzalloc_obj(struct dcn10_mpc, GFP_KERNEL); if (!mpc10) return NULL; @@ -687,8 +686,8 @@ static struct mpc *dcn10_mpc_create(struct dc_context *ctx) static struct hubbub *dcn10_hubbub_create(struct dc_context *ctx) { - struct dcn10_hubbub *dcn10_hubbub = kzalloc(sizeof(struct dcn10_hubbub), - GFP_KERNEL); + struct dcn10_hubbub *dcn10_hubbub = kzalloc_obj(struct dcn10_hubbub, + GFP_KERNEL); if (!dcn10_hubbub) return NULL; @@ -706,7 +705,7 @@ static struct timing_generator *dcn10_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -739,7 +738,7 @@ static struct link_encoder *dcn10_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn10_link_encoder *enc10 = - kzalloc(sizeof(struct dcn10_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn10_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc10 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -763,7 +762,7 @@ static struct link_encoder *dcn10_link_encoder_create( static struct panel_cntl *dcn10_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -785,7 +784,7 @@ static struct clock_source *dcn10_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -821,7 +820,7 @@ static struct stream_encoder *dcn10_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); if (!enc1) return NULL; @@ -847,7 +846,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn10_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -891,7 +890,7 @@ static void dcn10_clock_source_destroy(struct clock_source **clk_src) static struct pp_smu_funcs *dcn10_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc(sizeof(*pp_smu), GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); if (!pp_smu) return pp_smu; @@ -984,7 +983,7 @@ static struct hubp *dcn10_hubp_create( uint32_t inst) { struct dcn10_hubp *hubp1 = - kzalloc(sizeof(struct dcn10_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn10_hubp, GFP_KERNEL); if (!hubp1) return NULL; @@ -1681,7 +1680,7 @@ struct resource_pool *dcn10_create_resource_pool( struct dc *dc) { struct dcn10_resource_pool *pool = - kzalloc(sizeof(struct dcn10_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn10_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c index 6731544f0981..ba83a78f7fc1 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c @@ -736,7 +736,7 @@ struct dpp *dcn20_dpp_create( uint32_t inst) { struct dcn20_dpp *dpp = - kzalloc(sizeof(struct dcn20_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn20_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -754,7 +754,7 @@ struct input_pixel_processor *dcn20_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -771,7 +771,7 @@ struct output_pixel_processor *dcn20_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -788,7 +788,7 @@ struct dce_aux *dcn20_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -826,7 +826,7 @@ struct dce_i2c_hw *dcn20_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -838,7 +838,7 @@ struct dce_i2c_hw *dcn20_i2c_hw_create( } struct mpc *dcn20_mpc_create(struct dc_context *ctx) { - struct dcn20_mpc *mpc20 = kzalloc(sizeof(struct dcn20_mpc), GFP_KERNEL); + struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc, GFP_KERNEL); if (!mpc20) return NULL; @@ -855,7 +855,8 @@ struct mpc *dcn20_mpc_create(struct dc_context *ctx) struct hubbub *dcn20_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub = kzalloc(sizeof(struct dcn20_hubbub), GFP_KERNEL); + struct dcn20_hubbub *hubbub = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub) return NULL; @@ -883,7 +884,7 @@ struct timing_generator *dcn20_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -917,7 +918,7 @@ struct link_encoder *dcn20_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -941,7 +942,7 @@ struct link_encoder *dcn20_link_encoder_create( static struct panel_cntl *dcn20_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -963,7 +964,7 @@ static struct clock_source *dcn20_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -999,7 +1000,7 @@ struct stream_encoder *dcn20_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); if (!enc1) return NULL; @@ -1031,7 +1032,7 @@ static const struct dce_hwseq_mask hwseq_mask = { struct dce_hwseq *dcn20_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1062,7 +1063,7 @@ struct display_stream_compressor *dcn20_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1199,7 +1200,7 @@ struct hubp *dcn20_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -2130,7 +2131,8 @@ enum dc_status dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, bool voltage_supported; display_e2e_pipe_params_st *pipes; - pipes = kcalloc(dc->res_pool->pipe_count, sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, GFP_KERNEL); if (!pipes) return DC_FAIL_BANDWIDTH_VALIDATE; @@ -2240,8 +2242,8 @@ bool dcn20_dwbc_create(struct dc_context *ctx, struct resource_pool *pool) uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn20_dwbc *dwbc20 = kzalloc(sizeof(struct dcn20_dwbc), - GFP_KERNEL); + struct dcn20_dwbc *dwbc20 = kzalloc_obj(struct dcn20_dwbc, + GFP_KERNEL); if (!dwbc20) { dm_error("DC: failed to create dwbc20!\n"); @@ -2265,8 +2267,8 @@ bool dcn20_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool) ASSERT(pipe_count > 0); for (i = 0; i < pipe_count; i++) { - struct dcn20_mmhubbub *mcif_wb20 = kzalloc(sizeof(struct dcn20_mmhubbub), - GFP_KERNEL); + struct dcn20_mmhubbub *mcif_wb20 = kzalloc_obj(struct dcn20_mmhubbub, + GFP_KERNEL); if (!mcif_wb20) { dm_error("DC: failed to create mcif_wb20!\n"); @@ -2286,7 +2288,7 @@ bool dcn20_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool) static struct pp_smu_funcs *dcn20_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc(sizeof(*pp_smu), GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); if (!pp_smu) return pp_smu; @@ -2766,7 +2768,7 @@ struct resource_pool *dcn20_create_resource_pool( struct dc *dc) { struct dcn20_resource_pool *pool = - kzalloc(sizeof(struct dcn20_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn20_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c index 90d38631f63a..71629186eb30 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c @@ -632,7 +632,7 @@ static struct dpp *dcn201_dpp_create( uint32_t inst) { struct dcn201_dpp *dpp = - kzalloc(sizeof(struct dcn201_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn201_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -649,7 +649,7 @@ static struct input_pixel_processor *dcn201_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); if (!ipp) { return NULL; @@ -665,7 +665,7 @@ static struct output_pixel_processor *dcn201_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn201_opp *opp = - kzalloc(sizeof(struct dcn201_opp), GFP_KERNEL); + kzalloc_obj(struct dcn201_opp, GFP_KERNEL); if (!opp) { return NULL; @@ -680,7 +680,7 @@ static struct dce_aux *dcn201_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -713,7 +713,7 @@ static struct dce_i2c_hw *dcn201_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -726,7 +726,7 @@ static struct dce_i2c_hw *dcn201_i2c_hw_create(struct dc_context *ctx, static struct mpc *dcn201_mpc_create(struct dc_context *ctx, uint32_t num_mpcc) { - struct dcn201_mpc *mpc201 = kzalloc(sizeof(struct dcn201_mpc), GFP_KERNEL); + struct dcn201_mpc *mpc201 = kzalloc_obj(struct dcn201_mpc, GFP_KERNEL); if (!mpc201) return NULL; @@ -742,7 +742,8 @@ static struct mpc *dcn201_mpc_create(struct dc_context *ctx, uint32_t num_mpcc) static struct hubbub *dcn201_hubbub_create(struct dc_context *ctx) { - struct dcn20_hubbub *hubbub = kzalloc(sizeof(struct dcn20_hubbub), GFP_KERNEL); + struct dcn20_hubbub *hubbub = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub) return NULL; @@ -760,7 +761,7 @@ static struct timing_generator *dcn201_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -794,7 +795,7 @@ static struct link_encoder *dcn201_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); struct dcn10_link_encoder *enc10; if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -822,7 +823,7 @@ static struct clock_source *dcn201_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -857,7 +858,7 @@ static struct stream_encoder *dcn201_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); if (!enc1) return NULL; @@ -884,7 +885,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn201_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -984,7 +985,7 @@ static struct hubp *dcn201_hubp_create( uint32_t inst) { struct dcn201_hubp *hubp201 = - kzalloc(sizeof(struct dcn201_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn201_hubp, GFP_KERNEL); if (!hubp201) return NULL; @@ -1305,7 +1306,7 @@ struct resource_pool *dcn201_create_resource_pool( struct dc *dc) { struct dcn201_resource_pool *pool = - kzalloc(sizeof(struct dcn201_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn201_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c index 107612595db6..0e93bc342011 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c @@ -484,7 +484,7 @@ static struct input_pixel_processor *dcn21_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -501,7 +501,7 @@ static struct dpp *dcn21_dpp_create( uint32_t inst) { struct dcn20_dpp *dpp = - kzalloc(sizeof(struct dcn20_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn20_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -520,7 +520,7 @@ static struct dce_aux *dcn21_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -557,7 +557,7 @@ static struct dce_i2c_hw *dcn21_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -930,7 +930,8 @@ static enum dc_status dcn21_validate_bandwidth(struct dc *dc, struct dc_state *c bool voltage_supported; display_e2e_pipe_params_st *pipes; - pipes = kcalloc(dc->res_pool->pipe_count, sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, GFP_KERNEL); if (!pipes) return DC_FAIL_BANDWIDTH_VALIDATE; @@ -959,7 +960,7 @@ static struct clock_source *dcn21_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -980,7 +981,7 @@ static struct hubp *dcn21_hubp_create( uint32_t inst) { struct dcn21_hubp *hubp21 = - kzalloc(sizeof(struct dcn21_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn21_hubp, GFP_KERNEL); if (!hubp21) return NULL; @@ -998,8 +999,8 @@ static struct hubbub *dcn21_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub) return NULL; @@ -1027,7 +1028,7 @@ static struct output_pixel_processor *dcn21_opp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -1043,7 +1044,7 @@ static struct timing_generator *dcn21_timing_generator_create(struct dc_context uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1062,8 +1063,7 @@ static struct timing_generator *dcn21_timing_generator_create(struct dc_context static struct mpc *dcn21_mpc_create(struct dc_context *ctx) { - struct dcn20_mpc *mpc20 = kzalloc(sizeof(struct dcn20_mpc), - GFP_KERNEL); + struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc, GFP_KERNEL); if (!mpc20) return NULL; @@ -1091,7 +1091,7 @@ static struct display_stream_compressor *dcn21_dsc_create(struct dc_context *ctx uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1104,7 +1104,7 @@ static struct display_stream_compressor *dcn21_dsc_create(struct dc_context *ctx static struct pp_smu_funcs *dcn21_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc(sizeof(*pp_smu), GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); if (!pp_smu) return pp_smu; @@ -1141,7 +1141,7 @@ static struct stream_encoder *dcn21_stream_encoder_create(enum engine_id eng_id, struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); if (!enc1) return NULL; @@ -1168,7 +1168,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn21_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1295,7 +1295,7 @@ static struct link_encoder *dcn21_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn21_link_encoder *enc21 = - kzalloc(sizeof(struct dcn21_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn21_link_encoder, GFP_KERNEL); int link_regs_id; if (!enc21 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -1319,7 +1319,7 @@ static struct link_encoder *dcn21_link_encoder_create( static struct panel_cntl *dcn21_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1704,7 +1704,7 @@ struct resource_pool *dcn21_create_resource_pool( struct dc *dc) { struct dcn21_resource_pool *pool = - kzalloc(sizeof(struct dcn21_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn21_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c index 6cfdc37dab58..75aa4b6d7133 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c @@ -753,7 +753,7 @@ static struct dpp *dcn30_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -771,7 +771,7 @@ static struct output_pixel_processor *dcn30_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -788,7 +788,7 @@ static struct dce_aux *dcn30_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -827,7 +827,7 @@ static struct dce_i2c_hw *dcn30_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -843,8 +843,7 @@ static struct mpc *dcn30_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -863,8 +862,8 @@ static struct hubbub *dcn30_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -893,7 +892,7 @@ static struct timing_generator *dcn30_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -927,7 +926,7 @@ static struct link_encoder *dcn30_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -947,7 +946,7 @@ static struct link_encoder *dcn30_link_encoder_create( static struct panel_cntl *dcn30_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -981,7 +980,7 @@ static struct vpg *dcn30_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -998,7 +997,7 @@ static struct afmt *dcn30_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -1027,7 +1026,7 @@ static struct stream_encoder *dcn30_stream_encoder_create(enum engine_id eng_id, } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn30_vpg_create(ctx, vpg_inst); afmt = dcn30_afmt_create(ctx, afmt_inst); @@ -1048,7 +1047,7 @@ static struct stream_encoder *dcn30_stream_encoder_create(enum engine_id eng_id, static struct dce_hwseq *dcn30_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1201,7 +1200,7 @@ static struct hubp *dcn30_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1221,8 +1220,8 @@ static bool dcn30_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1246,8 +1245,8 @@ static bool dcn30_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1269,7 +1268,7 @@ static struct display_stream_compressor *dcn30_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1303,7 +1302,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2048,8 +2047,9 @@ enum dc_status dcn30_validate_bandwidth(struct dc *dc, int vlevel = 0; int pipe_cnt = 0; - display_e2e_pipe_params_st *pipes = kcalloc(dc->res_pool->pipe_count, - sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, + GFP_KERNEL); DC_LOGGER_INIT(dc->ctx->logger); BW_VAL_TRACE_COUNT(); @@ -2622,7 +2622,7 @@ struct resource_pool *dcn30_create_resource_pool( struct dc *dc) { struct dcn30_resource_pool *pool = - kzalloc(sizeof(struct dcn30_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn30_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c index e1d0c166b484..6bced8def669 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c @@ -717,7 +717,7 @@ static void dcn301_dpp_destroy(struct dpp **dpp) static struct dpp *dcn301_dpp_create(struct dc_context *ctx, uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -734,7 +734,7 @@ static struct output_pixel_processor *dcn301_opp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -749,7 +749,7 @@ static struct output_pixel_processor *dcn301_opp_create(struct dc_context *ctx, static struct dce_aux *dcn301_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -783,7 +783,7 @@ static const struct dce_i2c_mask i2c_masks = { static struct dce_i2c_hw *dcn301_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -798,8 +798,7 @@ static struct mpc *dcn301_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -818,8 +817,8 @@ static struct hubbub *dcn301_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -849,7 +848,7 @@ static struct timing_generator *dcn301_timing_generator_create( struct dc_context *ctx, uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -883,7 +882,7 @@ static struct link_encoder *dcn301_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -903,7 +902,7 @@ static struct link_encoder *dcn301_link_encoder_create( static struct panel_cntl *dcn301_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn301_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn301_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn301_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -952,7 +951,7 @@ static struct vpg *dcn301_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -969,7 +968,7 @@ static struct afmt *dcn301_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -998,7 +997,7 @@ static struct stream_encoder *dcn301_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn301_vpg_create(ctx, vpg_inst); afmt = dcn301_afmt_create(ctx, afmt_inst); @@ -1019,7 +1018,7 @@ static struct stream_encoder *dcn301_stream_encoder_create(enum engine_id eng_id static struct dce_hwseq *dcn301_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1161,7 +1160,7 @@ static void dcn301_destruct(struct dcn301_resource_pool *pool) static struct hubp *dcn301_hubp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1181,8 +1180,8 @@ static bool dcn301_dwbc_create(struct dc_context *ctx, struct resource_pool *poo uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1206,8 +1205,8 @@ static bool dcn301_mmhubbub_create(struct dc_context *ctx, struct resource_pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1229,7 +1228,7 @@ static struct display_stream_compressor *dcn301_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1258,7 +1257,7 @@ static struct clock_source *dcn301_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1728,7 +1727,7 @@ struct resource_pool *dcn301_create_resource_pool( struct dc *dc) { struct dcn301_resource_pool *pool = - kzalloc(sizeof(struct dcn301_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn301_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c index c0d4a1dc94f8..1dba37343c0f 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c @@ -257,7 +257,8 @@ static struct hubbub *dcn302_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -299,7 +300,7 @@ static const struct dcn30_vpg_mask vpg_mask = { static struct vpg *dcn302_vpg_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -331,7 +332,7 @@ static const struct dcn30_afmt_mask afmt_mask = { static struct afmt *dcn302_afmt_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -406,7 +407,7 @@ static struct stream_encoder *dcn302_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn302_vpg_create(ctx, vpg_inst); afmt = dcn302_afmt_create(ctx, afmt_inst); @@ -445,7 +446,8 @@ static const struct dce110_clk_src_mask cs_mask = { static struct clock_source *dcn302_clock_source_create(struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { - struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + struct dce110_clk_src *clk_src = kzalloc_obj(struct dce110_clk_src, + GFP_KERNEL); if (!clk_src) return NULL; @@ -474,7 +476,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn302_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -506,7 +508,7 @@ static const struct dcn_hubp2_mask hubp_mask = { static struct hubp *dcn302_hubp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_hubp *hubp2 = kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -540,7 +542,7 @@ static const struct dcn3_dpp_mask tf_mask = { static struct dpp *dcn302_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -574,7 +576,7 @@ static const struct dcn20_opp_mask opp_mask = { static struct output_pixel_processor *dcn302_opp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_opp *opp = kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -606,7 +608,7 @@ static const struct dcn_optc_mask optc_mask = { static struct timing_generator *dcn302_timing_generator_create(struct dc_context *ctx, uint32_t instance) { - struct optc *tgn10 = kzalloc(sizeof(struct optc), GFP_KERNEL); + struct optc *tgn10 = kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -651,7 +653,7 @@ static const struct dcn30_mpc_mask mpc_mask = { static struct mpc *dcn302_mpc_create(struct dc_context *ctx, int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -682,7 +684,7 @@ static const struct dcn20_dsc_mask dsc_mask = { static struct display_stream_compressor *dcn302_dsc_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_dsc *dsc = kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -714,7 +716,8 @@ static bool dcn302_dwbc_create(struct dc_context *ctx, struct resource_pool *poo uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -749,7 +752,8 @@ static bool dcn302_mmhubbub_create(struct dc_context *ctx, struct resource_pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -789,7 +793,8 @@ static const struct dce110_aux_registers_mask aux_mask = { static struct dce_aux *dcn302_aux_engine_create(struct dc_context *ctx, uint32_t inst) { - struct aux_engine_dce110 *aux_engine = kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + struct aux_engine_dce110 *aux_engine = kzalloc_obj(struct aux_engine_dce110, + GFP_KERNEL); if (!aux_engine) return NULL; @@ -820,7 +825,8 @@ static const struct dce_i2c_mask i2c_masks = { static struct dce_i2c_hw *dcn302_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { - struct dce_i2c_hw *dce_i2c_hw = kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + struct dce_i2c_hw *dce_i2c_hw = kzalloc_obj(struct dce_i2c_hw, + GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -894,7 +900,8 @@ static struct link_encoder *dcn302_link_encoder_create( struct dc_context *ctx, const struct encoder_init_data *enc_init_data) { - struct dcn20_link_encoder *enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + struct dcn20_link_encoder *enc20 = kzalloc_obj(struct dcn20_link_encoder, + GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -920,7 +927,8 @@ static const struct dce_panel_cntl_mask panel_cntl_mask = { static struct panel_cntl *dcn302_panel_cntl_create(const struct panel_cntl_init_data *init_data) { - struct dce_panel_cntl *panel_cntl = kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + struct dce_panel_cntl *panel_cntl = kzalloc_obj(struct dce_panel_cntl, + GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1512,7 +1520,8 @@ create_fail: struct resource_pool *dcn302_create_resource_pool(const struct dc_init_data *init_data, struct dc *dc) { - struct resource_pool *pool = kzalloc(sizeof(struct resource_pool), GFP_KERNEL); + struct resource_pool *pool = kzalloc_obj(struct resource_pool, + GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c index 75e09c2c283e..2f81c0b51d1a 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c @@ -253,7 +253,8 @@ static struct hubbub *dcn303_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -292,7 +293,7 @@ static const struct dcn30_vpg_mask vpg_mask = { static struct vpg *dcn303_vpg_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -321,7 +322,7 @@ static const struct dcn30_afmt_mask afmt_mask = { static struct afmt *dcn303_afmt_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -393,7 +394,7 @@ static struct stream_encoder *dcn303_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn303_vpg_create(ctx, vpg_inst); afmt = dcn303_afmt_create(ctx, afmt_inst); @@ -429,7 +430,8 @@ static const struct dce110_clk_src_mask cs_mask = { static struct clock_source *dcn303_clock_source_create(struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { - struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + struct dce110_clk_src *clk_src = kzalloc_obj(struct dce110_clk_src, + GFP_KERNEL); if (!clk_src) return NULL; @@ -458,7 +460,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn303_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -487,7 +489,7 @@ static const struct dcn_hubp2_mask hubp_mask = { static struct hubp *dcn303_hubp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_hubp *hubp2 = kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -518,7 +520,7 @@ static const struct dcn3_dpp_mask tf_mask = { static struct dpp *dcn303_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -549,7 +551,7 @@ static const struct dcn20_opp_mask opp_mask = { static struct output_pixel_processor *dcn303_opp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_opp *opp = kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -578,7 +580,7 @@ static const struct dcn_optc_mask optc_mask = { static struct timing_generator *dcn303_timing_generator_create(struct dc_context *ctx, uint32_t instance) { - struct optc *tgn10 = kzalloc(sizeof(struct optc), GFP_KERNEL); + struct optc *tgn10 = kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -615,7 +617,7 @@ static const struct dcn30_mpc_mask mpc_mask = { static struct mpc *dcn303_mpc_create(struct dc_context *ctx, int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -643,7 +645,7 @@ static const struct dcn20_dsc_mask dsc_mask = { static struct display_stream_compressor *dcn303_dsc_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_dsc *dsc = kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -675,7 +677,8 @@ static bool dcn303_dwbc_create(struct dc_context *ctx, struct resource_pool *poo uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -710,7 +713,8 @@ static bool dcn303_mmhubbub_create(struct dc_context *ctx, struct resource_pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -747,7 +751,8 @@ static const struct dce110_aux_registers_mask aux_mask = { static struct dce_aux *dcn303_aux_engine_create(struct dc_context *ctx, uint32_t inst) { - struct aux_engine_dce110 *aux_engine = kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + struct aux_engine_dce110 *aux_engine = kzalloc_obj(struct aux_engine_dce110, + GFP_KERNEL); if (!aux_engine) return NULL; @@ -775,7 +780,8 @@ static const struct dce_i2c_mask i2c_masks = { static struct dce_i2c_hw *dcn303_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { - struct dce_i2c_hw *dce_i2c_hw = kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + struct dce_i2c_hw *dce_i2c_hw = kzalloc_obj(struct dce_i2c_hw, + GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -839,7 +845,8 @@ static struct link_encoder *dcn303_link_encoder_create( struct dc_context *ctx, const struct encoder_init_data *enc_init_data) { - struct dcn20_link_encoder *enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + struct dcn20_link_encoder *enc20 = kzalloc_obj(struct dcn20_link_encoder, + GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -865,7 +872,8 @@ static const struct dce_panel_cntl_mask panel_cntl_mask = { static struct panel_cntl *dcn303_panel_cntl_create(const struct panel_cntl_init_data *init_data) { - struct dce_panel_cntl *panel_cntl = kzalloc(sizeof(struct dce_panel_cntl), GFP_KERNEL); + struct dce_panel_cntl *panel_cntl = kzalloc_obj(struct dce_panel_cntl, + GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1444,7 +1452,8 @@ create_fail: struct resource_pool *dcn303_create_resource_pool(const struct dc_init_data *init_data, struct dc *dc) { - struct resource_pool *pool = kzalloc(sizeof(struct resource_pool), GFP_KERNEL); + struct resource_pool *pool = kzalloc_obj(struct resource_pool, + GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c index 8ad72557b16a..4fb54637f41e 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c @@ -919,7 +919,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -937,7 +937,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -954,7 +954,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -991,7 +991,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -1006,8 +1006,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -1026,8 +1025,8 @@ static struct hubbub *dcn31_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1059,7 +1058,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1093,7 +1092,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1122,7 +1121,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1139,7 +1138,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1169,7 +1168,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1186,7 +1185,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1205,7 +1204,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1235,7 +1234,7 @@ static struct stream_encoder *dcn31_stream_encoder_create( } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1285,7 +1284,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1311,7 +1311,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1325,7 +1325,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1499,7 +1499,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1519,8 +1519,8 @@ static bool dcn31_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1544,8 +1544,8 @@ static bool dcn31_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1567,7 +1567,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1595,7 +1595,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1771,8 +1771,9 @@ enum dc_status dcn31_validate_bandwidth(struct dc *dc, int vlevel = 0; int pipe_cnt = 0; - display_e2e_pipe_params_st *pipes = kcalloc(dc->res_pool->pipe_count, - sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, + GFP_KERNEL); DC_LOGGER_INIT(dc->ctx->logger); BW_VAL_TRACE_COUNT(); @@ -1866,7 +1867,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2227,7 +2228,7 @@ struct resource_pool *dcn31_create_resource_pool( struct dc *dc) { struct dcn31_resource_pool *pool = - kzalloc(sizeof(struct dcn31_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn31_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c index 5f0fe6e5bd82..8c451d2a040a 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c @@ -955,7 +955,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -973,7 +973,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -990,7 +990,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -1049,7 +1049,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -1064,8 +1064,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -1084,8 +1083,8 @@ static struct hubbub *dcn31_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1117,7 +1116,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1151,7 +1150,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1180,7 +1179,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1197,7 +1196,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1227,7 +1226,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1244,7 +1243,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1263,7 +1262,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1293,7 +1292,7 @@ static struct stream_encoder *dcn314_stream_encoder_create( } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1344,7 +1343,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1370,7 +1370,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1384,7 +1384,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn314_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1557,7 +1557,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1577,8 +1577,8 @@ static bool dcn31_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1602,8 +1602,8 @@ static bool dcn31_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1625,7 +1625,7 @@ static struct display_stream_compressor *dcn314_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1653,7 +1653,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -1709,8 +1709,9 @@ enum dc_status dcn314_validate_bandwidth(struct dc *dc, int vlevel = 0; int pipe_cnt = 0; - display_e2e_pipe_params_st *pipes = kcalloc(dc->res_pool->pipe_count, - sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, + GFP_KERNEL); DC_LOGGER_INIT(dc->ctx->logger); BW_VAL_TRACE_COUNT(); @@ -1797,7 +1798,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2145,7 +2146,7 @@ struct resource_pool *dcn314_create_resource_pool( struct dc *dc) { struct dcn314_resource_pool *pool = - kzalloc(sizeof(struct dcn314_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn314_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c index 3ae787a377b1..1a63eaf5e1d9 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c @@ -918,7 +918,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -936,7 +936,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -953,7 +953,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -990,7 +990,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -1005,8 +1005,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -1025,8 +1024,8 @@ static struct hubbub *dcn31_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1058,7 +1057,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1092,7 +1091,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1121,7 +1120,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1138,7 +1137,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1168,7 +1167,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1185,7 +1184,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1204,7 +1203,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1236,7 +1235,7 @@ static struct stream_encoder *dcn315_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1286,7 +1285,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1312,7 +1312,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1326,7 +1326,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1500,7 +1500,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1520,8 +1520,8 @@ static bool dcn31_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1545,8 +1545,8 @@ static bool dcn31_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1568,7 +1568,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1596,7 +1596,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2167,7 +2167,7 @@ struct resource_pool *dcn315_create_resource_pool( struct dc *dc) { struct dcn315_resource_pool *pool = - kzalloc(sizeof(struct dcn315_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn315_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c index 4b8668458f03..4b8dddba34b8 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c @@ -911,7 +911,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp) return NULL; @@ -929,7 +929,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -946,7 +946,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -983,7 +983,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -998,8 +998,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -1018,8 +1017,8 @@ static struct hubbub *dcn31_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1051,7 +1050,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1085,7 +1084,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1114,7 +1113,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1131,7 +1130,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1161,7 +1160,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1178,7 +1177,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1198,7 +1197,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1229,7 +1228,7 @@ static struct stream_encoder *dcn316_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1280,7 +1279,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1306,7 +1306,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1321,7 +1321,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); if (hws) { hws->ctx = ctx; @@ -1492,7 +1492,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1512,8 +1512,8 @@ static bool dcn31_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1537,8 +1537,8 @@ static bool dcn31_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1560,7 +1560,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1588,7 +1588,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2034,7 +2034,7 @@ struct resource_pool *dcn316_create_resource_pool( struct dc *dc) { struct dcn316_resource_pool *pool = - kzalloc(sizeof(struct dcn316_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn316_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c index a55078458ba5..a93862071ff5 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c @@ -750,7 +750,7 @@ static struct dce_aux *dcn32_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -790,7 +790,7 @@ static struct dce_i2c_hw *dcn32_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -817,7 +817,7 @@ static struct clock_source *dcn32_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -837,8 +837,8 @@ static struct hubbub *dcn32_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub2 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub2 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub2) return NULL; @@ -893,7 +893,7 @@ static struct hubp *dcn32_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -925,7 +925,7 @@ static struct dpp *dcn32_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp3 = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp3) return NULL; @@ -951,8 +951,7 @@ static struct mpc *dcn32_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -975,7 +974,7 @@ static struct output_pixel_processor *dcn32_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp2 = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp2) { BREAK_TO_DEBUGGER(); @@ -1000,7 +999,7 @@ static struct timing_generator *dcn32_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1041,7 +1040,7 @@ static struct link_encoder *dcn32_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1085,7 +1084,7 @@ static struct link_encoder *dcn32_link_encoder_create( struct panel_cntl *dcn32_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1124,7 +1123,7 @@ static struct vpg *dcn32_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -1154,7 +1153,7 @@ static struct afmt *dcn32_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -1180,7 +1179,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1217,7 +1216,7 @@ static struct stream_encoder *dcn32_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn32_vpg_create(ctx, vpg_inst); afmt = dcn32_afmt_create(ctx, afmt_inst); @@ -1275,7 +1274,8 @@ static struct hpo_dp_stream_encoder *dcn32_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn32_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1308,7 +1308,7 @@ static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1327,7 +1327,7 @@ static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn32_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1510,8 +1510,8 @@ static bool dcn32_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1539,8 +1539,8 @@ static bool dcn32_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1566,7 +1566,7 @@ static struct display_stream_compressor *dcn32_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1754,8 +1754,9 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, enum dc_valid int vlevel = 0; int pipe_cnt = 0; - display_e2e_pipe_params_st *pipes = kcalloc(dc->res_pool->pipe_count, - sizeof(display_e2e_pipe_params_st), GFP_KERNEL); + display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st, + dc->res_pool->pipe_count, + GFP_KERNEL); /* To handle Freesync properly, setting FreeSync DML parameters * to its default state for the first stage of validation @@ -2571,7 +2572,7 @@ struct resource_pool *dcn32_create_resource_pool( struct dc *dc) { struct dcn32_resource_pool *pool = - kzalloc(sizeof(struct dcn32_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn32_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c index 188c3f24f110..97976318f4c0 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c @@ -744,7 +744,7 @@ static struct dce_aux *dcn321_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -784,7 +784,7 @@ static struct dce_i2c_hw *dcn321_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -811,7 +811,7 @@ static struct clock_source *dcn321_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -831,8 +831,8 @@ static struct hubbub *dcn321_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub2 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub2 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub2) return NULL; @@ -887,7 +887,7 @@ static struct hubp *dcn321_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -919,7 +919,7 @@ static struct dpp *dcn321_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp3 = - kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); if (!dpp3) return NULL; @@ -945,8 +945,7 @@ static struct mpc *dcn321_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), - GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -969,7 +968,7 @@ static struct output_pixel_processor *dcn321_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp2 = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp2) { BREAK_TO_DEBUGGER(); @@ -994,7 +993,7 @@ static struct timing_generator *dcn321_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1035,7 +1034,7 @@ static struct link_encoder *dcn321_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1105,7 +1104,7 @@ static struct vpg *dcn321_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc(sizeof(struct dcn30_vpg), GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); if (!vpg3) return NULL; @@ -1135,7 +1134,7 @@ static struct afmt *dcn321_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt3) return NULL; @@ -1161,7 +1160,7 @@ static struct apg *dcn321_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1198,7 +1197,7 @@ static struct stream_encoder *dcn321_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn321_vpg_create(ctx, vpg_inst); afmt = dcn321_afmt_create(ctx, afmt_inst); @@ -1256,7 +1255,8 @@ static struct hpo_dp_stream_encoder *dcn321_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn321_vpg_create(ctx, vpg_inst); apg = dcn321_apg_create(ctx, apg_inst); @@ -1289,7 +1289,7 @@ static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1308,7 +1308,7 @@ static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn321_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1490,8 +1490,8 @@ static bool dcn321_dwbc_create(struct dc_context *ctx, struct resource_pool *poo uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1519,8 +1519,8 @@ static bool dcn321_mmhubbub_create(struct dc_context *ctx, struct resource_pool uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1546,7 +1546,7 @@ static struct display_stream_compressor *dcn321_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -2064,7 +2064,7 @@ struct resource_pool *dcn321_create_resource_pool( struct dc *dc) { struct dcn321_resource_pool *pool = - kzalloc(sizeof(struct dcn321_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn321_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c index 5ea805fcff48..26493ed5a6fc 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c @@ -810,7 +810,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); bool success = (dpp != NULL); if (!success) @@ -841,7 +841,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -868,7 +868,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -931,7 +931,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -954,7 +954,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -977,8 +977,8 @@ static struct hubbub *dcn35_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1033,7 +1033,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1074,7 +1074,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1127,7 +1127,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1144,7 +1144,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1185,7 +1185,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1215,7 +1215,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1243,7 +1243,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1280,7 +1280,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1338,7 +1338,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1371,7 +1372,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1390,7 +1391,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn35_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1571,7 +1572,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1604,8 +1605,8 @@ static bool dcn35_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1643,8 +1644,8 @@ static bool dcn35_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1672,7 +1673,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1709,7 +1710,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2209,7 +2210,7 @@ struct resource_pool *dcn35_create_resource_pool( struct dc *dc) { struct dcn35_resource_pool *pool = - kzalloc(sizeof(struct dcn35_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn35_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c index 424b52e2dd7b..0e204d8e1336 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c @@ -790,7 +790,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); bool success = (dpp != NULL); if (!success) @@ -821,7 +821,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -848,7 +848,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -911,7 +911,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -934,7 +934,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -957,8 +957,8 @@ static struct hubbub *dcn35_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1013,7 +1013,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1054,7 +1054,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1107,7 +1107,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1124,7 +1124,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1165,7 +1165,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1195,7 +1195,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1223,7 +1223,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1260,7 +1260,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1318,7 +1318,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1351,7 +1352,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1370,7 +1371,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn351_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1551,7 +1552,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1584,8 +1585,8 @@ static bool dcn35_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1623,8 +1624,8 @@ static bool dcn35_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1652,7 +1653,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1689,7 +1690,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2182,7 +2183,7 @@ struct resource_pool *dcn351_create_resource_pool( struct dc *dc) { struct dcn351_resource_pool *pool = - kzalloc(sizeof(struct dcn351_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn351_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c index 7582217bd06d..c0cf8c46031f 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c @@ -797,7 +797,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc(sizeof(struct dcn3_dpp), GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); bool success = (dpp != NULL); if (!success) @@ -828,7 +828,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp) { BREAK_TO_DEBUGGER(); @@ -855,7 +855,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -918,7 +918,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -941,7 +941,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc(sizeof(struct dcn30_mpc), GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); if (!mpc30) return NULL; @@ -964,8 +964,8 @@ static struct hubbub *dcn35_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub3 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub3 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub3) return NULL; @@ -1020,7 +1020,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1061,7 +1061,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1114,7 +1114,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20) return NULL; @@ -1131,7 +1131,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc(sizeof(struct dcn31_panel_cntl), GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); if (!panel_cntl) return NULL; @@ -1172,7 +1172,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg31) return NULL; @@ -1202,7 +1202,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc(sizeof(struct dcn31_afmt), GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); if (!afmt31) return NULL; @@ -1230,7 +1230,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1267,7 +1267,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1325,7 +1325,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn31_vpg_create(ctx, vpg_inst); apg = dcn31_apg_create(ctx, apg_inst); @@ -1358,7 +1359,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1377,7 +1378,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn36_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1558,7 +1559,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -1591,8 +1592,8 @@ static bool dcn35_dwbc_create(struct dc_context *ctx, struct resource_pool *pool uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_dwbc *dwbc30 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc30 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc30) { dm_error("DC: failed to create dwbc30!\n"); @@ -1630,8 +1631,8 @@ static bool dcn35_mmhubbub_create(struct dc_context *ctx, struct resource_pool * uint32_t pipe_count = pool->res_cap->num_dwb; for (i = 0; i < pipe_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1659,7 +1660,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1696,7 +1697,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -2188,7 +2189,7 @@ struct resource_pool *dcn36_create_resource_pool( struct dc *dc) { struct dcn36_resource_pool *pool = - kzalloc(sizeof(struct dcn36_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn36_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c index f5e02a1ff771..db8a0c0b8cda 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c @@ -762,7 +762,7 @@ static struct dce_aux *dcn401_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); if (!aux_engine) return NULL; @@ -801,7 +801,7 @@ static struct dce_i2c_hw *dcn401_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); if (!dce_i2c_hw) return NULL; @@ -827,7 +827,7 @@ static struct clock_source *dcn401_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); if (!clk_src) return NULL; @@ -847,8 +847,8 @@ static struct hubbub *dcn401_hubbub_create(struct dc_context *ctx) { int i; - struct dcn20_hubbub *hubbub2 = kzalloc(sizeof(struct dcn20_hubbub), - GFP_KERNEL); + struct dcn20_hubbub *hubbub2 = kzalloc_obj(struct dcn20_hubbub, + GFP_KERNEL); if (!hubbub2) return NULL; @@ -900,7 +900,7 @@ static struct hubbub *dcn401_hubbub_create(struct dc_context *ctx) static struct dio *dcn401_dio_create(struct dc_context *ctx) { - struct dcn10_dio *dio10 = kzalloc(sizeof(struct dcn10_dio), GFP_KERNEL); + struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio, GFP_KERNEL); if (!dio10) return NULL; @@ -919,7 +919,7 @@ static struct hubp *dcn401_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); if (!hubp2) return NULL; @@ -951,7 +951,7 @@ static struct dpp *dcn401_dpp_create( uint32_t inst) { struct dcn401_dpp *dpp401 = - kzalloc(sizeof(struct dcn401_dpp), GFP_KERNEL); + kzalloc_obj(struct dcn401_dpp, GFP_KERNEL); if (!dpp401) return NULL; @@ -977,8 +977,7 @@ static struct mpc *dcn401_mpc_create( int num_mpcc, int num_rmu) { - struct dcn401_mpc *mpc401 = kzalloc(sizeof(struct dcn401_mpc), - GFP_KERNEL); + struct dcn401_mpc *mpc401 = kzalloc_obj(struct dcn401_mpc, GFP_KERNEL); if (!mpc401) return NULL; @@ -1001,7 +1000,7 @@ static struct output_pixel_processor *dcn401_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp4 = - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); + kzalloc_obj(struct dcn20_opp, GFP_KERNEL); if (!opp4) { BREAK_TO_DEBUGGER(); @@ -1026,7 +1025,7 @@ static struct timing_generator *dcn401_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc(sizeof(struct optc), GFP_KERNEL); + kzalloc_obj(struct optc, GFP_KERNEL); if (!tgn10) return NULL; @@ -1066,7 +1065,7 @@ static struct link_encoder *dcn401_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1131,7 +1130,7 @@ static struct vpg *dcn401_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg4 = kzalloc(sizeof(struct dcn31_vpg), GFP_KERNEL); + struct dcn31_vpg *vpg4 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); if (!vpg4) return NULL; @@ -1161,7 +1160,7 @@ static struct afmt *dcn401_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt401 = kzalloc(sizeof(struct dcn30_afmt), GFP_KERNEL); + struct dcn30_afmt *afmt401 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); if (!afmt401) return NULL; @@ -1186,7 +1185,7 @@ static struct apg *dcn401_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc(sizeof(struct dcn31_apg), GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); if (!apg31) return NULL; @@ -1223,7 +1222,7 @@ static struct stream_encoder *dcn401_stream_encoder_create( } else return NULL; - enc1 = kzalloc(sizeof(struct dcn10_stream_encoder), GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); vpg = dcn401_vpg_create(ctx, vpg_inst); afmt = dcn401_afmt_create(ctx, afmt_inst); @@ -1279,7 +1278,8 @@ static struct hpo_dp_stream_encoder *dcn401_hpo_dp_stream_encoder_create( apg_inst = hpo_dp_inst; /* allocate HPO stream encoder and create VPG sub-block */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_stream_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_stream_encoder, + GFP_KERNEL); vpg = dcn401_vpg_create(ctx, vpg_inst); apg = dcn401_apg_create(ctx, apg_inst); @@ -1312,7 +1312,7 @@ static struct hpo_dp_link_encoder *dcn401_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1356,7 +1356,7 @@ static unsigned int dcn401_calc_num_avail_chans_for_mall(struct dc *dc, unsigned static struct dce_hwseq *dcn401_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc(sizeof(struct dce_hwseq), GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1551,8 +1551,8 @@ static bool dcn401_dwbc_create(struct dc_context *ctx, struct resource_pool *poo uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_dwbc *dwbc401 = kzalloc(sizeof(struct dcn30_dwbc), - GFP_KERNEL); + struct dcn30_dwbc *dwbc401 = kzalloc_obj(struct dcn30_dwbc, + GFP_KERNEL); if (!dwbc401) { dm_error("DC: failed to create dwbc401!\n"); @@ -1582,8 +1582,8 @@ static bool dcn401_mmhubbub_create(struct dc_context *ctx, struct resource_pool uint32_t dwb_count = pool->res_cap->num_dwb; for (i = 0; i < dwb_count; i++) { - struct dcn30_mmhubbub *mcif_wb30 = kzalloc(sizeof(struct dcn30_mmhubbub), - GFP_KERNEL); + struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub, + GFP_KERNEL); if (!mcif_wb30) { dm_error("DC: failed to create mcif_wb30!\n"); @@ -1609,7 +1609,7 @@ static struct display_stream_compressor *dcn401_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn401_dsc *dsc = - kzalloc(sizeof(struct dcn401_dsc), GFP_KERNEL); + kzalloc_obj(struct dcn401_dsc, GFP_KERNEL); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -2314,7 +2314,7 @@ struct resource_pool *dcn401_create_resource_pool( struct dc *dc) { struct dcn401_resource_pool *pool = - kzalloc(sizeof(struct dcn401_resource_pool), GFP_KERNEL); + kzalloc_obj(struct dcn401_resource_pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c index 0fc0e5a6c171..1334d0efe6e3 100644 --- a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c +++ b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c @@ -21,7 +21,7 @@ struct soc_and_ip_translator *dc_create_soc_and_ip_translator(enum dce_version d { struct soc_and_ip_translator *soc_and_ip_translator; - soc_and_ip_translator = kzalloc(sizeof(*soc_and_ip_translator), GFP_KERNEL); + soc_and_ip_translator = kzalloc_obj(*soc_and_ip_translator, GFP_KERNEL); if (!soc_and_ip_translator) return NULL; diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c index a71df052cf25..33a7627191f8 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c @@ -933,7 +933,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma, struct pwl_float_data_ex *rgb = rgb_regamma; const struct hw_x_point *coord_x = coordinate_x; - coeff = kvzalloc(sizeof(*coeff), GFP_KERNEL); + coeff = kvzalloc_obj(*coeff, GFP_KERNEL); if (!coeff) goto release; @@ -1714,14 +1714,15 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps, input_tf->type = TF_TYPE_DISTRIBUTED_POINTS; if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) { - rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS, - sizeof(*rgb_user), - GFP_KERNEL); + rgb_user = kvzalloc_objs(*rgb_user, + ramp->num_entries + _EXTRA_POINTS, + GFP_KERNEL); if (!rgb_user) goto rgb_user_alloc_fail; - axis_x = kvcalloc(ramp->num_entries + _EXTRA_POINTS, sizeof(*axis_x), - GFP_KERNEL); + axis_x = kvzalloc_objs(*axis_x, + ramp->num_entries + _EXTRA_POINTS, + GFP_KERNEL); if (!axis_x) goto axis_x_alloc_fail; @@ -1737,13 +1738,11 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps, scale_gamma(rgb_user, ramp, dividers); } - curve = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*curve), - GFP_KERNEL); + curve = kvzalloc_objs(*curve, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); if (!curve) goto curve_alloc_fail; - coeff = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*coeff), - GFP_KERNEL); + coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); if (!coeff) goto coeff_alloc_fail; @@ -1940,14 +1939,14 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf, if (ramp && ramp->type != GAMMA_CS_TFM_1D && (map_user_ramp || ramp->type != GAMMA_RGB_256)) { - rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS, - sizeof(*rgb_user), - GFP_KERNEL); + rgb_user = kvzalloc_objs(*rgb_user, + ramp->num_entries + _EXTRA_POINTS, + GFP_KERNEL); if (!rgb_user) goto rgb_user_alloc_fail; - axis_x = kvcalloc(ramp->num_entries + 3, sizeof(*axis_x), - GFP_KERNEL); + axis_x = kvzalloc_objs(*axis_x, ramp->num_entries + 3, + GFP_KERNEL); if (!axis_x) goto axis_x_alloc_fail; @@ -1966,14 +1965,12 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf, scale_gamma_dx(rgb_user, ramp, dividers); } - rgb_regamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, - sizeof(*rgb_regamma), - GFP_KERNEL); + rgb_regamma = kvzalloc_objs(*rgb_regamma, MAX_HW_POINTS + _EXTRA_POINTS, + GFP_KERNEL); if (!rgb_regamma) goto rgb_regamma_alloc_fail; - coeff = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, sizeof(*coeff), - GFP_KERNEL); + coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); if (!coeff) goto coeff_alloc_fail; diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index 1aae46d703ba..b819610021f2 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -61,7 +61,7 @@ struct core_freesync { struct mod_freesync *mod_freesync_create(struct dc *dc) { struct core_freesync *core_freesync = - kzalloc(sizeof(struct core_freesync), GFP_KERNEL); + kzalloc_obj(struct core_freesync, GFP_KERNEL); if (core_freesync == NULL) goto fail_alloc_context; diff --git a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c index 2c40212d86da..ccd35d1f05ec 100644 --- a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c +++ b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c @@ -144,7 +144,7 @@ struct mod_vmid *mod_vmid_create( if (dc == NULL) goto fail_dc_null; - core_vmid = kzalloc(sizeof(struct core_vmid), GFP_KERNEL); + core_vmid = kzalloc_obj(struct core_vmid, GFP_KERNEL); if (core_vmid == NULL) goto fail_alloc_context; diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 938361ecae05..28b178d0aff6 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -2746,7 +2746,7 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev, name, ret); } - attr_entry = kmalloc(sizeof(*attr_entry), GFP_KERNEL); + attr_entry = kmalloc_obj(*attr_entry, GFP_KERNEL); if (!attr_entry) return -ENOMEM; @@ -4592,7 +4592,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) int ret; /* Setup the top `gpu_od` directory which holds all other OD interfaces */ - top_set = kzalloc(sizeof(*top_set), GFP_KERNEL); + top_set = kzalloc_obj(*top_set, GFP_KERNEL); if (!top_set) return -ENOMEM; list_add(&top_set->entry, &adev->pm.od_kobj_list); @@ -4629,7 +4629,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) * The container is presented as a plain file under top `gpu_od` * directory. */ - attribute = kzalloc(sizeof(*attribute), GFP_KERNEL); + attribute = kzalloc_obj(*attribute, GFP_KERNEL); if (!attribute) { ret = -ENOMEM; goto err_out; @@ -4649,7 +4649,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) goto err_out; } else { /* The container is presented as a sub directory. */ - sub_set = kzalloc(sizeof(*sub_set), GFP_KERNEL); + sub_set = kzalloc_obj(*sub_set, GFP_KERNEL); if (!sub_set) { ret = -ENOMEM; goto err_out; @@ -4679,7 +4679,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) * With the container presented as a sub directory, the entry within * it is presented as a plain file under the sub directory. */ - attribute = kzalloc(sizeof(*attribute), GFP_KERNEL); + attribute = kzalloc_obj(*attribute, GFP_KERNEL); if (!attribute) { ret = -ENOMEM; goto err_out; diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c index 33eb85dd68e9..5d0c0c5a706b 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c @@ -2724,9 +2724,8 @@ static int kv_parse_power_table(struct amdgpu_device *adev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - adev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct amdgpu_ps), - GFP_KERNEL); + adev->pm.dpm.ps = kzalloc_objs(struct amdgpu_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!adev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -2736,7 +2735,7 @@ static int kv_parse_power_table(struct amdgpu_device *adev) non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; - ps = kzalloc(sizeof(struct kv_ps), GFP_KERNEL); + ps = kzalloc_obj(struct kv_ps, GFP_KERNEL); if (ps == NULL) return -ENOMEM; adev->pm.dpm.ps[i].ps_priv = ps; @@ -2783,7 +2782,7 @@ static int kv_dpm_init(struct amdgpu_device *adev) struct kv_power_info *pi; int ret, i; - pi = kzalloc(sizeof(struct kv_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct kv_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; adev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c index c7ed0b457129..c41bcc8a7efb 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c @@ -302,9 +302,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev) ATOM_PPLIB_PhaseSheddingLimits_Record *entry; adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries = - kcalloc(psl->ucNumEntries, - sizeof(struct amdgpu_phase_shedding_limits_entry), - GFP_KERNEL); + kzalloc_objs(struct amdgpu_phase_shedding_limits_entry, + psl->ucNumEntries, GFP_KERNEL); if (!adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries) return -ENOMEM; @@ -503,7 +502,7 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(ext_hdr->usPPMTableOffset)); adev->pm.dpm.dyn_state.ppm_table = - kzalloc(sizeof(struct amdgpu_ppm_table), GFP_KERNEL); + kzalloc_obj(struct amdgpu_ppm_table, GFP_KERNEL); if (!adev->pm.dpm.dyn_state.ppm_table) return -ENOMEM; adev->pm.dpm.dyn_state.ppm_table->ppm_design = ppm->ucPpmDesign; @@ -557,7 +556,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev) le16_to_cpu(ext_hdr->usPowerTuneTableOffset)); ATOM_PowerTune_Table *pt; adev->pm.dpm.dyn_state.cac_tdp_table = - kzalloc(sizeof(struct amdgpu_cac_tdp_table), GFP_KERNEL); + kzalloc_obj(struct amdgpu_cac_tdp_table, + GFP_KERNEL); if (!adev->pm.dpm.dyn_state.cac_tdp_table) return -ENOMEM; if (rev > 0) { diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c index d8959e0f109c..b4fc0106f973 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c @@ -2586,7 +2586,7 @@ static int si_initialize_smc_dte_tables(struct amdgpu_device *adev) if (dte_data->k <= 0) return -EINVAL; - dte_tables = kzalloc(sizeof(Smc_SIslands_DTE_Configuration), GFP_KERNEL); + dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration, GFP_KERNEL); if (dte_tables == NULL) { si_pi->enable_dte = false; return -ENOMEM; @@ -2767,7 +2767,7 @@ static int si_initialize_smc_cac_tables(struct amdgpu_device *adev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc(sizeof(PP_SIslands_CacConfig), GFP_KERNEL); + cac_tables = kzalloc_obj(PP_SIslands_CacConfig, GFP_KERNEL); if (!cac_tables) return -ENOMEM; @@ -2964,7 +2964,7 @@ static int si_init_smc_spll_table(struct amdgpu_device *adev) if (si_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc(sizeof(SMC_SISLANDS_SPLL_DIV_TABLE), GFP_KERNEL); + spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); if (spll_table == NULL) return -ENOMEM; @@ -6054,7 +6054,7 @@ static int si_initialize_mc_reg_table(struct amdgpu_device *adev) u8 module_index = rv770_get_memory_module_index(adev); int ret; - table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -7341,9 +7341,8 @@ static int si_parse_power_table(struct amdgpu_device *adev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - adev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct amdgpu_ps), - GFP_KERNEL); + adev->pm.dpm.ps = kzalloc_objs(struct amdgpu_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!adev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -7353,7 +7352,7 @@ static int si_parse_power_table(struct amdgpu_device *adev) non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; - ps = kzalloc(sizeof(struct si_ps), GFP_KERNEL); + ps = kzalloc_obj(struct si_ps, GFP_KERNEL); if (ps == NULL) return -ENOMEM; adev->pm.dpm.ps[i].ps_priv = ps; @@ -7406,7 +7405,7 @@ static int si_dpm_init(struct amdgpu_device *adev) struct atom_clock_dividers dividers; int ret; - si_pi = kzalloc(sizeof(struct si_power_info), GFP_KERNEL); + si_pi = kzalloc_obj(struct si_power_info, GFP_KERNEL); if (si_pi == NULL) return -ENOMEM; adev->pm.dpm.priv = si_pi; @@ -7443,9 +7442,8 @@ static int si_dpm_init(struct amdgpu_device *adev) return ret; adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries = - kcalloc(4, - sizeof(struct amdgpu_clock_voltage_dependency_entry), - GFP_KERNEL); + kzalloc_objs(struct amdgpu_clock_voltage_dependency_entry, 4, + GFP_KERNEL); if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c index 0bbb89788335..cd3036e33c5a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c @@ -41,7 +41,7 @@ static int amd_powerplay_create(struct amdgpu_device *adev) if (adev == NULL) return -EINVAL; - hwmgr = kzalloc(sizeof(struct pp_hwmgr), GFP_KERNEL); + hwmgr = kzalloc_obj(struct pp_hwmgr, GFP_KERNEL); if (hwmgr == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c index 6cfef1b295ab..a1292d5b0a1c 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c @@ -165,7 +165,7 @@ static int get_vddc_lookup_table( PP_ASSERT_WITH_CODE((0 != vddc_lookup_pp_tables->ucNumEntries), "Invalid CAC Leakage PowerPlay Table!", return 1); - table = kzalloc(struct_size(table, entries, max_levels), GFP_KERNEL); + table = kzalloc_flex(*table, entries, max_levels, GFP_KERNEL); if (!table) return -ENOMEM; @@ -200,7 +200,7 @@ static int get_platform_power_management_table( struct pp_hwmgr *hwmgr, ATOM_Tonga_PPM_Table *atom_ppm_table) { - struct phm_ppm_table *ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + struct phm_ppm_table *ptr = kzalloc_obj(*ptr, GFP_KERNEL); struct phm_ppt_v1_information *pp_table_information = (struct phm_ppt_v1_information *)(hwmgr->pptable); @@ -321,8 +321,8 @@ static int get_valid_clk( PP_ASSERT_WITH_CODE((0 != clk_volt_pp_table->count), "Invalid PowerPlay Table!", return -1); - table = kzalloc(struct_size(table, values, clk_volt_pp_table->count), - GFP_KERNEL); + table = kzalloc_flex(*table, values, clk_volt_pp_table->count, + GFP_KERNEL); if (!table) return -ENOMEM; @@ -371,8 +371,8 @@ static int get_mclk_voltage_dependency_table( PP_ASSERT_WITH_CODE((0 != mclk_dep_table->ucNumEntries), "Invalid PowerPlay Table!", return -1); - mclk_table = kzalloc(struct_size(mclk_table, entries, mclk_dep_table->ucNumEntries), - GFP_KERNEL); + mclk_table = kzalloc_flex(*mclk_table, entries, + mclk_dep_table->ucNumEntries, GFP_KERNEL); if (!mclk_table) return -ENOMEM; @@ -415,8 +415,8 @@ static int get_sclk_voltage_dependency_table( PP_ASSERT_WITH_CODE((0 != tonga_table->ucNumEntries), "Invalid PowerPlay Table!", return -1); - sclk_table = kzalloc(struct_size(sclk_table, entries, tonga_table->ucNumEntries), - GFP_KERNEL); + sclk_table = kzalloc_flex(*sclk_table, entries, + tonga_table->ucNumEntries, GFP_KERNEL); if (!sclk_table) return -ENOMEM; @@ -444,8 +444,9 @@ static int get_sclk_voltage_dependency_table( PP_ASSERT_WITH_CODE((0 != polaris_table->ucNumEntries), "Invalid PowerPlay Table!", return -1); - sclk_table = kzalloc(struct_size(sclk_table, entries, polaris_table->ucNumEntries), - GFP_KERNEL); + sclk_table = kzalloc_flex(*sclk_table, entries, + polaris_table->ucNumEntries, + GFP_KERNEL); if (!sclk_table) return -ENOMEM; @@ -491,9 +492,9 @@ static int get_pcie_table( PP_ASSERT_WITH_CODE((atom_pcie_table->ucNumEntries != 0), "Invalid PowerPlay Table!", return -1); - pcie_table = kzalloc(struct_size(pcie_table, entries, - atom_pcie_table->ucNumEntries), - GFP_KERNEL); + pcie_table = kzalloc_flex(*pcie_table, entries, + atom_pcie_table->ucNumEntries, + GFP_KERNEL); if (!pcie_table) return -ENOMEM; @@ -528,9 +529,9 @@ static int get_pcie_table( PP_ASSERT_WITH_CODE((atom_pcie_table->ucNumEntries != 0), "Invalid PowerPlay Table!", return -1); - pcie_table = kzalloc(struct_size(pcie_table, entries, - atom_pcie_table->ucNumEntries), - GFP_KERNEL); + pcie_table = kzalloc_flex(*pcie_table, entries, + atom_pcie_table->ucNumEntries, + GFP_KERNEL); if (!pcie_table) return -ENOMEM; @@ -724,8 +725,8 @@ static int get_mm_clock_voltage_table( PP_ASSERT_WITH_CODE((0 != mm_dependency_table->ucNumEntries), "Invalid PowerPlay Table!", return -1); - mm_table = kzalloc(struct_size(mm_table, entries, mm_dependency_table->ucNumEntries), - GFP_KERNEL); + mm_table = kzalloc_flex(*mm_table, entries, + mm_dependency_table->ucNumEntries, GFP_KERNEL); if (!mm_table) return -ENOMEM; @@ -1141,7 +1142,7 @@ static int pp_tables_v1_0_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Tonga_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc(sizeof(struct phm_ppt_v1_information), GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v1_information, GFP_KERNEL); PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c index f06b29e33ba4..b19409890899 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c @@ -382,8 +382,8 @@ static int get_clock_voltage_dependency_table(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_clock_voltage_dependency_table *dep_table; - dep_table = kzalloc(struct_size(dep_table, entries, table->ucNumEntries), - GFP_KERNEL); + dep_table = kzalloc_flex(*dep_table, entries, table->ucNumEntries, + GFP_KERNEL); if (NULL == dep_table) return -ENOMEM; @@ -409,7 +409,8 @@ static int get_valid_clk(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_clock_array *clock_table; - clock_table = kzalloc(struct_size(clock_table, values, table->count), GFP_KERNEL); + clock_table = kzalloc_flex(*clock_table, values, table->count, + GFP_KERNEL); if (!clock_table) return -ENOMEM; @@ -1209,8 +1210,8 @@ static int get_uvd_clock_voltage_limit_table(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_uvd_clock_voltage_dependency_table *uvd_table; - uvd_table = kzalloc(struct_size(uvd_table, entries, table->numEntries), - GFP_KERNEL); + uvd_table = kzalloc_flex(*uvd_table, entries, table->numEntries, + GFP_KERNEL); if (!uvd_table) return -ENOMEM; @@ -1239,8 +1240,8 @@ static int get_vce_clock_voltage_limit_table(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_vce_clock_voltage_dependency_table *vce_table; - vce_table = kzalloc(struct_size(vce_table, entries, table->numEntries), - GFP_KERNEL); + vce_table = kzalloc_flex(*vce_table, entries, table->numEntries, + GFP_KERNEL); if (!vce_table) return -ENOMEM; @@ -1267,8 +1268,8 @@ static int get_samu_clock_voltage_limit_table(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_samu_clock_voltage_dependency_table *samu_table; - samu_table = kzalloc(struct_size(samu_table, entries, table->numEntries), - GFP_KERNEL); + samu_table = kzalloc_flex(*samu_table, entries, table->numEntries, + GFP_KERNEL); if (!samu_table) return -ENOMEM; @@ -1292,8 +1293,8 @@ static int get_acp_clock_voltage_limit_table(struct pp_hwmgr *hwmgr, unsigned long i; struct phm_acp_clock_voltage_dependency_table *acp_table; - acp_table = kzalloc(struct_size(acp_table, entries, table->numEntries), - GFP_KERNEL); + acp_table = kzalloc_flex(*acp_table, entries, table->numEntries, + GFP_KERNEL); if (!acp_table) return -ENOMEM; @@ -1487,8 +1488,8 @@ static int get_cac_leakage_table(struct pp_hwmgr *hwmgr, if (!hwmgr || !table || !ptable) return -EINVAL; - cac_leakage_table = kzalloc(struct_size(cac_leakage_table, entries, table->ucNumEntries), - GFP_KERNEL); + cac_leakage_table = kzalloc_flex(*cac_leakage_table, entries, + table->ucNumEntries, GFP_KERNEL); if (!cac_leakage_table) return -ENOMEM; @@ -1514,7 +1515,8 @@ static int get_cac_leakage_table(struct pp_hwmgr *hwmgr, static int get_platform_power_management_table(struct pp_hwmgr *hwmgr, ATOM_PPLIB_PPM_Table *atom_ppm_table) { - struct phm_ppm_table *ptr = kzalloc(sizeof(struct phm_ppm_table), GFP_KERNEL); + struct phm_ppm_table *ptr = kzalloc_obj(struct phm_ppm_table, + GFP_KERNEL); if (NULL == ptr) return -ENOMEM; @@ -1625,8 +1627,8 @@ static int init_phase_shedding_table(struct pp_hwmgr *hwmgr, unsigned long i; - table = kzalloc(struct_size(table, entries, ptable->ucNumEntries), - GFP_KERNEL); + table = kzalloc_flex(*table, entries, + ptable->ucNumEntries, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c index 8de8d66df95f..49dc20b790ad 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c @@ -133,8 +133,7 @@ static int smu10_init_dynamic_state_adjustment_rule_settings( int count = 8; struct phm_clock_voltage_dependency_table *table_clk_vlt; - table_clk_vlt = kzalloc(struct_size(table_clk_vlt, entries, count), - GFP_KERNEL); + table_clk_vlt = kzalloc_flex(*table_clk_vlt, entries, count, GFP_KERNEL); if (NULL == table_clk_vlt) { pr_err("Can not allocate memory!\n"); @@ -473,7 +472,7 @@ static int smu10_get_clock_voltage_dependency_table(struct pp_hwmgr *hwmgr, uint32_t i; struct smu10_voltage_dependency_table *ptable; - ptable = kzalloc(struct_size(ptable, entries, num_entry), GFP_KERNEL); + ptable = kzalloc_flex(*ptable, entries, num_entry, GFP_KERNEL); if (NULL == ptable) return -ENOMEM; @@ -551,7 +550,7 @@ static int smu10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) int result = 0; struct smu10_hwmgr *data; - data = kzalloc(sizeof(struct smu10_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct smu10_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 2be584aefd0a..a97136743723 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -2961,7 +2961,7 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct smu7_hwmgr *data; int result = 0; - data = kzalloc(sizeof(struct smu7_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct smu7_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -4652,7 +4652,7 @@ static const struct amdgpu_irq_src_funcs smu7_irq_funcs = { static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr) { struct amdgpu_irq_src *source = - kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL); + kzalloc_obj(struct amdgpu_irq_src, GFP_KERNEL); if (!source) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c index 736e5a8af477..5d20c41b3803 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c @@ -276,8 +276,7 @@ static int smu8_init_dynamic_state_adjustment_rule_settings( { struct phm_clock_voltage_dependency_table *table_clk_vlt; - table_clk_vlt = kzalloc(struct_size(table_clk_vlt, entries, 8), - GFP_KERNEL); + table_clk_vlt = kzalloc_flex(*table_clk_vlt, entries, 8, GFP_KERNEL); if (NULL == table_clk_vlt) { pr_err("Can not allocate memory!\n"); @@ -1122,7 +1121,7 @@ static int smu8_hwmgr_backend_init(struct pp_hwmgr *hwmgr) int result = 0; struct smu8_hwmgr *data; - data = kzalloc(sizeof(struct smu8_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct smu8_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c index c305ea4ec17d..68ae1bc36a7f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c @@ -211,8 +211,7 @@ int phm_trim_voltage_table(struct pp_atomctrl_voltage_table *vol_table) PP_ASSERT_WITH_CODE((NULL != vol_table), "Voltage Table empty.", return -EINVAL); - table = kzalloc(sizeof(struct pp_atomctrl_voltage_table), - GFP_KERNEL); + table = kzalloc_obj(struct pp_atomctrl_voltage_table, GFP_KERNEL); if (NULL == table) return -EINVAL; @@ -496,8 +495,7 @@ int phm_initializa_dynamic_state_adjustment_rule_settings(struct pp_hwmgr *hwmgr struct phm_ppt_v1_information *pptable_info = (struct phm_ppt_v1_information *)(hwmgr->pptable); /* initialize vddc_dep_on_dal_pwrl table */ - table_clk_vlt = kzalloc(struct_size(table_clk_vlt, entries, 4), - GFP_KERNEL); + table_clk_vlt = kzalloc_flex(*table_clk_vlt, entries, 4, GFP_KERNEL); if (NULL == table_clk_vlt) { pr_err("Can not allocate space for vddc_dep_on_dal_pwrl! \n"); @@ -646,7 +644,7 @@ static const struct amdgpu_irq_src_funcs smu9_irq_funcs = { int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr) { struct amdgpu_irq_src *source = - kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL); + kzalloc_obj(struct amdgpu_irq_src, GFP_KERNEL); if (!source) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c index 1b8a57d98759..255fa6c96120 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c @@ -831,7 +831,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct pp_atomfwctrl_voltage_table vol_table; struct amdgpu_device *adev = hwmgr->adev; - data = kzalloc(sizeof(struct vega10_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct vega10_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -1029,8 +1029,7 @@ static int vega10_trim_voltage_table(struct pp_hwmgr *hwmgr, PP_ASSERT_WITH_CODE(vol_table, "Voltage Table empty.", return -EINVAL); - table = kzalloc(sizeof(struct pp_atomfwctrl_voltage_table), - GFP_KERNEL); + table = kzalloc_obj(struct pp_atomfwctrl_voltage_table, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c index 3be616af327e..2b9a1840a35a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c @@ -350,8 +350,8 @@ static int get_mm_clock_voltage_table( PP_ASSERT_WITH_CODE((mm_dependency_table->ucNumEntries != 0), "Invalid PowerPlay Table!", return -1); - mm_table = kzalloc(struct_size(mm_table, entries, mm_dependency_table->ucNumEntries), - GFP_KERNEL); + mm_table = kzalloc_flex(*mm_table, entries, + mm_dependency_table->ucNumEntries, GFP_KERNEL); if (!mm_table) return -ENOMEM; @@ -573,8 +573,8 @@ static int get_socclk_voltage_dependency_table( PP_ASSERT_WITH_CODE(clk_dep_table->ucNumEntries, "Invalid PowerPlay Table!", return -1); - clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries), - GFP_KERNEL); + clk_table = kzalloc_flex(*clk_table, entries, + clk_dep_table->ucNumEntries, GFP_KERNEL); if (!clk_table) return -ENOMEM; @@ -603,8 +603,8 @@ static int get_mclk_voltage_dependency_table( PP_ASSERT_WITH_CODE(mclk_dep_table->ucNumEntries, "Invalid PowerPlay Table!", return -1); - mclk_table = kzalloc(struct_size(mclk_table, entries, mclk_dep_table->ucNumEntries), - GFP_KERNEL); + mclk_table = kzalloc_flex(*mclk_table, entries, + mclk_dep_table->ucNumEntries, GFP_KERNEL); if (!mclk_table) return -ENOMEM; @@ -640,8 +640,8 @@ static int get_gfxclk_voltage_dependency_table( PP_ASSERT_WITH_CODE((clk_dep_table->ucNumEntries != 0), "Invalid PowerPlay Table!", return -1); - clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries), - GFP_KERNEL); + clk_table = kzalloc_flex(*clk_table, entries, + clk_dep_table->ucNumEntries, GFP_KERNEL); if (!clk_table) return -ENOMEM; @@ -702,8 +702,8 @@ static int get_pix_clk_voltage_dependency_table( PP_ASSERT_WITH_CODE((clk_dep_table->ucNumEntries != 0), "Invalid PowerPlay Table!", return -1); - clk_table = kzalloc(struct_size(clk_table, entries, clk_dep_table->ucNumEntries), - GFP_KERNEL); + clk_table = kzalloc_flex(*clk_table, entries, + clk_dep_table->ucNumEntries, GFP_KERNEL); if (!clk_table) return -ENOMEM; @@ -755,8 +755,7 @@ static int get_dcefclk_voltage_dependency_table( num_entries = clk_dep_table->ucNumEntries; - clk_table = kzalloc(struct_size(clk_table, entries, num_entries), - GFP_KERNEL); + clk_table = kzalloc_flex(*clk_table, entries, num_entries, GFP_KERNEL); if (!clk_table) return -ENOMEM; @@ -794,8 +793,8 @@ static int get_pcie_table(struct pp_hwmgr *hwmgr, "Invalid PowerPlay Table!", return 0); - pcie_table = kzalloc(struct_size(pcie_table, entries, atom_pcie_table->ucNumEntries), - GFP_KERNEL); + pcie_table = kzalloc_flex(*pcie_table, entries, + atom_pcie_table->ucNumEntries, GFP_KERNEL); if (!pcie_table) return -ENOMEM; @@ -853,8 +852,8 @@ static int get_valid_clk( PP_ASSERT_WITH_CODE(clk_volt_pp_table->count, "Invalid PowerPlay Table!", return -1); - table = kzalloc(struct_size(table, values, clk_volt_pp_table->count), - GFP_KERNEL); + table = kzalloc_flex(*table, values, clk_volt_pp_table->count, + GFP_KERNEL); if (!table) return -ENOMEM; @@ -1041,7 +1040,7 @@ static int get_vddc_lookup_table( PP_ASSERT_WITH_CODE((vddc_lookup_pp_tables->ucNumEntries != 0), "Invalid SOC_VDDD Lookup Table!", return 1); - table = kzalloc(struct_size(table, entries, max_levels), GFP_KERNEL); + table = kzalloc_flex(*table, entries, max_levels, GFP_KERNEL); if (!table) return -ENOMEM; @@ -1149,7 +1148,7 @@ static int vega10_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega10_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc(sizeof(struct phm_ppt_v2_information), GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v2_information, GFP_KERNEL); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c index 5a987a535e73..eca05a6c868f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c @@ -395,7 +395,7 @@ static int vega12_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct vega12_hwmgr *data; struct amdgpu_device *adev = hwmgr->adev; - data = kzalloc(sizeof(struct vega12_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct vega12_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c index 89148f73b514..b8fad7417190 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c @@ -263,7 +263,7 @@ static int vega12_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega12_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc(sizeof(struct phm_ppt_v3_information), GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information, GFP_KERNEL); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c index 5193b7d0e11b..1dc84beaf440 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c @@ -436,7 +436,7 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct amdgpu_device *adev = hwmgr->adev; int result; - data = kzalloc(sizeof(struct vega20_hwmgr), GFP_KERNEL); + data = kzalloc_obj(struct vega20_hwmgr, GFP_KERNEL); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c index 2b446f8866ba..4316b5e4b848 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c @@ -336,7 +336,7 @@ static int vega20_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega20_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc(sizeof(struct phm_ppt_v3_information), GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information, GFP_KERNEL); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c index ad1fd3150d03..12a699a8c954 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c @@ -2681,7 +2681,7 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct ci_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = ci_get_memory_modile_index(hwmgr); - table = kzalloc(sizeof(pp_atomctrl_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); if (NULL == table) return -ENOMEM; @@ -2735,7 +2735,7 @@ static int ci_smu_init(struct pp_hwmgr *hwmgr) { struct ci_smumgr *ci_priv; - ci_priv = kzalloc(sizeof(struct ci_smumgr), GFP_KERNEL); + ci_priv = kzalloc_obj(struct ci_smumgr, GFP_KERNEL); if (ci_priv == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c index 0a876c840c79..d7fd3a36ac95 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c @@ -334,7 +334,7 @@ static int fiji_smu_init(struct pp_hwmgr *hwmgr) { struct fiji_smumgr *fiji_priv; - fiji_priv = kzalloc(sizeof(struct fiji_smumgr), GFP_KERNEL); + fiji_priv = kzalloc_obj(struct fiji_smumgr, GFP_KERNEL); if (fiji_priv == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c index aa3ae9b115c4..b990def7d1aa 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c @@ -261,7 +261,7 @@ static int iceland_smu_init(struct pp_hwmgr *hwmgr) { struct iceland_smumgr *iceland_priv; - iceland_priv = kzalloc(sizeof(struct iceland_smumgr), GFP_KERNEL); + iceland_priv = kzalloc_obj(struct iceland_smumgr, GFP_KERNEL); if (iceland_priv == NULL) return -ENOMEM; @@ -2608,7 +2608,7 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct iceland_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = iceland_get_memory_modile_index(hwmgr); - table = kzalloc(sizeof(pp_atomctrl_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); if (NULL == table) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c index bf6d09572cfc..497a70988960 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c @@ -336,7 +336,7 @@ static int polaris10_smu_init(struct pp_hwmgr *hwmgr) { struct polaris10_smumgr *smu_data; - smu_data = kzalloc(sizeof(struct polaris10_smumgr), GFP_KERNEL); + smu_data = kzalloc_obj(struct polaris10_smumgr, GFP_KERNEL); if (smu_data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c index 38e19e5cad4d..22e0db4e097f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c @@ -244,7 +244,7 @@ static int smu10_smu_init(struct pp_hwmgr *hwmgr) struct smu10_smumgr *priv; int r; - priv = kzalloc(sizeof(struct smu10_smumgr), GFP_KERNEL); + priv = kzalloc_obj(struct smu10_smumgr, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c index 0d4cbe4113a0..9d6203998b5c 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c @@ -333,7 +333,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) if (!smu_data->toc) { struct SMU_DRAMData_TOC *toc; - smu_data->toc = kzalloc(sizeof(struct SMU_DRAMData_TOC), GFP_KERNEL); + smu_data->toc = kzalloc_obj(struct SMU_DRAMData_TOC, GFP_KERNEL); if (!smu_data->toc) return -ENOMEM; toc = smu_data->toc; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c index 76d4f12ceedf..82f4f466db8a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c @@ -758,7 +758,7 @@ static int smu8_smu_init(struct pp_hwmgr *hwmgr) int ret = 0; struct smu8_smumgr *smu8_smu; - smu8_smu = kzalloc(sizeof(struct smu8_smumgr), GFP_KERNEL); + smu8_smu = kzalloc_obj(struct smu8_smumgr, GFP_KERNEL); if (smu8_smu == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c index 2e21f9d066cb..95d87b12df04 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c @@ -228,7 +228,7 @@ static int tonga_smu_init(struct pp_hwmgr *hwmgr) { struct tonga_smumgr *tonga_priv; - tonga_priv = kzalloc(sizeof(struct tonga_smumgr), GFP_KERNEL); + tonga_priv = kzalloc_obj(struct tonga_smumgr, GFP_KERNEL); if (tonga_priv == NULL) return -ENOMEM; @@ -3072,7 +3072,7 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct tonga_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = tonga_get_memory_modile_index(hwmgr); - table = kzalloc(sizeof(pp_atomctrl_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); if (table == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c index 0bf1bf5528c2..fe960e3c1010 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c @@ -218,7 +218,7 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL); + priv = kzalloc_obj(struct vega10_smumgr, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c index e2ba593faa5d..bd846c4f09a1 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c @@ -221,7 +221,7 @@ static int vega12_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc(sizeof(struct vega12_smumgr), GFP_KERNEL); + priv = kzalloc_obj(struct vega12_smumgr, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c index e3515156d26f..7dda3ad13861 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c @@ -430,7 +430,7 @@ static int vega20_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc(sizeof(struct vega20_smumgr), GFP_KERNEL); + priv = kzalloc_obj(struct vega20_smumgr, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c index 34c9f59b889a..57eed236baa4 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c @@ -83,7 +83,7 @@ static int vegam_smu_init(struct pp_hwmgr *hwmgr) { struct vegam_smumgr *smu_data; - smu_data = kzalloc(sizeof(struct vegam_smumgr), GFP_KERNEL); + smu_data = kzalloc_obj(struct vegam_smumgr, GFP_KERNEL); if (smu_data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 18ece5c714c5..2f02410376b9 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -803,7 +803,7 @@ static int smu_early_init(struct amdgpu_ip_block *ip_block) struct smu_context *smu; int r; - smu = kzalloc(sizeof(struct smu_context), GFP_KERNEL); + smu = kzalloc_obj(struct smu_context, GFP_KERNEL); if (!smu) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c index 0c4afd1e1aab..747879cbb4e6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c @@ -267,7 +267,7 @@ static int arcturus_tables_init(struct smu_context *smu) sizeof(DpmActivityMonitorCoeffInt_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) return -ENOMEM; smu_table->metrics_time = 0; @@ -307,14 +307,14 @@ static int arcturus_allocate_dpm_context(struct smu_context *smu) struct smu_dpm_context *smu_dpm = &smu->smu_dpm; struct smu_dpm_policy *policy; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_11_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_11_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; smu_dpm->dpm_context_size = sizeof(struct smu_11_0_dpm_context); smu_dpm->dpm_policies = - kzalloc(sizeof(struct smu_dpm_policy_ctxt), GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); if (!smu_dpm->dpm_policies) return -ENOMEM; @@ -1579,7 +1579,7 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c index 87953a4d0a43..97a785182e58 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c @@ -97,7 +97,7 @@ static int cyan_skillfish_tables_init(struct smu_context *smu) PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index 737bfdfb814c..48c75e293541 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -516,8 +516,7 @@ static int navi10_tables_init(struct smu_context *smu) dummy_read_1_table->align = PAGE_SIZE; dummy_read_1_table->domain = AMDGPU_GEM_DOMAIN_VRAM; - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_NV1X_t), - GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_NV1X_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -528,7 +527,7 @@ static int navi10_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; @@ -935,8 +934,8 @@ static int navi10_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_11_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_11_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; @@ -2794,7 +2793,7 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 6268bc5ed3e6..2c6378c51333 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -555,7 +555,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_DRIVER_SMU_CONFIG, sizeof(DriverSmuConfigExternal_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -566,7 +566,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; @@ -921,8 +921,8 @@ static int sienna_cichlid_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_11_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_11_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; @@ -2507,7 +2507,7 @@ static int sienna_cichlid_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c index 56efcfa327df..87502f9b5ca4 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c @@ -378,7 +378,7 @@ int smu_v11_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks), GFP_KERNEL); + kzalloc_obj(struct smu_11_0_max_sustainable_clocks, GFP_KERNEL); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index 08179840697e..86d8e5df1eb1 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -253,11 +253,11 @@ static int vangogh_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err3_out; @@ -433,8 +433,8 @@ static int vangogh_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_11_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_11_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c index 31e21ff8859a..f4951630375b 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c @@ -157,16 +157,16 @@ static int renoir_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index ad23682217ee..618d0098208d 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -245,7 +245,7 @@ static int aldebaran_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_ECCINFO, sizeof(EccInfoTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) return -ENOMEM; smu_table->metrics_time = 0; @@ -294,14 +294,14 @@ static int aldebaran_allocate_dpm_context(struct smu_context *smu) struct smu_dpm_context *smu_dpm = &smu->smu_dpm; struct smu_dpm_policy *policy; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_13_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_13_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context); smu_dpm->dpm_policies = - kzalloc(sizeof(struct smu_dpm_policy_ctxt), GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); if (!smu_dpm->dpm_policies) return -ENOMEM; @@ -1422,7 +1422,7 @@ static int aldebaran_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c index 63a65ea802fd..531fb265c948 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -449,7 +449,7 @@ int smu_v13_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc(sizeof(struct smu_13_0_max_sustainable_clocks), GFP_KERNEL); + kzalloc_obj(struct smu_13_0_max_sustainable_clocks, GFP_KERNEL); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; @@ -553,8 +553,8 @@ int smu_v13_0_init_power(struct smu_context *smu) if (smu_power->power_context || smu_power->power_context_size != 0) return -EINVAL; - smu_power->power_context = kzalloc(sizeof(struct smu_13_0_power_context), - GFP_KERNEL); + smu_power->power_context = kzalloc_obj(struct smu_13_0_power_context, + GFP_KERNEL); if (!smu_power->power_context) return -ENOMEM; smu_power->power_context_size = sizeof(struct smu_13_0_power_context); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 468d51f5f918..013942fac955 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -495,7 +495,7 @@ static int smu_v13_0_0_tables_init(struct smu_context *smu) sizeof(WifiBandEntryTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -506,7 +506,7 @@ static int smu_v13_0_0_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; @@ -530,8 +530,8 @@ static int smu_v13_0_0_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_13_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_13_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; @@ -2638,7 +2638,7 @@ static int smu_v13_0_0_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c index f2a6ecb64c03..5ada870f8b65 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c @@ -223,7 +223,7 @@ static int smu_v13_0_12_fru_get_product_info(struct smu_context *smu, struct amdgpu_device *adev = smu->adev; if (!adev->fru_info) { - adev->fru_info = kzalloc(sizeof(*adev->fru_info), GFP_KERNEL); + adev->fru_info = kzalloc_obj(*adev->fru_info, GFP_KERNEL); if (!adev->fru_info) return -ENOMEM; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c index 75b90ac0c29c..9e8b330f34dc 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c @@ -161,16 +161,16 @@ static int smu_v13_0_4_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c index 8ee5002e3d6b..25de5e2dde83 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c @@ -136,16 +136,16 @@ static int smu_v13_0_5_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c index 07592e285cf5..b85130bd8c08 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c @@ -586,7 +586,7 @@ static int smu_v13_0_6_tables_init(struct smu_context *smu) return -ENOMEM; smu_table->metrics_time = 0; - driver_pptable = kzalloc(sizeof(struct PPTable_t), GFP_KERNEL); + driver_pptable = kzalloc_obj(struct PPTable_t, GFP_KERNEL); if (!driver_pptable) return -ENOMEM; @@ -690,13 +690,13 @@ static int smu_v13_0_6_allocate_dpm_context(struct smu_context *smu) struct smu_dpm_policy *policy; smu_dpm->dpm_context = - kzalloc(sizeof(struct smu_13_0_dpm_context), GFP_KERNEL); + kzalloc_obj(struct smu_13_0_dpm_context, GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context); smu_dpm->dpm_policies = - kzalloc(sizeof(struct smu_dpm_policy_ctxt), GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); if (!smu_dpm->dpm_policies) { kfree(smu_dpm->dpm_context); return -ENOMEM; @@ -2341,7 +2341,7 @@ static int smu_v13_0_6_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c index a6c22ae86c98..6aefebdb0bad 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -530,7 +530,7 @@ static int smu_v13_0_7_tables_init(struct smu_context *smu) sizeof(WifiBandEntryTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -541,7 +541,7 @@ static int smu_v13_0_7_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; @@ -559,8 +559,8 @@ static int smu_v13_0_7_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_13_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_13_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; @@ -2400,9 +2400,9 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf if (!buf) return -EINVAL; - activity_monitor_external = kcalloc(PP_SMC_POWER_PROFILE_COUNT, - sizeof(*activity_monitor_external), - GFP_KERNEL); + activity_monitor_external = kzalloc_objs(*activity_monitor_external, + PP_SMC_POWER_PROFILE_COUNT, + GFP_KERNEL); if (!activity_monitor_external) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c index f9789b1fcbf8..e3700c704016 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c @@ -163,16 +163,16 @@ static int yellow_carp_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c index 7dc6687c3693..2cfa8eb70cb3 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c @@ -439,7 +439,7 @@ int smu_v14_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc(sizeof(struct smu_14_0_max_sustainable_clocks), GFP_KERNEL); + kzalloc_obj(struct smu_14_0_max_sustainable_clocks, GFP_KERNEL); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; @@ -538,8 +538,8 @@ int smu_v14_0_init_power(struct smu_context *smu) if (smu_power->power_context || smu_power->power_context_size != 0) return -EINVAL; - smu_power->power_context = kzalloc(sizeof(struct smu_14_0_dpm_context), - GFP_KERNEL); + smu_power->power_context = kzalloc_obj(struct smu_14_0_dpm_context, + GFP_KERNEL); if (!smu_power->power_context) return -ENOMEM; smu_power->power_context_size = sizeof(struct smu_14_0_dpm_context); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c index dbdf7653cc53..a863e637e37f 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c @@ -197,7 +197,7 @@ static int smu_v14_0_0_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -206,7 +206,7 @@ static int smu_v14_0_0_init_smc_tables(struct smu_context *smu) if (!smu_table->clocks_table) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c index becfd356b4e7..b051a1f58760 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c @@ -393,7 +393,7 @@ static int smu_v14_0_2_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_ECCINFO, sizeof(EccInfoTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -404,7 +404,7 @@ static int smu_v14_0_2_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; @@ -428,8 +428,8 @@ static int smu_v14_0_2_allocate_dpm_context(struct smu_context *smu) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; - smu_dpm->dpm_context = kzalloc(sizeof(struct smu_14_0_dpm_context), - GFP_KERNEL); + smu_dpm->dpm_context = kzalloc_obj(struct smu_14_0_dpm_context, + GFP_KERNEL); if (!smu_dpm->dpm_context) return -ENOMEM; @@ -1876,7 +1876,7 @@ static int smu_v14_0_2_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c index a2f446d38be8..2070cb31f185 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c @@ -408,7 +408,7 @@ int smu_v15_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc(sizeof(struct smu_15_0_max_sustainable_clocks), GFP_KERNEL); + kzalloc_obj(struct smu_15_0_max_sustainable_clocks, GFP_KERNEL); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; @@ -507,8 +507,8 @@ int smu_v15_0_init_power(struct smu_context *smu) if (smu_power->power_context || smu_power->power_context_size != 0) return -EINVAL; - smu_power->power_context = kzalloc(sizeof(struct smu_15_0_dpm_context), - GFP_KERNEL); + smu_power->power_context = kzalloc_obj(struct smu_15_0_dpm_context, + GFP_KERNEL); if (!smu_power->power_context) return -ENOMEM; smu_power->power_context_size = sizeof(struct smu_15_0_dpm_context); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c index 660335d7bda9..18c31a50d281 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c @@ -173,16 +173,16 @@ static int smu_v15_0_0_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; - smu_table->clocks_table = kzalloc(sizeof(DpmClocks_t), GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); if (!smu_table->clocks_table) goto err1_out; - smu_table->watermarks_table = kzalloc(sizeof(Watermarks_t), GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c index 59c063625920..611171fea3cb 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c @@ -299,7 +299,7 @@ static int amdgpu_ras_mgr_sw_init(struct amdgpu_ip_block *ip_block) if (!con->uniras_enabled) return 0; - ras_mgr = kzalloc(sizeof(*ras_mgr), GFP_KERNEL); + ras_mgr = kzalloc_obj(*ras_mgr, GFP_KERNEL); if (!ras_mgr) return -EINVAL; diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c index a75479593864..65223bfec688 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c @@ -195,7 +195,7 @@ static int amdgpu_virt_ras_get_cper_records(struct ras_core_context *ras_core, if (!req->buf_size || !req->buf_ptr || !req->cper_num) return RAS_CMD__ERROR_INVALID_INPUT_DATA; - trace = kcalloc(MAX_RECORD_PER_BATCH, sizeof(*trace), GFP_KERNEL); + trace = kzalloc_objs(*trace, MAX_RECORD_PER_BATCH, GFP_KERNEL); if (!trace) return RAS_CMD__ERROR_GENERIC; @@ -365,7 +365,8 @@ int amdgpu_virt_ras_sw_init(struct amdgpu_device *adev) { struct amdgpu_ras_mgr *ras_mgr = amdgpu_ras_mgr_get_context(adev); - ras_mgr->virt_ras_cmd = kzalloc(sizeof(struct amdgpu_virt_ras_cmd), GFP_KERNEL); + ras_mgr->virt_ras_cmd = kzalloc_obj(struct amdgpu_virt_ras_cmd, + GFP_KERNEL); if (!ras_mgr->virt_ras_cmd) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_core.c b/drivers/gpu/drm/amd/ras/rascore/ras_core.c index f2fccdf5e329..e4a6f6cfd2d5 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_core.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_core.c @@ -263,11 +263,11 @@ struct ras_core_context *ras_core_create(struct ras_core_config *init_config) struct ras_core_context *ras_core; struct ras_core_config *config; - ras_core = kzalloc(sizeof(*ras_core), GFP_KERNEL); + ras_core = kzalloc_obj(*ras_core, GFP_KERNEL); if (!ras_core) return NULL; - config = kzalloc(sizeof(*config), GFP_KERNEL); + config = kzalloc_obj(*config, GFP_KERNEL); if (!config) { kfree(ras_core); return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c index 0a838fdcb2f6..5d3e46c7740f 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c @@ -202,7 +202,7 @@ struct ras_log_batch_tag *ras_log_ring_create_batch_tag(struct ras_core_context struct ras_log_batch_tag *batch_tag; unsigned long flags = 0; - batch_tag = kzalloc(sizeof(*batch_tag), GFP_KERNEL); + batch_tag = kzalloc_obj(*batch_tag, GFP_KERNEL); if (!batch_tag) return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c index b19c26f6feaf..7c69a7a8c5f6 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c @@ -199,7 +199,7 @@ int ras_umc_log_bad_bank_pending(struct ras_core_context *ras_core, struct ras_b struct ras_umc *ras_umc = &ras_core->ras_umc; struct ras_bank_ecc_node *ecc_node; - ecc_node = kzalloc(sizeof(*ecc_node), GFP_KERNEL); + ecc_node = kzalloc_obj(*ecc_node, GFP_KERNEL); if (!ecc_node) return -ENOMEM; @@ -246,7 +246,7 @@ int ras_umc_log_bad_bank(struct ras_core_context *ras_core, struct ras_bank_ecc if (ret) goto out; - err_rec = kzalloc(sizeof(*err_rec), GFP_KERNEL); + err_rec = kzalloc_obj(*err_rec, GFP_KERNEL); if (!err_rec) { ret = -ENOMEM; goto out; @@ -454,7 +454,7 @@ int ras_umc_load_bad_pages(struct ras_core_context *ras_core) ras_core->ras_eeprom.record_threshold_config == DISABLE_RETIRE_PAGE) return 0; - bps = kcalloc(ras_num_recs, sizeof(*bps), GFP_KERNEL); + bps = kzalloc_objs(*bps, ras_num_recs, GFP_KERNEL); if (!bps) return -ENOMEM; @@ -512,8 +512,7 @@ int ras_umc_handle_bad_pages(struct ras_core_context *ras_core, void *data) struct eeprom_umc_record *records; int count, ret; - records = kcalloc(MAX_ECC_NUM_PER_RETIREMENT, - sizeof(*records), GFP_KERNEL); + records = kzalloc_objs(*records, MAX_ECC_NUM_PER_RETIREMENT, GFP_KERNEL); if (!records) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 5a66948ffd24..7221dc4731ab 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -503,7 +503,7 @@ static void komeda_crtc_reset(struct drm_crtc *crtc) kfree(to_kcrtc_st(crtc->state)); crtc->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -514,7 +514,7 @@ komeda_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct komeda_crtc_state *old = to_kcrtc_st(crtc->state); struct komeda_crtc_state *new; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index 3ca461eb0a24..ec34491f4f8b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -165,7 +165,7 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file, struct komeda_fb *kfb; int ret = 0, i; - kfb = kzalloc(sizeof(*kfb), GFP_KERNEL); + kfb = kzalloc_obj(*kfb, GFP_KERNEL); if (!kfb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index c20ff72f0ae5..05342c6d5b6d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -142,7 +142,7 @@ static void komeda_plane_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_plane_reset(plane, &state->base); } @@ -155,7 +155,7 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; @@ -247,7 +247,7 @@ static int komeda_plane_add(struct komeda_kms_dev *kms, u32 *formats, n_formats = 0; int err; - kplane = kzalloc(sizeof(*kplane), GFP_KERNEL); + kplane = kzalloc_obj(*kplane, GFP_KERNEL); if (!kplane) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c index 914400c4af73..56703456fbfa 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c @@ -50,7 +50,7 @@ static int komeda_layer_obj_add(struct komeda_kms_dev *kms, { struct komeda_layer_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -92,7 +92,7 @@ static int komeda_scaler_obj_add(struct komeda_kms_dev *kms, { struct komeda_scaler_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -135,7 +135,7 @@ static int komeda_compiz_obj_add(struct komeda_kms_dev *kms, { struct komeda_compiz_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -178,7 +178,7 @@ static int komeda_splitter_obj_add(struct komeda_kms_dev *kms, { struct komeda_splitter_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -221,7 +221,7 @@ static int komeda_merger_obj_add(struct komeda_kms_dev *kms, { struct komeda_merger_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -265,7 +265,7 @@ static int komeda_improc_obj_add(struct komeda_kms_dev *kms, { struct komeda_improc_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -308,7 +308,7 @@ static int komeda_timing_ctrlr_obj_add(struct komeda_kms_dev *kms, { struct komeda_compiz_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -352,7 +352,7 @@ static int komeda_pipeline_obj_add(struct komeda_kms_dev *kms, { struct komeda_pipeline_state *st; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index 875cdbff18c9..5e290815c32b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -149,7 +149,7 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, if (!kcrtc->master->wb_layer) return 0; - kwb_conn = kzalloc(sizeof(*kwb_conn), GFP_KERNEL); + kwb_conn = kzalloc_obj(*kwb_conn, GFP_KERNEL); if (!kwb_conn) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index e61cf362abdf..c3a295f3c82d 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -447,7 +447,7 @@ static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc) return NULL; old_state = to_malidp_crtc_state(crtc->state); - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -478,8 +478,7 @@ static void malidp_crtc_destroy_state(struct drm_crtc *crtc, static void malidp_crtc_reset(struct drm_crtc *crtc) { - struct malidp_crtc_state *state = - kzalloc(sizeof(*state), GFP_KERNEL); + struct malidp_crtc_state *state = kzalloc_obj(*state, GFP_KERNEL); if (crtc->state) malidp_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c index 47733c85d271..81442a011b09 100644 --- a/drivers/gpu/drm/arm/malidp_mw.c +++ b/drivers/gpu/drm/arm/malidp_mw.c @@ -66,8 +66,8 @@ static const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs static void malidp_mw_connector_reset(struct drm_connector *connector) { - struct malidp_mw_connector_state *mw_state = - kzalloc(sizeof(*mw_state), GFP_KERNEL); + struct malidp_mw_connector_state *mw_state = kzalloc_obj(*mw_state, + GFP_KERNEL); if (connector->state) __drm_atomic_helper_connector_destroy_state(connector->state); @@ -98,7 +98,7 @@ malidp_mw_connector_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - mw_state = kzalloc(sizeof(*mw_state), GFP_KERNEL); + mw_state = kzalloc_obj(*mw_state, GFP_KERNEL); if (!mw_state) return NULL; diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index f1a5014bcfa1..1ba8fdf2dc4f 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -81,7 +81,7 @@ static void malidp_plane_reset(struct drm_plane *plane) __drm_atomic_helper_plane_destroy_state(&state->base); kfree(state); plane->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_plane_reset(plane, &state->base); } @@ -94,7 +94,7 @@ drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane) if (!plane->state) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 033b19b31f63..ed57b60d0f12 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -921,7 +921,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, if (IS_ERR(base)) return PTR_ERR(base); - dcrtc = kzalloc(sizeof(*dcrtc), GFP_KERNEL); + dcrtc = kzalloc_obj(*dcrtc, GFP_KERNEL); if (!dcrtc) { DRM_ERROR("failed to allocate Armada crtc\n"); return -ENOMEM; @@ -970,7 +970,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, dcrtc->crtc.port = port; - primary = kzalloc(sizeof(*primary), GFP_KERNEL); + primary = kzalloc_obj(*primary, GFP_KERNEL); if (!primary) { ret = -ENOMEM; goto err_crtc; diff --git a/drivers/gpu/drm/armada/armada_fb.c b/drivers/gpu/drm/armada/armada_fb.c index 77098928f821..9355a7a20a50 100644 --- a/drivers/gpu/drm/armada/armada_fb.c +++ b/drivers/gpu/drm/armada/armada_fb.c @@ -57,7 +57,7 @@ struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - dfb = kzalloc(sizeof(*dfb), GFP_KERNEL); + dfb = kzalloc_obj(*dfb, GFP_KERNEL); if (!dfb) { DRM_ERROR("failed to allocate Armada fb object\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 35fcfa0d85ff..56563816ca54 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -137,7 +137,7 @@ armada_gem_linear_back(struct drm_device *dev, struct armada_gem_object *obj) void __iomem *ptr; int ret; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOSPC; @@ -200,7 +200,7 @@ armada_gem_alloc_private_object(struct drm_device *dev, size_t size) size = roundup_gem_size(size); - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; @@ -221,7 +221,7 @@ static struct armada_gem_object *armada_gem_alloc_object(struct drm_device *dev, size = roundup_gem_size(size); - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; @@ -393,7 +393,7 @@ armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sgt; int i; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return NULL; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 21fd3b4ba10f..c003a8dce805 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -310,7 +310,7 @@ static void armada_overlay_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) { state->colorkey_yr = 0xfefefe00; state->colorkey_ug = 0x01010100; @@ -550,7 +550,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) if (ret) return ret; - overlay = kzalloc(sizeof(*overlay), GFP_KERNEL); + overlay = kzalloc_obj(*overlay, GFP_KERNEL); if (!overlay) return -ENOMEM; diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c index a0326b4f568e..88cac3e7e592 100644 --- a/drivers/gpu/drm/armada/armada_plane.c +++ b/drivers/gpu/drm/armada/armada_plane.c @@ -262,7 +262,7 @@ void armada_plane_reset(struct drm_plane *plane) if (plane->state) __drm_atomic_helper_plane_destroy_state(plane->state); kfree(plane->state); - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (st) __drm_atomic_helper_plane_reset(plane, &st->base); } diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index 8e650a02c528..056b372803b1 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -479,8 +479,8 @@ static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs static void ast_astdp_connector_reset(struct drm_connector *connector) { - struct ast_astdp_connector_state *astdp_state = - kzalloc(sizeof(*astdp_state), GFP_KERNEL); + struct ast_astdp_connector_state *astdp_state = kzalloc_obj(*astdp_state, + GFP_KERNEL); if (connector->state) connector->funcs->atomic_destroy_state(connector, connector->state); @@ -500,7 +500,7 @@ ast_astdp_connector_atomic_duplicate_state(struct drm_connector *connector) if (drm_WARN_ON(dev, !connector->state)) return NULL; - new_astdp_state = kmalloc(sizeof(*new_astdp_state), GFP_KERNEL); + new_astdp_state = kmalloc_obj(*new_astdp_state, GFP_KERNEL); if (!new_astdp_state) return NULL; __drm_atomic_helper_connector_duplicate_state(connector, &new_astdp_state->base); diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 57c6fbc3232b..b017afe7e546 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -876,8 +876,7 @@ static const struct drm_crtc_helper_funcs ast_crtc_helper_funcs = { static void ast_crtc_reset(struct drm_crtc *crtc) { - struct ast_crtc_state *ast_state = - kzalloc(sizeof(*ast_state), GFP_KERNEL); + struct ast_crtc_state *ast_state = kzalloc_obj(*ast_state, GFP_KERNEL); if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); @@ -897,7 +896,7 @@ ast_crtc_atomic_duplicate_state(struct drm_crtc *crtc) if (drm_WARN_ON(dev, !crtc->state)) return NULL; - new_ast_state = kmalloc(sizeof(*new_ast_state), GFP_KERNEL); + new_ast_state = kmalloc_obj(*new_ast_state, GFP_KERNEL); if (!new_ast_state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &new_ast_state->base); diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index b075f291847f..7204ef72c4d2 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -540,7 +540,7 @@ static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -554,7 +554,7 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index c52da47982ee..1a1e76dc4727 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -1194,7 +1194,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) p->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) { if (atmel_hlcdc_plane_alloc_dscrs(p, state)) { kfree(state); diff --git a/drivers/gpu/drm/bridge/aux-bridge.c b/drivers/gpu/drm/bridge/aux-bridge.c index b3e4cdff61d6..50309a23dbea 100644 --- a/drivers/gpu/drm/bridge/aux-bridge.c +++ b/drivers/gpu/drm/bridge/aux-bridge.c @@ -47,7 +47,7 @@ int drm_aux_bridge_register(struct device *parent) struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c index 2e9c702c7087..0f8a0fb50fbc 100644 --- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c @@ -52,7 +52,7 @@ struct auxiliary_device *devm_drm_dp_hpd_bridge_alloc(struct device *parent, str struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 09b289f0fcbf..c094740523ea 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -902,7 +902,7 @@ static u32 *cdns_dsi_bridge_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; @@ -985,7 +985,7 @@ cdns_dsi_bridge_atomic_duplicate_state(struct drm_bridge *bridge) bridge_state = drm_priv_to_bridge_state(bridge->base.state); old_dsi_state = to_cdns_dsi_bridge_state(bridge_state); - dsi_state = kzalloc(sizeof(*dsi_state), GFP_KERNEL); + dsi_state = kzalloc_obj(*dsi_state, GFP_KERNEL); if (!dsi_state) return NULL; @@ -1013,7 +1013,7 @@ cdns_dsi_bridge_atomic_reset(struct drm_bridge *bridge) { struct cdns_dsi_bridge_state *dsi_state; - dsi_state = kzalloc(sizeof(*dsi_state), GFP_KERNEL); + dsi_state = kzalloc_obj(*dsi_state, GFP_KERNEL); if (!dsi_state) return NULL; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 38726ae1bf15..9d41e824e757 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2055,7 +2055,7 @@ cdns_mhdp_bridge_atomic_duplicate_state(struct drm_bridge *bridge) { struct cdns_mhdp_bridge_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -2085,7 +2085,7 @@ cdns_mhdp_bridge_atomic_reset(struct drm_bridge *bridge) { struct cdns_mhdp_bridge_state *cdns_mhdp_state; - cdns_mhdp_state = kzalloc(sizeof(*cdns_mhdp_state), GFP_KERNEL); + cdns_mhdp_state = kzalloc_obj(*cdns_mhdp_state, GFP_KERNEL); if (!cdns_mhdp_state) return NULL; @@ -2105,7 +2105,7 @@ static u32 *cdns_mhdp_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index e9f16dbc9535..f5ffef625a9b 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -116,7 +116,7 @@ static u32 *display_connector_get_output_bus_fmts(struct drm_bridge *bridge, u32 *out_bus_fmts; *num_output_fmts = 1; - out_bus_fmts = kmalloc(sizeof(*out_bus_fmts), GFP_KERNEL); + out_bus_fmts = kmalloc_obj(*out_bus_fmts, GFP_KERNEL); if (!out_bus_fmts) return NULL; @@ -158,7 +158,7 @@ static u32 *display_connector_get_input_bus_fmts(struct drm_bridge *bridge, u32 *in_bus_fmts; *num_input_fmts = 1; - in_bus_fmts = kmalloc(sizeof(*in_bus_fmts), GFP_KERNEL); + in_bus_fmts = kmalloc_obj(*in_bus_fmts, GFP_KERNEL); if (!in_bus_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c index fc67e7ed653d..157cda9d2fb1 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c @@ -319,7 +319,7 @@ imx8qm_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c index ada11eed13cf..eb06266f15fb 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c @@ -333,7 +333,7 @@ imx8qxp_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index 27ad66f240cf..a7dd49e2d3bb 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -216,7 +216,7 @@ imx8qxp_pc_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index 433c080197a2..85976abdda63 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -206,7 +206,7 @@ imx8qxp_pixel_link_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c index 9dc2b3d2ecef..7c86760171dc 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -175,7 +175,7 @@ imx8qxp_pxl2dpi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c index 8f7a0d46601a..e672a37950e0 100644 --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c @@ -609,7 +609,7 @@ static u32 *imx93_dsi_get_input_bus_fmts(void *priv_data, return NULL; } - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; input_fmts[0] = input_fmt; diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c index 3991fb76143c..85fbf57001ec 100644 --- a/drivers/gpu/drm/bridge/ite-it6263.c +++ b/drivers/gpu/drm/bridge/ite-it6263.c @@ -735,7 +735,7 @@ it6263_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, if (!it6263_is_input_bus_fmt_valid(it->lvds_data_mapping)) return NULL; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 1d85e706c74b..810c6984cf6b 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1741,7 +1741,7 @@ samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, { u32 *input_fmts; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 9e48ad39e1cc..10fcec9d653b 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -384,7 +384,7 @@ static void sii8620_mt_msc_cmd_send(struct sii8620 *ctx, static struct sii8620_mt_msg *sii8620_mt_msg_new(struct sii8620 *ctx) { - struct sii8620_mt_msg *msg = kzalloc(sizeof(*msg), GFP_KERNEL); + struct sii8620_mt_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) ctx->error = -ENOMEM; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c index 432342452484..04e2e19c9e25 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c @@ -1809,7 +1809,7 @@ static struct drm_bridge_state *dw_dp_bridge_atomic_duplicate_state(struct drm_b { struct dw_dp_bridge_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 8fc2e282ff11..8d5d8a196479 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -561,7 +561,7 @@ dw_mipi_dsi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, output_fmt, num_input_fmts); /* Fall back to MEDIA_BUS_FMT_FIXED as the only input format. */ - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; input_fmts[0] = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c index 5926a3a05d79..9f06d00569ec 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c @@ -711,7 +711,7 @@ dw_mipi_dsi2_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, output_fmt, num_input_fmts); /* Fall back to MEDIA_BUS_FMT_FIXED as the only input format. */ - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; input_fmts[0] = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 11b5bb50e9f4..cae2ea075670 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -213,7 +213,7 @@ static u32 *tfp410_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c index 28951e392482..f708c0d2bf6a 100644 --- a/drivers/gpu/drm/clients/drm_fbdev_client.c +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c @@ -154,7 +154,7 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info drm_WARN(dev, !dev->registered, "Device has not been registered.\n"); drm_WARN(dev, dev->fb_helper, "fb_helper is already set!\n"); - fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL); + fb_helper = kzalloc_obj(*fb_helper, GFP_KERNEL); if (!fb_helper) return -ENOMEM; drm_fb_helper_prepare(dev, fb_helper, color_mode, NULL); diff --git a/drivers/gpu/drm/clients/drm_log.c b/drivers/gpu/drm/clients/drm_log.c index 2bd5189c967e..1055f05dbfa2 100644 --- a/drivers/gpu/drm/clients/drm_log.c +++ b/drivers/gpu/drm/clients/drm_log.c @@ -248,7 +248,7 @@ static void drm_log_init_client(struct drm_log *dlog) if (!max_modeset) return; - dlog->scanout = kcalloc(max_modeset, sizeof(*dlog->scanout), GFP_KERNEL); + dlog->scanout = kzalloc_objs(*dlog->scanout, max_modeset, GFP_KERNEL); if (!dlog->scanout) return; @@ -419,7 +419,7 @@ void drm_log_register(struct drm_device *dev) { struct drm_log *new; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) goto err_warn; diff --git a/drivers/gpu/drm/display/drm_dp_aux_bus.c b/drivers/gpu/drm/display/drm_dp_aux_bus.c index 2d279e82922f..a36feef1cd6a 100644 --- a/drivers/gpu/drm/display/drm_dp_aux_bus.c +++ b/drivers/gpu/drm/display/drm_dp_aux_bus.c @@ -280,7 +280,7 @@ int of_dp_aux_populate_bus(struct drm_dp_aux *aux, goto err_did_get_np; } - aux_ep_with_data = kzalloc(sizeof(*aux_ep_with_data), GFP_KERNEL); + aux_ep_with_data = kzalloc_obj(*aux_ep_with_data, GFP_KERNEL); if (!aux_ep_with_data) { ret = -ENOMEM; goto err_did_set_populated; diff --git a/drivers/gpu/drm/display/drm_dp_aux_dev.c b/drivers/gpu/drm/display/drm_dp_aux_dev.c index 29555b9f03c8..df02dbca7338 100644 --- a/drivers/gpu/drm/display/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/display/drm_dp_aux_dev.c @@ -75,7 +75,7 @@ static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) struct drm_dp_aux_dev *aux_dev; int index; - aux_dev = kzalloc(sizeof(*aux_dev), GFP_KERNEL); + aux_dev = kzalloc_obj(*aux_dev, GFP_KERNEL); if (!aux_dev) return ERR_PTR(-ENOMEM); aux_dev->aux = aux; diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index be749dcad3b5..954ecaa6fd6b 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -1333,7 +1333,7 @@ static struct drm_dp_mst_branch *drm_dp_add_mst_branch_device(u8 lct, u8 *rad) { struct drm_dp_mst_branch *mstb; - mstb = kzalloc(sizeof(*mstb), GFP_KERNEL); + mstb = kzalloc_obj(*mstb, GFP_KERNEL); if (!mstb) return NULL; @@ -2317,7 +2317,7 @@ drm_dp_mst_add_port(struct drm_device *dev, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb, u8 port_number) { - struct drm_dp_mst_port *port = kzalloc(sizeof(*port), GFP_KERNEL); + struct drm_dp_mst_port *port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return NULL; @@ -2923,7 +2923,7 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, int i, ret, port_mask = 0; bool changed = false; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) return -ENOMEM; @@ -3000,7 +3000,7 @@ drm_dp_send_clear_payload_id_table(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg; int ret; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) return; @@ -3025,7 +3025,7 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg; int ret; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) return -ENOMEM; @@ -3138,7 +3138,7 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, return -EINVAL; } - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3185,7 +3185,7 @@ int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr, if (!port) return -EINVAL; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { drm_dp_mst_topology_put_port(port); return -ENOMEM; @@ -3219,7 +3219,7 @@ int drm_dp_send_query_stream_enc_status(struct drm_dp_mst_topology_mgr *mgr, u8 nonce[7]; int ret; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) return -ENOMEM; @@ -3470,7 +3470,7 @@ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, if (!mstb) return -EINVAL; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3521,7 +3521,7 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, if (!mstb) return -EINVAL; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3562,7 +3562,7 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, { struct drm_dp_sideband_msg_tx *txmsg; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) return -ENOMEM; @@ -4135,7 +4135,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) if (!mgr->up_req_recv.have_eomt) return 0; - up_req = kzalloc(sizeof(*up_req), GFP_KERNEL); + up_req = kzalloc_obj(*up_req, GFP_KERNEL); if (!up_req) { ret = -ENOMEM; goto out_clear_reply; @@ -4479,7 +4479,7 @@ int drm_dp_atomic_find_time_slots(struct drm_atomic_state *state, /* Add the new allocation to the state, note the VCPI isn't assigned until the end */ if (!payload) { - payload = kzalloc(sizeof(*payload), GFP_KERNEL); + payload = kzalloc_obj(*payload, GFP_KERNEL); if (!payload) return -ENOMEM; @@ -4604,8 +4604,9 @@ int drm_dp_mst_atomic_setup_commit(struct drm_atomic_state *state) continue; num_commit_deps = hweight32(mst_state->pending_crtc_mask); - mst_state->commit_deps = kmalloc_array(num_commit_deps, - sizeof(*mst_state->commit_deps), GFP_KERNEL); + mst_state->commit_deps = kmalloc_objs(*mst_state->commit_deps, + num_commit_deps, + GFP_KERNEL); if (!mst_state->commit_deps) return -ENOMEM; mst_state->num_commit_deps = num_commit_deps; @@ -5743,7 +5744,7 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, mgr->max_payloads = max_payloads; mgr->conn_base_id = conn_base_id; - mst_state = kzalloc(sizeof(*mst_state), GFP_KERNEL); + mst_state = kzalloc_obj(*mst_state, GFP_KERNEL); if (mst_state == NULL) return -ENOMEM; @@ -5843,7 +5844,7 @@ static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb, msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr; msg.u.i2c_read.num_bytes_read = msgs[num - 1].len; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { ret = -ENOMEM; goto out; @@ -5883,7 +5884,7 @@ static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb, struct drm_dp_sideband_msg_tx *txmsg = NULL; int ret; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); if (!txmsg) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/display/drm_dp_tunnel.c b/drivers/gpu/drm/display/drm_dp_tunnel.c index 43f13a7c79b9..005ee68e6cd4 100644 --- a/drivers/gpu/drm/display/drm_dp_tunnel.c +++ b/drivers/gpu/drm/display/drm_dp_tunnel.c @@ -476,7 +476,7 @@ create_tunnel(struct drm_dp_tunnel_mgr *mgr, u8 drv_group_id = tunnel_reg_drv_group_id(regs); struct drm_dp_tunnel *tunnel; - tunnel = kzalloc(sizeof(*tunnel), GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); if (!tunnel) return NULL; @@ -1387,7 +1387,7 @@ add_tunnel_state(struct drm_dp_tunnel_group_state *group_state, "Adding state for tunnel %p to group state %p\n", tunnel, group_state); - tunnel_state = kzalloc(sizeof(*tunnel_state), GFP_KERNEL); + tunnel_state = kzalloc_obj(*tunnel_state, GFP_KERNEL); if (!tunnel_state) return NULL; @@ -1458,7 +1458,7 @@ tunnel_group_duplicate_state(struct drm_private_obj *obj) struct drm_dp_tunnel_group_state *group_state; struct drm_dp_tunnel_state *tunnel_state; - group_state = kzalloc(sizeof(*group_state), GFP_KERNEL); + group_state = kzalloc_obj(*group_state, GFP_KERNEL); if (!group_state) return NULL; @@ -1583,7 +1583,7 @@ static bool init_group(struct drm_dp_tunnel_mgr *mgr, struct drm_dp_tunnel_group { struct drm_dp_tunnel_group_state *group_state; - group_state = kzalloc(sizeof(*group_state), GFP_KERNEL); + group_state = kzalloc_obj(*group_state, GFP_KERNEL); if (!group_state) return false; @@ -1644,7 +1644,7 @@ static int resize_bw_array(struct drm_dp_tunnel_state *tunnel_state, if (old_mask == new_mask) return 0; - new_bws = kcalloc(hweight32(new_mask), sizeof(*new_bws), GFP_KERNEL); + new_bws = kzalloc_objs(*new_bws, hweight32(new_mask), GFP_KERNEL); if (!new_bws) return -ENOMEM; @@ -1906,14 +1906,14 @@ drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count) struct drm_dp_tunnel_mgr *mgr; int i; - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (!mgr) return ERR_PTR(-ENOMEM); mgr->dev = dev; init_waitqueue_head(&mgr->bw_req_queue); - mgr->groups = kcalloc(max_group_count, sizeof(*mgr->groups), GFP_KERNEL); + mgr->groups = kzalloc_objs(*mgr->groups, max_group_count, GFP_KERNEL); if (!mgr->groups) { kfree(mgr); diff --git a/drivers/gpu/drm/display/drm_hdmi_cec_helper.c b/drivers/gpu/drm/display/drm_hdmi_cec_helper.c index 3651ad0f76e0..7308ed792089 100644 --- a/drivers/gpu/drm/display/drm_hdmi_cec_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_cec_helper.c @@ -97,7 +97,7 @@ int drmm_connector_hdmi_cec_register(struct drm_connector *connector, if (!funcs->init || !funcs->enable || !funcs->log_addr || !funcs->transmit) return -EINVAL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 52738b80ddbe..a666fca65d6c 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -132,16 +132,17 @@ drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state) */ state->allow_modeset = true; - state->crtcs = kcalloc(dev->mode_config.num_crtc, - sizeof(*state->crtcs), GFP_KERNEL); + state->crtcs = kzalloc_objs(*state->crtcs, dev->mode_config.num_crtc, + GFP_KERNEL); if (!state->crtcs) goto fail; - state->planes = kcalloc(dev->mode_config.num_total_plane, - sizeof(*state->planes), GFP_KERNEL); + state->planes = kzalloc_objs(*state->planes, + dev->mode_config.num_total_plane, + GFP_KERNEL); if (!state->planes) goto fail; - state->colorops = kcalloc(dev->mode_config.num_colorop, - sizeof(*state->colorops), GFP_KERNEL); + state->colorops = kzalloc_objs(*state->colorops, + dev->mode_config.num_colorop, GFP_KERNEL); if (!state->colorops) goto fail; @@ -176,7 +177,7 @@ drm_atomic_state_alloc(struct drm_device *dev) if (!config->funcs->atomic_state_alloc) { struct drm_atomic_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; if (drm_atomic_state_init(dev, state) < 0) { diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index cc1f0c102414..8626f903fdd5 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2453,7 +2453,8 @@ crtc_or_fake_commit(struct drm_atomic_state *state, struct drm_crtc *crtc) } if (!state->fake_commit) { - state->fake_commit = kzalloc(sizeof(*state->fake_commit), GFP_KERNEL); + state->fake_commit = kzalloc_obj(*state->fake_commit, + GFP_KERNEL); if (!state->fake_commit) return NULL; @@ -2524,7 +2525,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, funcs = state->dev->mode_config.helper_private; for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { - commit = kzalloc(sizeof(*commit), GFP_KERNEL); + commit = kzalloc_obj(*commit, GFP_KERNEL); if (!commit) return -ENOMEM; @@ -2553,8 +2554,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, } if (!new_crtc_state->event) { - commit->event = kzalloc(sizeof(*commit->event), - GFP_KERNEL); + commit->event = kzalloc_obj(*commit->event, GFP_KERNEL); if (!commit->event) return -ENOMEM; @@ -4080,7 +4080,7 @@ drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge, { u32 *input_fmts; - input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) { *num_input_fmts = 0; return NULL; diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index cee6d8fc44ad..67812085dca7 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -114,7 +114,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_reset); void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) { struct drm_crtc_state *crtc_state = - kzalloc(sizeof(*crtc->state), GFP_KERNEL); + kzalloc_obj(*crtc->state, GFP_KERNEL); if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); @@ -175,7 +175,7 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_duplicate_state(crtc, state); @@ -333,7 +333,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane) __drm_atomic_helper_plane_destroy_state(plane->state); kfree(plane->state); - plane->state = kzalloc(sizeof(*plane->state), GFP_KERNEL); + plane->state = kzalloc_obj(*plane->state, GFP_KERNEL); if (plane->state) __drm_atomic_helper_plane_reset(plane, plane->state); } @@ -377,7 +377,7 @@ drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_plane_duplicate_state(plane, state); @@ -473,8 +473,8 @@ EXPORT_SYMBOL(__drm_atomic_helper_connector_reset); */ void drm_atomic_helper_connector_reset(struct drm_connector *connector) { - struct drm_connector_state *conn_state = - kzalloc(sizeof(*conn_state), GFP_KERNEL); + struct drm_connector_state *conn_state = kzalloc_obj(*conn_state, + GFP_KERNEL); if (connector->state) __drm_atomic_helper_connector_destroy_state(connector->state); @@ -666,7 +666,7 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_connector_duplicate_state(connector, state); @@ -763,7 +763,7 @@ drm_atomic_helper_bridge_duplicate_state(struct drm_bridge *bridge) if (WARN_ON(!bridge->base.state)) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (new) __drm_atomic_helper_bridge_duplicate_state(bridge, new); @@ -821,7 +821,7 @@ drm_atomic_helper_bridge_reset(struct drm_bridge *bridge) { struct drm_bridge_state *bridge_state; - bridge_state = kzalloc(sizeof(*bridge_state), GFP_KERNEL); + bridge_state = kzalloc_obj(*bridge_state, GFP_KERNEL); if (!bridge_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index dc013a22bf26..ac2175f5e5b0 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1088,7 +1088,7 @@ static struct drm_pending_vblank_event *create_vblank_event( { struct drm_pending_vblank_event *e = NULL; - e = kzalloc(sizeof *e, GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return NULL; diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index a2556d16bed6..d9d984ae62c4 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -132,7 +132,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) { struct drm_master *master; - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return NULL; diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 6852d73c931c..9a81992b04e9 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -459,7 +459,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, drm_dbg_atomic(dev, "[CRTC:%d:%s] calculating normalized zpos values\n", crtc->base.id, crtc->name); - states = kmalloc_array(total_planes, sizeof(*states), GFP_KERNEL); + states = kmalloc_objs(*states, total_planes, GFP_KERNEL); if (!states) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 3b165a0d1e77..5518760a88c1 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1189,7 +1189,7 @@ drm_atomic_bridge_chain_select_bus_fmts(struct drm_bridge *bridge, return -ENOMEM; } else { num_out_bus_fmts = 1; - out_bus_fmts = kmalloc(sizeof(*out_bus_fmts), GFP_KERNEL); + out_bus_fmts = kmalloc_obj(*out_bus_fmts, GFP_KERNEL); if (!out_bus_fmts) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c index fd34d3755f7c..0562e7235dec 100644 --- a/drivers/gpu/drm/drm_buddy.c +++ b/drivers/gpu/drm/drm_buddy.c @@ -320,16 +320,14 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size) BUG_ON(mm->max_order > DRM_BUDDY_MAX_ORDER); - mm->free_trees = kmalloc_array(DRM_BUDDY_MAX_FREE_TREES, - sizeof(*mm->free_trees), - GFP_KERNEL); + mm->free_trees = kmalloc_objs(*mm->free_trees, DRM_BUDDY_MAX_FREE_TREES, + GFP_KERNEL); if (!mm->free_trees) return -ENOMEM; for_each_free_tree(i) { - mm->free_trees[i] = kmalloc_array(mm->max_order + 1, - sizeof(struct rb_root), - GFP_KERNEL); + mm->free_trees[i] = kmalloc_objs(struct rb_root, + mm->max_order + 1, GFP_KERNEL); if (!mm->free_trees[i]) goto out_free_tree; @@ -339,9 +337,8 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size) mm->n_roots = hweight64(size); - mm->roots = kmalloc_array(mm->n_roots, - sizeof(struct drm_buddy_block *), - GFP_KERNEL); + mm->roots = kmalloc_objs(struct drm_buddy_block *, mm->n_roots, + GFP_KERNEL); if (!mm->roots) goto out_free_tree; diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index a82d741e6630..0e6f4b73827d 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -225,7 +225,7 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, struct drm_framebuffer *fb; int ret; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index fc4caf7da5fc..fce35c27b361 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -44,7 +44,8 @@ int drm_client_modeset_create(struct drm_client_dev *client) int i = 0; /* Add terminating zero entry to enable index less iteration */ - client->modesets = kcalloc(num_crtc + 1, sizeof(*client->modesets), GFP_KERNEL); + client->modesets = kzalloc_objs(*client->modesets, num_crtc + 1, + GFP_KERNEL); if (!client->modesets) return -ENOMEM; @@ -58,8 +59,9 @@ int drm_client_modeset_create(struct drm_client_dev *client) max_connector_count = DRM_CLIENT_MAX_CLONED_CONNECTORS; for (modeset = client->modesets; modeset->crtc; modeset++) { - modeset->connectors = kcalloc(max_connector_count, - sizeof(*modeset->connectors), GFP_KERNEL); + modeset->connectors = kzalloc_objs(*modeset->connectors, + max_connector_count, + GFP_KERNEL); if (!modeset->connectors) goto err_free; } @@ -565,7 +567,7 @@ static int drm_client_pick_crtcs(struct drm_client_dev *client, if (modes[n] == NULL) return best_score; - crtcs = kcalloc(connector_count, sizeof(*crtcs), GFP_KERNEL); + crtcs = kzalloc_objs(*crtcs, connector_count, GFP_KERNEL); if (!crtcs) return best_score; @@ -641,7 +643,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, if (drm_WARN_ON(dev, count <= 0)) return false; - save_enabled = kcalloc(count, sizeof(bool), GFP_KERNEL); + save_enabled = kzalloc_objs(bool, count, GFP_KERNEL); if (!save_enabled) return false; @@ -853,10 +855,10 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, if (!connector_count) return 0; - crtcs = kcalloc(connector_count, sizeof(*crtcs), GFP_KERNEL); - modes = kcalloc(connector_count, sizeof(*modes), GFP_KERNEL); - offsets = kcalloc(connector_count, sizeof(*offsets), GFP_KERNEL); - enabled = kcalloc(connector_count, sizeof(bool), GFP_KERNEL); + crtcs = kzalloc_objs(*crtcs, connector_count, GFP_KERNEL); + modes = kzalloc_objs(*modes, connector_count, GFP_KERNEL); + offsets = kzalloc_objs(*offsets, connector_count, GFP_KERNEL); + enabled = kzalloc_objs(bool, connector_count, GFP_KERNEL); if (!crtcs || !modes || !enabled || !offsets) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c index 44eb823585d2..2f3cd856df03 100644 --- a/drivers/gpu/drm/drm_colorop.c +++ b/drivers/gpu/drm/drm_colorop.c @@ -453,7 +453,7 @@ drm_atomic_helper_colorop_duplicate_state(struct drm_colorop *colorop) if (WARN_ON(!colorop->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_colorop_duplicate_state(colorop, state); @@ -514,7 +514,7 @@ static void __drm_colorop_reset(struct drm_colorop *colorop, void drm_colorop_reset(struct drm_colorop *colorop) { kfree(colorop->state); - colorop->state = kzalloc(sizeof(*colorop->state), GFP_KERNEL); + colorop->state = kzalloc_obj(*colorop->state, GFP_KERNEL); if (colorop->state) __drm_colorop_reset(colorop, colorop->state); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 4f5b27fab475..7528c848ccfb 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -3605,7 +3605,7 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, struct drm_tile_group *tg; int ret; - tg = kzalloc(sizeof(*tg), GFP_KERNEL); + tg = kzalloc_obj(*tg, GFP_KERNEL); if (!tg) return NULL; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index a7797d260f1e..f24b5593b613 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -185,7 +185,7 @@ struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc) { struct dma_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; @@ -845,9 +845,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - connector_set = kmalloc_array(crtc_req->count_connectors, - sizeof(struct drm_connector *), - GFP_KERNEL); + connector_set = kmalloc_objs(struct drm_connector *, + crtc_req->count_connectors, + GFP_KERNEL); if (!connector_set) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 39497493f74c..75b3cf9c1a32 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -602,13 +602,15 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, * Allocate space for the backup of all (non-pointer) encoder and * connector data. */ - save_encoder_crtcs = kcalloc(dev->mode_config.num_encoder, - sizeof(struct drm_crtc *), GFP_KERNEL); + save_encoder_crtcs = kzalloc_objs(struct drm_crtc *, + dev->mode_config.num_encoder, + GFP_KERNEL); if (!save_encoder_crtcs) return -ENOMEM; - save_connector_encoders = kcalloc(dev->mode_config.num_connector, - sizeof(struct drm_encoder *), GFP_KERNEL); + save_connector_encoders = kzalloc_objs(struct drm_encoder *, + dev->mode_config.num_connector, + GFP_KERNEL); if (!save_connector_encoders) { kfree(save_encoder_crtcs); return -ENOMEM; diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c index 6a49e7a0ab84..928cccac527e 100644 --- a/drivers/gpu/drm/drm_damage_helper.c +++ b/drivers/gpu/drm/drm_damage_helper.c @@ -140,7 +140,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, num_clips /= 2; } - rects = kcalloc(num_clips, sizeof(*rects), GFP_KERNEL); + rects = kzalloc_objs(*rects, num_clips, GFP_KERNEL); if (!rects) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index 6b43b1cf2327..835deddcc538 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -224,7 +224,7 @@ static int crtc_crc_open(struct inode *inode, struct file *filep) if (WARN_ON(values_cnt == 0)) return -EINVAL; - entries = kcalloc(DRM_CRC_ENTRIES_NR, sizeof(*entries), GFP_KERNEL); + entries = kzalloc_objs(*entries, DRM_CRC_ENTRIES_NR, GFP_KERNEL); if (!entries) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 26bb7710a462..d248d2b295a0 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2503,7 +2503,7 @@ static const struct drm_edid *_drm_edid_alloc(const void *edid, size_t size) if (!edid || !size || size < EDID_LENGTH) return NULL; - drm_edid = kzalloc(sizeof(*drm_edid), GFP_KERNEL); + drm_edid = kzalloc_obj(*drm_edid, GFP_KERNEL); if (drm_edid) { drm_edid->edid = edid; drm_edid->size = size; @@ -5764,7 +5764,7 @@ static int _drm_edid_to_sad(const struct drm_edid *drm_edid, int i; count = cea_db_payload_len(db) / 3; /* SAD is 3B */ - sads = kcalloc(count, sizeof(*sads), GFP_KERNEL); + sads = kzalloc_objs(*sads, count, GFP_KERNEL); *psads = sads; if (!sads) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index be5e617ceb9f..608763984794 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -136,7 +136,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) struct drm_file *file; int ret; - file = kzalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc_obj(*file, GFP_KERNEL); if (!file) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c index f5889dd8e7aa..52c437746d48 100644 --- a/drivers/gpu/drm/drm_flip_work.c +++ b/drivers/gpu/drm/drm_flip_work.c @@ -37,7 +37,7 @@ static struct drm_flip_task *drm_flip_work_allocate_task(void *data, gfp_t flags { struct drm_flip_task *task; - task = kzalloc(sizeof(*task), flags); + task = kzalloc_obj(*task, flags); if (task) task->data = data; diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 18e753ade001..45963ff2192c 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -747,7 +747,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, ret = -EINVAL; goto out_err1; } - clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); if (!clips) { ret = -ENOMEM; goto out_err1; diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index f7094c4aa97a..4eb96aa589a1 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -684,7 +684,7 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj) npages = obj->size >> PAGE_SHIFT; - pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); if (pages == NULL) return ERR_PTR(-ENOMEM); @@ -832,7 +832,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles, if (!count) return 0; - objs = kvmalloc_array(count, sizeof(struct drm_gem_object *), + objs = kvmalloc_objs(struct drm_gem_object *, count, GFP_KERNEL | __GFP_ZERO); if (!objs) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c index 569d41a65a0b..fa43e586eb49 100644 --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -256,7 +256,8 @@ drm_gem_duplicate_shadow_plane_state(struct drm_plane *plane) if (!plane_state) return NULL; - new_shadow_plane_state = kzalloc(sizeof(*new_shadow_plane_state), GFP_KERNEL); + new_shadow_plane_state = kzalloc_obj(*new_shadow_plane_state, + GFP_KERNEL); if (!new_shadow_plane_state) return NULL; __drm_gem_duplicate_shadow_plane_state(plane, new_shadow_plane_state); @@ -337,7 +338,7 @@ void drm_gem_reset_shadow_plane(struct drm_plane *plane) plane->state = NULL; /* must be set to NULL here */ } - shadow_plane_state = kzalloc(sizeof(*shadow_plane_state), GFP_KERNEL); + shadow_plane_state = kzalloc_obj(*shadow_plane_state, GFP_KERNEL); __drm_gem_reset_shadow_plane(plane, shadow_plane_state); } EXPORT_SYMBOL(drm_gem_reset_shadow_plane); diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index eb56ba234796..ffcdf733984f 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -82,7 +82,7 @@ __drm_gem_dma_create(struct drm_device *drm, size_t size, bool private) return ERR_CAST(gem_obj); dma_obj = to_drm_gem_dma_obj(gem_obj); } else { - dma_obj = kzalloc(sizeof(*dma_obj), GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); if (!dma_obj) return ERR_PTR(-ENOMEM); gem_obj = &dma_obj->base; @@ -428,7 +428,7 @@ struct sg_table *drm_gem_dma_get_sg_table(struct drm_gem_dma_object *dma_obj) struct sg_table *sgt; int ret; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 9fd4eb02a20f..e8b81ea55878 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -238,7 +238,7 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file, struct drm_framebuffer *fb; int ret; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 3871a6d92f77..4acc632e73b1 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -127,7 +127,7 @@ __drm_gem_shmem_create(struct drm_device *dev, size_t size, bool private) return ERR_CAST(obj); shmem = to_drm_gem_shmem_obj(obj); } else { - shmem = kzalloc(sizeof(*shmem), GFP_KERNEL); + shmem = kzalloc_obj(*shmem, GFP_KERNEL); if (!shmem) return ERR_PTR(-ENOMEM); obj = &shmem->base; diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 5e5b70518dbe..27ceae40cfe3 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -197,7 +197,7 @@ struct drm_gem_vram_object *drm_gem_vram_create(struct drm_device *dev, return ERR_CAST(gem); gbo = drm_gem_vram_of_gem(gem); } else { - gbo = kzalloc(sizeof(*gbo), GFP_KERNEL); + gbo = kzalloc_obj(*gbo, GFP_KERNEL); if (!gbo) return ERR_PTR(-ENOMEM); gem = &gbo->bo.base; @@ -721,7 +721,7 @@ static struct ttm_tt *bo_driver_ttm_tt_create(struct ttm_buffer_object *bo, struct ttm_tt *tt; int ret; - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); if (!tt) return NULL; @@ -890,7 +890,7 @@ static struct drm_vram_mm *drm_vram_helper_alloc_mm(struct drm_device *dev, uint if (WARN_ON(dev->vram_mm)) return dev->vram_mm; - dev->vram_mm = kzalloc(sizeof(*dev->vram_mm), GFP_KERNEL); + dev->vram_mm = kzalloc_obj(*dev->vram_mm, GFP_KERNEL); if (!dev->vram_mm) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index a799447a7575..7570a0e05450 100644 --- a/drivers/gpu/drm/drm_gpusvm.c +++ b/drivers/gpu/drm/drm_gpusvm.c @@ -522,7 +522,7 @@ drm_gpusvm_notifier_alloc(struct drm_gpusvm *gpusvm, unsigned long fault_addr) if (gpusvm->ops->notifier_alloc) notifier = gpusvm->ops->notifier_alloc(); else - notifier = kzalloc(sizeof(*notifier), GFP_KERNEL); + notifier = kzalloc_obj(*notifier, GFP_KERNEL); if (!notifier) return ERR_PTR(-ENOMEM); @@ -629,7 +629,7 @@ drm_gpusvm_range_alloc(struct drm_gpusvm *gpusvm, if (gpusvm->ops->range_alloc) range = gpusvm->ops->range_alloc(gpusvm); else - range = kzalloc(sizeof(*range), GFP_KERNEL); + range = kzalloc_obj(*range, GFP_KERNEL); if (!range) return ERR_PTR(-ENOMEM); @@ -1471,7 +1471,7 @@ map_pages: /* Unlock and restart mapping to allocate memory. */ drm_gpusvm_notifier_unlock(gpusvm); svm_pages->dma_addr = - kvmalloc_array(npages, sizeof(*svm_pages->dma_addr), GFP_KERNEL); + kvmalloc_objs(*svm_pages->dma_addr, npages, GFP_KERNEL); if (!svm_pages->dma_addr) { err = -ENOMEM; goto err_free; diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 14469765a780..9d2f4ae8cc9d 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1060,7 +1060,7 @@ drm_gpuvm_resv_object_alloc(struct drm_device *drm) { struct drm_gem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; @@ -1581,7 +1581,7 @@ drm_gpuvm_bo_create(struct drm_gpuvm *gpuvm, if (ops && ops->vm_bo_alloc) vm_bo = ops->vm_bo_alloc(); else - vm_bo = kzalloc(sizeof(*vm_bo), GFP_KERNEL); + vm_bo = kzalloc_obj(*vm_bo, GFP_KERNEL); if (unlikely(!vm_bo)) return NULL; @@ -2852,7 +2852,7 @@ gpuva_op_alloc(struct drm_gpuvm *gpuvm) if (fn && fn->op_alloc) op = fn->op_alloc(); else - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (unlikely(!op)) return NULL; @@ -2946,7 +2946,7 @@ __drm_gpuvm_sm_map_ops_create(struct drm_gpuvm *gpuvm, } args; int ret; - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (unlikely(!ops)) return ERR_PTR(-ENOMEM); @@ -3080,7 +3080,7 @@ drm_gpuvm_sm_unmap_ops_create(struct drm_gpuvm *gpuvm, } args; int ret; - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (unlikely(!ops)) return ERR_PTR(-ENOMEM); @@ -3130,7 +3130,7 @@ drm_gpuvm_prefetch_ops_create(struct drm_gpuvm *gpuvm, u64 end = addr + range; int ret; - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (!ops) return ERR_PTR(-ENOMEM); @@ -3184,7 +3184,7 @@ drm_gpuvm_bo_unmap_ops_create(struct drm_gpuvm_bo *vm_bo) drm_gem_gpuva_assert_lock_held(vm_bo->vm, vm_bo->obj); - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (!ops) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 94375c6a5425..f0a5cef17164 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -386,8 +386,8 @@ static int fill_object_idr(struct drm_device *dev, int ret; bool universal_planes = READ_ONCE(lessor_priv->universal_planes); - objects = kcalloc(object_count, sizeof(struct drm_mode_object *), - GFP_KERNEL); + objects = kzalloc_objs(struct drm_mode_object *, object_count, + GFP_KERNEL); if (!objects) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index a712e177b350..55542a360adc 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -134,7 +134,7 @@ static struct mipi_dsi_device *mipi_dsi_device_alloc(struct mipi_dsi_host *host) { struct mipi_dsi_device *dsi; - dsi = kzalloc(sizeof(*dsi), GFP_KERNEL); + dsi = kzalloc_obj(*dsi, GFP_KERNEL); if (!dsi) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index e72f855fc495..e1293ef88581 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -75,7 +75,7 @@ struct drm_display_mode *drm_mode_create(struct drm_device *dev) { struct drm_display_mode *nmode; - nmode = kzalloc(sizeof(struct drm_display_mode), GFP_KERNEL); + nmode = kzalloc_obj(struct drm_display_mode, GFP_KERNEL); if (!nmode) return NULL; diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index beb91a13a312..2c806b0146d6 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -148,7 +148,7 @@ void drm_modeset_lock_all(struct drm_device *dev) struct drm_modeset_acquire_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL | __GFP_NOFAIL); if (WARN_ON(!ctx)) return; diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c index 5af518a93192..4e9b5f5f2539 100644 --- a/drivers/gpu/drm/drm_pagemap.c +++ b/drivers/gpu/drm/drm_pagemap.c @@ -94,7 +94,7 @@ drm_pagemap_zdd_alloc(struct drm_pagemap *dpagemap) { struct drm_pagemap_zdd *zdd; - zdd = kmalloc(sizeof(*zdd), GFP_KERNEL); + zdd = kmalloc_obj(*zdd, GFP_KERNEL); if (!zdd) return NULL; @@ -861,7 +861,7 @@ drm_pagemap_dev_hold(struct drm_pagemap *dpagemap) struct drm_pagemap_dev_hold *dev_hold; struct drm_device *drm = dpagemap->drm; - dev_hold = kzalloc(sizeof(*dev_hold), GFP_KERNEL); + dev_hold = kzalloc_obj(*dev_hold, GFP_KERNEL); if (!dev_hold) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_pagemap_util.c b/drivers/gpu/drm/drm_pagemap_util.c index c6ae3357c7fb..c53031308308 100644 --- a/drivers/gpu/drm/drm_pagemap_util.c +++ b/drivers/gpu/drm/drm_pagemap_util.c @@ -94,7 +94,7 @@ out: */ struct drm_pagemap_cache *drm_pagemap_cache_create_devm(struct drm_pagemap_shrinker *shrinker) { - struct drm_pagemap_cache *cache = kzalloc(sizeof(*cache), GFP_KERNEL); + struct drm_pagemap_cache *cache = kzalloc_obj(*cache, GFP_KERNEL); int err; if (!cache) @@ -424,7 +424,7 @@ struct drm_pagemap_shrinker *drm_pagemap_shrinker_create_devm(struct drm_device struct shrinker *shrink; int err; - shrinker = kzalloc(sizeof(*shrinker), GFP_KERNEL); + shrinker = kzalloc_obj(*shrinker, GFP_KERNEL); if (!shrinker) return ERR_PTR(-ENOMEM); @@ -548,7 +548,7 @@ int drm_pagemap_acquire_owner(struct drm_pagemap_peer *peer, } if (!interconnect) { - owner = kmalloc(sizeof(*owner), GFP_KERNEL); + owner = kmalloc_obj(*owner, GFP_KERNEL); if (!owner) { mutex_unlock(&owner_list->lock); return -ENOMEM; diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index bed2562bf911..75ec5ca579b0 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1514,7 +1514,7 @@ retry: } if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { - e = kzalloc(sizeof *e, GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { ret = -ENOMEM; goto out; @@ -1844,9 +1844,8 @@ int drm_plane_create_color_pipeline_property(struct drm_plane *plane, int len = 0; int i; - all_pipelines = kcalloc(num_pipelines + 1, - sizeof(*all_pipelines), - GFP_KERNEL); + all_pipelines = kzalloc_objs(*all_pipelines, num_pipelines + 1, + GFP_KERNEL); if (!all_pipelines) { drm_err(plane->dev, "failed to allocate color pipeline\n"); diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 747d248aaf02..802ddbb7aa88 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -217,8 +217,8 @@ int drm_plane_helper_update_primary(struct drm_plane *plane, struct drm_crtc *cr /* Find current connectors for CRTC */ num_connectors = get_connectors_for_crtc(crtc, NULL, 0); BUG_ON(num_connectors == 0); - connector_list = kcalloc(num_connectors, sizeof(*connector_list), - GFP_KERNEL); + connector_list = kzalloc_objs(*connector_list, num_connectors, + GFP_KERNEL); if (!connector_list) return -ENOMEM; get_connectors_for_crtc(crtc, connector_list, num_connectors); diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 21809a82187b..ad09be486ea0 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -100,7 +100,7 @@ int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, struct drm_prime_member *member; struct rb_node **p, *rb; - member = kmalloc(sizeof(*member), GFP_KERNEL); + member = kmalloc_obj(*member, GFP_KERNEL); if (!member) return -ENOMEM; @@ -780,8 +780,8 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) return 0; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - fil = kzalloc(sizeof(*fil), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); + fil = kzalloc_obj(*fil, GFP_KERNEL); if (!priv || !fil) { ret = -ENOMEM; goto out; @@ -854,7 +854,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev, size_t max_segment = 0; int err; - sg = kmalloc(sizeof(struct sg_table), GFP_KERNEL); + sg = kmalloc_obj(struct sg_table, GFP_KERNEL); if (!sg) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_privacy_screen.c b/drivers/gpu/drm/drm_privacy_screen.c index 8959f7084e0b..d9d0c5a38ffd 100644 --- a/drivers/gpu/drm/drm_privacy_screen.c +++ b/drivers/gpu/drm/drm_privacy_screen.c @@ -395,7 +395,7 @@ struct drm_privacy_screen *drm_privacy_screen_register( struct drm_privacy_screen *priv; int ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index 540cd41d8368..fb8a23832c37 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -107,7 +107,7 @@ struct drm_property *drm_property_create(struct drm_device *dev, if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN)) return NULL; - property = kzalloc(sizeof(struct drm_property), GFP_KERNEL); + property = kzalloc_obj(struct drm_property, GFP_KERNEL); if (!property) return NULL; @@ -417,7 +417,7 @@ int drm_property_add_enum(struct drm_property *property, if (WARN_ON(index >= property->num_values)) return -EINVAL; - prop_enum = kzalloc(sizeof(struct drm_property_enum), GFP_KERNEL); + prop_enum = kzalloc_obj(struct drm_property_enum, GFP_KERNEL); if (!prop_enum) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c index c0948586b7fd..294343259f8a 100644 --- a/drivers/gpu/drm/drm_self_refresh_helper.c +++ b/drivers/gpu/drm/drm_self_refresh_helper.c @@ -238,7 +238,7 @@ int drm_self_refresh_helper_init(struct drm_crtc *crtc) if (WARN_ON(sr_data)) return -EINVAL; - sr_data = kzalloc(sizeof(*sr_data), GFP_KERNEL); + sr_data = kzalloc_obj(*sr_data, GFP_KERNEL); if (!sr_data) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_suballoc.c b/drivers/gpu/drm/drm_suballoc.c index 879ea33dbbc4..e44ad39e310c 100644 --- a/drivers/gpu/drm/drm_suballoc.c +++ b/drivers/gpu/drm/drm_suballoc.c @@ -329,7 +329,7 @@ drm_suballoc_new(struct drm_suballoc_manager *sa_manager, size_t size, if (!align) align = sa_manager->align; - sa = kmalloc(sizeof(*sa), gfp); + sa = kmalloc_obj(*sa, gfp); if (!sa) return ERR_PTR(-ENOMEM); sa->manager = sa_manager; diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 2d4ab745fdad..bed005abf08e 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -557,7 +557,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, int ret; struct drm_syncobj *syncobj; - syncobj = kzalloc(sizeof(struct drm_syncobj), GFP_KERNEL); + syncobj = kzalloc_obj(struct drm_syncobj, GFP_KERNEL); if (!syncobj) return -ENOMEM; @@ -1062,7 +1062,7 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, goto err_free_points; } - entries = kcalloc(count, sizeof(*entries), GFP_KERNEL); + entries = kzalloc_objs(*entries, count, GFP_KERNEL); if (!entries) { timeout = -ENOMEM; goto err_free_points; @@ -1279,7 +1279,7 @@ static int drm_syncobj_array_find(struct drm_file *file_private, goto err_free_handles; } - syncobjs = kmalloc_array(count_handles, sizeof(*syncobjs), GFP_KERNEL); + syncobjs = kmalloc_objs(*syncobjs, count_handles, GFP_KERNEL); if (syncobjs == NULL) { ret = -ENOMEM; goto err_free_handles; @@ -1485,7 +1485,7 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data, goto err_fdget; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { ret = -ENOMEM; goto err_kzalloc; diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index b01ffa4d6509..0dccd5362138 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -349,7 +349,7 @@ int drm_sysfs_connector_add(struct drm_connector *connector) if (connector->kdev) return 0; - kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); + kdev = kzalloc_obj(*kdev, GFP_KERNEL); if (!kdev) return -ENOMEM; @@ -554,7 +554,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) struct device *kdev; int r; - kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); + kdev = kzalloc_obj(*kdev, GFP_KERNEL); if (!kdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 42fe11cc139b..4b196e48c8fe 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -1615,7 +1615,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, u64 seq; int ret; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (e == NULL) { ret = -ENOMEM; goto err_put; @@ -2094,7 +2094,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data, vblank = drm_crtc_vblank_crtc(crtc); - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (e == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c index 58659c16874c..7978b6276a6a 100644 --- a/drivers/gpu/drm/drm_vma_manager.c +++ b/drivers/gpu/drm/drm_vma_manager.c @@ -253,7 +253,7 @@ static int vma_node_allow(struct drm_vma_offset_node *node, * unlikely that an open-file is added twice to a single node so we * don't optimize for this case. OOM is checked below only if the entry * is actually used. */ - new = kmalloc(sizeof(*entry), GFP_KERNEL); + new = kmalloc_obj(*entry, GFP_KERNEL); write_lock(&node->vm_lock); diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c index 95b8a2e4bda6..7b1dbc0df135 100644 --- a/drivers/gpu/drm/drm_writeback.c +++ b/drivers/gpu/drm/drm_writeback.c @@ -422,8 +422,8 @@ int drm_writeback_set_fb(struct drm_connector_state *conn_state, WARN_ON(conn_state->connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK); if (!conn_state->writeback_job) { - conn_state->writeback_job = - kzalloc(sizeof(*conn_state->writeback_job), GFP_KERNEL); + conn_state->writeback_job = kzalloc_obj(*conn_state->writeback_job, + GFP_KERNEL); if (!conn_state->writeback_job) return -ENOMEM; @@ -581,7 +581,7 @@ drm_writeback_get_out_fence(struct drm_writeback_connector *wb_connector) DRM_MODE_CONNECTOR_WRITEBACK)) return NULL; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c index 3a221923f15d..57a82526a54f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c @@ -33,7 +33,7 @@ etnaviv_cmdbuf_suballoc_new(struct device *dev) struct etnaviv_cmdbuf_suballoc *suballoc; int ret; - suballoc = kzalloc(sizeof(*suballoc), GFP_KERNEL); + suballoc = kzalloc_obj(*suballoc, GFP_KERNEL); if (!suballoc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index bb1b84eecec8..06e76d6d2e47 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -66,7 +66,7 @@ static int etnaviv_open(struct drm_device *dev, struct drm_file *file) struct etnaviv_file_private *ctx; int ret, i; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -531,7 +531,7 @@ static int etnaviv_bind(struct device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { dev_err(dev, "failed to allocate private data\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c b/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c index 58d957ee861d..59ea7b9c60b8 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c @@ -182,8 +182,8 @@ int etnaviv_flop_reset_ppu_init(struct etnaviv_drm_private *priv) * (input and output image, and shader), we keep this buffer * for the whole life time the driver is bound */ - priv->flop_reset_data_ppu = - kzalloc(sizeof(*priv->flop_reset_data_ppu), GFP_KERNEL); + priv->flop_reset_data_ppu = kzalloc_obj(*priv->flop_reset_data_ppu, + GFP_KERNEL); if (!priv->flop_reset_data_ppu) return -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 5d8f3b03d4ae..3e330f30eaa2 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -288,7 +288,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get( */ mapping = etnaviv_gem_get_vram_mapping(etnaviv_obj, NULL); if (!mapping) { - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) { ret = -ENOMEM; goto out; @@ -675,7 +675,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj) if (userptr->mm != current->mm) return -EPERM; - pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + pvec = kvmalloc_objs(struct page *, npages, GFP_KERNEL); if (!pvec) return -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index 40a50c60dfff..1d9a4ca5d5e6 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c @@ -126,7 +126,7 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev, npages = size / PAGE_SIZE; etnaviv_obj->sgt = sgt; - etnaviv_obj->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + etnaviv_obj->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); if (!etnaviv_obj->pages) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c index a9611c1a773f..e3accccf22be 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c @@ -38,8 +38,8 @@ static struct etnaviv_gem_submit *submit_create(struct drm_device *dev, if (!submit) return NULL; - submit->pmrs = kcalloc(nr_pmrs, sizeof(struct etnaviv_perfmon_request), - GFP_KERNEL); + submit->pmrs = kzalloc_objs(struct etnaviv_perfmon_request, nr_pmrs, + GFP_KERNEL); if (!submit->pmrs) { kfree(submit); return NULL; @@ -468,9 +468,9 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, * Copy the command submission and bo array to kernel space in * one go, and do this outside of any locks. */ - bos = kvmalloc_array(args->nr_bos, sizeof(*bos), GFP_KERNEL); - relocs = kvmalloc_array(args->nr_relocs, sizeof(*relocs), GFP_KERNEL); - pmrs = kvmalloc_array(args->nr_pmrs, sizeof(*pmrs), GFP_KERNEL); + bos = kvmalloc_objs(*bos, args->nr_bos, GFP_KERNEL); + relocs = kvmalloc_objs(*relocs, args->nr_relocs, GFP_KERNEL); + pmrs = kvmalloc_objs(*pmrs, args->nr_pmrs, GFP_KERNEL); stream = kvmalloc_array(1, args->stream_size, GFP_KERNEL); if (!bos || !relocs || !pmrs || !stream) { ret = -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 94326dddaf6f..0d2a2684b2a6 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1184,7 +1184,7 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu) */ lockdep_assert_held(&gpu->lock); - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c index afe5dd6a9925..7cb29d6daa90 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c @@ -143,7 +143,7 @@ etnaviv_iommuv1_context_alloc(struct etnaviv_iommu_global *global) return context; } - v1_context = kzalloc(sizeof(*v1_context), GFP_KERNEL); + v1_context = kzalloc_obj(*v1_context, GFP_KERNEL); if (!v1_context) { mutex_unlock(&global->lock); return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c index a992be2ede88..2ffb18ccde61 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c @@ -494,7 +494,7 @@ int etnaviv_iommu_global_init(struct etnaviv_gpu *gpu) return 0; } - global = kzalloc(sizeof(*global), GFP_KERNEL); + global = kzalloc_obj(*global, GFP_KERNEL); if (!global) return -ENOMEM; diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index d19e796c2061..03ad7dd8bf07 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -180,7 +180,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_crtc *crtc; int ret; - exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL); + exynos_crtc = kzalloc_obj(*exynos_crtc, GFP_KERNEL); if (!exynos_crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 6cc7bf77bcac..311d5077a2bf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -50,7 +50,7 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) struct drm_exynos_file_private *file_priv; int ret; - file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); if (!file_priv) return -ENOMEM; @@ -245,7 +245,7 @@ static int exynos_drm_bind(struct device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); + private = kzalloc_obj(struct exynos_drm_private, GFP_KERNEL); if (!private) { ret = -ENOMEM; goto err_free_drm; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 6ecd95bcb0c4..b078295c96e2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -66,7 +66,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev, int i; int ret; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 2bea107dd960..aa70e249f512 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -287,7 +287,7 @@ static int g2d_init_cmdlist(struct g2d_data *g2d) return -ENOMEM; } - node = kcalloc(G2D_CMDLIST_NUM, sizeof(*node), GFP_KERNEL); + node = kzalloc_objs(*node, G2D_CMDLIST_NUM, GFP_KERNEL); if (!node) { ret = -ENOMEM; goto err; @@ -459,7 +459,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d, } } - g2d_userptr = kzalloc(sizeof(*g2d_userptr), GFP_KERNEL); + g2d_userptr = kzalloc_obj(*g2d_userptr, GFP_KERNEL); if (!g2d_userptr) return ERR_PTR(-ENOMEM); @@ -470,8 +470,8 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d, offset = userptr & ~PAGE_MASK; end = PAGE_ALIGN(userptr + size); npages = (end - start) >> PAGE_SHIFT; - g2d_userptr->pages = kvmalloc_array(npages, sizeof(*g2d_userptr->pages), - GFP_KERNEL); + g2d_userptr->pages = kvmalloc_objs(*g2d_userptr->pages, npages, + GFP_KERNEL); if (!g2d_userptr->pages) { ret = -ENOMEM; goto err_free; @@ -491,7 +491,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d, } g2d_userptr->npages = npages; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto err_unpin_pages; @@ -1169,7 +1169,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, node->event = NULL; if (req->event_type != G2D_EVENT_NOT) { - e = kzalloc(sizeof(*node->event), GFP_KERNEL); + e = kzalloc_obj(*node->event, GFP_KERNEL); if (!e) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index b9b2f000072d..8b21623c2075 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -152,7 +152,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev, struct drm_gem_object *obj; int ret; - exynos_gem = kzalloc(sizeof(*exynos_gem), GFP_KERNEL); + exynos_gem = kzalloc_obj(*exynos_gem, GFP_KERNEL); if (!exynos_gem) return ERR_PTR(-ENOMEM); @@ -411,7 +411,7 @@ struct sg_table *exynos_drm_gem_prime_get_sg_table(struct drm_gem_object *obj) struct sg_table *sgt; int ret; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 008def51225a..a4d72e12d1a6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -260,7 +260,7 @@ static inline struct exynos_drm_ipp_task * { struct exynos_drm_ipp_task *task; - task = kzalloc(sizeof(*task), GFP_KERNEL); + task = kzalloc_obj(*task, GFP_KERNEL); if (!task) return NULL; @@ -699,7 +699,7 @@ static int exynos_drm_ipp_event_create(struct exynos_drm_ipp_task *task, struct drm_pending_exynos_ipp_event *e = NULL; int ret; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 67afddd566e2..fec9033ec13e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -134,7 +134,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) plane->state = NULL; } - exynos_state = kzalloc(sizeof(*exynos_state), GFP_KERNEL); + exynos_state = kzalloc_obj(*exynos_state, GFP_KERNEL); if (exynos_state) { __drm_atomic_helper_plane_reset(plane, &exynos_state->base); plane->state->zpos = exynos_plane->config->zpos; @@ -148,7 +148,7 @@ exynos_drm_plane_duplicate_state(struct drm_plane *plane) struct exynos_drm_plane_state *copy; exynos_state = to_exynos_plane_state(plane->state); - copy = kzalloc(sizeof(*exynos_state), GFP_KERNEL); + copy = kzalloc_obj(*exynos_state, GFP_KERNEL); if (!copy) return NULL; diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index a9a341ea6507..7702788003a7 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -209,7 +209,7 @@ struct drm_plane *fsl_dcu_drm_primary_create_plane(struct drm_device *dev) struct drm_plane *primary; int ret; - primary = kzalloc(sizeof(*primary), GFP_KERNEL); + primary = kzalloc_obj(*primary, GFP_KERNEL); if (!primary) { DRM_DEBUG_KMS("Failed to allocate primary plane\n"); return NULL; diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c index 06fe7480e7af..df38fefd4722 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_crt.c +++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c @@ -250,11 +250,11 @@ void cdv_intel_crt_init(struct drm_device *dev, struct drm_encoder *encoder; int ret; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto err_free_encoder; diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index 5942a9d46b02..1f6e2f65c33f 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c @@ -939,7 +939,7 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev, vsync = p->vsync; } - mode = kzalloc(sizeof(*mode), GFP_KERNEL); + mode = kzalloc_obj(*mode, GFP_KERNEL); if (!mode) return NULL; diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index 54bf626f0524..4f3fbe31a779 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -1953,13 +1953,13 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev const char *name = NULL; int type = DRM_MODE_CONNECTOR_DisplayPort; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto err_connector; - intel_dp = kzalloc(sizeof(struct cdv_intel_dp), GFP_KERNEL); + intel_dp = kzalloc_obj(struct cdv_intel_dp, GFP_KERNEL); if (!intel_dp) goto err_priv; diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c index 8e93ee0d0ccd..5bfdc7adcaab 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c @@ -284,15 +284,15 @@ void cdv_hdmi_init(struct drm_device *dev, int ddc_reg; int ret; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto err_free_encoder; - hdmi_priv = kzalloc(sizeof(struct mid_intel_hdmi_priv), GFP_KERNEL); + hdmi_priv = kzalloc_obj(struct mid_intel_hdmi_priv, GFP_KERNEL); if (!hdmi_priv) goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c index fbe7fe317393..5b6b0ac77c99 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c @@ -501,17 +501,15 @@ void cdv_intel_lvds_init(struct drm_device *dev, return; } - gma_encoder = kzalloc(sizeof(struct gma_encoder), - GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), - GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto err_free_encoder; - lvds_priv = kzalloc(sizeof(struct cdv_intel_lvds_priv), GFP_KERNEL); + lvds_priv = kzalloc_obj(struct cdv_intel_lvds_priv, GFP_KERNEL); if (!lvds_priv) goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index e69b537ded6b..808feee5fe2a 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -75,7 +75,7 @@ struct drm_framebuffer *psb_framebuffer_create(struct drm_device *dev, struct drm_framebuffer *fb; int ret; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 2e44a2ac2742..238f0dfafacf 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -146,7 +146,7 @@ psb_gem_create(struct drm_device *dev, u64 size, const char *name, bool stolen, size = roundup(size, PAGE_SIZE); - pobj = kzalloc(sizeof(*pobj), GFP_KERNEL); + pobj = kzalloc_obj(*pobj, GFP_KERNEL); if (!pobj) return ERR_PTR(-ENOMEM); obj = &pobj->base; diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c index b60720560830..527adf563bfa 100644 --- a/drivers/gpu/drm/gma500/intel_bios.c +++ b/drivers/gpu/drm/gma500/intel_bios.c @@ -247,8 +247,7 @@ static void parse_lfp_panel_data(struct drm_psb_private *dev_priv, entry = &lvds_lfp_data->data[lvds_options->panel_type]; dvo_timing = &entry->dvo_timing; - panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), - GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); if (panel_fixed_mode == NULL) { dev_err(dev_priv->dev.dev, "out of memory for fixed panel mode\n"); return; @@ -286,7 +285,7 @@ static void parse_sdvo_panel_data(struct drm_psb_private *dev_priv, if (!dvo_timing) return; - panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); if (!panel_fixed_mode) return; @@ -478,7 +477,7 @@ parse_device_mapping(struct drm_psb_private *dev_priv, DRM_DEBUG_KMS("no child dev is parsed from VBT\n"); return; } - dev_priv->child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL); + dev_priv->child_dev = kzalloc_objs(*p_child, count, GFP_KERNEL); if (!dev_priv->child_dev) { DRM_DEBUG_KMS("No memory space for child devices\n"); return; diff --git a/drivers/gpu/drm/gma500/intel_gmbus.c b/drivers/gpu/drm/gma500/intel_gmbus.c index 2b06ba22f9c6..04eba78fa816 100644 --- a/drivers/gpu/drm/gma500/intel_gmbus.c +++ b/drivers/gpu/drm/gma500/intel_gmbus.c @@ -187,7 +187,7 @@ intel_gpio_create(struct drm_psb_private *dev_priv, u32 pin) if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin]) return NULL; - gpio = kzalloc(sizeof(struct intel_gpio), GFP_KERNEL); + gpio = kzalloc_obj(struct intel_gpio, GFP_KERNEL); if (gpio == NULL) return NULL; @@ -399,8 +399,8 @@ int gma_intel_setup_gmbus(struct drm_device *dev) struct drm_psb_private *dev_priv = to_drm_psb_private(dev); int ret, i; - dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus), - GFP_KERNEL); + dev_priv->gmbus = kzalloc_objs(struct intel_gmbus, GMBUS_NUM_PORTS, + GFP_KERNEL); if (dev_priv->gmbus == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/intel_i2c.c b/drivers/gpu/drm/gma500/intel_i2c.c index 9d02a7b6d9a3..e121c7c27638 100644 --- a/drivers/gpu/drm/gma500/intel_i2c.c +++ b/drivers/gpu/drm/gma500/intel_i2c.c @@ -107,7 +107,7 @@ struct gma_i2c_chan *gma_i2c_create(struct drm_device *dev, const u32 reg, { struct gma_i2c_chan *chan; - chan = kzalloc(sizeof(struct gma_i2c_chan), GFP_KERNEL); + chan = kzalloc_obj(struct gma_i2c_chan, GFP_KERNEL); if (!chan) goto out_free; diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c index 0326f3ddc621..16128e84936a 100644 --- a/drivers/gpu/drm/gma500/mid_bios.c +++ b/drivers/gpu/drm/gma500/mid_bios.c @@ -228,7 +228,7 @@ static int mid_get_vbt_data_r10(struct drm_psb_private *dev_priv, u32 addr) if (read_vbt_r10(addr, &vbt)) return -1; - gct = kmalloc_array(vbt.panel_count, sizeof(*gct), GFP_KERNEL); + gct = kmalloc_objs(*gct, vbt.panel_count, GFP_KERNEL); if (!gct) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/mmu.c b/drivers/gpu/drm/gma500/mmu.c index e6753282e70e..7bc6a914a378 100644 --- a/drivers/gpu/drm/gma500/mmu.c +++ b/drivers/gpu/drm/gma500/mmu.c @@ -158,7 +158,7 @@ static inline uint32_t psb_mmu_mask_pte(uint32_t pfn, int type) struct psb_mmu_pd *psb_mmu_alloc_pd(struct psb_mmu_driver *driver, int trap_pagefaults, int invalid_type) { - struct psb_mmu_pd *pd = kmalloc(sizeof(*pd), GFP_KERNEL); + struct psb_mmu_pd *pd = kmalloc_obj(*pd, GFP_KERNEL); uint32_t *v; int i; @@ -260,7 +260,7 @@ void psb_mmu_free_pagedir(struct psb_mmu_pd *pd) static struct psb_mmu_pt *psb_mmu_alloc_pt(struct psb_mmu_pd *pd) { - struct psb_mmu_pt *pt = kmalloc(sizeof(*pt), GFP_KERNEL); + struct psb_mmu_pt *pt = kmalloc_obj(*pt, GFP_KERNEL); void *v; uint32_t clflush_add = pd->driver->clflush_add >> PAGE_SHIFT; uint32_t clflush_count = PAGE_SIZE / clflush_add; @@ -425,7 +425,7 @@ struct psb_mmu_driver *psb_mmu_driver_init(struct drm_device *dev, struct psb_mmu_driver *driver; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); - driver = kmalloc(sizeof(*driver), GFP_KERNEL); + driver = kmalloc_obj(*driver, GFP_KERNEL); if (!driver) return NULL; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index 20d027d552c7..d48c9711e95a 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -633,11 +633,11 @@ void oaktrail_hdmi_init(struct drm_device *dev, struct drm_connector *connector; struct drm_encoder *encoder; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto failed_connector; @@ -677,7 +677,7 @@ void oaktrail_hdmi_setup(struct drm_device *dev) if (!pdev) return; - hdmi_dev = kzalloc(sizeof(struct oaktrail_hdmi_dev), GFP_KERNEL); + hdmi_dev = kzalloc_obj(struct oaktrail_hdmi_dev, GFP_KERNEL); if (!hdmi_dev) { dev_err(dev->dev, "failed to allocate memory\n"); goto out; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c index 48e8ac560a2a..7c02a92c60cb 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c @@ -280,7 +280,7 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev) hdmi_dev = pci_get_drvdata(dev); - i2c_dev = kzalloc(sizeof(struct hdmi_i2c_dev), GFP_KERNEL); + i2c_dev = kzalloc_obj(struct hdmi_i2c_dev, GFP_KERNEL); if (!i2c_dev) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c index 0705ba3813e6..f6ca1559081d 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c @@ -223,7 +223,7 @@ static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev, /* Use the firmware provided data on Moorestown */ if (dev_priv->has_gct) { - mode = kzalloc(sizeof(*mode), GFP_KERNEL); + mode = kzalloc_obj(*mode, GFP_KERNEL); if (!mode) return; @@ -302,11 +302,11 @@ void oaktrail_lvds_init(struct drm_device *dev, struct drm_display_mode *scan; /* *modes, *bios_mode; */ int ret; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) return; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) goto err_free_encoder; diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c b/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c index 939c53fd09e8..2b5ef15df09f 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c @@ -135,7 +135,7 @@ struct gma_i2c_chan *oaktrail_lvds_i2c_init(struct drm_device *dev) struct gma_i2c_chan *chan; int ret; - chan = kzalloc(sizeof(struct gma_i2c_chan), GFP_KERNEL); + chan = kzalloc_obj(struct gma_i2c_chan, GFP_KERNEL); if (!chan) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index 1ff2bd23db74..2864b209fcdf 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c @@ -404,7 +404,7 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev, vsync = p->vsync; } - mode = kzalloc(sizeof(*mode), GFP_KERNEL); + mode = kzalloc_obj(*mode, GFP_KERNEL); if (!mode) return NULL; @@ -487,7 +487,7 @@ void psb_intel_crtc_init(struct drm_device *dev, int pipe, return; gma_crtc->crtc_state = - kzalloc(sizeof(struct psb_intel_crtc_state), GFP_KERNEL); + kzalloc_obj(struct psb_intel_crtc_state, GFP_KERNEL); if (!gma_crtc->crtc_state) { dev_err(dev->dev, "Crtc state error: No memory\n"); kfree(gma_crtc); diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c index f8f3c42e67a7..6183360b1a81 100644 --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c @@ -639,20 +639,20 @@ void psb_intel_lvds_init(struct drm_device *dev, int pipe; int ret; - gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); if (!gma_encoder) { dev_err(dev->dev, "gma_encoder allocation error\n"); return; } encoder = &gma_encoder->base; - gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); if (!gma_connector) { dev_err(dev->dev, "gma_connector allocation error\n"); goto err_free_encoder; } - lvds_priv = kzalloc(sizeof(struct psb_intel_lvds_priv), GFP_KERNEL); + lvds_priv = kzalloc_obj(struct psb_intel_lvds_priv, GFP_KERNEL); if (!lvds_priv) { dev_err(dev->dev, "LVDS private allocation error\n"); goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c index 553e7c7d9bb8..6f973c9044e0 100644 --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c @@ -1977,7 +1977,8 @@ psb_intel_sdvo_dvi_init(struct psb_intel_sdvo *psb_intel_sdvo, int device) struct gma_connector *intel_connector; struct psb_intel_sdvo_connector *psb_intel_sdvo_connector; - psb_intel_sdvo_connector = kzalloc(sizeof(struct psb_intel_sdvo_connector), GFP_KERNEL); + psb_intel_sdvo_connector = kzalloc_obj(struct psb_intel_sdvo_connector, + GFP_KERNEL); if (!psb_intel_sdvo_connector) return false; @@ -2017,7 +2018,8 @@ psb_intel_sdvo_tv_init(struct psb_intel_sdvo *psb_intel_sdvo, int type) struct gma_connector *intel_connector; struct psb_intel_sdvo_connector *psb_intel_sdvo_connector; - psb_intel_sdvo_connector = kzalloc(sizeof(struct psb_intel_sdvo_connector), GFP_KERNEL); + psb_intel_sdvo_connector = kzalloc_obj(struct psb_intel_sdvo_connector, + GFP_KERNEL); if (!psb_intel_sdvo_connector) return false; @@ -2056,7 +2058,8 @@ psb_intel_sdvo_analog_init(struct psb_intel_sdvo *psb_intel_sdvo, int device) struct gma_connector *intel_connector; struct psb_intel_sdvo_connector *psb_intel_sdvo_connector; - psb_intel_sdvo_connector = kzalloc(sizeof(struct psb_intel_sdvo_connector), GFP_KERNEL); + psb_intel_sdvo_connector = kzalloc_obj(struct psb_intel_sdvo_connector, + GFP_KERNEL); if (!psb_intel_sdvo_connector) return false; @@ -2090,7 +2093,8 @@ psb_intel_sdvo_lvds_init(struct psb_intel_sdvo *psb_intel_sdvo, int device) struct gma_connector *intel_connector; struct psb_intel_sdvo_connector *psb_intel_sdvo_connector; - psb_intel_sdvo_connector = kzalloc(sizeof(struct psb_intel_sdvo_connector), GFP_KERNEL); + psb_intel_sdvo_connector = kzalloc_obj(struct psb_intel_sdvo_connector, + GFP_KERNEL); if (!psb_intel_sdvo_connector) return false; @@ -2442,7 +2446,7 @@ bool psb_intel_sdvo_init(struct drm_device *dev, int sdvo_reg) struct psb_intel_sdvo *psb_intel_sdvo; int i; - psb_intel_sdvo = kzalloc(sizeof(struct psb_intel_sdvo), GFP_KERNEL); + psb_intel_sdvo = kzalloc_obj(struct psb_intel_sdvo, GFP_KERNEL); if (!psb_intel_sdvo) return false; diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c index 1726a3fadff8..b3d5df5f7a5c 100644 --- a/drivers/gpu/drm/gud/gud_connector.c +++ b/drivers/gpu/drm/gud/gud_connector.c @@ -246,7 +246,8 @@ static int gud_connector_get_modes(struct drm_connector *connector) if (drm_edid && edid_ctx.edid_override) goto out; - reqmodes = kmalloc_array(GUD_CONNECTOR_MAX_NUM_MODES, sizeof(*reqmodes), GFP_KERNEL); + reqmodes = kmalloc_objs(*reqmodes, GUD_CONNECTOR_MAX_NUM_MODES, + GFP_KERNEL); if (!reqmodes) goto out; @@ -479,7 +480,8 @@ static int gud_connector_add_properties(struct gud_device *gdrm, struct gud_conn unsigned int i, num_properties; int ret; - properties = kcalloc(GUD_CONNECTOR_PROPERTIES_MAX_NUM, sizeof(*properties), GFP_KERNEL); + properties = kzalloc_objs(*properties, GUD_CONNECTOR_PROPERTIES_MAX_NUM, + GFP_KERNEL); if (!properties) return -ENOMEM; @@ -619,7 +621,7 @@ static int gud_connector_create(struct gud_device *gdrm, unsigned int index, int ret, connector_type; u32 flags; - gconn = kzalloc(sizeof(*gconn), GFP_KERNEL); + gconn = kzalloc_obj(*gconn, GFP_KERNEL); if (!gconn) return -ENOMEM; @@ -698,7 +700,7 @@ int gud_get_connectors(struct gud_device *gdrm) unsigned int i, num_connectors; int ret; - descs = kmalloc_array(GUD_CONNECTORS_MAX_NUM, sizeof(*descs), GFP_KERNEL); + descs = kmalloc_objs(*descs, GUD_CONNECTORS_MAX_NUM, GFP_KERNEL); if (!descs) return -ENOMEM; diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 42135a48d92e..66780b9f6026 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -82,7 +82,7 @@ static int gud_get_display_descriptor(struct usb_interface *intf, void *buf; int ret; - buf = kmalloc(sizeof(*desc), GFP_KERNEL); + buf = kmalloc_obj(*desc, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -135,7 +135,7 @@ static int gud_usb_get_status(struct usb_interface *intf) int ret, status = -EIO; u8 *buf; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -255,7 +255,8 @@ static int gud_plane_add_properties(struct gud_device *gdrm) unsigned int i, num_properties; int ret; - properties = kcalloc(GUD_PROPERTIES_MAX_NUM, sizeof(*properties), GFP_KERNEL); + properties = kzalloc_objs(*properties, GUD_PROPERTIES_MAX_NUM, + GFP_KERNEL); if (!properties) return -ENOMEM; @@ -401,7 +402,7 @@ static int gud_alloc_bulk_buffer(struct gud_device *gdrm) return -ENOMEM; num_pages = DIV_ROUND_UP(gdrm->bulk_len, PAGE_SIZE); - pages = kmalloc_array(num_pages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, num_pages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/dvo_ch7017.c b/drivers/gpu/drm/i915/display/dvo_ch7017.c index f10c0fb8d2c8..032c41e55a07 100644 --- a/drivers/gpu/drm/i915/display/dvo_ch7017.c +++ b/drivers/gpu/drm/i915/display/dvo_ch7017.c @@ -207,7 +207,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo, const char *str; u8 val; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ch7xxx.c b/drivers/gpu/drm/i915/display/dvo_ch7xxx.c index 49f02aca818b..b85c9afb0c64 100644 --- a/drivers/gpu/drm/i915/display/dvo_ch7xxx.c +++ b/drivers/gpu/drm/i915/display/dvo_ch7xxx.c @@ -218,7 +218,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo, u8 vendor, device; char *name, *devid; - ch7xxx = kzalloc(sizeof(*ch7xxx), GFP_KERNEL); + ch7xxx = kzalloc_obj(*ch7xxx, GFP_KERNEL); if (ch7xxx == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ivch.c b/drivers/gpu/drm/i915/display/dvo_ivch.c index 0713b2709412..9bcdd02d5f36 100644 --- a/drivers/gpu/drm/i915/display/dvo_ivch.c +++ b/drivers/gpu/drm/i915/display/dvo_ivch.c @@ -269,7 +269,7 @@ static bool ivch_init(struct intel_dvo_device *dvo, u16 temp; int i; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ns2501.c b/drivers/gpu/drm/i915/display/dvo_ns2501.c index 80b71bd6a837..248b79795edf 100644 --- a/drivers/gpu/drm/i915/display/dvo_ns2501.c +++ b/drivers/gpu/drm/i915/display/dvo_ns2501.c @@ -476,7 +476,7 @@ static bool ns2501_init(struct intel_dvo_device *dvo, struct ns2501_priv *ns; unsigned char ch; - ns = kzalloc(sizeof(*ns), GFP_KERNEL); + ns = kzalloc_obj(*ns, GFP_KERNEL); if (ns == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_sil164.c b/drivers/gpu/drm/i915/display/dvo_sil164.c index 017b617a8069..765d2517fb10 100644 --- a/drivers/gpu/drm/i915/display/dvo_sil164.c +++ b/drivers/gpu/drm/i915/display/dvo_sil164.c @@ -143,7 +143,7 @@ static bool sil164_init(struct intel_dvo_device *dvo, struct sil164_priv *sil; unsigned char ch; - sil = kzalloc(sizeof(*sil), GFP_KERNEL); + sil = kzalloc_obj(*sil, GFP_KERNEL); if (sil == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_tfp410.c b/drivers/gpu/drm/i915/display/dvo_tfp410.c index ed560e3438db..9bd8305bc291 100644 --- a/drivers/gpu/drm/i915/display/dvo_tfp410.c +++ b/drivers/gpu/drm/i915/display/dvo_tfp410.c @@ -175,7 +175,7 @@ static bool tfp410_init(struct intel_dvo_device *dvo, struct tfp410_priv *tfp; int id; - tfp = kzalloc(sizeof(*tfp), GFP_KERNEL); + tfp = kzalloc_obj(*tfp, GFP_KERNEL); if (tfp == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index dac781f54661..b46b79eee5bb 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1934,7 +1934,7 @@ void icl_dsi_init(struct intel_display *display, if (port == PORT_NONE) return; - intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL); + intel_dsi = kzalloc_obj(*intel_dsi, GFP_KERNEL); if (!intel_dsi) return; diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 348b1655435e..208d6a449edc 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -323,7 +323,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_atomic_state * intel_atomic_state_alloc(struct drm_device *dev) { - struct intel_atomic_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct intel_atomic_state *state = kzalloc_obj(*state, GFP_KERNEL); if (!state || drm_atomic_state_init(dev, &state->base) < 0) { kfree(state); diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index ae0b922d5bc3..4731afb418da 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -486,8 +486,8 @@ init_bdb_block(struct intel_display *display, if (section_id == BDB_MIPI_SEQUENCE && *(const u8 *)block >= 3) block_size += 5; - entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3), - GFP_KERNEL); + entry = kzalloc_flex(*entry, data, max(min_size, block_size) + 3, + GFP_KERNEL); if (!entry) { kfree(temp_block); return; @@ -852,7 +852,7 @@ parse_lfp_panel_dtd(struct intel_display *display, lfp_data_ptrs, panel_type); - panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); if (!panel_fixed_mode) return; @@ -968,7 +968,7 @@ parse_generic_dtd(struct intel_display *display, dtd = &generic_dtd->dtd[panel->vbt.panel_type]; - panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); if (!panel_fixed_mode) return; @@ -1141,7 +1141,7 @@ parse_sdvo_lvds_data(struct intel_display *display, return; } - panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); if (!panel_fixed_mode) return; @@ -2929,7 +2929,7 @@ parse_general_definitions(struct intel_display *display) "Found VBT child device with type 0x%x\n", child->device_type); - devdata = kzalloc(sizeof(*devdata), GFP_KERNEL); + devdata = kzalloc_obj(*devdata, GFP_KERNEL); if (!devdata) break; @@ -3010,7 +3010,7 @@ init_vbt_missing_defaults(struct intel_display *display) continue; /* Create fake child device config */ - devdata = kzalloc(sizeof(*devdata), GFP_KERNEL); + devdata = kzalloc_obj(*devdata, GFP_KERNEL); if (!devdata) break; diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index 4ee3f5172f4e..e08e477e882a 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -1470,7 +1470,7 @@ int intel_bw_init(struct intel_display *display) { struct intel_bw_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 9bfbfbf34dc0..46375d4972be 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -3409,7 +3409,7 @@ int intel_cdclk_init(struct intel_display *display) { struct intel_cdclk_state *cdclk_state; - cdclk_state = kzalloc(sizeof(*cdclk_state), GFP_KERNEL); + cdclk_state = kzalloc_obj(*cdclk_state, GFP_KERNEL); if (!cdclk_state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_colorop.c b/drivers/gpu/drm/i915/display/intel_colorop.c index 1d84933f05aa..8326916ccdc1 100644 --- a/drivers/gpu/drm/i915/display/intel_colorop.c +++ b/drivers/gpu/drm/i915/display/intel_colorop.c @@ -15,7 +15,7 @@ struct intel_colorop *intel_colorop_alloc(void) { struct intel_colorop *colorop; - colorop = kzalloc(sizeof(*colorop), GFP_KERNEL); + colorop = kzalloc_obj(*colorop, GFP_KERNEL); if (!colorop) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index 682bf1be350d..8712f6a61778 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -86,7 +86,7 @@ static int intel_connector_init(struct intel_connector *connector) * need it we'll free the state and allocate a smaller one on the first * successful commit anyway. */ - conn_state = kzalloc(sizeof(*conn_state), GFP_KERNEL); + conn_state = kzalloc_obj(*conn_state, GFP_KERNEL); if (!conn_state) return -ENOMEM; @@ -105,7 +105,7 @@ struct intel_connector *intel_connector_alloc(void) { struct intel_connector *connector; - connector = kzalloc(sizeof(*connector), GFP_KERNEL); + connector = kzalloc_obj(*connector, GFP_KERNEL); if (!connector) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 5f9a03877ea9..7be2361e52e7 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -1037,7 +1037,7 @@ void intel_crt_init(struct intel_display *display) intel_de_write(display, adpa_reg, adpa); } - crt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL); + crt = kzalloc_obj(struct intel_crt, GFP_KERNEL); if (!crt) return; diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index 778ebc5095c3..e41975b34929 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -168,7 +168,7 @@ struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc) { struct intel_crtc_state *crtc_state; - crtc_state = kmalloc(sizeof(*crtc_state), GFP_KERNEL); + crtc_state = kmalloc_obj(*crtc_state, GFP_KERNEL); if (crtc_state) intel_crtc_state_reset(crtc_state, crtc); @@ -196,7 +196,7 @@ static struct intel_crtc *intel_crtc_alloc(void) struct intel_crtc_state *crtc_state; struct intel_crtc *crtc; - crtc = kzalloc(sizeof(*crtc), GFP_KERNEL); + crtc = kzalloc_obj(*crtc, GFP_KERNEL); if (!crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dbuf_bw.c b/drivers/gpu/drm/i915/display/intel_dbuf_bw.c index 8b8894c37f63..73d22de72226 100644 --- a/drivers/gpu/drm/i915/display/intel_dbuf_bw.c +++ b/drivers/gpu/drm/i915/display/intel_dbuf_bw.c @@ -284,7 +284,7 @@ int intel_dbuf_bw_init(struct intel_display *display) { struct intel_dbuf_bw_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 81b3a6692ca2..4a081b30477c 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -4122,7 +4122,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder) crtc = intel_crtc_for_pipe(display, pipe); - mode = kzalloc(sizeof(*mode), GFP_KERNEL); + mode = kzalloc_obj(*mode, GFP_KERNEL); if (!mode) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 471f236c9ddf..648294f234cc 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -1663,7 +1663,7 @@ struct intel_display *intel_display_device_probe(struct pci_dev *pdev, const struct subplatform_desc *subdesc; enum intel_step step; - display = kzalloc(sizeof(*display), GFP_KERNEL); + display = kzalloc_obj(*display, GFP_KERNEL); if (!display) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c index 9adeebb376b1..6e7e4654eb79 100644 --- a/drivers/gpu/drm/i915/display/intel_display_irq.c +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c @@ -2479,7 +2479,7 @@ intel_display_irq_snapshot_capture(struct intel_display *display) { struct intel_display_irq_snapshot *snapshot; - snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); + snapshot = kzalloc_obj(*snapshot, GFP_ATOMIC); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c b/drivers/gpu/drm/i915/display/intel_display_power_map.c index 9b49952994ce..28b15d9ee45e 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power_map.c +++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c @@ -1823,9 +1823,8 @@ __set_power_wells(struct i915_power_domains *power_domains, power_domains->power_well_count = power_well_count; power_domains->power_wells = - kcalloc(power_well_count, - sizeof(*power_domains->power_wells), - GFP_KERNEL); + kzalloc_objs(*power_domains->power_wells, + power_well_count, GFP_KERNEL); if (!power_domains->power_wells) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_display_rps.c b/drivers/gpu/drm/i915/display/intel_display_rps.c index e77811396474..f37361f87894 100644 --- a/drivers/gpu/drm/i915/display/intel_display_rps.c +++ b/drivers/gpu/drm/i915/display/intel_display_rps.c @@ -59,7 +59,7 @@ void intel_display_rps_boost_after_vblank(struct drm_crtc *crtc, if (drm_crtc_vblank_get(crtc)) return; - wait = kmalloc(sizeof(*wait), GFP_KERNEL); + wait = kmalloc_obj(*wait, GFP_KERNEL); if (!wait) { drm_crtc_vblank_put(crtc); return; diff --git a/drivers/gpu/drm/i915/display/intel_display_snapshot.c b/drivers/gpu/drm/i915/display/intel_display_snapshot.c index 66087302fdbc..f650f15ad394 100644 --- a/drivers/gpu/drm/i915/display/intel_display_snapshot.c +++ b/drivers/gpu/drm/i915/display/intel_display_snapshot.c @@ -28,7 +28,7 @@ struct intel_display_snapshot *intel_display_snapshot_capture(struct intel_displ { struct intel_display_snapshot *snapshot; - snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); + snapshot = kzalloc_obj(*snapshot, GFP_ATOMIC); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c index 1182bc9a2e6d..7e51d8873178 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc.c +++ b/drivers/gpu/drm/i915/display/intel_dmc.c @@ -1417,7 +1417,7 @@ void intel_dmc_init(struct intel_display *display) */ intel_dmc_runtime_pm_get(display); - dmc = kzalloc(sizeof(*dmc), GFP_KERNEL); + dmc = kzalloc_obj(*dmc, GFP_KERNEL); if (!dmc) return; @@ -1547,7 +1547,7 @@ struct intel_dmc_snapshot *intel_dmc_snapshot_capture(struct intel_display *disp if (!HAS_DMC(display)) return NULL; - snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); + snapshot = kzalloc_obj(*snapshot, GFP_ATOMIC); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 24f8e60df9ac..96da2f8da8b5 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -1765,7 +1765,7 @@ mst_stream_encoder_create(struct intel_digital_port *dig_port, enum pipe pipe) struct intel_dp_mst_encoder *intel_mst; struct intel_encoder *encoder; - intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL); + intel_mst = kzalloc_obj(*intel_mst, GFP_KERNEL); if (!intel_mst) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c index faa2b7a46699..62f9bf3371cd 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c +++ b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c @@ -381,8 +381,8 @@ add_inherited_tunnel(struct intel_atomic_state *state, } if (!state->inherited_dp_tunnels) { - state->inherited_dp_tunnels = kzalloc(sizeof(*state->inherited_dp_tunnels), - GFP_KERNEL); + state->inherited_dp_tunnels = kzalloc_obj(*state->inherited_dp_tunnels, + GFP_KERNEL); if (!state->inherited_dp_tunnels) return -ENOMEM; } diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index 58d953472218..05e5c8f839a1 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -280,7 +280,7 @@ intel_dpt_create(struct intel_framebuffer *fb) return ERR_PTR(ret); } - dpt = kzalloc(sizeof(*dpt), GFP_KERNEL); + dpt = kzalloc_obj(*dpt, GFP_KERNEL); if (!dpt) { i915_gem_object_put(dpt_obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c index 91060e2a5762..d9aff12a0a9b 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -974,7 +974,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state, if (!display->params.enable_dsb) return NULL; - dsb = kzalloc(sizeof(*dsb), GFP_KERNEL); + dsb = kzalloc_obj(*dsb, GFP_KERNEL); if (!dsb) goto out; diff --git a/drivers/gpu/drm/i915/display/intel_dsb_buffer.c b/drivers/gpu/drm/i915/display/intel_dsb_buffer.c index 50faf3869b6c..28d63ba2f032 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb_buffer.c +++ b/drivers/gpu/drm/i915/display/intel_dsb_buffer.c @@ -46,7 +46,7 @@ struct intel_dsb_buffer *intel_dsb_buffer_create(struct drm_device *drm, size_t u32 *buf; int ret; - dsb_buf = kzalloc(sizeof(*dsb_buf), GFP_KERNEL); + dsb_buf = kzalloc_obj(*dsb_buf, GFP_KERNEL); if (!dsb_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dsi.c b/drivers/gpu/drm/i915/display/intel_dsi.c index a8f012119165..1ac274964c4c 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi.c +++ b/drivers/gpu/drm/i915/display/intel_dsi.c @@ -87,7 +87,7 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi *intel_dsi, struct intel_dsi_host *host; struct mipi_dsi_device *device; - host = kzalloc(sizeof(*host), GFP_KERNEL); + host = kzalloc_obj(*host, GFP_KERNEL); if (!host) return NULL; @@ -102,7 +102,7 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi *intel_dsi, * devices by ourselves here too. Need to be careful though, because we * don't initialize any of the driver model devices here. */ - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) { kfree(host); return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c index 4b815ce6b1fe..d1e7d758fb70 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c @@ -231,7 +231,7 @@ static void soc_opaque_gpio_set_value(struct intel_connector *connector, { struct gpiod_lookup_table *lookup; - lookup = kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); + lookup = kzalloc_flex(*lookup, table, 2, GFP_KERNEL); if (!lookup) return; diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index c2663d6e2c92..d6fbf4fd29d9 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -494,7 +494,7 @@ void intel_dvo_init(struct intel_display *display) struct intel_encoder *encoder; struct intel_dvo *intel_dvo; - intel_dvo = kzalloc(sizeof(*intel_dvo), GFP_KERNEL); + intel_dvo = kzalloc_obj(*intel_dvo, GFP_KERNEL); if (!intel_dvo) return; diff --git a/drivers/gpu/drm/i915/display/intel_encoder.c b/drivers/gpu/drm/i915/display/intel_encoder.c index 2ffe1f251ef8..b02297d56950 100644 --- a/drivers/gpu/drm/i915/display/intel_encoder.c +++ b/drivers/gpu/drm/i915/display/intel_encoder.c @@ -108,7 +108,7 @@ struct intel_digital_port *intel_dig_port_alloc(void) { struct intel_digital_port *dig_port; - dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL); + dig_port = kzalloc_obj(*dig_port, GFP_KERNEL); if (!dig_port) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index b9bd9b6dfe94..3b6d0d4ccff7 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -2173,7 +2173,7 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, if (ret || !fence) goto flush; - cb = kmalloc(sizeof(*cb), GFP_KERNEL); + cb = kmalloc_obj(*cb, GFP_KERNEL); if (!cb) { dma_fence_put(fence); ret = -ENOMEM; @@ -2361,7 +2361,7 @@ struct intel_framebuffer *intel_framebuffer_alloc(void) { struct intel_framebuffer *intel_fb; - intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); + intel_fb = kzalloc_obj(*intel_fb, GFP_KERNEL); if (!intel_fb) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index 9f39b6990bbd..c0dfa65809f9 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -2294,7 +2294,7 @@ static struct intel_fbc *intel_fbc_create(struct intel_display *display, { struct intel_fbc *fbc; - fbc = kzalloc(sizeof(*fbc), GFP_KERNEL); + fbc = kzalloc_obj(*fbc, GFP_KERNEL); if (!fbc) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_global_state.c b/drivers/gpu/drm/i915/display/intel_global_state.c index 30eff6009e87..49f32828c3f1 100644 --- a/drivers/gpu/drm/i915/display/intel_global_state.c +++ b/drivers/gpu/drm/i915/display/intel_global_state.c @@ -52,7 +52,7 @@ static struct intel_global_commit *commit_new(void) { struct intel_global_commit *commit; - commit = kzalloc(sizeof(*commit), GFP_KERNEL); + commit = kzalloc_obj(*commit, GFP_KERNEL); if (!commit) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c index 2caff677600c..b27330b95145 100644 --- a/drivers/gpu/drm/i915/display/intel_gmbus.c +++ b/drivers/gpu/drm/i915/display/intel_gmbus.c @@ -925,7 +925,7 @@ int intel_gmbus_setup(struct intel_display *display) if (!gmbus_pin) continue; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 7114fc405c29..7c276b7cc929 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -2327,9 +2327,9 @@ static int initialize_hdcp_port_data(struct intel_connector *connector, data->protocol = (u8)shim->protocol; if (!data->streams) - data->streams = kcalloc(INTEL_NUM_PIPES(display), - sizeof(struct hdcp2_streamid_type), - GFP_KERNEL); + data->streams = kzalloc_objs(struct hdcp2_streamid_type, + INTEL_NUM_PIPES(display), + GFP_KERNEL); if (!data->streams) { drm_err(display->drm, "Out of Memory\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c index 781667b710b4..5b941bfa8c17 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c @@ -633,7 +633,7 @@ int intel_hdcp_gsc_init(struct intel_display *display) struct i915_hdcp_arbiter *arbiter; int ret = 0; - arbiter = kzalloc(sizeof(*arbiter), GFP_KERNEL); + arbiter = kzalloc_obj(*arbiter, GFP_KERNEL); if (!arbiter) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_lpe_audio.c b/drivers/gpu/drm/i915/display/intel_lpe_audio.c index 5b41abe1c64d..c7f28b537509 100644 --- a/drivers/gpu/drm/i915/display/intel_lpe_audio.c +++ b/drivers/gpu/drm/i915/display/intel_lpe_audio.c @@ -87,11 +87,11 @@ lpe_audio_platdev_create(struct intel_display *display) struct platform_device *platdev; struct intel_hdmi_lpe_audio_pdata *pdata; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); - rsc = kcalloc(2, sizeof(*rsc), GFP_KERNEL); + rsc = kzalloc_objs(*rsc, 2, GFP_KERNEL); if (!rsc) { kfree(pdata); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 457d60863536..7f085f475664 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -886,7 +886,7 @@ void intel_lvds_init(struct intel_display *display) "LVDS is not present in VBT, but enabled anyway\n"); } - lvds_encoder = kzalloc(sizeof(*lvds_encoder), GFP_KERNEL); + lvds_encoder = kzalloc_obj(*lvds_encoder, GFP_KERNEL); if (!lvds_encoder) return; diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index cbc220310813..e968834dc7b7 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -898,7 +898,7 @@ int intel_opregion_setup(struct intel_display *display) return -ENOTSUPP; } - opregion = kzalloc(sizeof(*opregion), GFP_KERNEL); + opregion = kzalloc_obj(*opregion, GFP_KERNEL); if (!opregion) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index 88eb7ae5765c..8ab5a866fb67 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1409,7 +1409,7 @@ void intel_overlay_setup(struct intel_display *display) if (!engine || !engine->kernel_context) return; - overlay = kzalloc(sizeof(*overlay), GFP_KERNEL); + overlay = kzalloc_obj(*overlay, GFP_KERNEL); if (!overlay) return; @@ -1484,7 +1484,7 @@ intel_overlay_snapshot_capture(struct intel_display *display) if (!overlay || !overlay->active) return NULL; - error = kmalloc(sizeof(*error), GFP_ATOMIC); + error = kmalloc_obj(*error, GFP_ATOMIC); if (error == NULL) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c index 3dc2ed52147f..a5d60180cc7a 100644 --- a/drivers/gpu/drm/i915/display/intel_plane.c +++ b/drivers/gpu/drm/i915/display/intel_plane.c @@ -77,11 +77,11 @@ struct intel_plane *intel_plane_alloc(void) struct intel_plane_state *plane_state; struct intel_plane *plane; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); - plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL); + plane_state = kzalloc_obj(*plane_state, GFP_KERNEL); if (!plane_state) { kfree(plane); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c b/drivers/gpu/drm/i915/display/intel_pmdemand.c index dc44a7a169c1..d12fabbe90de 100644 --- a/drivers/gpu/drm/i915/display/intel_pmdemand.c +++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c @@ -121,7 +121,7 @@ int intel_pmdemand_init(struct intel_display *display) { struct intel_pmdemand_state *pmdemand_state; - pmdemand_state = kzalloc(sizeof(*pmdemand_state), GFP_KERNEL); + pmdemand_state = kzalloc_obj(*pmdemand_state, GFP_KERNEL); if (!pmdemand_state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_rom.c b/drivers/gpu/drm/i915/display/intel_rom.c index c8f615315310..930b9cb9d1b7 100644 --- a/drivers/gpu/drm/i915/display/intel_rom.c +++ b/drivers/gpu/drm/i915/display/intel_rom.c @@ -47,7 +47,7 @@ struct intel_rom *intel_rom_spi(struct drm_device *drm) struct intel_rom *rom; u32 static_region; - rom = kzalloc(sizeof(*rom), GFP_KERNEL); + rom = kzalloc_obj(*rom, GFP_KERNEL); if (!rom) return NULL; @@ -92,7 +92,7 @@ struct intel_rom *intel_rom_pci(struct drm_device *drm) { struct intel_rom *rom; - rom = kzalloc(sizeof(*rom), GFP_KERNEL); + rom = kzalloc_obj(*rom, GFP_KERNEL); if (!rom) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 6c032d81e7ee..273487e8ec5c 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -474,7 +474,7 @@ static bool __intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, if (!buf) return false; - msgs = kcalloc(args_len + 3, sizeof(*msgs), GFP_KERNEL); + msgs = kzalloc_objs(*msgs, args_len + 3, GFP_KERNEL); if (!msgs) { kfree(buf); return false; @@ -2774,11 +2774,11 @@ static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void) struct intel_sdvo_connector *sdvo_connector; struct intel_sdvo_connector_state *conn_state; - sdvo_connector = kzalloc(sizeof(*sdvo_connector), GFP_KERNEL); + sdvo_connector = kzalloc_obj(*sdvo_connector, GFP_KERNEL); if (!sdvo_connector) return NULL; - conn_state = kzalloc(sizeof(*conn_state), GFP_KERNEL); + conn_state = kzalloc_obj(*conn_state, GFP_KERNEL); if (!conn_state) { kfree(sdvo_connector); return NULL; @@ -3389,7 +3389,7 @@ bool intel_sdvo_init(struct intel_display *display, if (!assert_sdvo_port_valid(display, port)) return false; - intel_sdvo = kzalloc(sizeof(*intel_sdvo), GFP_KERNEL); + intel_sdvo = kzalloc_obj(*intel_sdvo, GFP_KERNEL); if (!intel_sdvo) return false; diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c index 064f572bbc85..0f9efe45acf2 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -1977,7 +1977,7 @@ int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) if (drm_WARN_ON(display->drm, tc_port == TC_PORT_NONE)) return -EINVAL; - tc = kzalloc(sizeof(*tc), GFP_KERNEL); + tc = kzalloc_obj(*tc, GFP_KERNEL); if (!tc) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index e3ab49815a3c..2036eaf2d1ff 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1966,7 +1966,7 @@ intel_tv_init(struct intel_display *display) (tv_dac_off & TVDAC_STATE_CHG_EN) != 0) return; - intel_tv = kzalloc(sizeof(*intel_tv), GFP_KERNEL); + intel_tv = kzalloc_obj(*intel_tv, GFP_KERNEL); if (!intel_tv) { return; } diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index a6aab79812e5..edd6ca199106 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -3366,7 +3366,7 @@ int intel_dbuf_init(struct intel_display *display) { struct intel_dbuf_state *dbuf_state; - dbuf_state = kzalloc(sizeof(*dbuf_state), GFP_KERNEL); + dbuf_state = kzalloc_obj(*dbuf_state, GFP_KERNEL); if (!dbuf_state) return -ENOMEM; @@ -3892,7 +3892,7 @@ void intel_wm_state_verify(struct intel_atomic_state *state, if (DISPLAY_VER(display) < 9 || !new_crtc_state->hw.active) return; - hw = kzalloc(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) return; diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index d705af3bf8ba..31625b0070c6 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1919,7 +1919,7 @@ void vlv_dsi_init(struct intel_display *display) else display->dsi.mmio_base = VLV_MIPI_BASE; - intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL); + intel_dsi = kzalloc_obj(*intel_dsi, GFP_KERNEL); if (!intel_dsi) return; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c index c1deea20c28a..50ade188edc5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c @@ -52,7 +52,7 @@ static struct clflush *clflush_work_create(struct drm_i915_gem_object *obj) GEM_BUG_ON(!obj->cache_dirty); - clflush = kmalloc(sizeof(*clflush), GFP_KERNEL); + clflush = kmalloc_obj(*clflush, GFP_KERNEL); if (!clflush) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 3215ef49c975..c364423706c6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -285,7 +285,7 @@ proto_context_create(struct drm_i915_file_private *fpriv, { struct i915_gem_proto_context *pc, *err; - pc = kzalloc(sizeof(*pc), GFP_KERNEL); + pc = kzalloc_obj(*pc, GFP_KERNEL); if (!pc) return ERR_PTR(-ENOMEM); @@ -442,7 +442,7 @@ set_proto_ctx_engines_balance(struct i915_user_extension __user *base, if (num_siblings == 0) return 0; - siblings = kmalloc_array(num_siblings, sizeof(*siblings), GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings, GFP_KERNEL); if (!siblings) return -ENOMEM; @@ -644,9 +644,7 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base, return -EINVAL; } - siblings = kmalloc_array(num_siblings * width, - sizeof(*siblings), - GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings * width, GFP_KERNEL); if (!siblings) return -ENOMEM; @@ -761,7 +759,7 @@ static int set_proto_ctx_engines(struct drm_i915_file_private *fpriv, if (set.num_engines > I915_EXEC_RING_MASK + 1) return -EINVAL; - set.engines = kmalloc_array(set.num_engines, sizeof(*set.engines), GFP_KERNEL); + set.engines = kmalloc_objs(*set.engines, set.num_engines, GFP_KERNEL); if (!set.engines) return -ENOMEM; @@ -1105,7 +1103,7 @@ static struct i915_gem_engines *alloc_engines(unsigned int count) { struct i915_gem_engines *e; - e = kzalloc(struct_size(e, engines, count), GFP_KERNEL); + e = kzalloc_flex(*e, engines, count, GFP_KERNEL); if (!e) return NULL; @@ -1611,7 +1609,7 @@ i915_gem_create_context(struct drm_i915_private *i915, int err; int i; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/drm/i915/gem/i915_gem_create.c index 189ecdd0a9c1..478f4b98bc2d 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_create.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_create.c @@ -54,9 +54,8 @@ static int object_set_placements(struct drm_i915_gem_object *obj, obj->mm.placements = &i915->mm.regions[mr->id]; obj->mm.n_placements = 1; } else { - arr = kmalloc_array(n_placements, - sizeof(struct intel_memory_region *), - GFP_KERNEL); + arr = kmalloc_objs(struct intel_memory_region *, n_placements, + GFP_KERNEL); if (!arr) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c index f4f1c979d1b9..db7166784731 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c @@ -36,7 +36,7 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attach, * Make a copy of the object's sgt, so that we can make an independent * mapping */ - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index d49e96f9be51..c2e91eeb7c16 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -2006,7 +2006,7 @@ static int eb_capture_stage(struct i915_execbuffer *eb) for_each_batch_create_order(eb, j) { struct i915_capture_list *capture; - capture = kmalloc(sizeof(*capture), GFP_KERNEL); + capture = kmalloc_obj(*capture, GFP_KERNEL); if (!capture) continue; @@ -3190,7 +3190,7 @@ eb_composite_fence_create(struct i915_execbuffer *eb, int out_fence_fd) GEM_BUG_ON(!intel_context_is_parent(eb->context)); - fences = kmalloc_array(eb->num_batches, sizeof(*fences), GFP_KERNEL); + fences = kmalloc_objs(*fences, eb->num_batches, GFP_KERNEL); if (!fences) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c index 232b984f60b6..e90fe30cc44e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c @@ -54,7 +54,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) } create_st: - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 4542135b20d5..e10a9e21e6c8 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -730,7 +730,7 @@ mmap_offset_attach(struct drm_i915_gem_object *obj, if (mmo) goto out; - mmo = kmalloc(sizeof(*mmo), GFP_KERNEL); + mmo = kmalloc_obj(*mmo, GFP_KERNEL); if (!mmo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c index aaa15e7b3f17..e9b7d76927bb 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c @@ -32,7 +32,7 @@ i915_gem_object_frontbuffer_get(struct drm_i915_gem_object *obj) if (front) return front; - front = kmalloc(sizeof(*front), GFP_KERNEL); + front = kmalloc_obj(*front, GFP_KERNEL); if (!front) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c index c2f8e5f95696..fa6d174987ac 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c @@ -314,7 +314,7 @@ static void *i915_gem_object_map_page(struct drm_i915_gem_object *obj, if (n_pages > ARRAY_SIZE(stack)) { /* Too big for stack -- allocate temporary array instead */ - pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, n_pages, GFP_KERNEL); if (!pages) return ERR_PTR(-ENOMEM); } @@ -382,7 +382,7 @@ static struct page **i915_gem_object_panic_pages(struct drm_i915_gem_object *obj struct sgt_iter iter; /* For a 3840x2160 32 bits Framebuffer, this should require ~64K */ - pages = kmalloc_array(n_pages, sizeof(*pages), GFP_ATOMIC); + pages = kmalloc_objs(*pages, n_pages, GFP_ATOMIC); if (!pages) return NULL; @@ -437,7 +437,7 @@ struct intel_panic *i915_gem_object_alloc_panic(void) { struct intel_panic *panic; - panic = kzalloc(sizeof(*panic), GFP_KERNEL); + panic = kzalloc_obj(*panic, GFP_KERNEL); return panic; } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index bc799f182850..71a2c2bb5087 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c @@ -47,7 +47,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) if (!vaddr) return -ENOMEM; - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) goto err_pci; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index 95b13d172913..c6c64ba29bc4 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c @@ -222,7 +222,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj) GEM_BUG_ON(obj->write_domain & I915_GEM_GPU_DOMAINS); rebuild_st: - st = kmalloc(sizeof(*st), GFP_KERNEL | __GFP_NOWARN); + st = kmalloc_obj(*st, GFP_KERNEL | __GFP_NOWARN); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index c3e0b8da485c..a577f8df7c60 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -648,7 +648,7 @@ i915_pages_create_for_stolen(struct drm_device *dev, * dma mapping in a single scatterlist. */ - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (st == NULL) return ERR_PTR(-ENOMEM); @@ -783,7 +783,7 @@ static int _i915_gem_object_stolen_init(struct intel_memory_region *mem, !(flags & I915_BO_ALLOC_GPU_ONLY)) return -ENOSPC; - stolen = kzalloc(sizeof(*stolen), GFP_KERNEL); + stolen = kzalloc_obj(*stolen, GFP_KERNEL); if (!stolen) return -ENOMEM; @@ -1074,7 +1074,7 @@ static struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *d struct drm_i915_private *i915 = to_i915(drm); struct intel_stolen_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 7b1a7d01db2b..46ed4ff8658d 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -279,7 +279,7 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, if (i915_ttm_is_ghost_object(bo)) return NULL; - i915_tt = kzalloc(sizeof(*i915_tt), GFP_KERNEL); + i915_tt = kzalloc_obj(*i915_tt, GFP_KERNEL); if (!i915_tt) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index 2f6b33edb9c9..ff2e02113fe6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -498,7 +498,7 @@ __i915_ttm_move(struct ttm_buffer_object *bo, struct dma_fence *dep = fence; if (!I915_SELFTEST_ONLY(fail_work_allocation)) - copy_work = kzalloc(sizeof(*copy_work), GFP_KERNEL); + copy_work = kzalloc_obj(*copy_work, GFP_KERNEL); if (copy_work) { copy_work->i915 = i915; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 77cc3af3d518..6518a02397c6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -109,7 +109,7 @@ static int i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj) return -E2BIG; num_pages = obj->base.size >> PAGE_SHIFT; - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; @@ -258,7 +258,7 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj) if (ret) return ret; - pvec = kvmalloc_array(num_pages, sizeof(struct page *), GFP_KERNEL); + pvec = kvmalloc_objs(struct page *, num_pages, GFP_KERNEL); if (!pvec) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c b/drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c index bac957755068..8caaf325e56a 100644 --- a/drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c +++ b/drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c @@ -38,7 +38,7 @@ static int huge_get_pages(struct drm_i915_gem_object *obj) return -E2BIG; npages = obj->base.size / PAGE_SIZE; - pages = kmalloc(sizeof(*pages), GFP); + pages = kmalloc_obj(*pages, GFP); if (!pages) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c index 02e9bf87f654..44718e728291 100644 --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c @@ -88,7 +88,7 @@ static int get_huge_pages(struct drm_i915_gem_object *obj) if (overflows_type(obj->base.size >> PAGE_SHIFT, unsigned int)) return -E2BIG; - st = kmalloc(sizeof(*st), GFP); + st = kmalloc_obj(*st, GFP); if (!st) return -ENOMEM; @@ -220,7 +220,7 @@ static int fake_get_huge_pages(struct drm_i915_gem_object *obj) if (overflows_type(obj->base.size >> PAGE_SHIFT, unsigned int)) return -E2BIG; - st = kmalloc(sizeof(*st), GFP); + st = kmalloc_obj(*st, GFP); if (!st) return -ENOMEM; @@ -270,7 +270,7 @@ static int fake_get_huge_pages_single(struct drm_i915_gem_object *obj) struct scatterlist *sg; unsigned int page_size; - st = kmalloc(sizeof(*st), GFP); + st = kmalloc_obj(*st, GFP); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c index 3557e9e6f422..ee661b7d3c6f 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c @@ -540,7 +540,7 @@ tiled_blits_create(struct intel_engine_cs *engine, struct rnd_state *prng) u64 hole_size; int err; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index 1330c0b431a7..223a9ca32d22 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c @@ -56,7 +56,7 @@ static int live_nop_switch(void *arg) if (IS_ERR(file)) return PTR_ERR(file); - ctx = kcalloc(nctx, sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_objs(*ctx, nctx, GFP_KERNEL); if (!ctx) { err = -ENOMEM; goto out_file; @@ -317,7 +317,7 @@ static int live_parallel_switch(void *arg) engines = i915_gem_context_lock_engines(ctx); count = engines->num_engines; - data = kcalloc(count, sizeof(*data), GFP_KERNEL); + data = kzalloc_objs(*data, count, GFP_KERNEL); if (!data) { i915_gem_context_unlock_engines(ctx); err = -ENOMEM; @@ -1054,7 +1054,7 @@ __sseu_prepare(const char *name, if (!(flags & (TEST_BUSY | TEST_RESET))) return 0; - *spin = kzalloc(sizeof(**spin), GFP_KERNEL); + *spin = kzalloc_obj(**spin, GFP_KERNEL); if (!*spin) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 0d250d57496a..17829ad57099 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -677,7 +677,7 @@ static int igt_mmap_offset_exhaustion(void *arg) list_for_each_entry_safe(hole, next, &mm->hole_stack, hole_stack) { struct drm_mm_node *resv; - resv = kzalloc(sizeof(*resv), GFP_NOWAIT); + resv = kzalloc_obj(*resv, GFP_NOWAIT); if (!resv) { err = -ENOMEM; goto out_park; diff --git a/drivers/gpu/drm/i915/gem/selftests/mock_context.c b/drivers/gpu/drm/i915/gem/selftests/mock_context.c index fd8babb513e5..35cf3d0dd08f 100644 --- a/drivers/gpu/drm/i915/gem/selftests/mock_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/mock_context.c @@ -17,7 +17,7 @@ mock_context(struct drm_i915_private *i915, struct i915_gem_engines *e; struct intel_sseu null_sseu = {}; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; diff --git a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c index 5cd58e0f0dcf..8eabb6aa2f65 100644 --- a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c @@ -15,7 +15,7 @@ static struct sg_table *mock_map_dma_buf(struct dma_buf_attachment *attachment, struct scatterlist *sg; int i, err; - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) return ERR_PTR(-ENOMEM); @@ -103,7 +103,7 @@ static struct dma_buf *mock_dmabuf(int npages) struct dma_buf *dmabuf; int i; - mock = kmalloc(struct_size(mock, pages, npages), GFP_KERNEL); + mock = kmalloc_flex(*mock, pages, npages, GFP_KERNEL); if (!mock) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c index c2bdc133c89a..6cbf5dc04d9a 100644 --- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c @@ -431,7 +431,7 @@ struct i915_ppgtt *gen6_ppgtt_create(struct intel_gt *gt) struct gen6_ppgtt *ppgtt; int err; - ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); if (!ppgtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index 398d60a66410..1e1d035a0391 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -1006,7 +1006,7 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt, struct i915_ppgtt *ppgtt; int err; - ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); if (!ppgtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c index bf6117d5fc57..e18c019b7725 100644 --- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c @@ -279,7 +279,7 @@ intel_breadcrumbs_create(struct intel_engine_cs *irq_engine) { struct intel_breadcrumbs *b; - b = kzalloc(sizeof(*b), GFP_KERNEL); + b = kzalloc_obj(*b, GFP_KERNEL); if (!b) return NULL; diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index 98a3a7a9de50..53b7554b78b9 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -471,7 +471,7 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id, if (GEM_DEBUG_WARN_ON(gt->engine_class[info->class][info->instance])) return -EINVAL; - engine = kzalloc(sizeof(*engine), GFP_KERNEL); + engine = kzalloc_obj(*engine, GFP_KERNEL); if (!engine) return -ENOMEM; @@ -1311,7 +1311,7 @@ static int measure_breadcrumb_dw(struct intel_context *ce) GEM_BUG_ON(!engine->gt->scratch); - frame = kzalloc(sizeof(*frame), GFP_KERNEL); + frame = kzalloc_obj(*frame, GFP_KERNEL); if (!frame) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 3df683b0402a..546ef2121f44 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -2254,7 +2254,7 @@ static struct execlists_capture *capture_regs(struct intel_engine_cs *engine) const gfp_t gfp = GFP_ATOMIC | __GFP_NOWARN; struct execlists_capture *cap; - cap = kmalloc(sizeof(*cap), gfp); + cap = kmalloc_obj(*cap, gfp); if (!cap) return NULL; @@ -3934,7 +3934,7 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count, unsigned int n; int err; - ve = kzalloc(struct_size(ve, siblings, count), GFP_KERNEL); + ve = kzalloc_flex(*ve, siblings, count, GFP_KERNEL); if (!ve) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c index 5eda98ebc1ae..c1904e0d24c7 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c @@ -865,9 +865,8 @@ void intel_ggtt_init_fences(struct i915_ggtt *ggtt) if (intel_vgpu_active(i915)) num_fences = intel_uncore_read(uncore, vgtif_reg(avail_rs.fence_num)); - ggtt->fence_regs = kcalloc(num_fences, - sizeof(*ggtt->fence_regs), - GFP_KERNEL); + ggtt->fence_regs = kzalloc_objs(*ggtt->fence_regs, num_fences, + GFP_KERNEL); if (!ggtt->fence_regs) num_fences = 0; diff --git a/drivers/gpu/drm/i915/gt/intel_gsc.c b/drivers/gpu/drm/i915/gt/intel_gsc.c index c43febc862dc..d0b61fcc6eb7 100644 --- a/drivers/gpu/drm/i915/gt/intel_gsc.c +++ b/drivers/gpu/drm/i915/gt/intel_gsc.c @@ -204,7 +204,7 @@ static void gsc_init_one(struct drm_i915_private *i915, struct intel_gsc *gsc, } add_device: - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) goto fail; diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c index c7befc5c20d0..372cdc758c5f 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c @@ -144,8 +144,8 @@ node_create(struct intel_gt_buffer_pool *pool, size_t sz, struct intel_gt_buffer_pool_node *node; struct drm_i915_gem_object *obj; - node = kmalloc(sizeof(*node), - GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + node = kmalloc_obj(*node, + GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!node) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_ppgtt.c b/drivers/gpu/drm/i915/gt/intel_ppgtt.c index d07a4f97b943..72d8473a448b 100644 --- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c @@ -17,7 +17,7 @@ struct i915_page_table *alloc_pt(struct i915_address_space *vm, int sz) { struct i915_page_table *pt; - pt = kmalloc(sizeof(*pt), I915_GFP_ALLOW_FAIL); + pt = kmalloc_obj(*pt, I915_GFP_ALLOW_FAIL); if (unlikely(!pt)) return ERR_PTR(-ENOMEM); @@ -36,11 +36,11 @@ struct i915_page_directory *__alloc_pd(int count) { struct i915_page_directory *pd; - pd = kzalloc(sizeof(*pd), I915_GFP_ALLOW_FAIL); + pd = kzalloc_obj(*pd, I915_GFP_ALLOW_FAIL); if (unlikely(!pd)) return NULL; - pd->entry = kcalloc(count, sizeof(*pd->entry), I915_GFP_ALLOW_FAIL); + pd->entry = kzalloc_objs(*pd->entry, count, I915_GFP_ALLOW_FAIL); if (unlikely(!pd->entry)) { kfree(pd); return NULL; diff --git a/drivers/gpu/drm/i915/gt/intel_ring.c b/drivers/gpu/drm/i915/gt/intel_ring.c index b74d9205c0f5..73e342a95dcb 100644 --- a/drivers/gpu/drm/i915/gt/intel_ring.c +++ b/drivers/gpu/drm/i915/gt/intel_ring.c @@ -152,7 +152,7 @@ intel_engine_create_ring(struct intel_engine_cs *engine, int size) GEM_BUG_ON(!is_power_of_2(size)); GEM_BUG_ON(RING_CTL_SIZE(size) & ~RING_NR_PAGES); - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c index 843f72829a24..98a6aadff7dd 100644 --- a/drivers/gpu/drm/i915/gt/intel_timeline.c +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c @@ -151,7 +151,7 @@ __intel_timeline_create(struct intel_gt *gt, struct intel_timeline *timeline; int err; - timeline = kzalloc(sizeof(*timeline), GFP_KERNEL); + timeline = kzalloc_obj(*timeline, GFP_KERNEL); if (!timeline) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c index ece88c612e27..d47a78af3622 100644 --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c @@ -157,8 +157,8 @@ static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa) if (IS_ALIGNED(wal->count, grow)) { /* Either uninitialized or full. */ struct i915_wa *list; - list = kmalloc_array(ALIGN(wal->count + 1, grow), sizeof(*list), - GFP_KERNEL); + list = kmalloc_objs(*list, ALIGN(wal->count + 1, grow), + GFP_KERNEL); if (!list) { drm_err(&i915->drm, "No space for workaround init!\n"); return; diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c index 9e4f0e417b3b..67326bc83310 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c @@ -72,7 +72,7 @@ static struct pulse *pulse_create(void) { struct pulse *p; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return p; diff --git a/drivers/gpu/drm/i915/gt/selftest_execlists.c b/drivers/gpu/drm/i915/gt/selftest_execlists.c index a06b397b6d42..1e99179ce32f 100644 --- a/drivers/gpu/drm/i915/gt/selftest_execlists.c +++ b/drivers/gpu/drm/i915/gt/selftest_execlists.c @@ -3564,7 +3564,7 @@ static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags) unsigned long count; int err = 0; - arg = kmalloc_array(I915_NUM_ENGINES, sizeof(*arg), GFP_KERNEL); + arg = kmalloc_objs(*arg, I915_NUM_ENGINES, GFP_KERNEL); if (!arg) return -ENOMEM; @@ -3648,9 +3648,8 @@ static int live_preempt_smoke(void *arg) u32 *cs; int n; - smoke.contexts = kmalloc_array(smoke.ncontext, - sizeof(*smoke.contexts), - GFP_KERNEL); + smoke.contexts = kmalloc_objs(*smoke.contexts, smoke.ncontext, + GFP_KERNEL); if (!smoke.contexts) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c index 4f252f704975..2204058849bd 100644 --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c @@ -986,7 +986,7 @@ static int __igt_reset_engines(struct intel_gt *gt, h.ctx->sched.priority = 1024; } - threads = kmalloc_array(I915_NUM_ENGINES, sizeof(*threads), GFP_KERNEL); + threads = kmalloc_objs(*threads, I915_NUM_ENGINES, GFP_KERNEL); if (!threads) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c index fdf0e9858607..71f2c2ca71a2 100644 --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c @@ -689,7 +689,7 @@ static int threaded_migrate(struct intel_migrate *migrate, unsigned int i; int err = 0; - thread = kcalloc(n_cpus, sizeof(*thread), GFP_KERNEL); + thread = kzalloc_objs(*thread, n_cpus, GFP_KERNEL); if (!thread) return 0; diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c index 41716ed454b7..166175f0b19c 100644 --- a/drivers/gpu/drm/i915/gt/selftest_rc6.c +++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c @@ -201,7 +201,7 @@ randomised_engines(struct intel_gt *gt, if (!n) return NULL; - engines = kmalloc_array(n, sizeof(*engines), GFP_KERNEL); + engines = kmalloc_objs(*engines, n, GFP_KERNEL); if (!engines) return NULL; diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c index e61bb0bad12c..6e25d39fa193 100644 --- a/drivers/gpu/drm/i915/gt/selftest_slpc.c +++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c @@ -499,7 +499,7 @@ static int live_slpc_tile_interaction(void *arg) struct slpc_thread *threads; int i = 0, ret = 0; - threads = kcalloc(I915_MAX_GT, sizeof(*threads), GFP_KERNEL); + threads = kzalloc_objs(*threads, I915_MAX_GT, GFP_KERNEL); if (!threads) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c index fa36cf920bde..6860b61915b9 100644 --- a/drivers/gpu/drm/i915/gt/selftest_timeline.c +++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c @@ -170,7 +170,7 @@ static int mock_hwsp_freelist(void *arg) state.max = PAGE_SIZE / sizeof(*state.history); state.count = 0; - state.history = kcalloc(state.max, sizeof(*state.history), GFP_KERNEL); + state.history = kzalloc_objs(*state.history, state.max, GFP_KERNEL); if (!state.history) { err = -ENOMEM; goto err_put; @@ -536,9 +536,8 @@ static int live_hwsp_engine(void *arg) * independently to each of their breadcrumb slots. */ - timelines = kvmalloc_array(NUM_TIMELINES * I915_NUM_ENGINES, - sizeof(*timelines), - GFP_KERNEL); + timelines = kvmalloc_objs(*timelines, NUM_TIMELINES * I915_NUM_ENGINES, + GFP_KERNEL); if (!timelines) return -ENOMEM; @@ -611,9 +610,8 @@ static int live_hwsp_alternate(void *arg) * engines. */ - timelines = kvmalloc_array(NUM_TIMELINES * I915_NUM_ENGINES, - sizeof(*timelines), - GFP_KERNEL); + timelines = kvmalloc_objs(*timelines, NUM_TIMELINES * I915_NUM_ENGINES, + GFP_KERNEL); if (!timelines) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_workarounds.c b/drivers/gpu/drm/i915/gt/selftest_workarounds.c index 14a8b25b6204..24ee4ec4c287 100644 --- a/drivers/gpu/drm/i915/gt/selftest_workarounds.c +++ b/drivers/gpu/drm/i915/gt/selftest_workarounds.c @@ -1204,7 +1204,7 @@ live_gpu_reset_workarounds(void *arg) if (!intel_has_gpu_reset(gt)) return 0; - lists = kzalloc(sizeof(*lists), GFP_KERNEL); + lists = kzalloc_obj(*lists, GFP_KERNEL); if (!lists) return -ENOMEM; @@ -1248,7 +1248,7 @@ live_engine_reset_workarounds(void *arg) if (!intel_has_reset_engine(gt)) return 0; - lists = kzalloc(sizeof(*lists), GFP_KERNEL); + lists = kzalloc_obj(*lists, GFP_KERNEL); if (!lists) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 5f37c699a320..1db6aa1e32d8 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -63,7 +63,7 @@ void *shmem_pin_map(struct file *file) void *vaddr; n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT; - pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, n_pages, GFP_KERNEL); if (!pages) return NULL; diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c index 4a81bc396b21..bb4eb815f0ff 100644 --- a/drivers/gpu/drm/i915/gt/sysfs_engines.c +++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c @@ -430,7 +430,7 @@ kobj_engine(struct kobject *dir, struct intel_engine_cs *engine) { struct kobj_engine *ke; - ke = kzalloc(sizeof(*ke), GFP_KERNEL); + ke = kzalloc_obj(*ke, GFP_KERNEL); if (!ke) return NULL; @@ -458,7 +458,7 @@ static void add_defaults(struct kobj_engine *parent) }; struct kobj_engine *ke; - ke = kzalloc(sizeof(*ke), GFP_KERNEL); + ke = kzalloc_obj(*ke, GFP_KERNEL); if (!ke) return; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c index 9547fff672bd..2e7257f5543b 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c @@ -275,7 +275,7 @@ __alloc_ext_regs(struct __guc_mmio_reg_descr_group *newlist, { struct __guc_mmio_reg_descr *list; - list = kcalloc(num_regs, sizeof(struct __guc_mmio_reg_descr), GFP_KERNEL); + list = kzalloc_objs(struct __guc_mmio_reg_descr, num_regs, GFP_KERNEL); if (!list) return -ENOMEM; @@ -320,7 +320,8 @@ guc_capture_alloc_steered_lists(struct intel_guc *guc, return; /* allocate an extra for an end marker */ - extlists = kcalloc(2, sizeof(struct __guc_mmio_reg_descr_group), GFP_KERNEL); + extlists = kzalloc_objs(struct __guc_mmio_reg_descr_group, 2, + GFP_KERNEL); if (!extlists) return; @@ -984,13 +985,14 @@ guc_capture_alloc_one_node(struct intel_guc *guc) struct __guc_capture_parsed_output *new; int i; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; for (i = 0; i < GUC_CAPTURE_LIST_TYPE_MAX; ++i) { - new->reginfo[i].regs = kcalloc(guc->capture->max_mmio_per_node, - sizeof(struct guc_mmio_reg), GFP_KERNEL); + new->reginfo[i].regs = kzalloc_objs(struct guc_mmio_reg, + guc->capture->max_mmio_per_node, + GFP_KERNEL); if (!new->reginfo[i].regs) { while (i) kfree(new->reginfo[--i].regs); @@ -1639,7 +1641,7 @@ void intel_guc_capture_destroy(struct intel_guc *guc) int intel_guc_capture_init(struct intel_guc *guc) { - guc->capture = kzalloc(sizeof(*guc->capture), GFP_KERNEL); + guc->capture = kzalloc_obj(*guc->capture, GFP_KERNEL); if (!guc->capture) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c index f1e53312ed90..8c4da526d461 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c @@ -866,7 +866,7 @@ static struct ct_incoming_msg *ct_alloc_msg(u32 num_dwords) { struct ct_incoming_msg *msg; - msg = kmalloc(struct_size(msg, msg, num_dwords), GFP_ATOMIC); + msg = kmalloc_flex(*msg, msg, num_dwords, GFP_ATOMIC); if (msg) msg->size = num_dwords; return msg; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 68f2b8d363ac..1ba53ff64861 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -2110,7 +2110,7 @@ static int init_tlb_lookup(struct intel_guc *guc) xa_init_flags(&guc->tlb_lookup, XA_FLAGS_ALLOC); - wait = kzalloc(sizeof(*wait), GFP_KERNEL); + wait = kzalloc_obj(*wait, GFP_KERNEL); if (!wait) return -ENOMEM; @@ -4222,9 +4222,7 @@ guc_create_parallel(struct intel_engine_cs **engines, struct intel_context *parent = NULL, *ce, *err; int i, j; - siblings = kmalloc_array(num_siblings, - sizeof(*siblings), - GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings, GFP_KERNEL); if (!siblings) return ERR_PTR(-ENOMEM); @@ -5907,7 +5905,7 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count, unsigned int n; int err; - ve = kzalloc(sizeof(*ve), GFP_KERNEL); + ve = kzalloc_obj(*ve, GFP_KERNEL); if (!ve) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c index 68feb55654f7..8556a3e1ac3f 100644 --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c @@ -153,7 +153,7 @@ static int intel_guc_steal_guc_ids(void *arg) struct i915_request *spin_rq = NULL, *rq, *last = NULL; int number_guc_id_stolen = guc->number_guc_id_stolen; - ce = kcalloc(GUC_MAX_CONTEXT_ID, sizeof(*ce), GFP_KERNEL); + ce = kzalloc_objs(*ce, GUC_MAX_CONTEXT_ID, GFP_KERNEL); if (!ce) { guc_err(guc, "Context array allocation failed\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index bf7c3d3f5f8a..d5d00cb84f2f 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -1921,7 +1921,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) if (ret) return ret; - bb = kzalloc(sizeof(*bb), GFP_KERNEL); + bb = kzalloc_obj(*bb, GFP_KERNEL); if (!bb) return -ENOMEM; @@ -3226,7 +3226,7 @@ static int init_cmd_table(struct intel_gvt *gvt) if (!(cmd_info[i].devices & gen_type)) continue; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c index ae3fd2c3cd23..36f55861228f 100644 --- a/drivers/gpu/drm/i915/gvt/debugfs.c +++ b/drivers/gpu/drm/i915/gvt/debugfs.c @@ -68,7 +68,7 @@ static inline int mmio_diff_handler(struct intel_gvt *gvt, vreg = vgpu_vreg(param->vgpu, offset); if (preg != vreg) { - node = kmalloc(sizeof(*node), GFP_ATOMIC); + node = kmalloc_obj(*node, GFP_ATOMIC); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c index 21341842c0a9..04ddd4709933 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c @@ -562,11 +562,11 @@ static int setup_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num, if (drm_WARN_ON(&i915->drm, resolution >= GVT_EDID_NUM)) return -EINVAL; - port->edid = kzalloc(sizeof(*(port->edid)), GFP_KERNEL); + port->edid = kzalloc_obj(*(port->edid), GFP_KERNEL); if (!port->edid) return -ENOMEM; - port->dpcd = kzalloc(sizeof(*(port->dpcd)), GFP_KERNEL); + port->dpcd = kzalloc_obj(*(port->dpcd), GFP_KERNEL); if (!port->dpcd) { kfree(port->edid); return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index 8e76869b352c..255abb5a849b 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -67,7 +67,7 @@ static int vgpu_gem_get_pages(struct drm_i915_gem_object *obj) if (drm_WARN_ON(&dev_priv->drm, !vgpu)) return -ENODEV; - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (unlikely(!st)) return -ENOMEM; @@ -447,15 +447,14 @@ int intel_vgpu_query_plane(struct intel_vgpu *vgpu, void *args) mutex_unlock(&vgpu->dmabuf_lock); /* Need to allocate a new one*/ - dmabuf_obj = kmalloc(sizeof(struct intel_vgpu_dmabuf_obj), GFP_KERNEL); + dmabuf_obj = kmalloc_obj(struct intel_vgpu_dmabuf_obj, GFP_KERNEL); if (unlikely(!dmabuf_obj)) { gvt_vgpu_err("alloc dmabuf_obj failed\n"); ret = -ENOMEM; goto out; } - dmabuf_obj->info = kmalloc(sizeof(struct intel_vgpu_fb_info), - GFP_KERNEL); + dmabuf_obj->info = kmalloc_obj(struct intel_vgpu_fb_info, GFP_KERNEL); if (unlikely(!dmabuf_obj->info)) { gvt_vgpu_err("allocate intel vgpu fb info failed\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 49028e7ef1e0..8cc24620a32e 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -654,7 +654,7 @@ static void *alloc_spt(gfp_t gfp_mask) { struct intel_vgpu_ppgtt_spt *spt; - spt = kzalloc(sizeof(*spt), gfp_mask); + spt = kzalloc_obj(*spt, gfp_mask); if (!spt) return NULL; @@ -1770,7 +1770,7 @@ static struct intel_vgpu_mm *vgpu_alloc_mm(struct intel_vgpu *vgpu) { struct intel_vgpu_mm *mm; - mm = kzalloc(sizeof(*mm), GFP_KERNEL); + mm = kzalloc_obj(*mm, GFP_KERNEL); if (!mm) return NULL; @@ -2206,7 +2206,7 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, if (!found) { /* the first partial part */ - partial_pte = kzalloc(sizeof(*partial_pte), GFP_KERNEL); + partial_pte = kzalloc_obj(*partial_pte, GFP_KERNEL); if (!partial_pte) return -ENOMEM; partial_pte->offset = off; @@ -2502,7 +2502,7 @@ static int setup_spt_oos(struct intel_gvt *gvt) INIT_LIST_HEAD(>t->oos_page_use_list_head); for (i = 0; i < preallocated_oos_pages; i++) { - oos_page = kzalloc(sizeof(*oos_page), GFP_KERNEL); + oos_page = kzalloc_obj(*oos_page, GFP_KERNEL); if (!oos_page) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c index bd20f287720f..ade07397a585 100644 --- a/drivers/gpu/drm/i915/gvt/handlers.c +++ b/drivers/gpu/drm/i915/gvt/handlers.c @@ -2892,7 +2892,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset, return -EEXIST; } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 009aa2df7958..62da85b3f2ca 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -250,7 +250,7 @@ static int __gvt_cache_add(struct intel_vgpu *vgpu, gfn_t gfn, struct gvt_dma *new, *itr; struct rb_node **link, *parent = NULL; - new = kzalloc(sizeof(struct gvt_dma), GFP_KERNEL); + new = kzalloc_obj(struct gvt_dma, GFP_KERNEL); if (!new) return -ENOMEM; @@ -378,7 +378,7 @@ static void kvmgt_protect_table_add(struct intel_vgpu *info, gfn_t gfn) if (kvmgt_gfn_is_write_protected(info, gfn)) return; - p = kzalloc(sizeof(struct kvmgt_pgfn), GFP_ATOMIC); + p = kzalloc_obj(struct kvmgt_pgfn, GFP_ATOMIC); if (WARN(!p, "gfn: 0x%llx\n", gfn)) return; @@ -595,7 +595,7 @@ int intel_gvt_set_edid(struct intel_vgpu *vgpu, int port_num) struct vfio_edid_region *base; int ret; - base = kzalloc(sizeof(*base), GFP_KERNEL); + base = kzalloc_obj(*base, GFP_KERNEL); if (!base) return -ENOMEM; @@ -1183,8 +1183,7 @@ static int intel_vgpu_ioctl_get_region_info(struct vfio_device *vfio_dev, VFIO_REGION_INFO_FLAG_WRITE; info->size = gvt_aperture_sz(vgpu->gvt); - sparse = kzalloc(struct_size(sparse, areas, nr_areas), - GFP_KERNEL); + sparse = kzalloc_flex(*sparse, areas, nr_areas, GFP_KERNEL); if (!sparse) return -ENOMEM; @@ -1830,7 +1829,7 @@ static int intel_gvt_init_device(struct drm_i915_private *i915) if (drm_WARN_ON(&i915->drm, i915->gvt)) return -EEXIST; - gvt = kzalloc(sizeof(struct intel_gvt), GFP_KERNEL); + gvt = kzalloc_obj(struct intel_gvt, GFP_KERNEL); if (!gvt) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/page_track.c b/drivers/gpu/drm/i915/gvt/page_track.c index b22ef801963e..862e199e5486 100644 --- a/drivers/gpu/drm/i915/gvt/page_track.c +++ b/drivers/gpu/drm/i915/gvt/page_track.c @@ -58,7 +58,7 @@ int intel_vgpu_register_page_track(struct intel_vgpu *vgpu, unsigned long gfn, if (track) return -EEXIST; - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (!track) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c index 9736a15a896f..21e823113543 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c @@ -282,7 +282,7 @@ static int tbs_sched_init(struct intel_gvt *gvt) struct gvt_sched_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -312,7 +312,7 @@ static int tbs_sched_init_vgpu(struct intel_vgpu *vgpu) { struct vgpu_sched_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c index 96d0bd1fa337..003aacd770e9 100644 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@ -113,13 +113,11 @@ int intel_gvt_init_vgpu_types(struct intel_gvt *gvt) unsigned int num_types = ARRAY_SIZE(intel_vgpu_configs); unsigned int i; - gvt->types = kcalloc(num_types, sizeof(struct intel_vgpu_type), - GFP_KERNEL); + gvt->types = kzalloc_objs(struct intel_vgpu_type, num_types, GFP_KERNEL); if (!gvt->types) return -ENOMEM; - gvt->mdev_types = kcalloc(num_types, sizeof(*gvt->mdev_types), - GFP_KERNEL); + gvt->mdev_types = kzalloc_objs(*gvt->mdev_types, num_types, GFP_KERNEL); if (!gvt->mdev_types) goto out_free_types; diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index 6b0c1162505a..4cbbbe8307a8 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -650,7 +650,7 @@ static int __await_barrier(struct i915_active *ref, struct i915_sw_fence *fence) { struct wait_barrier *wb; - wb = kmalloc(sizeof(*wb), GFP_KERNEL); + wb = kmalloc_obj(*wb, GFP_KERNEL); if (unlikely(!wb)) return -ENOMEM; @@ -1160,7 +1160,7 @@ struct i915_active *i915_active_create(void) { struct auto_active *aa; - aa = kmalloc(sizeof(*aa), GFP_KERNEL); + aa = kmalloc_obj(*aa, GFP_KERNEL); if (!aa) return NULL; diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c index 7654f1be8d3b..539119d2b594 100644 --- a/drivers/gpu/drm/i915/i915_cmd_parser.c +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c @@ -918,8 +918,8 @@ static int init_hash_table(struct intel_engine_cs *engine, for (j = 0; j < table->count; j++) { const struct drm_i915_cmd_descriptor *desc = &table->table[j]; - struct cmd_node *desc_node = - kmalloc(sizeof(*desc_node), GFP_KERNEL); + struct cmd_node *desc_node = kmalloc_obj(*desc_node, + GFP_KERNEL); if (!desc_node) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_deps.c b/drivers/gpu/drm/i915/i915_deps.c index 91c61864285a..40133e0ac01a 100644 --- a/drivers/gpu/drm/i915/i915_deps.c +++ b/drivers/gpu/drm/i915/i915_deps.c @@ -82,7 +82,7 @@ static int i915_deps_grow(struct i915_deps *deps, struct dma_fence *fence, struct dma_fence **new_fences; new_size = max(new_size, I915_DEPS_MIN_ALLOC_CHUNK); - new_fences = kmalloc_array(new_size, sizeof(*new_fences), deps->gfp); + new_fences = kmalloc_objs(*new_fences, new_size, deps->gfp); if (!new_fences) goto sync; diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c index 168d7375304b..2407414c2ff1 100644 --- a/drivers/gpu/drm/i915/i915_drm_client.c +++ b/drivers/gpu/drm/i915/i915_drm_client.c @@ -21,7 +21,7 @@ struct i915_drm_client *i915_drm_client_alloc(void) { struct i915_drm_client *client; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return NULL; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b40d4d88de01..6e44b4d633f9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1319,7 +1319,7 @@ int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file) drm_dbg(&i915->drm, "\n"); - file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); if (!file_priv) goto err_alloc; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 303d8d9b7775..a99b4e45d26c 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1155,7 +1155,7 @@ i915_vma_coredump_create(const struct intel_gt *gt, if (!vma_res || !vma_res->bi.pages || !compress) return NULL; - dst = kmalloc(sizeof(*dst), ALLOW_FAIL); + dst = kmalloc_obj(*dst, ALLOW_FAIL); if (!dst) return NULL; @@ -1502,7 +1502,7 @@ capture_vma_snapshot(struct intel_engine_capture_vma *next, if (!vma_res) return next; - c = kmalloc(sizeof(*c), gfp); + c = kmalloc_obj(*c, gfp); if (!c) return next; @@ -1598,7 +1598,7 @@ intel_engine_coredump_alloc(struct intel_engine_cs *engine, gfp_t gfp, u32 dump_ { struct intel_engine_coredump *ee; - ee = kzalloc(sizeof(*ee), gfp); + ee = kzalloc_obj(*ee, gfp); if (!ee) return NULL; @@ -1829,7 +1829,7 @@ gt_record_uc(struct intel_gt_coredump *gt, const struct intel_uc *uc = >->_gt->uc; struct intel_uc_coredump *error_uc; - error_uc = kzalloc(sizeof(*error_uc), ALLOW_FAIL); + error_uc = kzalloc_obj(*error_uc, ALLOW_FAIL); if (!error_uc) return NULL; @@ -2088,7 +2088,7 @@ i915_gpu_coredump_alloc(struct drm_i915_private *i915, gfp_t gfp) if (!i915->params.error_capture) return NULL; - error = kzalloc(sizeof(*error), gfp); + error = kzalloc_obj(*error, gfp); if (!error) return NULL; @@ -2112,7 +2112,7 @@ intel_gt_coredump_alloc(struct intel_gt *gt, gfp_t gfp, u32 dump_flags) { struct intel_gt_coredump *gc; - gc = kzalloc(sizeof(*gc), gfp); + gc = kzalloc_obj(*gc, gfp); if (!gc) return NULL; @@ -2143,7 +2143,7 @@ i915_vma_capture_prepare(struct intel_gt_coredump *gt) { struct i915_vma_compress *compress; - compress = kmalloc(sizeof(*compress), ALLOW_FAIL); + compress = kmalloc_obj(*compress, ALLOW_FAIL); if (!compress) return NULL; diff --git a/drivers/gpu/drm/i915/i915_hdcp_gsc.c b/drivers/gpu/drm/i915/i915_hdcp_gsc.c index 9906da2aef1c..988c4cafa7c6 100644 --- a/drivers/gpu/drm/i915/i915_hdcp_gsc.c +++ b/drivers/gpu/drm/i915/i915_hdcp_gsc.c @@ -94,7 +94,7 @@ static struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_de struct intel_hdcp_gsc_context *gsc_context; int ret; - gsc_context = kzalloc(sizeof(*gsc_context), GFP_KERNEL); + gsc_context = kzalloc_obj(*gsc_context, GFP_KERNEL); if (!gsc_context) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c index 7dfe1784153f..9d87d58d2385 100644 --- a/drivers/gpu/drm/i915/i915_hwmon.c +++ b/drivers/gpu/drm/i915/i915_hwmon.c @@ -915,7 +915,7 @@ void i915_hwmon_register(struct drm_i915_private *i915) if (!IS_DGFX(i915)) return; - hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); + hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); if (!hwmon) return; diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 0b9d9f3f7813..1b11442a3a39 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -2200,7 +2200,7 @@ alloc_oa_config_buffer(struct i915_perf_stream *stream, u32 *cs; int err; - oa_bo = kzalloc(sizeof(*oa_bo), GFP_KERNEL); + oa_bo = kzalloc_obj(*oa_bo, GFP_KERNEL); if (!oa_bo) return ERR_PTR(-ENOMEM); @@ -3872,7 +3872,7 @@ i915_perf_open_ioctl_locked(struct i915_perf *perf, goto err_ctx; } - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) { ret = -ENOMEM; goto err_ctx; @@ -4505,7 +4505,7 @@ static struct i915_oa_reg *alloc_oa_regs(struct i915_perf *perf, if (!is_valid) return ERR_PTR(-EINVAL); - oa_regs = kmalloc_array(n_regs, sizeof(*oa_regs), GFP_KERNEL); + oa_regs = kmalloc_objs(*oa_regs, n_regs, GFP_KERNEL); if (!oa_regs) return ERR_PTR(-ENOMEM); @@ -4614,7 +4614,7 @@ int i915_perf_add_config_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); if (!oa_config) { drm_dbg(&perf->i915->drm, "Failed to allocate memory for the OA config\n"); @@ -4910,7 +4910,7 @@ static int oa_init_gt(struct intel_gt *gt) struct i915_perf_group *g; intel_engine_mask_t tmp; - g = kcalloc(num_groups, sizeof(*g), GFP_KERNEL); + g = kzalloc_objs(*g, num_groups, GFP_KERNEL); if (!g) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index a6697db21c72..d52c1ed69b8e 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -1028,16 +1028,16 @@ create_event_attributes(struct i915_pmu *pmu) } /* Allocate attribute objects and table. */ - i915_attr = kcalloc(count, sizeof(*i915_attr), GFP_KERNEL); + i915_attr = kzalloc_objs(*i915_attr, count, GFP_KERNEL); if (!i915_attr) goto err_alloc; - pmu_attr = kcalloc(count, sizeof(*pmu_attr), GFP_KERNEL); + pmu_attr = kzalloc_objs(*pmu_attr, count, GFP_KERNEL); if (!pmu_attr) goto err_alloc; /* Max one pointer of each attribute type plus a termination entry. */ - attr = kcalloc(count * 2 + 1, sizeof(*attr), GFP_KERNEL); + attr = kzalloc_objs(*attr, count * 2 + 1, GFP_KERNEL); if (!attr) goto err_alloc; diff --git a/drivers/gpu/drm/i915/i915_scatterlist.c b/drivers/gpu/drm/i915/i915_scatterlist.c index 4d830740946d..ad868adb30dc 100644 --- a/drivers/gpu/drm/i915/i915_scatterlist.c +++ b/drivers/gpu/drm/i915/i915_scatterlist.c @@ -90,7 +90,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node, GEM_BUG_ON(!max_segment); - rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN); + rsgt = kmalloc_obj(*rsgt, GFP_KERNEL | __GFP_NOWARN); if (!rsgt) return ERR_PTR(-ENOMEM); @@ -178,7 +178,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res, GEM_BUG_ON(list_empty(blocks)); GEM_BUG_ON(!max_segment); - rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN); + rsgt = kmalloc_obj(*rsgt, GFP_KERNEL | __GFP_NOWARN); if (!rsgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c index 70a854557e6e..101df7236d6c 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.c +++ b/drivers/gpu/drm/i915/i915_scheduler.c @@ -453,7 +453,7 @@ i915_sched_engine_create(unsigned int subclass) { struct i915_sched_engine *sched_engine; - sched_engine = kzalloc(sizeof(*sched_engine), GFP_KERNEL); + sched_engine = kzalloc_obj(*sched_engine, GFP_KERNEL); if (!sched_engine) return NULL; diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c index 73e89b168fc3..f24f616e23ee 100644 --- a/drivers/gpu/drm/i915/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/i915_sw_fence.c @@ -360,7 +360,7 @@ static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, pending = I915_SW_FENCE_FLAG_FENCE; if (!wq) { - wq = kmalloc(sizeof(*wq), gfp); + wq = kmalloc_obj(*wq, gfp); if (!wq) { if (!gfpflags_allow_blocking(gfp)) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_syncmap.c b/drivers/gpu/drm/i915/i915_syncmap.c index df6437c37373..ed18650d83fd 100644 --- a/drivers/gpu/drm/i915/i915_syncmap.c +++ b/drivers/gpu/drm/i915/i915_syncmap.c @@ -197,7 +197,7 @@ __sync_alloc_leaf(struct i915_syncmap *parent, u64 id) { struct i915_syncmap *p; - p = kmalloc(struct_size(p, seqno, KSYNCMAP), GFP_KERNEL); + p = kmalloc_flex(*p, seqno, KSYNCMAP, GFP_KERNEL); if (unlikely(!p)) return NULL; @@ -279,8 +279,7 @@ static noinline int __sync_set(struct i915_syncmap **root, u64 id, u32 seqno) unsigned int above; /* Insert a join above the current layer */ - next = kzalloc(struct_size(next, child, KSYNCMAP), - GFP_KERNEL); + next = kzalloc_flex(*next, child, KSYNCMAP, GFP_KERNEL); if (unlikely(!next)) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c index d5c6e6605086..cf79995f1a5b 100644 --- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c +++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c @@ -48,7 +48,7 @@ static int i915_ttm_buddy_man_alloc(struct ttm_resource_manager *man, if (!lpfn) lpfn = man->size; - bman_res = kzalloc(sizeof(*bman_res), GFP_KERNEL); + bman_res = kzalloc_obj(*bman_res, GFP_KERNEL); if (!bman_res) return -ENOMEM; @@ -289,7 +289,7 @@ int i915_ttm_buddy_man_init(struct ttm_device *bdev, struct i915_ttm_buddy_manager *bman; int err; - bman = kzalloc(sizeof(*bman), GFP_KERNEL); + bman = kzalloc_obj(*bman, GFP_KERNEL); if (!bman) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 2c0a63664e13..39eb1808fd11 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -394,7 +394,7 @@ struct i915_vma_work *i915_vma_work(void) { struct i915_vma_work *vw; - vw = kzalloc(sizeof(*vw), GFP_KERNEL); + vw = kzalloc_obj(*vw, GFP_KERNEL); if (!vw) return NULL; @@ -1027,7 +1027,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info, int i; /* Allocate target SG list. */ - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) goto err_st_alloc; @@ -1237,7 +1237,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info, int i; /* Allocate target SG list. */ - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) goto err_st_alloc; @@ -1275,7 +1275,7 @@ intel_partial_pages(const struct i915_gtt_view *view, unsigned int count = view->partial.size; int ret = -ENOMEM; - st = kmalloc(sizeof(*st), GFP_KERNEL); + st = kmalloc_obj(*st, GFP_KERNEL); if (!st) goto err_st_alloc; diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c index ce722f20cab1..426355f75db8 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.c +++ b/drivers/gpu/drm/i915/intel_memory_region.c @@ -258,7 +258,7 @@ intel_memory_region_create(struct drm_i915_private *i915, struct intel_memory_region *mem; int err; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index fdd2a940f983..b0d7cc7eb98f 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -2072,7 +2072,7 @@ static int __fw_domain_init(struct intel_uncore *uncore, GEM_BUG_ON(domain_id >= FW_DOMAIN_ID_COUNT); GEM_BUG_ON(uncore->fw_domain[domain_id]); - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c index d4b0c76f335b..d87d58433307 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c @@ -222,7 +222,7 @@ int intel_pxp_init(struct drm_i915_private *i915) * including session and object management, or we will init the backend tee * channel for internal users such as HuC loading by GSC */ - i915->pxp = kzalloc(sizeof(*i915->pxp), GFP_KERNEL); + i915->pxp = kzalloc_obj(*i915->pxp, GFP_KERNEL); if (!i915->pxp) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c index 36c3a5460221..3eaee7e8cc65 100644 --- a/drivers/gpu/drm/i915/selftests/i915_active.c +++ b/drivers/gpu/drm/i915/selftests/i915_active.c @@ -66,7 +66,7 @@ static struct live_active *__live_alloc(struct drm_i915_private *i915) { struct live_active *active; - active = kzalloc(sizeof(*active), GFP_KERNEL); + active = kzalloc_obj(*active, GFP_KERNEL); if (!active) return NULL; diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c index f8fe3681c3dc..3362421467e8 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c @@ -421,7 +421,7 @@ static int igt_evict_contexts(void *arg) struct reserved *r; mutex_unlock(&ggtt->vm.mutex); - r = kcalloc(1, sizeof(*r), GFP_KERNEL); + r = kzalloc_objs(*r, 1, GFP_KERNEL); mutex_lock(&ggtt->vm.mutex); if (!r) { err = -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 0a86e4857539..e6bd06774816 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -63,7 +63,7 @@ static int fake_get_pages(struct drm_i915_gem_object *obj) struct scatterlist *sg; typeof(obj->base.size) rem; - pages = kmalloc(sizeof(*pages), GFP); + pages = kmalloc_obj(*pages, GFP); if (!pages) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c index 403134a7acec..411d43acd0d8 100644 --- a/drivers/gpu/drm/i915/selftests/i915_perf.c +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c @@ -21,7 +21,7 @@ alloc_empty_config(struct i915_perf *perf) { struct i915_oa_config *oa_config; - oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); if (!oa_config) return -ENOMEM; @@ -114,7 +114,7 @@ test_stream(struct i915_perf *perf) props.metrics_set = oa_config->id; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) { i915_oa_config_put(oa_config); return NULL; diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index 1260601bda1f..d1d48ea8d264 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -329,7 +329,7 @@ static void __igt_breadcrumbs_smoketest(struct kthread_work *work) * that the fences were marked as signaled. */ - requests = kcalloc(total, sizeof(*requests), GFP_KERNEL); + requests = kzalloc_objs(*requests, total, GFP_KERNEL); if (!requests) { thread->result = -ENOMEM; return; @@ -472,11 +472,11 @@ static int mock_breadcrumbs_smoketest(void *arg) * See __igt_breadcrumbs_smoketest(); */ - threads = kcalloc(ncpus, sizeof(*threads), GFP_KERNEL); + threads = kzalloc_objs(*threads, ncpus, GFP_KERNEL); if (!threads) return -ENOMEM; - t.contexts = kcalloc(t.ncontexts, sizeof(*t.contexts), GFP_KERNEL); + t.contexts = kzalloc_objs(*t.contexts, t.ncontexts, GFP_KERNEL); if (!t.contexts) { ret = -ENOMEM; goto out_threads; @@ -1203,7 +1203,7 @@ static int live_all_engines(void *arg) * block doing so, and that they don't complete too soon. */ - request = kcalloc(nengines, sizeof(*request), GFP_KERNEL); + request = kzalloc_objs(*request, nengines, GFP_KERNEL); if (!request) return -ENOMEM; @@ -1333,7 +1333,7 @@ static int live_sequential_engines(void *arg) * they are running on independent engines. */ - request = kcalloc(nengines, sizeof(*request), GFP_KERNEL); + request = kzalloc_objs(*request, nengines, GFP_KERNEL); if (!request) return -ENOMEM; @@ -1626,7 +1626,7 @@ static int live_parallel_engines(void *arg) * tests that we load up the system maximally. */ - threads = kcalloc(nengines, sizeof(*threads), GFP_KERNEL); + threads = kzalloc_objs(*threads, nengines, GFP_KERNEL); if (!threads) return -ENOMEM; @@ -1754,13 +1754,13 @@ static int live_breadcrumbs_smoketest(void *arg) goto out_rpm; } - smoke = kcalloc(nengines, sizeof(*smoke), GFP_KERNEL); + smoke = kzalloc_objs(*smoke, nengines, GFP_KERNEL); if (!smoke) { ret = -ENOMEM; goto out_file; } - threads = kcalloc(ncpus * nengines, sizeof(*threads), GFP_KERNEL); + threads = kzalloc_objs(*threads, ncpus * nengines, GFP_KERNEL); if (!threads) { ret = -ENOMEM; goto out_smoke; @@ -1768,9 +1768,8 @@ static int live_breadcrumbs_smoketest(void *arg) smoke[0].request_alloc = __live_request_alloc; smoke[0].ncontexts = 64; - smoke[0].contexts = kcalloc(smoke[0].ncontexts, - sizeof(*smoke[0].contexts), - GFP_KERNEL); + smoke[0].contexts = kzalloc_objs(*smoke[0].contexts, smoke[0].ncontexts, + GFP_KERNEL); if (!smoke[0].contexts) { ret = -ENOMEM; goto out_threads; @@ -2838,11 +2837,11 @@ static int perf_series_engines(void *arg) unsigned int idx; int err = 0; - stats = kcalloc(nengines, sizeof(*stats), GFP_KERNEL); + stats = kzalloc_objs(*stats, nengines, GFP_KERNEL); if (!stats) return -ENOMEM; - ps = kzalloc(struct_size(ps, ce, nengines), GFP_KERNEL); + ps = kzalloc_flex(*ps, ce, nengines, GFP_KERNEL); if (!ps) { kfree(stats); return -ENOMEM; @@ -3194,7 +3193,7 @@ static int perf_parallel_engines(void *arg) struct p_thread *engines; int err = 0; - engines = kcalloc(nengines, sizeof(*engines), GFP_KERNEL); + engines = kzalloc_objs(*engines, nengines, GFP_KERNEL); if (!engines) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c index 8f5ce71fa453..34bcdbaac7c3 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -47,7 +47,7 @@ static struct i915_sw_fence *alloc_fence(void) { struct i915_sw_fence *fence; - fence = kmalloc(sizeof(*fence), GFP_KERNEL); + fence = kmalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; @@ -454,7 +454,7 @@ static int test_chain(void *arg) int ret, i; /* Test a long chain of fences */ - fences = kmalloc_array(nfences, sizeof(*fences), GFP_KERNEL); + fences = kmalloc_objs(*fences, nfences, GFP_KERNEL); if (!fences) return -ENOMEM; @@ -639,7 +639,7 @@ static struct dma_fence *alloc_dma_fence(void) { struct dma_fence *dma; - dma = kmalloc(sizeof(*dma), GFP_KERNEL); + dma = kmalloc_obj(*dma, GFP_KERNEL); if (dma) dma_fence_init(dma, &mock_fence_ops, &mock_fence_lock, 0, 0); diff --git a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c index d79e4defb71d..4ac956dfd1f8 100644 --- a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c @@ -109,7 +109,7 @@ struct i915_sw_fence *heap_fence_create(gfp_t gfp) { struct heap_fence *h; - h = kmalloc(sizeof(*h), gfp); + h = kmalloc_obj(*h, gfp); if (!h) return NULL; diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index b59626c4994c..d6b4796fde82 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -148,7 +148,7 @@ struct drm_i915_private *mock_gem_device(void) struct pci_dev *pdev; int ret; - pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); + pdev = kzalloc_obj(*pdev, GFP_KERNEL); if (!pdev) return NULL; device_initialize(&pdev->dev); diff --git a/drivers/gpu/drm/i915/selftests/mock_gtt.c b/drivers/gpu/drm/i915/selftests/mock_gtt.c index a516c0aa88fd..1b13502add8a 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gtt.c +++ b/drivers/gpu/drm/i915/selftests/mock_gtt.c @@ -66,7 +66,7 @@ struct i915_ppgtt *mock_ppgtt(struct drm_i915_private *i915, const char *name) { struct i915_ppgtt *ppgtt; - ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); if (!ppgtt) return NULL; diff --git a/drivers/gpu/drm/i915/vlv_suspend.c b/drivers/gpu/drm/i915/vlv_suspend.c index bace7b38329b..b5360ddc34e7 100644 --- a/drivers/gpu/drm/i915/vlv_suspend.c +++ b/drivers/gpu/drm/i915/vlv_suspend.c @@ -464,8 +464,7 @@ int vlv_suspend_init(struct drm_i915_private *i915) return 0; /* we write all the values in the struct, so no need to zero it out */ - i915->vlv_s0ix_state = kmalloc(sizeof(*i915->vlv_s0ix_state), - GFP_KERNEL); + i915->vlv_s0ix_state = kmalloc_obj(*i915->vlv_s0ix_state, GFP_KERNEL); if (!i915->vlv_s0ix_state) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_ccb.c b/drivers/gpu/drm/imagination/pvr_ccb.c index 9294b4ba1de7..998b9ceb54ca 100644 --- a/drivers/gpu/drm/imagination/pvr_ccb.c +++ b/drivers/gpu/drm/imagination/pvr_ccb.c @@ -543,7 +543,7 @@ struct dma_fence *pvr_kccb_fence_alloc(void) { struct pvr_kccb_fence *kccb_fence; - kccb_fence = kzalloc(sizeof(*kccb_fence), GFP_KERNEL); + kccb_fence = kzalloc_obj(*kccb_fence, GFP_KERNEL); if (!kccb_fence) return NULL; diff --git a/drivers/gpu/drm/imagination/pvr_context.c b/drivers/gpu/drm/imagination/pvr_context.c index 5edc3c01af72..1aa4f098f93d 100644 --- a/drivers/gpu/drm/imagination/pvr_context.c +++ b/drivers/gpu/drm/imagination/pvr_context.c @@ -292,7 +292,7 @@ int pvr_context_create(struct pvr_file *pvr_file, struct drm_pvr_ioctl_create_co if (ctx_size < 0) return ctx_size; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c index 916b40ced7eb..b6171d10e8ac 100644 --- a/drivers/gpu/drm/imagination/pvr_drv.c +++ b/drivers/gpu/drm/imagination/pvr_drv.c @@ -1312,7 +1312,7 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file) struct pvr_device *pvr_dev = to_pvr_device(drm_dev); struct pvr_file *pvr_file; - pvr_file = kzalloc(sizeof(*pvr_file), GFP_KERNEL); + pvr_file = kzalloc_obj(*pvr_file, GFP_KERNEL); if (!pvr_file) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_free_list.c b/drivers/gpu/drm/imagination/pvr_free_list.c index 5228e214491c..cfcfbd89052a 100644 --- a/drivers/gpu/drm/imagination/pvr_free_list.c +++ b/drivers/gpu/drm/imagination/pvr_free_list.c @@ -307,7 +307,7 @@ pvr_free_list_grow(struct pvr_free_list *free_list, u32 num_pages) goto err_unlock; } - free_list_node = kzalloc(sizeof(*free_list_node), GFP_KERNEL); + free_list_node = kzalloc_obj(*free_list_node, GFP_KERNEL); if (!free_list_node) { err = -ENOMEM; goto err_unlock; @@ -415,7 +415,7 @@ pvr_free_list_create(struct pvr_file *pvr_file, int err; /* Create and fill out the kernel structure */ - free_list = kzalloc(sizeof(*free_list), GFP_KERNEL); + free_list = kzalloc_obj(*free_list, GFP_KERNEL); if (!free_list) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_fw.c b/drivers/gpu/drm/imagination/pvr_fw.c index 779a58fe6ee8..1cbbaff3e7bf 100644 --- a/drivers/gpu/drm/imagination/pvr_fw.c +++ b/drivers/gpu/drm/imagination/pvr_fw.c @@ -1272,7 +1272,7 @@ pvr_fw_object_create_and_map_common(struct pvr_device *pvr_dev, size_t size, /* %DRM_PVR_BO_PM_FW_PROTECT is implicit for FW objects. */ flags |= DRM_PVR_BO_PM_FW_PROTECT; - fw_obj = kzalloc(sizeof(*fw_obj), GFP_KERNEL); + fw_obj = kzalloc_obj(*fw_obj, GFP_KERNEL); if (!fw_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_fw_trace.c b/drivers/gpu/drm/imagination/pvr_fw_trace.c index 673ee71276e9..f2c92a3b3a94 100644 --- a/drivers/gpu/drm/imagination/pvr_fw_trace.c +++ b/drivers/gpu/drm/imagination/pvr_fw_trace.c @@ -455,7 +455,7 @@ static int fw_trace_open(struct inode *inode, struct file *file) struct pvr_fw_trace_seq_data *trace_seq_data; int err; - trace_seq_data = kzalloc(sizeof(*trace_seq_data), GFP_KERNEL); + trace_seq_data = kzalloc_obj(*trace_seq_data, GFP_KERNEL); if (!trace_seq_data) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_gem.c b/drivers/gpu/drm/imagination/pvr_gem.c index c07c9a915190..7a4e8ec92e1e 100644 --- a/drivers/gpu/drm/imagination/pvr_gem.c +++ b/drivers/gpu/drm/imagination/pvr_gem.c @@ -314,7 +314,7 @@ struct drm_gem_object *pvr_gem_create_object(struct drm_device *drm_dev, size_t struct drm_gem_object *gem_obj; struct pvr_gem_object *pvr_obj; - pvr_obj = kzalloc(sizeof(*pvr_obj), GFP_KERNEL); + pvr_obj = kzalloc_obj(*pvr_obj, GFP_KERNEL); if (!pvr_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_hwrt.c b/drivers/gpu/drm/imagination/pvr_hwrt.c index dc0c25fa1847..93ea3c8ee176 100644 --- a/drivers/gpu/drm/imagination/pvr_hwrt.c +++ b/drivers/gpu/drm/imagination/pvr_hwrt.c @@ -457,7 +457,7 @@ pvr_hwrt_dataset_create(struct pvr_file *pvr_file, int err, i = 0; /* Create and fill out the kernel structure */ - hwrt = kzalloc(sizeof(*hwrt), GFP_KERNEL); + hwrt = kzalloc_obj(*hwrt, GFP_KERNEL); if (!hwrt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_job.c b/drivers/gpu/drm/imagination/pvr_job.c index 7564b0f21b42..a4e550505504 100644 --- a/drivers/gpu/drm/imagination/pvr_job.c +++ b/drivers/gpu/drm/imagination/pvr_job.c @@ -415,7 +415,7 @@ create_job(struct pvr_device *pvr_dev, (args->hwrt.set_handle || args->hwrt.data_index)) return ERR_PTR(-EINVAL); - job = kzalloc(sizeof(*job), GFP_KERNEL); + job = kzalloc_obj(*job, GFP_KERNEL); if (!job) return ERR_PTR(-ENOMEM); @@ -718,8 +718,8 @@ pvr_submit_jobs(struct pvr_device *pvr_dev, struct pvr_file *pvr_file, if (err) return err; - job_data = kvmalloc_array(args->jobs.count, sizeof(*job_data), - GFP_KERNEL | __GFP_ZERO); + job_data = kvmalloc_objs(*job_data, args->jobs.count, + GFP_KERNEL | __GFP_ZERO); if (!job_data) { err = -ENOMEM; goto out_free; diff --git a/drivers/gpu/drm/imagination/pvr_mmu.c b/drivers/gpu/drm/imagination/pvr_mmu.c index 450d476d183f..4d35879a344b 100644 --- a/drivers/gpu/drm/imagination/pvr_mmu.c +++ b/drivers/gpu/drm/imagination/pvr_mmu.c @@ -1828,7 +1828,7 @@ pvr_page_table_l0_get_or_insert(struct pvr_mmu_op_context *op_ctx, */ struct pvr_mmu_context *pvr_mmu_context_create(struct pvr_device *pvr_dev) { - struct pvr_mmu_context *ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + struct pvr_mmu_context *ctx = kzalloc_obj(*ctx, GFP_KERNEL); int err; if (!ctx) @@ -1877,8 +1877,7 @@ pvr_page_table_l1_alloc(struct pvr_mmu_context *ctx) { int err; - struct pvr_page_table_l1 *table = - kzalloc(sizeof(*table), GFP_KERNEL); + struct pvr_page_table_l1 *table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return ERR_PTR(-ENOMEM); @@ -1906,8 +1905,7 @@ pvr_page_table_l0_alloc(struct pvr_mmu_context *ctx) { int err; - struct pvr_page_table_l0 *table = - kzalloc(sizeof(*table), GFP_KERNEL); + struct pvr_page_table_l0 *table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return ERR_PTR(-ENOMEM); @@ -2352,8 +2350,7 @@ pvr_mmu_op_context_create(struct pvr_mmu_context *ctx, struct sg_table *sgt, { int err; - struct pvr_mmu_op_context *op_ctx = - kzalloc(sizeof(*op_ctx), GFP_KERNEL); + struct pvr_mmu_op_context *op_ctx = kzalloc_obj(*op_ctx, GFP_KERNEL); if (!op_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_power.c b/drivers/gpu/drm/imagination/pvr_power.c index b9f801c63260..c70a62192d79 100644 --- a/drivers/gpu/drm/imagination/pvr_power.c +++ b/drivers/gpu/drm/imagination/pvr_power.c @@ -614,11 +614,11 @@ int pvr_power_domains_init(struct pvr_device *pvr_dev) link_count = domain_count + (domain_count - 1); - domain_devs = kcalloc(domain_count, sizeof(*domain_devs), GFP_KERNEL); + domain_devs = kzalloc_objs(*domain_devs, domain_count, GFP_KERNEL); if (!domain_devs) return -ENOMEM; - domain_links = kcalloc(link_count, sizeof(*domain_links), GFP_KERNEL); + domain_links = kzalloc_objs(*domain_links, link_count, GFP_KERNEL); if (!domain_links) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_queue.c b/drivers/gpu/drm/imagination/pvr_queue.c index fc415dd0d7a7..12f759c17f93 100644 --- a/drivers/gpu/drm/imagination/pvr_queue.c +++ b/drivers/gpu/drm/imagination/pvr_queue.c @@ -249,7 +249,7 @@ pvr_queue_fence_alloc(void) { struct pvr_queue_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; @@ -1266,7 +1266,7 @@ struct pvr_queue *pvr_queue_create(struct pvr_context *ctx, if (ctx_state_size < 0) return ERR_PTR(ctx_state_size); - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_sync.c b/drivers/gpu/drm/imagination/pvr_sync.c index 129f646d14ba..b5268c9b885b 100644 --- a/drivers/gpu/drm/imagination/pvr_sync.c +++ b/drivers/gpu/drm/imagination/pvr_sync.c @@ -64,7 +64,7 @@ pvr_sync_signal_array_add(struct xarray *array, struct drm_file *file, u32 handl int err; u32 id; - sig_sync = kzalloc(sizeof(*sig_sync), GFP_KERNEL); + sig_sync = kzalloc_obj(*sig_sync, GFP_KERNEL); if (!sig_sync) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c index 9a9ad4e82305..e482bfc00576 100644 --- a/drivers/gpu/drm/imagination/pvr_vm.c +++ b/drivers/gpu/drm/imagination/pvr_vm.c @@ -261,9 +261,9 @@ pvr_vm_bind_op_map_init(struct pvr_vm_bind_op *bind_op, if (IS_ERR(bind_op->gpuvm_bo)) return PTR_ERR(bind_op->gpuvm_bo); - bind_op->new_va = kzalloc(sizeof(*bind_op->new_va), GFP_KERNEL); - bind_op->prev_va = kzalloc(sizeof(*bind_op->prev_va), GFP_KERNEL); - bind_op->next_va = kzalloc(sizeof(*bind_op->next_va), GFP_KERNEL); + bind_op->new_va = kzalloc_obj(*bind_op->new_va, GFP_KERNEL); + bind_op->prev_va = kzalloc_obj(*bind_op->prev_va, GFP_KERNEL); + bind_op->next_va = kzalloc_obj(*bind_op->next_va, GFP_KERNEL); if (!bind_op->new_va || !bind_op->prev_va || !bind_op->next_va) { err = -ENOMEM; goto err_bind_op_fini; @@ -310,8 +310,8 @@ pvr_vm_bind_op_unmap_init(struct pvr_vm_bind_op *bind_op, bind_op->type = PVR_VM_BIND_TYPE_UNMAP; - bind_op->prev_va = kzalloc(sizeof(*bind_op->prev_va), GFP_KERNEL); - bind_op->next_va = kzalloc(sizeof(*bind_op->next_va), GFP_KERNEL); + bind_op->prev_va = kzalloc_obj(*bind_op->prev_va, GFP_KERNEL); + bind_op->next_va = kzalloc_obj(*bind_op->next_va, GFP_KERNEL); if (!bind_op->prev_va || !bind_op->next_va) { err = -ENOMEM; goto err_bind_op_fini; @@ -565,7 +565,7 @@ pvr_vm_create_context(struct pvr_device *pvr_dev, bool is_userspace_context) return ERR_PTR(-EINVAL); } - vm_ctx = kzalloc(sizeof(*vm_ctx), GFP_KERNEL); + vm_ctx = kzalloc_obj(*vm_ctx, GFP_KERNEL); if (!vm_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index 0b99b407ac0a..07bc2044f76a 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -381,7 +381,7 @@ struct dcss_plane *dcss_plane_init(struct drm_device *drm, if (zpos > 2) return ERR_PTR(-EINVAL); - dcss_plane = kzalloc(sizeof(*dcss_plane), GFP_KERNEL); + dcss_plane = kzalloc_obj(*dcss_plane, GFP_KERNEL); if (!dcss_plane) { DRM_ERROR("failed to allocate plane\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c index cf7b02b2d52c..eeff0d535b02 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c @@ -117,7 +117,7 @@ static void imx_drm_crtc_reset(struct drm_crtc *crtc) kfree(to_imx_crtc_state(crtc->state)); crtc->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -126,7 +126,7 @@ static struct drm_crtc_state *imx_drm_crtc_duplicate_state(struct drm_crtc *crtc { struct imx_crtc_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c index db50eccea0ca..0b58871277d7 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c @@ -308,7 +308,7 @@ static void ipu_plane_state_reset(struct drm_plane *plane) plane->state = NULL; } - ipu_state = kzalloc(sizeof(*ipu_state), GFP_KERNEL); + ipu_state = kzalloc_obj(*ipu_state, GFP_KERNEL); if (ipu_state) __drm_atomic_helper_plane_reset(plane, &ipu_state->base); @@ -322,7 +322,7 @@ ipu_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_plane_duplicate_state(plane, &state->base); diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index 6fbf505d2801..e82cbb92faee 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -66,7 +66,7 @@ imx_pd_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, } *num_output_fmts = 1; - output_fmts = kmalloc(sizeof(*output_fmts), GFP_KERNEL); + output_fmts = kmalloc_obj(*output_fmts, GFP_KERNEL); if (!output_fmts) return NULL; @@ -117,7 +117,7 @@ imx_pd_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, } *num_input_fmts = 1; - input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index d3213fbf22be..6273058b1bee 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -923,7 +923,7 @@ ingenic_drm_gem_create_object(struct drm_device *drm, size_t size) struct ingenic_drm *priv = drm_device_get_priv(drm); struct drm_gem_dma_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); @@ -1387,7 +1387,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_devclk_disable; } - private_state = kzalloc(sizeof(*private_state), GFP_KERNEL); + private_state = kzalloc_obj(*private_state, GFP_KERNEL); if (!private_state) { ret = -ENOMEM; goto err_clk_notifier_unregister; diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 32638a713241..88b6b406e796 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -887,7 +887,7 @@ static int ingenic_ipu_bind(struct device *dev, struct device *master, void *d) return err; } - private_state = kzalloc(sizeof(*private_state), GFP_KERNEL); + private_state = kzalloc_obj(*private_state, GFP_KERNEL); if (!private_state) { err = -ENOMEM; goto err_clk_unprepare; diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c index faf38ca9e44c..1d2ce15d703a 100644 --- a/drivers/gpu/drm/kmb/kmb_dsi.c +++ b/drivers/gpu/drm/kmb/kmb_dsi.c @@ -220,14 +220,14 @@ int kmb_dsi_host_bridge_init(struct device *dev) /* Create and register MIPI DSI host */ if (!dsi_host) { - dsi_host = kzalloc(sizeof(*dsi_host), GFP_KERNEL); + dsi_host = kzalloc_obj(*dsi_host, GFP_KERNEL); if (!dsi_host) return -ENOMEM; dsi_host->ops = &kmb_dsi_host_ops; if (!dsi_device) { - dsi_device = kzalloc(sizeof(*dsi_device), GFP_KERNEL); + dsi_device = kzalloc_obj(*dsi_device, GFP_KERNEL); if (!dsi_device) { kfree(dsi_host); return -ENOMEM; diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c index 0e668fc1e0f9..edcd3733dd95 100644 --- a/drivers/gpu/drm/lima/lima_ctx.c +++ b/drivers/gpu/drm/lima/lima_ctx.c @@ -12,7 +12,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id) struct lima_ctx *ctx; int i, err; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c index 65210ab081bb..f2bdf0d1b2fc 100644 --- a/drivers/gpu/drm/lima/lima_drv.c +++ b/drivers/gpu/drm/lima/lima_drv.c @@ -215,7 +215,7 @@ static int lima_drm_driver_open(struct drm_device *dev, struct drm_file *file) struct lima_drm_priv *priv; struct lima_device *ldev = to_lima_dev(dev); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 9722b847a539..bed7945d8440 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -39,8 +39,8 @@ int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm) if (bo->base.pages) { pages = bo->base.pages; } else { - pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT, - sizeof(*pages), GFP_KERNEL | __GFP_ZERO); + pages = kvmalloc_objs(*pages, bo->base.base.size >> PAGE_SHIFT, + GFP_KERNEL | __GFP_ZERO); if (!pages) { dma_resv_unlock(bo->base.base.resv); return -ENOMEM; @@ -73,7 +73,7 @@ int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm) dma_unmap_sgtable(dev, bo->base.sgt, DMA_BIDIRECTIONAL, 0); sg_free_table(bo->base.sgt); } else { - bo->base.sgt = kmalloc(sizeof(*bo->base.sgt), GFP_KERNEL); + bo->base.sgt = kmalloc_obj(*bo->base.sgt, GFP_KERNEL); if (!bo->base.sgt) { ret = -ENOMEM; goto err_out0; @@ -226,7 +226,7 @@ struct drm_gem_object *lima_gem_create_object(struct drm_device *dev, size_t siz { struct lima_bo *bo; - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/lima/lima_vm.c b/drivers/gpu/drm/lima/lima_vm.c index 2b2739adc7f5..5db2a1ad1983 100644 --- a/drivers/gpu/drm/lima/lima_vm.c +++ b/drivers/gpu/drm/lima/lima_vm.c @@ -109,7 +109,7 @@ int lima_vm_bo_add(struct lima_vm *vm, struct lima_bo *bo, bool create) return -ENOENT; } - bo_va = kzalloc(sizeof(*bo_va), GFP_KERNEL); + bo_va = kzalloc_obj(*bo_va, GFP_KERNEL); if (!bo_va) { err = -ENOMEM; goto err_out0; @@ -201,7 +201,7 @@ struct lima_vm *lima_vm_create(struct lima_device *dev) { struct lima_vm *vm; - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return NULL; diff --git a/drivers/gpu/drm/loongson/lsdc_crtc.c b/drivers/gpu/drm/loongson/lsdc_crtc.c index a5b7d5c5fd20..32ef0f3826ac 100644 --- a/drivers/gpu/drm/loongson/lsdc_crtc.c +++ b/drivers/gpu/drm/loongson/lsdc_crtc.c @@ -397,7 +397,7 @@ static void lsdc_crtc_reset(struct drm_crtc *crtc) if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); - priv_crtc_state = kzalloc(sizeof(*priv_crtc_state), GFP_KERNEL); + priv_crtc_state = kzalloc_obj(*priv_crtc_state, GFP_KERNEL); if (!priv_crtc_state) __drm_atomic_helper_crtc_reset(crtc, NULL); @@ -424,7 +424,7 @@ lsdc_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct lsdc_crtc_state *new_priv_state; struct lsdc_crtc_state *old_priv_state; - new_priv_state = kzalloc(sizeof(*new_priv_state), GFP_KERNEL); + new_priv_state = kzalloc_obj(*new_priv_state, GFP_KERNEL); if (!new_priv_state) return NULL; diff --git a/drivers/gpu/drm/loongson/lsdc_gfxpll.c b/drivers/gpu/drm/loongson/lsdc_gfxpll.c index 249c09d703ad..984ee165cacb 100644 --- a/drivers/gpu/drm/loongson/lsdc_gfxpll.c +++ b/drivers/gpu/drm/loongson/lsdc_gfxpll.c @@ -178,7 +178,7 @@ int loongson_gfxpll_create(struct drm_device *ddev, struct loongson_gfxpll *this; int ret; - this = kzalloc(sizeof(*this), GFP_KERNEL); + this = kzalloc_obj(*this, GFP_KERNEL); if (IS_ERR_OR_NULL(this)) return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_i2c.c b/drivers/gpu/drm/loongson/lsdc_i2c.c index 012b4761c538..5ed314a76dde 100644 --- a/drivers/gpu/drm/loongson/lsdc_i2c.c +++ b/drivers/gpu/drm/loongson/lsdc_i2c.c @@ -124,7 +124,7 @@ int lsdc_create_i2c_chan(struct drm_device *ddev, struct lsdc_i2c *li2c; int ret; - li2c = kzalloc(sizeof(*li2c), GFP_KERNEL); + li2c = kzalloc_obj(*li2c, GFP_KERNEL); if (!li2c) return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_pixpll.c b/drivers/gpu/drm/loongson/lsdc_pixpll.c index 51b9a032cf43..d9c9de7b5de0 100644 --- a/drivers/gpu/drm/loongson/lsdc_pixpll.c +++ b/drivers/gpu/drm/loongson/lsdc_pixpll.c @@ -124,7 +124,7 @@ static int lsdc_pixel_pll_setup(struct lsdc_pixpll * const this) if (!this->mmio) return -ENOMEM; - pparms = kzalloc(sizeof(*pparms), GFP_KERNEL); + pparms = kzalloc_obj(*pparms, GFP_KERNEL); if (!pparms) { iounmap(this->mmio); return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_ttm.c b/drivers/gpu/drm/loongson/lsdc_ttm.c index 5d9075634bf8..3404e18e87b4 100644 --- a/drivers/gpu/drm/loongson/lsdc_ttm.c +++ b/drivers/gpu/drm/loongson/lsdc_ttm.c @@ -96,7 +96,7 @@ lsdc_ttm_tt_create(struct ttm_buffer_object *tbo, uint32_t page_flags) struct ttm_tt *tt; int ret; - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); if (!tt) return NULL; @@ -441,7 +441,7 @@ struct lsdc_bo *lsdc_bo_create(struct drm_device *ddev, enum ttm_bo_type bo_type; int ret; - lbo = kzalloc(sizeof(*lbo), GFP_KERNEL); + lbo = kzalloc_obj(*lbo, GFP_KERNEL); if (!lbo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c index 6ad712c0339a..1c1459a4af13 100644 --- a/drivers/gpu/drm/mediatek/mtk_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c @@ -160,7 +160,7 @@ static void mtk_crtc_reset(struct drm_crtc *crtc) kfree(to_mtk_crtc_state(crtc->state)); crtc->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -169,7 +169,7 @@ static struct drm_crtc_state *mtk_crtc_duplicate_state(struct drm_crtc *crtc) { struct mtk_crtc_state *state; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 5e67dab6e2e9..08d954e412d1 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2482,7 +2482,7 @@ static u32 *mtk_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, u32 *output_fmts; *num_output_fmts = 0; - output_fmts = kmalloc(sizeof(*output_fmts), GFP_KERNEL); + output_fmts = kmalloc_obj(*output_fmts, GFP_KERNEL); if (!output_fmts) return NULL; *num_output_fmts = 1; diff --git a/drivers/gpu/drm/mediatek/mtk_gem.c b/drivers/gpu/drm/mediatek/mtk_gem.c index 7525a9f9907a..5f7e50ff70ae 100644 --- a/drivers/gpu/drm/mediatek/mtk_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_gem.c @@ -50,7 +50,7 @@ static struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj) struct sg_table *sgt; int ret; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); @@ -85,7 +85,7 @@ static struct drm_gem_dma_object *mtk_gem_init(struct drm_device *dev, if (size == 0) return ERR_PTR(-EINVAL); - dma_obj = kzalloc(sizeof(*dma_obj), GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); if (!dma_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c index fcd10d7e8342..60c35d3cbb9b 100644 --- a/drivers/gpu/drm/mediatek/mtk_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_plane.c @@ -35,7 +35,7 @@ static void mtk_plane_reset(struct drm_plane *plane) state = to_mtk_plane_state(plane->state); memset(state, 0, sizeof(*state)); } else { - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return; } @@ -52,7 +52,7 @@ static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane struct mtk_plane_state *old_state = to_mtk_plane_state(plane->state); struct mtk_plane_state *state; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index d019177462cf..fe7451ff4ea4 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -697,7 +697,7 @@ void mgag200_crtc_reset(struct drm_crtc *crtc) if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); - mgag200_crtc_state = kzalloc(sizeof(*mgag200_crtc_state), GFP_KERNEL); + mgag200_crtc_state = kzalloc_obj(*mgag200_crtc_state, GFP_KERNEL); if (mgag200_crtc_state) __drm_atomic_helper_crtc_reset(crtc, &mgag200_crtc_state->base); else @@ -713,7 +713,8 @@ struct drm_crtc_state *mgag200_crtc_atomic_duplicate_state(struct drm_crtc *crtc if (!crtc_state) return NULL; - new_mgag200_crtc_state = kzalloc(sizeof(*new_mgag200_crtc_state), GFP_KERNEL); + new_mgag200_crtc_state = kzalloc_obj(*new_mgag200_crtc_state, + GFP_KERNEL); if (!new_mgag200_crtc_state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &new_mgag200_crtc_state->base); diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c index f6e48bb8cc69..9cf06fd3a21e 100644 --- a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c @@ -457,7 +457,7 @@ static void a2xx_dump(struct msm_gpu *gpu) static struct msm_gpu_state *a2xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); @@ -509,7 +509,7 @@ static struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) goto fail; } - a2xx_gpu = kzalloc(sizeof(*a2xx_gpu), GFP_KERNEL); + a2xx_gpu = kzalloc_obj(*a2xx_gpu, GFP_KERNEL); if (!a2xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c index 0407c9bc8c1b..4e8148497295 100644 --- a/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +++ b/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c @@ -95,7 +95,7 @@ struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu) { struct a2xx_gpummu *gpummu; - gpummu = kzalloc(sizeof(*gpummu), GFP_KERNEL); + gpummu = kzalloc_obj(*gpummu, GFP_KERNEL); if (!gpummu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index f22d33e99e81..5d47f8c0b7ea 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -480,7 +480,7 @@ static void a3xx_dump(struct msm_gpu *gpu) static struct msm_gpu_state *a3xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); @@ -533,7 +533,7 @@ static struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) goto fail; } - a3xx_gpu = kzalloc(sizeof(*a3xx_gpu), GFP_KERNEL); + a3xx_gpu = kzalloc_obj(*a3xx_gpu, GFP_KERNEL); if (!a3xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c index db06c06067ae..e44e45ce0714 100644 --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c @@ -550,7 +550,7 @@ static const unsigned int a405_registers[] = { static struct msm_gpu_state *a4xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); @@ -645,7 +645,7 @@ static struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) goto fail; } - a4xx_gpu = kzalloc(sizeof(*a4xx_gpu), GFP_KERNEL); + a4xx_gpu = kzalloc_obj(*a4xx_gpu, GFP_KERNEL); if (!a4xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 56eaff2ee4e4..66e6b828cb84 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1570,8 +1570,7 @@ static void a5xx_gpu_state_get_hlsq_regs(struct msm_gpu *gpu, static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu) { - struct a5xx_gpu_state *a5xx_state = kzalloc(sizeof(*a5xx_state), - GFP_KERNEL); + struct a5xx_gpu_state *a5xx_state = kzalloc_obj(*a5xx_state, GFP_KERNEL); bool stalled = !!(gpu_read(gpu, REG_A5XX_RBBM_STATUS3) & BIT(24)); if (!a5xx_state) @@ -1735,7 +1734,7 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) unsigned int nr_rings; int ret; - a5xx_gpu = kzalloc(sizeof(*a5xx_gpu), GFP_KERNEL); + a5xx_gpu = kzalloc_obj(*a5xx_gpu, GFP_KERNEL); if (!a5xx_gpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 2129d230a92b..b8cc33fe7279 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2648,7 +2648,7 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) bool is_a7xx; int ret, nr_rings = 1; - a6xx_gpu = kzalloc(sizeof(*a6xx_gpu), GFP_KERNEL); + a6xx_gpu = kzalloc_obj(*a6xx_gpu, GFP_KERNEL); if (!a6xx_gpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c index d2d6b2fd3cba..40933f4d2424 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c @@ -1584,8 +1584,7 @@ struct msm_gpu_state *a6xx_gpu_state_get(struct msm_gpu *gpu) struct a6xx_crashdumper _dumper = { 0 }, *dumper = NULL; struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); - struct a6xx_gpu_state *a6xx_state = kzalloc(sizeof(*a6xx_state), - GFP_KERNEL); + struct a6xx_gpu_state *a6xx_state = kzalloc_obj(*a6xx_state, GFP_KERNEL); bool stalled; if (!a6xx_state) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 6bf7c46379ae..39c1165c93a7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -887,7 +887,7 @@ static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc) if (!state->gamma_lut) { dspp->ops.setup_gc(dspp, NULL); } else { - gc_lut = kzalloc(sizeof(*gc_lut), GFP_KERNEL); + gc_lut = kzalloc_obj(*gc_lut, GFP_KERNEL); if (!gc_lut) continue; _dpu_crtc_get_gc_lut(state, gc_lut); @@ -1146,7 +1146,7 @@ end: static void dpu_crtc_reset(struct drm_crtc *crtc) { - struct dpu_crtc_state *cstate = kzalloc(sizeof(*cstate), GFP_KERNEL); + struct dpu_crtc_state *cstate = kzalloc_obj(*cstate, GFP_KERNEL); if (crtc->state) dpu_crtc_destroy_state(crtc, crtc->state); @@ -1343,7 +1343,7 @@ static int dpu_crtc_reassign_planes(struct drm_crtc *crtc, struct drm_crtc_state if (!crtc_state->enable) return 0; - states = kcalloc(total_planes, sizeof(*states), GFP_KERNEL); + states = kzalloc_objs(*states, total_planes, GFP_KERNEL); if (!states) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 0623f1dbed97..35986cefbf8b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -385,7 +385,7 @@ static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms) { struct dpu_global_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 9b7a8b46bfa9..59c44cce6753 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1684,7 +1684,7 @@ static void dpu_plane_reset(struct drm_plane *plane) plane->state = NULL; } - pstate = kzalloc(sizeof(*pstate), GFP_KERNEL); + pstate = kzalloc_obj(*pstate, GFP_KERNEL); if (!pstate) { DPU_ERROR_PLANE(pdpu, "failed to allocate state\n"); return; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 373ae7d9bf01..671f9857fbed 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -1130,8 +1130,8 @@ static void mdp5_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state static void mdp5_crtc_reset(struct drm_crtc *crtc) { - struct mdp5_crtc_state *mdp5_cstate = - kzalloc(sizeof(*mdp5_cstate), GFP_KERNEL); + struct mdp5_crtc_state *mdp5_cstate = kzalloc_obj(*mdp5_cstate, + GFP_KERNEL); if (crtc->state) mdp5_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 61edf6864092..743517e29626 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -133,7 +133,7 @@ static int mdp5_global_obj_init(struct mdp5_kms *mdp5_kms) { struct mdp5_global_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 4ca183fb61a9..83088fd8f910 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -89,7 +89,7 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); plane->state = NULL; - mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); + mdp5_state = kzalloc_obj(*mdp5_state, GFP_KERNEL); if (!mdp5_state) return; __drm_atomic_helper_plane_reset(plane, &mdp5_state->base); diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c index 2be00b11e557..60af5c02973f 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c @@ -36,7 +36,7 @@ msm_disp_snapshot_state_sync(struct msm_kms *kms) WARN_ON(!mutex_is_locked(&kms->dump_mutex)); - disp_state = kzalloc(sizeof(struct msm_disp_state), GFP_KERNEL); + disp_state = kzalloc_obj(struct msm_disp_state, GFP_KERNEL); if (!disp_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c index 19b470968f4d..fdb8ca642794 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -172,7 +172,7 @@ void msm_disp_snapshot_add_block(struct msm_disp_state *disp_state, u32 len, struct va_format vaf; va_list va; - new_blk = kzalloc(sizeof(struct msm_disp_state_block), GFP_KERNEL); + new_blk = kzalloc_obj(struct msm_disp_state_block, GFP_KERNEL); if (!new_blk) return; diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index 5fc261191cb7..00c36fa75c5c 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -921,7 +921,7 @@ static void _dp_ctrl_calc_tu(struct msm_dp_ctrl_private *ctrl, uint EXTRA_PIXCLK_CYCLE_DELAY = 4; uint HBLANK_MARGIN = 4; - tu = kzalloc(sizeof(*tu), GFP_KERNEL); + tu = kzalloc_obj(*tu, GFP_KERNEL); if (!tu) return; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c index 0752fe373351..c59c7b4c3ee0 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c @@ -1400,7 +1400,7 @@ struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi) return ERR_PTR(-EINVAL); } - hdcp_ctrl = kzalloc(sizeof(*hdcp_ctrl), GFP_KERNEL); + hdcp_ctrl = kzalloc_obj(*hdcp_ctrl, GFP_KERNEL); if (!hdcp_ctrl) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index ebefea4fb408..020b2f432b38 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -246,7 +246,7 @@ struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) struct i2c_adapter *i2c = NULL; int ret; - hdmi_i2c = kzalloc(sizeof(*hdmi_i2c), GFP_KERNEL); + hdmi_i2c = kzalloc_obj(*hdmi_i2c, GFP_KERNEL); if (!hdmi_i2c) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 97dc70876442..785172f5d74f 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -76,7 +76,7 @@ static int msm_gpu_open(struct inode *inode, struct file *file) if (!gpu || !gpu->funcs->gpu_state_get) return -ENODEV; - show_priv = kmalloc(sizeof(*show_priv), GFP_KERNEL); + show_priv = kmalloc_obj(*show_priv, GFP_KERNEL); if (!show_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index ed2a61c66ac9..2fc0fa82a275 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -247,7 +247,7 @@ static int context_init(struct drm_device *dev, struct drm_file *file) static atomic_t ident = ATOMIC_INIT(0); struct msm_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c index 1eff615ff9bf..d784d1773dee 100644 --- a/drivers/gpu/drm/msm/msm_fb.c +++ b/drivers/gpu/drm/msm/msm_fb.c @@ -194,7 +194,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, goto fail; } - msm_fb = kzalloc(sizeof(*msm_fb), GFP_KERNEL); + msm_fb = kzalloc_obj(*msm_fb, GFP_KERNEL); if (!msm_fb) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c index d41e5a6bbee0..eafd52f03d17 100644 --- a/drivers/gpu/drm/msm/msm_fence.c +++ b/drivers/gpu/drm/msm/msm_fence.c @@ -46,7 +46,7 @@ msm_fence_context_alloc(struct drm_device *dev, volatile uint32_t *fenceptr, struct msm_fence_context *fctx; static int index = 0; - fctx = kzalloc(sizeof(*fctx), GFP_KERNEL); + fctx = kzalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return ERR_PTR(-ENOMEM); @@ -176,7 +176,7 @@ msm_fence_alloc(void) { struct msm_fence *f; - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index da74f1413f94..5d4ab1900984 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -1215,7 +1215,7 @@ static int msm_gem_new_impl(struct drm_device *dev, uint32_t flags, return -EINVAL; } - msm_obj = kzalloc(sizeof(*msm_obj), GFP_KERNEL); + msm_obj = kzalloc_obj(*msm_obj, GFP_KERNEL); if (!msm_obj) return -ENOMEM; @@ -1301,7 +1301,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, msm_obj = to_msm_bo(obj); msm_gem_lock(obj); msm_obj->sgt = sgt; - msm_obj->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + msm_obj->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); if (!msm_obj->pages) { msm_gem_unlock(obj); ret = -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index 5fd58d910620..3c43e27ce553 100644 --- a/drivers/gpu/drm/msm/msm_gem_vma.c +++ b/drivers/gpu/drm/msm/msm_gem_vma.c @@ -375,7 +375,7 @@ msm_gem_vma_new(struct drm_gpuvm *gpuvm, struct drm_gem_object *obj, drm_gpuvm_resv_assert_held(&vm->base); - vma = kzalloc(sizeof(*vma), GFP_KERNEL); + vma = kzalloc_obj(*vma, GFP_KERNEL); if (!vma) return ERR_PTR(-ENOMEM); @@ -465,7 +465,7 @@ struct op_arg { static int vm_op_enqueue(struct op_arg *arg, struct msm_vm_op _op) { - struct msm_vm_op *op = kmalloc(sizeof(*op), GFP_KERNEL); + struct msm_vm_op *op = kmalloc_obj(*op, GFP_KERNEL); if (!op) return -ENOMEM; @@ -819,7 +819,7 @@ msm_gem_vm_create(struct drm_device *drm, struct msm_mmu *mmu, const char *name, if (IS_ERR(mmu)) return ERR_CAST(mmu); - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return ERR_PTR(-ENOMEM); @@ -869,8 +869,8 @@ msm_gem_vm_create(struct drm_device *drm, struct msm_mmu *mmu, const char *name, vm->log_shift = MIN(vm_log_shift, 8); if (vm->log_shift) { - vm->log = kmalloc_array(1 << vm->log_shift, sizeof(vm->log[0]), - GFP_KERNEL | __GFP_ZERO); + vm->log = kmalloc_objs(vm->log[0], 1 << vm->log_shift, + GFP_KERNEL | __GFP_ZERO); } return &vm->base; @@ -952,7 +952,7 @@ vm_bind_job_create(struct drm_device *dev, struct drm_file *file, struct msm_vm_bind_job *job; int ret; - job = kzalloc(struct_size(job, ops, nr_ops), GFP_KERNEL | __GFP_NOWARN); + job = kzalloc_flex(*job, ops, nr_ops, GFP_KERNEL | __GFP_NOWARN); if (!job) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 995549d0bbbc..24f164a04f59 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -346,8 +346,7 @@ static void crashstate_get_vm_logs(struct msm_gpu_state *state, struct msm_gem_v state->nr_vm_logs = vm_log_len; } - state->vm_logs = kmalloc_array( - state->nr_vm_logs, sizeof(vm->log[0]), GFP_KERNEL); + state->vm_logs = kmalloc_objs(vm->log[0], state->nr_vm_logs, GFP_KERNEL); if (!state->vm_logs) { state->nr_vm_logs = 0; } diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index 271baf4dc4e8..425ae5eb9af3 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -332,7 +332,7 @@ msm_iommu_pagetable_prealloc_allocate(struct msm_mmu *mmu, struct msm_mmu_preall struct kmem_cache *pt_cache = get_pt_cache(mmu); int ret; - p->pages = kvmalloc_array(p->count, sizeof(*p->pages), GFP_KERNEL); + p->pages = kvmalloc_objs(*p->pages, p->count, GFP_KERNEL); if (!p->pages) return -ENOMEM; @@ -521,7 +521,7 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent, bool kernel_m if (WARN_ONCE(!ttbr1_cfg, "No per-process page tables")) return ERR_PTR(-ENODEV); - pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL); + pagetable = kzalloc_obj(*pagetable, GFP_KERNEL); if (!pagetable) return ERR_PTR(-ENOMEM); @@ -734,7 +734,7 @@ struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks) iommu_set_pgtable_quirks(domain, quirks); - iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); + iommu = kzalloc_obj(*iommu, GFP_KERNEL); if (!iommu) { iommu_domain_free(domain); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_kms.c b/drivers/gpu/drm/msm/msm_kms.c index 6e5e94f5c9a7..e5d0ea629448 100644 --- a/drivers/gpu/drm/msm/msm_kms.c +++ b/drivers/gpu/drm/msm/msm_kms.c @@ -128,7 +128,7 @@ static int vblank_ctrl_queue_work(struct msm_drm_private *priv, { struct msm_vblank_work *vbl_work; - vbl_work = kzalloc(sizeof(*vbl_work), GFP_ATOMIC); + vbl_work = kzalloc_obj(*vbl_work, GFP_ATOMIC); if (!vbl_work) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c index c369d4acc378..e40f6aa5917d 100644 --- a/drivers/gpu/drm/msm/msm_perf.c +++ b/drivers/gpu/drm/msm/msm_perf.c @@ -204,7 +204,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor) if (priv->perf) return 0; - perf = kzalloc(sizeof(*perf), GFP_KERNEL); + perf = kzalloc_obj(*perf, GFP_KERNEL); if (!perf) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index 54493a94dcb7..3275ce9a4f07 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -245,7 +245,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name) { struct msm_rd_state *rd; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c index b2f612e5dc79..9540a615b7a9 100644 --- a/drivers/gpu/drm/msm/msm_ringbuffer.c +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c @@ -79,7 +79,7 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id, /* We assume everywhere that MSM_GPU_RINGBUFFER_SZ is a power of 2 */ BUILD_BUG_ON(!is_power_of_2(MSM_GPU_RINGBUFFER_SZ)); - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c b/drivers/gpu/drm/msm/msm_submitqueue.c index d53dfad16bde..04e4a2f2a3b0 100644 --- a/drivers/gpu/drm/msm/msm_submitqueue.c +++ b/drivers/gpu/drm/msm/msm_submitqueue.c @@ -151,7 +151,7 @@ get_sched_entity(struct msm_context *ctx, struct msm_ringbuffer *ring, struct drm_gpu_scheduler *sched = &ring->sched; int ret; - entity = kzalloc(sizeof(*ctx->entities[idx]), GFP_KERNEL); + entity = kzalloc_obj(*ctx->entities[idx], GFP_KERNEL); ret = drm_sched_entity_init(entity, sched_prio, &sched, 1, NULL); if (ret) { @@ -207,7 +207,7 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_context *ctx, if (ret) return ret; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); } if (!queue) diff --git a/drivers/gpu/drm/msm/msm_syncobj.c b/drivers/gpu/drm/msm/msm_syncobj.c index 4baa9f522c54..c67aaf6f7105 100644 --- a/drivers/gpu/drm/msm/msm_syncobj.c +++ b/drivers/gpu/drm/msm/msm_syncobj.c @@ -19,8 +19,8 @@ msm_syncobj_parse_deps(struct drm_device *dev, int ret = 0; uint32_t i, j; - syncobjs = kcalloc(nr_in_syncobjs, sizeof(*syncobjs), - GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY); + syncobjs = kzalloc_objs(*syncobjs, nr_in_syncobjs, + GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY); if (!syncobjs) return ERR_PTR(-ENOMEM); @@ -94,8 +94,8 @@ msm_syncobj_parse_post_deps(struct drm_device *dev, int ret = 0; uint32_t i, j; - post_deps = kcalloc(nr_syncobjs, sizeof(*post_deps), - GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY); + post_deps = kzalloc_objs(*post_deps, nr_syncobjs, + GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY); if (!post_deps) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 72eb0de46b54..e6ef6e318df9 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -595,7 +595,7 @@ static void lcdif_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -609,7 +609,7 @@ lcdif_crtc_atomic_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 80493224eb6c..e8b4f272aa8c 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -1158,7 +1158,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, cli = chan->cli; push = &chan->chan.push; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -1291,7 +1291,7 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num) struct drm_plane *primary; int ret; - nv_crtc = kzalloc(sizeof(*nv_crtc), GFP_KERNEL); + nv_crtc = kzalloc_obj(*nv_crtc, GFP_KERNEL); if (!nv_crtc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c index 2e12bf136607..4137e694a7b6 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c @@ -532,7 +532,7 @@ nv04_dac_create(struct drm_connector *connector, struct dcb_output *entry) struct drm_device *dev = connector->dev; struct drm_encoder *encoder; - nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c index c724bacc67f8..a1cfc8e562d9 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c @@ -697,7 +697,7 @@ nv04_dfp_create(struct drm_connector *connector, struct dcb_output *entry) return -EINVAL; } - nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c b/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c index fd2150e07e36..369646b00802 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c @@ -444,7 +444,7 @@ static int ch7006_encoder_init(struct i2c_client *client, ch7006_dbg(client, "\n"); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c b/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c index 54ea8459332d..1af644b20b0b 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c @@ -399,7 +399,7 @@ sil164_encoder_init(struct i2c_client *client, struct sil164_priv *priv; struct i2c_client *slave_client; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c index 33f29736024a..6d6a69d9d23f 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c @@ -279,7 +279,8 @@ static void nv10_overlay_init(struct drm_device *device) { struct nouveau_drm *drm = nouveau_drm(device); - struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL); + struct nouveau_plane *plane = kzalloc_obj(struct nouveau_plane, + GFP_KERNEL); unsigned int num_formats = ARRAY_SIZE(formats); int ret; @@ -470,7 +471,8 @@ static void nv04_overlay_init(struct drm_device *device) { struct nouveau_drm *drm = nouveau_drm(device); - struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL); + struct nouveau_plane *plane = kzalloc_obj(struct nouveau_plane, + GFP_KERNEL); int ret; if (!plane) diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c index c61ab083f62e..3ddcffe5c58e 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c @@ -215,7 +215,7 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry) return type; /* Allocate the necessary memory */ - nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 06de05fe5db6..8d252e8013b6 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c @@ -797,7 +797,7 @@ nv17_tv_create(struct drm_connector *connector, struct dcb_output *entry) struct drm_encoder *encoder; struct nv17_tv_encoder *tv_enc = NULL; - tv_enc = kzalloc(sizeof(*tv_enc), GFP_KERNEL); + tv_enc = kzalloc_obj(*tv_enc, GFP_KERNEL); if (!tv_enc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv50/core507d.c b/drivers/gpu/drm/nouveau/dispnv50/core507d.c index 4b947b67a844..8997e53fd2be 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/core507d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/core507d.c @@ -162,7 +162,7 @@ core507d_new_(const struct nv50_core_func *func, struct nouveau_drm *drm, struct nv50_core *core; int ret; - if (!(core = *pcore = kzalloc(sizeof(*core), GFP_KERNEL))) + if (!(core = *pcore = kzalloc_obj(*core, GFP_KERNEL))) return -ENOMEM; core->func = func; core->disp = disp; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 12b1dba8e05d..c4c5ba876775 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1115,7 +1115,7 @@ nv50_msto_new(struct drm_device *dev, struct nv50_head *head, int id) struct nv50_msto *msto; int ret; - msto = kzalloc(sizeof(*msto), GFP_KERNEL); + msto = kzalloc_obj(*msto, GFP_KERNEL); if (!msto) return ERR_PTR(-ENOMEM); @@ -1267,7 +1267,7 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, struct nv50_mstc *mstc; int ret; - if (!(mstc = *pmstc = kzalloc(sizeof(*mstc), GFP_KERNEL))) + if (!(mstc = *pmstc = kzalloc_obj(*mstc, GFP_KERNEL))) return -ENOMEM; mstc->mstm = mstm; mstc->port = port; @@ -1520,7 +1520,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max, struct nv50_mstm *mstm; int ret; - if (!(mstm = *pmstm = kzalloc(sizeof(*mstm), GFP_KERNEL))) + if (!(mstm = *pmstm = kzalloc_obj(*mstm, GFP_KERNEL))) return -ENOMEM; mstm->outp = outp; mstm->mgr.cbs = &nv50_mstm; @@ -2496,7 +2496,7 @@ nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder) return outp; } - outp = kzalloc(sizeof(*outp), GFP_KERNEL); + outp = kzalloc_obj(*outp, GFP_KERNEL); if (!outp) return ERR_PTR(-ENOMEM); @@ -2643,7 +2643,7 @@ static struct drm_atomic_state * nv50_disp_atomic_state_alloc(struct drm_device *dev) { struct nv50_atom *atom; - if (!(atom = kzalloc(sizeof(*atom), GFP_KERNEL)) || + if (!(atom = kzalloc_obj(*atom, GFP_KERNEL)) || drm_atomic_state_init(dev, &atom->state) < 0) { kfree(atom); return NULL; @@ -2833,7 +2833,7 @@ nv50_display_create(struct drm_device *dev) int ret, i; bool has_mst = false; - disp = kzalloc(sizeof(*disp), GFP_KERNEL); + disp = kzalloc_obj(*disp, GFP_KERNEL); if (!disp) return -ENOMEM; @@ -2900,7 +2900,7 @@ nv50_display_create(struct drm_device *dev) for_each_set_bit(i, &disp->disp->outp_mask, sizeof(disp->disp->outp_mask) * 8) { struct nouveau_encoder *outp; - outp = kzalloc(sizeof(*outp), GFP_KERNEL); + outp = kzalloc_obj(*outp, GFP_KERNEL); if (!outp) break; @@ -2921,7 +2921,7 @@ nv50_display_create(struct drm_device *dev) outp->base.base.possible_clones = 0; outp->conn = nouveau_connector(connector); - outp->dcb = kzalloc(sizeof(*outp->dcb), GFP_KERNEL); + outp->dcb = kzalloc_obj(*outp->dcb, GFP_KERNEL); if (!outp->dcb) break; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c index e32ed1db6c56..3f1b3c6cc7d9 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -470,7 +470,7 @@ nv50_head_atomic_duplicate_state(struct drm_crtc *crtc) { struct nv50_head_atom *armh = nv50_head_atom(crtc->state); struct nv50_head_atom *asyh; - if (!(asyh = kmalloc(sizeof(*asyh), GFP_KERNEL))) + if (!(asyh = kmalloc_obj(*asyh, GFP_KERNEL))) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); asyh->wndw = armh->wndw; @@ -496,7 +496,7 @@ nv50_head_reset(struct drm_crtc *crtc) { struct nv50_head_atom *asyh; - if (WARN_ON(!(asyh = kzalloc(sizeof(*asyh), GFP_KERNEL)))) + if (WARN_ON(!(asyh = kzalloc_obj(*asyh, GFP_KERNEL)))) return; if (crtc->state) @@ -577,7 +577,7 @@ nv50_head_create(struct drm_device *dev, int index) const struct drm_crtc_funcs *funcs; int ret; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (!head) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/dispnv50/lut.c b/drivers/gpu/drm/nouveau/dispnv50/lut.c index 6b2ad1e6eab9..e07060917cc0 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/lut.c +++ b/drivers/gpu/drm/nouveau/dispnv50/lut.c @@ -38,7 +38,7 @@ nv50_lut_load(struct nv50_lut *lut, int buffer, struct drm_property_blob *blob, int i; if (!in) { - in = kvmalloc_array(1024, sizeof(*in), GFP_KERNEL); + in = kvmalloc_objs(*in, 1024, GFP_KERNEL); if (!WARN_ON(!in)) { for (i = 0; i < 1024; i++) { in[i].red = diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 9a2c20fce0f3..54b4252f4f49 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -80,7 +80,7 @@ nv50_wndw_ctxdma_new(struct nv50_wndw *wndw, struct drm_framebuffer *fb) return ctxdma; } - if (!(ctxdma = kzalloc(sizeof(*ctxdma), GFP_KERNEL))) + if (!(ctxdma = kzalloc_obj(*ctxdma, GFP_KERNEL))) return ERR_PTR(-ENOMEM); list_add(&ctxdma->head, &wndw->ctxdma.list); @@ -730,7 +730,7 @@ nv50_wndw_atomic_duplicate_state(struct drm_plane *plane) { struct nv50_wndw_atom *armw = nv50_wndw_atom(plane->state); struct nv50_wndw_atom *asyw; - if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL))) + if (!(asyw = kmalloc_obj(*asyw, GFP_KERNEL))) return NULL; __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); asyw->sema = armw->sema; @@ -757,7 +757,7 @@ nv50_wndw_reset(struct drm_plane *plane) { struct nv50_wndw_atom *asyw; - if (WARN_ON(!(asyw = kzalloc(sizeof(*asyw), GFP_KERNEL)))) + if (WARN_ON(!(asyw = kzalloc_obj(*asyw, GFP_KERNEL)))) return; if (plane->state) @@ -863,7 +863,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, int nformat; int ret; - if (!(wndw = *pwndw = kzalloc(sizeof(*wndw), GFP_KERNEL))) + if (!(wndw = *pwndw = kzalloc_obj(*wndw, GFP_KERNEL))) return -ENOMEM; wndw->func = func; wndw->id = index; diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index a3ba07fc48a0..8c0cfab73f8f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -44,7 +44,7 @@ nouveau_abi16(struct drm_file *file_priv) struct nouveau_cli *cli = nouveau_cli(file_priv); if (!cli->abi16) { struct nouveau_abi16 *abi16; - cli->abi16 = abi16 = kzalloc(sizeof(*abi16), GFP_KERNEL); + cli->abi16 = abi16 = kzalloc_obj(*abi16, GFP_KERNEL); if (cli->abi16) { abi16->cli = cli; INIT_LIST_HEAD(&abi16->channels); @@ -124,7 +124,7 @@ nouveau_abi16_obj_new(struct nouveau_abi16 *abi16, enum nouveau_abi16_obj_type t if (obj) return ERR_PTR(-EEXIST); - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); @@ -397,7 +397,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) return nouveau_abi16_put(abi16, -EINVAL); /* allocate "abi16 channel" data and make up a handle for it */ - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return nouveau_abi16_put(abi16, -ENOMEM); @@ -597,7 +597,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS) if (!oclass) return nouveau_abi16_put(abi16, -EINVAL); - ntfy = kzalloc(sizeof(*ntfy), GFP_KERNEL); + ntfy = kzalloc_obj(*ntfy, GFP_KERNEL); if (!ntfy) return nouveau_abi16_put(abi16, -ENOMEM); @@ -635,7 +635,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) if (!chan) return nouveau_abi16_put(abi16, -ENOENT); - ntfy = kzalloc(sizeof(*ntfy), GFP_KERNEL); + ntfy = kzalloc_obj(*ntfy, GFP_KERNEL); if (!ntfy) return nouveau_abi16_put(abi16, -ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 4a75d146a171..1ddc8d1817f6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -314,7 +314,7 @@ nouveau_backlight_init(struct drm_connector *connector) if (!nv_encoder) return 0; - bl = kzalloc(sizeof(*bl), GFP_KERNEL); + bl = kzalloc_obj(*bl, GFP_KERNEL); if (!bl) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index f26562eafffc..710f0551e091 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -222,7 +222,7 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain, return ERR_PTR(-EINVAL); } - nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL); + nvbo = kzalloc_obj(struct nouveau_bo, GFP_KERNEL); if (!nvbo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index b1e92b1f7a26..5b94aa9c1d9d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c @@ -149,7 +149,7 @@ nouveau_channel_prep(struct nouveau_cli *cli, u32 target; int ret; - chan = *pchan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = *pchan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return -ENOMEM; @@ -545,7 +545,7 @@ nouveau_channels_init(struct nouveau_drm *drm) drm->chan_nr = drm->chan_total = channels->data; drm->runl_nr = fls64(runlists->data); - drm->runl = kcalloc(drm->runl_nr, sizeof(*drm->runl), GFP_KERNEL); + drm->runl = kzalloc_objs(*drm->runl, drm->runl_nr, GFP_KERNEL); if (!drm->runl) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 63621b1510f6..a8250d04eaf4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -232,7 +232,7 @@ nouveau_conn_atomic_duplicate_state(struct drm_connector *connector) { struct nouveau_conn_atom *armc = nouveau_conn_atom(connector->state); struct nouveau_conn_atom *asyc; - if (!(asyc = kmalloc(sizeof(*asyc), GFP_KERNEL))) + if (!(asyc = kmalloc_obj(*asyc, GFP_KERNEL))) return NULL; __drm_atomic_helper_connector_duplicate_state(connector, &asyc->state); asyc->dither = armc->dither; @@ -249,7 +249,7 @@ nouveau_conn_reset(struct drm_connector *connector) struct nouveau_conn_atom *asyc; if (drm_drv_uses_atomic_modeset(connector->dev)) { - if (WARN_ON(!(asyc = kzalloc(sizeof(*asyc), GFP_KERNEL)))) + if (WARN_ON(!(asyc = kzalloc_obj(*asyc, GFP_KERNEL)))) return; if (connector->state) @@ -1298,7 +1298,7 @@ nouveau_connector_create(struct drm_device *dev, int index) } drm_connector_list_iter_end(&conn_iter); - nv_connector = kzalloc(sizeof(*nv_connector), GFP_KERNEL); + nv_connector = kzalloc_obj(*nv_connector, GFP_KERNEL); if (!nv_connector) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index c7869a639bef..cb7c77f5a9a8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -295,7 +295,7 @@ nouveau_drm_debugfs_init(struct drm_minor *minor) int nouveau_debugfs_init(struct nouveau_drm *drm) { - drm->debugfs = kzalloc(sizeof(*drm->debugfs), GFP_KERNEL); + drm->debugfs = kzalloc_obj(*drm->debugfs, GFP_KERNEL); if (!drm->debugfs) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 00515623a2cc..ff51329c5565 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -316,7 +316,7 @@ nouveau_framebuffer_new(struct drm_device *dev, } } - if (!(fb = *pfb = kzalloc(sizeof(*fb), GFP_KERNEL))) + if (!(fb = *pfb = kzalloc_obj(*fb, GFP_KERNEL))) return -ENOMEM; drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd); @@ -646,7 +646,7 @@ nouveau_display_create(struct drm_device *dev) struct nouveau_display *disp; int ret; - disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL); + disp = drm->display = kzalloc_obj(*disp, GFP_KERNEL); if (!disp) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index 3d8031296eed..dbc87f8e64f9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -303,7 +303,7 @@ nouveau_dmem_chunk_alloc(struct nouveau_drm *drm, struct page **ppage, unsigned long i, pfn_first, pfn; int ret; - chunk = kzalloc(sizeof(*chunk), GFP_KERNEL); + chunk = kzalloc_obj(*chunk, GFP_KERNEL); if (chunk == NULL) { ret = -ENOMEM; goto out; @@ -481,7 +481,7 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) src_pfns = kvcalloc(npages, sizeof(*src_pfns), GFP_KERNEL | __GFP_NOFAIL); dst_pfns = kvcalloc(npages, sizeof(*dst_pfns), GFP_KERNEL | __GFP_NOFAIL); - dma_info = kvcalloc(npages, sizeof(*dma_info), GFP_KERNEL | __GFP_NOFAIL); + dma_info = kvzalloc_objs(*dma_info, npages, GFP_KERNEL | __GFP_NOFAIL); migrate_device_range(src_pfns, chunk->pagemap.range.start >> PAGE_SHIFT, npages); @@ -707,7 +707,7 @@ nouveau_dmem_init(struct nouveau_drm *drm) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_PASCAL) return; - if (!(drm->dmem = kzalloc(sizeof(*drm->dmem), GFP_KERNEL))) + if (!(drm->dmem = kzalloc_obj(*drm->dmem, GFP_KERNEL))) return; drm->dmem->drm = drm; @@ -855,7 +855,7 @@ nouveau_dmem_migrate_vma(struct nouveau_drm *drm, if (!args.dst) goto out_free_src; - dma_info = kmalloc_array(max, sizeof(*dma_info), GFP_KERNEL); + dma_info = kmalloc_objs(*dma_info, max, GFP_KERNEL); if (!dma_info) goto out_free_dst; diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index dc469e571c0a..f5cfac289983 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -739,7 +739,7 @@ nouveau_drm_device_new(const struct drm_driver *drm_driver, struct device *paren struct nouveau_drm *drm; int ret; - drm = kzalloc(sizeof(*drm), GFP_KERNEL); + drm = kzalloc_obj(*drm, GFP_KERNEL); if (!drm) return ERR_PTR(-ENOMEM); @@ -1203,7 +1203,7 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) current->comm, pid_nr(rcu_dereference(fpriv->pid))); rcu_read_unlock(); - if (!(cli = kzalloc(sizeof(*cli), GFP_KERNEL))) { + if (!(cli = kzalloc_obj(*cli, GFP_KERNEL))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.c b/drivers/gpu/drm/nouveau/nouveau_exec.c index c4949e815eb3..b0522e97ebb3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_exec.c +++ b/drivers/gpu/drm/nouveau/nouveau_exec.c @@ -219,7 +219,7 @@ nouveau_exec_job_init(struct nouveau_exec_job **pjob, } } - job = *pjob = kzalloc(sizeof(*job), GFP_KERNEL); + job = *pjob = kzalloc_obj(*job, GFP_KERNEL); if (!job) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 4a193b7d6d9e..6af37c49913f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -408,7 +408,7 @@ nouveau_fence_create(struct nouveau_fence **pfence, if (unlikely(!chan->fence)) return -ENODEV; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 395d92ab6271..2ef7cb01a0c9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -168,7 +168,7 @@ nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nouveau_vma *vma) return; } - if (!(work = kmalloc(sizeof(*work), GFP_KERNEL))) { + if (!(work = kmalloc_obj(*work, GFP_KERNEL))) { WARN_ON(dma_fence_wait_timeout(fence, false, 2 * HZ) <= 0); nouveau_gem_object_delete(vma); return; diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c index 34effe6d86ad..a0f018380744 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c @@ -678,7 +678,7 @@ nouveau_hwmon_init(struct drm_device *dev) return 0; } - hwmon = drm->hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); + hwmon = drm->hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); if (!hwmon) return -ENOMEM; hwmon->dev = dev; diff --git a/drivers/gpu/drm/nouveau/nouveau_led.c b/drivers/gpu/drm/nouveau/nouveau_led.c index ac950518a820..87397fe57021 100644 --- a/drivers/gpu/drm/nouveau/nouveau_led.c +++ b/drivers/gpu/drm/nouveau/nouveau_led.c @@ -89,7 +89,7 @@ nouveau_led_init(struct drm_device *dev) if (nvkm_gpio_find(gpio, 0, DCB_GPIO_LOGO_LED_PWM, 0xff, &logo_led)) return 0; - drm->led = kzalloc(sizeof(*drm->led), GFP_KERNEL); + drm->led = kzalloc_obj(*drm->led, GFP_KERNEL); if (!drm->led) return -ENOMEM; drm->led->dev = dev; diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index fac92fdbf9cc..b370158ba3f7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -176,7 +176,7 @@ nouveau_mem_new(struct nouveau_drm *drm, u8 kind, u8 comp, { struct nouveau_mem *mem; - if (!(mem = kzalloc(sizeof(*mem), GFP_KERNEL))) + if (!(mem = kzalloc_obj(*mem, GFP_KERNEL))) return -ENOMEM; mem->drm = drm; diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c b/drivers/gpu/drm/nouveau/nouveau_sched.c index a7bf539e5d86..402ef5e95ad7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sched.c +++ b/drivers/gpu/drm/nouveau/nouveau_sched.c @@ -69,17 +69,17 @@ nouveau_job_init(struct nouveau_job *job, goto err_free_in_sync; } - job->out_sync.objs = kcalloc(job->out_sync.count, - sizeof(*job->out_sync.objs), - GFP_KERNEL); + job->out_sync.objs = kzalloc_objs(*job->out_sync.objs, + job->out_sync.count, + GFP_KERNEL); if (!job->out_sync.objs) { ret = -ENOMEM; goto err_free_out_sync; } - job->out_sync.chains = kcalloc(job->out_sync.count, - sizeof(*job->out_sync.chains), - GFP_KERNEL); + job->out_sync.chains = kzalloc_objs(*job->out_sync.chains, + job->out_sync.count, + GFP_KERNEL); if (!job->out_sync.chains) { ret = -ENOMEM; goto err_free_objs; @@ -467,7 +467,7 @@ nouveau_sched_create(struct nouveau_sched **psched, struct nouveau_drm *drm, struct nouveau_sched *sched; int ret; - sched = kzalloc(sizeof(*sched), GFP_KERNEL); + sched = kzalloc_obj(*sched, GFP_KERNEL); if (!sched) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index bd870028514b..a22483f68a7c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c @@ -79,7 +79,7 @@ nouveau_sgdma_create_ttm(struct ttm_buffer_object *bo, uint32_t page_flags) else caching = ttm_cached; - nvbe = kzalloc(sizeof(*nvbe), GFP_KERNEL); + nvbe = kzalloc_obj(*nvbe, GFP_KERNEL); if (!nvbe) return NULL; diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index b8a3378154d5..947601a8955b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -223,7 +223,7 @@ nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst) { struct nouveau_ivmm *ivmm; if (svmm) { - if (!(ivmm = kmalloc(sizeof(*ivmm), GFP_KERNEL))) + if (!(ivmm = kmalloc_obj(*ivmm, GFP_KERNEL))) return -ENOMEM; ivmm->svmm = svmm; ivmm->inst = inst; @@ -326,7 +326,7 @@ nouveau_svmm_init(struct drm_device *dev, void *data, return -ENOSYS; /* Allocate tracking for SVM-enabled VMM. */ - if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL))) + if (!(svmm = kzalloc_obj(*svmm, GFP_KERNEL))) return -ENOMEM; svmm->vmm = &cli->svm; svmm->unmanaged.start = args->unmanaged_addr; @@ -475,7 +475,7 @@ nouveau_svm_fault_cache(struct nouveau_svm *svm, nvif_mask(memory, offset + 0x1c, 0x80000000, 0x00000000); if (!buffer->fault[buffer->fault_nr]) { - fault = kmalloc(sizeof(*fault), GFP_KERNEL); + fault = kmalloc_obj(*fault, GFP_KERNEL); if (WARN_ON(!fault)) { nouveau_svm_fault_cancel(svm, inst, hub, gpc, client); return; @@ -900,7 +900,7 @@ nouveau_pfns_alloc(unsigned long npages) { struct nouveau_pfnmap_args *args; - args = kzalloc(struct_size(args, p.phys, npages), GFP_KERNEL); + args = kzalloc_flex(*args, p.phys, npages, GFP_KERNEL); if (!args) return NULL; @@ -1010,7 +1010,8 @@ nouveau_svm_fault_buffer_ctor(struct nouveau_svm *svm, s32 oclass, int id) if (ret) return ret; - buffer->fault = kvcalloc(buffer->entries, sizeof(*buffer->fault), GFP_KERNEL); + buffer->fault = kvzalloc_objs(*buffer->fault, buffer->entries, + GFP_KERNEL); if (!buffer->fault) return -ENOMEM; @@ -1062,7 +1063,7 @@ nouveau_svm_init(struct nouveau_drm *drm) if (drm->client.device.info.family > NV_DEVICE_INFO_V0_PASCAL) return; - drm->svm = svm = kzalloc(struct_size(drm->svm, buffer, 1), GFP_KERNEL); + drm->svm = svm = kzalloc_flex(*drm->svm, buffer, 1, GFP_KERNEL); if (!drm->svm) return; diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 0a55babdf667..89216d0a8e7e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -181,7 +181,7 @@ static int nouveau_ttm_init_vram(struct nouveau_drm *drm) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) { - struct ttm_resource_manager *man = kzalloc(sizeof(*man), GFP_KERNEL); + struct ttm_resource_manager *man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return -ENOMEM; @@ -229,7 +229,7 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm) return ttm_range_man_init(&drm->ttm.bdev, TTM_PL_TT, true, size_pages); - man = kzalloc(sizeof(*man), GFP_KERNEL); + man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index 0d693760d222..caa26db2b04b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -218,7 +218,7 @@ nouveau_uvma_unmap(struct nouveau_uvma *uvma) static int nouveau_uvma_alloc(struct nouveau_uvma **puvma) { - *puvma = kzalloc(sizeof(**puvma), GFP_KERNEL); + *puvma = kzalloc_obj(**puvma, GFP_KERNEL); if (!*puvma) return -ENOMEM; @@ -246,7 +246,7 @@ nouveau_uvma_gem_put(struct nouveau_uvma *uvma) static int nouveau_uvma_region_alloc(struct nouveau_uvma_region **preg) { - *preg = kzalloc(sizeof(**preg), GFP_KERNEL); + *preg = kzalloc_obj(**preg, GFP_KERNEL); if (!*preg) return -ENOMEM; @@ -1020,7 +1020,7 @@ nouveau_uvmm_validate_range(struct nouveau_uvmm *uvmm, u64 addr, u64 range) static int nouveau_uvmm_bind_job_alloc(struct nouveau_uvmm_bind_job **pjob) { - *pjob = kzalloc(sizeof(**pjob), GFP_KERNEL); + *pjob = kzalloc_obj(**pjob, GFP_KERNEL); if (!*pjob) return -ENOMEM; @@ -1618,7 +1618,7 @@ bind_job_op_from_uop(struct bind_job_op **pop, { struct bind_job_op *op; - op = *pop = kzalloc(sizeof(*op), GFP_KERNEL); + op = *pop = kzalloc_obj(*op, GFP_KERNEL); if (!op) return -ENOMEM; @@ -1911,7 +1911,7 @@ nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, goto out_unlock; } - uvmm = kzalloc(sizeof(*uvmm), GFP_KERNEL); + uvmm = kzalloc_obj(*uvmm, GFP_KERNEL); if (!uvmm) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/gpu/drm/nouveau/nouveau_vmm.c b/drivers/gpu/drm/nouveau/nouveau_vmm.c index 3dda885df5b2..a5e8efc3042c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_vmm.c @@ -87,7 +87,7 @@ nouveau_vma_new(struct nouveau_bo *nvbo, struct nouveau_vmm *vmm, return 0; } - if (!(vma = *pvma = kmalloc(sizeof(*vma), GFP_KERNEL))) + if (!(vma = *pvma = kmalloc_obj(*vma, GFP_KERNEL))) return -ENOMEM; vma->vmm = vmm; vma->refs = 1; diff --git a/drivers/gpu/drm/nouveau/nv04_fence.c b/drivers/gpu/drm/nouveau/nv04_fence.c index fa5c6029f783..7fa9eede7c5d 100644 --- a/drivers/gpu/drm/nouveau/nv04_fence.c +++ b/drivers/gpu/drm/nouveau/nv04_fence.c @@ -76,7 +76,7 @@ nv04_fence_context_del(struct nouveau_channel *chan) static int nv04_fence_context_new(struct nouveau_channel *chan) { - struct nv04_fence_chan *fctx = kzalloc(sizeof(*fctx), GFP_KERNEL); + struct nv04_fence_chan *fctx = kzalloc_obj(*fctx, GFP_KERNEL); if (fctx) { nouveau_fence_context_new(chan, &fctx->base); fctx->base.emit = nv04_fence_emit; @@ -101,7 +101,7 @@ nv04_fence_create(struct nouveau_drm *drm) { struct nv04_fence_priv *priv; - priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c index 40ee95340814..0f859251d9db 100644 --- a/drivers/gpu/drm/nouveau/nv10_fence.c +++ b/drivers/gpu/drm/nouveau/nv10_fence.c @@ -70,7 +70,7 @@ nv10_fence_context_new(struct nouveau_channel *chan) { struct nv10_fence_chan *fctx; - fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return -ENOMEM; @@ -96,7 +96,7 @@ nv10_fence_create(struct nouveau_drm *drm) { struct nv10_fence_priv *priv; - priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv17_fence.c b/drivers/gpu/drm/nouveau/nv17_fence.c index 1b0c0aa3c305..56682cb03d81 100644 --- a/drivers/gpu/drm/nouveau/nv17_fence.c +++ b/drivers/gpu/drm/nouveau/nv17_fence.c @@ -83,7 +83,7 @@ nv17_fence_context_new(struct nouveau_channel *chan) u32 limit = start + priv->bo->bo.base.size - 1; int ret = 0; - fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return -ENOMEM; @@ -120,7 +120,7 @@ nv17_fence_create(struct nouveau_drm *drm) struct nv10_fence_priv *priv; int ret = 0; - priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv50_fence.c b/drivers/gpu/drm/nouveau/nv50_fence.c index e1f0e8adf313..d64c070fe48b 100644 --- a/drivers/gpu/drm/nouveau/nv50_fence.c +++ b/drivers/gpu/drm/nouveau/nv50_fence.c @@ -42,7 +42,7 @@ nv50_fence_context_new(struct nouveau_channel *chan) u32 limit = start + priv->bo->bo.base.size - 1; int ret; - fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return -ENOMEM; @@ -71,7 +71,7 @@ nv50_fence_create(struct nouveau_drm *drm) struct nv10_fence_priv *priv; int ret = 0; - priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv84_fence.c b/drivers/gpu/drm/nouveau/nv84_fence.c index 1765b2cedaf9..7a2ad00870af 100644 --- a/drivers/gpu/drm/nouveau/nv84_fence.c +++ b/drivers/gpu/drm/nouveau/nv84_fence.c @@ -131,7 +131,7 @@ nv84_fence_context_new(struct nouveau_channel *chan) struct nv84_fence_chan *fctx; int ret; - fctx = chan->fence = kzalloc(sizeof(*fctx), GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return -ENOMEM; @@ -198,7 +198,7 @@ nv84_fence_create(struct nouveau_drm *drm) u32 domain; int ret; - priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvif/fifo.c b/drivers/gpu/drm/nouveau/nvif/fifo.c index b0ab80995d98..b42fc34cb5ce 100644 --- a/drivers/gpu/drm/nouveau/nvif/fifo.c +++ b/drivers/gpu/drm/nouveau/nvif/fifo.c @@ -36,7 +36,7 @@ nvif_fifo_runlists(struct nvif_device *device) if (device->runlist) return 0; - if (!(a = kmalloc(sizeof(*a), GFP_KERNEL))) + if (!(a = kmalloc_obj(*a, GFP_KERNEL))) return -ENOMEM; a->m.version = 1; a->m.count = sizeof(a->v) / sizeof(a->v.runlists); @@ -51,8 +51,8 @@ nvif_fifo_runlists(struct nvif_device *device) goto done; device->runlists = fls64(a->v.runlists.data); - device->runlist = kcalloc(device->runlists, sizeof(*device->runlist), - GFP_KERNEL); + device->runlist = kzalloc_objs(*device->runlist, device->runlists, + GFP_KERNEL); if (!device->runlist) { ret = -ENOMEM; goto done; diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mmu.c index c9dd3cff49a0..eaa96608a264 100644 --- a/drivers/gpu/drm/nouveau/nvif/mmu.c +++ b/drivers/gpu/drm/nouveau/nvif/mmu.c @@ -69,15 +69,12 @@ nvif_mmu_ctor(struct nvif_object *parent, const char *name, s32 oclass, goto done; mmu->mem = mems[ret].oclass; - mmu->heap = kmalloc_array(mmu->heap_nr, sizeof(*mmu->heap), - GFP_KERNEL); - mmu->type = kmalloc_array(mmu->type_nr, sizeof(*mmu->type), - GFP_KERNEL); + mmu->heap = kmalloc_objs(*mmu->heap, mmu->heap_nr, GFP_KERNEL); + mmu->type = kmalloc_objs(*mmu->type, mmu->type_nr, GFP_KERNEL); if (ret = -ENOMEM, !mmu->heap || !mmu->type) goto done; - mmu->kind = kmalloc_array(mmu->kind_nr, sizeof(*mmu->kind), - GFP_KERNEL); + mmu->kind = kmalloc_objs(*mmu->kind, mmu->kind_nr, GFP_KERNEL); if (!mmu->kind && mmu->kind_nr) goto done; diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c index 70af63d70976..93ad63f9021f 100644 --- a/drivers/gpu/drm/nouveau/nvif/object.c +++ b/drivers/gpu/drm/nouveau/nvif/object.c @@ -81,7 +81,7 @@ nvif_object_sclass_get(struct nvif_object *object, struct nvif_sclass **psclass) return ret; } - *psclass = kcalloc(args->sclass.count, sizeof(**psclass), GFP_KERNEL); + *psclass = kzalloc_objs(**psclass, args->sclass.count, GFP_KERNEL); if (*psclass) { for (i = 0; i < args->sclass.count; i++) { (*psclass)[i].oclass = args->sclass.oclass[i].oclass; diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c index 32f6c5eb92af..567cacc04989 100644 --- a/drivers/gpu/drm/nouveau/nvif/outp.c +++ b/drivers/gpu/drm/nouveau/nvif/outp.c @@ -438,7 +438,7 @@ nvif_outp_edid_get(struct nvif_outp *outp, u8 **pedid) struct nvif_outp_edid_get_v0 *args; int ret; - args = kmalloc(sizeof(*args), GFP_KERNEL); + args = kmalloc_obj(*args, GFP_KERNEL); if (!args) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvif/vmm.c b/drivers/gpu/drm/nouveau/nvif/vmm.c index 07c1ebc2a941..15e5f423c680 100644 --- a/drivers/gpu/drm/nouveau/nvif/vmm.c +++ b/drivers/gpu/drm/nouveau/nvif/vmm.c @@ -234,8 +234,7 @@ nvif_vmm_ctor(struct nvif_mmu *mmu, const char *name, s32 oclass, vmm->limit = args->size; vmm->page_nr = args->page_nr; - vmm->page = kmalloc_array(vmm->page_nr, sizeof(*vmm->page), - GFP_KERNEL); + vmm->page = kmalloc_objs(*vmm->page, vmm->page_nr, GFP_KERNEL); if (!vmm->page) { ret = -ENOMEM; goto done; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu/drm/nouveau/nvkm/core/client.c index 72c88db627a5..637fa5f89dc7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/client.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c @@ -109,7 +109,7 @@ nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg, struct nvkm_oclass oclass = { .base = nvkm_uclient_sclass }; struct nvkm_client *client; - if (!(client = *pclient = kzalloc(sizeof(*client), GFP_KERNEL))) + if (!(client = *pclient = kzalloc_obj(*client, GFP_KERNEL))) return -ENOMEM; oclass.client = client; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/engine.c b/drivers/gpu/drm/nouveau/nvkm/core/engine.c index 5bf62940d7be..1b94e0aa0f28 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/engine.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/engine.c @@ -183,7 +183,7 @@ nvkm_engine_new_(const struct nvkm_engine_func *func, struct nvkm_device *device enum nvkm_subdev_type type, int inst, bool enable, struct nvkm_engine **pengine) { - if (!(*pengine = kzalloc(sizeof(**pengine), GFP_KERNEL))) + if (!(*pengine = kzalloc_obj(**pengine, GFP_KERNEL))) return -ENOMEM; return nvkm_engine_ctor(func, device, type, inst, enable, *pengine); } diff --git a/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c b/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c index d6de2b3ed2c3..a81eddf777ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c @@ -232,7 +232,7 @@ nvkm_gpuobj_new(struct nvkm_device *device, u32 size, int align, bool zero, struct nvkm_gpuobj *gpuobj; int ret; - if (!(gpuobj = *pgpuobj = kzalloc(sizeof(*gpuobj), GFP_KERNEL))) + if (!(gpuobj = *pgpuobj = kzalloc_obj(*gpuobj, GFP_KERNEL))) return -ENOMEM; ret = nvkm_gpuobj_ctor(device, size, align, zero, parent, gpuobj); @@ -249,7 +249,7 @@ nvkm_gpuobj_new(struct nvkm_device *device, u32 size, int align, bool zero, int nvkm_gpuobj_wrap(struct nvkm_memory *memory, struct nvkm_gpuobj **pgpuobj) { - if (!(*pgpuobj = kzalloc(sizeof(**pgpuobj), GFP_KERNEL))) + if (!(*pgpuobj = kzalloc_obj(**pgpuobj, GFP_KERNEL))) return -ENOMEM; (*pgpuobj)->addr = nvkm_memory_addr(memory); diff --git a/drivers/gpu/drm/nouveau/nvkm/core/intr.c b/drivers/gpu/drm/nouveau/nvkm/core/intr.c index 36a747f0039e..a58de178cdf6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/intr.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/intr.c @@ -239,8 +239,8 @@ nvkm_intr_add(const struct nvkm_intr_func *func, const struct nvkm_intr_data *da intr->data = data; intr->subdev = subdev; intr->leaves = leaves; - intr->stat = kcalloc(leaves, sizeof(*intr->stat), GFP_KERNEL); - intr->mask = kcalloc(leaves, sizeof(*intr->mask), GFP_KERNEL); + intr->stat = kzalloc_objs(*intr->stat, leaves, GFP_KERNEL); + intr->mask = kzalloc_objs(*intr->mask, leaves, GFP_KERNEL); if (!intr->stat || !intr->mask) { kfree(intr->stat); return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/memory.c b/drivers/gpu/drm/nouveau/nvkm/core/memory.c index a705c2dfca80..bf69467e44da 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/memory.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/memory.c @@ -69,7 +69,7 @@ nvkm_memory_tags_get(struct nvkm_memory *memory, struct nvkm_device *device, return 0; } - if (!(tags = kmalloc(sizeof(*tags), GFP_KERNEL))) { + if (!(tags = kmalloc_obj(*tags, GFP_KERNEL))) { mutex_unlock(&fb->tags.mutex); return -ENOMEM; } diff --git a/drivers/gpu/drm/nouveau/nvkm/core/mm.c b/drivers/gpu/drm/nouveau/nvkm/core/mm.c index f78a06a6b2f1..bd47502d82ae 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/mm.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/mm.c @@ -90,7 +90,7 @@ region_head(struct nvkm_mm *mm, struct nvkm_mm_node *a, u32 size) if (a->length == size) return a; - b = kmalloc(sizeof(*b), GFP_KERNEL); + b = kmalloc_obj(*b, GFP_KERNEL); if (unlikely(b == NULL)) return NULL; @@ -165,7 +165,7 @@ region_tail(struct nvkm_mm *mm, struct nvkm_mm_node *a, u32 size) if (a->length == size) return a; - b = kmalloc(sizeof(*b), GFP_KERNEL); + b = kmalloc_obj(*b, GFP_KERNEL); if (unlikely(b == NULL)) return NULL; @@ -247,7 +247,7 @@ nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) next = prev->offset + prev->length; if (next != offset) { BUG_ON(next > offset); - if (!(node = kzalloc(sizeof(*node), GFP_KERNEL))) + if (!(node = kzalloc_obj(*node, GFP_KERNEL))) return -ENOMEM; node->type = NVKM_MM_TYPE_HOLE; node->offset = next; @@ -262,7 +262,7 @@ nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) mm->heap_nodes = 0; } - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/object.c b/drivers/gpu/drm/nouveau/nvkm/core/object.c index af9f00f74c28..6e84cf72bfc8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/object.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/object.c @@ -290,7 +290,7 @@ nvkm_object_new_(const struct nvkm_object_func *func, struct nvkm_object **pobject) { if (size == 0) { - if (!(*pobject = kzalloc(sizeof(**pobject), GFP_KERNEL))) + if (!(*pobject = kzalloc_obj(**pobject, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(func, oclass, *pobject); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c index 7c9edf752768..bfa9821b3ac4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c @@ -178,7 +178,7 @@ int nvkm_oproxy_new_(const struct nvkm_oproxy_func *func, const struct nvkm_oclass *oclass, struct nvkm_oproxy **poproxy) { - if (!(*poproxy = kzalloc(sizeof(**poproxy), GFP_KERNEL))) + if (!(*poproxy = kzalloc_obj(**poproxy, GFP_KERNEL))) return -ENOMEM; nvkm_oproxy_ctor(func, oclass, *poproxy); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index b7045d1c8415..97f5db788ba6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -280,7 +280,7 @@ int nvkm_subdev_new_(const struct nvkm_subdev_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_subdev **psubdev) { - if (!(*psubdev = kzalloc(sizeof(**psubdev), GFP_KERNEL))) + if (!(*psubdev = kzalloc_obj(**psubdev, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(func, device, type, inst, *psubdev); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c index 46beb6e470ee..5295b2b920e6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c @@ -144,7 +144,7 @@ nvkm_uevent_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, if (argc < sizeof(args->v0) || args->v0.version != 0) return -ENOSYS; - if (!(uevent = kzalloc(sizeof(*uevent), GFP_KERNEL))) + if (!(uevent = kzalloc_obj(*uevent, GFP_KERNEL))) return -ENOMEM; *pobject = &uevent->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c index ce774579c89d..4d09157fd7c0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c @@ -194,7 +194,7 @@ nvkm_control_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, { struct nvkm_control *ctrl; - if (!(ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL))) + if (!(ctrl = kzalloc_obj(*ctrl, GFP_KERNEL))) return -ENOMEM; *pobject = &ctrl->object; ctrl->device = device; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c index 4c29b60460d4..1e7b4a455049 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c @@ -1688,7 +1688,7 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg, pcid++; } - if (!(pdev = kzalloc(sizeof(*pdev), GFP_KERNEL))) { + if (!(pdev = kzalloc_obj(*pdev, GFP_KERNEL))) { pci_disable_device(pci_dev); return -ENOMEM; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c index 03aa6f09ec89..d49d92fa4648 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -253,7 +253,7 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, unsigned long rate; int ret; - if (!(tdev = kzalloc(sizeof(*tdev), GFP_KERNEL))) + if (!(tdev = kzalloc_obj(*tdev, GFP_KERNEL))) return -ENOMEM; tdev->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c index 32ff3181f47b..7dea6bf31b10 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c @@ -327,7 +327,7 @@ nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_client *client = oclass->client; struct nvkm_udevice *udev; - if (!(udev = kzalloc(sizeof(*udev), GFP_KERNEL))) + if (!(udev = kzalloc_obj(*udev, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nvkm_udevice, oclass, &udev->object); *pobject = &udev->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 84745f60912e..d25ef27ccf5d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -232,7 +232,7 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, struct nvkm_disp *disp; int ret; - if (!(disp = *pdisp = kzalloc(sizeof(**pdisp), GFP_KERNEL))) + if (!(disp = *pdisp = kzalloc_obj(**pdisp, GFP_KERNEL))) return -ENOMEM; disp->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c index 57a62a2de7c7..9b7148ce8d1b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c @@ -86,7 +86,7 @@ nvkm_disp_chan_child_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_disp_chan_object *object; int ret; - if (!(object = kzalloc(sizeof(*object), GFP_KERNEL))) + if (!(object = kzalloc_obj(*object, GFP_KERNEL))) return -ENOMEM; nvkm_oproxy_ctor(&nvkm_disp_chan_child_func_, oclass, &object->oproxy); object->disp = disp; @@ -195,7 +195,7 @@ nvkm_disp_chan_new_(struct nvkm_disp *disp, int nr, const struct nvkm_oclass *oc if (args->v0.id >= nr || !args->v0.pushbuf != !user->func->push) return -EINVAL; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; *pobject = &chan->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c index ff88a5a5253a..e4cfb172c383 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c @@ -78,7 +78,7 @@ int nvkm_conn_new(struct nvkm_disp *disp, int index, struct nvbios_connE *info, struct nvkm_conn **pconn) { - if (!(*pconn = kzalloc(sizeof(**pconn), GFP_KERNEL))) + if (!(*pconn = kzalloc_obj(**pconn, GFP_KERNEL))) return -ENOMEM; nvkm_conn_ctor(disp, index, info, *pconn); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c index 614921166fba..bf79076081f6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c @@ -822,7 +822,7 @@ gv100_disp_caps_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_disp *disp = nvkm_udisp(oclass->parent); struct gv100_disp_caps *caps; - if (!(caps = kzalloc(sizeof(*caps), GFP_KERNEL))) + if (!(caps = kzalloc_obj(*caps, GFP_KERNEL))) return -ENOMEM; *pobject = &caps->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c index 7f5d13d13c94..ffe2ec55a15a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c @@ -56,7 +56,7 @@ nvkm_head_new_(const struct nvkm_head_func *func, struct nvkm_disp *disp, int id) { struct nvkm_head *head; - if (!(head = kzalloc(sizeof(*head), GFP_KERNEL))) + if (!(head = kzalloc_obj(*head, GFP_KERNEL))) return -ENOMEM; head->func = func; head->disp = disp; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c index e420bf2e4330..d680ef5355a3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c @@ -58,7 +58,7 @@ nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *disp, enum nvkm_ior_type type, int id, bool hda) { struct nvkm_ior *ior; - if (!(ior = kzalloc(sizeof(*ior), GFP_KERNEL))) + if (!(ior = kzalloc_obj(*ior, GFP_KERNEL))) return -ENOMEM; ior->func = func; ior->disp = disp; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index 28adc5a30f2f..c61453db7597 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c @@ -379,7 +379,7 @@ nvkm_outp_new_(const struct nvkm_outp_func *func, struct nvkm_disp *disp, enum nvkm_ior_proto proto; enum nvkm_ior_type type; - if (!(outp = *poutp = kzalloc(sizeof(*outp), GFP_KERNEL))) + if (!(outp = *poutp = kzalloc_obj(*outp, GFP_KERNEL))) return -ENOMEM; outp->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c index 425cde35f128..8fcc4c587a28 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c @@ -108,7 +108,7 @@ nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device, { struct nvkm_dma *dma; - if (!(dma = *pdma = kzalloc(sizeof(*dma), GFP_KERNEL))) + if (!(dma = *pdma = kzalloc_obj(*dma, GFP_KERNEL))) return -ENOMEM; dma->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c index ef7ac360101e..2c1b14f93fb2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c @@ -78,7 +78,7 @@ gf100_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, user, unkn; int ret; - if (!(dmaobj = kzalloc(sizeof(*dmaobj), GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c index c068cee34588..c16449eb3c95 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c @@ -76,7 +76,7 @@ gf119_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, page; int ret; - if (!(dmaobj = kzalloc(sizeof(*dmaobj), GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c index 39eba9fc82be..982ee81fd2bc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c @@ -75,7 +75,7 @@ gv100_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, page; int ret; - if (!(dmaobj = kzalloc(sizeof(*dmaobj), GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c index 5159d5df20a2..fcc87163c2d6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c @@ -85,7 +85,7 @@ nv04_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, struct nv04_dmaobj *dmaobj; int ret; - if (!(dmaobj = kzalloc(sizeof(*dmaobj), GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c index 6a85b5dea643..5cf0986c7944 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c @@ -78,7 +78,7 @@ nv50_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 user, part, comp, kind; int ret; - if (!(dmaobj = kzalloc(sizeof(*dmaobj), GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c index cf8e356867b4..bf6a225f5673 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c @@ -341,7 +341,7 @@ nvkm_falcon_new_(const struct nvkm_falcon_func *func, struct nvkm_device *device { struct nvkm_falcon *falcon; - if (!(falcon = kzalloc(sizeof(*falcon), GFP_KERNEL))) + if (!(falcon = kzalloc_obj(*falcon, GFP_KERNEL))) return -ENOMEM; falcon->func = func; falcon->addr = addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index 1561287a32f2..7dad0bf10631 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -377,7 +377,7 @@ nvkm_fifo_new_(const struct nvkm_fifo_func *func, struct nvkm_device *device, { struct nvkm_fifo *fifo; - if (!(fifo = *pfifo = kzalloc(sizeof(*fifo), GFP_KERNEL))) + if (!(fifo = *pfifo = kzalloc_obj(*fifo, GFP_KERNEL))) return -ENOMEM; fifo->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c index 814db9daa194..2b852341d8f4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c @@ -69,7 +69,7 @@ nvkm_cgrp_ectx_get(struct nvkm_cgrp *cgrp, struct nvkm_engn *engn, struct nvkm_e /* Nope - create a fresh one. */ CGRP_TRACE(cgrp, "ctor ectx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(ectx = *pectx = kzalloc(sizeof(*ectx), GFP_KERNEL))) + if (!(ectx = *pectx = kzalloc_obj(*ectx, GFP_KERNEL))) return -ENOMEM; ectx->engn = engn; @@ -141,7 +141,7 @@ nvkm_cgrp_vctx_get(struct nvkm_cgrp *cgrp, struct nvkm_engn *engn, struct nvkm_c /* Now, create the sub-context. */ CGRP_TRACE(cgrp, "ctor vctx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(vctx = *pvctx = kzalloc(sizeof(*vctx), GFP_KERNEL))) { + if (!(vctx = *pvctx = kzalloc_obj(*vctx, GFP_KERNEL))) { nvkm_cgrp_ectx_put(cgrp, &ectx); return -ENOMEM; } @@ -224,7 +224,7 @@ nvkm_cgrp_new(struct nvkm_runl *runl, const char *name, struct nvkm_vmm *vmm, bo { struct nvkm_cgrp *cgrp; - if (!(cgrp = *pcgrp = kmalloc(sizeof(*cgrp), GFP_KERNEL))) + if (!(cgrp = *pcgrp = kmalloc_obj(*cgrp, GFP_KERNEL))) return -ENOMEM; cgrp->func = runl->fifo->func->cgrp.func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c index e5bbd8563007..0c6a5220ef80 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c @@ -117,7 +117,7 @@ nvkm_chan_cctx_get(struct nvkm_chan *chan, struct nvkm_engn *engn, struct nvkm_c /* Now, create the channel context - to track engine binding. */ CHAN_TRACE(chan, "ctor cctx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(cctx = *pcctx = kzalloc(sizeof(*cctx), GFP_KERNEL))) { + if (!(cctx = *pcctx = kzalloc_obj(*cctx, GFP_KERNEL))) { nvkm_cgrp_vctx_put(cgrp, &vctx); ret = -ENOMEM; goto done; @@ -367,7 +367,7 @@ nvkm_chan_new_(const struct nvkm_chan_func *func, struct nvkm_runl *runl, int ru return -EINVAL; } - if (!(chan = *pchan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = *pchan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; chan->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chid.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chid.c index 23944d95efd5..e7e0c381606c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chid.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chid.c @@ -89,7 +89,7 @@ nvkm_chid_new(const struct nvkm_event_func *func, struct nvkm_subdev *subdev, struct nvkm_chid *chid; int id; - if (!(chid = *pchid = kzalloc(struct_size(chid, used, nr), GFP_KERNEL))) + if (!(chid = *pchid = kzalloc_flex(*chid, used, nr, GFP_KERNEL))) return -ENOMEM; kref_init(&chid->kref); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c index 454a481a0aef..42e49781eb21 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c @@ -349,7 +349,7 @@ nvkm_runl_add(struct nvkm_runl *runl, int engi, const struct nvkm_engn_func *fun return NULL; } - if (!(engn = kzalloc(sizeof(*engn), GFP_KERNEL))) + if (!(engn = kzalloc_obj(*engn, GFP_KERNEL))) return NULL; engn->func = func; @@ -398,7 +398,7 @@ nvkm_runl_new(struct nvkm_fifo *fifo, int runi, u32 addr, int id_nr) struct nvkm_runl *runl; int ret; - if (!(runl = kzalloc(sizeof(*runl), GFP_KERNEL))) + if (!(runl = kzalloc_obj(*runl, GFP_KERNEL))) return ERR_PTR(-ENOMEM); runl->func = fifo->func->runl; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c index 33bcf5fb3ef0..e26e0f093755 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c @@ -34,7 +34,7 @@ nvkm_runq_new(struct nvkm_fifo *fifo, int pbid) { struct nvkm_runq *runq; - if (!(runq = kzalloc(sizeof(*runq), GFP_KERNEL))) + if (!(runq = kzalloc_obj(*runq, GFP_KERNEL))) return NULL; runq->func = fifo->func->runq; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c index 52c594dfb1b8..cea98ea25178 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c @@ -104,7 +104,7 @@ nvkm_ucgrp_new(struct nvkm_fifo *fifo, const struct nvkm_oclass *oclass, void *a return PTR_ERR(vmm); /* Allocate channel group. */ - if (!(ucgrp = kzalloc(sizeof(*ucgrp), GFP_KERNEL))) { + if (!(ucgrp = kzalloc_obj(*ucgrp, GFP_KERNEL))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c index c978b97e10c6..f986dbd14f73 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c @@ -166,7 +166,7 @@ nvkm_uchan_object_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, return -EINVAL; /* Allocate SW object. */ - if (!(uobj = kzalloc(sizeof(*uobj), GFP_KERNEL))) + if (!(uobj = kzalloc_obj(*uobj, GFP_KERNEL))) return -ENOMEM; nvkm_oproxy_ctor(&nvkm_uchan_object, oclass, &uobj->oproxy); @@ -375,7 +375,7 @@ nvkm_uchan_new(struct nvkm_fifo *fifo, struct nvkm_cgrp *cgrp, const struct nvkm } /* Allocate channel. */ - if (!(uchan = kzalloc(sizeof(*uchan), GFP_KERNEL))) { + if (!(uchan = kzalloc_obj(*uchan, GFP_KERNEL))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index 3608215f0f11..910ca0d4aa0f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -285,7 +285,7 @@ gf100_gr_object_new(const struct nvkm_oclass *oclass, void *data, u32 size, struct gf100_gr_chan *chan = gf100_gr_chan(oclass->parent); struct gf100_gr_object *object; - if (!(object = kzalloc(sizeof(*object), GFP_KERNEL))) + if (!(object = kzalloc_obj(*object, GFP_KERNEL))) return -ENOMEM; *pobject = &object->object; @@ -384,7 +384,7 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nvkm_device *device = gr->base.engine.subdev.device; int ret; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&gf100_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -2624,7 +2624,7 @@ gf100_gr_new_(const struct gf100_gr_fwif *fwif, struct nvkm_device *device, struct gf100_gr *gr; int ret; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c index 82937df8b8c0..3bf288190cd1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c @@ -1188,7 +1188,7 @@ nv04_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv04_gr_chan *chan; unsigned long flags; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv04_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -1417,7 +1417,7 @@ nv04_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, st { struct nv04_gr *gr; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c index fcb4e4fce83f..8b724b3acdba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c @@ -1007,7 +1007,7 @@ nv10_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nvkm_device *device = gr->base.engine.subdev.device; unsigned long flags; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv10_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -1177,7 +1177,7 @@ nv10_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv10_gr *gr; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c index ab57b3b40228..f12053d47fcf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c @@ -79,7 +79,7 @@ nv20_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv20_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -334,7 +334,7 @@ nv20_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv20_gr *gr; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c index d6bc6904dcc8..91c613e00e5e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c @@ -25,7 +25,7 @@ nv25_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv25_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c index e5a351b51eb9..4435db568bb4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c @@ -25,7 +25,7 @@ nv2a_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv2a_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c index 80370323755e..6da312944498 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c @@ -26,7 +26,7 @@ nv30_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv30_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c index cdf043bbdd59..8cb48adc5d58 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c @@ -25,7 +25,7 @@ nv34_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv34_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c index fa5a6ccb871d..4116872fd2d1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c @@ -25,7 +25,7 @@ nv35_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv35_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c index e3e797cf3034..5af4fa408fb8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c @@ -152,7 +152,7 @@ nv40_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv40_gr_chan *chan; unsigned long flags; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv40_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -433,7 +433,7 @@ nv40_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv40_gr *gr; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; *pgr = &gr->base; INIT_LIST_HEAD(&gr->chan); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c index c8a0288c092d..fae9254fa870 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c @@ -92,7 +92,7 @@ nv50_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv50_gr *gr = nv50_gr(base); struct nv50_gr_chan *chan; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv50_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -765,7 +765,7 @@ nv50_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv50_gr *gr; - if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c index db9fc1ecae0d..ee907c2987a6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c @@ -89,7 +89,7 @@ nv31_mpeg_chan_new(struct nvkm_chan *fifoch, const struct nvkm_oclass *oclass, unsigned long flags; int ret = -EBUSY; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv31_mpeg_chan, oclass, &chan->object); chan->mpeg = mpeg; @@ -277,7 +277,7 @@ nv31_mpeg_new_(const struct nv31_mpeg_func *func, struct nvkm_device *device, { struct nv31_mpeg *mpeg; - if (!(mpeg = kzalloc(sizeof(*mpeg), GFP_KERNEL))) + if (!(mpeg = kzalloc_obj(*mpeg, GFP_KERNEL))) return -ENOMEM; mpeg->func = func; *pmpeg = &mpeg->engine; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c index 38146f9cc81c..c14b6efcaf6d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c @@ -107,7 +107,7 @@ nv44_mpeg_chan_new(struct nvkm_chan *fifoch, const struct nvkm_oclass *oclass, struct nv44_mpeg_chan *chan; unsigned long flags; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nv44_mpeg_chan, oclass, &chan->object); chan->mpeg = mpeg; @@ -207,7 +207,7 @@ nv44_mpeg_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct nv44_mpeg *mpeg; - if (!(mpeg = kzalloc(sizeof(*mpeg), GFP_KERNEL))) + if (!(mpeg = kzalloc_obj(*mpeg, GFP_KERNEL))) return -ENOMEM; INIT_LIST_HEAD(&mpeg->chan); *pmpeg = &mpeg->engine; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c index 7d1c6791ae82..175a372a1de4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c @@ -43,7 +43,7 @@ nvkm_nvdec_new_(const struct nvkm_nvdec_fwif *fwif, struct nvkm_device *device, struct nvkm_nvdec *nvdec; int ret; - if (!(nvdec = *pnvdec = kzalloc(sizeof(*nvdec), GFP_KERNEL))) + if (!(nvdec = *pnvdec = kzalloc_obj(*nvdec, GFP_KERNEL))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_nvdec, device, type, inst, true, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c index d45dbb42a0db..d8e6c8b58643 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c @@ -44,7 +44,7 @@ nvkm_nvenc_new_(const struct nvkm_nvenc_fwif *fwif, struct nvkm_device *device, struct nvkm_nvenc *nvenc; int ret; - if (!(nvenc = *pnvenc = kzalloc(sizeof(*nvenc), GFP_KERNEL))) + if (!(nvenc = *pnvenc = kzalloc_obj(*nvenc, GFP_KERNEL))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_nvenc, device, type, inst, true, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c index 3e4d6a680ee9..f8c0656f74c1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c @@ -137,7 +137,7 @@ nvkm_sec2_new_(const struct nvkm_sec2_fwif *fwif, struct nvkm_device *device, struct nvkm_sec2 *sec2; int ret; - if (!(sec2 = *psec2 = kzalloc(sizeof(*sec2), GFP_KERNEL))) + if (!(sec2 = *psec2 = kzalloc_obj(*sec2, GFP_KERNEL))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_sec2, device, type, inst, true, &sec2->engine); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c index 83a6bad5967e..fb5c05e49b80 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c @@ -42,7 +42,7 @@ r535_sec2_new(const struct nvkm_sec2_func *func, struct nvkm_device *device, struct nvkm_sec2 *sec2; int ret; - if (!(sec2 = *psec2 = kzalloc(sizeof(*sec2), GFP_KERNEL))) + if (!(sec2 = *psec2 = kzalloc_obj(*sec2, GFP_KERNEL))) return -ENOMEM; ret = nvkm_engine_ctor(&r535_sec2, device, type, inst, true, &sec2->engine); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c index 20220d6d4a13..3201ab862764 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c @@ -100,7 +100,7 @@ nvkm_sw_new_(const struct nvkm_sw_func *func, struct nvkm_device *device, { struct nvkm_sw *sw; - if (!(sw = *psw = kzalloc(sizeof(*sw), GFP_KERNEL))) + if (!(sw = *psw = kzalloc_obj(*sw, GFP_KERNEL))) return -ENOMEM; INIT_LIST_HEAD(&sw->chan); sw->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c index a0273baf4c67..42a1fcacb45b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c @@ -110,7 +110,7 @@ gf100_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifoch, struct nv50_sw_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c index 8a1d112da894..d1fc9c58653d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c @@ -111,7 +111,7 @@ nv04_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifo, { struct nv04_sw_chan *chan; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; atomic_set(&chan->ref, 0); *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c index 742c75859569..cac43cedebf9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c @@ -41,7 +41,7 @@ nv10_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifo, { struct nvkm_sw_chan *chan; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; *pobject = &chan->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c index 99476d32c5af..62d719241cf6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c @@ -106,7 +106,7 @@ nv50_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifoch, struct nv50_sw_chan *chan; int ret, i; - if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) return -ENOMEM; *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c index f5affa1c8f34..023b94c7abe0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c @@ -64,7 +64,7 @@ nvkm_nvsw_new_(const struct nvkm_nvsw_func *func, struct nvkm_sw_chan *chan, { struct nvkm_nvsw *nvsw; - if (!(nvsw = kzalloc(sizeof(*nvsw), GFP_KERNEL))) + if (!(nvsw = kzalloc_obj(*nvsw, GFP_KERNEL))) return -ENOMEM; *pobject = &nvsw->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c b/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c index 910a5bb2d191..e1fa755134d5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c @@ -181,7 +181,7 @@ nvkm_xtensa_new_(const struct nvkm_xtensa_func *func, struct nvkm_device *device { struct nvkm_xtensa *xtensa; - if (!(xtensa = kzalloc(sizeof(*xtensa), GFP_KERNEL))) + if (!(xtensa = kzalloc_obj(*xtensa, GFP_KERNEL))) return -ENOMEM; xtensa->func = func; xtensa->addr = addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c b/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c index 211ebe7afac6..449ef127e56c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c @@ -203,7 +203,7 @@ nvkm_falcon_cmdq_new(struct nvkm_falcon_qmgr *qmgr, const char *name, { struct nvkm_falcon_cmdq *cmdq = *pcmdq; - if (!(cmdq = *pcmdq = kzalloc(sizeof(*cmdq), GFP_KERNEL))) + if (!(cmdq = *pcmdq = kzalloc_obj(*cmdq, GFP_KERNEL))) return -ENOMEM; cmdq->qmgr = qmgr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c b/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c index 16b246fda666..4bff735a08df 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c @@ -203,7 +203,7 @@ nvkm_falcon_msgq_new(struct nvkm_falcon_qmgr *qmgr, const char *name, { struct nvkm_falcon_msgq *msgq = *pmsgq; - if (!(msgq = *pmsgq = kzalloc(sizeof(*msgq), GFP_KERNEL))) + if (!(msgq = *pmsgq = kzalloc_obj(*msgq, GFP_KERNEL))) return -ENOMEM; msgq->qmgr = qmgr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c b/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c index a453de341a75..4e1518b43fed 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c @@ -73,7 +73,7 @@ nvkm_falcon_qmgr_new(struct nvkm_falcon *falcon, struct nvkm_falcon_qmgr *qmgr; int i; - if (!(qmgr = *pqmgr = kzalloc(sizeof(*qmgr), GFP_KERNEL))) + if (!(qmgr = *pqmgr = kzalloc_obj(*qmgr, GFP_KERNEL))) return -ENOMEM; qmgr->falcon = falcon; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c index 13d829593180..0f83774f31a1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c @@ -251,7 +251,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev) nvkm_falcon_put(lsfw->falcon, subdev); - if (!(lsf = kmalloc(sizeof(*lsf), GFP_KERNEL))) + if (!(lsf = kmalloc_obj(*lsf, GFP_KERNEL))) return -ENOMEM; lsf->func = lsfw->func; lsf->falcon = lsfw->falcon; @@ -422,7 +422,7 @@ nvkm_acr_new_(const struct nvkm_acr_fwif *fwif, struct nvkm_device *device, struct nvkm_acr *acr; long wprfw; - if (!(acr = *pacr = kzalloc(sizeof(*acr), GFP_KERNEL))) + if (!(acr = *pacr = kzalloc_obj(*acr, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_acr, device, type, inst, &acr->subdev); INIT_LIST_HEAD(&acr->hsfw); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c index e3370c1551c0..70405ba5a87e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c @@ -37,7 +37,7 @@ ga100_acr_hsfw_ctor(struct nvkm_acr *acr, const char *bl, const char *fw, { struct nvkm_acr_hsfw *hsfw; - if (!(hsfw = kzalloc(sizeof(*hsfw), GFP_KERNEL))) + if (!(hsfw = kzalloc_obj(*hsfw, GFP_KERNEL))) return -ENOMEM; hsfw->falcon_id = fwif->falcon_id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c index c7d38609bb7e..77535b0d1d75 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c @@ -32,7 +32,7 @@ ga102_acr_wpr_patch(struct nvkm_acr *acr, s64 adjust) struct nvkm_acr_lsfw *lsfw; u32 offset = 0; - lsb = kvmalloc(sizeof(*lsb), GFP_KERNEL); + lsb = kvmalloc_obj(*lsb, GFP_KERNEL); if (!lsb) return -ENOMEM; @@ -67,7 +67,7 @@ ga102_acr_wpr_build_lsb(struct nvkm_acr *acr, struct nvkm_acr_lsfw *lsfw) if (WARN_ON(lsfw->sig->size != sizeof(hdr->signature))) return -EINVAL; - hdr = kvzalloc(sizeof(*hdr), GFP_KERNEL); + hdr = kvzalloc_obj(*hdr, GFP_KERNEL); if (!hdr) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c index 31079c947758..5b812bed400d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c @@ -247,7 +247,7 @@ gm200_acr_hsfw_ctor(struct nvkm_acr *acr, const char *bl, const char *fw, const { struct nvkm_acr_hsfw *hsfw; - if (!(hsfw = kzalloc(sizeof(*hsfw), GFP_KERNEL))) + if (!(hsfw = kzalloc_obj(*hsfw, GFP_KERNEL))) return -ENOMEM; hsfw->falcon_id = fwif->falcon_id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c index bd104a030243..ecf7500dc135 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c @@ -71,7 +71,7 @@ nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func *func, struct nvkm_acr *acr, } if (!lsfw) { - if (!(lsfw = kzalloc(sizeof(*lsfw), GFP_KERNEL))) + if (!(lsfw = kzalloc_obj(*lsfw, GFP_KERNEL))) return ERR_PTR(-ENOMEM); lsfw->id = id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c index e5e60915029c..8f45161e3f2b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c @@ -165,7 +165,7 @@ gf100_bar_new_(const struct nvkm_bar_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_bar **pbar) { struct gf100_bar *bar; - if (!(bar = kzalloc(sizeof(*bar), GFP_KERNEL))) + if (!(bar = kzalloc_obj(*bar, GFP_KERNEL))) return -ENOMEM; nvkm_bar_ctor(func, device, type, inst, &bar->base); bar->bar2_halve = nvkm_boolopt(device->cfgopt, "NvBar2Halve", false); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c index 6a881becb02c..eb66234bc478 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c @@ -223,7 +223,7 @@ nv50_bar_new_(const struct nvkm_bar_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u32 pgd_addr, struct nvkm_bar **pbar) { struct nv50_bar *bar; - if (!(bar = kzalloc(sizeof(*bar), GFP_KERNEL))) + if (!(bar = kzalloc_obj(*bar, GFP_KERNEL))) return -ENOMEM; nvkm_bar_ctor(func, device, type, inst, &bar->base); bar->pgd_addr = pgd_addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c index 91f486ee4c42..9edc439ac790 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c @@ -156,7 +156,7 @@ nvkm_bios_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct bit_entry bit_i; int ret, idx = 0; - if (!(bios = *pbios = kzalloc(sizeof(*bios), GFP_KERNEL))) + if (!(bios = *pbios = kzalloc_obj(*bios, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_bios, device, type, inst, &bios->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c index dea444d48f94..f1fec267ebad 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c @@ -73,8 +73,7 @@ nvbios_iccsense_parse(struct nvkm_bios *bios, struct nvbios_iccsense *iccsense) } iccsense->nr_entry = cnt; - iccsense->rail = kmalloc_array(cnt, sizeof(struct pwr_rail_t), - GFP_KERNEL); + iccsense->rail = kmalloc_objs(struct pwr_rail_t, cnt, GFP_KERNEL); if (!iccsense->rail) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c index cb05f7f48a98..02c2551b82cf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c @@ -58,7 +58,7 @@ of_init(struct nvkm_bios *bios, const char *name) struct priv *priv; if (!(dn = pci_device_to_OF_node(pdev))) return ERR_PTR(-ENODEV); - if (!(priv = kzalloc(sizeof(*priv), GFP_KERNEL))) + if (!(priv = kzalloc_obj(*priv, GFP_KERNEL))) return ERR_PTR(-ENOMEM); if ((priv->data = of_get_property(dn, "NVDA,BMP", &priv->size))) return priv; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c index 8d9812a51ef6..72658f45cdf0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c @@ -65,7 +65,7 @@ pcirom_init(struct nvkm_bios *bios, const char *name) if (!(ret = pci_enable_rom(pdev))) { if (ret = -ENOMEM, - (priv = kmalloc(sizeof(*priv), GFP_KERNEL))) { + (priv = kmalloc_obj(*priv, GFP_KERNEL))) { if (ret = -EFAULT, (priv->rom = pci_map_rom(pdev, &priv->size))) { priv->pdev = pdev; @@ -104,7 +104,7 @@ platform_init(struct nvkm_bios *bios, const char *name) if (!pdev->rom || pdev->romlen == 0) return ERR_PTR(-ENODEV); - if ((priv = kmalloc(sizeof(*priv), GFP_KERNEL))) { + if ((priv = kmalloc_obj(*priv, GFP_KERNEL))) { priv->size = pdev->romlen; if (ret = -ENODEV, (priv->rom = ioremap(pdev->rom, pdev->romlen))) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c index 023ddc7c5399..0cae8502301a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c @@ -102,7 +102,7 @@ pramin_init(struct nvkm_bios *bios, const char *name) } /* modify bar0 PRAMIN window to cover the bios image */ - if (!(priv = kmalloc(sizeof(*priv), GFP_KERNEL))) { + if (!(priv = kmalloc_obj(*priv, GFP_KERNEL))) { nvkm_error(subdev, "... out of memory\n"); return ERR_PTR(-ENOMEM); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c index 0e5a46db52ea..6c789ef5e341 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c @@ -56,7 +56,7 @@ nvkm_bus_new_(const struct nvkm_bus_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_bus **pbus) { struct nvkm_bus *bus; - if (!(bus = *pbus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = *pbus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_bus, device, type, inst, &bus->subdev); bus->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c index 2a5668938f2f..8cb4bc5fdedf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c @@ -45,7 +45,7 @@ nvkm_hwsq_init(struct nvkm_subdev *subdev, struct nvkm_hwsq **phwsq) { struct nvkm_hwsq *hwsq; - hwsq = *phwsq = kmalloc(sizeof(*hwsq), GFP_KERNEL); + hwsq = *phwsq = kmalloc_obj(*hwsq, GFP_KERNEL); if (hwsq) { hwsq->subdev = subdev; hwsq->addr = ~0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c index 71420f81714b..39b88d995411 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c @@ -239,7 +239,7 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate) if (volt && nvkm_volt_map_min(volt, cstepX.voltage) > volt->max_uv) return -EINVAL; - cstate = kzalloc(sizeof(*cstate), GFP_KERNEL); + cstate = kzalloc_obj(*cstate, GFP_KERNEL); if (!cstate) return -ENOMEM; @@ -416,7 +416,7 @@ nvkm_pstate_new(struct nvkm_clk *clk, int idx) if (perfE.pstate == 0xff) return 0; - pstate = kzalloc(sizeof(*pstate), GFP_KERNEL); + pstate = kzalloc_obj(*pstate, GFP_KERNEL); if (!pstate) return -ENOMEM; @@ -710,7 +710,7 @@ int nvkm_clk_new_(const struct nvkm_clk_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, bool allow_reclock, struct nvkm_clk **pclk) { - if (!(*pclk = kzalloc(sizeof(**pclk), GFP_KERNEL))) + if (!(*pclk = kzalloc_obj(**pclk, GFP_KERNEL))) return -ENOMEM; return nvkm_clk_ctor(func, device, type, inst, allow_reclock, *pclk); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c index 6eea11aefb70..ec1effd3417b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c @@ -473,7 +473,7 @@ gf100_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gf100_clk *clk; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c index 0d8e2ddcc5ee..8ef413154f7e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c @@ -509,7 +509,7 @@ gk104_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gk104_clk *clk; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 65f5d0f1f3bf..4a87023154ec 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -649,7 +649,7 @@ gk20a_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gk20a_clk *clk; int ret; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c index fa8ca53acbd1..59132544985a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c @@ -919,7 +919,7 @@ gm20b_clk_new_speedo0(struct nvkm_device *device, enum nvkm_subdev_type type, in struct gk20a_clk *clk; int ret; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c index 492b62c0ee96..13fea8f3e5c0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c @@ -165,7 +165,7 @@ gp10b_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gp10b_clk *clk; int ret, i; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = kzalloc_obj(*clk, GFP_KERNEL); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c index b5f3969727a2..ed792f2b251e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c @@ -542,7 +542,7 @@ gt215_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gt215_clk *clk; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c index 81f103f88dc8..4960cf6acb2d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c @@ -414,7 +414,7 @@ mcp77_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct mcp77_clk *clk; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c index 7ddd8cecb805..de429f26fa4f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c @@ -223,7 +223,7 @@ nv40_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct nv40_clk *clk; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; clk->base.pll_calc = nv04_clk_pll_calc; clk->base.pll_prog = nv04_clk_pll_prog; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c index e1d31c62f9ec..aec4bb2b3550 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c @@ -513,7 +513,7 @@ nv50_clk_new_(const struct nvkm_clk_func *func, struct nvkm_device *device, struct nv50_clk *clk; int ret; - if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) return -ENOMEM; ret = nvkm_clk_ctor(func, device, type, inst, allow_reclock, &clk->base); *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c index 88bc890f89a2..92b846d28869 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c @@ -439,7 +439,7 @@ nv04_devinit_new_(const struct nvkm_devinit_func *func, struct nvkm_device *devi { struct nv04_devinit *init; - if (!(init = kzalloc(sizeof(*init), GFP_KERNEL))) + if (!(init = kzalloc_obj(*init, GFP_KERNEL))) return -ENOMEM; *pinit = &init->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c index 07ed8fd778b2..1eb0908dcb5c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c @@ -150,7 +150,7 @@ nv50_devinit_new_(const struct nvkm_devinit_func *func, struct nvkm_device *devi { struct nv50_devinit *init; - if (!(init = kzalloc(sizeof(*init), GFP_KERNEL))) + if (!(init = kzalloc_obj(*init, GFP_KERNEL))) return -ENOMEM; *pinit = &init->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c index 666eb93b1742..e226a2e24da5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c @@ -36,7 +36,7 @@ r535_devinit_new(const struct nvkm_devinit_func *hw, struct nvkm_devinit_func *rm; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_devinit_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c index d8d32bb5bcd9..0ebda68c7d96 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c @@ -76,7 +76,7 @@ nvkm_fault_oneinit_buffer(struct nvkm_fault *fault, int id) struct nvkm_fault_buffer *buffer; int ret; - if (!(buffer = kzalloc(sizeof(*buffer), GFP_KERNEL))) + if (!(buffer = kzalloc_obj(*buffer, GFP_KERNEL))) return -ENOMEM; buffer->fault = fault; buffer->id = id; @@ -156,7 +156,7 @@ nvkm_fault_new_(const struct nvkm_fault_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fault **pfault) { struct nvkm_fault *fault; - if (!(fault = *pfault = kzalloc(sizeof(*fault), GFP_KERNEL))) + if (!(fault = *pfault = kzalloc_obj(*fault, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_fault, device, type, inst, &fault->subdev); fault->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c index 7ce1b65e2c1c..f15635ea99b8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c @@ -296,7 +296,7 @@ int nvkm_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb) { - if (!(*pfb = kzalloc(sizeof(**pfb), GFP_KERNEL))) + if (!(*pfb = kzalloc_obj(**pfb, GFP_KERNEL))) return -ENOMEM; return nvkm_fb_ctor(func, device, type, inst, *pfb); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c index 64281a09fb39..0c3e52e29baa 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c @@ -112,7 +112,7 @@ gf100_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, { struct gf100_fb *fb; - if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL))) + if (!(fb = kzalloc_obj(*fb, GFP_KERNEL))) return -ENOMEM; nvkm_fb_ctor(func, device, type, inst, &fb->base); *pfb = &fb->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c index 076d968b7297..c2687ade0d7e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c @@ -244,7 +244,7 @@ nv50_fb_new_(const struct nv50_fb_func *func, struct nvkm_device *device, { struct nv50_fb *fb; - if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL))) + if (!(fb = kzalloc_obj(*fb, GFP_KERNEL))) return -ENOMEM; nvkm_fb_ctor(&nv50_fb_, device, type, inst, &fb->base); fb->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c index d32515010167..167eb70143ce 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c @@ -35,7 +35,7 @@ r535_fb_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct nvkm_ram *ram; int ret; - if (!(ram = *pram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = *pram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; ram->func = &r535_fb_ram; @@ -71,7 +71,7 @@ r535_fb_new(const struct nvkm_fb_func *hw, struct nvkm_fb_func *rm; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_fb_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c index c826980bf70e..e3f161f27189 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c @@ -127,7 +127,7 @@ nvkm_ram_wrap(struct nvkm_device *device, u64 addr, u64 size, return -ENODEV; ram = device->fb->ram; - if (!(vram = kzalloc(sizeof(*vram), GFP_KERNEL))) + if (!(vram = kzalloc_obj(*vram, GFP_KERNEL))) return -ENOMEM; nvkm_memory_ctor(&nvkm_vram, &vram->memory); @@ -135,7 +135,7 @@ nvkm_ram_wrap(struct nvkm_device *device, u64 addr, u64 size, vram->page = NVKM_RAM_MM_SHIFT; *pmemory = &vram->memory; - vram->mn = kzalloc(sizeof(*vram->mn), GFP_KERNEL); + vram->mn = kzalloc_obj(*vram->mn, GFP_KERNEL); if (!vram->mn) return -ENOMEM; @@ -163,7 +163,7 @@ nvkm_ram_get(struct nvkm_device *device, u8 heap, u8 type, u8 rpage, u64 size, ram = device->fb->ram; mm = &ram->vram; - if (!(vram = kzalloc(sizeof(*vram), GFP_KERNEL))) + if (!(vram = kzalloc_obj(*vram, GFP_KERNEL))) return -ENOMEM; nvkm_memory_ctor(&nvkm_vram, &vram->memory); vram->ram = ram; @@ -257,7 +257,7 @@ int nvkm_ram_new_(const struct nvkm_ram_func *func, struct nvkm_fb *fb, enum nvkm_ram_type type, u64 size, struct nvkm_ram **pram) { - if (!(*pram = kzalloc(sizeof(**pram), GFP_KERNEL))) + if (!(*pram = kzalloc_obj(**pram, GFP_KERNEL))) return -ENOMEM; return nvkm_ram_ctor(func, fb, type, size, *pram); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c index ba43fe158b22..1367cb8adb8f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c @@ -572,7 +572,7 @@ gf100_ram_new_(const struct nvkm_ram_func *func, struct gf100_ram *ram; int ret; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c index 2b678b60b4d3..9bcbbe5469a3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c @@ -1371,7 +1371,7 @@ gk104_ram_train_init(struct nvkm_ram *ram) struct gk104_ram_train *train; int ret, i; - if (!(train = kzalloc(sizeof(*train), GFP_KERNEL))) + if (!(train = kzalloc_obj(*train, GFP_KERNEL))) return -ENOMEM; for (i = 0; i < 0x100; i++) { @@ -1446,7 +1446,7 @@ gk104_ram_ctor_data(struct gk104_ram *ram, u8 ramcfg, int i) u32 data; int ret; - if (!(cfg = kmalloc(sizeof(*cfg), GFP_KERNEL))) + if (!(cfg = kmalloc_obj(*cfg, GFP_KERNEL))) return -ENOMEM; p = &list_last_entry(&ram->cfg, typeof(*cfg), head)->bios; n = &cfg->bios; @@ -1530,7 +1530,7 @@ gk104_ram_new_(const struct nvkm_ram_func *func, struct nvkm_fb *fb, u8 ramcfg = nvbios_ramcfg_index(subdev); u32 tmp; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c index 8987a21e81d1..fb958bb6c1d1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c @@ -91,7 +91,7 @@ gp100_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) { struct nvkm_ram *ram; - if (!(ram = *pram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = *pram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; return gf100_ram_ctor(&gp100_ram, fb, ram); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c index bbfde1cb3a17..6417ee503aaf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c @@ -942,7 +942,7 @@ gt215_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct gt215_ram *ram; int ret, i; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c index 7de18e53ef45..2e1890ada5f9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c @@ -66,7 +66,7 @@ mcp77_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct mcp77_ram *ram; int ret; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c index 97b3a28ca5c0..5dc6012c67cd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c @@ -192,7 +192,7 @@ nv40_ram_new_(struct nvkm_fb *fb, enum nvkm_ram_type type, u64 size, struct nvkm_ram **pram) { struct nv40_ram *ram; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; return nvkm_ram_ctor(&nv40_ram_func, fb, type, size, &ram->base); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c index 7b1eb44ff3da..d767a6488e4c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c @@ -587,7 +587,7 @@ nv50_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct nv50_ram *ram; int ret, i; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c index e366a980baa9..ba24758d5ed1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c @@ -55,7 +55,7 @@ nvkm_fsp_new_(const struct nvkm_fsp_func *func, { struct nvkm_fsp *fsp; - fsp = *pfsp = kzalloc(sizeof(*fsp), GFP_KERNEL); + fsp = *pfsp = kzalloc_obj(*fsp, GFP_KERNEL); if (!fsp) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c index 375dfce09f84..ad5c0de62459 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c @@ -45,7 +45,7 @@ nvkm_fuse_new_(const struct nvkm_fuse_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fuse **pfuse) { struct nvkm_fuse *fuse; - if (!(fuse = *pfuse = kzalloc(sizeof(*fuse), GFP_KERNEL))) + if (!(fuse = *pfuse = kzalloc_obj(*fuse, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_fuse, device, type, inst, &fuse->subdev); fuse->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c index b2c34878a68f..d8b434a7276d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c @@ -227,7 +227,7 @@ nvkm_gpio_new_(const struct nvkm_gpio_func *func, struct nvkm_device *device, { struct nvkm_gpio *gpio; - if (!(gpio = *pgpio = kzalloc(sizeof(*gpio), GFP_KERNEL))) + if (!(gpio = *pgpio = kzalloc_obj(*gpio, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_gpio, device, type, inst, &gpio->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c index 30cb843ba35c..3952b96a5abb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c @@ -132,7 +132,7 @@ nvkm_gsp_new_(const struct nvkm_gsp_fwif *fwif, struct nvkm_device *device, { struct nvkm_gsp *gsp; - if (!(gsp = *pgsp = kzalloc(sizeof(*gsp), GFP_KERNEL))) + if (!(gsp = *pgsp = kzalloc_obj(*gsp, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_gsp, device, type, inst, &gsp->subdev); @@ -148,7 +148,7 @@ nvkm_gsp_new_(const struct nvkm_gsp_fwif *fwif, struct nvkm_device *device, if (fwif->rm) { nvkm_info(&gsp->subdev, "RM version: %s\n", fwif->ver); - gsp->rm = kzalloc(sizeof(*gsp->rm), GFP_KERNEL); + gsp->rm = kzalloc_obj(*gsp->rm, GFP_KERNEL); if (!gsp->rm) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c index 3b0e83b2f57f..01c90b592dca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c @@ -44,7 +44,7 @@ nvkm_rm_engine_obj_new(struct nvkm_gsp_object *chan, int chid, const struct nvkm struct nvkm_rm_engine_obj *obj; int ret; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return -ENOMEM; @@ -106,7 +106,7 @@ nvkm_rm_engine_ctor(void *(*dtor)(struct nvkm_engine *), struct nvkm_rm *rm, { struct nvkm_engine_func *func; - func = kzalloc(struct_size(func, sclass, nclass + 1), GFP_KERNEL); + func = kzalloc_flex(*func, sclass, nclass + 1, GFP_KERNEL); if (!func) return -ENOMEM; @@ -130,7 +130,7 @@ nvkm_rm_engine_new_(struct nvkm_rm *rm, enum nvkm_subdev_type type, int inst, u3 struct nvkm_engine *engine; int ret; - engine = kzalloc(sizeof(*engine), GFP_KERNEL); + engine = kzalloc_obj(*engine, GFP_KERNEL); if (!engine) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c index f40b8fcc2bcb..c13aaeb9fc89 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c @@ -56,7 +56,7 @@ nvkm_rm_gr_new(struct nvkm_rm *rm) struct nvkm_gr_func *func; struct r535_gr *gr; - func = kzalloc(struct_size(func, sclass, ARRAY_SIZE(classes) + 1), GFP_KERNEL); + func = kzalloc_flex(*func, sclass, ARRAY_SIZE(classes) + 1, GFP_KERNEL); if (!func) return -ENOMEM; @@ -74,7 +74,7 @@ nvkm_rm_gr_new(struct nvkm_rm *rm) func->sclass[i].ctor = nvkm_rm_gr_obj_ctor; } - gr = kzalloc(sizeof(*gr), GFP_KERNEL); + gr = kzalloc_obj(*gr, GFP_KERNEL); if (!gr) { kfree(func); return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c index d9fbfc377864..c0c6695bd547 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c @@ -17,7 +17,7 @@ nvkm_rm_nvdec_new(struct nvkm_rm *rm, int inst) struct nvkm_nvdec *nvdec; int ret; - nvdec = kzalloc(sizeof(*nvdec), GFP_KERNEL); + nvdec = kzalloc_obj(*nvdec, GFP_KERNEL); if (!nvdec) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c index 6dfa7b789e07..db1c8b508b08 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c @@ -17,7 +17,7 @@ nvkm_rm_nvenc_new(struct nvkm_rm *rm, int inst) struct nvkm_nvenc *nvenc; int ret; - nvenc = kzalloc(sizeof(*nvenc), GFP_KERNEL); + nvenc = kzalloc_obj(*nvenc, GFP_KERNEL); if (!nvenc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c index d06bf95b9a4a..37d0e21905bf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c @@ -169,7 +169,7 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device, struct nvkm_bar *bar; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_bar_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c index e962d0e8f837..c0d3d4f66d30 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c @@ -184,7 +184,7 @@ fbsr_vram(struct fbsr *fbsr, const char *type, u64 addr, u64 size) { struct fbsr_item *item; - if (!(item = kzalloc(sizeof(*item), GFP_KERNEL))) + if (!(item = kzalloc_obj(*item, GFP_KERNEL))) return false; item->type = type; @@ -309,7 +309,7 @@ r535_instmem_new(const struct nvkm_instmem_func *hw, struct nvkm_instmem_func *rm; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_instmem_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c index 4ed54b386a60..3d20574f5f70 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c @@ -591,7 +591,7 @@ r535_fifo_new(const struct nvkm_fifo_func *hw, struct nvkm_device *device, const struct nvkm_rm_gpu *gpu = device->gsp->rm->gpu; struct nvkm_fifo_func *rm; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_fifo_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c index ddb57d5e73d6..d9029a87c010 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c @@ -147,7 +147,7 @@ r535_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *chan, const struct nvkm struct r535_gr_chan *grc; int ret; - if (!(grc = kzalloc(sizeof(*grc), GFP_KERNEL))) + if (!(grc = kzalloc_obj(*grc, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&r535_gr_chan, oclass, &grc->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c index 7fb13434c051..9fd073619c38 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c @@ -2003,7 +2003,7 @@ static void r535_gsp_retain_logging(struct nvkm_gsp *gsp) goto exit; } - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) goto error; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c index f25ea610cd99..8ce33b757589 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c @@ -171,7 +171,7 @@ r535_mmu_new(const struct nvkm_mmu_func *hw, struct nvkm_mmu_func *rm; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_mmu_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c index 6c76e5e14b75..9e523e0d0a10 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c @@ -107,7 +107,7 @@ anx9805_bus_new(struct nvkm_i2c_pad *base, int id, u8 drive, struct anx9805_bus *bus; int ret; - if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; *pbus = &bus->base; bus->pad = pad; @@ -236,7 +236,7 @@ anx9805_aux_new(struct nvkm_i2c_pad *base, int id, u8 drive, struct anx9805_aux *aux; int ret; - if (!(aux = kzalloc(sizeof(*aux), GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) return -ENOMEM; *pbus = &aux->base; aux->pad = pad; @@ -267,7 +267,7 @@ anx9805_pad_new(struct nvkm_i2c_bus *bus, int id, u8 addr, { struct anx9805_pad *pad; - if (!(pad = kzalloc(sizeof(*pad), GFP_KERNEL))) + if (!(pad = kzalloc_obj(*pad, GFP_KERNEL))) return -ENOMEM; *ppad = &pad->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c index fafc634acbf6..62b8b9d2d03b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c @@ -209,7 +209,7 @@ nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *func, struct nvkm_i2c_pad *pad, int id, struct nvkm_i2c_aux **paux) { - if (!(*paux = kzalloc(sizeof(**paux), GFP_KERNEL))) + if (!(*paux = kzalloc_obj(**paux, GFP_KERNEL))) return -ENOMEM; return nvkm_i2c_aux_ctor(func, pad, id, *paux); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c index 854bb4b5fdb4..4906dad21347 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c @@ -171,7 +171,7 @@ g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *func, { struct g94_i2c_aux *aux; - if (!(aux = kzalloc(sizeof(*aux), GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) return -ENOMEM; *paux = &aux->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c index 3c5005e3b330..3f0ed4057e9c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c @@ -177,7 +177,7 @@ gm200_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive, { struct gm200_i2c_aux *aux; - if (!(aux = kzalloc(sizeof(*aux), GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) return -ENOMEM; *paux = &aux->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c index 454bb21815a2..42b9df6d6825 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c @@ -266,7 +266,7 @@ nvkm_i2c_new_(const struct nvkm_i2c_func *func, struct nvkm_device *device, u8 ver, hdr; int ret, i, ids; - if (!(i2c = *pi2c = kzalloc(sizeof(*i2c), GFP_KERNEL))) + if (!(i2c = *pi2c = kzalloc_obj(*i2c, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_i2c, device, type, inst, &i2c->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c index ed50cc3736b9..84d6c0238be2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c @@ -232,7 +232,7 @@ nvkm_i2c_bus_ctor(const struct nvkm_i2c_bus_func *func, if ( bus->func->drive_scl && !nvkm_boolopt(device->cfgopt, "NvI2C", internal)) { - if (!(bit = kzalloc(sizeof(*bit), GFP_KERNEL))) + if (!(bit = kzalloc_obj(*bit, GFP_KERNEL))) return -ENOMEM; bit->udelay = 10; bit->timeout = usecs_to_jiffies(2200); @@ -258,7 +258,7 @@ nvkm_i2c_bus_new_(const struct nvkm_i2c_bus_func *func, struct nvkm_i2c_pad *pad, int id, struct nvkm_i2c_bus **pbus) { - if (!(*pbus = kzalloc(sizeof(**pbus), GFP_KERNEL))) + if (!(*pbus = kzalloc_obj(**pbus, GFP_KERNEL))) return -ENOMEM; return nvkm_i2c_bus_ctor(func, pad, id, *pbus); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c index 96bbdda0f439..598df4da20b6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c @@ -85,7 +85,7 @@ gf119_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, { struct gf119_i2c_bus *bus; - if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c index a58db159231f..1a83c872d9d0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c @@ -85,7 +85,7 @@ nv04_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, u8 sense, { struct nv04_i2c_bus *bus; - if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c index cdd73dcb1197..3019cab91e4b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c @@ -76,7 +76,7 @@ nv4e_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, { struct nv4e_i2c_bus *bus; - if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c index 8db8399381ca..995abbf8ef61 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c @@ -102,7 +102,7 @@ nv50_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, return -ENODEV; } - if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c index 2c5fcb9c504b..7b167b691fc6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c @@ -109,7 +109,7 @@ int nvkm_i2c_pad_new_(const struct nvkm_i2c_pad_func *func, struct nvkm_i2c *i2c, int id, struct nvkm_i2c_pad **ppad) { - if (!(*ppad = kzalloc(sizeof(**ppad), GFP_KERNEL))) + if (!(*ppad = kzalloc_obj(**ppad, GFP_KERNEL))) return -ENOMEM; nvkm_i2c_pad_ctor(func, i2c, id, *ppad); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c index 8f0ccd3664eb..365747909077 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c @@ -188,7 +188,7 @@ nvkm_iccsense_create_sensor(struct nvkm_iccsense *iccsense, u8 id) return NULL; } - sensor = kmalloc(sizeof(*sensor), GFP_KERNEL); + sensor = kmalloc_obj(*sensor, GFP_KERNEL); if (!sensor) return NULL; @@ -279,7 +279,7 @@ nvkm_iccsense_oneinit(struct nvkm_subdev *subdev) continue; } - rail = kmalloc(sizeof(*rail), GFP_KERNEL); + rail = kmalloc_obj(*rail, GFP_KERNEL); if (!rail) return -ENOMEM; @@ -322,7 +322,7 @@ int nvkm_iccsense_new_(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_iccsense **iccsense) { - if (!(*iccsense = kzalloc(sizeof(**iccsense), GFP_KERNEL))) + if (!(*iccsense = kzalloc_obj(**iccsense, GFP_KERNEL))) return -ENOMEM; INIT_LIST_HEAD(&(*iccsense)->sensors); INIT_LIST_HEAD(&(*iccsense)->rails); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c index 201022ae9214..dab22c47d85e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c @@ -387,7 +387,7 @@ gk20a_instobj_ctor_dma(struct gk20a_instmem *imem, u32 npages, u32 align, struct nvkm_subdev *subdev = &imem->base.subdev; struct device *dev = subdev->device->dev; - if (!(node = kzalloc(sizeof(*node), GFP_KERNEL))) + if (!(node = kzalloc_obj(*node, GFP_KERNEL))) return -ENOMEM; *_node = &node->base; @@ -577,7 +577,7 @@ gk20a_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int in struct nvkm_device_tegra *tdev = device->func->tegra(device); struct gk20a_instmem *imem; - if (!(imem = kzalloc(sizeof(*imem), GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) return -ENOMEM; nvkm_instmem_ctor(&gk20a_instmem, device, type, inst, &imem->base); mutex_init(&imem->lock); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c index e5320ef849bf..247a7bf5fe39 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c @@ -125,7 +125,7 @@ nv04_instobj_new(struct nvkm_instmem *base, u32 size, u32 align, bool zero, struct nv04_instobj *iobj; int ret; - if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -267,7 +267,7 @@ nv04_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int ins { struct nv04_instmem *imem; - if (!(imem = kzalloc(sizeof(*imem), GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) return -ENOMEM; nvkm_instmem_ctor(&nv04_instmem, device, type, inst, &imem->base); *pimem = &imem->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c index 2544b9f0ec85..5a0f30d94198 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c @@ -124,7 +124,7 @@ nv40_instobj_new(struct nvkm_instmem *base, u32 size, u32 align, bool zero, struct nv40_instobj *iobj; int ret; - if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -240,7 +240,7 @@ nv40_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int ins { struct nv40_instmem *imem; - if (!(imem = kzalloc(sizeof(*imem), GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) return -ENOMEM; nvkm_instmem_ctor(&nv40_instmem, device, type, inst, &imem->base); *pimem = &imem->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c index 4ca6fb30743d..d6c781ae57e9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c @@ -360,7 +360,7 @@ nv50_instobj_wrap(struct nvkm_instmem *base, struct nv50_instmem *imem = nv50_instmem(base); struct nv50_instobj *iobj; - if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -431,7 +431,7 @@ nv50_instmem_new_(const struct nvkm_instmem_func *func, { struct nv50_instmem *imem; - if (!(imem = kzalloc(sizeof(*imem), GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) return -ENOMEM; nvkm_instmem_ctor(func, device, type, inst, &imem->base); INIT_LIST_HEAD(&imem->lru); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c index f742a7b7b175..7c1652bc28cd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c @@ -133,7 +133,7 @@ nvkm_ltc_new_(const struct nvkm_ltc_func *func, struct nvkm_device *device, { struct nvkm_ltc *ltc; - if (!(ltc = *pltc = kzalloc(sizeof(*ltc), GFP_KERNEL))) + if (!(ltc = *pltc = kzalloc_obj(*ltc, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_ltc, device, type, inst, <c->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c index c85600ba69f9..2d7e6d6f8760 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c @@ -130,7 +130,7 @@ nvkm_mc_new_(const struct nvkm_mc_func *func, struct nvkm_device *device, struct nvkm_mc *mc; int ret; - if (!(mc = *pmc = kzalloc(sizeof(*mc), GFP_KERNEL))) + if (!(mc = *pmc = kzalloc_obj(*mc, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_mc, device, type, inst, &mc->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c index b67ace7ae93c..2d9c4d6f9162 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c @@ -68,13 +68,13 @@ nvkm_mmu_ptp_get(struct nvkm_mmu *mmu, u32 size, bool zero) struct nvkm_mmu_ptp *ptp; int slot; - if (!(pt = kzalloc(sizeof(*pt), GFP_KERNEL))) + if (!(pt = kzalloc_obj(*pt, GFP_KERNEL))) return NULL; ptp = list_first_entry_or_null(&mmu->ptp.list, typeof(*ptp), head); if (!ptp) { /* Need to allocate a new parent to sub-allocate from. */ - if (!(ptp = kmalloc(sizeof(*ptp), GFP_KERNEL))) { + if (!(ptp = kmalloc_obj(*ptp, GFP_KERNEL))) { kfree(pt); return NULL; } @@ -126,7 +126,7 @@ nvkm_mmu_ptc_find(struct nvkm_mmu *mmu, u32 size) return ptc; } - ptc = kmalloc(sizeof(*ptc), GFP_KERNEL); + ptc = kmalloc_obj(*ptc, GFP_KERNEL); if (ptc) { INIT_LIST_HEAD(&ptc->item); ptc->size = size; @@ -199,7 +199,7 @@ nvkm_mmu_ptc_get(struct nvkm_mmu *mmu, u32 size, u32 align, bool zero) mutex_unlock(&mmu->ptc.mutex); /* No such luck, we need to allocate. */ - if (!(pt = kmalloc(sizeof(*pt), GFP_KERNEL))) + if (!(pt = kmalloc_obj(*pt, GFP_KERNEL))) return NULL; pt->ptc = ptc; pt->sub = false; @@ -434,7 +434,7 @@ int nvkm_mmu_new_(const struct nvkm_mmu_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mmu **pmmu) { - if (!(*pmmu = kzalloc(sizeof(**pmmu), GFP_KERNEL))) + if (!(*pmmu = kzalloc_obj(**pmmu, GFP_KERNEL))) return -ENOMEM; nvkm_mmu_ctor(func, device, type, inst, *pmmu); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c index 92e363dbbc5a..96b620ed07ca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c @@ -163,7 +163,7 @@ nvkm_mem_new_host(struct nvkm_mmu *mmu, int type, u8 page, u64 size, if (page != PAGE_SHIFT) return -EINVAL; - if (!(mem = kzalloc(sizeof(*mem), GFP_KERNEL))) + if (!(mem = kzalloc_obj(*mem, GFP_KERNEL))) return -ENOMEM; mem->target = target; mem->mmu = mmu; @@ -191,9 +191,9 @@ nvkm_mem_new_host(struct nvkm_mmu *mmu, int type, u8 page, u64 size, nvkm_memory_ctor(&nvkm_mem_dma, &mem->memory); size = ALIGN(size, PAGE_SIZE) >> PAGE_SHIFT; - if (!(mem->mem = kvmalloc_array(size, sizeof(*mem->mem), GFP_KERNEL))) + if (!(mem->mem = kvmalloc_objs(*mem->mem, size, GFP_KERNEL))) return -ENOMEM; - if (!(mem->dma = kvmalloc_array(size, sizeof(*mem->dma), GFP_KERNEL))) + if (!(mem->dma = kvmalloc_objs(*mem->dma, size, GFP_KERNEL))) return -ENOMEM; if (mmu->dma_bits > 32) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c index e530bb8b3b17..79ab3a99d98c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c @@ -161,7 +161,7 @@ nvkm_umem_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, if (type >= mmu->type_nr) return -EINVAL; - if (!(umem = kzalloc(sizeof(*umem), GFP_KERNEL))) + if (!(umem = kzalloc_obj(*umem, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nvkm_umem, oclass, &umem->object); umem->mmu = mmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c index 6870fda4b188..8de3a707b5c2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c @@ -172,7 +172,7 @@ nvkm_ummu_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, } else return ret; - if (!(ummu = kzalloc(sizeof(*ummu), GFP_KERNEL))) + if (!(ummu = kzalloc_obj(*ummu, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nvkm_ummu, oclass, &ummu->object); ummu->mmu = mmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c index cf490ff2b9f1..1778daa0af3a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c @@ -551,7 +551,7 @@ nvkm_uvmm_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, } else return ret; - if (!(uvmm = kzalloc(sizeof(*uvmm), GFP_KERNEL))) + if (!(uvmm = kzalloc_obj(*uvmm, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nvkm_uvmm, oclass, &uvmm->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c index 19a7407cf702..3a53ce15ea29 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c @@ -59,7 +59,7 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc, bool sparse, pgt->sparse = sparse; if (desc->type == PGD) { - pgt->pde = kvcalloc(pten, sizeof(*pgt->pde), GFP_KERNEL); + pgt->pde = kvzalloc_objs(*pgt->pde, pten, GFP_KERNEL); if (!pgt->pde) { kfree(pgt); return NULL; @@ -823,7 +823,7 @@ nvkm_vmm_ptes_get_map(struct nvkm_vmm *vmm, const struct nvkm_vmm_page *page, struct nvkm_vma * nvkm_vma_new(u64 addr, u64 size) { - struct nvkm_vma *vma = kzalloc(sizeof(*vma), GFP_KERNEL); + struct nvkm_vma *vma = kzalloc_obj(*vma, GFP_KERNEL); if (vma) { vma->addr = addr; vma->size = size; @@ -1226,7 +1226,7 @@ nvkm_vmm_new_(const struct nvkm_vmm_func *func, struct nvkm_mmu *mmu, struct lock_class_key *key, const char *name, struct nvkm_vmm **pvmm) { - if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL))) + if (!(*pvmm = kzalloc_obj(**pvmm, GFP_KERNEL))) return -ENOMEM; return nvkm_vmm_ctor(func, mmu, hdr, managed, addr, size, key, name, *pvmm); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c index ff08ad5005a9..86f038ebb360 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c @@ -346,7 +346,7 @@ nv50_vmm_join(struct nvkm_vmm *vmm, struct nvkm_memory *inst) u64 data; u32 pdei; - if (!(join = kmalloc(sizeof(*join), GFP_KERNEL))) + if (!(join = kmalloc_obj(*join, GFP_KERNEL))) return -ENOMEM; join->inst = inst; list_add_tail(&join->head, &vmm->join); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c index c1acfe642da3..6d6c4b831a58 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c @@ -238,7 +238,7 @@ nvkm_mxm_new_(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u8 ver, len; u16 data; - if (!(mxm = *pmxm = kzalloc(sizeof(*mxm), GFP_KERNEL))) + if (!(mxm = *pmxm = kzalloc_obj(*mxm, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_mxm, device, type, inst, &mxm->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c index 0f3e0d324a52..f357d777bc96 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c @@ -162,7 +162,7 @@ nvkm_pci_new_(const struct nvkm_pci_func *func, struct nvkm_device *device, { struct nvkm_pci *pci; - if (!(pci = *ppci = kzalloc(sizeof(**ppci), GFP_KERNEL))) + if (!(pci = *ppci = kzalloc_obj(**ppci, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_pci_func, device, type, inst, &pci->subdev); pci->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c index 9e9004ec4588..0d7cfd73ff17 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c @@ -161,7 +161,7 @@ nvkm_pmu_new_(const struct nvkm_pmu_fwif *fwif, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pmu **ppmu) { struct nvkm_pmu *pmu; - if (!(pmu = *ppmu = kzalloc(sizeof(*pmu), GFP_KERNEL))) + if (!(pmu = *ppmu = kzalloc_obj(*pmu, GFP_KERNEL))) return -ENOMEM; return nvkm_pmu_ctor(fwif, device, type, inst, *ppmu); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c index b5e52b35f5d0..46abf56cc830 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c @@ -215,7 +215,7 @@ gk20a_pmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gk20a_pmu *pmu; int ret; - if (!(pmu = kzalloc(sizeof(*pmu), GFP_KERNEL))) + if (!(pmu = kzalloc_obj(*pmu, GFP_KERNEL))) return -ENOMEM; *ppmu = &pmu->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c index 22eaebefced3..0fed890a8f95 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c @@ -53,7 +53,7 @@ nvkm_memx_init(struct nvkm_pmu *pmu, struct nvkm_memx **pmemx) if (ret) return ret; - memx = *pmemx = kzalloc(sizeof(*memx), GFP_KERNEL); + memx = *pmemx = kzalloc_obj(*memx, GFP_KERNEL); if (!memx) return -ENOMEM; memx->pmu = pmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c index 1510aba33956..2613f5872bcd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c @@ -447,7 +447,7 @@ nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, { struct nvkm_therm *therm; - if (!(therm = *ptherm = kzalloc(sizeof(*therm), GFP_KERNEL))) + if (!(therm = *ptherm = kzalloc_obj(*therm, GFP_KERNEL))) return -ENOMEM; nvkm_therm_ctor(therm, device, type, inst, func); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c index 8ae300f911b6..92737c2770b6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c @@ -40,7 +40,7 @@ nvkm_fannil_create(struct nvkm_therm *therm) { struct nvkm_fan *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); therm->fan = priv; if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c index b13ba9b2f6be..aa13cd45785a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c @@ -97,7 +97,7 @@ nvkm_fanpwm_create(struct nvkm_therm *therm, struct dcb_gpio_func *func) therm->func->pwm_get(therm, func->line, &divs, &duty) == -ENODEV) return -ENODEV; - fan = kzalloc(sizeof(*fan), GFP_KERNEL); + fan = kzalloc_obj(*fan, GFP_KERNEL); if (!fan) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c index bfdf4ca5625c..6cfe7fee54f0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c @@ -99,7 +99,7 @@ nvkm_fantog_create(struct nvkm_therm *therm, struct dcb_gpio_func *func) return ret; } - fan = kzalloc(sizeof(*fan), GFP_KERNEL); + fan = kzalloc_obj(*fan, GFP_KERNEL); if (!fan) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c index 45e295c271fb..f58f4add5ef3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c @@ -112,7 +112,7 @@ gk104_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, const struct gf100_idle_filter *idle_filter, struct nvkm_therm **ptherm) { - struct gk104_therm *therm = kzalloc(sizeof(*therm), GFP_KERNEL); + struct gk104_therm *therm = kzalloc_obj(*therm, GFP_KERNEL); if (!therm) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c index ddb2b2c600ca..b828dec2e3e7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c @@ -119,7 +119,7 @@ nvkm_therm_sensor_event(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs, if (active) { struct work_struct *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) { INIT_WORK(work, nv_poweroff_work); schedule_work(work); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c index a5c3c282b5d0..dcb4763e1c08 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c @@ -187,7 +187,7 @@ nvkm_timer_new_(const struct nvkm_timer_func *func, struct nvkm_device *device, { struct nvkm_timer *tmr; - if (!(tmr = *ptmr = kzalloc(sizeof(*tmr), GFP_KERNEL))) + if (!(tmr = *ptmr = kzalloc_obj(*tmr, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_timer, device, type, inst, &tmr->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c index eb348dfc1d7a..fb55ff2b2a46 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c @@ -26,7 +26,7 @@ struct nvkm_top_device * nvkm_top_device_new(struct nvkm_top *top) { - struct nvkm_top_device *info = kmalloc(sizeof(*info), GFP_KERNEL); + struct nvkm_top_device *info = kmalloc_obj(*info, GFP_KERNEL); if (info) { info->type = NVKM_SUBDEV_NR; info->inst = -1; @@ -152,7 +152,7 @@ nvkm_top_new_(const struct nvkm_top_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_top **ptop) { struct nvkm_top *top; - if (!(top = *ptop = kzalloc(sizeof(*top), GFP_KERNEL))) + if (!(top = *ptop = kzalloc_obj(*top, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_top, device, type, inst, &top->subdev); top->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c index 62e81d551f44..3d584be9e201 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c @@ -39,7 +39,7 @@ nvkm_vfn_new_(const struct nvkm_vfn_func *func, struct nvkm_device *device, struct nvkm_vfn *vfn; int ret; - if (!(vfn = *pvfn = kzalloc(sizeof(*vfn), GFP_KERNEL))) + if (!(vfn = *pvfn = kzalloc_obj(*vfn, GFP_KERNEL))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_vfn, device, type, inst, &vfn->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c index d294844d9eae..e01ea0dcd529 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c @@ -38,7 +38,7 @@ r535_vfn_new(const struct nvkm_vfn_func *hw, struct nvkm_vfn_func *rm; int ret; - if (!(rm = kzalloc(sizeof(*rm), GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) return -ENOMEM; rm->dtor = r535_vfn_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c index 4e64d8843373..27fd15559796 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c @@ -56,7 +56,7 @@ nvkm_uvfn_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, if (argc != 0) return -ENOSYS; - if (!(uvfn = kzalloc(sizeof(*uvfn), GFP_KERNEL))) + if (!(uvfn = kzalloc_obj(*uvfn, GFP_KERNEL))) return -ENOMEM; nvkm_object_ctor(&nvkm_uvfn, oclass, &uvfn->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c index 803b98df4858..8bb3761e547b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c @@ -321,7 +321,7 @@ int nvkm_volt_new_(const struct nvkm_volt_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_volt **pvolt) { - if (!(*pvolt = kzalloc(sizeof(**pvolt), GFP_KERNEL))) + if (!(*pvolt = kzalloc_obj(**pvolt, GFP_KERNEL))) return -ENOMEM; nvkm_volt_ctor(func, device, type, inst, *pvolt); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c index d1ce4309cfb8..5146666ea0f5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c @@ -113,7 +113,7 @@ gk104_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, volt_func = &gk104_volt_pwm; } - if (!(volt = kzalloc(sizeof(*volt), GFP_KERNEL))) + if (!(volt = kzalloc_obj(*volt, GFP_KERNEL))) return -ENOMEM; nvkm_volt_ctor(volt_func, device, type, inst, &volt->base); *pvolt = &volt->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c index ccac88da8864..5941a1eeabd9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c @@ -176,7 +176,7 @@ gk20a_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gk20a_volt *volt; - volt = kzalloc(sizeof(*volt), GFP_KERNEL); + volt = kzalloc_obj(*volt, GFP_KERNEL); if (!volt) return -ENOMEM; *pvolt = &volt->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c index c2e9694d333f..7348acb147bf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c @@ -77,7 +77,7 @@ gm20b_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, return -EINVAL; } - volt = kzalloc(sizeof(*volt), GFP_KERNEL); + volt = kzalloc_obj(*volt, GFP_KERNEL); if (!volt) return -ENOMEM; *pvolt = &volt->base; diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index cf055815077c..c3cca5234f67 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -4603,7 +4603,7 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) int r = 0; struct device_node *np = pdev->dev.of_node; - dispc = kzalloc(sizeof(*dispc), GFP_KERNEL); + dispc = kzalloc_obj(*dispc, GFP_KERNEL); if (!dispc) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index b129e5a8d791..1269978ba292 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -1041,7 +1041,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p) unsigned long flags; struct dsi_irq_stats *stats; - stats = kmalloc(sizeof(*stats), GFP_KERNEL); + stats = kmalloc_obj(*stats, GFP_KERNEL); if (!stats) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 692df747e2ae..791d88933084 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -928,7 +928,7 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name, { struct dss_debugfs_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -1419,7 +1419,7 @@ static int dss_probe(struct platform_device *pdev) struct dss_device *dss; int r; - dss = kzalloc(sizeof(*dss), GFP_KERNEL); + dss = kzalloc_obj(*dss, GFP_KERNEL); if (!dss) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 1c2a1920c0a6..ba730242ad74 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -716,7 +716,7 @@ static void omap_crtc_reset(struct drm_crtc *crtc) kfree(crtc->state); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -731,7 +731,7 @@ omap_crtc_duplicate_state(struct drm_crtc *crtc) current_state = to_omap_crtc_state(crtc->state); - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -793,7 +793,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev, DBG("%s", channel_names[channel]); - omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL); + omap_crtc = kzalloc_obj(*omap_crtc, GFP_KERNEL); if (!omap_crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index bbe427ab43c1..8312c4d14348 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -536,7 +536,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, unsigned long flags; u32 slot_bytes; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return ERR_PTR(-ENOMEM); @@ -571,7 +571,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, struct tiler_block *tiler_reserve_1d(size_t size) { - struct tiler_block *block = kzalloc(sizeof(*block), GFP_KERNEL); + struct tiler_block *block = kzalloc_obj(*block, GFP_KERNEL); int num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned long flags; @@ -774,7 +774,7 @@ static int omap_dmm_probe(struct platform_device *dev) u32 hwinfo, pat_geom; struct resource *mem; - omap_dmm = kzalloc(sizeof(*omap_dmm), GFP_KERNEL); + omap_dmm = kzalloc_obj(*omap_dmm, GFP_KERNEL); if (!omap_dmm) goto fail; @@ -885,8 +885,8 @@ static int omap_dmm_probe(struct platform_device *dev) } /* alloc engines */ - omap_dmm->engines = kcalloc(omap_dmm->num_engines, - sizeof(*omap_dmm->engines), GFP_KERNEL); + omap_dmm->engines = kzalloc_objs(*omap_dmm->engines, + omap_dmm->num_engines, GFP_KERNEL); if (!omap_dmm->engines) { ret = -ENOMEM; goto fail; @@ -904,8 +904,8 @@ static int omap_dmm_probe(struct platform_device *dev) list_add(&omap_dmm->engines[i].idle_node, &omap_dmm->idle_head); } - omap_dmm->tcm = kcalloc(omap_dmm->num_lut, sizeof(*omap_dmm->tcm), - GFP_KERNEL); + omap_dmm->tcm = kzalloc_objs(*omap_dmm->tcm, omap_dmm->num_lut, + GFP_KERNEL); if (!omap_dmm->tcm) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 1b96343226a5..206018aab88e 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -146,7 +146,7 @@ static int omap_atomic_update_normalize_zpos(struct drm_device *dev, struct drm_plane_state **states; int ret = 0; - states = kmalloc_array(total_planes, sizeof(*states), GFP_KERNEL); + states = kmalloc_objs(*states, total_planes, GFP_KERNEL); if (!states) return -ENOMEM; @@ -285,7 +285,7 @@ static int omap_global_obj_init(struct drm_device *dev) struct omap_drm_private *priv = dev->dev_private; struct omap_global_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; @@ -798,7 +798,7 @@ static int pdev_probe(struct platform_device *pdev) } /* Allocate and initialize the driver private structure. */ - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 195715b162e3..2577ba92b1b9 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -122,7 +122,7 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct drm_encoder *encoder = NULL; struct omap_encoder *omap_encoder; - omap_encoder = kzalloc(sizeof(*omap_encoder), GFP_KERNEL); + omap_encoder = kzalloc_obj(*omap_encoder, GFP_KERNEL); if (!omap_encoder) goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index b8c249ec1891..c3b1bea75f7f 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -390,7 +390,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, goto fail; } - omap_fb = kzalloc(sizeof(*omap_fb), GFP_KERNEL); + omap_fb = kzalloc_obj(*omap_fb, GFP_KERNEL); if (!omap_fb) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 71e79f53489a..63c4bfc9a5c0 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -254,7 +254,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) * DSS, GPU, etc. are not cache coherent: */ if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { - addrs = kmalloc_array(npages, sizeof(*addrs), GFP_KERNEL); + addrs = kmalloc_objs(*addrs, npages, GFP_KERNEL); if (!addrs) { ret = -ENOMEM; goto free_pages; @@ -278,7 +278,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) } } } else { - addrs = kcalloc(npages, sizeof(*addrs), GFP_KERNEL); + addrs = kzalloc_objs(*addrs, npages, GFP_KERNEL); if (!addrs) { ret = -ENOMEM; goto free_pages; @@ -989,7 +989,7 @@ struct sg_table *omap_gem_get_sg(struct drm_gem_object *obj, if (sgt) goto out; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto err_unpin; @@ -1319,7 +1319,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, } /* Allocate the initialize the OMAP GEM object. */ - omap_obj = kzalloc(sizeof(*omap_obj), GFP_KERNEL); + omap_obj = kzalloc_obj(*omap_obj, GFP_KERNEL); if (!omap_obj) return NULL; @@ -1410,7 +1410,7 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size, unsigned int ret; npages = DIV_ROUND_UP(size, PAGE_SIZE); - pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) { omap_gem_free_object(obj); return ERR_PTR(-ENOMEM); @@ -1470,7 +1470,7 @@ void omap_gem_init(struct drm_device *dev) return; } - usergart = kcalloc(3, sizeof(*usergart), GFP_KERNEL); + usergart = kzalloc_objs(*usergart, 3, GFP_KERNEL); if (!usergart) return; diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c index 943c5307da00..b1da72838824 100644 --- a/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/drivers/gpu/drm/omapdrm/omap_irq.c @@ -43,7 +43,7 @@ struct omap_irq_wait * omap_irq_wait_init(struct drm_device *dev, u32 irqmask, int count) { struct omap_drm_private *priv = dev->dev_private; - struct omap_irq_wait *wait = kzalloc(sizeof(*wait), GFP_KERNEL); + struct omap_irq_wait *wait = kzalloc_obj(*wait, GFP_KERNEL); unsigned long flags; init_waitqueue_head(&wait->wq); diff --git a/drivers/gpu/drm/omapdrm/omap_overlay.c b/drivers/gpu/drm/omapdrm/omap_overlay.c index 6fb7510cbebb..3b673662bf99 100644 --- a/drivers/gpu/drm/omapdrm/omap_overlay.c +++ b/drivers/gpu/drm/omapdrm/omap_overlay.c @@ -159,7 +159,7 @@ static struct omap_hw_overlay *omap_overlay_init(enum omap_plane_id overlay_id, { struct omap_hw_overlay *overlay; - overlay = kzalloc(sizeof(*overlay), GFP_KERNEL); + overlay = kzalloc_obj(*overlay, GFP_KERNEL); if (!overlay) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index f9698890c989..ff2c692c3ede 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -410,7 +410,7 @@ static void omap_plane_reset(struct drm_plane *plane) if (plane->state) drm_atomic_helper_plane_destroy_state(plane, plane->state); - omap_state = kzalloc(sizeof(*omap_state), GFP_KERNEL); + omap_state = kzalloc_obj(*omap_state, GFP_KERNEL); if (!omap_state) return; @@ -427,7 +427,7 @@ omap_plane_atomic_duplicate_state(struct drm_plane *plane) current_state = to_omap_plane_state(plane->state); - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -533,7 +533,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, if (WARN_ON(idx >= num_planes)) return ERR_PTR(-EINVAL); - omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL); + omap_plane = kzalloc_obj(*omap_plane, GFP_KERNEL); if (!omap_plane) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 2f58a9b0773a..191d909f5845 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -207,9 +207,8 @@ panfrost_lookup_bos(struct drm_device *dev, if (ret) return ret; - job->mappings = kvmalloc_array(job->bo_count, - sizeof(struct panfrost_gem_mapping *), - GFP_KERNEL | __GFP_ZERO); + job->mappings = kvmalloc_objs(struct panfrost_gem_mapping *, + job->bo_count, GFP_KERNEL | __GFP_ZERO); if (!job->mappings) return -ENOMEM; @@ -317,7 +316,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, goto out_put_syncout; } - job = kzalloc(sizeof(*job), GFP_KERNEL); + job = kzalloc_obj(*job, GFP_KERNEL); if (!job) { ret = -ENOMEM; goto out_put_jm_ctx; @@ -598,7 +597,7 @@ static int panfrost_ioctl_sync_bo(struct drm_device *ddev, void *data, if (!args->op_count) return 0; - ops = kvmalloc_array(args->op_count, sizeof(*ops), GFP_KERNEL); + ops = kvmalloc_objs(*ops, args->op_count, GFP_KERNEL); if (!ops) { DRM_DEBUG("Failed to allocate incoming BO sync ops array\n"); return -ENOMEM; @@ -683,7 +682,7 @@ panfrost_open(struct drm_device *dev, struct drm_file *file) struct panfrost_device *pfdev = to_panfrost_device(dev); struct panfrost_file_priv *panfrost_priv; - panfrost_priv = kzalloc(sizeof(*panfrost_priv), GFP_KERNEL); + panfrost_priv = kzalloc_obj(*panfrost_priv, GFP_KERNEL); if (!panfrost_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 47ac8386aabc..a70847a73f98 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -175,7 +175,7 @@ int panfrost_gem_open(struct drm_gem_object *obj, struct drm_file *file_priv) struct panfrost_file_priv *priv = file_priv->driver_priv; struct panfrost_gem_mapping *mapping; - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) return -ENOMEM; @@ -429,7 +429,7 @@ struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t struct panfrost_device *pfdev = to_panfrost_device(dev); struct panfrost_gem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 11894a6b9fcc..862acf9c8422 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -95,7 +95,7 @@ static struct dma_fence *panfrost_fence_create(struct panfrost_device *pfdev, in struct panfrost_fence *fence; struct panfrost_job_slot *js = pfdev->js; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return ERR_PTR(-ENOMEM); @@ -1053,7 +1053,7 @@ int panfrost_jm_ctx_create(struct drm_file *file, struct panfrost_jm_ctx *jm_ctx; int ret; - jm_ctx = kzalloc(sizeof(*jm_ctx), GFP_KERNEL); + jm_ctx = kzalloc_obj(*jm_ctx, GFP_KERNEL); if (!jm_ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 50ff30849361..71eef57af549 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -620,14 +620,16 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, dma_resv_lock(obj->resv, NULL); if (!bo->base.pages) { - bo->sgts = kvmalloc_array(bo->base.base.size / SZ_2M, - sizeof(struct sg_table), GFP_KERNEL | __GFP_ZERO); + bo->sgts = kvmalloc_objs(struct sg_table, + bo->base.base.size / SZ_2M, + GFP_KERNEL | __GFP_ZERO); if (!bo->sgts) { ret = -ENOMEM; goto err_unlock; } - pages = kvmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL | __GFP_ZERO); + pages = kvmalloc_objs(struct page *, nr_pages, + GFP_KERNEL | __GFP_ZERO); if (!pages) { kvfree(bo->sgts); bo->sgts = NULL; @@ -792,7 +794,7 @@ struct panfrost_mmu *panfrost_mmu_ctx_create(struct panfrost_device *pfdev) fmt = ARM_MALI_LPAE; } - mmu = kzalloc(sizeof(*mmu), GFP_KERNEL); + mmu = kzalloc_obj(*mmu, GFP_KERNEL); if (!mmu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c index 165dddfde6ca..e1e51daba356 100644 --- a/drivers/gpu/drm/panthor/panthor_drv.c +++ b/drivers/gpu/drm/panthor/panthor_drv.c @@ -382,7 +382,7 @@ panthor_submit_ctx_add_sync_signal(struct panthor_submit_ctx *ctx, u32 handle, u struct dma_fence *cur_fence; int ret; - sig_sync = kzalloc(sizeof(*sig_sync), GFP_KERNEL); + sig_sync = kzalloc_obj(*sig_sync, GFP_KERNEL); if (!sig_sync) return -ENOMEM; @@ -723,8 +723,8 @@ panthor_submit_ctx_push_jobs(struct panthor_submit_ctx *ctx, static int panthor_submit_ctx_init(struct panthor_submit_ctx *ctx, struct drm_file *file, u32 job_count) { - ctx->jobs = kvmalloc_array(job_count, sizeof(*ctx->jobs), - GFP_KERNEL | __GFP_ZERO); + ctx->jobs = kvmalloc_objs(*ctx->jobs, job_count, + GFP_KERNEL | __GFP_ZERO); if (!ctx->jobs) return -ENOMEM; @@ -1471,7 +1471,7 @@ panthor_open(struct drm_device *ddev, struct drm_file *file) struct panthor_file *pfile; int ret; - pfile = kzalloc(sizeof(*pfile), GFP_KERNEL); + pfile = kzalloc_obj(*pfile, GFP_KERNEL); if (!pfile) return -ENOMEM; diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c index 2c215efb5320..3d94f9cc94d6 100644 --- a/drivers/gpu/drm/panthor/panthor_gem.c +++ b/drivers/gpu/drm/panthor/panthor_gem.c @@ -183,7 +183,7 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm, if (drm_WARN_ON(&ptdev->base, !vm)) return ERR_PTR(-EINVAL); - kbo = kzalloc(sizeof(*kbo), GFP_KERNEL); + kbo = kzalloc_obj(*kbo, GFP_KERNEL); if (!kbo) return ERR_PTR(-ENOMEM); @@ -399,7 +399,7 @@ struct drm_gem_object *panthor_gem_create_object(struct drm_device *ddev, size_t { struct panthor_gem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_heap.c b/drivers/gpu/drm/panthor/panthor_heap.c index 0b6ff4c0a11b..ded9cb83842c 100644 --- a/drivers/gpu/drm/panthor/panthor_heap.c +++ b/drivers/gpu/drm/panthor/panthor_heap.c @@ -145,7 +145,7 @@ static int panthor_alloc_heap_chunk(struct panthor_heap_pool *pool, struct panthor_heap_chunk_header *hdr; int ret; - chunk = kmalloc(sizeof(*chunk), GFP_KERNEL); + chunk = kmalloc_obj(*chunk, GFP_KERNEL); if (!chunk) return -ENOMEM; @@ -303,7 +303,7 @@ int panthor_heap_create(struct panthor_heap_pool *pool, if (!vm) return -EINVAL; - heap = kzalloc(sizeof(*heap), GFP_KERNEL); + heap = kzalloc_obj(*heap, GFP_KERNEL); if (!heap) { ret = -ENOMEM; goto err_put_vm; @@ -541,7 +541,7 @@ panthor_heap_pool_create(struct panthor_device *ptdev, struct panthor_vm *vm) struct panthor_heap_pool *pool; int ret = 0; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index 198d59f42578..c482bbe6fffd 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -1159,7 +1159,7 @@ panthor_vm_op_ctx_prealloc_vmas(struct panthor_vm_op_ctx *op_ctx) } for (u32 i = 0; i < vma_count; i++) { - struct panthor_vma *vma = kzalloc(sizeof(*vma), GFP_KERNEL); + struct panthor_vma *vma = kzalloc_obj(*vma, GFP_KERNEL); if (!vma) return -ENOMEM; @@ -1257,9 +1257,8 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, ((ALIGN(va + size, 1ull << 30) - ALIGN_DOWN(va, 1ull << 30)) >> 30) + ((ALIGN(va + size, 1ull << 21) - ALIGN_DOWN(va, 1ull << 21)) >> 21); - op_ctx->rsvd_page_tables.pages = kcalloc(pt_count, - sizeof(*op_ctx->rsvd_page_tables.pages), - GFP_KERNEL); + op_ctx->rsvd_page_tables.pages = kzalloc_objs(*op_ctx->rsvd_page_tables.pages, + pt_count, GFP_KERNEL); if (!op_ctx->rsvd_page_tables.pages) { ret = -ENOMEM; goto err_cleanup; @@ -1312,9 +1311,9 @@ static int panthor_vm_prepare_unmap_op_ctx(struct panthor_vm_op_ctx *op_ctx, goto err_cleanup; if (pt_count) { - op_ctx->rsvd_page_tables.pages = kcalloc(pt_count, - sizeof(*op_ctx->rsvd_page_tables.pages), - GFP_KERNEL); + op_ctx->rsvd_page_tables.pages = kzalloc_objs(*op_ctx->rsvd_page_tables.pages, + pt_count, + GFP_KERNEL); if (!op_ctx->rsvd_page_tables.pages) { ret = -ENOMEM; goto err_cleanup; @@ -1587,7 +1586,7 @@ void panthor_vm_pool_destroy(struct panthor_file *pfile) */ int panthor_vm_pool_create(struct panthor_file *pfile) { - pfile->vms = kzalloc(sizeof(*pfile->vms), GFP_KERNEL); + pfile->vms = kzalloc_obj(*pfile->vms, GFP_KERNEL); if (!pfile->vms) return -ENOMEM; @@ -2426,7 +2425,7 @@ panthor_vm_create(struct panthor_device *ptdev, bool for_mcu, struct panthor_vm *vm; int ret; - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return ERR_PTR(-ENOMEM); @@ -2609,7 +2608,7 @@ panthor_vm_bind_job_create(struct drm_file *file, if (vm->destroyed || vm->unusable) return ERR_PTR(-EINVAL); - job = kzalloc(sizeof(*job), GFP_KERNEL); + job = kzalloc_obj(*job, GFP_KERNEL); if (!job) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c index ca272dbae14d..e40d7be90bb9 100644 --- a/drivers/gpu/drm/panthor/panthor_sched.c +++ b/drivers/gpu/drm/panthor/panthor_sched.c @@ -3512,7 +3512,7 @@ group_create_queue(struct panthor_group *group, if (args->priority > CSF_MAX_QUEUE_PRIO) return ERR_PTR(-EINVAL); - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return ERR_PTR(-ENOMEM); @@ -3659,7 +3659,7 @@ int panthor_group_create(struct panthor_file *pfile, hweight64(group_args->tiler_core_mask) < group_args->max_tiler_cores) return -EINVAL; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; @@ -3853,7 +3853,7 @@ int panthor_group_pool_create(struct panthor_file *pfile) { struct panthor_group_pool *gpool; - gpool = kzalloc(sizeof(*gpool), GFP_KERNEL); + gpool = kzalloc_obj(*gpool, GFP_KERNEL); if (!gpool) return -ENOMEM; @@ -3979,7 +3979,7 @@ panthor_job_create(struct panthor_file *pfile, if (qsubmit->latest_flush & GENMASK(30, 24)) return ERR_PTR(-EINVAL); - job = kzalloc(sizeof(*job), GFP_KERNEL); + job = kzalloc_obj(*job, GFP_KERNEL); if (!job) return ERR_PTR(-ENOMEM); @@ -4011,7 +4011,7 @@ panthor_job_create(struct panthor_file *pfile, * the previously submitted job. */ if (job->call_info.size) { - job->done_fence = kzalloc(sizeof(*job->done_fence), GFP_KERNEL); + job->done_fence = kzalloc_obj(*job->done_fence, GFP_KERNEL); if (!job->done_fence) { ret = -ENOMEM; goto err_put_job; diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index 2e3200db2f39..47c7f4e68dc6 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -63,7 +63,7 @@ qxl_ring_create(struct qxl_ring_header *header, { struct qxl_ring *ring; - ring = kmalloc(sizeof(*ring), GFP_KERNEL); + ring = kmalloc_obj(*ring, GFP_KERNEL); if (!ring) return NULL; diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index a134820aac58..3b6e48b28480 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -58,9 +58,9 @@ static int qxl_alloc_client_monitors_config(struct qxl_device *qdev, qdev->client_monitors_config = NULL; } if (!qdev->client_monitors_config) { - qdev->client_monitors_config = kzalloc( - struct_size(qdev->client_monitors_config, - heads, count), GFP_KERNEL); + qdev->client_monitors_config = kzalloc_flex(*qdev->client_monitors_config, + heads, count, + GFP_KERNEL); if (!qdev->client_monitors_config) return -ENOMEM; } @@ -1008,7 +1008,7 @@ static int qdev_crtc_init(struct drm_device *dev, int crtc_id) struct qxl_device *qdev = to_qxl(dev); int r; - qxl_crtc = kzalloc(sizeof(struct qxl_crtc), GFP_KERNEL); + qxl_crtc = kzalloc_obj(struct qxl_crtc, GFP_KERNEL); if (!qxl_crtc) return -ENOMEM; @@ -1159,7 +1159,7 @@ static int qdev_output_init(struct drm_device *dev, int num_output) struct drm_encoder *encoder; int ret; - qxl_output = kzalloc(sizeof(struct qxl_output), GFP_KERNEL); + qxl_output = kzalloc_obj(struct qxl_output, GFP_KERNEL); if (!qxl_output) return -ENOMEM; @@ -1241,8 +1241,8 @@ int qxl_create_monitors_object(struct qxl_device *qdev) qxl_bo_physical_address(qdev, qdev->monitors_config_bo, 0); memset(qdev->monitors_config, 0, monitors_config_size); - qdev->dumb_heads = kcalloc(qxl_num_crtc, sizeof(qdev->dumb_heads[0]), - GFP_KERNEL); + qdev->dumb_heads = kzalloc_objs(qdev->dumb_heads[0], qxl_num_crtc, + GFP_KERNEL); if (!qdev->dumb_heads) { qxl_destroy_monitors_object(qdev); return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_image.c b/drivers/gpu/drm/qxl/qxl_image.c index 3cc45997533d..01c56913b582 100644 --- a/drivers/gpu/drm/qxl/qxl_image.c +++ b/drivers/gpu/drm/qxl/qxl_image.c @@ -40,7 +40,7 @@ qxl_allocate_chunk(struct qxl_device *qdev, struct qxl_drm_chunk *chunk; int ret; - chunk = kmalloc(sizeof(struct qxl_drm_chunk), GFP_KERNEL); + chunk = kmalloc_obj(struct qxl_drm_chunk, GFP_KERNEL); if (!chunk) return -ENOMEM; @@ -63,7 +63,7 @@ qxl_image_alloc_objects(struct qxl_device *qdev, struct qxl_drm_image *image; int ret; - image = kmalloc(sizeof(struct qxl_drm_image), GFP_KERNEL); + image = kmalloc_obj(struct qxl_drm_image, GFP_KERNEL); if (!image) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index 336cbff26089..7370fb7f4f5f 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c @@ -168,8 +168,8 @@ static int qxl_process_single_command(struct qxl_device *qdev, cmd->command_size)) return -EFAULT; - reloc_info = kmalloc_array(cmd->relocs_num, - sizeof(struct qxl_reloc_info), GFP_KERNEL); + reloc_info = kmalloc_objs(struct qxl_reloc_info, cmd->relocs_num, + GFP_KERNEL); if (!reloc_info) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 66635c55cf85..14b325703034 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -116,7 +116,7 @@ int qxl_bo_create(struct qxl_device *qdev, unsigned long size, else type = ttm_bo_type_device; *bo_ptr = NULL; - bo = kzalloc(sizeof(struct qxl_bo), GFP_KERNEL); + bo = kzalloc_obj(struct qxl_bo, GFP_KERNEL); if (bo == NULL) return -ENOMEM; size = roundup(size, PAGE_SIZE); diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index 7b3c9a6016db..ec2b1120aef9 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -177,7 +177,7 @@ int qxl_release_list_add(struct qxl_release *release, struct qxl_bo *bo) return 0; } - entry = kmalloc(sizeof(struct qxl_bo_list), GFP_KERNEL); + entry = kmalloc_obj(struct qxl_bo_list, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 1a40590077dd..7ac5e40ac851 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -109,7 +109,7 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo, { struct ttm_tt *ttm; - ttm = kzalloc(sizeof(struct ttm_tt), GFP_KERNEL); + ttm = kzalloc_obj(struct ttm_tt, GFP_KERNEL); if (ttm == NULL) return NULL; if (ttm_tt_init(ttm, bo, page_flags, ttm_cached, 0)) { diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index b31125eb9a65..01bbbde30914 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -1281,7 +1281,7 @@ struct atom_context *atom_parse(struct card_info *card, void *bios) { int base; struct atom_context *ctx = - kzalloc(sizeof(struct atom_context), GFP_KERNEL); + kzalloc_obj(struct atom_context, GFP_KERNEL); char *str; char name[512]; int i; diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 3d9f47bc807a..0ed85b5dd193 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -218,7 +218,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, return; } - pdata = kmalloc(sizeof(struct radeon_backlight_privdata), GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_backlight_privdata, GFP_KERNEL); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -2625,7 +2625,8 @@ radeon_atombios_set_dac_info(struct radeon_encoder *radeon_encoder) { struct drm_device *dev = radeon_encoder->base.dev; struct radeon_device *rdev = dev->dev_private; - struct radeon_encoder_atom_dac *dac = kzalloc(sizeof(struct radeon_encoder_atom_dac), GFP_KERNEL); + struct radeon_encoder_atom_dac *dac = kzalloc_obj(struct radeon_encoder_atom_dac, + GFP_KERNEL); if (!dac) return NULL; @@ -2638,7 +2639,8 @@ static struct radeon_encoder_atom_dig * radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder) { int encoder_enum = (radeon_encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT; - struct radeon_encoder_atom_dig *dig = kzalloc(sizeof(struct radeon_encoder_atom_dig), GFP_KERNEL); + struct radeon_encoder_atom_dig *dig = kzalloc_obj(struct radeon_encoder_atom_dig, + GFP_KERNEL); if (!dig) return NULL; @@ -2676,7 +2678,7 @@ radeon_add_atom_encoder(struct drm_device *dev, } /* add a new one */ - radeon_encoder = kzalloc(sizeof(struct radeon_encoder), GFP_KERNEL); + radeon_encoder = kzalloc_obj(struct radeon_encoder, GFP_KERNEL); if (!radeon_encoder) return; diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index 70931b04bbac..36486a9c7b06 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -1992,7 +1992,7 @@ static int btc_initialize_mc_reg_table(struct radeon_device *rdev) struct evergreen_mc_reg_table *eg_table = &eg_pi->mc_reg_table; u8 module_index = rv770_get_memory_module_index(rdev); - table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -2526,7 +2526,7 @@ int btc_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - eg_pi = kzalloc(sizeof(struct evergreen_power_info), GFP_KERNEL); + eg_pi = kzalloc_obj(struct evergreen_power_info, GFP_KERNEL); if (eg_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = eg_pi; @@ -2552,9 +2552,8 @@ int btc_dpm_init(struct radeon_device *rdev) return ret; rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries = - kcalloc(4, - sizeof(struct radeon_clock_voltage_dependency_entry), - GFP_KERNEL); + kzalloc_objs(struct radeon_clock_voltage_dependency_entry, 4, + GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { r600_free_extended_power_table(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index ba8db1d07c07..f8de657c3ed0 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -4579,7 +4579,7 @@ static int ci_initialize_mc_reg_table(struct radeon_device *rdev) u8 module_index = rv770_get_memory_module_index(rdev); int ret; - table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -5517,9 +5517,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -5534,7 +5533,7 @@ static int ci_parse_power_table(struct radeon_device *rdev) ret = -EINVAL; goto err_free_ps; } - ps = kzalloc(sizeof(struct ci_ps), GFP_KERNEL); + ps = kzalloc_obj(struct ci_ps, GFP_KERNEL); if (ps == NULL) { ret = -ENOMEM; goto err_free_ps; @@ -5638,7 +5637,7 @@ int ci_dpm_init(struct radeon_device *rdev) struct pci_dev *root = rdev->pdev->bus->self; int ret; - pi = kzalloc(sizeof(struct ci_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct ci_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; @@ -5741,9 +5740,8 @@ int ci_dpm_init(struct radeon_device *rdev) ci_set_private_data_variables_based_on_pptable(rdev); rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries = - kcalloc(4, - sizeof(struct radeon_clock_voltage_dependency_entry), - GFP_KERNEL); + kzalloc_objs(struct radeon_clock_voltage_dependency_entry, 4, + GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { ci_dpm_fini(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 72a0768df00f..1fe0eecb3ea3 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c @@ -2028,7 +2028,7 @@ int cypress_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - eg_pi = kzalloc(sizeof(struct evergreen_power_info), GFP_KERNEL); + eg_pi = kzalloc_obj(struct evergreen_power_info, GFP_KERNEL); if (eg_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = eg_pi; diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 1162cb5d75ed..257caf19583a 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -2769,7 +2769,7 @@ int evergreen_cs_parse(struct radeon_cs_parser *p) if (p->track == NULL) { /* initialize tracker, we are in kms */ - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (track == NULL) return -ENOMEM; evergreen_cs_track_init(track); diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 4aa050385284..7c896c24f03d 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -2457,9 +2457,8 @@ static int kv_parse_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -2471,7 +2470,7 @@ static int kv_parse_power_table(struct radeon_device *rdev) &non_clock_info_array->nonClockInfo[non_clock_array_index]; if (!rdev->pm.power_state[i].clock_info) return -EINVAL; - ps = kzalloc(sizeof(struct kv_ps), GFP_KERNEL); + ps = kzalloc_obj(struct kv_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -2520,7 +2519,7 @@ int kv_dpm_init(struct radeon_device *rdev) struct kv_power_info *pi; int ret, i; - pi = kzalloc(sizeof(struct kv_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct kv_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index 82edbfb259bf..c4305bacd47d 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -2104,7 +2104,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev) if (ni_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc(sizeof(SMC_NISLANDS_SPLL_DIV_TABLE), GFP_KERNEL); + spll_table = kzalloc_obj(SMC_NISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); if (spll_table == NULL) return -ENOMEM; @@ -2879,7 +2879,7 @@ static int ni_initialize_mc_reg_table(struct radeon_device *rdev) struct ni_mc_reg_table *ni_table = &ni_pi->mc_reg_table; u8 module_index = rv770_get_memory_module_index(rdev); - table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -3147,7 +3147,7 @@ static int ni_initialize_smc_cac_tables(struct radeon_device *rdev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc(sizeof(PP_NIslands_CACTABLES), GFP_KERNEL); + cac_tables = kzalloc_obj(PP_NIslands_CACTABLES, GFP_KERNEL); if (!cac_tables) return -ENOMEM; @@ -4000,9 +4000,9 @@ static int ni_parse_power_table(struct radeon_device *rdev) return -EINVAL; power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); - rdev->pm.dpm.ps = kcalloc(power_info->pplib.ucNumStates, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + power_info->pplib.ucNumStates, + GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; @@ -4018,7 +4018,7 @@ static int ni_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc(sizeof(struct ni_ps), GFP_KERNEL); + ps = kzalloc_obj(struct ni_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -4051,7 +4051,7 @@ int ni_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - ni_pi = kzalloc(sizeof(struct ni_power_info), GFP_KERNEL); + ni_pi = kzalloc_obj(struct ni_power_info, GFP_KERNEL); if (ni_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = ni_pi; @@ -4078,9 +4078,8 @@ int ni_dpm_init(struct radeon_device *rdev) return ret; rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries = - kcalloc(4, - sizeof(struct radeon_clock_voltage_dependency_entry), - GFP_KERNEL); + kzalloc_objs(struct radeon_clock_voltage_dependency_entry, 4, + GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { r600_free_extended_power_table(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 07a9c523a17a..53d336b15662 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -2063,7 +2063,7 @@ int r100_cs_parse(struct radeon_cs_parser *p) struct r100_cs_track *track; int r; - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (!track) return -ENOMEM; r100_cs_track_clear(p->rdev, track); diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index d2ee6deec039..aad94b49671c 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -1284,7 +1284,7 @@ int r300_cs_parse(struct radeon_cs_parser *p) struct r100_cs_track *track; int r; - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (track == NULL) return -ENOMEM; r100_cs_track_clear(p->rdev, track); diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 8eeceeeca362..5db10ad3fd8b 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -2282,7 +2282,7 @@ int r600_cs_parse(struct radeon_cs_parser *p) if (p->track == NULL) { /* initialize tracker, we are in kms */ - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (track == NULL) return -ENOMEM; r600_cs_track_init(track); diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index 81d58ef667dd..cfe851bf1848 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -821,9 +821,9 @@ static int r600_parse_clk_voltage_dep_table(struct radeon_clock_voltage_dependen int i; ATOM_PPLIB_Clock_Voltage_Dependency_Record *entry; - radeon_table->entries = kcalloc(atom_table->ucNumEntries, - sizeof(struct radeon_clock_voltage_dependency_entry), - GFP_KERNEL); + radeon_table->entries = kzalloc_objs(struct radeon_clock_voltage_dependency_entry, + atom_table->ucNumEntries, + GFP_KERNEL); if (!radeon_table->entries) return -ENOMEM; @@ -988,9 +988,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) ATOM_PPLIB_PhaseSheddingLimits_Record *entry; rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries = - kcalloc(psl->ucNumEntries, - sizeof(struct radeon_phase_shedding_limits_entry), - GFP_KERNEL); + kzalloc_objs(struct radeon_phase_shedding_limits_entry, + psl->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries) { r600_free_extended_power_table(rdev); return -ENOMEM; @@ -1198,7 +1197,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(ext_hdr->usPPMTableOffset)); rdev->pm.dpm.dyn_state.ppm_table = - kzalloc(sizeof(struct radeon_ppm_table), GFP_KERNEL); + kzalloc_obj(struct radeon_ppm_table, GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.ppm_table) { r600_free_extended_power_table(rdev); return -ENOMEM; @@ -1256,7 +1255,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) le16_to_cpu(ext_hdr->usPowerTuneTableOffset)); ATOM_PowerTune_Table *pt; rdev->pm.dpm.dyn_state.cac_tdp_table = - kzalloc(sizeof(struct radeon_cac_tdp_table), GFP_KERNEL); + kzalloc_obj(struct radeon_cac_tdp_table, + GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.cac_tdp_table) { r600_free_extended_power_table(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index 89d7b0e9e79f..fb75d0bb8726 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c @@ -132,7 +132,7 @@ struct radeon_agp_head *radeon_agp_head_init(struct drm_device *dev) struct pci_dev *pdev = to_pci_dev(dev->dev); struct radeon_agp_head *head; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (!head) return NULL; head->bridge = agp_find_bridge(pdev); diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 81a0a91921b9..35c37b6054ad 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -1632,7 +1632,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct lvds_info = (union lvds_info *)(mode_info->atom_context->bios + data_offset); lvds = - kzalloc(sizeof(struct radeon_encoder_atom_dig), GFP_KERNEL); + kzalloc_obj(struct radeon_encoder_atom_dig, GFP_KERNEL); if (!lvds) return NULL; @@ -1773,7 +1773,8 @@ radeon_atombios_get_primary_dac_info(struct radeon_encoder *encoder) dac_info = (struct _COMPASSIONATE_DATA *) (mode_info->atom_context->bios + data_offset); - p_dac = kzalloc(sizeof(struct radeon_encoder_primary_dac), GFP_KERNEL); + p_dac = kzalloc_obj(struct radeon_encoder_primary_dac, + GFP_KERNEL); if (!p_dac) return NULL; @@ -1960,7 +1961,7 @@ radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) dac_info = (struct _COMPASSIONATE_DATA *) (mode_info->atom_context->bios + data_offset); - tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL); + tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac, GFP_KERNEL); if (!tv_dac) return NULL; @@ -2117,9 +2118,8 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev) num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK; if (num_modes == 0) return state_index; - rdev->pm.power_state = kcalloc(num_modes, - sizeof(struct radeon_power_state), - GFP_KERNEL); + rdev->pm.power_state = kzalloc_objs(struct radeon_power_state, + num_modes, GFP_KERNEL); if (!rdev->pm.power_state) return state_index; /* last mode is usually default, array is low to high */ @@ -2127,8 +2127,8 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev) /* avoid memory leaks from invalid modes or unknown frev. */ if (!rdev->pm.power_state[state_index].clock_info) { rdev->pm.power_state[state_index].clock_info = - kzalloc(sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_obj(struct radeon_pm_clock_info, + GFP_KERNEL); } if (!rdev->pm.power_state[state_index].clock_info) goto out; @@ -2591,9 +2591,9 @@ static int radeon_atombios_parse_power_table_4_5(struct radeon_device *rdev) radeon_atombios_add_pplib_thermal_controller(rdev, &power_info->pplib.sThermalController); if (power_info->pplib.ucNumStates == 0) return state_index; - rdev->pm.power_state = kcalloc(power_info->pplib.ucNumStates, - sizeof(struct radeon_power_state), - GFP_KERNEL); + rdev->pm.power_state = kzalloc_objs(struct radeon_power_state, + power_info->pplib.ucNumStates, + GFP_KERNEL); if (!rdev->pm.power_state) return state_index; /* first mode is usually default, followed by low to high */ @@ -2609,10 +2609,9 @@ static int radeon_atombios_parse_power_table_4_5(struct radeon_device *rdev) (power_state->v1.ucNonClockStateIndex * power_info->pplib.ucNonClockSize)); rdev->pm.power_state[i].clock_info = - kcalloc((power_info->pplib.ucStateEntrySize - 1) ? - (power_info->pplib.ucStateEntrySize - 1) : 1, - sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, + (power_info->pplib.ucStateEntrySize - 1) ? (power_info->pplib.ucStateEntrySize - 1) : 1, + GFP_KERNEL); if (!rdev->pm.power_state[i].clock_info) return state_index; if (power_info->pplib.ucStateEntrySize - 1) { @@ -2694,9 +2693,9 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); if (state_array->ucNumEntries == 0) return state_index; - rdev->pm.power_state = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_power_state), - GFP_KERNEL); + rdev->pm.power_state = kzalloc_objs(struct radeon_power_state, + state_array->ucNumEntries, + GFP_KERNEL); if (!rdev->pm.power_state) return state_index; power_state_offset = (u8 *)state_array->states; @@ -2707,10 +2706,9 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; rdev->pm.power_state[i].clock_info = - kcalloc(power_state->v2.ucNumDPMLevels ? - power_state->v2.ucNumDPMLevels : 1, - sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, + power_state->v2.ucNumDPMLevels ? power_state->v2.ucNumDPMLevels : 1, + GFP_KERNEL); if (!rdev->pm.power_state[i].clock_info) return state_index; if (power_state->v2.ucNumDPMLevels) { @@ -2787,12 +2785,12 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) } if (state_index == 0) { - rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL); + rdev->pm.power_state = kzalloc_obj(struct radeon_power_state, + GFP_KERNEL); if (rdev->pm.power_state) { rdev->pm.power_state[0].clock_info = - kcalloc(1, - sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, 1, + GFP_KERNEL); if (rdev->pm.power_state[0].clock_info) { /* add the default mode */ rdev->pm.power_state[state_index].type = diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index df8d7f56b028..6cb0b7cfe510 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -851,8 +851,7 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct struct radeon_encoder_primary_dac *p_dac; int found = 0; - p_dac = kzalloc(sizeof(struct radeon_encoder_primary_dac), - GFP_KERNEL); + p_dac = kzalloc_obj(struct radeon_encoder_primary_dac, GFP_KERNEL); if (!p_dac) return NULL; @@ -1002,7 +1001,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct struct radeon_encoder_tv_dac *tv_dac; int found = 0; - tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL); + tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac, GFP_KERNEL); if (!tv_dac) return NULL; @@ -1090,7 +1089,7 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct uint32_t ppll_div_sel, ppll_val; uint32_t lvds_ss_gen_cntl = RREG32(RADEON_LVDS_SS_GEN_CNTL); - lvds = kzalloc(sizeof(struct radeon_encoder_lvds), GFP_KERNEL); + lvds = kzalloc_obj(struct radeon_encoder_lvds, GFP_KERNEL); if (!lvds) return NULL; @@ -1165,7 +1164,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE); if (lcd_info) { - lvds = kzalloc(sizeof(struct radeon_encoder_lvds), GFP_KERNEL); + lvds = kzalloc_obj(struct radeon_encoder_lvds, GFP_KERNEL); if (!lvds) return NULL; @@ -2630,16 +2629,14 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) rdev->pm.default_power_state_index = -1; /* allocate 2 power states */ - rdev->pm.power_state = kcalloc(2, sizeof(struct radeon_power_state), - GFP_KERNEL); + rdev->pm.power_state = kzalloc_objs(struct radeon_power_state, 2, + GFP_KERNEL); if (rdev->pm.power_state) { /* allocate 1 clock mode per state */ rdev->pm.power_state[0].clock_info = - kcalloc(1, sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, 1, GFP_KERNEL); rdev->pm.power_state[1].clock_info = - kcalloc(1, sizeof(struct radeon_pm_clock_info), - GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, 1, GFP_KERNEL); if (!rdev->pm.power_state[0].clock_info || !rdev->pm.power_state[1].clock_info) goto pm_failed; diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 012d8b2295b8..e5bf06d7b981 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1887,7 +1887,7 @@ radeon_add_atom_connector(struct drm_device *dev, } } - radeon_connector = kzalloc(sizeof(struct radeon_connector), GFP_KERNEL); + radeon_connector = kzalloc_obj(struct radeon_connector, GFP_KERNEL); if (!radeon_connector) return; @@ -1907,7 +1907,8 @@ radeon_add_atom_connector(struct drm_device *dev, } if (is_dp_bridge) { - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2078,7 +2079,8 @@ radeon_add_atom_connector(struct drm_device *dev, break; case DRM_MODE_CONNECTOR_DVII: case DRM_MODE_CONNECTOR_DVID: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2140,7 +2142,8 @@ radeon_add_atom_connector(struct drm_device *dev, break; case DRM_MODE_CONNECTOR_HDMIA: case DRM_MODE_CONNECTOR_HDMIB: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2195,7 +2198,8 @@ radeon_add_atom_connector(struct drm_device *dev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_DisplayPort: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2250,7 +2254,8 @@ radeon_add_atom_connector(struct drm_device *dev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_eDP: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2297,7 +2302,8 @@ radeon_add_atom_connector(struct drm_device *dev, connector->doublescan_allowed = false; break; case DRM_MODE_CONNECTOR_LVDS: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); + radeon_dig_connector = kzalloc_obj(struct radeon_connector_atom_dig, + GFP_KERNEL); if (!radeon_dig_connector) goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; @@ -2379,7 +2385,7 @@ radeon_add_legacy_connector(struct drm_device *dev, } } - radeon_connector = kzalloc(sizeof(struct radeon_connector), GFP_KERNEL); + radeon_connector = kzalloc_obj(struct radeon_connector, GFP_KERNEL); if (!radeon_connector) return; diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 3f9c0011244f..3b2cbd69b58b 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -93,8 +93,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) p->dma_reloc_idx = 0; /* FIXME: we assume that each relocs use 4 dwords */ p->nrelocs = chunk->length_dw / 4; - p->relocs = kvcalloc(p->nrelocs, sizeof(struct radeon_bo_list), - GFP_KERNEL); + p->relocs = kvzalloc_objs(struct radeon_bo_list, p->nrelocs, GFP_KERNEL); if (p->relocs == NULL) { return -ENOMEM; } @@ -297,7 +296,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) } p->cs_flags = 0; p->nchunks = cs->num_chunks; - p->chunks = kvcalloc(p->nchunks, sizeof(struct radeon_cs_chunk), GFP_KERNEL); + p->chunks = kvzalloc_objs(struct radeon_cs_chunk, p->nchunks, + GFP_KERNEL); if (p->chunks == NULL) { return -ENOMEM; } diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 5faae0361361..c58d24fe74f9 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -974,7 +974,7 @@ static uint32_t cail_ioreg_read(struct card_info *info, uint32_t reg) int radeon_atombios_init(struct radeon_device *rdev) { struct card_info *atom_card_info = - kzalloc(sizeof(struct card_info), GFP_KERNEL); + kzalloc_obj(struct card_info, GFP_KERNEL); if (!atom_card_info) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index bc28117e01b4..4296ebd3dd94 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -494,7 +494,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, unsigned long flags; int r; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (work == NULL) return -ENOMEM; @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index) struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc; - radeon_crtc = kzalloc(sizeof(*radeon_crtc), GFP_KERNEL); + radeon_crtc = kzalloc_obj(*radeon_crtc, GFP_KERNEL); if (radeon_crtc == NULL) return; @@ -1346,7 +1346,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); @@ -1539,7 +1539,8 @@ static void radeon_afmt_init(struct radeon_device *rdev) BUG_ON(num_afmt > ARRAY_SIZE(eg_offsets)); for (i = 0; i < num_afmt; i++) { - rdev->mode_info.afmt[i] = kzalloc(sizeof(struct radeon_afmt), GFP_KERNEL); + rdev->mode_info.afmt[i] = kzalloc_obj(struct radeon_afmt, + GFP_KERNEL); if (rdev->mode_info.afmt[i]) { rdev->mode_info.afmt[i]->offset = eg_offsets[i]; rdev->mode_info.afmt[i]->id = i; @@ -1547,26 +1548,30 @@ static void radeon_afmt_init(struct radeon_device *rdev) } } else if (ASIC_IS_DCE3(rdev)) { /* DCE3.x has 2 audio blocks tied to DIG encoders */ - rdev->mode_info.afmt[0] = kzalloc(sizeof(struct radeon_afmt), GFP_KERNEL); + rdev->mode_info.afmt[0] = kzalloc_obj(struct radeon_afmt, + GFP_KERNEL); if (rdev->mode_info.afmt[0]) { rdev->mode_info.afmt[0]->offset = DCE3_HDMI_OFFSET0; rdev->mode_info.afmt[0]->id = 0; } - rdev->mode_info.afmt[1] = kzalloc(sizeof(struct radeon_afmt), GFP_KERNEL); + rdev->mode_info.afmt[1] = kzalloc_obj(struct radeon_afmt, + GFP_KERNEL); if (rdev->mode_info.afmt[1]) { rdev->mode_info.afmt[1]->offset = DCE3_HDMI_OFFSET1; rdev->mode_info.afmt[1]->id = 1; } } else if (ASIC_IS_DCE2(rdev)) { /* DCE2 has at least 1 routable audio block */ - rdev->mode_info.afmt[0] = kzalloc(sizeof(struct radeon_afmt), GFP_KERNEL); + rdev->mode_info.afmt[0] = kzalloc_obj(struct radeon_afmt, + GFP_KERNEL); if (rdev->mode_info.afmt[0]) { rdev->mode_info.afmt[0]->offset = DCE2_HDMI_OFFSET0; rdev->mode_info.afmt[0]->id = 0; } /* r6xx has 2 routable audio blocks */ if (rdev->family >= CHIP_R600) { - rdev->mode_info.afmt[1] = kzalloc(sizeof(struct radeon_afmt), GFP_KERNEL); + rdev->mode_info.afmt[1] = kzalloc_obj(struct radeon_afmt, + GFP_KERNEL); if (rdev->mode_info.afmt[1]) { rdev->mode_info.afmt[1]->offset = DCE2_HDMI_OFFSET1; rdev->mode_info.afmt[1]->id = 1; diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index fd083aaa91bb..9d760c221c5a 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -228,7 +228,7 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper *fb_helper, } rbo = gem_to_radeon_bo(gobj); - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) { ret = -ENOMEM; goto err_radeon_fbdev_destroy_pinned_object; diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 167d6f122b8e..6a13299089d5 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -137,7 +137,7 @@ int radeon_fence_emit(struct radeon_device *rdev, u64 seq; /* we are protected by the ring emission mutex */ - *fence = kmalloc(sizeof(struct radeon_fence), GFP_KERNEL); + *fence = kmalloc_obj(struct radeon_fence, GFP_KERNEL); if ((*fence) == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index f3ba4187092c..007d9353b1ab 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c @@ -912,7 +912,7 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, if (rec->mm_i2c && (radeon_hw_i2c == 0)) return NULL; - i2c = kzalloc(sizeof(struct radeon_i2c_chan), GFP_KERNEL); + i2c = kzalloc_obj(struct radeon_i2c_chan, GFP_KERNEL); if (i2c == NULL) return NULL; diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 7cbe02ffb193..9833d77170fc 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -640,7 +640,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) /* new gpu have virtual address space support */ if (rdev->family >= CHIP_CAYMAN) { - fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); + fpriv = kzalloc_obj(*fpriv, GFP_KERNEL); if (unlikely(!fpriv)) { r = -ENOMEM; goto err_suspend; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index d1e8b9757a65..f2bb046a595e 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -394,7 +394,7 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, return; } - pdata = kmalloc(sizeof(struct radeon_backlight_privdata), GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_backlight_privdata, GFP_KERNEL); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -1695,7 +1695,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeon struct radeon_encoder_int_tmds *tmds; bool ret; - tmds = kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL); + tmds = kzalloc_obj(struct radeon_encoder_int_tmds, GFP_KERNEL); if (!tmds) return NULL; @@ -1721,7 +1721,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra if (rdev->is_atom_bios) return NULL; - tmds = kzalloc(sizeof(struct radeon_encoder_ext_tmds), GFP_KERNEL); + tmds = kzalloc_obj(struct radeon_encoder_ext_tmds, GFP_KERNEL); if (!tmds) return NULL; @@ -1752,7 +1752,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_ } /* add a new one */ - radeon_encoder = kzalloc(sizeof(struct radeon_encoder), GFP_KERNEL); + radeon_encoder = kzalloc_obj(struct radeon_encoder, GFP_KERNEL); if (!radeon_encoder) return; diff --git a/drivers/gpu/drm/radeon/radeon_semaphore.c b/drivers/gpu/drm/radeon/radeon_semaphore.c index 1f0a9a4ff5ae..28331fef03c5 100644 --- a/drivers/gpu/drm/radeon/radeon_semaphore.c +++ b/drivers/gpu/drm/radeon/radeon_semaphore.c @@ -36,7 +36,7 @@ int radeon_semaphore_create(struct radeon_device *rdev, { int r; - *semaphore = kmalloc(sizeof(struct radeon_semaphore), GFP_KERNEL); + *semaphore = kmalloc_obj(struct radeon_semaphore, GFP_KERNEL); if (*semaphore == NULL) { return -ENOMEM; } diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index 818554e60537..cab04dccbd1d 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c @@ -60,7 +60,7 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) n = rdev->mc.gtt_size - rdev->gart_pin_size; n /= size; - gtt_obj = kcalloc(n, sizeof(*gtt_obj), GFP_KERNEL); + gtt_obj = kzalloc_objs(*gtt_obj, n, GFP_KERNEL); if (!gtt_obj) { DRM_ERROR("Failed to allocate %d pointers\n", n); r = 1; diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 695ac32f7535..4cb141b052b6 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -492,7 +492,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo, #endif rbo = container_of(bo, struct radeon_bo, tbo); - gtt = kzalloc(sizeof(struct radeon_ttm_tt), GFP_KERNEL); + gtt = kzalloc_obj(struct radeon_ttm_tt, GFP_KERNEL); if (gtt == NULL) { return NULL; } @@ -533,7 +533,7 @@ static int radeon_ttm_tt_populate(struct ttm_device *bdev, bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); if (gtt && gtt->userptr) { - ttm->sg = kzalloc(sizeof(struct sg_table), GFP_KERNEL); + ttm->sg = kzalloc_obj(struct sg_table, GFP_KERNEL); if (!ttm->sg) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 21a5340aefdf..5be6cf123d8d 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c @@ -133,8 +133,8 @@ struct radeon_bo_list *radeon_vm_get_bos(struct radeon_device *rdev, struct radeon_bo_list *list; unsigned i, idx; - list = kvmalloc_array(vm->max_pde_used + 2, - sizeof(struct radeon_bo_list), GFP_KERNEL); + list = kvmalloc_objs(struct radeon_bo_list, vm->max_pde_used + 2, + GFP_KERNEL); if (!list) return NULL; @@ -321,7 +321,7 @@ struct radeon_bo_va *radeon_vm_bo_add(struct radeon_device *rdev, { struct radeon_bo_va *bo_va; - bo_va = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); + bo_va = kzalloc_obj(struct radeon_bo_va, GFP_KERNEL); if (bo_va == NULL) return NULL; @@ -495,7 +495,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, if (bo_va->it.start || bo_va->it.last) { /* add a clone of the bo_va to clear the old address */ struct radeon_bo_va *tmp; - tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); + tmp = kzalloc_obj(struct radeon_bo_va, GFP_KERNEL); if (!tmp) { mutex_unlock(&vm->mutex); r = -ENOMEM; diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c index 24ad12409120..813ef291b349 100644 --- a/drivers/gpu/drm/radeon/rs780_dpm.c +++ b/drivers/gpu/drm/radeon/rs780_dpm.c @@ -804,9 +804,9 @@ static int rs780_parse_power_table(struct radeon_device *rdev) return -EINVAL; power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); - rdev->pm.dpm.ps = kcalloc(power_info->pplib.ucNumStates, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + power_info->pplib.ucNumStates, + GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; @@ -826,7 +826,7 @@ static int rs780_parse_power_table(struct radeon_device *rdev) le16_to_cpu(power_info->pplib.usClockInfoArrayOffset) + (power_state->v1.ucClockStateIndices[0] * power_info->pplib.ucClockInfoSize)); - ps = kzalloc(sizeof(struct igp_ps), GFP_KERNEL); + ps = kzalloc_obj(struct igp_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -853,7 +853,7 @@ int rs780_dpm_init(struct radeon_device *rdev) u8 frev, crev; int ret; - pi = kzalloc(sizeof(struct igp_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct igp_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index 69d380fff22a..2a4c5d79271b 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c @@ -1887,9 +1887,9 @@ static int rv6xx_parse_power_table(struct radeon_device *rdev) return -EINVAL; power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); - rdev->pm.dpm.ps = kcalloc(power_info->pplib.ucNumStates, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + power_info->pplib.ucNumStates, + GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; @@ -1905,7 +1905,7 @@ static int rv6xx_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc(sizeof(struct rv6xx_ps), GFP_KERNEL); + ps = kzalloc_obj(struct rv6xx_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1936,7 +1936,7 @@ int rv6xx_dpm_init(struct radeon_device *rdev) struct rv6xx_power_info *pi; int ret; - pi = kzalloc(sizeof(struct rv6xx_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct rv6xx_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index e3e1f6833f12..0de4b5171aac 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c @@ -2283,9 +2283,9 @@ int rv7xx_parse_power_table(struct radeon_device *rdev) return -EINVAL; power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); - rdev->pm.dpm.ps = kcalloc(power_info->pplib.ucNumStates, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + power_info->pplib.ucNumStates, + GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; @@ -2301,7 +2301,7 @@ int rv7xx_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc(sizeof(struct rv7xx_ps), GFP_KERNEL); + ps = kzalloc_obj(struct rv7xx_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -2348,7 +2348,7 @@ int rv770_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - pi = kzalloc(sizeof(struct rv7xx_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct rv7xx_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index f12227145ef0..b7897f89dee8 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -2419,7 +2419,7 @@ static int si_initialize_smc_dte_tables(struct radeon_device *rdev) if (dte_data->k <= 0) return -EINVAL; - dte_tables = kzalloc(sizeof(Smc_SIslands_DTE_Configuration), GFP_KERNEL); + dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration, GFP_KERNEL); if (dte_tables == NULL) { si_pi->enable_dte = false; return -ENOMEM; @@ -2599,7 +2599,7 @@ static int si_initialize_smc_cac_tables(struct radeon_device *rdev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc(sizeof(PP_SIslands_CacConfig), GFP_KERNEL); + cac_tables = kzalloc_obj(PP_SIslands_CacConfig, GFP_KERNEL); if (!cac_tables) return -ENOMEM; @@ -2794,7 +2794,7 @@ static int si_init_smc_spll_table(struct radeon_device *rdev) if (si_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc(sizeof(SMC_SISLANDS_SPLL_DIV_TABLE), GFP_KERNEL); + spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); if (spll_table == NULL) return -ENOMEM; @@ -5479,7 +5479,7 @@ static int si_initialize_mc_reg_table(struct radeon_device *rdev) u8 module_index = rv770_get_memory_module_index(rdev); int ret; - table = kzalloc(sizeof(struct atom_mc_reg_table), GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -6778,9 +6778,8 @@ static int si_parse_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -6792,7 +6791,7 @@ static int si_parse_power_table(struct radeon_device *rdev) &non_clock_info_array->nonClockInfo[non_clock_array_index]; if (!rdev->pm.power_state[i].clock_info) return -EINVAL; - ps = kzalloc(sizeof(struct ni_ps), GFP_KERNEL); + ps = kzalloc_obj(struct ni_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -6849,7 +6848,7 @@ int si_dpm_init(struct radeon_device *rdev) struct pci_dev *root = rdev->pdev->bus->self; int ret; - si_pi = kzalloc(sizeof(struct si_power_info), GFP_KERNEL); + si_pi = kzalloc_obj(struct si_power_info, GFP_KERNEL); if (si_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = si_pi; @@ -6899,9 +6898,8 @@ int si_dpm_init(struct radeon_device *rdev) return ret; rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries = - kcalloc(4, - sizeof(struct radeon_clock_voltage_dependency_entry), - GFP_KERNEL); + kzalloc_objs(struct radeon_clock_voltage_dependency_entry, 4, + GFP_KERNEL); if (!rdev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { r600_free_extended_power_table(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index b11f7c5bbcbe..43d452b65c6a 100644 --- a/drivers/gpu/drm/radeon/sumo_dpm.c +++ b/drivers/gpu/drm/radeon/sumo_dpm.c @@ -1479,9 +1479,8 @@ static int sumo_parse_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -1495,7 +1494,7 @@ static int sumo_parse_power_table(struct radeon_device *rdev) kfree(rdev->pm.dpm.ps); return -EINVAL; } - ps = kzalloc(sizeof(struct sumo_ps), GFP_KERNEL); + ps = kzalloc_obj(struct sumo_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1745,7 +1744,7 @@ int sumo_dpm_init(struct radeon_device *rdev) u32 hw_rev = (RREG32(HW_REV) & ATI_REV_ID_MASK) >> ATI_REV_ID_SHIFT; int ret; - pi = kzalloc(sizeof(struct sumo_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct sumo_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index b9a2c7ccc881..a8e8cb8e2b01 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -1710,9 +1710,8 @@ static int trinity_parse_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset)); - rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, - sizeof(struct radeon_ps), - GFP_KERNEL); + rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps, + state_array->ucNumEntries, GFP_KERNEL); if (!rdev->pm.dpm.ps) return -ENOMEM; power_state_offset = (u8 *)state_array->states; @@ -1726,7 +1725,7 @@ static int trinity_parse_power_table(struct radeon_device *rdev) kfree(rdev->pm.dpm.ps); return -EINVAL; } - ps = kzalloc(sizeof(struct sumo_ps), GFP_KERNEL); + ps = kzalloc_obj(struct sumo_ps, GFP_KERNEL); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1903,7 +1902,7 @@ int trinity_dpm_init(struct radeon_device *rdev) struct trinity_power_info *pi; int ret, i; - pi = kzalloc(sizeof(struct trinity_power_info), GFP_KERNEL); + pi = kzalloc_obj(struct trinity_power_info, GFP_KERNEL); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c index 2e2906ab750b..dad019714c3e 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c @@ -1006,7 +1006,7 @@ static void rcar_du_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c index 6294443f6068..6ef11717b2ff 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c @@ -381,7 +381,7 @@ struct drm_gem_object *rcar_du_gem_prime_import_sg_table(struct drm_device *dev, return drm_gem_dma_prime_import_sg_table(dev, attach, sgt); /* Create a DMA GEM buffer. */ - dma_obj = kzalloc(sizeof(*dma_obj), GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); if (!dma_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c index c546ab0805d6..29d5574a5d8e 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c @@ -721,7 +721,7 @@ static void rcar_du_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c index 7aa0373563a4..87eb80cb931e 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c @@ -404,7 +404,7 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - copy = kzalloc(sizeof(*copy), GFP_KERNEL); + copy = kzalloc_obj(*copy, GFP_KERNEL); if (copy == NULL) return NULL; @@ -429,7 +429,7 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return; @@ -488,7 +488,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, num_planes = rcdu->info->num_rpf; - vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL); + vsp->planes = kzalloc_objs(*vsp->planes, num_planes, GFP_KERNEL); if (!vsp->planes) return -ENOMEM; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c index 8cd37d7b8ae2..0d818663b1ce 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c @@ -57,7 +57,7 @@ static int rcar_du_wb_prepare_job(struct drm_writeback_connector *connector, if (!job->fb) return 0; - rjob = kzalloc(sizeof(*rjob), GFP_KERNEL); + rjob = kzalloc_obj(*rjob, GFP_KERNEL); if (!rjob) return -ENOMEM; @@ -99,7 +99,7 @@ rcar_du_wb_conn_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - copy = kzalloc(sizeof(*copy), GFP_KERNEL); + copy = kzalloc_obj(*copy, GFP_KERNEL); if (!copy) return NULL; @@ -124,7 +124,7 @@ static void rcar_du_wb_conn_reset(struct drm_connector *connector) connector->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c index 6e7aac6219be..e9a95a026a2a 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c @@ -336,7 +336,7 @@ static void rzg2l_du_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return; diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c index 040d4e4aff00..525889dba500 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c @@ -249,7 +249,7 @@ rzg2l_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - copy = kzalloc(sizeof(*copy), GFP_KERNEL); + copy = kzalloc_obj(*copy, GFP_KERNEL); if (!copy) return NULL; @@ -274,7 +274,7 @@ static void rzg2l_du_vsp_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return; diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 2e2f37b9d0a4..931d797c598a 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -551,7 +551,7 @@ shmob_drm_connector_init(struct shmob_drm_device *sdev, return ERR_PTR(-EINVAL); } - scon = kzalloc(sizeof(*scon), GFP_KERNEL); + scon = kzalloc_obj(*scon, GFP_KERNEL); if (!scon) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c index 9d166ab2af8b..983e4c72002a 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c @@ -260,7 +260,7 @@ static void shmob_drm_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 2f469d370021..43688d0322d7 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -36,7 +36,7 @@ rockchip_fb_create(struct drm_device *dev, struct drm_file *file, struct drm_afbc_framebuffer *afbc_fb; int ret; - afbc_fb = kzalloc(sizeof(*afbc_fb), GFP_KERNEL); + afbc_fb = kzalloc_obj(*afbc_fb, GFP_KERNEL); if (!afbc_fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index df9a8bff2e22..e6216773a6c4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -289,7 +289,7 @@ static struct rockchip_gem_object * size = round_up(size, PAGE_SIZE); - rk_obj = kzalloc(sizeof(*rk_obj), GFP_KERNEL); + rk_obj = kzalloc_obj(*rk_obj, GFP_KERNEL); if (!rk_obj) return ERR_PTR(-ENOMEM); @@ -434,7 +434,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj) if (rk_obj->pages) return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages); - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 1b466623b6c7..ab16765a407b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1658,8 +1658,8 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, static void vop_crtc_reset(struct drm_crtc *crtc) { - struct rockchip_crtc_state *crtc_state = - kzalloc(sizeof(*crtc_state), GFP_KERNEL); + struct rockchip_crtc_state *crtc_state = kzalloc_obj(*crtc_state, + GFP_KERNEL); if (crtc->state) vop_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index ec3b4fde10db..b12970bcc588 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2140,8 +2140,7 @@ static void vop2_crtc_destroy_state(struct drm_crtc *crtc, static void vop2_crtc_reset(struct drm_crtc *crtc) { - struct rockchip_crtc_state *vcstate = - kzalloc(sizeof(*vcstate), GFP_KERNEL); + struct rockchip_crtc_state *vcstate = kzalloc_obj(*vcstate, GFP_KERNEL); if (crtc->state) vop2_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index bd7936c03da2..d0b3a10d808f 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1352,13 +1352,14 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_init_ sched->own_submit_wq = true; } - sched->sched_rq = kmalloc_array(args->num_rqs, sizeof(*sched->sched_rq), - GFP_KERNEL | __GFP_ZERO); + sched->sched_rq = kmalloc_objs(*sched->sched_rq, args->num_rqs, + GFP_KERNEL | __GFP_ZERO); if (!sched->sched_rq) goto Out_check_own; sched->num_rqs = args->num_rqs; for (i = DRM_SCHED_PRIORITY_KERNEL; i < sched->num_rqs; i++) { - sched->sched_rq[i] = kzalloc(sizeof(*sched->sched_rq[i]), GFP_KERNEL); + sched->sched_rq[i] = kzalloc_obj(*sched->sched_rq[i], + GFP_KERNEL); if (!sched->sched_rq[i]) goto Out_unroll; drm_sched_rq_init(sched, sched->sched_rq[i]); diff --git a/drivers/gpu/drm/sitronix/st7920.c b/drivers/gpu/drm/sitronix/st7920.c index f35a157fdad8..21d9369d01c3 100644 --- a/drivers/gpu/drm/sitronix/st7920.c +++ b/drivers/gpu/drm/sitronix/st7920.c @@ -459,7 +459,7 @@ static void st7920_primary_plane_reset(struct drm_plane *plane) drm_WARN_ON_ONCE(plane->dev, plane->state); - st7920_state = kzalloc(sizeof(*st7920_state), GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); if (!st7920_state) return; @@ -474,7 +474,7 @@ static struct drm_plane_state *st7920_primary_plane_duplicate_state(struct drm_p if (drm_WARN_ON_ONCE(plane->dev, !plane->state)) return NULL; - st7920_state = kzalloc(sizeof(*st7920_state), GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); if (!st7920_state) return NULL; @@ -581,7 +581,7 @@ static void st7920_crtc_reset(struct drm_crtc *crtc) drm_WARN_ON_ONCE(crtc->dev, crtc->state); - st7920_state = kzalloc(sizeof(*st7920_state), GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); if (!st7920_state) return; @@ -595,7 +595,7 @@ static struct drm_crtc_state *st7920_crtc_duplicate_state(struct drm_crtc *crtc) if (drm_WARN_ON_ONCE(crtc->dev, !crtc->state)) return NULL; - st7920_state = kzalloc(sizeof(*st7920_state), GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); if (!st7920_state) return NULL; diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 96cf39320137..aa08e13e4bb7 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -1396,7 +1396,7 @@ static void ssd130x_primary_plane_reset(struct drm_plane *plane) drm_WARN_ON_ONCE(plane->dev, plane->state); - ssd130x_state = kzalloc(sizeof(*ssd130x_state), GFP_KERNEL); + ssd130x_state = kzalloc_obj(*ssd130x_state, GFP_KERNEL); if (!ssd130x_state) return; @@ -1553,7 +1553,7 @@ static void ssd130x_crtc_reset(struct drm_crtc *crtc) drm_WARN_ON_ONCE(crtc->dev, crtc->state); - ssd130x_state = kzalloc(sizeof(*ssd130x_state), GFP_KERNEL); + ssd130x_state = kzalloc_obj(*ssd130x_state, GFP_KERNEL); if (!ssd130x_state) return; diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index f16345f01065..b0c73fe2731d 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -151,7 +151,7 @@ static int sti_init(struct drm_device *ddev) { struct sti_private *private; - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (!private) return -ENOMEM; diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 98f3176366c0..10e8dbdc6a76 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -29,7 +29,7 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) __drm_atomic_helper_plane_reset(plane, &state->state); } @@ -40,7 +40,7 @@ sun4i_backend_layer_duplicate_state(struct drm_plane *plane) struct sun4i_layer_state *orig = state_to_sun4i_layer_state(plane->state); struct sun4i_layer_state *copy; - copy = kzalloc(sizeof(*copy), GFP_KERNEL); + copy = kzalloc_obj(*copy, GFP_KERNEL); if (!copy) return NULL; diff --git a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c index 6214b7709b37..02c59d401b45 100644 --- a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c +++ b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c @@ -427,7 +427,7 @@ void drm_sysfb_plane_reset(struct drm_plane *plane) if (plane->state) drm_sysfb_plane_state_destroy(to_drm_sysfb_plane_state(plane->state)); - sysfb_plane_state = kzalloc(sizeof(*sysfb_plane_state), GFP_KERNEL); + sysfb_plane_state = kzalloc_obj(*sysfb_plane_state, GFP_KERNEL); if (sysfb_plane_state) __drm_gem_reset_shadow_plane(plane, &sysfb_plane_state->base); else @@ -447,7 +447,7 @@ struct drm_plane_state *drm_sysfb_plane_atomic_duplicate_state(struct drm_plane return NULL; sysfb_plane_state = to_drm_sysfb_plane_state(plane_state); - new_sysfb_plane_state = kzalloc(sizeof(*new_sysfb_plane_state), GFP_KERNEL); + new_sysfb_plane_state = kzalloc_obj(*new_sysfb_plane_state, GFP_KERNEL); if (!new_sysfb_plane_state) return NULL; new_shadow_plane_state = &new_sysfb_plane_state->base; @@ -523,7 +523,7 @@ void drm_sysfb_crtc_reset(struct drm_crtc *crtc) if (crtc->state) drm_sysfb_crtc_state_destroy(to_drm_sysfb_crtc_state(crtc->state)); - sysfb_crtc_state = kzalloc(sizeof(*sysfb_crtc_state), GFP_KERNEL); + sysfb_crtc_state = kzalloc_obj(*sysfb_crtc_state, GFP_KERNEL); if (sysfb_crtc_state) { sysfb_crtc_state->format = sysfb->fb_format; __drm_atomic_helper_crtc_reset(crtc, &sysfb_crtc_state->base); @@ -543,7 +543,7 @@ struct drm_crtc_state *drm_sysfb_crtc_atomic_duplicate_state(struct drm_crtc *cr if (drm_WARN_ON(dev, !crtc_state)) return NULL; - new_sysfb_crtc_state = kzalloc(sizeof(*new_sysfb_crtc_state), GFP_KERNEL); + new_sysfb_crtc_state = kzalloc_obj(*new_sysfb_crtc_state, GFP_KERNEL); if (!new_sysfb_crtc_state) return NULL; diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 01e9d5011dd8..21cadb50c671 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -812,7 +812,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -1115,7 +1115,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -1263,7 +1263,7 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -1389,7 +1389,7 @@ static void tegra_dc_destroy(struct drm_crtc *crtc) static void tegra_crtc_reset(struct drm_crtc *crtc) { - struct tegra_dc_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct tegra_dc_state *state = kzalloc_obj(*state, GFP_KERNEL); if (crtc->state) tegra_crtc_atomic_destroy_state(crtc, crtc->state); @@ -1406,7 +1406,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct tegra_dc_state *state = to_dc_state(crtc->state); struct tegra_dc_state *copy; - copy = kmalloc(sizeof(*copy), GFP_KERNEL); + copy = kmalloc_obj(*copy, GFP_KERNEL); if (!copy) return NULL; diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index f7222819d672..1d1bbeae4522 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -104,7 +104,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) { struct tegra_drm_file *fpriv; - fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); + fpriv = kzalloc_obj(*fpriv, GFP_KERNEL); if (!fpriv) return -ENOMEM; @@ -212,7 +212,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, */ num_refs = num_cmdbufs + num_relocs * 2; - refs = kmalloc_array(num_refs, sizeof(*refs), GFP_KERNEL); + refs = kmalloc_objs(*refs, num_refs, GFP_KERNEL); if (!refs) { err = -ENOMEM; goto put; @@ -465,7 +465,7 @@ static int tegra_open_channel(struct drm_device *drm, void *data, struct tegra_drm_client *client; int err = -ENODEV; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; @@ -1147,7 +1147,7 @@ static int host1x_drm_probe(struct host1x_device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - tegra = kzalloc(sizeof(*tegra), GFP_KERNEL); + tegra = kzalloc_obj(*tegra, GFP_KERNEL); if (!tegra) { err = -ENOMEM; goto put; diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 8ee96b59fdbc..f28e7bd63508 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -772,7 +772,7 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi) static void tegra_dsi_connector_reset(struct drm_connector *connector) { - struct tegra_dsi_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct tegra_dsi_state *state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return; diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 1cef8c5cac50..e795570776fd 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -112,7 +112,7 @@ struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm, unsigned int i; int err; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 6b14f1e919eb..c7355b11424c 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -64,7 +64,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ struct host1x_bo_mapping *map; int err; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return ERR_PTR(-ENOMEM); @@ -103,7 +103,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ * If we don't have a mapping for this buffer yet, return an SG table * so that host1x can do the mapping for us via the DMA API. */ - map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); if (!map->sgt) { err = -ENOMEM; goto free; @@ -240,7 +240,7 @@ static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo) if (bo->mm) return -EBUSY; - bo->mm = kzalloc(sizeof(*bo->mm), GFP_KERNEL); + bo->mm = kzalloc_obj(*bo->mm, GFP_KERNEL); if (!bo->mm) return -ENOMEM; @@ -302,7 +302,7 @@ static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm, struct tegra_bo *bo; int err; - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); @@ -639,7 +639,7 @@ tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach, struct tegra_bo *bo = to_tegra_bo(gem); struct sg_table *sgt; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return NULL; diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index c924ffba4094..e0f84efb3b76 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -769,7 +769,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -943,7 +943,7 @@ static int tegra_display_hub_init(struct host1x_client *client) struct tegra_drm *tegra = drm->dev_private; struct tegra_display_hub_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index ffe5f06b770d..ce49c2de2c08 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -36,7 +36,7 @@ static void tegra_plane_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state) { plane->state = &state->base; plane->state->plane = plane; @@ -55,7 +55,7 @@ tegra_plane_atomic_duplicate_state(struct drm_plane *plane) struct tegra_plane_state *copy; unsigned int i; - copy = kmalloc(sizeof(*copy), GFP_KERNEL); + copy = kmalloc_obj(*copy, GFP_KERNEL); if (!copy) return NULL; diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 4023cb5998f1..a2cb68f42612 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1721,7 +1721,7 @@ static void tegra_sor_connector_reset(struct drm_connector *connector) { struct tegra_sor_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return; diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c index 2430fcc97448..7747d5b9f3ca 100644 --- a/drivers/gpu/drm/tegra/submit.c +++ b/drivers/gpu/drm/tegra/submit.c @@ -71,7 +71,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction struct host1x_bo_mapping *map; int err; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return ERR_PTR(-ENOMEM); @@ -80,7 +80,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction map->direction = direction; map->dev = dev; - map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); if (!map->sgt) { err = -ENOMEM; goto free; @@ -193,7 +193,7 @@ static int submit_copy_gather_data(struct gather_bo **pbo, struct device *dev, return -EINVAL; } - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) { SUBMIT_ERR(context, "failed to allocate memory for bo info"); return -ENOMEM; @@ -270,7 +270,7 @@ static int submit_process_bufs(struct tegra_drm_context *context, struct gather_ return PTR_ERR(bufs); } - mappings = kcalloc(args->num_bufs, sizeof(*mappings), GFP_KERNEL); + mappings = kzalloc_objs(*mappings, args->num_bufs, GFP_KERNEL); if (!mappings) { SUBMIT_ERR(context, "failed to allocate memory for mapping info"); err = -ENOMEM; @@ -560,7 +560,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data, if (err) goto unlock; - job_data = kzalloc(sizeof(*job_data), GFP_KERNEL); + job_data = kzalloc_obj(*job_data, GFP_KERNEL); if (!job_data) { SUBMIT_ERR(context, "failed to allocate memory for job data"); err = -ENOMEM; diff --git a/drivers/gpu/drm/tegra/uapi.c b/drivers/gpu/drm/tegra/uapi.c index d0b6a1fa6efa..c4061d0f69a7 100644 --- a/drivers/gpu/drm/tegra/uapi.c +++ b/drivers/gpu/drm/tegra/uapi.c @@ -86,7 +86,7 @@ int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data, struct drm_ if (args->flags) return -EINVAL; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; @@ -206,7 +206,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f return -EINVAL; } - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) { err = -ENOMEM; goto unlock; diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c index 4b459f21acfd..f401b9c42a9c 100644 --- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c +++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c @@ -80,7 +80,7 @@ static void drm_gem_shmem_test_obj_create_private(struct kunit *test) buf = kunit_kzalloc(test, TEST_SIZE, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, buf); - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, sgt); ret = kunit_add_action_or_reset(test, kfree_wrapper, sgt); diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c index aec9eccdeae9..6a1a27ee5f36 100644 --- a/drivers/gpu/drm/tests/drm_mm_test.c +++ b/drivers/gpu/drm/tests/drm_mm_test.c @@ -252,7 +252,7 @@ static void drm_test_mm_align_pot(struct kunit *test, int max) for (bit = max - 1; bit; bit--) { u64 align, size; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) { KUNIT_FAIL(test, "failed to allocate node"); goto out; diff --git a/drivers/gpu/drm/tests/drm_panic_test.c b/drivers/gpu/drm/tests/drm_panic_test.c index d60150877df8..a36f5106c139 100644 --- a/drivers/gpu/drm/tests/drm_panic_test.c +++ b/drivers/gpu/drm/tests/drm_panic_test.c @@ -127,7 +127,7 @@ static void drm_test_panic_screen_user_page(struct kunit *test) fb_size = params->width * params->height * sb->format->cpp[0]; npages = DIV_ROUND_UP(fb_size, PAGE_SIZE); - pages = kmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, npages, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, pages); for (p = 0; p < npages; p++) { diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 8f81eb560b9e..e7fc496e2ce4 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -364,7 +364,7 @@ static void tidss_crtc_reset(struct drm_crtc *crtc) if (crtc->state) tidss_crtc_destroy_state(crtc, crtc->state); - tstate = kzalloc(sizeof(*tstate), GFP_KERNEL); + tstate = kzalloc_obj(*tstate, GFP_KERNEL); if (!tstate) { crtc->state = NULL; return; @@ -382,7 +382,7 @@ static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc) current_state = to_tidss_crtc_state(crtc->state); - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -425,7 +425,7 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, bool has_ctm = tidss->feat->vp_feat.color.has_ctm; int ret; - tcrtc = kzalloc(sizeof(*tcrtc), GFP_KERNEL); + tcrtc = kzalloc_obj(*tcrtc, GFP_KERNEL); if (!tcrtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index bd10bc1b9961..a8e681c4e03b 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -203,7 +203,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, BIT(DRM_MODE_BLEND_COVERAGE)); int ret; - tplane = kzalloc(sizeof(*tplane), GFP_KERNEL); + tplane = kzalloc_obj(*tplane, GFP_KERNEL); if (!tplane) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 262f290d85d9..ed0822b3a020 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -272,7 +272,7 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) return NULL; } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) goto put_node; diff --git a/drivers/gpu/drm/tiny/appletbdrm.c b/drivers/gpu/drm/tiny/appletbdrm.c index 751b05753c94..585c1a0ec025 100644 --- a/drivers/gpu/drm/tiny/appletbdrm.c +++ b/drivers/gpu/drm/tiny/appletbdrm.c @@ -225,7 +225,7 @@ static int appletbdrm_send_msg(struct appletbdrm_device *adev, __le32 msg) struct appletbdrm_msg_simple_request *request; int ret; - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) return -ENOMEM; @@ -260,7 +260,7 @@ static int appletbdrm_get_information(struct appletbdrm_device *adev) __le32 pixel_format; int ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -358,7 +358,8 @@ static int appletbdrm_primary_plane_helper_atomic_check(struct drm_plane *plane, if (!appletbdrm_state->request) return -ENOMEM; - appletbdrm_state->response = kzalloc(sizeof(*appletbdrm_state->response), GFP_KERNEL); + appletbdrm_state->response = kzalloc_obj(*appletbdrm_state->response, + GFP_KERNEL); if (!appletbdrm_state->response) return -ENOMEM; @@ -505,7 +506,7 @@ static void appletbdrm_primary_plane_reset(struct drm_plane *plane) WARN_ON(plane->state); - appletbdrm_state = kzalloc(sizeof(*appletbdrm_state), GFP_KERNEL); + appletbdrm_state = kzalloc_obj(*appletbdrm_state, GFP_KERNEL); if (!appletbdrm_state) return; @@ -520,7 +521,7 @@ static struct drm_plane_state *appletbdrm_primary_plane_duplicate_state(struct d if (WARN_ON(!plane->state)) return NULL; - appletbdrm_state = kzalloc(sizeof(*appletbdrm_state), GFP_KERNEL); + appletbdrm_state = kzalloc_obj(*appletbdrm_state, GFP_KERNEL); if (!appletbdrm_state) return NULL; diff --git a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c b/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c index 7b533e4e1e04..5cefc50304e4 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c +++ b/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c @@ -49,7 +49,7 @@ static struct ttm_tt *ttm_tt_simple_create(struct ttm_buffer_object *bo, u32 pag { struct ttm_tt *tt; - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); ttm_tt_init(tt, bo, page_flags, ttm_cached, 0); return tt; diff --git a/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c b/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c index dd395229e388..d6558f5c7e48 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c +++ b/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c @@ -35,7 +35,7 @@ static int ttm_mock_manager_alloc(struct ttm_resource_manager *man, u64 lpfn, fpfn, alloc_size; int err; - mock_res = kzalloc(sizeof(*mock_res), GFP_KERNEL); + mock_res = kzalloc_obj(*mock_res, GFP_KERNEL); if (!mock_res) return -ENOMEM; @@ -100,7 +100,7 @@ int ttm_mock_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size) struct ttm_resource_manager *base; int err; - manager = kzalloc(sizeof(*manager), GFP_KERNEL); + manager = kzalloc_obj(*manager, GFP_KERNEL); if (!manager) return -ENOMEM; @@ -194,7 +194,7 @@ int ttm_bad_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size) { struct ttm_resource_manager *man; - man = kzalloc(sizeof(*man), GFP_KERNEL); + man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index fca0a1a3c6fd..a973aafd6f7f 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -128,7 +128,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_buffer_object *bo, { struct ttm_agp_backend *agp_be; - agp_be = kmalloc(sizeof(*agp_be), GFP_KERNEL); + agp_be = kmalloc_obj(*agp_be, GFP_KERNEL); if (!agp_be) return NULL; diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index cabcfeaa70dc..93871aaa33b2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -233,7 +233,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, struct ttm_transfer_obj *fbo; int ret; - fbo = kmalloc(sizeof(*fbo), GFP_KERNEL); + fbo = kmalloc_obj(*fbo, GFP_KERNEL); if (!fbo) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 217e45958099..b1fa78edad1f 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -164,7 +164,7 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags, return p; } - dma = kmalloc(sizeof(*dma), GFP_KERNEL); + dma = kmalloc_obj(*dma, GFP_KERNEL); if (!dma) return NULL; @@ -858,7 +858,7 @@ int ttm_pool_restore_and_alloc(struct ttm_pool *pool, struct ttm_tt *tt, if (ctx->gfp_retry_mayfail) gfp |= __GFP_RETRY_MAYFAIL; - restore = kzalloc(sizeof(*restore), gfp); + restore = kzalloc_obj(*restore, gfp); if (!restore) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c index db854b581d83..b223b873d0c6 100644 --- a/drivers/gpu/drm/ttm/ttm_range_manager.c +++ b/drivers/gpu/drm/ttm/ttm_range_manager.c @@ -73,7 +73,7 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man, if (!lpfn) lpfn = man->size; - node = kzalloc(struct_size(node, mm_nodes, 1), GFP_KERNEL); + node = kzalloc_flex(*node, mm_nodes, 1, GFP_KERNEL); if (!node) return -ENOMEM; @@ -184,7 +184,7 @@ int ttm_range_man_init_nocheck(struct ttm_device *bdev, struct ttm_resource_manager *man; struct ttm_range_manager *rman; - rman = kzalloc(sizeof(*rman), GFP_KERNEL); + rman = kzalloc_obj(*rman, GFP_KERNEL); if (!rman) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c b/drivers/gpu/drm/ttm/ttm_sys_manager.c index 2ced169513cb..fb3e9869704a 100644 --- a/drivers/gpu/drm/ttm/ttm_sys_manager.c +++ b/drivers/gpu/drm/ttm/ttm_sys_manager.c @@ -12,7 +12,7 @@ static int ttm_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc(sizeof(**res), GFP_KERNEL); + *res = kzalloc_obj(**res, GFP_KERNEL); if (!*res) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index fbf713abd547..3497011eb8ff 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -137,8 +137,8 @@ static int ttm_dma_tt_alloc_page_directory(struct ttm_tt *ttm) static int ttm_sg_tt_alloc_page_directory(struct ttm_tt *ttm) { - ttm->dma_address = kvcalloc(ttm->num_pages, sizeof(*ttm->dma_address), - GFP_KERNEL); + ttm->dma_address = kvzalloc_objs(*ttm->dma_address, ttm->num_pages, + GFP_KERNEL); if (!ttm->dma_address) return -ENOMEM; diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index bc58991a6f14..27dac7cc50a6 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -218,7 +218,7 @@ retry: udl->urbs.size = size; while (udl->urbs.count * size < wanted_size) { - unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); + unode = kzalloc_obj(struct urb_node, GFP_KERNEL); if (!unode) break; unode->dev = udl; diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index 36aae97cf6da..146bcb30f37b 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -86,7 +86,7 @@ struct drm_gem_object *v3d_create_object(struct drm_device *dev, size_t size) if (size == 0) return ERR_PTR(-EINVAL); - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); obj = &bo->base.base; diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 8de4f151a5c0..0ed83100c95a 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -133,7 +133,7 @@ v3d_open(struct drm_device *dev, struct drm_file *file) struct drm_gpu_scheduler *sched; int i; - v3d_priv = kzalloc(sizeof(*v3d_priv), GFP_KERNEL); + v3d_priv = kzalloc_obj(*v3d_priv, GFP_KERNEL); if (!v3d_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c index c82500a1df73..0deaf636387e 100644 --- a/drivers/gpu/drm/v3d/v3d_fence.c +++ b/drivers/gpu/drm/v3d/v3d_fence.c @@ -8,7 +8,7 @@ struct dma_fence *v3d_fence_create(struct v3d_dev *v3d, enum v3d_queue q) struct v3d_queue_state *queue = &v3d->queue[q]; struct v3d_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/v3d/v3d_perfmon.c b/drivers/gpu/drm/v3d/v3d_perfmon.c index 9a3fe5255874..b1bde69e4517 100644 --- a/drivers/gpu/drm/v3d/v3d_perfmon.c +++ b/drivers/gpu/drm/v3d/v3d_perfmon.c @@ -353,8 +353,7 @@ int v3d_perfmon_create_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - perfmon = kzalloc(struct_size(perfmon, values, req->ncounters), - GFP_KERNEL); + perfmon = kzalloc_flex(*perfmon, values, req->ncounters, GFP_KERNEL); if (!perfmon) return -ENOMEM; diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c index 794c3571662d..d172cab1564c 100644 --- a/drivers/gpu/drm/v3d/v3d_submit.c +++ b/drivers/gpu/drm/v3d/v3d_submit.c @@ -335,9 +335,8 @@ v3d_get_multisync_post_deps(struct drm_file *file_priv, return 0; se->out_syncs = (struct v3d_submit_outsync *) - kvmalloc_array(count, - sizeof(struct v3d_submit_outsync), - GFP_KERNEL); + kvmalloc_objs(struct v3d_submit_outsync, count, + GFP_KERNEL); if (!se->out_syncs) return -ENOMEM; @@ -486,9 +485,8 @@ v3d_get_cpu_timestamp_query_params(struct drm_file *file_priv, job->job_type = V3D_CPU_JOB_TYPE_TIMESTAMP_QUERY; - query_info->queries = kvmalloc_array(timestamp.count, - sizeof(struct v3d_timestamp_query), - GFP_KERNEL); + query_info->queries = kvmalloc_objs(struct v3d_timestamp_query, + timestamp.count, GFP_KERNEL); if (!query_info->queries) return -ENOMEM; @@ -545,9 +543,8 @@ v3d_get_cpu_reset_timestamp_params(struct drm_file *file_priv, job->job_type = V3D_CPU_JOB_TYPE_RESET_TIMESTAMP_QUERY; - query_info->queries = kvmalloc_array(reset.count, - sizeof(struct v3d_timestamp_query), - GFP_KERNEL); + query_info->queries = kvmalloc_objs(struct v3d_timestamp_query, + reset.count, GFP_KERNEL); if (!query_info->queries) return -ENOMEM; @@ -602,9 +599,8 @@ v3d_get_cpu_copy_query_results_params(struct drm_file *file_priv, job->job_type = V3D_CPU_JOB_TYPE_COPY_TIMESTAMP_QUERY; - query_info->queries = kvmalloc_array(copy.count, - sizeof(struct v3d_timestamp_query), - GFP_KERNEL); + query_info->queries = kvmalloc_objs(struct v3d_timestamp_query, + copy.count, GFP_KERNEL); if (!query_info->queries) return -ENOMEM; @@ -729,9 +725,8 @@ v3d_get_cpu_reset_performance_params(struct drm_file *file_priv, job->job_type = V3D_CPU_JOB_TYPE_RESET_PERFORMANCE_QUERY; query_info->queries = - kvmalloc_array(reset.count, - sizeof(struct v3d_performance_query), - GFP_KERNEL); + kvmalloc_objs(struct v3d_performance_query, reset.count, + GFP_KERNEL); if (!query_info->queries) return -ENOMEM; @@ -771,9 +766,8 @@ v3d_get_cpu_copy_performance_query_params(struct drm_file *file_priv, job->job_type = V3D_CPU_JOB_TYPE_COPY_PERFORMANCE_QUERY; query_info->queries = - kvmalloc_array(copy.count, - sizeof(struct v3d_performance_query), - GFP_KERNEL); + kvmalloc_objs(struct v3d_performance_query, copy.count, + GFP_KERNEL); if (!query_info->queries) return -ENOMEM; @@ -1082,8 +1076,8 @@ v3d_submit_tfu_ioctl(struct drm_device *dev, void *data, goto fail; } - job->base.bo = kcalloc(ARRAY_SIZE(args->bo_handles), - sizeof(*job->base.bo), GFP_KERNEL); + job->base.bo = kzalloc_objs(*job->base.bo, ARRAY_SIZE(args->bo_handles), + GFP_KERNEL); if (!job->base.bo) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index d363c3f0afdf..86229323eeac 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -528,7 +528,7 @@ static struct drm_plane *vbox_create_plane(struct vbox_private *vbox, return ERR_PTR(-EINVAL); } - plane = kzalloc(sizeof(*plane), GFP_KERNEL); + plane = kzalloc_obj(*plane, GFP_KERNEL); if (!plane) return ERR_PTR(-ENOMEM); @@ -562,7 +562,7 @@ static struct vbox_crtc *vbox_crtc_init(struct drm_device *dev, unsigned int i) if (ret) return ERR_PTR(ret); - vbox_crtc = kzalloc(sizeof(*vbox_crtc), GFP_KERNEL); + vbox_crtc = kzalloc_obj(*vbox_crtc, GFP_KERNEL); if (!vbox_crtc) return ERR_PTR(-ENOMEM); @@ -622,7 +622,7 @@ static struct drm_encoder *vbox_encoder_init(struct drm_device *dev, { struct vbox_encoder *vbox_encoder; - vbox_encoder = kzalloc(sizeof(*vbox_encoder), GFP_KERNEL); + vbox_encoder = kzalloc_obj(*vbox_encoder, GFP_KERNEL); if (!vbox_encoder) return NULL; @@ -808,7 +808,7 @@ static int vbox_connector_init(struct drm_device *dev, struct vbox_connector *vbox_connector; struct drm_connector *connector; - vbox_connector = kzalloc(sizeof(*vbox_connector), GFP_KERNEL); + vbox_connector = kzalloc_obj(*vbox_connector, GFP_KERNEL); if (!vbox_connector) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 46b4474ac41d..274cad424059 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -205,8 +205,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev, struct list_head *new_list; uint32_t i; - new_list = kmalloc_array(new_size, sizeof(struct list_head), - GFP_KERNEL); + new_list = kmalloc_objs(struct list_head, new_size, GFP_KERNEL); if (!new_list) return NULL; @@ -400,7 +399,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return ERR_PTR(-ENODEV); - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); @@ -1015,8 +1014,8 @@ int vc4_bo_cache_init(struct drm_device *dev) * use. This lets us avoid a bunch of string reallocation in * the kernel's draw and BO allocation paths. */ - vc4->bo_labels = kcalloc(VC4_BO_TYPE_COUNT, sizeof(*vc4->bo_labels), - GFP_KERNEL); + vc4->bo_labels = kzalloc_objs(*vc4->bo_labels, VC4_BO_TYPE_COUNT, + GFP_KERNEL); if (!vc4->bo_labels) return -ENOMEM; vc4->num_labels = VC4_BO_TYPE_COUNT; diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 2a48038abe7a..27a9eab1c2d0 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -997,7 +997,7 @@ vc4_async_page_flip_common(struct drm_crtc *crtc, struct drm_plane *plane = crtc->primary; struct vc4_async_flip_state *flip_state; - flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL); + flip_state = kzalloc_obj(*flip_state, GFP_KERNEL); if (!flip_state) return -ENOMEM; @@ -1105,7 +1105,7 @@ struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) { struct vc4_crtc_state *vc4_state, *old_vc4_state; - vc4_state = kzalloc(sizeof(*vc4_state), GFP_KERNEL); + vc4_state = kzalloc_obj(*vc4_state, GFP_KERNEL); if (!vc4_state) return NULL; @@ -1142,7 +1142,7 @@ void vc4_crtc_reset(struct drm_crtc *crtc) if (crtc->state) vc4_crtc_destroy_state(crtc, crtc->state); - vc4_crtc_state = kzalloc(sizeof(*vc4_crtc_state), GFP_KERNEL); + vc4_crtc_state = kzalloc_obj(*vc4_crtc_state, GFP_KERNEL); if (!vc4_crtc_state) { crtc->state = NULL; return; diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 3846996f9028..0677458e28f8 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -152,7 +152,7 @@ static int vc4_open(struct drm_device *dev, struct drm_file *file) if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return -ENODEV; - vc4file = kzalloc(sizeof(*vc4file), GFP_KERNEL); + vc4file = kzalloc_obj(*vc4file, GFP_KERNEL); if (!vc4file) return -ENOMEM; vc4file->dev = vc4; diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index ab16164b5eda..42b6dcbaa01b 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -110,7 +110,7 @@ vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, state->bo = get_state->bo; memcpy(get_state, state, sizeof(*state)); - bo_state = kcalloc(state->bo_count, sizeof(*bo_state), GFP_KERNEL); + bo_state = kzalloc_objs(*bo_state, state->bo_count, GFP_KERNEL); if (!bo_state) { ret = -ENOMEM; goto err_free; @@ -161,7 +161,7 @@ vc4_save_hang_state(struct drm_device *dev) unsigned long irqflags; unsigned int i, j, k, unref_list_count; - kernel_state = kcalloc(1, sizeof(*kernel_state), GFP_KERNEL); + kernel_state = kzalloc_objs(*kernel_state, 1, GFP_KERNEL); if (!kernel_state) return; @@ -187,8 +187,8 @@ vc4_save_hang_state(struct drm_device *dev) state->bo_count += exec[i]->bo_count + unref_list_count; } - kernel_state->bo = kcalloc(state->bo_count, - sizeof(*kernel_state->bo), GFP_ATOMIC); + kernel_state->bo = kzalloc_objs(*kernel_state->bo, state->bo_count, + GFP_ATOMIC); if (!kernel_state->bo) { spin_unlock_irqrestore(&vc4->job_lock, irqflags); @@ -622,7 +622,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec, unsigned long irqflags; struct vc4_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return -ENOMEM; fence->dev = dev; @@ -1043,7 +1043,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - exec = kcalloc(1, sizeof(*exec), GFP_KERNEL); + exec = kzalloc_objs(*exec, 1, GFP_KERNEL); if (!exec) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 2ea31938168d..ef5825a00bc3 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2941,8 +2941,7 @@ static int vc4_hdmi_build_regset(struct drm_device *drm, unsigned int i; int ret; - regs = kcalloc(variant->num_registers, sizeof(*regs), - GFP_KERNEL); + regs = kzalloc_objs(*regs, variant->num_registers, GFP_KERNEL); if (!regs) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index e563c1210937..de39992bbaa2 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -103,7 +103,7 @@ static int vc4_ctm_obj_init(struct vc4_dev *vc4) drm_modeset_lock_init(&vc4->ctm_state_lock); - ctm_state = kzalloc(sizeof(*ctm_state), GFP_KERNEL); + ctm_state = kzalloc_obj(*ctm_state, GFP_KERNEL); if (!ctm_state) return -ENOMEM; @@ -734,7 +734,7 @@ static int vc4_load_tracker_obj_init(struct vc4_dev *vc4) { struct vc4_load_tracker_state *load_state; - load_state = kzalloc(sizeof(*load_state), GFP_KERNEL); + load_state = kzalloc_obj(*load_state, GFP_KERNEL); if (!load_state) return -ENOMEM; @@ -752,7 +752,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) struct vc4_hvs_state *state; unsigned int i; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -817,7 +817,7 @@ static int vc4_hvs_channels_obj_init(struct vc4_dev *vc4) { struct vc4_hvs_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; @@ -911,7 +911,7 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, * If the layout changes and doesn't give us that in the future, * we will need to have something smarter, but it works so far. */ - sorted_crtcs = kmalloc_array(dev->num_crtcs, sizeof(*sorted_crtcs), GFP_KERNEL); + sorted_crtcs = kmalloc_objs(*sorted_crtcs, dev->num_crtcs, GFP_KERNEL); if (!sorted_crtcs) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_perfmon.c b/drivers/gpu/drm/vc4/vc4_perfmon.c index 1ac80c0b258f..26e89e7054a0 100644 --- a/drivers/gpu/drm/vc4/vc4_perfmon.c +++ b/drivers/gpu/drm/vc4/vc4_perfmon.c @@ -172,8 +172,7 @@ int vc4_perfmon_create_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - perfmon = kzalloc(struct_size(perfmon, counters, req->ncounters), - GFP_KERNEL); + perfmon = kzalloc_flex(*perfmon, counters, req->ncounters, GFP_KERNEL); if (!perfmon) return -ENOMEM; perfmon->dev = vc4; diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index f00d4076ba07..26392ae43b99 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -374,7 +374,7 @@ static void vc4_plane_reset(struct drm_plane *plane) kfree(plane->state); - vc4_state = kzalloc(sizeof(*vc4_state), GFP_KERNEL); + vc4_state = kzalloc_obj(*vc4_state, GFP_KERNEL); if (!vc4_state) return; diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c index b50b6cdac3f4..8e2fe5eef1b9 100644 --- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c +++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c @@ -803,7 +803,7 @@ vc4_validate_shader(struct drm_gem_dma_object *shader_obj) if (!validation_state.branch_targets) goto fail; - validated_shader = kcalloc(1, sizeof(*validated_shader), GFP_KERNEL); + validated_shader = kzalloc_objs(*validated_shader, 1, GFP_KERNEL); if (!validated_shader) goto fail; diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 260c64733972..7dc9e2e422f5 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -60,7 +60,7 @@ static int vgem_open(struct drm_device *dev, struct drm_file *file) struct vgem_file *vfile; int ret; - vfile = kzalloc(sizeof(*vfile), GFP_KERNEL); + vfile = kzalloc_obj(*vfile, GFP_KERNEL); if (!vfile) return -ENOMEM; @@ -94,7 +94,7 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz { struct drm_gem_shmem_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 07db319c3d7f..313e706abe37 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -71,7 +71,7 @@ static struct dma_fence *vgem_fence_create(struct vgem_file *vfile, { struct vgem_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 6a962c1d6e95..a4b7761d9250 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -334,7 +334,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, if (!obj) return ERR_PTR(-EINVAL); - virtio_gpu_fb = kzalloc(sizeof(*virtio_gpu_fb), GFP_KERNEL); + virtio_gpu_fb = kzalloc_obj(*virtio_gpu_fb, GFP_KERNEL); if (virtio_gpu_fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 44c1d8ef3c4d..7ee31fd89741 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -61,8 +61,8 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev, { uint64_t fence_context = base_fence_ctx + ring_idx; struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv; - struct virtio_gpu_fence *fence = kzalloc(sizeof(struct virtio_gpu_fence), - GFP_KERNEL); + struct virtio_gpu_fence *fence = kzalloc_obj(struct virtio_gpu_fence, + GFP_KERNEL); if (!fence) return fence; diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 90c99d83c4cf..a2f462aeec25 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -154,7 +154,7 @@ struct virtio_gpu_object_array *virtio_gpu_panic_array_alloc(void) { struct virtio_gpu_object_array *objs; - objs = kmalloc(sizeof(struct virtio_gpu_object_array), GFP_ATOMIC); + objs = kmalloc_obj(struct virtio_gpu_object_array, GFP_ATOMIC); if (!objs) return NULL; @@ -167,7 +167,7 @@ struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents) { struct virtio_gpu_object_array *objs; - objs = kmalloc(struct_size(objs, objs, nents), GFP_KERNEL); + objs = kmalloc_flex(*objs, objs, nents, GFP_KERNEL); if (!objs) return NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index f3594695bb82..b1a13946d4db 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -316,7 +316,7 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) return 0; /* allocate a virt GPU context for this opener */ - vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); + vfpriv = kzalloc_obj(*vfpriv, GFP_KERNEL); if (!vfpriv) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index 4270bfede7b9..c7381c564492 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -149,7 +149,7 @@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, struct virtio_gpu_object_shmem *shmem; struct drm_gem_shmem_object *dshmem; - shmem = kzalloc(sizeof(*shmem), GFP_KERNEL); + shmem = kzalloc_obj(*shmem, GFP_KERNEL); if (!shmem) return ERR_PTR(-ENOMEM); @@ -177,9 +177,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, else *nents = pages->orig_nents; - *ents = kvmalloc_array(*nents, - sizeof(struct virtio_gpu_mem_entry), - GFP_KERNEL); + *ents = kvmalloc_objs(struct virtio_gpu_mem_entry, *nents, GFP_KERNEL); if (!(*ents)) { DRM_ERROR("failed to allocate ent list\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index a7863f8ee4ee..9b72ece71264 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -79,7 +79,7 @@ drm_plane_state *virtio_gpu_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index ce49282198cb..9cae1f3b18e8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -164,9 +164,8 @@ int virtgpu_dma_buf_import_sgt(struct virtio_gpu_mem_entry **ents, if (IS_ERR(sgt)) return PTR_ERR(sgt); - *ents = kvmalloc_array(sgt->nents, - sizeof(struct virtio_gpu_mem_entry), - GFP_KERNEL); + *ents = kvmalloc_objs(struct virtio_gpu_mem_entry, sgt->nents, + GFP_KERNEL); if (!(*ents)) { dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); return -ENOMEM; @@ -315,7 +314,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, if (!vgdev->has_resource_blob || vgdev->has_virgl_3d) return drm_gem_prime_import(dev, buf); - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/virtio/virtgpu_submit.c b/drivers/gpu/drm/virtio/virtgpu_submit.c index 7d34cf83f5f2..8f171d87545f 100644 --- a/drivers/gpu/drm/virtio/virtgpu_submit.c +++ b/drivers/gpu/drm/virtio/virtgpu_submit.c @@ -104,7 +104,7 @@ virtio_gpu_parse_deps(struct virtio_gpu_submit *submit) * internally for allocations larger than a page size, preventing * storm of KMSG warnings. */ - syncobjs = kvcalloc(num_in_syncobjs, sizeof(*syncobjs), GFP_KERNEL); + syncobjs = kvzalloc_objs(*syncobjs, num_in_syncobjs, GFP_KERNEL); if (!syncobjs) return -ENOMEM; @@ -195,7 +195,7 @@ static int virtio_gpu_parse_post_deps(struct virtio_gpu_submit *submit) if (!num_out_syncobjs) return 0; - post_deps = kvcalloc(num_out_syncobjs, sizeof(*post_deps), GFP_KERNEL); + post_deps = kvzalloc_objs(*post_deps, num_out_syncobjs, GFP_KERNEL); if (!post_deps) return -ENOMEM; @@ -277,7 +277,7 @@ static int virtio_gpu_fence_event_create(struct drm_device *dev, struct virtio_gpu_fence_event *e = NULL; int ret; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 0c194b4e9488..9a45a58e9f58 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -312,7 +312,7 @@ static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int *sg_ents) if (WARN_ON(!PAGE_ALIGNED(data))) return NULL; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return NULL; @@ -936,8 +936,7 @@ int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_display_info), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_display_info, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -959,8 +958,7 @@ int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_capset_info, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -995,7 +993,7 @@ int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, if (version > vgdev->capsets[idx].max_version) return -EINVAL; - cache_ent = kzalloc(sizeof(*cache_ent), GFP_KERNEL); + cache_ent = kzalloc_obj(*cache_ent, GFP_KERNEL); if (!cache_ent) return -ENOMEM; @@ -1063,8 +1061,7 @@ int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev) return -EINVAL; for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) { - resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_edid), - GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_edid, GFP_KERNEL); if (!resp_buf) return -ENOMEM; @@ -1341,7 +1338,7 @@ virtio_gpu_cmd_resource_assign_uuid(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_resource_uuid *resp_buf; - resp_buf = kzalloc(sizeof(*resp_buf), GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); if (!resp_buf) { spin_lock(&vgdev->resource_export_lock); bo->uuid_state = STATE_ERR; @@ -1394,7 +1391,7 @@ int virtio_gpu_cmd_map(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_map_info *resp_buf; - resp_buf = kzalloc(sizeof(*resp_buf), GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); if (!resp_buf) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio/virtgpu_vram.c index 5ad3b7c6f73c..da5d4ee8ddef 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vram.c +++ b/drivers/gpu/drm/virtio/virtgpu_vram.c @@ -79,7 +79,7 @@ struct sg_table *virtio_gpu_vram_map_dma_buf(struct virtio_gpu_object *bo, dma_addr_t addr; int ret; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return ERR_PTR(-ENOMEM); @@ -193,7 +193,7 @@ int virtio_gpu_vram_create(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_vram *vram; int ret; - vram = kzalloc(sizeof(*vram), GFP_KERNEL); + vram = kzalloc_obj(*vram, GFP_KERNEL); if (!vram) return -ENOMEM; diff --git a/drivers/gpu/drm/vkms/vkms_colorop.c b/drivers/gpu/drm/vkms/vkms_colorop.c index d03a1f2e9c41..8aeea73de617 100644 --- a/drivers/gpu/drm/vkms/vkms_colorop.c +++ b/drivers/gpu/drm/vkms/vkms_colorop.c @@ -24,7 +24,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr memset(ops, 0, sizeof(ops)); /* 1st op: 1d curve */ - ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -41,7 +41,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 2nd op: 3x4 matrix */ - ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -57,7 +57,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3rd op: 3x4 matrix */ - ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -73,7 +73,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 4th op: 1d curve */ - ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c index 8788df9edb7c..8447b654e229 100644 --- a/drivers/gpu/drm/vkms/vkms_config.c +++ b/drivers/gpu/drm/vkms/vkms_config.c @@ -12,7 +12,7 @@ struct vkms_config *vkms_config_create(const char *dev_name) { struct vkms_config *config; - config = kzalloc(sizeof(*config), GFP_KERNEL); + config = kzalloc_obj(*config, GFP_KERNEL); if (!config) return ERR_PTR(-ENOMEM); @@ -388,7 +388,7 @@ struct vkms_config_plane *vkms_config_create_plane(struct vkms_config *config) { struct vkms_config_plane *plane_cfg; - plane_cfg = kzalloc(sizeof(*plane_cfg), GFP_KERNEL); + plane_cfg = kzalloc_obj(*plane_cfg, GFP_KERNEL); if (!plane_cfg) return ERR_PTR(-ENOMEM); @@ -448,7 +448,7 @@ struct vkms_config_crtc *vkms_config_create_crtc(struct vkms_config *config) { struct vkms_config_crtc *crtc_cfg; - crtc_cfg = kzalloc(sizeof(*crtc_cfg), GFP_KERNEL); + crtc_cfg = kzalloc_obj(*crtc_cfg, GFP_KERNEL); if (!crtc_cfg) return ERR_PTR(-ENOMEM); @@ -527,7 +527,7 @@ struct vkms_config_encoder *vkms_config_create_encoder(struct vkms_config *confi { struct vkms_config_encoder *encoder_cfg; - encoder_cfg = kzalloc(sizeof(*encoder_cfg), GFP_KERNEL); + encoder_cfg = kzalloc_obj(*encoder_cfg, GFP_KERNEL); if (!encoder_cfg) return ERR_PTR(-ENOMEM); @@ -591,7 +591,7 @@ struct vkms_config_connector *vkms_config_create_connector(struct vkms_config *c { struct vkms_config_connector *connector_cfg; - connector_cfg = kzalloc(sizeof(*connector_cfg), GFP_KERNEL); + connector_cfg = kzalloc_obj(*connector_cfg, GFP_KERNEL); if (!connector_cfg) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vkms/vkms_configfs.c b/drivers/gpu/drm/vkms/vkms_configfs.c index 506666e21c91..f6471ee9a58c 100644 --- a/drivers/gpu/drm/vkms/vkms_configfs.c +++ b/drivers/gpu/drm/vkms/vkms_configfs.c @@ -769,7 +769,7 @@ static struct config_group *make_device_group(struct config_group *group, if (strcmp(name, DEFAULT_DEVICE_NAME) == 0) return ERR_PTR(-EINVAL); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 9a7db1d51022..f5b99ebb37e3 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -62,7 +62,7 @@ vkms_atomic_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - vkms_state = kzalloc(sizeof(*vkms_state), GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); if (!vkms_state) return NULL; @@ -87,8 +87,8 @@ static void vkms_atomic_crtc_destroy_state(struct drm_crtc *crtc, static void vkms_atomic_crtc_reset(struct drm_crtc *crtc) { - struct vkms_crtc_state *vkms_state = - kzalloc(sizeof(*vkms_state), GFP_KERNEL); + struct vkms_crtc_state *vkms_state = kzalloc_obj(*vkms_state, + GFP_KERNEL); if (crtc->state) vkms_atomic_crtc_destroy_state(crtc, crtc->state); @@ -137,7 +137,8 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, i++; } - vkms_state->active_planes = kcalloc(i, sizeof(*vkms_state->active_planes), GFP_KERNEL); + vkms_state->active_planes = kzalloc_objs(*vkms_state->active_planes, i, + GFP_KERNEL); if (!vkms_state->active_planes) return -ENOMEM; vkms_state->num_active_planes = i; diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index 19fe6acad306..73d3c4af7743 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -56,11 +56,11 @@ vkms_plane_duplicate_state(struct drm_plane *plane) struct vkms_plane_state *vkms_state; struct vkms_frame_info *frame_info; - vkms_state = kzalloc(sizeof(*vkms_state), GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); if (!vkms_state) return NULL; - frame_info = kzalloc(sizeof(*frame_info), GFP_KERNEL); + frame_info = kzalloc_obj(*frame_info, GFP_KERNEL); if (!frame_info) { DRM_DEBUG_KMS("Couldn't allocate frame_info\n"); kfree(vkms_state); @@ -104,7 +104,7 @@ static void vkms_plane_reset(struct drm_plane *plane) plane->state = NULL; /* must be set to NULL here */ } - vkms_state = kzalloc(sizeof(*vkms_state), GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); if (!vkms_state) { DRM_ERROR("Cannot allocate vkms_plane_state\n"); return; diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 097ae1f0a230..1cd760f75779 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -81,7 +81,7 @@ static int vkms_wb_prepare_job(struct drm_writeback_connector *wb_connector, if (!job->fb) return 0; - vkmsjob = kzalloc(sizeof(*vkmsjob), GFP_KERNEL); + vkmsjob = kzalloc_obj(*vkmsjob, GFP_KERNEL); if (!vkmsjob) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.c b/drivers/gpu/drm/vmwgfx/ttm_object.c index 36d46b79562a..23ffb7069d01 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.c +++ b/drivers/gpu/drm/vmwgfx/ttm_object.c @@ -318,7 +318,7 @@ int ttm_ref_object_add(struct ttm_object_file *tfile, if (require_existed) return -EPERM; - ref = kmalloc(sizeof(*ref), GFP_KERNEL); + ref = kmalloc_obj(*ref, GFP_KERNEL); if (unlikely(ref == NULL)) { return -ENOMEM; } @@ -404,7 +404,7 @@ void ttm_object_file_release(struct ttm_object_file **p_tfile) struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev) { - struct ttm_object_file *tfile = kmalloc(sizeof(*tfile), GFP_KERNEL); + struct ttm_object_file *tfile = kmalloc_obj(*tfile, GFP_KERNEL); if (unlikely(tfile == NULL)) return NULL; @@ -422,7 +422,7 @@ struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev) struct ttm_object_device * ttm_object_device_init(const struct dma_buf_ops *ops) { - struct ttm_object_device *tdev = kmalloc(sizeof(*tdev), GFP_KERNEL); + struct ttm_object_device *tdev = kmalloc_obj(*tdev, GFP_KERNEL); if (unlikely(tdev == NULL)) return NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c index fa5841fda659..60ebcfe6d428 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c @@ -586,8 +586,8 @@ int vmw_bo_cpu_blit(struct vmw_bo *vmw_dst, w, h, diff); if (!src->ttm->pages && src->ttm->sg) { - src_pages = kvmalloc_array(src->ttm->num_pages, - sizeof(struct page *), GFP_KERNEL); + src_pages = kvmalloc_objs(struct page *, src->ttm->num_pages, + GFP_KERNEL); if (!src_pages) return -ENOMEM; ret = drm_prime_sg_to_page_array(src->ttm->sg, src_pages, @@ -596,8 +596,8 @@ int vmw_bo_cpu_blit(struct vmw_bo *vmw_dst, goto out; } if (!dst->ttm->pages && dst->ttm->sg) { - dst_pages = kvmalloc_array(dst->ttm->num_pages, - sizeof(struct page *), GFP_KERNEL); + dst_pages = kvmalloc_objs(struct page *, dst->ttm->num_pages, + GFP_KERNEL); if (!dst_pages) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index b22887e8c881..97290b5d65d0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -449,7 +449,7 @@ int vmw_bo_create(struct vmw_private *vmw, { int ret; - *p_bo = kmalloc(sizeof(**p_bo), GFP_KERNEL); + *p_bo = kmalloc_obj(**p_bo, GFP_KERNEL); if (unlikely(!*p_bo)) { DRM_ERROR("Failed to allocate a buffer.\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c index 8fe02131a6c4..cfecea9bfa24 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c @@ -103,7 +103,7 @@ struct vmw_fifo_state *vmw_fifo_create(struct vmw_private *dev_priv) if (!dev_priv->fifo_mem) return NULL; - fifo = kzalloc(sizeof(*fifo), GFP_KERNEL); + fifo = kzalloc_obj(*fifo, GFP_KERNEL); if (!fifo) return ERR_PTR(-ENOMEM); fifo->static_buffer_size = VMWGFX_FIFO_STATIC_SIZE; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index 94e8982f5616..5756af107555 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -961,7 +961,7 @@ void *vmw_cmdbuf_alloc(struct vmw_cmdbuf_man *man, *p_header = NULL; - header = kzalloc(sizeof(*header), GFP_KERNEL); + header = kzalloc_obj(*header, GFP_KERNEL); if (!header) return ERR_PTR(-ENOMEM); @@ -1296,7 +1296,7 @@ struct vmw_cmdbuf_man *vmw_cmdbuf_man_create(struct vmw_private *dev_priv) if (!(dev_priv->capabilities & SVGA_CAP_COMMAND_BUFFERS)) return ERR_PTR(-ENOSYS); - man = kzalloc(sizeof(*man), GFP_KERNEL); + man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c index 47bc0b411055..b8b4834d40fb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c @@ -200,7 +200,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, { struct vmw_cmdbuf_res *cres; - cres = kzalloc(sizeof(*cres), GFP_KERNEL); + cres = kzalloc_obj(*cres, GFP_KERNEL); if (unlikely(!cres)) return -ENOMEM; @@ -284,7 +284,7 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv) { struct vmw_cmdbuf_res_manager *man; - man = kzalloc(sizeof(*man), GFP_KERNEL); + man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c index ecc503e42790..0845c00e777d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c @@ -738,7 +738,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, return -EINVAL; } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (unlikely(!ctx)) { ret = -ENOMEM; goto out_ret; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c index 98331c4c0335..6220a1a0326a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c @@ -604,7 +604,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, int ret; u32 num_entries; - vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL); + vcotbl = kzalloc_obj(*vcotbl, GFP_KERNEL); if (unlikely(!vcotbl)) { ret = -ENOMEM; goto out_no_alloc; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 599052d07ae8..eb5695bcae89 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1209,7 +1209,7 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv) struct vmw_fpriv *vmw_fp; int ret = -ENOMEM; - vmw_fp = kzalloc(sizeof(*vmw_fp), GFP_KERNEL); + vmw_fp = kzalloc_obj(*vmw_fp, GFP_KERNEL); if (unlikely(!vmw_fp)) return ret; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index 85795082fef9..4500771a8f42 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c @@ -129,7 +129,7 @@ static const struct dma_fence_ops vmw_fence_ops = { struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv) { - struct vmw_fence_manager *fman = kzalloc(sizeof(*fman), GFP_KERNEL); + struct vmw_fence_manager *fman = kzalloc_obj(*fman, GFP_KERNEL); if (unlikely(!fman)) return NULL; @@ -251,7 +251,7 @@ int vmw_fence_create(struct vmw_fence_manager *fman, struct vmw_fence_obj *fence; int ret; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (unlikely(!fence)) return -ENOMEM; @@ -298,7 +298,7 @@ int vmw_user_fence_create(struct drm_file *file_priv, struct vmw_fence_obj *tmp; int ret; - ufence = kzalloc(sizeof(*ufence), GFP_KERNEL); + ufence = kzalloc_obj(*ufence, GFP_KERNEL); if (unlikely(!ufence)) { ret = -ENOMEM; goto out_no_object; @@ -580,7 +580,7 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv, struct vmw_event_fence_action *eaction; struct vmw_fence_manager *fman = fman_from_fence(fence); - eaction = kzalloc(sizeof(*eaction), GFP_KERNEL); + eaction = kzalloc_obj(*eaction, GFP_KERNEL); if (unlikely(!eaction)) return -ENOMEM; @@ -612,7 +612,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv, struct drm_device *dev = &fman->dev_priv->drm; int ret; - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (unlikely(!event)) { DRM_ERROR("Failed to allocate an event.\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index 5bd967fbcf55..1a45220d3607 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man, struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man); int id; - *res = kmalloc(sizeof(**res), GFP_KERNEL); + *res = kmalloc_obj(**res, GFP_KERNEL); if (!*res) return -ENOMEM; @@ -154,8 +154,7 @@ static const struct ttm_resource_manager_func vmw_gmrid_manager_func; int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type) { struct ttm_resource_manager *man; - struct vmwgfx_gmrid_man *gman = - kzalloc(sizeof(*gman), GFP_KERNEL); + struct vmwgfx_gmrid_man *gman = kzalloc_obj(*gman, GFP_KERNEL); if (unlikely(!gman)) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 835d1eed8dd9..1c4fc5f0d586 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -196,7 +196,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, goto out_clips; } - clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); if (clips == NULL) { DRM_ERROR("Failed to allocate clip rect list.\n"); ret = -ENOMEM; @@ -273,7 +273,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, goto out_clips; } - clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); if (clips == NULL) { DRM_ERROR("Failed to allocate clip rect list.\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index bc51b5d55e38..ca6aec15f113 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -224,7 +224,7 @@ void vmw_du_crtc_reset(struct drm_crtc *crtc) kfree(vmw_crtc_state_to_vcs(crtc->state)); } - vcs = kzalloc(sizeof(*vcs), GFP_KERNEL); + vcs = kzalloc_obj(*vcs, GFP_KERNEL); if (!vcs) { DRM_ERROR("Cannot allocate vmw_crtc_state\n"); @@ -300,7 +300,7 @@ void vmw_du_plane_reset(struct drm_plane *plane) if (plane->state) vmw_du_plane_destroy_state(plane, plane->state); - vps = kzalloc(sizeof(*vps), GFP_KERNEL); + vps = kzalloc_obj(*vps, GFP_KERNEL); if (!vps) { DRM_ERROR("Cannot allocate vmw_plane_state\n"); @@ -382,7 +382,7 @@ void vmw_du_connector_reset(struct drm_connector *connector) kfree(vmw_connector_state_to_vcs(connector->state)); } - vcs = kzalloc(sizeof(*vcs), GFP_KERNEL); + vcs = kzalloc_obj(*vcs, GFP_KERNEL); if (!vcs) { DRM_ERROR("Cannot allocate vmw_connector_state\n"); @@ -543,7 +543,7 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, return -EINVAL; } - vfbs = kzalloc(sizeof(*vfbs), GFP_KERNEL); + vfbs = kzalloc_obj(*vfbs, GFP_KERNEL); if (!vfbs) { ret = -ENOMEM; goto out_err1; @@ -632,7 +632,7 @@ static int vmw_kms_new_framebuffer_bo(struct vmw_private *dev_priv, return -EINVAL; } - vfbd = kzalloc(sizeof(*vfbd), GFP_KERNEL); + vfbd = kzalloc_obj(*vfbd, GFP_KERNEL); if (!vfbd) { ret = -ENOMEM; goto out_err1; @@ -948,8 +948,8 @@ static int vmw_kms_check_topology(struct drm_device *dev, uint32_t i; int ret = 0; - rects = kcalloc(dev->mode_config.num_crtc, sizeof(struct drm_rect), - GFP_KERNEL); + rects = kzalloc_objs(struct drm_rect, dev->mode_config.num_crtc, + GFP_KERNEL); if (!rects) return -ENOMEM; @@ -1422,8 +1422,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, } rects_size = arg->num_outputs * sizeof(struct drm_vmw_rect); - rects = kcalloc(arg->num_outputs, sizeof(struct drm_vmw_rect), - GFP_KERNEL); + rects = kzalloc_objs(struct drm_vmw_rect, arg->num_outputs, GFP_KERNEL); if (unlikely(!rects)) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index c23c9195f0dc..e07ee831064b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -416,7 +416,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - ldu = kzalloc(sizeof(*ldu), GFP_KERNEL); + ldu = kzalloc_obj(*ldu, GFP_KERNEL); if (!ldu) return -ENOMEM; @@ -547,7 +547,7 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv) return -EINVAL; } - dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL); + dev_priv->ldu_priv = kmalloc_obj(*dev_priv->ldu_priv, GFP_KERNEL); if (!dev_priv->ldu_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c index d8204d4265d3..d29ac15a742b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c @@ -390,7 +390,7 @@ static unsigned long vmw_mob_calculate_pt_pages(unsigned long data_pages) */ struct vmw_mob *vmw_mob_create(unsigned long data_pages) { - struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL); + struct vmw_mob *mob = kzalloc_obj(*mob, GFP_KERNEL); if (unlikely(!mob)) return NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index 1d9a42cbc88f..84237edf1ac0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c @@ -981,10 +981,9 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data, BUG_ON(dev_priv->mksstat_user_pages[slot]); /* Allocate statically-sized temp arrays for pages -- too big to keep in frame */ - pages_stat = (struct page **)kmalloc_array( - ARRAY_SIZE(pdesc->statPPNs) + - ARRAY_SIZE(pdesc->infoPPNs) + - ARRAY_SIZE(pdesc->strsPPNs), sizeof(*pages_stat), GFP_KERNEL); + pages_stat = (struct page **) kmalloc_objs(*pages_stat, + ARRAY_SIZE(pdesc->statPPNs) + ARRAY_SIZE(pdesc->infoPPNs) + ARRAY_SIZE(pdesc->strsPPNs), + GFP_KERNEL); if (!pages_stat) goto err_nomem; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c index e20f64b67b26..9a75a35f605b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c @@ -539,7 +539,7 @@ int vmw_overlay_init(struct vmw_private *dev_priv) if (dev_priv->overlay_priv) return -EINVAL; - overlay = kzalloc(sizeof(*overlay), GFP_KERNEL); + overlay = kzalloc_obj(*overlay, GFP_KERNEL); if (!overlay) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 5f5f5a94301f..37bcdfb585ce 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -811,7 +811,7 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - sou = kzalloc(sizeof(*sou), GFP_KERNEL); + sou = kzalloc_obj(*sou, GFP_KERNEL); if (!sou) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c index a8c8c9375d29..d74d9b72f80d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c @@ -595,7 +595,7 @@ int vmw_dx_shader_add(struct vmw_cmdbuf_res_manager *man, if (!vmw_shader_id_ok(user_key, shader_type)) return -EINVAL; - shader = kmalloc(sizeof(*shader), GFP_KERNEL); + shader = kmalloc_obj(*shader, GFP_KERNEL); if (!shader) { return -ENOMEM; } @@ -696,7 +696,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, struct vmw_resource *res, *tmp; int ret; - ushader = kzalloc(sizeof(*ushader), GFP_KERNEL); + ushader = kzalloc_obj(*ushader, GFP_KERNEL); if (unlikely(!ushader)) { ret = -ENOMEM; goto out; @@ -746,7 +746,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv, struct vmw_resource *res; int ret; - shader = kzalloc(sizeof(*shader), GFP_KERNEL); + shader = kzalloc_obj(*shader, GFP_KERNEL); if (unlikely(!shader)) { ret = -ENOMEM; goto out_err; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 20aab725e53a..14f583ab4bac 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1541,7 +1541,7 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - stdu = kzalloc(sizeof(*stdu), GFP_KERNEL); + stdu = kzalloc_obj(*stdu, GFP_KERNEL); if (!stdu) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c b/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c index edcc40659038..6805c03ae248 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c @@ -284,7 +284,7 @@ int vmw_dx_streamoutput_add(struct vmw_cmdbuf_res_manager *man, struct vmw_private *dev_priv = ctx->dev_priv; int ret; - so = kmalloc(sizeof(*so), GFP_KERNEL); + so = kmalloc_obj(*so, GFP_KERNEL); if (!so) { return -ENOMEM; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index c4ac9b47e23a..9ff2d54d548e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -741,7 +741,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - user_srf = kzalloc(sizeof(*user_srf), GFP_KERNEL); + user_srf = kzalloc_obj(*user_srf, GFP_KERNEL); if (unlikely(!user_srf)) { ret = -ENOMEM; goto out_unlock; @@ -767,8 +767,8 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, ret = PTR_ERR(metadata->sizes); goto out_no_sizes; } - srf->offsets = kmalloc_array(metadata->num_sizes, sizeof(*srf->offsets), - GFP_KERNEL); + srf->offsets = kmalloc_objs(*srf->offsets, metadata->num_sizes, + GFP_KERNEL); if (unlikely(!srf->offsets)) { ret = -ENOMEM; goto out_no_offsets; @@ -2144,7 +2144,7 @@ int vmw_gb_surface_define(struct vmw_private *dev_priv, if (req->sizes != NULL) return -EINVAL; - user_srf = kzalloc(sizeof(*user_srf), GFP_KERNEL); + user_srf = kzalloc_obj(*user_srf, GFP_KERNEL); if (unlikely(!user_srf)) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c index ee7964cbdaca..08b492534fe9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c @@ -37,7 +37,7 @@ static int vmw_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc(sizeof(**res), GFP_KERNEL); + *res = kzalloc_obj(**res, GFP_KERNEL); if (!*res) return -ENOMEM; @@ -60,8 +60,7 @@ static const struct ttm_resource_manager_func vmw_sys_manager_func = { int vmw_sys_man_init(struct vmw_private *dev_priv) { struct ttm_device *bdev = &dev_priv->bdev; - struct ttm_resource_manager *man = - kzalloc(sizeof(*man), GFP_KERNEL); + struct ttm_resource_manager *man = kzalloc_obj(*man, GFP_KERNEL); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index 5553892d7c3e..232c2b8ff520 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -404,7 +404,7 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo, int ret; bool external = bo->type == ttm_bo_type_sg; - vmw_be = kzalloc(sizeof(*vmw_be), GFP_KERNEL); + vmw_be = kzalloc_obj(*vmw_be, GFP_KERNEL); if (!vmw_be) return NULL; diff --git a/drivers/gpu/drm/xe/display/intel_bo.c b/drivers/gpu/drm/xe/display/intel_bo.c index e8049a255d21..89ee5f3491c6 100644 --- a/drivers/gpu/drm/xe/display/intel_bo.c +++ b/drivers/gpu/drm/xe/display/intel_bo.c @@ -57,7 +57,7 @@ struct intel_frontbuffer *intel_bo_frontbuffer_get(struct drm_gem_object *obj) { struct xe_frontbuffer *front; - front = kmalloc(sizeof(*front), GFP_KERNEL); + front = kmalloc_obj(*front, GFP_KERNEL); if (!front) return NULL; diff --git a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c index fa0acb11eaad..1c35eb2def8c 100644 --- a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c +++ b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c @@ -43,7 +43,7 @@ struct intel_dsb_buffer *intel_dsb_buffer_create(struct drm_device *drm, size_t struct xe_bo *obj; int ret; - dsb_buf = kzalloc(sizeof(*dsb_buf), GFP_KERNEL); + dsb_buf = kzalloc_obj(*dsb_buf, GFP_KERNEL); if (!dsb_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c index ed1f65f5ef4d..0266deccb31a 100644 --- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c @@ -95,7 +95,7 @@ static struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_de struct intel_hdcp_gsc_context *gsc_context; int ret; - gsc_context = kzalloc(sizeof(*gsc_context), GFP_KERNEL); + gsc_context = kzalloc_obj(*gsc_context, GFP_KERNEL); if (!gsc_context) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/display/xe_panic.c b/drivers/gpu/drm/xe/display/xe_panic.c index e078494dc8ba..e68abd9268f2 100644 --- a/drivers/gpu/drm/xe/display/xe_panic.c +++ b/drivers/gpu/drm/xe/display/xe_panic.c @@ -79,7 +79,7 @@ static struct intel_panic *xe_panic_alloc(void) { struct intel_panic *panic; - panic = kzalloc(sizeof(*panic), GFP_KERNEL); + panic = kzalloc_obj(*panic, GFP_KERNEL); return panic; } diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c index 8dc2f86ec602..fac3d60e8a31 100644 --- a/drivers/gpu/drm/xe/display/xe_stolen.c +++ b/drivers/gpu/drm/xe/display/xe_stolen.c @@ -86,7 +86,7 @@ static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm) struct xe_device *xe = to_xe_device(drm); struct intel_stolen_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c index b7d8e45804cf..acbc7802cc5e 100644 --- a/drivers/gpu/drm/xe/tests/xe_bo.c +++ b/drivers/gpu/drm/xe/tests/xe_bo.c @@ -482,7 +482,7 @@ static int shrink_test_run_device(struct xe_device *xe) unsigned int mem_type; struct xe_ttm_tt *xe_tt; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) { KUNIT_FAIL(test, "Unexpected link allocation failure\n"); failed = true; diff --git a/drivers/gpu/drm/xe/xe_bb.c b/drivers/gpu/drm/xe/xe_bb.c index 8b678297aaa2..18236fbe8e63 100644 --- a/drivers/gpu/drm/xe/xe_bb.c +++ b/drivers/gpu/drm/xe/xe_bb.c @@ -31,7 +31,7 @@ static int bb_prefetch(struct xe_gt *gt) struct xe_bb *xe_bb_new(struct xe_gt *gt, u32 dwords, bool usm) { struct xe_tile *tile = gt_to_tile(gt); - struct xe_bb *bb = kmalloc(sizeof(*bb), GFP_KERNEL); + struct xe_bb *bb = kmalloc_obj(*bb, GFP_KERNEL); int err; if (!bb) @@ -62,7 +62,7 @@ err: struct xe_bb *xe_bb_ccs_new(struct xe_gt *gt, u32 dwords, enum xe_sriov_vf_ccs_rw_ctxs ctx_id) { - struct xe_bb *bb = kmalloc(sizeof(*bb), GFP_KERNEL); + struct xe_bb *bb = kmalloc_obj(*bb, GFP_KERNEL); struct xe_device *xe = gt_to_xe(gt); struct xe_sa_manager *bb_pool; int err; diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index 5dd8fcacbb80..31eacbbfe50a 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -480,7 +480,7 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo, enum ttm_caching caching = ttm_cached; int err; - xe_tt = kzalloc(sizeof(*xe_tt), GFP_KERNEL); + xe_tt = kzalloc_obj(*xe_tt, GFP_KERNEL); if (!xe_tt) return NULL; @@ -2089,7 +2089,7 @@ static const struct drm_gem_object_funcs xe_gem_object_funcs = { */ struct xe_bo *xe_bo_alloc(void) { - struct xe_bo *bo = kzalloc(sizeof(*bo), GFP_KERNEL); + struct xe_bo *bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index 82edd0466005..b58191735e31 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -998,7 +998,7 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro if (!match) return ERR_PTR(-ENOENT); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_dep_scheduler.c b/drivers/gpu/drm/xe/xe_dep_scheduler.c index 9bd3bfd2e526..f1620711fbd2 100644 --- a/drivers/gpu/drm/xe/xe_dep_scheduler.c +++ b/drivers/gpu/drm/xe/xe_dep_scheduler.c @@ -86,7 +86,7 @@ xe_dep_scheduler_create(struct xe_device *xe, }; int err; - dep_scheduler = kzalloc(sizeof(*dep_scheduler), GFP_KERNEL); + dep_scheduler = kzalloc_obj(*dep_scheduler, GFP_KERNEL); if (!dep_scheduler) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 1581f4dab69d..f96d992b2ca4 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -86,7 +86,7 @@ static int xe_file_open(struct drm_device *dev, struct drm_file *file) int ret = -ENOMEM; struct task_struct *task = NULL; - xef = kzalloc(sizeof(*xef), GFP_KERNEL); + xef = kzalloc_obj(*xef, GFP_KERNEL); if (!xef) return ret; diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c index 2787bbb36141..b7284acc379c 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -88,7 +88,7 @@ struct xe_drm_client *xe_drm_client_alloc(void) { struct xe_drm_client *client; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return NULL; diff --git a/drivers/gpu/drm/xe/xe_eu_stall.c b/drivers/gpu/drm/xe/xe_eu_stall.c index a5c36a317a70..a9fa39bfeca7 100644 --- a/drivers/gpu/drm/xe/xe_eu_stall.c +++ b/drivers/gpu/drm/xe/xe_eu_stall.c @@ -238,7 +238,7 @@ int xe_eu_stall_init(struct xe_gt *gt) if (!xe_eu_stall_supported_on_platform(xe)) return 0; - gt->eu_stall = kzalloc(sizeof(*gt->eu_stall), GFP_KERNEL); + gt->eu_stall = kzalloc_obj(*gt->eu_stall, GFP_KERNEL); if (!gt->eu_stall) { ret = -ENOMEM; goto exit; @@ -636,7 +636,8 @@ static int xe_eu_stall_data_buf_alloc(struct xe_eu_stall_data_stream *stream, struct xe_bo *bo; u32 size; - stream->xecore_buf = kcalloc(last_xecore, sizeof(*stream->xecore_buf), GFP_KERNEL); + stream->xecore_buf = kzalloc_objs(*stream->xecore_buf, last_xecore, + GFP_KERNEL); if (!stream->xecore_buf) return -ENOMEM; @@ -905,7 +906,7 @@ static int xe_eu_stall_stream_open_locked(struct drm_device *dev, return -EBUSY; } - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c index dbe6c006f1d6..45b7a7fd7a3b 100644 --- a/drivers/gpu/drm/xe/xe_exec.c +++ b/drivers/gpu/drm/xe/xe_exec.c @@ -162,7 +162,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file) } if (args->num_syncs) { - syncs = kcalloc(args->num_syncs, sizeof(*syncs), GFP_KERNEL); + syncs = kzalloc_objs(*syncs, args->num_syncs, GFP_KERNEL); if (!syncs) { err = -ENOMEM; goto err_exec_queue; diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 9b6311f7fd4f..36b0bd32e2a6 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -208,7 +208,7 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, /* only kernel queues can be permanent */ XE_WARN_ON((flags & EXEC_QUEUE_FLAG_PERMANENT) && !(flags & EXEC_QUEUE_FLAG_KERNEL)); - q = kzalloc(struct_size(q, lrc, width), GFP_KERNEL); + q = kzalloc_flex(*q, lrc, width, GFP_KERNEL); if (!q) return ERR_PTR(-ENOMEM); @@ -681,7 +681,7 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue * struct xe_exec_queue_group *group; struct xe_bo *bo; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c index 8bf330aeaec0..405069c72773 100644 --- a/drivers/gpu/drm/xe/xe_execlist.c +++ b/drivers/gpu/drm/xe/xe_execlist.c @@ -352,7 +352,7 @@ static int execlist_exec_queue_init(struct xe_exec_queue *q) drm_info(&xe->drm, "Enabling execlist submission (GuC submission disabled)\n"); - exl = kzalloc(sizeof(*exl), GFP_KERNEL); + exl = kzalloc_obj(*exl, GFP_KERNEL); if (!exl) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 60665ad1415b..2bda426a6986 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -702,7 +702,7 @@ int xe_ggtt_node_insert(struct xe_ggtt_node *node, u32 size, u32 align) **/ struct xe_ggtt_node *xe_ggtt_node_init(struct xe_ggtt *ggtt) { - struct xe_ggtt_node *node = kzalloc(sizeof(*node), GFP_NOFS); + struct xe_ggtt_node *node = kzalloc_obj(*node, GFP_NOFS); if (!node) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c index f97abb02aebd..8f45a1e72e1c 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c @@ -710,7 +710,7 @@ static int config_blob_open(struct inode *inode, struct file *file) if (ret < 0) return ret; - cbd = kzalloc(struct_size(cbd, blob, ret), GFP_KERNEL); + cbd = kzalloc_flex(*cbd, blob, ret, GFP_KERNEL); if (!cbd) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c index 1448be047b4a..e2ab22643c63 100644 --- a/drivers/gpu/drm/xe/xe_gt_sysfs.c +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c @@ -36,7 +36,7 @@ int xe_gt_sysfs_init(struct xe_gt *gt) struct kobj_gt *kg; int err; - kg = kzalloc(sizeof(*kg), GFP_KERNEL); + kg = kzalloc_obj(*kg, GFP_KERNEL); if (!kg) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index dfbf76037b04..d04589140b77 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -1957,7 +1957,7 @@ static struct xe_guc_ct_snapshot *guc_ct_snapshot_alloc(struct xe_guc_ct *ct, bo { struct xe_guc_ct_snapshot *snapshot; - snapshot = kzalloc(sizeof(*snapshot), atomic ? GFP_ATOMIC : GFP_KERNEL); + snapshot = kzalloc_obj(*snapshot, atomic ? GFP_ATOMIC : GFP_KERNEL); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c index acac66a4eca7..538d4df0f7aa 100644 --- a/drivers/gpu/drm/xe/xe_guc_log.c +++ b/drivers/gpu/drm/xe/xe_guc_log.c @@ -116,7 +116,7 @@ static struct xe_guc_log_snapshot *xe_guc_log_snapshot_alloc(struct xe_guc_log * size_t remain; int i; - snapshot = kzalloc(sizeof(*snapshot), atomic ? GFP_ATOMIC : GFP_KERNEL); + snapshot = kzalloc_obj(*snapshot, atomic ? GFP_ATOMIC : GFP_KERNEL); if (!snapshot) return NULL; @@ -128,8 +128,8 @@ static struct xe_guc_log_snapshot *xe_guc_log_snapshot_alloc(struct xe_guc_log * snapshot->size = xe_bo_size(log->bo); snapshot->num_chunks = DIV_ROUND_UP(snapshot->size, GUC_LOG_CHUNK_SIZE); - snapshot->copy = kcalloc(snapshot->num_chunks, sizeof(*snapshot->copy), - atomic ? GFP_ATOMIC : GFP_KERNEL); + snapshot->copy = kzalloc_objs(*snapshot->copy, snapshot->num_chunks, + atomic ? GFP_ATOMIC : GFP_KERNEL); if (!snapshot->copy) goto fail_snap; diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 1b2f66f4425b..e15a38ff7354 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1903,7 +1903,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) xe_gt_assert(guc_to_gt(guc), xe_device_uc_enabled(guc_to_xe(guc))); - ge = kzalloc(sizeof(*ge), GFP_KERNEL); + ge = kzalloc_obj(*ge, GFP_KERNEL); if (!ge) return -ENOMEM; @@ -2057,7 +2057,7 @@ static int guc_exec_queue_set_priority(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -2075,7 +2075,7 @@ static int guc_exec_queue_set_timeslice(struct xe_exec_queue *q, u32 timeslice_u exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -2094,7 +2094,7 @@ static int guc_exec_queue_set_preempt_timeout(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -2115,7 +2115,7 @@ static int guc_exec_queue_set_multi_queue_priority(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -3128,7 +3128,7 @@ xe_guc_exec_queue_snapshot_capture(struct xe_exec_queue *q) struct xe_guc_submit_exec_queue_snapshot *snapshot; int i; - snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); + snapshot = kzalloc_obj(*snapshot, GFP_ATOMIC); if (!snapshot) return NULL; @@ -3144,8 +3144,8 @@ xe_guc_exec_queue_snapshot_capture(struct xe_exec_queue *q) snapshot->sched_props.preempt_timeout_us = q->sched_props.preempt_timeout_us; - snapshot->lrc = kmalloc_array(q->width, sizeof(struct xe_lrc_snapshot *), - GFP_ATOMIC); + snapshot->lrc = kmalloc_objs(struct xe_lrc_snapshot *, q->width, + GFP_ATOMIC); if (snapshot->lrc) { for (i = 0; i < q->width; ++i) { diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c index c1f15313f92e..1e0eeb77427c 100644 --- a/drivers/gpu/drm/xe/xe_heci_gsc.c +++ b/drivers/gpu/drm/xe/xe_heci_gsc.c @@ -131,7 +131,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def * struct mei_aux_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; adev->irq = heci_gsc->irq; diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c index 4d3ee5226e3a..688d645e0e73 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine.c +++ b/drivers/gpu/drm/xe/xe_hw_engine.c @@ -927,7 +927,7 @@ xe_hw_engine_snapshot_capture(struct xe_hw_engine *hwe, struct xe_exec_queue *q) if (!xe_hw_engine_is_valid(hwe)) return NULL; - snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC); + snapshot = kzalloc_obj(*snapshot, GFP_ATOMIC); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c index 3c65becb39ad..4425a1ce140f 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c @@ -549,7 +549,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char struct kobj_eclass *keclass; int err = 0; - keclass = kzalloc(sizeof(*keclass), GFP_KERNEL); + keclass = kzalloc_obj(*keclass, GFP_KERNEL); if (!keclass) return NULL; @@ -582,7 +582,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe, struct kobject *kobj; int err = 0; - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + kobj = kzalloc_obj(*kobj, GFP_KERNEL); if (!kobj) return -ENOMEM; @@ -629,7 +629,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt) u16 class_mask = 0; int err = 0; - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + kobj = kzalloc_obj(*kobj, GFP_KERNEL); if (!kobj) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_lmtt.c b/drivers/gpu/drm/xe/xe_lmtt.c index 2077e1ef8b43..0cff46a0f1f6 100644 --- a/drivers/gpu/drm/xe/xe_lmtt.c +++ b/drivers/gpu/drm/xe/xe_lmtt.c @@ -64,7 +64,7 @@ static struct xe_lmtt_pt *lmtt_pt_alloc(struct xe_lmtt *lmtt, unsigned int level struct xe_bo *bo; int err; - pt = kzalloc(struct_size(pt, entries, num_entries), GFP_KERNEL); + pt = kzalloc_flex(*pt, entries, num_entries, GFP_KERNEL); if (!pt) { err = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index 3db7968aa5e2..4b2091d552fd 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1616,7 +1616,7 @@ struct xe_lrc *xe_lrc_create(struct xe_hw_engine *hwe, struct xe_vm *vm, struct xe_lrc *lrc; int err; - lrc = kzalloc(sizeof(*lrc), GFP_KERNEL); + lrc = kzalloc_obj(*lrc, GFP_KERNEL); if (!lrc) return ERR_PTR(-ENOMEM); @@ -2269,7 +2269,7 @@ u32 *xe_lrc_emit_hwe_state_instructions(struct xe_exec_queue *q, u32 *cs) struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc) { - struct xe_lrc_snapshot *snapshot = kmalloc(sizeof(*snapshot), GFP_NOWAIT); + struct xe_lrc_snapshot *snapshot = kmalloc_obj(*snapshot, GFP_NOWAIT); if (!snapshot) return NULL; diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 078a9bc2821d..9d463a48a4d4 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -2303,7 +2303,7 @@ static struct drm_pagemap_addr *xe_migrate_dma_map(struct xe_device *xe, struct drm_pagemap_addr *pagemap_addr; unsigned long i, npages = DIV_ROUND_UP(len, PAGE_SIZE); - pagemap_addr = kcalloc(npages, sizeof(*pagemap_addr), GFP_KERNEL); + pagemap_addr = kzalloc_objs(*pagemap_addr, npages, GFP_KERNEL); if (!pagemap_addr) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_mmio_gem.c b/drivers/gpu/drm/xe/xe_mmio_gem.c index 9a97c4387e4f..c4fb55d2dcce 100644 --- a/drivers/gpu/drm/xe/xe_mmio_gem.c +++ b/drivers/gpu/drm/xe/xe_mmio_gem.c @@ -78,7 +78,7 @@ struct xe_mmio_gem *xe_mmio_gem_create(struct xe_device *xe, struct drm_file *fi if ((phys_addr % PAGE_SIZE != 0) || (size % PAGE_SIZE != 0)) return ERR_PTR(-EINVAL); - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_nvm.c b/drivers/gpu/drm/xe/xe_nvm.c index 6f9dd519371c..fb5eb9099921 100644 --- a/drivers/gpu/drm/xe/xe_nvm.c +++ b/drivers/gpu/drm/xe/xe_nvm.c @@ -133,7 +133,7 @@ int xe_nvm_init(struct xe_device *xe) if (WARN_ON(xe->nvm)) return -EFAULT; - xe->nvm = kzalloc(sizeof(*nvm), GFP_KERNEL); + xe->nvm = kzalloc_obj(*nvm, GFP_KERNEL); if (!xe->nvm) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c index abf87fe0b345..283cd72ef40b 100644 --- a/drivers/gpu/drm/xe/xe_oa.c +++ b/drivers/gpu/drm/xe/xe_oa.c @@ -905,7 +905,7 @@ __xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa size_t config_length; struct xe_bb *bb; - oa_bo = kzalloc(sizeof(*oa_bo), GFP_KERNEL); + oa_bo = kzalloc_obj(*oa_bo, GFP_KERNEL); if (!oa_bo) return ERR_PTR(-ENOMEM); @@ -997,7 +997,7 @@ static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config int i, err, num_signal = 0; struct dma_fence *fence; - ofence = kzalloc(sizeof(*ofence), GFP_KERNEL); + ofence = kzalloc_obj(*ofence, GFP_KERNEL); if (!ofence) { err = -ENOMEM; goto exit; @@ -1408,7 +1408,8 @@ static int xe_oa_parse_syncs(struct xe_oa *oa, } if (param->num_syncs) { - param->syncs = kcalloc(param->num_syncs, sizeof(*param->syncs), GFP_KERNEL); + param->syncs = kzalloc_objs(*param->syncs, param->num_syncs, + GFP_KERNEL); if (!param->syncs) { ret = -ENOMEM; goto exit; @@ -1852,7 +1853,7 @@ static int xe_oa_stream_open_ioctl_locked(struct xe_oa *oa, if (ret) goto exit; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) { ret = -ENOMEM; goto err_syncobj; @@ -2259,7 +2260,7 @@ xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr), int err; u32 i; - oa_regs = kmalloc_array(n_regs, sizeof(*oa_regs), GFP_KERNEL); + oa_regs = kmalloc_objs(*oa_regs, n_regs, GFP_KERNEL); if (!oa_regs) return ERR_PTR(-ENOMEM); @@ -2361,7 +2362,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi XE_IOCTL_DBG(oa->xe, !arg->n_regs)) return -EINVAL; - oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); if (!oa_config) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c index 0b20059dd7b3..ac8303509d48 100644 --- a/drivers/gpu/drm/xe/xe_pmu.c +++ b/drivers/gpu/drm/xe/xe_pmu.c @@ -142,7 +142,7 @@ static bool event_gt_forcewake(struct perf_event *event) gt = xe_device_get_gt(xe, config_to_gt_id(config)); - fw_ref = kzalloc(sizeof(*fw_ref), GFP_KERNEL); + fw_ref = kzalloc_obj(*fw_ref, GFP_KERNEL); if (!fw_ref) return false; diff --git a/drivers/gpu/drm/xe/xe_preempt_fence.c b/drivers/gpu/drm/xe/xe_preempt_fence.c index 7f587ca3947d..85c792ee0818 100644 --- a/drivers/gpu/drm/xe/xe_preempt_fence.c +++ b/drivers/gpu/drm/xe/xe_preempt_fence.c @@ -101,7 +101,7 @@ struct xe_preempt_fence *xe_preempt_fence_alloc(void) { struct xe_preempt_fence *pfence; - pfence = kmalloc(sizeof(*pfence), GFP_KERNEL); + pfence = kmalloc_obj(*pfence, GFP_KERNEL); if (!pfence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 6703a7049227..5d3a84baa80b 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -109,11 +109,11 @@ struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile, int err; if (level) { - struct xe_pt_dir *dir = kzalloc(sizeof(*dir), GFP_KERNEL); + struct xe_pt_dir *dir = kzalloc_obj(*dir, GFP_KERNEL); pt = (dir) ? &dir->pt : NULL; } else { - pt = kzalloc(sizeof(*pt), GFP_KERNEL); + pt = kzalloc_obj(*pt, GFP_KERNEL); } if (!pt) return ERR_PTR(-ENOMEM); @@ -368,9 +368,8 @@ xe_pt_new_shared(struct xe_walk_update *wupd, struct xe_pt *parent, entry->pt_bo->update_index = -1; if (alloc_entries) { - entry->pt_entries = kmalloc_array(XE_PDES, - sizeof(*entry->pt_entries), - GFP_KERNEL); + entry->pt_entries = kmalloc_objs(*entry->pt_entries, XE_PDES, + GFP_KERNEL); if (!entry->pt_entries) return -ENOMEM; } @@ -2574,7 +2573,7 @@ xe_pt_update_ops_run(struct xe_tile *tile, struct xe_vma_ops *vops) } } - rfence = kzalloc(sizeof(*rfence), GFP_KERNEL); + rfence = kzalloc_obj(*rfence, GFP_KERNEL); if (!rfence) { err = -ENOMEM; goto free_ijob; diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c index d3e13ea33123..80532bbce727 100644 --- a/drivers/gpu/drm/xe/xe_reg_sr.c +++ b/drivers/gpu/drm/xe/xe_reg_sr.c @@ -89,7 +89,7 @@ int xe_reg_sr_add(struct xe_reg_sr *sr, return 0; } - pentry = kmalloc(sizeof(*pentry), GFP_KERNEL); + pentry = kmalloc_obj(*pentry, GFP_KERNEL); if (!pentry) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c index 90244fe59b59..f798404ac337 100644 --- a/drivers/gpu/drm/xe/xe_shrinker.c +++ b/drivers/gpu/drm/xe/xe_shrinker.c @@ -282,7 +282,7 @@ static void xe_shrinker_fini(struct drm_device *drm, void *arg) */ int xe_shrinker_create(struct xe_device *xe) { - struct xe_shrinker *shrinker = kzalloc(sizeof(*shrinker), GFP_KERNEL); + struct xe_shrinker *shrinker = kzalloc_obj(*shrinker, GFP_KERNEL); if (!shrinker) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_sriov_packet.c b/drivers/gpu/drm/xe/xe_sriov_packet.c index 7a4c3de662e5..26905bc61979 100644 --- a/drivers/gpu/drm/xe/xe_sriov_packet.c +++ b/drivers/gpu/drm/xe/xe_sriov_packet.c @@ -89,7 +89,7 @@ struct xe_sriov_packet *xe_sriov_packet_alloc(struct xe_device *xe) { struct xe_sriov_packet *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c index 82a1055985ba..457676713402 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c @@ -364,7 +364,7 @@ static struct kobject *create_xe_sriov_kobj(struct xe_device *xe, unsigned int v xe_sriov_pf_assert_vfid(xe, vfid); - vkobj = kzalloc(sizeof(*vkobj), GFP_KERNEL); + vkobj = kzalloc_obj(*vkobj, GFP_KERNEL); if (!vkobj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index 78f4b2c60670..ead9a61b1cdb 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -109,7 +109,7 @@ xe_svm_range_alloc(struct drm_gpusvm *gpusvm) { struct xe_svm_range *range; - range = kzalloc(sizeof(*range), GFP_KERNEL); + range = kzalloc_obj(*range, GFP_KERNEL); if (!range) return NULL; @@ -1748,7 +1748,7 @@ static struct xe_pagemap *xe_pagemap_create(struct xe_device *xe, struct xe_vram void *addr; int err; - xpagemap = kzalloc(sizeof(*xpagemap), GFP_KERNEL); + xpagemap = kzalloc_obj(*xpagemap, GFP_KERNEL); if (!xpagemap) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index c8fdcdbd6ae7..69a723a8c68e 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -59,7 +59,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr, if (get_user(prefetch_val, ptr)) return ERR_PTR(-EFAULT); - ufence = kzalloc(sizeof(*ufence), GFP_KERNEL); + ufence = kzalloc_obj(*ufence, GFP_KERNEL); if (!ufence) return ERR_PTR(-ENOMEM); @@ -343,8 +343,7 @@ xe_sync_in_fence_get(struct xe_sync_entry *sync, int num_sync, num_fence++; } - fences = kmalloc_array(num_fence, sizeof(*fences), - GFP_KERNEL); + fences = kmalloc_objs(*fences, num_fence, GFP_KERNEL); if (!fences) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c index 9e1236a9ec67..39f04b309e73 100644 --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c @@ -36,7 +36,7 @@ int xe_tile_sysfs_init(struct xe_tile *tile) struct kobj_tile *kt; int err; - kt = kzalloc(sizeof(*kt), GFP_KERNEL); + kt = kzalloc_obj(*kt, GFP_KERNEL); if (!kt) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_tlb_inval_job.c b/drivers/gpu/drm/xe/xe_tlb_inval_job.c index 01c413a2537e..0560605588db 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval_job.c +++ b/drivers/gpu/drm/xe/xe_tlb_inval_job.c @@ -108,7 +108,7 @@ xe_tlb_inval_job_create(struct xe_exec_queue *q, struct xe_tlb_inval *tlb_inval, xe_assert(vm->xe, type == XE_EXEC_QUEUE_TLB_INVAL_MEDIA_GT || type == XE_EXEC_QUEUE_TLB_INVAL_PRIMARY_GT); - job = kmalloc(sizeof(*job), GFP_KERNEL); + job = kmalloc_obj(*job, GFP_KERNEL); if (!job) return ERR_PTR(-ENOMEM); @@ -125,7 +125,7 @@ xe_tlb_inval_job_create(struct xe_exec_queue *q, struct xe_tlb_inval *tlb_inval, xe_exec_queue_get(q); /* Pairs with put in xe_tlb_inval_job_destroy */ xe_vm_get(vm); /* Pairs with put in xe_tlb_inval_job_destroy */ - ifence = kmalloc(sizeof(*ifence), GFP_KERNEL); + ifence = kmalloc_obj(*ifence, GFP_KERNEL); if (!ifence) { err = -ENOMEM; goto err_job; diff --git a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c index 99fb7e99eb7f..18d58ad574cf 100644 --- a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c @@ -33,7 +33,7 @@ static int xe_ttm_sys_mgr_new(struct ttm_resource_manager *man, struct xe_ttm_sys_node *node; int r; - node = kzalloc(struct_size(node, base.mm_nodes, 1), GFP_KERNEL); + node = kzalloc_flex(*node, base.mm_nodes, 1, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c index 6553a19f7cf2..93ad02ec76eb 100644 --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c @@ -64,7 +64,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, if (tbo->base.size >> PAGE_SHIFT > (lpfn - place->fpfn)) return -E2BIG; /* don't trigger eviction for the impossible */ - vres = kzalloc(sizeof(*vres), GFP_KERNEL); + vres = kzalloc_obj(*vres, GFP_KERNEL); if (!vres) return -ENOMEM; @@ -371,7 +371,7 @@ int xe_ttm_vram_mgr_alloc_sgt(struct xe_device *xe, if (vres->used_visible_size < res->size) return -EOPNOTSUPP; - *sgt = kmalloc(sizeof(**sgt), GFP_KERNEL); + *sgt = kmalloc_obj(**sgt, GFP_KERNEL); if (!*sgt) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index dd6d99d7fca8..b53d76dc62b2 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -586,9 +586,9 @@ static int xe_vma_ops_alloc(struct xe_vma_ops *vops, bool array_of_binds) continue; vops->pt_update_ops[i].ops = - kmalloc_array(vops->pt_update_ops[i].num_ops, - sizeof(*vops->pt_update_ops[i].ops), - GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + kmalloc_objs(*vops->pt_update_ops[i].ops, + vops->pt_update_ops[i].num_ops, + GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!vops->pt_update_ops[i].ops) return array_of_binds ? -ENOBUFS : -ENOMEM; } @@ -667,7 +667,7 @@ static int xe_vm_ops_add_rebind(struct xe_vma_ops *vops, struct xe_vma *vma, { struct xe_vma_op *op; - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (!op) return -ENOMEM; @@ -803,7 +803,7 @@ xe_vm_ops_add_range_rebind(struct xe_vma_ops *vops, { struct xe_vma_op *op; - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (!op) return -ENOMEM; @@ -889,7 +889,7 @@ xe_vm_ops_add_range_unbind(struct xe_vma_ops *vops, { struct xe_vma_op *op; - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (!op) return -ENOMEM; @@ -1008,14 +1008,14 @@ static struct xe_vma *xe_vma_create(struct xe_vm *vm, * matches what was allocated. */ if (!bo && !is_null && !is_cpu_addr_mirror) { - struct xe_userptr_vma *uvma = kzalloc(sizeof(*uvma), GFP_KERNEL); + struct xe_userptr_vma *uvma = kzalloc_obj(*uvma, GFP_KERNEL); if (!uvma) return ERR_PTR(-ENOMEM); vma = &uvma->vma; } else { - vma = kzalloc(sizeof(*vma), GFP_KERNEL); + vma = kzalloc_obj(*vma, GFP_KERNEL); if (!vma) return ERR_PTR(-ENOMEM); @@ -1235,7 +1235,7 @@ static struct drm_gpuva_op *xe_vm_op_alloc(void) { struct xe_vma_op *op; - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (unlikely(!op)) return NULL; @@ -3161,7 +3161,7 @@ static struct dma_fence *ops_execute(struct xe_vm *vm, ++n_fence; } - fences = kmalloc_array(n_fence, sizeof(*fences), GFP_KERNEL); + fences = kmalloc_objs(*fences, n_fence, GFP_KERNEL); if (!fences) { fence = ERR_PTR(-ENOMEM); goto err_trace; @@ -3373,10 +3373,9 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe, struct xe_vm *vm, u64 __user *bind_user = u64_to_user_ptr(args->vector_of_binds); - *bind_ops = kvmalloc_array(args->num_binds, - sizeof(struct drm_xe_vm_bind_op), - GFP_KERNEL | __GFP_ACCOUNT | - __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + *bind_ops = kvmalloc_objs(struct drm_xe_vm_bind_op, + args->num_binds, + GFP_KERNEL | __GFP_ACCOUNT | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!*bind_ops) return args->num_binds > 1 ? -ENOBUFS : -ENOMEM; @@ -3663,17 +3662,15 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file) } if (args->num_binds) { - bos = kvcalloc(args->num_binds, sizeof(*bos), - GFP_KERNEL | __GFP_ACCOUNT | - __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + bos = kvzalloc_objs(*bos, args->num_binds, + GFP_KERNEL | __GFP_ACCOUNT | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!bos) { err = -ENOMEM; goto release_vm_lock; } - ops = kvcalloc(args->num_binds, sizeof(*ops), - GFP_KERNEL | __GFP_ACCOUNT | - __GFP_RETRY_MAYFAIL | __GFP_NOWARN); + ops = kvzalloc_objs(*ops, args->num_binds, + GFP_KERNEL | __GFP_ACCOUNT | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); if (!ops) { err = -ENOMEM; goto free_bos; @@ -3708,7 +3705,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file) } if (args->num_syncs) { - syncs = kcalloc(args->num_syncs, sizeof(*syncs), GFP_KERNEL); + syncs = kzalloc_objs(*syncs, args->num_syncs, GFP_KERNEL); if (!syncs) { err = -ENOMEM; goto put_obj; diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c b/drivers/gpu/drm/xe/xe_vm_madvise.c index 52147f5eaaa0..c5605e9d9090 100644 --- a/drivers/gpu/drm/xe/xe_vm_madvise.c +++ b/drivers/gpu/drm/xe/xe_vm_madvise.c @@ -47,7 +47,8 @@ static int get_vmas(struct xe_vm *vm, struct xe_vmas_in_madvise_range *madvise_r lockdep_assert_held(&vm->lock); madvise_range->num_vmas = 0; - madvise_range->vmas = kmalloc_array(max_vmas, sizeof(*madvise_range->vmas), GFP_KERNEL); + madvise_range->vmas = kmalloc_objs(*madvise_range->vmas, max_vmas, + GFP_KERNEL); if (!madvise_range->vmas) return -ENOMEM; diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 4fa45dbe1dcb..79dce72c9bc4 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -171,7 +171,7 @@ int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, if (unlikely(!evtchnl)) return -EIO; - dbuf = kzalloc(sizeof(*dbuf), GFP_KERNEL); + dbuf = kzalloc_obj(*dbuf, GFP_KERNEL); if (!dbuf) return -ENOMEM; @@ -496,7 +496,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) DRM_INFO("Creating %s\n", xen_drm_driver.desc); - drm_info = kzalloc(sizeof(*drm_info), GFP_KERNEL); + drm_info = kzalloc_obj(*drm_info, GFP_KERNEL); if (!drm_info) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c index e52afd792346..88cc85395791 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c +++ b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c @@ -212,9 +212,8 @@ int xen_drm_front_evtchnl_create_all(struct xen_drm_front_info *front_info) cfg = &front_info->cfg; front_info->evt_pairs = - kcalloc(cfg->num_connectors, - sizeof(struct xen_drm_front_evtchnl_pair), - GFP_KERNEL); + kzalloc_objs(struct xen_drm_front_evtchnl_pair, + cfg->num_connectors, GFP_KERNEL); if (!front_info->evt_pairs) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c index 386ae7441093..afad19fe01d2 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c @@ -47,8 +47,8 @@ static int gem_alloc_pages_array(struct xen_gem_object *xen_obj, size_t buf_size) { xen_obj->num_pages = DIV_ROUND_UP(buf_size, PAGE_SIZE); - xen_obj->pages = kvmalloc_array(xen_obj->num_pages, - sizeof(struct page *), GFP_KERNEL); + xen_obj->pages = kvmalloc_objs(struct page *, xen_obj->num_pages, + GFP_KERNEL); return !xen_obj->pages ? -ENOMEM : 0; } @@ -118,7 +118,7 @@ static struct xen_gem_object *gem_create_obj(struct drm_device *dev, struct xen_gem_object *xen_obj; int ret; - xen_obj = kzalloc(sizeof(*xen_obj), GFP_KERNEL); + xen_obj = kzalloc_obj(*xen_obj, GFP_KERNEL); if (!xen_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 80d1e499a18d..db1053161e35 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1360,7 +1360,7 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) struct zynqmp_disp *disp; int ret; - disp = kzalloc(sizeof(*disp), GFP_KERNEL); + disp = kzalloc_obj(*disp, GFP_KERNEL); if (!disp) return -ENOMEM; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 34ddbf98e81d..4f21dc062170 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1739,7 +1739,7 @@ static const struct drm_edid *zynqmp_dp_bridge_edid_read(struct drm_bridge *brid static u32 *zynqmp_dp_bridge_default_bus_fmts(unsigned int *num_input_fmts) { - u32 *formats = kzalloc(sizeof(*formats), GFP_KERNEL); + u32 *formats = kzalloc_obj(*formats, GFP_KERNEL); if (formats) *formats = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index 2764c4b17c5e..137d3e85e0fb 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -189,7 +189,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) int ret; /* Allocate private data. */ - dpsub = kzalloc(sizeof(*dpsub), GFP_KERNEL); + dpsub = kzalloc_obj(*dpsub, GFP_KERNEL); if (!dpsub) return -ENOMEM; diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index e2673bc7cb31..b0c12d63d7b4 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -43,7 +43,7 @@ static int host1x_subdev_add(struct host1x_device *device, struct host1x_subdev *subdev; int err; - subdev = kzalloc(sizeof(*subdev), GFP_KERNEL); + subdev = kzalloc_obj(*subdev, GFP_KERNEL); if (!subdev) return -ENOMEM; @@ -459,7 +459,7 @@ static int host1x_device_add(struct host1x *host1x, struct host1x_device *device; int err; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return -ENOMEM; diff --git a/drivers/gpu/host1x/channel.c b/drivers/gpu/host1x/channel.c index 08077afe4cde..b2d434746167 100644 --- a/drivers/gpu/host1x/channel.c +++ b/drivers/gpu/host1x/channel.c @@ -16,8 +16,8 @@ int host1x_channel_list_init(struct host1x_channel_list *chlist, unsigned int num_channels) { - chlist->channels = kcalloc(num_channels, sizeof(struct host1x_channel), - GFP_KERNEL); + chlist->channels = kzalloc_objs(struct host1x_channel, num_channels, + GFP_KERNEL); if (!chlist->channels) return -ENOMEM; diff --git a/drivers/gpu/host1x/context.c b/drivers/gpu/host1x/context.c index a6f6779662a3..8d7719dab510 100644 --- a/drivers/gpu/host1x/context.c +++ b/drivers/gpu/host1x/context.c @@ -35,7 +35,7 @@ int host1x_memory_context_list_init(struct host1x *host1x) return 0; cdl->len = err / 4; - cdl->devs = kcalloc(cdl->len, sizeof(*cdl->devs), GFP_KERNEL); + cdl->devs = kzalloc_objs(*cdl->devs, cdl->len, GFP_KERNEL); if (!cdl->devs) return -ENOMEM; diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c index 139ad1afd935..d8f3aade9b2e 100644 --- a/drivers/gpu/host1x/fence.c +++ b/drivers/gpu/host1x/fence.c @@ -127,7 +127,7 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold, { struct host1x_syncpt_fence *fence; - fence = kzalloc(sizeof(*fence), GFP_KERNEL); + fence = kzalloc_obj(*fence, GFP_KERNEL); if (!fence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c index e51b43dd15a3..90108d695f63 100644 --- a/drivers/gpu/host1x/mipi.c +++ b/drivers/gpu/host1x/mipi.c @@ -219,7 +219,7 @@ struct tegra_mipi_device *tegra_mipi_request(struct device *device, if (err < 0) return ERR_PTR(err); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { err = -ENOMEM; goto out; diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 333f36e0a715..fa3a8f1f7aa7 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -183,7 +183,7 @@ struct ipuv3_channel *ipu_idmac_get(struct ipu_soc *ipu, unsigned num) } } - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) { channel = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index 3c33b4defab5..e994abcd7a0d 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -2082,7 +2082,7 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task, chan = &priv->chan[ic_task]; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); @@ -2402,7 +2402,7 @@ ipu_image_convert(struct ipu_soc *ipu, enum ipu_ic_task ic_task, if (IS_ERR(ctx)) return ERR_CAST(ctx); - run = kzalloc(sizeof(*run), GFP_KERNEL); + run = kzalloc_obj(*run, GFP_KERNEL); if (!run) { ipu_image_convert_unprepare(ctx); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 68e45a26e85f..1d7d52245197 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -297,7 +297,7 @@ static int register_client(struct pci_dev *pdev, { struct vga_switcheroo_client *client; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/drivers/greybus/bundle.c b/drivers/greybus/bundle.c index a6e1cca06172..f8aee6da89a4 100644 --- a/drivers/greybus/bundle.c +++ b/drivers/greybus/bundle.c @@ -197,7 +197,7 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, return NULL; } - bundle = kzalloc(sizeof(*bundle), GFP_KERNEL); + bundle = kzalloc_obj(*bundle, GFP_KERNEL); if (!bundle) return NULL; diff --git a/drivers/greybus/connection.c b/drivers/greybus/connection.c index 9c88861986c8..91fd5cbb716d 100644 --- a/drivers/greybus/connection.c +++ b/drivers/greybus/connection.c @@ -165,7 +165,7 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id, } hd_cport_id = ret; - connection = kzalloc(sizeof(*connection), GFP_KERNEL); + connection = kzalloc_obj(*connection, GFP_KERNEL); if (!connection) { ret = -ENOMEM; goto err_hd_cport_release; diff --git a/drivers/greybus/control.c b/drivers/greybus/control.c index b5cf49d09df2..8e5c8288bf5a 100644 --- a/drivers/greybus/control.c +++ b/drivers/greybus/control.c @@ -446,7 +446,7 @@ struct gb_control *gb_control_create(struct gb_interface *intf) struct gb_connection *connection; struct gb_control *control; - control = kzalloc(sizeof(*control), GFP_KERNEL); + control = kzalloc_obj(*control, GFP_KERNEL); if (!control) return ERR_PTR(-ENOMEM); diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c index 7630a36ecf81..5acb238dde17 100644 --- a/drivers/greybus/es2.c +++ b/drivers/greybus/es2.c @@ -547,7 +547,7 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id, u32 connection_flags; int ret; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -883,7 +883,7 @@ static struct arpc *arpc_alloc(void *payload, u16 size, u8 type) if (size + sizeof(*rpc->req) > ARPC_OUT_SIZE_MAX) return NULL; - rpc = kzalloc(sizeof(*rpc), GFP_KERNEL); + rpc = kzalloc_obj(*rpc, GFP_KERNEL); if (!rpc) return NULL; @@ -892,7 +892,7 @@ static struct arpc *arpc_alloc(void *payload, u16 size, u8 type) if (!rpc->req) goto err_free_rpc; - rpc->resp = kzalloc(sizeof(*rpc->resp), GFP_KERNEL); + rpc->resp = kzalloc_obj(*rpc->resp, GFP_KERNEL); if (!rpc->resp) goto err_free_req; @@ -1203,7 +1203,7 @@ static int apb_get_cport_count(struct usb_device *udev) int retval; __le16 *cport_count; - cport_count = kzalloc(sizeof(*cport_count), GFP_KERNEL); + cport_count = kzalloc_obj(*cport_count, GFP_KERNEL); if (!cport_count) return -ENOMEM; diff --git a/drivers/greybus/interface.c b/drivers/greybus/interface.c index a0f3e9422721..881eb5e545a0 100644 --- a/drivers/greybus/interface.c +++ b/drivers/greybus/interface.c @@ -789,7 +789,7 @@ struct gb_interface *gb_interface_create(struct gb_module *module, struct gb_host_device *hd = module->hd; struct gb_interface *intf; - intf = kzalloc(sizeof(*intf), GFP_KERNEL); + intf = kzalloc_obj(*intf, GFP_KERNEL); if (!intf) return NULL; diff --git a/drivers/greybus/manifest.c b/drivers/greybus/manifest.c index dd7040697bde..0cb87bea249e 100644 --- a/drivers/greybus/manifest.c +++ b/drivers/greybus/manifest.c @@ -157,7 +157,7 @@ static int identify_descriptor(struct gb_interface *intf, expected_size, desc_size); } - descriptor = kzalloc(sizeof(*descriptor), GFP_KERNEL); + descriptor = kzalloc_obj(*descriptor, GFP_KERNEL); if (!descriptor) return -ENOMEM; @@ -275,8 +275,8 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle) if (!count) return 0; - bundle->cport_desc = kcalloc(count, sizeof(*bundle->cport_desc), - GFP_KERNEL); + bundle->cport_desc = kzalloc_objs(*bundle->cport_desc, count, + GFP_KERNEL); if (!bundle->cport_desc) goto exit; diff --git a/drivers/greybus/module.c b/drivers/greybus/module.c index 7f7153a1dd60..1f68516716be 100644 --- a/drivers/greybus/module.c +++ b/drivers/greybus/module.c @@ -93,8 +93,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id, struct gb_module *module; int i; - module = kzalloc(struct_size(module, interfaces, num_interfaces), - GFP_KERNEL); + module = kzalloc_flex(*module, interfaces, num_interfaces, GFP_KERNEL); if (!module) return NULL; diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c index 35ea7147dca6..4efe3dd5bc17 100644 --- a/drivers/greybus/svc.c +++ b/drivers/greybus/svc.c @@ -782,8 +782,8 @@ static void gb_svc_pwrmon_debugfs_init(struct gb_svc *svc) if (!rail_names) goto err_pwrmon_debugfs; - svc->pwrmon_rails = kcalloc(rail_count, sizeof(*svc->pwrmon_rails), - GFP_KERNEL); + svc->pwrmon_rails = kzalloc_objs(*svc->pwrmon_rails, rail_count, + GFP_KERNEL); if (!svc->pwrmon_rails) goto err_pwrmon_debugfs_free; @@ -1128,7 +1128,7 @@ static int gb_svc_queue_deferred_request(struct gb_operation *operation) struct gb_svc *svc = gb_connection_get_data(operation->connection); struct gb_svc_deferred_request *dr; - dr = kmalloc(sizeof(*dr), GFP_KERNEL); + dr = kmalloc_obj(*dr, GFP_KERNEL); if (!dr) return -ENOMEM; @@ -1315,7 +1315,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd) { struct gb_svc *svc; - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) return NULL; diff --git a/drivers/greybus/svc_watchdog.c b/drivers/greybus/svc_watchdog.c index b6b1682c19c4..2d2171f95822 100644 --- a/drivers/greybus/svc_watchdog.c +++ b/drivers/greybus/svc_watchdog.c @@ -112,7 +112,7 @@ int gb_svc_watchdog_create(struct gb_svc *svc) if (svc->watchdog) return 0; - watchdog = kmalloc(sizeof(*watchdog), GFP_KERNEL); + watchdog = kmalloc_obj(*watchdog, GFP_KERNEL); if (!watchdog) return -ENOMEM; diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index 7017bfa59093..8b479441bf90 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -47,7 +47,7 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type) guard(mutex)(&mp2->lock); for (i = 0; i < cli_data->num_hid_devices; i++) { if (cli_data->hid_sensor_hubs[i] == hid) { - struct request_list *new = kzalloc(sizeof(*new), GFP_KERNEL); + struct request_list *new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c index 81f3024b7b1b..59bc9a2e0cd7 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c @@ -135,7 +135,7 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) if (IS_ERR(hid)) return PTR_ERR(hid); - hid_data = kzalloc(sizeof(*hid_data), GFP_KERNEL); + hid_data = kzalloc_obj(*hid_data, GFP_KERNEL); if (!hid_data) { rc = -ENOMEM; goto err_hid_data; diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c index 892aca026ffa..c99d81789eb3 100644 --- a/drivers/hid/bpf/hid_bpf_dispatch.c +++ b/drivers/hid/bpf/hid_bpf_dispatch.c @@ -320,7 +320,7 @@ hid_bpf_allocate_context(unsigned int hid_id) if (IS_ERR(hdev)) return NULL; - ctx_kern = kzalloc(sizeof(*ctx_kern), GFP_KERNEL); + ctx_kern = kzalloc_obj(*ctx_kern, GFP_KERNEL); if (!ctx_kern) { hid_put_device(hdev); return NULL; diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 233e367cce1d..189baafe2d1e 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -794,7 +794,7 @@ static int apple_backlight_set(struct hid_device *hdev, u16 value, u16 rate) int ret = 0; struct apple_backlight_set_report *rep; - rep = kmalloc(sizeof(*rep), GFP_KERNEL); + rep = kmalloc_obj(*rep, GFP_KERNEL); if (rep == NULL) return -ENOMEM; diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index fbe4e16ab029..c7dcdffff9e6 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c @@ -96,7 +96,7 @@ static int axff_init(struct hid_device *hid) return -ENODEV; } - axff = kzalloc(sizeof(struct axff_device), GFP_KERNEL); + axff = kzalloc_obj(struct axff_device, GFP_KERNEL); if (!axff) return -ENOMEM; diff --git a/drivers/hid/hid-betopff.c b/drivers/hid/hid-betopff.c index a6d5f030d023..d739b3746138 100644 --- a/drivers/hid/hid-betopff.c +++ b/drivers/hid/hid-betopff.c @@ -100,7 +100,7 @@ static int betopff_init(struct hid_device *hid) } } - betopff = kzalloc(sizeof(*betopff), GFP_KERNEL); + betopff = kzalloc_obj(*betopff, GFP_KERNEL); if (!betopff) return -ENOMEM; diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index 528d7f361215..c81c34e5b41a 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -145,7 +145,7 @@ static int cmhid_probe(struct hid_device *hid, const struct hid_device_id *id) int ret; struct cmhid *cm; - cm = kzalloc(sizeof(struct cmhid), GFP_KERNEL); + cm = kzalloc_obj(struct cmhid, GFP_KERNEL); if (!cm) { ret = -ENOMEM; goto allocfail; diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index a5b3a8ca2fcb..d1ea455ce3d2 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -93,7 +93,7 @@ struct hid_report *hid_register_report(struct hid_device *device, if (report_enum->report_id_hash[id]) return report_enum->report_id_hash[id]; - report = kzalloc(sizeof(struct hid_report), GFP_KERNEL); + report = kzalloc_obj(struct hid_report, GFP_KERNEL); if (!report) return NULL; @@ -1319,8 +1319,9 @@ int hid_open_report(struct hid_device *device) end = start + size; - device->collection = kcalloc(HID_DEFAULT_NUM_COLLECTIONS, - sizeof(struct hid_collection), GFP_KERNEL); + device->collection = kzalloc_objs(struct hid_collection, + HID_DEFAULT_NUM_COLLECTIONS, + GFP_KERNEL); if (!device->collection) { ret = -ENOMEM; goto err; @@ -1796,7 +1797,7 @@ static void hid_report_process_ordering(struct hid_device *hid, } /* allocate the memory to process the fields */ - entries = kcalloc(count, sizeof(*entries), GFP_KERNEL); + entries = kzalloc_objs(*entries, count, GFP_KERNEL); if (!entries) return; @@ -2610,7 +2611,7 @@ static ssize_t new_id_store(struct device_driver *drv, const char *buf, if (ret < 3) return -EINVAL; - dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); + dynid = kzalloc_obj(*dynid, GFP_KERNEL); if (!dynid) return -ENOMEM; @@ -2972,7 +2973,7 @@ struct hid_device *hid_allocate_device(void) struct hid_device *hdev; int ret = -ENOMEM; - hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); + hdev = kzalloc_obj(*hdev, GFP_KERNEL); if (hdev == NULL) return ERR_PTR(ret); diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c index 62b99f5c3cf8..750cac0a2a69 100644 --- a/drivers/hid/hid-corsair.c +++ b/drivers/hid/hid-corsair.c @@ -427,7 +427,7 @@ static int k90_init_backlight(struct hid_device *dev) size_t name_sz; char *name; - drvdata->backlight = kzalloc(sizeof(struct k90_led), GFP_KERNEL); + drvdata->backlight = kzalloc_obj(struct k90_led, GFP_KERNEL); if (!drvdata->backlight) { ret = -ENOMEM; goto fail_backlight_alloc; @@ -471,7 +471,7 @@ static int k90_init_macro_functions(struct hid_device *dev) size_t name_sz; char *name; - k90 = kzalloc(sizeof(struct k90_drvdata), GFP_KERNEL); + k90 = kzalloc_obj(struct k90_drvdata, GFP_KERNEL); if (!k90) { ret = -ENOMEM; goto fail_drvdata; diff --git a/drivers/hid/hid-cougar.c b/drivers/hid/hid-cougar.c index 5596dd940322..0b66a7c61ac6 100644 --- a/drivers/hid/hid-cougar.c +++ b/drivers/hid/hid-cougar.c @@ -166,7 +166,7 @@ static int cougar_bind_shared_data(struct hid_device *hdev, shared = cougar_get_shared_data(hdev); if (!shared) { - shared = kzalloc(sizeof(*shared), GFP_KERNEL); + shared = kzalloc_obj(*shared, GFP_KERNEL); if (!shared) { error = -ENOMEM; goto out; diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index c5865b0d2aaa..220b497c573a 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -3681,7 +3681,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) struct hid_debug_list *list; unsigned long flags; - if (!(list = kzalloc(sizeof(struct hid_debug_list), GFP_KERNEL))) { + if (!(list = kzalloc_obj(struct hid_debug_list, GFP_KERNEL))) { err = -ENOMEM; goto out; } diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c index 84e1e90a266b..9923b222383a 100644 --- a/drivers/hid/hid-dr.c +++ b/drivers/hid/hid-dr.c @@ -104,7 +104,7 @@ static int drff_init(struct hid_device *hid) return -ENODEV; } - drff = kzalloc(sizeof(struct drff_device), GFP_KERNEL); + drff = kzalloc_obj(struct drff_device, GFP_KERNEL); if (!drff) return -ENOMEM; diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c index cf17bdd14d9c..465f04ed1a55 100644 --- a/drivers/hid/hid-elo.c +++ b/drivers/hid/hid-elo.c @@ -232,7 +232,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) if (!hid_is_usb(hdev)) return -EINVAL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index 60bfb6a924d7..0dbe598f2e48 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c @@ -76,7 +76,7 @@ static int emsff_init(struct hid_device *hid) return -ENODEV; } - emsff = kzalloc(sizeof(struct emsff_device), GFP_KERNEL); + emsff = kzalloc_obj(struct emsff_device, GFP_KERNEL); if (!emsff) return -ENOMEM; diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c index c6db8b6cc8ee..a9d305a193d2 100644 --- a/drivers/hid/hid-gaff.c +++ b/drivers/hid/hid-gaff.c @@ -96,7 +96,7 @@ static int gaff_init(struct hid_device *hid) return -ENODEV; } - gaff = kzalloc(sizeof(struct gaff_device), GFP_KERNEL); + gaff = kzalloc_obj(struct gaff_device, GFP_KERNEL); if (!gaff) return -ENOMEM; diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c index 4c1ccf7a267a..99b2e0919830 100644 --- a/drivers/hid/hid-google-hammer.c +++ b/drivers/hid/hid-google-hammer.c @@ -59,8 +59,8 @@ static int cbas_ec_query_base(struct cros_ec_device *ec_dev, bool get_state, struct cros_ec_command *msg; int ret; - msg = kzalloc(struct_size(msg, data, max(sizeof(u32), sizeof(*params))), - GFP_KERNEL); + msg = kzalloc_flex(*msg, data, max(sizeof(u32), sizeof(*params)), + GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/hid/hid-haptic.c b/drivers/hid/hid-haptic.c index fc8a9997f815..84f4b1ece777 100644 --- a/drivers/hid/hid-haptic.c +++ b/drivers/hid/hid-haptic.c @@ -474,8 +474,8 @@ int hid_haptic_init(struct hid_device *hdev, ret = -ENOMEM; goto duration_map; } - haptic->effect = kcalloc(FF_MAX_EFFECTS, - sizeof(struct hid_haptic_effect), GFP_KERNEL); + haptic->effect = kzalloc_objs(struct hid_haptic_effect, FF_MAX_EFFECTS, + GFP_KERNEL); if (!haptic->effect) { ret = -ENOMEM; goto output_queue; diff --git a/drivers/hid/hid-holtekff.c b/drivers/hid/hid-holtekff.c index 8619b80c834c..56980af08683 100644 --- a/drivers/hid/hid-holtekff.c +++ b/drivers/hid/hid-holtekff.c @@ -149,7 +149,7 @@ static int holtekff_init(struct hid_device *hid) return -ENODEV; } - holtekff = kzalloc(sizeof(*holtekff), GFP_KERNEL); + holtekff = kzalloc_obj(*holtekff, GFP_KERNEL); if (!holtekff) return -ENOMEM; diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c index 9eafff0b6ea4..f092547d08d2 100644 --- a/drivers/hid/hid-hyperv.c +++ b/drivers/hid/hid-hyperv.c @@ -149,7 +149,7 @@ static struct mousevsc_dev *mousevsc_alloc_device(struct hv_device *device) { struct mousevsc_dev *input_dev; - input_dev = kzalloc(sizeof(struct mousevsc_dev), GFP_KERNEL); + input_dev = kzalloc_obj(struct mousevsc_dev, GFP_KERNEL); if (!input_dev) return NULL; diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 2633fcd8f910..6137cc0aeeaf 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -531,7 +531,7 @@ static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type, if (quirks & HID_BATTERY_QUIRK_IGNORE) return 0; - psy_desc = kzalloc(sizeof(*psy_desc), GFP_KERNEL); + psy_desc = kzalloc_obj(*psy_desc, GFP_KERNEL); if (!psy_desc) return -ENOMEM; @@ -2023,7 +2023,7 @@ static void report_features(struct hid_device *hid) static struct hid_input *hidinput_allocate(struct hid_device *hid, unsigned int application) { - struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); + struct hid_input *hidinput = kzalloc_obj(*hidinput, GFP_KERNEL); struct input_dev *input_dev = input_allocate_device(); const char *suffix = NULL; size_t suffix_len, name_len; diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 9a2cfa018bd3..7cdf1e895b69 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -768,7 +768,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) return -ENODEV; } - drv_data = kzalloc(sizeof(struct lg_drv_data), GFP_KERNEL); + drv_data = kzalloc_obj(struct lg_drv_data, GFP_KERNEL); if (!drv_data) { hid_err(hdev, "Insufficient memory, cannot allocate driver data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c index 73d07e35f12a..e4a034bd4095 100644 --- a/drivers/hid/hid-lg2ff.c +++ b/drivers/hid/hid-lg2ff.c @@ -66,7 +66,7 @@ int lg2ff_init(struct hid_device *hid) if (!report) return -ENODEV; - lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL); + lg2ff = kmalloc_obj(struct lg2ff_device, GFP_KERNEL); if (!lg2ff) return -ENOMEM; diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 32b711723f2a..4979f7779de8 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -1288,7 +1288,7 @@ int lg4ff_init(struct hid_device *hid) hid_err(hid, "Cannot add device, private driver data not allocated\n"); return -1; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; spin_lock_init(&entry->report_lock); diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index c41fded63f4b..2fb6a67bede2 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -733,7 +733,7 @@ static struct dj_receiver_dev *dj_get_receiver_dev(struct hid_device *hdev, djrcv_dev = dj_find_receiver_dev(hdev, type); if (!djrcv_dev) { - djrcv_dev = kzalloc(sizeof(*djrcv_dev), GFP_KERNEL); + djrcv_dev = kzalloc_obj(*djrcv_dev, GFP_KERNEL); if (!djrcv_dev) goto out; @@ -851,7 +851,7 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, snprintf(tmpstr, sizeof(tmpstr), ":%d", device_index); strlcat(dj_hiddev->phys, tmpstr, sizeof(dj_hiddev->phys)); - dj_dev = kzalloc(sizeof(struct dj_device), GFP_KERNEL); + dj_dev = kzalloc_obj(struct dj_device, GFP_KERNEL); if (!dj_dev) { hid_err(djrcv_hdev, "%s: failed allocating dj_dev\n", __func__); @@ -1332,7 +1332,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) goto out; } - dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); + dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL); if (!dj_report) return -ENOMEM; dj_report->report_id = REPORT_ID_DJ_SHORT; @@ -1356,7 +1356,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, u8 *buf; int retval = 0; - dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); + dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL); if (!dj_report) return -ENOMEM; diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 02d83c3bd73d..4f3289b8a7c2 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -390,7 +390,7 @@ static int hidpp_send_fap_command_sync(struct hidpp_device *hidpp, return -EINVAL; } - message = kzalloc(sizeof(struct hidpp_report), GFP_KERNEL); + message = kzalloc_obj(struct hidpp_report, GFP_KERNEL); if (!message) return -ENOMEM; @@ -443,7 +443,7 @@ static int hidpp_send_rap_command_sync(struct hidpp_device *hidpp_dev, if (param_count > max_count) return -EINVAL; - message = kzalloc(sizeof(struct hidpp_report), GFP_KERNEL); + message = kzalloc_obj(struct hidpp_report, GFP_KERNEL); if (!message) return -ENOMEM; message->report_id = report_id; @@ -2527,7 +2527,7 @@ out: static int hidpp_ff_queue_work(struct hidpp_ff_private_data *data, int effect_id, u8 command, u8 *params, u8 size) { - struct hidpp_ff_work_data *wd = kzalloc(sizeof(*wd), GFP_KERNEL); + struct hidpp_ff_work_data *wd = kzalloc_obj(*wd, GFP_KERNEL); int s; if (!wd) @@ -2853,7 +2853,7 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, data = kmemdup(data, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->effect_ids = kcalloc(num_slots, sizeof(int), GFP_KERNEL); + data->effect_ids = kzalloc_objs(int, num_slots, GFP_KERNEL); if (!data->effect_ids) { kfree(data); return -ENOMEM; diff --git a/drivers/hid/hid-megaworld.c b/drivers/hid/hid-megaworld.c index 0476d7d16e7f..62f3e976f6b3 100644 --- a/drivers/hid/hid-megaworld.c +++ b/drivers/hid/hid-megaworld.c @@ -57,7 +57,7 @@ static int mwctrl_init(struct hid_device *hid) return -ENODEV; } - mwctrl = kzalloc(sizeof(struct mwctrl_device), GFP_KERNEL); + mwctrl = kzalloc_obj(struct mwctrl_device, GFP_KERNEL); if (!mwctrl) return -ENOMEM; diff --git a/drivers/hid/hid-mf.c b/drivers/hid/hid-mf.c index 49a4052a1496..9a34645e92b6 100644 --- a/drivers/hid/hid-mf.c +++ b/drivers/hid/hid-mf.c @@ -88,7 +88,7 @@ static int mf_init(struct hid_device *hid) input_ptr = input_ptr->next; input = list_entry(input_ptr, struct hid_input, list); - mf = kzalloc(sizeof(struct mf_device), GFP_KERNEL); + mf = kzalloc_obj(struct mf_device, GFP_KERNEL); if (!mf) return -ENOMEM; diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index a7f10c45f62b..f48dc2f34f79 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -900,7 +900,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev->quirks |= HID_QUIRK_MULTI_INPUT | HID_QUIRK_NO_INIT_REPORTS; - nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); + nd = kmalloc_obj(struct ntrig_data, GFP_KERNEL); if (!nd) { hid_err(hdev, "cannot allocate N-Trig data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c index 6a88e6bc70f3..99cae54dc769 100644 --- a/drivers/hid/hid-picolcd_core.c +++ b/drivers/hid/hid-picolcd_core.c @@ -78,7 +78,7 @@ struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev, return NULL; if (data->status & PICOLCD_FAILED) return NULL; - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return NULL; @@ -528,7 +528,7 @@ static int picolcd_probe(struct hid_device *hdev, * Let's allocate the picolcd data structure, set some reasonable * defaults, and associate it with the device */ - data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); + data = kzalloc_obj(struct picolcd_data, GFP_KERNEL); if (data == NULL) { hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index dc11d5322fc0..967f93d9b46b 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c @@ -140,7 +140,7 @@ static int plff_init(struct hid_device *hid) return -ENODEV; } - plff = kzalloc(sizeof(struct plff_device), GFP_KERNEL); + plff = kzalloc_obj(struct plff_device, GFP_KERNEL); if (!plff) return -ENOMEM; diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 2ec6d4445e84..2458c6b61358 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -1658,7 +1658,7 @@ static int dualsense_reset_leds(struct dualsense *ds) struct dualsense_output_report report; struct dualsense_output_report_bt *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index 6e413df38358..e69b3cb682bc 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c @@ -797,7 +797,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) intf = to_usb_interface(hdev->dev.parent); ifnum = intf->cur_altsetting->desc.bInterfaceNumber; - pm = kzalloc(sizeof(*pm), GFP_KERNEL); + pm = kzalloc_obj(*pm, GFP_KERNEL); if (pm == NULL) { hid_err(hdev, "can't alloc descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 3217e436c052..b6a9cfb71ec9 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -1164,11 +1164,11 @@ static int hid_modify_dquirk(const struct hid_device_id *id, int list_edited = 0; int ret = 0; - hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); + hdev = kzalloc_obj(*hdev, GFP_KERNEL); if (!hdev) return -ENOMEM; - q_new = kmalloc(sizeof(struct quirks_list_struct), GFP_KERNEL); + q_new = kmalloc_obj(struct quirks_list_struct, GFP_KERNEL); if (!q_new) { ret = -ENOMEM; goto out; diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c index 7b09adfa44a1..f7318bc9e1a5 100644 --- a/drivers/hid/hid-roccat-arvo.c +++ b/drivers/hid/hid-roccat-arvo.c @@ -299,7 +299,7 @@ static int arvo_init_specials(struct hid_device *hdev) return 0; } - arvo = kzalloc(sizeof(*arvo), GFP_KERNEL); + arvo = kzalloc_obj(*arvo, GFP_KERNEL); if (!arvo) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c index 339378771ed5..470c5e47d185 100644 --- a/drivers/hid/hid-roccat-isku.c +++ b/drivers/hid/hid-roccat-isku.c @@ -279,7 +279,7 @@ static int isku_init_specials(struct hid_device *hdev) return 0; } - isku = kzalloc(sizeof(*isku), GFP_KERNEL); + isku = kzalloc_obj(*isku, GFP_KERNEL); if (!isku) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index fabc08efcfd8..9ec3e015acb9 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -704,7 +704,7 @@ static int kone_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - kone = kzalloc(sizeof(*kone), GFP_KERNEL); + kone = kzalloc_obj(*kone, GFP_KERNEL); if (!kone) return -ENOMEM; hid_set_drvdata(hdev, kone); diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 77d45d36421a..534d67a2617e 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -384,7 +384,7 @@ static int koneplus_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - koneplus = kzalloc(sizeof(*koneplus), GFP_KERNEL); + koneplus = kzalloc_obj(*koneplus, GFP_KERNEL); if (!koneplus) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-konepure.c b/drivers/hid/hid-roccat-konepure.c index 027bfc55ef9c..1994efc4f26b 100644 --- a/drivers/hid/hid-roccat-konepure.c +++ b/drivers/hid/hid-roccat-konepure.c @@ -88,7 +88,7 @@ static int konepure_init_specials(struct hid_device *hdev) return 0; } - konepure = kzalloc(sizeof(*konepure), GFP_KERNEL); + konepure = kzalloc_obj(*konepure, GFP_KERNEL); if (!konepure) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index a66f1b4730f3..429d9b86b672 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c @@ -453,7 +453,7 @@ static int kovaplus_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - kovaplus = kzalloc(sizeof(*kovaplus), GFP_KERNEL); + kovaplus = kzalloc_obj(*kovaplus, GFP_KERNEL); if (!kovaplus) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-lua.c b/drivers/hid/hid-roccat-lua.c index 45e30549c236..a7ed873f8761 100644 --- a/drivers/hid/hid-roccat-lua.c +++ b/drivers/hid/hid-roccat-lua.c @@ -119,7 +119,7 @@ static int lua_init_specials(struct hid_device *hdev) struct lua_device *lua; int retval; - lua = kzalloc(sizeof(*lua), GFP_KERNEL); + lua = kzalloc_obj(*lua, GFP_KERNEL); if (!lua) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index de2da6086e0b..35fffc55eb4f 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c @@ -403,7 +403,7 @@ static int pyra_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); + pyra = kzalloc_obj(*pyra, GFP_KERNEL); if (!pyra) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-ryos.c b/drivers/hid/hid-roccat-ryos.c index 36911c9da4fe..0f4b52ef5404 100644 --- a/drivers/hid/hid-roccat-ryos.c +++ b/drivers/hid/hid-roccat-ryos.c @@ -96,7 +96,7 @@ static int ryos_init_specials(struct hid_device *hdev) return 0; } - ryos = kzalloc(sizeof(*ryos), GFP_KERNEL); + ryos = kzalloc_obj(*ryos, GFP_KERNEL); if (!ryos) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-savu.c b/drivers/hid/hid-roccat-savu.c index fb2e464c3ada..90f9b0feb754 100644 --- a/drivers/hid/hid-roccat-savu.c +++ b/drivers/hid/hid-roccat-savu.c @@ -68,7 +68,7 @@ static int savu_init_specials(struct hid_device *hdev) return 0; } - savu = kzalloc(sizeof(*savu), GFP_KERNEL); + savu = kzalloc_obj(*savu, GFP_KERNEL); if (!savu) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index c7f7562e22e5..5fe16ec1849a 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c @@ -152,7 +152,7 @@ static int roccat_open(struct inode *inode, struct file *file) struct roccat_device *device; int error = 0; - reader = kzalloc(sizeof(struct roccat_reader), GFP_KERNEL); + reader = kzalloc_obj(struct roccat_reader, GFP_KERNEL); if (!reader) return -ENOMEM; @@ -301,7 +301,7 @@ int roccat_connect(const struct class *klass, struct hid_device *hid, int report struct roccat_device *device; int temp; - device = kzalloc(sizeof(struct roccat_device), GFP_KERNEL); + device = kzalloc_obj(struct roccat_device, GFP_KERNEL); if (!device) return -ENOMEM; diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c index 761760668f6d..75d827c85e14 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -912,7 +912,7 @@ hid_sensor_custom_get_known(struct hid_sensor_hub_device *hsdev, hid_sensor_custom_known_table; struct hid_sensor_custom_properties *prop; - prop = kmalloc(sizeof(struct hid_sensor_custom_properties), GFP_KERNEL); + prop = kmalloc_obj(struct hid_sensor_custom_properties, GFP_KERNEL); if (!prop) return -ENOMEM; diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 0edec902be41..90666ff629de 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -139,7 +139,7 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); return -EINVAL; } - callback = kzalloc(sizeof(*callback), GFP_ATOMIC); + callback = kzalloc_obj(*callback, GFP_ATOMIC); if (!callback) { spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); return -ENOMEM; diff --git a/drivers/hid/hid-sjoy.c b/drivers/hid/hid-sjoy.c index d3a777f52a3f..e567c264aed3 100644 --- a/drivers/hid/hid-sjoy.c +++ b/drivers/hid/hid-sjoy.c @@ -83,7 +83,7 @@ static int sjoyff_init(struct hid_device *hid) return -ENODEV; } - sjoyff = kzalloc(sizeof(struct sjoyff_device), GFP_KERNEL); + sjoyff = kzalloc_obj(struct sjoyff_device, GFP_KERNEL); if (!sjoyff) return -ENOMEM; diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c index 0bf70664c35e..15847eef4ac0 100644 --- a/drivers/hid/hid-thrustmaster.c +++ b/drivers/hid/hid-thrustmaster.c @@ -308,7 +308,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i } // Now we allocate the tm_wheel - tm_wheel = kzalloc(sizeof(struct tm_wheel), GFP_KERNEL); + tm_wheel = kzalloc_obj(struct tm_wheel, GFP_KERNEL); if (!tm_wheel) { ret = -ENOMEM; goto error1; @@ -328,7 +328,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i goto error3; } - tm_wheel->response = kzalloc(sizeof(struct tm_wheel_response), GFP_KERNEL); + tm_wheel->response = kzalloc_obj(struct tm_wheel_response, GFP_KERNEL); if (!tm_wheel->response) { ret = -ENOMEM; goto error4; diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index fcd859aa3a8c..ddb2629ed9e1 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c @@ -132,7 +132,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) hidinput = list_entry(hid->inputs.next, struct hid_input, list); input_dev = hidinput->input; - tmff = kzalloc(sizeof(struct tmff_device), GFP_KERNEL); + tmff = kzalloc_obj(struct tmff_device, GFP_KERNEL); if (!tmff) return -ENOMEM; diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index e28176d9d9c9..21b1d865bd0d 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -1358,13 +1358,13 @@ static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev, if (!uclogic_params_ugee_v2_has_battery(hdev)) return 0; - p->event_hooks = kzalloc(sizeof(*p->event_hooks), GFP_KERNEL); + p->event_hooks = kzalloc_obj(*p->event_hooks, GFP_KERNEL); if (!p->event_hooks) return -ENOMEM; INIT_LIST_HEAD(&p->event_hooks->list); - event_hook = kzalloc(sizeof(*event_hook), GFP_KERNEL); + event_hook = kzalloc_obj(*event_hook, GFP_KERNEL); if (!event_hook) return -ENOMEM; diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 5b5fc460a4c5..c24ccfc7c05a 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -1737,7 +1737,7 @@ static struct wiimote_data *wiimote_create(struct hid_device *hdev) { struct wiimote_data *wdata; - wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); + wdata = kzalloc_obj(*wdata, GFP_KERNEL); if (!wdata) return NULL; diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c index 00f9be55f148..07d7137acfd4 100644 --- a/drivers/hid/hid-wiimote-debug.c +++ b/drivers/hid/hid-wiimote-debug.c @@ -174,7 +174,7 @@ int wiidebug_init(struct wiimote_data *wdata) struct wiimote_debug *dbg; unsigned long flags; - dbg = kzalloc(sizeof(*dbg), GFP_KERNEL); + dbg = kzalloc_obj(*dbg, GFP_KERNEL); if (!dbg) return -ENOMEM; diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c index aacf7f137b18..b9d94b3fe8b2 100644 --- a/drivers/hid/hid-zpff.c +++ b/drivers/hid/hid-zpff.c @@ -71,7 +71,7 @@ static int zpff_init(struct hid_device *hid) return -ENODEV; } - zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL); + zpff = kzalloc_obj(struct zpff_device, GFP_KERNEL); if (!zpff) return -ENOMEM; diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index bbd6f23bce78..c3cd8521b695 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -281,7 +281,7 @@ static int hidraw_open(struct inode *inode, struct file *file) unsigned long flags; int err = 0; - if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { + if (!(list = kzalloc_obj(struct hidraw_list, GFP_KERNEL))) { err = -ENOMEM; goto out; } @@ -603,7 +603,7 @@ int hidraw_connect(struct hid_device *hid) /* we accept any HID device, all applications */ - dev = kzalloc(sizeof(struct hidraw), GFP_KERNEL); + dev = kzalloc_obj(struct hidraw, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c index be2c62fc8251..48f06c93a07b 100644 --- a/drivers/hid/intel-ish-hid/ishtp-hid.c +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c @@ -214,7 +214,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev, if (IS_ERR(hid)) return PTR_ERR(hid); - hid_data = kzalloc(sizeof(*hid_data), GFP_KERNEL); + hid_data = kzalloc_obj(*hid_data, GFP_KERNEL); if (!hid_data) { rv = -ENOMEM; goto err_hid_data; diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index b890fbf97a75..ff60be49f2b8 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -435,7 +435,7 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev, } spin_unlock_irqrestore(&dev->device_list_lock, flags); - device = kzalloc(sizeof(struct ishtp_cl_device), GFP_KERNEL); + device = kzalloc_obj(struct ishtp_cl_device, GFP_KERNEL); if (!device) return NULL; diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c index 97f4026b1627..717276f8460a 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c +++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c @@ -66,7 +66,7 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl) for (j = 0; j < cl->tx_ring_size; ++j) { struct ishtp_cl_tx_ring *tx_buf; - tx_buf = kzalloc(sizeof(struct ishtp_cl_tx_ring), GFP_KERNEL); + tx_buf = kzalloc_obj(struct ishtp_cl_tx_ring, GFP_KERNEL); if (!tx_buf) goto out; @@ -183,7 +183,7 @@ struct ishtp_cl_rb *ishtp_io_rb_init(struct ishtp_cl *cl) { struct ishtp_cl_rb *rb; - rb = kzalloc(sizeof(struct ishtp_cl_rb), GFP_KERNEL); + rb = kzalloc_obj(struct ishtp_cl_rb, GFP_KERNEL); if (!rb) return NULL; diff --git a/drivers/hid/intel-ish-hid/ishtp/client.c b/drivers/hid/intel-ish-hid/ishtp/client.c index 40f510b1c072..f22b2f85e70f 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client.c +++ b/drivers/hid/intel-ish-hid/ishtp/client.c @@ -105,7 +105,7 @@ struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device) { struct ishtp_cl *cl; - cl = kmalloc(sizeof(struct ishtp_cl), GFP_KERNEL); + cl = kmalloc_obj(struct ishtp_cl, GFP_KERNEL); if (!cl) return NULL; diff --git a/drivers/hid/intel-ish-hid/ishtp/hbm.c b/drivers/hid/intel-ish-hid/ishtp/hbm.c index 97c4fcd9e3c6..9834dbd04726 100644 --- a/drivers/hid/intel-ish-hid/ishtp/hbm.c +++ b/drivers/hid/intel-ish-hid/ishtp/hbm.c @@ -34,8 +34,8 @@ static void ishtp_hbm_fw_cl_allocate(struct ishtp_device *dev) return; /* allocate storage for fw clients representation */ - clients = kcalloc(dev->fw_clients_num, sizeof(struct ishtp_fw_client), - GFP_KERNEL); + clients = kzalloc_objs(struct ishtp_fw_client, dev->fw_clients_num, + GFP_KERNEL); if (!clients) { dev->dev_state = ISHTP_DEV_RESETTING; ish_hw_reset(dev); diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 21a70420151e..a4f57143642c 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -110,7 +110,7 @@ static int uhid_queue_event(struct uhid_device *uhid, __u32 event) unsigned long flags; struct uhid_event *ev; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -129,7 +129,7 @@ static int uhid_hid_start(struct hid_device *hid) struct uhid_event *ev; unsigned long flags; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -240,7 +240,7 @@ static int uhid_hid_get_report(struct hid_device *hid, unsigned char rnum, if (!READ_ONCE(uhid->running)) return -EIO; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -282,7 +282,7 @@ static int uhid_hid_set_report(struct hid_device *hid, unsigned char rnum, if (!READ_ONCE(uhid->running) || count > UHID_DATA_MAX) return -EIO; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -365,7 +365,7 @@ static int uhid_hid_output_raw(struct hid_device *hid, __u8 *buf, size_t count, if (count < 1 || count > UHID_DATA_MAX) return -EINVAL; - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) return -ENOMEM; @@ -433,7 +433,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len, */ struct uhid_create_req_compat *compat; - compat = kzalloc(sizeof(*compat), GFP_KERNEL); + compat = kzalloc_obj(*compat, GFP_KERNEL); if (!compat) return -ENOMEM; @@ -636,7 +636,7 @@ static int uhid_char_open(struct inode *inode, struct file *file) { struct uhid_device *uhid; - uhid = kzalloc(sizeof(*uhid), GFP_KERNEL); + uhid = kzalloc_obj(*uhid, GFP_KERNEL); if (!uhid) return -ENOMEM; diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 758eb21430cd..922022a9c253 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -858,7 +858,7 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) &usbhid->inbuf_dma); usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->outbuf_dma); - usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL); + usbhid->cr = kmalloc_obj(*usbhid->cr, GFP_KERNEL); usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->ctrlbuf_dma); if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || @@ -1430,7 +1430,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0) hid->uniq[0] = 0; - usbhid = kzalloc(sizeof(*usbhid), GFP_KERNEL); + usbhid = kzalloc_obj(*usbhid, GFP_KERNEL); if (usbhid == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index a4e700b40ba9..6719c976a3c3 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -1528,7 +1528,7 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks) return -ENODEV; } - pidff = kzalloc(sizeof(*pidff), GFP_KERNEL); + pidff = kzalloc_obj(*pidff, GFP_KERNEL); if (!pidff) return -ENOMEM; diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 59cf3ddfdf78..3a115ea49cd2 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -434,7 +434,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, struct hid_field *field; int i; - uref_multi = kmalloc(sizeof(struct hiddev_usage_ref_multi), GFP_KERNEL); + uref_multi = kmalloc_obj(struct hiddev_usage_ref_multi, GFP_KERNEL); if (!uref_multi) return -ENOMEM; uref = &uref_multi->uref; @@ -890,7 +890,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) return -EINVAL; } - if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL))) + if (!(hiddev = kzalloc_obj(struct hiddev, GFP_KERNEL))) return -ENOMEM; init_waitqueue_head(&hiddev->wait); diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index af6bc76dbf64..d32a860c6979 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -241,7 +241,7 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) return -1; if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma))) return -1; - if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) + if (!(kbd->cr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL))) return -1; if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma))) return -1; @@ -281,7 +281,7 @@ static int usb_kbd_probe(struct usb_interface *iface, pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - kbd = kzalloc(sizeof(struct usb_kbd), GFP_KERNEL); + kbd = kzalloc_obj(struct usb_kbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!kbd || !input_dev) goto fail1; diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 3fd93c2e4f4a..da0d30de1d26 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -125,7 +125,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - mouse = kzalloc(sizeof(struct usb_mouse), GFP_KERNEL); + mouse = kzalloc_obj(struct usb_mouse, GFP_KERNEL); input_dev = input_allocate_device(); if (!mouse || !input_dev) goto fail1; diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index afc900560706..e2e9f8afec11 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -892,7 +892,7 @@ static int wacom_add_shared_data(struct hid_device *hdev) data = wacom_get_hdev_data(hdev); if (!data) { - data = kzalloc(sizeof(struct wacom_hdev_data), GFP_KERNEL); + data = kzalloc_obj(struct wacom_hdev_data, GFP_KERNEL); if (!data) { mutex_unlock(&wacom_udev_list_lock); return -ENOMEM; diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c index daa8e1bff5d9..5918401a4db9 100644 --- a/drivers/hsi/clients/cmt_speech.c +++ b/drivers/hsi/clients/cmt_speech.c @@ -139,7 +139,7 @@ static void cs_notify(u32 message, struct list_head *head) goto out; } - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) { dev_err(&cs_char_data.cl->device, "Can't allocate new entry for the queue.\n"); @@ -273,7 +273,7 @@ static int cs_alloc_cmds(struct cs_hsi_iface *hi) msg = hsi_alloc_msg(1, GFP_KERNEL); if (!msg) goto out; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) { hsi_free_msg(msg); goto out; @@ -985,7 +985,7 @@ static int cs_hsi_start(struct cs_hsi_iface **hi, struct hsi_client *cl, unsigned long mmap_base, unsigned long mmap_size) { int err = 0; - struct cs_hsi_iface *hsi_if = kzalloc(sizeof(*hsi_if), GFP_KERNEL); + struct cs_hsi_iface *hsi_if = kzalloc_obj(*hsi_if, GFP_KERNEL); dev_dbg(&cl->device, "cs_hsi_start\n"); diff --git a/drivers/hsi/clients/hsi_char.c b/drivers/hsi/clients/hsi_char.c index 71ce7dbfe31d..3258a7cf81ac 100644 --- a/drivers/hsi/clients/hsi_char.c +++ b/drivers/hsi/clients/hsi_char.c @@ -683,7 +683,7 @@ static int hsc_probe(struct device *dev) int ret; int i; - cl_data = kzalloc(sizeof(*cl_data), GFP_KERNEL); + cl_data = kzalloc_obj(*cl_data, GFP_KERNEL); if (!cl_data) return -ENOMEM; diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c index d10a01f3eb9e..e7bb2803ace5 100644 --- a/drivers/hsi/clients/ssi_protocol.c +++ b/drivers/hsi/clients/ssi_protocol.c @@ -259,7 +259,7 @@ static int ssip_alloc_cmds(struct ssi_protocol *ssi) msg = hsi_alloc_msg(1, GFP_KERNEL); if (!msg) goto out; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) { hsi_free_msg(msg); goto out; @@ -1077,7 +1077,7 @@ static int ssi_protocol_probe(struct device *dev) struct ssi_protocol *ssi; int err; - ssi = kzalloc(sizeof(*ssi), GFP_KERNEL); + ssi = kzalloc_obj(*ssi, GFP_KERNEL); if (!ssi) return -ENOMEM; diff --git a/drivers/hsi/hsi_boardinfo.c b/drivers/hsi/hsi_boardinfo.c index 52500e7fd836..109b0fb71a9a 100644 --- a/drivers/hsi/hsi_boardinfo.c +++ b/drivers/hsi/hsi_boardinfo.c @@ -36,7 +36,7 @@ int __init hsi_register_board_info(struct hsi_board_info const *info, { struct hsi_cl_info *cl_info; - cl_info = kcalloc(len, sizeof(*cl_info), GFP_KERNEL); + cl_info = kzalloc_objs(*cl_info, len, GFP_KERNEL); if (!cl_info) return -ENOMEM; diff --git a/drivers/hsi/hsi_core.c b/drivers/hsi/hsi_core.c index 8113cb9d4015..84792da4caca 100644 --- a/drivers/hsi/hsi_core.c +++ b/drivers/hsi/hsi_core.c @@ -70,7 +70,7 @@ struct hsi_client *hsi_new_client(struct hsi_port *port, struct hsi_client *cl; size_t size; - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) goto err; @@ -203,7 +203,7 @@ static void hsi_add_client_from_dt(struct hsi_port *port, char name[32]; int length, cells, err, i, max_chan, mode; - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return; @@ -253,13 +253,13 @@ static void hsi_add_client_from_dt(struct hsi_port *port, cl->rx_cfg.num_channels = cells; cl->tx_cfg.num_channels = cells; - cl->rx_cfg.channels = kcalloc(cells, sizeof(channel), GFP_KERNEL); + cl->rx_cfg.channels = kzalloc_objs(channel, cells, GFP_KERNEL); if (!cl->rx_cfg.channels) { err = -ENOMEM; goto err; } - cl->tx_cfg.channels = kcalloc(cells, sizeof(channel), GFP_KERNEL); + cl->tx_cfg.channels = kzalloc_objs(channel, cells, GFP_KERNEL); if (!cl->tx_cfg.channels) { err = -ENOMEM; goto err2; @@ -468,10 +468,10 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags) if (!n_ports) return NULL; - hsi = kzalloc(sizeof(*hsi), flags); + hsi = kzalloc_obj(*hsi, flags); if (!hsi) return NULL; - port = kcalloc(n_ports, sizeof(*port), flags); + port = kzalloc_objs(*port, n_ports, flags); if (!port) { kfree(hsi); return NULL; @@ -482,7 +482,7 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags) device_initialize(&hsi->device); for (i = 0; i < n_ports; i++) { - port[i] = kzalloc(sizeof(**port), flags); + port[i] = kzalloc_obj(**port, flags); if (port[i] == NULL) goto out; port[i]->num = i; @@ -538,7 +538,7 @@ struct hsi_msg *hsi_alloc_msg(unsigned int nents, gfp_t flags) struct hsi_msg *msg; int err; - msg = kzalloc(sizeof(*msg), flags); + msg = kzalloc_obj(*msg, flags); if (!msg) return NULL; diff --git a/drivers/hte/hte.c b/drivers/hte/hte.c index 23a6eeb8c506..34f40ed46242 100644 --- a/drivers/hte/hte.c +++ b/drivers/hte/hte.c @@ -850,7 +850,7 @@ static int hte_register_chip(struct hte_chip *chip) return -EINVAL; } - gdev = kzalloc(struct_size(gdev, ei, chip->nlines), GFP_KERNEL); + gdev = kzalloc_flex(*gdev, ei, chip->nlines, GFP_KERNEL); if (!gdev) return -ENOMEM; diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 74fed2c073d4..7c77ada12b2e 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -354,7 +354,7 @@ static struct vmbus_channel *alloc_channel(void) { struct vmbus_channel *channel; - channel = kzalloc(sizeof(*channel), GFP_ATOMIC); + channel = kzalloc_obj(*channel, GFP_ATOMIC); if (!channel) return NULL; diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 5d9cb5bf2d62..16b9959dba7e 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -313,9 +313,8 @@ int vmbus_connect(void) pr_info("Vmbus version:%d.%d\n", version >> 16, version & 0xFFFF); - vmbus_connection.channels = kcalloc(MAX_CHANNEL_RELIDS, - sizeof(struct vmbus_channel *), - GFP_KERNEL); + vmbus_connection.channels = kzalloc_objs(struct vmbus_channel *, + MAX_CHANNEL_RELIDS, GFP_KERNEL); if (vmbus_connection.channels == NULL) { ret = -ENOMEM; goto cleanup; diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index ea6835638505..4a2348b7f8a2 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -183,8 +183,8 @@ int hv_synic_alloc(void) memset(hv_cpu, 0, sizeof(*hv_cpu)); } - hv_context.hv_numa_map = kcalloc(nr_node_ids, sizeof(struct cpumask), - GFP_KERNEL); + hv_context.hv_numa_map = kzalloc_objs(struct cpumask, nr_node_ids, + GFP_KERNEL); if (!hv_context.hv_numa_map) { pr_err("Unable to allocate NUMA map\n"); goto err; diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 2b4080e51f97..a848400a59a2 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -801,7 +801,7 @@ static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) * is, create a gap and update covered_end_pfn. */ if (has->covered_end_pfn != start_pfn) { - gap = kzalloc(sizeof(struct hv_hotadd_gap), GFP_ATOMIC); + gap = kzalloc_obj(struct hv_hotadd_gap, GFP_ATOMIC); if (!gap) { ret = -ENOMEM; break; diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 62795f6cbb00..29ef1dc5c184 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -134,7 +134,7 @@ kvp_register(int reg_value) struct hv_kvp_msg *kvp_msg; char *version; - kvp_msg = kzalloc(sizeof(*kvp_msg), GFP_KERNEL); + kvp_msg = kzalloc_obj(*kvp_msg, GFP_KERNEL); if (kvp_msg) { version = kvp_msg->body.kvp_register.version; @@ -385,7 +385,7 @@ kvp_send_key(struct work_struct *dummy) if (kvp_transaction.state != HVUTIL_HOSTMSG_RECEIVED) return; - message = kzalloc(sizeof(*message), GFP_KERNEL); + message = kzalloc_obj(*message, GFP_KERNEL); if (!message) return; diff --git a/drivers/hv/hv_proc.c b/drivers/hv/hv_proc.c index 5f4fd9c3231c..216a0e8fd15b 100644 --- a/drivers/hv/hv_proc.c +++ b/drivers/hv/hv_proc.c @@ -40,7 +40,7 @@ int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages) return -ENOMEM; pages = page_address(page); - counts = kcalloc(HV_DEPOSIT_MAX, sizeof(int), GFP_KERNEL); + counts = kzalloc_objs(int, HV_DEPOSIT_MAX, GFP_KERNEL); if (!counts) { free_page((unsigned long)pages); return -ENOMEM; diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index 2e7f537d53cf..50f9348789ee 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -184,7 +184,7 @@ static void vss_send_op(void) return; } - vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL); + vss_msg = kzalloc_obj(*vss_msg, GFP_KERNEL); if (!vss_msg) return; @@ -424,7 +424,7 @@ int hv_vss_pre_suspend(void) * write() will fail with EINVAL (see vss_on_msg()), and the daemon * will reset the device by closing and re-opening it. */ - vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL); + vss_msg = kzalloc_obj(*vss_msg, GFP_KERNEL); if (!vss_msg) return -ENOMEM; diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c index b3de35ff6334..43b7ffae8852 100644 --- a/drivers/hv/hv_utils_transport.c +++ b/drivers/hv/hv_utils_transport.c @@ -274,7 +274,7 @@ struct hvutil_transport *hvutil_transport_init(const char *name, { struct hvutil_transport *hvt; - hvt = kzalloc(sizeof(*hvt), GFP_KERNEL); + hvt = kzalloc_obj(*hvt, GFP_KERNEL); if (!hvt) return NULL; diff --git a/drivers/hv/mshv_debugfs.c b/drivers/hv/mshv_debugfs.c index ebf2549eb44d..6a080d728836 100644 --- a/drivers/hv/mshv_debugfs.c +++ b/drivers/hv/mshv_debugfs.c @@ -156,9 +156,8 @@ static int __init mshv_debugfs_lp_create(struct dentry *parent) struct dentry *lp_dir; int err, lp_index; - mshv_lps_stats = kcalloc(mshv_lps_count, - sizeof(*mshv_lps_stats), - GFP_KERNEL_ACCOUNT); + mshv_lps_stats = kzalloc_objs(*mshv_lps_stats, mshv_lps_count, + GFP_KERNEL_ACCOUNT); if (!mshv_lps_stats) return -ENOMEM; @@ -329,8 +328,8 @@ static int mshv_debugfs_partition_stats_create(u64 partition_id, struct hv_stats_page **pstats; int err; - pstats = kcalloc(NUM_STATS_AREAS, sizeof(struct hv_stats_page *), - GFP_KERNEL_ACCOUNT); + pstats = kzalloc_objs(struct hv_stats_page *, NUM_STATS_AREAS, + GFP_KERNEL_ACCOUNT); if (!pstats) return -ENOMEM; @@ -472,8 +471,8 @@ static int __init parent_vp_debugfs_create(u32 vp_index, struct hv_stats_page **pstats; int err; - pstats = kcalloc(NUM_STATS_AREAS, sizeof(struct hv_stats_page *), - GFP_KERNEL_ACCOUNT); + pstats = kzalloc_objs(struct hv_stats_page *, NUM_STATS_AREAS, + GFP_KERNEL_ACCOUNT); if (!pstats) return -ENOMEM; @@ -512,8 +511,7 @@ static int __init mshv_debugfs_parent_partition_create(void) if (err) goto remove_debugfs_partition; - parent_vp_stats = kcalloc(nr_cpu_ids, sizeof(*parent_vp_stats), - GFP_KERNEL); + parent_vp_stats = kzalloc_objs(*parent_vp_stats, nr_cpu_ids, GFP_KERNEL); if (!parent_vp_stats) { err = -ENOMEM; goto remove_debugfs_partition; diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c index 492c6258045c..5b3c09f08a1e 100644 --- a/drivers/hv/mshv_eventfd.c +++ b/drivers/hv/mshv_eventfd.c @@ -394,7 +394,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, CLASS(fd, f)(args->fd); - irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL); + irqfd = kzalloc_obj(*irqfd, GFP_KERNEL); if (!irqfd) return -ENOMEM; @@ -439,7 +439,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, } if (!irqfd->irqfd_resampler) { - rp = kzalloc(sizeof(*rp), GFP_KERNEL_ACCOUNT); + rp = kzalloc_obj(*rp, GFP_KERNEL_ACCOUNT); if (!rp) { ret = -ENOMEM; mutex_unlock(&pt->irqfds_resampler_lock); @@ -707,7 +707,7 @@ static int mshv_assign_ioeventfd(struct mshv_partition *pt, if (IS_ERR(eventfd)) return PTR_ERR(eventfd); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { ret = -ENOMEM; goto fail; diff --git a/drivers/hv/mshv_irq.c b/drivers/hv/mshv_irq.c index 798e7e1ab06e..02c56fc3a498 100644 --- a/drivers/hv/mshv_irq.c +++ b/drivers/hv/mshv_irq.c @@ -37,8 +37,8 @@ int mshv_update_routing_table(struct mshv_partition *partition, } nr_rt_entries += 1; - new = kzalloc(struct_size(new, mshv_girq_info_tbl, nr_rt_entries), - GFP_KERNEL_ACCOUNT); + new = kzalloc_flex(*new, mshv_girq_info_tbl, nr_rt_entries, + GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM; diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index e6509c980763..4715d23d22f2 100644 --- a/drivers/hv/mshv_root_main.c +++ b/drivers/hv/mshv_root_main.c @@ -713,7 +713,7 @@ mshv_vp_ioctl_get_set_state_pfn(struct mshv_vp *vp, return -EOVERFLOW; /* Pin user pages so hypervisor can copy directly to them */ - pages = kcalloc(page_count, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, page_count, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -1072,7 +1072,7 @@ mshv_partition_ioctl_create_vp(struct mshv_partition *partition, if (ret) goto unmap_ghcb_page; - vp = kzalloc(sizeof(*vp), GFP_KERNEL); + vp = kzalloc_obj(*vp, GFP_KERNEL); if (!vp) goto unmap_stats_pages; @@ -1977,7 +1977,7 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev) if (ret) return ret; - partition = kzalloc(sizeof(*partition), GFP_KERNEL); + partition = kzalloc_obj(*partition, GFP_KERNEL); if (!partition) return -ENOMEM; diff --git a/drivers/hv/mshv_synic.c b/drivers/hv/mshv_synic.c index f8b0337cdc82..49e3a59ffb90 100644 --- a/drivers/hv/mshv_synic.c +++ b/drivers/hv/mshv_synic.c @@ -605,7 +605,7 @@ mshv_register_doorbell(u64 partition_id, doorbell_cb_t doorbell_cb, void *data, union hv_port_id port_id = { 0 }; int ret; - port_table_info = kmalloc(sizeof(*port_table_info), GFP_KERNEL); + port_table_info = kmalloc_obj(*port_table_info, GFP_KERNEL); if (!port_table_info) return -ENOMEM; diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c index 7bbbce009732..916021a175f3 100644 --- a/drivers/hv/mshv_vtl_main.c +++ b/drivers/hv/mshv_vtl_main.c @@ -117,7 +117,7 @@ mshv_ioctl_create_vtl(void __user *user_arg, struct device *module_dev) struct file *file; int fd; - vtl = kzalloc(sizeof(*vtl), GFP_KERNEL); + vtl = kzalloc_obj(*vtl, GFP_KERNEL); if (!vtl) return -ENOMEM; @@ -393,7 +393,7 @@ static int mshv_vtl_ioctl_add_vtl0_mem(struct mshv_vtl *vtl, void __user *arg) return -EFAULT; } - pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL); + pgmap = kzalloc_obj(*pgmap, GFP_KERNEL); if (!pgmap) return -ENOMEM; @@ -1344,7 +1344,7 @@ static int __init mshv_vtl_init(void) /* * "mshv vtl mem dev" device is later used to setup VTL0 memory. */ - mem_dev = kzalloc(sizeof(*mem_dev), GFP_KERNEL); + mem_dev = kzalloc_obj(*mem_dev, GFP_KERNEL); if (!mem_dev) { ret = -ENOMEM; goto free_low; diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 3c421a7f78c0..db3c2537360f 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -196,9 +196,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, * First page holds struct hv_ring_buffer, do wraparound mapping for * the rest. */ - pages_wraparound = kcalloc(page_cnt * 2 - 1, - sizeof(struct page *), - GFP_KERNEL); + pages_wraparound = kzalloc_objs(struct page *, page_cnt * 2 - 1, + GFP_KERNEL); if (!pages_wraparound) return -ENOMEM; diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 3e7a52918ce0..3119f68fd27b 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -756,7 +756,7 @@ static int vmbus_add_dynid(struct hv_driver *drv, guid_t *guid) { struct vmbus_dynid *dynid; - dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); + dynid = kzalloc_obj(*dynid, GFP_KERNEL); if (!dynid) return -ENOMEM; @@ -1120,7 +1120,7 @@ static void __vmbus_on_msg_dpc(void *message_page_addr) } if (entry->handler_type == VMHT_BLOCKING) { - ctx = kmalloc(struct_size(ctx, msg.payload, payload_size), GFP_ATOMIC); + ctx = kmalloc_flex(*ctx, msg.payload, payload_size, GFP_ATOMIC); if (ctx == NULL) return; @@ -2156,7 +2156,7 @@ struct hv_device *vmbus_device_create(const guid_t *type, { struct hv_device *child_device_obj; - child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL); + child_device_obj = kzalloc_obj(struct hv_device, GFP_KERNEL); if (!child_device_obj) { pr_err("Unable to allocate device object for child device\n"); return NULL; @@ -2318,7 +2318,7 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx) if (end < 0x100000) return AE_OK; - new_res = kzalloc(sizeof(*new_res), GFP_ATOMIC); + new_res = kzalloc_obj(*new_res, GFP_ATOMIC); if (!new_res) return AE_NO_MEMORY; @@ -2672,7 +2672,7 @@ static int vmbus_device_add(struct platform_device *pdev) for_each_of_range(&parser, &range) { struct resource *res; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) { vmbus_mmio_remove(); return -ENOMEM; diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index 7cb66216f358..1fa3657f4630 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -245,9 +245,8 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource) if (!pss->package.count) goto end; - resource->domain_devices = kcalloc(pss->package.count, - sizeof(struct acpi_device *), - GFP_KERNEL); + resource->domain_devices = kzalloc_objs(struct acpi_device *, + pss->package.count, GFP_KERNEL); if (!resource->domain_devices) { res = -ENOMEM; goto end; @@ -893,7 +892,7 @@ static int acpi_power_meter_add(struct acpi_device *device) if (!device) return -EINVAL; - resource = kzalloc(sizeof(*resource), GFP_KERNEL); + resource = kzalloc_obj(*resource, GFP_KERNEL); if (!resource) return -ENOMEM; diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index fc6d6a9053ce..0dbad1d3808c 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -586,7 +586,7 @@ static int applesmc_init_smcreg_try(void) s->key_count = count; if (!s->cache) - s->cache = kcalloc(s->key_count, sizeof(*s->cache), GFP_KERNEL); + s->cache = kzalloc_objs(*s->cache, s->key_count, GFP_KERNEL); if (!s->cache) return -ENOMEM; @@ -1141,7 +1141,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num) int ret, i; for (grp = groups; grp->format; grp++) { - grp->nodes = kcalloc(num + 1, sizeof(*node), GFP_KERNEL); + grp->nodes = kzalloc_objs(*node, num + 1, GFP_KERNEL); if (!grp->nodes) { ret = -ENOMEM; goto out; diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index d2dfa4e30407..eb00a9f08955 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -492,13 +492,13 @@ init_temp_data(struct platform_data *pdata, unsigned int cpu, int pkg_flag) * when this information becomes available. */ pdata->nr_cores = NUM_REAL_CORES; - pdata->core_data = kcalloc(pdata->nr_cores, sizeof(struct temp_data *), - GFP_KERNEL); + pdata->core_data = kzalloc_objs(struct temp_data *, + pdata->nr_cores, GFP_KERNEL); if (!pdata->core_data) return NULL; } - tdata = kzalloc(sizeof(struct temp_data), GFP_KERNEL); + tdata = kzalloc_obj(struct temp_data, GFP_KERNEL); if (!tdata) return NULL; @@ -625,7 +625,7 @@ static int coretemp_device_add(int zoneid) int err; /* Initialize the per-zone data structures */ - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; @@ -804,8 +804,8 @@ static int __init coretemp_init(void) return -ENODEV; max_zones = topology_max_packages() * topology_max_dies_per_package(); - zone_devices = kcalloc(max_zones, sizeof(struct platform_device *), - GFP_KERNEL); + zone_devices = kzalloc_objs(struct platform_device *, max_zones, + GFP_KERNEL); if (!zone_devices) return -ENOMEM; diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index 9c5b021aab86..f2fa7223be7a 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -556,7 +556,7 @@ static int drivetemp_add(struct device *dev) struct drivetemp_data *st; int err; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) return -ENOMEM; diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index a303959879ef..740d46634b4c 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c @@ -1088,7 +1088,7 @@ static int fschmd_probe(struct i2c_client *client) int i, err; enum chips kind = (uintptr_t)i2c_get_match_data(client); - data = kzalloc(sizeof(struct fschmd_data), GFP_KERNEL); + data = kzalloc_obj(struct fschmd_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 714caa6a36a3..a1173ea0b029 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -533,7 +533,7 @@ static struct attribute *hwmon_genattr(const void *drvdata, if ((mode & 0222) && !ops->write) return ERR_PTR(-EINVAL); - hattr = kzalloc(sizeof(*hattr), GFP_KERNEL); + hattr = kzalloc_obj(*hattr, GFP_KERNEL); if (!hattr) return ERR_PTR(-ENOMEM); @@ -879,7 +879,7 @@ __hwmon_create_attrs(const void *drvdata, const struct hwmon_chip_info *chip) if (nattrs == 0) return ERR_PTR(-EINVAL); - attrs = kcalloc(nattrs + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, nattrs + 1, GFP_KERNEL); if (!attrs) return ERR_PTR(-ENOMEM); @@ -917,7 +917,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, if (id < 0) return ERR_PTR(id); - hwdev = kzalloc(sizeof(*hwdev), GFP_KERNEL); + hwdev = kzalloc_obj(*hwdev, GFP_KERNEL); if (hwdev == NULL) { err = -ENOMEM; goto ida_remove; @@ -933,7 +933,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, for (i = 0; groups[i]; i++) ngroups++; - hwdev->groups = kcalloc(ngroups, sizeof(*groups), GFP_KERNEL); + hwdev->groups = kzalloc_objs(*groups, ngroups, GFP_KERNEL); if (!hwdev->groups) { err = -ENOMEM; goto free_hwmon; diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index b22e0423e324..f3835606179c 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c @@ -494,7 +494,7 @@ static int i5k_amb_probe(struct platform_device *pdev) struct resource *reso; int i, res; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index daed437d34a4..e62e7bab0865 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c @@ -517,7 +517,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle) int i; int res = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return res; mutex_init(&data->lock); @@ -657,7 +657,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe, int i; int res = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return res; mutex_init(&data->lock); diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index 228c5f6c6f38..331aa8159ab8 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c @@ -367,8 +367,8 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data) return -ENOENT; data->num_sensors = err; - data->sensors = kcalloc(data->num_sensors, sizeof(*data->sensors), - GFP_KERNEL); + data->sensors = kzalloc_objs(*data->sensors, data->num_sensors, + GFP_KERNEL); if (!data->sensors) return -ENOMEM; @@ -438,7 +438,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) struct ibmpex_bmc_data *data; int err; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return; diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index 98e075e54e9d..1b0442fe2bf3 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -330,7 +330,7 @@ struct regmap *devm_regmap_init_sch56xx(struct device *dev, struct mutex *lock, if (config->reg_bits != 16 && config->val_bits != 8) return ERR_PTR(-EOPNOTSUPP); - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c index 823bff2871e1..72a4f514a78c 100644 --- a/drivers/hwmon/via-cputemp.c +++ b/drivers/hwmon/via-cputemp.c @@ -222,7 +222,7 @@ static int via_cputemp_online(unsigned int cpu) goto exit; } - pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL); + pdev_entry = kzalloc_obj(struct pdev_entry, GFP_KERNEL); if (!pdev_entry) { err = -ENOMEM; goto exit_device_put; diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 67728f60333f..8081ef3b1592 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c @@ -1650,7 +1650,7 @@ static int w83793_probe(struct i2c_client *client) int files_pwm = ARRAY_SIZE(w83793_left_pwm) / 5; int files_temp = ARRAY_SIZE(w83793_temp) / 6; - data = kzalloc(sizeof(struct w83793_data), GFP_KERNEL); + data = kzalloc_obj(struct w83793_data, GFP_KERNEL); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 69b36bae97ab..4123d4e16bbe 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -337,7 +337,7 @@ static int catu_alloc_etr_buf(struct tmc_drvdata *tmc_drvdata, csdev = tmc_etr_get_catu_device(tmc_drvdata); if (!csdev) return -ENODEV; - catu_buf = kzalloc(sizeof(*catu_buf), GFP_KERNEL); + catu_buf = kzalloc_obj(*catu_buf, GFP_KERNEL); if (!catu_buf) return -ENOMEM; diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index c660cf8adb1c..b03d228f6bf7 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -821,7 +821,7 @@ out: if (ret) return ret; - node = kzalloc(sizeof(struct coresight_node), GFP_KERNEL); + node = kzalloc_obj(struct coresight_node, GFP_KERNEL); if (!node) return -ENOMEM; @@ -840,7 +840,7 @@ struct coresight_path *coresight_build_path(struct coresight_device *source, if (!sink) return ERR_PTR(-EINVAL); - path = kzalloc(sizeof(struct coresight_path), GFP_KERNEL); + path = kzalloc_obj(struct coresight_path, GFP_KERNEL); if (!path) return ERR_PTR(-ENOMEM); @@ -1327,7 +1327,7 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) struct coresight_device *csdev; bool registered = false; - csdev = kzalloc(sizeof(*csdev), GFP_KERNEL); + csdev = kzalloc_obj(*csdev, GFP_KERNEL); if (!csdev) { ret = -ENOMEM; goto err_out; diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index d0ae10bf6128..ecb0bdc2c3e6 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -325,7 +325,7 @@ static int cti_plat_process_filter_sigs(struct cti_drvdata *drvdata, if (nr_filter_sigs > drvdata->config.nr_trig_max) return -EINVAL; - tg = kzalloc(sizeof(*tg), GFP_KERNEL); + tg = kzalloc_obj(*tg, GFP_KERNEL); if (!tg) return -ENOMEM; diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 3c8a6f795094..01d4c422fed9 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -260,7 +260,7 @@ static void *alloc_event_data(int cpu) struct etm_event_data *event_data; /* First get memory for the session's data */ - event_data = kzalloc(sizeof(struct etm_event_data), GFP_KERNEL); + event_data = kzalloc_obj(struct etm_event_data, GFP_KERNEL); if (!event_data) return NULL; diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c b/drivers/hwtracing/coresight/coresight-syscfg.c index 6836b05986e8..de2f6947f521 100644 --- a/drivers/hwtracing/coresight/coresight-syscfg.c +++ b/drivers/hwtracing/coresight/coresight-syscfg.c @@ -756,7 +756,7 @@ static int cscfg_list_add_csdev(struct coresight_device *csdev, struct cscfg_registered_csdev *csdev_item; /* allocate the list entry structure */ - csdev_item = kzalloc(sizeof(struct cscfg_registered_csdev), GFP_KERNEL); + csdev_item = kzalloc_obj(struct cscfg_registered_csdev, GFP_KERNEL); if (!csdev_item) return -ENOMEM; @@ -1190,7 +1190,7 @@ static int cscfg_create_device(void) goto create_dev_exit_unlock; } - cscfg_mgr = kzalloc(sizeof(struct cscfg_manager), GFP_KERNEL); + cscfg_mgr = kzalloc_obj(struct cscfg_manager, GFP_KERNEL); if (!cscfg_mgr) goto create_dev_exit_unlock; diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index cee82e52c4ea..7aca22d6e335 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -204,12 +204,11 @@ static int tmc_pages_alloc(struct tmc_pages *tmc_pages, struct device *real_dev = dev->parent; nr_pages = tmc_pages->nr_pages; - tmc_pages->daddrs = kcalloc(nr_pages, sizeof(*tmc_pages->daddrs), + tmc_pages->daddrs = kzalloc_objs(*tmc_pages->daddrs, nr_pages, GFP_KERNEL); if (!tmc_pages->daddrs) return -ENOMEM; - tmc_pages->pages = kcalloc(nr_pages, sizeof(*tmc_pages->pages), - GFP_KERNEL); + tmc_pages->pages = kzalloc_objs(*tmc_pages->pages, nr_pages, GFP_KERNEL); if (!tmc_pages->pages) { kfree(tmc_pages->daddrs); tmc_pages->daddrs = NULL; @@ -332,7 +331,7 @@ struct tmc_sg_table *tmc_alloc_sg_table(struct device *dev, long rc; struct tmc_sg_table *sg_table; - sg_table = kzalloc(sizeof(*sg_table), GFP_KERNEL); + sg_table = kzalloc_obj(*sg_table, GFP_KERNEL); if (!sg_table) return ERR_PTR(-ENOMEM); sg_table->data_pages.nr_pages = nr_dpages; @@ -575,7 +574,7 @@ tmc_init_etr_sg_table(struct device *dev, int node, struct tmc_sg_table *sg_table; struct etr_sg_table *etr_table; - etr_table = kzalloc(sizeof(*etr_table), GFP_KERNEL); + etr_table = kzalloc_obj(*etr_table, GFP_KERNEL); if (!etr_table) return ERR_PTR(-ENOMEM); nr_entries = tmc_etr_sg_table_entries(nr_dpages); @@ -612,7 +611,7 @@ static int tmc_etr_alloc_flat_buf(struct tmc_drvdata *drvdata, if (pages) return -EINVAL; - flat_buf = kzalloc(sizeof(*flat_buf), GFP_KERNEL); + flat_buf = kzalloc_obj(*flat_buf, GFP_KERNEL); if (!flat_buf) return -ENOMEM; @@ -710,7 +709,7 @@ static int tmc_etr_alloc_resrv_buf(struct tmc_drvdata *drvdata, if (pages) return -EINVAL; - resrv_buf = kzalloc(sizeof(*resrv_buf), GFP_KERNEL); + resrv_buf = kzalloc_obj(*resrv_buf, GFP_KERNEL); if (!resrv_buf) return -ENOMEM; @@ -942,7 +941,7 @@ static struct etr_buf *tmc_alloc_etr_buf(struct tmc_drvdata *drvdata, struct device *dev = &drvdata->csdev->dev; get_etr_buf_hw(dev, &buf_hw); - etr_buf = kzalloc(sizeof(*etr_buf), GFP_KERNEL); + etr_buf = kzalloc_obj(*etr_buf, GFP_KERNEL); if (!etr_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 474861903f6c..257dd5689c81 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -751,7 +751,7 @@ static void *arm_trbe_alloc_buffer(struct coresight_device *csdev, if (!buf) return NULL; - pglist = kcalloc(nr_pages, sizeof(*pglist), GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); if (!pglist) { kfree(buf); return NULL; diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index 2482ecf5776b..641efa0016e0 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -891,7 +891,7 @@ intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata, int err, r, nr_mmios = 0; struct intel_th *th; - th = kzalloc(sizeof(*th), GFP_KERNEL); + th = kzalloc_obj(*th, GFP_KERNEL); if (!th) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwtracing/intel_th/msu-sink.c b/drivers/hwtracing/intel_th/msu-sink.c index 256ce3260ad9..d3373be9109b 100644 --- a/drivers/hwtracing/intel_th/msu-sink.c +++ b/drivers/hwtracing/intel_th/msu-sink.c @@ -23,7 +23,7 @@ static void *msu_sink_assign(struct device *dev, int *mode) { struct msu_sink_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c index f3a13b300835..33e16c40f0ec 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c @@ -236,7 +236,7 @@ int intel_th_msu_buffer_register(const struct msu_buffer *mbuf, struct msu_buffer_entry *mbe; int ret = 0; - mbe = kzalloc(sizeof(*mbe), GFP_KERNEL); + mbe = kzalloc_obj(*mbe, GFP_KERNEL); if (!mbe) return -ENOMEM; @@ -450,7 +450,7 @@ static struct msc_iter *msc_iter_install(struct msc *msc) { struct msc_iter *iter; - iter = kzalloc(sizeof(*iter), GFP_KERNEL); + iter = kzalloc_obj(*iter, GFP_KERNEL); if (!iter) return ERR_PTR(-ENOMEM); @@ -1105,7 +1105,7 @@ static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks) if (!nr_blocks) return 0; - win = kzalloc(sizeof(*win), GFP_KERNEL); + win = kzalloc_obj(*win, GFP_KERNEL); if (!win) return -ENOMEM; diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 3090479a2979..3d7a80dacce5 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -384,7 +384,7 @@ hisi_ptt_alloc_add_filter(struct hisi_ptt *hisi_ptt, u16 devid, bool is_port) return NULL; } - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) { pci_err(hisi_ptt->pdev, "failed to add filter for %s\n", filter_name); @@ -1043,11 +1043,11 @@ static void *hisi_ptt_pmu_setup_aux(struct perf_event *event, void **pages, if (nr_pages < HISI_PTT_TRACE_TOTAL_BUF_SIZE / PAGE_SIZE) return NULL; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return NULL; - pagelist = kcalloc(nr_pages, sizeof(*pagelist), GFP_KERNEL); + pagelist = kzalloc_objs(*pagelist, nr_pages, GFP_KERNEL); if (!pagelist) goto err; diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index cdba4e875b28..b3df3104aa3d 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -160,9 +160,9 @@ static int stp_master_alloc(struct stm_device *stm, unsigned int idx) { struct stp_master *master; - master = kzalloc(struct_size(master, chan_map, - BITS_TO_LONGS(stm->data->sw_nchannels)), - GFP_ATOMIC); + master = kzalloc_flex(*master, chan_map, + BITS_TO_LONGS(stm->data->sw_nchannels), + GFP_ATOMIC); if (!master) return -ENOMEM; @@ -406,7 +406,7 @@ int stm_register_protocol(const struct stm_protocol_driver *pdrv) goto unlock; } - pe = kzalloc(sizeof(*pe), GFP_KERNEL); + pe = kzalloc_obj(*pe, GFP_KERNEL); if (!pe) goto unlock; @@ -493,7 +493,7 @@ static int stm_char_open(struct inode *inode, struct file *file) if (!dev) return -ENODEV; - stmf = kzalloc(sizeof(*stmf), GFP_KERNEL); + stmf = kzalloc_obj(*stmf, GFP_KERNEL); if (!stmf) goto err_put_device; @@ -1229,7 +1229,7 @@ int stm_source_register_device(struct device *parent, if (!stm_core_up) return -EPROBE_DEFER; - src = kzalloc(sizeof(*src), GFP_KERNEL); + src = kzalloc_obj(*src, GFP_KERNEL); if (!src) return -ENOMEM; diff --git a/drivers/hwtracing/stm/p_sys-t.c b/drivers/hwtracing/stm/p_sys-t.c index 1e75aa0025a3..bcbbc4d92325 100644 --- a/drivers/hwtracing/stm/p_sys-t.c +++ b/drivers/hwtracing/stm/p_sys-t.c @@ -128,7 +128,7 @@ static int sys_t_output_open(void *priv, struct stm_output *output) struct sys_t_policy_node *pn = priv; struct sys_t_output *opriv; - opriv = kzalloc(sizeof(*opriv), GFP_ATOMIC); + opriv = kzalloc_obj(*opriv, GFP_ATOMIC); if (!opriv) return -ENOMEM; diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index 42103c3a177f..f0f8876008ed 100644 --- a/drivers/hwtracing/stm/policy.c +++ b/drivers/hwtracing/stm/policy.c @@ -437,7 +437,7 @@ stp_policy_make(struct config_group *group, const char *name) goto unlock_policy; } - stm->policy = kzalloc(sizeof(*stm->policy), GFP_KERNEL); + stm->policy = kzalloc_obj(*stm->policy, GFP_KERNEL); if (!stm->policy) { ret = ERR_PTR(-ENOMEM); goto unlock_policy; diff --git a/drivers/i2c/busses/i2c-cp2615.c b/drivers/i2c/busses/i2c-cp2615.c index e7720ea4045e..b9a86eb10cc2 100644 --- a/drivers/i2c/busses/i2c-cp2615.c +++ b/drivers/i2c/busses/i2c-cp2615.c @@ -124,7 +124,7 @@ static int cp2615_check_status(enum cp2615_i2c_status status) static int cp2615_i2c_send(struct usb_interface *usbif, struct cp2615_i2c_transfer *i2c_w) { - struct cp2615_iop_msg *msg = kzalloc(sizeof(*msg), GFP_KERNEL); + struct cp2615_iop_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); struct usb_device *usbdev = interface_to_usbdev(usbif); int res = cp2615_init_i2c_msg(msg, i2c_w); @@ -143,7 +143,7 @@ cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf) struct cp2615_i2c_transfer_result *i2c_r; int res; - msg = kzalloc(sizeof(*msg), GFP_KERNEL); + msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -171,7 +171,7 @@ cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf) /* Checks if the IOP is functional by querying the part's ID */ static int cp2615_check_iop(struct usb_interface *usbif) { - struct cp2615_iop_msg *msg = kzalloc(sizeof(*msg), GFP_KERNEL); + struct cp2615_iop_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); struct cp2615_iop_accessory_info *info = (struct cp2615_iop_accessory_info *)&msg->data; struct usb_device *usbdev = interface_to_usbdev(usbif); int res = cp2615_init_iop_msg(msg, iop_GetAccessoryInfo, NULL, 0); diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 260e1643c2cc..dbe90974167a 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c @@ -636,7 +636,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev) struct cpm_i2c *cpm; const u32 *data; - cpm = kzalloc(sizeof(struct cpm_i2c), GFP_KERNEL); + cpm = kzalloc_obj(struct cpm_i2c, GFP_KERNEL); if (!cpm) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c index 404571ad61a8..c4d3b0ee6f4d 100644 --- a/drivers/i2c/busses/i2c-designware-amdpsp.c +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c @@ -93,7 +93,7 @@ static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type) int status, ret; /* Allocate command-response buffer */ - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c index c02459405b26..ba0a2e03f490 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c @@ -445,7 +445,7 @@ static int diolan_u2c_probe(struct usb_interface *interface, return -ENODEV; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; goto error; diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 27ea3c130a16..65ac713e8a84 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c @@ -720,7 +720,7 @@ static int pch_i2c_probe(struct pci_dev *pdev, pch_pci_dbg(pdev, "Entered.\n"); - adap_info = kzalloc((sizeof(struct adapter_info)), GFP_KERNEL); + adap_info = kzalloc_obj(struct adapter_info, GFP_KERNEL); if (adap_info == NULL) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c index 3a7e577e6eac..77b4129e1ee6 100644 --- a/drivers/i2c/busses/i2c-fsi.c +++ b/drivers/i2c/busses/i2c-fsi.c @@ -707,7 +707,7 @@ static int fsi_i2c_probe(struct fsi_device *fsi_dev) if (!of_device_is_available(np)) continue; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) { of_node_put(np); break; diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index 78c5845e0877..ddea5847f0c5 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c @@ -365,7 +365,7 @@ static int highlander_i2c_probe(struct platform_device *pdev) return -ENODEV; } - dev = kzalloc(sizeof(struct highlander_i2c_dev), GFP_KERNEL); + dev = kzalloc_obj(struct highlander_i2c_dev, GFP_KERNEL); if (unlikely(!dev)) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 6bf45d752ff9..ca2534bba932 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -687,7 +687,7 @@ static int iic_probe(struct platform_device *ofdev) const u32 *freq; int ret; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index ce5ca5b90b39..f5c1d2191c98 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c @@ -415,13 +415,13 @@ iop3xx_i2c_probe(struct platform_device *pdev) struct i2c_adapter *new_adapter; struct i2c_algo_iop3xx_data *adapter_data; - new_adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); + new_adapter = kzalloc_obj(struct i2c_adapter, GFP_KERNEL); if (!new_adapter) { ret = -ENOMEM; goto out; } - adapter_data = kzalloc(sizeof(struct i2c_algo_iop3xx_data), GFP_KERNEL); + adapter_data = kzalloc_obj(struct i2c_algo_iop3xx_data, GFP_KERNEL); if (!adapter_data) { ret = -ENOMEM; goto free_adapter; diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index d58a308582e4..b673206313fc 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -359,7 +359,7 @@ static int nforce2_probe(struct pci_dev *dev, const struct pci_device_id *id) int res1, res2; /* we support 2 SMBus adapters */ - smbuses = kcalloc(2, sizeof(struct nforce2_smbus), GFP_KERNEL); + smbuses = kzalloc_objs(struct nforce2_smbus, 2, GFP_KERNEL); if (!smbuses) return -ENOMEM; pci_set_drvdata(dev, smbuses); diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 3249bbd5eb43..5ae1c7f8b9b5 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c @@ -288,7 +288,7 @@ static void i2c_parport_attach(struct parport *port) return; } - adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL); + adapter = kzalloc_obj(struct i2c_par, GFP_KERNEL); if (!adapter) return; memset(&i2c_parport_cb, 0, sizeof(i2c_parport_cb)); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index ac3bb550303f..e159a9aed41f 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -919,7 +919,7 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba, struct i2c_piix4_adapdata *adapdata; int retval; - adap = kzalloc(sizeof(*adap), GFP_KERNEL); + adap = kzalloc_obj(*adap, GFP_KERNEL); if (adap == NULL) { release_region(smba, SMBIOSIZE); return -ENOMEM; @@ -930,7 +930,7 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba, adap->algo = sb800_main ? &piix4_smbus_algorithm_sb800 : &smbus_algorithm; - adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL); + adapdata = kzalloc_obj(*adapdata, GFP_KERNEL); if (adapdata == NULL) { kfree(adap); release_region(smba, SMBIOSIZE); diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index af2094720a4d..c80a054fc4e9 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c @@ -112,7 +112,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev, dev_err(&dev->dev, "Missing device tree node.\n"); return -EINVAL; } - sds = kzalloc(sizeof(*sds), GFP_KERNEL); + sds = kzalloc_obj(*sds, GFP_KERNEL); if (!sds) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index ae609bdd2ec4..9958920f635e 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -799,7 +799,8 @@ static int geni_i2c_gpi_xfer(struct geni_i2c_dev *gi2c, struct i2c_msg msgs[], i if (gi2c->is_tx_multi_desc_xfer) { tx_multi_xfer->dma_buf = kcalloc(num, sizeof(void *), GFP_KERNEL); - tx_multi_xfer->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_KERNEL); + tx_multi_xfer->dma_addr = kzalloc_objs(dma_addr_t, num, + GFP_KERNEL); if (!tx_multi_xfer->dma_buf || !tx_multi_xfer->dma_addr) { ret = -ENOMEM; goto err; diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c index 10a5146b3aa5..c10ad0677949 100644 --- a/drivers/i2c/busses/i2c-scmi.c +++ b/drivers/i2c/busses/i2c-scmi.c @@ -359,7 +359,7 @@ static int smbus_cmi_probe(struct platform_device *device) struct acpi_smbus_cmi *smbus_cmi; int ret; - smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL); + smbus_cmi = kzalloc_obj(struct acpi_smbus_cmi, GFP_KERNEL); if (!smbus_cmi) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index 43f33988b98f..dcdf56398f70 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c @@ -443,7 +443,7 @@ static int sh7760_i2c_probe(struct platform_device *pdev) goto out0; } - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { ret = -ENOMEM; goto out0; diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c index d90606048611..9572357cc177 100644 --- a/drivers/i2c/busses/i2c-simtec.c +++ b/drivers/i2c/busses/i2c-simtec.c @@ -64,7 +64,7 @@ static int simtec_i2c_probe(struct platform_device *dev) int size; int ret; - pd = kzalloc(sizeof(struct simtec_i2c_data), GFP_KERNEL); + pd = kzalloc_obj(struct simtec_i2c_data, GFP_KERNEL); if (pd == NULL) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index dc69ed934ec8..e2388862f29e 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -544,7 +544,7 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev, if (((sdadel >= sdadel_min) && (sdadel <= sdadel_max)) && (p != p_prev)) { - v = kmalloc(sizeof(*v), GFP_KERNEL); + v = kmalloc_obj(*v, GFP_KERNEL); if (!v) { ret = -ENOMEM; goto exit; diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c index cb97f72291bc..e8a89b7d2174 100644 --- a/drivers/i2c/busses/i2c-taos-evm.c +++ b/drivers/i2c/busses/i2c-taos-evm.c @@ -203,7 +203,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv) char *name; int err; - taos = kzalloc(sizeof(struct taos_data), GFP_KERNEL); + taos = kzalloc_obj(struct taos_data, GFP_KERNEL); if (!taos) { err = -ENOMEM; goto exit; diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index 57dfe5f1a7d9..ab021042901b 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c @@ -55,7 +55,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) struct i2c_msg *pmsg; int i, ret; - pstatus = kmalloc(sizeof(*pstatus), GFP_KERNEL); + pstatus = kmalloc_obj(*pstatus, GFP_KERNEL); if (!pstatus) return -ENOMEM; @@ -123,7 +123,7 @@ static u32 usb_func(struct i2c_adapter *adapter) __le32 *pfunc; u32 ret; - pfunc = kmalloc(sizeof(*pfunc), GFP_KERNEL); + pfunc = kmalloc_obj(*pfunc, GFP_KERNEL); /* get functionality from adapter */ if (!pfunc || usb_read(adapter, CMD_GET_FUNC, 0, 0, pfunc, @@ -233,7 +233,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface, dev_dbg(&interface->dev, "probing usb device\n"); /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto error; diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c index af1381949f50..01ef98e90243 100644 --- a/drivers/i2c/busses/i2c-virtio.c +++ b/drivers/i2c/busses/i2c-virtio.c @@ -139,7 +139,7 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, struct virtio_i2c_req *reqs; int count; - reqs = kcalloc(num, sizeof(*reqs), GFP_KERNEL); + reqs = kzalloc_objs(*reqs, num, GFP_KERNEL); if (!reqs) return -ENOMEM; diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 06cf221557f2..1c76aef0a423 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c @@ -418,7 +418,7 @@ static struct scx200_acb_iface *scx200_create_iface(const char *text, struct scx200_acb_iface *iface; struct i2c_adapter *adapter; - iface = kzalloc(sizeof(*iface), GFP_KERNEL); + iface = kzalloc_obj(*iface, GFP_KERNEL); if (!iface) return NULL; diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c index dd194476b118..8e3fe365caaf 100644 --- a/drivers/i2c/i2c-atr.c +++ b/drivers/i2c/i2c-atr.c @@ -137,7 +137,7 @@ static struct i2c_atr_alias_pool *i2c_atr_alloc_alias_pool(size_t num_aliases, b struct i2c_atr_alias_pool *alias_pool; int ret; - alias_pool = kzalloc(sizeof(*alias_pool), GFP_KERNEL); + alias_pool = kzalloc_obj(*alias_pool, GFP_KERNEL); if (!alias_pool) return ERR_PTR(-ENOMEM); @@ -183,7 +183,7 @@ static struct i2c_atr_alias_pair *i2c_atr_create_c2a(struct i2c_atr_chan *chan, lockdep_assert_held(&chan->alias_pairs_lock); - c2a = kzalloc(sizeof(*c2a), GFP_KERNEL); + c2a = kzalloc_obj(*c2a, GFP_KERNEL); if (!c2a) return NULL; @@ -724,7 +724,7 @@ struct i2c_atr *i2c_atr_new(struct i2c_adapter *parent, struct device *dev, if (!ops || !ops->attach_addr || !ops->detach_addr) return ERR_PTR(-EINVAL); - atr = kzalloc(struct_size(atr, adapter, max_adapters), GFP_KERNEL); + atr = kzalloc_flex(*atr, adapter, max_adapters, GFP_KERNEL); if (!atr) return ERR_PTR(-ENOMEM); @@ -800,7 +800,7 @@ int i2c_atr_add_adapter(struct i2c_atr *atr, struct i2c_atr_adap_desc *desc) return -EEXIST; } - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return -ENOMEM; diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c index 4df8ad092df3..31fcc051bf20 100644 --- a/drivers/i2c/i2c-boardinfo.c +++ b/drivers/i2c/i2c-boardinfo.c @@ -61,7 +61,7 @@ int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsig for (status = 0; len; len--, info++) { struct i2c_devinfo *devinfo; - devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); + devinfo = kzalloc_obj(*devinfo, GFP_KERNEL); if (!devinfo) { pr_debug("i2c-core: can't register boardinfo!\n"); status = -ENOMEM; diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index ed90858a27b7..5b16d76a5bc2 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -683,7 +683,7 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command, if (ACPI_FAILURE(ret)) return ret; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) { ret = AE_NO_MEMORY; goto err; @@ -793,8 +793,7 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) if (!handle) return -ENODEV; - data = kzalloc(sizeof(struct i2c_acpi_handler_data), - GFP_KERNEL); + data = kzalloc_obj(struct i2c_acpi_handler_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index f0fb0cfd56e0..91b388070525 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -964,7 +964,7 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf bool need_put = false; int status; - client = kzalloc(sizeof *client, GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return ERR_PTR(-ENOMEM); @@ -2529,7 +2529,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) return 0; /* Set up a temporary client to help detect callback */ - temp_client = kzalloc(sizeof(*temp_client), GFP_KERNEL); + temp_client = kzalloc_obj(*temp_client, GFP_KERNEL); if (!temp_client) return -ENOMEM; diff --git a/drivers/i2c/i2c-core-of-prober.c b/drivers/i2c/i2c-core-of-prober.c index 0a66267e4836..8c820d70846a 100644 --- a/drivers/i2c/i2c-core-of-prober.c +++ b/drivers/i2c/i2c-core-of-prober.c @@ -63,7 +63,7 @@ static int i2c_of_probe_enable_node(struct device *dev, struct device_node *node dev_dbg(dev, "Enabling %pOF\n", node); - struct of_changeset *ocs __free(kfree) = kzalloc(sizeof(*ocs), GFP_KERNEL); + struct of_changeset *ocs __free(kfree) = kzalloc_obj(*ocs, GFP_KERNEL); if (!ocs) return -ENOMEM; diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index e9577f920286..e4ac9f2df8d5 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -74,7 +74,7 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap) return ERR_PTR(-ENODEV); } - i2c_dev = kzalloc(sizeof(*i2c_dev), GFP_KERNEL); + i2c_dev = kzalloc_obj(*i2c_dev, GFP_KERNEL); if (!i2c_dev) return ERR_PTR(-ENOMEM); i2c_dev->adap = adap; @@ -552,8 +552,8 @@ static long compat_i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned lo if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS) return -EINVAL; - rdwr_pa = kmalloc_array(rdwr_arg.nmsgs, sizeof(struct i2c_msg), - GFP_KERNEL); + rdwr_pa = kmalloc_objs(struct i2c_msg, rdwr_arg.nmsgs, + GFP_KERNEL); if (!rdwr_pa) return -ENOMEM; @@ -612,7 +612,7 @@ static int i2cdev_open(struct inode *inode, struct file *file) * or I2C core code!! It just holds private copies of addressing * information and maybe a PEC flag. */ - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) { i2c_put_adapter(adap); return -ENOMEM; diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index d59644e50f14..2e7b4073a4df 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -277,7 +277,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, return -EINVAL; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 0316b347f9e7..14e45590e97e 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -319,8 +319,7 @@ struct i2c_client *i2c_new_slave_host_notify_device(struct i2c_adapter *adapter) struct i2c_client *client; int ret; - status = kzalloc(sizeof(struct i2c_slave_host_notify_status), - GFP_KERNEL); + status = kzalloc_obj(struct i2c_slave_host_notify_status, GFP_KERNEL); if (!status) return ERR_PTR(-ENOMEM); diff --git a/drivers/i2c/i2c-stub.c b/drivers/i2c/i2c-stub.c index 09e7b7bf4c5f..1d7d105c5643 100644 --- a/drivers/i2c/i2c-stub.c +++ b/drivers/i2c/i2c-stub.c @@ -372,8 +372,7 @@ static int __init i2c_stub_init(void) /* Allocate memory for all chips at once */ stub_chips_nr = i; - stub_chips = kcalloc(stub_chips_nr, sizeof(struct stub_chip), - GFP_KERNEL); + stub_chips = kzalloc_objs(struct stub_chip, stub_chips_nr, GFP_KERNEL); if (!stub_chips) return -ENOMEM; diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 0eae19b3823d..161eab16d17e 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -858,7 +858,7 @@ i3c_master_alloc_i2c_dev(struct i3c_master_controller *master, { struct i2c_dev_desc *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); @@ -983,7 +983,7 @@ i3c_master_alloc_i3c_dev(struct i3c_master_controller *master, { struct i3c_dev_desc *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); @@ -1742,7 +1742,7 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) if (desc->dev || !desc->info.dyn_addr || desc == master->this) continue; - desc->dev = kzalloc(sizeof(*desc->dev), GFP_KERNEL); + desc->dev = kzalloc_obj(*desc->dev, GFP_KERNEL); if (!desc->dev) continue; @@ -1852,7 +1852,8 @@ struct i3c_dma *i3c_master_dma_map_single(struct device *dev, void *buf, void *bounce __free(kfree) = NULL; void *dma_buf = buf; - struct i3c_dma *dma_xfer __free(kfree) = kzalloc(sizeof(*dma_xfer), GFP_KERNEL); + struct i3c_dma *dma_xfer __free(kfree) = kzalloc_obj(*dma_xfer, + GFP_KERNEL); if (!dma_xfer) return NULL; @@ -2847,7 +2848,7 @@ i3c_generic_ibi_alloc_pool(struct i3c_dev_desc *dev, unsigned int i; int ret; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); @@ -2855,7 +2856,7 @@ i3c_generic_ibi_alloc_pool(struct i3c_dev_desc *dev, INIT_LIST_HEAD(&pool->free_slots); INIT_LIST_HEAD(&pool->pending); - pool->slots = kcalloc(req->num_slots, sizeof(*slot), GFP_KERNEL); + pool->slots = kzalloc_objs(*slot, req->num_slots, GFP_KERNEL); if (!pool->slots) { ret = -ENOMEM; goto err_free_pool; @@ -3218,7 +3219,7 @@ int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev, if (dev->ibi) return -EBUSY; - ibi = kzalloc(sizeof(*ibi), GFP_KERNEL); + ibi = kzalloc_obj(*ibi, GFP_KERNEL); if (!ibi) return -ENOMEM; diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c index 6380a38e6d29..e60dc306a03e 100644 --- a/drivers/i3c/master/adi-i3c-master.c +++ b/drivers/i3c/master/adi-i3c-master.c @@ -187,7 +187,7 @@ static struct adi_i3c_xfer *adi_i3c_master_alloc_xfer(struct adi_i3c_master *mas { struct adi_i3c_xfer *xfer; - xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL); + xfer = kzalloc_flex(*xfer, cmds, ncmds, GFP_KERNEL); if (!xfer) return NULL; @@ -459,7 +459,7 @@ static int adi_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) int slot; u8 addr; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -531,7 +531,7 @@ static int adi_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c index 7eb09ad10171..e4740cd07c66 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -382,7 +382,7 @@ dw_i3c_master_alloc_xfer(struct dw_i3c_master *master, unsigned int ncmds) { struct dw_i3c_xfer *xfer; - xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL); + xfer = kzalloc_flex(*xfer, cmds, ncmds, GFP_KERNEL); if (!xfer) return NULL; @@ -1044,7 +1044,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1162,7 +1162,7 @@ static int dw_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c index 8eb76b8ca2b0..2f31e7ef3ea8 100644 --- a/drivers/i3c/master/i3c-master-cdns.c +++ b/drivers/i3c/master/i3c-master-cdns.c @@ -498,7 +498,7 @@ cdns_i3c_master_alloc_xfer(struct cdns_i3c_master *master, unsigned int ncmds) { struct cdns_i3c_xfer *xfer; - xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL); + xfer = kzalloc_flex(*xfer, cmds, ncmds, GFP_KERNEL); if (!xfer) return NULL; @@ -940,7 +940,7 @@ static int cdns_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) struct cdns_i3c_i2c_dev_data *data; int slot; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -991,7 +991,7 @@ static int cdns_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index e925584113d1..a527e7305c09 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -410,7 +410,7 @@ static int i3c_hci_attach_i3c_dev(struct i3c_dev_desc *dev) struct i3c_hci_dev_data *dev_data; int ret; - dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) return -ENOMEM; if (hci->cmd == &mipi_i3c_hci_cmd_v1) { @@ -460,7 +460,7 @@ static int i3c_hci_attach_i2c_dev(struct i2c_dev_desc *dev) if (hci->cmd != &mipi_i3c_hci_cmd_v1) return 0; - dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) return -ENOMEM; ret = mipi_i3c_hci_dat_v1.alloc_entry(hci); diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c index 2e5b4974d431..cdba4c9c839d 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -328,7 +328,7 @@ static int hci_dma_init(struct i3c_hci *hci) } if (nr_rings > XFER_RINGS) nr_rings = XFER_RINGS; - rings = kzalloc(struct_size(rings, headers, nr_rings), GFP_KERNEL); + rings = kzalloc_flex(*rings, headers, nr_rings, GFP_KERNEL); if (!rings) return -ENOMEM; hci->io_data = rings; @@ -363,8 +363,8 @@ static int hci_dma_init(struct i3c_hci *hci) rh->resp = dma_alloc_coherent(rings->sysdev, resps_sz, &rh->resp_dma, GFP_KERNEL); rh->src_xfers = - kmalloc_array(rh->xfer_entries, sizeof(*rh->src_xfers), - GFP_KERNEL); + kmalloc_objs(*rh->src_xfers, rh->xfer_entries, + GFP_KERNEL); ret = -ENOMEM; if (!rh->xfer || !rh->resp || !rh->src_xfers) goto err_out; @@ -636,7 +636,7 @@ static int hci_dma_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev, struct i3c_generic_ibi_pool *pool; struct hci_dma_dev_ibi_data *dev_ibi; - dev_ibi = kmalloc(sizeof(*dev_ibi), GFP_KERNEL); + dev_ibi = kmalloc_obj(*dev_ibi, GFP_KERNEL); if (!dev_ibi) return -ENOMEM; pool = i3c_generic_ibi_alloc_pool(dev, req); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 6035f74212db..7d57ebba0c24 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -107,7 +107,7 @@ struct hci_xfer { static inline struct hci_xfer *hci_alloc_xfer(unsigned int n) { - return kcalloc(n, sizeof(struct hci_xfer), GFP_KERNEL); + return kzalloc_objs(struct hci_xfer, n, GFP_KERNEL); } static inline void hci_free_xfer(struct hci_xfer *xfer, unsigned int n) diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c index 0f05a15c14c7..4fa3d5cf14d2 100644 --- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c +++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c @@ -242,7 +242,7 @@ static void mipi_i3c_hci_pci_setup_cell(struct mipi_i3c_hci_pci *hci, int idx, cell->resources = &data->res; } -#define mipi_i3c_hci_pci_alloc(h, x) kcalloc((h)->info->instance_count, sizeof(*(x)), GFP_KERNEL) +#define mipi_i3c_hci_pci_alloc(h, x) kzalloc_objs(*(x), (h)->info->instance_count, GFP_KERNEL) static int mipi_i3c_hci_pci_add_instances(struct mipi_i3c_hci_pci *hci) { diff --git a/drivers/i3c/master/mipi-i3c-hci/pio.c b/drivers/i3c/master/mipi-i3c-hci/pio.c index 8e868e81acda..0c333e40378c 100644 --- a/drivers/i3c/master/mipi-i3c-hci/pio.c +++ b/drivers/i3c/master/mipi-i3c-hci/pio.c @@ -977,7 +977,7 @@ static int hci_pio_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev, struct i3c_generic_ibi_pool *pool; struct hci_pio_dev_ibi_data *dev_ibi; - dev_ibi = kmalloc(sizeof(*dev_ibi), GFP_KERNEL); + dev_ibi = kmalloc_obj(*dev_ibi, GFP_KERNEL); if (!dev_ibi) return -ENOMEM; pool = i3c_generic_ibi_alloc_pool(dev, req); diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c index 528bccc2c68e..a100bbaabf2d 100644 --- a/drivers/i3c/master/renesas-i3c.c +++ b/drivers/i3c/master/renesas-i3c.c @@ -345,7 +345,7 @@ static struct renesas_i3c_xfer *renesas_i3c_alloc_xfer(struct renesas_i3c *i3c, { struct renesas_i3c_xfer *xfer; - xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL); + xfer = kzalloc_flex(*xfer, cmds, ncmds, GFP_KERNEL); if (!xfer) return NULL; @@ -874,7 +874,7 @@ static int renesas_i3c_attach_i3c_dev(struct i3c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -984,7 +984,7 @@ static int renesas_i3c_attach_i2c_dev(struct i2c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 857504d36e18..0e3b1a7be6a4 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -900,7 +900,7 @@ static int svc_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { svc_i3c_master_release_slot(master, slot); return -ENOMEM; @@ -953,7 +953,7 @@ static int svc_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { svc_i3c_master_release_slot(master, slot); return -ENOMEM; @@ -1504,7 +1504,7 @@ svc_i3c_master_alloc_xfer(struct svc_i3c_master *master, unsigned int ncmds) { struct svc_i3c_xfer *xfer; - xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL); + xfer = kzalloc_flex(*xfer, cmds, ncmds, GFP_KERNEL); if (!xfer) return NULL; diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c index 8eb717b11cff..14d95d63f277 100644 --- a/drivers/iio/adc/ti-tsc2046.c +++ b/drivers/iio/adc/ti-tsc2046.c @@ -290,15 +290,15 @@ static int tsc2046_adc_read_one(struct tsc2046_adc_priv *priv, int ch_idx, if (sizeof(struct tsc2046_adc_atom) * max_count > PAGE_SIZE) return -ENOSPC; - struct tsc2046_adc_atom *tx_buf __free(kfree) = kcalloc(max_count, - sizeof(*tx_buf), - GFP_KERNEL); + struct tsc2046_adc_atom *tx_buf __free(kfree) = kzalloc_objs(*tx_buf, + max_count, + GFP_KERNEL); if (!tx_buf) return -ENOMEM; - struct tsc2046_adc_atom *rx_buf __free(kfree) = kcalloc(max_count, - sizeof(*rx_buf), - GFP_KERNEL); + struct tsc2046_adc_atom *rx_buf __free(kfree) = kzalloc_objs(*rx_buf, + max_count, + GFP_KERNEL); if (!rx_buf) return -ENOMEM; diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c index f4ebff968493..7a251b030b7e 100644 --- a/drivers/iio/buffer/industrialio-buffer-cb.c +++ b/drivers/iio/buffer/industrialio-buffer-cb.c @@ -60,7 +60,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, return ERR_PTR(-EINVAL); } - cb_buff = kzalloc(sizeof(*cb_buff), GFP_KERNEL); + cb_buff = kzalloc_obj(*cb_buff, GFP_KERNEL); if (cb_buff == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c index 1c94b334f987..2425e1113a7d 100644 --- a/drivers/iio/buffer/industrialio-buffer-dma.c +++ b/drivers/iio/buffer/industrialio-buffer-dma.c @@ -174,7 +174,7 @@ iio_dma_buffer_alloc_block(struct iio_dma_buffer_queue *queue, size_t size, bool fileio) { struct iio_dma_buffer_block *block __free(kfree) = - kzalloc(sizeof(*block), GFP_KERNEL); + kzalloc_obj(*block, GFP_KERNEL); if (!block) return NULL; diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c index 0d3454f4adb0..23b4ac7cca9c 100644 --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c @@ -224,7 +224,7 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct dma_chan *chan) if (ret < 0) return ERR_PTR(ret); - dmaengine_buffer = kzalloc(sizeof(*dmaengine_buffer), GFP_KERNEL); + dmaengine_buffer = kzalloc_obj(*dmaengine_buffer, GFP_KERNEL); if (!dmaengine_buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c index 526b2a8d725d..9745b3bd4ac7 100644 --- a/drivers/iio/buffer/industrialio-hw-consumer.c +++ b/drivers/iio/buffer/industrialio-hw-consumer.c @@ -60,7 +60,7 @@ static struct hw_consumer_buffer *iio_hw_consumer_get_buffer( return buf; } - buf = kzalloc(struct_size(buf, scan_mask, mask_longs), GFP_KERNEL); + buf = kzalloc_flex(*buf, scan_mask, mask_longs, GFP_KERNEL); if (!buf) return NULL; @@ -87,7 +87,7 @@ struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev) struct iio_channel *chan; int ret; - hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); + hwc = kzalloc_obj(*hwc, GFP_KERNEL); if (!hwc) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c index 38034c8bcc04..73e2cd7e7313 100644 --- a/drivers/iio/buffer/kfifo_buf.c +++ b/drivers/iio/buffer/kfifo_buf.c @@ -204,7 +204,7 @@ struct iio_buffer *iio_kfifo_allocate(void) { struct iio_kfifo *kf; - kf = kzalloc(sizeof(*kf), GFP_KERNEL); + kf = kzalloc_obj(*kf, GFP_KERNEL); if (!kf) return NULL; diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c index b7f093d7345b..5fd9ef819417 100644 --- a/drivers/iio/common/ssp_sensors/ssp_spi.c +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c @@ -77,7 +77,7 @@ static struct ssp_msg *ssp_create_msg(u8 cmd, u16 len, u16 opt, u32 data) struct ssp_msg_header h; struct ssp_msg *msg; - msg = kzalloc(sizeof(*msg), GFP_KERNEL); + msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) return NULL; diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c index 8271849b1c83..f95983f81f63 100644 --- a/drivers/iio/dac/ad5360.c +++ b/drivers/iio/dac/ad5360.c @@ -439,8 +439,8 @@ static int ad5360_alloc_channels(struct iio_dev *indio_dev) struct iio_chan_spec *channels; unsigned int i; - channels = kcalloc(st->chip_info->num_channels, - sizeof(struct iio_chan_spec), GFP_KERNEL); + channels = kzalloc_objs(struct iio_chan_spec, + st->chip_info->num_channels, GFP_KERNEL); if (!channels) return -ENOMEM; diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c index 16d3f144dda0..84bc2281c03a 100644 --- a/drivers/iio/dummy/iio_dummy_evgen.c +++ b/drivers/iio/dummy/iio_dummy_evgen.c @@ -47,7 +47,7 @@ static int iio_dummy_evgen_create(void) { int ret; - iio_evgen = kzalloc(sizeof(*iio_evgen), GFP_KERNEL); + iio_evgen = kzalloc_obj(*iio_evgen, GFP_KERNEL); if (!iio_evgen) return -ENOMEM; diff --git a/drivers/iio/dummy/iio_simple_dummy.c b/drivers/iio/dummy/iio_simple_dummy.c index 8575d4a08963..cba19b6a23cb 100644 --- a/drivers/iio/dummy/iio_simple_dummy.c +++ b/drivers/iio/dummy/iio_simple_dummy.c @@ -588,7 +588,7 @@ static struct iio_sw_device *iio_dummy_probe(const char *name) * parent = &client->dev; */ - swd = kzalloc(sizeof(*swd), GFP_KERNEL); + swd = kzalloc_obj(*swd, GFP_KERNEL); if (!swd) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/dummy/iio_simple_dummy_buffer.c b/drivers/iio/dummy/iio_simple_dummy_buffer.c index e35e0596cbfb..5bbfda407bc2 100644 --- a/drivers/iio/dummy/iio_simple_dummy_buffer.c +++ b/drivers/iio/dummy/iio_simple_dummy_buffer.c @@ -60,7 +60,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p) * - A buffer at the end of the structure accessed via iio_priv() * that is marked __aligned(IIO_DMA_MINALIGN). */ - scan = kzalloc(sizeof(*scan), GFP_KERNEL); + scan = kzalloc_obj(*scan, GFP_KERNEL); if (!scan) goto done; diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c index cd3db2388164..222b77781639 100644 --- a/drivers/iio/imu/adis_buffer.c +++ b/drivers/iio/imu/adis_buffer.c @@ -33,7 +33,7 @@ static int adis_update_scan_mode_burst(struct iio_dev *indio_dev, else burst_max_length = burst_length; - adis->xfer = kcalloc(2, sizeof(*adis->xfer), GFP_KERNEL); + adis->xfer = kzalloc_objs(*adis->xfer, 2, GFP_KERNEL); if (!adis->xfer) return -ENOMEM; @@ -81,7 +81,7 @@ int adis_update_scan_mode(struct iio_dev *indio_dev, scan_count = indio_dev->scan_bytes / 2; - adis->xfer = kcalloc(scan_count + 1, sizeof(*adis->xfer), GFP_KERNEL); + adis->xfer = kzalloc_objs(*adis->xfer, scan_count + 1, GFP_KERNEL); if (!adis->xfer) return -ENOMEM; diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index c6259213e150..ac141289a2f3 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1024,7 +1024,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer, (*p)->to + (*p)->length == out_loc) { (*p)->length += length; } else { - *p = kmalloc(sizeof(**p), GFP_KERNEL); + *p = kmalloc_obj(**p, GFP_KERNEL); if (!(*p)) return -ENOMEM; (*p)->from = in_loc; @@ -1478,7 +1478,7 @@ static struct attribute *iio_buffer_wrap_attr(struct iio_buffer *buffer, struct device_attribute *dattr = to_dev_attr(attr); struct iio_dev_attr *iio_attr; - iio_attr = kzalloc(sizeof(*iio_attr), GFP_KERNEL); + iio_attr = kzalloc_obj(*iio_attr, GFP_KERNEL); if (!iio_attr) return NULL; @@ -1507,7 +1507,7 @@ static int iio_buffer_register_legacy_sysfs_groups(struct iio_dev *indio_dev, struct attribute **attrs; int ret; - attrs = kcalloc(buffer_attrcount + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, buffer_attrcount + 1, GFP_KERNEL); if (!attrs) return -ENOMEM; @@ -1521,7 +1521,7 @@ static int iio_buffer_register_legacy_sysfs_groups(struct iio_dev *indio_dev, if (ret) goto error_free_buffer_attrs; - attrs = kcalloc(scan_el_attrcount + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, scan_el_attrcount + 1, GFP_KERNEL); if (!attrs) { ret = -ENOMEM; goto error_free_buffer_attrs; @@ -1674,7 +1674,7 @@ static int iio_buffer_attach_dmabuf(struct iio_dev_buffer_pair *ib, if (copy_from_user(&fd, user_fd, sizeof(fd))) return -EFAULT; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1862,7 +1862,7 @@ static int iio_buffer_enqueue_dmabuf(struct iio_dev_buffer_pair *ib, priv = attach->importer_priv; - fence = kmalloc(sizeof(*fence), GFP_KERNEL); + fence = kmalloc_obj(*fence, GFP_KERNEL); if (!fence) { ret = -ENOMEM; goto err_attachment_put; @@ -2035,7 +2035,7 @@ static long iio_device_buffer_getfd(struct iio_dev *indio_dev, unsigned long arg goto error_iio_dev_put; } - ib = kzalloc(sizeof(*ib), GFP_KERNEL); + ib = kzalloc_obj(*ib, GFP_KERNEL); if (!ib) { ret = -ENOMEM; goto error_clear_busy_bit; @@ -2182,7 +2182,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, } attrn = buffer_attrcount + scan_el_attrcount; - attr = kcalloc(attrn + 1, sizeof(*attr), GFP_KERNEL); + attr = kzalloc_objs(*attr, attrn + 1, GFP_KERNEL); if (!attr) { ret = -ENOMEM; goto error_free_scan_mask; diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 819bfb9c289e..9e3d23368413 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1192,7 +1192,7 @@ int __iio_add_chan_devattr(const char *postfix, int ret; struct iio_dev_attr *iio_attr, *t; - iio_attr = kzalloc(sizeof(*iio_attr), GFP_KERNEL); + iio_attr = kzalloc_obj(*iio_attr, GFP_KERNEL); if (iio_attr == NULL) return -ENOMEM; ret = __iio_device_attr_init(&iio_attr->dev_attr, @@ -1586,9 +1586,8 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev) attrcount++; iio_dev_opaque->chan_attr_group.attrs = - kcalloc(attrcount + 1, - sizeof(iio_dev_opaque->chan_attr_group.attrs[0]), - GFP_KERNEL); + kzalloc_objs(iio_dev_opaque->chan_attr_group.attrs[0], + attrcount + 1, GFP_KERNEL); if (iio_dev_opaque->chan_attr_group.attrs == NULL) { ret = -ENOMEM; goto error_clear_attrs; @@ -1797,7 +1796,7 @@ static int iio_chrdev_open(struct inode *inode, struct file *filp) iio_device_get(indio_dev); - ib = kmalloc(sizeof(*ib), GFP_KERNEL); + ib = kmalloc_obj(*ib, GFP_KERNEL); if (!ib) { iio_device_put(indio_dev); clear_bit(IIO_BUSY_BIT_POS, &iio_dev_opaque->flags); diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 06295cfc2da8..43043ea897e0 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c @@ -583,7 +583,7 @@ int iio_device_register_eventset(struct iio_dev *indio_dev) iio_check_for_dynamic_events(indio_dev))) return 0; - ev_int = kzalloc(sizeof(*ev_int), GFP_KERNEL); + ev_int = kzalloc_obj(*ev_int, GFP_KERNEL); if (!ev_int) return -ENOMEM; @@ -606,9 +606,8 @@ int iio_device_register_eventset(struct iio_dev *indio_dev) } ev_int->group.name = iio_event_group_name; - ev_int->group.attrs = kcalloc(attrcount + 1, - sizeof(ev_int->group.attrs[0]), - GFP_KERNEL); + ev_int->group.attrs = kzalloc_objs(ev_int->group.attrs[0], + attrcount + 1, GFP_KERNEL); if (ev_int->group.attrs == NULL) { ret = -ENOMEM; goto error_free_setup_event_lines; diff --git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c index f35c36fd4a55..d7b52ca256b2 100644 --- a/drivers/iio/industrialio-gts-helper.c +++ b/drivers/iio/industrialio-gts-helper.c @@ -250,12 +250,12 @@ static int iio_gts_alloc_int_table_array(int ***arr, int num_tables, int num_tab { int i, **tmp; - tmp = kcalloc(num_tables, sizeof(**arr), GFP_KERNEL); + tmp = kzalloc_objs(**arr, num_tables, GFP_KERNEL); if (!tmp) return -ENOMEM; for (i = 0; i < num_tables; i++) { - tmp[i] = kcalloc(num_table_items, sizeof(int), GFP_KERNEL); + tmp[i] = kzalloc_objs(int, num_table_items, GFP_KERNEL); if (!tmp[i]) goto err_free; } @@ -432,7 +432,7 @@ static int iio_gts_build_avail_time_table(struct iio_gts *gts) if (!gts->num_itime) return 0; - times = kcalloc(gts->num_itime, sizeof(int), GFP_KERNEL); + times = kzalloc_objs(int, gts->num_itime, GFP_KERNEL); if (!times) return -ENOMEM; diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 54416a384232..97a808554609 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -372,7 +372,7 @@ struct iio_poll_func va_list vargs; struct iio_poll_func *pf; - pf = kmalloc(sizeof(*pf), GFP_KERNEL); + pf = kmalloc_obj(*pf, GFP_KERNEL); if (!pf) return NULL; va_start(vargs, fmt); @@ -557,7 +557,7 @@ struct iio_trigger *viio_trigger_alloc(struct device *parent, struct iio_trigger *trig; int i; - trig = kzalloc(sizeof(*trig), GFP_KERNEL); + trig = kzalloc_obj(*trig, GFP_KERNEL); if (!trig) return NULL; diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 1e5eb5a41271..44600bc1b879 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -55,7 +55,7 @@ int iio_map_array_register(struct iio_dev *indio_dev, const struct iio_map *maps guard(mutex)(&iio_map_list_lock); while (maps[i].consumer_dev_name) { - mapi = kzalloc(sizeof(*mapi), GFP_KERNEL); + mapi = kzalloc_obj(*mapi, GFP_KERNEL); if (!mapi) { ret = -ENOMEM; goto error_ret; @@ -188,7 +188,7 @@ static struct iio_channel *fwnode_iio_channel_get(struct fwnode_handle *fwnode, return ERR_PTR(-EINVAL); struct iio_channel *channel __free(kfree) = - kzalloc(sizeof(*channel), GFP_KERNEL); + kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return ERR_PTR(-ENOMEM); @@ -302,7 +302,7 @@ static struct iio_channel *fwnode_iio_channel_get_all(struct device *dev) /* NULL terminated array to save passing size */ struct iio_channel *chans __free(kfree) = - kcalloc(nummaps + 1, sizeof(*chans), GFP_KERNEL); + kzalloc_objs(*chans, nummaps + 1, GFP_KERNEL); if (!chans) return ERR_PTR(-ENOMEM); @@ -474,7 +474,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev) /* NULL terminated array to save passing size */ struct iio_channel *chans __free(kfree) = - kcalloc(nummaps + 1, sizeof(*chans), GFP_KERNEL); + kzalloc_objs(*chans, nummaps + 1, GFP_KERNEL); if (!chans) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c index 82c72baccb62..02f137ace26d 100644 --- a/drivers/iio/trigger/iio-trig-hrtimer.c +++ b/drivers/iio/trigger/iio-trig-hrtimer.c @@ -131,7 +131,7 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name) struct iio_hrtimer_info *trig_info; int ret; - trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); if (!trig_info) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-interrupt.c b/drivers/iio/trigger/iio-trig-interrupt.c index 21c6b6292a72..432c9b2f2c64 100644 --- a/drivers/iio/trigger/iio-trig-interrupt.c +++ b/drivers/iio/trigger/iio-trig-interrupt.c @@ -48,7 +48,7 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev) goto error_ret; } - trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); if (!trig_info) { ret = -ENOMEM; goto error_free_trigger; diff --git a/drivers/iio/trigger/iio-trig-loop.c b/drivers/iio/trigger/iio-trig-loop.c index 7aaed0611899..8996aaffb3f8 100644 --- a/drivers/iio/trigger/iio-trig-loop.c +++ b/drivers/iio/trigger/iio-trig-loop.c @@ -80,7 +80,7 @@ static struct iio_sw_trigger *iio_trig_loop_probe(const char *name) struct iio_loop_info *trig_info; int ret; - trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); if (!trig_info) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c index 575d725696a9..f242b3209307 100644 --- a/drivers/iio/trigger/iio-trig-sysfs.c +++ b/drivers/iio/trigger/iio-trig-sysfs.c @@ -140,7 +140,7 @@ static int iio_sysfs_trigger_probe(int id) ret = -EINVAL; goto err_unlock; } - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (t == NULL) { ret = -ENOMEM; goto err_unlock; diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 35ba852a172a..0764d71a9dd5 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -646,7 +646,7 @@ int rdma_resolve_ip(struct sockaddr *src_addr, const struct sockaddr *dst_addr, struct addr_req *req; int ret = 0; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/infiniband/core/agent.c b/drivers/infiniband/core/agent.c index 25a060a28301..8b889cb85c59 100644 --- a/drivers/infiniband/core/agent.c +++ b/drivers/infiniband/core/agent.c @@ -162,7 +162,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num) int ret; /* Create new device info */ - port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); if (!port_priv) { ret = -ENOMEM; goto error1; diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 0fc1c5bce2f0..c3d542187129 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -296,14 +296,14 @@ alloc_gid_entry(const struct ib_gid_attr *attr) struct ib_gid_table_entry *entry; struct net_device *ndev; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; ndev = rcu_dereference_protected(attr->ndev, 1); if (ndev) { - entry->ndev_storage = kzalloc(sizeof(*entry->ndev_storage), - GFP_KERNEL); + entry->ndev_storage = kzalloc_obj(*entry->ndev_storage, + GFP_KERNEL); if (!entry->ndev_storage) { kfree(entry); return NULL; @@ -771,12 +771,12 @@ const struct ib_gid_attr *rdma_find_gid_by_filter( static struct ib_gid_table *alloc_gid_table(int sz) { - struct ib_gid_table *table = kzalloc(sizeof(*table), GFP_KERNEL); + struct ib_gid_table *table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return NULL; - table->data_vec = kcalloc(sz, sizeof(*table->data_vec), GFP_KERNEL); + table->data_vec = kzalloc_objs(*table->data_vec, sz, GFP_KERNEL); if (!table->data_vec) goto err_free_table; @@ -1452,7 +1452,7 @@ ib_cache_update(struct ib_device *device, u32 port, bool update_gids, if (!rdma_is_port_valid(device, port)) return -EINVAL; - tprops = kmalloc(sizeof *tprops, GFP_KERNEL); + tprops = kmalloc_obj(*tprops, GFP_KERNEL); if (!tprops) return -ENOMEM; @@ -1472,9 +1472,8 @@ ib_cache_update(struct ib_device *device, u32 port, bool update_gids, update_pkeys &= !!tprops->pkey_tbl_len; if (update_pkeys) { - pkey_cache = kmalloc(struct_size(pkey_cache, table, - tprops->pkey_tbl_len), - GFP_KERNEL); + pkey_cache = kmalloc_flex(*pkey_cache, table, + tprops->pkey_tbl_len, GFP_KERNEL); if (!pkey_cache) { ret = -ENOMEM; goto err; @@ -1583,7 +1582,7 @@ void ib_dispatch_event(const struct ib_event *event) { struct ib_update_work *work; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return; diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 024df6ee239d..c2fb11197d02 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -827,7 +827,7 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device, u32 id; int ret; - cm_id_priv = kzalloc(sizeof *cm_id_priv, GFP_KERNEL); + cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL); if (!cm_id_priv) return ERR_PTR(-ENOMEM); @@ -976,7 +976,7 @@ static struct cm_timewait_info *cm_create_timewait_info(__be32 local_id) { struct cm_timewait_info *timewait_info; - timewait_info = kzalloc(sizeof *timewait_info, GFP_KERNEL); + timewait_info = kzalloc_obj(*timewait_info, GFP_KERNEL); if (!timewait_info) return ERR_PTR(-ENOMEM); @@ -3902,7 +3902,7 @@ static int cm_establish(struct ib_cm_id *cm_id) if (!cm_dev) return -ENODEV; - work = kmalloc(sizeof *work, GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return -ENOMEM; @@ -4050,7 +4050,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, attr_id = be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id); atomic_long_inc(&port->counters[CM_RECV][attr_id - CM_ATTR_ID_OFFSET]); - work = kmalloc(struct_size(work, path, paths), GFP_KERNEL); + work = kmalloc_flex(*work, path, paths, GFP_KERNEL); if (!work) { ib_free_recv_mad(mad_recv_wc); return; @@ -4348,8 +4348,8 @@ static int cm_add_one(struct ib_device *ib_device) int count = 0; u32 i; - cm_dev = kzalloc(struct_size(cm_dev, port, ib_device->phys_port_cnt), - GFP_KERNEL); + cm_dev = kzalloc_flex(*cm_dev, port, ib_device->phys_port_cnt, + GFP_KERNEL); if (!cm_dev) return -ENOMEM; @@ -4366,7 +4366,7 @@ static int cm_add_one(struct ib_device *ib_device) if (!rdma_cap_ib_cm(ib_device, i)) continue; - port = kzalloc(sizeof *port, GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) { ret = -ENOMEM; goto error1; diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 0ee855a71ed4..e4bd705cc046 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -490,7 +490,7 @@ static int cma_add_id_to_tree(struct rdma_id_private *node_id_priv) unsigned long flags; int result; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; @@ -1013,7 +1013,7 @@ __rdma_create_id(struct net *net, rdma_cm_event_handler event_handler, { struct rdma_id_private *id_priv; - id_priv = kzalloc(sizeof *id_priv, GFP_KERNEL); + id_priv = kzalloc_obj(*id_priv, GFP_KERNEL); if (!id_priv) return ERR_PTR(-ENOMEM); @@ -2300,8 +2300,8 @@ cma_ib_new_conn_id(const struct rdma_cm_id *listen_id, rt = &id->route; rt->num_pri_alt_paths = ib_event->param.req_rcvd.alternate_path ? 2 : 1; - rt->path_rec = kmalloc_array(rt->num_pri_alt_paths, - sizeof(*rt->path_rec), GFP_KERNEL); + rt->path_rec = kmalloc_objs(*rt->path_rec, rt->num_pri_alt_paths, + GFP_KERNEL); if (!rt->path_rec) goto err; @@ -2880,8 +2880,8 @@ static int route_set_path_rec_inbound(struct cma_work *work, struct rdma_route *route = &work->id->id.route; if (!route->path_rec_inbound) { - route->path_rec_inbound = - kzalloc(sizeof(*route->path_rec_inbound), GFP_KERNEL); + route->path_rec_inbound = kzalloc_obj(*route->path_rec_inbound, + GFP_KERNEL); if (!route->path_rec_inbound) return -ENOMEM; } @@ -2896,8 +2896,8 @@ static int route_set_path_rec_outbound(struct cma_work *work, struct rdma_route *route = &work->id->id.route; if (!route->path_rec_outbound) { - route->path_rec_outbound = - kzalloc(sizeof(*route->path_rec_outbound), GFP_KERNEL); + route->path_rec_outbound = kzalloc_obj(*route->path_rec_outbound, + GFP_KERNEL); if (!route->path_rec_outbound) return -ENOMEM; } @@ -3083,14 +3083,14 @@ static int cma_resolve_ib_route(struct rdma_id_private *id_priv, struct cma_work *work; int ret; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; cma_init_resolve_route_work(work, id_priv); if (!route->path_rec) - route->path_rec = kmalloc(sizeof *route->path_rec, GFP_KERNEL); + route->path_rec = kmalloc_obj(*route->path_rec, GFP_KERNEL); if (!route->path_rec) { ret = -ENOMEM; goto err1; @@ -3204,7 +3204,7 @@ static int cma_resolve_iw_route(struct rdma_id_private *id_priv) { struct cma_work *work; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; @@ -3311,11 +3311,11 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv) tos = id_priv->tos_set ? id_priv->tos : default_roce_tos; mutex_unlock(&id_priv->qp_mutex); - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; - route->path_rec = kzalloc(sizeof *route->path_rec, GFP_KERNEL); + route->path_rec = kzalloc_obj(*route->path_rec, GFP_KERNEL); if (!route->path_rec) { ret = -ENOMEM; goto err1; @@ -3560,7 +3560,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv) union ib_gid gid; int ret; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; @@ -3585,7 +3585,7 @@ static int cma_resolve_ib_addr(struct rdma_id_private *id_priv) struct cma_work *work; int ret; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; @@ -3685,7 +3685,7 @@ static int cma_alloc_port(enum rdma_ucm_port_space ps, lockdep_assert_held(&lock); - bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL); + bind_list = kzalloc_obj(*bind_list, GFP_KERNEL); if (!bind_list) return -ENOMEM; @@ -5100,7 +5100,7 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, if (id_priv->id.qp_type != IB_QPT_UD) return -EINVAL; - mc = kzalloc(sizeof(*mc), GFP_KERNEL); + mc = kzalloc_obj(*mc, GFP_KERNEL); if (!mc) return -ENOMEM; @@ -5166,7 +5166,7 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) { pr_info("RDMA CM addr change for ndev %s used by id %p\n", ndev->name, &id_priv->id); - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; @@ -5373,14 +5373,14 @@ static int cma_add_one(struct ib_device *device) if (!cma_supported(device)) return -EOPNOTSUPP; - cma_dev = kmalloc(sizeof(*cma_dev), GFP_KERNEL); + cma_dev = kmalloc_obj(*cma_dev, GFP_KERNEL); if (!cma_dev) return -ENOMEM; cma_dev->device = device; - cma_dev->default_gid_type = kcalloc(device->phys_port_cnt, - sizeof(*cma_dev->default_gid_type), - GFP_KERNEL); + cma_dev->default_gid_type = kzalloc_objs(*cma_dev->default_gid_type, + device->phys_port_cnt, + GFP_KERNEL); if (!cma_dev->default_gid_type) { ret = -ENOMEM; goto free_cma_dev; @@ -5570,7 +5570,7 @@ static void cma_query_ib_service_handler(int status, } id_priv->id.route.service_recs = - kmalloc_array(num_recs, sizeof(*recs), GFP_KERNEL); + kmalloc_objs(*recs, num_recs, GFP_KERNEL); if (!id_priv->id.route.service_recs) { status = -ENOMEM; goto fail; @@ -5610,7 +5610,7 @@ static int cma_resolve_ib_service(struct rdma_id_private *id_priv, ib_sa_comp_mask mask = 0; struct cma_work *work; - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c index f2fb2d8a6597..a914edb8ffef 100644 --- a/drivers/infiniband/core/cma_configfs.c +++ b/drivers/infiniband/core/cma_configfs.c @@ -210,8 +210,7 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group, return -ENODEV; ports_num = ibdev->phys_port_cnt; - ports = kcalloc(ports_num, sizeof(*cma_dev_group->ports), - GFP_KERNEL); + ports = kzalloc_objs(*cma_dev_group->ports, ports_num, GFP_KERNEL); if (!ports) return -ENOMEM; @@ -285,7 +284,7 @@ static struct config_group *make_cma_dev(struct config_group *group, if (!cma_dev) goto fail; - cma_dev_group = kzalloc(sizeof(*cma_dev_group), GFP_KERNEL); + cma_dev_group = kzalloc_obj(*cma_dev_group, GFP_KERNEL); if (!cma_dev_group) { err = -ENOMEM; diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index 584537c71545..ffe357d01dce 100644 --- a/drivers/infiniband/core/cq.c +++ b/drivers/infiniband/core/cq.c @@ -58,7 +58,7 @@ static void rdma_dim_init(struct ib_cq *cq) cq->poll_ctx == IB_POLL_DIRECT) return; - dim = kzalloc(sizeof(struct dim), GFP_KERNEL); + dim = kzalloc_obj(struct dim, GFP_KERNEL); if (!dim) return; @@ -230,7 +230,7 @@ struct ib_cq *__ib_alloc_cq(struct ib_device *dev, void *private, int nr_cqe, atomic_set(&cq->usecnt, 0); cq->comp_vector = comp_vector; - cq->wc = kmalloc_array(IB_POLL_BATCH, sizeof(*cq->wc), GFP_KERNEL); + cq->wc = kmalloc_objs(*cq->wc, IB_POLL_BATCH, GFP_KERNEL); if (!cq->wc) goto out_free_cq; diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 2f2081e75bce..8d50ee81a6d1 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -811,9 +811,8 @@ static int alloc_port_data(struct ib_device *device) * Therefore port_data is declared as a 1 based array with potential * empty slots at the beginning. */ - pdata_rcu = kzalloc(struct_size(pdata_rcu, pdata, - size_add(rdma_end_port(device), 1)), - GFP_KERNEL); + pdata_rcu = kzalloc_flex(*pdata_rcu, pdata, + size_add(rdma_end_port(device), 1), GFP_KERNEL); if (!pdata_rcu) return -ENOMEM; /* @@ -958,7 +957,7 @@ static int add_one_compat_dev(struct ib_device *device, if (ret) goto done; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) { ret = -ENOMEM; goto cdev_err; diff --git a/drivers/infiniband/core/ib_core_uverbs.c b/drivers/infiniband/core/ib_core_uverbs.c index 1de72ff4610c..9e26868e50b6 100644 --- a/drivers/infiniband/core/ib_core_uverbs.c +++ b/drivers/infiniband/core/ib_core_uverbs.c @@ -87,7 +87,7 @@ int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma, return -EINVAL; lockdep_assert_held(&ufile->device->disassociate_srcu); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index eb942ab9c405..73e6849140fb 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c @@ -171,7 +171,7 @@ static int alloc_work_entries(struct iwcm_id_private *cm_id_priv, int count) BUG_ON(!list_empty(&cm_id_priv->work_free_list)); while (count--) { - work = kmalloc(sizeof(struct iwcm_work), GFP_KERNEL); + work = kmalloc_obj(struct iwcm_work, GFP_KERNEL); if (!work) { dealloc_work_entries(cm_id_priv); return -ENOMEM; @@ -242,7 +242,7 @@ struct iw_cm_id *iw_create_cm_id(struct ib_device *device, { struct iwcm_id_private *cm_id_priv; - cm_id_priv = kzalloc(sizeof(*cm_id_priv), GFP_KERNEL); + cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL); if (!cm_id_priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/iwpm_msg.c b/drivers/infiniband/core/iwpm_msg.c index 3c9a9869212b..69c85249b465 100644 --- a/drivers/infiniband/core/iwpm_msg.c +++ b/drivers/infiniband/core/iwpm_msg.c @@ -649,7 +649,7 @@ int iwpm_remote_info_cb(struct sk_buff *skb, struct netlink_callback *cb) __func__); return ret; } - rem_info = kzalloc(sizeof(struct iwpm_remote_info), GFP_ATOMIC); + rem_info = kzalloc_obj(struct iwpm_remote_info, GFP_ATOMIC); if (!rem_info) { ret = -ENOMEM; return ret; diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index eecb369898f5..96c707a49a71 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c @@ -58,13 +58,13 @@ static struct iwpm_admin_data iwpm_admin; */ int iwpm_init(u8 nl_client) { - iwpm_hash_bucket = kcalloc(IWPM_MAPINFO_HASH_SIZE, - sizeof(struct hlist_head), GFP_KERNEL); + iwpm_hash_bucket = kzalloc_objs(struct hlist_head, + IWPM_MAPINFO_HASH_SIZE, GFP_KERNEL); if (!iwpm_hash_bucket) return -ENOMEM; - iwpm_reminfo_bucket = kcalloc(IWPM_REMINFO_HASH_SIZE, - sizeof(struct hlist_head), GFP_KERNEL); + iwpm_reminfo_bucket = kzalloc_objs(struct hlist_head, + IWPM_REMINFO_HASH_SIZE, GFP_KERNEL); if (!iwpm_reminfo_bucket) { kfree(iwpm_hash_bucket); return -ENOMEM; @@ -113,7 +113,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, unsigned long flags; int ret = -EINVAL; - map_info = kzalloc(sizeof(struct iwpm_mapping_info), GFP_KERNEL); + map_info = kzalloc_obj(struct iwpm_mapping_info, GFP_KERNEL); if (!map_info) return -ENOMEM; @@ -310,7 +310,7 @@ struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq, struct iwpm_nlmsg_request *nlmsg_request; unsigned long flags; - nlmsg_request = kzalloc(sizeof(struct iwpm_nlmsg_request), gfp); + nlmsg_request = kzalloc_obj(struct iwpm_nlmsg_request, gfp); if (!nlmsg_request) return NULL; diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 8f26bfb69586..a2b2cd4f8e0a 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -386,7 +386,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, } /* Allocate structures */ - mad_agent_priv = kzalloc(sizeof *mad_agent_priv, GFP_KERNEL); + mad_agent_priv = kzalloc_obj(*mad_agent_priv, GFP_KERNEL); if (!mad_agent_priv) { ret = ERR_PTR(-ENOMEM); goto error1; @@ -698,7 +698,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, goto out; } - local = kmalloc(sizeof *local, GFP_ATOMIC); + local = kmalloc_obj(*local, GFP_ATOMIC); if (!local) { ret = -ENOMEM; goto out; @@ -1400,7 +1400,7 @@ static int method_in_use(struct ib_mad_mgmt_method_table **method, static int allocate_method_table(struct ib_mad_mgmt_method_table **method) { /* Allocate management method table */ - *method = kzalloc(sizeof **method, GFP_ATOMIC); + *method = kzalloc_obj(**method, GFP_ATOMIC); return (*method) ? 0 : (-ENOMEM); } @@ -1488,7 +1488,7 @@ static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req, class = &port_priv->version[mad_reg_req->mgmt_class_version].class; if (!*class) { /* Allocate management class table for "new" class version */ - *class = kzalloc(sizeof **class, GFP_ATOMIC); + *class = kzalloc_obj(**class, GFP_ATOMIC); if (!*class) { ret = -ENOMEM; goto error1; @@ -1553,7 +1553,7 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, mad_reg_req->mgmt_class_version].vendor; if (!*vendor_table) { /* Allocate mgmt vendor class table for "new" class version */ - vendor = kzalloc(sizeof *vendor, GFP_ATOMIC); + vendor = kzalloc_obj(*vendor, GFP_ATOMIC); if (!vendor) goto error1; @@ -1561,7 +1561,7 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, } if (!(*vendor_table)->vendor_class[vclass]) { /* Allocate table for this management vendor class */ - vendor_class = kzalloc(sizeof *vendor_class, GFP_ATOMIC); + vendor_class = kzalloc_obj(*vendor_class, GFP_ATOMIC); if (!vendor_class) goto error2; @@ -2612,7 +2612,7 @@ static bool ib_mad_send_error(struct ib_mad_port_private *port_priv, struct ib_qp_attr *attr; /* Transition QP to RTS and fail offending send */ - attr = kmalloc(sizeof *attr, GFP_KERNEL); + attr = kmalloc_obj(*attr, GFP_KERNEL); if (attr) { attr->qp_state = IB_QPS_RTS; attr->cur_qp_state = IB_QPS_SQE; @@ -3042,7 +3042,7 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv) struct ib_qp *qp; u16 pkey_index; - attr = kmalloc(sizeof *attr, GFP_KERNEL); + attr = kmalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; @@ -3207,7 +3207,7 @@ static int ib_mad_port_open(struct ib_device *device, return -EFAULT; /* Create new device info */ - port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); if (!port_priv) return -ENOMEM; diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 1c5e0eaf1c94..7d577d26f3eb 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c @@ -279,7 +279,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent, struct mad_rmpp_recv *rmpp_recv; struct ib_mad_hdr *mad_hdr; - rmpp_recv = kmalloc(sizeof *rmpp_recv, GFP_KERNEL); + rmpp_recv = kmalloc_obj(*rmpp_recv, GFP_KERNEL); if (!rmpp_recv) return NULL; diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c index a236532a9026..ad2f009886d8 100644 --- a/drivers/infiniband/core/multicast.c +++ b/drivers/infiniband/core/multicast.c @@ -570,7 +570,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port, spin_unlock_irqrestore(&port->lock, flags); } - group = kzalloc(sizeof *group, gfp_mask); + group = kzalloc_obj(*group, gfp_mask); if (!group) return NULL; @@ -621,7 +621,7 @@ ib_sa_join_multicast(struct ib_sa_client *client, if (!dev) return ERR_PTR(-ENODEV); - member = kmalloc(sizeof *member, gfp_mask); + member = kmalloc_obj(*member, gfp_mask); if (!member) return ERR_PTR(-ENOMEM); @@ -823,8 +823,7 @@ static int mcast_add_one(struct ib_device *device) int i; int count = 0; - dev = kmalloc(struct_size(dev, port, device->phys_port_cnt), - GFP_KERNEL); + dev = kmalloc_flex(*dev, port, device->phys_port_cnt, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c index b097cfcade1c..87a9ac4bf987 100644 --- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -25,7 +25,7 @@ int rdma_restrack_init(struct ib_device *dev) struct rdma_restrack_root *rt; int i; - dev->res = kcalloc(RDMA_RESTRACK_MAX, sizeof(*rt), GFP_KERNEL); + dev->res = kzalloc_objs(*rt, RDMA_RESTRACK_MAX, GFP_KERNEL); if (!dev->res) return -ENOMEM; diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c index a9f2c6b1b29e..22c83e44091d 100644 --- a/drivers/infiniband/core/roce_gid_mgmt.c +++ b/drivers/infiniband/core/roce_gid_mgmt.c @@ -352,7 +352,7 @@ static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, } in_dev_for_each_ifa_rcu(ifa, in_dev) { - struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + struct sin_list *entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) continue; @@ -395,7 +395,7 @@ static void enum_netdev_ipv6_ips(struct ib_device *ib_dev, read_lock_bh(&in6_dev->lock); list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { - struct sin6_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + struct sin6_list *entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) continue; @@ -556,7 +556,7 @@ struct upper_list { static int netdev_upper_walk(struct net_device *upper, struct netdev_nested_priv *priv) { - struct upper_list *entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + struct upper_list *entry = kmalloc_obj(*entry, GFP_ATOMIC); struct list_head *upper_list = (struct list_head *)priv->data; if (!entry) @@ -660,8 +660,8 @@ static int netdevice_queue_work(struct netdev_event_work_cmd *cmds, struct net_device *ndev) { unsigned int i; - struct netdev_event_work *ndev_work = - kmalloc(sizeof(*ndev_work), GFP_KERNEL); + struct netdev_event_work *ndev_work = kmalloc_obj(*ndev_work, + GFP_KERNEL); if (!ndev_work) return NOTIFY_DONE; @@ -858,7 +858,7 @@ static int addr_event(struct notifier_block *this, unsigned long event, return NOTIFY_DONE; } - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 518095d82d5d..71345ccf1bf8 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -162,7 +162,7 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, int i, j, ret = 0, count = 0; ctx->nr_ops = DIV_ROUND_UP(sg_cnt, pages_per_mr); - ctx->reg = kcalloc(ctx->nr_ops, sizeof(*ctx->reg), GFP_KERNEL); + ctx->reg = kzalloc_objs(*ctx->reg, ctx->nr_ops, GFP_KERNEL); if (!ctx->reg) { ret = -ENOMEM; goto out; @@ -213,8 +213,8 @@ static int rdma_rw_init_mr_wrs_bvec(struct rdma_rw_ctx *ctx, struct ib_qp *qp, int i, ret, count = 0; u32 nents = 0; - ctx->reg = kcalloc(DIV_ROUND_UP(nr_bvec, pages_per_mr), - sizeof(*ctx->reg), GFP_KERNEL); + ctx->reg = kzalloc_objs(*ctx->reg, DIV_ROUND_UP(nr_bvec, pages_per_mr), + GFP_KERNEL); if (!ctx->reg) return -ENOMEM; @@ -222,9 +222,8 @@ static int rdma_rw_init_mr_wrs_bvec(struct rdma_rw_ctx *ctx, struct ib_qp *qp, * Build scatterlist from bvecs using the iterator. This follows * the pattern from __blk_rq_map_sg. */ - ctx->reg[0].sgt.sgl = kmalloc_array(nr_bvec, - sizeof(*ctx->reg[0].sgt.sgl), - GFP_KERNEL); + ctx->reg[0].sgt.sgl = kmalloc_objs(*ctx->reg[0].sgt.sgl, nr_bvec, + GFP_KERNEL); if (!ctx->reg[0].sgt.sgl) { ret = -ENOMEM; goto out_free_reg; @@ -298,11 +297,11 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, ctx->nr_ops = DIV_ROUND_UP(sg_cnt, max_sge); - ctx->map.sges = sge = kcalloc(sg_cnt, sizeof(*sge), GFP_KERNEL); + ctx->map.sges = sge = kzalloc_objs(*sge, sg_cnt, GFP_KERNEL); if (!ctx->map.sges) goto out; - ctx->map.wrs = kcalloc(ctx->nr_ops, sizeof(*ctx->map.wrs), GFP_KERNEL); + ctx->map.wrs = kzalloc_objs(*ctx->map.wrs, ctx->nr_ops, GFP_KERNEL); if (!ctx->map.wrs) goto out_free_sges; @@ -757,7 +756,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, ctx->type = RDMA_RW_SIG_MR; ctx->nr_ops = 1; - ctx->reg = kzalloc(sizeof(*ctx->reg), GFP_KERNEL); + ctx->reg = kzalloc_obj(*ctx->reg, GFP_KERNEL); if (!ctx->reg) { ret = -ENOMEM; goto out_unmap_prot_sg; diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index c23e9c847314..cbea6fdd0e75 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -1607,7 +1607,7 @@ static void ib_sa_service_rec_callback(struct ib_sa_query *sa_query, int status, return; } - rec = kmalloc_array(num_services, sizeof(*rec), GFP_KERNEL); + rec = kmalloc_objs(*rec, num_services, GFP_KERNEL); if (!rec) { query->callback(-ENOMEM, NULL, 0, query->context); return; @@ -1689,7 +1689,7 @@ int ib_sa_path_rec_get(struct ib_sa_client *client, port = &sa_dev->port[port_num - sa_dev->start_port]; agent = port->agent; - query = kzalloc(sizeof(*query), gfp_mask); + query = kzalloc_obj(*query, gfp_mask); if (!query) return -ENOMEM; @@ -1702,8 +1702,7 @@ int ib_sa_path_rec_get(struct ib_sa_client *client, } else if (status == PR_OPA_SUPPORTED) { query->sa_query.flags |= IB_SA_QUERY_OPA; } else { - query->conv_pr = - kmalloc(sizeof(*query->conv_pr), gfp_mask); + query->conv_pr = kmalloc_obj(*query->conv_pr, gfp_mask); if (!query->conv_pr) { ret = -ENOMEM; goto err1; @@ -1814,7 +1813,7 @@ int ib_sa_service_rec_get(struct ib_sa_client *client, port = &sa_dev->port[port_num - sa_dev->start_port]; agent = port->agent; - query = kzalloc(sizeof(*query), gfp_mask); + query = kzalloc_obj(*query, gfp_mask); if (!query) return -ENOMEM; @@ -1906,7 +1905,7 @@ int ib_sa_mcmember_rec_query(struct ib_sa_client *client, port = &sa_dev->port[port_num - sa_dev->start_port]; agent = port->agent; - query = kzalloc(sizeof(*query), gfp_mask); + query = kzalloc_obj(*query, gfp_mask); if (!query) return -ENOMEM; @@ -2002,7 +2001,7 @@ int ib_sa_guid_info_rec_query(struct ib_sa_client *client, port = &sa_dev->port[port_num - sa_dev->start_port]; agent = port->agent; - query = kzalloc(sizeof(*query), gfp_mask); + query = kzalloc_obj(*query, gfp_mask); if (!query) return -ENOMEM; @@ -2131,7 +2130,7 @@ static int ib_sa_classport_info_rec_query(struct ib_sa_port *port, agent = port->agent; - query = kzalloc(sizeof(*query), gfp_mask); + query = kzalloc_obj(*query, gfp_mask); if (!query) return -ENOMEM; @@ -2189,7 +2188,7 @@ static void update_ib_cpi(struct work_struct *work) } spin_unlock_irqrestore(&port->classport_lock, flags); - cb_context = kmalloc(sizeof(*cb_context), GFP_KERNEL); + cb_context = kmalloc_obj(*cb_context, GFP_KERNEL); if (!cb_context) goto err_nomem; @@ -2307,7 +2306,7 @@ static void update_sm_ah(struct work_struct *work) return; } - new_ah = kmalloc(sizeof(*new_ah), GFP_KERNEL); + new_ah = kmalloc_obj(*new_ah, GFP_KERNEL); if (!new_ah) return; @@ -2415,9 +2414,8 @@ static int ib_sa_add_one(struct ib_device *device) s = rdma_start_port(device); e = rdma_end_port(device); - sa_dev = kzalloc(struct_size(sa_dev, port, - size_add(size_sub(e, s), 1)), - GFP_KERNEL); + sa_dev = kzalloc_flex(*sa_dev, port, size_add(size_sub(e, s), 1), + GFP_KERNEL); if (!sa_dev) return -ENOMEM; diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c index 3512c2e54efc..deccd7b7eb51 100644 --- a/drivers/infiniband/core/security.c +++ b/drivers/infiniband/core/security.c @@ -258,7 +258,7 @@ static int port_pkey_list_insert(struct ib_port_pkey *pp) if (!pkey) { bool found = false; - pkey = kzalloc(sizeof(*pkey), GFP_KERNEL); + pkey = kzalloc_obj(*pkey, GFP_KERNEL); if (!pkey) return -ENOMEM; @@ -335,7 +335,7 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp, struct ib_ports_pkeys *new_pps; struct ib_ports_pkeys *qp_pps = qp->qp_sec->ports_pkeys; - new_pps = kzalloc(sizeof(*new_pps), GFP_KERNEL); + new_pps = kzalloc_obj(*new_pps, GFP_KERNEL); if (!new_pps) return NULL; @@ -428,7 +428,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev) if (!is_ib) return 0; - qp->qp_sec = kzalloc(sizeof(*qp->qp_sec), GFP_KERNEL); + qp->qp_sec = kzalloc_obj(*qp->qp_sec, GFP_KERNEL); if (!qp->qp_sec) return -ENOMEM; diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index bfaca07933d8..c2becb0b39a2 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -515,8 +515,8 @@ static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, if (!dev->ops.process_mad) return -ENOSYS; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kzalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kzalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) { ret = -ENOMEM; goto out; @@ -855,12 +855,12 @@ alloc_hw_stats_device(struct ib_device *ibdev) * Two extra attribue elements here, one for the lifespan entry and * one to NULL terminate the list for the sysfs core code */ - data = kzalloc(struct_size(data, attrs, size_add(stats->num_counters, 1)), - GFP_KERNEL); + data = kzalloc_flex(*data, attrs, size_add(stats->num_counters, 1), + GFP_KERNEL); if (!data) goto err_free_stats; - data->group.attrs = kcalloc(stats->num_counters + 2, - sizeof(*data->group.attrs), GFP_KERNEL); + data->group.attrs = kzalloc_objs(*data->group.attrs, + stats->num_counters + 2, GFP_KERNEL); if (!data->group.attrs) goto err_free_data; @@ -962,12 +962,12 @@ alloc_hw_stats_port(struct ib_port *port, struct attribute_group *group) * Two extra attribue elements here, one for the lifespan entry and * one to NULL terminate the list for the sysfs core code */ - data = kzalloc(struct_size(data, attrs, size_add(stats->num_counters, 1)), - GFP_KERNEL); + data = kzalloc_flex(*data, attrs, size_add(stats->num_counters, 1), + GFP_KERNEL); if (!data) goto err_free_stats; - group->attrs = kcalloc(stats->num_counters + 2, - sizeof(*group->attrs), GFP_KERNEL); + group->attrs = kzalloc_objs(*group->attrs, stats->num_counters + 2, + GFP_KERNEL); if (!group->attrs) goto err_free_data; @@ -1054,7 +1054,7 @@ alloc_port_table_group(const char *name, struct attribute_group *group, struct attribute **attr_list; int i; - attr_list = kcalloc(num + 1, sizeof(*attr_list), GFP_KERNEL); + attr_list = kzalloc_objs(*attr_list, num + 1, GFP_KERNEL); if (!attr_list) return -ENOMEM; @@ -1092,9 +1092,9 @@ static int setup_gid_attrs(struct ib_port *port, struct gid_attr_group *gid_attr_group; int ret; - gid_attr_group = kzalloc(struct_size(gid_attr_group, attrs_list, - size_mul(attr->gid_tbl_len, 2)), - GFP_KERNEL); + gid_attr_group = kzalloc_flex(*gid_attr_group, attrs_list, + size_mul(attr->gid_tbl_len, 2), + GFP_KERNEL); if (!gid_attr_group) return -ENOMEM; gid_attr_group->port = port; @@ -1157,9 +1157,9 @@ static struct ib_port *setup_port(struct ib_core_device *coredev, int port_num, struct ib_port *p; int ret; - p = kvzalloc(struct_size(p, attrs_list, - size_add(attr->gid_tbl_len, attr->pkey_tbl_len)), - GFP_KERNEL); + p = kvzalloc_flex(*p, attrs_list, + size_add(attr->gid_tbl_len, attr->pkey_tbl_len), + GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); p->ibdev = device; diff --git a/drivers/infiniband/core/ucaps.c b/drivers/infiniband/core/ucaps.c index de5cb8bf0a61..d5524f69b981 100644 --- a/drivers/infiniband/core/ucaps.c +++ b/drivers/infiniband/core/ucaps.c @@ -160,7 +160,7 @@ int ib_create_ucap(enum rdma_user_cap type) return 0; } - ucap = kzalloc(sizeof(*ucap), GFP_KERNEL); + ucap = kzalloc_obj(*ucap, GFP_KERNEL); if (!ucap) { ret = -ENOMEM; goto unlock; diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index ec3be65a2b88..f84c6a02eaff 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -195,7 +195,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file) { struct ucma_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -262,7 +262,7 @@ static struct ucma_event *ucma_create_uevent(struct ucma_context *ctx, { struct ucma_event *uevent; - uevent = kzalloc(sizeof(*uevent), GFP_KERNEL); + uevent = kzalloc_obj(*uevent, GFP_KERNEL); if (!uevent) return NULL; @@ -1529,7 +1529,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, if (IS_ERR(ctx)) return PTR_ERR(ctx); - mc = kzalloc(sizeof(*mc), GFP_KERNEL); + mc = kzalloc_obj(*mc, GFP_KERNEL); if (!mc) { ret = -ENOMEM; goto err_put_ctx; @@ -1770,7 +1770,7 @@ static ssize_t ucma_write_cm_event(struct ucma_file *file, event.status = cmd.status; event.param.arg = cmd.param.arg; - uevent = kzalloc(sizeof(*uevent), GFP_KERNEL); + uevent = kzalloc_obj(*uevent, GFP_KERNEL); if (!uevent) { ret = -ENOMEM; goto out; @@ -1885,7 +1885,7 @@ static int ucma_open(struct inode *inode, struct file *filp) { struct ucma_file *file; - file = kmalloc(sizeof *file, GFP_KERNEL); + file = kmalloc_obj(*file, GFP_KERNEL); if (!file) return -ENOMEM; diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 8137031c2a65..8863fd1b85d8 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -189,7 +189,7 @@ struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr, if (access & IB_ACCESS_ON_DEMAND) return ERR_PTR(-EOPNOTSUPP); - umem = kzalloc(sizeof(*umem), GFP_KERNEL); + umem = kzalloc_obj(*umem, GFP_KERNEL); if (!umem) return ERR_PTR(-ENOMEM); umem->ibdev = device; diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c index 939da49b0dcc..dc35dbe18951 100644 --- a/drivers/infiniband/core/umem_dmabuf.c +++ b/drivers/infiniband/core/umem_dmabuf.c @@ -136,7 +136,7 @@ ib_umem_dmabuf_get_with_dma_device(struct ib_device *device, if (dmabuf->size < end) goto out_release_dmabuf; - umem_dmabuf = kzalloc(sizeof(*umem_dmabuf), GFP_KERNEL); + umem_dmabuf = kzalloc_obj(*umem_dmabuf, GFP_KERNEL); if (!umem_dmabuf) { ret = ERR_PTR(-ENOMEM); goto out_release_dmabuf; diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c index 32267258a19c..d14bd597a2b7 100644 --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -140,7 +140,7 @@ struct ib_umem_odp *ib_umem_odp_alloc_implicit(struct ib_device *device, if (access & IB_ACCESS_HUGETLB) return ERR_PTR(-EINVAL); - umem_odp = kzalloc(sizeof(*umem_odp), GFP_KERNEL); + umem_odp = kzalloc_obj(*umem_odp, GFP_KERNEL); if (!umem_odp) return ERR_PTR(-ENOMEM); umem = &umem_odp->umem; @@ -181,7 +181,7 @@ ib_umem_odp_alloc_child(struct ib_umem_odp *root, unsigned long addr, if (WARN_ON(!root->is_implicit_odp)) return ERR_PTR(-EINVAL); - odp_data = kzalloc(sizeof(*odp_data), GFP_KERNEL); + odp_data = kzalloc_obj(*odp_data, GFP_KERNEL); if (!odp_data) return ERR_PTR(-ENOMEM); umem = &odp_data->umem; @@ -241,7 +241,7 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *device, if (WARN_ON_ONCE(!(access & IB_ACCESS_ON_DEMAND))) return ERR_PTR(-EINVAL); - umem_odp = kzalloc(sizeof(struct ib_umem_odp), GFP_KERNEL); + umem_odp = kzalloc_obj(struct ib_umem_odp, GFP_KERNEL); if (!umem_odp) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c index 2f7e3c4483fc..0ff2b7ba6b79 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c @@ -247,7 +247,7 @@ static void recv_handler(struct ib_mad_agent *agent, if (mad_recv_wc->wc->status != IB_WC_SUCCESS) goto err1; - packet = kzalloc(sizeof *packet, GFP_KERNEL); + packet = kzalloc_obj(*packet, GFP_KERNEL); if (!packet) goto err1; @@ -1018,7 +1018,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp) goto out; } - file = kzalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc_obj(*file, GFP_KERNEL); if (!file) { ret = -ENOMEM; goto out; @@ -1396,9 +1396,8 @@ static int ib_umad_add_one(struct ib_device *device) s = rdma_start_port(device); e = rdma_end_port(device); - umad_dev = kzalloc(struct_size(umad_dev, ports, - size_add(size_sub(e, s), 1)), - GFP_KERNEL); + umad_dev = kzalloc_flex(*umad_dev, ports, size_add(size_sub(e, s), 1), + GFP_KERNEL); if (!umad_dev) return -ENOMEM; diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index f4616deeca54..7aa7f1692c73 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -510,7 +510,7 @@ static int xrcd_table_insert(struct ib_uverbs_device *dev, struct rb_node **p = &dev->xrcd_tree.rb_node; struct rb_node *parent = NULL; - entry = kmalloc(sizeof *entry, GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1672,8 +1672,8 @@ static int ib_uverbs_query_qp(struct uverbs_attr_bundle *attrs) if (ret) return ret; - attr = kmalloc(sizeof *attr, GFP_KERNEL); - init_attr = kmalloc(sizeof *init_attr, GFP_KERNEL); + attr = kmalloc_obj(*attr, GFP_KERNEL); + init_attr = kmalloc_obj(*init_attr, GFP_KERNEL); if (!attr || !init_attr) { ret = -ENOMEM; goto out; @@ -1780,7 +1780,7 @@ static int modify_qp(struct uverbs_attr_bundle *attrs, struct ib_qp *qp; int ret; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; @@ -2525,7 +2525,7 @@ static int ib_uverbs_attach_mcast(struct uverbs_attr_bundle *attrs) goto out_put; } - mcast = kmalloc(sizeof *mcast, GFP_KERNEL); + mcast = kmalloc_obj(*mcast, GFP_KERNEL); if (!mcast) { ret = -ENOMEM; goto out_put; @@ -2595,7 +2595,7 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs) { struct ib_uflow_resources *resources; - resources = kzalloc(sizeof(*resources), GFP_KERNEL); + resources = kzalloc_obj(*resources, GFP_KERNEL); if (!resources) return NULL; @@ -2604,9 +2604,9 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs) goto out; resources->counters = - kcalloc(num_specs, sizeof(*resources->counters), GFP_KERNEL); + kzalloc_objs(*resources->counters, num_specs, GFP_KERNEL); resources->collection = - kcalloc(num_specs, sizeof(*resources->collection), GFP_KERNEL); + kzalloc_objs(*resources->collection, num_specs, GFP_KERNEL); if (!resources->counters || !resources->collection) goto err; @@ -3116,7 +3116,7 @@ static int ib_uverbs_ex_create_rwq_ind_table(struct uverbs_attr_bundle *attrs) if (err) goto err_free; - wqs = kcalloc(num_wq_handles, sizeof(*wqs), GFP_KERNEL); + wqs = kzalloc_objs(*wqs, num_wq_handles, GFP_KERNEL); if (!wqs) { err = -ENOMEM; goto err_free; @@ -3292,8 +3292,8 @@ static int ib_uverbs_ex_create_flow(struct uverbs_attr_bundle *attrs) goto err_put; } - flow_attr = kzalloc(struct_size(flow_attr, flows, - cmd.flow_attr.num_of_specs), GFP_KERNEL); + flow_attr = kzalloc_flex(*flow_attr, flows, cmd.flow_attr.num_of_specs, + GFP_KERNEL); if (!flow_attr) { err = -ENOMEM; goto err_put; diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c index f80da6a67e24..f37bb447c230 100644 --- a/drivers/infiniband/core/uverbs_ioctl.c +++ b/drivers/infiniband/core/uverbs_ioctl.c @@ -120,7 +120,7 @@ __malloc void *_uverbs_alloc(struct uverbs_attr_bundle *bundle, size_t size, if (new_used > pbundle->internal_avail) { struct bundle_alloc_head *buf; - buf = kvmalloc(struct_size(buf, data, size), flags); + buf = kvmalloc_flex(*buf, data, size, flags); if (!buf) return ERR_PTR(-ENOMEM); buf->next = pbundle->allocated_mem; diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 973fe2c7ef53..2a3c8a5ead1c 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -382,7 +382,7 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context) return; } - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) { spin_unlock_irqrestore(&ev_queue->lock, flags); return; @@ -417,7 +417,7 @@ void ib_uverbs_async_handler(struct ib_uverbs_async_event_file *async_file, return; } - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) { spin_unlock_irqrestore(&async_file->ev_queue.lock, flags); return; @@ -737,7 +737,7 @@ static void rdma_umap_open(struct vm_area_struct *vma) if (!ufile->ucontext) goto out_unlock; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) goto out_unlock; rdma_umap_priv_init(priv, vma, opriv->entry); @@ -966,7 +966,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) } } - file = kzalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc_obj(*file, GFP_KERNEL); if (!file) { ret = -ENOMEM; if (module_dependent) @@ -1154,7 +1154,7 @@ static int ib_uverbs_add_one(struct ib_device *device) device->type == RDMA_DEVICE_TYPE_SMI) return -EOPNOTSUPP; - uverbs_dev = kzalloc(sizeof(*uverbs_dev), GFP_KERNEL); + uverbs_dev = kzalloc_obj(*uverbs_dev, GFP_KERNEL); if (!uverbs_dev) return -ENOMEM; diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c index 38d0bbbee796..7e8b04658526 100644 --- a/drivers/infiniband/core/uverbs_uapi.c +++ b/drivers/infiniband/core/uverbs_uapi.c @@ -445,8 +445,8 @@ static int uapi_finalize(struct uverbs_api *uapi) uapi->notsupp_method.handler = ib_uverbs_notsupp; uapi->num_write = max_write + 1; uapi->num_write_ex = max_write_ex + 1; - data = kmalloc_array(uapi->num_write + uapi->num_write_ex, - sizeof(*uapi->write_methods), GFP_KERNEL); + data = kmalloc_objs(*uapi->write_methods, + uapi->num_write + uapi->num_write_ex, GFP_KERNEL); if (!data) return -ENOMEM; @@ -648,7 +648,7 @@ struct uverbs_api *uverbs_alloc_api(struct ib_device *ibdev) struct uverbs_api *uapi; int rc; - uapi = kzalloc(sizeof(*uapi), GFP_KERNEL); + uapi = kzalloc_obj(*uapi, GFP_KERNEL); if (!uapi) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index a2670a031faf..2e98f1e2e53f 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1186,7 +1186,7 @@ static struct ib_qp *__ib_open_qp(struct ib_qp *real_qp, unsigned long flags; int err; - qp = kzalloc(sizeof *qp, GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return ERR_PTR(-ENOMEM); @@ -2420,7 +2420,7 @@ struct ib_mr *ib_alloc_mr_integrity(struct ib_pd *pd, goto out; } - sig_attrs = kzalloc(sizeof(struct ib_sig_attrs), GFP_KERNEL); + sig_attrs = kzalloc_obj(struct ib_sig_attrs, GFP_KERNEL); if (!sig_attrs) { mr = ERR_PTR(-ENOMEM); goto out; @@ -3205,7 +3205,7 @@ struct rdma_hw_stats *rdma_alloc_hw_stats_struct( { struct rdma_hw_stats *stats; - stats = kzalloc(struct_size(stats, value, num_counters), GFP_KERNEL); + stats = kzalloc_flex(*stats, value, num_counters, GFP_KERNEL); if (!stats) return NULL; diff --git a/drivers/infiniband/hw/bng_re/bng_dev.c b/drivers/infiniband/hw/bng_re/bng_dev.c index d8f8d7f7075f..d43fa9a5b109 100644 --- a/drivers/infiniband/hw/bng_re/bng_dev.c +++ b/drivers/infiniband/hw/bng_re/bng_dev.c @@ -77,7 +77,7 @@ static int bng_re_setup_chip_ctx(struct bng_re_dev *rdev) aux_dev = rdev->aux_dev; rdev->bng_res.pdev = aux_dev->pdev; rdev->rcfw.res = &rdev->bng_res; - chip_ctx = kzalloc(sizeof(*chip_ctx), GFP_KERNEL); + chip_ctx = kzalloc_obj(*chip_ctx, GFP_KERNEL); if (!chip_ctx) return -ENOMEM; chip_ctx->chip_num = aux_dev->chip_num; @@ -85,7 +85,7 @@ static int bng_re_setup_chip_ctx(struct bng_re_dev *rdev) rdev->chip_ctx = chip_ctx; rdev->bng_res.cctx = rdev->chip_ctx; - rdev->dev_attr = kzalloc(sizeof(*rdev->dev_attr), GFP_KERNEL); + rdev->dev_attr = kzalloc_obj(*rdev->dev_attr, GFP_KERNEL); if (!rdev->dev_attr) goto free_chip_ctx; rdev->bng_res.dattr = rdev->dev_attr; @@ -337,7 +337,7 @@ static int bng_re_dev_init(struct bng_re_dev *rdev) } /* Allocate nq record memory */ - rdev->nqr = kzalloc(sizeof(*rdev->nqr), GFP_KERNEL); + rdev->nqr = kzalloc_obj(*rdev->nqr, GFP_KERNEL); if (!rdev->nqr) { bng_re_destroy_chip_ctx(rdev); bnge_unregister_dev(rdev->aux_dev); @@ -464,7 +464,7 @@ static int bng_re_probe(struct auxiliary_device *adev, struct bng_re_en_dev_info *en_info; int rc; - en_info = kzalloc(sizeof(*en_info), GFP_KERNEL); + en_info = kzalloc_obj(*en_info, GFP_KERNEL); if (!en_info) return -ENOMEM; diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c index 01b3e1cbe719..cd2d2670700d 100644 --- a/drivers/infiniband/hw/bng_re/bng_fw.c +++ b/drivers/infiniband/hw/bng_re/bng_fw.c @@ -98,8 +98,8 @@ int bng_re_alloc_fw_channel(struct bng_re_res *res, goto fail; } - rcfw->crsqe_tbl = kcalloc(cmdq->hwq.max_elements, - sizeof(*rcfw->crsqe_tbl), GFP_KERNEL); + rcfw->crsqe_tbl = kzalloc_objs(*rcfw->crsqe_tbl, cmdq->hwq.max_elements, + GFP_KERNEL); if (!rcfw->crsqe_tbl) goto fail; diff --git a/drivers/infiniband/hw/bnxt_re/debugfs.c b/drivers/infiniband/hw/bnxt_re/debugfs.c index e025217861c2..e43698156c61 100644 --- a/drivers/infiniband/hw/bnxt_re/debugfs.c +++ b/drivers/infiniband/hw/bnxt_re/debugfs.c @@ -467,7 +467,7 @@ static void bnxt_re_init_cq_coal_debugfs(struct bnxt_re_dev *rdev) if (!_is_cq_coalescing_supported(rdev->dev_attr->dev_cap_flags2)) return; - dbg_cq_coal_params = kzalloc(sizeof(*dbg_cq_coal_params), GFP_KERNEL); + dbg_cq_coal_params = kzalloc_obj(*dbg_cq_coal_params, GFP_KERNEL); if (!dbg_cq_coal_params) return; @@ -497,7 +497,7 @@ void bnxt_re_debugfs_add_pdev(struct bnxt_re_dev *rdev) bnxt_re_debugfs_add_info(rdev); - rdev->cc_config_params = kzalloc(sizeof(*cc_params), GFP_KERNEL); + rdev->cc_config_params = kzalloc_obj(*cc_params, GFP_KERNEL); for (i = 0; i < BNXT_RE_CC_PARAM_GEN0; i++) { struct bnxt_re_cc_param *tmp_params = &rdev->cc_config_params->gen0_parms[i]; diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index be3c3f1f87f7..ea1518ba5c02 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -461,7 +461,7 @@ int bnxt_re_add_gid(const struct ib_gid_attr *attr, void **context) return rc; } - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx_tbl = sgid_tbl->ctx; @@ -593,7 +593,7 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd) fence->dma_addr = dma_addr; /* Allocate a MR */ - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { rc = -ENOMEM; goto fail; @@ -651,7 +651,7 @@ bnxt_re_mmap_entry_insert(struct bnxt_re_ucontext *uctx, u64 mem_offset, struct bnxt_re_user_mmap_entry *entry; int ret; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -1190,7 +1190,7 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah union ib_gid sgid; int rc; - ah = kzalloc(sizeof(*ah), GFP_KERNEL); + ah = kzalloc_obj(*ah, GFP_KERNEL); if (!ah) return NULL; @@ -1237,7 +1237,7 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp struct bnxt_re_qp *qp; int rc; - qp = kzalloc(sizeof(*qp), GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return NULL; @@ -1547,8 +1547,8 @@ static int bnxt_re_create_shadow_gsi(struct bnxt_re_qp *qp, rdev = qp->rdev; /* Create a shadow QP to handle the QP1 traffic */ - sqp_tbl = kcalloc(BNXT_RE_MAX_GSI_SQP_ENTRIES, sizeof(*sqp_tbl), - GFP_KERNEL); + sqp_tbl = kzalloc_objs(*sqp_tbl, BNXT_RE_MAX_GSI_SQP_ENTRIES, + GFP_KERNEL); if (!sqp_tbl) return -ENOMEM; rdev->gsi_ctx.sqp_tbl = sqp_tbl; @@ -2359,7 +2359,7 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, struct bnxt_qplib_qp *qplib_qp; int rc; - qplib_qp = kzalloc(sizeof(*qplib_qp), GFP_KERNEL); + qplib_qp = kzalloc_obj(*qplib_qp, GFP_KERNEL); if (!qplib_qp) return -ENOMEM; @@ -3194,8 +3194,8 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, cq->qplib_cq.dpi = &uctx->dpi; } else { cq->max_cql = min_t(u32, entries, MAX_CQL_PER_POLL); - cq->cql = kcalloc(cq->max_cql, sizeof(struct bnxt_qplib_cqe), - GFP_KERNEL); + cq->cql = kzalloc_objs(struct bnxt_qplib_cqe, cq->max_cql, + GFP_KERNEL); if (!cq->cql) { rc = -ENOMEM; goto fail; @@ -4030,7 +4030,7 @@ struct ib_mr *bnxt_re_get_dma_mr(struct ib_pd *ib_pd, int mr_access_flags) u32 active_mrs; int rc; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -4133,7 +4133,7 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type, if (max_num_sg > MAX_PBL_LVL_1_PGS) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -4185,7 +4185,7 @@ struct ib_mw *bnxt_re_alloc_mw(struct ib_pd *ib_pd, enum ib_mw_type type, u32 active_mws; int rc; - mw = kzalloc(sizeof(*mw), GFP_KERNEL); + mw = kzalloc_obj(*mw, GFP_KERNEL); if (!mw) return ERR_PTR(-ENOMEM); mw->rdev = rdev; @@ -4250,7 +4250,7 @@ static struct ib_mr *__bnxt_re_user_reg_mr(struct ib_pd *ib_pd, u64 length, u64 return ERR_PTR(-EINVAL); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -4507,7 +4507,7 @@ struct ib_flow *bnxt_re_create_flow(struct ib_qp *ib_qp, return ERR_PTR(-EBUSY); } - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (!flow) { mutex_unlock(&rdev->qp_lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index ee882456319d..cbb56ba634fc 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -171,7 +171,7 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev) en_dev = rdev->en_dev; rdev->qplib_res.pdev = en_dev->pdev; - chip_ctx = kzalloc(sizeof(*chip_ctx), GFP_KERNEL); + chip_ctx = kzalloc_obj(*chip_ctx, GFP_KERNEL); if (!chip_ctx) return -ENOMEM; chip_ctx->chip_num = en_dev->chip_num; @@ -182,7 +182,7 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev) rdev->qplib_res.cctx = rdev->chip_ctx; rdev->rcfw.res = &rdev->qplib_res; - rdev->dev_attr = kzalloc(sizeof(*rdev->dev_attr), GFP_KERNEL); + rdev->dev_attr = kzalloc_obj(*rdev->dev_attr, GFP_KERNEL); if (!rdev->dev_attr) goto free_chip_ctx; rdev->qplib_res.dattr = rdev->dev_attr; @@ -420,7 +420,7 @@ static void bnxt_re_async_notifier(void *handle, struct hwrm_async_event_cmpl *c switch (event_id) { case ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE: - dcb_work = kzalloc(sizeof(*dcb_work), GFP_ATOMIC); + dcb_work = kzalloc_obj(*dcb_work, GFP_ATOMIC); if (!dcb_work) break; @@ -2033,7 +2033,7 @@ static int bnxt_re_ib_init(struct bnxt_re_dev *rdev) static int bnxt_re_alloc_nqr_mem(struct bnxt_re_dev *rdev) { - rdev->nqr = kzalloc(sizeof(*rdev->nqr), GFP_KERNEL); + rdev->nqr = kzalloc_obj(*rdev->nqr, GFP_KERNEL); if (!rdev->nqr) return -ENOMEM; @@ -2491,7 +2491,7 @@ static int bnxt_re_probe(struct auxiliary_device *adev, en_dev = aux_priv->edev; mutex_lock(&bnxt_re_mutex); - en_info = kzalloc(sizeof(*en_info), GFP_KERNEL); + en_info = kzalloc_obj(*en_info, GFP_KERNEL); if (!en_info) { mutex_unlock(&bnxt_re_mutex); return -ENOMEM; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 3e44311bf939..9a491e489b2f 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -688,8 +688,8 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, srq->start_idx = 0; srq->last_idx = srq->hwq.max_elements - 1; if (!srq->hwq.is_user) { - srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), - GFP_KERNEL); + srq->swq = kzalloc_objs(*srq->swq, srq->hwq.max_elements, + GFP_KERNEL); if (!srq->swq) { rc = -ENOMEM; goto fail; @@ -799,7 +799,7 @@ static int bnxt_qplib_alloc_init_swq(struct bnxt_qplib_q *que) { int indx; - que->swq = kcalloc(que->max_sw_wqe, sizeof(*que->swq), GFP_KERNEL); + que->swq = kzalloc_objs(*que->swq, que->max_sw_wqe, GFP_KERNEL); if (!que->swq) return -ENOMEM; @@ -2096,7 +2096,7 @@ queue_err: qp->wqe_cnt++; done: if (sch_handler) { - nq_work = kzalloc(sizeof(*nq_work), GFP_ATOMIC); + nq_work = kzalloc_obj(*nq_work, GFP_ATOMIC); if (nq_work) { nq_work->cq = qp->scq; nq_work->nq = qp->scq->nq; @@ -2183,7 +2183,7 @@ queue_err: bnxt_qplib_hwq_incr_prod(&rq->dbinfo, hwq, swq->slots); done: if (sch_handler) { - nq_work = kzalloc(sizeof(*nq_work), GFP_ATOMIC); + nq_work = kzalloc_obj(*nq_work, GFP_ATOMIC); if (nq_work) { nq_work->cq = qp->rcq; nq_work->nq = qp->rcq->nq; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 4dad0cfcfa98..4ba87b0ed62f 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -968,8 +968,8 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res, goto fail; } - rcfw->crsqe_tbl = kcalloc(cmdq->hwq.max_elements, - sizeof(*rcfw->crsqe_tbl), GFP_KERNEL); + rcfw->crsqe_tbl = kzalloc_objs(*rcfw->crsqe_tbl, cmdq->hwq.max_elements, + GFP_KERNEL); if (!rcfw->crsqe_tbl) goto fail; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 4d674a3aee1a..619947e2f114 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -556,7 +556,7 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, struct bnxt_qplib_sgid_tbl *sgid_tbl, u16 max) { - sgid_tbl->tbl = kcalloc(max, sizeof(*sgid_tbl->tbl), GFP_KERNEL); + sgid_tbl->tbl = kzalloc_objs(*sgid_tbl->tbl, max, GFP_KERNEL); if (!sgid_tbl->tbl) return -ENOMEM; @@ -872,8 +872,8 @@ int bnxt_qplib_alloc_res(struct bnxt_qplib_res *res, struct net_device *netdev) /* Allocate one extra to hold the QP1 entries */ rcfw->qp_tbl_size = max_t(u32, BNXT_RE_MAX_QPC_COUNT + 1, dev_attr->max_qp); - rcfw->qp_tbl = kcalloc(rcfw->qp_tbl_size, sizeof(struct bnxt_qplib_qp_node), - GFP_KERNEL); + rcfw->qp_tbl = kzalloc_objs(struct bnxt_qplib_qp_node, + rcfw->qp_tbl_size, GFP_KERNEL); if (!rcfw->qp_tbl) return -ENOMEM; diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index 14ced7b667fa..c891fc3177e9 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c @@ -1095,10 +1095,10 @@ int c4iw_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, if (ucontext) { ret = -ENOMEM; - mm = kmalloc(sizeof(*mm), GFP_KERNEL); + mm = kmalloc_obj(*mm, GFP_KERNEL); if (!mm) goto err_remove_handle; - mm2 = kmalloc(sizeof(*mm2), GFP_KERNEL); + mm2 = kmalloc_obj(*mm2, GFP_KERNEL); if (!mm2) goto err_free_mm; diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index d892f55febe2..95e01f23c7b9 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c @@ -330,7 +330,7 @@ static int qp_open(struct inode *inode, struct file *file) unsigned long index; int count = 1; - qpd = kmalloc(sizeof(*qpd), GFP_KERNEL); + qpd = kmalloc_obj(*qpd, GFP_KERNEL); if (!qpd) return -ENOMEM; @@ -424,7 +424,7 @@ static int stag_open(struct inode *inode, struct file *file) int ret = 0; int count = 1; - stagd = kmalloc(sizeof(*stagd), GFP_KERNEL); + stagd = kmalloc_obj(*stagd, GFP_KERNEL); if (!stagd) { ret = -ENOMEM; goto out; @@ -675,7 +675,7 @@ static int ep_open(struct inode *inode, struct file *file) int ret = 0; int count = 1; - epd = kmalloc(sizeof(*epd), GFP_KERNEL); + epd = kmalloc_obj(*epd, GFP_KERNEL); if (!epd) { ret = -ENOMEM; goto out; @@ -881,9 +881,9 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) rdev->status_page->write_cmpl_supported = rdev->lldi.write_cmpl_support; if (c4iw_wr_log) { - rdev->wr_log = kcalloc(1 << c4iw_wr_log_size_order, - sizeof(*rdev->wr_log), - GFP_KERNEL); + rdev->wr_log = kzalloc_objs(*rdev->wr_log, + 1 << c4iw_wr_log_size_order, + GFP_KERNEL); if (rdev->wr_log) { rdev->wr_log_size = 1 << c4iw_wr_log_size_order; atomic_set(&rdev->wr_log_idx, 0); @@ -1078,7 +1078,7 @@ static void *c4iw_uld_add(const struct cxgb4_lld_info *infop) pr_info("Chelsio T4/T5 RDMA Driver - version %s\n", DRV_VERSION); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ctx = ERR_PTR(-ENOMEM); goto out; @@ -1439,7 +1439,7 @@ static void recover_queues(struct uld_ctx *ctx) xa_for_each(&ctx->dev->qps, index, qp) count++; - qp_list.qps = kcalloc(count, sizeof(*qp_list.qps), GFP_ATOMIC); + qp_list.qps = kzalloc_objs(*qp_list.qps, count, GFP_ATOMIC); if (!qp_list.qps) { xa_unlock_irq(&ctx->dev->qps); return; @@ -1522,7 +1522,7 @@ struct c4iw_wr_wait *c4iw_alloc_wr_wait(gfp_t gfp) { struct c4iw_wr_wait *wr_waitp; - wr_waitp = kzalloc(sizeof(*wr_waitp), gfp); + wr_waitp = kzalloc_obj(*wr_waitp, gfp); if (wr_waitp) { kref_init(&wr_waitp->kref); pr_debug("wr_wait %p\n", wr_waitp); diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c index adeed7447e7b..caa489c653ce 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -282,7 +282,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, if (c4iw_fatal_error(rdev)) return -EIO; - tpt = kmalloc(sizeof(*tpt), GFP_KERNEL); + tpt = kmalloc_obj(*tpt, GFP_KERNEL); if (!tpt) return -ENOMEM; @@ -439,7 +439,7 @@ struct ib_mr *c4iw_get_dma_mr(struct ib_pd *pd, int acc) php = to_c4iw_pd(pd); rhp = php->rhp; - mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); + mhp = kzalloc_obj(*mhp, GFP_KERNEL); if (!mhp) return ERR_PTR(-ENOMEM); mhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); @@ -517,7 +517,7 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, if (mr_exceeds_hw_limits(rhp, length)) return ERR_PTR(-EINVAL); - mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); + mhp = kzalloc_obj(*mhp, GFP_KERNEL); if (!mhp) return ERR_PTR(-ENOMEM); mhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); @@ -618,7 +618,7 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, use_dsgl)) return ERR_PTR(-EINVAL); - mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); + mhp = kzalloc_obj(*mhp, GFP_KERNEL); if (!mhp) { ret = -ENOMEM; goto err; diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index e059f92d90fd..03db946208b6 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -92,7 +92,7 @@ static int c4iw_alloc_ucontext(struct ib_ucontext *ucontext, pr_err_once("Warning - downlevel libcxgb4 (non-fatal), device status page disabled\n"); rhp->rdev.flags |= T4_STATUS_PAGE_DISABLED; } else { - mm = kmalloc(sizeof(*mm), GFP_KERNEL); + mm = kmalloc_obj(*mm, GFP_KERNEL); if (!mm) { ret = -ENOMEM; goto err; diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index 955f061a55e9..f942a5428283 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c @@ -223,17 +223,16 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, } if (!user) { - wq->sq.sw_sq = kcalloc(wq->sq.size, sizeof(*wq->sq.sw_sq), - GFP_KERNEL); + wq->sq.sw_sq = kzalloc_objs(*wq->sq.sw_sq, wq->sq.size, + GFP_KERNEL); if (!wq->sq.sw_sq) { ret = -ENOMEM; goto free_rq_qid;//FIXME } if (need_rq) { - wq->rq.sw_rq = kcalloc(wq->rq.size, - sizeof(*wq->rq.sw_rq), - GFP_KERNEL); + wq->rq.sw_rq = kzalloc_objs(*wq->rq.sw_rq, wq->rq.size, + GFP_KERNEL); if (!wq->rq.sw_rq) { ret = -ENOMEM; goto free_sw_sq; @@ -2221,26 +2220,25 @@ int c4iw_create_qp(struct ib_qp *qp, struct ib_qp_init_attr *attrs, goto err_destroy_qp; if (udata && ucontext) { - sq_key_mm = kmalloc(sizeof(*sq_key_mm), GFP_KERNEL); + sq_key_mm = kmalloc_obj(*sq_key_mm, GFP_KERNEL); if (!sq_key_mm) { ret = -ENOMEM; goto err_remove_handle; } if (!attrs->srq) { - rq_key_mm = kmalloc(sizeof(*rq_key_mm), GFP_KERNEL); + rq_key_mm = kmalloc_obj(*rq_key_mm, GFP_KERNEL); if (!rq_key_mm) { ret = -ENOMEM; goto err_free_sq_key; } } - sq_db_key_mm = kmalloc(sizeof(*sq_db_key_mm), GFP_KERNEL); + sq_db_key_mm = kmalloc_obj(*sq_db_key_mm, GFP_KERNEL); if (!sq_db_key_mm) { ret = -ENOMEM; goto err_free_rq_key; } if (!attrs->srq) { - rq_db_key_mm = - kmalloc(sizeof(*rq_db_key_mm), GFP_KERNEL); + rq_db_key_mm = kmalloc_obj(*rq_db_key_mm, GFP_KERNEL); if (!rq_db_key_mm) { ret = -ENOMEM; goto err_free_sq_db_key; @@ -2248,8 +2246,8 @@ int c4iw_create_qp(struct ib_qp *qp, struct ib_qp_init_attr *attrs, } memset(&uresp, 0, sizeof(uresp)); if (t4_sq_onchip(&qhp->wq.sq)) { - ma_sync_key_mm = kmalloc(sizeof(*ma_sync_key_mm), - GFP_KERNEL); + ma_sync_key_mm = kmalloc_obj(*ma_sync_key_mm, + GFP_KERNEL); if (!ma_sync_key_mm) { ret = -ENOMEM; goto err_free_rq_db_key; @@ -2552,13 +2550,11 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx, goto err; if (!user) { - wq->sw_rq = kcalloc(wq->size, sizeof(*wq->sw_rq), - GFP_KERNEL); + wq->sw_rq = kzalloc_objs(*wq->sw_rq, wq->size, GFP_KERNEL); if (!wq->sw_rq) goto err_put_qpid; - wq->pending_wrs = kcalloc(srq->wq.size, - sizeof(*srq->wq.pending_wrs), - GFP_KERNEL); + wq->pending_wrs = kzalloc_objs(*srq->wq.pending_wrs, + srq->wq.size, GFP_KERNEL); if (!wq->pending_wrs) goto err_free_sw_rq; } @@ -2761,12 +2757,12 @@ int c4iw_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *attrs, srq->flags = T4_SRQ_LIMIT_SUPPORT; if (udata) { - srq_key_mm = kmalloc(sizeof(*srq_key_mm), GFP_KERNEL); + srq_key_mm = kmalloc_obj(*srq_key_mm, GFP_KERNEL); if (!srq_key_mm) { ret = -ENOMEM; goto err_free_queue; } - srq_db_key_mm = kmalloc(sizeof(*srq_db_key_mm), GFP_KERNEL); + srq_db_key_mm = kmalloc_obj(*srq_db_key_mm, GFP_KERNEL); if (!srq_db_key_mm) { ret = -ENOMEM; goto err_free_srq_key_mm; diff --git a/drivers/infiniband/hw/cxgb4/resource.c b/drivers/infiniband/hw/cxgb4/resource.c index e800e8e8bed5..224098e456c6 100644 --- a/drivers/infiniband/hw/cxgb4/resource.c +++ b/drivers/infiniband/hw/cxgb4/resource.c @@ -126,7 +126,7 @@ u32 c4iw_get_cqid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) rdev->stats.qid.cur += rdev->qpmask + 1; mutex_unlock(&rdev->stats.lock); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = i; @@ -137,13 +137,13 @@ u32 c4iw_get_cqid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) * now put the same ids on the qp list since they all * map to the same db/gts page. */ - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = qid; list_add_tail(&entry->entry, &uctx->qpids); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = i; @@ -165,7 +165,7 @@ void c4iw_put_cqid(struct c4iw_rdev *rdev, u32 qid, { struct c4iw_qid_list *entry; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return; pr_debug("qid 0x%x\n", qid); @@ -200,7 +200,7 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) rdev->stats.qid.cur += rdev->qpmask + 1; mutex_unlock(&rdev->stats.lock); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = i; @@ -211,13 +211,13 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) * now put the same ids on the cq list since they all * map to the same db/gts page. */ - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = qid; list_add_tail(&entry->entry, &uctx->cqids); for (i = qid + 1; i & rdev->qpmask; i++) { - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) goto out; entry->qid = i; @@ -239,7 +239,7 @@ void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid, { struct c4iw_qid_list *entry; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return; pr_debug("qid 0x%x\n", qid); diff --git a/drivers/infiniband/hw/cxgb4/restrack.c b/drivers/infiniband/hw/cxgb4/restrack.c index fd22c85d35f4..d9fdedce0f21 100644 --- a/drivers/infiniband/hw/cxgb4/restrack.c +++ b/drivers/infiniband/hw/cxgb4/restrack.c @@ -209,7 +209,7 @@ int c4iw_fill_res_cm_id_entry(struct sk_buff *msg, epcp = (struct c4iw_ep_common *)iw_cm_id->provider_data; if (!epcp) return 0; - uep = kzalloc(sizeof(*uep), GFP_KERNEL); + uep = kzalloc_obj(*uep, GFP_KERNEL); if (!uep) return 0; diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c index 6c415b9adb5f..2e6b37385e5a 100644 --- a/drivers/infiniband/hw/efa/efa_main.c +++ b/drivers/infiniband/hw/efa/efa_main.c @@ -332,7 +332,7 @@ static int efa_create_eqs(struct efa_dev *dev) neqs = min_t(u32, neqs, dev->num_irq_vectors - EFA_COMP_EQS_VEC_BASE); dev->neqs = neqs; - dev->eqs = kcalloc(neqs, sizeof(*dev->eqs), GFP_KERNEL); + dev->eqs = kzalloc_objs(*dev->eqs, neqs, GFP_KERNEL); if (!dev->eqs) return -ENOMEM; diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 755bba8d58bb..29a4e51dc015 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -525,7 +525,7 @@ efa_user_mmap_entry_insert(struct ib_ucontext *ucontext, u64 address, size_t length, u8 mmap_flag, u64 *offset) { - struct efa_user_mmap_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct efa_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); int err; if (!entry) @@ -1335,7 +1335,7 @@ static struct scatterlist *efa_vmalloc_buf_to_sg(u64 *buf, int page_cnt) struct page *pg; int i; - sglist = kmalloc_array(page_cnt, sizeof(*sglist), GFP_KERNEL); + sglist = kmalloc_objs(*sglist, page_cnt, GFP_KERNEL); if (!sglist) return NULL; sg_init_table(sglist, page_cnt); @@ -1374,9 +1374,8 @@ static int pbl_chunk_list_create(struct efa_dev *dev, struct pbl_context *pbl) chunk_list_size = DIV_ROUND_UP(page_cnt, EFA_PTRS_PER_CHUNK); chunk_list->size = chunk_list_size; - chunk_list->chunks = kcalloc(chunk_list_size, - sizeof(*chunk_list->chunks), - GFP_KERNEL); + chunk_list->chunks = kzalloc_objs(*chunk_list->chunks, chunk_list_size, + GFP_KERNEL); if (!chunk_list->chunks) return -ENOMEM; @@ -1682,7 +1681,7 @@ static struct efa_mr *efa_alloc_mr(struct ib_pd *ibpd, int access_flags, return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/erdma/erdma_cm.c b/drivers/infiniband/hw/erdma/erdma_cm.c index ed21ba0037a4..3b164f645e6e 100644 --- a/drivers/infiniband/hw/erdma/erdma_cm.c +++ b/drivers/infiniband/hw/erdma/erdma_cm.c @@ -91,7 +91,7 @@ static void erdma_disassoc_listen_cep(struct erdma_cep *cep) static struct erdma_cep *erdma_cep_alloc(struct erdma_dev *dev) { - struct erdma_cep *cep = kzalloc(sizeof(*cep), GFP_KERNEL); + struct erdma_cep *cep = kzalloc_obj(*cep, GFP_KERNEL); unsigned long flags; if (!cep) @@ -217,7 +217,7 @@ static int erdma_cm_alloc_work(struct erdma_cep *cep, int num) struct erdma_cm_work *work; while (num--) { - work = kmalloc(sizeof(*work), GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) { if (!(list_empty(&cep->work_freelist))) erdma_cm_free_work(cep); @@ -1340,7 +1340,7 @@ int erdma_create_listen(struct iw_cm_id *id, int backlog) if (!id->provider_data) { id->provider_data = - kmalloc(sizeof(struct list_head), GFP_KERNEL); + kmalloc_obj(struct list_head, GFP_KERNEL); if (!id->provider_data) { ret = -ENOMEM; goto error; diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c index 109a3f3de911..7adf95d1315b 100644 --- a/drivers/infiniband/hw/erdma/erdma_verbs.c +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c @@ -291,8 +291,7 @@ static struct rdma_user_mmap_entry * erdma_user_mmap_entry_insert(struct erdma_ucontext *uctx, void *address, u32 size, u8 mmap_flag, u64 *mmap_offset) { - struct erdma_user_mmap_entry *entry = - kzalloc(sizeof(*entry), GFP_KERNEL); + struct erdma_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); int ret; if (!entry) @@ -600,7 +599,7 @@ static struct erdma_mtt *erdma_create_cont_mtt(struct erdma_dev *dev, { struct erdma_mtt *mtt; - mtt = kzalloc(sizeof(*mtt), GFP_KERNEL); + mtt = kzalloc_obj(*mtt, GFP_KERNEL); if (!mtt) return ERR_PTR(-ENOMEM); @@ -725,7 +724,7 @@ static struct erdma_mtt *erdma_create_scatter_mtt(struct erdma_dev *dev, struct erdma_mtt *mtt; int ret = -ENOMEM; - mtt = kzalloc(sizeof(*mtt), GFP_KERNEL); + mtt = kzalloc_obj(*mtt, GFP_KERNEL); if (!mtt) return ERR_PTR(-ENOMEM); @@ -888,7 +887,7 @@ static int erdma_map_user_dbrecords(struct erdma_ucontext *ctx, if (page->va == (dbrecords_va & PAGE_MASK)) goto found; - page = kmalloc(sizeof(*page), GFP_KERNEL); + page = kmalloc_obj(*page, GFP_KERNEL); if (!page) { rv = -ENOMEM; goto out; @@ -1116,7 +1115,7 @@ struct ib_mr *erdma_get_dma_mr(struct ib_pd *ibpd, int acc) u32 stag; int ret; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1160,7 +1159,7 @@ struct ib_mr *erdma_ib_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, if (max_num_sg > ERDMA_MR_MAX_MTT_CNT) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1246,7 +1245,7 @@ struct ib_mr *erdma_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (!len || len > dev->attrs.max_mr_size) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index ee7fedc67b86..28ded5e12b42 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -199,7 +199,7 @@ static struct hfi1_affinity_node *node_affinity_allocate(int node) { struct hfi1_affinity_node *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; entry->node = node; @@ -406,9 +406,9 @@ static int _dev_comp_vect_mappings_create(struct hfi1_devdata *dd, return -ENOMEM; } - dd->comp_vect_mappings = kcalloc(dd->comp_vect_possible_cpus, - sizeof(*dd->comp_vect_mappings), - GFP_KERNEL); + dd->comp_vect_mappings = kzalloc_objs(*dd->comp_vect_mappings, + dd->comp_vect_possible_cpus, + GFP_KERNEL); if (!dd->comp_vect_mappings) { ret = -ENOMEM; goto fail; diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index 0781ab756d44..b03f39ee1964 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -14221,7 +14221,7 @@ static struct rsm_map_table *alloc_rsm_map_table(struct hfi1_devdata *dd) struct rsm_map_table *rmt; u8 rxcontext = is_ax(dd) ? 0 : 0xff; /* 0 is default if a0 ver. */ - rmt = kmalloc(sizeof(*rmt), GFP_KERNEL); + rmt = kmalloc_obj(*rmt, GFP_KERNEL); if (rmt) { memset(rmt->map, rxcontext, sizeof(rmt->map)); rmt->used = 0; @@ -14872,7 +14872,7 @@ static int init_asic_data(struct hfi1_devdata *dd) int ret = 0; /* pre-allocate the asic structure in case we are the first device */ - asic_data = kzalloc(sizeof(*dd->asic_data), GFP_KERNEL); + asic_data = kzalloc_obj(*dd->asic_data, GFP_KERNEL); if (!asic_data) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/efivar.c b/drivers/infiniband/hw/hfi1/efivar.c index 9ed05e10020e..f311b2f328a9 100644 --- a/drivers/infiniband/hw/hfi1/efivar.c +++ b/drivers/infiniband/hw/hfi1/efivar.c @@ -41,7 +41,7 @@ static int read_efi_var(const char *name, unsigned long *size, if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) return -EOPNOTSUPP; - uni_name = kcalloc(strlen(name) + 1, sizeof(efi_char16_t), GFP_KERNEL); + uni_name = kzalloc_objs(efi_char16_t, strlen(name) + 1, GFP_KERNEL); temp_buffer = kzalloc(EFI_DATA_SIZE, GFP_KERNEL); if (!uni_name || !temp_buffer) { diff --git a/drivers/infiniband/hw/hfi1/fault.c b/drivers/infiniband/hw/hfi1/fault.c index a45cbffd52c7..697210b84937 100644 --- a/drivers/infiniband/hw/hfi1/fault.c +++ b/drivers/infiniband/hw/hfi1/fault.c @@ -209,7 +209,7 @@ int hfi1_fault_init_debugfs(struct hfi1_ibdev *ibd) struct dentry *parent = ibd->hfi1_ibdev_dbg; struct dentry *fault_dir; - ibd->fault = kzalloc(sizeof(*ibd->fault), GFP_KERNEL); + ibd->fault = kzalloc_obj(*ibd->fault, GFP_KERNEL); if (!ibd->fault) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index 503abec709c9..9baedace9ccc 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/drivers/infiniband/hw/hfi1/file_ops.c @@ -158,7 +158,7 @@ static int hfi1_file_open(struct inode *inode, struct file *fp) /* The real work is performed later in assign_ctxt() */ - fd = kzalloc(sizeof(*fd), GFP_KERNEL); + fd = kzalloc_obj(*fd, GFP_KERNEL); if (!fd || init_srcu_struct(&fd->pq_srcu)) goto nomem; diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index e4aef102dac0..5bc8250ffbb2 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -646,7 +646,7 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd, spin_lock_init(&ppd->cc_state_lock); spin_lock_init(&ppd->cc_log_lock); - cc_state = kzalloc(sizeof(*cc_state), GFP_KERNEL); + cc_state = kzalloc_obj(*cc_state, GFP_KERNEL); RCU_INIT_POINTER(ppd->cc_state, cc_state); if (!cc_state) goto bail; @@ -1282,7 +1282,7 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, goto bail; } - dd->comp_vect = kzalloc(sizeof(*dd->comp_vect), GFP_KERNEL); + dd->comp_vect = kzalloc_obj(*dd->comp_vect, GFP_KERNEL); if (!dd->comp_vect) { ret = -ENOMEM; goto bail; diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c index 961fa07116f0..41791ade91bd 100644 --- a/drivers/infiniband/hw/hfi1/mad.c +++ b/drivers/infiniband/hw/hfi1/mad.c @@ -390,7 +390,7 @@ static struct trap_node *create_trap_node(u8 type, __be16 trap_num, u32 lid) { struct trap_node *trap; - trap = kzalloc(sizeof(*trap), GFP_ATOMIC); + trap = kzalloc_obj(*trap, GFP_ATOMIC); if (!trap) return NULL; @@ -3736,7 +3736,7 @@ static void apply_cc_state(struct hfi1_pportdata *ppd) { struct cc_state *old_cc_state, *new_cc_state; - new_cc_state = kzalloc(sizeof(*new_cc_state), GFP_KERNEL); + new_cc_state = kzalloc_obj(*new_cc_state, GFP_KERNEL); if (!new_cc_state) return; diff --git a/drivers/infiniband/hw/hfi1/msix.c b/drivers/infiniband/hw/hfi1/msix.c index 77d2ece9a9cb..790a4fd79421 100644 --- a/drivers/infiniband/hw/hfi1/msix.c +++ b/drivers/infiniband/hw/hfi1/msix.c @@ -38,8 +38,7 @@ int msix_initialize(struct hfi1_devdata *dd) return ret; } - entries = kcalloc(total, sizeof(*dd->msix_info.msix_entries), - GFP_KERNEL); + entries = kzalloc_objs(*dd->msix_info.msix_entries, total, GFP_KERNEL); if (!entries) { pci_free_irq_vectors(dd->pcidev); return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/pin_system.c b/drivers/infiniband/hw/hfi1/pin_system.c index cce56134519b..d8109b06aa70 100644 --- a/drivers/infiniband/hw/hfi1/pin_system.c +++ b/drivers/infiniband/hw/hfi1/pin_system.c @@ -119,7 +119,7 @@ static int pin_system_pages(struct user_sdma_request *req, int pinned, cleared; struct page **pages; - pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -173,7 +173,7 @@ static int add_system_pinning(struct user_sdma_request *req, struct sdma_mmu_node *node; int ret; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c index 764286da2ce8..fdf7cecb8336 100644 --- a/drivers/infiniband/hw/hfi1/pio.c +++ b/drivers/infiniband/hw/hfi1/pio.c @@ -407,9 +407,8 @@ int init_send_contexts(struct hfi1_devdata *dd) dd->hw_to_sw = kmalloc_array(TXE_NUM_CONTEXTS, sizeof(u8), GFP_KERNEL); - dd->send_contexts = kcalloc(dd->num_send_contexts, - sizeof(struct send_context_info), - GFP_KERNEL); + dd->send_contexts = kzalloc_objs(struct send_context_info, + dd->num_send_contexts, GFP_KERNEL); if (!dd->send_contexts || !dd->hw_to_sw) { kfree(dd->hw_to_sw); kfree(dd->send_contexts); @@ -1883,8 +1882,8 @@ int pio_map_init(struct hfi1_devdata *dd, u8 port, u8 num_vls, u8 *vl_scontexts) vl_scontexts[i] = sc_per_vl + (extra > 0 ? 1 : 0); } /* build new map */ - newmap = kzalloc(struct_size(newmap, map, roundup_pow_of_two(num_vls)), - GFP_KERNEL); + newmap = kzalloc_flex(*newmap, map, roundup_pow_of_two(num_vls), + GFP_KERNEL); if (!newmap) goto bail; newmap->actual_vls = num_vls; @@ -1898,9 +1897,8 @@ int pio_map_init(struct hfi1_devdata *dd, u8 port, u8 num_vls, u8 *vl_scontexts) int sz = roundup_pow_of_two(vl_scontexts[i]); /* only allocate once */ - newmap->map[i] = kzalloc(struct_size(newmap->map[i], - ksc, sz), - GFP_KERNEL); + newmap->map[i] = kzalloc_flex(*newmap->map[i], ksc, sz, + GFP_KERNEL); if (!newmap->map[i]) goto bail; newmap->map[i]->mask = (1 << ilog2(sz)) - 1; @@ -2054,10 +2052,8 @@ int init_credit_return(struct hfi1_devdata *dd) int ret; int i; - dd->cr_base = kcalloc( - node_affinity.num_possible_nodes, - sizeof(struct credit_return_base), - GFP_KERNEL); + dd->cr_base = kzalloc_objs(struct credit_return_base, + node_affinity.num_possible_nodes, GFP_KERNEL); if (!dd->cr_base) { ret = -ENOMEM; goto done; diff --git a/drivers/infiniband/hw/hfi1/qsfp.c b/drivers/infiniband/hw/hfi1/qsfp.c index 3b7842a7f634..7c133037397c 100644 --- a/drivers/infiniband/hw/hfi1/qsfp.c +++ b/drivers/infiniband/hw/hfi1/qsfp.c @@ -107,7 +107,7 @@ static struct hfi1_i2c_bus *init_i2c_bus(struct hfi1_devdata *dd, struct hfi1_i2c_bus *bus; int ret; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) return NULL; diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index 5cfa4f8fbf3d..04763f50ff60 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c @@ -937,7 +937,7 @@ ssize_t sdma_set_cpu_to_sde_map(struct sdma_engine *sde, const char *buf, rht_node = rhashtable_lookup_fast(dd->sdma_rht, &cpu, sdma_rht_params); if (!rht_node) { - rht_node = kzalloc(sizeof(*rht_node), GFP_KERNEL); + rht_node = kzalloc_obj(*rht_node, GFP_KERNEL); if (!rht_node) { ret = -ENOMEM; goto out; @@ -1481,7 +1481,7 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) if (ret < 0) goto bail; - tmp_sdma_rht = kzalloc(sizeof(*tmp_sdma_rht), GFP_KERNEL); + tmp_sdma_rht = kzalloc_obj(*tmp_sdma_rht, GFP_KERNEL); if (!tmp_sdma_rht) { ret = -ENOMEM; goto bail; @@ -3017,7 +3017,7 @@ static int _extend_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx) if (unlikely(tx->num_desc == MAX_DESC)) goto enomem; - descp = kmalloc_array(MAX_DESC, sizeof(struct sdma_desc), GFP_ATOMIC); + descp = kmalloc_objs(struct sdma_desc, MAX_DESC, GFP_ATOMIC); if (!descp) goto enomem; tx->descp = descp; diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c index eafd2f157e32..90ddd59f1e1b 100644 --- a/drivers/infiniband/hw/hfi1/tid_rdma.c +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c @@ -233,7 +233,7 @@ bool tid_rdma_conn_reply(struct rvt_qp *qp, u64 data) * * at the responder, 0 being returned to the requester so as to * disable TID RDMA at both the requester and the responder */ - remote = kzalloc(sizeof(*remote), GFP_ATOMIC); + remote = kzalloc_obj(*remote, GFP_ATOMIC); if (!remote) { ret = false; goto null; diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c index 62b4f16dab27..1c16d4f9e1ab 100644 --- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c +++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c @@ -52,17 +52,16 @@ int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd, { int ret = 0; - fd->entry_to_rb = kcalloc(uctxt->expected_count, - sizeof(*fd->entry_to_rb), - GFP_KERNEL); + fd->entry_to_rb = kzalloc_objs(*fd->entry_to_rb, uctxt->expected_count, + GFP_KERNEL); if (!fd->entry_to_rb) return -ENOMEM; if (!HFI1_CAP_UGET_MASK(uctxt->flags, TID_UNMAP)) { fd->invalid_tid_idx = 0; - fd->invalid_tids = kcalloc(uctxt->expected_count, - sizeof(*fd->invalid_tids), - GFP_KERNEL); + fd->invalid_tids = kzalloc_objs(*fd->invalid_tids, + uctxt->expected_count, + GFP_KERNEL); if (!fd->invalid_tids) { kfree(fd->entry_to_rb); fd->entry_to_rb = NULL; @@ -170,7 +169,7 @@ static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) } /* Allocate the array of struct page pointers needed for pinning */ - pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -736,7 +735,7 @@ static int set_rcvarray_entry(struct hfi1_filedata *fd, * Allocate the node first so we can handle a potential * failure before we've programmed anything. */ - node = kzalloc(struct_size(node, pages, npages), GFP_KERNEL); + node = kzalloc_flex(*node, pages, npages, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index 9b1aece1b080..f2642fef0bf4 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -120,7 +120,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, dd = uctxt->dd; - pq = kzalloc(sizeof(*pq), GFP_KERNEL); + pq = kzalloc_obj(*pq, GFP_KERNEL); if (!pq) return -ENOMEM; pq->dd = dd; @@ -135,9 +135,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, activate_packet_queue, NULL, NULL); pq->reqidx = 0; - pq->reqs = kcalloc(hfi1_sdma_comp_ring_size, - sizeof(*pq->reqs), - GFP_KERNEL); + pq->reqs = kzalloc_objs(*pq->reqs, hfi1_sdma_comp_ring_size, GFP_KERNEL); if (!pq->reqs) goto pq_reqs_nomem; @@ -158,7 +156,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, goto pq_txreq_nomem; } - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) goto cq_nomem; diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c index 6ee911f6885b..8e802f118bc9 100644 --- a/drivers/infiniband/hw/hns/hns_roce_alloc.c +++ b/drivers/infiniband/hw/hns/hns_roce_alloc.c @@ -77,7 +77,7 @@ struct hns_roce_buf *hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, return ERR_PTR(-EINVAL); gfp_flags = (flags & HNS_ROCE_BUF_NOSLEEP) ? GFP_ATOMIC : GFP_KERNEL; - buf = kzalloc(sizeof(*buf), gfp_flags); + buf = kzalloc_obj(*buf, gfp_flags); if (!buf) return ERR_PTR(-ENOMEM); @@ -93,7 +93,7 @@ struct hns_roce_buf *hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, ntrunk = DIV_ROUND_UP(size, 1 << buf->trunk_shift); } - trunks = kcalloc(ntrunk, sizeof(*trunks), gfp_flags); + trunks = kzalloc_objs(*trunks, ntrunk, gfp_flags); if (!trunks) { kfree(buf); return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/hns/hns_roce_bond.c b/drivers/infiniband/hw/hns/hns_roce_bond.c index cc85f3ce1f3e..e3ffd7e20160 100644 --- a/drivers/infiniband/hw/hns/hns_roce_bond.c +++ b/drivers/infiniband/hw/hns/hns_roce_bond.c @@ -253,7 +253,7 @@ static struct hns_roce_die_info *alloc_die_info(int bus_num) struct hns_roce_die_info *die_info; int ret; - die_info = kzalloc(sizeof(*die_info), GFP_KERNEL); + die_info = kzalloc_obj(*die_info, GFP_KERNEL); if (!die_info) return NULL; @@ -855,7 +855,7 @@ int hns_roce_alloc_bond_grp(struct hns_roce_dev *hr_dev) return 0; for (i = 0; i < ROCE_BOND_NUM_MAX; i++) { - bond_grp = kvzalloc(sizeof(*bond_grp), GFP_KERNEL); + bond_grp = kvzalloc_obj(*bond_grp, GFP_KERNEL); if (!bond_grp) { ret = -ENOMEM; goto mem_err; diff --git a/drivers/infiniband/hw/hns/hns_roce_cmd.c b/drivers/infiniband/hw/hns/hns_roce_cmd.c index 873e8a69a1b9..f8a42ea6acac 100644 --- a/drivers/infiniband/hw/hns/hns_roce_cmd.c +++ b/drivers/infiniband/hw/hns/hns_roce_cmd.c @@ -219,7 +219,7 @@ int hns_roce_cmd_use_events(struct hns_roce_dev *hr_dev) int i; hr_cmd->context = - kcalloc(hr_cmd->max_cmds, sizeof(*hr_cmd->context), GFP_KERNEL); + kzalloc_objs(*hr_cmd->context, hr_cmd->max_cmds, GFP_KERNEL); if (!hr_cmd->context) { hr_dev->cmd_mod = 0; return -ENOMEM; @@ -254,7 +254,7 @@ hns_roce_alloc_cmd_mailbox(struct hns_roce_dev *hr_dev) { struct hns_roce_cmd_mailbox *mailbox; - mailbox = kmalloc(sizeof(*mailbox), GFP_KERNEL); + mailbox = kmalloc_obj(*mailbox, GFP_KERNEL); if (!mailbox) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/hns/hns_roce_db.c b/drivers/infiniband/hw/hns/hns_roce_db.c index 5c4c0480832b..ad8fcaf613b9 100644 --- a/drivers/infiniband/hw/hns/hns_roce_db.c +++ b/drivers/infiniband/hw/hns/hns_roce_db.c @@ -21,7 +21,7 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, unsigned long virt, if (page->user_virt == page_addr) goto found; - page = kmalloc(sizeof(*page), GFP_KERNEL); + page = kmalloc_obj(*page, GFP_KERNEL); if (!page) { ret = -ENOMEM; goto out; @@ -72,7 +72,7 @@ static struct hns_roce_db_pgdir *hns_roce_alloc_db_pgdir( { struct hns_roce_db_pgdir *pgdir; - pgdir = kzalloc(sizeof(*pgdir), GFP_KERNEL); + pgdir = kzalloc_obj(*pgdir, GFP_KERNEL); if (!pgdir) return NULL; diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index 3d479c63b117..11ba69dde716 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -262,7 +262,7 @@ static struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, return NULL; } - hem = kmalloc(sizeof(*hem), GFP_KERNEL); + hem = kmalloc_obj(*hem, GFP_KERNEL); if (!hem) return NULL; @@ -737,7 +737,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, obj_per_chunk = table->table_chunk_size / obj_size; num_hem = DIV_ROUND_UP(nobj, obj_per_chunk); - table->hem = kcalloc(num_hem, sizeof(*table->hem), GFP_KERNEL); + table->hem = kzalloc_objs(*table->hem, num_hem, GFP_KERNEL); if (!table->hem) return -ENOMEM; } else { @@ -763,8 +763,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, if (type >= HEM_TYPE_MTT) num_bt_l0 = bt_chunk_num; - table->hem = kcalloc(num_hem, sizeof(*table->hem), - GFP_KERNEL); + table->hem = kzalloc_objs(*table->hem, num_hem, GFP_KERNEL); if (!table->hem) goto err_kcalloc_hem_buf; @@ -778,9 +777,9 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, if (!table->bt_l1) goto err_kcalloc_bt_l1; - table->bt_l1_dma_addr = kcalloc(num_bt_l1, - sizeof(*table->bt_l1_dma_addr), - GFP_KERNEL); + table->bt_l1_dma_addr = kzalloc_objs(*table->bt_l1_dma_addr, + num_bt_l1, + GFP_KERNEL); if (!table->bt_l1_dma_addr) goto err_kcalloc_l1_dma; @@ -793,9 +792,9 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, if (!table->bt_l0) goto err_kcalloc_bt_l0; - table->bt_l0_dma_addr = kcalloc(num_bt_l0, - sizeof(*table->bt_l0_dma_addr), - GFP_KERNEL); + table->bt_l0_dma_addr = kzalloc_objs(*table->bt_l0_dma_addr, + num_bt_l0, + GFP_KERNEL); if (!table->bt_l0_dma_addr) goto err_kcalloc_l0_dma; } @@ -939,7 +938,7 @@ hem_list_alloc_item(struct hns_roce_dev *hr_dev, int start, int end, int count, { struct hns_roce_hem_item *hem; - hem = kzalloc(sizeof(*hem), GFP_KERNEL); + hem = kzalloc_obj(*hem, GFP_KERNEL); if (!hem) return NULL; diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 5d0a8662249d..3440a6f21c02 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -1948,7 +1948,7 @@ static int hns_roce_hw_v2_query_counter(struct hns_roce_dev *hr_dev, return -EINVAL; desc_num = DIV_ROUND_UP(HNS_ROCE_HW_CNT_TOTAL, CNT_PER_DESC); - desc = kcalloc(desc_num, sizeof(*desc), GFP_KERNEL); + desc = kzalloc_objs(*desc, desc_num, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -2881,7 +2881,7 @@ static struct ib_pd *free_mr_init_pd(struct hns_roce_dev *hr_dev) struct hns_roce_pd *hr_pd; struct ib_pd *pd; - hr_pd = kzalloc(sizeof(*hr_pd), GFP_KERNEL); + hr_pd = kzalloc_obj(*hr_pd, GFP_KERNEL); if (!hr_pd) return NULL; pd = &hr_pd->ibpd; @@ -2912,7 +2912,7 @@ static struct ib_cq *free_mr_init_cq(struct hns_roce_dev *hr_dev) cq_init_attr.cqe = HNS_ROCE_FREE_MR_USED_CQE_NUM; - hr_cq = kzalloc(sizeof(*hr_cq), GFP_KERNEL); + hr_cq = kzalloc_obj(*hr_cq, GFP_KERNEL); if (!hr_cq) return NULL; @@ -2945,7 +2945,7 @@ static int free_mr_init_qp(struct hns_roce_dev *hr_dev, struct ib_cq *cq, struct ib_qp *qp; int ret; - hr_qp = kzalloc(sizeof(*hr_qp), GFP_KERNEL); + hr_qp = kzalloc_obj(*hr_qp, GFP_KERNEL); if (!hr_qp) return -ENOMEM; @@ -5021,7 +5021,7 @@ static int alloc_dip_entry(struct xarray *dip_xa, u32 qpn) if (hr_dip) return 0; - hr_dip = kzalloc(sizeof(*hr_dip), GFP_KERNEL); + hr_dip = kzalloc_obj(*hr_dip, GFP_KERNEL); if (!hr_dip) return -ENOMEM; @@ -5635,8 +5635,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, * we should set all bits of the relevant fields in context mask to * 0 at the same time, else set them to 0x1. */ - context = kvzalloc(sizeof(*context), GFP_KERNEL); - qpc_mask = kvzalloc(sizeof(*qpc_mask), GFP_KERNEL); + context = kvzalloc_obj(*context, GFP_KERNEL); + qpc_mask = kvzalloc_obj(*qpc_mask, GFP_KERNEL); if (!context || !qpc_mask) goto out; @@ -6450,7 +6450,7 @@ static void hns_roce_v2_init_irq_work(struct hns_roce_dev *hr_dev, { struct hns_roce_work *irq_work; - irq_work = kzalloc(sizeof(struct hns_roce_work), GFP_ATOMIC); + irq_work = kzalloc_obj(struct hns_roce_work, GFP_ATOMIC); if (!irq_work) return; @@ -7107,7 +7107,7 @@ static int hns_roce_v2_init_eq_table(struct hns_roce_dev *hr_dev) eq_num = comp_num + aeq_num; irq_num = eq_num + other_num; - eq_table->eq = kcalloc(eq_num, sizeof(*eq_table->eq), GFP_KERNEL); + eq_table->eq = kzalloc_objs(*eq_table->eq, eq_num, GFP_KERNEL); if (!eq_table->eq) return -ENOMEM; @@ -7309,7 +7309,7 @@ static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle) if (!hr_dev) return -ENOMEM; - hr_dev->priv = kzalloc(sizeof(struct hns_roce_v2_priv), GFP_KERNEL); + hr_dev->priv = kzalloc_obj(struct hns_roce_v2_priv, GFP_KERNEL); if (!hr_dev->priv) { ret = -ENOMEM; goto error_failed_kzalloc; diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index a3490bab297a..349910dd99c6 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -366,7 +366,7 @@ hns_roce_user_mmap_entry_insert(struct ib_ucontext *ucontext, u64 address, struct hns_user_mmap_entry *entry; int ret; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -1153,8 +1153,8 @@ void hns_roce_handle_device_err(struct hns_roce_dev *hr_dev) static int hns_roce_alloc_dfx_cnt(struct hns_roce_dev *hr_dev) { - hr_dev->dfx_cnt = kvcalloc(HNS_ROCE_DFX_CNT_TOTAL, sizeof(atomic64_t), - GFP_KERNEL); + hr_dev->dfx_cnt = kvzalloc_objs(atomic64_t, HNS_ROCE_DFX_CNT_TOTAL, + GFP_KERNEL); if (!hr_dev->dfx_cnt) return -ENOMEM; diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c index 31cb8699e198..80917b8926c1 100644 --- a/drivers/infiniband/hw/hns/hns_roce_mr.c +++ b/drivers/infiniband/hw/hns/hns_roce_mr.c @@ -200,7 +200,7 @@ struct ib_mr *hns_roce_get_dma_mr(struct ib_pd *pd, int acc) struct hns_roce_mr *mr; int ret; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -243,7 +243,7 @@ struct ib_mr *hns_roce_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, goto err_out; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { ret = -ENOMEM; goto err_out; @@ -395,7 +395,7 @@ struct ib_mr *hns_roce_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, return ERR_PTR(-EINVAL); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -458,8 +458,9 @@ int hns_roce_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents, return sg_num; mr->npages = 0; - mr->page_list = kvcalloc(mr->pbl_mtr.hem_cfg.buf_pg_count, - sizeof(dma_addr_t), GFP_KERNEL); + mr->page_list = kvzalloc_objs(dma_addr_t, + mr->pbl_mtr.hem_cfg.buf_pg_count, + GFP_KERNEL); if (!mr->page_list) return sg_num; @@ -650,7 +651,7 @@ static int mtr_map_bufs(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr) page_shift = need_split_huge_page(mtr) ? HNS_HW_PAGE_SHIFT : mtr->hem_cfg.buf_pg_shift; /* alloc a tmp array to store buffer's dma address */ - pages = kvcalloc(page_count, sizeof(dma_addr_t), GFP_KERNEL); + pages = kvzalloc_objs(dma_addr_t, page_count, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/infiniband/hw/ionic/ionic_admin.c b/drivers/infiniband/hw/ionic/ionic_admin.c index 2537aa55d12d..850bd40ae3cc 100644 --- a/drivers/infiniband/hw/ionic/ionic_admin.c +++ b/drivers/infiniband/hw/ionic/ionic_admin.c @@ -520,7 +520,7 @@ static struct ionic_vcq *ionic_create_rdma_admincq(struct ionic_ibdev *dev, struct ionic_cq *cq; int rc; - vcq = kzalloc(sizeof(*vcq), GFP_KERNEL); + vcq = kzalloc_obj(*vcq, GFP_KERNEL); if (!vcq) return ERR_PTR(-ENOMEM); @@ -558,7 +558,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev, struct ionic_aq *aq; int rc; - aq = kzalloc(sizeof(*aq), GFP_KERNEL); + aq = kzalloc_obj(*aq, GFP_KERNEL); if (!aq) return ERR_PTR(-ENOMEM); @@ -575,7 +575,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev, ionic_queue_dbell_init(&aq->q, aq->aqid); - aq->q_wr = kcalloc((u32)aq->q.mask + 1, sizeof(*aq->q_wr), GFP_KERNEL); + aq->q_wr = kzalloc_objs(*aq->q_wr, (u32)aq->q.mask + 1, GFP_KERNEL); if (!aq->q_wr) { rc = -ENOMEM; goto err_wr; @@ -983,7 +983,7 @@ static struct ionic_eq *ionic_create_eq(struct ionic_ibdev *dev, int eqid) struct ionic_eq *eq; int rc; - eq = kzalloc(sizeof(*eq), GFP_KERNEL); + eq = kzalloc_obj(*eq, GFP_KERNEL); if (!eq) return ERR_PTR(-ENOMEM); @@ -1095,8 +1095,8 @@ int ionic_create_rdma_admin(struct ionic_ibdev *dev) goto out; } - dev->eq_vec = kmalloc_array(dev->lif_cfg.eq_count, sizeof(*dev->eq_vec), - GFP_KERNEL); + dev->eq_vec = kmalloc_objs(*dev->eq_vec, dev->lif_cfg.eq_count, + GFP_KERNEL); if (!dev->eq_vec) { rc = -ENOMEM; goto out; @@ -1126,8 +1126,8 @@ int ionic_create_rdma_admin(struct ionic_ibdev *dev) dev->lif_cfg.eq_count = eq_i; - dev->aq_vec = kmalloc_array(dev->lif_cfg.aq_count, sizeof(*dev->aq_vec), - GFP_KERNEL); + dev->aq_vec = kmalloc_objs(*dev->aq_vec, dev->lif_cfg.aq_count, + GFP_KERNEL); if (!dev->aq_vec) { rc = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c index ea12d9b8e125..9a2b09b783e0 100644 --- a/drivers/infiniband/hw/ionic/ionic_controlpath.c +++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c @@ -343,7 +343,7 @@ ionic_mmap_entry_insert(struct ionic_ctx *ctx, unsigned long size, struct ionic_mmap_entry *entry; int rc; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -852,7 +852,7 @@ struct ib_mr *ionic_get_dma_mr(struct ib_pd *ibpd, int access) struct ionic_pd *pd = to_ionic_pd(ibpd); struct ionic_mr *mr; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -878,7 +878,7 @@ struct ib_mr *ionic_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -945,7 +945,7 @@ struct ib_mr *ionic_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 offset, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1039,7 +1039,7 @@ struct ib_mr *ionic_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type type, if (type != IB_MR_TYPE_MEM_REG) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1868,9 +1868,8 @@ static int ionic_qp_sq_init(struct ionic_ibdev *dev, struct ionic_ctx *ctx, ionic_queue_dbell_init(&qp->sq, qp->qpid); - qp->sq_meta = kmalloc_array((u32)qp->sq.mask + 1, - sizeof(*qp->sq_meta), - GFP_KERNEL); + qp->sq_meta = kmalloc_objs(*qp->sq_meta, (u32)qp->sq.mask + 1, + GFP_KERNEL); if (!qp->sq_meta) { rc = -ENOMEM; goto err_sq_meta; @@ -2083,9 +2082,8 @@ static int ionic_qp_rq_init(struct ionic_ibdev *dev, struct ionic_ctx *ctx, ionic_queue_dbell_init(&qp->rq, qp->qpid); - qp->rq_meta = kmalloc_array((u32)qp->rq.mask + 1, - sizeof(*qp->rq_meta), - GFP_KERNEL); + qp->rq_meta = kmalloc_objs(*qp->rq_meta, (u32)qp->rq.mask + 1, + GFP_KERNEL); if (!qp->rq_meta) { rc = -ENOMEM; goto err_rq_meta; @@ -2205,7 +2203,7 @@ int ionic_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attr, qp->has_ah = attr->qp_type == IB_QPT_RC; if (qp->has_ah) { - qp->hdr = kzalloc(sizeof(*qp->hdr), GFP_KERNEL); + qp->hdr = kzalloc_obj(*qp->hdr, GFP_KERNEL); if (!qp->hdr) { rc = -ENOMEM; goto err_ah_alloc; diff --git a/drivers/infiniband/hw/ionic/ionic_hw_stats.c b/drivers/infiniband/hw/ionic/ionic_hw_stats.c index 244a80dde08f..3fbdc007dd05 100644 --- a/drivers/infiniband/hw/ionic/ionic_hw_stats.c +++ b/drivers/infiniband/hw/ionic/ionic_hw_stats.c @@ -155,9 +155,8 @@ static int ionic_init_hw_stats(struct ionic_ibdev *dev) dev->hw_stats_count = hw_stats_count; /* alloc and init array of names, for alloc_hw_stats */ - dev->hw_stats_hdrs = kcalloc(hw_stats_count, - sizeof(*dev->hw_stats_hdrs), - GFP_KERNEL); + dev->hw_stats_hdrs = kzalloc_objs(*dev->hw_stats_hdrs, hw_stats_count, + GFP_KERNEL); if (!dev->hw_stats_hdrs) { rc = -ENOMEM; goto err_dma; @@ -241,7 +240,7 @@ ionic_counter_alloc_stats(struct rdma_counter *counter) struct ionic_counter *cntr; int err; - cntr = kzalloc(sizeof(*cntr), GFP_KERNEL); + cntr = kzalloc_obj(*cntr, GFP_KERNEL); if (!cntr) return NULL; @@ -402,8 +401,8 @@ static int ionic_alloc_counters(struct ionic_ibdev *dev) cs->queue_stats_count = hw_stats_count; /* alloc and init array of names */ - cs->stats_hdrs = kcalloc(hw_stats_count, sizeof(*cs->stats_hdrs), - GFP_KERNEL); + cs->stats_hdrs = kzalloc_objs(*cs->stats_hdrs, hw_stats_count, + GFP_KERNEL); if (!cs->stats_hdrs) { rc = -ENOMEM; goto err_dma; @@ -449,8 +448,8 @@ void ionic_stats_init(struct ionic_ibdev *dev) } if (stats_type & IONIC_LIF_RDMA_STAT_QP) { - dev->counter_stats = kzalloc(sizeof(*dev->counter_stats), - GFP_KERNEL); + dev->counter_stats = kzalloc_obj(*dev->counter_stats, + GFP_KERNEL); if (!dev->counter_stats) return; diff --git a/drivers/infiniband/hw/irdma/cm.c b/drivers/infiniband/hw/irdma/cm.c index f4f4f92ba63a..aaff968138e2 100644 --- a/drivers/infiniband/hw/irdma/cm.c +++ b/drivers/infiniband/hw/irdma/cm.c @@ -234,7 +234,7 @@ static struct irdma_cm_event *irdma_create_event(struct irdma_cm_node *cm_node, if (!cm_node->cm_id) return NULL; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return NULL; @@ -1136,7 +1136,7 @@ int irdma_schedule_cm_timer(struct irdma_cm_node *cm_node, u32 was_timer_set; unsigned long flags; - new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); + new_send = kzalloc_obj(*new_send, GFP_ATOMIC); if (!new_send) { if (type != IRDMA_TIMER_TYPE_CLOSE) irdma_free_sqbuf(vsi, sqbuf); @@ -1683,7 +1683,8 @@ static int irdma_add_mqh_6(struct irdma_device *iwdev, ibdev_dbg(&iwdev->ibdev, "CM: IP=%pI6, vlan_id=%d, MAC=%pM\n", &ifp->addr, rdma_vlan_dev_vlan_id(ip_dev), ip_dev->dev_addr); - child_listen_node = kzalloc(sizeof(*child_listen_node), GFP_KERNEL); + child_listen_node = kzalloc_obj(*child_listen_node, + GFP_KERNEL); ibdev_dbg(&iwdev->ibdev, "CM: Allocating child listener %p\n", child_listen_node); if (!child_listen_node) { @@ -1771,7 +1772,8 @@ static int irdma_add_mqh_4(struct irdma_device *iwdev, "CM: Allocating child CM Listener forIP=%pI4, vlan_id=%d, MAC=%pM\n", &ifa->ifa_address, rdma_vlan_dev_vlan_id(ip_dev), ip_dev->dev_addr); - child_listen_node = kzalloc(sizeof(*child_listen_node), GFP_KERNEL); + child_listen_node = kzalloc_obj(*child_listen_node, + GFP_KERNEL); cm_parent_listen_node->cm_core->stats_listen_nodes_created++; ibdev_dbg(&iwdev->ibdev, "CM: Allocating child listener %p\n", child_listen_node); @@ -2243,7 +2245,7 @@ irdma_make_cm_node(struct irdma_cm_core *cm_core, struct irdma_device *iwdev, struct net_device *netdev = iwdev->netdev; /* create an hte and cm_node for this instance */ - cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC); + cm_node = kzalloc_obj(*cm_node, GFP_ATOMIC); if (!cm_node) return NULL; @@ -2967,7 +2969,7 @@ irdma_make_listen_node(struct irdma_cm_core *cm_core, /* create a CM listen node * 1/2 node to compare incoming traffic to */ - listener = kzalloc(sizeof(*listener), GFP_KERNEL); + listener = kzalloc_obj(*listener, GFP_KERNEL); if (!listener) return NULL; cm_core->stats_listen_nodes_created++; @@ -3444,7 +3446,7 @@ void irdma_cm_disconn(struct irdma_qp *iwqp) struct disconn_work *work; unsigned long flags; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return; diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c index 31c67b753fc0..8da3b2799593 100644 --- a/drivers/infiniband/hw/irdma/hw.c +++ b/drivers/infiniband/hw/irdma/hw.c @@ -1029,7 +1029,7 @@ static int irdma_create_cqp(struct irdma_pci_f *rf) u16 maj_err, min_err; int i, status; - cqp->cqp_requests = kcalloc(sqsize, sizeof(*cqp->cqp_requests), GFP_KERNEL); + cqp->cqp_requests = kzalloc_objs(*cqp->cqp_requests, sqsize, GFP_KERNEL); if (!cqp->cqp_requests) return -ENOMEM; @@ -1039,8 +1039,7 @@ static int irdma_create_cqp(struct irdma_pci_f *rf) goto err_scratch; } - cqp->oop_op_array = kcalloc(sqsize, sizeof(*cqp->oop_op_array), - GFP_KERNEL); + cqp->oop_op_array = kzalloc_objs(*cqp->oop_op_array, sqsize, GFP_KERNEL); if (!cqp->oop_op_array) { status = -ENOMEM; goto err_oop; @@ -1366,7 +1365,7 @@ static int irdma_setup_ceq_0(struct irdma_pci_f *rf) u32 num_ceqs; num_ceqs = min(rf->msix_count, rf->sc_dev.hmc_fpm_misc.max_ceqs); - rf->ceqlist = kcalloc(num_ceqs, sizeof(*rf->ceqlist), GFP_KERNEL); + rf->ceqlist = kzalloc_objs(*rf->ceqlist, num_ceqs, GFP_KERNEL); if (!rf->ceqlist) { status = -ENOMEM; goto exit; @@ -2466,7 +2465,7 @@ struct irdma_apbvt_entry *irdma_add_apbvt(struct irdma_device *iwdev, u16 port) return entry; } - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) { spin_unlock_irqrestore(&cm_core->apbvt_lock, flags); return NULL; diff --git a/drivers/infiniband/hw/irdma/i40iw_if.c b/drivers/infiniband/hw/irdma/i40iw_if.c index 15e036ddaffb..eea222ae125a 100644 --- a/drivers/infiniband/hw/irdma/i40iw_if.c +++ b/drivers/infiniband/hw/irdma/i40iw_if.c @@ -120,7 +120,7 @@ static int i40iw_open(struct i40e_info *cdev_info, struct i40e_client *client) if (!iwdev) return -ENOMEM; - iwdev->rf = kzalloc(sizeof(*rf), GFP_KERNEL); + iwdev->rf = kzalloc_obj(*rf, GFP_KERNEL); if (!iwdev->rf) { ib_dealloc_device(&iwdev->ibdev); return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/icrdma_if.c b/drivers/infiniband/hw/irdma/icrdma_if.c index b49fd9cf2476..60f3c7f1547d 100644 --- a/drivers/infiniband/hw/irdma/icrdma_if.c +++ b/drivers/infiniband/hw/irdma/icrdma_if.c @@ -167,8 +167,8 @@ static int icrdma_init_interrupts(struct irdma_pci_f *rf, struct iidc_rdma_core_ int i; rf->msix_count = num_online_cpus() + IRDMA_NUM_AEQ_MSIX; - rf->msix_entries = kcalloc(rf->msix_count, sizeof(*rf->msix_entries), - GFP_KERNEL); + rf->msix_entries = kzalloc_objs(*rf->msix_entries, rf->msix_count, + GFP_KERNEL); if (!rf->msix_entries) return -ENOMEM; @@ -258,7 +258,7 @@ static int icrdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary iwdev = ib_alloc_device(irdma_device, ibdev); if (!iwdev) return -ENOMEM; - iwdev->rf = kzalloc(sizeof(*rf), GFP_KERNEL); + iwdev->rf = kzalloc_obj(*rf, GFP_KERNEL); if (!iwdev->rf) { ib_dealloc_device(&iwdev->ibdev); return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/ig3rdma_if.c b/drivers/infiniband/hw/irdma/ig3rdma_if.c index e1d6670d9396..4d581ec341f3 100644 --- a/drivers/infiniband/hw/irdma/ig3rdma_if.c +++ b/drivers/infiniband/hw/irdma/ig3rdma_if.c @@ -101,8 +101,8 @@ static int ig3rdma_cfg_regions(struct irdma_hw *hw, return -ENOMEM; hw->num_io_regions = le16_to_cpu(idc_priv->num_memory_regions); - hw->io_regs = kcalloc(hw->num_io_regions, - sizeof(struct irdma_mmio_region), GFP_KERNEL); + hw->io_regs = kzalloc_objs(struct irdma_mmio_region, hw->num_io_regions, + GFP_KERNEL); if (!hw->io_regs) { iounmap(hw->rdma_reg.addr); @@ -175,7 +175,7 @@ static int ig3rdma_core_probe(struct auxiliary_device *aux_dev, struct irdma_pci_f *rf; int err; - rf = kzalloc(sizeof(*rf), GFP_KERNEL); + rf = kzalloc_obj(*rf, GFP_KERNEL); if (!rf) return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c index 960432bf7fc9..ab8c5284d4be 100644 --- a/drivers/infiniband/hw/irdma/utils.c +++ b/drivers/infiniband/hw/irdma/utils.c @@ -438,7 +438,7 @@ struct irdma_cqp_request *irdma_alloc_and_get_cqp_request(struct irdma_cqp *cqp, } spin_unlock_irqrestore(&cqp->req_lock, flags); if (!cqp_request) { - cqp_request = kzalloc(sizeof(*cqp_request), GFP_ATOMIC); + cqp_request = kzalloc_obj(*cqp_request, GFP_ATOMIC); if (cqp_request) { cqp_request->dynamic = true; if (wait) @@ -2025,7 +2025,7 @@ int irdma_puda_create_ah(struct irdma_sc_dev *dev, struct irdma_pci_f *rf = dev_to_rf(dev); int err; - ah = kzalloc(sizeof(*ah), GFP_ATOMIC); + ah = kzalloc_obj(*ah, GFP_ATOMIC); *ah_ret = ah; if (!ah) return -ENOMEM; @@ -2431,7 +2431,7 @@ void irdma_generate_flush_completions(struct irdma_qp *iwqp) spin_lock_irqsave(&iwqp->lock, flags2); while (IRDMA_RING_MORE_WORK(*sq_ring)) { - cmpl = kzalloc(sizeof(*cmpl), GFP_ATOMIC); + cmpl = kzalloc_obj(*cmpl, GFP_ATOMIC); if (!cmpl) { spin_unlock_irqrestore(&iwqp->lock, flags2); spin_unlock_irqrestore(&iwscq->lock, flags1); @@ -2475,7 +2475,7 @@ void irdma_generate_flush_completions(struct irdma_qp *iwqp) spin_lock_irqsave(&iwqp->lock, flags2); while (IRDMA_RING_MORE_WORK(*rq_ring)) { - cmpl = kzalloc(sizeof(*cmpl), GFP_ATOMIC); + cmpl = kzalloc_obj(*cmpl, GFP_ATOMIC); if (!cmpl) { spin_unlock_irqrestore(&iwqp->lock, flags2); spin_unlock_irqrestore(&iwrcq->lock, flags1); diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index cf8d19150574..818ea15d5d92 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -157,7 +157,7 @@ static struct rdma_user_mmap_entry* irdma_user_mmap_entry_insert(struct irdma_ucontext *ucontext, u64 bar_offset, enum irdma_mmap_flag mmap_flag, u64 *mmap_offset) { - struct irdma_user_mmap_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct irdma_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); int ret; if (!entry) @@ -709,12 +709,14 @@ static int irdma_setup_kmode_qp(struct irdma_device *iwdev, return status; iwqp->kqp.sq_wrid_mem = - kcalloc(ukinfo->sq_depth, sizeof(*iwqp->kqp.sq_wrid_mem), GFP_KERNEL); + kzalloc_objs(*iwqp->kqp.sq_wrid_mem, ukinfo->sq_depth, + GFP_KERNEL); if (!iwqp->kqp.sq_wrid_mem) return -ENOMEM; iwqp->kqp.rq_wrid_mem = - kcalloc(ukinfo->rq_depth, sizeof(*iwqp->kqp.rq_wrid_mem), GFP_KERNEL); + kzalloc_objs(*iwqp->kqp.rq_wrid_mem, ukinfo->rq_depth, + GFP_KERNEL); if (!iwqp->kqp.rq_wrid_mem) { kfree(iwqp->kqp.sq_wrid_mem); @@ -2109,7 +2111,7 @@ static int irdma_resize_cq(struct ib_cq *ibcq, int entries, info.cq_base = kmem_buf.va; info.cq_pa = kmem_buf.pa; - cq_buf = kzalloc(sizeof(*cq_buf), GFP_KERNEL); + cq_buf = kzalloc_obj(*cq_buf, GFP_KERNEL); if (!cq_buf) { ret = -ENOMEM; goto error; @@ -3151,7 +3153,7 @@ static struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 stag; int err_code; - iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -3368,7 +3370,7 @@ static struct irdma_mr *irdma_alloc_iwmr(struct ib_umem *region, struct irdma_mr *iwmr; unsigned long pgsz_bitmap; - iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -3807,7 +3809,7 @@ struct ib_mr *irdma_reg_phys_mr(struct ib_pd *pd, u64 addr, u64 size, int access u32 stag; int ret; - iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -4849,7 +4851,7 @@ static int irdma_attach_mcast(struct ib_qp *ibqp, union ib_gid *ibgid, u16 lid) struct irdma_dma_mem *dma_mem_mc; spin_unlock_irqrestore(&rf->qh_list_lock, flags); - mc_qht_elem = kzalloc(sizeof(*mc_qht_elem), GFP_KERNEL); + mc_qht_elem = kzalloc_obj(*mc_qht_elem, GFP_KERNEL); if (!mc_qht_elem) return -ENOMEM; diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c index 974dd610dcbf..413fde213120 100644 --- a/drivers/infiniband/hw/mana/cq.c +++ b/drivers/infiniband/hw/mana/cq.c @@ -147,7 +147,7 @@ int mana_ib_install_cq_cb(struct mana_ib_dev *mdev, struct mana_ib_cq *cq) if (cq->queue.kmem) gdma_cq = cq->queue.kmem; else - gdma_cq = kzalloc(sizeof(*gdma_cq), GFP_KERNEL); + gdma_cq = kzalloc_obj(*gdma_cq, GFP_KERNEL); if (!gdma_cq) return -ENOMEM; diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c index fac159f7128d..3d6a9c427269 100644 --- a/drivers/infiniband/hw/mana/main.c +++ b/drivers/infiniband/hw/mana/main.c @@ -793,8 +793,8 @@ int mana_ib_create_eqs(struct mana_ib_dev *mdev) if (err) return err; - mdev->eqs = kcalloc(mdev->ib_dev.num_comp_vectors, sizeof(struct gdma_queue *), - GFP_KERNEL); + mdev->eqs = kzalloc_objs(struct gdma_queue *, + mdev->ib_dev.num_comp_vectors, GFP_KERNEL); if (!mdev->eqs) { err = -ENOMEM; goto destroy_fatal_eq; diff --git a/drivers/infiniband/hw/mana/mr.c b/drivers/infiniband/hw/mana/mr.c index f979f26adc3b..b67d94842721 100644 --- a/drivers/infiniband/hw/mana/mr.c +++ b/drivers/infiniband/hw/mana/mr.c @@ -137,7 +137,7 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length, if (access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -221,7 +221,7 @@ struct ib_mr *mana_ib_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 start, u64 leng if (access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -286,7 +286,7 @@ struct ib_mr *mana_ib_get_dma_mr(struct ib_pd *ibpd, int access_flags) if (access_flags & ~VALID_DMA_MR_FLAGS) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -360,7 +360,7 @@ struct ib_dm *mana_ib_alloc_dm(struct ib_device *ibdev, struct mana_ib_dm *dm; int err; - dm = kzalloc(sizeof(*dm), GFP_KERNEL); + dm = kzalloc_obj(*dm, GFP_KERNEL); if (!dm) return ERR_PTR(-ENOMEM); @@ -425,7 +425,7 @@ struct ib_mr *mana_ib_reg_dm_mr(struct ib_pd *ibpd, struct ib_dm *ibdm, if (attr->access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 48c1f4977f21..811b8e0eab67 100644 --- a/drivers/infiniband/hw/mana/qp.c +++ b/drivers/infiniband/hw/mana/qp.c @@ -164,8 +164,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd, ibdev_dbg(&mdev->ib_dev, "rx_hash_function %d port %d\n", ucmd.rx_hash_function, port); - mana_ind_table = kcalloc(ind_tbl_size, sizeof(mana_handle_t), - GFP_KERNEL); + mana_ind_table = kzalloc_objs(mana_handle_t, ind_tbl_size, GFP_KERNEL); if (!mana_ind_table) { ret = -ENOMEM; goto fail; diff --git a/drivers/infiniband/hw/mana/wq.c b/drivers/infiniband/hw/mana/wq.c index f959f4b9244f..05789069369b 100644 --- a/drivers/infiniband/hw/mana/wq.c +++ b/drivers/infiniband/hw/mana/wq.c @@ -25,7 +25,7 @@ struct ib_wq *mana_ib_create_wq(struct ib_pd *pd, return ERR_PTR(err); } - wq = kzalloc(sizeof(*wq), GFP_KERNEL); + wq = kzalloc_obj(*wq, GFP_KERNEL); if (!wq) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index d7327735b8d0..82c01b99b60d 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c @@ -513,7 +513,7 @@ static int set_guid_rec(struct ib_device *ibdev, goto new_schedule; } - callback_context = kmalloc(sizeof *callback_context, GFP_KERNEL); + callback_context = kmalloc_obj(*callback_context, GFP_KERNEL); if (!callback_context) { err = -ENOMEM; resched_delay = HZ * 5; @@ -754,7 +754,7 @@ static void alias_guid_work(struct work_struct *work) alias_guid); struct mlx4_ib_dev *dev = container_of(ib_sriov, struct mlx4_ib_dev, sriov); - rec = kzalloc(sizeof *rec, GFP_KERNEL); + rec = kzalloc_obj(*rec, GFP_KERNEL); if (!rec) return; @@ -835,8 +835,8 @@ int mlx4_ib_init_alias_guid_service(struct mlx4_ib_dev *dev) if (!mlx4_is_master(dev->dev)) return 0; - dev->sriov.alias_guid.sa_client = - kzalloc(sizeof *dev->sriov.alias_guid.sa_client, GFP_KERNEL); + dev->sriov.alias_guid.sa_client = kzalloc_obj(*dev->sriov.alias_guid.sa_client, + GFP_KERNEL); if (!dev->sriov.alias_guid.sa_client) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c index 03aacd526860..a71603353dbd 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -235,7 +235,7 @@ id_map_alloc(struct ib_device *ibdev, int slave_id, u32 sl_cm_id) struct id_map_entry *ent; struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; - ent = kmalloc(sizeof (struct id_map_entry), GFP_KERNEL); + ent = kmalloc_obj(struct id_map_entry, GFP_KERNEL); if (!ent) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ static int alloc_rej_tmout(struct mlx4_ib_sriov *sriov, u32 rem_pv_cm_id, int sl } xa_unlock(&sriov->xa_rej_tmout); - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index c592374f4a58..dc05b3d88fe4 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c @@ -300,7 +300,7 @@ static int mlx4_alloc_resize_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq, if (cq->resize_buf) return -EBUSY; - cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_KERNEL); + cq->resize_buf = kmalloc_obj(*cq->resize_buf, GFP_KERNEL); if (!cq->resize_buf) return -ENOMEM; @@ -328,7 +328,7 @@ static int mlx4_alloc_resize_umem(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) return -EFAULT; - cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_KERNEL); + cq->resize_buf = kmalloc_obj(*cq->resize_buf, GFP_KERNEL); if (!cq->resize_buf) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/doorbell.c b/drivers/infiniband/hw/mlx4/doorbell.c index 9bbd695a9fd5..62f9c65ca140 100644 --- a/drivers/infiniband/hw/mlx4/doorbell.c +++ b/drivers/infiniband/hw/mlx4/doorbell.c @@ -56,7 +56,7 @@ int mlx4_ib_db_map_user(struct ib_udata *udata, unsigned long virt, if (page->user_virt == (virt & PAGE_MASK)) goto found; - page = kmalloc(sizeof *page, GFP_KERNEL); + page = kmalloc_obj(*page, GFP_KERNEL); if (!page) { err = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 91c714f72099..ac58fc6e3730 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -1133,8 +1133,8 @@ static void handle_slaves_guid_change(struct mlx4_ib_dev *dev, u32 port_num, if (!mlx4_is_mfunc(dev->dev) || !mlx4_is_master(dev->dev)) return; - in_mad = kmalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kmalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -1612,15 +1612,12 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, tun_qp = &ctx->qp[qp_type]; - tun_qp->ring = kcalloc(nmbr_bufs, - sizeof(struct mlx4_ib_buf), - GFP_KERNEL); + tun_qp->ring = kzalloc_objs(struct mlx4_ib_buf, nmbr_bufs, GFP_KERNEL); if (!tun_qp->ring) return -ENOMEM; - tun_qp->tx_ring = kcalloc(nmbr_bufs, - sizeof (struct mlx4_ib_tun_tx_buf), - GFP_KERNEL); + tun_qp->tx_ring = kzalloc_objs(struct mlx4_ib_tun_tx_buf, nmbr_bufs, + GFP_KERNEL); if (!tun_qp->tx_ring) { kfree(tun_qp->ring); tun_qp->ring = NULL; @@ -1958,7 +1955,7 @@ static int alloc_pv_object(struct mlx4_ib_dev *dev, int slave, int port, struct mlx4_ib_demux_pv_ctx *ctx; *ret_ctx = NULL; - ctx = kzalloc(sizeof (struct mlx4_ib_demux_pv_ctx), GFP_KERNEL); + ctx = kzalloc_obj(struct mlx4_ib_demux_pv_ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -2161,8 +2158,8 @@ static int mlx4_ib_alloc_demux_ctx(struct mlx4_ib_dev *dev, int ret = 0; int i; - ctx->tun = kcalloc(dev->dev->caps.sqp_demux, - sizeof (struct mlx4_ib_demux_pv_ctx *), GFP_KERNEL); + ctx->tun = kzalloc_objs(struct mlx4_ib_demux_pv_ctx *, + dev->dev->caps.sqp_demux, GFP_KERNEL); if (!ctx->tun) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index dd35e03402ab..1dab78eb7a03 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -295,7 +295,8 @@ static int mlx4_ib_add_gid(const struct ib_gid_attr *attr, void **context) if (free < 0) { ret = -ENOSPC; } else { - port_gid_table->gids[free].ctx = kmalloc(sizeof(*port_gid_table->gids[free].ctx), GFP_ATOMIC); + port_gid_table->gids[free].ctx = kmalloc_obj(*port_gid_table->gids[free].ctx, + GFP_ATOMIC); if (!port_gid_table->gids[free].ctx) { ret = -ENOMEM; } else { @@ -314,8 +315,7 @@ static int mlx4_ib_add_gid(const struct ib_gid_attr *attr, void **context) ctx->refcount++; } if (!ret && hw_update) { - gids = kmalloc_array(MLX4_MAX_PORT_GIDS, sizeof(*gids), - GFP_ATOMIC); + gids = kmalloc_objs(*gids, MLX4_MAX_PORT_GIDS, GFP_ATOMIC); if (!gids) { ret = -ENOMEM; *context = NULL; @@ -373,8 +373,7 @@ static int mlx4_ib_del_gid(const struct ib_gid_attr *attr, void **context) if (!ret && hw_update) { int i; - gids = kmalloc_array(MLX4_MAX_PORT_GIDS, sizeof(*gids), - GFP_ATOMIC); + gids = kmalloc_objs(*gids, MLX4_MAX_PORT_GIDS, GFP_ATOMIC); if (!gids) { ret = -ENOMEM; } else { @@ -462,8 +461,8 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, resp.response_length = offsetof(typeof(resp), response_length) + sizeof(resp.response_length); - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); err = -ENOMEM; if (!in_mad || !out_mad) goto out; @@ -661,8 +660,8 @@ static int ib_link_query_port(struct ib_device *ibdev, u32 port, int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -840,8 +839,8 @@ int __mlx4_ib_query_gid(struct ib_device *ibdev, u32 port, int index, int clear = 0; int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -909,8 +908,8 @@ static int mlx4_ib_query_sl2vl(struct ib_device *ibdev, u32 port, return 0; } - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -963,8 +962,8 @@ int __mlx4_ib_query_pkey(struct ib_device *ibdev, u32 port, u16 index, int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -1268,7 +1267,7 @@ static int add_gid_entry(struct ib_qp *ibqp, union ib_gid *gid) struct mlx4_ib_dev *mdev = to_mdev(ibqp->device); struct mlx4_ib_gid_entry *ge; - ge = kzalloc(sizeof *ge, GFP_KERNEL); + ge = kzalloc_obj(*ge, GFP_KERNEL); if (!ge) return -ENOMEM; @@ -1708,7 +1707,7 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp, memset(type, 0, sizeof(type)); - mflow = kzalloc(sizeof(*mflow), GFP_KERNEL); + mflow = kzalloc_obj(*mflow, GFP_KERNEL); if (!mflow) { err = -ENOMEM; goto err_free; @@ -1845,7 +1844,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) if (mdev->dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { - ib_steering = kmalloc(sizeof(*ib_steering), GFP_KERNEL); + ib_steering = kmalloc_obj(*ib_steering, GFP_KERNEL); if (!ib_steering) return -ENOMEM; } @@ -1979,8 +1978,8 @@ static int init_node_data(struct mlx4_ib_dev *dev) int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -2158,8 +2157,7 @@ static int __mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev, if (!port) num_counters += ARRAY_SIZE(diag_device_only); - *pdescs = kcalloc(num_counters, sizeof(struct rdma_stat_desc), - GFP_KERNEL); + *pdescs = kzalloc_objs(struct rdma_stat_desc, num_counters, GFP_KERNEL); if (!*pdescs) return -ENOMEM; @@ -2427,8 +2425,8 @@ static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev) { int i, j, eq = 0, total_eqs = 0; - ibdev->eq_table = kcalloc(dev->caps.num_comp_vectors, - sizeof(ibdev->eq_table[0]), GFP_KERNEL); + ibdev->eq_table = kzalloc_objs(ibdev->eq_table[0], + dev->caps.num_comp_vectors, GFP_KERNEL); if (!ibdev->eq_table) return; @@ -2732,8 +2730,7 @@ static int mlx4_ib_probe(struct auxiliary_device *adev, counter_index = mlx4_get_default_counter_index(dev, i + 1); } - new_counter_index = kmalloc(sizeof(*new_counter_index), - GFP_KERNEL); + new_counter_index = kmalloc_obj(*new_counter_index, GFP_KERNEL); if (!new_counter_index) { err = -ENOMEM; if (allocated) @@ -2751,8 +2748,8 @@ static int mlx4_ib_probe(struct auxiliary_device *adev, if (mlx4_is_bonded(dev)) for (i = 1; i < ibdev->num_ports ; ++i) { new_counter_index = - kmalloc(sizeof(struct counter_index), - GFP_KERNEL); + kmalloc_obj(struct counter_index, + GFP_KERNEL); if (!new_counter_index) { err = -ENOMEM; goto err_counter; @@ -3035,12 +3032,12 @@ static void do_slave_init(struct mlx4_ib_dev *ibdev, int slave, int do_init) ports = bitmap_weight(actv_ports.ports, dev->caps.num_ports); first_port = find_first_bit(actv_ports.ports, dev->caps.num_ports); - dm = kcalloc(ports, sizeof(*dm), GFP_ATOMIC); + dm = kzalloc_objs(*dm, ports, GFP_ATOMIC); if (!dm) return; for (i = 0; i < ports; i++) { - dm[i] = kmalloc(sizeof (struct mlx4_ib_demux_work), GFP_ATOMIC); + dm[i] = kmalloc_obj(struct mlx4_ib_demux_work, GFP_ATOMIC); if (!dm[i]) { while (--i >= 0) kfree(dm[i]); @@ -3195,7 +3192,7 @@ void mlx4_sched_ib_sl2vl_update_work(struct mlx4_ib_dev *ibdev, { struct ib_event_work *ew; - ew = kmalloc(sizeof(*ew), GFP_ATOMIC); + ew = kmalloc_obj(*ew, GFP_ATOMIC); if (ew) { INIT_WORK(&ew->work, ib_sl2vl_update_work); ew->port = port; @@ -3218,7 +3215,7 @@ static int mlx4_ib_event(struct notifier_block *this, unsigned long event, if (mlx4_is_bonded(dev) && ((event == MLX4_DEV_EVENT_PORT_UP) || (event == MLX4_DEV_EVENT_PORT_DOWN))) { - ew = kmalloc(sizeof(*ew), GFP_ATOMIC); + ew = kmalloc_obj(*ew, GFP_ATOMIC); if (!ew) return NOTIFY_DONE; INIT_WORK(&ew->work, handle_bonded_port_state_event); @@ -3267,7 +3264,7 @@ static int mlx4_ib_event(struct notifier_block *this, unsigned long event, break; case MLX4_DEV_EVENT_PORT_MGMT_CHANGE: - ew = kmalloc(sizeof *ew, GFP_ATOMIC); + ew = kmalloc_obj(*ew, GFP_ATOMIC); if (!ew) return NOTIFY_DONE; diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c index e279e69b9a51..ef4ab3bc6ffd 100644 --- a/drivers/infiniband/hw/mlx4/mcg.c +++ b/drivers/infiniband/hw/mlx4/mcg.c @@ -824,7 +824,7 @@ static struct mcast_group *acquire_group(struct mlx4_ib_demux_ctx *ctx, if (!create) return ERR_PTR(-ENOENT); - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return ERR_PTR(-ENOMEM); @@ -946,7 +946,7 @@ int mlx4_ib_mcg_multiplex_handler(struct ib_device *ibdev, int port, may_create = 1; fallthrough; case IB_SA_METHOD_DELETE: - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -1150,7 +1150,7 @@ void mlx4_ib_mcg_port_cleanup(struct mlx4_ib_demux_ctx *ctx, int destroy_wq) return; } - work = kmalloc(sizeof *work, GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) { ctx->flushing = 0; return; @@ -1211,7 +1211,7 @@ static int push_deleteing_req(struct mcast_group *group, int slave) if (!group->func[slave].join_state) return 0; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 94464f1694d9..27038065ee67 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c @@ -60,7 +60,7 @@ struct ib_mr *mlx4_ib_get_dma_mr(struct ib_pd *pd, int acc) struct mlx4_ib_mr *mr; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -151,7 +151,7 @@ struct ib_mr *mlx4_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -394,7 +394,7 @@ struct ib_mr *mlx4_ib_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, max_num_sg > MLX4_MAX_FAST_REG_PAGES) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f2887ae6390e..c7dd9d6e4f8f 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -267,7 +267,7 @@ static void mlx4_ib_qp_event(struct mlx4_qp *qp, enum mlx4_event type) if (!ibqp->event_handler) goto out_no_handler; - qpe_work = kzalloc(sizeof(*qpe_work), GFP_ATOMIC); + qpe_work = kzalloc_obj(*qpe_work, GFP_ATOMIC); if (!qpe_work) goto out_no_handler; @@ -472,14 +472,12 @@ static int alloc_proxy_bufs(struct ib_device *dev, struct mlx4_ib_qp *qp) int i; qp->sqp_proxy_rcv = - kmalloc_array(qp->rq.wqe_cnt, sizeof(struct mlx4_ib_buf), - GFP_KERNEL); + kmalloc_objs(struct mlx4_ib_buf, qp->rq.wqe_cnt, GFP_KERNEL); if (!qp->sqp_proxy_rcv) return -ENOMEM; for (i = 0; i < qp->rq.wqe_cnt; i++) { qp->sqp_proxy_rcv[i].addr = - kmalloc(sizeof (struct mlx4_ib_proxy_sqp_hdr), - GFP_KERNEL); + kmalloc_obj(struct mlx4_ib_proxy_sqp_hdr, GFP_KERNEL); if (!qp->sqp_proxy_rcv[i].addr) goto err; qp->sqp_proxy_rcv[i].map = @@ -683,7 +681,7 @@ static int create_qp_rss(struct mlx4_ib_dev *dev, qp->mtt = (to_mqp( (struct ib_qp *)init_attr->rwq_ind_tbl->ind_tbl[0]))->mtt; - qp->rss_ctx = kzalloc(sizeof(*qp->rss_ctx), GFP_KERNEL); + qp->rss_ctx = kzalloc_obj(*qp->rss_ctx, GFP_KERNEL); if (!qp->rss_ctx) { err = -ENOMEM; goto err_qp_alloc; @@ -793,7 +791,7 @@ static int mlx4_ib_alloc_wqn(struct mlx4_ib_ucontext *context, struct mlx4_wqn_range, list); if (!range || (range->refcount == range->size) || range->dirty) { - range = kzalloc(sizeof(*range), GFP_KERNEL); + range = kzalloc_obj(*range, GFP_KERNEL); if (!range) { err = -ENOMEM; goto out; @@ -1051,7 +1049,7 @@ static int create_qp_common(struct ib_pd *pd, struct ib_qp_init_attr *init_attr, qp_type == MLX4_IB_QPT_GSI || (qp_type & (MLX4_IB_QPT_PROXY_SMI | MLX4_IB_QPT_PROXY_SMI_OWNER | MLX4_IB_QPT_PROXY_GSI | MLX4_IB_QPT_TUN_SMI_OWNER))) { - qp->sqp = kzalloc(sizeof(struct mlx4_ib_sqp), GFP_KERNEL); + qp->sqp = kzalloc_obj(struct mlx4_ib_sqp, GFP_KERNEL); if (!qp->sqp) return -ENOMEM; } @@ -1972,7 +1970,7 @@ static int create_qp_lb_counter(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp) if (err) return err; - new_counter_index = kmalloc(sizeof(*new_counter_index), GFP_KERNEL); + new_counter_index = kmalloc_obj(*new_counter_index, GFP_KERNEL); if (!new_counter_index) { mlx4_counter_free(dev->dev, tmp_idx); return -ENOMEM; @@ -2165,7 +2163,7 @@ static int __mlx4_ib_modify_qp(void *src, enum mlx4_ib_source_type src_type, IB_LINK_LAYER_ETHERNET) return -ENOTSUPP; - context = kzalloc(sizeof *context, GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; @@ -4167,7 +4165,7 @@ struct ib_wq *mlx4_ib_create_wq(struct ib_pd *pd, return ERR_PTR(-EOPNOTSUPP); } - qp = kzalloc(sizeof(*qp), GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c index 88f534cf690e..ba0356aa3038 100644 --- a/drivers/infiniband/hw/mlx4/sysfs.c +++ b/drivers/infiniband/hw/mlx4/sysfs.c @@ -244,8 +244,8 @@ static int add_port_entries(struct mlx4_ib_dev *device, int port_num) * gids (operational) * mcg_table */ - port->dentr_ar = kzalloc(sizeof (struct mlx4_ib_iov_sysfs_attr_ar), - GFP_KERNEL); + port->dentr_ar = kzalloc_obj(struct mlx4_ib_iov_sysfs_attr_ar, + GFP_KERNEL); if (!port->dentr_ar) { ret = -ENOMEM; goto err; @@ -500,13 +500,12 @@ alloc_group_attrs(ssize_t (*show)(struct mlx4_port *, struct port_table_attribute *element; int i; - tab_attr = kcalloc(1 + len, sizeof (struct attribute *), GFP_KERNEL); + tab_attr = kzalloc_objs(struct attribute *, 1 + len, GFP_KERNEL); if (!tab_attr) return NULL; for (i = 0; i < len; i++) { - element = kzalloc(sizeof (struct port_table_attribute), - GFP_KERNEL); + element = kzalloc_obj(struct port_table_attribute, GFP_KERNEL); if (!element) goto err; if (snprintf(element->name, sizeof (element->name), @@ -630,7 +629,7 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave) int is_eth = rdma_port_get_link_layer(&dev->ib_dev, port_num) == IB_LINK_LAYER_ETHERNET; - p = kzalloc(sizeof *p, GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/cong.c b/drivers/infiniband/hw/mlx5/cong.c index a78a067e3ce7..fb2bc450f4ff 100644 --- a/drivers/infiniband/hw/mlx5/cong.c +++ b/drivers/infiniband/hw/mlx5/cong.c @@ -449,7 +449,7 @@ void mlx5_ib_init_cong_debugfs(struct mlx5_ib_dev *dev, u32 port_num) !MLX5_CAP_GEN(mdev, cc_modify_allowed)) goto put_mdev; - dbg_cc_params = kzalloc(sizeof(*dbg_cc_params), GFP_KERNEL); + dbg_cc_params = kzalloc_obj(*dbg_cc_params, GFP_KERNEL); if (!dbg_cc_params) goto err; diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c index e042e0719ead..10feeb77d569 100644 --- a/drivers/infiniband/hw/mlx5/counters.c +++ b/drivers/infiniband/hw/mlx5/counters.c @@ -858,13 +858,12 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev, skip_non_qcounters: cnts->num_op_counters = num_op_counters; num_counters += num_op_counters; - cnts->descs = kcalloc(num_counters, - sizeof(struct rdma_stat_desc), GFP_KERNEL); + cnts->descs = kzalloc_objs(struct rdma_stat_desc, num_counters, + GFP_KERNEL); if (!cnts->descs) return -ENOMEM; - cnts->offsets = kcalloc(num_counters, - sizeof(*cnts->offsets), GFP_KERNEL); + cnts->offsets = kzalloc_objs(*cnts->offsets, num_counters, GFP_KERNEL); if (!cnts->offsets) goto err; @@ -1074,9 +1073,8 @@ int mlx5_ib_flow_counters_set_data(struct ib_counters *ibcounters, if (cntrs_data->ncounters > MAX_COUNTERS_NUM) return -EINVAL; - desc_data = kcalloc(cntrs_data->ncounters, - sizeof(*desc_data), - GFP_KERNEL); + desc_data = kzalloc_objs(*desc_data, cntrs_data->ncounters, + GFP_KERNEL); if (!desc_data) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 651d76bca114..c0e06c05555b 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -1210,7 +1210,7 @@ static int resize_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq, { int err; - cq->resize_buf = kzalloc(sizeof(*cq->resize_buf), GFP_KERNEL); + cq->resize_buf = kzalloc_obj(*cq->resize_buf, GFP_KERNEL); if (!cq->resize_buf) return -ENOMEM; @@ -1449,7 +1449,7 @@ int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc) struct mlx5_ib_cq *cq = to_mcq(ibcq); unsigned long flags; - soft_wc = kmalloc(sizeof(*soft_wc), GFP_ATOMIC); + soft_wc = kmalloc_obj(*soft_wc, GFP_ATOMIC); if (!soft_wc) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/data_direct.c b/drivers/infiniband/hw/mlx5/data_direct.c index b81ac5709b56..a93e31e23dc2 100644 --- a/drivers/infiniband/hw/mlx5/data_direct.c +++ b/drivers/infiniband/hw/mlx5/data_direct.c @@ -83,7 +83,7 @@ int mlx5_data_direct_ib_reg(struct mlx5_ib_dev *ibdev, char *vuid) struct mlx5_data_direct_registration *reg; struct mlx5_data_direct_dev *dev; - reg = kzalloc(sizeof(*reg), GFP_KERNEL); + reg = kzalloc_obj(*reg, GFP_KERNEL); if (!reg) return -ENOMEM; @@ -160,7 +160,7 @@ static int mlx5_data_direct_probe(struct pci_dev *pdev, const struct pci_device_ struct mlx5_data_direct_dev *dev; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index d31d7f3005c6..5e1cefeaa494 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -1950,7 +1950,7 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table, event = xa_load(&devx_event_table->event_xa, key_level1); if (!event) { - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) return -ENOMEM; @@ -1972,7 +1972,7 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table, obj_event = xa_load(&event->object_ids, key_level2); if (!obj_event) { - obj_event = kzalloc(sizeof(*obj_event), GFP_KERNEL); + obj_event = kzalloc_obj(*obj_event, GFP_KERNEL); if (!obj_event) /* Level1 is valid for future use, no need to free */ return -ENOMEM; @@ -2697,7 +2697,7 @@ void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile) int head = 0; int tail = 0; - async_cmd = kcalloc(MAX_ASYNC_CMDS, sizeof(*async_cmd), GFP_KERNEL); + async_cmd = kzalloc_objs(*async_cmd, MAX_ASYNC_CMDS, GFP_KERNEL); if (!async_cmd) return; diff --git a/drivers/infiniband/hw/mlx5/dm.c b/drivers/infiniband/hw/mlx5/dm.c index 9ded2b7c1e31..db45ff9b64a8 100644 --- a/drivers/infiniband/hw/mlx5/dm.c +++ b/drivers/infiniband/hw/mlx5/dm.c @@ -285,7 +285,7 @@ static struct ib_dm *handle_alloc_dm_memic(struct ib_ucontext *ctx, if (!dm_db || !MLX5_CAP_DEV_MEM(dm_db->dev, memic)) return ERR_PTR(-EOPNOTSUPP); - dm = kzalloc(sizeof(*dm), GFP_KERNEL); + dm = kzalloc_obj(*dm, GFP_KERNEL); if (!dm) return ERR_PTR(-ENOMEM); @@ -382,7 +382,7 @@ static struct ib_dm *handle_alloc_dm_sw_icm(struct ib_ucontext *ctx, return ERR_PTR(-EOPNOTSUPP); } - dm = kzalloc(sizeof(*dm), GFP_KERNEL); + dm = kzalloc_obj(*dm, GFP_KERNEL); if (!dm) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx5/doorbell.c b/drivers/infiniband/hw/mlx5/doorbell.c index e32111117a5e..277e16a2c714 100644 --- a/drivers/infiniband/hw/mlx5/doorbell.c +++ b/drivers/infiniband/hw/mlx5/doorbell.c @@ -58,7 +58,7 @@ int mlx5_ib_db_map_user(struct mlx5_ib_ucontext *context, unsigned long virt, (page->user_virt == (virt & PAGE_MASK))) goto found; - page = kmalloc(sizeof(*page), GFP_KERNEL); + page = kmalloc_obj(*page, GFP_KERNEL); if (!page) { err = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c index d17823ce7f38..3c23bf34b3ab 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -1021,7 +1021,7 @@ static struct mlx5_per_qp_opfc *get_per_qp_opfc(struct xarray *qpn_opfc_xa, per_qp_opfc = xa_load(qpn_opfc_xa, qp_num); if (per_qp_opfc) return per_qp_opfc; - per_qp_opfc = kzalloc(sizeof(*per_qp_opfc), GFP_KERNEL); + per_qp_opfc = kzalloc_obj(*per_qp_opfc, GFP_KERNEL); if (!per_qp_opfc) return NULL; @@ -1057,7 +1057,7 @@ static int add_op_fc_rules(struct mlx5_ib_dev *dev, opfc->fc = fc_arr[type]; - spec = kcalloc(MAX_OPFC_RULES, sizeof(*spec), GFP_KERNEL); + spec = kzalloc_objs(*spec, MAX_OPFC_RULES, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto null_fc; @@ -1231,7 +1231,7 @@ int mlx5_ib_fs_add_op_fc(struct mlx5_ib_dev *dev, u32 port_num, struct mlx5_ib_flow_prio *prio; struct mlx5_flow_spec *spec; - spec = kcalloc(MAX_OPFC_RULES, sizeof(*spec), GFP_KERNEL); + spec = kzalloc_objs(*spec, MAX_OPFC_RULES, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1532,8 +1532,8 @@ static struct mlx5_ib_flow_handler *_create_flow_rule(struct mlx5_ib_dev *dev, if (dev->is_rep && is_egress) return ERR_PTR(-EINVAL); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); - handler = kzalloc(sizeof(*handler), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); + handler = kzalloc_obj(*handler, GFP_KERNEL); if (!handler || !spec) { err = -ENOMEM; goto free; @@ -1792,7 +1792,7 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, goto free_ucmd; } - dst = kzalloc(sizeof(*dst), GFP_KERNEL); + dst = kzalloc_obj(*dst, GFP_KERNEL); if (!dst) { err = -ENOMEM; goto free_ucmd; @@ -2060,8 +2060,8 @@ _create_raw_flow_rule(struct mlx5_ib_dev *dev, struct mlx5_flow_table *ft = ft_prio->flow_table; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); - handler = kzalloc(sizeof(*handler), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); + handler = kzalloc_obj(*handler, GFP_KERNEL); if (!handler || !spec) { err = -ENOMEM; goto free; @@ -2153,7 +2153,7 @@ static struct mlx5_ib_flow_handler *raw_fs_rule_add( if (fs_matcher->priority > MLX5_IB_FLOW_LAST_PRIO) return ERR_PTR(-ENOMEM); - dst = kcalloc(2, sizeof(*dst), GFP_KERNEL); + dst = kzalloc_objs(*dst, 2, GFP_KERNEL); if (!dst) return ERR_PTR(-ENOMEM); @@ -3080,7 +3080,7 @@ mlx5_ib_create_modify_header(struct mlx5_ib_dev *dev, if (ret) return ERR_PTR(-EINVAL); - maction = kzalloc(sizeof(*maction), GFP_KERNEL); + maction = kzalloc_obj(*maction, GFP_KERNEL); if (!maction) return ERR_PTR(-ENOMEM); @@ -3479,23 +3479,23 @@ int mlx5_ib_fs_init(struct mlx5_ib_dev *dev) { int i, j; - dev->flow_db = kzalloc(sizeof(*dev->flow_db), GFP_KERNEL); + dev->flow_db = kzalloc_obj(*dev->flow_db, GFP_KERNEL); if (!dev->flow_db) return -ENOMEM; for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) { dev->flow_db->rdma_transport_rx[i] = - kcalloc(dev->num_ports, - sizeof(struct mlx5_ib_flow_prio), GFP_KERNEL); + kzalloc_objs(struct mlx5_ib_flow_prio, dev->num_ports, + GFP_KERNEL); if (!dev->flow_db->rdma_transport_rx[i]) goto free_rdma_transport_rx; } for (j = 0; j < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; j++) { dev->flow_db->rdma_transport_tx[j] = - kcalloc(dev->num_ports, - sizeof(struct mlx5_ib_flow_prio), GFP_KERNEL); + kzalloc_objs(struct mlx5_ib_flow_prio, dev->num_ports, + GFP_KERNEL); if (!dev->flow_db->rdma_transport_tx[j]) goto free_rdma_transport_tx; } diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c index d5487834ed25..f572d75f6fd6 100644 --- a/drivers/infiniband/hw/mlx5/gsi.c +++ b/drivers/infiniband/hw/mlx5/gsi.c @@ -104,13 +104,13 @@ int mlx5_ib_create_gsi(struct ib_pd *pd, struct mlx5_ib_qp *mqp, } gsi = &mqp->gsi; - gsi->tx_qps = kcalloc(num_qps, sizeof(*gsi->tx_qps), GFP_KERNEL); + gsi->tx_qps = kzalloc_objs(*gsi->tx_qps, num_qps, GFP_KERNEL); if (!gsi->tx_qps) return -ENOMEM; gsi->outstanding_wrs = - kcalloc(attr->cap.max_send_wr, sizeof(*gsi->outstanding_wrs), - GFP_KERNEL); + kzalloc_objs(*gsi->outstanding_wrs, attr->cap.max_send_wr, + GFP_KERNEL); if (!gsi->outstanding_wrs) { ret = -ENOMEM; goto err_free_tx; diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c index bbecca405171..72c870f4f54b 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.c +++ b/drivers/infiniband/hw/mlx5/ib_rep.c @@ -158,8 +158,7 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) goto release_transport; } - ibdev->port = kcalloc(num_ports, sizeof(*ibdev->port), - GFP_KERNEL); + ibdev->port = kzalloc_objs(*ibdev->port, num_ports, GFP_KERNEL); if (!ibdev->port) { ret = -ENOMEM; goto fail_port; diff --git a/drivers/infiniband/hw/mlx5/ib_virt.c b/drivers/infiniband/hw/mlx5/ib_virt.c index afeb5e53254f..beb99db3f76f 100644 --- a/drivers/infiniband/hw/mlx5/ib_virt.c +++ b/drivers/infiniband/hw/mlx5/ib_virt.c @@ -55,7 +55,7 @@ int mlx5_ib_get_vf_config(struct ib_device *device, int vf, u32 port, struct mlx5_hca_vport_context *rep; int err; - rep = kzalloc(sizeof(*rep), GFP_KERNEL); + rep = kzalloc_obj(*rep, GFP_KERNEL); if (!rep) return -ENOMEM; @@ -98,7 +98,7 @@ int mlx5_ib_set_vf_link_state(struct ib_device *device, int vf, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc(sizeof(*in), GFP_KERNEL); + in = kzalloc_obj(*in, GFP_KERNEL); if (!in) return -ENOMEM; @@ -157,7 +157,7 @@ static int set_vf_node_guid(struct ib_device *device, int vf, u32 port, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc(sizeof(*in), GFP_KERNEL); + in = kzalloc_obj(*in, GFP_KERNEL); if (!in) return -ENOMEM; @@ -181,7 +181,7 @@ static int set_vf_port_guid(struct ib_device *device, int vf, u32 port, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc(sizeof(*in), GFP_KERNEL); + in = kzalloc_obj(*in, GFP_KERNEL); if (!in) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/macsec.c b/drivers/infiniband/hw/mlx5/macsec.c index 3c56eb5eddf3..f93ce56d7515 100644 --- a/drivers/infiniband/hw/mlx5/macsec.c +++ b/drivers/infiniband/hw/mlx5/macsec.c @@ -52,7 +52,7 @@ static struct mlx5_macsec_device *get_macsec_device(void *macdev, if (macsec_device) return macsec_device; - macsec_device = kzalloc(sizeof(*macsec_device), GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); if (!macsec_device) return NULL; @@ -82,7 +82,7 @@ static void mlx5_macsec_save_roce_gid(struct mlx5_macsec_device *macsec_device, { struct mlx5_roce_gids *roce_gids; - roce_gids = kzalloc(sizeof(*roce_gids), GFP_KERNEL); + roce_gids = kzalloc_obj(*roce_gids, GFP_KERNEL); if (!roce_gids) return; @@ -180,9 +180,8 @@ int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev) max_gids = MLX5_CAP_ROCE(dev->mdev, roce_address_table_size); for (i = 0; i < dev->num_ports; i++) { - dev->port[i].reserved_gids = kcalloc(max_gids, - sizeof(*dev->port[i].reserved_gids), - GFP_KERNEL); + dev->port[i].reserved_gids = kzalloc_objs(*dev->port[i].reserved_gids, + max_gids, GFP_KERNEL); if (!dev->port[i].reserved_gids) goto err; diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c index 2453ae4384a7..41dd186deffd 100644 --- a/drivers/infiniband/hw/mlx5/mad.c +++ b/drivers/infiniband/hw/mlx5/mad.c @@ -367,8 +367,8 @@ int mlx5_query_ext_port_caps(struct mlx5_ib_dev *dev, unsigned int port) int err = -ENOMEM; u16 packet_error; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -395,7 +395,7 @@ static int mlx5_query_mad_ifc_smp_attr_node_info(struct ib_device *ibdev, struct ib_smp *in_mad; int err; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); if (!in_mad) return -ENOMEM; @@ -415,7 +415,7 @@ int mlx5_query_mad_ifc_system_image_guid(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!out_mad) return -ENOMEM; @@ -437,7 +437,7 @@ int mlx5_query_mad_ifc_max_pkeys(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!out_mad) return -ENOMEM; @@ -459,7 +459,7 @@ int mlx5_query_mad_ifc_vendor_id(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!out_mad) return -ENOMEM; @@ -481,8 +481,8 @@ int mlx5_query_mad_ifc_node_desc(struct mlx5_ib_dev *dev, char *node_desc) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -506,8 +506,8 @@ int mlx5_query_mad_ifc_node_guid(struct mlx5_ib_dev *dev, __be64 *node_guid) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -532,8 +532,8 @@ int mlx5_query_mad_ifc_pkey(struct ib_device *ibdev, u32 port, u16 index, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -561,8 +561,8 @@ int mlx5_query_mad_ifc_gids(struct ib_device *ibdev, u32 port, int index, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -604,8 +604,8 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u32 port, int ext_active_speed; int err = -ENOMEM; - in_mad = kzalloc(sizeof(*in_mad), GFP_KERNEL); - out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 5e06177ace26..a5425f6d5527 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1460,7 +1460,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u32 port, int err; u16 ib_link_width_oper; - rep = kzalloc(sizeof(*rep), GFP_KERNEL); + rep = kzalloc_obj(*rep, GFP_KERNEL); if (!rep) { err = -ENOMEM; goto out; @@ -3121,7 +3121,7 @@ static int mlx5_ib_event(struct notifier_block *nb, { struct mlx5_ib_event_work *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; @@ -3141,7 +3141,7 @@ static int mlx5_ib_event_slave_port(struct notifier_block *nb, { struct mlx5_ib_event_work *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; @@ -3188,7 +3188,7 @@ static int mlx5_ib_sys_error_event(struct notifier_block *nb, if (event != MLX5_DEV_EVENT_SYS_ERROR) return NOTIFY_DONE; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; @@ -4042,7 +4042,7 @@ static int mlx5_ib_init_multiport_master(struct mlx5_ib_dev *dev) /* build a stub multiport info struct for the native port. */ if (i == port_num) { - mpi = kzalloc(sizeof(*mpi), GFP_KERNEL); + mpi = kzalloc_obj(*mpi, GFP_KERNEL); if (!mpi) { mutex_unlock(&mlx5_ib_multiport_mutex); mlx5_nic_vport_disable_roce(dev->mdev); @@ -4148,7 +4148,7 @@ alloc_var_entry(struct mlx5_ib_ucontext *c) int err; var_table = &to_mdev(c->ibucontext.device)->var_table; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -4269,7 +4269,7 @@ alloc_uar_entry(struct mlx5_ib_ucontext *c, u32 uar_index; int err; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -5204,8 +5204,9 @@ static struct ib_device *mlx5_ib_add_sub_dev(struct ib_device *parent, if (!mplane) return ERR_PTR(-ENOMEM); - mplane->port = kcalloc(mparent->num_plane * mparent->num_ports, - sizeof(*mplane->port), GFP_KERNEL); + mplane->port = kzalloc_objs(*mplane->port, + mparent->num_plane * mparent->num_ports, + GFP_KERNEL); if (!mplane->port) { ret = -ENOMEM; goto fail_kcalloc; @@ -5249,7 +5250,7 @@ static int mlx5r_mp_probe(struct auxiliary_device *adev, bool bound = false; int err; - mpi = kzalloc(sizeof(*mpi), GFP_KERNEL); + mpi = kzalloc_obj(*mpi, GFP_KERNEL); if (!mpi) return -ENOMEM; @@ -5325,8 +5326,7 @@ static int mlx5r_probe(struct auxiliary_device *adev, goto fail; } - dev->port = kcalloc(num_ports, sizeof(*dev->port), - GFP_KERNEL); + dev->port = kzalloc_objs(*dev->port, num_ports, GFP_KERNEL); if (!dev->port) { ret = -ENOMEM; goto fail; diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index a7b37e3df072..0444be024ff9 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -156,7 +156,7 @@ static int push_mkey_locked(struct mlx5_cache_ent *ent, u32 mkey) lockdep_assert_held(&ent->mkeys_queue.lock); if (ent->mkeys_queue.ci >= ent->mkeys_queue.num_pages * NUM_MKEYS_PER_PAGE) { - page = kzalloc(sizeof(*page), GFP_ATOMIC); + page = kzalloc_obj(*page, GFP_ATOMIC); if (!page) return -ENOMEM; ent->mkeys_queue.num_pages++; @@ -276,8 +276,8 @@ static int add_keys(struct mlx5_cache_ent *ent, unsigned int num) int i; for (i = 0; i < num; i++) { - async_create = kzalloc(sizeof(struct mlx5r_async_create_mkey), - GFP_KERNEL); + async_create = kzalloc_obj(struct mlx5r_async_create_mkey, + GFP_KERNEL); if (!async_create) return -ENOMEM; mkc = MLX5_ADDR_OF(create_mkey_in, async_create->in, @@ -742,7 +742,7 @@ static struct mlx5_ib_mr *_mlx5_mr_cache_alloc(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -867,7 +867,7 @@ static int mlx5r_mkeys_init(struct mlx5_cache_ent *ent) { struct mlx5_mkeys_page *page; - page = kzalloc(sizeof(*page), GFP_KERNEL); + page = kzalloc_obj(*page, GFP_KERNEL); if (!page) return -ENOMEM; INIT_LIST_HEAD(&ent->mkeys_queue.pages_list); @@ -897,7 +897,7 @@ mlx5r_cache_create_ent_locked(struct mlx5_ib_dev *dev, int order; int ret; - ent = kzalloc(sizeof(*ent), GFP_KERNEL); + ent = kzalloc_obj(*ent, GFP_KERNEL); if (!ent) return ERR_PTR(-ENOMEM); @@ -1059,7 +1059,7 @@ struct ib_mr *mlx5_ib_get_dma_mr(struct ib_pd *pd, int acc) u32 *in; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1207,7 +1207,7 @@ reg_create_crossing_vhca_mr(struct ib_pd *pd, u64 iova, u64 length, int access_f if (!MLX5_CAP_GEN(dev->mdev, crossing_vhca_mkey)) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1272,7 +1272,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, struct ib_umem *umem, if (!page_size) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1370,7 +1370,7 @@ static struct ib_mr *mlx5_ib_get_dm_mr(struct ib_pd *pd, u64 start_addr, u32 *in; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -2343,7 +2343,7 @@ static struct mlx5_ib_mr *mlx5_ib_alloc_pi_mr(struct ib_pd *pd, u32 *in; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -2400,7 +2400,7 @@ static int mlx5_alloc_integrity_descs(struct ib_pd *pd, struct mlx5_ib_mr *mr, void *mkc; int err; - mr->sig = kzalloc(sizeof(*mr->sig), GFP_KERNEL); + mr->sig = kzalloc_obj(*mr->sig, GFP_KERNEL); if (!mr->sig) return -ENOMEM; @@ -2480,7 +2480,7 @@ static struct ib_mr *__mlx5_ib_alloc_mr(struct ib_pd *pd, u32 *in; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index e71ee3d52eb0..ed73d3e82ea5 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -1092,7 +1092,7 @@ next_mr: continue; } - frame = kzalloc(sizeof(*frame), GFP_KERNEL); + frame = kzalloc_obj(*frame, GFP_KERNEL); if (!frame) { ret = -ENOMEM; goto end; @@ -2097,7 +2097,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, return mlx5_ib_prefetch_sg_list(pd, advice, pf_flags, sg_list, num_sge); - work = kvzalloc(struct_size(work, frags, num_sge), GFP_KERNEL); + work = kvzalloc_flex(*work, frags, num_sge, GFP_KERNEL); if (!work) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 0324909e3151..762a2dfc4455 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -416,7 +416,7 @@ static void mlx5_ib_qp_event(struct mlx5_core_qp *qp, int type) if (!ibqp->event_handler) goto out_no_handler; - qpe_work = kzalloc(sizeof(*qpe_work), GFP_ATOMIC); + qpe_work = kzalloc_obj(*qpe_work, GFP_ATOMIC); if (!qpe_work) goto out_no_handler; @@ -1185,8 +1185,8 @@ static int _create_kernel_qp(struct mlx5_ib_dev *dev, sizeof(*qp->sq.wr_data), GFP_KERNEL); qp->rq.wrid = kvmalloc_array(qp->rq.wqe_cnt, sizeof(*qp->rq.wrid), GFP_KERNEL); - qp->sq.w_list = kvmalloc_array(qp->sq.wqe_cnt, - sizeof(*qp->sq.w_list), GFP_KERNEL); + qp->sq.w_list = kvmalloc_objs(*qp->sq.w_list, qp->sq.wqe_cnt, + GFP_KERNEL); qp->sq.wqe_head = kvmalloc_array(qp->sq.wqe_cnt, sizeof(*qp->sq.wqe_head), GFP_KERNEL); @@ -5488,7 +5488,7 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd, dev = to_mdev(pd->device); switch (init_attr->wq_type) { case IB_WQT_RQ: - rwq = kzalloc(sizeof(*rwq), GFP_KERNEL); + rwq = kzalloc_obj(*rwq, GFP_KERNEL); if (!rwq) return ERR_PTR(-ENOMEM); err = prepare_user_rq(pd, init_attr, udata, rwq); diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c index bcb6b324af50..6e79e7a1015e 100644 --- a/drivers/infiniband/hw/mlx5/srq.c +++ b/drivers/infiniband/hw/mlx5/srq.c @@ -358,7 +358,7 @@ int mlx5_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) int ret; struct mlx5_srq_attr *out; - out = kzalloc(sizeof(*out), GFP_KERNEL); + out = kzalloc_obj(*out, GFP_KERNEL); if (!out) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c index 9f0f79d02d3c..2532ea4e1278 100644 --- a/drivers/infiniband/hw/mthca/mthca_allocator.c +++ b/drivers/infiniband/hw/mthca/mthca_allocator.c @@ -157,8 +157,7 @@ int mthca_array_init(struct mthca_array *array, int nent) int npage = (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; int i; - array->page_list = kmalloc_array(npage, sizeof(*array->page_list), - GFP_KERNEL); + array->page_list = kmalloc_objs(*array->page_list, npage, GFP_KERNEL); if (!array->page_list) return -ENOMEM; @@ -231,9 +230,8 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct, if (!dma_list) return -ENOMEM; - buf->page_list = kmalloc_array(npages, - sizeof(*buf->page_list), - GFP_KERNEL); + buf->page_list = kmalloc_objs(*buf->page_list, npages, + GFP_KERNEL); if (!buf->page_list) goto err_out; diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c index 3df1f5ff7932..83a7ba41fa04 100644 --- a/drivers/infiniband/hw/mthca/mthca_av.c +++ b/drivers/infiniband/hw/mthca/mthca_av.c @@ -161,7 +161,7 @@ int mthca_create_ah(struct mthca_dev *dev, ah->type = MTHCA_AH_PCI_POOL; if (mthca_is_memfree(dev)) { - ah->av = kmalloc(sizeof *ah->av, GFP_ATOMIC); + ah->av = kmalloc_obj(*ah->av, GFP_ATOMIC); if (!ah->av) return -ENOMEM; @@ -175,7 +175,7 @@ int mthca_create_ah(struct mthca_dev *dev, if (index == -1) goto on_hca_fail; - av = kmalloc(sizeof *av, GFP_ATOMIC); + av = kmalloc_obj(*av, GFP_ATOMIC); if (!av) goto on_hca_fail; diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index 8fe0cef7e2be..1c51814d5354 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c @@ -559,9 +559,8 @@ int mthca_cmd_use_events(struct mthca_dev *dev) { int i; - dev->cmd.context = kmalloc_array(dev->cmd.max_cmds, - sizeof(struct mthca_cmd_context), - GFP_KERNEL); + dev->cmd.context = kmalloc_objs(struct mthca_cmd_context, + dev->cmd.max_cmds, GFP_KERNEL); if (!dev->cmd.context) return -ENOMEM; @@ -611,7 +610,7 @@ struct mthca_mailbox *mthca_alloc_mailbox(struct mthca_dev *dev, { struct mthca_mailbox *mailbox; - mailbox = kmalloc(sizeof *mailbox, gfp_mask); + mailbox = kmalloc_obj(*mailbox, gfp_mask); if (!mailbox) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c index 97287c544da8..5f109a116390 100644 --- a/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/drivers/infiniband/hw/mthca/mthca_eq.c @@ -479,8 +479,7 @@ static int mthca_create_eq(struct mthca_dev *dev, eq->nent = roundup_pow_of_two(max(nent, 2)); npages = ALIGN(eq->nent * MTHCA_EQ_ENTRY_SIZE, PAGE_SIZE) / PAGE_SIZE; - eq->page_list = kmalloc_array(npages, sizeof(*eq->page_list), - GFP_KERNEL); + eq->page_list = kmalloc_objs(*eq->page_list, npages, GFP_KERNEL); if (!eq->page_list) goto err_out; diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c index 04252700790e..8df1bdd1a1bf 100644 --- a/drivers/infiniband/hw/mthca/mthca_mad.c +++ b/drivers/infiniband/hw/mthca/mthca_mad.c @@ -52,7 +52,7 @@ static int mthca_update_rate(struct mthca_dev *dev, u8 port_num) struct ib_port_attr *tprops = NULL; int ret; - tprops = kmalloc(sizeof *tprops, GFP_KERNEL); + tprops = kmalloc_obj(*tprops, GFP_KERNEL); if (!tprops) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c index f2734a5c5f26..e59df6ed0f21 100644 --- a/drivers/infiniband/hw/mthca/mthca_memfree.c +++ b/drivers/infiniband/hw/mthca/mthca_memfree.c @@ -145,7 +145,7 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages, /* We use sg_set_buf for coherent allocs, which assumes low memory */ BUG_ON(coherent && (gfp_mask & __GFP_HIGHMEM)); - icm = kmalloc(sizeof *icm, gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); + icm = kmalloc_obj(*icm, gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); if (!icm) return icm; @@ -156,8 +156,8 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages, while (npages > 0) { if (!chunk) { - chunk = kmalloc(sizeof *chunk, - gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); + chunk = kmalloc_obj(*chunk, + gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); if (!chunk) goto fail; @@ -367,7 +367,7 @@ struct mthca_icm_table *mthca_alloc_icm_table(struct mthca_dev *dev, obj_per_chunk = MTHCA_TABLE_CHUNK_SIZE / obj_size; num_icm = DIV_ROUND_UP(nobj, obj_per_chunk); - table = kmalloc(struct_size(table, icm, num_icm), GFP_KERNEL); + table = kmalloc_flex(*table, icm, num_icm, GFP_KERNEL); if (!table) return NULL; @@ -532,7 +532,7 @@ struct mthca_user_db_table *mthca_init_user_db_tab(struct mthca_dev *dev) return NULL; npages = dev->uar_table.uarc_size / MTHCA_ICM_PAGE_SIZE; - db_tab = kmalloc(struct_size(db_tab, page, npages), GFP_KERNEL); + db_tab = kmalloc_flex(*db_tab, page, npages, GFP_KERNEL); if (!db_tab) return ERR_PTR(-ENOMEM); @@ -707,7 +707,7 @@ int mthca_init_db_tab(struct mthca_dev *dev) if (!mthca_is_memfree(dev)) return 0; - dev->db_tab = kmalloc(sizeof *dev->db_tab, GFP_KERNEL); + dev->db_tab = kmalloc_obj(*dev->db_tab, GFP_KERNEL); if (!dev->db_tab) return -ENOMEM; @@ -717,9 +717,8 @@ int mthca_init_db_tab(struct mthca_dev *dev) dev->db_tab->max_group1 = 0; dev->db_tab->min_group2 = dev->db_tab->npages - 1; - dev->db_tab->page = kmalloc_array(dev->db_tab->npages, - sizeof(*dev->db_tab->page), - GFP_KERNEL); + dev->db_tab->page = kmalloc_objs(*dev->db_tab->page, + dev->db_tab->npages, GFP_KERNEL); if (!dev->db_tab->page) { kfree(dev->db_tab); return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index dacb8ceeebe0..eae6c92e7515 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c @@ -146,8 +146,8 @@ static int mthca_buddy_init(struct mthca_buddy *buddy, int max_order) buddy->bits = kcalloc(buddy->max_order + 1, sizeof(*buddy->bits), GFP_KERNEL); - buddy->num_free = kcalloc((buddy->max_order + 1), sizeof *buddy->num_free, - GFP_KERNEL); + buddy->num_free = kzalloc_objs(*buddy->num_free, (buddy->max_order + 1), + GFP_KERNEL); if (!buddy->bits || !buddy->num_free) goto err_out; @@ -212,7 +212,7 @@ static struct mthca_mtt *__mthca_alloc_mtt(struct mthca_dev *dev, int size, if (size <= 0) return ERR_PTR(-EINVAL); - mtt = kmalloc(sizeof *mtt, GFP_KERNEL); + mtt = kmalloc_obj(*mtt, GFP_KERNEL); if (!mtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c index 69af65f1b332..230c073dd11f 100644 --- a/drivers/infiniband/hw/mthca/mthca_profile.c +++ b/drivers/infiniband/hw/mthca/mthca_profile.c @@ -77,7 +77,7 @@ s64 mthca_make_profile(struct mthca_dev *dev, struct mthca_resource *profile; int i, j; - profile = kcalloc(MTHCA_RES_NUM, sizeof(*profile), GFP_KERNEL); + profile = kzalloc_objs(*profile, MTHCA_RES_NUM, GFP_KERNEL); if (!profile) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index dd572d76866c..88ce64eb4704 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -61,8 +61,8 @@ static int mthca_query_device(struct ib_device *ibdev, struct ib_device_attr *pr if (uhw->inlen || uhw->outlen) return -EINVAL; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -125,8 +125,8 @@ static int mthca_query_port(struct ib_device *ibdev, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -221,8 +221,8 @@ static int mthca_query_pkey(struct ib_device *ibdev, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -250,8 +250,8 @@ static int mthca_query_gid(struct ib_device *ibdev, u32 port, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; @@ -516,7 +516,7 @@ static int mthca_create_qp(struct ib_qp *ibqp, case IB_QPT_SMI: case IB_QPT_GSI: { - qp->sqp = kzalloc(sizeof(struct mthca_sqp), GFP_KERNEL); + qp->sqp = kzalloc_obj(struct mthca_sqp, GFP_KERNEL); if (!qp->sqp) return -ENOMEM; @@ -660,7 +660,7 @@ static int mthca_alloc_resize_buf(struct mthca_dev *dev, struct mthca_cq *cq, goto unlock; } - cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_ATOMIC); + cq->resize_buf = kmalloc_obj(*cq->resize_buf, GFP_ATOMIC); if (!cq->resize_buf) { ret = -ENOMEM; goto unlock; @@ -806,7 +806,7 @@ static struct ib_mr *mthca_get_dma_mr(struct ib_pd *pd, int acc) struct mthca_mr *mr; int err; - mr = kmalloc(sizeof *mr, GFP_KERNEL); + mr = kmalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -853,7 +853,7 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, } else if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) return ERR_PTR(-EFAULT); - mr = kmalloc(sizeof *mr, GFP_KERNEL); + mr = kmalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -998,8 +998,8 @@ static int mthca_init_node_data(struct mthca_dev *dev) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); if (!in_mad || !out_mad) goto out; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 56f06c68f31a..c6a55323408a 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -355,7 +355,7 @@ static void *ocrdma_init_emb_mqe(u8 opcode, u32 cmd_len) { struct ocrdma_mqe *mqe; - mqe = kzalloc(sizeof(struct ocrdma_mqe), GFP_KERNEL); + mqe = kzalloc_obj(struct ocrdma_mqe, GFP_KERNEL); if (!mqe) return NULL; mqe->hdr.spcl_sge_cnt_emb |= @@ -1289,7 +1289,7 @@ int ocrdma_mbx_rdma_stats(struct ocrdma_dev *dev, bool reset) struct ocrdma_rdma_stats_resp *old_stats; int status; - old_stats = kmalloc(sizeof(*old_stats), GFP_KERNEL); + old_stats = kmalloc_obj(*old_stats, GFP_KERNEL); if (old_stats == NULL) return -ENOMEM; @@ -1332,7 +1332,7 @@ static int ocrdma_mbx_get_ctrl_attribs(struct ocrdma_dev *dev) struct ocrdma_get_ctrl_attribs_rsp *ctrl_attr_rsp; struct mgmt_hba_attribs *hba_attribs; - mqe = kzalloc(sizeof(struct ocrdma_mqe), GFP_KERNEL); + mqe = kzalloc_obj(struct ocrdma_mqe, GFP_KERNEL); if (!mqe) return status; @@ -1592,8 +1592,7 @@ void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev) { int status; - dev->pd_mgr = kzalloc(sizeof(struct ocrdma_pd_resource_mgr), - GFP_KERNEL); + dev->pd_mgr = kzalloc_obj(struct ocrdma_pd_resource_mgr, GFP_KERNEL); if (!dev->pd_mgr) return; @@ -3082,7 +3081,7 @@ static int ocrdma_create_eqs(struct ocrdma_dev *dev) if (!num_eq) return -EINVAL; - dev->eq_tbl = kcalloc(num_eq, sizeof(struct ocrdma_eq), GFP_KERNEL); + dev->eq_tbl = kzalloc_objs(struct ocrdma_eq, num_eq, GFP_KERNEL); if (!dev->eq_tbl) return -ENOMEM; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 5d4b3bc16493..16e3e0ff97b8 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -219,15 +219,14 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) static int ocrdma_alloc_resources(struct ocrdma_dev *dev) { mutex_init(&dev->dev_lock); - dev->cq_tbl = kcalloc(OCRDMA_MAX_CQ, sizeof(struct ocrdma_cq *), - GFP_KERNEL); + dev->cq_tbl = kzalloc_objs(struct ocrdma_cq *, OCRDMA_MAX_CQ, + GFP_KERNEL); if (!dev->cq_tbl) goto alloc_err; if (dev->attr.max_qp) { - dev->qp_tbl = kcalloc(OCRDMA_MAX_QP, - sizeof(struct ocrdma_qp *), - GFP_KERNEL); + dev->qp_tbl = kzalloc_objs(struct ocrdma_qp *, OCRDMA_MAX_QP, + GFP_KERNEL); if (!dev->qp_tbl) goto alloc_err; } @@ -271,7 +270,7 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) return NULL; } - dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL); + dev->mbx_cmd = kzalloc_obj(struct ocrdma_mqe_emb_cmd, GFP_KERNEL); if (!dev->mbx_cmd) goto init_err; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 46d911fd38de..e9840337e694 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -195,7 +195,7 @@ static int ocrdma_add_mmap(struct ocrdma_ucontext *uctx, u64 phy_addr, { struct ocrdma_mm *mm; - mm = kzalloc(sizeof(*mm), GFP_KERNEL); + mm = kzalloc_obj(*mm, GFP_KERNEL); if (mm == NULL) return -ENOMEM; mm->key.phy_addr = phy_addr; @@ -727,7 +727,7 @@ struct ib_mr *ocrdma_get_dma_mr(struct ib_pd *ibpd, int acc) return ERR_PTR(-EINVAL); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -794,8 +794,8 @@ static int ocrdma_build_pbl_tbl(struct ocrdma_dev *dev, struct ocrdma_hw_mr *mr) void *va; dma_addr_t pa; - mr->pbl_table = kcalloc(mr->num_pbls, sizeof(struct ocrdma_pbl), - GFP_KERNEL); + mr->pbl_table = kzalloc_objs(struct ocrdma_pbl, mr->num_pbls, + GFP_KERNEL); if (!mr->pbl_table) return -ENOMEM; @@ -863,7 +863,7 @@ struct ib_mr *ocrdma_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(status); mr->umem = ib_umem_get(ibpd->device, start, len, acc); @@ -1255,8 +1255,7 @@ static void ocrdma_set_qp_db(struct ocrdma_dev *dev, struct ocrdma_qp *qp, static int ocrdma_alloc_wr_id_tbl(struct ocrdma_qp *qp) { qp->wqe_wr_id_tbl = - kcalloc(qp->sq.max_cnt, sizeof(*(qp->wqe_wr_id_tbl)), - GFP_KERNEL); + kzalloc_objs(*(qp->wqe_wr_id_tbl), qp->sq.max_cnt, GFP_KERNEL); if (qp->wqe_wr_id_tbl == NULL) return -ENOMEM; qp->rqe_wr_id_tbl = @@ -2911,7 +2910,7 @@ struct ib_mr *ocrdma_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, if (max_num_sg > dev->attr.max_pages_per_frmr) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index ecdfeff3d44f..8b074d8982e5 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -333,8 +333,7 @@ static int qedr_alloc_resources(struct qedr_dev *dev) __le16 *cons_pi; int i, rc; - dev->sgid_tbl = kcalloc(QEDR_MAX_SGID, sizeof(union ib_gid), - GFP_KERNEL); + dev->sgid_tbl = kzalloc_objs(union ib_gid, QEDR_MAX_SGID, GFP_KERNEL); if (!dev->sgid_tbl) return -ENOMEM; @@ -351,15 +350,13 @@ static int qedr_alloc_resources(struct qedr_dev *dev) } /* Allocate Status blocks for CNQ */ - dev->sb_array = kcalloc(dev->num_cnq, sizeof(*dev->sb_array), - GFP_KERNEL); + dev->sb_array = kzalloc_objs(*dev->sb_array, dev->num_cnq, GFP_KERNEL); if (!dev->sb_array) { rc = -ENOMEM; goto err_destroy_wq; } - dev->cnq_array = kcalloc(dev->num_cnq, - sizeof(*dev->cnq_array), GFP_KERNEL); + dev->cnq_array = kzalloc_objs(*dev->cnq_array, dev->num_cnq, GFP_KERNEL); if (!dev->cnq_array) { rc = -ENOMEM; goto err2; @@ -789,7 +786,7 @@ static int qedr_init_hw(struct qedr_dev *dev) int rc = 0; int i; - in_params = kzalloc(sizeof(*in_params), GFP_KERNEL); + in_params = kzalloc_obj(*in_params, GFP_KERNEL); if (!in_params) { rc = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c index 259303b9907c..ff1f138ec34f 100644 --- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c @@ -108,7 +108,7 @@ qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params) struct iw_cm_event event; struct qedr_iw_ep *ep; - ep = kzalloc(sizeof(*ep), GFP_ATOMIC); + ep = kzalloc_obj(*ep, GFP_ATOMIC); if (!ep) return; @@ -258,7 +258,7 @@ qedr_iw_disconnect_event(void *context, struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context; struct qedr_dev *dev = ep->dev; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return; @@ -560,7 +560,7 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) if (!laddr->sin_port || !raddr->sin_port) return -EINVAL; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; @@ -672,7 +672,7 @@ int qedr_iw_create_listen(struct iw_cm_id *cm_id, int backlog) DP_DEBUG(dev, QEDR_MSG_IWARP, "Create Listener address: %pISpc\n", &cm_id->local_addr); - listener = kzalloc(sizeof(*listener), GFP_KERNEL); + listener = kzalloc_obj(*listener, GFP_KERNEL); if (!listener) return -ENOMEM; diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c index 859f66a51bd2..f0e0ae154302 100644 --- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c @@ -339,12 +339,10 @@ int qedr_create_gsi_qp(struct qedr_dev *dev, struct ib_qp_init_attr *attrs, qp->rq.max_wr = attrs->cap.max_recv_wr; qp->sq.max_wr = attrs->cap.max_send_wr; - qp->rqe_wr_id = kcalloc(qp->rq.max_wr, sizeof(*qp->rqe_wr_id), - GFP_KERNEL); + qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr, GFP_KERNEL); if (!qp->rqe_wr_id) goto err; - qp->wqe_wr_id = kcalloc(qp->sq.max_wr, sizeof(*qp->wqe_wr_id), - GFP_KERNEL); + qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr, GFP_KERNEL); if (!qp->wqe_wr_id) goto err; @@ -507,7 +505,7 @@ static inline int qedr_gsi_build_packet(struct qedr_dev *dev, header_size = ib_ud_header_pack(&udh, &ud_header_buffer); - packet = kzalloc(sizeof(*packet), GFP_ATOMIC); + packet = kzalloc_obj(*packet, GFP_ATOMIC); if (!packet) return -ENOMEM; diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index ab9bf0922979..ed7d4fc20b21 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -296,7 +296,7 @@ int qedr_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata) ctx->dpi_addr = oparams.dpi_addr; ctx->dpi_phys_addr = oparams.dpi_phys_addr; ctx->dpi_size = oparams.dpi_size; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { rc = -ENOMEM; goto err; @@ -537,7 +537,7 @@ static struct qedr_pbl *qedr_alloc_pbl_tbl(struct qedr_dev *dev, void *va; int i; - pbl_table = kcalloc(pbl_info->num_pbls, sizeof(*pbl_table), flags); + pbl_table = kzalloc_objs(*pbl_table, pbl_info->num_pbls, flags); if (!pbl_table) return ERR_PTR(-ENOMEM); @@ -761,7 +761,7 @@ static int qedr_init_user_db_rec(struct ib_udata *udata, return -ENOMEM; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) goto err_free_db_data; @@ -820,7 +820,7 @@ static inline int qedr_init_user_queue(struct ib_udata *udata, qedr_populate_pbls(dev, q->umem, q->pbl_tbl, &q->pbl_info, FW_PAGE_SHIFT); } else { - q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL); + q->pbl_tbl = kzalloc_obj(*q->pbl_tbl, GFP_KERNEL); if (!q->pbl_tbl) { rc = -ENOMEM; goto err0; @@ -2187,8 +2187,7 @@ static int qedr_create_kernel_qp(struct qedr_dev *dev, qp->sq.max_wr = min_t(u32, attrs->cap.max_send_wr * dev->wq_multiplier, dev->attr.max_sqe); - qp->wqe_wr_id = kcalloc(qp->sq.max_wr, sizeof(*qp->wqe_wr_id), - GFP_KERNEL); + qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr, GFP_KERNEL); if (!qp->wqe_wr_id) { DP_ERR(dev, "create qp: failed SQ shadow memory allocation\n"); return -ENOMEM; @@ -2205,8 +2204,7 @@ static int qedr_create_kernel_qp(struct qedr_dev *dev, qp->rq.max_wr = (u16) max_t(u32, attrs->cap.max_recv_wr, 1); /* Allocate driver internal RQ array */ - qp->rqe_wr_id = kcalloc(qp->rq.max_wr, sizeof(*qp->rqe_wr_id), - GFP_KERNEL); + qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr, GFP_KERNEL); if (!qp->rqe_wr_id) { DP_ERR(dev, "create qp: failed RQ shadow memory allocation\n"); @@ -2972,7 +2970,7 @@ struct ib_mr *qedr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(rc); @@ -3080,7 +3078,7 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd, "qedr_alloc_frmr pd = %d max_page_list_len= %d\n", pd->pd_id, max_page_list_len); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(rc); @@ -3221,7 +3219,7 @@ struct ib_mr *qedr_get_dma_mr(struct ib_pd *ibpd, int acc) struct qedr_mr *mr; int rc; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_fwd.c b/drivers/infiniband/hw/usnic/usnic_fwd.c index 18a70850b738..7dd66ee61a4e 100644 --- a/drivers/infiniband/hw/usnic/usnic_fwd.c +++ b/drivers/infiniband/hw/usnic/usnic_fwd.c @@ -85,7 +85,7 @@ struct usnic_fwd_dev *usnic_fwd_dev_alloc(struct pci_dev *pdev) { struct usnic_fwd_dev *ufdev; - ufdev = kzalloc(sizeof(*ufdev), GFP_KERNEL); + ufdev = kzalloc_obj(*ufdev, GFP_KERNEL); if (!ufdev) return NULL; @@ -210,7 +210,7 @@ usnic_fwd_alloc_flow(struct usnic_fwd_dev *ufdev, struct filter *filter, tlv_size = (2*sizeof(struct filter_tlv) + sizeof(struct filter) + sizeof(struct filter_action)); - flow = kzalloc(sizeof(*flow), GFP_ATOMIC); + flow = kzalloc_obj(*flow, GFP_ATOMIC); if (!flow) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index 11eca39b73a9..91e91f78f35b 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c @@ -556,7 +556,7 @@ static int usnic_ib_pci_probe(struct pci_dev *pdev, return -EPERM; } - vf = kzalloc(sizeof(*vf), GFP_KERNEL); + vf = kzalloc_obj(*vf, GFP_KERNEL); if (!vf) return -ENOMEM; diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 59bfbfaee325..a7327c7a7465 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -232,7 +232,7 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp, } /* Create Flow Handle */ - qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC); + qp_flow = kzalloc_obj(*qp_flow, GFP_ATOMIC); if (!qp_flow) { err = -ENOMEM; goto out_dealloc_flow; @@ -305,7 +305,7 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp, } /* Create qp_flow */ - qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC); + qp_flow = kzalloc_obj(*qp_flow, GFP_ATOMIC); if (!qp_flow) { err = -ENOMEM; goto out_dealloc_flow; @@ -542,8 +542,8 @@ alloc_res_chunk_list(struct usnic_vnic *vnic, /* Do Nothing */ } - res_chunk_list = kcalloc(res_lst_sz + 1, sizeof(*res_chunk_list), - GFP_ATOMIC); + res_chunk_list = kzalloc_objs(*res_chunk_list, res_lst_sz + 1, + GFP_ATOMIC); if (!res_chunk_list) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index ae5df96589d9..bbbea014b784 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -604,7 +604,7 @@ struct ib_mr *usnic_ib_reg_mr(struct ib_pd *pd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c index 3fbf99757b11..c659c80a37a6 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -149,9 +149,9 @@ static int usnic_uiom_get_pages(unsigned long addr, size_t size, int writable, off = 0; while (ret) { - chunk = kmalloc(struct_size(chunk, page_list, - min_t(int, ret, USNIC_UIOM_PAGE_CHUNK)), - GFP_KERNEL); + chunk = kmalloc_flex(*chunk, page_list, + min_t(int, ret, USNIC_UIOM_PAGE_CHUNK), + GFP_KERNEL); if (!chunk) { ret = -ENOMEM; goto out; @@ -351,7 +351,7 @@ struct usnic_uiom_reg *usnic_uiom_reg_get(struct usnic_uiom_pd *pd, vpn_start = (addr & PAGE_MASK) >> PAGE_SHIFT; vpn_last = vpn_start + npages - 1; - uiomr = kmalloc(sizeof(*uiomr), GFP_KERNEL); + uiomr = kmalloc_obj(*uiomr, GFP_KERNEL); if (!uiomr) return ERR_PTR(-ENOMEM); @@ -439,7 +439,7 @@ struct usnic_uiom_pd *usnic_uiom_alloc_pd(struct device *dev) struct usnic_uiom_pd *pd; void *domain; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return ERR_PTR(-ENOMEM); @@ -469,7 +469,7 @@ int usnic_uiom_attach_dev_to_pd(struct usnic_uiom_pd *pd, struct device *dev) struct usnic_uiom_dev *uiom_dev; int err; - uiom_dev = kzalloc(sizeof(*uiom_dev), GFP_ATOMIC); + uiom_dev = kzalloc_obj(*uiom_dev, GFP_ATOMIC); if (!uiom_dev) return -ENOMEM; uiom_dev->dev = dev; @@ -533,7 +533,7 @@ struct device **usnic_uiom_get_dev_list(struct usnic_uiom_pd *pd) int i = 0; spin_lock(&pd->lock); - devs = kcalloc(pd->dev_cnt + 1, sizeof(*devs), GFP_ATOMIC); + devs = kzalloc_objs(*devs, pd->dev_cnt + 1, GFP_ATOMIC); if (!devs) { devs = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c index 29d71267af78..235d3a124242 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c @@ -70,7 +70,7 @@ static struct usnic_uiom_interval_node* usnic_uiom_interval_node_alloc(long int start, long int last, int ref_cnt, int flags) { - struct usnic_uiom_interval_node *interval = kzalloc(sizeof(*interval), + struct usnic_uiom_interval_node *interval = kzalloc_obj(*interval, GFP_ATOMIC); if (!interval) return NULL; diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.c b/drivers/infiniband/hw/usnic/usnic_vnic.c index 0c47f73aaed5..2565b1e136cf 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.c +++ b/drivers/infiniband/hw/usnic/usnic_vnic.c @@ -239,12 +239,12 @@ usnic_vnic_get_resources(struct usnic_vnic *vnic, enum usnic_vnic_res_type type, if (usnic_vnic_res_free_cnt(vnic, type) < cnt || cnt < 0 || !owner) return ERR_PTR(-EINVAL); - ret = kzalloc(sizeof(*ret), GFP_ATOMIC); + ret = kzalloc_obj(*ret, GFP_ATOMIC); if (!ret) return ERR_PTR(-ENOMEM); if (cnt > 0) { - ret->res = kcalloc(cnt, sizeof(*(ret->res)), GFP_ATOMIC); + ret->res = kzalloc_objs(*(ret->res), cnt, GFP_ATOMIC); if (!ret->res) { kfree(ret); return ERR_PTR(-ENOMEM); @@ -311,12 +311,12 @@ static int usnic_vnic_alloc_res_chunk(struct usnic_vnic *vnic, } chunk->cnt = chunk->free_cnt = cnt; - chunk->res = kcalloc(cnt, sizeof(*(chunk->res)), GFP_KERNEL); + chunk->res = kzalloc_objs(*(chunk->res), cnt, GFP_KERNEL); if (!chunk->res) return -ENOMEM; for (i = 0; i < cnt; i++) { - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) { err = -ENOMEM; goto fail; @@ -445,7 +445,7 @@ struct usnic_vnic *usnic_vnic_alloc(struct pci_dev *pdev) return ERR_PTR(-EINVAL); } - vnic = kzalloc(sizeof(*vnic), GFP_KERNEL); + vnic = kzalloc_obj(*vnic, GFP_KERNEL); if (!vnic) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index 1664d1d7d969..81970a53a049 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -257,14 +257,14 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) mutex_init(&dev->port_mutex); spin_lock_init(&dev->desc_lock); - dev->cq_tbl = kcalloc(dev->dsr->caps.max_cq, sizeof(struct pvrdma_cq *), - GFP_KERNEL); + dev->cq_tbl = kzalloc_objs(struct pvrdma_cq *, dev->dsr->caps.max_cq, + GFP_KERNEL); if (!dev->cq_tbl) return ret; spin_lock_init(&dev->cq_tbl_lock); - dev->qp_tbl = kcalloc(dev->dsr->caps.max_qp, sizeof(struct pvrdma_qp *), - GFP_KERNEL); + dev->qp_tbl = kzalloc_objs(struct pvrdma_qp *, dev->dsr->caps.max_qp, + GFP_KERNEL); if (!dev->qp_tbl) goto err_cq_free; spin_lock_init(&dev->qp_tbl_lock); @@ -273,9 +273,8 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) if (dev->dsr->caps.max_srq) { ib_set_device_ops(&dev->ib_dev, &pvrdma_dev_srq_ops); - dev->srq_tbl = kcalloc(dev->dsr->caps.max_srq, - sizeof(struct pvrdma_srq *), - GFP_KERNEL); + dev->srq_tbl = kzalloc_objs(struct pvrdma_srq *, + dev->dsr->caps.max_srq, GFP_KERNEL); if (!dev->srq_tbl) goto err_qp_free; } @@ -752,7 +751,7 @@ static int pvrdma_netdevice_event(struct notifier_block *this, struct net_device *event_netdev = netdev_notifier_info_to_dev(ptr); struct pvrdma_netdevice_work *netdev_work; - netdev_work = kmalloc(sizeof(*netdev_work), GFP_ATOMIC); + netdev_work = kmalloc_obj(*netdev_work, GFP_ATOMIC); if (!netdev_work) return NOTIFY_BAD; @@ -985,8 +984,8 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, } /* Allocate GID table */ - dev->sgid_tbl = kcalloc(dev->dsr->caps.gid_tbl_len, - sizeof(union ib_gid), GFP_KERNEL); + dev->sgid_tbl = kzalloc_objs(union ib_gid, dev->dsr->caps.gid_tbl_len, + GFP_KERNEL); if (!dev->sgid_tbl) { ret = -ENOMEM; goto err_free_uar_table; diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c index ba43ad07898c..a4da1b61c27f 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c @@ -81,8 +81,7 @@ int pvrdma_page_dir_init(struct pvrdma_dev *dev, struct pvrdma_page_dir *pdir, pdir->npages = npages; if (alloc_pages) { - pdir->pages = kcalloc(npages, sizeof(*pdir->pages), - GFP_KERNEL); + pdir->pages = kzalloc_objs(*pdir->pages, npages, GFP_KERNEL); if (!pdir->pages) goto err; diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c index ec7a00c8285b..b53fb23c3c86 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c @@ -72,7 +72,7 @@ struct ib_mr *pvrdma_get_dma_mr(struct ib_pd *pd, int acc) return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -146,7 +146,7 @@ struct ib_mr *pvrdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, goto err_umem; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { ret = -ENOMEM; goto err_umem; @@ -222,7 +222,7 @@ struct ib_mr *pvrdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, max_num_sg > PVRDMA_MAX_FAST_REG_PAGES) return ERR_PTR(-EINVAL); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c index 59045bdce2a9..987e9c0b0466 100644 --- a/drivers/infiniband/sw/rdmavt/mcast.c +++ b/drivers/infiniband/sw/rdmavt/mcast.c @@ -34,7 +34,7 @@ static struct rvt_mcast_qp *rvt_mcast_qp_alloc(struct rvt_qp *qp) { struct rvt_mcast_qp *mqp; - mqp = kmalloc(sizeof(*mqp), GFP_KERNEL); + mqp = kmalloc_obj(*mqp, GFP_KERNEL); if (!mqp) goto bail; @@ -66,7 +66,7 @@ static struct rvt_mcast *rvt_mcast_alloc(union ib_gid *mgid, u16 lid) { struct rvt_mcast *mcast; - mcast = kzalloc(sizeof(*mcast), GFP_KERNEL); + mcast = kzalloc_obj(*mcast, GFP_KERNEL); if (!mcast) goto bail; diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 86e482593a85..89b1c7410920 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c @@ -242,7 +242,7 @@ static struct rvt_mr *__rvt_alloc_mr(int count, struct ib_pd *pd) /* Allocate struct plus pointers to first level page tables. */ m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ; - mr = kzalloc(struct_size(mr, mr.map, m), GFP_KERNEL); + mr = kzalloc_flex(*mr, mr.map, m, GFP_KERNEL); if (!mr) goto bail; @@ -292,7 +292,7 @@ struct ib_mr *rvt_get_dma_mr(struct ib_pd *pd, int acc) if (ibpd_to_rvtpd(pd)->user) return ERR_PTR(-EPERM); - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { ret = ERR_PTR(-ENOMEM); goto bail; diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 134a79eecfcb..8108660b2d33 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -2650,7 +2650,7 @@ struct rvt_qp_iter *rvt_qp_iter_init(struct rvt_dev_info *rdi, { struct rvt_qp_iter *i; - i = kzalloc(sizeof(*i), GFP_KERNEL); + i = kzalloc_obj(*i, GFP_KERNEL); if (!i) return NULL; diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index d22d610c2696..3a7b1f3c4ac6 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -53,7 +53,7 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports) if (!rdi) return rdi; - rdi->ports = kcalloc(nports, sizeof(*rdi->ports), GFP_KERNEL); + rdi->ports = kzalloc_objs(*rdi->ports, nports, GFP_KERNEL); if (!rdi->ports) ib_dealloc_device(&rdi->ibdev); diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c index 07ff47bae31d..6c3c78ddedc9 100644 --- a/drivers/infiniband/sw/rxe/rxe_mcast.c +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c @@ -223,7 +223,7 @@ static struct rxe_mcg *rxe_get_mcg(struct rxe_dev *rxe, union ib_gid *mgid) } /* speculative alloc of new mcg */ - mcg = kzalloc(sizeof(*mcg), GFP_KERNEL); + mcg = kzalloc_obj(*mcg, GFP_KERNEL); if (!mcg) { err = -ENOMEM; goto err_dec; @@ -363,7 +363,7 @@ static int rxe_attach_mcg(struct rxe_mcg *mcg, struct rxe_qp *qp) spin_unlock_bh(&rxe->mcg_lock); /* speculative alloc new mca without using GFP_ATOMIC */ - mca = kzalloc(sizeof(*mca), GFP_KERNEL); + mca = kzalloc_obj(*mca, GFP_KERNEL); if (!mca) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_mmap.c b/drivers/infiniband/sw/rxe/rxe_mmap.c index 6b7f2bd69879..6afd158b4b0b 100644 --- a/drivers/infiniband/sw/rxe/rxe_mmap.c +++ b/drivers/infiniband/sw/rxe/rxe_mmap.c @@ -120,7 +120,7 @@ struct rxe_mmap_info *rxe_create_mmap_info(struct rxe_dev *rxe, u32 size, if (!udata) return ERR_PTR(-EINVAL); - ip = kmalloc(sizeof(*ip), GFP_KERNEL); + ip = kmalloc_obj(*ip, GFP_KERNEL); if (!ip) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index c71ab780e379..e2a4eb72a56e 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -156,8 +156,7 @@ static int rxe_mr_fill_pages_from_sgt(struct rxe_mr *mr, struct sg_table *sgt) static int __alloc_mr_page_info(struct rxe_mr *mr, int num_pages) { - mr->page_info = kcalloc(num_pages, sizeof(struct rxe_mr_page), - GFP_KERNEL); + mr->page_info = kzalloc_objs(struct rxe_mr_page, num_pages, GFP_KERNEL); if (!mr->page_info) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c index d3a54bfaf92f..81b7d5cc8313 100644 --- a/drivers/infiniband/sw/rxe/rxe_odp.c +++ b/drivers/infiniband/sw/rxe/rxe_odp.c @@ -523,7 +523,7 @@ static int rxe_ib_advise_mr_prefetch(struct ib_pd *ibpd, num_sge); /* Asynchronous call is "best-effort" and allowed to fail */ - work = kvzalloc(struct_size(work, frags, num_sge), GFP_KERNEL); + work = kvzalloc_flex(*work, frags, num_sge, GFP_KERNEL); if (!work) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 845bdd03ca28..3e00b1c3db0a 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -152,7 +152,7 @@ static int alloc_rd_atomic_resources(struct rxe_qp *qp, unsigned int n) { qp->resp.res_head = 0; qp->resp.res_tail = 0; - qp->resp.resources = kcalloc(n, sizeof(struct resp_res), GFP_KERNEL); + qp->resp.resources = kzalloc_objs(struct resp_res, n, GFP_KERNEL); if (!qp->resp.resources) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c index 9611ee191a46..e27d57ac687f 100644 --- a/drivers/infiniband/sw/rxe/rxe_queue.c +++ b/drivers/infiniband/sw/rxe/rxe_queue.c @@ -63,7 +63,7 @@ struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe, int *num_elem, if (*num_elem < 0) return NULL; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 38d8c408320f..5d1e0b3228c4 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -1245,7 +1245,7 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access) struct rxe_mr *mr; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1288,7 +1288,7 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start, return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); @@ -1373,7 +1373,7 @@ static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, goto err_out; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 1d3de8209bfa..22fa54cacab9 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -205,7 +205,7 @@ static void siw_cep_socket_assoc(struct siw_cep *cep, struct socket *s) static struct siw_cep *siw_cep_alloc(struct siw_device *sdev) { - struct siw_cep *cep = kzalloc(sizeof(*cep), GFP_KERNEL); + struct siw_cep *cep = kzalloc_obj(*cep, GFP_KERNEL); unsigned long flags; if (!cep) @@ -334,7 +334,7 @@ static int siw_cm_alloc_work(struct siw_cep *cep, int num) struct siw_cm_work *work; while (num--) { - work = kmalloc(sizeof(*work), GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) { if (!(list_empty(&cep->work_freelist))) siw_cm_free_work(cep); @@ -1915,7 +1915,7 @@ int siw_create_listen(struct iw_cm_id *id, int backlog) */ if (!id->provider_data) { id->provider_data = - kmalloc(sizeof(struct list_head), GFP_KERNEL); + kmalloc_obj(struct list_head, GFP_KERNEL); if (!id->provider_data) { rv = -ENOMEM; goto error; diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c index 5168307229a9..a896b527bcee 100644 --- a/drivers/infiniband/sw/siw/siw_main.c +++ b/drivers/infiniband/sw/siw/siw_main.c @@ -128,14 +128,14 @@ static int siw_init_cpulist(void) siw_cpu_info.num_nodes = num_nodes; siw_cpu_info.tx_valid_cpus = - kcalloc(num_nodes, sizeof(struct cpumask *), GFP_KERNEL); + kzalloc_objs(struct cpumask *, num_nodes, GFP_KERNEL); if (!siw_cpu_info.tx_valid_cpus) { siw_cpu_info.num_nodes = 0; return -ENOMEM; } for (i = 0; i < siw_cpu_info.num_nodes; i++) { siw_cpu_info.tx_valid_cpus[i] = - kzalloc(sizeof(struct cpumask), GFP_KERNEL); + kzalloc_obj(struct cpumask, GFP_KERNEL); if (!siw_cpu_info.tx_valid_cpus[i]) goto out_err; diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c index d5ddeb17bd22..56d3e5c410ce 100644 --- a/drivers/infiniband/sw/siw/siw_mem.c +++ b/drivers/infiniband/sw/siw/siw_mem.c @@ -58,7 +58,7 @@ int siw_mr_add_mem(struct siw_mr *mr, struct ib_pd *pd, void *mem_obj, u64 start, u64 len, int rights) { struct siw_device *sdev = to_siw_dev(pd->device); - struct siw_mem *mem = kzalloc(sizeof(*mem), GFP_KERNEL); + struct siw_mem *mem = kzalloc_obj(*mem, GFP_KERNEL); struct xa_limit limit = XA_LIMIT(1, SIW_STAG_MAX_INDEX); u32 id, next; @@ -321,7 +321,7 @@ struct siw_pbl *siw_pbl_alloc(u32 num_buf) if (num_buf == 0) return ERR_PTR(-EINVAL); - pbl = kzalloc(struct_size(pbl, pbe, num_buf), GFP_KERNEL); + pbl = kzalloc_flex(*pbl, pbe, num_buf, GFP_KERNEL); if (!pbl) return ERR_PTR(-ENOMEM); @@ -347,12 +347,12 @@ struct siw_umem *siw_umem_get(struct ib_device *base_dev, u64 start, num_pages = PAGE_ALIGN(start + len - first_page_va) >> PAGE_SHIFT; num_chunks = (num_pages >> CHUNK_SHIFT) + 1; - umem = kzalloc(sizeof(*umem), GFP_KERNEL); + umem = kzalloc_obj(*umem, GFP_KERNEL); if (!umem) return ERR_PTR(-ENOMEM); umem->page_chunk = - kcalloc(num_chunks, sizeof(struct siw_page_chunk), GFP_KERNEL); + kzalloc_objs(struct siw_page_chunk, num_chunks, GFP_KERNEL); if (!umem->page_chunk) { rv = -ENOMEM; goto err_out; @@ -376,7 +376,7 @@ struct siw_umem *siw_umem_get(struct ib_device *base_dev, u64 start, for (i = 0; num_pages > 0; i++) { int nents = min_t(int, num_pages, PAGES_PER_CHUNK); struct page **plist = - kcalloc(nents, sizeof(struct page *), GFP_KERNEL); + kzalloc_objs(struct page *, nents, GFP_KERNEL); if (!plist) { rv = -ENOMEM; diff --git a/drivers/infiniband/sw/siw/siw_qp.c b/drivers/infiniband/sw/siw/siw_qp.c index c1e6e7d6e32f..cccfef1e27bf 100644 --- a/drivers/infiniband/sw/siw/siw_qp.c +++ b/drivers/infiniband/sw/siw/siw_qp.c @@ -391,7 +391,7 @@ void siw_send_terminate(struct siw_qp *qp) return; } - term = kzalloc(sizeof(*term), GFP_KERNEL); + term = kzalloc_obj(*term, GFP_KERNEL); if (!term) return; @@ -405,7 +405,7 @@ void siw_send_terminate(struct siw_qp *qp) if ((qp->term_info.layer == TERM_ERROR_LAYER_DDP) || ((qp->term_info.layer == TERM_ERROR_LAYER_RDMAP) && (qp->term_info.etype != RDMAP_ETYPE_CATASTROPHIC))) { - err_hdr = kzalloc(sizeof(*err_hdr), GFP_KERNEL); + err_hdr = kzalloc_obj(*err_hdr, GFP_KERNEL); if (!err_hdr) { kfree(term); return; diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c index efa2f097b582..12719394f1ea 100644 --- a/drivers/infiniband/sw/siw/siw_verbs.c +++ b/drivers/infiniband/sw/siw/siw_verbs.c @@ -274,7 +274,7 @@ siw_mmap_entry_insert(struct siw_ucontext *uctx, void *address, size_t length, u64 *offset) { - struct siw_user_mmap_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct siw_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); int rv; *offset = SIW_INVAL_UOBJ_KEY; @@ -1360,7 +1360,7 @@ struct ib_mr *siw_reg_user_mr(struct ib_pd *pd, u64 start, u64 len, umem = NULL; goto err_out; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { rv = -ENOMEM; goto err_out; @@ -1441,7 +1441,7 @@ struct ib_mr *siw_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, pbl = NULL; goto err_out; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { rv = -ENOMEM; goto err_out; @@ -1556,7 +1556,7 @@ struct ib_mr *siw_get_dma_mr(struct ib_pd *pd, int rights) rv = -ENOMEM; goto err_out; } - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { rv = -ENOMEM; goto err_out; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index b610d36295bb..54de2be1494b 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -360,7 +360,7 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i if (!rx->rx_ring) return -ENOMEM; - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) { ret = -ENOMEM; goto err_free_1; @@ -449,7 +449,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, int ret; ipoib_dbg(priv, "REQ arrived\n"); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; p->dev = dev; @@ -1304,7 +1304,7 @@ struct ipoib_cm_tx *ipoib_cm_create_tx(struct net_device *dev, struct ipoib_path struct ipoib_dev_priv *priv = ipoib_priv(dev); struct ipoib_cm_tx *tx; - tx = kzalloc(sizeof(*tx), GFP_ATOMIC); + tx = kzalloc_obj(*tx, GFP_ATOMIC); if (!tx) return NULL; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 10b0dbda6cd5..44354d661e65 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -59,7 +59,7 @@ struct ipoib_ah *ipoib_create_ah(struct net_device *dev, struct ipoib_ah *ah; struct ib_ah *vah; - ah = kmalloc(sizeof(*ah), GFP_KERNEL); + ah = kmalloc_obj(*ah, GFP_KERNEL); if (!ah) return ERR_PTR(-ENOMEM); @@ -422,7 +422,7 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) ipoib_warn(priv, "failed send event (status=%d, wrid=%d vend_err %#x)\n", wc->status, wr_id, wc->vendor_err); - qp_work = kzalloc(sizeof(*qp_work), GFP_ATOMIC); + qp_work = kzalloc_obj(*qp_work, GFP_ATOMIC); if (!qp_work) return; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 4a504b7c4293..934d8e5a8f11 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -169,7 +169,7 @@ static void ipoib_schedule_ifupdown_task(struct net_device *dev, bool up) (!up && !(dev->flags & IFF_UP))) return; - work = kmalloc(sizeof(*work), GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) return; work->dev = dev; @@ -673,7 +673,7 @@ struct ipoib_path_iter *ipoib_path_iter_init(struct net_device *dev) { struct ipoib_path_iter *iter; - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return NULL; @@ -924,7 +924,7 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid) if (!priv->broadcast) return NULL; - path = kzalloc(sizeof(*path), GFP_ATOMIC); + path = kzalloc_obj(*path, GFP_ATOMIC); if (!path) return NULL; @@ -1443,7 +1443,7 @@ static struct ipoib_neigh *ipoib_neigh_ctor(u8 *daddr, { struct ipoib_neigh *neigh; - neigh = kzalloc(sizeof(*neigh), GFP_ATOMIC); + neigh = kzalloc_obj(*neigh, GFP_ATOMIC); if (!neigh) return NULL; @@ -1593,11 +1593,11 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv) clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags); ntbl->htbl = NULL; - htbl = kzalloc(sizeof(*htbl), GFP_KERNEL); + htbl = kzalloc_obj(*htbl, GFP_KERNEL); if (!htbl) return -ENOMEM; size = roundup_pow_of_two(arp_tbl.gc_thresh3); - buckets = kvcalloc(size, sizeof(*buckets), GFP_KERNEL); + buckets = kvzalloc_objs(*buckets, size, GFP_KERNEL); if (!buckets) { kfree(htbl); return -ENOMEM; @@ -1773,9 +1773,8 @@ static int ipoib_dev_init_default(struct net_device *dev) ipoib_napi_add(dev); /* Allocate RX/TX "rings" to hold queued skbs */ - priv->rx_ring = kcalloc(ipoib_recvq_size, - sizeof(*priv->rx_ring), - GFP_KERNEL); + priv->rx_ring = kzalloc_objs(*priv->rx_ring, ipoib_recvq_size, + GFP_KERNEL); if (!priv->rx_ring) goto out; @@ -2278,7 +2277,7 @@ int ipoib_intf_init(struct ib_device *hca, u32 port, const char *name, struct ipoib_dev_priv *priv; int rc; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -2664,7 +2663,7 @@ static int ipoib_add_one(struct ib_device *device) unsigned int p; int count = 0; - dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL); + dev_list = kmalloc_obj(*dev_list, GFP_KERNEL); if (!dev_list) return -ENOMEM; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 8a4ab9ff0a68..7b04186f659e 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -139,7 +139,7 @@ static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev) { struct ipoib_mcast *mcast; - mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC); + mcast = kzalloc_obj(*mcast, GFP_ATOMIC); if (!mcast) return NULL; @@ -980,7 +980,7 @@ struct ipoib_mcast_iter *ipoib_mcast_iter_init(struct net_device *dev) { struct ipoib_mcast_iter *iter; - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return NULL; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 86983080d28b..55a612ad2b07 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c @@ -52,7 +52,7 @@ int ipoib_mcast_attach(struct net_device *dev, struct ib_device *hca, if (set_qkey) { ret = -ENOMEM; - qp_attr = kmalloc(sizeof(*qp_attr), GFP_KERNEL); + qp_attr = kmalloc_obj(*qp_attr, GFP_KERNEL); if (!qp_attr) goto out; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 243e8f555eca..df98b4936c32 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c @@ -274,7 +274,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) priv->child_type == IPOIB_LEGACY_CHILD) { struct ipoib_vlan_delete_work *work; - work = kmalloc(sizeof(*work), GFP_KERNEL); + work = kmalloc_obj(*work, GFP_KERNEL); if (!work) { rc = -ENOMEM; goto out; diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index dc531fad73de..2e1e97acf342 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -802,7 +802,7 @@ static struct iscsi_endpoint *iscsi_iser_ep_connect(struct Scsi_Host *shost, if (!ep) return ERR_PTR(-ENOMEM); - iser_conn = kzalloc(sizeof(*iser_conn), GFP_KERNEL); + iser_conn = kzalloc_obj(*iser_conn, GFP_KERNEL); if (!iser_conn) { err = -ENOMEM; goto failure; diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index f5f090dc4f1e..0ae0f7722e0f 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c @@ -240,9 +240,8 @@ int iser_alloc_rx_descriptors(struct iser_conn *iser_conn, goto alloc_login_buf_fail; iser_conn->num_rx_descs = session->cmds_max; - iser_conn->rx_descs = kmalloc_array(iser_conn->num_rx_descs, - sizeof(struct iser_rx_desc), - GFP_KERNEL); + iser_conn->rx_descs = kmalloc_objs(struct iser_rx_desc, + iser_conn->num_rx_descs, GFP_KERNEL); if (!iser_conn->rx_descs) goto rx_desc_alloc_fail; diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 6801b70dc9e0..f08dea6721c4 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -105,7 +105,7 @@ iser_create_fastreg_desc(struct iser_device *device, enum ib_mr_type mr_type; int ret; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return ERR_PTR(-ENOMEM); @@ -305,7 +305,7 @@ struct iser_device *iser_device_find_by_ib_device(struct rdma_cm_id *cma_id) if (device->ib_device->node_guid == cma_id->device->node_guid) goto inc_refcnt; - device = kzalloc(sizeof *device, GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) goto out; diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index af811d060cc8..ab5d8790cf87 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -152,9 +152,8 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn) u64 dma_addr; int i, j; - isert_conn->rx_descs = kcalloc(ISERT_QP_MAX_RECV_DTOS, - sizeof(struct iser_rx_desc), - GFP_KERNEL); + isert_conn->rx_descs = kzalloc_objs(struct iser_rx_desc, + ISERT_QP_MAX_RECV_DTOS, GFP_KERNEL); if (!isert_conn->rx_descs) return -ENOMEM; @@ -275,7 +274,7 @@ isert_device_get(struct rdma_cm_id *cma_id) } } - device = kzalloc(sizeof(struct isert_device), GFP_KERNEL); + device = kzalloc_obj(struct isert_device, GFP_KERNEL); if (!device) { mutex_unlock(&device_list_mutex); return ERR_PTR(-ENOMEM); @@ -333,8 +332,8 @@ isert_alloc_login_buf(struct isert_conn *isert_conn, { int ret; - isert_conn->login_desc = kzalloc(sizeof(*isert_conn->login_desc), - GFP_KERNEL); + isert_conn->login_desc = kzalloc_obj(*isert_conn->login_desc, + GFP_KERNEL); if (!isert_conn->login_desc) return -ENOMEM; @@ -429,7 +428,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) isert_dbg("cma_id: %p, portal: %p\n", cma_id, cma_id->context); - isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); + isert_conn = kzalloc_obj(struct isert_conn, GFP_KERNEL); if (!isert_conn) return -ENOMEM; @@ -2269,7 +2268,7 @@ isert_setup_np(struct iscsi_np *np, struct rdma_cm_id *isert_lid; int ret; - isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL); + isert_np = kzalloc_obj(struct isert_np, GFP_KERNEL); if (!isert_np) return -ENOMEM; diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c index 31cd361416ac..6d3dbf45e9f5 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c @@ -238,7 +238,7 @@ int opa_vnic_update_mac_tbl(struct opa_vnic_adapter *adapter, if (!memcmp(mac_addr, empty_mac, ARRAY_SIZE(empty_mac))) continue; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) { rc = -ENOMEM; goto updt_done; @@ -265,7 +265,7 @@ int opa_vnic_update_mac_tbl(struct opa_vnic_adapter *adapter, (node->index < (loffset + lnum_entries))) continue; - new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); + new_node = kzalloc_obj(*new_node, GFP_KERNEL); if (!new_node) { rc = -ENOMEM; goto updt_done; diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c index 071f35711468..6d5f642ff3d3 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c @@ -337,7 +337,7 @@ struct opa_vnic_adapter *opa_vnic_add_netdev(struct ib_device *ibdev, return ERR_CAST(netdev); rn = netdev_priv(netdev); - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) { rc = -ENOMEM; goto adapter_err; diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index 59e30640f94a..67405a19ea10 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -1364,9 +1364,8 @@ static int alloc_path_reqs(struct rtrs_clt_path *clt_path) enum ib_mr_type mr_type; int i, err = -ENOMEM; - clt_path->reqs = kcalloc(clt_path->queue_depth, - sizeof(*clt_path->reqs), - GFP_KERNEL); + clt_path->reqs = kzalloc_objs(*clt_path->reqs, clt_path->queue_depth, + GFP_KERNEL); if (!clt_path->reqs) return -ENOMEM; @@ -1384,7 +1383,7 @@ static int alloc_path_reqs(struct rtrs_clt_path *clt_path) if (!req->iu) goto out; - req->sge = kcalloc(2, sizeof(*req->sge), GFP_KERNEL); + req->sge = kzalloc_objs(*req->sge, 2, GFP_KERNEL); if (!req->sge) goto out; @@ -1538,7 +1537,7 @@ static struct rtrs_clt_path *alloc_path(struct rtrs_clt_sess *clt, int cpu; size_t total_con; - clt_path = kzalloc(sizeof(*clt_path), GFP_KERNEL); + clt_path = kzalloc_obj(*clt_path, GFP_KERNEL); if (!clt_path) goto err; @@ -1547,15 +1546,14 @@ static struct rtrs_clt_path *alloc_path(struct rtrs_clt_sess *clt, * +1: Extra connection for user messages */ total_con = con_num + nr_poll_queues + 1; - clt_path->s.con = kcalloc(total_con, sizeof(*clt_path->s.con), - GFP_KERNEL); + clt_path->s.con = kzalloc_objs(*clt_path->s.con, total_con, GFP_KERNEL); if (!clt_path->s.con) goto err_free_path; clt_path->s.con_num = total_con; clt_path->s.irq_con_num = con_num + 1; - clt_path->stats = kzalloc(sizeof(*clt_path->stats), GFP_KERNEL); + clt_path->stats = kzalloc_obj(*clt_path->stats, GFP_KERNEL); if (!clt_path->stats) goto err_free_con; @@ -1622,7 +1620,7 @@ static int create_con(struct rtrs_clt_path *clt_path, unsigned int cid) { struct rtrs_clt_con *con; - con = kzalloc(sizeof(*con), GFP_KERNEL); + con = kzalloc_obj(*con, GFP_KERNEL); if (!con) return -ENOMEM; @@ -1873,9 +1871,8 @@ static int rtrs_rdma_conn_established(struct rtrs_clt_con *con, } if (!clt_path->rbufs) { - clt_path->rbufs = kcalloc(queue_depth, - sizeof(*clt_path->rbufs), - GFP_KERNEL); + clt_path->rbufs = kzalloc_objs(*clt_path->rbufs, + queue_depth, GFP_KERNEL); if (!clt_path->rbufs) return -ENOMEM; } @@ -2730,7 +2727,7 @@ static struct rtrs_clt_sess *alloc_clt(const char *sessname, size_t paths_num, if (strlen(sessname) >= sizeof(clt->sessname)) return ERR_PTR(-EINVAL); - clt = kzalloc(sizeof(*clt), GFP_KERNEL); + clt = kzalloc_obj(*clt, GFP_KERNEL); if (!clt) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index 2e09811a10b2..c66929b74805 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -138,14 +138,13 @@ static int rtrs_srv_alloc_ops_ids(struct rtrs_srv_path *srv_path) struct rtrs_srv_op *id; int i, ret; - srv_path->ops_ids = kcalloc(srv->queue_depth, - sizeof(*srv_path->ops_ids), - GFP_KERNEL); + srv_path->ops_ids = kzalloc_objs(*srv_path->ops_ids, srv->queue_depth, + GFP_KERNEL); if (!srv_path->ops_ids) goto err; for (i = 0; i < srv->queue_depth; ++i) { - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) goto err; @@ -589,7 +588,7 @@ static int map_cont_bufs(struct rtrs_srv_path *srv_path) chunks_per_mr = DIV_ROUND_UP(srv->queue_depth, mrs_num); } - srv_path->mrs = kcalloc(mrs_num, sizeof(*srv_path->mrs), GFP_KERNEL); + srv_path->mrs = kzalloc_objs(*srv_path->mrs, mrs_num, GFP_KERNEL); if (!srv_path->mrs) return -ENOMEM; @@ -837,7 +836,7 @@ static int process_info_req(struct rtrs_srv_con *con, strscpy(srv_path->s.sessname, msg->pathname, sizeof(srv_path->s.sessname)); - rwr = kcalloc(srv_path->mrs_num, sizeof(*rwr), GFP_KERNEL); + rwr = kzalloc_objs(*rwr, srv_path->mrs_num, GFP_KERNEL); if (!rwr) return -ENOMEM; @@ -1436,7 +1435,7 @@ static struct rtrs_srv_sess *get_or_create_srv(struct rtrs_srv_ctx *ctx, } /* need to allocate a new srv */ - srv = kzalloc(sizeof(*srv), GFP_KERNEL); + srv = kzalloc_obj(*srv, GFP_KERNEL); if (!srv) return ERR_PTR(-ENOMEM); @@ -1449,8 +1448,7 @@ static struct rtrs_srv_sess *get_or_create_srv(struct rtrs_srv_ctx *ctx, device_initialize(&srv->dev); srv->dev.release = rtrs_srv_dev_release; - srv->chunks = kcalloc(srv->queue_depth, sizeof(*srv->chunks), - GFP_KERNEL); + srv->chunks = kzalloc_objs(*srv->chunks, srv->queue_depth, GFP_KERNEL); if (!srv->chunks) goto err_free_srv; @@ -1715,7 +1713,7 @@ static int create_con(struct rtrs_srv_path *srv_path, u32 cq_num, max_send_wr, max_recv_wr, wr_limit; int err, cq_vector; - con = kzalloc(sizeof(*con), GFP_KERNEL); + con = kzalloc_obj(*con, GFP_KERNEL); if (!con) { err = -ENOMEM; goto err; @@ -1808,11 +1806,11 @@ static struct rtrs_srv_path *__alloc_path(struct rtrs_srv_sess *srv, err = -EEXIST; goto err; } - srv_path = kzalloc(sizeof(*srv_path), GFP_KERNEL); + srv_path = kzalloc_obj(*srv_path, GFP_KERNEL); if (!srv_path) goto err; - srv_path->stats = kzalloc(sizeof(*srv_path->stats), GFP_KERNEL); + srv_path->stats = kzalloc_obj(*srv_path->stats, GFP_KERNEL); if (!srv_path->stats) goto err_free_sess; @@ -1822,14 +1820,12 @@ static struct rtrs_srv_path *__alloc_path(struct rtrs_srv_sess *srv, srv_path->stats->srv_path = srv_path; - srv_path->dma_addr = kcalloc(srv->queue_depth, - sizeof(*srv_path->dma_addr), - GFP_KERNEL); + srv_path->dma_addr = kzalloc_objs(*srv_path->dma_addr, srv->queue_depth, + GFP_KERNEL); if (!srv_path->dma_addr) goto err_free_percpu; - srv_path->s.con = kcalloc(con_num, sizeof(*srv_path->s.con), - GFP_KERNEL); + srv_path->s.con = kzalloc_objs(*srv_path->s.con, con_num, GFP_KERNEL); if (!srv_path->s.con) goto err_free_dma_addr; @@ -2162,7 +2158,7 @@ static struct rtrs_srv_ctx *alloc_srv_ctx(struct rtrs_srv_ops *ops) { struct rtrs_srv_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; diff --git a/drivers/infiniband/ulp/rtrs/rtrs.c b/drivers/infiniband/ulp/rtrs/rtrs.c index bc1208ae8216..f316cbe5e62c 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs.c @@ -26,7 +26,7 @@ struct rtrs_iu *rtrs_iu_alloc(u32 iu_num, size_t size, gfp_t gfp_mask, struct rtrs_iu *ius, *iu; int i; - ius = kcalloc(iu_num, sizeof(*ius), gfp_mask); + ius = kzalloc_objs(*ius, iu_num, gfp_mask); if (!ius) return NULL; for (i = 0; i < iu_num; i++) { @@ -618,7 +618,7 @@ rtrs_ib_dev_find_or_add(struct ib_device *ib_dev, goto out_unlock; } mutex_unlock(&pool->mutex); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto out_err; diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 510f16004ecd..e1dfc097f774 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -225,7 +225,7 @@ static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, { struct srp_iu *iu; - iu = kmalloc(sizeof *iu, gfp_mask); + iu = kmalloc_obj(*iu, gfp_mask); if (!iu) goto out; @@ -274,7 +274,7 @@ static int srp_init_ib_qp(struct srp_target_port *target, struct ib_qp_attr *attr; int ret; - attr = kmalloc(sizeof *attr, GFP_KERNEL); + attr = kmalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; @@ -418,7 +418,7 @@ static struct srp_fr_pool *srp_create_fr_pool(struct ib_device *device, if (pool_size <= 0) goto err; ret = -ENOMEM; - pool = kzalloc(struct_size(pool, desc, pool_size), GFP_KERNEL); + pool = kzalloc_flex(*pool, desc, pool_size, GFP_KERNEL); if (!pool) goto err; pool->size = pool_size; @@ -533,7 +533,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) const int m = 1 + dev->use_fast_reg * target->mr_per_cmd * 2; int ret; - init_attr = kzalloc(sizeof *init_attr, GFP_KERNEL); + init_attr = kzalloc_obj(*init_attr, GFP_KERNEL); if (!init_attr) return -ENOMEM; @@ -806,7 +806,7 @@ static int srp_send_req(struct srp_rdma_ch *ch, uint32_t max_iu_len, char *ipi, *tpi; int status; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -2257,12 +2257,10 @@ static int srp_alloc_iu_bufs(struct srp_rdma_ch *ch) struct srp_target_port *target = ch->target; int i; - ch->rx_ring = kcalloc(target->queue_size, sizeof(*ch->rx_ring), - GFP_KERNEL); + ch->rx_ring = kzalloc_objs(*ch->rx_ring, target->queue_size, GFP_KERNEL); if (!ch->rx_ring) goto err_no_ring; - ch->tx_ring = kcalloc(target->queue_size, sizeof(*ch->tx_ring), - GFP_KERNEL); + ch->tx_ring = kzalloc_objs(*ch->tx_ring, target->queue_size, GFP_KERNEL); if (!ch->tx_ring) goto err_no_ring; @@ -2387,7 +2385,7 @@ static void srp_cm_rep_handler(struct ib_cm_id *cm_id, if (!target->using_rdma_cm) { ret = -ENOMEM; - qp_attr = kmalloc(sizeof(*qp_attr), GFP_KERNEL); + qp_attr = kmalloc_obj(*qp_attr, GFP_KERNEL); if (!qp_attr) goto error; @@ -3824,8 +3822,7 @@ static ssize_t add_target_store(struct device *dev, num_online_cpus()); } - target->ch = kcalloc(target->ch_count, sizeof(*target->ch), - GFP_KERNEL); + target->ch = kzalloc_objs(*target->ch, target->ch_count, GFP_KERNEL); if (!target->ch) goto out; @@ -3960,7 +3957,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u32 port) { struct srp_host *host; - host = kzalloc(sizeof *host, GFP_KERNEL); + host = kzalloc_obj(*host, GFP_KERNEL); if (!host) return NULL; @@ -4010,7 +4007,7 @@ static int srp_add_one(struct ib_device *device) u64 max_pages_per_mr; unsigned int flags = 0; - srp_dev = kzalloc(sizeof(*srp_dev), GFP_KERNEL); + srp_dev = kzalloc_obj(*srp_dev, GFP_KERNEL); if (!srp_dev) return -ENOMEM; diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index e314e6a84d96..6e371b264054 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -127,7 +127,7 @@ static struct kmem_cache *srpt_cache_get(unsigned int object_size) return e->c; } snprintf(name, sizeof(name), "srpt-%u", object_size); - e = kmalloc(sizeof(*e), GFP_KERNEL); + e = kmalloc_obj(*e, GFP_KERNEL); if (!e) return NULL; refcount_set(&e->ref, 1); @@ -790,7 +790,7 @@ static struct srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev, WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx) && ioctx_size != sizeof(struct srpt_send_ioctx)); - ring = kvmalloc_array(ring_size, sizeof(ring[0]), GFP_KERNEL); + ring = kvmalloc_objs(ring[0], ring_size, GFP_KERNEL); if (!ring) goto out; for (i = 0; i < ring_size; ++i) { @@ -965,8 +965,8 @@ static int srpt_alloc_rw_ctxs(struct srpt_send_ioctx *ioctx, if (nbufs == 1) { ioctx->rw_ctxs = &ioctx->s_rw_ctx; } else { - ioctx->rw_ctxs = kmalloc_array(nbufs, sizeof(*ioctx->rw_ctxs), - GFP_KERNEL); + ioctx->rw_ctxs = kmalloc_objs(*ioctx->rw_ctxs, nbufs, + GFP_KERNEL); if (!ioctx->rw_ctxs) return -ENOMEM; } @@ -1181,7 +1181,7 @@ static int srpt_init_ch_qp(struct srpt_rdma_ch *ch, struct ib_qp *qp) WARN_ON_ONCE(ch->using_rdma_cm); - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; @@ -1857,7 +1857,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) WARN_ON(ch->rq_size < 1); ret = -ENOMEM; - qp_init = kzalloc(sizeof(*qp_init), GFP_KERNEL); + qp_init = kzalloc_obj(*qp_init, GFP_KERNEL); if (!qp_init) goto out; @@ -2089,7 +2089,7 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport, if (nexus) break; - tmp_nexus = kzalloc(sizeof(*nexus), GFP_KERNEL); + tmp_nexus = kzalloc_obj(*nexus, GFP_KERNEL); if (!tmp_nexus) { nexus = ERR_PTR(-ENOMEM); break; @@ -2241,9 +2241,9 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, } ret = -ENOMEM; - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); - rej = kzalloc(sizeof(*rej), GFP_KERNEL); - rep_param = kzalloc(sizeof(*rep_param), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rej = kzalloc_obj(*rej, GFP_KERNEL); + rep_param = kzalloc_obj(*rep_param, GFP_KERNEL); if (!rsp || !rej || !rep_param) goto out; @@ -2273,7 +2273,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, } ret = -ENOMEM; - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) { rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); pr_err("rejected SRP_LOGIN_REQ because out of memory.\n"); @@ -3210,8 +3210,7 @@ static int srpt_add_one(struct ib_device *device) pr_debug("device = %p\n", device); - sdev = kzalloc(struct_size(sdev, port, device->phys_port_cnt), - GFP_KERNEL); + sdev = kzalloc_flex(*sdev, port, device->phys_port_cnt, GFP_KERNEL); if (!sdev) return -ENOMEM; @@ -3790,7 +3789,7 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn, struct srpt_tpg *stpg; int res = -ENOMEM; - stpg = kzalloc(sizeof(*stpg), GFP_KERNEL); + stpg = kzalloc_obj(*stpg, GFP_KERNEL); if (!stpg) return ERR_PTR(res); stpg->sport_id = sport_id; @@ -3847,7 +3846,7 @@ static struct se_wwn *srpt_make_tport(struct target_fabric_configfs *tf, WARN_ON_ONCE(true); return &(*papi.port_id)->wwn; } - port_id = kzalloc(sizeof(*port_id), GFP_KERNEL); + port_id = kzalloc_obj(*port_id, GFP_KERNEL); if (!port_id) { srpt_sdev_put(sport->sdev); return ERR_PTR(-ENOMEM); diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c index 70a9e1dfba33..211ab2c0793a 100644 --- a/drivers/input/apm-power.c +++ b/drivers/input/apm-power.c @@ -52,7 +52,7 @@ static int apmpower_connect(struct input_handler *handler, struct input_handle *handle; int error; - handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL); + handle = kzalloc_obj(struct input_handle, GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 90ff6be85cf4..884b525e799c 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -465,7 +465,7 @@ static int evdev_open(struct inode *inode, struct file *file) struct evdev_client *client; int error; - client = kvzalloc(struct_size(client, buffer, bufsize), GFP_KERNEL); + client = kvzalloc_flex(*client, buffer, bufsize, GFP_KERNEL); if (!client) return -ENOMEM; @@ -1346,7 +1346,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev, return error; } - evdev = kzalloc(sizeof(struct evdev), GFP_KERNEL); + evdev = kzalloc_obj(struct evdev, GFP_KERNEL); if (!evdev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index 66f7ffe8c7e0..d6e2c3017435 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c @@ -303,12 +303,11 @@ int input_ff_create(struct input_dev *dev, unsigned int max_effects) } struct ff_device *ff __free(kfree) = - kzalloc(struct_size(ff, effect_owners, max_effects), - GFP_KERNEL); + kzalloc_flex(*ff, effect_owners, max_effects, GFP_KERNEL); if (!ff) return -ENOMEM; - ff->effects = kcalloc(max_effects, sizeof(*ff->effects), GFP_KERNEL); + ff->effects = kzalloc_objs(*ff->effects, max_effects, GFP_KERNEL); if (!ff->effects) return -ENOMEM; diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index e0c1c61aae71..e018ea328dda 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -508,7 +508,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data, int error; int i; - struct ml_device *ml __free(kfree) = kzalloc(sizeof(*ml), GFP_KERNEL); + struct ml_device *ml __free(kfree) = kzalloc_obj(*ml, GFP_KERNEL); if (!ml) return -ENOMEM; diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c index 4f4583048f24..cbb67f97d0ca 100644 --- a/drivers/input/gameport/emu10k1-gp.c +++ b/drivers/input/gameport/emu10k1-gp.c @@ -43,7 +43,7 @@ static int emu_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct gameport *port; int error; - emu = kzalloc(sizeof(*emu), GFP_KERNEL); + emu = kzalloc_obj(*emu, GFP_KERNEL); port = gameport_allocate_port(); if (!emu || !port) { printk(KERN_ERR "emu10k1-gp: Memory allocation failed\n"); diff --git a/drivers/input/gameport/fm801-gp.c b/drivers/input/gameport/fm801-gp.c index 7ae5009385cc..f5b1a683d1b4 100644 --- a/drivers/input/gameport/fm801-gp.c +++ b/drivers/input/gameport/fm801-gp.c @@ -68,7 +68,7 @@ static int fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id) struct gameport *port; int error; - gp = kzalloc(sizeof(*gp), GFP_KERNEL); + gp = kzalloc_obj(*gp, GFP_KERNEL); port = gameport_allocate_port(); if (!gp || !port) { printk(KERN_ERR "fm801-gp: Memory allocation failed\n"); diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index f4f12dd00fff..9707b155bc94 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c @@ -374,7 +374,7 @@ static int gameport_queue_event(void *object, struct module *owner, } } - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) { pr_err("Not enough memory to queue event %d\n", event_type); retval = -ENOMEM; diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index 880e714b49bc..cb04b49a82be 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c @@ -120,7 +120,7 @@ static int ns558_isa_probe(int io) return -EBUSY; } - ns558 = kzalloc(sizeof(*ns558), GFP_KERNEL); + ns558 = kzalloc_obj(*ns558, GFP_KERNEL); port = gameport_allocate_port(); if (!ns558 || !port) { printk(KERN_ERR "ns558: Memory allocation failed.\n"); @@ -192,7 +192,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did) if (!request_region(ioport, iolen, "ns558-pnp")) return -EBUSY; - ns558 = kzalloc(sizeof(*ns558), GFP_KERNEL); + ns558 = kzalloc_obj(*ns558, GFP_KERNEL); port = gameport_allocate_port(); if (!ns558 || !port) { printk(KERN_ERR "ns558: Memory allocation failed\n"); diff --git a/drivers/input/input-leds.c b/drivers/input/input-leds.c index 6bbf3806ea37..f0fa83ab9339 100644 --- a/drivers/input/input-leds.c +++ b/drivers/input/input-leds.c @@ -101,7 +101,7 @@ static int input_leds_connect(struct input_handler *handler, if (!num_leds) return -ENXIO; - leds = kzalloc(struct_size(leds, leds, num_leds), GFP_KERNEL); + leds = kzalloc_flex(*leds, leds, num_leds, GFP_KERNEL); if (!leds) return -ENOMEM; diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 09f518897d4a..0d4043797e4c 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -50,7 +50,7 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, return -EINVAL; struct input_mt *mt __free(kfree) = - kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL); + kzalloc_flex(*mt, slots, num_slots, GFP_KERNEL); if (!mt) return -ENOMEM; @@ -84,7 +84,7 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); if (flags & INPUT_MT_TRACK) { unsigned int n2 = num_slots * num_slots; - mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL); + mt->red = kzalloc_objs(*mt->red, n2, GFP_KERNEL); if (!mt->red) return -ENOMEM; } diff --git a/drivers/input/input-poller.c b/drivers/input/input-poller.c index 1ce83d6521bb..fa0c7089f3bb 100644 --- a/drivers/input/input-poller.c +++ b/drivers/input/input-poller.c @@ -71,7 +71,7 @@ int input_setup_polling(struct input_dev *dev, { struct input_dev_poller *poller; - poller = kzalloc(sizeof(*poller), GFP_KERNEL); + poller = kzalloc_obj(*poller, GFP_KERNEL); if (!poller) { /* * We want to show message even though kzalloc() may have diff --git a/drivers/input/input.c b/drivers/input/input.c index a500e1e276c2..9486a9ea1541 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -439,7 +439,7 @@ void input_alloc_absinfo(struct input_dev *dev) if (dev->absinfo) return; - dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo), GFP_KERNEL); + dev->absinfo = kzalloc_objs(*dev->absinfo, ABS_CNT, GFP_KERNEL); if (!dev->absinfo) { dev_err(dev->dev.parent ?: &dev->dev, "%s: unable to allocate memory\n", __func__); @@ -1887,7 +1887,7 @@ struct input_dev *input_allocate_device(void) static atomic_t input_no = ATOMIC_INIT(-1); struct input_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -1897,7 +1897,7 @@ struct input_dev *input_allocate_device(void) * when we register the device. */ dev->max_vals = 10; - dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL); + dev->vals = kzalloc_objs(*dev->vals, dev->max_vals, GFP_KERNEL); if (!dev->vals) { kfree(dev); return NULL; diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index ba2b17288bcd..5c773f94646f 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -261,7 +261,7 @@ static int joydev_open(struct inode *inode, struct file *file) struct joydev_client *client; int error; - client = kzalloc(sizeof(struct joydev_client), GFP_KERNEL); + client = kzalloc_obj(struct joydev_client, GFP_KERNEL); if (!client) return -ENOMEM; @@ -921,7 +921,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev, return error; } - joydev = kzalloc(sizeof(struct joydev), GFP_KERNEL); + joydev = kzalloc_obj(struct joydev, GFP_KERNEL); if (!joydev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c index 15182f16ed19..07bd0083d654 100644 --- a/drivers/input/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c @@ -249,7 +249,7 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - a3d = kzalloc(sizeof(*a3d), GFP_KERNEL); + a3d = kzalloc_obj(*a3d, GFP_KERNEL); input_dev = input_allocate_device(); if (!a3d || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c index 963250de24b7..fa7d0b80e7b7 100644 --- a/drivers/input/joystick/adi.c +++ b/drivers/input/joystick/adi.c @@ -456,7 +456,7 @@ static int adi_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index c709b58d770a..79ed2363b8e5 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -582,7 +582,7 @@ static int analog_connect(struct gameport *gameport, struct gameport_driver *drv int i; int err; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c index 49a0dfbbeb49..2d1a23866e64 100644 --- a/drivers/input/joystick/as5011.c +++ b/drivers/input/joystick/as5011.c @@ -237,7 +237,7 @@ static int as5011_probe(struct i2c_client *client) return -ENODEV; } - as5011 = kmalloc(sizeof(*as5011), GFP_KERNEL); + as5011 = kmalloc_obj(*as5011, GFP_KERNEL); input_dev = input_allocate_device(); if (!as5011 || !input_dev) { dev_err(&client->dev, diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c index 5a0ea3ad5efa..781cec6b2b24 100644 --- a/drivers/input/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c @@ -141,7 +141,7 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv) int i, j; int err; - cobra = kzalloc(sizeof(*cobra), GFP_KERNEL); + cobra = kzalloc_obj(*cobra, GFP_KERNEL); if (!cobra) return -ENOMEM; diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index d5c67a927404..165096fc0a55 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -585,7 +585,7 @@ static void db9_attach(struct parport *pp) return; } - db9 = kzalloc(sizeof(*db9), GFP_KERNEL); + db9 = kzalloc_obj(*db9, GFP_KERNEL); if (!db9) goto err_unreg_pardev; diff --git a/drivers/input/joystick/fsia6b.c b/drivers/input/joystick/fsia6b.c index 7e3bc99d766f..0bd7d4bd562a 100644 --- a/drivers/input/joystick/fsia6b.c +++ b/drivers/input/joystick/fsia6b.c @@ -132,7 +132,7 @@ static int fsia6b_serio_connect(struct serio *serio, struct serio_driver *drv) int i, j; int sw_id = 0; - fsia6b = kzalloc(sizeof(*fsia6b), GFP_KERNEL); + fsia6b = kzalloc_obj(*fsia6b, GFP_KERNEL); if (!fsia6b) return -ENOMEM; diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index ae95cb3d0ae9..03d0e491b688 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -291,7 +291,7 @@ static int gc_n64_init_ff(struct input_dev *dev, int i) struct gc_subdev *sdev; int err; - sdev = kmalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kmalloc_obj(*sdev, GFP_KERNEL); if (!sdev) return -ENOMEM; @@ -948,7 +948,7 @@ static void gc_attach(struct parport *pp) return; } - gc = kzalloc(sizeof(*gc), GFP_KERNEL); + gc = kzalloc_obj(*gc, GFP_KERNEL); if (!gc) { pr_err("Not enough memory\n"); goto err_unreg_pardev; diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index e7ff7bdb1a3a..23dc98146ccd 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c @@ -222,7 +222,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) unsigned char data[GF2K_LENGTH]; int i, err; - gf2k = kzalloc(sizeof(*gf2k), GFP_KERNEL); + gf2k = kzalloc_obj(*gf2k, GFP_KERNEL); input_dev = input_allocate_device(); if (!gf2k || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c index f339ce2b7a33..f500a32d1ea7 100644 --- a/drivers/input/joystick/grip.c +++ b/drivers/input/joystick/grip.c @@ -284,7 +284,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv) int i, j, t; int err; - grip = kzalloc(sizeof(*grip), GFP_KERNEL); + grip = kzalloc_obj(*grip, GFP_KERNEL); if (!grip) return -ENOMEM; diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 5eadb5a3ca37..7d90d8e5485b 100644 --- a/drivers/input/joystick/grip_mp.c +++ b/drivers/input/joystick/grip_mp.c @@ -632,7 +632,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv) struct grip_mp *grip; int err; - grip = kzalloc(sizeof(*grip), GFP_KERNEL); + grip = kzalloc_obj(*grip, GFP_KERNEL); if (!grip) return -ENOMEM; diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c index 1c5a76f72239..eb7faaf3f020 100644 --- a/drivers/input/joystick/guillemot.c +++ b/drivers/input/joystick/guillemot.c @@ -163,7 +163,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver * int i, t; int err; - guillemot = kzalloc(sizeof(*guillemot), GFP_KERNEL); + guillemot = kzalloc_obj(*guillemot, GFP_KERNEL); input_dev = input_allocate_device(); if (!guillemot || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index 75b85c46dfa4..0ca2f9bfb17b 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c @@ -185,7 +185,7 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) struct iforce_serio *iforce_serio; int err; - iforce_serio = kzalloc(sizeof(*iforce_serio), GFP_KERNEL); + iforce_serio = kzalloc_obj(*iforce_serio, GFP_KERNEL); if (!iforce_serio) return -ENOMEM; diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index 1f00f76b0174..b41d0b962e3d 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -207,7 +207,7 @@ static int iforce_usb_probe(struct usb_interface *intf, if (!usb_endpoint_is_int_out(epout)) return -ENODEV; - iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL); + iforce_usb = kzalloc_obj(*iforce_usb, GFP_KERNEL); if (!iforce_usb) goto fail; diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c index 262f022e5695..88aa77d1fc36 100644 --- a/drivers/input/joystick/interact.c +++ b/drivers/input/joystick/interact.c @@ -192,7 +192,7 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d int i, t; int err; - interact = kzalloc(sizeof(*interact), GFP_KERNEL); + interact = kzalloc_obj(*interact, GFP_KERNEL); input_dev = input_allocate_device(); if (!interact || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c index 865652a7821d..9feda59dccde 100644 --- a/drivers/input/joystick/joydump.c +++ b/drivers/input/joystick/joydump.c @@ -61,7 +61,7 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr timeout = gameport_time(gameport, 10000); /* 10 ms */ - buf = kmalloc_array(BUF_SIZE, sizeof(struct joydump), GFP_KERNEL); + buf = kmalloc_objs(struct joydump, BUF_SIZE, GFP_KERNEL); if (!buf) { printk(KERN_INFO "joydump: no memory for testing\n"); goto jd_end; diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c index 7622638e5bb8..3b7f5840caeb 100644 --- a/drivers/input/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c @@ -132,7 +132,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - magellan = kzalloc(sizeof(*magellan), GFP_KERNEL); + magellan = kzalloc_obj(*magellan, GFP_KERNEL); input_dev = input_allocate_device(); if (!magellan || !input_dev) goto fail1; diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 8b54f9b18e7c..2a811f302173 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -102,7 +102,7 @@ static int probe_maple_controller(struct device *dev) struct input_dev *idev; unsigned long data = be32_to_cpu(mdev->devinfo.function_data[0]); - pad = kzalloc(sizeof(*pad), GFP_KERNEL); + pad = kzalloc_obj(*pad, GFP_KERNEL); idev = input_allocate_device(); if (!pad || !idev) { error = -ENOMEM; diff --git a/drivers/input/joystick/n64joy.c b/drivers/input/joystick/n64joy.c index 94d2f4e96fe6..b4203825e9e6 100644 --- a/drivers/input/joystick/n64joy.c +++ b/drivers/input/joystick/n64joy.c @@ -243,7 +243,7 @@ static int __init n64joy_probe(struct platform_device *pdev) int err = 0; u32 i, j, found = 0; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; mutex_init(&priv->n64joy_mutex); diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 3a5873e5fcb3..645c822638ad 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -578,7 +578,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) comment[0] = 0; - sw = kzalloc(sizeof(*sw), GFP_KERNEL); + sw = kzalloc_obj(*sw, GFP_KERNEL); buf = kmalloc(SW_LENGTH, GFP_KERNEL); idbuf = kmalloc(SW_LENGTH, GFP_KERNEL); if (!sw || !buf || !idbuf) { diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index 4f2221001a95..d562275aa4bc 100644 --- a/drivers/input/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c @@ -199,7 +199,7 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv) if ((id = serio->id.id) > SPACEBALL_MAX_ID) return -ENODEV; - spaceball = kmalloc(sizeof(*spaceball), GFP_KERNEL); + spaceball = kmalloc_obj(*spaceball, GFP_KERNEL); input_dev = input_allocate_device(); if (!spaceball || !input_dev) goto fail1; diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index 7250d74d62a1..3aee84c19a25 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c @@ -147,7 +147,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - spaceorb = kzalloc(sizeof(*spaceorb), GFP_KERNEL); + spaceorb = kzalloc_obj(*spaceorb, GFP_KERNEL); input_dev = input_allocate_device(); if (!spaceorb || !input_dev) goto fail1; diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c index 1b24ea21aa30..81d4d1aa1752 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c @@ -118,7 +118,7 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - stinger = kmalloc(sizeof(*stinger), GFP_KERNEL); + stinger = kmalloc_obj(*stinger, GFP_KERNEL); input_dev = input_allocate_device(); if (!stinger || !input_dev) goto fail1; diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c index 514b1026e379..8d1367fdc400 100644 --- a/drivers/input/joystick/tmdc.c +++ b/drivers/input/joystick/tmdc.c @@ -264,7 +264,7 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data) int i, j, b = 0; int err; - tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL); + tmdc->port[idx] = port = kzalloc_obj(struct tmdc_port, GFP_KERNEL); input_dev = input_allocate_device(); if (!port || !input_dev) { err = -ENOMEM; @@ -348,7 +348,7 @@ static int tmdc_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - tmdc = kzalloc(sizeof(*tmdc), GFP_KERNEL); + tmdc = kzalloc_obj(*tmdc, GFP_KERNEL); if (!tmdc) return -ENOMEM; diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 5f69aef01791..90cddb12efbb 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -170,7 +170,7 @@ static void tgfx_attach(struct parport *pp) return; } - tgfx = kzalloc(sizeof(*tgfx), GFP_KERNEL); + tgfx = kzalloc_obj(*tgfx, GFP_KERNEL); if (!tgfx) { printk(KERN_ERR "turbografx.c: Not enough memory\n"); goto err_unreg_pardev; diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c index ab99d76e5d8d..e8f81d3a4d99 100644 --- a/drivers/input/joystick/twidjoy.c +++ b/drivers/input/joystick/twidjoy.c @@ -171,7 +171,7 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - twidjoy = kzalloc(sizeof(*twidjoy), GFP_KERNEL); + twidjoy = kzalloc_obj(*twidjoy, GFP_KERNEL); input_dev = input_allocate_device(); if (!twidjoy || !input_dev) goto fail1; diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index ebeab441e9ec..45027058a777 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c @@ -124,7 +124,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - warrior = kzalloc(sizeof(*warrior), GFP_KERNEL); + warrior = kzalloc_obj(*warrior, GFP_KERNEL); input_dev = input_allocate_device(); if (!warrior || !input_dev) goto fail1; diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 363d50949386..58ff39dee70c 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1744,7 +1744,7 @@ static int xpad_led_probe(struct usb_xpad *xpad) if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX360W) return 0; - xpad->led = led = kzalloc(sizeof(*led), GFP_KERNEL); + xpad->led = led = kzalloc_obj(*led, GFP_KERNEL); if (!led) return -ENOMEM; @@ -2077,7 +2077,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id break; } - xpad = kzalloc(sizeof(*xpad), GFP_KERNEL); + xpad = kzalloc_obj(*xpad, GFP_KERNEL); if (!xpad) return -ENOMEM; diff --git a/drivers/input/joystick/zhenhua.c b/drivers/input/joystick/zhenhua.c index cc0e2a77ac5e..873e71fe6580 100644 --- a/drivers/input/joystick/zhenhua.c +++ b/drivers/input/joystick/zhenhua.c @@ -131,7 +131,7 @@ static int zhenhua_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - zhenhua = kzalloc(sizeof(*zhenhua), GFP_KERNEL); + zhenhua = kzalloc_obj(*zhenhua, GFP_KERNEL); input_dev = input_allocate_device(); if (!zhenhua || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 422e28ad1e8e..f149ed800a45 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -1277,7 +1277,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *dev; int err = -ENOMEM; - atkbd = kzalloc(sizeof(*atkbd), GFP_KERNEL); + atkbd = kzalloc_obj(*atkbd, GFP_KERNEL); dev = input_allocate_device(); if (!atkbd || !dev) goto fail1; diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index 54afb38601b9..8f246865a5ee 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@ -447,7 +447,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv) uint8_t did, *idd; int error; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index 2f130f819363..f0daee8887cb 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c @@ -608,7 +608,7 @@ static int lkkbd_connect(struct serio *serio, struct serio_driver *drv) int i; int err; - lk = kzalloc(sizeof(*lk), GFP_KERNEL); + lk = kzalloc_obj(*lk, GFP_KERNEL); input_dev = input_allocate_device(); if (!lk || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index 58d4f2096cf9..b6b9354b3354 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -224,7 +224,7 @@ static int locomokbd_probe(struct locomo_dev *dev) struct input_dev *input_dev; int i, err; - locomokbd = kzalloc(sizeof(*locomokbd), GFP_KERNEL); + locomokbd = kzalloc_obj(*locomokbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!locomokbd || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 1a8f1fa53fbb..52dfdcab55f2 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -151,7 +151,7 @@ static int probe_maple_kbd(struct device *dev) mdev = to_maple_dev(dev); mdrv = to_maple_driver(dev->driver); - kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); + kbd = kzalloc_obj(*kbd, GFP_KERNEL); if (!kbd) { error = -ENOMEM; goto fail; diff --git a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c index 71e0a3f830dd..ee142a2d7c84 100644 --- a/drivers/input/keyboard/newtonkbd.c +++ b/drivers/input/keyboard/newtonkbd.c @@ -68,7 +68,7 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - nkbd = kzalloc(sizeof(*nkbd), GFP_KERNEL); + nkbd = kzalloc_obj(*nkbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!nkbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 9e13f3f70a81..8fd909407ec8 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -193,7 +193,7 @@ static int omap_kp_probe(struct platform_device *pdev) row_shift = get_count_order(pdata->cols); keycodemax = pdata->rows << row_shift; - omap_kp = kzalloc(struct_size(omap_kp, keymap, keycodemax), GFP_KERNEL); + omap_kp = kzalloc_flex(*omap_kp, keymap, keycodemax, GFP_KERNEL); input_dev = input_allocate_device(); if (!omap_kp || !input_dev) { kfree(omap_kp); diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 159f41eedd41..7ad799efc539 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -184,7 +184,7 @@ static int sh_keysc_probe(struct platform_device *pdev) if (irq < 0) goto err0; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); error = -ENOMEM; diff --git a/drivers/input/keyboard/stowaway.c b/drivers/input/keyboard/stowaway.c index 7ef0b3f4f549..592801876291 100644 --- a/drivers/input/keyboard/stowaway.c +++ b/drivers/input/keyboard/stowaway.c @@ -72,7 +72,7 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - skbd = kzalloc(sizeof(*skbd), GFP_KERNEL); + skbd = kzalloc_obj(*skbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!skbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index 3299e1919b37..d2783e9a5583 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c @@ -262,7 +262,7 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - sunkbd = kzalloc(sizeof(*sunkbd), GFP_KERNEL); + sunkbd = kzalloc_obj(*sunkbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!sunkbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c index befa713268ae..ce061bd76623 100644 --- a/drivers/input/keyboard/xtkbd.c +++ b/drivers/input/keyboard/xtkbd.c @@ -70,7 +70,7 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - xtkbd = kmalloc(sizeof(*xtkbd), GFP_KERNEL); + xtkbd = kmalloc_obj(*xtkbd, GFP_KERNEL); input_dev = input_allocate_device(); if (!xtkbd || !input_dev) goto fail1; diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c index 9159b5fec129..32d2f4450b7c 100644 --- a/drivers/input/misc/88pm80x_onkey.c +++ b/drivers/input/misc/88pm80x_onkey.c @@ -57,7 +57,7 @@ static int pm80x_onkey_probe(struct platform_device *pdev) struct pm80x_onkey_info *info; int err; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index e84649af801d..faa03c0b8c92 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c @@ -772,7 +772,7 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d if (alt->desc.bInterfaceNumber) return -ENODEV; - ar2 = kzalloc(sizeof (struct ati_remote2), GFP_KERNEL); + ar2 = kzalloc_obj(struct ati_remote2, GFP_KERNEL); if (!ar2) return -ENOMEM; diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 0cfe5d4a573c..3fbdd160fb2c 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -696,7 +696,7 @@ static int cm109_usb_probe(struct usb_interface *intf, if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -721,7 +721,7 @@ static int cm109_usb_probe(struct usb_interface *intf, if (!dev->ctl_data) goto err_out; - dev->ctl_req = kmalloc(sizeof(*(dev->ctl_req)), GFP_KERNEL); + dev->ctl_req = kmalloc_obj(*(dev->ctl_req), GFP_KERNEL); if (!dev->ctl_req) goto err_out; diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c index b4232b0a3957..b5047f74f632 100644 --- a/drivers/input/misc/cma3000_d0x.c +++ b/drivers/input/misc/cma3000_d0x.c @@ -285,7 +285,7 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq, goto err_out; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); input_dev = input_allocate_device(); if (!data || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/misc/cs40l50-vibra.c b/drivers/input/misc/cs40l50-vibra.c index 90410025bbae..e6c8c9d165d3 100644 --- a/drivers/input/misc/cs40l50-vibra.c +++ b/drivers/input/misc/cs40l50-vibra.c @@ -276,7 +276,7 @@ static void cs40l50_add_worker(struct work_struct *work) /* Update effect if already uploaded, otherwise create new effect */ effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head); if (!effect) { - effect = kzalloc(sizeof(*effect), GFP_KERNEL); + effect = kzalloc_obj(*effect, GFP_KERNEL); if (!effect) { error = -ENOMEM; goto err_pm; @@ -392,7 +392,7 @@ static int cs40l50_playback(struct input_dev *dev, int effect_id, int val) struct cs40l50_vibra *vib = input_get_drvdata(dev); struct cs40l50_work *work_data; - work_data = kzalloc(sizeof(*work_data), GFP_ATOMIC); + work_data = kzalloc_obj(*work_data, GFP_ATOMIC); if (!work_data) return -ENOMEM; diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c index cc23625019e3..49112b3ff445 100644 --- a/drivers/input/misc/da9052_onkey.c +++ b/drivers/input/misc/da9052_onkey.c @@ -80,7 +80,7 @@ static int da9052_onkey_probe(struct platform_device *pdev) return -EINVAL; } - onkey = kzalloc(sizeof(*onkey), GFP_KERNEL); + onkey = kzalloc_obj(*onkey, GFP_KERNEL); input_dev = input_allocate_device(); if (!onkey || !input_dev) { dev_err(&pdev->dev, "Failed to allocate memory\n"); diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 4581f1c53644..52ad6e3a8112 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -286,7 +286,7 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu) struct input_dev *input; int error; - gamepad = kzalloc(sizeof(*gamepad), GFP_KERNEL); + gamepad = kzalloc_obj(*gamepad, GFP_KERNEL); input = input_allocate_device(); if (!gamepad || !input) { dev_err(pcu->dev, @@ -1991,7 +1991,7 @@ static int ims_pcu_probe(struct usb_interface *intf, struct ims_pcu *pcu; int error; - pcu = kzalloc(sizeof(*pcu), GFP_KERNEL); + pcu = kzalloc_obj(*pcu, GFP_KERNEL); if (!pcu) return -ENOMEM; diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index bee4b1376491..219a7a92e5b6 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -453,7 +453,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic if (!endpoint) return -ENODEV; - remote = kzalloc(sizeof(*remote), GFP_KERNEL); + remote = kzalloc_obj(*remote, GFP_KERNEL); input_dev = input_allocate_device(); if (!remote || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index d5e051a25a74..290c03d8b972 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -247,7 +247,7 @@ static int max8997_haptic_probe(struct platform_device *pdev) return -EINVAL; } - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); input_dev = input_allocate_device(); if (!chip || !input_dev) { dev_err(&pdev->dev, "unable to allocate memory\n"); diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c index b83d762ae2e9..d75af824033a 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c @@ -108,7 +108,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev) return -ENOMEM; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { err = -ENOMEM; dev_dbg(&pdev->dev, "Can't allocate power button\n"); diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c index d9c5aae143dc..c1608cdee7f2 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -164,7 +164,7 @@ static int palmas_pwron_probe(struct platform_device *pdev) palmas_pwron_params_ofinit(dev, &config); - pwron = kzalloc(sizeof(*pwron), GFP_KERNEL); + pwron = kzalloc_obj(*pwron, GFP_KERNEL); if (!pwron) return -ENOMEM; diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c index fe43fd72ba7b..003bc50f83a6 100644 --- a/drivers/input/misc/pcap_keys.c +++ b/drivers/input/misc/pcap_keys.c @@ -49,7 +49,7 @@ static int pcap_keys_probe(struct platform_device *pdev) struct pcap_keys *pcap_keys; struct input_dev *input_dev; - pcap_keys = kmalloc(sizeof(*pcap_keys), GFP_KERNEL); + pcap_keys = kmalloc_obj(*pcap_keys, GFP_KERNEL); if (!pcap_keys) return err; diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index 3632cb206e34..bcef6a251237 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c @@ -91,7 +91,7 @@ static int pcf8574_kp_probe(struct i2c_client *client) return -ENODEV; } - lp = kzalloc(sizeof(*lp), GFP_KERNEL); + lp = kzalloc_obj(*lp, GFP_KERNEL); if (!lp) return -ENOMEM; diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index ecb92ee5ebbc..dfcab914d5f3 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c @@ -275,7 +275,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev if (!pm->data) return -1; - pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL); + pm->configcr = kmalloc_obj(*(pm->configcr), GFP_KERNEL); if (!pm->configcr) return -ENOMEM; @@ -313,7 +313,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i 0, interface->desc.bInterfaceNumber, NULL, 0, USB_CTRL_SET_TIMEOUT); - pm = kzalloc(sizeof(*pm), GFP_KERNEL); + pm = kzalloc_obj(*pm, GFP_KERNEL); input_dev = input_allocate_device(); if (!pm || !input_dev) goto fail1; diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 13336a2fd49c..f34bda9b1a74 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -379,7 +379,7 @@ static int uinput_open(struct inode *inode, struct file *file) { struct uinput_device *newdev; - newdev = kzalloc(sizeof(*newdev), GFP_KERNEL); + newdev = kzalloc_obj(*newdev, GFP_KERNEL); if (!newdev) return -ENOMEM; diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 67f1c7364c95..b046df24a433 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c @@ -205,7 +205,7 @@ static int xenkbd_probe(struct xenbus_device *dev, struct xenkbd_info *info; struct input_dev *kbd, *ptr, *mtouch; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 08dc53ae1b3c..10a85f60f6d1 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c @@ -831,7 +831,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - yld = kzalloc(sizeof(*yld), GFP_KERNEL); + yld = kzalloc_obj(*yld, GFP_KERNEL); if (!yld) return -ENOMEM; @@ -854,7 +854,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!yld->ctl_data) return usb_cleanup(yld, -ENOMEM); - yld->ctl_req = kmalloc(sizeof(*(yld->ctl_req)), GFP_KERNEL); + yld->ctl_req = kmalloc_obj(*(yld->ctl_req), GFP_KERNEL); if (yld->ctl_req == NULL) return usb_cleanup(yld, -ENOMEM); diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index df8953a5196e..700dad83f6d0 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -3206,7 +3206,7 @@ int alps_detect(struct psmouse *psmouse, bool set_properties) */ psmouse_reset(psmouse); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 3ce63fb35992..f9b8a4aa24e3 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -852,7 +852,7 @@ static int atp_probe(struct usb_interface *iface, } /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "Out of memory\n"); diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index dfdfb59cc8b5..a193dc4f8b09 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -895,7 +895,7 @@ static int bcm5974_probe(struct usb_interface *iface, cfg = bcm5974_get_config(udev); /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "out of memory\n"); diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c index 7f85c7ab68c5..ec9306e15a07 100644 --- a/drivers/input/mouse/byd.c +++ b/drivers/input/mouse/byd.c @@ -469,7 +469,7 @@ int byd_init(struct psmouse *psmouse) if (byd_reset_touchpad(psmouse)) return -EIO; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index 9446657a5f35..e96b838afcf7 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -624,7 +624,7 @@ int cypress_init(struct psmouse *psmouse) struct cytp_data *cytp; int error; - cytp = kzalloc(sizeof(*cytp), GFP_KERNEL); + cytp = kzalloc_obj(*cytp, GFP_KERNEL); if (!cytp) return -ENOMEM; diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 79ad98cc1e79..c7f510fcb04f 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -2074,7 +2074,7 @@ static int elantech_setup_ps2(struct psmouse *psmouse, int error = -EINVAL; struct input_dev *tp_dev; - psmouse->private = etd = kzalloc(sizeof(*etd), GFP_KERNEL); + psmouse->private = etd = kzalloc_obj(*etd, GFP_KERNEL); if (!etd) return -ENOMEM; diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c index 356b99d48544..1e8e3f166b47 100644 --- a/drivers/input/mouse/focaltech.c +++ b/drivers/input/mouse/focaltech.c @@ -408,7 +408,7 @@ int focaltech_init(struct psmouse *psmouse) struct focaltech_data *priv; int error; - psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index 6125652e5ad8..23840c8fba32 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c @@ -981,7 +981,7 @@ int hgpk_init(struct psmouse *psmouse) struct hgpk_data *priv; int err; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { err = -ENOMEM; goto alloc_fail; diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 283ef46f039f..6af7153e9dc7 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -273,7 +273,7 @@ static int lifebook_create_relative_device(struct psmouse *psmouse) struct lifebook_data *priv; int error = -ENOMEM; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); dev2 = input_allocate_device(); if (!priv || !dev2) goto err_out; diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index baef4be14b54..ca4901eb7717 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -73,7 +73,7 @@ static int probe_maple_mouse(struct device *dev) struct input_dev *input_dev; struct dc_mouse *mse; - mse = kzalloc(sizeof(*mse), GFP_KERNEL); + mse = kzalloc_obj(*mse, GFP_KERNEL); if (!mse) { error = -ENOMEM; goto fail; diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 77ea7da3b1c5..46907609d3d4 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1591,7 +1591,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) psmouse_deactivate(parent); } - psmouse = kzalloc(sizeof(*psmouse), GFP_KERNEL); + psmouse = kzalloc_obj(*psmouse, GFP_KERNEL); input_dev = input_allocate_device(); if (!psmouse || !input_dev) goto err_free; diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c index 15bd49ccad22..96df86872017 100644 --- a/drivers/input/mouse/psmouse-smbus.c +++ b/drivers/input/mouse/psmouse-smbus.c @@ -154,7 +154,7 @@ static void psmouse_smbus_schedule_remove(struct i2c_client *client) { struct psmouse_smbus_removal_work *rwork; - rwork = kzalloc(sizeof(*rwork), GFP_KERNEL); + rwork = kzalloc_obj(*rwork, GFP_KERNEL); if (rwork) { INIT_WORK(&rwork->work, psmouse_smbus_remove_i2c_device); rwork->client = client; diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 44b136fc29aa..4d1fc22f9732 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c @@ -1028,7 +1028,7 @@ int fsp_init(struct psmouse *psmouse) "Finger Sensing Pad, hw: %d.%d.%d, sn: %x, sw: %s\n", ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver); - psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index 218c8432a13b..c38779fcff72 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c @@ -231,7 +231,7 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv) unsigned char c = serio->id.extra; int err = -ENOMEM; - sermouse = kzalloc(sizeof(*sermouse), GFP_KERNEL); + sermouse = kzalloc_obj(*sermouse, GFP_KERNEL); input_dev = input_allocate_device(); if (!sermouse || !input_dev) goto fail1; diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index c5c88a75a019..b9dfcdbefaed 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -741,7 +741,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) { struct serio *serio; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) { psmouse_err(psmouse, "not enough memory for pass-through port\n"); @@ -1597,7 +1597,7 @@ static int synaptics_init_ps2(struct psmouse *psmouse, synaptics_apply_quirks(psmouse, info); - psmouse->private = priv = kzalloc(sizeof(*priv), GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/synaptics_usb.c b/drivers/input/mouse/synaptics_usb.c index 75e45f3ae675..296de386fafe 100644 --- a/drivers/input/mouse/synaptics_usb.c +++ b/drivers/input/mouse/synaptics_usb.c @@ -311,7 +311,7 @@ static int synusb_probe(struct usb_interface *intf, if (!ep) return -ENODEV; - synusb = kzalloc(sizeof(*synusb), GFP_KERNEL); + synusb = kzalloc_obj(*synusb, GFP_KERNEL); input_dev = input_allocate_device(); if (!synusb || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 5f6643b69a2c..c2b2cd057ca3 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -409,7 +409,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) if (!set_properties) return 0; - tp = kzalloc(sizeof(*tp), GFP_KERNEL); + tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) return -ENOMEM; diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index fb1d986a6895..eda8f9192423 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c @@ -409,7 +409,7 @@ int vmmouse_init(struct psmouse *psmouse) if (error) return error; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); abs_dev = input_allocate_device(); if (!priv || !abs_dev) { error = -ENOMEM; diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 707cd28f4ba6..4556c5232a82 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c @@ -456,7 +456,7 @@ static int vsxxxaa_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - mouse = kzalloc(sizeof(*mouse), GFP_KERNEL); + mouse = kzalloc_obj(*mouse, GFP_KERNEL); input_dev = input_allocate_device(); if (!mouse || !input_dev) goto fail1; diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 505c562a5daa..0b842077a7b4 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -543,7 +543,7 @@ static int mousedev_open(struct inode *inode, struct file *file) #endif mousedev = container_of(inode->i_cdev, struct mousedev, cdev); - client = kzalloc(sizeof(struct mousedev_client), GFP_KERNEL); + client = kzalloc_obj(struct mousedev_client, GFP_KERNEL); if (!client) return -ENOMEM; @@ -853,7 +853,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev, goto err_out; } - mousedev = kzalloc(sizeof(struct mousedev), GFP_KERNEL); + mousedev = kzalloc_obj(struct mousedev, GFP_KERNEL); if (!mousedev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index b85ee9db87b0..0e2bb94e67cc 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c @@ -78,7 +78,7 @@ int rmi_register_transport_device(struct rmi_transport_dev *xport) struct rmi_device *rmi_dev; int error; - rmi_dev = kzalloc(sizeof(struct rmi_device), GFP_KERNEL); + rmi_dev = kzalloc_obj(struct rmi_device, GFP_KERNEL); if (!rmi_dev) return -ENOMEM; diff --git a/drivers/input/rmi4/rmi_f03.c b/drivers/input/rmi4/rmi_f03.c index e1157ff0f00a..1c7be2d9df42 100644 --- a/drivers/input/rmi4/rmi_f03.c +++ b/drivers/input/rmi4/rmi_f03.c @@ -171,7 +171,7 @@ static int rmi_f03_register_pt(struct f03_data *f03) { struct serio *serio; - serio = kzalloc(sizeof(struct serio), GFP_KERNEL); + serio = kzalloc_obj(struct serio, GFP_KERNEL); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index 761aaaa3e571..b2f5fec9290c 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c @@ -100,7 +100,7 @@ static int altera_ps2_probe(struct platform_device *pdev) return error; } - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index de4b3915c37d..5a4ef62fa3d3 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c @@ -114,8 +114,8 @@ static int amba_kmi_probe(struct amba_device *dev, if (ret) return ret; - kmi = kzalloc(sizeof(*kmi), GFP_KERNEL); - io = kzalloc(sizeof(*io), GFP_KERNEL); + kmi = kzalloc_obj(*kmi, GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!kmi || !io) { ret = -ENOMEM; goto out; diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 81b3a053df81..206e6dc3f502 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c @@ -150,7 +150,7 @@ static int ams_delta_serio_init(struct platform_device *pdev) return err; } - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index a5fbb27088be..5828a4e9fe82 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -165,7 +165,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) /* Set reload register to core freq in kHz/10 */ iowrite32be(freq_hz / 10000, &priv->regs->reload); - priv->io = kzalloc(sizeof(*priv->io), GFP_KERNEL); + priv->io = kzalloc_obj(*priv->io, GFP_KERNEL); if (!priv->io) return -ENOMEM; diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index 29095d8804d2..bce8d6308f8d 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -155,7 +155,7 @@ static int arc_ps2_create_port(struct platform_device *pdev, struct arc_ps2_port *port = &arc_ps2->port[index]; struct serio *io; - io = kzalloc(sizeof(*io), GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!io) return -ENOMEM; diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 053a15988c45..3a7424bdf877 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c @@ -158,7 +158,7 @@ static int __init ct82c710_detect(void) static int ct82c710_probe(struct platform_device *dev) { - ct82c710_port = kzalloc(sizeof(*ct82c710_port), GFP_KERNEL); + ct82c710_port = kzalloc_obj(*ct82c710_port, GFP_KERNEL); if (!ct82c710_port) return -ENOMEM; diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 9c6ff04c46cf..59c242f97fd3 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -350,8 +350,8 @@ static int __init gscps2_probe(struct parisc_device *dev) if (dev->id.sversion == 0x96) hpa += GSC_DINO_OFFSET; - ps2port = kzalloc(sizeof(*ps2port), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + ps2port = kzalloc_obj(*ps2port, GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!ps2port || !serio) { ret = -ENOMEM; goto fail_nomem; diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index 3fedfc5abc73..f56252d6df5b 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -939,7 +939,7 @@ int hil_mlc_register(hil_mlc *mlc) for (i = 0; i < HIL_MLC_DEVMEM; i++) { struct serio *mlc_serio; hil_mlc_copy_di_scratch(mlc, i); - mlc_serio = kzalloc(sizeof(*mlc_serio), GFP_KERNEL); + mlc_serio = kzalloc_obj(*mlc_serio, GFP_KERNEL); mlc->serio[i] = mlc_serio; if (!mlc->serio[i]) { for (; i >= 0; i--) diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c index 0ee7505427ac..7cbf726b47a7 100644 --- a/drivers/input/serio/hyperv-keyboard.c +++ b/drivers/input/serio/hyperv-keyboard.c @@ -316,8 +316,8 @@ static int hv_kbd_probe(struct hv_device *hv_dev, struct serio *hv_serio; int error; - kbd_dev = kzalloc(sizeof(*kbd_dev), GFP_KERNEL); - hv_serio = kzalloc(sizeof(*hv_serio), GFP_KERNEL); + kbd_dev = kzalloc_obj(*kbd_dev, GFP_KERNEL); + hv_serio = kzalloc_obj(*hv_serio, GFP_KERNEL); if (!kbd_dev || !hv_serio) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index c135254665b6..1a5a7f2f0214 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -1324,7 +1324,7 @@ static int i8042_create_kbd_port(void) struct serio *serio; struct i8042_port *port = &i8042_ports[I8042_KBD_PORT_NO]; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; @@ -1354,7 +1354,7 @@ static int i8042_create_aux_port(int idx) int port_no = idx < 0 ? I8042_AUX_PORT_NO : I8042_MUX_PORT_NO + idx; struct i8042_port *port = &i8042_ports[port_no]; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/ioc3kbd.c b/drivers/input/serio/ioc3kbd.c index d2c7ffb9a946..650758115bf0 100644 --- a/drivers/input/serio/ioc3kbd.c +++ b/drivers/input/serio/ioc3kbd.c @@ -139,11 +139,11 @@ static int ioc3kbd_probe(struct platform_device *pdev) if (!d) return -ENOMEM; - sk = kzalloc(sizeof(*sk), GFP_KERNEL); + sk = kzalloc_obj(*sk, GFP_KERNEL); if (!sk) return -ENOMEM; - sa = kzalloc(sizeof(*sa), GFP_KERNEL); + sa = kzalloc_obj(*sa, GFP_KERNEL); if (!sa) { kfree(sk); return -ENOMEM; diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c index 3d28a5cddd61..dda52b7d2c1d 100644 --- a/drivers/input/serio/maceps2.c +++ b/drivers/input/serio/maceps2.c @@ -117,7 +117,7 @@ static struct serio *maceps2_allocate_port(int idx) { struct serio *serio; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (serio) { serio->id.type = SERIO_8042; serio->write = maceps2_write; diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index c07fb8a1799d..14c235b0b4e4 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c @@ -188,7 +188,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) return priv->irq; /* KEYBOARD */ - kb_serio = kzalloc(sizeof(*kb_serio), GFP_KERNEL); + kb_serio = kzalloc_obj(*kb_serio, GFP_KERNEL); if (!kb_serio) return -ENOMEM; kb_serio->id.type = SERIO_8042_XL; @@ -203,7 +203,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) serio_register_port(kb_serio); /* TOUCHPAD */ - pad_serio = kzalloc(sizeof(*pad_serio), GFP_KERNEL); + pad_serio = kzalloc_obj(*pad_serio, GFP_KERNEL); if (!pad_serio) { error = -ENOMEM; goto err_pad; diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c index 22fe55490572..a4b830b499f6 100644 --- a/drivers/input/serio/parkbd.c +++ b/drivers/input/serio/parkbd.c @@ -165,7 +165,7 @@ static struct serio *parkbd_allocate_serio(void) { struct serio *serio; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (serio) { serio->id.type = parkbd_mode; serio->write = parkbd_write; diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index 6b9abb2e18c9..9e5d022fa502 100644 --- a/drivers/input/serio/pcips2.c +++ b/drivers/input/serio/pcips2.c @@ -137,8 +137,8 @@ static int pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id) if (ret) goto disable; - ps2if = kzalloc(sizeof(*ps2if), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + ps2if = kzalloc_obj(*ps2if, GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!ps2if || !serio) { ret = -ENOMEM; goto release; diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index 46fb7667b244..a52ce59952a9 100644 --- a/drivers/input/serio/ps2-gpio.c +++ b/drivers/input/serio/ps2-gpio.c @@ -405,7 +405,7 @@ static int ps2_gpio_probe(struct platform_device *pdev) int error; drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!drvdata || !serio) { error = -ENOMEM; goto err_free_serio; diff --git a/drivers/input/serio/ps2mult.c b/drivers/input/serio/ps2mult.c index b96cee52fc52..e0462ac3aa1d 100644 --- a/drivers/input/serio/ps2mult.c +++ b/drivers/input/serio/ps2mult.c @@ -122,7 +122,7 @@ static int ps2mult_create_port(struct ps2mult *psm, int i) struct serio *mx_serio = psm->mx_serio; struct serio *serio; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; @@ -160,7 +160,7 @@ static int ps2mult_connect(struct serio *serio, struct serio_driver *drv) if (!serio->write) return -EINVAL; - psm = kzalloc(sizeof(*psm), GFP_KERNEL); + psm = kzalloc_obj(*psm, GFP_KERNEL); if (!psm) return -ENOMEM; diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index ae55c4de092f..55c254fbdb24 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c @@ -102,8 +102,8 @@ static int q40kbd_probe(struct platform_device *pdev) struct serio *port; int error; - q40kbd = kzalloc(sizeof(*q40kbd), GFP_KERNEL); - port = kzalloc(sizeof(*port), GFP_KERNEL); + q40kbd = kzalloc_obj(*q40kbd, GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!q40kbd || !port) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index c65c552b0c45..c097716da53e 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c @@ -108,8 +108,8 @@ static int rpckbd_probe(struct platform_device *dev) if (tx_irq < 0) return tx_irq; - serio = kzalloc(sizeof(*serio), GFP_KERNEL); - rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); + rpckbd = kzalloc_obj(*rpckbd, GFP_KERNEL); if (!serio || !rpckbd) { kfree(rpckbd); kfree(serio); diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c index 375c6f5f905c..32752d898797 100644 --- a/drivers/input/serio/sa1111ps2.c +++ b/drivers/input/serio/sa1111ps2.c @@ -254,8 +254,8 @@ static int ps2_probe(struct sa1111_dev *dev) struct serio *serio; int ret; - ps2if = kzalloc(sizeof(*ps2if), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + ps2if = kzalloc_obj(*ps2if, GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!ps2if || !serio) { ret = -ENOMEM; goto free; diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 2b5ddc5dac19..54dd26249b02 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -244,7 +244,7 @@ static int serio_queue_event(void *object, struct module *owner, } } - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) { pr_err("Not enough memory to queue event %d\n", event_type); return -ENOMEM; diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 4d6395088986..70df54435a94 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -270,7 +270,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) struct serio_raw *serio_raw; int err; - serio_raw = kzalloc(sizeof(*serio_raw), GFP_KERNEL); + serio_raw = kzalloc_obj(*serio_raw, GFP_KERNEL); if (!serio_raw) { dev_dbg(&serio->dev, "can't allocate memory for a device\n"); return -ENOMEM; diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 74ac88796187..46087c02c340 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c @@ -78,7 +78,7 @@ static int serport_ldisc_open(struct tty_struct *tty) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - serport = kzalloc(sizeof(*serport), GFP_KERNEL); + serport = kzalloc_obj(*serport, GFP_KERNEL); if (!serport) return -ENOMEM; @@ -159,7 +159,7 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, if (test_and_set_bit(SERPORT_BUSY, &serport->flags)) return -EBUSY; - serport->serio = serio = kzalloc(sizeof(*serio), GFP_KERNEL); + serport->serio = serio = kzalloc_obj(*serio, GFP_KERNEL); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index 524929ce1cae..5b46c66b2100 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -209,8 +209,8 @@ static int sun4i_ps2_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int error; - drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + drvdata = kzalloc_obj(*drvdata, GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!drvdata || !serio) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/userio.c b/drivers/input/serio/userio.c index 7f627b08055e..3bdb17b4dd25 100644 --- a/drivers/input/serio/userio.c +++ b/drivers/input/serio/userio.c @@ -73,7 +73,7 @@ static int userio_device_write(struct serio *id, unsigned char val) static int userio_char_open(struct inode *inode, struct file *file) { struct userio_device *userio __free(kfree) = - kzalloc(sizeof(*userio), GFP_KERNEL); + kzalloc_obj(*userio, GFP_KERNEL); if (!userio) return -ENOMEM; @@ -81,7 +81,7 @@ static int userio_char_open(struct inode *inode, struct file *file) spin_lock_init(&userio->buf_lock); init_waitqueue_head(&userio->waitq); - userio->serio = kzalloc(sizeof(*userio->serio), GFP_KERNEL); + userio->serio = kzalloc_obj(*userio->serio, GFP_KERNEL); if (!userio->serio) return -ENOMEM; diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index 01433f0b48f1..0c9ddc532c31 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c @@ -247,8 +247,8 @@ static int xps2_of_probe(struct platform_device *ofdev) return -ENODEV; } - drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); - serio = kzalloc(sizeof(*serio), GFP_KERNEL); + drvdata = kzalloc_obj(*drvdata, GFP_KERNEL); + serio = kzalloc_obj(*serio, GFP_KERNEL); if (!drvdata || !serio) { error = -ENOMEM; goto failed1; diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index 0ac16f32b31f..6f39938d5bbc 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c @@ -129,7 +129,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - acecad = kzalloc(sizeof(*acecad), GFP_KERNEL); + acecad = kzalloc_obj(*acecad, GFP_KERNEL); input_dev = input_allocate_device(); if (!acecad || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 2b3fbb0455d5..df9ed01dcdb3 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -1673,7 +1673,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) */ speeds[0] = programmableDelay; - aiptek = kzalloc(sizeof(*aiptek), GFP_KERNEL); + aiptek = kzalloc_obj(*aiptek, GFP_KERNEL); inputdev = input_allocate_device(); if (!aiptek || !inputdev) { dev_warn(&intf->dev, diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c index 42c1e5eaddd5..264cb9c6e807 100644 --- a/drivers/input/tablet/hanwang.c +++ b/drivers/input/tablet/hanwang.c @@ -322,7 +322,7 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id if (intf->cur_altsetting->desc.bNumEndpoints < 1) return -ENODEV; - hanwang = kzalloc(sizeof(*hanwang), GFP_KERNEL); + hanwang = kzalloc_obj(*hanwang, GFP_KERNEL); input_dev = input_allocate_device(); if (!hanwang || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 794caa102909..658cf6c144bb 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -121,7 +121,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - kbtab = kzalloc(sizeof(*kbtab), GFP_KERNEL); + kbtab = kzalloc_obj(*kbtab, GFP_KERNEL); input_dev = input_allocate_device(); if (!kbtab || !input_dev) goto fail1; diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c index eabb4a0b8a0d..8ba71855421b 100644 --- a/drivers/input/tablet/pegasus_notetaker.c +++ b/drivers/input/tablet/pegasus_notetaker.c @@ -293,7 +293,7 @@ static int pegasus_probe(struct usb_interface *intf, endpoint = &intf->cur_altsetting->endpoint[0].desc; - pegasus = kzalloc(sizeof(*pegasus), GFP_KERNEL); + pegasus = kzalloc_obj(*pegasus, GFP_KERNEL); input_dev = input_allocate_device(); if (!pegasus || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/tablet/wacom_serial4.c b/drivers/input/tablet/wacom_serial4.c index cf7cea77dabc..218eb157288b 100644 --- a/drivers/input/tablet/wacom_serial4.c +++ b/drivers/input/tablet/wacom_serial4.c @@ -521,7 +521,7 @@ static int wacom_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - wacom = kzalloc(sizeof(*wacom), GFP_KERNEL); + wacom = kzalloc_obj(*wacom, GFP_KERNEL); input_dev = input_allocate_device(); if (!wacom || !input_dev) goto free_device; diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index c9aa1847265a..404a4b7f4021 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -201,7 +201,7 @@ static int ad7877_read(struct spi_device *spi, u16 reg) struct ser_req *req; int status, ret; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -232,7 +232,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val) struct ser_req *req; int status; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -259,7 +259,7 @@ static int ad7877_read_adc(struct spi_device *spi, unsigned command) int sample; int i; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 67264c5b49cb..656e907bc13d 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -357,7 +357,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) struct ser_req *req; int status; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -442,7 +442,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command) struct ads7845_ser_req *req; int status; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index c2d3252f8466..ab36ecf2ab3b 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c @@ -232,7 +232,7 @@ static int da9052_ts_probe(struct platform_device *pdev) if (!da9052) return -EINVAL; - tsi = kzalloc(sizeof(*tsi), GFP_KERNEL); + tsi = kzalloc_obj(*tsi, GFP_KERNEL); input_dev = input_allocate_device(); if (!tsi || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/dynapro.c b/drivers/input/touchscreen/dynapro.c index 998d5ca8071e..6d9a25269639 100644 --- a/drivers/input/touchscreen/dynapro.c +++ b/drivers/input/touchscreen/dynapro.c @@ -110,7 +110,7 @@ static int dynapro_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - pdynapro = kzalloc(sizeof(*pdynapro), GFP_KERNEL); + pdynapro = kzalloc_obj(*pdynapro, GFP_KERNEL); input_dev = input_allocate_device(); if (!pdynapro || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/egalax_ts_serial.c b/drivers/input/touchscreen/egalax_ts_serial.c index 5f284490a298..b741843719ab 100644 --- a/drivers/input/touchscreen/egalax_ts_serial.c +++ b/drivers/input/touchscreen/egalax_ts_serial.c @@ -99,7 +99,7 @@ static int egalax_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int error; - egalax = kzalloc(sizeof(*egalax), GFP_KERNEL); + egalax = kzalloc_obj(*egalax, GFP_KERNEL); input_dev = input_allocate_device(); if (!egalax || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index 137a5f69b83e..f75ea0caf7f9 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c @@ -307,7 +307,7 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - elo = kzalloc(sizeof(*elo), GFP_KERNEL); + elo = kzalloc_obj(*elo, GFP_KERNEL); input_dev = input_allocate_device(); if (!elo || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/fujitsu_ts.c b/drivers/input/touchscreen/fujitsu_ts.c index cef2e93c17bc..3a4f47e37ae7 100644 --- a/drivers/input/touchscreen/fujitsu_ts.c +++ b/drivers/input/touchscreen/fujitsu_ts.c @@ -99,7 +99,7 @@ static int fujitsu_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - fujitsu = kzalloc(sizeof(*fujitsu), GFP_KERNEL); + fujitsu = kzalloc_obj(*fujitsu, GFP_KERNEL); input_dev = input_allocate_device(); if (!fujitsu || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c index 426d2bc80a93..0311f80d263e 100644 --- a/drivers/input/touchscreen/gunze.c +++ b/drivers/input/touchscreen/gunze.c @@ -97,7 +97,7 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - gunze = kzalloc(sizeof(*gunze), GFP_KERNEL); + gunze = kzalloc_obj(*gunze, GFP_KERNEL); input_dev = input_allocate_device(); if (!gunze || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/hampshire.c b/drivers/input/touchscreen/hampshire.c index 0a9af8d0218c..b6423c982726 100644 --- a/drivers/input/touchscreen/hampshire.c +++ b/drivers/input/touchscreen/hampshire.c @@ -109,7 +109,7 @@ static int hampshire_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - phampshire = kzalloc(sizeof(*phampshire), GFP_KERNEL); + phampshire = kzalloc_obj(*phampshire, GFP_KERNEL); input_dev = input_allocate_device(); if (!phampshire || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/inexio.c b/drivers/input/touchscreen/inexio.c index a7604f2c4e3a..72caa754381e 100644 --- a/drivers/input/touchscreen/inexio.c +++ b/drivers/input/touchscreen/inexio.c @@ -114,7 +114,7 @@ static int inexio_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - pinexio = kzalloc(sizeof(*pinexio), GFP_KERNEL); + pinexio = kzalloc_obj(*pinexio, GFP_KERNEL); input_dev = input_allocate_device(); if (!pinexio || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index 47b8da00027f..f539339ee6a0 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -168,7 +168,7 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) struct input_dev *idev; int ret = -ENOMEM; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); idev = input_allocate_device(); if (!priv || !idev) goto err_free_mem; diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index 7511a134e302..c7d5ca01beba 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c @@ -122,7 +122,7 @@ static int migor_ts_probe(struct i2c_client *client) struct input_dev *input; int error; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); input = input_allocate_device(); if (!priv || !input) { dev_err(&client->dev, "failed to allocate memory\n"); diff --git a/drivers/input/touchscreen/mtouch.c b/drivers/input/touchscreen/mtouch.c index 0427ae08c39d..f4e99ccee363 100644 --- a/drivers/input/touchscreen/mtouch.c +++ b/drivers/input/touchscreen/mtouch.c @@ -128,7 +128,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - mtouch = kzalloc(sizeof(*mtouch), GFP_KERNEL); + mtouch = kzalloc_obj(*mtouch, GFP_KERNEL); input_dev = input_allocate_device(); if (!mtouch || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c index 083206a3457b..05e90b36246f 100644 --- a/drivers/input/touchscreen/pcap_ts.c +++ b/drivers/input/touchscreen/pcap_ts.c @@ -138,7 +138,7 @@ static int pcap_ts_probe(struct platform_device *pdev) struct pcap_ts *pcap_ts; int err = -ENOMEM; - pcap_ts = kzalloc(sizeof(*pcap_ts), GFP_KERNEL); + pcap_ts = kzalloc_obj(*pcap_ts, GFP_KERNEL); if (!pcap_ts) return err; diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c index e027c71cffd9..c4979ce707b8 100644 --- a/drivers/input/touchscreen/penmount.c +++ b/drivers/input/touchscreen/penmount.c @@ -199,7 +199,7 @@ static int pm_connect(struct serio *serio, struct serio_driver *drv) int max_x, max_y; int err; - pm = kzalloc(sizeof(*pm), GFP_KERNEL); + pm = kzalloc_obj(*pm, GFP_KERNEL); input_dev = input_allocate_device(); if (!pm || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index 7b3b10cbfcfc..dbe3ddb1194a 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -672,7 +672,7 @@ static int sur40_probe(struct usb_interface *interface, return -ENODEV; /* Allocate memory for our device state and initialize it. */ - sur40 = kzalloc(sizeof(*sur40), GFP_KERNEL); + sur40 = kzalloc_obj(*sur40, GFP_KERNEL); if (!sur40) return -ENOMEM; diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index 0534b2ba650b..d03076da7f04 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -422,7 +422,7 @@ static int titsc_probe(struct platform_device *pdev) int err; /* Allocate memory for device */ - ts_dev = kzalloc(sizeof(*ts_dev), GFP_KERNEL); + ts_dev = kzalloc_obj(*ts_dev, GFP_KERNEL); input_dev = input_allocate_device(); if (!ts_dev || !input_dev) { dev_err(&pdev->dev, "failed to allocate memory.\n"); diff --git a/drivers/input/touchscreen/touchit213.c b/drivers/input/touchscreen/touchit213.c index 53c39ed849f7..6fc1f60fd7a9 100644 --- a/drivers/input/touchscreen/touchit213.c +++ b/drivers/input/touchscreen/touchit213.c @@ -139,7 +139,7 @@ static int touchit213_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - touchit213 = kzalloc(sizeof(*touchit213), GFP_KERNEL); + touchit213 = kzalloc_obj(*touchit213, GFP_KERNEL); input_dev = input_allocate_device(); if (!touchit213 || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/touchright.c b/drivers/input/touchscreen/touchright.c index 9be7c6bf5e7f..0493ead34b34 100644 --- a/drivers/input/touchscreen/touchright.c +++ b/drivers/input/touchscreen/touchright.c @@ -102,7 +102,7 @@ static int tr_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - tr = kzalloc(sizeof(*tr), GFP_KERNEL); + tr = kzalloc_obj(*tr, GFP_KERNEL); input_dev = input_allocate_device(); if (!tr || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/touchwin.c b/drivers/input/touchscreen/touchwin.c index 4b92e8711e1d..687fee4a71b9 100644 --- a/drivers/input/touchscreen/touchwin.c +++ b/drivers/input/touchscreen/touchwin.c @@ -109,7 +109,7 @@ static int tw_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - tw = kzalloc(sizeof(*tw), GFP_KERNEL); + tw = kzalloc_obj(*tw, GFP_KERNEL); input_dev = input_allocate_device(); if (!tw || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/tsc40.c b/drivers/input/touchscreen/tsc40.c index c5dabebaf96d..b83b839d7d5e 100644 --- a/drivers/input/touchscreen/tsc40.c +++ b/drivers/input/touchscreen/tsc40.c @@ -83,7 +83,7 @@ static int tsc_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int error; - ptsc = kzalloc(sizeof(*ptsc), GFP_KERNEL); + ptsc = kzalloc_obj(*ptsc, GFP_KERNEL); input_dev = input_allocate_device(); if (!ptsc || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 7567efabe014..01dcf448a025 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -378,7 +378,7 @@ static int mtouch_alloc(struct usbtouch_usb *usbtouch) { struct mtouch_priv *priv; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -938,7 +938,7 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch) struct nexio_priv *priv; int ret = -ENOMEM; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) goto out_buf; @@ -1458,7 +1458,7 @@ static int usbtouch_probe(struct usb_interface *intf, if (!endpoint) return -ENXIO; - usbtouch = kzalloc(sizeof(*usbtouch), GFP_KERNEL); + usbtouch = kzalloc_obj(*usbtouch, GFP_KERNEL); input_dev = input_allocate_device(); if (!usbtouch || !input_dev) goto out_free; diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index ed2ca8a689d5..4ddca1128d35 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -596,7 +596,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) char basename[64] = "Wacom Serial"; int err, err_pen, err_touch; - w8001 = kzalloc(sizeof(*w8001), GFP_KERNEL); + w8001 = kzalloc_obj(*w8001, GFP_KERNEL); input_dev_pen = input_allocate_device(); input_dev_touch = input_allocate_device(); if (!w8001 || !input_dev_pen || !input_dev_touch) { diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 6cc979b26151..e4e236798357 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -172,7 +172,7 @@ static struct icc_path *path_init(struct device *dev, struct icc_node *dst, struct icc_path *path; int i; - path = kzalloc(struct_size(path, reqs, num_nodes), GFP_KERNEL); + path = kzalloc_flex(*path, reqs, num_nodes, GFP_KERNEL); if (!path) return ERR_PTR(-ENOMEM); @@ -408,7 +408,7 @@ struct icc_node_data *of_icc_get_from_provider(const struct of_phandle_args *spe return ERR_CAST(node); if (!data) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); data->node = node; @@ -827,7 +827,7 @@ static struct icc_node *icc_node_create_nolock(int id) if (node) return node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); diff --git a/drivers/interconnect/debugfs-client.c b/drivers/interconnect/debugfs-client.c index 24d7b5a57794..227235b4b184 100644 --- a/drivers/interconnect/debugfs-client.c +++ b/drivers/interconnect/debugfs-client.c @@ -86,7 +86,7 @@ static int icc_get_set(void *data, u64 val) goto err_free; } - debugfs_path = kzalloc(sizeof(*debugfs_path), GFP_KERNEL); + debugfs_path = kzalloc_obj(*debugfs_path, GFP_KERNEL); if (!debugfs_path) { ret = -ENOMEM; goto err_put; diff --git a/drivers/interconnect/qcom/icc-common.c b/drivers/interconnect/qcom/icc-common.c index 9b8a9c69e0cb..5f90fcf7b22e 100644 --- a/drivers/interconnect/qcom/icc-common.c +++ b/drivers/interconnect/qcom/icc-common.c @@ -19,7 +19,7 @@ struct icc_node_data *qcom_icc_xlate_extended(const struct of_phandle_args *spec if (IS_ERR(node)) return ERR_CAST(node); - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 5a797c1b31e2..cdda0eb8056f 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -659,9 +659,9 @@ static inline void free_dev_table(struct amd_iommu_pci_seg *pci_seg) /* Allocate per PCI segment IOMMU rlookup table. */ static inline int __init alloc_rlookup_table(struct amd_iommu_pci_seg *pci_seg) { - pci_seg->rlookup_table = kvcalloc(pci_seg->last_bdf + 1, - sizeof(*pci_seg->rlookup_table), - GFP_KERNEL); + pci_seg->rlookup_table = kvzalloc_objs(*pci_seg->rlookup_table, + pci_seg->last_bdf + 1, + GFP_KERNEL); if (pci_seg->rlookup_table == NULL) return -ENOMEM; @@ -676,9 +676,9 @@ static inline void free_rlookup_table(struct amd_iommu_pci_seg *pci_seg) static inline int __init alloc_irq_lookup_table(struct amd_iommu_pci_seg *pci_seg) { - pci_seg->irq_lookup_table = kvcalloc(pci_seg->last_bdf + 1, - sizeof(*pci_seg->irq_lookup_table), - GFP_KERNEL); + pci_seg->irq_lookup_table = kvzalloc_objs(*pci_seg->irq_lookup_table, + pci_seg->last_bdf + 1, + GFP_KERNEL); if (pci_seg->irq_lookup_table == NULL) return -ENOMEM; @@ -695,9 +695,8 @@ static int __init alloc_alias_table(struct amd_iommu_pci_seg *pci_seg) { int i; - pci_seg->alias_table = kvmalloc_array(pci_seg->last_bdf + 1, - sizeof(*pci_seg->alias_table), - GFP_KERNEL); + pci_seg->alias_table = kvmalloc_objs(*pci_seg->alias_table, + pci_seg->last_bdf + 1, GFP_KERNEL); if (!pci_seg->alias_table) return -ENOMEM; @@ -1285,7 +1284,7 @@ set_dev_entry_from_acpi_range(struct amd_iommu *iommu, u16 first, u16 last, if (search_ivhd_dte_flags(iommu->pci_seg->id, first, last)) return; - d = kzalloc(sizeof(struct ivhd_dte_flags), GFP_KERNEL); + d = kzalloc_obj(struct ivhd_dte_flags, GFP_KERNEL); if (!d) return; @@ -1357,7 +1356,7 @@ int __init add_special_device(u8 type, u8 id, u32 *devid, bool cmd_line) return 0; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1388,7 +1387,7 @@ static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u32 *devid, return 0; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1721,7 +1720,7 @@ static struct amd_iommu_pci_seg *__init alloc_pci_segment(u16 id, if (last_bdf < 0) return NULL; - pci_seg = kzalloc(sizeof(struct amd_iommu_pci_seg), GFP_KERNEL); + pci_seg = kzalloc_obj(struct amd_iommu_pci_seg, GFP_KERNEL); if (pci_seg == NULL) return NULL; @@ -2041,7 +2040,7 @@ static int __init init_iommu_all(struct acpi_table_header *table) DUMP_printk(" mmio-addr: %016llx\n", h->mmio_phys); - iommu = kzalloc(sizeof(struct amd_iommu), GFP_KERNEL); + iommu = kzalloc_obj(struct amd_iommu, GFP_KERNEL); if (iommu == NULL) return -ENOMEM; @@ -2642,7 +2641,7 @@ static int __init init_unity_map_range(struct ivmd_header *m, if (pci_seg == NULL) return -ENOMEM; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (e == NULL) return -ENOMEM; diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index ab61ef61e670..e26f94feeaa5 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -372,7 +372,7 @@ static struct iommu_dev_data *alloc_dev_data(struct amd_iommu *iommu, u16 devid) struct iommu_dev_data *dev_data; struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; - dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) return NULL; @@ -2277,7 +2277,7 @@ static int pdom_attach_iommu(struct amd_iommu *iommu, goto out_unlock; } - pdom_iommu_info = kzalloc(sizeof(*pdom_iommu_info), GFP_ATOMIC); + pdom_iommu_info = kzalloc_obj(*pdom_iommu_info, GFP_ATOMIC); if (!pdom_iommu_info) { ret = -ENOMEM; goto out_unlock; @@ -2547,7 +2547,7 @@ struct protection_domain *protection_domain_alloc(void) struct protection_domain *domain; int domid; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return NULL; @@ -3248,7 +3248,7 @@ static struct irq_remap_table *__alloc_irq_table(int nid, size_t size) { struct irq_remap_table *table; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return NULL; @@ -3799,15 +3799,14 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, } ret = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto out_free_data; if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir)) - data->entry = kzalloc(sizeof(union irte), GFP_KERNEL); + data->entry = kzalloc_obj(union irte, GFP_KERNEL); else - data->entry = kzalloc(sizeof(struct irte_ga), - GFP_KERNEL); + data->entry = kzalloc_obj(struct irte_ga, GFP_KERNEL); if (!data->entry) { kfree(data); goto out_free_data; diff --git a/drivers/iommu/amd/iommufd.c b/drivers/iommu/amd/iommufd.c index 96ec6a4a760d..760b3afaaf13 100644 --- a/drivers/iommu/amd/iommufd.c +++ b/drivers/iommu/amd/iommufd.c @@ -19,7 +19,7 @@ void *amd_iommufd_hw_info(struct device *dev, u32 *length, enum iommu_hw_info_ty *type != IOMMU_HW_INFO_TYPE_AMD) return ERR_PTR(-EOPNOTSUPP); - hwinfo = kzalloc(sizeof(*hwinfo), GFP_KERNEL); + hwinfo = kzalloc_obj(*hwinfo, GFP_KERNEL); if (!hwinfo) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/nested.c b/drivers/iommu/amd/nested.c index 66cc36133c8b..1a5ff73db628 100644 --- a/drivers/iommu/amd/nested.c +++ b/drivers/iommu/amd/nested.c @@ -68,7 +68,7 @@ static void *gdom_info_load_or_alloc_locked(struct xarray *xa, unsigned long ind return elm; xa_unlock(xa); - elm = kzalloc(sizeof(struct guest_domain_mapping_info), GFP_KERNEL); + elm = kzalloc_obj(struct guest_domain_mapping_info, GFP_KERNEL); xa_lock(xa); if (!elm) return ERR_PTR(-ENOMEM); @@ -102,7 +102,7 @@ amd_iommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, if (user_data->type != IOMMU_HWPT_DATA_AMD_GUEST) return ERR_PTR(-EOPNOTSUPP); - ndom = kzalloc(sizeof(*ndom), GFP_KERNEL); + ndom = kzalloc_obj(*ndom, GFP_KERNEL); if (!ndom) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/pasid.c b/drivers/iommu/amd/pasid.c index 77c8e9a91cbc..38cf8f519477 100644 --- a/drivers/iommu/amd/pasid.c +++ b/drivers/iommu/amd/pasid.c @@ -121,7 +121,7 @@ int iommu_sva_set_dev_pasid(struct iommu_domain *domain, return ret; /* Add PASID to protection domain pasid list */ - pdom_dev_data = kzalloc(sizeof(*pdom_dev_data), GFP_KERNEL); + pdom_dev_data = kzalloc_obj(*pdom_dev_data, GFP_KERNEL); if (pdom_dev_data == NULL) return ret; diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 83a5aabcd15d..6b679fa53c3e 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -768,7 +768,7 @@ static struct iommu_domain *apple_dart_domain_alloc_paging(struct device *dev) { struct apple_dart_domain *dart_domain; - dart_domain = kzalloc(sizeof(*dart_domain), GFP_KERNEL); + dart_domain = kzalloc_obj(*dart_domain, GFP_KERNEL); if (!dart_domain) return NULL; @@ -812,7 +812,7 @@ static int apple_dart_of_xlate(struct device *dev, sid = args->args[0]; if (!cfg) { - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; /* Will be ANDed with DART capabilities */ diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c index 823461a26659..973afced466c 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c @@ -23,7 +23,7 @@ void *arm_smmu_hw_info(struct device *dev, u32 *length, return impl_ops->hw_info(master->smmu, length, type); } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); @@ -121,7 +121,7 @@ int arm_smmu_attach_prepare_vmaster(struct arm_smmu_attach_state *state, return ret; } - vmaster = kzalloc(sizeof(*vmaster), GFP_KERNEL); + vmaster = kzalloc_obj(*vmaster, GFP_KERNEL); if (!vmaster) return -ENOMEM; vmaster->vsmmu = nested_domain->vsmmu; @@ -261,7 +261,7 @@ arm_vsmmu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, if (ret) return ERR_PTR(ret); - nested_domain = kzalloc(sizeof(*nested_domain), GFP_KERNEL_ACCOUNT); + nested_domain = kzalloc_obj(*nested_domain, GFP_KERNEL_ACCOUNT); if (!nested_domain) return ERR_PTR(-ENOMEM); @@ -361,7 +361,7 @@ int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu, struct arm_vsmmu_invalidation_cmd *end; int ret; - cmds = kcalloc(array->entry_num, sizeof(*cmds), GFP_KERNEL); + cmds = kzalloc_objs(*cmds, array->entry_num, GFP_KERNEL); if (!cmds) return -ENOMEM; cur = cmds; diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index b397d1714d97..bee947ad5640 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1514,9 +1514,9 @@ static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master) cd_table->l2.num_l1_ents = DIV_ROUND_UP(max_contexts, CTXDESC_L2_ENTRIES); - cd_table->l2.l2ptrs = kcalloc(cd_table->l2.num_l1_ents, - sizeof(*cd_table->l2.l2ptrs), - GFP_KERNEL); + cd_table->l2.l2ptrs = kzalloc_objs(*cd_table->l2.l2ptrs, + cd_table->l2.num_l1_ents, + GFP_KERNEL); if (!cd_table->l2.l2ptrs) return -ENOMEM; @@ -2524,7 +2524,7 @@ struct arm_smmu_domain *arm_smmu_domain_alloc(void) { struct arm_smmu_domain *smmu_domain; - smmu_domain = kzalloc(sizeof(*smmu_domain), GFP_KERNEL); + smmu_domain = kzalloc_obj(*smmu_domain, GFP_KERNEL); if (!smmu_domain) return ERR_PTR(-ENOMEM); @@ -2965,7 +2965,7 @@ int arm_smmu_attach_prepare(struct arm_smmu_attach_state *state, return ret; } - master_domain = kzalloc(sizeof(*master_domain), GFP_KERNEL); + master_domain = kzalloc_obj(*master_domain, GFP_KERNEL); if (!master_domain) { ret = -ENOMEM; goto err_free_vmaster; @@ -3517,8 +3517,8 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu, int ret = 0; struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(master->dev); - master->streams = kcalloc(fwspec->num_ids, sizeof(*master->streams), - GFP_KERNEL); + master->streams = kzalloc_objs(*master->streams, fwspec->num_ids, + GFP_KERNEL); if (!master->streams) return -ENOMEM; master->num_streams = fwspec->num_ids; @@ -3597,7 +3597,7 @@ static struct iommu_device *arm_smmu_probe_device(struct device *dev) if (!smmu) return ERR_PTR(-ENODEV); - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c index 156b87fe456d..c7892443258d 100644 --- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c +++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c @@ -693,7 +693,7 @@ tegra241_vintf_alloc_lvcmdq(struct tegra241_vintf *vintf, u16 lidx) char header[64]; int ret; - vcmdq = kzalloc(sizeof(*vcmdq), GFP_KERNEL); + vcmdq = kzalloc_obj(*vcmdq, GFP_KERNEL); if (!vcmdq) return ERR_PTR(-ENOMEM); @@ -742,8 +742,8 @@ static int tegra241_cmdqv_init_vintf(struct tegra241_cmdqv *cmdqv, u16 max_idx, vintf->cmdqv = cmdqv; vintf->base = cmdqv->base + TEGRA241_VINTF(idx); - vintf->lvcmdqs = kcalloc(cmdqv->num_lvcmdqs_per_vintf, - sizeof(*vintf->lvcmdqs), GFP_KERNEL); + vintf->lvcmdqs = kzalloc_objs(*vintf->lvcmdqs, + cmdqv->num_lvcmdqs_per_vintf, GFP_KERNEL); if (!vintf->lvcmdqs) { ida_free(&cmdqv->vintf_ids, idx); return -ENOMEM; @@ -818,7 +818,7 @@ static void *tegra241_cmdqv_hw_info(struct arm_smmu_device *smmu, u32 *length, if (*type != IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV) return ERR_PTR(-EOPNOTSUPP); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); @@ -860,7 +860,7 @@ static int tegra241_cmdqv_init_structures(struct arm_smmu_device *smmu) int lidx; int ret; - vintf = kzalloc(sizeof(*vintf), GFP_KERNEL); + vintf = kzalloc_obj(*vintf, GFP_KERNEL); if (!vintf) return -ENOMEM; @@ -947,7 +947,7 @@ __tegra241_cmdqv_probe(struct arm_smmu_device *smmu, struct resource *res, 1 << FIELD_GET(CMDQV_NUM_SID_PER_VM_LOG2, regval); cmdqv->vintfs = - kcalloc(cmdqv->num_vintfs, sizeof(*cmdqv->vintfs), GFP_KERNEL); + kzalloc_objs(*cmdqv->vintfs, cmdqv->num_vintfs, GFP_KERNEL); if (!cmdqv->vintfs) goto free_irq; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 1e218fbea35a..a31e90fcfefe 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -927,7 +927,7 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev) * We can't really do anything meaningful until we've added a * master. */ - smmu_domain = kzalloc(sizeof(*smmu_domain), GFP_KERNEL); + smmu_domain = kzalloc_obj(*smmu_domain, GFP_KERNEL); if (!smmu_domain) return NULL; diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index c98bed38c58a..7126431c966d 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -329,7 +329,7 @@ static struct iommu_domain *qcom_iommu_domain_alloc_paging(struct device *dev) * We can't really do anything meaningful until we've added a * master. */ - qcom_domain = kzalloc(sizeof(*qcom_domain), GFP_KERNEL); + qcom_domain = kzalloc_obj(*qcom_domain, GFP_KERNEL); if (!qcom_domain) return NULL; diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index aeaf8fad985c..d1ecb722b546 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -372,7 +372,7 @@ int iommu_get_dma_cookie(struct iommu_domain *domain) if (domain->cookie_type != IOMMU_COOKIE_NONE) return -EEXIST; - cookie = kzalloc(sizeof(*cookie), GFP_KERNEL); + cookie = kzalloc_obj(*cookie, GFP_KERNEL); if (!cookie) return -ENOMEM; @@ -404,7 +404,7 @@ int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base) if (domain->cookie_type != IOMMU_COOKIE_NONE) return -EEXIST; - cookie = kzalloc(sizeof(*cookie), GFP_KERNEL); + cookie = kzalloc_obj(*cookie, GFP_KERNEL); if (!cookie) return -ENOMEM; @@ -480,7 +480,7 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, num_pages = iova_align(iovad, end - start) >> iova_shift(iovad); for (i = 0; i < num_pages; i++) { - msi_page = kmalloc(sizeof(*msi_page), GFP_KERNEL); + msi_page = kmalloc_obj(*msi_page, GFP_KERNEL); if (!msi_page) return -ENOMEM; @@ -880,7 +880,7 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev, if (!order_mask) return NULL; - pages = kvcalloc(count, sizeof(*pages), GFP_KERNEL); + pages = kvzalloc_objs(*pages, count, GFP_KERNEL); if (!pages) return NULL; @@ -1045,7 +1045,7 @@ struct sg_table *iommu_dma_alloc_noncontiguous(struct device *dev, size_t size, { struct dma_sgt_handle *sh; - sh = kmalloc(sizeof(*sh), gfp); + sh = kmalloc_obj(*sh, gfp); if (!sh) return NULL; @@ -2157,7 +2157,7 @@ static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev, if (msi_page->phys == msi_addr) return msi_page; - msi_page = kzalloc(sizeof(*msi_page), GFP_KERNEL); + msi_page = kzalloc_obj(*msi_page, GFP_KERNEL); if (!msi_page) return NULL; diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index b512c6b939ac..2e439699382d 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -899,7 +899,7 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) /* Check if correct PTE offsets are initialized */ BUG_ON(PG_ENT_SHIFT < 0 || !dma_dev); - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return NULL; @@ -1451,7 +1451,7 @@ static int exynos_iommu_of_xlate(struct device *dev, return -ENODEV; if (!owner) { - owner = kzalloc(sizeof(*owner), GFP_KERNEL); + owner = kzalloc_obj(*owner, GFP_KERNEL); if (!owner) return -ENOMEM; diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index f37d3b044131..8db71fe57894 100644 --- a/drivers/iommu/fsl_pamu.c +++ b/drivers/iommu/fsl_pamu.c @@ -785,7 +785,7 @@ static int fsl_pamu_probe(struct platform_device *pdev) goto error; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { ret = -ENOMEM; goto error; diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c index 0961ac805944..b776c52aca6b 100644 --- a/drivers/iommu/hyperv-iommu.c +++ b/drivers/iommu/hyperv-iommu.c @@ -276,7 +276,7 @@ static int hyperv_root_irq_remapping_alloc(struct irq_domain *domain, if (ret < 0) return ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { irq_domain_free_irqs_common(domain, virq, nr_irqs); return -ENOMEM; diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c index 385ae5cfb30d..e43c93fb9b1d 100644 --- a/drivers/iommu/intel/cache.c +++ b/drivers/iommu/intel/cache.c @@ -49,7 +49,7 @@ int cache_tag_assign(struct dmar_domain *domain, u16 did, struct device *dev, struct list_head *prev; unsigned long flags; - tag = kzalloc(sizeof(*tag), GFP_KERNEL); + tag = kzalloc_obj(*tag, GFP_KERNEL); if (!tag) return -ENOMEM; @@ -123,7 +123,7 @@ static int domain_qi_batch_alloc(struct dmar_domain *domain) if (domain->qi_batch) goto out_unlock; - domain->qi_batch = kzalloc(sizeof(*domain->qi_batch), GFP_ATOMIC); + domain->qi_batch = kzalloc_obj(*domain->qi_batch, GFP_ATOMIC); if (!domain->qi_batch) ret = -ENOMEM; out_unlock: diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index ec975c73cfe6..4a2143036b94 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -99,7 +99,7 @@ void *dmar_alloc_dev_scope(void *start, void *end, int *cnt) if (*cnt == 0) return NULL; - return kcalloc(*cnt, sizeof(struct dmar_dev_scope), GFP_KERNEL); + return kzalloc_objs(struct dmar_dev_scope, *cnt, GFP_KERNEL); } void dmar_free_dev_scope(struct dmar_dev_scope **devices, int *cnt) @@ -1046,7 +1046,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) return -EINVAL; } - iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); + iommu = kzalloc_obj(*iommu, GFP_KERNEL); if (!iommu) return -ENOMEM; @@ -1692,7 +1692,7 @@ int dmar_enable_qi(struct intel_iommu *iommu) if (iommu->qi) return 0; - iommu->qi = kmalloc(sizeof(*qi), GFP_ATOMIC); + iommu->qi = kmalloc_obj(*qi, GFP_ATOMIC); if (!iommu->qi) return -ENOMEM; @@ -1713,7 +1713,7 @@ int dmar_enable_qi(struct intel_iommu *iommu) qi->desc = desc; - qi->desc_status = kcalloc(QI_LENGTH, sizeof(int), GFP_ATOMIC); + qi->desc_status = kzalloc_objs(int, QI_LENGTH, GFP_ATOMIC); if (!qi->desc_status) { iommu_free_pages(qi->desc); kfree(qi); diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 705828b06e32..3505ced050f0 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -1030,7 +1030,7 @@ int domain_attach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu) if (domain->domain.type == IOMMU_DOMAIN_SVA) return 0; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1926,7 +1926,7 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); } - rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL); + rmrru = kzalloc_obj(*rmrru, GFP_KERNEL); if (!rmrru) goto out; @@ -2779,7 +2779,7 @@ static struct dmar_domain *paging_domain_alloc(void) { struct dmar_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return ERR_PTR(-ENOMEM); @@ -3237,7 +3237,7 @@ static struct iommu_device *intel_iommu_probe_device(struct device *dev) if (!iommu || !iommu->iommu.ops) return ERR_PTR(-ENODEV); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); @@ -3576,7 +3576,7 @@ domain_add_dev_pasid(struct iommu_domain *domain, unsigned long flags; int ret; - dev_pasid = kzalloc(sizeof(*dev_pasid), GFP_KERNEL); + dev_pasid = kzalloc_obj(*dev_pasid, GFP_KERNEL); if (!dev_pasid) return ERR_PTR(-ENOMEM); @@ -3672,7 +3672,7 @@ static void *intel_iommu_hw_info(struct device *dev, u32 *length, *type != IOMMU_HW_INFO_TYPE_INTEL_VTD) return ERR_PTR(-EOPNOTSUPP); - vtd = kzalloc(sizeof(*vtd), GFP_KERNEL); + vtd = kzalloc_obj(*vtd, GFP_KERNEL); if (!vtd) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c index ecb591e98565..105958b4a29e 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -533,7 +533,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) if (iommu->ir_table) return 0; - ir_table = kzalloc(sizeof(struct ir_table), GFP_KERNEL); + ir_table = kzalloc_obj(struct ir_table, GFP_KERNEL); if (!ir_table) return -ENOMEM; @@ -1426,7 +1426,7 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, return ret; ret = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto out_free_parent; @@ -1448,7 +1448,7 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, } if (i > 0) { - ird = kzalloc(sizeof(*ird), GFP_KERNEL); + ird = kzalloc_obj(*ird, GFP_KERNEL); if (!ird) goto out_free_data; /* Initialize the common data */ diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c index e9a440e9c960..2b979bec56ce 100644 --- a/drivers/iommu/intel/nested.c +++ b/drivers/iommu/intel/nested.c @@ -218,7 +218,7 @@ intel_iommu_domain_alloc_nested(struct device *dev, struct iommu_domain *parent, if (ret) return ERR_PTR(ret); - domain = kzalloc(sizeof(*domain), GFP_KERNEL_ACCOUNT); + domain = kzalloc_obj(*domain, GFP_KERNEL_ACCOUNT); if (!domain) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index b63a71904cfb..5ffe84dee862 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -50,7 +50,7 @@ int intel_pasid_alloc_table(struct device *dev) if (WARN_ON(info->pasid_table)) return -EEXIST; - pasid_table = kzalloc(sizeof(*pasid_table), GFP_KERNEL); + pasid_table = kzalloc_obj(*pasid_table, GFP_KERNEL); if (!pasid_table) return -ENOMEM; diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c index dceeadc3ee7c..02168f2f20a4 100644 --- a/drivers/iommu/intel/perf.c +++ b/drivers/iommu/intel/perf.c @@ -33,8 +33,8 @@ int dmar_latency_enable(struct intel_iommu *iommu, enum latency_type type) spin_lock_irqsave(&latency_lock, flags); if (!iommu->perf_statistic) { - iommu->perf_statistic = kcalloc(DMAR_LATENCY_NUM, sizeof(*lstat), - GFP_ATOMIC); + iommu->perf_statistic = kzalloc_objs(*lstat, DMAR_LATENCY_NUM, + GFP_ATOMIC); if (!iommu->perf_statistic) { ret = -ENOMEM; goto unlock_out; diff --git a/drivers/iommu/intel/perfmon.c b/drivers/iommu/intel/perfmon.c index 75f493bcb353..76b62f2c8d92 100644 --- a/drivers/iommu/intel/perfmon.c +++ b/drivers/iommu/intel/perfmon.c @@ -591,7 +591,7 @@ int alloc_iommu_pmu(struct intel_iommu *iommu) if (!ecmd_has_pmu_essential(iommu)) return -ENODEV; - iommu_pmu = kzalloc(sizeof(*iommu_pmu), GFP_KERNEL); + iommu_pmu = kzalloc_obj(*iommu_pmu, GFP_KERNEL); if (!iommu_pmu) return -ENOMEM; diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 71de7947971f..be165cb9d01e 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -210,7 +210,7 @@ struct iommu_domain *intel_svm_domain_alloc(struct device *dev, if (ret) return ERR_PTR(ret); - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c index 8b5926c1452e..a0d8fd7f2e84 100644 --- a/drivers/iommu/io-pgfault.c +++ b/drivers/iommu/io-pgfault.c @@ -65,7 +65,7 @@ static int report_partial_fault(struct iommu_fault_param *fault_param, { struct iopf_fault *iopf; - iopf = kzalloc(sizeof(*iopf), GFP_KERNEL); + iopf = kzalloc_obj(*iopf, GFP_KERNEL); if (!iopf) return -ENOMEM; @@ -85,7 +85,7 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param, struct iopf_fault *iopf, *next; struct iopf_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) { /* * We always need to construct the group as we need it to abort @@ -400,7 +400,7 @@ int iopf_queue_add_device(struct iopf_queue *queue, struct device *dev) goto done_unlock; } - fault_param = kzalloc(sizeof(*fault_param), GFP_KERNEL); + fault_param = kzalloc_obj(*fault_param, GFP_KERNEL); if (!fault_param) { ret = -ENOMEM; goto done_unlock; @@ -503,7 +503,7 @@ struct iopf_queue *iopf_queue_alloc(const char *name) { struct iopf_queue *queue; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return NULL; diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 523355e91a2c..67ce99ca82b3 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -692,7 +692,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, !arm_v7s_is_mtk_enabled(cfg)) return NULL; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 05d63fe92e43..c5076caf17aa 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -930,7 +930,7 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg) if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS) return NULL; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/iommu/io-pgtable-dart.c b/drivers/iommu/io-pgtable-dart.c index 54d287cc0dd1..d31f00ff1206 100644 --- a/drivers/iommu/io-pgtable-dart.c +++ b/drivers/iommu/io-pgtable-dart.c @@ -388,7 +388,7 @@ dart_alloc_pgtable(struct io_pgtable_cfg *cfg) if (tbl_bits > max_tbl_bits) return NULL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index e1e63c2be82b..6f3b26a823ec 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -35,7 +35,7 @@ static struct iommu_mm_data *iommu_alloc_mm_data(struct mm_struct *mm, struct de return iommu_mm; } - iommu_mm = kzalloc(sizeof(struct iommu_mm_data), GFP_KERNEL); + iommu_mm = kzalloc_obj(struct iommu_mm_data, GFP_KERNEL); if (!iommu_mm) return ERR_PTR(-ENOMEM); @@ -108,7 +108,7 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm goto out_unlock; } - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c index 170022c09536..cf72d58fcb7c 100644 --- a/drivers/iommu/iommu-sysfs.c +++ b/drivers/iommu/iommu-sysfs.c @@ -59,7 +59,7 @@ int iommu_device_sysfs_add(struct iommu_device *iommu, va_list vargs; int ret; - iommu->dev = kzalloc(sizeof(*iommu->dev), GFP_KERNEL); + iommu->dev = kzalloc_obj(*iommu->dev, GFP_KERNEL); if (!iommu->dev) return -ENOMEM; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 4926a43118e6..1a98d65fb35d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -233,7 +233,7 @@ static int __init iommu_subsys_init(void) (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ? " (set via kernel command line)" : ""); - nb = kcalloc(ARRAY_SIZE(iommu_buses), sizeof(*nb), GFP_KERNEL); + nb = kzalloc_objs(*nb, ARRAY_SIZE(iommu_buses), GFP_KERNEL); if (!nb) return -ENOMEM; @@ -383,7 +383,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev) if (param) return param; - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) return NULL; @@ -1053,7 +1053,7 @@ struct iommu_group *iommu_group_alloc(void) struct iommu_group *group; int ret; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return ERR_PTR(-ENOMEM); @@ -1244,7 +1244,7 @@ static struct group_device *iommu_group_alloc_device(struct iommu_group *group, int ret, i = 0; struct group_device *device; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return ERR_PTR(-ENOMEM); @@ -2939,7 +2939,7 @@ struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start, { struct iommu_resv_region *region; - region = kzalloc(sizeof(*region), gfp); + region = kzalloc_obj(*region, gfp); if (!region) return NULL; @@ -3010,7 +3010,7 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode) return -ENOMEM; /* Preallocate for the overwhelmingly common case of 1 ID */ - fwspec = kzalloc(struct_size(fwspec, ids, 1), GFP_KERNEL); + fwspec = kzalloc_flex(*fwspec, ids, 1, GFP_KERNEL); if (!fwspec) return -ENOMEM; diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index 4c842368289f..5a2628854a05 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -87,7 +87,7 @@ static struct iommufd_group *iommufd_get_group(struct iommufd_ctx *ictx, } xa_unlock(&ictx->groups); - new_igroup = kzalloc(sizeof(*new_igroup), GFP_KERNEL); + new_igroup = kzalloc_obj(*new_igroup, GFP_KERNEL); if (!new_igroup) { iommu_group_put(group); return ERR_PTR(-ENOMEM); @@ -508,7 +508,7 @@ static int iommufd_hwpt_attach_device(struct iommufd_hw_pagetable *hwpt, if (rc) return rc; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; @@ -575,7 +575,7 @@ static int iommufd_hwpt_replace_device(struct iommufd_device *idev, old_handle = iommufd_device_get_attach_handle(idev, pasid); - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; @@ -619,7 +619,7 @@ int iommufd_hw_pagetable_attach(struct iommufd_hw_pagetable *hwpt, } if (!attach) { - attach = kzalloc(sizeof(*attach), GFP_KERNEL); + attach = kzalloc_obj(*attach, GFP_KERNEL); if (!attach) { rc = -ENOMEM; goto err_release_pasid; diff --git a/drivers/iommu/iommufd/driver.c b/drivers/iommu/iommufd/driver.c index 21d4a35538f6..b71fb2472945 100644 --- a/drivers/iommu/iommufd/driver.c +++ b/drivers/iommu/iommufd/driver.c @@ -155,7 +155,7 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu, goto out_set_header; } - vevent = kzalloc(struct_size(vevent, event_data, data_len), GFP_ATOMIC); + vevent = kzalloc_flex(*vevent, event_data, data_len, GFP_ATOMIC); if (!vevent) { rc = -ENOMEM; vevent = &veventq->lost_events_header; @@ -202,7 +202,7 @@ iommufd_sw_msi_get_map(struct iommufd_ctx *ictx, phys_addr_t msi_addr, BITS_PER_BYTE * sizeof_field(struct iommufd_sw_msi_maps, bitmap)) return ERR_PTR(-EOVERFLOW); - cur = kzalloc(sizeof(*cur), GFP_KERNEL); + cur = kzalloc_obj(*cur, GFP_KERNEL); if (!cur) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index e23d9ee4fe38..f1e686b3a265 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -262,7 +262,7 @@ iommufd_veventq_deliver_fetch(struct iommufd_veventq *veventq) next = list_first_entry(list, struct iommufd_vevent, node); /* Make a copy of the lost_events_header for copy_to_user */ if (next == &veventq->lost_events_header) { - vevent = kzalloc(sizeof(*vevent), GFP_ATOMIC); + vevent = kzalloc_obj(*vevent, GFP_ATOMIC); if (!vevent) goto out_unlock; } diff --git a/drivers/iommu/iommufd/io_pagetable.c b/drivers/iommu/iommufd/io_pagetable.c index 436992331111..ee003bb2f647 100644 --- a/drivers/iommu/iommufd/io_pagetable.c +++ b/drivers/iommu/iommufd/io_pagetable.c @@ -245,7 +245,7 @@ static struct iopt_area *iopt_area_alloc(void) { struct iopt_area *area; - area = kzalloc(sizeof(*area), GFP_KERNEL_ACCOUNT); + area = kzalloc_obj(*area, GFP_KERNEL_ACCOUNT); if (!area) return NULL; RB_CLEAR_NODE(&area->node.rb); @@ -715,7 +715,7 @@ int iopt_get_pages(struct io_pagetable *iopt, unsigned long iova, struct iopt_pages_list *elm; unsigned long last = min(last_iova, iopt_area_last_iova(area)); - elm = kzalloc(sizeof(*elm), GFP_KERNEL_ACCOUNT); + elm = kzalloc_obj(*elm, GFP_KERNEL_ACCOUNT); if (!elm) { rc = -ENOMEM; goto err_free; @@ -888,7 +888,7 @@ int iopt_reserve_iova(struct io_pagetable *iopt, unsigned long start, iopt_allowed_iter_first(iopt, start, last)) return -EADDRINUSE; - reserved = kzalloc(sizeof(*reserved), GFP_KERNEL_ACCOUNT); + reserved = kzalloc_obj(*reserved, GFP_KERNEL_ACCOUNT); if (!reserved) return -ENOMEM; reserved->node.start = start; diff --git a/drivers/iommu/iommufd/ioas.c b/drivers/iommu/iommufd/ioas.c index f4721afedadc..fed06c2b728e 100644 --- a/drivers/iommu/iommufd/ioas.c +++ b/drivers/iommu/iommufd/ioas.c @@ -132,7 +132,7 @@ static int iommufd_ioas_load_iovas(struct rb_root_cached *itree, if (interval_tree_iter_first(itree, range.start, range.last)) return -EINVAL; - allowed = kzalloc(sizeof(*allowed), GFP_KERNEL_ACCOUNT); + allowed = kzalloc_obj(*allowed, GFP_KERNEL_ACCOUNT); if (!allowed) return -ENOMEM; allowed->node.start = range.start; diff --git a/drivers/iommu/iommufd/iova_bitmap.c b/drivers/iommu/iommufd/iova_bitmap.c index b5b67a9d3fb3..151285e0521e 100644 --- a/drivers/iommu/iommufd/iova_bitmap.c +++ b/drivers/iommu/iommufd/iova_bitmap.c @@ -247,7 +247,7 @@ struct iova_bitmap *iova_bitmap_alloc(unsigned long iova, size_t length, struct iova_bitmap *bitmap; int rc; - bitmap = kzalloc(sizeof(*bitmap), GFP_KERNEL); + bitmap = kzalloc_obj(*bitmap, GFP_KERNEL); if (!bitmap) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iommufd/main.c b/drivers/iommu/iommufd/main.c index 5cc4b08c25f5..8c6d43601afb 100644 --- a/drivers/iommu/iommufd/main.c +++ b/drivers/iommu/iommufd/main.c @@ -296,7 +296,7 @@ static int iommufd_fops_open(struct inode *inode, struct file *filp) { struct iommufd_ctx *ictx; - ictx = kzalloc(sizeof(*ictx), GFP_KERNEL_ACCOUNT); + ictx = kzalloc_obj(*ictx, GFP_KERNEL_ACCOUNT); if (!ictx) return -ENOMEM; diff --git a/drivers/iommu/iommufd/pages.c b/drivers/iommu/iommufd/pages.c index f863fea75b98..38efabe95dba 100644 --- a/drivers/iommu/iommufd/pages.c +++ b/drivers/iommu/iommufd/pages.c @@ -1372,7 +1372,7 @@ static struct iopt_pages *iopt_alloc_pages(unsigned long start_byte, if (length > SIZE_MAX - PAGE_SIZE || length == 0) return ERR_PTR(-EINVAL); - pages = kzalloc(sizeof(*pages), GFP_KERNEL_ACCOUNT); + pages = kzalloc_obj(*pages, GFP_KERNEL_ACCOUNT); if (!pages) return ERR_PTR(-ENOMEM); @@ -1575,7 +1575,7 @@ int iopt_dmabuf_track_domain(struct iopt_pages *pages, struct iopt_area *area, if (WARN_ON(track->domain == domain && track->area == area)) return -EINVAL; - track = kzalloc(sizeof(*track), GFP_KERNEL); + track = kzalloc_obj(*track, GFP_KERNEL); if (!track) return -ENOMEM; track->domain = domain; @@ -2455,7 +2455,7 @@ int iopt_area_add_access(struct iopt_area *area, unsigned long start_index, return 0; } - access = kzalloc(sizeof(*access), GFP_KERNEL_ACCOUNT); + access = kzalloc_obj(*access, GFP_KERNEL_ACCOUNT); if (!access) { rc = -ENOMEM; goto err_unlock; diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index 989d8c4c60a7..530202748016 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -308,7 +308,7 @@ static void *mock_domain_hw_info(struct device *dev, u32 *length, *type != IOMMU_HW_INFO_TYPE_SELFTEST) return ERR_PTR(-EOPNOTSUPP); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); @@ -353,7 +353,7 @@ __mock_domain_alloc_nested(const struct iommu_user_data *user_data) if (rc) return ERR_PTR(rc); - mock_nested = kzalloc(sizeof(*mock_nested), GFP_KERNEL); + mock_nested = kzalloc_obj(*mock_nested, GFP_KERNEL); if (!mock_nested) return ERR_PTR(-ENOMEM); mock_nested->domain.ops = &domain_nested_ops; @@ -441,7 +441,7 @@ mock_domain_alloc_pgtable(struct device *dev, struct mock_iommu_domain *mock; int rc; - mock = kzalloc(sizeof(*mock), GFP_KERNEL); + mock = kzalloc_obj(*mock, GFP_KERNEL); if (!mock) return ERR_PTR(-ENOMEM); mock->domain.type = IOMMU_DOMAIN_UNMANAGED; @@ -674,7 +674,7 @@ static int mock_viommu_cache_invalidate(struct iommufd_viommu *viommu, return 0; } - cmds = kcalloc(array->entry_num, sizeof(*cmds), GFP_KERNEL); + cmds = kzalloc_objs(*cmds, array->entry_num, GFP_KERNEL); if (!cmds) return -ENOMEM; cur = cmds; @@ -1023,7 +1023,7 @@ static struct mock_dev *mock_dev_create(unsigned long dev_flags) if (dev_flags & ~valid_flags) return ERR_PTR(-EINVAL); - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return ERR_PTR(-ENOMEM); @@ -1448,7 +1448,7 @@ static struct selftest_access *iommufd_test_alloc_access(void) struct selftest_access *staccess; struct file *filep; - staccess = kzalloc(sizeof(*staccess), GFP_KERNEL_ACCOUNT); + staccess = kzalloc_obj(*staccess, GFP_KERNEL_ACCOUNT); if (!staccess) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&staccess->items); @@ -1592,7 +1592,7 @@ static int iommufd_test_access_pages(struct iommufd_ucmd *ucmd, npages = (ALIGN(iova + length, PAGE_SIZE) - ALIGN_DOWN(iova, PAGE_SIZE)) / PAGE_SIZE; - pages = kvcalloc(npages, sizeof(*pages), GFP_KERNEL_ACCOUNT); + pages = kvzalloc_objs(*pages, npages, GFP_KERNEL_ACCOUNT); if (!pages) { rc = -ENOMEM; goto out_put; @@ -1622,7 +1622,7 @@ static int iommufd_test_access_pages(struct iommufd_ucmd *ucmd, goto out_unaccess; } - item = kzalloc(sizeof(*item), GFP_KERNEL_ACCOUNT); + item = kzalloc_obj(*item, GFP_KERNEL_ACCOUNT); if (!item) { rc = -ENOMEM; goto out_unaccess; @@ -2032,7 +2032,7 @@ static int iommufd_test_dmabuf_get(struct iommufd_ucmd *ucmd, if (len == 0 || len > PAGE_SIZE * 512) return -EINVAL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/iommu/iommufd/viommu.c b/drivers/iommu/iommufd/viommu.c index 462b457ffd0c..4081deda9b33 100644 --- a/drivers/iommu/iommufd/viommu.c +++ b/drivers/iommu/iommufd/viommu.c @@ -312,7 +312,7 @@ iommufd_hw_queue_alloc_phys(struct iommu_hw_queue_alloc *cmd, * Use kvcalloc() to avoid memory fragmentation for a large page array. * Set __GFP_NOWARN to avoid syzkaller blowups */ - pages = kvcalloc(max_npages, sizeof(*pages), GFP_KERNEL | __GFP_NOWARN); + pages = kvzalloc_objs(*pages, max_npages, GFP_KERNEL | __GFP_NOWARN); if (!pages) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 18f839721813..ac9d6a4c1432 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -715,9 +715,8 @@ int iova_domain_init_rcaches(struct iova_domain *iovad) unsigned int cpu; int i, ret; - iovad->rcaches = kcalloc(IOVA_RANGE_CACHE_MAX_SIZE, - sizeof(struct iova_rcache), - GFP_KERNEL); + iovad->rcaches = kzalloc_objs(struct iova_rcache, + IOVA_RANGE_CACHE_MAX_SIZE, GFP_KERNEL); if (!iovad->rcaches) return -ENOMEM; diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ca848288dbf2..bd18c3a7ee54 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -566,7 +566,7 @@ static struct iommu_domain *ipmmu_domain_alloc_paging(struct device *dev) { struct ipmmu_vmsa_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return NULL; diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 819add75a665..00b4ea90e500 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -306,7 +306,7 @@ static struct iommu_domain *msm_iommu_domain_alloc_paging(struct device *dev) { struct msm_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) goto fail_nomem; @@ -605,7 +605,7 @@ static int insert_iommu_master(struct device *dev, int sid; if (list_empty(&(*iommu)->ctx_list)) { - master = kzalloc(sizeof(*master), GFP_ATOMIC); + master = kzalloc_obj(*master, GFP_ATOMIC); if (!master) { dev_err(dev, "Failed to allocate iommu_master\n"); return -ENOMEM; diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 60fcd3d3b5eb..6dd60f4a8087 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -704,7 +704,7 @@ static struct iommu_domain *mtk_iommu_domain_alloc_paging(struct device *dev) { struct mtk_iommu_domain *dom; - dom = kzalloc(sizeof(*dom), GFP_KERNEL); + dom = kzalloc_obj(*dom, GFP_KERNEL); if (!dom) return NULL; mutex_init(&dom->mutex); diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index c8d8eff5373d..e5ad7fa6e4e7 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -284,7 +284,7 @@ static struct iommu_domain *mtk_iommu_v1_domain_alloc_paging(struct device *dev) { struct mtk_iommu_v1_domain *dom; - dom = kzalloc(sizeof(*dom), GFP_KERNEL); + dom = kzalloc_obj(*dom, GFP_KERNEL); if (!dom) return NULL; diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c index 259f65291d90..b0853f69f98d 100644 --- a/drivers/iommu/omap-iommu-debug.c +++ b/drivers/iommu/omap-iommu-debug.c @@ -147,7 +147,7 @@ static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s) num = obj->nr_tlb_entries; - cr = kcalloc(num, sizeof(*cr), GFP_KERNEL); + cr = kzalloc_objs(*cr, num, GFP_KERNEL); if (!cr) return 0; diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 768973b7e511..f4fd0fba6a8c 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -311,7 +311,7 @@ static struct cr_regs *iotlb_alloc_cr(struct omap_iommu *obj, return ERR_PTR(-EINVAL); } - cr = kmalloc(sizeof(*cr), GFP_KERNEL); + cr = kmalloc_obj(*cr, GFP_KERNEL); if (!cr) return ERR_PTR(-ENOMEM); @@ -1395,8 +1395,7 @@ static int omap_iommu_attach_init(struct device *dev, if (!odomain->num_iommus) return -ENODEV; - odomain->iommus = kcalloc(odomain->num_iommus, sizeof(*iommu), - GFP_ATOMIC); + odomain->iommus = kzalloc_objs(*iommu, odomain->num_iommus, GFP_ATOMIC); if (!odomain->iommus) return -ENOMEM; @@ -1564,7 +1563,7 @@ static struct iommu_domain *omap_iommu_domain_alloc_paging(struct device *dev) { struct omap_iommu_domain *omap_domain; - omap_domain = kzalloc(sizeof(*omap_domain), GFP_KERNEL); + omap_domain = kzalloc_obj(*omap_domain, GFP_KERNEL); if (!omap_domain) return NULL; @@ -1656,7 +1655,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev) if (num_iommus < 0) return ERR_PTR(-ENODEV); - arch_data = kcalloc(num_iommus + 1, sizeof(*arch_data), GFP_KERNEL); + arch_data = kzalloc_objs(*arch_data, num_iommus + 1, GFP_KERNEL); if (!arch_data) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c index 2d8fb0859f30..26068cefa837 100644 --- a/drivers/iommu/riscv/iommu.c +++ b/drivers/iommu/riscv/iommu.c @@ -853,7 +853,7 @@ static int riscv_iommu_bond_link(struct riscv_iommu_domain *domain, struct riscv_iommu_bond *bond; struct list_head *bonds; - bond = kzalloc(sizeof(*bond), GFP_KERNEL); + bond = kzalloc_obj(*bond, GFP_KERNEL); if (!bond) return -ENOMEM; bond->dev = dev; @@ -1380,7 +1380,7 @@ static struct iommu_domain *riscv_iommu_alloc_paging_domain(struct device *dev) return ERR_PTR(-ENODEV); } - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return ERR_PTR(-ENOMEM); @@ -1504,7 +1504,7 @@ static struct iommu_device *riscv_iommu_probe_device(struct device *dev) if (iommu->ddt_mode <= RISCV_IOMMU_DDTP_IOMMU_MODE_BARE) return ERR_PTR(-ENODEV); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); /* diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 85f3667e797c..e0cfe7bbef8c 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1064,7 +1064,7 @@ static struct iommu_domain *rk_iommu_domain_alloc_paging(struct device *dev) struct rk_iommu_domain *rk_domain; struct rk_iommu *iommu; - rk_domain = kzalloc(sizeof(*rk_domain), GFP_KERNEL); + rk_domain = kzalloc_obj(*rk_domain, GFP_KERNEL); if (!rk_domain) return NULL; diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index fe679850af28..dcef361f9806 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -531,7 +531,7 @@ static struct iommu_domain *s390_domain_alloc_paging(struct device *dev) struct s390_domain *s390_domain; u64 aperture_size; - s390_domain = kzalloc(sizeof(*s390_domain), GFP_KERNEL); + s390_domain = kzalloc_obj(*s390_domain, GFP_KERNEL); if (!s390_domain) return NULL; diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 555d4505c747..0164c08ed9dc 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -137,7 +137,7 @@ static struct iommu_domain *sprd_iommu_domain_alloc_paging(struct device *dev) { struct sprd_iommu_domain *dom; - dom = kzalloc(sizeof(*dom), GFP_KERNEL); + dom = kzalloc_obj(*dom, GFP_KERNEL); if (!dom) return NULL; diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 90b26fe21817..30f93e691c09 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -686,7 +686,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev) { struct sun50i_iommu_domain *sun50i_domain; - sun50i_domain = kzalloc(sizeof(*sun50i_domain), GFP_KERNEL); + sun50i_domain = kzalloc_obj(*sun50i_domain, GFP_KERNEL); if (!sun50i_domain) return NULL; diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index c391e7f2cde6..4890a88ac169 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -289,7 +289,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev) { struct tegra_smmu_as *as; - as = kzalloc(sizeof(*as), GFP_KERNEL); + as = kzalloc_obj(*as, GFP_KERNEL); if (!as) return NULL; @@ -308,7 +308,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev) return NULL; } - as->pts = kcalloc(SMMU_NUM_PDE, sizeof(*as->pts), GFP_KERNEL); + as->pts = kzalloc_objs(*as->pts, SMMU_NUM_PDE, GFP_KERNEL); if (!as->pts) { kfree(as->count); iommu_free_pages(as->pd); diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index d314fa5cd847..ba8a70fdb494 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -231,7 +231,7 @@ static int __viommu_add_req(struct viommu_dev *viommu, void *buf, size_t len, if (write_offset <= 0) return -EINVAL; - req = kzalloc(struct_size(req, buf, len), GFP_ATOMIC); + req = kzalloc_flex(*req, buf, len, GFP_ATOMIC); if (!req) return -ENOMEM; @@ -333,7 +333,7 @@ static int viommu_add_mapping(struct viommu_domain *vdomain, u64 iova, u64 end, unsigned long irqflags; struct viommu_mapping *mapping; - mapping = kzalloc(sizeof(*mapping), GFP_ATOMIC); + mapping = kzalloc_obj(*mapping, GFP_ATOMIC); if (!mapping) return -ENOMEM; @@ -670,7 +670,7 @@ static struct iommu_domain *viommu_domain_alloc_paging(struct device *dev) return ERR_PTR(-ENODEV); } - vdomain = kzalloc(sizeof(*vdomain), GFP_KERNEL); + vdomain = kzalloc_obj(*vdomain, GFP_KERNEL); if (!vdomain) return ERR_PTR(-ENOMEM); @@ -1028,7 +1028,7 @@ static struct iommu_device *viommu_probe_device(struct device *dev) if (!viommu) return ERR_PTR(-ENODEV); - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c index cbfdadecb23b..6d1058dc8faa 100644 --- a/drivers/ipack/carriers/tpci200.c +++ b/drivers/ipack/carriers/tpci200.c @@ -209,7 +209,7 @@ static int tpci200_request_irq(struct ipack_device *dev, goto out_unlock; } - slot_irq = kzalloc(sizeof(struct slot_irq), GFP_KERNEL); + slot_irq = kzalloc_obj(struct slot_irq, GFP_KERNEL); if (slot_irq == NULL) { dev_err(&dev->dev, "Slot [%d:%d] unable to allocate memory for IRQ !\n", @@ -461,8 +461,8 @@ static int tpci200_install(struct tpci200_board *tpci200) { int res; - tpci200->slots = kcalloc(TPCI200_NB_SLOT, sizeof(struct tpci200_slot), - GFP_KERNEL); + tpci200->slots = kzalloc_objs(struct tpci200_slot, TPCI200_NB_SLOT, + GFP_KERNEL); if (tpci200->slots == NULL) return -ENOMEM; @@ -487,7 +487,7 @@ static int tpci200_create_device(struct tpci200_board *tpci200, int i) int ret; enum ipack_space space; struct ipack_device *dev = - kzalloc(sizeof(struct ipack_device), GFP_KERNEL); + kzalloc_obj(struct ipack_device, GFP_KERNEL); if (!dev) return -ENOMEM; dev->slot = i; @@ -521,11 +521,11 @@ static int tpci200_pci_probe(struct pci_dev *pdev, struct tpci200_board *tpci200; u32 reg32; - tpci200 = kzalloc(sizeof(struct tpci200_board), GFP_KERNEL); + tpci200 = kzalloc_obj(struct tpci200_board, GFP_KERNEL); if (!tpci200) return -ENOMEM; - tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL); + tpci200->info = kzalloc_obj(struct tpci200_infos, GFP_KERNEL); if (!tpci200->info) { ret = -ENOMEM; goto err_tpci200; diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index ba2e9e52d72b..563fdf197101 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c @@ -688,7 +688,7 @@ static int ipoctal_probe(struct ipack_device *dev) int res; struct ipoctal *ipoctal; - ipoctal = kzalloc(sizeof(struct ipoctal), GFP_KERNEL); + ipoctal = kzalloc_obj(struct ipoctal, GFP_KERNEL); if (ipoctal == NULL) return -ENOMEM; diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index 57d232c909f9..d4ec786bf98d 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -203,7 +203,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots, int bus_nr; struct ipack_bus_device *bus; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) return NULL; diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c index 495848442b35..8776f2ba4bae 100644 --- a/drivers/irqchip/exynos-combiner.c +++ b/drivers/irqchip/exynos-combiner.c @@ -176,7 +176,7 @@ static void __init combiner_init(void __iomem *combiner_base, nr_irq = max_nr * IRQ_IN_COMBINER; - combiner_data = kcalloc(max_nr, sizeof (*combiner_data), GFP_KERNEL); + combiner_data = kzalloc_objs(*combiner_data, max_nr, GFP_KERNEL); if (!combiner_data) return; diff --git a/drivers/irqchip/irq-al-fic.c b/drivers/irqchip/irq-al-fic.c index 8f300843bbca..f6b637bebcc0 100644 --- a/drivers/irqchip/irq-al-fic.c +++ b/drivers/irqchip/irq-al-fic.c @@ -194,7 +194,7 @@ static struct al_fic *al_fic_wire_init(struct device_node *node, int ret; u32 control = CONTROL_MASK_MSI_X; - fic = kzalloc(sizeof(*fic), GFP_KERNEL); + fic = kzalloc_obj(*fic, GFP_KERNEL); if (!fic) return ERR_PTR(-ENOMEM); diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c index 159d9ec7c0dd..0fb09ddc43ef 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -192,7 +192,8 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv, struct device static int alpine_msix_init(struct device_node *node, struct device_node *parent) { - struct alpine_msix_data *priv __free(kfree) = kzalloc(sizeof(*priv), GFP_KERNEL); + struct alpine_msix_data *priv __free(kfree) = kzalloc_obj(*priv, + GFP_KERNEL); struct resource res; int ret; diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c index 3c70364e7cdd..e09939e279f6 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -921,7 +921,7 @@ static void build_fiq_affinity(struct aic_irq_chip *ic, struct device_node *aff) if (WARN_ON(n < 0)) return; - ic->fiq_aff[fiq] = kzalloc(sizeof(*ic->fiq_aff[fiq]), GFP_KERNEL); + ic->fiq_aff[fiq] = kzalloc_obj(*ic->fiq_aff[fiq], GFP_KERNEL); if (!ic->fiq_aff[fiq]) return; @@ -959,7 +959,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p if (WARN_ON(!regs)) return -EIO; - irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); + irqc = kzalloc_obj(*irqc, GFP_KERNEL); if (!irqc) { iounmap(regs); return -ENOMEM; diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index a4d03a2d1569..84e8f204edef 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -835,7 +835,7 @@ static int __init mpic_of_init(struct device_node *node, struct device_node *par struct mpic *mpic; int err; - mpic = kzalloc(sizeof(*mpic), GFP_KERNEL); + mpic = kzalloc_obj(*mpic, GFP_KERNEL); if (WARN_ON(!mpic)) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c index 87c1feb999ff..35189fd06b3d 100644 --- a/drivers/irqchip/irq-aspeed-i2c-ic.c +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c @@ -66,7 +66,7 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node, struct aspeed_i2c_ic *i2c_ic; int ret = 0; - i2c_ic = kzalloc(sizeof(*i2c_ic), GFP_KERNEL); + i2c_ic = kzalloc_obj(*i2c_ic, GFP_KERNEL); if (!i2c_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-intc.c b/drivers/irqchip/irq-aspeed-intc.c index 8330221799a0..f3ae18de3b95 100644 --- a/drivers/irqchip/irq-aspeed-intc.c +++ b/drivers/irqchip/irq-aspeed-intc.c @@ -89,7 +89,7 @@ static int __init aspeed_intc_ic_of_init(struct device_node *node, struct aspeed_intc_ic *intc_ic; int irq, i, ret = 0; - intc_ic = kzalloc(sizeof(*intc_ic), GFP_KERNEL); + intc_ic = kzalloc_obj(*intc_ic, GFP_KERNEL); if (!intc_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-scu-ic.c b/drivers/irqchip/irq-aspeed-scu-ic.c index 7398c3b9eace..170fc82091da 100644 --- a/drivers/irqchip/irq-aspeed-scu-ic.c +++ b/drivers/irqchip/irq-aspeed-scu-ic.c @@ -270,7 +270,7 @@ static int __init aspeed_scu_ic_of_init(struct device_node *node, struct device_ if (!variant) return -ENODEV; - scu_ic = kzalloc(sizeof(*scu_ic), GFP_KERNEL); + scu_ic = kzalloc_obj(*scu_ic, GFP_KERNEL); if (!scu_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-vic.c b/drivers/irqchip/irq-aspeed-vic.c index 9b665b5bb531..35cd50aaed81 100644 --- a/drivers/irqchip/irq-aspeed-vic.c +++ b/drivers/irqchip/irq-aspeed-vic.c @@ -196,7 +196,7 @@ static int __init avic_of_init(struct device_node *node, if (WARN_ON(!regs)) return -EIO; - vic = kzalloc(sizeof(struct aspeed_vic), GFP_KERNEL); + vic = kzalloc_obj(struct aspeed_vic, GFP_KERNEL); if (WARN_ON(!vic)) { iounmap(regs); return -ENOMEM; diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index e68853815c7a..087eed7ed6db 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c @@ -213,7 +213,7 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node, if (!reg_base) return ERR_PTR(-ENOMEM); - aic = kcalloc(nchips, sizeof(*aic), GFP_KERNEL); + aic = kzalloc_objs(*aic, nchips, GFP_KERNEL); if (!aic) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/irqchip/irq-bcm2712-mip.c b/drivers/irqchip/irq-bcm2712-mip.c index 4761974ad650..118ab4ac6714 100644 --- a/drivers/irqchip/irq-bcm2712-mip.c +++ b/drivers/irqchip/irq-bcm2712-mip.c @@ -238,7 +238,7 @@ static int mip_msi_probe(struct platform_device *pdev, struct device_node *paren struct mip_priv *mip; int ret; - mip = kzalloc(sizeof(*mip), GFP_KERNEL); + mip = kzalloc_obj(*mip, GFP_KERNEL); if (!mip) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c index ca4e141c5bc2..956c53dffca3 100644 --- a/drivers/irqchip/irq-bcm6345-l1.c +++ b/drivers/irqchip/irq-bcm6345-l1.c @@ -238,8 +238,8 @@ static int __init bcm6345_l1_init_one(struct device_node *dn, else if (intc->n_words != n_words) return -EINVAL; - cpu = intc->cpus[idx] = kzalloc(struct_size(cpu, enable_cache, n_words), - GFP_KERNEL); + cpu = intc->cpus[idx] = kzalloc_flex(*cpu, enable_cache, n_words, + GFP_KERNEL); if (!cpu) return -ENOMEM; @@ -296,7 +296,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn, unsigned int idx; int ret; - intc = kzalloc(sizeof(*intc), GFP_KERNEL); + intc = kzalloc_obj(*intc, GFP_KERNEL); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c index 45c4824be92f..3f838f019f4d 100644 --- a/drivers/irqchip/irq-bcm7038-l1.c +++ b/drivers/irqchip/irq-bcm7038-l1.c @@ -242,8 +242,8 @@ static int bcm7038_l1_init_one(struct device_node *dn, unsigned int idx, return -EINVAL; } - cpu = intc->cpus[idx] = kzalloc(struct_size(cpu, mask_cache, n_words), - GFP_KERNEL); + cpu = intc->cpus[idx] = kzalloc_flex(*cpu, mask_cache, n_words, + GFP_KERNEL); if (!cpu) return -ENOMEM; @@ -398,7 +398,7 @@ static int bcm7038_l1_probe(struct platform_device *pdev, struct device_node *pa struct bcm7038_l1_chip *intc; int idx, ret; - intc = kzalloc(sizeof(*intc), GFP_KERNEL); + intc = kzalloc_obj(*intc, GFP_KERNEL); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index 518c9d4366a5..341b4e62b942 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c @@ -220,7 +220,7 @@ static int bcm7120_l2_intc_probe(struct platform_device *pdev, struct device_nod unsigned int idx, irq, flags; u32 valid_mask[MAX_WORDS] = { }; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -231,8 +231,8 @@ static int bcm7120_l2_intc_probe(struct platform_device *pdev, struct device_nod goto out_unmap; } - data->l1_data = kcalloc(data->num_parent_irqs, sizeof(*data->l1_data), - GFP_KERNEL); + data->l1_data = kzalloc_objs(*data->l1_data, data->num_parent_irqs, + GFP_KERNEL); if (!data->l1_data) { ret = -ENOMEM; goto out_free_l1_data; diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c index bb7078d6524f..c5f4c79e7ea9 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c @@ -151,7 +151,7 @@ static int brcmstb_l2_intc_probe(struct platform_device *pdev, struct device_nod int parent_irq; void __iomem *base; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c index c4b73ba2323b..80b9f7bc7bbd 100644 --- a/drivers/irqchip/irq-clps711x.c +++ b/drivers/irqchip/irq-clps711x.c @@ -155,7 +155,7 @@ static int __init _clps711x_intc_init(struct device_node *np, { int err; - clps711x_intc = kzalloc(sizeof(*clps711x_intc), GFP_KERNEL); + clps711x_intc = kzalloc_obj(*clps711x_intc, GFP_KERNEL); if (!clps711x_intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index 66bb39e24a52..c3ddffc28bbd 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -199,7 +199,7 @@ static int __init crossbar_of_init(struct device_node *node) const __be32 *irqsr; int ret = -ENOMEM; - cb = kzalloc(sizeof(*cb), GFP_KERNEL); + cb = kzalloc_obj(*cb, GFP_KERNEL); if (!cb) return ret; @@ -268,7 +268,7 @@ static int __init crossbar_of_init(struct device_node *node) } - cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL); + cb->register_offsets = kzalloc_objs(int, max, GFP_KERNEL); if (!cb->register_offsets) goto err_irq_map; diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index 8a3410c2b7b5..d9215d785bcc 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c @@ -293,7 +293,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode, int ret; struct v2m_data *v2m; - v2m = kzalloc(sizeof(struct v2m_data), GFP_KERNEL); + v2m = kzalloc_obj(struct v2m_data, GFP_KERNEL); if (!v2m) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 2988def30972..4f3212caa1ef 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1926,8 +1926,8 @@ static int its_vlpi_map(struct irq_data *d, struct its_cmd_info *info) if (!its_dev->event_map.vm) { struct its_vlpi_map *maps; - maps = kcalloc(its_dev->event_map.nr_lpis, sizeof(*maps), - GFP_ATOMIC); + maps = kzalloc_objs(*maps, its_dev->event_map.nr_lpis, + GFP_ATOMIC); if (!maps) return -ENOMEM; @@ -2108,7 +2108,7 @@ static struct lpi_range *mk_lpi_range(u32 base, u32 span) { struct lpi_range *range; - range = kmalloc(sizeof(*range), GFP_KERNEL); + range = kmalloc_obj(*range, GFP_KERNEL); if (range) { range->base_id = base; range->span = span; @@ -2927,7 +2927,7 @@ static int allocate_vpe_l1_table(void) if (val & GICR_VPROPBASER_4_1_VALID) goto out; - gic_data_rdist()->vpe_table_mask = kzalloc(sizeof(cpumask_t), GFP_ATOMIC); + gic_data_rdist()->vpe_table_mask = kzalloc_obj(cpumask_t, GFP_ATOMIC); if (!gic_data_rdist()->vpe_table_mask) return -ENOMEM; @@ -3025,8 +3025,8 @@ static int its_alloc_collections(struct its_node *its) { int i; - its->collections = kcalloc(nr_cpu_ids, sizeof(*its->collections), - GFP_KERNEL); + its->collections = kzalloc_objs(*its->collections, nr_cpu_ids, + GFP_KERNEL); if (!its->collections) return -ENOMEM; @@ -3493,7 +3493,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, itt = itt_alloc_pool(its->numa_node, sz); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (alloc_lpis) { lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis); @@ -5139,7 +5139,7 @@ static int its_init_domain(struct its_node *its) }; struct msi_domain_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -5169,8 +5169,7 @@ static int its_init_vpe_domain(void) its = list_first_entry(&its_nodes, struct its_node, entry); entries = roundup_pow_of_two(nr_cpu_ids); - vpe_proxy.vpes = kcalloc(entries, sizeof(*vpe_proxy.vpes), - GFP_KERNEL); + vpe_proxy.vpes = kzalloc_objs(*vpe_proxy.vpes, entries, GFP_KERNEL); if (!vpe_proxy.vpes) return -ENOMEM; @@ -5514,7 +5513,7 @@ static struct its_node __init *its_node_init(struct resource *res, pr_info("ITS %pR\n", res); - its = kzalloc(sizeof(*its), GFP_KERNEL); + its = kzalloc_obj(*its, GFP_KERNEL); if (!its) goto out_unmap; @@ -5680,8 +5679,7 @@ static void __init acpi_table_parse_srat_its(void) if (count <= 0) return; - its_srat_maps = kmalloc_array(count, sizeof(struct its_srat_map), - GFP_KERNEL); + its_srat_maps = kmalloc_objs(struct its_srat_map, count, GFP_KERNEL); if (!its_srat_maps) return; diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c index aa11bbe8026a..9254a5e92577 100644 --- a/drivers/irqchip/irq-gic-v3-mbi.c +++ b/drivers/irqchip/irq-gic-v3-mbi.c @@ -231,7 +231,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent) return -EINVAL; mbi_range_nr = n / 2; - mbi_ranges = kcalloc(mbi_range_nr, sizeof(*mbi_ranges), GFP_KERNEL); + mbi_ranges = kzalloc_objs(*mbi_ranges, mbi_range_nr, GFP_KERNEL); if (!mbi_ranges) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 6607ab58f72e..602870a2b8f8 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2090,7 +2090,7 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) if (!nr_parts) goto out_put_node; - parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); if (WARN_ON(!parts)) goto out_put_node; @@ -2218,8 +2218,7 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare if (of_property_read_u32(node, "#redistributor-regions", &nr_redist_regions)) nr_redist_regions = 1; - rdist_regs = kcalloc(nr_redist_regions, sizeof(*rdist_regs), - GFP_KERNEL); + rdist_regs = kzalloc_objs(*rdist_regs, nr_redist_regions, GFP_KERNEL); if (!rdist_regs) { err = -ENOMEM; goto out_unmap_dist; diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c index 8bc4bb121088..8379e975a172 100644 --- a/drivers/irqchip/irq-gic-v5-irs.c +++ b/drivers/irqchip/irq-gic-v5-irs.c @@ -727,7 +727,7 @@ static int __init gicv5_irs_of_init(struct device_node *node) u32 idr; int ret; - irs_data = kzalloc(sizeof(*irs_data), GFP_KERNEL); + irs_data = kzalloc_obj(*irs_data, GFP_KERNEL); if (!irs_data) return -ENOMEM; @@ -913,7 +913,7 @@ static int __init gic_acpi_parse_madt_irs(union acpi_subtable_headers *header, int ret; /* Per-IRS data structure */ - irs_data = kzalloc(sizeof(*irs_data), GFP_KERNEL); + irs_data = kzalloc_obj(*irs_data, GFP_KERNEL); if (!irs_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c index 8c4cf8430871..96c67e168e6f 100644 --- a/drivers/irqchip/irq-gic-v5-its.c +++ b/drivers/irqchip/irq-gic-v5-its.c @@ -757,7 +757,7 @@ static struct gicv5_its_dev *gicv5_its_alloc_device(struct gicv5_its_chip_data * return ERR_PTR(-EBUSY); } - its_dev = kzalloc(sizeof(*its_dev), GFP_KERNEL); + its_dev = kzalloc_obj(*its_dev, GFP_KERNEL); if (!its_dev) return ERR_PTR(-ENOMEM); @@ -1100,7 +1100,7 @@ static int gicv5_its_init_domain(struct gicv5_its_chip_data *its, struct irq_dom }; struct msi_domain_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -1125,7 +1125,7 @@ static int __init gicv5_its_init_bases(void __iomem *its_base, struct fwnode_han bool enabled; int ret; - its_node = kzalloc(sizeof(*its_node), GFP_KERNEL); + its_node = kzalloc_obj(*its_node, GFP_KERNEL); if (!its_node) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v5-iwb.c b/drivers/irqchip/irq-gic-v5-iwb.c index c7d5fd34d053..562d3f0df24e 100644 --- a/drivers/irqchip/irq-gic-v5-iwb.c +++ b/drivers/irqchip/irq-gic-v5-iwb.c @@ -219,8 +219,8 @@ gicv5_iwb_init_bases(void __iomem *iwb_base, struct platform_device *pdev) unsigned int n; int ret; - struct gicv5_iwb_chip_data *iwb_node __free(kfree) = kzalloc(sizeof(*iwb_node), - GFP_KERNEL); + struct gicv5_iwb_chip_data *iwb_node __free(kfree) = kzalloc_obj(*iwb_node, + GFP_KERNEL); if (!iwb_node) return ERR_PTR(-ENOMEM); diff --git a/drivers/irqchip/irq-goldfish-pic.c b/drivers/irqchip/irq-goldfish-pic.c index a8b23b507ecd..c2047ccf4360 100644 --- a/drivers/irqchip/irq-goldfish-pic.c +++ b/drivers/irqchip/irq-goldfish-pic.c @@ -61,7 +61,7 @@ static int __init goldfish_pic_of_init(struct device_node *of_node, unsigned int parent_irq; int ret = 0; - gfpic = kzalloc(sizeof(*gfpic), GFP_KERNEL); + gfpic = kzalloc_obj(*gfpic, GFP_KERNEL); if (!gfpic) { ret = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-idt3243x.c b/drivers/irqchip/irq-idt3243x.c index f8324fb1fe8f..6812396c6268 100644 --- a/drivers/irqchip/irq-idt3243x.c +++ b/drivers/irqchip/irq-idt3243x.c @@ -52,7 +52,7 @@ static int idt_pic_init(struct device_node *of_node, struct device_node *parent) unsigned int parent_irq; int ret = 0; - idtpic = kzalloc(sizeof(*idtpic), GFP_KERNEL); + idtpic = kzalloc_obj(*idtpic, GFP_KERNEL); if (!idtpic) { ret = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c index 04f7ba0657be..7fff14c7b917 100644 --- a/drivers/irqchip/irq-imx-gpcv2.c +++ b/drivers/irqchip/irq-imx-gpcv2.c @@ -231,7 +231,7 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, return -ENXIO; } - cd = kzalloc(sizeof(struct gpcv2_irqchip_data), GFP_KERNEL); + cd = kzalloc_obj(struct gpcv2_irqchip_data, GFP_KERNEL); if (!cd) return -ENOMEM; diff --git a/drivers/irqchip/irq-ingenic-tcu.c b/drivers/irqchip/irq-ingenic-tcu.c index 794ecba717c9..e4028ddeb0e8 100644 --- a/drivers/irqchip/irq-ingenic-tcu.c +++ b/drivers/irqchip/irq-ingenic-tcu.c @@ -96,7 +96,7 @@ static int __init ingenic_tcu_irq_init(struct device_node *np, if (IS_ERR(map)) return PTR_ERR(map); - tcu = kzalloc(sizeof(*tcu), GFP_KERNEL); + tcu = kzalloc_obj(*tcu, GFP_KERNEL); if (!tcu) return -ENOMEM; diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c index 52393724f213..fbbe655fa234 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -67,7 +67,7 @@ static int __init ingenic_intc_of_init(struct device_node *node, int parent_irq, err = 0; unsigned i; - intc = kzalloc(sizeof(*intc), GFP_KERNEL); + intc = kzalloc_obj(*intc, GFP_KERNEL); if (!intc) { err = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-loongarch-avec.c b/drivers/irqchip/irq-loongarch-avec.c index fb8efde95393..cbea378c25c3 100644 --- a/drivers/irqchip/irq-loongarch-avec.c +++ b/drivers/irqchip/irq-loongarch-avec.c @@ -276,7 +276,7 @@ static int avecintc_domain_alloc(struct irq_domain *domain, unsigned int virq, { for (unsigned int i = 0; i < nr_irqs; i++) { struct irq_data *irqd = irq_domain_get_irq_data(domain, virq + i); - struct avecintc_data *adata = kzalloc(sizeof(*adata), GFP_KERNEL); + struct avecintc_data *adata = kzalloc_obj(*adata, GFP_KERNEL); int ret; if (!adata) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 37e7e1f9bbe3..b219cd18a8f7 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -584,7 +584,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, struct eiointc_priv *priv; int node; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -633,7 +633,7 @@ static int __init eiointc_of_init(struct device_node *of_node, struct irq_data *irq_data; int parent_irq, ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-htpic.c b/drivers/irqchip/irq-loongson-htpic.c index 1c691c4be989..f0ea5dad7a1c 100644 --- a/drivers/irqchip/irq-loongson-htpic.c +++ b/drivers/irqchip/irq-loongson-htpic.c @@ -95,7 +95,7 @@ static int __init htpic_of_init(struct device_node *node, struct device_node *pa return -ENODEV; } - htpic = kzalloc(sizeof(*htpic), GFP_KERNEL); + htpic = kzalloc_obj(*htpic, GFP_KERNEL); if (!htpic) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 5a3339da97ad..4645948222ee 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -192,7 +192,7 @@ static int htvec_init(phys_addr_t addr, unsigned long size, int i; struct htvec *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 551597e2c428..44b03de6091a 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -205,7 +205,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, struct irq_domain *domain; struct liointc_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-lpc.c b/drivers/irqchip/irq-loongson-pch-lpc.c index 3a125f3e4287..7a074077d8ba 100644 --- a/drivers/irqchip/irq-loongson-pch-lpc.c +++ b/drivers/irqchip/irq-loongson-pch-lpc.c @@ -183,7 +183,7 @@ int __init pch_lpc_acpi_init(struct irq_domain *parent, struct irq_fwspec fwspec; struct fwnode_handle *irq_handle; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c index 91c856c65d9d..9a2d3804bc6e 100644 --- a/drivers/irqchip/irq-loongson-pch-msi.c +++ b/drivers/irqchip/irq-loongson-pch-msi.c @@ -177,7 +177,7 @@ static int pch_msi_init(phys_addr_t msg_address, int irq_base, int irq_count, int ret; struct pch_msi_data *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index f2acaf93f552..b50fd928e1f6 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -329,7 +329,7 @@ static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base, struct pch_pic *priv; int i; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-lpc32xx.c b/drivers/irqchip/irq-lpc32xx.c index 14cca44baa14..7dfd46d8dab2 100644 --- a/drivers/irqchip/irq-lpc32xx.c +++ b/drivers/irqchip/irq-lpc32xx.c @@ -198,7 +198,7 @@ static int __init lpc32xx_of_ic_init(struct device_node *node, const __be32 *reg = of_get_property(node, "reg", NULL); u32 parent_irq, i, addr = reg ? be32_to_cpu(*reg) : 0; - irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); + irqc = kzalloc_obj(*irqc, GFP_KERNEL); if (!irqc) return -ENOMEM; diff --git a/drivers/irqchip/irq-ls1x.c b/drivers/irqchip/irq-ls1x.c index 589d32007fca..5c39e02d40aa 100644 --- a/drivers/irqchip/irq-ls1x.c +++ b/drivers/irqchip/irq-ls1x.c @@ -108,7 +108,7 @@ static int __init ls1x_intc_of_init(struct device_node *node, struct ls1x_intc_priv *priv; int parent_irq, err = 0; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c index 31093a8ab67c..15f4d17a2612 100644 --- a/drivers/irqchip/irq-mchp-eic.c +++ b/drivers/irqchip/irq-mchp-eic.c @@ -209,7 +209,7 @@ static int mchp_eic_probe(struct platform_device *pdev, struct device_node *pare struct irq_domain *parent_domain = NULL; int ret, i; - eic = kzalloc(sizeof(*eic), GFP_KERNEL); + eic = kzalloc_obj(*eic, GFP_KERNEL); if (!eic) return -ENOMEM; diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c index 3fcbb044ae60..a19fa5a5ba3e 100644 --- a/drivers/irqchip/irq-meson-gpio.c +++ b/drivers/irqchip/irq-meson-gpio.c @@ -601,7 +601,7 @@ static int meson_gpio_irq_probe(struct platform_device *pdev, struct device_node return -ENXIO; } - ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kzalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return -ENOMEM; diff --git a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c index ac784ef3ed4b..37a8221be9fa 100644 --- a/drivers/irqchip/irq-mips-cpu.c +++ b/drivers/irqchip/irq-mips-cpu.c @@ -237,7 +237,7 @@ static void mips_cpu_register_ipi_domain(struct device_node *of_node) { struct cpu_ipi_domain_state *ipi_domain_state; - ipi_domain_state = kzalloc(sizeof(*ipi_domain_state), GFP_KERNEL); + ipi_domain_state = kzalloc_obj(*ipi_domain_state, GFP_KERNEL); ipi_domain = irq_domain_create_hierarchy(irq_domain, IRQ_DOMAIN_FLAG_IPI_SINGLE, 2, of_fwnode_handle(of_node), &mips_cpu_ipi_chip_ops, ipi_domain_state); diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c index 7f760f555a76..e4c1281e9ae4 100644 --- a/drivers/irqchip/irq-mst-intc.c +++ b/drivers/irqchip/irq-mst-intc.c @@ -263,7 +263,7 @@ static int __init mst_intc_of_init(struct device_node *dn, of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end)) return -EINVAL; - cd = kzalloc(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); if (!cd) return -ENOMEM; diff --git a/drivers/irqchip/irq-mtk-cirq.c b/drivers/irqchip/irq-mtk-cirq.c index 9571f622774e..1ac2b2ae94cf 100644 --- a/drivers/irqchip/irq-mtk-cirq.c +++ b/drivers/irqchip/irq-mtk-cirq.c @@ -311,7 +311,7 @@ static int __init mtk_cirq_of_init(struct device_node *node, return -EINVAL; } - cirq_data = kzalloc(sizeof(*cirq_data), GFP_KERNEL); + cirq_data = kzalloc_obj(*cirq_data, GFP_KERNEL); if (!cirq_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c index 6895e7096b27..1988bb02b4d3 100644 --- a/drivers/irqchip/irq-mtk-sysirq.c +++ b/drivers/irqchip/irq-mtk-sysirq.c @@ -133,7 +133,7 @@ static int __init mtk_sysirq_of_init(struct device_node *node, return -EINVAL; } - chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); if (!chip_data) return -ENOMEM; @@ -154,9 +154,8 @@ static int __init mtk_sysirq_of_init(struct device_node *node, goto out_free_chip; } - chip_data->intpol_bases = kcalloc(nr_intpol_bases, - sizeof(*chip_data->intpol_bases), - GFP_KERNEL); + chip_data->intpol_bases = kzalloc_objs(*chip_data->intpol_bases, + nr_intpol_bases, GFP_KERNEL); if (!chip_data->intpol_bases) { ret = -ENOMEM; goto out_free_intpol_words; diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index e5b2bde3d933..933511ec6d1f 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c @@ -178,7 +178,7 @@ static int __init mvebu_odmi_init(struct device_node *node, if (of_property_read_u32(node, "marvell,odmi-frames", &odmis_count)) return -EINVAL; - odmis = kcalloc(odmis_count, sizeof(struct odmi_data), GFP_KERNEL); + odmis = kzalloc_objs(struct odmi_data, odmis_count, GFP_KERNEL); if (!odmis) return -ENOMEM; diff --git a/drivers/irqchip/irq-owl-sirq.c b/drivers/irqchip/irq-owl-sirq.c index 3d93d21f6732..f1985a2dc6a1 100644 --- a/drivers/irqchip/irq-owl-sirq.c +++ b/drivers/irqchip/irq-owl-sirq.c @@ -288,7 +288,7 @@ static int __init owl_sirq_init(const struct owl_sirq_params *params, return -ENXIO; } - chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); if (!chip_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evic.c index d87aca73c009..be99b64bc35d 100644 --- a/drivers/irqchip/irq-pic32-evic.c +++ b/drivers/irqchip/irq-pic32-evic.c @@ -221,7 +221,7 @@ static int __init pic32_of_init(struct device_node *node, if (!evic_base) return -ENOMEM; - priv = kcalloc(nchips, sizeof(*priv), GFP_KERNEL); + priv = kzalloc_objs(*priv, nchips, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/irqchip/irq-riscv-imsic-state.c b/drivers/irqchip/irq-riscv-imsic-state.c index 7566c8aa2d48..101b871a6014 100644 --- a/drivers/irqchip/irq-riscv-imsic-state.c +++ b/drivers/irqchip/irq-riscv-imsic-state.c @@ -512,8 +512,8 @@ static int __init imsic_local_init(void) #endif /* Allocate vector array */ - lpriv->vectors = kcalloc(global->nr_ids + 1, sizeof(*lpriv->vectors), - GFP_KERNEL); + lpriv->vectors = kzalloc_objs(*lpriv->vectors, + global->nr_ids + 1, GFP_KERNEL); if (!lpriv->vectors) goto fail_local_cleanup; @@ -810,7 +810,7 @@ int __init imsic_setup_state(struct fwnode_handle *fwnode, void *opaque) return -ENODEV; } - imsic = kzalloc(sizeof(*imsic), GFP_KERNEL); + imsic = kzalloc_obj(*imsic, GFP_KERNEL); if (!imsic) return -ENOMEM; imsic->fwnode = fwnode; @@ -828,14 +828,14 @@ int __init imsic_setup_state(struct fwnode_handle *fwnode, void *opaque) goto out_free_local; /* Allocate MMIO resource array */ - mmios = kcalloc(nr_mmios, sizeof(*mmios), GFP_KERNEL); + mmios = kzalloc_objs(*mmios, nr_mmios, GFP_KERNEL); if (!mmios) { rc = -ENOMEM; goto out_free_local; } /* Allocate MMIO virtual address array */ - mmios_va = kcalloc(nr_mmios, sizeof(*mmios_va), GFP_KERNEL); + mmios_va = kzalloc_objs(*mmios_va, nr_mmios, GFP_KERNEL); if (!mmios_va) { rc = -ENOMEM; goto out_iounmap; diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 70290b35b317..8533a516de1c 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -349,13 +349,14 @@ static int __init riscv_intc_acpi_init(union acpi_subtable_headers *header, if (count <= 0) return -EINVAL; - rintc_acpi_data = kcalloc(count, sizeof(*rintc_acpi_data), GFP_KERNEL); + rintc_acpi_data = kzalloc_objs(*rintc_acpi_data, count, + GFP_KERNEL); if (!rintc_acpi_data) return -ENOMEM; } rintc = (struct acpi_madt_rintc *)header; - rintc_acpi_data[nr_rintc] = kzalloc(sizeof(*rintc_acpi_data[0]), GFP_KERNEL); + rintc_acpi_data[nr_rintc] = kzalloc_obj(*rintc_acpi_data[0], GFP_KERNEL); if (!rintc_acpi_data[nr_rintc]) return -ENOMEM; diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c index 60fd8f91762b..39e85561e8b3 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -640,7 +640,7 @@ static int plic_probe(struct fwnode_handle *fwnode) if (error) goto fail_free_regs; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { error = -ENOMEM; goto fail_free_regs; diff --git a/drivers/irqchip/irq-sni-exiu.c b/drivers/irqchip/irq-sni-exiu.c index 0cad68aa8388..2e5596048988 100644 --- a/drivers/irqchip/irq-sni-exiu.c +++ b/drivers/irqchip/irq-sni-exiu.c @@ -199,7 +199,7 @@ static struct exiu_irq_data *exiu_init(const struct fwnode_handle *fwnode, struct exiu_irq_data *data; int err; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip/irq-starfive-jh8100-intc.c index 705361b4ebe0..aa0a15f97ccf 100644 --- a/drivers/irqchip/irq-starfive-jh8100-intc.c +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c @@ -123,7 +123,7 @@ static int starfive_intc_probe(struct platform_device *pdev, struct device_node int parent_irq; int ret; - irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); + irqc = kzalloc_obj(*irqc, GFP_KERNEL); if (!irqc) return -ENOMEM; diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index 978811f2abe8..c27aaf7e506a 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -269,14 +269,13 @@ stm32_exti_host_data *stm32_exti_host_init(const struct stm32_exti_drv_data *dd, { struct stm32_exti_host_data *host_data; - host_data = kzalloc(sizeof(*host_data), GFP_KERNEL); + host_data = kzalloc_obj(*host_data, GFP_KERNEL); if (!host_data) return NULL; host_data->drv_data = dd; - host_data->chips_data = kcalloc(dd->bank_nr, - sizeof(struct stm32_exti_chip_data), - GFP_KERNEL); + host_data->chips_data = kzalloc_objs(struct stm32_exti_chip_data, + dd->bank_nr, GFP_KERNEL); if (!host_data->chips_data) goto free_host_data; diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c index 9c2c9caeca2a..dde777304171 100644 --- a/drivers/irqchip/irq-sun4i.c +++ b/drivers/irqchip/irq-sun4i.c @@ -146,7 +146,7 @@ static int __init sun4i_of_init(struct device_node *node, static int __init sun4i_ic_of_init(struct device_node *node, struct device_node *parent) { - irq_ic_data = kzalloc(sizeof(struct sun4i_irq_chip_data), GFP_KERNEL); + irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data, GFP_KERNEL); if (!irq_ic_data) return -ENOMEM; @@ -161,7 +161,7 @@ IRQCHIP_DECLARE(allwinner_sun4i_ic, "allwinner,sun4i-a10-ic", sun4i_ic_of_init); static int __init suniv_ic_of_init(struct device_node *node, struct device_node *parent) { - irq_ic_data = kzalloc(sizeof(struct sun4i_irq_chip_data), GFP_KERNEL); + irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data, GFP_KERNEL); if (!irq_ic_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c index b6382cf6359a..f0cd19f88cf0 100644 --- a/drivers/irqchip/irq-tegra.c +++ b/drivers/irqchip/irq-tegra.c @@ -302,7 +302,7 @@ static int __init tegra_ictlr_init(struct device_node *node, soc = match->data; - lic = kzalloc(sizeof(*lic), GFP_KERNEL); + lic = kzalloc_obj(*lic, GFP_KERNEL); if (!lic) return -ENOMEM; diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c index 01963d36cfaf..93aaf19fc4bc 100644 --- a/drivers/irqchip/irq-ti-sci-inta.c +++ b/drivers/irqchip/irq-ti-sci-inta.c @@ -222,7 +222,7 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom goto free_vint; } - vint_desc = kzalloc(sizeof(*vint_desc), GFP_KERNEL); + vint_desc = kzalloc_obj(*vint_desc, GFP_KERNEL); if (!vint_desc) { ret = -ENOMEM; goto free_vint; diff --git a/drivers/irqchip/irq-vf610-mscm-ir.c b/drivers/irqchip/irq-vf610-mscm-ir.c index 5d9c7503aa7f..750b3d5b4c1d 100644 --- a/drivers/irqchip/irq-vf610-mscm-ir.c +++ b/drivers/irqchip/irq-vf610-mscm-ir.c @@ -188,7 +188,7 @@ static int __init vf610_mscm_ir_of_init(struct device_node *node, return -EINVAL; } - mscm_ir_data = kzalloc(sizeof(*mscm_ir_data), GFP_KERNEL); + mscm_ir_data = kzalloc_obj(*mscm_ir_data, GFP_KERNEL); if (!mscm_ir_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c index 3b742590aec8..48bd0ac5cf63 100644 --- a/drivers/irqchip/irq-vt8500.c +++ b/drivers/irqchip/irq-vt8500.c @@ -203,7 +203,7 @@ static int __init vt8500_irq_init(struct device_node *node, struct vt8500_irq_data *intc; int irq, i, ret = 0; - intc = kzalloc(sizeof(*intc), GFP_KERNEL); + intc = kzalloc_obj(*intc, GFP_KERNEL); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-wpcm450-aic.c b/drivers/irqchip/irq-wpcm450-aic.c index a8ed4894d29e..22ee3cfbfa03 100644 --- a/drivers/irqchip/irq-wpcm450-aic.c +++ b/drivers/irqchip/irq-wpcm450-aic.c @@ -139,7 +139,7 @@ static int __init wpcm450_aic_of_init(struct device_node *node, if (parent) return -EINVAL; - aic = kzalloc(sizeof(*aic), GFP_KERNEL); + aic = kzalloc_obj(*aic, GFP_KERNEL); if (!aic) return -ENOMEM; diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index 92dcb9fdcb25..b922226adbee 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -171,7 +171,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, struct xintc_irq_chip *irqc; int ret, irq; - irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); + irqc = kzalloc_obj(*irqc, GFP_KERNEL); if (!irqc) return -ENOMEM; irqc->base = of_iomap(intc, 0); diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 518f7f0f3dab..10d54ab3ad90 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -318,7 +318,7 @@ static int pdc_setup_pin_mapping(struct device_node *np) return -EINVAL; pdc_region_cnt = n / 3; - pdc_region = kcalloc(pdc_region_cnt, sizeof(*pdc_region), GFP_KERNEL); + pdc_region = kzalloc_objs(*pdc_region, pdc_region_cnt, GFP_KERNEL); if (!pdc_region) { pdc_region_cnt = 0; return -ENOMEM; diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 78e6e7748fb9..b1b367353b4f 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -148,7 +148,7 @@ static int capiminor_add_ack(struct capiminor *mp, u16 datahandle) { struct ackqueue_entry *n; - n = kmalloc(sizeof(*n), GFP_ATOMIC); + n = kmalloc_obj(*n, GFP_ATOMIC); if (unlikely(!n)) { printk(KERN_ERR "capi: alloc datahandle failed\n"); return -1; @@ -215,7 +215,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) struct device *dev; unsigned int minor; - mp = kzalloc(sizeof(*mp), GFP_KERNEL); + mp = kzalloc_obj(*mp, GFP_KERNEL); if (!mp) { printk(KERN_ERR "capi: can't alloc capiminor\n"); return NULL; @@ -341,7 +341,7 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) { struct capincci *np; - np = kzalloc(sizeof(*np), GFP_KERNEL); + np = kzalloc_obj(*np, GFP_KERNEL); if (!np) return NULL; np->ncci = ncci; @@ -981,7 +981,7 @@ static int capi_open(struct inode *inode, struct file *file) { struct capidev *cdev; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return -ENOMEM; @@ -1259,8 +1259,8 @@ static int __init capinc_tty_init(void) if (capi_ttyminors <= 0) capi_ttyminors = CAPINC_NR_PORTS; - capiminors = kcalloc(capi_ttyminors, sizeof(struct capiminor *), - GFP_KERNEL); + capiminors = kzalloc_objs(struct capiminor *, capi_ttyminors, + GFP_KERNEL); if (!capiminors) return -ENOMEM; diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c index d7ae42edc4a8..298029340ba8 100644 --- a/drivers/isdn/capi/capiutil.c +++ b/drivers/isdn/capi/capiutil.c @@ -538,7 +538,7 @@ static _cdebbuf *cdebbuf_alloc(void) cdb = g_debbuf; goto init; } else - cdb = kmalloc(sizeof(_cdebbuf), GFP_ATOMIC); + cdb = kmalloc_obj(_cdebbuf, GFP_ATOMIC); if (!cdb) return NULL; cdb->buf = kmalloc(CDEBUG_SIZE, GFP_ATOMIC); @@ -592,7 +592,7 @@ _cdebbuf *capi_message2str(u8 *msg) if (likely(cdb == g_debbuf)) cmsg = g_cmsg; else - cmsg = kmalloc(sizeof(_cmsg), GFP_ATOMIC); + cmsg = kmalloc_obj(_cmsg, GFP_ATOMIC); if (unlikely(!cmsg)) { cdebbuf_free(cdb); return NULL; @@ -618,10 +618,10 @@ _cdebbuf *capi_message2str(u8 *msg) int __init cdebug_init(void) { - g_cmsg = kmalloc(sizeof(_cmsg), GFP_KERNEL); + g_cmsg = kmalloc_obj(_cmsg, GFP_KERNEL); if (!g_cmsg) return -ENOMEM; - g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL); + g_debbuf = kmalloc_obj(_cdebbuf, GFP_KERNEL); if (!g_debbuf) { kfree(g_cmsg); return -ENOMEM; diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index e8f7e52354bc..f9fa17d68095 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -253,7 +253,7 @@ static void do_notify_work(struct work_struct *work) static int notify_push(unsigned int event_type, u32 controller) { - struct capictr_event *event = kmalloc(sizeof(*event), GFP_ATOMIC); + struct capictr_event *event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return -ENOMEM; diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index 044e4961376c..e833b45834d2 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c @@ -1090,7 +1090,7 @@ fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err = -ENOMEM; struct fritzcard *card; - card = kzalloc(sizeof(struct fritzcard), GFP_KERNEL); + card = kzalloc_obj(struct fritzcard, GFP_KERNEL); if (!card) { pr_info("No kmem for fritzcard\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index f6c27ca92c01..23db1ca03fa6 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4777,7 +4777,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m, int pt) char name[MISDN_MAX_IDLEN]; int bcount = 0; - dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); + dch = kzalloc_obj(struct dchannel, GFP_KERNEL); if (!dch) return -ENOMEM; dch->debug = debug; @@ -4795,7 +4795,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m, int pt) for (ch = 1; ch <= 31; ch++) { if (!((1 << ch) & hc->bmask[pt])) /* skip unused channel */ continue; - bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); + bch = kzalloc_obj(struct bchannel, GFP_KERNEL); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); @@ -4850,7 +4850,7 @@ init_multi_port(struct hfc_multi *hc, int pt) int ch, i, ret = 0; char name[MISDN_MAX_IDLEN]; - dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); + dch = kzalloc_obj(struct dchannel, GFP_KERNEL); if (!dch) return -ENOMEM; dch->debug = debug; @@ -4868,7 +4868,7 @@ init_multi_port(struct hfc_multi *hc, int pt) hc->chan[i + 2].port = pt; hc->chan[i + 2].nt_timer = -1; for (ch = 0; ch < dch->dev.nrbchan; ch++) { - bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); + bch = kzalloc_obj(struct bchannel, GFP_KERNEL); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); @@ -4991,7 +4991,7 @@ hfcmulti_init(struct hm_map *m, struct pci_dev *pdev, type[HFC_cnt]); /* allocate card+fifo structure */ - hc = kzalloc(sizeof(struct hfc_multi), GFP_KERNEL); + hc = kzalloc_obj(struct hfc_multi, GFP_KERNEL); if (!hc) { printk(KERN_ERR "No kmem for HFC-Multi card\n"); return -ENOMEM; diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index ea8a0ab47afd..6446eea8d9bb 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -2225,7 +2225,7 @@ hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct hfc_pci *card; struct _hfc_map *m = (struct _hfc_map *)ent->driver_data; - card = kzalloc(sizeof(struct hfc_pci), GFP_KERNEL); + card = kzalloc_obj(struct hfc_pci, GFP_KERNEL); if (!card) { printk(KERN_ERR "No kmem for HFC card\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 541a20cb58f1..293add6adeaf 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c @@ -249,7 +249,7 @@ hfcsusb_ph_info(struct hfcsusb *hw) struct dchannel *dch = &hw->dch; int i; - phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC); + phi = kzalloc_flex(*phi, bch, dch->dev.nrbchan, GFP_ATOMIC); if (!phi) return -ENOMEM; @@ -1696,7 +1696,7 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel) static int setup_hfcsusb(struct hfcsusb *hw) { - void *dmabuf = kmalloc(sizeof(u_char), GFP_KERNEL); + void *dmabuf = kmalloc_obj(u_char, GFP_KERNEL); u_char b; int ret; @@ -2018,7 +2018,7 @@ hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) return -EIO; iface = iface_used; - hw = kzalloc(sizeof(struct hfcsusb), GFP_KERNEL); + hw = kzalloc_obj(struct hfcsusb, GFP_KERNEL); if (!hw) return -ENOMEM; /* got no mem */ snprintf(hw->name, MISDN_MAX_IDLEN - 1, "%s", DRIVER_NAME); diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c index 30876a012711..09d85c5f2ca5 100644 --- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c +++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c @@ -1074,7 +1074,7 @@ inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err = -ENOMEM; struct inf_hw *card; - card = kzalloc(sizeof(struct inf_hw), GFP_KERNEL); + card = kzalloc_obj(struct inf_hw, GFP_KERNEL); if (!card) { pr_info("No memory for Infineon ISDN card\n"); return err; @@ -1108,7 +1108,7 @@ inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct inf_hw *sc; for (i = 1; i < 4; i++) { - sc = kzalloc(sizeof(struct inf_hw), GFP_KERNEL); + sc = kzalloc_obj(struct inf_hw, GFP_KERNEL); if (!sc) { release_card(card); pci_disable_device(pdev); diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index d163850c295e..e5c28f25d190 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c @@ -1070,7 +1070,7 @@ nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return -ENODEV; } - card = kzalloc(sizeof(struct tiger_hw), GFP_KERNEL); + card = kzalloc_obj(struct tiger_hw, GFP_KERNEL); if (!card) { pr_info("No kmem for Netjet\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/speedfax.c b/drivers/isdn/hardware/mISDN/speedfax.c index 0c405261d940..5df9fd5b0c9c 100644 --- a/drivers/isdn/hardware/mISDN/speedfax.c +++ b/drivers/isdn/hardware/mISDN/speedfax.c @@ -443,7 +443,7 @@ static int sfaxpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int err = -ENOMEM; - struct sfax_hw *card = kzalloc(sizeof(struct sfax_hw), GFP_KERNEL); + struct sfax_hw *card = kzalloc_obj(struct sfax_hw, GFP_KERNEL); if (!card) { pr_info("No memory for Speedfax+ PCI\n"); diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 168fc345dcdc..60bb2f302b1c 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -1342,7 +1342,7 @@ w6692_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct w6692_hw *card; struct w6692map *m = (struct w6692map *)ent->driver_data; - card = kzalloc(sizeof(struct w6692_hw), GFP_KERNEL); + card = kzalloc_obj(struct w6692_hw, GFP_KERNEL); if (!card) { pr_info("No kmem for w6692 card\n"); return err; diff --git a/drivers/isdn/mISDN/clock.c b/drivers/isdn/mISDN/clock.c index f71eb61db131..2668be9de20a 100644 --- a/drivers/isdn/mISDN/clock.c +++ b/drivers/isdn/mISDN/clock.c @@ -91,7 +91,7 @@ struct mISDNclock if (*debug & (DEBUG_CORE | DEBUG_CLOCK)) printk(KERN_DEBUG "%s: %s %d\n", __func__, name, pri); - iclock = kzalloc(sizeof(struct mISDNclock), GFP_ATOMIC); + iclock = kzalloc_obj(struct mISDNclock, GFP_ATOMIC); if (!iclock) { printk(KERN_ERR "%s: No memory for clock entry.\n", __func__); return NULL; diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c index 53fad9487574..d5eb2349c414 100644 --- a/drivers/isdn/mISDN/dsp_cmx.c +++ b/drivers/isdn/mISDN/dsp_cmx.c @@ -226,7 +226,7 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf) return -EINVAL; } - member = kzalloc(sizeof(struct dsp_conf_member), GFP_ATOMIC); + member = kzalloc_obj(struct dsp_conf_member, GFP_ATOMIC); if (!member) { printk(KERN_ERR "kzalloc struct dsp_conf_member failed\n"); return -ENOMEM; @@ -305,7 +305,7 @@ static struct dsp_conf return NULL; } - conf = kzalloc(sizeof(struct dsp_conf), GFP_ATOMIC); + conf = kzalloc_obj(struct dsp_conf, GFP_ATOMIC); if (!conf) { printk(KERN_ERR "kzalloc struct dsp_conf failed\n"); return NULL; diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c index b4ed0bb8ddfb..55693dc7206b 100644 --- a/drivers/isdn/mISDN/dsp_pipeline.c +++ b/drivers/isdn/mISDN/dsp_pipeline.c @@ -75,7 +75,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem) if (!elem) return -EINVAL; - entry = kzalloc(sizeof(struct dsp_element_entry), GFP_ATOMIC); + entry = kzalloc_obj(struct dsp_element_entry, GFP_ATOMIC); if (!entry) return -ENOMEM; @@ -223,8 +223,8 @@ int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg) if (!strcmp(entry->elem->name, name)) { elem = entry->elem; - pipeline_entry = kmalloc(sizeof(struct - dsp_pipeline_entry), GFP_ATOMIC); + pipeline_entry = kmalloc_obj(struct dsp_pipeline_entry, + GFP_ATOMIC); if (!pipeline_entry) { printk(KERN_ERR "%s: failed to add " "entry to pipeline: %s (out of " diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 6ab036e4a35f..2e02a81fe760 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1370,7 +1370,7 @@ init_card(struct l1oip *hc, int pri, int bundle) (hc->remoteip >> 8) & 0xff, hc->remoteip & 0xff, hc->remoteport, hc->ondemand); - dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); + dch = kzalloc_obj(struct dchannel, GFP_KERNEL); if (!dch) return -ENOMEM; dch->debug = debug; @@ -1391,7 +1391,7 @@ init_card(struct l1oip *hc, int pri, int bundle) for (ch = 0; ch < dch->dev.nrbchan; ch++) { if (ch == 15) i++; - bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); + bch = kzalloc_obj(struct bchannel, GFP_KERNEL); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); @@ -1477,7 +1477,7 @@ l1oip_init(void) bundle ? "bundled IP packet for all B-channels" : "separate IP packets for every B-channel"); - hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC); + hc = kzalloc_obj(struct l1oip, GFP_ATOMIC); if (!hc) { printk(KERN_ERR "No kmem for L1-over-IP driver.\n"); l1oip_cleanup(); diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c index 7b31c25a550e..3fbc170acf9a 100644 --- a/drivers/isdn/mISDN/layer1.c +++ b/drivers/isdn/mISDN/layer1.c @@ -374,7 +374,7 @@ int create_l1(struct dchannel *dch, dchannel_l1callback *dcb) { struct layer1 *nl1; - nl1 = kzalloc(sizeof(struct layer1), GFP_ATOMIC); + nl1 = kzalloc_obj(struct layer1, GFP_ATOMIC); if (!nl1) { printk(KERN_ERR "kmalloc struct layer1 failed\n"); return -ENOMEM; diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c index 5bf7fcb282c4..ea32330c1612 100644 --- a/drivers/isdn/mISDN/layer2.c +++ b/drivers/isdn/mISDN/layer2.c @@ -2111,7 +2111,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, int tei, struct layer2 *l2; struct channel_req rq; - l2 = kzalloc(sizeof(struct layer2), GFP_KERNEL); + l2 = kzalloc_obj(struct layer2, GFP_KERNEL); if (!l2) { printk(KERN_ERR "kzalloc layer2 failed\n"); return NULL; diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index c2f76f398613..4226bae0f8c6 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c @@ -366,7 +366,7 @@ create_stack(struct mISDNdevice *dev) int err; DECLARE_COMPLETION_ONSTACK(done); - newst = kzalloc(sizeof(struct mISDNstack), GFP_KERNEL); + newst = kzalloc_obj(struct mISDNstack, GFP_KERNEL); if (!newst) { printk(KERN_ERR "kmalloc mISDN_stack failed\n"); return -ENOMEM; diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c index 59d28cb19738..e7c1d465cef3 100644 --- a/drivers/isdn/mISDN/tei.c +++ b/drivers/isdn/mISDN/tei.c @@ -803,7 +803,7 @@ create_new_tei(struct manager *mgr, int tei, int sapi) printk(KERN_WARNING "%s:no memory for layer2\n", __func__); return NULL; } - l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); + l2->tm = kzalloc_obj(struct teimgr, GFP_KERNEL); if (!l2->tm) { kfree(l2); printk(KERN_WARNING "%s:no memory for teimgr\n", __func__); @@ -1046,7 +1046,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq) crq->adr.tei, crq->adr.sapi); if (!l2) return -ENOMEM; - l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); + l2->tm = kzalloc_obj(struct teimgr, GFP_KERNEL); if (!l2->tm) { kfree(l2); printk(KERN_ERR "kmalloc teimgr failed\n"); @@ -1345,7 +1345,7 @@ create_teimanager(struct mISDNdevice *dev) { struct manager *mgr; - mgr = kzalloc(sizeof(struct manager), GFP_KERNEL); + mgr = kzalloc_obj(struct manager, GFP_KERNEL); if (!mgr) return -ENOMEM; INIT_LIST_HEAD(&mgr->layer2); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index 33521c328a82..25b9625b1cd8 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -47,7 +47,7 @@ mISDN_open(struct inode *ino, struct file *filep) if (*debug & DEBUG_TIMER) printk(KERN_DEBUG "%s(%p,%p)\n", __func__, ino, filep); - dev = kmalloc(sizeof(struct mISDNtimerdev) , GFP_KERNEL); + dev = kmalloc_obj(struct mISDNtimerdev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->next_id = 1; @@ -179,7 +179,7 @@ misdn_add_timer(struct mISDNtimerdev *dev, int timeout) wake_up_interruptible(&dev->wait); id = 0; } else { - timer = kzalloc(sizeof(struct mISDNtimer), GFP_KERNEL); + timer = kzalloc_obj(struct mISDNtimer, GFP_KERNEL); if (!timer) return -ENOMEM; timer->dev = dev; diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 3799dcc1cf07..2fdb713307c3 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -486,7 +486,7 @@ void led_trigger_register_simple(const char *name, struct led_trigger **tp) struct led_trigger *trig; int err; - trig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); + trig = kzalloc_obj(struct led_trigger, GFP_KERNEL); if (trig) { trig->name = name; diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index f54851dfb42f..138c8fb3514c 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -996,7 +996,7 @@ static int lpg_pattern_set(struct lpg_led *led, struct led_pattern *led_pattern, if (len % 2) return -EINVAL; - pattern = kcalloc(len / 2, sizeof(*pattern), GFP_KERNEL); + pattern = kzalloc_objs(*pattern, len / 2, GFP_KERNEL); if (!pattern) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c index c973246a57f9..4f0c16b04876 100644 --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -188,7 +188,7 @@ static int activity_activate(struct led_classdev *led_cdev) { struct activity_data *activity_data; - activity_data = kzalloc(sizeof(*activity_data), GFP_KERNEL); + activity_data = kzalloc_obj(*activity_data, GFP_KERNEL); if (!activity_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-backlight.c b/drivers/leds/trigger/ledtrig-backlight.c index c1f0f5becaee..80b33f13beee 100644 --- a/drivers/leds/trigger/ledtrig-backlight.c +++ b/drivers/leds/trigger/ledtrig-backlight.c @@ -102,7 +102,7 @@ static int bl_trig_activate(struct led_classdev *led) { struct bl_trig_notifier *n; - n = kzalloc(sizeof(struct bl_trig_notifier), GFP_KERNEL); + n = kzalloc_obj(struct bl_trig_notifier, GFP_KERNEL); if (!n) return -ENOMEM; led_set_trigger_data(led, n); diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index 7f6a2352b0ac..eec6de5ea3bc 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -78,7 +78,7 @@ static int gpio_trig_activate(struct led_classdev *led) struct device *dev = led->dev; int ret; - gpio_data = kzalloc(sizeof(*gpio_data), GFP_KERNEL); + gpio_data = kzalloc_obj(*gpio_data, GFP_KERNEL); if (!gpio_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c index 40eb61b6d54e..6ad8b486b058 100644 --- a/drivers/leds/trigger/ledtrig-heartbeat.c +++ b/drivers/leds/trigger/ledtrig-heartbeat.c @@ -129,7 +129,7 @@ static int heartbeat_trig_activate(struct led_classdev *led_cdev) { struct heartbeat_trig_data *heartbeat_data; - heartbeat_data = kzalloc(sizeof(*heartbeat_data), GFP_KERNEL); + heartbeat_data = kzalloc_obj(*heartbeat_data, GFP_KERNEL); if (!heartbeat_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-input-events.c b/drivers/leds/trigger/ledtrig-input-events.c index 3c6414259c27..dcdea964311d 100644 --- a/drivers/leds/trigger/ledtrig-input-events.c +++ b/drivers/leds/trigger/ledtrig-input-events.c @@ -75,7 +75,7 @@ static int input_events_connect(struct input_handler *handler, struct input_dev struct input_handle *handle; int ret; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index c15efe3e5078..e15e7dcdbcd9 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -691,7 +691,7 @@ static int netdev_trig_activate(struct led_classdev *led_cdev) struct device *dev; int rc; - trigger_data = kzalloc(sizeof(struct led_netdev_data), GFP_KERNEL); + trigger_data = kzalloc_obj(struct led_netdev_data, GFP_KERNEL); if (!trigger_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-oneshot.c b/drivers/leds/trigger/ledtrig-oneshot.c index bee3bd452abf..b825e607bb9f 100644 --- a/drivers/leds/trigger/ledtrig-oneshot.c +++ b/drivers/leds/trigger/ledtrig-oneshot.c @@ -159,7 +159,7 @@ static int oneshot_trig_activate(struct led_classdev *led_cdev) { struct oneshot_trig_data *oneshot_data; - oneshot_data = kzalloc(sizeof(*oneshot_data), GFP_KERNEL); + oneshot_data = kzalloc_obj(*oneshot_data, GFP_KERNEL); if (!oneshot_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index 9af3c18f14f4..9eaae7757c8e 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -465,7 +465,7 @@ static int pattern_trig_activate(struct led_classdev *led_cdev) { struct pattern_trig_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 20f1351464b1..258e5d8db5b2 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -164,7 +164,7 @@ static int transient_trig_activate(struct led_classdev *led_cdev) { struct transient_trig_data *tdata; - tdata = kzalloc(sizeof(struct transient_trig_data), GFP_KERNEL); + tdata = kzalloc_obj(struct transient_trig_data, GFP_KERNEL); if (!tdata) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-tty.c b/drivers/leds/trigger/ledtrig-tty.c index 8cf1485e8165..4ce915e417f8 100644 --- a/drivers/leds/trigger/ledtrig-tty.c +++ b/drivers/leds/trigger/ledtrig-tty.c @@ -312,7 +312,7 @@ static int ledtrig_tty_activate(struct led_classdev *led_cdev) { struct ledtrig_tty_data *trigger_data; - trigger_data = kzalloc(sizeof(*trigger_data), GFP_KERNEL); + trigger_data = kzalloc_obj(*trigger_data, GFP_KERNEL); if (!trigger_data) return -ENOMEM; diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c index 374a841f18c3..b70d203d0b16 100644 --- a/drivers/leds/uleds.c +++ b/drivers/leds/uleds.c @@ -53,7 +53,7 @@ static int uleds_open(struct inode *inode, struct file *file) { struct uleds_device *udev; - udev = kzalloc(sizeof(*udev), GFP_KERNEL); + udev = kzalloc_obj(*udev, GFP_KERNEL); if (!udev) return -ENOMEM; diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 88adee42ba82..959cfbee7387 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -674,7 +674,7 @@ static int adb_open(struct inode *inode, struct file *file) ret = -ENXIO; goto out; } - state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); + state = kmalloc_obj(struct adbdev_state, GFP_KERNEL); if (!state) { ret = -ENOMEM; goto out; @@ -783,8 +783,7 @@ static ssize_t adb_write(struct file *file, const char __user *buf, if (adb_controller == NULL) return -ENXIO; - req = kmalloc(sizeof(struct adb_request), - GFP_KERNEL); + req = kmalloc_obj(struct adb_request, GFP_KERNEL); if (req == NULL) return -ENOMEM; diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index c5aabf238d0a..c995f1155a94 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c @@ -764,7 +764,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id, return -EEXIST; } - adbhid[id] = hid = kzalloc(sizeof(struct adbhid), GFP_KERNEL); + adbhid[id] = hid = kzalloc_obj(struct adbhid, GFP_KERNEL); input_dev = input_allocate_device(); if (!hid || !input_dev) { err = -ENOMEM; diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 06fd910b3fd1..37f25b1f68c9 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -102,7 +102,7 @@ static int mac_hid_emumouse_connect(struct input_handler *handler, if (dev == mac_hid_emumouse_dev) return -ENODEV; - handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL); + handle = kzalloc_obj(struct input_handle, GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index bede200e32e8..b11809c41417 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -368,7 +368,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, if (np == NULL) return NULL; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 896a43bd819f..f720c6c64b86 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -396,7 +396,7 @@ static int rackmeter_probe(struct macio_dev* mdev, } /* Create and initialize our instance data */ - rm = kzalloc(sizeof(*rm), GFP_KERNEL); + rm = kzalloc_obj(*rm, GFP_KERNEL); if (rm == NULL) { printk(KERN_ERR "rackmeter: failed to allocate memory !\n"); rc = -ENOMEM; diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index a1534cc6c641..8f1f57a00981 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -1081,7 +1081,7 @@ static int smu_open(struct inode *inode, struct file *file) struct smu_private *pp; unsigned long flags; - pp = kzalloc(sizeof(struct smu_private), GFP_KERNEL); + pp = kzalloc_obj(struct smu_private, GFP_KERNEL); if (!pp) return -ENOMEM; spin_lock_init(&pp->lock); diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 00693741f744..0f8ac254ecee 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -498,7 +498,7 @@ static int probe_thermostat(struct i2c_client *client) } } - th = kzalloc(sizeof(struct thermostat), GFP_KERNEL); + th = kzalloc_obj(struct thermostat, GFP_KERNEL); if (!th) return -ENOMEM; diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 5fe47e784d43..e721c84f51c3 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -2147,7 +2147,7 @@ pmu_open(struct inode *inode, struct file *file) struct pmu_private *pp; unsigned long flags; - pp = kmalloc(sizeof(struct pmu_private), GFP_KERNEL); + pp = kmalloc_obj(struct pmu_private, GFP_KERNEL); if (!pp) return -ENOMEM; pp->rb_get = pp->rb_put = 0; diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c b/drivers/macintosh/windfarm_ad7417_sensor.c index 3ff4577ba847..40af189795d8 100644 --- a/drivers/macintosh/windfarm_ad7417_sensor.c +++ b/drivers/macintosh/windfarm_ad7417_sensor.c @@ -260,7 +260,7 @@ static int wf_ad7417_probe(struct i2c_client *client) return -ENXIO; } - pv = kzalloc(sizeof(struct wf_ad7417_priv), GFP_KERNEL); + pv = kzalloc_obj(struct wf_ad7417_priv, GFP_KERNEL); if (pv == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 28d18ef22bbb..570b5428da1a 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -94,7 +94,7 @@ static int __init wf_cpufreq_clamp_init(void) goto fail; } - clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); + clamp = kmalloc_obj(struct wf_control, GFP_KERNEL); if (clamp == NULL) { ret = -ENOMEM; goto fail; diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c index 82365f19adb4..c3b95f968592 100644 --- a/drivers/macintosh/windfarm_fcu_controls.c +++ b/drivers/macintosh/windfarm_fcu_controls.c @@ -363,7 +363,7 @@ static void wf_fcu_add_fan(struct wf_fcu_priv *pv, const char *name, { struct wf_fcu_fan *fan; - fan = kzalloc(sizeof(*fan), GFP_KERNEL); + fan = kzalloc_obj(*fan, GFP_KERNEL); if (!fan) return; fan->fcu_priv = pv; @@ -518,7 +518,7 @@ static int wf_fcu_probe(struct i2c_client *client) { struct wf_fcu_priv *pv; - pv = kzalloc(sizeof(*pv), GFP_KERNEL); + pv = kzalloc_obj(*pv, GFP_KERNEL); if (!pv) return -ENOMEM; diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index b5d9c2e40148..188a1a56e34c 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -130,7 +130,7 @@ static int wf_lm75_probe(struct i2c_client *client) return -ENXIO; - lm = kzalloc(sizeof(struct wf_lm75_sensor), GFP_KERNEL); + lm = kzalloc_obj(struct wf_lm75_sensor, GFP_KERNEL); if (lm == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c index 16635e2b180b..dcaba5c7bec1 100644 --- a/drivers/macintosh/windfarm_lm87_sensor.c +++ b/drivers/macintosh/windfarm_lm87_sensor.c @@ -128,7 +128,7 @@ static int wf_lm87_probe(struct i2c_client *client) return -ENODEV; } - lm = kzalloc(sizeof(struct wf_lm87_sensor), GFP_KERNEL); + lm = kzalloc_obj(struct wf_lm87_sensor, GFP_KERNEL); if (lm == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index d734b31b8236..be9e75e2d3cf 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c @@ -85,7 +85,7 @@ static int wf_max6690_probe(struct i2c_client *client) else return -ENXIO; - max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); + max = kzalloc_obj(struct wf_6690_sensor, GFP_KERNEL); if (max == NULL) { printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor: " "no memory\n"); diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c index 660180c843a3..82e2e4aa6b2e 100644 --- a/drivers/macintosh/windfarm_pm121.c +++ b/drivers/macintosh/windfarm_pm121.c @@ -531,8 +531,8 @@ static void pm121_create_sys_fans(int loop_id) control = controls[param->control_id]; /* Alloc & initialize state */ - pm121_sys_state[loop_id] = kmalloc(sizeof(struct pm121_sys_state), - GFP_KERNEL); + pm121_sys_state[loop_id] = kmalloc_obj(struct pm121_sys_state, + GFP_KERNEL); if (pm121_sys_state[loop_id] == NULL) { printk(KERN_WARNING "pm121: Memory allocation error\n"); goto fail; @@ -668,8 +668,7 @@ static void pm121_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - pm121_cpu_state = kmalloc(sizeof(struct pm121_cpu_state), - GFP_KERNEL); + pm121_cpu_state = kmalloc_obj(struct pm121_cpu_state, GFP_KERNEL); if (pm121_cpu_state == NULL) goto fail; pm121_cpu_state->ticks = 1; diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index ada97377e19e..f62a647a66a3 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c @@ -283,8 +283,7 @@ static void wf_smu_create_sys_fans(void) } /* Alloc & initialize state */ - wf_smu_sys_fans = kmalloc(sizeof(struct wf_smu_sys_fans_state), - GFP_KERNEL); + wf_smu_sys_fans = kmalloc_obj(struct wf_smu_sys_fans_state, GFP_KERNEL); if (wf_smu_sys_fans == NULL) { printk(KERN_WARNING "windfarm: Memory allocation error" " max fan speed\n"); @@ -419,8 +418,7 @@ static void wf_smu_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - wf_smu_cpu_fans = kmalloc(sizeof(struct wf_smu_cpu_fans_state), - GFP_KERNEL); + wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state, GFP_KERNEL); if (wf_smu_cpu_fans == NULL) goto fail; wf_smu_cpu_fans->ticks = 1; diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index 108d7938e714..398e61352e16 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c @@ -168,8 +168,7 @@ static void wf_smu_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - wf_smu_cpu_fans = kmalloc(sizeof(struct wf_smu_cpu_fans_state), - GFP_KERNEL); + wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state, GFP_KERNEL); if (wf_smu_cpu_fans == NULL) goto fail; wf_smu_cpu_fans->ticks = 1; @@ -300,8 +299,8 @@ static void wf_smu_create_drive_fans(void) }; /* Alloc & initialize state */ - wf_smu_drive_fans = kmalloc(sizeof(struct wf_smu_drive_fans_state), - GFP_KERNEL); + wf_smu_drive_fans = kmalloc_obj(struct wf_smu_drive_fans_state, + GFP_KERNEL); if (wf_smu_drive_fans == NULL) { printk(KERN_WARNING "windfarm: Memory allocation error" " max fan speed\n"); @@ -381,8 +380,8 @@ static void wf_smu_create_slots_fans(void) }; /* Alloc & initialize state */ - wf_smu_slots_fans = kmalloc(sizeof(struct wf_smu_slots_fans_state), - GFP_KERNEL); + wf_smu_slots_fans = kmalloc_obj(struct wf_smu_slots_fans_state, + GFP_KERNEL); if (wf_smu_slots_fans == NULL) { printk(KERN_WARNING "windfarm: Memory allocation error" " max fan speed\n"); diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c index bdd92b27da2a..4cba2b51bd8a 100644 --- a/drivers/macintosh/windfarm_smu_controls.c +++ b/drivers/macintosh/windfarm_smu_controls.c @@ -162,7 +162,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, const u32 *reg; const char *l; - fct = kmalloc(sizeof(struct smu_fan_control), GFP_KERNEL); + fct = kmalloc_obj(struct smu_fan_control, GFP_KERNEL); if (fct == NULL) return NULL; fct->ctrl.ops = &smu_fan_ops; diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index ff8805ecf2e5..c613484d7a80 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -203,7 +203,7 @@ static int wf_sat_probe(struct i2c_client *client) char *name; int vsens[2], isens[2]; - sat = kzalloc(sizeof(struct wf_sat), GFP_KERNEL); + sat = kzalloc_obj(struct wf_sat, GFP_KERNEL); if (sat == NULL) return -ENOMEM; sat->nr = -1; diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c index 2bdb73b34d29..d7c934c5759d 100644 --- a/drivers/macintosh/windfarm_smu_sensors.c +++ b/drivers/macintosh/windfarm_smu_sensors.c @@ -200,7 +200,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) const char *l; const u32 *v; - ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL); + ads = kmalloc_obj(struct smu_ad_sensor, GFP_KERNEL); if (ads == NULL) return NULL; l = of_get_property(node, "location", NULL); @@ -338,7 +338,7 @@ smu_cpu_power_create(struct wf_sensor *volts, struct wf_sensor *amps) { struct smu_cpu_power_sensor *pow; - pow = kmalloc(sizeof(struct smu_cpu_power_sensor), GFP_KERNEL); + pow = kmalloc_obj(struct smu_cpu_power_sensor, GFP_KERNEL); if (pow == NULL) return NULL; pow->sens.ops = &smu_cpu_power_ops; diff --git a/drivers/mailbox/bcm74110-mailbox.c b/drivers/mailbox/bcm74110-mailbox.c index 2e7e86f3e6a4..344cfc35984b 100644 --- a/drivers/mailbox/bcm74110-mailbox.c +++ b/drivers/mailbox/bcm74110-mailbox.c @@ -140,7 +140,7 @@ static void bcm74110_rx_push_init_msg(struct bcm74110_mbox *mbox, u32 val) { struct bcm74110_mbox_msg *msg; - msg = kzalloc(sizeof(*msg), GFP_ATOMIC); + msg = kzalloc_obj(*msg, GFP_ATOMIC); if (!msg) return; diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 9da16b30eb41..d7c6b38888a3 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -456,7 +456,7 @@ static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data) /* Client should not flush new tasks if suspended. */ WARN_ON(cmdq->suspended); - task = kzalloc(sizeof(*task), GFP_ATOMIC); + task = kzalloc_obj(*task, GFP_ATOMIC); if (!task) return -ENOMEM; diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c index 3d487d75c483..ce17092d5c1f 100644 --- a/drivers/mcb/mcb-core.c +++ b/drivers/mcb/mcb-core.c @@ -274,7 +274,7 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier) int bus_nr; int rc; - bus = kzalloc(sizeof(struct mcb_bus), GFP_KERNEL); + bus = kzalloc_obj(struct mcb_bus, GFP_KERNEL); if (!bus) return ERR_PTR(-ENOMEM); @@ -366,7 +366,7 @@ struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus) { struct mcb_device *dev; - dev = kzalloc(sizeof(struct mcb_device), GFP_KERNEL); + dev = kzalloc_obj(struct mcb_device, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c index bf0d7d58c8b0..934f8d96922d 100644 --- a/drivers/mcb/mcb-parse.c +++ b/drivers/mcb/mcb-parse.c @@ -146,15 +146,14 @@ static int chameleon_get_bar(void __iomem **base, phys_addr_t mapbase, if (bar_count <= 0 || bar_count > CHAMELEON_BAR_MAX) return -ENODEV; - c = kcalloc(bar_count, sizeof(struct chameleon_bar), - GFP_KERNEL); + c = kzalloc_objs(struct chameleon_bar, bar_count, GFP_KERNEL); if (!c) return -ENOMEM; chameleon_parse_bar(*base, c, bar_count); *base += BAR_DESC_SIZE(bar_count); } else { - c = kzalloc(sizeof(struct chameleon_bar), GFP_KERNEL); + c = kzalloc_obj(struct chameleon_bar, GFP_KERNEL); if (!c) return -ENOMEM; diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 7708d92df23e..90cc6ed4bd6d 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -697,7 +697,7 @@ int bch_open_buckets_alloc(struct cache_set *c) spin_lock_init(&c->data_bucket_lock); for (i = 0; i < MAX_OPEN_BUCKETS; i++) { - struct open_bucket *b = kzalloc(sizeof(*b), GFP_KERNEL); + struct open_bucket *b = kzalloc_obj(*b, GFP_KERNEL); if (!b) return -ENOMEM; diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 3ed39c823826..27a129d47d0a 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -585,7 +585,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c, * kzalloc() is necessary here for initialization, * see code comments in bch_btree_keys_init(). */ - struct btree *b = kzalloc(sizeof(struct btree), gfp); + struct btree *b = kzalloc_obj(struct btree, gfp); if (!b) return NULL; diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index f327456fc4e0..55f5e202015d 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -208,7 +208,7 @@ static int bch_dump_open(struct inode *inode, struct file *file) struct cache_set *c = inode->i_private; struct dump_iterator *i; - i = kzalloc(sizeof(struct dump_iterator), GFP_KERNEL); + i = kzalloc_obj(struct dump_iterator, GFP_KERNEL); if (!i) return -ENOMEM; diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 238d12ffdae8..a304ef80820b 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1527,8 +1527,7 @@ static CLOSURE_CALLBACK(flash_dev_flush) static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) { int err = -ENOMEM; - struct bcache_device *d = kzalloc(sizeof(struct bcache_device), - GFP_KERNEL); + struct bcache_device *d = kzalloc_obj(struct bcache_device, GFP_KERNEL); if (!d) goto err_ret; @@ -1864,7 +1863,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb) { int iter_size; struct cache *ca = container_of(sb, struct cache, sb); - struct cache_set *c = kzalloc(sizeof(struct cache_set), GFP_KERNEL); + struct cache_set *c = kzalloc_obj(struct cache_set, GFP_KERNEL); if (!c) return NULL; @@ -2543,8 +2542,8 @@ static void register_device_async(struct async_reg_args *args) static void *alloc_holder_object(struct cache_sb *sb) { if (SB_IS_BDEV(sb)) - return kzalloc(sizeof(struct cached_dev), GFP_KERNEL); - return kzalloc(sizeof(struct cache), GFP_KERNEL); + return kzalloc_obj(struct cached_dev, GFP_KERNEL); + return kzalloc_obj(struct cache, GFP_KERNEL); } static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, @@ -2581,7 +2580,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, if (!path) goto out_module_put; - sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL); + sb = kmalloc_obj(struct cache_sb, GFP_KERNEL); if (!sb) goto out_free_path; @@ -2633,7 +2632,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, if (async_registration) { /* register in asynchronous way */ struct async_reg_args *args = - kzalloc(sizeof(struct async_reg_args), GFP_KERNEL); + kzalloc_obj(struct async_reg_args, GFP_KERNEL); if (!args) { ret = -ENOMEM; @@ -2710,7 +2709,7 @@ static ssize_t bch_pending_bdevs_cleanup(struct kobject *k, mutex_lock(&bch_register_lock); list_for_each_entry_safe(dc, tdc, &uncached_devices, list) { - pdev = kmalloc(sizeof(struct pdev), GFP_KERNEL); + pdev = kmalloc_obj(struct pdev, GFP_KERNEL); if (!pdev) break; pdev->dc = dc; diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 72f38e5b6f5c..b30424075106 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -415,7 +415,7 @@ STORE(__cached_dev) buf, SB_LABEL_SIZE); bch_uuid_write(dc->disk.c); } - env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); if (!env) return -ENOMEM; add_uevent_var(env, "DRIVER=bcache"); diff --git a/drivers/md/dm-bio-prison-v1.c b/drivers/md/dm-bio-prison-v1.c index b4d1c4329df3..fc8bb30dc533 100644 --- a/drivers/md/dm-bio-prison-v1.c +++ b/drivers/md/dm-bio-prison-v1.c @@ -44,7 +44,7 @@ struct dm_bio_prison *dm_bio_prison_create(void) struct dm_bio_prison *prison; num_locks = dm_num_hash_locks(); - prison = kzalloc(struct_size(prison, regions, num_locks), GFP_KERNEL); + prison = kzalloc_flex(*prison, regions, num_locks, GFP_KERNEL); if (!prison) return NULL; prison->num_locks = num_locks; @@ -301,7 +301,7 @@ struct dm_deferred_set *dm_deferred_set_create(void) int i; struct dm_deferred_set *ds; - ds = kmalloc(sizeof(*ds), GFP_KERNEL); + ds = kmalloc_obj(*ds, GFP_KERNEL); if (!ds) return NULL; diff --git a/drivers/md/dm-bio-prison-v2.c b/drivers/md/dm-bio-prison-v2.c index cf433b0cf742..d4daf426c2c7 100644 --- a/drivers/md/dm-bio-prison-v2.c +++ b/drivers/md/dm-bio-prison-v2.c @@ -36,7 +36,7 @@ static struct kmem_cache *_cell_cache; */ struct dm_bio_prison_v2 *dm_bio_prison_create_v2(struct workqueue_struct *wq) { - struct dm_bio_prison_v2 *prison = kzalloc(sizeof(*prison), GFP_KERNEL); + struct dm_bio_prison_v2 *prison = kzalloc_obj(*prison, GFP_KERNEL); int ret; if (!prison) diff --git a/drivers/md/dm-cache-background-tracker.c b/drivers/md/dm-cache-background-tracker.c index b4165f172d62..fb5efaab11a3 100644 --- a/drivers/md/dm-cache-background-tracker.c +++ b/drivers/md/dm-cache-background-tracker.c @@ -26,7 +26,7 @@ struct kmem_cache *btracker_work_cache = NULL; struct background_tracker *btracker_create(unsigned int max_work) { - struct background_tracker *b = kmalloc(sizeof(*b), GFP_KERNEL); + struct background_tracker *b = kmalloc_obj(*b, GFP_KERNEL); if (!b) { DMERR("couldn't create background_tracker"); diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index a9a1ab284076..5060a58605a2 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -760,7 +760,7 @@ static struct dm_cache_metadata *metadata_open(struct block_device *bdev, int r; struct dm_cache_metadata *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { DMERR("could not allocate metadata struct"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c index 7e1e8cc0e33a..bec1b5e95170 100644 --- a/drivers/md/dm-cache-policy-smq.c +++ b/drivers/md/dm-cache-policy-smq.c @@ -1735,7 +1735,7 @@ __smq_create(dm_cblock_t cache_size, sector_t origin_size, sector_t cache_block_ unsigned int i; unsigned int nr_sentinels_per_queue = 2u * NR_CACHE_LEVELS; unsigned int total_sentinels = 2u * nr_sentinels_per_queue; - struct smq_policy *mq = kzalloc(sizeof(*mq), GFP_KERNEL); + struct smq_policy *mq = kzalloc_obj(*mq, GFP_KERNEL); if (!mq) return NULL; diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 62d1060619dd..be1af992b931 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2387,7 +2387,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) struct dm_cache_metadata *cmd; bool may_format = ca->features.mode == CM_WRITE; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); if (!cache) return -ENOMEM; @@ -2612,7 +2612,7 @@ static int cache_ctr(struct dm_target *ti, unsigned int argc, char **argv) struct cache_args *ca; struct cache *cache = NULL; - ca = kzalloc(sizeof(*ca), GFP_KERNEL); + ca = kzalloc_obj(*ca, GFP_KERNEL); if (!ca) { ti->error = "Error allocating memory for cache"; return -ENOMEM; diff --git a/drivers/md/dm-clone-metadata.c b/drivers/md/dm-clone-metadata.c index 14c5c28d938b..cb474e852548 100644 --- a/drivers/md/dm-clone-metadata.c +++ b/drivers/md/dm-clone-metadata.c @@ -553,7 +553,7 @@ struct dm_clone_metadata *dm_clone_metadata_open(struct block_device *bdev, int r; struct dm_clone_metadata *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { DMERR("Failed to allocate memory for dm-clone metadata"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c index a7f73861a8cd..c9b25af70063 100644 --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -580,7 +580,7 @@ static int hash_table_init(struct clone *clone) sz = 1 << HASH_TABLE_BITS; - clone->ht = kvmalloc_array(sz, sizeof(struct hash_table_bucket), GFP_KERNEL); + clone->ht = kvmalloc_objs(struct hash_table_bucket, sz, GFP_KERNEL); if (!clone->ht) return -ENOMEM; @@ -1766,7 +1766,7 @@ static int clone_ctr(struct dm_target *ti, unsigned int argc, char **argv) as.argc = argc; as.argv = argv; - clone = kzalloc(sizeof(*clone), GFP_KERNEL); + clone = kzalloc_obj(*clone, GFP_KERNEL); if (!clone) { ti->error = "Failed to allocate clone structure"; return -ENOMEM; diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 339976d4c2ca..a2f9f0f0db5e 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2334,9 +2334,8 @@ static int crypt_alloc_tfms_skcipher(struct crypt_config *cc, char *ciphermode) unsigned int i; int err; - cc->cipher_tfm.tfms = kcalloc(cc->tfms_count, - sizeof(struct crypto_skcipher *), - GFP_KERNEL); + cc->cipher_tfm.tfms = kzalloc_objs(struct crypto_skcipher *, + cc->tfms_count, GFP_KERNEL); if (!cc->cipher_tfm.tfms) return -ENOMEM; @@ -2364,7 +2363,7 @@ static int crypt_alloc_tfms_aead(struct crypt_config *cc, char *ciphermode) { int err; - cc->cipher_tfm.tfms = kmalloc(sizeof(struct crypto_skcipher *), GFP_KERNEL); + cc->cipher_tfm.tfms = kmalloc_obj(struct crypto_skcipher *, GFP_KERNEL); if (!cc->cipher_tfm.tfms) return -ENOMEM; @@ -3238,7 +3237,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - cc = kzalloc(struct_size(cc, key, key_size), GFP_KERNEL); + cc = kzalloc_flex(*cc, key, key_size, GFP_KERNEL); if (!cc) { ti->error = "Cannot allocate encryption context"; return -ENOMEM; diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index 029f04776490..5d2dd07a19b0 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -224,7 +224,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - dc = kzalloc(sizeof(*dc), GFP_KERNEL); + dc = kzalloc_obj(*dc, GFP_KERNEL); if (!dc) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-dust.c b/drivers/md/dm-dust.c index e75310232bbf..a91f96bad0b9 100644 --- a/drivers/md/dm-dust.c +++ b/drivers/md/dm-dust.c @@ -108,7 +108,7 @@ static int dust_add_block(struct dust_device *dd, unsigned long long block, struct badblock *bblock; unsigned long flags; - bblock = kmalloc(sizeof(*bblock), GFP_KERNEL); + bblock = kmalloc_obj(*bblock, GFP_KERNEL); if (bblock == NULL) { if (!dd->quiet_mode) DMERR("%s: badblock allocation failed", __func__); @@ -360,7 +360,7 @@ static int dust_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - dd = kzalloc(sizeof(struct dust_device), GFP_KERNEL); + dd = kzalloc_obj(struct dust_device, GFP_KERNEL); if (dd == NULL) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index b354e74a670e..4c9a25ae90d6 100644 --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -257,7 +257,7 @@ static int ebs_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - ec = ti->private = kzalloc(sizeof(*ec), GFP_KERNEL); + ec = ti->private = kzalloc_obj(*ec, GFP_KERNEL); if (!ec) { ti->error = "Cannot allocate ebs context"; return -ENOMEM; diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c index 9c84e9d13eca..9bec72f04b9b 100644 --- a/drivers/md/dm-era-target.c +++ b/drivers/md/dm-era-target.c @@ -808,7 +808,7 @@ static struct era_metadata *metadata_open(struct block_device *bdev, bool may_format) { int r; - struct era_metadata *md = kzalloc(sizeof(*md), GFP_KERNEL); + struct era_metadata *md = kzalloc_obj(*md, GFP_KERNEL); if (!md) return NULL; @@ -1473,7 +1473,7 @@ static int era_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - era = kzalloc(sizeof(*era), GFP_KERNEL); + era = kzalloc_obj(*era, GFP_KERNEL); if (!era) { ti->error = "Error allocating era structure"; return -ENOMEM; diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index 88f119a0a2ae..91d541c66709 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -204,7 +204,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, return -EINVAL; } - tmp_store = kzalloc(sizeof(*tmp_store), GFP_KERNEL); + tmp_store = kzalloc_obj(*tmp_store, GFP_KERNEL); if (!tmp_store) { ti->error = "Exception store allocation failed"; return -ENOMEM; diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index 08925aca838c..922e75bfcf17 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -277,7 +277,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - fc = kzalloc(sizeof(*fc), GFP_KERNEL); + fc = kzalloc_obj(*fc, GFP_KERNEL); if (!fc) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c index b37bbe762500..703250739a8a 100644 --- a/drivers/md/dm-init.c +++ b/drivers/md/dm-init.c @@ -127,7 +127,7 @@ static char __init *dm_parse_table_entry(struct dm_device *dev, char *str) /* Delimit last field that can be terminated by comma */ next = str_field_delimit(&field[i], ','); - sp = kzalloc(sizeof(*sp), GFP_KERNEL); + sp = kzalloc_obj(*sp, GFP_KERNEL); if (!sp) return ERR_PTR(-ENOMEM); dev->table[n] = sp; @@ -244,7 +244,7 @@ static int __init dm_parse_devices(struct list_head *devices, char *str) DMDEBUG("parsing \"%s\"", str); while (device) { - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; list_add_tail(&dev->list, devices); diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 681b00958d42..3da3ce600758 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4243,7 +4243,8 @@ static struct page_list *dm_integrity_alloc_page_list(unsigned int n_pages) struct page_list *pl; unsigned int i; - pl = kvmalloc_array(n_pages + 1, sizeof(struct page_list), GFP_KERNEL | __GFP_ZERO); + pl = kvmalloc_objs(struct page_list, n_pages + 1, + GFP_KERNEL | __GFP_ZERO); if (!pl) return NULL; @@ -4277,9 +4278,8 @@ static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_int struct scatterlist **sl; unsigned int i; - sl = kvmalloc_array(ic->journal_sections, - sizeof(struct scatterlist *), - GFP_KERNEL | __GFP_ZERO); + sl = kvmalloc_objs(struct scatterlist *, ic->journal_sections, + GFP_KERNEL | __GFP_ZERO); if (!sl) return NULL; @@ -4296,8 +4296,7 @@ static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_int n_pages = (end_index - start_index + 1); - s = kvmalloc_array(n_pages, sizeof(struct scatterlist), - GFP_KERNEL); + s = kvmalloc_objs(struct scatterlist, n_pages, GFP_KERNEL); if (!s) { dm_integrity_free_journal_scatterlist(ic, sl); return NULL; @@ -4500,9 +4499,8 @@ static int create_journal(struct dm_integrity_c *ic, char **error) goto bad; } - sg = kvmalloc_array(ic->journal_pages + 1, - sizeof(struct scatterlist), - GFP_KERNEL); + sg = kvmalloc_objs(struct scatterlist, + ic->journal_pages + 1, GFP_KERNEL); if (!sg) { *error = "Unable to allocate sg list"; r = -ENOMEM; @@ -4569,9 +4567,9 @@ static int create_journal(struct dm_integrity_c *ic, char **error) r = -ENOMEM; goto bad; } - ic->sk_requests = kvmalloc_array(ic->journal_sections, - sizeof(struct skcipher_request *), - GFP_KERNEL | __GFP_ZERO); + ic->sk_requests = kvmalloc_objs(struct skcipher_request *, + ic->journal_sections, + GFP_KERNEL | __GFP_ZERO); if (!ic->sk_requests) { *error = "Unable to allocate sk requests"; r = -ENOMEM; @@ -4703,7 +4701,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv return -EINVAL; } - ic = kzalloc(sizeof(struct dm_integrity_c), GFP_KERNEL); + ic = kzalloc_obj(struct dm_integrity_c, GFP_KERNEL); if (!ic) { ti->error = "Cannot allocate integrity context"; return -ENOMEM; @@ -5272,7 +5270,8 @@ try_smaller_buffer: r = -ENOMEM; goto bad; } - ic->bbs = kvmalloc_array(ic->n_bitmap_blocks, sizeof(struct bitmap_block_status), GFP_KERNEL); + ic->bbs = kvmalloc_objs(struct bitmap_block_status, + ic->n_bitmap_blocks, GFP_KERNEL); if (!ic->bbs) { ti->error = "Could not allocate memory for bitmap"; r = -ENOMEM; diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index c37668790577..d08399b40dac 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -52,7 +52,7 @@ struct dm_io_client *dm_io_client_create(void) unsigned int min_ios = dm_get_reserved_bio_based_ios(); int ret; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index fd4bf8e1d73e..7ab970430acd 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -218,7 +218,7 @@ static struct hash_cell *alloc_cell(const char *name, const char *uuid, { struct hash_cell *hc; - hc = kmalloc(sizeof(*hc), GFP_KERNEL); + hc = kmalloc_obj(*hc, GFP_KERNEL); if (!hc) return NULL; @@ -2136,7 +2136,7 @@ static int dm_open(struct inode *inode, struct file *filp) if (unlikely(r)) return r; - priv = filp->private_data = kmalloc(sizeof(struct dm_file), GFP_KERNEL); + priv = filp->private_data = kmalloc_obj(struct dm_file, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index cec9a60227b6..03b81b39c65c 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -219,7 +219,7 @@ static struct page_list *alloc_pl(gfp_t gfp) { struct page_list *pl; - pl = kmalloc(sizeof(*pl), gfp); + pl = kmalloc_obj(*pl, gfp); if (!pl) return NULL; @@ -918,7 +918,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro unsigned int reserve_pages; struct dm_kcopyd_client *kc; - kc = kzalloc(sizeof(*kc), GFP_KERNEL); + kc = kzalloc_obj(*kc, GFP_KERNEL); if (!kc) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 73bf290af181..3123227a6e1d 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -39,7 +39,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - lc = kmalloc(sizeof(*lc), GFP_KERNEL); + lc = kmalloc_obj(*lc, GFP_KERNEL); if (lc == NULL) { ti->error = "Cannot allocate linear context"; return -ENOMEM; diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c index 607436804a8b..d1bc7d0c89d9 100644 --- a/drivers/md/dm-log-userspace-base.c +++ b/drivers/md/dm-log-userspace-base.c @@ -205,7 +205,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti, return -EINVAL; } - lc = kzalloc(sizeof(*lc), GFP_KERNEL); + lc = kzalloc_obj(*lc, GFP_KERNEL); if (!lc) { DMWARN("Unable to allocate userspace log context."); return -ENOMEM; diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index f0c84e7a5daa..a1040e8049aa 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -519,7 +519,7 @@ static int log_writes_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - lc = kzalloc(sizeof(struct log_writes_c), GFP_KERNEL); + lc = kzalloc_obj(struct log_writes_c, GFP_KERNEL); if (!lc) { ti->error = "Cannot allocate context"; return -ENOMEM; @@ -587,7 +587,7 @@ static int log_mark(struct log_writes_c *lc, char *data) struct pending_block *block; size_t maxsize = lc->sectorsize - sizeof(struct log_write_entry); - block = kzalloc(sizeof(struct pending_block), GFP_KERNEL); + block = kzalloc_obj(struct pending_block, GFP_KERNEL); if (!block) { DMERR("Error allocating pending block"); return -ENOMEM; diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index bced5a783ee3..7865002678f5 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -153,7 +153,7 @@ struct dm_dirty_log *dm_dirty_log_create(const char *type_name, struct dm_dirty_log_type *type; struct dm_dirty_log *log; - log = kmalloc(sizeof(*log), GFP_KERNEL); + log = kmalloc_obj(*log, GFP_KERNEL); if (!log) return NULL; @@ -402,7 +402,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, region_count = dm_sector_div_up(ti->len, region_size); - lc = kmalloc(sizeof(*lc), GFP_KERNEL); + lc = kmalloc_obj(*lc, GFP_KERNEL); if (!lc) { DMWARN("couldn't allocate core log"); return -ENOMEM; diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index de03f9b06584..e47cfdf4f5d1 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -160,7 +160,7 @@ static bool mpath_double_check_test_bit(int MPATHF_bit, struct multipath *m) */ static struct pgpath *alloc_pgpath(void) { - struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); + struct pgpath *pgpath = kzalloc_obj(*pgpath, GFP_KERNEL); if (!pgpath) return NULL; @@ -179,7 +179,7 @@ static struct priority_group *alloc_priority_group(void) { struct priority_group *pg; - pg = kzalloc(sizeof(*pg), GFP_KERNEL); + pg = kzalloc_obj(*pg, GFP_KERNEL); if (pg) INIT_LIST_HEAD(&pg->pgpaths); @@ -216,7 +216,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti) { struct multipath *m; - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (m) { INIT_LIST_HEAD(&m->priority_groups); spin_lock_init(&m->lock); diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c index 2b0ac200f1c0..28dc759e957a 100644 --- a/drivers/md/dm-path-selector.c +++ b/drivers/md/dm-path-selector.c @@ -87,7 +87,7 @@ out: static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst) { - struct ps_internal *psi = kzalloc(sizeof(*psi), GFP_KERNEL); + struct ps_internal *psi = kzalloc_obj(*psi, GFP_KERNEL); if (psi) psi->pst = *pst; diff --git a/drivers/md/dm-pcache/cache.c b/drivers/md/dm-pcache/cache.c index 534bf07b794f..a616255b83e2 100644 --- a/drivers/md/dm-pcache/cache.c +++ b/drivers/md/dm-pcache/cache.c @@ -138,7 +138,8 @@ static int cache_init(struct dm_pcache *pcache) struct pcache_cache_dev *cache_dev = &pcache->cache_dev; int ret; - cache->segments = kvcalloc(cache_dev->seg_num, sizeof(struct pcache_cache_segment), GFP_KERNEL); + cache->segments = kvzalloc_objs(struct pcache_cache_segment, + cache_dev->seg_num, GFP_KERNEL); if (!cache->segments) { ret = -ENOMEM; goto err; diff --git a/drivers/md/dm-pcache/cache_key.c b/drivers/md/dm-pcache/cache_key.c index 2b77e121f89b..3de356abf952 100644 --- a/drivers/md/dm-pcache/cache_key.c +++ b/drivers/md/dm-pcache/cache_key.c @@ -837,7 +837,8 @@ int cache_tree_init(struct pcache_cache *cache, struct pcache_cache_tree *cache_ * Each element is a cache tree structure that contains * an RB tree root and a spinlock for protecting its contents. */ - cache_tree->subtrees = kvcalloc(cache_tree->n_subtrees, sizeof(struct pcache_cache_subtree), GFP_KERNEL); + cache_tree->subtrees = kvzalloc_objs(struct pcache_cache_subtree, + cache_tree->n_subtrees, GFP_KERNEL); if (!cache_tree->subtrees) { ret = -ENOMEM; goto key_pool_exit; diff --git a/drivers/md/dm-pcache/dm_pcache.c b/drivers/md/dm-pcache/dm_pcache.c index e5f5936fa6f0..c36f2afdadc1 100644 --- a/drivers/md/dm-pcache/dm_pcache.c +++ b/drivers/md/dm-pcache/dm_pcache.c @@ -281,7 +281,7 @@ static int dm_pcache_ctr(struct dm_target *ti, unsigned int argc, char **argv) } /* Allocate memory for the cache structure */ - pcache = kzalloc(sizeof(struct dm_pcache), GFP_KERNEL); + pcache = kzalloc_obj(struct dm_pcache, GFP_KERNEL); if (!pcache) return -ENOMEM; diff --git a/drivers/md/dm-ps-historical-service-time.c b/drivers/md/dm-ps-historical-service-time.c index f07e773d9cc0..a526b5ab0453 100644 --- a/drivers/md/dm-ps-historical-service-time.c +++ b/drivers/md/dm-ps-historical-service-time.c @@ -129,7 +129,7 @@ static u64 fixed_ema(u64 last, u64 next, u64 weight) static struct selector *alloc_selector(void) { - struct selector *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct selector *s = kmalloc_obj(*s, GFP_KERNEL); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -289,7 +289,7 @@ static int hst_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc(sizeof(*pi), GFP_KERNEL); + pi = kmalloc_obj(*pi, GFP_KERNEL); if (!pi) { *error = "historical-service-time ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-ps-io-affinity.c b/drivers/md/dm-ps-io-affinity.c index 80415a045c68..5d69a4a93684 100644 --- a/drivers/md/dm-ps-io-affinity.c +++ b/drivers/md/dm-ps-io-affinity.c @@ -53,7 +53,7 @@ static int ioa_add_path(struct path_selector *ps, struct dm_path *path, return -EINVAL; } - pi = kzalloc(sizeof(*pi), GFP_KERNEL); + pi = kzalloc_obj(*pi, GFP_KERNEL); if (!pi) { *error = "io-affinity ps: Error allocating path context"; return -ENOMEM; @@ -112,12 +112,11 @@ static int ioa_create(struct path_selector *ps, unsigned int argc, char **argv) { struct selector *s; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; - s->path_map = kcalloc(nr_cpu_ids, sizeof(struct path_info *), - GFP_KERNEL); + s->path_map = kzalloc_objs(struct path_info *, nr_cpu_ids, GFP_KERNEL); if (!s->path_map) goto free_selector; diff --git a/drivers/md/dm-ps-queue-length.c b/drivers/md/dm-ps-queue-length.c index 9c68701ed7a4..d2663b1b136c 100644 --- a/drivers/md/dm-ps-queue-length.c +++ b/drivers/md/dm-ps-queue-length.c @@ -42,7 +42,7 @@ struct path_info { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct selector *s = kmalloc_obj(*s, GFP_KERNEL); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -142,7 +142,7 @@ static int ql_add_path(struct path_selector *ps, struct dm_path *path, } /* Allocate the path information structure */ - pi = kmalloc(sizeof(*pi), GFP_KERNEL); + pi = kmalloc_obj(*pi, GFP_KERNEL); if (!pi) { *error = "queue-length ps: Error allocating path information"; return -ENOMEM; diff --git a/drivers/md/dm-ps-round-robin.c b/drivers/md/dm-ps-round-robin.c index 0c12f4073461..ec8b9f27d3e7 100644 --- a/drivers/md/dm-ps-round-robin.c +++ b/drivers/md/dm-ps-round-robin.c @@ -55,7 +55,7 @@ struct selector { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct selector *s = kmalloc_obj(*s, GFP_KERNEL); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -144,7 +144,7 @@ static int rr_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc(sizeof(*pi), GFP_KERNEL); + pi = kmalloc_obj(*pi, GFP_KERNEL); if (!pi) { *error = "round-robin ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-ps-service-time.c b/drivers/md/dm-ps-service-time.c index 0543fe7969c4..dc119955fadd 100644 --- a/drivers/md/dm-ps-service-time.c +++ b/drivers/md/dm-ps-service-time.c @@ -38,7 +38,7 @@ struct path_info { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct selector *s = kmalloc_obj(*s, GFP_KERNEL); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -153,7 +153,7 @@ static int st_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc(sizeof(*pi), GFP_KERNEL); + pi = kmalloc_obj(*pi, GFP_KERNEL); if (!pi) { *error = "service-time ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 4bacdc499984..939d403fda30 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -744,7 +744,7 @@ static struct raid_set *raid_set_alloc(struct dm_target *ti, struct raid_type *r return ERR_PTR(-EINVAL); } - rs = kzalloc(struct_size(rs, dev, raid_devs), GFP_KERNEL); + rs = kzalloc_flex(*rs, dev, raid_devs, GFP_KERNEL); if (!rs) { ti->error = "Cannot allocate raid context"; return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 943c0c6b2087..9fb2182ef287 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -890,7 +890,7 @@ static struct mirror_set *alloc_context(unsigned int nr_mirrors, struct dm_dirty_log *dl) { struct mirror_set *ms = - kzalloc(struct_size(ms, mirror, nr_mirrors), GFP_KERNEL); + kzalloc_flex(*ms, mirror, nr_mirrors, GFP_KERNEL); if (!ms) { ti->error = "Cannot allocate mirror context"; diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index e9b47b659976..a3489965103c 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c @@ -184,7 +184,7 @@ struct dm_region_hash *dm_region_hash_create( ; nr_buckets >>= 1; - rh = kzalloc(sizeof(*rh), GFP_KERNEL); + rh = kzalloc_obj(*rh, GFP_KERNEL); if (!rh) { DMERR("unable to allocate region hash memory"); return ERR_PTR(-ENOMEM); @@ -294,7 +294,7 @@ static struct dm_region *__rh_alloc(struct dm_region_hash *rh, region_t region) nreg = mempool_alloc(&rh->region_pool, GFP_ATOMIC); if (unlikely(!nreg)) - nreg = kmalloc(sizeof(*nreg), GFP_NOIO | __GFP_NOFAIL); + nreg = kmalloc_obj(*nreg, GFP_NOIO | __GFP_NOFAIL); nreg->state = rh->log->type->in_sync(rh->log, region, 1) ? DM_RH_CLEAN : DM_RH_NOSYNC; diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 0e13d60bfdd1..c8128af1dcad 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -626,8 +626,8 @@ static int persistent_read_metadata(struct dm_exception_store *store, */ ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) / sizeof(struct disk_exception); - ps->callbacks = kvcalloc(ps->exceptions_per_area, - sizeof(*ps->callbacks), GFP_KERNEL); + ps->callbacks = kvzalloc_objs(*ps->callbacks, ps->exceptions_per_area, + GFP_KERNEL); if (!ps->callbacks) return -ENOMEM; @@ -854,7 +854,7 @@ static int persistent_ctr(struct dm_exception_store *store, char *options) int r; /* allocate the pstore */ - ps = kzalloc(sizeof(*ps), GFP_KERNEL); + ps = kzalloc_obj(*ps, GFP_KERNEL); if (!ps) return -ENOMEM; diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c index 1e07a745bedd..b7b449db6c34 100644 --- a/drivers/md/dm-snap-transient.c +++ b/drivers/md/dm-snap-transient.c @@ -77,7 +77,7 @@ static int transient_ctr(struct dm_exception_store *store, char *options) { struct transient_c *tc; - tc = kmalloc(sizeof(struct transient_c), GFP_KERNEL); + tc = kmalloc_obj(struct transient_c, GFP_KERNEL); if (!tc) return -ENOMEM; diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index dbd148967de4..5a77ccd33232 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -354,8 +354,7 @@ static int init_origin_hash(void) { int i; - _origins = kmalloc_array(ORIGIN_HASH_SIZE, sizeof(struct list_head), - GFP_KERNEL); + _origins = kmalloc_objs(struct list_head, ORIGIN_HASH_SIZE, GFP_KERNEL); if (!_origins) { DMERR("unable to allocate memory for _origins"); return -ENOMEM; @@ -363,9 +362,8 @@ static int init_origin_hash(void) for (i = 0; i < ORIGIN_HASH_SIZE; i++) INIT_LIST_HEAD(_origins + i); - _dm_origins = kmalloc_array(ORIGIN_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + _dm_origins = kmalloc_objs(struct list_head, ORIGIN_HASH_SIZE, + GFP_KERNEL); if (!_dm_origins) { DMERR("unable to allocate memory for _dm_origins"); kfree(_origins); @@ -559,7 +557,7 @@ static int register_snapshot(struct dm_snapshot *snap) struct block_device *bdev = snap->origin->bdev; int r = 0; - new_o = kmalloc(sizeof(*new_o), GFP_KERNEL); + new_o = kmalloc_obj(*new_o, GFP_KERNEL); if (!new_o) return -ENOMEM; @@ -666,8 +664,7 @@ static int dm_exception_table_init(struct dm_exception_table *et, et->hash_shift = hash_shift; et->hash_mask = size - 1; - et->table = kvmalloc_array(size, sizeof(struct dm_hlist_head), - GFP_KERNEL); + et->table = kvmalloc_objs(struct dm_hlist_head, size, GFP_KERNEL); if (!et->table) return -ENOMEM; @@ -1252,7 +1249,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) origin_mode = BLK_OPEN_WRITE; } - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) { ti->error = "Cannot allocate private snapshot structure"; r = -ENOMEM; @@ -2626,7 +2623,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - o = kmalloc(sizeof(struct dm_origin), GFP_KERNEL); + o = kmalloc_obj(struct dm_origin, GFP_KERNEL); if (!o) { ti->error = "Cannot allocate private origin structure"; r = -ENOMEM; diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c index 1e5d988f44da..b26656dea4ec 100644 --- a/drivers/md/dm-stats.c +++ b/drivers/md/dm-stats.c @@ -971,9 +971,8 @@ static int parse_histogram(const char *h, unsigned int *n_histogram_entries, if (*q == ',') (*n_histogram_entries)++; - *histogram_boundaries = kmalloc_array(*n_histogram_entries, - sizeof(unsigned long long), - GFP_KERNEL); + *histogram_boundaries = kmalloc_objs(unsigned long long, + *n_histogram_entries, GFP_KERNEL); if (!*histogram_boundaries) return -ENOMEM; diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 20cce876d80c..e06bb1f7518e 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -129,7 +129,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - sc = kmalloc(struct_size(sc, stripe, stripes), GFP_KERNEL); + sc = kmalloc_flex(*sc, stripe, stripes, GFP_KERNEL); if (!sc) { ti->error = "Memory allocation for striped context failed"; return -ENOMEM; diff --git a/drivers/md/dm-switch.c b/drivers/md/dm-switch.c index 50a52ca50b34..00dffd4a9ea8 100644 --- a/drivers/md/dm-switch.c +++ b/drivers/md/dm-switch.c @@ -62,7 +62,7 @@ static struct switch_ctx *alloc_switch_ctx(struct dm_target *ti, unsigned int nr { struct switch_ctx *sctx; - sctx = kzalloc(struct_size(sctx, path_list, nr_paths), GFP_KERNEL); + sctx = kzalloc_flex(*sctx, path_list, nr_paths, GFP_KERNEL); if (!sctx) return NULL; diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 7be1d8dc8bdd..4b4712e54797 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -133,7 +133,7 @@ int dm_table_create(struct dm_table **result, blk_mode_t mode, if (num_targets > DM_MAX_TARGETS) return -EOVERFLOW; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) return -ENOMEM; @@ -381,7 +381,7 @@ int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode, dd = find_device(&t->devices, dev); if (!dd) { - dd = kmalloc(sizeof(*dd), GFP_KERNEL); + dd = kmalloc_obj(*dd, GFP_KERNEL); if (!dd) return -ENOMEM; @@ -1391,7 +1391,7 @@ static int dm_table_construct_crypto_profile(struct dm_table *t) unsigned int i; bool empty_profile = true; - dmcp = kmalloc(sizeof(*dmcp), GFP_KERNEL); + dmcp = kmalloc_obj(*dmcp, GFP_KERNEL); if (!dmcp) return -ENOMEM; dmcp->md = t->md; diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c index 1fd41289de36..a138e8a24327 100644 --- a/drivers/md/dm-target.c +++ b/drivers/md/dm-target.c @@ -128,7 +128,7 @@ static int io_err_get_args(struct dm_target *tt, unsigned int argc, char **args) char dummy; int ret; - ioec = kmalloc(sizeof(*ioec), GFP_KERNEL); + ioec = kmalloc_obj(*ioec, GFP_KERNEL); if (!ioec) { tt->error = "Cannot allocate io_err context"; return -ENOMEM; diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index f90679cfec5b..c924ec4d300d 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -957,7 +957,7 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, int r; struct dm_pool_metadata *pmd; - pmd = kmalloc(sizeof(*pmd), GFP_KERNEL); + pmd = kmalloc_obj(*pmd, GFP_KERNEL); if (!pmd) { DMERR("could not allocate metadata struct"); return ERR_PTR(-ENOMEM); @@ -1077,7 +1077,7 @@ static int __open_device(struct dm_pool_metadata *pmd, details_le.snapshotted_time = cpu_to_le32(pmd->time); } - *td = kmalloc(sizeof(**td), GFP_NOIO); + *td = kmalloc_obj(**td, GFP_NOIO); if (!*td) return -ENOMEM; diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 52ffb495f5a8..492ead2d9356 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2949,7 +2949,7 @@ static struct pool *pool_create(struct mapped_device *pool_md, return ERR_CAST(pmd); } - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) { *error = "Error allocating memory for pool"; err_p = ERR_PTR(-ENOMEM); @@ -3354,7 +3354,7 @@ static int pool_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto out; } - pt = kzalloc(sizeof(*pt), GFP_KERNEL); + pt = kzalloc_obj(*pt, GFP_KERNEL); if (!pt) { r = -ENOMEM; goto out; @@ -4193,7 +4193,7 @@ static int thin_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto out_unlock; } - tc = ti->private = kzalloc(sizeof(*tc), GFP_KERNEL); + tc = ti->private = kzalloc_obj(*tc, GFP_KERNEL); if (!tc) { ti->error = "Out of memory"; r = -ENOMEM; diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c index 17be48359564..c595d0a138fc 100644 --- a/drivers/md/dm-unstripe.c +++ b/drivers/md/dm-unstripe.c @@ -48,7 +48,7 @@ static int unstripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - uc = kzalloc(sizeof(*uc), GFP_KERNEL); + uc = kzalloc_obj(*uc, GFP_KERNEL); if (!uc) { ti->error = "Memory allocation for unstriped context failed"; return -ENOMEM; diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 7583607a8aa6..08bb75f00891 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -607,7 +607,7 @@ int verity_fec_ctr_alloc(struct dm_verity *v) { struct dm_verity_fec *f; - f = kzalloc(sizeof(struct dm_verity_fec), GFP_KERNEL); + f = kzalloc_obj(struct dm_verity_fec, GFP_KERNEL); if (!f) { v->ti->error = "Cannot allocate FEC structure"; return -ENOMEM; diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 8089cb74b75d..9dd0c195091f 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -764,8 +764,8 @@ static void verity_submit_prefetch(struct dm_verity *v, struct dm_verity_io *io, return; } - pw = kmalloc(sizeof(struct dm_verity_prefetch_work), - GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN); + pw = kmalloc_obj(struct dm_verity_prefetch_work, + GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN); if (!pw) return; @@ -1369,7 +1369,7 @@ static int verity_setup_salt_and_hashstate(struct dm_verity *v, const char *arg) if (likely(v->use_sha256_lib)) { /* Implies version 1: salt at beginning */ v->initial_hashstate.sha256 = - kmalloc(sizeof(struct sha256_ctx), GFP_KERNEL); + kmalloc_obj(struct sha256_ctx, GFP_KERNEL); if (!v->initial_hashstate.sha256) { ti->error = "Cannot allocate initial hash state"; return -ENOMEM; @@ -1430,7 +1430,7 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv) char dummy; char *root_hash_digest_to_validate; - v = kzalloc(sizeof(struct dm_verity), GFP_KERNEL); + v = kzalloc_obj(struct dm_verity, GFP_KERNEL); if (!v) { ti->error = "Cannot allocate verity structure"; return -ENOMEM; diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index af54e289bceb..bca442478a8d 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1848,9 +1848,8 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba bio->bi_iter.bi_sector = read_original_sector(wc, e); if (unlikely(max_pages > WB_LIST_INLINE)) - wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *), - GFP_NOIO | __GFP_NORETRY | - __GFP_NOMEMALLOC | __GFP_NOWARN); + wb->wc_list = kmalloc_objs(struct wc_entry *, max_pages, + GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN); if (likely(max_pages <= WB_LIST_INLINE) || unlikely(!wb->wc_list)) { wb->wc_list = wb->wc_list_inline; @@ -2246,7 +2245,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned int argc, char **argv) as.argc = argc; as.argv = argv; - wc = kzalloc(sizeof(struct dm_writecache), GFP_KERNEL); + wc = kzalloc_obj(struct dm_writecache, GFP_KERNEL); if (!wc) { ti->error = "Cannot allocate writecache structure"; r = -ENOMEM; diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 83fcd7b31ed9..b9a473ffdb70 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -303,7 +303,7 @@ static struct dm_zone *dmz_get(struct dmz_metadata *zmd, unsigned int zone_id) static struct dm_zone *dmz_insert(struct dmz_metadata *zmd, unsigned int zone_id, struct dmz_dev *dev) { - struct dm_zone *zone = kzalloc(sizeof(struct dm_zone), GFP_KERNEL); + struct dm_zone *zone = kzalloc_obj(struct dm_zone, GFP_KERNEL); if (!zone) return ERR_PTR(-ENOMEM); @@ -419,7 +419,7 @@ static struct dmz_mblock *dmz_alloc_mblock(struct dmz_metadata *zmd, } /* Allocate a new block */ - mblk = kmalloc(sizeof(struct dmz_mblock), GFP_NOIO); + mblk = kmalloc_obj(struct dmz_mblock, GFP_NOIO); if (!mblk) return NULL; @@ -1311,7 +1311,7 @@ static int dmz_load_sb(struct dmz_metadata *zmd) int i; struct dmz_sb *sb; - sb = kzalloc(sizeof(struct dmz_sb), GFP_KERNEL); + sb = kzalloc_obj(struct dmz_sb, GFP_KERNEL); if (!sb) return -ENOMEM; for (i = 1; i < zmd->nr_devs; i++) { @@ -1686,8 +1686,8 @@ static int dmz_load_mapping(struct dmz_metadata *zmd) unsigned int bzone_id; /* Metadata block array for the chunk mapping table */ - zmd->map_mblk = kcalloc(zmd->nr_map_blocks, - sizeof(struct dmz_mblock *), GFP_KERNEL); + zmd->map_mblk = kzalloc_objs(struct dmz_mblock *, zmd->nr_map_blocks, + GFP_KERNEL); if (!zmd->map_mblk) return -ENOMEM; @@ -2868,7 +2868,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev, struct dm_zone *zone; int ret; - zmd = kzalloc(sizeof(struct dmz_metadata), GFP_KERNEL); + zmd = kzalloc_obj(struct dmz_metadata, GFP_KERNEL); if (!zmd) return -ENOMEM; diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c index 76e2c6868548..8598cc9eb40f 100644 --- a/drivers/md/dm-zoned-reclaim.c +++ b/drivers/md/dm-zoned-reclaim.c @@ -556,7 +556,7 @@ int dmz_ctr_reclaim(struct dmz_metadata *zmd, struct dmz_reclaim *zrc; int ret; - zrc = kzalloc(sizeof(struct dmz_reclaim), GFP_KERNEL); + zrc = kzalloc_obj(struct dmz_reclaim, GFP_KERNEL); if (!zrc) return -ENOMEM; diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 9da329078ea4..0e6ddfb96e03 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -545,7 +545,7 @@ static int dmz_queue_chunk_work(struct dmz_target *dmz, struct bio *bio) dmz_get_chunk_work(cw); } else { /* Create a new chunk work */ - cw = kmalloc(sizeof(struct dm_chunk_work), GFP_NOIO); + cw = kmalloc_obj(struct dm_chunk_work, GFP_NOIO); if (unlikely(!cw)) { ret = -ENOMEM; goto out; @@ -838,18 +838,18 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) } /* Allocate and initialize the target descriptor */ - dmz = kzalloc(sizeof(struct dmz_target), GFP_KERNEL); + dmz = kzalloc_obj(struct dmz_target, GFP_KERNEL); if (!dmz) { ti->error = "Unable to allocate the zoned target descriptor"; return -ENOMEM; } - dmz->dev = kcalloc(argc, sizeof(struct dmz_dev), GFP_KERNEL); + dmz->dev = kzalloc_objs(struct dmz_dev, argc, GFP_KERNEL); if (!dmz->dev) { ti->error = "Unable to allocate the zoned device descriptors"; kfree(dmz); return -ENOMEM; } - dmz->ddev = kcalloc(argc, sizeof(struct dm_dev *), GFP_KERNEL); + dmz->ddev = kzalloc_objs(struct dm_dev *, argc, GFP_KERNEL); if (!dmz->ddev) { ti->error = "Unable to allocate the dm device descriptors"; ret = -ENOMEM; diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 1d4a050dab3a..ca833f147c6a 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1025,8 +1025,7 @@ static int md_bitmap_storage_alloc(struct bitmap_storage *store, num_pages = DIV_ROUND_UP(bytes, PAGE_SIZE); offset = slot_number * num_pages; - store->filemap = kmalloc_array(num_pages, sizeof(struct page *), - GFP_KERNEL); + store->filemap = kmalloc_objs(struct page *, num_pages, GFP_KERNEL); if (!store->filemap) return -ENOMEM; @@ -2121,7 +2120,7 @@ static struct bitmap *__bitmap_create(struct mddev *mddev, int slot) return ERR_PTR(-EBUSY); } - bitmap = kzalloc(sizeof(*bitmap), GFP_KERNEL); + bitmap = kzalloc_obj(*bitmap, GFP_KERNEL); if (!bitmap) return ERR_PTR(-ENOMEM); @@ -2436,7 +2435,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks, pages = DIV_ROUND_UP(chunks, PAGE_COUNTER_RATIO); - new_bp = kcalloc(pages, sizeof(*new_bp), GFP_KERNEL); + new_bp = kzalloc_objs(*new_bp, pages, GFP_KERNEL); ret = -ENOMEM; if (!new_bp) { md_bitmap_file_unmap(&store); diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 896279988dfd..c588c972ad54 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -196,7 +196,7 @@ static struct dlm_lock_resource *lockres_init(struct mddev *mddev, int ret, namelen; struct md_cluster_info *cinfo = mddev->cluster_info; - res = kzalloc(sizeof(struct dlm_lock_resource), GFP_KERNEL); + res = kzalloc_obj(struct dlm_lock_resource, GFP_KERNEL); if (!res) return NULL; init_waitqueue_head(&res->sync_locking); @@ -886,7 +886,7 @@ static int join(struct mddev *mddev, int nodes) int ret, ops_rv; char str[64]; - cinfo = kzalloc(sizeof(struct md_cluster_info), GFP_KERNEL); + cinfo = kzalloc_obj(struct md_cluster_info, GFP_KERNEL); if (!cinfo) return -ENOMEM; @@ -1543,8 +1543,8 @@ static int lock_all_bitmaps(struct mddev *mddev) struct md_cluster_info *cinfo = mddev->cluster_info; cinfo->other_bitmap_lockres = - kcalloc(mddev->bitmap_info.nodes - 1, - sizeof(struct dlm_lock_resource *), GFP_KERNEL); + kzalloc_objs(struct dlm_lock_resource *, + mddev->bitmap_info.nodes - 1, GFP_KERNEL); if (!cinfo->other_bitmap_lockres) { pr_err("md: can't alloc mem for other bitmap locks\n"); return 0; diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c index 8d7b82c4a723..beeb88274da4 100644 --- a/drivers/md/md-linear.c +++ b/drivers/md/md-linear.c @@ -92,7 +92,7 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks) int cnt; int i; - conf = kzalloc(struct_size(conf, disks, raid_disks), GFP_KERNEL); + conf = kzalloc_flex(*conf, disks, raid_disks, GFP_KERNEL); if (!conf) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/md-llbitmap.c b/drivers/md/md-llbitmap.c index cd713a7dc270..e8d7af0c665a 100644 --- a/drivers/md/md-llbitmap.c +++ b/drivers/md/md-llbitmap.c @@ -982,7 +982,7 @@ static int llbitmap_create(struct mddev *mddev) if (ret) return ret; - llbitmap = kzalloc(sizeof(*llbitmap), GFP_KERNEL); + llbitmap = kzalloc_obj(*llbitmap, GFP_KERNEL); if (!llbitmap) return -ENOMEM; diff --git a/drivers/md/md.c b/drivers/md/md.c index 72a1c7267851..b7ac2440fbbb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -853,7 +853,7 @@ static struct mddev *mddev_alloc(dev_t unit) if (unit && MAJOR(unit) != MD_MAJOR) unit &= ~((1 << MdpMinorShift) - 1); - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return ERR_PTR(-ENOMEM); @@ -1222,8 +1222,8 @@ static int md_sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) int ret; mdp_super_t *tmp1, *tmp2; - tmp1 = kmalloc(sizeof(*tmp1),GFP_KERNEL); - tmp2 = kmalloc(sizeof(*tmp2),GFP_KERNEL); + tmp1 = kmalloc_obj(*tmp1, GFP_KERNEL); + tmp2 = kmalloc_obj(*tmp2, GFP_KERNEL); if (!tmp1 || !tmp2) { ret = 0; @@ -3817,7 +3817,7 @@ static struct md_rdev *md_import_device(dev_t newdev, int super_format, int supe sector_t size; int err; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return ERR_PTR(-ENOMEM); @@ -7238,7 +7238,7 @@ static int get_bitmap_file(struct mddev *mddev, void __user * arg) char *ptr; int err; - file = kzalloc(sizeof(*file), GFP_NOIO); + file = kzalloc_obj(*file, GFP_NOIO); if (!file) return -ENOMEM; @@ -8541,7 +8541,7 @@ struct md_thread *md_register_thread(void (*run) (struct md_thread *), { struct md_thread *thread; - thread = kzalloc(sizeof(struct md_thread), GFP_KERNEL); + thread = kzalloc_obj(struct md_thread, GFP_KERNEL); if (!thread) return NULL; @@ -10749,7 +10749,7 @@ void md_autodetect_dev(dev_t dev) { struct detected_devices_node *node_detected_dev; - node_detected_dev = kzalloc(sizeof(*node_detected_dev), GFP_KERNEL); + node_detected_dev = kzalloc_obj(*node_detected_dev, GFP_KERNEL); if (node_detected_dev) { node_detected_dev->dev = dev; mutex_lock(&detected_devices_mutex); diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index 1ef71e5fcde7..43bd64b77a7d 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -388,7 +388,7 @@ struct dm_block_manager *dm_block_manager_create(struct block_device *bdev, int r; struct dm_block_manager *bm; - bm = kmalloc(sizeof(*bm), GFP_KERNEL); + bm = kmalloc_obj(*bm, GFP_KERNEL); if (!bm) { r = -ENOMEM; goto bad; diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index 0c7a2e8d1846..dd02eee4a23c 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -280,7 +280,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root) * considered an FS op. We can't recurse back into the FS, so we * allocate GFP_NOFS. */ - s = kmalloc(sizeof(*s), GFP_NOFS); + s = kmalloc_obj(*s, GFP_NOFS); if (!s) return -ENOMEM; s->info = info; diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c index f4241f54e20e..1d3cfc87701a 100644 --- a/drivers/md/persistent-data/dm-space-map-disk.c +++ b/drivers/md/persistent-data/dm-space-map-disk.c @@ -220,7 +220,7 @@ struct dm_space_map *dm_sm_disk_create(struct dm_transaction_manager *tm, int r; struct sm_disk *smd; - smd = kmalloc(sizeof(*smd), GFP_KERNEL); + smd = kmalloc_obj(*smd, GFP_KERNEL); if (!smd) return ERR_PTR(-ENOMEM); @@ -254,7 +254,7 @@ struct dm_space_map *dm_sm_disk_open(struct dm_transaction_manager *tm, int r; struct sm_disk *smd; - smd = kmalloc(sizeof(*smd), GFP_KERNEL); + smd = kmalloc_obj(*smd, GFP_KERNEL); if (!smd) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c index d48c4fafc779..3c82a715ceed 100644 --- a/drivers/md/persistent-data/dm-space-map-metadata.c +++ b/drivers/md/persistent-data/dm-space-map-metadata.c @@ -772,7 +772,7 @@ struct dm_space_map *dm_sm_metadata_init(void) { struct sm_metadata *smm; - smm = kvmalloc(sizeof(*smm), GFP_KERNEL); + smm = kvmalloc_obj(*smm, GFP_KERNEL); if (!smm) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 98c745d90f48..1f50f50665ef 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.c +++ b/drivers/md/persistent-data/dm-transaction-manager.c @@ -137,7 +137,7 @@ static void insert_shadow(struct dm_transaction_manager *tm, dm_block_t b) unsigned int bucket; struct shadow_info *si; - si = kmalloc(sizeof(*si), GFP_NOIO); + si = kmalloc_obj(*si, GFP_NOIO); if (si) { struct rb_node **node, *parent; si->where = b; @@ -185,7 +185,7 @@ static struct dm_transaction_manager *dm_tm_create(struct dm_block_manager *bm, unsigned int i; struct dm_transaction_manager *tm; - tm = kmalloc(sizeof(*tm), GFP_KERNEL); + tm = kmalloc_obj(*tm, GFP_KERNEL); if (!tm) return ERR_PTR(-ENOMEM); @@ -207,7 +207,7 @@ struct dm_transaction_manager *dm_tm_create_non_blocking_clone(struct dm_transac { struct dm_transaction_manager *tm; - tm = kmalloc(sizeof(*tm), GFP_KERNEL); + tm = kmalloc_obj(*tm, GFP_KERNEL); if (tm) { tm->is_clone = 1; tm->real = real; diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index d83b2b1c0049..f316267a2c02 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -69,7 +69,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) struct md_rdev *smallest, *rdev1, *rdev2, *rdev, **dev; struct strip_zone *zone; int cnt; - struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); + struct r0conf *conf = kzalloc_obj(*conf, GFP_KERNEL); unsigned int blksize = 512; if (!mddev_is_dm(mddev)) @@ -143,9 +143,8 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) } err = -ENOMEM; - conf->strip_zone = kcalloc(conf->nr_strip_zones, - sizeof(struct strip_zone), - GFP_KERNEL); + conf->strip_zone = kzalloc_objs(struct strip_zone, conf->nr_strip_zones, + GFP_KERNEL); if (!conf->strip_zone) goto abort; conf->devlist = kzalloc(array3_size(sizeof(struct md_rdev *), diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 867db18bc3ba..d5fd7841dd9f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -155,8 +155,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) if (!r1_bio) return NULL; - rps = kmalloc_array(conf->raid_disks * 2, sizeof(struct resync_pages), - gfp_flags); + rps = kmalloc_objs(struct resync_pages, conf->raid_disks * 2, gfp_flags); if (!rps) goto out_free_r1bio; @@ -3070,27 +3069,25 @@ static struct r1conf *setup_conf(struct mddev *mddev) size_t r1bio_size; int err = -ENOMEM; - conf = kzalloc(sizeof(struct r1conf), GFP_KERNEL); + conf = kzalloc_obj(struct r1conf, GFP_KERNEL); if (!conf) goto abort; - conf->nr_pending = kcalloc(BARRIER_BUCKETS_NR, - sizeof(atomic_t), GFP_KERNEL); + conf->nr_pending = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, + GFP_KERNEL); if (!conf->nr_pending) goto abort; - conf->nr_waiting = kcalloc(BARRIER_BUCKETS_NR, - sizeof(atomic_t), GFP_KERNEL); + conf->nr_waiting = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, + GFP_KERNEL); if (!conf->nr_waiting) goto abort; - conf->nr_queued = kcalloc(BARRIER_BUCKETS_NR, - sizeof(atomic_t), GFP_KERNEL); + conf->nr_queued = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, GFP_KERNEL); if (!conf->nr_queued) goto abort; - conf->barrier = kcalloc(BARRIER_BUCKETS_NR, - sizeof(atomic_t), GFP_KERNEL); + conf->barrier = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, GFP_KERNEL); if (!conf->barrier) goto abort; diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 9debb20cf129..bdd3a7feaea7 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -152,7 +152,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data) nalloc_rp = nalloc; else nalloc_rp = nalloc * 2; - rps = kmalloc_array(nalloc_rp, sizeof(struct resync_pages), gfp_flags); + rps = kmalloc_objs(struct resync_pages, nalloc_rp, gfp_flags); if (!rps) goto out_free_r10bio; @@ -3852,14 +3852,14 @@ static struct r10conf *setup_conf(struct mddev *mddev) } err = -ENOMEM; - conf = kzalloc(sizeof(struct r10conf), GFP_KERNEL); + conf = kzalloc_obj(struct r10conf, GFP_KERNEL); if (!conf) goto out; /* FIXME calc properly */ - conf->mirrors = kcalloc(mddev->raid_disks + max(0, -mddev->delta_disks), - sizeof(struct raid10_info), - GFP_KERNEL); + conf->mirrors = kzalloc_objs(struct raid10_info, + mddev->raid_disks + max(0, -mddev->delta_disks), + GFP_KERNEL); if (!conf->mirrors) goto out; @@ -4281,9 +4281,9 @@ static int raid10_check_reshape(struct mddev *mddev) if (mddev->delta_disks > 0) { /* allocate new 'mirrors' list */ conf->mirrors_new = - kcalloc(mddev->raid_disks + mddev->delta_disks, - sizeof(struct raid10_info), - GFP_KERNEL); + kzalloc_objs(struct raid10_info, + mddev->raid_disks + mddev->delta_disks, + GFP_KERNEL); if (!conf->mirrors_new) return -ENOMEM; } @@ -4918,7 +4918,7 @@ static int handle_reshape_read_error(struct mddev *mddev, int idx = 0; struct page **pages; - r10b = kmalloc(struct_size(r10b, devs, conf->copies), GFP_NOIO); + r10b = kmalloc_flex(*r10b, devs, conf->copies, GFP_NOIO); if (!r10b) { set_bit(MD_RECOVERY_INTR, &mddev->recovery); return -ENOMEM; diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index e29e69335c69..3ae22f6aacda 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -2447,7 +2447,7 @@ static int r5l_recovery_log(struct r5l_log *log) int ret; sector_t pos; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -3071,7 +3071,7 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) return -EINVAL; } - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) return -ENOMEM; log->rdev = rdev; diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 56b234683ee6..9dfa07ed723f 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -1352,7 +1352,7 @@ int ppl_init_log(struct r5conf *conf) return -EINVAL; } - ppl_conf = kzalloc(sizeof(struct ppl_conf), GFP_KERNEL); + ppl_conf = kzalloc_obj(struct ppl_conf, GFP_KERNEL); if (!ppl_conf) return -ENOMEM; @@ -1378,8 +1378,8 @@ int ppl_init_log(struct r5conf *conf) goto err; ppl_conf->count = conf->raid_disks; - ppl_conf->child_logs = kcalloc(ppl_conf->count, sizeof(struct ppl_log), - GFP_KERNEL); + ppl_conf->child_logs = kzalloc_objs(struct ppl_log, ppl_conf->count, + GFP_KERNEL); if (!ppl_conf->child_logs) { ret = -ENOMEM; goto err; diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 8854e024f311..ba8381cbb2f1 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -513,7 +513,7 @@ init_stripe_shared_pages(struct stripe_head *sh, struct r5conf *conf, int disks) cnt = PAGE_SIZE / conf->stripe_size; nr_pages = (disks + cnt - 1) / cnt; - sh->pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); + sh->pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!sh->pages) return -ENOMEM; sh->nr_pages = nr_pages; @@ -2610,7 +2610,7 @@ static int resize_stripes(struct r5conf *conf, int newsize) * is completely stalled, so now is a good time to resize * conf->disks and the scribble region */ - ndisks = kcalloc(newsize, sizeof(struct disk_info), GFP_NOIO); + ndisks = kzalloc_objs(struct disk_info, newsize, GFP_NOIO); if (ndisks) { for (i = 0; i < conf->pool_size; i++) ndisks[i] = conf->disks[i]; @@ -7267,8 +7267,8 @@ static int alloc_thread_groups(struct r5conf *conf, int cnt, int *group_cnt, *group_cnt = num_possible_nodes(); size = sizeof(struct r5worker) * cnt; workers = kcalloc(size, *group_cnt, GFP_NOIO); - *worker_groups = kcalloc(*group_cnt, sizeof(struct r5worker_group), - GFP_NOIO); + *worker_groups = kzalloc_objs(struct r5worker_group, *group_cnt, + GFP_NOIO); if (!*worker_groups || !workers) { kfree(workers); kfree(*worker_groups); @@ -7497,7 +7497,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) return ERR_PTR(-EINVAL); } - conf = kzalloc(sizeof(struct r5conf), GFP_KERNEL); + conf = kzalloc_obj(struct r5conf, GFP_KERNEL); if (conf == NULL) goto abort; @@ -7508,9 +7508,8 @@ static struct r5conf *setup_conf(struct mddev *mddev) #endif INIT_LIST_HEAD(&conf->free_list); INIT_LIST_HEAD(&conf->pending_list); - conf->pending_data = kcalloc(PENDING_IO_MAX, - sizeof(struct r5pending_data), - GFP_KERNEL); + conf->pending_data = kzalloc_objs(struct r5pending_data, PENDING_IO_MAX, + GFP_KERNEL); if (!conf->pending_data) goto abort; for (i = 0; i < PENDING_IO_MAX; i++) @@ -7557,8 +7556,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) conf->previous_raid_disks = mddev->raid_disks - mddev->delta_disks; max_disks = max(conf->raid_disks, conf->previous_raid_disks); - conf->disks = kcalloc(max_disks, sizeof(struct disk_info), - GFP_KERNEL); + conf->disks = kzalloc_objs(struct disk_info, max_disks, GFP_KERNEL); if (!conf->disks) goto abort; diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c index ba6828ef540e..b81cdf343209 100644 --- a/drivers/media/cec/core/cec-adap.c +++ b/drivers/media/cec/core/cec-adap.c @@ -95,7 +95,7 @@ void cec_queue_event_fh(struct cec_fh *fh, if (ev_idx < CEC_NUM_CORE_EVENTS) entry = &fh->core_events[ev_idx]; else - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (entry) { if (new_ev->event == CEC_EVENT_LOST_MSGS && fh->queued_events[ev_idx]) { @@ -218,7 +218,7 @@ static void cec_queue_msg_fh(struct cec_fh *fh, const struct cec_msg *msg) struct cec_msg_entry *entry; mutex_lock(&fh->lock); - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (entry) { entry->msg = *msg; /* Add new msg at the end of the queue */ @@ -922,7 +922,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg, return -EBUSY; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/media/cec/core/cec-api.c b/drivers/media/cec/core/cec-api.c index 2b50578d107e..c634185a3446 100644 --- a/drivers/media/cec/core/cec-api.c +++ b/drivers/media/cec/core/cec-api.c @@ -555,7 +555,7 @@ static int cec_open(struct inode *inode, struct file *filp) struct cec_devnode *devnode = container_of(inode->i_cdev, struct cec_devnode, cdev); struct cec_adapter *adap = to_cec_adapter(devnode); - struct cec_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); + struct cec_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); /* * Initial events that are automatically sent when the cec device is * opened. diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index dd6e24a0899b..e6d958662d37 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -237,7 +237,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, return ERR_PTR(-EINVAL); if (WARN_ON(!available_las || available_las > CEC_MAX_LOG_ADDRS)) return ERR_PTR(-EINVAL); - adap = kzalloc(sizeof(*adap), GFP_KERNEL); + adap = kzalloc_obj(*adap, GFP_KERNEL); if (!adap) return ERR_PTR(-ENOMEM); strscpy(adap->name, name, sizeof(adap->name)); diff --git a/drivers/media/cec/core/cec-notifier.c b/drivers/media/cec/core/cec-notifier.c index 1fed0b1c71e9..026476ce6bfb 100644 --- a/drivers/media/cec/core/cec-notifier.c +++ b/drivers/media/cec/core/cec-notifier.c @@ -63,7 +63,7 @@ cec_notifier_get_conn(struct device *hdmi_dev, const char *port_name) return n; } } - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) goto unlock; n->hdmi_dev = hdmi_dev; diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c index 4d7155281daa..5299d944b526 100644 --- a/drivers/media/cec/core/cec-pin.c +++ b/drivers/media/cec/core/cec-pin.c @@ -1367,7 +1367,7 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops, void *priv, const char *name, u32 caps) { struct cec_adapter *adap; - struct cec_pin *pin = kzalloc(sizeof(*pin), GFP_KERNEL); + struct cec_pin *pin = kzalloc_obj(*pin, GFP_KERNEL); if (pin == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c index bf92576bb2fc..8249d3bb11e4 100644 --- a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c +++ b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c @@ -1494,7 +1494,7 @@ static int extron_setup(struct extron *extron) if (vendor_id) caps &= ~CEC_CAP_LOG_ADDRS; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -1769,7 +1769,7 @@ static int extron_connect(struct serio *serio, struct serio_driver *drv) manufacturer_name[0] = 0; } - extron = kzalloc(sizeof(*extron), GFP_KERNEL); + extron = kzalloc_obj(*extron, GFP_KERNEL); if (!extron) return -ENOMEM; diff --git a/drivers/media/cec/usb/pulse8/pulse8-cec.c b/drivers/media/cec/usb/pulse8/pulse8-cec.c index 60569f1670fe..d000416d25c4 100644 --- a/drivers/media/cec/usb/pulse8/pulse8-cec.c +++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c @@ -840,7 +840,7 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv) struct cec_log_addrs log_addrs = {}; u16 pa = CEC_PHYS_ADDR_INVALID; - pulse8 = kzalloc(sizeof(*pulse8), GFP_KERNEL); + pulse8 = kzalloc_obj(*pulse8, GFP_KERNEL); if (!pulse8) return -ENOMEM; diff --git a/drivers/media/cec/usb/rainshadow/rainshadow-cec.c b/drivers/media/cec/usb/rainshadow/rainshadow-cec.c index 6c0cee4b066f..5457fe240654 100644 --- a/drivers/media/cec/usb/rainshadow/rainshadow-cec.c +++ b/drivers/media/cec/usb/rainshadow/rainshadow-cec.c @@ -313,7 +313,7 @@ static int rain_connect(struct serio *serio, struct serio_driver *drv) struct cec_log_addrs log_addrs = {}; u16 pa = CEC_PHYS_ADDR_INVALID; - rain = kzalloc(sizeof(*rain), GFP_KERNEL); + rain = kzalloc_obj(*rain, GFP_KERNEL); if (!rain) return -ENOMEM; diff --git a/drivers/media/common/b2c2/flexcop.c b/drivers/media/common/b2c2/flexcop.c index 8506de48ba45..88668065a308 100644 --- a/drivers/media/common/b2c2/flexcop.c +++ b/drivers/media/common/b2c2/flexcop.c @@ -214,8 +214,8 @@ void flexcop_reset_block_300(struct flexcop_device *fc) struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) { void *bus; - struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), - GFP_KERNEL); + struct flexcop_device *fc = kzalloc_obj(struct flexcop_device, + GFP_KERNEL); if (!fc) { err("no memory"); return NULL; diff --git a/drivers/media/common/cypress_firmware.c b/drivers/media/common/cypress_firmware.c index cdc7050ed3ac..c1c110428928 100644 --- a/drivers/media/common/cypress_firmware.c +++ b/drivers/media/common/cypress_firmware.c @@ -75,7 +75,7 @@ int cypress_load_firmware(struct usb_device *udev, struct hexline *hx; int ret, pos = 0; - hx = kmalloc(sizeof(*hx), GFP_KERNEL); + hx = kmalloc_obj(*hx, GFP_KERNEL); if (!hx) return -ENOMEM; diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c index 27c53eed8fe3..fc0f88b16dc3 100644 --- a/drivers/media/common/saa7146/saa7146_core.c +++ b/drivers/media/common/saa7146/saa7146_core.c @@ -141,7 +141,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) struct page *pg; int i; - sglist = kmalloc_array(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); + sglist = kmalloc_objs(struct scatterlist, nr_pages, GFP_KERNEL); if (NULL == sglist) return NULL; sg_init_table(sglist, nr_pages); @@ -334,7 +334,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent int err = -ENOMEM; /* clear out mem for sure */ - dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL); + dev = kzalloc_obj(struct saa7146_dev, GFP_KERNEL); if (!dev) { ERR("out of memory\n"); goto out; diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c index a9e3bad76d54..f448c0a0e05f 100644 --- a/drivers/media/common/saa7146/saa7146_fops.c +++ b/drivers/media/common/saa7146/saa7146_fops.c @@ -266,7 +266,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) } dev->v4l2_dev.ctrl_handler = hdl; - vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); + vv = kzalloc_obj(struct saa7146_vv, GFP_KERNEL); if (vv == NULL) { ERR("out of memory. aborting.\n"); v4l2_ctrl_handler_free(hdl); diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 3732367e0c62..489a8dd0a161 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -439,7 +439,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) return entry; } } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (entry) { entry->mode = default_mode; strscpy(entry->devpath, devpath, sizeof(entry->devpath)); @@ -528,7 +528,7 @@ int smscore_register_hotplug(hotplug_t hotplug) int rc = 0; mutex_lock(&g_smscore_deviceslock); - notifyee = kmalloc(sizeof(*notifyee), GFP_KERNEL); + notifyee = kmalloc_obj(*notifyee, GFP_KERNEL); if (notifyee) { /* now notify callback about existing devices */ first = &g_smscore_devices; @@ -617,7 +617,7 @@ smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, { struct smscore_buffer_t *cb; - cb = kzalloc(sizeof(*cb), GFP_KERNEL); + cb = kzalloc_obj(*cb, GFP_KERNEL); if (!cb) return NULL; @@ -647,7 +647,7 @@ int smscore_register_device(struct smsdevice_params_t *params, struct smscore_device_t *dev; u8 *buffer; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -1678,7 +1678,7 @@ static int smscore_validate_client(struct smscore_device_t *coredev, pr_err("The msg ID already registered to another client.\n"); return -EEXIST; } - listentry = kzalloc(sizeof(*listentry), GFP_KERNEL); + listentry = kzalloc_obj(*listentry, GFP_KERNEL); if (!listentry) return -ENOMEM; @@ -1715,7 +1715,7 @@ int smscore_register_client(struct smscore_device_t *coredev, return -EEXIST; } - newclient = kzalloc(sizeof(*newclient), GFP_KERNEL); + newclient = kzalloc_obj(*newclient, GFP_KERNEL); if (!newclient) return -ENOMEM; diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index d14ba271db50..e5fbc08d4192 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -358,7 +358,7 @@ int smsdvb_debugfs_create(struct smsdvb_client_t *client) if (!smsdvb_debugfs_usb_root || !coredev->is_usb_device) return -ENODEV; - debug_data = kzalloc(sizeof(*client->debug_data), GFP_KERNEL); + debug_data = kzalloc_obj(*client->debug_data, GFP_KERNEL); if (!debug_data) return -ENOMEM; diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index 9b1a650ed055..f49845a266e5 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1110,7 +1110,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, /* device removal handled by onremove callback */ if (!arrival) return 0; - client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); + client = kzalloc_obj(struct smsdvb_client_t, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 2d1f253b4929..a70181f8d9d9 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -841,7 +841,7 @@ static bool verify_coherency_flags(struct vb2_queue *q, bool non_coherent_mem) static int vb2_core_allocated_buffers_storage(struct vb2_queue *q) { if (!q->bufs) - q->bufs = kcalloc(q->max_num_buffers, sizeof(*q->bufs), GFP_KERNEL); + q->bufs = kzalloc_objs(*q->bufs, q->max_num_buffers, GFP_KERNEL); if (!q->bufs) return -ENOMEM; @@ -2861,7 +2861,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, q->fileio_write_immediately); - fileio = kzalloc(sizeof(*fileio), GFP_KERNEL); + fileio = kzalloc_obj(*fileio, GFP_KERNEL); if (fileio == NULL) return -ENOMEM; @@ -3256,7 +3256,7 @@ int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv, if (WARN_ON(q->fileio)) return -EBUSY; - threadio = kzalloc(sizeof(*threadio), GFP_KERNEL); + threadio = kzalloc_obj(*threadio, GFP_KERNEL); if (threadio == NULL) return -ENOMEM; threadio->fnc = fnc; diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index 7123c5fae92c..983de3b99acb 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -238,7 +238,7 @@ static void *vb2_dc_alloc(struct vb2_buffer *vb, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof *buf, GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -325,7 +325,7 @@ static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dc_buf *buf = dbuf->priv; int ret; - attach = kzalloc(sizeof(*attach), GFP_KERNEL); + attach = kzalloc_obj(*attach, GFP_KERNEL); if (!attach) return -ENOMEM; @@ -479,7 +479,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) if (buf->non_coherent_mem) return buf->dma_sgt; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { dev_err(buf->dev, "failed to alloc sg table\n"); return NULL; @@ -587,7 +587,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof *buf, GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -624,7 +624,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, goto out; } - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { pr_err("failed to allocate sg table\n"); ret = -ENOMEM; @@ -779,7 +779,7 @@ static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index b3bf2173c14e..76a9301fb85b 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -109,7 +109,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev) || WARN_ON(!size)) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof *buf, GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -126,7 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, * there is no memory consistency guarantee, hence dma-sg ignores DMA * attributes passed from the upper layer. */ - buf->pages = kvcalloc(buf->num_pages, sizeof(struct page *), GFP_KERNEL); + buf->pages = kvzalloc_objs(struct page *, buf->num_pages, GFP_KERNEL); if (!buf->pages) goto fail_pages_array_alloc; @@ -230,7 +230,7 @@ static void *vb2_dma_sg_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof *buf, GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -375,7 +375,7 @@ static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dma_sg_buf *buf = dbuf->priv; int ret; - attach = kzalloc(sizeof(*attach), GFP_KERNEL); + attach = kzalloc_obj(*attach, GFP_KERNEL); if (!attach) return -ENOMEM; @@ -626,7 +626,7 @@ static void *vb2_dma_sg_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dvb.c b/drivers/media/common/videobuf2/videobuf2-dvb.c index 3746bf6d1c15..e37dd9007b19 100644 --- a/drivers/media/common/videobuf2/videobuf2-dvb.c +++ b/drivers/media/common/videobuf2/videobuf2-dvb.c @@ -299,7 +299,7 @@ struct vb2_dvb_frontend *vb2_dvb_alloc_frontend( { struct vb2_dvb_frontend *fe; - fe = kzalloc(sizeof(struct vb2_dvb_frontend), GFP_KERNEL); + fe = kzalloc_obj(struct vb2_dvb_frontend, GFP_KERNEL); if (fe == NULL) return NULL; diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index 3f777068cd34..a410e9078626 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c @@ -39,7 +39,7 @@ static void *vb2_vmalloc_alloc(struct vb2_buffer *vb, struct device *dev, { struct vb2_vmalloc_buf *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL | vb->vb2_queue->gfp_flags); + buf = kzalloc_obj(*buf, GFP_KERNEL | vb->vb2_queue->gfp_flags); if (!buf) return ERR_PTR(-ENOMEM); @@ -78,7 +78,7 @@ static void *vb2_vmalloc_get_userptr(struct vb2_buffer *vb, struct device *dev, int n_pages, offset, i; int ret = -ENOMEM; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -221,7 +221,7 @@ static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, int ret; int i; - attach = kzalloc(sizeof(*attach), GFP_KERNEL); + attach = kzalloc_obj(*attach, GFP_KERNEL); if (!attach) return -ENOMEM; @@ -409,7 +409,7 @@ static void *vb2_vmalloc_attach_dmabuf(struct vb2_buffer *vb, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index c946c8ea6e39..254d56059863 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -892,7 +892,7 @@ static int dvb_dmxdev_add_pid(struct dmxdev *dmxdev, (!list_empty(&filter->feed.ts))) return -EINVAL; - feed = kzalloc(sizeof(struct dmxdev_feed), GFP_KERNEL); + feed = kzalloc_obj(struct dmxdev_feed, GFP_KERNEL); if (feed == NULL) return -ENOMEM; diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index 7b591aa1179f..d25d4522240a 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1880,7 +1880,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, return -EINVAL; /* initialise the system data */ - ca = kzalloc(sizeof(*ca), GFP_KERNEL); + ca = kzalloc_obj(*ca, GFP_KERNEL); if (!ca) { ret = -ENOMEM; goto exit; @@ -1889,8 +1889,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, ca->pub = pubca; ca->flags = flags; ca->slot_count = slot_count; - ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), - GFP_KERNEL); + ca->slot_info = kzalloc_objs(struct dvb_ca_slot, slot_count, GFP_KERNEL); if (!ca->slot_info) { ret = -ENOMEM; goto free_ca; diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index a05aa271a1ba..6ba5857d280f 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -3021,7 +3021,7 @@ int dvb_register_frontend(struct dvb_adapter *dvb, if (mutex_lock_interruptible(&frontend_mutex)) return -ERESTARTSYS; - fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); + fe->frontend_priv = kzalloc_obj(struct dvb_frontend_private, GFP_KERNEL); if (!fe->frontend_priv) { mutex_unlock(&frontend_mutex); return -ENOMEM; diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 8b980d371a45..00476e7ee048 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -251,13 +251,13 @@ static int dvb_create_tsout_entity(struct dvb_device *dvbdev, { int i; - dvbdev->tsout_pads = kcalloc(npads, sizeof(*dvbdev->tsout_pads), - GFP_KERNEL); + dvbdev->tsout_pads = kzalloc_objs(*dvbdev->tsout_pads, npads, + GFP_KERNEL); if (!dvbdev->tsout_pads) return -ENOMEM; - dvbdev->tsout_entity = kcalloc(npads, sizeof(*dvbdev->tsout_entity), - GFP_KERNEL); + dvbdev->tsout_entity = kzalloc_objs(*dvbdev->tsout_entity, npads, + GFP_KERNEL); if (!dvbdev->tsout_entity) return -ENOMEM; @@ -328,15 +328,14 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev, return 0; } - dvbdev->entity = kzalloc(sizeof(*dvbdev->entity), GFP_KERNEL); + dvbdev->entity = kzalloc_obj(*dvbdev->entity, GFP_KERNEL); if (!dvbdev->entity) return -ENOMEM; dvbdev->entity->name = dvbdev->name; if (npads) { - dvbdev->pads = kcalloc(npads, sizeof(*dvbdev->pads), - GFP_KERNEL); + dvbdev->pads = kzalloc_objs(*dvbdev->pads, npads, GFP_KERNEL); if (!dvbdev->pads) { kfree(dvbdev->entity); dvbdev->entity = NULL; @@ -472,7 +471,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, return -ENFILE; } - *pdvbdev = dvbdev = kzalloc(sizeof(*dvbdev), GFP_KERNEL); + *pdvbdev = dvbdev = kzalloc_obj(*dvbdev, GFP_KERNEL); if (!dvbdev) { mutex_unlock(&dvbdev_register_lock); return -ENOMEM; @@ -500,7 +499,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, return -ENOMEM; } - new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); + new_node = kzalloc_obj(*new_node, GFP_KERNEL); if (!new_node) { kfree(dvbdevfops); kfree(dvbdev); @@ -712,12 +711,12 @@ int dvb_create_media_graph(struct dvb_adapter *adap, demod = NULL; if (create_rf_connector) { - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) return -ENOMEM; adap->conn = conn; - adap->conn_pads = kzalloc(sizeof(*adap->conn_pads), GFP_KERNEL); + adap->conn_pads = kzalloc_obj(*adap->conn_pads, GFP_KERNEL); if (!adap->conn_pads) return -ENOMEM; @@ -1027,7 +1026,7 @@ struct i2c_client *dvb_module_probe(const char *module_name, struct i2c_client *client; struct i2c_board_info *board_info; - board_info = kzalloc(sizeof(*board_info), GFP_KERNEL); + board_info = kzalloc_obj(*board_info, GFP_KERNEL); if (!board_info) return NULL; diff --git a/drivers/media/dvb-frontends/a8293.c b/drivers/media/dvb-frontends/a8293.c index bf2773c5b97a..c1eeed1d08e6 100644 --- a/drivers/media/dvb-frontends/a8293.c +++ b/drivers/media/dvb-frontends/a8293.c @@ -218,7 +218,7 @@ static int a8293_probe(struct i2c_client *client) int ret; u8 buf[2]; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index befd6a4eafd9..d004ec9e94f0 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -1447,7 +1447,7 @@ static int af9013_probe(struct i2c_client *client) .val_bits = 8, }; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index eed2ea4da8fa..584cc0405e4a 100644 --- a/drivers/media/dvb-frontends/af9033.c +++ b/drivers/media/dvb-frontends/af9033.c @@ -1062,7 +1062,7 @@ static int af9033_probe(struct i2c_client *client) }; /* Allocate memory for the internal state */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/as102_fe.c b/drivers/media/dvb-frontends/as102_fe.c index bc72d954dc1f..5b17d0b6f3ea 100644 --- a/drivers/media/dvb-frontends/as102_fe.c +++ b/drivers/media/dvb-frontends/as102_fe.c @@ -447,7 +447,7 @@ struct dvb_frontend *as102_attach(const char *name, struct as102_state *state; struct dvb_frontend *fe; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ascot2e.c b/drivers/media/dvb-frontends/ascot2e.c index cf8e5f1bd101..0d28a3422cae 100644 --- a/drivers/media/dvb-frontends/ascot2e.c +++ b/drivers/media/dvb-frontends/ascot2e.c @@ -477,7 +477,7 @@ struct dvb_frontend *ascot2e_attach(struct dvb_frontend *fe, u8 data[4]; struct ascot2e_priv *priv = NULL; - priv = kzalloc(sizeof(struct ascot2e_priv), GFP_KERNEL); + priv = kzalloc_obj(struct ascot2e_priv, GFP_KERNEL); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/atbm8830.c b/drivers/media/dvb-frontends/atbm8830.c index 778c865085bf..2b9dbd748ebc 100644 --- a/drivers/media/dvb-frontends/atbm8830.c +++ b/drivers/media/dvb-frontends/atbm8830.c @@ -458,7 +458,7 @@ struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config, if (config == NULL || i2c == NULL) return NULL; - priv = kzalloc(sizeof(struct atbm_state), GFP_KERNEL); + priv = kzalloc_obj(struct atbm_state, GFP_KERNEL); if (priv == NULL) goto error_out; diff --git a/drivers/media/dvb-frontends/bcm3510.c b/drivers/media/dvb-frontends/bcm3510.c index d935fb10e620..50f43f9c7aef 100644 --- a/drivers/media/dvb-frontends/bcm3510.c +++ b/drivers/media/dvb-frontends/bcm3510.c @@ -800,7 +800,7 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config, bcm3510_register_value v; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL); + state = kzalloc_obj(struct bcm3510_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/cx22700.c b/drivers/media/dvb-frontends/cx22700.c index 1d04c0a652b2..9f36c837fd66 100644 --- a/drivers/media/dvb-frontends/cx22700.c +++ b/drivers/media/dvb-frontends/cx22700.c @@ -376,7 +376,7 @@ struct dvb_frontend* cx22700_attach(const struct cx22700_config* config, struct cx22700_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct cx22700_state), GFP_KERNEL); + state = kzalloc_obj(struct cx22700_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/cx22702.c b/drivers/media/dvb-frontends/cx22702.c index 61ad34b7004b..acdc8712d343 100644 --- a/drivers/media/dvb-frontends/cx22702.c +++ b/drivers/media/dvb-frontends/cx22702.c @@ -582,7 +582,7 @@ struct dvb_frontend *cx22702_attach(const struct cx22702_config *config, struct cx22702_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct cx22702_state), GFP_KERNEL); + state = kzalloc_obj(struct cx22702_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/cx24110.c b/drivers/media/dvb-frontends/cx24110.c index 65dd9b72ea55..a413dd023aa9 100644 --- a/drivers/media/dvb-frontends/cx24110.c +++ b/drivers/media/dvb-frontends/cx24110.c @@ -588,7 +588,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, int ret; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct cx24110_state), GFP_KERNEL); + state = kzalloc_obj(struct cx24110_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/cx24113.c b/drivers/media/dvb-frontends/cx24113.c index 203cb6b3f941..450e9d02e950 100644 --- a/drivers/media/dvb-frontends/cx24113.c +++ b/drivers/media/dvb-frontends/cx24113.c @@ -542,7 +542,7 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe, const struct cx24113_config *config, struct i2c_adapter *i2c) { /* allocate memory for the internal state */ - struct cx24113_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + struct cx24113_state *state = kzalloc_obj(*state, GFP_KERNEL); int rc; if (!state) diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c index f5dd3a81725a..f7c2d7b165ce 100644 --- a/drivers/media/dvb-frontends/cx24116.c +++ b/drivers/media/dvb-frontends/cx24116.c @@ -1116,7 +1116,7 @@ struct dvb_frontend *cx24116_attach(const struct cx24116_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c index 75fc7ad263d0..99555db3c537 100644 --- a/drivers/media/dvb-frontends/cx24117.c +++ b/drivers/media/dvb-frontends/cx24117.c @@ -1184,7 +1184,7 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, } /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct cx24117_state), GFP_KERNEL); + state = kzalloc_obj(struct cx24117_state, GFP_KERNEL); if (state == NULL) goto error2; diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c index 44515fdbe91d..2602fe350d35 100644 --- a/drivers/media/dvb-frontends/cx24120.c +++ b/drivers/media/dvb-frontends/cx24120.c @@ -268,7 +268,7 @@ struct dvb_frontend *cx24120_attach(const struct cx24120_config *config, int demod_rev; info("Conexant cx24120/cx24118 - DVBS/S2 Satellite demod/tuner\n"); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { err("Unable to allocate memory for cx24120_state\n"); goto error; diff --git a/drivers/media/dvb-frontends/cx24123.c b/drivers/media/dvb-frontends/cx24123.c index 539889e638cc..ecc1a017cbe1 100644 --- a/drivers/media/dvb-frontends/cx24123.c +++ b/drivers/media/dvb-frontends/cx24123.c @@ -1043,7 +1043,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config, { /* allocate memory for the internal state */ struct cx24123_state *state = - kzalloc(sizeof(struct cx24123_state), GFP_KERNEL); + kzalloc_obj(struct cx24123_state, GFP_KERNEL); dprintk("\n"); if (state == NULL) { diff --git a/drivers/media/dvb-frontends/cxd2099.c b/drivers/media/dvb-frontends/cxd2099.c index 5e6e18819a0d..80ca00f22d07 100644 --- a/drivers/media/dvb-frontends/cxd2099.c +++ b/drivers/media/dvb-frontends/cxd2099.c @@ -609,7 +609,7 @@ static int cxd2099_probe(struct i2c_client *client) unsigned int val; int ret; - ci = kzalloc(sizeof(*ci), GFP_KERNEL); + ci = kzalloc_obj(*ci, GFP_KERNEL); if (!ci) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c index 5aa3d45a691a..ed3f535db949 100644 --- a/drivers/media/dvb-frontends/cxd2820r_core.c +++ b/drivers/media/dvb-frontends/cxd2820r_core.c @@ -594,7 +594,7 @@ static int cxd2820r_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index 8fcb4417ba22..db58803c85df 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -3844,7 +3844,7 @@ static struct dvb_frontend *cxd2841er_attach(struct cxd2841er_config *cfg, struct cxd2841er_priv *priv = NULL; /* allocate memory for the internal state */ - priv = kzalloc(sizeof(struct cxd2841er_priv), GFP_KERNEL); + priv = kzalloc_obj(struct cxd2841er_priv, GFP_KERNEL); if (!priv) return NULL; priv->i2c = i2c; diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c index a06d8368ca79..1a1ed41f7555 100644 --- a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c @@ -1887,7 +1887,7 @@ struct dvb_frontend *cxd2880_attach(struct dvb_frontend *fe, return NULL; } - priv = kzalloc(sizeof(struct cxd2880_priv), GFP_KERNEL); + priv = kzalloc_obj(struct cxd2880_priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/drivers/media/dvb-frontends/dib0070.c b/drivers/media/dvb-frontends/dib0070.c index 9a8e7cdd2a24..de91a6e497a7 100644 --- a/drivers/media/dvb-frontends/dib0070.c +++ b/drivers/media/dvb-frontends/dib0070.c @@ -738,7 +738,8 @@ static const struct dvb_tuner_ops dib0070_ops = { struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) { - struct dib0070_state *state = kzalloc(sizeof(struct dib0070_state), GFP_KERNEL); + struct dib0070_state *state = kzalloc_obj(struct dib0070_state, + GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c index 6cbbb351d545..f11083a955ec 100644 --- a/drivers/media/dvb-frontends/dib0090.c +++ b/drivers/media/dvb-frontends/dib0090.c @@ -2606,7 +2606,7 @@ static const struct dib0090_wbd_slope dib0090_wbd_table_default[] = { struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config) { - struct dib0090_state *st = kzalloc(sizeof(struct dib0090_state), GFP_KERNEL); + struct dib0090_state *st = kzalloc_obj(struct dib0090_state, GFP_KERNEL); if (st == NULL) return NULL; @@ -2638,7 +2638,8 @@ EXPORT_SYMBOL_GPL(dib0090_register); struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config) { - struct dib0090_fw_state *st = kzalloc(sizeof(struct dib0090_fw_state), GFP_KERNEL); + struct dib0090_fw_state *st = kzalloc_obj(struct dib0090_fw_state, + GFP_KERNEL); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib3000mb.c b/drivers/media/dvb-frontends/dib3000mb.c index 63bc7b74bc8b..ab7046a4ff96 100644 --- a/drivers/media/dvb-frontends/dib3000mb.c +++ b/drivers/media/dvb-frontends/dib3000mb.c @@ -746,7 +746,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, struct dib3000_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL); + state = kzalloc_obj(struct dib3000_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/dib3000mc.c b/drivers/media/dvb-frontends/dib3000mc.c index c2fca8289aba..12ee8a5d3b6e 100644 --- a/drivers/media/dvb-frontends/dib3000mc.c +++ b/drivers/media/dvb-frontends/dib3000mc.c @@ -861,7 +861,7 @@ int dib3000mc_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 defa static const u8 DIB3000MC_I2C_ADDRESS[] = { 20, 22, 24, 26 }; - dmcst = kzalloc(sizeof(struct dib3000mc_state), GFP_KERNEL); + dmcst = kzalloc_obj(struct dib3000mc_state, GFP_KERNEL); if (dmcst == NULL) return -ENOMEM; @@ -910,7 +910,7 @@ struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr { struct dvb_frontend *demod; struct dib3000mc_state *st; - st = kzalloc(sizeof(struct dib3000mc_state), GFP_KERNEL); + st = kzalloc_obj(struct dib3000mc_state, GFP_KERNEL); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib7000m.c b/drivers/media/dvb-frontends/dib7000m.c index fdb22f32e3a1..ffbc313915ed 100644 --- a/drivers/media/dvb-frontends/dib7000m.c +++ b/drivers/media/dvb-frontends/dib7000m.c @@ -1403,7 +1403,7 @@ struct dvb_frontend * dib7000m_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, { struct dvb_frontend *demod; struct dib7000m_state *st; - st = kzalloc(sizeof(struct dib7000m_state), GFP_KERNEL); + st = kzalloc_obj(struct dib7000m_state, GFP_KERNEL); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c index 7d3a994b7cc4..2d0c85fb11a0 100644 --- a/drivers/media/dvb-frontends/dib7000p.c +++ b/drivers/media/dvb-frontends/dib7000p.c @@ -2081,7 +2081,7 @@ static int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u int k = 0; u8 new_addr = 0; - dpst = kzalloc(sizeof(struct dib7000p_state), GFP_KERNEL); + dpst = kzalloc_obj(struct dib7000p_state, GFP_KERNEL); if (!dpst) return -ENOMEM; @@ -2741,7 +2741,7 @@ static struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 i2c_a { struct dvb_frontend *demod; struct dib7000p_state *st; - st = kzalloc(sizeof(struct dib7000p_state), GFP_KERNEL); + st = kzalloc_obj(struct dib7000p_state, GFP_KERNEL); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index d90f1b0b2051..2266178f0a22 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -4307,7 +4307,7 @@ static int dib8000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, ret = -ENOMEM; goto error_memory_read; } - client.i2c_buffer_lock = kzalloc(sizeof(struct mutex), GFP_KERNEL); + client.i2c_buffer_lock = kzalloc_obj(struct mutex, GFP_KERNEL); if (!client.i2c_buffer_lock) { dprintk("%s: not enough memory\n", __func__); ret = -ENOMEM; @@ -4448,10 +4448,10 @@ static struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_ad dprintk("dib8000_init\n"); - state = kzalloc(sizeof(struct dib8000_state), GFP_KERNEL); + state = kzalloc_obj(struct dib8000_state, GFP_KERNEL); if (state == NULL) return NULL; - fe = kzalloc(sizeof(struct dvb_frontend), GFP_KERNEL); + fe = kzalloc_obj(struct dvb_frontend, GFP_KERNEL); if (fe == NULL) goto error; diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c index 83cf6eadd49c..b2e5fe1af78a 100644 --- a/drivers/media/dvb-frontends/dib9000.c +++ b/drivers/media/dvb-frontends/dib9000.c @@ -2474,10 +2474,10 @@ struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, c { struct dvb_frontend *fe; struct dib9000_state *st; - st = kzalloc(sizeof(struct dib9000_state), GFP_KERNEL); + st = kzalloc_obj(struct dib9000_state, GFP_KERNEL); if (st == NULL) return NULL; - fe = kzalloc(sizeof(struct dvb_frontend), GFP_KERNEL); + fe = kzalloc_obj(struct dvb_frontend, GFP_KERNEL); if (fe == NULL) { kfree(st); return NULL; diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 428b31e60874..c7a91f90ed10 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -12276,7 +12276,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) int result; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct drx39xxj_state), GFP_KERNEL); + state = kzalloc_obj(struct drx39xxj_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c index 6a531937f4bb..aefdd620ce2c 100644 --- a/drivers/media/dvb-frontends/drxd_hard.c +++ b/drivers/media/dvb-frontends/drxd_hard.c @@ -2910,7 +2910,7 @@ struct dvb_frontend *drxd_attach(const struct drxd_config *config, { struct drxd_state *state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 9ef367918824..7fb5f46aa1d4 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -6722,7 +6722,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, int status; dprintk(1, "\n"); - state = kzalloc(sizeof(struct drxk_state), GFP_KERNEL); + state = kzalloc_obj(struct drxk_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index 515aa7c7baf2..d300c357f177 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -827,7 +827,7 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 1775a4aa0a18..078596bd0361 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -820,7 +820,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, fe->ops.i2c_gate_ctrl(fe, 0); } - priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); + priv = kzalloc_obj(struct dvb_pll_priv, GFP_KERNEL); if (!priv) goto out; diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c index 9ff1ebaa5e04..9ed03df364d6 100644 --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c @@ -114,7 +114,7 @@ struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); if (!state) return NULL; @@ -135,7 +135,7 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); if (!state) return NULL; @@ -156,7 +156,7 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ec100.c b/drivers/media/dvb-frontends/ec100.c index 2ad0a3c2f756..be9ee1c90434 100644 --- a/drivers/media/dvb-frontends/ec100.c +++ b/drivers/media/dvb-frontends/ec100.c @@ -276,7 +276,7 @@ struct dvb_frontend *ec100_attach(const struct ec100_config *config, u8 tmp; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct ec100_state), GFP_KERNEL); + state = kzalloc_obj(struct ec100_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/gp8psk-fe.c b/drivers/media/dvb-frontends/gp8psk-fe.c index ed671e951a17..8893de2758f6 100644 --- a/drivers/media/dvb-frontends/gp8psk-fe.c +++ b/drivers/media/dvb-frontends/gp8psk-fe.c @@ -332,7 +332,7 @@ struct dvb_frontend *gp8psk_fe_attach(const struct gp8psk_fe_ops *ops, return NULL; } - st = kzalloc(sizeof(struct gp8psk_fe_state), GFP_KERNEL); + st = kzalloc_obj(struct gp8psk_fe_state, GFP_KERNEL); if (!st) return NULL; diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c index f127adee3ebb..0b68fa8b2664 100644 --- a/drivers/media/dvb-frontends/helene.c +++ b/drivers/media/dvb-frontends/helene.c @@ -997,7 +997,7 @@ struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe, { struct helene_priv *priv = NULL; - priv = kzalloc(sizeof(struct helene_priv), GFP_KERNEL); + priv = kzalloc_obj(struct helene_priv, GFP_KERNEL); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); @@ -1033,7 +1033,7 @@ struct dvb_frontend *helene_attach(struct dvb_frontend *fe, { struct helene_priv *priv = NULL; - priv = kzalloc(sizeof(struct helene_priv), GFP_KERNEL); + priv = kzalloc_obj(struct helene_priv, GFP_KERNEL); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c index 0330b78a5b3f..618301eb26aa 100644 --- a/drivers/media/dvb-frontends/horus3a.c +++ b/drivers/media/dvb-frontends/horus3a.c @@ -339,7 +339,7 @@ struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe, u8 buf[3], val; struct horus3a_priv *priv = NULL; - priv = kzalloc(sizeof(struct horus3a_priv), GFP_KERNEL); + priv = kzalloc_obj(struct horus3a_priv, GFP_KERNEL); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/isl6405.c b/drivers/media/dvb-frontends/isl6405.c index 7d28a743f97e..96635db2eabc 100644 --- a/drivers/media/dvb-frontends/isl6405.c +++ b/drivers/media/dvb-frontends/isl6405.c @@ -106,7 +106,7 @@ static void isl6405_release(struct dvb_frontend *fe) struct dvb_frontend *isl6405_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, u8 override_set, u8 override_clear) { - struct isl6405 *isl6405 = kmalloc(sizeof(struct isl6405), GFP_KERNEL); + struct isl6405 *isl6405 = kmalloc_obj(struct isl6405, GFP_KERNEL); if (!isl6405) return NULL; diff --git a/drivers/media/dvb-frontends/isl6421.c b/drivers/media/dvb-frontends/isl6421.c index 2e9f6f12f849..02d9e3b4e91d 100644 --- a/drivers/media/dvb-frontends/isl6421.c +++ b/drivers/media/dvb-frontends/isl6421.c @@ -177,7 +177,7 @@ static void isl6421_release(struct dvb_frontend *fe) struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, u8 override_set, u8 override_clear, bool override_tone) { - struct isl6421 *isl6421 = kmalloc(sizeof(struct isl6421), GFP_KERNEL); + struct isl6421 *isl6421 = kmalloc_obj(struct isl6421, GFP_KERNEL); if (!isl6421) return NULL; diff --git a/drivers/media/dvb-frontends/isl6423.c b/drivers/media/dvb-frontends/isl6423.c index a0d0a3834057..6bffcc381fed 100644 --- a/drivers/media/dvb-frontends/isl6423.c +++ b/drivers/media/dvb-frontends/isl6423.c @@ -258,7 +258,7 @@ struct dvb_frontend *isl6423_attach(struct dvb_frontend *fe, { struct isl6423_dev *isl6423; - isl6423 = kzalloc(sizeof(struct isl6423_dev), GFP_KERNEL); + isl6423 = kzalloc_obj(struct isl6423_dev, GFP_KERNEL); if (!isl6423) return NULL; diff --git a/drivers/media/dvb-frontends/itd1000.c b/drivers/media/dvb-frontends/itd1000.c index f8f362f50e78..6c1863efe227 100644 --- a/drivers/media/dvb-frontends/itd1000.c +++ b/drivers/media/dvb-frontends/itd1000.c @@ -365,7 +365,7 @@ struct dvb_frontend *itd1000_attach(struct dvb_frontend *fe, struct i2c_adapter struct itd1000_state *state = NULL; u8 i = 0; - state = kzalloc(sizeof(struct itd1000_state), GFP_KERNEL); + state = kzalloc_obj(struct itd1000_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ix2505v.c b/drivers/media/dvb-frontends/ix2505v.c index 3212e333d472..db0875f65de8 100644 --- a/drivers/media/dvb-frontends/ix2505v.c +++ b/drivers/media/dvb-frontends/ix2505v.c @@ -267,7 +267,7 @@ struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe, goto error; } - state = kzalloc(sizeof(struct ix2505v_state), GFP_KERNEL); + state = kzalloc_obj(struct ix2505v_state, GFP_KERNEL); if (NULL == state) return NULL; diff --git a/drivers/media/dvb-frontends/l64781.c b/drivers/media/dvb-frontends/l64781.c index fe5af2453d55..cfec598001db 100644 --- a/drivers/media/dvb-frontends/l64781.c +++ b/drivers/media/dvb-frontends/l64781.c @@ -497,7 +497,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct l64781_state), GFP_KERNEL); + state = kzalloc_obj(struct l64781_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/lg2160.c b/drivers/media/dvb-frontends/lg2160.c index fe700aa56bff..5c9ebfec4524 100644 --- a/drivers/media/dvb-frontends/lg2160.c +++ b/drivers/media/dvb-frontends/lg2160.c @@ -1396,7 +1396,7 @@ struct dvb_frontend *lg2160_attach(const struct lg2160_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc(sizeof(struct lg216x_state), GFP_KERNEL); + state = kzalloc_obj(struct lg216x_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/lgdt3305.c b/drivers/media/dvb-frontends/lgdt3305.c index bdc8311e1c0b..9fcac3361618 100644 --- a/drivers/media/dvb-frontends/lgdt3305.c +++ b/drivers/media/dvb-frontends/lgdt3305.c @@ -1103,7 +1103,7 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc(sizeof(struct lgdt3305_state), GFP_KERNEL); + state = kzalloc_obj(struct lgdt3305_state, GFP_KERNEL); if (state == NULL) goto fail; diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c index 6ab9d4de65ce..a6d885d951a5 100644 --- a/drivers/media/dvb-frontends/lgdt3306a.c +++ b/drivers/media/dvb-frontends/lgdt3306a.c @@ -1802,7 +1802,7 @@ struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc(sizeof(struct lgdt3306a_state), GFP_KERNEL); + state = kzalloc_obj(struct lgdt3306a_state, GFP_KERNEL); if (state == NULL) goto fail; diff --git a/drivers/media/dvb-frontends/lgdt330x.c b/drivers/media/dvb-frontends/lgdt330x.c index 8c34a5b850bc..43e45c2317e0 100644 --- a/drivers/media/dvb-frontends/lgdt330x.c +++ b/drivers/media/dvb-frontends/lgdt330x.c @@ -863,7 +863,7 @@ static int lgdt330x_probe(struct i2c_client *client) u8 buf[1]; /* Allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) goto error; diff --git a/drivers/media/dvb-frontends/lgs8gl5.c b/drivers/media/dvb-frontends/lgs8gl5.c index 872abb70d1b6..07e422cb53da 100644 --- a/drivers/media/dvb-frontends/lgs8gl5.c +++ b/drivers/media/dvb-frontends/lgs8gl5.c @@ -375,7 +375,7 @@ lgs8gl5_attach(const struct lgs8gl5_config *config, struct i2c_adapter *i2c) dprintk("%s\n", __func__); /* Allocate memory for the internal state */ - state = kzalloc(sizeof(struct lgs8gl5_state), GFP_KERNEL); + state = kzalloc_obj(struct lgs8gl5_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/lgs8gxx.c b/drivers/media/dvb-frontends/lgs8gxx.c index ffaf60e16ecd..8904f767e4ad 100644 --- a/drivers/media/dvb-frontends/lgs8gxx.c +++ b/drivers/media/dvb-frontends/lgs8gxx.c @@ -1012,7 +1012,7 @@ struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config, if (config == NULL || i2c == NULL) return NULL; - priv = kzalloc(sizeof(struct lgs8gxx_state), GFP_KERNEL); + priv = kzalloc_obj(struct lgs8gxx_state, GFP_KERNEL); if (priv == NULL) goto error_out; diff --git a/drivers/media/dvb-frontends/lnbh25.c b/drivers/media/dvb-frontends/lnbh25.c index 41bec050642b..e4e4c43465cf 100644 --- a/drivers/media/dvb-frontends/lnbh25.c +++ b/drivers/media/dvb-frontends/lnbh25.c @@ -148,7 +148,7 @@ struct dvb_frontend *lnbh25_attach(struct dvb_frontend *fe, struct lnbh25_priv *priv; dev_dbg(&i2c->dev, "%s()\n", __func__); - priv = kzalloc(sizeof(struct lnbh25_priv), GFP_KERNEL); + priv = kzalloc_obj(struct lnbh25_priv, GFP_KERNEL); if (!priv) return NULL; priv->i2c_address = (cfg->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/lnbh29.c b/drivers/media/dvb-frontends/lnbh29.c index 410bae099c32..2bb9f8b9d325 100644 --- a/drivers/media/dvb-frontends/lnbh29.c +++ b/drivers/media/dvb-frontends/lnbh29.c @@ -135,7 +135,7 @@ struct dvb_frontend *lnbh29_attach(struct dvb_frontend *fe, { struct lnbh29_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/drivers/media/dvb-frontends/lnbp21.c b/drivers/media/dvb-frontends/lnbp21.c index 32593b1f75a3..b68fa4424acd 100644 --- a/drivers/media/dvb-frontends/lnbp21.c +++ b/drivers/media/dvb-frontends/lnbp21.c @@ -113,7 +113,7 @@ static struct dvb_frontend *lnbx2x_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear, u8 i2c_addr, u8 config) { - struct lnbp21 *lnbp21 = kmalloc(sizeof(struct lnbp21), GFP_KERNEL); + struct lnbp21 *lnbp21 = kmalloc_obj(struct lnbp21, GFP_KERNEL); if (!lnbp21) return NULL; diff --git a/drivers/media/dvb-frontends/lnbp22.c b/drivers/media/dvb-frontends/lnbp22.c index cb4ea5d3fad4..98e54f74f306 100644 --- a/drivers/media/dvb-frontends/lnbp22.c +++ b/drivers/media/dvb-frontends/lnbp22.c @@ -96,7 +96,7 @@ static void lnbp22_release(struct dvb_frontend *fe) struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c) { - struct lnbp22 *lnbp22 = kmalloc(sizeof(struct lnbp22), GFP_KERNEL); + struct lnbp22 *lnbp22 = kmalloc_obj(struct lnbp22, GFP_KERNEL); if (!lnbp22) return NULL; diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c index 5a03485686d9..e419551ca46e 100644 --- a/drivers/media/dvb-frontends/m88ds3103.c +++ b/drivers/media/dvb-frontends/m88ds3103.c @@ -1775,7 +1775,7 @@ static int m88ds3103_probe(struct i2c_client *client) int ret; unsigned int utmp; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 2aa98203cd65..1804c31ebe0f 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -786,7 +786,7 @@ struct dvb_frontend *m88rs2000_attach(const struct m88rs2000_config *config, struct m88rs2000_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct m88rs2000_state), GFP_KERNEL); + state = kzalloc_obj(struct m88rs2000_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mb86a16.c b/drivers/media/dvb-frontends/mb86a16.c index 9033e39d75f4..0c9bd4a47be4 100644 --- a/drivers/media/dvb-frontends/mb86a16.c +++ b/drivers/media/dvb-frontends/mb86a16.c @@ -1833,7 +1833,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, u8 dev_id = 0; struct mb86a16_state *state = NULL; - state = kmalloc(sizeof(struct mb86a16_state), GFP_KERNEL); + state = kmalloc_obj(struct mb86a16_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index f8e4bbee5bd5..eb596d3b9da5 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -2052,7 +2052,7 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, dev_dbg(&i2c->dev, "%s called.\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/mn88472.c b/drivers/media/dvb-frontends/mn88472.c index 729751671c3d..ce3ae7d8d13f 100644 --- a/drivers/media/dvb-frontends/mn88472.c +++ b/drivers/media/dvb-frontends/mn88472.c @@ -586,7 +586,7 @@ static int mn88472_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c index fefc640d8afb..371f9faa3038 100644 --- a/drivers/media/dvb-frontends/mn88473.c +++ b/drivers/media/dvb-frontends/mn88473.c @@ -626,7 +626,7 @@ static int mn88473_probe(struct i2c_client *client) goto err; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c index fb867dd8a26b..06d7153f57d8 100644 --- a/drivers/media/dvb-frontends/mt312.c +++ b/drivers/media/dvb-frontends/mt312.c @@ -780,7 +780,7 @@ struct dvb_frontend *mt312_attach(const struct mt312_config *config, struct mt312_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct mt312_state), GFP_KERNEL); + state = kzalloc_obj(struct mt312_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mt352.c b/drivers/media/dvb-frontends/mt352.c index 1b2889f5cf67..3f57ac209654 100644 --- a/drivers/media/dvb-frontends/mt352.c +++ b/drivers/media/dvb-frontends/mt352.c @@ -533,7 +533,7 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config, struct mt352_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct mt352_state), GFP_KERNEL); + state = kzalloc_obj(struct mt352_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 930da176e5bf..43d953c898fd 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -1829,7 +1829,7 @@ struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, struct mxl *state; struct mxl_base *base; - state = kzalloc(sizeof(struct mxl), GFP_KERNEL); + state = kzalloc_obj(struct mxl, GFP_KERNEL); if (!state) return NULL; @@ -1845,7 +1845,7 @@ struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, goto fail; state->base = base; } else { - base = kzalloc(sizeof(struct mxl_base), GFP_KERNEL); + base = kzalloc_obj(struct mxl_base, GFP_KERNEL); if (!base) goto fail; base->i2c = i2c; diff --git a/drivers/media/dvb-frontends/mxl692.c b/drivers/media/dvb-frontends/mxl692.c index bbc2bc778225..68455628b03d 100644 --- a/drivers/media/dvb-frontends/mxl692.c +++ b/drivers/media/dvb-frontends/mxl692.c @@ -1314,7 +1314,7 @@ static int mxl692_probe(struct i2c_client *client) struct mxl692_dev *dev; int ret = 0; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; dev_dbg(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c index 1c549ada6ebf..5b0762938c86 100644 --- a/drivers/media/dvb-frontends/nxt200x.c +++ b/drivers/media/dvb-frontends/nxt200x.c @@ -1128,7 +1128,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, u8 buf [] = {0,0,0,0,0}; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct nxt200x_state), GFP_KERNEL); + state = kzalloc_obj(struct nxt200x_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/nxt6000.c b/drivers/media/dvb-frontends/nxt6000.c index e8d4940370dd..ed12ef9cd9df 100644 --- a/drivers/media/dvb-frontends/nxt6000.c +++ b/drivers/media/dvb-frontends/nxt6000.c @@ -560,7 +560,7 @@ struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, struct nxt6000_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct nxt6000_state), GFP_KERNEL); + state = kzalloc_obj(struct nxt6000_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/or51132.c b/drivers/media/dvb-frontends/or51132.c index 74e04c7cca1e..4b0063823736 100644 --- a/drivers/media/dvb-frontends/or51132.c +++ b/drivers/media/dvb-frontends/or51132.c @@ -552,7 +552,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config, struct or51132_state* state = NULL; /* Allocate memory for the internal state */ - state = kzalloc(sizeof(struct or51132_state), GFP_KERNEL); + state = kzalloc_obj(struct or51132_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/or51211.c b/drivers/media/dvb-frontends/or51211.c index 2e8e7071a67a..2a52b1dc9d0a 100644 --- a/drivers/media/dvb-frontends/or51211.c +++ b/drivers/media/dvb-frontends/or51211.c @@ -501,7 +501,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config, struct or51211_state* state = NULL; /* Allocate memory for the internal state */ - state = kzalloc(sizeof(struct or51211_state), GFP_KERNEL); + state = kzalloc_obj(struct or51211_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c index aa4ef9aedf17..ee6ba9b7c016 100644 --- a/drivers/media/dvb-frontends/rtl2830.c +++ b/drivers/media/dvb-frontends/rtl2830.c @@ -807,7 +807,7 @@ static int rtl2830_probe(struct i2c_client *client) } /* allocate memory for the internal state */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 3b4e46dac1bf..19ec892debb7 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c @@ -1043,7 +1043,7 @@ static int rtl2832_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); /* allocate memory for the internal state */ - dev = kzalloc(sizeof(struct rtl2832_dev), GFP_KERNEL); + dev = kzalloc_obj(struct rtl2832_dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 0357624968f1..5a59bdde8f7b 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -1330,7 +1330,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) ret = -EINVAL; goto err; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; goto err_module_put; diff --git a/drivers/media/dvb-frontends/s5h1409.c b/drivers/media/dvb-frontends/s5h1409.c index 28b1dca077ea..33f820e2d6d3 100644 --- a/drivers/media/dvb-frontends/s5h1409.c +++ b/drivers/media/dvb-frontends/s5h1409.c @@ -946,7 +946,7 @@ struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config, u16 reg; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct s5h1409_state), GFP_KERNEL); + state = kzalloc_obj(struct s5h1409_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/s5h1411.c b/drivers/media/dvb-frontends/s5h1411.c index fc48e659c2d8..c6379da7361e 100644 --- a/drivers/media/dvb-frontends/s5h1411.c +++ b/drivers/media/dvb-frontends/s5h1411.c @@ -861,7 +861,7 @@ struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config, u16 reg; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct s5h1411_state), GFP_KERNEL); + state = kzalloc_obj(struct s5h1411_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/s5h1420.c b/drivers/media/dvb-frontends/s5h1420.c index d700de1ea6c2..623900e732c1 100644 --- a/drivers/media/dvb-frontends/s5h1420.c +++ b/drivers/media/dvb-frontends/s5h1420.c @@ -872,7 +872,8 @@ struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config, struct i2c_adapter *i2c) { /* allocate memory for the internal state */ - struct s5h1420_state *state = kzalloc(sizeof(struct s5h1420_state), GFP_KERNEL); + struct s5h1420_state *state = kzalloc_obj(struct s5h1420_state, + GFP_KERNEL); u8 i; if (state == NULL) diff --git a/drivers/media/dvb-frontends/s5h1432.c b/drivers/media/dvb-frontends/s5h1432.c index ff5d3bdf3bc6..6261df9f383c 100644 --- a/drivers/media/dvb-frontends/s5h1432.c +++ b/drivers/media/dvb-frontends/s5h1432.c @@ -337,7 +337,7 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config, printk(KERN_INFO " Enter s5h1432_attach(). attach success!\n"); /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct s5h1432_state), GFP_KERNEL); + state = kmalloc_obj(struct s5h1432_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/s921.c b/drivers/media/dvb-frontends/s921.c index 7e461ac159fc..6d38c9742f1d 100644 --- a/drivers/media/dvb-frontends/s921.c +++ b/drivers/media/dvb-frontends/s921.c @@ -476,7 +476,7 @@ struct dvb_frontend *s921_attach(const struct s921_config *config, { /* allocate memory for the internal state */ struct s921_state *state = - kzalloc(sizeof(struct s921_state), GFP_KERNEL); + kzalloc_obj(struct s921_state, GFP_KERNEL); dprintk("\n"); if (!state) { diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c index f87c9357cee3..cb6802b81e41 100644 --- a/drivers/media/dvb-frontends/si2165.c +++ b/drivers/media/dvb-frontends/si2165.c @@ -1158,7 +1158,7 @@ static int si2165_probe(struct i2c_client *client) }; /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { ret = -ENOMEM; goto error; diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index d6b6b8bc7d4e..f7a1d2fc3cfb 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -681,7 +681,7 @@ static int si2168_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c index 210ccd356e2b..ac50df3c40fb 100644 --- a/drivers/media/dvb-frontends/si21xx.c +++ b/drivers/media/dvb-frontends/si21xx.c @@ -902,7 +902,7 @@ struct dvb_frontend *si21xx_attach(const struct si21xx_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct si21xx_state), GFP_KERNEL); + state = kzalloc_obj(struct si21xx_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 75adf2a4589f..50103c4a36f9 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -371,7 +371,7 @@ static int sp2_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/sp887x.c b/drivers/media/dvb-frontends/sp887x.c index f59c0f96416b..235ecfd45376 100644 --- a/drivers/media/dvb-frontends/sp887x.c +++ b/drivers/media/dvb-frontends/sp887x.c @@ -568,7 +568,7 @@ struct dvb_frontend* sp887x_attach(const struct sp887x_config* config, struct sp887x_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct sp887x_state), GFP_KERNEL); + state = kzalloc_obj(struct sp887x_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c index 35634f9a8ab5..19a31a296e0f 100644 --- a/drivers/media/dvb-frontends/stb0899_drv.c +++ b/drivers/media/dvb-frontends/stb0899_drv.c @@ -1613,7 +1613,7 @@ struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_ad { struct stb0899_state *state = NULL; - state = kzalloc(sizeof (struct stb0899_state), GFP_KERNEL); + state = kzalloc_obj(struct stb0899_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stb6000.c b/drivers/media/dvb-frontends/stb6000.c index d74e34677b92..85900e616490 100644 --- a/drivers/media/dvb-frontends/stb6000.c +++ b/drivers/media/dvb-frontends/stb6000.c @@ -218,7 +218,7 @@ struct dvb_frontend *stb6000_attach(struct dvb_frontend *fe, int addr, if (ret != 2) return NULL; - priv = kzalloc(sizeof(struct stb6000_priv), GFP_KERNEL); + priv = kzalloc_obj(struct stb6000_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c index c5818a15a0d7..97238cf98067 100644 --- a/drivers/media/dvb-frontends/stb6100.c +++ b/drivers/media/dvb-frontends/stb6100.c @@ -534,7 +534,7 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, { struct stb6100_state *state = NULL; - state = kzalloc(sizeof (struct stb6100_state), GFP_KERNEL); + state = kzalloc_obj(struct stb6100_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/stv0288.c b/drivers/media/dvb-frontends/stv0288.c index a5581bd60f9e..40648b74edd4 100644 --- a/drivers/media/dvb-frontends/stv0288.c +++ b/drivers/media/dvb-frontends/stv0288.c @@ -557,7 +557,7 @@ struct dvb_frontend *stv0288_attach(const struct stv0288_config *config, int id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0288_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0288_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0297.c b/drivers/media/dvb-frontends/stv0297.c index 9d4dbd99a5a7..c0634e2436b3 100644 --- a/drivers/media/dvb-frontends/stv0297.c +++ b/drivers/media/dvb-frontends/stv0297.c @@ -654,7 +654,7 @@ struct dvb_frontend *stv0297_attach(const struct stv0297_config *config, struct stv0297_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0297_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0297_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/media/dvb-frontends/stv0299.c index ba4bb3685095..cc15bb93b7dc 100644 --- a/drivers/media/dvb-frontends/stv0299.c +++ b/drivers/media/dvb-frontends/stv0299.c @@ -671,7 +671,7 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0299_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0299_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index 72540ef4e5f8..cf6b1b646b10 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -1698,10 +1698,10 @@ struct dvb_frontend *stv0367ter_attach(const struct stv0367_config *config, struct stv0367ter_state *ter_state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0367_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); if (state == NULL) goto error; - ter_state = kzalloc(sizeof(struct stv0367ter_state), GFP_KERNEL); + ter_state = kzalloc_obj(struct stv0367ter_state, GFP_KERNEL); if (ter_state == NULL) goto error; @@ -2865,10 +2865,10 @@ struct dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, struct stv0367cab_state *cab_state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0367_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); if (state == NULL) goto error; - cab_state = kzalloc(sizeof(struct stv0367cab_state), GFP_KERNEL); + cab_state = kzalloc_obj(struct stv0367cab_state, GFP_KERNEL); if (cab_state == NULL) goto error; @@ -3274,13 +3274,13 @@ struct dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config, struct stv0367cab_state *cab_state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct stv0367_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); if (state == NULL) goto error; - ter_state = kzalloc(sizeof(struct stv0367ter_state), GFP_KERNEL); + ter_state = kzalloc_obj(struct stv0367ter_state, GFP_KERNEL); if (ter_state == NULL) goto error; - cab_state = kzalloc(sizeof(struct stv0367cab_state), GFP_KERNEL); + cab_state = kzalloc_obj(struct stv0367cab_state, GFP_KERNEL); if (cab_state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c index e7b9b9b11d7d..3f1edc8559c5 100644 --- a/drivers/media/dvb-frontends/stv0900_core.c +++ b/drivers/media/dvb-frontends/stv0900_core.c @@ -85,14 +85,14 @@ static struct stv0900_inode *append_internal(struct stv0900_internal *internal) struct stv0900_inode *new_node = stv0900_first_inode; if (new_node == NULL) { - new_node = kmalloc(sizeof(struct stv0900_inode), GFP_KERNEL); + new_node = kmalloc_obj(struct stv0900_inode, GFP_KERNEL); stv0900_first_inode = new_node; } else { while (new_node->next_inode != NULL) new_node = new_node->next_inode; - new_node->next_inode = kmalloc(sizeof(struct stv0900_inode), - GFP_KERNEL); + new_node->next_inode = kmalloc_obj(struct stv0900_inode, + GFP_KERNEL); if (new_node->next_inode != NULL) new_node = new_node->next_inode; else @@ -1348,8 +1348,8 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe, dprintk("%s: Find Internal Structure!\n", __func__); return STV0900_NO_ERROR; } else { - state->internal = kmalloc(sizeof(struct stv0900_internal), - GFP_KERNEL); + state->internal = kmalloc_obj(struct stv0900_internal, + GFP_KERNEL); if (state->internal == NULL) return STV0900_INVALID_HANDLE; temp_int = append_internal(state->internal); @@ -1903,7 +1903,7 @@ struct dvb_frontend *stv0900_attach(const struct stv0900_config *config, struct stv0900_init_params init_params; enum fe_stv0900_error err_stv0900; - state = kzalloc(sizeof(struct stv0900_state), GFP_KERNEL); + state = kzalloc_obj(struct stv0900_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c index f273efa330cf..16ff5c8cf417 100644 --- a/drivers/media/dvb-frontends/stv090x.c +++ b/drivers/media/dvb-frontends/stv090x.c @@ -85,7 +85,7 @@ static struct stv090x_dev *append_internal(struct stv090x_internal *internal) struct stv090x_dev *new_dev; struct stv090x_dev *temp_dev; - new_dev = kmalloc(sizeof(struct stv090x_dev), GFP_KERNEL); + new_dev = kmalloc_obj(struct stv090x_dev, GFP_KERNEL); if (new_dev != NULL) { new_dev->internal = internal; new_dev->next_dev = NULL; @@ -4906,7 +4906,7 @@ static int stv090x_setup_compound(struct stv090x_state *state) state->internal->num_used++; dprintk(FE_INFO, 1, "Found Internal Structure!"); } else { - state->internal = kmalloc(sizeof(*state->internal), GFP_KERNEL); + state->internal = kmalloc_obj(*state->internal, GFP_KERNEL); if (!state->internal) goto error; temp_int = append_internal(state->internal); @@ -5002,7 +5002,7 @@ static int stv090x_probe(struct i2c_client *client) struct stv090x_state *state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { ret = -ENOMEM; goto error; @@ -5050,7 +5050,7 @@ struct dvb_frontend *stv090x_attach(struct stv090x_config *config, int ret = 0; struct stv090x_state *state = NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) goto error; diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 069dec75129c..666562f7ca17 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -1766,7 +1766,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, struct stv *state; struct stv_base *base; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; @@ -1788,7 +1788,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, base->count++; state->base = base; } else { - base = kzalloc(sizeof(*base), GFP_KERNEL); + base = kzalloc_obj(*base, GFP_KERNEL); if (!base) goto fail; base->i2c = i2c; diff --git a/drivers/media/dvb-frontends/stv6110.c b/drivers/media/dvb-frontends/stv6110.c index 1cf9c095dbff..beb1c832a13d 100644 --- a/drivers/media/dvb-frontends/stv6110.c +++ b/drivers/media/dvb-frontends/stv6110.c @@ -408,7 +408,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, if (ret != 1) return NULL; - priv = kzalloc(sizeof(struct stv6110_priv), GFP_KERNEL); + priv = kzalloc_obj(struct stv6110_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/stv6110x.c b/drivers/media/dvb-frontends/stv6110x.c index 33c8105da1c3..4122f7655b0a 100644 --- a/drivers/media/dvb-frontends/stv6110x.c +++ b/drivers/media/dvb-frontends/stv6110x.c @@ -412,7 +412,7 @@ static int stv6110x_probe(struct i2c_client *client) struct stv6110x_state *stv6110x; - stv6110x = kzalloc(sizeof(*stv6110x), GFP_KERNEL); + stv6110x = kzalloc_obj(*stv6110x, GFP_KERNEL); if (!stv6110x) return -ENOMEM; @@ -448,7 +448,7 @@ const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, { struct stv6110x_state *stv6110x; - stv6110x = kzalloc(sizeof(*stv6110x), GFP_KERNEL); + stv6110x = kzalloc_obj(*stv6110x, GFP_KERNEL); if (!stv6110x) return NULL; diff --git a/drivers/media/dvb-frontends/stv6111.c b/drivers/media/dvb-frontends/stv6111.c index 0ac15273922d..d367ee7f3cbe 100644 --- a/drivers/media/dvb-frontends/stv6111.c +++ b/drivers/media/dvb-frontends/stv6111.c @@ -653,7 +653,7 @@ struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, int stat = -ENODEV; int gatestat = 0; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; state->adr = adr; diff --git a/drivers/media/dvb-frontends/tc90522.c b/drivers/media/dvb-frontends/tc90522.c index 1f8cbf45554a..3ac0b7a0844f 100644 --- a/drivers/media/dvb-frontends/tc90522.c +++ b/drivers/media/dvb-frontends/tc90522.c @@ -647,7 +647,7 @@ tc90522_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) for (i = 0; i < num; i++) if (msgs[i].flags & I2C_M_RD) rd_num++; - new_msgs = kmalloc_array(num + rd_num, sizeof(*new_msgs), GFP_KERNEL); + new_msgs = kmalloc_objs(*new_msgs, num + rd_num, GFP_KERNEL); if (!new_msgs) return -ENOMEM; @@ -788,7 +788,7 @@ static int tc90522_probe(struct i2c_client *client) struct i2c_adapter *adap; int ret; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; state->i2c_client = client; diff --git a/drivers/media/dvb-frontends/tda10021.c b/drivers/media/dvb-frontends/tda10021.c index 462e12ab6bd1..9a950ee9562e 100644 --- a/drivers/media/dvb-frontends/tda10021.c +++ b/drivers/media/dvb-frontends/tda10021.c @@ -451,7 +451,7 @@ struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config, u8 id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda10021_state), GFP_KERNEL); + state = kzalloc_obj(struct tda10021_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda10023.c b/drivers/media/dvb-frontends/tda10023.c index 4c2541ecd743..c8b1cc0f7abb 100644 --- a/drivers/media/dvb-frontends/tda10023.c +++ b/drivers/media/dvb-frontends/tda10023.c @@ -511,7 +511,7 @@ struct dvb_frontend *tda10023_attach(const struct tda10023_config *config, struct tda10023_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda10023_state), GFP_KERNEL); + state = kzalloc_obj(struct tda10023_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda10048.c b/drivers/media/dvb-frontends/tda10048.c index 1f87eb0dcf2a..fe9685cbf7a5 100644 --- a/drivers/media/dvb-frontends/tda10048.c +++ b/drivers/media/dvb-frontends/tda10048.c @@ -1097,7 +1097,7 @@ struct dvb_frontend *tda10048_attach(const struct tda10048_config *config, dprintk(1, "%s()\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda10048_state), GFP_KERNEL); + state = kzalloc_obj(struct tda10048_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/tda1004x.c b/drivers/media/dvb-frontends/tda1004x.c index 6f306db6c615..0a1bf80211d3 100644 --- a/drivers/media/dvb-frontends/tda1004x.c +++ b/drivers/media/dvb-frontends/tda1004x.c @@ -1271,7 +1271,7 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda1004x_state), GFP_KERNEL); + state = kzalloc_obj(struct tda1004x_state, GFP_KERNEL); if (!state) { printk(KERN_ERR "Can't allocate memory for tda10045 state\n"); return NULL; @@ -1341,7 +1341,7 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda1004x_state), GFP_KERNEL); + state = kzalloc_obj(struct tda1004x_state, GFP_KERNEL); if (!state) { printk(KERN_ERR "Can't allocate memory for tda10046 state\n"); return NULL; diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index e23794b821cd..430702da6e79 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c @@ -1156,7 +1156,7 @@ static int tda10071_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/tda10086.c b/drivers/media/dvb-frontends/tda10086.c index b449514ae585..5e63ded2cfbf 100644 --- a/drivers/media/dvb-frontends/tda10086.c +++ b/drivers/media/dvb-frontends/tda10086.c @@ -737,7 +737,7 @@ struct dvb_frontend* tda10086_attach(const struct tda10086_config* config, dprintk ("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda10086_state), GFP_KERNEL); + state = kzalloc_obj(struct tda10086_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index c11563853c07..f10d74ff192c 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -1215,7 +1215,7 @@ struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe, { struct tda_state *state; - state = kzalloc(sizeof(struct tda_state), GFP_KERNEL); + state = kzalloc_obj(struct tda_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda665x.c b/drivers/media/dvb-frontends/tda665x.c index 346be5011fb7..f9dcbb69e949 100644 --- a/drivers/media/dvb-frontends/tda665x.c +++ b/drivers/media/dvb-frontends/tda665x.c @@ -207,7 +207,7 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, struct tda665x_state *state = NULL; struct dvb_tuner_info *info; - state = kzalloc(sizeof(struct tda665x_state), GFP_KERNEL); + state = kzalloc_obj(struct tda665x_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dvb-frontends/tda8083.c index 44f53624557b..c9f280cdd7db 100644 --- a/drivers/media/dvb-frontends/tda8083.c +++ b/drivers/media/dvb-frontends/tda8083.c @@ -417,7 +417,7 @@ struct dvb_frontend* tda8083_attach(const struct tda8083_config* config, struct tda8083_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct tda8083_state), GFP_KERNEL); + state = kzalloc_obj(struct tda8083_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index 8b06f92745dc..73c90442f403 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -168,7 +168,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, { struct tda8261_state *state = NULL; - if ((state = kzalloc(sizeof (struct tda8261_state), GFP_KERNEL)) == NULL) + if ((state = kzalloc_obj(struct tda8261_state, GFP_KERNEL)) == NULL) goto exit; state->config = config; diff --git a/drivers/media/dvb-frontends/tda826x.c b/drivers/media/dvb-frontends/tda826x.c index eafcf5f7da3d..b51da4053ef5 100644 --- a/drivers/media/dvb-frontends/tda826x.c +++ b/drivers/media/dvb-frontends/tda826x.c @@ -150,7 +150,7 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2 if (!(b1[1] & 0x80)) return NULL; - priv = kzalloc(sizeof(struct tda826x_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tda826x_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c index e25add6cc38e..2368214781a6 100644 --- a/drivers/media/dvb-frontends/ts2020.c +++ b/drivers/media/dvb-frontends/ts2020.c @@ -566,7 +566,7 @@ static int ts2020_probe(struct i2c_client *client) } fe = pdata->fe; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/tua6100.c b/drivers/media/dvb-frontends/tua6100.c index 41dd9b6d3190..2d052bfb8a23 100644 --- a/drivers/media/dvb-frontends/tua6100.c +++ b/drivers/media/dvb-frontends/tua6100.c @@ -175,7 +175,7 @@ struct dvb_frontend *tua6100_attach(struct dvb_frontend *fe, int addr, struct i2 if (ret != 2) return NULL; - priv = kzalloc(sizeof(struct tua6100_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tua6100_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ves1820.c b/drivers/media/dvb-frontends/ves1820.c index ee5620e731e9..56bbd52d1783 100644 --- a/drivers/media/dvb-frontends/ves1820.c +++ b/drivers/media/dvb-frontends/ves1820.c @@ -366,7 +366,7 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, struct ves1820_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct ves1820_state), GFP_KERNEL); + state = kzalloc_obj(struct ves1820_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/ves1x93.c b/drivers/media/dvb-frontends/ves1x93.c index c60e21d26b88..5c8abcebbd88 100644 --- a/drivers/media/dvb-frontends/ves1x93.c +++ b/drivers/media/dvb-frontends/ves1x93.c @@ -450,7 +450,7 @@ struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, u8 identity; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct ves1x93_state), GFP_KERNEL); + state = kzalloc_obj(struct ves1x93_state, GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/zd1301_demod.c b/drivers/media/dvb-frontends/zd1301_demod.c index e8b9e67a8717..0c244fd17623 100644 --- a/drivers/media/dvb-frontends/zd1301_demod.c +++ b/drivers/media/dvb-frontends/zd1301_demod.c @@ -470,7 +470,7 @@ static int zd1301_demod_probe(struct platform_device *pdev) goto err; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/zl10036.c b/drivers/media/dvb-frontends/zl10036.c index 5ad987c6861b..3d05828e499a 100644 --- a/drivers/media/dvb-frontends/zl10036.c +++ b/drivers/media/dvb-frontends/zl10036.c @@ -457,7 +457,7 @@ struct dvb_frontend *zl10036_attach(struct dvb_frontend *fe, return NULL; } - state = kzalloc(sizeof(struct zl10036_state), GFP_KERNEL); + state = kzalloc_obj(struct zl10036_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/zl10039.c b/drivers/media/dvb-frontends/zl10039.c index a3e4d219400c..54e1e4267c1d 100644 --- a/drivers/media/dvb-frontends/zl10039.c +++ b/drivers/media/dvb-frontends/zl10039.c @@ -254,7 +254,7 @@ struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, struct zl10039_state *state = NULL; dprintk("%s\n", __func__); - state = kmalloc(sizeof(struct zl10039_state), GFP_KERNEL); + state = kmalloc_obj(struct zl10039_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/zl10353.c b/drivers/media/dvb-frontends/zl10353.c index 8849d05475c2..a9f23b142301 100644 --- a/drivers/media/dvb-frontends/zl10353.c +++ b/drivers/media/dvb-frontends/zl10353.c @@ -598,7 +598,7 @@ struct dvb_frontend *zl10353_attach(const struct zl10353_config *config, int id; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct zl10353_state), GFP_KERNEL); + state = kzalloc_obj(struct zl10353_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/firewire/firedtv-fw.c b/drivers/media/firewire/firedtv-fw.c index 5f6e97a8d1c0..5ee96f290fef 100644 --- a/drivers/media/firewire/firedtv-fw.c +++ b/drivers/media/firewire/firedtv-fw.c @@ -135,7 +135,7 @@ int fdtv_start_iso(struct firedtv *fdtv) struct fw_device *device = device_of(fdtv); int i, err; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -255,7 +255,7 @@ static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) char name[MAX_MODEL_NAME_LEN]; int name_len, i, err; - fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL); + fdtv = kzalloc_obj(*fdtv, GFP_KERNEL); if (!fdtv) return -ENOMEM; diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index 1f088acecf36..c063da7d568d 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1094,7 +1094,7 @@ static int alvium_setup_mipi_fmt(struct alvium_dev *alvium) /* init alvium_csi2_fmt array */ alvium->alvium_csi2_fmt_n = sz; alvium->alvium_csi2_fmt = - kmalloc_array(sz, sizeof(struct alvium_pixfmt), GFP_KERNEL); + kmalloc_objs(struct alvium_pixfmt, sz, GFP_KERNEL); if (!alvium->alvium_csi2_fmt) return -ENOMEM; diff --git a/drivers/media/i2c/cs3308.c b/drivers/media/i2c/cs3308.c index 078e0066ce4b..cc4bd7fd7cdb 100644 --- a/drivers/media/i2c/cs3308.c +++ b/drivers/media/i2c/cs3308.c @@ -79,7 +79,7 @@ static int cs3308_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); + sd = kzalloc_obj(struct v4l2_subdev, GFP_KERNEL); if (sd == NULL) return -ENOMEM; diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index 3156f6d6c6de..98f45dcad667 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -1379,7 +1379,7 @@ static int ub960_parse_dt_txport(struct ub960_data *priv, struct ub960_txport *txport; int ret; - txport = kzalloc(sizeof(*txport), GFP_KERNEL); + txport = kzalloc_obj(*txport, GFP_KERNEL); if (!txport) return -ENOMEM; @@ -4573,7 +4573,7 @@ static int ub960_parse_dt_rxport(struct ub960_data *priv, unsigned int nport, struct ub960_rxport *rxport; int ret; - rxport = kzalloc(sizeof(*rxport), GFP_KERNEL); + rxport = kzalloc_obj(*rxport, GFP_KERNEL); if (!rxport) return -ENOMEM; diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3532766cd795..bf4f7b44d42e 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2538,7 +2538,7 @@ static int tda1997x_probe(struct i2c_client *client) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; - state = kzalloc(sizeof(struct tda1997x_state), GFP_KERNEL); + state = kzalloc_obj(struct tda1997x_state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 1eee2d4f5b40..eebca7a0fb9b 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -750,7 +750,7 @@ static int video_i2c_probe(struct i2c_client *client) struct vb2_queue *queue; int ret = -ENODEV; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/media/mc/mc-dev-allocator.c b/drivers/media/mc/mc-dev-allocator.c index ae17887dec59..b8a170aaee04 100644 --- a/drivers/media/mc/mc-dev-allocator.c +++ b/drivers/media/mc/mc-dev-allocator.c @@ -81,7 +81,7 @@ static struct media_device *__media_device_get(struct device *dev, return &mdi->mdev; } - mdi = kzalloc(sizeof(*mdi), GFP_KERNEL); + mdi = kzalloc_obj(*mdi, GFP_KERNEL); if (!mdi) return NULL; diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index 5a4465b290f0..a27afa530592 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -737,7 +737,7 @@ int __must_check __media_device_register(struct media_device *mdev, struct media_devnode *devnode; int ret; - devnode = kzalloc(sizeof(*devnode), GFP_KERNEL); + devnode = kzalloc_obj(*devnode, GFP_KERNEL); if (!devnode) return -ENOMEM; diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 9519a537bfa2..a078488874b2 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -587,7 +587,7 @@ static int media_pipeline_add_pad(struct media_pipeline *pipe, } } - ppad = kzalloc(sizeof(*ppad), GFP_KERNEL); + ppad = kzalloc_obj(*ppad, GFP_KERNEL); if (!ppad) return -ENOMEM; @@ -977,7 +977,7 @@ __must_check int media_pipeline_alloc_start(struct media_pad *pad) */ pipe = media_pad_pipeline(pad); if (!pipe) { - new_pipe = kzalloc(sizeof(*new_pipe), GFP_KERNEL); + new_pipe = kzalloc_obj(*new_pipe, GFP_KERNEL); if (!new_pipe) { ret = -ENOMEM; goto out; @@ -1061,7 +1061,7 @@ static struct media_link *media_add_link(struct list_head *head) { struct media_link *link; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (link == NULL) return NULL; @@ -1547,7 +1547,7 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev, { struct media_intf_devnode *devnode; - devnode = kzalloc(sizeof(*devnode), GFP_KERNEL); + devnode = kzalloc_obj(*devnode, GFP_KERNEL); if (!devnode) return NULL; diff --git a/drivers/media/mc/mc-request.c b/drivers/media/mc/mc-request.c index 8ad10c72f9db..6668f44359ce 100644 --- a/drivers/media/mc/mc-request.c +++ b/drivers/media/mc/mc-request.c @@ -293,7 +293,7 @@ int media_request_alloc(struct media_device *mdev, int *alloc_fd) if (mdev->ops->req_alloc) req = mdev->ops->req_alloc(mdev); else - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/media/mmc/siano/smssdio.c b/drivers/media/mmc/siano/smssdio.c index 8199077faf36..8dc11576f4e8 100644 --- a/drivers/media/mmc/siano/smssdio.c +++ b/drivers/media/mmc/siano/smssdio.c @@ -244,7 +244,7 @@ static int smssdio_probe(struct sdio_func *func, board_id = id->driver_data; - smsdev = kzalloc(sizeof(struct smssdio_device), GFP_KERNEL); + smsdev = kzalloc_obj(struct smssdio_device, GFP_KERNEL); if (!smsdev) return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 17e4529e537a..26cc0f6b7571 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -3216,7 +3216,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) if (bttv_num == BTTV_MAX) return -ENOMEM; pr_info("Bt8xx card found (%d)\n", bttv_num); - bttvs[bttv_num] = btv = kzalloc(sizeof(*btv), GFP_KERNEL); + bttvs[bttv_num] = btv = kzalloc_obj(*btv, GFP_KERNEL); if (btv == NULL) { pr_err("out of memory\n"); return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c index 59a6f160aac7..5b4c6336d2d5 100644 --- a/drivers/media/pci/bt8xx/bttv-gpio.c +++ b/drivers/media/pci/bt8xx/bttv-gpio.c @@ -73,7 +73,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) struct bttv_sub_device *sub; int err; - sub = kzalloc(sizeof(*sub),GFP_KERNEL); + sub = kzalloc_obj(*sub, GFP_KERNEL); if (NULL == sub) return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c index 84aa269248fd..45e30ebdc5f8 100644 --- a/drivers/media/pci/bt8xx/bttv-input.c +++ b/drivers/media/pci/bt8xx/bttv-input.c @@ -416,7 +416,7 @@ int bttv_input_init(struct bttv *btv) if (!btv->has_remote) return -ENODEV; - ir = kzalloc(sizeof(*ir),GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); rc = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ir || !rc) goto err_out_free; diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index a9cc6e7a57f9..f26ece10d926 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -454,7 +454,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer; int result = 0; - hw_buffer = kmalloc(sizeof(*hw_buffer), GFP_KERNEL); + hw_buffer = kmalloc_obj(*hw_buffer, GFP_KERNEL); if (!hw_buffer) return -ENOMEM; dprintk(verbose, DST_CA_DEBUG, 1, " "); @@ -535,9 +535,9 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct mutex_lock(&dst_ca_mutex); dvbdev = file->private_data; state = dvbdev->priv; - p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); - p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); - p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); + p_ca_message = kmalloc_obj(struct ca_msg, GFP_KERNEL); + p_ca_slot_info = kmalloc_obj(struct ca_slot_info, GFP_KERNEL); + p_ca_caps = kmalloc_obj(struct ca_caps, GFP_KERNEL); if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { result = -ENOMEM; goto free_mem_and_exit; diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c index f0fbb468aea2..b9c712c078d2 100644 --- a/drivers/media/pci/bt8xx/dvb-bt8xx.c +++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c @@ -657,7 +657,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case BTTV_BOARD_TWINHAN_DST: /* DST is not a frontend driver !!! */ - state = kmalloc(sizeof (struct dst_state), GFP_KERNEL); + state = kmalloc_obj(struct dst_state, GFP_KERNEL); if (!state) { pr_err("No memory\n"); break; @@ -809,7 +809,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub) struct pci_dev* bttv_pci_dev; int ret; - if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) + if (!(card = kzalloc_obj(struct dvb_bt8xx_card, GFP_KERNEL))) return -ENOMEM; mutex_init(&card->lock); diff --git a/drivers/media/pci/cobalt/cobalt-alsa-main.c b/drivers/media/pci/cobalt/cobalt-alsa-main.c index c57f87a68269..1b30b44ad112 100644 --- a/drivers/media/pci/cobalt/cobalt-alsa-main.c +++ b/drivers/media/pci/cobalt/cobalt-alsa-main.c @@ -45,7 +45,7 @@ static int snd_cobalt_card_create(struct cobalt_stream *s, struct snd_card *sc, struct snd_cobalt_card **cobsc) { - *cobsc = kzalloc(sizeof(struct snd_cobalt_card), GFP_KERNEL); + *cobsc = kzalloc_obj(struct snd_cobalt_card, GFP_KERNEL); if (*cobsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index b7695705fdee..1c2b00278c55 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -663,7 +663,7 @@ static int cobalt_probe(struct pci_dev *pci_dev, /* FIXME - module parameter arrays constrain max instances */ i = atomic_inc_return(&cobalt_instance) - 1; - cobalt = kzalloc(sizeof(struct cobalt), GFP_KERNEL); + cobalt = kzalloc_obj(struct cobalt, GFP_KERNEL); if (cobalt == NULL) return -ENOMEM; cobalt->pci_dev = pci_dev; diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c index 9dc361886284..6214e29a5cd6 100644 --- a/drivers/media/pci/cx18/cx18-alsa-main.c +++ b/drivers/media/pci/cx18/cx18-alsa-main.c @@ -77,7 +77,7 @@ static int snd_cx18_card_create(struct v4l2_device *v4l2_dev, struct snd_card *sc, struct snd_cx18_card **cxsc) { - *cxsc = kzalloc(sizeof(struct snd_cx18_card), GFP_KERNEL); + *cxsc = kzalloc_obj(struct snd_cx18_card, GFP_KERNEL); if (*cxsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 74c59a94b2b0..bdfdd403a039 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -314,7 +314,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) memset(tv, 0, sizeof(*tv)); - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) return; @@ -899,7 +899,7 @@ static int cx18_probe(struct pci_dev *pci_dev, return -ENOMEM; } - cx = kzalloc(sizeof(*cx), GFP_KERNEL); + cx = kzalloc_obj(*cx, GFP_KERNEL); if (!cx) return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-fileops.c b/drivers/media/pci/cx18/cx18-fileops.c index 4944033dbb20..b3d3a6f67ea8 100644 --- a/drivers/media/pci/cx18/cx18-fileops.c +++ b/drivers/media/pci/cx18/cx18-fileops.c @@ -732,7 +732,7 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp) CX18_DEBUG_FILE("open %s\n", s->name); /* Allocate memory */ - item = kzalloc(sizeof(struct cx18_open_id), GFP_KERNEL); + item = kzalloc_obj(struct cx18_open_id, GFP_KERNEL); if (NULL == item) { CX18_DEBUG_WARN("nomem on v4l2 open\n"); return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-queue.c b/drivers/media/pci/cx18/cx18-queue.c index eeb5513b1d52..04d6828f0259 100644 --- a/drivers/media/pci/cx18/cx18-queue.c +++ b/drivers/media/pci/cx18/cx18-queue.c @@ -361,12 +361,11 @@ int cx18_stream_alloc(struct cx18_stream *s) struct cx18_buffer *buf; /* 1 MDL per buffer to handle the worst & also default case */ - mdl = kzalloc(sizeof(struct cx18_mdl), GFP_KERNEL|__GFP_NOWARN); + mdl = kzalloc_obj(struct cx18_mdl, GFP_KERNEL | __GFP_NOWARN); if (mdl == NULL) break; - buf = kzalloc(sizeof(struct cx18_buffer), - GFP_KERNEL|__GFP_NOWARN); + buf = kzalloc_obj(struct cx18_buffer, GFP_KERNEL | __GFP_NOWARN); if (buf == NULL) { kfree(mdl); break; diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c index 48203ba16387..b5b969fa9530 100644 --- a/drivers/media/pci/cx18/cx18-streams.c +++ b/drivers/media/pci/cx18/cx18-streams.c @@ -343,7 +343,7 @@ static int cx18_prep_dev(struct cx18 *cx, int type) /* Allocate the cx18_dvb struct only for the TS on cards with DTV */ if (type == CX18_ENC_STREAM_TYPE_TS) { if (cx->card->hw_all & CX18_HW_DVB) { - s->dvb = kzalloc(sizeof(struct cx18_dvb), GFP_KERNEL); + s->dvb = kzalloc_obj(struct cx18_dvb, GFP_KERNEL); if (s->dvb == NULL) { CX18_ERR("Couldn't allocate cx18_dvb structure for %s\n", s->name); diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 0dc348215b72..7eae29e002ea 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -224,14 +224,14 @@ static struct fpga_inode *append_internal(struct fpga_internal *internal) struct fpga_inode *new_node = fpga_first_inode; if (new_node == NULL) { - new_node = kmalloc(sizeof(struct fpga_inode), GFP_KERNEL); + new_node = kmalloc_obj(struct fpga_inode, GFP_KERNEL); fpga_first_inode = new_node; } else { while (new_node->next_inode != NULL) new_node = new_node->next_inode; new_node->next_inode = - kmalloc(sizeof(struct fpga_inode), GFP_KERNEL); + kmalloc_obj(struct fpga_inode, GFP_KERNEL); if (new_node->next_inode != NULL) new_node = new_node->next_inode; else @@ -634,7 +634,7 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) struct fpga_internal *inter = NULL; int ret = 0; - pid_filt = kzalloc(sizeof(struct netup_hw_pid_filter), GFP_KERNEL); + pid_filt = kzalloc_obj(struct netup_hw_pid_filter, GFP_KERNEL); ci_dbg_print("%s\n", __func__); @@ -648,7 +648,7 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) (inter->filts_used)++; ci_dbg_print("%s: Find Internal Structure!\n", __func__); } else { - inter = kzalloc(sizeof(struct fpga_internal), GFP_KERNEL); + inter = kzalloc_obj(struct fpga_internal, GFP_KERNEL); if (!inter) { ret = -ENOMEM; goto err; @@ -706,7 +706,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) int ret = 0; u8 store = 0; - state = kzalloc(sizeof(struct altera_ci_state), GFP_KERNEL); + state = kzalloc_obj(struct altera_ci_state, GFP_KERNEL); ci_dbg_print("%s\n", __func__); @@ -721,7 +721,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) inter->fpga_rw = config->fpga_rw; ci_dbg_print("%s: Find Internal Structure!\n", __func__); } else { - inter = kzalloc(sizeof(struct fpga_internal), GFP_KERNEL); + inter = kzalloc_obj(struct fpga_internal, GFP_KERNEL); if (!inter) { ret = -ENOMEM; goto err; diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c index 06e41f92092d..f0ecc92fc444 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c @@ -451,7 +451,7 @@ int netup_ci_init(struct cx23885_tsport *port) int ret; ci_dbg_print("%s\n", __func__); - state = kzalloc(sizeof(struct netup_ci_state), GFP_KERNEL); + state = kzalloc_obj(struct netup_ci_state, GFP_KERNEL); if (!state) { ci_dbg_print("%s: Unable create CI structure!\n", __func__); ret = -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c index 717fc6c9ef21..e56c5b7d84bc 100644 --- a/drivers/media/pci/cx23885/cx23885-alsa.c +++ b/drivers/media/pci/cx23885/cx23885-alsa.c @@ -374,7 +374,7 @@ static int snd_cx23885_hw_params(struct snd_pcm_substream *substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods-1)); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (NULL == buf) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index a39f445ce22a..ef2d00db794c 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -2124,7 +2124,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev, struct v4l2_ctrl_handler *hdl; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index d2e84c6457e0..9c6e5b360bab 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c @@ -327,7 +327,7 @@ int cx23885_input_init(struct cx23885_dev *dev) } /* cx23885 board instance kernel IR state */ - kernel_ir = kzalloc(sizeof(struct cx23885_kernel_ir), GFP_KERNEL); + kernel_ir = kzalloc_obj(struct cx23885_kernel_ir, GFP_KERNEL); if (kernel_ir == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index 222d04421468..242b47a7d0af 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -1142,7 +1142,7 @@ int cx23888_ir_probe(struct cx23885_dev *dev) struct v4l2_subdev_ir_parameters default_params; int ret; - state = kzalloc(sizeof(struct cx23888_ir_state), GFP_KERNEL); + state = kzalloc_obj(struct cx23888_ir_state, GFP_KERNEL); if (state == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c index f463365163b7..a8197a9b0abf 100644 --- a/drivers/media/pci/cx25821/cx25821-alsa.c +++ b/drivers/media/pci/cx25821/cx25821-alsa.c @@ -512,7 +512,7 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods - 1)); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (NULL == buf) return -ENOMEM; diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c index a7336be44474..d64712f3aed4 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1266,7 +1266,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev, struct cx25821_dev *dev; int err = 0; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index 4e574d8390b4..3b8622dd056c 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c @@ -465,7 +465,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream *substream, WARN_ON(!chip->dma_size); WARN_ON(chip->num_periods & (chip->num_periods - 1)); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c index f01e48c23f8e..3e11bb066f31 100644 --- a/drivers/media/pci/cx88/cx88-cards.c +++ b/drivers/media/pci/cx88/cx88-cards.c @@ -3700,7 +3700,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) struct cx88_core *core; int i; - core = kzalloc(sizeof(*core), GFP_KERNEL); + core = kzalloc_obj(*core, GFP_KERNEL); if (!core) return NULL; diff --git a/drivers/media/pci/cx88/cx88-dsp.c b/drivers/media/pci/cx88/cx88-dsp.c index e378f3b215c7..1d7049edd252 100644 --- a/drivers/media/pci/cx88/cx88-dsp.c +++ b/drivers/media/pci/cx88/cx88-dsp.c @@ -252,7 +252,7 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N) current_address, current_address - srch->fifo_start, sample_count, cx_read(MO_AUD_INTSTAT)); - samples = kmalloc_array(sample_count, sizeof(*samples), GFP_KERNEL); + samples = kmalloc_objs(*samples, sample_count, GFP_KERNEL); if (!samples) return NULL; diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index b9f2c14d62b4..f94d75c64cf9 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -267,7 +267,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) * used with a full-code IR table */ - ir = kzalloc(sizeof(*ir), GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); dev = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !dev) goto err_out_free; diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c index 2c1d5137ac47..1ed77f812784 100644 --- a/drivers/media/pci/cx88/cx88-mpeg.c +++ b/drivers/media/pci/cx88/cx88-mpeg.c @@ -619,7 +619,7 @@ int cx8802_register_driver(struct cx8802_driver *drv) dev->core->boardnr); /* Bring up a new struct for each driver instance */ - driver = kzalloc(sizeof(*drv), GFP_KERNEL); + driver = kzalloc_obj(*drv, GFP_KERNEL); if (!driver) { err = -ENOMEM; goto out; @@ -715,7 +715,7 @@ static int cx8802_probe(struct pci_dev *pci_dev, goto fail_core; err = -ENOMEM; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto fail_core; dev->pci = pci_dev; diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 0c87327689d3..87752ce17df8 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -1261,7 +1261,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, int err; int i; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-vp3054-i2c.c b/drivers/media/pci/cx88/cx88-vp3054-i2c.c index ac7f76dc5e21..e421589edf4c 100644 --- a/drivers/media/pci/cx88/cx88-vp3054-i2c.c +++ b/drivers/media/pci/cx88/cx88-vp3054-i2c.c @@ -97,7 +97,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev) if (core->boardnr != CX88_BOARD_DNTV_LIVE_DVB_T_PRO) return 0; - vp3054_i2c = kzalloc(sizeof(*vp3054_i2c), GFP_KERNEL); + vp3054_i2c = kzalloc_obj(*vp3054_i2c, GFP_KERNEL); if (!vp3054_i2c) return -ENOMEM; dev->vp3054 = vp3054_i2c; diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c index ee20813c33ff..2602256b9f4a 100644 --- a/drivers/media/pci/ddbridge/ddbridge-ci.c +++ b/drivers/media/pci/ddbridge/ddbridge-ci.c @@ -155,7 +155,7 @@ static void ci_attach(struct ddb_port *port) { struct ddb_ci *ci; - ci = kzalloc(sizeof(*ci), GFP_KERNEL); + ci = kzalloc_obj(*ci, GFP_KERNEL); if (!ci) return; memcpy(&ci->en, &en_templ, sizeof(en_templ)); @@ -288,7 +288,7 @@ static void ci_xo2_attach(struct ddb_port *port) { struct ddb_ci *ci; - ci = kzalloc(sizeof(*ci), GFP_KERNEL); + ci = kzalloc_obj(*ci, GFP_KERNEL); if (!ci) return; memcpy(&ci->en, &en_xo2_templ, sizeof(en_xo2_templ)); diff --git a/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c b/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c index 520ebd16b0c4..57192c5cb9c3 100644 --- a/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c +++ b/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c @@ -100,7 +100,7 @@ struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void) struct ddbridge_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct ddbridge_dummy_fe_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c index 9e9c7c071acc..1e1d4bda7c56 100644 --- a/drivers/media/pci/dm1105/dm1105.c +++ b/drivers/media/pci/dm1105/dm1105.c @@ -976,7 +976,7 @@ static int dm1105_probe(struct pci_dev *pdev, if (dm1105_devcount >= ARRAY_SIZE(card)) return -ENODEV; - dev = kzalloc(sizeof(struct dm1105_dev), GFP_KERNEL); + dev = kzalloc_obj(struct dm1105_dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index b2b710094914..72ebe4016ca2 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -638,7 +638,7 @@ int ipu_bridge_instantiate_vcm(struct device *sensor) return 0; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { fwnode_handle_put(vcm_fwnode); return -ENOMEM; @@ -851,7 +851,7 @@ int ipu_bridge_init(struct device *dev, return dev_err_probe(dev, -EPROBE_DEFER, "waiting for IVSC to become ready\n"); - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu6/ipu6-bus.c b/drivers/media/pci/intel/ipu6/ipu6-bus.c index 5cee2748983b..59879e4861ed 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-bus.c +++ b/drivers/media/pci/intel/ipu6/ipu6-bus.c @@ -90,7 +90,7 @@ ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *parent, struct ipu6_device *isp = pci_get_drvdata(pdev); int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/intel/ipu6/ipu6-buttress.c b/drivers/media/pci/intel/ipu6/ipu6-buttress.c index 103386c4f6ae..8b90ecf49e45 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-buttress.c +++ b/drivers/media/pci/intel/ipu6/ipu6-buttress.c @@ -552,7 +552,7 @@ int ipu6_buttress_map_fw_image(struct ipu6_bus_device *sys, n_pages = PFN_UP(fw->size); - pages = kmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, n_pages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu6/ipu6-dma.c b/drivers/media/pci/intel/ipu6/ipu6-dma.c index 7296373d36b0..cefb16040c21 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-dma.c +++ b/drivers/media/pci/intel/ipu6/ipu6-dma.c @@ -164,7 +164,7 @@ void *ipu6_dma_alloc(struct ipu6_bus_device *sys, size_t size, unsigned int i; int ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return NULL; diff --git a/drivers/media/pci/intel/ipu6/ipu6-fw-com.c b/drivers/media/pci/intel/ipu6/ipu6-fw-com.c index 40d8ce138a67..13ee09f6d32a 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-fw-com.c +++ b/drivers/media/pci/intel/ipu6/ipu6-fw-com.c @@ -170,7 +170,7 @@ void *ipu6_fw_com_prepare(struct ipu6_fw_com_cfg *cfg, if (!cfg || !cfg->cell_start || !cfg->cell_ready) return NULL; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; ctx->dmem_addr = base + cfg->dmem_addr + REGMEM_OFFSET; diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c index 85cc6d5b4dd1..9eadde7142a3 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c @@ -549,7 +549,7 @@ static struct ipu6_mmu_info *ipu6_mmu_alloc(struct ipu6_device *isp) struct ipu6_mmu_info *mmu_info; int ret; - mmu_info = kzalloc(sizeof(*mmu_info), GFP_KERNEL); + mmu_info = kzalloc_obj(*mmu_info, GFP_KERNEL); if (!mmu_info) return NULL; @@ -613,7 +613,7 @@ static struct ipu6_dma_mapping *alloc_dma_mapping(struct ipu6_device *isp) { struct ipu6_dma_mapping *dmap; - dmap = kzalloc(sizeof(*dmap), GFP_KERNEL); + dmap = kzalloc_obj(*dmap, GFP_KERNEL); if (!dmap) return NULL; diff --git a/drivers/media/pci/intel/ipu6/ipu6.c b/drivers/media/pci/intel/ipu6/ipu6.c index 24238f8311a6..57fe13ebb621 100644 --- a/drivers/media/pci/intel/ipu6/ipu6.c +++ b/drivers/media/pci/intel/ipu6/ipu6.c @@ -381,7 +381,7 @@ ipu6_isys_init(struct pci_dev *pdev, struct device *parent, return ERR_PTR(ret); } - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); @@ -425,7 +425,7 @@ ipu6_psys_init(struct pci_dev *pdev, struct device *parent, struct ipu6_psys_pdata *pdata; int ret; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/ivtv/ivtv-alsa-main.c b/drivers/media/pci/ivtv/ivtv-alsa-main.c index 9e13a7128a53..05d499241c02 100644 --- a/drivers/media/pci/ivtv/ivtv-alsa-main.c +++ b/drivers/media/pci/ivtv/ivtv-alsa-main.c @@ -74,7 +74,7 @@ static int snd_ivtv_card_create(struct v4l2_device *v4l2_dev, struct snd_card *sc, struct snd_ivtv_card **itvsc) { - *itvsc = kzalloc(sizeof(struct snd_ivtv_card), GFP_KERNEL); + *itvsc = kzalloc_obj(struct snd_ivtv_card, GFP_KERNEL); if (*itvsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 459eb6cc370c..9d0d4faf9867 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -953,7 +953,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) int vbi_buf_size; struct ivtv *itv; - itv = kzalloc(sizeof(struct ivtv), GFP_KERNEL); + itv = kzalloc_obj(struct ivtv, GFP_KERNEL); if (itv == NULL) return -ENOMEM; itv->pdev = pdev; diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c index ef9ec062c03a..87c0ef449beb 100644 --- a/drivers/media/pci/ivtv/ivtv-fileops.c +++ b/drivers/media/pci/ivtv/ivtv-fileops.c @@ -990,7 +990,7 @@ static int ivtv_open(struct file *filp) } /* Allocate memory */ - item = kzalloc(sizeof(struct ivtv_open_id), GFP_KERNEL); + item = kzalloc_obj(struct ivtv_open_id, GFP_KERNEL); if (NULL == item) { IVTV_DEBUG_WARN("nomem on v4l2 open\n"); return -ENOMEM; diff --git a/drivers/media/pci/ivtv/ivtv-queue.c b/drivers/media/pci/ivtv/ivtv-queue.c index f7d2d159d800..9e339ef0c82d 100644 --- a/drivers/media/pci/ivtv/ivtv-queue.c +++ b/drivers/media/pci/ivtv/ivtv-queue.c @@ -207,8 +207,8 @@ int ivtv_stream_alloc(struct ivtv_stream *s) } s->sg_processing_size = 0; - s->sg_dma = kzalloc(sizeof(struct ivtv_sg_element), - GFP_KERNEL|__GFP_NOWARN); + s->sg_dma = kzalloc_obj(struct ivtv_sg_element, + GFP_KERNEL | __GFP_NOWARN); if (s->sg_dma == NULL) { IVTV_ERR("Could not allocate sg_dma for %s stream\n", s->name); kfree(s->sg_pending); @@ -226,8 +226,8 @@ int ivtv_stream_alloc(struct ivtv_stream *s) /* allocate stream buffers. Initially all buffers are in q_free. */ for (i = 0; i < s->buffers; i++) { - struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), - GFP_KERNEL|__GFP_NOWARN); + struct ivtv_buffer *buf = kzalloc_obj(struct ivtv_buffer, + GFP_KERNEL | __GFP_NOWARN); if (buf == NULL) break; diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 90c584cf97c2..4f55b44738c9 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -1176,8 +1176,7 @@ static int ivtvfb_init_card(struct ivtv *itv) return -EBUSY; } - itv->osd_info = kzalloc(sizeof(struct osd_info), - GFP_KERNEL|__GFP_NOWARN); + itv->osd_info = kzalloc_obj(struct osd_info, GFP_KERNEL | __GFP_NOWARN); if (itv->osd_info == NULL) { IVTVFB_ERR("Failed to allocate memory for osd_info\n"); return -ENOMEM; diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index b85aef4e2b24..132b5e21868b 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -149,7 +149,7 @@ static int hopper_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err; - mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); + mantis = kzalloc_obj(*mantis, GFP_KERNEL); if (!mantis) { err = -ENOMEM; goto fail0; diff --git a/drivers/media/pci/mantis/mantis_ca.c b/drivers/media/pci/mantis/mantis_ca.c index 0fad0a923e35..a0998b16ba9e 100644 --- a/drivers/media/pci/mantis/mantis_ca.c +++ b/drivers/media/pci/mantis/mantis_ca.c @@ -137,7 +137,7 @@ int mantis_ca_init(struct mantis_pci *mantis) int ca_flags = 0, result; dprintk(MANTIS_DEBUG, 1, "Initializing Mantis CA"); - ca = kzalloc(sizeof(struct mantis_ca), GFP_KERNEL); + ca = kzalloc_obj(struct mantis_ca, GFP_KERNEL); if (!ca) { dprintk(MANTIS_ERROR, 1, "Out of memory!, exiting .."); result = -ENOMEM; diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index b44b4cf42f86..3c46e1db8e4a 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c @@ -158,7 +158,7 @@ static int mantis_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err; - mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); + mantis = kzalloc_obj(*mantis, GFP_KERNEL); if (!mantis) return -ENOMEM; diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c index a7cb8dc50b53..cd23758fb9b4 100644 --- a/drivers/media/pci/mgb4/mgb4_core.c +++ b/drivers/media/pci/mgb4/mgb4_core.c @@ -522,7 +522,7 @@ static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id) }; int irqs = pci_msix_vec_count(pdev); - mgbdev = kzalloc(sizeof(*mgbdev), GFP_KERNEL); + mgbdev = kzalloc_obj(*mgbdev, GFP_KERNEL); if (!mgbdev) return -ENOMEM; diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c index e782db79686f..815c87b9210f 100644 --- a/drivers/media/pci/mgb4/mgb4_vin.c +++ b/drivers/media/pci/mgb4/mgb4_vin.c @@ -946,7 +946,7 @@ struct mgb4_vin_dev *mgb4_vin_create(struct mgb4_dev *mgbdev, int id) struct device *dev = &pdev->dev; int vin_irq, err_irq; - vindev = kzalloc(sizeof(*vindev), GFP_KERNEL); + vindev = kzalloc_obj(*vindev, GFP_KERNEL); if (!vindev) return NULL; diff --git a/drivers/media/pci/mgb4/mgb4_vout.c b/drivers/media/pci/mgb4/mgb4_vout.c index 44e9565d4d06..cd5a36a41333 100644 --- a/drivers/media/pci/mgb4/mgb4_vout.c +++ b/drivers/media/pci/mgb4/mgb4_vout.c @@ -761,7 +761,7 @@ struct mgb4_vout_dev *mgb4_vout_create(struct mgb4_dev *mgbdev, int id) struct pci_dev *pdev = mgbdev->pdev; struct device *dev = &pdev->dev; - voutdev = kzalloc(sizeof(*voutdev), GFP_KERNEL); + voutdev = kzalloc_obj(*voutdev, GFP_KERNEL); if (!voutdev) return NULL; diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index 9f2ac33cffa7..08af6717b1c9 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c @@ -799,7 +799,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev, } /* allocate device context */ - ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); + ndev = kzalloc_obj(*ndev, GFP_KERNEL); if (!ndev) goto dev_alloc_err; diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c index 6ac9b9bd7435..38bd167e821d 100644 --- a/drivers/media/pci/pluto2/pluto2.c +++ b/drivers/media/pci/pluto2/pluto2.c @@ -582,7 +582,7 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct dmx_demux *dmx; int ret = -ENOMEM; - pluto = kzalloc(sizeof(struct pluto), GFP_KERNEL); + pluto = kzalloc_obj(struct pluto, GFP_KERNEL); if (!pluto) goto out; diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c index 1ced093583ac..21a9a3166588 100644 --- a/drivers/media/pci/pt1/pt1.c +++ b/drivers/media/pci/pt1/pt1.c @@ -833,7 +833,7 @@ pt1_alloc_adapter(struct pt1 *pt1) struct dmxdev *dmxdev; int ret; - adap = kzalloc(sizeof(struct pt1_adapter), GFP_KERNEL); + adap = kzalloc_obj(struct pt1_adapter, GFP_KERNEL); if (!adap) { ret = -ENOMEM; goto err; @@ -1356,7 +1356,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_pci_release_regions; } - pt1 = kzalloc(sizeof(struct pt1), GFP_KERNEL); + pt1 = kzalloc_obj(struct pt1, GFP_KERNEL); if (!pt1) { ret = -ENOMEM; goto err_pci_iounmap; diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c index c55aa782b72c..f0fb92017e8f 100644 --- a/drivers/media/pci/pt3/pt3.c +++ b/drivers/media/pci/pt3/pt3.c @@ -529,7 +529,7 @@ static int pt3_alloc_adapter(struct pt3_board *pt3, int index) struct pt3_adapter *adap; struct dvb_adapter *da; - adap = kzalloc(sizeof(*adap), GFP_KERNEL); + adap = kzalloc_obj(*adap, GFP_KERNEL); if (!adap) return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index f86a44dfe6e3..ad1a640d7f76 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c @@ -816,7 +816,7 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) mutex_unlock(&dev->dmasound.lock); - pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); + pcm = kzalloc_obj(*pcm, GFP_KERNEL); if (pcm == NULL) return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index 537aa65acdc8..5acad9554a61 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -1010,7 +1010,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, if (saa7134_devcount == SAA7134_MAXBOARDS) return -ENOMEM; - dev = kzalloc(sizeof(*dev),GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (NULL == dev) return -ENOMEM; @@ -1018,7 +1018,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, sprintf(dev->name, "saa%x[%d]", pci_dev->device, dev->nr); #ifdef CONFIG_MEDIA_CONTROLLER - dev->media_dev = kzalloc(sizeof(*dev->media_dev), GFP_KERNEL); + dev->media_dev = kzalloc_obj(*dev->media_dev, GFP_KERNEL); if (!dev->media_dev) { err = -ENOMEM; goto err_free_dev; diff --git a/drivers/media/pci/saa7134/saa7134-go7007.c b/drivers/media/pci/saa7134/saa7134-go7007.c index bd37db5ce363..05f9606b9012 100644 --- a/drivers/media/pci/saa7134/saa7134-go7007.c +++ b/drivers/media/pci/saa7134/saa7134-go7007.c @@ -414,7 +414,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev) if (go == NULL) return -ENOMEM; - saa = kzalloc(sizeof(struct saa7134_go7007), GFP_KERNEL); + saa = kzalloc_obj(struct saa7134_go7007, GFP_KERNEL); if (saa == NULL) { kfree(go); return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index 468dbe8d552f..22fbcc2cb585 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -768,7 +768,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) return -ENODEV; } - ir = kzalloc(sizeof(*ir), GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); rc = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ir || !rc) { err = -ENOMEM; diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index 40b35098f3ea..371beecd92e1 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c @@ -250,7 +250,7 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d DEB_EE("\n"); - hexium = kzalloc(sizeof(*hexium), GFP_KERNEL); + hexium = kzalloc_obj(*hexium, GFP_KERNEL); if (!hexium) return -ENOMEM; diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c index a2076728c621..f713d543971e 100644 --- a/drivers/media/pci/saa7146/hexium_orion.c +++ b/drivers/media/pci/saa7146/hexium_orion.c @@ -209,7 +209,7 @@ static int hexium_probe(struct saa7146_dev *dev) return -EFAULT; } - hexium = kzalloc(sizeof(*hexium), GFP_KERNEL); + hexium = kzalloc_obj(*hexium, GFP_KERNEL); if (!hexium) return -ENOMEM; diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c index a14b839098b8..1999d45f2986 100644 --- a/drivers/media/pci/saa7146/mxb.c +++ b/drivers/media/pci/saa7146/mxb.c @@ -226,7 +226,7 @@ static int mxb_probe(struct saa7146_dev *dev) V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); if (hdl->error) return hdl->error; - mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL); + mxb = kzalloc_obj(struct mxb, GFP_KERNEL); if (mxb == NULL) { DEB_D("not enough kernel memory\n"); return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-buffer.c b/drivers/media/pci/saa7164/saa7164-buffer.c index 7820e4f47fd5..9d1fa04990f7 100644 --- a/drivers/media/pci/saa7164/saa7164-buffer.c +++ b/drivers/media/pci/saa7164/saa7164-buffer.c @@ -68,7 +68,7 @@ struct saa7164_buffer *saa7164_buffer_alloc(struct saa7164_port *port, goto ret; } - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) goto ret; @@ -252,7 +252,7 @@ struct saa7164_user_buffer *saa7164_buffer_alloc_user(struct saa7164_dev *dev, { struct saa7164_user_buffer *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return NULL; diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index a8a004f28ca0..eac9bc9f640c 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1238,7 +1238,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev, int err, i; u32 version; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index 66d650b5f69a..cae31f11d076 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -719,7 +719,7 @@ static int fops_open(struct file *file) dprintk(DBGLVL_ENC, "%s()\n", __func__); /* allocate + initialize per filehandle data */ - fh = kzalloc(sizeof(*fh), GFP_KERNEL); + fh = kzalloc_obj(*fh, GFP_KERNEL); if (NULL == fh) return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c index 57e4362c0d19..fcb9f99890e5 100644 --- a/drivers/media/pci/saa7164/saa7164-vbi.c +++ b/drivers/media/pci/saa7164/saa7164-vbi.c @@ -422,7 +422,7 @@ static int fops_open(struct file *file) dprintk(DBGLVL_VBI, "%s()\n", __func__); /* allocate + initialize per filehandle data */ - fh = kzalloc(sizeof(*fh), GFP_KERNEL); + fh = kzalloc_obj(*fh, GFP_KERNEL); if (NULL == fh) return -ENOMEM; diff --git a/drivers/media/pci/smipcie/smipcie-main.c b/drivers/media/pci/smipcie/smipcie-main.c index 7db6d443fc54..5bfba2721231 100644 --- a/drivers/media/pci/smipcie/smipcie-main.c +++ b/drivers/media/pci/smipcie/smipcie-main.c @@ -946,7 +946,7 @@ static int smi_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (pci_enable_device(pdev) < 0) return -ENODEV; - dev = kzalloc(sizeof(struct smi_dev), GFP_KERNEL); + dev = kzalloc_obj(struct smi_dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err_pci_disable_device; diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c index d1d3a83d0122..78335a6838c6 100644 --- a/drivers/media/pci/solo6x10/solo6x10-core.c +++ b/drivers/media/pci/solo6x10/solo6x10-core.c @@ -449,7 +449,7 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) int ret; u8 chip_id; - solo_dev = kzalloc(sizeof(*solo_dev), GFP_KERNEL); + solo_dev = kzalloc_obj(*solo_dev, GFP_KERNEL); if (solo_dev == NULL) return -ENOMEM; diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c index 1db9f40ee0c0..5906fd47b583 100644 --- a/drivers/media/pci/solo6x10/solo6x10-g723.c +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c @@ -120,7 +120,7 @@ static int snd_solo_pcm_open(struct snd_pcm_substream *ss) struct solo_dev *solo_dev = snd_pcm_substream_chip(ss); struct solo_snd_pcm *solo_pcm; - solo_pcm = kzalloc(sizeof(*solo_pcm), GFP_KERNEL); + solo_pcm = kzalloc_obj(*solo_pcm, GFP_KERNEL); if (solo_pcm == NULL) goto oom; diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index 5ee59b3844cc..d7168b9c9e61 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c @@ -1208,7 +1208,7 @@ static struct solo_enc_dev *solo_enc_alloc(struct solo_dev *solo_dev, struct v4l2_ctrl_handler *hdl; int ret; - solo_enc = kzalloc(sizeof(*solo_enc), GFP_KERNEL); + solo_enc = kzalloc_obj(*solo_enc, GFP_KERNEL); if (!solo_enc) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index 69f5e810f9b5..482e71c0fdcc 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -1437,7 +1437,7 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio dprintk(2, "dev: %p\n", dev); - budget_av = kzalloc(sizeof(struct budget_av), GFP_KERNEL); + budget_av = kzalloc_obj(struct budget_av, GFP_KERNEL); if (!budget_av) return -ENOMEM; diff --git a/drivers/media/pci/ttpci/budget-ci.c b/drivers/media/pci/ttpci/budget-ci.c index 33f08adf4feb..86edb4310366 100644 --- a/drivers/media/pci/ttpci/budget-ci.c +++ b/drivers/media/pci/ttpci/budget-ci.c @@ -1456,7 +1456,7 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio struct budget_ci *budget_ci; int err; - budget_ci = kzalloc(sizeof(struct budget_ci), GFP_KERNEL); + budget_ci = kzalloc_obj(struct budget_ci, GFP_KERNEL); if (!budget_ci) { err = -ENOMEM; goto out1; diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c index f623c250909b..ebdc6d2bce4e 100644 --- a/drivers/media/pci/ttpci/budget.c +++ b/drivers/media/pci/ttpci/budget.c @@ -788,7 +788,7 @@ static int budget_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d struct budget *budget = NULL; int err; - budget = kmalloc(sizeof(struct budget), GFP_KERNEL); + budget = kmalloc_obj(struct budget, GFP_KERNEL); if (budget == NULL) return -ENOMEM; diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c index f39e0e34deb6..bcf93f4a5c83 100644 --- a/drivers/media/pci/tw686x/tw686x-core.c +++ b/drivers/media/pci/tw686x/tw686x-core.c @@ -243,22 +243,22 @@ static int tw686x_probe(struct pci_dev *pci_dev, struct tw686x_dev *dev; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->type = pci_id->driver_data; dev->dma_mode = dma_mode; sprintf(dev->name, "tw%04X", pci_dev->device); - dev->video_channels = kcalloc(max_channels(dev), - sizeof(*dev->video_channels), GFP_KERNEL); + dev->video_channels = kzalloc_objs(*dev->video_channels, + max_channels(dev), GFP_KERNEL); if (!dev->video_channels) { err = -ENOMEM; goto free_dev; } - dev->audio_channels = kcalloc(max_channels(dev), - sizeof(*dev->audio_channels), GFP_KERNEL); + dev->audio_channels = kzalloc_objs(*dev->audio_channels, + max_channels(dev), GFP_KERNEL); if (!dev->audio_channels) { err = -ENOMEM; goto free_video; diff --git a/drivers/media/pci/zoran/videocodec.c b/drivers/media/pci/zoran/videocodec.c index 8efc5e06b0f7..2874247ad300 100644 --- a/drivers/media/pci/zoran/videocodec.c +++ b/drivers/media/pci/zoran/videocodec.c @@ -73,7 +73,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) res = codec->setup(codec); if (res == 0) { zrdev_dbg(zr, "%s: '%s'\n", __func__, codec->name); - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); if (!ptr) goto out_kfree; ptr->codec = codec; @@ -180,7 +180,7 @@ int videocodec_register(const struct videocodec *codec) "videocodec: register '%s', type: %x, flags %lx, magic %lx\n", codec->name, codec->type, codec->flags, codec->magic); - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); if (!ptr) return -ENOMEM; ptr->codec = codec; diff --git a/drivers/media/pci/zoran/zr36016.c b/drivers/media/pci/zoran/zr36016.c index d2e136c48a1b..4c6a0a00578b 100644 --- a/drivers/media/pci/zoran/zr36016.c +++ b/drivers/media/pci/zoran/zr36016.c @@ -344,7 +344,7 @@ static int zr36016_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/pci/zoran/zr36050.c b/drivers/media/pci/zoran/zr36050.c index c17965073557..701e4ef7ec22 100644 --- a/drivers/media/pci/zoran/zr36050.c +++ b/drivers/media/pci/zoran/zr36050.c @@ -741,7 +741,7 @@ static int zr36050_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/pci/zoran/zr36060.c b/drivers/media/pci/zoran/zr36060.c index d6c12efc5bb6..ddd822e4495a 100644 --- a/drivers/media/pci/zoran/zr36060.c +++ b/drivers/media/pci/zoran/zr36060.c @@ -796,7 +796,7 @@ static int zr36060_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index eec0b8b30b7f..a6589cd6359e 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -967,7 +967,7 @@ static int allegro_mbox_notify(struct allegro_mbox *mbox) u32 *tmp; int err; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -1551,7 +1551,7 @@ static int allocate_buffers_internal(struct allegro_channel *channel, struct allegro_buffer *buffer, *tmp; for (i = 0; i < n; i++) { - buffer = kmalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kmalloc_obj(*buffer, GFP_KERNEL); if (!buffer) { err = -ENOMEM; goto err; @@ -1632,7 +1632,7 @@ static ssize_t allegro_h264_write_sps(struct allegro_channel *channel, unsigned int cpb_size; unsigned int cpb_size_scale; - sps = kzalloc(sizeof(*sps), GFP_KERNEL); + sps = kzalloc_obj(*sps, GFP_KERNEL); if (!sps) return -ENOMEM; @@ -1729,7 +1729,7 @@ static ssize_t allegro_h264_write_pps(struct allegro_channel *channel, struct nal_h264_pps *pps; ssize_t size; - pps = kzalloc(sizeof(*pps), GFP_KERNEL); + pps = kzalloc_obj(*pps, GFP_KERNEL); if (!pps) return -ENOMEM; @@ -1780,7 +1780,7 @@ static ssize_t allegro_hevc_write_vps(struct allegro_channel *channel, s32 level = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_level); s32 tier = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_tier); - vps = kzalloc(sizeof(*vps), GFP_KERNEL); + vps = kzalloc_obj(*vps, GFP_KERNEL); if (!vps) return -ENOMEM; @@ -1822,7 +1822,7 @@ static ssize_t allegro_hevc_write_sps(struct allegro_channel *channel, s32 level = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_level); s32 tier = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_tier); - sps = kzalloc(sizeof(*sps), GFP_KERNEL); + sps = kzalloc_obj(*sps, GFP_KERNEL); if (!sps) return -ENOMEM; @@ -1929,7 +1929,7 @@ static ssize_t allegro_hevc_write_pps(struct allegro_channel *channel, ssize_t size; int i; - pps = kzalloc(sizeof(*pps), GFP_KERNEL); + pps = kzalloc_obj(*pps, GFP_KERNEL); if (!pps) return -ENOMEM; diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c index c51c6f4e41dc..0b499ed7795f 100644 --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c @@ -834,7 +834,7 @@ static int ge2d_open(struct file *file) struct ge2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->ge2d = ge2d; diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index adf53b49020e..3302994dbf3f 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -1927,19 +1927,18 @@ static int vdec_open(struct file *file) struct vdec_t *vdec; int ret; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; - vdec = kzalloc(sizeof(*vdec), GFP_KERNEL); + vdec = kzalloc_obj(*vdec, GFP_KERNEL); if (!vdec) { kfree(inst); return -ENOMEM; } - vdec->slots = kmalloc_array(VDEC_SLOT_CNT_DFT, - sizeof(*vdec->slots), - GFP_KERNEL | __GFP_ZERO); + vdec->slots = kmalloc_objs(*vdec->slots, VDEC_SLOT_CNT_DFT, + GFP_KERNEL | __GFP_ZERO); if (!vdec->slots) { kfree(vdec); kfree(inst); diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index 9e5cbc2b0d3f..4f13566fed49 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -858,7 +858,7 @@ static int venc_frame_encoded(struct vpu_inst *inst, void *arg) if (!info) return -EINVAL; venc = inst->priv; - frame = kzalloc(sizeof(*frame), GFP_KERNEL); + frame = kzalloc_obj(*frame, GFP_KERNEL); if (!frame) return -ENOMEM; @@ -1307,11 +1307,11 @@ static int venc_open(struct file *file) struct venc_t *venc; int ret; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; - venc = kzalloc(sizeof(*venc), GFP_KERNEL); + venc = kzalloc_obj(*venc, GFP_KERNEL); if (!venc) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/amphion/vpu_cmds.c b/drivers/media/platform/amphion/vpu_cmds.c index ab69412e0aa7..00eda558a739 100644 --- a/drivers/media/platform/amphion/vpu_cmds.c +++ b/drivers/media/platform/amphion/vpu_cmds.c @@ -83,11 +83,11 @@ static struct vpu_cmd_t *vpu_alloc_cmd(struct vpu_inst *inst, u32 id, void *data int i; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return NULL; - cmd->pkt = kzalloc(sizeof(*cmd->pkt), GFP_KERNEL); + cmd->pkt = kzalloc_obj(*cmd->pkt, GFP_KERNEL); if (!cmd->pkt) { kfree(cmd); return NULL; diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index f10064107d54..9d00ea315763 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2642,7 +2642,7 @@ static int unicam_probe(struct platform_device *pdev) struct unicam_device *unicam; int ret; - unicam = kzalloc(sizeof(*unicam), GFP_KERNEL); + unicam = kzalloc_obj(*unicam, GFP_KERNEL); if (!unicam) return -ENOMEM; diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 8c19f125da3e..df299f29756f 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -824,7 +824,7 @@ static int csi2rx_probe(struct platform_device *pdev) unsigned int i; int ret; - csi2rx = kzalloc(sizeof(*csi2rx), GFP_KERNEL); + csi2rx = kzalloc_obj(*csi2rx, GFP_KERNEL); if (!csi2rx) return -ENOMEM; platform_set_drvdata(pdev, csi2rx); diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index e22b133f346d..80aefdbe259b 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -573,7 +573,7 @@ static int csi2tx_probe(struct platform_device *pdev) unsigned int i; int ret; - csi2tx = kzalloc(sizeof(*csi2tx), GFP_KERNEL); + csi2tx = kzalloc_obj(*csi2tx, GFP_KERNEL); if (!csi2tx) return -ENOMEM; platform_set_drvdata(pdev, csi2tx); diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index fa6b72c3bd93..aab26194ad1b 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -397,7 +397,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list) */ src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); - meta = kmalloc(sizeof(*meta), GFP_KERNEL); + meta = kmalloc_obj(*meta, GFP_KERNEL); if (meta) { meta->sequence = src_buf->sequence; meta->timecode = src_buf->timecode; diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 33f712ff8556..fea7682b2217 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2606,7 +2606,7 @@ static int coda_open(struct file *file) int ret; int idx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/chips-media/coda/coda-jpeg.c b/drivers/media/platform/chips-media/coda/coda-jpeg.c index fb150b87c773..487d08491a42 100644 --- a/drivers/media/platform/chips-media/coda/coda-jpeg.c +++ b/drivers/media/platform/chips-media/coda/coda-jpeg.c @@ -355,7 +355,7 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct vb2_buffer *vb) } huff_tab = ctx->params.jpeg_huff_tab; if (!huff_tab) { - huff_tab = kzalloc(sizeof(struct coda_huff_tab), GFP_KERNEL); + huff_tab = kzalloc_obj(struct coda_huff_tab, GFP_KERNEL); if (!huff_tab) return -ENOMEM; ctx->params.jpeg_huff_tab = huff_tab; @@ -593,7 +593,7 @@ static int coda9_jpeg_gen_enc_huff_tab(struct coda_ctx *ctx, int tab_num, }; int ret = -EINVAL; - huff = kzalloc(sizeof(*huff), GFP_KERNEL); + huff = kzalloc_obj(*huff, GFP_KERNEL); if (!huff) return -ENOMEM; @@ -723,7 +723,7 @@ static int coda9_jpeg_load_huff_tab(struct coda_ctx *ctx) int i, j; int ret; - huff = kzalloc(sizeof(*huff), GFP_KERNEL); + huff = kzalloc_obj(*huff, GFP_KERNEL); if (!huff) return -ENOMEM; diff --git a/drivers/media/platform/chips-media/coda/imx-vdoa.c b/drivers/media/platform/chips-media/coda/imx-vdoa.c index c3561fcecb98..2e85043a7f01 100644 --- a/drivers/media/platform/chips-media/coda/imx-vdoa.c +++ b/drivers/media/platform/chips-media/coda/imx-vdoa.c @@ -201,7 +201,7 @@ struct vdoa_ctx *vdoa_context_create(struct vdoa_data *vdoa) struct vdoa_ctx *ctx; int err; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c index 8917542b993c..097ab7f595b0 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c @@ -1822,7 +1822,7 @@ static int wave5_vpu_open_dec(struct file *filp) struct v4l2_m2m_ctx *m2m_ctx; int ret = 0; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; @@ -1834,7 +1834,7 @@ static int wave5_vpu_open_dec(struct file *filp) mutex_init(&inst->feed_lock); INIT_LIST_HEAD(&inst->avail_src_bufs); - inst->codec_info = kzalloc(sizeof(*inst->codec_info), GFP_KERNEL); + inst->codec_info = kzalloc_obj(*inst->codec_info, GFP_KERNEL); if (!inst->codec_info) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c index 24fc0d0d3f4a..f9373ed9a97b 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c @@ -1571,7 +1571,7 @@ static int wave5_vpu_open_enc(struct file *filp) struct v4l2_ctrl_handler *v4l2_ctrl_hdl; int ret = 0; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; v4l2_ctrl_hdl = &inst->v4l2_ctrl_hdl; @@ -1580,7 +1580,7 @@ static int wave5_vpu_open_enc(struct file *filp) inst->type = VPU_INST_TYPE_ENC; inst->ops = &wave5_vpu_enc_inst_ops; - inst->codec_info = kzalloc(sizeof(*inst->codec_info), GFP_KERNEL); + inst->codec_info = kzalloc_obj(*inst->codec_info, GFP_KERNEL); if (!inst->codec_info) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c index 1c6e076033ec..803470d12bdb 100644 --- a/drivers/media/platform/imagination/e5010-jpeg-enc.c +++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c @@ -728,7 +728,7 @@ static int e5010_open(struct file *file) struct e5010_context *ctx; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index bef1e7137f23..dbd465708f6f 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -741,7 +741,7 @@ static struct pxa_camera_format_xlate *pxa_mbus_build_fmts_xlate( if (!fmts) return ERR_PTR(-ENXIO); - user_formats = kcalloc(fmts + 1, sizeof(*user_formats), GFP_KERNEL); + user_formats = kzalloc_objs(*user_formats, fmts + 1, GFP_KERNEL); if (!user_formats) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index af098874ead5..568193243869 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -835,7 +835,7 @@ static int deinterlace_open(struct file *file) struct deinterlace_dev *pcdev = video_drvdata(file); struct deinterlace_ctx *ctx = NULL; - ctx = kzalloc(sizeof *ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/marvell/cafe-driver.c b/drivers/media/platform/marvell/cafe-driver.c index f9796de92aa7..a447099b40cc 100644 --- a/drivers/media/platform/marvell/cafe-driver.c +++ b/drivers/media/platform/marvell/cafe-driver.c @@ -327,7 +327,7 @@ static int cafe_smbus_setup(struct cafe_camera *cam) struct i2c_adapter *adap; int ret; - adap = kzalloc(sizeof(*adap), GFP_KERNEL); + adap = kzalloc_obj(*adap, GFP_KERNEL); if (adap == NULL) return -ENOMEM; adap->owner = THIS_MODULE; @@ -485,7 +485,7 @@ static int cafe_pci_probe(struct pci_dev *pdev, * Start putting together one of our big camera structures. */ ret = -ENOMEM; - cam = kzalloc(sizeof(struct cafe_camera), GFP_KERNEL); + cam = kzalloc_obj(struct cafe_camera, GFP_KERNEL); if (cam == NULL) goto out; pci_set_drvdata(pdev, cam); diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index d08fe365cbb2..7a506b1f03da 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1151,7 +1151,7 @@ static int mtk_jpeg_open(struct file *file) struct mtk_jpeg_ctx *ctx; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c index 03c07948dfdd..e069e326d2bd 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c @@ -1053,7 +1053,7 @@ static int mtk_mdp_m2m_open(struct file *file) int ret; struct v4l2_format default_format; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index e5ccf673e152..d4dd2cad0d7f 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -564,7 +564,7 @@ static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, goto err_uninit; } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto err_uninit; @@ -583,13 +583,13 @@ static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, goto err_destroy_pkt; } - comps = kcalloc(num_comp, sizeof(*comps), GFP_KERNEL); + comps = kzalloc_objs(*comps, num_comp, GFP_KERNEL); if (!comps) { ret = -ENOMEM; goto err_destroy_pkt; } - path = kzalloc(sizeof(*path), GFP_KERNEL); + path = kzalloc_obj(*path, GFP_KERNEL); if (!path) { ret = -ENOMEM; goto err_free_comps; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index f20d2ed1f2bb..978bf12cc1d0 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -221,7 +221,7 @@ static int mdp_probe(struct platform_device *pdev) struct resource *res; int ret, i, mutex_id; - mdp = kzalloc(sizeof(*mdp), GFP_KERNEL); + mdp = kzalloc_obj(*mdp, GFP_KERNEL); if (!mdp) { ret = -ENOMEM; goto err_return; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c index 44140987cf5f..bb8f70a42f32 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c @@ -568,7 +568,7 @@ static int mdp_m2m_open(struct file *file) struct v4l2_format default_format = {}; const struct mdp_limit *limit = mdp->mdp_data->def_limit; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c index 643d6fff088b..c4566eb52db8 100644 --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c @@ -149,7 +149,7 @@ void mtk_vcodec_dbgfs_create(struct mtk_vcodec_dec_ctx *ctx) struct mtk_vcodec_dbgfs_inst *dbgfs_inst; struct mtk_vcodec_dec_dev *vcodec_dev = ctx->dev; - dbgfs_inst = kzalloc(sizeof(*dbgfs_inst), GFP_KERNEL); + dbgfs_inst = kzalloc_obj(*dbgfs_inst, GFP_KERNEL); if (!dbgfs_inst) return; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c index 3b81fae9f913..066bb304a34c 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c @@ -200,7 +200,7 @@ static int fops_vcodec_open(struct file *file) struct vb2_queue *src_vq; unsigned long flags; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c index 8e1cf16a168a..85b88aa45f5b 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c @@ -735,7 +735,7 @@ static struct media_request *fops_media_request_alloc(struct media_device *mdev) { struct mtk_vcodec_dec_request *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); return &req->req; } diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c index 7be4b6086920..a3ea4d2a9fb0 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c @@ -1879,7 +1879,7 @@ static int vdec_av1_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_av1_slice_init_vsi *vsi; int ret; - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c index 795cb19b075d..a754b96ae84b 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c @@ -270,7 +270,7 @@ static int vdec_h264_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_h264_inst *inst = NULL; int err; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c index b9a5ea7887d3..9cf7ff35731e 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c @@ -273,7 +273,7 @@ static int vdec_h264_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_h264_slice_inst *inst; int err; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c index 9a9dc2f88d6e..d761e70f5933 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c @@ -1208,7 +1208,7 @@ static int vdec_h264_slice_init(struct mtk_vcodec_dec_ctx *ctx) int err, vsi_size; unsigned char *temp; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c index 88eca50c2017..1c925deaa721 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c @@ -858,7 +858,7 @@ static int vdec_hevc_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_hevc_slice_inst *inst; int err, vsi_size; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c index 5f848691cea4..af5bd3c24729 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c @@ -390,7 +390,7 @@ static int vdec_vp8_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp8_inst *inst; int err; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c index e1d4960553f2..27d6af7836b9 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c @@ -275,7 +275,7 @@ static int vdec_vp8_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp8_slice_inst *inst; int err; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c index cd1935014d76..1b4bc0f60b8b 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c @@ -1848,7 +1848,7 @@ static int vdec_vp9_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp9_slice_init_vsi *vsi; int ret; - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c index 82b8ff38e8f1..c02cdb7acd63 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c @@ -119,7 +119,7 @@ static int fops_vcodec_open(struct file *file) struct vb2_queue *src_vq; unsigned long flags; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c index 0f63657d8bad..d7630d9ae305 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c @@ -588,7 +588,7 @@ static int h264_enc_init(struct mtk_vcodec_enc_ctx *ctx) int ret = 0; struct venc_h264_inst *inst; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c index 05abca91e742..b85b177ebcce 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c @@ -316,7 +316,7 @@ static int vp8_enc_init(struct mtk_vcodec_enc_ctx *ctx) int ret = 0; struct venc_vp8_inst *inst; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c index 44e904e61801..eccd92774344 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -411,7 +411,7 @@ static unsigned int npcm_video_add_rect(struct npcm_video *video, struct rect_list *list = NULL; struct v4l2_rect *r; - list = kzalloc(sizeof(*list), GFP_KERNEL); + list = kzalloc_obj(*list, GFP_KERNEL); if (!list) return 0; @@ -466,7 +466,7 @@ static struct rect_list *npcm_video_new_rect(struct npcm_video *video, struct rect_list *list = NULL; struct v4l2_rect *r; - list = kzalloc(sizeof(*list), GFP_KERNEL); + list = kzalloc_obj(*list, GFP_KERNEL); if (!list) return NULL; @@ -1733,7 +1733,7 @@ static int npcm_video_init(struct npcm_video *video) static int npcm_video_probe(struct platform_device *pdev) { - struct npcm_video *video = kzalloc(sizeof(*video), GFP_KERNEL); + struct npcm_video *video = kzalloc_obj(*video, GFP_KERNEL); int rc; void __iomem *regs; diff --git a/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c b/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c index b34244ea14dd..4e4b8c09d5be 100644 --- a/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +++ b/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c @@ -115,7 +115,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unmap; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto err_unmap; diff --git a/drivers/media/platform/nvidia/tegra-vde/v4l2.c b/drivers/media/platform/nvidia/tegra-vde/v4l2.c index d94978ae2baf..d877802352d3 100644 --- a/drivers/media/platform/nvidia/tegra-vde/v4l2.c +++ b/drivers/media/platform/nvidia/tegra-vde/v4l2.c @@ -811,8 +811,7 @@ static int tegra_open(struct file *file) struct tegra_ctx *ctx; int err; - ctx = kzalloc(struct_size(ctx, ctrls, ARRAY_SIZE(ctrl_cfgs)), - GFP_KERNEL); + ctx = kzalloc_flex(*ctx, ctrls, ARRAY_SIZE(ctrl_cfgs), GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nvidia/tegra-vde/vde.c b/drivers/media/platform/nvidia/tegra-vde/vde.c index 3232392c60e2..a1d4a1ab12f9 100644 --- a/drivers/media/platform/nvidia/tegra-vde/vde.c +++ b/drivers/media/platform/nvidia/tegra-vde/vde.c @@ -61,7 +61,7 @@ int tegra_vde_alloc_bo(struct tegra_vde *vde, struct tegra_vde_bo *bo; int err; - bo = kzalloc(sizeof(*bo), GFP_KERNEL); + bo = kzalloc_obj(*bo, GFP_KERNEL); if (!bo) return -ENOMEM; diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c index 4aaf9c3fff53..cf20f1ffc1d1 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -601,7 +601,7 @@ static int dw100_open(struct file *file) struct v4l2_pix_format_mplane *pix_fmt; int ret, i; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index b558700d1d96..100320ddf545 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -2200,7 +2200,7 @@ static int mxc_jpeg_open(struct file *file) struct mxc_jpeg_ctx *ctx; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index 3f9a67a6bd4d..ad31a3459b94 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -1646,7 +1646,7 @@ static int pxp_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto open_unlock; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c index 18146978bdf5..87346979ef09 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c @@ -474,8 +474,8 @@ static int mxc_isi_probe(struct platform_device *pdev) isi->pdata = of_device_get_match_data(dev); - isi->pipes = kcalloc(isi->pdata->num_channels, sizeof(isi->pipes[0]), - GFP_KERNEL); + isi->pipes = kzalloc_objs(isi->pipes[0], isi->pdata->num_channels, + GFP_KERNEL); if (!isi->pipes) return -ENOMEM; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c index 3c26cfef93d1..2cd014a79006 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c @@ -189,7 +189,7 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd, * pipelines by default. */ routing.num_routes = min(xbar->num_sinks - 1, xbar->num_sources); - routes = kcalloc(routing.num_routes, sizeof(*routes), GFP_KERNEL); + routes = kzalloc_objs(*routes, routing.num_routes, GFP_KERNEL); if (!routes) return -ENOMEM; @@ -454,12 +454,11 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi) xbar->num_sources = isi->pdata->num_channels; num_pads = xbar->num_sinks + xbar->num_sources; - xbar->pads = kcalloc(num_pads, sizeof(*xbar->pads), GFP_KERNEL); + xbar->pads = kzalloc_objs(*xbar->pads, num_pads, GFP_KERNEL); if (!xbar->pads) return -ENOMEM; - xbar->inputs = kcalloc(xbar->num_sinks, sizeof(*xbar->inputs), - GFP_KERNEL); + xbar->inputs = kzalloc_objs(*xbar->inputs, xbar->num_sinks, GFP_KERNEL); if (!xbar->inputs) { ret = -ENOMEM; goto err_free; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c index f425ac786854..e6ad1044b954 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c @@ -624,7 +624,7 @@ static int mxc_isi_m2m_open(struct file *file) struct mxc_isi_m2m_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/mx2_emmaprp.c b/drivers/media/platform/nxp/mx2_emmaprp.c index 02d57229b9b3..8f588688f049 100644 --- a/drivers/media/platform/nxp/mx2_emmaprp.c +++ b/drivers/media/platform/nxp/mx2_emmaprp.c @@ -718,7 +718,7 @@ static int emmaprp_open(struct file *file) struct emmaprp_dev *pcdev = video_drvdata(file); struct emmaprp_ctx *ctx; - ctx = kzalloc(sizeof *ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c index f1f003a787bf..f0fdba0ae987 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -342,7 +342,7 @@ static int iris_create_internal_buffer(struct iris_inst *inst, if (!buffers->size) return 0; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c index 11815f6f5bac..abffd20cf25b 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c @@ -1087,5 +1087,5 @@ void iris_hfi_gen1_command_ops_init(struct iris_core *core) struct iris_inst *iris_hfi_gen1_get_instance(void) { - return kzalloc(sizeof(struct iris_inst), GFP_KERNEL); + return kzalloc_obj(struct iris_inst, GFP_KERNEL); } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c index 715ec9575b90..d45cecd5e544 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -1329,7 +1329,7 @@ struct iris_inst *iris_hfi_gen2_get_instance(void) struct iris_inst_hfi_gen2 *out; /* The allocation is intentionally larger than struct iris_inst. */ - out = kzalloc(sizeof(*out), GFP_KERNEL); + out = kzalloc_obj(*out, GFP_KERNEL); return &out->inst; } diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c index 467d00044a2f..3cfbdc04d3a9 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -21,8 +21,8 @@ int iris_vdec_inst_init(struct iris_inst *inst) struct iris_core *core = inst->core; struct v4l2_format *f; - inst->fmt_src = kzalloc(sizeof(*inst->fmt_src), GFP_KERNEL); - inst->fmt_dst = kzalloc(sizeof(*inst->fmt_dst), GFP_KERNEL); + inst->fmt_src = kzalloc_obj(*inst->fmt_src, GFP_KERNEL); + inst->fmt_dst = kzalloc_obj(*inst->fmt_dst, GFP_KERNEL); inst->fw_min_count = MIN_BUFFERS; diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c index 6461d9c9d598..d3531a3cc2a2 100644 --- a/drivers/media/platform/qcom/iris/iris_venc.c +++ b/drivers/media/platform/qcom/iris/iris_venc.c @@ -19,8 +19,8 @@ int iris_venc_inst_init(struct iris_inst *inst) struct iris_core *core = inst->core; struct v4l2_format *f; - inst->fmt_src = kzalloc(sizeof(*inst->fmt_src), GFP_KERNEL); - inst->fmt_dst = kzalloc(sizeof(*inst->fmt_dst), GFP_KERNEL); + inst->fmt_src = kzalloc_obj(*inst->fmt_src, GFP_KERNEL); + inst->fmt_dst = kzalloc_obj(*inst->fmt_dst, GFP_KERNEL); if (!inst->fmt_src || !inst->fmt_dst) { kfree(inst->fmt_src); kfree(inst->fmt_dst); diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 24d2b2fd0340..db3536956131 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -213,7 +213,7 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) if (core->res->hfi_version != HFI_VERSION_1XX) return 0; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; @@ -329,7 +329,7 @@ static int venus_add_dynamic_nodes(struct venus_core *core) struct device *dev = core->dev; int ret; - core->ocs = kmalloc(sizeof(*core->ocs), GFP_KERNEL); + core->ocs = kmalloc_obj(*core->ocs, GFP_KERNEL); if (!core->ocs) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 2e4363f82231..f4223470f0dd 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -192,7 +192,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) count = hfi_bufreq_get_count_min(&bufreq, ver); for (i = 0; i < count; i++) { - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto fail; @@ -248,7 +248,7 @@ static int intbufs_set_buffer(struct venus_inst *inst, u32 type) return 0; for (i = 0; i < bufreq.count_actual; i++) { - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto fail; diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index d3da35f67fd5..a6cf17e379f7 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1702,7 +1702,7 @@ int venus_hfi_create(struct venus_core *core) struct venus_hfi_device *hdev; int ret; - hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); + hdev = kzalloc_obj(*hdev, GFP_KERNEL); if (!hdev) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 21ca4947a849..3f46e2d8ccce 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1684,7 +1684,7 @@ static int vdec_open(struct file *file) struct venus_inst *inst; int ret; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 0b5843ba536f..32185f29eee5 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1466,7 +1466,7 @@ static int venc_open(struct file *file) struct venus_inst *inst; int ret; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c index 62dca76b468d..a02a966d9c3b 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c @@ -2279,7 +2279,7 @@ static int cfe_probe(struct platform_device *pdev) char debugfs_name[32]; int ret; - cfe = kzalloc(sizeof(*cfe), GFP_KERNEL); + cfe = kzalloc_obj(*cfe, GFP_KERNEL); if (!cfe) return -ENOMEM; diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c index 100105b620e3..36421defa598 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c @@ -128,7 +128,7 @@ static int rvin_group_get(struct rvin_dev *vin, group = rvin_group_data; kref_get(&group->refcount); } else { - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) { ret = -ENOMEM; goto err_group; diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c index 672869815f63..791cff4a48ea 100644 --- a/drivers/media/platform/renesas/rcar_fdp1.c +++ b/drivers/media/platform/renesas/rcar_fdp1.c @@ -2078,7 +2078,7 @@ static int fdp1_open(struct file *file) if (mutex_lock_interruptible(&fdp1->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto done; diff --git a/drivers/media/platform/renesas/rcar_jpu.c b/drivers/media/platform/renesas/rcar_jpu.c index a6d26b446494..3a3aa6bba9d2 100644 --- a/drivers/media/platform/renesas/rcar_jpu.c +++ b/drivers/media/platform/renesas/rcar_jpu.c @@ -1212,7 +1212,7 @@ static int jpu_open(struct file *file) struct jpu_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index deed49d0fb10..a827a4cf6826 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1616,7 +1616,7 @@ static int ceu_probe(struct platform_device *pdev) int num_subdevs; int ret; - ceudev = kzalloc(sizeof(*ceudev), GFP_KERNEL); + ceudev = kzalloc_obj(*ceudev, GFP_KERNEL); if (!ceudev) return -ENOMEM; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_dl.c b/drivers/media/platform/renesas/vsp1/vsp1_dl.c index d732b4ed1180..f6b5623bf7d5 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_dl.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_dl.c @@ -259,7 +259,7 @@ vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies, size_t dlb_size; unsigned int i; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -274,7 +274,7 @@ vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies, dlb_size = num_entries * sizeof(struct vsp1_dl_entry) + extra_size; pool->size = dlb_size * num_bodies; - pool->bodies = kcalloc(num_bodies, sizeof(*pool->bodies), GFP_KERNEL); + pool->bodies = kzalloc_objs(*pool->bodies, num_bodies, GFP_KERNEL); if (!pool->bodies) { kfree(pool); return NULL; @@ -434,7 +434,7 @@ vsp1_dl_cmd_pool_create(struct vsp1_device *vsp1, enum vsp1_extcmd_type type, unsigned int i; size_t cmd_size; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -443,7 +443,7 @@ vsp1_dl_cmd_pool_create(struct vsp1_device *vsp1, enum vsp1_extcmd_type type, spin_lock_init(&pool->lock); INIT_LIST_HEAD(&pool->free); - pool->cmds = kcalloc(num_cmds, sizeof(*pool->cmds), GFP_KERNEL); + pool->cmds = kzalloc_objs(*pool->cmds, num_cmds, GFP_KERNEL); if (!pool->cmds) { kfree(pool); return NULL; @@ -557,7 +557,7 @@ static struct vsp1_dl_list *vsp1_dl_list_alloc(struct vsp1_dl_manager *dlm) struct vsp1_dl_list *dl; size_t header_offset; - dl = kzalloc(sizeof(*dl), GFP_KERNEL); + dl = kzalloc_obj(*dl, GFP_KERNEL); if (!dl) return NULL; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c index 75f9a1a85d55..e1f1c2a933ab 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_video.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c @@ -565,7 +565,7 @@ static struct vsp1_pipeline *vsp1_video_pipeline_get(struct vsp1_video *video) * when the last reference is released. */ if (!video->rwpf->entity.pipe) { - pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); + pipe = kzalloc_obj(*pipe, GFP_KERNEL); if (!pipe) return ERR_PTR(-ENOMEM); @@ -720,8 +720,8 @@ static int vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe) } pipe->partitions = DIV_ROUND_UP(format->width, div_size); - pipe->part_table = kcalloc(pipe->partitions, sizeof(*pipe->part_table), - GFP_KERNEL); + pipe->part_table = kzalloc_objs(*pipe->part_table, pipe->partitions, + GFP_KERNEL); if (!pipe->part_table) return -ENOMEM; @@ -1074,7 +1074,7 @@ static int vsp1_video_open(struct file *file) struct v4l2_fh *vfh; int ret = 0; - vfh = kzalloc(sizeof(*vfh), GFP_KERNEL); + vfh = kzalloc_obj(*vfh, GFP_KERNEL); if (vfh == NULL) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c index 43f6a8d99381..736072635ed5 100644 --- a/drivers/media/platform/rockchip/rga/rga.c +++ b/drivers/media/platform/rockchip/rga/rga.c @@ -370,7 +370,7 @@ static int rga_open(struct file *file) struct rga_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->rga = rga; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c index a1af12c97914..377607c94092 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c @@ -375,7 +375,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc(sizeof(*h264_ctx), GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c index 3276f584f5c7..abb695ebe258 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c @@ -528,7 +528,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) struct rkvdec_hevc_priv_tbl *priv_tbl; struct rkvdec_hevc_ctx *hevc_ctx; - hevc_ctx = kzalloc(sizeof(*hevc_ctx), GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c index cd0aa3f3a13d..218377f91a0b 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c @@ -383,7 +383,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc(sizeof(*h264_ctx), GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c index 5f1c11ffb9f0..b5f20c8d4285 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c @@ -551,7 +551,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) if (ret) return ret; - hevc_ctx = kzalloc(sizeof(*hevc_ctx), GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c index 6ab3167addc8..bb53163efe41 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c @@ -447,7 +447,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc(sizeof(*h264_ctx), GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c index 085c0a63a80c..0e5a58e48608 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c @@ -559,7 +559,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) if (ret) return ret; - hevc_ctx = kzalloc(sizeof(*hevc_ctx), GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c index ba51a7c2fe55..1e66333e4589 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c @@ -971,7 +971,7 @@ static int rkvdec_vp9_start(struct rkvdec_ctx *ctx) unsigned char *count_tbl; int ret; - vp9_ctx = kzalloc(sizeof(*vp9_ctx), GFP_KERNEL); + vp9_ctx = kzalloc_obj(*vp9_ctx, GFP_KERNEL); if (!vp9_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c index 967c452ab61f..2d4493434077 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c @@ -1282,7 +1282,7 @@ static int rkvdec_open(struct file *filp) struct rkvdec_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c b/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c index 722e2531e23f..9d15a2115c23 100644 --- a/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c @@ -612,7 +612,7 @@ static int gsc_m2m_open(struct file *file) if (mutex_lock_interruptible(&gsc->lock)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index 5b412afd7d60..0b8327e4a875 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -1718,7 +1718,7 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, struct fimc_ctx *ctx; int ret = -ENOMEM; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index 562c57f186c6..2aa9c22df72b 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -616,7 +616,7 @@ static int fimc_m2m_open(struct file *file) if (test_bit(ST_CAPT_BUSY, &fimc->state)) goto unlock; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c index bc7087eb761a..56d8b7cd3b5a 100644 --- a/drivers/media/platform/samsung/exynos4-is/media-dev.c +++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c @@ -373,7 +373,7 @@ static struct exynos_media_pipeline *fimc_md_pipeline_create( { struct fimc_pipeline *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return NULL; diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c index e765dfcc2830..a1d6315d8c4a 100644 --- a/drivers/media/platform/samsung/s5p-g2d/g2d.c +++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c @@ -237,7 +237,7 @@ static int g2d_open(struct file *file) struct g2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c index ff28482759ec..68250d7bb02d 100644 --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c @@ -953,7 +953,7 @@ static int s5p_jpeg_open(struct file *file) struct s5p_jpeg_fmt *out_fmt, *cap_fmt; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 4948d734eb02..e79441f01a51 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -794,7 +794,7 @@ static int s5p_mfc_open(struct file *file) } dev->num_inst++; /* It is guarded by mfc_mutex in vfd */ /* Allocate memory for context */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c index 56169b70652d..6f7b3f0db48e 100644 --- a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c @@ -583,7 +583,7 @@ static int bdisp_open(struct file *file) return -ERESTARTSYS; /* Allocate memory for both context and node */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c b/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c index a078f1107300..ed05feac6944 100644 --- a/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c +++ b/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c @@ -324,7 +324,7 @@ static int delta_mjpeg_open(struct delta_ctx *pctx) { struct delta_mjpeg_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; pctx->priv = ctx; diff --git a/drivers/media/platform/st/sti/delta/delta-v4l2.c b/drivers/media/platform/st/sti/delta/delta-v4l2.c index 6c1a53c771f7..b3fb25bd0f60 100644 --- a/drivers/media/platform/st/sti/delta/delta-v4l2.c +++ b/drivers/media/platform/st/sti/delta/delta-v4l2.c @@ -164,7 +164,7 @@ static void delta_push_dts(struct delta_ctx *ctx, u64 val) { struct delta_dts *dts; - dts = kzalloc(sizeof(*dts), GFP_KERNEL); + dts = kzalloc_obj(*dts, GFP_KERNEL); if (!dts) return; @@ -1629,7 +1629,7 @@ static int delta_open(struct file *file) mutex_lock(&delta->lock); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto err; diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c index 3581b73a99b8..4b2100b7242b 100644 --- a/drivers/media/platform/st/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c @@ -1165,7 +1165,7 @@ static int hva_open(struct file *file) struct hva_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto out; diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c index 72488aa922fc..fb11794c6b17 100644 --- a/drivers/media/platform/st/stm32/dma2d/dma2d.c +++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c @@ -280,7 +280,7 @@ static int dma2d_open(struct file *file) struct dma2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c index 19e6b187be22..ccf3c19883c0 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c @@ -867,7 +867,7 @@ struct dcmipp_ent_device *dcmipp_bytecap_ent_init(struct device *dev, int ret = 0; /* Allocate the dcmipp_bytecap_device struct */ - vcap = kzalloc(sizeof(*vcap), GFP_KERNEL); + vcap = kzalloc_obj(*vcap, GFP_KERNEL); if (!vcap) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c index f9e4a3a9ef3f..4704cc4d6111 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c @@ -581,7 +581,7 @@ dcmipp_byteproc_ent_init(struct device *dev, const char *entity_name, int ret; /* Allocate the byteproc struct */ - byteproc = kzalloc(sizeof(*byteproc), GFP_KERNEL); + byteproc = kzalloc_obj(*byteproc, GFP_KERNEL); if (!byteproc) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c index 562933e08d62..f6e83e72c940 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c @@ -20,7 +20,7 @@ struct media_pad *dcmipp_pads_init(u16 num_pads, const unsigned long *pads_flags unsigned int i; /* Allocate memory for the pads */ - pads = kcalloc(num_pads, sizeof(*pads), GFP_KERNEL); + pads = kzalloc_objs(*pads, num_pads, GFP_KERNEL); if (!pads) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c index c4bc76909b1c..ac19ed966521 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c @@ -527,7 +527,7 @@ struct dcmipp_ent_device *dcmipp_inp_ent_init(struct device *dev, int ret; /* Allocate the inp struct */ - inp = kzalloc(sizeof(*inp), GFP_KERNEL); + inp = kzalloc_obj(*inp, GFP_KERNEL); if (!inp) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index 7c4dd1ac772d..a2e4dae765ee 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -709,7 +709,7 @@ static int deinterlace_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index 2deab920884a..05b51e5fc01f 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -642,7 +642,7 @@ static int rotate_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/media/platform/ti/cal/cal.c b/drivers/media/platform/ti/cal/cal.c index 3e25ce0c3c3b..c0883b948cbc 100644 --- a/drivers/media/platform/ti/cal/cal.c +++ b/drivers/media/platform/ti/cal/cal.c @@ -1012,7 +1012,7 @@ static struct cal_ctx *cal_ctx_create(struct cal_dev *cal, int inst) struct cal_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c index 969d623fc842..f0d724efb494 100644 --- a/drivers/media/platform/ti/davinci/vpif.c +++ b/drivers/media/platform/ti/davinci/vpif.c @@ -450,7 +450,7 @@ static int vpif_probe(struct platform_device *pdev) if (IS_ERR(vpif_base)) return PTR_ERR(vpif_base); - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -482,7 +482,7 @@ static int vpif_probe(struct platform_device *pdev) res_irq = DEFINE_RES_IRQ_NAMED(irq, of_node_full_name(pdev->dev.of_node)); res_irq.flags |= irq_get_trigger_type(irq); - pdev_capture = kzalloc(sizeof(*pdev_capture), GFP_KERNEL); + pdev_capture = kzalloc_obj(*pdev_capture, GFP_KERNEL); if (!pdev_capture) { ret = -ENOMEM; goto err_put_rpm; @@ -501,7 +501,7 @@ static int vpif_probe(struct platform_device *pdev) if (ret) goto err_put_pdev_capture; - pdev_display = kzalloc(sizeof(*pdev_display), GFP_KERNEL); + pdev_display = kzalloc_obj(*pdev_display, GFP_KERNEL); if (!pdev_display) { ret = -ENOMEM; goto err_del_pdev_capture; diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index 243c6196b024..6b7d19a7529a 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1335,8 +1335,7 @@ static int initialize_vpif(void) /* Allocate memory for six channel objects */ for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { - vpif_obj.dev[i] = - kzalloc(sizeof(*vpif_obj.dev[i]), GFP_KERNEL); + vpif_obj.dev[i] = kzalloc_obj(*vpif_obj.dev[i], GFP_KERNEL); /* If memory allocation fails, return error */ if (!vpif_obj.dev[i]) { free_channel_objects_index = i; @@ -1651,7 +1650,7 @@ static int vpif_probe(struct platform_device *pdev) vpif_obj.config = pdev->dev.platform_data; subdev_count = vpif_obj.config->subdev_count; - vpif_obj.sd = kcalloc(subdev_count, sizeof(*vpif_obj.sd), GFP_KERNEL); + vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count, GFP_KERNEL); if (!vpif_obj.sd) { err = -ENOMEM; goto probe_subdev_out; diff --git a/drivers/media/platform/ti/davinci/vpif_display.c b/drivers/media/platform/ti/davinci/vpif_display.c index 1e7815e9f8e0..b8349ebcde33 100644 --- a/drivers/media/platform/ti/davinci/vpif_display.c +++ b/drivers/media/platform/ti/davinci/vpif_display.c @@ -1089,7 +1089,7 @@ static int initialize_vpif(void) /* Allocate memory for six channel objects */ for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { vpif_obj.dev[i] = - kzalloc(sizeof(struct channel_obj), GFP_KERNEL); + kzalloc_obj(struct channel_obj, GFP_KERNEL); /* If memory allocation fails, return error */ if (!vpif_obj.dev[i]) { free_channel_objects_index = i; @@ -1264,7 +1264,7 @@ static int vpif_probe(struct platform_device *pdev) vpif_obj.config = pdev->dev.platform_data; subdev_count = vpif_obj.config->subdev_count; subdevdata = vpif_obj.config->subdevinfo; - vpif_obj.sd = kcalloc(subdev_count, sizeof(*vpif_obj.sd), GFP_KERNEL); + vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count, GFP_KERNEL); if (!vpif_obj.sd) { err = -ENOMEM; goto vpif_unregister; diff --git a/drivers/media/platform/ti/omap/omap_vout.c b/drivers/media/platform/ti/omap/omap_vout.c index 22782e9f1f4e..b88c78d724d6 100644 --- a/drivers/media/platform/ti/omap/omap_vout.c +++ b/drivers/media/platform/ti/omap/omap_vout.c @@ -1452,7 +1452,7 @@ static int __init omap_vout_create_video_devices(struct platform_device *pdev) for (k = 0; k < pdev->num_resources; k++) { - vout = kzalloc(sizeof(struct omap_vout_device), GFP_KERNEL); + vout = kzalloc_obj(struct omap_vout_device, GFP_KERNEL); if (!vout) { dev_err(&pdev->dev, ": could not allocate memory\n"); return -ENOMEM; @@ -1611,7 +1611,7 @@ static int __init omap_vout_probe(struct platform_device *pdev) goto err_dss_init; } - vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL); + vid_dev = kzalloc_obj(struct omap2video_device, GFP_KERNEL); if (vid_dev == NULL) { ret = -ENOMEM; goto err_dss_init; diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c index 8ac2bdcdf87b..23a433455459 100644 --- a/drivers/media/platform/ti/omap3isp/isp.c +++ b/drivers/media/platform/ti/omap3isp/isp.c @@ -2231,7 +2231,7 @@ static int isp_probe(struct platform_device *pdev) int ret; int i, m; - isp = kzalloc(sizeof(*isp), GFP_KERNEL); + isp = kzalloc_obj(*isp, GFP_KERNEL); if (!isp) { dev_err(&pdev->dev, "could not allocate memory\n"); return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispccdc.c b/drivers/media/platform/ti/omap3isp/ispccdc.c index 9dbf06ac058d..2e2daadbd575 100644 --- a/drivers/media/platform/ti/omap3isp/ispccdc.c +++ b/drivers/media/platform/ti/omap3isp/ispccdc.c @@ -419,7 +419,7 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc, return -EINVAL; } - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (req == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/isph3a_aewb.c b/drivers/media/platform/ti/omap3isp/isph3a_aewb.c index ae93da9c4542..1da1b71773bb 100644 --- a/drivers/media/platform/ti/omap3isp/isph3a_aewb.c +++ b/drivers/media/platform/ti/omap3isp/isph3a_aewb.c @@ -291,7 +291,7 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) struct omap3isp_h3a_aewb_config *aewb_recover_cfg = NULL; int ret; - aewb_cfg = kzalloc(sizeof(*aewb_cfg), GFP_KERNEL); + aewb_cfg = kzalloc_obj(*aewb_cfg, GFP_KERNEL); if (!aewb_cfg) return -ENOMEM; @@ -301,7 +301,7 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) aewb->isp = isp; /* Set recover state configuration */ - aewb_recover_cfg = kzalloc(sizeof(*aewb_recover_cfg), GFP_KERNEL); + aewb_recover_cfg = kzalloc_obj(*aewb_recover_cfg, GFP_KERNEL); if (!aewb_recover_cfg) { dev_err(aewb->isp->dev, "AEWB: cannot allocate memory for recover configuration.\n"); diff --git a/drivers/media/platform/ti/omap3isp/isph3a_af.c b/drivers/media/platform/ti/omap3isp/isph3a_af.c index ca478da4ad34..ff806d162529 100644 --- a/drivers/media/platform/ti/omap3isp/isph3a_af.c +++ b/drivers/media/platform/ti/omap3isp/isph3a_af.c @@ -354,7 +354,7 @@ int omap3isp_h3a_af_init(struct isp_device *isp) struct omap3isp_h3a_af_config *af_recover_cfg = NULL; int ret; - af_cfg = kzalloc(sizeof(*af_cfg), GFP_KERNEL); + af_cfg = kzalloc_obj(*af_cfg, GFP_KERNEL); if (af_cfg == NULL) return -ENOMEM; @@ -364,7 +364,7 @@ int omap3isp_h3a_af_init(struct isp_device *isp) af->isp = isp; /* Set recover state configuration */ - af_recover_cfg = kzalloc(sizeof(*af_recover_cfg), GFP_KERNEL); + af_recover_cfg = kzalloc_obj(*af_recover_cfg, GFP_KERNEL); if (!af_recover_cfg) { dev_err(af->isp->dev, "AF: cannot allocate memory for recover configuration.\n"); diff --git a/drivers/media/platform/ti/omap3isp/isphist.c b/drivers/media/platform/ti/omap3isp/isphist.c index 7851ad13d84f..8459fd9d5fc4 100644 --- a/drivers/media/platform/ti/omap3isp/isphist.c +++ b/drivers/media/platform/ti/omap3isp/isphist.c @@ -477,7 +477,7 @@ int omap3isp_hist_init(struct isp_device *isp) struct omap3isp_hist_config *hist_cfg; int ret; - hist_cfg = kzalloc(sizeof(*hist_cfg), GFP_KERNEL); + hist_cfg = kzalloc_obj(*hist_cfg, GFP_KERNEL); if (hist_cfg == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index 64bc71d830c4..ad34cc2c6f05 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -1047,7 +1047,7 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name, { int ret; - stat->buf = kcalloc(STAT_MAX_BUFS, sizeof(*stat->buf), GFP_KERNEL); + stat->buf = kzalloc_objs(*stat->buf, STAT_MAX_BUFS, GFP_KERNEL); if (!stat->buf) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispvideo.c b/drivers/media/platform/ti/omap3isp/ispvideo.c index 86cb27b6ca4e..f2a48387d158 100644 --- a/drivers/media/platform/ti/omap3isp/ispvideo.c +++ b/drivers/media/platform/ti/omap3isp/ispvideo.c @@ -1371,7 +1371,7 @@ static int isp_video_open(struct file *file) struct vb2_queue *queue; int ret = 0; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (handle == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/vpe/vip.c b/drivers/media/platform/ti/vpe/vip.c index d4236ac6d867..33805f3b0a81 100644 --- a/drivers/media/platform/ti/vpe/vip.c +++ b/drivers/media/platform/ti/vpe/vip.c @@ -3035,7 +3035,7 @@ static int alloc_stream(struct vip_port *port, int stream_id, int vfl_type) struct list_head *pos, *tmp; int ret, i; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; @@ -3079,7 +3079,7 @@ static int alloc_stream(struct vip_port *port, int stream_id, int vfl_type) /* Allocate/populate Drop queue entries */ INIT_LIST_HEAD(&stream->dropq); for (i = 0; i < VIP_DROPQ_SIZE; i++) { - buf = kzalloc(sizeof(*buf), GFP_ATOMIC); + buf = kzalloc_obj(*buf, GFP_ATOMIC); if (!buf) { ret = -ENOMEM; goto do_free_dropq; diff --git a/drivers/media/platform/ti/vpe/vpe.c b/drivers/media/platform/ti/vpe/vpe.c index 1a549775cabe..5effa0558f0f 100644 --- a/drivers/media/platform/ti/vpe/vpe.c +++ b/drivers/media/platform/ti/vpe/vpe.c @@ -2272,7 +2272,7 @@ static int vpe_open(struct file *file) vpe_dbg(dev, "vpe_open\n"); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 94f58f4e4a4e..0a14970f0472 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -640,7 +640,7 @@ static int hantro_open(struct file *filp) * helper functions used here. */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c index 5702eff664d4..fe8d94906e37 100644 --- a/drivers/media/platform/via/via-camera.c +++ b/drivers/media/platform/via/via-camera.c @@ -1164,7 +1164,7 @@ static int viacam_probe(struct platform_device *pdev) /* * Basic structure initialization. */ - cam = kzalloc (sizeof(struct via_camera), GFP_KERNEL); + cam = kzalloc_obj(struct via_camera, GFP_KERNEL); if (cam == NULL) return -ENOMEM; via_cam_info = cam; diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 9a45cda05779..dab1deea05ea 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -338,7 +338,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, struct v4l2_device *v4l2_dev; int retval; - radio = kzalloc(sizeof(struct dsbr100_device), GFP_KERNEL); + radio = kzalloc_obj(struct dsbr100_device, GFP_KERNEL); if (!radio) return -ENOMEM; diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 2c1d413e8636..5a477ac9487b 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -67,7 +67,7 @@ struct rtrack { static struct radio_isa_card *rtrack_alloc(void) { - struct rtrack *rt = kzalloc(sizeof(struct rtrack), GFP_KERNEL); + struct rtrack *rt = kzalloc_obj(struct rtrack, GFP_KERNEL); if (rt) rt->curvol = 0xff; diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 0a4667bb7034..4e4721ed61e7 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c @@ -82,7 +82,7 @@ static void aztech_set_pins(void *handle, u8 pins) static struct radio_isa_card *aztech_alloc(void) { - struct aztech *az = kzalloc(sizeof(*az), GFP_KERNEL); + struct aztech *az = kzalloc_obj(*az, GFP_KERNEL); return az ? &az->isa : NULL; } diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index a3265f1dd189..5f2637ffabae 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -179,7 +179,7 @@ static unsigned long gemtek_convfreq(unsigned long freq) static struct radio_isa_card *gemtek_alloc(void) { - struct gemtek *gt = kzalloc(sizeof(*gt), GFP_KERNEL); + struct gemtek *gt = kzalloc_obj(*gt, GFP_KERNEL); if (gt) gt->muted = true; diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index c133305fd019..a26da2e9fbab 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c @@ -311,7 +311,7 @@ static int usb_keene_probe(struct usb_interface *intf, if (dev->product && strcmp(dev->product, "B-LINK USB Audio ")) return -ENODEV; - radio = kzalloc(sizeof(struct keene_device), GFP_KERNEL); + radio = kzalloc_obj(struct keene_device, GFP_KERNEL); if (radio) radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c index 657c3dda6648..e768c40ab73d 100644 --- a/drivers/media/radio/radio-ma901.c +++ b/drivers/media/radio/radio-ma901.c @@ -346,7 +346,7 @@ static int usb_ma901radio_probe(struct usb_interface *intf, || strncmp(dev->manufacturer, "www.masterkit.ru", 16) != 0)) return -ENODEV; - radio = kzalloc(sizeof(struct ma901radio_device), GFP_KERNEL); + radio = kzalloc_obj(struct ma901radio_device, GFP_KERNEL); if (!radio) { dev_err(&intf->dev, "kzalloc for ma901radio_device failed\n"); retval = -ENOMEM; diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 1a5dbae24ef4..cfa0568791fd 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -122,7 +122,7 @@ static int maxiradio_probe(struct pci_dev *pdev, struct v4l2_device *v4l2_dev; int retval = -ENOMEM; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { dev_err(&pdev->dev, "not enough memory\n"); return -ENOMEM; diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index cb0437b4c331..2e74f915c873 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -501,7 +501,7 @@ static int usb_amradio_probe(struct usb_interface *intf, struct amradio_device *radio; int retval; - radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL); + radio = kzalloc_obj(struct amradio_device, GFP_KERNEL); if (!radio) { dev_err(&intf->dev, "kmalloc for amradio_device failed\n"); diff --git a/drivers/media/radio/radio-raremono.c b/drivers/media/radio/radio-raremono.c index f60775b005e1..45b491ad1601 100644 --- a/drivers/media/radio/radio-raremono.c +++ b/drivers/media/radio/radio-raremono.c @@ -301,7 +301,7 @@ static int usb_raremono_probe(struct usb_interface *intf, struct raremono_device *radio; int retval = 0; - radio = kzalloc(sizeof(*radio), GFP_KERNEL); + radio = kzalloc_obj(*radio, GFP_KERNEL); if (!radio) return -ENOMEM; radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index efc02069bf9d..1e24e2d9cbbc 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c @@ -47,7 +47,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device numbers"); static struct radio_isa_card *rtrack2_alloc(void) { - return kzalloc(sizeof(struct radio_isa_card), GFP_KERNEL); + return kzalloc_obj(struct radio_isa_card, GFP_KERNEL); } static void zero(struct radio_isa_card *isa) diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index d0dde55b7930..cdd489ca2d9a 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -252,7 +252,7 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) static int fmr2_isa_match(struct device *pdev, unsigned int ndev) { - struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); + struct fmr2 *fmr2 = kzalloc_obj(*fmr2, GFP_KERNEL); if (!fmr2) return 0; @@ -269,7 +269,7 @@ static int fmr2_isa_match(struct device *pdev, unsigned int ndev) static int fmr2_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *id) { int ret; - struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); + struct fmr2 *fmr2 = kzalloc_obj(*fmr2, GFP_KERNEL); if (!fmr2) return -ENOMEM; diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c index 127a3be0e0f0..381196d6c675 100644 --- a/drivers/media/radio/radio-shark.c +++ b/drivers/media/radio/radio-shark.c @@ -327,7 +327,7 @@ static int usb_shark_probe(struct usb_interface *intf, return -EINVAL; } - shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL); + shark = kzalloc_obj(struct shark_device, GFP_KERNEL); if (!shark) return retval; diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c index e3e6aa87fe08..9e1d00d6bac1 100644 --- a/drivers/media/radio/radio-shark2.c +++ b/drivers/media/radio/radio-shark2.c @@ -293,7 +293,7 @@ static int usb_shark_probe(struct usb_interface *intf, return -EINVAL; } - shark = kzalloc(sizeof(struct shark_device), GFP_KERNEL); + shark = kzalloc_obj(struct shark_device, GFP_KERNEL); if (!shark) return retval; diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index dd85b0b1bcd9..ec953b8cb7ab 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c @@ -420,7 +420,7 @@ static int tea5764_i2c_probe(struct i2c_client *client) int ret; PDEBUG("probe"); - radio = kzalloc(sizeof(struct tea5764_device), GFP_KERNEL); + radio = kzalloc_obj(struct tea5764_device, GFP_KERNEL); if (!radio) return -ENOMEM; diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index 43817dd0a0fe..a160bcc2643f 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -56,7 +56,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device number"); static struct radio_isa_card *terratec_alloc(void) { - return kzalloc(sizeof(struct radio_isa_card), GFP_KERNEL); + return kzalloc_obj(struct radio_isa_card, GFP_KERNEL); } static int terratec_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol) diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index dfb8b62f0e2b..31d5e5efafaa 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c @@ -55,7 +55,7 @@ struct trust { static struct radio_isa_card *trust_alloc(void) { - struct trust *tr = kzalloc(sizeof(*tr), GFP_KERNEL); + struct trust *tr = kzalloc_obj(*tr, GFP_KERNEL); return tr ? &tr->isa : NULL; } diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index 1aa856df70df..4c49d9103135 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c @@ -75,7 +75,7 @@ struct typhoon { static struct radio_isa_card *typhoon_alloc(void) { - struct typhoon *ty = kzalloc(sizeof(*ty), GFP_KERNEL); + struct typhoon *ty = kzalloc_obj(*ty, GFP_KERNEL); return ty ? &ty->isa : NULL; } diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index e043bee52384..cf1a823e0aa9 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c @@ -79,7 +79,7 @@ struct zoltrix { static struct radio_isa_card *zoltrix_alloc(void) { - struct zoltrix *zol = kzalloc(sizeof(*zol), GFP_KERNEL); + struct zoltrix *zol = kzalloc_obj(*zol, GFP_KERNEL); return zol ? &zol->isa : NULL; } diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c index d9eecddffd91..71850c3b02a4 100644 --- a/drivers/media/radio/saa7706h.c +++ b/drivers/media/radio/saa7706h.c @@ -344,7 +344,7 @@ static int saa7706h_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%02x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc(sizeof(struct saa7706h_state), GFP_KERNEL); + state = kzalloc_obj(struct saa7706h_state, GFP_KERNEL); if (state == NULL) return -ENOMEM; sd = &state->sd; diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index aa7a580dbecc..79208c0b5c4a 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -570,7 +570,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, unsigned char version_warning = 0; /* private data allocation and initialization */ - radio = kzalloc(sizeof(struct si470x_device), GFP_KERNEL); + radio = kzalloc_obj(struct si470x_device, GFP_KERNEL); if (!radio) { retval = -ENOMEM; goto err_initial; diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index 2cf36c8abdde..a4bfda695413 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -420,7 +420,7 @@ static int usb_si4713_probe(struct usb_interface *intf, id->idVendor, id->idProduct); /* Initialize local device structure */ - radio = kzalloc(sizeof(struct si4713_usb_device), GFP_KERNEL); + radio = kzalloc_obj(struct si4713_usb_device, GFP_KERNEL); if (radio) radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c index b00ccf651922..7f95498a5551 100644 --- a/drivers/media/radio/tef6862.c +++ b/drivers/media/radio/tef6862.c @@ -153,7 +153,7 @@ static int tef6862_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%02x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc(sizeof(struct tef6862_state), GFP_KERNEL); + state = kzalloc_obj(struct tef6862_state, GFP_KERNEL); if (state == NULL) return -ENOMEM; state->freq = TEF6862_LO_FREQ; diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index a733914a2574..6bde5c913e99 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -839,7 +839,7 @@ static int ati_remote_probe(struct usb_interface *interface, return -ENODEV; } - ati_remote = kzalloc(sizeof (struct ati_remote), GFP_KERNEL); + ati_remote = kzalloc_obj(struct ati_remote, GFP_KERNEL); rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ati_remote || !rc_dev) goto exit_free_dev_rdev; diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index d6c54a3bccc2..6e61173ba233 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -993,7 +993,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) struct ene_device *dev; /* allocate memory */ - dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL); + dev = kzalloc_obj(struct ene_device, GFP_KERNEL); rdev = rc_allocate_device(RC_DRIVER_IR_RAW); if (!dev || !rdev) goto exit_free_dev_rdev; diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 3fb0968efd57..92a38d04d979 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -465,7 +465,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id struct rc_dev *rdev; int ret = -ENOMEM; - fintek = kzalloc(sizeof(struct fintek_dev), GFP_KERNEL); + fintek = kzalloc_obj(struct fintek_dev, GFP_KERNEL); if (!fintek) return ret; diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c index 8af94246e591..bb5bd62c8645 100644 --- a/drivers/media/rc/iguanair.c +++ b/drivers/media/rc/iguanair.c @@ -392,7 +392,7 @@ static int iguanair_probe(struct usb_interface *intf, if (idesc->desc.bNumEndpoints < 2) return -ENODEV; - ir = kzalloc(sizeof(*ir), GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !rc) { ret = -ENOMEM; diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 35b9e07003d8..0cb2ad180728 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -614,7 +614,7 @@ static int send_packet(struct imon_context *ictx) ictx->tx_urb->actual_length = 0; } else { /* fill request into kmalloc'ed space: */ - control_req = kmalloc(sizeof(*control_req), GFP_KERNEL); + control_req = kmalloc_obj(*control_req, GFP_KERNEL); if (control_req == NULL) return -ENOMEM; @@ -2233,7 +2233,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf, struct usb_host_interface *iface_desc; int ret = -ENOMEM; - ictx = kzalloc(sizeof(*ictx), GFP_KERNEL); + ictx = kzalloc_obj(*ictx, GFP_KERNEL); if (!ictx) goto exit; diff --git a/drivers/media/rc/ir_toy.c b/drivers/media/rc/ir_toy.c index 533faa117517..cf3b27817131 100644 --- a/drivers/media/rc/ir_toy.c +++ b/drivers/media/rc/ir_toy.c @@ -418,7 +418,7 @@ static int irtoy_probe(struct usb_interface *intf, return -ENODEV; } - irtoy = kzalloc(sizeof(*irtoy), GFP_KERNEL); + irtoy = kzalloc_obj(*irtoy, GFP_KERNEL); if (!irtoy) return -ENOMEM; diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 2bacecb02262..448f5c5db616 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c @@ -1304,7 +1304,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id int model_no; int io_rsrc_no; - itdev = kzalloc(sizeof(struct ite_dev), GFP_KERNEL); + itdev = kzalloc_obj(struct ite_dev, GFP_KERNEL); if (!itdev) return ret; diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 7d4942925993..735b0630b172 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -128,7 +128,7 @@ static int lirc_open(struct inode *inode, struct file *file) { struct rc_dev *dev = container_of(inode->i_cdev, struct rc_dev, lirc_cdev); - struct lirc_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); + struct lirc_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); unsigned long flags; int retval; @@ -267,7 +267,7 @@ static ssize_t lirc_transmit(struct file *file, const char __user *buf, goto out_unlock; } - raw = kmalloc_array(LIRCBUF_SIZE, sizeof(*raw), GFP_KERNEL); + raw = kmalloc_objs(*raw, LIRCBUF_SIZE, GFP_KERNEL); if (!raw) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 044767eb3a38..d35fff006ac9 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1715,7 +1715,7 @@ static int mceusb_dev_probe(struct usb_interface *intf, pipe = usb_rcvbulkpipe(dev, ep_in->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - ir = kzalloc(sizeof(struct mceusb_dev), GFP_KERNEL); + ir = kzalloc_obj(struct mceusb_dev, GFP_KERNEL); if (!ir) goto mem_alloc_fail; diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 2214d41ef579..4cf74ac2d76c 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -639,7 +639,7 @@ static int nvt_ir_raw_set_wakeup_filter(struct rc_dev *dev, if (!sc_filter->mask) return 0; - raw = kmalloc_array(WAKEUP_MAX_SIZE, sizeof(*raw), GFP_KERNEL); + raw = kmalloc_objs(*raw, WAKEUP_MAX_SIZE, GFP_KERNEL); if (!raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index 5dafe11f61c6..d1f8bb6af874 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -615,7 +615,7 @@ int ir_raw_event_prepare(struct rc_dev *dev) if (!dev) return -EINVAL; - dev->raw = kzalloc(sizeof(*dev->raw), GFP_KERNEL); + dev->raw = kzalloc_obj(*dev->raw, GFP_KERNEL); if (!dev->raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index 8288366f891f..959a1167d376 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -185,7 +185,7 @@ static int loop_set_wakeup_filter(struct rc_dev *dev, return 0; /* encode the specified filter and loop it back */ - raw = kmalloc_array(max, sizeof(*raw), GFP_KERNEL); + raw = kmalloc_objs(*raw, max, GFP_KERNEL); if (!raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index b9bf5cdcde4a..b67af602fbe6 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1701,7 +1701,7 @@ struct rc_dev *rc_allocate_device(enum rc_driver_type type) { struct rc_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index a49173f54a4d..2471bb4d66b8 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -502,7 +502,7 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutus) __be32 *timeout; int ret; - timeout = kmalloc(sizeof(*timeout), GFP_KERNEL); + timeout = kmalloc_obj(*timeout, GFP_KERNEL); if (!timeout) return -ENOMEM; @@ -768,13 +768,11 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, /* rr3 will disable rc detector on transmit */ rr3->transmitting = true; - sample_lens = kcalloc(RR3_DRIVER_MAXLENS, - sizeof(*sample_lens), - GFP_KERNEL); + sample_lens = kzalloc_objs(*sample_lens, RR3_DRIVER_MAXLENS, GFP_KERNEL); if (!sample_lens) return -ENOMEM; - irdata = kzalloc(sizeof(*irdata), GFP_KERNEL); + irdata = kzalloc_obj(*irdata, GFP_KERNEL); if (!irdata) { ret = -ENOMEM; goto out; @@ -1022,7 +1020,7 @@ static int redrat3_dev_probe(struct usb_interface *intf, } /* allocate memory for our device state and initialize it */ - rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL); + rr3 = kzalloc_obj(*rr3, GFP_KERNEL); if (!rr3) goto no_endpoints; diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index d3b48a0dd1f4..38e0db1b4964 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -285,7 +285,7 @@ static int streamzap_probe(struct usb_interface *intf, int pipe, maxp; /* Allocate space for device driver specific data */ - sz = kzalloc(sizeof(struct streamzap_ir), GFP_KERNEL); + sz = kzalloc_obj(struct streamzap_ir, GFP_KERNEL); if (!sz) return -ENOMEM; diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index 560a26f3965c..8b70c1e809ed 100644 --- a/drivers/media/rc/ttusbir.c +++ b/drivers/media/rc/ttusbir.c @@ -187,7 +187,7 @@ static int ttusbir_probe(struct usb_interface *intf, int i, j, ret; int altsetting = -1; - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!tt || !rc) { ret = -ENOMEM; diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 25884a79985c..875ead5240a5 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -1017,7 +1017,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) return -ENODEV; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/media/rc/xbox_remote.c b/drivers/media/rc/xbox_remote.c index a1572381d097..79c3bfe60437 100644 --- a/drivers/media/rc/xbox_remote.c +++ b/drivers/media/rc/xbox_remote.c @@ -213,7 +213,7 @@ static int xbox_remote_probe(struct usb_interface *interface, return -ENODEV; } - xbox_remote = kzalloc(sizeof(*xbox_remote), GFP_KERNEL); + xbox_remote = kzalloc_obj(*xbox_remote, GFP_KERNEL); rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE); if (!xbox_remote || !rc_dev) goto exit_free_dev_rdev; diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c index 65fa7f857fca..352ff42b9121 100644 --- a/drivers/media/spi/cxd2880-spi.c +++ b/drivers/media/spi/cxd2880-spi.c @@ -516,7 +516,7 @@ cxd2880_spi_probe(struct spi_device *spi) return -EINVAL; } - dvb_spi = kzalloc(sizeof(struct cxd2880_dvb_spi), GFP_KERNEL); + dvb_spi = kzalloc_obj(struct cxd2880_dvb_spi, GFP_KERNEL); if (!dvb_spi) return -ENOMEM; diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c index be846f711969..d3d4bb41c8ea 100644 --- a/drivers/media/test-drivers/vicodec/vicodec-core.c +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c @@ -1836,7 +1836,7 @@ static int vicodec_open(struct file *file) if (mutex_lock_interruptible(vfd->lock)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto open_unlock; @@ -2105,7 +2105,7 @@ static int vicodec_probe(struct platform_device *pdev) struct vicodec_dev *dev; int ret; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c index 438483c62fac..03bb7c79df47 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -490,7 +490,7 @@ static int vidtv_bridge_probe(struct platform_device *pdev) struct vidtv_dvb *dvb; int ret; - dvb = kzalloc(sizeof(*dvb), GFP_KERNEL); + dvb = kzalloc_obj(*dvb, GFP_KERNEL); if (!dvb) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c index 3541155c6fc6..4ba65853c3ed 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_channel.c +++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c @@ -67,7 +67,7 @@ struct vidtv_channel const u16 s302m_beethoven_event_id = 1; struct vidtv_channel *s302m; - s302m = kzalloc(sizeof(*s302m), GFP_KERNEL); + s302m = kzalloc_obj(*s302m, GFP_KERNEL); if (!s302m) return NULL; @@ -389,7 +389,7 @@ static struct vidtv_psi_desc_service_list_entry s_desc = (struct vidtv_psi_desc_service *)desc; - curr_e = kzalloc(sizeof(*curr_e), GFP_KERNEL); + curr_e = kzalloc_obj(*curr_e, GFP_KERNEL); if (!curr_e) { vidtv_channel_destroy_service_list(head_e); return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_demod.c b/drivers/media/test-drivers/vidtv/vidtv_demod.c index 505f96fccbf3..31ee6d706744 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_demod.c +++ b/drivers/media/test-drivers/vidtv/vidtv_demod.c @@ -418,7 +418,7 @@ static int vidtv_demod_i2c_probe(struct i2c_client *client) struct vidtv_demod_state *state; /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_mux.c b/drivers/media/test-drivers/vidtv/vidtv_mux.c index f99878eff7ac..01bed6d82437 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_mux.c +++ b/drivers/media/test-drivers/vidtv/vidtv_mux.c @@ -50,7 +50,7 @@ static struct vidtv_mux_pid_ctx if (ctx) return ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -480,7 +480,7 @@ struct vidtv_mux *vidtv_mux_init(struct dvb_frontend *fe, { struct vidtv_mux *m; - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (!m) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c index 2a51c898c11e..2cd3f5d7c142 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -285,7 +285,7 @@ struct vidtv_psi_desc_service *vidtv_psi_service_desc_init(struct vidtv_psi_desc u32 service_name_len = service_name ? strlen(service_name) : 0; u32 provider_name_len = provider_name ? strlen(provider_name) : 0; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; @@ -360,7 +360,7 @@ struct vidtv_psi_desc_network_name u32 network_name_len = network_name ? strlen(network_name) : 0; struct vidtv_psi_desc_network_name *desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; @@ -390,14 +390,14 @@ struct vidtv_psi_desc_service_list struct vidtv_psi_desc_service_list *desc; u16 length = 0; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; desc->type = SERVICE_LIST_DESCRIPTOR; while (entry) { - curr_e = kzalloc(sizeof(*curr_e), GFP_KERNEL); + curr_e = kzalloc_obj(*curr_e, GFP_KERNEL); if (!curr_e) { while (head_e) { curr_e = head_e; @@ -441,7 +441,7 @@ struct vidtv_psi_desc_short_event struct vidtv_psi_desc_short_event *desc; u32 text_len = text ? strlen(text) : 0; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; @@ -895,7 +895,7 @@ vidtv_psi_pat_program_init(struct vidtv_psi_table_pat_program *head, struct vidtv_psi_table_pat_program *program; const u16 RESERVED = 0x07; - program = kzalloc(sizeof(*program), GFP_KERNEL); + program = kzalloc_obj(*program, GFP_KERNEL); if (!program) return NULL; @@ -967,7 +967,7 @@ struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id) const u16 ZERO = 0x0; const u16 ONES = 0x03; - pat = kzalloc(sizeof(*pat), GFP_KERNEL); + pat = kzalloc_obj(*pat, GFP_KERNEL); if (!pat) return NULL; @@ -1067,7 +1067,7 @@ vidtv_psi_pmt_stream_init(struct vidtv_psi_table_pmt_stream *head, const u16 ZERO = 0x0; u16 desc_loop_len; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return NULL; @@ -1153,7 +1153,7 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number, const u16 ZERO = 0x0; u16 desc_loop_len; - pmt = kzalloc(sizeof(*pmt), GFP_KERNEL); + pmt = kzalloc_obj(*pmt, GFP_KERNEL); if (!pmt) return NULL; @@ -1298,7 +1298,7 @@ struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 network_id, const u16 ONES = 0x03; const u16 ONE = 0x1; - sdt = kzalloc(sizeof(*sdt), GFP_KERNEL); + sdt = kzalloc_obj(*sdt, GFP_KERNEL); if (!sdt) return NULL; @@ -1438,7 +1438,7 @@ struct vidtv_psi_table_sdt_service { struct vidtv_psi_table_sdt_service *service; - service = kzalloc(sizeof(*service), GFP_KERNEL); + service = kzalloc_obj(*service, GFP_KERNEL); if (!service) return NULL; @@ -1523,9 +1523,8 @@ vidtv_psi_pmt_create_sec_for_each_pat_entry(struct vidtv_psi_table_pat *pat, program = program->next; } - pmt_secs = kcalloc(num_pmt, - sizeof(struct vidtv_psi_table_pmt *), - GFP_KERNEL); + pmt_secs = kzalloc_objs(struct vidtv_psi_table_pmt *, num_pmt, + GFP_KERNEL); if (!pmt_secs) return NULL; @@ -1622,11 +1621,11 @@ struct vidtv_psi_table_nit const u16 ONES = 0x03; const u16 ONE = 0x1; - nit = kzalloc(sizeof(*nit), GFP_KERNEL); + nit = kzalloc_obj(*nit, GFP_KERNEL); if (!nit) return NULL; - transport = kzalloc(sizeof(*transport), GFP_KERNEL); + transport = kzalloc_obj(*transport, GFP_KERNEL); if (!transport) goto free_nit; @@ -1857,7 +1856,7 @@ struct vidtv_psi_table_eit const u16 ONE = 0x1; const u16 ONES = 0x03; - eit = kzalloc(sizeof(*eit), GFP_KERNEL); + eit = kzalloc_obj(*eit, GFP_KERNEL); if (!eit) return NULL; @@ -1982,7 +1981,7 @@ struct vidtv_psi_table_eit_event int mjd, l; __be16 mjd_be; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_s302m.c b/drivers/media/test-drivers/vidtv/vidtv_s302m.c index 9da18eac04b5..1a2ffcf0796f 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_s302m.c +++ b/drivers/media/test-drivers/vidtv/vidtv_s302m.c @@ -148,7 +148,7 @@ static struct vidtv_access_unit *vidtv_s302m_access_unit_init(struct vidtv_acces { struct vidtv_access_unit *au; - au = kzalloc(sizeof(*au), GFP_KERNEL); + au = kzalloc_obj(*au, GFP_KERNEL); if (!au) return NULL; @@ -445,7 +445,7 @@ struct vidtv_encoder struct vidtv_s302m_ctx *ctx; struct vidtv_encoder *e; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_tuner.c b/drivers/media/test-drivers/vidtv/vidtv_tuner.c index 4ba302d569d6..735eb3b6824d 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_tuner.c +++ b/drivers/media/test-drivers/vidtv/vidtv_tuner.c @@ -396,7 +396,7 @@ static int vidtv_tuner_i2c_probe(struct i2c_client *client) struct dvb_frontend *fe = config->fe; struct vidtv_tuner_dev *tuner_dev = NULL; - tuner_dev = kzalloc(sizeof(*tuner_dev), GFP_KERNEL); + tuner_dev = kzalloc_obj(*tuner_dev, GFP_KERNEL); if (!tuner_dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vim2m.c b/drivers/media/test-drivers/vim2m.c index c33c18ea5210..ae091cb67794 100644 --- a/drivers/media/test-drivers/vim2m.c +++ b/drivers/media/test-drivers/vim2m.c @@ -1365,7 +1365,7 @@ static int vim2m_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto open_unlock; @@ -1492,7 +1492,7 @@ static int vim2m_probe(struct platform_device *pdev) struct video_device *vfd; int ret; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vimc/vimc-capture.c b/drivers/media/test-drivers/vimc/vimc-capture.c index 7f6124025fc9..e8a91f78a484 100644 --- a/drivers/media/test-drivers/vimc/vimc-capture.c +++ b/drivers/media/test-drivers/vimc/vimc-capture.c @@ -397,7 +397,7 @@ static struct vimc_ent_device *vimc_capture_add(struct vimc_device *vimc, int ret; /* Allocate the vimc_capture_device struct */ - vcapture = kzalloc(sizeof(*vcapture), GFP_KERNEL); + vcapture = kzalloc_obj(*vcapture, GFP_KERNEL); if (!vcapture) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c index f632c77e52f5..7267766662fa 100644 --- a/drivers/media/test-drivers/vimc/vimc-core.c +++ b/drivers/media/test-drivers/vimc/vimc-core.c @@ -287,8 +287,8 @@ static int vimc_register_devices(struct vimc_device *vimc) return ret; } /* allocate ent_devs */ - vimc->ent_devs = kcalloc(vimc->pipe_cfg->num_ents, - sizeof(*vimc->ent_devs), GFP_KERNEL); + vimc->ent_devs = kzalloc_objs(*vimc->ent_devs, vimc->pipe_cfg->num_ents, + GFP_KERNEL); if (!vimc->ent_devs) { ret = -ENOMEM; goto err_v4l2_unregister; @@ -354,7 +354,7 @@ static int vimc_probe(struct platform_device *pdev) if (vimc_allocator == VIMC_ALLOCATOR_DMA_CONTIG) dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); - vimc = kzalloc(sizeof(*vimc), GFP_KERNEL); + vimc = kzalloc_obj(*vimc, GFP_KERNEL); if (!vimc) return -ENOMEM; diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c index bbb7c7a86df0..9f86944a04a5 100644 --- a/drivers/media/test-drivers/vimc/vimc-debayer.c +++ b/drivers/media/test-drivers/vimc/vimc-debayer.c @@ -564,7 +564,7 @@ static struct vimc_ent_device *vimc_debayer_add(struct vimc_device *vimc, int ret; /* Allocate the vdebayer struct */ - vdebayer = kzalloc(sizeof(*vdebayer), GFP_KERNEL); + vdebayer = kzalloc_obj(*vdebayer, GFP_KERNEL); if (!vdebayer) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-lens.c b/drivers/media/test-drivers/vimc/vimc-lens.c index 96399057a2b5..9b7909ded8d6 100644 --- a/drivers/media/test-drivers/vimc/vimc-lens.c +++ b/drivers/media/test-drivers/vimc/vimc-lens.c @@ -54,7 +54,7 @@ static struct vimc_ent_device *vimc_lens_add(struct vimc_device *vimc, int ret; /* Allocate the vlens struct */ - vlens = kzalloc(sizeof(*vlens), GFP_KERNEL); + vlens = kzalloc_obj(*vlens, GFP_KERNEL); if (!vlens) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-scaler.c b/drivers/media/test-drivers/vimc/vimc-scaler.c index 47d0d63865a0..eb0a45944e4f 100644 --- a/drivers/media/test-drivers/vimc/vimc-scaler.c +++ b/drivers/media/test-drivers/vimc/vimc-scaler.c @@ -392,7 +392,7 @@ static struct vimc_ent_device *vimc_scaler_add(struct vimc_device *vimc, int ret; /* Allocate the vscaler struct */ - vscaler = kzalloc(sizeof(*vscaler), GFP_KERNEL); + vscaler = kzalloc_obj(*vscaler, GFP_KERNEL); if (!vscaler) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-sensor.c b/drivers/media/test-drivers/vimc/vimc-sensor.c index 027767777763..e53d28e59ac3 100644 --- a/drivers/media/test-drivers/vimc/vimc-sensor.c +++ b/drivers/media/test-drivers/vimc/vimc-sensor.c @@ -382,7 +382,7 @@ static struct vimc_ent_device *vimc_sensor_add(struct vimc_device *vimc, int ret; /* Allocate the vsensor struct */ - vsensor = kzalloc(sizeof(*vsensor), GFP_KERNEL); + vsensor = kzalloc_obj(*vsensor, GFP_KERNEL); if (!vsensor) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 26c6c6835f79..5ef662fa6cfa 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -332,7 +332,7 @@ static int visl_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto unlock; @@ -437,7 +437,7 @@ static int visl_probe(struct platform_device *pdev) int ret; int rc; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/visl/visl-debugfs.c b/drivers/media/test-drivers/visl/visl-debugfs.c index 45f2a8268014..8cb75c63aca6 100644 --- a/drivers/media/test-drivers/visl/visl-debugfs.c +++ b/drivers/media/test-drivers/visl/visl-debugfs.c @@ -45,7 +45,7 @@ void visl_trace_bitstream(struct visl_ctx *ctx, struct visl_run *run) struct dentry *dentry; char name[32]; - blob = kzalloc(sizeof(*blob), GFP_KERNEL); + blob = kzalloc_obj(*blob, GFP_KERNEL); if (!blob) return; diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 9c0b1a32b5c9..5d73701f9080 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -1814,7 +1814,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) int i; /* allocate main vivid state structure */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index 549b2009f974..3c2d90fe4349 100644 --- a/drivers/media/tuners/e4000.c +++ b/drivers/media/tuners/e4000.c @@ -621,7 +621,7 @@ static int e4000_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c index 3d3b54be2955..e982c1834fe4 100644 --- a/drivers/media/tuners/fc0011.c +++ b/drivers/media/tuners/fc0011.c @@ -485,7 +485,7 @@ struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe, { struct fc0011_priv *priv; - priv = kzalloc(sizeof(struct fc0011_priv), GFP_KERNEL); + priv = kzalloc_obj(struct fc0011_priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c index 81e65acbdb17..efe0fd2f4673 100644 --- a/drivers/media/tuners/fc0012.c +++ b/drivers/media/tuners/fc0012.c @@ -435,7 +435,7 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); - priv = kzalloc(sizeof(struct fc0012_priv), GFP_KERNEL); + priv = kzalloc_obj(struct fc0012_priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; dev_err(&i2c->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME); diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c index 90d2ef067594..d0049a302689 100644 --- a/drivers/media/tuners/fc0013.c +++ b/drivers/media/tuners/fc0013.c @@ -526,7 +526,7 @@ struct dvb_frontend *fc0013_attach(struct dvb_frontend *fe, { struct fc0013_priv *priv = NULL; - priv = kzalloc(sizeof(struct fc0013_priv), GFP_KERNEL); + priv = kzalloc_obj(struct fc0013_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c index 046389896dc5..992e716a0703 100644 --- a/drivers/media/tuners/fc2580.c +++ b/drivers/media/tuners/fc2580.c @@ -518,7 +518,7 @@ static int fc2580_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c index 9186174a46fd..a78ce6c76b9c 100644 --- a/drivers/media/tuners/it913x.c +++ b/drivers/media/tuners/it913x.c @@ -385,7 +385,7 @@ static int it913x_probe(struct platform_device *pdev) int ret; char *chip_ver_str; - dev = kzalloc(sizeof(struct it913x_dev), GFP_KERNEL); + dev = kzalloc_obj(struct it913x_dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; dev_err(&pdev->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index cc57980ed417..16144f4b363e 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -612,7 +612,7 @@ static int m88rs6000t_probe(struct i2c_client *client) {0x75, 0xFC}, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/max2165.c b/drivers/media/tuners/max2165.c index 1575ab94e1c8..04c25efb3baa 100644 --- a/drivers/media/tuners/max2165.c +++ b/drivers/media/tuners/max2165.c @@ -394,7 +394,7 @@ struct dvb_frontend *max2165_attach(struct dvb_frontend *fe, i2c ? i2c_adapter_id(i2c) : -1, cfg ? cfg->i2c_address : -1); - priv = kzalloc(sizeof(struct max2165_priv), GFP_KERNEL); + priv = kzalloc_obj(struct max2165_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mc44s803.c b/drivers/media/tuners/mc44s803.c index ed8bdf7ebd99..fb5dc3bef84f 100644 --- a/drivers/media/tuners/mc44s803.c +++ b/drivers/media/tuners/mc44s803.c @@ -315,7 +315,7 @@ struct dvb_frontend *mc44s803_attach(struct dvb_frontend *fe, reg = 0; - priv = kzalloc(sizeof(struct mc44s803_priv), GFP_KERNEL); + priv = kzalloc_obj(struct mc44s803_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/msi001.c b/drivers/media/tuners/msi001.c index ad6c72c1ed04..071847007e65 100644 --- a/drivers/media/tuners/msi001.c +++ b/drivers/media/tuners/msi001.c @@ -426,7 +426,7 @@ static int msi001_probe(struct spi_device *spi) dev_dbg(&spi->dev, "\n"); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/mt2060.c b/drivers/media/tuners/mt2060.c index 4b9dca2f17cc..3ae1c4de9dd3 100644 --- a/drivers/media/tuners/mt2060.c +++ b/drivers/media/tuners/mt2060.c @@ -407,7 +407,7 @@ struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter struct mt2060_priv *priv = NULL; u8 id = 0; - priv = kzalloc(sizeof(struct mt2060_priv), GFP_KERNEL); + priv = kzalloc_obj(struct mt2060_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mt2063.c b/drivers/media/tuners/mt2063.c index 2c8ce74ddca4..5e226618321a 100644 --- a/drivers/media/tuners/mt2063.c +++ b/drivers/media/tuners/mt2063.c @@ -2212,7 +2212,7 @@ struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, dprintk(2, "\n"); - state = kzalloc(sizeof(struct mt2063_state), GFP_KERNEL); + state = kzalloc_obj(struct mt2063_state, GFP_KERNEL); if (!state) return NULL; diff --git a/drivers/media/tuners/mt20xx.c b/drivers/media/tuners/mt20xx.c index baf708f42428..5d89b84e4fb9 100644 --- a/drivers/media/tuners/mt20xx.c +++ b/drivers/media/tuners/mt20xx.c @@ -596,7 +596,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe, unsigned char buf[21]; int company_code; - priv = kzalloc(sizeof(struct microtune_priv), GFP_KERNEL); + priv = kzalloc_obj(struct microtune_priv, GFP_KERNEL); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/mt2131.c b/drivers/media/tuners/mt2131.c index eebc06088341..31ada489ba27 100644 --- a/drivers/media/tuners/mt2131.c +++ b/drivers/media/tuners/mt2131.c @@ -248,7 +248,7 @@ struct dvb_frontend * mt2131_attach(struct dvb_frontend *fe, dprintk(1, "%s()\n", __func__); - priv = kzalloc(sizeof(struct mt2131_priv), GFP_KERNEL); + priv = kzalloc_obj(struct mt2131_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mt2266.c b/drivers/media/tuners/mt2266.c index 2e92885a6bcb..84bba08ae0a4 100644 --- a/drivers/media/tuners/mt2266.c +++ b/drivers/media/tuners/mt2266.c @@ -313,7 +313,7 @@ struct dvb_frontend * mt2266_attach(struct dvb_frontend *fe, struct i2c_adapter struct mt2266_priv *priv = NULL; u8 id = 0; - priv = kzalloc(sizeof(struct mt2266_priv), GFP_KERNEL); + priv = kzalloc_obj(struct mt2266_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mxl301rf.c b/drivers/media/tuners/mxl301rf.c index 3b61c3afed18..4cae9d2d37d2 100644 --- a/drivers/media/tuners/mxl301rf.c +++ b/drivers/media/tuners/mxl301rf.c @@ -289,7 +289,7 @@ static int mxl301rf_probe(struct i2c_client *client) struct mxl301rf_config *cfg; struct dvb_frontend *fe; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/drivers/media/tuners/mxl5005s.c b/drivers/media/tuners/mxl5005s.c index 0e811c5eae6c..5538066a57ed 100644 --- a/drivers/media/tuners/mxl5005s.c +++ b/drivers/media/tuners/mxl5005s.c @@ -4103,7 +4103,7 @@ struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe, struct mxl5005s_state *state = NULL; dprintk(1, "%s()\n", __func__); - state = kzalloc(sizeof(struct mxl5005s_state), GFP_KERNEL); + state = kzalloc_obj(struct mxl5005s_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/tuners/qm1d1b0004.c b/drivers/media/tuners/qm1d1b0004.c index c53aeb558413..dae101ac56f1 100644 --- a/drivers/media/tuners/qm1d1b0004.c +++ b/drivers/media/tuners/qm1d1b0004.c @@ -208,7 +208,7 @@ qm1d1b0004_probe(struct i2c_client *client) fe = cfg->fe; i2c_set_clientdata(client, fe); - fe->tuner_priv = kzalloc(sizeof(struct qm1d1b0004_state), GFP_KERNEL); + fe->tuner_priv = kzalloc_obj(struct qm1d1b0004_state, GFP_KERNEL); if (!fe->tuner_priv) { ret = -ENOMEM; goto err_mem; diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners/qm1d1c0042.c index c58f5b6526f1..3a9037a2a74b 100644 --- a/drivers/media/tuners/qm1d1c0042.c +++ b/drivers/media/tuners/qm1d1c0042.c @@ -407,7 +407,7 @@ static int qm1d1c0042_probe(struct i2c_client *client) struct qm1d1c0042_config *cfg; struct dvb_frontend *fe; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; state->i2c = client; diff --git a/drivers/media/tuners/qt1010.c b/drivers/media/tuners/qt1010.c index 48fc79cd4027..2aee4556ad53 100644 --- a/drivers/media/tuners/qt1010.c +++ b/drivers/media/tuners/qt1010.c @@ -411,7 +411,7 @@ struct dvb_frontend * qt1010_attach(struct dvb_frontend *fe, struct qt1010_priv *priv = NULL; u8 id; - priv = kzalloc(sizeof(struct qt1010_priv), GFP_KERNEL); + priv = kzalloc_obj(struct qt1010_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index def06c262ea2..1239206a0ac4 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -884,7 +884,7 @@ static int si2157_probe(struct i2c_client *client) struct si2157_cmd cmd; int ret; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/tda18212.c b/drivers/media/tuners/tda18212.c index 39f2dc9c2845..435189d37655 100644 --- a/drivers/media/tuners/tda18212.c +++ b/drivers/media/tuners/tda18212.c @@ -186,7 +186,7 @@ static int tda18212_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/tda18218.c b/drivers/media/tuners/tda18218.c index 7d8d84dcb245..f3b54e815657 100644 --- a/drivers/media/tuners/tda18218.c +++ b/drivers/media/tuners/tda18218.c @@ -292,7 +292,7 @@ struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xf6 }; - priv = kzalloc(sizeof(struct tda18218_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tda18218_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c index 68d0275f29e1..4e77ebc10114 100644 --- a/drivers/media/tuners/tda18250.c +++ b/drivers/media/tuners/tda18250.c @@ -769,7 +769,7 @@ static int tda18250_probe(struct i2c_client *client) .volatile_table = &tda18250_volatile_table, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/tda827x.c b/drivers/media/tuners/tda827x.c index ad68ee6c5ed4..adc00ee687a1 100644 --- a/drivers/media/tuners/tda827x.c +++ b/drivers/media/tuners/tda827x.c @@ -873,7 +873,7 @@ struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr, struct tda827x_priv *priv = NULL; dprintk("%s:\n", __func__); - priv = kzalloc(sizeof(struct tda827x_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tda827x_priv, GFP_KERNEL); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c index 98851482c0cc..f15dca8f5b08 100644 --- a/drivers/media/tuners/tda8290.c +++ b/drivers/media/tuners/tda8290.c @@ -734,7 +734,7 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, struct tda8290_priv *priv = NULL; char *name; - priv = kzalloc(sizeof(struct tda8290_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tda8290_priv, GFP_KERNEL); if (priv == NULL) return NULL; fe->analog_demod_priv = priv; diff --git a/drivers/media/tuners/tea5761.c b/drivers/media/tuners/tea5761.c index 425e9fd3f3d4..1e3ea4fd7013 100644 --- a/drivers/media/tuners/tea5761.c +++ b/drivers/media/tuners/tea5761.c @@ -315,7 +315,7 @@ struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe, if (tea5761_autodetection(i2c_adap, i2c_addr) != 0) return NULL; - priv = kzalloc(sizeof(struct tea5761_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tea5761_priv, GFP_KERNEL); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c index ef4acb1f1bfa..81deab8f2b20 100644 --- a/drivers/media/tuners/tea5767.c +++ b/drivers/media/tuners/tea5767.c @@ -441,7 +441,7 @@ struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe, { struct tea5767_priv *priv = NULL; - priv = kzalloc(sizeof(struct tea5767_priv), GFP_KERNEL); + priv = kzalloc_obj(struct tea5767_priv, GFP_KERNEL); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/tua9001.c b/drivers/media/tuners/tua9001.c index 562a7a5c26f5..59bd15ba6280 100644 --- a/drivers/media/tuners/tua9001.c +++ b/drivers/media/tuners/tua9001.c @@ -178,7 +178,7 @@ static int tua9001_probe(struct i2c_client *client) .val_bits = 16, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/tuner-i2c.h b/drivers/media/tuners/tuner-i2c.h index 724952e001cd..336acbbc622b 100644 --- a/drivers/media/tuners/tuner-i2c.h +++ b/drivers/media/tuners/tuner-i2c.h @@ -132,7 +132,7 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, } \ } \ if (0 == __ret) { \ - state = kzalloc(sizeof(type), GFP_KERNEL); \ + state = kzalloc_obj(type, GFP_KERNEL); \ if (NULL == state) \ goto __fail; \ state->i2c_props.addr = i2caddr; \ diff --git a/drivers/media/tuners/xc2028.c b/drivers/media/tuners/xc2028.c index 807585d2dfde..f0f99142941f 100644 --- a/drivers/media/tuners/xc2028.c +++ b/drivers/media/tuners/xc2028.c @@ -332,7 +332,7 @@ static int load_all_firmwares(struct dvb_frontend *fe, n_array, priv->fname, name, priv->firm_version >> 8, priv->firm_version & 0xff); - priv->firm = kcalloc(n_array, sizeof(*priv->firm), GFP_KERNEL); + priv->firm = kzalloc_objs(*priv->firm, n_array, GFP_KERNEL); if (priv->firm == NULL) { tuner_err("Not enough memory to load firmware file.\n"); rc = -ENOMEM; diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c index b44c97e4e5ec..674e863839c9 100644 --- a/drivers/media/tuners/xc4000.c +++ b/drivers/media/tuners/xc4000.c @@ -763,7 +763,7 @@ static int xc4000_fwupload(struct dvb_frontend *fe) n_array, fname, name, priv->firm_version >> 8, priv->firm_version & 0xff); - priv->firm = kcalloc(n_array, sizeof(*priv->firm), GFP_KERNEL); + priv->firm = kzalloc_objs(*priv->firm, n_array, GFP_KERNEL); if (priv->firm == NULL) { printk(KERN_ERR "Not enough memory to load firmware file.\n"); rc = -ENOMEM; diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 08f0920cf6ca..1751a67842bc 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -968,7 +968,7 @@ static int airspy_probe(struct usb_interface *intf, buf = NULL; ret = -ENOMEM; - s = kzalloc(sizeof(struct airspy), GFP_KERNEL); + s = kzalloc_obj(struct airspy, GFP_KERNEL); if (s == NULL) { dev_err(&intf->dev, "Could not allocate memory for state\n"); return -ENOMEM; diff --git a/drivers/media/usb/as102/as102_fw.c b/drivers/media/usb/as102/as102_fw.c index 514764247588..6c14b2754b83 100644 --- a/drivers/media/usb/as102/as102_fw.c +++ b/drivers/media/usb/as102/as102_fw.c @@ -96,7 +96,7 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap, int total_read_bytes = 0, errno = 0; unsigned char addr_has_changed = 0; - fw_pkt = kmalloc(sizeof(*fw_pkt), GFP_KERNEL); + fw_pkt = kmalloc_obj(*fw_pkt, GFP_KERNEL); if (!fw_pkt) return -ENOMEM; diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c index e0ef66a522e2..594dde4578ce 100644 --- a/drivers/media/usb/as102/as102_usb_drv.c +++ b/drivers/media/usb/as102/as102_usb_drv.c @@ -345,7 +345,7 @@ static int as102_usb_probe(struct usb_interface *intf, return -EINVAL; } - as102_dev = kzalloc(sizeof(struct as102_dev_t), GFP_KERNEL); + as102_dev = kzalloc_obj(struct as102_dev_t, GFP_KERNEL); if (as102_dev == NULL) return -ENOMEM; diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 1e246b47766d..d99f32d5d06f 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -670,7 +670,7 @@ static int au0828_usb_probe(struct usb_interface *interface, return -ENODEV; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { pr_err("%s() Unable to allocate memory\n", __func__); return -ENOMEM; diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c index 3d3368202cd0..9de5e7fdbbef 100644 --- a/drivers/media/usb/au0828/au0828-input.c +++ b/drivers/media/usb/au0828/au0828-input.c @@ -283,7 +283,7 @@ int au0828_rc_register(struct au0828_dev *dev) if (!i2c_rc_dev_addr) return -ENODEV; - ir = kzalloc(sizeof(*ir), GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !rc) goto error; diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index 691f073892b3..00029ea23c63 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c @@ -1295,7 +1295,7 @@ void cx231xx_card_setup(struct cx231xx *dev) u8 eeprom[256]; struct i2c_client client; }; - struct eeprom *e = kzalloc(sizeof(*e), GFP_KERNEL); + struct eeprom *e = kzalloc_obj(*e, GFP_KERNEL); if (e == NULL) { dev_err(dev->dev, @@ -1381,7 +1381,7 @@ static int cx231xx_media_device_init(struct cx231xx *dev, #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 0037b4b1381e..913d53abd0e4 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -627,7 +627,7 @@ static int dvb_init(struct cx231xx *dev) return 0; } - dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL); + dvb = kzalloc_obj(struct cx231xx_dvb, GFP_KERNEL); if (dvb == NULL) { dev_info(dev->dev, diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index f1c79f351ec8..acbc951dbdc0 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -392,7 +392,7 @@ static int dvb_usbv2_media_device_init(struct dvb_usb_adapter *adap) struct dvb_usb_device *d = adap_to_d(adap); struct usb_device *udev = d->udev; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; @@ -904,7 +904,7 @@ int dvb_usbv2_probe(struct usb_interface *intf, goto err; } - d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL); + d = kzalloc_obj(struct dvb_usb_device, GFP_KERNEL); if (!d) { dev_err(&udev->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME); ret = -ENOMEM; diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c index a6ad5f477520..4811f4d1ac87 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c @@ -577,7 +577,7 @@ struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state, mxl_dbg("()"); - state = kzalloc(sizeof(struct mxl111sf_demod_state), GFP_KERNEL); + state = kzalloc_obj(struct mxl111sf_demod_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c index 6686f75cbd94..0cc78fd8e916 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c @@ -482,7 +482,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, mxl_dbg("()"); - state = kzalloc(sizeof(struct mxl111sf_tuner_state), GFP_KERNEL); + state = kzalloc_obj(struct mxl111sf_tuner_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/usb/dvb-usb/af9005-fe.c b/drivers/media/usb/dvb-usb/af9005-fe.c index 404e56b32145..b6fb72c97aef 100644 --- a/drivers/media/usb/dvb-usb/af9005-fe.c +++ b/drivers/media/usb/dvb-usb/af9005-fe.c @@ -1423,7 +1423,7 @@ struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d) struct af9005_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct af9005_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct af9005_fe_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/usb/dvb-usb/cinergyT2-fe.c b/drivers/media/usb/dvb-usb/cinergyT2-fe.c index efb207c23a64..84f167a463ce 100644 --- a/drivers/media/usb/dvb-usb/cinergyT2-fe.c +++ b/drivers/media/usb/dvb-usb/cinergyT2-fe.c @@ -268,8 +268,8 @@ static const struct dvb_frontend_ops cinergyt2_fe_ops; struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d) { - struct cinergyt2_fe_state *s = kzalloc(sizeof( - struct cinergyt2_fe_state), GFP_KERNEL); + struct cinergyt2_fe_state *s = kzalloc_obj(struct cinergyt2_fe_state, + GFP_KERNEL); if (s == NULL) return NULL; diff --git a/drivers/media/usb/dvb-usb/dtt200u-fe.c b/drivers/media/usb/dvb-usb/dtt200u-fe.c index 586afe22d817..30d2e6d46b5b 100644 --- a/drivers/media/usb/dvb-usb/dtt200u-fe.c +++ b/drivers/media/usb/dvb-usb/dtt200u-fe.c @@ -206,7 +206,7 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d) struct dtt200u_fe_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); + state = kzalloc_obj(struct dtt200u_fe_state, GFP_KERNEL); if (state == NULL) goto error; diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 0a7f8ba90992..94e1e7ce278d 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -103,7 +103,7 @@ static int dvb_usb_media_device_init(struct dvb_usb_adapter *adap) struct dvb_usb_device *d = adap->dev; struct usb_device *udev = d->udev; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c index fbf58012becd..656401276d09 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c @@ -278,7 +278,7 @@ int dvb_usb_device_init(struct usb_interface *intf, if (du != NULL) *du = NULL; - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { err("no memory for 'struct dvb_usb_device'"); return -ENOMEM; diff --git a/drivers/media/usb/dvb-usb/vp702x-fe.c b/drivers/media/usb/dvb-usb/vp702x-fe.c index c1e7931900ee..0f9bd7abbcec 100644 --- a/drivers/media/usb/dvb-usb/vp702x-fe.c +++ b/drivers/media/usb/dvb-usb/vp702x-fe.c @@ -323,7 +323,8 @@ static const struct dvb_frontend_ops vp702x_fe_ops; struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) { - struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL); + struct vp702x_fe_state *s = kzalloc_obj(struct vp702x_fe_state, + GFP_KERNEL); if (s == NULL) goto error; diff --git a/drivers/media/usb/dvb-usb/vp7045-fe.c b/drivers/media/usb/dvb-usb/vp7045-fe.c index e99740ec2650..a6555fc0b79a 100644 --- a/drivers/media/usb/dvb-usb/vp7045-fe.c +++ b/drivers/media/usb/dvb-usb/vp7045-fe.c @@ -140,7 +140,8 @@ static const struct dvb_frontend_ops vp7045_fe_ops; struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) { - struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL); + struct vp7045_fe_state *s = kzalloc_obj(struct vp7045_fe_state, + GFP_KERNEL); if (s == NULL) goto error; diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index ce1b0d9e0741..ca8432d47301 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -750,7 +750,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) if (!dev->adev.transfer_buffer) return -ENOMEM; - dev->adev.urb = kcalloc(num_urb, sizeof(*dev->adev.urb), GFP_KERNEL); + dev->adev.urb = kzalloc_objs(*dev->adev.urb, num_urb, GFP_KERNEL); if (!dev->adev.urb) { kfree(dev->adev.transfer_buffer); return -ENOMEM; diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index a51cbcf429e1..2fa43caaa968 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3488,7 +3488,7 @@ static int em28xx_media_device_init(struct em28xx *dev, #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; @@ -3905,7 +3905,7 @@ static int em28xx_usb_probe(struct usb_interface *intf, } /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { retval = -ENOMEM; goto err; diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index b94f5c70ab75..c6151d2a21a6 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1500,7 +1500,7 @@ static int em28xx_dvb_init(struct em28xx *dev) dev_info(&dev->intf->dev, "Binding DVB extension\n"); - dvb = kzalloc(sizeof(*dvb), GFP_KERNEL); + dvb = kzalloc_obj(*dvb, GFP_KERNEL); if (!dvb) return -ENOMEM; diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index 5f3b00869bdb..f8de173affd5 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c @@ -724,7 +724,7 @@ static int em28xx_ir_init(struct em28xx *dev) dev_info(&dev->intf->dev, "Registering input extension\n"); - ir = kzalloc(sizeof(*ir), GFP_KERNEL); + ir = kzalloc_obj(*ir, GFP_KERNEL); if (!ir) goto ref_put; rc = rc_allocate_device(RC_DRIVER_SCANCODE); @@ -765,7 +765,7 @@ static int em28xx_ir_init(struct em28xx *dev) goto error; } - ir->i2c_client = kzalloc(sizeof(*ir->i2c_client), GFP_KERNEL); + ir->i2c_client = kzalloc_obj(*ir->i2c_client, GFP_KERNEL); if (!ir->i2c_client) goto error; ir->i2c_client->adapter = &ir->dev->i2c_adap[dev->def_i2c_bus]; diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 2dfa3242a7ab..ca88b6b13724 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -2529,7 +2529,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) mutex_lock(&dev->lock); - v4l2 = kzalloc(sizeof(*v4l2), GFP_KERNEL); + v4l2 = kzalloc_obj(*v4l2, GFP_KERNEL); if (!v4l2) { mutex_unlock(&dev->lock); return -ENOMEM; diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c index 468406302cd5..77f4d9a249ea 100644 --- a/drivers/media/usb/go7007/go7007-driver.c +++ b/drivers/media/usb/go7007/go7007-driver.c @@ -694,7 +694,7 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board, { struct go7007 *go; - go = kzalloc(sizeof(struct go7007), GFP_KERNEL); + go = kzalloc_obj(struct go7007, GFP_KERNEL); if (go == NULL) return NULL; go->dev = dev; diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c index 334cdde81a5c..8a42aaac9cba 100644 --- a/drivers/media/usb/go7007/go7007-usb.c +++ b/drivers/media/usb/go7007/go7007-usb.c @@ -1115,7 +1115,7 @@ static int go7007_usb_probe(struct usb_interface *intf, if (go == NULL) return -ENOMEM; - usb = kzalloc(sizeof(struct go7007_usb), GFP_KERNEL); + usb = kzalloc_obj(struct go7007_usb, GFP_KERNEL); if (usb == NULL) { kfree(go); return -ENOMEM; diff --git a/drivers/media/usb/go7007/s2250-board.c b/drivers/media/usb/go7007/s2250-board.c index a155b987282f..23f577b0cfbf 100644 --- a/drivers/media/usb/go7007/s2250-board.c +++ b/drivers/media/usb/go7007/s2250-board.c @@ -509,7 +509,7 @@ static int s2250_probe(struct i2c_client *client) if (IS_ERR(audio)) return PTR_ERR(audio); - state = kzalloc(sizeof(struct s2250), GFP_KERNEL); + state = kzalloc_obj(struct s2250, GFP_KERNEL); if (state == NULL) { i2c_unregister_device(audio); return -ENOMEM; diff --git a/drivers/media/usb/go7007/snd-go7007.c b/drivers/media/usb/go7007/snd-go7007.c index 9a6bd87fce03..c294c9486611 100644 --- a/drivers/media/usb/go7007/snd-go7007.c +++ b/drivers/media/usb/go7007/snd-go7007.c @@ -207,7 +207,7 @@ int go7007_snd_init(struct go7007 *go) dev++; return -ENOENT; } - gosnd = kmalloc(sizeof(struct go7007_snd), GFP_KERNEL); + gosnd = kmalloc_obj(struct go7007_snd, GFP_KERNEL); if (gosnd == NULL) return -ENOMEM; spin_lock_init(&gosnd->lock); diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c index 303b055fefea..ecb73b0b186b 100644 --- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c +++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c @@ -368,7 +368,7 @@ static int hdcs_probe_1x00(struct sd *sd) sd->gspca_dev.cam.cam_mode = hdcs1x00_mode; sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode); - hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); + hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL); if (!hdcs) return -ENOMEM; @@ -425,7 +425,7 @@ static int hdcs_probe_1020(struct sd *sd) sd->gspca_dev.cam.cam_mode = hdcs1020_mode; sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode); - hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); + hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL); if (!hdcs) return -ENOMEM; diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c index ae382b3b5f7f..984e6283ce83 100644 --- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c @@ -126,7 +126,7 @@ static int pb0100_init_controls(struct sd *sd) .def = 1, }; - ctrls = kzalloc(sizeof(*ctrls), GFP_KERNEL); + ctrls = kzalloc_obj(*ctrls, GFP_KERNEL); if (!ctrls) return -ENOMEM; diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 0b50de8775a3..599ebcad2bcc 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -1348,7 +1348,7 @@ static int hackrf_probe(struct usb_interface *intf, int ret; u8 u8tmp, buf[BUF_SIZE]; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index 52e05a69c46e..eba330e00fb7 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c @@ -276,7 +276,7 @@ static int hdpvr_probe(struct usb_interface *interface, int retval = -ENOMEM; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { dev_err(&interface->dev, "Out of memory\n"); goto error; diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 8c7ae362d992..54c0484a14d8 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -147,7 +147,7 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) for (i = 0; i < count; i++) { - buf = kzalloc(sizeof(struct hdpvr_buffer), GFP_KERNEL); + buf = kzalloc_obj(struct hdpvr_buffer, GFP_KERNEL); if (!buf) { v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n"); goto exit; @@ -379,7 +379,7 @@ static int hdpvr_stop_streaming(struct hdpvr_device *dev) static int hdpvr_open(struct file *file) { - struct hdpvr_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); + struct hdpvr_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); if (fh == NULL) return -ENOMEM; diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 33099f39146a..330955ddb703 100644 --- a/drivers/media/usb/msi2500/msi2500.c +++ b/drivers/media/usb/msi2500/msi2500.c @@ -1170,7 +1170,7 @@ static int msi2500_probe(struct usb_interface *intf, .max_speed_hz = 12000000, }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c index 73c95ba2328a..ca970f7f4bc0 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-context.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c @@ -204,7 +204,7 @@ struct pvr2_context *pvr2_context_create( void (*setup_func)(struct pvr2_context *)) { struct pvr2_context *mp = NULL; - mp = kzalloc(sizeof(*mp),GFP_KERNEL); + mp = kzalloc_obj(*mp, GFP_KERNEL); if (!mp) goto done; pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (create)",mp); mp->setup_func = setup_func; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c index 3610139fb9ad..064c11b7effe 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c @@ -449,7 +449,7 @@ struct pvr2_dvb_adapter *pvr2_dvb_create(struct pvr2_context *pvr) the DVB side of the driver either. For now. */ return NULL; } - adap = kzalloc(sizeof(*adap), GFP_KERNEL); + adap = kzalloc_obj(*adap, GFP_KERNEL); if (!adap) return adap; pvr2_channel_init(&adap->channel, pvr); adap->channel.check_func = pvr2_dvb_internal_check; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 5807734ae26c..fe988c6b693f 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2367,7 +2367,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, goto fail; } - hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); + hdw = kzalloc_obj(*hdw, GFP_KERNEL); pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", hdw,hdw_desc->description); pvr2_trace(PVR2_TRACE_INFO, "Hardware description: %s", @@ -2424,8 +2424,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, hdw->control_cnt = CTRLDEF_COUNT; hdw->control_cnt += MPEGDEF_COUNT; - hdw->controls = kcalloc(hdw->control_cnt, sizeof(struct pvr2_ctrl), - GFP_KERNEL); + hdw->controls = kzalloc_objs(struct pvr2_ctrl, hdw->control_cnt, + GFP_KERNEL); if (!hdw->controls) goto fail; hdw->hdw_desc = hdw_desc; hdw->ir_scheme_active = hdw->hdw_desc->ir_scheme; @@ -2450,9 +2450,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, } /* Define and configure additional controls from cx2341x module. */ - hdw->mpeg_ctrl_info = kcalloc(MPEGDEF_COUNT, - sizeof(*(hdw->mpeg_ctrl_info)), - GFP_KERNEL); + hdw->mpeg_ctrl_info = kzalloc_objs(*(hdw->mpeg_ctrl_info), + MPEGDEF_COUNT, GFP_KERNEL); if (!hdw->mpeg_ctrl_info) goto fail; for (idx = 0; idx < MPEGDEF_COUNT; idx++) { cptr = hdw->controls + idx + CTRLDEF_COUNT; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-io.c b/drivers/media/usb/pvrusb2/pvrusb2-io.c index 28ffe7981f8c..1341967ac666 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-io.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-io.c @@ -299,7 +299,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt) if (scnt > sp->buffer_slot_count) { struct pvr2_buffer **nb; - nb = kmalloc_array(scnt, sizeof(*nb), GFP_KERNEL); + nb = kmalloc_objs(*nb, scnt, GFP_KERNEL); if (!nb) return -ENOMEM; if (sp->buffer_slot_count) { memcpy(nb, sp->buffers, @@ -311,7 +311,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt) } while (sp->buffer_total_count < cnt) { struct pvr2_buffer *bp; - bp = kmalloc(sizeof(*bp), GFP_KERNEL); + bp = kmalloc_obj(*bp, GFP_KERNEL); if (!bp) return -ENOMEM; ret = pvr2_buffer_init(bp, sp, sp->buffer_total_count); if (ret) { @@ -460,7 +460,7 @@ static void buffer_complete(struct urb *urb) struct pvr2_stream *pvr2_stream_create(void) { struct pvr2_stream *sp; - sp = kzalloc(sizeof(*sp), GFP_KERNEL); + sp = kzalloc_obj(*sp, GFP_KERNEL); if (!sp) return sp; pvr2_trace(PVR2_TRACE_INIT, "pvr2_stream_create: sp=%p", sp); pvr2_stream_init(sp); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c index 46f8013849b9..d397231f153d 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c @@ -73,7 +73,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) struct pvr2_ioread *pvr2_ioread_create(void) { struct pvr2_ioread *cp; - cp = kzalloc(sizeof(*cp),GFP_KERNEL); + cp = kzalloc_obj(*cp, GFP_KERNEL); if (!cp) return NULL; pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); if (pvr2_ioread_init(cp) < 0) { diff --git a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c index 3077399901aa..f2cb644ca3d7 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c @@ -289,7 +289,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); if (!cptr) return; - cip = kzalloc(sizeof(*cip),GFP_KERNEL); + cip = kzalloc_obj(*cip, GFP_KERNEL); if (!cip) return; pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); @@ -411,7 +411,7 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) struct pvr2_sysfs_debugifc *dip; int ret; - dip = kzalloc(sizeof(*dip),GFP_KERNEL); + dip = kzalloc_obj(*dip, GFP_KERNEL); if (!dip) return; sysfs_attr_init(&dip->attr_debugcmd.attr); dip->attr_debugcmd.attr.name = "debugcmd"; @@ -615,7 +615,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp) usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); if (!usb_dev) return; - class_dev = kzalloc(sizeof(*class_dev),GFP_KERNEL); + class_dev = kzalloc_obj(*class_dev, GFP_KERNEL); if (!class_dev) return; pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); @@ -748,7 +748,7 @@ static void pvr2_sysfs_internal_check(struct pvr2_channel *chp) void pvr2_sysfs_create(struct pvr2_context *mp) { struct pvr2_sysfs *sfp; - sfp = kzalloc(sizeof(*sfp),GFP_KERNEL); + sfp = kzalloc_obj(*sfp, GFP_KERNEL); if (!sfp) return; pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index f9535a484738..6fd0bfb5f699 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -944,7 +944,7 @@ static int pvr2_v4l2_open(struct file *file) return -EIO; } - fhp = kzalloc(sizeof(*fhp),GFP_KERNEL); + fhp = kzalloc_obj(*fhp, GFP_KERNEL); if (!fhp) { return -ENOMEM; } @@ -1236,7 +1236,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) { struct pvr2_v4l2 *vp; - vp = kzalloc(sizeof(*vp),GFP_KERNEL); + vp = kzalloc_obj(*vp, GFP_KERNEL); if (!vp) return vp; pvr2_channel_init(&vp->channel,mnp); pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp); @@ -1244,12 +1244,12 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) vp->channel.check_func = pvr2_v4l2_internal_check; /* register streams */ - vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL); + vp->dev_video = kzalloc_obj(*vp->dev_video, GFP_KERNEL); if (!vp->dev_video) goto fail; pvr2_v4l2_dev_init(vp->dev_video,vp,VFL_TYPE_VIDEO); if (pvr2_hdw_get_input_available(vp->channel.mc_head->hdw) & (1 << PVR2_CVAL_INPUT_RADIO)) { - vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL); + vp->dev_radio = kzalloc_obj(*vp->dev_radio, GFP_KERNEL); if (!vp->dev_radio) goto fail; pvr2_v4l2_dev_init(vp->dev_radio,vp,VFL_TYPE_RADIO); } diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index c6e5d031f068..b57502237f3a 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c @@ -1026,7 +1026,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id PWC_WARNING("Warning: more than 1 configuration available.\n"); /* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */ - pdev = kzalloc(sizeof(struct pwc_device), GFP_KERNEL); + pdev = kzalloc_obj(struct pwc_device, GFP_KERNEL); if (pdev == NULL) { PWC_ERROR("Oops, could not allocate memory for pwc_device.\n"); return -ENOMEM; diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 8332f2c5aed7..189a356eaf34 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -2207,7 +2207,7 @@ static int s2255_probe(struct usb_interface *interface, int fw_size; /* allocate memory for our device state and initialize it to zero */ - dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL); + dev = kzalloc_obj(struct s2255_dev, GFP_KERNEL); if (dev == NULL) { s2255_dev_err(&interface->dev, "out of memory\n"); return -ENOMEM; @@ -2221,7 +2221,7 @@ static int s2255_probe(struct usb_interface *interface, refcount_set(&dev->num_channels, 0); dev->pid = id->idProduct; - dev->fw_data = kzalloc(sizeof(struct s2255_fw), GFP_KERNEL); + dev->fw_data = kzalloc_obj(struct s2255_fw, GFP_KERNEL); if (!dev->fw_data) goto errorFWDATA1; mutex_init(&dev->lock); diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 2c8179a84991..4d9cb4184ca2 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -367,7 +367,7 @@ static void *siano_media_device_register(struct smsusb_device_t *dev, struct sms_board *board = sms_get_board(board_id); int ret; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return NULL; @@ -397,7 +397,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) int align = 0; /* create device object */ - dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); + dev = kzalloc_obj(struct smsusb_device_t, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c index 25d725c2ab3c..ec4a9e2f42ab 100644 --- a/drivers/media/usb/stk1160/stk1160-core.c +++ b/drivers/media/usb/stk1160/stk1160-core.c @@ -295,7 +295,7 @@ static int stk1160_probe(struct usb_interface *interface, return rc; } - dev = kzalloc(sizeof(struct stk1160), GFP_KERNEL); + dev = kzalloc_obj(struct stk1160, GFP_KERNEL); if (dev == NULL) { kfree(alt_max_pkt_size); return -ENOMEM; diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c index 9e016b71aa91..9cd0ea41300c 100644 --- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c @@ -1606,7 +1606,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; - if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL))) + if (!(ttusb = kzalloc_obj(struct ttusb, GFP_KERNEL))) return -ENOMEM; ttusb->dev = udev; diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c index b4575fe89c95..24ba5c1c48d2 100644 --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c @@ -809,8 +809,7 @@ static void ttusb_dec_process_urb(struct urb *urb) b = urb->transfer_buffer + d->offset; length = d->actual_length; - if ((frame = kmalloc(sizeof(struct urb_frame), - GFP_ATOMIC))) { + if ((frame = kmalloc_obj(struct urb_frame, GFP_ATOMIC))) { unsigned long flags; memcpy(frame->data, b, length); @@ -1061,8 +1060,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed) if (!result) { if (c_length == 2) { - if (!(finfo = kmalloc(sizeof(struct filter_info), - GFP_ATOMIC))) + if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC))) return -ENOMEM; finfo->stream_id = c[1]; @@ -1644,7 +1642,7 @@ static int ttusb_dec_probe(struct usb_interface *intf, udev = interface_to_usbdev(intf); - if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) { + if (!(dec = kzalloc_obj(struct ttusb_dec, GFP_KERNEL))) { printk("%s: couldn't allocate memory.\n", __func__); return -ENOMEM; } diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c index dff6bf532ce3..df4ade291db4 100644 --- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c +++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c @@ -198,7 +198,7 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf struct ttusbdecfe_state* state = NULL; /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); + state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL); if (state == NULL) return NULL; @@ -218,7 +218,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf struct ttusbdecfe_state* state = NULL; /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); + state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c index 1f7620cd2996..12ed28253d0c 100644 --- a/drivers/media/usb/usbtv/usbtv-core.c +++ b/drivers/media/usb/usbtv/usbtv-core.c @@ -87,7 +87,7 @@ static int usbtv_probe(struct usb_interface *intf, size = size * usb_endpoint_maxp_mult(&ep->desc); /* Device structure */ - usbtv = kzalloc(sizeof(struct usbtv), GFP_KERNEL); + usbtv = kzalloc_obj(struct usbtv, GFP_KERNEL); if (usbtv == NULL) return -ENOMEM; usbtv->dev = dev; diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index f0f6f8454d9c..2c511d1d9bf9 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -600,7 +600,7 @@ static const struct uvc_control_mapping *uvc_ctrl_filter_plf_mapping( u8 init_val; int ret; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) return NULL; @@ -3339,8 +3339,7 @@ static int uvc_ctrl_init_chain(struct uvc_video_chain *chain) if (ncontrols == 0) continue; - entity->controls = kcalloc(ncontrols, sizeof(*ctrl), - GFP_KERNEL); + entity->controls = kzalloc_objs(*ctrl, ncontrols, GFP_KERNEL); if (entity->controls == NULL) return -ENOMEM; entity->ncontrols = ncontrols; diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c index 14fa41cb8148..1ea4a4e82662 100644 --- a/drivers/media/usb/uvc/uvc_debugfs.c +++ b/drivers/media/usb/uvc/uvc_debugfs.c @@ -29,7 +29,7 @@ static int uvc_debugfs_stats_open(struct inode *inode, struct file *file) struct uvc_streaming *stream = inode->i_private; struct uvc_debugfs_buffer *buf; - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (buf == NULL) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index aa3e8d295e0f..05c5f70c0a93 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -200,7 +200,7 @@ static struct uvc_streaming *uvc_stream_new(struct uvc_device *dev, { struct uvc_streaming *stream; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (stream == NULL) return NULL; @@ -1761,7 +1761,7 @@ static struct uvc_video_chain *uvc_alloc_chain(struct uvc_device *dev) { struct uvc_video_chain *chain; - chain = kzalloc(sizeof(*chain), GFP_KERNEL); + chain = kzalloc_obj(*chain, GFP_KERNEL); if (chain == NULL) return NULL; @@ -2193,7 +2193,7 @@ static int uvc_probe(struct usb_interface *intf, int ret; /* Allocate memory for the device and initialize it. */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c index c23b174965c3..59e2b05aaf21 100644 --- a/drivers/media/usb/uvc/uvc_metadata.c +++ b/drivers/media/usb/uvc/uvc_metadata.c @@ -181,7 +181,7 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev) * USB requires buffers aligned in a special way, simplest way is to * make sure that query_ctrl will work is to kmalloc() them. */ - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c index 231cfee8e7c2..018d25101bb8 100644 --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c @@ -263,7 +263,7 @@ int uvc_status_init(struct uvc_device *dev) if (ep == NULL) return 0; - dev->status = kzalloc(sizeof(*dev->status), GFP_KERNEL); + dev->status = kzalloc_obj(*dev->status, GFP_KERNEL); if (!dev->status) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 30c160daed8c..98e6c4135dfd 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -133,7 +133,7 @@ static int uvc_ioctl_xu_ctrl_map(struct uvc_video_chain *chain, return -EINVAL; } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) return -ENOMEM; @@ -572,7 +572,7 @@ static int uvc_v4l2_open(struct file *file) uvc_dbg(stream->dev, CALLS, "%s\n", __func__); /* Create the device handle. */ - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 59eb95a4b70c..249a225563f9 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -682,8 +682,7 @@ static int uvc_video_clock_init(struct uvc_clock *clock) spin_lock_init(&clock->lock); clock->size = 32; - clock->samples = kmalloc_array(clock->size, sizeof(*clock->samples), - GFP_KERNEL); + clock->samples = kmalloc_objs(*clock->samples, clock->size, GFP_KERNEL); if (clock->samples == NULL) return -ENOMEM; diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index 5687089bea6e..b6e7c11ef7e5 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v4l2-core/tuner-core.c @@ -633,7 +633,7 @@ static int tuner_probe(struct i2c_client *client) int ret; #endif - t = kzalloc(sizeof(struct tuner), GFP_KERNEL); + t = kzalloc_obj(struct tuner, GFP_KERNEL); if (NULL == t) return -ENOMEM; v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops); diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index 1c08bba9ecb9..c04a0e7c6edf 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -779,7 +779,7 @@ int v4l2_async_subdev_endpoint_add(struct v4l2_subdev *sd, { struct v4l2_async_subdev_endpoint *ase; - ase = kmalloc(sizeof(*ase), GFP_KERNEL); + ase = kmalloc_obj(*ase, GFP_KERNEL); if (!ase) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-ctrls-api.c b/drivers/media/v4l2-core/v4l2-ctrls-api.c index 0078a04c5445..03040c8eaa79 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-api.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-api.c @@ -431,8 +431,7 @@ int v4l2_g_ext_ctrls_common(struct v4l2_ctrl_handler *hdl, return class_check(hdl, cs->which); if (cs->count > ARRAY_SIZE(helper)) { - helpers = kvmalloc_array(cs->count, sizeof(helper[0]), - GFP_KERNEL); + helpers = kvmalloc_objs(helper[0], cs->count, GFP_KERNEL); if (!helpers) return -ENOMEM; } @@ -617,8 +616,7 @@ int try_set_ext_ctrls_common(struct v4l2_fh *fh, return class_check(hdl, cs->which); if (cs->count > ARRAY_SIZE(helper)) { - helpers = kvmalloc_array(cs->count, sizeof(helper[0]), - GFP_KERNEL); + helpers = kvmalloc_objs(helper[0], cs->count, GFP_KERNEL); if (!helpers) return -ENOMEM; } diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index 79a157975f70..3e8b4a38b8ae 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -1725,8 +1725,8 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl, INIT_LIST_HEAD(&hdl->ctrls); INIT_LIST_HEAD(&hdl->ctrl_refs); hdl->nr_of_buckets = 1 + nr_of_controls_hint / 8; - hdl->buckets = kvcalloc(hdl->nr_of_buckets, sizeof(hdl->buckets[0]), - GFP_KERNEL); + hdl->buckets = kvzalloc_objs(hdl->buckets[0], hdl->nr_of_buckets, + GFP_KERNEL); hdl->error = hdl->buckets ? 0 : -ENOMEM; v4l2_ctrl_handler_init_request(hdl); return hdl->error; diff --git a/drivers/media/v4l2-core/v4l2-ctrls-request.c b/drivers/media/v4l2-core/v4l2-ctrls-request.c index e77f722b36a4..e6d7f731d01a 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-request.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-request.c @@ -198,7 +198,7 @@ v4l2_ctrls_find_req_obj(struct v4l2_ctrl_handler *hdl, if (!set) return ERR_PTR(-ENOMEM); - new_hdl = kzalloc(sizeof(*new_hdl), GFP_KERNEL); + new_hdl = kzalloc_obj(*new_hdl, GFP_KERNEL); if (!new_hdl) return ERR_PTR(-ENOMEM); @@ -341,7 +341,7 @@ void v4l2_ctrl_request_complete(struct media_request *req, int ret; /* Create a new request so the driver can return controls */ - hdl = kzalloc(sizeof(*hdl), GFP_KERNEL); + hdl = kzalloc_obj(*hdl, GFP_KERNEL); if (!hdl) return; diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 10a126e50c1c..8add56232e84 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -146,7 +146,7 @@ static inline int devnode_find(struct video_device *vdev, int from, int to) struct video_device *video_device_alloc(void) { - return kzalloc(sizeof(struct video_device), GFP_KERNEL); + return kzalloc_obj(struct video_device, GFP_KERNEL); } EXPORT_SYMBOL(video_device_alloc); diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c index 63b12ef9d4d9..779ae282ab11 100644 --- a/drivers/media/v4l2-core/v4l2-device.c +++ b/drivers/media/v4l2-core/v4l2-device.c @@ -205,7 +205,7 @@ int __v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev, if (sd->devnode) continue; - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) { err = -ENOMEM; goto clean_up; diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 346d1b0e10ce..a6233bdab3d4 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c @@ -1237,7 +1237,7 @@ struct v4l2_debugfs_if *v4l2_debugfs_if_alloc(struct dentry *root, u32 if_types, if (IS_ERR_OR_NULL(root) || !if_types || !if_read) return NULL; - infoframes = kzalloc(sizeof(*infoframes), GFP_KERNEL); + infoframes = kzalloc_obj(*infoframes, GFP_KERNEL); if (!infoframes) return NULL; diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c index 3898ff7edddb..b92561fb65d4 100644 --- a/drivers/media/v4l2-core/v4l2-event.c +++ b/drivers/media/v4l2-core/v4l2-event.c @@ -235,7 +235,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, if (elems < 1) elems = 1; - sev = kvzalloc(struct_size(sev, events, elems), GFP_KERNEL); + sev = kvzalloc_flex(*sev, events, elems, GFP_KERNEL); if (!sev) return -ENOMEM; sev->elems = elems; diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c index df3ba9d4674b..fdd247b945a3 100644 --- a/drivers/media/v4l2-core/v4l2-fh.c +++ b/drivers/media/v4l2-core/v4l2-fh.c @@ -57,7 +57,7 @@ EXPORT_SYMBOL_GPL(v4l2_fh_add); int v4l2_fh_open(struct file *filp) { struct video_device *vdev = video_devdata(filp); - struct v4l2_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); + struct v4l2_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); if (fh == NULL) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-flash-led-class.c b/drivers/media/v4l2-core/v4l2-flash-led-class.c index 355595a0fefa..735434d4b4c2 100644 --- a/drivers/media/v4l2-core/v4l2-flash-led-class.c +++ b/drivers/media/v4l2-core/v4l2-flash-led-class.c @@ -443,8 +443,8 @@ static int v4l2_flash_init_controls(struct v4l2_flash *v4l2_flash, return -ENOMEM; /* allocate memory dynamically so as not to exceed stack frame size */ - ctrl_init_data = kcalloc(NUM_FLASH_CTRLS, sizeof(*ctrl_init_data), - GFP_KERNEL); + ctrl_init_data = kzalloc_objs(*ctrl_init_data, NUM_FLASH_CTRLS, + GFP_KERNEL); if (!ctrl_init_data) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 22ec702a4567..c3ea009b8ffb 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -785,7 +785,7 @@ int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode, if (!connector_ep) return -ENOTCONN; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) { err = -ENOMEM; goto err; @@ -1257,7 +1257,7 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd) if (WARN_ON(!sd->dev)) return -ENODEV; - notifier = kzalloc(sizeof(*notifier), GFP_KERNEL); + notifier = kzalloc_obj(*notifier, GFP_KERNEL); if (!notifier) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index b661f483dad3..2c933f4644aa 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -1190,7 +1190,7 @@ struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops) if (!m2m_ops || WARN_ON(!m2m_ops->device_run)) return ERR_PTR(-EINVAL); - m2m_dev = kzalloc(sizeof *m2m_dev, GFP_KERNEL); + m2m_dev = kzalloc_obj(*m2m_dev, GFP_KERNEL); if (!m2m_dev) return ERR_PTR(-ENOMEM); @@ -1238,7 +1238,7 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, struct v4l2_m2m_queue_ctx *out_q_ctx, *cap_q_ctx; int ret; - m2m_ctx = kzalloc(sizeof *m2m_ctx, GFP_KERNEL); + m2m_ctx = kzalloc_obj(*m2m_ctx, GFP_KERNEL); if (!m2m_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 66842b975f91..c358cb40b829 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -99,7 +99,7 @@ static int subdev_open(struct file *file) struct v4l2_subdev_fh *subdev_fh; int ret; - subdev_fh = kzalloc(sizeof(*subdev_fh), GFP_KERNEL); + subdev_fh = kzalloc_obj(*subdev_fh, GFP_KERNEL); if (subdev_fh == NULL) return -ENOMEM; @@ -1606,7 +1606,7 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name, struct v4l2_subdev_state *state; int ret; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); @@ -1620,8 +1620,8 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name, /* Drivers that support streams do not need the legacy pad config */ if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS) && sd->entity.num_pads) { - state->pads = kvcalloc(sd->entity.num_pads, - sizeof(*state->pads), GFP_KERNEL); + state->pads = kvzalloc_objs(*state->pads, sd->entity.num_pads, + GFP_KERNEL); if (!state->pads) { ret = -ENOMEM; goto err; @@ -1889,9 +1889,9 @@ v4l2_subdev_init_stream_configs(struct v4l2_subdev_stream_configs *stream_config } if (new_configs.num_configs) { - new_configs.configs = kvcalloc(new_configs.num_configs, - sizeof(*new_configs.configs), - GFP_KERNEL); + new_configs.configs = kvzalloc_objs(*new_configs.configs, + new_configs.num_configs, + GFP_KERNEL); if (!new_configs.configs) return -ENOMEM; diff --git a/drivers/memory/samsung/exynos-srom.c b/drivers/memory/samsung/exynos-srom.c index d913fb901973..1863c85642dd 100644 --- a/drivers/memory/samsung/exynos-srom.c +++ b/drivers/memory/samsung/exynos-srom.c @@ -54,7 +54,7 @@ exynos_srom_alloc_reg_dump(const unsigned long *rdump, struct exynos_srom_reg_dump *rd; unsigned int i; - rd = kcalloc(nr_rdump, sizeof(*rd), GFP_KERNEL); + rd = kzalloc_objs(*rd, nr_rdump, GFP_KERNEL); if (!rd) return NULL; diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c index 9978ff911c47..68496f9012ff 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -1291,7 +1291,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c index 9d7393e19f12..965bfab127f5 100644 --- a/drivers/memory/tegra/tegra124.c +++ b/drivers/memory/tegra/tegra124.c @@ -1182,7 +1182,7 @@ tegra124_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data if (node->id != idx) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c index 398cb8ae2e38..48a546315d1c 100644 --- a/drivers/memory/tegra/tegra20-emc.c +++ b/drivers/memory/tegra/tegra20-emc.c @@ -958,7 +958,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra20.c b/drivers/memory/tegra/tegra20.c index a3022e715dee..40bee3ff4a45 100644 --- a/drivers/memory/tegra/tegra20.c +++ b/drivers/memory/tegra/tegra20.c @@ -401,7 +401,7 @@ tegra20_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != idx) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); @@ -615,7 +615,7 @@ static int tegra20_mc_stats_show(struct seq_file *s, void *unused) struct tegra20_mc_client_stat *stats; unsigned int i; - stats = kcalloc(mc->soc->num_clients + 1, sizeof(*stats), GFP_KERNEL); + stats = kzalloc_objs(*stats, mc->soc->num_clients + 1, GFP_KERNEL); if (!stats) return -ENOMEM; diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 914116d8ec16..8226cadc1f8f 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -1476,7 +1476,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra30.c b/drivers/memory/tegra/tegra30.c index d3e685c8431f..d9f255da5c0e 100644 --- a/drivers/memory/tegra/tegra30.c +++ b/drivers/memory/tegra/tegra30.c @@ -1344,7 +1344,7 @@ tegra30_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != idx) continue; - ndata = kzalloc(sizeof(*ndata), GFP_KERNEL); + ndata = kzalloc_obj(*ndata, GFP_KERNEL); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index acafc910bbac..d3641ba53bc9 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c @@ -380,8 +380,7 @@ EXPORT_SYMBOL(memstick_set_rw_addr); static struct memstick_dev *memstick_alloc_card(struct memstick_host *host) { - struct memstick_dev *card = kzalloc(sizeof(struct memstick_dev), - GFP_KERNEL); + struct memstick_dev *card = kzalloc_obj(struct memstick_dev, GFP_KERNEL); struct memstick_dev *old_card = host->card; struct ms_id_register id_reg; diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index 1af157ce0a63..6835849bf309 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -1203,8 +1203,7 @@ static int msb_read_boot_blocks(struct msb_data *msb) dbg_verbose("Start of a scan for the boot blocks"); if (!msb->boot_page) { - page = kmalloc_array(2, sizeof(struct ms_boot_page), - GFP_KERNEL); + page = kmalloc_objs(struct ms_boot_page, 2, GFP_KERNEL); if (!page) return -ENOMEM; @@ -2151,7 +2150,7 @@ static int msb_probe(struct memstick_dev *card) struct msb_data *msb; int rc = 0; - msb = kzalloc(sizeof(struct msb_data), GFP_KERNEL); + msb = kzalloc_obj(struct msb_data, GFP_KERNEL); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -2225,7 +2224,7 @@ static int msb_resume(struct memstick_dev *card) #endif mutex_lock(&card->host->lock); - new_msb = kzalloc(sizeof(struct msb_data), GFP_KERNEL); + new_msb = kzalloc_obj(struct msb_data, GFP_KERNEL); if (!new_msb) goto out; diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index e507bb11c802..57c2b28f88bd 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -939,9 +939,8 @@ static int mspro_block_read_attributes(struct memstick_dev *card) } else attr_count = attr->count; - msb->attr_group.attrs = kcalloc(attr_count + 1, - sizeof(*msb->attr_group.attrs), - GFP_KERNEL); + msb->attr_group.attrs = kzalloc_objs(*msb->attr_group.attrs, + attr_count + 1, GFP_KERNEL); if (!msb->attr_group.attrs) { rc = -ENOMEM; goto out_free_attr; @@ -955,7 +954,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card) } for (cnt = 0; cnt < attr_count; ++cnt) { - s_attr = kzalloc(sizeof(struct mspro_sys_attr), GFP_KERNEL); + s_attr = kzalloc_obj(struct mspro_sys_attr, GFP_KERNEL); if (!s_attr) { rc = -ENOMEM; goto out_free_buffer; @@ -1211,7 +1210,7 @@ static int mspro_block_probe(struct memstick_dev *card) struct mspro_block_data *msb; int rc = 0; - msb = kzalloc(sizeof(struct mspro_block_data), GFP_KERNEL); + msb = kzalloc_obj(struct mspro_block_data, GFP_KERNEL); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -1298,7 +1297,7 @@ static int mspro_block_resume(struct memstick_dev *card) unsigned char cnt; mutex_lock(&host->lock); - new_msb = kzalloc(sizeof(struct mspro_block_data), GFP_KERNEL); + new_msb = kzalloc_obj(struct mspro_block_data, GFP_KERNEL); if (!new_msb) { rc = -ENOMEM; goto out_unlock; diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c index 79e66e30417c..122300b89279 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -926,7 +926,7 @@ static int jmb38x_ms_probe(struct pci_dev *pdev, goto err_out_int; } - jm = kzalloc(struct_size(jm, hosts, cnt), GFP_KERNEL); + jm = kzalloc_flex(*jm, hosts, cnt, GFP_KERNEL); if (!jm) { rc = -ENOMEM; goto err_out_int; diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index e60a8d3947c9..de771eb6facd 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1771,7 +1771,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) struct proc_dir_entry *dent; #endif - ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_KERNEL); + ioc = kzalloc_obj(MPT_ADAPTER, GFP_KERNEL); if (ioc == NULL) { printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); return -ENOMEM; @@ -5700,8 +5700,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) continue; - if ((component_info = kmalloc(sizeof (*component_info), - GFP_KERNEL)) == NULL) + if ((component_info = kmalloc_obj(*component_info, GFP_KERNEL)) == NULL) continue; component_info->volumeID = id; diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index cd52db6fe76c..b65bc679106a 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -484,7 +484,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) } } if (new_ri) { /* allocate one */ - ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); + ri = kzalloc_obj(struct mptfc_rport_info, GFP_KERNEL); if (!ri) return; list_add_tail(&ri->list, &ioc->fc_rports); @@ -572,7 +572,7 @@ mptfc_target_alloc(struct scsi_target *starget) struct mptfc_rport_info *ri; int rc; - vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); if (!vtarget) return -ENOMEM; starget->hostdata = vtarget; @@ -650,7 +650,7 @@ mptfc_sdev_init(struct scsi_device *sdev) hd = shost_priv(sdev->host); ioc = hd->ioc; - vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index de2e7bcf4784..0da0d472aaff 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c @@ -391,14 +391,13 @@ mpt_lan_open(struct net_device *dev) "a moment.\n"); } - priv->mpt_txfidx = kmalloc_array(priv->tx_max_out, sizeof(int), - GFP_KERNEL); + priv->mpt_txfidx = kmalloc_objs(int, priv->tx_max_out, GFP_KERNEL); if (priv->mpt_txfidx == NULL) goto out; priv->mpt_txfidx_tail = -1; - priv->SendCtl = kcalloc(priv->tx_max_out, sizeof(struct BufferControl), - GFP_KERNEL); + priv->SendCtl = kzalloc_objs(struct BufferControl, priv->tx_max_out, + GFP_KERNEL); if (priv->SendCtl == NULL) goto out_mpt_txfidx; for (i = 0; i < priv->tx_max_out; i++) @@ -406,15 +405,13 @@ mpt_lan_open(struct net_device *dev) dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); - priv->mpt_rxfidx = kmalloc_array(priv->max_buckets_out, sizeof(int), - GFP_KERNEL); + priv->mpt_rxfidx = kmalloc_objs(int, priv->max_buckets_out, GFP_KERNEL); if (priv->mpt_rxfidx == NULL) goto out_SendCtl; priv->mpt_rxfidx_tail = -1; - priv->RcvCtl = kcalloc(priv->max_buckets_out, - sizeof(struct BufferControl), - GFP_KERNEL); + priv->RcvCtl = kzalloc_objs(struct BufferControl, priv->max_buckets_out, + GFP_KERNEL); if (priv->RcvCtl == NULL) goto out_mpt_rxfidx; for (i = 0; i < priv->max_buckets_out; i++) diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 5276bdb7acc2..0b9e787ae3d5 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -603,7 +603,7 @@ mptsas_add_device_component(MPT_ADAPTER *ioc, u8 channel, u8 id, } } - sas_info = kzalloc(sizeof(struct mptsas_device_info), GFP_KERNEL); + sas_info = kzalloc_obj(struct mptsas_device_info, GFP_KERNEL); if (!sas_info) goto out; @@ -756,7 +756,7 @@ mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc, } } - sas_info = kzalloc(sizeof(struct mptsas_device_info), GFP_KERNEL); + sas_info = kzalloc_obj(struct mptsas_device_info, GFP_KERNEL); if (sas_info) { sas_info->fw.id = starget->id; sas_info->os.id = starget->id; @@ -907,8 +907,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) * Forming a port */ if (!port_details) { - port_details = kzalloc(sizeof(struct - mptsas_portinfo_details), GFP_KERNEL); + port_details = kzalloc_obj(struct mptsas_portinfo_details, + GFP_KERNEL); if (!port_details) goto out; port_details->num_phys = 1; @@ -1038,7 +1038,7 @@ mptsas_queue_rescan(MPT_ADAPTER *ioc) { struct fw_event_work *fw_event; - fw_event = kzalloc(sizeof(*fw_event), GFP_ATOMIC); + fw_event = kzalloc_obj(*fw_event, GFP_ATOMIC); if (!fw_event) { printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", ioc->name, __func__, __LINE__); @@ -1150,8 +1150,8 @@ mptsas_target_reset_queue(MPT_ADAPTER *ioc, vtarget->deleted = 1; /* block IO */ } - target_reset_list = kzalloc(sizeof(struct mptsas_target_reset_event), - GFP_ATOMIC); + target_reset_list = kzalloc_obj(struct mptsas_target_reset_event, + GFP_ATOMIC); if (!target_reset_list) { dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n", @@ -1751,7 +1751,7 @@ mptsas_target_alloc(struct scsi_target *starget) int i; MPT_ADAPTER *ioc = hd->ioc; - vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); if (!vtarget) return -ENOMEM; @@ -1878,7 +1878,7 @@ mptsas_sdev_init(struct scsi_device *sdev) int i; MPT_ADAPTER *ioc = hd->ioc; - vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kzalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); @@ -2428,8 +2428,8 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) goto out_free_consistent; port_info->num_phys = buffer->NumPhys; - port_info->phy_info = kcalloc(port_info->num_phys, - sizeof(struct mptsas_phyinfo), GFP_KERNEL); + port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo, + port_info->num_phys, GFP_KERNEL); if (!port_info->phy_info) { error = -ENOMEM; goto out_free_consistent; @@ -2719,8 +2719,8 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, /* save config data */ port_info->num_phys = (buffer->NumPhys) ? buffer->NumPhys : 1; - port_info->phy_info = kcalloc(port_info->num_phys, - sizeof(struct mptsas_phyinfo), GFP_KERNEL); + port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo, + port_info->num_phys, GFP_KERNEL); if (!port_info->phy_info) { error = -ENOMEM; goto out_free_consistent; @@ -3309,7 +3309,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) struct mptsas_portinfo *port_info, *hba; int error = -ENOMEM, i; - hba = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL); + hba = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); if (! hba) goto out; @@ -3444,12 +3444,12 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc, int i; __le64 sas_address; - port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); BUG_ON(!port_info); port_info->num_phys = (expander_data->NumPhys) ? expander_data->NumPhys : 1; - port_info->phy_info = kcalloc(port_info->num_phys, - sizeof(struct mptsas_phyinfo), GFP_KERNEL); + port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo, + port_info->num_phys, GFP_KERNEL); BUG_ON(!port_info->phy_info); memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64)); for (i = 0; i < port_info->num_phys; i++) { @@ -3677,7 +3677,7 @@ mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle) MPI_SAS_EXPAND_PGAD_FORM_SHIFT), handle))) return NULL; - port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); if (!port_info) { dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "%s: exit at line=%d\n", ioc->name, @@ -3945,7 +3945,7 @@ mptsas_probe_expanders(MPT_ADAPTER *ioc) continue; } - port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); if (!port_info) { dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "%s: exit at line=%d\n", ioc->name, diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 14707d19fbbd..62cf9d582386 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -405,7 +405,7 @@ static int mptspi_target_alloc(struct scsi_target *starget) return -ENODEV; ioc = hd->ioc; - vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); if (!vtarget) return -ENOMEM; @@ -725,7 +725,7 @@ static int mptspi_sdev_init(struct scsi_device *sdev) mptscsih_is_phys_disk(ioc, 0, sdev->id) == 0) return -ENXIO; - vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); @@ -1152,7 +1152,7 @@ static void mpt_work_wrapper(struct work_struct *work) static void mpt_dv_raid(struct _MPT_SCSI_HOST *hd, int disk) { - struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC); + struct work_queue_wrapper *wqw = kmalloc_obj(*wqw, GFP_ATOMIC); MPT_ADAPTER *ioc = hd->ioc; if (!wqw) { @@ -1288,7 +1288,7 @@ mptspi_dv_renegotiate_work(struct work_struct *work) static void mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd) { - struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC); + struct work_queue_wrapper *wqw = kmalloc_obj(*wqw, GFP_ATOMIC); if (!wqw) return; diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index dc80a272726b..777cb2a24983 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -188,7 +188,7 @@ static int ec_device_probe(struct platform_device *pdev) struct device_node *node; struct device *dev = &pdev->dev; struct cros_ec_platform *ec_platform = dev_get_platdata(dev); - struct cros_ec_dev *ec = kzalloc(sizeof(*ec), GFP_KERNEL); + struct cros_ec_dev *ec = kzalloc_obj(*ec, GFP_KERNEL); struct ec_response_pchg_count pchg_count; int i; diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c index fbbe82c6e75b..eb70156e5abf 100644 --- a/drivers/mfd/dln2.c +++ b/drivers/mfd/dln2.c @@ -125,7 +125,7 @@ int dln2_register_event_cb(struct platform_device *pdev, u16 id, unsigned long flags; int ret = 0; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -778,7 +778,7 @@ static int dln2_probe(struct usb_interface *interface, if (ret) return ret; - dln2 = kzalloc(sizeof(*dln2), GFP_KERNEL); + dln2 = kzalloc_obj(*dln2, GFP_KERNEL); if (!dln2) return -ENOMEM; diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index 1be4557b7bdd..d98a02a073ac 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -302,7 +302,7 @@ int pcap_adc_async(struct pcap_chip *pcap, u8 bank, u32 flags, u8 ch[], unsigned long irq_flags; /* This will be freed after we have a result */ - req = kmalloc(sizeof(struct pcap_adc_request), GFP_KERNEL); + req = kmalloc_obj(struct pcap_adc_request, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 50bf3260f65d..ae6af552f6d2 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1335,7 +1335,7 @@ static int sm501_plat_probe(struct platform_device *dev) struct sm501_devdata *sm; int ret; - sm = kzalloc(sizeof(*sm), GFP_KERNEL); + sm = kzalloc_obj(*sm, GFP_KERNEL); if (!sm) { ret = -ENOMEM; goto err1; @@ -1518,7 +1518,7 @@ static int sm501_pci_probe(struct pci_dev *dev, struct sm501_devdata *sm; int err; - sm = kzalloc(sizeof(*sm), GFP_KERNEL); + sm = kzalloc_obj(*sm, GFP_KERNEL); if (!sm) { err = -ENOMEM; goto err1; diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index e5d5def594f6..6bf0bcf49ff4 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -51,7 +51,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res) WARN_ON(!mutex_is_locked(&syscon_list_lock)); - struct syscon *syscon __free(kfree) = kzalloc(sizeof(*syscon), GFP_KERNEL); + struct syscon *syscon __free(kfree) = kzalloc_obj(*syscon, GFP_KERNEL); if (!syscon) return ERR_PTR(-ENOMEM); @@ -212,7 +212,7 @@ int of_syscon_register_regmap(struct device_node *np, struct regmap *regmap) if (!np || !regmap) return -EINVAL; - syscon = kzalloc(sizeof(*syscon), GFP_KERNEL); + syscon = kzalloc_obj(*syscon, GFP_KERNEL); if (!syscon) return -ENOMEM; diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c index b059713db875..b44af8ca1360 100644 --- a/drivers/mfd/timberdale.c +++ b/drivers/mfd/timberdale.c @@ -649,7 +649,7 @@ static int timb_probe(struct pci_dev *dev, struct msix_entry *msix_entries = NULL; u8 ip_setup; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -698,8 +698,8 @@ static int timb_probe(struct pci_dev *dev, goto err_config; } - msix_entries = kcalloc(TIMBERDALE_NR_IRQS, sizeof(*msix_entries), - GFP_KERNEL); + msix_entries = kzalloc_objs(*msix_entries, TIMBERDALE_NR_IRQS, + GFP_KERNEL); if (!msix_entries) goto err_config; diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index d3ab40651307..4def9eeb964f 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c @@ -631,7 +631,7 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base) return status; } - agent = kzalloc(sizeof(*agent), GFP_KERNEL); + agent = kzalloc_obj(*agent, GFP_KERNEL); if (!agent) return -ENOMEM; diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 4b450d78a65f..b2f304984505 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -395,7 +395,7 @@ static int ucb1x00_add_dev(struct ucb1x00 *ucb, struct ucb1x00_driver *drv) struct ucb1x00_dev *dev; int ret; - dev = kmalloc(sizeof(struct ucb1x00_dev), GFP_KERNEL); + dev = kmalloc_obj(struct ucb1x00_dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -513,7 +513,7 @@ static int ucb1x00_probe(struct mcp *mcp) goto out; } - ucb = kzalloc(sizeof(struct ucb1x00), GFP_KERNEL); + ucb = kzalloc_obj(struct ucb1x00, GFP_KERNEL); ret = -ENOMEM; if (!ucb) goto out; diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 6e1b38f9f26c..ff1b018969d5 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c @@ -367,7 +367,7 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) struct input_dev *idev; int err; - ts = kzalloc(sizeof(struct ucb1x00_ts), GFP_KERNEL); + ts = kzalloc_obj(struct ucb1x00_ts, GFP_KERNEL); idev = input_allocate_device(); if (!ts || !idev) { err = -ENOMEM; diff --git a/drivers/mfd/viperboard.c b/drivers/mfd/viperboard.c index ba867b7ecfad..7c0b1ae0c6bc 100644 --- a/drivers/mfd/viperboard.c +++ b/drivers/mfd/viperboard.c @@ -53,7 +53,7 @@ static int vprbrd_probe(struct usb_interface *interface, int pipe, ret; /* allocate memory for our device state and initialize it */ - vb = kzalloc(sizeof(*vb), GFP_KERNEL); + vb = kzalloc_obj(*vb, GFP_KERNEL); if (!vb) return -ENOMEM; diff --git a/drivers/mfd/wm831x-auxadc.c b/drivers/mfd/wm831x-auxadc.c index 18618a8f9206..5db027c904ad 100644 --- a/drivers/mfd/wm831x-auxadc.c +++ b/drivers/mfd/wm831x-auxadc.c @@ -35,7 +35,7 @@ static int wm831x_auxadc_read_irq(struct wm831x *wm831x, int ret; bool ena = false; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c index 04683b981e54..8024378b4e61 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c @@ -686,7 +686,7 @@ int ad_dpot_probe(struct device *dev, struct dpot_data *data; int i, err = 0; - data = kzalloc(sizeof(struct dpot_data), GFP_KERNEL); + data = kzalloc_obj(struct dpot_data, GFP_KERNEL); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c index bbe3967c3a4c..334117d3a214 100644 --- a/drivers/misc/altera-stapl/altera.c +++ b/drivers/misc/altera-stapl/altera.c @@ -290,13 +290,13 @@ static int altera_execute(struct altera_state *astate, if (sym_count <= 0) goto exit_done; - vars = kcalloc(sym_count, sizeof(long), GFP_KERNEL); + vars = kzalloc_objs(long, sym_count, GFP_KERNEL); if (vars == NULL) status = -ENOMEM; if (status == 0) { - var_size = kcalloc(sym_count, sizeof(s32), GFP_KERNEL); + var_size = kzalloc_objs(s32, sym_count, GFP_KERNEL); if (var_size == NULL) status = -ENOMEM; @@ -1098,8 +1098,8 @@ exit_done: /* Allocate a writable buffer for this array */ count = var_size[variable_id]; long_tmp = vars[variable_id]; - longptr_tmp = kcalloc(count, sizeof(long), - GFP_KERNEL); + longptr_tmp = kzalloc_objs(long, count, + GFP_KERNEL); vars[variable_id] = (long)longptr_tmp; if (vars[variable_id] == 0) { @@ -2342,8 +2342,7 @@ static int altera_get_act_info(u8 *p, (p[proc_table + (13 * act_proc_id) + 8] & 0x03); procptr = - kzalloc(sizeof(struct altera_procinfo), - GFP_KERNEL); + kzalloc_obj(struct altera_procinfo, GFP_KERNEL); if (procptr == NULL) status = -ENOMEM; @@ -2399,7 +2398,7 @@ int altera_init(struct altera_config *config, const struct firmware *fw) retval = -ENOMEM; goto free_key; } - astate = kzalloc(sizeof(struct altera_state), GFP_KERNEL); + astate = kzalloc_obj(struct altera_state, GFP_KERNEL); if (!astate) { retval = -ENOMEM; goto free_value; diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 6db4db975b9a..26d5e002dfa4 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -217,7 +217,7 @@ static int apds9802als_probe(struct i2c_client *client) int res; struct als_data *data; - data = kzalloc(sizeof(struct als_data), GFP_KERNEL); + data = kzalloc_obj(struct als_data, GFP_KERNEL); if (data == NULL) { dev_err(&client->dev, "Memory allocation failed\n"); return -ENOMEM; diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c index 58946c4ff1a5..b057e659135f 100644 --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c @@ -1055,7 +1055,7 @@ static int apds990x_probe(struct i2c_client *client) struct apds990x_chip *chip; int err; - chip = kzalloc(sizeof *chip, GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c index d4a96137728d..cdcf334f0ede 100644 --- a/drivers/misc/bcm-vk/bcm_vk_dev.c +++ b/drivers/misc/bcm-vk/bcm_vk_dev.c @@ -1289,7 +1289,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) u32 boot_status; /* allocate vk structure which is tied to kref for freeing */ - vk = kzalloc(sizeof(*vk), GFP_KERNEL); + vk = kzalloc_obj(*vk, GFP_KERNEL); if (!vk) return -ENOMEM; diff --git a/drivers/misc/bcm-vk/bcm_vk_msg.c b/drivers/misc/bcm-vk/bcm_vk_msg.c index 665a3888708a..8537c76e2541 100644 --- a/drivers/misc/bcm-vk/bcm_vk_msg.c +++ b/drivers/misc/bcm-vk/bcm_vk_msg.c @@ -700,7 +700,7 @@ int bcm_vk_send_shutdown_msg(struct bcm_vk *vk, u32 shut_type, return -EINVAL; } - entry = kzalloc(struct_size(entry, to_v_msg, 1), GFP_KERNEL); + entry = kzalloc_flex(*entry, to_v_msg, 1, GFP_KERNEL); if (!entry) return -ENOMEM; entry->to_v_blks = 1; /* always 1 block */ diff --git a/drivers/misc/bcm-vk/bcm_vk_sg.c b/drivers/misc/bcm-vk/bcm_vk_sg.c index d309216ee181..bd8c726fdc0f 100644 --- a/drivers/misc/bcm-vk/bcm_vk_sg.c +++ b/drivers/misc/bcm-vk/bcm_vk_sg.c @@ -60,9 +60,7 @@ static int bcm_vk_dma_alloc(struct device *dev, dma->nr_pages = last - first + 1; /* Allocate DMA pages */ - dma->pages = kmalloc_array(dma->nr_pages, - sizeof(struct page *), - GFP_KERNEL); + dma->pages = kmalloc_objs(struct page *, dma->nr_pages, GFP_KERNEL); if (!dma->pages) return -ENOMEM; diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c index babdb60cc46c..707871bc4a50 100644 --- a/drivers/misc/c2port/core.c +++ b/drivers/misc/c2port/core.c @@ -912,7 +912,7 @@ struct c2port_device *c2port_device_register(char *name, unlikely(!ops->c2d_get) || unlikely(!ops->c2d_set)) return ERR_PTR(-EINVAL); - c2dev = kzalloc(sizeof(struct c2port_device), GFP_KERNEL); + c2dev = kzalloc_obj(struct c2port_device, GFP_KERNEL); if (unlikely(!c2dev)) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c index f9952d76d6ed..d7211b305918 100644 --- a/drivers/misc/cardreader/rtsx_pcr.c +++ b/drivers/misc/cardreader/rtsx_pcr.c @@ -1385,8 +1385,7 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr) pcr_dbg(pcr, "PID: 0x%04x, IC version: 0x%02x\n", PCI_PID(pcr), pcr->ic_version); - pcr->slots = kcalloc(pcr->num_slots, sizeof(struct rtsx_slot), - GFP_KERNEL); + pcr->slots = kzalloc_objs(struct rtsx_slot, pcr->num_slots, GFP_KERNEL); if (!pcr->slots) return -ENOMEM; @@ -1494,13 +1493,13 @@ static int rtsx_pci_probe(struct pci_dev *pcidev, if (ret) goto disable; - pcr = kzalloc(sizeof(*pcr), GFP_KERNEL); + pcr = kzalloc_obj(*pcr, GFP_KERNEL); if (!pcr) { ret = -ENOMEM; goto release_pci; } - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) { ret = -ENOMEM; goto free_pcr; diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index 2b6778d8d166..f0bfc6210dab 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c @@ -187,7 +187,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain) if (timer_nr < 0) goto done; - timer = kmalloc(sizeof(*timer), GFP_KERNEL); + timer = kmalloc_obj(*timer, GFP_KERNEL); if (!timer) { /* aw hell */ spin_lock_irqsave(&mfgpt->lock, flags); diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index a3e4cada3b51..dae682d8c4a7 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c @@ -144,7 +144,7 @@ static int max6875_probe(struct i2c_client *client) if (client->addr & 1) return -ENODEV; - data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL); + data = kzalloc_obj(struct max6875_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index ca4c420e4a2f..7c2964762ef0 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c @@ -117,7 +117,7 @@ enclosure_register(struct device *dev, const char *name, int components, struct enclosure_component_callbacks *cb) { struct enclosure_device *edev = - kzalloc(struct_size(edev, component, components), GFP_KERNEL); + kzalloc_flex(*edev, component, components, GFP_KERNEL); int err, i; BUG_ON(!cb); diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 4f5a79c50f58..d212649fe7f9 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -424,7 +424,7 @@ static int __fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, { struct fastrpc_buf *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -600,7 +600,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( unsigned long flags; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); @@ -611,14 +611,13 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( REMOTE_SCALARS_OUTBUFS(sc); if (ctx->nscalars) { - ctx->maps = kcalloc(ctx->nscalars, - sizeof(*ctx->maps), GFP_KERNEL); + ctx->maps = kzalloc_objs(*ctx->maps, ctx->nscalars, GFP_KERNEL); if (!ctx->maps) { kfree(ctx); return ERR_PTR(-ENOMEM); } - ctx->olaps = kcalloc(ctx->nscalars, - sizeof(*ctx->olaps), GFP_KERNEL); + ctx->olaps = kzalloc_objs(*ctx->olaps, ctx->nscalars, + GFP_KERNEL); if (!ctx->olaps) { kfree(ctx->maps); kfree(ctx); @@ -705,7 +704,7 @@ static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf, struct fastrpc_buf *buffer = dmabuf->priv; int ret; - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) return -ENOMEM; @@ -787,7 +786,7 @@ static int fastrpc_map_attach(struct fastrpc_user *fl, int fd, struct scatterlist *sgl = NULL; int err = 0, sgl_index = 0; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return -ENOMEM; @@ -1307,7 +1306,8 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, } inbuf; u32 sc; - args = kcalloc(FASTRPC_CREATE_STATIC_PROCESS_NARGS, sizeof(*args), GFP_KERNEL); + args = kzalloc_objs(*args, FASTRPC_CREATE_STATIC_PROCESS_NARGS, + GFP_KERNEL); if (!args) return -ENOMEM; @@ -1432,7 +1432,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl, u32 sc; bool unsigned_module = false; - args = kcalloc(FASTRPC_CREATE_PROCESS_NARGS, sizeof(*args), GFP_KERNEL); + args = kzalloc_objs(*args, FASTRPC_CREATE_PROCESS_NARGS, GFP_KERNEL); if (!args) return -ENOMEM; @@ -1627,7 +1627,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) fdevice = miscdev_to_fdevice(filp->private_data); cctx = fdevice->cctx; - fl = kzalloc(sizeof(*fl), GFP_KERNEL); + fl = kzalloc_obj(*fl, GFP_KERNEL); if (!fl) return -ENOMEM; @@ -1734,7 +1734,7 @@ static int fastrpc_invoke(struct fastrpc_user *fl, char __user *argp) /* nscalars is truncated here to max supported value */ nscalars = REMOTE_SCALARS_LENGTH(inv.sc); if (nscalars) { - args = kcalloc(nscalars, sizeof(*args), GFP_KERNEL); + args = kzalloc_objs(*args, nscalars, GFP_KERNEL); if (!args) return -ENOMEM; @@ -2371,7 +2371,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) else if (!qcom_scm_is_available()) return -EPROBE_DEFER; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c index 224a7e97cbea..75b970d1012e 100644 --- a/drivers/misc/genwqe/card_base.c +++ b/drivers/misc/genwqe/card_base.c @@ -141,7 +141,7 @@ static struct genwqe_dev *genwqe_dev_alloc(void) if (i >= GENWQE_CARD_NO_MAX) return ERR_PTR(-ENODEV); - cd = kzalloc(sizeof(struct genwqe_dev), GFP_KERNEL); + cd = kzalloc_obj(struct genwqe_dev, GFP_KERNEL); if (!cd) return ERR_PTR(-ENOMEM); @@ -403,8 +403,7 @@ static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd) /* currently support only the debug units mentioned here */ cd->ffdc[type].entries = e; cd->ffdc[type].regs = - kmalloc_array(e, sizeof(struct genwqe_reg), - GFP_KERNEL); + kmalloc_objs(struct genwqe_reg, e, GFP_KERNEL); /* * regs == NULL is ok, the using code treats this as no regs, * Printing warning is ok in this case. diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c index fd7d5cd50d39..87286ad04a4b 100644 --- a/drivers/misc/genwqe/card_ddcb.c +++ b/drivers/misc/genwqe/card_ddcb.c @@ -194,7 +194,7 @@ struct genwqe_ddcb_cmd *ddcb_requ_alloc(void) { struct ddcb_requ *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; @@ -1046,16 +1046,15 @@ static int setup_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) "[%s] **err: could not allocate DDCB **\n", __func__); return -ENOMEM; } - queue->ddcb_req = kcalloc(queue->ddcb_max, sizeof(struct ddcb_requ *), - GFP_KERNEL); + queue->ddcb_req = kzalloc_objs(struct ddcb_requ *, queue->ddcb_max, + GFP_KERNEL); if (!queue->ddcb_req) { rc = -ENOMEM; goto free_ddcbs; } - queue->ddcb_waitqs = kcalloc(queue->ddcb_max, - sizeof(wait_queue_head_t), - GFP_KERNEL); + queue->ddcb_waitqs = kzalloc_objs(wait_queue_head_t, queue->ddcb_max, + GFP_KERNEL); if (!queue->ddcb_waitqs) { rc = -ENOMEM; goto free_requs; diff --git a/drivers/misc/genwqe/card_debugfs.c b/drivers/misc/genwqe/card_debugfs.c index 491fb4482da2..7fc0dce42aa7 100644 --- a/drivers/misc/genwqe/card_debugfs.c +++ b/drivers/misc/genwqe/card_debugfs.c @@ -53,7 +53,7 @@ static int curr_dbg_uidn_show(struct seq_file *s, void *unused, int uid) if (entries == 0) return 0; - regs = kcalloc(entries, sizeof(*regs), GFP_KERNEL); + regs = kzalloc_objs(*regs, entries, GFP_KERNEL); if (regs == NULL) return -ENOMEM; @@ -122,7 +122,7 @@ static int curr_regs_show(struct seq_file *s, void *unused) unsigned int i; struct genwqe_reg *regs; - regs = kcalloc(GENWQE_FFDC_REGS, sizeof(*regs), GFP_KERNEL); + regs = kzalloc_objs(*regs, GENWQE_FFDC_REGS, GFP_KERNEL); if (regs == NULL) return -ENOMEM; diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 4441aca2280a..9b5458c10053 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c @@ -301,7 +301,7 @@ static int genwqe_open(struct inode *inode, struct file *filp) struct genwqe_dev *cd; struct genwqe_file *cfile; - cfile = kzalloc(sizeof(*cfile), GFP_KERNEL); + cfile = kzalloc_obj(*cfile, GFP_KERNEL); if (cfile == NULL) return -ENOMEM; @@ -446,7 +446,7 @@ static int genwqe_mmap(struct file *filp, struct vm_area_struct *vma) if (get_order(vsize) > MAX_PAGE_ORDER) return -ENOMEM; - dma_map = kzalloc(sizeof(struct dma_mapping), GFP_KERNEL); + dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL); if (dma_map == NULL) return -ENOMEM; @@ -783,7 +783,7 @@ static int genwqe_pin_mem(struct genwqe_file *cfile, struct genwqe_mem *m) map_addr = (m->addr & PAGE_MASK); map_size = round_up(m->size + (m->addr & ~PAGE_MASK), PAGE_SIZE); - dma_map = kzalloc(sizeof(struct dma_mapping), GFP_KERNEL); + dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL); if (dma_map == NULL) return -ENOMEM; diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 04bd34c8c506..174cabc7307f 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -570,7 +570,7 @@ static int ilo_open(struct inode *ip, struct file *fp) hw = container_of(ip->i_cdev, struct ilo_hwinfo, cdev); /* new ccb allocation */ - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -798,7 +798,7 @@ static int ilo_probe(struct pci_dev *pdev, /* track global allocations for this device */ error = -ENOMEM; - ilo_hw = kzalloc(sizeof(*ilo_hw), GFP_KERNEL); + ilo_hw = kzalloc_obj(*ilo_hw, GFP_KERNEL); if (!ilo_hw) goto out; diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c index 733dd30fbacc..9e4f45be78d7 100644 --- a/drivers/misc/ibmasm/command.c +++ b/drivers/misc/ibmasm/command.c @@ -24,7 +24,7 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s if (buffer_size > IBMASM_CMD_MAX_BUFFER_SIZE) return NULL; - cmd = kzalloc(sizeof(struct command), GFP_KERNEL); + cmd = kzalloc_obj(struct command, GFP_KERNEL); if (cmd == NULL) return NULL; diff --git a/drivers/misc/ibmasm/event.c b/drivers/misc/ibmasm/event.c index 40ce75f8970c..41aabfcd256f 100644 --- a/drivers/misc/ibmasm/event.c +++ b/drivers/misc/ibmasm/event.c @@ -139,7 +139,7 @@ int ibmasm_event_buffer_init(struct service_processor *sp) struct ibmasm_event *event; int i; - buffer = kmalloc(sizeof(struct event_buffer), GFP_KERNEL); + buffer = kmalloc_obj(struct event_buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 824c5b664985..f203bc3e8068 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -235,7 +235,7 @@ static int command_file_open(struct inode *inode, struct file *file) if (!inode->i_private) return -ENODEV; - command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL); + command_data = kmalloc_obj(struct ibmasmfs_command_data, GFP_KERNEL); if (!command_data) return -ENOMEM; @@ -344,7 +344,7 @@ static int event_file_open(struct inode *inode, struct file *file) sp = inode->i_private; - event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL); + event_data = kmalloc_obj(struct ibmasmfs_event_data, GFP_KERNEL); if (!event_data) return -ENOMEM; @@ -430,7 +430,7 @@ static int r_heartbeat_file_open(struct inode *inode, struct file *file) if (!inode->i_private) return -ENODEV; - rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL); + rhbeat = kmalloc_obj(struct ibmasmfs_heartbeat_data, GFP_KERNEL); if (!rhbeat) return -ENOMEM; diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index dc8a06c06c63..ea625673826b 100644 --- a/drivers/misc/ibmasm/module.c +++ b/drivers/misc/ibmasm/module.c @@ -64,7 +64,7 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* vnc client won't work without bus-mastering */ pci_set_master(pdev); - sp = kzalloc(sizeof(struct service_processor), GFP_KERNEL); + sp = kzalloc_obj(struct service_processor, GFP_KERNEL); if (sp == NULL) { dev_err(&pdev->dev, "Failed to allocate memory\n"); result = -ENOMEM; diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index e5f935b5249d..78ecc28f00fb 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -830,7 +830,7 @@ static int ibmvmc_open(struct inode *inode, struct file *file) (unsigned long)inode, (unsigned long)file, ibmvmc.state); - session = kzalloc(sizeof(*session), GFP_KERNEL); + session = kzalloc_obj(*session, GFP_KERNEL); if (!session) return -ENOMEM; diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c index 4cdb1087838f..df4d36fe46ac 100644 --- a/drivers/misc/ics932s401.c +++ b/drivers/misc/ics932s401.c @@ -433,7 +433,7 @@ static int ics932s401_probe(struct i2c_client *client) struct ics932s401_data *data; int err; - data = kzalloc(sizeof(struct ics932s401_data), GFP_KERNEL); + data = kzalloc_obj(struct ics932s401_data, GFP_KERNEL); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c index 9f26db467a81..ea56dde9183d 100644 --- a/drivers/misc/isl29003.c +++ b/drivers/misc/isl29003.c @@ -383,7 +383,7 @@ static int isl29003_probe(struct i2c_client *client) if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE)) return -EIO; - data = kzalloc(sizeof(struct isl29003_data), GFP_KERNEL); + data = kzalloc_obj(struct isl29003_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/misc/keba/cp500.c b/drivers/misc/keba/cp500.c index d0c6113dcff3..6039a718d92f 100644 --- a/drivers/misc/keba/cp500.c +++ b/drivers/misc/keba/cp500.c @@ -335,7 +335,7 @@ static int cp500_register_i2c(struct cp500 *cp500) { int ret; - cp500->i2c = kzalloc(sizeof(*cp500->i2c), GFP_KERNEL); + cp500->i2c = kzalloc_obj(*cp500->i2c, GFP_KERNEL); if (!cp500->i2c) return -ENOMEM; @@ -386,7 +386,7 @@ static int cp500_register_spi(struct cp500 *cp500, u8 esc_type) int info_size; int ret; - cp500->spi = kzalloc(sizeof(*cp500->spi), GFP_KERNEL); + cp500->spi = kzalloc_obj(*cp500->spi, GFP_KERNEL); if (!cp500->spi) return -ENOMEM; @@ -443,7 +443,7 @@ static int cp500_register_fan(struct cp500 *cp500) { int ret; - cp500->fan = kzalloc(sizeof(*cp500->fan), GFP_KERNEL); + cp500->fan = kzalloc_obj(*cp500->fan, GFP_KERNEL); if (!cp500->fan) return -ENOMEM; @@ -491,7 +491,7 @@ static int cp500_register_batt(struct cp500 *cp500) { int ret; - cp500->batt = kzalloc(sizeof(*cp500->batt), GFP_KERNEL); + cp500->batt = kzalloc_obj(*cp500->batt, GFP_KERNEL); if (!cp500->batt) return -ENOMEM; @@ -541,7 +541,7 @@ static int cp500_register_uart(struct cp500 *cp500, { int ret; - *uart = kzalloc(sizeof(**uart), GFP_KERNEL); + *uart = kzalloc_obj(**uart, GFP_KERNEL); if (!*uart) return -ENOMEM; diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c index 9c79b58137e5..6245ea993d1b 100644 --- a/drivers/misc/lan966x_pci.c +++ b/drivers/misc/lan966x_pci.c @@ -58,7 +58,7 @@ static struct pci_dev_intr_ctrl *pci_dev_create_intr_ctrl(struct pci_dev *pdev) if (!fwnode) return ERR_PTR(-ENODEV); - intr_ctrl = kmalloc(sizeof(*intr_ctrl), GFP_KERNEL); + intr_ctrl = kmalloc_obj(*intr_ctrl, GFP_KERNEL); if (!intr_ctrl) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 1a634ac1a241..f5adec86ca28 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -952,7 +952,7 @@ int lis3lv02d_init_dt(struct lis3lv02d *lis3) if (!lis3->of_node) return 0; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c index b2aee36b956d..6de369f0ccd2 100644 --- a/drivers/misc/lkdtm/bugs.c +++ b/drivers/misc/lkdtm/bugs.c @@ -477,7 +477,7 @@ static void lkdtm_FAM_BOUNDS(void) { struct lkdtm_cb_fam *inst; - inst = kzalloc(struct_size(inst, array, element_count + 1), GFP_KERNEL); + inst = kzalloc_flex(*inst, array, element_count + 1, GFP_KERNEL); if (!inst) { pr_err("FAIL: could not allocate test struct!\n"); return; @@ -533,7 +533,7 @@ static void lkdtm_PTR_BOUNDS(void) { struct lkdtm_cb_ptr *inst; - inst = kzalloc(sizeof(*inst), GFP_KERNEL); + inst = kzalloc_obj(*inst, GFP_KERNEL); if (!inst) { pr_err("FAIL: could not allocate struct lkdtm_cb_ptr!\n"); return; @@ -547,7 +547,7 @@ static void lkdtm_PTR_BOUNDS(void) inst->len = element_count; /* Double element_count */ - inst->extra = kcalloc(element_count * 2, sizeof(*inst->extra), GFP_KERNEL); + inst->extra = kzalloc_objs(*inst->extra, element_count * 2, GFP_KERNEL); inst->nr_extra = element_count * 2; pr_info("Pointer access within bounds ...\n"); diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c index 34c9be437432..30c24a3e728f 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c @@ -42,8 +42,8 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id if (!aux_bus) return -ENOMEM; - aux_bus->aux_device_wrapper[0] = kzalloc(sizeof(*aux_bus->aux_device_wrapper[0]), - GFP_KERNEL); + aux_bus->aux_device_wrapper[0] = kzalloc_obj(*aux_bus->aux_device_wrapper[0], + GFP_KERNEL); if (!aux_bus->aux_device_wrapper[0]) return -ENOMEM; @@ -67,8 +67,8 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id if (retval) goto err_aux_dev_add_0; - aux_bus->aux_device_wrapper[1] = kzalloc(sizeof(*aux_bus->aux_device_wrapper[1]), - GFP_KERNEL); + aux_bus->aux_device_wrapper[1] = kzalloc_obj(*aux_bus->aux_device_wrapper[1], + GFP_KERNEL); if (!aux_bus->aux_device_wrapper[1]) { retval = -ENOMEM; goto err_aux_dev_add_0; diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 2c810ab12e62..fb311b6633d6 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -1363,7 +1363,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus, struct mei_cl_device *cldev; struct mei_cl *cl; - cldev = kzalloc(sizeof(*cldev), GFP_KERNEL); + cldev = kzalloc_obj(*cldev, GFP_KERNEL); if (!cldev) return NULL; diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 5dc665515263..2ad20921ffb7 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -370,7 +370,7 @@ static struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, { struct mei_cl_cb *cb; - cb = kzalloc(sizeof(*cb), GFP_KERNEL); + cb = kzalloc_obj(*cb, GFP_KERNEL); if (!cb) return NULL; @@ -605,7 +605,7 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev) { struct mei_cl *cl; - cl = kmalloc(sizeof(*cl), GFP_KERNEL); + cl = kmalloc_obj(*cl, GFP_KERNEL); if (!cl) return NULL; @@ -1273,7 +1273,7 @@ struct mei_cl_vtag *mei_cl_vtag_alloc(struct file *fp, u8 vtag) { struct mei_cl_vtag *cl_vtag; - cl_vtag = kzalloc(sizeof(*cl_vtag), GFP_KERNEL); + cl_vtag = kzalloc_obj(*cl_vtag, GFP_KERNEL); if (!cl_vtag) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c index f52fe23a6c0b..00467dc56b9b 100644 --- a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c +++ b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c @@ -141,7 +141,7 @@ static int mei_gsc_proxy_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_master = kzalloc(sizeof(*comp_master), GFP_KERNEL); + comp_master = kzalloc_obj(*comp_master, GFP_KERNEL); if (!comp_master) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index ccd9df5d1c7d..19db57456f2c 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c @@ -409,7 +409,7 @@ static int mei_hbm_me_cl_add(struct mei_device *dev, mei_me_cl_rm_by_uuid(dev, uuid); - me_cl = kzalloc(sizeof(*me_cl), GFP_KERNEL); + me_cl = kzalloc_obj(*me_cl, GFP_KERNEL); if (!me_cl) return -ENOMEM; diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index 323f10620d90..68cb4da376f9 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -819,7 +819,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_arbiter = kzalloc(sizeof(*comp_arbiter), GFP_KERNEL); + comp_arbiter = kzalloc_obj(*comp_arbiter, GFP_KERNEL); if (!comp_arbiter) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 3f210413fd32..d11d19e75726 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -133,7 +133,8 @@ static int mei_cl_irq_read_msg(struct mei_cl *cl, break; case MEI_EXT_HDR_GSC: gsc_f2h = (struct mei_ext_hdr_gsc_f2h *)ext; - cb->ext_hdr = (struct mei_ext_hdr *)kzalloc(sizeof(*gsc_f2h), GFP_KERNEL); + cb->ext_hdr = (struct mei_ext_hdr *) kzalloc_obj(*gsc_f2h, + GFP_KERNEL); if (!cb->ext_hdr) { cb->status = -ENOMEM; goto discard; diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c index 2820d389c88e..b79573c32a4d 100644 --- a/drivers/misc/mei/pxp/mei_pxp.c +++ b/drivers/misc/mei/pxp/mei_pxp.c @@ -273,7 +273,7 @@ static int mei_pxp_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_master = kzalloc(sizeof(*comp_master), GFP_KERNEL); + comp_master = kzalloc_obj(*comp_master, GFP_KERNEL); if (!comp_master) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/vsc-fw-loader.c b/drivers/misc/mei/vsc-fw-loader.c index 43abefa806e1..dc32510c9ddb 100644 --- a/drivers/misc/mei/vsc-fw-loader.c +++ b/drivers/misc/mei/vsc-fw-loader.c @@ -721,7 +721,7 @@ int vsc_tp_init(struct vsc_tp *tp, struct device *dev) void *rx_buf __free(kfree) = NULL; int ret; - fw_loader = kzalloc(sizeof(*fw_loader), GFP_KERNEL); + fw_loader = kzalloc_obj(*fw_loader, GFP_KERNEL); if (!fw_loader) return -ENOMEM; diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index 9087f045e362..727d9bbe1a29 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -705,7 +705,7 @@ static struct ntsync_obj *ntsync_alloc_obj(struct ntsync_device *dev, { struct ntsync_obj *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; obj->type = type; @@ -884,7 +884,7 @@ static int setup_wait(struct ntsync_device *dev, if (args->alert) fds[count] = args->alert; - q = kmalloc(struct_size(q, entries, total_count), GFP_KERNEL); + q = kmalloc_flex(*q, entries, total_count, GFP_KERNEL); if (!q) return -ENOMEM; q->task = current; @@ -1145,7 +1145,7 @@ static int ntsync_char_open(struct inode *inode, struct file *file) { struct ntsync_device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/misc/ocxl/afu_irq.c b/drivers/misc/ocxl/afu_irq.c index f6b821fc274c..3969fc9d58e2 100644 --- a/drivers/misc/ocxl/afu_irq.c +++ b/drivers/misc/ocxl/afu_irq.c @@ -107,7 +107,7 @@ int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id) struct afu_irq *irq; int rc; - irq = kzalloc(sizeof(struct afu_irq), GFP_KERNEL); + irq = kzalloc_obj(struct afu_irq, GFP_KERNEL); if (!irq) return -ENOMEM; diff --git a/drivers/misc/ocxl/context.c b/drivers/misc/ocxl/context.c index cded7d1caf32..3ca1c442fb39 100644 --- a/drivers/misc/ocxl/context.c +++ b/drivers/misc/ocxl/context.c @@ -10,7 +10,7 @@ int ocxl_context_alloc(struct ocxl_context **context, struct ocxl_afu *afu, int pasid; struct ocxl_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/misc/ocxl/core.c b/drivers/misc/ocxl/core.c index aebfc53a2d09..608ac6a2d855 100644 --- a/drivers/misc/ocxl/core.c +++ b/drivers/misc/ocxl/core.c @@ -17,7 +17,7 @@ static struct ocxl_afu *alloc_afu(struct ocxl_fn *fn) { struct ocxl_afu *afu; - afu = kzalloc(sizeof(struct ocxl_afu), GFP_KERNEL); + afu = kzalloc_obj(struct ocxl_afu, GFP_KERNEL); if (!afu) return NULL; @@ -300,7 +300,7 @@ static struct ocxl_fn *alloc_function(void) { struct ocxl_fn *fn; - fn = kzalloc(sizeof(struct ocxl_fn), GFP_KERNEL); + fn = kzalloc_obj(struct ocxl_fn, GFP_KERNEL); if (!fn) return NULL; diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 7eb74711ac96..fc03b82c3eb6 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -526,7 +526,7 @@ int ocxl_file_register_afu(struct ocxl_afu *afu) struct ocxl_fn *fn = afu->fn; struct pci_dev *pci_dev = to_pci_dev(fn->dev.parent); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) return -ENOMEM; diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c index 03402203cacd..c413d065abe7 100644 --- a/drivers/misc/ocxl/link.c +++ b/drivers/misc/ocxl/link.c @@ -345,7 +345,7 @@ static int alloc_spa(struct pci_dev *dev, struct ocxl_link *link) { struct spa *spa; - spa = kzalloc(sizeof(struct spa), GFP_KERNEL); + spa = kzalloc_obj(struct spa, GFP_KERNEL); if (!spa) return -ENOMEM; @@ -387,7 +387,7 @@ static int alloc_link(struct pci_dev *dev, int PE_mask, struct ocxl_link **out_l struct ocxl_link *link; int rc; - link = kzalloc(sizeof(struct ocxl_link), GFP_KERNEL); + link = kzalloc_obj(struct ocxl_link, GFP_KERNEL); if (!link) return -ENOMEM; @@ -559,7 +559,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr, goto unlock; } - pe_data = kmalloc(sizeof(*pe_data), GFP_KERNEL); + pe_data = kmalloc_obj(*pe_data, GFP_KERNEL); if (!pe_data) { rc = -ENOMEM; goto unlock; diff --git a/drivers/misc/ocxl/pasid.c b/drivers/misc/ocxl/pasid.c index d14cb56e6920..677870f49290 100644 --- a/drivers/misc/ocxl/pasid.c +++ b/drivers/misc/ocxl/pasid.c @@ -28,7 +28,7 @@ static int range_alloc(struct list_head *head, u32 size, int max_id, struct id_range *cur, *new; int rc, last_end; - new = kmalloc(sizeof(struct id_range), GFP_KERNEL); + new = kmalloc_obj(struct id_range, GFP_KERNEL); if (!new) return -ENOMEM; diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c index 0d63e834dbe7..c69a88a09332 100644 --- a/drivers/misc/pch_phub.c +++ b/drivers/misc/pch_phub.c @@ -666,7 +666,7 @@ static int pch_phub_probe(struct pci_dev *pdev, int ret; struct pch_phub_reg *chip; - chip = kzalloc(sizeof(struct pch_phub_reg), GFP_KERNEL); + chip = kzalloc_obj(struct pch_phub_reg, GFP_KERNEL); if (chip == NULL) return -ENOMEM; diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index 701db2c5859b..cb7f7d9243d3 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c @@ -362,7 +362,7 @@ static int phantom_probe(struct pci_dev *pdev, } retval = -ENOMEM; - pht = kzalloc(sizeof(*pht), GFP_KERNEL); + pht = kzalloc_obj(*pht, GFP_KERNEL); if (pht == NULL) { dev_err(&pdev->dev, "unable to allocate device\n"); goto err_reg; diff --git a/drivers/misc/rpmb-core.c b/drivers/misc/rpmb-core.c index 2d653926cdbb..2bd557665d1a 100644 --- a/drivers/misc/rpmb-core.c +++ b/drivers/misc/rpmb-core.c @@ -161,7 +161,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev, !descr->dev_id_len) return ERR_PTR(-EINVAL); - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return ERR_PTR(-ENOMEM); rdev->descr = *descr; diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c index 3036c15f3689..171d38913dcf 100644 --- a/drivers/misc/sgi-gru/grumain.c +++ b/drivers/misc/sgi-gru/grumain.c @@ -356,7 +356,7 @@ struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma, int tsid) { struct gru_vma_data *vdata = NULL; - vdata = kmalloc(sizeof(*vdata), GFP_KERNEL); + vdata = kmalloc_obj(*vdata, GFP_KERNEL); if (!vdata) return NULL; diff --git a/drivers/misc/sgi-gru/grutlbpurge.c b/drivers/misc/sgi-gru/grutlbpurge.c index 1107dd3e2e9f..1bb07781a105 100644 --- a/drivers/misc/sgi-gru/grutlbpurge.c +++ b/drivers/misc/sgi-gru/grutlbpurge.c @@ -237,7 +237,7 @@ static struct mmu_notifier *gru_alloc_notifier(struct mm_struct *mm) { struct gru_mm_struct *gms; - gms = kzalloc(sizeof(*gms), GFP_KERNEL); + gms = kzalloc_obj(*gms, GFP_KERNEL); if (!gms) return ERR_PTR(-ENOMEM); STAT(gms_alloc); diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c index 9fe816bf3957..4e608379d6e7 100644 --- a/drivers/misc/sgi-xp/xpc_main.c +++ b/drivers/misc/sgi-xp/xpc_main.c @@ -400,9 +400,8 @@ xpc_setup_ch_structures(struct xpc_partition *part) * memory. */ DBUG_ON(part->channels != NULL); - part->channels = kcalloc(XPC_MAX_NCHANNELS, - sizeof(struct xpc_channel), - GFP_KERNEL); + part->channels = kzalloc_objs(struct xpc_channel, XPC_MAX_NCHANNELS, + GFP_KERNEL); if (part->channels == NULL) { dev_err(xpc_chan, "can't get memory for channels\n"); return xpNoMemory; @@ -890,9 +889,8 @@ xpc_setup_partitions(void) short partid; struct xpc_partition *part; - xpc_partitions = kcalloc(xp_max_npartitions, - sizeof(struct xpc_partition), - GFP_KERNEL); + xpc_partitions = kzalloc_objs(struct xpc_partition, xp_max_npartitions, + GFP_KERNEL); if (xpc_partitions == NULL) { dev_err(xpc_part, "can't get memory for partition structure\n"); return -ENOMEM; diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 2f03a7080d96..ccd3047580c5 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c @@ -147,7 +147,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, struct xpc_gru_mq_uv *mq; struct uv_IO_APIC_route_entry *mmr_value; - mq = kmalloc(sizeof(struct xpc_gru_mq_uv), GFP_KERNEL); + mq = kmalloc_obj(struct xpc_gru_mq_uv, GFP_KERNEL); if (mq == NULL) { dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() " "a xpc_gru_mq_uv structure\n"); @@ -155,8 +155,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, goto out_0; } - mq->gru_mq_desc = kzalloc(sizeof(struct gru_message_queue_desc), - GFP_KERNEL); + mq->gru_mq_desc = kzalloc_obj(struct gru_message_queue_desc, GFP_KERNEL); if (mq->gru_mq_desc == NULL) { dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() " "a gru_message_queue_desc structure\n"); @@ -623,9 +622,8 @@ again: if (!(part_uv->flags & XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV)) { gru_mq_desc = part_uv->cached_activate_gru_mq_desc; if (gru_mq_desc == NULL) { - gru_mq_desc = kmalloc(sizeof(struct - gru_message_queue_desc), - GFP_ATOMIC); + gru_mq_desc = kmalloc_obj(struct gru_message_queue_desc, + GFP_ATOMIC); if (gru_mq_desc == NULL) { ret = xpNoMemory; goto done; @@ -1075,9 +1073,8 @@ xpc_setup_msg_structures_uv(struct xpc_channel *ch) DBUG_ON(ch->flags & XPC_C_SETUP); - ch_uv->cached_notify_gru_mq_desc = kmalloc(sizeof(struct - gru_message_queue_desc), - GFP_KERNEL); + ch_uv->cached_notify_gru_mq_desc = kmalloc_obj(struct gru_message_queue_desc, + GFP_KERNEL); if (ch_uv->cached_notify_gru_mq_desc == NULL) return xpNoMemory; diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 2396ba3b03bd..1533b72d57b1 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c @@ -431,7 +431,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) * xpc_send_notifies are relying on this skb. When none * remain, release the skb. */ - queued_msg = kmalloc(sizeof(struct xpnet_pending_msg), GFP_ATOMIC); + queued_msg = kmalloc_obj(struct xpnet_pending_msg, GFP_ATOMIC); if (queued_msg == NULL) { dev_warn(xpnet, "failed to kmalloc %ld bytes; dropping " "packet\n", sizeof(struct xpnet_pending_msg)); diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index c98ff8aa221c..39b38d639638 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -191,7 +191,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) * after the reserved blocks from the dt are processed. */ nblocks = (np) ? of_get_available_child_count(np) + 1 : 1; - rblocks = kcalloc(nblocks, sizeof(*rblocks), GFP_KERNEL); + rblocks = kzalloc_objs(*rblocks, nblocks, GFP_KERNEL); if (!rblocks) return -ENOMEM; diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index 12355d34e193..96ad091089a7 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c @@ -176,7 +176,7 @@ struct tifm_adapter *tifm_alloc_adapter(unsigned int num_sockets, { struct tifm_adapter *fm; - fm = kzalloc(struct_size(fm, sockets, num_sockets), GFP_KERNEL); + fm = kzalloc_flex(*fm, sockets, num_sockets, GFP_KERNEL); if (fm) { fm->dev.class = &tifm_adapter_class; fm->dev.parent = dev; @@ -252,7 +252,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, if (!tifm_media_type_name(type, 0)) return sock; - sock = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL); + sock = kzalloc_obj(struct tifm_dev, GFP_KERNEL); if (sock) { spin_lock_init(&sock->lock); sock->type = type; diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 1a7796ab3fad..8f592afe1a32 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c @@ -343,7 +343,7 @@ static int tsl2550_probe(struct i2c_client *client) goto exit; } - data = kzalloc(sizeof(struct tsl2550_data), GFP_KERNEL); + data = kzalloc_obj(struct tsl2550_data, GFP_KERNEL); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 6d71355528d3..55735335ce12 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -158,7 +158,7 @@ static int uacce_fops_open(struct inode *inode, struct file *filep) if (!uacce) return -ENODEV; - q = kzalloc(sizeof(struct uacce_queue), GFP_KERNEL); + q = kzalloc_obj(struct uacce_queue, GFP_KERNEL); if (!q) return -ENOMEM; @@ -251,7 +251,7 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma) else return -EINVAL; - qfr = kzalloc(sizeof(*qfr), GFP_KERNEL); + qfr = kzalloc_obj(*qfr, GFP_KERNEL); if (!qfr) return -ENOMEM; @@ -506,7 +506,7 @@ struct uacce_device *uacce_alloc(struct device *parent, struct uacce_device *uacce; int ret; - uacce = kzalloc(sizeof(struct uacce_device), GFP_KERNEL); + uacce = kzalloc_obj(struct uacce_device, GFP_KERNEL); if (!uacce) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 216a16395968..5ae13779bd1a 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -1616,7 +1616,7 @@ static int vmballoon_enable_stats(struct vmballoon *b) if (b->stats) goto out; - b->stats = kzalloc(sizeof(*b->stats), GFP_KERNEL); + b->stats = kzalloc_obj(*b->stats, GFP_KERNEL); if (!b->stats) { /* allocation failed */ diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c index 8069d271ed81..0a87d5430385 100644 --- a/drivers/misc/vmw_vmci/vmci_context.c +++ b/drivers/misc/vmw_vmci/vmci_context.c @@ -104,7 +104,7 @@ struct vmci_ctx *vmci_ctx_create(u32 cid, u32 priv_flags, goto err_out; } - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) { pr_warn("Failed to allocate memory for VMCI context\n"); error = -ENOMEM; @@ -294,7 +294,7 @@ int vmci_ctx_enqueue_datagram(u32 cid, struct vmci_datagram *dg) } /* Allocate guest call entry and add it to the target VM's queue. */ - dq_entry = kmalloc(sizeof(*dq_entry), GFP_KERNEL); + dq_entry = kmalloc_obj(*dq_entry, GFP_KERNEL); if (dq_entry == NULL) { pr_warn("Failed to allocate memory for datagram\n"); vmci_ctx_put(context); @@ -598,7 +598,7 @@ int vmci_ctx_add_notification(u32 context_id, u32 remote_cid) goto out; } - notifier = kmalloc(sizeof(struct vmci_handle_list), GFP_KERNEL); + notifier = kmalloc_obj(struct vmci_handle_list, GFP_KERNEL); if (!notifier) { result = VMCI_ERROR_NO_MEM; goto out; diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c index 3964d9e5a39b..1a276717e20a 100644 --- a/drivers/misc/vmw_vmci/vmci_datagram.c +++ b/drivers/misc/vmw_vmci/vmci_datagram.c @@ -71,7 +71,7 @@ static int dg_create_handle(u32 resource_id, handle = vmci_make_handle(context_id, resource_id); - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { pr_warn("Failed allocating memory for datagram entry\n"); return VMCI_ERROR_NO_MEM; @@ -224,8 +224,8 @@ static int dg_dispatch_as_host(u32 context_id, struct vmci_datagram *dg) return VMCI_ERROR_NO_MEM; } - dg_info = kmalloc(struct_size(dg_info, msg_payload, dg->payload_size), - GFP_ATOMIC); + dg_info = kmalloc_flex(*dg_info, msg_payload, + dg->payload_size, GFP_ATOMIC); if (!dg_info) { atomic_dec(&delayed_dg_host_queue_size); vmci_resource_put(resource); diff --git a/drivers/misc/vmw_vmci/vmci_doorbell.c b/drivers/misc/vmw_vmci/vmci_doorbell.c index 53eeb9e6cb56..c2db2d4ab7f6 100644 --- a/drivers/misc/vmw_vmci/vmci_doorbell.c +++ b/drivers/misc/vmw_vmci/vmci_doorbell.c @@ -402,7 +402,7 @@ int vmci_doorbell_create(struct vmci_handle *handle, priv_flags & ~VMCI_PRIVILEGE_ALL_FLAGS) return VMCI_ERROR_INVALID_ARGS; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (entry == NULL) { pr_warn("Failed allocating memory for datagram entry\n"); return VMCI_ERROR_NO_MEM; diff --git a/drivers/misc/vmw_vmci/vmci_event.c b/drivers/misc/vmw_vmci/vmci_event.c index 9a41ab65378d..85dc12860f17 100644 --- a/drivers/misc/vmw_vmci/vmci_event.c +++ b/drivers/misc/vmw_vmci/vmci_event.c @@ -151,7 +151,7 @@ int vmci_event_subscribe(u32 event, return VMCI_ERROR_INVALID_ARGS; } - sub = kzalloc(sizeof(*sub), GFP_KERNEL); + sub = kzalloc_obj(*sub, GFP_KERNEL); if (!sub) return VMCI_ERROR_NO_MEM; diff --git a/drivers/misc/vmw_vmci/vmci_handle_array.c b/drivers/misc/vmw_vmci/vmci_handle_array.c index 681b3500125a..fd94e4f90322 100644 --- a/drivers/misc/vmw_vmci/vmci_handle_array.c +++ b/drivers/misc/vmw_vmci/vmci_handle_array.c @@ -19,7 +19,7 @@ struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity) capacity = min((u32)VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY, max_capacity); - array = kmalloc(struct_size(array, entries, capacity), GFP_ATOMIC); + array = kmalloc_flex(*array, entries, capacity, GFP_ATOMIC); if (!array) return NULL; diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c index b64944367ac5..88fea05203d5 100644 --- a/drivers/misc/vmw_vmci/vmci_host.c +++ b/drivers/misc/vmw_vmci/vmci_host.c @@ -120,7 +120,7 @@ static int vmci_host_open(struct inode *inode, struct file *filp) { struct vmci_host_dev *vmci_host_dev; - vmci_host_dev = kzalloc(sizeof(struct vmci_host_dev), GFP_KERNEL); + vmci_host_dev = kzalloc_obj(struct vmci_host_dev, GFP_KERNEL); if (vmci_host_dev == NULL) return -ENOMEM; diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index b88ac144ad32..d2a7f79f4e8d 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -895,7 +895,7 @@ qp_guest_endpoint_create(struct vmci_handle handle, handle = vmci_make_handle(context_id, VMCI_INVALID_ID); } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (entry) { entry->qp.peer = peer; entry->qp.flags = flags; @@ -1318,7 +1318,7 @@ static int qp_broker_create(struct vmci_handle handle, if (is_local && peer != VMCI_INVALID_ID && context_id != peer) return VMCI_ERROR_NO_ACCESS; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return VMCI_ERROR_NO_MEM; @@ -2722,7 +2722,7 @@ int vmci_qpair_alloc(struct vmci_qp **qpair, return VMCI_ERROR_INVALID_ARGS; } - my_qpair = kzalloc(sizeof(*my_qpair), GFP_KERNEL); + my_qpair = kzalloc_obj(*my_qpair, GFP_KERNEL); if (!my_qpair) return VMCI_ERROR_NO_MEM; diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index fb6eb2d79b4f..b39cd61cea44 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -422,7 +422,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( struct mmc_blk_ioc_data *idata; int err; - idata = kzalloc(sizeof(*idata), GFP_KERNEL); + idata = kzalloc_obj(*idata, GFP_KERNEL); if (!idata) { err = -ENOMEM; goto out; @@ -737,7 +737,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md, return -EINVAL; n = num_of_cmds; - idata = kcalloc(n, sizeof(*idata), GFP_KERNEL); + idata = kzalloc_objs(*idata, n, GFP_KERNEL); if (!idata) return -ENOMEM; @@ -2562,7 +2562,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, return ERR_PTR(devidx); } - md = kzalloc(sizeof(*md), GFP_KERNEL); + md = kzalloc_obj(*md, GFP_KERNEL); if (!md) { ret = -ENOMEM; goto out; @@ -2794,12 +2794,12 @@ static struct mmc_blk_ioc_data **alloc_idata(struct mmc_rpmb_data *rpmb, struct mmc_blk_ioc_data **idata; unsigned int n; - idata = kcalloc(cmd_count, sizeof(*idata), GFP_KERNEL); + idata = kzalloc_objs(*idata, cmd_count, GFP_KERNEL); if (!idata) return NULL; for (n = 0; n < cmd_count; n++) { - idata[n] = kcalloc(1, sizeof(**idata), GFP_KERNEL); + idata[n] = kzalloc_objs(**idata, 1, GFP_KERNEL); if (!idata[n]) { free_idata(idata, n); return NULL; @@ -2942,7 +2942,7 @@ static int mmc_blk_alloc_rpmb_part(struct mmc_card *card, if (devidx < 0) return devidx; - rpmb = kzalloc(sizeof(*rpmb), GFP_KERNEL); + rpmb = kzalloc_obj(*rpmb, GFP_KERNEL); if (!rpmb) { ida_free(&mmc_rpmb_ida, devidx); return -ENOMEM; diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index ec4f3462bf80..740b082da3e2 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -279,7 +279,7 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host, const struct device_type { struct mmc_card *card; - card = kzalloc(sizeof(struct mmc_card), GFP_KERNEL); + card = kzalloc_obj(struct mmc_card, GFP_KERNEL); if (!card) return ERR_PTR(-ENOMEM); diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 01d1e62c2ce7..70cc83a8a1ee 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -348,11 +348,11 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz, if (max_segs > max_page_cnt) max_segs = max_page_cnt; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return NULL; - mem->arr = kcalloc(max_segs, sizeof(*mem->arr), GFP_KERNEL); + mem->arr = kzalloc_objs(*mem->arr, max_segs, GFP_KERNEL); if (!mem->arr) goto out_free; @@ -533,7 +533,7 @@ static void mmc_test_save_transfer_result(struct mmc_test_card *test, if (!test->gr) return; - tr = kmalloc(sizeof(*tr), GFP_KERNEL); + tr = kmalloc_obj(*tr, GFP_KERNEL); if (!tr) return; @@ -765,7 +765,7 @@ static void mmc_test_req_reset(struct mmc_test_req *rq) static struct mmc_test_req *mmc_test_req_alloc(void) { - struct mmc_test_req *rq = kmalloc(sizeof(*rq), GFP_KERNEL); + struct mmc_test_req *rq = kmalloc_obj(*rq, GFP_KERNEL); if (rq) mmc_test_req_reset(rq); @@ -1570,14 +1570,13 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) if (!t->mem) return -ENOMEM; - t->sg = kmalloc_array(t->max_segs, sizeof(*t->sg), GFP_KERNEL); + t->sg = kmalloc_objs(*t->sg, t->max_segs, GFP_KERNEL); if (!t->sg) { ret = -ENOMEM; goto out_free; } - t->sg_areq = kmalloc_array(t->max_segs, sizeof(*t->sg_areq), - GFP_KERNEL); + t->sg_areq = kmalloc_objs(*t->sg_areq, t->max_segs, GFP_KERNEL); if (!t->sg_areq) { ret = -ENOMEM; goto out_free; @@ -2968,7 +2967,7 @@ static void mmc_test_run(struct mmc_test_card *test, int testcase) } } - gr = kzalloc(sizeof(*gr), GFP_KERNEL); + gr = kzalloc_obj(*gr, GFP_KERNEL); if (gr) { INIT_LIST_HEAD(&gr->tr_lst); @@ -3100,7 +3099,7 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, if (ret) return ret; - test = kzalloc(sizeof(*test), GFP_KERNEL); + test = kzalloc_obj(*test, GFP_KERNEL); if (!test) return -ENOMEM; @@ -3189,7 +3188,7 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card, file = debugfs_create_file(name, mode, card->debugfs_root, card, fops); - df = kmalloc(sizeof(*df), GFP_KERNEL); + df = kmalloc_obj(*df, GFP_KERNEL); if (!df) { debugfs_remove(file); return -ENOMEM; diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index 284856c8f655..13000fc57e2e 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -167,7 +167,7 @@ static struct scatterlist *mmc_alloc_sg(unsigned short sg_len, gfp_t gfp) { struct scatterlist *sg; - sg = kmalloc_array(sg_len, sizeof(*sg), gfp); + sg = kmalloc_objs(*sg, sg_len, gfp); if (sg) sg_init_table(sg, sg_len); diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 6e5bdc2f0cc8..060da5c4ea75 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -337,7 +337,7 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card) { struct sdio_func *func; - func = kzalloc(sizeof(struct sdio_func), GFP_KERNEL); + func = kzalloc_obj(struct sdio_func, GFP_KERNEL); if (!func) return ERR_PTR(-ENOMEM); diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c index 7423a601e1e5..a37d91347931 100644 --- a/drivers/mmc/core/sdio_uart.c +++ b/drivers/mmc/core/sdio_uart.c @@ -1021,7 +1021,7 @@ static int sdio_uart_probe(struct sdio_func *func, struct sdio_uart_port *port; int ret; - port = kzalloc(sizeof(struct sdio_uart_port), GFP_KERNEL); + port = kzalloc_obj(struct sdio_uart_port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 62c68cda1e21..2a2aee4054f7 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -306,8 +306,7 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode) return -EIO; } - ranges = kmalloc_array(priv->num_phases / 2 + 1, - sizeof(*ranges), GFP_KERNEL); + ranges = kmalloc_objs(*ranges, priv->num_phases / 2 + 1, GFP_KERNEL); if (!ranges) return -ENOMEM; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 9e74b675e92d..1e0c3904cded 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -834,7 +834,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host, static int dw_mci_edmac_init(struct dw_mci *host) { /* Request external dma channel */ - host->dms = kzalloc(sizeof(struct dw_mci_dma_slave), GFP_KERNEL); + host->dms = kzalloc_obj(struct dw_mci_dma_slave, GFP_KERNEL); if (!host->dms) return -ENOMEM; diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 42936e248c55..8ab52b4de02e 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1236,7 +1236,7 @@ static int mmc_spi_probe(struct spi_device *spi) } /* Preallocate buffers */ - host->data = kmalloc(sizeof(*host->data), GFP_KERNEL); + host->data = kmalloc_obj(*host->data, GFP_KERNEL); if (!host->data) goto fail_nobuf1; diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index 05939f30a5ae..d3137d23533c 100644 --- a/drivers/mmc/host/of_mmc_spi.c +++ b/drivers/mmc/host/of_mmc_spi.c @@ -57,7 +57,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) if (dev->platform_data || !dev_fwnode(dev)) return dev->platform_data; - oms = kzalloc(sizeof(*oms), GFP_KERNEL); + oms = kzalloc_obj(*oms, GFP_KERNEL); if (!oms) return NULL; diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c index 2b7456e942f7..6a4274bac5c0 100644 --- a/drivers/mmc/host/ushc.c +++ b/drivers/mmc/host/ushc.c @@ -462,7 +462,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->int_data = kzalloc(sizeof(struct ushc_int_data), GFP_KERNEL); + ushc->int_data = kzalloc_obj(struct ushc_int_data, GFP_KERNEL); if (ushc->int_data == NULL) { ret = -ENOMEM; goto err; @@ -479,7 +479,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->cbw = kzalloc(sizeof(struct ushc_cbw), GFP_KERNEL); + ushc->cbw = kzalloc_obj(struct ushc_cbw, GFP_KERNEL); if (ushc->cbw == NULL) { ret = -ENOMEM; goto err; @@ -501,7 +501,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->csw = kzalloc(sizeof(struct ushc_csw), GFP_KERNEL); + ushc->csw = kzalloc_obj(struct ushc_csw, GFP_KERNEL); if (ushc->csw == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/most/configfs.c b/drivers/most/configfs.c index 36d8c917f65f..03b977a4c070 100644 --- a/drivers/most/configfs.c +++ b/drivers/most/configfs.c @@ -426,7 +426,7 @@ static struct config_item *most_common_make_item(struct config_group *group, struct mdev_link *mdev_link; struct most_common *mc = to_most_common(group->cg_subsys); - mdev_link = kzalloc(sizeof(*mdev_link), GFP_KERNEL); + mdev_link = kzalloc_obj(*mdev_link, GFP_KERNEL); if (!mdev_link) return ERR_PTR(-ENOMEM); @@ -526,7 +526,7 @@ static struct config_item *most_snd_grp_make_item(struct config_group *group, { struct mdev_link *mdev_link; - mdev_link = kzalloc(sizeof(*mdev_link), GFP_KERNEL); + mdev_link = kzalloc_obj(*mdev_link, GFP_KERNEL); if (!mdev_link) return ERR_PTR(-ENOMEM); @@ -607,7 +607,7 @@ static struct config_group *most_sound_make_group(struct config_group *group, } if (!try_module_get(ms->mod)) return ERR_PTR(-ENOLCK); - most = kzalloc(sizeof(*most), GFP_KERNEL); + most = kzalloc_obj(*most, GFP_KERNEL); if (!most) { module_put(ms->mod); return ERR_PTR(-ENOMEM); diff --git a/drivers/most/core.c b/drivers/most/core.c index 40d63e38fef5..3bbe8bed402a 100644 --- a/drivers/most/core.c +++ b/drivers/most/core.c @@ -880,7 +880,7 @@ static int arm_mbo_chain(struct most_channel *c, int dir, atomic_set(&c->mbo_nq_level, 0); for (i = 0; i < c->cfg.num_buffers; i++) { - mbo = kzalloc(sizeof(*mbo), GFP_KERNEL); + mbo = kzalloc_obj(*mbo, GFP_KERNEL); if (!mbo) goto flush_fifos; @@ -1300,7 +1300,7 @@ int most_register_interface(struct most_interface *iface) return id; } - iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL); + iface->p = kzalloc_obj(*iface->p, GFP_KERNEL); if (!iface->p) { ida_free(&mdev_id, id); put_device(iface->dev); @@ -1324,7 +1324,7 @@ int most_register_interface(struct most_interface *iface) for (i = 0; i < iface->num_channels; i++) { const char *name_suffix = iface->channel_vector[i].name_suffix; - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) goto err_free_resources; if (!name_suffix) diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c index b9423f82373d..87f770b03466 100644 --- a/drivers/most/most_cdev.c +++ b/drivers/most/most_cdev.c @@ -429,7 +429,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, if (current_minor < 0) return current_minor; - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) { retval = -ENOMEM; goto err_remove_ida; diff --git a/drivers/most/most_snd.c b/drivers/most/most_snd.c index 45d762804c5e..ffd51f2d0d9b 100644 --- a/drivers/most/most_snd.c +++ b/drivers/most/most_snd.c @@ -542,7 +542,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, adpt->pcm_dev_idx++; goto skip_adpt_alloc; } - adpt = kzalloc(sizeof(*adpt), GFP_KERNEL); + adpt = kzalloc_obj(*adpt, GFP_KERNEL); if (!adpt) return -ENOMEM; @@ -574,7 +574,7 @@ skip_adpt_alloc: capture_count = 1; direction = SNDRV_PCM_STREAM_CAPTURE; } - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) { ret = -ENOMEM; goto err_free_adpt; diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c index 41ee169f80c5..0c61d023ac0a 100644 --- a/drivers/most/most_usb.c +++ b/drivers/most/most_usb.c @@ -142,7 +142,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) __le16 *dma_buf; u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL); + dma_buf = kzalloc_obj(*dma_buf, GFP_KERNEL); if (!dma_buf) return -ENOMEM; @@ -960,7 +960,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) struct usb_endpoint_descriptor *ep_desc; int ret = -ENOMEM; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; @@ -1000,11 +1000,11 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) mdev->dev.init_name = mdev->description; mdev->dev.parent = &interface->dev; mdev->dev.release = release_mdev; - mdev->conf = kcalloc(num_endpoints, sizeof(*mdev->conf), GFP_KERNEL); + mdev->conf = kzalloc_objs(*mdev->conf, num_endpoints, GFP_KERNEL); if (!mdev->conf) goto err_free_mdev; - mdev->cap = kcalloc(num_endpoints, sizeof(*mdev->cap), GFP_KERNEL); + mdev->cap = kzalloc_objs(*mdev->cap, num_endpoints, GFP_KERNEL); if (!mdev->cap) goto err_free_conf; @@ -1015,7 +1015,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) goto err_free_cap; mdev->busy_urbs = - kcalloc(num_endpoints, sizeof(*mdev->busy_urbs), GFP_KERNEL); + kzalloc_objs(*mdev->busy_urbs, num_endpoints, GFP_KERNEL); if (!mdev->busy_urbs) goto err_free_ep_address; @@ -1064,7 +1064,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 || le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81119 || le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81210) { - mdev->dci = kzalloc(sizeof(*mdev->dci), GFP_KERNEL); + mdev->dci = kzalloc_obj(*mdev->dci, GFP_KERNEL); if (!mdev->dci) { mutex_unlock(&mdev->io_mutex); most_deregister_interface(&mdev->iface); diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index c10693ba265b..9a54e390cd44 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -501,7 +501,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary) struct mtd_info *mtd; int i; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) return NULL; mtd->priv = map; @@ -627,9 +627,8 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd) mtd->size = devsize * cfi->numchips; mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips; - mtd->eraseregions = kcalloc(mtd->numeraseregions, - sizeof(struct mtd_erase_region_info), - GFP_KERNEL); + mtd->eraseregions = kzalloc_objs(struct mtd_erase_region_info, + mtd->numeraseregions, GFP_KERNEL); if (!mtd->eraseregions) goto setup_err; @@ -777,13 +776,11 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, } numvirtchips = cfi->numchips * numparts; - newcfi = kmalloc(struct_size(newcfi, chips, numvirtchips), - GFP_KERNEL); + newcfi = kmalloc_flex(*newcfi, chips, numvirtchips, GFP_KERNEL); if (!newcfi) return -ENOMEM; - shared = kmalloc_array(cfi->numchips, - sizeof(struct flchip_shared), - GFP_KERNEL); + shared = kmalloc_objs(struct flchip_shared, cfi->numchips, + GFP_KERNEL); if (!shared) { kfree(newcfi); return -ENOMEM; diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 7c91429a670b..efb3ba02432e 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -604,7 +604,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) struct mtd_info *mtd; int i; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) return NULL; mtd->priv = map; @@ -776,9 +776,8 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) mtd->size = devsize * cfi->numchips; mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips; - mtd->eraseregions = kmalloc_array(mtd->numeraseregions, - sizeof(struct mtd_erase_region_info), - GFP_KERNEL); + mtd->eraseregions = kmalloc_objs(struct mtd_erase_region_info, + mtd->numeraseregions, GFP_KERNEL); if (!mtd->eraseregions) goto setup_err; @@ -2819,7 +2818,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, for (i = 0; i < mtd->numeraseregions; i++) max_sectors += regions[i].numblocks; - sect = kcalloc(max_sectors, sizeof(struct ppb_lock), GFP_KERNEL); + sect = kzalloc_objs(struct ppb_lock, max_sectors, GFP_KERNEL); if (!sect) return -ENOMEM; diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 5e5266e2c2e1..5665d3b72da1 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c @@ -172,7 +172,7 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map) int i,j; unsigned long devsize = (1<cfiq->DevSize) * cfi->interleave; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); //printk(KERN_DEBUG "number of CFI chips: %d\n", cfi->numchips); if (!mtd) { @@ -185,9 +185,8 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map) mtd->size = devsize * cfi->numchips; mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips; - mtd->eraseregions = kmalloc_array(mtd->numeraseregions, - sizeof(struct mtd_erase_region_info), - GFP_KERNEL); + mtd->eraseregions = kmalloc_objs(struct mtd_erase_region_info, + mtd->numeraseregions, GFP_KERNEL); if (!mtd->eraseregions) { kfree(cfi->cmdset_priv); kfree(mtd); diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index e254f9cd2796..926bf7b61e59 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -208,7 +208,8 @@ static int __xipram cfi_chip_setup(struct map_info *map, if (!num_erase_regions) return 0; - cfi->cfiq = kmalloc(struct_size(cfi->cfiq, EraseRegionInfo, num_erase_regions), GFP_KERNEL); + cfi->cfiq = kmalloc_flex(*cfi->cfiq, EraseRegionInfo, num_erase_regions, + GFP_KERNEL); if (!cfi->cfiq) return 0; diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index 9e53fcd7600d..ebf653ba8f6a 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c @@ -134,7 +134,7 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi * our caller, and copy the appropriate data into them. */ - retcfi = kmalloc(struct_size(retcfi, chips, cfi.numchips), GFP_KERNEL); + retcfi = kmalloc_flex(*retcfi, chips, cfi.numchips, GFP_KERNEL); if (!retcfi) { kfree(cfi.cfiq); diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index 3c631608f6d6..d7acf0425e4f 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c @@ -1985,7 +1985,8 @@ static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int in num_erase_regions = jedec_table[index].nr_regions; - cfi->cfiq = kmalloc(struct_size(cfi->cfiq, EraseRegionInfo, num_erase_regions), GFP_KERNEL); + cfi->cfiq = kmalloc_flex(*cfi->cfiq, EraseRegionInfo, num_erase_regions, + GFP_KERNEL); if (!cfi->cfiq) { //xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name); return 0; diff --git a/drivers/mtd/chips/map_absent.c b/drivers/mtd/chips/map_absent.c index fc68557f49c0..6a9bd84a6def 100644 --- a/drivers/mtd/chips/map_absent.c +++ b/drivers/mtd/chips/map_absent.c @@ -46,7 +46,7 @@ static struct mtd_info *map_absent_probe(struct map_info *map) { struct mtd_info *mtd; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) { return NULL; } diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index f9d3e32ef8e9..f94d20672423 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c @@ -57,7 +57,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map) #endif /* OK. It seems to be RAM. */ - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) return NULL; diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index 0823b15aaadb..644ef8d62cc8 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c @@ -45,7 +45,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map) { struct mtd_info *mtd; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) return NULL; diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index b06c8dd51562..41b1c1348efe 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -271,7 +271,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, if (!devname) return NULL; - dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL); + dev = kzalloc_obj(struct block2mtd_dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index c93769c233d9..8db760b2c900 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -1810,10 +1810,10 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev) struct mtd_info *mtd; ret = -ENOMEM; - docg3 = kzalloc(sizeof(struct docg3), GFP_KERNEL); + docg3 = kzalloc_obj(struct docg3, GFP_KERNEL); if (!docg3) goto nomem1; - mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); + mtd = kzalloc_obj(struct mtd_info, GFP_KERNEL); if (!mtd) goto nomem2; mtd->priv = docg3; diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c index 08f76ff839a7..0a5d6ca1fe2f 100644 --- a/drivers/mtd/devices/ms02-nv.c +++ b/drivers/mtd/devices/ms02-nv.c @@ -117,7 +117,7 @@ static int __init ms02nv_init_one(ulong addr) int ret = -ENODEV; /* The module decodes 8MiB of address space. */ - mod_res = kzalloc(sizeof(*mod_res), GFP_KERNEL); + mod_res = kzalloc_obj(*mod_res, GFP_KERNEL); if (!mod_res) return -ENOMEM; @@ -138,10 +138,10 @@ static int __init ms02nv_init_one(ulong addr) } ret = -ENOMEM; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) goto err_out_mod_res_rel; - mp = kzalloc(sizeof(*mp), GFP_KERNEL); + mp = kzalloc_obj(*mp, GFP_KERNEL); if (!mp) goto err_out_mtd; @@ -149,7 +149,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.module = mod_res; /* Firmware's diagnostic NVRAM area. */ - diag_res = kzalloc(sizeof(*diag_res), GFP_KERNEL); + diag_res = kzalloc_obj(*diag_res, GFP_KERNEL); if (!diag_res) goto err_out_mp; @@ -162,7 +162,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.diag_ram = diag_res; /* User-available general-purpose NVRAM area. */ - user_res = kzalloc(sizeof(*user_res), GFP_KERNEL); + user_res = kzalloc_obj(*user_res, GFP_KERNEL); if (!user_res) goto err_out_diag_res; @@ -175,7 +175,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.user_ram = user_res; /* Control and status register. */ - csr_res = kzalloc(sizeof(*csr_res), GFP_KERNEL); + csr_res = kzalloc_obj(*csr_res, GFP_KERNEL); if (!csr_res) goto err_out_user_res; diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index ec52277e3dd5..3eebca290f50 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -627,7 +627,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages, char *otp_tag = ""; int err = 0; - priv = kzalloc(sizeof *priv, GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/devices/mtd_intel_dg.c b/drivers/mtd/devices/mtd_intel_dg.c index 7f751c48a76d..ed5a07459012 100644 --- a/drivers/mtd/devices/mtd_intel_dg.c +++ b/drivers/mtd/devices/mtd_intel_dg.c @@ -720,7 +720,7 @@ static int intel_dg_nvm_init_mtd(struct intel_dg_nvm *nvm, struct device *device nvm->mtd.erasesize = SZ_4K; /* 4K bytes granularity */ nvm->mtd.size = nvm->size; - parts = kcalloc(nvm->nregions, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, nvm->nregions, GFP_KERNEL); if (!parts) return -ENOMEM; @@ -764,7 +764,7 @@ static int intel_dg_mtd_probe(struct auxiliary_device *aux_dev, return -ENODEV; } - nvm = kzalloc(struct_size(nvm, regions, nregions), GFP_KERNEL); + nvm = kzalloc_flex(*nvm, regions, nregions, GFP_KERNEL); if (!nvm) return -ENOMEM; diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index 1c97fabc4bf9..5418cfcfb1d9 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c @@ -158,7 +158,7 @@ static int __init init_mtdram(void) return -EINVAL; /* Allocate some memory */ - mtd_info = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); + mtd_info = kmalloc_obj(struct mtd_info, GFP_KERNEL); if (!mtd_info) return -ENOMEM; diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index fd9ec165e61a..d35f43dec8e3 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c @@ -130,7 +130,7 @@ static int register_device(struct platform_device *pdev, const char *name, struct phram_mtd_list *new; int ret = -ENOMEM; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) goto out0; diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 6597fc2aad34..1d793bf7ad71 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -715,11 +715,11 @@ static int __init init_pmc551(void) msize = length; } - mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); + mtd = kzalloc_obj(struct mtd_info, GFP_KERNEL); if (!mtd) break; - priv = kzalloc(sizeof(struct mypriv), GFP_KERNEL); + priv = kzalloc_obj(struct mypriv, GFP_KERNEL); if (!priv) { kfree(mtd); break; diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index 8297b366a066..1ac94e837f26 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c @@ -135,17 +135,17 @@ static int register_device(char *name, unsigned long start, unsigned long length curmtd = &(*curmtd)->next; } - *curmtd = kmalloc(sizeof(slram_mtd_list_t), GFP_KERNEL); + *curmtd = kmalloc_obj(slram_mtd_list_t, GFP_KERNEL); if (!(*curmtd)) { E("slram: Cannot allocate new MTD device.\n"); return(-ENOMEM); } - (*curmtd)->mtdinfo = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); + (*curmtd)->mtdinfo = kzalloc_obj(struct mtd_info, GFP_KERNEL); (*curmtd)->next = NULL; if ((*curmtd)->mtdinfo) { (*curmtd)->mtdinfo->priv = - kzalloc(sizeof(slram_priv_t), GFP_KERNEL); + kzalloc_obj(slram_priv_t, GFP_KERNEL); if (!(*curmtd)->mtdinfo->priv) { kfree((*curmtd)->mtdinfo); diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index 59a901549257..bc372a0c040d 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -201,16 +201,14 @@ static int build_maps(partition_t *part) /* Set up erase unit maps */ part->DataUnits = le16_to_cpu(part->header.NumEraseUnits) - part->header.NumTransferUnits; - part->EUNInfo = kmalloc_array(part->DataUnits, sizeof(struct eun_info_t), - GFP_KERNEL); + part->EUNInfo = kmalloc_objs(struct eun_info_t, part->DataUnits, GFP_KERNEL); if (!part->EUNInfo) goto out; for (i = 0; i < part->DataUnits; i++) part->EUNInfo[i].Offset = 0xffffffff; part->XferInfo = - kmalloc_array(part->header.NumTransferUnits, - sizeof(struct xfer_info_t), - GFP_KERNEL); + kmalloc_objs(struct xfer_info_t, part->header.NumTransferUnits, + GFP_KERNEL); if (!part->XferInfo) goto out_EUNInfo; @@ -339,7 +337,7 @@ static int erase_xfer(partition_t *part, /* Is there a free erase slot? Always in MTD. */ - erase=kmalloc(sizeof(struct erase_info), GFP_KERNEL); + erase=kmalloc_obj(struct erase_info, GFP_KERNEL); if (!erase) return -ENOMEM; @@ -1007,7 +1005,7 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { partition_t *partition; - partition = kzalloc(sizeof(partition_t), GFP_KERNEL); + partition = kzalloc_obj(partition_t, GFP_KERNEL); if (!partition) { printk(KERN_WARNING "No memory to scan for FTL on %s\n", diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index 58c6e1743f5c..cde1e3f52a49 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c @@ -52,7 +52,7 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) pr_debug("INFTL: add_mtd for %s\n", mtd->name); - inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); + inftl = kzalloc_obj(*inftl, GFP_KERNEL); if (!inftl) return; diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index cd37d58abacb..97f960af44b4 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -41,7 +41,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) int numchips; int i, j; - mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); + mtd = kzalloc_obj(*mtd, GFP_KERNEL); if (!mtd) return NULL; mtd->priv = map; @@ -65,8 +65,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; mtd->writesize = 1 << lpddr->qinfo->BufSizeShift; - shared = kmalloc_array(lpddr->numchips, sizeof(struct flchip_shared), - GFP_KERNEL); + shared = kmalloc_objs(struct flchip_shared, lpddr->numchips, GFP_KERNEL); if (!shared) { kfree(mtd); return NULL; diff --git a/drivers/mtd/lpddr/qinfo_probe.c b/drivers/mtd/lpddr/qinfo_probe.c index 42281e460c62..9339da9f09a1 100644 --- a/drivers/mtd/lpddr/qinfo_probe.c +++ b/drivers/mtd/lpddr/qinfo_probe.c @@ -120,7 +120,7 @@ out: static int lpddr_chip_setup(struct map_info *map, struct lpddr_private *lpddr) { - lpddr->qinfo = kzalloc(sizeof(struct qinfo_chip), GFP_KERNEL); + lpddr->qinfo = kzalloc_obj(struct qinfo_chip, GFP_KERNEL); if (!lpddr->qinfo) return 0; @@ -167,8 +167,7 @@ static struct lpddr_private *lpddr_probe_chip(struct map_info *map) lpddr.numchips = 1; numvirtchips = lpddr.numchips * lpddr.qinfo->HWPartsNum; - retlpddr = kzalloc(struct_size(retlpddr, chips, numvirtchips), - GFP_KERNEL); + retlpddr = kzalloc_flex(*retlpddr, chips, numvirtchips, GFP_KERNEL); if (!retlpddr) return NULL; diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index 281fcbaa74e7..1825f8e2898f 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c @@ -188,7 +188,7 @@ static int amd76xrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) goto out; } diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c index c0216bc740cc..0ac4b26b1dd7 100644 --- a/drivers/mtd/maps/ck804xrom.c +++ b/drivers/mtd/maps/ck804xrom.c @@ -218,7 +218,7 @@ static int __init ck804xrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) goto out; } diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c index 15d5b76ff504..14d050a5629f 100644 --- a/drivers/mtd/maps/esb2rom.c +++ b/drivers/mtd/maps/esb2rom.c @@ -278,7 +278,7 @@ static int __init esb2rom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) goto out; } diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c index c8b2793691db..b940beb70b65 100644 --- a/drivers/mtd/maps/ichxrom.c +++ b/drivers/mtd/maps/ichxrom.c @@ -212,7 +212,7 @@ static int __init ichxrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) goto out; } diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index ca00d211e73e..b70b8edceb1b 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c @@ -264,7 +264,7 @@ static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) if (err) goto out; - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); err = -ENOMEM; if (!map) goto release; diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 206a3c463e6e..8b7192ff6f04 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -674,7 +674,7 @@ static int pcmciamtd_probe(struct pcmcia_device *link) struct pcmciamtd_dev *dev; /* Create new memory card device */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; pr_debug("dev=0x%p\n", dev); diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c index ecf68922da73..30b95fd3352d 100644 --- a/drivers/mtd/maps/pismo.c +++ b/drivers/mtd/maps/pismo.c @@ -218,7 +218,7 @@ static int pismo_probe(struct i2c_client *client) return -EIO; } - pismo = kzalloc(sizeof(*pismo), GFP_KERNEL); + pismo = kzalloc_obj(*pismo, GFP_KERNEL); if (!pismo) return -ENOMEM; diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 1c541eaf477a..d0f9b81ad7c5 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c @@ -109,7 +109,7 @@ static int platram_probe(struct platform_device *pdev) pdata = dev_get_platdata(&pdev->dev); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) { err = -ENOMEM; goto exit_error; diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index f27c25db6778..5ad7ae7a311c 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -51,7 +51,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev) if (!res) return -ENODEV; - info = kzalloc(sizeof(struct pxa2xx_flash_info), GFP_KERNEL); + info = kzalloc_obj(struct pxa2xx_flash_info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 6a54a84d0d9c..ed69df084352 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c @@ -170,7 +170,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev, /* * Allocate the map_info structs in one go. */ - info = kzalloc(struct_size(info, subdev, nr), GFP_KERNEL); + info = kzalloc_flex(*info, subdev, nr, GFP_KERNEL); if (!info) { ret = -ENOMEM; goto out; @@ -222,7 +222,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev, } else if (info->num_subdev > 1) { struct mtd_info **cdev; - cdev = kmalloc_array(nr, sizeof(*cdev), GFP_KERNEL); + cdev = kmalloc_objs(*cdev, nr, GFP_KERNEL); if (!cdev) { ret = -ENOMEM; goto err; diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index ea3aa026b55b..aebbf2931f1c 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -61,7 +61,7 @@ static int uflash_devinit(struct platform_device *op, struct device_node *dp) return -ENODEV; } - up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL); + up = kzalloc_obj(struct uflash_dev, GFP_KERNEL); if (!up) return -ENOMEM; diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c index 53019d313db7..bd4ebcde51db 100644 --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c @@ -73,7 +73,7 @@ static struct vmu_block *ofs_to_block(unsigned long src_ofs, if (num > card->parts[partition].numblocks) goto failed; - vblock = kmalloc(sizeof(struct vmu_block), GFP_KERNEL); + vblock = kmalloc_obj(struct vmu_block, GFP_KERNEL); if (!vblock) goto failed; @@ -539,7 +539,7 @@ static void vmu_queryblocks(struct mapleq *mq) mtd_cur->_sync = vmu_flash_sync; mtd_cur->writesize = card->blocklen; - mpart = kmalloc(sizeof(struct mdev_part), GFP_KERNEL); + mpart = kmalloc_obj(struct mdev_part, GFP_KERNEL); if (!mpart) goto fail_mpart; @@ -548,7 +548,7 @@ static void vmu_queryblocks(struct mapleq *mq) mtd_cur->priv = mpart; mtd_cur->owner = THIS_MODULE; - pcache = kzalloc(sizeof(struct vmu_cache), GFP_KERNEL); + pcache = kzalloc_obj(struct vmu_cache, GFP_KERNEL); if (!pcache) goto fail_cache_create; part_cur->pcache = pcache; @@ -609,7 +609,7 @@ static int vmu_connect(struct maple_device *mdev) basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); - card = kmalloc(sizeof(struct memcard), GFP_KERNEL); + card = kmalloc_obj(struct memcard, GFP_KERNEL); if (!card) { error = -ENOMEM; goto fail_nomem; @@ -627,15 +627,13 @@ static int vmu_connect(struct maple_device *mdev) * Not sure there are actually any multi-partition devices in the * real world, but the hardware supports them, so, so will we */ - card->parts = kmalloc_array(card->partitions, sizeof(struct vmupart), - GFP_KERNEL); + card->parts = kmalloc_objs(struct vmupart, card->partitions, GFP_KERNEL); if (!card->parts) { error = -ENOMEM; goto fail_partitions; } - card->mtd = kmalloc_array(card->partitions, sizeof(struct mtd_info), - GFP_KERNEL); + card->mtd = kmalloc_objs(struct mtd_info, card->partitions, GFP_KERNEL); if (!card->mtd) { error = -ENOMEM; goto fail_mtd_info; diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 28e09d080440..470a838cbab7 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -324,7 +324,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) new->readonly = 1; ret = -ENOMEM; - new->tag_set = kzalloc(sizeof(*new->tag_set), GFP_KERNEL); + new->tag_set = kzalloc_obj(*new->tag_set, GFP_KERNEL); if (!new->tag_set) goto out_list_del; diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index 9751416c2a91..80614f218228 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c @@ -316,7 +316,7 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev) static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { - struct mtdblk_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct mtdblk_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return; diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c index ef6299af60e4..e82f27eec5ae 100644 --- a/drivers/mtd/mtdblock_ro.c +++ b/drivers/mtd/mtdblock_ro.c @@ -36,7 +36,7 @@ static int mtdblock_writesect(struct mtd_blktrans_dev *dev, static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { - struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct mtd_blktrans_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return; diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 335c702633ff..35b31fea77f3 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -72,7 +72,7 @@ static int mtdchar_open(struct inode *inode, struct file *file) goto out1; } - mfi = kzalloc(sizeof(*mfi), GFP_KERNEL); + mfi = kzalloc_obj(*mfi, GFP_KERNEL); if (!mfi) { ret = -ENOMEM; goto out1; @@ -923,7 +923,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) { struct erase_info *erase; - erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL); + erase=kzalloc_obj(struct erase_info, GFP_KERNEL); if (!erase) ret = -ENOMEM; else { @@ -1162,7 +1162,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) if (!master->ooblayout) return -EOPNOTSUPP; - usrlay = kmalloc(sizeof(*usrlay), GFP_KERNEL); + usrlay = kmalloc_obj(*usrlay, GFP_KERNEL); if (!usrlay) return -ENOMEM; diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index f56f44aa8625..c4145ba218df 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -416,7 +416,7 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr) } /* make a local copy of instr to avoid modifying the caller's struct */ - erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL); + erase = kmalloc_obj(struct erase_info, GFP_KERNEL); if (!erase) return -ENOMEM; @@ -823,9 +823,8 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c concat->mtd.erasesize = max_erasesize; concat->mtd.numeraseregions = num_erase_region; concat->mtd.eraseregions = erase_region_p = - kmalloc_array(num_erase_region, - sizeof(struct mtd_erase_region_info), - GFP_KERNEL); + kmalloc_objs(struct mtd_erase_region_info, num_erase_region, + GFP_KERNEL); if (!erase_region_p) { kfree(concat); printk diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 2876501a7814..2c0be153a96e 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -53,7 +53,7 @@ static struct mtd_info *allocate_partition(struct mtd_info *parent, u64 tmp; /* allocate the partition structure */ - child = kzalloc(sizeof(*child), GFP_KERNEL); + child = kzalloc_obj(*child, GFP_KERNEL); name = kstrdup(part->name, GFP_KERNEL); if (!name || !child) { printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n", diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index d8f2e5be2d31..a2d072da1bbe 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c @@ -1413,11 +1413,11 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) "%u spare, %u bad blocks\n", MTDSWAP_PREFIX, part, swap_size / 1024, spare_cnt, bad_blocks); - d = kzalloc(sizeof(struct mtdswap_dev), GFP_KERNEL); + d = kzalloc_obj(struct mtdswap_dev, GFP_KERNEL); if (!d) return; - mbd_dev = kzalloc(sizeof(struct mtd_blktrans_dev), GFP_KERNEL); + mbd_dev = kzalloc_obj(struct mtd_blktrans_dev, GFP_KERNEL); if (!mbd_dev) { kfree(d); return; diff --git a/drivers/mtd/nand/ecc-sw-bch.c b/drivers/mtd/nand/ecc-sw-bch.c index 0d9310dd6f52..8ed20f176521 100644 --- a/drivers/mtd/nand/ecc-sw-bch.c +++ b/drivers/mtd/nand/ecc-sw-bch.c @@ -227,7 +227,7 @@ int nand_ecc_sw_bch_init_ctx(struct nand_device *nand) return -EINVAL; } - engine_conf = kzalloc(sizeof(*engine_conf), GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/ecc-sw-hamming.c b/drivers/mtd/nand/ecc-sw-hamming.c index bc62a71f9fdd..65fe971a409d 100644 --- a/drivers/mtd/nand/ecc-sw-hamming.c +++ b/drivers/mtd/nand/ecc-sw-hamming.c @@ -496,7 +496,7 @@ int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand) if (conf->step_size != 256 && conf->step_size != 512) conf->step_size = 256; - engine_conf = kzalloc(sizeof(*engine_conf), GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/generic.c b/drivers/mtd/nand/onenand/generic.c index 4e6fd1c34484..69ca617985c8 100644 --- a/drivers/mtd/nand/onenand/generic.c +++ b/drivers/mtd/nand/onenand/generic.c @@ -37,7 +37,7 @@ static int generic_onenand_probe(struct platform_device *pdev) unsigned long size = resource_size(res); int err; - info = kzalloc(sizeof(struct onenand_info), GFP_KERNEL); + info = kzalloc_obj(struct onenand_info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c index 0dc2ea4fc857..e69f46ff2b11 100644 --- a/drivers/mtd/nand/onenand/onenand_base.c +++ b/drivers/mtd/nand/onenand/onenand_base.c @@ -3728,9 +3728,8 @@ static int onenand_probe(struct mtd_info *mtd) /* Maximum possible erase regions */ mtd->numeraseregions = this->dies << 1; mtd->eraseregions = - kcalloc(this->dies << 1, - sizeof(struct mtd_erase_region_info), - GFP_KERNEL); + kzalloc_objs(struct mtd_erase_region_info, + this->dies << 1, GFP_KERNEL); if (!mtd->eraseregions) return -ENOMEM; } diff --git a/drivers/mtd/nand/onenand/onenand_bbt.c b/drivers/mtd/nand/onenand/onenand_bbt.c index d7fe35bc45cb..380e5051595f 100644 --- a/drivers/mtd/nand/onenand/onenand_bbt.c +++ b/drivers/mtd/nand/onenand/onenand_bbt.c @@ -231,7 +231,7 @@ int onenand_default_bbt(struct mtd_info *mtd) struct onenand_chip *this = mtd->priv; struct bbm_info *bbm; - this->bbm = kzalloc(sizeof(struct bbm_info), GFP_KERNEL); + this->bbm = kzalloc_obj(struct bbm_info, GFP_KERNEL); if (!this->bbm) return -ENOMEM; diff --git a/drivers/mtd/nand/qpic_common.c b/drivers/mtd/nand/qpic_common.c index db6c46a6fe01..0acd6c65f326 100644 --- a/drivers/mtd/nand/qpic_common.c +++ b/drivers/mtd/nand/qpic_common.c @@ -156,7 +156,7 @@ int qcom_prepare_bam_async_desc(struct qcom_nand_controller *nandc, enum dma_transfer_direction dir_eng; struct dma_async_tx_descriptor *dma_desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -364,7 +364,7 @@ int qcom_prep_adm_dma_desc(struct qcom_nand_controller *nandc, bool read, struct scatterlist *sgl; int ret; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c index 04d64724c400..6b09eb643ed2 100644 --- a/drivers/mtd/nand/raw/au1550nd.c +++ b/drivers/mtd/nand/raw/au1550nd.c @@ -266,7 +266,7 @@ static int au1550nd_probe(struct platform_device *pdev) return -ENODEV; } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/cafe_nand.c b/drivers/mtd/nand/raw/cafe_nand.c index 66385c4fb994..b05a41ce2e35 100644 --- a/drivers/mtd/nand/raw/cafe_nand.c +++ b/drivers/mtd/nand/raw/cafe_nand.c @@ -678,7 +678,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, pci_set_master(pdev); - cafe = kzalloc(sizeof(*cafe), GFP_KERNEL); + cafe = kzalloc_obj(*cafe, GFP_KERNEL); if (!cafe) { err = -ENOMEM; goto out_disable_device; diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c index ec95d787001b..ca2a7e16b5d8 100644 --- a/drivers/mtd/nand/raw/cs553x_nand.c +++ b/drivers/mtd/nand/raw/cs553x_nand.c @@ -273,7 +273,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) } /* Allocate memory for MTD device structure and private data */ - controller = kzalloc(sizeof(*controller), GFP_KERNEL); + controller = kzalloc_obj(*controller, GFP_KERNEL); if (!controller) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c index 03dbe37df021..fdca096d74ba 100644 --- a/drivers/mtd/nand/raw/fsl_elbc_nand.c +++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c @@ -895,13 +895,13 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev) return -ENODEV; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; mutex_lock(&fsl_elbc_nand_mutex); if (!fsl_lbc_ctrl_dev->nand) { - elbc_fcm_ctrl = kzalloc(sizeof(*elbc_fcm_ctrl), GFP_KERNEL); + elbc_fcm_ctrl = kzalloc_obj(*elbc_fcm_ctrl, GFP_KERNEL); if (!elbc_fcm_ctrl) { mutex_unlock(&fsl_elbc_nand_mutex); ret = -ENOMEM; diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c index 7be95d0be248..6eb507f6a204 100644 --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c @@ -1018,7 +1018,7 @@ static int fsl_ifc_nand_probe(struct platform_device *dev) mutex_lock(&fsl_ifc_nand_mutex); if (!fsl_ifc_ctrl_dev->nand) { - ifc_nand_ctrl = kzalloc(sizeof(*ifc_nand_ctrl), GFP_KERNEL); + ifc_nand_ctrl = kzalloc_obj(*ifc_nand_ctrl, GFP_KERNEL); if (!ifc_nand_ctrl) { mutex_unlock(&fsl_ifc_nand_mutex); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index f2322de93ab4..29f603fb2d8f 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -1062,7 +1062,7 @@ static int nand_choose_interface_config(struct nand_chip *chip) if (!nand_controller_can_setup_interface(chip)) return 0; - iface = kzalloc(sizeof(*iface), GFP_KERNEL); + iface = kzalloc_obj(*iface, GFP_KERNEL); if (!iface) return -ENOMEM; @@ -5429,8 +5429,8 @@ static int of_get_nand_secure_regions(struct nand_chip *chip) return nr_elem; chip->nr_secure_regions = nr_elem / 2; - chip->secure_regions = kcalloc(chip->nr_secure_regions, sizeof(*chip->secure_regions), - GFP_KERNEL); + chip->secure_regions = kzalloc_objs(*chip->secure_regions, + chip->nr_secure_regions, GFP_KERNEL); if (!chip->secure_regions) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_bbt.c b/drivers/mtd/nand/raw/nand_bbt.c index 3050ab7e6eb6..5e500bf2a3c2 100644 --- a/drivers/mtd/nand/raw/nand_bbt.c +++ b/drivers/mtd/nand/raw/nand_bbt.c @@ -1375,7 +1375,7 @@ static int nand_create_badblock_pattern(struct nand_chip *this) pr_warn("Bad block pattern already allocated; not replacing\n"); return -EINVAL; } - bd = kzalloc(sizeof(*bd), GFP_KERNEL); + bd = kzalloc_obj(*bd, GFP_KERNEL); if (!bd) return -ENOMEM; bd->options = this->bbt_options & BADBLOCK_SCAN_MASK; diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c index b663659b2f49..12f4e5d1038e 100644 --- a/drivers/mtd/nand/raw/nand_hynix.c +++ b/drivers/mtd/nand/raw/nand_hynix.c @@ -705,7 +705,7 @@ static int hynix_nand_init(struct nand_chip *chip) else chip->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; - hynix = kzalloc(sizeof(*hynix), GFP_KERNEL); + hynix = kzalloc_obj(*hynix, GFP_KERNEL); if (!hynix) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c index 89e6dd8ed1a8..8b2725863fbf 100644 --- a/drivers/mtd/nand/raw/nand_jedec.c +++ b/drivers/mtd/nand/raw/nand_jedec.c @@ -42,7 +42,7 @@ int nand_jedec_detect(struct nand_chip *chip) return 0; /* JEDEC chip: allocate a buffer to hold its parameter page */ - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index c0192881906b..b97a2bd606ae 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c @@ -484,7 +484,7 @@ static int micron_nand_init(struct nand_chip *chip) int ondie; int ret; - micron = kzalloc(sizeof(*micron), GFP_KERNEL); + micron = kzalloc_obj(*micron, GFP_KERNEL); if (!micron) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c index 11954440e4de..c4e7304372f1 100644 --- a/drivers/mtd/nand/raw/nand_onfi.c +++ b/drivers/mtd/nand/raw/nand_onfi.c @@ -306,7 +306,7 @@ int nand_onfi_detect(struct nand_chip *chip) if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_READ_CACHE) chip->parameters.supports_read_cache = true; - onfi = kzalloc(sizeof(*onfi), GFP_KERNEL); + onfi = kzalloc_obj(*onfi, GFP_KERNEL); if (!onfi) { ret = -ENOMEM; goto free_model; diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c index 84942e7e528f..4e7ea6c11a15 100644 --- a/drivers/mtd/nand/raw/nandsim.c +++ b/drivers/mtd/nand/raw/nandsim.c @@ -851,7 +851,7 @@ static int ns_parse_weakblocks(void) } if (*w == ',') w += 1; - wb = kzalloc(sizeof(*wb), GFP_KERNEL); + wb = kzalloc_obj(*wb, GFP_KERNEL); if (!wb) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -902,7 +902,7 @@ static int ns_parse_weakpages(void) } if (*w == ',') w += 1; - wp = kzalloc(sizeof(*wp), GFP_KERNEL); + wp = kzalloc_obj(*wp, GFP_KERNEL); if (!wp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -953,7 +953,7 @@ static int ns_parse_gravepages(void) } if (*g == ',') g += 1; - gp = kzalloc(sizeof(*gp), GFP_KERNEL); + gp = kzalloc_obj(*gp, GFP_KERNEL); if (!gp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -2268,7 +2268,7 @@ static int __init ns_init_module(void) return -EINVAL; } - ns = kzalloc(sizeof(struct nandsim), GFP_KERNEL); + ns = kzalloc_obj(struct nandsim, GFP_KERNEL); if (!ns) { NS_ERR("unable to allocate core structures.\n"); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c index 0b1f7670660e..05d3e58c50dc 100644 --- a/drivers/mtd/nand/raw/pasemi_nand.c +++ b/drivers/mtd/nand/raw/pasemi_nand.c @@ -113,7 +113,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) dev_dbg(dev, "pasemi_nand at %pR\n", &res); /* Allocate memory for MTD device structure and private data */ - ddata = kzalloc(sizeof(*ddata), GFP_KERNEL); + ddata = kzalloc_obj(*ddata, GFP_KERNEL); if (!ddata) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c index 918974d088cf..24e702919b87 100644 --- a/drivers/mtd/nand/raw/r852.c +++ b/drivers/mtd/nand/raw/r852.c @@ -867,7 +867,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) error = -ENOMEM; /* init nand chip, but register it only on card insert */ - chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL); + chip = kzalloc_obj(struct nand_chip, GFP_KERNEL); if (!chip) goto error4; @@ -883,7 +883,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) chip->legacy.write_buf = r852_write_buf; /* init our device structure */ - dev = kzalloc(sizeof(struct r852_device), GFP_KERNEL); + dev = kzalloc_obj(struct r852_device, GFP_KERNEL); if (!dev) goto error5; diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c index 142e93b200a3..d74097783036 100644 --- a/drivers/mtd/nand/raw/sharpsl.c +++ b/drivers/mtd/nand/raw/sharpsl.c @@ -132,7 +132,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) } /* Allocate memory for MTD device structure and private data */ - sharpsl = kzalloc(sizeof(struct sharpsl_nand), GFP_KERNEL); + sharpsl = kzalloc_obj(struct sharpsl_nand, GFP_KERNEL); if (!sharpsl) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c index 907fb5de4269..e49c38abef68 100644 --- a/drivers/mtd/nand/raw/txx9ndfmc.c +++ b/drivers/mtd/nand/raw/txx9ndfmc.c @@ -319,8 +319,7 @@ static int txx9ndfmc_probe(struct platform_device *dev) if (!(plat->ch_mask & (1 << i))) continue; - txx9_priv = kzalloc(sizeof(struct txx9ndfmc_priv), - GFP_KERNEL); + txx9_priv = kzalloc_obj(struct txx9ndfmc_priv, GFP_KERNEL); if (!txx9_priv) continue; chip = &txx9_priv->chip; diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 29fb2ac19569..86dee7d13a38 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -350,7 +350,7 @@ static int spinand_ondie_ecc_init_ctx(struct nand_device *nand) nand->ecc.ctx.conf.step_size = nand->ecc.requirements.step_size; nand->ecc.ctx.conf.strength = nand->ecc.requirements.strength; - engine_conf = kzalloc(sizeof(*engine_conf), GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index e4380208edd0..137571093ec0 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -642,7 +642,7 @@ static int gd5fxgm9_spinand_init(struct spinand_device *spinand) { struct gigadevice_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index 84be5e0402b5..2e6b9be9c58b 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -499,7 +499,7 @@ static int macronix_spinand_init(struct spinand_device *spinand) { struct macronix_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index 868aa3d35d09..9f3c193fb0c4 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c @@ -45,7 +45,7 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) pr_debug("NFTL: add_mtd for %s\n", mtd->name); - nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL); + nftl = kzalloc_obj(struct NFTLrecord, GFP_KERNEL); if (!nftl) return; diff --git a/drivers/mtd/parsers/bcm47xxpart.c b/drivers/mtd/parsers/bcm47xxpart.c index 49c8e7f27f21..b8ba7d2f22e1 100644 --- a/drivers/mtd/parsers/bcm47xxpart.c +++ b/drivers/mtd/parsers/bcm47xxpart.c @@ -106,8 +106,8 @@ static int bcm47xxpart_parse(struct mtd_info *master, blocksize = 0x1000; /* Alloc */ - parts = kcalloc(BCM47XXPART_MAX_PARTS, sizeof(struct mtd_partition), - GFP_KERNEL); + parts = kzalloc_objs(struct mtd_partition, BCM47XXPART_MAX_PARTS, + GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/brcm_u-boot.c b/drivers/mtd/parsers/brcm_u-boot.c index 984f98923446..168cd629c277 100644 --- a/drivers/mtd/parsers/brcm_u-boot.c +++ b/drivers/mtd/parsers/brcm_u-boot.c @@ -37,7 +37,7 @@ static int brcm_u_boot_parse(struct mtd_info *mtd, int err; int i = 0; - parts = kcalloc(BRCM_U_BOOT_MAX_PARTS, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, BRCM_U_BOOT_MAX_PARTS, GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/ofpart_core.c b/drivers/mtd/parsers/ofpart_core.c index 599adb69eba6..02cf6a539e3f 100644 --- a/drivers/mtd/parsers/ofpart_core.c +++ b/drivers/mtd/parsers/ofpart_core.c @@ -102,7 +102,7 @@ static int parse_fixed_partitions(struct mtd_info *master, return 0; } - parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); if (!parts) { if (dedicated) of_node_put(ofpart_node); @@ -249,7 +249,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master, nr_parts = plen / sizeof(part[0]); - parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/parser_trx.c b/drivers/mtd/parsers/parser_trx.c index 4814cf218e17..cfd9ab8caff5 100644 --- a/drivers/mtd/parsers/parser_trx.c +++ b/drivers/mtd/parsers/parser_trx.c @@ -65,8 +65,8 @@ static int parser_trx_parse(struct mtd_info *mtd, if (err != 0 && err != -EINVAL) pr_err("failed to parse \"brcm,trx-magic\" DT attribute, using default: %d\n", err); - parts = kcalloc(TRX_PARSER_MAX_PARTS, sizeof(struct mtd_partition), - GFP_KERNEL); + parts = kzalloc_objs(struct mtd_partition, TRX_PARSER_MAX_PARTS, + GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c index 4311b89d8df0..dd595387946b 100644 --- a/drivers/mtd/parsers/qcomsmempart.c +++ b/drivers/mtd/parsers/qcomsmempart.c @@ -123,7 +123,7 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, numparts++; } - parts = kcalloc(numparts, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, numparts, GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c index 3b55b676ca6b..4f3f5145ea83 100644 --- a/drivers/mtd/parsers/redboot.c +++ b/drivers/mtd/parsers/redboot.c @@ -203,7 +203,7 @@ nogood: if (!redboot_checksum(&buf[i])) break; - new_fl = kmalloc(sizeof(struct fis_list), GFP_KERNEL); + new_fl = kmalloc_obj(struct fis_list, GFP_KERNEL); namelen += strlen(buf[i].name) + 1; if (!new_fl) { ret = -ENOMEM; diff --git a/drivers/mtd/parsers/scpart.c b/drivers/mtd/parsers/scpart.c index 6e5e11c37078..84b89499b200 100644 --- a/drivers/mtd/parsers/scpart.c +++ b/drivers/mtd/parsers/scpart.c @@ -80,7 +80,7 @@ static int scpart_scan_partmap(struct mtd_info *master, loff_t partmap_offs, if (cnt > 0) { int bytes = cnt * sizeof(*pdesc); - pdesc = kcalloc(cnt, sizeof(*pdesc), GFP_KERNEL); + pdesc = kzalloc_objs(*pdesc, cnt, GFP_KERNEL); if (!pdesc) { res = -ENOMEM; goto free; @@ -171,8 +171,8 @@ static int scpart_parse(struct mtd_info *master, goto free; } - parts = kcalloc(of_get_child_count(ofpart_node), sizeof(*parts), - GFP_KERNEL); + parts = kzalloc_objs(*parts, of_get_child_count(ofpart_node), + GFP_KERNEL); if (!parts) { res = -ENOMEM; goto free; diff --git a/drivers/mtd/parsers/sharpslpart.c b/drivers/mtd/parsers/sharpslpart.c index 671a61845bd5..ce1e255b707d 100644 --- a/drivers/mtd/parsers/sharpslpart.c +++ b/drivers/mtd/parsers/sharpslpart.c @@ -362,9 +362,8 @@ static int sharpsl_parse_mtd_partitions(struct mtd_info *master, return err; } - sharpsl_nand_parts = kcalloc(SHARPSL_NAND_PARTS, - sizeof(*sharpsl_nand_parts), - GFP_KERNEL); + sharpsl_nand_parts = kzalloc_objs(*sharpsl_nand_parts, + SHARPSL_NAND_PARTS, GFP_KERNEL); if (!sharpsl_nand_parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/tplink_safeloader.c b/drivers/mtd/parsers/tplink_safeloader.c index 4fcaf92d22e4..3a4e9b84277f 100644 --- a/drivers/mtd/parsers/tplink_safeloader.c +++ b/drivers/mtd/parsers/tplink_safeloader.c @@ -82,7 +82,7 @@ static int mtd_parser_tplink_safeloader_parse(struct mtd_info *mtd, int idx; int err; - parts = kcalloc(TPLINK_SAFELOADER_MAX_PARTS, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, TPLINK_SAFELOADER_MAX_PARTS, GFP_KERNEL); if (!parts) { err = -ENOMEM; goto err_out; diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index be26cc67a1c4..f7d5591e8858 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -185,8 +185,8 @@ static int scan_header(struct partition *part) if (!part->header_cache) goto err; - part->blocks = kcalloc(part->total_blocks, sizeof(struct block), - GFP_KERNEL); + part->blocks = kzalloc_objs(struct block, part->total_blocks, + GFP_KERNEL); if (!part->blocks) goto err; @@ -270,7 +270,7 @@ static int erase_block(struct partition *part, int block) struct erase_info *erase; int rc; - erase = kmalloc(sizeof(struct erase_info), GFP_KERNEL); + erase = kmalloc_obj(struct erase_info, GFP_KERNEL); if (!erase) return -ENOMEM; @@ -752,7 +752,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) mtd->size > UINT_MAX) return; - part = kzalloc(sizeof(struct partition), GFP_KERNEL); + part = kzalloc_obj(struct partition, GFP_KERNEL); if (!part) return; diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index 5988cba30eb3..5da82a4612b6 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -64,7 +64,7 @@ static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) /* Initialize sysfs attributes */ vendor_attribute = - kzalloc(sizeof(struct sm_sysfs_attribute), GFP_KERNEL); + kzalloc_obj(struct sm_sysfs_attribute, GFP_KERNEL); if (!vendor_attribute) goto error2; @@ -78,14 +78,14 @@ static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) /* Create array of pointers to the attributes */ - attributes = kcalloc(NUM_ATTRIBUTES + 1, sizeof(struct attribute *), - GFP_KERNEL); + attributes = kzalloc_objs(struct attribute *, NUM_ATTRIBUTES + 1, + GFP_KERNEL); if (!attributes) goto error3; attributes[0] = &vendor_attribute->dev_attr.attr; /* Finally create the attribute group */ - attr_group = kzalloc(sizeof(struct attribute_group), GFP_KERNEL); + attr_group = kzalloc_obj(struct attribute_group, GFP_KERNEL); if (!attr_group) goto error4; attr_group->attrs = attributes; @@ -1134,7 +1134,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) struct sm_ftl *ftl; /* Allocate & initialize our private structure */ - ftl = kzalloc(sizeof(struct sm_ftl), GFP_KERNEL); + ftl = kzalloc_obj(struct sm_ftl, GFP_KERNEL); if (!ftl) goto error1; @@ -1156,8 +1156,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) goto error2; /* Allocate zone array, it will be initialized on demand */ - ftl->zones = kcalloc(ftl->zone_count, sizeof(struct ftl_zone), - GFP_KERNEL); + ftl->zones = kzalloc_objs(struct ftl_zone, ftl->zone_count, GFP_KERNEL); if (!ftl->zones) goto error3; @@ -1171,7 +1170,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) /* Allocate upper layer structure and initialize it */ - trans = kzalloc(sizeof(struct mtd_blktrans_dev), GFP_KERNEL); + trans = kzalloc_obj(struct mtd_blktrans_dev, GFP_KERNEL); if (!trans) goto error5; diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index d3f8a78efd3b..d48170eceec6 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1553,7 +1553,7 @@ spi_nor_init_erase_cmd(const struct spi_nor_erase_region *region, { struct spi_nor_erase_command *cmd; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kmalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return ERR_PTR(-ENOMEM); diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c index a8324c2da0ac..1514f21c8557 100644 --- a/drivers/mtd/spi-nor/sfdp.c +++ b/drivers/mtd/spi-nor/sfdp.c @@ -760,7 +760,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt, u8 read_data_mask, map_id; /* Use a kmalloc'ed bounce buffer to guarantee it is DMA-able. */ - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index 46c01fa2ec46..b4e9a1c11c54 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c @@ -295,7 +295,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) if (cis_sector == -1) return; - ssfdc = kzalloc(sizeof(*ssfdc), GFP_KERNEL); + ssfdc = kzalloc_obj(*ssfdc, GFP_KERNEL); if (!ssfdc) return; diff --git a/drivers/mtd/tests/stresstest.c b/drivers/mtd/tests/stresstest.c index 8062098930d6..ec5d7bd93b77 100644 --- a/drivers/mtd/tests/stresstest.c +++ b/drivers/mtd/tests/stresstest.c @@ -178,7 +178,7 @@ static int __init mtd_stresstest_init(void) err = -ENOMEM; readbuf = vmalloc(bufsize); writebuf = vmalloc(bufsize); - offsets = kmalloc_array(ebcnt, sizeof(int), GFP_KERNEL); + offsets = kmalloc_objs(int, ebcnt, GFP_KERNEL); if (!readbuf || !writebuf || !offsets) goto out; for (i = 0; i < ebcnt; i++) diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 884171871d0e..9823e0bd7a51 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c @@ -131,7 +131,7 @@ static struct ubi_ainf_volume *find_or_add_av(struct ubi_attach_info *ai, return NULL; /* The volume is absent - add it */ - av = kzalloc(sizeof(*av), GFP_KERNEL); + av = kzalloc_obj(*av, GFP_KERNEL); if (!av) return ERR_PTR(-ENOMEM); @@ -1451,7 +1451,7 @@ static struct ubi_attach_info *alloc_ai(const char *slab_name) { struct ubi_attach_info *ai; - ai = kzalloc(sizeof(struct ubi_attach_info), GFP_KERNEL); + ai = kzalloc_obj(struct ubi_attach_info, GFP_KERNEL); if (!ai) return ai; diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c index b53fd147fa65..4428486fb287 100644 --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c @@ -368,7 +368,7 @@ int ubiblock_create(struct ubi_volume_info *vi) goto out_unlock; } - dev = kzalloc(sizeof(struct ubiblock), GFP_KERNEL); + dev = kzalloc_obj(struct ubiblock, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index ef6a22f372f9..d7493b61bee4 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -930,7 +930,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, } } - ubi = kzalloc(sizeof(struct ubi_device), GFP_KERNEL); + ubi = kzalloc_obj(struct ubi_device, GFP_KERNEL); if (!ubi) return -ENOMEM; diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index b700a0efaa93..0b233b6a2d9c 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -727,7 +727,7 @@ static int rename_volumes(struct ubi_device *ubi, int name_len = req->ents[i].name_len; const char *name = req->ents[i].name; - re = kzalloc(sizeof(struct ubi_rename_entry), GFP_KERNEL); + re = kzalloc_obj(struct ubi_rename_entry, GFP_KERNEL); if (!re) { err = -ENOMEM; goto out_free; @@ -801,7 +801,7 @@ static int rename_volumes(struct ubi_device *ubi, goto out_free; } - re1 = kzalloc(sizeof(struct ubi_rename_entry), GFP_KERNEL); + re1 = kzalloc_obj(struct ubi_rename_entry, GFP_KERNEL); if (!re1) { err = -ENOMEM; ubi_close_volume(desc); @@ -1007,7 +1007,7 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd, struct ubi_rnvol_req *req; dbg_gen("re-name volumes"); - req = kmalloc(sizeof(struct ubi_rnvol_req), GFP_KERNEL); + req = kmalloc_obj(struct ubi_rnvol_req, GFP_KERNEL); if (!req) { err = -ENOMEM; break; diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index c7ba7a15c9f7..dbc448e2b7a6 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -124,12 +124,11 @@ struct ubi_eba_table *ubi_eba_create_table(struct ubi_volume *vol, int err = -ENOMEM; int i; - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (!tbl) return ERR_PTR(-ENOMEM); - tbl->entries = kmalloc_array(nentries, sizeof(*tbl->entries), - GFP_KERNEL); + tbl->entries = kmalloc_objs(*tbl->entries, nentries, GFP_KERNEL); if (!tbl->entries) goto err; @@ -248,7 +247,7 @@ static struct ubi_ltree_entry *ltree_add_entry(struct ubi_device *ubi, { struct ubi_ltree_entry *le, *le1, *le_free; - le = kmalloc(sizeof(struct ubi_ltree_entry), GFP_NOFS); + le = kmalloc_obj(struct ubi_ltree_entry, GFP_NOFS); if (!le) return ERR_PTR(-ENOMEM); @@ -1536,11 +1535,11 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap, num_volumes = ubi->vtbl_slots + UBI_INT_VOL_COUNT; - scan_eba = kmalloc_array(num_volumes, sizeof(*scan_eba), GFP_KERNEL); + scan_eba = kmalloc_objs(*scan_eba, num_volumes, GFP_KERNEL); if (!scan_eba) return -ENOMEM; - fm_eba = kmalloc_array(num_volumes, sizeof(*fm_eba), GFP_KERNEL); + fm_eba = kmalloc_objs(*fm_eba, num_volumes, GFP_KERNEL); if (!fm_eba) { kfree(scan_eba); return -ENOMEM; @@ -1551,17 +1550,15 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap, if (!vol) continue; - scan_eba[i] = kmalloc_array(vol->reserved_pebs, - sizeof(**scan_eba), - GFP_KERNEL); + scan_eba[i] = kmalloc_objs(**scan_eba, vol->reserved_pebs, + GFP_KERNEL); if (!scan_eba[i]) { ret = -ENOMEM; goto out_free; } - fm_eba[i] = kmalloc_array(vol->reserved_pebs, - sizeof(**fm_eba), - GFP_KERNEL); + fm_eba[i] = kmalloc_objs(**fm_eba, vol->reserved_pebs, + GFP_KERNEL); if (!fm_eba[i]) { ret = -ENOMEM; kfree(scan_eba[i]); diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c index e2bc1122bfd3..a0f750411f9d 100644 --- a/drivers/mtd/ubi/fastmap-wl.c +++ b/drivers/mtd/ubi/fastmap-wl.c @@ -466,7 +466,7 @@ int ubi_ensure_anchor_pebs(struct ubi_device *ubi) ubi->wl_scheduled = 1; spin_unlock(&ubi->wl_lock); - wrk = kmalloc(sizeof(struct ubi_work), GFP_NOFS); + wrk = kmalloc_obj(struct ubi_work, GFP_NOFS); if (!wrk) { spin_lock(&ubi->wl_lock); ubi->wl_scheduled = 0; diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 9a4940874be5..30953ff2ff52 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -889,13 +889,13 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai, down_write(&ubi->fm_protect); memset(ubi->fm_buf, 0, ubi->fm_size); - fmsb = kmalloc(sizeof(*fmsb), GFP_KERNEL); + fmsb = kmalloc_obj(*fmsb, GFP_KERNEL); if (!fmsb) { ret = -ENOMEM; goto out; } - fm = kzalloc(sizeof(*fm), GFP_KERNEL); + fm = kzalloc_obj(*fm, GFP_KERNEL); if (!fm) { ret = -ENOMEM; kfree(fmsb); @@ -1416,7 +1416,7 @@ static int invalidate_fastmap(struct ubi_device *ubi) ubi->fm = NULL; ret = -ENOMEM; - fm = kzalloc(sizeof(*fm), GFP_NOFS); + fm = kzalloc_obj(*fm, GFP_NOFS); if (!fm) goto out; @@ -1501,7 +1501,7 @@ int ubi_update_fastmap(struct ubi_device *ubi) return 0; } - new_fm = kzalloc(sizeof(*new_fm), GFP_NOFS); + new_fm = kzalloc_obj(*new_fm, GFP_NOFS); if (!new_fm) { up_write(&ubi->fm_eba_sem); up_write(&ubi->work_sem); diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c index 1b980d15d9fb..e56b4172264c 100644 --- a/drivers/mtd/ubi/gluebi.c +++ b/drivers/mtd/ubi/gluebi.c @@ -281,7 +281,7 @@ static int gluebi_create(struct ubi_device_info *di, struct gluebi_device *gluebi, *g; struct mtd_info *mtd; - gluebi = kzalloc(sizeof(struct gluebi_device), GFP_KERNEL); + gluebi = kzalloc_obj(struct gluebi_device, GFP_KERNEL); if (!gluebi) return -ENOMEM; diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index df0a5a57b072..7cc239245e42 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -140,7 +140,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) goto out_put_ubi; } - desc = kmalloc(sizeof(struct ubi_volume_desc), GFP_KERNEL); + desc = kmalloc_obj(struct ubi_volume_desc, GFP_KERNEL); if (!desc) { err = -ENOMEM; goto out_put_ubi; diff --git a/drivers/mtd/ubi/nvmem.c b/drivers/mtd/ubi/nvmem.c index 34f8c1d3cdee..bc2cfb355d5c 100644 --- a/drivers/mtd/ubi/nvmem.c +++ b/drivers/mtd/ubi/nvmem.c @@ -75,7 +75,7 @@ static int ubi_nvmem_add(struct ubi_volume_info *vi) WARN_ON_ONCE(vi->size <= 0)) return -EINVAL; - unv = kzalloc(sizeof(struct ubi_nvmem), GFP_KERNEL); + unv = kzalloc_obj(struct ubi_nvmem, GFP_KERNEL); if (!unv) return -ENOMEM; diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 44803d3329f4..af466cd83ae0 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h @@ -1100,7 +1100,7 @@ ubi_alloc_vid_buf(const struct ubi_device *ubi, gfp_t gfp_flags) struct ubi_vid_io_buf *vidb; void *buf; - vidb = kzalloc(sizeof(*vidb), gfp_flags); + vidb = kzalloc_obj(*vidb, gfp_flags); if (!vidb) return NULL; diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index e5cf3bdca3b0..ffec2c649698 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -172,7 +172,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) if (ubi->ro_mode) return -EROFS; - vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); if (!vol) return -ENOMEM; diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 6e5489e233dd..74427a03e896 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -531,7 +531,7 @@ static int init_volumes(struct ubi_device *ubi, if (be32_to_cpu(vtbl[i].reserved_pebs) == 0) continue; /* Empty record */ - vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); if (!vol) return -ENOMEM; @@ -623,7 +623,7 @@ static int init_volumes(struct ubi_device *ubi, } /* And add the layout volume */ - vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); if (!vol) return -ENOMEM; diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index fbd399cf6503..e3705db8e570 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -602,7 +602,7 @@ static int schedule_erase(struct ubi_device *ubi, struct ubi_wl_entry *e, dbg_wl("schedule erasure of PEB %d, EC %d, torture %d", e->pnum, e->ec, torture); - wl_wrk = kmalloc(sizeof(struct ubi_work), GFP_NOFS); + wl_wrk = kmalloc_obj(struct ubi_work, GFP_NOFS); if (!wl_wrk) return -ENOMEM; @@ -1071,7 +1071,7 @@ static int ensure_wear_leveling(struct ubi_device *ubi, int nested) ubi->wl_scheduled = 1; spin_unlock(&ubi->wl_lock); - wrk = kmalloc(sizeof(struct ubi_work), GFP_NOFS); + wrk = kmalloc_obj(struct ubi_work, GFP_NOFS); if (!wrk) { err = -ENOMEM; goto out_cancel; diff --git a/drivers/mux/core.c b/drivers/mux/core.c index a3840fe0995f..236e4f02f38e 100644 --- a/drivers/mux/core.c +++ b/drivers/mux/core.c @@ -681,7 +681,7 @@ static struct mux_state *mux_state_get(struct device *dev, const char *mux_name) { struct mux_state *mstate; - mstate = kzalloc(sizeof(*mstate), GFP_KERNEL); + mstate = kzalloc_obj(*mstate, GFP_KERNEL); if (!mstate) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/amt.c b/drivers/net/amt.c index 902c817a0dea..f2f3139e38a5 100644 --- a/drivers/net/amt.c +++ b/drivers/net/amt.c @@ -368,7 +368,7 @@ static struct amt_source_node *amt_alloc_snode(struct amt_group_node *gnode, { struct amt_source_node *snode; - snode = kzalloc(sizeof(*snode), GFP_ATOMIC); + snode = kzalloc_obj(*snode, GFP_ATOMIC); if (!snode) return NULL; diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c index 75f08aa7528b..a6d9207cfc16 100644 --- a/drivers/net/arcnet/com20020_cs.c +++ b/drivers/net/arcnet/com20020_cs.c @@ -119,7 +119,7 @@ static int com20020_probe(struct pcmcia_device *p_dev) dev_dbg(&p_dev->dev, "com20020_attach()\n"); /* Create new network device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) goto fail_alloc_info; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 55a960da42b5..cddcbb5883c6 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -491,7 +491,7 @@ static int bond_ipsec_add_sa(struct net_device *bond_dev, goto out; } - ipsec = kmalloc(sizeof(*ipsec), GFP_KERNEL); + ipsec = kmalloc_obj(*ipsec, GFP_KERNEL); if (!ipsec) { err = -ENOMEM; goto out; @@ -1387,7 +1387,7 @@ static inline int slave_enable_netpoll(struct slave *slave) struct netpoll *np; int err = 0; - np = kzalloc(sizeof(*np), GFP_KERNEL); + np = kzalloc_obj(*np, GFP_KERNEL); err = -ENOMEM; if (!np) goto out; @@ -1711,7 +1711,7 @@ static struct slave *bond_alloc_slave(struct bonding *bond, { struct slave *slave = NULL; - slave = kzalloc(sizeof(*slave), GFP_KERNEL); + slave = kzalloc_obj(*slave, GFP_KERNEL); if (!slave) return NULL; @@ -1723,8 +1723,8 @@ static struct slave *bond_alloc_slave(struct bonding *bond, return NULL; if (BOND_MODE(bond) == BOND_MODE_8023AD) { - SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), - GFP_KERNEL); + SLAVE_AD_INFO(slave) = kzalloc_obj(struct ad_slave_info, + GFP_KERNEL); if (!SLAVE_AD_INFO(slave)) { kobject_put(&slave->kobj); return NULL; @@ -2982,7 +2982,7 @@ struct bond_vlan_tag *bond_verify_device_path(struct net_device *start_dev, struct list_head *iter; if (start_dev == end_dev) { - tags = kcalloc(level + 1, sizeof(*tags), GFP_ATOMIC); + tags = kzalloc_objs(*tags, level + 1, GFP_ATOMIC); if (!tags) return ERR_PTR(-ENOMEM); tags[level].vlan_proto = BOND_VLAN_PROTO_NONE; @@ -5097,10 +5097,9 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) might_sleep(); - usable_slaves = kzalloc(struct_size(usable_slaves, arr, - bond->slave_cnt), GFP_KERNEL); - all_slaves = kzalloc(struct_size(all_slaves, arr, - bond->slave_cnt), GFP_KERNEL); + usable_slaves = kzalloc_flex(*usable_slaves, arr, bond->slave_cnt, + GFP_KERNEL); + all_slaves = kzalloc_flex(*all_slaves, arr, bond->slave_cnt, GFP_KERNEL); if (!usable_slaves || !all_slaves) { ret = -ENOMEM; goto out; diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index c60386bf2d1a..8ac1a4b8e055 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -493,7 +493,7 @@ static struct buf_info *cfv_alloc_and_copy_to_shm(struct cfv_info *cfv, goto err; } - buf_info = kmalloc(sizeof(struct buf_info), GFP_ATOMIC); + buf_info = kmalloc_obj(struct buf_info, GFP_ATOMIC); if (unlikely(!buf_info)) goto err; diff --git a/drivers/net/can/ctucanfd/ctucanfd_pci.c b/drivers/net/can/ctucanfd/ctucanfd_pci.c index 9da09e7dd63a..2d731a6f0be0 100644 --- a/drivers/net/can/ctucanfd/ctucanfd_pci.c +++ b/drivers/net/can/ctucanfd/ctucanfd_pci.c @@ -153,7 +153,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev, ntxbufs = 4; - bdata = kzalloc(sizeof(*bdata), GFP_KERNEL); + bdata = kzalloc_obj(*bdata, GFP_KERNEL); if (!bdata) { ret = -ENOMEM; goto err_pci_iounmap_bar0; diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c index 3b1b09943436..56758ddf939b 100644 --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -1054,8 +1054,7 @@ static int grcan_open(struct net_device *dev) return err; } - priv->echo_skb = kcalloc(dma->tx.size, sizeof(*priv->echo_skb), - GFP_KERNEL); + priv->echo_skb = kzalloc_objs(*priv->echo_skb, dma->tx.size, GFP_KERNEL); if (!priv->echo_skb) { err = -ENOMEM; goto exit_free_dma_buffers; diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c index 5bca719d61f5..c4716df2e00f 100644 --- a/drivers/net/can/sja1000/ems_pci.c +++ b/drivers/net/can/sja1000/ems_pci.c @@ -260,7 +260,7 @@ static int ems_pci_add_card(struct pci_dev *pdev, } /* Allocating card structures to hold addresses, ... */ - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) { pci_disable_device(pdev); return -ENOMEM; diff --git a/drivers/net/can/sja1000/ems_pcmcia.c b/drivers/net/can/sja1000/ems_pcmcia.c index 4642b6d4aaf7..fad4c51767ed 100644 --- a/drivers/net/can/sja1000/ems_pcmcia.c +++ b/drivers/net/can/sja1000/ems_pcmcia.c @@ -165,7 +165,7 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base) int err, i; /* Allocating card structures to hold addresses, ... */ - card = kzalloc(sizeof(struct ems_pcmcia_card), GFP_KERNEL); + card = kzalloc_obj(struct ems_pcmcia_card, GFP_KERNEL); if (!card) return -ENOMEM; diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index 10d88cbda465..4ab825636092 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c @@ -452,7 +452,7 @@ static int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev) /* channel is the first one: do the init part */ } else { /* create the bit banging I2C adapter structure */ - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) return -ENOMEM; diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c index e1610b527d13..04b37c746620 100644 --- a/drivers/net/can/sja1000/peak_pcmcia.c +++ b/drivers/net/can/sja1000/peak_pcmcia.c @@ -650,7 +650,7 @@ static int pcan_probe(struct pcmcia_device *pdev) goto probe_err_1; } - card = kzalloc(sizeof(struct pcan_pccard), GFP_KERNEL); + card = kzalloc_obj(struct pcan_pccard, GFP_KERNEL); if (!card) { err = -ENOMEM; goto probe_err_2; diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c index 67e5316c6372..d1c9427f6a5d 100644 --- a/drivers/net/can/sja1000/plx_pci.c +++ b/drivers/net/can/sja1000/plx_pci.c @@ -629,7 +629,7 @@ static int plx_pci_add_card(struct pci_dev *pdev, ci->name, PCI_SLOT(pdev->devfn)); /* Allocate card structures to hold addresses, ... */ - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) { pci_disable_device(pdev); return -ENOMEM; diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c index e5c939b63fa6..c37390fa7e6a 100644 --- a/drivers/net/can/softing/softing_cs.c +++ b/drivers/net/can/softing/softing_cs.c @@ -256,7 +256,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia) } /* create softing platform device */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto mem_failed; diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 79bc64395ac4..4872f636e367 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -767,7 +767,7 @@ static int softing_pdev_probe(struct platform_device *pdev) return -EINVAL; } - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) return -ENOMEM; card->pdat = pdat; diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index 5134ebb85880..6ef8a3fa2f1e 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -1961,11 +1961,11 @@ mcp251xfd_register_get_dev_id(const struct mcp251xfd_priv *priv, u32 *dev_id, struct spi_transfer xfer[2] = { }; int err; - buf_rx = kzalloc(sizeof(*buf_rx), GFP_KERNEL); + buf_rx = kzalloc_obj(*buf_rx, GFP_KERNEL); if (!buf_rx) return -ENOMEM; - buf_tx = kzalloc(sizeof(*buf_tx), GFP_KERNEL); + buf_tx = kzalloc_obj(*buf_tx, GFP_KERNEL); if (!buf_tx) { err = -ENOMEM; goto out_kfree_buf_rx; diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 8cc924c47042..029a321bac10 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -726,7 +726,7 @@ static int esd_usb_start(struct esd_usb_net_priv *priv) union esd_usb_msg *msg; int err, i; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) { err = -ENOMEM; goto out; @@ -962,7 +962,7 @@ static int esd_usb_stop(struct esd_usb_net_priv *priv) int err; int i; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -1068,7 +1068,7 @@ static int esd_usb_2_set_bittiming(struct net_device *netdev) if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) canbtr |= ESD_USB_TRIPLE_SAMPLES; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -1130,7 +1130,7 @@ static int esd_usb_3_set_bittiming(struct net_device *netdev) u16 flags = 0; int err; - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -1302,7 +1302,7 @@ static int esd_usb_probe(struct usb_interface *intf, union esd_usb_msg *msg; int i, err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { err = -ENOMEM; goto done; @@ -1314,7 +1314,7 @@ static int esd_usb_probe(struct usb_interface *intf, usb_set_intfdata(intf, dev); - msg = kmalloc(sizeof(*msg), GFP_KERNEL); + msg = kmalloc_obj(*msg, GFP_KERNEL); if (!msg) { err = -ENOMEM; goto free_msg; diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c index efe61ece79ea..435c7d878138 100644 --- a/drivers/net/can/usb/f81604.c +++ b/drivers/net/can/usb/f81604.c @@ -678,7 +678,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) break; } - frame = kmalloc(sizeof(*frame), GFP_KERNEL); + frame = kmalloc_obj(*frame, GFP_KERNEL); if (!frame) { usb_free_urb(rx_urb); ret = -ENOMEM; @@ -717,7 +717,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) goto error; } - int_data = kmalloc(sizeof(*int_data), GFP_KERNEL); + int_data = kmalloc_obj(*int_data, GFP_KERNEL); if (!int_data) { usb_free_urb(int_urb); ret = -ENOMEM; @@ -919,7 +919,7 @@ static netdev_tx_t f81604_start_xmit(struct sk_buff *skb, if (!write_urb) goto nomem_urb; - frame = kzalloc(sizeof(*frame), GFP_ATOMIC); + frame = kzalloc_obj(*frame, GFP_ATOMIC); if (!frame) goto nomem_buf; diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index d8b2dd74b3a1..95de036c4410 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -1560,7 +1560,7 @@ static int gs_usb_probe(struct usb_interface *intf, return -EINVAL; } - parent = kzalloc(struct_size(parent, canch, icount), GFP_KERNEL); + parent = kzalloc_flex(*parent, canch, icount, GFP_KERNEL); if (!parent) return -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index a59f20dad692..e765210626ce 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -580,7 +580,7 @@ static int kvaser_usb_hydra_send_simple_cmd(struct kvaser_usb *dev, size_t cmd_len; int err; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -621,7 +621,7 @@ kvaser_usb_hydra_send_simple_cmd_async(struct kvaser_usb_net_priv *priv, size_t cmd_len; int err; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return -ENOMEM; @@ -742,7 +742,7 @@ static int kvaser_usb_hydra_map_channel(struct kvaser_usb *dev, u16 transid, struct kvaser_cmd *cmd; int err; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -784,7 +784,7 @@ static int kvaser_usb_hydra_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1465,7 +1465,7 @@ kvaser_usb_hydra_frame_to_cmd_ext(const struct kvaser_usb_net_priv *priv, u32 kcan_id; u32 kcan_header; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return NULL; @@ -1544,7 +1544,7 @@ kvaser_usb_hydra_frame_to_cmd_std(const struct kvaser_usb_net_priv *priv, u32 flags; u32 id; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return NULL; @@ -1610,7 +1610,7 @@ static int kvaser_usb_hydra_get_busparams(struct kvaser_usb_net_priv *priv, if (!hydra) return -EINVAL; - cmd = kcalloc(1, sizeof(struct kvaser_cmd), GFP_KERNEL); + cmd = kzalloc_objs(struct kvaser_cmd, 1, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1655,7 +1655,7 @@ static int kvaser_usb_hydra_set_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1685,7 +1685,7 @@ static int kvaser_usb_hydra_set_data_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1842,7 +1842,7 @@ static int kvaser_usb_hydra_get_software_details(struct kvaser_usb *dev) u32 fw_version; struct kvaser_usb_dev_card_data *card_data = &dev->card_data; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1985,7 +1985,7 @@ static int kvaser_usb_hydra_set_led(struct kvaser_usb_net_priv *priv, size_t cmd_len; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -2021,7 +2021,7 @@ static int kvaser_usb_hydra_set_opt_mode(const struct kvaser_usb_net_priv *priv) return -EINVAL; } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index 1167d38344f1..8e32d98ab0a3 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -616,7 +616,7 @@ kvaser_usb_leaf_frame_to_cmd(const struct kvaser_usb_net_priv *priv, u8 *cmd_tx_can_flags = NULL; /* GCC */ struct can_frame *cf = (struct can_frame *)skb->data; - cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kmalloc_obj(*cmd, GFP_ATOMIC); if (cmd) { cmd->u.tx_can.tid = transid & 0xff; cmd->len = *cmd_len = CMD_HEADER_LEN + @@ -723,7 +723,7 @@ static int kvaser_usb_leaf_send_simple_cmd(const struct kvaser_usb *dev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kmalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -873,7 +873,7 @@ static int kvaser_usb_leaf_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -970,7 +970,7 @@ static int kvaser_usb_leaf_set_led(struct kvaser_usb_net_priv *priv, struct kvaser_cmd *cmd; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1079,7 +1079,7 @@ static int kvaser_usb_leaf_simple_cmd_async(struct kvaser_usb_net_priv *priv, struct kvaser_cmd *cmd; int err; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return -ENOMEM; @@ -1752,7 +1752,7 @@ static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1824,7 +1824,7 @@ static int kvaser_usb_leaf_flush_queue(struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1881,7 +1881,7 @@ static int kvaser_usb_leaf_set_bittiming(const struct net_device *netdev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kmalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/nct6694_canfd.c b/drivers/net/can/usb/nct6694_canfd.c index dd6df2ec3742..de60c2d1cdd1 100644 --- a/drivers/net/can/usb/nct6694_canfd.c +++ b/drivers/net/can/usb/nct6694_canfd.c @@ -527,7 +527,7 @@ static int nct6694_canfd_start(struct net_device *ndev) u32 en_tdc; int ret; - setting = kzalloc(sizeof(*setting), GFP_KERNEL); + setting = kzalloc_obj(*setting, GFP_KERNEL); if (!setting) return -ENOMEM; @@ -596,7 +596,7 @@ static void nct6694_canfd_stop(struct net_device *ndev) * mode allows the device to monitor bus activity without actively * participating in communication. */ - setting = kzalloc(sizeof(*setting), GFP_KERNEL); + setting = kzalloc_obj(*setting, GFP_KERNEL); if (!setting) return; @@ -707,7 +707,7 @@ static int nct6694_canfd_get_clock(struct nct6694_canfd_priv *priv) }; int ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index be84191cde56..fbdc9b644241 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c @@ -939,7 +939,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - pdev->usb_if = kzalloc(sizeof(*pdev->usb_if), GFP_KERNEL); + pdev->usb_if = kzalloc_obj(*pdev->usb_if, GFP_KERNEL); if (!pdev->usb_if) goto err_out; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index 7be286293b1a..db5d43bd4220 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c @@ -870,10 +870,9 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - usb_if = kzalloc(sizeof(struct pcan_usb_pro_interface), - GFP_KERNEL); - fi = kmalloc(sizeof(struct pcan_usb_pro_fwinfo), GFP_KERNEL); - bi = kmalloc(sizeof(struct pcan_usb_pro_blinfo), GFP_KERNEL); + usb_if = kzalloc_obj(struct pcan_usb_pro_interface, GFP_KERNEL); + fi = kmalloc_obj(struct pcan_usb_pro_fwinfo, GFP_KERNEL); + bi = kmalloc_obj(struct pcan_usb_pro_blinfo, GFP_KERNEL); if (!usb_if || !fi || !bi) { err = -ENOMEM; goto err_out; diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c index de61d9da99e3..906aca08cf5c 100644 --- a/drivers/net/can/usb/ucan.c +++ b/drivers/net/can/usb/ucan.c @@ -330,9 +330,8 @@ static int ucan_alloc_context_array(struct ucan_priv *up) /* release contexts if any */ ucan_release_context_array(up); - up->context_array = kcalloc(up->device_info.tx_fifo, - sizeof(*up->context_array), - GFP_KERNEL); + up->context_array = kzalloc_objs(*up->context_array, + up->device_info.tx_fifo, GFP_KERNEL); if (!up->context_array) { netdev_err(up->netdev, "Not enough memory to allocate tx contexts\n"); diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index e22362e6f0cd..8df91e4c1237 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c @@ -950,7 +950,7 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port, if (ret == 0) return -EEXIST; - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index dd5f263ab984..1e1917eafd7a 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1265,7 +1265,7 @@ static int hellcreek_devlink_region_vlan_snapshot(struct devlink *dl, struct hellcreek *hellcreek = ds->priv; int i; - table = kcalloc(VLAN_N_VID, sizeof(*entry), GFP_KERNEL); + table = kzalloc_objs(*entry, VLAN_N_VID, GFP_KERNEL); if (!table) return -ENOMEM; @@ -1293,7 +1293,7 @@ static int hellcreek_devlink_region_fdb_snapshot(struct devlink *dl, struct hellcreek *hellcreek = ds->priv; size_t i; - table = kcalloc(hellcreek->fdb_entries, sizeof(*entry), GFP_KERNEL); + table = kzalloc_objs(*entry, hellcreek->fdb_entries, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/net/dsa/microchip/ksz9477_acl.c b/drivers/net/dsa/microchip/ksz9477_acl.c index 7ba778df63ac..efd1da08bb45 100644 --- a/drivers/net/dsa/microchip/ksz9477_acl.c +++ b/drivers/net/dsa/microchip/ksz9477_acl.c @@ -1060,7 +1060,7 @@ int ksz9477_port_acl_init(struct ksz_device *dev, int port) struct ksz9477_acl_priv *acl; int ret, i; - acl = kzalloc(sizeof(*acl), GFP_KERNEL); + acl = kzalloc_obj(*acl, GFP_KERNEL); if (!acl) return -ENOMEM; diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index e5fa1f5fc09b..ddcbb1be4818 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -4835,7 +4835,7 @@ int ksz_switch_macaddr_get(struct dsa_switch *ds, int port, return 0; } - switch_macaddr = kzalloc(sizeof(*switch_macaddr), GFP_KERNEL); + switch_macaddr = kzalloc_obj(*switch_macaddr, GFP_KERNEL); if (!switch_macaddr) return -ENOMEM; diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 09002c853b78..7a43110e74b7 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2024,7 +2024,7 @@ static int mv88e6xxx_mst_get(struct mv88e6xxx_chip *chip, struct net_device *br, if (err) goto err; - mst = kzalloc(sizeof(*mst), GFP_KERNEL); + mst = kzalloc_obj(*mst, GFP_KERNEL); if (!mst) { err = -ENOMEM; goto err; diff --git a/drivers/net/dsa/mv88e6xxx/devlink.c b/drivers/net/dsa/mv88e6xxx/devlink.c index da69e0b85879..f241e7df6eb5 100644 --- a/drivers/net/dsa/mv88e6xxx/devlink.c +++ b/drivers/net/dsa/mv88e6xxx/devlink.c @@ -378,9 +378,8 @@ static int mv88e6xxx_region_atu_snapshot(struct devlink *dl, struct mv88e6xxx_chip *chip = ds->priv; int fid = -1, err = 0, count = 0; - table = kcalloc(mv88e6xxx_num_databases(chip), - sizeof(struct mv88e6xxx_devlink_atu_entry), - GFP_KERNEL); + table = kzalloc_objs(struct mv88e6xxx_devlink_atu_entry, + mv88e6xxx_num_databases(chip), GFP_KERNEL); if (!table) return -ENOMEM; @@ -440,9 +439,8 @@ static int mv88e6xxx_region_vtu_snapshot(struct devlink *dl, struct mv88e6xxx_vtu_entry vlan; int err; - table = kcalloc(mv88e6xxx_max_vid(chip) + 1, - sizeof(struct mv88e6xxx_devlink_vtu_entry), - GFP_KERNEL); + table = kzalloc_objs(struct mv88e6xxx_devlink_vtu_entry, + mv88e6xxx_max_vid(chip) + 1, GFP_KERNEL); if (!table) return -ENOMEM; @@ -523,9 +521,8 @@ static int mv88e6xxx_region_stu_snapshot(struct devlink *dl, struct mv88e6xxx_stu_entry stu; int err; - table = kcalloc(mv88e6xxx_max_sid(chip) + 1, - sizeof(struct mv88e6xxx_devlink_stu_entry), - GFP_KERNEL); + table = kzalloc_objs(struct mv88e6xxx_devlink_stu_entry, + mv88e6xxx_max_sid(chip) + 1, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-6185.c b/drivers/net/dsa/mv88e6xxx/pcs-6185.c index af7e06d265f7..176480cdee5a 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-6185.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-6185.c @@ -131,7 +131,7 @@ static int mv88e6185_pcs_init(struct mv88e6xxx_chip *chip, int port) dev = chip->dev; - mpcs = kzalloc(sizeof(*mpcs), GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); if (!mpcs) return -ENOMEM; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-6352.c b/drivers/net/dsa/mv88e6xxx/pcs-6352.c index 36993400837e..ecd8b5efccf6 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-6352.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-6352.c @@ -267,7 +267,7 @@ static struct marvell_c22_pcs *marvell_c22_pcs_alloc(struct device *dev, { struct marvell_c22_pcs *mpcs; - mpcs = kzalloc(sizeof(*mpcs), GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); if (!mpcs) return NULL; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-639x.c b/drivers/net/dsa/mv88e6xxx/pcs-639x.c index 5db17c0b77f5..c7728b00297d 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-639x.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-639x.c @@ -67,7 +67,7 @@ mv88e639x_pcs_alloc(struct device *dev, struct mii_bus *bus, unsigned int addr, { struct mv88e639x_pcs *mpcs; - mpcs = kzalloc(sizeof(*mpcs), GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); if (!mpcs) return NULL; diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 5d34eb82e639..1587dd33a557 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -109,8 +109,7 @@ static int felix_tag_8021q_vlan_add_rx(struct dsa_switch *ds, int port, key_length = ocelot->vcap[VCAP_ES0].keys[VCAP_ES0_IGR_PORT].length; - outer_tagging_rule = kzalloc(sizeof(struct ocelot_vcap_filter), - GFP_KERNEL); + outer_tagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!outer_tagging_rule) return -ENOMEM; @@ -178,11 +177,11 @@ static int felix_tag_8021q_vlan_add_tx(struct dsa_switch *ds, int port, unsigned long cookie; int err; - untagging_rule = kzalloc(sizeof(struct ocelot_vcap_filter), GFP_KERNEL); + untagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!untagging_rule) return -ENOMEM; - redirect_rule = kzalloc(sizeof(struct ocelot_vcap_filter), GFP_KERNEL); + redirect_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!redirect_rule) { kfree(untagging_rule); return -ENOMEM; @@ -1540,8 +1539,8 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) ocelot->npi_xtr_prefix = OCELOT_TAG_PREFIX_SHORT; ocelot->devlink = felix->ds->devlink; - port_phy_modes = kcalloc(num_phys_ports, sizeof(phy_interface_t), - GFP_KERNEL); + port_phy_modes = kzalloc_objs(phy_interface_t, num_phys_ports, + GFP_KERNEL); if (!port_phy_modes) return -ENOMEM; diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 8cf4c8986587..86b9a24d3e33 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -2201,7 +2201,7 @@ static int vsc9959_psfp_sgi_table_add(struct ocelot *ocelot, return 0; } - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/net/dsa/sja1105/sja1105_devlink.c b/drivers/net/dsa/sja1105/sja1105_devlink.c index 30b1f1ba762f..c1dd9ccc32d0 100644 --- a/drivers/net/dsa/sja1105/sja1105_devlink.c +++ b/drivers/net/dsa/sja1105/sja1105_devlink.c @@ -82,8 +82,8 @@ static int sja1105_setup_devlink_regions(struct dsa_switch *ds) struct devlink_region *region; u64 size; - priv->regions = kcalloc(num_regions, sizeof(struct devlink_region *), - GFP_KERNEL); + priv->regions = kzalloc_objs(struct devlink_region *, num_regions, + GFP_KERNEL); if (!priv->regions) return -ENOMEM; diff --git a/drivers/net/dsa/sja1105/sja1105_flower.c b/drivers/net/dsa/sja1105/sja1105_flower.c index 05d8ed3121e7..c91f7371471c 100644 --- a/drivers/net/dsa/sja1105/sja1105_flower.c +++ b/drivers/net/dsa/sja1105/sja1105_flower.c @@ -41,7 +41,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv, int rc; if (!rule) { - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -112,7 +112,7 @@ static int sja1105_setup_tc_policer(struct sja1105_private *priv, int rc; if (!rule) { - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/dsa/sja1105/sja1105_tas.c b/drivers/net/dsa/sja1105/sja1105_tas.c index d5949d2c3e71..a3090c70b428 100644 --- a/drivers/net/dsa/sja1105/sja1105_tas.c +++ b/drivers/net/dsa/sja1105/sja1105_tas.c @@ -477,7 +477,7 @@ bool sja1105_gating_check_conflicts(struct sja1105_private *priv, int port, if (list_empty(&gating_cfg->entries)) return false; - dummy = kzalloc(struct_size(dummy, entries, num_entries), GFP_KERNEL); + dummy = kzalloc_flex(*dummy, entries, num_entries, GFP_KERNEL); if (!dummy) { NL_SET_ERR_MSG_MOD(extack, "Failed to allocate memory"); return true; diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c index b7e95d60a6e4..7ec1ce5edf07 100644 --- a/drivers/net/dsa/sja1105/sja1105_vl.c +++ b/drivers/net/dsa/sja1105/sja1105_vl.c @@ -16,7 +16,7 @@ static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg, struct sja1105_gate_entry *e; int rc; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; @@ -524,7 +524,7 @@ int sja1105_vl_redirect(struct sja1105_private *priv, int port, } if (!rule) { - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -622,7 +622,7 @@ int sja1105_vl_gate(struct sja1105_private *priv, int port, } if (!rule) { - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -635,9 +635,8 @@ int sja1105_vl_gate(struct sja1105_private *priv, int port, rule->vl.base_time = base_time; rule->vl.cycle_time = cycle_time; rule->vl.num_entries = num_entries; - rule->vl.entries = kcalloc(num_entries, - sizeof(struct action_gate_entry), - GFP_KERNEL); + rule->vl.entries = kzalloc_objs(struct action_gate_entry, + num_entries, GFP_KERNEL); if (!rule->vl.entries) { rc = -ENOMEM; goto out; diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index 9d31b8258268..a2feb30843b6 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -1664,7 +1664,7 @@ static int vsc73xx_port_vlan_add(struct dsa_switch *ds, int port, vsc73xx_vlan = vsc73xx_bridge_vlan_find(vsc, vlan->vid); if (!vsc73xx_vlan) { - vsc73xx_vlan = kzalloc(sizeof(*vsc73xx_vlan), GFP_KERNEL); + vsc73xx_vlan = kzalloc_obj(*vsc73xx_vlan, GFP_KERNEL); if (!vsc73xx_vlan) return -ENOMEM; diff --git a/drivers/net/eql.c b/drivers/net/eql.c index 9ba10efd3794..3fccbe2a63a0 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c @@ -425,7 +425,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user * if ((master_dev->flags & IFF_UP) == IFF_UP) { /* slave is not a master & not already a slave: */ if (!eql_is_master(slave_dev) && !eql_is_slave(slave_dev)) { - slave_t *s = kzalloc(sizeof(*s), GFP_KERNEL); + slave_t *s = kzalloc_obj(*s, GFP_KERNEL); equalizer_t *eql = netdev_priv(master_dev); int ret; diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c index 1b4e37d000b9..53fac3dc8be6 100644 --- a/drivers/net/ethernet/adi/adin1110.c +++ b/drivers/net/ethernet/adi/adin1110.c @@ -1492,7 +1492,7 @@ static int adin1110_switchdev_event(struct notifier_block *unused, if (!adin1110_port_dev_check(netdev)) return NOTIFY_DONE; - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index 5c8217638dda..30cc8acd2b8c 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c @@ -1866,10 +1866,10 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) struct fbr_lookup *fbr; /* Alloc memory for the lookup table */ - rx_ring->fbr[0] = kzalloc(sizeof(*fbr), GFP_KERNEL); + rx_ring->fbr[0] = kzalloc_obj(*fbr, GFP_KERNEL); if (rx_ring->fbr[0] == NULL) return -ENOMEM; - rx_ring->fbr[1] = kzalloc(sizeof(*fbr), GFP_KERNEL); + rx_ring->fbr[1] = kzalloc_obj(*fbr, GFP_KERNEL); if (rx_ring->fbr[1] == NULL) return -ENOMEM; @@ -2089,7 +2089,7 @@ static int et131x_init_recv(struct et131x_adapter *adapter) /* Setup each RFD */ for (rfdct = 0; rfdct < rx_ring->num_rfd; rfdct++) { - rfd = kzalloc(sizeof(*rfd), GFP_ATOMIC | GFP_DMA); + rfd = kzalloc_obj(*rfd, GFP_ATOMIC | GFP_DMA); if (!rfd) return -ENOMEM; @@ -2357,8 +2357,8 @@ static int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter) struct tx_ring *tx_ring = &adapter->tx_ring; /* Allocate memory for the TCB's (Transmit Control Block) */ - tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb), - GFP_KERNEL | GFP_DMA); + tx_ring->tcb_ring = kzalloc_objs(struct tcb, NUM_TCB, + GFP_KERNEL | GFP_DMA); if (!tx_ring->tcb_ring) return -ENOMEM; diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c index 89f22f3f47dc..84090dee9814 100644 --- a/drivers/net/ethernet/airoha/airoha_npu.c +++ b/drivers/net/ethernet/airoha/airoha_npu.c @@ -333,7 +333,7 @@ static int airoha_npu_ppe_init(struct airoha_npu *npu) struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc(sizeof(*ppe_data), GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); if (!ppe_data) return -ENOMEM; @@ -354,7 +354,7 @@ static int airoha_npu_ppe_deinit(struct airoha_npu *npu) struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc(sizeof(*ppe_data), GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); if (!ppe_data) return -ENOMEM; @@ -375,7 +375,7 @@ static int airoha_npu_ppe_flush_sram_entries(struct airoha_npu *npu, struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc(sizeof(*ppe_data), GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); if (!ppe_data) return -ENOMEM; @@ -399,7 +399,7 @@ static int airoha_npu_foe_commit_entry(struct airoha_npu *npu, struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc(sizeof(*ppe_data), GFP_ATOMIC); + ppe_data = kzalloc_obj(*ppe_data, GFP_ATOMIC); if (!ppe_data) return -ENOMEM; @@ -434,7 +434,7 @@ static int airoha_npu_ppe_stats_setup(struct airoha_npu *npu, int err, size = num_stats_entries * sizeof(*npu->stats); struct ppe_mbox_data *ppe_data; - ppe_data = kzalloc(sizeof(*ppe_data), GFP_ATOMIC); + ppe_data = kzalloc_obj(*ppe_data, GFP_ATOMIC); if (!ppe_data) return -ENOMEM; diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c index 2221bafaf7c9..a0f4c6e33bfc 100644 --- a/drivers/net/ethernet/airoha/airoha_ppe.c +++ b/drivers/net/ethernet/airoha/airoha_ppe.c @@ -778,7 +778,7 @@ airoha_ppe_foe_commit_subflow_entry(struct airoha_ppe *ppe, if (!hwe_p) return -EINVAL; - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return -ENOMEM; @@ -1173,7 +1173,7 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth, return err; } - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; diff --git a/drivers/net/ethernet/alacritech/slicoss.c b/drivers/net/ethernet/alacritech/slicoss.c index 7488fb6ace0b..808ee88dcdc8 100644 --- a/drivers/net/ethernet/alacritech/slicoss.c +++ b/drivers/net/ethernet/alacritech/slicoss.c @@ -192,7 +192,7 @@ static int slic_new_upr(struct slic_device *sdev, unsigned int type, { struct slic_upr *upr; - upr = kmalloc(sizeof(*upr), GFP_ATOMIC); + upr = kmalloc_obj(*upr, GFP_ATOMIC); if (!upr) return -ENOMEM; upr->type = type; @@ -845,7 +845,7 @@ static int slic_init_tx_queue(struct slic_device *sdev) txq->put_idx = 0; txq->done_idx = 0; - txq->txbuffs = kcalloc(txq->len, sizeof(*buff), GFP_KERNEL); + txq->txbuffs = kzalloc_objs(*buff, txq->len, GFP_KERNEL); if (!txq->txbuffs) return -ENOMEM; @@ -922,7 +922,7 @@ static int slic_init_rx_queue(struct slic_device *sdev) rxq->done_idx = 0; rxq->put_idx = 0; - buff = kcalloc(rxq->len, sizeof(*buff), GFP_KERNEL); + buff = kzalloc_objs(*buff, rxq->len, GFP_KERNEL); if (!buff) return -ENOMEM; diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 2f516b950f4e..fc7341a5cbb7 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -223,7 +223,7 @@ emac_alloc_dma_req(struct emac_board_info *db, { struct emac_dma_req *req; - req = kzalloc(sizeof(struct emac_dma_req), GFP_ATOMIC); + req = kzalloc_obj(struct emac_dma_req, GFP_ATOMIC); if (!req) return NULL; diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index 9e6f91df2ba0..81f57bc6b3a2 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c @@ -1149,7 +1149,7 @@ static int ace_init(struct net_device *dev) /* * Get the memory for the skb rings. */ - if (!(ap->skb = kzalloc(sizeof(struct ace_skb), GFP_KERNEL))) { + if (!(ap->skb = kzalloc_obj(struct ace_skb, GFP_KERNEL))) { ecode = -EAGAIN; goto init_error; } diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index ca55c5fd11df..2893fbaa51ca 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -258,14 +258,12 @@ static int alloc_init_skbufs(struct altera_tse_private *priv) int i; /* Create Rx ring buffer */ - priv->rx_ring = kcalloc(rx_descs, sizeof(struct tse_buffer), - GFP_KERNEL); + priv->rx_ring = kzalloc_objs(struct tse_buffer, rx_descs, GFP_KERNEL); if (!priv->rx_ring) goto err_rx_ring; /* Create Tx ring buffer */ - priv->tx_ring = kcalloc(tx_descs, sizeof(struct tse_buffer), - GFP_KERNEL); + priv->tx_ring = kzalloc_objs(struct tse_buffer, tx_descs, GFP_KERNEL); if (!priv->tx_ring) goto err_tx_ring; diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c index b1e6620ad41d..98afd8cb0efb 100644 --- a/drivers/net/ethernet/amd/lance.c +++ b/drivers/net/ethernet/amd/lance.c @@ -551,7 +551,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int dev->base_addr = ioaddr; /* Make certain the data structures used by the LANCE are aligned and DMAble. */ - lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL); + lp = kzalloc_obj(*lp, GFP_DMA | GFP_KERNEL); if (!lp) return -ENOMEM; if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp); diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c index 9eaefa0f5e80..e0705a54366b 100644 --- a/drivers/net/ethernet/amd/pcnet32.c +++ b/drivers/net/ethernet/amd/pcnet32.c @@ -491,11 +491,11 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, if (!new_tx_ring) return; - new_dma_addr_list = kcalloc(entries, sizeof(dma_addr_t), GFP_ATOMIC); + new_dma_addr_list = kzalloc_objs(dma_addr_t, entries, GFP_ATOMIC); if (!new_dma_addr_list) goto free_new_tx_ring; - new_skb_list = kcalloc(entries, sizeof(struct sk_buff *), GFP_ATOMIC); + new_skb_list = kzalloc_objs(struct sk_buff *, entries, GFP_ATOMIC); if (!new_skb_list) goto free_new_lists; @@ -550,11 +550,11 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, if (!new_rx_ring) return; - new_dma_addr_list = kcalloc(entries, sizeof(dma_addr_t), GFP_ATOMIC); + new_dma_addr_list = kzalloc_objs(dma_addr_t, entries, GFP_ATOMIC); if (!new_dma_addr_list) goto free_new_rx_ring; - new_skb_list = kcalloc(entries, sizeof(struct sk_buff *), GFP_ATOMIC); + new_skb_list = kzalloc_objs(struct sk_buff *, entries, GFP_ATOMIC); if (!new_skb_list) goto free_new_lists; @@ -2035,23 +2035,21 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) return -ENOMEM; } - lp->tx_dma_addr = kcalloc(lp->tx_ring_size, sizeof(dma_addr_t), - GFP_KERNEL); + lp->tx_dma_addr = kzalloc_objs(dma_addr_t, lp->tx_ring_size, GFP_KERNEL); if (!lp->tx_dma_addr) return -ENOMEM; - lp->rx_dma_addr = kcalloc(lp->rx_ring_size, sizeof(dma_addr_t), - GFP_KERNEL); + lp->rx_dma_addr = kzalloc_objs(dma_addr_t, lp->rx_ring_size, GFP_KERNEL); if (!lp->rx_dma_addr) return -ENOMEM; - lp->tx_skbuff = kcalloc(lp->tx_ring_size, sizeof(struct sk_buff *), - GFP_KERNEL); + lp->tx_skbuff = kzalloc_objs(struct sk_buff *, lp->tx_ring_size, + GFP_KERNEL); if (!lp->tx_skbuff) return -ENOMEM; - lp->rx_skbuff = kcalloc(lp->rx_ring_size, sizeof(struct sk_buff *), - GFP_KERNEL); + lp->rx_skbuff = kzalloc_objs(struct sk_buff *, lp->rx_ring_size, + GFP_KERNEL); if (!lp->rx_skbuff) return -ENOMEM; diff --git a/drivers/net/ethernet/amd/pds_core/auxbus.c b/drivers/net/ethernet/amd/pds_core/auxbus.c index 92f359f2b449..6f0ffdf14e96 100644 --- a/drivers/net/ethernet/amd/pds_core/auxbus.c +++ b/drivers/net/ethernet/amd/pds_core/auxbus.c @@ -140,7 +140,7 @@ static struct pds_auxiliary_dev *pdsc_auxbus_dev_register(struct pdsc *cf, struct pds_auxiliary_dev *padev; int err; - padev = kzalloc(sizeof(*padev), GFP_KERNEL); + padev = kzalloc_obj(*padev, GFP_KERNEL); if (!padev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/amd/pds_core/core.c b/drivers/net/ethernet/amd/pds_core/core.c index 076dfe2910c7..af2f2c7f5de5 100644 --- a/drivers/net/ethernet/amd/pds_core/core.c +++ b/drivers/net/ethernet/amd/pds_core/core.c @@ -415,9 +415,9 @@ static int pdsc_viftypes_init(struct pdsc *pdsc) { enum pds_core_vif_types vt; - pdsc->viftype_status = kcalloc(ARRAY_SIZE(pdsc_viftype_defaults), - sizeof(*pdsc->viftype_status), - GFP_KERNEL); + pdsc->viftype_status = kzalloc_objs(*pdsc->viftype_status, + ARRAY_SIZE(pdsc_viftype_defaults), + GFP_KERNEL); if (!pdsc->viftype_status) return -ENOMEM; diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c index 495ef4ef8c10..6ae27bfb3375 100644 --- a/drivers/net/ethernet/amd/pds_core/dev.c +++ b/drivers/net/ethernet/amd/pds_core/dev.c @@ -359,7 +359,7 @@ int pdsc_dev_init(struct pdsc *pdsc) nintrs = min_t(unsigned int, num_online_cpus(), nintrs); /* Get intr_info struct array for tracking */ - pdsc->intr_info = kcalloc(nintrs, sizeof(*pdsc->intr_info), GFP_KERNEL); + pdsc->intr_info = kzalloc_objs(*pdsc->intr_info, nintrs, GFP_KERNEL); if (!pdsc->intr_info) return -ENOMEM; diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c index c7a2eff57632..743b154d2a88 100644 --- a/drivers/net/ethernet/amd/pds_core/main.c +++ b/drivers/net/ethernet/amd/pds_core/main.c @@ -146,8 +146,7 @@ static int pdsc_sriov_configure(struct pci_dev *pdev, int num_vfs) int ret = 0; if (num_vfs > 0) { - pdsc->vfs = kcalloc(num_vfs, sizeof(struct pdsc_vf), - GFP_KERNEL); + pdsc->vfs = kzalloc_objs(struct pdsc_vf, num_vfs, GFP_KERNEL); if (!pdsc->vfs) return -ENOMEM; pdsc->num_vfs = num_vfs; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c b/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c index 55e5e467facd..488f96bec1e7 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c @@ -112,7 +112,7 @@ static int __xgbe_test_loopback(struct xgbe_prv_data *pdata, struct sk_buff *skb = NULL; int ret = 0; - tdata = kzalloc(sizeof(*tdata), GFP_KERNEL); + tdata = kzalloc_obj(*tdata, GFP_KERNEL); if (!tdata) return -ENOMEM; diff --git a/drivers/net/ethernet/apm/xgene-v2/main.c b/drivers/net/ethernet/apm/xgene-v2/main.c index d7ca847d44c7..b88764615994 100644 --- a/drivers/net/ethernet/apm/xgene-v2/main.c +++ b/drivers/net/ethernet/apm/xgene-v2/main.c @@ -405,7 +405,7 @@ static struct xge_desc_ring *xge_create_desc_ring(struct net_device *ndev) struct xge_desc_ring *ring; u16 size; - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) return NULL; @@ -417,8 +417,8 @@ static struct xge_desc_ring *xge_create_desc_ring(struct net_device *ndev) if (!ring->desc_addr) goto err; - ring->pkt_info = kcalloc(XGENE_ENET_NUM_DESC, sizeof(*ring->pkt_info), - GFP_KERNEL); + ring->pkt_info = kzalloc_objs(*ring->pkt_info, XGENE_ENET_NUM_DESC, + GFP_KERNEL); if (!ring->pkt_info) goto err; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c index 30a573db02bb..4f0b66917ce0 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c @@ -688,7 +688,7 @@ int aq_add_rxnfc_rule(struct aq_nic_s *aq_nic, const struct ethtool_rxnfc *cmd) if (err) goto err_exit; - aq_rx_fltr = kzalloc(sizeof(*aq_rx_fltr), GFP_KERNEL); + aq_rx_fltr = kzalloc_obj(*aq_rx_fltr, GFP_KERNEL); if (unlikely(!aq_rx_fltr)) { err = -ENOMEM; goto err_exit; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c b/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c index 6afff8af5e86..a47d5ec74b94 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c @@ -1462,7 +1462,7 @@ int aq_macsec_init(struct aq_nic_s *nic) if (!(caps_lo & BIT(CAPS_LO_MACSEC))) return 0; - nic->macsec_cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + nic->macsec_cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!nic->macsec_cfg) return -ENOMEM; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index ed5231dece3f..05d656fb4a27 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -244,7 +244,7 @@ static int aq_pci_probe(struct pci_dev *pdev, if (err) goto err_ioremap; - self->aq_hw = kzalloc(sizeof(*self->aq_hw), GFP_KERNEL); + self->aq_hw = kzalloc_obj(*self->aq_hw, GFP_KERNEL); if (!self->aq_hw) { err = -ENOMEM; goto err_ioremap; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c index 0fa0f891c0e0..83216657d1d8 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -1130,8 +1130,8 @@ static void aq_ptp_gpio_init(struct ptp_clock_info *info, if (!info->n_pins) return; - info->pin_config = kcalloc(info->n_pins, sizeof(struct ptp_pin_desc), - GFP_KERNEL); + info->pin_config = kzalloc_objs(struct ptp_pin_desc, info->n_pins, + GFP_KERNEL); if (!info->pin_config) return; @@ -1183,7 +1183,7 @@ int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_vec) aq_ptp_offset_init(&mbox.info.ptp_offset); - aq_ptp = kzalloc(sizeof(*aq_ptp), GFP_KERNEL); + aq_ptp = kzalloc_obj(*aq_ptp, GFP_KERNEL); if (!aq_ptp) { err = -ENOMEM; goto err_exit; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index d23d23bed39f..62478c605503 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -138,7 +138,7 @@ static int aq_ring_alloc(struct aq_ring_s *self, int err = 0; self->buff_ring = - kcalloc(self->size, sizeof(struct aq_ring_buff_s), GFP_KERNEL); + kzalloc_objs(struct aq_ring_buff_s, self->size, GFP_KERNEL); if (!self->buff_ring) { err = -ENOMEM; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c index 9769ab4f9bef..90eaf11076d2 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c @@ -104,7 +104,7 @@ struct aq_vec_s *aq_vec_alloc(struct aq_nic_s *aq_nic, unsigned int idx, { struct aq_vec_s *self = NULL; - self = kzalloc(sizeof(*self), GFP_KERNEL); + self = kzalloc_obj(*self, GFP_KERNEL); if (!self) goto err_exit; diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index cbc730c7cff2..13e3bd7fe82b 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -1305,7 +1305,7 @@ static int ag71xx_rings_init(struct ag71xx *ag) ring_size = BIT(tx->order) + BIT(rx->order); tx_size = BIT(tx->order); - tx->buf = kcalloc(ring_size, sizeof(*tx->buf), GFP_KERNEL); + tx->buf = kzalloc_objs(*tx->buf, ring_size, GFP_KERNEL); if (!tx->buf) return -ENOMEM; diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index ad6d6abd885f..9b1923055293 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -616,7 +616,7 @@ static int alx_set_mac_address(struct net_device *netdev, void *data) static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq, int offset) { - txq->bufs = kcalloc(txq->count, sizeof(struct alx_buffer), GFP_KERNEL); + txq->bufs = kzalloc_objs(struct alx_buffer, txq->count, GFP_KERNEL); if (!txq->bufs) return -ENOMEM; @@ -630,7 +630,7 @@ static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq, static int alx_alloc_rx_ring(struct alx_priv *alx, struct alx_rx_queue *rxq, int offset) { - rxq->bufs = kcalloc(rxq->count, sizeof(struct alx_buffer), GFP_KERNEL); + rxq->bufs = kzalloc_objs(struct alx_buffer, rxq->count, GFP_KERNEL); if (!rxq->bufs) return -ENOMEM; @@ -746,7 +746,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate alx_napi structures */ for (i = 0; i < alx->num_napi; i++) { - np = kzalloc(sizeof(struct alx_napi), GFP_KERNEL); + np = kzalloc_obj(struct alx_napi, GFP_KERNEL); if (!np) goto err_out; @@ -758,7 +758,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate tx queues */ for (i = 0; i < alx->num_txq; i++) { np = alx->qnapi[i]; - txq = kzalloc(sizeof(*txq), GFP_KERNEL); + txq = kzalloc_obj(*txq, GFP_KERNEL); if (!txq) goto err_out; @@ -775,7 +775,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate rx queues */ np = alx->qnapi[0]; - rxq = kzalloc(sizeof(*rxq), GFP_KERNEL); + rxq = kzalloc_obj(*rxq, GFP_KERNEL); if (!rxq) goto err_out; diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index d0a480430a95..612abed61fff 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -689,8 +689,8 @@ static int bcmasp_alloc_buffers(struct bcmasp_intf *intf) if (!intf->tx_spb_cpu) goto free_rx_edpkt_dma; - intf->tx_cbs = kcalloc(DESC_RING_COUNT, sizeof(struct bcmasp_tx_cb), - GFP_KERNEL); + intf->tx_cbs = kzalloc_objs(struct bcmasp_tx_cb, DESC_RING_COUNT, + GFP_KERNEL); if (!intf->tx_cbs) goto free_tx_spb_dma; diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c index 203e8d0dd04b..fa1fd5667596 100644 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c @@ -181,7 +181,7 @@ static int bcm4908_dma_alloc_buf_descs(struct bcm4908_enet *enet, goto err_free_buf_descs; } - ring->slots = kcalloc(ring->length, sizeof(*ring->slots), GFP_KERNEL); + ring->slots = kzalloc_objs(*ring->slots, ring->length, GFP_KERNEL); if (!ring->slots) goto err_free_buf_descs; diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 92204fea1f08..00408af127e1 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -981,8 +981,8 @@ static int bcm_enet_open(struct net_device *dev) priv->tx_desc_alloc_size = size; priv->tx_desc_cpu = p; - priv->tx_skb = kcalloc(priv->tx_ring_size, sizeof(struct sk_buff *), - GFP_KERNEL); + priv->tx_skb = kzalloc_objs(struct sk_buff *, priv->tx_ring_size, + GFP_KERNEL); if (!priv->tx_skb) { ret = -ENOMEM; goto out_free_tx_ring; @@ -2149,8 +2149,8 @@ static int bcm_enetsw_open(struct net_device *dev) priv->tx_desc_alloc_size = size; priv->tx_desc_cpu = p; - priv->tx_skb = kcalloc(priv->tx_ring_size, sizeof(struct sk_buff *), - GFP_KERNEL); + priv->tx_skb = kzalloc_objs(struct sk_buff *, priv->tx_ring_size, + GFP_KERNEL); if (!priv->tx_skb) { dev_err(kdev, "cannot allocate tx skb queue\n"); ret = -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index bc4e1f3b3752..f81392cbedd1 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -1486,7 +1486,7 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv, /* Simple descriptors partitioning for now */ size = 256; - ring->cbs = kcalloc(size, sizeof(struct bcm_sysport_cb), GFP_KERNEL); + ring->cbs = kzalloc_objs(struct bcm_sysport_cb, size, GFP_KERNEL); if (!ring->cbs) { netif_err(priv, hw, priv->netdev, "CB allocation failed\n"); return -ENOMEM; @@ -1665,8 +1665,8 @@ static int bcm_sysport_init_rx_ring(struct bcm_sysport_priv *priv) priv->rx_bds = priv->base + SYS_PORT_RDMA_OFFSET; priv->rx_c_index = 0; priv->rx_read_ptr = 0; - priv->rx_cbs = kcalloc(priv->num_rx_bds, sizeof(struct bcm_sysport_cb), - GFP_KERNEL); + priv->rx_cbs = kzalloc_objs(struct bcm_sysport_cb, priv->num_rx_bds, + GFP_KERNEL); if (!priv->rx_cbs) { netif_err(priv, hw, priv->netdev, "CB allocation failed\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c index 5f4cb4991964..d530046e027d 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c @@ -210,7 +210,7 @@ void bnge_rdma_aux_device_init(struct bnge_dev *bd) if (!bnge_is_roce_en(bd)) return; - aux_priv = kzalloc(sizeof(*aux_priv), GFP_KERNEL); + aux_priv = kzalloc_obj(*aux_priv, GFP_KERNEL); if (!aux_priv) goto exit; @@ -235,13 +235,13 @@ void bnge_rdma_aux_device_init(struct bnge_dev *bd) } bd->aux_priv = aux_priv; - auxr_dev = kzalloc(sizeof(*auxr_dev), GFP_KERNEL); + auxr_dev = kzalloc_obj(*auxr_dev, GFP_KERNEL); if (!auxr_dev) goto aux_dev_uninit; aux_priv->auxr_dev = auxr_dev; - auxr_info = kzalloc(sizeof(*auxr_info), GFP_KERNEL); + auxr_info = kzalloc_obj(*auxr_info, GFP_KERNEL); if (!auxr_info) goto aux_dev_uninit; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c index c3087e5cd875..cf6e503d63a6 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c @@ -229,7 +229,7 @@ bnge_hwrm_create_token(struct bnge_dev *bd, enum bnge_hwrm_chnl dst) { struct bnge_hwrm_wait_token *token; - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kzalloc_obj(*token, GFP_KERNEL); if (!token) return NULL; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c index 91a4ef9e3150..579943445b24 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c @@ -242,7 +242,7 @@ static int bnge_alloc_all_ctx_pg_info(struct bnge_dev *bd, int ctx_max) if (ctxm->instance_bmap) n = hweight32(ctxm->instance_bmap); - ctxm->pg_info = kcalloc(n, sizeof(*ctxm->pg_info), GFP_KERNEL); + ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n, GFP_KERNEL); if (!ctxm->pg_info) return -ENOMEM; } @@ -269,7 +269,7 @@ int bnge_hwrm_func_backing_store_qcaps(struct bnge_dev *bd) if (rc) return rc; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; bd->ctx = ctx; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c index b8e258842c61..74b552ee1796 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c @@ -127,11 +127,11 @@ static void bnge_free_cp_desc_arr(struct bnge_cp_ring_info *cpr) static int bnge_alloc_nq_desc_arr(struct bnge_nq_ring_info *nqr, int n) { - nqr->desc_ring = kcalloc(n, sizeof(*nqr->desc_ring), GFP_KERNEL); + nqr->desc_ring = kzalloc_objs(*nqr->desc_ring, n, GFP_KERNEL); if (!nqr->desc_ring) return -ENOMEM; - nqr->desc_mapping = kcalloc(n, sizeof(*nqr->desc_mapping), GFP_KERNEL); + nqr->desc_mapping = kzalloc_objs(*nqr->desc_mapping, n, GFP_KERNEL); if (!nqr->desc_mapping) goto err_free_desc_ring; return 0; @@ -144,11 +144,11 @@ err_free_desc_ring: static int bnge_alloc_cp_desc_arr(struct bnge_cp_ring_info *cpr, int n) { - cpr->desc_ring = kcalloc(n, sizeof(*cpr->desc_ring), GFP_KERNEL); + cpr->desc_ring = kzalloc_objs(*cpr->desc_ring, n, GFP_KERNEL); if (!cpr->desc_ring) return -ENOMEM; - cpr->desc_mapping = kcalloc(n, sizeof(*cpr->desc_mapping), GFP_KERNEL); + cpr->desc_mapping = kzalloc_objs(*cpr->desc_mapping, n, GFP_KERNEL); if (!cpr->desc_mapping) goto err_free_desc_ring; return 0; @@ -287,8 +287,7 @@ static int bnge_alloc_nq_tree(struct bnge_net *bn) tx = 1; } - nqr->cp_ring_arr = kcalloc(cp_count, sizeof(*cpr), - GFP_KERNEL); + nqr->cp_ring_arr = kzalloc_objs(*cpr, cp_count, GFP_KERNEL); if (!nqr->cp_ring_arr) { rc = -ENOMEM; goto err_free_nq_tree; @@ -510,21 +509,21 @@ static int bnge_alloc_tpa_info(struct bnge_net *bn) for (i = 0; i < bd->rx_nr_rings; i++) { struct bnge_rx_ring_info *rxr = &bn->rx_ring[i]; - rxr->rx_tpa = kcalloc(bn->max_tpa, sizeof(struct bnge_tpa_info), - GFP_KERNEL); + rxr->rx_tpa = kzalloc_objs(struct bnge_tpa_info, bn->max_tpa, + GFP_KERNEL); if (!rxr->rx_tpa) goto err_free_tpa_info; for (j = 0; j < bn->max_tpa; j++) { struct rx_agg_cmp *agg; - agg = kcalloc(MAX_SKB_FRAGS, sizeof(*agg), GFP_KERNEL); + agg = kzalloc_objs(*agg, MAX_SKB_FRAGS, GFP_KERNEL); if (!agg) goto err_free_tpa_info; rxr->rx_tpa[j].agg_arr = agg; } - rxr->rx_tpa_idx_map = kzalloc(sizeof(*rxr->rx_tpa_idx_map), - GFP_KERNEL); + rxr->rx_tpa_idx_map = kzalloc_obj(*rxr->rx_tpa_idx_map, + GFP_KERNEL); if (!rxr->rx_tpa_idx_map) goto err_free_tpa_info; } @@ -813,8 +812,8 @@ static int bnge_alloc_vnics(struct bnge_net *bn) */ num_vnics = 1; - bn->vnic_info = kcalloc(num_vnics, sizeof(struct bnge_vnic_info), - GFP_KERNEL); + bn->vnic_info = kzalloc_objs(struct bnge_vnic_info, num_vnics, + GFP_KERNEL); if (!bn->vnic_info) return -ENOMEM; @@ -841,9 +840,8 @@ static int bnge_init_ring_grps(struct bnge_net *bn) struct bnge_dev *bd = bn->bd; int i; - bn->grp_info = kcalloc(bd->nq_nr_rings, - sizeof(struct bnge_ring_grp_info), - GFP_KERNEL); + bn->grp_info = kzalloc_objs(struct bnge_ring_grp_info, bd->nq_nr_rings, + GFP_KERNEL); if (!bn->grp_info) return -ENOMEM; for (i = 0; i < bd->nq_nr_rings; i++) { @@ -903,9 +901,8 @@ static int bnge_alloc_core(struct bnge_net *bn) nqr->ring_struct.ring_mem.flags = BNGE_RMEM_RING_PTE_FLAG; } - bn->rx_ring = kcalloc(bd->rx_nr_rings, - sizeof(struct bnge_rx_ring_info), - GFP_KERNEL); + bn->rx_ring = kzalloc_objs(struct bnge_rx_ring_info, bd->rx_nr_rings, + GFP_KERNEL); if (!bn->rx_ring) goto err_free_core; @@ -920,9 +917,8 @@ static int bnge_alloc_core(struct bnge_net *bn) bn->bnapi[i]->rx_ring = &bn->rx_ring[i]; } - bn->tx_ring = kcalloc(bd->tx_nr_rings, - sizeof(struct bnge_tx_ring_info), - GFP_KERNEL); + bn->tx_ring = kzalloc_objs(struct bnge_tx_ring_info, bd->tx_nr_rings, + GFP_KERNEL); if (!bn->tx_ring) goto err_free_core; @@ -1778,7 +1774,7 @@ static struct bnge_l2_filter *bnge_alloc_l2_filter(struct bnge_net *bn, if (fltr) return fltr; - fltr = kzalloc(sizeof(*fltr), gfp); + fltr = kzalloc_obj(*fltr, gfp); if (!fltr) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c index 943df5f60f01..155b48cd2af8 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c @@ -389,7 +389,7 @@ int bnge_alloc_irqs(struct bnge_dev *bd) num_entries = irqs_demand; if (pci_msix_can_alloc_dyn(bd->pdev)) num_entries = max; - bd->irq_tbl = kcalloc(num_entries, sizeof(*bd->irq_tbl), GFP_KERNEL); + bd->irq_tbl = kzalloc_objs(*bd->irq_tbl, num_entries, GFP_KERNEL); if (!bd->irq_tbl) { rc = -ENOMEM; goto err_free_irqs; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c b/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c index ee97be440c33..fb89737b481d 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c @@ -158,8 +158,8 @@ static int bnge_alloc_ctx_pg_tbls(struct bnge_dev *bd, int nr_tbls, i; rmem->depth = 2; - ctx_pg->ctx_pg_tbl = kcalloc(MAX_CTX_PAGES, sizeof(ctx_pg), - GFP_KERNEL); + ctx_pg->ctx_pg_tbl = kzalloc_objs(ctx_pg, MAX_CTX_PAGES, + GFP_KERNEL); if (!ctx_pg->ctx_pg_tbl) return -ENOMEM; nr_tbls = DIV_ROUND_UP(ctx_pg->nr_pages, MAX_CTX_PAGES); @@ -170,7 +170,7 @@ static int bnge_alloc_ctx_pg_tbls(struct bnge_dev *bd, for (i = 0; i < nr_tbls; i++) { struct bnge_ctx_pg_info *pg_tbl; - pg_tbl = kzalloc(sizeof(*pg_tbl), GFP_KERNEL); + pg_tbl = kzalloc_obj(*pg_tbl, GFP_KERNEL); if (!pg_tbl) return -ENOMEM; ctx_pg->ctx_pg_tbl[i] = pg_tbl; diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 805daae9dd36..97aafe021477 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -8084,7 +8084,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) bp->phy_flags = 0; bp->temp_stats_blk = - kzalloc(sizeof(struct statistics_block), GFP_KERNEL); + kzalloc_obj(struct statistics_block, GFP_KERNEL); if (!bp->temp_stats_blk) { rc = -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e59530357e2c..ea0fc6add87d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -4582,9 +4582,9 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) "allocating tx memory of fp %d cos %d\n", index, cos); - txdata->tx_buf_ring = kcalloc(NUM_TX_BD, - sizeof(struct sw_tx_bd), - GFP_KERNEL); + txdata->tx_buf_ring = kzalloc_objs(struct sw_tx_bd, + NUM_TX_BD, + GFP_KERNEL); if (!txdata->tx_buf_ring) goto alloc_mem_err; txdata->tx_desc_ring = BNX2X_PCI_ALLOC(&txdata->tx_desc_mapping, @@ -4598,7 +4598,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) if (!skip_rx_queue(bp, index)) { /* fastpath rx rings: rx_buf rx_desc rx_comp */ bnx2x_fp(bp, index, rx_buf_ring) = - kcalloc(NUM_RX_BD, sizeof(struct sw_rx_bd), GFP_KERNEL); + kzalloc_objs(struct sw_rx_bd, NUM_RX_BD, GFP_KERNEL); if (!bnx2x_fp(bp, index, rx_buf_ring)) goto alloc_mem_err; bnx2x_fp(bp, index, rx_desc_ring) = @@ -4616,8 +4616,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) /* SGE ring */ bnx2x_fp(bp, index, rx_page_ring) = - kcalloc(NUM_RX_SGE, sizeof(struct sw_rx_page), - GFP_KERNEL); + kzalloc_objs(struct sw_rx_page, NUM_RX_SGE, GFP_KERNEL); if (!bnx2x_fp(bp, index, rx_page_ring)) goto alloc_mem_err; bnx2x_fp(bp, index, rx_sge_ring) = @@ -4747,13 +4746,14 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) bp->fp_array_size = fp_array_size; BNX2X_DEV_INFO("fp_array_size %d\n", bp->fp_array_size); - fp = kcalloc(bp->fp_array_size, sizeof(*fp), GFP_KERNEL); + fp = kzalloc_objs(*fp, bp->fp_array_size, GFP_KERNEL); if (!fp) goto alloc_err; for (i = 0; i < bp->fp_array_size; i++) { fp[i].tpa_info = - kcalloc(ETH_MAX_AGGREGATION_QUEUES_E1H_E2, - sizeof(struct bnx2x_agg_info), GFP_KERNEL); + kzalloc_objs(struct bnx2x_agg_info, + ETH_MAX_AGGREGATION_QUEUES_E1H_E2, + GFP_KERNEL); if (!(fp[i].tpa_info)) goto alloc_err; } @@ -4761,14 +4761,14 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) bp->fp = fp; /* allocate sp objs */ - bp->sp_objs = kcalloc(bp->fp_array_size, sizeof(struct bnx2x_sp_objs), - GFP_KERNEL); + bp->sp_objs = kzalloc_objs(struct bnx2x_sp_objs, bp->fp_array_size, + GFP_KERNEL); if (!bp->sp_objs) goto alloc_err; /* allocate fp_stats */ - bp->fp_stats = kcalloc(bp->fp_array_size, sizeof(struct bnx2x_fp_stats), - GFP_KERNEL); + bp->fp_stats = kzalloc_objs(struct bnx2x_fp_stats, bp->fp_array_size, + GFP_KERNEL); if (!bp->fp_stats) goto alloc_err; @@ -4777,19 +4777,19 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS + CNIC_SUPPORT(bp); BNX2X_DEV_INFO("txq_array_size %d", txq_array_size); - bp->bnx2x_txq = kcalloc(txq_array_size, sizeof(struct bnx2x_fp_txdata), - GFP_KERNEL); + bp->bnx2x_txq = kzalloc_objs(struct bnx2x_fp_txdata, txq_array_size, + GFP_KERNEL); if (!bp->bnx2x_txq) goto alloc_err; /* msix table */ - tbl = kcalloc(msix_table_size, sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_objs(*tbl, msix_table_size, GFP_KERNEL); if (!tbl) goto alloc_err; bp->msix_table = tbl; /* ilt */ - ilt = kzalloc(sizeof(*ilt), GFP_KERNEL); + ilt = kzalloc_obj(*ilt, GFP_KERNEL); if (!ilt) goto alloc_err; bp->ilt = ilt; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 6a1cc2032bf3..745b023e2e08 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -6577,7 +6577,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp) if (bp->gunzip_buf == NULL) goto gunzip_nomem1; - bp->strm = kmalloc(sizeof(*bp->strm), GFP_KERNEL); + bp->strm = kmalloc_obj(*bp->strm, GFP_KERNEL); if (bp->strm == NULL) goto gunzip_nomem2; @@ -8396,8 +8396,8 @@ int bnx2x_alloc_mem(struct bnx2x *bp) goto alloc_mem_err; allocated += bp->context[i].size; } - bp->ilt->lines = kcalloc(ILT_MAX_LINES, sizeof(struct ilt_line), - GFP_KERNEL); + bp->ilt->lines = kzalloc_objs(struct ilt_line, ILT_MAX_LINES, + GFP_KERNEL); if (!bp->ilt->lines) goto alloc_mem_err; @@ -10660,7 +10660,7 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi) up(&bnx2x_prev_sem); /* Create an entry for this path and add it */ - tmp_list = kmalloc(sizeof(struct bnx2x_prev_path_list), GFP_KERNEL); + tmp_list = kmalloc_obj(struct bnx2x_prev_path_list, GFP_KERNEL); if (!tmp_list) { BNX2X_ERR("Failed to allocate 'bnx2x_prev_path_list'\n"); return -ENOMEM; @@ -12954,7 +12954,7 @@ static int bnx2x_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) DP(NETIF_MSG_IFUP, "Adding VLAN %d\n", vid); - vlan = kmalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kmalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; @@ -14841,7 +14841,7 @@ static int bnx2x_get_fc_npiv(struct net_device *dev, DP(BNX2X_MSG_MCP, "About to read the FC-NPIV table\n"); - tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kmalloc_obj(*tbl, GFP_KERNEL); if (!tbl) { BNX2X_ERR("Failed to allocate fc_npiv table\n"); goto out; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 02c8213915a5..07a908a2c72f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c @@ -251,7 +251,7 @@ static inline struct bnx2x_exeq_elem *bnx2x_exe_queue_alloc_elem( struct bnx2x *bp) { DP(BNX2X_MSG_SP, "Allocating a new exe_queue element\n"); - return kzalloc(sizeof(struct bnx2x_exeq_elem), GFP_ATOMIC); + return kzalloc_obj(struct bnx2x_exeq_elem, GFP_ATOMIC); } /************************ raw_obj functions ***********************************/ @@ -1736,7 +1736,7 @@ static inline int bnx2x_vlan_mac_get_registry_elem( /* Allocate a new registry element if needed. */ if (!restore && ((cmd == BNX2X_VLAN_MAC_ADD) || (cmd == BNX2X_VLAN_MAC_MOVE))) { - reg_elem = kzalloc(sizeof(*reg_elem), GFP_ATOMIC); + reg_elem = kzalloc_obj(*reg_elem, GFP_ATOMIC); if (!reg_elem) return -ENOMEM; @@ -2688,7 +2688,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp, return 0; /* Add mcast is called under spin_lock, thus calling with GFP_ATOMIC */ - new_cmd = kzalloc(sizeof(*new_cmd), GFP_ATOMIC); + new_cmd = kzalloc_obj(*new_cmd, GFP_ATOMIC); if (!new_cmd) return -ENOMEM; @@ -3846,7 +3846,7 @@ static inline int bnx2x_mcast_refresh_registry_e1(struct bnx2x *bp, if (!list_empty(&o->registry.exact_match.macs)) return 0; - elem = kcalloc(len, sizeof(*elem), GFP_ATOMIC); + elem = kzalloc_objs(*elem, len, GFP_ATOMIC); if (!elem) { BNX2X_ERR("Failed to allocate registry memory\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 12198fc3ab22..5aeb5b6a64b5 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c @@ -551,8 +551,8 @@ int bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf, else set_bit(RAMROD_COMP_WAIT, &mcast.ramrod_flags); if (mc_num) { - mc = kcalloc(mc_num, sizeof(struct bnx2x_mcast_list_elem), - GFP_KERNEL); + mc = kzalloc_objs(struct bnx2x_mcast_list_elem, mc_num, + GFP_KERNEL); if (!mc) { BNX2X_ERR("Cannot Configure multicasts due to lack of memory\n"); return -ENOMEM; @@ -1218,7 +1218,7 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, } /* allocate the vfs database */ - bp->vfdb = kzalloc(sizeof(*(bp->vfdb)), GFP_KERNEL); + bp->vfdb = kzalloc_obj(*(bp->vfdb), GFP_KERNEL); if (!bp->vfdb) { BNX2X_ERR("failed to allocate vf database\n"); err = -ENOMEM; @@ -1247,9 +1247,8 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, num_vfs_param, iov->nr_virtfn); /* allocate the vf array */ - bp->vfdb->vfs = kcalloc(BNX2X_NR_VIRTFN(bp), - sizeof(struct bnx2x_virtf), - GFP_KERNEL); + bp->vfdb->vfs = kzalloc_objs(struct bnx2x_virtf, BNX2X_NR_VIRTFN(bp), + GFP_KERNEL); if (!bp->vfdb->vfs) { BNX2X_ERR("failed to allocate vf array\n"); err = -ENOMEM; @@ -1275,9 +1274,8 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, } /* allocate the queue arrays for all VFs */ - bp->vfdb->vfqs = kcalloc(BNX2X_MAX_NUM_VF_QUEUES, - sizeof(struct bnx2x_vf_queue), - GFP_KERNEL); + bp->vfdb->vfqs = kzalloc_objs(struct bnx2x_vf_queue, + BNX2X_MAX_NUM_VF_QUEUES, GFP_KERNEL); if (!bp->vfdb->vfqs) { BNX2X_ERR("failed to allocate vf queue array\n"); diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c index 8946a931e87e..818481f7a3ea 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c @@ -1654,8 +1654,7 @@ static int bnx2x_vf_mbx_macvlan_list(struct bnx2x *bp, int i, j; struct bnx2x_vf_mac_vlan_filters *fl = NULL; - fl = kzalloc(struct_size(fl, filters, tlv->n_mac_vlan_filters), - GFP_KERNEL); + fl = kzalloc_flex(*fl, filters, tlv->n_mac_vlan_filters, GFP_KERNEL); if (!fl) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index fb45e1dd1dd7..ad5035cd8ac3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3752,21 +3752,20 @@ static int bnxt_alloc_one_tpa_info(struct bnxt *bp, struct rx_agg_cmp *agg; int i; - rxr->rx_tpa = kcalloc(bp->max_tpa, sizeof(struct bnxt_tpa_info), - GFP_KERNEL); + rxr->rx_tpa = kzalloc_objs(struct bnxt_tpa_info, bp->max_tpa, + GFP_KERNEL); if (!rxr->rx_tpa) return -ENOMEM; if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS)) return 0; for (i = 0; i < bp->max_tpa; i++) { - agg = kcalloc(MAX_SKB_FRAGS, sizeof(*agg), GFP_KERNEL); + agg = kzalloc_objs(*agg, MAX_SKB_FRAGS, GFP_KERNEL); if (!agg) return -ENOMEM; rxr->rx_tpa[i].agg_arr = agg; } - rxr->rx_tpa_idx_map = kzalloc(sizeof(*rxr->rx_tpa_idx_map), - GFP_KERNEL); + rxr->rx_tpa_idx_map = kzalloc_obj(*rxr->rx_tpa_idx_map, GFP_KERNEL); if (!rxr->rx_tpa_idx_map) return -ENOMEM; @@ -4081,11 +4080,11 @@ static void bnxt_free_cp_arrays(struct bnxt_cp_ring_info *cpr) static int bnxt_alloc_cp_arrays(struct bnxt_cp_ring_info *cpr, int n) { - cpr->cp_desc_ring = kcalloc(n, sizeof(*cpr->cp_desc_ring), GFP_KERNEL); + cpr->cp_desc_ring = kzalloc_objs(*cpr->cp_desc_ring, n, GFP_KERNEL); if (!cpr->cp_desc_ring) return -ENOMEM; - cpr->cp_desc_mapping = kcalloc(n, sizeof(*cpr->cp_desc_mapping), - GFP_KERNEL); + cpr->cp_desc_mapping = kzalloc_objs(*cpr->cp_desc_mapping, n, + GFP_KERNEL); if (!cpr->cp_desc_mapping) return -ENOMEM; return 0; @@ -4232,8 +4231,7 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp) tx = 1; } - cpr->cp_ring_arr = kcalloc(cp_count, sizeof(*cpr), - GFP_KERNEL); + cpr->cp_ring_arr = kzalloc_objs(*cpr, cp_count, GFP_KERNEL); if (!cpr->cp_ring_arr) return -ENOMEM; cpr->cp_ring_count = cp_count; @@ -4627,9 +4625,8 @@ static int bnxt_init_ring_grps(struct bnxt *bp, bool irq_re_init) int i; if (irq_re_init) { - bp->grp_info = kcalloc(bp->cp_nr_rings, - sizeof(struct bnxt_ring_grp_info), - GFP_KERNEL); + bp->grp_info = kzalloc_objs(struct bnxt_ring_grp_info, + bp->cp_nr_rings, GFP_KERNEL); if (!bp->grp_info) return -ENOMEM; } @@ -4667,8 +4664,8 @@ static int bnxt_alloc_vnics(struct bnxt *bp) if (BNXT_CHIP_TYPE_NITRO_A0(bp)) num_vnics++; - bp->vnic_info = kcalloc(num_vnics, sizeof(struct bnxt_vnic_info), - GFP_KERNEL); + bp->vnic_info = kzalloc_objs(struct bnxt_vnic_info, num_vnics, + GFP_KERNEL); if (!bp->vnic_info) return -ENOMEM; @@ -5248,7 +5245,7 @@ static int bnxt_alloc_stats(struct bnxt *bp) struct bnxt_napi *bnapi = bp->bnapi[i]; struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; - cpr->sw_stats = kzalloc(sizeof(*cpr->sw_stats), GFP_KERNEL); + cpr->sw_stats = kzalloc_obj(*cpr->sw_stats, GFP_KERNEL); if (!cpr->sw_stats) return -ENOMEM; @@ -5516,9 +5513,8 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init) } } - bp->rx_ring = kcalloc(bp->rx_nr_rings, - sizeof(struct bnxt_rx_ring_info), - GFP_KERNEL); + bp->rx_ring = kzalloc_objs(struct bnxt_rx_ring_info, + bp->rx_nr_rings, GFP_KERNEL); if (!bp->rx_ring) return -ENOMEM; @@ -5537,9 +5533,8 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init) bp->bnapi[i]->rx_ring = &bp->rx_ring[i]; } - bp->tx_ring = kcalloc(bp->tx_nr_rings, - sizeof(struct bnxt_tx_ring_info), - GFP_KERNEL); + bp->tx_ring = kzalloc_objs(struct bnxt_tx_ring_info, + bp->tx_nr_rings, GFP_KERNEL); if (!bp->tx_ring) return -ENOMEM; @@ -6096,7 +6091,7 @@ static struct bnxt_l2_filter *bnxt_alloc_l2_filter(struct bnxt *bp, if (fltr) return fltr; - fltr = kzalloc(sizeof(*fltr), gfp); + fltr = kzalloc_obj(*fltr, gfp); if (!fltr) return ERR_PTR(-ENOMEM); spin_lock_bh(&bp->ntp_fltr_lock); @@ -6125,7 +6120,7 @@ struct bnxt_l2_filter *bnxt_alloc_new_l2_filter(struct bnxt *bp, fltr = ERR_PTR(-EEXIST); goto l2_filter_exit; } - fltr = kzalloc(sizeof(*fltr), GFP_ATOMIC); + fltr = kzalloc_obj(*fltr, GFP_ATOMIC); if (!fltr) { fltr = ERR_PTR(-ENOMEM); goto l2_filter_exit; @@ -8655,7 +8650,7 @@ static int bnxt_alloc_all_ctx_pg_info(struct bnxt *bp, int ctx_max) if (ctxm->instance_bmap) n = hweight32(ctxm->instance_bmap); - ctxm->pg_info = kcalloc(n, sizeof(*ctxm->pg_info), GFP_KERNEL); + ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n, GFP_KERNEL); if (!ctxm->pg_info) return -ENOMEM; } @@ -8682,7 +8677,7 @@ static int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp) return rc; if (!ctx) { - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; bp->ctx = ctx; @@ -8769,7 +8764,7 @@ static int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp) ctx = bp->ctx; if (!ctx) { - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto ctx_err; @@ -9048,8 +9043,8 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, int nr_tbls, i; rmem->depth = 2; - ctx_pg->ctx_pg_tbl = kcalloc(MAX_CTX_PAGES, sizeof(ctx_pg), - GFP_KERNEL); + ctx_pg->ctx_pg_tbl = kzalloc_objs(ctx_pg, MAX_CTX_PAGES, + GFP_KERNEL); if (!ctx_pg->ctx_pg_tbl) return -ENOMEM; nr_tbls = DIV_ROUND_UP(ctx_pg->nr_pages, MAX_CTX_PAGES); @@ -9060,7 +9055,7 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, for (i = 0; i < nr_tbls; i++) { struct bnxt_ctx_pg_info *pg_tbl; - pg_tbl = kzalloc(sizeof(*pg_tbl), GFP_KERNEL); + pg_tbl = kzalloc_obj(*pg_tbl, GFP_KERNEL); if (!pg_tbl) return -ENOMEM; ctx_pg->ctx_pg_tbl[i] = pg_tbl; @@ -9569,8 +9564,7 @@ static int bnxt_alloc_crash_dump_mem(struct bnxt *bp) if (bp->fw_crash_mem) bnxt_free_ctx_pg_tbls(bp, bp->fw_crash_mem); else - bp->fw_crash_mem = kzalloc(sizeof(*bp->fw_crash_mem), - GFP_KERNEL); + bp->fw_crash_mem = kzalloc_obj(*bp->fw_crash_mem, GFP_KERNEL); if (!bp->fw_crash_mem) return -ENOMEM; @@ -9677,7 +9671,7 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp) goto exit; } if (!ptp) { - ptp = kzalloc(sizeof(*ptp), GFP_KERNEL); + ptp = kzalloc_obj(*ptp, GFP_KERNEL); if (!ptp) { rc = -ENOMEM; goto exit; @@ -9949,7 +9943,7 @@ static int __bnxt_alloc_fw_health(struct bnxt *bp) if (bp->fw_health) return 0; - bp->fw_health = kzalloc(sizeof(*bp->fw_health), GFP_KERNEL); + bp->fw_health = kzalloc_obj(*bp->fw_health, GFP_KERNEL); if (!bp->fw_health) return -ENOMEM; @@ -11460,7 +11454,7 @@ static int bnxt_init_int_mode(struct bnxt *bp) tbl_size = total_vecs; if (pci_msix_can_alloc_dyn(bp->pdev)) tbl_size = max; - bp->irq_tbl = kcalloc(tbl_size, sizeof(*bp->irq_tbl), GFP_KERNEL); + bp->irq_tbl = kzalloc_objs(*bp->irq_tbl, tbl_size, GFP_KERNEL); if (bp->irq_tbl) { for (i = 0; i < total_vecs; i++) bp->irq_tbl[i].vector = pci_irq_vector(bp->pdev, i); @@ -12957,7 +12951,7 @@ static int bnxt_set_xps_mapping(struct bnxt *bp) cpumask_t *q_map; int rc = 0; - q_map = kcalloc(bp->tx_nr_rings_per_tc, sizeof(*q_map), GFP_KERNEL); + q_map = kzalloc_objs(*q_map, bp->tx_nr_rings_per_tc, GFP_KERNEL); if (!q_map) return -ENOMEM; @@ -15650,7 +15644,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, return -EINVAL; } } - new_fltr = kzalloc(sizeof(*new_fltr), GFP_ATOMIC); + new_fltr = kzalloc_obj(*new_fltr, GFP_ATOMIC); if (!new_fltr) { bnxt_del_l2_filter(bp, l2_fltr); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c index a00b67334f9b..00e3ef076d93 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c @@ -529,7 +529,7 @@ static int bnxt_dcbnl_ieee_getets(struct net_device *dev, struct ieee_ets *ets) if (bp->dcbx_cap & DCB_CAP_DCBX_HOST) return 0; - my_ets = kzalloc(sizeof(*my_ets), GFP_KERNEL); + my_ets = kzalloc_obj(*my_ets, GFP_KERNEL); if (!my_ets) return -ENOMEM; rc = bnxt_hwrm_queue_cos2bw_qcfg(bp, my_ets); @@ -568,7 +568,7 @@ static int bnxt_dcbnl_ieee_setets(struct net_device *dev, struct ieee_ets *ets) rc = bnxt_ets_validate(bp, ets, &max_tc); if (!rc) { if (!my_ets) { - my_ets = kzalloc(sizeof(*my_ets), GFP_KERNEL); + my_ets = kzalloc_obj(*my_ets, GFP_KERNEL); if (!my_ets) return -ENOMEM; /* initialize PRI2TC mappings to invalid value */ @@ -604,7 +604,7 @@ static int bnxt_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) if (bp->dcbx_cap & DCB_CAP_DCBX_HOST) return 0; - my_pfc = kzalloc(sizeof(*my_pfc), GFP_KERNEL); + my_pfc = kzalloc_obj(*my_pfc, GFP_KERNEL); if (!my_pfc) return 0; bp->ieee_pfc = my_pfc; @@ -642,7 +642,7 @@ static int bnxt_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc) return -EINVAL; if (!my_pfc) { - my_pfc = kzalloc(sizeof(*my_pfc), GFP_KERNEL); + my_pfc = kzalloc_obj(*my_pfc, GFP_KERNEL); if (!my_pfc) return -ENOMEM; bp->ieee_pfc = my_pfc; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 53a83b6680c4..e7455ef8984a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1371,7 +1371,7 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, return -EOPNOTSUPP; } - new_fltr = kzalloc(sizeof(*new_fltr), GFP_KERNEL); + new_fltr = kzalloc_obj(*new_fltr, GFP_KERNEL); if (!new_fltr) return -ENOMEM; @@ -5485,7 +5485,7 @@ void bnxt_ethtool_init(struct bnxt *bp) test_info = bp->test_info; if (!test_info) { - test_info = kzalloc(sizeof(*bp->test_info), GFP_KERNEL); + test_info = kzalloc_obj(*bp->test_info, GFP_KERNEL); if (!test_info) return; bp->test_info = test_info; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c index 5ce190f50120..fcb4edb24012 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c @@ -371,7 +371,7 @@ __hwrm_acquire_token(struct bnxt *bp, enum bnxt_hwrm_chnl dst) { struct bnxt_hwrm_wait_token *token; - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kzalloc_obj(*token, GFP_KERNEL); if (!token) return NULL; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c index ad89c5fa9b40..0135c53d4b47 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c @@ -983,9 +983,8 @@ static int bnxt_ptp_pps_init(struct bnxt *bp) pps_info = &ptp->pps_info; pps_info->num_pins = resp->num_pins; ptp_info->n_pins = pps_info->num_pins; - ptp_info->pin_config = kcalloc(ptp_info->n_pins, - sizeof(*ptp_info->pin_config), - GFP_KERNEL); + ptp_info->pin_config = kzalloc_objs(*ptp_info->pin_config, + ptp_info->n_pins, GFP_KERNEL); if (!ptp_info->pin_config) { hwrm_req_drop(bp, req); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index be7deb9cc410..d0f5f2ad5b26 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -459,7 +459,7 @@ static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs) struct pci_dev *pdev = bp->pdev; u32 nr_pages, size, i, j, k = 0; - bp->pf.vf = kcalloc(num_vfs, sizeof(struct bnxt_vf_info), GFP_KERNEL); + bp->pf.vf = kzalloc_objs(struct bnxt_vf_info, num_vfs, GFP_KERNEL); if (!bp->pf.vf) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c index 2d66bf59cd64..c678305d588c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c @@ -977,7 +977,7 @@ bnxt_tc_get_l2_node(struct bnxt *bp, struct rhashtable *l2_table, l2_node = rhashtable_lookup_fast(l2_table, l2_key, ht_params); if (!l2_node) { - l2_node = kzalloc(sizeof(*l2_node), GFP_KERNEL); + l2_node = kzalloc_obj(*l2_node, GFP_KERNEL); if (!l2_node) { rc = -ENOMEM; return NULL; @@ -1128,7 +1128,7 @@ bnxt_tc_get_tunnel_node(struct bnxt *bp, struct rhashtable *tunnel_table, tunnel_node = rhashtable_lookup_fast(tunnel_table, tun_key, *ht_params); if (!tunnel_node) { - tunnel_node = kzalloc(sizeof(*tunnel_node), GFP_KERNEL); + tunnel_node = kzalloc_obj(*tunnel_node, GFP_KERNEL); if (!tunnel_node) { rc = -ENOMEM; goto err; @@ -1535,7 +1535,7 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid, int rc; /* allocate memory for the new flow and it's node */ - new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); + new_node = kzalloc_obj(*new_node, GFP_KERNEL); if (!new_node) { rc = -ENOMEM; goto done; @@ -1915,7 +1915,7 @@ static int bnxt_tc_setup_indr_block(struct net_device *netdev, struct Qdisc *sch switch (f->command) { case FLOW_BLOCK_BIND: - cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL); + cb_priv = kmalloc_obj(*cb_priv, GFP_KERNEL); if (!cb_priv) return -ENOMEM; @@ -2018,7 +2018,7 @@ int bnxt_init_tc(struct bnxt *bp) if (bp->hwrm_spec_code < 0x10803) return 0; - tc_info = kzalloc(sizeof(*tc_info), GFP_KERNEL); + tc_info = kzalloc_obj(*tc_info, GFP_KERNEL); if (!tc_info) return -ENOMEM; mutex_init(&tc_info->lock); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c index 927971c362f1..ca95f6e70dde 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c @@ -333,8 +333,8 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err) return; if (!err) { - ent = kcalloc(ulp->msix_requested, sizeof(*ent), - GFP_KERNEL); + ent = kzalloc_objs(*ent, ulp->msix_requested, + GFP_KERNEL); if (!ent) return; bnxt_fill_msix_vecs(bp, ent); @@ -479,7 +479,7 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp) if (!(bp->flags & BNXT_FLAG_ROCE_CAP)) return; - aux_priv = kzalloc(sizeof(*bp->aux_priv), GFP_KERNEL); + aux_priv = kzalloc_obj(*bp->aux_priv, GFP_KERNEL); if (!aux_priv) goto exit; @@ -509,13 +509,13 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp) * any error unwinding will need to include a call to * auxiliary_device_uninit. */ - edev = kzalloc(sizeof(*edev), GFP_KERNEL); + edev = kzalloc_obj(*edev, GFP_KERNEL); if (!edev) goto aux_dev_uninit; aux_priv->edev = edev; - ulp = kzalloc(sizeof(*ulp), GFP_KERNEL); + ulp = kzalloc_obj(*ulp, GFP_KERNEL); if (!ulp) goto aux_dev_uninit; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c index bd116fd578d8..d0a67616f927 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c @@ -496,7 +496,7 @@ int bnxt_vf_reps_create(struct bnxt *bp) if (!(bp->flags & BNXT_FLAG_DSN_VALID)) return -ENODEV; - bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); + bp->vf_reps = kzalloc_objs(vf_rep, num_vfs, GFP_KERNEL); if (!bp->vf_reps) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 6e97a5a7daaf..bd4238737fef 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -1062,7 +1062,7 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages) } } - udev = kzalloc(sizeof(struct cnic_uio_dev), GFP_ATOMIC); + udev = kzalloc_obj(struct cnic_uio_dev, GFP_ATOMIC); if (!udev) return -ENOMEM; @@ -1208,7 +1208,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev) if (blks > cp->ethdev->ctx_tbl_len) return -ENOMEM; - cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL); + cp->ctx_arr = kzalloc_objs(struct cnic_ctx, blks, GFP_KERNEL); if (cp->ctx_arr == NULL) return -ENOMEM; @@ -1261,13 +1261,13 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev) cp->fcoe_init_cid = 0x10; } - cp->iscsi_tbl = kcalloc(MAX_ISCSI_TBL_SZ, sizeof(struct cnic_iscsi), - GFP_KERNEL); + cp->iscsi_tbl = kzalloc_objs(struct cnic_iscsi, MAX_ISCSI_TBL_SZ, + GFP_KERNEL); if (!cp->iscsi_tbl) goto error; - cp->ctx_tbl = kcalloc(cp->max_cid_space, sizeof(struct cnic_context), - GFP_KERNEL); + cp->ctx_tbl = kzalloc_objs(struct cnic_context, cp->max_cid_space, + GFP_KERNEL); if (!cp->ctx_tbl) goto error; @@ -4105,8 +4105,8 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev) u32 port_id; int i; - cp->csk_tbl = kvcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock), - GFP_KERNEL); + cp->csk_tbl = kvzalloc_objs(struct cnic_sock, MAX_CM_SK_TBL_SZ, + GFP_KERNEL); if (!cp->csk_tbl) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 05512aa10c20..a6f8805e1932 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3083,8 +3083,8 @@ static int bcmgenet_init_dma(struct bcmgenet_priv *priv, bool flush_rx) /* Initialize common Rx ring structures */ priv->rx_bds = priv->base + priv->hw_params->rdma_offset; priv->num_rx_bds = TOTAL_DESC; - priv->rx_cbs = kcalloc(priv->num_rx_bds, sizeof(struct enet_cb), - GFP_KERNEL); + priv->rx_cbs = kzalloc_objs(struct enet_cb, priv->num_rx_bds, + GFP_KERNEL); if (!priv->rx_cbs) return -ENOMEM; @@ -3096,8 +3096,8 @@ static int bcmgenet_init_dma(struct bcmgenet_priv *priv, bool flush_rx) /* Initialize common TX ring structures */ priv->tx_bds = priv->base + priv->hw_params->tdma_offset; priv->num_tx_bds = TOTAL_DESC; - priv->tx_cbs = kcalloc(priv->num_tx_bds, sizeof(struct enet_cb), - GFP_KERNEL); + priv->tx_cbs = kzalloc_objs(struct enet_cb, priv->num_tx_bds, + GFP_KERNEL); if (!priv->tx_cbs) { kfree(priv->rx_cbs); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c index 30865fe03eeb..4787ea610edc 100644 --- a/drivers/net/ethernet/broadcom/sb1250-mac.c +++ b/drivers/net/ethernet/broadcom/sb1250-mac.c @@ -622,9 +622,9 @@ static void sbdma_initctx(struct sbmacdma *d, struct sbmac_softc *s, int chan, d->sbdma_maxdescr = maxdescr; - d->sbdma_dscrtable_unaligned = kcalloc(d->sbdma_maxdescr + 1, - sizeof(*d->sbdma_dscrtable), - GFP_KERNEL); + d->sbdma_dscrtable_unaligned = kzalloc_objs(*d->sbdma_dscrtable, + d->sbdma_maxdescr + 1, + GFP_KERNEL); /* * The descriptor table must be aligned to at least 16 bytes or the @@ -642,8 +642,8 @@ static void sbdma_initctx(struct sbmacdma *d, struct sbmac_softc *s, int chan, * And context table */ - d->sbdma_ctxtable = kcalloc(d->sbdma_maxdescr, - sizeof(*d->sbdma_ctxtable), GFP_KERNEL); + d->sbdma_ctxtable = kzalloc_objs(*d->sbdma_ctxtable, d->sbdma_maxdescr, + GFP_KERNEL); #ifdef CONFIG_SBMAC_COALESCE /* diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 75f66587983d..746c95dc11cd 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -8729,9 +8729,8 @@ static int tg3_mem_tx_acquire(struct tg3 *tp) tnapi++; for (i = 0; i < tp->txq_cnt; i++, tnapi++) { - tnapi->tx_buffers = kcalloc(TG3_TX_RING_SIZE, - sizeof(struct tg3_tx_ring_info), - GFP_KERNEL); + tnapi->tx_buffers = kzalloc_objs(struct tg3_tx_ring_info, + TG3_TX_RING_SIZE, GFP_KERNEL); if (!tnapi->tx_buffers) goto err_out; diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 9bed33295839..ec3750f055b8 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -1345,8 +1345,8 @@ bnad_mem_alloc(struct bnad *bnad, return 0; } - mem_info->mdl = kcalloc(mem_info->num, sizeof(struct bna_mem_descr), - GFP_KERNEL); + mem_info->mdl = kzalloc_objs(struct bna_mem_descr, mem_info->num, + GFP_KERNEL); if (mem_info->mdl == NULL) return -ENOMEM; @@ -1458,9 +1458,8 @@ bnad_txrx_irq_alloc(struct bnad *bnad, enum bnad_intr_source src, if (cfg_flags & BNAD_CF_MSIX) { intr_info->intr_type = BNA_INTR_T_MSIX; - intr_info->idl = kcalloc(intr_info->num, - sizeof(struct bna_intr_descr), - GFP_KERNEL); + intr_info->idl = kzalloc_objs(struct bna_intr_descr, + intr_info->num, GFP_KERNEL); if (!intr_info->idl) return -ENOMEM; @@ -1484,9 +1483,8 @@ bnad_txrx_irq_alloc(struct bnad *bnad, enum bnad_intr_source src, } else { intr_info->intr_type = BNA_INTR_T_INTX; intr_info->num = 1; - intr_info->idl = kcalloc(intr_info->num, - sizeof(struct bna_intr_descr), - GFP_KERNEL); + intr_info->idl = kzalloc_objs(struct bna_intr_descr, + intr_info->num, GFP_KERNEL); if (!intr_info->idl) return -ENOMEM; @@ -2642,7 +2640,7 @@ bnad_enable_msix(struct bnad *bnad) return; bnad->msix_table = - kcalloc(bnad->msix_num, sizeof(struct msix_entry), GFP_KERNEL); + kzalloc_objs(struct msix_entry, bnad->msix_num, GFP_KERNEL); if (!bnad->msix_table) goto intx_mode; diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c index 8f0972e6737c..8a2eb4504760 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c @@ -45,7 +45,7 @@ bnad_debugfs_open_fwtrc(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc(sizeof(struct bnad_debug_info), GFP_KERNEL); + fw_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); if (!fw_debug) return -ENOMEM; @@ -85,7 +85,7 @@ bnad_debugfs_open_fwsave(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc(sizeof(struct bnad_debug_info), GFP_KERNEL); + fw_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); if (!fw_debug) return -ENOMEM; @@ -122,7 +122,7 @@ bnad_debugfs_open_reg(struct inode *inode, struct file *file) { struct bnad_debug_info *reg_debug; - reg_debug = kzalloc(sizeof(struct bnad_debug_info), GFP_KERNEL); + reg_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); if (!reg_debug) return -ENOMEM; @@ -185,7 +185,7 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file) struct bnad_debug_info *drv_info; int rc; - drv_info = kzalloc(sizeof(struct bnad_debug_info), GFP_KERNEL); + drv_info = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); if (!drv_info) return -ENOMEM; diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 216e25f26dbb..446234e3ca53 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c @@ -285,7 +285,7 @@ bnad_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) strscpy(drvinfo->driver, BNAD_NAME, sizeof(drvinfo->driver)); - ioc_attr = kzalloc(sizeof(*ioc_attr), GFP_KERNEL); + ioc_attr = kzalloc_obj(*ioc_attr, GFP_KERNEL); if (ioc_attr) { spin_lock_irqsave(&bnad->bna_lock, flags); bfa_nw_ioc_get_attr(&bnad->bna.ioceth.ioc, ioc_attr); @@ -900,7 +900,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, u32 i, flash_part = 0, ret; unsigned long flags = 0; - flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); + flash_attr = kzalloc_obj(struct bfa_flash_attr, GFP_KERNEL); if (!flash_attr) return 0; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 43cd013bb70e..86f516563db6 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3734,7 +3734,7 @@ static int gem_add_flow_filter(struct net_device *netdev, int ret = -EINVAL; bool added = false; - newfs = kmalloc(sizeof(*newfs), GFP_KERNEL); + newfs = kmalloc_obj(*newfs, GFP_KERNEL); if (newfs == NULL) return -ENOMEM; memcpy(&newfs->fs, fs, sizeof(newfs->fs)); diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c index 331ac6a3dc38..283948d784da 100644 --- a/drivers/net/ethernet/calxeda/xgmac.c +++ b/drivers/net/ethernet/calxeda/xgmac.c @@ -729,8 +729,8 @@ static int xgmac_dma_desc_rings_init(struct net_device *dev) netdev_dbg(priv->dev, "mtu [%d] bfsize [%d]\n", dev->mtu, bfsize); - priv->rx_skbuff = kcalloc(DMA_RX_RING_SZ, sizeof(struct sk_buff *), - GFP_KERNEL); + priv->rx_skbuff = kzalloc_objs(struct sk_buff *, DMA_RX_RING_SZ, + GFP_KERNEL); if (!priv->rx_skbuff) return -ENOMEM; @@ -742,8 +742,8 @@ static int xgmac_dma_desc_rings_init(struct net_device *dev) if (!priv->dma_rx) goto err_dma_rx; - priv->tx_skbuff = kcalloc(DMA_TX_RING_SZ, sizeof(struct sk_buff *), - GFP_KERNEL); + priv->tx_skbuff = kzalloc_objs(struct sk_buff *, DMA_TX_RING_SZ, + GFP_KERNEL); if (!priv->tx_skbuff) goto err_tx_skb; diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c index 215dac201b4a..baccb0169068 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c @@ -89,12 +89,12 @@ int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) int i, j; lio->glist_lock = - kcalloc(num_iqs, sizeof(*lio->glist_lock), GFP_KERNEL); + kzalloc_objs(*lio->glist_lock, num_iqs, GFP_KERNEL); if (!lio->glist_lock) return -ENOMEM; lio->glist = - kcalloc(num_iqs, sizeof(*lio->glist), GFP_KERNEL); + kzalloc_objs(*lio->glist, num_iqs, GFP_KERNEL); if (!lio->glist) { kfree(lio->glist_lock); lio->glist_lock = NULL; @@ -107,10 +107,10 @@ int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) /* allocate memory to store virtual and dma base address of * per glist consistent memory */ - lio->glists_virt_base = kcalloc(num_iqs, sizeof(*lio->glists_virt_base), - GFP_KERNEL); - lio->glists_dma_base = kcalloc(num_iqs, sizeof(*lio->glists_dma_base), - GFP_KERNEL); + lio->glists_virt_base = kzalloc_objs(*lio->glists_virt_base, num_iqs, + GFP_KERNEL); + lio->glists_dma_base = kzalloc_objs(*lio->glists_dma_base, num_iqs, + GFP_KERNEL); if (!lio->glists_virt_base || !lio->glists_dma_base) { lio_delete_glists(lio); @@ -138,7 +138,7 @@ int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) g = kzalloc_node(sizeof(*g), GFP_KERNEL, numa_node); if (!g) - g = kzalloc(sizeof(*g), GFP_KERNEL); + g = kzalloc_obj(*g, GFP_KERNEL); if (!g) break; @@ -1051,9 +1051,8 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs) aux_irq_name = &queue_irq_names [IRQ_NAME_OFF(MAX_IOQ_INTERRUPTS_PER_PF)]; - oct->msix_entries = kcalloc(oct->num_msix_irqs, - sizeof(struct msix_entry), - GFP_KERNEL); + oct->msix_entries = kzalloc_objs(struct msix_entry, + oct->num_msix_irqs, GFP_KERNEL); if (!oct->msix_entries) { dev_err(&oct->pci_dev->dev, "Memory Alloc failed...\n"); kfree(oct->irq_name_storage); diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c index 1753bb87dfbd..e61f18467a15 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c @@ -1164,7 +1164,7 @@ octeon_register_dispatch_fn(struct octeon_device *oct, dev_dbg(&oct->pci_dev->dev, "Adding opcode to dispatch list linked list\n"); - dispatch = kmalloc(sizeof(*dispatch), GFP_KERNEL); + dispatch = kmalloc_obj(*dispatch, GFP_KERNEL); if (!dispatch) return 1; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 0b6e30a8feb0..7ef2a9f606a1 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1465,7 +1465,7 @@ int nicvf_open(struct net_device *netdev) /* Register NAPI handler for processing CQEs */ for (qidx = 0; qidx < qs->cq_cnt; qidx++) { - cq_poll = kzalloc(sizeof(*cq_poll), GFP_KERNEL); + cq_poll = kzalloc_obj(*cq_poll, GFP_KERNEL); if (!cq_poll) { err = -ENOMEM; goto napi_del; @@ -2052,9 +2052,9 @@ static void nicvf_set_rx_mode(struct net_device *netdev) mode |= BGX_XCAST_MCAST_FILTER; /* here we need to copy mc addrs */ if (netdev_mc_count(netdev)) { - mc_list = kmalloc(struct_size(mc_list, mc, - netdev_mc_count(netdev)), - GFP_ATOMIC); + mc_list = kmalloc_flex(*mc_list, mc, + netdev_mc_count(netdev), + GFP_ATOMIC); if (unlikely(!mc_list)) return; mc_list->count = 0; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index 5211759bfe47..12bea0b6a4e6 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -289,8 +289,7 @@ static int nicvf_init_rbdr(struct nicvf *nic, struct rbdr *rbdr, rbdr->is_xdp = true; } rbdr->pgcnt = roundup_pow_of_two(rbdr->pgcnt); - rbdr->pgcache = kcalloc(rbdr->pgcnt, sizeof(*rbdr->pgcache), - GFP_KERNEL); + rbdr->pgcache = kzalloc_objs(*rbdr->pgcache, rbdr->pgcnt, GFP_KERNEL); if (!rbdr->pgcache) return -ENOMEM; rbdr->pgidx = 0; diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 9efb60842ad1..87723e4140b0 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -1086,8 +1086,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) /* actual number of filters available to exact LMAC */ lmac->dmacs_count = (RX_DMAC_COUNT / bgx->lmac_count); - lmac->dmacs = kcalloc(lmac->dmacs_count, sizeof(*lmac->dmacs), - GFP_KERNEL); + lmac->dmacs = kzalloc_objs(*lmac->dmacs, lmac->dmacs_count, GFP_KERNEL); if (!lmac->dmacs) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb/espi.c b/drivers/net/ethernet/chelsio/cxgb/espi.c index ef70569435be..a7dd518b6ea9 100644 --- a/drivers/net/ethernet/chelsio/cxgb/espi.c +++ b/drivers/net/ethernet/chelsio/cxgb/espi.c @@ -280,7 +280,7 @@ void t1_espi_destroy(struct peespi *espi) struct peespi *t1_espi_create(adapter_t *adapter) { - struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL); + struct peespi *espi = kzalloc_obj(*espi, GFP_KERNEL); if (espi) espi->adapter = adapter; diff --git a/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c b/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c index 30b003484fc1..4c4a43828110 100644 --- a/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c +++ b/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c @@ -358,7 +358,7 @@ static struct cphy *mv88e1xxx_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { struct adapter *adapter = netdev_priv(dev); - struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c b/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c index 556c8ad68fa8..8c3d3250b72c 100644 --- a/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c +++ b/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c @@ -203,7 +203,7 @@ static struct cphy *mv88x201x_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { u32 val; - struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/my3126.c b/drivers/net/ethernet/chelsio/cxgb/my3126.c index 60aa45b375b6..9d29f0767dcb 100644 --- a/drivers/net/ethernet/chelsio/cxgb/my3126.c +++ b/drivers/net/ethernet/chelsio/cxgb/my3126.c @@ -171,7 +171,7 @@ static const struct cphy_ops my3126_ops = { static struct cphy *my3126_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { - struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index 5f354cf62cdd..21d7f84af72e 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c @@ -366,7 +366,7 @@ static int tx_sched_init(struct sge *sge) struct sched *s; int i; - s = kzalloc(sizeof (struct sched), GFP_KERNEL); + s = kzalloc_obj(struct sched, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2095,7 +2095,7 @@ static void espibug_workaround(struct timer_list *t) */ struct sge *t1_sge_create(struct adapter *adapter, struct sge_params *p) { - struct sge *sge = kzalloc(sizeof(*sge), GFP_KERNEL); + struct sge *sge = kzalloc_obj(*sge, GFP_KERNEL); int i; if (!sge) diff --git a/drivers/net/ethernet/chelsio/cxgb/tp.c b/drivers/net/ethernet/chelsio/cxgb/tp.c index 4337cee0763e..66dfe57b9f01 100644 --- a/drivers/net/ethernet/chelsio/cxgb/tp.c +++ b/drivers/net/ethernet/chelsio/cxgb/tp.c @@ -58,7 +58,7 @@ void t1_tp_destroy(struct petp *tp) struct petp *t1_tp_create(adapter_t *adapter, struct tp_params *p) { - struct petp *tp = kzalloc(sizeof(*tp), GFP_KERNEL); + struct petp *tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 3b1321c8ed14..ce9880805a42 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c @@ -3242,7 +3242,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) mmio_len = pci_resource_len(pdev, 0); ai = t3_get_adapter_info(ent->driver_data); - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) { err = -ENOMEM; goto out_release_regions; diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c index 5a9f6925e1fa..cf8916f4e3d6 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c @@ -1185,7 +1185,7 @@ int cxgb3_offload_activate(struct adapter *adapter) unsigned int l2t_capacity; struct l2t_data *l2td; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.c b/drivers/net/ethernet/chelsio/cxgb3/l2t.c index 5d5f3380ecca..6bcb952fe832 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/l2t.c +++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.c @@ -408,7 +408,7 @@ struct l2t_data *t3_init_l2t(unsigned int l2t_capacity) struct l2t_data *d; int i; - d = kvzalloc(struct_size(d, l2tab, l2t_capacity), GFP_KERNEL); + d = kvzalloc_flex(*d, l2tab, l2t_capacity, GFP_KERNEL); if (!d) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c index 5060d3998889..fb958857bfd6 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c +++ b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c @@ -287,7 +287,7 @@ struct clip_tbl *t4_init_clip_tbl(unsigned int clipt_start, if (clipt_size < CLIPT_MIN_HASH_BUCKETS) return NULL; - ctbl = kvzalloc(struct_size(ctbl, hash_list, clipt_size), GFP_KERNEL); + ctbl = kvzalloc_flex(*ctbl, hash_list, clipt_size, GFP_KERNEL); if (!ctbl) return NULL; @@ -301,7 +301,7 @@ struct clip_tbl *t4_init_clip_tbl(unsigned int clipt_start, for (i = 0; i < ctbl->clipt_size; ++i) INIT_LIST_HEAD(&ctbl->hash_list[i]); - cl_list = kvcalloc(clipt_size, sizeof(struct clip_entry), GFP_KERNEL); + cl_list = kvzalloc_objs(struct clip_entry, clipt_size, GFP_KERNEL); if (!cl_list) { kvfree(ctbl); return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index 14e0d989c3ba..6e2e5644b825 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c @@ -860,7 +860,7 @@ static int cctrl_tbl_show(struct seq_file *seq, void *v) u16 (*incr)[NCCTRL_WIN]; struct adapter *adap = seq->private; - incr = kmalloc_array(NMTUS, sizeof(*incr), GFP_KERNEL); + incr = kmalloc_objs(*incr, NMTUS, GFP_KERNEL); if (!incr) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c index faf8f7e86520..3c66db1f765a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c @@ -2250,13 +2250,12 @@ int cxgb4_init_ethtool_filters(struct adapter *adap) u32 nentries, i; int ret; - eth_filter = kzalloc(sizeof(*eth_filter), GFP_KERNEL); + eth_filter = kzalloc_obj(*eth_filter, GFP_KERNEL); if (!eth_filter) return -ENOMEM; - eth_filter_info = kcalloc(adap->params.nports, - sizeof(*eth_filter_info), - GFP_KERNEL); + eth_filter_info = kzalloc_objs(*eth_filter_info, adap->params.nports, + GFP_KERNEL); if (!eth_filter_info) { ret = -ENOMEM; goto free_eth_filter; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c index dd9e68465e69..dad0e72a52ab 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c @@ -1389,7 +1389,7 @@ static int cxgb4_set_hash_filter(struct net_device *dev, if (iq < 0) return iq; - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 043733c5c812..20eeb4deab49 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -388,7 +388,7 @@ static int cxgb4_mac_sync(struct net_device *netdev, const u8 *mac_addr) * list and program it */ if (uhash || mhash) { - new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC); + new_entry = kzalloc_obj(*new_entry, GFP_ATOMIC); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, mac_addr); @@ -478,7 +478,7 @@ int cxgb4_change_mac(struct port_info *pi, unsigned int viid, goto set_hash; } } - new_entry = kzalloc(sizeof(*new_entry), GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, addr); @@ -1330,7 +1330,7 @@ static int cxgb4_port_mirror_alloc_queues(struct net_device *dev) if (s->mirror_rxq[pi->port_id]) return 0; - mirror_rxq = kcalloc(pi->nmirrorqsets, sizeof(*mirror_rxq), GFP_KERNEL); + mirror_rxq = kzalloc_objs(*mirror_rxq, pi->nmirrorqsets, GFP_KERNEL); if (!mirror_rxq) return -ENOMEM; @@ -4057,7 +4057,7 @@ static int adap_config_hma(struct adapter *adapter) page_size = HMA_PAGE_SIZE; page_order = HMA_PAGE_ORDER; - adapter->hma.sgt = kzalloc(sizeof(*adapter->hma.sgt), GFP_KERNEL); + adapter->hma.sgt = kzalloc_obj(*adapter->hma.sgt, GFP_KERNEL); if (unlikely(!adapter->hma.sgt)) { dev_err(adapter->pdev_dev, "HMA SG table allocation failed\n"); return -ENOMEM; @@ -4097,8 +4097,7 @@ static int adap_config_hma(struct adapter *adapter) } adapter->hma.flags |= HMA_DMA_MAPPED_FLAG; - adapter->hma.phy_addr = kcalloc(sgt->nents, sizeof(dma_addr_t), - GFP_KERNEL); + adapter->hma.phy_addr = kzalloc_objs(dma_addr_t, sgt->nents, GFP_KERNEL); if (unlikely(!adapter->hma.phy_addr)) goto free_hma; @@ -4812,7 +4811,7 @@ static int adap_init0(struct adapter *adap, int vpd_skip) /* allocate memory to read the header of the firmware on the * card */ - card_fw = kvzalloc(sizeof(*card_fw), GFP_KERNEL); + card_fw = kvzalloc_obj(*card_fw, GFP_KERNEL); if (!card_fw) { ret = -ENOMEM; goto bye; @@ -5022,15 +5021,15 @@ static int adap_init0(struct adapter *adap, int vpd_skip) adap->sge.egr_sz = val[0] - adap->sge.egr_start + 1; adap->sge.ingr_sz = val[1] - adap->sge.ingr_start + 1; - adap->sge.egr_map = kcalloc(adap->sge.egr_sz, - sizeof(*adap->sge.egr_map), GFP_KERNEL); + adap->sge.egr_map = kzalloc_objs(*adap->sge.egr_map, adap->sge.egr_sz, + GFP_KERNEL); if (!adap->sge.egr_map) { ret = -ENOMEM; goto bye; } - adap->sge.ingr_map = kcalloc(adap->sge.ingr_sz, - sizeof(*adap->sge.ingr_map), GFP_KERNEL); + adap->sge.ingr_map = kzalloc_objs(*adap->sge.ingr_map, + adap->sge.ingr_sz, GFP_KERNEL); if (!adap->sge.ingr_map) { ret = -ENOMEM; goto bye; @@ -5836,7 +5835,7 @@ static int alloc_msix_info(struct adapter *adap, u32 num_vec) { struct msix_info *msix_info; - msix_info = kcalloc(num_vec, sizeof(*msix_info), GFP_KERNEL); + msix_info = kzalloc_objs(*msix_info, num_vec, GFP_KERNEL); if (!msix_info) return -ENOMEM; @@ -5935,7 +5934,7 @@ static int enable_msix(struct adapter *adap) want += EXTRA_VECS; need += EXTRA_VECS; - entries = kmalloc_array(want, sizeof(*entries), GFP_KERNEL); + entries = kmalloc_objs(*entries, want, GFP_KERNEL); if (!entries) return -ENOMEM; @@ -6350,8 +6349,9 @@ static int cxgb4_iov_configure(struct pci_dev *pdev, int num_vfs) return err; } /* Allocate and set up VF Information. */ - adap->vfinfo = kcalloc(pci_sriov_get_totalvfs(pdev), - sizeof(struct vf_info), GFP_KERNEL); + adap->vfinfo = kzalloc_objs(struct vf_info, + pci_sriov_get_totalvfs(pdev), + GFP_KERNEL); if (!adap->vfinfo) { unregister_netdev(adap->port[0]); free_netdev(adap->port[0]); @@ -6604,7 +6604,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_disable_device; } - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) { err = -ENOMEM; goto out_unmap_bar0; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c index 60f4d5b5eb3a..94c8ce39310b 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c @@ -42,7 +42,7 @@ static int cxgb4_mps_ref_inc(struct adapter *adap, const u8 *mac_addr, goto unlock; } } - mps_entry = kzalloc(sizeof(*mps_entry), GFP_ATOMIC); + mps_entry = kzalloc_obj(*mps_entry, GFP_ATOMIC); if (!mps_entry) { ret = -ENOMEM; goto unlock; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c index e2b5554531b5..79db92f3ba62 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c @@ -145,7 +145,7 @@ static void cxgb4_action_natmode_tweak(struct ch_filter_specification *fs, static struct ch_tc_flower_entry *allocate_flower_entry(void) { - struct ch_tc_flower_entry *new = kzalloc(sizeof(*new), GFP_KERNEL); + struct ch_tc_flower_entry *new = kzalloc_obj(*new, GFP_KERNEL); if (new) spin_lock_init(&new->lock); return new; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c index f8dcf0b4abcd..4d53744b2130 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c @@ -531,13 +531,12 @@ int cxgb4_init_tc_matchall(struct adapter *adap) struct cxgb4_tc_matchall *tc_matchall; int ret; - tc_matchall = kzalloc(sizeof(*tc_matchall), GFP_KERNEL); + tc_matchall = kzalloc_obj(*tc_matchall, GFP_KERNEL); if (!tc_matchall) return -ENOMEM; - tc_port_matchall = kcalloc(adap->params.nports, - sizeof(*tc_port_matchall), - GFP_KERNEL); + tc_port_matchall = kzalloc_objs(*tc_port_matchall, adap->params.nports, + GFP_KERNEL); if (!tc_port_matchall) { ret = -ENOMEM; goto out_free_matchall; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c index a2dcd2e24263..9d07540e2955 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c @@ -100,8 +100,7 @@ static int cxgb4_init_eosw_txq(struct net_device *dev, memset(eosw_txq, 0, sizeof(*eosw_txq)); - ring = kcalloc(CXGB4_EOSW_TXQ_DEFAULT_DESC_NUM, - sizeof(*ring), GFP_KERNEL); + ring = kzalloc_objs(*ring, CXGB4_EOSW_TXQ_DEFAULT_DESC_NUM, GFP_KERNEL); if (!ring) return -ENOMEM; @@ -157,15 +156,13 @@ static int cxgb4_mqprio_alloc_hw_resources(struct net_device *dev) /* Allocate ETHOFLD hardware queue structures if not done already */ if (!refcount_read(&adap->tc_mqprio->refcnt)) { - adap->sge.eohw_rxq = kcalloc(adap->sge.eoqsets, - sizeof(struct sge_ofld_rxq), - GFP_KERNEL); + adap->sge.eohw_rxq = kzalloc_objs(struct sge_ofld_rxq, + adap->sge.eoqsets, GFP_KERNEL); if (!adap->sge.eohw_rxq) return -ENOMEM; - adap->sge.eohw_txq = kcalloc(adap->sge.eoqsets, - sizeof(struct sge_eohw_txq), - GFP_KERNEL); + adap->sge.eohw_txq = kzalloc_objs(struct sge_eohw_txq, + adap->sge.eoqsets, GFP_KERNEL); if (!adap->sge.eohw_txq) { kfree(adap->sge.eohw_rxq); return -ENOMEM; @@ -657,12 +654,12 @@ int cxgb4_init_tc_mqprio(struct adapter *adap) int ret = 0; u8 i; - tc_mqprio = kzalloc(sizeof(*tc_mqprio), GFP_KERNEL); + tc_mqprio = kzalloc_obj(*tc_mqprio, GFP_KERNEL); if (!tc_mqprio) return -ENOMEM; - tc_port_mqprio = kcalloc(adap->params.nports, sizeof(*tc_port_mqprio), - GFP_KERNEL); + tc_port_mqprio = kzalloc_objs(*tc_port_mqprio, adap->params.nports, + GFP_KERNEL); if (!tc_port_mqprio) { ret = -ENOMEM; goto out_free_mqprio; @@ -673,8 +670,8 @@ int cxgb4_init_tc_mqprio(struct adapter *adap) tc_mqprio->port_mqprio = tc_port_mqprio; for (i = 0; i < adap->params.nports; i++) { port_mqprio = &tc_mqprio->port_mqprio[i]; - eosw_txq = kcalloc(adap->tids.neotids, sizeof(*eosw_txq), - GFP_KERNEL); + eosw_txq = kzalloc_objs(*eosw_txq, adap->tids.neotids, + GFP_KERNEL); if (!eosw_txq) { ret = -ENOMEM; goto out_free_ports; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c index 8524246fd67e..dbfa657c04b9 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c @@ -501,7 +501,7 @@ struct cxgb4_tc_u32_table *cxgb4_init_tc_u32(struct adapter *adap) if (!max_tids) return NULL; - t = kvzalloc(struct_size(t, table, max_tids), GFP_KERNEL); + t = kvzalloc_flex(*t, table, max_tids, GFP_KERNEL); if (!t) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c index 5c13bcb4550d..c1fe70fc3286 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c @@ -241,7 +241,7 @@ static int cfg_queues_uld(struct adapter *adap, unsigned int uld_type, struct sge_uld_rxq_info *rxq_info; int i, nrxq, ciq_size; - rxq_info = kzalloc(sizeof(*rxq_info), GFP_KERNEL); + rxq_info = kzalloc_obj(*rxq_info, GFP_KERNEL); if (!rxq_info) return -ENOMEM; @@ -269,8 +269,7 @@ static int cfg_queues_uld(struct adapter *adap, unsigned int uld_type, } nrxq = rxq_info->nrxq + rxq_info->nciq; /* total rxq's */ - rxq_info->uldrxq = kcalloc(nrxq, sizeof(struct sge_ofld_rxq), - GFP_KERNEL); + rxq_info->uldrxq = kzalloc_objs(struct sge_ofld_rxq, nrxq, GFP_KERNEL); if (!rxq_info->uldrxq) { kfree(rxq_info); return -ENOMEM; @@ -472,7 +471,7 @@ setup_sge_txq_uld(struct adapter *adap, unsigned int uld_type, (atomic_inc_return(&txq_info->users) > 1)) return 0; - txq_info = kzalloc(sizeof(*txq_info), GFP_KERNEL); + txq_info = kzalloc_obj(*txq_info, GFP_KERNEL); if (!txq_info) return -ENOMEM; if (uld_type == CXGB4_ULD_CRYPTO) { @@ -489,8 +488,8 @@ setup_sge_txq_uld(struct adapter *adap, unsigned int uld_type, i = min_t(int, uld_info->ntxq, num_online_cpus()); txq_info->ntxq = roundup(i, adap->params.nports); } - txq_info->uldtxq = kcalloc(txq_info->ntxq, sizeof(struct sge_uld_txq), - GFP_KERNEL); + txq_info->uldtxq = kzalloc_objs(struct sge_uld_txq, txq_info->ntxq, + GFP_KERNEL); if (!txq_info->uldtxq) { kfree(txq_info); return -ENOMEM; @@ -525,19 +524,17 @@ int t4_uld_mem_alloc(struct adapter *adap) { struct sge *s = &adap->sge; - adap->uld = kcalloc(CXGB4_ULD_MAX, sizeof(*adap->uld), GFP_KERNEL); + adap->uld = kzalloc_objs(*adap->uld, CXGB4_ULD_MAX, GFP_KERNEL); if (!adap->uld) return -ENOMEM; - s->uld_rxq_info = kcalloc(CXGB4_ULD_MAX, - sizeof(struct sge_uld_rxq_info *), - GFP_KERNEL); + s->uld_rxq_info = kzalloc_objs(struct sge_uld_rxq_info *, CXGB4_ULD_MAX, + GFP_KERNEL); if (!s->uld_rxq_info) goto err_uld; - s->uld_txq_info = kcalloc(CXGB4_TX_MAX, - sizeof(struct sge_uld_txq_info *), - GFP_KERNEL); + s->uld_txq_info = kzalloc_objs(struct sge_uld_txq_info *, CXGB4_TX_MAX, + GFP_KERNEL); if (!s->uld_txq_info) goto err_uld_rx; return 0; @@ -805,7 +802,7 @@ void cxgb4_register_uld(enum cxgb4_uld type, if (type >= CXGB4_ULD_MAX) return; - uld_entry = kzalloc(sizeof(*uld_entry), GFP_KERNEL); + uld_entry = kzalloc_obj(*uld_entry, GFP_KERNEL); if (!uld_entry) return; diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c index c02b4e9c06b2..1e2a6bac25ba 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c +++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c @@ -620,7 +620,7 @@ struct l2t_data *t4_init_l2t(unsigned int l2t_start, unsigned int l2t_end) if (l2t_size < L2T_MIN_HASH_BUCKETS) return NULL; - d = kvzalloc(struct_size(d, l2tab, l2t_size), GFP_KERNEL); + d = kvzalloc_flex(*d, l2tab, l2t_size, GFP_KERNEL); if (!d) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/sched.c b/drivers/net/ethernet/chelsio/cxgb4/sched.c index 38a30aeee122..8e73a5c49529 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sched.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sched.c @@ -225,7 +225,7 @@ static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p) if (p->queue < 0 || p->queue >= pi->nqsets) return -ERANGE; - qe = kvzalloc(sizeof(struct sched_queue_entry), GFP_KERNEL); + qe = kvzalloc_obj(struct sched_queue_entry, GFP_KERNEL); if (!qe) return -ENOMEM; @@ -294,7 +294,7 @@ static int t4_sched_flowc_bind(struct port_info *pi, struct ch_sched_flowc *p) if (p->tid < 0 || p->tid >= adap->tids.neotids) return -ERANGE; - fe = kvzalloc(sizeof(*fe), GFP_KERNEL); + fe = kvzalloc_obj(*fe, GFP_KERNEL); if (!fe) return -ENOMEM; @@ -653,7 +653,7 @@ struct sched_table *t4_init_sched(unsigned int sched_size) struct sched_table *s; unsigned int i; - s = kvzalloc(struct_size(s, tab, sched_size), GFP_KERNEL); + s = kvzalloc_flex(*s, tab, sched_size, GFP_KERNEL); if (!s) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/smt.c b/drivers/net/ethernet/chelsio/cxgb4/smt.c index e617e4aabbcc..315c7605622f 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/smt.c +++ b/drivers/net/ethernet/chelsio/cxgb4/smt.c @@ -47,7 +47,7 @@ struct smt_data *t4_init_smt(void) smt_size = SMT_SIZE; - s = kvzalloc(struct_size(s, smtab, smt_size), GFP_KERNEL); + s = kvzalloc_flex(*s, smtab, smt_size, GFP_KERNEL); if (!s) return NULL; s->smt_size = smt_size; diff --git a/drivers/net/ethernet/chelsio/cxgb4/srq.c b/drivers/net/ethernet/chelsio/cxgb4/srq.c index a77d6ac1ee8c..1f7e2dece66c 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/srq.c +++ b/drivers/net/ethernet/chelsio/cxgb4/srq.c @@ -40,7 +40,7 @@ struct srq_data *t4_init_srq(int srq_size) { struct srq_data *s; - s = kvzalloc(sizeof(*s), GFP_KERNEL); + s = kvzalloc_obj(*s, GFP_KERNEL); if (!s) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 2fbe0f059a0b..592f736f6c85 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -288,7 +288,7 @@ static int cxgb4vf_change_mac(struct port_info *pi, unsigned int viid, goto set_hash; } } - new_entry = kzalloc(sizeof(*new_entry), GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, addr); @@ -953,7 +953,7 @@ static int cxgb4vf_mac_sync(struct net_device *netdev, const u8 *mac_addr) * list and program it */ if (uhash || mhash) { - new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC); + new_entry = kzalloc_obj(*new_entry, GFP_ATOMIC); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, mac_addr); @@ -2935,7 +2935,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, /* * Allocate our adapter data structure and attach it to the device. */ - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) { err = -ENOMEM; goto err_release_regions; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c index 074717d4bb16..e89150c0f2c7 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c @@ -104,7 +104,7 @@ static void *ch_ipsec_uld_add(const struct cxgb4_lld_info *infop) pr_info_once("%s - version %s\n", CHIPSEC_DRV_DESC, CHIPSEC_DRV_VERSION); - u_ctx = kzalloc(sizeof(*u_ctx), GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; @@ -295,7 +295,7 @@ static int ch_ipsec_xfrm_add_state(struct net_device *dev, return -ENODEV; } - sa_entry = kzalloc(sizeof(*sa_entry), GFP_KERNEL); + sa_entry = kzalloc_obj(*sa_entry, GFP_KERNEL); if (!sa_entry) { res = -ENOMEM; module_put(THIS_MODULE); diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c index b8ebb56de65e..eb53e3a3ccf9 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -442,7 +442,7 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk, if (u_ctx && u_ctx->detach) goto out; - tx_info = kvzalloc(sizeof(*tx_info), GFP_KERNEL); + tx_info = kvzalloc_obj(*tx_info, GFP_KERNEL); if (!tx_info) goto out; @@ -2117,7 +2117,7 @@ static void *chcr_ktls_uld_add(const struct cxgb4_lld_info *lldi) pr_info_once("%s - version %s\n", CHCR_KTLS_DRV_DESC, CHCR_KTLS_DRV_VERSION); - u_ctx = kzalloc(sizeof(*u_ctx), GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c index ee0154337a9c..caa46c191268 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c @@ -57,7 +57,7 @@ static unsigned char new_state[16] = { static struct chtls_sock *chtls_sock_create(struct chtls_dev *cdev) { - struct chtls_sock *csk = kzalloc(sizeof(*csk), GFP_ATOMIC); + struct chtls_sock *csk = kzalloc_obj(*csk, GFP_ATOMIC); if (!csk) return NULL; @@ -548,7 +548,7 @@ static struct listen_info *listen_hash_add(struct chtls_dev *cdev, struct sock *sk, unsigned int stid) { - struct listen_info *p = kmalloc(sizeof(*p), GFP_KERNEL); + struct listen_info *p = kmalloc_obj(*p, GFP_KERNEL); if (p) { int key = listen_hashfn(sk); @@ -666,7 +666,7 @@ int chtls_listen_start(struct chtls_dev *cdev, struct sock *sk) if (listen_hash_find(cdev, sk) >= 0) /* already have it */ return -EADDRINUSE; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c index daa1ebaef511..511ca3bfce3f 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c @@ -95,7 +95,7 @@ static int chtls_start_listen(struct chtls_dev *cdev, struct sock *sk) return -EADDRNOTAVAIL; sk->sk_backlog_rcv = listen_backlog_rcv; - clisten = kmalloc(sizeof(*clisten), GFP_KERNEL); + clisten = kmalloc_obj(*clisten, GFP_KERNEL); if (!clisten) return -ENOMEM; clisten->cdev = cdev; @@ -114,7 +114,7 @@ static void chtls_stop_listen(struct chtls_dev *cdev, struct sock *sk) if (sk->sk_protocol != IPPROTO_TCP) return; - clisten = kmalloc(sizeof(*clisten), GFP_KERNEL); + clisten = kmalloc_obj(*clisten, GFP_KERNEL); if (!clisten) return; clisten->cdev = cdev; @@ -238,11 +238,11 @@ static void *chtls_uld_add(const struct cxgb4_lld_info *info) struct chtls_dev *cdev; int i, j; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) goto out; - lldi = kzalloc(sizeof(*lldi), GFP_KERNEL); + lldi = kzalloc_obj(*lldi, GFP_KERNEL); if (!lldi) goto out_lldi; diff --git a/drivers/net/ethernet/cisco/enic/enic_clsf.c b/drivers/net/ethernet/cisco/enic/enic_clsf.c index 837f954873ee..581e89da9091 100644 --- a/drivers/net/ethernet/cisco/enic/enic_clsf.c +++ b/drivers/net/ethernet/cisco/enic/enic_clsf.c @@ -235,7 +235,7 @@ int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, struct hlist_head *head; head = &enic->rfs_h.ht_head[tbl_idx]; - d = kmalloc(sizeof(*d), GFP_ATOMIC); + d = kmalloc_obj(*d, GFP_ATOMIC); if (d) { d->fltr_id = n->fltr_id; INIT_HLIST_NODE(&d->node); @@ -257,7 +257,7 @@ int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, goto ret_unlock; } - n = kmalloc(sizeof(*n), GFP_ATOMIC); + n = kmalloc_obj(*n, GFP_ATOMIC); if (!n) { res = -ENOMEM; enic->rfs_h.free++; diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 6bc8dfdb3d4b..14dc4c5aa825 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -2456,35 +2456,35 @@ static void enic_free_enic_resources(struct enic *enic) static int enic_alloc_enic_resources(struct enic *enic) { - enic->wq = kcalloc(enic->wq_avail, sizeof(struct enic_wq), GFP_KERNEL); + enic->wq = kzalloc_objs(struct enic_wq, enic->wq_avail, GFP_KERNEL); if (!enic->wq) goto free_queues; - enic->rq = kcalloc(enic->rq_avail, sizeof(struct enic_rq), GFP_KERNEL); + enic->rq = kzalloc_objs(struct enic_rq, enic->rq_avail, GFP_KERNEL); if (!enic->rq) goto free_queues; - enic->cq = kcalloc(enic->cq_avail, sizeof(struct vnic_cq), GFP_KERNEL); + enic->cq = kzalloc_objs(struct vnic_cq, enic->cq_avail, GFP_KERNEL); if (!enic->cq) goto free_queues; - enic->napi = kcalloc(enic->wq_avail + enic->rq_avail, - sizeof(struct napi_struct), GFP_KERNEL); + enic->napi = kzalloc_objs(struct napi_struct, + enic->wq_avail + enic->rq_avail, GFP_KERNEL); if (!enic->napi) goto free_queues; - enic->msix_entry = kcalloc(enic->intr_avail, sizeof(struct msix_entry), - GFP_KERNEL); + enic->msix_entry = kzalloc_objs(struct msix_entry, enic->intr_avail, + GFP_KERNEL); if (!enic->msix_entry) goto free_queues; - enic->msix = kcalloc(enic->intr_avail, sizeof(struct enic_msix_entry), - GFP_KERNEL); + enic->msix = kzalloc_objs(struct enic_msix_entry, enic->intr_avail, + GFP_KERNEL); if (!enic->msix) goto free_queues; - enic->intr = kcalloc(enic->intr_avail, sizeof(struct vnic_intr), - GFP_KERNEL); + enic->intr = kzalloc_objs(struct vnic_intr, enic->intr_avail, + GFP_KERNEL); if (!enic->intr) goto free_queues; @@ -2737,7 +2737,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) #endif /* Allocate structure for port profiles */ - enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL); + enic->pp = kzalloc_objs(*enic->pp, num_pps, GFP_KERNEL); if (!enic->pp) { err = -ENOMEM; goto err_out_disable_sriov_pp; diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c index 9f6089e81608..5a8a49f8c44f 100644 --- a/drivers/net/ethernet/cisco/enic/vnic_dev.c +++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c @@ -371,7 +371,7 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev) if (vdev->devcmd2) return 0; - vdev->devcmd2 = kzalloc(sizeof(*vdev->devcmd2), GFP_KERNEL); + vdev->devcmd2 = kzalloc_obj(*vdev->devcmd2, GFP_KERNEL); if (!vdev->devcmd2) return -ENOMEM; @@ -1053,7 +1053,7 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev, unsigned int num_bars) { if (!vdev) { - vdev = kzalloc(sizeof(struct vnic_dev), GFP_KERNEL); + vdev = kzalloc_obj(struct vnic_dev, GFP_KERNEL); if (!vdev) return NULL; } diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 6a2004bbe87f..d5608611cee8 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -554,7 +554,7 @@ static int gmac_setup_txqs(struct net_device *netdev) rwptr_reg = port->dma_base + GMAC_SW_TX_QUEUE0_PTR_REG; - skb_tab = kcalloc(len, sizeof(*skb_tab), GFP_KERNEL); + skb_tab = kzalloc_objs(*skb_tab, len, GFP_KERNEL); if (!skb_tab) return -ENOMEM; @@ -940,8 +940,7 @@ static int geth_setup_freeq(struct gemini_ethernet *geth) } /* Allocate a mapping to page look-up index */ - geth->freeq_pages = kcalloc(pages, sizeof(*geth->freeq_pages), - GFP_KERNEL); + geth->freeq_pages = kzalloc_objs(*geth->freeq_pages, pages, GFP_KERNEL); if (!geth->freeq_pages) goto err_freeq; geth->num_freeq_pages = pages; diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 52e10467b3e4..fb9c9d8bc659 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -4207,8 +4207,7 @@ static int be_vf_setup_init(struct be_adapter *adapter) struct be_vf_cfg *vf_cfg; int vf; - adapter->vf_cfg = kcalloc(adapter->num_vfs, sizeof(*vf_cfg), - GFP_KERNEL); + adapter->vf_cfg = kzalloc_objs(*vf_cfg, adapter->num_vfs, GFP_KERNEL); if (!adapter->vf_cfg) return -ENOMEM; @@ -4686,13 +4685,13 @@ static int be_if_create(struct be_adapter *adapter) if (!adapter->pmac_id) return -ENOMEM; - adapter->mc_list = kcalloc(be_max_mc(adapter), - sizeof(*adapter->mc_list), GFP_KERNEL); + adapter->mc_list = kzalloc_objs(*adapter->mc_list, be_max_mc(adapter), + GFP_KERNEL); if (!adapter->mc_list) return -ENOMEM; - adapter->uc_list = kcalloc(be_max_uc(adapter), - sizeof(*adapter->uc_list), GFP_KERNEL); + adapter->uc_list = kzalloc_objs(*adapter->uc_list, be_max_uc(adapter), + GFP_KERNEL); if (!adapter->uc_list) return -ENOMEM; @@ -5048,7 +5047,7 @@ static struct be_cmd_work *be_alloc_work(struct be_adapter *adapter, { struct be_cmd_work *work; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { dev_err(&adapter->pdev->dev, "be_work memory allocation failed\n"); diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index b118407c30e8..eddfde68d503 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -2102,14 +2102,12 @@ int tsnep_enable_xsk(struct tsnep_queue *queue, struct xsk_buff_pool *pool) if (frame_size < TSNEP_XSK_RX_BUF_SIZE) return -EOPNOTSUPP; - queue->rx->page_buffer = kcalloc(TSNEP_RING_SIZE, - sizeof(*queue->rx->page_buffer), - GFP_KERNEL); + queue->rx->page_buffer = kzalloc_objs(*queue->rx->page_buffer, + TSNEP_RING_SIZE, GFP_KERNEL); if (!queue->rx->page_buffer) return -ENOMEM; - queue->rx->xdp_batch = kcalloc(TSNEP_RING_SIZE, - sizeof(*queue->rx->xdp_batch), - GFP_KERNEL); + queue->rx->xdp_batch = kzalloc_objs(*queue->rx->xdp_batch, + TSNEP_RING_SIZE, GFP_KERNEL); if (!queue->rx->xdp_batch) { kfree(queue->rx->page_buffer); queue->rx->page_buffer = NULL; diff --git a/drivers/net/ethernet/engleder/tsnep_rxnfc.c b/drivers/net/ethernet/engleder/tsnep_rxnfc.c index 9ac2a0cf3833..9342dff7a073 100644 --- a/drivers/net/ethernet/engleder/tsnep_rxnfc.c +++ b/drivers/net/ethernet/engleder/tsnep_rxnfc.c @@ -231,7 +231,7 @@ int tsnep_rxnfc_add_rule(struct tsnep_adapter *adapter, return -EINVAL; } - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/engleder/tsnep_selftests.c b/drivers/net/ethernet/engleder/tsnep_selftests.c index 8a9145f93147..1a67d3136456 100644 --- a/drivers/net/ethernet/engleder/tsnep_selftests.c +++ b/drivers/net/ethernet/engleder/tsnep_selftests.c @@ -354,7 +354,7 @@ static bool tsnep_test_taprio(struct tsnep_adapter *adapter) struct tc_taprio_qopt_offload *qopt; int i; - qopt = kzalloc(struct_size(qopt, entries, 255), GFP_KERNEL); + qopt = kzalloc_flex(*qopt, entries, 255, GFP_KERNEL); if (!qopt) return false; for (i = 0; i < 255; i++) @@ -451,7 +451,7 @@ static bool tsnep_test_taprio_change(struct tsnep_adapter *adapter) struct tc_taprio_qopt_offload *qopt; int i; - qopt = kzalloc(struct_size(qopt, entries, 255), GFP_KERNEL); + qopt = kzalloc_flex(*qopt, entries, 255, GFP_KERNEL); if (!qopt) return false; for (i = 0; i < 255; i++) @@ -604,7 +604,7 @@ static bool tsnep_test_taprio_extension(struct tsnep_adapter *adapter) struct tc_taprio_qopt_offload *qopt; int i; - qopt = kzalloc(struct_size(qopt, entries, 255), GFP_KERNEL); + qopt = kzalloc_flex(*qopt, entries, 255, GFP_KERNEL); if (!qopt) return false; for (i = 0; i < 255; i++) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c index ed3fa80af8c3..0071d9538661 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c @@ -421,7 +421,7 @@ static int dpaa_set_coalesce(struct net_device *dev, bool *needs_revert; int cpu, res; - needs_revert = kcalloc(num_possible_cpus(), sizeof(bool), GFP_KERNEL); + needs_revert = kzalloc_objs(bool, num_possible_cpus(), GFP_KERNEL); if (!needs_revert) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c index 76f808d38066..0db00bebb268 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c @@ -237,14 +237,14 @@ int dpaa2_eth_dl_traps_register(struct dpaa2_eth_priv *priv) struct device *dev = net_dev->dev.parent; int err; - dpaa2_eth_trap_data = kzalloc(sizeof(*dpaa2_eth_trap_data), GFP_KERNEL); + dpaa2_eth_trap_data = kzalloc_obj(*dpaa2_eth_trap_data, GFP_KERNEL); if (!dpaa2_eth_trap_data) return -ENOMEM; priv->trap_data = dpaa2_eth_trap_data; - dpaa2_eth_trap_data->trap_items_arr = kcalloc(ARRAY_SIZE(dpaa2_eth_traps_arr), - sizeof(struct dpaa2_eth_trap_item), - GFP_KERNEL); + dpaa2_eth_trap_data->trap_items_arr = kzalloc_objs(struct dpaa2_eth_trap_item, + ARRAY_SIZE(dpaa2_eth_traps_arr), + GFP_KERNEL); if (!dpaa2_eth_trap_data->trap_items_arr) { err = -ENOMEM; goto trap_data_free; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 18d86badd6ea..70691bf85e2d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -920,7 +920,7 @@ static int dpaa2_eth_build_sg_fd(struct dpaa2_eth_priv *priv, if (unlikely(PAGE_SIZE / sizeof(struct scatterlist) < nr_frags + 1)) return -EINVAL; - scl = kmalloc_array(nr_frags + 1, sizeof(struct scatterlist), GFP_ATOMIC); + scl = kmalloc_objs(struct scatterlist, nr_frags + 1, GFP_ATOMIC); if (unlikely(!scl)) return -ENOMEM; @@ -3125,7 +3125,7 @@ static struct dpaa2_eth_channel *dpaa2_eth_alloc_channel(struct dpaa2_eth_priv * struct device *dev = priv->net_dev->dev.parent; int err; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -3392,7 +3392,7 @@ struct dpaa2_eth_bp *dpaa2_eth_allocate_dpbp(struct dpaa2_eth_priv *priv) return ERR_PTR(err); } - bp = kzalloc(sizeof(*bp), GFP_KERNEL); + bp = kzalloc_obj(*bp, GFP_KERNEL); if (!bp) { err = -ENOMEM; goto err_alloc; @@ -4673,7 +4673,7 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv) goto out_put_device; } - mac = kzalloc(sizeof(struct dpaa2_mac), GFP_KERNEL); + mac = kzalloc_obj(struct dpaa2_mac, GFP_KERNEL); if (!mac) { err = -ENOMEM; goto out_put_device; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c index 701a87370737..388f81713f1e 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c @@ -505,7 +505,7 @@ dpaa2_switch_cls_flower_replace_acl(struct dpaa2_switch_filter_block *block, return -ENOMEM; } - acl_entry = kzalloc(sizeof(*acl_entry), GFP_KERNEL); + acl_entry = kzalloc_obj(*acl_entry, GFP_KERNEL); if (!acl_entry) return -ENOMEM; @@ -633,7 +633,7 @@ dpaa2_switch_cls_flower_replace_mirror(struct dpaa2_switch_filter_block *block, } } - mirror_entry = kzalloc(sizeof(*mirror_entry), GFP_KERNEL); + mirror_entry = kzalloc_obj(*mirror_entry, GFP_KERNEL); if (!mirror_entry) return -ENOMEM; @@ -708,7 +708,7 @@ dpaa2_switch_cls_matchall_replace_acl(struct dpaa2_switch_filter_block *block, return -ENOMEM; } - acl_entry = kzalloc(sizeof(*acl_entry), GFP_KERNEL); + acl_entry = kzalloc_obj(*acl_entry, GFP_KERNEL); if (!acl_entry) return -ENOMEM; @@ -780,7 +780,7 @@ dpaa2_switch_cls_matchall_replace_mirror(struct dpaa2_switch_filter_block *block } } - mirror_entry = kzalloc(sizeof(*mirror_entry), GFP_KERNEL); + mirror_entry = kzalloc_obj(*mirror_entry, GFP_KERNEL); if (!mirror_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 66240c340492..2b0cac347fec 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1456,7 +1456,7 @@ static int dpaa2_switch_port_connect_mac(struct ethsw_port_priv *port_priv) goto out_put_device; } - mac = kzalloc(sizeof(*mac), GFP_KERNEL); + mac = kzalloc_obj(*mac, GFP_KERNEL); if (!mac) { err = -ENOMEM; goto out_put_device; @@ -2334,7 +2334,7 @@ static int dpaa2_switch_port_event(struct notifier_block *nb, if (!dpaa2_switch_port_dev_check(dev)) return NOTIFY_DONE; - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (!switchdev_work) return NOTIFY_BAD; @@ -3385,7 +3385,7 @@ static int dpaa2_switch_probe(struct fsl_mc_device *sw_dev) int i, err; /* Allocate switch core*/ - ethsw = kzalloc(sizeof(*ethsw), GFP_KERNEL); + ethsw = kzalloc_obj(*ethsw, GFP_KERNEL); if (!ethsw) return -ENOMEM; @@ -3408,23 +3408,22 @@ static int dpaa2_switch_probe(struct fsl_mc_device *sw_dev) if (err) goto err_free_cmdport; - ethsw->ports = kcalloc(ethsw->sw_attr.num_ifs, sizeof(*ethsw->ports), - GFP_KERNEL); + ethsw->ports = kzalloc_objs(*ethsw->ports, ethsw->sw_attr.num_ifs, + GFP_KERNEL); if (!(ethsw->ports)) { err = -ENOMEM; goto err_teardown; } - ethsw->fdbs = kcalloc(ethsw->sw_attr.num_ifs, sizeof(*ethsw->fdbs), - GFP_KERNEL); + ethsw->fdbs = kzalloc_objs(*ethsw->fdbs, ethsw->sw_attr.num_ifs, + GFP_KERNEL); if (!ethsw->fdbs) { err = -ENOMEM; goto err_free_ports; } - ethsw->filter_blocks = kcalloc(ethsw->sw_attr.num_ifs, - sizeof(*ethsw->filter_blocks), - GFP_KERNEL); + ethsw->filter_blocks = kzalloc_objs(*ethsw->filter_blocks, + ethsw->sw_attr.num_ifs, GFP_KERNEL); if (!ethsw->filter_blocks) { err = -ENOMEM; goto err_free_fdbs; diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index e380a4f39855..d6575a446adf 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2268,7 +2268,7 @@ enetc_alloc_tx_resources(struct enetc_ndev_priv *priv) struct enetc_bdr_resource *tx_res; int i, err; - tx_res = kcalloc(priv->num_tx_rings, sizeof(*tx_res), GFP_KERNEL); + tx_res = kzalloc_objs(*tx_res, priv->num_tx_rings, GFP_KERNEL); if (!tx_res) return ERR_PTR(-ENOMEM); @@ -2340,7 +2340,7 @@ enetc_alloc_rx_resources(struct enetc_ndev_priv *priv, bool extended) struct enetc_bdr_resource *rx_res; int i, err; - rx_res = kcalloc(priv->num_rx_rings, sizeof(*rx_res), GFP_KERNEL); + rx_res = kzalloc_objs(*rx_res, priv->num_rx_rings, GFP_KERNEL); if (!rx_res) return ERR_PTR(-ENOMEM); @@ -2469,7 +2469,7 @@ static int enetc_setup_default_rss_table(struct enetc_si *si, int num_groups) int *rss_table; int i; - rss_table = kmalloc_array(si->num_rss, sizeof(*rss_table), GFP_KERNEL); + rss_table = kmalloc_objs(*rss_table, si->num_rss, GFP_KERNEL); if (!rss_table) return -ENOMEM; @@ -2562,8 +2562,8 @@ int enetc_alloc_si_resources(struct enetc_ndev_priv *priv) { struct enetc_si *si = priv->si; - priv->cls_rules = kcalloc(si->num_fs_entries, sizeof(*priv->cls_rules), - GFP_KERNEL); + priv->cls_rules = kzalloc_objs(*priv->cls_rules, si->num_fs_entries, + GFP_KERNEL); if (!priv->cls_rules) return -ENOMEM; @@ -3454,7 +3454,7 @@ static int enetc_int_vector_init(struct enetc_ndev_priv *priv, int i, struct enetc_bdr *bdr; int j, err; - v = kzalloc(struct_size(v, tx_ring, v_tx_rings), GFP_KERNEL); + v = kzalloc_flex(*v, tx_ring, v_tx_rings, GFP_KERNEL); if (!v) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c index 5850540634b0..689b9f13c5eb 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -192,7 +192,7 @@ static int enetc4_pf_set_uc_exact_filter(struct enetc_pf *pf) goto unlock_netif_addr; } - mac_tbl = kcalloc(mac_cnt, sizeof(*mac_tbl), GFP_ATOMIC); + mac_tbl = kzalloc_objs(*mac_tbl, mac_cnt, GFP_ATOMIC); if (!mac_tbl) { err = -ENOMEM; goto unlock_netif_addr; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index de0fb272c847..eb3a50a94df7 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -814,7 +814,7 @@ static int enetc_init_port_rss_memory(struct enetc_si *si) if (!num_rss) return 0; - rss_table = kcalloc(num_rss, sizeof(*rss_table), GFP_KERNEL); + rss_table = kzalloc_objs(*rss_table, num_rss, GFP_KERNEL); if (!rss_table) return -ENOMEM; @@ -958,8 +958,8 @@ static int enetc_pf_probe(struct pci_dev *pdev, pf->total_vfs = pci_sriov_get_totalvfs(pdev); if (pf->total_vfs) { - pf->vf_state = kcalloc(pf->total_vfs, sizeof(struct enetc_vf_state), - GFP_KERNEL); + pf->vf_state = kzalloc_objs(struct enetc_vf_state, + pf->total_vfs, GFP_KERNEL); if (!pf->vf_state) goto err_alloc_vf_state; } diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c index b8413d3b4f16..dbf35abea7f7 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c @@ -53,7 +53,7 @@ static int enetc_ptp_probe(struct pci_dev *pdev, pci_set_master(pdev); - ptp_qoriq = kzalloc(sizeof(*ptp_qoriq), GFP_KERNEL); + ptp_qoriq = kzalloc_obj(*ptp_qoriq, GFP_KERNEL); if (!ptp_qoriq) { err = -ENOMEM; goto err_alloc_ptp; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index ccf86651455c..6ff65108cc97 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -1153,7 +1153,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, if (!entryg) return -EINVAL; - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; @@ -1266,7 +1266,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, filter->sgi_index = sgi->index; - sfi = kzalloc(sizeof(*sfi), GFP_KERNEL); + sfi = kzalloc_obj(*sfi, GFP_KERNEL); if (!sfi) { err = -ENOMEM; goto free_gate; @@ -1283,7 +1283,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, goto free_sfi; if (entryp->police.burst) { - fmi = kzalloc(sizeof(*fmi), GFP_KERNEL); + fmi = kzalloc_obj(*fmi, GFP_KERNEL); if (!fmi) { err = -ENOMEM; goto free_sfi; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 0d926bf18195..c43539d4bab0 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3952,7 +3952,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev) struct fec_enet_priv_tx_q *txq; for (i = 0; i < fep->num_tx_queues; i++) { - txq = kzalloc(sizeof(*txq), GFP_KERNEL); + txq = kzalloc_obj(*txq, GFP_KERNEL); if (!txq) { ret = -ENOMEM; goto alloc_failed; @@ -3975,8 +3975,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev) } for (i = 0; i < fep->num_rx_queues; i++) { - fep->rx_queue[i] = kzalloc(sizeof(*fep->rx_queue[i]), - GFP_KERNEL); + fep->rx_queue[i] = kzalloc_obj(*fep->rx_queue[i], GFP_KERNEL); if (!fep->rx_queue[i]) { ret = -ENOMEM; goto alloc_failed; @@ -4426,7 +4425,7 @@ fec_alloc_new_rxq_xsk(struct fec_enet_private *fep, int queue, union fec_rx_buffer *buf; int i; - rxq = kzalloc(sizeof(*rxq), GFP_KERNEL); + rxq = kzalloc_obj(*rxq, GFP_KERNEL); if (!rxq) return NULL; @@ -4467,7 +4466,7 @@ fec_alloc_new_rxq_pp(struct fec_enet_private *fep, int queue) union fec_rx_buffer *buf; int i = 0; - rxq = kzalloc(sizeof(*rxq), GFP_KERNEL); + rxq = kzalloc_obj(*rxq, GFP_KERNEL); if (!rxq) return NULL; diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index 3d073f0fae63..f182480909f1 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -74,7 +74,7 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of) bus = mdiobus_alloc(); if (bus == NULL) return -ENOMEM; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) { err = -ENOMEM; goto out_free; diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index 11887458f050..b8d603fb70dc 100644 --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -1688,12 +1688,12 @@ static int fman_config(struct fman *fman) base_addr = fman->dts_params.base_addr; - fman->state = kzalloc(sizeof(*fman->state), GFP_KERNEL); + fman->state = kzalloc_obj(*fman->state, GFP_KERNEL); if (!fman->state) goto err_fm_state; /* Allocate the FM driver's parameters structure */ - fman->cfg = kzalloc(sizeof(*fman->cfg), GFP_KERNEL); + fman->cfg = kzalloc_obj(*fman->cfg, GFP_KERNEL); if (!fman->cfg) goto err_fm_drv; @@ -2697,7 +2697,7 @@ static struct fman *read_dts_node(struct platform_device *of_dev) struct clk *clk; u32 clk_rate; - fman = kzalloc(sizeof(*fman), GFP_KERNEL); + fman = kzalloc_obj(*fman, GFP_KERNEL); if (!fman) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 51402dff72c5..12d739808f16 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1055,7 +1055,7 @@ static int dtsec_add_hash_mac_address(struct fman_mac *dtsec, set_bucket(dtsec->regs, bucket, true); /* Create element to be added to the driver hash table */ - hash_entry = kmalloc(sizeof(*hash_entry), GFP_ATOMIC); + hash_entry = kmalloc_obj(*hash_entry, GFP_ATOMIC); if (!hash_entry) return -ENOMEM; hash_entry->addr = addr; @@ -1348,12 +1348,12 @@ static struct fman_mac *dtsec_config(struct mac_device *mac_dev, struct dtsec_cfg *dtsec_drv_param; /* allocate memory for the UCC GETH data structure. */ - dtsec = kzalloc(sizeof(*dtsec), GFP_KERNEL); + dtsec = kzalloc_obj(*dtsec, GFP_KERNEL); if (!dtsec) return NULL; /* allocate memory for the d_tsec driver parameters data structure. */ - dtsec_drv_param = kzalloc(sizeof(*dtsec_drv_param), GFP_KERNEL); + dtsec_drv_param = kzalloc_obj(*dtsec_drv_param, GFP_KERNEL); if (!dtsec_drv_param) goto err_dtsec; diff --git a/drivers/net/ethernet/freescale/fman/fman_keygen.c b/drivers/net/ethernet/freescale/fman/fman_keygen.c index e73f6ef3c6ee..f4b83b5eb018 100644 --- a/drivers/net/ethernet/freescale/fman/fman_keygen.c +++ b/drivers/net/ethernet/freescale/fman/fman_keygen.c @@ -629,7 +629,7 @@ struct fman_keygen *keygen_init(struct fman_kg_regs __iomem *keygen_regs) int i; /* Allocate memory for KeyGen driver */ - keygen = kzalloc(sizeof(*keygen), GFP_KERNEL); + keygen = kzalloc_obj(*keygen, GFP_KERNEL); if (!keygen) return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index e5d6cddea731..83d53f33abc2 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -224,14 +224,13 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size) struct eth_hash_t *hash; /* Allocate address hash table */ - hash = kmalloc(sizeof(*hash), GFP_KERNEL); + hash = kmalloc_obj(*hash, GFP_KERNEL); if (!hash) return NULL; hash->size = size; - hash->lsts = kmalloc_array(hash->size, sizeof(struct list_head), - GFP_KERNEL); + hash->lsts = kmalloc_objs(struct list_head, hash->size, GFP_KERNEL); if (!hash->lsts) { kfree(hash); return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index c84f0336c94c..f9461bba1a66 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -811,7 +811,7 @@ static int memac_add_hash_mac_address(struct fman_mac *memac, hash = get_mac_addr_hash_code(addr) & HASH_CTRL_ADDR_MASK; /* Create element to be added to the driver hash table */ - hash_entry = kmalloc(sizeof(*hash_entry), GFP_ATOMIC); + hash_entry = kmalloc_obj(*hash_entry, GFP_ATOMIC); if (!hash_entry) return -ENOMEM; hash_entry->addr = addr; @@ -1086,12 +1086,12 @@ static struct fman_mac *memac_config(struct mac_device *mac_dev, struct memac_cfg *memac_drv_param; /* allocate memory for the m_emac data structure */ - memac = kzalloc(sizeof(*memac), GFP_KERNEL); + memac = kzalloc_obj(*memac, GFP_KERNEL); if (!memac) return NULL; /* allocate memory for the m_emac driver parameters data structure */ - memac_drv_param = kzalloc(sizeof(*memac_drv_param), GFP_KERNEL); + memac_drv_param = kzalloc_obj(*memac_drv_param, GFP_KERNEL); if (!memac_drv_param) { memac_free(memac); return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_muram.c b/drivers/net/ethernet/freescale/fman/fman_muram.c index 1ed245a2ee01..eb85c54c9408 100644 --- a/drivers/net/ethernet/freescale/fman/fman_muram.c +++ b/drivers/net/ethernet/freescale/fman/fman_muram.c @@ -40,7 +40,7 @@ struct muram_info *fman_muram_init(phys_addr_t base, size_t size) void __iomem *vaddr; int ret; - muram = kzalloc(sizeof(*muram), GFP_KERNEL); + muram = kzalloc_obj(*muram, GFP_KERNEL); if (!muram) return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index e977389f7088..a3e8c77dbb57 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.c +++ b/drivers/net/ethernet/freescale/fman/fman_port.c @@ -1297,7 +1297,7 @@ int fman_port_config(struct fman_port *port, struct fman_port_params *params) int err; /* Allocate the FM driver's parameters structure */ - port->cfg = kzalloc(sizeof(*port->cfg), GFP_KERNEL); + port->cfg = kzalloc_obj(*port->cfg, GFP_KERNEL); if (!port->cfg) return -EINVAL; @@ -1753,7 +1753,7 @@ static int fman_port_probe(struct platform_device *of_dev) u16 port_speed; u8 port_id; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index fecfca6eba03..05edac07ba6c 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -505,7 +505,7 @@ static int tgec_add_hash_mac_address(struct fman_mac *tgec, hash = (crc >> TGEC_HASH_MCAST_SHIFT) & TGEC_HASH_ADR_MSK; /* Create element to be added to the driver hash table */ - hash_entry = kmalloc(sizeof(*hash_entry), GFP_ATOMIC); + hash_entry = kmalloc_obj(*hash_entry, GFP_ATOMIC); if (!hash_entry) return -ENOMEM; hash_entry->addr = addr; @@ -711,12 +711,12 @@ static struct fman_mac *tgec_config(struct mac_device *mac_dev, struct tgec_cfg *cfg; /* allocate memory for the UCC GETH data structure. */ - tgec = kzalloc(sizeof(*tgec), GFP_KERNEL); + tgec = kzalloc_obj(*tgec, GFP_KERNEL); if (!tgec) return NULL; /* allocate memory for the 10G MAC driver parameters data structure. */ - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) { tgec_free(tgec); return NULL; diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index f563692a4a00..3ba98561f566 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -866,7 +866,7 @@ static int fs_enet_probe(struct platform_device *ofdev) if (!ops) return -EINVAL; - fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); + fpi = kzalloc_obj(*fpi, GFP_KERNEL); if (!fpi) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c index 66038e2a4ae3..2a27dc0b5653 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c @@ -152,7 +152,7 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev) struct bb_info *bitbang; int ret = -ENOMEM; - bitbang = kzalloc(sizeof(struct bb_info), GFP_KERNEL); + bitbang = kzalloc_obj(struct bb_info, GFP_KERNEL); if (!bitbang) goto out; diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c index dec31b638941..512e897cea08 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c @@ -108,7 +108,7 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev) if (!new_bus) goto out; - fec = kzalloc(sizeof(struct fec_info), GFP_KERNEL); + fec = kzalloc_obj(struct fec_info, GFP_KERNEL); if (!fec) goto out_mii; diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 7c0f049f0938..a58cd09b4c0d 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -413,8 +413,8 @@ static int gfar_alloc_tx_queues(struct gfar_private *priv) int i; for (i = 0; i < priv->num_tx_queues; i++) { - priv->tx_queue[i] = kzalloc(sizeof(struct gfar_priv_tx_q), - GFP_KERNEL); + priv->tx_queue[i] = kzalloc_obj(struct gfar_priv_tx_q, + GFP_KERNEL); if (!priv->tx_queue[i]) return -ENOMEM; @@ -431,8 +431,8 @@ static int gfar_alloc_rx_queues(struct gfar_private *priv) int i; for (i = 0; i < priv->num_rx_queues; i++) { - priv->rx_queue[i] = kzalloc(sizeof(struct gfar_priv_rx_q), - GFP_KERNEL); + priv->rx_queue[i] = kzalloc_obj(struct gfar_priv_rx_q, + GFP_KERNEL); if (!priv->rx_queue[i]) return -ENOMEM; @@ -507,8 +507,7 @@ static int gfar_parse_group(struct device_node *np, int i; for (i = 0; i < GFAR_NUM_IRQS; i++) { - grp->irqinfo[i] = kzalloc(sizeof(struct gfar_irqinfo), - GFP_KERNEL); + grp->irqinfo[i] = kzalloc_obj(struct gfar_irqinfo, GFP_KERNEL); if (!grp->irqinfo[i]) return -ENOMEM; } @@ -1376,9 +1375,8 @@ static int gfar_alloc_skb_resources(struct net_device *ndev) for (i = 0; i < priv->num_tx_queues; i++) { tx_queue = priv->tx_queue[i]; tx_queue->tx_skbuff = - kmalloc_array(tx_queue->tx_ring_size, - sizeof(*tx_queue->tx_skbuff), - GFP_KERNEL); + kmalloc_objs(*tx_queue->tx_skbuff, + tx_queue->tx_ring_size, GFP_KERNEL); if (!tx_queue->tx_skbuff) goto cleanup; @@ -1388,9 +1386,9 @@ static int gfar_alloc_skb_resources(struct net_device *ndev) for (i = 0; i < priv->num_rx_queues; i++) { rx_queue = priv->rx_queue[i]; - rx_queue->rx_buff = kcalloc(rx_queue->rx_ring_size, - sizeof(*rx_queue->rx_buff), - GFP_KERNEL); + rx_queue->rx_buff = kzalloc_objs(*rx_queue->rx_buff, + rx_queue->rx_ring_size, + GFP_KERNEL); if (!rx_queue->rx_buff) goto cleanup; } diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 6fa752d3b60d..528a0717084c 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -1241,7 +1241,7 @@ static int gfar_process_filer_changes(struct gfar_private *priv) s32 ret = 0; /* So index is set to zero, too! */ - tab = kzalloc(sizeof(*tab), GFP_KERNEL); + tab = kzalloc_obj(*tab, GFP_KERNEL); if (tab == NULL) return -ENOMEM; @@ -1293,7 +1293,7 @@ static int gfar_add_cls(struct gfar_private *priv, struct ethtool_flow_spec_container *temp, *comp; int ret = 0; - temp = kmalloc(sizeof(*temp), GFP_KERNEL); + temp = kmalloc_obj(*temp, GFP_KERNEL); if (temp == NULL) return -ENOMEM; memcpy(&temp->fs, flow, sizeof(temp->fs)); diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 131d1210dc4a..b1ced6432f26 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2071,8 +2071,8 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) for (j = 0; j < ucc_geth_tx_queues(ug_info); j++) { /* Setup the skbuff rings */ ugeth->tx_skbuff[j] = - kcalloc(ugeth->ug_info->bdRingLenTx[j], - sizeof(struct sk_buff *), GFP_KERNEL); + kzalloc_objs(struct sk_buff *, + ugeth->ug_info->bdRingLenTx[j], GFP_KERNEL); if (ugeth->tx_skbuff[j] == NULL) { if (netif_msg_ifup(ugeth)) @@ -2129,8 +2129,8 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) for (j = 0; j < ucc_geth_rx_queues(ug_info); j++) { /* Setup the skbuff rings */ ugeth->rx_skbuff[j] = - kcalloc(ugeth->ug_info->bdRingLenRx[j], - sizeof(struct sk_buff *), GFP_KERNEL); + kzalloc_objs(struct sk_buff *, + ugeth->ug_info->bdRingLenRx[j], GFP_KERNEL); if (ugeth->rx_skbuff[j] == NULL) { if (netif_msg_ifup(ugeth)) @@ -2677,7 +2677,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) * allocated resources can be released when the channel is freed. */ if (!(ugeth->p_init_enet_param_shadow = - kzalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) { + kzalloc_obj(struct ucc_geth_init_pram, GFP_KERNEL))) { if (netif_msg_ifup(ugeth)) pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/fungible/funcore/fun_dev.c b/drivers/net/ethernet/fungible/funcore/fun_dev.c index ce97b76f9ae0..1c1e66068fed 100644 --- a/drivers/net/ethernet/fungible/funcore/fun_dev.c +++ b/drivers/net/ethernet/fungible/funcore/fun_dev.c @@ -210,7 +210,7 @@ static int fun_init_cmd_ctx(struct fun_dev *fdev, unsigned int ntags) { unsigned int i; - fdev->cmd_ctx = kvcalloc(ntags, sizeof(*fdev->cmd_ctx), GFP_KERNEL); + fdev->cmd_ctx = kvzalloc_objs(*fdev->cmd_ctx, ntags, GFP_KERNEL); if (!fdev->cmd_ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/fungible/funcore/fun_queue.c b/drivers/net/ethernet/fungible/funcore/fun_queue.c index d07ee3e4f52a..200983145606 100644 --- a/drivers/net/ethernet/fungible/funcore/fun_queue.c +++ b/drivers/net/ethernet/fungible/funcore/fun_queue.c @@ -405,7 +405,7 @@ void fun_free_queue(struct fun_queue *funq) struct fun_queue *fun_alloc_queue(struct fun_dev *fdev, int qid, const struct fun_queue_alloc_req *req) { - struct fun_queue *funq = kzalloc(sizeof(*funq), GFP_KERNEL); + struct fun_queue *funq = kzalloc_obj(*funq, GFP_KERNEL); if (!funq) return NULL; diff --git a/drivers/net/ethernet/fungible/funeth/funeth_main.c b/drivers/net/ethernet/fungible/funeth/funeth_main.c index 792cddac6f1b..2255f203674a 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_main.c +++ b/drivers/net/ethernet/fungible/funeth/funeth_main.c @@ -424,7 +424,7 @@ static struct funeth_txq **alloc_xdpqs(struct net_device *dev, unsigned int nqs, unsigned int i; int err; - xdpqs = kcalloc(nqs, sizeof(*xdpqs), GFP_KERNEL); + xdpqs = kzalloc_objs(*xdpqs, nqs, GFP_KERNEL); if (!xdpqs) return ERR_PTR(-ENOMEM); @@ -486,7 +486,7 @@ static int fun_alloc_rings(struct net_device *netdev, struct fun_qset *qset) if (err) return err; - rxqs = kcalloc(qset->ntxqs + qset->nrxqs, sizeof(*rxqs), GFP_KERNEL); + rxqs = kzalloc_objs(*rxqs, qset->ntxqs + qset->nrxqs, GFP_KERNEL); if (!rxqs) return -ENOMEM; @@ -1175,7 +1175,7 @@ static int fun_init_vports(struct fun_ethdev *ed, unsigned int n) if (ed->num_vports) return -EINVAL; - ed->vport_info = kvcalloc(n, sizeof(*ed->vport_info), GFP_KERNEL); + ed->vport_info = kvzalloc_objs(*ed->vport_info, n, GFP_KERNEL); if (!ed->vport_info) return -ENOMEM; ed->num_vports = n; @@ -1833,7 +1833,7 @@ static int fun_create_ports(struct fun_ethdev *ed, unsigned int nports) return -EINVAL; } - ed->netdevs = kcalloc(nports, sizeof(*ed->netdevs), GFP_KERNEL); + ed->netdevs = kzalloc_objs(*ed->netdevs, nports, GFP_KERNEL); if (!ed->netdevs) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c index 42a0a6f7b296..a2b5aeee0831 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -176,8 +176,8 @@ gve_get_ethtool_stats(struct net_device *netdev, priv = netdev_priv(netdev); num_tx_queues = gve_num_tx_queues(priv); report_stats = priv->stats_report->stats; - rx_qid_to_stats_idx = kmalloc_array(priv->rx_cfg.num_queues, - sizeof(int), GFP_KERNEL); + rx_qid_to_stats_idx = kmalloc_objs(int, priv->rx_cfg.num_queues, + GFP_KERNEL); if (!rx_qid_to_stats_idx) return; for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) { @@ -185,8 +185,7 @@ gve_get_ethtool_stats(struct net_device *netdev, if (!gve_rx_was_added_to_block(priv, ring)) num_stopped_rxqs++; } - tx_qid_to_stats_idx = kmalloc_array(num_tx_queues, - sizeof(int), GFP_KERNEL); + tx_qid_to_stats_idx = kmalloc_objs(int, num_tx_queues, GFP_KERNEL); if (!tx_qid_to_stats_idx) { kfree(rx_qid_to_stats_idx); return; diff --git a/drivers/net/ethernet/google/gve/gve_flow_rule.c b/drivers/net/ethernet/google/gve/gve_flow_rule.c index 0bb8cd1876a3..f97b124b1c6a 100644 --- a/drivers/net/ethernet/google/gve/gve_flow_rule.c +++ b/drivers/net/ethernet/google/gve/gve_flow_rule.c @@ -269,7 +269,7 @@ int gve_add_flow_rule(struct gve_priv *priv, struct ethtool_rxnfc *cmd) if (!priv->max_flow_rules) return -EOPNOTSUPP; - rule = kvzalloc(sizeof(*rule), GFP_KERNEL); + rule = kvzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index 0ee864b0afe0..75c4748f9de2 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -151,8 +151,8 @@ static int gve_alloc_flow_rule_caches(struct gve_priv *priv) return 0; flow_rules_cache->rules_cache = - kvcalloc(GVE_FLOW_RULES_CACHE_SIZE, sizeof(*flow_rules_cache->rules_cache), - GFP_KERNEL); + kvzalloc_objs(*flow_rules_cache->rules_cache, + GVE_FLOW_RULES_CACHE_SIZE, GFP_KERNEL); if (!flow_rules_cache->rules_cache) { dev_err(&priv->pdev->dev, "Cannot alloc flow rules cache\n"); return -ENOMEM; @@ -485,8 +485,8 @@ static int gve_alloc_notify_blocks(struct gve_priv *priv) int i, j; int err; - priv->msix_vectors = kvcalloc(num_vecs_requested, - sizeof(*priv->msix_vectors), GFP_KERNEL); + priv->msix_vectors = kvzalloc_objs(*priv->msix_vectors, + num_vecs_requested, GFP_KERNEL); if (!priv->msix_vectors) return -ENOMEM; for (i = 0; i < num_vecs_requested; i++) @@ -666,8 +666,8 @@ static int gve_setup_device_resources(struct gve_priv *priv) } if (!gve_is_gqi(priv)) { - priv->ptype_lut_dqo = kvzalloc(sizeof(*priv->ptype_lut_dqo), - GFP_KERNEL); + priv->ptype_lut_dqo = kvzalloc_obj(*priv->ptype_lut_dqo, + GFP_KERNEL); if (!priv->ptype_lut_dqo) { err = -ENOMEM; goto abort_with_stats_report; @@ -1090,17 +1090,17 @@ struct gve_queue_page_list *gve_alloc_queue_page_list(struct gve_priv *priv, int err; int i; - qpl = kvzalloc(sizeof(*qpl), GFP_KERNEL); + qpl = kvzalloc_obj(*qpl, GFP_KERNEL); if (!qpl) return NULL; qpl->id = id; qpl->num_entries = 0; - qpl->pages = kvcalloc(pages, sizeof(*qpl->pages), GFP_KERNEL); + qpl->pages = kvzalloc_objs(*qpl->pages, pages, GFP_KERNEL); if (!qpl->pages) goto abort; - qpl->page_buses = kvcalloc(pages, sizeof(*qpl->page_buses), GFP_KERNEL); + qpl->page_buses = kvzalloc_objs(*qpl->page_buses, pages, GFP_KERNEL); if (!qpl->page_buses) goto abort; diff --git a/drivers/net/ethernet/google/gve/gve_ptp.c b/drivers/net/ethernet/google/gve/gve_ptp.c index de42fc2c19a1..eb836ebcbd60 100644 --- a/drivers/net/ethernet/google/gve/gve_ptp.c +++ b/drivers/net/ethernet/google/gve/gve_ptp.c @@ -70,7 +70,7 @@ static int gve_ptp_init(struct gve_priv *priv) struct gve_ptp *ptp; int err; - priv->ptp = kzalloc(sizeof(*priv->ptp), GFP_KERNEL); + priv->ptp = kzalloc_obj(*priv->ptp, GFP_KERNEL); if (!priv->ptp) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c index ec424d2f4f57..197513da0fe5 100644 --- a/drivers/net/ethernet/google/gve/gve_rx.c +++ b/drivers/net/ethernet/google/gve/gve_rx.c @@ -390,8 +390,8 @@ int gve_rx_alloc_rings_gqi(struct gve_priv *priv, int err = 0; int i, j; - rx = kvcalloc(cfg->qcfg_rx->max_queues, sizeof(struct gve_rx_ring), - GFP_KERNEL); + rx = kvzalloc_objs(struct gve_rx_ring, cfg->qcfg_rx->max_queues, + GFP_KERNEL); if (!rx) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_rx_dqo.c b/drivers/net/ethernet/google/gve/gve_rx_dqo.c index 63a96106a693..282c10e50d53 100644 --- a/drivers/net/ethernet/google/gve/gve_rx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_rx_dqo.c @@ -320,8 +320,8 @@ int gve_rx_alloc_rings_dqo(struct gve_priv *priv, int err; int i; - rx = kvcalloc(cfg->qcfg_rx->max_queues, sizeof(struct gve_rx_ring), - GFP_KERNEL); + rx = kvzalloc_objs(struct gve_rx_ring, cfg->qcfg_rx->max_queues, + GFP_KERNEL); if (!rx) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c index 97efc8d27e6f..d2023cee1f35 100644 --- a/drivers/net/ethernet/google/gve/gve_tx.c +++ b/drivers/net/ethernet/google/gve/gve_tx.c @@ -345,8 +345,8 @@ int gve_tx_alloc_rings_gqi(struct gve_priv *priv, return -EINVAL; } - tx = kvcalloc(cfg->qcfg->max_queues, sizeof(struct gve_tx_ring), - GFP_KERNEL); + tx = kvzalloc_objs(struct gve_tx_ring, cfg->qcfg->max_queues, + GFP_KERNEL); if (!tx) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c index 28e85730f785..44980f61e330 100644 --- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c @@ -266,9 +266,8 @@ static int gve_tx_qpl_buf_init(struct gve_tx_ring *tx) tx->dqo.qpl->num_entries; int i; - tx->dqo.tx_qpl_buf_next = kvcalloc(num_tx_qpl_bufs, - sizeof(tx->dqo.tx_qpl_buf_next[0]), - GFP_KERNEL); + tx->dqo.tx_qpl_buf_next = kvzalloc_objs(tx->dqo.tx_qpl_buf_next[0], + num_tx_qpl_bufs, GFP_KERNEL); if (!tx->dqo.tx_qpl_buf_next) return -ENOMEM; @@ -337,9 +336,9 @@ static int gve_tx_alloc_ring_dqo(struct gve_priv *priv, num_pending_packets /= 2; tx->dqo.num_pending_packets = min_t(int, num_pending_packets, S16_MAX); - tx->dqo.pending_packets = kvcalloc(tx->dqo.num_pending_packets, - sizeof(tx->dqo.pending_packets[0]), - GFP_KERNEL); + tx->dqo.pending_packets = kvzalloc_objs(tx->dqo.pending_packets[0], + tx->dqo.num_pending_packets, + GFP_KERNEL); if (!tx->dqo.pending_packets) goto err; @@ -417,8 +416,8 @@ int gve_tx_alloc_rings_dqo(struct gve_priv *priv, return -EINVAL; } - tx = kvcalloc(cfg->qcfg->max_queues, sizeof(struct gve_tx_ring), - GFP_KERNEL); + tx = kvzalloc_objs(struct gve_tx_ring, cfg->qcfg->max_queues, + GFP_KERNEL); if (!tx) return -ENOMEM; diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c index d4293f76d69d..5c3b4eaf144b 100644 --- a/drivers/net/ethernet/hisilicon/hns/hnae.c +++ b/drivers/net/ethernet/hisilicon/hns/hnae.c @@ -208,8 +208,8 @@ hnae_init_ring(struct hnae_queue *q, struct hnae_ring *ring, int flags) assert(ring->next_to_use == 0); assert(ring->next_to_clean == 0); - ring->desc_cb = kcalloc(ring->desc_num, sizeof(ring->desc_cb[0]), - GFP_KERNEL); + ring->desc_cb = kzalloc_objs(ring->desc_cb[0], ring->desc_num, + GFP_KERNEL); if (!ring->desc_cb) { ret = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c index 8ce910f8d0cc..a4f4c4d14035 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c @@ -81,8 +81,7 @@ static struct hnae_handle *hns_ae_get_handle(struct hnae_ae_dev *dev, vfnum_per_port = hns_ae_get_vf_num_per_port(dsaf_dev, port_id); qnum_per_vf = hns_ae_get_q_num_per_vf(dsaf_dev, port_id); - vf_cb = kzalloc(struct_size(vf_cb, ae_handle.qs, qnum_per_vf), - GFP_KERNEL); + vf_cb = kzalloc_flex(*vf_cb, ae_handle.qs, qnum_per_vf, GFP_KERNEL); if (unlikely(!vf_cb)) { dev_err(dsaf_dev->dev, "malloc vf_cb fail!\n"); ae_handle = ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 6d746a9fb687..dbc6d5c6644c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -1099,8 +1099,8 @@ static struct hns3_enet_ring *hns3_backup_ringparam(struct hns3_nic_priv *priv) struct hns3_enet_ring *tmp_rings; int i; - tmp_rings = kcalloc(handle->kinfo.num_tqps * 2, - sizeof(struct hns3_enet_ring), GFP_KERNEL); + tmp_rings = kzalloc_objs(struct hns3_enet_ring, + handle->kinfo.num_tqps * 2, GFP_KERNEL); if (!tmp_rings) return NULL; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index b76d25074e99..5a7ce1eea30c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -800,7 +800,7 @@ hclge_dbg_dump_reg_tqp(struct hclge_dev *hdev, if (ret) return ret; - desc_src = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc_src) return -ENOMEM; @@ -852,7 +852,7 @@ hclge_dbg_dump_reg_common(struct hclge_dev *hdev, if (ret) return ret; - desc_src = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc_src) return -ENOMEM; @@ -2278,7 +2278,7 @@ static int hclge_dbg_get_imp_stats_info(struct seq_file *s, void *data) return -EINVAL; } - desc_src = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc_src) return -ENOMEM; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c index cc7f46c0b35f..02d21c5e8e0e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c @@ -2481,7 +2481,7 @@ static int hclge_handle_all_ras_errors(struct hclge_dev *hdev) return ret; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -3038,7 +3038,7 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev, goto out; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -3127,7 +3127,7 @@ void hclge_handle_all_hns_hw_errors(struct hnae3_ae_dev *ae_dev) return; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); if (!desc) return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index edec994981c7..80aa566ad31f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -492,7 +492,7 @@ static int hclge_mac_update_stats_complete(struct hclge_dev *hdev) /* This may be called inside atomic sections, * so GFP_ATOMIC is more suitable here */ - desc = kcalloc(desc_num, sizeof(struct hclge_desc), GFP_ATOMIC); + desc = kzalloc_objs(struct hclge_desc, desc_num, GFP_ATOMIC); if (!desc) return -ENOMEM; @@ -2418,7 +2418,7 @@ int hclge_buffer_alloc(struct hclge_dev *hdev) struct hclge_pkt_buf_alloc *pkt_buf; int ret; - pkt_buf = kzalloc(sizeof(*pkt_buf), GFP_KERNEL); + pkt_buf = kzalloc_obj(*pkt_buf, GFP_KERNEL); if (!pkt_buf) return -ENOMEM; @@ -6582,7 +6582,7 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle, if (ret) return ret; - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -7124,7 +7124,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, return -ENOSPC; } - rule = kzalloc(sizeof(*rule), GFP_ATOMIC); + rule = kzalloc_obj(*rule, GFP_ATOMIC); if (!rule) { spin_unlock_bh(&hdev->fd_rule_lock); return -ENOMEM; @@ -7410,7 +7410,7 @@ static int hclge_add_cls_flower(struct hnae3_handle *handle, return ret; } - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -8578,7 +8578,7 @@ int hclge_update_mac_list(struct hclge_vport *vport, return -ENOENT; } - mac_node = kzalloc(sizeof(*mac_node), GFP_ATOMIC); + mac_node = kzalloc_obj(*mac_node, GFP_ATOMIC); if (!mac_node) { spin_unlock_bh(&vport->mac_list_lock); return -ENOMEM; @@ -8986,7 +8986,7 @@ static void hclge_sync_vport_mac_table(struct hclge_vport *vport, list_move_tail(&mac_node->node, &tmp_del_list); break; case HCLGE_MAC_TO_ADD: - new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC); + new_node = kzalloc_obj(*new_node, GFP_ATOMIC); if (!new_node) goto stop_traverse; ether_addr_copy(new_node->mac_addr, mac_node->mac_addr); @@ -9328,7 +9328,7 @@ int hclge_update_mac_node_for_dev_addr(struct hclge_vport *vport, new_node = hclge_find_mac_node(list, new_addr); if (!new_node) { - new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC); + new_node = kzalloc_obj(*new_node, GFP_ATOMIC); if (!new_node) return -ENOMEM; @@ -10093,7 +10093,7 @@ static void hclge_add_vport_vlan_table(struct hclge_vport *vport, u16 vlan_id, } } - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) { mutex_unlock(&hdev->vport_lock); return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index b7d4e06a55d4..7801c39df38d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -212,7 +212,7 @@ static int hclge_get_ring_chain_from_mbx( cur_chain = ring_chain; for (i = 1; i < ring_num; i++) { - new_chain = kzalloc(sizeof(*new_chain), GFP_KERNEL); + new_chain = kzalloc_obj(*new_chain, GFP_KERNEL); if (!new_chain) goto err; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c index 8c057192aae6..3bd3195d789e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c @@ -190,7 +190,7 @@ static int hclge_get_32_bit_regs(struct hclge_dev *hdev, u32 regs_num, nodata_num = HCLGE_32_BIT_DESC_NODATA_LEN; cmd_num = DIV_ROUND_UP(regs_num + nodata_num, HCLGE_32_BIT_REG_RTN_DATANUM); - desc = kcalloc(cmd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, cmd_num, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -244,7 +244,7 @@ static int hclge_get_64_bit_regs(struct hclge_dev *hdev, u32 regs_num, nodata_len = HCLGE_64_BIT_DESC_NODATA_LEN; cmd_num = DIV_ROUND_UP(regs_num + nodata_len, HCLGE_64_BIT_REG_RTN_DATANUM); - desc = kcalloc(cmd_num, sizeof(struct hclge_desc), GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, cmd_num, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -394,7 +394,7 @@ static int hclge_get_dfx_reg_len(struct hclge_dev *hdev, int *len) int ret; u32 i; - bd_num_list = kcalloc(dfx_reg_type_num, sizeof(int), GFP_KERNEL); + bd_num_list = kzalloc_objs(int, dfx_reg_type_num, GFP_KERNEL); if (!bd_num_list) return -ENOMEM; @@ -455,7 +455,7 @@ static int hclge_get_dfx_reg(struct hclge_dev *hdev, void *data) int ret; u32 i; - bd_num_list = kcalloc(dfx_reg_type_num, sizeof(int), GFP_KERNEL); + bd_num_list = kzalloc_objs(int, dfx_reg_type_num, GFP_KERNEL); if (!bd_num_list) return -ENOMEM; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 70327a73dee3..0cc911e6c732 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -977,7 +977,7 @@ static int hclgevf_update_mac_list(struct hnae3_handle *handle, return -ENOENT; } - mac_node = kzalloc(sizeof(*mac_node), GFP_ATOMIC); + mac_node = kzalloc_obj(*mac_node, GFP_ATOMIC); if (!mac_node) { spin_unlock_bh(&hdev->mac_table.mac_list_lock); return -ENOMEM; @@ -1156,7 +1156,7 @@ static void hclgevf_sync_mac_list(struct hclgevf_dev *hdev, list_move_tail(&mac_node->node, &tmp_del_list); break; case HCLGEVF_MAC_TO_ADD: - new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC); + new_node = kzalloc_obj(*new_node, GFP_ATOMIC); if (!new_node) goto stop_traverse; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c b/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c index 061952c6c21a..39ceba2820bf 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c @@ -88,7 +88,7 @@ static int hinic_dbg_get_func_table(struct hinic_dev *nic_dev, int idx) int ret = ~0; int err; - read_data = kzalloc(sizeof(*read_data), GFP_KERNEL); + read_data = kzalloc_obj(*read_data, GFP_KERNEL); if (!read_data) return ~0; @@ -182,7 +182,7 @@ static int create_dbg_files(struct hinic_dev *dev, enum hinic_dbg_type type, voi struct hinic_debug_priv *tmp; int i; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c index 300bc267a259..f4d34fdbc014 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c @@ -130,7 +130,7 @@ static int hinic_flash_fw(struct hinic_devlink_priv *priv, const u8 *data, int total_len_flag = 0; int err; - fw_update_msg = kzalloc(sizeof(*fw_update_msg), GFP_KERNEL); + fw_update_msg = kzalloc_obj(*fw_update_msg, GFP_KERNEL); if (!fw_update_msg) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c index f28528df5aac..d4787347d0c5 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c @@ -1392,7 +1392,7 @@ static void hinic_get_ethtool_stats(struct net_device *netdev, sizeof(u64)) ? *(u64 *)p : *(u32 *)p; } - port_stats = kzalloc(sizeof(*port_stats), GFP_KERNEL); + port_stats = kzalloc_obj(*port_stats, GFP_KERNEL); if (!port_stats) { memset(&data[i], 0, ARRAY_SIZE(hinic_port_stats) * sizeof(*data)); diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c index 97c1584dc05b..f8aef328f8c0 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c @@ -487,7 +487,7 @@ static void recv_mbox_handler(struct hinic_mbox_func_to_func *func_to_func, if (!rcv_mbox_temp->buf_out) goto err_alloc_rcv_mbox_buf; - mbox_work = kzalloc(sizeof(*mbox_work), GFP_KERNEL); + mbox_work = kzalloc_obj(*mbox_work, GFP_KERNEL); if (!mbox_work) goto err_alloc_mbox_work; @@ -603,7 +603,7 @@ static bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func "The mailbox random id(0x%x) of func_id(0x%x) doesn't match with pf reservation(0x%x)\n", random_id, src, func_to_func->vf_mbx_rand_id[src]); - mbox_work = kzalloc(sizeof(*mbox_work), GFP_KERNEL); + mbox_work = kzalloc_obj(*mbox_work, GFP_KERNEL); if (!mbox_work) return false; @@ -1402,7 +1402,7 @@ int hinic_func_to_func_init(struct hinic_hwdev *hwdev) int err; pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); - func_to_func = kzalloc(sizeof(*func_to_func), GFP_KERNEL); + func_to_func = kzalloc_obj(*func_to_func, GFP_KERNEL); if (!func_to_func) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c index 4aa1f433ed24..8bda0a26a345 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c @@ -441,7 +441,7 @@ static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt, { struct hinic_mgmt_msg_handle_work *mgmt_work = NULL; - mgmt_work = kzalloc(sizeof(*mgmt_work), GFP_KERNEL); + mgmt_work = kzalloc_obj(*mgmt_work, GFP_KERNEL); if (!mgmt_work) return; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c index 486fb0e20bef..868e666cc392 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_port.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c @@ -1032,7 +1032,7 @@ int hinic_get_phy_port_stats(struct hinic_dev *nic_dev, struct pci_dev *pdev = hwif->pdev; int err; - port_stats = kzalloc(sizeof(*port_stats), GFP_KERNEL); + port_stats = kzalloc_obj(*port_stats, GFP_KERNEL); if (!port_stats) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c index 86720bb119e9..ab38da085ae5 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c @@ -123,7 +123,7 @@ struct hinic3_cmd_buf *hinic3_alloc_cmd_buf(struct hinic3_hwdev *hwdev) cmdqs = hwdev->cmdqs; - cmd_buf = kmalloc(sizeof(*cmd_buf), GFP_ATOMIC); + cmd_buf = kmalloc_obj(*cmd_buf, GFP_ATOMIC); if (!cmd_buf) return NULL; @@ -614,8 +614,8 @@ static int init_cmdq(struct hinic3_cmdq *cmdq, struct hinic3_hwdev *hwdev, spin_lock_init(&cmdq->cmdq_lock); - cmdq->cmd_infos = kcalloc(cmdq->wq.q_depth, sizeof(*cmdq->cmd_infos), - GFP_KERNEL); + cmdq->cmd_infos = kzalloc_objs(*cmdq->cmd_infos, cmdq->wq.q_depth, + GFP_KERNEL); if (!cmdq->cmd_infos) { err = -ENOMEM; return err; @@ -738,7 +738,7 @@ static int init_cmdqs(struct hinic3_hwdev *hwdev) { struct hinic3_cmdqs *cmdqs; - cmdqs = kzalloc(sizeof(*cmdqs), GFP_KERNEL); + cmdqs = kzalloc_obj(*cmdqs, GFP_KERNEL); if (!cmdqs) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c index a2c3962116d5..78f50dc6513a 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c @@ -648,7 +648,7 @@ int hinic3_aeqs_init(struct hinic3_hwdev *hwdev, u16 num_aeqs, u16 q_id; int err; - aeqs = kzalloc(sizeof(*aeqs), GFP_KERNEL); + aeqs = kzalloc_obj(*aeqs, GFP_KERNEL); if (!aeqs) return -ENOMEM; @@ -720,7 +720,7 @@ int hinic3_ceqs_init(struct hinic3_hwdev *hwdev, u16 num_ceqs, u16 q_id; int err; - ceqs = kzalloc(sizeof(*ceqs), GFP_KERNEL); + ceqs = kzalloc_obj(*ceqs, GFP_KERNEL); if (!ceqs) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_filter.c b/drivers/net/ethernet/huawei/hinic3/hinic3_filter.c index 6349d71f574b..6d378c86aabd 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_filter.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_filter.c @@ -75,7 +75,7 @@ static void hinic3_add_filter(struct net_device *netdev, struct hinic3_nic_dev *nic_dev = netdev_priv(netdev); struct hinic3_mac_filter *f; - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return; @@ -110,7 +110,7 @@ hinic3_mac_filter_entry_clone(const struct hinic3_mac_filter *src) { struct hinic3_mac_filter *f; - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return NULL; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c index 7827c1f626db..c65dec383535 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c @@ -86,8 +86,7 @@ static int hinic3_init_irq_info(struct hinic3_hwdev *hwdev) } irq_info = &cfg_mgmt->irq_info; - irq_info->irq = kcalloc(intr_num, sizeof(struct hinic3_irq), - GFP_KERNEL); + irq_info->irq = kzalloc_objs(struct hinic3_irq, intr_num, GFP_KERNEL); if (!irq_info->irq) return -ENOMEM; @@ -130,7 +129,7 @@ int hinic3_init_cfg_mgmt(struct hinic3_hwdev *hwdev) struct hinic3_cfg_mgmt_info *cfg_mgmt; int err; - cfg_mgmt = kzalloc(sizeof(*cfg_mgmt), GFP_KERNEL); + cfg_mgmt = kzalloc_obj(*cfg_mgmt, GFP_KERNEL); if (!cfg_mgmt) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c index 7906d4057cf2..f0b402b792b9 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c @@ -528,7 +528,7 @@ int hinic3_init_hwdev(struct pci_dev *pdev) struct hinic3_hwdev *hwdev; int err; - hwdev = kzalloc(sizeof(*hwdev), GFP_KERNEL); + hwdev = kzalloc_obj(*hwdev, GFP_KERNEL); if (!hwdev) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c index 801f48e241f8..c1eeedbe0c15 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c @@ -432,7 +432,7 @@ int hinic3_init_hwif(struct hinic3_hwdev *hwdev) u32 attr1, attr4, attr5; int err; - hwif = kzalloc(sizeof(*hwif), GFP_KERNEL); + hwif = kzalloc_obj(*hwif, GFP_KERNEL); if (!hwif) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c index 87413e192f10..b5d026c95d39 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c @@ -60,7 +60,7 @@ static struct hinic3_adev *hinic3_add_one_adev(struct hinic3_hwdev *hwdev, const char *svc_name; int ret; - hadev = kzalloc(sizeof(*hadev), GFP_KERNEL); + hadev = kzalloc_obj(*hadev, GFP_KERNEL); if (!hadev) return NULL; @@ -250,7 +250,7 @@ static int hinic3_pci_init(struct pci_dev *pdev) struct hinic3_pcidev *pci_adapter; int err; - pci_adapter = kzalloc(sizeof(*pci_adapter), GFP_KERNEL); + pci_adapter = kzalloc_obj(*pci_adapter, GFP_KERNEL); if (!pci_adapter) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c index 6275d94dfefd..3c9efe037793 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c @@ -57,9 +57,8 @@ static int hinic3_init_intr_coalesce(struct net_device *netdev) { struct hinic3_nic_dev *nic_dev = netdev_priv(netdev); - nic_dev->intr_coalesce = kcalloc(nic_dev->max_qps, - sizeof(*nic_dev->intr_coalesce), - GFP_KERNEL); + nic_dev->intr_coalesce = kzalloc_objs(*nic_dev->intr_coalesce, + nic_dev->max_qps, GFP_KERNEL); if (!nic_dev->intr_coalesce) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c index c871fd0fb109..8c7bb38cc57d 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c @@ -320,7 +320,7 @@ static int hinic3_init_func_mbox_msg_channel(struct hinic3_hwdev *hwdev) int err; mbox = hwdev->mbox; - mbox->func_msg = kzalloc(sizeof(*mbox->func_msg), GFP_KERNEL); + mbox->func_msg = kzalloc_obj(*mbox->func_msg, GFP_KERNEL); if (!mbox->func_msg) return -ENOMEM; @@ -412,7 +412,7 @@ int hinic3_init_mbox(struct hinic3_hwdev *hwdev) struct hinic3_mbox *mbox; int err; - mbox = kzalloc(sizeof(*mbox), GFP_KERNEL); + mbox = kzalloc_obj(*mbox, GFP_KERNEL); if (!mbox) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c b/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c index be2a2ae75fc0..29422ac14bb8 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c @@ -120,7 +120,7 @@ static void hinic3_init_mgmt_msg_work(struct hinic3_msg_pf_to_mgmt *pf_to_mgmt, { struct mgmt_msg_handle_work *mgmt_work; - mgmt_work = kmalloc(sizeof(*mgmt_work), GFP_KERNEL); + mgmt_work = kmalloc_obj(*mgmt_work, GFP_KERNEL); if (!mgmt_work) return; @@ -252,7 +252,7 @@ int hinic3_pf_to_mgmt_init(struct hinic3_hwdev *hwdev) struct hinic3_msg_pf_to_mgmt *pf_to_mgmt; int err; - pf_to_mgmt = kzalloc(sizeof(*pf_to_mgmt), GFP_KERNEL); + pf_to_mgmt = kzalloc_obj(*pf_to_mgmt, GFP_KERNEL); if (!pf_to_mgmt) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c index 75adfe897e81..7830bff30859 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c @@ -99,9 +99,8 @@ static int hinic3_setup_num_qps(struct net_device *netdev) nic_dev->num_qp_irq = 0; - nic_dev->qps_msix_entries = kcalloc(nic_dev->max_qps, - sizeof(struct msix_entry), - GFP_KERNEL); + nic_dev->qps_msix_entries = kzalloc_objs(struct msix_entry, + nic_dev->max_qps, GFP_KERNEL); if (!nic_dev->qps_msix_entries) return -ENOMEM; @@ -127,20 +126,20 @@ static int hinic3_alloc_txrxq_resources(struct net_device *netdev, { int err; - q_params->txqs_res = kcalloc(q_params->num_qps, - sizeof(*q_params->txqs_res), GFP_KERNEL); + q_params->txqs_res = kzalloc_objs(*q_params->txqs_res, + q_params->num_qps, GFP_KERNEL); if (!q_params->txqs_res) return -ENOMEM; - q_params->rxqs_res = kcalloc(q_params->num_qps, - sizeof(*q_params->rxqs_res), GFP_KERNEL); + q_params->rxqs_res = kzalloc_objs(*q_params->rxqs_res, + q_params->num_qps, GFP_KERNEL); if (!q_params->rxqs_res) { err = -ENOMEM; goto err_free_txqs_res_arr; } - q_params->irq_cfg = kcalloc(q_params->num_qps, - sizeof(*q_params->irq_cfg), GFP_KERNEL); + q_params->irq_cfg = kzalloc_objs(*q_params->irq_cfg, q_params->num_qps, + GFP_KERNEL); if (!q_params->irq_cfg) { err = -ENOMEM; goto err_free_rxqs_res_arr; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c index 90887d2bb127..0ded1000b369 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c @@ -212,7 +212,7 @@ int hinic3_init_nic_io(struct hinic3_nic_dev *nic_dev) struct hinic3_nic_io *nic_io; int err; - nic_io = kzalloc(sizeof(*nic_io), GFP_KERNEL); + nic_io = kzalloc_obj(*nic_io, GFP_KERNEL); if (!nic_io) return -ENOMEM; @@ -408,13 +408,13 @@ int hinic3_alloc_qps(struct hinic3_nic_dev *nic_dev, if (qp_params->num_qps > nic_io->max_qps || !qp_params->num_qps) return -EINVAL; - sqs = kcalloc(qp_params->num_qps, sizeof(*sqs), GFP_KERNEL); + sqs = kzalloc_objs(*sqs, qp_params->num_qps, GFP_KERNEL); if (!sqs) { err = -ENOMEM; goto err_out; } - rqs = kcalloc(qp_params->num_qps, sizeof(*rqs), GFP_KERNEL); + rqs = kzalloc_objs(*rqs, qp_params->num_qps, GFP_KERNEL); if (!rqs) { err = -ENOMEM; goto err_free_sqs; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c b/drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c index fab9011de9ad..9c00d1ed825a 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c @@ -44,8 +44,8 @@ int hinic3_queue_pages_alloc(struct hinic3_hwdev *hwdev, u32 pg_idx; int err; - qpages->pages = kcalloc(qpages->num_pages, sizeof(qpages->pages[0]), - GFP_KERNEL); + qpages->pages = kzalloc_objs(qpages->pages[0], qpages->num_pages, + GFP_KERNEL); if (!qpages->pages) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c index 159c291fa293..f2d43beab444 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c @@ -66,7 +66,7 @@ int hinic3_alloc_rxqs(struct net_device *netdev) struct hinic3_rxq *rxq; u16 q_id; - nic_dev->rxqs = kcalloc(num_rxqs, sizeof(*nic_dev->rxqs), GFP_KERNEL); + nic_dev->rxqs = kzalloc_objs(*nic_dev->rxqs, num_rxqs, GFP_KERNEL); if (!nic_dev->rxqs) return -ENOMEM; @@ -419,8 +419,8 @@ int hinic3_alloc_rxqs_res(struct net_device *netdev, u16 num_rq, for (idx = 0; idx < num_rq; idx++) { rqres = &rxqs_res[idx]; - rqres->rx_info = kcalloc(rq_depth, sizeof(*rqres->rx_info), - GFP_KERNEL); + rqres->rx_info = kzalloc_objs(*rqres->rx_info, rq_depth, + GFP_KERNEL); if (!rqres->rx_info) goto err_free_rqres; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c index 6d3dc930ca97..8c988df8963e 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c @@ -48,7 +48,7 @@ int hinic3_alloc_txqs(struct net_device *netdev) struct pci_dev *pdev = nic_dev->pdev; struct hinic3_txq *txq; - nic_dev->txqs = kcalloc(num_txqs, sizeof(*nic_dev->txqs), GFP_KERNEL); + nic_dev->txqs = kzalloc_objs(*nic_dev->txqs, num_txqs, GFP_KERNEL); if (!nic_dev->txqs) return -ENOMEM; @@ -681,14 +681,14 @@ int hinic3_alloc_txqs_res(struct net_device *netdev, u16 num_sq, for (idx = 0; idx < num_sq; idx++) { tqres = &txqs_res[idx]; - tqres->tx_info = kcalloc(sq_depth, sizeof(*tqres->tx_info), - GFP_KERNEL); + tqres->tx_info = kzalloc_objs(*tqres->tx_info, sq_depth, + GFP_KERNEL); if (!tqres->tx_info) goto err_free_tqres; - tqres->bds = kcalloc(sq_depth * HINIC3_BDS_PER_SQ_WQEBB + - HINIC3_MAX_SQ_SGE, sizeof(*tqres->bds), - GFP_KERNEL); + tqres->bds = kzalloc_objs(*tqres->bds, + sq_depth * HINIC3_BDS_PER_SQ_WQEBB + HINIC3_MAX_SQ_SGE, + GFP_KERNEL); if (!tqres->bds) { kfree(tqres->tx_info); goto err_free_tqres; diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 9b006bc353a1..a2d7f5468590 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -173,7 +173,7 @@ static void ehea_update_firmware_handles(void) num_portres * EHEA_NUM_PORTRES_FW_HANDLES; if (num_fw_handles) { - arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL); + arr = kzalloc_objs(*arr, num_fw_handles, GFP_KERNEL); if (!arr) goto out; /* Keep the existing array */ } else @@ -256,7 +256,7 @@ static void ehea_update_bcmc_registrations(void) } if (num_registrations) { - arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC); + arr = kzalloc_objs(*arr, num_registrations, GFP_ATOMIC); if (!arr) goto out; /* Keep the existing array */ } else @@ -1487,7 +1487,7 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, pr->send_cq->attr.act_nr_of_cqes, pr->recv_cq->attr.act_nr_of_cqes); - init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL); + init_attr = kzalloc_obj(*init_attr, GFP_KERNEL); if (!init_attr) { ret = -ENOMEM; pr_err("no mem for ehea_qp_init_attr\n"); @@ -1899,7 +1899,7 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) struct ehea_mc_list *ehea_mcl_entry; u64 hret; - ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC); + ehea_mcl_entry = kzalloc_obj(*ehea_mcl_entry, GFP_ATOMIC); if (!ehea_mcl_entry) return; @@ -2968,7 +2968,7 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, port->msg_enable = netif_msg_init(msg_level, EHEA_MSG_DEFAULT); - port->mc_list = kzalloc(sizeof(struct ehea_mc_list), GFP_KERNEL); + port->mc_list = kzalloc_obj(struct ehea_mc_list, GFP_KERNEL); if (!port->mc_list) { ret = -ENOMEM; goto out_free_ethdev; diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c index db45373ea31c..e9d51e65efe8 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c @@ -114,7 +114,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, int ret; void *vpage; - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) goto out_nomem; @@ -235,7 +235,7 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter, void *vpage; struct ehea_eq *eq; - eq = kzalloc(sizeof(*eq), GFP_KERNEL); + eq = kzalloc_obj(*eq, GFP_KERNEL); if (!eq) return NULL; @@ -404,7 +404,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, u32 wqe_size_in_bytes_rq2, wqe_size_in_bytes_rq3; - qp = kzalloc(sizeof(*qp), GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return NULL; @@ -542,7 +542,7 @@ static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, { if (!ehea_top_bmap->dir[dir]) { ehea_top_bmap->dir[dir] = - kzalloc(sizeof(struct ehea_dir_bmap), GFP_KERNEL); + kzalloc_obj(struct ehea_dir_bmap, GFP_KERNEL); if (!ehea_top_bmap->dir[dir]) return -ENOMEM; } @@ -553,7 +553,7 @@ static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) { if (!ehea_bmap->top[top]) { ehea_bmap->top[top] = - kzalloc(sizeof(struct ehea_top_bmap), GFP_KERNEL); + kzalloc_obj(struct ehea_top_bmap, GFP_KERNEL); if (!ehea_bmap->top[top]) return -ENOMEM; } @@ -613,7 +613,7 @@ static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add return 0; if (!ehea_bmap) { - ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); + ehea_bmap = kzalloc_obj(struct ehea_bmap, GFP_KERNEL); if (!ehea_bmap) return -ENOMEM; } diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 6f0821f1e798..3108bf50576f 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -169,7 +169,7 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) if (!pool->free_map) return -1; - pool->dma_addr = kcalloc(pool->size, sizeof(dma_addr_t), GFP_KERNEL); + pool->dma_addr = kzalloc_objs(dma_addr_t, pool->size, GFP_KERNEL); if (!pool->dma_addr) { kfree(pool->free_map); pool->free_map = NULL; diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 3808148c1fc7..1241be315d58 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -932,16 +932,14 @@ static void release_stats_buffers(struct ibmvnic_adapter *adapter) static int init_stats_buffers(struct ibmvnic_adapter *adapter) { adapter->tx_stats_buffers = - kcalloc(IBMVNIC_MAX_QUEUES, - sizeof(struct ibmvnic_tx_queue_stats), - GFP_KERNEL); + kzalloc_objs(struct ibmvnic_tx_queue_stats, + IBMVNIC_MAX_QUEUES, GFP_KERNEL); if (!adapter->tx_stats_buffers) return -ENOMEM; adapter->rx_stats_buffers = - kcalloc(IBMVNIC_MAX_QUEUES, - sizeof(struct ibmvnic_rx_queue_stats), - GFP_KERNEL); + kzalloc_objs(struct ibmvnic_rx_queue_stats, + IBMVNIC_MAX_QUEUES, GFP_KERNEL); if (!adapter->rx_stats_buffers) return -ENOMEM; @@ -1096,9 +1094,8 @@ static int init_rx_pools(struct net_device *netdev) /* Allocate/populate the pools. */ release_rx_pools(adapter); - adapter->rx_pool = kcalloc(num_pools, - sizeof(struct ibmvnic_rx_pool), - GFP_KERNEL); + adapter->rx_pool = kzalloc_objs(struct ibmvnic_rx_pool, num_pools, + GFP_KERNEL); if (!adapter->rx_pool) { dev_err(dev, "Failed to allocate rx pools\n"); return -ENOMEM; @@ -1120,17 +1117,15 @@ static int init_rx_pools(struct net_device *netdev) rx_pool->index = i; rx_pool->buff_size = ALIGN(buff_size, L1_CACHE_BYTES); - rx_pool->free_map = kcalloc(rx_pool->size, sizeof(int), - GFP_KERNEL); + rx_pool->free_map = kzalloc_objs(int, rx_pool->size, GFP_KERNEL); if (!rx_pool->free_map) { dev_err(dev, "Couldn't alloc free_map %d\n", i); rc = -ENOMEM; goto out_release; } - rx_pool->rx_buff = kcalloc(rx_pool->size, - sizeof(struct ibmvnic_rx_buff), - GFP_KERNEL); + rx_pool->rx_buff = kzalloc_objs(struct ibmvnic_rx_buff, + rx_pool->size, GFP_KERNEL); if (!rx_pool->rx_buff) { dev_err(dev, "Couldn't alloc rx buffers\n"); rc = -ENOMEM; @@ -1243,13 +1238,12 @@ static int init_one_tx_pool(struct net_device *netdev, { int i; - tx_pool->tx_buff = kcalloc(pool_size, - sizeof(struct ibmvnic_tx_buff), - GFP_KERNEL); + tx_pool->tx_buff = kzalloc_objs(struct ibmvnic_tx_buff, pool_size, + GFP_KERNEL); if (!tx_pool->tx_buff) return -ENOMEM; - tx_pool->free_map = kcalloc(pool_size, sizeof(int), GFP_KERNEL); + tx_pool->free_map = kzalloc_objs(int, pool_size, GFP_KERNEL); if (!tx_pool->free_map) { kfree(tx_pool->tx_buff); tx_pool->tx_buff = NULL; @@ -1341,13 +1335,13 @@ static int init_tx_pools(struct net_device *netdev) pool_size = adapter->req_tx_entries_per_subcrq; num_pools = adapter->num_active_tx_scrqs; - adapter->tx_pool = kcalloc(num_pools, - sizeof(struct ibmvnic_tx_pool), GFP_KERNEL); + adapter->tx_pool = kzalloc_objs(struct ibmvnic_tx_pool, num_pools, + GFP_KERNEL); if (!adapter->tx_pool) return -ENOMEM; - adapter->tso_pool = kcalloc(num_pools, - sizeof(struct ibmvnic_tx_pool), GFP_KERNEL); + adapter->tso_pool = kzalloc_objs(struct ibmvnic_tx_pool, num_pools, + GFP_KERNEL); /* To simplify release_tx_pools() ensure that ->tx_pool and * ->tso_pool are either both NULL or both non-NULL. */ @@ -1471,8 +1465,8 @@ static int init_napi(struct ibmvnic_adapter *adapter) { int i; - adapter->napi = kcalloc(adapter->req_rx_queues, - sizeof(struct napi_struct), GFP_KERNEL); + adapter->napi = kzalloc_objs(struct napi_struct, adapter->req_rx_queues, + GFP_KERNEL); if (!adapter->napi) return -ENOMEM; @@ -1859,7 +1853,7 @@ static int init_resources(struct ibmvnic_adapter *adapter) if (rc) return rc; - adapter->vpd = kzalloc(sizeof(*adapter->vpd), GFP_KERNEL); + adapter->vpd = kzalloc_obj(*adapter->vpd, GFP_KERNEL); if (!adapter->vpd) return -ENOMEM; @@ -3450,7 +3444,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, } } - rwi = kzalloc(sizeof(*rwi), GFP_ATOMIC); + rwi = kzalloc_obj(*rwi, GFP_ATOMIC); if (!rwi) { ret = ENOMEM; goto err; @@ -4055,7 +4049,7 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter struct ibmvnic_sub_crq_queue *scrq; int rc; - scrq = kzalloc(sizeof(*scrq), GFP_KERNEL); + scrq = kzalloc_obj(*scrq, GFP_KERNEL); if (!scrq) return NULL; @@ -4447,7 +4441,7 @@ static int init_sub_crqs(struct ibmvnic_adapter *adapter) total_queues = adapter->req_tx_queues + adapter->req_rx_queues; - allqueues = kcalloc(total_queues, sizeof(*allqueues), GFP_KERNEL); + allqueues = kzalloc_objs(*allqueues, total_queues, GFP_KERNEL); if (!allqueues) return -ENOMEM; @@ -4486,8 +4480,8 @@ static int init_sub_crqs(struct ibmvnic_adapter *adapter) } } - adapter->tx_scrq = kcalloc(adapter->req_tx_queues, - sizeof(*adapter->tx_scrq), GFP_KERNEL); + adapter->tx_scrq = kzalloc_objs(*adapter->tx_scrq, + adapter->req_tx_queues, GFP_KERNEL); if (!adapter->tx_scrq) goto tx_failed; @@ -4497,8 +4491,8 @@ static int init_sub_crqs(struct ibmvnic_adapter *adapter) adapter->num_active_tx_scrqs++; } - adapter->rx_scrq = kcalloc(adapter->req_rx_queues, - sizeof(*adapter->rx_scrq), GFP_KERNEL); + adapter->rx_scrq = kzalloc_objs(*adapter->rx_scrq, + adapter->req_rx_queues, GFP_KERNEL); if (!adapter->rx_scrq) goto rx_failed; diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 5c56c1edd492..321a15a220a6 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c @@ -2156,7 +2156,7 @@ static int e100_rx_alloc_list(struct nic *nic) nic->rx_to_use = nic->rx_to_clean = NULL; nic->ru_running = RU_UNINITIALIZED; - if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_KERNEL))) + if (!(nic->rxs = kzalloc_objs(struct rx, count, GFP_KERNEL))) return -ENOMEM; for (rx = nic->rxs, i = 0; i < count; rx++, i++) { diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c index 726365c567ef..132644a387ef 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c @@ -582,13 +582,13 @@ static int e1000_set_ringparam(struct net_device *netdev, rx_old = adapter->rx_ring; err = -ENOMEM; - txdr = kcalloc(adapter->num_tx_queues, sizeof(struct e1000_tx_ring), - GFP_KERNEL); + txdr = kzalloc_objs(struct e1000_tx_ring, adapter->num_tx_queues, + GFP_KERNEL); if (!txdr) goto err_alloc_tx; - rxdr = kcalloc(adapter->num_rx_queues, sizeof(struct e1000_rx_ring), - GFP_KERNEL); + rxdr = kzalloc_objs(struct e1000_rx_ring, adapter->num_rx_queues, + GFP_KERNEL); if (!rxdr) goto err_alloc_rx; @@ -984,8 +984,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) if (!txdr->count) txdr->count = E1000_DEFAULT_TXD; - txdr->buffer_info = kcalloc(txdr->count, sizeof(struct e1000_tx_buffer), - GFP_KERNEL); + txdr->buffer_info = kzalloc_objs(struct e1000_tx_buffer, txdr->count, + GFP_KERNEL); if (!txdr->buffer_info) { ret_val = 1; goto err_nomem; @@ -1043,8 +1043,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) if (!rxdr->count) rxdr->count = E1000_DEFAULT_RXD; - rxdr->buffer_info = kcalloc(rxdr->count, sizeof(struct e1000_rx_buffer), - GFP_KERNEL); + rxdr->buffer_info = kzalloc_objs(struct e1000_rx_buffer, rxdr->count, + GFP_KERNEL); if (!rxdr->buffer_info) { ret_val = 5; goto err_nomem; diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 7f078ec9c14c..b0ecd3413ffb 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c @@ -1322,13 +1322,13 @@ static int e1000_sw_init(struct e1000_adapter *adapter) **/ static int e1000_alloc_queues(struct e1000_adapter *adapter) { - adapter->tx_ring = kcalloc(adapter->num_tx_queues, - sizeof(struct e1000_tx_ring), GFP_KERNEL); + adapter->tx_ring = kzalloc_objs(struct e1000_tx_ring, + adapter->num_tx_queues, GFP_KERNEL); if (!adapter->tx_ring) return -ENOMEM; - adapter->rx_ring = kcalloc(adapter->num_rx_queues, - sizeof(struct e1000_rx_ring), GFP_KERNEL); + adapter->rx_ring = kzalloc_objs(struct e1000_rx_ring, + adapter->num_rx_queues, GFP_KERNEL); if (!adapter->rx_ring) { kfree(adapter->tx_ring); return -ENOMEM; diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 7b1ac90b3de4..21094a03189a 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -1173,8 +1173,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) if (!tx_ring->count) tx_ring->count = E1000_DEFAULT_TXD; - tx_ring->buffer_info = kcalloc(tx_ring->count, - sizeof(struct e1000_buffer), GFP_KERNEL); + tx_ring->buffer_info = kzalloc_objs(struct e1000_buffer, tx_ring->count, + GFP_KERNEL); if (!tx_ring->buffer_info) { ret_val = 1; goto err_nomem; @@ -1234,8 +1234,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) if (!rx_ring->count) rx_ring->count = E1000_DEFAULT_RXD; - rx_ring->buffer_info = kcalloc(rx_ring->count, - sizeof(struct e1000_buffer), GFP_KERNEL); + rx_ring->buffer_info = kzalloc_objs(struct e1000_buffer, rx_ring->count, + GFP_KERNEL); if (!rx_ring->buffer_info) { ret_val = 5; goto err_nomem; diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index ddbe2f7d8112..edd503b79f98 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -2050,10 +2050,9 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter) case E1000E_INT_MODE_MSIX: if (adapter->flags & FLAG_HAS_MSIX) { adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */ - adapter->msix_entries = kcalloc(adapter->num_vectors, - sizeof(struct - msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, + adapter->num_vectors, + GFP_KERNEL); if (adapter->msix_entries) { struct e1000_adapter *a = adapter; @@ -2370,9 +2369,9 @@ int e1000e_setup_rx_resources(struct e1000_ring *rx_ring) for (i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - buffer_info->ps_pages = kcalloc(PS_PAGE_BUFFERS, - sizeof(struct e1000_ps_page), - GFP_KERNEL); + buffer_info->ps_pages = kzalloc_objs(struct e1000_ps_page, + PS_PAGE_BUFFERS, + GFP_KERNEL); if (!buffer_info->ps_pages) goto err_pages; } diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c index b8c15b837fda..9f2620a14484 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c @@ -1597,7 +1597,7 @@ static int fm10k_alloc_q_vector(struct fm10k_intfc *interface, ring_count = txr_count + rxr_count; /* allocate q_vector and rings */ - q_vector = kzalloc(struct_size(q_vector, ring, ring_count), GFP_KERNEL); + q_vector = kzalloc_flex(*q_vector, ring, ring_count, GFP_KERNEL); if (!q_vector) return -ENOMEM; @@ -1825,8 +1825,8 @@ static int fm10k_init_msix_capability(struct fm10k_intfc *interface) v_budget = min_t(int, v_budget, hw->mac.max_msix_vectors); /* A failure in MSI-X entry allocation is fatal. */ - interface->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), - GFP_KERNEL); + interface->msix_entries = kzalloc_objs(struct msix_entry, v_budget, + GFP_KERNEL); if (!interface->msix_entries) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index 34ab5ff9823b..c86701be4364 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c @@ -649,7 +649,7 @@ int fm10k_queue_vlan_request(struct fm10k_intfc *interface, /* This must be atomic since we may be called while the netdev * addr_list_lock is held */ - request = kzalloc(sizeof(*request), GFP_ATOMIC); + request = kzalloc_obj(*request, GFP_ATOMIC); if (!request) return -ENOMEM; @@ -688,7 +688,7 @@ int fm10k_queue_mac_request(struct fm10k_intfc *interface, u16 glort, /* This must be atomic since we may be called while the netdev * addr_list_lock is held */ - request = kzalloc(sizeof(*request), GFP_ATOMIC); + request = kzalloc_obj(*request, GFP_ATOMIC); if (!request) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index 518bc738ea3b..dacebf773adf 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -291,7 +291,7 @@ static int i40e_register_auxiliary_dev(struct i40e_info *ldev, const char *name) struct auxiliary_device *aux_dev; int ret; - i40e_aux_dev = kzalloc(sizeof(*i40e_aux_dev), GFP_KERNEL); + i40e_aux_dev = kzalloc_obj(*i40e_aux_dev, GFP_KERNEL); if (!i40e_aux_dev) return -ENOMEM; @@ -337,7 +337,7 @@ static void i40e_client_add_instance(struct i40e_pf *pf) struct i40e_client_instance *cdev = NULL; struct netdev_hw_addr *mac = NULL; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return; @@ -466,7 +466,7 @@ int i40e_lan_add_device(struct i40e_pf *pf) goto out; } } - ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); + ldev = kzalloc_obj(*ldev, GFP_KERNEL); if (!ldev) { ret = -ENOMEM; goto out; @@ -566,8 +566,8 @@ static int i40e_client_setup_qvlist(struct i40e_info *ldev, struct i40e_qv_info *qv_info; u32 v_idx, i, reg_idx, reg; - ldev->qvlist_info = kzalloc(struct_size(ldev->qvlist_info, qv_info, - qvlist_info->num_vectors), GFP_KERNEL); + ldev->qvlist_info = kzalloc_flex(*ldev->qvlist_info, qv_info, + qvlist_info->num_vectors, GFP_KERNEL); if (!ldev->qvlist_info) return -ENOMEM; ldev->qvlist_info->num_vectors = qvlist_info->num_vectors; diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index c17b5d290f0a..8056fa9d9cf2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c @@ -983,9 +983,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp, int i, ret; u16 switch_id; - bw_data = kzalloc(sizeof( - struct i40e_aqc_query_port_ets_config_resp), - GFP_KERNEL); + bw_data = kzalloc_obj(struct i40e_aqc_query_port_ets_config_resp, + GFP_KERNEL); if (!bw_data) { ret = -ENOMEM; goto command_write_done; @@ -1229,7 +1228,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, struct libie_aq_desc *desc; int ret; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) goto command_write_done; cnt = sscanf(&cmd_buf[11], @@ -1277,7 +1276,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, u8 *buff; int ret; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) goto command_write_done; cnt = sscanf(&cmd_buf[20], diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 6a47ea0927e9..3ddc29db8dc5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2120,8 +2120,8 @@ static int i40e_set_ringparam(struct net_device *netdev, netdev_info(netdev, "Changing Tx descriptor count from %d to %d.\n", vsi->tx_rings[0]->count, new_tx_count); - tx_rings = kcalloc(tx_alloc_queue_pairs, - sizeof(struct i40e_ring), GFP_KERNEL); + tx_rings = kzalloc_objs(struct i40e_ring, tx_alloc_queue_pairs, + GFP_KERNEL); if (!tx_rings) { err = -ENOMEM; goto done; @@ -2159,8 +2159,8 @@ static int i40e_set_ringparam(struct net_device *netdev, netdev_info(netdev, "Changing Rx descriptor count from %d to %d\n", vsi->rx_rings[0]->count, new_rx_count); - rx_rings = kcalloc(vsi->alloc_queue_pairs, - sizeof(struct i40e_ring), GFP_KERNEL); + rx_rings = kzalloc_objs(struct i40e_ring, + vsi->alloc_queue_pairs, GFP_KERNEL); if (!rx_rings) { err = -ENOMEM; goto free_tx; @@ -3976,7 +3976,7 @@ static int i40e_add_flex_offset(struct list_head *flex_pit_list, { struct i40e_flex_pit *new_pit, *entry; - new_pit = kzalloc(sizeof(*entry), GFP_KERNEL); + new_pit = kzalloc_obj(*entry, GFP_KERNEL); if (!new_pit) return -ENOMEM; @@ -4867,7 +4867,7 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, q_index = ring; } - input = kzalloc(sizeof(*input), GFP_KERNEL); + input = kzalloc_obj(*input, GFP_KERNEL); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 02de186dcc8f..05dc5ddc918c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -1462,7 +1462,7 @@ static int i40e_correct_mac_vlan_filters(struct i40e_vsi *vsi, return -ENOMEM; /* Create a temporary i40e_new_mac_filter */ - new = kzalloc(sizeof(*new), GFP_ATOMIC); + new = kzalloc_obj(*new, GFP_ATOMIC); if (!new) return -ENOMEM; @@ -1574,7 +1574,7 @@ static int i40e_correct_vf_mac_vlan_filters(struct i40e_vsi *vsi, if (!add_head) return -ENOMEM; /* Create a temporary i40e_new_mac_filter */ - new_mac = kzalloc(sizeof(*new_mac), GFP_ATOMIC); + new_mac = kzalloc_obj(*new_mac, GFP_ATOMIC); if (!new_mac) return -ENOMEM; new_mac->f = add_head; @@ -1651,7 +1651,7 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi, f = i40e_find_filter(vsi, macaddr, vlan); if (!f) { - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return NULL; @@ -2606,7 +2606,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) } if (f->state == I40E_FILTER_NEW) { /* Create a temporary i40e_new_mac_filter */ - new = kzalloc(sizeof(*new), GFP_ATOMIC); + new = kzalloc_obj(*new, GFP_ATOMIC); if (!new) goto err_no_memory_locked; @@ -6686,7 +6686,7 @@ static int i40e_configure_queue_channels(struct i40e_vsi *vsi) vsi->tc_seid_map[0] = vsi->seid; for (i = 1; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (vsi->tc_config.enabled_tc & BIT(i)) { - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) { ret = -ENOMEM; goto err_free; @@ -7962,7 +7962,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, /* Create channels for macvlans */ INIT_LIST_HEAD(&vsi->macvlan_list); for (i = 0; i < macvlan_cnt; i++) { - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) { ret = -ENOMEM; goto err_free; @@ -8074,7 +8074,7 @@ static void *i40e_fwd_add(struct net_device *netdev, struct net_device *vdev) return ERR_PTR(-EBUSY); /* create the fwd struct */ - fwd = kzalloc(sizeof(*fwd), GFP_KERNEL); + fwd = kzalloc_obj(*fwd, GFP_KERNEL); if (!fwd) return ERR_PTR(-ENOMEM); @@ -8835,7 +8835,7 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi, clear_bit(I40E_FLAG_FD_SB_TO_CLOUD_FILTER, vsi->back->flags); } - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; @@ -11540,7 +11540,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type) } pf->next_vsi = ++i; - vsi = kzalloc(sizeof(*vsi), GFP_KERNEL); + vsi = kzalloc_obj(*vsi, GFP_KERNEL); if (!vsi) { ret = -ENOMEM; goto unlock_pf; @@ -11711,7 +11711,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) /* Set basic values in the rings to be used later during open() */ for (i = 0; i < vsi->alloc_queue_pairs; i++) { /* allocate space for both Tx and Rx in one shot */ - ring = kcalloc(qpv, sizeof(struct i40e_ring), GFP_KERNEL); + ring = kzalloc_objs(struct i40e_ring, qpv, GFP_KERNEL); if (!ring) goto err_out; @@ -11914,8 +11914,7 @@ static int i40e_init_msix(struct i40e_pf *pf) "Calculation of remaining vectors underflowed. This is an accounting bug when determining total MSI-X vectors.\n"); v_budget += pf->num_lan_msix; - pf->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), - GFP_KERNEL); + pf->msix_entries = kzalloc_objs(struct msix_entry, v_budget, GFP_KERNEL); if (!pf->msix_entries) return -ENOMEM; @@ -12028,7 +12027,7 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx) struct i40e_q_vector *q_vector; /* allocate q_vector */ - q_vector = kzalloc(sizeof(struct i40e_q_vector), GFP_KERNEL); + q_vector = kzalloc_obj(struct i40e_q_vector, GFP_KERNEL); if (!q_vector) return -ENOMEM; @@ -14581,7 +14580,7 @@ static int i40e_veb_mem_alloc(struct i40e_pf *pf) goto err_alloc_veb; /* out of VEB slots! */ } - veb = kzalloc(sizeof(*veb), GFP_KERNEL); + veb = kzalloc_obj(*veb, GFP_KERNEL); if (!veb) { ret = -ENOMEM; goto err_alloc_veb; @@ -15441,8 +15440,7 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw) pf->num_alloc_vsi = pf->hw.func_caps.num_vsis; /* Set up the vsi struct and our local tracking of the MAIN PF vsi. */ - pf->vsi = kcalloc(pf->num_alloc_vsi, sizeof(struct i40e_vsi *), - GFP_KERNEL); + pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi, GFP_KERNEL); if (!pf->vsi) { err = -ENOMEM; goto err_switch_setup; @@ -15865,8 +15863,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Set up the *vsi struct and our local tracking of the MAIN PF vsi. */ - pf->vsi = kcalloc(pf->num_alloc_vsi, sizeof(struct i40e_vsi *), - GFP_KERNEL); + pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi, GFP_KERNEL); if (!pf->vsi) { err = -ENOMEM; goto err_switch_setup; diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c index 33535418178b..416b42743439 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c @@ -1132,7 +1132,7 @@ int i40e_ptp_alloc_pins(struct i40e_pf *pf) return 0; pf->ptp_pins = - kzalloc(sizeof(struct i40e_ptp_pins_settings), GFP_KERNEL); + kzalloc_obj(struct i40e_ptp_pins_settings, GFP_KERNEL); if (!pf->ptp_pins) { dev_warn(&pf->pdev->dev, "Cannot allocate memory for PTP pins structure.\n"); @@ -1344,9 +1344,8 @@ static int i40e_init_pin_config(struct i40e_pf *pf) pf->ptp_caps.pps = 1; pf->ptp_caps.n_per_out = 2; - pf->ptp_caps.pin_config = kcalloc(pf->ptp_caps.n_pins, - sizeof(*pf->ptp_caps.pin_config), - GFP_KERNEL); + pf->ptp_caps.pin_config = kzalloc_objs(*pf->ptp_caps.pin_config, + pf->ptp_caps.n_pins, GFP_KERNEL); if (!pf->ptp_caps.pin_config) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index cc0b9efc2637..f89927bfa9d1 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -1572,7 +1572,7 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring) rx_ring->xdp_prog = rx_ring->vsi->xdp_prog; rx_ring->rx_bi = - kcalloc(rx_ring->count, sizeof(*rx_ring->rx_bi), GFP_KERNEL); + kzalloc_objs(*rx_ring->rx_bi, rx_ring->count, GFP_KERNEL); if (!rx_ring->rx_bi) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 1fa877b52f61..fb4560cc42f4 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -1261,7 +1261,7 @@ static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, u16 *num_vlans, spin_lock_bh(&vsi->mac_filter_hash_lock); *num_vlans = __i40e_getnum_vf_vsi_vlan_filters(vsi); - *vlan_list = kcalloc(*num_vlans, sizeof(**vlan_list), GFP_ATOMIC); + *vlan_list = kzalloc_objs(**vlan_list, *num_vlans, GFP_ATOMIC); if (!(*vlan_list)) goto err; @@ -1844,7 +1844,7 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) } } /* allocate memory */ - vfs = kcalloc(num_alloc_vfs, sizeof(struct i40e_vf), GFP_KERNEL); + vfs = kzalloc_objs(struct i40e_vf, num_alloc_vfs, GFP_KERNEL); if (!vfs) { ret = -ENOMEM; goto err_alloc; @@ -3956,7 +3956,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) goto err_out; } - cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL); + cfilter = kzalloc_obj(*cfilter, GFP_KERNEL); if (!cfilter) { aq_ret = -ENOMEM; goto err_out; diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index 2cc21289a707..e0163e2e022b 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1276,7 +1276,7 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx } spin_unlock_bh(&adapter->fdir_fltr_lock); - fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); + fltr = kzalloc_obj(*fltr, GFP_KERNEL); if (!fltr) return -ENOMEM; @@ -1519,7 +1519,7 @@ iavf_set_rxfh_fields(struct net_device *netdev, if (hash_flds == IAVF_ADV_RSS_HASH_INVALID) return -EINVAL; - rss_new = kzalloc(sizeof(*rss_new), GFP_KERNEL); + rss_new = kzalloc_obj(*rss_new, GFP_KERNEL); if (!rss_new) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 4b0fc8f354bc..5ee145d9dd0b 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -771,7 +771,7 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter, f = iavf_find_vlan(adapter, vlan); if (!f) { - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) goto clearout; @@ -978,7 +978,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, f = iavf_find_filter(adapter, macaddr); if (!f) { - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) return f; @@ -1585,12 +1585,12 @@ static int iavf_alloc_queues(struct iavf_adapter *adapter) (int)(num_online_cpus())); - adapter->tx_rings = kcalloc(num_active_queues, - sizeof(struct iavf_ring), GFP_KERNEL); + adapter->tx_rings = kzalloc_objs(struct iavf_ring, num_active_queues, + GFP_KERNEL); if (!adapter->tx_rings) goto err_out; - adapter->rx_rings = kcalloc(num_active_queues, - sizeof(struct iavf_ring), GFP_KERNEL); + adapter->rx_rings = kzalloc_objs(struct iavf_ring, num_active_queues, + GFP_KERNEL); if (!adapter->rx_rings) goto err_out; @@ -1653,8 +1653,8 @@ static int iavf_set_interrupt_capability(struct iavf_adapter *adapter) v_budget = min_t(int, pairs + NONQ_VECS, (int)adapter->vf_res->max_vectors); - adapter->msix_entries = kcalloc(v_budget, - sizeof(struct msix_entry), GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, v_budget, + GFP_KERNEL); if (!adapter->msix_entries) { err = -ENOMEM; goto out; @@ -1812,8 +1812,7 @@ static int iavf_alloc_q_vectors(struct iavf_adapter *adapter) struct iavf_q_vector *q_vector; num_q_vectors = adapter->num_msix_vectors - NONQ_VECS; - adapter->q_vectors = kcalloc(num_q_vectors, sizeof(*q_vector), - GFP_KERNEL); + adapter->q_vectors = kzalloc_objs(*q_vector, num_q_vectors, GFP_KERNEL); if (!adapter->q_vectors) return -ENOMEM; @@ -4119,7 +4118,7 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter, return -EINVAL; } - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; filter->cookie = cls_flower->cookie; @@ -4234,7 +4233,7 @@ static int iavf_add_cls_u32(struct iavf_adapter *adapter, return -EOPNOTSUPP; } - fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); + fltr = kzalloc_obj(*fltr, GFP_KERNEL); if (!fltr) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c b/drivers/net/ethernet/intel/iavf/iavf_ptp.c index 9cbd8c154031..f2f3411878e1 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ptp.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ptp.c @@ -133,7 +133,7 @@ static struct iavf_ptp_aq_cmd *iavf_allocate_ptp_cmd(enum virtchnl_ops v_opcode, { struct iavf_ptp_aq_cmd *cmd; - cmd = kzalloc(struct_size(cmd, msg, msglen), GFP_KERNEL); + cmd = kzalloc_flex(*cmd, msg, msglen, GFP_KERNEL); if (!cmd) return NULL; diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index 2ef39cc70c21..38081776ce65 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -285,7 +285,7 @@ static int ice_devlink_info_get(struct devlink *devlink, return err; } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/devlink/port.c b/drivers/net/ethernet/intel/ice/devlink/port.c index 63fb36fc4b3d..ce830213e73a 100644 --- a/drivers/net/ethernet/intel/ice/devlink/port.c +++ b/drivers/net/ethernet/intel/ice/devlink/port.c @@ -58,8 +58,9 @@ static void ice_devlink_port_options_print(struct ice_pf *pf) const char *str; int status; - options = kcalloc(ICE_AQC_PORT_OPT_MAX * ICE_MAX_PORT_PER_PCI_DEV, - sizeof(*options), GFP_KERNEL); + options = kzalloc_objs(*options, + ICE_AQC_PORT_OPT_MAX * ICE_MAX_PORT_PER_PCI_DEV, + GFP_KERNEL); if (!options) return; @@ -920,7 +921,7 @@ ice_alloc_dynamic_port(struct ice_pf *pf, if (err) return err; - dyn_port = kzalloc(sizeof(*dyn_port), GFP_KERNEL); + dyn_port = kzalloc_obj(*dyn_port, GFP_KERNEL); if (!dyn_port) { err = -ENOMEM; goto unroll_reserve_sf_num; diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c index 0a8a48cd4bce..d5b857b07f21 100644 --- a/drivers/net/ethernet/intel/ice/ice_adapter.c +++ b/drivers/net/ethernet/intel/ice/ice_adapter.c @@ -55,7 +55,7 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev) { struct ice_adapter *adapter; - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_arfs.c b/drivers/net/ethernet/intel/ice/ice_arfs.c index 1f7834c03550..fe9b40654df2 100644 --- a/drivers/net/ethernet/intel/ice/ice_arfs.c +++ b/drivers/net/ethernet/intel/ice/ice_arfs.c @@ -534,13 +534,12 @@ static int ice_init_arfs_cntrs(struct ice_vsi *vsi) if (!vsi || vsi->type != ICE_VSI_PF) return -EINVAL; - vsi->arfs_fltr_cntrs = kzalloc(sizeof(*vsi->arfs_fltr_cntrs), - GFP_KERNEL); + vsi->arfs_fltr_cntrs = kzalloc_obj(*vsi->arfs_fltr_cntrs, GFP_KERNEL); if (!vsi->arfs_fltr_cntrs) return -ENOMEM; - vsi->arfs_last_fltr_id = kzalloc(sizeof(*vsi->arfs_last_fltr_id), - GFP_KERNEL); + vsi->arfs_last_fltr_id = kzalloc_obj(*vsi->arfs_last_fltr_id, + GFP_KERNEL); if (!vsi->arfs_last_fltr_id) { kfree(vsi->arfs_fltr_cntrs); vsi->arfs_fltr_cntrs = NULL; @@ -562,8 +561,8 @@ void ice_init_arfs(struct ice_vsi *vsi) if (!vsi || vsi->type != ICE_VSI_PF || ice_is_arfs_active(vsi)) return; - arfs_fltr_list = kcalloc(ICE_MAX_ARFS_LIST, sizeof(*arfs_fltr_list), - GFP_KERNEL); + arfs_fltr_list = kzalloc_objs(*arfs_fltr_list, ICE_MAX_ARFS_LIST, + GFP_KERNEL); if (!arfs_fltr_list) return; diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index afbff8aa9ceb..35089e80e810 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -107,7 +107,7 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx) int err; /* allocate q_vector */ - q_vector = kzalloc(sizeof(*q_vector), GFP_KERNEL); + q_vector = kzalloc_obj(*q_vector, GFP_KERNEL); if (!q_vector) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 64e798b8f18f..651cd5476f88 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1067,7 +1067,7 @@ int ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_sched; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) { status = -ENOMEM; goto err_unroll_sched; @@ -1103,8 +1103,8 @@ int ice_init_hw(struct ice_hw *hw) /* Get MAC information */ /* A single port can report up to two (LAN and WoL) addresses */ - mac_buf = kcalloc(2, sizeof(struct ice_aqc_manage_mac_read_resp), - GFP_KERNEL); + mac_buf = kzalloc_objs(struct ice_aqc_manage_mac_read_resp, 2, + GFP_KERNEL); if (!mac_buf) { status = -ENOMEM; goto err_unroll_fltr_mgmt_struct; @@ -3630,7 +3630,7 @@ int ice_update_link_info(struct ice_port_info *pi) if (li->link_info & ICE_AQ_MEDIA_AVAILABLE) { struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -3881,7 +3881,7 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update) *aq_failures = 0; hw = pi->hw; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -4020,7 +4020,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, hw = pi->hw; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -4358,7 +4358,7 @@ int ice_get_phy_lane_number(struct ice_hw *hw) hw->device_id == ICE_DEV_ID_E825C_SGMII) return hw->pf_id; - options = kcalloc(ICE_AQC_PORT_OPT_MAX, sizeof(*options), GFP_KERNEL); + options = kzalloc_objs(*options, ICE_AQC_PORT_OPT_MAX, GFP_KERNEL); if (!options) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index 9fc8681cc58e..9d0e71598948 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -399,7 +399,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked) } /* Notify AUX drivers about impending change to TCs */ - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) { ret = -ENOMEM; goto free_cfg; @@ -575,7 +575,7 @@ void ice_dcb_rebuild(struct ice_pf *pf) dcb_error: dev_err(dev, "Disabling DCB until new settings occur\n"); - err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL); + err_cfg = kzalloc_obj(*err_cfg, GFP_KERNEL); if (!err_cfg) { mutex_unlock(&pf->tc_mutex); return; @@ -641,7 +641,7 @@ int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked) hw = &pf->hw; pi = hw->port_info; - dcbcfg = kzalloc(sizeof(*dcbcfg), GFP_KERNEL); + dcbcfg = kzalloc_obj(*dcbcfg, GFP_KERNEL); if (!dcbcfg) return -ENOMEM; @@ -791,7 +791,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked) privd = cdev->iidc_priv; ice_setup_dcb_qos_info(pf, &privd->qos_info); /* Notify the AUX drivers that TC change is finished */ - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) return; diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index baf02512d041..23bbfcbca490 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -3276,7 +3276,7 @@ static int ice_dpll_pin_notify(struct notifier_block *nb, unsigned long action, if (pin->fwnode != info->fwnode) return NOTIFY_DONE; /* Not this pin */ - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return NOTIFY_DONE; @@ -4145,7 +4145,7 @@ static int ice_dpll_init_info_e825c(struct ice_pf *pf) d->clock_id = ice_generate_clock_id(pf); d->num_inputs = ICE_SYNCE_CLK_NUM; - d->inputs = kcalloc(d->num_inputs, sizeof(*d->inputs), GFP_KERNEL); + d->inputs = kzalloc_objs(*d->inputs, d->num_inputs, GFP_KERNEL); if (!d->inputs) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c index cccb7ddf61c9..e043e8ddbc9d 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c @@ -129,11 +129,11 @@ ice_eswitch_br_fwd_rule_create(struct ice_hw *hw, int vsi_idx, int port_type, lkups_cnt = ice_eswitch_br_get_lkups_cnt(vid); - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return ERR_PTR(-ENOMEM); - list = kcalloc(lkups_cnt, sizeof(*list), GFP_ATOMIC); + list = kzalloc_objs(*list, lkups_cnt, GFP_ATOMIC); if (!list) { err = -ENOMEM; goto err_list_alloc; @@ -190,11 +190,11 @@ ice_eswitch_br_guard_rule_create(struct ice_hw *hw, u16 vsi_idx, lkups_cnt = ice_eswitch_br_get_lkups_cnt(vid); - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) goto err_exit; - list = kcalloc(lkups_cnt, sizeof(*list), GFP_ATOMIC); + list = kzalloc_objs(*list, lkups_cnt, GFP_ATOMIC); if (!list) goto err_list_alloc; @@ -233,7 +233,7 @@ ice_eswitch_br_flow_create(struct device *dev, struct ice_hw *hw, int vsi_idx, struct ice_esw_br_flow *flow; int err; - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (!flow) return ERR_PTR(-ENOMEM); @@ -418,7 +418,7 @@ ice_eswitch_br_fdb_entry_create(struct net_device *netdev, if (fdb_entry) ice_eswitch_br_fdb_entry_notify_and_cleanup(bridge, fdb_entry); - fdb_entry = kzalloc(sizeof(*fdb_entry), GFP_KERNEL); + fdb_entry = kzalloc_obj(*fdb_entry, GFP_KERNEL); if (!fdb_entry) { err = -ENOMEM; goto err_exit; @@ -513,7 +513,7 @@ ice_eswitch_br_fdb_work_alloc(struct switchdev_notifier_fdb_info *fdb_info, struct ice_esw_br_fdb_work *work; unsigned char *mac; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return ERR_PTR(-ENOMEM); @@ -698,7 +698,7 @@ ice_eswitch_br_vlan_create(u16 vid, u16 flags, struct ice_esw_br_port *port) struct ice_esw_br_vlan *vlan; int err; - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return ERR_PTR(-ENOMEM); @@ -916,7 +916,7 @@ ice_eswitch_br_port_init(struct ice_esw_br *bridge) { struct ice_esw_br_port *br_port; - br_port = kzalloc(sizeof(*br_port), GFP_KERNEL); + br_port = kzalloc_obj(*br_port, GFP_KERNEL); if (!br_port) return ERR_PTR(-ENOMEM); @@ -1013,7 +1013,7 @@ ice_eswitch_br_init(struct ice_esw_br_offloads *br_offloads, int ifindex) struct ice_esw_br *bridge; int err; - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return ERR_PTR(-ENOMEM); @@ -1217,7 +1217,7 @@ ice_eswitch_br_offloads_alloc(struct ice_pf *pf) if (pf->eswitch.br_offloads) return ERR_PTR(-EEXIST); - br_offloads = kzalloc(sizeof(*br_offloads), GFP_KERNEL); + br_offloads = kzalloc_obj(*br_offloads, GFP_KERNEL); if (!br_offloads) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index c6bc29cfb8e6..4cce51840369 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -1652,7 +1652,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) break; } - caps = kzalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc_obj(*caps, GFP_KERNEL); if (!caps) return -ENOMEM; @@ -2364,7 +2364,7 @@ ice_get_link_ksettings(struct net_device *netdev, /* flow control is symmetric and always supported */ ethtool_link_ksettings_add_link_mode(ks, supported, Pause); - caps = kzalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc_obj(*caps, GFP_KERNEL); if (!caps) return -ENOMEM; @@ -2629,7 +2629,7 @@ ice_set_link_ksettings(struct net_device *netdev, pi->phy.link_info.link_info & ICE_AQ_LINK_UP) return -EOPNOTSUPP; - phy_caps = kzalloc(sizeof(*phy_caps), GFP_KERNEL); + phy_caps = kzalloc_obj(*phy_caps, GFP_KERNEL); if (!phy_caps) return -ENOMEM; @@ -3265,7 +3265,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, netdev_info(netdev, "Changing Tx descriptor count from %d to %d\n", vsi->tx_rings[0]->count, new_tx_cnt); - tx_rings = kcalloc(vsi->num_txq, sizeof(*tx_rings), GFP_KERNEL); + tx_rings = kzalloc_objs(*tx_rings, vsi->num_txq, GFP_KERNEL); if (!tx_rings) { err = -ENOMEM; goto done; @@ -3295,7 +3295,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, netdev_info(netdev, "Changing XDP descriptor count from %d to %d\n", vsi->xdp_rings[0]->count, new_tx_cnt); - xdp_rings = kcalloc(vsi->num_xdp_txq, sizeof(*xdp_rings), GFP_KERNEL); + xdp_rings = kzalloc_objs(*xdp_rings, vsi->num_xdp_txq, GFP_KERNEL); if (!xdp_rings) { err = -ENOMEM; goto free_tx; @@ -3325,7 +3325,7 @@ process_rx: netdev_info(netdev, "Changing Rx descriptor count from %d to %d\n", vsi->rx_rings[0]->count, new_rx_cnt); - rx_rings = kcalloc(vsi->num_rxq, sizeof(*rx_rings), GFP_KERNEL); + rx_rings = kzalloc_objs(*rx_rings, vsi->num_rxq, GFP_KERNEL); if (!rx_rings) { err = -ENOMEM; goto done; @@ -3445,7 +3445,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return; @@ -3511,7 +3511,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) * so compare pause->autoneg with SW configured to prevent the user from * using set pause param to chance autoneg. */ - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c index c0dbec369366..28516878fa53 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c @@ -3734,7 +3734,7 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, int status = 0; u16 idx; - attr_used = kcalloc(ICE_MAX_PTG_ATTRS, sizeof(*attr_used), GFP_KERNEL); + attr_used = kzalloc_objs(*attr_used, ICE_MAX_PTG_ATTRS, GFP_KERNEL); if (!attr_used) return -ENOMEM; @@ -4021,7 +4021,7 @@ ice_find_prof_vsig(struct ice_hw *hw, enum ice_block blk, u64 hdl, u16 *vsig) INIT_LIST_HEAD(&lst); - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) return false; diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index c9b6d0a84bd1..51f718020073 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -1468,7 +1468,7 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, if (prof_id >= ids->count) return -ENOSPC; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -1661,7 +1661,7 @@ ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, int status; int i, idx; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -2552,7 +2552,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; - segs = kcalloc(segs_cnt, sizeof(*segs), GFP_KERNEL); + segs = kzalloc_objs(*segs, segs_cnt, GFP_KERNEL); if (!segs) return -ENOMEM; @@ -2699,7 +2699,7 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; - segs = kcalloc(segs_cnt, sizeof(*segs), GFP_KERNEL); + segs = kzalloc_objs(*segs, segs_cnt, GFP_KERNEL); if (!segs) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_fw_update.c b/drivers/net/ethernet/intel/ice/ice_fw_update.c index 973a13d3d92a..b67fde32577a 100644 --- a/drivers/net/ethernet/intel/ice/ice_fw_update.c +++ b/drivers/net/ethernet/intel/ice/ice_fw_update.c @@ -862,7 +862,7 @@ int ice_get_pending_updates(struct ice_pf *pf, u8 *pending, struct ice_hw *hw = &pf->hw; int err; - dev_caps = kzalloc(sizeof(*dev_caps), GFP_KERNEL); + dev_caps = kzalloc_obj(*dev_caps, GFP_KERNEL); if (!dev_caps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c index 6b26290452d4..e81d46412043 100644 --- a/drivers/net/ethernet/intel/ice/ice_gnss.c +++ b/drivers/net/ethernet/intel/ice/ice_gnss.c @@ -174,7 +174,7 @@ static struct gnss_serial *ice_gnss_struct_init(struct ice_pf *pf) struct kthread_worker *kworker; struct gnss_serial *gnss; - gnss = kzalloc(sizeof(*gnss), GFP_KERNEL); + gnss = kzalloc_obj(*gnss, GFP_KERNEL); if (!gnss) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c index 420d45c2558b..5487edc36260 100644 --- a/drivers/net/ethernet/intel/ice/ice_idc.c +++ b/drivers/net/ethernet/intel/ice/ice_idc.c @@ -308,7 +308,7 @@ int ice_plug_aux_dev(struct ice_pf *pf) if (!cdev) return -ENODEV; - iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); + iadev = kzalloc_obj(*iadev, GFP_KERNEL); if (!iadev) return -ENOMEM; @@ -376,13 +376,13 @@ int ice_init_rdma(struct ice_pf *pf) return 0; } - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return -ENOMEM; pf->cdev_info = cdev; - privd = kzalloc(sizeof(*privd), GFP_KERNEL); + privd = kzalloc_obj(*privd, GFP_KERNEL); if (!privd) { ret = -ENOMEM; goto err_privd_alloc; diff --git a/drivers/net/ethernet/intel/ice/ice_irq.c b/drivers/net/ethernet/intel/ice/ice_irq.c index 1d9b2d646474..3864fdcdeae0 100644 --- a/drivers/net/ethernet/intel/ice/ice_irq.c +++ b/drivers/net/ethernet/intel/ice/ice_irq.c @@ -81,7 +81,7 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf, unsigned int index; int ret; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index d2576d606e10..af285bba3b1a 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -742,7 +742,7 @@ static void ice_lag_build_netdev_list(struct ice_lag *lag, INIT_LIST_HEAD(&ndlist->node); rcu_read_lock(); for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) { - nl = kzalloc(sizeof(*nl), GFP_ATOMIC); + nl = kzalloc_obj(*nl, GFP_ATOMIC); if (!nl) break; @@ -2310,7 +2310,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event, return NOTIFY_DONE; /* This memory will be freed at the end of ice_lag_process_event */ - lag_work = kzalloc(sizeof(*lag_work), GFP_KERNEL); + lag_work = kzalloc_obj(*lag_work, GFP_KERNEL); if (!lag_work) return -ENOMEM; @@ -2332,7 +2332,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event, rcu_read_lock(); for_each_netdev_in_bond_rcu(upper_netdev, tmp_nd) { - nd_list = kzalloc(sizeof(*nd_list), GFP_ATOMIC); + nd_list = kzalloc_obj(*nd_list, GFP_ATOMIC); if (!nd_list) break; @@ -2577,7 +2577,7 @@ int ice_init_lag(struct ice_pf *pf) if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) return 0; - pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL); + pf->lag = kzalloc_obj(*lag, GFP_KERNEL); if (!pf->lag) return -ENOMEM; lag = pf->lag; diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index d921269e1fe7..c5695b2e2319 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -290,7 +290,7 @@ static void ice_vsi_delete_from_hw(struct ice_vsi *vsi) int status; ice_fltr_remove_all(vsi); - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return; @@ -396,7 +396,7 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi) ring_stats = tx_ring_stats[i]; if (!ring_stats) { - ring_stats = kzalloc(sizeof(*ring_stats), GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); if (!ring_stats) goto err_out; @@ -417,7 +417,7 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi) ring_stats = rx_ring_stats[i]; if (!ring_stats) { - ring_stats = kzalloc(sizeof(*ring_stats), GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); if (!ring_stats) goto err_out; @@ -533,19 +533,19 @@ static int ice_vsi_alloc_stat_arrays(struct ice_vsi *vsi) /* realloc will happen in rebuild path */ return 0; - vsi_stat = kzalloc(sizeof(*vsi_stat), GFP_KERNEL); + vsi_stat = kzalloc_obj(*vsi_stat, GFP_KERNEL); if (!vsi_stat) return -ENOMEM; vsi_stat->tx_ring_stats = - kcalloc(vsi->alloc_txq, sizeof(*vsi_stat->tx_ring_stats), - GFP_KERNEL); + kzalloc_objs(*vsi_stat->tx_ring_stats, vsi->alloc_txq, + GFP_KERNEL); if (!vsi_stat->tx_ring_stats) goto err_alloc_tx; vsi_stat->rx_ring_stats = - kcalloc(vsi->alloc_rxq, sizeof(*vsi_stat->rx_ring_stats), - GFP_KERNEL); + kzalloc_objs(*vsi_stat->rx_ring_stats, vsi->alloc_rxq, + GFP_KERNEL); if (!vsi_stat->rx_ring_stats) goto err_alloc_rx; @@ -1239,7 +1239,7 @@ static int ice_vsi_init(struct ice_vsi *vsi, u32 vsi_flags) int ret = 0; dev = ice_pf_to_dev(pf); - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -1403,7 +1403,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) struct ice_tx_ring *ring; /* allocate with kzalloc(), free with kfree_rcu() */ - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) goto err_out; @@ -1427,7 +1427,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) struct ice_rx_ring *ring; /* allocate with kzalloc(), free with kfree_rcu() */ - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) goto err_out; @@ -3104,8 +3104,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) if (ret) goto unlock; - coalesce = kcalloc(vsi->num_q_vectors, - sizeof(struct ice_coalesce_stored), GFP_KERNEL); + coalesce = kzalloc_objs(struct ice_coalesce_stored, vsi->num_q_vectors, + GFP_KERNEL); if (!coalesce) { ret = -ENOMEM; goto decfg; @@ -3387,7 +3387,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc) vsi->tc_cfg.ena_tc = ena_tc; vsi->tc_cfg.numtc = num_tc; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 4da37caa3ec9..45036a066012 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -875,7 +875,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup) an = "False"; /* Get FEC mode requested based on PHY caps last SW configuration */ - caps = kzalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc_obj(*caps, GFP_KERNEL); if (!caps) { fec_req = "Unknown"; an_advertised = "Unknown"; @@ -1951,7 +1951,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up) pi = vsi->port_info; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -2010,7 +2010,7 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi) struct ice_pf *pf = pi->hw->back; int err; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -2122,7 +2122,7 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi) if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE)) return -EIO; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -2202,7 +2202,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) if (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags)) return ice_force_phys_link_state(vsi, true); - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; @@ -2236,7 +2236,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) goto done; } - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) { err = -ENOMEM; goto done; @@ -2385,7 +2385,7 @@ static void ice_service_task(struct work_struct *work) if (test_and_clear_bit(ICE_AUX_ERR_PENDING, pf->state)) { struct iidc_rdma_event *event; - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (event) { set_bit(IIDC_RDMA_EVENT_CRIT_ERR, event->type); /* report the entire OICR value to AUX driver */ @@ -2408,7 +2408,7 @@ static void ice_service_task(struct work_struct *work) if (test_and_clear_bit(ICE_FLAG_MTU_CHANGED, pf->flags)) { struct iidc_rdma_event *event; - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (event) { set_bit(IIDC_RDMA_EVENT_AFTER_MTU_CHANGE, event->type); ice_send_event_to_aux(pf, event); @@ -2609,11 +2609,11 @@ static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi) struct ice_ring_stats *ring_stats; struct ice_tx_ring *xdp_ring; - xdp_ring = kzalloc(sizeof(*xdp_ring), GFP_KERNEL); + xdp_ring = kzalloc_obj(*xdp_ring, GFP_KERNEL); if (!xdp_ring) goto free_xdp_rings; - ring_stats = kzalloc(sizeof(*ring_stats), GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); if (!ring_stats) { ice_free_tx_ring(xdp_ring); goto free_xdp_rings; @@ -4204,7 +4204,7 @@ static void ice_set_safe_mode_vlan_cfg(struct ice_pf *pf) if (!vsi) return; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return; @@ -4910,7 +4910,7 @@ static int ice_init_pf_sw(struct ice_pf *pf) int err; /* create switch struct for the switch element created by FW on boot */ - pf->first_sw = kzalloc(sizeof(*pf->first_sw), GFP_KERNEL); + pf->first_sw = kzalloc_obj(*pf->first_sw, GFP_KERNEL); if (!pf->first_sw) return -ENOMEM; @@ -8096,7 +8096,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc) hfunc != ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ) return -EOPNOTSUPP; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -8168,7 +8168,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode) vsi_props = &vsi->info; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -9142,7 +9142,7 @@ static int ice_create_q_channels(struct ice_vsi *vsi) if (!(vsi->all_enatc & BIT(i))) continue; - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) { ret = -ENOMEM; goto err_free; @@ -9573,7 +9573,7 @@ ice_indr_setup_tc_block(struct net_device *netdev, struct Qdisc *sch, if (indr_priv) return -EEXIST; - indr_priv = kzalloc(sizeof(*indr_priv), GFP_KERNEL); + indr_priv = kzalloc_obj(*indr_priv, GFP_KERNEL); if (!indr_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c index 664beb64f557..4dd3f666daa8 100644 --- a/drivers/net/ethernet/intel/ice/ice_parser.c +++ b/drivers/net/ethernet/intel/ice/ice_parser.c @@ -1895,7 +1895,7 @@ static struct ice_xlt_kb *ice_xlt_kb_get(struct ice_hw *hw, u32 sect_type) if (!seg) return ERR_PTR(-EINVAL); - kb = kzalloc(sizeof(*kb), GFP_KERNEL); + kb = kzalloc_obj(*kb, GFP_KERNEL); if (!kb) return ERR_PTR(-ENOMEM); @@ -2000,7 +2000,7 @@ struct ice_parser *ice_parser_create(struct ice_hw *hw) struct ice_parser *p; void *err; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 22c3986b910a..db2213e0e1b5 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -706,7 +706,7 @@ ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx) unsigned long *in_use, *stale; struct ice_tx_tstamp *tstamps; - tstamps = kcalloc(tx->len, sizeof(*tstamps), GFP_KERNEL); + tstamps = kzalloc_objs(*tstamps, tx->len, GFP_KERNEL); in_use = bitmap_zalloc(tx->len, GFP_KERNEL); stale = bitmap_zalloc(tx->len, GFP_KERNEL); diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index cb08746556a6..7bdcc0e5986b 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -369,7 +369,7 @@ static struct ice_repr *ice_repr_create(struct ice_vsi *src_vsi) struct ice_repr *repr; int err; - repr = kzalloc(sizeof(*repr), GFP_KERNEL); + repr = kzalloc_obj(*repr, GFP_KERNEL); if (!repr) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.c b/drivers/net/ethernet/intel/ice/ice_sf_eth.c index 1a2c94375ca7..93e62050e00a 100644 --- a/drivers/net/ethernet/intel/ice/ice_sf_eth.c +++ b/drivers/net/ethernet/intel/ice/ice_sf_eth.c @@ -273,7 +273,7 @@ ice_sf_eth_activate(struct ice_dynamic_port *dyn_port, return err; } - sf_dev = kzalloc(sizeof(*sf_dev), GFP_KERNEL); + sf_dev = kzalloc_obj(*sf_dev, GFP_KERNEL); if (!sf_dev) { err = -ENOMEM; NL_SET_ERR_MSG_MOD(extack, "Could not allocate SF memory"); diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index 6b1126ddb561..7c15d62bb14b 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -695,7 +695,7 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs) pci_read_config_word(pdev, pos + PCI_SRIOV_VF_DID, &vf_pdev_id); for (u16 vf_id = 0; vf_id < num_vfs; vf_id++) { - vf = kzalloc(sizeof(*vf), GFP_KERNEL); + vf = kzalloc_obj(*vf, GFP_KERNEL); if (!vf) { err = -ENOMEM; goto err_free_entries; diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 84848f0123e7..515e96c44bfa 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -1847,7 +1847,7 @@ ice_cfg_rdma_fltr(struct ice_hw *hw, u16 vsi_handle, bool enable) if (!cached_ctx) return -ENOENT; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -2069,7 +2069,7 @@ ice_update_recipe_lkup_idx(struct ice_hw *hw, u16 num_recps = ICE_MAX_NUM_RECIPES; int status; - rcp_list = kcalloc(num_recps, sizeof(*rcp_list), GFP_KERNEL); + rcp_list = kzalloc_objs(*rcp_list, num_recps, GFP_KERNEL); if (!rcp_list) return -ENOMEM; @@ -2326,7 +2326,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, bitmap_zero(result_bm, ICE_MAX_FV_WORDS); /* we need a buffer big enough to accommodate all the recipes */ - tmp = kcalloc(ICE_MAX_NUM_RECIPES, sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_objs(*tmp, ICE_MAX_NUM_RECIPES, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -5096,7 +5096,7 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, if (recp_cnt > ICE_MAX_CHAIN_RECIPE_RES) return -E2BIG; - buf = kcalloc(recp_cnt, sizeof(*buf), GFP_KERNEL); + buf = kzalloc_objs(*buf, recp_cnt, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -5324,7 +5324,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, if (!lkups_cnt) return -EINVAL; - lkup_exts = kzalloc(sizeof(*lkup_exts), GFP_KERNEL); + lkup_exts = kzalloc_obj(*lkup_exts, GFP_KERNEL); if (!lkup_exts) return -ENOMEM; @@ -5346,7 +5346,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, } } - rm = kzalloc(sizeof(*rm), GFP_KERNEL); + rm = kzalloc_obj(*rm, GFP_KERNEL); if (!rm) { status = -ENOMEM; goto err_free_lkup_exts; @@ -5530,7 +5530,7 @@ ice_dummy_packet_add_vlan(const struct ice_dummy_pkt_profile *dummy_pkt, memcpy(pkt + etype_off + off, dummy_pkt->pkt + etype_off, dummy_pkt->pkt_len - etype_off); - profile = kzalloc(sizeof(*profile), GFP_KERNEL); + profile = kzalloc_obj(*profile, GFP_KERNEL); if (!profile) { kfree(offsets); kfree(pkt); diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c index fb9ea7f8ef44..c687da8d950d 100644 --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c @@ -931,7 +931,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr) return ice_pass_vf_tx_lldp(vsi, false); lkups_cnt = ice_tc_count_lkups(flags, fltr); - list = kcalloc(lkups_cnt, sizeof(*list), GFP_ATOMIC); + list = kzalloc_objs(*list, lkups_cnt, GFP_ATOMIC); if (!list) return -ENOMEM; @@ -1177,7 +1177,7 @@ ice_add_tc_flower_adv_fltr(struct ice_vsi *vsi, } lkups_cnt = ice_tc_count_lkups(flags, tc_fltr); - list = kcalloc(lkups_cnt, sizeof(*list), GFP_ATOMIC); + list = kzalloc_objs(*list, lkups_cnt, GFP_ATOMIC); if (!list) return -ENOMEM; @@ -2191,7 +2191,7 @@ ice_add_tc_fltr(struct net_device *netdev, struct ice_vsi *vsi, /* by default, set output to be INVALID */ *__fltr = NULL; - fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); + fltr = kzalloc_obj(*fltr, GFP_KERNEL); if (!fltr) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 6fa201a14f51..642b761c38a2 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -397,7 +397,7 @@ static int ice_alloc_tstamp_ring(struct ice_tx_ring *tx_ring) struct ice_tstamp_ring *tstamp_ring; /* allocate with kzalloc(), free with kfree_rcu() */ - tstamp_ring = kzalloc(sizeof(*tstamp_ring), GFP_KERNEL); + tstamp_ring = kzalloc_obj(*tstamp_ring, GFP_KERNEL); if (!tstamp_ring) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index de9e81ccee66..dba56e317b77 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -1112,7 +1112,7 @@ static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable) struct ice_vsi_ctx *ctx; int err; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c index ada78f83b3ac..79f18e693e04 100644 --- a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c @@ -94,7 +94,7 @@ static int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -141,7 +141,7 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena) if (vsi->info.port_based_inner_vlan) return 0; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -239,7 +239,7 @@ static int __ice_vsi_set_inner_port_vlan(struct ice_vsi *vsi, u16 pvid_info) struct ice_vsi_ctx *ctxt; int ret; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -292,7 +292,7 @@ int ice_vsi_clear_inner_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int ret; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -336,7 +336,7 @@ static int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena) return 0; pf = vsi->back; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -382,7 +382,7 @@ static int ice_cfg_vlan_antispoof(struct ice_vsi *vsi, bool enable) struct ice_vsi_ctx *ctx; int err; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -478,7 +478,7 @@ int ice_vsi_ena_outer_stripping(struct ice_vsi *vsi, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -529,7 +529,7 @@ int ice_vsi_dis_outer_stripping(struct ice_vsi *vsi) if (vsi->info.port_based_outer_vlan) return 0; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -584,7 +584,7 @@ int ice_vsi_ena_outer_insertion(struct ice_vsi *vsi, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -636,7 +636,7 @@ int ice_vsi_dis_outer_insertion(struct ice_vsi *vsi) if (vsi->info.port_based_outer_vlan) return 0; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -694,7 +694,7 @@ __ice_vsi_set_outer_port_vlan(struct ice_vsi *vsi, u16 vlan_info, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -767,7 +767,7 @@ int ice_vsi_clear_outer_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; @@ -794,7 +794,7 @@ int ice_vsi_clear_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 953e68ed0f9a..e01eae07b6ed 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -174,9 +174,8 @@ int ice_realloc_rx_xdp_bufs(struct ice_rx_ring *rx_ring, bool pool_present) { if (pool_present) { - rx_ring->xdp_buf = kcalloc(rx_ring->count, - sizeof(*rx_ring->xdp_buf), - GFP_KERNEL); + rx_ring->xdp_buf = kzalloc_objs(*rx_ring->xdp_buf, + rx_ring->count, GFP_KERNEL); if (!rx_ring->xdp_buf) return -ENOMEM; } else { diff --git a/drivers/net/ethernet/intel/ice/virt/fdir.c b/drivers/net/ethernet/intel/ice/virt/fdir.c index ae83c3914e29..8b2c882fb39c 100644 --- a/drivers/net/ethernet/intel/ice/virt/fdir.c +++ b/drivers/net/ethernet/intel/ice/virt/fdir.c @@ -875,7 +875,7 @@ ice_vc_fdir_parse_raw(struct ice_vf *vf, if (hw->debug_mask & ICE_DBG_PARSER) ice_parser_result_dump(hw, &rslt); - conf->prof = kzalloc(sizeof(*conf->prof), GFP_KERNEL); + conf->prof = kzalloc_obj(*conf->prof, GFP_KERNEL); if (!conf->prof) { status = -ENOMEM; goto err_parser_destroy; @@ -2128,7 +2128,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) goto err_exit; } - stat = kzalloc(sizeof(*stat), GFP_KERNEL); + stat = kzalloc_obj(*stat, GFP_KERNEL); if (!stat) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; dev_dbg(dev, "Alloc stat for VF %d failed\n", vf->vf_id); @@ -2332,7 +2332,7 @@ int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg) goto err_exit; } - stat = kzalloc(sizeof(*stat), GFP_KERNEL); + stat = kzalloc_obj(*stat, GFP_KERNEL); if (!stat) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; dev_dbg(dev, "Alloc stat for VF %d failed\n", vf->vf_id); diff --git a/drivers/net/ethernet/intel/ice/virt/rss.c b/drivers/net/ethernet/intel/ice/virt/rss.c index 085e69ec0cfc..2f259b261512 100644 --- a/drivers/net/ethernet/intel/ice/virt/rss.c +++ b/drivers/net/ethernet/intel/ice/virt/rss.c @@ -380,7 +380,7 @@ ice_vc_rss_hash_update(struct ice_hw *hw, struct ice_vsi *vsi, u8 hash_type) struct ice_vsi_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/virt/virtchnl.c b/drivers/net/ethernet/intel/ice/virt/virtchnl.c index f3f921134379..9abfba8ae6bd 100644 --- a/drivers/net/ethernet/intel/ice/virt/virtchnl.c +++ b/drivers/net/ethernet/intel/ice/virt/virtchnl.c @@ -1658,7 +1658,7 @@ static int ice_vc_get_offload_vlan_v2_caps(struct ice_vf *vf) goto out; } - caps = kzalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc_obj(*caps, GFP_KERNEL); if (!caps) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; goto out; @@ -2477,7 +2477,7 @@ static int ice_vc_get_phc_time(struct ice_vf *vf) v_ret = VIRTCHNL_STATUS_SUCCESS; - phc_time = kzalloc(sizeof(*phc_time), GFP_KERNEL); + phc_time = kzalloc_obj(*phc_time, GFP_KERNEL); if (!phc_time) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; goto err; diff --git a/drivers/net/ethernet/intel/idpf/idpf_controlq.c b/drivers/net/ethernet/intel/idpf/idpf_controlq.c index 67894eda2d29..e3681dedc888 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_controlq.c +++ b/drivers/net/ethernet/intel/idpf/idpf_controlq.c @@ -127,7 +127,7 @@ int idpf_ctlq_add(struct idpf_hw *hw, bool is_rxq = false; int err; - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) return -ENOMEM; @@ -159,9 +159,8 @@ int idpf_ctlq_add(struct idpf_hw *hw, idpf_ctlq_init_rxq_bufs(cq); } else { /* Allocate the array of msg pointers for TX queues */ - cq->bi.tx_msg = kcalloc(qinfo->len, - sizeof(struct idpf_ctlq_msg *), - GFP_KERNEL); + cq->bi.tx_msg = kzalloc_objs(struct idpf_ctlq_msg *, qinfo->len, + GFP_KERNEL); if (!cq->bi.tx_msg) { err = -ENOMEM; goto init_dealloc_q_mem; diff --git a/drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c b/drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c index a942a6385d06..dfdbfb89b090 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c +++ b/drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c @@ -40,8 +40,8 @@ static int idpf_ctlq_alloc_bufs(struct idpf_hw *hw, /* We'll be allocating the buffer info memory first, then we can * allocate the mapped buffers for the event processing */ - cq->bi.rx_buff = kcalloc(cq->ring_size, sizeof(struct idpf_dma_mem *), - GFP_KERNEL); + cq->bi.rx_buff = kzalloc_objs(struct idpf_dma_mem *, cq->ring_size, + GFP_KERNEL); if (!cq->bi.rx_buff) return -ENOMEM; @@ -50,8 +50,8 @@ static int idpf_ctlq_alloc_bufs(struct idpf_hw *hw, struct idpf_dma_mem *bi; int num = 1; /* number of idpf_dma_mem to be allocated */ - cq->bi.rx_buff[i] = kcalloc(num, sizeof(struct idpf_dma_mem), - GFP_KERNEL); + cq->bi.rx_buff[i] = kzalloc_objs(struct idpf_dma_mem, num, + GFP_KERNEL); if (!cq->bi.rx_buff[i]) goto unwind_alloc_cq_bufs; diff --git a/drivers/net/ethernet/intel/idpf/idpf_dev.c b/drivers/net/ethernet/intel/idpf/idpf_dev.c index a4625638cf3f..c7c38e22c975 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_dev.c +++ b/drivers/net/ethernet/intel/idpf/idpf_dev.c @@ -83,8 +83,7 @@ static int idpf_intr_reg_init(struct idpf_vport *vport, u16 total_vecs; total_vecs = idpf_get_reserved_vecs(vport->adapter); - reg_vals = kcalloc(total_vecs, sizeof(struct idpf_vec_regs), - GFP_KERNEL); + reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs, GFP_KERNEL); if (!reg_vals) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c index 1d78a621d65b..8cfb09ff8ebd 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c +++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c @@ -200,11 +200,11 @@ static int idpf_add_flow_steer(struct net_device *netdev, if (q_index >= num_rxq) return -EINVAL; - rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL); + rule = kzalloc_flex(*rule, rule_info, 1, GFP_KERNEL); if (!rule) return -ENOMEM; - fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); + fltr = kzalloc_obj(*fltr, GFP_KERNEL); if (!fltr) { err = -ENOMEM; goto out_free_rule; @@ -310,7 +310,7 @@ static int idpf_del_flow_steer(struct net_device *netdev, if (!idpf_sideband_action_ena(vport, fsp)) return -EOPNOTSUPP; - rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL); + rule = kzalloc_flex(*rule, rule_info, 1, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_idc.c b/drivers/net/ethernet/intel/idpf/idpf_idc.c index 6dad0593f7f2..42fb8659142a 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_idc.c +++ b/drivers/net/ethernet/intel/idpf/idpf_idc.c @@ -60,7 +60,7 @@ static int idpf_plug_vport_aux_dev(struct iidc_rdma_core_dev_info *cdev_info, struct auxiliary_device *adev; int ret; - iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); + iadev = kzalloc_obj(*iadev, GFP_KERNEL); if (!iadev) return -ENOMEM; @@ -120,7 +120,7 @@ static int idpf_idc_init_aux_vport_dev(struct idpf_vport *vport) if (!(le16_to_cpu(vport_msg->vport_flags) & VIRTCHNL2_VPORT_ENABLE_RDMA)) return 0; - vport->vdev_info = kzalloc(sizeof(*vdev_info), GFP_KERNEL); + vport->vdev_info = kzalloc_obj(*vdev_info, GFP_KERNEL); if (!vport->vdev_info) return -ENOMEM; @@ -198,7 +198,7 @@ static int idpf_plug_core_aux_dev(struct iidc_rdma_core_dev_info *cdev_info) struct auxiliary_device *adev; int ret; - iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); + iadev = kzalloc_obj(*iadev, GFP_KERNEL); if (!iadev) return -ENOMEM; @@ -414,12 +414,12 @@ int idpf_idc_init_aux_core_dev(struct idpf_adapter *adapter, struct iidc_rdma_priv_dev_info *privd; int err, i; - adapter->cdev_info = kzalloc(sizeof(*cdev_info), GFP_KERNEL); + adapter->cdev_info = kzalloc_obj(*cdev_info, GFP_KERNEL); if (!adapter->cdev_info) return -ENOMEM; cdev_info = adapter->cdev_info; - privd = kzalloc(sizeof(*privd), GFP_KERNEL); + privd = kzalloc_obj(*privd, GFP_KERNEL); if (!privd) { err = -ENOMEM; goto err_privd_alloc; @@ -431,9 +431,8 @@ int idpf_idc_init_aux_core_dev(struct idpf_adapter *adapter, privd->ftype = ftype; privd->mapped_mem_regions = - kcalloc(adapter->hw.num_lan_regs, - sizeof(struct iidc_rdma_lan_mapped_mem_region), - GFP_KERNEL); + kzalloc_objs(struct iidc_rdma_lan_mapped_mem_region, + adapter->hw.num_lan_regs, GFP_KERNEL); if (!privd->mapped_mem_regions) { err = -ENOMEM; goto err_plug_aux_dev; diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c index 94da5fbd56f1..a70f8ba7aad2 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -359,9 +359,9 @@ int idpf_intr_req(struct idpf_adapter *adapter) num_rdma_vecs = IDPF_MIN_RDMA_VEC; } - adapter->rdma_msix_entries = kcalloc(num_rdma_vecs, - sizeof(struct msix_entry), - GFP_KERNEL); + adapter->rdma_msix_entries = kzalloc_objs(struct msix_entry, + num_rdma_vecs, + GFP_KERNEL); if (!adapter->rdma_msix_entries) { err = -ENOMEM; goto free_irq; @@ -369,8 +369,8 @@ int idpf_intr_req(struct idpf_adapter *adapter) } num_lan_vecs = actual_vecs - num_rdma_vecs; - adapter->msix_entries = kcalloc(num_lan_vecs, sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, num_lan_vecs, + GFP_KERNEL); if (!adapter->msix_entries) { err = -ENOMEM; goto free_rdma_msix; @@ -577,7 +577,7 @@ static int __idpf_add_mac_filter(struct idpf_vport_config *vport_config, return 0; } - f = kzalloc(sizeof(*f), GFP_ATOMIC); + f = kzalloc_obj(*f, GFP_ATOMIC); if (!f) { spin_unlock_bh(&vport_config->mac_filter_list_lock); @@ -1239,7 +1239,7 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter, if (idx == IDPF_NO_FREE_SLOT) return NULL; - vport = kzalloc(sizeof(*vport), GFP_KERNEL); + vport = kzalloc_obj(*vport, GFP_KERNEL); if (!vport) return vport; @@ -1248,14 +1248,14 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter, struct idpf_vport_config *vport_config; struct idpf_q_coalesce *q_coal; - vport_config = kzalloc(sizeof(*vport_config), GFP_KERNEL); + vport_config = kzalloc_obj(*vport_config, GFP_KERNEL); if (!vport_config) { kfree(vport); return NULL; } - q_coal = kcalloc(num_max_q, sizeof(*q_coal), GFP_KERNEL); + q_coal = kzalloc_objs(*q_coal, num_max_q, GFP_KERNEL); if (!q_coal) { kfree(vport_config); kfree(vport); @@ -2027,7 +2027,7 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport, * error occurred, the existing vport will be untouched. * */ - new_vport = kzalloc(sizeof(*vport), GFP_KERNEL); + new_vport = kzalloc_obj(*vport, GFP_KERNEL); if (!new_vport) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index de5d722cc21d..be6760249dc8 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c @@ -238,7 +238,7 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct idpf_adapter *adapter; int err; - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_ptp.c b/drivers/net/ethernet/intel/idpf/idpf_ptp.c index 4a805a9541f0..c098d3f66a34 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_ptp.c +++ b/drivers/net/ethernet/intel/idpf/idpf_ptp.c @@ -936,7 +936,7 @@ int idpf_ptp_init(struct idpf_adapter *adapter) return -EOPNOTSUPP; } - adapter->ptp = kzalloc(sizeof(*adapter->ptp), GFP_KERNEL); + adapter->ptp = kzalloc_obj(*adapter->ptp, GFP_KERNEL); if (!adapter->ptp) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index 376050308b06..259316af9ec5 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -183,8 +183,8 @@ static int idpf_tx_buf_alloc_all(struct idpf_tx_queue *tx_q) tx_q->buf_pool_size = U16_MAX; else tx_q->buf_pool_size = tx_q->desc_count; - tx_q->tx_buf = kcalloc(tx_q->buf_pool_size, sizeof(*tx_q->tx_buf), - GFP_KERNEL); + tx_q->tx_buf = kzalloc_objs(*tx_q->tx_buf, tx_q->buf_pool_size, + GFP_KERNEL); if (!tx_q->tx_buf) return -ENOMEM; @@ -1204,9 +1204,9 @@ static int idpf_qp_enable(const struct idpf_vport *vport, if (!rsrc->xdp_txq_offset) goto config; - q_vector->xsksq = kcalloc(DIV_ROUND_UP(rsrc->num_rxq_grp, - rsrc->num_q_vectors), - sizeof(*q_vector->xsksq), GFP_KERNEL); + q_vector->xsksq = kzalloc_objs(*q_vector->xsksq, + DIV_ROUND_UP(rsrc->num_rxq_grp, rsrc->num_q_vectors), + GFP_KERNEL); if (!q_vector->xsksq) return -ENOMEM; @@ -1439,8 +1439,7 @@ static int idpf_vport_init_fast_path_txqs(struct idpf_vport *vport, struct work_struct *tstamp_task = &vport->tstamp_task; int k = 0; - vport->txqs = kcalloc(rsrc->num_txq, sizeof(*vport->txqs), - GFP_KERNEL); + vport->txqs = kzalloc_objs(*vport->txqs, rsrc->num_txq, GFP_KERNEL); if (!vport->txqs) return -ENOMEM; @@ -1711,8 +1710,8 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, { bool split, flow_sch_en; - rsrc->txq_grps = kcalloc(rsrc->num_txq_grp, - sizeof(*rsrc->txq_grps), GFP_KERNEL); + rsrc->txq_grps = kzalloc_objs(*rsrc->txq_grps, rsrc->num_txq_grp, + GFP_KERNEL); if (!rsrc->txq_grps) return -ENOMEM; @@ -1728,8 +1727,8 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, tx_qgrp->num_txq = num_txq; for (unsigned int j = 0; j < tx_qgrp->num_txq; j++) { - tx_qgrp->txqs[j] = kzalloc(sizeof(*tx_qgrp->txqs[j]), - GFP_KERNEL); + tx_qgrp->txqs[j] = kzalloc_obj(*tx_qgrp->txqs[j], + GFP_KERNEL); if (!tx_qgrp->txqs[j]) goto err_alloc; } @@ -1756,7 +1755,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, idpf_queue_set(FLOW_SCH_EN, q); - q->refillq = kzalloc(sizeof(*q->refillq), GFP_KERNEL); + q->refillq = kzalloc_obj(*q->refillq, GFP_KERNEL); if (!q->refillq) goto err_alloc; @@ -1767,9 +1766,9 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, if (!split) continue; - tx_qgrp->complq = kcalloc(IDPF_COMPLQ_PER_GROUP, - sizeof(*tx_qgrp->complq), - GFP_KERNEL); + tx_qgrp->complq = kzalloc_objs(*tx_qgrp->complq, + IDPF_COMPLQ_PER_GROUP, + GFP_KERNEL); if (!tx_qgrp->complq) goto err_alloc; @@ -1806,8 +1805,8 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, bool hs, rsc; int err = 0; - rsrc->rxq_grps = kcalloc(rsrc->num_rxq_grp, - sizeof(struct idpf_rxq_group), GFP_KERNEL); + rsrc->rxq_grps = kzalloc_objs(struct idpf_rxq_group, rsrc->num_rxq_grp, + GFP_KERNEL); if (!rsrc->rxq_grps) return -ENOMEM; @@ -1821,9 +1820,8 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, if (!idpf_is_queue_model_split(rsrc->rxq_model)) { rx_qgrp->singleq.num_rxq = num_rxq; for (unsigned int j = 0; j < num_rxq; j++) { - rx_qgrp->singleq.rxqs[j] = - kzalloc(sizeof(*rx_qgrp->singleq.rxqs[j]), - GFP_KERNEL); + rx_qgrp->singleq.rxqs[j] = kzalloc_obj(*rx_qgrp->singleq.rxqs[j], + GFP_KERNEL); if (!rx_qgrp->singleq.rxqs[j]) { err = -ENOMEM; goto err_alloc; @@ -1835,17 +1833,16 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, for (unsigned int j = 0; j < num_rxq; j++) { rx_qgrp->splitq.rxq_sets[j] = - kzalloc(sizeof(struct idpf_rxq_set), - GFP_KERNEL); + kzalloc_obj(struct idpf_rxq_set, GFP_KERNEL); if (!rx_qgrp->splitq.rxq_sets[j]) { err = -ENOMEM; goto err_alloc; } } - rx_qgrp->splitq.bufq_sets = kcalloc(rsrc->num_bufqs_per_qgrp, - sizeof(struct idpf_bufq_set), - GFP_KERNEL); + rx_qgrp->splitq.bufq_sets = kzalloc_objs(struct idpf_bufq_set, + rsrc->num_bufqs_per_qgrp, + GFP_KERNEL); if (!rx_qgrp->splitq.bufq_sets) { err = -ENOMEM; goto err_alloc; @@ -1880,9 +1877,9 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, rsrc->bufq_desc_count[j]; idpf_queue_set(GEN_CHK, refillq); idpf_queue_set(RFL_GEN_CHK, refillq); - refillq->ring = kcalloc(refillq->desc_count, - sizeof(*refillq->ring), - GFP_KERNEL); + refillq->ring = kzalloc_objs(*refillq->ring, + refillq->desc_count, + GFP_KERNEL); if (!refillq->ring) { err = -ENOMEM; goto err_alloc; @@ -4567,8 +4564,8 @@ int idpf_vport_intr_alloc(struct idpf_vport *vport, user_config = &vport->adapter->vport_config[idx]->user_config; - rsrc->q_vectors = kcalloc(rsrc->num_q_vectors, - sizeof(struct idpf_q_vector), GFP_KERNEL); + rsrc->q_vectors = kzalloc_objs(struct idpf_q_vector, + rsrc->num_q_vectors, GFP_KERNEL); if (!rsrc->q_vectors) return -ENOMEM; @@ -4595,37 +4592,34 @@ int idpf_vport_intr_alloc(struct idpf_vport *vport, q_vector->rx_intr_mode = q_coal->rx_intr_mode; q_vector->rx_itr_idx = VIRTCHNL2_ITR_IDX_0; - q_vector->tx = kcalloc(txqs_per_vector, sizeof(*q_vector->tx), - GFP_KERNEL); + q_vector->tx = kzalloc_objs(*q_vector->tx, txqs_per_vector, + GFP_KERNEL); if (!q_vector->tx) goto error; - q_vector->rx = kcalloc(rxqs_per_vector, sizeof(*q_vector->rx), - GFP_KERNEL); + q_vector->rx = kzalloc_objs(*q_vector->rx, rxqs_per_vector, + GFP_KERNEL); if (!q_vector->rx) goto error; if (!idpf_is_queue_model_split(rsrc->rxq_model)) continue; - q_vector->bufq = kcalloc(bufqs_per_vector, - sizeof(*q_vector->bufq), - GFP_KERNEL); + q_vector->bufq = kzalloc_objs(*q_vector->bufq, bufqs_per_vector, + GFP_KERNEL); if (!q_vector->bufq) goto error; - q_vector->complq = kcalloc(complqs_per_vector, - sizeof(*q_vector->complq), - GFP_KERNEL); + q_vector->complq = kzalloc_objs(*q_vector->complq, + complqs_per_vector, GFP_KERNEL); if (!q_vector->complq) goto error; if (!rsrc->xdp_txq_offset) continue; - q_vector->xsksq = kcalloc(rxqs_per_vector, - sizeof(*q_vector->xsksq), - GFP_KERNEL); + q_vector->xsksq = kzalloc_objs(*q_vector->xsksq, + rxqs_per_vector, GFP_KERNEL); if (!q_vector->xsksq) goto error; } diff --git a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c index 7527b967e2e7..57559a2bc9dd 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c +++ b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c @@ -82,8 +82,7 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport, u16 total_vecs; total_vecs = idpf_get_reserved_vecs(vport->adapter); - reg_vals = kcalloc(total_vecs, sizeof(struct idpf_vec_regs), - GFP_KERNEL); + reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs, GFP_KERNEL); if (!reg_vals) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index d46affaf7185..f1a8ae9d8118 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -132,7 +132,7 @@ static int idpf_mb_clean(struct idpf_adapter *adapter, struct idpf_dma_mem *dma_mem; int err; - q_msg = kcalloc(num_q_msg, sizeof(struct idpf_ctlq_msg *), GFP_ATOMIC); + q_msg = kzalloc_objs(struct idpf_ctlq_msg *, num_q_msg, GFP_ATOMIC); if (!q_msg) return -ENOMEM; @@ -238,11 +238,11 @@ int idpf_send_mb_msg(struct idpf_adapter *adapter, struct idpf_ctlq_info *asq, if (err) return err; - ctlq_msg = kzalloc(sizeof(*ctlq_msg), GFP_ATOMIC); + ctlq_msg = kzalloc_obj(*ctlq_msg, GFP_ATOMIC); if (!ctlq_msg) return -ENOMEM; - dma_mem = kzalloc(sizeof(*dma_mem), GFP_ATOMIC); + dma_mem = kzalloc_obj(*dma_mem, GFP_ATOMIC); if (!dma_mem) { err = -ENOMEM; goto dma_mem_error; @@ -740,7 +740,7 @@ struct idpf_queue_set *idpf_alloc_queue_set(struct idpf_adapter *adapter, { struct idpf_queue_set *qp; - qp = kzalloc(struct_size(qp, qs, num), GFP_KERNEL); + qp = kzalloc_flex(*qp, qs, num, GFP_KERNEL); if (!qp) return NULL; @@ -1059,7 +1059,7 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter) return -EINVAL; hw = &adapter->hw; - hw->lan_regs = kcalloc(num_regions, sizeof(*hw->lan_regs), GFP_KERNEL); + hw->lan_regs = kzalloc_objs(*hw->lan_regs, num_regions, GFP_KERNEL); if (!hw->lan_regs) return -ENOMEM; @@ -1091,8 +1091,7 @@ static int idpf_calc_remaining_mmio_regs(struct idpf_adapter *adapter) struct idpf_hw *hw = &adapter->hw; hw->num_lan_regs = IDPF_MMIO_MAP_FALLBACK_MAX_REMAINING; - hw->lan_regs = kcalloc(hw->num_lan_regs, sizeof(*hw->lan_regs), - GFP_KERNEL); + hw->lan_regs = kzalloc_objs(*hw->lan_regs, hw->num_lan_regs, GFP_KERNEL); if (!hw->lan_regs) return -ENOMEM; @@ -1291,8 +1290,8 @@ idpf_vport_init_queue_reg_chunks(struct idpf_vport_config *vport_config, kfree(q_info->queue_chunks); - q_info->queue_chunks = kcalloc(num_chunks, sizeof(*q_info->queue_chunks), - GFP_KERNEL); + q_info->queue_chunks = kzalloc_objs(*q_info->queue_chunks, num_chunks, + GFP_KERNEL); if (!q_info->queue_chunks) { q_info->num_chunks = 0; return -ENOMEM; @@ -1845,7 +1844,7 @@ static int idpf_send_config_tx_queue_set_msg(const struct idpf_queue_set *qs) .chunk_sz = sizeof(*qi), }; - qi = kcalloc(qs->num, sizeof(*qi), GFP_KERNEL); + qi = kzalloc_objs(*qi, qs->num, GFP_KERNEL); if (!qi) return -ENOMEM; @@ -2034,7 +2033,7 @@ static int idpf_send_config_rx_queue_set_msg(const struct idpf_queue_set *qs) .chunk_sz = sizeof(*qi), }; - qi = kcalloc(qs->num, sizeof(*qi), GFP_KERNEL); + qi = kzalloc_objs(*qi, qs->num, GFP_KERNEL); if (!qi) return -ENOMEM; @@ -2161,7 +2160,7 @@ static int idpf_send_ena_dis_queue_set_msg(const struct idpf_queue_set *qs, .num_chunks = qs->num, }; - qc = kcalloc(qs->num, sizeof(*qc), GFP_KERNEL); + qc = kzalloc_objs(*qc, qs->num, GFP_KERNEL); if (!qc) return -ENOMEM; @@ -2328,7 +2327,7 @@ idpf_send_map_unmap_queue_set_vector_msg(const struct idpf_queue_set *qs, }; bool split; - vqv = kcalloc(qs->num, sizeof(*vqv), GFP_KERNEL); + vqv = kzalloc_objs(*vqv, qs->num, GFP_KERNEL); if (!vqv) return -ENOMEM; @@ -3198,16 +3197,16 @@ static int idpf_send_get_rx_ptype_msg(struct idpf_adapter *adapter) u16 next_ptype_id = 0; ssize_t reply_sz; - singleq_pt_lkup = kcalloc(IDPF_RX_MAX_BASE_PTYPE, - sizeof(*singleq_pt_lkup), GFP_KERNEL); + singleq_pt_lkup = kzalloc_objs(*singleq_pt_lkup, IDPF_RX_MAX_BASE_PTYPE, + GFP_KERNEL); if (!singleq_pt_lkup) return -ENOMEM; - splitq_pt_lkup = kcalloc(max_ptype, sizeof(*splitq_pt_lkup), GFP_KERNEL); + splitq_pt_lkup = kzalloc_objs(*splitq_pt_lkup, max_ptype, GFP_KERNEL); if (!splitq_pt_lkup) return -ENOMEM; - get_ptype_info = kzalloc(sizeof(*get_ptype_info), GFP_KERNEL); + get_ptype_info = kzalloc_obj(*get_ptype_info, GFP_KERNEL); if (!get_ptype_info) return -ENOMEM; @@ -3435,15 +3434,13 @@ static int idpf_vport_params_buf_alloc(struct idpf_adapter *adapter) { u16 num_max_vports = idpf_get_max_vports(adapter); - adapter->vport_params_reqd = kcalloc(num_max_vports, - sizeof(*adapter->vport_params_reqd), - GFP_KERNEL); + adapter->vport_params_reqd = kzalloc_objs(*adapter->vport_params_reqd, + num_max_vports, GFP_KERNEL); if (!adapter->vport_params_reqd) return -ENOMEM; - adapter->vport_params_recvd = kcalloc(num_max_vports, - sizeof(*adapter->vport_params_recvd), - GFP_KERNEL); + adapter->vport_params_recvd = kzalloc_objs(*adapter->vport_params_recvd, + num_max_vports, GFP_KERNEL); if (!adapter->vport_params_recvd) goto err_mem; @@ -3454,9 +3451,8 @@ static int idpf_vport_params_buf_alloc(struct idpf_adapter *adapter) if (adapter->vport_config) return 0; - adapter->vport_config = kcalloc(num_max_vports, - sizeof(*adapter->vport_config), - GFP_KERNEL); + adapter->vport_config = kzalloc_objs(*adapter->vport_config, + num_max_vports, GFP_KERNEL); if (!adapter->vport_config) goto err_mem; @@ -3488,7 +3484,8 @@ int idpf_vc_core_init(struct idpf_adapter *adapter) int err = 0; if (!adapter->vcxn_mngr) { - adapter->vcxn_mngr = kzalloc(sizeof(*adapter->vcxn_mngr), GFP_KERNEL); + adapter->vcxn_mngr = kzalloc_obj(*adapter->vcxn_mngr, + GFP_KERNEL); if (!adapter->vcxn_mngr) { err = -ENOMEM; goto init_failed; @@ -3560,15 +3557,14 @@ restart: pci_sriov_set_totalvfs(adapter->pdev, idpf_get_max_vfs(adapter)); num_max_vports = idpf_get_max_vports(adapter); adapter->max_vports = num_max_vports; - adapter->vports = kcalloc(num_max_vports, sizeof(*adapter->vports), - GFP_KERNEL); + adapter->vports = kzalloc_objs(*adapter->vports, num_max_vports, + GFP_KERNEL); if (!adapter->vports) return -ENOMEM; if (!adapter->netdevs) { - adapter->netdevs = kcalloc(num_max_vports, - sizeof(struct net_device *), - GFP_KERNEL); + adapter->netdevs = kzalloc_objs(struct net_device *, + num_max_vports, GFP_KERNEL); if (!adapter->netdevs) { err = -ENOMEM; goto err_netdev_alloc; @@ -4335,8 +4331,8 @@ int idpf_add_del_mac_filters(struct idpf_adapter *adapter, } /* Fill all the new filters into virtchannel message */ - mac_addr = kcalloc(total_filters, sizeof(struct virtchnl2_mac_addr), - GFP_ATOMIC); + mac_addr = kzalloc_objs(struct virtchnl2_mac_addr, total_filters, + GFP_ATOMIC); if (!mac_addr) { spin_unlock_bh(&vport_config->mac_filter_list_lock); diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c index 61cedb6f2854..2980164ba9fb 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c @@ -39,8 +39,8 @@ int idpf_ptp_get_caps(struct idpf_adapter *adapter) u32 temp_offset; int reply_sz; - recv_ptp_caps_msg = kzalloc(sizeof(struct virtchnl2_ptp_get_caps), - GFP_KERNEL); + recv_ptp_caps_msg = kzalloc_obj(struct virtchnl2_ptp_get_caps, + GFP_KERNEL); if (!recv_ptp_caps_msg) return -ENOMEM; @@ -395,7 +395,7 @@ int idpf_ptp_get_vport_tstamps_caps(struct idpf_vport *vport) for (u16 i = 0; i < tstamp_caps->num_entries; i++) { __le32 offset_l, offset_h; - ptp_tx_tstamp = kzalloc(sizeof(*ptp_tx_tstamp), GFP_KERNEL); + ptp_tx_tstamp = kzalloc_obj(*ptp_tx_tstamp, GFP_KERNEL); if (!ptp_tx_tstamp) { err = -ENOMEM; goto err_free_ptp_tx_stamp_list; diff --git a/drivers/net/ethernet/intel/idpf/xdp.c b/drivers/net/ethernet/intel/idpf/xdp.c index 2b60f2a78684..a94bde86f84f 100644 --- a/drivers/net/ethernet/intel/idpf/xdp.c +++ b/drivers/net/ethernet/intel/idpf/xdp.c @@ -154,7 +154,7 @@ int idpf_xdpsqs_get(const struct idpf_vport *vport) if (!idpf_xdp_enabled(vport)) return 0; - timers = kvcalloc(vport->num_xdp_txq, sizeof(*timers), GFP_KERNEL); + timers = kvzalloc_objs(*timers, vport->num_xdp_txq, GFP_KERNEL); if (!timers) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index b507576b28b2..117d2a0ca620 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2919,7 +2919,7 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter, if ((fsp->flow_type & ~FLOW_EXT) != ETHER_FLOW) return -EINVAL; - input = kzalloc(sizeof(*input), GFP_KERNEL); + input = kzalloc_obj(*input, GFP_KERNEL); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index dbea37269d2c..5dc97daf6ac1 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2711,7 +2711,7 @@ static int igb_configure_clsflower(struct igb_adapter *adapter, return -EINVAL; } - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; @@ -3775,8 +3775,9 @@ static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs, bool reinit) } else adapter->vfs_allocated_count = num_vfs; - adapter->vf_data = kcalloc(adapter->vfs_allocated_count, - sizeof(struct vf_data_storage), GFP_KERNEL); + adapter->vf_data = kzalloc_objs(struct vf_data_storage, + adapter->vfs_allocated_count, + GFP_KERNEL); /* if allocation failed then we do not support SR-IOV */ if (!adapter->vf_data) { @@ -3794,9 +3795,8 @@ static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs, bool reinit) (1 + IGB_PF_MAC_FILTERS_RESERVED + adapter->vfs_allocated_count); - adapter->vf_mac_list = kcalloc(num_vf_mac_filters, - sizeof(struct vf_mac_filter), - GFP_KERNEL); + adapter->vf_mac_list = kzalloc_objs(struct vf_mac_filter, + num_vf_mac_filters, GFP_KERNEL); mac_list = adapter->vf_mac_list; INIT_LIST_HEAD(&adapter->vf_macs.l); @@ -4091,9 +4091,8 @@ static int igb_sw_init(struct igb_adapter *adapter) /* Assume MSI-X interrupts, will be checked during IRQ allocation */ adapter->flags |= IGB_FLAG_HAS_MSIX; - adapter->mac_table = kcalloc(hw->mac.rar_entry_count, - sizeof(struct igb_mac_addr), - GFP_KERNEL); + adapter->mac_table = kzalloc_objs(struct igb_mac_addr, + hw->mac.rar_entry_count, GFP_KERNEL); if (!adapter->mac_table) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index ac57212ab02b..72ea2e6ce15b 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -1017,8 +1017,7 @@ static void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter) int i; /* we allocate 3 vectors, 1 for Tx, 1 for Rx, one for PF messages */ - adapter->msix_entries = kcalloc(3, sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, 3, GFP_KERNEL); if (adapter->msix_entries) { for (i = 0; i < 3; i++) adapter->msix_entries[i].entry = i; @@ -1098,11 +1097,11 @@ static int igbvf_alloc_queues(struct igbvf_adapter *adapter) { struct net_device *netdev = adapter->netdev; - adapter->tx_ring = kzalloc(sizeof(struct igbvf_ring), GFP_KERNEL); + adapter->tx_ring = kzalloc_obj(struct igbvf_ring, GFP_KERNEL); if (!adapter->tx_ring) return -ENOMEM; - adapter->rx_ring = kzalloc(sizeof(struct igbvf_ring), GFP_KERNEL); + adapter->rx_ring = kzalloc_obj(struct igbvf_ring, GFP_KERNEL); if (!adapter->rx_ring) { kfree(adapter->tx_ring); return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 3172cdbca9cc..35b74213ca8b 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1395,7 +1395,7 @@ static int igc_ethtool_add_nfc_rule(struct igc_adapter *adapter, return -EINVAL; } - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igc/igc_leds.c b/drivers/net/ethernet/intel/igc/igc_leds.c index 3929b25b6ae6..d6e011695adc 100644 --- a/drivers/net/ethernet/intel/igc/igc_leds.c +++ b/drivers/net/ethernet/intel/igc/igc_leds.c @@ -268,7 +268,7 @@ int igc_led_setup(struct igc_adapter *adapter) mutex_init(&adapter->led_mutex); - leds = kcalloc(IGC_NUM_LEDS, sizeof(*leds), GFP_KERNEL); + leds = kzalloc_objs(*leds, IGC_NUM_LEDS, GFP_KERNEL); if (!leds) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 89a321a344d2..73d841e63d2d 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4633,8 +4633,8 @@ static void igc_set_interrupt_capability(struct igc_adapter *adapter, /* add 1 vector for link status interrupts */ numvecs++; - adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, numvecs, + GFP_KERNEL); if (!adapter->msix_entries) return; @@ -4863,8 +4863,7 @@ static int igc_alloc_q_vector(struct igc_adapter *adapter, /* allocate q_vector and rings */ q_vector = adapter->q_vector[v_idx]; if (!q_vector) - q_vector = kzalloc(struct_size(q_vector, ring, ring_count), - GFP_KERNEL); + q_vector = kzalloc_flex(*q_vector, ring, ring_count, GFP_KERNEL); else memset(q_vector, 0, struct_size(q_vector, ring, ring_count)); if (!q_vector) diff --git a/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c b/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c index d227f4d2a2d1..165a8f12745f 100644 --- a/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c @@ -318,7 +318,7 @@ static int ixgbe_devlink_info_get(struct devlink *devlink, struct ixgbe_info_ctx *ctx; int err; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index 3dd5a16a14df..0ecc4f7d0288 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c @@ -516,8 +516,8 @@ static int ixgbe_dcbnl_ieee_setets(struct net_device *dev, return -EINVAL; if (!adapter->ixgbe_ieee_ets) { - adapter->ixgbe_ieee_ets = kmalloc(sizeof(struct ieee_ets), - GFP_KERNEL); + adapter->ixgbe_ieee_ets = kmalloc_obj(struct ieee_ets, + GFP_KERNEL); if (!adapter->ixgbe_ieee_ets) return -ENOMEM; @@ -593,8 +593,8 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev, return -EINVAL; if (!adapter->ixgbe_ieee_pfc) { - adapter->ixgbe_ieee_pfc = kmalloc(sizeof(struct ieee_pfc), - GFP_KERNEL); + adapter->ixgbe_ieee_pfc = kmalloc_obj(struct ieee_pfc, + GFP_KERNEL); if (!adapter->ixgbe_ieee_pfc) return -ENOMEM; } diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c index c2f8189a0738..f8a4331e8fe3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c @@ -1285,7 +1285,7 @@ int ixgbe_update_link_info(struct ixgbe_hw *hw) if (!(li->link_info & IXGBE_ACI_MEDIA_AVAILABLE)) return 0; - pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); if (!pcaps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index bb4b53fee234..56aabaa5caec 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -2981,7 +2981,7 @@ static int ixgbe_add_ethtool_fdir_entry(struct ixgbe_adapter *adapter, return -EINVAL; } - input = kzalloc(sizeof(*input), GFP_ATOMIC); + input = kzalloc_obj(*input, GFP_ATOMIC); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c index e5479fc07a07..c44c9bf53cc4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c @@ -516,7 +516,7 @@ int ixgbe_get_pending_updates(struct ixgbe_adapter *adapter, u8 *pending, struct ixgbe_hw *hw = &adapter->hw; int err; - dev_caps = kzalloc(sizeof(*dev_caps), GFP_KERNEL); + dev_caps = kzalloc_obj(*dev_caps, GFP_KERNEL); if (!dev_caps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c index d1f4073b36f9..6da3e52cea7a 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c @@ -904,7 +904,7 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) goto err_out; } - xs = kzalloc(sizeof(*xs), GFP_ATOMIC); + xs = kzalloc_obj(*xs, GFP_ATOMIC); if (unlikely(!xs)) { err = -ENOMEM; goto err_out; @@ -1233,7 +1233,7 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter) if (t_dis || r_dis) return; - ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); if (!ipsec) goto err1; hash_init(ipsec->rx_sa_list); diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c index a1d04914fbbc..f5c00cf57d43 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c @@ -768,9 +768,8 @@ static int ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter) */ vector_threshold = MIN_MSIX_COUNT; - adapter->msix_entries = kcalloc(vectors, - sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, vectors, + GFP_KERNEL); if (!adapter->msix_entries) return -ENOMEM; @@ -859,8 +858,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, q_vector = kzalloc_node(struct_size(q_vector, ring, ring_count), GFP_KERNEL, node); if (!q_vector) - q_vector = kzalloc(struct_size(q_vector, ring, ring_count), - GFP_KERNEL); + q_vector = kzalloc_flex(*q_vector, ring, ring_count, GFP_KERNEL); if (!q_vector) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index c58051e4350b..59b3acb62134 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -6895,8 +6895,8 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter, #endif /* IXGBE_FCOE */ /* initialize static ixgbe jump table entries */ - adapter->jump_tables[0] = kzalloc(sizeof(*adapter->jump_tables[0]), - GFP_KERNEL); + adapter->jump_tables[0] = kzalloc_obj(*adapter->jump_tables[0], + GFP_KERNEL); if (!adapter->jump_tables[0]) return -ENOMEM; adapter->jump_tables[0]->mat = ixgbe_ipv4_fields; @@ -6904,9 +6904,8 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter, for (i = 1; i < IXGBE_MAX_LINK_HANDLE; i++) adapter->jump_tables[i] = NULL; - adapter->mac_table = kcalloc(hw->mac.num_rar_entries, - sizeof(struct ixgbe_mac_addr), - GFP_KERNEL); + adapter->mac_table = kzalloc_objs(struct ixgbe_mac_addr, + hw->mac.num_rar_entries, GFP_KERNEL); if (!adapter->mac_table) return -ENOMEM; @@ -10273,15 +10272,15 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, (__force u32)cls->knode.sel->offmask) return err; - jump = kzalloc(sizeof(*jump), GFP_KERNEL); + jump = kzalloc_obj(*jump, GFP_KERNEL); if (!jump) return -ENOMEM; - input = kzalloc(sizeof(*input), GFP_KERNEL); + input = kzalloc_obj(*input, GFP_KERNEL); if (!input) { err = -ENOMEM; goto free_jump; } - mask = kzalloc(sizeof(*mask), GFP_KERNEL); + mask = kzalloc_obj(*mask, GFP_KERNEL); if (!mask) { err = -ENOMEM; goto free_input; @@ -10305,10 +10304,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, return 0; } - input = kzalloc(sizeof(*input), GFP_KERNEL); + input = kzalloc_obj(*input, GFP_KERNEL); if (!input) return -ENOMEM; - mask = kzalloc(sizeof(*mask), GFP_KERNEL); + mask = kzalloc_obj(*mask, GFP_KERNEL); if (!mask) { err = -ENOMEM; goto free_input; @@ -10786,7 +10785,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) return ERR_PTR(-ENOMEM); } - accel = kzalloc(sizeof(*accel), GFP_KERNEL); + accel = kzalloc_obj(*accel, GFP_KERNEL); if (!accel) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index ee133d6749b3..40dfdf62ab33 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -37,8 +37,7 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter, if (!num_vf_macvlans) return; - mv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans), - GFP_KERNEL); + mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans, GFP_KERNEL); if (mv_list) { for (i = 0; i < num_vf_macvlans; i++) { mv_list[i].vf = -1; @@ -65,8 +64,8 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter, IXGBE_FLAG_VMDQ_ENABLED; /* Allocate memory for per VF control structures */ - adapter->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage), - GFP_KERNEL); + adapter->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs, + GFP_KERNEL); if (!adapter->vfinfo) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c b/drivers/net/ethernet/intel/ixgbevf/ipsec.c index fce35924ff8b..780ebcdbd4a7 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c +++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c @@ -628,7 +628,7 @@ void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter) return; } - ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); if (!ipsec) goto err1; hash_init(ipsec->rx_sa_list); diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index d5ce20f47def..38af1f35b339 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -2716,8 +2716,8 @@ static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter) v_budget = min_t(int, v_budget, num_online_cpus()); v_budget += NON_Q_VECTORS; - adapter->msix_entries = kcalloc(v_budget, - sizeof(struct msix_entry), GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, v_budget, + GFP_KERNEL); if (!adapter->msix_entries) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/libie/fwlog.c b/drivers/net/ethernet/intel/libie/fwlog.c index f39cc11cb7c5..5b69a26ef2bd 100644 --- a/drivers/net/ethernet/intel/libie/fwlog.c +++ b/drivers/net/ethernet/intel/libie/fwlog.c @@ -153,7 +153,7 @@ static void libie_fwlog_realloc_rings(struct libie_fwlog *fwlog, int index) * old rings and buffers. that way if we don't have enough * memory then we at least have what we had before */ - ring.rings = kcalloc(ring_size, sizeof(*ring.rings), GFP_KERNEL); + ring.rings = kzalloc_objs(*ring.rings, ring_size, GFP_KERNEL); if (!ring.rings) return; @@ -208,7 +208,7 @@ libie_aq_fwlog_set(struct libie_fwlog *fwlog, int status; int i; - fw_modules = kcalloc(num_entries, sizeof(*fw_modules), GFP_KERNEL); + fw_modules = kzalloc_objs(*fw_modules, num_entries, GFP_KERNEL); if (!fw_modules) return -ENOMEM; @@ -838,8 +838,8 @@ static void libie_debugfs_fwlog_init(struct libie_fwlog *fwlog, /* allocate space for this first because if it fails then we don't * need to unwind */ - fw_modules = kcalloc(LIBIE_NR_FW_LOG_MODULES, sizeof(*fw_modules), - GFP_KERNEL); + fw_modules = kzalloc_objs(*fw_modules, LIBIE_NR_FW_LOG_MODULES, + GFP_KERNEL); if (!fw_modules) return; @@ -978,7 +978,7 @@ static void libie_fwlog_set_supported(struct libie_fwlog *fwlog) fwlog->supported = false; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return; @@ -1013,9 +1013,9 @@ int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api) if (status) return status; - fwlog->ring.rings = kcalloc(LIBIE_FWLOG_RING_SIZE_DFLT, - sizeof(*fwlog->ring.rings), - GFP_KERNEL); + fwlog->ring.rings = kzalloc_objs(*fwlog->ring.rings, + LIBIE_FWLOG_RING_SIZE_DFLT, + GFP_KERNEL); if (!fwlog->ring.rings) { dev_warn(&fwlog->pdev->dev, "Unable to allocate memory for FW log rings\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index d8be0e4dcb07..25ec5f757c68 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c @@ -576,9 +576,9 @@ jme_setup_tx_resources(struct jme_adapter *jme) atomic_set(&txring->next_to_clean, 0); atomic_set(&txring->nr_free, jme->tx_ring_size); - txring->bufinf = kcalloc(jme->tx_ring_size, - sizeof(struct jme_buffer_info), - GFP_ATOMIC); + txring->bufinf = kzalloc_objs(struct jme_buffer_info, + jme->tx_ring_size, + GFP_ATOMIC); if (unlikely(!(txring->bufinf))) goto err_free_txring; @@ -819,9 +819,9 @@ jme_setup_rx_resources(struct jme_adapter *jme) rxring->next_to_use = 0; atomic_set(&rxring->next_to_clean, 0); - rxring->bufinf = kcalloc(jme->rx_ring_size, - sizeof(struct jme_buffer_info), - GFP_ATOMIC); + rxring->bufinf = kzalloc_objs(struct jme_buffer_info, + jme->rx_ring_size, + GFP_ATOMIC); if (unlikely(!(rxring->bufinf))) goto err_free_rxring; diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 0ab52c57c648..1bc31e0b443d 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -1967,8 +1967,7 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) memset(rxq->rx_desc_area, 0, size); rxq->rx_desc_area_size = size; - rxq->rx_skb = kcalloc(rxq->rx_ring_size, sizeof(*rxq->rx_skb), - GFP_KERNEL); + rxq->rx_skb = kzalloc_objs(*rxq->rx_skb, rxq->rx_ring_size, GFP_KERNEL); if (rxq->rx_skb == NULL) goto out_free; diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 7af44f858fa3..c058df3bb85f 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3554,7 +3554,7 @@ static int mvneta_txq_sw_init(struct mvneta_port *pp, txq->last_desc = txq->size - 1; - txq->buf = kmalloc_array(txq->size, sizeof(*txq->buf), GFP_KERNEL); + txq->buf = kmalloc_objs(*txq->buf, txq->size, GFP_KERNEL); if (!txq->buf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index c116da7d7f18..83ba45f54180 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1367,7 +1367,7 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port, if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW) return -EINVAL; - efs = kzalloc(sizeof(*efs), GFP_KERNEL); + efs = kzalloc_obj(*efs, GFP_KERNEL); if (!efs) return -ENOMEM; @@ -1503,8 +1503,7 @@ static int mvpp22_rss_context_create(struct mvpp2_port *port, u32 *rss_ctx) if (ctx == MVPP22_N_RSS_TABLES) return -EINVAL; - priv->rss_tables[ctx] = kzalloc(sizeof(*priv->rss_tables[ctx]), - GFP_KERNEL); + priv->rss_tables[ctx] = kzalloc_obj(*priv->rss_tables[ctx], GFP_KERNEL); if (!priv->rss_tables[ctx]) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c index 0f9bc4f8ec3b..2aef0c77f4d6 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c @@ -706,7 +706,7 @@ void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name) mvpp2_dir = debugfs_create_dir(name, mvpp2_root); priv->dbgfs_dir = mvpp2_dir; - priv->dbgfs_entries = kzalloc(sizeof(*priv->dbgfs_entries), GFP_KERNEL); + priv->dbgfs_entries = kzalloc_obj(*priv->dbgfs_entries, GFP_KERNEL); if (!priv->dbgfs_entries) goto err; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 33426fded919..58f77972c86a 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3151,9 +3151,8 @@ static int mvpp2_txq_init(struct mvpp2_port *port, for (thread = 0; thread < port->priv->nthreads; thread++) { txq_pcpu = per_cpu_ptr(txq->pcpu, thread); txq_pcpu->size = txq->size; - txq_pcpu->buffs = kmalloc_array(txq_pcpu->size, - sizeof(*txq_pcpu->buffs), - GFP_KERNEL); + txq_pcpu->buffs = kmalloc_objs(*txq_pcpu->buffs, txq_pcpu->size, + GFP_KERNEL); if (!txq_pcpu->buffs) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 57db7ea2f5be..fd9abcfeb4e0 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -115,8 +115,8 @@ static int octep_enable_msix_range(struct octep_device *oct) /* Generic interrupts apart from input/output queues */ num_msix = oct->num_oqs + CFG_GET_NON_IOQ_MSIX(oct->conf); - oct->msix_entries = kcalloc(num_msix, - sizeof(struct msix_entry), GFP_KERNEL); + oct->msix_entries = kzalloc_objs(struct msix_entry, num_msix, + GFP_KERNEL); if (!oct->msix_entries) goto msix_alloc_err; @@ -1293,7 +1293,7 @@ int octep_device_setup(struct octep_device *oct) int i, ret; /* allocate memory for oct->conf */ - oct->conf = kzalloc(sizeof(*oct->conf), GFP_KERNEL); + oct->conf = kzalloc_obj(*oct->conf, GFP_KERNEL); if (!oct->conf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c index 1d9760b4b8f4..b794b517c304 100644 --- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c @@ -113,7 +113,8 @@ static int octep_vf_enable_msix_range(struct octep_vf_device *oct) /* Generic interrupts apart from input/output queues */ //num_msix = oct->num_oqs + CFG_GET_NON_IOQ_MSIX(oct->conf); num_msix = oct->num_oqs; - oct->msix_entries = kcalloc(num_msix, sizeof(struct msix_entry), GFP_KERNEL); + oct->msix_entries = kzalloc_objs(struct msix_entry, num_msix, + GFP_KERNEL); if (!oct->msix_entries) goto msix_alloc_err; @@ -951,7 +952,7 @@ int octep_vf_device_setup(struct octep_vf_device *oct) struct pci_dev *pdev = oct->pdev; /* allocate memory for oct->conf */ - oct->conf = kzalloc(sizeof(*oct->conf), GFP_KERNEL); + oct->conf = kzalloc_obj(*oct->conf, GFP_KERNEL); if (!oct->conf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index fd4792e432bf..dc4537623578 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1725,7 +1725,7 @@ static int cgx_lmac_init(struct cgx *cgx) cgx->lmac_count = cgx->max_lmac_per_mac; for (i = 0; i < cgx->lmac_count; i++) { - lmac = kzalloc(sizeof(struct lmac), GFP_KERNEL); + lmac = kzalloc_obj(struct lmac, GFP_KERNEL); if (!lmac) return -ENOMEM; lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL); diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c index 75872d257eca..ad62be730bbc 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c @@ -133,7 +133,7 @@ int cn20k_mbox_setup(struct otx2_mbox *mbox, struct pci_dev *pdev, mbox->reg_base = reg_base; mbox->pdev = pdev; - mbox->dev = kcalloc(ndevs, sizeof(struct otx2_mbox_dev), GFP_KERNEL); + mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs, GFP_KERNEL); if (!mbox->dev) { otx2_mbox_destroy(mbox); return -ENOMEM; @@ -211,7 +211,7 @@ static int otx2_mbox_setup(struct otx2_mbox *mbox, struct pci_dev *pdev, mbox->reg_base = reg_base; mbox->pdev = pdev; - mbox->dev = kcalloc(ndevs, sizeof(struct otx2_mbox_dev), GFP_KERNEL); + mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs, GFP_KERNEL); if (!mbox->dev) { otx2_mbox_destroy(mbox); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c index a80c8e7c94f2..d98b49f47970 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c @@ -105,7 +105,7 @@ int mcs_add_intr_wq_entry(struct mcs *mcs, struct mcs_intr_event *event) if (!(pfvf->intr_mask && event->intr_mask)) return 0; - qentry = kmalloc(sizeof(*qentry), GFP_ATOMIC); + qentry = kmalloc_obj(*qentry, GFP_ATOMIC); if (!qentry) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c index 66749b3649c1..f38b5addd4d8 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c @@ -520,7 +520,7 @@ static int ptp_probe(struct pci_dev *pdev, struct ptp *ptp; int err; - ptp = kzalloc(sizeof(*ptp), GFP_KERNEL); + ptp = kzalloc_obj(*ptp, GFP_KERNEL); if (!ptp) { err = -ENOMEM; goto error; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 8530df8b3fda..2e3b3345a362 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2516,7 +2516,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, if (!pf_bmap) return -ENOMEM; - ng_rvu_mbox = kzalloc(sizeof(*ng_rvu_mbox), GFP_KERNEL); + ng_rvu_mbox = kzalloc_obj(*ng_rvu_mbox, GFP_KERNEL); if (!ng_rvu_mbox) { err = -ENOMEM; goto free_bitmap; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c index 3d91a34f8b57..b9980253dcb0 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c @@ -184,7 +184,7 @@ static int rvu_cgx_send_link_info(int cgx_id, int lmac_id, struct rvu *rvu) unsigned long flags; int err; - qentry = kmalloc(sizeof(*qentry), GFP_KERNEL); + qentry = kmalloc_obj(*qentry, GFP_KERNEL); if (!qentry) return -ENOMEM; @@ -215,7 +215,7 @@ static int cgx_lmac_postevent(struct cgx_link_event *event, void *data) struct rvu *rvu = data; /* post event to the event queue */ - qentry = kmalloc(sizeof(*qentry), GFP_ATOMIC); + qentry = kmalloc_obj(*qentry, GFP_ATOMIC); if (!qentry) return -ENOMEM; qentry->link_event = *event; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c index 0f9953eaf1b0..71c411d8eb83 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -494,12 +494,12 @@ static int rvu_nix_register_reporters(struct rvu_devlink *rvu_dl) struct rvu_nix_event_ctx *nix_event_context; struct rvu *rvu = rvu_dl->rvu; - rvu_reporters = kzalloc(sizeof(*rvu_reporters), GFP_KERNEL); + rvu_reporters = kzalloc_obj(*rvu_reporters, GFP_KERNEL); if (!rvu_reporters) return -ENOMEM; rvu_dl->rvu_nix_health_reporter = rvu_reporters; - nix_event_context = kzalloc(sizeof(*nix_event_context), GFP_KERNEL); + nix_event_context = kzalloc_obj(*nix_event_context, GFP_KERNEL); if (!nix_event_context) return -ENOMEM; @@ -1048,12 +1048,12 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl) struct rvu_npa_event_ctx *npa_event_context; struct rvu *rvu = rvu_dl->rvu; - rvu_reporters = kzalloc(sizeof(*rvu_reporters), GFP_KERNEL); + rvu_reporters = kzalloc_obj(*rvu_reporters, GFP_KERNEL); if (!rvu_reporters) return -ENOMEM; rvu_dl->rvu_npa_health_reporter = rvu_reporters; - npa_event_context = kzalloc(sizeof(*npa_event_context), GFP_KERNEL); + npa_event_context = kzalloc_obj(*npa_event_context, GFP_KERNEL); if (!npa_event_context) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 49f7ff5eddfc..0964a85b536f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -2455,7 +2455,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, } /* XOFF all TL2s whose parent TL1 matches SMQ tree TL1 */ - smq_flush_ctx = kzalloc(sizeof(*smq_flush_ctx), GFP_KERNEL); + smq_flush_ctx = kzalloc_obj(*smq_flush_ctx, GFP_KERNEL); if (!smq_flush_ctx) return -ENOMEM; nix_smq_flush_fill_ctx(rvu, blkaddr, smq, smq_flush_ctx); @@ -3373,7 +3373,7 @@ static int nix_add_mce_list_entry(struct rvu *rvu, mce_list = &elem->mcast_mce_list; for (i = 0; i < num_entry; i++) { - mce = kzalloc(sizeof(*mce), GFP_KERNEL); + mce = kzalloc_obj(*mce, GFP_KERNEL); if (!mce) goto free_mce; @@ -3435,7 +3435,7 @@ static int nix_update_mce_list_entry(struct nix_mce_list *mce_list, return 0; /* Add a new one to the list, at the tail */ - mce = kzalloc(sizeof(*mce), GFP_KERNEL); + mce = kzalloc_obj(*mce, GFP_KERNEL); if (!mce) return -ENOMEM; mce->pcifunc = pcifunc; @@ -6420,7 +6420,7 @@ int rvu_mbox_handler_nix_mcast_grp_create(struct rvu *rvu, return err; mcast_grp = &nix_hw->mcast_grp; - elem = kzalloc(sizeof(*elem), GFP_KERNEL); + elem = kzalloc_obj(*elem, GFP_KERNEL); if (!elem) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c index b56395ac5a74..1b7dd4e771c7 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -1297,7 +1297,7 @@ static int npc_install_flow(struct rvu *rvu, int blkaddr, u16 target, find_rule: rule = rvu_mcam_find_rule(mcam, entry_index); if (!rule) { - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; new = true; @@ -1741,7 +1741,7 @@ int npc_install_mcam_drop_rule(struct rvu *rvu, int mcam_idx, u16 *counter_idx, } /* Add this entry to mcam rules list */ - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 999f6d93c7fe..7ed5750435c1 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -796,7 +796,7 @@ static int rvu_npc_exact_add_to_list(struct rvu *rvu, enum npc_exact_opc_type op return -EFAULT; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { rvu_npc_exact_free_id(rvu, *seq_id); dev_err(rvu->dev, "%s: Memory allocation failed\n", __func__); @@ -1896,7 +1896,7 @@ int rvu_npc_exact_init(struct rvu *rvu) /* Set capability to true */ rvu->hw->cap.npc_exact_match_enabled = true; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c index 4415d0ce9aef..901f6fd40fd4 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c @@ -97,7 +97,7 @@ int rvu_mbox_handler_rep_event_notify(struct rvu *rvu, struct rep_event *req, { struct rep_evtq_ent *qentry; - qentry = kmalloc(sizeof(*qentry), GFP_ATOMIC); + qentry = kmalloc_obj(*qentry, GFP_ATOMIC); if (!qentry) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c index 060c715ebad0..5f90f38071da 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c @@ -914,7 +914,7 @@ static struct cn10k_mcs_txsc *cn10k_mcs_create_txsc(struct otx2_nic *pfvf) struct cn10k_mcs_txsc *txsc; int ret; - txsc = kzalloc(sizeof(*txsc), GFP_KERNEL); + txsc = kzalloc_obj(*txsc, GFP_KERNEL); if (!txsc) return ERR_PTR(-ENOMEM); @@ -987,7 +987,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf) struct cn10k_mcs_rxsc *rxsc; int ret; - rxsc = kzalloc(sizeof(*rxsc), GFP_KERNEL); + rxsc = kzalloc_obj(*rxsc, GFP_KERNEL); if (!rxsc) return ERR_PTR(-ENOMEM); @@ -1772,7 +1772,7 @@ int cn10k_mcs_init(struct otx2_nic *pfvf) if (!test_bit(CN10K_HW_MACSEC, &pfvf->hw.cap_flag)) return 0; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 75ebb17419c4..768503b255fb 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -1005,7 +1005,7 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura) } sq->sqe_base = sq->sqe->base; - sq->sg = kcalloc(qset->sqe_cnt, sizeof(struct sg_list), GFP_KERNEL); + sq->sg = kzalloc_objs(struct sg_list, qset->sqe_cnt, GFP_KERNEL); if (!sq->sg) return -ENOMEM; @@ -1585,7 +1585,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf) sq = &qset->sq[qidx]; sq->sqb_count = 0; - sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs), GFP_KERNEL); + sq->sqb_ptrs = kzalloc_objs(*sq->sqb_ptrs, num_sqbs, GFP_KERNEL); if (!sq->sqb_ptrs) { err = -ENOMEM; goto err_mem; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c index 64c6d9162ef6..f61730e8d73a 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -1063,7 +1063,7 @@ static int otx2_add_flow_with_pfmac(struct otx2_nic *pfvf, struct otx2_flow *pf_mac; struct ethhdr *eth_hdr; - pf_mac = kzalloc(sizeof(*pf_mac), GFP_KERNEL); + pf_mac = kzalloc_obj(*pf_mac, GFP_KERNEL); if (!pf_mac) return -ENOMEM; @@ -1131,7 +1131,7 @@ int otx2_add_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc) flow = otx2_find_flow(pfvf, fsp->location); if (!flow) { - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (!flow) return -ENOMEM; flow->location = fsp->location; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 444bb67494ab..333071ac7598 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1936,7 +1936,7 @@ int otx2_alloc_queue_mem(struct otx2_nic *pf) pf->qset.cq_cnt = pf->hw.rx_queues + otx2_get_total_tx_queues(pf); - qset->napi = kcalloc(pf->hw.cint_cnt, sizeof(*cq_poll), GFP_KERNEL); + qset->napi = kzalloc_objs(*cq_poll, pf->hw.cint_cnt, GFP_KERNEL); if (!qset->napi) return -ENOMEM; @@ -1945,18 +1945,18 @@ int otx2_alloc_queue_mem(struct otx2_nic *pf) /* CQ size of SQ */ qset->sqe_cnt = qset->sqe_cnt ? qset->sqe_cnt : Q_COUNT(Q_SIZE_4K); - qset->cq = kcalloc(pf->qset.cq_cnt, - sizeof(struct otx2_cq_queue), GFP_KERNEL); + qset->cq = kzalloc_objs(struct otx2_cq_queue, pf->qset.cq_cnt, + GFP_KERNEL); if (!qset->cq) goto err_free_mem; - qset->sq = kcalloc(otx2_get_total_tx_queues(pf), - sizeof(struct otx2_snd_queue), GFP_KERNEL); + qset->sq = kzalloc_objs(struct otx2_snd_queue, + otx2_get_total_tx_queues(pf), GFP_KERNEL); if (!qset->sq) goto err_free_mem; - qset->rq = kcalloc(pf->hw.rx_queues, - sizeof(struct otx2_rcv_queue), GFP_KERNEL); + qset->rq = kzalloc_objs(struct otx2_rcv_queue, pf->hw.rx_queues, + GFP_KERNEL); if (!qset->rq) goto err_free_mem; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c index dedd586ed310..de9b90e498cc 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c @@ -408,7 +408,7 @@ int otx2_ptp_init(struct otx2_nic *pfvf) } mutex_unlock(&pfvf->mbox.lock); - ptp_ptr = kzalloc(sizeof(*ptp_ptr), GFP_KERNEL); + ptp_ptr = kzalloc_obj(*ptp_ptr, GFP_KERNEL); if (!ptp_ptr) { err = -ENOMEM; goto error; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c index 26a08d2cfbb1..9b569e0d6222 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c @@ -1271,7 +1271,7 @@ static int otx2_tc_add_flow(struct otx2_nic *nic, } /* allocate memory for the new flow and it's node */ - new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); + new_node = kzalloc_obj(*new_node, GFP_KERNEL); if (!new_node) return -ENOMEM; spin_lock_init(&new_node->lock); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c index 5765bac119f0..435c176c2643 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c @@ -407,7 +407,7 @@ otx2_qos_alloc_root(struct otx2_nic *pfvf) { struct otx2_qos_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); @@ -463,7 +463,7 @@ static int otx2_qos_alloc_txschq_node(struct otx2_nic *pfvf, parent = node; for (lvl = node->level - 1; lvl >= NIX_TXSCH_LVL_MDQ; lvl--) { - txschq_node = kzalloc(sizeof(*txschq_node), GFP_KERNEL); + txschq_node = kzalloc_obj(*txschq_node, GFP_KERNEL); if (!txschq_node) goto err_out; @@ -508,7 +508,7 @@ otx2_qos_sw_create_leaf_node(struct otx2_nic *pfvf, struct otx2_qos_node *node; int err; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); @@ -1045,7 +1045,7 @@ static int otx2_qos_root_add(struct otx2_nic *pfvf, u16 htb_maj_id, u16 htb_defc } /* allocate txschq queue */ - new_cfg = kzalloc(sizeof(*new_cfg), GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); err = -ENOMEM; @@ -1279,7 +1279,7 @@ static int otx2_qos_leaf_alloc_queue(struct otx2_nic *pfvf, u16 classid, set_bit(prio, parent->prio_bmap); /* read current txschq configuration */ - old_cfg = kzalloc(sizeof(*old_cfg), GFP_KERNEL); + old_cfg = kzalloc_obj(*old_cfg, GFP_KERNEL); if (!old_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1308,7 +1308,7 @@ static int otx2_qos_leaf_alloc_queue(struct otx2_nic *pfvf, u16 classid, } /* push new txschq config to hw */ - new_cfg = kzalloc(sizeof(*new_cfg), GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1417,7 +1417,7 @@ static int otx2_qos_leaf_to_inner(struct otx2_nic *pfvf, u16 classid, qid = node->qid; /* read current txschq configuration */ - old_cfg = kzalloc(sizeof(*old_cfg), GFP_KERNEL); + old_cfg = kzalloc_obj(*old_cfg, GFP_KERNEL); if (!old_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1445,7 +1445,7 @@ static int otx2_qos_leaf_to_inner(struct otx2_nic *pfvf, u16 classid, } /* push new txschq config to hw */ - new_cfg = kzalloc(sizeof(*new_cfg), GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1668,7 +1668,7 @@ static int otx2_qos_leaf_del_last(struct otx2_nic *pfvf, u16 classid, bool force __set_bit(qid, pfvf->qos.qos_sq_bmap); /* push new txschq config to hw */ - new_cfg = kzalloc(sizeof(*new_cfg), GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c index b476733a0234..7706ec417d2b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c @@ -40,7 +40,7 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep) int ent, allocated = 0; int count; - rep->flow_cfg = kcalloc(1, sizeof(struct otx2_flow_config), GFP_KERNEL); + rep->flow_cfg = kzalloc_objs(struct otx2_flow_config, 1, GFP_KERNEL); if (!rep->flow_cfg) return -ENOMEM; @@ -504,7 +504,7 @@ static int rvu_rep_napi_init(struct otx2_nic *priv, int err = 0, qidx, vec; char *irq_name; - qset->napi = kcalloc(hw->cint_cnt, sizeof(*cq_poll), GFP_KERNEL); + qset->napi = kzalloc_objs(*cq_poll, hw->cint_cnt, GFP_KERNEL); if (!qset->napi) return -ENOMEM; @@ -656,7 +656,7 @@ int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack *extack) if (err) return -ENOMEM; - priv->reps = kcalloc(rep_cnt, sizeof(struct rep_dev *), GFP_KERNEL); + priv->reps = kzalloc_objs(struct rep_dev *, rep_cnt, GFP_KERNEL); if (!priv->reps) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_acl.c b/drivers/net/ethernet/marvell/prestera/prestera_acl.c index cba89fda504b..02f113f9af9f 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_acl.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_acl.c @@ -144,7 +144,7 @@ prestera_acl_ruleset_create(struct prestera_acl *acl, if (!prestera_acl_chain_is_supported(chain_index, block->ingress)) return ERR_PTR(-EINVAL); - ruleset = kzalloc(sizeof(*ruleset), GFP_KERNEL); + ruleset = kzalloc_obj(*ruleset, GFP_KERNEL); if (!ruleset) return ERR_PTR(-ENOMEM); @@ -438,7 +438,7 @@ prestera_acl_rule_create(struct prestera_acl_ruleset *ruleset, { struct prestera_acl_rule *rule; - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return ERR_PTR(-ENOMEM); @@ -713,7 +713,7 @@ prestera_acl_rule_entry_create(struct prestera_acl *acl, struct prestera_acl_rule_entry *e; int err; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) goto err_kzalloc; @@ -816,7 +816,7 @@ int prestera_acl_vtcam_id_get(struct prestera_acl *acl, u8 lookup, u8 dir, } /* vtcam not found, try to create new one */ - vtcam = kzalloc(sizeof(*vtcam), GFP_KERNEL); + vtcam = kzalloc_obj(*vtcam, GFP_KERNEL); if (!vtcam) return -ENOMEM; @@ -880,7 +880,7 @@ int prestera_acl_init(struct prestera_switch *sw) struct prestera_acl *acl; int err; - acl = kzalloc(sizeof(*acl), GFP_KERNEL); + acl = kzalloc_obj(*acl, GFP_KERNEL); if (!acl) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_counter.c b/drivers/net/ethernet/marvell/prestera/prestera_counter.c index 634f4543c1d7..c59ed115c700 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_counter.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_counter.c @@ -147,7 +147,7 @@ prestera_counter_block_get(struct prestera_counter *counter, u32 client) if (block) return block; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return ERR_PTR(-ENOMEM); @@ -157,8 +157,8 @@ prestera_counter_block_get(struct prestera_counter *counter, u32 client) if (err) goto err_block; - block->stats = kcalloc(block->num_counters, - sizeof(*block->stats), GFP_KERNEL); + block->stats = kzalloc_objs(*block->stats, block->num_counters, + GFP_KERNEL); if (!block->stats) { err = -ENOMEM; goto err_stats; @@ -437,11 +437,11 @@ int prestera_counter_init(struct prestera_switch *sw) { struct prestera_counter *counter; - counter = kzalloc(sizeof(*counter), GFP_KERNEL); + counter = kzalloc_obj(*counter, GFP_KERNEL); if (!counter) return -ENOMEM; - counter->block_list = kzalloc(sizeof(*counter->block_list), GFP_KERNEL); + counter->block_list = kzalloc_obj(*counter->block_list, GFP_KERNEL); if (!counter->block_list) { kfree(counter); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_devlink.c b/drivers/net/ethernet/marvell/prestera/prestera_devlink.c index e63d95c1842f..981b9e835be7 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_devlink.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_devlink.c @@ -451,13 +451,12 @@ int prestera_devlink_traps_register(struct prestera_switch *sw) struct prestera_trap *prestera_trap; int err, i; - trap_data = kzalloc(sizeof(*trap_data), GFP_KERNEL); + trap_data = kzalloc_obj(*trap_data, GFP_KERNEL); if (!trap_data) return -ENOMEM; - trap_data->trap_items_arr = kcalloc(traps_count, - sizeof(struct prestera_trap_item), - GFP_KERNEL); + trap_data->trap_items_arr = kzalloc_objs(struct prestera_trap_item, + traps_count, GFP_KERNEL); if (!trap_data->trap_items_arr) { err = -ENOMEM; goto err_trap_items_alloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flow.c b/drivers/net/ethernet/marvell/prestera/prestera_flow.c index 9f4267f326b0..21c052bfa6e8 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flow.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flow.c @@ -82,7 +82,7 @@ prestera_flow_block_create(struct prestera_switch *sw, { struct prestera_flow_block *block; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return NULL; @@ -130,7 +130,7 @@ static int prestera_flow_block_bind(struct prestera_flow_block *block, struct prestera_flow_block_binding *binding; int err; - binding = kzalloc(sizeof(*binding), GFP_KERNEL); + binding = kzalloc_obj(*binding, GFP_KERNEL); if (!binding) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c index 418101a93149..28077005efaa 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c @@ -495,7 +495,7 @@ int prestera_flower_tmplt_create(struct prestera_flow_block *block, if (err) return err; - template = kmalloc(sizeof(*template), GFP_KERNEL); + template = kmalloc_obj(*template, GFP_KERNEL); if (!template) { err = -ENOMEM; goto err_malloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_hw.c index 197198ba61b1..e20bd0eca18d 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_hw.c @@ -2256,7 +2256,7 @@ int prestera_hw_event_handler_register(struct prestera_switch *sw, if (eh) return -EEXIST; - eh = kmalloc(sizeof(*eh), GFP_KERNEL); + eh = kmalloc_obj(*eh, GFP_KERNEL); if (!eh) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 65e7ef033bde..0d12ed32586b 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -1014,7 +1014,7 @@ static int prestera_lag_init(struct prestera_switch *sw) { u16 id; - sw->lags = kcalloc(sw->lag_max, sizeof(*sw->lags), GFP_KERNEL); + sw->lags = kzalloc_objs(*sw->lags, sw->lag_max, GFP_KERNEL); if (!sw->lags) return -ENOMEM; @@ -1209,7 +1209,7 @@ prestera_mdb_entry_create(struct prestera_switch *sw, struct prestera_flood_domain *flood_domain; struct prestera_mdb_entry *mdb_entry; - mdb_entry = kzalloc(sizeof(*mdb_entry), GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); if (!mdb_entry) goto err_mdb_alloc; @@ -1247,7 +1247,7 @@ prestera_flood_domain_create(struct prestera_switch *sw) { struct prestera_flood_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return NULL; @@ -1279,7 +1279,7 @@ prestera_flood_domain_port_create(struct prestera_flood_domain *flood_domain, bool is_first_port_in_list = false; int err; - flood_domain_port = kzalloc(sizeof(*flood_domain_port), GFP_KERNEL); + flood_domain_port = kzalloc_obj(*flood_domain_port, GFP_KERNEL); if (!flood_domain_port) { err = -ENOMEM; goto err_port_alloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router.c b/drivers/net/ethernet/marvell/prestera/prestera_router.c index de317179a7dc..a75764610eef 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_router.c @@ -485,7 +485,7 @@ __prestera_kern_neigh_cache_create(struct prestera_switch *sw, struct prestera_kern_neigh_cache *n_cache; int err; - n_cache = kzalloc(sizeof(*n_cache), GFP_KERNEL); + n_cache = kzalloc_obj(*n_cache, GFP_KERNEL); if (!n_cache) goto err_kzalloc; @@ -623,7 +623,7 @@ prestera_kern_fib_cache_create(struct prestera_switch *sw, struct prestera_kern_fib_cache *fib_cache; int err; - fib_cache = kzalloc(sizeof(*fib_cache), GFP_KERNEL); + fib_cache = kzalloc_obj(*fib_cache, GFP_KERNEL); if (!fib_cache) goto err_kzalloc; @@ -1448,7 +1448,7 @@ static int __prestera_router_fib_event(struct notifier_block *nb, if (!fen_info->fi) return NOTIFY_DONE; - fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); + fib_work = kzalloc_obj(*fib_work, GFP_ATOMIC); if (WARN_ON(!fib_work)) return NOTIFY_BAD; @@ -1503,7 +1503,7 @@ static int prestera_router_netevent_event(struct notifier_block *nb, if (n->tbl->family != AF_INET) return NOTIFY_DONE; - net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC); + net_work = kzalloc_obj(*net_work, GFP_ATOMIC); if (WARN_ON(!net_work)) return NOTIFY_BAD; @@ -1550,7 +1550,7 @@ int prestera_router_init(struct prestera_switch *sw) struct prestera_router *router; int err, nhgrp_cache_bytes; - router = kzalloc(sizeof(*sw->router), GFP_KERNEL); + router = kzalloc_obj(*sw->router, GFP_KERNEL); if (!router) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c index 02faaea2aefa..b94e28d403e7 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c @@ -127,7 +127,7 @@ static struct prestera_vr *__prestera_vr_create(struct prestera_switch *sw, struct prestera_vr *vr; int err; - vr = kzalloc(sizeof(*vr), GFP_KERNEL); + vr = kzalloc_obj(*vr, GFP_KERNEL); if (!vr) { err = -ENOMEM; goto err_alloc_vr; @@ -252,7 +252,7 @@ prestera_rif_entry_create(struct prestera_switch *sw, struct prestera_rif_entry *e; struct prestera_iface iface; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) goto err_kzalloc; @@ -301,7 +301,7 @@ __prestera_nh_neigh_create(struct prestera_switch *sw, struct prestera_nh_neigh *neigh; int err; - neigh = kzalloc(sizeof(*neigh), GFP_KERNEL); + neigh = kzalloc_obj(*neigh, GFP_KERNEL); if (!neigh) goto err_kzalloc; @@ -397,7 +397,7 @@ __prestera_nexthop_group_create(struct prestera_switch *sw, struct prestera_nh_neigh *nh_neigh; int nh_cnt, err, gid; - nh_grp = kzalloc(sizeof(*nh_grp), GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); if (!nh_grp) goto err_kzalloc; @@ -628,7 +628,7 @@ prestera_fib_node_create(struct prestera_switch *sw, struct prestera_vr *vr; int err; - fib_node = kzalloc(sizeof(*fib_node), GFP_KERNEL); + fib_node = kzalloc_obj(*fib_node, GFP_KERNEL); if (!fib_node) goto err_kzalloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c index 39d9bf82c115..696625d6dcbc 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c @@ -379,7 +379,7 @@ static int prestera_sdma_rx_init(struct prestera_sdma *sdma) struct prestera_sdma_buf *head, *tail, *next, *prev; struct prestera_rx_ring *ring = &sdma->rx_ring[q]; - ring->bufs = kmalloc_array(bnum, sizeof(*head), GFP_KERNEL); + ring->bufs = kmalloc_objs(*head, bnum, GFP_KERNEL); if (!ring->bufs) return -ENOMEM; @@ -529,7 +529,7 @@ static int prestera_sdma_tx_init(struct prestera_sdma *sdma) INIT_WORK(&sdma->tx_work, prestera_sdma_tx_recycle_work_fn); spin_lock_init(&sdma->tx_lock); - tx_ring->bufs = kmalloc_array(bnum, sizeof(*head), GFP_KERNEL); + tx_ring->bufs = kmalloc_objs(*head, bnum, GFP_KERNEL); if (!tx_ring->bufs) return -ENOMEM; @@ -784,7 +784,7 @@ int prestera_rxtx_switch_init(struct prestera_switch *sw) struct prestera_rxtx *rxtx; int err; - rxtx = kzalloc(sizeof(*rxtx), GFP_KERNEL); + rxtx = kzalloc_obj(*rxtx, GFP_KERNEL); if (!rxtx) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_span.c b/drivers/net/ethernet/marvell/prestera/prestera_span.c index 1005182ce3bc..dd86164e6a19 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_span.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_span.c @@ -27,7 +27,7 @@ prestera_span_entry_create(struct prestera_port *port, u8 span_id) { struct prestera_span_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -170,7 +170,7 @@ int prestera_span_init(struct prestera_switch *sw) { struct prestera_span *span; - span = kzalloc(sizeof(*span), GFP_KERNEL); + span = kzalloc_obj(*span, GFP_KERNEL); if (!span) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c index e548cd32582e..1ca197fb08a6 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c @@ -180,7 +180,7 @@ prestera_bridge_vlan_create(struct prestera_bridge_port *br_port, u16 vid) { struct prestera_bridge_vlan *br_vlan; - br_vlan = kzalloc(sizeof(*br_vlan), GFP_KERNEL); + br_vlan = kzalloc_obj(*br_vlan, GFP_KERNEL); if (!br_vlan) return NULL; @@ -263,7 +263,7 @@ prestera_port_vlan_create(struct prestera_port *port, u16 vid, bool untagged) if (err) return ERR_PTR(err); - port_vlan = kzalloc(sizeof(*port_vlan), GFP_KERNEL); + port_vlan = kzalloc_obj(*port_vlan, GFP_KERNEL); if (!port_vlan) { err = -ENOMEM; goto err_port_vlan_alloc; @@ -443,7 +443,7 @@ prestera_bridge_create(struct prestera_switchdev *swdev, struct net_device *dev) return ERR_PTR(-EINVAL); } - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return ERR_PTR(-ENOMEM); @@ -562,7 +562,7 @@ prestera_bridge_port_create(struct prestera_bridge *bridge, { struct prestera_bridge_port *br_port; - br_port = kzalloc(sizeof(*br_port), GFP_KERNEL); + br_port = kzalloc_obj(*br_port, GFP_KERNEL); if (!br_port) return NULL; @@ -1313,7 +1313,7 @@ static int prestera_switchdev_event(struct notifier_block *unused, if (!netif_is_bridge_master(upper)) return NOTIFY_DONE; - swdev_work = kzalloc(sizeof(*swdev_work), GFP_ATOMIC); + swdev_work = kzalloc_obj(*swdev_work, GFP_ATOMIC); if (!swdev_work) return NOTIFY_BAD; @@ -1498,7 +1498,7 @@ prestera_br_mdb_entry_create(struct prestera_switch *sw, struct prestera_br_mdb_entry *br_mdb_entry; struct prestera_mdb_entry *mdb_entry; - br_mdb_entry = kzalloc(sizeof(*br_mdb_entry), GFP_KERNEL); + br_mdb_entry = kzalloc_obj(*br_mdb_entry, GFP_KERNEL); if (!br_mdb_entry) return NULL; @@ -1530,7 +1530,7 @@ static int prestera_br_mdb_port_add(struct prestera_br_mdb_entry *br_mdb, if (br_mdb_port->br_port == br_port) return 0; - br_mdb_port = kzalloc(sizeof(*br_mdb_port), GFP_KERNEL); + br_mdb_port = kzalloc_obj(*br_mdb_port, GFP_KERNEL); if (!br_mdb_port) return -ENOMEM; @@ -1873,7 +1873,7 @@ int prestera_switchdev_init(struct prestera_switch *sw) struct prestera_switchdev *swdev; int err; - swdev = kzalloc(sizeof(*swdev), GFP_KERNEL); + swdev = kzalloc_obj(*swdev, GFP_KERNEL); if (!swdev) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c index 68f8a1e36aa6..a2f6622e6ff5 100644 --- a/drivers/net/ethernet/marvell/pxa168_eth.c +++ b/drivers/net/ethernet/marvell/pxa168_eth.c @@ -1024,7 +1024,7 @@ static int rxq_init(struct net_device *dev) int rx_desc_num = pep->rx_ring_size; /* Allocate RX skb rings */ - pep->rx_skb = kcalloc(rx_desc_num, sizeof(*pep->rx_skb), GFP_KERNEL); + pep->rx_skb = kzalloc_objs(*pep->rx_skb, rx_desc_num, GFP_KERNEL); if (!pep->rx_skb) return -ENOMEM; @@ -1083,7 +1083,7 @@ static int txq_init(struct net_device *dev) int size = 0, i = 0; int tx_desc_num = pep->tx_ring_size; - pep->tx_skb = kcalloc(tx_desc_num, sizeof(*pep->tx_skb), GFP_KERNEL); + pep->tx_skb = kzalloc_objs(*pep->tx_skb, tx_desc_num, GFP_KERNEL); if (!pep->tx_skb) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index cf4e26d337bb..49942779418c 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -918,7 +918,7 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base) struct skge_element *e; int i; - ring->start = kcalloc(ring->count, sizeof(*e), GFP_KERNEL); + ring->start = kzalloc_objs(*e, ring->count, GFP_KERNEL); if (!ring->start) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 3831f533b9db..27af9627394a 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -1601,8 +1601,8 @@ static int sky2_alloc_buffers(struct sky2_port *sky2) if (!sky2->tx_le) goto nomem; - sky2->tx_ring = kcalloc(sky2->tx_ring_size, sizeof(struct tx_ring_info), - GFP_KERNEL); + sky2->tx_ring = kzalloc_objs(struct tx_ring_info, sky2->tx_ring_size, + GFP_KERNEL); if (!sky2->tx_ring) goto nomem; @@ -1611,8 +1611,8 @@ static int sky2_alloc_buffers(struct sky2_port *sky2) if (!sky2->rx_le) goto nomem; - sky2->rx_ring = kcalloc(sky2->rx_pending, sizeof(struct rx_ring_info), - GFP_KERNEL); + sky2->rx_ring = kzalloc_objs(struct rx_ring_info, sky2->rx_pending, + GFP_KERNEL); if (!sky2->rx_ring) goto nomem; diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 35fef28ee2f9..61065fb30acb 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2647,8 +2647,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) else ring_size = soc->tx.dma_size; - ring->buf = kcalloc(ring_size, sizeof(*ring->buf), - GFP_KERNEL); + ring->buf = kzalloc_objs(*ring->buf, ring_size, GFP_KERNEL); if (!ring->buf) goto no_tx_mem; diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c index ada852adc5f7..75f7728fc796 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -705,7 +705,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry, u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; int type; - flow_info = kzalloc(sizeof(*flow_info), GFP_ATOMIC); + flow_info = kzalloc_obj(*flow_info, GFP_ATOMIC); if (!flow_info) return; diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c index e9bd32741983..bc53b08ff205 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c @@ -469,7 +469,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, if (wed_index >= 0 && (err = mtk_wed_flow_add(wed_index)) < 0) return err; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c index 1ed1f88dd7f8..303e3945b72c 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c @@ -656,7 +656,7 @@ mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev) } n_pages = dev->tx_buf_ring.size / MTK_WED_BUF_PER_PAGE; - page_list = kcalloc(n_pages, sizeof(*page_list), GFP_KERNEL); + page_list = kzalloc_objs(*page_list, n_pages, GFP_KERNEL); if (!page_list) return -ENOMEM; @@ -780,7 +780,7 @@ mtk_wed_hwrro_buffer_alloc(struct mtk_wed_device *dev) if (!dev->wlan.hw_rro) return 0; - page_list = kcalloc(n_pages, sizeof(*page_list), GFP_KERNEL); + page_list = kzalloc_objs(*page_list, n_pages, GFP_KERNEL); if (!page_list) return -ENOMEM; @@ -2718,7 +2718,7 @@ mtk_wed_setup_tc_block(struct mtk_wed_hw *hw, struct net_device *dev, return 0; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -2822,7 +2822,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth, if (WARN_ON(hw_list[index])) goto unlock; - hw = kzalloc(sizeof(*hw), GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) goto unlock; diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c index 07b061a97a6e..7e4d1998fd0d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c @@ -223,7 +223,7 @@ struct mlx4_zone_entry { struct mlx4_zone_allocator *mlx4_zone_allocator_create(enum mlx4_zone_alloc_flags flags) { - struct mlx4_zone_allocator *zones = kmalloc(sizeof(*zones), GFP_KERNEL); + struct mlx4_zone_allocator *zones = kmalloc_obj(*zones, GFP_KERNEL); if (NULL == zones) return NULL; @@ -247,7 +247,7 @@ int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc, { u32 mask = mlx4_bitmap_masked_value(bitmap, (u32)-1); struct mlx4_zone_entry *it; - struct mlx4_zone_entry *zone = kmalloc(sizeof(*zone), GFP_KERNEL); + struct mlx4_zone_entry *zone = kmalloc_obj(*zone, GFP_KERNEL); if (NULL == zone) return -ENOMEM; @@ -594,8 +594,8 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, buf->nbufs = DIV_ROUND_UP(size, PAGE_SIZE); buf->npages = buf->nbufs; buf->page_shift = PAGE_SHIFT; - buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list), - GFP_KERNEL); + buf->page_list = kzalloc_objs(*buf->page_list, buf->nbufs, + GFP_KERNEL); if (!buf->page_list) return -ENOMEM; @@ -642,7 +642,7 @@ static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device) { struct mlx4_db_pgdir *pgdir; - pgdir = kzalloc(sizeof(*pgdir), GFP_KERNEL); + pgdir = kzalloc_obj(*pgdir, GFP_KERNEL); if (!pgdir) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 7f20813456e2..150ede6eb18f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -1674,7 +1674,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, int err = 0; /* Create sw representation of Virtual HCR */ - vhcr = kzalloc(sizeof(struct mlx4_vhcr), GFP_KERNEL); + vhcr = kzalloc_obj(struct mlx4_vhcr, GFP_KERNEL); if (!vhcr) return -ENOMEM; @@ -1873,7 +1873,7 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, vp_admin->default_vlan, vp_admin->default_qos, vp_admin->link_state); - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; @@ -2368,23 +2368,20 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) struct mlx4_vf_admin_state *vf_admin; priv->mfunc.master.slave_state = - kcalloc(dev->num_slaves, - sizeof(struct mlx4_slave_state), - GFP_KERNEL); + kzalloc_objs(struct mlx4_slave_state, dev->num_slaves, + GFP_KERNEL); if (!priv->mfunc.master.slave_state) goto err_comm; priv->mfunc.master.vf_admin = - kcalloc(dev->num_slaves, - sizeof(struct mlx4_vf_admin_state), - GFP_KERNEL); + kzalloc_objs(struct mlx4_vf_admin_state, + dev->num_slaves, GFP_KERNEL); if (!priv->mfunc.master.vf_admin) goto err_comm_admin; priv->mfunc.master.vf_oper = - kcalloc(dev->num_slaves, - sizeof(struct mlx4_vf_oper_state), - GFP_KERNEL); + kzalloc_objs(struct mlx4_vf_oper_state, dev->num_slaves, + GFP_KERNEL); if (!priv->mfunc.master.vf_oper) goto err_comm_oper; @@ -2408,8 +2405,8 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) struct mlx4_vport_state *oper_vport; s_state->vlan_filter[port] = - kzalloc(sizeof(struct mlx4_vlan_fltr), - GFP_KERNEL); + kzalloc_obj(struct mlx4_vlan_fltr, + GFP_KERNEL); if (!s_state->vlan_filter[port]) { if (--port) kfree(s_state->vlan_filter[port]); @@ -2625,9 +2622,8 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev) int i; int err = 0; - priv->cmd.context = kmalloc_array(priv->cmd.max_cmds, - sizeof(struct mlx4_cmd_context), - GFP_KERNEL); + priv->cmd.context = kmalloc_objs(struct mlx4_cmd_context, + priv->cmd.max_cmds, GFP_KERNEL); if (!priv->cmd.context) return -ENOMEM; @@ -2693,7 +2689,7 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) { struct mlx4_cmd_mailbox *mailbox; - mailbox = kmalloc(sizeof(*mailbox), GFP_KERNEL); + mailbox = kmalloc_obj(*mailbox, GFP_KERNEL); if (!mailbox) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index ad6298456639..2e914a254a16 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -1158,7 +1158,7 @@ static int mlx4_en_set_ringparam(struct net_device *dev, tx_size == priv->tx_ring[TX][0]->size) return 0; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -1452,8 +1452,8 @@ static int add_ip_rule(struct mlx4_en_priv *priv, struct mlx4_spec_list *spec_l3; struct ethtool_usrip4_spec *l3_mask = &cmd->fs.m_u.usr_ip4_spec; - spec_l3 = kzalloc(sizeof(*spec_l3), GFP_KERNEL); - spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL); + spec_l3 = kzalloc_obj(*spec_l3, GFP_KERNEL); + spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); if (!spec_l2 || !spec_l3) { err = -ENOMEM; goto free_spec; @@ -1491,9 +1491,9 @@ static int add_tcp_udp_rule(struct mlx4_en_priv *priv, struct mlx4_spec_list *spec_l4; struct ethtool_tcpip4_spec *l4_mask = &cmd->fs.m_u.tcp_ip4_spec; - spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL); - spec_l3 = kzalloc(sizeof(*spec_l3), GFP_KERNEL); - spec_l4 = kzalloc(sizeof(*spec_l4), GFP_KERNEL); + spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); + spec_l3 = kzalloc_obj(*spec_l3, GFP_KERNEL); + spec_l4 = kzalloc_obj(*spec_l4, GFP_KERNEL); if (!spec_l2 || !spec_l3 || !spec_l4) { err = -ENOMEM; goto free_spec; @@ -1564,7 +1564,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev, switch (cmd->fs.flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) { case ETHER_FLOW: - spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL); + spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); if (!spec_l2) return -ENOMEM; @@ -1833,7 +1833,7 @@ static int mlx4_en_set_channels(struct net_device *dev, if (!channel->tx_count || !channel->rx_count) return -EINVAL; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c index d8f4d00ad26b..1374a81945b2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c @@ -271,7 +271,7 @@ static int mlx4_en_probe(struct auxiliary_device *adev, printk_once(KERN_INFO "%s", mlx4_en_version); - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) { err = -ENOMEM; goto err_free_res; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 81bf8908b897..ee1ea70cdd34 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -99,7 +99,7 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc) int port_up = 0; int err = 0; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -295,7 +295,7 @@ mlx4_en_filter_alloc(struct mlx4_en_priv *priv, int rxq_index, __be32 src_ip, { struct mlx4_en_filter *filter; - filter = kzalloc(sizeof(struct mlx4_en_filter), GFP_ATOMIC); + filter = kzalloc_obj(struct mlx4_en_filter, GFP_ATOMIC); if (!filter) return NULL; @@ -827,7 +827,7 @@ static void mlx4_en_cache_mclist(struct net_device *dev) mlx4_en_clear_list(dev); netdev_for_each_mc_addr(ha, dev) { - tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC); + tmp = kzalloc_obj(struct mlx4_en_mc_list, GFP_ATOMIC); if (!tmp) { mlx4_en_clear_list(dev); return; @@ -1209,7 +1209,7 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv, } if (!found) { - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { en_err(priv, "Failed adding MAC %pM on port:%d (out of memory)\n", ha->addr, priv->port); @@ -1317,7 +1317,7 @@ static int mlx4_en_set_rss_steer_rules(struct mlx4_en_priv *priv) if (err) goto tunnel_err; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto alloc_err; @@ -2240,15 +2240,13 @@ static int mlx4_en_copy_priv(struct mlx4_en_priv *dst, if (!dst->tx_ring_num[t]) continue; - dst->tx_ring[t] = kcalloc(MAX_TX_RINGS, - sizeof(struct mlx4_en_tx_ring *), - GFP_KERNEL); + dst->tx_ring[t] = kzalloc_objs(struct mlx4_en_tx_ring *, + MAX_TX_RINGS, GFP_KERNEL); if (!dst->tx_ring[t]) goto err_free_tx; - dst->tx_cq[t] = kcalloc(MAX_TX_RINGS, - sizeof(struct mlx4_en_cq *), - GFP_KERNEL); + dst->tx_cq[t] = kzalloc_objs(struct mlx4_en_cq *, MAX_TX_RINGS, + GFP_KERNEL); if (!dst->tx_cq[t]) { kfree(dst->tx_ring[t]); goto err_free_tx; @@ -2754,7 +2752,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog) if (!mlx4_en_check_xdp_mtu(dev, dev->mtu)) return -EOPNOTSUPP; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -3217,16 +3215,14 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, if (!priv->tx_ring_num[t]) continue; - priv->tx_ring[t] = kcalloc(MAX_TX_RINGS, - sizeof(struct mlx4_en_tx_ring *), - GFP_KERNEL); + priv->tx_ring[t] = kzalloc_objs(struct mlx4_en_tx_ring *, + MAX_TX_RINGS, GFP_KERNEL); if (!priv->tx_ring[t]) { err = -ENOMEM; goto out; } - priv->tx_cq[t] = kcalloc(MAX_TX_RINGS, - sizeof(struct mlx4_en_cq *), - GFP_KERNEL); + priv->tx_cq[t] = kzalloc_objs(struct mlx4_en_cq *, MAX_TX_RINGS, + GFP_KERNEL); if (!priv->tx_cq[t]) { err = -ENOMEM; goto out; @@ -3525,7 +3521,7 @@ int mlx4_en_reset_config(struct net_device *dev, return -EINVAL; } - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 13666d50b90f..de45de8fa41b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -1094,7 +1094,7 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn, struct mlx4_qp_context *context; int err = 0; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; @@ -1208,7 +1208,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) return 0; } - rss_map->indir_qp = kzalloc(sizeof(*rss_map->indir_qp), GFP_KERNEL); + rss_map->indir_qp = kzalloc_obj(*rss_map->indir_qp, GFP_KERNEL); if (!rss_map->indir_qp) { err = -ENOMEM; goto rss_err; diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 9572a45f6143..9891d33c7ecb 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -987,8 +987,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, */ npages = PAGE_ALIGN(eq->nent * dev->caps.eqe_size) / PAGE_SIZE; - eq->page_list = kmalloc_array(npages, sizeof(*eq->page_list), - GFP_KERNEL); + eq->page_list = kmalloc_objs(*eq->page_list, npages, GFP_KERNEL); if (!eq->page_list) goto err_out; @@ -1158,8 +1157,9 @@ int mlx4_alloc_eq_table(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - priv->eq_table.eq = kcalloc(dev->caps.num_eqs - dev->caps.reserved_eqs, - sizeof(*priv->eq_table.eq), GFP_KERNEL); + priv->eq_table.eq = kzalloc_objs(*priv->eq_table.eq, + dev->caps.num_eqs - dev->caps.reserved_eqs, + GFP_KERNEL); if (!priv->eq_table.eq) return -ENOMEM; @@ -1177,9 +1177,8 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) int err; int i; - priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev), - sizeof(*priv->eq_table.uar_map), - GFP_KERNEL); + priv->eq_table.uar_map = kzalloc_objs(*priv->eq_table.uar_map, + mlx4_num_eq_uar(dev), GFP_KERNEL); if (!priv->eq_table.uar_map) { err = -ENOMEM; goto err_out_free; diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index 59b8b3c73582..c076d26a0b12 100644 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c @@ -145,8 +145,8 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN), dev->numa_node); if (!icm) { - icm = kmalloc(sizeof(*icm), - gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); + icm = kmalloc_obj(*icm, + gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); if (!icm) return NULL; } @@ -163,9 +163,8 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, __GFP_NOWARN), dev->numa_node); if (!chunk) { - chunk = kzalloc(sizeof(*chunk), - gfp_mask & ~(__GFP_HIGHMEM | - __GFP_NOWARN)); + chunk = kzalloc_obj(*chunk, + gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); if (!chunk) goto fail; } @@ -427,7 +426,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, return -EINVAL; num_icm = DIV_ROUND_UP(nobj, obj_per_chunk); - table->icm = kvcalloc(num_icm, sizeof(*table->icm), GFP_KERNEL); + table->icm = kvzalloc_objs(*table->icm, num_icm, GFP_KERNEL); if (!table->icm) return -ENOMEM; table->virt = virt; diff --git a/drivers/net/ethernet/mellanox/mlx4/intf.c b/drivers/net/ethernet/mellanox/mlx4/intf.c index a371b970ac1e..e1db44df72f6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/intf.c +++ b/drivers/net/ethernet/mellanox/mlx4/intf.c @@ -78,8 +78,8 @@ int mlx4_adev_init(struct mlx4_dev *dev) if (priv->adev_idx < 0) return priv->adev_idx; - priv->adev = kcalloc(ARRAY_SIZE(mlx4_adev_devices), - sizeof(struct mlx4_adev *), GFP_KERNEL); + priv->adev = kzalloc_objs(struct mlx4_adev *, + ARRAY_SIZE(mlx4_adev_devices), GFP_KERNEL); if (!priv->adev) { ida_free(&mlx4_adev_ida, priv->adev_idx); return -ENOMEM; @@ -115,7 +115,7 @@ static struct mlx4_adev *add_adev(struct mlx4_dev *dev, int idx) struct mlx4_adev *madev; int ret; - madev = kzalloc(sizeof(*madev), GFP_KERNEL); + madev = kzalloc_obj(*madev, GFP_KERNEL); if (!madev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 4293f8e33f44..2e5032658fcd 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -867,8 +867,9 @@ static int mlx4_slave_special_qp_cap(struct mlx4_dev *dev) struct mlx4_caps *caps = &dev->caps; int i, err = 0; - func_cap = kzalloc(sizeof(*func_cap), GFP_KERNEL); - caps->spec_qps = kcalloc(caps->num_ports, sizeof(*caps->spec_qps), GFP_KERNEL); + func_cap = kzalloc_obj(*func_cap, GFP_KERNEL); + caps->spec_qps = kzalloc_objs(*caps->spec_qps, caps->num_ports, + GFP_KERNEL); if (!func_cap || !caps->spec_qps) { mlx4_err(dev, "Failed to allocate memory for special qps cap\n"); @@ -911,9 +912,9 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) struct mlx4_func_cap *func_cap; struct mlx4_init_hca_param *hca_param; - hca_param = kzalloc(sizeof(*hca_param), GFP_KERNEL); - func_cap = kzalloc(sizeof(*func_cap), GFP_KERNEL); - dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); + hca_param = kzalloc_obj(*hca_param, GFP_KERNEL); + func_cap = kzalloc_obj(*func_cap, GFP_KERNEL); + dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); if (!hca_param || !func_cap || !dev_cap) { mlx4_err(dev, "Failed to allocate memory for slave_cap\n"); err = -ENOMEM; @@ -1548,7 +1549,7 @@ int mlx4_queue_bond_work(struct mlx4_dev *dev, int is_bonded, u8 v2p_p1, { struct mlx4_bond *bond; - bond = kzalloc(sizeof(*bond), GFP_ATOMIC); + bond = kzalloc_obj(*bond, GFP_ATOMIC); if (!bond) return -ENOMEM; @@ -2323,8 +2324,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev) int err; if (!mlx4_is_slave(dev)) { - dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); - init_hca = kzalloc(sizeof(*init_hca), GFP_KERNEL); + dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); + init_hca = kzalloc_obj(*init_hca, GFP_KERNEL); if (!dev_cap || !init_hca) { err = -ENOMEM; @@ -2965,7 +2966,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) if (msi_x > 1) nreq = min_t(int, nreq, msi_x); - entries = kcalloc(nreq, sizeof(*entries), GFP_KERNEL); + entries = kzalloc_objs(*entries, nreq, GFP_KERNEL); if (!entries) goto no_msi; @@ -3173,8 +3174,7 @@ static int mlx4_init_steering(struct mlx4_dev *dev) int num_entries = dev->caps.num_ports; int i, j; - priv->steer = kcalloc(num_entries, sizeof(struct mlx4_steer), - GFP_KERNEL); + priv->steer = kzalloc_objs(struct mlx4_steer, num_entries, GFP_KERNEL); if (!priv->steer) return -ENOMEM; @@ -3279,8 +3279,8 @@ static u64 mlx4_enable_sriov(struct mlx4_dev *dev, struct pci_dev *pdev, MLX4_MAX_NUM_VF); if (reset_flow) { - dev->dev_vfs = kcalloc(total_vfs, sizeof(*dev->dev_vfs), - GFP_KERNEL); + dev->dev_vfs = kzalloc_objs(*dev->dev_vfs, total_vfs, + GFP_KERNEL); if (!dev->dev_vfs) goto free_mem; return dev_flags; @@ -3295,7 +3295,7 @@ static u64 mlx4_enable_sriov(struct mlx4_dev *dev, struct pci_dev *pdev, } } - dev->dev_vfs = kcalloc(total_vfs, sizeof(*dev->dev_vfs), GFP_KERNEL); + dev->dev_vfs = kzalloc_objs(*dev->dev_vfs, total_vfs, GFP_KERNEL); if (NULL == dev->dev_vfs) { mlx4_err(dev, "Failed to allocate memory for VFs\n"); goto disable_sriov; @@ -3494,7 +3494,7 @@ slave_start: if (mlx4_is_master(dev)) { /* when we hit the goto slave_start below, dev_cap already initialized */ if (!dev_cap) { - dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); + dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); if (!dev_cap) { err = -ENOMEM; @@ -4034,7 +4034,7 @@ static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) priv = devlink_priv(devlink); dev = &priv->dev; - dev->persist = kzalloc(sizeof(*dev->persist), GFP_KERNEL); + dev->persist = kzalloc_obj(*dev->persist, GFP_KERNEL); if (!dev->persist) { ret = -ENOMEM; goto err_devlink_free; diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index 24d0c7c46878..7ab766a81452 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c @@ -162,7 +162,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, return -EINVAL; s_steer = &mlx4_priv(dev)->steer[port - 1]; - new_entry = kzalloc(sizeof(*new_entry), GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); if (!new_entry) return -ENOMEM; @@ -175,7 +175,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, */ pqp = get_promisc_qp(dev, port, steer, qpn); if (pqp) { - dqp = kmalloc(sizeof(*dqp), GFP_KERNEL); + dqp = kmalloc_obj(*dqp, GFP_KERNEL); if (!dqp) { err = -ENOMEM; goto out_alloc; @@ -274,7 +274,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port, } /* add the qp as a duplicate on this index */ - dqp = kmalloc(sizeof(*dqp), GFP_KERNEL); + dqp = kmalloc_obj(*dqp, GFP_KERNEL); if (!dqp) return -ENOMEM; dqp->qpn = qpn; @@ -443,7 +443,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, goto out_mutex; } - pqp = kmalloc(sizeof(*pqp), GFP_KERNEL); + pqp = kmalloc_obj(*pqp, GFP_KERNEL); if (!pqp) { err = -ENOMEM; goto out_mutex; @@ -479,7 +479,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, /* Entry already exists. * Add to duplicates. */ - dqp = kmalloc(sizeof(*dqp), GFP_KERNEL); + dqp = kmalloc_obj(*dqp, GFP_KERNEL); if (!dqp) { err = -ENOMEM; goto out_mailbox; diff --git a/drivers/net/ethernet/mellanox/mlx4/pd.c b/drivers/net/ethernet/mellanox/mlx4/pd.c index 6fc156a3918d..b29e067da2e2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/pd.c +++ b/drivers/net/ethernet/mellanox/mlx4/pd.c @@ -189,7 +189,7 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) } uar = kmalloc_node(sizeof(*uar), GFP_KERNEL, node); if (!uar) { - uar = kmalloc(sizeof(*uar), GFP_KERNEL); + uar = kmalloc_obj(*uar, GFP_KERNEL); if (!uar) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx4/profile.c b/drivers/net/ethernet/mellanox/mlx4/profile.c index ba361c5fbda3..828c14074f81 100644 --- a/drivers/net/ethernet/mellanox/mlx4/profile.c +++ b/drivers/net/ethernet/mellanox/mlx4/profile.c @@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, struct sysinfo si; int i, j; - profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL); + profile = kzalloc_objs(*profile, MLX4_RES_NUM, GFP_KERNEL); if (!profile) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 913ed255990f..50002356697f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c @@ -564,7 +564,7 @@ static int mlx4_create_zones(struct mlx4_dev *dev, if (NULL == qp_table->zones) return -ENOMEM; - bitmap = kmalloc(sizeof(*bitmap), GFP_KERNEL); + bitmap = kmalloc_obj(*bitmap, GFP_KERNEL); if (NULL == bitmap) { err = -ENOMEM; @@ -853,9 +853,9 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) /* In mfunc, calculate proxy and tunnel qp offsets for the PF here, * since the PF does not call mlx4_slave_caps */ - dev->caps.spec_qps = kcalloc(dev->caps.num_ports, - sizeof(*dev->caps.spec_qps), - GFP_KERNEL); + dev->caps.spec_qps = kzalloc_objs(*dev->caps.spec_qps, + dev->caps.num_ports, + GFP_KERNEL); if (!dev->caps.spec_qps) { err = -ENOMEM; goto err_mem; diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 771b92019af1..dba5709ff96f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -505,8 +505,7 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) int t; priv->mfunc.master.res_tracker.slave_list = - kcalloc(dev->num_slaves, sizeof(struct slave_list), - GFP_KERNEL); + kzalloc_objs(struct slave_list, dev->num_slaves, GFP_KERNEL); if (!priv->mfunc.master.res_tracker.slave_list) return -ENOMEM; @@ -525,21 +524,20 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) for (i = 0; i < MLX4_NUM_OF_RESOURCE_TYPE; i++) { struct resource_allocator *res_alloc = &priv->mfunc.master.res_tracker.res_alloc[i]; - res_alloc->quota = kmalloc_array(dev->persist->num_vfs + 1, - sizeof(int), - GFP_KERNEL); - res_alloc->guaranteed = kmalloc_array(dev->persist->num_vfs + 1, - sizeof(int), - GFP_KERNEL); + res_alloc->quota = kmalloc_objs(int, dev->persist->num_vfs + 1, + GFP_KERNEL); + res_alloc->guaranteed = kmalloc_objs(int, + dev->persist->num_vfs + 1, + GFP_KERNEL); if (i == RES_MAC || i == RES_VLAN) res_alloc->allocated = - kcalloc(MLX4_MAX_PORTS * - (dev->persist->num_vfs + 1), - sizeof(int), GFP_KERNEL); + kzalloc_objs(int, + MLX4_MAX_PORTS * (dev->persist->num_vfs + 1), + GFP_KERNEL); else res_alloc->allocated = - kcalloc(dev->persist->num_vfs + 1, - sizeof(int), GFP_KERNEL); + kzalloc_objs(int, dev->persist->num_vfs + 1, + GFP_KERNEL); /* Reduce the sink counter */ if (i == RES_COUNTER) res_alloc->res_free = dev->caps.max_counters - 1; @@ -1051,7 +1049,7 @@ static struct res_common *alloc_qp_tr(int id) { struct res_qp *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1069,7 +1067,7 @@ static struct res_common *alloc_mtt_tr(int id, int order) { struct res_mtt *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1085,7 +1083,7 @@ static struct res_common *alloc_mpt_tr(int id, int key) { struct res_mpt *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1100,7 +1098,7 @@ static struct res_common *alloc_eq_tr(int id) { struct res_eq *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1114,7 +1112,7 @@ static struct res_common *alloc_cq_tr(int id) { struct res_cq *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1129,7 +1127,7 @@ static struct res_common *alloc_srq_tr(int id) { struct res_srq *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1144,7 +1142,7 @@ static struct res_common *alloc_counter_tr(int id, int port) { struct res_counter *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1159,7 +1157,7 @@ static struct res_common *alloc_xrcdn_tr(int id) { struct res_xrcdn *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1173,7 +1171,7 @@ static struct res_common *alloc_fs_rule_tr(u64 id, int qpn) { struct res_fs_rule *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -1240,8 +1238,8 @@ int mlx4_calc_vf_counters(struct mlx4_dev *dev, int slave, int port, memset(data, 0, sizeof(*data)); - counters_arr = kmalloc_array(dev->caps.max_counters, - sizeof(*counters_arr), GFP_KERNEL); + counters_arr = kmalloc_objs(*counters_arr, dev->caps.max_counters, + GFP_KERNEL); if (!counters_arr) return -ENOMEM; @@ -1285,7 +1283,7 @@ static int add_res_range(struct mlx4_dev *dev, int slave, u64 base, int count, struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; struct rb_root *root = &tracker->res_tree[type]; - res_arr = kcalloc(count, sizeof(*res_arr), GFP_KERNEL); + res_arr = kzalloc_objs(*res_arr, count, GFP_KERNEL); if (!res_arr) return -ENOMEM; @@ -2038,7 +2036,7 @@ static int mac_add_to_slave(struct mlx4_dev *dev, int slave, u64 mac, int port, if (mlx4_grant_resource(dev, slave, RES_MAC, 1, port)) return -EINVAL; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) { mlx4_release_resource(dev, slave, RES_MAC, 1, port); return -ENOMEM; @@ -2145,7 +2143,7 @@ static int vlan_add_to_slave(struct mlx4_dev *dev, int slave, u16 vlan, if (mlx4_grant_resource(dev, slave, RES_VLAN, 1, port)) return -EINVAL; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) { mlx4_release_resource(dev, slave, RES_VLAN, 1, port); return -ENOMEM; @@ -4032,7 +4030,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, struct res_gid *res; int err; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return -ENOMEM; @@ -5187,8 +5185,8 @@ static void rem_slave_counters(struct mlx4_dev *dev, int slave) mlx4_warn(dev, "rem_slave_counters: Could not move all counters - too busy for slave %d\n", slave); - counters_arr = kmalloc_array(dev->caps.max_counters, - sizeof(*counters_arr), GFP_KERNEL); + counters_arr = kmalloc_objs(*counters_arr, dev->caps.max_counters, + GFP_KERNEL); if (!counters_arr) return; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c index 6aca004e88cd..058b7b2497ac 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c @@ -79,8 +79,7 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size, buf->size = size; buf->npages = DIV_ROUND_UP(size, PAGE_SIZE); buf->page_shift = PAGE_SHIFT; - buf->frags = kcalloc(buf->npages, sizeof(struct mlx5_buf_list), - GFP_KERNEL); + buf->frags = kzalloc_objs(struct mlx5_buf_list, buf->npages, GFP_KERNEL); if (!buf->frags) goto err_out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 5b08e5ffe0e2..6c99c7f36163 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -123,7 +123,7 @@ cmd_alloc_ent(struct mlx5_cmd *cmd, struct mlx5_cmd_msg *in, gfp_t alloc_flags = cbk ? GFP_ATOMIC : GFP_KERNEL; struct mlx5_cmd_work_ent *ent; - ent = kzalloc(sizeof(*ent), alloc_flags); + ent = kzalloc_obj(*ent, alloc_flags); if (!ent) return ERR_PTR(-ENOMEM); @@ -1436,7 +1436,7 @@ static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev, { struct mlx5_cmd_mailbox *mailbox; - mailbox = kmalloc(sizeof(*mailbox), flags); + mailbox = kmalloc_obj(*mailbox, flags); if (!mailbox) return ERR_PTR(-ENOMEM); @@ -1470,7 +1470,7 @@ static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, int n; int i; - msg = kzalloc(sizeof(*msg), flags); + msg = kzalloc_obj(*msg, flags); if (!msg) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c index 1301c56e20d6..f2aa14e07e92 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -201,7 +201,7 @@ static const struct file_operations slots_fops = { static struct mlx5_cmd_stats * mlx5_cmdif_alloc_stats(struct xarray *stats_xa, int opcode) { - struct mlx5_cmd_stats *stats = kzalloc(sizeof(*stats), GFP_KERNEL); + struct mlx5_cmd_stats *stats = kzalloc_obj(*stats, GFP_KERNEL); int err; if (!stats) @@ -509,7 +509,7 @@ static int add_res_tree(struct mlx5_core_dev *dev, enum dbg_rsc_type type, char resn[32]; int i; - d = kzalloc(struct_size(d, fields, nfile), GFP_KERNEL); + d = kzalloc_flex(*d, fields, nfile, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c index 781e39b5aa1d..bed0b6bfba7e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c @@ -277,8 +277,8 @@ int mlx5_adev_init(struct mlx5_core_dev *dev) { struct mlx5_priv *priv = &dev->priv; - priv->adev = kcalloc(ARRAY_SIZE(mlx5_adev_devices), - sizeof(struct mlx5_adev *), GFP_KERNEL); + priv->adev = kzalloc_objs(struct mlx5_adev *, + ARRAY_SIZE(mlx5_adev_devices), GFP_KERNEL); if (!priv->adev) return -ENOMEM; @@ -310,7 +310,7 @@ static struct mlx5_adev *add_adev(struct mlx5_core_dev *dev, int idx) struct mlx5_adev *madev; int ret; - madev = kzalloc(sizeof(*madev), GFP_KERNEL); + madev = kzalloc_obj(*madev, GFP_KERNEL); if (!madev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index ea77fbd98396..18cfb7655805 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -294,7 +294,7 @@ static int mlx5_devlink_trap_init(struct devlink *devlink, const struct devlink_ struct mlx5_core_dev *dev = devlink_priv(devlink); struct mlx5_devlink_trap *dl_trap; - dl_trap = kzalloc(sizeof(*dl_trap), GFP_KERNEL); + dl_trap = kzalloc_obj(*dl_trap, GFP_KERNEL); if (!dl_trap) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c index 6b4ec457ce22..d2e2c9f0f340 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -412,7 +412,7 @@ static struct tracer_string_format *mlx5_tracer_message_insert(struct mlx5_fw_tr &tracer->hash[mlx5_tracer_message_hash(tracer_event->string_event.tmsn)]; struct tracer_string_format *cur_string; - cur_string = kzalloc(sizeof(*cur_string), GFP_KERNEL); + cur_string = kzalloc_obj(*cur_string, GFP_KERNEL); if (!cur_string) return NULL; @@ -1023,7 +1023,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) return NULL; } - tracer = kvzalloc(sizeof(*tracer), GFP_KERNEL); + tracer = kvzalloc_obj(*tracer, GFP_KERNEL); if (!tracer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c index c5b560a8b026..9bcc2d8edc76 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c @@ -137,7 +137,7 @@ struct mlx5_rsc_dump_cmd *mlx5_rsc_dump_cmd_create(struct mlx5_core_dev *dev, if (!sgmt_type && key->rsc != MLX5_SGMT_TYPE_MENU) return ERR_PTR(-EOPNOTSUPP); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { mlx5_core_err(dev, "Resource dump: Failed to allocate command\n"); return ERR_PTR(-ENOMEM); @@ -255,7 +255,7 @@ struct mlx5_rsc_dump *mlx5_rsc_dump_create(struct mlx5_core_dev *dev) mlx5_core_dbg(dev, "Resource dump: capability not present\n"); return NULL; } - rsc_dump = kzalloc(sizeof(*rsc_dump), GFP_KERNEL); + rsc_dump = kzalloc_obj(*rsc_dump, GFP_KERNEL); if (!rsc_dump) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c index 3981dd81d4c1..abb678fe3021 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c @@ -433,7 +433,7 @@ static int mlx5_dpll_probe(struct auxiliary_device *adev, if (err) return err; - mdpll = kzalloc(sizeof(*mdpll), GFP_KERNEL); + mdpll = kzalloc_obj(*mdpll, GFP_KERNEL); if (!mdpll) return -ENOMEM; mdpll->mdev = mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c index 671adbad0a40..8b418e8538ca 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c @@ -90,7 +90,7 @@ mlx5e_fs_tt_redirect_udp_add_rule(struct mlx5e_flow_steering *fs, if (type == FS_UDP_NUM_TYPES) return ERR_PTR(-EINVAL); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -150,7 +150,7 @@ static int fs_udp_create_groups(struct mlx5e_flow_table *ft, enum fs_udp_type ty int err; u8 *mc; - ft->g = kcalloc(MLX5E_FS_UDP_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS, GFP_KERNEL); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -325,7 +325,7 @@ int mlx5e_fs_tt_redirect_udp_create(struct mlx5e_flow_steering *fs) return 0; } - udp = kzalloc(sizeof(*udp), GFP_KERNEL); + udp = kzalloc_obj(*udp, GFP_KERNEL); if (!udp) return -ENOMEM; mlx5e_fs_set_udp(fs, udp); @@ -372,7 +372,7 @@ mlx5e_fs_tt_redirect_any_add_rule(struct mlx5e_flow_steering *fs, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -432,7 +432,7 @@ static int fs_any_create_groups(struct mlx5e_flow_table *ft) int err; u8 *mc; - ft->g = kcalloc(MLX5E_FS_UDP_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS, GFP_KERNEL); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -589,7 +589,7 @@ int mlx5e_fs_tt_redirect_any_create(struct mlx5e_flow_steering *fs) return 0; } - fs_any = kzalloc(sizeof(*fs_any), GFP_KERNEL); + fs_any = kzalloc_obj(*fs_any, GFP_KERNEL); if (!fs_any) return -ENOMEM; mlx5e_fs_set_any(fs, fs_any); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c b/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c index 09d441ecb9f6..c63b8022fae6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c @@ -72,7 +72,7 @@ mlx5e_htb_node_create_leaf(struct mlx5e_htb *htb, u16 classid, u16 qid, { struct mlx5e_qos_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); @@ -93,7 +93,7 @@ static struct mlx5e_qos_node *mlx5e_htb_node_create_root(struct mlx5e_htb *htb) { struct mlx5e_qos_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return ERR_PTR(-ENOMEM); @@ -694,7 +694,7 @@ mlx5e_htb_node_modify(struct mlx5e_htb *htb, u16 classid, u64 rate, u64 ceil, struct mlx5e_htb *mlx5e_htb_alloc(void) { - return kvzalloc(sizeof(struct mlx5e_htb), GFP_KERNEL); + return kvzalloc_obj(struct mlx5e_htb, GFP_KERNEL); } void mlx5e_htb_free(struct mlx5e_htb *htb) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c b/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c index 1de18c7e96ec..b1a84a01a81c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c @@ -198,7 +198,7 @@ mapping_create(size_t data_size, u32 max_id, bool delayed_removal) { struct mapping_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c index 74660e7fe674..5f4a7ca15518 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c @@ -883,7 +883,7 @@ int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params, c = kvzalloc_node(sizeof(*c), GFP_KERNEL, dev_to_node(mlx5_core_dma_dev(mdev))); - cparams = kvzalloc(sizeof(*cparams), GFP_KERNEL); + cparams = kvzalloc_obj(*cparams, GFP_KERNEL); if (!c || !cparams) { err = -ENOMEM; goto err_free; @@ -988,7 +988,7 @@ int mlx5e_ptp_alloc_rx_fs(struct mlx5e_flow_steering *fs, if (!mlx5e_profile_feature_cap(profile, PTP_RX)) return 0; - ptp_fs = kzalloc(sizeof(*ptp_fs), GFP_KERNEL); + ptp_fs = kzalloc_obj(*ptp_fs, GFP_KERNEL); if (!ptp_fs) return -ENOMEM; mlx5e_fs_set_ptp(fs, ptp_fs); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c index 4e461cb03b83..cebcff010eac 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c @@ -87,8 +87,9 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, if (!priv->htb_qos_sq_stats) { struct mlx5e_sq_stats **stats_list; - stats_list = kvcalloc(mlx5e_qos_max_leaf_nodes(priv->mdev), - sizeof(*stats_list), GFP_KERNEL); + stats_list = kvzalloc_objs(*stats_list, + mlx5e_qos_max_leaf_nodes(priv->mdev), + GFP_KERNEL); if (!stats_list) return -ENOMEM; @@ -98,7 +99,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, if (!priv->htb_qos_sq_stats[node_qid]) { struct mlx5e_sq_stats *stats; - stats = kzalloc(sizeof(*stats), GFP_KERNEL); + stats = kzalloc_obj(*stats, GFP_KERNEL); if (!stats) return -ENOMEM; @@ -114,7 +115,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, c = chs->c[ix]; qos_sqs = mlx5e_state_dereference(priv, c->qos_sqs); - sq = kzalloc(sizeof(*sq), GFP_KERNEL); + sq = kzalloc_obj(*sq, GFP_KERNEL); if (!sq) return -ENOMEM; @@ -276,7 +277,8 @@ int mlx5e_qos_alloc_queues(struct mlx5e_priv *priv, struct mlx5e_channels *chs) for (i = 0; i < chs->num; i++) { struct mlx5e_txqsq **sqs; - sqs = kvcalloc(qos_sqs_size, sizeof(struct mlx5e_txqsq *), GFP_KERNEL); + sqs = kvzalloc_objs(struct mlx5e_txqsq *, qos_sqs_size, + GFP_KERNEL); if (!sqs) goto err_free; @@ -460,7 +462,7 @@ struct mlx5e_mqprio_rl { struct mlx5e_mqprio_rl *mlx5e_mqprio_rl_alloc(void) { - return kvzalloc(sizeof(struct mlx5e_mqprio_rl), GFP_KERNEL); + return kvzalloc_obj(struct mlx5e_mqprio_rl, GFP_KERNEL); } void mlx5e_mqprio_rl_free(struct mlx5e_mqprio_rl *rl) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c index 016a61c52c45..8038deae35a7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c @@ -92,7 +92,7 @@ int mlx5e_rep_bond_enslave(struct mlx5_eswitch *esw, struct net_device *netdev, mdata = mlx5e_lookup_rep_bond_metadata(&rpriv->uplink_priv, lag_dev); if (!mdata) { /* First netdev becomes slave, no metadata presents the lag_dev. Create one */ - mdata = kzalloc(sizeof(*mdata), GFP_KERNEL); + mdata = kzalloc_obj(*mdata, GFP_KERNEL); if (!mdata) return -ENOMEM; @@ -110,7 +110,7 @@ int mlx5e_rep_bond_enslave(struct mlx5_eswitch *esw, struct net_device *netdev, mdata->metadata_reg_c_0); } - s_entry = kzalloc(sizeof(*s_entry), GFP_KERNEL); + s_entry = kzalloc_obj(*s_entry, GFP_KERNEL); if (!s_entry) { err = -ENOMEM; goto entry_alloc_err; @@ -315,7 +315,7 @@ int mlx5e_rep_bond_init(struct mlx5e_rep_priv *rpriv) if (!mlx5_esw_acl_egress_fwd2vport_supported(priv->mdev->priv.eswitch)) goto out; - uplink_priv->bond = kvzalloc(sizeof(*uplink_priv->bond), GFP_KERNEL); + uplink_priv->bond = kvzalloc_obj(*uplink_priv->bond, GFP_KERNEL); if (!uplink_priv->bond) { ret = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c index 87a2ad69526d..baac38bece14 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c @@ -394,7 +394,7 @@ mlx5_esw_bridge_init_switchdev_fdb_work(struct net_device *dev, bool add, struct mlx5_bridge_switchdev_fdb_work *work; u8 *addr; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c index 2e9bee4e5209..cbfb0cc32a3b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c @@ -173,7 +173,7 @@ static struct neigh_update_work *mlx5e_alloc_neigh_update_work(struct mlx5e_priv struct mlx5e_neigh_hash_entry *nhe; struct mlx5e_neigh m_neigh = {}; - update_work = kzalloc(sizeof(*update_work), GFP_ATOMIC); + update_work = kzalloc_obj(*update_work, GFP_ATOMIC); if (WARN_ON(!update_work)) return NULL; @@ -376,7 +376,7 @@ int mlx5e_rep_neigh_entry_create(struct mlx5e_priv *priv, { int err; - *nhe = kzalloc(sizeof(**nhe), GFP_KERNEL); + *nhe = kzalloc_obj(**nhe, GFP_KERNEL); if (!*nhe) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c index a55452c69f06..2dc5e139c99c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c @@ -503,7 +503,7 @@ mlx5e_rep_indr_setup_block(struct net_device *netdev, struct Qdisc *sch, if (indr_priv) return -EEXIST; - indr_priv = kmalloc(sizeof(*indr_priv), GFP_KERNEL); + indr_priv = kmalloc_obj(*indr_priv, GFP_KERNEL); if (!indr_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c index 88b0e1050d1a..c9d141b8650b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c @@ -93,7 +93,7 @@ void mlx5e_rss_params_indir_modify_actual_size(struct mlx5e_rss *rss, u32 num_ch int mlx5e_rss_params_indir_init(struct mlx5e_rss_params_indir *indir, u32 actual_table_size, u32 max_table_size) { - indir->table = kvmalloc_array(max_table_size, sizeof(*indir->table), GFP_KERNEL); + indir->table = kvmalloc_objs(*indir->table, max_table_size, GFP_KERNEL); if (!indir->table) return -ENOMEM; @@ -134,7 +134,7 @@ static struct mlx5e_rss *mlx5e_rss_init_copy(const struct mlx5e_rss *from) struct mlx5e_rss *rss; int err; - rss = kvzalloc(sizeof(*rss), GFP_KERNEL); + rss = kvzalloc_obj(*rss, GFP_KERNEL); if (!rss) return ERR_PTR(-ENOMEM); @@ -216,7 +216,7 @@ mlx5e_rss_create_tir(struct mlx5e_rss *rss, enum mlx5_traffic_types tt, if (*tir_p) return -EINVAL; - tir = kvzalloc(sizeof(*tir), GFP_KERNEL); + tir = kvzalloc_obj(*tir, GFP_KERNEL); if (!tir) return -ENOMEM; @@ -372,7 +372,7 @@ mlx5e_rss_init(struct mlx5_core_dev *mdev, struct mlx5e_rss *rss; int err; - rss = kvzalloc(sizeof(*rss), GFP_KERNEL); + rss = kvzalloc_obj(*rss, GFP_KERNEL); if (!rss) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c index 55c117b7d8c4..a9f55ffb894e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c @@ -325,7 +325,7 @@ static struct mlx5e_rx_res *mlx5e_rx_res_alloc(struct mlx5_core_dev *mdev, unsig { struct mlx5e_rx_res *rx_res; - rx_res = kvzalloc(sizeof(*rx_res), GFP_KERNEL); + rx_res = kvzalloc_obj(*rx_res, GFP_KERNEL); if (!rx_res) return NULL; @@ -359,7 +359,7 @@ static int mlx5e_rx_res_channels_init(struct mlx5e_rx_res *res) if (!builder) return -ENOMEM; - res->channels = kvcalloc(res->max_nch, sizeof(*res->channels), GFP_KERNEL); + res->channels = kvzalloc_objs(*res->channels, res->max_nch, GFP_KERNEL); if (!res->channels) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c b/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c index f66bbc846464..4598d922385a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c @@ -30,11 +30,11 @@ int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock) selq->state_lock = state_lock; - selq->standby = kvzalloc(sizeof(*selq->standby), GFP_KERNEL); + selq->standby = kvzalloc_obj(*selq->standby, GFP_KERNEL); if (!selq->standby) return -ENOMEM; - init_params = kvzalloc(sizeof(*selq->active), GFP_KERNEL); + init_params = kvzalloc_obj(*selq->active, GFP_KERNEL); if (!init_params) { kvfree(selq->standby); selq->standby = NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c index 7aa926e542d3..45ff384b66d4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c @@ -36,7 +36,7 @@ mlx5e_tc_act_stats_create(void) struct mlx5e_tc_act_stats_handle *handle; int err; - handle = kvzalloc(sizeof(*handle), GFP_KERNEL); + handle = kvzalloc_obj(*handle, GFP_KERNEL); if (!handle) return ERR_PTR(-ENOMEM); @@ -67,7 +67,7 @@ mlx5e_tc_act_stats_add(struct mlx5e_tc_act_stats_handle *handle, u64 lastused; int err = 0; - act_stats = kvzalloc(sizeof(*act_stats), GFP_KERNEL); + act_stats = kvzalloc_obj(*act_stats, GFP_KERNEL); if (!act_stats) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c index 64a82aafaaca..e983da2574ec 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c @@ -34,7 +34,7 @@ mlx5_ct_fs_dmfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, struct mlx5_ct_fs_dmfs_rule *dmfs_rule; int err; - dmfs_rule = kzalloc(sizeof(*dmfs_rule), GFP_KERNEL); + dmfs_rule = kzalloc_obj(*dmfs_rule, GFP_KERNEL); if (!dmfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c index d3db6146fcad..59aa6ee5be05 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c @@ -203,7 +203,7 @@ mlx5_ct_fs_hmfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, if (!mlx5e_tc_ct_is_valid_flow_rule(fs->netdev, flow_rule)) return ERR_PTR(-EOPNOTSUPP); - hmfs_rule = kzalloc(sizeof(*hmfs_rule), GFP_KERNEL); + hmfs_rule = kzalloc_obj(*hmfs_rule, GFP_KERNEL); if (!hmfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c index 4d6924b644c9..897d8f7ed7f2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c @@ -92,7 +92,7 @@ mlx5_ct_fs_smfs_matcher_create(struct mlx5_ct_fs *fs, struct mlx5dr_table *tbl, struct mlx5dr_matcher *dr_matcher; struct mlx5_flow_spec *spec; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -234,7 +234,7 @@ mlx5_ct_fs_smfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, if (!mlx5e_tc_ct_is_valid_flow_rule(fs->netdev, flow_rule)) return ERR_PTR(-EOPNOTSUPP); - smfs_rule = kzalloc(sizeof(*smfs_rule), GFP_KERNEL); + smfs_rule = kzalloc_obj(*smfs_rule, GFP_KERNEL); if (!smfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c index 991f47050643..11754c8ae986 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c @@ -69,7 +69,7 @@ mlx5e_int_port_create_rx_rule(struct mlx5_eswitch *esw, struct mlx5_flow_spec *spec; void *misc; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -167,7 +167,7 @@ mlx5e_int_port_add(struct mlx5e_tc_int_port_priv *priv, return ERR_PTR(-ENOSPC); } - int_port = kzalloc(sizeof(*int_port), GFP_KERNEL); + int_port = kzalloc_obj(*int_port, GFP_KERNEL); if (!int_port) return ERR_PTR(-ENOMEM); @@ -313,7 +313,7 @@ mlx5e_tc_int_port_init(struct mlx5e_priv *priv) if (!mlx5e_tc_int_port_supported(esw)) return NULL; - int_port_priv = kzalloc(sizeof(*int_port_priv), GFP_KERNEL); + int_port_priv = kzalloc_obj(*int_port_priv, GFP_KERNEL); if (!int_port_priv) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c index d5d9146efca6..80ddbe373f97 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c @@ -247,7 +247,7 @@ __mlx5e_flow_meter_alloc(struct mlx5e_flow_meters *flow_meters, bool alloc_aso) int err, pos, total; u32 id; - meter = kzalloc(sizeof(*meter), GFP_KERNEL); + meter = kzalloc_obj(*meter, GFP_KERNEL); if (!meter) return ERR_PTR(-ENOMEM); @@ -526,7 +526,7 @@ mlx5e_flow_meters_init(struct mlx5e_priv *priv, return ERR_PTR(-EOPNOTSUPP); } - flow_meters = kzalloc(sizeof(*flow_meters), GFP_KERNEL); + flow_meters = kzalloc_obj(*flow_meters, GFP_KERNEL); if (!flow_meters) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c index b500cc2c9689..62184531b3e6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c @@ -42,7 +42,7 @@ mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, goto err_check; } - post_act = kzalloc(sizeof(*post_act), GFP_KERNEL); + post_act = kzalloc_obj(*post_act, GFP_KERNEL); if (!post_act) { err = -ENOMEM; goto err_check; @@ -86,7 +86,7 @@ mlx5e_tc_post_act_offload(struct mlx5e_post_act *post_act, if (IS_ERR(post_act)) return PTR_ERR(post_act); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -117,7 +117,7 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *po if (IS_ERR(post_act)) return ERR_CAST(post_act); - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c index 50b60fd00946..e5467a94e9dc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c @@ -156,7 +156,7 @@ mlx5e_post_meter_rate_rules_create(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -402,7 +402,7 @@ mlx5e_post_meter_init(struct mlx5e_priv *priv, struct mlx5e_post_meter_priv *post_meter; int err; - post_meter = kzalloc(sizeof(*post_meter), GFP_KERNEL); + post_meter = kzalloc_obj(*post_meter, GFP_KERNEL); if (!post_meter) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c index 5db239cae814..938961520f6c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c @@ -183,7 +183,7 @@ sampler_get(struct mlx5e_tc_psample *tc_psample, u32 sample_ratio, u32 default_t sample_ratio, default_table_id)) goto add_ref; - sampler = kzalloc(sizeof(*sampler), GFP_KERNEL); + sampler = kzalloc_obj(*sampler, GFP_KERNEL); if (!sampler) { err = -ENOMEM; goto err_alloc; @@ -273,7 +273,7 @@ sample_restore_get(struct mlx5e_tc_psample *tc_psample, u32 obj_id, if (restore->obj_id == obj_id) goto add_ref; - restore = kzalloc(sizeof(*restore), GFP_KERNEL); + restore = kzalloc_obj(*restore, GFP_KERNEL); if (!restore) { err = -ENOMEM; goto err_alloc; @@ -485,7 +485,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, if (IS_ERR_OR_NULL(tc_psample)) return ERR_PTR(-EOPNOTSUPP); - sample_flow = kzalloc(sizeof(*sample_flow), GFP_KERNEL); + sample_flow = kzalloc_obj(*sample_flow, GFP_KERNEL); if (!sample_flow) return ERR_PTR(-ENOMEM); sample_attr = &attr->sample_attr; @@ -619,7 +619,7 @@ mlx5e_tc_sample_init(struct mlx5_eswitch *esw, struct mlx5e_post_act *post_act) struct mlx5e_tc_psample *tc_psample; int err; - tc_psample = kzalloc(sizeof(*tc_psample), GFP_KERNEL); + tc_psample = kzalloc_obj(*tc_psample, GFP_KERNEL); if (!tc_psample) return ERR_PTR(-ENOMEM); if (IS_ERR_OR_NULL(post_act)) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index fc0e57403d25..2d3654faabfa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -812,7 +812,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, zone_rule->nat = nat; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -887,7 +887,7 @@ mlx5_tc_ct_entry_update_rule(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1021,7 +1021,7 @@ mlx5_tc_ct_counter_create(struct mlx5_tc_ct_priv *ct_priv) struct mlx5_ct_counter *counter; int ret; - counter = kzalloc(sizeof(*counter), GFP_KERNEL); + counter = kzalloc_obj(*counter, GFP_KERNEL); if (!counter) return ERR_PTR(-ENOMEM); @@ -1219,7 +1219,7 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, } spin_unlock_bh(&ct_priv->ht_lock); - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1620,7 +1620,7 @@ static int tc_ct_pre_ct_add_rules(struct mlx5_ct_ft *ct_ft, u16 zone; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1856,7 +1856,7 @@ mlx5_tc_ct_add_ft_cb(struct mlx5_tc_ct_priv *ct_priv, u16 zone, return ft; } - ft = kzalloc(sizeof(*ft), GFP_KERNEL); + ft = kzalloc_obj(*ft, GFP_KERNEL); if (!ft) return ERR_PTR(-ENOMEM); @@ -2298,7 +2298,7 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, if (err) goto err_support; - ct_priv = kzalloc(sizeof(*ct_priv), GFP_KERNEL); + ct_priv = kzalloc_obj(*ct_priv, GFP_KERNEL); if (!ct_priv) goto err_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c index 0735d10f2bac..9a7c6df78640 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c @@ -87,7 +87,7 @@ int mlx5e_tc_set_attr_rx_tun(struct mlx5e_tc_flow *flow, void *daddr, *saddr; u8 ip_version; - tun_attr = kvzalloc(sizeof(*tun_attr), GFP_KERNEL); + tun_attr = kvzalloc_obj(*tun_attr, GFP_KERNEL); if (!tun_attr) return -ENOMEM; @@ -864,7 +864,7 @@ int mlx5e_attach_encap(struct mlx5e_priv *priv, goto attach_flow; } - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { err = -ENOMEM; goto out_err; @@ -976,7 +976,7 @@ int mlx5e_attach_decap(struct mlx5e_priv *priv, goto found; } - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { err = -ENOMEM; goto out_err; @@ -1205,7 +1205,7 @@ mlx5e_route_get_create(struct mlx5e_priv *priv, return r; } - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return ERR_PTR(-ENOMEM); @@ -1251,7 +1251,7 @@ mlx5e_tc_init_fib_work(unsigned long event, struct net_device *ul_dev, gfp_t fla { struct mlx5e_tc_fib_event_data *fib_work; - fib_work = kzalloc(sizeof(*fib_work), flags); + fib_work = kzalloc_obj(*fib_work, flags); if (WARN_ON(!fib_work)) return NULL; @@ -1862,7 +1862,7 @@ struct mlx5e_tc_tun_encap *mlx5e_tc_tun_init(struct mlx5e_priv *priv) struct mlx5e_tc_tun_encap *encap; int err; - encap = kvzalloc(sizeof(*encap), GFP_KERNEL); + encap = kvzalloc_obj(*encap, GFP_KERNEL); if (!encap) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c index 0b55e77f19c8..e02f04a7b211 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c @@ -22,7 +22,7 @@ struct mlx5e_tir_builder *mlx5e_tir_builder_alloc(bool modify) { struct mlx5e_tir_builder *builder; - builder = kvzalloc(sizeof(*builder), GFP_KERNEL); + builder = kvzalloc_obj(*builder, GFP_KERNEL); if (!builder) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c index 5c5360a25c64..52de57d7c7dc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c @@ -23,8 +23,8 @@ static void mlx5e_xsk_unmap_pool(struct mlx5e_priv *priv, static int mlx5e_xsk_get_pools(struct mlx5e_xsk *xsk) { if (!xsk->pools) { - xsk->pools = kcalloc(MLX5E_MAX_NUM_CHANNELS, - sizeof(*xsk->pools), GFP_KERNEL); + xsk->pools = kzalloc_objs(*xsk->pools, MLX5E_MAX_NUM_CHANNELS, + GFP_KERNEL); if (unlikely(!xsk->pools)) return -ENOMEM; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c index 5981c71cae2d..bd0cf822cea9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c @@ -123,7 +123,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, if (!mlx5e_validate_xsk_param(params, xsk, priv->mdev)) return -EINVAL; - cparam = kvzalloc(sizeof(*cparam), GFP_KERNEL); + cparam = kvzalloc_obj(*cparam, GFP_KERNEL); if (!cparam) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c index 1febdc5b81f9..64fe7921f380 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c @@ -82,7 +82,7 @@ struct mlx5_flow_handle *mlx5e_accel_fs_add_sk(struct mlx5e_flow_steering *fs, struct mlx5_flow_handle *flow; struct mlx5_flow_spec *spec; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -186,7 +186,7 @@ static int accel_fs_tcp_create_groups(struct mlx5e_flow_table *ft, int err; u8 *mc; - ft->g = kcalloc(MLX5E_ACCEL_FS_TCP_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_ACCEL_FS_TCP_NUM_GROUPS, GFP_KERNEL); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -378,7 +378,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs) if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version)) return -EOPNOTSUPP; - accel_tcp = kzalloc(sizeof(*accel_tcp), GFP_KERNEL); + accel_tcp = kzalloc_obj(*accel_tcp, GFP_KERNEL); if (!accel_tcp) return -ENOMEM; mlx5e_fs_set_accel_tcp(fs, accel_tcp); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c index 9c7064187ed0..6ae17d24e64d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c @@ -712,21 +712,20 @@ static int mlx5_ipsec_create_work(struct mlx5e_ipsec_sa_entry *sa_entry) break; } - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; switch (x->xso.type) { case XFRM_DEV_OFFLOAD_CRYPTO: - data = kzalloc(sizeof(*sa_entry), GFP_KERNEL); + data = kzalloc_obj(*sa_entry, GFP_KERNEL); if (!data) goto free_work; INIT_WORK(&work->work, mlx5e_ipsec_modify_state); break; case XFRM_DEV_OFFLOAD_PACKET: - data = kzalloc(sizeof(struct mlx5e_ipsec_netevent_data), - GFP_KERNEL); + data = kzalloc_obj(struct mlx5e_ipsec_netevent_data, GFP_KERNEL); if (!data) goto free_work; @@ -760,7 +759,7 @@ static int mlx5e_ipsec_create_dwork(struct mlx5e_ipsec_sa_entry *sa_entry) x->lft.hard_byte_limit == XFRM_INF) return 0; - dwork = kzalloc(sizeof(*dwork), GFP_KERNEL); + dwork = kzalloc_obj(*dwork, GFP_KERNEL); if (!dwork) return -ENOMEM; @@ -787,7 +786,7 @@ static int mlx5e_xfrm_add_state(struct net_device *dev, ipsec = priv->ipsec; gfp = (x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ) ? GFP_ATOMIC : GFP_KERNEL; - sa_entry = kzalloc(sizeof(*sa_entry), gfp); + sa_entry = kzalloc_obj(*sa_entry, gfp); if (!sa_entry) return -ENOMEM; @@ -989,7 +988,7 @@ void mlx5e_ipsec_init(struct mlx5e_priv *priv) return; } - ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); if (!ipsec) return; @@ -1277,7 +1276,7 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x, if (err) return err; - pol_entry = kzalloc(sizeof(*pol_entry), GFP_KERNEL); + pol_entry = kzalloc_obj(*pol_entry, GFP_KERNEL); if (!pol_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c index feef86fff4bf..8139772387f1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c @@ -208,7 +208,7 @@ static int rx_add_rule_drop_auth_trailer(struct mlx5e_ipsec_sa_entry *sa_entry, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -287,7 +287,7 @@ static int rx_add_rule_drop_replay(struct mlx5e_ipsec_sa_entry *sa_entry, struct struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -347,7 +347,7 @@ static int ipsec_rx_status_drop_all_create(struct mlx5e_ipsec *ipsec, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!flow_group_in || !spec) { err = -ENOMEM; goto err_out; @@ -454,7 +454,7 @@ ipsec_rx_status_pass_create(struct mlx5e_ipsec *ipsec, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -554,7 +554,7 @@ static int ipsec_miss_create(struct mlx5_core_dev *mdev, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!flow_group_in || !spec) { err = -ENOMEM; goto out; @@ -1226,7 +1226,7 @@ static int ipsec_counter_rule_tx(struct mlx5_core_dev *mdev, struct mlx5e_ipsec_ struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1962,7 +1962,7 @@ static int rx_add_rule_sa_selector(struct mlx5e_ipsec_sa_entry *sa_entry, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -2046,7 +2046,7 @@ static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) if (IS_ERR(rx)) return PTR_ERR(rx); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2176,7 +2176,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) if (IS_ERR(tx)) return PTR_ERR(tx); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2267,7 +2267,7 @@ static int tx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) if (IS_ERR(ft)) return PTR_ERR(ft); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2354,7 +2354,7 @@ static int rx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) rx = ipsec_rx(pol_entry->ipsec, attrs->addrs.family, attrs->type); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2434,7 +2434,7 @@ static struct mlx5e_ipsec_fc *ipsec_fs_init_single_counter(struct mlx5_core_dev struct mlx5_fc *counter; int err; - fc = kzalloc(sizeof(*fc), GFP_KERNEL); + fc = kzalloc_obj(*fc, GFP_KERNEL); if (!fc) return ERR_PTR(-ENOMEM); @@ -2778,24 +2778,24 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec, if (!ns_esw) return -EOPNOTSUPP; - ipsec->tx_esw = kzalloc(sizeof(*ipsec->tx_esw), GFP_KERNEL); + ipsec->tx_esw = kzalloc_obj(*ipsec->tx_esw, GFP_KERNEL); if (!ipsec->tx_esw) return -ENOMEM; - ipsec->rx_esw = kzalloc(sizeof(*ipsec->rx_esw), GFP_KERNEL); + ipsec->rx_esw = kzalloc_obj(*ipsec->rx_esw, GFP_KERNEL); if (!ipsec->rx_esw) goto err_rx_esw; } - ipsec->tx = kzalloc(sizeof(*ipsec->tx), GFP_KERNEL); + ipsec->tx = kzalloc_obj(*ipsec->tx, GFP_KERNEL); if (!ipsec->tx) goto err_tx; - ipsec->rx_ipv4 = kzalloc(sizeof(*ipsec->rx_ipv4), GFP_KERNEL); + ipsec->rx_ipv4 = kzalloc_obj(*ipsec->rx_ipv4, GFP_KERNEL); if (!ipsec->rx_ipv4) goto err_rx_ipv4; - ipsec->rx_ipv6 = kzalloc(sizeof(*ipsec->rx_ipv6), GFP_KERNEL); + ipsec->rx_ipv6 = kzalloc_obj(*ipsec->rx_ipv6, GFP_KERNEL); if (!ipsec->rx_ipv6) goto err_rx_ipv6; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c index ef7322d381af..14d7a63f752e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c @@ -503,7 +503,7 @@ static int mlx5e_ipsec_event(struct notifier_block *nb, unsigned long event, if (!sa_entry) return NOTIFY_DONE; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; @@ -522,7 +522,7 @@ int mlx5e_ipsec_aso_init(struct mlx5e_ipsec *ipsec) struct device *pdev; int err; - aso = kzalloc(sizeof(*ipsec->aso), GFP_KERNEL); + aso = kzalloc_obj(*ipsec->aso, GFP_KERNEL); if (!aso) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c index 1c2cc2aad2b0..ac348aacdb0d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c @@ -199,7 +199,7 @@ int mlx5e_ktls_init(struct mlx5e_priv *priv) if (!mlx5e_is_ktls_device(priv->mdev)) return 0; - tls = kzalloc(sizeof(*tls), GFP_KERNEL); + tls = kzalloc_obj(*tls, GFP_KERNEL); if (!tls) return -ENOMEM; tls->mdev = priv->mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c index 5d8fe252799e..47de07467e0c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c @@ -90,7 +90,7 @@ mlx5e_ktls_rx_resync_create_resp_list(void) { struct mlx5e_ktls_resync_resp *resp_list; - resp_list = kvzalloc(sizeof(*resp_list), GFP_KERNEL); + resp_list = kvzalloc_obj(*resp_list, GFP_KERNEL); if (!resp_list) return ERR_PTR(-ENOMEM); @@ -261,7 +261,7 @@ resync_post_get_progress_params(struct mlx5e_icosq *sq, int err; u16 pi; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (unlikely(!buf)) { err = -ENOMEM; goto err_out; @@ -643,7 +643,7 @@ int mlx5e_ktls_add_rx(struct net_device *netdev, struct sock *sk, tls_ctx = tls_get_ctx(sk); priv = netdev_priv(netdev); - priv_rx = kzalloc(sizeof(*priv_rx), GFP_KERNEL); + priv_rx = kzalloc_obj(*priv_rx, GFP_KERNEL); if (unlikely(!priv_rx)) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c index 08f06984407b..b93f7d41a692 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c @@ -196,7 +196,7 @@ mlx5e_tls_priv_tx_init(struct mlx5_core_dev *mdev, struct mlx5e_tls_sw_stats *sw struct mlx5e_ktls_offload_context_tx *priv_tx; int err; - priv_tx = kzalloc(sizeof(*priv_tx), GFP_KERNEL); + priv_tx = kzalloc_obj(*priv_tx, GFP_KERNEL); if (!priv_tx) return ERR_PTR(-ENOMEM); @@ -360,7 +360,7 @@ static struct mlx5e_tls_tx_pool *mlx5e_tls_tx_pool_init(struct mlx5_core_dev *md BUILD_BUG_ON(MLX5E_TLS_TX_POOL_LOW + MLX5E_TLS_TX_POOL_BULK >= MLX5E_TLS_TX_POOL_HIGH); - pool = kvzalloc(sizeof(*pool), GFP_KERNEL); + pool = kvzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index 90b3bc5f9166..14db0a2af406 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -165,7 +165,7 @@ static int mlx5e_macsec_aso_reg_mr(struct mlx5_core_dev *mdev, struct mlx5e_macs dma_addr_t dma_addr; int err; - umr = kzalloc(sizeof(*umr), GFP_KERNEL); + umr = kzalloc_obj(*umr, GFP_KERNEL); if (!umr) { err = -ENOMEM; return err; @@ -530,7 +530,7 @@ static int mlx5e_macsec_add_txsa(struct macsec_context *ctx) goto out; } - tx_sa = kzalloc(sizeof(*tx_sa), GFP_KERNEL); + tx_sa = kzalloc_obj(*tx_sa, GFP_KERNEL); if (!tx_sa) { err = -ENOMEM; goto out; @@ -701,13 +701,13 @@ static int mlx5e_macsec_add_rxsc(struct macsec_context *ctx) goto out; } - rx_sc = kzalloc(sizeof(*rx_sc), GFP_KERNEL); + rx_sc = kzalloc_obj(*rx_sc, GFP_KERNEL); if (!rx_sc) { err = -ENOMEM; goto out; } - sc_xarray_element = kzalloc(sizeof(*sc_xarray_element), GFP_KERNEL); + sc_xarray_element = kzalloc_obj(*sc_xarray_element, GFP_KERNEL); if (!sc_xarray_element) { err = -ENOMEM; goto destroy_rx_sc; @@ -912,7 +912,7 @@ static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx) goto out; } - rx_sa = kzalloc(sizeof(*rx_sa), GFP_KERNEL); + rx_sa = kzalloc_obj(*rx_sa, GFP_KERNEL); if (!rx_sa) { err = -ENOMEM; goto out; @@ -1093,7 +1093,7 @@ static int mlx5e_macsec_add_secy(struct macsec_context *ctx) goto out; } - macsec_device = kzalloc(sizeof(*macsec_device), GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); if (!macsec_device) { err = -ENOMEM; goto out; @@ -1565,7 +1565,7 @@ static int macsec_obj_change_event(struct notifier_block *nb, unsigned long even if (obj_type != MLX5_GENERAL_OBJECT_TYPES_MACSEC) return NOTIFY_DONE; - async_work = kzalloc(sizeof(*async_work), GFP_ATOMIC); + async_work = kzalloc_obj(*async_work, GFP_ATOMIC); if (!async_work) return NOTIFY_DONE; @@ -1730,7 +1730,7 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv) return 0; } - macsec = kzalloc(sizeof(*macsec), GFP_KERNEL); + macsec = kzalloc_obj(*macsec, GFP_KERNEL); if (!macsec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c index 9a74438ce10a..ea250eecbed1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c @@ -142,7 +142,7 @@ static int accel_psp_fs_rx_err_add_rule(struct mlx5e_psp_fs *fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -344,7 +344,7 @@ static int accel_psp_fs_rx_create_ft(struct mlx5e_psp_fs *fs, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!flow_group_in || !spec) { err = -ENOMEM; goto out; @@ -560,7 +560,7 @@ static int accel_psp_fs_init_rx(struct mlx5e_psp_fs *fs) enum accel_fs_psp_type i; int err; - accel_psp = kzalloc(sizeof(*accel_psp), GFP_KERNEL); + accel_psp = kzalloc_obj(*accel_psp, GFP_KERNEL); if (!accel_psp) return -ENOMEM; @@ -686,7 +686,7 @@ static int accel_psp_fs_tx_create_ft_table(struct mlx5e_psp_fs *fs) struct mlx5_flow_group *fg; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); in = kvzalloc(inlen, GFP_KERNEL); if (!spec || !in) { err = -ENOMEM; @@ -815,7 +815,7 @@ static int accel_psp_fs_init_tx(struct mlx5e_psp_fs *fs) if (!ns) return -EOPNOTSUPP; - tx_fs = kzalloc(sizeof(*tx_fs), GFP_KERNEL); + tx_fs = kzalloc_obj(*tx_fs, GFP_KERNEL); if (!tx_fs) return -ENOMEM; @@ -896,7 +896,7 @@ static struct mlx5e_psp_fs *mlx5e_accel_psp_fs_init(struct mlx5e_priv *priv) struct mlx5e_psp_fs *fs; int err = 0; - fs = kzalloc(sizeof(*fs), GFP_KERNEL); + fs = kzalloc_obj(*fs, GFP_KERNEL); if (!fs) return ERR_PTR(-ENOMEM); @@ -1127,7 +1127,7 @@ int mlx5e_psp_init(struct mlx5e_priv *priv) return 0; } - psp = kzalloc(sizeof(*psp), GFP_KERNEL); + psp = kzalloc_obj(*psp, GFP_KERNEL); if (!psp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c index 93cf23278d93..dbe824a62f22 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c @@ -260,8 +260,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, int err; u8 *mc; - ft->g = kcalloc(MLX5E_ARFS_NUM_GROUPS, - sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_ARFS_NUM_GROUPS, GFP_KERNEL); if (!ft->g) return -ENOMEM; @@ -392,7 +391,7 @@ int mlx5e_arfs_create_tables(struct mlx5e_flow_steering *fs, if (!ntuple) return 0; - arfs = kvzalloc(sizeof(*arfs), GFP_KERNEL); + arfs = kvzalloc_obj(*arfs, GFP_KERNEL); if (!arfs) return -ENOMEM; @@ -523,7 +522,7 @@ static struct mlx5_flow_handle *arfs_add_rule(struct mlx5e_priv *priv, struct mlx5_flow_table *ft; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { priv->channel_stats[arfs_rule->rxq]->rq.arfs_err++; err = -ENOMEM; @@ -662,7 +661,7 @@ static struct arfs_rule *arfs_alloc_rule(struct mlx5e_priv *priv, struct arfs_rule *rule; struct arfs_tuple *tuple; - rule = kzalloc(sizeof(*rule), GFP_ATOMIC); + rule = kzalloc_obj(*rule, GFP_ATOMIC); if (!rule) { priv->channel_stats[rxq]->rq.arfs_err++; return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c index 5a2ac7b6f260..5da0a13d92f1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c @@ -179,7 +179,7 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev, bool create_tises) num_doorbells = min(mlx5e_get_devlink_param_num_doorbells(mdev), mlx5e_get_max_num_channels(mdev)); - res->bfregs = kcalloc(num_doorbells, sizeof(*res->bfregs), GFP_KERNEL); + res->bfregs = kzalloc_objs(*res->bfregs, num_doorbells, GFP_KERNEL); if (!res->bfregs) { err = -ENOMEM; goto err_destroy_mkey; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c index 8928d2dcd43f..1dd5f916597b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -128,7 +128,7 @@ static void mlx5e_add_l2_to_hash(struct hlist_head *hash, const u8 *addr) return; } - hn = kzalloc(sizeof(*hn), GFP_ATOMIC); + hn = kzalloc_obj(*hn, GFP_ATOMIC); if (!hn) return; @@ -295,7 +295,7 @@ static int mlx5e_add_vlan_rule(struct mlx5e_flow_steering *fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -372,7 +372,7 @@ mlx5e_add_trap_rule(struct mlx5_flow_table *ft, int trap_id, int tir_num) struct mlx5_flow_handle *rule; struct mlx5_flow_spec *spec; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); spec->flow_context.flags |= FLOW_CONTEXT_HAS_TAG; @@ -754,7 +754,7 @@ static int mlx5e_add_promisc_rule(struct mlx5e_flow_steering *fs) struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; @@ -984,7 +984,7 @@ static int mlx5e_add_l2_flow_rule(struct mlx5e_flow_steering *fs, u8 *mc_dmac; u8 *mv_dmac; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1039,7 +1039,7 @@ static int mlx5e_create_l2_table_groups(struct mlx5e_l2_table *l2_table) int err; u8 *mc; - ft->g = kcalloc(MLX5E_NUM_L2_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_L2_GROUPS, GFP_KERNEL); if (!ft->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -1251,7 +1251,7 @@ static int mlx5e_fs_create_vlan_table(struct mlx5e_flow_steering *fs) if (IS_ERR(ft->t)) return PTR_ERR(ft->t); - ft->g = kcalloc(MLX5E_NUM_VLAN_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_VLAN_GROUPS, GFP_KERNEL); if (!ft->g) { err = -ENOMEM; goto err_destroy_vlan_table; @@ -1394,7 +1394,7 @@ void mlx5e_destroy_flow_steering(struct mlx5e_flow_steering *fs, bool ntuple, static int mlx5e_fs_vlan_alloc(struct mlx5e_flow_steering *fs) { - fs->vlan = kvzalloc(sizeof(*fs->vlan), GFP_KERNEL); + fs->vlan = kvzalloc_obj(*fs->vlan, GFP_KERNEL); if (!fs->vlan) return -ENOMEM; return 0; @@ -1466,7 +1466,7 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile, struct mlx5e_flow_steering *fs; int err; - fs = kvzalloc(sizeof(*fs), GFP_KERNEL); + fs = kvzalloc_obj(*fs, GFP_KERNEL); if (!fs) goto err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index 63bdef5b4ba5..d01636af3d02 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -465,7 +465,7 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); err = set_flow_attrs(spec->match_criteria, spec->match_value, @@ -476,7 +476,7 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv, if (fs->ring_cookie == RX_CLS_FLOW_DISC) { flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP; } else { - dst = kzalloc(sizeof(*dst), GFP_KERNEL); + dst = kzalloc_obj(*dst, GFP_KERNEL); if (!dst) { err = -ENOMEM; goto free; @@ -541,7 +541,7 @@ static struct mlx5e_ethtool_rule *get_ethtool_rule(struct mlx5e_priv *priv, if (eth_rule) del_ethtool_rule(priv->fs, eth_rule); - eth_rule = kzalloc(sizeof(*eth_rule), GFP_KERNEL); + eth_rule = kzalloc_obj(*eth_rule, GFP_KERNEL); if (!eth_rule) return ERR_PTR(-ENOMEM); @@ -836,7 +836,7 @@ mlx5e_ethtool_get_all_flows(struct mlx5e_priv *priv, int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool) { - *ethtool = kvzalloc(sizeof(**ethtool), GFP_KERNEL); + *ethtool = kvzalloc_obj(**ethtool, GFP_KERNEL); if (!*ethtool) return -ENOMEM; return 0; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 7eb691c2a1bd..41edda3d0c70 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2791,7 +2791,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, return err; c = kvzalloc_node(sizeof(*c), GFP_KERNEL, cpu_to_node(cpu)); - cparam = kvzalloc(sizeof(*cparam), GFP_KERNEL); + cparam = kvzalloc_obj(*cparam, GFP_KERNEL); if (!c || !cparam) { err = -ENOMEM; goto err_free; @@ -2911,7 +2911,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv, chs->num = chs->params.num_channels; - chs->c = kcalloc(chs->num, sizeof(struct mlx5e_channel *), GFP_KERNEL); + chs->c = kzalloc_objs(struct mlx5e_channel *, chs->num, GFP_KERNEL); if (!chs->c) goto err_out; @@ -3415,8 +3415,8 @@ int mlx5e_safe_switch_params(struct mlx5e_priv *priv, if (!reset) return mlx5e_switch_priv_params(priv, params, preactivate, context); - old_chs = kzalloc(sizeof(*old_chs), GFP_KERNEL); - new_chs = kzalloc(sizeof(*new_chs), GFP_KERNEL); + old_chs = kzalloc_obj(*old_chs, GFP_KERNEL); + new_chs = kzalloc_obj(*new_chs, GFP_KERNEL); if (!old_chs || !new_chs) { err = -ENOMEM; goto err_free_chs; @@ -6258,8 +6258,8 @@ int mlx5e_priv_init(struct mlx5e_priv *priv, if (!priv->channel_stats) goto err_free_tx_rates; - priv->fec_ranges = kcalloc(ETHTOOL_FEC_HIST_MAX, - sizeof(*priv->fec_ranges), GFP_KERNEL); + priv->fec_ranges = kzalloc_objs(*priv->fec_ranges, ETHTOOL_FEC_HIST_MAX, + GFP_KERNEL); if (!priv->fec_ranges) goto err_free_channel_stats; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 6eec88fa6d10..b0bc37669305 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -476,7 +476,7 @@ static int mlx5e_sqs2vport_add_peers_rules(struct mlx5_eswitch *esw, struct mlx5 struct mlx5e_rep_sq_peer *sq_peer; int err; - sq_peer = kzalloc(sizeof(*sq_peer), GFP_KERNEL); + sq_peer = kzalloc_obj(*sq_peer, GFP_KERNEL); if (!sq_peer) return -ENOMEM; @@ -521,7 +521,7 @@ static int mlx5e_sqs2vport_start(struct mlx5_eswitch *esw, devcom_locked = true; for (i = 0; i < sqns_num; i++) { - rep_sq = kzalloc(sizeof(*rep_sq), GFP_KERNEL); + rep_sq = kzalloc_obj(*rep_sq, GFP_KERNEL); if (!rep_sq) { err = -ENOMEM; goto out_err; @@ -1621,7 +1621,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) struct mlx5e_rep_priv *rpriv; int err; - rpriv = kvzalloc(sizeof(*rpriv), GFP_KERNEL); + rpriv = kvzalloc_obj(*rpriv, GFP_KERNEL); if (!rpriv) return -ENOMEM; @@ -1731,7 +1731,7 @@ static int mlx5e_vport_rep_event_pair(struct mlx5_eswitch *esw, sq_peer->peer = peer_esw; continue; } - sq_peer = kzalloc(sizeof(*sq_peer), GFP_KERNEL); + sq_peer = kzalloc_obj(*sq_peer, GFP_KERNEL); if (!sq_peer) { err = -ENOMEM; goto err_sq_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c index fcad464bc4d5..4066778f702d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c @@ -270,7 +270,7 @@ static int mlx5e_test_loopback(struct mlx5e_priv *priv) return -ENODEV; } - lbtp = kzalloc(sizeof(*lbtp), GFP_KERNEL); + lbtp = kzalloc_obj(*lbtp, GFP_KERNEL); if (!lbtp) return -ENOMEM; lbtp->loopback_ok = false; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 424786f489ec..761cfd2d95f1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -153,7 +153,7 @@ struct mlx5e_tc_table *mlx5e_tc_table_alloc(void) { struct mlx5e_tc_table *tc; - tc = kvzalloc(sizeof(*tc), GFP_KERNEL); + tc = kvzalloc_obj(*tc, GFP_KERNEL); return tc ? tc : ERR_PTR(-ENOMEM); } @@ -905,7 +905,7 @@ mlx5e_hairpin_create(struct mlx5e_priv *priv, struct mlx5_hairpin_params *params struct mlx5_hairpin *pair; int err; - hp = kzalloc(sizeof(*hp), GFP_KERNEL); + hp = kzalloc_obj(*hp, GFP_KERNEL); if (!hp) return ERR_PTR(-ENOMEM); @@ -1139,7 +1139,7 @@ static int mlx5e_hairpin_flow_add(struct mlx5e_priv *priv, goto attach_flow; } - hpe = kzalloc(sizeof(*hpe), GFP_KERNEL); + hpe = kzalloc_obj(*hpe, GFP_KERNEL); if (!hpe) { mutex_unlock(&tc->hairpin_tbl_lock); return -ENOMEM; @@ -1794,7 +1794,7 @@ extra_split_attr_dests(struct mlx5e_tc_flow *flow, return PTR_ERR(post_act); attr2 = mlx5_alloc_flow_attr(mlx5e_get_flow_namespace(flow)); - parse_attr2 = kvzalloc(sizeof(*parse_attr), GFP_KERNEL); + parse_attr2 = kvzalloc_obj(*parse_attr, GFP_KERNEL); if (!attr2 || !parse_attr2) { err = -ENOMEM; goto err_free; @@ -2570,7 +2570,7 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, } else if (tunnel) { struct mlx5_flow_spec *tmp_spec; - tmp_spec = kvzalloc(sizeof(*tmp_spec), GFP_KERNEL); + tmp_spec = kvzalloc_obj(*tmp_spec, GFP_KERNEL); if (!tmp_spec) { NL_SET_ERR_MSG_MOD(extack, "Failed to allocate memory for tunnel tmp spec"); netdev_warn(priv->netdev, "Failed to allocate memory for tunnel tmp spec"); @@ -3671,7 +3671,7 @@ mlx5e_clone_flow_attr_for_post_act(struct mlx5_flow_attr *attr, struct mlx5_flow_attr *attr2; attr2 = mlx5_alloc_flow_attr(ns_type); - parse_attr = kvzalloc(sizeof(*parse_attr), GFP_KERNEL); + parse_attr = kvzalloc_obj(*parse_attr, GFP_KERNEL); if (!attr2 || !parse_attr) { kvfree(parse_attr); kfree(attr2); @@ -4448,8 +4448,8 @@ mlx5e_alloc_flow(struct mlx5e_priv *priv, int attr_size, int err = -ENOMEM; int out_index; - flow = kzalloc(sizeof(*flow), GFP_KERNEL); - parse_attr = kvzalloc(sizeof(*parse_attr), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); + parse_attr = kvzalloc_obj(*parse_attr, GFP_KERNEL); if (!parse_attr || !flow) goto err_free; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 25499da177bc..cc679500b3dc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -881,7 +881,7 @@ static int comp_irq_request_sf(struct mlx5_core_dev *dev, u16 vecidx) if (!mlx5_irq_pool_is_sf_pool(pool)) return comp_irq_request_pci(dev, vecidx); - af_desc = kvzalloc(sizeof(*af_desc), GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); if (!af_desc) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c index 3ce455c2535c..a95d12860fed 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c @@ -58,7 +58,7 @@ int esw_egress_acl_vlan_create(struct mlx5_eswitch *esw, if (vport->egress.allowed_vlan) return -EEXIST; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c index 49a637829c59..f8ca68ea685e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c @@ -200,7 +200,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, "vport[%d] configure ingress rules, vlan(%d) qos(%d)\n", vport->vport, vport->info.vlan, vport->info.qos); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c index a436ce895e45..4ffaa7b4b5b1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c @@ -29,7 +29,7 @@ static int esw_acl_ingress_prio_tag_create(struct mlx5_eswitch *esw, * required, allow * Unmatched traffic is allowed by default */ - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c index 60e10047770f..b9e9505ff76e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c @@ -586,7 +586,7 @@ mlx5_esw_bridge_ingress_flow_with_esw_create(u16 vport_num, const unsigned char struct mlx5_flow_handle *handle; u8 *smac_v, *smac_c; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -700,7 +700,7 @@ mlx5_esw_bridge_ingress_filter_flow_create(u16 vport_num, const unsigned char *a struct mlx5_flow_handle *handle; u8 *smac_v, *smac_c; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -753,7 +753,7 @@ mlx5_esw_bridge_egress_flow_create(u16 vport_num, u16 esw_owner_vhca_id, const u struct mlx5_flow_handle *handle; u8 *dmac_v, *dmac_c; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -821,7 +821,7 @@ mlx5_esw_bridge_egress_miss_flow_create(struct mlx5_flow_table *egress_ft, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -844,7 +844,7 @@ static struct mlx5_esw_bridge *mlx5_esw_bridge_create(struct net_device *br_netd struct mlx5_esw_bridge *bridge; int err; - bridge = kvzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kvzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return ERR_PTR(-ENOMEM); @@ -1179,7 +1179,7 @@ mlx5_esw_bridge_vlan_create(u16 vlan_proto, u16 vid, u16 flags, struct mlx5_esw_ struct mlx5_esw_bridge_vlan *vlan; int err; - vlan = kvzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kvzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return ERR_PTR(-ENOMEM); @@ -1365,7 +1365,7 @@ mlx5_esw_bridge_fdb_entry_init(struct net_device *dev, u16 vport_num, u16 esw_ow if (entry) mlx5_esw_bridge_fdb_entry_notify_and_cleanup(entry, bridge); - entry = kvzalloc(sizeof(*entry), GFP_KERNEL); + entry = kvzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -1550,7 +1550,7 @@ static int mlx5_esw_bridge_vport_init(u16 vport_num, u16 esw_owner_vhca_id, u16 struct mlx5_esw_bridge_port *port; int err; - port = kvzalloc(sizeof(*port), GFP_KERNEL); + port = kvzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -1924,7 +1924,7 @@ struct mlx5_esw_bridge_offloads *mlx5_esw_bridge_init(struct mlx5_eswitch *esw) ASSERT_RTNL(); - br_offloads = kvzalloc(sizeof(*br_offloads), GFP_KERNEL); + br_offloads = kvzalloc_obj(*br_offloads, GFP_KERNEL); if (!br_offloads) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c index 22dd30cf8033..15e5a05f5dd8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c @@ -65,11 +65,11 @@ mlx5_esw_bridge_mdb_flow_create(u16 esw_owner_vhca_id, struct mlx5_esw_bridge_md u8 *dmac_v, *dmac_c; unsigned long idx; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); - dests = kvcalloc(num_dests, sizeof(*dests), GFP_KERNEL); + dests = kvzalloc_objs(*dests, num_dests, GFP_KERNEL); if (!dests) { kvfree(rule_spec); return ERR_PTR(-ENOMEM); @@ -152,7 +152,7 @@ mlx5_esw_bridge_port_mdb_entry_init(struct mlx5_esw_bridge_port *port, struct mlx5_esw_bridge_mdb_entry *entry; int err; - entry = kvzalloc(sizeof(*entry), GFP_KERNEL); + entry = kvzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -516,7 +516,7 @@ mlx5_esw_bridge_mcast_flow_with_esw_create(struct mlx5_esw_bridge_port *port, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -584,7 +584,7 @@ mlx5_esw_bridge_mcast_vlan_flow_create(u16 vlan_proto, struct mlx5_esw_bridge_po struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -656,7 +656,7 @@ mlx5_esw_bridge_mcast_fwd_flow_create(struct mlx5_esw_bridge_port *port) struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -890,7 +890,7 @@ mlx5_esw_bridge_ingress_igmp_fh_create(struct mlx5_flow_table *ingress_ft, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -922,7 +922,7 @@ mlx5_esw_bridge_ingress_mld_fh_create(u8 type, struct mlx5_flow_table *ingress_f struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc(sizeof(*rule_spec), GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); if (!rule_spec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c index cd60bc500ec5..0b8bb42af33f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c @@ -70,7 +70,7 @@ int mlx5_esw_offloads_pf_vf_devlink_port_init(struct mlx5_eswitch *esw, if (!mlx5_esw_devlink_port_supported(esw, vport_num)) return 0; - dl_port = kzalloc(sizeof(*dl_port), GFP_KERNEL); + dl_port = kzalloc_obj(*dl_port, GFP_KERNEL); if (!dl_port) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c index 9959e9fd15a1..1a135c3e48df 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c @@ -46,7 +46,7 @@ struct mlx5_esw_indir_table { struct mlx5_esw_indir_table * mlx5_esw_indir_table_init(void) { - struct mlx5_esw_indir_table *indir = kvzalloc(sizeof(*indir), GFP_KERNEL); + struct mlx5_esw_indir_table *indir = kvzalloc_obj(*indir, GFP_KERNEL); if (!indir) return ERR_PTR(-ENOMEM); @@ -111,7 +111,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw, return 0; } - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return -ENOMEM; @@ -258,7 +258,7 @@ mlx5_esw_indir_table_entry_create(struct mlx5_eswitch *esw, struct mlx5_flow_att if (!root_ns) return ERR_PTR(-ENOENT); - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c index 929adeb50a98..0ee931bca98b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c @@ -259,7 +259,7 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw, if (err) return err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c index 4278bcb04c72..2f9e59790584 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c @@ -38,7 +38,7 @@ static struct mlx5_qos_domain *esw_qos_domain_alloc(void) { struct mlx5_qos_domain *qos_domain; - qos_domain = kzalloc(sizeof(*qos_domain), GFP_KERNEL); + qos_domain = kzalloc_obj(*qos_domain, GFP_KERNEL); if (!qos_domain) return NULL; @@ -518,7 +518,7 @@ __esw_qos_alloc_node(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_node_type { struct mlx5_esw_sched_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; @@ -916,9 +916,8 @@ esw_qos_create_vport_tc_sched_elements(struct mlx5_vport *vport, int err, num_tcs = esw_qos_num_tcs(vport_node->esw->dev); u32 rate_limit_elem_ix; - vport->qos.sched_nodes = kcalloc(num_tcs, - sizeof(struct mlx5_esw_sched_node *), - GFP_KERNEL); + vport->qos.sched_nodes = kzalloc_objs(struct mlx5_esw_sched_node *, + num_tcs, GFP_KERNEL); if (!vport->qos.sched_nodes) { NL_SET_ERR_MSG_MOD(extack, "Allocating the vport TC scheduling elements failed."); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c index 407062096a82..5628182faf57 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c @@ -96,7 +96,7 @@ mlx5_esw_vporttbl_get(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr goto out; } - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { fdb = ERR_PTR(-ENOMEM); goto err_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 5fbfabe28bdb..d31a74ae1dd7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -221,7 +221,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u16 vport, bool rx_rule, if (rx_rule) match_header |= MLX5_MATCH_MISC_PARAMETERS; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; @@ -1862,7 +1862,7 @@ int mlx5_esw_vport_alloc(struct mlx5_eswitch *esw, int index, u16 vport_num) struct mlx5_vport *vport; int err; - vport = kzalloc(sizeof(*vport), GFP_KERNEL); + vport = kzalloc_obj(*vport, GFP_KERNEL); if (!vport) return -ENOMEM; @@ -2022,7 +2022,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) if (!MLX5_VPORT_MANAGER(dev) && !MLX5_ESWITCH_MANAGER(dev)) return 0; - esw = kzalloc(sizeof(*esw), GFP_KERNEL); + esw = kzalloc_obj(*esw, GFP_KERNEL); if (!esw) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 1b439cef3719..1693f2dd5d6a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -680,7 +680,7 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, if (!esw_flow_dests_fwd_ipsec_check(esw, esw_attr)) return ERR_PTR(-EOPNOTSUPP); - dest = kcalloc(MLX5_MAX_FLOW_FWD_VPORTS + 1, sizeof(*dest), GFP_KERNEL); + dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1, GFP_KERNEL); if (!dest) return ERR_PTR(-ENOMEM); @@ -808,7 +808,7 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw, struct mlx5_flow_handle *rule; int i, err = 0; - dest = kcalloc(MLX5_MAX_FLOW_FWD_VPORTS + 1, sizeof(*dest), GFP_KERNEL); + dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1, GFP_KERNEL); if (!dest) return ERR_PTR(-ENOMEM); @@ -947,7 +947,7 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *on_esw, void *misc; u16 vport; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { flow_rule = ERR_PTR(-ENOMEM); goto out; @@ -1044,7 +1044,7 @@ mlx5_eswitch_add_send_to_vport_meta_rule(struct mlx5_eswitch *esw, u16 vport_num struct mlx5_flow_handle *flow_rule; struct mlx5_flow_spec *spec; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -1198,13 +1198,13 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw, !mlx5_core_is_ecpf_esw_manager(peer_dev)) return 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; peer_miss_rules_setup(esw, peer_dev, spec, &dest); - flows = kvcalloc(peer_esw->total_vports, sizeof(*flows), GFP_KERNEL); + flows = kvzalloc_objs(*flows, peer_esw->total_vports, GFP_KERNEL); if (!flows) { err = -ENOMEM; goto alloc_flows_err; @@ -1368,7 +1368,7 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw) u8 *dmac_c; u8 *dmac_v; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { err = -ENOMEM; goto out; @@ -1430,7 +1430,7 @@ esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag) if (!mlx5_eswitch_reg_c1_loopback_supported(esw)) return ERR_PTR(-EOPNOTSUPP); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -2148,7 +2148,7 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport, struct mlx5_flow_handle *flow_rule; struct mlx5_flow_spec *spec; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { flow_rule = ERR_PTR(-ENOMEM); goto out; @@ -2525,7 +2525,7 @@ int mlx5_esw_offloads_rep_add(struct mlx5_eswitch *esw, int rep_type; int err; - rep = kzalloc(sizeof(*rep), GFP_KERNEL); + rep = kzalloc_obj(*rep, GFP_KERNEL); if (!rep) return -ENOMEM; @@ -2861,7 +2861,7 @@ static int __esw_set_master_egress_rule(struct mlx5_core_dev *master, int err = 0; void *misc; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -3640,7 +3640,7 @@ int mlx5_esw_funcs_changed_handler(struct notifier_block *nb, unsigned long type struct mlx5_host_work *host_work; struct mlx5_eswitch *esw; - host_work = kzalloc(sizeof(*host_work), GFP_ATOMIC); + host_work = kzalloc_obj(*host_work, GFP_ATOMIC); if (!host_work) return NOTIFY_DONE; @@ -4470,7 +4470,7 @@ int mlx5_esw_vport_vhca_id_map(struct mlx5_eswitch *esw, } vhca_id = vport->vhca_id; - vhca_map_entry = kmalloc(sizeof(*vhca_map_entry), GFP_KERNEL); + vhca_map_entry = kmalloc_obj(*vhca_map_entry, GFP_KERNEL); if (!vhca_map_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c index 40bdc677f051..af82232d53ef 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c @@ -132,7 +132,7 @@ mlx5_eswitch_termtbl_get_create(struct mlx5_eswitch *esw, if (found) goto tt_add_ref; - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); if (!tt) { err = -ENOMEM; goto tt_create_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c index 01c5f5990f9a..23ecc8e8a219 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/events.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c @@ -374,7 +374,7 @@ static int forward_event(struct notifier_block *nb, unsigned long event, void *d int mlx5_events_init(struct mlx5_core_dev *dev) { - struct mlx5_events *events = kzalloc(sizeof(*events), GFP_KERNEL); + struct mlx5_events *events = kzalloc_obj(*events, GFP_KERNEL); if (!events) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c index ccef64fb40b6..2b029dc3f0c8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c @@ -531,17 +531,15 @@ static int mlx5_fpga_conn_create_qp(struct mlx5_fpga_conn *conn, if (err) goto out; - conn->qp.rq.bufs = kvcalloc(conn->qp.rq.size, - sizeof(conn->qp.rq.bufs[0]), - GFP_KERNEL); + conn->qp.rq.bufs = kvzalloc_objs(conn->qp.rq.bufs[0], conn->qp.rq.size, + GFP_KERNEL); if (!conn->qp.rq.bufs) { err = -ENOMEM; goto err_wq; } - conn->qp.sq.bufs = kvcalloc(conn->qp.sq.size, - sizeof(conn->qp.sq.bufs[0]), - GFP_KERNEL); + conn->qp.sq.bufs = kvzalloc_objs(conn->qp.sq.bufs[0], conn->qp.sq.size, + GFP_KERNEL); if (!conn->qp.sq.bufs) { err = -ENOMEM; goto err_rq_bufs; @@ -816,7 +814,7 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev, if (!attr->recv_cb) return ERR_PTR(-EINVAL); - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c index 1ec61164e6b5..ae87ca14cae4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c @@ -59,7 +59,7 @@ static struct mlx5_fpga_device *mlx5_fpga_device_alloc(void) { struct mlx5_fpga_device *fdev; - fdev = kzalloc(sizeof(*fdev), GFP_KERNEL); + fdev = kzalloc_obj(*fdev, GFP_KERNEL); if (!fdev) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 0a6031a64c6f..80950d84d07a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -947,7 +947,7 @@ alloc_flow_table(struct mlx5_flow_table_attr *ft_attr, u16 vport, struct mlx5_flow_table *ft; int ret; - ft = kzalloc(sizeof(*ft), GFP_KERNEL); + ft = kzalloc_obj(*ft, GFP_KERNEL); if (!ft) return ERR_PTR(-ENOMEM); @@ -1530,7 +1530,7 @@ static struct mlx5_flow_rule *alloc_rule(struct mlx5_flow_destination *dest) { struct mlx5_flow_rule *rule; - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return NULL; @@ -1548,7 +1548,7 @@ static struct mlx5_flow_handle *alloc_handle(int num_rules) { struct mlx5_flow_handle *handle; - handle = kzalloc(struct_size(handle, rule, num_rules), GFP_KERNEL); + handle = kzalloc_flex(*handle, rule, num_rules, GFP_KERNEL); if (!handle) return NULL; @@ -2096,7 +2096,7 @@ static int build_match_list(struct match_list *match_head, if (unlikely(!tree_get_node(&g->node))) continue; - curr_match = kmalloc(sizeof(*curr_match), GFP_ATOMIC); + curr_match = kmalloc_obj(*curr_match, GFP_ATOMIC); if (!curr_match) { rcu_read_unlock(); free_match_list(match_head, ft_locked); @@ -2178,7 +2178,7 @@ add_rule_dup_match_fte(struct fs_fte *fte, int i = 0; if (!fte->dup) { - dup = kvzalloc(sizeof(*dup), GFP_KERNEL); + dup = kvzalloc_obj(*dup, GFP_KERNEL); if (!dup) return ERR_PTR(-ENOMEM); /* dup will be freed when the fte is freed @@ -2471,8 +2471,7 @@ mlx5_add_flow_rules(struct mlx5_flow_table *ft, goto unlock; } - gen_dest = kcalloc(num_dest + 1, sizeof(*dest), - GFP_KERNEL); + gen_dest = kzalloc_objs(*dest, num_dest + 1, GFP_KERNEL); if (!gen_dest) { handle = ERR_PTR(-ENOMEM); goto unlock; @@ -2849,7 +2848,7 @@ static struct fs_prio *_fs_create_prio(struct mlx5_flow_namespace *ns, { struct fs_prio *fs_prio; - fs_prio = kzalloc(sizeof(*fs_prio), GFP_KERNEL); + fs_prio = kzalloc_obj(*fs_prio, GFP_KERNEL); if (!fs_prio) return ERR_PTR(-ENOMEM); @@ -2889,7 +2888,7 @@ static struct mlx5_flow_namespace *fs_create_namespace(struct fs_prio *prio, { struct mlx5_flow_namespace *ns; - ns = kzalloc(sizeof(*ns), GFP_KERNEL); + ns = kzalloc_obj(*ns, GFP_KERNEL); if (!ns) return ERR_PTR(-ENOMEM); @@ -3020,7 +3019,7 @@ static struct mlx5_flow_root_namespace struct mlx5_flow_namespace *ns; /* Create the root namespace */ - root_ns = kzalloc(sizeof(*root_ns), GFP_KERNEL); + root_ns = kzalloc_obj(*root_ns, GFP_KERNEL); if (!root_ns) return NULL; @@ -3375,9 +3374,8 @@ static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering) total_vports = mlx5_eswitch_get_total_vports(dev) ?: 1; steering->rdma_transport_rx_root_ns = - kcalloc(total_vports, - sizeof(*steering->rdma_transport_rx_root_ns), - GFP_KERNEL); + kzalloc_objs(*steering->rdma_transport_rx_root_ns, + total_vports, GFP_KERNEL); if (!steering->rdma_transport_rx_root_ns) return -ENOMEM; @@ -3408,9 +3406,8 @@ static int init_rdma_transport_tx_root_ns(struct mlx5_flow_steering *steering) total_vports = mlx5_eswitch_get_total_vports(dev) ?: 1; steering->rdma_transport_tx_root_ns = - kcalloc(total_vports, - sizeof(*steering->rdma_transport_tx_root_ns), - GFP_KERNEL); + kzalloc_objs(*steering->rdma_transport_tx_root_ns, + total_vports, GFP_KERNEL); if (!steering->rdma_transport_tx_root_ns) return -ENOMEM; @@ -3518,9 +3515,8 @@ static int create_fdb_fast_path(struct mlx5_flow_steering *steering) { int err; - steering->fdb_sub_ns = kcalloc(FDB_NUM_CHAINS, - sizeof(*steering->fdb_sub_ns), - GFP_KERNEL); + steering->fdb_sub_ns = kzalloc_objs(*steering->fdb_sub_ns, + FDB_NUM_CHAINS, GFP_KERNEL); if (!steering->fdb_sub_ns) return -ENOMEM; @@ -3674,7 +3670,7 @@ mlx5_fs_add_vport_acl_root_ns(struct mlx5_flow_steering *steering, if (xa_load(esw_acl_root_ns, vport_idx)) return -EEXIST; - vport_ns = kzalloc(sizeof(*vport_ns), GFP_KERNEL); + vport_ns = kzalloc_obj(*vport_ns, GFP_KERNEL); if (!vport_ns) return -ENOMEM; @@ -3993,7 +3989,7 @@ int mlx5_fs_core_alloc(struct mlx5_core_dev *dev) if (err) goto err; - steering = kzalloc(sizeof(*steering), GFP_KERNEL); + steering = kzalloc_obj(*steering, GFP_KERNEL); if (!steering) { err = -ENOMEM; goto err; @@ -4034,7 +4030,7 @@ int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn) struct mlx5_ft_underlay_qp *new_uqp; int err = 0; - new_uqp = kzalloc(sizeof(*new_uqp), GFP_KERNEL); + new_uqp = kzalloc_obj(*new_uqp, GFP_KERNEL); if (!new_uqp) return -ENOMEM; @@ -4137,7 +4133,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - modify_hdr = kzalloc(sizeof(*modify_hdr), GFP_KERNEL); + modify_hdr = kzalloc_obj(*modify_hdr, GFP_KERNEL); if (!modify_hdr) return ERR_PTR(-ENOMEM); @@ -4178,7 +4174,7 @@ struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - pkt_reformat = kzalloc(sizeof(*pkt_reformat), GFP_KERNEL); + pkt_reformat = kzalloc_obj(*pkt_reformat, GFP_KERNEL); if (!pkt_reformat) return ERR_PTR(-ENOMEM); @@ -4226,7 +4222,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - definer = kzalloc(sizeof(*definer), GFP_KERNEL); + definer = kzalloc_obj(*definer, GFP_KERNEL); if (!definer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c index fe7caa910219..b2b3a12493f4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c @@ -234,11 +234,11 @@ static struct mlx5_fc *mlx5_fc_single_alloc(struct mlx5_core_dev *dev) struct mlx5_fc *counter; int err; - counter = kzalloc(sizeof(*counter), GFP_KERNEL); + counter = kzalloc_obj(*counter, GFP_KERNEL); if (!counter) return ERR_PTR(-ENOMEM); - fc_bulk = kzalloc(sizeof(*fc_bulk), GFP_KERNEL); + fc_bulk = kzalloc_obj(*fc_bulk, GFP_KERNEL); if (!fc_bulk) { err = -ENOMEM; goto free_counter; @@ -328,7 +328,7 @@ int mlx5_init_fc_stats(struct mlx5_core_dev *dev) { struct mlx5_fc_stats *fc_stats; - fc_stats = kzalloc(sizeof(*fc_stats), GFP_KERNEL); + fc_stats = kzalloc_obj(*fc_stats, GFP_KERNEL); if (!fc_stats) return -ENOMEM; dev->priv.fc_stats = fc_stats; @@ -460,7 +460,7 @@ static struct mlx5_fs_bulk *mlx5_fc_bulk_create(struct mlx5_core_dev *dev, alloc_bitmask = MLX5_CAP_GEN(dev, flow_counter_bulk_alloc); bulk_len = alloc_bitmask > 0 ? MLX5_FC_BULK_NUM_FCS(alloc_bitmask) : 1; - fc_bulk = kvzalloc(struct_size(fc_bulk, fcs, bulk_len), GFP_KERNEL); + fc_bulk = kvzalloc_flex(*fc_bulk, fcs, bulk_len, GFP_KERNEL); if (!fc_bulk) return NULL; @@ -572,10 +572,10 @@ mlx5_fc_local_create(u32 counter_id, u32 offset, u32 bulk_size) struct mlx5_fc_bulk *fc_bulk; struct mlx5_fc *counter; - counter = kzalloc(sizeof(*counter), GFP_KERNEL); + counter = kzalloc_obj(*counter, GFP_KERNEL); if (!counter) return ERR_PTR(-ENOMEM); - fc_bulk = kzalloc(sizeof(*fc_bulk), GFP_KERNEL); + fc_bulk = kzalloc_obj(*fc_bulk, GFP_KERNEL); if (!fc_bulk) { kfree(counter); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c index f6abfd00d7e6..847e940d4d70 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c @@ -26,7 +26,7 @@ int mlx5_ft_pool_init(struct mlx5_core_dev *dev) struct mlx5_ft_pool *ft_pool; int i; - ft_pool = kzalloc(sizeof(*ft_pool), GFP_KERNEL); + ft_pool = kzalloc_obj(*ft_pool, GFP_KERNEL); if (!ft_pool) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c index ae10665c53f3..c0e23bc2d96a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -899,7 +899,7 @@ int mlx5_fw_reset_init(struct mlx5_core_dev *dev) if (!MLX5_CAP_MCAM_REG(dev, mfrl)) return 0; - fw_reset = kzalloc(sizeof(*fw_reset), GFP_KERNEL); + fw_reset = kzalloc_obj(*fw_reset, GFP_KERNEL); if (!fw_reset) return -ENOMEM; fw_reset->wq = create_singlethread_workqueue("mlx5_fw_reset_events"); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c index 4ba2636d7fb6..ab005d7d184b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c @@ -298,7 +298,7 @@ static struct mlx5_hwmon *mlx5_hwmon_alloc(struct mlx5_core_dev *mdev) u32 sensors_count; int err; - hwmon = kzalloc(sizeof(*mdev->hwmon), GFP_KERNEL); + hwmon = kzalloc_obj(*mdev->hwmon, GFP_KERNEL); if (!hwmon) return ERR_PTR(-ENOMEM); @@ -313,8 +313,8 @@ static struct mlx5_hwmon *mlx5_hwmon_alloc(struct mlx5_core_dev *mdev) hwmon->module_scount = mon_cap ? 1 : 0; sensors_count = hwmon->asic_platform_scount + hwmon->module_scount; - hwmon->temp_channel_desc = kcalloc(sensors_count, sizeof(*hwmon->temp_channel_desc), - GFP_KERNEL); + hwmon->temp_channel_desc = kzalloc_objs(*hwmon->temp_channel_desc, + sensors_count, GFP_KERNEL); if (!hwmon->temp_channel_desc) { err = -ENOMEM; goto err_free_hwmon; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c index 04444dad3a0d..96a75b8ef779 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c @@ -51,7 +51,7 @@ int mlx5i_pkey_qpn_ht_init(struct net_device *netdev) struct mlx5i_priv *ipriv = netdev_priv(netdev); struct mlx5i_pkey_qpn_ht *qpn_htbl; - qpn_htbl = kzalloc(sizeof(*qpn_htbl), GFP_KERNEL); + qpn_htbl = kzalloc_obj(*qpn_htbl, GFP_KERNEL); if (!qpn_htbl) return -ENOMEM; @@ -89,7 +89,7 @@ int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn) u8 key = hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP); struct qpn_to_netdev *new_node; - new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); + new_node = kzalloc_obj(*new_node, GFP_KERNEL); if (!new_node) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c index 14d339eceb92..0be0b614938c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c @@ -52,7 +52,7 @@ irq_pool_request_irq(struct mlx5_irq_pool *pool, struct irq_affinity_desc *af_de u32 irq_index; int err; - auto_desc = kvzalloc(sizeof(*auto_desc), GFP_KERNEL); + auto_desc = kvzalloc_obj(*auto_desc, GFP_KERNEL); if (!auto_desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c index 9fe47c836ebd..0eed75f5ccc2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c @@ -272,7 +272,7 @@ static struct mlx5_lag *mlx5_lag_dev_alloc(struct mlx5_core_dev *dev) struct mlx5_lag *ldev; int err; - ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); + ldev = kzalloc_obj(*ldev, GFP_KERNEL); if (!ldev) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c index cdc99fe5c956..c4c2bf33ef35 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c @@ -291,7 +291,7 @@ mlx5_lag_init_fib_work(struct mlx5_lag *ldev, unsigned long event) { struct mlx5_fib_event_work *fib_work; - fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); + fib_work = kzalloc_obj(*fib_work, GFP_ATOMIC); if (WARN_ON(!fib_work)) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c index 04762562d7d9..d3458adcc1e5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c @@ -171,7 +171,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev, if (!ldev) return 0; - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); if (!work) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c index d832a12ffec0..63071fcb3a51 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c @@ -308,7 +308,7 @@ mlx5_lag_create_definer(struct mlx5_lag *ldev, enum netdev_lag_hash hash, return ERR_PTR(-EINVAL); dev = ldev->pf[first_idx].dev; - lag_definer = kzalloc(sizeof(*lag_definer), GFP_KERNEL); + lag_definer = kzalloc_obj(*lag_definer, GFP_KERNEL); if (!lag_definer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c index 129725159a93..004077710a34 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c @@ -311,7 +311,7 @@ struct mlx5_aso *mlx5_aso_create(struct mlx5_core_dev *mdev, u32 pdn) struct mlx5_aso *aso; int err; - aso = kzalloc(sizeof(*aso), GFP_KERNEL); + aso = kzalloc_obj(*aso, GFP_KERNEL); if (!aso) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c index 0ba0ef8bae42..6067d3ac3cb8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -1082,9 +1082,8 @@ static void mlx5_init_pin_config(struct mlx5_core_dev *mdev) return; clock->ptp_info.pin_config = - kcalloc(clock->ptp_info.n_pins, - sizeof(*clock->ptp_info.pin_config), - GFP_KERNEL); + kzalloc_objs(*clock->ptp_info.pin_config, + clock->ptp_info.n_pins, GFP_KERNEL); if (!clock->ptp_info.pin_config) return; clock->ptp_info.enable = mlx5_ptp_enable; @@ -1407,7 +1406,7 @@ static int mlx5_clock_alloc(struct mlx5_core_dev *mdev, bool shared) struct mlx5_clock_priv *cpriv; struct mlx5_clock *clock; - cpriv = kzalloc(sizeof(*cpriv), GFP_KERNEL); + cpriv = kzalloc_obj(*cpriv, GFP_KERNEL); if (!cpriv) return -ENOMEM; @@ -1604,7 +1603,7 @@ int mlx5_init_clock(struct mlx5_core_dev *mdev) return 0; } - clock_state = kzalloc(sizeof(*clock_state), GFP_KERNEL); + clock_state = kzalloc_obj(*clock_state, GFP_KERNEL); if (!clock_state) return -ENOMEM; clock_state->mdev = mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c index 3a94b8f8031e..b47e828406f9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c @@ -293,7 +293,7 @@ mlx5_crypto_dek_bulk_create(struct mlx5_crypto_dek_pool *pool) int num_deks, base_obj_id; int err; - bulk = kzalloc(sizeof(*bulk), GFP_KERNEL); + bulk = kzalloc_obj(*bulk, GFP_KERNEL); if (!bulk) return ERR_PTR(-ENOMEM); @@ -611,7 +611,7 @@ struct mlx5_crypto_dek *mlx5_crypto_dek_create(struct mlx5_crypto_dek_pool *dek_ int obj_offset; int err; - dek = kzalloc(sizeof(*dek), GFP_KERNEL); + dek = kzalloc_obj(*dek, GFP_KERNEL); if (!dek) return ERR_PTR(-ENOMEM); @@ -683,7 +683,7 @@ mlx5_crypto_dek_pool_create(struct mlx5_core_dev *mdev, int key_purpose) { struct mlx5_crypto_dek_pool *pool; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); @@ -748,7 +748,7 @@ struct mlx5_crypto_dek_priv *mlx5_crypto_dek_init(struct mlx5_core_dev *mdev) if (!MLX5_CAP_CRYPTO(mdev, log_dek_max_alloc)) return NULL; - dek_priv = kzalloc(sizeof(*dek_priv), GFP_KERNEL); + dek_priv = kzalloc_obj(*dek_priv, GFP_KERNEL); if (!dek_priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c index e749618229bc..d681c063be4e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c @@ -64,7 +64,7 @@ mlx5_devcom_dev_alloc(struct mlx5_core_dev *dev) { struct mlx5_devcom_dev *devc; - devc = kzalloc(sizeof(*devc), GFP_KERNEL); + devc = kzalloc_obj(*devc, GFP_KERNEL); if (!devc) return NULL; @@ -120,7 +120,7 @@ mlx5_devcom_comp_alloc(u64 id, const struct mlx5_devcom_match_attr *attr, { struct mlx5_devcom_comp *comp; - comp = kzalloc(sizeof(*comp), GFP_KERNEL); + comp = kzalloc_obj(*comp, GFP_KERNEL); if (!comp) return NULL; @@ -158,7 +158,7 @@ devcom_alloc_comp_dev(struct mlx5_devcom_dev *devc, { struct mlx5_devcom_comp_dev *devcom; - devcom = kzalloc(sizeof(*devcom), GFP_KERNEL); + devcom = kzalloc_obj(*devcom, GFP_KERNEL); if (!devcom) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c index 8115071c34a4..b6fc7ca4bcc0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c @@ -28,7 +28,7 @@ struct mlx5_dm *mlx5_dm_create(struct mlx5_core_dev *dev) if (!(MLX5_CAP_GEN_64(dev, general_obj_types) & MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM)) return NULL; - dm = kzalloc(sizeof(*dm), GFP_KERNEL); + dm = kzalloc_obj(*dm, GFP_KERNEL); if (!dm) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c index 0a3c260af377..d8242edec30f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c @@ -314,7 +314,7 @@ mlx5_chains_create_chain(struct mlx5_fs_chains *chains, u32 chain) struct fs_chain *chain_s = NULL; int err; - chain_s = kvzalloc(sizeof(*chain_s), GFP_KERNEL); + chain_s = kvzalloc_obj(*chain_s, GFP_KERNEL); if (!chain_s) return ERR_PTR(-ENOMEM); @@ -481,7 +481,7 @@ mlx5_chains_create_prio(struct mlx5_fs_chains *chains, if (IS_ERR(chain_s)) return ERR_CAST(chain_s); - prio_s = kvzalloc(sizeof(*prio_s), GFP_KERNEL); + prio_s = kvzalloc_obj(*prio_s, GFP_KERNEL); flow_group_in = kvzalloc(inlen, GFP_KERNEL); if (!prio_s || !flow_group_in) { err = -ENOMEM; @@ -728,7 +728,7 @@ mlx5_chains_init(struct mlx5_core_dev *dev, struct mlx5_chains_attr *attr) struct mlx5_fs_chains *chains; int err; - chains = kzalloc(sizeof(*chains), GFP_KERNEL); + chains = kzalloc_obj(*chains, GFP_KERNEL); if (!chains) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c index 7adad784ad46..feed745cddab 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c @@ -359,7 +359,7 @@ mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -536,7 +536,7 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc, int err; u8 *mc; - ttc->g = kcalloc(groups->num_groups, sizeof(*ttc->g), GFP_KERNEL); + ttc->g = kzalloc_objs(*ttc->g, groups->num_groups, GFP_KERNEL); if (!ttc->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -630,7 +630,7 @@ mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev, int err = 0; u8 ipv; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -713,7 +713,7 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc, int err; u8 *mc; - ttc->g = kcalloc(groups->num_groups, sizeof(*ttc->g), GFP_KERNEL); + ttc->g = kzalloc_objs(*ttc->g, groups->num_groups, GFP_KERNEL); if (!ttc->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -804,7 +804,7 @@ struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev, return ERR_PTR(-EINVAL); } - ttc = kvzalloc(sizeof(*ttc), GFP_KERNEL); + ttc = kvzalloc_obj(*ttc, GFP_KERNEL); if (!ttc) return ERR_PTR(-ENOMEM); @@ -882,7 +882,7 @@ struct mlx5_ttc_table *mlx5_create_ttc_table(struct mlx5_core_dev *dev, return ERR_PTR(-EINVAL); } - ttc = kvzalloc(sizeof(*ttc), GFP_KERNEL); + ttc = kvzalloc_obj(*ttc, GFP_KERNEL); if (!ttc) return ERR_PTR(-ENOMEM); @@ -1029,7 +1029,7 @@ mlx5_ttc_create_ipsec_outer_rule(struct mlx5_ttc_table *ttc, if (err) return ERR_PTR(err); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); @@ -1070,7 +1070,7 @@ mlx5_ttc_create_ipsec_inner_rule(struct mlx5_ttc_table *ttc, if (err) return ERR_PTR(err); - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c index 6dc83e871cd7..7664a74cbf18 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c @@ -134,8 +134,7 @@ void mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) struct mlx5_geneve *mlx5_geneve_create(struct mlx5_core_dev *mdev) { - struct mlx5_geneve *geneve = - kzalloc(sizeof(*geneve), GFP_KERNEL); + struct mlx5_geneve *geneve = kzalloc_obj(*geneve, GFP_KERNEL); if (!geneve) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c index 30564d9b00e9..6b3f906653bd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c @@ -42,7 +42,7 @@ struct mlx5_hv_vhca *mlx5_hv_vhca_create(struct mlx5_core_dev *dev) { struct mlx5_hv_vhca *hv_vhca; - hv_vhca = kzalloc(sizeof(*hv_vhca), GFP_KERNEL); + hv_vhca = kzalloc_obj(*hv_vhca, GFP_KERNEL); if (!hv_vhca) return ERR_PTR(-ENOMEM); @@ -98,7 +98,7 @@ void mlx5_hv_vhca_invalidate(void *context, u64 block_mask) struct mlx5_hv_vhca *hv_vhca = (struct mlx5_hv_vhca *)context; struct mlx5_hv_vhca_work *work; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return; @@ -152,7 +152,7 @@ mlx5_hv_vhca_control_agent_invalidate(struct mlx5_hv_vhca_agent *agent, u32 capabilities = 0; int err; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return; @@ -273,7 +273,7 @@ mlx5_hv_vhca_agent_create(struct mlx5_hv_vhca *hv_vhca, } mutex_unlock(&hv_vhca->agents_lock); - agent = kzalloc(sizeof(*agent), GFP_KERNEL); + agent = kzalloc_obj(*agent, GFP_KERNEL); if (!agent) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c index d524f0220513..ddde75bd3012 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c @@ -139,7 +139,7 @@ ipsec_fs_roce_rx_rule_setup(struct mlx5_core_dev *mdev, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -242,7 +242,7 @@ static int ipsec_fs_roce_tx_mpv_rule_setup(struct mlx5_core_dev *mdev, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -850,7 +850,7 @@ struct mlx5_ipsec_fs *mlx5_ipsec_fs_roce_init(struct mlx5_core_dev *mdev, return NULL; } - roce_ipsec = kzalloc(sizeof(*roce_ipsec), GFP_KERNEL); + roce_ipsec = kzalloc_obj(*roce_ipsec, GFP_KERNEL); if (!roce_ipsec) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c index e6be2f01daf4..eafd6bcf1675 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c @@ -267,7 +267,7 @@ static int macsec_fs_tx_create_crypto_table_groups(struct mlx5_macsec_flow_table int err; u8 *mc; - ft->g = kcalloc(TX_CRYPTO_TABLE_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, TX_CRYPTO_TABLE_NUM_GROUPS, GFP_KERNEL); if (!ft->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -404,7 +404,7 @@ static int macsec_fs_tx_create(struct mlx5_macsec_fs *macsec_fs) if (!ns) return -ENOMEM; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -713,7 +713,7 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id, rcu_read_unlock(); } - fs_id_iter = kzalloc(sizeof(*fs_id_iter), GFP_KERNEL); + fs_id_iter = kzalloc_obj(*fs_id_iter, GFP_KERNEL); if (!fs_id_iter) return -ENOMEM; @@ -725,7 +725,7 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id, } if (!macsec_device) { /* first time adding a SA to that device */ - macsec_device = kzalloc(sizeof(*macsec_device), GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); if (!macsec_device) { err = -ENOMEM; goto err_alloc_dev; @@ -813,7 +813,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs, tx_tables = &tx_fs->tables; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; @@ -821,7 +821,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs, if (err) goto out_spec; - macsec_rule = kzalloc(sizeof(*macsec_rule), GFP_KERNEL); + macsec_rule = kzalloc_obj(*macsec_rule, GFP_KERNEL); if (!macsec_rule) { macsec_fs_tx_ft_put(macsec_fs); goto out_spec; @@ -931,7 +931,7 @@ static int macsec_fs_tx_init(struct mlx5_macsec_fs *macsec_fs) struct mlx5_fc *flow_counter; int err; - tx_fs = kzalloc(sizeof(*tx_fs), GFP_KERNEL); + tx_fs = kzalloc_obj(*tx_fs, GFP_KERNEL); if (!tx_fs) return -ENOMEM; @@ -1055,7 +1055,7 @@ static int macsec_fs_rx_create_crypto_table_groups(struct mlx5_macsec_flow_table int err; u8 *mc; - ft->g = kcalloc(RX_CRYPTO_TABLE_NUM_GROUPS, sizeof(*ft->g), GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, RX_CRYPTO_TABLE_NUM_GROUPS, GFP_KERNEL); if (!ft->g) return -ENOMEM; @@ -1327,7 +1327,7 @@ static int macsec_fs_rx_roce_jump_to_rdma_rules_create(struct mlx5_macsec_fs *ma struct mlx5_flow_spec *spec; int err; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1510,7 +1510,7 @@ static int macsec_fs_rx_create(struct mlx5_macsec_fs *macsec_fs) if (!ns) return -ENOMEM; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -1739,7 +1739,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; @@ -1747,7 +1747,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs, if (err) goto out_spec; - macsec_rule = kzalloc(sizeof(*macsec_rule), GFP_KERNEL); + macsec_rule = kzalloc_obj(*macsec_rule, GFP_KERNEL); if (!macsec_rule) { macsec_fs_rx_ft_put(macsec_fs); goto out_spec; @@ -1847,7 +1847,7 @@ static int macsec_fs_rx_init(struct mlx5_macsec_fs *macsec_fs) struct mlx5_fc *flow_counter; int err; - rx_fs = kzalloc(sizeof(*rx_fs), GFP_KERNEL); + rx_fs = kzalloc_obj(*rx_fs, GFP_KERNEL); if (!rx_fs) return -ENOMEM; @@ -2132,11 +2132,11 @@ static int mlx5_macsec_fs_add_roce_rule_rx(struct mlx5_macsec_fs *macsec_fs, u32 struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; - rx_rule = kzalloc(sizeof(*rx_rule), GFP_KERNEL); + rx_rule = kzalloc_obj(*rx_rule, GFP_KERNEL); if (!rx_rule) { err = -ENOMEM; goto out; @@ -2201,11 +2201,11 @@ static int mlx5_macsec_fs_add_roce_rule_tx(struct mlx5_macsec_fs *macsec_fs, u32 struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; - tx_rule = kzalloc(sizeof(*tx_rule), GFP_KERNEL); + tx_rule = kzalloc_obj(*tx_rule, GFP_KERNEL); if (!tx_rule) { err = -ENOMEM; goto out; @@ -2361,7 +2361,7 @@ mlx5_macsec_fs_init(struct mlx5_core_dev *mdev) struct mlx5_macsec_fs *macsec_fs; int err; - macsec_fs = kzalloc(sizeof(*macsec_fs), GFP_KERNEL); + macsec_fs = kzalloc_obj(*macsec_fs, GFP_KERNEL); if (!macsec_fs) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c index 4a88a42ae4f7..5352f9b61415 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c @@ -103,7 +103,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) if (!MLX5_ESWITCH_MANAGER(dev) || l2table_size == 1) return 0; - mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL); + mpfs = kzalloc_obj(*mpfs, GFP_KERNEL); if (!mpfs) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h index 9c63838ce1f3..e864e5c430e0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h @@ -72,7 +72,7 @@ struct l2addr_node { int ix = MLX5_L2_ADDR_HASH(mac); \ type *ptr = NULL; \ \ - ptr = kzalloc(sizeof(type), gfp); \ + ptr = kzalloc_obj(type, gfp); \ if (ptr) { \ ether_addr_copy(ptr->node.addr, mac); \ hlist_add_head(&ptr->node.hlist, &(hash)[ix]);\ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c index 8e17daae48af..ca99b4375b66 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c @@ -187,7 +187,7 @@ static int sd_init(struct mlx5_core_dev *dev) return 0; } - sd = kzalloc(sizeof(*sd), GFP_KERNEL); + sd = kzalloc_obj(*sd, GFP_KERNEL); if (!sd) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c index ef06fe6cbb51..2de8a80415f1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c @@ -59,7 +59,7 @@ struct mlx5_st *mlx5_st_create(struct mlx5_core_dev *dev) if (ret) return NULL; - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) goto end; @@ -124,7 +124,7 @@ int mlx5_st_alloc_index(struct mlx5_core_dev *dev, enum tph_mem_type mem_type, } } - idx_data = kzalloc(sizeof(*idx_data), GFP_KERNEL); + idx_data = kzalloc_obj(*idx_data, GFP_KERNEL); if (!idx_data) { ret = -ENOMEM; goto end; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c index e223e0e46433..5c2ebf74b6a5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c @@ -37,7 +37,7 @@ int mlx5_tout_init(struct mlx5_core_dev *dev) { int i; - dev->timeouts = kmalloc(sizeof(*dev->timeouts), GFP_KERNEL); + dev->timeouts = kmalloc_obj(*dev->timeouts, GFP_KERNEL); if (!dev->timeouts) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c index 304912637c35..906d1ce3879f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c @@ -103,7 +103,7 @@ int mlx5_vxlan_add_port(struct mlx5_vxlan *vxlan, u16 port) struct mlx5_vxlan_port *vxlanp; int ret; - vxlanp = kzalloc(sizeof(*vxlanp), GFP_KERNEL); + vxlanp = kzalloc_obj(*vxlanp, GFP_KERNEL); if (!vxlanp) return -ENOMEM; vxlanp->udp_port = port; @@ -151,7 +151,7 @@ struct mlx5_vxlan *mlx5_vxlan_create(struct mlx5_core_dev *mdev) if (!MLX5_CAP_ETH(mdev, tunnel_stateless_vxlan) || !mlx5_core_is_pf(mdev)) return ERR_PTR(-EOPNOTSUPP); - vxlan = kzalloc(sizeof(*vxlan), GFP_KERNEL); + vxlan = kzalloc_obj(*vxlan, GFP_KERNEL); if (!vxlan) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 55b4e0cceae2..a6c838cce13c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1792,7 +1792,7 @@ static int mlx5_hca_caps_alloc(struct mlx5_core_dev *dev) int i; for (i = 0; i < ARRAY_SIZE(types); i++) { - cap = kzalloc(sizeof(*cap), GFP_KERNEL); + cap = kzalloc_obj(*cap, GFP_KERNEL); if (!cap) goto err; type = types[i]; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index cd68c4b2c0bf..91aa78052462 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -107,7 +107,7 @@ static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 fun if (root) return root; - root = kzalloc(sizeof(*root), GFP_KERNEL); + root = kzalloc_obj(*root, GFP_KERNEL); if (!root) return ERR_PTR(-ENOMEM); @@ -148,7 +148,7 @@ static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u return -EEXIST; } - nfp = kzalloc(sizeof(*nfp), GFP_KERNEL); + nfp = kzalloc_obj(*nfp, GFP_KERNEL); if (!nfp) return -ENOMEM; @@ -639,7 +639,7 @@ static int req_pages_handler(struct notifier_block *nb, RELEASE_ALL_PAGES_MASK; mlx5_core_dbg(dev, "page request for func 0x%x, npages %d, release_all %d\n", func_id, npages, release_all); - req = kzalloc(sizeof(*req), GFP_ATOMIC); + req = kzalloc_obj(*req, GFP_ATOMIC); if (!req) { mlx5_core_warn(dev, "failed to allocate pages request\n"); return NOTIFY_DONE; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c index aa3b5878e3da..c23d2c710256 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c @@ -261,7 +261,7 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i, struct mlx5_irq *irq; int err; - irq = kzalloc(sizeof(*irq), GFP_KERNEL); + irq = kzalloc_obj(*irq, GFP_KERNEL); if (!irq || !zalloc_cpumask_var(&irq->mask, GFP_KERNEL)) { kfree(irq); return ERR_PTR(-ENOMEM); @@ -471,7 +471,7 @@ struct mlx5_irq *mlx5_ctrl_irq_request(struct mlx5_core_dev *dev) struct irq_affinity_desc *af_desc; struct mlx5_irq *irq; - af_desc = kvzalloc(sizeof(*af_desc), GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); if (!af_desc) return ERR_PTR(-ENOMEM); @@ -556,7 +556,7 @@ struct mlx5_irq *mlx5_irq_request_vector(struct mlx5_core_dev *dev, u16 cpu, struct irq_affinity_desc *af_desc; struct mlx5_irq *irq; - af_desc = kvzalloc(sizeof(*af_desc), GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); if (!af_desc) return ERR_PTR(-ENOMEM); @@ -578,7 +578,7 @@ static struct mlx5_irq_pool * irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name, u32 min_threshold, u32 max_threshold) { - struct mlx5_irq_pool *pool = kvzalloc(sizeof(*pool), GFP_KERNEL); + struct mlx5_irq_pool *pool = kvzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c index 5c552b71e371..aebb67a7964d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c @@ -41,7 +41,7 @@ static int mlx5_rdma_enable_roce_steering(struct mlx5_core_dev *dev) flow_group_in = kvzalloc(inlen, GFP_KERNEL); if (!flow_group_in) return -ENOMEM; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) { kvfree(flow_group_in); return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rl.c b/drivers/net/ethernet/mellanox/mlx5/core/rl.c index 39a209b9b684..477526f04cd9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/rl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/rl.c @@ -247,8 +247,8 @@ static int mlx5_rl_table_get(struct mlx5_rl_table *table) return 0; } - table->rl_entry = kcalloc(table->max_size, sizeof(struct mlx5_rl_entry), - GFP_KERNEL); + table->rl_entry = kzalloc_objs(struct mlx5_rl_entry, table->max_size, + GFP_KERNEL); if (!table->rl_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c index f310bde3d11f..e41da4da4c4f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c @@ -99,7 +99,7 @@ static void mlx5_sf_dev_add(struct mlx5_core_dev *dev, u16 sf_index, u16 fn_id, goto add_err; } - sf_dev = kzalloc(sizeof(*sf_dev), GFP_KERNEL); + sf_dev = kzalloc_obj(*sf_dev, GFP_KERNEL); if (!sf_dev) { mlx5_adev_idx_free(id); err = -ENOMEM; @@ -280,7 +280,7 @@ static void mlx5_sf_dev_queue_active_works(struct work_struct *_work) continue; sw_func_id = MLX5_GET(query_vhca_state_out, out, vhca_state_context.sw_function_id); - work_ctx = kzalloc(sizeof(*work_ctx), GFP_KERNEL); + work_ctx = kzalloc_obj(*work_ctx, GFP_KERNEL); if (!work_ctx) return; @@ -336,7 +336,7 @@ void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev) if (!mlx5_sf_dev_supported(dev)) return; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) { err = -ENOMEM; goto table_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c index b82323b8449e..894567e905b4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c @@ -70,7 +70,7 @@ mlx5_sf_alloc(struct mlx5_sf_table *table, struct mlx5_eswitch *esw, goto id_err; } - sf = kzalloc(sizeof(*sf), GFP_KERNEL); + sf = kzalloc_obj(*sf, GFP_KERNEL); if (!sf) { err = -ENOMEM; goto alloc_err; @@ -509,7 +509,7 @@ int mlx5_sf_table_init(struct mlx5_core_dev *dev) if (!mlx5_sf_table_supported(dev) || !mlx5_vhca_event_supported(dev)) return 0; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c index bd968f3b3855..b50a50f7d909 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c @@ -233,7 +233,7 @@ static int mlx5_sf_hw_table_hwc_init(struct mlx5_sf_hwc_table *hwc, u16 max_fn, if (!max_fn) return 0; - sfs = kcalloc(max_fn, sizeof(*sfs), GFP_KERNEL); + sfs = kzalloc_objs(*sfs, max_fn, GFP_KERNEL); if (!sfs) return -ENOMEM; @@ -298,7 +298,7 @@ int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev) if (!max_fn && !max_ext_fn) return 0; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) { err = -ENOMEM; goto alloc_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c index b04cf6cf8956..809643870526 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c @@ -114,7 +114,7 @@ mlx5_vhca_state_change_notifier(struct notifier_block *nb, unsigned long type, v struct mlx5_eqe *eqe = data; int wq_idx; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return NOTIFY_DONE; INIT_WORK(&work->work, &mlx5_vhca_state_work_handler); @@ -153,7 +153,7 @@ int mlx5_vhca_event_init(struct mlx5_core_dev *dev) if (!mlx5_vhca_event_supported(dev)) return 0; - events = kzalloc(sizeof(*events), GFP_KERNEL); + events = kzalloc_obj(*events, GFP_KERNEL); if (!events) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index a2fc937d5461..143278b70a64 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -47,7 +47,7 @@ static int sriov_restore_guids(struct mlx5_core_dev *dev, int vf, u16 func_id) if (sriov->vfs_ctx[vf].node_guid || sriov->vfs_ctx[vf].port_guid || sriov->vfs_ctx[vf].policy != MLX5_POLICY_INVALID) { - in = kzalloc(sizeof(*in), GFP_KERNEL); + in = kzalloc_obj(*in, GFP_KERNEL); if (!in) return -ENOMEM; @@ -305,7 +305,7 @@ int mlx5_sriov_init(struct mlx5_core_dev *dev) sriov->max_vfs = mlx5_get_max_vfs(dev); sriov->num_vfs = pci_num_vf(pdev); sriov->max_ec_vfs = mlx5_core_ec_sriov_enabled(dev) ? pci_sriov_get_totalvfs(dev->pdev) : 0; - sriov->vfs_ctx = kcalloc(total_vfs, sizeof(*sriov->vfs_ctx), GFP_KERNEL); + sriov->vfs_ctx = kzalloc_objs(*sriov->vfs_ctx, total_vfs, GFP_KERNEL); if (!sriov->vfs_ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c index fe56b59e24c5..d8a003119be5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c @@ -92,7 +92,7 @@ static int hws_action_get_shared_stc_nic(struct mlx5hws_context *ctx, return 0; } - shared_stc = kzalloc(sizeof(*shared_stc), GFP_KERNEL); + shared_stc = kzalloc_obj(*shared_stc, GFP_KERNEL); if (!shared_stc) { ret = -ENOMEM; goto unlock_and_out; @@ -632,7 +632,7 @@ hws_action_create_generic_bulk(struct mlx5hws_context *ctx, if (!hws_action_validate_hws_action(ctx, flags)) return NULL; - action = kcalloc(bulk_sz, sizeof(*action), GFP_KERNEL); + action = kzalloc_objs(*action, bulk_sz, GFP_KERNEL); if (!action) return NULL; @@ -1383,7 +1383,7 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx, size_t num_dest, return NULL; } - dest_list = kcalloc(num_dest, sizeof(*dest_list), GFP_KERNEL); + dest_list = kzalloc_objs(*dest_list, num_dest, GFP_KERNEL); if (!dest_list) return NULL; @@ -1477,7 +1477,7 @@ mlx5hws_action_create_insert_header(struct mlx5hws_context *ctx, if (!action) return NULL; - reformat_hdrs = kcalloc(num_of_hdrs, sizeof(*reformat_hdrs), GFP_KERNEL); + reformat_hdrs = kzalloc_objs(*reformat_hdrs, num_of_hdrs, GFP_KERNEL); if (!reformat_hdrs) goto free_action; @@ -1557,7 +1557,7 @@ hws_action_create_dest_match_range_definer(struct mlx5hws_context *ctx) __be32 *tag; int ret; - definer = kzalloc(sizeof(*definer), GFP_KERNEL); + definer = kzalloc_obj(*definer, GFP_KERNEL); if (!definer) return NULL; @@ -1600,7 +1600,7 @@ hws_action_create_dest_match_range_table(struct mlx5hws_context *ctx, return NULL; } - table_ste = kzalloc(sizeof(*table_ste), GFP_KERNEL); + table_ste = kzalloc_obj(*table_ste, GFP_KERNEL); if (!table_ste) return NULL; @@ -2019,7 +2019,7 @@ __must_hold(&ctx->ctrl_lock) return 0; } - default_stc = kzalloc(sizeof(*default_stc), GFP_KERNEL); + default_stc = kzalloc_obj(*default_stc, GFP_KERNEL); if (!default_stc) return -ENOMEM; @@ -2621,7 +2621,7 @@ mlx5hws_action_template_create(enum mlx5hws_action_type action_type[]) u8 num_actions = 0; int i; - at = kzalloc(sizeof(*at), GFP_KERNEL); + at = kzalloc_obj(*at, GFP_KERNEL); if (!at) return NULL; @@ -2629,7 +2629,8 @@ mlx5hws_action_template_create(enum mlx5hws_action_type action_type[]) ; at->num_actions = num_actions - 1; - at->action_type_arr = kcalloc(num_actions, sizeof(*action_type), GFP_KERNEL); + at->action_type_arr = kzalloc_objs(*action_type, num_actions, + GFP_KERNEL); if (!at->action_type_arr) goto free_at; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c index 5766a9c82f96..f5ab9f3c694b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c @@ -141,7 +141,7 @@ hws_action_ste_table_alloc(struct mlx5hws_action_ste_pool_element *parent_elem) MLX5HWS_ACTION_STE_TABLE_INIT_LOG_SZ, MLX5HWS_ACTION_STE_TABLE_MAX_LOG_SZ); - action_tbl = kzalloc(sizeof(*action_tbl), GFP_KERNEL); + action_tbl = kzalloc_obj(*action_tbl, GFP_KERNEL); if (!action_tbl) return ERR_PTR(-ENOMEM); @@ -329,7 +329,7 @@ int mlx5hws_action_ste_pool_init(struct mlx5hws_context *ctx) size_t queues = ctx->queues; int i, err; - pool = kcalloc(queues, sizeof(*pool), GFP_KERNEL); + pool = kzalloc_objs(*pool, queues, GFP_KERNEL); if (!pool) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c index b9aef80ba094..147e176b6f9a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c @@ -54,7 +54,7 @@ struct mlx5hws_buddy_mem *mlx5hws_buddy_create(u32 max_order) { struct mlx5hws_buddy_mem *buddy; - buddy = kzalloc(sizeof(*buddy), GFP_KERNEL); + buddy = kzalloc_obj(*buddy, GFP_KERNEL); if (!buddy) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c index 6ef0c4be27e1..6f69b97a8c2b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c @@ -236,7 +236,8 @@ int mlx5hws_bwc_matcher_create_simple(struct mlx5hws_bwc_matcher *bwc_matcher, struct mlx5hws_matcher_attr attr = {0}; int i; - bwc_matcher->rules = kcalloc(bwc_queues, sizeof(*bwc_matcher->rules), GFP_KERNEL); + bwc_matcher->rules = kzalloc_objs(*bwc_matcher->rules, bwc_queues, + GFP_KERNEL); if (!bwc_matcher->rules) goto err; @@ -253,8 +254,9 @@ int mlx5hws_bwc_matcher_create_simple(struct mlx5hws_bwc_matcher *bwc_matcher, bwc_matcher->priority = priority; bwc_matcher->size_of_at_array = MLX5HWS_BWC_MATCHER_ATTACH_AT_NUM; - bwc_matcher->at = kcalloc(bwc_matcher->size_of_at_array, - sizeof(*bwc_matcher->at), GFP_KERNEL); + bwc_matcher->at = kzalloc_objs(*bwc_matcher->at, + bwc_matcher->size_of_at_array, + GFP_KERNEL); if (!bwc_matcher->at) goto free_bwc_matcher_rules; @@ -332,7 +334,7 @@ mlx5hws_bwc_matcher_create(struct mlx5hws_table *table, return NULL; } - bwc_matcher = kzalloc(sizeof(*bwc_matcher), GFP_KERNEL); + bwc_matcher = kzalloc_obj(*bwc_matcher, GFP_KERNEL); if (!bwc_matcher) return NULL; @@ -481,11 +483,11 @@ mlx5hws_bwc_rule_alloc(struct mlx5hws_bwc_matcher *bwc_matcher) { struct mlx5hws_bwc_rule *bwc_rule; - bwc_rule = kzalloc(sizeof(*bwc_rule), GFP_KERNEL); + bwc_rule = kzalloc_obj(*bwc_rule, GFP_KERNEL); if (unlikely(!bwc_rule)) goto out_err; - bwc_rule->rule = kzalloc(sizeof(*bwc_rule->rule), GFP_KERNEL); + bwc_rule->rule = kzalloc_obj(*bwc_rule->rule, GFP_KERNEL); if (unlikely(!bwc_rule->rule)) goto free_rule; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c index f22eaf506d28..25b8ad504acc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c @@ -299,7 +299,7 @@ mlx5hws_cmd_forward_tbl_create(struct mlx5_core_dev *mdev, struct mlx5hws_cmd_forward_tbl *tbl; int ret; - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (!tbl) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c index 428dae869706..6e5b2c1a8b0b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c @@ -192,7 +192,7 @@ struct mlx5hws_context *mlx5hws_context_open(struct mlx5_core_dev *mdev, struct mlx5hws_context *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -201,7 +201,7 @@ struct mlx5hws_context *mlx5hws_context_open(struct mlx5_core_dev *mdev, mutex_init(&ctx->ctrl_lock); xa_init(&ctx->peer_ctx_xa); - ctx->caps = kzalloc(sizeof(*ctx->caps), GFP_KERNEL); + ctx->caps = kzalloc_obj(*ctx->caps, GFP_KERNEL); if (!ctx->caps) goto free_ctx; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c index 82fd122d4284..d5902cfa8146 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c @@ -1688,7 +1688,7 @@ hws_definer_alloc_compressed_fc(struct mlx5hws_definer_fc *fc) u32 fc_sz = 0; int i; - compressed_fc = kcalloc(definer_size, sizeof(*compressed_fc), GFP_KERNEL); + compressed_fc = kzalloc_objs(*compressed_fc, definer_size, GFP_KERNEL); if (!compressed_fc) return NULL; @@ -1731,7 +1731,7 @@ hws_definer_alloc_fc(struct mlx5hws_context *ctx, struct mlx5hws_definer_fc *fc; int i; - fc = kcalloc(len, sizeof(*fc), GFP_KERNEL); + fc = kzalloc_objs(*fc, len, GFP_KERNEL); if (!fc) return NULL; @@ -2139,7 +2139,7 @@ int mlx5hws_definer_init_cache(struct mlx5hws_definer_cache **cache) { struct mlx5hws_definer_cache *new_cache; - new_cache = kzalloc(sizeof(*new_cache), GFP_KERNEL); + new_cache = kzalloc_obj(*new_cache, GFP_KERNEL); if (!new_cache) return -ENOMEM; @@ -2183,7 +2183,7 @@ int mlx5hws_definer_get_obj(struct mlx5hws_context *ctx, if (ret) return -1; - cached_definer = kzalloc(sizeof(*cached_definer), GFP_KERNEL); + cached_definer = kzalloc_obj(*cached_definer, GFP_KERNEL); if (!cached_definer) goto free_definer_obj; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c index 6a4c4cccd643..d684a49900a5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c @@ -478,7 +478,7 @@ mlx5_fs_get_cached_hws_data(struct xarray *cache_xa, unsigned long index) xa_lock(cache_xa); fs_hws_data = xa_load(cache_xa, index); if (!fs_hws_data) { - fs_hws_data = kzalloc(sizeof(*fs_hws_data), GFP_ATOMIC); + fs_hws_data = kzalloc_obj(*fs_hws_data, GFP_ATOMIC); if (!fs_hws_data) { xa_unlock(cache_xa); return NULL; @@ -759,22 +759,22 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns, int num_actions = 0; int err; - *ractions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, sizeof(**ractions), - GFP_KERNEL); + *ractions = kzalloc_objs(**ractions, MLX5_FLOW_CONTEXT_ACTION_MAX, + GFP_KERNEL); if (!*ractions) { err = -ENOMEM; goto out_err; } - fs_actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, - sizeof(*fs_actions), GFP_KERNEL); + fs_actions = kzalloc_objs(*fs_actions, MLX5_FLOW_CONTEXT_ACTION_MAX, + GFP_KERNEL); if (!fs_actions) { err = -ENOMEM; goto free_actions_alloc; } - dest_actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, - sizeof(*dest_actions), GFP_KERNEL); + dest_actions = kzalloc_objs(*dest_actions, MLX5_FLOW_CONTEXT_ACTION_MAX, + GFP_KERNEL); if (!dest_actions) { err = -ENOMEM; goto free_fs_actions_alloc; @@ -1239,7 +1239,7 @@ mlx5_fs_get_pr_encap_pool(struct mlx5_core_dev *dev, struct xarray *pr_pools, if (pr_pool) return pr_pool; - pr_pool = kzalloc(sizeof(*pr_pool), GFP_KERNEL); + pr_pool = kzalloc_obj(*pr_pool, GFP_KERNEL); if (!pr_pool) return ERR_PTR(-ENOMEM); err = mlx5_fs_hws_pr_pool_init(pr_pool, dev, size, reformat_type); @@ -1430,7 +1430,7 @@ mlx5_fs_create_mh_pool(struct mlx5_core_dev *dev, struct mlx5_fs_pool *pool; int err; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); err = mlx5_fs_hws_mh_pool_init(pool, dev, pattern); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c index 5bc8e97ecf1c..d24eb6723b85 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c @@ -117,7 +117,7 @@ mlx5_fs_hws_pr_bulk_create(struct mlx5_core_dev *dev, void *pool_ctx) return NULL; pr_pool_ctx = pool_ctx; bulk_len = MLX5_FS_HWS_DEFAULT_BULK_LEN; - pr_bulk = kvzalloc(struct_size(pr_bulk, prs_data, bulk_len), GFP_KERNEL); + pr_bulk = kvzalloc_flex(*pr_bulk, prs_data, bulk_len, GFP_KERNEL); if (!pr_bulk) return NULL; @@ -186,7 +186,7 @@ int mlx5_fs_hws_pr_pool_init(struct mlx5_fs_pool *pr_pool, reformat_type != MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L2) return -EOPNOTSUPP; - pr_pool_ctx = kzalloc(sizeof(*pr_pool_ctx), GFP_KERNEL); + pr_pool_ctx = kzalloc_obj(*pr_pool_ctx, GFP_KERNEL); if (!pr_pool_ctx) return -ENOMEM; pr_pool_ctx->reformat_type = reformat_type; @@ -273,7 +273,7 @@ mlx5_fs_hws_mh_bulk_create(struct mlx5_core_dev *dev, void *pool_ctx) pattern = pool_ctx; bulk_len = MLX5_FS_HWS_DEFAULT_BULK_LEN; - mh_bulk = kvzalloc(struct_size(mh_bulk, mhs_data, bulk_len), GFP_KERNEL); + mh_bulk = kvzalloc_flex(*mh_bulk, mhs_data, bulk_len, GFP_KERNEL); if (!mh_bulk) return NULL; @@ -331,7 +331,7 @@ int mlx5_fs_hws_mh_pool_init(struct mlx5_fs_pool *fs_hws_mh_pool, { struct mlx5hws_action_mh_pattern *pool_pattern; - pool_pattern = kzalloc(sizeof(*pool_pattern), GFP_KERNEL); + pool_pattern = kzalloc_obj(*pool_pattern, GFP_KERNEL); if (!pool_pattern) return -ENOMEM; pool_pattern->data = kmemdup(pattern->data, pattern->sz, GFP_KERNEL); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c index 32f87fdf3213..c78ae73e5411 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c @@ -912,7 +912,7 @@ hws_matcher_create_col_matcher(struct mlx5hws_matcher *matcher) !hws_matcher_requires_col_tbl(size_tx->rule.num_log)) return 0; - col_matcher = kzalloc(sizeof(*matcher), GFP_KERNEL); + col_matcher = kzalloc_obj(*matcher, GFP_KERNEL); if (!col_matcher) return -ENOMEM; @@ -1084,14 +1084,14 @@ hws_matcher_set_templates(struct mlx5hws_matcher *matcher, return -EOPNOTSUPP; } - matcher->mt = kcalloc(num_of_mt, sizeof(*matcher->mt), GFP_KERNEL); + matcher->mt = kzalloc_objs(*matcher->mt, num_of_mt, GFP_KERNEL); if (!matcher->mt) return -ENOMEM; matcher->size_of_at_array = num_of_at + matcher->attr.max_num_of_at_attach; - matcher->at = kvcalloc(matcher->size_of_at_array, sizeof(*matcher->at), - GFP_KERNEL); + matcher->at = kvzalloc_objs(*matcher->at, matcher->size_of_at_array, + GFP_KERNEL); if (!matcher->at) { mlx5hws_err(ctx, "Failed to allocate action template array\n"); ret = -ENOMEM; @@ -1133,7 +1133,7 @@ mlx5hws_matcher_create(struct mlx5hws_table *tbl, struct mlx5hws_matcher *matcher; int ret; - matcher = kzalloc(sizeof(*matcher), GFP_KERNEL); + matcher = kzalloc_obj(*matcher, GFP_KERNEL); if (!matcher) return NULL; @@ -1179,7 +1179,7 @@ mlx5hws_match_template_create(struct mlx5hws_context *ctx, { struct mlx5hws_match_template *mt; - mt = kzalloc(sizeof(*mt), GFP_KERNEL); + mt = kzalloc_obj(*mt, GFP_KERNEL); if (!mt) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c index d56271a9e4f0..49c8f3c872d9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c @@ -78,7 +78,7 @@ int mlx5hws_pat_init_pattern_cache(struct mlx5hws_pattern_cache **cache) { struct mlx5hws_pattern_cache *new_cache; - new_cache = kzalloc(sizeof(*new_cache), GFP_KERNEL); + new_cache = kzalloc_obj(*new_cache, GFP_KERNEL); if (!new_cache) return -ENOMEM; @@ -168,7 +168,7 @@ mlx5hws_pat_add_pattern_to_cache(struct mlx5hws_pattern_cache *cache, { struct mlx5hws_pattern_cache_item *cached_pattern; - cached_pattern = kzalloc(sizeof(*cached_pattern), GFP_KERNEL); + cached_pattern = kzalloc_obj(*cached_pattern, GFP_KERNEL); if (!cached_pattern) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c index 7b5071c3df36..4b6642642346 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c @@ -41,7 +41,7 @@ hws_pool_create_one_resource(struct mlx5hws_pool *pool, u32 log_range, u32 obj_id = 0; int ret; - resource = kzalloc(sizeof(*resource), GFP_KERNEL); + resource = kzalloc_obj(*resource, GFP_KERNEL); if (!resource) return NULL; @@ -347,7 +347,7 @@ mlx5hws_pool_create(struct mlx5hws_context *ctx, struct mlx5hws_pool_attr *pool_ enum mlx5hws_db_type res_db_type; struct mlx5hws_pool *pool; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c index a94f094e72ba..3c966476479d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c @@ -136,7 +136,7 @@ hws_rule_save_resize_info(struct mlx5hws_rule *rule, /* resize_info might already exist (if we're in update flow) */ if (likely(!rule->resize_info)) { - rule->resize_info = kzalloc(sizeof(*rule->resize_info), GFP_KERNEL); + rule->resize_info = kzalloc_obj(*rule->resize_info, GFP_KERNEL); if (unlikely(!rule->resize_info)) { pr_warn("HWS: resize info isn't allocated for rule\n"); return; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c index 7510c46e58a5..4fef376d63a2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c @@ -701,7 +701,7 @@ static int hws_send_ring_alloc_sq(struct mlx5_core_dev *mdev, wq->db = &wq->db[MLX5_SND_DBR]; buf_sz = queue->num_entries * MAX_WQES_PER_RULE; - sq->dep_wqe = kcalloc(queue->num_entries, sizeof(*sq->dep_wqe), GFP_KERNEL); + sq->dep_wqe = kzalloc_objs(*sq->dep_wqe, queue->num_entries, GFP_KERNEL); if (!sq->dep_wqe) { err = -ENOMEM; goto destroy_wq_cyc; @@ -1033,9 +1033,8 @@ static int mlx5hws_send_queue_open(struct mlx5hws_context *ctx, queue->num_entries = roundup_pow_of_two(queue_size); queue->used_entries = 0; - queue->completed.entries = kcalloc(queue->num_entries, - sizeof(queue->completed.entries[0]), - GFP_KERNEL); + queue->completed.entries = kzalloc_objs(queue->completed.entries[0], + queue->num_entries, GFP_KERNEL); if (!queue->completed.entries) return -ENOMEM; @@ -1094,16 +1093,14 @@ static int hws_bwc_send_queues_init(struct mlx5hws_context *ctx) ctx->queues += bwc_queues; - ctx->bwc_send_queue_locks = kcalloc(bwc_queues, - sizeof(*ctx->bwc_send_queue_locks), - GFP_KERNEL); + ctx->bwc_send_queue_locks = kzalloc_objs(*ctx->bwc_send_queue_locks, + bwc_queues, GFP_KERNEL); if (!ctx->bwc_send_queue_locks) return -ENOMEM; - ctx->bwc_lock_class_keys = kcalloc(bwc_queues, - sizeof(*ctx->bwc_lock_class_keys), - GFP_KERNEL); + ctx->bwc_lock_class_keys = kzalloc_objs(*ctx->bwc_lock_class_keys, + bwc_queues, GFP_KERNEL); if (!ctx->bwc_lock_class_keys) goto err_lock_class_keys; @@ -1135,7 +1132,8 @@ int mlx5hws_send_queues_open(struct mlx5hws_context *ctx, if (err) return err; - ctx->send_queue = kcalloc(ctx->queues, sizeof(*ctx->send_queue), GFP_KERNEL); + ctx->send_queue = kzalloc_objs(*ctx->send_queue, ctx->queues, + GFP_KERNEL); if (!ctx->send_queue) { err = -ENOMEM; goto free_bwc_locks; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c index 6113383ae47b..2bf42f5df285 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c @@ -238,7 +238,7 @@ struct mlx5hws_table *mlx5hws_table_create(struct mlx5hws_context *ctx, return NULL; } - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (!tbl) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c index 2ebb61ef3ea9..9889149569fe 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c @@ -1194,14 +1194,14 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, return NULL; } - hw_dests = kcalloc(num_of_dests, sizeof(*hw_dests), GFP_KERNEL); + hw_dests = kzalloc_objs(*hw_dests, num_of_dests, GFP_KERNEL); if (!hw_dests) return NULL; if (unlikely(check_mul_overflow(num_of_dests, 2u, &ref_act_cnt))) goto free_hw_dests; - ref_actions = kcalloc(ref_act_cnt, sizeof(*ref_actions), GFP_KERNEL); + ref_actions = kzalloc_objs(*ref_actions, ref_act_cnt, GFP_KERNEL); if (!ref_actions) goto free_hw_dests; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c index 01ed6442095d..b276f9e966bc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c @@ -68,7 +68,7 @@ static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool) } for (i = 0; i < num_of_objects; i++) { - arg_obj = kzalloc(sizeof(*arg_obj), GFP_KERNEL); + arg_obj = kzalloc_obj(*arg_obj, GFP_KERNEL); if (!arg_obj) { ret = -ENOMEM; goto clean_arg_obj; @@ -132,7 +132,7 @@ static struct dr_arg_pool *dr_arg_pool_create(struct mlx5dr_domain *dmn, { struct dr_arg_pool *pool; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -235,7 +235,7 @@ mlx5dr_arg_mgr_create(struct mlx5dr_domain *dmn) if (!mlx5dr_domain_is_support_ptrn_arg(dmn)) return NULL; - pool_mgr = kzalloc(sizeof(*pool_mgr), GFP_KERNEL); + pool_mgr = kzalloc_obj(*pool_mgr, GFP_KERNEL); if (!pool_mgr) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c index fe228d948b47..3af4218381a1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c @@ -16,12 +16,10 @@ int mlx5dr_buddy_init(struct mlx5dr_icm_buddy_mem *buddy, INIT_LIST_HEAD(&buddy->list_node); - buddy->bitmap = kcalloc(buddy->max_order + 1, - sizeof(*buddy->bitmap), - GFP_KERNEL); - buddy->num_free = kcalloc(buddy->max_order + 1, - sizeof(*buddy->num_free), - GFP_KERNEL); + buddy->bitmap = kzalloc_objs(*buddy->bitmap, buddy->max_order + 1, + GFP_KERNEL); + buddy->num_free = kzalloc_objs(*buddy->num_free, buddy->max_order + 1, + GFP_KERNEL); if (!buddy->bitmap || !buddy->num_free) goto err_free_all; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c index 8803fa071c50..c8904955ec54 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c @@ -60,7 +60,7 @@ mlx5dr_dbg_dump_data_init_new_buff(struct mlx5dr_dbg_dump_data *dump_data) { struct mlx5dr_dbg_dump_buff *new_buff; - new_buff = kzalloc(sizeof(*new_buff), GFP_KERNEL); + new_buff = kzalloc_obj(*new_buff, GFP_KERNEL); if (!new_buff) return NULL; @@ -81,7 +81,7 @@ mlx5dr_dbg_create_dump_data(void) { struct mlx5dr_dbg_dump_data *dump_data; - dump_data = kzalloc(sizeof(*dump_data), GFP_KERNEL); + dump_data = kzalloc_obj(*dump_data, GFP_KERNEL); if (!dump_data) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c index d5ea97751945..282088205d4c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c @@ -60,7 +60,7 @@ dr_definer_create_obj(struct mlx5dr_domain *dmn, u16 format_id, struct dr_definer_object *definer_obj; int ret = 0; - definer_obj = kzalloc(sizeof(*definer_obj), GFP_KERNEL); + definer_obj = kzalloc_obj(*definer_obj, GFP_KERNEL); if (!definer_obj) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c index e8c67ed9f748..5c0a8dc6cff0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c @@ -282,7 +282,7 @@ dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport) struct mlx5dr_cmd_vport_cap *vport_caps; int ret; - vport_caps = kvzalloc(sizeof(*vport_caps), GFP_KERNEL); + vport_caps = kvzalloc_obj(*vport_caps, GFP_KERNEL); if (!vport_caps) return NULL; @@ -467,7 +467,7 @@ mlx5dr_domain_create(struct mlx5_core_dev *mdev, enum mlx5dr_domain_type type) if (type > MLX5DR_DOMAIN_TYPE_FDB) return NULL; - dmn = kzalloc(sizeof(*dmn), GFP_KERNEL); + dmn = kzalloc_obj(*dmn, GFP_KERNEL); if (!dmn) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c index f05ef0cd54ba..df34beefda11 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c @@ -13,7 +13,7 @@ mlx5dr_fw_create_recalc_cs_ft(struct mlx5dr_domain *dmn, u16 vport_num) u64 rx_icm_addr, modify_ttl_action; int ret; - recalc_cs_ft = kzalloc(sizeof(*recalc_cs_ft), GFP_KERNEL); + recalc_cs_ft = kzalloc_obj(*recalc_cs_ft, GFP_KERNEL); if (!recalc_cs_ft) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c index 0b5af9f3f605..79f0adecc2aa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c @@ -116,7 +116,7 @@ dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool) size_t log_align_base = 0; int err; - icm_mr = kvzalloc(sizeof(*icm_mr), GFP_KERNEL); + icm_mr = kvzalloc_obj(*icm_mr, GFP_KERNEL); if (!icm_mr) return NULL; @@ -227,8 +227,8 @@ static int dr_icm_buddy_init_ste_cache(struct mlx5dr_icm_buddy_mem *buddy) int num_of_entries = mlx5dr_icm_pool_chunk_size_to_entries(buddy->pool->max_log_chunk_sz); - buddy->ste_arr = kvcalloc(num_of_entries, - sizeof(struct mlx5dr_ste), GFP_KERNEL); + buddy->ste_arr = kvzalloc_objs(struct mlx5dr_ste, num_of_entries, + GFP_KERNEL); if (!buddy->ste_arr) return -ENOMEM; @@ -269,7 +269,7 @@ static int dr_icm_buddy_create(struct mlx5dr_icm_pool *pool) if (!icm_mr) return -ENOMEM; - buddy = kvzalloc(sizeof(*buddy), GFP_KERNEL); + buddy = kvzalloc_obj(*buddy, GFP_KERNEL); if (!buddy) goto free_mr; @@ -509,7 +509,7 @@ struct mlx5dr_icm_pool *mlx5dr_icm_pool_create(struct mlx5dr_domain *dmn, struct mlx5dr_icm_pool *pool; u32 max_hot_size = 0; - pool = kvzalloc(sizeof(*pool), GFP_KERNEL); + pool = kvzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -548,9 +548,8 @@ struct mlx5dr_icm_pool *mlx5dr_icm_pool_create(struct mlx5dr_domain *dmn, num_of_chunks = DIV_ROUND_UP(max_hot_size, entry_size) + 1; pool->th = max_hot_size; - pool->hot_chunks_arr = kvcalloc(num_of_chunks, - sizeof(struct mlx5dr_icm_hot_chunk), - GFP_KERNEL); + pool->hot_chunks_arr = kvzalloc_objs(struct mlx5dr_icm_hot_chunk, + num_of_chunks, GFP_KERNEL); if (!pool->hot_chunks_arr) goto free_pool; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c index 0726848eb3ff..b171fdb5a622 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c @@ -996,7 +996,7 @@ mlx5dr_matcher_create(struct mlx5dr_table *tbl, refcount_inc(&tbl->refcount); - matcher = kzalloc(sizeof(*matcher), GFP_KERNEL); + matcher = kzalloc_obj(*matcher, GFP_KERNEL); if (!matcher) goto dec_ref; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c index 8ca534ef5d03..094a6bea9a8a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c @@ -94,7 +94,7 @@ dr_ptrn_alloc_pattern(struct mlx5dr_ptrn_mgr *mgr, mgr->dmn->info.caps.hdr_modify_pattern_icm_addr) / DR_ACTION_CACHE_LINE_SIZE; - pattern = kzalloc(sizeof(*pattern), GFP_KERNEL); + pattern = kzalloc_obj(*pattern, GFP_KERNEL); if (!pattern) goto free_chunk; @@ -201,7 +201,7 @@ struct mlx5dr_ptrn_mgr *mlx5dr_ptrn_mgr_create(struct mlx5dr_domain *dmn) if (!mlx5dr_domain_is_support_ptrn_arg(dmn)) return NULL; - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (!mgr) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c index d1db04baa1fa..8d925c3e2b11 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c @@ -593,7 +593,7 @@ static int dr_rule_add_action_members(struct mlx5dr_rule *rule, int i; for (i = 0; i < num_actions; i++) { - action_mem = kvzalloc(sizeof(*action_mem), GFP_KERNEL); + action_mem = kvzalloc_obj(*action_mem, GFP_KERNEL); if (!action_mem) goto free_action_members; @@ -1298,7 +1298,7 @@ dr_rule_create_rule(struct mlx5dr_matcher *matcher, if (!dr_rule_verify(matcher, value, ¶m)) return NULL; - rule = kzalloc(sizeof(*rule), GFP_KERNEL); + rule = kzalloc_obj(*rule, GFP_KERNEL); if (!rule) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c index d034372fa047..78d7c83a98b0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c @@ -72,7 +72,7 @@ static int dr_send_info_pool_fill(struct mlx5dr_send_info_pool *pool) int i; for (i = 0; i < DR_SEND_INFO_POOL_SIZE; i++) { - pool_obj = kzalloc(sizeof(*pool_obj), GFP_KERNEL); + pool_obj = kzalloc_obj(*pool_obj, GFP_KERNEL); if (!pool_obj) goto clean_pool; @@ -114,7 +114,7 @@ static struct mlx5dr_send_info_pool *dr_send_info_pool_create(void) struct mlx5dr_send_info_pool *pool; int ret; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -258,7 +258,7 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev, void *in; int err; - dr_qp = kzalloc(sizeof(*dr_qp), GFP_KERNEL); + dr_qp = kzalloc_obj(*dr_qp, GFP_KERNEL); if (!dr_qp) return NULL; @@ -1063,7 +1063,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, __be64 *pas; u32 i; - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) return NULL; @@ -1158,7 +1158,7 @@ static int dr_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, u32 *mkey) static struct mlx5dr_mr *dr_reg_mr(struct mlx5_core_dev *mdev, u32 pdn, void *buf, size_t size) { - struct mlx5dr_mr *mr = kzalloc(sizeof(*mr), GFP_KERNEL); + struct mlx5dr_mr *mr = kzalloc_obj(*mr, GFP_KERNEL); struct device *dma_device; dma_addr_t dma_addr; int err; @@ -1207,7 +1207,7 @@ int mlx5dr_send_ring_alloc(struct mlx5dr_domain *dmn) int size; int ret; - dmn->send_ring = kzalloc(sizeof(*dmn->send_ring), GFP_KERNEL); + dmn->send_ring = kzalloc_obj(*dmn->send_ring, GFP_KERNEL); if (!dmn->send_ring) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c index 69294a66fd7f..ab4c360c64e0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c @@ -255,7 +255,7 @@ struct mlx5dr_table *mlx5dr_table_create(struct mlx5dr_domain *dmn, u32 level, refcount_inc(&dmn->refcount); - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (!tbl) goto dec_ref; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c index f367997ab61e..4d29c6347902 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c @@ -275,22 +275,22 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, if (mlx5_fs_cmd_is_fw_term_table(ft)) return mlx5_fs_cmd_get_fw_cmds()->create_fte(ns, ft, group, fte); - actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, sizeof(*actions), - GFP_KERNEL); + actions = kzalloc_objs(*actions, MLX5_FLOW_CONTEXT_ACTION_MAX, + GFP_KERNEL); if (!actions) { err = -ENOMEM; goto out_err; } - fs_dr_actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, - sizeof(*fs_dr_actions), GFP_KERNEL); + fs_dr_actions = kzalloc_objs(*fs_dr_actions, + MLX5_FLOW_CONTEXT_ACTION_MAX, GFP_KERNEL); if (!fs_dr_actions) { err = -ENOMEM; goto free_actions_alloc; } - term_actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, - sizeof(*term_actions), GFP_KERNEL); + term_actions = kzalloc_objs(*term_actions, MLX5_FLOW_CONTEXT_ACTION_MAX, + GFP_KERNEL); if (!term_actions) { err = -ENOMEM; goto free_fs_dr_actions_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c index cb098d3eb2fa..3b41a507ea05 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c @@ -832,7 +832,7 @@ int mlx5_query_hca_vport_system_image_guid(struct mlx5_core_dev *dev, struct mlx5_hca_vport_context *rep; int err; - rep = kvzalloc(sizeof(*rep), GFP_KERNEL); + rep = kvzalloc_obj(*rep, GFP_KERNEL); if (!rep) return -ENOMEM; @@ -851,7 +851,7 @@ int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev, struct mlx5_hca_vport_context *rep; int err; - rep = kvzalloc(sizeof(*rep), GFP_KERNEL); + rep = kvzalloc_obj(*rep, GFP_KERNEL); if (!rep) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wc.c b/drivers/net/ethernet/mellanox/mlx5/core/wc.c index 04d03be1bb77..aa989841f375 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/wc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/wc.c @@ -366,7 +366,7 @@ static void mlx5_core_test_wc(struct mlx5_core_dev *mdev) if (mdev->wc_state != MLX5_WC_STATE_UNINITIALIZED) return; - sq = kzalloc(sizeof(*sq), GFP_KERNEL); + sq = kzalloc_obj(*sq, GFP_KERNEL); if (!sq) return; diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c index e6f677e42007..b2335f56b481 100644 --- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c +++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c @@ -267,7 +267,7 @@ struct mlxfw_mfa2_file *mlxfw_mfa2_file_init(const struct firmware *fw) const void *first_tlv_ptr; const void *cb_top_ptr; - mfa2_file = kzalloc(sizeof(*mfa2_file), GFP_KERNEL); + mfa2_file = kzalloc_obj(*mfa2_file, GFP_KERNEL); if (!mfa2_file) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 83c7cf3bbea3..6d2353324eda 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -150,8 +150,8 @@ static int mlxsw_ports_init(struct mlxsw_core *mlxsw_core, bool reload) else mlxsw_core->max_ports = MLXSW_PORT_MAX_PORTS_DEFAULT + 1; - mlxsw_core->ports = kcalloc(mlxsw_core->max_ports, - sizeof(struct mlxsw_core_port), GFP_KERNEL); + mlxsw_core->ports = kzalloc_objs(struct mlxsw_core_port, + mlxsw_core->max_ports, GFP_KERNEL); if (!mlxsw_core->ports) return -ENOMEM; @@ -1793,7 +1793,7 @@ static void mlxsw_core_health_listener_func(const struct mlxsw_reg_info *reg, struct mlxsw_core_health_event *event; struct mlxsw_core *mlxsw_core = priv; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; event->mlxsw_core = mlxsw_core; @@ -2376,7 +2376,7 @@ int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core, rxl_item = __find_rx_listener_item(mlxsw_core, rxl); if (rxl_item) return -EEXIST; - rxl_item = kmalloc(sizeof(*rxl_item), GFP_KERNEL); + rxl_item = kmalloc_obj(*rxl_item, GFP_KERNEL); if (!rxl_item) return -ENOMEM; rxl_item->rxl = *rxl; @@ -2475,7 +2475,7 @@ int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core, el_item = __find_event_listener_item(mlxsw_core, el); if (el_item) return -EEXIST; - el_item = kmalloc(sizeof(*el_item), GFP_KERNEL); + el_item = kmalloc_obj(*el_item, GFP_KERNEL); if (!el_item) return -ENOMEM; el_item->mlxsw_core = mlxsw_core; @@ -2684,7 +2684,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core, struct mlxsw_reg_trans *trans; int err; - trans = kzalloc(sizeof(*trans), GFP_KERNEL); + trans = kzalloc_obj(*trans, GFP_KERNEL); if (!trans) return -ENOMEM; @@ -2785,7 +2785,7 @@ int mlxsw_core_irq_event_handler_register(struct mlxsw_core *mlxsw_core, { struct mlxsw_core_irq_event_handler_item *item; - item = kzalloc(sizeof(*item), GFP_KERNEL); + item = kzalloc_obj(*item, GFP_KERNEL); if (!item) return -ENOMEM; item->cb = cb; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c index 1915fa41c622..08168f95987a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c @@ -201,7 +201,7 @@ struct mlxsw_afa *mlxsw_afa_create(unsigned int max_acts_per_set, struct mlxsw_afa *mlxsw_afa; int err; - mlxsw_afa = kzalloc(sizeof(*mlxsw_afa), GFP_KERNEL); + mlxsw_afa = kzalloc_obj(*mlxsw_afa, GFP_KERNEL); if (!mlxsw_afa) return ERR_PTR(-ENOMEM); err = rhashtable_init(&mlxsw_afa->set_ht, &mlxsw_afa_set_ht_params); @@ -276,7 +276,7 @@ static struct mlxsw_afa_set *mlxsw_afa_set_create(bool is_first) { struct mlxsw_afa_set *set; - set = kzalloc(sizeof(*set), GFP_KERNEL); + set = kzalloc_obj(*set, GFP_KERNEL); if (!set) return NULL; /* Need to initialize the set to pass by default */ @@ -406,7 +406,7 @@ struct mlxsw_afa_block *mlxsw_afa_block_create(struct mlxsw_afa *mlxsw_afa) { struct mlxsw_afa_block *block; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&block->resource_list); @@ -560,7 +560,7 @@ mlxsw_afa_fwd_entry_create(struct mlxsw_afa *mlxsw_afa, u16 local_port) struct mlxsw_afa_fwd_entry *fwd_entry; int err; - fwd_entry = kzalloc(sizeof(*fwd_entry), GFP_KERNEL); + fwd_entry = kzalloc_obj(*fwd_entry, GFP_KERNEL); if (!fwd_entry) return ERR_PTR(-ENOMEM); fwd_entry->ht_key.local_port = local_port; @@ -653,7 +653,7 @@ mlxsw_afa_fwd_entry_ref_create(struct mlxsw_afa_block *block, u16 local_port) struct mlxsw_afa_fwd_entry *fwd_entry; int err; - fwd_entry_ref = kzalloc(sizeof(*fwd_entry_ref), GFP_KERNEL); + fwd_entry_ref = kzalloc_obj(*fwd_entry_ref, GFP_KERNEL); if (!fwd_entry_ref) return ERR_PTR(-ENOMEM); fwd_entry = mlxsw_afa_fwd_entry_get(block->afa, local_port); @@ -702,7 +702,7 @@ mlxsw_afa_counter_create(struct mlxsw_afa_block *block) struct mlxsw_afa_counter *counter; int err; - counter = kzalloc(sizeof(*counter), GFP_KERNEL); + counter = kzalloc_obj(*counter, GFP_KERNEL); if (!counter) return ERR_PTR(-ENOMEM); @@ -847,7 +847,7 @@ mlxsw_afa_cookie_ref_create(struct mlxsw_afa_block *block, struct mlxsw_afa_cookie *cookie; int err; - cookie_ref = kzalloc(sizeof(*cookie_ref), GFP_KERNEL); + cookie_ref = kzalloc_obj(*cookie_ref, GFP_KERNEL); if (!cookie_ref) return ERR_PTR(-ENOMEM); cookie = mlxsw_afa_cookie_get(block->afa, fa_cookie); @@ -873,7 +873,7 @@ mlxsw_afa_policer_create(struct mlxsw_afa *mlxsw_afa, u32 fa_index, struct mlxsw_afa_policer *policer; int err; - policer = kzalloc(sizeof(*policer), GFP_KERNEL); + policer = kzalloc_obj(*policer, GFP_KERNEL); if (!policer) return ERR_PTR(-ENOMEM); @@ -974,7 +974,7 @@ mlxsw_afa_policer_ref_create(struct mlxsw_afa_block *block, u32 fa_index, struct mlxsw_afa_policer *policer; int err; - policer_ref = kzalloc(sizeof(*policer_ref), GFP_KERNEL); + policer_ref = kzalloc_obj(*policer_ref, GFP_KERNEL); if (!policer_ref) return ERR_PTR(-ENOMEM); @@ -1386,7 +1386,7 @@ mlxsw_afa_mirror_create(struct mlxsw_afa_block *block, u16 local_in_port, struct mlxsw_afa_mirror *mirror; int err; - mirror = kzalloc(sizeof(*mirror), GFP_KERNEL); + mirror = kzalloc_obj(*mirror, GFP_KERNEL); if (!mirror) return ERR_PTR(-ENOMEM); @@ -2187,7 +2187,7 @@ mlxsw_afa_sampler_create(struct mlxsw_afa_block *block, u16 local_port, struct mlxsw_afa_sampler *sampler; int err; - sampler = kzalloc(sizeof(*sampler), GFP_KERNEL); + sampler = kzalloc_obj(*sampler, GFP_KERNEL); if (!sampler) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c index 7aa1a462a103..030eefcd3eda 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c @@ -86,7 +86,7 @@ struct mlxsw_afk *mlxsw_afk_create(unsigned int max_blocks, { struct mlxsw_afk *mlxsw_afk; - mlxsw_afk = kzalloc(sizeof(*mlxsw_afk), GFP_KERNEL); + mlxsw_afk = kzalloc_obj(*mlxsw_afk, GFP_KERNEL); if (!mlxsw_afk) return NULL; INIT_LIST_HEAD(&mlxsw_afk->key_info_list); @@ -262,7 +262,7 @@ static int mlxsw_afk_picker(struct mlxsw_afk *mlxsw_afk, enum mlxsw_afk_element element; int err; - picker = kcalloc(mlxsw_afk->blocks_count, sizeof(*picker), GFP_KERNEL); + picker = kzalloc_objs(*picker, mlxsw_afk->blocks_count, GFP_KERNEL); if (!picker) return -ENOMEM; @@ -327,8 +327,8 @@ mlxsw_afk_key_info_create(struct mlxsw_afk *mlxsw_afk, struct mlxsw_afk_key_info *key_info; int err; - key_info = kzalloc(struct_size(key_info, blocks, mlxsw_afk->max_blocks), - GFP_KERNEL); + key_info = kzalloc_flex(*key_info, blocks, mlxsw_afk->max_blocks, + GFP_KERNEL); if (!key_info) return ERR_PTR(-ENOMEM); err = mlxsw_afk_picker(mlxsw_afk, key_info, elusage); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c index 294e758f1067..3b6b17c48a18 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -986,7 +986,7 @@ mlxsw_env_mtwe_listener_func(const struct mlxsw_reg_info *reg, char *mtwe_pl, struct mlxsw_env_module_temp_warn_event *event; struct mlxsw_env *mlxsw_env = priv; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; @@ -1080,7 +1080,7 @@ mlxsw_env_pmpe_listener_func(const struct mlxsw_reg_info *reg, char *pmpe_pl, if (module_status != MLXSW_REG_PMPE_MODULE_STATUS_PLUGGED_ENABLED) return; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; @@ -1243,10 +1243,10 @@ static int mlxsw_env_line_cards_alloc(struct mlxsw_env *env) int i, j; for (i = 0; i < env->num_of_slots; i++) { - env->line_cards[i] = kzalloc(struct_size(env->line_cards[i], - module_info, - env->max_module_count), - GFP_KERNEL); + env->line_cards[i] = kzalloc_flex(*env->line_cards[i], + module_info, + env->max_module_count, + GFP_KERNEL); if (!env->line_cards[i]) goto kzalloc_err; @@ -1453,8 +1453,7 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, mlxsw_reg_mgpir_max_modules_per_slot_get(mgpir_pl) : module_count; - env = kzalloc(struct_size(env, line_cards, num_of_slots + 1), - GFP_KERNEL); + env = kzalloc_flex(*env, line_cards, num_of_slots + 1, GFP_KERNEL); if (!env) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c index 9c12e1feb643..e7081614f597 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c @@ -871,8 +871,8 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, NULL, &num_of_slots); - mlxsw_hwmon = kzalloc(struct_size(mlxsw_hwmon, line_cards, - num_of_slots + 1), GFP_KERNEL); + mlxsw_hwmon = kzalloc_flex(*mlxsw_hwmon, line_cards, num_of_slots + 1, + GFP_KERNEL); if (!mlxsw_hwmon) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c index e8d6fe35bf36..a689c79122cf 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c @@ -57,7 +57,7 @@ int mlxsw_linecard_bdev_add(struct mlxsw_linecard *linecard) if (id < 0) return id; - linecard_bdev = kzalloc(sizeof(*linecard_bdev), GFP_KERNEL); + linecard_bdev = kzalloc_obj(*linecard_bdev, GFP_KERNEL); if (!linecard_bdev) { mlxsw_linecard_bdev_id_free(id); return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c index 10f5bc4892fc..ef13fee48b1a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c @@ -531,7 +531,7 @@ int mlxsw_linecards_event_ops_register(struct mlxsw_core *mlxsw_core, if (!linecards) return 0; - item = kzalloc(sizeof(*item), GFP_KERNEL); + item = kzalloc_obj(*item, GFP_KERNEL); if (!item) return -ENOMEM; item->event_ops = ops; @@ -1192,7 +1192,7 @@ mlxsw_linecard_status_listener_func(const struct mlxsw_reg_info *reg, struct mlxsw_linecard_status_event *event; struct mlxsw_core *mlxsw_core = priv; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; event->mlxsw_core = mlxsw_core; @@ -1225,7 +1225,7 @@ mlxsw_linecard_bct_listener_func(const struct mlxsw_reg_info *reg, struct mlxsw_linecard_bct_event *event; struct mlxsw_core *mlxsw_core = priv; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; event->mlxsw_core = mlxsw_core; @@ -1446,7 +1446,7 @@ static int mlxsw_linecard_types_init(struct mlxsw_core *mlxsw_core, return 0; } - types_info = kzalloc(sizeof(*types_info), GFP_KERNEL); + types_info = kzalloc_obj(*types_info, GFP_KERNEL); if (!types_info) { release_firmware(firmware); return -ENOMEM; @@ -1469,9 +1469,8 @@ static int mlxsw_linecard_types_init(struct mlxsw_core *mlxsw_core, goto err_type_file_file_validate; } - types_info->ini_files = kmalloc_array(types_info->count, - sizeof(struct mlxsw_linecard_ini_file *), - GFP_KERNEL); + types_info->ini_files = kmalloc_objs(struct mlxsw_linecard_ini_file *, + types_info->count, GFP_KERNEL); if (!types_info->ini_files) { err = -ENOMEM; goto err_ini_files_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index eac9a14a6058..4c9b04ca5154 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -431,9 +431,8 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, if (!area->tz_module_num) return 0; - area->tz_module_arr = kcalloc(area->tz_module_num, - sizeof(*area->tz_module_arr), - GFP_KERNEL); + area->tz_module_arr = kzalloc_objs(*area->tz_module_arr, + area->tz_module_num, GFP_KERNEL); if (!area->tz_module_arr) return -ENOMEM; @@ -522,9 +521,8 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, return 0; area->tz_gearbox_num = gbox_num; - area->tz_gearbox_arr = kcalloc(area->tz_gearbox_num, - sizeof(*area->tz_gearbox_arr), - GFP_KERNEL); + area->tz_gearbox_arr = kzalloc_objs(*area->tz_gearbox_arr, + area->tz_gearbox_num, GFP_KERNEL); if (!area->tz_gearbox_arr) return -ENOMEM; @@ -644,8 +642,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, NULL, &num_of_slots); - thermal = kzalloc(struct_size(thermal, line_cards, num_of_slots + 1), - GFP_KERNEL); + thermal = kzalloc_flex(*thermal, line_cards, num_of_slots + 1, + GFP_KERNEL); if (!thermal) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 828c65036a4c..9871b9e1d094 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -398,14 +398,12 @@ static int mlxsw_m_linecards_init(struct mlxsw_m *mlxsw_m) /* Add slot for main board. */ mlxsw_m->num_of_slots += 1; - mlxsw_m->ports = kcalloc(max_ports, sizeof(*mlxsw_m->ports), - GFP_KERNEL); + mlxsw_m->ports = kzalloc_objs(*mlxsw_m->ports, max_ports, GFP_KERNEL); if (!mlxsw_m->ports) return -ENOMEM; - mlxsw_m->line_cards = kcalloc(mlxsw_m->num_of_slots, - sizeof(*mlxsw_m->line_cards), - GFP_KERNEL); + mlxsw_m->line_cards = kzalloc_objs(*mlxsw_m->line_cards, + mlxsw_m->num_of_slots, GFP_KERNEL); if (!mlxsw_m->line_cards) { err = -ENOMEM; goto err_kcalloc; @@ -413,10 +411,8 @@ static int mlxsw_m_linecards_init(struct mlxsw_m *mlxsw_m) for (i = 0; i < mlxsw_m->num_of_slots; i++) { mlxsw_m->line_cards[i] = - kzalloc(struct_size(mlxsw_m->line_cards[i], - module_to_port, - mlxsw_m->max_modules_per_slot), - GFP_KERNEL); + kzalloc_flex(*mlxsw_m->line_cards[i], module_to_port, + mlxsw_m->max_modules_per_slot, GFP_KERNEL); if (!mlxsw_m->line_cards[i]) { err = -ENOMEM; goto err_kmalloc_array; diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 7da9ef254b72..9b378e9d084d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -1264,7 +1264,7 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, if (!mem_item->buf) return -ENOMEM; - q->elem_info = kcalloc(q->count, sizeof(*q->elem_info), GFP_KERNEL); + q->elem_info = kzalloc_objs(*q->elem_info, q->count, GFP_KERNEL); if (!q->elem_info) { err = -ENOMEM; goto err_elem_info_alloc; @@ -1316,7 +1316,7 @@ static int mlxsw_pci_queue_group_init(struct mlxsw_pci *mlxsw_pci, char *mbox, int err; queue_group = mlxsw_pci_queue_type_group_get(mlxsw_pci, q_ops->type); - queue_group->q = kcalloc(num_qs, sizeof(*queue_group->q), GFP_KERNEL); + queue_group->q = kzalloc_objs(*queue_group->q, num_qs, GFP_KERNEL); if (!queue_group->q) return -ENOMEM; @@ -1667,8 +1667,8 @@ static int mlxsw_pci_fw_area_init(struct mlxsw_pci *mlxsw_pci, char *mbox, int i; int err; - mlxsw_pci->fw_area.items = kcalloc(num_pages, sizeof(*mem_item), - GFP_KERNEL); + mlxsw_pci->fw_area.items = kzalloc_objs(*mem_item, num_pages, + GFP_KERNEL); if (!mlxsw_pci->fw_area.items) return -ENOMEM; mlxsw_pci->fw_area.count = num_pages; @@ -2414,7 +2414,7 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct mlxsw_pci *mlxsw_pci; int err; - mlxsw_pci = kzalloc(sizeof(*mlxsw_pci), GFP_KERNEL); + mlxsw_pci = kzalloc_obj(*mlxsw_pci, GFP_KERNEL); if (!mlxsw_pci) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 9a2d64a0a858..dbc032ff4963 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -972,7 +972,7 @@ mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid) if (err) return ERR_PTR(err); - mlxsw_sp_port_vlan = kzalloc(sizeof(*mlxsw_sp_port_vlan), GFP_KERNEL); + mlxsw_sp_port_vlan = kzalloc_obj(*mlxsw_sp_port_vlan, GFP_KERNEL); if (!mlxsw_sp_port_vlan) { err = -ENOMEM; goto err_port_vlan_alloc; @@ -1776,7 +1776,7 @@ static int mlxsw_sp_cpu_port_create(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_port *mlxsw_sp_port; int err; - mlxsw_sp_port = kzalloc(sizeof(*mlxsw_sp_port), GFP_KERNEL); + mlxsw_sp_port = kzalloc_obj(*mlxsw_sp_port, GFP_KERNEL); if (!mlxsw_sp_port) return -ENOMEM; @@ -1898,7 +1898,7 @@ mlxsw_sp_port_mapping_listener_func(const struct mlxsw_reg_info *reg, return; events = &mlxsw_sp->port_mapping_events; - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kmalloc_obj(*event, GFP_ATOMIC); if (!event) return; memcpy(event->pmlp_pl, pmlp_pl, sizeof(event->pmlp_pl)); @@ -2019,9 +2019,8 @@ static int mlxsw_sp_port_module_info_init(struct mlxsw_sp *mlxsw_sp) int i; int err; - mlxsw_sp->port_mapping = kcalloc(max_ports, - sizeof(struct mlxsw_sp_port_mapping), - GFP_KERNEL); + mlxsw_sp->port_mapping = kzalloc_objs(struct mlxsw_sp_port_mapping, + max_ports, GFP_KERNEL); if (!mlxsw_sp->port_mapping) return -ENOMEM; @@ -2490,8 +2489,8 @@ static int mlxsw_sp_traps_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_CPU_POLICERS)) return -EIO; max_policers = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_CPU_POLICERS); - trap = kzalloc(struct_size(trap, policers_usage, - BITS_TO_LONGS(max_policers)), GFP_KERNEL); + trap = kzalloc_flex(*trap, policers_usage, BITS_TO_LONGS(max_policers), + GFP_KERNEL); if (!trap) return -ENOMEM; trap->max_policers = max_policers; @@ -2624,8 +2623,8 @@ static int mlxsw_sp_lag_init(struct mlxsw_sp *mlxsw_sp) if (err) return err; - mlxsw_sp->lags = kcalloc(mlxsw_sp->max_lag, sizeof(struct mlxsw_sp_lag), - GFP_KERNEL); + mlxsw_sp->lags = kzalloc_objs(struct mlxsw_sp_lag, mlxsw_sp->max_lag, + GFP_KERNEL); if (!mlxsw_sp->lags) { err = -ENOMEM; goto err_kcalloc; @@ -2748,7 +2747,7 @@ mlxsw_sp_sample_trigger_node_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_sample_trigger_node *trigger_node; int err; - trigger_node = kzalloc(sizeof(*trigger_node), GFP_KERNEL); + trigger_node = kzalloc_obj(*trigger_node, GFP_KERNEL); if (!trigger_node) return -ENOMEM; @@ -2894,7 +2893,7 @@ mlxsw_sp_ipv6_addr_init(struct mlxsw_sp *mlxsw_sp, const struct in6_addr *addr6, if (err) goto err_rips_write; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) { err = -ENOMEM; goto err_node_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c index 1e3fc989393c..6aa1252cbe49 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c @@ -224,8 +224,7 @@ mlxsw_sp1_kvdl_part_init(struct mlxsw_sp *mlxsw_sp, } nr_entries = div_u64(resource_size, info->alloc_size); - part = kzalloc(struct_size(part, usage, BITS_TO_LONGS(nr_entries)), - GFP_KERNEL); + part = kzalloc_flex(*part, usage, BITS_TO_LONGS(nr_entries), GFP_KERNEL); if (!part) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c index c8c67536917b..814b704de294 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c @@ -259,8 +259,8 @@ mlxsw_sp1_mr_tcam_region_init(struct mlxsw_sp *mlxsw_sp, } mr_tcam_region->parman = parman; - parman_prios = kmalloc_array(MLXSW_SP_MR_ROUTE_PRIO_MAX + 1, - sizeof(*parman_prios), GFP_KERNEL); + parman_prios = kmalloc_objs(*parman_prios, + MLXSW_SP_MR_ROUTE_PRIO_MAX + 1, GFP_KERNEL); if (!parman_prios) { err = -ENOMEM; goto err_parman_prios_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c index 3e70cee4d2f3..aaaa586e8569 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c @@ -318,7 +318,7 @@ mlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl, struct mlxsw_sp_acl_rule_info *rulei; int err; - rulei = kzalloc(sizeof(*rulei), GFP_KERNEL); + rulei = kzalloc_obj(*rulei, GFP_KERNEL); if (!rulei) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c index 07cb1e26ca3e..b6e1fc77f0c0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c @@ -74,7 +74,7 @@ mlxsw_sp_acl_atcam_region_generic_init(struct mlxsw_sp_acl_atcam_region *aregion { struct mlxsw_sp_acl_atcam_region_generic *region_generic; - region_generic = kzalloc(sizeof(*region_generic), GFP_KERNEL); + region_generic = kzalloc_obj(*region_generic, GFP_KERNEL); if (!region_generic) return -ENOMEM; @@ -126,7 +126,7 @@ mlxsw_sp_acl_atcam_region_12kb_init(struct mlxsw_sp_acl_atcam_region *aregion) return -EIO; max_lkey_id = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID); - region_12kb = kzalloc(sizeof(*region_12kb), GFP_KERNEL); + region_12kb = kzalloc_obj(*region_12kb, GFP_KERNEL); if (!region_12kb) return -ENOMEM; @@ -179,7 +179,7 @@ mlxsw_sp_acl_atcam_lkey_id_create(struct mlxsw_sp_acl_atcam_region *aregion, else return ERR_PTR(-ENOBUFS); - lkey_id = kzalloc(sizeof(*lkey_id), GFP_KERNEL); + lkey_id = kzalloc_obj(*lkey_id, GFP_KERNEL); if (!lkey_id) { err = -ENOMEM; goto err_lkey_id_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c index 067f0055a55a..d6c55a80a7ce 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c @@ -513,8 +513,8 @@ mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks) * is 2^ACL_MAX_BF_LOG */ bf_bank_size = 1 << MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_BF_LOG); - bf = kzalloc(struct_size(bf, refcnt, size_mul(bf_bank_size, num_erp_banks)), - GFP_KERNEL); + bf = kzalloc_flex(*bf, refcnt, size_mul(bf_bank_size, num_erp_banks), + GFP_KERNEL); if (!bf) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c index 9eee229303cc..80307d6554a2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c @@ -254,7 +254,7 @@ mlxsw_sp_acl_erp_generic_create(struct mlxsw_sp_acl_erp_table *erp_table, struct mlxsw_sp_acl_erp *erp; int err; - erp = kzalloc(sizeof(*erp), GFP_KERNEL); + erp = kzalloc_obj(*erp, GFP_KERNEL); if (!erp) return ERR_PTR(-ENOMEM); @@ -798,7 +798,7 @@ mlxsw_sp_acl_erp_ctcam_mask_create(struct mlxsw_sp_acl_erp_table *erp_table, struct mlxsw_sp_acl_erp *erp; int err; - erp = kzalloc(sizeof(*erp), GFP_KERNEL); + erp = kzalloc_obj(*erp, GFP_KERNEL); if (!erp) return ERR_PTR(-ENOMEM); @@ -1236,7 +1236,7 @@ static void *mlxsw_sp_acl_erp_delta_create(void *priv, void *parent_obj, if (err) return ERR_PTR(-EINVAL); - delta = kzalloc(sizeof(*delta), GFP_KERNEL); + delta = kzalloc_obj(*delta, GFP_KERNEL); if (!delta) return ERR_PTR(-ENOMEM); delta->start = delta_start; @@ -1309,7 +1309,7 @@ mlxsw_sp_acl_erp_table_create(struct mlxsw_sp_acl_atcam_region *aregion, struct mlxsw_sp_acl_erp_table *erp_table; int err; - erp_table = kzalloc(sizeof(*erp_table), GFP_KERNEL); + erp_table = kzalloc_obj(*erp_table, GFP_KERNEL); if (!erp_table) return ERR_PTR(-ENOMEM); @@ -1563,7 +1563,7 @@ int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_erp_core *erp_core; int err; - erp_core = kzalloc(sizeof(*erp_core), GFP_KERNEL); + erp_core = kzalloc_obj(*erp_core, GFP_KERNEL); if (!erp_core) return -ENOMEM; erp_core->mlxsw_sp = mlxsw_sp; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c index 69f9da9fb305..5a282cb4b52d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c @@ -778,7 +778,7 @@ mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_tcam_vregion *vregion; int err; - vregion = kzalloc(sizeof(*vregion), GFP_KERNEL); + vregion = kzalloc_obj(*vregion, GFP_KERNEL); if (!vregion) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&vregion->vchunk_list); @@ -939,7 +939,7 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, if (priority == MLXSW_SP_ACL_TCAM_CATCHALL_PRIO) return ERR_PTR(-EINVAL); - vchunk = kzalloc(sizeof(*vchunk), GFP_KERNEL); + vchunk = kzalloc_obj(*vchunk, GFP_KERNEL); if (!vchunk) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&vchunk->ventry_list); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c index 2c0cfa79d138..fd6b36c3d475 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c @@ -628,8 +628,7 @@ static int mlxsw_sp_sb_port_init(struct mlxsw_sp *mlxsw_sp, { struct mlxsw_sp_sb_pm *pms; - pms = kcalloc(mlxsw_sp->sb_vals->pool_count, sizeof(*pms), - GFP_KERNEL); + pms = kzalloc_objs(*pms, mlxsw_sp->sb_vals->pool_count, GFP_KERNEL); if (!pms) return -ENOMEM; sb_port->pms = pms; @@ -648,14 +647,12 @@ static int mlxsw_sp_sb_ports_init(struct mlxsw_sp *mlxsw_sp) int i; int err; - mlxsw_sp->sb->ports = kcalloc(max_ports, - sizeof(struct mlxsw_sp_sb_port), - GFP_KERNEL); + mlxsw_sp->sb->ports = kzalloc_objs(struct mlxsw_sp_sb_port, max_ports, + GFP_KERNEL); if (!mlxsw_sp->sb->ports) return -ENOMEM; - prs = kcalloc(mlxsw_sp->sb_vals->pool_count, sizeof(*prs), - GFP_KERNEL); + prs = kzalloc_objs(*prs, mlxsw_sp->sb_vals->pool_count, GFP_KERNEL); if (!prs) { err = -ENOMEM; goto err_alloc_prs; @@ -1264,7 +1261,7 @@ int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_HEADROOM_SIZE)) return -EIO; - mlxsw_sp->sb = kzalloc(sizeof(*mlxsw_sp->sb), GFP_KERNEL); + mlxsw_sp->sb = kzalloc_obj(*mlxsw_sp->sb, GFP_KERNEL); if (!mlxsw_sp->sb) return -ENOMEM; mlxsw_sp->sb->cell_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, CELL_SIZE); @@ -1327,7 +1324,7 @@ int mlxsw_sp_port_buffers_init(struct mlxsw_sp_port *mlxsw_sp_port) { int err; - mlxsw_sp_port->hdroom = kzalloc(sizeof(*mlxsw_sp_port->hdroom), GFP_KERNEL); + mlxsw_sp_port->hdroom = kzalloc_obj(*mlxsw_sp_port->hdroom, GFP_KERNEL); if (!mlxsw_sp_port->hdroom) return -ENOMEM; mlxsw_sp_port->hdroom->mtu = mlxsw_sp_port->dev->mtu; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c index b1094aaffa5f..33ef49de4e0b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c @@ -124,8 +124,7 @@ int mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_counter_pool *pool; int err; - pool = kzalloc(struct_size(pool, sub_pools, sub_pools_count), - GFP_KERNEL); + pool = kzalloc_flex(*pool, sub_pools, sub_pools_count, GFP_KERNEL); if (!pool) return -ENOMEM; mlxsw_sp->counter_pool = pool; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c index aff6d4f35cd2..69ab4f8cf05d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c @@ -654,8 +654,8 @@ static const struct dcbnl_rtnl_ops mlxsw_sp_dcbnl_ops = { static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port) { - mlxsw_sp_port->dcb.ets = kzalloc(sizeof(*mlxsw_sp_port->dcb.ets), - GFP_KERNEL); + mlxsw_sp_port->dcb.ets = kzalloc_obj(*mlxsw_sp_port->dcb.ets, + GFP_KERNEL); if (!mlxsw_sp_port->dcb.ets) return -ENOMEM; @@ -673,8 +673,8 @@ static int mlxsw_sp_port_maxrate_init(struct mlxsw_sp_port *mlxsw_sp_port) { int i; - mlxsw_sp_port->dcb.maxrate = kmalloc(sizeof(*mlxsw_sp_port->dcb.maxrate), - GFP_KERNEL); + mlxsw_sp_port->dcb.maxrate = kmalloc_obj(*mlxsw_sp_port->dcb.maxrate, + GFP_KERNEL); if (!mlxsw_sp_port->dcb.maxrate) return -ENOMEM; @@ -691,8 +691,8 @@ static void mlxsw_sp_port_maxrate_fini(struct mlxsw_sp_port *mlxsw_sp_port) static int mlxsw_sp_port_pfc_init(struct mlxsw_sp_port *mlxsw_sp_port) { - mlxsw_sp_port->dcb.pfc = kzalloc(sizeof(*mlxsw_sp_port->dcb.pfc), - GFP_KERNEL); + mlxsw_sp_port->dcb.pfc = kzalloc_obj(*mlxsw_sp_port->dcb.pfc, + GFP_KERNEL); if (!mlxsw_sp_port->dcb.pfc) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c index 65562ab208b3..2e9c35f5f992 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c @@ -1022,7 +1022,7 @@ mlxsw_sp_fid_port_vid_list_add(struct mlxsw_sp_fid *fid, u16 local_port, { struct mlxsw_sp_fid_port_vid *port_vid, *tmp_port_vid; - port_vid = kzalloc(sizeof(*port_vid), GFP_KERNEL); + port_vid = kzalloc_obj(*port_vid, GFP_KERNEL); if (!port_vid) return -ENOMEM; @@ -2295,7 +2295,7 @@ mlxsw_sp_fids_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid_core *fid_core; int err, i; - fid_core = kzalloc(sizeof(*mlxsw_sp->fid_core), GFP_KERNEL); + fid_core = kzalloc_obj(*mlxsw_sp->fid_core, GFP_KERNEL); if (!fid_core) return -ENOMEM; mlxsw_sp->fid_core = fid_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c index 9e50c823a354..6e341b4a9805 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c @@ -14,7 +14,7 @@ mlxsw_sp_flow_block_create(struct mlxsw_sp *mlxsw_sp, struct net *net) { struct mlxsw_sp_flow_block *block; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return NULL; INIT_LIST_HEAD(&block->binding_list); @@ -75,7 +75,7 @@ static int mlxsw_sp_flow_block_bind(struct mlxsw_sp *mlxsw_sp, if (err) return err; - binding = kzalloc(sizeof(*binding), GFP_KERNEL); + binding = kzalloc_obj(*binding, GFP_KERNEL); if (!binding) { err = -ENOMEM; goto err_binding_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c index 07b371cd9818..a5fdc1a7555a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c @@ -243,7 +243,7 @@ int mlxsw_sp_mall_replace(struct mlxsw_sp *mlxsw_sp, return -EOPNOTSUPP; } - mall_entry = kzalloc(sizeof(*mall_entry), GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); if (!mall_entry) return -ENOMEM; mall_entry->cookie = f->cookie; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c index 81935f87bfcd..1ca8a15a9cb2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c @@ -172,7 +172,7 @@ static int mlxsw_sp_mr_route_evif_link(struct mlxsw_sp_mr_route *mr_route, { struct mlxsw_sp_mr_route_vif_entry *rve; - rve = kzalloc(sizeof(*rve), GFP_KERNEL); + rve = kzalloc_obj(*rve, GFP_KERNEL); if (!rve) return -ENOMEM; rve->mr_route = mr_route; @@ -305,7 +305,7 @@ mlxsw_sp_mr_route_create(struct mlxsw_sp_mr_table *mr_table, int i; /* Allocate and init a new route and fill it with parameters */ - mr_route = kzalloc(sizeof(*mr_route), GFP_KERNEL); + mr_route = kzalloc_obj(*mr_route, GFP_KERNEL); if (!mr_route) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&mr_route->evif_list); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c index 01d81ae3662a..f652630cbac1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c @@ -52,7 +52,7 @@ mlxsw_sp_mr_erif_sublist_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_mr_erif_sublist *erif_sublist; int err; - erif_sublist = kzalloc(sizeof(*erif_sublist), GFP_KERNEL); + erif_sublist = kzalloc_obj(*erif_sublist, GFP_KERNEL); if (!erif_sublist) return ERR_PTR(-ENOMEM); err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c index 5479a1c19d2e..8068502c8c2b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c @@ -216,7 +216,7 @@ mlxsw_sp_nve_mc_list_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nve_mc_list *mc_list; int err; - mc_list = kmalloc(sizeof(*mc_list), GFP_KERNEL); + mc_list = kmalloc_obj(*mc_list, GFP_KERNEL); if (!mc_list) return ERR_PTR(-ENOMEM); @@ -277,8 +277,8 @@ mlxsw_sp_nve_mc_record_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nve_mc_record *mc_record; int err; - mc_record = kzalloc(struct_size(mc_record, entries, num_max_entries), - GFP_KERNEL); + mc_record = kzalloc_flex(*mc_record, entries, num_max_entries, + GFP_KERNEL); if (!mc_record) return ERR_PTR(-ENOMEM); @@ -848,7 +848,7 @@ static int mlxsw_sp_nve_ipv6_ht_insert(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nve *nve = mlxsw_sp->nve; int err; - ipv6_ht_node = kzalloc(sizeof(*ipv6_ht_node), GFP_KERNEL); + ipv6_ht_node = kzalloc_obj(*ipv6_ht_node, GFP_KERNEL); if (!ipv6_ht_node) return -ENOMEM; @@ -1119,7 +1119,7 @@ int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_nve *nve; int err; - nve = kzalloc(sizeof(*mlxsw_sp->nve), GFP_KERNEL); + nve = kzalloc_obj(*mlxsw_sp->nve, GFP_KERNEL); if (!nve) return -ENOMEM; mlxsw_sp->nve = nve; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c index 4ef81bac17d6..0b6269a40c5a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c @@ -116,7 +116,7 @@ mlxsw_sp_pgt_entry_create(struct mlxsw_sp_pgt *pgt, u16 mid, u16 smpe) void *ret; int err; - pgt_entry = kzalloc(sizeof(*pgt_entry), GFP_KERNEL); + pgt_entry = kzalloc_obj(*pgt_entry, GFP_KERNEL); if (!pgt_entry) return ERR_PTR(-ENOMEM); @@ -211,7 +211,7 @@ mlxsw_sp_pgt_entry_port_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_pgt_entry_port *pgt_entry_port; int err; - pgt_entry_port = kzalloc(sizeof(*pgt_entry_port), GFP_KERNEL); + pgt_entry_port = kzalloc_obj(*pgt_entry_port, GFP_KERNEL); if (!pgt_entry_port) return ERR_PTR(-ENOMEM); @@ -315,7 +315,7 @@ int mlxsw_sp_pgt_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, PGT_SIZE)) return -EIO; - pgt = kzalloc(sizeof(*mlxsw_sp->pgt), GFP_KERNEL); + pgt = kzalloc_obj(*mlxsw_sp->pgt, GFP_KERNEL); if (!pgt) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c index 22ebb207ce4d..a6d849c7bb3d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c @@ -243,7 +243,7 @@ int mlxsw_sp_policer_add(struct mlxsw_sp *mlxsw_sp, if (err) return err; - policer = kmalloc(sizeof(*policer), GFP_KERNEL); + policer = kmalloc_obj(*policer, GFP_KERNEL); if (!policer) return -ENOMEM; policer->params = *params; @@ -357,7 +357,7 @@ int mlxsw_sp_policers_init(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_policer_core *policer_core; int i, err; - policer_core = kzalloc(sizeof(*policer_core), GFP_KERNEL); + policer_core = kzalloc_obj(*policer_core, GFP_KERNEL); if (!policer_core) return -ENOMEM; mlxsw_sp->policer_core = policer_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c index 2d193de12be6..4afcb32e7d14 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c @@ -52,7 +52,7 @@ mlxsw_sp_port_range_reg_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_port_range_reg *prr; int err; - prr = kzalloc(sizeof(*prr), GFP_KERNEL); + prr = kzalloc_obj(*prr, GFP_KERNEL); if (!prr) return ERR_PTR(-ENOMEM); @@ -172,7 +172,7 @@ int mlxsw_sp_port_range_init(struct mlxsw_sp *mlxsw_sp) */ WARN_ON(max > BITS_PER_BYTE * sizeof(u16)); - pr_core = kzalloc(sizeof(*mlxsw_sp->pr_core), GFP_KERNEL); + pr_core = kzalloc_obj(*mlxsw_sp->pr_core, GFP_KERNEL); if (!pr_core) return -ENOMEM; mlxsw_sp->pr_core = pr_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c index 5b9f0844b8f6..4025b556b39c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c @@ -277,7 +277,7 @@ mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) struct mlxsw_sp1_ptp_clock *clock; int err; - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) return ERR_PTR(-ENOMEM); @@ -446,7 +446,7 @@ mlxsw_sp2_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) struct mlxsw_sp_ptp_clock *clock; int err; - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) return ERR_PTR(-ENOMEM); @@ -524,7 +524,7 @@ mlxsw_sp1_ptp_unmatched_save(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp1_ptp_unmatched *unmatched; int err; - unmatched = kzalloc(sizeof(*unmatched), GFP_ATOMIC); + unmatched = kzalloc_obj(*unmatched, GFP_ATOMIC); if (!unmatched) return -ENOMEM; @@ -1032,7 +1032,7 @@ struct mlxsw_sp_ptp_state *mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp) if (err) return ERR_PTR(err); - ptp_state = kzalloc(sizeof(*ptp_state), GFP_KERNEL); + ptp_state = kzalloc_obj(*ptp_state, GFP_KERNEL); if (!ptp_state) return ERR_PTR(-ENOMEM); ptp_state->common.mlxsw_sp = mlxsw_sp; @@ -1358,7 +1358,7 @@ struct mlxsw_sp_ptp_state *mlxsw_sp2_ptp_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, FID)) return ERR_PTR(-EIO); - ptp_state = kzalloc(sizeof(*ptp_state), GFP_KERNEL); + ptp_state = kzalloc_obj(*ptp_state, GFP_KERNEL); if (!ptp_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c index 4243d3b883ff..5e159b326100 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c @@ -365,9 +365,9 @@ static int mlxsw_sp_qdisc_create(struct mlxsw_sp_port *mlxsw_sp_port, return err; if (ops->num_classes) { - mlxsw_sp_qdisc->qdiscs = kcalloc(ops->num_classes, - sizeof(*mlxsw_sp_qdisc->qdiscs), - GFP_KERNEL); + mlxsw_sp_qdisc->qdiscs = kzalloc_objs(*mlxsw_sp_qdisc->qdiscs, + ops->num_classes, + GFP_KERNEL); if (!mlxsw_sp_qdisc->qdiscs) return -ENOMEM; @@ -1332,7 +1332,7 @@ __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, int err; if (!ets_data) { - ets_data = kzalloc(sizeof(*ets_data), GFP_KERNEL); + ets_data = kzalloc_obj(*ets_data, GFP_KERNEL); if (!ets_data) return -ENOMEM; mlxsw_sp_qdisc->ets_data = ets_data; @@ -2021,7 +2021,7 @@ static int mlxsw_sp_qevent_mall_replace(struct mlxsw_sp *mlxsw_sp, return -EOPNOTSUPP; } - mall_entry = kzalloc(sizeof(*mall_entry), GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); if (!mall_entry) return -ENOMEM; mall_entry->cookie = f->cookie; @@ -2100,7 +2100,7 @@ static struct mlxsw_sp_qevent_block *mlxsw_sp_qevent_block_create(struct mlxsw_s { struct mlxsw_sp_qevent_block *qevent_block; - qevent_block = kzalloc(sizeof(*qevent_block), GFP_KERNEL); + qevent_block = kzalloc_obj(*qevent_block, GFP_KERNEL); if (!qevent_block) return NULL; @@ -2132,7 +2132,7 @@ mlxsw_sp_qevent_binding_create(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, { struct mlxsw_sp_qevent_binding *binding; - binding = kzalloc(sizeof(*binding), GFP_KERNEL); + binding = kzalloc_obj(*binding, GFP_KERNEL); if (!binding) return ERR_PTR(-ENOMEM); @@ -2321,7 +2321,7 @@ int mlxsw_sp_tc_qdisc_init(struct mlxsw_sp_port *mlxsw_sp_port) { struct mlxsw_sp_qdisc_state *qdisc_state; - qdisc_state = kzalloc(sizeof(*qdisc_state), GFP_KERNEL); + qdisc_state = kzalloc_obj(*qdisc_state, GFP_KERNEL); if (!qdisc_state) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 2d0e89bd2fb9..417431895268 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -538,7 +538,7 @@ static struct mlxsw_sp_fib *mlxsw_sp_fib_create(struct mlxsw_sp *mlxsw_sp, int err; lpm_tree = mlxsw_sp->router->lpm.proto_trees[proto]; - fib = kzalloc(sizeof(*fib), GFP_KERNEL); + fib = kzalloc_obj(*fib, GFP_KERNEL); if (!fib) return ERR_PTR(-ENOMEM); err = rhashtable_init(&fib->ht, &mlxsw_sp_fib_ht_params); @@ -717,9 +717,9 @@ static int mlxsw_sp_lpm_init(struct mlxsw_sp *mlxsw_sp) max_trees = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LPM_TREES); mlxsw_sp->router->lpm.tree_count = max_trees - MLXSW_SP_LPM_TREE_MIN; - mlxsw_sp->router->lpm.trees = kcalloc(mlxsw_sp->router->lpm.tree_count, - sizeof(struct mlxsw_sp_lpm_tree), - GFP_KERNEL); + mlxsw_sp->router->lpm.trees = kzalloc_objs(struct mlxsw_sp_lpm_tree, + mlxsw_sp->router->lpm.tree_count, + GFP_KERNEL); if (!mlxsw_sp->router->lpm.trees) return -ENOMEM; @@ -1038,8 +1038,8 @@ static int mlxsw_sp_vrs_init(struct mlxsw_sp *mlxsw_sp) return -EIO; max_vrs = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); - mlxsw_sp->router->vrs = kcalloc(max_vrs, sizeof(struct mlxsw_sp_vr), - GFP_KERNEL); + mlxsw_sp->router->vrs = kzalloc_objs(struct mlxsw_sp_vr, max_vrs, + GFP_KERNEL); if (!mlxsw_sp->router->vrs) return -ENOMEM; @@ -1095,7 +1095,7 @@ mlxsw_sp_crif_alloc(struct net_device *dev) { struct mlxsw_sp_crif *crif; - crif = kzalloc(sizeof(*crif), GFP_KERNEL); + crif = kzalloc_obj(*crif, GFP_KERNEL); if (!crif) return NULL; @@ -1178,7 +1178,7 @@ mlxsw_sp_ipip_entry_alloc(struct mlxsw_sp *mlxsw_sp, int err; ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; - ipip_entry = kzalloc(sizeof(*ipip_entry), GFP_KERNEL); + ipip_entry = kzalloc_obj(*ipip_entry, GFP_KERNEL); if (!ipip_entry) return ERR_PTR(-ENOMEM); @@ -2261,7 +2261,7 @@ mlxsw_sp_neigh_entry_alloc(struct mlxsw_sp *mlxsw_sp, struct neighbour *n, { struct mlxsw_sp_neigh_entry *neigh_entry; - neigh_entry = kzalloc(sizeof(*neigh_entry), GFP_KERNEL); + neigh_entry = kzalloc_obj(*neigh_entry, GFP_KERNEL); if (!neigh_entry) return NULL; @@ -2856,7 +2856,7 @@ static int mlxsw_sp_router_schedule_work(struct net *net, if (!net_eq(net, mlxsw_sp_net(router->mlxsw_sp))) return NOTIFY_DONE; - net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC); + net_work = kzalloc_obj(*net_work, GFP_ATOMIC); if (!net_work) return NOTIFY_BAD; @@ -3172,7 +3172,7 @@ mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_nexthop_counter *nhct; int err; - nhct = kzalloc(sizeof(*nhct), GFP_KERNEL); + nhct = kzalloc_obj(*nhct, GFP_KERNEL); if (!nhct) return ERR_PTR(-ENOMEM); @@ -3404,7 +3404,7 @@ mlxsw_sp_nexthop_group_vr_entry_create(struct mlxsw_sp_nexthop_group *nh_grp, struct mlxsw_sp_nexthop_group_vr_entry *vr_entry; int err; - vr_entry = kzalloc(sizeof(*vr_entry), GFP_KERNEL); + vr_entry = kzalloc_obj(*vr_entry, GFP_KERNEL); if (!vr_entry) return -ENOMEM; @@ -5198,7 +5198,7 @@ mlxsw_sp_nexthop_obj_group_info_init(struct mlxsw_sp *mlxsw_sp, return -EINVAL; } - nhgi = kzalloc(struct_size(nhgi, nexthops, nhs), GFP_KERNEL); + nhgi = kzalloc_flex(*nhgi, nexthops, nhs, GFP_KERNEL); if (!nhgi) return -ENOMEM; nh_grp->nhgi = nhgi; @@ -5304,7 +5304,7 @@ mlxsw_sp_nexthop_obj_group_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc(sizeof(*nh_grp), GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -5779,7 +5779,7 @@ mlxsw_sp_nexthop4_group_info_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop *nh; int err, i; - nhgi = kzalloc(struct_size(nhgi, nexthops, nhs), GFP_KERNEL); + nhgi = kzalloc_flex(*nhgi, nexthops, nhs, GFP_KERNEL); if (!nhgi) return -ENOMEM; nh_grp->nhgi = nhgi; @@ -5841,7 +5841,7 @@ mlxsw_sp_nexthop4_group_create(struct mlxsw_sp *mlxsw_sp, struct fib_info *fi) struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc(sizeof(*nh_grp), GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -6481,7 +6481,7 @@ mlxsw_sp_fib4_entry_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fib_entry *fib_entry; int err; - fib4_entry = kzalloc(sizeof(*fib4_entry), GFP_KERNEL); + fib4_entry = kzalloc_obj(*fib4_entry, GFP_KERNEL); if (!fib4_entry) return ERR_PTR(-ENOMEM); fib_entry = &fib4_entry->common; @@ -6601,7 +6601,7 @@ mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, { struct mlxsw_sp_fib_node *fib_node; - fib_node = kzalloc(sizeof(*fib_node), GFP_KERNEL); + fib_node = kzalloc_obj(*fib_node, GFP_KERNEL); if (!fib_node) return NULL; @@ -6906,7 +6906,7 @@ static struct mlxsw_sp_rt6 *mlxsw_sp_rt6_create(struct fib6_info *rt) { struct mlxsw_sp_rt6 *mlxsw_sp_rt6; - mlxsw_sp_rt6 = kzalloc(sizeof(*mlxsw_sp_rt6), GFP_KERNEL); + mlxsw_sp_rt6 = kzalloc_obj(*mlxsw_sp_rt6, GFP_KERNEL); if (!mlxsw_sp_rt6) return ERR_PTR(-ENOMEM); @@ -7032,8 +7032,7 @@ mlxsw_sp_nexthop6_group_info_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop *nh; int err, i; - nhgi = kzalloc(struct_size(nhgi, nexthops, fib6_entry->nrt6), - GFP_KERNEL); + nhgi = kzalloc_flex(*nhgi, nexthops, fib6_entry->nrt6, GFP_KERNEL); if (!nhgi) return -ENOMEM; nh_grp->nhgi = nhgi; @@ -7099,7 +7098,7 @@ mlxsw_sp_nexthop6_group_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc(sizeof(*nh_grp), GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -7378,7 +7377,7 @@ mlxsw_sp_fib6_entry_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_rt6 *mlxsw_sp_rt6; int err, i; - fib6_entry = kzalloc(sizeof(*fib6_entry), GFP_KERNEL); + fib6_entry = kzalloc_obj(*fib6_entry, GFP_KERNEL); if (!fib6_entry) return ERR_PTR(-ENOMEM); fib_entry = &fib6_entry->common; @@ -7827,7 +7826,7 @@ mlxsw_sp_router_fib6_work_init(struct mlxsw_sp_fib6_event_work *fib6_work, nrt6 = fen6_info->nsiblings + 1; - rt_arr = kcalloc(nrt6, sizeof(struct fib6_info *), GFP_ATOMIC); + rt_arr = kzalloc_objs(struct fib6_info *, nrt6, GFP_ATOMIC); if (!rt_arr) return -ENOMEM; @@ -8139,7 +8138,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, break; } - fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); + fib_work = kzalloc_obj(*fib_work, GFP_ATOMIC); if (!fib_work) return NOTIFY_BAD; @@ -8542,7 +8541,7 @@ mlxsw_sp_router_hwstats_notify_schedule(struct net_device *dev) * later. */ - hws_work = kzalloc(sizeof(*hws_work), GFP_KERNEL); + hws_work = kzalloc_obj(*hws_work, GFP_KERNEL); if (!hws_work) return; @@ -8947,7 +8946,7 @@ mlxsw_sp_rif_mac_profile_alloc(const char *mac) { struct mlxsw_sp_rif_mac_profile *profile; - profile = kzalloc(sizeof(*profile), GFP_KERNEL); + profile = kzalloc_obj(*profile, GFP_KERNEL); if (!profile) return NULL; @@ -9594,7 +9593,7 @@ static int mlxsw_sp_inet6addr_event(struct notifier_block *nb, if (event == NETDEV_UP) return NOTIFY_DONE; - inet6addr_work = kzalloc(sizeof(*inet6addr_work), GFP_ATOMIC); + inet6addr_work = kzalloc_obj(*inet6addr_work, GFP_ATOMIC); if (!inet6addr_work) return NOTIFY_BAD; @@ -11069,9 +11068,8 @@ static int mlxsw_sp_rifs_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp->router->max_rif_mac_profile = MLXSW_CORE_RES_GET(core, MAX_RIF_MAC_PROFILES); - mlxsw_sp->router->rifs = kcalloc(max_rifs, - sizeof(struct mlxsw_sp_rif *), - GFP_KERNEL); + mlxsw_sp->router->rifs = kzalloc_objs(struct mlxsw_sp_rif *, max_rifs, + GFP_KERNEL); if (!mlxsw_sp->router->rifs) return -ENOMEM; @@ -11584,7 +11582,7 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, struct notifier_block *nb; int err; - router = kzalloc(sizeof(*mlxsw_sp->router), GFP_KERNEL); + router = kzalloc_obj(*mlxsw_sp->router, GFP_KERNEL); if (!router) return -ENOMEM; mutex_init(&router->lock); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 32d2e61f2b82..79b0ed4e4c71 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -87,7 +87,7 @@ int mlxsw_sp_span_init(struct mlxsw_sp *mlxsw_sp) return -EIO; entries_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_SPAN); - span = kzalloc(struct_size(span, entries, entries_count), GFP_KERNEL); + span = kzalloc_flex(*span, entries, entries_count, GFP_KERNEL); if (!span) return -ENOMEM; refcount_set(&span->policer_id_base_ref_count, 0); @@ -1120,7 +1120,7 @@ mlxsw_sp_span_analyzed_port_create(struct mlxsw_sp_span *span, struct mlxsw_sp_span_analyzed_port *analyzed_port; int err; - analyzed_port = kzalloc(sizeof(*analyzed_port), GFP_KERNEL); + analyzed_port = kzalloc_obj(*analyzed_port, GFP_KERNEL); if (!analyzed_port) return ERR_PTR(-ENOMEM); @@ -1505,7 +1505,7 @@ mlxsw_sp_span_trigger_entry_create(struct mlxsw_sp_span *span, struct mlxsw_sp_span_trigger_entry *trigger_entry; int err; - trigger_entry = kzalloc(sizeof(*trigger_entry), GFP_KERNEL); + trigger_entry = kzalloc_obj(*trigger_entry, GFP_KERNEL); if (!trigger_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index a48bf342084d..7c386ee2ea74 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -262,7 +262,7 @@ mlxsw_sp_bridge_device_create(struct mlxsw_sp_bridge *bridge, return ERR_PTR(-EINVAL); } - bridge_device = kzalloc(sizeof(*bridge_device), GFP_KERNEL); + bridge_device = kzalloc_obj(*bridge_device, GFP_KERNEL); if (!bridge_device) return ERR_PTR(-ENOMEM); @@ -478,7 +478,7 @@ mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device, struct mlxsw_sp_port *mlxsw_sp_port; int err; - bridge_port = kzalloc(sizeof(*bridge_port), GFP_KERNEL); + bridge_port = kzalloc_obj(*bridge_port, GFP_KERNEL); if (!bridge_port) return ERR_PTR(-ENOMEM); @@ -625,7 +625,7 @@ mlxsw_sp_bridge_vlan_create(struct mlxsw_sp_bridge_port *bridge_port, u16 vid) { struct mlxsw_sp_bridge_vlan *bridge_vlan; - bridge_vlan = kzalloc(sizeof(*bridge_vlan), GFP_KERNEL); + bridge_vlan = kzalloc_obj(*bridge_vlan, GFP_KERNEL); if (!bridge_vlan) return NULL; @@ -1131,7 +1131,7 @@ mlxsw_sp_mdb_entry_port_get(struct mlxsw_sp *mlxsw_sp, if (err) return ERR_PTR(err); - mdb_entry_port = kzalloc(sizeof(*mdb_entry_port), GFP_KERNEL); + mdb_entry_port = kzalloc_obj(*mdb_entry_port, GFP_KERNEL); if (!mdb_entry_port) { err = -ENOMEM; goto err_mdb_entry_port_alloc; @@ -1195,7 +1195,7 @@ mlxsw_sp_mdb_entry_mrouter_port_get(struct mlxsw_sp *mlxsw_sp, if (err) return ERR_PTR(err); - mdb_entry_port = kzalloc(sizeof(*mdb_entry_port), GFP_KERNEL); + mdb_entry_port = kzalloc_obj(*mdb_entry_port, GFP_KERNEL); if (!mdb_entry_port) { err = -ENOMEM; goto err_mdb_entry_port_alloc; @@ -2027,7 +2027,7 @@ mlxsw_sp_mc_mdb_entry_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_mdb_entry *mdb_entry; int err; - mdb_entry = kzalloc(sizeof(*mdb_entry), GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); if (!mdb_entry) return ERR_PTR(-ENOMEM); @@ -3784,7 +3784,7 @@ static int mlxsw_sp_switchdev_event(struct notifier_block *unused, if (!mlxsw_sp_port_dev_lower_find_rcu(br_dev)) return NOTIFY_DONE; - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (!switchdev_work) return NOTIFY_BAD; @@ -4169,7 +4169,7 @@ int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp) { struct mlxsw_sp_bridge *bridge; - bridge = kzalloc(sizeof(*mlxsw_sp->bridge), GFP_KERNEL); + bridge = kzalloc_obj(*mlxsw_sp->bridge, GFP_KERNEL); if (!bridge) return -ENOMEM; mlxsw_sp->bridge = bridge; diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index 4aaa928bf8ab..e4e1af365460 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -1640,7 +1640,7 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn, return -EIO; /* Allocate NAPI vector and queue triads */ - nv = kzalloc(struct_size(nv, qt, qt_count), GFP_KERNEL); + nv = kzalloc_flex(*nv, qt, qt_count, GFP_KERNEL); if (!nv) return -ENOMEM; diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 491e9ce3d9b0..e594ea78b118 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -3991,8 +3991,8 @@ static void ksz_update_timer(struct ksz_timer_info *info) */ static int ksz_alloc_soft_desc(struct ksz_desc_info *desc_info, int transmit) { - desc_info->ring = kcalloc(desc_info->alloc, sizeof(struct ksz_desc), - GFP_KERNEL); + desc_info->ring = kzalloc_objs(struct ksz_desc, desc_info->alloc, + GFP_KERNEL); if (!desc_info->ring) return 1; hw_init_desc(desc_info, transmit); @@ -6577,7 +6577,7 @@ static int pcidev_init(struct pci_dev *pdev, const struct pci_device_id *id) result = -ENOMEM; - info = kzalloc(sizeof(struct platform_info), GFP_KERNEL); + info = kzalloc_obj(struct platform_info, GFP_KERNEL); if (!info) goto pcidev_init_dev_err; @@ -6630,7 +6630,7 @@ static int pcidev_init(struct pci_dev *pdev, const struct pci_device_id *id) mib_port_count = SWITCH_PORT_NUM; } hw->mib_port_cnt = TOTAL_PORT_NUM; - hw->ksz_switch = kzalloc(sizeof(struct ksz_switch), GFP_KERNEL); + hw->ksz_switch = kzalloc_obj(struct ksz_switch, GFP_KERNEL); if (!hw->ksz_switch) goto pcidev_init_alloc_err; diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c index e4c542fc6c2b..7ab6ad877a3c 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -2141,7 +2141,7 @@ static int lan743x_tx_ring_init(struct lan743x_tx *tx) tx->ring_cpu_ptr = (struct lan743x_tx_descriptor *)cpu_ptr; tx->ring_dma_ptr = dma_ptr; - cpu_ptr = kcalloc(tx->ring_size, sizeof(*tx->buffer_info), GFP_KERNEL); + cpu_ptr = kzalloc_objs(*tx->buffer_info, tx->ring_size, GFP_KERNEL); if (!cpu_ptr) { ret = -ENOMEM; goto cleanup; @@ -2686,8 +2686,7 @@ static int lan743x_rx_ring_init(struct lan743x_rx *rx) rx->ring_cpu_ptr = (struct lan743x_rx_descriptor *)cpu_ptr; rx->ring_dma_ptr = dma_ptr; - cpu_ptr = kcalloc(rx->ring_size, sizeof(*rx->buffer_info), - GFP_KERNEL); + cpu_ptr = kzalloc_objs(*rx->buffer_info, rx->ring_size, GFP_KERNEL); if (!cpu_ptr) { ret = -ENOMEM; goto cleanup; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c index 2ea263e893ee..cddd5dd35feb 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c @@ -46,7 +46,7 @@ static void lan966x_fdb_add_entry(struct lan966x *lan966x, return; } - fdb_entry = kzalloc(sizeof(*fdb_entry), GFP_KERNEL); + fdb_entry = kzalloc_obj(*fdb_entry, GFP_KERNEL); if (!fdb_entry) return; @@ -262,7 +262,7 @@ int lan966x_handle_fdb(struct net_device *dev, !fdb_info->added_by_user) break; - fdb_work = kzalloc(sizeof(*fdb_work), GFP_ATOMIC); + fdb_work = kzalloc_obj(*fdb_work, GFP_ATOMIC); if (!fdb_work) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c index 502670718104..13e22179f57a 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c @@ -200,8 +200,8 @@ static int lan966x_fdma_tx_alloc(struct lan966x_tx *tx) struct fdma *fdma = &tx->fdma; int err; - tx->dcbs_buf = kcalloc(fdma->n_dcbs, sizeof(struct lan966x_tx_dcb_buf), - GFP_KERNEL); + tx->dcbs_buf = kzalloc_objs(struct lan966x_tx_dcb_buf, fdma->n_dcbs, + GFP_KERNEL); if (!tx->dcbs_buf) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c index baa3a30c039f..7a2294a0d099 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mac.c @@ -206,7 +206,7 @@ static struct lan966x_mac_entry *lan966x_mac_alloc_entry(struct lan966x_port *po { struct lan966x_mac_entry *mac_entry; - mac_entry = kzalloc(sizeof(*mac_entry), GFP_ATOMIC); + mac_entry = kzalloc_obj(*mac_entry, GFP_ATOMIC); if (!mac_entry) return NULL; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c index 2af55268bf4d..aef4bc288e05 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c @@ -74,7 +74,7 @@ lan966x_mdb_entry_add(struct lan966x *lan966x, { struct lan966x_mdb_entry *mdb_entry; - mdb_entry = kzalloc(sizeof(*mdb_entry), GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); if (!mdb_entry) return ERR_PTR(-ENOMEM); @@ -184,7 +184,7 @@ lan966x_pgid_entry_add(struct lan966x *lan966x, int index, u16 ports) { struct lan966x_pgid_entry *pgid_entry; - pgid_entry = kzalloc(sizeof(*pgid_entry), GFP_KERNEL); + pgid_entry = kzalloc_obj(*pgid_entry, GFP_KERNEL); if (!pgid_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c index 2a37fc1ba4bc..cb07178f55fa 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c @@ -611,7 +611,7 @@ lan966x_vcap_admin_alloc(struct lan966x *lan966x, struct vcap_control *ctrl, { struct vcap_admin *admin; - admin = kzalloc(sizeof(*admin), GFP_KERNEL); + admin = kzalloc_obj(*admin, GFP_KERNEL); if (!admin) return ERR_PTR(-ENOMEM); @@ -712,7 +712,7 @@ int lan966x_vcap_init(struct lan966x *lan966x) struct vcap_admin *admin; struct dentry *dir; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c index 1282f5c3ee6d..57a24cbfb398 100644 --- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c +++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c @@ -186,9 +186,7 @@ static int lan969x_fdma_tx_alloc(struct sparx5 *sparx5) struct fdma *fdma = &tx->fdma; int err; - tx->dbs = kcalloc(fdma->n_dcbs, - sizeof(struct sparx5_tx_buf), - GFP_KERNEL); + tx->dbs = kzalloc_objs(struct sparx5_tx_buf, fdma->n_dcbs, GFP_KERNEL); if (!tx->dbs) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c index 5c46d81de530..19321de0712e 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c @@ -585,7 +585,7 @@ int sparx5_config_dsm_calendar(struct sparx5 *sparx5) struct sparx5_calendar_data *data; int err = 0; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index 582145713cfd..8c7894a69e5c 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -889,8 +889,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev) } sparx5->port_count = of_get_child_count(ports); - configs = kcalloc(sparx5->port_count, - sizeof(struct initial_port_config), GFP_KERNEL); + configs = kzalloc_objs(struct initial_port_config, sparx5->port_count, + GFP_KERNEL); if (!configs) { err = -ENOMEM; goto cleanup_pnode; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c index 0a71abbd3da5..6743c5ef3efd 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c @@ -398,7 +398,7 @@ static int sparx5_switchdev_event(struct notifier_block *nb, case SWITCHDEV_FDB_ADD_TO_DEVICE: fallthrough; case SWITCHDEV_FDB_DEL_TO_DEVICE: - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (!switchdev_work) return NOTIFY_BAD; @@ -465,7 +465,7 @@ static int sparx5_alloc_mdb_entry(struct sparx5 *sparx5, u16 pgid_idx; int err; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index 4dc1ebd5d510..57d88fe32752 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -1464,7 +1464,7 @@ static int sparx5_tc_flower_template_create(struct net_device *ndev, return -EBUSY; } - ftp = kzalloc(sizeof(*ftp), GFP_KERNEL); + ftp = kzalloc_obj(*ftp, GFP_KERNEL); if (!ftp) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c index 6b4d1d7b9730..cd0f44a6c88e 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c @@ -60,7 +60,7 @@ static int sparx5_tc_matchall_replace(struct net_device *ndev, } action = &tmo->rule->action.entries[0]; - mall_entry = kzalloc(sizeof(*mall_entry), GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); if (!mall_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c index 25066ddb8d4d..4bf3be00d627 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c @@ -1944,7 +1944,7 @@ sparx5_vcap_admin_alloc(struct sparx5 *sparx5, struct vcap_control *ctrl, { struct vcap_admin *admin; - admin = kzalloc(sizeof(*admin), GFP_KERNEL); + admin = kzalloc_obj(*admin, GFP_KERNEL); if (!admin) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&admin->list); @@ -2047,7 +2047,7 @@ int sparx5_vcap_init(struct sparx5 *sparx5) * - Initialize VCAP blocks * - Configure port keysets */ - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index 2687765abe52..29fe5101db4c 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -1004,7 +1004,7 @@ static struct vcap_rule_internal *vcap_dup_rule(struct vcap_rule_internal *ri, struct vcap_rule_internal *duprule; /* Allocate the client part */ - duprule = kzalloc(sizeof(*duprule), GFP_KERNEL); + duprule = kzalloc_obj(*duprule, GFP_KERNEL); if (!duprule) return ERR_PTR(-ENOMEM); *duprule = *ri; @@ -1309,7 +1309,7 @@ static void vcap_rule_alloc_keyfield(struct vcap_rule_internal *ri, { struct vcap_client_keyfield *field; - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) return; INIT_LIST_HEAD(&field->ctrl.list); @@ -1418,7 +1418,7 @@ static void vcap_rule_alloc_actionfield(struct vcap_rule_internal *ri, { struct vcap_client_actionfield *field; - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) return; INIT_LIST_HEAD(&field->ctrl.list); @@ -2345,7 +2345,7 @@ struct vcap_rule *vcap_alloc_rule(struct vcap_control *vctrl, } /* Create a container for the rule and return it */ - ri = kzalloc(sizeof(*ri), GFP_KERNEL); + ri = kzalloc_obj(*ri, GFP_KERNEL); if (!ri) { err = -ENOMEM; goto out_unlock; @@ -2689,7 +2689,7 @@ static int vcap_rule_add_key(struct vcap_rule *rule, return -EINVAL; } - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) return -ENOMEM; memcpy(&field->data, data, sizeof(field->data)); @@ -2857,7 +2857,7 @@ static int vcap_rule_add_action(struct vcap_rule *rule, return -EINVAL; } - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) return -ENOMEM; memcpy(&field->data, data, sizeof(field->data)); @@ -3125,7 +3125,7 @@ static int vcap_enable(struct vcap_control *vctrl, struct net_device *ndev, if (!admin) return -ENOENT; - eport = kzalloc(sizeof(*eport), GFP_KERNEL); + eport = kzalloc_obj(*eport, GFP_KERNEL); if (!eport) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c index 16eb3de60eb6..c57919278783 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c @@ -2037,7 +2037,7 @@ static void vcap_api_filter_unsupported_keys_test(struct kunit *test) /* Add all keys to the rule */ INIT_LIST_HEAD(&ri.data.keyfields); for (idx = 0; idx < ARRAY_SIZE(keylist); idx++) { - ckf = kzalloc(sizeof(*ckf), GFP_KERNEL); + ckf = kzalloc_obj(*ckf, GFP_KERNEL); if (ckf) { ckf->ctrl.key = keylist[idx]; list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); @@ -2161,7 +2161,7 @@ static void vcap_api_filter_keylist_test(struct kunit *test) /* Add all keys to the rule */ INIT_LIST_HEAD(&ri.data.keyfields); for (idx = 0; idx < ARRAY_SIZE(keylist); idx++) { - ckf = kzalloc(sizeof(*ckf), GFP_KERNEL); + ckf = kzalloc_obj(*ckf, GFP_KERNEL); if (ckf) { ckf->ctrl.key = keylist[idx]; list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 0055c231acf6..dc7c29240cac 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -634,7 +634,7 @@ static void mana_gd_process_eqe(struct gdma_queue *eq) break; } - mns_wk = kzalloc(sizeof(*mns_wk), GFP_ATOMIC); + mns_wk = kzalloc_obj(*mns_wk, GFP_ATOMIC); if (!mns_wk) { module_put(THIS_MODULE); break; @@ -923,7 +923,7 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd, struct gdma_queue *queue; int err; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return -ENOMEM; @@ -1062,7 +1062,7 @@ int mana_gd_create_mana_eq(struct gdma_dev *gd, if (spec->type != GDMA_EQ) return -EINVAL; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return -ENOMEM; @@ -1115,7 +1115,7 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd, spec->type != GDMA_RQ) return -EINVAL; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return -ENOMEM; @@ -1625,7 +1625,7 @@ static int mana_gd_setup_dyn_irqs(struct pci_dev *pdev, int nvec) bool skip_first_cpu = false; int *irqs, irq, err, i; - irqs = kmalloc_array(nvec, sizeof(int), GFP_KERNEL); + irqs = kmalloc_objs(int, nvec, GFP_KERNEL); if (!irqs) return -ENOMEM; @@ -1636,7 +1636,7 @@ static int mana_gd_setup_dyn_irqs(struct pci_dev *pdev, int nvec) * further used in irq_setup() */ for (i = 1; i <= nvec; i++) { - gic = kzalloc(sizeof(*gic), GFP_KERNEL); + gic = kzalloc_obj(*gic, GFP_KERNEL); if (!gic) { err = -ENOMEM; goto free_irq; @@ -1707,14 +1707,14 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev, int nvec) unsigned int cpu; int err, i; - irqs = kmalloc_array(nvec, sizeof(int), GFP_KERNEL); + irqs = kmalloc_objs(int, nvec, GFP_KERNEL); if (!irqs) return -ENOMEM; start_irqs = irqs; for (i = 0; i < nvec; i++) { - gic = kzalloc(sizeof(*gic), GFP_KERNEL); + gic = kzalloc_obj(*gic, GFP_KERNEL); if (!gic) { err = -ENOMEM; goto free_irq; @@ -2071,7 +2071,7 @@ disable_dev: dev_info(&pdev->dev, "Start MANA recovery mode\n"); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return err; diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c index aa4e2731e2ba..f2221e65a6a3 100644 --- a/drivers/net/ethernet/microsoft/mana/hw_channel.c +++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c @@ -407,7 +407,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, if (cq_size < MANA_MIN_QSIZE) cq_size = MANA_MIN_QSIZE; - hwc_cq = kzalloc(sizeof(*hwc_cq), GFP_KERNEL); + hwc_cq = kzalloc_obj(*hwc_cq, GFP_KERNEL); if (!hwc_cq) return -ENOMEM; @@ -426,7 +426,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, } hwc_cq->gdma_cq = cq; - comp_buf = kcalloc(q_depth, sizeof(*comp_buf), GFP_KERNEL); + comp_buf = kzalloc_objs(*comp_buf, q_depth, GFP_KERNEL); if (!comp_buf) { err = -ENOMEM; goto out; @@ -461,7 +461,7 @@ static int mana_hwc_alloc_dma_buf(struct hw_channel_context *hwc, u16 q_depth, int err; u16 i; - dma_buf = kzalloc(struct_size(dma_buf, reqs, q_depth), GFP_KERNEL); + dma_buf = kzalloc_flex(*dma_buf, reqs, q_depth, GFP_KERNEL); if (!dma_buf) return -ENOMEM; @@ -539,7 +539,7 @@ static int mana_hwc_create_wq(struct hw_channel_context *hwc, if (queue_size < MANA_MIN_QSIZE) queue_size = MANA_MIN_QSIZE; - hwc_wq = kzalloc(sizeof(*hwc_wq), GFP_KERNEL); + hwc_wq = kzalloc_obj(*hwc_wq, GFP_KERNEL); if (!hwc_wq) return -ENOMEM; @@ -644,7 +644,7 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth, return err; } - ctx = kcalloc(q_depth, sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_objs(*ctx, q_depth, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -750,7 +750,7 @@ int mana_hwc_create_channel(struct gdma_context *gc) u16 q_depth_max; int err; - hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); + hwc = kzalloc_obj(*hwc, GFP_KERNEL); if (!hwc) return -ENOMEM; diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 9b5a72ada5c4..5c9704f2041a 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -491,9 +491,8 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev) if (pkg.wqe_req.num_sge <= ARRAY_SIZE(pkg.sgl_array)) { pkg.wqe_req.sgl = pkg.sgl_array; } else { - pkg.sgl_ptr = kmalloc_array(pkg.wqe_req.num_sge, - sizeof(struct gdma_sge), - GFP_ATOMIC); + pkg.sgl_ptr = kmalloc_objs(struct gdma_sge, pkg.wqe_req.num_sge, + GFP_ATOMIC); if (!pkg.sgl_ptr) goto tx_drop_count; @@ -804,7 +803,7 @@ int mana_pre_alloc_rxbufs(struct mana_port_context *mpc, int new_mtu, int num_qu if (!mpc->rxbufs_pre) goto error; - mpc->das_pre = kmalloc_array(num_rxb, sizeof(dma_addr_t), GFP_KERNEL); + mpc->das_pre = kmalloc_objs(dma_addr_t, num_rxb, GFP_KERNEL); if (!mpc->das_pre) goto error; @@ -996,8 +995,7 @@ static void mana_cleanup_indir_table(struct mana_port_context *apc) static int mana_init_port_context(struct mana_port_context *apc) { - apc->rxqs = kcalloc(apc->num_queues, sizeof(struct mana_rxq *), - GFP_KERNEL); + apc->rxqs = kzalloc_objs(struct mana_rxq *, apc->num_queues, GFP_KERNEL); return !apc->rxqs ? -ENOMEM : 0; } @@ -1634,8 +1632,7 @@ static int mana_create_eq(struct mana_context *ac) int err; int i; - ac->eqs = kcalloc(gc->max_num_queues, sizeof(struct mana_eq), - GFP_KERNEL); + ac->eqs = kzalloc_objs(struct mana_eq, gc->max_num_queues, GFP_KERNEL); if (!ac->eqs) return -ENOMEM; @@ -2329,8 +2326,8 @@ static int mana_create_txq(struct mana_port_context *apc, int err; int i; - apc->tx_qp = kcalloc(apc->num_queues, sizeof(struct mana_tx_qp), - GFP_KERNEL); + apc->tx_qp = kzalloc_objs(struct mana_tx_qp, apc->num_queues, + GFP_KERNEL); if (!apc->tx_qp) return -ENOMEM; @@ -2640,8 +2637,7 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc, gc = gd->gdma_context; - rxq = kzalloc(struct_size(rxq, rx_oobs, apc->rx_queue_size), - GFP_KERNEL); + rxq = kzalloc_flex(*rxq, rx_oobs, apc->rx_queue_size, GFP_KERNEL); if (!rxq) return NULL; @@ -2856,7 +2852,8 @@ static int mana_rss_table_alloc(struct mana_port_context *apc) if (!apc->indir_table) return -ENOMEM; - apc->rxobj_table = kcalloc(apc->indir_table_sz, sizeof(mana_handle_t), GFP_KERNEL); + apc->rxobj_table = kzalloc_objs(mana_handle_t, apc->indir_table_sz, + GFP_KERNEL); if (!apc->rxobj_table) { kfree(apc->indir_table); return -ENOMEM; @@ -3418,7 +3415,7 @@ static int add_adev(struct gdma_dev *gd, const char *name) struct mana_adev *madev; int ret; - madev = kzalloc(sizeof(*madev), GFP_KERNEL); + madev = kzalloc_obj(*madev, GFP_KERNEL); if (!madev) return -ENOMEM; @@ -3511,7 +3508,7 @@ int mana_rdma_service_event(struct gdma_context *gc, enum gdma_service_type even return 0; } - serv_work = kzalloc(sizeof(*serv_work), GFP_ATOMIC); + serv_work = kzalloc_obj(*serv_work, GFP_ATOMIC); if (!serv_work) return -ENOMEM; @@ -3562,7 +3559,7 @@ int mana_probe(struct gdma_dev *gd, bool resuming) return err; if (!resuming) { - ac = kzalloc(sizeof(*ac), GFP_KERNEL); + ac = kzalloc_obj(*ac, GFP_KERNEL); if (!ac) return -ENOMEM; diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index c345d9b17c89..a572170506cb 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -576,7 +576,7 @@ static int ocelot_update_vlan_reclassify_rule(struct ocelot *ocelot, int port) } /* Filter doesn't exist, create it */ - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; @@ -682,7 +682,7 @@ static int ocelot_vlan_member_add(struct ocelot *ocelot, int port, u16 vid, return 0; } - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; @@ -1664,7 +1664,7 @@ int ocelot_trap_add(struct ocelot *ocelot, int port, trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie, false); if (!trap) { - trap = kzalloc(sizeof(*trap), GFP_KERNEL); + trap = kzalloc_obj(*trap, GFP_KERNEL); if (!trap) return -ENOMEM; @@ -2046,7 +2046,7 @@ static struct ocelot_pgid *ocelot_pgid_alloc(struct ocelot *ocelot, int index, { struct ocelot_pgid *pgid; - pgid = kzalloc(sizeof(*pgid), GFP_KERNEL); + pgid = kzalloc_obj(*pgid, GFP_KERNEL); if (!pgid) return ERR_PTR(-ENOMEM); @@ -2563,7 +2563,7 @@ int ocelot_lag_fdb_add(struct ocelot *ocelot, struct net_device *bond, struct ocelot_lag_fdb *fdb; int lag, err; - fdb = kzalloc(sizeof(*fdb), GFP_KERNEL); + fdb = kzalloc_obj(*fdb, GFP_KERNEL); if (!fdb) return -ENOMEM; @@ -2894,7 +2894,7 @@ struct ocelot_mirror *ocelot_mirror_get(struct ocelot *ocelot, int to, return m; } - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (!m) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c index 986b1f150e3b..4fccc8adad56 100644 --- a/drivers/net/ethernet/mscc/ocelot_flower.c +++ b/drivers/net/ethernet/mscc/ocelot_flower.c @@ -833,7 +833,7 @@ static struct ocelot_vcap_filter { struct ocelot_vcap_filter *filter; - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return NULL; diff --git a/drivers/net/ethernet/mscc/ocelot_mrp.c b/drivers/net/ethernet/mscc/ocelot_mrp.c index 3ccec488a304..04ae7a156f22 100644 --- a/drivers/net/ethernet/mscc/ocelot_mrp.c +++ b/drivers/net/ethernet/mscc/ocelot_mrp.c @@ -54,7 +54,7 @@ static int ocelot_mrp_redirect_add_vcap(struct ocelot *ocelot, int src_port, struct ocelot_vcap_filter *filter; int err; - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) return -ENOMEM; diff --git a/drivers/net/ethernet/mscc/ocelot_vcap.c b/drivers/net/ethernet/mscc/ocelot_vcap.c index 5734b86aed5b..ec193ed18050 100644 --- a/drivers/net/ethernet/mscc/ocelot_vcap.c +++ b/drivers/net/ethernet/mscc/ocelot_vcap.c @@ -910,7 +910,7 @@ int ocelot_vcap_policer_add(struct ocelot *ocelot, u32 pol_ix, return 0; } - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index d9b5d7999370..75ee09571af6 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -3703,8 +3703,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp) * slices. We give up on MSI-X if we can only get a single * vector. */ - mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors), - GFP_KERNEL); + mgp->msix_vectors = kzalloc_objs(*mgp->msix_vectors, mgp->num_slices, + GFP_KERNEL); if (mgp->msix_vectors == NULL) goto no_msix; for (i = 0; i < mgp->num_slices; i++) { diff --git a/drivers/net/ethernet/netronome/nfp/abm/cls.c b/drivers/net/ethernet/netronome/nfp/abm/cls.c index 23ebddfb9532..5cb4bb03b2a5 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/cls.c +++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c @@ -203,7 +203,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink, } if (!match) { - match = kzalloc(sizeof(*match), GFP_KERNEL); + match = kzalloc_obj(*match, GFP_KERNEL); if (!match) return -ENOMEM; list_add(&match->list, &alink->dscp_map); diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.c b/drivers/net/ethernet/netronome/nfp/abm/main.c index 5d3df28c648f..b4c85bb0f787 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/main.c +++ b/drivers/net/ethernet/netronome/nfp/abm/main.c @@ -317,7 +317,7 @@ nfp_abm_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id) struct nfp_abm_link *alink; int err; - alink = kzalloc(sizeof(*alink), GFP_KERNEL); + alink = kzalloc_obj(*alink, GFP_KERNEL); if (!alink) return -ENOMEM; nn->app_priv = alink; @@ -461,7 +461,7 @@ static int nfp_abm_init(struct nfp_app *app) return -EINVAL; } - abm = kzalloc(sizeof(*abm), GFP_KERNEL); + abm = kzalloc_obj(*abm, GFP_KERNEL); if (!abm) return -ENOMEM; app->priv = abm; diff --git a/drivers/net/ethernet/netronome/nfp/abm/qdisc.c b/drivers/net/ethernet/netronome/nfp/abm/qdisc.c index 2a5cc64227e9..a030b59901c9 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/qdisc.c +++ b/drivers/net/ethernet/netronome/nfp/abm/qdisc.c @@ -344,7 +344,7 @@ nfp_abm_qdisc_alloc(struct net_device *netdev, struct nfp_abm_link *alink, struct nfp_qdisc *qdisc; int err; - qdisc = kzalloc(sizeof(*qdisc), GFP_KERNEL); + qdisc = kzalloc_obj(*qdisc, GFP_KERNEL); if (!qdisc) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c index f469950c7265..d9591ca44a8f 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c @@ -76,7 +76,7 @@ nfp_bpf_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id) return -EINVAL; } - bv = kzalloc(sizeof(*bv), GFP_KERNEL); + bv = kzalloc_obj(*bv, GFP_KERNEL); if (!bv) return -ENOMEM; nn->app_priv = bv; @@ -458,7 +458,7 @@ static int nfp_bpf_init(struct nfp_app *app) struct nfp_app_bpf *bpf; int err; - bpf = kzalloc(sizeof(*bpf), GFP_KERNEL); + bpf = kzalloc_obj(*bpf, GFP_KERNEL); if (!bpf) return -ENOMEM; bpf->app = app; diff --git a/drivers/net/ethernet/netronome/nfp/bpf/offload.c b/drivers/net/ethernet/netronome/nfp/bpf/offload.c index c03558adda91..2b22725fb8a6 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/offload.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/offload.c @@ -48,7 +48,7 @@ nfp_map_ptr_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, */ bpf_map_inc(map); - record = kmalloc(sizeof(*record), GFP_KERNEL); + record = kmalloc_obj(*record, GFP_KERNEL); if (!record) { err = -ENOMEM; goto err_map_put; @@ -123,9 +123,8 @@ nfp_map_ptrs_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, if (!cnt) goto out; - nfp_prog->map_records = kmalloc_array(cnt, - sizeof(nfp_prog->map_records[0]), - GFP_KERNEL); + nfp_prog->map_records = kmalloc_objs(nfp_prog->map_records[0], cnt, + GFP_KERNEL); if (!nfp_prog->map_records) { err = -ENOMEM; goto out; @@ -155,7 +154,7 @@ nfp_prog_prepare(struct nfp_prog *nfp_prog, const struct bpf_insn *prog, unsigned int i; for (i = 0; i < cnt; i++) { - meta = kzalloc(sizeof(*meta), GFP_KERNEL); + meta = kzalloc_obj(*meta, GFP_KERNEL); if (!meta) return -ENOMEM; @@ -193,7 +192,7 @@ static int nfp_bpf_verifier_prep(struct bpf_prog *prog) struct nfp_prog *nfp_prog; int ret; - nfp_prog = kzalloc(sizeof(*nfp_prog), GFP_KERNEL); + nfp_prog = kzalloc_obj(*nfp_prog, GFP_KERNEL); if (!nfp_prog) return -ENOMEM; prog->aux->offload->dev_priv = nfp_prog; diff --git a/drivers/net/ethernet/netronome/nfp/bpf/verifier.c b/drivers/net/ethernet/netronome/nfp/bpf/verifier.c index 9d235c0ce46a..de9508282841 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/verifier.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/verifier.c @@ -770,8 +770,8 @@ int nfp_bpf_finalize(struct bpf_verifier_env *env) nfp_prog = env->prog->aux->offload->dev_priv; nfp_prog->subprog_cnt = env->subprog_cnt; - nfp_prog->subprog = kcalloc(nfp_prog->subprog_cnt, - sizeof(nfp_prog->subprog[0]), GFP_KERNEL); + nfp_prog->subprog = kzalloc_objs(nfp_prog->subprog[0], + nfp_prog->subprog_cnt, GFP_KERNEL); if (!nfp_prog->subprog) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index 15180538b80a..178184a68816 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -1355,7 +1355,7 @@ nfp_fl_ct_zone_entry *get_nfp_zone_entry(struct nfp_flower_priv *priv, if (IS_ERR(zt) || zt->priv) return zt; } else { - zt = kzalloc(sizeof(*zt), GFP_KERNEL); + zt = kzalloc_obj(*zt, GFP_KERNEL); if (!zt) return ERR_PTR(-ENOMEM); } @@ -1487,7 +1487,7 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_action_entry *act; int err, i; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -1501,7 +1501,7 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, * to do a full copy instead of just a reference. */ if (is_nft) { - nft_match = kzalloc(sizeof(*nft_match), GFP_KERNEL); + nft_match = kzalloc_obj(*nft_match, GFP_KERNEL); if (!nft_match) { err = -ENOMEM; goto err_pre_ct_act; diff --git a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c index 2c7bd6e80d99..9b78cc9600fe 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c @@ -119,7 +119,7 @@ nfp_fl_lag_group_create(struct nfp_fl_lag *lag, struct net_device *master) return ERR_PTR(id); } - group = kmalloc(sizeof(*group), GFP_KERNEL); + group = kmalloc_obj(*group, GFP_KERNEL); if (!group) { ida_free(&lag->ida_handle, id); return ERR_PTR(-ENOMEM); @@ -335,8 +335,8 @@ static void nfp_fl_lag_do_work(struct work_struct *work) continue; } - acti_netdevs = kmalloc_array(entry->slave_cnt, - sizeof(*acti_netdevs), GFP_KERNEL); + acti_netdevs = kmalloc_objs(*acti_netdevs, entry->slave_cnt, + GFP_KERNEL); if (!acti_netdevs) { schedule_delayed_work(&lag->work, NFP_FL_LAG_DELAY); diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c index 83eaa5ae3cd4..4677183322bc 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c @@ -182,7 +182,7 @@ nfp_flower_non_repr_priv_get(struct nfp_app *app, struct net_device *netdev) if (entry) goto inc_ref; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -406,7 +406,7 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app, goto err_reprs_clean; } - repr_priv = kzalloc(sizeof(*repr_priv), GFP_KERNEL); + repr_priv = kzalloc_obj(*repr_priv, GFP_KERNEL); if (!repr_priv) { err = -ENOMEM; nfp_repr_free(repr); @@ -524,7 +524,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv) goto err_reprs_clean; } - repr_priv = kzalloc(sizeof(*repr_priv), GFP_KERNEL); + repr_priv = kzalloc_obj(*repr_priv, GFP_KERNEL); if (!repr_priv) { err = -ENOMEM; nfp_repr_free(repr); diff --git a/drivers/net/ethernet/netronome/nfp/flower/metadata.c b/drivers/net/ethernet/netronome/nfp/flower/metadata.c index dde60c4572fa..fbb858a5324b 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/metadata.c +++ b/drivers/net/ethernet/netronome/nfp/flower/metadata.c @@ -214,7 +214,7 @@ nfp_add_mask_table(struct nfp_app *app, char *mask_data, u32 mask_len) if (nfp_mask_alloc(app, &mask_id)) return -ENOENT; - mask_entry = kmalloc(sizeof(*mask_entry), GFP_KERNEL); + mask_entry = kmalloc_obj(*mask_entry, GFP_KERNEL); if (!mask_entry) { nfp_release_mask_id(app, mask_id); return -ENOMEM; @@ -324,7 +324,7 @@ int nfp_compile_flow_metadata(struct nfp_app *app, u32 cookie, nfp_flow->meta.host_cookie = cpu_to_be64(cookie); nfp_flow->ingress_dev = netdev; - ctx_entry = kzalloc(sizeof(*ctx_entry), GFP_KERNEL); + ctx_entry = kzalloc_obj(*ctx_entry, GFP_KERNEL); if (!ctx_entry) { err = -ENOMEM; goto err_release_stats; @@ -557,8 +557,8 @@ int nfp_flower_metadata_init(struct nfp_app *app, u64 host_ctx_count, /* Init timestamps for mask id*/ priv->mask_ids.last_used = - kmalloc_array(NFP_FLOWER_MASK_ENTRY_RS, - sizeof(*priv->mask_ids.last_used), GFP_KERNEL); + kmalloc_objs(*priv->mask_ids.last_used, + NFP_FLOWER_MASK_ENTRY_RS, GFP_KERNEL); if (!priv->mask_ids.last_used) goto err_free_mask_id; @@ -573,8 +573,7 @@ int nfp_flower_metadata_init(struct nfp_app *app, u64 host_ctx_count, stats_size = FIELD_PREP(NFP_FL_STAT_ID_STAT, host_ctx_count) | FIELD_PREP(NFP_FL_STAT_ID_MU_NUM, host_num_mems - 1); - priv->stats = kvmalloc_array(stats_size, sizeof(struct nfp_fl_stats), - GFP_KERNEL); + priv->stats = kvmalloc_objs(struct nfp_fl_stats, stats_size, GFP_KERNEL); if (!priv->stats) goto err_free_ring_buf; diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 46ffc2c20893..b6e1e33d3f27 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -549,7 +549,7 @@ nfp_flower_allocate_new(struct nfp_fl_key_ls *key_layer) { struct nfp_fl_payload *flow_pay; - flow_pay = kmalloc(sizeof(*flow_pay), GFP_KERNEL); + flow_pay = kmalloc_obj(*flow_pay, GFP_KERNEL); if (!flow_pay) return NULL; @@ -979,7 +979,7 @@ static int nfp_flower_link_flows(struct nfp_fl_payload *merge_flow, { struct nfp_fl_payload_link *link; - link = kmalloc(sizeof(*link), GFP_KERNEL); + link = kmalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; @@ -1067,7 +1067,7 @@ int nfp_flower_merge_offloaded_flows(struct nfp_app *app, if (err) goto err_release_metadata; - merge_info = kmalloc(sizeof(*merge_info), GFP_KERNEL); + merge_info = kmalloc_obj(*merge_info, GFP_KERNEL); if (!merge_info) { err = -ENOMEM; goto err_remove_rhash; @@ -1354,7 +1354,7 @@ nfp_flower_add_offload(struct nfp_app *app, struct net_device *netdev, if (!offload_pre_check(flow)) return -EOPNOTSUPP; - key_layer = kmalloc(sizeof(*key_layer), GFP_KERNEL); + key_layer = kmalloc_obj(*key_layer, GFP_KERNEL); if (!key_layer) return -ENOMEM; @@ -1400,7 +1400,7 @@ nfp_flower_add_offload(struct nfp_app *app, struct net_device *netdev, if (priv->flower_ext_feats & NFP_FL_FEATS_DECAP_V2) { struct nfp_predt_entry *predt; - predt = kzalloc(sizeof(*predt), GFP_KERNEL); + predt = kzalloc_obj(*predt, GFP_KERNEL); if (!predt) { err = -ENOMEM; goto err_remove_rhash; @@ -1901,7 +1901,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct Qdisc *sch, str &nfp_block_cb_list)) return -EBUSY; - cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL); + cb_priv = kmalloc_obj(*cb_priv, GFP_KERNEL); if (!cb_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c b/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c index e7180b4793c7..6a7f806b3fdf 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c @@ -579,7 +579,7 @@ nfp_flower_add_meter_entry(struct nfp_app *app, u32 meter_id) if (meter_entry) return meter_entry; - meter_entry = kzalloc(sizeof(*meter_entry), GFP_KERNEL); + meter_entry = kzalloc_obj(*meter_entry, GFP_KERNEL); if (!meter_entry) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c index 0d7d138d6e0d..e0d32ddc80c3 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -696,7 +696,7 @@ nfp_tun_alloc_neigh_update_work(struct nfp_app *app, struct neighbour *n) { struct nfp_neigh_update_work *update_work; - update_work = kzalloc(sizeof(*update_work), GFP_ATOMIC); + update_work = kzalloc_obj(*update_work, GFP_ATOMIC); if (!update_work) return NULL; @@ -884,7 +884,7 @@ void nfp_tunnel_add_ipv4_off(struct nfp_app *app, __be32 ipv4) } } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { mutex_unlock(&priv->tun.ipv4_off_lock); nfp_flower_cmsg_warn(app, "Mem error when offloading IP address.\n"); @@ -959,7 +959,7 @@ nfp_tunnel_add_ipv6_off(struct nfp_app *app, struct in6_addr *ipv6) return entry; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { mutex_unlock(&priv->tun.ipv6_off_lock); nfp_flower_cmsg_warn(app, "Mem error when offloading IP address.\n"); @@ -1117,7 +1117,7 @@ nfp_tunnel_add_shared_mac(struct nfp_app *app, struct net_device *netdev, } if (!entry) { - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto err_free_ida; diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/rings.c b/drivers/net/ethernet/netronome/nfp/nfd3/rings.c index a03190c9313c..480b644afed5 100644 --- a/drivers/net/ethernet/netronome/nfp/nfd3/rings.c +++ b/drivers/net/ethernet/netronome/nfp/nfd3/rings.c @@ -140,8 +140,8 @@ nfp_nfd3_tx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring) goto err_alloc; } - tx_ring->txbufs = kvcalloc(tx_ring->cnt, sizeof(*tx_ring->txbufs), - GFP_KERNEL); + tx_ring->txbufs = kvzalloc_objs(*tx_ring->txbufs, tx_ring->cnt, + GFP_KERNEL); if (!tx_ring->txbufs) goto err_alloc; diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/rings.c b/drivers/net/ethernet/netronome/nfp/nfdk/rings.c index fdb8144a63e0..c0905469911c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfdk/rings.c +++ b/drivers/net/ethernet/netronome/nfp/nfdk/rings.c @@ -105,8 +105,8 @@ nfp_nfdk_tx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring) goto err_alloc; } - tx_ring->ktxbufs = kvcalloc(tx_ring->cnt, sizeof(*tx_ring->ktxbufs), - GFP_KERNEL); + tx_ring->ktxbufs = kvzalloc_objs(*tx_ring->ktxbufs, tx_ring->cnt, + GFP_KERNEL); if (!tx_ring->ktxbufs) goto err_alloc; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_app.c b/drivers/net/ethernet/netronome/nfp/nfp_app.c index bb3f46c74f77..f53418136c37 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_app.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_app.c @@ -239,7 +239,7 @@ struct nfp_app *nfp_app_alloc(struct nfp_pf *pf, enum nfp_app_id id) if (WARN_ON(!apps[id]->ctrl_msg_rx && apps[id]->ctrl_msg_rx_raw)) return ERR_PTR(-EINVAL); - app = kzalloc(sizeof(*app), GFP_KERNEL); + app = kzalloc_obj(*app, GFP_KERNEL); if (!app) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 9ef72f294117..bebf7e7c4a86 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -1554,7 +1554,7 @@ struct nfp_net_dp *nfp_net_clone_dp(struct nfp_net *nn) { struct nfp_net_dp *new; - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; @@ -2537,8 +2537,8 @@ nfp_net_alloc(struct pci_dev *pdev, const struct nfp_dev_info *dev_info, nn->dp.num_r_vecs, num_online_cpus()); nn->max_r_vecs = nn->dp.num_r_vecs; - nn->dp.xsk_pools = kcalloc(nn->max_r_vecs, sizeof(*nn->dp.xsk_pools), - GFP_KERNEL); + nn->dp.xsk_pools = kzalloc_objs(*nn->dp.xsk_pools, nn->max_r_vecs, + GFP_KERNEL); if (!nn->dp.xsk_pools) { err = -ENOMEM; goto err_free_nn; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c b/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c index 550df83b798c..cbb983729f22 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c @@ -184,8 +184,7 @@ int nfp_net_tx_rings_prepare(struct nfp_net *nn, struct nfp_net_dp *dp) { unsigned int r; - dp->tx_rings = kcalloc(dp->num_tx_rings, sizeof(*dp->tx_rings), - GFP_KERNEL); + dp->tx_rings = kzalloc_objs(*dp->tx_rings, dp->num_tx_rings, GFP_KERNEL); if (!dp->tx_rings) return -ENOMEM; @@ -340,8 +339,7 @@ int nfp_net_rx_rings_prepare(struct nfp_net *nn, struct nfp_net_dp *dp) { unsigned int r; - dp->rx_rings = kcalloc(dp->num_rx_rings, sizeof(*dp->rx_rings), - GFP_KERNEL); + dp->rx_rings = kzalloc_objs(*dp->rx_rings, dp->num_rx_rings, GFP_KERNEL); if (!dp->rx_rings) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c index e88b1c4732a5..16bf77708b9e 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -713,7 +713,7 @@ static int nfp_test_nsp(struct net_device *netdev) goto exit_close_nsp; } - nspi = kzalloc(sizeof(*nspi), GFP_KERNEL); + nspi = kzalloc_obj(*nspi, GFP_KERNEL); if (!nspi) { err = -ENOMEM; goto exit_close_nsp; @@ -1676,7 +1676,7 @@ static int nfp_net_fs_add(struct nfp_net *nn, struct ethtool_rxnfc *cmd) if (unsupp_mask) return -EOPNOTSUPP; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index cbe4972ba104..aeaa998e2f75 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -229,8 +229,8 @@ static int nfp_net_pf_alloc_irqs(struct nfp_pf *pf) wanted_irqs = 0; list_for_each_entry(nn, &pf->vnics, vnic_list) wanted_irqs += NFP_NET_NON_Q_VECTORS + nn->dp.num_r_vecs; - pf->irq_entries = kcalloc(wanted_irqs, sizeof(*pf->irq_entries), - GFP_KERNEL); + pf->irq_entries = kzalloc_objs(*pf->irq_entries, wanted_irqs, + GFP_KERNEL); if (!pf->irq_entries) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index 227e7a5d712e..bac4c61f8632 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -500,7 +500,7 @@ struct nfp_reprs *nfp_reprs_alloc(unsigned int num_reprs) { struct nfp_reprs *reprs; - reprs = kzalloc(struct_size(reprs, reprs, num_reprs), GFP_KERNEL); + reprs = kzalloc_flex(*reprs, reprs, num_reprs, GFP_KERNEL); if (!reprs) return NULL; reprs->num_reprs = num_reprs; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index e19bb0150cb5..061d1ba89760 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -93,7 +93,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, dev_info = &nfp_dev_info[pci_id->driver_data]; - vf = kzalloc(sizeof(*vf), GFP_KERNEL); + vf = kzalloc_obj(*vf, GFP_KERNEL); if (!vf) return -ENOMEM; pci_set_drvdata(pdev, vf); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c index 54640bcb70fb..1ce12ad44d2f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_port.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c @@ -203,7 +203,7 @@ nfp_port_alloc(struct nfp_app *app, enum nfp_port_type type, { struct nfp_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_shared_buf.c b/drivers/net/ethernet/netronome/nfp/nfp_shared_buf.c index ea2e3f829aba..eb5f9c2bf445 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_shared_buf.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_shared_buf.c @@ -99,8 +99,8 @@ int nfp_shared_buf_register(struct nfp_pf *pf) entry_sz = nfp_cpp_area_size(sb_desc_area) / num_entries; - pf->shared_bufs = kmalloc_array(num_entries, sizeof(pf->shared_bufs[0]), - GFP_KERNEL); + pf->shared_bufs = kmalloc_objs(pf->shared_bufs[0], num_entries, + GFP_KERNEL); if (!pf->shared_bufs) { err = -ENOMEM; goto err_release_area; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c index 7c2200b49ce4..ff16af23fc3a 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c @@ -1320,7 +1320,7 @@ nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev, const struct nfp_dev_info *dev_i dev_info->chip_names); pcie_print_link_status(pdev); - nfp = kzalloc(sizeof(*nfp), GFP_KERNEL); + nfp = kzalloc_obj(*nfp, GFP_KERNEL); if (!nfp) { err = -ENOMEM; goto err_ret; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c index 669f9f8fb507..06ebad34c00b 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c @@ -802,7 +802,7 @@ int nfp_cpp_area_cache_add(struct nfp_cpp *cpp, size_t size) if (!area) return -ENOMEM; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); if (!cache) { nfp_cpp_area_free(area); return -ENOMEM; @@ -1170,7 +1170,7 @@ nfp_cpp_from_operations(const struct nfp_cpp_operations *ops, u32 xpbaddr; size_t tgt; - cpp = kzalloc(sizeof(*cpp), GFP_KERNEL); + cpp = kzalloc_obj(*cpp, GFP_KERNEL); if (!cpp) { err = -ENOMEM; goto err_malloc; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c index 79e17943519e..93b11eaf7d9f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c @@ -101,7 +101,7 @@ const struct nfp_mip *nfp_mip_open(struct nfp_cpp *cpp) struct nfp_mip *mip; int err; - mip = kmalloc(sizeof(*mip), GFP_KERNEL); + mip = kmalloc_obj(*mip, GFP_KERNEL); if (!mip) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c index 7bc17b94ac60..d017b7779819 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c @@ -140,7 +140,7 @@ struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target, if (tmp != key) return NULL; - mutex = kzalloc(sizeof(*mutex), GFP_KERNEL); + mutex = kzalloc_obj(*mutex, GFP_KERNEL); if (!mutex) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c index e2e5fd003ad6..4ad0f7586ba1 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c @@ -163,7 +163,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) u32 info_ver; int err; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c index 0bd6477292a6..a874a5f233a6 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c @@ -280,7 +280,7 @@ struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp) if (IS_ERR(res)) return ERR_CAST(res); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { nfp_resource_release(res); return ERR_PTR(-ENOMEM); @@ -514,7 +514,7 @@ nfp_nsp_command_buf_dma_sg(struct nfp_nsp *nsp, dma_size = BIT_ULL(dma_order); nseg = DIV_ROUND_UP(max_size, chunk_size); - chunks = kcalloc(nseg, sizeof(*chunks), GFP_KERNEL); + chunks = kzalloc_objs(*chunks, nseg, GFP_KERNEL); if (!chunks) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c index 0997d127144f..33ff357b6fc6 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c @@ -29,7 +29,7 @@ struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp) if (nfp_nsp_get_abi_ver_minor(nsp) < 15) return NULL; - ni = kzalloc(sizeof(*ni), GFP_KERNEL); + ni = kzalloc_obj(*ni, GFP_KERNEL); if (!ni) return NULL; @@ -40,7 +40,7 @@ struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp) goto exit_free; } - nspi = kzalloc(sizeof(*nspi), GFP_KERNEL); + nspi = kzalloc_obj(*nspi, GFP_KERNEL); if (!nspi) goto exit_free; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c index 5cfddc9a5d87..9a1f1849e0db 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c @@ -319,7 +319,7 @@ __nfp_eth_read_ports(struct nfp_cpp *cpp, struct nfp_nsp *nsp) goto err; } - table = kzalloc(struct_size(table, ports, cnt), GFP_KERNEL); + table = kzalloc_flex(*table, ports, cnt, GFP_KERNEL); if (!table) goto err; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c index 279ea0b56955..54089663bbd7 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c @@ -155,7 +155,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name) struct nfp_resource *res; int err; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nic/main.c b/drivers/net/ethernet/netronome/nfp/nic/main.c index 9dd5afe37f6e..82ec6d9018b0 100644 --- a/drivers/net/ethernet/netronome/nfp/nic/main.c +++ b/drivers/net/ethernet/netronome/nfp/nic/main.c @@ -51,7 +51,7 @@ static int nfp_nic_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, return err; if (sizeof(*app_pri)) { - nn->app_priv = kzalloc(sizeof(*app_pri), GFP_KERNEL); + nn->app_priv = kzalloc_obj(*app_pri, GFP_KERNEL); if (!nn->app_priv) return -ENOMEM; } diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 19aa1f1538aa..bff27b223f5d 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -5854,8 +5854,10 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) goto out_unmap; np->tx_ring.ex = &np->rx_ring.ex[np->rx_ring_size]; } - np->rx_skb = kcalloc(np->rx_ring_size, sizeof(struct nv_skb_map), GFP_KERNEL); - np->tx_skb = kcalloc(np->tx_ring_size, sizeof(struct nv_skb_map), GFP_KERNEL); + np->rx_skb = kzalloc_objs(struct nv_skb_map, np->rx_ring_size, + GFP_KERNEL); + np->tx_skb = kzalloc_objs(struct nv_skb_map, np->tx_ring_size, + GFP_KERNEL); if (!np->rx_skb || !np->tx_skb) goto out_freering; diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index 00909372ea61..f9a6471b36d0 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -381,9 +381,8 @@ static int pasemi_mac_setup_rx_resources(const struct net_device *dev) spin_lock_init(&ring->lock); ring->size = RX_RING_SIZE; - ring->ring_info = kcalloc(RX_RING_SIZE, - sizeof(struct pasemi_mac_buffer), - GFP_KERNEL); + ring->ring_info = kzalloc_objs(struct pasemi_mac_buffer, RX_RING_SIZE, + GFP_KERNEL); if (!ring->ring_info) goto out_ring_info; @@ -465,9 +464,8 @@ pasemi_mac_setup_tx_resources(const struct net_device *dev) spin_lock_init(&ring->lock); ring->size = TX_RING_SIZE; - ring->ring_info = kcalloc(TX_RING_SIZE, - sizeof(struct pasemi_mac_buffer), - GFP_KERNEL); + ring->ring_info = kzalloc_objs(struct pasemi_mac_buffer, TX_RING_SIZE, + GFP_KERNEL); if (!ring->ring_info) goto out_ring_info; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_aux.c b/drivers/net/ethernet/pensando/ionic/ionic_aux.c index a2be338eb3e5..4c9db73cef23 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_aux.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_aux.c @@ -26,7 +26,7 @@ int ionic_auxbus_register(struct ionic_lif *lif) if (!(le64_to_cpu(lif->ionic->ident.lif.capabilities) & IONIC_LIF_CAP_RDMA)) return 0; - ionic_adev = kzalloc(sizeof(*ionic_adev), GFP_KERNEL); + ionic_adev = kzalloc_obj(*ionic_adev, GFP_KERNEL); if (!ionic_adev) return -ENOMEM; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 0671deae9a28..104e1d35e0be 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -151,7 +151,7 @@ static int ionic_vf_alloc(struct ionic *ionic, int num_vfs) down_write(&ionic->vf_op_lock); - ionic->vfs = kcalloc(num_vfs, sizeof(struct ionic_vf), GFP_KERNEL); + ionic->vfs = kzalloc_objs(struct ionic_vf, num_vfs, GFP_KERNEL); if (!ionic->vfs) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index ab27e9225c1e..3838c4a70766 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -35,7 +35,7 @@ static void ionic_watchdog_cb(struct timer_list *t) if (test_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state) && !test_bit(IONIC_LIF_F_FW_RESET, lif->state)) { - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { netdev_err(lif->netdev, "rxmode change dropped\n"); return; @@ -577,7 +577,7 @@ do_check_time: if (trigger) { struct ionic_deferred_work *work; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (work) { work->type = IONIC_DW_TYPE_LIF_RESET; work->fw_status = fw_status_ready; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 058eea86e141..050dd3168f6b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -203,7 +203,7 @@ void ionic_link_status_check_request(struct ionic_lif *lif, bool can_sleep) return; if (!can_sleep) { - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { clear_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state); return; @@ -1427,7 +1427,7 @@ static void ionic_ndo_set_rx_mode(struct net_device *netdev) /* Shove off the rest of the rxmode work to the work task * which will include syncing the filters to the firmware. */ - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { netdev_err(lif->netdev, "rxmode change dropped\n"); return; @@ -2694,7 +2694,7 @@ static int ionic_register_rxq_info(struct ionic_queue *q, unsigned int napi_id) struct xdp_rxq_info *rxq_info; int err; - rxq_info = kzalloc(sizeof(*rxq_info), GFP_KERNEL); + rxq_info = kzalloc_obj(*rxq_info, GFP_KERNEL); if (!rxq_info) return -ENOMEM; @@ -3177,7 +3177,7 @@ static int ionic_affinity_masks_alloc(struct ionic *ionic) int nintrs = ionic->nintrs; int i; - affinity_masks = kcalloc(nintrs, sizeof(cpumask_var_t), GFP_KERNEL); + affinity_masks = kzalloc_objs(cpumask_var_t, nintrs, GFP_KERNEL); if (!affinity_masks) return -ENOMEM; @@ -3218,7 +3218,7 @@ int ionic_lif_alloc(struct ionic *ionic) int tbl_sz; int err; - lid = kzalloc(sizeof(*lid), GFP_KERNEL); + lid = kzalloc_obj(*lid, GFP_KERNEL); if (!lid) return -ENOMEM; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 14dc055be3e9..3c5200e2fdb7 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -283,7 +283,7 @@ bool ionic_notifyq_service(struct ionic_cq *cq) if (lif->ionic->idev.fw_status_ready && !test_bit(IONIC_LIF_F_FW_RESET, lif->state) && !test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) { - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { netdev_err(lif->netdev, "Reset event dropped\n"); clear_bit(IONIC_LIF_F_FW_STOPPING, lif->state); diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c index 89c8b2349694..fff8dc84212d 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c @@ -634,7 +634,7 @@ static int nx_p3_nic_add_mac(struct netxen_adapter *adapter, } } - cur = kzalloc(sizeof(nx_mac_list_t), GFP_ATOMIC); + cur = kzalloc_obj(nx_mac_list_t, GFP_ATOMIC); if (cur == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index 51fa880eaf6c..a0466693e2d9 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c @@ -185,7 +185,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) struct netxen_cmd_buffer *cmd_buf_arr; struct net_device *netdev = adapter->netdev; - tx_ring = kzalloc(sizeof(struct nx_host_tx_ring), GFP_KERNEL); + tx_ring = kzalloc_obj(struct nx_host_tx_ring, GFP_KERNEL); if (tx_ring == NULL) return -ENOMEM; @@ -202,8 +202,8 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) recv_ctx = &adapter->recv_ctx; - rds_ring = kcalloc(adapter->max_rds_rings, - sizeof(struct nx_host_rds_ring), GFP_KERNEL); + rds_ring = kzalloc_objs(struct nx_host_rds_ring, adapter->max_rds_rings, + GFP_KERNEL); if (rds_ring == NULL) goto err_out; @@ -451,7 +451,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter) return -EIO; } - buf = kcalloc(n, sizeof(struct crb_addr_pair), GFP_KERNEL); + buf = kzalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); if (buf == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index e8ff661fa4a5..5ee2bd9d6886 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c @@ -3198,7 +3198,7 @@ netxen_list_config_ip(struct netxen_adapter *adapter, goto out; } - cur = kzalloc(sizeof(struct nx_ip_list), GFP_ATOMIC); + cur = kzalloc_obj(struct nx_ip_list, GFP_ATOMIC); if (cur == NULL) goto out; if (is_vlan_dev(dev)) diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index 33f4f58ee51c..ddc1f9213a95 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c +++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c @@ -845,8 +845,8 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn) p_t2->num_pages = DIV_ROUND_UP(total_size, psz); /* allocate t2 */ - p_t2->dma_mem = kcalloc(p_t2->num_pages, sizeof(struct phys_mem_desc), - GFP_KERNEL); + p_t2->dma_mem = kzalloc_objs(struct phys_mem_desc, p_t2->num_pages, + GFP_KERNEL); if (!p_t2->dma_mem) { DP_NOTICE(p_hwfn, "Failed to allocate t2 table\n"); rc = -ENOMEM; @@ -994,8 +994,8 @@ static int qed_ilt_shadow_alloc(struct qed_hwfn *p_hwfn) int rc; size = qed_cxt_ilt_shadow_size(clients); - p_mngr->ilt_shadow = kcalloc(size, sizeof(struct phys_mem_desc), - GFP_KERNEL); + p_mngr->ilt_shadow = kzalloc_objs(struct phys_mem_desc, size, + GFP_KERNEL); if (!p_mngr->ilt_shadow) { rc = -ENOMEM; goto ilt_shadow_fail; @@ -1114,7 +1114,7 @@ int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn) struct qed_cxt_mngr *p_mngr; u32 i; - p_mngr = kzalloc(sizeof(*p_mngr), GFP_KERNEL); + p_mngr = kzalloc_obj(*p_mngr, GFP_KERNEL); if (!p_mngr) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index dc93ddea8906..593931ec7226 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -915,7 +915,7 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn, int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn) { - p_hwfn->p_dcbx_info = kzalloc(sizeof(*p_hwfn->p_dcbx_info), GFP_KERNEL); + p_hwfn->p_dcbx_info = kzalloc_obj(*p_hwfn->p_dcbx_info, GFP_KERNEL); if (!p_hwfn->p_dcbx_info) return -ENOMEM; @@ -1244,7 +1244,7 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn, return 0; } - dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL); + dcbx_info = kzalloc_obj(*dcbx_info, GFP_KERNEL); if (!dcbx_info) return -ENOMEM; @@ -1283,7 +1283,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn, { struct qed_dcbx_get *dcbx_info; - dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_ATOMIC); + dcbx_info = kzalloc_obj(*dcbx_info, GFP_ATOMIC); if (!dcbx_info) return NULL; diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c index 1f0cea3cae92..a869a2a7e918 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -6821,9 +6821,8 @@ qed_mcp_trace_alloc_meta_data(struct qed_hwfn *p_hwfn, /* Read number of formats and allocate memory for all formats */ meta->formats_num = qed_read_dword_from_buf(meta_buf_bytes, &offset); - meta->formats = kcalloc(meta->formats_num, - sizeof(struct mcp_trace_format), - GFP_KERNEL); + meta->formats = kzalloc_objs(struct mcp_trace_format, meta->formats_num, + GFP_KERNEL); if (!meta->formats) return DBG_STATUS_VIRT_MEM_ALLOC_FAILED; @@ -7536,8 +7535,7 @@ enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn, enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn, void **user_data_ptr) { - *user_data_ptr = kzalloc(sizeof(struct dbg_tools_user_data), - GFP_KERNEL); + *user_data_ptr = kzalloc_obj(struct dbg_tools_user_data, GFP_KERNEL); if (!(*user_data_ptr)) return DBG_STATUS_VIRT_MEM_ALLOC_FAILED; diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index f3d2b2b3bad5..4c2027972347 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -146,7 +146,7 @@ int qed_db_recovery_add(struct qed_dev *cdev, p_hwfn = qed_db_rec_find_hwfn(cdev, db_addr); /* Create entry */ - db_entry = kzalloc(sizeof(*db_entry), GFP_KERNEL); + db_entry = kzalloc_obj(*db_entry, GFP_KERNEL); if (!db_entry) { DP_NOTICE(cdev, "Failed to allocate a db recovery entry\n"); return -ENOMEM; @@ -383,7 +383,7 @@ static int qed_llh_alloc(struct qed_dev *cdev) struct qed_llh_info *p_llh_info; u32 size, i; - p_llh_info = kzalloc(sizeof(*p_llh_info), GFP_KERNEL); + p_llh_info = kzalloc_obj(*p_llh_info, GFP_KERNEL); if (!p_llh_info) return -ENOMEM; cdev->p_llh_info = p_llh_info; @@ -2108,27 +2108,27 @@ static int qed_alloc_qm_data(struct qed_hwfn *p_hwfn) if (rc) goto alloc_err; - qm_info->qm_pq_params = kcalloc(qed_init_qm_get_num_pqs(p_hwfn), - sizeof(*qm_info->qm_pq_params), - GFP_KERNEL); + qm_info->qm_pq_params = kzalloc_objs(*qm_info->qm_pq_params, + qed_init_qm_get_num_pqs(p_hwfn), + GFP_KERNEL); if (!qm_info->qm_pq_params) goto alloc_err; - qm_info->qm_vport_params = kcalloc(qed_init_qm_get_num_vports(p_hwfn), - sizeof(*qm_info->qm_vport_params), - GFP_KERNEL); + qm_info->qm_vport_params = kzalloc_objs(*qm_info->qm_vport_params, + qed_init_qm_get_num_vports(p_hwfn), + GFP_KERNEL); if (!qm_info->qm_vport_params) goto alloc_err; - qm_info->qm_port_params = kcalloc(p_hwfn->cdev->num_ports_in_engine, - sizeof(*qm_info->qm_port_params), - GFP_KERNEL); + qm_info->qm_port_params = kzalloc_objs(*qm_info->qm_port_params, + p_hwfn->cdev->num_ports_in_engine, + GFP_KERNEL); if (!qm_info->qm_port_params) goto alloc_err; - qm_info->wfq_data = kcalloc(qed_init_qm_get_num_vports(p_hwfn), - sizeof(*qm_info->wfq_data), - GFP_KERNEL); + qm_info->wfq_data = kzalloc_objs(*qm_info->wfq_data, + qed_init_qm_get_num_vports(p_hwfn), + GFP_KERNEL); if (!qm_info->wfq_data) goto alloc_err; @@ -2155,7 +2155,7 @@ int qed_resc_alloc(struct qed_dev *cdev) return rc; } - cdev->fw_data = kzalloc(sizeof(*cdev->fw_data), GFP_KERNEL); + cdev->fw_data = kzalloc_obj(*cdev->fw_data, GFP_KERNEL); if (!cdev->fw_data) return -ENOMEM; @@ -2345,7 +2345,7 @@ int qed_resc_alloc(struct qed_dev *cdev) goto alloc_err; } - cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL); + cdev->reset_stats = kzalloc_obj(*cdev->reset_stats, GFP_KERNEL); if (!cdev->reset_stats) goto alloc_no_mem; @@ -2642,7 +2642,7 @@ static int qed_hw_init_common(struct qed_hwfn *p_hwfn, u32 concrete_fid; int rc = 0; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) { DP_NOTICE(p_hwfn->cdev, "Failed to allocate common init params\n"); diff --git a/drivers/net/ethernet/qlogic/qed/qed_fcoe.c b/drivers/net/ethernet/qlogic/qed/qed_fcoe.c index 04602ac94708..9d91e4775b52 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_fcoe.c +++ b/drivers/net/ethernet/qlogic/qed/qed_fcoe.c @@ -383,7 +383,7 @@ qed_fcoe_allocate_connection(struct qed_hwfn *p_hwfn, } spin_unlock_bh(&p_hwfn->p_fcoe_info->lock); - p_conn = kzalloc(sizeof(*p_conn), GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); if (!p_conn) return -ENOMEM; @@ -535,7 +535,7 @@ int qed_fcoe_alloc(struct qed_hwfn *p_hwfn) struct qed_fcoe_info *p_fcoe_info; /* Allocate LL2's set struct */ - p_fcoe_info = kzalloc(sizeof(*p_fcoe_info), GFP_KERNEL); + p_fcoe_info = kzalloc_obj(*p_fcoe_info, GFP_KERNEL); if (!p_fcoe_info) { DP_NOTICE(p_hwfn, "Failed to allocate qed_fcoe_info'\n"); return -ENOMEM; @@ -817,8 +817,8 @@ static int qed_fcoe_start(struct qed_dev *cdev, struct qed_fcoe_tid *tasks) hash_init(cdev->connections); if (tasks) { - struct qed_tid_mem *tid_info = kzalloc(sizeof(*tid_info), - GFP_ATOMIC); + struct qed_tid_mem *tid_info = kzalloc_obj(*tid_info, + GFP_ATOMIC); if (!tid_info) { DP_NOTICE(cdev, @@ -855,7 +855,7 @@ static int qed_fcoe_acquire_conn(struct qed_dev *cdev, int rc; /* Allocate a hashed connection */ - hash_con = kzalloc(sizeof(*hash_con), GFP_KERNEL); + hash_con = kzalloc_obj(*hash_con, GFP_KERNEL); if (!hash_con) { DP_NOTICE(cdev, "Failed to allocate hashed connection\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_hw.c b/drivers/net/ethernet/qlogic/qed/qed_hw.c index 9907973399dc..6fff9788101c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_hw.c +++ b/drivers/net/ethernet/qlogic/qed/qed_hw.c @@ -46,7 +46,7 @@ struct qed_ptt_pool { int qed_ptt_pool_alloc(struct qed_hwfn *p_hwfn) { - struct qed_ptt_pool *p_pool = kmalloc(sizeof(*p_pool), GFP_KERNEL); + struct qed_ptt_pool *p_pool = kmalloc_obj(*p_pool, GFP_KERNEL); int i; if (!p_pool) diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c b/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c index aa20bb8caa9a..9b7b05362c68 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c +++ b/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c @@ -1692,8 +1692,8 @@ struct phys_mem_desc *qed_fw_overlay_mem_alloc(struct qed_hwfn *p_hwfn, if (!buf_size) return NULL; - allocated_mem = kcalloc(NUM_STORMS, sizeof(struct phys_mem_desc), - GFP_KERNEL); + allocated_mem = kzalloc_objs(struct phys_mem_desc, NUM_STORMS, + GFP_KERNEL); if (!allocated_mem) return NULL; diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c index b3bf9899c1a1..330c75d9ee07 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c +++ b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c @@ -210,8 +210,7 @@ int qed_init_alloc(struct qed_hwfn *p_hwfn) if (IS_VF(p_hwfn->cdev)) return 0; - rt_data->b_valid = kcalloc(RUNTIME_ARRAY_SIZE, sizeof(bool), - GFP_KERNEL); + rt_data->b_valid = kzalloc_objs(bool, RUNTIME_ARRAY_SIZE, GFP_KERNEL); if (!rt_data->b_valid) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c index 2661c483c67e..a65827240d00 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_int.c +++ b/drivers/net/ethernet/qlogic/qed/qed_int.c @@ -1412,7 +1412,7 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn, void *p_virt; /* SB struct */ - p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL); + p_sb = kmalloc_obj(*p_sb, GFP_KERNEL); if (!p_sb) return -ENOMEM; @@ -1765,7 +1765,7 @@ static int qed_int_sp_sb_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) void *p_virt; /* SB struct */ - p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL); + p_sb = kmalloc_obj(*p_sb, GFP_KERNEL); if (!p_sb) return -ENOMEM; @@ -2188,7 +2188,7 @@ int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) u32 min_vf = 0, max_vf = 0; u16 igu_sb_id; - p_hwfn->hw_info.p_igu_info = kzalloc(sizeof(*p_igu_info), GFP_KERNEL); + p_hwfn->hw_info.p_igu_info = kzalloc_obj(*p_igu_info, GFP_KERNEL); if (!p_hwfn->hw_info.p_igu_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c index 980e7289b481..758fa97be920 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c @@ -710,7 +710,7 @@ static int qed_iscsi_allocate_connection(struct qed_hwfn *p_hwfn, /* Need to allocate a new connection */ p_params = &p_hwfn->pf_params.iscsi_pf_params; - p_conn = kzalloc(sizeof(*p_conn), GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); if (!p_conn) return -ENOMEM; @@ -845,7 +845,7 @@ int qed_iscsi_alloc(struct qed_hwfn *p_hwfn) { struct qed_iscsi_info *p_iscsi_info; - p_iscsi_info = kzalloc(sizeof(*p_iscsi_info), GFP_KERNEL); + p_iscsi_info = kzalloc_obj(*p_iscsi_info, GFP_KERNEL); if (!p_iscsi_info) return -ENOMEM; @@ -1125,7 +1125,7 @@ static int qed_iscsi_start(struct qed_dev *cdev, if (!tasks) return 0; - tid_info = kzalloc(sizeof(*tid_info), GFP_KERNEL); + tid_info = kzalloc_obj(*tid_info, GFP_KERNEL); if (!tid_info) { qed_iscsi_stop(cdev); @@ -1159,7 +1159,7 @@ static int qed_iscsi_acquire_conn(struct qed_dev *cdev, int rc; /* Allocate a hashed connection */ - hash_con = kzalloc(sizeof(*hash_con), GFP_ATOMIC); + hash_con = kzalloc_obj(*hash_con, GFP_ATOMIC); if (!hash_con) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index 1d1d4caad680..3b1ff94a0588 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -546,7 +546,7 @@ qed_iwarp_create_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep **ep_out) struct qed_iwarp_ep *ep; int rc; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; @@ -2602,7 +2602,7 @@ qed_iwarp_ll2_alloc_buffers(struct qed_hwfn *p_hwfn, int i; for (i = 0; i < num_rx_bufs; i++) { - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) { rc = -ENOMEM; break; @@ -2759,9 +2759,9 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn, if (rc) goto err; - iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps, - sizeof(*iwarp_info->partial_fpdus), - GFP_KERNEL); + iwarp_info->partial_fpdus = kzalloc_objs(*iwarp_info->partial_fpdus, + (u16)p_hwfn->p_rdma_info->num_qps, + GFP_KERNEL); if (!iwarp_info->partial_fpdus) { rc = -ENOMEM; goto err; @@ -2780,9 +2780,8 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn, * processing. We can't fail on allocation of such a struct therefore * we allocate enough to take care of all rx packets */ - iwarp_info->mpa_bufs = kcalloc(data.input.rx_num_desc, - sizeof(*iwarp_info->mpa_bufs), - GFP_KERNEL); + iwarp_info->mpa_bufs = kzalloc_objs(*iwarp_info->mpa_bufs, + data.input.rx_num_desc, GFP_KERNEL); if (!iwarp_info->mpa_bufs) { rc = -ENOMEM; goto err; @@ -3167,7 +3166,7 @@ qed_iwarp_create_listen(void *rdma_cxt, struct qed_hwfn *p_hwfn = rdma_cxt; struct qed_iwarp_listener *listener; - listener = kzalloc(sizeof(*listener), GFP_KERNEL); + listener = kzalloc_obj(*listener, GFP_KERNEL); if (!listener) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index 970b9aabbc3d..e78f9c2ffc38 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c @@ -58,7 +58,7 @@ int qed_l2_alloc(struct qed_hwfn *p_hwfn) if (!QED_IS_L2_PERSONALITY(p_hwfn)) return 0; - p_l2_info = kzalloc(sizeof(*p_l2_info), GFP_KERNEL); + p_l2_info = kzalloc_obj(*p_l2_info, GFP_KERNEL); if (!p_l2_info) return -ENOMEM; p_hwfn->p_l2_info = p_l2_info; diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index ab5ef254a748..904bb1cd9bdb 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -1195,8 +1195,7 @@ qed_ll2_acquire_connection_rx(struct qed_hwfn *p_hwfn, } capacity = qed_chain_get_capacity(&p_ll2_info->rx_queue.rxq_chain); - p_descq = kcalloc(capacity, sizeof(struct qed_ll2_rx_packet), - GFP_KERNEL); + p_descq = kzalloc_objs(struct qed_ll2_rx_packet, capacity, GFP_KERNEL); if (!p_descq) { rc = -ENOMEM; DP_NOTICE(p_hwfn, "Failed to allocate ll2 Rx desc\n"); @@ -1291,7 +1290,7 @@ qed_ll2_acquire_connection_ooo(struct qed_hwfn *p_hwfn, for (buf_idx = 0; buf_idx < p_ll2_info->input.rx_num_ooo_buffers; buf_idx++) { - p_buf = kzalloc(sizeof(*p_buf), GFP_KERNEL); + p_buf = kzalloc_obj(*p_buf, GFP_KERNEL); if (!p_buf) { rc = -ENOMEM; goto out; @@ -2200,8 +2199,9 @@ int qed_ll2_alloc(struct qed_hwfn *p_hwfn) u8 i; /* Allocate LL2's set struct */ - p_ll2_connections = kcalloc(QED_MAX_NUM_OF_LL2_CONNECTIONS, - sizeof(struct qed_ll2_info), GFP_KERNEL); + p_ll2_connections = kzalloc_objs(struct qed_ll2_info, + QED_MAX_NUM_OF_LL2_CONNECTIONS, + GFP_KERNEL); if (!p_ll2_connections) { DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_ll2'\n"); return -ENOMEM; @@ -2603,7 +2603,7 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params) DP_INFO(cdev, "Allocating %d LL2 buffers of size %08x bytes\n", rx_num_desc, cdev->ll2->rx_size); for (i = 0; i < rx_num_desc; i++) { - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) { DP_INFO(cdev, "Failed to allocate LL2 buffers\n"); rc = -ENOMEM; @@ -2811,7 +2811,7 @@ const struct qed_ll2_ops qed_ll2_ops_pass = { int qed_ll2_alloc_if(struct qed_dev *cdev) { - cdev->ll2 = kzalloc(sizeof(*cdev->ll2), GFP_KERNEL); + cdev->ll2 = kzalloc_obj(*cdev->ll2, GFP_KERNEL); return cdev->ll2 ? 0 : -ENOMEM; } diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index d4685ad4b169..544d790efdea 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -461,7 +461,7 @@ static struct qed_dev *qed_alloc_cdev(struct pci_dev *pdev) { struct qed_dev *cdev; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return cdev; @@ -612,7 +612,7 @@ static int qed_set_int_mode(struct qed_dev *cdev, bool force_mode) case QED_INT_MODE_MSIX: /* Allocate MSIX table */ cnt = int_params->in.num_vectors; - int_params->msix_table = kcalloc(cnt, sizeof(*tbl), GFP_KERNEL); + int_params->msix_table = kzalloc_objs(*tbl, cnt, GFP_KERNEL); if (!int_params->msix_table) { rc = -ENOMEM; goto out; @@ -1050,7 +1050,7 @@ static int qed_alloc_stream_mem(struct qed_dev *cdev) for_each_hwfn(cdev, i) { struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; - p_hwfn->stream = kzalloc(sizeof(*p_hwfn->stream), GFP_KERNEL); + p_hwfn->stream = kzalloc_obj(*p_hwfn->stream, GFP_KERNEL); if (!p_hwfn->stream) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c index c7f497c36f66..22802c793d68 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c @@ -104,7 +104,7 @@ qed_mcp_cmd_add_elem(struct qed_hwfn *p_hwfn, { struct qed_mcp_cmd_elem *p_cmd_elem = NULL; - p_cmd_elem = kzalloc(sizeof(*p_cmd_elem), GFP_ATOMIC); + p_cmd_elem = kzalloc_obj(*p_cmd_elem, GFP_ATOMIC); if (!p_cmd_elem) goto out; @@ -241,7 +241,7 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) u32 size; /* Allocate mcp_info structure */ - p_hwfn->mcp_info = kzalloc(sizeof(*p_hwfn->mcp_info), GFP_KERNEL); + p_hwfn->mcp_info = kzalloc_obj(*p_hwfn->mcp_info, GFP_KERNEL); if (!p_hwfn->mcp_info) goto err; p_info = p_hwfn->mcp_info; @@ -3365,9 +3365,8 @@ int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn) goto err0; } - nvm_info.image_att = kmalloc_array(nvm_info.num_images, - sizeof(struct bist_nvm_image_att), - GFP_KERNEL); + nvm_info.image_att = kmalloc_objs(struct bist_nvm_image_att, + nvm_info.num_images, GFP_KERNEL); if (!nvm_info.image_att) { rc = -ENOMEM; goto err0; diff --git a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c b/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c index f19128c8d9cc..81823f4197f6 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c @@ -218,7 +218,7 @@ static int qed_nvmetcp_start(struct qed_dev *cdev, if (!tasks) return 0; - tid_info = kzalloc(sizeof(*tid_info), GFP_KERNEL); + tid_info = kzalloc_obj(*tid_info, GFP_KERNEL); if (!tid_info) { qed_nvmetcp_stop(cdev); @@ -477,7 +477,7 @@ static int qed_nvmetcp_allocate_connection(struct qed_hwfn *p_hwfn, /* Need to allocate a new connection */ p_params = &p_hwfn->pf_params.nvmetcp_pf_params; - p_conn = kzalloc(sizeof(*p_conn), GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); if (!p_conn) return -ENOMEM; @@ -568,7 +568,7 @@ int qed_nvmetcp_alloc(struct qed_hwfn *p_hwfn) { struct qed_nvmetcp_info *p_nvmetcp_info; - p_nvmetcp_info = kzalloc(sizeof(*p_nvmetcp_info), GFP_KERNEL); + p_nvmetcp_info = kzalloc_obj(*p_nvmetcp_info, GFP_KERNEL); if (!p_nvmetcp_info) return -ENOMEM; @@ -611,7 +611,7 @@ static int qed_nvmetcp_acquire_conn(struct qed_dev *cdev, int rc; /* Allocate a hashed connection */ - hash_con = kzalloc(sizeof(*hash_con), GFP_ATOMIC); + hash_con = kzalloc_obj(*hash_con, GFP_ATOMIC); if (!hash_con) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_ooo.c b/drivers/net/ethernet/qlogic/qed/qed_ooo.c index 8be567a6ad44..23631e18858e 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ooo.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ooo.c @@ -107,7 +107,7 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) return -EINVAL; } - p_ooo_info = kzalloc(sizeof(*p_ooo_info), GFP_KERNEL); + p_ooo_info = kzalloc_obj(*p_ooo_info, GFP_KERNEL); if (!p_ooo_info) return -ENOMEM; @@ -118,9 +118,8 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) INIT_LIST_HEAD(&p_ooo_info->ready_buffers_list); INIT_LIST_HEAD(&p_ooo_info->free_isles_list); - p_ooo_info->p_isles_mem = kcalloc(max_num_isles, - sizeof(struct qed_ooo_isle), - GFP_KERNEL); + p_ooo_info->p_isles_mem = kzalloc_objs(struct qed_ooo_isle, + max_num_isles, GFP_KERNEL); if (!p_ooo_info->p_isles_mem) goto no_isles_mem; @@ -131,9 +130,8 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) } p_ooo_info->p_archipelagos_mem = - kcalloc(max_num_archipelagos, - sizeof(struct qed_ooo_archipelago), - GFP_KERNEL); + kzalloc_objs(struct qed_ooo_archipelago, + max_num_archipelagos, GFP_KERNEL); if (!p_ooo_info->p_archipelagos_mem) goto no_archipelagos_mem; @@ -141,9 +139,9 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) INIT_LIST_HEAD(&p_ooo_info->p_archipelagos_mem[i].isles_list); p_ooo_info->ooo_history.p_cqes = - kcalloc(QED_MAX_NUM_OOO_HISTORY_ENTRIES, - sizeof(struct ooo_opaque), - GFP_KERNEL); + kzalloc_objs(struct ooo_opaque, + QED_MAX_NUM_OOO_HISTORY_ENTRIES, + GFP_KERNEL); if (!p_ooo_info->ooo_history.p_cqes) goto no_history_mem; diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index 9a1660a12c57..8872c9ebcd26 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -119,7 +119,7 @@ int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) { struct qed_rdma_info *p_rdma_info; - p_rdma_info = kzalloc(sizeof(*p_rdma_info), GFP_KERNEL); + p_rdma_info = kzalloc_obj(*p_rdma_info, GFP_KERNEL); if (!p_rdma_info) return -ENOMEM; @@ -168,12 +168,12 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn) p_rdma_info->max_queue_zones = (u16)RESC_NUM(p_hwfn, QED_L2_QUEUE); /* Allocate a struct with device params and fill it */ - p_rdma_info->dev = kzalloc(sizeof(*p_rdma_info->dev), GFP_KERNEL); + p_rdma_info->dev = kzalloc_obj(*p_rdma_info->dev, GFP_KERNEL); if (!p_rdma_info->dev) return rc; /* Allocate a struct with port params and fill it */ - p_rdma_info->port = kzalloc(sizeof(*p_rdma_info->port), GFP_KERNEL); + p_rdma_info->port = kzalloc_obj(*p_rdma_info->port, GFP_KERNEL); if (!p_rdma_info->port) goto free_rdma_dev; @@ -1293,7 +1293,7 @@ qed_rdma_create_qp(void *rdma_cxt, } } - qp = kzalloc(sizeof(*qp), GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return NULL; diff --git a/drivers/net/ethernet/qlogic/qed/qed_spq.c b/drivers/net/ethernet/qlogic/qed/qed_spq.c index d01b9245f811..d0ef2782f5ba 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_spq.c +++ b/drivers/net/ethernet/qlogic/qed/qed_spq.c @@ -407,7 +407,7 @@ int qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem) int ret; /* Allocate EQ struct */ - p_eq = kzalloc(sizeof(*p_eq), GFP_KERNEL); + p_eq = kzalloc_obj(*p_eq, GFP_KERNEL); if (!p_eq) return -ENOMEM; @@ -562,7 +562,7 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn) int ret; /* SPQ struct */ - p_spq = kzalloc(sizeof(*p_spq), GFP_KERNEL); + p_spq = kzalloc_obj(*p_spq, GFP_KERNEL); if (!p_spq) return -ENOMEM; @@ -633,7 +633,7 @@ int qed_spq_get_entry(struct qed_hwfn *p_hwfn, struct qed_spq_entry **pp_ent) spin_lock_bh(&p_spq->lock); if (list_empty(&p_spq->free_pool)) { - p_ent = kzalloc(sizeof(*p_ent), GFP_ATOMIC); + p_ent = kzalloc_obj(*p_ent, GFP_ATOMIC); if (!p_ent) { DP_NOTICE(p_hwfn, "Failed to allocate an SPQ entry for a pending ramrod\n"); @@ -1013,7 +1013,7 @@ int qed_consq_alloc(struct qed_hwfn *p_hwfn) int ret; /* Allocate ConsQ struct */ - p_consq = kzalloc(sizeof(*p_consq), GFP_KERNEL); + p_consq = kzalloc_obj(*p_consq, GFP_KERNEL); if (!p_consq) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c index 5222a035fd19..cc9087abbacc 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c @@ -543,7 +543,7 @@ int qed_iov_alloc(struct qed_hwfn *p_hwfn) return 0; } - p_sriov = kzalloc(sizeof(*p_sriov), GFP_KERNEL); + p_sriov = kzalloc_obj(*p_sriov, GFP_KERNEL); if (!p_sriov) return -ENOMEM; @@ -600,7 +600,7 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn) } /* Allocate a new struct for IOV information */ - cdev->p_iov_info = kzalloc(sizeof(*cdev->p_iov_info), GFP_KERNEL); + cdev->p_iov_info = kzalloc_obj(*cdev->p_iov_info, GFP_KERNEL); if (!cdev->p_iov_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c index 0e265ed1f501..b9ebf91e6b6a 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_vf.c +++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c @@ -454,7 +454,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) p_hwfn->hw_info.concrete_fid = REG_RD(p_hwfn, reg); /* Allocate vf sriov info */ - p_iov = kzalloc(sizeof(*p_iov), GFP_KERNEL); + p_iov = kzalloc_obj(*p_iov, GFP_KERNEL); if (!p_iov) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index 7e341e026489..32bb653c50f7 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -413,7 +413,7 @@ qede_alloc_filter(struct qede_dev *edev, int min_hlen) if (bit_id >= QEDE_RFS_MAX_FLTR) return NULL; - n = kzalloc(sizeof(*n), GFP_ATOMIC); + n = kzalloc_obj(*n, GFP_ATOMIC); if (!n) return NULL; @@ -682,7 +682,7 @@ int qede_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) DP_VERBOSE(edev, NETIF_MSG_IFUP, "Adding vlan 0x%04x\n", vid); - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) { DP_INFO(edev, "Failed to allocate struct for vlan\n"); return -ENOMEM; @@ -1916,7 +1916,7 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, goto unlock; } - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) { rc = -ENOMEM; goto unlock; @@ -2059,7 +2059,7 @@ int qede_add_cls_rule(struct qede_dev *edev, struct ethtool_rxnfc *info) goto unlock; } - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) { rc = -ENOMEM; goto unlock; diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index 66ab1b9d65a1..dfa221b30e9e 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -963,17 +963,17 @@ static int qede_alloc_fp_array(struct qede_dev *edev) struct qede_fastpath *fp; int i; - edev->fp_array = kcalloc(QEDE_QUEUE_CNT(edev), - sizeof(*edev->fp_array), GFP_KERNEL); + edev->fp_array = kzalloc_objs(*edev->fp_array, QEDE_QUEUE_CNT(edev), + GFP_KERNEL); if (!edev->fp_array) { DP_NOTICE(edev, "fp array allocation failed\n"); goto err; } if (!edev->coal_entry) { - edev->coal_entry = kcalloc(QEDE_MAX_RSS_CNT(edev), - sizeof(*edev->coal_entry), - GFP_KERNEL); + edev->coal_entry = kzalloc_objs(*edev->coal_entry, + QEDE_MAX_RSS_CNT(edev), + GFP_KERNEL); if (!edev->coal_entry) { DP_ERR(edev, "coalesce entry allocation failed\n"); goto err; @@ -990,7 +990,7 @@ static int qede_alloc_fp_array(struct qede_dev *edev) for_each_queue(i) { fp = &edev->fp_array[i]; - fp->sb_info = kzalloc(sizeof(*fp->sb_info), GFP_KERNEL); + fp->sb_info = kzalloc_obj(*fp->sb_info, GFP_KERNEL); if (!fp->sb_info) { DP_NOTICE(edev, "sb info struct allocation failed\n"); goto err; @@ -1007,20 +1007,20 @@ static int qede_alloc_fp_array(struct qede_dev *edev) } if (fp->type & QEDE_FASTPATH_TX) { - fp->txq = kcalloc(edev->dev_info.num_tc, - sizeof(*fp->txq), GFP_KERNEL); + fp->txq = kzalloc_objs(*fp->txq, edev->dev_info.num_tc, + GFP_KERNEL); if (!fp->txq) goto err; } if (fp->type & QEDE_FASTPATH_RX) { - fp->rxq = kzalloc(sizeof(*fp->rxq), GFP_KERNEL); + fp->rxq = kzalloc_obj(*fp->rxq, GFP_KERNEL); if (!fp->rxq) goto err; if (edev->xdp_prog) { - fp->xdp_tx = kzalloc(sizeof(*fp->xdp_tx), - GFP_KERNEL); + fp->xdp_tx = kzalloc_obj(*fp->xdp_tx, + GFP_KERNEL); if (!fp->xdp_tx) goto err; fp->type |= QEDE_FASTPATH_XDP; diff --git a/drivers/net/ethernet/qlogic/qede/qede_ptp.c b/drivers/net/ethernet/qlogic/qede/qede_ptp.c index d351be5fbda1..774f77f9a55e 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ptp.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ptp.c @@ -446,7 +446,7 @@ int qede_ptp_enable(struct qede_dev *edev) struct qede_ptp *ptp; int rc; - ptp = kzalloc(sizeof(*ptp), GFP_KERNEL); + ptp = kzalloc_obj(*ptp, GFP_KERNEL); if (!ptp) { DP_INFO(edev, "Failed to allocate struct for PTP\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qede/qede_rdma.c b/drivers/net/ethernet/qlogic/qede/qede_rdma.c index 6304514a6f2c..d0fff415871e 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_rdma.c +++ b/drivers/net/ethernet/qlogic/qede/qede_rdma.c @@ -258,7 +258,7 @@ qede_rdma_get_free_event_node(struct qede_dev *edev) } if (!found) { - event_node = kzalloc(sizeof(*event_node), GFP_ATOMIC); + event_node = kzalloc_obj(*event_node, GFP_ATOMIC); if (!event_node) { DP_NOTICE(edev, "qedr: Could not allocate memory for rdma work\n"); diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index fca94a69c777..b75b4708c300 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -2578,9 +2578,8 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev) else qdev->lrg_buf_q_alloc_size = qdev->lrg_buf_q_size * 2; - qdev->lrg_buf = kmalloc_array(qdev->num_large_buffers, - sizeof(struct ql_rcv_buf_cb), - GFP_KERNEL); + qdev->lrg_buf = kmalloc_objs(struct ql_rcv_buf_cb, + qdev->num_large_buffers, GFP_KERNEL); if (qdev->lrg_buf == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 91e7b38143ea..bae848bd5e26 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c @@ -1732,7 +1732,7 @@ int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *adapter, u32 mode) if (adapter->recv_ctx->state == QLCNIC_HOST_CTX_STATE_FREED) return -EIO; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return -ENOMEM; @@ -2103,7 +2103,7 @@ int qlcnic_83xx_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr, if (adapter->recv_ctx->state == QLCNIC_HOST_CTX_STATE_FREED) return -EIO; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return -ENOMEM; @@ -4164,7 +4164,7 @@ int qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *adapter) struct qlcnic_hardware_context *ahw = adapter->ahw; struct qlcnic_mailbox *mbx; - ahw->mailbox = kzalloc(sizeof(*mbx), GFP_KERNEL); + ahw->mailbox = kzalloc_obj(*mbx, GFP_KERNEL); if (!ahw->mailbox) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index 6145252d8ff8..42c8e5490ee7 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c @@ -2388,7 +2388,7 @@ static int qlcnic_83xx_get_fw_info(struct qlcnic_adapter *adapter) struct qlc_83xx_fw_info *fw_info; int err = 0; - ahw->fw_info = kzalloc(sizeof(*fw_info), GFP_KERNEL); + ahw->fw_info = kzalloc_obj(*fw_info, GFP_KERNEL); if (!ahw->fw_info) { err = -ENOMEM; } else { diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c index 4d638f60f237..576340315e0d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c @@ -259,7 +259,7 @@ int qlcnic_register_dcb(struct qlcnic_adapter *adapter) if (qlcnic_sriov_vf_check(adapter)) return 0; - dcb = kzalloc(sizeof(struct qlcnic_dcb), GFP_ATOMIC); + dcb = kzalloc_obj(struct qlcnic_dcb, GFP_ATOMIC); if (!dcb) return -ENOMEM; @@ -317,13 +317,13 @@ static int __qlcnic_dcb_attach(struct qlcnic_dcb *dcb) return -1; } - dcb->cfg = kzalloc(sizeof(struct qlcnic_dcb_cfg), GFP_ATOMIC); + dcb->cfg = kzalloc_obj(struct qlcnic_dcb_cfg, GFP_ATOMIC); if (!dcb->cfg) { err = -ENOMEM; goto out_free_wq; } - dcb->param = kzalloc(sizeof(struct qlcnic_dcb_mbx_params), GFP_ATOMIC); + dcb->param = kzalloc_obj(struct qlcnic_dcb_mbx_params, GFP_ATOMIC); if (!dcb->param) { err = -ENOMEM; goto out_free_cfg; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index ae4ee0326ee1..e58176badc1f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c @@ -489,7 +489,7 @@ int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan, return 0; } - cur = kzalloc(sizeof(*cur), GFP_ATOMIC); + cur = kzalloc_obj(*cur, GFP_ATOMIC); if (cur == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index 09f20c794754..e56ef10b6a2d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c @@ -189,8 +189,8 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter) recv_ctx = adapter->recv_ctx; - rds_ring = kcalloc(adapter->max_rds_rings, - sizeof(struct qlcnic_host_rds_ring), GFP_KERNEL); + rds_ring = kzalloc_objs(struct qlcnic_host_rds_ring, + adapter->max_rds_rings, GFP_KERNEL); if (rds_ring == NULL) goto err_out; @@ -454,7 +454,7 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter) return -EIO; } - buf = kcalloc(n, sizeof(struct crb_addr_pair), GFP_KERNEL); + buf = kzalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); if (buf == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index b9dc0071c5de..537fd26da904 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c @@ -220,7 +220,7 @@ static void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter, return; } - fil = kzalloc(sizeof(struct qlcnic_filter), GFP_ATOMIC); + fil = kzalloc_obj(struct qlcnic_filter, GFP_ATOMIC); if (!fil) return; @@ -346,7 +346,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter, return; } - fil = kzalloc(sizeof(struct qlcnic_filter), GFP_ATOMIC); + fil = kzalloc_obj(struct qlcnic_filter, GFP_ATOMIC); if (!fil) return; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index e051d8c7a28d..00eab09c1710 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -679,9 +679,8 @@ int qlcnic_setup_tss_rss_intr(struct qlcnic_adapter *adapter) num_msix += 1; if (!adapter->msix_entries) { - adapter->msix_entries = kcalloc(num_msix, - sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, + num_msix, GFP_KERNEL); if (!adapter->msix_entries) return -ENOMEM; } @@ -734,9 +733,8 @@ int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix) int err, vector; if (!adapter->msix_entries) { - adapter->msix_entries = kcalloc(num_msix, - sizeof(struct msix_entry), - GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, + num_msix, GFP_KERNEL); if (!adapter->msix_entries) return -ENOMEM; } @@ -952,7 +950,7 @@ static int qlcnic_get_act_pci_func(struct qlcnic_adapter *adapter) if (ahw->op_mode == QLCNIC_MGMT_FUNC) return 0; - pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func, GFP_KERNEL); if (!pci_info) return -ENOMEM; @@ -986,7 +984,7 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter) u16 act_pci_func; u8 pfn; - pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func, GFP_KERNEL); if (!pci_info) return -ENOMEM; @@ -996,17 +994,15 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter) act_pci_func = ahw->total_nic_func; - adapter->npars = kcalloc(act_pci_func, - sizeof(struct qlcnic_npar_info), - GFP_KERNEL); + adapter->npars = kzalloc_objs(struct qlcnic_npar_info, act_pci_func, + GFP_KERNEL); if (!adapter->npars) { ret = -ENOMEM; goto err_pci_info; } - adapter->eswitch = kcalloc(QLCNIC_NIU_MAX_XG_PORTS, - sizeof(struct qlcnic_eswitch), - GFP_KERNEL); + adapter->eswitch = kzalloc_objs(struct qlcnic_eswitch, + QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); if (!adapter->eswitch) { ret = -ENOMEM; goto err_npars; @@ -2059,8 +2055,7 @@ static int qlcnic_alloc_adapter_resources(struct qlcnic_adapter *adapter) struct qlcnic_hardware_context *ahw = adapter->ahw; int err = 0; - adapter->recv_ctx = kzalloc(sizeof(struct qlcnic_recv_context), - GFP_KERNEL); + adapter->recv_ctx = kzalloc_obj(struct qlcnic_recv_context, GFP_KERNEL); if (!adapter->recv_ctx) { err = -ENOMEM; goto err_out; @@ -2356,8 +2351,8 @@ int qlcnic_alloc_tx_rings(struct qlcnic_adapter *adapter, struct qlcnic_host_tx_ring *tx_ring; struct qlcnic_cmd_buffer *cmd_buf_arr; - tx_ring = kcalloc(adapter->drv_tx_rings, - sizeof(struct qlcnic_host_tx_ring), GFP_KERNEL); + tx_ring = kzalloc_objs(struct qlcnic_host_tx_ring, + adapter->drv_tx_rings, GFP_KERNEL); if (tx_ring == NULL) return -ENOMEM; @@ -2444,7 +2439,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); - ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); + ahw = kzalloc_obj(struct qlcnic_hardware_context, GFP_KERNEL); if (!ahw) { err = -ENOMEM; goto err_out_free_res; @@ -2851,8 +2846,8 @@ void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter) adapter->fhash.fbucket_size = QLC_83XX_LB_BUCKET_SIZE; } - head = kcalloc(adapter->fhash.fbucket_size, - sizeof(struct hlist_head), GFP_ATOMIC); + head = kzalloc_objs(struct hlist_head, adapter->fhash.fbucket_size, + GFP_ATOMIC); if (!head) return; @@ -2868,8 +2863,8 @@ void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter) adapter->rx_fhash.fbucket_size = adapter->fhash.fbucket_size; - head = kcalloc(adapter->rx_fhash.fbucket_size, - sizeof(struct hlist_head), GFP_ATOMIC); + head = kzalloc_objs(struct hlist_head, adapter->rx_fhash.fbucket_size, + GFP_ATOMIC); if (!head) return; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index 7ecb3dfe30bd..c2bf5455092c 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c @@ -792,8 +792,7 @@ static u32 qlcnic_read_memory_pexdma(struct qlcnic_adapter *adapter, } /* Create DMA descriptor */ - dma_descr = kzalloc(sizeof(struct qlcnic_pex_dma_descriptor), - GFP_KERNEL); + dma_descr = kzalloc_obj(struct qlcnic_pex_dma_descriptor, GFP_KERNEL); if (!dma_descr) { *ret = -ENOMEM; return 0; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index d57b976b9040..c6af69e5a700 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c @@ -149,15 +149,15 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) if (!qlcnic_sriov_enable_check(adapter)) return -EIO; - sriov = kzalloc(sizeof(struct qlcnic_sriov), GFP_KERNEL); + sriov = kzalloc_obj(struct qlcnic_sriov, GFP_KERNEL); if (!sriov) return -ENOMEM; adapter->ahw->sriov = sriov; sriov->num_vfs = num_vfs; bc = &sriov->bc; - sriov->vf_info = kcalloc(num_vfs, sizeof(struct qlcnic_vf_info), - GFP_KERNEL); + sriov->vf_info = kzalloc_objs(struct qlcnic_vf_info, num_vfs, + GFP_KERNEL); if (!sriov->vf_info) { err = -ENOMEM; goto qlcnic_free_sriov; @@ -201,7 +201,7 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) INIT_WORK(&vf->trans_work, qlcnic_sriov_process_bc_cmd); if (qlcnic_sriov_pf_check(adapter)) { - vp = kzalloc(sizeof(struct qlcnic_vport), GFP_KERNEL); + vp = kzalloc_obj(struct qlcnic_vport, GFP_KERNEL); if (!vp) { err = -ENOMEM; goto qlcnic_destroy_async_wq; @@ -699,7 +699,7 @@ int qlcnic_sriov_func_to_index(struct qlcnic_adapter *adapter, u8 pci_func) static inline int qlcnic_sriov_alloc_bc_trans(struct qlcnic_bc_trans **trans) { - *trans = kzalloc(sizeof(struct qlcnic_bc_trans), GFP_ATOMIC); + *trans = kzalloc_obj(struct qlcnic_bc_trans, GFP_ATOMIC); if (!*trans) return -ENOMEM; @@ -710,7 +710,7 @@ static inline int qlcnic_sriov_alloc_bc_trans(struct qlcnic_bc_trans **trans) static inline int qlcnic_sriov_alloc_bc_msg(struct qlcnic_bc_hdr **hdr, u32 size) { - *hdr = kcalloc(size, sizeof(struct qlcnic_bc_hdr), GFP_ATOMIC); + *hdr = kzalloc_objs(struct qlcnic_bc_hdr, size, GFP_ATOMIC); if (!*hdr) return -ENOMEM; @@ -1634,7 +1634,7 @@ qlcnic_sriov_alloc_async_cmd(struct qlcnic_back_channel *bc, { struct qlcnic_async_cmd *entry = NULL; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return NULL; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index 8dd7aa08ecfb..7052d34aad45 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c @@ -799,7 +799,7 @@ static int qlcnic_sriov_cfg_vf_def_mac(struct qlcnic_adapter *adapter, vp = vf->vp; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (!cmd) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index 5296d9a6ee83..406101671602 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c @@ -909,7 +909,7 @@ static ssize_t qlcnic_sysfs_read_pci_config(struct file *file, int i, ret; u32 count; - pci_info = kcalloc(size, sizeof(*pci_info), GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, size, GFP_KERNEL); if (!pci_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c index ba8763cac9d9..723ddbb1a70a 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c @@ -68,7 +68,7 @@ static int rmnet_register_real_device(struct net_device *real_dev, return 0; } - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -143,7 +143,7 @@ static int rmnet_newlink(struct net_device *dev, return -ENODEV; } - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; diff --git a/drivers/net/ethernet/realtek/r8169_leds.c b/drivers/net/ethernet/realtek/r8169_leds.c index e10bee706bc6..5da64cea5eb4 100644 --- a/drivers/net/ethernet/realtek/r8169_leds.c +++ b/drivers/net/ethernet/realtek/r8169_leds.c @@ -154,7 +154,7 @@ struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev) struct r8169_led_classdev *leds; int i; - leds = kcalloc(RTL8168_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL); + leds = kzalloc_objs(*leds, RTL8168_NUM_LEDS + 1, GFP_KERNEL); if (!leds) return NULL; @@ -253,7 +253,7 @@ struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev) struct r8169_led_classdev *leds; int i; - leds = kcalloc(RTL8125_NUM_LEDS + 1, sizeof(*leds), GFP_KERNEL); + leds = kzalloc_objs(*leds, RTL8125_NUM_LEDS + 1, GFP_KERNEL); if (!leds) return NULL; diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 2f7d9809c373..ad0e07e2a09d 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2683,7 +2683,7 @@ static void rtl_request_firmware(struct rtl8169_private *tp) if (tp->rtl_fw || !tp->fw_name) return; - rtl_fw = kzalloc(sizeof(*rtl_fw), GFP_KERNEL); + rtl_fw = kzalloc_obj(*rtl_fw, GFP_KERNEL); if (!rtl_fw) return; diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 57b0db314fb5..85f2e23f2638 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -436,14 +436,14 @@ static int ravb_ring_init(struct net_device *ndev, int q) goto error; /* Allocate RX buffers */ - priv->rx_buffers[q] = kcalloc(priv->num_rx_ring[q], - sizeof(*priv->rx_buffers[q]), GFP_KERNEL); + priv->rx_buffers[q] = kzalloc_objs(*priv->rx_buffers[q], + priv->num_rx_ring[q], GFP_KERNEL); if (!priv->rx_buffers[q]) goto error; /* Allocate TX skb rings */ - priv->tx_skb[q] = kcalloc(priv->num_tx_ring[q], - sizeof(*priv->tx_skb[q]), GFP_KERNEL); + priv->tx_skb[q] = kzalloc_objs(*priv->tx_skb[q], priv->num_tx_ring[q], + GFP_KERNEL); if (!priv->tx_skb[q]) goto error; @@ -2199,7 +2199,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) /* TX timestamp required */ if (info->gptp || info->ccc_gac) { if (q == RAVB_NC) { - ts_skb = kmalloc(sizeof(*ts_skb), GFP_ATOMIC); + ts_skb = kmalloc_obj(*ts_skb, GFP_ATOMIC); if (!ts_skb) { if (num_tx_desc > 1) { desc--; diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c index 433eb2b00d10..421677d4b1d7 100644 --- a/drivers/net/ethernet/renesas/rswitch_main.c +++ b/drivers/net/ethernet/renesas/rswitch_main.c @@ -346,7 +346,8 @@ static int rswitch_gwca_queue_alloc(struct net_device *ndev, gq->ndev = ndev; if (!dir_tx) { - gq->rx_bufs = kcalloc(gq->ring_size, sizeof(*gq->rx_bufs), GFP_KERNEL); + gq->rx_bufs = kzalloc_objs(*gq->rx_bufs, gq->ring_size, + GFP_KERNEL); if (!gq->rx_bufs) return -ENOMEM; if (rswitch_gwca_queue_alloc_rx_buf(gq, 0, gq->ring_size) < 0) @@ -356,10 +357,11 @@ static int rswitch_gwca_queue_alloc(struct net_device *ndev, sizeof(struct rswitch_ext_ts_desc) * (gq->ring_size + 1), &gq->ring_dma, GFP_KERNEL); } else { - gq->skbs = kcalloc(gq->ring_size, sizeof(*gq->skbs), GFP_KERNEL); + gq->skbs = kzalloc_objs(*gq->skbs, gq->ring_size, GFP_KERNEL); if (!gq->skbs) return -ENOMEM; - gq->unmap_addrs = kcalloc(gq->ring_size, sizeof(*gq->unmap_addrs), GFP_KERNEL); + gq->unmap_addrs = kzalloc_objs(*gq->unmap_addrs, gq->ring_size, + GFP_KERNEL); if (!gq->unmap_addrs) goto out; gq->tx_ring = dma_alloc_coherent(ndev->dev.parent, diff --git a/drivers/net/ethernet/renesas/rtsn.c b/drivers/net/ethernet/renesas/rtsn.c index 85052b47afb9..2850e76d7f6f 100644 --- a/drivers/net/ethernet/renesas/rtsn.c +++ b/drivers/net/ethernet/renesas/rtsn.c @@ -349,8 +349,8 @@ static int rtsn_chain_init(struct rtsn_private *priv, int tx_size, int rx_size) priv->num_tx_ring = tx_size; priv->num_rx_ring = rx_size; - priv->tx_skb = kcalloc(tx_size, sizeof(*priv->tx_skb), GFP_KERNEL); - priv->rx_skb = kcalloc(rx_size, sizeof(*priv->rx_skb), GFP_KERNEL); + priv->tx_skb = kzalloc_objs(*priv->tx_skb, tx_size, GFP_KERNEL); + priv->rx_skb = kzalloc_objs(*priv->rx_skb, rx_size, GFP_KERNEL); if (!priv->rx_skb || !priv->tx_skb) goto error; diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 6fb0ffc1c844..019828d3713f 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1410,13 +1410,13 @@ static int sh_eth_ring_init(struct net_device *ndev) mdp->rx_buf_sz += NET_IP_ALIGN; /* Allocate RX and TX skb rings */ - mdp->rx_skbuff = kcalloc(mdp->num_rx_ring, sizeof(*mdp->rx_skbuff), - GFP_KERNEL); + mdp->rx_skbuff = kzalloc_objs(*mdp->rx_skbuff, mdp->num_rx_ring, + GFP_KERNEL); if (!mdp->rx_skbuff) return -ENOMEM; - mdp->tx_skbuff = kcalloc(mdp->num_tx_ring, sizeof(*mdp->tx_skbuff), - GFP_KERNEL); + mdp->tx_skbuff = kzalloc_objs(*mdp->tx_skbuff, mdp->num_tx_ring, + GFP_KERNEL); if (!mdp->tx_skbuff) goto ring_free; diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 2794f75df8fc..503a9869e1db 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -66,7 +66,7 @@ static struct rocker_wait *rocker_wait_create(void) { struct rocker_wait *wait; - wait = kzalloc(sizeof(*wait), GFP_KERNEL); + wait = kzalloc_obj(*wait, GFP_KERNEL); if (!wait) return NULL; return wait; @@ -435,8 +435,7 @@ static int rocker_dma_ring_create(const struct rocker *rocker, info->type = type; info->head = 0; info->tail = 0; - info->desc_info = kcalloc(info->size, sizeof(*info->desc_info), - GFP_KERNEL); + info->desc_info = kzalloc_objs(*info->desc_info, info->size, GFP_KERNEL); if (!info->desc_info) return -ENOMEM; @@ -2155,7 +2154,7 @@ static int rocker_router_fib_event(struct notifier_block *nb, if (info->family != AF_INET) return NOTIFY_DONE; - fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); + fib_work = kzalloc_obj(*fib_work, GFP_ATOMIC); if (WARN_ON(!fib_work)) return NOTIFY_BAD; @@ -2648,9 +2647,8 @@ static int rocker_msix_init(struct rocker *rocker) if (msix_entries != ROCKER_MSIX_VEC_COUNT(rocker->port_count)) return -EINVAL; - rocker->msix_entries = kmalloc_array(msix_entries, - sizeof(struct msix_entry), - GFP_KERNEL); + rocker->msix_entries = kmalloc_objs(struct msix_entry, msix_entries, + GFP_KERNEL); if (!rocker->msix_entries) return -ENOMEM; @@ -2764,7 +2762,7 @@ static int rocker_switchdev_event(struct notifier_block *unused, return rocker_switchdev_port_attr_set_event(dev, ptr); rocker_port = netdev_priv(dev); - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; @@ -2850,7 +2848,7 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct rocker *rocker; int err; - rocker = kzalloc(sizeof(*rocker), GFP_KERNEL); + rocker = kzalloc_obj(*rocker, GFP_KERNEL); if (!rocker) return -ENOMEM; diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c index 61e50517c05b..a9795b79d1d4 100644 --- a/drivers/net/ethernet/rocker/rocker_ofdpa.c +++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c @@ -838,7 +838,7 @@ static int ofdpa_flow_tbl_ig_port(struct ofdpa_port *ofdpa_port, int flags, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -860,7 +860,7 @@ static int ofdpa_flow_tbl_vlan(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -886,7 +886,7 @@ static int ofdpa_flow_tbl_term_mac(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -926,7 +926,7 @@ static int ofdpa_flow_tbl_bridge(struct ofdpa_port *ofdpa_port, bool dflt = !eth_dst || eth_dst_mask; bool wild = false; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; @@ -976,7 +976,7 @@ static int ofdpa_flow_tbl_ucast4_routing(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1006,7 +1006,7 @@ static int ofdpa_flow_tbl_acl(struct ofdpa_port *ofdpa_port, int flags, u32 priority; struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1150,7 +1150,7 @@ static int ofdpa_group_l2_interface(struct ofdpa_port *ofdpa_port, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1166,7 +1166,7 @@ static int ofdpa_group_l2_fan_out(struct ofdpa_port *ofdpa_port, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1199,7 +1199,7 @@ static int ofdpa_group_l3_unicast(struct ofdpa_port *ofdpa_port, int flags, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1273,7 +1273,7 @@ static int ofdpa_port_ipv4_neigh(struct ofdpa_port *ofdpa_port, bool removing; int err = 0; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; @@ -1386,7 +1386,7 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port, bool resolved = true; int err = 0; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1866,7 +1866,7 @@ static int ofdpa_port_fdb_learn(struct ofdpa_port *ofdpa_port, if (!(flags & OFDPA_OP_FLAG_LEARNED)) return 0; - lw = kzalloc(sizeof(*lw), GFP_ATOMIC); + lw = kzalloc_obj(*lw, GFP_ATOMIC); if (!lw) return -ENOMEM; @@ -1904,7 +1904,7 @@ static int ofdpa_port_fdb(struct ofdpa_port *ofdpa_port, bool removing = (flags & OFDPA_OP_FLAG_REMOVE); unsigned long lock_flags; - fdb = kzalloc(sizeof(*fdb), GFP_KERNEL); + fdb = kzalloc_obj(*fdb, GFP_KERNEL); if (!fdb) return -ENOMEM; @@ -2232,7 +2232,7 @@ static __be16 ofdpa_port_internal_vlan_id_get(struct ofdpa_port *ofdpa_port, unsigned long lock_flags; int i; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return 0; diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 849c5a6c2af1..437bcf8ad0c8 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -489,15 +489,14 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no, return -ENOMEM; /* allocate memory for RX skbuff array */ - rx_ring->rx_skbuff_dma = kmalloc_array(rx_rsize, - sizeof(dma_addr_t), GFP_KERNEL); + rx_ring->rx_skbuff_dma = kmalloc_objs(dma_addr_t, rx_rsize, GFP_KERNEL); if (!rx_ring->rx_skbuff_dma) { ret = -ENOMEM; goto err_free_dma_rx; } - rx_ring->rx_skbuff = kmalloc_array(rx_rsize, - sizeof(struct sk_buff *), GFP_KERNEL); + rx_ring->rx_skbuff = kmalloc_objs(struct sk_buff *, rx_rsize, + GFP_KERNEL); if (!rx_ring->rx_skbuff) { ret = -ENOMEM; goto err_free_skbuff_dma; @@ -2007,7 +2006,7 @@ static int sxgbe_hw_init(struct sxgbe_priv_data * const priv) { u32 ctrl_ids; - priv->hw = kmalloc(sizeof(*priv->hw), GFP_KERNEL); + priv->hw = kmalloc_obj(*priv->hw, GFP_KERNEL); if(!priv->hw) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index fcec81f862ec..58d3a381271d 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -431,7 +431,7 @@ static int efx_ef10_add_vlan(struct efx_nic *efx, u16 vid) } rc = -ENOMEM; - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) goto fail_alloc; @@ -527,7 +527,7 @@ static int efx_ef10_probe(struct efx_nic *efx) struct efx_ef10_nic_data *nic_data; int i, rc; - nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; @@ -3591,7 +3591,7 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx) MCDI_VAR_ARRAY_LEN(outlen, NVRAM_PARTITIONS_OUT_TYPE_ID)) return -EIO; - parts = kcalloc(n_parts_total, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, n_parts_total, GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ef100.c b/drivers/net/ethernet/sfc/ef100.c index 6334992b0af4..d2f64e049be1 100644 --- a/drivers/net/ethernet/sfc/ef100.c +++ b/drivers/net/ethernet/sfc/ef100.c @@ -453,7 +453,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev, int rc; /* Allocate probe data and struct efx_nic */ - probe_data = kzalloc(sizeof(*probe_data), GFP_KERNEL); + probe_data = kzalloc_obj(*probe_data, GFP_KERNEL); if (!probe_data) return -ENOMEM; probe_data->pci_dev = pci_dev; diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c index 3ad95a4c8af2..da433a94a994 100644 --- a/drivers/net/ethernet/sfc/ef100_nic.c +++ b/drivers/net/ethernet/sfc/ef100_nic.c @@ -351,7 +351,7 @@ int ef100_phy_probe(struct efx_nic *efx) int rc; /* Probe for the PHY */ - efx->phy_data = kzalloc(sizeof(struct efx_mcdi_phy_data), GFP_KERNEL); + efx->phy_data = kzalloc_obj(struct efx_mcdi_phy_data, GFP_KERNEL); if (!efx->phy_data) return -ENOMEM; @@ -1020,7 +1020,7 @@ static int ef100_probe_main(struct efx_nic *efx) if (WARN_ON(bar_size == 0)) return -EIO; - nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c index 9aae0d8b713f..5b3377ca7220 100644 --- a/drivers/net/ethernet/sfc/ef10_sriov.c +++ b/drivers/net/ethernet/sfc/ef10_sriov.c @@ -189,8 +189,7 @@ static int efx_ef10_sriov_alloc_vf_vswitching(struct efx_nic *efx) unsigned int i; int rc; - nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf), - GFP_KERNEL); + nic_data->vf = kzalloc_objs(struct ef10_vf, efx->vf_count, GFP_KERNEL); if (!nic_data->vf) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 112e55b98ed3..133a23a9dd5a 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -1155,7 +1155,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev, int rc; /* Allocate probe data and struct efx_nic */ - probe_data = kzalloc(sizeof(*probe_data), GFP_KERNEL); + probe_data = kzalloc_obj(*probe_data, GFP_KERNEL); if (!probe_data) return -ENOMEM; probe_data->pci_dev = pci_dev; diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index ed3a96ebc7f3..84beb79f1969 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -534,7 +534,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i) struct efx_channel *channel; int j; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -604,7 +604,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) struct efx_channel *channel; int j; - channel = kmalloc(sizeof(*channel), GFP_KERNEL); + channel = kmalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -934,9 +934,9 @@ int efx_set_channels(struct efx_nic *efx) EFX_WARN_ON_PARANOID(efx->xdp_tx_queues); /* Allocate array for XDP TX queue lookup. */ - efx->xdp_tx_queues = kcalloc(efx->xdp_tx_queue_count, - sizeof(*efx->xdp_tx_queues), - GFP_KERNEL); + efx->xdp_tx_queues = kzalloc_objs(*efx->xdp_tx_queues, + efx->xdp_tx_queue_count, + GFP_KERNEL); if (!efx->xdp_tx_queues) return -ENOMEM; } diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c index e8fdbb62d872..a41a840b3710 100644 --- a/drivers/net/ethernet/sfc/efx_common.c +++ b/drivers/net/ethernet/sfc/efx_common.c @@ -996,8 +996,8 @@ int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev) mutex_init(&efx->rps_mutex); spin_lock_init(&efx->rps_hash_lock); /* Failure to allocate is not fatal, but may degrade ARFS performance */ - efx->rps_hash_table = kcalloc(EFX_ARFS_HASH_TABLE_SIZE, - sizeof(*efx->rps_hash_table), GFP_KERNEL); + efx->rps_hash_table = kzalloc_objs(*efx->rps_hash_table, + EFX_ARFS_HASH_TABLE_SIZE, GFP_KERNEL); #endif spin_lock_init(&efx->vf_reps_lock); INIT_LIST_HEAD(&efx->vf_reps); diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index 2fc42b1a2bfb..6b762153c8a4 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -133,7 +133,7 @@ void efx_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL); + efx_tests = kzalloc_obj(*efx_tests, GFP_KERNEL); if (!efx_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c index 6ea41f6c9ef5..2852868c1003 100644 --- a/drivers/net/ethernet/sfc/falcon/efx.c +++ b/drivers/net/ethernet/sfc/falcon/efx.c @@ -423,7 +423,7 @@ ef4_alloc_channel(struct ef4_nic *efx, int i, struct ef4_channel *old_channel) struct ef4_tx_queue *tx_queue; int j; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -456,7 +456,7 @@ ef4_copy_channel(const struct ef4_channel *old_channel) struct ef4_tx_queue *tx_queue; int j; - channel = kmalloc(sizeof(*channel), GFP_KERNEL); + channel = kmalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c index 049364031545..069269884396 100644 --- a/drivers/net/ethernet/sfc/falcon/ethtool.c +++ b/drivers/net/ethernet/sfc/falcon/ethtool.c @@ -493,7 +493,7 @@ static void ef4_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - ef4_tests = kzalloc(sizeof(*ef4_tests), GFP_KERNEL); + ef4_tests = kzalloc_obj(*ef4_tests, GFP_KERNEL); if (!ef4_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/falcon/falcon.c b/drivers/net/ethernet/sfc/falcon/falcon.c index c44df8e4dd30..1603c5267654 100644 --- a/drivers/net/ethernet/sfc/falcon/falcon.c +++ b/drivers/net/ethernet/sfc/falcon/falcon.c @@ -929,7 +929,7 @@ static int falcon_mtd_probe(struct ef4_nic *efx) ASSERT_RTNL(); /* Allocate space for maximum number of partitions */ - parts = kcalloc(2, sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, 2, GFP_KERNEL); if (!parts) return -ENOMEM; n_parts = 0; @@ -2180,7 +2180,7 @@ static int falcon_probe_nvconfig(struct ef4_nic *efx) struct falcon_nvconfig *nvconfig; int rc; - nvconfig = kmalloc(sizeof(*nvconfig), GFP_KERNEL); + nvconfig = kmalloc_obj(*nvconfig, GFP_KERNEL); if (!nvconfig) return -ENOMEM; @@ -2289,7 +2289,7 @@ static int falcon_probe_nic(struct ef4_nic *efx) efx->primary = efx; /* only one usable function per controller */ /* Allocate storage for hardware specific data */ - nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c index 01017c41338e..67b62c3a9839 100644 --- a/drivers/net/ethernet/sfc/falcon/farch.c +++ b/drivers/net/ethernet/sfc/falcon/farch.c @@ -2701,7 +2701,7 @@ int ef4_farch_filter_table_probe(struct ef4_nic *efx) struct ef4_farch_filter_table *table; unsigned table_id; - state = kzalloc(sizeof(struct ef4_farch_filter_state), GFP_KERNEL); + state = kzalloc_obj(struct ef4_farch_filter_state, GFP_KERNEL); if (!state) return -ENOMEM; efx->filter_state = state; diff --git a/drivers/net/ethernet/sfc/falcon/qt202x_phy.c b/drivers/net/ethernet/sfc/falcon/qt202x_phy.c index 21af67e42296..dc6383ceb656 100644 --- a/drivers/net/ethernet/sfc/falcon/qt202x_phy.c +++ b/drivers/net/ethernet/sfc/falcon/qt202x_phy.c @@ -340,7 +340,7 @@ static int qt202x_phy_probe(struct ef4_nic *efx) { struct qt202x_phy_data *phy_data; - phy_data = kzalloc(sizeof(struct qt202x_phy_data), GFP_KERNEL); + phy_data = kzalloc_obj(struct qt202x_phy_data, GFP_KERNEL); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/falcon/rx.c b/drivers/net/ethernet/sfc/falcon/rx.c index f69fcf6caca8..d32bab1b5783 100644 --- a/drivers/net/ethernet/sfc/falcon/rx.c +++ b/drivers/net/ethernet/sfc/falcon/rx.c @@ -701,8 +701,7 @@ int ef4_probe_rx_queue(struct ef4_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kcalloc(entries, sizeof(*rx_queue->buffer), - GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); if (!rx_queue->buffer) return -ENOMEM; @@ -734,8 +733,8 @@ static void ef4_init_rx_recycle_ring(struct ef4_nic *efx, page_ring_size = roundup_pow_of_two(bufs_in_recycle_ring / efx->rx_bufs_per_page); - rx_queue->page_ring = kcalloc(page_ring_size, - sizeof(*rx_queue->page_ring), GFP_KERNEL); + rx_queue->page_ring = kzalloc_objs(*rx_queue->page_ring, page_ring_size, + GFP_KERNEL); if (!rx_queue->page_ring) rx_queue->page_ptr_mask = 0; else diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c index c3dc88e6c26c..8205a08132ae 100644 --- a/drivers/net/ethernet/sfc/falcon/selftest.c +++ b/drivers/net/ethernet/sfc/falcon/selftest.c @@ -545,8 +545,8 @@ ef4_test_loopback(struct ef4_tx_queue *tx_queue, /* Determine how many packets to send */ state->packet_count = efx->txq_entries / 3; state->packet_count = min(1 << (i << 2), state->packet_count); - state->skbs = kcalloc(state->packet_count, - sizeof(state->skbs[0]), GFP_KERNEL); + state->skbs = kzalloc_objs(state->skbs[0], state->packet_count, + GFP_KERNEL); if (!state->skbs) return -ENOMEM; state->flush = false; @@ -635,7 +635,7 @@ static int ef4_test_loopbacks(struct ef4_nic *efx, struct ef4_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/falcon/tenxpress.c b/drivers/net/ethernet/sfc/falcon/tenxpress.c index e27824ef121f..4a5e24b4d174 100644 --- a/drivers/net/ethernet/sfc/falcon/tenxpress.c +++ b/drivers/net/ethernet/sfc/falcon/tenxpress.c @@ -165,7 +165,7 @@ static int tenxpress_phy_probe(struct ef4_nic *efx) struct tenxpress_phy_data *phy_data; /* Allocate phy private storage */ - phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/falcon/tx.c b/drivers/net/ethernet/sfc/falcon/tx.c index e6e80b039ca2..a295b40342a4 100644 --- a/drivers/net/ethernet/sfc/falcon/tx.c +++ b/drivers/net/ethernet/sfc/falcon/tx.c @@ -544,13 +544,13 @@ int ef4_probe_tx_queue(struct ef4_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kcalloc(entries, sizeof(*tx_queue->buffer), - GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); if (!tx_queue->buffer) return -ENOMEM; - tx_queue->cb_page = kcalloc(ef4_tx_cb_page_count(tx_queue), - sizeof(tx_queue->cb_page[0]), GFP_KERNEL); + tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0], + ef4_tx_cb_page_count(tx_queue), + GFP_KERNEL); if (!tx_queue->cb_page) { rc = -ENOMEM; goto fail1; diff --git a/drivers/net/ethernet/sfc/falcon/txc43128_phy.c b/drivers/net/ethernet/sfc/falcon/txc43128_phy.c index f3503965c52c..0025baff6efe 100644 --- a/drivers/net/ethernet/sfc/falcon/txc43128_phy.c +++ b/drivers/net/ethernet/sfc/falcon/txc43128_phy.c @@ -323,7 +323,7 @@ static int txc43128_phy_probe(struct ef4_nic *efx) struct txc43128_data *phy_data; /* Allocate phy private storage */ - phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c index 7cfd9000f79d..6e8e90254792 100644 --- a/drivers/net/ethernet/sfc/mae.c +++ b/drivers/net/ethernet/sfc/mae.c @@ -255,14 +255,12 @@ more: if (desc->scheme) goto fail; rc = -ENOMEM; - desc->keys = kcalloc(desc->n_keys, - sizeof(struct efx_tc_table_field_fmt), - GFP_KERNEL); + desc->keys = kzalloc_objs(struct efx_tc_table_field_fmt, + desc->n_keys, GFP_KERNEL); if (!desc->keys) goto fail; - desc->resps = kcalloc(desc->n_resps, - sizeof(struct efx_tc_table_field_fmt), - GFP_KERNEL); + desc->resps = kzalloc_objs(struct efx_tc_table_field_fmt, + desc->n_resps, GFP_KERNEL); if (!desc->resps) goto fail; } @@ -1160,7 +1158,7 @@ int efx_mae_enumerate_mports(struct efx_nic *efx) for (i = 0; i < count; i++) { struct mae_mport_desc *d; - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) { rc = -ENOMEM; goto fail; @@ -2315,7 +2313,7 @@ int efx_init_mae(struct efx_nic *efx) if (!nic_data->have_mport) return -EINVAL; - mae = kmalloc(sizeof(*mae), GFP_KERNEL); + mae = kmalloc_obj(*mae, GFP_KERNEL); if (!mae) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 5e9b8def5e42..7a19bba484cd 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -63,7 +63,7 @@ int efx_mcdi_init(struct efx_nic *efx) bool already_attached; int rc = -ENOMEM; - efx->mcdi = kzalloc(sizeof(*efx->mcdi), GFP_KERNEL); + efx->mcdi = kzalloc_obj(*efx->mcdi, GFP_KERNEL); if (!efx->mcdi) goto fail; diff --git a/drivers/net/ethernet/sfc/mcdi_filters.c b/drivers/net/ethernet/sfc/mcdi_filters.c index 3db589b90b68..80d53614e4fc 100644 --- a/drivers/net/ethernet/sfc/mcdi_filters.c +++ b/drivers/net/ethernet/sfc/mcdi_filters.c @@ -459,7 +459,7 @@ static s32 efx_mcdi_filter_insert_locked(struct efx_nic *efx, replacing = true; priv_flags = efx_mcdi_filter_entry_flags(table, ins_index); } else { - saved_spec = kmalloc(sizeof(*spec), GFP_ATOMIC); + saved_spec = kmalloc_obj(*spec, GFP_ATOMIC); if (!saved_spec) { rc = -ENOMEM; goto out_unlock; @@ -1310,7 +1310,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) if (efx->filter_state) /* already probed */ return 0; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return -ENOMEM; @@ -1586,7 +1586,7 @@ int efx_mcdi_filter_add_vlan(struct efx_nic *efx, u16 vid) return -EALREADY; } - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/mcdi_mon.c b/drivers/net/ethernet/sfc/mcdi_mon.c index f5128db7c7e7..2d6472ec4a02 100644 --- a/drivers/net/ethernet/sfc/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/mcdi_mon.c @@ -350,13 +350,13 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) * value, min, max, crit, alarm and label for each sensor. */ n_attrs = 6 * n_sensors; - hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL); + hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs, GFP_KERNEL); if (!hwmon->attrs) { rc = -ENOMEM; goto fail; } - hwmon->group.attrs = kcalloc(n_attrs + 1, sizeof(struct attribute *), - GFP_KERNEL); + hwmon->group.attrs = kzalloc_objs(struct attribute *, n_attrs + 1, + GFP_KERNEL); if (!hwmon->group.attrs) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/ethernet/sfc/mcdi_port_common.c b/drivers/net/ethernet/sfc/mcdi_port_common.c index dae684194ac8..ba9e29ca9874 100644 --- a/drivers/net/ethernet/sfc/mcdi_port_common.c +++ b/drivers/net/ethernet/sfc/mcdi_port_common.c @@ -429,7 +429,7 @@ int efx_mcdi_phy_probe(struct efx_nic *efx) int rc; /* Initialise and populate phy_data */ - phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); if (phy_data == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index 4c7222bf26be..7268f049cf3d 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c @@ -1263,7 +1263,7 @@ static int efx_ptp_insert_filter(struct efx_nic *efx, return 0; } - rxfilter = kzalloc(sizeof(*rxfilter), GFP_KERNEL); + rxfilter = kzalloc_obj(*rxfilter, GFP_KERNEL); if (!rxfilter) return -ENOMEM; @@ -1565,7 +1565,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) return 0; } - ptp = kzalloc(sizeof(struct efx_ptp_data), GFP_KERNEL); + ptp = kzalloc_obj(struct efx_ptp_data, GFP_KERNEL); efx->ptp_data = ptp; if (!efx->ptp_data) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c index 5306f4c44be4..809faeead09b 100644 --- a/drivers/net/ethernet/sfc/rx_common.c +++ b/drivers/net/ethernet/sfc/rx_common.c @@ -138,8 +138,8 @@ static void efx_init_rx_recycle_ring(struct efx_rx_queue *rx_queue) bufs_in_recycle_ring = efx_rx_recycle_ring_size(efx); page_ring_size = roundup_pow_of_two(bufs_in_recycle_ring / efx->rx_bufs_per_page); - rx_queue->page_ring = kcalloc(page_ring_size, - sizeof(*rx_queue->page_ring), GFP_KERNEL); + rx_queue->page_ring = kzalloc_objs(*rx_queue->page_ring, page_ring_size, + GFP_KERNEL); if (!rx_queue->page_ring) rx_queue->page_ptr_mask = 0; else @@ -204,8 +204,7 @@ int efx_probe_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kcalloc(entries, sizeof(*rx_queue->buffer), - GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); if (!rx_queue->buffer) return -ENOMEM; @@ -709,7 +708,7 @@ struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx, return rule; } } - rule = kmalloc(sizeof(*rule), GFP_ATOMIC); + rule = kmalloc_obj(*rule, GFP_ATOMIC); *new = true; if (rule) { memcpy(&rule->spec, spec, sizeof(rule->spec)); diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c index 894fad0bb5ea..ef37de056a19 100644 --- a/drivers/net/ethernet/sfc/selftest.c +++ b/drivers/net/ethernet/sfc/selftest.c @@ -542,8 +542,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue, /* Determine how many packets to send */ state->packet_count = efx->txq_entries / 3; state->packet_count = min(1 << (i << 2), state->packet_count); - state->skbs = kcalloc(state->packet_count, - sizeof(state->skbs[0]), GFP_KERNEL); + state->skbs = kzalloc_objs(state->skbs[0], state->packet_count, + GFP_KERNEL); if (!state->skbs) return -ENOMEM; state->flush = false; @@ -628,7 +628,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/siena/efx_channels.c b/drivers/net/ethernet/sfc/siena/efx_channels.c index fc075ab6b7b5..f2ed3c8b1f5d 100644 --- a/drivers/net/ethernet/sfc/siena/efx_channels.c +++ b/drivers/net/ethernet/sfc/siena/efx_channels.c @@ -536,7 +536,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i) struct efx_channel *channel; int j; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -607,7 +607,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) struct efx_channel *channel; int j; - channel = kmalloc(sizeof(*channel), GFP_KERNEL); + channel = kmalloc_obj(*channel, GFP_KERNEL); if (!channel) return NULL; @@ -966,9 +966,9 @@ int efx_siena_set_channels(struct efx_nic *efx) EFX_WARN_ON_PARANOID(efx->xdp_tx_queues); /* Allocate array for XDP TX queue lookup. */ - efx->xdp_tx_queues = kcalloc(efx->xdp_tx_queue_count, - sizeof(*efx->xdp_tx_queues), - GFP_KERNEL); + efx->xdp_tx_queues = kzalloc_objs(*efx->xdp_tx_queues, + efx->xdp_tx_queue_count, + GFP_KERNEL); if (!efx->xdp_tx_queues) return -ENOMEM; } diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index 35036cc902fe..07e650f2d13e 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -1023,8 +1023,8 @@ int efx_siena_init_struct(struct efx_nic *efx, mutex_init(&efx->rps_mutex); spin_lock_init(&efx->rps_hash_lock); /* Failure to allocate is not fatal, but may degrade ARFS performance */ - efx->rps_hash_table = kcalloc(EFX_ARFS_HASH_TABLE_SIZE, - sizeof(*efx->rps_hash_table), GFP_KERNEL); + efx->rps_hash_table = kzalloc_objs(*efx->rps_hash_table, + EFX_ARFS_HASH_TABLE_SIZE, GFP_KERNEL); #endif efx->mdio.dev = net_dev; INIT_WORK(&efx->mac_work, efx_mac_work); diff --git a/drivers/net/ethernet/sfc/siena/ethtool_common.c b/drivers/net/ethernet/sfc/siena/ethtool_common.c index c56e0b54d854..cb19af6aafd9 100644 --- a/drivers/net/ethernet/sfc/siena/ethtool_common.c +++ b/drivers/net/ethernet/sfc/siena/ethtool_common.c @@ -355,7 +355,7 @@ void efx_siena_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL); + efx_tests = kzalloc_obj(*efx_tests, GFP_KERNEL); if (!efx_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c index 562a038e38a7..ab2e36520fb9 100644 --- a/drivers/net/ethernet/sfc/siena/farch.c +++ b/drivers/net/ethernet/sfc/siena/farch.c @@ -2790,7 +2790,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx) struct efx_farch_filter_table *table; unsigned table_id; - state = kzalloc(sizeof(struct efx_farch_filter_state), GFP_KERNEL); + state = kzalloc_obj(struct efx_farch_filter_state, GFP_KERNEL); if (!state) return -ENOMEM; efx->filter_state = state; diff --git a/drivers/net/ethernet/sfc/siena/mcdi.c b/drivers/net/ethernet/sfc/siena/mcdi.c index c8f0fb43e285..3bee5c0e6edc 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.c +++ b/drivers/net/ethernet/sfc/siena/mcdi.c @@ -65,7 +65,7 @@ int efx_siena_mcdi_init(struct efx_nic *efx) bool already_attached; int rc = -ENOMEM; - efx->mcdi = kzalloc(sizeof(*efx->mcdi), GFP_KERNEL); + efx->mcdi = kzalloc_obj(*efx->mcdi, GFP_KERNEL); if (!efx->mcdi) goto fail; diff --git a/drivers/net/ethernet/sfc/siena/mcdi_mon.c b/drivers/net/ethernet/sfc/siena/mcdi_mon.c index 56a9c56ed9e3..ddf7d712fb21 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/siena/mcdi_mon.c @@ -350,13 +350,13 @@ int efx_siena_mcdi_mon_probe(struct efx_nic *efx) * value, min, max, crit, alarm and label for each sensor. */ n_attrs = 6 * n_sensors; - hwmon->attrs = kcalloc(n_attrs, sizeof(*hwmon->attrs), GFP_KERNEL); + hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs, GFP_KERNEL); if (!hwmon->attrs) { rc = -ENOMEM; goto fail; } - hwmon->group.attrs = kcalloc(n_attrs + 1, sizeof(struct attribute *), - GFP_KERNEL); + hwmon->group.attrs = kzalloc_objs(struct attribute *, n_attrs + 1, + GFP_KERNEL); if (!hwmon->group.attrs) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/ethernet/sfc/siena/mcdi_port_common.c b/drivers/net/ethernet/sfc/siena/mcdi_port_common.c index 067fe0f4393a..6154d09f9dde 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi_port_common.c +++ b/drivers/net/ethernet/sfc/siena/mcdi_port_common.c @@ -430,7 +430,7 @@ int efx_siena_mcdi_phy_probe(struct efx_nic *efx) int rc; /* Initialise and populate phy_data */ - phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); if (phy_data == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/ptp.c b/drivers/net/ethernet/sfc/siena/ptp.c index 062c77c92077..2cb1d0fc9daa 100644 --- a/drivers/net/ethernet/sfc/siena/ptp.c +++ b/drivers/net/ethernet/sfc/siena/ptp.c @@ -1443,7 +1443,7 @@ static int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) int rc = 0; unsigned int pos; - ptp = kzalloc(sizeof(struct efx_ptp_data), GFP_KERNEL); + ptp = kzalloc_obj(struct efx_ptp_data, GFP_KERNEL); efx->ptp_data = ptp; if (!efx->ptp_data) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/rx_common.c b/drivers/net/ethernet/sfc/siena/rx_common.c index 4ae09505e417..71549c21ebc1 100644 --- a/drivers/net/ethernet/sfc/siena/rx_common.c +++ b/drivers/net/ethernet/sfc/siena/rx_common.c @@ -141,8 +141,8 @@ static void efx_init_rx_recycle_ring(struct efx_rx_queue *rx_queue) bufs_in_recycle_ring = efx_rx_recycle_ring_size(efx); page_ring_size = roundup_pow_of_two(bufs_in_recycle_ring / efx->rx_bufs_per_page); - rx_queue->page_ring = kcalloc(page_ring_size, - sizeof(*rx_queue->page_ring), GFP_KERNEL); + rx_queue->page_ring = kzalloc_objs(*rx_queue->page_ring, page_ring_size, + GFP_KERNEL); if (!rx_queue->page_ring) rx_queue->page_ptr_mask = 0; else @@ -207,8 +207,7 @@ int efx_siena_probe_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kcalloc(entries, sizeof(*rx_queue->buffer), - GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); if (!rx_queue->buffer) return -ENOMEM; @@ -696,7 +695,7 @@ static struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx, return rule; } } - rule = kmalloc(sizeof(*rule), GFP_ATOMIC); + rule = kmalloc_obj(*rule, GFP_ATOMIC); *new = true; if (rule) { memcpy(&rule->spec, spec, sizeof(rule->spec)); diff --git a/drivers/net/ethernet/sfc/siena/selftest.c b/drivers/net/ethernet/sfc/siena/selftest.c index 526da43d4b61..668e6771b8bf 100644 --- a/drivers/net/ethernet/sfc/siena/selftest.c +++ b/drivers/net/ethernet/sfc/siena/selftest.c @@ -543,8 +543,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue, /* Determine how many packets to send */ state->packet_count = efx->txq_entries / 3; state->packet_count = min(1 << (i << 2), state->packet_count); - state->skbs = kcalloc(state->packet_count, - sizeof(state->skbs[0]), GFP_KERNEL); + state->skbs = kzalloc_objs(state->skbs[0], state->packet_count, + GFP_KERNEL); if (!state->skbs) return -ENOMEM; state->flush = false; @@ -633,7 +633,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/siena/siena.c b/drivers/net/ethernet/sfc/siena/siena.c index 49f0c8a1a90a..4718a31b4d94 100644 --- a/drivers/net/ethernet/sfc/siena/siena.c +++ b/drivers/net/ethernet/sfc/siena/siena.c @@ -266,7 +266,7 @@ static int siena_probe_nic(struct efx_nic *efx) int rc; /* Allocate storage for hardware specific data */ - nic_data = kzalloc(sizeof(struct siena_nic_data), GFP_KERNEL); + nic_data = kzalloc_obj(struct siena_nic_data, GFP_KERNEL); if (!nic_data) return -ENOMEM; nic_data->efx = efx; @@ -923,7 +923,7 @@ static int siena_mtd_probe(struct efx_nic *efx) if (rc) return rc; - parts = kcalloc(hweight32(nvram_types), sizeof(*parts), GFP_KERNEL); + parts = kzalloc_objs(*parts, hweight32(nvram_types), GFP_KERNEL); if (!parts) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/siena_sriov.c b/drivers/net/ethernet/sfc/siena/siena_sriov.c index 8353c15dc233..bcab299f7204 100644 --- a/drivers/net/ethernet/sfc/siena/siena_sriov.c +++ b/drivers/net/ethernet/sfc/siena/siena_sriov.c @@ -1123,7 +1123,7 @@ static void efx_siena_sriov_peer_work(struct work_struct *data) ++peer_count; if (--peer_space == 0) { if (list_empty(&pages)) { - epp = kmalloc(sizeof(*epp), GFP_KERNEL); + epp = kmalloc_obj(*epp, GFP_KERNEL); if (!epp) break; epp->ptr = dma_alloc_coherent( @@ -1197,8 +1197,7 @@ static int efx_siena_sriov_vf_alloc(struct efx_nic *efx) struct siena_vf *vf; struct siena_nic_data *nic_data = efx->nic_data; - nic_data->vf = kcalloc(efx->vf_count, sizeof(*nic_data->vf), - GFP_KERNEL); + nic_data->vf = kzalloc_objs(*nic_data->vf, efx->vf_count, GFP_KERNEL); if (!nic_data->vf) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/tx_common.c b/drivers/net/ethernet/sfc/siena/tx_common.c index 71f9b5ec5ae4..ca7f910a4847 100644 --- a/drivers/net/ethernet/sfc/siena/tx_common.c +++ b/drivers/net/ethernet/sfc/siena/tx_common.c @@ -36,13 +36,13 @@ int efx_siena_probe_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kcalloc(entries, sizeof(*tx_queue->buffer), - GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); if (!tx_queue->buffer) return -ENOMEM; - tx_queue->cb_page = kcalloc(efx_tx_cb_page_count(tx_queue), - sizeof(tx_queue->cb_page[0]), GFP_KERNEL); + tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0], + efx_tx_cb_page_count(tx_queue), + GFP_KERNEL); if (!tx_queue->cb_page) { rc = -ENOMEM; goto fail1; diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c index fa94aa3cd5fe..bf39fb5e4bb6 100644 --- a/drivers/net/ethernet/sfc/tc.c +++ b/drivers/net/ethernet/sfc/tc.c @@ -126,7 +126,7 @@ static struct efx_tc_mac_pedit_action *efx_tc_flower_get_mac(struct efx_nic *efx struct efx_tc_mac_pedit_action *ped, *old; int rc; - ped = kzalloc(sizeof(*ped), GFP_USER); + ped = kzalloc_obj(*ped, GFP_USER); if (!ped) return ERR_PTR(-ENOMEM); memcpy(ped->h_addr, h_addr, ETH_ALEN); @@ -571,7 +571,7 @@ static int efx_tc_flower_record_encap_match(struct efx_nic *efx, if (rc) goto fail_pseudo; - encap = kzalloc(sizeof(*encap), GFP_USER); + encap = kzalloc_obj(*encap, GFP_USER); if (!encap) { rc = -ENOMEM; goto fail_pseudo; @@ -694,7 +694,7 @@ static struct efx_tc_recirc_id *efx_tc_get_recirc_id(struct efx_nic *efx, struct efx_tc_recirc_id *rid, *old; int rc; - rid = kzalloc(sizeof(*rid), GFP_USER); + rid = kzalloc_obj(*rid, GFP_USER); if (!rid) return ERR_PTR(-ENOMEM); rid->chain_index = chain_index; @@ -1505,7 +1505,7 @@ static int efx_tc_flower_replace_foreign_lhs_ar(struct efx_nic *efx, if (rc) goto release_encap_match; - rule = kzalloc(sizeof(*rule), GFP_USER); + rule = kzalloc_obj(*rule, GFP_USER); if (!rule) { rc = -ENOMEM; goto release_encap_match; @@ -1618,7 +1618,7 @@ static int efx_tc_flower_replace_foreign_lhs(struct efx_nic *efx, if (rc) goto release_encap_match; - rule = kzalloc(sizeof(*rule), GFP_USER); + rule = kzalloc_obj(*rule, GFP_USER); if (!rule) { rc = -ENOMEM; goto release_encap_match; @@ -1794,7 +1794,7 @@ static int efx_tc_flower_replace_foreign(struct efx_nic *efx, goto release; } - rule = kzalloc(sizeof(*rule), GFP_USER); + rule = kzalloc_obj(*rule, GFP_USER); if (!rule) { rc = -ENOMEM; goto release; @@ -1815,7 +1815,7 @@ static int efx_tc_flower_replace_foreign(struct efx_nic *efx, goto release; } - act = kzalloc(sizeof(*act), GFP_USER); + act = kzalloc_obj(*act, GFP_USER); if (!act) { rc = -ENOMEM; goto release; @@ -1901,7 +1901,7 @@ static int efx_tc_flower_replace_foreign(struct efx_nic *efx, if (fa->id == FLOW_ACTION_REDIRECT) break; /* end of the line */ /* Mirror, so continue on with saved act */ - act = kzalloc(sizeof(*act), GFP_USER); + act = kzalloc_obj(*act, GFP_USER); if (!act) { rc = -ENOMEM; goto release; @@ -2016,7 +2016,7 @@ static int efx_tc_flower_replace_lhs(struct efx_nic *efx, if (rc) return rc; - rule = kzalloc(sizeof(*rule), GFP_USER); + rule = kzalloc_obj(*rule, GFP_USER); if (!rule) return -ENOMEM; rule->cookie = tc->cookie; @@ -2177,7 +2177,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, if (rc) goto release; - rule = kzalloc(sizeof(*rule), GFP_USER); + rule = kzalloc_obj(*rule, GFP_USER); if (!rule) { rc = -ENOMEM; goto release; @@ -2199,7 +2199,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, } /* Parse actions */ - act = kzalloc(sizeof(*act), GFP_USER); + act = kzalloc_obj(*act, GFP_USER); if (!act) { rc = -ENOMEM; goto release; @@ -2340,7 +2340,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, break; /* end of the line */ /* Mirror, so continue on with saved act */ save.count = NULL; - act = kzalloc(sizeof(*act), GFP_USER); + act = kzalloc_obj(*act, GFP_USER); if (!act) { rc = -ENOMEM; goto release; @@ -2380,7 +2380,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, break; /* end of the line */ /* Mirror, so continue on with saved act */ save.count = NULL; - act = kzalloc(sizeof(*act), GFP_USER); + act = kzalloc_obj(*act, GFP_USER); if (!act) { rc = -ENOMEM; goto release; @@ -2672,7 +2672,7 @@ static int efx_tc_configure_default_rule(struct efx_nic *efx, u32 ing_port, match->value.ingress_port = ing_port; match->mask.ingress_port = ~0; - act = kzalloc(sizeof(*act), GFP_KERNEL); + act = kzalloc_obj(*act, GFP_KERNEL); if (!act) return -ENOMEM; act->deliver = 1; @@ -2745,7 +2745,7 @@ static int efx_tc_configure_fallback_acts(struct efx_nic *efx, u32 eg_port, struct efx_tc_action_set *act; int rc; - act = kzalloc(sizeof(*act), GFP_KERNEL); + act = kzalloc_obj(*act, GFP_KERNEL); if (!act) return -ENOMEM; act->deliver = 1; @@ -2988,10 +2988,10 @@ int efx_init_struct_tc(struct efx_nic *efx) if (efx->type->is_vf) return 0; - efx->tc = kzalloc(sizeof(*efx->tc), GFP_KERNEL); + efx->tc = kzalloc_obj(*efx->tc, GFP_KERNEL); if (!efx->tc) return -ENOMEM; - efx->tc->caps = kzalloc(sizeof(struct mae_caps), GFP_KERNEL); + efx->tc->caps = kzalloc_obj(struct mae_caps, GFP_KERNEL); if (!efx->tc->caps) { rc = -ENOMEM; goto fail_alloc_caps; diff --git a/drivers/net/ethernet/sfc/tc_bindings.c b/drivers/net/ethernet/sfc/tc_bindings.c index 1b79c535c54e..c4b187b51a69 100644 --- a/drivers/net/ethernet/sfc/tc_bindings.c +++ b/drivers/net/ethernet/sfc/tc_bindings.c @@ -59,7 +59,7 @@ static struct efx_tc_block_binding *efx_tc_create_binding( struct efx_nic *efx, struct efx_rep *efv, struct net_device *otherdev, struct flow_block *block) { - struct efx_tc_block_binding *binding = kmalloc(sizeof(*binding), GFP_KERNEL); + struct efx_tc_block_binding *binding = kmalloc_obj(*binding, GFP_KERNEL); if (!binding) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sfc/tc_conntrack.c b/drivers/net/ethernet/sfc/tc_conntrack.c index c0603f54cec3..77ce2eca43f2 100644 --- a/drivers/net/ethernet/sfc/tc_conntrack.c +++ b/drivers/net/ethernet/sfc/tc_conntrack.c @@ -365,7 +365,7 @@ static int efx_tc_ct_replace(struct efx_tc_ct_zone *ct_zone, if (WARN_ON(!efx->tc->up)) return -ENETDOWN; - conn = kzalloc(sizeof(*conn), GFP_USER); + conn = kzalloc_obj(*conn, GFP_USER); if (!conn) return -ENOMEM; conn->cookie = tc->cookie; @@ -562,7 +562,7 @@ struct efx_tc_ct_zone *efx_tc_ct_register_zone(struct efx_nic *efx, u16 zone, struct efx_tc_ct_zone *ct_zone, *old; int rc; - ct_zone = kzalloc(sizeof(*ct_zone), GFP_USER); + ct_zone = kzalloc_obj(*ct_zone, GFP_USER); if (!ct_zone) return ERR_PTR(-ENOMEM); ct_zone->zone = zone; diff --git a/drivers/net/ethernet/sfc/tc_counters.c b/drivers/net/ethernet/sfc/tc_counters.c index a421b0123506..d168282f30bf 100644 --- a/drivers/net/ethernet/sfc/tc_counters.c +++ b/drivers/net/ethernet/sfc/tc_counters.c @@ -135,7 +135,7 @@ struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx, struct efx_tc_counter *cnt; int rc, rc2; - cnt = kzalloc(sizeof(*cnt), GFP_USER); + cnt = kzalloc_obj(*cnt, GFP_USER); if (!cnt) return ERR_PTR(-ENOMEM); @@ -226,7 +226,7 @@ struct efx_tc_counter_index *efx_tc_flower_get_counter_index( struct efx_tc_counter_index *ctr, *old; struct efx_tc_counter *cnt; - ctr = kzalloc(sizeof(*ctr), GFP_USER); + ctr = kzalloc_obj(*ctr, GFP_USER); if (!ctr) return ERR_PTR(-ENOMEM); ctr->cookie = cookie; diff --git a/drivers/net/ethernet/sfc/tc_encap_actions.c b/drivers/net/ethernet/sfc/tc_encap_actions.c index eef06e48185d..da35705cc5e1 100644 --- a/drivers/net/ethernet/sfc/tc_encap_actions.c +++ b/drivers/net/ethernet/sfc/tc_encap_actions.c @@ -120,7 +120,7 @@ static int efx_bind_neigh(struct efx_nic *efx, return -EOPNOTSUPP; } - neigh = kzalloc(sizeof(*neigh), GFP_KERNEL_ACCOUNT); + neigh = kzalloc_obj(*neigh, GFP_KERNEL_ACCOUNT); if (!neigh) return -ENOMEM; neigh->net = get_net_track(net, &neigh->ns_tracker, GFP_KERNEL_ACCOUNT); @@ -632,7 +632,7 @@ struct efx_tc_encap_action *efx_tc_flower_create_encap_md( info->mode); return ERR_PTR(-EOPNOTSUPP); } - encap = kzalloc(sizeof(*encap), GFP_KERNEL_ACCOUNT); + encap = kzalloc_obj(*encap, GFP_KERNEL_ACCOUNT); if (!encap) return ERR_PTR(-ENOMEM); encap->type = type; diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index a22a0d634ffc..4437e2c424f7 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -36,13 +36,13 @@ int efx_probe_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kcalloc(entries, sizeof(*tx_queue->buffer), - GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); if (!tx_queue->buffer) return -ENOMEM; - tx_queue->cb_page = kcalloc(efx_tx_cb_page_count(tx_queue), - sizeof(tx_queue->cb_page[0]), GFP_KERNEL); + tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0], + efx_tx_cb_page_count(tx_queue), + GFP_KERNEL); if (!tx_queue->cb_page) { rc = -ENOMEM; goto fail1; diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c index 15e46e6ac262..c06387ed3bf1 100644 --- a/drivers/net/ethernet/sis/sis190.c +++ b/drivers/net/ethernet/sis/sis190.c @@ -1407,7 +1407,7 @@ static int sis190_mii_probe(struct net_device *dev) if (status == 0xffff || status == 0x0000) continue; - phy = kmalloc(sizeof(*phy), GFP_KERNEL); + phy = kmalloc_obj(*phy, GFP_KERNEL); if (!phy) { sis190_free_phy(&tp->first_phy); rc = -ENOMEM; diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index d85ac8cbeb00..b756eea09513 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c @@ -619,7 +619,7 @@ static int sis900_mii_probe(struct net_device *net_dev) continue; } - if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { + if ((mii_phy = kmalloc_obj(struct mii_phy, GFP_KERNEL)) == NULL) { mii_phy = sis_priv->first_mii; while (mii_phy) { struct mii_phy *phy; diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c index f30d4b17c7fb..02482de18b56 100644 --- a/drivers/net/ethernet/smsc/smsc9420.c +++ b/drivers/net/ethernet/smsc/smsc9420.c @@ -1179,9 +1179,8 @@ static int smsc9420_alloc_tx_ring(struct smsc9420_pdata *pd) BUG_ON(!pd->tx_ring); - pd->tx_buffers = kmalloc_array(TX_RING_SIZE, - sizeof(struct smsc9420_ring_info), - GFP_KERNEL); + pd->tx_buffers = kmalloc_objs(struct smsc9420_ring_info, TX_RING_SIZE, + GFP_KERNEL); if (!pd->tx_buffers) return -ENOMEM; @@ -1212,9 +1211,8 @@ static int smsc9420_alloc_rx_ring(struct smsc9420_pdata *pd) BUG_ON(!pd->rx_ring); - pd->rx_buffers = kmalloc_array(RX_RING_SIZE, - sizeof(struct smsc9420_ring_info), - GFP_KERNEL); + pd->rx_buffers = kmalloc_objs(struct smsc9420_ring_info, RX_RING_SIZE, + GFP_KERNEL); if (pd->rx_buffers == NULL) goto out; diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index ee890de69ffe..3b6008cad3a5 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1263,7 +1263,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id) if (!dring->vaddr) goto err; - dring->desc = kcalloc(DESC_NUM, sizeof(*dring->desc), GFP_KERNEL); + dring->desc = kzalloc_objs(*dring->desc, DESC_NUM, GFP_KERNEL); if (!dring->desc) goto err; diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index 4700998c4837..3c581d71c00e 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -1273,15 +1273,13 @@ static int ave_open(struct net_device *ndev) if (ret) return ret; - priv->tx.desc = kcalloc(priv->tx.ndesc, sizeof(*priv->tx.desc), - GFP_KERNEL); + priv->tx.desc = kzalloc_objs(*priv->tx.desc, priv->tx.ndesc, GFP_KERNEL); if (!priv->tx.desc) { ret = -ENOMEM; goto out_free_irq; } - priv->rx.desc = kcalloc(priv->rx.ndesc, sizeof(*priv->rx.desc), - GFP_KERNEL); + priv->rx.desc = kzalloc_objs(*priv->rx.desc, priv->rx.ndesc, GFP_KERNEL); if (!priv->rx.desc) { kfree(priv->tx.desc); ret = -ENOMEM; diff --git a/drivers/net/ethernet/spacemit/k1_emac.c b/drivers/net/ethernet/spacemit/k1_emac.c index dab0772c5b9d..870ab19395d6 100644 --- a/drivers/net/ethernet/spacemit/k1_emac.c +++ b/drivers/net/ethernet/spacemit/k1_emac.c @@ -391,9 +391,8 @@ static int emac_alloc_tx_resources(struct emac_priv *priv) struct emac_desc_ring *tx_ring = &priv->tx_ring; struct platform_device *pdev = priv->pdev; - tx_ring->tx_desc_buf = kcalloc(tx_ring->total_cnt, - sizeof(*tx_ring->tx_desc_buf), - GFP_KERNEL); + tx_ring->tx_desc_buf = kzalloc_objs(*tx_ring->tx_desc_buf, + tx_ring->total_cnt, GFP_KERNEL); if (!tx_ring->tx_desc_buf) return -ENOMEM; @@ -420,9 +419,8 @@ static int emac_alloc_rx_resources(struct emac_priv *priv) struct emac_desc_ring *rx_ring = &priv->rx_ring; struct platform_device *pdev = priv->pdev; - rx_ring->rx_desc_buf = kcalloc(rx_ring->total_cnt, - sizeof(*rx_ring->rx_desc_buf), - GFP_KERNEL); + rx_ring->rx_desc_buf = kzalloc_objs(*rx_ring->rx_desc_buf, + rx_ring->total_cnt, GFP_KERNEL); if (!rx_ring->rx_desc_buf) return -ENOMEM; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 82375d34ad57..ebda64cd1bf2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2212,9 +2212,8 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, return ret; } - rx_q->buf_pool = kcalloc(dma_conf->dma_rx_size, - sizeof(*rx_q->buf_pool), - GFP_KERNEL); + rx_q->buf_pool = kzalloc_objs(*rx_q->buf_pool, dma_conf->dma_rx_size, + GFP_KERNEL); if (!rx_q->buf_pool) return -ENOMEM; @@ -2297,15 +2296,13 @@ static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, tx_q->queue_index = queue; tx_q->priv_data = priv; - tx_q->tx_skbuff_dma = kcalloc(dma_conf->dma_tx_size, - sizeof(*tx_q->tx_skbuff_dma), - GFP_KERNEL); + tx_q->tx_skbuff_dma = kzalloc_objs(*tx_q->tx_skbuff_dma, + dma_conf->dma_tx_size, GFP_KERNEL); if (!tx_q->tx_skbuff_dma) return -ENOMEM; - tx_q->tx_skbuff = kcalloc(dma_conf->dma_tx_size, - sizeof(struct sk_buff *), - GFP_KERNEL); + tx_q->tx_skbuff = kzalloc_objs(struct sk_buff *, dma_conf->dma_tx_size, + GFP_KERNEL); if (!tx_q->tx_skbuff) return -ENOMEM; @@ -4016,7 +4013,7 @@ stmmac_setup_dma_desc(struct stmmac_priv *priv, unsigned int mtu) struct stmmac_dma_conf *dma_conf; int chan, bfsize, ret; - dma_conf = kzalloc(sizeof(*dma_conf), GFP_KERNEL); + dma_conf = kzalloc_obj(*dma_conf, GFP_KERNEL); if (!dma_conf) { netdev_err(priv->dev, "%s: DMA conf allocation failed\n", __func__); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 08b60b7d5fd6..8f18a2eab33e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -324,7 +324,7 @@ static int __stmmac_test_loopback(struct stmmac_priv *priv, struct sk_buff *skb = NULL; int ret = 0; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; @@ -434,11 +434,11 @@ static int stmmac_test_eee(struct stmmac_priv *priv) if (!priv->dma_cap.eee || !priv->eee_active) return -EOPNOTSUPP; - initial = kzalloc(sizeof(*initial), GFP_KERNEL); + initial = kzalloc_obj(*initial, GFP_KERNEL); if (!initial) return -ENOMEM; - final = kzalloc(sizeof(*final), GFP_KERNEL); + final = kzalloc_obj(*final, GFP_KERNEL); if (!final) { ret = -ENOMEM; goto out_free_initial; @@ -744,7 +744,7 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv) if (!phydev || (!phydev->pause && !phydev->asym_pause)) return -EOPNOTSUPP; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; @@ -898,7 +898,7 @@ static int __stmmac_test_vlanfilt(struct stmmac_priv *priv) struct sk_buff *skb = NULL; int ret = 0, i; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; @@ -991,7 +991,7 @@ static int __stmmac_test_dvlanfilt(struct stmmac_priv *priv) struct sk_buff *skb = NULL; int ret = 0, i; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; @@ -1095,23 +1095,23 @@ static int stmmac_test_rxp(struct stmmac_priv *priv) if (!priv->dma_cap.frpsel) return -EOPNOTSUPP; - sel = kzalloc(struct_size(sel, keys, nk), GFP_KERNEL); + sel = kzalloc_flex(*sel, keys, nk, GFP_KERNEL); if (!sel) return -ENOMEM; - exts = kzalloc(sizeof(*exts), GFP_KERNEL); + exts = kzalloc_obj(*exts, GFP_KERNEL); if (!exts) { ret = -ENOMEM; goto cleanup_sel; } - actions = kcalloc(nk, sizeof(*actions), GFP_KERNEL); + actions = kzalloc_objs(*actions, nk, GFP_KERNEL); if (!actions) { ret = -ENOMEM; goto cleanup_exts; } - gact = kcalloc(nk, sizeof(*gact), GFP_KERNEL); + gact = kzalloc_objs(*gact, nk, GFP_KERNEL); if (!gact) { ret = -ENOMEM; goto cleanup_actions; @@ -1266,7 +1266,7 @@ static int stmmac_test_vlanoff_common(struct stmmac_priv *priv, bool svlan) if (!priv->dma_cap.vlins) return -EOPNOTSUPP; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; @@ -1349,7 +1349,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, priv->plat->rx_queues_to_use); } - dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); + dissector = kzalloc_obj(*dissector, GFP_KERNEL); if (!dissector) { ret = -ENOMEM; goto cleanup_rss; @@ -1358,7 +1358,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_IPV4_ADDRS); dissector->offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] = 0; - cls = kzalloc(sizeof(*cls), GFP_KERNEL); + cls = kzalloc_obj(*cls, GFP_KERNEL); if (!cls) { ret = -ENOMEM; goto cleanup_dissector; @@ -1368,7 +1368,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, cls->command = FLOW_CLS_REPLACE; cls->cookie = dummy_cookie; - rule = kzalloc(struct_size(rule, action.entries, 1), GFP_KERNEL); + rule = kzalloc_flex(*rule, action.entries, 1, GFP_KERNEL); if (!rule) { ret = -ENOMEM; goto cleanup_cls; @@ -1475,7 +1475,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, priv->plat->rx_queues_to_use); } - dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); + dissector = kzalloc_obj(*dissector, GFP_KERNEL); if (!dissector) { ret = -ENOMEM; goto cleanup_rss; @@ -1486,7 +1486,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, dissector->offset[FLOW_DISSECTOR_KEY_BASIC] = 0; dissector->offset[FLOW_DISSECTOR_KEY_PORTS] = offsetof(typeof(keys), key); - cls = kzalloc(sizeof(*cls), GFP_KERNEL); + cls = kzalloc_obj(*cls, GFP_KERNEL); if (!cls) { ret = -ENOMEM; goto cleanup_dissector; @@ -1496,7 +1496,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, cls->command = FLOW_CLS_REPLACE; cls->cookie = dummy_cookie; - rule = kzalloc(struct_size(rule, action.entries, 1), GFP_KERNEL); + rule = kzalloc_flex(*rule, action.entries, 1, GFP_KERNEL); if (!rule) { ret = -ENOMEM; goto cleanup_cls; @@ -1628,7 +1628,7 @@ static int stmmac_test_arpoffload(struct stmmac_priv *priv) if (!priv->dma_cap.arpoffsel) return -EOPNOTSUPP; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c index acfb523214b9..fe00e7dd3fe4 100644 --- a/drivers/net/ethernet/sun/cassini.c +++ b/drivers/net/ethernet/sun/cassini.c @@ -465,7 +465,7 @@ static cas_page_t *cas_page_alloc(struct cas *cp, const gfp_t flags) { cas_page_t *page; - page = kmalloc(sizeof(cas_page_t), flags); + page = kmalloc_obj(cas_page_t, flags); if (!page) return NULL; diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c index 6fc37ab27f7b..c1102acbb1e0 100644 --- a/drivers/net/ethernet/sun/ldmvsw.c +++ b/drivers/net/ethernet/sun/ldmvsw.c @@ -202,7 +202,7 @@ static struct vnet *vsw_get_vnet(struct mdesc_handle *hp, } if (!vp) { - vp = kzalloc(sizeof(*vp), GFP_KERNEL); + vp = kzalloc_obj(*vp, GFP_KERNEL); if (unlikely(!vp)) { mutex_unlock(&vnet_list_mutex); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index f035e3bbbef8..2d31e6112ca6 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -4341,8 +4341,7 @@ static int niu_alloc_rx_ring_info(struct niu *np, { BUILD_BUG_ON(sizeof(struct rxdma_mailbox) != 64); - rp->rxhash = kcalloc(MAX_RBR_RING_SIZE, sizeof(struct page *), - GFP_KERNEL); + rp->rxhash = kzalloc_objs(struct page *, MAX_RBR_RING_SIZE, GFP_KERNEL); if (!rp->rxhash) return -ENOMEM; @@ -4485,8 +4484,7 @@ static int niu_alloc_channels(struct niu *np) num_rx_rings = parent->rxchan_per_port[port]; num_tx_rings = parent->txchan_per_port[port]; - rx_rings = kcalloc(num_rx_rings, sizeof(struct rx_ring_info), - GFP_KERNEL); + rx_rings = kzalloc_objs(struct rx_ring_info, num_rx_rings, GFP_KERNEL); err = -ENOMEM; if (!rx_rings) goto out_err; @@ -4525,8 +4523,7 @@ static int niu_alloc_channels(struct niu *np) goto out_err; } - tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info), - GFP_KERNEL); + tx_rings = kzalloc_objs(struct tx_ring_info, num_tx_rings, GFP_KERNEL); err = -ENOMEM; if (!tx_rings) goto out_err; @@ -9514,7 +9511,7 @@ static struct niu_parent *niu_new_parent(struct niu *np, goto fail_unregister; } - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) goto fail_unregister; diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 666998082998..1984a6de65ee 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2248,7 +2248,7 @@ static struct quattro *quattro_sbus_find(struct platform_device *child) if (qp) return qp; - qp = kzalloc(sizeof(*qp), GFP_KERNEL); + qp = kzalloc_obj(*qp, GFP_KERNEL); if (!qp) return NULL; @@ -2278,7 +2278,7 @@ static struct quattro *quattro_pci_find(struct pci_dev *pdev) return qp; } - qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); + qp = kmalloc_obj(struct quattro, GFP_KERNEL); if (!qp) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c index 2920341b14a0..36187e85b7e6 100644 --- a/drivers/net/ethernet/sun/sunqe.c +++ b/drivers/net/ethernet/sun/sunqe.c @@ -771,7 +771,7 @@ static struct sunqec *get_qec(struct platform_device *child) qecp = platform_get_drvdata(op); if (!qecp) { - qecp = kzalloc(sizeof(struct sunqec), GFP_KERNEL); + qecp = kzalloc_obj(struct sunqec, GFP_KERNEL); if (qecp) { u32 ctrl; diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index a2a3e94da4b8..7c756e07eb55 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -436,7 +436,7 @@ static int vnet_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto err_out_put_mdesc; } - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); err = -ENOMEM; if (!port) goto err_out_put_mdesc; diff --git a/drivers/net/ethernet/sun/sunvnet_common.c b/drivers/net/ethernet/sun/sunvnet_common.c index 0212853c9430..5cca95869052 100644 --- a/drivers/net/ethernet/sun/sunvnet_common.c +++ b/drivers/net/ethernet/sun/sunvnet_common.c @@ -1571,7 +1571,7 @@ static void __update_mc_list(struct vnet *vp, struct net_device *dev) } if (!m) { - m = kzalloc(sizeof(*m), GFP_ATOMIC); + m = kzalloc_obj(*m, GFP_ATOMIC); if (!m) continue; memcpy(m->addr, ha->addr, ETH_ALEN); diff --git a/drivers/net/ethernet/sunplus/spl2sw_desc.c b/drivers/net/ethernet/sunplus/spl2sw_desc.c index 3f0d9f78b37d..f6b42cda693a 100644 --- a/drivers/net/ethernet/sunplus/spl2sw_desc.c +++ b/drivers/net/ethernet/sunplus/spl2sw_desc.c @@ -129,8 +129,9 @@ int spl2sw_rx_descs_init(struct spl2sw_common *comm) u32 i, j; for (i = 0; i < RX_DESC_QUEUE_NUM; i++) { - comm->rx_skb_info[i] = kcalloc(comm->rx_desc_num[i], sizeof(*rx_skbinfo), - GFP_KERNEL | GFP_DMA); + comm->rx_skb_info[i] = kzalloc_objs(*rx_skbinfo, + comm->rx_desc_num[i], + GFP_KERNEL | GFP_DMA); if (!comm->rx_skb_info[i]) goto mem_alloc_fail; diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c index 589797bad1f9..cda6ee474400 100644 --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c @@ -140,9 +140,8 @@ static int xlgmac_init_ring(struct xlgmac_pdata *pdata, return -ENOMEM; /* Array of descriptor data */ - ring->desc_data_head = kcalloc(dma_desc_count, - sizeof(struct xlgmac_desc_data), - GFP_KERNEL); + ring->desc_data_head = kzalloc_objs(struct xlgmac_desc_data, + dma_desc_count, GFP_KERNEL); if (!ring->desc_data_head) return -ENOMEM; @@ -234,21 +233,21 @@ static int xlgmac_alloc_channels(struct xlgmac_pdata *pdata) int ret = -ENOMEM; unsigned int i; - channel_head = kcalloc(pdata->channel_count, - sizeof(struct xlgmac_channel), GFP_KERNEL); + channel_head = kzalloc_objs(struct xlgmac_channel, pdata->channel_count, + GFP_KERNEL); if (!channel_head) return ret; netif_dbg(pdata, drv, pdata->netdev, "channel_head=%p\n", channel_head); - tx_ring = kcalloc(pdata->tx_ring_count, sizeof(struct xlgmac_ring), - GFP_KERNEL); + tx_ring = kzalloc_objs(struct xlgmac_ring, pdata->tx_ring_count, + GFP_KERNEL); if (!tx_ring) goto err_tx_ring; - rx_ring = kcalloc(pdata->rx_ring_count, sizeof(struct xlgmac_ring), - GFP_KERNEL); + rx_ring = kzalloc_objs(struct xlgmac_ring, pdata->rx_ring_count, + GFP_KERNEL); if (!rx_ring) goto err_rx_ring; diff --git a/drivers/net/ethernet/ti/am65-cpsw-switchdev.c b/drivers/net/ethernet/ti/am65-cpsw-switchdev.c index d4c56da98a6a..53cdac272b58 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-switchdev.c +++ b/drivers/net/ethernet/ti/am65-cpsw-switchdev.c @@ -435,7 +435,7 @@ static int am65_cpsw_switchdev_event(struct notifier_block *unused, if (!am65_cpsw_port_dev_check(ndev)) return NOTIFY_DONE; - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; diff --git a/drivers/net/ethernet/ti/cpsw_switchdev.c b/drivers/net/ethernet/ti/cpsw_switchdev.c index ce85f7610273..7e06aac388a6 100644 --- a/drivers/net/ethernet/ti/cpsw_switchdev.c +++ b/drivers/net/ethernet/ti/cpsw_switchdev.c @@ -445,7 +445,7 @@ static int cpsw_switchdev_event(struct notifier_block *unused, if (!cpsw_port_dev_check(ndev)) return NOTIFY_DONE; - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; diff --git a/drivers/net/ethernet/ti/icssg/icssg_switchdev.c b/drivers/net/ethernet/ti/icssg/icssg_switchdev.c index 67e2927e176d..26a57be04665 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_switchdev.c +++ b/drivers/net/ethernet/ti/icssg/icssg_switchdev.c @@ -193,7 +193,7 @@ static int prueth_switchdev_event(struct notifier_block *unused, return notifier_from_errno(err); } - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; diff --git a/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c b/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c index 07c08564386e..fa9959ad966d 100644 --- a/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c +++ b/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c @@ -748,7 +748,7 @@ int icssm_prueth_sw_init_fdb_table(struct prueth *prueth) if (prueth->emac_configured) return 0; - prueth->fdb_tbl = kmalloc(sizeof(*prueth->fdb_tbl), GFP_KERNEL); + prueth->fdb_tbl = kmalloc_obj(*prueth->fdb_tbl, GFP_KERNEL); if (!prueth->fdb_tbl) return -ENOMEM; @@ -816,7 +816,7 @@ int icssm_prueth_sw_learn_fdb(struct prueth_emac *emac, u8 *src_mac) { struct icssm_prueth_sw_fdb_work *fdb_work; - fdb_work = kzalloc(sizeof(*fdb_work), GFP_ATOMIC); + fdb_work = kzalloc_obj(*fdb_work, GFP_ATOMIC); if (WARN_ON(!fdb_work)) return -ENOMEM; @@ -835,7 +835,7 @@ int icssm_prueth_sw_purge_fdb(struct prueth_emac *emac) { struct icssm_prueth_sw_fdb_work *fdb_work; - fdb_work = kzalloc(sizeof(*fdb_work), GFP_ATOMIC); + fdb_work = kzalloc_obj(*fdb_work, GFP_ATOMIC); if (WARN_ON(!fdb_work)) return -ENOMEM; diff --git a/drivers/net/ethernet/ti/icssm/icssm_switchdev.c b/drivers/net/ethernet/ti/icssm/icssm_switchdev.c index 414ec9fc02a0..1c48023031dc 100644 --- a/drivers/net/ethernet/ti/icssm/icssm_switchdev.c +++ b/drivers/net/ethernet/ti/icssm/icssm_switchdev.c @@ -167,7 +167,7 @@ static int icssm_prueth_sw_switchdev_event(struct notifier_block *unused, return notifier_from_errno(err); } - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (WARN_ON(!switchdev_work)) return NOTIFY_BAD; diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index 739bae8e11ee..58bb394fecdf 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -55,7 +55,7 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, const char *pool_name = NULL; int ret = -ENOMEM; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(ret); @@ -77,8 +77,8 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, pool->gen_pool->name = pool_name; - pool->desc_infos = kcalloc(pool->num_desc, - sizeof(*pool->desc_infos), GFP_KERNEL); + pool->desc_infos = kzalloc_objs(*pool->desc_infos, pool->num_desc, + GFP_KERNEL); if (!pool->desc_infos) goto gen_pool_desc_infos_alloc_fail; diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c index 4fbe4b7cd12a..67d96efcb8bc 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c @@ -209,7 +209,7 @@ static struct gelic_eurus_cmd *gelic_eurus_sync_cmd(struct gelic_wl_info *wl, struct gelic_eurus_cmd *cmd; /* allocate cmd */ - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return NULL; @@ -2305,9 +2305,8 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card) pr_debug("%s: wl=%p port=%p\n", __func__, wl, port); /* allocate scan list */ - wl->networks = kcalloc(GELIC_WL_BSS_MAX_ENT, - sizeof(struct gelic_wl_scan_info), - GFP_KERNEL); + wl->networks = kzalloc_objs(struct gelic_wl_scan_info, + GELIC_WL_BSS_MAX_ENT, GFP_KERNEL); if (!wl->networks) goto fail_bss; diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 5aa93144a4f5..f761975aeda8 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c @@ -1631,8 +1631,8 @@ static int velocity_init_rd_ring(struct velocity_info *vptr) { int ret = -ENOMEM; - vptr->rx.info = kcalloc(vptr->options.numrx, - sizeof(struct velocity_rd_info), GFP_KERNEL); + vptr->rx.info = kzalloc_objs(struct velocity_rd_info, + vptr->options.numrx, GFP_KERNEL); if (!vptr->rx.info) goto out; @@ -1664,9 +1664,9 @@ static int velocity_init_td_ring(struct velocity_info *vptr) /* Init the TD ring entries */ for (j = 0; j < vptr->tx.numq; j++) { - vptr->tx.infos[j] = kcalloc(vptr->options.numtx, - sizeof(struct velocity_td_info), - GFP_KERNEL); + vptr->tx.infos[j] = kzalloc_objs(struct velocity_td_info, + vptr->options.numtx, + GFP_KERNEL); if (!vptr->tx.infos[j]) { while (--j >= 0) kfree(vptr->tx.infos[j]); @@ -2304,7 +2304,7 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) struct rx_info rx; struct tx_info tx; - tmp_vptr = kzalloc(sizeof(*tmp_vptr), GFP_KERNEL); + tmp_vptr = kzalloc_obj(*tmp_vptr, GFP_KERNEL); if (!tmp_vptr) { ret = -ENOMEM; goto out_0; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c index 58b8300e3d2c..c78e0775aeb5 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c @@ -2505,9 +2505,8 @@ int wx_sw_init(struct wx *wx) wx->rss_flags = WX_RSS_FIELD_IPV4 | WX_RSS_FIELD_IPV4_TCP | WX_RSS_FIELD_IPV6 | WX_RSS_FIELD_IPV6_TCP; - wx->mac_table = kcalloc(wx->mac.num_rar_entries, - sizeof(struct wx_mac_addr), - GFP_KERNEL); + wx->mac_table = kzalloc_objs(struct wx_mac_addr, + wx->mac.num_rar_entries, GFP_KERNEL); if (!wx->mac_table) { wx_err(wx, "mac_table allocation failed\n"); kfree(wx->rss_key); diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index b31b48d26575..00c23bebdc72 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -1905,16 +1905,14 @@ static int wx_acquire_msix_vectors(struct wx *wx) nvecs = min_t(int, nvecs, num_online_cpus()); nvecs = min_t(int, nvecs, wx->mac.max_msix_vectors); - wx->msix_q_entries = kcalloc(nvecs, sizeof(struct msix_entry), - GFP_KERNEL); + wx->msix_q_entries = kzalloc_objs(struct msix_entry, nvecs, GFP_KERNEL); if (!wx->msix_q_entries) return -ENOMEM; /* One for non-queue interrupts */ nvecs += 1; - wx->msix_entry = kcalloc(1, sizeof(struct msix_entry), - GFP_KERNEL); + wx->msix_entry = kzalloc_objs(struct msix_entry, 1, GFP_KERNEL); if (!wx->msix_entry) { kfree(wx->msix_q_entries); wx->msix_q_entries = NULL; @@ -2097,8 +2095,7 @@ static int wx_alloc_q_vector(struct wx *wx, /* note this will allocate space for the ring structure as well! */ ring_count = txr_count + rxr_count; - q_vector = kzalloc(struct_size(q_vector, ring, ring_count), - GFP_KERNEL); + q_vector = kzalloc_flex(*q_vector, ring, ring_count, GFP_KERNEL); if (!q_vector) return -ENOMEM; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_mbx.c b/drivers/net/ethernet/wangxun/libwx/wx_mbx.c index 2aa03eadf064..d237814cbae5 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_mbx.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_mbx.c @@ -403,8 +403,7 @@ int wx_read_mbx_vf(struct wx *wx, u32 *msg, u16 size) int wx_init_mbx_params_vf(struct wx *wx) { - wx->vfinfo = kzalloc(sizeof(struct vf_data_storage), - GFP_KERNEL); + wx->vfinfo = kzalloc_obj(struct vf_data_storage, GFP_KERNEL); if (!wx->vfinfo) return -ENOMEM; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_sriov.c b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c index 493da5fffdb6..70a5b00eb353 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_sriov.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c @@ -32,8 +32,7 @@ static int wx_alloc_vf_macvlans(struct wx *wx, u8 num_vfs) if (!num_vf_macvlans) return -EINVAL; - mv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans), - GFP_KERNEL); + mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans, GFP_KERNEL); if (!mv_list) return -ENOMEM; @@ -88,8 +87,7 @@ static int __wx_enable_sriov(struct wx *wx, u8 num_vfs) wx->ring_feature[RING_F_VMDQ].limit = 1; wx->ring_feature[RING_F_VMDQ].offset = num_vfs; - wx->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage), - GFP_KERNEL); + wx->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs, GFP_KERNEL); if (!wx->vfinfo) return -ENOMEM; diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c index 662f28bdde8a..d42fd6d8d9c8 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c @@ -81,7 +81,7 @@ static int ngbe_set_ringparam(struct net_device *netdev, /* allocate temporary buffer to store rings in */ i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); - temp_ring = kvmalloc_array(i, sizeof(struct wx_ring), GFP_KERNEL); + temp_ring = kvmalloc_objs(struct wx_ring, i, GFP_KERNEL); if (!temp_ring) { err = -ENOMEM; goto clear_reset; diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c index 59d758acccf0..cc0ebc3d030a 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c @@ -73,7 +73,7 @@ static int txgbe_set_ringparam(struct net_device *netdev, /* allocate temporary buffer to store rings in */ i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); - temp_ring = kvmalloc_array(i, sizeof(struct wx_ring), GFP_KERNEL); + temp_ring = kvmalloc_objs(struct wx_ring, i, GFP_KERNEL); if (!temp_ring) { err = -ENOMEM; goto clear_reset; @@ -390,7 +390,7 @@ static int txgbe_add_ethtool_fdir_entry(struct txgbe *txgbe, return -EINVAL; } - input = kzalloc(sizeof(*input), GFP_ATOMIC); + input = kzalloc_obj(*input, GFP_ATOMIC); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 998bacd508b8..8980c965b5fd 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1542,14 +1542,14 @@ static int axienet_init_dmaengine(struct net_device *ndev) lp->tx_ring_head = 0; lp->rx_ring_tail = 0; lp->rx_ring_head = 0; - lp->tx_skb_ring = kcalloc(TX_BD_NUM_MAX, sizeof(*lp->tx_skb_ring), - GFP_KERNEL); + lp->tx_skb_ring = kzalloc_objs(*lp->tx_skb_ring, TX_BD_NUM_MAX, + GFP_KERNEL); if (!lp->tx_skb_ring) { ret = -ENOMEM; goto err_dma_release_rx; } for (i = 0; i < TX_BD_NUM_MAX; i++) { - skbuf_dma = kzalloc(sizeof(*skbuf_dma), GFP_KERNEL); + skbuf_dma = kzalloc_obj(*skbuf_dma, GFP_KERNEL); if (!skbuf_dma) { ret = -ENOMEM; goto err_free_tx_skb_ring; @@ -1557,14 +1557,14 @@ static int axienet_init_dmaengine(struct net_device *ndev) lp->tx_skb_ring[i] = skbuf_dma; } - lp->rx_skb_ring = kcalloc(RX_BUF_NUM_DEFAULT, sizeof(*lp->rx_skb_ring), - GFP_KERNEL); + lp->rx_skb_ring = kzalloc_objs(*lp->rx_skb_ring, RX_BUF_NUM_DEFAULT, + GFP_KERNEL); if (!lp->rx_skb_ring) { ret = -ENOMEM; goto err_free_tx_skb_ring; } for (i = 0; i < RX_BUF_NUM_DEFAULT; i++) { - skbuf_dma = kzalloc(sizeof(*skbuf_dma), GFP_KERNEL); + skbuf_dma = kzalloc_obj(*skbuf_dma, GFP_KERNEL); if (!skbuf_dma) { ret = -ENOMEM; goto err_free_rx_skb_ring; diff --git a/drivers/net/fjes/fjes_hw.c b/drivers/net/fjes/fjes_hw.c index 5ad2673f213d..db40667413b4 100644 --- a/drivers/net/fjes/fjes_hw.c +++ b/drivers/net/fjes/fjes_hw.c @@ -212,8 +212,7 @@ static int fjes_hw_setup(struct fjes_hw *hw) hw->hw_info.max_epid = &hw->max_epid; hw->hw_info.my_epid = &hw->my_epid; - buf = kcalloc(hw->max_epid, sizeof(struct ep_share_mem_info), - GFP_KERNEL); + buf = kzalloc_objs(struct ep_share_mem_info, hw->max_epid, GFP_KERNEL); if (!buf) return -ENOMEM; diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 0949d4579171..d482e5512fa8 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -980,7 +980,7 @@ static struct geneve_sock *geneve_socket_create(struct net *net, __be16 port, struct udp_tunnel_sock_cfg tunnel_cfg; int h; - gs = kzalloc(sizeof(*gs), GFP_KERNEL); + gs = kzalloc_obj(*gs, GFP_KERNEL); if (!gs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 4213c3b2d532..e8949f556209 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1623,13 +1623,13 @@ static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize) { int i; - gtp->addr_hash = kmalloc_array(hsize, sizeof(struct hlist_head), - GFP_KERNEL | __GFP_NOWARN); + gtp->addr_hash = kmalloc_objs(struct hlist_head, hsize, + GFP_KERNEL | __GFP_NOWARN); if (gtp->addr_hash == NULL) return -ENOMEM; - gtp->tid_hash = kmalloc_array(hsize, sizeof(struct hlist_head), - GFP_KERNEL | __GFP_NOWARN); + gtp->tid_hash = kmalloc_objs(struct hlist_head, hsize, + GFP_KERNEL | __GFP_NOWARN); if (gtp->tid_hash == NULL) goto err1; @@ -1917,7 +1917,7 @@ static struct pdp_ctx *gtp_pdp_add(struct gtp_dev *gtp, struct sock *sk, } - pctx = kmalloc(sizeof(*pctx), GFP_ATOMIC); + pctx = kmalloc_obj(*pctx, GFP_ATOMIC); if (pctx == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index f29997b20fd7..16220b740b8e 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -386,7 +386,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate, } /* Allocate a new mcs */ - if ((p = kmalloc(sizeof(struct yam_mcs), GFP_KERNEL)) == NULL) { + if ((p = kmalloc_obj(struct yam_mcs, GFP_KERNEL)) == NULL) { release_firmware(fw); return NULL; } diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 60a4629fe6ba..d9fa2fc4c43c 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -129,7 +129,7 @@ static struct netvsc_device *alloc_net_device(void) { struct netvsc_device *net_device; - net_device = kzalloc(sizeof(struct netvsc_device), GFP_KERNEL); + net_device = kzalloc_obj(struct netvsc_device, GFP_KERNEL); if (!net_device) return NULL; @@ -1025,9 +1025,8 @@ static int netvsc_dma_map(struct hv_device *hv_dev, if (!hv_is_isolation_supported()) return 0; - packet->dma_range = kcalloc(page_count, - sizeof(*packet->dma_range), - GFP_ATOMIC); + packet->dma_range = kzalloc_objs(*packet->dma_range, page_count, + GFP_ATOMIC); if (!packet->dma_range) return -ENOMEM; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index cbd52cb79268..1a3f2a35519f 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -712,7 +712,7 @@ void netvsc_linkstatus_callback(struct net_device *net, if (net->reg_state != NETREG_REGISTERED) return; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return; event->event = indicate->status; @@ -931,7 +931,7 @@ struct netvsc_device_info *netvsc_devinfo_get(struct netvsc_device *nvdev) struct netvsc_device_info *dev_info; struct bpf_prog *prog; - dev_info = kzalloc(sizeof(*dev_info), GFP_ATOMIC); + dev_info = kzalloc_obj(*dev_info, GFP_ATOMIC); if (!dev_info) return NULL; @@ -1524,9 +1524,8 @@ static void netvsc_get_ethtool_stats(struct net_device *dev, data[i++] = xdp_tx; } - pcpu_sum = kvmalloc_array(nr_cpu_ids, - sizeof(struct netvsc_ethtool_pcpu_stats), - GFP_KERNEL); + pcpu_sum = kvmalloc_objs(struct netvsc_ethtool_pcpu_stats, nr_cpu_ids, + GFP_KERNEL); if (!pcpu_sum) return; diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index c35f9685b6bf..2fa77dc21d7e 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -64,7 +64,7 @@ static struct rndis_device *get_rndis_device(void) { struct rndis_device *device; - device = kzalloc(sizeof(struct rndis_device), GFP_KERNEL); + device = kzalloc_obj(struct rndis_device, GFP_KERNEL); if (!device) return NULL; @@ -87,7 +87,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev, struct rndis_set_request *set; unsigned long flags; - request = kzalloc(sizeof(struct rndis_request), GFP_KERNEL); + request = kzalloc_obj(struct rndis_request, GFP_KERNEL); if (!request) return NULL; diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index fd91f8a45bce..6156cf379916 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -788,7 +788,7 @@ static irqreturn_t at86rf230_isr(int irq, void *data) disable_irq_nosync(irq); - ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC); + ctx = kzalloc_obj(*ctx, GFP_ATOMIC); if (!ctx) { enable_irq(irq); return IRQ_NONE; diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index ebc4f1b18e7b..bb3ff9ce06b2 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -720,8 +720,8 @@ static void ca8210_rx_done(struct cas_control *cas_ctl) &priv->spi->dev, "Resetting MAC...\n"); - mlme_reset_wpc = kmalloc(sizeof(*mlme_reset_wpc), - GFP_KERNEL); + mlme_reset_wpc = kmalloc_obj(*mlme_reset_wpc, + GFP_KERNEL); if (!mlme_reset_wpc) goto finish; INIT_WORK( @@ -884,7 +884,7 @@ static int ca8210_spi_transfer( dev_dbg(&spi->dev, "%s called\n", __func__); - cas_ctl = kzalloc(sizeof(*cas_ctl), GFP_ATOMIC); + cas_ctl = kzalloc_obj(*cas_ctl, GFP_ATOMIC); if (!cas_ctl) return -ENOMEM; @@ -3067,7 +3067,7 @@ static int ca8210_probe(struct spi_device *spi_device) ca8210_hw_setup(hw); ieee802154_random_extended_addr(&hw->phy->perm_extended_addr); - pdata = kmalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kmalloc_obj(*pdata, GFP_KERNEL); if (!pdata) { ret = -ENOMEM; goto error; diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c index 1cab20b5a885..e449afd8e71f 100644 --- a/drivers/net/ieee802154/mac802154_hwsim.c +++ b/drivers/net/ieee802154/mac802154_hwsim.c @@ -98,7 +98,7 @@ static int hwsim_update_pib(struct ieee802154_hw *hw, u8 page, u8 channel, struct hwsim_phy *phy = hw->priv; struct hwsim_pib *pib, *pib_old; - pib = kzalloc(sizeof(*pib), GFP_ATOMIC); + pib = kzalloc_obj(*pib, GFP_ATOMIC); if (!pib) return -ENOMEM; @@ -545,11 +545,11 @@ static struct hwsim_edge *hwsim_alloc_edge(struct hwsim_phy *endpoint, u8 lqi) struct hwsim_edge_info *einfo; struct hwsim_edge *e; - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return NULL; - einfo = kzalloc(sizeof(*einfo), GFP_KERNEL); + einfo = kzalloc_obj(*einfo, GFP_KERNEL); if (!einfo) { kfree(e); return NULL; @@ -713,7 +713,7 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info) return -ENOENT; } - einfo = kzalloc(sizeof(*einfo), GFP_KERNEL); + einfo = kzalloc_obj(*einfo, GFP_KERNEL); if (!einfo) { mutex_unlock(&hwsim_phys_lock); return -ENOMEM; @@ -946,7 +946,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, /* hwsim phy channel 13 as default */ hw->phy->current_channel = 13; - pib = kzalloc(sizeof(*pib), GFP_KERNEL); + pib = kzalloc_obj(*pib, GFP_KERNEL); if (!pib) { err = -ENOMEM; goto err_pib; diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 6da801748189..4ad90264433a 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -187,7 +187,7 @@ static int ifb_dev_init(struct net_device *dev) struct ifb_q_private *txp; int i; - txp = kcalloc(dev->num_tx_queues, sizeof(*txp), GFP_KERNEL); + txp = kzalloc_objs(*txp, dev->num_tx_queues, GFP_KERNEL); if (!txp) return -ENOMEM; dp->tx_private = txp; diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 19531883864a..f82484de39dd 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -730,8 +730,8 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) * modulo that number to determine the next one that's free. * Transactions are allocated one at a time. */ - trans_info->trans = kcalloc(tre_count, sizeof(*trans_info->trans), - GFP_KERNEL); + trans_info->trans = kzalloc_objs(*trans_info->trans, tre_count, + GFP_KERNEL); if (!trans_info->trans) return -ENOMEM; trans_info->free_id = 0; /* all modulo channel->tre_count */ @@ -746,8 +746,7 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) * Each entry in this map records the transaction associated * with a corresponding completed TRE. */ - trans_info->map = kcalloc(tre_count, sizeof(*trans_info->map), - GFP_KERNEL); + trans_info->map = kzalloc_objs(*trans_info->map, tre_count, GFP_KERNEL); if (!trans_info->map) { ret = -ENOMEM; goto err_trans_free; diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 8336596b1247..9e8d75a98f05 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -329,7 +329,7 @@ struct ipa_interrupt *ipa_interrupt_init(struct platform_device *pdev) if (irq <= 0) return ERR_PTR(irq ? : -EINVAL); - interrupt = kzalloc(sizeof(*interrupt), GFP_KERNEL); + interrupt = kzalloc_obj(*interrupt, GFP_KERNEL); if (!interrupt) return ERR_PTR(-ENOMEM); interrupt->irq = irq; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 95a61bae3124..d09b4723f26c 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -830,7 +830,7 @@ static int ipa_probe(struct platform_device *pdev) } /* No more EPROBE_DEFER. Allocate and initialize the IPA structure */ - ipa = kzalloc(sizeof(*ipa), GFP_KERNEL); + ipa = kzalloc_obj(*ipa, GFP_KERNEL); if (!ipa) { ret = -ENOMEM; goto err_power_exit; diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c index 420098796eec..e96bdd9b68a8 100644 --- a/drivers/net/ipa/ipa_smp2p.c +++ b/drivers/net/ipa/ipa_smp2p.c @@ -242,7 +242,7 @@ ipa_smp2p_init(struct ipa *ipa, struct platform_device *pdev, bool modem_init) if (enabled_bit >= 32) /* BITS_PER_U32 */ return -EINVAL; - smp2p = kzalloc(sizeof(*smp2p), GFP_KERNEL); + smp2p = kzalloc_obj(*smp2p, GFP_KERNEL); if (!smp2p) return -ENOMEM; diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index baccdad695fd..6f4ea2234ccb 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -64,7 +64,7 @@ static int ipvlan_port_create(struct net_device *dev) struct ipvl_port *port; int err, idx; - port = kzalloc(sizeof(struct ipvl_port), GFP_KERNEL); + port = kzalloc_obj(struct ipvl_port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -820,7 +820,7 @@ static int ipvlan_add_addr(struct ipvl_dev *ipvlan, void *iaddr, bool is_v6) assert_spin_locked(&ipvlan->port->addrs_lock); - addr = kzalloc(sizeof(struct ipvl_addr), GFP_ATOMIC); + addr = kzalloc_obj(struct ipvl_addr, GFP_ATOMIC); if (!addr) return -ENOMEM; diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index c2cb2d20976b..1b523a56e7da 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -1465,7 +1465,7 @@ static struct macsec_rx_sc *create_rx_sc(struct net_device *dev, sci_t sci, return ERR_PTR(-EEXIST); } - rx_sc = kzalloc(sizeof(*rx_sc), GFP_KERNEL); + rx_sc = kzalloc_obj(*rx_sc, GFP_KERNEL); if (!rx_sc) return ERR_PTR(-ENOMEM); @@ -1797,7 +1797,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info) return -EBUSY; } - rx_sa = kmalloc(sizeof(*rx_sa), GFP_KERNEL); + rx_sa = kmalloc_obj(*rx_sa, GFP_KERNEL); if (!rx_sa) { rtnl_unlock(); return -ENOMEM; @@ -2005,7 +2005,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info) return -EBUSY; } - tx_sa = kmalloc(sizeof(*tx_sa), GFP_KERNEL); + tx_sa = kmalloc_obj(*tx_sa, GFP_KERNEL); if (!tx_sa) { rtnl_unlock(); return -ENOMEM; @@ -4013,7 +4013,7 @@ static int register_macsec_dev(struct net_device *real_dev, if (!rxd) { int err; - rxd = kmalloc(sizeof(*rxd), GFP_KERNEL); + rxd = kmalloc_obj(*rxd, GFP_KERNEL); if (!rxd) return -ENOMEM; diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 4433b8e95b6a..1b4e327e26e1 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -163,7 +163,7 @@ static int macvlan_hash_add_source(struct macvlan_dev *vlan, if (entry) return 0; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -1131,7 +1131,7 @@ static int macvlan_dev_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err; - netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); err = -ENOMEM; if (!netpoll) goto out; @@ -1249,7 +1249,7 @@ static int macvlan_port_create(struct net_device *dev) if (netdev_is_rx_handler_busy(dev)) return -EBUSY; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (port == NULL) return -ENOMEM; diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c index 8043b57bdf25..03f51a66933c 100644 --- a/drivers/net/mctp/mctp-i2c.c +++ b/drivers/net/mctp/mctp-i2c.c @@ -154,7 +154,7 @@ static struct mctp_i2c_client *mctp_i2c_new_client(struct i2c_client *client) goto err; } - mcli = kzalloc(sizeof(*mcli), GFP_KERNEL); + mcli = kzalloc_obj(*mcli, GFP_KERNEL); if (!mcli) { rc = -ENOMEM; goto err; diff --git a/drivers/net/mctp/mctp-i3c.c b/drivers/net/mctp/mctp-i3c.c index 36c2405677c2..0814b65c2843 100644 --- a/drivers/net/mctp/mctp-i3c.c +++ b/drivers/net/mctp/mctp-i3c.c @@ -259,7 +259,7 @@ __must_hold(&busdevs_lock) struct mctp_i3c_device *mi = NULL; int rc; - mi = kzalloc(sizeof(*mi), GFP_KERNEL); + mi = kzalloc_obj(*mi, GFP_KERNEL); if (!mi) { rc = -ENOMEM; goto err; diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index d144787b2947..73604c019b25 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -348,7 +348,7 @@ static struct netconsole_target *alloc_and_init(void) { struct netconsole_target *nt; - nt = kzalloc(sizeof(*nt), GFP_KERNEL); + nt = kzalloc_obj(*nt, GFP_KERNEL); if (!nt) return nt; @@ -1270,7 +1270,7 @@ static struct config_item *userdatum_make_item(struct config_group *group, if (count_userdata_entries(nt) >= MAX_USERDATA_ITEMS) return ERR_PTR(-ENOSPC); - udm = kzalloc(sizeof(*udm), GFP_KERNEL); + udm = kzalloc_obj(*udm, GFP_KERNEL); if (!udm) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c index 5f17f68f3c08..badf08add94f 100644 --- a/drivers/net/netdevsim/bpf.c +++ b/drivers/net/netdevsim/bpf.c @@ -222,7 +222,7 @@ static int nsim_bpf_create_prog(struct nsim_dev *nsim_dev, char name[16]; int ret; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; @@ -501,7 +501,7 @@ nsim_bpf_map_alloc(struct netdevsim *ns, struct bpf_offloaded_map *offmap) if (offmap->map.map_flags) return -EINVAL; - nmap = kzalloc(sizeof(*nmap), GFP_KERNEL_ACCOUNT); + nmap = kzalloc_obj(*nmap, GFP_KERNEL_ACCOUNT); if (!nmap) return -ENOMEM; diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index d16b95304aa7..8de96fe6c02a 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -451,7 +451,7 @@ nsim_bus_dev_new(unsigned int id, unsigned int port_count, unsigned int num_queu struct nsim_bus_dev *nsim_bus_dev; int err; - nsim_bus_dev = kzalloc(sizeof(*nsim_bus_dev), GFP_KERNEL); + nsim_bus_dev = kzalloc_obj(*nsim_bus_dev, GFP_KERNEL); if (!nsim_bus_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index f7b32446d3b8..a227c0b9fe4c 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -267,8 +267,8 @@ static ssize_t nsim_bus_dev_max_vfs_write(struct file *file, if (val > NSIM_DEV_VF_PORT_INDEX_MAX - NSIM_DEV_VF_PORT_INDEX_BASE) return -ERANGE; - vfconfigs = kcalloc(val, sizeof(struct nsim_vf_config), - GFP_KERNEL | __GFP_NOWARN); + vfconfigs = kzalloc_objs(struct nsim_vf_config, val, + GFP_KERNEL | __GFP_NOWARN); if (!vfconfigs) return -ENOMEM; @@ -935,13 +935,13 @@ static int nsim_dev_traps_init(struct devlink *devlink) struct nsim_trap_data *nsim_trap_data; int err; - nsim_trap_data = kzalloc(sizeof(*nsim_trap_data), GFP_KERNEL); + nsim_trap_data = kzalloc_obj(*nsim_trap_data, GFP_KERNEL); if (!nsim_trap_data) return -ENOMEM; - nsim_trap_data->trap_items_arr = kcalloc(ARRAY_SIZE(nsim_traps_arr), - sizeof(struct nsim_trap_item), - GFP_KERNEL); + nsim_trap_data->trap_items_arr = kzalloc_objs(struct nsim_trap_item, + ARRAY_SIZE(nsim_traps_arr), + GFP_KERNEL); if (!nsim_trap_data->trap_items_arr) { err = -ENOMEM; goto err_trap_data_free; @@ -1348,7 +1348,7 @@ static int nsim_rate_node_new(struct devlink_rate *node, void **priv, return -EOPNOTSUPP; } - nsim_node = kzalloc(sizeof(*nsim_node), GFP_KERNEL); + nsim_node = kzalloc_obj(*nsim_node, GFP_KERNEL); if (!nsim_node) return -ENOMEM; @@ -1464,7 +1464,7 @@ static int __nsim_dev_port_add(struct nsim_dev *nsim_dev, enum nsim_dev_port_typ if (type == NSIM_DEV_PORT_TYPE_VF && !nsim_dev_get_vfs(nsim_dev)) return -EINVAL; - nsim_dev_port = kzalloc(sizeof(*nsim_dev_port), GFP_KERNEL); + nsim_dev_port = kzalloc_obj(*nsim_dev_port, GFP_KERNEL); if (!nsim_dev_port) return -ENOMEM; nsim_dev_port->port_index = nsim_dev_port_index(type, port_index); @@ -1652,9 +1652,9 @@ int nsim_drv_probe(struct nsim_bus_dev *nsim_bus_dev) dev_set_drvdata(&nsim_bus_dev->dev, nsim_dev); - nsim_dev->vfconfigs = kcalloc(nsim_bus_dev->max_vfs, - sizeof(struct nsim_vf_config), - GFP_KERNEL | __GFP_NOWARN); + nsim_dev->vfconfigs = kzalloc_objs(struct nsim_vf_config, + nsim_bus_dev->max_vfs, + GFP_KERNEL | __GFP_NOWARN); if (!nsim_dev->vfconfigs) { err = -ENOMEM; goto err_devlink_unlock; diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c index 16c382c42227..b1292a8c0ef1 100644 --- a/drivers/net/netdevsim/fib.c +++ b/drivers/net/netdevsim/fib.c @@ -277,7 +277,7 @@ nsim_fib4_rt_create(struct nsim_fib_data *data, { struct nsim_fib4_rt *fib4_rt; - fib4_rt = kzalloc(sizeof(*fib4_rt), GFP_KERNEL); + fib4_rt = kzalloc_obj(*fib4_rt, GFP_KERNEL); if (!fib4_rt) return NULL; @@ -497,7 +497,7 @@ static int nsim_fib6_rt_nh_add(struct nsim_fib6_rt *fib6_rt, { struct nsim_fib6_rt_nh *fib6_rt_nh; - fib6_rt_nh = kzalloc(sizeof(*fib6_rt_nh), GFP_KERNEL); + fib6_rt_nh = kzalloc_obj(*fib6_rt_nh, GFP_KERNEL); if (!fib6_rt_nh) return -ENOMEM; @@ -544,7 +544,7 @@ nsim_fib6_rt_create(struct nsim_fib_data *data, int i = 0; int err; - fib6_rt = kzalloc(sizeof(*fib6_rt), GFP_KERNEL); + fib6_rt = kzalloc_obj(*fib6_rt, GFP_KERNEL); if (!fib6_rt) return ERR_PTR(-ENOMEM); @@ -807,7 +807,7 @@ static int nsim_fib6_event_init(struct nsim_fib6_event *fib6_event, nrt6 = fen6_info->nsiblings + 1; - rt_arr = kcalloc(nrt6, sizeof(struct fib6_info *), GFP_ATOMIC); + rt_arr = kzalloc_objs(struct fib6_info *, nrt6, GFP_ATOMIC); if (!rt_arr) return -ENOMEM; @@ -987,7 +987,7 @@ static int nsim_fib_event_schedule_work(struct nsim_fib_data *data, */ return NOTIFY_DONE; - fib_event = kzalloc(sizeof(*fib_event), GFP_ATOMIC); + fib_event = kzalloc_obj(*fib_event, GFP_ATOMIC); if (!fib_event) goto err_fib_event_alloc; @@ -1116,7 +1116,7 @@ static struct nsim_nexthop *nsim_nexthop_create(struct nsim_fib_data *data, u64 occ = 0; int i; - nexthop = kzalloc(sizeof(*nexthop), GFP_KERNEL); + nexthop = kzalloc_obj(*nexthop, GFP_KERNEL); if (!nexthop) return ERR_PTR(-ENOMEM); @@ -1556,7 +1556,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink, struct nsim_dev *nsim_dev; int err; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); data->devlink = devlink; diff --git a/drivers/net/netdevsim/hwstats.c b/drivers/net/netdevsim/hwstats.c index 1abe48e35ca3..57b782aa1046 100644 --- a/drivers/net/netdevsim/hwstats.c +++ b/drivers/net/netdevsim/hwstats.c @@ -238,7 +238,7 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats, goto out_unlock_list; } - hwsdev = kzalloc(sizeof(*hwsdev), GFP_KERNEL); + hwsdev = kzalloc_obj(*hwsdev, GFP_KERNEL); if (!hwsdev) { err = -ENOMEM; goto out_put_netdev; diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 6285fbefe38a..5ec028a00c62 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -723,7 +723,7 @@ static struct nsim_rq *nsim_queue_alloc(void) { struct nsim_rq *rq; - rq = kzalloc(sizeof(*rq), GFP_KERNEL_ACCOUNT); + rq = kzalloc_obj(*rq, GFP_KERNEL_ACCOUNT); if (!rq) return NULL; @@ -997,8 +997,7 @@ static int nsim_queue_init(struct netdevsim *ns) struct net_device *dev = ns->netdev; int i; - ns->rq = kcalloc(dev->num_rx_queues, sizeof(*ns->rq), - GFP_KERNEL_ACCOUNT); + ns->rq = kzalloc_objs(*ns->rq, dev->num_rx_queues, GFP_KERNEL_ACCOUNT); if (!ns->rq) return -ENOMEM; diff --git a/drivers/net/netdevsim/psample.c b/drivers/net/netdevsim/psample.c index f0c6477dd0ae..39250b9d201f 100644 --- a/drivers/net/netdevsim/psample.c +++ b/drivers/net/netdevsim/psample.c @@ -200,7 +200,7 @@ int nsim_dev_psample_init(struct nsim_dev *nsim_dev) struct nsim_dev_psample *psample; int err; - psample = kzalloc(sizeof(*psample), GFP_KERNEL); + psample = kzalloc_obj(*psample, GFP_KERNEL); if (!psample) return -ENOMEM; nsim_dev->psample = psample; diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c index 0a2fef7caccb..5c0e01396e06 100644 --- a/drivers/net/netkit.c +++ b/drivers/net/netkit.c @@ -796,7 +796,7 @@ int netkit_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) ret = PTR_ERR(dev); goto out; } - nkl = kzalloc(sizeof(*nkl), GFP_KERNEL_ACCOUNT); + nkl = kzalloc_obj(*nkl, GFP_KERNEL_ACCOUNT); if (!nkl) { ret = -ENOMEM; goto out; diff --git a/drivers/net/ovpn/bind.c b/drivers/net/ovpn/bind.c index 24d2788a277e..e42b60cd04a9 100644 --- a/drivers/net/ovpn/bind.c +++ b/drivers/net/ovpn/bind.c @@ -32,7 +32,7 @@ struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss) else return ERR_PTR(-EAFNOSUPPORT); - bind = kzalloc(sizeof(*bind), GFP_ATOMIC); + bind = kzalloc_obj(*bind, GFP_ATOMIC); if (unlikely(!bind)) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ovpn/crypto_aead.c b/drivers/net/ovpn/crypto_aead.c index 2cca759feffa..de335ab81948 100644 --- a/drivers/net/ovpn/crypto_aead.c +++ b/drivers/net/ovpn/crypto_aead.c @@ -328,7 +328,7 @@ ovpn_aead_crypto_key_slot_new(const struct ovpn_key_config *kc) return ERR_PTR(-EINVAL); /* build the key slot */ - ks = kmalloc(sizeof(*ks), GFP_KERNEL); + ks = kmalloc_obj(*ks, GFP_KERNEL); if (!ks) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c index 1bb1afe766a4..4554b0f8a409 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -57,7 +57,7 @@ static int ovpn_mp_alloc(struct ovpn_priv *ovpn) /* the peer container is fairly large, therefore we allocate it only in * MP mode */ - ovpn->peers = kzalloc(sizeof(*ovpn->peers), GFP_KERNEL); + ovpn->peers = kzalloc_obj(*ovpn->peers, GFP_KERNEL); if (!ovpn->peers) return -ENOMEM; diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index 0463b5b0542f..bac34068f0fc 100644 --- a/drivers/net/ovpn/peer.c +++ b/drivers/net/ovpn/peer.c @@ -95,7 +95,7 @@ struct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id) int ret; /* alloc and init peer object */ - peer = kzalloc(sizeof(*peer), GFP_KERNEL); + peer = kzalloc_obj(*peer, GFP_KERNEL); if (!peer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ovpn/socket.c b/drivers/net/ovpn/socket.c index 448cee3b3f9f..7be493f78440 100644 --- a/drivers/net/ovpn/socket.c +++ b/drivers/net/ovpn/socket.c @@ -191,7 +191,7 @@ struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer) /* socket is not owned: attach to this ovpn instance */ - ovpn_sock = kzalloc(sizeof(*ovpn_sock), GFP_KERNEL); + ovpn_sock = kzalloc_obj(*ovpn_sock, GFP_KERNEL); if (!ovpn_sock) { ovpn_sock = ERR_PTR(-ENOMEM); goto sock_release; diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 73e1364ad1ed..abf521f063cf 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -288,7 +288,7 @@ static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) struct lynx_pcs *lynx; int i; - lynx = kzalloc(sizeof(*lynx), GFP_KERNEL); + lynx = kzalloc_obj(*lynx, GFP_KERNEL); if (!lynx) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c index 44006bb6ac0b..5587d572dcbc 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -334,7 +334,7 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev, dev_dbg(dev, "MediaTek LynxI SGMII PCS (id 0x%08x, ver 0x%04x)\n", id, ver); - mpcs = kzalloc(sizeof(*mpcs), GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); if (!mpcs) return NULL; diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c index 8d7f82c1df2f..4de8c426787e 100644 --- a/drivers/net/pcs/pcs-rzn1-miic.c +++ b/drivers/net/pcs/pcs-rzn1-miic.c @@ -487,7 +487,7 @@ struct phylink_pcs *miic_create(struct device *dev, struct device_node *np) return ERR_PTR(-EINVAL); } - miic_port = kzalloc(sizeof(*miic_port), GFP_KERNEL); + miic_port = kzalloc_obj(*miic_port, GFP_KERNEL); if (!miic_port) { put_device(&pdev->dev); return ERR_PTR(-ENOMEM); @@ -679,8 +679,8 @@ static int miic_parse_dt(struct miic *miic, u32 *mode_cfg) s8 *dt_val; u32 conf; - dt_val = kmalloc_array(miic->of_data->conf_conv_count, - sizeof(*dt_val), GFP_KERNEL); + dt_val = kmalloc_objs(*dt_val, miic->of_data->conf_conv_count, + GFP_KERNEL); if (!dt_val) return -ENOMEM; diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 9679f2b35a44..8566e6ad64e9 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -1528,7 +1528,7 @@ static struct dw_xpcs *xpcs_create_data(struct mdio_device *mdiodev) { struct dw_xpcs *xpcs; - xpcs = kzalloc(sizeof(*xpcs), GFP_KERNEL); + xpcs = kzalloc_obj(*xpcs, GFP_KERNEL); if (!xpcs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c index 005277360656..d3954ea6b1dd 100644 --- a/drivers/net/phy/as21xxx.c +++ b/drivers/net/phy/as21xxx.c @@ -907,7 +907,7 @@ static int as21xxx_match_phy_device(struct phy_device *phydev, return phy_id == phydrv->phy_id; /* Allocate temp priv and load the firmware */ - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index b950acc9c49b..a56f4302840f 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -1027,13 +1027,12 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) if (clock) goto out; - clock = kzalloc(sizeof(struct dp83640_clock), GFP_KERNEL); + clock = kzalloc_obj(struct dp83640_clock, GFP_KERNEL); if (!clock) goto out; - clock->caps.pin_config = kcalloc(DP83640_N_PINS, - sizeof(struct ptp_pin_desc), - GFP_KERNEL); + clock->caps.pin_config = kzalloc_objs(struct ptp_pin_desc, + DP83640_N_PINS, GFP_KERNEL); if (!clock->caps.pin_config) { kfree(clock); clock = NULL; @@ -1412,7 +1411,7 @@ static int dp83640_probe(struct phy_device *phydev) if (!clock) goto no_clock; - dp83640 = kzalloc(sizeof(struct dp83640_private), GFP_KERNEL); + dp83640 = kzalloc_obj(struct dp83640_private, GFP_KERNEL); if (!dp83640) goto no_memory; diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index 65636070a222..172fbfcb215c 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -41,7 +41,7 @@ struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr) struct mdio_device *mdiodev; /* We allocate the device, and initialize the default values */ - mdiodev = kzalloc(sizeof(*mdiodev), GFP_KERNEL); + mdiodev = kzalloc_obj(*mdiodev, GFP_KERNEL); if (!mdiodev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 663dcdc92204..5ef9248c6b49 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -4114,7 +4114,7 @@ static void lan8814_get_rx_ts(struct kszphy_ptp_priv *ptp_priv) u32 reg; do { - rx_ts = kzalloc(sizeof(*rx_ts), GFP_KERNEL); + rx_ts = kzalloc_obj(*rx_ts, GFP_KERNEL); if (!rx_ts) return; diff --git a/drivers/net/phy/microchip_rds_ptp.c b/drivers/net/phy/microchip_rds_ptp.c index f5f2928e705f..9307df6f6d11 100644 --- a/drivers/net/phy/microchip_rds_ptp.c +++ b/drivers/net/phy/microchip_rds_ptp.c @@ -999,7 +999,7 @@ static struct mchp_rds_ptp_rx_ts if (rc < 0) goto error; - rx_ts = kmalloc(sizeof(*rx_ts), GFP_KERNEL); + rx_ts = kmalloc_obj(*rx_ts, GFP_KERNEL); if (!rx_ts) return NULL; diff --git a/drivers/net/phy/mii_timestamper.c b/drivers/net/phy/mii_timestamper.c index 51ae0593a04f..259ed30897c7 100644 --- a/drivers/net/phy/mii_timestamper.c +++ b/drivers/net/phy/mii_timestamper.c @@ -28,7 +28,7 @@ int register_mii_tstamp_controller(struct device *device, { struct mii_timestamping_desc *desc; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return -ENOMEM; diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c index 9a38a29cf397..ed0d445ce1e1 100644 --- a/drivers/net/phy/mscc/mscc_macsec.c +++ b/drivers/net/phy/mscc/mscc_macsec.c @@ -610,7 +610,7 @@ static struct macsec_flow *vsc8584_macsec_alloc_flow(struct vsc8531_private *pri if (index == MSCC_MS_MAX_FLOWS) return ERR_PTR(-ENOMEM); - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (!flow) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/nxp-c45-tja11xx-macsec.c b/drivers/net/phy/nxp-c45-tja11xx-macsec.c index fc897ba79b03..21519a2d9f85 100644 --- a/drivers/net/phy/nxp-c45-tja11xx-macsec.c +++ b/drivers/net/phy/nxp-c45-tja11xx-macsec.c @@ -431,7 +431,7 @@ static struct nxp_c45_sa *nxp_c45_sa_alloc(struct list_head *sa_list, void *sa, return ERR_PTR(-ENOSPC); } - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return ERR_PTR(-ENOMEM); @@ -991,7 +991,7 @@ static int nxp_c45_mdo_add_secy(struct macsec_context *ctx) if (idx == TX_SC_MAX) return -ENOSPC; - phy_secy = kzalloc(sizeof(*phy_secy), GFP_KERNEL); + phy_secy = kzalloc_obj(*phy_secy, GFP_KERNEL); if (!phy_secy) return -ENOMEM; diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 13dd1691886d..376bfa923349 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -736,7 +736,7 @@ int phy_ethtool_set_plca_cfg(struct phy_device *phydev, goto out; } - curr_plca_cfg = kmalloc(sizeof(*curr_plca_cfg), GFP_KERNEL); + curr_plca_cfg = kmalloc_obj(*curr_plca_cfg, GFP_KERNEL); if (!curr_plca_cfg) { ret = -ENOMEM; goto out; diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 9b8eaac63b90..52c2ff7fc6ae 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -438,7 +438,7 @@ static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend, static int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, int (*run)(struct phy_device *)) { - struct phy_fixup *fixup = kzalloc(sizeof(*fixup), GFP_KERNEL); + struct phy_fixup *fixup = kzalloc_obj(*fixup, GFP_KERNEL); if (!fixup) return -ENOMEM; @@ -754,7 +754,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, int ret = 0; /* We allocate the device, and initialize the default values */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c index 60893691d4c3..7821fe19934c 100644 --- a/drivers/net/phy/phy_led_triggers.c +++ b/drivers/net/phy/phy_led_triggers.c @@ -93,8 +93,7 @@ int phy_led_triggers_register(struct phy_device *phy) if (!phy->phy_num_led_triggers) return 0; - phy->led_link_trigger = kzalloc(sizeof(*phy->led_link_trigger), - GFP_KERNEL); + phy->led_link_trigger = kzalloc_obj(*phy->led_link_trigger, GFP_KERNEL); if (!phy->led_link_trigger) { err = -ENOMEM; goto out_clear; @@ -104,9 +103,9 @@ int phy_led_triggers_register(struct phy_device *phy) if (err) goto out_free_link; - phy->phy_led_triggers = kcalloc(phy->phy_num_led_triggers, - sizeof(struct phy_led_trigger), - GFP_KERNEL); + phy->phy_led_triggers = kzalloc_objs(struct phy_led_trigger, + phy->phy_num_led_triggers, + GFP_KERNEL); if (!phy->phy_led_triggers) { err = -ENOMEM; goto out_unreg_link; diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c index 0e9e987f37dd..ed15599dd38d 100644 --- a/drivers/net/phy/phy_link_topology.c +++ b/drivers/net/phy/phy_link_topology.c @@ -15,7 +15,7 @@ static int netdev_alloc_phy_link_topology(struct net_device *dev) { struct phy_link_topology *topo; - topo = kzalloc(sizeof(*topo), GFP_KERNEL); + topo = kzalloc_obj(*topo, GFP_KERNEL); if (!topo) return -ENOMEM; @@ -43,7 +43,7 @@ int phy_link_topo_add_phy(struct net_device *dev, topo = dev->link_topo; } - pdn = kzalloc(sizeof(*pdn), GFP_KERNEL); + pdn = kzalloc_obj(*pdn, GFP_KERNEL); if (!pdn) return -ENOMEM; diff --git a/drivers/net/phy/phy_package.c b/drivers/net/phy/phy_package.c index 3024da0bbf7b..3137a8fecf21 100644 --- a/drivers/net/phy/phy_package.c +++ b/drivers/net/phy/phy_package.c @@ -219,7 +219,7 @@ int phy_package_join(struct phy_device *phydev, int base_addr, size_t priv_size) shared = bus->shared[base_addr]; if (!shared) { ret = -ENOMEM; - shared = kzalloc(sizeof(*shared), GFP_KERNEL); + shared = kzalloc_obj(*shared, GFP_KERNEL); if (!shared) goto err_unlock; if (priv_size) { diff --git a/drivers/net/phy/phy_port.c b/drivers/net/phy/phy_port.c index 63d1bb154dc7..cae133a25fb0 100644 --- a/drivers/net/phy/phy_port.c +++ b/drivers/net/phy/phy_port.c @@ -19,7 +19,7 @@ struct phy_port *phy_port_alloc(void) { struct phy_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return NULL; diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index e1f01d7fc4da..f21a69e34d1c 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1853,7 +1853,7 @@ struct phylink *phylink_create(struct phylink_config *config, return ERR_PTR(-EINVAL); } - pl = kzalloc(sizeof(*pl), GFP_KERNEL); + pl = kzalloc_obj(*pl, GFP_KERNEL); if (!pl) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index b945d75966d5..07175bf3ef60 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c @@ -388,7 +388,7 @@ static struct sfp_bus *sfp_bus_get(const struct fwnode_handle *fwnode) { struct sfp_bus *sfp, *new, *found = NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); mutex_lock(&sfp_mutex); diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 43aefdd8b70f..42a9c93f03b3 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -3029,7 +3029,7 @@ static struct sfp *sfp_alloc(struct device *dev) { struct sfp *sfp; - sfp = kzalloc(sizeof(*sfp), GFP_KERNEL); + sfp = kzalloc_obj(*sfp, GFP_KERNEL); if (!sfp) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ppp/bsd_comp.c b/drivers/net/ppp/bsd_comp.c index f385b759d5cf..26bfa0feb7f5 100644 --- a/drivers/net/ppp/bsd_comp.c +++ b/drivers/net/ppp/bsd_comp.c @@ -395,8 +395,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) * Allocate the main control structure for this instance. */ maxmaxcode = MAXCODE(bits); - db = kzalloc(sizeof (struct bsd_db), - GFP_KERNEL); + db = kzalloc_obj(struct bsd_db, GFP_KERNEL); if (!db) { return NULL; diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c index c97406c6004d..ead937d95cd8 100644 --- a/drivers/net/ppp/ppp_async.c +++ b/drivers/net/ppp/ppp_async.c @@ -163,7 +163,7 @@ ppp_asynctty_open(struct tty_struct *tty) return -EOPNOTSUPP; err = -ENOMEM; - ap = kzalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc_obj(*ap, GFP_KERNEL); if (!ap) goto out; diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c index d93aeacc0dba..1d8370d2f098 100644 --- a/drivers/net/ppp/ppp_deflate.c +++ b/drivers/net/ppp/ppp_deflate.c @@ -97,8 +97,7 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = kzalloc(sizeof(*state), - GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return NULL; @@ -313,7 +312,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index f8814d7be6f1..fdf96999ba18 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -2926,7 +2926,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan) struct channel *pch; struct ppp_net *pn; - pch = kzalloc(sizeof(struct channel), GFP_KERNEL); + pch = kzalloc_obj(struct channel, GFP_KERNEL); if (!pch) return -ENOMEM; @@ -3277,7 +3277,7 @@ ppp_register_compressor(struct compressor *cp) if (find_comp_entry(cp->compress_proto)) goto out; ret = -ENOMEM; - ce = kmalloc(sizeof(struct compressor_entry), GFP_ATOMIC); + ce = kmalloc_obj(struct compressor_entry, GFP_ATOMIC); if (!ce) goto out; ret = 0; diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c index 630cbf71c147..eacfe50b6955 100644 --- a/drivers/net/ppp/ppp_mppe.c +++ b/drivers/net/ppp/ppp_mppe.c @@ -158,7 +158,7 @@ static void *mppe_alloc(unsigned char *options, int optlen) fips_enabled) return NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (state == NULL) return NULL; diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c index 9c4932198931..f49e60985171 100644 --- a/drivers/net/ppp/ppp_synctty.c +++ b/drivers/net/ppp/ppp_synctty.c @@ -162,7 +162,7 @@ ppp_sync_open(struct tty_struct *tty) if (tty->ops->write == NULL) return -EOPNOTSUPP; - ap = kzalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc_obj(*ap, GFP_KERNEL); err = -ENOMEM; if (!ap) goto out; diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c index 134435e90073..ef130eb75212 100644 --- a/drivers/net/pse-pd/pd692x0.c +++ b/drivers/net/pse-pd/pd692x0.c @@ -646,9 +646,9 @@ pd692x0_pi_get_pw_limit_ranges(struct pse_controller_dev *pcdev, int id, int i; pw_table = pd692x0_class_pw_table; - c33_pw_limit_ranges = kcalloc(PD692X0_CLASS_PW_TABLE_SIZE, - sizeof(*c33_pw_limit_ranges), - GFP_KERNEL); + c33_pw_limit_ranges = kzalloc_objs(*c33_pw_limit_ranges, + PD692X0_CLASS_PW_TABLE_SIZE, + GFP_KERNEL); if (!c33_pw_limit_ranges) return -ENOMEM; @@ -1259,7 +1259,7 @@ static int pd692x0_setup_pi_matrix(struct pse_controller_dev *pcdev) struct pd692x0_manager *manager; int ret; - manager = kcalloc(PD692X0_MAX_MANAGERS, sizeof(*manager), GFP_KERNEL); + manager = kzalloc_objs(*manager, PD692X0_MAX_MANAGERS, GFP_KERNEL); if (!manager) return -ENOMEM; diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index 23eb3c9d0bcd..ccbcda0cc4a2 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -162,7 +162,7 @@ static int of_load_pse_pis(struct pse_controller_dev *pcdev) if (!np) return -ENODEV; - pcdev->pi = kcalloc(pcdev->nr_lines, sizeof(*pcdev->pi), GFP_KERNEL); + pcdev->pi = kzalloc_objs(*pcdev->pi, pcdev->nr_lines, GFP_KERNEL); if (!pcdev->pi) return -ENOMEM; @@ -1408,7 +1408,7 @@ pse_control_get_internal(struct pse_controller_dev *pcdev, unsigned int index, } } - psec = kzalloc(sizeof(*psec), GFP_KERNEL); + psec = kzalloc_obj(*psec, GFP_KERNEL); if (!psec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 76ec1555d60d..465b6cfa6253 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -523,8 +523,7 @@ tps23881_pi_get_pw_limit_ranges(struct pse_controller_dev *pcdev, int id, { struct ethtool_c33_pse_pw_limit_range *c33_pw_limit_ranges; - c33_pw_limit_ranges = kzalloc(sizeof(*c33_pw_limit_ranges), - GFP_KERNEL); + c33_pw_limit_ranges = kzalloc_obj(*c33_pw_limit_ranges, GFP_KERNEL); if (!c33_pw_limit_ranges) return -ENOMEM; diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 318a0ef1af50..09fbb4ce8e38 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -603,7 +603,7 @@ static int rionet_add_dev(struct device *dev, struct subsys_interface *sif) rnet = netdev_priv(nets[netid].ndev); - peer = kzalloc(sizeof(*peer), GFP_KERNEL); + peer = kzalloc_obj(*peer, GFP_KERNEL); if (!peer) { rc = -ENOMEM; goto out; diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c index ee9fd3a94b96..98c4d5925694 100644 --- a/drivers/net/slip/slhc.c +++ b/drivers/net/slip/slhc.c @@ -98,7 +98,7 @@ slhc_init(int rslots, int tslots) if (rslots < 0 || rslots > 255 || tslots < 0 || tslots > 255) return ERR_PTR(-EINVAL); - comp = kzalloc(sizeof(struct slcompress), GFP_KERNEL); + comp = kzalloc_obj(struct slcompress, GFP_KERNEL); if (! comp) goto out_fail; diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index c889fb374703..4019c6b4dafc 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -1297,8 +1297,7 @@ static int __init slip_init(void) printk(KERN_INFO "SLIP linefill/keepalive option.\n"); #endif - slip_devs = kcalloc(slip_maxdev, sizeof(struct net_device *), - GFP_KERNEL); + slip_devs = kzalloc_objs(struct net_device *, slip_maxdev, GFP_KERNEL); if (!slip_devs) return -ENOMEM; diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 1197f245e873..aee69767342e 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -1197,7 +1197,7 @@ int tap_queue_resize(struct tap_dev *tap) int n = tap->numqueues; int ret, i = 0; - rings = kmalloc_array(n, sizeof(*rings), GFP_KERNEL); + rings = kmalloc_objs(*rings, n, GFP_KERNEL); if (!rings) return -ENOMEM; @@ -1217,7 +1217,7 @@ static int tap_list_add(dev_t major, const char *device_name) { struct major_info *tap_major; - tap_major = kzalloc(sizeof(*tap_major), GFP_ATOMIC); + tap_major = kzalloc_obj(*tap_major, GFP_ATOMIC); if (!tap_major) return -ENOMEM; diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index c08a5c1bd6e4..28c09ffd34b8 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -157,7 +157,7 @@ static int __team_option_inst_add(struct team *team, struct team_option *option, array_size = 1; /* No array but still need one instance */ for (i = 0; i < array_size; i++) { - opt_inst = kmalloc(sizeof(*opt_inst), GFP_KERNEL); + opt_inst = kmalloc_obj(*opt_inst, GFP_KERNEL); if (!opt_inst) return -ENOMEM; opt_inst->option = option; @@ -256,8 +256,7 @@ static int __team_options_register(struct team *team, struct team_option **dst_opts; int err; - dst_opts = kcalloc(option_count, sizeof(struct team_option *), - GFP_KERNEL); + dst_opts = kzalloc_objs(struct team_option *, option_count, GFP_KERNEL); if (!dst_opts) return -ENOMEM; for (i = 0; i < option_count; i++, option++) { @@ -434,7 +433,7 @@ int team_mode_register(const struct team_mode *mode) mode->priv_size > TEAM_MODE_PRIV_SIZE) return -EINVAL; - mitem = kmalloc(sizeof(*mitem), GFP_KERNEL); + mitem = kmalloc_obj(*mitem, GFP_KERNEL); if (!mitem) return -ENOMEM; @@ -780,8 +779,7 @@ static int team_queue_override_init(struct team *team) if (!queue_cnt) return 0; - listarr = kmalloc_array(queue_cnt, sizeof(struct list_head), - GFP_KERNEL); + listarr = kmalloc_objs(struct list_head, queue_cnt, GFP_KERNEL); if (!listarr) return -ENOMEM; team->qom_lists = listarr; @@ -1017,7 +1015,7 @@ static int __team_port_enable_netpoll(struct team_port *port) struct netpoll *np; int err; - np = kzalloc(sizeof(*np), GFP_KERNEL); + np = kzalloc_obj(*np, GFP_KERNEL); if (!np) return -ENOMEM; diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c index b14538bde2f8..b50c479f06ce 100644 --- a/drivers/net/team/team_mode_loadbalance.c +++ b/drivers/net/team/team_mode_loadbalance.c @@ -259,7 +259,7 @@ static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len, if (data_len % sizeof(struct sock_filter)) return -EINVAL; - fprog = kmalloc(sizeof(*fprog), GFP_KERNEL); + fprog = kmalloc_obj(*fprog, GFP_KERNEL); if (!fprog) return -ENOMEM; fprog->filter = kmemdup(filter, data_len, GFP_KERNEL); @@ -594,7 +594,7 @@ static int lb_init(struct team *team) BUG_ON(!func); rcu_assign_pointer(lb_priv->select_tx_port_func, func); - lb_priv->ex = kzalloc(sizeof(*lb_priv->ex), GFP_KERNEL); + lb_priv->ex = kzalloc_obj(*lb_priv->ex, GFP_KERNEL); if (!lb_priv->ex) return -ENOMEM; lb_priv->ex->team = team; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 8192740357a0..fcddbeb6d36a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -318,7 +318,7 @@ static struct tun_flow_entry *tun_flow_create(struct tun_struct *tun, struct hlist_head *head, u32 rxhash, u16 queue_index) { - struct tun_flow_entry *e = kmalloc(sizeof(*e), GFP_ATOMIC); + struct tun_flow_entry *e = kmalloc_obj(*e, GFP_ATOMIC); if (e) { netif_info(tun, tx_queued, tun->dev, @@ -2228,7 +2228,7 @@ static int __tun_set_ebpf(struct tun_struct *tun, struct tun_prog *old, *new = NULL; if (prog) { - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; new->prog = prog; @@ -3605,7 +3605,7 @@ static int tun_queue_resize(struct tun_struct *tun) int n = tun->numqueues + tun->numdisabled; int ret, i; - rings = kmalloc_array(n, sizeof(*rings), GFP_KERNEL); + rings = kmalloc_objs(*rings, n, GFP_KERNEL); if (!rings) return -ENOMEM; diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 0722050dbe32..5ab60f7c90dd 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -703,7 +703,7 @@ static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - aqc111_data = kzalloc(sizeof(*aqc111_data), GFP_KERNEL); + aqc111_data = kzalloc_obj(*aqc111_data, GFP_KERNEL); if (!aqc111_data) return -ENOMEM; diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 7eb6e86adb16..ca8a9d04a16b 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -1314,7 +1314,7 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf) dev->rx_urb_size = 2048; } - dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL); + dev->driver_priv = kzalloc_obj(struct asix_common_private, GFP_KERNEL); if (!dev->driver_priv) return -ENOMEM; diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 3100fbe153c0..54c0ba627b50 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -165,7 +165,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) if (ret) return ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 0e9ae89b840e..46e6c4dcda47 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1287,7 +1287,7 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) if (ret < 0) return ret; - ax179_data = kzalloc(sizeof(*ax179_data), GFP_KERNEL); + ax179_data = kzalloc_obj(*ax179_data, GFP_KERNEL); if (!ax179_data) return -ENOMEM; diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 5d123df0a866..39e8063b1f5b 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -827,7 +827,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ u8 iface_no; struct usb_cdc_parsed_header hdr; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c index 79a47e2fd437..54199fde1c64 100644 --- a/drivers/net/usb/cx82310_eth.c +++ b/drivers/net/usb/cx82310_eth.c @@ -173,7 +173,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) if (!dev->partial_data) return -ENOMEM; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto err_partial; diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1aeb36119d3f..1da216248896 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2313,7 +2313,7 @@ static struct hso_device *hso_create_device(struct usb_interface *intf, { struct hso_device *hso_dev; - hso_dev = kzalloc(sizeof(*hso_dev), GFP_KERNEL); + hso_dev = kzalloc_obj(*hso_dev, GFP_KERNEL); if (!hso_dev) return NULL; @@ -2617,7 +2617,7 @@ static struct hso_device *hso_create_bulk_serial_device( if (!hso_dev) return NULL; - serial = kzalloc(sizeof(*serial), GFP_KERNEL); + serial = kzalloc_obj(*serial, GFP_KERNEL); if (!serial) goto exit; @@ -2626,13 +2626,12 @@ static struct hso_device *hso_create_bulk_serial_device( if ((port & HSO_PORT_MASK) == HSO_PORT_MODEM) { num_urbs = 2; - serial->tiocmget = kzalloc(sizeof(struct hso_tiocmget), - GFP_KERNEL); + serial->tiocmget = kzalloc_obj(struct hso_tiocmget, GFP_KERNEL); if (!serial->tiocmget) goto exit; serial->tiocmget->serial_state_notification - = kzalloc(sizeof(struct hso_serial_state_notification), - GFP_KERNEL); + = kzalloc_obj(struct hso_serial_state_notification, + GFP_KERNEL); if (!serial->tiocmget->serial_state_notification) goto exit; tiocmget = serial->tiocmget; @@ -2711,7 +2710,7 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface, if (!hso_dev) return NULL; - serial = kzalloc(sizeof(*serial), GFP_KERNEL); + serial = kzalloc_obj(*serial, GFP_KERNEL); if (!serial) goto err_free_dev; @@ -2755,7 +2754,7 @@ static void hso_free_shared_int(struct hso_shared_int *mux) static struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) { - struct hso_shared_int *mux = kzalloc(sizeof(*mux), GFP_KERNEL); + struct hso_shared_int *mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return NULL; diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 00397a807393..92ec3e73edff 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -682,7 +682,7 @@ static int lan78xx_read_stats(struct lan78xx_net *dev, u32 *src; u32 *dst; - stats = kmalloc(sizeof(*stats), GFP_KERNEL); + stats = kmalloc_obj(*stats, GFP_KERNEL); if (!stats) return -ENOMEM; @@ -3728,7 +3728,7 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) int ret; int i; - dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL); + dev->data[0] = (unsigned long) kzalloc_obj(*pdata, GFP_KERNEL); pdata = (struct lan78xx_priv *)(dev->data[0]); if (!pdata) { diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c index b2495fa80171..21f6a4795295 100644 --- a/drivers/net/usb/lg-vl600.c +++ b/drivers/net/usb/lg-vl600.c @@ -56,7 +56,7 @@ struct vl600_state { static int vl600_bind(struct usbnet *dev, struct usb_interface *intf) { int ret; - struct vl600_state *s = kzalloc(sizeof(struct vl600_state), GFP_KERNEL); + struct vl600_state *s = kzalloc_obj(struct vl600_state, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 7b6d6eb60709..4f539b5d509a 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -140,7 +140,7 @@ static int update_eth_regs_async(pegasus_t *pegasus) struct urb *async_urb; struct usb_ctrlrequest *req; - req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); + req = kmalloc_obj(struct usb_ctrlrequest, GFP_ATOMIC); if (req == NULL) return ret; diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8d36162f36df..c224d2ee107c 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -9647,7 +9647,7 @@ static u8 __rtl_get_hw_ver(struct usb_device *udev) int ret; int i; - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kmalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return 0; diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 2f1f134b5b48..4cda0643afb6 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -187,7 +187,7 @@ static int async_set_registers(rtl8150_t *dev, u16 indx, u16 size, u16 reg) struct urb *async_urb; struct async_req *req; - req = kmalloc(sizeof(struct async_req), GFP_ATOMIC); + req = kmalloc_obj(struct async_req, GFP_ATOMIC); if (req == NULL) return res; async_urb = usb_alloc_urb(0, GFP_ATOMIC); diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 3ca60ebdd468..87a10f5ab557 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -683,7 +683,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) return -ENODEV; } /* Initialize sierra private data */ - priv = kzalloc(sizeof *priv, GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 1a61a8bcf5d3..8fb6bb58b589 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -1450,8 +1450,8 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv), - GFP_KERNEL); + dev->data[0] = (unsigned long) kzalloc_obj(struct smsc75xx_priv, + GFP_KERNEL); pdata = (struct smsc75xx_priv *)(dev->data[0]); if (!pdata) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 7ecf98d97493..df2c4c1f8c0b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1157,7 +1157,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return -ENOMEM; diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 8e44feaf7ff1..ed86ba87ca4e 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1377,8 +1377,7 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) return 0; /* reserve one for zero packet */ - urb->sg = kmalloc_array(num_sgs + 1, sizeof(struct scatterlist), - GFP_ATOMIC); + urb->sg = kmalloc_objs(struct scatterlist, num_sgs + 1, GFP_ATOMIC); if (!urb->sg) return -ENOMEM; @@ -2234,7 +2233,7 @@ int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, } } - req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); + req = kmalloc_obj(struct usb_ctrlrequest, GFP_ATOMIC); if (!req) goto fail_free_buf; diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 9982412fd7f2..e35df717e65e 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1434,8 +1434,8 @@ static int veth_alloc_queues(struct net_device *dev) struct veth_priv *priv = netdev_priv(dev); int i; - priv->rq = kvcalloc(dev->num_rx_queues, sizeof(*priv->rq), - GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); + priv->rq = kvzalloc_objs(*priv->rq, dev->num_rx_queues, + GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); if (!priv->rq) return -ENOMEM; diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index db88dcaefb20..31ed78712e43 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3732,7 +3732,7 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) goto succ; } - mq = kzalloc(sizeof(*mq), GFP_KERNEL); + mq = kzalloc_obj(*mq, GFP_KERNEL); if (!mq) return -ENOMEM; @@ -3799,7 +3799,7 @@ static void virtnet_rx_mode_work(struct work_struct *work) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc_allmulti = kzalloc(sizeof(*promisc_allmulti), GFP_KERNEL); + promisc_allmulti = kzalloc_obj(*promisc_allmulti, GFP_KERNEL); if (!promisc_allmulti) { dev_warn(&dev->dev, "Failed to set RX mode, no memory.\n"); return; @@ -3885,7 +3885,7 @@ static int virtnet_vlan_rx_add_vid(struct net_device *dev, __virtio16 *_vid __free(kfree) = NULL; struct scatterlist sg; - _vid = kzalloc(sizeof(*_vid), GFP_KERNEL); + _vid = kzalloc_obj(*_vid, GFP_KERNEL); if (!_vid) return -ENOMEM; @@ -3905,7 +3905,7 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev, __virtio16 *_vid __free(kfree) = NULL; struct scatterlist sg; - _vid = kzalloc(sizeof(*_vid), GFP_KERNEL); + _vid = kzalloc_obj(*_vid, GFP_KERNEL); if (!_vid) return -ENOMEM; @@ -4028,7 +4028,7 @@ static int virtnet_send_ctrl_coal_vq_cmd(struct virtnet_info *vi, struct virtio_net_ctrl_coal_vq *coal_vq __free(kfree) = NULL; struct scatterlist sgs; - coal_vq = kzalloc(sizeof(*coal_vq), GFP_KERNEL); + coal_vq = kzalloc_obj(*coal_vq, GFP_KERNEL); if (!coal_vq) return -ENOMEM; @@ -4987,7 +4987,7 @@ static int virtnet_get_hw_stats(struct virtnet_info *vi, qnum += 1; } - req = kcalloc(qnum, sizeof(*req), GFP_KERNEL); + req = kzalloc_objs(*req, qnum, GFP_KERNEL); if (!req) return -ENOMEM; @@ -5127,7 +5127,7 @@ static int virtnet_send_tx_notf_coal_cmds(struct virtnet_info *vi, struct scatterlist sgs_tx; int i; - coal_tx = kzalloc(sizeof(*coal_tx), GFP_KERNEL); + coal_tx = kzalloc_obj(*coal_tx, GFP_KERNEL); if (!coal_tx) return -ENOMEM; @@ -5175,7 +5175,7 @@ static int virtnet_send_rx_notf_coal_cmds(struct virtnet_info *vi, return 0; } - coal_rx = kzalloc(sizeof(*coal_rx), GFP_KERNEL); + coal_rx = kzalloc_obj(*coal_rx, GFP_KERNEL); if (!coal_rx) return -ENOMEM; @@ -5738,7 +5738,7 @@ static int virtnet_set_guest_offloads(struct virtnet_info *vi, u64 offloads) __virtio64 *_offloads __free(kfree) = NULL; struct scatterlist sg; - _offloads = kzalloc(sizeof(*_offloads), GFP_KERNEL); + _offloads = kzalloc_obj(*_offloads, GFP_KERNEL); if (!_offloads) return -ENOMEM; @@ -5882,7 +5882,7 @@ static int virtnet_xsk_pool_enable(struct net_device *dev, size = virtqueue_get_vring_size(rq->vq); - rq->xsk_buffs = kvcalloc(size, sizeof(*rq->xsk_buffs), GFP_KERNEL); + rq->xsk_buffs = kvzalloc_objs(*rq->xsk_buffs, size, GFP_KERNEL); if (!rq->xsk_buffs) return -ENOMEM; @@ -6395,14 +6395,14 @@ static int virtnet_find_vqs(struct virtnet_info *vi) virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); /* Allocate space for find_vqs parameters */ - vqs = kcalloc(total_vqs, sizeof(*vqs), GFP_KERNEL); + vqs = kzalloc_objs(*vqs, total_vqs, GFP_KERNEL); if (!vqs) goto err_vq; - vqs_info = kcalloc(total_vqs, sizeof(*vqs_info), GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, total_vqs, GFP_KERNEL); if (!vqs_info) goto err_vqs_info; if (!vi->big_packets || vi->mergeable_rx_bufs) { - ctx = kcalloc(total_vqs, sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_objs(*ctx, total_vqs, GFP_KERNEL); if (!ctx) goto err_ctx; } else { @@ -6460,16 +6460,16 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) int i; if (vi->has_cvq) { - vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_KERNEL); + vi->ctrl = kzalloc_obj(*vi->ctrl, GFP_KERNEL); if (!vi->ctrl) goto err_ctrl; } else { vi->ctrl = NULL; } - vi->sq = kcalloc(vi->max_queue_pairs, sizeof(*vi->sq), GFP_KERNEL); + vi->sq = kzalloc_objs(*vi->sq, vi->max_queue_pairs, GFP_KERNEL); if (!vi->sq) goto err_sq; - vi->rq = kcalloc(vi->max_queue_pairs, sizeof(*vi->rq), GFP_KERNEL); + vi->rq = kzalloc_objs(*vi->rq, vi->max_queue_pairs, GFP_KERNEL); if (!vi->rq) goto err_rq; @@ -7016,7 +7016,7 @@ static int virtnet_probe(struct virtio_device *vdev) struct scatterlist sg; __le64 v; - stats_cap = kzalloc(sizeof(*stats_cap), GFP_KERNEL); + stats_cap = kzalloc_obj(*stats_cap, GFP_KERNEL); if (!stats_cap) { rtnl_unlock(); err = -ENOMEM; diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 571847a7f86d..8c009bcaa8e7 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -158,7 +158,7 @@ static struct vrf_map_elem *vrf_map_elem_alloc(gfp_t flags) { struct vrf_map_elem *me; - me = kmalloc(sizeof(*me), flags); + me = kmalloc_obj(*me, flags); if (!me) return NULL; diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 7bd0ae0a6a33..c1cf3eff4c1b 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -580,7 +580,7 @@ static int vxlan_fdb_append(struct vxlan_fdb *f, if (rd) return 0; - rd = kmalloc(sizeof(*rd), GFP_ATOMIC); + rd = kmalloc_obj(*rd, GFP_ATOMIC); if (rd == NULL) return -ENOMEM; @@ -774,7 +774,7 @@ static struct vxlan_fdb *vxlan_fdb_alloc(struct vxlan_dev *vxlan, const u8 *mac, { struct vxlan_fdb *f; - f = kmalloc(sizeof(*f), GFP_ATOMIC); + f = kmalloc_obj(*f, GFP_ATOMIC); if (!f) return NULL; memset(&f->key, 0, sizeof(f->key)); @@ -3578,7 +3578,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, bool ipv6, ASSERT_RTNL(); - vs = kzalloc(sizeof(*vs), GFP_KERNEL); + vs = kzalloc_obj(*vs, GFP_KERNEL); if (!vs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/vxlan/vxlan_mdb.c b/drivers/net/vxlan/vxlan_mdb.c index 816ab1aa0526..8f53ae776613 100644 --- a/drivers/net/vxlan/vxlan_mdb.c +++ b/drivers/net/vxlan/vxlan_mdb.c @@ -430,7 +430,7 @@ static int vxlan_mdb_config_src_entry_init(struct vxlan_mdb_config *cfg, extack)) return -EINVAL; - src = kzalloc(sizeof(*src), GFP_KERNEL); + src = kzalloc_obj(*src, GFP_KERNEL); if (!src) return -ENOMEM; @@ -697,7 +697,7 @@ static int vxlan_mdb_remote_rdst_init(const struct vxlan_mdb_config *cfg, struct vxlan_rdst *rd; int err; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; @@ -767,7 +767,7 @@ vxlan_mdb_remote_src_entry_add(struct vxlan_mdb_remote *remote, { struct vxlan_mdb_src_entry *ent; - ent = kzalloc(sizeof(*ent), GFP_KERNEL); + ent = kzalloc_obj(*ent, GFP_KERNEL); if (!ent) return NULL; @@ -1139,7 +1139,7 @@ static int vxlan_mdb_remote_add(const struct vxlan_mdb_config *cfg, return -ENOENT; } - remote = kzalloc(sizeof(*remote), GFP_KERNEL); + remote = kzalloc_obj(*remote, GFP_KERNEL); if (!remote) return -ENOMEM; @@ -1187,7 +1187,7 @@ vxlan_mdb_entry_get(struct vxlan_dev *vxlan, if (mdb_entry) return mdb_entry; - mdb_entry = kzalloc(sizeof(*mdb_entry), GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); if (!mdb_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index cde897d92f24..726a34d16fa2 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -697,7 +697,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan, { struct vxlan_vni_node *vninode; - vninode = kzalloc(sizeof(*vninode), GFP_KERNEL); + vninode = kzalloc_obj(*vninode, GFP_KERNEL); if (!vninode) return NULL; vninode->stats = netdev_alloc_pcpu_stats(struct vxlan_vni_stats_pcpu); @@ -925,7 +925,7 @@ int vxlan_vnigroup_init(struct vxlan_dev *vxlan) struct vxlan_vni_group *vg; int ret; - vg = kzalloc(sizeof(*vg), GFP_KERNEL); + vg = kzalloc_obj(*vg, GFP_KERNEL); if (!vg) return -ENOMEM; ret = rhashtable_init(&vg->vni_hash, &vxlan_vni_rht_params); diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c index 8dd14d916c3a..82ba8dfa979b 100644 --- a/drivers/net/wan/c101.c +++ b/drivers/net/wan/c101.c @@ -313,7 +313,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) return -ENODEV; } - card = kzalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc_obj(card_t, GFP_KERNEL); if (!card) return -ENOBUFS; diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 5b01642ca44e..9f989b2ff558 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c @@ -2359,7 +2359,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Allocate driver private data */ - card = kzalloc(sizeof(struct fst_card_info), GFP_KERNEL); + card = kzalloc_obj(struct fst_card_info, GFP_KERNEL); if (!card) return -ENOMEM; diff --git a/drivers/net/wan/framer/framer-core.c b/drivers/net/wan/framer/framer-core.c index bf7ac7dd2804..66ed38e97336 100644 --- a/drivers/net/wan/framer/framer-core.c +++ b/drivers/net/wan/framer/framer-core.c @@ -615,7 +615,7 @@ struct framer *framer_create(struct device *dev, struct device_node *node, if (WARN_ON((ops->flags & FRAMER_FLAG_POLL_STATUS) && !ops->get_status)) return ERR_PTR(-EINVAL); - framer = kzalloc(sizeof(*framer), GFP_KERNEL); + framer = kzalloc_obj(*framer, GFP_KERNEL); if (!framer) return ERR_PTR(-ENOMEM); @@ -771,7 +771,7 @@ __framer_provider_of_register(struct device *dev, struct module *owner, { struct framer_provider *framer_provider; - framer_provider = kzalloc(sizeof(*framer_provider), GFP_KERNEL); + framer_provider = kzalloc_obj(*framer_provider, GFP_KERNEL); if (!framer_provider) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wan/framer/pef2256/pef2256.c b/drivers/net/wan/framer/pef2256/pef2256.c index c058cc79137d..f7ed6b3dd2d7 100644 --- a/drivers/net/wan/framer/pef2256/pef2256.c +++ b/drivers/net/wan/framer/pef2256/pef2256.c @@ -638,7 +638,7 @@ static int pef2256_add_audio_devices(struct pef2256 *pef2256) if (!count) return 0; - audio_devs = kcalloc(count, sizeof(*audio_devs), GFP_KERNEL); + audio_devs = kzalloc_objs(*audio_devs, count, GFP_KERNEL); if (!audio_devs) return -ENOMEM; diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index dff84731343c..5e93e204da0c 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -203,17 +203,15 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) goto free_tx_bd; } - priv->rx_skbuff = kcalloc(priv->rx_ring_size, - sizeof(*priv->rx_skbuff), - GFP_KERNEL); + priv->rx_skbuff = kzalloc_objs(*priv->rx_skbuff, priv->rx_ring_size, + GFP_KERNEL); if (!priv->rx_skbuff) { ret = -ENOMEM; goto free_ucc_pram; } - priv->tx_skbuff = kcalloc(priv->tx_ring_size, - sizeof(*priv->tx_skbuff), - GFP_KERNEL); + priv->tx_skbuff = kzalloc_objs(*priv->tx_skbuff, priv->tx_ring_size, + GFP_KERNEL); if (!priv->tx_skbuff) { ret = -ENOMEM; goto free_rx_skbuff; @@ -900,8 +898,7 @@ static int uhdlc_suspend(struct device *dev) priv->gumr = ioread32be(&uf_regs->gumr); priv->guemr = ioread8(&uf_regs->guemr); - priv->ucc_pram_bak = kmalloc(sizeof(*priv->ucc_pram_bak), - GFP_KERNEL); + priv->ucc_pram_bak = kmalloc_obj(*priv->ucc_pram_bak, GFP_KERNEL); if (!priv->ucc_pram_bak) return -ENOMEM; @@ -1173,7 +1170,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev) ut_info->uf_info.regs = res.start; ut_info->uf_info.irq = irq_of_parse_and_map(np, 0); - uhdlc_priv = kzalloc(sizeof(*uhdlc_priv), GFP_KERNEL); + uhdlc_priv = kzalloc_obj(*uhdlc_priv, GFP_KERNEL); if (!uhdlc_priv) return -ENOMEM; @@ -1186,7 +1183,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev) uhdlc_priv->hdlc_bus = of_property_read_bool(np, "fsl,hdlc-bus"); if (uhdlc_priv->tsa == 1) { - utdm = kzalloc(sizeof(*utdm), GFP_KERNEL); + utdm = kzalloc_obj(*utdm, GFP_KERNEL); if (!utdm) { ret = -ENOMEM; dev_err(&pdev->dev, "No mem to alloc ucc tdm data\n"); diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 08a0ba5ca471..5f0e54ed1ee1 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c @@ -192,7 +192,7 @@ static struct pvc_device *add_pvc(struct net_device *dev, u16 dlci) pvc_p = &(*pvc_p)->next; } - pvc = kzalloc(sizeof(*pvc), GFP_ATOMIC); + pvc = kzalloc_obj(*pvc, GFP_ATOMIC); #ifdef DEBUG_PVC printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev); #endif diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index f3e80722ba1d..1892ee67bf20 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -340,7 +340,7 @@ static int __init n2_run(unsigned long io, unsigned long irq, return -ENODEV; } - card = kzalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc_obj(card_t, GFP_KERNEL); if (!card) return -ENOBUFS; diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index 4766446f0fa0..82ae9e1db51d 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c @@ -300,7 +300,7 @@ static int pc300_pci_init_one(struct pci_dev *pdev, return i; } - card = kzalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc_obj(card_t, GFP_KERNEL); if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index ea86c7035653..33f562919923 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c @@ -281,7 +281,7 @@ static int pci200_pci_init_one(struct pci_dev *pdev, return i; } - card = kzalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc_obj(card_t, GFP_KERNEL); if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 5a9e262188ef..d24443390932 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -598,7 +598,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, ports = 4; } - card = kzalloc(struct_size(card, ports, ports), GFP_KERNEL); + card = kzalloc_flex(*card, ports, ports, GFP_KERNEL); if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c index 1fe8468f0bef..994b7c6f0613 100644 --- a/drivers/net/wireguard/noise.c +++ b/drivers/net/wireguard/noise.c @@ -97,7 +97,7 @@ void wg_noise_handshake_clear(struct noise_handshake *handshake) static struct noise_keypair *keypair_create(struct wg_peer *peer) { - struct noise_keypair *keypair = kzalloc(sizeof(*keypair), GFP_KERNEL); + struct noise_keypair *keypair = kzalloc_obj(*keypair, GFP_KERNEL); if (unlikely(!keypair)) return NULL; diff --git a/drivers/net/wireguard/peerlookup.c b/drivers/net/wireguard/peerlookup.c index f2783aa7a88f..5ae4e6c5e7c9 100644 --- a/drivers/net/wireguard/peerlookup.c +++ b/drivers/net/wireguard/peerlookup.c @@ -21,7 +21,7 @@ static struct hlist_head *pubkey_bucket(struct pubkey_hashtable *table, struct pubkey_hashtable *wg_pubkey_hashtable_alloc(void) { - struct pubkey_hashtable *table = kvmalloc(sizeof(*table), GFP_KERNEL); + struct pubkey_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL); if (!table) return NULL; @@ -82,7 +82,7 @@ static struct hlist_head *index_bucket(struct index_hashtable *table, struct index_hashtable *wg_index_hashtable_alloc(void) { - struct index_hashtable *table = kvmalloc(sizeof(*table), GFP_KERNEL); + struct index_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL); if (!table) return NULL; diff --git a/drivers/net/wireguard/ratelimiter.c b/drivers/net/wireguard/ratelimiter.c index dd55e5c26f46..13d532a44294 100644 --- a/drivers/net/wireguard/ratelimiter.c +++ b/drivers/net/wireguard/ratelimiter.c @@ -176,12 +176,12 @@ int wg_ratelimiter_init(void) (1U << 14) / sizeof(struct hlist_head))); max_entries = table_size * 8; - table_v4 = kvcalloc(table_size, sizeof(*table_v4), GFP_KERNEL); + table_v4 = kvzalloc_objs(*table_v4, table_size, GFP_KERNEL); if (unlikely(!table_v4)) goto err_kmemcache; #if IS_ENABLED(CONFIG_IPV6) - table_v6 = kvcalloc(table_size, sizeof(*table_v6), GFP_KERNEL); + table_v6 = kvzalloc_objs(*table_v6, table_size, GFP_KERNEL); if (unlikely(!table_v6)) { kvfree(table_v4); goto err_kmemcache; diff --git a/drivers/net/wireguard/selftest/allowedips.c b/drivers/net/wireguard/selftest/allowedips.c index 41837efa70cb..6c7c79e39ad4 100644 --- a/drivers/net/wireguard/selftest/allowedips.c +++ b/drivers/net/wireguard/selftest/allowedips.c @@ -181,7 +181,7 @@ static __init int horrible_allowedips_insert_v4(struct horrible_allowedips *table, struct in_addr *ip, u8 cidr, void *value) { - struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL); + struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL); if (unlikely(!node)) return -ENOMEM; @@ -198,7 +198,7 @@ static __init int horrible_allowedips_insert_v6(struct horrible_allowedips *table, struct in6_addr *ip, u8 cidr, void *value) { - struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL); + struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL); if (unlikely(!node)) return -ENOMEM; @@ -266,13 +266,13 @@ static __init bool randomized_test(void) wg_allowedips_init(&t); horrible_allowedips_init(&h); - peers = kcalloc(NUM_PEERS, sizeof(*peers), GFP_KERNEL); + peers = kzalloc_objs(*peers, NUM_PEERS, GFP_KERNEL); if (unlikely(!peers)) { pr_err("allowedips random self-test malloc: FAIL\n"); goto free; } for (i = 0; i < NUM_PEERS; ++i) { - peers[i] = kzalloc(sizeof(*peers[i]), GFP_KERNEL); + peers[i] = kzalloc_obj(*peers[i], GFP_KERNEL); if (unlikely(!peers[i])) { pr_err("allowedips random self-test malloc: FAIL\n"); goto free; @@ -447,7 +447,7 @@ static __init inline struct in6_addr *ip6(u32 a, u32 b, u32 c, u32 d) static __init struct wg_peer *init_peer(void) { - struct wg_peer *peer = kzalloc(sizeof(*peer), GFP_KERNEL); + struct wg_peer *peer = kzalloc_obj(*peer, GFP_KERNEL); if (!peer) return NULL; diff --git a/drivers/net/wireguard/selftest/counter.c b/drivers/net/wireguard/selftest/counter.c index ec3c156bf91b..13c5535a1fd6 100644 --- a/drivers/net/wireguard/selftest/counter.c +++ b/drivers/net/wireguard/selftest/counter.c @@ -10,7 +10,7 @@ bool __init wg_packet_counter_selftest(void) unsigned int test_num = 0, i; bool success = true; - counter = kmalloc(sizeof(*counter), GFP_KERNEL); + counter = kmalloc_obj(*counter, GFP_KERNEL); if (unlikely(!counter)) { pr_err("nonce counter self-test malloc: FAIL\n"); return false; diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index 1230e6278f23..f1567365ac04 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c @@ -1512,11 +1512,11 @@ static int ar5523_load_firmware(struct usb_device *dev) return -ENOENT; } - txblock = kzalloc(sizeof(*txblock), GFP_KERNEL); + txblock = kzalloc_obj(*txblock, GFP_KERNEL); if (!txblock) goto out; - rxblock = kmalloc(sizeof(*rxblock), GFP_KERNEL); + rxblock = kmalloc_obj(*rxblock, GFP_KERNEL); if (!rxblock) goto out_free_txblock; diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 82f120ee1c66..23e5163acc9a 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -1461,8 +1461,8 @@ ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id, nentries = roundup_pow_of_two(nentries); - src_ring = kzalloc(struct_size(src_ring, per_transfer_context, - nentries), GFP_KERNEL); + src_ring = kzalloc_flex(*src_ring, per_transfer_context, nentries, + GFP_KERNEL); if (src_ring == NULL) return ERR_PTR(-ENOMEM); @@ -1519,8 +1519,8 @@ ath10k_ce_alloc_src_ring_64(struct ath10k *ar, unsigned int ce_id, nentries = roundup_pow_of_two(nentries); - src_ring = kzalloc(struct_size(src_ring, per_transfer_context, - nentries), GFP_KERNEL); + src_ring = kzalloc_flex(*src_ring, per_transfer_context, nentries, + GFP_KERNEL); if (!src_ring) return ERR_PTR(-ENOMEM); @@ -1575,8 +1575,8 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, nentries = roundup_pow_of_two(attr->dest_nentries); - dest_ring = kzalloc(struct_size(dest_ring, per_transfer_context, - nentries), GFP_KERNEL); + dest_ring = kzalloc_flex(*dest_ring, per_transfer_context, nentries, + GFP_KERNEL); if (dest_ring == NULL) return ERR_PTR(-ENOMEM); @@ -1619,8 +1619,8 @@ ath10k_ce_alloc_dest_ring_64(struct ath10k *ar, unsigned int ce_id, nentries = roundup_pow_of_two(attr->dest_nentries); - dest_ring = kzalloc(struct_size(dest_ring, per_transfer_context, - nentries), GFP_KERNEL); + dest_ring = kzalloc_flex(*dest_ring, per_transfer_context, nentries, + GFP_KERNEL); if (!dest_ring) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index d7e429041065..bea2cd4e5ee4 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -807,8 +807,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) } htt->rx_ring.netbufs_ring = - kcalloc(htt->rx_ring.size, sizeof(struct sk_buff *), - GFP_KERNEL); + kzalloc_objs(struct sk_buff *, htt->rx_ring.size, GFP_KERNEL); if (!htt->rx_ring.netbufs_ring) goto err_netbuf; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index da6f7957a0ae..ef595a939bde 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -6431,7 +6431,7 @@ static int ath10k_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) { ret = -ENOMEM; goto exit; @@ -7559,8 +7559,8 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, } if (ath10k_debug_is_extd_tx_stats_enabled(ar)) { - arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats), - GFP_KERNEL); + arsta->tx_stats = kzalloc_obj(*arsta->tx_stats, + GFP_KERNEL); if (!arsta->tx_stats) { ath10k_mac_dec_num_stations(arvif, sta); ret = -ENOMEM; @@ -7972,7 +7972,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) { ret = -ENOMEM; goto exit; @@ -8954,8 +8954,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw, if (arg.n_vifs == 0) goto radar; - arg.vifs = kcalloc(arg.n_vifs, sizeof(arg.vifs[0]), - GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); if (!arg.vifs) goto radar; diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 8275345631a0..62c9ef500ee7 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -245,7 +245,7 @@ static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi) const u8 *temp; int ret; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -437,7 +437,7 @@ ath10k_qmi_cfg_send_sync_msg(struct ath10k *ar, int ret; u32 i; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -578,7 +578,7 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) struct qmi_txn txn; int ret; - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) return -ENOMEM; @@ -877,7 +877,7 @@ ath10k_qmi_driver_event_post(struct ath10k_qmi *qmi, { struct ath10k_qmi_driver_event *event; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return -ENOMEM; @@ -1075,7 +1075,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size) struct ath10k_qmi *qmi; int ret; - qmi = kzalloc(sizeof(*qmi), GFP_KERNEL); + qmi = kzalloc_obj(*qmi, GFP_KERNEL); if (!qmi) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 00d0556dafef..ff046cff7399 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -246,7 +246,7 @@ static int ath10k_sdio_writesb32(struct ath10k *ar, u32 addr, u32 val) __le32 *buf; int ret; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -1766,7 +1766,7 @@ static int ath10k_sdio_diag_read32(struct ath10k *ar, u32 address, __le32 *val; int ret; - val = kzalloc(sizeof(*val), GFP_KERNEL); + val = kzalloc_obj(*val, GFP_KERNEL); if (!val) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 493bfb410aff..50a3498a0bfd 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -230,7 +230,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt, spin_lock_bh(&ar->data_lock); peer = ath10k_peer_find(ar, ev->vdev_id, ev->addr); if (!peer) { - peer = kzalloc(sizeof(*peer), GFP_ATOMIC); + peer = kzalloc_obj(*peer, GFP_ATOMIC); if (!peer) goto exit; diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c index 1732a4f98418..59969db56048 100644 --- a/drivers/net/wireless/ath/ath10k/usb.c +++ b/drivers/net/wireless/ath/ath10k/usb.c @@ -799,7 +799,7 @@ static int ath10k_usb_alloc_pipe_resources(struct ath10k *ar, init_usb_anchor(&pipe->urb_submitted); for (i = 0; i < urb_cnt; i++) { - urb_context = kzalloc(sizeof(*urb_context), GFP_KERNEL); + urb_context = kzalloc_obj(*urb_context, GFP_KERNEL); if (!urb_context) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 16d07d619b4d..ec8e91707f84 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -145,7 +145,7 @@ ath10k_wmi_tlv_parse_alloc(struct ath10k *ar, const void *ptr, const void **tb; int ret; - tb = kcalloc(WMI_TLV_TAG_MAX, sizeof(*tb), gfp); + tb = kzalloc_objs(*tb, WMI_TLV_TAG_MAX, gfp); if (!tb) return ERR_PTR(-ENOMEM); @@ -1546,7 +1546,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar, data += sizeof(*src); data_len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -1569,7 +1569,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar, data += sizeof(*src); data_len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -1590,7 +1590,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar, data += sizeof(*src); data_len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3063,7 +3063,7 @@ ath10k_wmi_mgmt_tx_alloc_msdu_id(struct ath10k *ar, struct sk_buff *skb, struct ath10k_mgmt_tx_pkt_addr *pkt_addr; int ret; - pkt_addr = kmalloc(sizeof(*pkt_addr), GFP_ATOMIC); + pkt_addr = kmalloc_obj(*pkt_addr, GFP_ATOMIC); if (!pkt_addr) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index ce22141e5efd..0bdb38edd915 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3046,7 +3046,7 @@ static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3067,7 +3067,7 @@ static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3100,7 +3100,7 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3122,7 +3122,7 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3161,7 +3161,7 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3198,7 +3198,7 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3238,7 +3238,7 @@ static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3281,7 +3281,7 @@ static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, stats_len)) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3330,7 +3330,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3376,7 +3376,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3409,7 +3409,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -3429,7 +3429,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar, if (!skb_pull(skb, sizeof(*src))) return -EPROTO; - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; ath10k_wmi_10_4_pull_vdev_stats(src, dst); @@ -4912,7 +4912,7 @@ void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb) rate_max = WMI_TPC_RATE_MAX; } - tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC); + tpc_stats = kzalloc_obj(*tpc_stats, GFP_ATOMIC); if (!tpc_stats) return; @@ -5168,7 +5168,7 @@ void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb) rate_max = WMI_TPC_FINAL_RATE_MAX; } - tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC); + tpc_stats = kzalloc_obj(*tpc_stats, GFP_ATOMIC); if (!tpc_stats) return; diff --git a/drivers/net/wireless/ath/ath10k/wow.c b/drivers/net/wireless/ath/ath10k/wow.c index aa7b2e703f3d..8b7f608b5265 100644 --- a/drivers/net/wireless/ath/ath10k/wow.c +++ b/drivers/net/wireless/ath/ath10k/wow.c @@ -301,7 +301,7 @@ static int ath10k_vif_wow_set_wakeups(struct ath10k_vif *arvif, struct wmi_pno_scan_req *pno; int ret; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; @@ -413,7 +413,7 @@ static int ath10k_vif_wow_clean_nlo(struct ath10k_vif *arvif) if (ar->nlo_enabled) { struct wmi_pno_scan_req *pno; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c index a7a163621b21..b91f8bb9a81c 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -615,7 +615,7 @@ ath11k_ce_alloc_ring(struct ath11k_base *ab, int nentries, int desc_sz) struct ath11k_ce_ring *ce_ring; dma_addr_t base_addr; - ce_ring = kzalloc(struct_size(ce_ring, skb, nentries), GFP_KERNEL); + ce_ring = kzalloc_flex(*ce_ring, skb, nentries, GFP_KERNEL); if (ce_ring == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/ath/ath11k/cfr.c b/drivers/net/wireless/ath/ath11k/cfr.c index 61bf1c0884f7..61ac656ece07 100644 --- a/drivers/net/wireless/ath/ath11k/cfr.c +++ b/drivers/net/wireless/ath/ath11k/cfr.c @@ -975,8 +975,7 @@ int ath11k_cfr_init(struct ath11k_base *ab) spin_lock_init(&cfr->lut_lock); num_lut_entries = min_t(u32, CFR_MAX_LUT_ENTRIES, db_cap.min_elem); - cfr->lut = kcalloc(num_lut_entries, sizeof(*cfr->lut), - GFP_KERNEL); + cfr->lut = kzalloc_objs(*cfr->lut, num_lut_entries, GFP_KERNEL); if (!cfr->lut) { ret = -ENOMEM; goto err; diff --git a/drivers/net/wireless/ath/ath11k/dbring.c b/drivers/net/wireless/ath/ath11k/dbring.c index d6994ce6ebff..6ac18f8a1e5f 100644 --- a/drivers/net/wireless/ath/ath11k/dbring.c +++ b/drivers/net/wireless/ath/ath11k/dbring.c @@ -127,7 +127,7 @@ static int ath11k_dbring_fill_bufs(struct ath11k *ar, size = ring->buf_sz + align - 1; while (num_remain > 0) { - buff = kzalloc(sizeof(*buff), GFP_ATOMIC); + buff = kzalloc_obj(*buff, GFP_ATOMIC); if (!buff) break; diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c index 50f344803e8f..9b8660e56a1a 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c @@ -1193,8 +1193,7 @@ static int ath11k_debugfs_dbr_dbg_init(struct ath11k *ar, int dbr_id) if (ar->debug.dbr_debug[dbr_id]) return 0; - ar->debug.dbr_debug[dbr_id] = kzalloc(sizeof(*dbr_debug), - GFP_KERNEL); + ar->debug.dbr_debug[dbr_id] = kzalloc_obj(*dbr_debug, GFP_KERNEL); if (!ar->debug.dbr_debug[dbr_id]) return -ENOMEM; @@ -1216,9 +1215,9 @@ static int ath11k_debugfs_dbr_dbg_init(struct ath11k *ar, int dbr_id) dbr_debug->dbr_debug_enabled = true; dbr_dbg_data->num_ring_debug_entries = ATH11K_DEBUG_DBR_ENTRIES_MAX; dbr_dbg_data->dbr_debug_idx = 0; - dbr_dbg_data->entries = kcalloc(ATH11K_DEBUG_DBR_ENTRIES_MAX, - sizeof(struct ath11k_dbg_dbr_entry), - GFP_KERNEL); + dbr_dbg_data->entries = kzalloc_objs(struct ath11k_dbg_dbr_entry, + ATH11K_DEBUG_DBR_ENTRIES_MAX, + GFP_KERNEL); if (!dbr_dbg_data->entries) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index b9e976ddcbbf..49d959b2e148 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -772,7 +772,7 @@ static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx, return; } - elem = kzalloc(sizeof(*elem), GFP_ATOMIC); + elem = kzalloc_obj(*elem, GFP_ATOMIC); if (!elem) goto free_desc; @@ -1542,7 +1542,7 @@ struct htt_ppdu_stats_info *ath11k_dp_htt_get_ppdu_desc(struct ath11k *ar, } } - ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_ATOMIC); + ppdu_info = kzalloc_obj(*ppdu_info, GFP_ATOMIC); if (!ppdu_info) return NULL; @@ -5485,7 +5485,7 @@ static int ath11k_dp_rx_full_mon_prepare_mpdu(struct ath11k_dp *dp, struct sk_buff *head, struct sk_buff *tail) { - mon_mpdu = kzalloc(sizeof(*mon_mpdu), GFP_ATOMIC); + mon_mpdu = kzalloc_obj(*mon_mpdu, GFP_ATOMIC); if (!mon_mpdu) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c index 86e1e6c27b36..9c2310665713 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c @@ -796,7 +796,7 @@ int ath11k_dp_tx_send_reo_cmd(struct ath11k_base *ab, struct dp_rx_tid *rx_tid, * for tid delete command to free up the resource on the command status * indication? */ - dp_cmd = kzalloc(sizeof(*dp_cmd), GFP_ATOMIC); + dp_cmd = kzalloc_obj(*dp_cmd, GFP_ATOMIC); if (!dp_cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 4dfd08b58416..7ec87ea7620f 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4221,7 +4221,7 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) { ret = -ENOMEM; @@ -7876,7 +7876,7 @@ ath11k_mac_update_active_vif_chan(struct ath11k *ar, if (arg.n_vifs == 0) return; - arg.vifs = kcalloc(arg.n_vifs, sizeof(arg.vifs[0]), GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); if (!arg.vifs) return; @@ -9729,7 +9729,7 @@ static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) { ret = -ENOMEM; goto exit; @@ -9823,7 +9823,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, arvif->reinstall_group_keys = false; } - arsta->rx_stats = kzalloc(sizeof(*arsta->rx_stats), GFP_KERNEL); + arsta->rx_stats = kzalloc_obj(*arsta->rx_stats, GFP_KERNEL); if (!arsta->rx_stats) { ret = -ENOMEM; goto dec_num_station; @@ -9844,7 +9844,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, sta->addr, arvif->vdev_id); if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) { - arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats), GFP_KERNEL); + arsta->tx_stats = kzalloc_obj(*arsta->tx_stats, GFP_KERNEL); if (!arsta->tx_stats) { ret = -ENOMEM; goto free_peer; @@ -10278,7 +10278,7 @@ static void ath11k_mac_setup_mac_address_list(struct ath11k *ar) return; n_addresses = ar->ab->hw_params.num_vdevs; - addresses = kcalloc(n_addresses, sizeof(*addresses), GFP_KERNEL); + addresses = kzalloc_objs(*addresses, n_addresses, GFP_KERNEL); if (!addresses) return; @@ -10310,7 +10310,7 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) else n_combos = 1; - combinations = kcalloc(n_combos, sizeof(*combinations), GFP_KERNEL); + combinations = kzalloc_objs(*combinations, n_combos, GFP_KERNEL); if (!combinations) return -ENOMEM; @@ -10319,7 +10319,7 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) else n_limits = 2; - limits = kcalloc(n_limits, sizeof(*limits), GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); if (!limits) { kfree(combinations); return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c index d2c44f7f9b62..7cb91d23362f 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c @@ -207,7 +207,7 @@ static int ath11k_mhi_get_msi(struct ath11k_pci *ab_pci) ath11k_dbg(ab, ATH11K_DBG_PCI, "num_vectors %d base_vector %d\n", num_vectors, base_vector); - irq = kcalloc(num_vectors, sizeof(int), GFP_KERNEL); + irq = kzalloc_objs(int, num_vectors, GFP_KERNEL); if (!irq) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/peer.c b/drivers/net/wireless/ath/ath11k/peer.c index 6d0126c39301..027cc7aa58c8 100644 --- a/drivers/net/wireless/ath/ath11k/peer.c +++ b/drivers/net/wireless/ath/ath11k/peer.c @@ -125,7 +125,7 @@ void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, spin_lock_bh(&ab->base_lock); peer = ath11k_peer_find(ab, vdev_id, mac_addr); if (!peer) { - peer = kzalloc(sizeof(*peer), GFP_ATOMIC); + peer = kzalloc_obj(*peer, GFP_ATOMIC); if (!peer) goto exit; diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index ff6a97e328b8..ea6f560abd98 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1799,11 +1799,11 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab) struct qmi_txn txn; int ret; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) { ret = -ENOMEM; goto resp_out; @@ -1878,7 +1878,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) int ret = 0, i; bool delayed; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -2306,7 +2306,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab, int ret = 0; u32 remaining = len; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -2705,7 +2705,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -2929,7 +2929,7 @@ ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, { struct ath11k_qmi_driver_event *event; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c index 49b79648752c..0cf830d97dbd 100644 --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c @@ -146,8 +146,7 @@ int ath11k_reg_update_chan_list(struct ath11k *ar, bool wait) if (WARN_ON(!num_channels)) return -EINVAL; - params = kzalloc(struct_size(params, ch_param, num_channels), - GFP_KERNEL); + params = kzalloc_flex(*params, ch_param, num_channels, GFP_KERNEL); if (!params) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 451cc4c719ae..40747fba3b0c 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -249,7 +249,7 @@ const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void **tb; int ret; - tb = kcalloc(WMI_TAG_MAX, sizeof(*tb), gfp); + tb = kzalloc_objs(*tb, WMI_TAG_MAX, gfp); if (!tb) return ERR_PTR(-ENOMEM); @@ -4918,9 +4918,8 @@ static int ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse(struct ath11k_base *soc, } if (!soc->reg_info_store) { - soc->reg_info_store = kcalloc(soc->num_radios, - sizeof(*soc->reg_info_store), - GFP_ATOMIC); + soc->reg_info_store = kzalloc_objs(*soc->reg_info_store, + soc->num_radios, GFP_ATOMIC); if (!soc->reg_info_store) return -ENOMEM; } @@ -5238,8 +5237,7 @@ static struct cur_reg_rule struct cur_reg_rule *reg_rule_ptr; u32 count; - reg_rule_ptr = kcalloc(num_reg_rules, sizeof(*reg_rule_ptr), - GFP_ATOMIC); + reg_rule_ptr = kzalloc_objs(*reg_rule_ptr, num_reg_rules, GFP_ATOMIC); if (!reg_rule_ptr) return NULL; @@ -5388,7 +5386,7 @@ static struct cur_reg_rule struct cur_reg_rule *reg_rule_ptr; u32 count; - reg_rule_ptr = kcalloc(num_reg_rules, sizeof(*reg_rule_ptr), GFP_ATOMIC); + reg_rule_ptr = kzalloc_objs(*reg_rule_ptr, num_reg_rules, GFP_ATOMIC); if (!reg_rule_ptr) return NULL; @@ -6694,7 +6692,7 @@ static int ath11k_wmi_tlv_fw_stats_data_parse(struct ath11k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -6737,7 +6735,7 @@ static int ath11k_wmi_tlv_fw_stats_data_parse(struct ath11k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -6760,7 +6758,7 @@ static int ath11k_wmi_tlv_fw_stats_data_parse(struct ath11k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -7247,7 +7245,7 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *sk struct cur_regulatory_info *reg_info; int ret; - reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC); + reg_info = kzalloc_obj(*reg_info, GFP_ATOMIC); if (!reg_info) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/wow.c b/drivers/net/wireless/ath/ath11k/wow.c index b6f08755129f..7b696d1dd0e8 100644 --- a/drivers/net/wireless/ath/ath11k/wow.c +++ b/drivers/net/wireless/ath/ath11k/wow.c @@ -381,7 +381,7 @@ static int ath11k_vif_wow_set_wakeups(struct ath11k_vif *arvif, struct wmi_pno_scan_req *pno; int ret; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; @@ -495,7 +495,7 @@ static int ath11k_vif_wow_clean_nlo(struct ath11k_vif *arvif) if (ar->nlo_enabled) { struct wmi_pno_scan_req *pno; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/ce.c b/drivers/net/wireless/ath/ath12k/ce.c index f13b260c5c96..1106671dc844 100644 --- a/drivers/net/wireless/ath/ath12k/ce.c +++ b/drivers/net/wireless/ath/ath12k/ce.c @@ -332,7 +332,7 @@ ath12k_ce_alloc_ring(struct ath12k_base *ab, int nentries, int desc_sz) struct ath12k_ce_ring *ce_ring; dma_addr_t base_addr; - ce_ring = kzalloc(struct_size(ce_ring, skb, nentries), GFP_KERNEL); + ce_ring = kzalloc_flex(*ce_ring, skb, nentries, GFP_KERNEL); if (!ce_ring) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 9d6c50a94e64..d9b41fc90dcd 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -1805,7 +1805,7 @@ static struct ath12k_hw_group *ath12k_core_hw_group_alloc(struct ath12k_base *ab list_for_each_entry(ag, &ath12k_hw_group_list, list) count++; - ag = kzalloc(sizeof(*ag), GFP_KERNEL); + ag = kzalloc_obj(*ag, GFP_KERNEL); if (!ag) return NULL; diff --git a/drivers/net/wireless/ath/ath12k/dp.c b/drivers/net/wireless/ath/ath12k/dp.c index ab54c8a84d3e..43f8ef03b1cf 100644 --- a/drivers/net/wireless/ath/ath12k/dp.c +++ b/drivers/net/wireless/ath/ath12k/dp.c @@ -407,9 +407,8 @@ static int ath12k_dp_init_bank_profiles(struct ath12k_base *ab) int i; dp->num_bank_profiles = num_tcl_banks; - dp->bank_profiles = kmalloc_array(num_tcl_banks, - sizeof(struct ath12k_dp_tx_bank_profile), - GFP_KERNEL); + dp->bank_profiles = kmalloc_objs(struct ath12k_dp_tx_bank_profile, + num_tcl_banks, GFP_KERNEL); if (!dp->bank_profiles) return -ENOMEM; @@ -1215,8 +1214,8 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab) spin_lock_bh(&dp->rx_desc_lock); - dp->rxbaddr = kcalloc(num_rx_spt_pages, - sizeof(struct ath12k_rx_desc_info *), GFP_ATOMIC); + dp->rxbaddr = kzalloc_objs(struct ath12k_rx_desc_info *, + num_rx_spt_pages, GFP_ATOMIC); if (!dp->rxbaddr) { spin_unlock_bh(&dp->rx_desc_lock); @@ -1227,8 +1226,8 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab) * RX */ for (i = 0; i < num_rx_spt_pages; i++) { - rx_descs = kcalloc(ATH12K_MAX_SPT_ENTRIES, sizeof(*rx_descs), - GFP_ATOMIC); + rx_descs = kzalloc_objs(*rx_descs, ATH12K_MAX_SPT_ENTRIES, + GFP_ATOMIC); if (!rx_descs) { spin_unlock_bh(&dp->rx_desc_lock); @@ -1253,8 +1252,8 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab) spin_unlock_bh(&dp->rx_desc_lock); - dp->txbaddr = kcalloc(ATH12K_NUM_TX_SPT_PAGES(ab), - sizeof(struct ath12k_tx_desc_info *), GFP_ATOMIC); + dp->txbaddr = kzalloc_objs(struct ath12k_tx_desc_info *, + ATH12K_NUM_TX_SPT_PAGES(ab), GFP_ATOMIC); if (!dp->txbaddr) return -ENOMEM; @@ -1262,8 +1261,9 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab) for (pool_id = 0; pool_id < ATH12K_HW_MAX_QUEUES; pool_id++) { spin_lock_bh(&dp->tx_desc_lock[pool_id]); for (i = 0; i < ATH12K_TX_SPT_PAGES_PER_POOL(ab); i++) { - tx_descs = kcalloc(ATH12K_MAX_SPT_ENTRIES, sizeof(*tx_descs), - GFP_ATOMIC); + tx_descs = kzalloc_objs(*tx_descs, + ATH12K_MAX_SPT_ENTRIES, + GFP_ATOMIC); if (!tx_descs) { spin_unlock_bh(&dp->tx_desc_lock[pool_id]); @@ -1362,8 +1362,8 @@ static int ath12k_dp_cc_init(struct ath12k_base *ab) if (dp->num_spt_pages > ATH12K_MAX_PPT_ENTRIES) dp->num_spt_pages = ATH12K_MAX_PPT_ENTRIES; - dp->spt_info = kcalloc(dp->num_spt_pages, sizeof(struct ath12k_spt_info), - GFP_KERNEL); + dp->spt_info = kzalloc_objs(struct ath12k_spt_info, dp->num_spt_pages, + GFP_KERNEL); if (!dp->spt_info) { ath12k_warn(ab, "SPT page allocation failure"); diff --git a/drivers/net/wireless/ath/ath12k/dp_htt.c b/drivers/net/wireless/ath/ath12k/dp_htt.c index cc71c5c5de5a..e71bb71a6020 100644 --- a/drivers/net/wireless/ath/ath12k/dp_htt.c +++ b/drivers/net/wireless/ath/ath12k/dp_htt.c @@ -386,7 +386,7 @@ struct htt_ppdu_stats_info *ath12k_dp_htt_get_ppdu_desc(struct ath12k_pdev_dp *d } } - ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_ATOMIC); + ppdu_info = kzalloc_obj(*ppdu_info, GFP_ATOMIC); if (!ppdu_info) return NULL; diff --git a/drivers/net/wireless/ath/ath12k/dp_peer.c b/drivers/net/wireless/ath/ath12k/dp_peer.c index 2e66872b5572..95b5a4af4b2e 100644 --- a/drivers/net/wireless/ath/ath12k/dp_peer.c +++ b/drivers/net/wireless/ath/ath12k/dp_peer.c @@ -165,7 +165,7 @@ void ath12k_dp_link_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_ spin_lock_bh(&dp->dp_lock); peer = ath12k_dp_link_peer_find_by_vdev_and_addr(dp, vdev_id, mac_addr); if (!peer) { - peer = kzalloc(sizeof(*peer), GFP_ATOMIC); + peer = kzalloc_obj(*peer, GFP_ATOMIC); if (!peer) goto exit; @@ -179,8 +179,8 @@ void ath12k_dp_link_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_ ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id); if (ar && ath12k_debugfs_is_extd_rx_stats_enabled(ar) && !peer->peer_stats.rx_stats) { - peer->peer_stats.rx_stats = - kzalloc(sizeof(*peer->peer_stats.rx_stats), GFP_ATOMIC); + peer->peer_stats.rx_stats = kzalloc_obj(*peer->peer_stats.rx_stats, + GFP_ATOMIC); } rcu_read_unlock(); @@ -233,7 +233,7 @@ static int ath12k_dp_link_peer_rhash_addr_tbl_init(struct ath12k_dp *dp) lockdep_assert_held(&dp->link_peer_rhash_tbl_lock); - rhash_addr_tbl = kzalloc(sizeof(*dp->rhead_peer_addr), GFP_KERNEL); + rhash_addr_tbl = kzalloc_obj(*dp->rhead_peer_addr, GFP_KERNEL); if (!rhash_addr_tbl) return -ENOMEM; @@ -463,7 +463,7 @@ int ath12k_dp_peer_create(struct ath12k_dp_hw *dp_hw, u8 *addr, } spin_unlock_bh(&dp_hw->peer_lock); - dp_peer = kzalloc(sizeof(*dp_peer), GFP_ATOMIC); + dp_peer = kzalloc_obj(*dp_peer, GFP_ATOMIC); if (!dp_peer) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index a32ee9f8061a..5a82ede65dd3 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -464,7 +464,7 @@ void ath12k_dp_rx_tid_del_func(struct ath12k_dp *dp, void *ctx, ath12k_dp_rx_process_reo_cmd_update_rx_queue_list(dp); spin_unlock_bh(&dp->dp_lock); - elem = kzalloc(sizeof(*elem), GFP_ATOMIC); + elem = kzalloc_obj(*elem, GFP_ATOMIC); if (!elem) goto free_desc; @@ -565,7 +565,7 @@ static int ath12k_dp_prepare_reo_update_elem(struct ath12k_dp *dp, lockdep_assert_held(&dp->dp_lock); - elem = kzalloc(sizeof(*elem), GFP_ATOMIC); + elem = kzalloc_obj(*elem, GFP_ATOMIC); if (!elem) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 68431a0e128e..007c91dbb269 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3838,7 +3838,7 @@ static void ath12k_bss_assoc(struct ath12k *ar, lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc(sizeof(*peer_arg), GFP_KERNEL); + kzalloc_obj(*peer_arg, GFP_KERNEL); if (!peer_arg) return; @@ -4217,7 +4217,7 @@ static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, if (vif->type == NL80211_IFTYPE_STATION) arvif->is_sta_assoc_link = true; } else { - arvif = kzalloc(sizeof(*arvif), GFP_KERNEL); + arvif = kzalloc_obj(*arvif, GFP_KERNEL); if (!arvif) return NULL; } @@ -5024,7 +5024,8 @@ static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *a u8 link_id) { if (!ahvif->cache[link_id]) { - ahvif->cache[link_id] = kzalloc(sizeof(*ahvif->cache[0]), GFP_KERNEL); + ahvif->cache[link_id] = kzalloc_obj(*ahvif->cache[0], + GFP_KERNEL); if (ahvif->cache[link_id]) INIT_LIST_HEAD(&ahvif->cache[link_id]->key_conf.list); } @@ -5602,7 +5603,7 @@ static int ath12k_mac_initiate_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) { ret = -ENOMEM; goto exit; @@ -5692,7 +5693,7 @@ int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, lockdep_assert_wiphy(hw->wiphy); - chan_list = kcalloc(hw_req->req.n_channels, sizeof(*chan_list), GFP_KERNEL); + chan_list = kzalloc_objs(*chan_list, hw_req->req.n_channels, GFP_KERNEL); if (!chan_list) return -ENOMEM; @@ -6122,7 +6123,7 @@ static int ath12k_mac_update_key_cache(struct ath12k_vif_cache *cache, } if (cmd == SET_KEY) { - key_conf = kzalloc(sizeof(*key_conf), GFP_KERNEL); + key_conf = kzalloc_obj(*key_conf, GFP_KERNEL); if (!key_conf) return -ENOMEM; @@ -6456,7 +6457,7 @@ static int ath12k_mac_station_assoc(struct ath12k *ar, mask = &arvif->bitrate_mask; struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc(sizeof(*peer_arg), GFP_KERNEL); + kzalloc_obj(*peer_arg, GFP_KERNEL); if (!peer_arg) return -ENOMEM; @@ -6619,7 +6620,7 @@ static void ath12k_sta_rc_update_wk(struct wiphy *wiphy, struct wiphy_work *wk) nss = min(nss, mac_nss); struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc(sizeof(*peer_arg), GFP_KERNEL); + kzalloc_obj(*peer_arg, GFP_KERNEL); if (!peer_arg) return; @@ -7974,7 +7975,7 @@ static struct ath12k_link_sta *ath12k_mac_alloc_assign_link_sta(struct ath12k_hw if (arsta) return NULL; - arsta = kmalloc(sizeof(*arsta), GFP_KERNEL); + arsta = kmalloc_obj(*arsta, GFP_KERNEL); if (!arsta) return NULL; @@ -11549,7 +11550,7 @@ ath12k_mac_update_active_vif_chan(struct ath12k *ar, if (arg.n_vifs == 0) return; - arg.vifs = kcalloc(arg.n_vifs, sizeof(arg.vifs[0]), GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); if (!arg.vifs) return; @@ -13714,7 +13715,7 @@ int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = hw->wiphy->max_remain_on_channel_duration * 2; struct ath12k_wmi_scan_req_arg *arg __free(kfree) = - kzalloc(sizeof(*arg), GFP_KERNEL); + kzalloc_obj(*arg, GFP_KERNEL); if (!arg) return -ENOMEM; @@ -14122,7 +14123,7 @@ ath12k_mac_setup_radio_iface_comb(struct ath12k *ar, max_interfaces = 1; } - limits = kcalloc(n_limits, sizeof(*limits), GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); if (!limits) return -ENOMEM; @@ -14186,7 +14187,7 @@ ath12k_mac_setup_global_iface_comb(struct ath12k_hw *ah, else n_limits = 1; - limits = kcalloc(n_limits, sizeof(*limits), GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); if (!limits) return -ENOMEM; @@ -14249,8 +14250,8 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) if (ar->ab->hw_params->single_pdev_only) n_combinations = 2; - combinations = kcalloc(n_combinations, sizeof(*combinations), - GFP_KERNEL); + combinations = kzalloc_objs(*combinations, n_combinations, + GFP_KERNEL); if (!combinations) return -ENOMEM; @@ -14271,20 +14272,20 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) goto out; } - combinations = kcalloc(n_combinations, sizeof(*combinations), GFP_KERNEL); + combinations = kzalloc_objs(*combinations, n_combinations, GFP_KERNEL); if (!combinations) return -ENOMEM; /* there are multiple radios */ - radio = kcalloc(ah->num_radio, sizeof(*radio), GFP_KERNEL); + radio = kzalloc_objs(*radio, ah->num_radio, GFP_KERNEL); if (!radio) { ret = -ENOMEM; goto err_free_combinations; } for_each_ar(ah, ar, i) { - comb = kzalloc(sizeof(*comb), GFP_KERNEL); + comb = kzalloc_obj(*comb, GFP_KERNEL); if (!comb) { ret = -ENOMEM; goto err_free_radios; diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/ath/ath12k/mhi.c index 45c0f66dcc5e..8f07c00c51a2 100644 --- a/drivers/net/wireless/ath/ath12k/mhi.c +++ b/drivers/net/wireless/ath/ath12k/mhi.c @@ -80,7 +80,7 @@ static int ath12k_mhi_get_msi(struct ath12k_pci *ab_pci) ath12k_dbg(ab, ATH12K_DBG_PCI, "Number of assigned MSI for MHI is %d, base vector is %d\n", num_vectors, base_vector); - irq = kcalloc(num_vectors, sizeof(*irq), GFP_KERNEL); + irq = kzalloc_objs(*irq, num_vectors, GFP_KERNEL); if (!irq) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c index 5f3bd3b9a3e9..ad571a4cf974 100644 --- a/drivers/net/wireless/ath/ath12k/peer.c +++ b/drivers/net/wireless/ath/ath12k/peer.c @@ -413,7 +413,7 @@ int ath12k_link_sta_rhash_tbl_init(struct ath12k_base *ab) struct rhashtable *rhash_addr_tbl; int ret; - rhash_addr_tbl = kzalloc(sizeof(*ab->rhead_sta_addr), GFP_KERNEL); + rhash_addr_tbl = kzalloc_obj(*ab->rhead_sta_addr, GFP_KERNEL); if (!rhash_addr_tbl) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index cfde4147c8fc..631041bf1dc1 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -2344,11 +2344,11 @@ static int ath12k_qmi_fw_ind_register_send(struct ath12k_base *ab) struct qmi_txn txn; int ret; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) { ret = -ENOMEM; goto resp_out; @@ -2416,7 +2416,7 @@ int ath12k_qmi_respond_fw_mem_request(struct ath12k_base *ab) int ret = 0, i; bool delayed; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -2968,7 +2968,7 @@ static int ath12k_qmi_load_file_target_mem(struct ath12k_base *ab, int ret = 0; u32 remaining = len; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -3465,7 +3465,7 @@ static int ath12k_qmi_wlanfw_wlan_cfg_send(struct ath12k_base *ab) ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -3636,7 +3636,7 @@ ath12k_qmi_driver_event_post(struct ath12k_qmi *qmi, { struct ath12k_qmi_driver_event *event; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c index 7898f6981e5a..cd9ed489369e 100644 --- a/drivers/net/wireless/ath/ath12k/reg.c +++ b/drivers/net/wireless/ath/ath12k/reg.c @@ -170,7 +170,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar, bool wait) return -EINVAL; } - arg = kzalloc(struct_size(arg, channel, num_channels), GFP_KERNEL); + arg = kzalloc_flex(*arg, channel, num_channels, GFP_KERNEL); if (!arg) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp.c b/drivers/net/wireless/ath/ath12k/wifi7/dp.c index 2b194879ee80..8e0b83801346 100644 --- a/drivers/net/wireless/ath/ath12k/wifi7/dp.c +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp.c @@ -161,7 +161,7 @@ struct ath12k_dp *ath12k_wifi7_dp_device_alloc(struct ath12k_base *ab) struct ath12k_dp *dp; /* TODO: align dp later if cache alignment becomes a bottleneck */ - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); if (!dp) return NULL; diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c b/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c index bd741532b7dc..c9cea597a92e 100644 --- a/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c @@ -1800,7 +1800,7 @@ ath12k_wifi7_dp_mon_parse_rx_dest_tlv(struct ath12k_pdev_dp *dp_pdev, if (WARN_ON_ONCE(pmon->mon_mpdu)) break; - pmon->mon_mpdu = kzalloc(sizeof(*pmon->mon_mpdu), GFP_ATOMIC); + pmon->mon_mpdu = kzalloc_obj(*pmon->mon_mpdu, GFP_ATOMIC); if (!pmon->mon_mpdu) return -ENOMEM; break; @@ -1849,7 +1849,7 @@ ath12k_wifi7_dp_mon_tx_get_ppdu_info(struct ath12k_mon_data *pmon, } /* allocate new tx_ppdu_info */ - tx_ppdu_info = kzalloc(sizeof(*tx_ppdu_info), GFP_ATOMIC); + tx_ppdu_info = kzalloc_obj(*tx_ppdu_info, GFP_ATOMIC); if (!tx_ppdu_info) return NULL; @@ -2383,7 +2383,7 @@ ath12k_wifi7_dp_mon_tx_parse_status_tlv(struct ath12k_base *ab, case HAL_TX_MPDU_START: { struct dp_mon_mpdu *mon_mpdu = tx_ppdu_info->tx_mon_mpdu; - mon_mpdu = kzalloc(sizeof(*mon_mpdu), GFP_ATOMIC); + mon_mpdu = kzalloc_obj(*mon_mpdu, GFP_ATOMIC); if (!mon_mpdu) return DP_MON_TX_STATUS_PPDU_NOT_DONE; status = DP_MON_TX_MPDU_START; @@ -2853,7 +2853,7 @@ ath12k_wifi7_dp_rx_mon_dest_process(struct ath12k *ar, int mac_id, } if (head_msdu && tail_msdu) { - tmp_mpdu = kzalloc(sizeof(*tmp_mpdu), GFP_ATOMIC); + tmp_mpdu = kzalloc_obj(*tmp_mpdu, GFP_ATOMIC); if (!tmp_mpdu) break; diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c b/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c index 7450938adf65..038e339e8fb1 100644 --- a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c @@ -165,7 +165,7 @@ int ath12k_wifi7_dp_reo_cmd_send(struct ath12k_base *ab, * for tid delete command to free up the resource on the command status * indication? */ - dp_cmd = kzalloc(sizeof(*dp_cmd), GFP_ATOMIC); + dp_cmd = kzalloc_obj(*dp_cmd, GFP_ATOMIC); if (!dp_cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 7617fc3a2479..eb7615a289f7 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -303,7 +303,7 @@ ath12k_wmi_tlv_parse_alloc(struct ath12k_base *ab, const void **tb; int ret; - tb = kcalloc(WMI_TAG_MAX, sizeof(*tb), gfp); + tb = kzalloc_objs(*tb, WMI_TAG_MAX, gfp); if (!tb) return ERR_PTR(-ENOMEM); @@ -6867,7 +6867,7 @@ static int ath12k_reg_chan_list_event(struct ath12k_base *ab, struct sk_buff *sk u8 pdev_idx = 255; int ret; - reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC); + reg_info = kzalloc_obj(*reg_info, GFP_ATOMIC); if (!reg_info) { ret = -ENOMEM; goto fallback; @@ -8297,7 +8297,7 @@ static int ath12k_wmi_tlv_fw_stats_data_parse(struct ath12k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; ath12k_wmi_pull_vdev_stats(src, dst); @@ -8316,7 +8316,7 @@ static int ath12k_wmi_tlv_fw_stats_data_parse(struct ath12k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; ath12k_wmi_pull_bcn_stats(src, dst); @@ -8338,7 +8338,7 @@ static int ath12k_wmi_tlv_fw_stats_data_parse(struct ath12k_base *ab, data += sizeof(*src); len -= sizeof(*src); - dst = kzalloc(sizeof(*dst), GFP_ATOMIC); + dst = kzalloc_obj(*dst, GFP_ATOMIC); if (!dst) continue; @@ -9559,8 +9559,7 @@ static void ath12k_wmi_process_tpc_stats(struct ath12k_base *ab, goto unlock; } ar->debug.tpc_stats = - kzalloc(sizeof(struct wmi_tpc_stats_arg), - GFP_ATOMIC); + kzalloc_obj(struct wmi_tpc_stats_arg, GFP_ATOMIC); if (!ar->debug.tpc_stats) { ath12k_warn(ab, "Failed to allocate memory for tpc stats\n"); diff --git a/drivers/net/wireless/ath/ath12k/wow.c b/drivers/net/wireless/ath/ath12k/wow.c index bb08e1740582..bdac483c58cf 100644 --- a/drivers/net/wireless/ath/ath12k/wow.c +++ b/drivers/net/wireless/ath/ath12k/wow.c @@ -395,7 +395,7 @@ static int ath12k_wow_vif_set_wakeups(struct ath12k_link_vif *arvif, struct wmi_pno_scan_req_arg *pno; int ret; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; @@ -507,7 +507,7 @@ static int ath12k_wow_vdev_clean_nlo(struct ath12k *ar, u32 vdev_id) if (!ar->nlo_enabled) return 0; - pno = kzalloc(sizeof(*pno), GFP_KERNEL); + pno = kzalloc_obj(*pno, GFP_KERNEL); if (!pno) return -ENOMEM; @@ -748,7 +748,7 @@ static int ath12k_wow_arp_ns_offload(struct ath12k *ar, bool enable) lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); - offload = kmalloc(sizeof(*offload), GFP_KERNEL); + offload = kmalloc_obj(*offload, GFP_KERNEL); if (!offload) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 4d88b02ffa79..7b945a010ea1 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -919,8 +919,8 @@ ath5k_desc_alloc(struct ath5k_hw *ah) ATH5K_DBG(ah, ATH5K_DEBUG_ANY, "DMA map: %p (%zu) -> %llx\n", ds, ah->desc_len, (unsigned long long)ah->desc_daddr); - bf = kcalloc(1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF, - sizeof(struct ath5k_buf), GFP_KERNEL); + bf = kzalloc_objs(struct ath5k_buf, + 1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF, GFP_KERNEL); if (bf == NULL) { ATH5K_ERR(ah, "can't allocate bufptr\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index ec130510aeb2..5e30316f4543 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c @@ -928,7 +928,7 @@ static int open_file_eeprom(struct inode *inode, struct file *file) /* Create private struct and assign to file */ - ep = kmalloc(sizeof(*ep), GFP_KERNEL); + ep = kmalloc_obj(*ep, GFP_KERNEL); if (!ep) { ret = -ENOMEM; goto freebuf; diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 58d3e86f6256..a8b9c346c74b 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c @@ -727,9 +727,8 @@ ath5k_eeprom_convert_pcal_info_5111(struct ath5k_hw *ah, int mode, /* Allocate pd_curves for this cal pier */ chinfo[pier].pd_curves = - kcalloc(AR5K_EEPROM_N_PD_CURVES, - sizeof(struct ath5k_pdgain_info), - GFP_KERNEL); + kzalloc_objs(struct ath5k_pdgain_info, + AR5K_EEPROM_N_PD_CURVES, GFP_KERNEL); if (!chinfo[pier].pd_curves) goto err_out; @@ -761,8 +760,8 @@ ath5k_eeprom_convert_pcal_info_5111(struct ath5k_hw *ah, int mode, if (!pd->pd_step) goto err_out; - pd->pd_pwr = kcalloc(AR5K_EEPROM_N_PWR_POINTS_5111, - sizeof(s16), GFP_KERNEL); + pd->pd_pwr = kzalloc_objs(s16, AR5K_EEPROM_N_PWR_POINTS_5111, + GFP_KERNEL); if (!pd->pd_pwr) goto err_out; @@ -917,9 +916,9 @@ ath5k_eeprom_convert_pcal_info_5112(struct ath5k_hw *ah, int mode, /* Allocate pd_curves for this cal pier */ chinfo[pier].pd_curves = - kcalloc(AR5K_EEPROM_N_PD_CURVES, - sizeof(struct ath5k_pdgain_info), - GFP_KERNEL); + kzalloc_objs(struct ath5k_pdgain_info, + AR5K_EEPROM_N_PD_CURVES, + GFP_KERNEL); if (!chinfo[pier].pd_curves) goto err_out; @@ -943,8 +942,8 @@ ath5k_eeprom_convert_pcal_info_5112(struct ath5k_hw *ah, int mode, if (!pd->pd_step) goto err_out; - pd->pd_pwr = kcalloc(pd->pd_points, - sizeof(s16), GFP_KERNEL); + pd->pd_pwr = kzalloc_objs(s16, pd->pd_points, + GFP_KERNEL); if (!pd->pd_pwr) goto err_out; @@ -981,8 +980,8 @@ ath5k_eeprom_convert_pcal_info_5112(struct ath5k_hw *ah, int mode, if (!pd->pd_step) goto err_out; - pd->pd_pwr = kcalloc(pd->pd_points, - sizeof(s16), GFP_KERNEL); + pd->pd_pwr = kzalloc_objs(s16, pd->pd_points, + GFP_KERNEL); if (!pd->pd_pwr) goto err_out; @@ -1209,9 +1208,9 @@ ath5k_eeprom_convert_pcal_info_2413(struct ath5k_hw *ah, int mode, /* Allocate pd_curves for this cal pier */ chinfo[pier].pd_curves = - kcalloc(AR5K_EEPROM_N_PD_CURVES, - sizeof(struct ath5k_pdgain_info), - GFP_KERNEL); + kzalloc_objs(struct ath5k_pdgain_info, + AR5K_EEPROM_N_PD_CURVES, + GFP_KERNEL); if (!chinfo[pier].pd_curves) goto err_out; @@ -1237,8 +1236,8 @@ ath5k_eeprom_convert_pcal_info_2413(struct ath5k_hw *ah, int mode, if (!pd->pd_step) goto err_out; - pd->pd_pwr = kcalloc(pd->pd_points, - sizeof(s16), GFP_KERNEL); + pd->pd_pwr = kzalloc_objs(s16, pd->pd_points, + GFP_KERNEL); if (!pd->pd_pwr) goto err_out; diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c index 830350bda531..8be852e832f3 100644 --- a/drivers/net/wireless/ath/ath6kl/core.c +++ b/drivers/net/wireless/ath/ath6kl/core.c @@ -311,7 +311,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev) ar->sta_list[ctr].mgmt_psq_len = 0; INIT_LIST_HEAD(&ar->sta_list[ctr].mgmt_psq); ar->sta_list[ctr].aggr_conn = - kzalloc(sizeof(struct aggr_info_conn), GFP_KERNEL); + kzalloc_obj(struct aggr_info_conn, GFP_KERNEL); if (!ar->sta_list[ctr].aggr_conn) { ath6kl_err("Failed to allocate memory for sta aggregation information\n"); ath6kl_core_destroy(ar); diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c index 122e07ef3965..19dfeb012c04 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c +++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c @@ -2792,7 +2792,7 @@ static int ath6kl_htc_reset(struct htc_target *target) (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH); for (i = 0; i < NUM_CONTROL_BUFFERS; i++) { - packet = kzalloc(sizeof(*packet), GFP_KERNEL); + packet = kzalloc_obj(*packet, GFP_KERNEL); if (!packet) return -ENOMEM; @@ -2842,13 +2842,13 @@ static void *ath6kl_htc_mbox_create(struct ath6kl *ar) struct htc_target *target = NULL; int status = 0; - target = kzalloc(sizeof(*target), GFP_KERNEL); + target = kzalloc_obj(*target, GFP_KERNEL); if (!target) { ath6kl_err("unable to allocate memory\n"); return NULL; } - target->dev = kzalloc(sizeof(*target->dev), GFP_KERNEL); + target->dev = kzalloc_obj(*target->dev, GFP_KERNEL); if (!target->dev) { ath6kl_err("unable to allocate memory\n"); kfree(target); diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c index 7b823be9d846..ba8a701087c3 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c @@ -510,7 +510,7 @@ static struct htc_packet *build_htc_txctrl_packet(void) struct htc_packet *packet = NULL; struct sk_buff *skb; - packet = kzalloc(sizeof(struct htc_packet), GFP_KERNEL); + packet = kzalloc_obj(struct htc_packet, GFP_KERNEL); if (packet == NULL) return NULL; @@ -1409,7 +1409,7 @@ static void *ath6kl_htc_pipe_create(struct ath6kl *ar) struct htc_packet *packet; int i; - target = kzalloc(sizeof(struct htc_target), GFP_KERNEL); + target = kzalloc_obj(struct htc_target, GFP_KERNEL); if (target == NULL) { ath6kl_err("htc create unable to allocate memory\n"); status = -ENOMEM; @@ -1423,13 +1423,13 @@ static void *ath6kl_htc_pipe_create(struct ath6kl *ar) reset_endpoint_states(target); for (i = 0; i < HTC_PACKET_CONTAINER_ALLOCATION; i++) { - packet = kzalloc(sizeof(struct htc_packet), GFP_KERNEL); + packet = kzalloc_obj(struct htc_packet, GFP_KERNEL); if (packet != NULL) free_htc_packet_container(target, packet); } - target->dev = kzalloc(sizeof(*target->dev), GFP_KERNEL); + target->dev = kzalloc_obj(*target->dev, GFP_KERNEL); if (!target->dev) { ath6kl_err("unable to allocate memory\n"); status = -ENOMEM; diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index 59068ea3879b..908cb87842f7 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -485,7 +485,7 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr, keymgmt, ucipher, auth, apsd_info); /* send event to application */ - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return; @@ -1249,8 +1249,8 @@ static void ath6kl_set_multicast_list(struct net_device *ndev) } if (!found) { - mc_filter = kzalloc(sizeof(struct ath6kl_mc_filter), - GFP_ATOMIC); + mc_filter = kzalloc_obj(struct ath6kl_mc_filter, + GFP_ATOMIC); if (!mc_filter) { WARN_ON(1); goto out; diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index 83de40bc4445..c0a895ae882f 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -1316,7 +1316,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func, func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize); - ar_sdio = kzalloc(sizeof(struct ath6kl_sdio), GFP_KERNEL); + ar_sdio = kzalloc_obj(struct ath6kl_sdio, GFP_KERNEL); if (!ar_sdio) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index c3b06b515c4f..623d134c4be7 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -1770,13 +1770,13 @@ struct aggr_info *aggr_init(struct ath6kl_vif *vif) { struct aggr_info *p_aggr = NULL; - p_aggr = kzalloc(sizeof(struct aggr_info), GFP_KERNEL); + p_aggr = kzalloc_obj(struct aggr_info, GFP_KERNEL); if (!p_aggr) { ath6kl_err("failed to alloc memory for aggr_node\n"); return NULL; } - p_aggr->aggr_conn = kzalloc(sizeof(struct aggr_info_conn), GFP_KERNEL); + p_aggr->aggr_conn = kzalloc_obj(struct aggr_info_conn, GFP_KERNEL); if (!p_aggr->aggr_conn) { ath6kl_err("failed to alloc memory for connection specific aggr info\n"); kfree(p_aggr); diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c index 38bb501fc553..9362ab82cc30 100644 --- a/drivers/net/wireless/ath/ath6kl/usb.c +++ b/drivers/net/wireless/ath/ath6kl/usb.c @@ -190,8 +190,7 @@ static int ath6kl_usb_alloc_pipe_resources(struct ath6kl_usb_pipe *pipe, init_usb_anchor(&pipe->urb_submitted); for (i = 0; i < urb_cnt; i++) { - urb_context = kzalloc(sizeof(struct ath6kl_urb_context), - GFP_KERNEL); + urb_context = kzalloc_obj(struct ath6kl_urb_context, GFP_KERNEL); if (urb_context == NULL) { status = -ENOMEM; goto fail_alloc_pipe_resources; @@ -634,7 +633,7 @@ static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface) int i; /* ath6kl_usb_destroy() needs ar_usb != NULL && ar_usb->wq != NULL. */ - ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL); + ar_usb = kzalloc_obj(struct ath6kl_usb, GFP_KERNEL); if (ar_usb == NULL) return NULL; ar_usb->wq = alloc_workqueue("ath6kl_wq", 0, 0); diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 08a154bce139..c043ba9a2afa 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -4135,7 +4135,7 @@ void *ath6kl_wmi_init(struct ath6kl *dev) { struct wmi *wmi; - wmi = kzalloc(sizeof(struct wmi), GFP_KERNEL); + wmi = kzalloc_obj(struct wmi, GFP_KERNEL); if (!wmi) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index fe9abe8cd268..c7e063482f55 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -107,7 +107,7 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev, if (urb == NULL) return -ENOMEM; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) { usb_free_urb(urb); return -ENOMEM; @@ -190,7 +190,7 @@ static int hif_usb_send_mgmt(struct hif_device_usb *hif_dev, if (urb == NULL) return -ENOMEM; - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); + cmd = kzalloc_obj(*cmd, GFP_ATOMIC); if (cmd == NULL) { usb_free_urb(urb); return -ENOMEM; @@ -849,7 +849,7 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev) init_usb_anchor(&hif_dev->mgmt_submitted); for (i = 0; i < MAX_TX_URB_NUM; i++) { - tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL); + tx_buf = kzalloc_obj(*tx_buf, GFP_KERNEL); if (!tx_buf) goto err; @@ -897,7 +897,7 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) for (i = 0; i < MAX_RX_URB_NUM; i++) { - rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); + rx_buf = kzalloc_obj(*rx_buf, GFP_KERNEL); if (!rx_buf) { ret = -ENOMEM; goto err_rxb; @@ -972,7 +972,7 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) for (i = 0; i < MAX_REG_IN_URB_NUM; i++) { - rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); + rx_buf = kzalloc_obj(*rx_buf, GFP_KERNEL); if (!rx_buf) { ret = -ENOMEM; goto err_rxb; @@ -1376,7 +1376,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, if (id->driver_info == STORAGE_DEVICE) return send_eject_command(interface); - hif_dev = kzalloc(sizeof(struct hif_device_usb), GFP_KERNEL); + hif_dev = kzalloc_obj(struct hif_device_usb, GFP_KERNEL); if (!hif_dev) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 3633f9eb2c55..a57b1ca76891 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -611,7 +611,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, struct ath_common *common; int i, ret = 0, csz = 0; - ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL); + ah = kzalloc_obj(struct ath_hw, GFP_KERNEL); if (!ah) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index ee5945cfc10e..20e1f9b72b16 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c @@ -664,8 +664,8 @@ void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event) * Store this event, so that the TX cleanup * routine can check later for the needed packet. */ - tx_pend = kzalloc(sizeof(struct ath9k_htc_tx_event), - GFP_ATOMIC); + tx_pend = kzalloc_obj(struct ath9k_htc_tx_event, + GFP_ATOMIC); if (!tx_pend) continue; @@ -1193,7 +1193,7 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv) for (i = 0; i < ATH9K_HTC_RXBUF; i++) { struct ath9k_htc_rxbuf *rxbuf = - kzalloc(sizeof(struct ath9k_htc_rxbuf), GFP_KERNEL); + kzalloc_obj(struct ath9k_htc_rxbuf, GFP_KERNEL); if (rxbuf == NULL) goto err; diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index b5257b2b4aa5..a2fe131d8c00 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c @@ -499,7 +499,7 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle, struct htc_endpoint *endpoint; struct htc_target *target; - target = kzalloc(sizeof(struct htc_target), GFP_KERNEL); + target = kzalloc_obj(struct htc_target, GFP_KERNEL); if (!target) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 14de62c1a32b..e7bf63d257b2 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -3128,7 +3128,7 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, !AR_SREV_9300_20_OR_LATER(ah)) return NULL; - timer = kzalloc(sizeof(struct ath_gen_timer), GFP_KERNEL); + timer = kzalloc_obj(struct ath_gen_timer, GFP_KERNEL); if (timer == NULL) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c index a0845002d6fe..f82bb2349928 100644 --- a/drivers/net/wireless/ath/ath9k/mci.c +++ b/drivers/net/wireless/ath/ath9k/mci.c @@ -53,7 +53,7 @@ static bool ath_mci_add_profile(struct ath_common *common, (info->type != MCI_GPM_COEX_PROFILE_VOICE)) return false; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return false; diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index 805ad31edba2..2f56b9cc0ab8 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -92,7 +92,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_htc_priv *priv) { struct wmi *wmi; - wmi = kzalloc(sizeof(struct wmi), GFP_KERNEL); + wmi = kzalloc_obj(struct wmi, GFP_KERNEL); if (!wmi) return NULL; diff --git a/drivers/net/wireless/ath/carl9170/cmd.c b/drivers/net/wireless/ath/carl9170/cmd.c index b8ed193c0195..402fd0633e09 100644 --- a/drivers/net/wireless/ath/carl9170/cmd.c +++ b/drivers/net/wireless/ath/carl9170/cmd.c @@ -120,7 +120,7 @@ struct carl9170_cmd *carl9170_cmd_buf(struct ar9170 *ar, { struct carl9170_cmd *tmp; - tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); + tmp = kzalloc_obj(*tmp, GFP_ATOMIC); if (tmp) { tmp->hdr.cmd = cmd; tmp->hdr.len = len; diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index a7a9345f3483..3262a279746f 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c @@ -1412,8 +1412,7 @@ static int carl9170_op_ampdu_action(struct ieee80211_hw *hw, if (!sta_info->ht_sta) return -EOPNOTSUPP; - tid_info = kzalloc(sizeof(struct carl9170_sta_tid), - GFP_KERNEL); + tid_info = kzalloc_obj(struct carl9170_sta_tid, GFP_KERNEL); if (!tid_info) return -ENOMEM; diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index b7717f9e1e9b..59caf1e4b158 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c @@ -1328,7 +1328,7 @@ static void carl9170_bar_check(struct ar9170 *ar, struct sk_buff *skb) struct carl9170_bar_list_entry *entry; unsigned int queue = skb_get_queue_mapping(skb); - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!WARN_ON_ONCE(!entry)) { entry->skb = skb; spin_lock_bh(&ar->bar_list_lock[queue]); diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c index 700da9f4531e..a798ff11183d 100644 --- a/drivers/net/wireless/ath/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c @@ -199,7 +199,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) u32 i; struct channel_detector *cd; - cd = kzalloc(struct_size(cd, detectors, dpd->num_radar_types), GFP_ATOMIC); + cd = kzalloc_flex(*cd, detectors, dpd->num_radar_types, GFP_ATOMIC); if (cd == NULL) goto fail; @@ -354,7 +354,7 @@ dfs_pattern_detector_init(struct ath_common *common, if (!IS_ENABLED(CONFIG_CFG80211_CERTIFICATION_ONUS)) return NULL; - dpd = kmalloc(sizeof(*dpd), GFP_KERNEL); + dpd = kmalloc_obj(*dpd, GFP_KERNEL); if (dpd == NULL) return NULL; diff --git a/drivers/net/wireless/ath/dfs_pri_detector.c b/drivers/net/wireless/ath/dfs_pri_detector.c index d07c454c9c00..388f9d1913bd 100644 --- a/drivers/net/wireless/ath/dfs_pri_detector.c +++ b/drivers/net/wireless/ath/dfs_pri_detector.c @@ -202,7 +202,7 @@ static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) { struct pulse_elem *p = pool_get_pulse_elem(); if (p == NULL) { - p = kmalloc(sizeof(*p), GFP_ATOMIC); + p = kmalloc_obj(*p, GFP_ATOMIC); if (p == NULL) { DFS_POOL_STAT_INC(pulse_alloc_error); return false; @@ -284,7 +284,7 @@ static bool pseq_handler_create_sequences(struct pri_detector *pde, ps.deadline_ts = ps.first_ts + ps.dur; new_ps = pool_get_pseq_elem(); if (new_ps == NULL) { - new_ps = kmalloc(sizeof(*new_ps), GFP_ATOMIC); + new_ps = kmalloc_obj(*new_ps, GFP_ATOMIC); if (new_ps == NULL) { DFS_POOL_STAT_INC(pseq_alloc_error); return false; @@ -418,7 +418,7 @@ struct pri_detector *pri_detector_init(const struct radar_detector_specs *rs) { struct pri_detector *de; - de = kzalloc(sizeof(*de), GFP_ATOMIC); + de = kzalloc_obj(*de, GFP_ATOMIC); if (de == NULL) return NULL; de->exit = pri_detector_exit; diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 0f4df5585fd9..c6ec7a296240 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -74,7 +74,7 @@ static int wcn36xx_dxe_allocate_ctl_block(struct wcn36xx_dxe_ch *ch) spin_lock_init(&ch->lock); for (i = 0; i < ch->desc_num; i++) { - cur_ctl = kzalloc(sizeof(*cur_ctl), GFP_KERNEL); + cur_ctl = kzalloc_obj(*cur_ctl, GFP_KERNEL); if (!cur_ctl) goto out_fail; diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 02a525645bfa..c3f0860873de 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -462,7 +462,7 @@ static u64 wcn36xx_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr *ha; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac prepare multicast list\n"); - fp = kzalloc(sizeof(*fp), GFP_ATOMIC); + fp = kzalloc_obj(*fp, GFP_ATOMIC); if (!fp) { wcn36xx_err("Out of memory setting filters.\n"); return 0; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 136acc414714..f9ebe13d0245 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -847,7 +847,7 @@ int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, return -EINVAL; mutex_lock(&wcn->hal_mutex); - msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); if (!msg_body) { ret = -ENOMEM; goto out; @@ -942,7 +942,7 @@ int wcn36xx_smd_update_channel_list(struct wcn36xx *wcn, struct cfg80211_scan_re struct wcn36xx_hal_update_channel_list_req_msg *msg_body; int ret, i; - msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); if (!msg_body) return -ENOMEM; @@ -1624,7 +1624,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct cfg80211_chan_def *chandef; int ret; - msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); if (!msg_body) return -ENOMEM; @@ -1744,7 +1744,7 @@ static int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct wcn36xx_hal_config_sta_params *sta_params; int ret; - msg = kzalloc(sizeof(*msg), GFP_KERNEL); + msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) return -ENOMEM; @@ -3306,7 +3306,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_DELETE_STA_CONTEXT_IND: case WCN36XX_HAL_PRINT_REG_INFO_IND: case WCN36XX_HAL_SCAN_OFFLOAD_IND: - msg_ind = kmalloc(struct_size(msg_ind, msg, len), GFP_ATOMIC); + msg_ind = kmalloc_flex(*msg_ind, msg, len, GFP_ATOMIC); if (!msg_ind) { wcn36xx_err("Run out of memory while handling SMD_EVENT (%d)\n", msg_header->msg_type); diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 7218fe70f3bc..e0f39ef9ac78 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -691,7 +691,7 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name, return ERR_PTR(-EINVAL); } - p2p_wdev = kzalloc(sizeof(*p2p_wdev), GFP_KERNEL); + p2p_wdev = kzalloc_obj(*p2p_wdev, GFP_KERNEL); if (!p2p_wdev) return ERR_PTR(-ENOMEM); @@ -2394,7 +2394,7 @@ static int wil_cfg80211_probe_client(struct wiphy *wiphy, if (cid < 0) return -ENOLINK; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index c021ebcddee7..2e5c24245e6a 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -1392,7 +1392,7 @@ static int link_show(struct seq_file *s, void *data) struct station_info *sinfo; int i, rc = 0; - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return -ENOMEM; @@ -2441,9 +2441,8 @@ int wil6210_debugfs_init(struct wil6210_priv *wil) if (IS_ERR_OR_NULL(dbg)) return -ENODEV; - wil->dbg_data.data_arr = kcalloc(dbg_off_count, - sizeof(struct wil_debugfs_iomem_data), - GFP_KERNEL); + wil->dbg_data.data_arr = kzalloc_objs(struct wil_debugfs_iomem_data, + dbg_off_count, GFP_KERNEL); if (!wil->dbg_data.data_arr) { debugfs_remove_recursive(dbg); wil->debug = NULL; diff --git a/drivers/net/wireless/ath/wil6210/fw_inc.c b/drivers/net/wireless/ath/wil6210/fw_inc.c index c3c0b289dcf3..bc172f5a70c9 100644 --- a/drivers/net/wireless/ath/wil6210/fw_inc.c +++ b/drivers/net/wireless/ath/wil6210/fw_inc.c @@ -160,8 +160,8 @@ fw_handle_brd_file(struct wil6210_priv *wil, const void *data, return -EINVAL; } - wil->brd_info = kcalloc(max_num_ent, sizeof(struct wil_brd_info), - GFP_KERNEL); + wil->brd_info = kzalloc_objs(struct wil_brd_info, max_num_ent, + GFP_KERNEL); if (!wil->brd_info) return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/pmc.c b/drivers/net/wireless/ath/wil6210/pmc.c index a2f7b4c1da48..8d368c901122 100644 --- a/drivers/net/wireless/ath/wil6210/pmc.c +++ b/drivers/net/wireless/ath/wil6210/pmc.c @@ -85,9 +85,8 @@ void wil_pmc_alloc(struct wil6210_priv *wil, num_descriptors, descriptor_size); /* allocate descriptors info list in pmc context*/ - pmc->descriptors = kcalloc(num_descriptors, - sizeof(struct desc_alloc_info), - GFP_KERNEL); + pmc->descriptors = kzalloc_objs(struct desc_alloc_info, num_descriptors, + GFP_KERNEL); if (!pmc->descriptors) { wil_err(wil, "ERROR allocating pmc skb list\n"); goto no_release_err; diff --git a/drivers/net/wireless/ath/wil6210/rx_reorder.c b/drivers/net/wireless/ath/wil6210/rx_reorder.c index d385bc03033a..75bf9dbbf23a 100644 --- a/drivers/net/wireless/ath/wil6210/rx_reorder.c +++ b/drivers/net/wireless/ath/wil6210/rx_reorder.c @@ -241,13 +241,13 @@ out: struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil, int size, u16 ssn) { - struct wil_tid_ampdu_rx *r = kzalloc(sizeof(*r), GFP_KERNEL); + struct wil_tid_ampdu_rx *r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return NULL; r->reorder_buf = - kcalloc(size, sizeof(struct sk_buff *), GFP_KERNEL); + kzalloc_objs(struct sk_buff *, size, GFP_KERNEL); if (!r->reorder_buf) { kfree(r); return NULL; diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 19702b6f09c3..e11f30a7bb48 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -119,7 +119,7 @@ static int wil_vring_alloc(struct wil6210_priv *wil, struct wil_ring *vring) vring->swhead = 0; vring->swtail = 0; - vring->ctx = kcalloc(vring->size, sizeof(vring->ctx[0]), GFP_KERNEL); + vring->ctx = kzalloc_objs(vring->ctx[0], vring->size, GFP_KERNEL); if (!vring->ctx) { vring->va = NULL; return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c index 1ba1f21ebea2..e391951346c2 100644 --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c @@ -314,9 +314,8 @@ static int wil_init_rx_buff_arr(struct wil6210_priv *wil, struct list_head *free = &wil->rx_buff_mgmt.free; int i; - wil->rx_buff_mgmt.buff_arr = kcalloc(size + 1, - sizeof(struct wil_rx_buff), - GFP_KERNEL); + wil->rx_buff_mgmt.buff_arr = kzalloc_objs(struct wil_rx_buff, size + 1, + GFP_KERNEL); if (!wil->rx_buff_mgmt.buff_arr) return -ENOMEM; @@ -382,7 +381,7 @@ static int wil_ring_alloc_desc_ring(struct wil6210_priv *wil, ring->swhead = 0; ring->swtail = 0; - ring->ctx = kcalloc(ring->size, sizeof(ring->ctx[0]), GFP_KERNEL); + ring->ctx = kzalloc_objs(ring->ctx[0], ring->size, GFP_KERNEL); if (!ring->ctx) goto err; diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 6d376f85fbde..69f9fb19f01b 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -1080,7 +1080,7 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len) goto out; } - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) { rc = -ENOMEM; goto out; diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c index aa683eacaf38..11554306a5f3 100644 --- a/drivers/net/wireless/atmel/at76c50x-usb.c +++ b/drivers/net/wireless/atmel/at76c50x-usb.c @@ -378,7 +378,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size, return -EINVAL; } - dfu_stat_buf = kmalloc(sizeof(*dfu_stat_buf), GFP_KERNEL); + dfu_stat_buf = kmalloc_obj(*dfu_stat_buf, GFP_KERNEL); if (!dfu_stat_buf) { ret = -ENOMEM; goto exit; @@ -607,7 +607,7 @@ static inline int at76_get_hw_cfg_intersil(struct usb_device *udev, static int at76_get_hw_config(struct at76_priv *priv) { int ret; - union at76_hwcfg *hwcfg = kmalloc(sizeof(*hwcfg), GFP_KERNEL); + union at76_hwcfg *hwcfg = kmalloc_obj(*hwcfg, GFP_KERNEL); if (!hwcfg) return -ENOMEM; @@ -931,7 +931,7 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv) { int i; int ret; - struct mib_mac_addr *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_mac_addr *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -959,7 +959,7 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv) int i; int ret; int key_len; - struct mib_mac_wep *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_mac_wep *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -994,7 +994,7 @@ exit: static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) { int ret; - struct mib_mac_mgmt *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_mac_mgmt *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -1030,7 +1030,7 @@ exit: static void at76_dump_mib_mac(struct at76_priv *priv) { int ret; - struct mib_mac *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_mac *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -1067,7 +1067,7 @@ exit: static void at76_dump_mib_phy(struct at76_priv *priv) { int ret; - struct mib_phy *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_phy *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -1100,7 +1100,7 @@ exit: static void at76_dump_mib_local(struct at76_priv *priv) { int ret; - struct mib_local *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_local *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -1125,7 +1125,7 @@ exit: static void at76_dump_mib_mdomain(struct at76_priv *priv) { int ret; - struct mib_mdomain *m = kmalloc(sizeof(*m), GFP_KERNEL); + struct mib_mdomain *m = kmalloc_obj(*m, GFP_KERNEL); if (!m) return; @@ -2442,7 +2442,7 @@ static int at76_probe(struct usb_interface *interface, udev = usb_get_dev(interface_to_usbdev(interface)); - fwv = kmalloc(sizeof(*fwv), GFP_KERNEL); + fwv = kmalloc_obj(*fwv, GFP_KERNEL); if (!fwv) { ret = -ENOMEM; goto exit; diff --git a/drivers/net/wireless/broadcom/b43/bus.c b/drivers/net/wireless/broadcom/b43/bus.c index fdb1c82892d6..b6c8697f782b 100644 --- a/drivers/net/wireless/broadcom/b43/bus.c +++ b/drivers/net/wireless/broadcom/b43/bus.c @@ -74,7 +74,7 @@ void b43_bus_bcma_block_write(struct b43_bus_dev *dev, const void *buffer, struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core) { - struct b43_bus_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct b43_bus_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -179,7 +179,7 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) { struct b43_bus_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/net/wireless/broadcom/b43/debugfs.c b/drivers/net/wireless/broadcom/b43/debugfs.c index 5a49970afc8c..aa6768a66b03 100644 --- a/drivers/net/wireless/broadcom/b43/debugfs.c +++ b/drivers/net/wireless/broadcom/b43/debugfs.c @@ -670,15 +670,15 @@ void b43_debugfs_add_device(struct b43_wldev *dev) char devdir[16]; B43_WARN_ON(!dev); - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { b43err(dev->wl, "debugfs: add device OOM\n"); return; } e->dev = dev; log = &e->txstatlog; - log->log = kcalloc(B43_NR_LOGGED_TXSTATUS, - sizeof(struct b43_txstatus), GFP_KERNEL); + log->log = kzalloc_objs(struct b43_txstatus, B43_NR_LOGGED_TXSTATUS, + GFP_KERNEL); if (!log->log) { b43err(dev->wl, "debugfs: add device txstatus OOM\n"); kfree(e); diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/broadcom/b43/dma.c index 6ac7dcebfff9..eca39555718f 100644 --- a/drivers/net/wireless/broadcom/b43/dma.c +++ b/drivers/net/wireless/broadcom/b43/dma.c @@ -838,7 +838,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, int i, err; dma_addr_t dma_test; - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) goto out; @@ -846,8 +846,8 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, if (for_tx) ring->nr_slots = B43_TXRING_SLOTS; - ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta), - GFP_KERNEL); + ring->meta = kzalloc_objs(struct b43_dmadesc_meta, ring->nr_slots, + GFP_KERNEL); if (!ring->meta) goto err_kfree_ring; for (i = 0; i < ring->nr_slots; i++) diff --git a/drivers/net/wireless/broadcom/b43/lo.c b/drivers/net/wireless/broadcom/b43/lo.c index 338b6545a1e7..6fcd7205bda3 100644 --- a/drivers/net/wireless/broadcom/b43/lo.c +++ b/drivers/net/wireless/broadcom/b43/lo.c @@ -766,7 +766,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev, loctl.i, loctl.q); } - cal = kmalloc(sizeof(*cal), GFP_KERNEL); + cal = kmalloc_obj(*cal, GFP_KERNEL); if (!cal) { b43warn(dev->wl, "LO calib: out of memory\n"); return NULL; diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index f1a77c4c445f..97e222e9e613 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -2555,7 +2555,7 @@ static void b43_request_firmware(struct work_struct *work) int err; const char *errmsg; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return; ctx->dev = dev; @@ -5494,7 +5494,7 @@ static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl) struct b43_wldev *wldev; int err = -ENOMEM; - wldev = kzalloc(sizeof(*wldev), GFP_KERNEL); + wldev = kzalloc_obj(*wldev, GFP_KERNEL); if (!wldev) goto out; diff --git a/drivers/net/wireless/broadcom/b43/phy_ac.c b/drivers/net/wireless/broadcom/b43/phy_ac.c index 756cd44a8104..85af2d791d91 100644 --- a/drivers/net/wireless/broadcom/b43/phy_ac.c +++ b/drivers/net/wireless/broadcom/b43/phy_ac.c @@ -17,7 +17,7 @@ static int b43_phy_ac_op_allocate(struct b43_wldev *dev) { struct b43_phy_ac *phy_ac; - phy_ac = kzalloc(sizeof(*phy_ac), GFP_KERNEL); + phy_ac = kzalloc_obj(*phy_ac, GFP_KERNEL); if (!phy_ac) return -ENOMEM; dev->phy.ac = phy_ac; diff --git a/drivers/net/wireless/broadcom/b43/phy_g.c b/drivers/net/wireless/broadcom/b43/phy_g.c index ac72ca39e409..94038d427b39 100644 --- a/drivers/net/wireless/broadcom/b43/phy_g.c +++ b/drivers/net/wireless/broadcom/b43/phy_g.c @@ -2422,14 +2422,14 @@ static int b43_gphy_op_allocate(struct b43_wldev *dev) struct b43_txpower_lo_control *lo; int err; - gphy = kzalloc(sizeof(*gphy), GFP_KERNEL); + gphy = kzalloc_obj(*gphy, GFP_KERNEL); if (!gphy) { err = -ENOMEM; goto error; } dev->phy.g = gphy; - lo = kzalloc(sizeof(*lo), GFP_KERNEL); + lo = kzalloc_obj(*lo, GFP_KERNEL); if (!lo) { err = -ENOMEM; goto err_free_gphy; diff --git a/drivers/net/wireless/broadcom/b43/phy_ht.c b/drivers/net/wireless/broadcom/b43/phy_ht.c index 26a226126bc4..a1a5e699caf1 100644 --- a/drivers/net/wireless/broadcom/b43/phy_ht.c +++ b/drivers/net/wireless/broadcom/b43/phy_ht.c @@ -842,7 +842,7 @@ static int b43_phy_ht_op_allocate(struct b43_wldev *dev) { struct b43_phy_ht *phy_ht; - phy_ht = kzalloc(sizeof(*phy_ht), GFP_KERNEL); + phy_ht = kzalloc_obj(*phy_ht, GFP_KERNEL); if (!phy_ht) return -ENOMEM; dev->phy.ht = phy_ht; diff --git a/drivers/net/wireless/broadcom/b43/phy_lcn.c b/drivers/net/wireless/broadcom/b43/phy_lcn.c index 63bd29f070f7..67b61a915aa2 100644 --- a/drivers/net/wireless/broadcom/b43/phy_lcn.c +++ b/drivers/net/wireless/broadcom/b43/phy_lcn.c @@ -669,7 +669,7 @@ static int b43_phy_lcn_op_allocate(struct b43_wldev *dev) { struct b43_phy_lcn *phy_lcn; - phy_lcn = kzalloc(sizeof(*phy_lcn), GFP_KERNEL); + phy_lcn = kzalloc_obj(*phy_lcn, GFP_KERNEL); if (!phy_lcn) return -ENOMEM; dev->phy.lcn = phy_lcn; diff --git a/drivers/net/wireless/broadcom/b43/phy_lp.c b/drivers/net/wireless/broadcom/b43/phy_lp.c index 0e5c076e7544..622d4fe3b613 100644 --- a/drivers/net/wireless/broadcom/b43/phy_lp.c +++ b/drivers/net/wireless/broadcom/b43/phy_lp.c @@ -43,7 +43,7 @@ static int b43_lpphy_op_allocate(struct b43_wldev *dev) { struct b43_phy_lp *lpphy; - lpphy = kzalloc(sizeof(*lpphy), GFP_KERNEL); + lpphy = kzalloc_obj(*lpphy, GFP_KERNEL); if (!lpphy) return -ENOMEM; dev->phy.lp = lpphy; diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c index 4bb005b93f2c..768d9576be41 100644 --- a/drivers/net/wireless/broadcom/b43/phy_n.c +++ b/drivers/net/wireless/broadcom/b43/phy_n.c @@ -1549,7 +1549,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, len = bw << 1; } - samples = kcalloc(len, sizeof(struct cordic_iq), GFP_KERNEL); + samples = kzalloc_objs(struct cordic_iq, len, GFP_KERNEL); if (!samples) { b43err(dev->wl, "allocation for samples generation failed\n"); return 0; @@ -6417,7 +6417,7 @@ static int b43_nphy_op_allocate(struct b43_wldev *dev) { struct b43_phy_n *nphy; - nphy = kzalloc(sizeof(*nphy), GFP_KERNEL); + nphy = kzalloc_obj(*nphy, GFP_KERNEL); if (!nphy) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/b43/pio.c b/drivers/net/wireless/broadcom/b43/pio.c index e41f2f5b4c26..135091bec6c4 100644 --- a/drivers/net/wireless/broadcom/b43/pio.c +++ b/drivers/net/wireless/broadcom/b43/pio.c @@ -127,7 +127,7 @@ static struct b43_pio_txqueue *b43_setup_pioqueue_tx(struct b43_wldev *dev, struct b43_pio_txpacket *p; unsigned int i; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; q->dev = dev; @@ -161,7 +161,7 @@ static struct b43_pio_rxqueue *b43_setup_pioqueue_rx(struct b43_wldev *dev, { struct b43_pio_rxqueue *q; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; q->dev = dev; diff --git a/drivers/net/wireless/broadcom/b43/sdio.c b/drivers/net/wireless/broadcom/b43/sdio.c index 02b0cfd535ab..8d19fe48831f 100644 --- a/drivers/net/wireless/broadcom/b43/sdio.c +++ b/drivers/net/wireless/broadcom/b43/sdio.c @@ -139,7 +139,7 @@ static int b43_sdio_probe(struct sdio_func *func, } sdio_release_host(func); - sdio = kzalloc(sizeof(*sdio), GFP_KERNEL); + sdio = kzalloc_obj(*sdio, GFP_KERNEL); if (!sdio) { error = -ENOMEM; dev_err(&func->dev, "failed to allocate ssb bus\n"); diff --git a/drivers/net/wireless/broadcom/b43legacy/debugfs.c b/drivers/net/wireless/broadcom/b43legacy/debugfs.c index 5d04bcc216e5..ec1f67f6d328 100644 --- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c +++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c @@ -358,15 +358,15 @@ void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) char devdir[16]; B43legacy_WARN_ON(!dev); - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { b43legacyerr(dev->wl, "debugfs: add device OOM\n"); return; } e->dev = dev; log = &e->txstatlog; - log->log = kcalloc(B43legacy_NR_LOGGED_TXSTATUS, - sizeof(struct b43legacy_txstatus), GFP_KERNEL); + log->log = kzalloc_objs(struct b43legacy_txstatus, + B43legacy_NR_LOGGED_TXSTATUS, GFP_KERNEL); if (!log->log) { b43legacyerr(dev->wl, "debugfs: add device txstatus OOM\n"); kfree(e); diff --git a/drivers/net/wireless/broadcom/b43legacy/dma.c b/drivers/net/wireless/broadcom/b43legacy/dma.c index 60e41de72f29..aff7e9161ffc 100644 --- a/drivers/net/wireless/broadcom/b43legacy/dma.c +++ b/drivers/net/wireless/broadcom/b43legacy/dma.c @@ -610,7 +610,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, int nr_slots; dma_addr_t dma_test; - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) goto out; ring->type = type; @@ -620,8 +620,8 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, if (for_tx) nr_slots = B43legacy_TXRING_SLOTS; - ring->meta = kcalloc(nr_slots, sizeof(struct b43legacy_dmadesc_meta), - GFP_KERNEL); + ring->meta = kzalloc_objs(struct b43legacy_dmadesc_meta, nr_slots, + GFP_KERNEL); if (!ring->meta) goto err_kfree_ring; if (for_tx) { diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c index aada342e0b80..0873014a9299 100644 --- a/drivers/net/wireless/broadcom/b43legacy/main.c +++ b/drivers/net/wireless/broadcom/b43legacy/main.c @@ -3269,9 +3269,8 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev) if ((phy->type == B43legacy_PHYTYPE_B) || (phy->type == B43legacy_PHYTYPE_G)) { - phy->_lo_pairs = kcalloc(B43legacy_LO_COUNT, - sizeof(struct b43legacy_lopair), - GFP_KERNEL); + phy->_lo_pairs = kzalloc_objs(struct b43legacy_lopair, + B43legacy_LO_COUNT, GFP_KERNEL); if (!phy->_lo_pairs) return -ENOMEM; } @@ -3739,7 +3738,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev, struct b43legacy_wldev *wldev; int err = -ENOMEM; - wldev = kzalloc(sizeof(*wldev), GFP_KERNEL); + wldev = kzalloc_obj(*wldev, GFP_KERNEL); if (!wldev) goto out; diff --git a/drivers/net/wireless/broadcom/b43legacy/pio.c b/drivers/net/wireless/broadcom/b43legacy/pio.c index aac413d0f629..fd9b79710350 100644 --- a/drivers/net/wireless/broadcom/b43legacy/pio.c +++ b/drivers/net/wireless/broadcom/b43legacy/pio.c @@ -320,7 +320,7 @@ struct b43legacy_pioqueue *b43legacy_setup_pioqueue(struct b43legacy_wldev *dev, u32 value; u16 qsize; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) goto out; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c index f471c962104a..1a6cb3450d58 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c @@ -23,8 +23,7 @@ static int brcmf_bca_alloc_fweh_info(struct brcmf_pub *drvr) { struct brcmf_fweh_info *fweh; - fweh = kzalloc(struct_size(fweh, evt_handler, BRCMF_BCA_E_LAST), - GFP_KERNEL); + fweh = kzalloc_flex(*fweh, evt_handler, BRCMF_BCA_E_LAST, GFP_KERNEL); if (!fweh) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c index 9ec0c60b6da1..1817adc29cd8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c @@ -444,7 +444,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { struct brcmf_bcdc *bcdc; - bcdc = kzalloc(sizeof(*bcdc), GFP_ATOMIC); + bcdc = kzalloc_obj(*bcdc, GFP_ATOMIC); if (!bcdc) goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index 6a3f187320fc..cf5cf1dce28d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -794,7 +794,7 @@ static int brcmf_sdiod_freezer_attach(struct brcmf_sdio_dev *sdiodev) if (!IS_ENABLED(CONFIG_PM_SLEEP)) return 0; - sdiodev->freezer = kzalloc(sizeof(*sdiodev->freezer), GFP_KERNEL); + sdiodev->freezer = kzalloc_obj(*sdiodev->freezer, GFP_KERNEL); if (!sdiodev->freezer) return -ENOMEM; atomic_set(&sdiodev->freezer->thread_count, 0); @@ -1067,10 +1067,10 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, if (func->num != 2) return -ENODEV; - bus_if = kzalloc(sizeof(*bus_if), GFP_KERNEL); + bus_if = kzalloc_obj(*bus_if, GFP_KERNEL); if (!bus_if) return -ENOMEM; - sdiodev = kzalloc(sizeof(*sdiodev), GFP_KERNEL); + sdiodev = kzalloc_obj(*sdiodev, GFP_KERNEL); if (!sdiodev) { kfree(bus_if); return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c index 67c0c5a92f99..5aa1dd33bf85 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c @@ -362,7 +362,7 @@ int brcmf_btcoex_attach(struct brcmf_cfg80211_info *cfg) struct brcmf_btcoex_info *btci; brcmf_dbg(TRACE, "enter\n"); - btci = kmalloc(sizeof(*btci), GFP_KERNEL); + btci = kmalloc_obj(*btci, GFP_KERNEL); if (!btci) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 61f7e620cab3..a442c74423a6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2527,7 +2527,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, offsetof(struct brcmf_assoc_params_le, chanspec_list); if (cfg->channel) join_params_size += sizeof(u16); - ext_join_params = kzalloc(sizeof(*ext_join_params), GFP_KERNEL); + ext_join_params = kzalloc_obj(*ext_join_params, GFP_KERNEL); if (ext_join_params == NULL) { err = -ENOMEM; goto done; @@ -4330,7 +4330,7 @@ brcmf_pmksa_v3_op(struct brcmf_if *ifp, struct cfg80211_pmksa *pmksa, int length = offsetof(struct brcmf_pmk_op_v3_le, pmk); int ret; - pmk_op = kzalloc(sizeof(*pmk_op), GFP_KERNEL); + pmk_op = kzalloc_obj(*pmk_op, GFP_KERNEL); if (!pmk_op) return -ENOMEM; @@ -5588,7 +5588,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, err = -EINVAL; goto exit; } - af_params = kzalloc(sizeof(*af_params), GFP_KERNEL); + af_params = kzalloc_obj(*af_params, GFP_KERNEL); if (af_params == NULL) { bphy_err(drvr, "unable to allocate frame\n"); err = -ENOMEM; @@ -6050,7 +6050,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", sizeof(*vif)); - vif = kzalloc(sizeof(*vif), GFP_KERNEL); + vif = kzalloc_obj(*vif, GFP_KERNEL); if (!vif) return ERR_PTR(-ENOMEM); @@ -6540,7 +6540,7 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg, return -EINVAL; } - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return -ENOMEM; @@ -6828,7 +6828,7 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_info *cfg) static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_info *cfg) { - cfg->conf = kzalloc(sizeof(*cfg->conf), GFP_KERNEL); + cfg->conf = kzalloc_obj(*cfg->conf, GFP_KERNEL); if (!cfg->conf) goto init_priv_mem_out; cfg->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); @@ -7486,7 +7486,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) mchan = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN); n_combos = 1 + !!(p2p && !rsdb) + !!mbss; - combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); + combo = kzalloc_objs(*combo, n_combos, GFP_KERNEL); if (!combo) goto err; @@ -7503,7 +7503,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) c = 0; i = 0; n_limits = 1 + mon_flag + (p2p ? 2 : 0) + (rsdb || !p2p); - c0_limits = kcalloc(n_limits, sizeof(*c0_limits), GFP_KERNEL); + c0_limits = kzalloc_objs(*c0_limits, n_limits, GFP_KERNEL); if (!c0_limits) goto err; @@ -7542,7 +7542,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) if (p2p && !rsdb) { c++; i = 0; - p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); + p2p_limits = kzalloc_objs(*p2p_limits, 4, GFP_KERNEL); if (!p2p_limits) goto err; p2p_limits[i].max = 1; @@ -7563,8 +7563,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) c++; i = 0; n_limits = 1 + mon_flag; - mbss_limits = kcalloc(n_limits, sizeof(*mbss_limits), - GFP_KERNEL); + mbss_limits = kzalloc_objs(*mbss_limits, n_limits, GFP_KERNEL); if (!mbss_limits) goto err; mbss_limits[i].max = 4; @@ -8322,7 +8321,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, return NULL; } - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) { bphy_err(drvr, "Could not allocate wiphy device\n"); return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 4239f2b21e54..a3bbbb76dd97 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -507,7 +507,7 @@ static struct brcmf_core *brcmf_chip_add_core(struct brcmf_chip_priv *ci, { struct brcmf_core_priv *core; - core = kzalloc(sizeof(*core), GFP_KERNEL); + core = kzalloc_obj(*core, GFP_KERNEL); if (!core) return ERR_PTR(-ENOMEM); @@ -1137,7 +1137,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx, u16 devid, if (err < 0) return ERR_PTR(-EINVAL); - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 688f16c51319..cdc9dc733f5b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -132,8 +132,7 @@ static int brcmf_c_download_blob(struct brcmf_if *ifp, brcmf_dbg(TRACE, "Enter\n"); - chunk_buf = kzalloc(struct_size(chunk_buf, data, MAX_CHUNK_LEN), - GFP_KERNEL); + chunk_buf = kzalloc_flex(*chunk_buf, data, MAX_CHUNK_LEN, GFP_KERNEL); if (!chunk_buf) { err = -ENOMEM; return -ENOMEM; @@ -521,7 +520,7 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, brcmf_dbg(INFO, "Enter, bus=%d, chip=%d, rev=%d\n", bus_type, chip, chiprev); - settings = kzalloc(sizeof(*settings), GFP_ATOMIC); + settings = kzalloc_obj(*settings, GFP_ATOMIC); if (!settings) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 616885d6db3f..99d5fd453cf1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -879,7 +879,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, if (!drvr->settings->p2p_enable && is_p2pdev) { /* this is P2P_DEVICE interface */ brcmf_dbg(INFO, "allocate non-netdev interface\n"); - ifp = kzalloc(sizeof(*ifp), GFP_KERNEL); + ifp = kzalloc_obj(*ifp, GFP_KERNEL); if (!ifp) return ERR_PTR(-ENOMEM); } else { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c index 4f0ea4347840..abd38ac8c51e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c @@ -66,8 +66,7 @@ static int brcmf_cyw_alloc_fweh_info(struct brcmf_pub *drvr) { struct brcmf_fweh_info *fweh; - fweh = kzalloc(struct_size(fweh, evt_handler, BRCMF_CYW_E_LAST), - GFP_KERNEL); + fweh = kzalloc_flex(*fweh, evt_handler, BRCMF_CYW_E_LAST, GFP_KERNEL); if (!fweh) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index ef79924fd8f4..7b3b0bd1acaf 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -765,7 +765,7 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req, if (!brcmf_fw_request_is_valid(req)) return -EINVAL; - fwctx = kzalloc(sizeof(*fwctx), GFP_KERNEL); + fwctx = kzalloc_obj(*fwctx, GFP_KERNEL); if (!fwctx) return -ENOMEM; @@ -825,7 +825,7 @@ brcmf_fw_alloc_request(u32 chip, u32 chiprev, return NULL; } - fwreq = kzalloc(struct_size(fwreq, items, n_fwnames), GFP_KERNEL); + fwreq = kzalloc_flex(*fwreq, items, n_fwnames, GFP_KERNEL); if (!fwreq) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c index e1127d7e086d..9184022600d6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c @@ -145,7 +145,7 @@ u32 brcmf_flowring_create(struct brcmf_flowring *flow, u8 da[ETH_ALEN], if (i == flow->nrofrings) return -ENOMEM; - ring = kzalloc(sizeof(*ring), GFP_ATOMIC); + ring = kzalloc_obj(*ring, GFP_ATOMIC); if (!ring) return -ENOMEM; @@ -360,7 +360,7 @@ struct brcmf_flowring *brcmf_flowring_attach(struct device *dev, u16 nrofrings) struct brcmf_flowring *flow; u32 i; - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (flow) { flow->dev = dev; flow->nrofrings = nrofrings; @@ -369,8 +369,7 @@ struct brcmf_flowring *brcmf_flowring_attach(struct device *dev, u16 nrofrings) flow->addr_mode[i] = ADDR_INDIRECT; for (i = 0; i < ARRAY_SIZE(flow->hash); i++) flow->hash[i].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; - flow->rings = kcalloc(nrofrings, sizeof(*flow->rings), - GFP_KERNEL); + flow->rings = kzalloc_objs(*flow->rings, nrofrings, GFP_KERNEL); if (!flow->rings) { kfree(flow); flow = NULL; @@ -480,7 +479,7 @@ void brcmf_flowring_add_tdls_peer(struct brcmf_flowring *flow, int ifidx, struct brcmf_flowring_tdls_entry *tdls_entry; struct brcmf_flowring_tdls_entry *search; - tdls_entry = kzalloc(sizeof(*tdls_entry), GFP_ATOMIC); + tdls_entry = kzalloc_obj(*tdls_entry, GFP_ATOMIC); if (tdls_entry == NULL) return; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c index c2d98ee6652f..984886481f4e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c @@ -497,7 +497,7 @@ void brcmf_fweh_process_event(struct brcmf_pub *drvr, datalen + sizeof(*event_packet) > packet_len) return; - event = kzalloc(struct_size(event, data, datalen), gfp); + event = kzalloc_flex(*event, data, datalen, gfp); if (!event) return; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index b70d20128f98..b6fab5eb6002 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -1712,8 +1712,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt) /* allocate space for flow reorder info */ brcmf_dbg(INFO, "flow-%d: start, maxidx %d\n", flow_id, max_idx); - rfi = kzalloc(struct_size(rfi, pktslots, max_idx + 1), - GFP_ATOMIC); + rfi = kzalloc_flex(*rfi, pktslots, max_idx + 1, GFP_ATOMIC); if (rfi == NULL) { bphy_err(drvr, "failed to alloc buffer\n"); brcmf_netif_rx(ifp, pkt); @@ -2343,7 +2342,7 @@ struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr) int rc; u32 mode; - fws = kzalloc(sizeof(*fws), GFP_KERNEL); + fws = kzalloc_obj(*fws, GFP_KERNEL); if (!fws) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index 45fbcbdc7d9e..7252cdb6d87a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -299,11 +299,11 @@ brcmf_msgbuf_init_pktids(u32 nr_array_entries, struct brcmf_msgbuf_pktid *array; struct brcmf_msgbuf_pktids *pktids; - array = kcalloc(nr_array_entries, sizeof(*array), GFP_KERNEL); + array = kzalloc_objs(*array, nr_array_entries, GFP_KERNEL); if (!array) return NULL; - pktids = kzalloc(sizeof(*pktids), GFP_KERNEL); + pktids = kzalloc_obj(*pktids, GFP_KERNEL); if (!pktids) { kfree(array); return NULL; @@ -670,7 +670,7 @@ static u32 brcmf_msgbuf_flowring_create(struct brcmf_msgbuf *msgbuf, int ifidx, u32 flowid; ulong flags; - create = kzalloc(sizeof(*create), GFP_ATOMIC); + create = kzalloc_obj(*create, GFP_ATOMIC); if (create == NULL) return BRCMF_FLOWRING_INVALID_ID; @@ -1539,7 +1539,7 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr) if_msgbuf->max_flowrings = BRCMF_FLOWRING_HASHSIZE - 1; } - msgbuf = kzalloc(sizeof(*msgbuf), GFP_KERNEL); + msgbuf = kzalloc_obj(*msgbuf, GFP_KERNEL); if (!msgbuf) goto fail; @@ -1588,8 +1588,8 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr) msgbuf->flowrings = (struct brcmf_commonring **)if_msgbuf->flowrings; msgbuf->max_flowrings = if_msgbuf->max_flowrings; msgbuf->flowring_dma_handle = - kcalloc(msgbuf->max_flowrings, - sizeof(*msgbuf->flowring_dma_handle), GFP_KERNEL); + kzalloc_objs(*msgbuf->flowring_dma_handle, + msgbuf->max_flowrings, GFP_KERNEL); if (!msgbuf->flowring_dma_handle) goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 6327f4eca500..d15b98273cd3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1155,7 +1155,7 @@ brcmf_pcie_alloc_dma_and_ring(struct brcmf_pciedev_info *devinfo, u32 ring_id, addr = tcm_ring_phys_addr + BRCMF_RING_LEN_ITEMS_OFFSET; brcmf_pcie_write_tcm16(devinfo, addr, ring_itemsize_array[ring_id]); - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) { dma_free_coherent(&devinfo->pdev->dev, size, dma_buf, dma_handle); @@ -1347,7 +1347,7 @@ static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo) devinfo->shared.max_flowrings = max_flowrings; devinfo->shared.max_submissionrings = max_submissionrings; devinfo->shared.max_completionrings = max_completionrings; - rings = kcalloc(max_flowrings, sizeof(*ring), GFP_KERNEL); + rings = kzalloc_objs(*ring, max_flowrings, GFP_KERNEL); if (!rings) goto fail; @@ -2199,8 +2199,8 @@ static void brcmf_pcie_setup(struct device *dev, int ret, bus->msgbuf->commonrings[i] = &devinfo->shared.commonrings[i]->commonring; - flowrings = kcalloc(devinfo->shared.max_flowrings, sizeof(*flowrings), - GFP_KERNEL); + flowrings = kzalloc_objs(*flowrings, devinfo->shared.max_flowrings, + GFP_KERNEL); if (!flowrings) goto fail; @@ -2457,7 +2457,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); ret = -ENOMEM; - devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); + devinfo = kzalloc_obj(*devinfo, GFP_KERNEL); if (devinfo == NULL) return ret; @@ -2477,7 +2477,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) else devinfo->reginfo = &brcmf_reginfo_default; - pcie_bus_dev = kzalloc(sizeof(*pcie_bus_dev), GFP_KERNEL); + pcie_bus_dev = kzalloc_obj(*pcie_bus_dev, GFP_KERNEL); if (pcie_bus_dev == NULL) { ret = -ENOMEM; goto fail; @@ -2495,12 +2495,12 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (ret < 0) goto fail; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) { ret = -ENOMEM; goto fail; } - bus->msgbuf = kzalloc(sizeof(*bus->msgbuf), GFP_KERNEL); + bus->msgbuf = kzalloc_obj(*bus->msgbuf, GFP_KERNEL); if (!bus->msgbuf) { ret = -ENOMEM; kfree(bus); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c index 05f66ab13bed..34179e69d77d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c @@ -321,7 +321,7 @@ static int brcmf_pno_prep_fwconfig(struct brcmf_pno_info *pi, } *buckets = NULL; - fw_buckets = kcalloc(pi->n_reqs, sizeof(*fw_buckets), GFP_KERNEL); + fw_buckets = kzalloc_objs(*fw_buckets, pi->n_reqs, GFP_KERNEL); if (!fw_buckets) return -ENOMEM; @@ -517,7 +517,7 @@ int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg) struct brcmf_pno_info *pi; brcmf_dbg(TRACE, "enter\n"); - pi = kzalloc(sizeof(*pi), GFP_KERNEL); + pi = kzalloc_obj(*pi, GFP_KERNEL); if (!pi) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c index 2e911d4874af..7fc441859f52 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c @@ -23,7 +23,7 @@ int brcmf_proto_attach(struct brcmf_pub *drvr) brcmf_dbg(TRACE, "Enter\n"); - proto = kzalloc(sizeof(*proto), GFP_ATOMIC); + proto = kzalloc_obj(*proto, GFP_ATOMIC); if (!proto) goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 8cf9d7e7c3f7..30c19591c018 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4455,7 +4455,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) brcmf_dbg(TRACE, "Enter\n"); /* Allocate private bus interface state */ - bus = kzalloc(sizeof(*bus), GFP_ATOMIC); + bus = kzalloc_obj(*bus, GFP_ATOMIC); if (!bus) { ret = -ENOMEM; goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c index f0129d10d2b9..0b52f968b907 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c @@ -428,7 +428,7 @@ brcmf_usbdev_qinit(struct list_head *q, int qsize) int i; struct brcmf_usbreq *req, *reqs; - reqs = kcalloc(qsize, sizeof(struct brcmf_usbreq), GFP_ATOMIC); + reqs = kzalloc_objs(struct brcmf_usbreq, qsize, GFP_ATOMIC); if (reqs == NULL) return NULL; @@ -1255,7 +1255,7 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo, if (!bus_pub) return -ENODEV; - bus = kzalloc(sizeof(*bus), GFP_ATOMIC); + bus = kzalloc_obj(*bus, GFP_ATOMIC); if (!bus) { ret = -ENOMEM; goto fail; @@ -1359,7 +1359,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) brcmf_dbg(USB, "Enter 0x%04x:0x%04x\n", id->idVendor, id->idProduct); - devinfo = kzalloc(sizeof(*devinfo), GFP_ATOMIC); + devinfo = kzalloc_obj(*devinfo, GFP_ATOMIC); if (devinfo == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c index 05d7c2a4fba5..9a8351537938 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c @@ -24,8 +24,7 @@ static int brcmf_wcc_alloc_fweh_info(struct brcmf_pub *drvr) { struct brcmf_fweh_info *fweh; - fweh = kzalloc(struct_size(fweh, evt_handler, BRCMF_WCC_E_LAST), - GFP_KERNEL); + fweh = kzalloc_flex(*fweh, evt_handler, BRCMF_WCC_E_LAST, GFP_KERNEL); if (!fweh) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/aiutils.c index 0cb64fc56783..6a67db07833e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/aiutils.c @@ -512,7 +512,7 @@ ai_attach(struct bcma_bus *pbus) struct si_info *sii; /* alloc struct si_info */ - sii = kzalloc(sizeof(*sii), GFP_ATOMIC); + sii = kzalloc_obj(*sii, GFP_ATOMIC); if (sii == NULL) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c index e1d707a7c964..fc7a5dd2e5d8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c @@ -219,7 +219,7 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc) struct ampdu_info *ampdu; int i; - ampdu = kzalloc(sizeof(*ampdu), GFP_ATOMIC); + ampdu = kzalloc_obj(*ampdu, GFP_ATOMIC); if (!ampdu) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/antsel.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/antsel.c index f411bc6d795d..9a3e40528ff7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/antsel.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/antsel.c @@ -111,7 +111,7 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc) struct antsel_info *asi; struct ssb_sprom *sprom = &wlc->hw->d11core->bus->sprom; - asi = kzalloc(sizeof(*asi), GFP_ATOMIC); + asi = kzalloc_obj(*asi, GFP_ATOMIC); if (!asi) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c index 3878c4124e25..cdfe8635c012 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c @@ -331,7 +331,7 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc) const char *ccode = sprom->alpha2; int ccode_len = sizeof(sprom->alpha2); - wlc_cm = kzalloc(sizeof(*wlc_cm), GFP_ATOMIC); + wlc_cm = kzalloc_obj(*wlc_cm, GFP_ATOMIC); if (wlc_cm == NULL) return NULL; wlc_cm->pub = pub; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c index c739bf7463b3..9f6ef7ce1b58 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c @@ -558,7 +558,7 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc, struct si_info *sii = container_of(sih, struct si_info, pub); /* allocate private info structure */ - di = kzalloc(sizeof(*di), GFP_ATOMIC); + di = kzalloc_obj(*di, GFP_ATOMIC); if (di == NULL) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c index aadcff1e2b5d..6255d673d2d3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c @@ -1499,7 +1499,7 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl, { struct brcms_timer *t; - t = kzalloc(sizeof(*t), GFP_ATOMIC); + t = kzalloc_obj(*t, GFP_ATOMIC); if (!t) return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c index c1a9c1e442ee..c7eaf160e1fa 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c @@ -457,11 +457,11 @@ static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit) { struct brcms_bss_cfg *cfg; - cfg = kzalloc(sizeof(*cfg), GFP_ATOMIC); + cfg = kzalloc_obj(*cfg, GFP_ATOMIC); if (cfg == NULL) goto fail; - cfg->current_bss = kzalloc(sizeof(*cfg->current_bss), GFP_ATOMIC); + cfg->current_bss = kzalloc_obj(*cfg->current_bss, GFP_ATOMIC); if (cfg->current_bss == NULL) goto fail; @@ -477,14 +477,14 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) { struct brcms_c_info *wlc; - wlc = kzalloc(sizeof(*wlc), GFP_ATOMIC); + wlc = kzalloc_obj(*wlc, GFP_ATOMIC); if (wlc == NULL) { *err = 1002; goto fail; } /* allocate struct brcms_c_pub state structure */ - wlc->pub = kzalloc(sizeof(*wlc->pub), GFP_ATOMIC); + wlc->pub = kzalloc_obj(*wlc->pub, GFP_ATOMIC); if (wlc->pub == NULL) { *err = 1003; goto fail; @@ -493,7 +493,7 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) /* allocate struct brcms_hardware state structure */ - wlc->hw = kzalloc(sizeof(*wlc->hw), GFP_ATOMIC); + wlc->hw = kzalloc_obj(*wlc->hw, GFP_ATOMIC); if (wlc->hw == NULL) { *err = 1005; goto fail; @@ -501,7 +501,7 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) wlc->hw->wlc = wlc; wlc->hw->bandstate[0] = - kcalloc(MAXBANDS, sizeof(struct brcms_hw_band), GFP_ATOMIC); + kzalloc_objs(struct brcms_hw_band, MAXBANDS, GFP_ATOMIC); if (wlc->hw->bandstate[0] == NULL) { *err = 1006; goto fail; @@ -515,14 +515,13 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) } wlc->modulecb = - kcalloc(BRCMS_MAXMODULES, sizeof(struct modulecb), - GFP_ATOMIC); + kzalloc_objs(struct modulecb, BRCMS_MAXMODULES, GFP_ATOMIC); if (wlc->modulecb == NULL) { *err = 1009; goto fail; } - wlc->default_bss = kzalloc(sizeof(*wlc->default_bss), GFP_ATOMIC); + wlc->default_bss = kzalloc_obj(*wlc->default_bss, GFP_ATOMIC); if (wlc->default_bss == NULL) { *err = 1010; goto fail; @@ -534,20 +533,20 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) goto fail; } - wlc->protection = kzalloc(sizeof(*wlc->protection), GFP_ATOMIC); + wlc->protection = kzalloc_obj(*wlc->protection, GFP_ATOMIC); if (wlc->protection == NULL) { *err = 1016; goto fail; } - wlc->stf = kzalloc(sizeof(*wlc->stf), GFP_ATOMIC); + wlc->stf = kzalloc_obj(*wlc->stf, GFP_ATOMIC); if (wlc->stf == NULL) { *err = 1017; goto fail; } wlc->bandstate[0] = - kcalloc(MAXBANDS, sizeof(*wlc->bandstate[0]), GFP_ATOMIC); + kzalloc_objs(*wlc->bandstate[0], MAXBANDS, GFP_ATOMIC); if (wlc->bandstate[0] == NULL) { *err = 1025; goto fail; @@ -560,14 +559,14 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid) + (sizeof(struct brcms_band)*i)); } - wlc->corestate = kzalloc(sizeof(*wlc->corestate), GFP_ATOMIC); + wlc->corestate = kzalloc_obj(*wlc->corestate, GFP_ATOMIC); if (wlc->corestate == NULL) { *err = 1026; goto fail; } - wlc->corestate->macstat_snapshot = - kzalloc(sizeof(*wlc->corestate->macstat_snapshot), GFP_ATOMIC); + wlc->corestate->macstat_snapshot = kzalloc_obj(*wlc->corestate->macstat_snapshot, + GFP_ATOMIC); if (wlc->corestate->macstat_snapshot == NULL) { *err = 1027; goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c index ce6ce2dea39c..7eae73ef7e94 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c @@ -333,7 +333,7 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp) { struct shared_phy *sh; - sh = kzalloc(sizeof(*sh), GFP_ATOMIC); + sh = kzalloc_obj(*sh, GFP_ATOMIC); if (sh == NULL) return NULL; @@ -420,7 +420,7 @@ wlc_phy_attach(struct shared_phy *sh, struct bcma_device *d11core, return &pi->pubpi_ro; } - pi = kzalloc(sizeof(*pi), GFP_ATOMIC); + pi = kzalloc_obj(*pi, GFP_ATOMIC); if (pi == NULL) return NULL; pi->wiphy = wiphy; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c index 5258681218ea..8cec5ad79fda 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c @@ -1319,7 +1319,7 @@ wlc_lcnphy_rx_iq_cal(struct brcms_phy *pi, s16 *ptr; struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; - ptr = kmalloc_array(131, sizeof(s16), GFP_ATOMIC); + ptr = kmalloc_objs(s16, 131, GFP_ATOMIC); if (NULL == ptr) return false; if (module == 2) { @@ -3605,7 +3605,7 @@ wlc_lcnphy_a1(struct brcms_phy *pi, int cal_type, int num_levels, u16 *phy_c32; phy_c21 = 0; phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0; - ptr = kmalloc_array(131, sizeof(s16), GFP_ATOMIC); + ptr = kmalloc_objs(s16, 131, GFP_ATOMIC); if (NULL == ptr) return; @@ -4966,7 +4966,7 @@ bool wlc_phy_attach_lcnphy(struct brcms_phy *pi) { struct brcms_phy_lcnphy *pi_lcn; - pi_lcn = kzalloc(sizeof(*pi_lcn), GFP_ATOMIC); + pi_lcn = kzalloc_obj(*pi_lcn, GFP_ATOMIC); if (!pi_lcn) return false; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c index b03d5a1f1a93..86cfa3e87a04 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c @@ -23049,8 +23049,7 @@ wlc_phy_gen_load_samples_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, tbl_len = (phy_bw << 1); } - tone_buf = kmalloc_array(tbl_len, sizeof(struct cordic_iq), - GFP_ATOMIC); + tone_buf = kmalloc_objs(struct cordic_iq, tbl_len, GFP_ATOMIC); if (tone_buf == NULL) return 0; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c index 8b852581c4e4..20cf6379e838 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c @@ -40,7 +40,7 @@ struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw, struct brcms_c_info *wlc) { struct phy_shim_info *physhim; - physhim = kzalloc(sizeof(*physhim), GFP_ATOMIC); + physhim = kzalloc_obj(*physhim, GFP_ATOMIC); if (!physhim) return NULL; diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c index c7c5bc0f1650..029459df3343 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c @@ -1885,9 +1885,8 @@ static int ipw2100_wdev_init(struct net_device *dev) bg_band->band = NL80211_BAND_2GHZ; bg_band->n_channels = geo->bg_channels; - bg_band->channels = kcalloc(geo->bg_channels, - sizeof(struct ieee80211_channel), - GFP_KERNEL); + bg_band->channels = kzalloc_objs(struct ieee80211_channel, + geo->bg_channels, GFP_KERNEL); if (!bg_band->channels) { ipw2100_down(priv); return -ENOMEM; @@ -3413,9 +3412,8 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv) dma_addr_t p; priv->msg_buffers = - kmalloc_array(IPW_COMMAND_POOL_SIZE, - sizeof(struct ipw2100_tx_packet), - GFP_KERNEL); + kmalloc_objs(struct ipw2100_tx_packet, IPW_COMMAND_POOL_SIZE, + GFP_KERNEL); if (!priv->msg_buffers) return -ENOMEM; @@ -4410,9 +4408,8 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv) return err; } - priv->tx_buffers = kmalloc_array(TX_PENDED_QUEUE_LENGTH, - sizeof(struct ipw2100_tx_packet), - GFP_KERNEL); + priv->tx_buffers = kmalloc_objs(struct ipw2100_tx_packet, + TX_PENDED_QUEUE_LENGTH, GFP_KERNEL); if (!priv->tx_buffers) { bd_queue_free(priv, &priv->tx_queue); return -ENOMEM; @@ -4555,9 +4552,8 @@ static int ipw2100_rx_allocate(struct ipw2100_priv *priv) /* * allocate packets */ - priv->rx_buffers = kmalloc_array(RX_QUEUE_LENGTH, - sizeof(struct ipw2100_rx_packet), - GFP_KERNEL); + priv->rx_buffers = kmalloc_objs(struct ipw2100_rx_packet, + RX_QUEUE_LENGTH, GFP_KERNEL); if (!priv->rx_buffers) { IPW_DEBUG_INFO("can't allocate rx packet buffer table\n"); diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c index b0e769da9415..a39985e4a977 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c @@ -3153,8 +3153,7 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) if (!virts) return -ENOMEM; - phys = kmalloc_array(CB_NUMBER_OF_ELEMENTS_SMALL, sizeof(dma_addr_t), - GFP_KERNEL); + phys = kmalloc_objs(dma_addr_t, CB_NUMBER_OF_ELEMENTS_SMALL, GFP_KERNEL); if (!phys) { kfree(virts); return -ENOMEM; @@ -3723,7 +3722,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv, { struct pci_dev *dev = priv->pci_dev; - q->txb = kmalloc_array(count, sizeof(q->txb[0]), GFP_KERNEL); + q->txb = kmalloc_objs(q->txb[0], count, GFP_KERNEL); if (!q->txb) return -ENOMEM; @@ -5201,7 +5200,7 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv) struct ipw_rx_queue *rxq; int i; - rxq = kzalloc(sizeof(*rxq), GFP_KERNEL); + rxq = kzalloc_obj(*rxq, GFP_KERNEL); if (unlikely(!rxq)) { IPW_ERROR("memory allocation failed\n"); return NULL; @@ -8103,7 +8102,7 @@ static int is_duplicate_packet(struct ipw_priv *priv, break; } if (p == &priv->ibss_mac_hash[index]) { - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) { IPW_ERROR ("Cannot malloc new mac entry\n"); @@ -11119,8 +11118,7 @@ static int ipw_up(struct ipw_priv *priv) return -EIO; if (cmdlog && !priv->cmdlog) { - priv->cmdlog = kcalloc(cmdlog, sizeof(*priv->cmdlog), - GFP_KERNEL); + priv->cmdlog = kzalloc_objs(*priv->cmdlog, cmdlog, GFP_KERNEL); if (priv->cmdlog == NULL) { IPW_ERROR("Error allocating %d command log entries.\n", cmdlog); @@ -11279,9 +11277,8 @@ static int ipw_wdev_init(struct net_device *dev) bg_band->band = NL80211_BAND_2GHZ; bg_band->n_channels = geo->bg_channels; - bg_band->channels = kcalloc(geo->bg_channels, - sizeof(struct ieee80211_channel), - GFP_KERNEL); + bg_band->channels = kzalloc_objs(struct ieee80211_channel, + geo->bg_channels, GFP_KERNEL); if (!bg_band->channels) { rc = -ENOMEM; goto out; @@ -11318,9 +11315,8 @@ static int ipw_wdev_init(struct net_device *dev) a_band->band = NL80211_BAND_5GHZ; a_band->n_channels = geo->a_channels; - a_band->channels = kcalloc(geo->a_channels, - sizeof(struct ieee80211_channel), - GFP_KERNEL); + a_band->channels = kzalloc_objs(struct ieee80211_channel, + geo->a_channels, GFP_KERNEL); if (!a_band->channels) { rc = -ENOMEM; goto out; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c b/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c index 243d0c5928a2..e39b95f68dd4 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c @@ -159,7 +159,7 @@ int libipw_register_crypto_ops(const struct libipw_crypto_ops *ops) unsigned long flags; struct libipw_crypto_alg *alg; - alg = kzalloc(sizeof(*alg), GFP_KERNEL); + alg = kzalloc_obj(*alg, GFP_KERNEL); if (alg == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_ccmp.c b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_ccmp.c index bf900d8c8ad3..631a4dd86cab 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_ccmp.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_ccmp.c @@ -53,7 +53,7 @@ static void *libipw_ccmp_init(int key_idx) { struct libipw_ccmp_data *priv; - priv = kzalloc(sizeof(*priv), GFP_ATOMIC); + priv = kzalloc_obj(*priv, GFP_ATOMIC); if (priv == NULL) goto fail; priv->key_idx = key_idx; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c index 32288697da4f..c6b0de8d91ae 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c @@ -87,7 +87,7 @@ static void *libipw_tkip_init(int key_idx) if (fips_enabled) return NULL; - priv = kzalloc(sizeof(*priv), GFP_ATOMIC); + priv = kzalloc_obj(*priv, GFP_ATOMIC); if (priv == NULL) goto fail; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_wep.c b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_wep.c index c3a4ccb9de17..96109e123a1a 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_crypto_wep.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_crypto_wep.c @@ -37,7 +37,7 @@ static void *libipw_wep_init(int keyidx) if (fips_enabled) return NULL; - priv = kzalloc(sizeof(*priv), GFP_ATOMIC); + priv = kzalloc_obj(*priv, GFP_ATOMIC); if (priv == NULL) return NULL; priv->key_idx = keyidx; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_module.c b/drivers/net/wireless/intel/ipw2x00/libipw_module.c index 2ad085b1f492..cc771ee9bac3 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_module.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_module.c @@ -57,8 +57,8 @@ static int libipw_networks_allocate(struct libipw_device *ieee) int i, j; for (i = 0; i < MAX_NETWORK_COUNT; i++) { - ieee->networks[i] = kzalloc(sizeof(struct libipw_network), - GFP_KERNEL); + ieee->networks[i] = kzalloc_obj(struct libipw_network, + GFP_KERNEL); if (!ieee->networks[i]) { LIBIPW_ERROR("Out of memory allocating beacons\n"); for (j = 0; j < i; j++) diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c index 80edaa3dea9c..6e16060834b8 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c @@ -180,7 +180,7 @@ static struct libipw_txb *libipw_alloc_txb(int nr_frags, int txb_size, struct libipw_txb *txb; int i; - txb = kzalloc(struct_size(txb, fragments, nr_frags), gfp_mask); + txb = kzalloc_flex(*txb, fragments, nr_frags, gfp_mask); if (!txb) return NULL; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_wx.c b/drivers/net/wireless/intel/ipw2x00/libipw_wx.c index db71d81b0d4f..3db31b740a0e 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_wx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_wx.c @@ -365,8 +365,7 @@ int libipw_wx_set_encode(struct libipw_device *ieee, struct libipw_crypt_data *new_crypt; /* take WEP into use */ - new_crypt = kzalloc(sizeof(struct libipw_crypt_data), - GFP_KERNEL); + new_crypt = kzalloc_obj(struct libipw_crypt_data, GFP_KERNEL); if (new_crypt == NULL) return -ENOMEM; new_crypt->ops = libipw_get_crypto_ops("WEP"); @@ -598,7 +597,7 @@ int libipw_wx_set_encodeext(struct libipw_device *ieee, libipw_crypt_delayed_deinit(&ieee->crypt_info, crypt); - new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); + new_crypt = kzalloc_obj(*new_crypt, GFP_KERNEL); if (new_crypt == NULL) { ret = -ENOMEM; goto done; diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c index 54991f31c52c..c87579e4c7f9 100644 --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c @@ -269,7 +269,7 @@ il3945_get_free_frame(struct il_priv *il) struct il3945_frame *frame; struct list_head *element; if (list_empty(&il->free_frames)) { - frame = kzalloc(sizeof(*frame), GFP_KERNEL); + frame = kzalloc_obj(*frame, GFP_KERNEL); if (!frame) { IL_ERR("Could not allocate frame!\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index 57fa866efd9f..8429b6f5768b 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c @@ -3027,7 +3027,7 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id) u32 rate_flags = 0; __le32 rate_n_flags; - link_cmd = kzalloc(sizeof(struct il_link_quality_cmd), GFP_KERNEL); + link_cmd = kzalloc_obj(struct il_link_quality_cmd, GFP_KERNEL); if (!link_cmd) { IL_ERR("Unable to allocate memory for LQ cmd.\n"); return NULL; @@ -3709,7 +3709,7 @@ il4965_get_free_frame(struct il_priv *il) struct il_frame *frame; struct list_head *element; if (list_empty(&il->free_frames)) { - frame = kzalloc(sizeof(*frame), GFP_KERNEL); + frame = kzalloc_obj(*frame, GFP_KERNEL); if (!frame) { IL_ERR("Could not allocate frame!\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index b7bd3ec4cc50..4a12703e9b46 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -907,8 +907,7 @@ il_init_channel_map(struct il_priv *il) D_EEPROM("Parsing data for %d channels.\n", il->channel_count); il->channel_info = - kcalloc(il->channel_count, sizeof(struct il_channel_info), - GFP_KERNEL); + kzalloc_objs(struct il_channel_info, il->channel_count, GFP_KERNEL); if (!il->channel_info) { IL_ERR("Could not allocate channel_info\n"); il->channel_count = 0; @@ -2969,9 +2968,8 @@ il_tx_queue_alloc(struct il_priv *il, struct il_tx_queue *txq, u32 id) /* Driver ilate data, only for Tx (not command) queues, * not shared with device. */ if (id != il->cmd_queue) { - txq->skbs = kcalloc(TFD_QUEUE_SIZE_MAX, - sizeof(struct sk_buff *), - GFP_KERNEL); + txq->skbs = kzalloc_objs(struct sk_buff *, TFD_QUEUE_SIZE_MAX, + GFP_KERNEL); if (!txq->skbs) { IL_ERR("Fail to alloc skbs\n"); goto error; @@ -3024,9 +3022,9 @@ il_tx_queue_init(struct il_priv *il, u32 txq_id) } txq->meta = - kcalloc(actual_slots, sizeof(struct il_cmd_meta), GFP_KERNEL); + kzalloc_objs(struct il_cmd_meta, actual_slots, GFP_KERNEL); txq->cmd = - kcalloc(actual_slots, sizeof(struct il_device_cmd *), GFP_KERNEL); + kzalloc_objs(struct il_device_cmd *, actual_slots, GFP_KERNEL); if (!txq->meta || !txq->cmd) goto out_free_arrays; @@ -3444,12 +3442,12 @@ il_init_geos(struct il_priv *il) } channels = - kcalloc(il->channel_count, sizeof(struct ieee80211_channel), - GFP_KERNEL); + kzalloc_objs(struct ieee80211_channel, il->channel_count, + GFP_KERNEL); if (!channels) return -ENOMEM; - rates = kcalloc(RATE_COUNT_LEGACY, sizeof(*rates), GFP_KERNEL); + rates = kzalloc_objs(*rates, RATE_COUNT_LEGACY, GFP_KERNEL); if (!rates) { kfree(channels); return -ENOMEM; @@ -4611,9 +4609,8 @@ il_alloc_txq_mem(struct il_priv *il) { if (!il->txq) il->txq = - kcalloc(il->cfg->num_of_queues, - sizeof(struct il_tx_queue), - GFP_KERNEL); + kzalloc_objs(struct il_tx_queue, il->cfg->num_of_queues, + GFP_KERNEL); if (!il->txq) { IL_ERR("Not enough memory for txq\n"); return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/calib.c b/drivers/net/wireless/intel/iwlwifi/dvm/calib.c index f488620d2844..94c5d40cdf41 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/calib.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/calib.c @@ -63,7 +63,7 @@ int iwl_calib_set(struct iwl_priv *priv, if (check_sub_overflow(len, sizeof(*cmd), &len)) return -ENOMEM; - res = kmalloc(struct_size(res, cmd.data, len), GFP_ATOMIC); + res = kmalloc_flex(*res, cmd.data, len, GFP_ATOMIC); if (!res) return -ENOMEM; res->cmd = *cmd; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/devices.c b/drivers/net/wireless/intel/iwlwifi/dvm/devices.c index be7e61e2b291..5c8665b5a1b7 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/devices.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/devices.c @@ -567,7 +567,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, }; int err; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c b/drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c index d337ab543eb0..f723884e2a62 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c @@ -1067,8 +1067,7 @@ iwl_parse_eeprom_data(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg, if (WARN_ON(!cfg || !cfg->eeprom_params)) return NULL; - data = kzalloc(struct_size(data, channels, IWL_NUM_CHANNELS), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NUM_CHANNELS, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c index 48711dbcfa5a..bc14ed3060dd 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c @@ -1056,7 +1056,7 @@ int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan) int ret, i; u16 seq; - key_data.rsc_tsc = kzalloc(sizeof(*key_data.rsc_tsc), GFP_KERNEL); + key_data.rsc_tsc = kzalloc_obj(*key_data.rsc_tsc, GFP_KERNEL); if (!key_data.rsc_tsc) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/main.c b/drivers/net/wireless/intel/iwlwifi/dvm/main.c index 2b4dbebc71c2..ec30b5f3870b 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/main.c @@ -205,7 +205,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) /* Allocate beacon command */ if (!priv->beacon_cmd) - priv->beacon_cmd = kzalloc(sizeof(*tx_beacon_cmd), GFP_KERNEL); + priv->beacon_cmd = kzalloc_obj(*tx_beacon_cmd, GFP_KERNEL); tx_beacon_cmd = priv->beacon_cmd; if (!tx_beacon_cmd) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/rx.c b/drivers/net/wireless/intel/iwlwifi/dvm/rx.c index b34ee68f3dce..088302a238de 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/rx.c @@ -915,7 +915,7 @@ static void iwlagn_rx_noa_notification(struct iwl_priv *priv, len += 1 + 2; copylen += 1 + 2; - new_data = kmalloc(struct_size(new_data, data, len), GFP_ATOMIC); + new_data = kmalloc_flex(*new_data, data, len, GFP_ATOMIC); if (new_data) { new_data->length = len; new_data->data[0] = WLAN_EID_VENDOR_SPECIFIC; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/sta.c b/drivers/net/wireless/intel/iwlwifi/dvm/sta.c index 8b01ab986cb1..b29859f9d7c0 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/sta.c @@ -864,7 +864,7 @@ iwl_sta_alloc_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, { struct iwl_link_quality_cmd *link_cmd; - link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL); + link_cmd = kzalloc_obj(struct iwl_link_quality_cmd, GFP_KERNEL); if (!link_cmd) { IWL_ERR(priv, "Unable to allocate memory for LQ cmd.\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/tt.c b/drivers/net/wireless/intel/iwlwifi/dvm/tt.c index 96831ce8da6f..9bfdf033463b 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/tt.c @@ -595,13 +595,11 @@ void iwl_tt_initialize(struct iwl_priv *priv) if (priv->lib->adv_thermal_throttle) { IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n"); - tt->restriction = kcalloc(IWL_TI_STATE_MAX, - sizeof(struct iwl_tt_restriction), - GFP_KERNEL); - tt->transaction = kcalloc(IWL_TI_STATE_MAX * - (IWL_TI_STATE_MAX - 1), - sizeof(struct iwl_tt_trans), - GFP_KERNEL); + tt->restriction = kzalloc_objs(struct iwl_tt_restriction, + IWL_TI_STATE_MAX, GFP_KERNEL); + tt->transaction = kzalloc_objs(struct iwl_tt_trans, + IWL_TI_STATE_MAX * (IWL_TI_STATE_MAX - 1), + GFP_KERNEL); if (!tt->restriction || !tt->transaction) { IWL_ERR(priv, "Fallback to Legacy Throttling\n"); priv->thermal_throttle.advanced_tt = false; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 2ce55859641c..a070593e085f 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -595,7 +595,7 @@ static struct scatterlist *alloc_sgtable(ssize_t size) nents -= n_fill; } - new = kcalloc(n_alloc, sizeof(*new), GFP_KERNEL); + new = kzalloc_objs(*new, n_alloc, GFP_KERNEL); if (!new) { if (result) _devcd_free_sgtable(result); @@ -2958,8 +2958,8 @@ int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, struct iwl_fw_dump_desc *iwl_dump_error_desc; int ret; - iwl_dump_error_desc = - kmalloc(sizeof(*iwl_dump_error_desc), GFP_KERNEL); + iwl_dump_error_desc = kmalloc_obj(*iwl_dump_error_desc, + GFP_KERNEL); if (!iwl_dump_error_desc) return -ENOMEM; @@ -3011,7 +3011,7 @@ int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, delay = le32_to_cpu(trigger->stop_delay) * USEC_PER_MSEC; } - desc = kzalloc(struct_size(desc, trig_desc.data, len), GFP_ATOMIC); + desc = kzalloc_flex(*desc, trig_desc.data, len, GFP_ATOMIC); if (!desc) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c index 3c4bee85b825..21d889344796 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c @@ -360,7 +360,7 @@ static void *iwl_dbgfs_fw_info_seq_start(struct seq_file *seq, loff_t *pos) if (*pos >= fw->ucode_capa.n_cmd_versions) return NULL; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; state->pos = *pos; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c index f297e82d63d2..a45c3a9c223e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c @@ -379,7 +379,7 @@ iwl_pnvm_load_pnvm_to_trans(struct iwl_trans *trans, return; } - pnvm_data = kzalloc(sizeof(*pnvm_data), GFP_KERNEL); + pnvm_data = kzalloc_obj(*pnvm_data, GFP_KERNEL); if (!pnvm_data) goto free; @@ -425,7 +425,7 @@ iwl_pnvm_load_reduce_power_to_trans(struct iwl_trans *trans, return; } - pnvm_data = kzalloc(sizeof(*pnvm_data), GFP_KERNEL); + pnvm_data = kzalloc_obj(*pnvm_data, GFP_KERNEL); if (!pnvm_data) goto free; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 5240dacf1360..a6733224428a 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -71,7 +71,7 @@ static struct iwl_ucode_tlv *iwl_dbg_tlv_add(const struct iwl_ucode_tlv *tlv, u32 len = le32_to_cpu(tlv->length); struct iwl_dbg_tlv_node *node; - node = kzalloc(struct_size(node, tlv.data, len), GFP_KERNEL); + node = kzalloc_flex(*node, tlv.data, len, GFP_KERNEL); if (!node) return NULL; @@ -618,7 +618,7 @@ static int iwl_dbg_tlv_alloc_fragments(struct iwl_fw_runtime *fwrt, num_frags = min_t(u32, num_frags, remain_pages); frag_pages = DIV_ROUND_UP(remain_pages, num_frags); - fw_mon->frags = kcalloc(num_frags, sizeof(*fw_mon->frags), GFP_KERNEL); + fw_mon->frags = kzalloc_objs(*fw_mon->frags, num_frags, GFP_KERNEL); if (!fw_mon->frags) return -ENOMEM; @@ -1001,7 +1001,7 @@ static void iwl_dbg_tlv_set_periodic_trigs(struct iwl_fw_runtime *fwrt) collect_interval = le32_to_cpu(trig->data[0]); - timer_node = kzalloc(sizeof(*timer_node), GFP_KERNEL); + timer_node = kzalloc_obj(*timer_node, GFP_KERNEL); if (!timer_node) { IWL_ERR(fwrt, "WRT: Failed to allocate periodic trigger\n"); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c index f8fc6f30fbe5..39e362df0233 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -1459,7 +1459,7 @@ static int iwl_alloc_ucode_mem(struct fw_img *out, struct fw_img_parsing *img) { struct fw_desc *sec; - sec = kcalloc(img->sec_counter, sizeof(*sec), GFP_KERNEL); + sec = kzalloc_objs(*sec, img->sec_counter, GFP_KERNEL); if (!sec) return -ENOMEM; @@ -1622,7 +1622,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) /* dump all fw memory areas by default */ fw->dbg.dump_mask = 0xffffffff; - pieces = kzalloc(sizeof(*pieces), GFP_KERNEL); + pieces = kzalloc_obj(*pieces, GFP_KERNEL); if (!pieces) goto out_free_fw; @@ -1915,7 +1915,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) struct iwl_drv *drv; int ret; - drv = kzalloc(sizeof(*drv), GFP_KERNEL); + drv = kzalloc_obj(*drv, GFP_KERNEL); if (!drv) { ret = -ENOMEM; goto err; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index e021fc57d85d..75d1db91314b 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1377,13 +1377,11 @@ iwl_parse_mei_nvm_data(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg, u8 tx_chains = fw->valid_rx_ant; if (cfg->uhb_supported) - data = kzalloc(struct_size(data, channels, - IWL_NVM_NUM_CHANNELS_UHB), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NVM_NUM_CHANNELS_UHB, + GFP_KERNEL); else - data = kzalloc(struct_size(data, channels, - IWL_NVM_NUM_CHANNELS_EXT), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NVM_NUM_CHANNELS_EXT, + GFP_KERNEL); if (!data) return NULL; @@ -1446,17 +1444,14 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg, const __le16 *ch_section; if (cfg->uhb_supported) - data = kzalloc(struct_size(data, channels, - IWL_NVM_NUM_CHANNELS_UHB), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NVM_NUM_CHANNELS_UHB, + GFP_KERNEL); else if (cfg->nvm_type != IWL_NVM_EXT) - data = kzalloc(struct_size(data, channels, - IWL_NVM_NUM_CHANNELS), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NVM_NUM_CHANNELS, + GFP_KERNEL); else - data = kzalloc(struct_size(data, channels, - IWL_NVM_NUM_CHANNELS_EXT), - GFP_KERNEL); + data = kzalloc_flex(*data, channels, IWL_NVM_NUM_CHANNELS_EXT, + GFP_KERNEL); if (!data) return NULL; @@ -1692,7 +1687,7 @@ iwl_parse_nvm_mcc_info(struct iwl_trans *trans, num_of_ch); /* build a regdomain rule for every valid channel */ - regd = kzalloc(struct_size(regd, reg_rules, num_of_ch), GFP_KERNEL); + regd = kzalloc_flex(*regd, reg_rules, num_of_ch, GFP_KERNEL); if (!regd) return ERR_PTR(-ENOMEM); @@ -2041,7 +2036,7 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, if (empty_otp) IWL_INFO(trans, "OTP is empty\n"); - nvm = kzalloc(struct_size(nvm, channels, IWL_NUM_CHANNELS), GFP_KERNEL); + nvm = kzalloc_flex(*nvm, channels, IWL_NUM_CHANNELS, GFP_KERNEL); if (!nvm) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c b/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c index 0a93ac769f66..a5e287daf440 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c @@ -59,8 +59,7 @@ struct iwl_phy_db_chg_txp { struct iwl_phy_db *iwl_phy_db_init(struct iwl_trans *trans) { - struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db), - GFP_KERNEL); + struct iwl_phy_db *phy_db = kzalloc_obj(struct iwl_phy_db, GFP_KERNEL); if (!phy_db) return phy_db; @@ -172,9 +171,9 @@ int iwl_phy_db_set_section(struct iwl_phy_db *phy_db, * Firmware sends the largest index first, so we can use * it to know how much we should allocate. */ - phy_db->calib_ch_group_papd = kcalloc(chg_id + 1, - sizeof(struct iwl_phy_db_entry), - GFP_ATOMIC); + phy_db->calib_ch_group_papd = kzalloc_objs(struct iwl_phy_db_entry, + chg_id + 1, + GFP_ATOMIC); if (!phy_db->calib_ch_group_papd) return -ENOMEM; phy_db->n_group_papd = chg_id + 1; @@ -186,9 +185,9 @@ int iwl_phy_db_set_section(struct iwl_phy_db *phy_db, * Firmware sends the largest index first, so we can use * it to know how much we should allocate. */ - phy_db->calib_ch_group_txp = kcalloc(chg_id + 1, - sizeof(struct iwl_phy_db_entry), - GFP_ATOMIC); + phy_db->calib_ch_group_txp = kzalloc_objs(struct iwl_phy_db_entry, + chg_id + 1, + GFP_ATOMIC); if (!phy_db->calib_ch_group_txp) return -ENOMEM; phy_db->n_group_txp = chg_id + 1; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c index fa1442246662..eebec9b8c169 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c @@ -46,7 +46,7 @@ iwl_trans_get_restart_data(struct device *dev) if (data) return data; - data = kzalloc(struct_size(data, name, strlen(name) + 1), GFP_ATOMIC); + data = kzalloc_flex(*data, name, strlen(name) + 1, GFP_ATOMIC); if (!data) return NULL; @@ -113,7 +113,7 @@ static void iwl_trans_schedule_reprobe(struct iwl_trans *trans, return; } - reprobe = kzalloc(sizeof(*reprobe), GFP_KERNEL); + reprobe = kzalloc_obj(*reprobe, GFP_KERNEL); if (!reprobe) { module_put(THIS_MODULE); return; diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c index dce0b7cf7b26..f9358cb01103 100644 --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -702,7 +702,7 @@ static void iwl_mei_handle_csme_filters(struct mei_cl_device *cldev, rcu_dereference_protected(mei->filters, lockdep_is_held(&iwl_mei_mutex)); - new_filters = kzalloc(sizeof(*new_filters), GFP_KERNEL); + new_filters = kzalloc_obj(*new_filters, GFP_KERNEL); if (!new_filters) return; @@ -886,7 +886,7 @@ static void iwl_mei_handle_nvm(struct mei_cl_device *cldev, int i; kfree(mei->nvm); - mei->nvm = kzalloc(sizeof(*mei_nvm), GFP_KERNEL); + mei->nvm = kzalloc_obj(*mei_nvm, GFP_KERNEL); if (!mei->nvm) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c index 6595542e95cf..e7849183dff1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c @@ -609,10 +609,9 @@ iwl_mld_handle_wowlan_info_notif(struct iwl_mld *mld, 5)) return true; - converted_notif = kzalloc(struct_size(converted_notif, - mlo_gtks, - notif_v5->num_mlo_link_keys), - GFP_ATOMIC); + converted_notif = kzalloc_flex(*converted_notif, mlo_gtks, + notif_v5->num_mlo_link_keys, + GFP_ATOMIC); if (!converted_notif) { IWL_ERR(mld, "Failed to allocate memory for converted wowlan_info_notif\n"); @@ -1173,8 +1172,7 @@ iwl_mld_set_netdetect_info(struct iwl_mld *mld, for (int k = 0; k < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN; k++) n_channels += hweight8(matches[i].matching_channels[k]); - match = kzalloc(struct_size(match, channels, n_channels), - GFP_KERNEL); + match = kzalloc_flex(*match, channels, n_channels, GFP_KERNEL); if (!match) return; @@ -1251,8 +1249,8 @@ iwl_mld_process_netdetect_res(struct iwl_mld *mld, goto out; } n_matches = hweight_long(matched_profiles); - netdetect_info = kzalloc(struct_size(netdetect_info, matches, - n_matches), GFP_KERNEL); + netdetect_info = kzalloc_flex(*netdetect_info, matches, n_matches, + GFP_KERNEL); if (netdetect_info) iwl_mld_set_netdetect_info(mld, netdetect_cfg, netdetect_info, resume_data->netdetect_res, @@ -1656,7 +1654,7 @@ iwl_mld_suspend_send_security_cmds(struct iwl_mld *mld, struct iwl_mld_suspend_key_iter_data data = {}; int ret; - data.rsc = kzalloc(sizeof(*data.rsc), GFP_KERNEL); + data.rsc = kzalloc_obj(*data.rsc, GFP_KERNEL); if (!data.rsc) return -ENOMEM; @@ -2002,8 +2000,8 @@ int iwl_mld_wowlan_resume(struct iwl_mld *mld) iwl_fw_dbg_read_d3_debug_data(&mld->fwrt); - resume_data.wowlan_status = kzalloc(sizeof(*resume_data.wowlan_status), - GFP_KERNEL); + resume_data.wowlan_status = kzalloc_obj(*resume_data.wowlan_status, + GFP_KERNEL); if (!resume_data.wowlan_status) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/iface.c b/drivers/net/wireless/intel/iwlwifi/mld/iface.c index 743e44ff19cf..b418cbeb30aa 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/iface.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/iface.c @@ -542,7 +542,7 @@ void iwl_mld_handle_probe_resp_data_notif(struct iwl_mld *mld, notif->noa_attr.len_low)) return; - new_data = kzalloc(sizeof(*new_data), GFP_KERNEL); + new_data = kzalloc_obj(*new_data, GFP_KERNEL); if (!new_data) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/link.c b/drivers/net/wireless/intel/iwlwifi/mld/link.c index d89840a1152b..5640de4662d7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/link.c @@ -468,7 +468,7 @@ int iwl_mld_add_link(struct iwl_mld *mld, if (is_deflink) { link = &mld_vif->deflink; } else { - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; } diff --git a/drivers/net/wireless/intel/iwlwifi/mld/low_latency.c b/drivers/net/wireless/intel/iwlwifi/mld/low_latency.c index 23362867b400..fb63c8ba800a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/low_latency.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/low_latency.c @@ -131,8 +131,8 @@ int iwl_mld_low_latency_init(struct iwl_mld *mld) struct iwl_mld_low_latency *ll = &mld->low_latency; unsigned long ts = jiffies; - ll->pkts_counters = kcalloc(mld->trans->info.num_rxqs, - sizeof(*ll->pkts_counters), GFP_KERNEL); + ll->pkts_counters = kzalloc_objs(*ll->pkts_counters, + mld->trans->info.num_rxqs, GFP_KERNEL); if (!ll->pkts_counters) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c index 3414b04a6953..54e128fd0141 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c @@ -2092,8 +2092,7 @@ static int iwl_mld_alloc_ptk_pn(struct iwl_mld *mld, return -EINVAL; WARN_ON(rcu_access_pointer(mld_sta->ptk_pn[keyidx])); - *ptk_pn = kzalloc(struct_size(*ptk_pn, q, num_rx_queues), - GFP_KERNEL); + *ptk_pn = kzalloc_flex(**ptk_pn, q, num_rx_queues, GFP_KERNEL); if (!*ptk_pn) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/notif.c b/drivers/net/wireless/intel/iwlwifi/mld/notif.c index 35356b244c0a..240526d8b632 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/notif.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/notif.c @@ -557,7 +557,7 @@ static void iwl_mld_rx_notif(struct iwl_mld *mld, break; } - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); /* we can't do much... */ if (!entry) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/scan.c b/drivers/net/wireless/intel/iwlwifi/mld/scan.c index 16f48087a888..6679be028a6b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/scan.c @@ -2083,9 +2083,9 @@ void iwl_mld_handle_channel_survey_notif(struct iwl_mld *mld, n_channels += mld->wiphy->bands[band]->n_channels; } - mld->channel_survey = kzalloc(struct_size(mld->channel_survey, - channels, n_channels), - GFP_KERNEL); + mld->channel_survey = kzalloc_flex(*mld->channel_survey, + channels, n_channels, + GFP_KERNEL); if (!mld->channel_survey) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/sta.c b/drivers/net/wireless/intel/iwlwifi/mld/sta.c index 6056a306f7cb..0869f2ee7cee 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/sta.c @@ -539,7 +539,7 @@ iwl_mld_add_link_sta(struct iwl_mld *mld, struct ieee80211_link_sta *link_sta) if (link_sta == &link_sta->sta->deflink) { mld_link_sta = &mld_sta->deflink; } else { - mld_link_sta = kzalloc(sizeof(*mld_link_sta), GFP_KERNEL); + mld_link_sta = kzalloc_obj(*mld_link_sta, GFP_KERNEL); if (!mld_link_sta) return -ENOMEM; } @@ -660,8 +660,8 @@ iwl_mld_alloc_dup_data(struct iwl_mld *mld, struct iwl_mld_sta *mld_sta) if (mld->fw_status.in_hw_restart) return 0; - dup_data = kcalloc(mld->trans->info.num_rxqs, sizeof(*dup_data), - GFP_KERNEL); + dup_data = kzalloc_objs(*dup_data, mld->trans->info.num_rxqs, + GFP_KERNEL); if (!dup_data) return -ENOMEM; @@ -695,9 +695,9 @@ static void iwl_mld_alloc_mpdu_counters(struct iwl_mld *mld, sta->tdls || !ieee80211_vif_is_mld(vif)) return; - mld_sta->mpdu_counters = kcalloc(mld->trans->info.num_rxqs, - sizeof(*mld_sta->mpdu_counters), - GFP_KERNEL); + mld_sta->mpdu_counters = kzalloc_objs(*mld_sta->mpdu_counters, + mld->trans->info.num_rxqs, + GFP_KERNEL); if (!mld_sta->mpdu_counters) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/time_sync.c b/drivers/net/wireless/intel/iwlwifi/mld/time_sync.c index 50799f9bfccb..ad6f5c40f23d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/time_sync.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/time_sync.c @@ -12,8 +12,8 @@ static int iwl_mld_init_time_sync(struct iwl_mld *mld, u32 protocols, const u8 *addr) { - struct iwl_mld_time_sync_data *time_sync = kzalloc(sizeof(*time_sync), - GFP_KERNEL); + struct iwl_mld_time_sync_data *time_sync = kzalloc_obj(*time_sync, + GFP_KERNEL); if (!time_sync) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 6c225861db61..8df70323d426 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -460,7 +460,7 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, struct wowlan_key_rsc_v5_data data = {}; int i; - data.rsc = kzalloc(sizeof(*data.rsc), GFP_KERNEL); + data.rsc = kzalloc_obj(*data.rsc, GFP_KERNEL); if (!data.rsc) return -ENOMEM; @@ -483,7 +483,7 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, } else if (ver == 2 || ver == IWL_FW_CMD_VER_UNKNOWN) { struct wowlan_key_rsc_tsc_data data = {}; - data.rsc_tsc = kzalloc(sizeof(*data.rsc_tsc), GFP_KERNEL); + data.rsc_tsc = kzalloc_obj(*data.rsc_tsc, GFP_KERNEL); if (!data.rsc_tsc) return -ENOMEM; @@ -2605,8 +2605,7 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, n_matches = 0; } - net_detect = kzalloc(struct_size(net_detect, matches, n_matches), - GFP_KERNEL); + net_detect = kzalloc_flex(*net_detect, matches, n_matches, GFP_KERNEL); if (!net_detect || !n_matches) goto out_report_nd; net_detect->n_matches = n_matches; @@ -2620,8 +2619,7 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, d3_data->nd_results, i); - match = kzalloc(struct_size(match, channels, n_channels), - GFP_KERNEL); + match = kzalloc_flex(*match, channels, n_channels, GFP_KERNEL); if (!match) goto out_report_nd; match->n_channels = n_channels; @@ -3093,7 +3091,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm) } if (resume_notif_based) { - d3_data.status = kzalloc(sizeof(*d3_data.status), GFP_KERNEL); + d3_data.status = kzalloc_obj(*d3_data.status, GFP_KERNEL); if (!d3_data.status) { IWL_ERR(mvm, "Failed to allocate wowlan status\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index a493ef6bedc3..0a21670a9207 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -1124,7 +1124,7 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm, } if (!resp) { - resp = kzalloc(sizeof(*resp), GFP_KERNEL); + resp = kzalloc_obj(*resp, GFP_KERNEL); if (!resp) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 0e5820c13523..a633f0d9c821 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1764,7 +1764,7 @@ void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, notif->noa_attr.len_low)) return; - new_data = kzalloc(sizeof(*new_data), GFP_KERNEL); + new_data = kzalloc_obj(*new_data, GFP_KERNEL); if (!new_data) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 169c87588938..aeaa1d4b312d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -4348,9 +4348,9 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw, int tid, q; WARN_ON(rcu_access_pointer(mvmsta->ptk_pn[keyidx])); - ptk_pn = kzalloc(struct_size(ptk_pn, q, - mvm->trans->info.num_rxqs), - GFP_KERNEL); + ptk_pn = kzalloc_flex(*ptk_pn, q, + mvm->trans->info.num_rxqs, + GFP_KERNEL); if (!ptk_pn) { ret = -ENOMEM; break; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 075ff09e93cc..00ba47d5f499 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -905,7 +905,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, if (!(added & BIT(i))) continue; - new_link[i] = kzalloc(sizeof(*new_link[i]), GFP_KERNEL); + new_link[i] = kzalloc_obj(*new_link[i], GFP_KERNEL); if (!new_link[i]) { err = -ENOMEM; goto free; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 1100d763ceb6..8417b76e8fdb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -547,7 +547,7 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, if (rcu_access_pointer(sta->link[link_id]) == &sta->deflink) { link = &mvm_sta->deflink; } else { - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 5ebd046371f5..be328607e6f8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1097,7 +1097,7 @@ static void iwl_mvm_me_conn_status(void *priv, const struct iwl_mei_conn_info *c */ prev_conn_info = rcu_dereference_protected(mvm->csme_conn_info, true); - curr_conn_info = kzalloc(sizeof(*curr_conn_info), GFP_KERNEL); + curr_conn_info = kzalloc_obj(*curr_conn_info, GFP_KERNEL); if (!curr_conn_info) return; @@ -1747,7 +1747,7 @@ static void iwl_mvm_rx_common(struct iwl_mvm *mvm, return; } - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); /* we can't do much... */ if (!entry) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 9c51953d255d..3e39c243ddca 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -547,7 +547,7 @@ iwl_mvm_config_sched_scan_profiles(struct iwl_mvm *mvm, else blocklist_len = IWL_SCAN_MAX_BLACKLIST_LEN; - blocklist = kcalloc(blocklist_len, sizeof(*blocklist), GFP_KERNEL); + blocklist = kzalloc_objs(*blocklist, blocklist_len, GFP_KERNEL); if (!blocklist) return -ENOMEM; @@ -3603,9 +3603,8 @@ void iwl_mvm_rx_channel_survey_notif(struct iwl_mvm *mvm, n_channels += mvm->hw->wiphy->bands[band]->n_channels; } - mvm->acs_survey = kzalloc(struct_size(mvm->acs_survey, - channels, n_channels), - GFP_KERNEL); + mvm->acs_survey = kzalloc_flex(*mvm->acs_survey, channels, + n_channels, GFP_KERNEL); if (!mvm->acs_survey) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 363232bb74fa..5f37ee7b9ab1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -1798,8 +1798,8 @@ int iwl_mvm_sta_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (iwl_mvm_has_new_rx_api(mvm)) { int q; - dup_data = kcalloc(mvm->trans->info.num_rxqs, - sizeof(*dup_data), GFP_KERNEL); + dup_data = kzalloc_objs(*dup_data, mvm->trans->info.num_rxqs, + GFP_KERNEL); if (!dup_data) return -ENOMEM; /* diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c index 0957223c776d..65b54f1e6347 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c @@ -99,10 +99,10 @@ int iwl_pcie_init_fw_sec(struct iwl_trans *trans, /* add 2 due to separators */ paging_cnt = iwl_pcie_get_num_sections(fw, lmac_cnt + umac_cnt + 2); - dram->fw = kcalloc(umac_cnt + lmac_cnt, sizeof(*dram->fw), GFP_KERNEL); + dram->fw = kzalloc_objs(*dram->fw, umac_cnt + lmac_cnt, GFP_KERNEL); if (!dram->fw) return -ENOMEM; - dram->paging = kcalloc(paging_cnt, sizeof(*dram->paging), GFP_KERNEL); + dram->paging = kzalloc_objs(*dram->paging, paging_cnt, GFP_KERNEL); if (!dram->paging) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c index 619a9505e6d9..4e23b292e4df 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c @@ -773,15 +773,14 @@ static int iwl_pcie_rx_alloc(struct iwl_trans *trans) if (WARN_ON(trans_pcie->rxq)) return -EINVAL; - trans_pcie->rxq = kcalloc(trans->info.num_rxqs, sizeof(struct iwl_rxq), - GFP_KERNEL); - trans_pcie->rx_pool = kcalloc(RX_POOL_SIZE(trans_pcie->num_rx_bufs), - sizeof(trans_pcie->rx_pool[0]), - GFP_KERNEL); + trans_pcie->rxq = kzalloc_objs(struct iwl_rxq, trans->info.num_rxqs, + GFP_KERNEL); + trans_pcie->rx_pool = kzalloc_objs(trans_pcie->rx_pool[0], + RX_POOL_SIZE(trans_pcie->num_rx_bufs), + GFP_KERNEL); trans_pcie->global_table = - kcalloc(RX_POOL_SIZE(trans_pcie->num_rx_bufs), - sizeof(trans_pcie->global_table[0]), - GFP_KERNEL); + kzalloc_objs(trans_pcie->global_table[0], + RX_POOL_SIZE(trans_pcie->num_rx_bufs), GFP_KERNEL); if (!trans_pcie->rxq || !trans_pcie->rx_pool || !trans_pcie->global_table) { ret = -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c index 415a19ea9f06..ec88aefb0913 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c @@ -2303,7 +2303,7 @@ void iwl_trans_pcie_reset(struct iwl_trans *trans, enum iwl_reset_mode mode) return; } - removal = kzalloc(sizeof(*removal), GFP_ATOMIC); + removal = kzalloc_obj(*removal, GFP_ATOMIC); if (!removal) { module_put(THIS_MODULE); return; @@ -2748,7 +2748,7 @@ static void *iwl_dbgfs_tx_queue_seq_start(struct seq_file *seq, loff_t *pos) if (*pos >= priv->trans->mac_cfg->base->num_of_queues) return NULL; - state = kmalloc(sizeof(*state), GFP_KERNEL); + state = kmalloc_obj(*state, GFP_KERNEL); if (!state) return NULL; state->pos = *pos; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c index df0545f09da9..f2752ab4c402 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c @@ -928,7 +928,7 @@ iwl_txq_dyn_alloc_dma(struct iwl_trans *trans, int size, unsigned int timeout) if (WARN_ON(size > bc_tbl_entries)) return ERR_PTR(-EINVAL); - txq = kzalloc(sizeof(*txq), GFP_KERNEL); + txq = kzalloc_obj(*txq, GFP_KERNEL); if (!txq) return ERR_PTR(-ENOMEM); @@ -1152,7 +1152,7 @@ int iwl_txq_gen2_init(struct iwl_trans *trans, int txq_id, int queue_size) /* alloc and init the tx queue */ if (!trans_pcie->txqs.txq[txq_id]) { - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) { IWL_ERR(trans, "Not enough memory for tx queue\n"); return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c index 6e85aa519e1b..0b817e5c5679 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c @@ -741,9 +741,8 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, txq->n_window = slots_num; - txq->entries = kcalloc(slots_num, - sizeof(struct iwl_pcie_txq_entry), - GFP_KERNEL); + txq->entries = kzalloc_objs(struct iwl_pcie_txq_entry, slots_num, + GFP_KERNEL); if (!txq->entries) goto error; @@ -751,8 +750,7 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, if (cmd_queue) for (i = 0; i < slots_num; i++) { txq->entries[i].cmd = - kmalloc(sizeof(struct iwl_device_cmd), - GFP_KERNEL); + kmalloc_obj(struct iwl_device_cmd, GFP_KERNEL); if (!txq->entries[i].cmd) goto error; } @@ -838,8 +836,8 @@ static int iwl_pcie_tx_alloc(struct iwl_trans *trans) } trans_pcie->txq_memory = - kcalloc(trans->mac_cfg->base->num_of_queues, - sizeof(struct iwl_txq), GFP_KERNEL); + kzalloc_objs(struct iwl_txq, + trans->mac_cfg->base->num_of_queues, GFP_KERNEL); if (!trans_pcie->txq_memory) { IWL_ERR(trans, "Not enough memory for txq\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/intersil/p54/eeprom.c b/drivers/net/wireless/intersil/p54/eeprom.c index 5bd35c147e19..c338a7a7fc41 100644 --- a/drivers/net/wireless/intersil/p54/eeprom.c +++ b/drivers/net/wireless/intersil/p54/eeprom.c @@ -154,13 +154,12 @@ static int p54_generate_band(struct ieee80211_hw *dev, if ((!list->entries) || (!list->band_channel_num[band])) return -EINVAL; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) goto err_out; - tmp->channels = kcalloc(list->band_channel_num[band], - sizeof(struct ieee80211_channel), - GFP_KERNEL); + tmp->channels = kzalloc_objs(struct ieee80211_channel, + list->band_channel_num[band], GFP_KERNEL); if (!tmp->channels) goto err_out; @@ -336,23 +335,22 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev) max_channel_num = max_t(unsigned int, max_channel_num, priv->curve_data->entries); - list = kzalloc(sizeof(*list), GFP_KERNEL); + list = kzalloc_obj(*list, GFP_KERNEL); if (!list) { ret = -ENOMEM; goto free; } priv->chan_num = max_channel_num; - priv->survey = kcalloc(max_channel_num, sizeof(struct survey_info), - GFP_KERNEL); + priv->survey = kzalloc_objs(struct survey_info, max_channel_num, + GFP_KERNEL); if (!priv->survey) { ret = -ENOMEM; goto free; } list->max_entries = max_channel_num; - list->channels = kcalloc(max_channel_num, - sizeof(struct p54_channel_entry), - GFP_KERNEL); + list->channels = kzalloc_objs(struct p54_channel_entry, max_channel_num, + GFP_KERNEL); if (!list->channels) { ret = -ENOMEM; goto free; diff --git a/drivers/net/wireless/intersil/p54/p54usb.c b/drivers/net/wireless/intersil/p54/p54usb.c index cae47663b17b..c0d3b5329f4e 100644 --- a/drivers/net/wireless/intersil/p54/p54usb.c +++ b/drivers/net/wireless/intersil/p54/p54usb.c @@ -328,7 +328,7 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) struct net2280_reg_write *reg = NULL; int err = -ENOMEM; - reg = kmalloc(sizeof(*reg), GFP_ATOMIC); + reg = kmalloc_obj(*reg, GFP_ATOMIC); if (!reg) goto out; diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c index caba7491cd5a..331b0b69ce62 100644 --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c @@ -2094,7 +2094,7 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev) int ret = 0; struct wireless_dev *wdev; - wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); + wdev = kzalloc_obj(struct wireless_dev, GFP_KERNEL); if (!wdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/marvell/libertas/debugfs.c b/drivers/net/wireless/marvell/libertas/debugfs.c index c604613ab506..d2dc9128dae2 100644 --- a/drivers/net/wireless/marvell/libertas/debugfs.c +++ b/drivers/net/wireless/marvell/libertas/debugfs.c @@ -232,7 +232,7 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask, if (!buf) return -ENOMEM; - subscribed = kzalloc(sizeof(*subscribed), GFP_KERNEL); + subscribed = kzalloc_obj(*subscribed, GFP_KERNEL); if (!subscribed) { ret = -ENOMEM; goto out_page; @@ -288,7 +288,7 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask, ret = -EINVAL; goto out_page; } - events = kzalloc(sizeof(*events), GFP_KERNEL); + events = kzalloc_obj(*events, GFP_KERNEL); if (!events) { ret = -ENOMEM; goto out_page; diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c index fc5318035822..b814cf9032ad 100644 --- a/drivers/net/wireless/marvell/libertas/if_sdio.c +++ b/drivers/net/wireless/marvell/libertas/if_sdio.c @@ -1158,7 +1158,7 @@ static int if_sdio_probe(struct sdio_func *func, return -ENODEV; } - card = kzalloc(sizeof(struct if_sdio_card), GFP_KERNEL); + card = kzalloc_obj(struct if_sdio_card, GFP_KERNEL); if (!card) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c index 8a2504a62840..a21f7bba13c5 100644 --- a/drivers/net/wireless/marvell/libertas/if_spi.c +++ b/drivers/net/wireless/marvell/libertas/if_spi.c @@ -1113,7 +1113,7 @@ static int if_spi_probe(struct spi_device *spi) } /* Allocate card structure to represent this specific device */ - card = kzalloc(sizeof(struct if_spi_card), GFP_KERNEL); + card = kzalloc_obj(struct if_spi_card, GFP_KERNEL); if (!card) { err = -ENOMEM; goto teardown; diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c index 924ab93b7b67..e02756d7e87a 100644 --- a/drivers/net/wireless/marvell/libertas/if_usb.c +++ b/drivers/net/wireless/marvell/libertas/if_usb.c @@ -203,7 +203,7 @@ static int if_usb_probe(struct usb_interface *intf, udev = interface_to_usbdev(intf); - cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL); + cardp = kzalloc_obj(struct if_usb_card, GFP_KERNEL); if (!cardp) goto error; diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c index 2dd635935448..aa94b777da13 100644 --- a/drivers/net/wireless/marvell/libertas/mesh.c +++ b/drivers/net/wireless/marvell/libertas/mesh.c @@ -983,7 +983,7 @@ static int lbs_add_mesh(struct lbs_private *priv) int ret = 0; /* Allocate a virtual mesh device */ - mesh_wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); + mesh_wdev = kzalloc_obj(struct wireless_dev, GFP_KERNEL); if (!mesh_wdev) { lbs_deb_mesh("init mshX wireless device failed\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c index 5662a244f82a..44c609205422 100644 --- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c +++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c @@ -154,7 +154,7 @@ static int if_usb_probe(struct usb_interface *intf, lbtf_deb_enter(LBTF_DEB_USB); udev = interface_to_usbdev(intf); - cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL); + cardp = kzalloc_obj(struct if_usb_card, GFP_KERNEL); if (!cardp) goto error; diff --git a/drivers/net/wireless/marvell/mwifiex/11n.c b/drivers/net/wireless/marvell/mwifiex/11n.c index 66f0f5377ac1..cef8a55427dd 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n.c +++ b/drivers/net/wireless/marvell/mwifiex/11n.c @@ -547,8 +547,8 @@ void mwifiex_create_ba_tbl(struct mwifiex_private *priv, u8 *ra, int tid, int tid_down; if (!mwifiex_get_ba_tbl(priv, tid, ra)) { - new_node = kzalloc(sizeof(struct mwifiex_tx_ba_stream_tbl), - GFP_ATOMIC); + new_node = kzalloc_obj(struct mwifiex_tx_ba_stream_tbl, + GFP_ATOMIC); if (!new_node) return; diff --git a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c index f3397dc6c422..c00b385c0f58 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c @@ -344,7 +344,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, return; } /* if !tbl then create one */ - new_node = kzalloc(sizeof(struct mwifiex_rx_reorder_tbl), GFP_KERNEL); + new_node = kzalloc_obj(struct mwifiex_rx_reorder_tbl, GFP_KERNEL); if (!new_node) return; diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index a66d18e380fc..f387b26b086b 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -756,7 +756,7 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, return -EINVAL; } - bss_cfg = kzalloc(sizeof(*bss_cfg), GFP_KERNEL); + bss_cfg = kzalloc_obj(*bss_cfg, GFP_KERNEL); if (!bss_cfg) return -ENOMEM; @@ -2073,7 +2073,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) return -1; - bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), GFP_KERNEL); + bss_cfg = kzalloc_obj(struct mwifiex_uap_bss_param, GFP_KERNEL); if (!bss_cfg) return -ENOMEM; @@ -2683,7 +2683,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, if (!mwifiex_stop_bg_scan(priv)) cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0); - user_scan_cfg = kzalloc(sizeof(*user_scan_cfg), GFP_KERNEL); + user_scan_cfg = kzalloc_obj(*user_scan_cfg, GFP_KERNEL); if (!user_scan_cfg) return -ENOMEM; @@ -2787,7 +2787,7 @@ mwifiex_cfg80211_sched_scan_start(struct wiphy *wiphy, request->n_channels, request->scan_plans->interval, (int)request->ie_len); - bgscan_cfg = kzalloc(sizeof(*bgscan_cfg), GFP_KERNEL); + bgscan_cfg = kzalloc_obj(*bgscan_cfg, GFP_KERNEL); if (!bgscan_cfg) return -ENOMEM; @@ -3452,7 +3452,7 @@ static int mwifiex_set_mef_filter(struct mwifiex_private *priv, if (wowlan->n_patterns || wowlan->magic_pkt) num_entries++; - mef_entry = kcalloc(num_entries, sizeof(*mef_entry), GFP_KERNEL); + mef_entry = kzalloc_objs(*mef_entry, num_entries, GFP_KERNEL); if (!mef_entry) return -ENOMEM; @@ -3989,7 +3989,7 @@ mwifiex_cfg80211_uap_add_station(struct mwifiex_private *priv, const u8 *mac, if (!ret) { struct station_info *sinfo; - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return -ENOMEM; @@ -4161,7 +4161,7 @@ static int mwifiex_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev, if (!tb[MWIFIEX_TM_ATTR_DATA]) return -EINVAL; - hostcmd = kzalloc(sizeof(*hostcmd), GFP_KERNEL); + hostcmd = kzalloc_obj(*hostcmd, GFP_KERNEL); if (!hostcmd) return -ENOMEM; @@ -4677,9 +4677,9 @@ int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter) * additional active scan request for hidden SSIDs on passive channels. */ adapter->num_in_chan_stats = 2 * (n_channels_bg + n_channels_a); - adapter->chan_stats = kcalloc(adapter->num_in_chan_stats, - sizeof(*adapter->chan_stats), - GFP_KERNEL); + adapter->chan_stats = kzalloc_objs(*adapter->chan_stats, + adapter->num_in_chan_stats, + GFP_KERNEL); if (!adapter->chan_stats) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 0f466c31337f..1bb30fbab12b 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -389,8 +389,8 @@ int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter) u32 i; /* Allocate and initialize struct cmd_ctrl_node */ - cmd_array = kcalloc(MWIFIEX_NUM_OF_CMD_BUFFER, - sizeof(struct cmd_ctrl_node), GFP_KERNEL); + cmd_array = kzalloc_objs(struct cmd_ctrl_node, + MWIFIEX_NUM_OF_CMD_BUFFER, GFP_KERNEL); if (!cmd_array) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/ie.c b/drivers/net/wireless/marvell/mwifiex/ie.c index 26694cee15d3..55af5e9b5bee 100644 --- a/drivers/net/wireless/marvell/mwifiex/ie.c +++ b/drivers/net/wireless/marvell/mwifiex/ie.c @@ -149,7 +149,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv, u16 len; int ret; - ap_custom_ie = kzalloc(sizeof(*ap_custom_ie), GFP_KERNEL); + ap_custom_ie = kzalloc_obj(*ap_custom_ie, GFP_KERNEL); if (!ap_custom_ie) return -ENOMEM; @@ -221,8 +221,7 @@ static int mwifiex_update_vs_ie(const u8 *ies, int ies_len, vendor_ie = cfg80211_find_vendor_ie(oui, oui_type, ies, ies_len); if (vendor_ie) { if (!*ie_ptr) { - *ie_ptr = kzalloc(sizeof(struct mwifiex_ie), - GFP_KERNEL); + *ie_ptr = kzalloc_obj(struct mwifiex_ie, GFP_KERNEL); if (!*ie_ptr) return -ENOMEM; ie = *ie_ptr; @@ -326,7 +325,7 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv, if (!info->tail || !info->tail_len) return 0; - gen_ie = kzalloc(sizeof(*gen_ie), GFP_KERNEL); + gen_ie = kzalloc_obj(*gen_ie, GFP_KERNEL); if (!gen_ie) return -ENOMEM; @@ -439,7 +438,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) int ret = 0; if (priv->gen_idx != MWIFIEX_AUTO_IDX_MASK) { - gen_ie = kmalloc(sizeof(*gen_ie), GFP_KERNEL); + gen_ie = kmalloc_obj(*gen_ie, GFP_KERNEL); if (!gen_ie) return -ENOMEM; @@ -457,7 +456,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) } if (priv->beacon_idx != MWIFIEX_AUTO_IDX_MASK) { - beacon_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); + beacon_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); if (!beacon_ie) { ret = -ENOMEM; goto done; @@ -467,7 +466,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) beacon_ie->ie_length = 0; } if (priv->proberesp_idx != MWIFIEX_AUTO_IDX_MASK) { - pr_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); + pr_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); if (!pr_ie) { ret = -ENOMEM; goto done; @@ -477,7 +476,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) pr_ie->ie_length = 0; } if (priv->assocresp_idx != MWIFIEX_AUTO_IDX_MASK) { - ar_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); + ar_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); if (!ar_ie) { ret = -ENOMEM; goto done; diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 4820010a86f6..28ffcc780eab 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -25,7 +25,7 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) struct mwifiex_bss_prio_node *bss_prio; struct mwifiex_bss_prio_tbl *tbl = adapter->bss_prio_tbl; - bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL); + bss_prio = kzalloc_obj(struct mwifiex_bss_prio_node, GFP_KERNEL); if (!bss_prio) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index ff177b06f42d..d4c62fad8099 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -60,7 +60,7 @@ static int mwifiex_register(void *card, struct device *dev, struct mwifiex_adapter *adapter; int i; - adapter = kzalloc(sizeof(struct mwifiex_adapter), GFP_KERNEL); + adapter = kzalloc_obj(struct mwifiex_adapter, GFP_KERNEL); if (!adapter) return -ENOMEM; @@ -82,7 +82,7 @@ static int mwifiex_register(void *card, struct device *dev, for (i = 0; i < MWIFIEX_MAX_BSS_NUM; i++) { /* Allocate memory for private structure */ adapter->priv[i] = - kzalloc(sizeof(struct mwifiex_private), GFP_KERNEL); + kzalloc_obj(struct mwifiex_private, GFP_KERNEL); if (!adapter->priv[i]) goto error; @@ -1180,7 +1180,7 @@ void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter) p += adapter->if_ops.reg_dump(adapter, p); } p += sprintf(p, "\n=== more debug information\n"); - debug_info = kzalloc(sizeof(*debug_info), GFP_KERNEL); + debug_info = kzalloc_obj(*debug_info, GFP_KERNEL); if (debug_info) { for (i = 0; i < adapter->priv_num; i++) { if (!adapter->priv[i]->netdev) @@ -1346,7 +1346,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv, if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA || GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) { - priv->hist_data = kmalloc(sizeof(*priv->hist_data), GFP_KERNEL); + priv->hist_data = kmalloc_obj(*priv->hist_data, GFP_KERNEL); if (priv->hist_data) mwifiex_hist_data_reset(priv); } diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c index cab889af4c4a..b4858c0002e0 100644 --- a/drivers/net/wireless/marvell/mwifiex/scan.c +++ b/drivers/net/wireless/marvell/mwifiex/scan.c @@ -1503,16 +1503,15 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, adapter->scan_processing = true; spin_unlock_bh(&adapter->mwifiex_cmd_lock); - scan_cfg_out = kzalloc(sizeof(union mwifiex_scan_cmd_config_tlv), - GFP_KERNEL); + scan_cfg_out = kzalloc_obj(union mwifiex_scan_cmd_config_tlv, + GFP_KERNEL); if (!scan_cfg_out) { ret = -ENOMEM; goto done; } - scan_chan_list = kcalloc(MWIFIEX_USER_SCAN_CHAN_MAX, - sizeof(struct mwifiex_chan_scan_param_set), - GFP_KERNEL); + scan_chan_list = kzalloc_objs(struct mwifiex_chan_scan_param_set, + MWIFIEX_USER_SCAN_CHAN_MAX, GFP_KERNEL); if (!scan_chan_list) { kfree(scan_cfg_out); ret = -ENOMEM; @@ -1650,7 +1649,7 @@ static int mwifiex_save_hidden_ssid_channels(struct mwifiex_private *priv, int chid; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc(sizeof(*bss_desc), GFP_KERNEL); + bss_desc = kzalloc_obj(*bss_desc, GFP_KERNEL); if (!bss_desc) return -ENOMEM; @@ -1693,7 +1692,7 @@ static int mwifiex_update_curr_bss_params(struct mwifiex_private *priv, int ret; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), GFP_KERNEL); + bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor, GFP_KERNEL); if (!bss_desc) return -ENOMEM; @@ -1932,7 +1931,7 @@ mwifiex_active_scan_req_for_passive_chan(struct mwifiex_private *priv) mwifiex_dbg(adapter, INFO, "No BSS with hidden SSID found on DFS channels\n"); return 0; } - user_scan_cfg = kzalloc(sizeof(*user_scan_cfg), GFP_KERNEL); + user_scan_cfg = kzalloc_obj(*user_scan_cfg, GFP_KERNEL); if (!user_scan_cfg) return -ENOMEM; @@ -2174,9 +2173,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, if (nd_config) { adapter->nd_info = - kzalloc(struct_size(adapter->nd_info, matches, - scan_rsp->number_of_sets), - GFP_ATOMIC); + kzalloc_flex(*adapter->nd_info, matches, + scan_rsp->number_of_sets, GFP_ATOMIC); if (adapter->nd_info) adapter->nd_info->n_matches = scan_rsp->number_of_sets; @@ -2452,7 +2450,7 @@ int mwifiex_stop_bg_scan(struct mwifiex_private *priv) return 0; } - bgscan_cfg = kzalloc(sizeof(*bgscan_cfg), GFP_KERNEL); + bgscan_cfg = kzalloc_obj(*bgscan_cfg, GFP_KERNEL); if (!bgscan_cfg) return -ENOMEM; @@ -2779,7 +2777,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, return -EBUSY; } - scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), GFP_KERNEL); + scan_cfg = kzalloc_obj(struct mwifiex_user_scan_cfg, GFP_KERNEL); if (!scan_cfg) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c index dcca71158fc6..b457ed6f18f5 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -1516,7 +1516,7 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data, struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_ds_misc_cmd *hostcmd __free(kfree) = NULL; - hostcmd = kzalloc(sizeof(*hostcmd), GFP_KERNEL); + hostcmd = kzalloc_obj(*hostcmd, GFP_KERNEL); if (!hostcmd) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c index 9c53825f222d..f8f84fc670f3 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c @@ -1052,7 +1052,7 @@ mwifiex_create_custom_regdomain(struct mwifiex_private *priv, if (WARN_ON_ONCE(num_chan > NL80211_MAX_SUPP_REG_RULES)) return ERR_PTR(-EINVAL); - regd = kzalloc(struct_size(regd, reg_rules, num_chan), GFP_KERNEL); + regd = kzalloc_flex(*regd, reg_rules, num_chan, GFP_KERNEL); if (!regd) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index ef6722ffdc74..46476cb752dd 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -330,8 +330,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, return -EINVAL; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), - GFP_KERNEL); + bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor, GFP_KERNEL); if (!bss_desc) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c index 77a9a6de636d..a4cf323e704b 100644 --- a/drivers/net/wireless/marvell/mwifiex/tdls.c +++ b/drivers/net/wireless/marvell/mwifiex/tdls.c @@ -1356,7 +1356,7 @@ void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac) } /* create new TDLS peer */ - tdls_peer = kzalloc(sizeof(*tdls_peer), GFP_ATOMIC); + tdls_peer = kzalloc_obj(*tdls_peer, GFP_ATOMIC); if (tdls_peer) { ether_addr_copy(tdls_peer->mac_addr, mac); tdls_peer->tdls_status = TDLS_SETUP_INPROGRESS; diff --git a/drivers/net/wireless/marvell/mwifiex/uap_event.c b/drivers/net/wireless/marvell/mwifiex/uap_event.c index 245cb99a3daa..9abd011aa295 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_event.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_event.c @@ -105,7 +105,7 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv) switch (eventcause) { case EVENT_UAP_STA_ASSOC: - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c index 6882e90e90b2..7d3631d21223 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -694,7 +694,7 @@ mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac) if (node) goto done; - node = kzalloc(sizeof(*node), GFP_ATOMIC); + node = kzalloc_obj(*node, GFP_ATOMIC); if (!node) goto done; diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wireless/marvell/mwifiex/wmm.c index 1b1222c73728..841505e83c7f 100644 --- a/drivers/net/wireless/marvell/mwifiex/wmm.c +++ b/drivers/net/wireless/marvell/mwifiex/wmm.c @@ -99,7 +99,7 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, const u8 *ra) { struct mwifiex_ra_list_tbl *ra_list; - ra_list = kzalloc(sizeof(struct mwifiex_ra_list_tbl), GFP_ATOMIC); + ra_list = kzalloc_obj(struct mwifiex_ra_list_tbl, GFP_ATOMIC); if (!ra_list) return NULL; diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c index 54d6d00ecdf1..c505c83f8abc 100644 --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c @@ -1182,7 +1182,7 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index) return -ENOMEM; } - rxq->buf = kcalloc(MWL8K_RX_DESCS, sizeof(*rxq->buf), GFP_KERNEL); + rxq->buf = kzalloc_objs(*rxq->buf, MWL8K_RX_DESCS, GFP_KERNEL); if (rxq->buf == NULL) { dma_free_coherent(&priv->pdev->dev, size, rxq->rxd, rxq->rxd_dma); @@ -1478,7 +1478,7 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index) return -ENOMEM; } - txq->skb = kcalloc(MWL8K_TX_DESCS, sizeof(*txq->skb), GFP_KERNEL); + txq->skb = kzalloc_objs(*txq->skb, MWL8K_TX_DESCS, GFP_KERNEL); if (txq->skb == NULL) { dma_free_coherent(&priv->pdev->dev, size, txq->txd, txq->txd_dma); @@ -2472,7 +2472,7 @@ static int mwl8k_cmd_get_hw_spec_sta(struct ieee80211_hw *hw) int rc; int i; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2537,7 +2537,7 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw) int rc, i; u32 api_version; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2639,7 +2639,7 @@ static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw) int rc; int i; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2753,7 +2753,7 @@ static int mwl8k_cmd_get_stat(struct ieee80211_hw *hw, struct mwl8k_cmd_get_stat *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2796,7 +2796,7 @@ mwl8k_cmd_radio_control(struct ieee80211_hw *hw, bool enable, bool force) if (enable == priv->radio_on && !force) return 0; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2854,7 +2854,7 @@ static int mwl8k_cmd_rf_tx_power(struct ieee80211_hw *hw, int dBm) struct mwl8k_cmd_rf_tx_power *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2895,7 +2895,7 @@ static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw, int rc; int i; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -2948,7 +2948,7 @@ mwl8k_cmd_rf_antenna(struct ieee80211_hw *hw, int antenna, int mask) struct mwl8k_cmd_rf_antenna *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3066,7 +3066,7 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw) struct mwl8k_cmd_set_pre_scan *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3099,7 +3099,7 @@ mwl8k_cmd_bbp_reg_access(struct ieee80211_hw *hw, struct mwl8k_cmd_bbp_reg_access *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3135,7 +3135,7 @@ mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, const __u8 *mac) struct mwl8k_cmd_set_post_scan *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3228,7 +3228,7 @@ static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw, struct mwl8k_priv *priv = hw->priv; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3314,7 +3314,7 @@ mwl8k_cmd_set_aid(struct ieee80211_hw *hw, u16 prot_mode; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3368,7 +3368,7 @@ mwl8k_cmd_set_rate(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct mwl8k_cmd_set_rate *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3402,7 +3402,7 @@ static int mwl8k_cmd_finalize_join(struct ieee80211_hw *hw, void *frame, int payload_len; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3440,7 +3440,7 @@ mwl8k_cmd_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, struct mwl8k_cmd_set_rts_threshold *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3469,7 +3469,7 @@ static int mwl8k_cmd_set_slot(struct ieee80211_hw *hw, bool short_slot_time) struct mwl8k_cmd_set_slot *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3543,7 +3543,7 @@ mwl8k_cmd_set_edca_params(struct ieee80211_hw *hw, __u8 qnum, struct mwl8k_cmd_set_edca_params *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3583,7 +3583,7 @@ static int mwl8k_cmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable) struct mwl8k_cmd_set_wmm_mode *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3615,7 +3615,7 @@ static int mwl8k_cmd_mimo_config(struct ieee80211_hw *hw, __u8 rx, __u8 tx) struct mwl8k_cmd_mimo_config *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3658,7 +3658,7 @@ static int mwl8k_cmd_use_fixed_rate_sta(struct ieee80211_hw *hw) struct mwl8k_cmd_use_fixed_rate_sta *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3698,7 +3698,7 @@ mwl8k_cmd_use_fixed_rate_ap(struct ieee80211_hw *hw, int mcast, int mgmt) struct mwl8k_cmd_use_fixed_rate_ap *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3727,7 +3727,7 @@ static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable) struct mwl8k_cmd_enable_sniffer *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3782,7 +3782,7 @@ static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw, mac_type = MWL8K_MAC_TYPE_SECONDARY_AP; } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3837,7 +3837,7 @@ static int mwl8k_cmd_set_rateadapt_mode(struct ieee80211_hw *hw, __u16 mode) struct mwl8k_cmd_set_rate_adapt_mode *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3865,7 +3865,7 @@ static int mwl8k_cmd_get_watchdog_bitmap(struct ieee80211_hw *hw, u8 *bitmap) struct mwl8k_cmd_get_watchdog_bitmap *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -3954,7 +3954,7 @@ static int mwl8k_cmd_bss_start(struct ieee80211_hw *hw, if (!enable && !(priv->running_bsses & (1 << mwl8k_vif->macid))) return 0; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4046,7 +4046,7 @@ mwl8k_check_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream, struct mwl8k_cmd_bastream *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4078,7 +4078,7 @@ mwl8k_create_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream, struct mwl8k_cmd_bastream *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4121,7 +4121,7 @@ static void mwl8k_destroy_ba(struct ieee80211_hw *hw, { struct mwl8k_cmd_bastream *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return; @@ -4173,7 +4173,7 @@ static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw, u32 rates; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4211,7 +4211,7 @@ static int mwl8k_cmd_set_new_stn_add_self(struct ieee80211_hw *hw, struct mwl8k_cmd_set_new_stn *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4254,7 +4254,7 @@ static int mwl8k_cmd_set_new_stn_del(struct ieee80211_hw *hw, spin_unlock(&priv->stream_lock); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4341,7 +4341,7 @@ static int mwl8k_cmd_update_encryption_enable(struct ieee80211_hw *hw, struct mwl8k_cmd_update_encryption *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4410,7 +4410,7 @@ static int mwl8k_cmd_encryption_set_key(struct ieee80211_hw *hw, u8 idx; struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4467,7 +4467,7 @@ static int mwl8k_cmd_encryption_remove_key(struct ieee80211_hw *hw, int rc; struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4604,7 +4604,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw, u32 rates; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; @@ -4643,7 +4643,7 @@ static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw, struct mwl8k_cmd_update_stadb *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c index 3d34caf7e4f7..144c336e13a2 100644 --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c @@ -248,7 +248,7 @@ int mt76_rx_aggr_start(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno, mt76_rx_aggr_stop(dev, wcid, tidno); - tid = kzalloc(struct_size(tid, reorder_buf, size), GFP_KERNEL); + tid = kzalloc_flex(*tid, reorder_buf, size, GFP_KERNEL); if (!tid) return -ENOMEM; diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index bd56cdb022a2..45992fdcec60 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1055,7 +1055,7 @@ mt7615_mac_queue_rate_update(struct mt7615_phy *phy, struct mt7615_sta *sta, if (work_pending(&dev->rate_work)) return -EBUSY; - wrd = kzalloc(sizeof(*wrd), GFP_ATOMIC); + wrd = kzalloc_obj(*wrd, GFP_ATOMIC); if (!wrd) return -ENOMEM; diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index beed795edb24..fee1f5ae0496 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -966,7 +966,7 @@ mt7996_mac_sta_init_link(struct mt7996_dev *dev, mtxq->wcid = idx; } } else { - msta_link = kzalloc(sizeof(*msta_link), GFP_KERNEL); + msta_link = kzalloc_obj(*msta_link, GFP_KERNEL); if (!msta_link) return -ENOMEM; diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index 14a88ef79b6c..c0c042de477b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -726,7 +726,7 @@ mt7996_mcu_wed_rro_event(struct mt7996_dev *dev, struct sk_buff *skb) struct mt7996_wed_rro_session_id *session; e = (void *)skb->data; - session = kzalloc(sizeof(*session), GFP_ATOMIC); + session = kzalloc_obj(*session, GFP_ATOMIC); if (!session) break; diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index c39e7f313ea1..edd4e570fe9f 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -484,15 +484,15 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx) { if (!priv->wilc_gtk[idx]) { - priv->wilc_gtk[idx] = kzalloc(sizeof(*priv->wilc_gtk[idx]), - GFP_KERNEL); + priv->wilc_gtk[idx] = kzalloc_obj(*priv->wilc_gtk[idx], + GFP_KERNEL); if (!priv->wilc_gtk[idx]) return -ENOMEM; } if (!priv->wilc_ptk[idx]) { - priv->wilc_ptk[idx] = kzalloc(sizeof(*priv->wilc_ptk[idx]), - GFP_KERNEL); + priv->wilc_ptk[idx] = kzalloc_obj(*priv->wilc_ptk[idx], + GFP_KERNEL); if (!priv->wilc_ptk[idx]) return -ENOMEM; } @@ -504,8 +504,8 @@ static int wilc_wfi_cfg_allocate_wpa_igtk_entry(struct wilc_priv *priv, u8 idx) { idx -= 4; if (!priv->wilc_igtk[idx]) { - priv->wilc_igtk[idx] = kzalloc(sizeof(*priv->wilc_igtk[idx]), - GFP_KERNEL); + priv->wilc_igtk[idx] = kzalloc_obj(*priv->wilc_igtk[idx], + GFP_KERNEL); if (!priv->wilc_igtk[idx]) return -ENOMEM; } @@ -1178,7 +1178,7 @@ static int mgmt_tx(struct wiphy *wiphy, if (!ieee80211_is_mgmt(mgmt->frame_control)) goto out; - mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_KERNEL); + mgmt_tx = kmalloc_obj(*mgmt_tx, GFP_KERNEL); if (!mgmt_tx) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index a229c6cab332..bbd1794acb27 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -60,7 +60,7 @@ wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), if (!work_fun) return ERR_PTR(-EINVAL); - msg = kzalloc(sizeof(*msg), GFP_ATOMIC); + msg = kzalloc_obj(*msg, GFP_ATOMIC); if (!msg) return ERR_PTR(-ENOMEM); msg->fn = work_fun; @@ -387,7 +387,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, u64 ies_tsf; int ret; - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) return NULL; @@ -1039,7 +1039,7 @@ int wilc_set_external_auth_param(struct wilc_vif *vif, wid.id = WID_EXTERNAL_AUTH_PARAM; wid.type = WID_BIN_DATA; wid.size = sizeof(*param); - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) return -EINVAL; @@ -1516,7 +1516,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) struct host_if_drv *hif_drv; struct wilc_vif *vif = netdev_priv(dev); - hif_drv = kzalloc(sizeof(*hif_drv), GFP_KERNEL); + hif_drv = kzalloc_obj(*hif_drv, GFP_KERNEL); if (!hif_drv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/mon.c b/drivers/net/wireless/microchip/wilc1000/mon.c index c3d27aaec297..b5cf6fa7a851 100644 --- a/drivers/net/wireless/microchip/wilc1000/mon.c +++ b/drivers/net/wireless/microchip/wilc1000/mon.c @@ -120,7 +120,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) return -EFAULT; netif_stop_queue(dev); - mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); + mgmt_tx = kmalloc_obj(*mgmt_tx, GFP_ATOMIC); if (!mgmt_tx) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index af298021e050..956cb578bf37 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -752,7 +752,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) return NETDEV_TX_OK; } - tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC); + tx_data = kmalloc_obj(*tx_data, GFP_ATOMIC); if (!tx_data) { dev_kfree_skb(skb); netif_wake_queue(ndev); diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index af970f999111..64b1490b793d 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -145,7 +145,7 @@ static int wilc_sdio_probe(struct sdio_func *func, int ret; - sdio_priv = kzalloc(sizeof(*sdio_priv), GFP_KERNEL); + sdio_priv = kzalloc_obj(*sdio_priv, GFP_KERNEL); if (!sdio_priv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 5bcabb7decea..cad1fcf2e14f 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -211,7 +211,7 @@ static int wilc_bus_probe(struct spi_device *spi) struct wilc *wilc; int ret; - spi_priv = kzalloc(sizeof(*spi_priv), GFP_KERNEL); + spi_priv = kzalloc_obj(*spi_priv, GFP_KERNEL); if (!spi_priv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index fedc7d59216a..15a2221892cd 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -244,7 +244,7 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer, return 0; } - tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); + tqe = kmalloc_obj(*tqe, GFP_ATOMIC); if (!tqe) { complete(&wilc->cfg_event); return 0; @@ -413,7 +413,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, return 0; } - tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); + tqe = kmalloc_obj(*tqe, GFP_ATOMIC); if (!tqe) { tx_complete_fn(tx_data, 0); @@ -466,7 +466,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, tx_complete_fn(priv, 0); return 0; } - tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC); + tqe = kmalloc_obj(*tqe, GFP_ATOMIC); if (!tqe) { tx_complete_fn(priv, 0); @@ -1209,7 +1209,7 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) offset += size; wilc->rx_buffer_offset = offset; - rqe = kmalloc(sizeof(*rqe), GFP_KERNEL); + rqe = kmalloc_obj(*rqe, GFP_KERNEL); if (!rqe) return; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c index cfabd5aebb54..0163f0b17497 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c @@ -390,7 +390,7 @@ int wilc_wlan_cfg_init(struct wilc *wl) if (!wl->cfg.s) goto out_w; - str_vals = kzalloc(sizeof(*str_vals), GFP_KERNEL); + str_vals = kzalloc_obj(*str_vals, GFP_KERNEL); if (!str_vals) goto out_s; diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c index 711902a809db..09303aa6c1d7 100644 --- a/drivers/net/wireless/purelifi/plfxlc/usb.c +++ b/drivers/net/wireless/purelifi/plfxlc/usb.c @@ -204,7 +204,7 @@ static int __lf_x_usb_enable_rx(struct plfxlc_usb *usb) int i, r; r = -ENOMEM; - urbs = kcalloc(RX_URBS_COUNT, sizeof(struct urb *), GFP_KERNEL); + urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT, GFP_KERNEL); if (!urbs) goto error; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 956c5763662f..b1908fa90cfa 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -981,7 +981,7 @@ qtnf_parse_wowlan_info(struct qtnf_wmac *mac, const struct qlink_wowlan_support *data1; struct wiphy_wowlan_support *supp; - supp = kzalloc(sizeof(*supp), GFP_KERNEL); + supp = kzalloc_obj(*supp, GFP_KERNEL); if (!supp) return; @@ -1031,8 +1031,8 @@ qtnf_parse_variable_mac_info(struct qtnf_wmac *mac, if (WARN_ON(resp->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) return -E2BIG; - mac->rd = kzalloc(struct_size(mac->rd, reg_rules, resp->n_reg_rules), - GFP_KERNEL); + mac->rd = kzalloc_flex(*mac->rd, reg_rules, resp->n_reg_rules, + GFP_KERNEL); if (!mac->rd) return -ENOMEM; @@ -1084,8 +1084,8 @@ qtnf_parse_variable_mac_info(struct qtnf_wmac *mac, return -EINVAL; } - limits = kcalloc(rec->n_limits, sizeof(*limits), - GFP_KERNEL); + limits = kzalloc_objs(*limits, rec->n_limits, + GFP_KERNEL); if (!limits) return -ENOMEM; @@ -1254,9 +1254,8 @@ qtnf_cmd_resp_proc_mac_info(struct qtnf_wmac *mac, sizeof(mac_info->vht_cap_mod_mask)); mac_info->n_if_comb = resp_info->n_iface_combinations; - mac_info->if_comb = kcalloc(mac->macinfo.n_if_comb, - sizeof(*mac->macinfo.if_comb), - GFP_KERNEL); + mac_info->if_comb = kzalloc_objs(*mac->macinfo.if_comb, + mac->macinfo.n_if_comb, GFP_KERNEL); if (!mac->macinfo.if_comb) return -ENOMEM; @@ -1341,8 +1340,8 @@ static int qtnf_cmd_band_fill_iftype(const u8 *data, if (band->n_iftype_data == 0) return 0; - iftype_data = kcalloc(band->n_iftype_data, sizeof(*iftype_data), - GFP_KERNEL); + iftype_data = kzalloc_objs(*iftype_data, band->n_iftype_data, + GFP_KERNEL); if (!iftype_data) { band->n_iftype_data = 0; return -ENOMEM; @@ -1389,8 +1388,8 @@ qtnf_cmd_resp_fill_band_info(struct ieee80211_supported_band *band, return 0; if (!band->channels) - band->channels = kcalloc(band->n_channels, sizeof(*chan), - GFP_KERNEL); + band->channels = kzalloc_objs(*chan, band->n_channels, + GFP_KERNEL); if (!band->channels) { band->n_channels = 0; return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 38af6cdc2843..4cab8dee332b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -212,7 +212,7 @@ static int qtnf_mac_init_single_band(struct wiphy *wiphy, { int ret; - wiphy->bands[band] = kzalloc(sizeof(*wiphy->bands[band]), GFP_KERNEL); + wiphy->bands[band] = kzalloc_obj(*wiphy->bands[band], GFP_KERNEL); if (!wiphy->bands[band]) return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 71840f41b73c..c16cd1e5286a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -41,7 +41,7 @@ qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif, return -EPROTO; } - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (!sinfo) return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/util.c b/drivers/net/wireless/quantenna/qtnfmac/util.c index cda6f5f3f38a..5c1a5a8f87a6 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/util.c +++ b/drivers/net/wireless/quantenna/qtnfmac/util.c @@ -59,7 +59,7 @@ struct qtnf_sta_node *qtnf_sta_list_add(struct qtnf_vif *vif, if (node) goto done; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (unlikely(!node)) goto done; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c index 42e21e9f303b..f2b55db0b27b 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c @@ -1589,7 +1589,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c index 36ddc5a69fa4..a6b26c5ef4cf 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c @@ -1907,7 +1907,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c index 09923765e2db..50f1eeddf913 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c @@ -1720,7 +1720,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index 65d0f805459c..6041f029857b 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -11907,13 +11907,13 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information and survey arrays */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; rt2x00dev->chan_survey = - kcalloc(spec->num_channels, sizeof(struct rt2x00_chan_survey), - GFP_KERNEL); + kzalloc_objs(struct rt2x00_chan_survey, spec->num_channels, + GFP_KERNEL); if (!rt2x00dev->chan_survey) { kfree(info); return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c index b51a23300ba2..d1d94b0b0f31 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -179,7 +179,7 @@ static int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) u32 fw_mode; int ret; - reg = kmalloc(sizeof(*reg), GFP_KERNEL); + reg = kmalloc_obj(*reg, GFP_KERNEL); if (reg == NULL) return -ENOMEM; /* cannot use rt2x00usb_register_read here as it uses different diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c index f2395309ec00..edececd89572 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c @@ -639,7 +639,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) struct dentry *queue_folder; struct dentry *register_folder; - intf = kzalloc(sizeof(struct rt2x00debug_intf), GFP_KERNEL); + intf = kzalloc_obj(struct rt2x00debug_intf, GFP_KERNEL); if (!intf) { rt2x00_err(rt2x00dev, "Failed to allocate debug handler\n"); return; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 778a478ab53a..dee01472747f 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1020,11 +1020,11 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, if (spec->supported_rates & SUPPORT_RATE_OFDM) num_rates += 8; - channels = kcalloc(spec->num_channels, sizeof(*channels), GFP_KERNEL); + channels = kzalloc_objs(*channels, spec->num_channels, GFP_KERNEL); if (!channels) return -ENOMEM; - rates = kcalloc(num_rates, sizeof(*rates), GFP_KERNEL); + rates = kzalloc_objs(*rates, num_rates, GFP_KERNEL); if (!rates) goto exit_free_channels; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c index 13e48b1e7356..8fb336834ced 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c @@ -564,7 +564,7 @@ static void rt2x00queue_bar_check(struct queue_entry *entry) if (likely(!ieee80211_is_back_req(bar->frame_control))) return; - bar_entry = kmalloc(sizeof(*bar_entry), GFP_ATOMIC); + bar_entry = kmalloc_obj(*bar_entry, GFP_ATOMIC); /* * If the alloc fails we still send the BAR out but just don't track @@ -1244,7 +1244,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) */ rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim; - queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL); + queue = kzalloc_objs(*queue, rt2x00dev->data_queues, GFP_KERNEL); if (!queue) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index a6d50149e0c3..54599cad78f9 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -196,7 +196,7 @@ void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, struct urb *urb; struct rt2x00_async_read_data *rd; - rd = kmalloc(sizeof(*rd), GFP_ATOMIC); + rd = kmalloc_obj(*rd, GFP_ATOMIC); if (!rd) return; diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c index d1cd5694e3c7..aea74b6b28e4 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c @@ -2712,7 +2712,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt73usb.c b/drivers/net/wireless/ralink/rt2x00/rt73usb.c index b79dda952a33..c47f4689ffdd 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt73usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt73usb.c @@ -2136,7 +2136,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c index 7aa2da0cd63c..7a2a31af9a79 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c @@ -129,7 +129,7 @@ static void rtl8187_iowrite_async(struct rtl8187_priv *priv, __le16 addr, } *buf; int rc; - buf = kmalloc(sizeof(*buf), GFP_ATOMIC); + buf = kmalloc_obj(*buf, GFP_ATOMIC); if (!buf) return; @@ -1463,7 +1463,7 @@ static int rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); /* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf = kmalloc(sizeof(*priv->io_dmabuf), GFP_KERNEL); + priv->io_dmabuf = kmalloc_obj(*priv->io_dmabuf, GFP_KERNEL); if (!priv->io_dmabuf) { err = -ENOMEM; goto err_free_dev; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c index f9a527f6a175..721c95f13ec9 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c @@ -7323,7 +7323,7 @@ static void rtl8xxxu_collect_sta_iter(void *data, struct ieee80211_sta *sta) struct rtl8xxxu_iter_stas_data *iter_stas = data; struct rtl8xxxu_stas_entry *stas_entry; - stas_entry = kmalloc(sizeof(*stas_entry), GFP_ATOMIC); + stas_entry = kmalloc_obj(*stas_entry, GFP_ATOMIC); if (!stas_entry) return; @@ -7381,7 +7381,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) } for (i = 0; i < RTL8XXXU_TX_URBS; i++) { - tx_urb = kmalloc(sizeof(struct rtl8xxxu_tx_urb), GFP_KERNEL); + tx_urb = kmalloc_obj(struct rtl8xxxu_tx_urb, GFP_KERNEL); if (!tx_urb) { if (!i) ret = -ENOMEM; @@ -7402,7 +7402,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) spin_unlock_irqrestore(&priv->rx_urb_lock, flags); for (i = 0; i < RTL8XXXU_RX_URBS; i++) { - rx_urb = kmalloc(sizeof(struct rtl8xxxu_rx_urb), GFP_KERNEL); + rx_urb = kmalloc_obj(struct rtl8xxxu_rx_urb, GFP_KERNEL); if (!rx_urb) { if (!i) ret = -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index 09e5a16d7252..0ac9cf0937aa 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -2011,7 +2011,7 @@ void rtl_collect_scan_list(struct ieee80211_hw *hw, struct sk_buff *skb) } if (!entry) { - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) goto label_err; diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c index e88d92d3ae7a..332f90e4d83f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c @@ -132,10 +132,10 @@ static void rtl_btc_alloc_variable(struct rtl_priv *rtlpriv, bool wifi_only) { if (wifi_only) rtlpriv->btcoexist.wifi_only_context = - kzalloc(sizeof(struct wifi_only_cfg), GFP_KERNEL); + kzalloc_obj(struct wifi_only_cfg, GFP_KERNEL); else rtlpriv->btcoexist.btc_context = - kzalloc(sizeof(struct btc_coexist), GFP_KERNEL); + kzalloc_obj(struct btc_coexist, GFP_KERNEL); } static void rtl_btc_free_variable(struct rtl_priv *rtlpriv) diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c index a164364109ba..dcfaa98198b6 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rc.c +++ b/drivers/net/wireless/realtek/rtlwifi/rc.c @@ -278,7 +278,7 @@ static void *rtl_rate_alloc_sta(void *ppriv, struct rtl_priv *rtlpriv = ppriv; struct rtl_rate_priv *rate_priv; - rate_priv = kzalloc(sizeof(*rate_priv), gfp); + rate_priv = kzalloc_obj(*rate_priv, gfp); if (!rate_priv) return NULL; diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c index cc699efa9c79..1f927dd9e152 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c @@ -70,10 +70,10 @@ static int rtl92du_init_shared_data(struct ieee80211_hw *hw) rtlpriv->curveindex_5g = kcalloc(TARGET_CHNL_NUM_5G, sizeof(*rtlpriv->curveindex_5g), GFP_KERNEL); - rtlpriv->mutex_for_power_on_off = - kzalloc(sizeof(*rtlpriv->mutex_for_power_on_off), GFP_KERNEL); - rtlpriv->mutex_for_hw_init = - kzalloc(sizeof(*rtlpriv->mutex_for_hw_init), GFP_KERNEL); + rtlpriv->mutex_for_power_on_off = kzalloc_obj(*rtlpriv->mutex_for_power_on_off, + GFP_KERNEL); + rtlpriv->mutex_for_hw_init = kzalloc_obj(*rtlpriv->mutex_for_hw_init, + GFP_KERNEL); if (!rtlpriv->curveindex_2g || !rtlpriv->curveindex_5g || !rtlpriv->mutex_for_power_on_off || !rtlpriv->mutex_for_hw_init) { diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index c68a9fff6808..a3e5b0963cb7 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -1331,7 +1331,7 @@ static struct rtw_rsvd_page *rtw_alloc_rsvd_page(struct rtw_dev *rtwdev, { struct rtw_rsvd_page *rsvd_pkt = NULL; - rsvd_pkt = kzalloc(sizeof(*rsvd_pkt), GFP_KERNEL); + rsvd_pkt = kzalloc_obj(*rsvd_pkt, GFP_KERNEL); if (!rsvd_pkt) return NULL; diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c index 138e9e348c6c..b42840271051 100644 --- a/drivers/net/wireless/realtek/rtw88/sdio.c +++ b/drivers/net/wireless/realtek/rtw88/sdio.c @@ -1290,8 +1290,8 @@ static int rtw_sdio_init_tx(struct rtw_dev *rtwdev) for (i = 0; i < RTK_MAX_TX_QUEUE_NUM; i++) skb_queue_head_init(&rtwsdio->tx_queue[i]); - rtwsdio->tx_handler_data = kmalloc(sizeof(*rtwsdio->tx_handler_data), - GFP_KERNEL); + rtwsdio->tx_handler_data = kmalloc_obj(*rtwsdio->tx_handler_data, + GFP_KERNEL); if (!rtwsdio->tx_handler_data) goto err_destroy_wq; diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c index db60e142268d..433b06c8d8a6 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -403,7 +403,7 @@ static bool rtw_usb_tx_agg_skb(struct rtw_usb *rtwusb, struct sk_buff_head *list if (skb_queue_empty(list)) return false; - txcb = kmalloc(sizeof(*txcb), GFP_ATOMIC); + txcb = kmalloc_obj(*txcb, GFP_ATOMIC); if (!txcb) return false; diff --git a/drivers/net/wireless/realtek/rtw88/util.c b/drivers/net/wireless/realtek/rtw88/util.c index 66819f694405..fcd6eb1ab32a 100644 --- a/drivers/net/wireless/realtek/rtw88/util.c +++ b/drivers/net/wireless/realtek/rtw88/util.c @@ -122,7 +122,7 @@ static void rtw_collect_sta_iter(void *data, struct ieee80211_sta *sta) struct rtw_iter_stas_data *iter_stas = data; struct rtw_stas_entry *stas_entry; - stas_entry = kmalloc(sizeof(*stas_entry), GFP_ATOMIC); + stas_entry = kmalloc_obj(*stas_entry, GFP_ATOMIC); if (!stas_entry) return; @@ -172,7 +172,7 @@ static void rtw_collect_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) struct rtw_iter_vifs_data *iter_stas = data; struct rtw_vifs_entry *vifs_entry; - vifs_entry = kmalloc(sizeof(*vifs_entry), GFP_ATOMIC); + vifs_entry = kmalloc_obj(*vifs_entry, GFP_ATOMIC); if (!vifs_entry) return; diff --git a/drivers/net/wireless/realtek/rtw89/acpi.c b/drivers/net/wireless/realtek/rtw89/acpi.c index f1e758a5f32b..0853b2e49675 100644 --- a/drivers/net/wireless/realtek/rtw89/acpi.c +++ b/drivers/net/wireless/realtek/rtw89/acpi.c @@ -115,7 +115,7 @@ rtw89_acpi_evaluate_method(struct rtw89_dev *rtwdev, const char *method) goto out; } - data = kzalloc(struct_size(data, buf, len), GFP_KERNEL); + data = kzalloc_flex(*data, buf, len, GFP_KERNEL); if (!data) goto out; diff --git a/drivers/net/wireless/realtek/rtw89/cam.c b/drivers/net/wireless/realtek/rtw89/cam.c index 9f63d67777fa..949f304216e2 100644 --- a/drivers/net/wireless/realtek/rtw89/cam.c +++ b/drivers/net/wireless/realtek/rtw89/cam.c @@ -420,7 +420,7 @@ static int rtw89_cam_sec_key_install(struct rtw89_dev *rtwdev, return ret; } - sec_cam = kzalloc(sizeof(*sec_cam), GFP_KERNEL); + sec_cam = kzalloc_obj(*sec_cam, GFP_KERNEL); if (!sec_cam) { ret = -ENOMEM; goto err_release_cam; diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 6e77522bcd8f..3295f76a0f1c 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -4220,7 +4220,7 @@ int rtw89_core_send_nullfunc(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rt if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc) return 0; - wait = kzalloc(sizeof(*wait), GFP_KERNEL); + wait = kzalloc_obj(*wait, GFP_KERNEL); if (!wait) return -ENOMEM; @@ -5657,7 +5657,7 @@ rtw89_wait_for_cond_prep(struct rtw89_wait_info *wait, unsigned int cond) if (cur != RTW89_WAIT_COND_IDLE) return ERR_PTR(-EPERM); - prep = kzalloc(sizeof(*prep), GFP_KERNEL); + prep = kzalloc_obj(*prep, GFP_KERNEL); if (!prep) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 06a9504d2bad..fb89660ba70c 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3524,7 +3524,7 @@ rtw89_debug_priv_early_h2c_set(struct rtw89_dev *rtwdev, goto out; } - early_h2c = kmalloc(sizeof(*early_h2c), GFP_KERNEL); + early_h2c = kmalloc_obj(*early_h2c, GFP_KERNEL); if (!early_h2c) { kfree(h2c); return -EFAULT; diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index f84726f04669..97c58a2fa399 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -1099,12 +1099,12 @@ int rtw89_build_phy_tbl_from_elm(struct rtw89_dev *rtwdev, else if (*pp) return 1; /* ignore if an element is existing */ - tbl = kzalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kzalloc_obj(*tbl, GFP_KERNEL); if (!tbl) return -ENOMEM; n_regs = le32_to_cpu(elm->size) / sizeof(tbl->regs[0]); - regs = kcalloc(n_regs, sizeof(*regs), GFP_KERNEL); + regs = kzalloc_objs(*regs, n_regs, GFP_KERNEL); if (!regs) goto out; @@ -1141,7 +1141,7 @@ int rtw89_fw_recognize_txpwr_from_elm(struct rtw89_dev *rtwdev, struct rtw89_txpwr_conf *conf; if (!rtwdev->rfe_data) { - rtwdev->rfe_data = kzalloc(sizeof(*rtwdev->rfe_data), GFP_KERNEL); + rtwdev->rfe_data = kzalloc_obj(*rtwdev->rfe_data, GFP_KERNEL); if (!rtwdev->rfe_data) return -ENOMEM; } @@ -1201,7 +1201,7 @@ int rtw89_build_txpwr_trk_tbl_from_elm(struct rtw89_dev *rtwdev, return -ENOENT; } - elm_info->txpwr_trk = kzalloc(sizeof(*elm_info->txpwr_trk), GFP_KERNEL); + elm_info->txpwr_trk = kzalloc_obj(*elm_info->txpwr_trk, GFP_KERNEL); if (!elm_info->txpwr_trk) return -ENOMEM; @@ -1250,7 +1250,7 @@ int rtw89_build_rfk_log_fmt_from_elm(struct rtw89_dev *rtwdev, if (elm_info->rfk_log_fmt) goto allocated; - elm_info->rfk_log_fmt = kzalloc(sizeof(*elm_info->rfk_log_fmt), GFP_KERNEL); + elm_info->rfk_log_fmt = kzalloc_obj(*elm_info->rfk_log_fmt, GFP_KERNEL); if (!elm_info->rfk_log_fmt) return 1; /* this is an optional element, so just ignore this */ @@ -2944,7 +2944,7 @@ static int rtw89_fw_h2c_add_general_pkt(struct rtw89_dev *rtwdev, struct sk_buff *skb; int ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -8138,7 +8138,7 @@ static int rtw89_append_probe_req_ie(struct rtw89_dev *rtwdev, skb_put_data(new, ies->ies[band], ies->len[band]); skb_put_data(new, ies->common_ies, ies->common_ie_len); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { ret = -ENOMEM; kfree_skb(new); @@ -8234,7 +8234,7 @@ static int rtw89_update_6ghz_rnr_chan_ax(struct rtw89_dev *rtwdev, hdr = (struct ieee80211_hdr *)skb->data; ether_addr_copy(hdr->addr3, params->bssid); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { ret = -ENOMEM; kfree_skb(skb); @@ -8527,7 +8527,7 @@ int rtw89_pno_scan_add_chan_list_ax(struct rtw89_dev *rtwdev, idx < nd_config->n_channels && list_len < RTW89_SCAN_LIST_LIMIT_AX; idx++, list_len++) { channel = nd_config->channels[idx]; - ch_info = kzalloc(sizeof(*ch_info), GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8567,7 +8567,7 @@ static int rtw89_hw_scan_add_op_types_ax(struct rtw89_dev *rtwdev, { struct rtw89_mac_chinfo_ax *tmp; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -8613,7 +8613,7 @@ int rtw89_hw_scan_prep_chan_list_ax(struct rtw89_dev *rtwdev, for (idx = 0; idx < req->n_channels; idx++) { channel = req->channels[idx]; - ch_info = kzalloc(sizeof(*ch_info), GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8745,7 +8745,7 @@ int rtw89_pno_scan_add_chan_list_be(struct rtw89_dev *rtwdev, idx < nd_config->n_channels && list_len < RTW89_SCAN_LIST_LIMIT_BE; idx++, list_len++) { channel = nd_config->channels[idx]; - ch_info = kzalloc(sizeof(*ch_info), GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8807,7 +8807,7 @@ int rtw89_hw_scan_prep_chan_list_be(struct rtw89_dev *rtwdev, !cfg80211_channel_is_psc(channel) && chan_by_rnr) continue; - ch_info = kzalloc(sizeof(*ch_info), GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); if (!ch_info) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c index 315bb0d0759f..594af3b7201b 100644 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c @@ -1666,7 +1666,7 @@ int rtw89_ops_change_vif_links(struct ieee80211_hw *hw, return -EOPNOTSUPP; if (removing_links) { - snap = kzalloc(sizeof(*snap), GFP_KERNEL); + snap = kzalloc_obj(*snap, GFP_KERNEL); if (!snap) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index 6c6d5f1da867..eb2e2191408a 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -1975,7 +1975,7 @@ void rtw89_phy_init_rf_reg(struct rtw89_dev *rtwdev, bool noio) struct rtw89_fw_h2c_rf_reg_info *rf_reg_info; u8 path; - rf_reg_info = kzalloc(sizeof(*rf_reg_info), GFP_KERNEL); + rf_reg_info = kzalloc_obj(*rf_reg_info, GFP_KERNEL); if (!rf_reg_info) return; diff --git a/drivers/net/wireless/realtek/rtw89/sar.c b/drivers/net/wireless/realtek/rtw89/sar.c index ef7feccccd5e..994ebbd8d267 100644 --- a/drivers/net/wireless/realtek/rtw89/sar.c +++ b/drivers/net/wireless/realtek/rtw89/sar.c @@ -501,7 +501,7 @@ static void rtw89_set_sar_from_acpi(struct rtw89_dev *rtwdev) struct rtw89_sar_cfg_acpi *cfg; int ret; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return; diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c index 7fdc69578da3..f91e66133b30 100644 --- a/drivers/net/wireless/realtek/rtw89/ser.c +++ b/drivers/net/wireless/realtek/rtw89/ser.c @@ -210,7 +210,7 @@ static int ser_send_msg(struct rtw89_ser *ser, u8 event) if (test_bit(RTW89_SER_DRV_STOP_RUN, ser->flags)) return -EIO; - msg = kmalloc(sizeof(*msg), GFP_ATOMIC); + msg = kmalloc_obj(*msg, GFP_ATOMIC); if (!msg) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c index e77561a4d971..95b5c1cfdce4 100644 --- a/drivers/net/wireless/realtek/rtw89/usb.c +++ b/drivers/net/wireless/realtek/rtw89/usb.c @@ -294,7 +294,7 @@ static void rtw89_usb_ops_tx_kick_off(struct rtw89_dev *rtwdev, u8 txch) if (!skb) break; - txcb = kmalloc(sizeof(*txcb), GFP_ATOMIC); + txcb = kmalloc_obj(*txcb, GFP_ATOMIC); if (!txcb) { rtw89_usb_tx_free_skb(rtwdev, txch, skb); continue; @@ -931,8 +931,8 @@ static int rtw89_usb_intf_init(struct rtw89_dev *rtwdev, if (ret) return ret; - rtwusb->vendor_req_buf = kmalloc(sizeof(*rtwusb->vendor_req_buf), - GFP_KERNEL); + rtwusb->vendor_req_buf = kmalloc_obj(*rtwusb->vendor_req_buf, + GFP_KERNEL); if (!rtwusb->vendor_req_buf) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c index b67ceda59e92..6954ca8f0b35 100644 --- a/drivers/net/wireless/realtek/rtw89/wow.c +++ b/drivers/net/wireless/realtek/rtw89/wow.c @@ -1490,7 +1490,7 @@ static int rtw89_pno_scan_update_probe_req(struct rtw89_dev *rtwdev, skb_put_data(skb, basic_rate_ie, sizeof(basic_rate_ie)); skb_put_data(skb, nd_config->ie, nd_config->ie_len); - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { kfree_skb(skb); rtw89_fw_release_pno_pkt_list(rtwdev, rtwvif_link); diff --git a/drivers/net/wireless/rsi/rsi_91x_coex.c b/drivers/net/wireless/rsi/rsi_91x_coex.c index 372eaaa2b9ef..5bc8c30f2721 100644 --- a/drivers/net/wireless/rsi/rsi_91x_coex.c +++ b/drivers/net/wireless/rsi/rsi_91x_coex.c @@ -140,7 +140,7 @@ int rsi_coex_attach(struct rsi_common *common) struct rsi_coex_ctrl_block *coex_cb; int cnt; - coex_cb = kzalloc(sizeof(*coex_cb), GFP_KERNEL); + coex_cb = kzalloc_obj(*coex_cb, GFP_KERNEL); if (!coex_cb) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c index c528e6ca2c8d..ea1766b967ee 100644 --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c @@ -285,7 +285,7 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) int ii; const struct rsi_dbg_files *files; - dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); + dev_dbgfs = kzalloc_obj(*dev_dbgfs, GFP_KERNEL); if (!dev_dbgfs) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c index 7d26314a3e76..9e65db2f6460 100644 --- a/drivers/net/wireless/rsi/rsi_91x_hal.c +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c @@ -647,7 +647,7 @@ static int bl_write_header(struct rsi_hw *adapter, u8 *flash_content, u32 write_addr, write_len; int status; - bl_hdr = kzalloc(sizeof(*bl_hdr), GFP_KERNEL); + bl_hdr = kzalloc_obj(*bl_hdr, GFP_KERNEL); if (!bl_hdr) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c index a9bb37d5d581..c936e40ac871 100644 --- a/drivers/net/wireless/rsi/rsi_91x_main.c +++ b/drivers/net/wireless/rsi/rsi_91x_main.c @@ -304,11 +304,11 @@ struct rsi_hw *rsi_91x_init(u16 oper_mode) struct rsi_common *common = NULL; u8 ii = 0; - adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); + adapter = kzalloc_obj(*adapter, GFP_KERNEL); if (!adapter) return NULL; - adapter->priv = kzalloc(sizeof(*common), GFP_KERNEL); + adapter->priv = kzalloc_obj(*common, GFP_KERNEL); if (adapter->priv == NULL) { rsi_dbg(ERR_ZONE, "%s: Failed in allocation of memory\n", __func__); diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index ee7ad81c858d..51932a434d89 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -828,7 +828,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter, struct rsi_91x_sdiodev *rsi_91x_dev; int status; - rsi_91x_dev = kzalloc(sizeof(*rsi_91x_dev), GFP_KERNEL); + rsi_91x_dev = kzalloc_obj(*rsi_91x_dev, GFP_KERNEL); if (!rsi_91x_dev) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index dccc139cabb2..b0238103c13b 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -620,7 +620,7 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter, struct rsi_91x_usbdev *rsi_dev; int status; - rsi_dev = kzalloc(sizeof(*rsi_dev), GFP_KERNEL); + rsi_dev = kzalloc_obj(*rsi_dev, GFP_KERNEL); if (!rsi_dev) return -ENOMEM; diff --git a/drivers/net/wireless/silabs/wfx/debug.c b/drivers/net/wireless/silabs/wfx/debug.c index e8265208f9a5..6475a4a42afc 100644 --- a/drivers/net/wireless/silabs/wfx/debug.c +++ b/drivers/net/wireless/silabs/wfx/debug.c @@ -291,7 +291,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf, static int wfx_send_hif_msg_open(struct inode *inode, struct file *file) { - struct dbgfs_hif_msg *context = kzalloc(sizeof(*context), GFP_KERNEL); + struct dbgfs_hif_msg *context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; diff --git a/drivers/net/wireless/st/cw1200/cw1200_sdio.c b/drivers/net/wireless/st/cw1200/cw1200_sdio.c index 00c4731d8f8e..b503112d3a3e 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_sdio.c +++ b/drivers/net/wireless/st/cw1200/cw1200_sdio.c @@ -287,7 +287,7 @@ static int cw1200_sdio_probe(struct sdio_func *func, if (func->num != 0x01) return -ENODEV; - self = kzalloc(sizeof(*self), GFP_KERNEL); + self = kzalloc_obj(*self, GFP_KERNEL); if (!self) { pr_err("Can't allocate SDIO hwbus_priv.\n"); return -ENOMEM; diff --git a/drivers/net/wireless/st/cw1200/debug.c b/drivers/net/wireless/st/cw1200/debug.c index 8686929c70df..6af080d0f21b 100644 --- a/drivers/net/wireless/st/cw1200/debug.c +++ b/drivers/net/wireless/st/cw1200/debug.c @@ -360,8 +360,8 @@ static const struct file_operations fops_wsm_dumps = { int cw1200_debug_init(struct cw1200_common *priv) { int ret = -ENOMEM; - struct cw1200_debug_priv *d = kzalloc(sizeof(struct cw1200_debug_priv), - GFP_KERNEL); + struct cw1200_debug_priv *d = kzalloc_obj(struct cw1200_debug_priv, + GFP_KERNEL); priv->debug = d; if (!d) return ret; diff --git a/drivers/net/wireless/st/cw1200/pm.c b/drivers/net/wireless/st/cw1200/pm.c index 2002e3f9fe45..ed2650b2a40b 100644 --- a/drivers/net/wireless/st/cw1200/pm.c +++ b/drivers/net/wireless/st/cw1200/pm.c @@ -207,7 +207,7 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) wsm_set_ether_type_filter(priv, &cw1200_ether_type_filter_on.hdr); /* Allocate state */ - state = kzalloc(sizeof(struct cw1200_suspend_state), GFP_KERNEL); + state = kzalloc_obj(struct cw1200_suspend_state, GFP_KERNEL); if (!state) goto revert3; diff --git a/drivers/net/wireless/st/cw1200/queue.c b/drivers/net/wireless/st/cw1200/queue.c index a933e2c7dc2c..717da9c2cad9 100644 --- a/drivers/net/wireless/st/cw1200/queue.c +++ b/drivers/net/wireless/st/cw1200/queue.c @@ -153,8 +153,7 @@ int cw1200_queue_stats_init(struct cw1200_queue_stats *stats, spin_lock_init(&stats->lock); init_waitqueue_head(&stats->wait_link_id_empty); - stats->link_map_cache = kcalloc(map_capacity, sizeof(int), - GFP_KERNEL); + stats->link_map_cache = kzalloc_objs(int, map_capacity, GFP_KERNEL); if (!stats->link_map_cache) return -ENOMEM; @@ -180,13 +179,13 @@ int cw1200_queue_init(struct cw1200_queue *queue, spin_lock_init(&queue->lock); timer_setup(&queue->gc, cw1200_queue_gc, 0); - queue->pool = kcalloc(capacity, sizeof(struct cw1200_queue_item), - GFP_KERNEL); + queue->pool = kzalloc_objs(struct cw1200_queue_item, capacity, + GFP_KERNEL); if (!queue->pool) return -ENOMEM; - queue->link_map_cache = kcalloc(stats->map_capacity, sizeof(int), - GFP_KERNEL); + queue->link_map_cache = kzalloc_objs(int, stats->map_capacity, + GFP_KERNEL); if (!queue->link_map_cache) { kfree(queue->pool); queue->pool = NULL; diff --git a/drivers/net/wireless/st/cw1200/scan.c b/drivers/net/wireless/st/cw1200/scan.c index 1f856fbbc0ea..f0b902d2ecc1 100644 --- a/drivers/net/wireless/st/cw1200/scan.c +++ b/drivers/net/wireless/st/cw1200/scan.c @@ -225,9 +225,8 @@ void cw1200_scan_work(struct work_struct *work) scan.type = WSM_SCAN_TYPE_BACKGROUND; scan.flags = WSM_SCAN_FLAG_FORCE_BACKGROUND; } - scan.ch = kcalloc(it - priv->scan.curr, - sizeof(struct wsm_scan_ch), - GFP_KERNEL); + scan.ch = kzalloc_objs(struct wsm_scan_ch, it - priv->scan.curr, + GFP_KERNEL); if (!scan.ch) { priv->scan.status = -ENOMEM; goto fail; diff --git a/drivers/net/wireless/st/cw1200/wsm.c b/drivers/net/wireless/st/cw1200/wsm.c index 4a9e4b5d3547..0b669b2f3ef4 100644 --- a/drivers/net/wireless/st/cw1200/wsm.c +++ b/drivers/net/wireless/st/cw1200/wsm.c @@ -922,7 +922,7 @@ static int wsm_event_indication(struct cw1200_common *priv, struct wsm_buf *buf) return 0; } - event = kzalloc(sizeof(struct cw1200_wsm_event), GFP_KERNEL); + event = kzalloc_obj(struct cw1200_wsm_event, GFP_KERNEL); if (!event) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index 166efac812fe..b53ac17172c4 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c @@ -18,7 +18,7 @@ int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod, wl1251_debug(DEBUG_ACX, "acx frame rates"); - rates = kzalloc(sizeof(*rates), GFP_KERNEL); + rates = kzalloc_obj(*rates, GFP_KERNEL); if (!rates) return -ENOMEM; @@ -47,7 +47,7 @@ int wl1251_acx_station_id(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx dot11_station_id"); - mac = kzalloc(sizeof(*mac), GFP_KERNEL); + mac = kzalloc_obj(*mac, GFP_KERNEL); if (!mac) return -ENOMEM; @@ -67,7 +67,7 @@ int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id) wl1251_debug(DEBUG_ACX, "acx dot11_default_key (%d)", key_id); - default_key = kzalloc(sizeof(*default_key), GFP_KERNEL); + default_key = kzalloc_obj(*default_key, GFP_KERNEL); if (!default_key) return -ENOMEM; @@ -95,7 +95,7 @@ int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event, wl1251_debug(DEBUG_ACX, "acx wake up conditions"); - wake_up = kzalloc(sizeof(*wake_up), GFP_KERNEL); + wake_up = kzalloc_obj(*wake_up, GFP_KERNEL); if (!wake_up) return -ENOMEM; @@ -121,7 +121,7 @@ int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth) wl1251_debug(DEBUG_ACX, "acx sleep auth"); - auth = kzalloc(sizeof(*auth), GFP_KERNEL); + auth = kzalloc_obj(*auth, GFP_KERNEL); if (!auth) return -ENOMEM; @@ -140,7 +140,7 @@ int wl1251_acx_fw_version(struct wl1251 *wl, char *buf, size_t len) wl1251_debug(DEBUG_ACX, "acx fw rev"); - rev = kzalloc(sizeof(*rev), GFP_KERNEL); + rev = kzalloc_obj(*rev, GFP_KERNEL); if (!rev) return -ENOMEM; @@ -167,7 +167,7 @@ int wl1251_acx_tx_power(struct wl1251 *wl, int power) if (power < 0 || power > 25) return -EINVAL; - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -191,7 +191,7 @@ int wl1251_acx_feature_cfg(struct wl1251 *wl, u32 data_flow_options) wl1251_debug(DEBUG_ACX, "acx feature cfg"); - feature = kzalloc(sizeof(*feature), GFP_KERNEL); + feature = kzalloc_obj(*feature, GFP_KERNEL); if (!feature) return -ENOMEM; @@ -233,7 +233,7 @@ int wl1251_acx_data_path_params(struct wl1251 *wl, wl1251_debug(DEBUG_ACX, "acx data path params"); - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -279,7 +279,7 @@ int wl1251_acx_rx_msdu_life_time(struct wl1251 *wl, u32 life_time) wl1251_debug(DEBUG_ACX, "acx rx msdu life time"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -303,7 +303,7 @@ int wl1251_acx_rx_config(struct wl1251 *wl, u32 config, u32 filter) wl1251_debug(DEBUG_ACX, "acx rx config"); - rx_config = kzalloc(sizeof(*rx_config), GFP_KERNEL); + rx_config = kzalloc_obj(*rx_config, GFP_KERNEL); if (!rx_config) return -ENOMEM; @@ -329,7 +329,7 @@ int wl1251_acx_pd_threshold(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx data pd threshold"); - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return -ENOMEM; @@ -353,7 +353,7 @@ int wl1251_acx_slot(struct wl1251 *wl, enum acx_slot_type slot_time) wl1251_debug(DEBUG_ACX, "acx slot"); - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) return -ENOMEM; @@ -379,7 +379,7 @@ int wl1251_acx_group_address_tbl(struct wl1251 *wl, bool enable, wl1251_debug(DEBUG_ACX, "acx group address tbl"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -405,7 +405,7 @@ int wl1251_acx_service_period_timeout(struct wl1251 *wl) struct acx_rx_timeout *rx_timeout; int ret; - rx_timeout = kzalloc(sizeof(*rx_timeout), GFP_KERNEL); + rx_timeout = kzalloc_obj(*rx_timeout, GFP_KERNEL); if (!rx_timeout) return -ENOMEM; @@ -434,7 +434,7 @@ int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold) wl1251_debug(DEBUG_ACX, "acx rts threshold"); - rts = kzalloc(sizeof(*rts), GFP_KERNEL); + rts = kzalloc_obj(*rts, GFP_KERNEL); if (!rts) return -ENOMEM; @@ -458,7 +458,7 @@ int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter) wl1251_debug(DEBUG_ACX, "acx beacon filter opt"); - beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL); + beacon_filter = kzalloc_obj(*beacon_filter, GFP_KERNEL); if (!beacon_filter) return -ENOMEM; @@ -485,7 +485,7 @@ int wl1251_acx_beacon_filter_table(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx beacon filter table"); - ie_table = kzalloc(sizeof(*ie_table), GFP_KERNEL); + ie_table = kzalloc_obj(*ie_table, GFP_KERNEL); if (!ie_table) return -ENOMEM; @@ -513,7 +513,7 @@ int wl1251_acx_conn_monit_params(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx connection monitor parameters"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -540,7 +540,7 @@ int wl1251_acx_sg_enable(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx sg enable"); - pta = kzalloc(sizeof(*pta), GFP_KERNEL); + pta = kzalloc_obj(*pta, GFP_KERNEL); if (!pta) return -ENOMEM; @@ -564,7 +564,7 @@ int wl1251_acx_sg_cfg(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx sg cfg"); - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) return -ENOMEM; @@ -616,7 +616,7 @@ int wl1251_acx_cca_threshold(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx cca threshold"); - detection = kzalloc(sizeof(*detection), GFP_KERNEL); + detection = kzalloc_obj(*detection, GFP_KERNEL); if (!detection) return -ENOMEM; @@ -639,7 +639,7 @@ int wl1251_acx_bcn_dtim_options(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx bcn dtim options"); - bb = kzalloc(sizeof(*bb), GFP_KERNEL); + bb = kzalloc_obj(*bb, GFP_KERNEL); if (!bb) return -ENOMEM; @@ -666,7 +666,7 @@ int wl1251_acx_aid(struct wl1251 *wl, u16 aid) wl1251_debug(DEBUG_ACX, "acx aid"); - acx_aid = kzalloc(sizeof(*acx_aid), GFP_KERNEL); + acx_aid = kzalloc_obj(*acx_aid, GFP_KERNEL); if (!acx_aid) return -ENOMEM; @@ -690,7 +690,7 @@ int wl1251_acx_event_mbox_mask(struct wl1251 *wl, u32 event_mask) wl1251_debug(DEBUG_ACX, "acx event mbox mask"); - mask = kzalloc(sizeof(*mask), GFP_KERNEL); + mask = kzalloc_obj(*mask, GFP_KERNEL); if (!mask) return -ENOMEM; @@ -719,7 +719,7 @@ int wl1251_acx_low_rssi(struct wl1251 *wl, s8 threshold, u8 weight, wl1251_debug(DEBUG_ACX, "acx low rssi"); - rssi = kzalloc(sizeof(*rssi), GFP_KERNEL); + rssi = kzalloc_obj(*rssi, GFP_KERNEL); if (!rssi) return -ENOMEM; @@ -743,7 +743,7 @@ int wl1251_acx_set_preamble(struct wl1251 *wl, enum acx_preamble_type preamble) wl1251_debug(DEBUG_ACX, "acx_set_preamble"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -768,7 +768,7 @@ int wl1251_acx_cts_protect(struct wl1251 *wl, wl1251_debug(DEBUG_ACX, "acx_set_ctsprotect"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -790,7 +790,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime) struct acx_tsf_info *tsf_info; int ret; - tsf_info = kzalloc(sizeof(*tsf_info), GFP_KERNEL); + tsf_info = kzalloc_obj(*tsf_info, GFP_KERNEL); if (!tsf_info) return -ENOMEM; @@ -832,7 +832,7 @@ int wl1251_acx_mem_cfg(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx mem cfg"); - mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL); + mem_conf = kzalloc_obj(*mem_conf, GFP_KERNEL); if (!mem_conf) return -ENOMEM; @@ -877,7 +877,7 @@ int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim) wl1251_debug(DEBUG_ACX, "acx tbtt and dtim"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -904,7 +904,7 @@ int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode, wl1251_debug(DEBUG_ACX, "acx bet enable"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -929,7 +929,7 @@ int wl1251_acx_arp_ip_filter(struct wl1251 *wl, bool enable, __be32 address) wl1251_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -957,7 +957,7 @@ int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max, wl1251_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " "aifs %d txop %d", ac, cw_min, cw_max, aifs, txop); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -990,7 +990,7 @@ int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue, "ps_scheme %d ack_policy %d", queue, type, tsid, ps_scheme, ack_policy); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c index c33ee0d4d323..19eb8806651f 100644 --- a/drivers/net/wireless/ti/wl1251/cmd.c +++ b/drivers/net/wireless/ti/wl1251/cmd.c @@ -133,7 +133,7 @@ int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity, wl1251_debug(DEBUG_CMD, "cmd vbm"); - vbm = kzalloc(sizeof(*vbm), GFP_KERNEL); + vbm = kzalloc_obj(*vbm, GFP_KERNEL); if (!vbm) return -ENOMEM; @@ -169,7 +169,7 @@ int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable) wl1251_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -203,7 +203,7 @@ int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable) wl1251_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -233,7 +233,7 @@ int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel, int ret, i; u8 *bssid; - join = kzalloc(sizeof(*join), GFP_KERNEL); + join = kzalloc_obj(*join, GFP_KERNEL); if (!join) return -ENOMEM; @@ -276,7 +276,7 @@ int wl1251_cmd_ps_mode(struct wl1251 *wl, u8 ps_mode) wl1251_debug(DEBUG_CMD, "cmd set ps mode"); - ps_params = kzalloc(sizeof(*ps_params), GFP_KERNEL); + ps_params = kzalloc_obj(*ps_params, GFP_KERNEL); if (!ps_params) return -ENOMEM; @@ -342,7 +342,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -409,7 +409,7 @@ int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout) wl1251_debug(DEBUG_CMD, "cmd trigger scan to"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/debugfs.c b/drivers/net/wireless/ti/wl1251/debugfs.c index a1b778a0fda0..a68d57555318 100644 --- a/drivers/net/wireless/ti/wl1251/debugfs.c +++ b/drivers/net/wireless/ti/wl1251/debugfs.c @@ -444,7 +444,7 @@ void wl1251_debugfs_reset(struct wl1251 *wl) int wl1251_debugfs_init(struct wl1251 *wl) { - wl->stats.fw_stats = kzalloc(sizeof(*wl->stats.fw_stats), GFP_KERNEL); + wl->stats.fw_stats = kzalloc_obj(*wl->stats.fw_stats, GFP_KERNEL); if (!wl->stats.fw_stats) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/event.c b/drivers/net/wireless/ti/wl1251/event.c index e945aafd88ee..6135d7c6d109 100644 --- a/drivers/net/wireless/ti/wl1251/event.c +++ b/drivers/net/wireless/ti/wl1251/event.c @@ -208,7 +208,7 @@ int wl1251_event_handle(struct wl1251 *wl, u8 mbox_num) if (mbox_num > 1) return -EINVAL; - mbox = kmalloc(sizeof(*mbox), GFP_KERNEL); + mbox = kmalloc_obj(*mbox, GFP_KERNEL); if (!mbox) { wl1251_error("can not allocate mbox buffer"); return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/init.c b/drivers/net/wireless/ti/wl1251/init.c index 5663f197ea69..0d7f08f0a41a 100644 --- a/drivers/net/wireless/ti/wl1251/init.c +++ b/drivers/net/wireless/ti/wl1251/init.c @@ -194,8 +194,7 @@ int wl1251_hw_init_mem_config(struct wl1251 *wl) if (ret < 0) return ret; - wl->target_mem_map = kzalloc(sizeof(struct wl1251_acx_mem_map), - GFP_KERNEL); + wl->target_mem_map = kzalloc_obj(struct wl1251_acx_mem_map, GFP_KERNEL); if (!wl->target_mem_map) { wl1251_error("couldn't allocate target memory map"); return -ENOMEM; @@ -261,7 +260,7 @@ static int wl1251_hw_init_tx_queue_config(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx tx queue config"); - config = kzalloc(sizeof(*config), GFP_KERNEL); + config = kzalloc_obj(*config, GFP_KERNEL); if (!config) { ret = -ENOMEM; goto out; @@ -294,8 +293,8 @@ static int wl1251_hw_init_data_path_config(struct wl1251 *wl) int ret; /* asking for the data path parameters */ - wl->data_path = kzalloc(sizeof(struct acx_data_path_params_resp), - GFP_KERNEL); + wl->data_path = kzalloc_obj(struct acx_data_path_params_resp, + GFP_KERNEL); if (!wl->data_path) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/io.c b/drivers/net/wireless/ti/wl1251/io.c index e8d567af74b4..84d497ebc7f2 100644 --- a/drivers/net/wireless/ti/wl1251/io.c +++ b/drivers/net/wireless/ti/wl1251/io.c @@ -123,7 +123,7 @@ void wl1251_set_partition(struct wl1251 *wl, { struct wl1251_partition_set *partition; - partition = kmalloc(sizeof(*partition), GFP_KERNEL); + partition = kmalloc_obj(*partition, GFP_KERNEL); if (!partition) { wl1251_error("can not allocate partition buffer"); return; diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c index 69fc51f183ad..0a5ec19f8abc 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -725,7 +725,7 @@ static u64 wl1251_op_prepare_multicast(struct ieee80211_hw *hw, if (unlikely(wl->state == WL1251_STATE_OFF)) return 0; - fp = kzalloc(sizeof(*fp), GFP_ATOMIC); + fp = kzalloc_obj(*fp, GFP_ATOMIC); if (!fp) { wl1251_error("Out of memory setting filters."); return 0; @@ -878,7 +878,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, wl1251_debug(DEBUG_MAC80211, "mac80211 set key"); - wl_cmd = kzalloc(sizeof(*wl_cmd), GFP_KERNEL); + wl_cmd = kzalloc_obj(*wl_cmd, GFP_KERNEL); if (!wl_cmd) { ret = -ENOMEM; goto out; @@ -1640,7 +1640,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void) wl->tx_mgmt_frm_rate = DEFAULT_HW_GEN_TX_RATE; wl->tx_mgmt_frm_mod = DEFAULT_HW_GEN_MODULATION_TYPE; - wl->rx_descriptor = kmalloc(sizeof(*wl->rx_descriptor), GFP_KERNEL); + wl->rx_descriptor = kmalloc_obj(*wl->rx_descriptor, GFP_KERNEL); if (!wl->rx_descriptor) { wl1251_error("could not allocate memory for rx descriptor"); ieee80211_free_hw(hw); diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c index b45050243129..1ba35c9fb34b 100644 --- a/drivers/net/wireless/ti/wl1251/sdio.c +++ b/drivers/net/wireless/ti/wl1251/sdio.c @@ -204,7 +204,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl = hw->priv; - wl_sdio = kzalloc(sizeof(*wl_sdio), GFP_KERNEL); + wl_sdio = kzalloc_obj(*wl_sdio, GFP_KERNEL); if (wl_sdio == NULL) { ret = -ENOMEM; goto out_free_hw; diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c index adb4840b0489..acd4834d8a54 100644 --- a/drivers/net/wireless/ti/wl1251/tx.c +++ b/drivers/net/wireless/ti/wl1251/tx.c @@ -451,7 +451,7 @@ void wl1251_tx_complete(struct wl1251 *wl) if (unlikely(wl->state != WL1251_STATE_ON)) return; - result = kmalloc_array(FW_TX_CMPLT_BLOCK_SIZE, sizeof(*result), GFP_KERNEL); + result = kmalloc_objs(*result, FW_TX_CMPLT_BLOCK_SIZE, GFP_KERNEL); if (!result) { wl1251_error("can not allocate result buffer"); return; diff --git a/drivers/net/wireless/ti/wl12xx/acx.c b/drivers/net/wireless/ti/wl12xx/acx.c index fb830d01b8ff..74e16f8c8b22 100644 --- a/drivers/net/wireless/ti/wl12xx/acx.c +++ b/drivers/net/wireless/ti/wl12xx/acx.c @@ -17,7 +17,7 @@ int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap) struct wl1271_acx_host_config_bitmap *bitmap_conf; int ret; - bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL); + bitmap_conf = kzalloc_obj(*bitmap_conf, GFP_KERNEL); if (!bitmap_conf) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl12xx/cmd.c b/drivers/net/wireless/ti/wl12xx/cmd.c index 17434b3bb10b..d57f420baa60 100644 --- a/drivers/net/wireless/ti/wl12xx/cmd.c +++ b/drivers/net/wireless/ti/wl12xx/cmd.c @@ -22,7 +22,7 @@ int wl1271_cmd_ext_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - ext_radio_parms = kzalloc(sizeof(*ext_radio_parms), GFP_KERNEL); + ext_radio_parms = kzalloc_obj(*ext_radio_parms, GFP_KERNEL); if (!ext_radio_parms) return -ENOMEM; @@ -63,7 +63,7 @@ int wl1271_cmd_general_parms(struct wl1271 *wl) return -EINVAL; } - gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL); + gen_parms = kzalloc_obj(*gen_parms, GFP_KERNEL); if (!gen_parms) return -ENOMEM; @@ -130,7 +130,7 @@ int wl128x_cmd_general_parms(struct wl1271 *wl) return -EINVAL; } - gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL); + gen_parms = kzalloc_obj(*gen_parms, GFP_KERNEL); if (!gen_parms) return -ENOMEM; @@ -191,7 +191,7 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - radio_parms = kzalloc(sizeof(*radio_parms), GFP_KERNEL); + radio_parms = kzalloc_obj(*radio_parms, GFP_KERNEL); if (!radio_parms) return -ENOMEM; @@ -235,7 +235,7 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - radio_parms = kzalloc(sizeof(*radio_parms), GFP_KERNEL); + radio_parms = kzalloc_obj(*radio_parms, GFP_KERNEL); if (!radio_parms) return -ENOMEM; @@ -280,7 +280,7 @@ int wl12xx_cmd_channel_switch(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "cmd channel switch"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index ffbf54776330..f766845e2451 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -1882,7 +1882,7 @@ static int wl12xx_setup(struct wl1271 *wl) wl1271_error("Invalid tcxo parameter %s", tcxo_param); } - priv->rx_mem_addr = kmalloc(sizeof(*priv->rx_mem_addr), GFP_KERNEL); + priv->rx_mem_addr = kmalloc_obj(*priv->rx_mem_addr, GFP_KERNEL); if (!priv->rx_mem_addr) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c index 6c18e8552e4a..021c547bbab8 100644 --- a/drivers/net/wireless/ti/wl12xx/scan.c +++ b/drivers/net/wireless/ti/wl12xx/scan.c @@ -91,8 +91,8 @@ static int wl1271_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (!passive && wl->scan.req->n_ssids == 0) return WL1271_NOTHING_TO_SCAN; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); - trigger = kzalloc(sizeof(*trigger), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); + trigger = kzalloc_obj(*trigger, GFP_KERNEL); if (!cmd || !trigger) { ret = -ENOMEM; goto out; @@ -184,7 +184,7 @@ int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd scan stop"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -317,7 +317,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config"); - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; @@ -348,7 +348,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, wl1271_debug(DEBUG_SCAN, "filter_type = %d", cfg->filter_type); - cfg_channels = kzalloc(sizeof(*cfg_channels), GFP_KERNEL); + cfg_channels = kzalloc_obj(*cfg_channels, GFP_KERNEL); if (!cfg_channels) { ret = -ENOMEM; goto out; @@ -425,7 +425,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) return -EBUSY; - start = kzalloc(sizeof(*start), GFP_KERNEL); + start = kzalloc_obj(*start, GFP_KERNEL); if (!start) return -ENOMEM; @@ -465,7 +465,7 @@ void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd periodic scan stop"); /* FIXME: what to do if alloc'ing to stop fails? */ - stop = kzalloc(sizeof(*stop), GFP_KERNEL); + stop = kzalloc_obj(*stop, GFP_KERNEL); if (!stop) { wl1271_error("failed to alloc memory to send sched scan stop"); return; diff --git a/drivers/net/wireless/ti/wl18xx/acx.c b/drivers/net/wireless/ti/wl18xx/acx.c index d1deef02f43e..f29dd27814f5 100644 --- a/drivers/net/wireless/ti/wl18xx/acx.c +++ b/drivers/net/wireless/ti/wl18xx/acx.c @@ -23,7 +23,7 @@ int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap, host_cfg_bitmap, sdio_blk_size, extra_mem_blks, len_field_size); - bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL); + bitmap_conf = kzalloc_obj(*bitmap_conf, GFP_KERNEL); if (!bitmap_conf) { ret = -ENOMEM; goto out; @@ -54,7 +54,7 @@ int wl18xx_acx_set_checksum_state(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx checksum state"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -80,7 +80,7 @@ int wl18xx_acx_clear_statistics(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx clear statistics"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -105,7 +105,7 @@ int wl18xx_acx_peer_ht_operation_mode(struct wl1271 *wl, u8 hlid, bool wide) wl1271_debug(DEBUG_ACX, "acx peer ht operation mode hlid %d bw %d", hlid, wide); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -146,7 +146,7 @@ int wl18xx_acx_set_peer_cap(struct wl1271 *wl, "acx set cap ht_supp: %d ht_cap: %d rates: 0x%x", ht_cap->ht_supported, ht_cap->cap, rate_set); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -192,7 +192,7 @@ int wl18xx_acx_interrupt_notify_config(struct wl1271 *wl, struct wl18xx_acx_interrupt_notify *acx; int ret = 0; - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -219,7 +219,7 @@ int wl18xx_acx_rx_ba_filter(struct wl1271 *wl, bool action) struct wl18xx_acx_rx_ba_filter *acx; int ret = 0; - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -247,7 +247,7 @@ int wl18xx_acx_ap_sleep(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx config ap sleep"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -277,7 +277,7 @@ int wl18xx_acx_dynamic_fw_traces(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx dynamic fw traces config %d", wl->dynamic_fw_traces); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -305,7 +305,7 @@ int wl18xx_acx_time_sync_cfg(struct wl1271 *wl) wl->conf.sg.params[WL18XX_CONF_SG_TIME_SYNC], wl->zone_master_mac_addr); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl18xx/cmd.c b/drivers/net/wireless/ti/wl18xx/cmd.c index 5f8620d90052..5a1dc648fd57 100644 --- a/drivers/net/wireless/ti/wl18xx/cmd.c +++ b/drivers/net/wireless/ti/wl18xx/cmd.c @@ -22,7 +22,7 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "cmd channel switch (count=%d)", ch_switch->count); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -78,7 +78,7 @@ int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap) wl1271_debug(DEBUG_CMD, "cmd smart config start group_bitmap=0x%x", group_bitmap); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -105,7 +105,7 @@ int wl18xx_cmd_smart_config_stop(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd smart config stop"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -137,7 +137,7 @@ int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id, return -E2BIG; } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -167,7 +167,7 @@ int wl18xx_cmd_set_cac(struct wl1271 *wl, struct wl12xx_vif *wlvif, bool start) wl1271_debug(DEBUG_CMD, "cmd cac (channel %d) %s", wlvif->channel, start ? "start" : "stop"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -198,7 +198,7 @@ int wl18xx_cmd_radar_detection_debug(struct wl1271 *wl, u8 channel) wl1271_debug(DEBUG_CMD, "cmd radar detection debug (chan %d)", channel); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -224,7 +224,7 @@ int wl18xx_cmd_dfs_master_restart(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd dfs master restart (role %d)", wlvif->role_id); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c index d9f4b715abf6..7e61403aa374 100644 --- a/drivers/net/wireless/ti/wl18xx/scan.c +++ b/drivers/net/wireless/ti/wl18xx/scan.c @@ -31,7 +31,7 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct wlcore_scan_channels *cmd_channels = NULL; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -67,7 +67,7 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, /* configure channels */ WARN_ON(req->n_ssids > 1); - cmd_channels = kzalloc(sizeof(*cmd_channels), GFP_KERNEL); + cmd_channels = kzalloc_obj(*cmd_channels, GFP_KERNEL); if (!cmd_channels) { ret = -ENOMEM; goto out; @@ -169,7 +169,7 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl, if (filter_type < 0) return filter_type; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -201,7 +201,7 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl, /* don't stop scanning automatically when something is found */ cmd->terminate_after = 0; - cmd_channels = kzalloc(sizeof(*cmd_channels), GFP_KERNEL); + cmd_channels = kzalloc_obj(*cmd_channels, GFP_KERNEL); if (!cmd_channels) { ret = -ENOMEM; goto out; @@ -301,7 +301,7 @@ static int __wl18xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd periodic scan stop"); - stop = kzalloc(sizeof(*stop), GFP_KERNEL); + stop = kzalloc_obj(*stop, GFP_KERNEL); if (!stop) { wl1271_error("failed to alloc memory to send sched scan stop"); return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c index e820fe694121..65d1df37828d 100644 --- a/drivers/net/wireless/ti/wlcore/acx.c +++ b/drivers/net/wireless/ti/wlcore/acx.c @@ -28,7 +28,7 @@ int wl1271_acx_wake_up_conditions(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx wake up conditions (wake_up_event %d listen_interval %d)", wake_up_event, listen_interval); - wake_up = kzalloc(sizeof(*wake_up), GFP_KERNEL); + wake_up = kzalloc_obj(*wake_up, GFP_KERNEL); if (!wake_up) { ret = -ENOMEM; goto out; @@ -57,7 +57,7 @@ int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth) wl1271_debug(DEBUG_ACX, "acx sleep auth %d", sleep_auth); - auth = kzalloc(sizeof(*auth), GFP_KERNEL); + auth = kzalloc_obj(*auth, GFP_KERNEL); if (!auth) { ret = -ENOMEM; goto out; @@ -90,7 +90,7 @@ int wl1271_acx_tx_power(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (power < 0 || power > 25) return -EINVAL; - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -117,7 +117,7 @@ int wl1271_acx_feature_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx feature cfg"); - feature = kzalloc(sizeof(*feature), GFP_KERNEL); + feature = kzalloc_obj(*feature, GFP_KERNEL); if (!feature) { ret = -ENOMEM; goto out; @@ -162,7 +162,7 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx rx msdu life time"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -189,7 +189,7 @@ int wl1271_acx_slot(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx slot"); - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) { ret = -ENOMEM; goto out; @@ -218,7 +218,7 @@ int wl1271_acx_group_address_tbl(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx group address tbl"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -248,7 +248,7 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl, struct acx_rx_timeout *rx_timeout; int ret; - rx_timeout = kzalloc(sizeof(*rx_timeout), GFP_KERNEL); + rx_timeout = kzalloc_obj(*rx_timeout, GFP_KERNEL); if (!rx_timeout) { ret = -ENOMEM; goto out; @@ -288,7 +288,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx rts threshold: %d", rts_threshold); - rts = kzalloc(sizeof(*rts), GFP_KERNEL); + rts = kzalloc_obj(*rts, GFP_KERNEL); if (!rts) { ret = -ENOMEM; goto out; @@ -316,7 +316,7 @@ int wl1271_acx_dco_itrim_params(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx dco itrim parameters"); - dco = kzalloc(sizeof(*dco), GFP_KERNEL); + dco = kzalloc_obj(*dco, GFP_KERNEL); if (!dco) { ret = -ENOMEM; goto out; @@ -350,7 +350,7 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED) goto out; - beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL); + beacon_filter = kzalloc_obj(*beacon_filter, GFP_KERNEL); if (!beacon_filter) { ret = -ENOMEM; goto out; @@ -387,7 +387,7 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx beacon filter table"); - ie_table = kzalloc(sizeof(*ie_table), GFP_KERNEL); + ie_table = kzalloc_obj(*ie_table, GFP_KERNEL); if (!ie_table) { ret = -ENOMEM; goto out; @@ -446,7 +446,7 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx connection monitor parameters: %s", enable ? "enabled" : "disabled"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -482,7 +482,7 @@ int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable) wl1271_debug(DEBUG_ACX, "acx sg enable"); - pta = kzalloc(sizeof(*pta), GFP_KERNEL); + pta = kzalloc_obj(*pta, GFP_KERNEL); if (!pta) { ret = -ENOMEM; goto out; @@ -512,7 +512,7 @@ int wl12xx_acx_sg_cfg(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx sg cfg"); - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) { ret = -ENOMEM; goto out; @@ -541,7 +541,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx cca threshold"); - detection = kzalloc(sizeof(*detection), GFP_KERNEL); + detection = kzalloc_obj(*detection, GFP_KERNEL); if (!detection) { ret = -ENOMEM; goto out; @@ -567,7 +567,7 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx bcn dtim options"); - bb = kzalloc(sizeof(*bb), GFP_KERNEL); + bb = kzalloc_obj(*bb, GFP_KERNEL); if (!bb) { ret = -ENOMEM; goto out; @@ -597,7 +597,7 @@ int wl1271_acx_aid(struct wl1271 *wl, struct wl12xx_vif *wlvif, u16 aid) wl1271_debug(DEBUG_ACX, "acx aid"); - acx_aid = kzalloc(sizeof(*acx_aid), GFP_KERNEL); + acx_aid = kzalloc_obj(*acx_aid, GFP_KERNEL); if (!acx_aid) { ret = -ENOMEM; goto out; @@ -624,7 +624,7 @@ int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask) wl1271_debug(DEBUG_ACX, "acx event mbox mask"); - mask = kzalloc(sizeof(*mask), GFP_KERNEL); + mask = kzalloc_obj(*mask, GFP_KERNEL); if (!mask) { ret = -ENOMEM; goto out; @@ -654,7 +654,7 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx_set_preamble"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -682,7 +682,7 @@ int wl1271_acx_cts_protect(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx_set_ctsprotect"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -727,7 +727,7 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx rate policies"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; @@ -798,7 +798,7 @@ int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, wl1271_debug(DEBUG_ACX, "acx ap rate policy %d rates 0x%x", idx, c->enabled_rates); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -831,7 +831,7 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " "aifs %d txop %d", ac, cw_min, cw_max, aifsn, txop); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; @@ -866,7 +866,7 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx tid config"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; @@ -907,7 +907,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl, u32 frag_threshold) wl1271_debug(DEBUG_ACX, "acx frag threshold: %d", frag_threshold); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; @@ -933,7 +933,7 @@ int wl1271_acx_tx_config_options(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx tx config options"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; @@ -961,7 +961,7 @@ int wl12xx_acx_mem_cfg(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "wl1271 mem cfg"); - mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL); + mem_conf = kzalloc_obj(*mem_conf, GFP_KERNEL); if (!mem_conf) { ret = -ENOMEM; goto out; @@ -998,8 +998,7 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl) { int ret; - wl->target_mem_map = kzalloc(sizeof(struct wl1271_acx_mem_map), - GFP_KERNEL); + wl->target_mem_map = kzalloc_obj(struct wl1271_acx_mem_map, GFP_KERNEL); if (!wl->target_mem_map) { wl1271_error("couldn't allocate target memory map"); return -ENOMEM; @@ -1032,7 +1031,7 @@ int wl1271_acx_init_rx_interrupt(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "wl1271 rx interrupt config"); - rx_conf = kzalloc(sizeof(*rx_conf), GFP_KERNEL); + rx_conf = kzalloc_obj(*rx_conf, GFP_KERNEL); if (!rx_conf) { ret = -ENOMEM; goto out; @@ -1066,7 +1065,7 @@ int wl1271_acx_bet_enable(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (enable && wl->conf.conn.bet_enable == CONF_BET_MODE_DISABLE) goto out; - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1095,7 +1094,7 @@ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1128,7 +1127,7 @@ int wl1271_acx_pm_config(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx pm config"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1157,7 +1156,7 @@ int wl1271_acx_keep_alive_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx keep alive mode: %d", enable); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1185,7 +1184,7 @@ int wl1271_acx_keep_alive_config(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx keep alive config"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1217,7 +1216,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx rssi snr trigger"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1259,7 +1258,7 @@ int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx rssi snr avg weights"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1294,7 +1293,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, "sta supp: %d sta cap: %d", ht_cap->ht_supported, ht_cap->cap); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1340,7 +1339,7 @@ int wl1271_acx_set_ht_information(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx ht information setting"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1376,7 +1375,7 @@ int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx ba initiator policy"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1412,7 +1411,7 @@ int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index, wl1271_debug(DEBUG_ACX, "acx ba receiver session setting"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1451,7 +1450,7 @@ int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct wl12xx_acx_fw_tsf_information *tsf_info; int ret; - tsf_info = kzalloc(sizeof(*tsf_info), GFP_KERNEL); + tsf_info = kzalloc_obj(*tsf_info, GFP_KERNEL); if (!tsf_info) { ret = -ENOMEM; goto out; @@ -1483,7 +1482,7 @@ int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx ps rx streaming"); - rx_streaming = kzalloc(sizeof(*rx_streaming), GFP_KERNEL); + rx_streaming = kzalloc_obj(*rx_streaming, GFP_KERNEL); if (!rx_streaming) { ret = -ENOMEM; goto out; @@ -1530,7 +1529,7 @@ int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx ap max tx retry"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -1555,7 +1554,7 @@ int wl12xx_acx_config_ps(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx config ps"); - config_ps = kzalloc(sizeof(*config_ps), GFP_KERNEL); + config_ps = kzalloc_obj(*config_ps, GFP_KERNEL); if (!config_ps) { ret = -ENOMEM; goto out; @@ -1586,7 +1585,7 @@ int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx set inconnaction sta %pM", addr); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -1612,7 +1611,7 @@ int wl1271_acx_fm_coex(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx fm coex setting"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1653,7 +1652,7 @@ int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx set rate mgmt params"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; @@ -1695,7 +1694,7 @@ int wl12xx_acx_config_hangover(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx config hangover"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1735,7 +1734,7 @@ int wlcore_acx_average_rssi(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx roaming statistics"); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; @@ -1767,7 +1766,7 @@ int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, wl1271_debug(DEBUG_ACX, "acx default rx filter en: %d act: %d", enable, action); - acx = kzalloc(sizeof(*acx), GFP_KERNEL); + acx = kzalloc_obj(*acx, GFP_KERNEL); if (!acx) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index 9d73ba933a16..ded64bf9c5a6 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c @@ -172,7 +172,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, *timeout = false; - events_vector = kmalloc(sizeof(*events_vector), GFP_KERNEL | GFP_DMA); + events_vector = kmalloc_obj(*events_vector, GFP_KERNEL | GFP_DMA); if (!events_vector) return -ENOMEM; @@ -231,7 +231,7 @@ int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 *addr, u8 role_type, if (WARN_ON(*role_id != WL12XX_INVALID_ROLE_ID)) return -EBUSY; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -273,7 +273,7 @@ int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id) if (WARN_ON(*role_id == WL12XX_INVALID_ROLE_ID)) return -ENOENT; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -431,7 +431,7 @@ static int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_cmd_role_start *cmd; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -483,7 +483,7 @@ static int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, if (WARN_ON(wlvif->dev_hlid == WL12XX_INVALID_LINK_ID)) return -EINVAL; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -517,7 +517,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) u32 supported_rates; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -594,7 +594,7 @@ int wl12xx_cmd_role_stop_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) if (WARN_ON(wlvif->sta.hlid == WL12XX_INVALID_LINK_ID)) return -EINVAL; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -641,7 +641,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) } } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -736,7 +736,7 @@ int wl12xx_cmd_role_stop_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) struct wl12xx_cmd_role_stop *cmd; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -769,7 +769,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif) struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; int ret; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -942,7 +942,7 @@ int wl1271_cmd_data_path(struct wl1271 *wl, bool enable) wl1271_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -993,7 +993,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd set ps mode"); - ps_params = kzalloc(sizeof(*ps_params), GFP_KERNEL); + ps_params = kzalloc_obj(*ps_params, GFP_KERNEL); if (!ps_params) { ret = -ENOMEM; goto out; @@ -1028,7 +1028,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u8 role_id, WARN_ON(buf_len > WL1271_CMD_TEMPL_MAX_SIZE); buf_len = min_t(size_t, buf_len, WL1271_CMD_TEMPL_MAX_SIZE); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1340,7 +1340,7 @@ int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid) wl1271_debug(DEBUG_CMD, "cmd set_default_wep_key %d", id); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1376,7 +1376,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) return 0; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1442,7 +1442,7 @@ int wl1271_cmd_set_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, int ret = 0; u8 lid_type; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -1505,7 +1505,7 @@ int wl12xx_cmd_set_peer_state(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd set peer state (hlid=%d)", hlid); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1540,7 +1540,7 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd add peer %d", (int)hlid); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1599,7 +1599,7 @@ int wl12xx_cmd_remove_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd remove peer %d", (int)hlid); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1733,7 +1733,7 @@ int wlcore_cmd_regdomain_config_locked(struct wl1271 *wl) if (!memcmp(tmp_ch_bitmap, wl->reg_ch_conf_last, sizeof(tmp_ch_bitmap))) goto out; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1778,7 +1778,7 @@ int wl12xx_cmd_config_fwlog(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd config firmware logger"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1810,7 +1810,7 @@ int wl12xx_cmd_stop_fwlog(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd stop firmware logger"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1840,7 +1840,7 @@ static int wl12xx_cmd_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (WARN_ON(role_id == WL12XX_INVALID_ROLE_ID)) return -EINVAL; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1882,7 +1882,7 @@ static int wl12xx_cmd_croc(struct wl1271 *wl, u8 role_id) wl1271_debug(DEBUG_CMD, "cmd croc (%d)", role_id); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -1951,7 +1951,7 @@ int wl12xx_cmd_stop_channel_switch(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "cmd stop channel switch"); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; @@ -2055,7 +2055,7 @@ int wlcore_cmd_generic_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, "cmd generic cfg (role %d feature %d enable %d value %d)", wlvif->role_id, feature, enable, value); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c index 03b49baa9d89..3f544a900f67 100644 --- a/drivers/net/wireless/ti/wlcore/init.c +++ b/drivers/net/wireless/ti/wlcore/init.c @@ -148,7 +148,7 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl, int ret; u32 rate; - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); if (!tmpl) { ret = -ENOMEM; goto out; @@ -175,7 +175,7 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl, int ret; u32 rate; - nullfunc = kzalloc(sizeof(*nullfunc), GFP_KERNEL); + nullfunc = kzalloc_obj(*nullfunc, GFP_KERNEL); if (!nullfunc) { ret = -ENOMEM; goto out; @@ -208,7 +208,7 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl, int ret; u32 rate; - qosnull = kzalloc(sizeof(*qosnull), GFP_KERNEL); + qosnull = kzalloc_obj(*qosnull, GFP_KERNEL); if (!qosnull) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index dce79bce2e3f..82e035aea874 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1070,11 +1070,11 @@ static int wl1271_setup(struct wl1271 *wl) if (!wl->raw_fw_status) goto err; - wl->fw_status = kzalloc(sizeof(*wl->fw_status), GFP_KERNEL); + wl->fw_status = kzalloc_obj(*wl->fw_status, GFP_KERNEL); if (!wl->fw_status) goto err; - wl->tx_res_if = kzalloc(sizeof(*wl->tx_res_if), GFP_KERNEL); + wl->tx_res_if = kzalloc_obj(*wl->tx_res_if, GFP_KERNEL); if (!wl->tx_res_if) goto err; @@ -1477,7 +1477,7 @@ wl1271_validate_wowlan_pattern(struct cfg80211_pkt_pattern *p) struct wl12xx_rx_filter *wl1271_rx_filter_alloc(void) { - return kzalloc(sizeof(struct wl12xx_rx_filter), GFP_KERNEL); + return kzalloc_obj(struct wl12xx_rx_filter, GFP_KERNEL); } void wl1271_rx_filter_free(struct wl12xx_rx_filter *filter) @@ -3215,7 +3215,7 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, struct wl1271_filter_params *fp; struct netdev_hw_addr *ha; - fp = kzalloc(sizeof(*fp), GFP_ATOMIC); + fp = kzalloc_obj(*fp, GFP_ATOMIC); if (!fp) { wl1271_error("Out of memory setting filters."); return 0; @@ -3346,7 +3346,7 @@ static int wl1271_record_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (i == MAX_NUM_KEYS) return -EBUSY; - ap_key = kzalloc(sizeof(*ap_key), GFP_KERNEL); + ap_key = kzalloc_obj(*ap_key, GFP_KERNEL); if (!ap_key) return -ENOMEM; @@ -6459,7 +6459,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size, goto err_fwlog; } - wl->buffer_32 = kmalloc(sizeof(*wl->buffer_32), GFP_KERNEL); + wl->buffer_32 = kmalloc_obj(*wl->buffer_32, GFP_KERNEL); if (!wl->buffer_32) { ret = -ENOMEM; goto err_mbox; diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c index f6dc54c1dbad..7cd58bb0efb6 100644 --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c @@ -389,7 +389,7 @@ wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl, goto out; } - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c index 7c0cb1b7fef0..caca2786d07c 100644 --- a/drivers/net/wireless/ti/wlcore/testmode.c +++ b/drivers/net/wireless/ti/wlcore/testmode.c @@ -159,7 +159,7 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]) if (ret < 0) goto out; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { ret = -ENOMEM; goto out_sleep; diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index 4d9f5f87e814..f4f37f71285e 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -6489,7 +6489,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) if (info->attrs[HWSIM_ATTR_PMSR_SUPPORT]) { struct cfg80211_pmsr_capabilities *pmsr_capa; - pmsr_capa = kmalloc(sizeof(*pmsr_capa), GFP_KERNEL); + pmsr_capa = kmalloc_obj(*pmsr_capa, GFP_KERNEL); if (!pmsr_capa) { ret = -ENOMEM; goto out_free; diff --git a/drivers/net/wireless/virtual/virt_wifi.c b/drivers/net/wireless/virtual/virt_wifi.c index 4eae89376feb..eac81ebf9551 100644 --- a/drivers/net/wireless/virtual/virt_wifi.c +++ b/drivers/net/wireless/virtual/virt_wifi.c @@ -558,7 +558,7 @@ static int virt_wifi_newlink(struct net_device *dev, netif_stacked_transfer_operstate(priv->lowerdev, dev); SET_NETDEV_DEV(dev, &priv->lowerdev->dev); - dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL); + dev->ieee80211_ptr = kzalloc_obj(*dev->ieee80211_ptr, GFP_KERNEL); if (!dev->ieee80211_ptr) { err = -ENOMEM; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c index 0f6271d7259b..f5063efc8e42 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c @@ -722,8 +722,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon, /* Alloc memory for full beacon write at once. */ num_cmds = 1 + zd_chip_is_zd1211b(&mac->chip) + full_len; - ioreqs = kmalloc_array(num_cmds, sizeof(struct zd_ioreq32), - GFP_KERNEL); + ioreqs = kmalloc_objs(struct zd_ioreq32, num_cmds, GFP_KERNEL); if (!ioreqs) { r = -ENOMEM; goto out_nofree; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c b/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c index a4e7f187d82d..d15d95ff5aad 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c @@ -518,7 +518,7 @@ int zd_rf_init_uw2453(struct zd_rf *rf) /* we have our own TX integration code */ rf->update_channel_int = 0; - rf->priv = kmalloc(sizeof(struct uw2453_priv), GFP_KERNEL); + rf->priv = kmalloc_obj(struct uw2453_priv, GFP_KERNEL); if (rf->priv == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c index 8ee15a15f4ca..e5c3be14ae4e 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c @@ -752,7 +752,7 @@ static int __zd_usb_enable_rx(struct zd_usb *usb) dev_dbg_f(zd_usb_dev(usb), "\n"); r = -ENOMEM; - urbs = kcalloc(RX_URBS_COUNT, sizeof(struct urb *), GFP_KERNEL); + urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT, GFP_KERNEL); if (!urbs) goto error; for (i = 0; i < RX_URBS_COUNT; i++) { diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.c b/drivers/net/wwan/iosm/iosm_ipc_imem.c index 530a3ea47a1a..f354e4514565 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_imem.c +++ b/drivers/net/wwan/iosm/iosm_ipc_imem.c @@ -1334,7 +1334,7 @@ static int ipc_imem_config(struct iosm_imem *ipc_imem) struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id, void __iomem *mmio, struct device *dev) { - struct iosm_imem *ipc_imem = kzalloc(sizeof(*pcie->imem), GFP_KERNEL); + struct iosm_imem *ipc_imem = kzalloc_obj(*pcie->imem, GFP_KERNEL); enum ipc_mem_exec_stage stage; if (!ipc_imem) @@ -1359,8 +1359,7 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id, goto mmio_init_fail; } - ipc_imem->ipc_task = kzalloc(sizeof(*ipc_imem->ipc_task), - GFP_KERNEL); + ipc_imem->ipc_task = kzalloc_obj(*ipc_imem->ipc_task, GFP_KERNEL); /* Create tasklet for event handling*/ if (!ipc_imem->ipc_task) diff --git a/drivers/net/wwan/iosm/iosm_ipc_mmio.c b/drivers/net/wwan/iosm/iosm_ipc_mmio.c index 6764c13530b9..3319d7423101 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mmio.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mmio.c @@ -82,7 +82,7 @@ void ipc_mmio_update_cp_capability(struct iosm_mmio *ipc_mmio) struct iosm_mmio *ipc_mmio_init(void __iomem *mmio, struct device *dev) { - struct iosm_mmio *ipc_mmio = kzalloc(sizeof(*ipc_mmio), GFP_KERNEL); + struct iosm_mmio *ipc_mmio = kzalloc_obj(*ipc_mmio, GFP_KERNEL); int retries = IPC_MMIO_EXEC_STAGE_TIMEOUT; enum ipc_mem_exec_stage stage; diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux.c b/drivers/net/wwan/iosm/iosm_ipc_mux.c index b846889fcb09..d370c7b7810a 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux.c @@ -278,7 +278,7 @@ out: struct iosm_mux *ipc_mux_init(struct ipc_mux_config *mux_cfg, struct iosm_imem *imem) { - struct iosm_mux *ipc_mux = kzalloc(sizeof(*ipc_mux), GFP_KERNEL); + struct iosm_mux *ipc_mux = kzalloc_obj(*ipc_mux, GFP_KERNEL); int i, j, ul_tds, ul_td_size; struct sk_buff_head *free_list; struct sk_buff *skb; diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c index 08ff0d6ccfab..f7f693c2296a 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c +++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c @@ -260,7 +260,7 @@ default_ret: static int ipc_pcie_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct iosm_pcie *ipc_pcie = kzalloc(sizeof(*ipc_pcie), GFP_KERNEL); + struct iosm_pcie *ipc_pcie = kzalloc_obj(*ipc_pcie, GFP_KERNEL); int ret; pr_debug("Probing device 0x%X from the vendor 0x%X", pci_id->device, diff --git a/drivers/net/wwan/iosm/iosm_ipc_port.c b/drivers/net/wwan/iosm/iosm_ipc_port.c index 5d5b4183e14a..bf75d8b94682 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_port.c +++ b/drivers/net/wwan/iosm/iosm_ipc_port.c @@ -48,7 +48,7 @@ static const struct wwan_port_ops ipc_wwan_ctrl_ops = { struct iosm_cdev *ipc_port_init(struct iosm_imem *ipc_imem, struct ipc_chnl_cfg ipc_port_cfg) { - struct iosm_cdev *ipc_port = kzalloc(sizeof(*ipc_port), GFP_KERNEL); + struct iosm_cdev *ipc_port = kzalloc_obj(*ipc_port, GFP_KERNEL); enum wwan_port_type port_type = ipc_port_cfg.wwan_port_type; enum ipc_channel_id chl_id = ipc_port_cfg.id; diff --git a/drivers/net/wwan/iosm/iosm_ipc_protocol.c b/drivers/net/wwan/iosm/iosm_ipc_protocol.c index 63fc7012f09f..851a24641c35 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_protocol.c +++ b/drivers/net/wwan/iosm/iosm_ipc_protocol.c @@ -222,8 +222,8 @@ bool ipc_protocol_resume(struct iosm_protocol *ipc_protocol) struct iosm_protocol *ipc_protocol_init(struct iosm_imem *ipc_imem) { - struct iosm_protocol *ipc_protocol = - kzalloc(sizeof(*ipc_protocol), GFP_KERNEL); + struct iosm_protocol *ipc_protocol = kzalloc_obj(*ipc_protocol, + GFP_KERNEL); struct ipc_protocol_context_info *p_ci; u64 addr; diff --git a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c index 4627847c6daa..f2f86f41fd10 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c +++ b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c @@ -69,7 +69,7 @@ static int ipc_protocol_msg_prepipe_open(struct iosm_protocol *ipc_protocol, * SKB ring is internal memory allocation for driver. No need to * re-calculate the start and end addresses. */ - skbr = kcalloc(pipe->nr_of_entries, sizeof(*skbr), GFP_ATOMIC); + skbr = kzalloc_objs(*skbr, pipe->nr_of_entries, GFP_ATOMIC); if (!skbr) return -ENOMEM; diff --git a/drivers/net/wwan/iosm/iosm_ipc_task_queue.c b/drivers/net/wwan/iosm/iosm_ipc_task_queue.c index 852a99166144..f9c1837781e5 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_task_queue.c +++ b/drivers/net/wwan/iosm/iosm_ipc_task_queue.c @@ -174,8 +174,7 @@ int ipc_task_init(struct ipc_task *ipc_task) { struct ipc_task_queue *ipc_queue = &ipc_task->ipc_queue; - ipc_task->ipc_tasklet = kzalloc(sizeof(*ipc_task->ipc_tasklet), - GFP_KERNEL); + ipc_task->ipc_tasklet = kzalloc_obj(*ipc_task->ipc_tasklet, GFP_KERNEL); if (!ipc_task->ipc_tasklet) return -ENOMEM; diff --git a/drivers/net/wwan/iosm/iosm_ipc_trace.c b/drivers/net/wwan/iosm/iosm_ipc_trace.c index 9656254c1c6c..c6368131d786 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_trace.c +++ b/drivers/net/wwan/iosm/iosm_ipc_trace.c @@ -140,7 +140,7 @@ struct iosm_trace *ipc_trace_init(struct iosm_imem *ipc_imem) ipc_imem_channel_init(ipc_imem, IPC_CTYPE_CTRL, chnl_cfg, IRQ_MOD_OFF); - ipc_trace = kzalloc(sizeof(*ipc_trace), GFP_KERNEL); + ipc_trace = kzalloc_obj(*ipc_trace, GFP_KERNEL); if (!ipc_trace) return NULL; diff --git a/drivers/net/wwan/iosm/iosm_ipc_uevent.c b/drivers/net/wwan/iosm/iosm_ipc_uevent.c index d12188ffed7e..4073b70e2457 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_uevent.c +++ b/drivers/net/wwan/iosm/iosm_ipc_uevent.c @@ -27,7 +27,7 @@ static void ipc_uevent_work(struct work_struct *data) void ipc_uevent_send(struct device *dev, char *uevent) { - struct ipc_uevent_info *info = kzalloc(sizeof(*info), GFP_ATOMIC); + struct ipc_uevent_info *info = kzalloc_obj(*info, GFP_ATOMIC); if (!info) return; diff --git a/drivers/net/wwan/iosm/iosm_ipc_wwan.c b/drivers/net/wwan/iosm/iosm_ipc_wwan.c index ff747fc79aaf..7a299b6b41c9 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_wwan.c +++ b/drivers/net/wwan/iosm/iosm_ipc_wwan.c @@ -290,7 +290,7 @@ struct iosm_wwan *ipc_wwan_init(struct iosm_imem *ipc_imem, struct device *dev) { struct iosm_wwan *ipc_wwan; - ipc_wwan = kzalloc(sizeof(*ipc_wwan), GFP_KERNEL); + ipc_wwan = kzalloc_obj(*ipc_wwan, GFP_KERNEL); if (!ipc_wwan) return NULL; diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c b/drivers/net/wwan/mhi_wwan_ctrl.c index e13c0b078175..33e0dd11abde 100644 --- a/drivers/net/wwan/mhi_wwan_ctrl.c +++ b/drivers/net/wwan/mhi_wwan_ctrl.c @@ -218,7 +218,7 @@ static int mhi_wwan_ctrl_probe(struct mhi_device *mhi_dev, struct mhi_wwan_dev *mhiwwan; struct wwan_port *port; - mhiwwan = kzalloc(sizeof(*mhiwwan), GFP_KERNEL); + mhiwwan = kzalloc_obj(*mhiwwan, GFP_KERNEL); if (!mhiwwan) return -ENOMEM; diff --git a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c b/drivers/net/wwan/t7xx/t7xx_hif_cldma.c index 43ac1c3f1ad0..a32378dcc392 100644 --- a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c +++ b/drivers/net/wwan/t7xx/t7xx_hif_cldma.c @@ -391,7 +391,7 @@ static struct cldma_request *t7xx_alloc_rx_request(struct cldma_ctrl *md_ctrl, s struct cldma_request *req; int val; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; @@ -451,7 +451,7 @@ static struct cldma_request *t7xx_alloc_tx_request(struct cldma_ctrl *md_ctrl) { struct cldma_request *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; @@ -1206,7 +1206,7 @@ static int t7xx_cldma_suspend(struct t7xx_pci_dev *t7xx_dev, void *entity_param) static int t7xx_cldma_pm_init(struct cldma_ctrl *md_ctrl) { - md_ctrl->pm_entity = kzalloc(sizeof(*md_ctrl->pm_entity), GFP_KERNEL); + md_ctrl->pm_entity = kzalloc_obj(*md_ctrl->pm_entity, GFP_KERNEL); if (!md_ctrl->pm_entity) return -ENOMEM; diff --git a/drivers/net/wwan/t7xx/t7xx_state_monitor.c b/drivers/net/wwan/t7xx/t7xx_state_monitor.c index cbdbb91e8381..091d7cabd630 100644 --- a/drivers/net/wwan/t7xx/t7xx_state_monitor.c +++ b/drivers/net/wwan/t7xx/t7xx_state_monitor.c @@ -486,7 +486,8 @@ int t7xx_fsm_append_cmd(struct t7xx_fsm_ctl *ctl, enum t7xx_fsm_cmd_state cmd_id unsigned long flags; int ret; - cmd = kzalloc(sizeof(*cmd), flag & FSM_CMD_FLAG_IN_INTERRUPT ? GFP_ATOMIC : GFP_KERNEL); + cmd = kzalloc_obj(*cmd, + flag & FSM_CMD_FLAG_IN_INTERRUPT ? GFP_ATOMIC : GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -532,8 +533,8 @@ int t7xx_fsm_append_event(struct t7xx_fsm_ctl *ctl, enum t7xx_fsm_event_state ev return -EINVAL; } - event = kmalloc(struct_size(event, data, length), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + event = kmalloc_flex(*event, data, length, + in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); if (!event) return -ENOMEM; diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index 015213b3d687..ffa222b6dce8 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -250,7 +250,7 @@ static struct wwan_device *wwan_create_dev(struct device *parent) goto done_unlock; } - wwandev = kzalloc(sizeof(*wwandev), GFP_KERNEL); + wwandev = kzalloc_obj(*wwandev, GFP_KERNEL); if (!wwandev) { wwandev = ERR_PTR(-ENOMEM); ida_free(&wwan_dev_ids, id); @@ -639,7 +639,7 @@ struct wwan_port *wwan_create_port(struct device *parent, if (IS_ERR(wwandev)) return ERR_CAST(wwandev); - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) { err = -ENOMEM; goto error_wwandev_remove; diff --git a/drivers/net/wwan/wwan_hwsim.c b/drivers/net/wwan/wwan_hwsim.c index 8541bd58e831..55d3b2bb4061 100644 --- a/drivers/net/wwan/wwan_hwsim.c +++ b/drivers/net/wwan/wwan_hwsim.c @@ -317,7 +317,7 @@ static struct wwan_hwsim_port *wwan_hwsim_port_new(struct wwan_hwsim_dev *dev, else return ERR_PTR(-EINVAL); - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); @@ -390,7 +390,7 @@ static struct wwan_hwsim_dev *wwan_hwsim_dev_new(void) struct wwan_hwsim_dev *dev; int err; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c index c6b2eba3511b..20c2c6c5bda1 100644 --- a/drivers/net/xen-netback/hash.c +++ b/drivers/net/xen-netback/hash.c @@ -39,7 +39,7 @@ static void xenvif_add_hash(struct xenvif *vif, const u8 *tag, unsigned long flags; bool found; - new = kmalloc(sizeof(*entry), GFP_ATOMIC); + new = kmalloc_obj(*entry, GFP_ATOMIC); if (!new) return; diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index c759ebc56457..3cdb7fd659db 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -855,7 +855,7 @@ static int xenvif_mcast_add(struct xenvif *vif, const u8 *addr) return -ENOSPC; } - mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC); + mcast = kzalloc_obj(*mcast, GFP_ATOMIC); if (!mcast) return -ENOMEM; diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 61b547aab286..adb3967f00ee 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -1007,7 +1007,7 @@ static int netback_probe(struct xenbus_device *dev, int err; int sg; const char *script; - struct backend_info *be = kzalloc(sizeof(*be), GFP_KERNEL); + struct backend_info *be = kzalloc_obj(*be, GFP_KERNEL); if (!be) { xenbus_dev_fatal(dev, -ENOMEM, diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 0969d5c9f6b7..c4e75cc53f64 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -2212,8 +2212,8 @@ static int xennet_create_queues(struct netfront_info *info, unsigned int i; int ret; - info->queues = kcalloc(*num_queues, sizeof(struct netfront_queue), - GFP_KERNEL); + info->queues = kzalloc_objs(struct netfront_queue, *num_queues, + GFP_KERNEL); if (!info->queues) return -ENOMEM; diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index f9cca885beec..5f8c9c2c7c06 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -373,7 +373,7 @@ struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *cldev) { struct nfc_mei_phy *phy; - phy = kzalloc(sizeof(struct nfc_mei_phy), GFP_KERNEL); + phy = kzalloc_obj(struct nfc_mei_phy, GFP_KERNEL); if (!phy) return NULL; diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c index bb4d029bb888..60cdf4d09577 100644 --- a/drivers/nfc/microread/microread.c +++ b/drivers/nfc/microread/microread.c @@ -473,7 +473,7 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, pr_info("target discovered to gate 0x%x\n", gate); - targets = kzalloc(sizeof(struct nfc_target), GFP_KERNEL); + targets = kzalloc_obj(struct nfc_target, GFP_KERNEL); if (targets == NULL) { r = -ENOMEM; goto exit; @@ -650,7 +650,7 @@ int microread_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; int r; - info = kzalloc(sizeof(struct microread_info), GFP_KERNEL); + info = kzalloc_obj(struct microread_info, GFP_KERNEL); if (!info) { r = -ENOMEM; goto err_info_alloc; diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index 141bc4b66dcb..2065befd3793 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c @@ -101,7 +101,7 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy, int tailroom; u32 protocols; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c index a55381f80cd6..6b2939e6a7cd 100644 --- a/drivers/nfc/nfcsim.c +++ b/drivers/nfc/nfcsim.c @@ -66,7 +66,7 @@ static struct nfcsim_link *nfcsim_link_new(void) { struct nfcsim_link *link; - link = kzalloc(sizeof(struct nfcsim_link), GFP_KERNEL); + link = kzalloc_obj(struct nfcsim_link, GFP_KERNEL); if (!link) return NULL; @@ -373,7 +373,7 @@ static struct nfcsim *nfcsim_device_new(struct nfcsim_link *link_in, struct nfcsim *dev; int rc; - dev = kzalloc(sizeof(struct nfcsim), GFP_KERNEL); + dev = kzalloc_obj(struct nfcsim, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index 2b043a9f9533..8d62084c3e92 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -444,7 +444,7 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code, dev_dbg(dev->dev, "Sending command 0x%x\n", cmd_code); - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -518,7 +518,7 @@ static int pn533_send_cmd_direct_async(struct pn533 *dev, u8 cmd_code, struct pn533_cmd *cmd; int rc; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -2019,7 +2019,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target, *next = 0; } - arg = kmalloc(sizeof(*arg), GFP_KERNEL); + arg = kmalloc_obj(*arg, GFP_KERNEL); if (!arg) { dev_kfree_skb(skb); return -ENOMEM; @@ -2266,7 +2266,7 @@ static int pn533_transceive(struct nfc_dev *nfc_dev, goto error; } - arg = kmalloc(sizeof(*arg), GFP_KERNEL); + arg = kmalloc_obj(*arg, GFP_KERNEL); if (!arg) { rc = -ENOMEM; goto error; @@ -2744,7 +2744,7 @@ struct pn533 *pn53x_common_init(u32 device_type, { struct pn533 *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c index a081bce61c29..3355736e5e26 100644 --- a/drivers/nfc/pn533/uart.c +++ b/drivers/nfc/pn533/uart.c @@ -242,7 +242,7 @@ static int pn532_uart_probe(struct serdev_device *serdev) int err; err = -ENOMEM; - pn532 = kzalloc(sizeof(*pn532), GFP_KERNEL); + pn532 = kzalloc_obj(*pn532, GFP_KERNEL); if (!pn532) goto err_exit; diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index 32a61a185142..87803f125f5e 100644 --- a/drivers/nfc/pn544/pn544.c +++ b/drivers/nfc/pn544/pn544.c @@ -910,7 +910,7 @@ int pn544_hci_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; int r; - info = kzalloc(sizeof(struct pn544_hci_info), GFP_KERNEL); + info = kzalloc_obj(struct pn544_hci_info, GFP_KERNEL); if (!info) { r = -ENOMEM; goto err_info_alloc; diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c index 00d8ea6dcb5d..3dcd13878535 100644 --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -859,7 +859,7 @@ static int port100_send_cmd_async(struct port100 *dev, u8 cmd_code, if (!resp) return -ENOMEM; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { dev_kfree_skb(resp); return -ENOMEM; @@ -1211,7 +1211,7 @@ static int port100_in_send_cmd(struct nfc_digital_dev *ddev, struct port100_cb_arg *cb_arg; __le16 timeout; - cb_arg = kzalloc(sizeof(struct port100_cb_arg), GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); if (!cb_arg) return -ENOMEM; @@ -1377,7 +1377,7 @@ static int port100_tg_send_cmd(struct nfc_digital_dev *ddev, struct port100_tg_comm_rf_cmd *hdr; struct port100_cb_arg *cb_arg; - cb_arg = kzalloc(sizeof(struct port100_cb_arg), GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); if (!cb_arg) return -ENOMEM; @@ -1418,7 +1418,7 @@ static int port100_listen_mdaa(struct nfc_digital_dev *ddev, if (rc) return rc; - cb_arg = kzalloc(sizeof(struct port100_cb_arg), GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); if (!cb_arg) return -ENOMEM; diff --git a/drivers/nfc/st21nfca/core.c b/drivers/nfc/st21nfca/core.c index bec6f607c32c..31f6e7c9930f 100644 --- a/drivers/nfc/st21nfca/core.c +++ b/drivers/nfc/st21nfca/core.c @@ -946,7 +946,7 @@ int st21nfca_hci_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; unsigned long quirks = 0; - info = kzalloc(sizeof(struct st21nfca_hci_info), GFP_KERNEL); + info = kzalloc_obj(struct st21nfca_hci_info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c index b957fce83b7c..81cc2e046ee6 100644 --- a/drivers/nfc/virtual_ncidev.c +++ b/drivers/nfc/virtual_ncidev.c @@ -135,7 +135,7 @@ static int virtual_ncidev_open(struct inode *inode, struct file *file) int ret = 0; struct virtual_nci_dev *vdev; - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) return -ENOMEM; vdev->ndev = nci_allocate_device(&virtual_nci_ops, diff --git a/drivers/ntb/test/ntb_msi_test.c b/drivers/ntb/test/ntb_msi_test.c index 4e18e08776c9..f52d409ba6d2 100644 --- a/drivers/ntb/test/ntb_msi_test.c +++ b/drivers/ntb/test/ntb_msi_test.c @@ -164,7 +164,7 @@ static void ntb_msit_db_event(void *ctx, int vec) if (irq_count == -1) continue; - desc = kcalloc(irq_count, sizeof(*desc), GFP_ATOMIC); + desc = kzalloc_objs(*desc, irq_count, GFP_ATOMIC); if (!desc) continue; diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c index 197c8c0de199..559dce302d06 100644 --- a/drivers/nubus/nubus.c +++ b/drivers/nubus/nubus.c @@ -510,7 +510,7 @@ nubus_get_functional_resource(struct nubus_board *board, int slot, dir.procdir = nubus_proc_add_rsrc_dir(board->procdir, parent, board); /* Actually we should probably panic if this fails */ - fres = kzalloc(sizeof(*fres), GFP_ATOMIC); + fres = kzalloc_obj(*fres, GFP_ATOMIC); if (!fres) return NULL; fres->resid = parent->type; @@ -739,7 +739,7 @@ static void __init nubus_add_board(int slot, int bytelanes) nubus_rewind(&rp, FORMAT_BLOCK_SIZE, bytelanes); /* Actually we should probably panic if this fails */ - if ((board = kzalloc(sizeof(*board), GFP_ATOMIC)) == NULL) + if ((board = kzalloc_obj(*board, GFP_ATOMIC)) == NULL) return; board->fblock = rp; diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c index e7a347db708c..4d6773ef484e 100644 --- a/drivers/nubus/proc.c +++ b/drivers/nubus/proc.c @@ -96,7 +96,7 @@ nubus_proc_alloc_pde_data(unsigned char *ptr, unsigned int size) { struct nubus_proc_pde_data *pded; - pded = kmalloc(sizeof(*pded), GFP_KERNEL); + pded = kmalloc_obj(*pded, GFP_KERNEL); if (!pded) return NULL; diff --git a/drivers/nvdimm/badrange.c b/drivers/nvdimm/badrange.c index 36c626db459a..7d2422f72e66 100644 --- a/drivers/nvdimm/badrange.c +++ b/drivers/nvdimm/badrange.c @@ -37,7 +37,7 @@ static int alloc_and_append_badrange_entry(struct badrange *badrange, { struct badrange_entry *bre; - bre = kzalloc(sizeof(*bre), flags); + bre = kzalloc_obj(*bre, flags); if (!bre) return -ENOMEM; @@ -50,7 +50,7 @@ static int add_badrange(struct badrange *badrange, u64 addr, u64 length) struct badrange_entry *bre, *bre_new; spin_unlock(&badrange->lock); - bre_new = kzalloc(sizeof(*bre_new), GFP_KERNEL); + bre_new = kzalloc_obj(*bre_new, GFP_KERNEL); spin_lock(&badrange->lock); if (list_empty(&badrange->list)) { diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 237edfa1c624..c47785274d3a 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -539,8 +539,8 @@ static int btt_freelist_init(struct arena_info *arena) struct log_entry log_new; u32 i, map_entry, log_oldmap, log_newmap; - arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry), - GFP_KERNEL); + arena->freelist = kzalloc_objs(struct free_entry, arena->nfree, + GFP_KERNEL); if (!arena->freelist) return -ENOMEM; @@ -733,8 +733,8 @@ static int btt_maplocks_init(struct arena_info *arena) { u32 i; - arena->map_locks = kcalloc(arena->nfree, sizeof(struct aligned_lock), - GFP_KERNEL); + arena->map_locks = kzalloc_objs(struct aligned_lock, arena->nfree, + GFP_KERNEL); if (!arena->map_locks) return -ENOMEM; @@ -751,7 +751,7 @@ static struct arena_info *alloc_arena(struct btt *btt, size_t size, u64 logsize, mapsize, datasize; u64 available = size; - arena = kzalloc(sizeof(*arena), GFP_KERNEL); + arena = kzalloc_obj(*arena, GFP_KERNEL); if (!arena) return NULL; arena->nd_btt = btt->nd_btt; @@ -854,7 +854,7 @@ static int discover_arenas(struct btt *btt) size_t cur_off = 0; int num_arenas = 0; - struct btt_sb *super __free(kfree) = kzalloc(sizeof(*super), GFP_KERNEL); + struct btt_sb *super __free(kfree) = kzalloc_obj(*super, GFP_KERNEL); if (!super) return -ENOMEM; @@ -978,7 +978,7 @@ static int btt_arena_write_layout(struct arena_info *arena) if (ret) return ret; - super = kzalloc(sizeof(*super), GFP_NOIO); + super = kzalloc_obj(*super, GFP_NOIO); if (!super) return -ENOMEM; diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index b3279b86bbfd..ab9d0ad53724 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c @@ -180,7 +180,7 @@ static struct device *__nd_btt_create(struct nd_region *nd_region, struct nd_btt *nd_btt; struct device *dev; - nd_btt = kzalloc(sizeof(*nd_btt), GFP_KERNEL); + nd_btt = kzalloc_obj(*nd_btt, GFP_KERNEL); if (!nd_btt) return NULL; diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 87178a53ff9c..767a4f1e27e5 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -336,7 +336,7 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent, struct nvdimm_bus *nvdimm_bus; int rc; - nvdimm_bus = kzalloc(sizeof(*nvdimm_bus), GFP_KERNEL); + nvdimm_bus = kzalloc_obj(*nvdimm_bus, GFP_KERNEL); if (!nvdimm_bus) return NULL; INIT_LIST_HEAD(&nvdimm_bus->list); @@ -736,7 +736,7 @@ int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus) struct device *dev; int rc; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; device_initialize(dev); diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c index 5ba204113fe1..5c2e4160e6ae 100644 --- a/drivers/nvdimm/core.c +++ b/drivers/nvdimm/core.c @@ -80,7 +80,7 @@ static struct nvdimm_map *alloc_nvdimm_map(struct device *dev, struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev); struct nvdimm_map *nvdimm_map; - nvdimm_map = kzalloc(sizeof(*nvdimm_map), GFP_KERNEL); + nvdimm_map = kzalloc_obj(*nvdimm_map, GFP_KERNEL); if (!nvdimm_map) return NULL; diff --git a/drivers/nvdimm/dax_devs.c b/drivers/nvdimm/dax_devs.c index ba4c409ede65..6d25a7fbf751 100644 --- a/drivers/nvdimm/dax_devs.c +++ b/drivers/nvdimm/dax_devs.c @@ -50,7 +50,7 @@ static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region) struct nd_dax *nd_dax; struct device *dev; - nd_dax = kzalloc(sizeof(*nd_dax), GFP_KERNEL); + nd_dax = kzalloc_obj(*nd_dax, GFP_KERNEL); if (!nd_dax) return NULL; diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c index 2f6c26cc6a3e..f7c7ecee80a7 100644 --- a/drivers/nvdimm/dimm.c +++ b/drivers/nvdimm/dimm.c @@ -39,7 +39,7 @@ static int nvdimm_probe(struct device *dev) */ nvdimm_clear_locked(dev); - ndd = kzalloc(sizeof(*ndd), GFP_KERNEL); + ndd = kzalloc_obj(*ndd, GFP_KERNEL); if (!ndd) return -ENOMEM; diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c index e1349ef5f8fd..c0366fd5d6a0 100644 --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c @@ -575,7 +575,7 @@ struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus, const struct nvdimm_security_ops *sec_ops, const struct nvdimm_fw_ops *fw_ops) { - struct nvdimm *nvdimm = kzalloc(sizeof(*nvdimm), GFP_KERNEL); + struct nvdimm *nvdimm = kzalloc_obj(*nvdimm, GFP_KERNEL); struct device *dev; if (!nvdimm) diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c index 04f4a049599a..e370eaf17099 100644 --- a/drivers/nvdimm/label.c +++ b/drivers/nvdimm/label.c @@ -982,7 +982,7 @@ static int init_labels(struct nd_mapping *nd_mapping, int num_labels) * they can be garbage collected after writing the new labels. */ for (i = old_num_labels; i < num_labels; i++) { - label_ent = kzalloc(sizeof(*label_ent), GFP_KERNEL); + label_ent = kzalloc_obj(*label_ent, GFP_KERNEL); if (!label_ent) return -ENOMEM; mutex_lock(&nd_mapping->lock); diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index a5edcacfe46d..6f2cd7d32467 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -1530,11 +1530,11 @@ static struct device **create_namespace_io(struct nd_region *nd_region) struct device *dev, **devs; struct resource *res; - nsio = kzalloc(sizeof(*nsio), GFP_KERNEL); + nsio = kzalloc_obj(*nsio, GFP_KERNEL); if (!nsio) return NULL; - devs = kcalloc(2, sizeof(struct device *), GFP_KERNEL); + devs = kzalloc_objs(struct device *, 2, GFP_KERNEL); if (!devs) { kfree(nsio); return NULL; @@ -1693,7 +1693,7 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region, nsl_uuid_raw(ndd, nd_label)); } - nspm = kzalloc(sizeof(*nspm), GFP_KERNEL); + nspm = kzalloc_obj(*nspm, GFP_KERNEL); if (!nspm) return ERR_PTR(-ENOMEM); @@ -1797,7 +1797,7 @@ static struct device *nd_namespace_pmem_create(struct nd_region *nd_region) if (!is_memory(&nd_region->dev)) return NULL; - nspm = kzalloc(sizeof(*nspm), GFP_KERNEL); + nspm = kzalloc_obj(*nspm, GFP_KERNEL); if (!nspm) return NULL; @@ -1931,7 +1931,7 @@ static struct device **scan_labels(struct nd_region *nd_region) struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1; - devs = kcalloc(2, sizeof(dev), GFP_KERNEL); + devs = kzalloc_objs(dev, 2, GFP_KERNEL); if (!devs) return NULL; @@ -1954,7 +1954,7 @@ static struct device **scan_labels(struct nd_region *nd_region) if (i < count) continue; if (count) { - __devs = kcalloc(count + 2, sizeof(dev), GFP_KERNEL); + __devs = kzalloc_objs(dev, count + 2, GFP_KERNEL); if (!__devs) goto err; memcpy(__devs, devs, sizeof(dev) * count); @@ -1984,7 +1984,7 @@ static struct device **scan_labels(struct nd_region *nd_region) /* Publish a zero-sized namespace for userspace to configure. */ nd_mapping_free_labels(nd_mapping); - nspm = kzalloc(sizeof(*nspm), GFP_KERNEL); + nspm = kzalloc_obj(*nspm, GFP_KERNEL); if (!nspm) goto err; dev = &nspm->nsio.common.dev; @@ -2118,7 +2118,7 @@ static int init_active_labels(struct nd_region *nd_region) for (j = 0; j < count; j++) { struct nd_namespace_label *label; - label_ent = kzalloc(sizeof(*label_ent), GFP_KERNEL); + label_ent = kzalloc_obj(*label_ent, GFP_KERNEL); if (!label_ent) break; label = nd_label_active(ndd, j); diff --git a/drivers/nvdimm/nd_perf.c b/drivers/nvdimm/nd_perf.c index 2b6dc80d8fb5..5338a440890b 100644 --- a/drivers/nvdimm/nd_perf.c +++ b/drivers/nvdimm/nd_perf.c @@ -184,7 +184,7 @@ static int create_cpumask_attr_group(struct nvdimm_pmu *nd_pmu) struct attribute **attrs_group; struct attribute_group *nvdimm_pmu_cpumask_group; - pmu_events_attr = kzalloc(sizeof(*pmu_events_attr), GFP_KERNEL); + pmu_events_attr = kzalloc_obj(*pmu_events_attr, GFP_KERNEL); if (!pmu_events_attr) return -ENOMEM; @@ -195,7 +195,8 @@ static int create_cpumask_attr_group(struct nvdimm_pmu *nd_pmu) } /* Allocate memory for cpumask attribute group */ - nvdimm_pmu_cpumask_group = kzalloc(sizeof(*nvdimm_pmu_cpumask_group), GFP_KERNEL); + nvdimm_pmu_cpumask_group = kzalloc_obj(*nvdimm_pmu_cpumask_group, + GFP_KERNEL); if (!nvdimm_pmu_cpumask_group) { kfree(pmu_events_attr); kfree(attrs_group); diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c index af82385be7c6..e70aee4ef7a9 100644 --- a/drivers/nvdimm/nd_virtio.c +++ b/drivers/nvdimm/nd_virtio.c @@ -55,7 +55,7 @@ static int virtio_pmem_flush(struct nd_region *nd_region) return -EIO; } - req_data = kmalloc(sizeof(*req_data), GFP_KERNEL); + req_data = kmalloc_obj(*req_data, GFP_KERNEL); if (!req_data) return -ENOMEM; diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index 68bddab3fb46..f78aede2aab5 100644 --- a/drivers/nvdimm/of_pmem.c +++ b/drivers/nvdimm/of_pmem.c @@ -26,7 +26,7 @@ static int of_pmem_region_probe(struct platform_device *pdev) if (!np) return -ENXIO; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 42b172fc5576..5d1e1c214847 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -311,7 +311,7 @@ static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) struct nd_pfn *nd_pfn; struct device *dev; - nd_pfn = kzalloc(sizeof(*nd_pfn), GFP_KERNEL); + nd_pfn = kzalloc_obj(*nd_pfn, GFP_KERNEL); if (!nd_pfn) return NULL; diff --git a/drivers/nvdimm/ramdax.c b/drivers/nvdimm/ramdax.c index 954cb7919807..8d6cfffbb56c 100644 --- a/drivers/nvdimm/ramdax.c +++ b/drivers/nvdimm/ramdax.c @@ -40,7 +40,7 @@ static int ramdax_register_region(struct resource *res, struct nd_interleave_set *nd_set; int nid = phys_to_target_node(res->start); - nd_set = kzalloc(sizeof(*nd_set), GFP_KERNEL); + nd_set = kzalloc_obj(*nd_set, GFP_KERNEL); if (!nd_set) return -ENOMEM; @@ -80,7 +80,7 @@ static int ramdax_register_dimm(struct resource *res, void *data) struct ramdax_dimm *dimm; int err; - dimm = kzalloc(sizeof(*dimm), GFP_KERNEL); + dimm = kzalloc_obj(*dimm, GFP_KERNEL); if (!dimm) return -ENOMEM; diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index 1220530a23b6..c1eebff582d9 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -1005,8 +1005,8 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus, } nd_region = - kzalloc(struct_size(nd_region, mapping, ndr_desc->num_mappings), - GFP_KERNEL); + kzalloc_flex(*nd_region, mapping, ndr_desc->num_mappings, + GFP_KERNEL); if (!nd_region) return NULL; diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index 8f3ccb317e4d..20a7347fa258 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -1083,8 +1083,8 @@ int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl) if (!ctrl->opts->dhchap_secret && !ctrl->opts->dhchap_ctrl_secret) return 0; - ctrl->dhchap_ctxs = kvcalloc(ctrl_max_dhchaps(ctrl), - sizeof(*chap), GFP_KERNEL); + ctrl->dhchap_ctxs = kvzalloc_objs(*chap, ctrl_max_dhchaps(ctrl), + GFP_KERNEL); if (!ctrl->dhchap_ctxs) { ret = -ENOMEM; goto err_free_dhchap_ctrl_secret; diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 19b67cf5d550..fe05fb76afe6 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1469,7 +1469,7 @@ static int nvme_identify_ctrl(struct nvme_ctrl *dev, struct nvme_id_ctrl **id) c.identify.opcode = nvme_admin_identify; c.identify.cns = NVME_ID_CNS_CTRL; - *id = kmalloc(sizeof(struct nvme_id_ctrl), GFP_KERNEL); + *id = kmalloc_obj(struct nvme_id_ctrl, GFP_KERNEL); if (!*id) return -ENOMEM; @@ -1599,7 +1599,7 @@ int nvme_identify_ns(struct nvme_ctrl *ctrl, unsigned nsid, c.identify.nsid = cpu_to_le32(nsid); c.identify.cns = NVME_ID_CNS_NS; - *id = kmalloc(sizeof(**id), GFP_KERNEL); + *id = kmalloc_obj(**id, GFP_KERNEL); if (!*id) return -ENOMEM; @@ -1663,7 +1663,7 @@ static int nvme_ns_info_from_id_cs_indep(struct nvme_ctrl *ctrl, }; int ret; - id = kmalloc(sizeof(*id), GFP_KERNEL); + id = kmalloc_obj(*id, GFP_KERNEL); if (!id) return -ENOMEM; @@ -1923,7 +1923,7 @@ static int nvme_identify_ns_nvm(struct nvme_ctrl *ctrl, unsigned int nsid, struct nvme_id_ns_nvm *nvm; int ret; - nvm = kzalloc(sizeof(*nvm), GFP_KERNEL); + nvm = kzalloc_obj(*nvm, GFP_KERNEL); if (!nvm) return -ENOMEM; @@ -2784,7 +2784,7 @@ static int nvme_configure_host_options(struct nvme_ctrl *ctrl) if (!acre && !lbafee) return 0; - host = kzalloc(sizeof(*host), GFP_KERNEL); + host = kzalloc_obj(*host, GFP_KERNEL); if (!host) return 0; @@ -2873,7 +2873,7 @@ static int nvme_configure_apst(struct nvme_ctrl *ctrl) return 0; } - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return 0; @@ -3208,7 +3208,7 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) struct nvme_subsystem *subsys, *found; int ret; - subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); + subsys = kzalloc_obj(*subsys, GFP_KERNEL); if (!subsys) return -ENOMEM; @@ -3326,7 +3326,7 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi, if (cel) goto out; - cel = kzalloc(sizeof(*cel), GFP_KERNEL); + cel = kzalloc_obj(*cel, GFP_KERNEL); if (!cel) return -ENOMEM; @@ -3379,7 +3379,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl) test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags)) return 0; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) return -ENOMEM; @@ -3408,7 +3408,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl, { struct nvme_effects_log *effects, *old; - effects = kzalloc(sizeof(*effects), GFP_KERNEL); + effects = kzalloc_obj(*effects, GFP_KERNEL); if (!effects) return -ENOMEM; @@ -4688,7 +4688,7 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl) struct nvme_fw_slot_info_log *log; u8 next_fw_slot, cur_fw_slot; - log = kmalloc(sizeof(*log), GFP_KERNEL); + log = kmalloc_obj(*log, GFP_KERNEL); if (!log) return; diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 55a8afd2efd5..b4e4bdea1db0 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -26,7 +26,7 @@ static struct nvmf_host *nvmf_host_alloc(const char *hostnqn, uuid_t *id) { struct nvmf_host *host; - host = kmalloc(sizeof(*host), GFP_KERNEL); + host = kmalloc_obj(*host, GFP_KERNEL); if (!host) return NULL; @@ -396,7 +396,7 @@ static struct nvmf_connect_data *nvmf_connect_data_prep(struct nvme_ctrl *ctrl, { struct nvmf_connect_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; @@ -1312,7 +1312,7 @@ nvmf_create_ctrl(struct device *dev, const char *buf) struct nvme_ctrl *ctrl; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 6948de3f438a..0b65d1bab4c1 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1724,15 +1724,15 @@ nvme_fc_rcv_ls_req(struct nvme_fc_remote_port *portptr, goto out_put; } - lsop = kzalloc(sizeof(*lsop), GFP_KERNEL); + lsop = kzalloc_obj(*lsop, GFP_KERNEL); if (!lsop) { nvme_fc_rcv_ls_req_err_msg(lport, w0); ret = -ENOMEM; goto out_put; } - lsop->rqstbuf = kzalloc(sizeof(*lsop->rqstbuf), GFP_KERNEL); - lsop->rspbuf = kzalloc(sizeof(*lsop->rspbuf), GFP_KERNEL); + lsop->rqstbuf = kzalloc_obj(*lsop->rqstbuf, GFP_KERNEL); + lsop->rspbuf = kzalloc_obj(*lsop->rspbuf, GFP_KERNEL); if (!lsop->rqstbuf || !lsop->rspbuf) { nvme_fc_rcv_ls_req_err_msg(lport, w0); ret = -ENOMEM; @@ -3443,7 +3443,7 @@ nvme_fc_alloc_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, goto out_fail; } - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) { ret = -ENOMEM; goto out_fail; @@ -3497,8 +3497,8 @@ nvme_fc_alloc_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, ctrl->ctrl.cntlid = 0xffff; ret = -ENOMEM; - ctrl->queues = kcalloc(ctrl->ctrl.queue_count, - sizeof(struct nvme_fc_queue), GFP_KERNEL); + ctrl->queues = kzalloc_objs(struct nvme_fc_queue, + ctrl->ctrl.queue_count, GFP_KERNEL); if (!ctrl->queues) goto out_free_ida; diff --git a/drivers/nvme/host/hwmon.c b/drivers/nvme/host/hwmon.c index 89a1a1043d63..c60bd960f03a 100644 --- a/drivers/nvme/host/hwmon.c +++ b/drivers/nvme/host/hwmon.c @@ -230,11 +230,11 @@ int nvme_hwmon_init(struct nvme_ctrl *ctrl) struct device *hwmon; int err; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; - data->log = kzalloc(sizeof(*data->log), GFP_KERNEL); + data->log = kzalloc_obj(*data->log, GFP_KERNEL); if (!data->log) { err = -ENOMEM; goto err_free_data; diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 80df992d1ae8..89b5095d1b2e 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2447,7 +2447,7 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred, if (!descs) goto out; - bufs = kcalloc(max_entries, sizeof(*bufs), GFP_KERNEL); + bufs = kzalloc_objs(*bufs, max_entries, GFP_KERNEL); if (!bufs) goto out_free_descs; diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 35c0822edb2d..718bbc9b87c1 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -215,7 +215,7 @@ static struct nvme_rdma_qe *nvme_rdma_alloc_ring(struct ib_device *ibdev, struct nvme_rdma_qe *ring; int i; - ring = kcalloc(ib_queue_size, sizeof(struct nvme_rdma_qe), GFP_KERNEL); + ring = kzalloc_objs(struct nvme_rdma_qe, ib_queue_size, GFP_KERNEL); if (!ring) return NULL; @@ -300,7 +300,7 @@ static int nvme_rdma_init_request(struct blk_mq_tag_set *set, struct nvme_rdma_queue *queue = &ctrl->queues[queue_idx]; nvme_req(rq)->ctrl = &ctrl->ctrl; - req->sqe.data = kzalloc(sizeof(struct nvme_command), GFP_KERNEL); + req->sqe.data = kzalloc_obj(struct nvme_command, GFP_KERNEL); if (!req->sqe.data) return -ENOMEM; @@ -375,7 +375,7 @@ nvme_rdma_find_get_device(struct rdma_cm_id *cm_id) goto out_unlock; } - ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); + ndev = kzalloc_obj(*ndev, GFP_KERNEL); if (!ndev) goto out_err; @@ -2240,7 +2240,7 @@ static struct nvme_rdma_ctrl *nvme_rdma_alloc_ctrl(struct device *dev, struct nvme_rdma_ctrl *ctrl; int ret; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return ERR_PTR(-ENOMEM); ctrl->ctrl.opts = opts; @@ -2290,8 +2290,8 @@ static struct nvme_rdma_ctrl *nvme_rdma_alloc_ctrl(struct device *dev, ctrl->ctrl.kato = opts->kato; ret = -ENOMEM; - ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues), - GFP_KERNEL); + ctrl->queues = kzalloc_objs(*ctrl->queues, ctrl->ctrl.queue_count, + GFP_KERNEL); if (!ctrl->queues) goto out_free_ctrl; diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 69cb04406b47..489102bdd057 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1467,11 +1467,11 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue) u32 maxh2cdata; int ret; - icreq = kzalloc(sizeof(*icreq), GFP_KERNEL); + icreq = kzalloc_obj(*icreq, GFP_KERNEL); if (!icreq) return -ENOMEM; - icresp = kzalloc(sizeof(*icresp), GFP_KERNEL); + icresp = kzalloc_obj(*icresp, GFP_KERNEL); if (!icresp) { ret = -ENOMEM; goto free_icreq; @@ -2891,7 +2891,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev, struct nvme_tcp_ctrl *ctrl; int ret; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return ERR_PTR(-ENOMEM); @@ -2949,8 +2949,8 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev, goto out_free_ctrl; } - ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues), - GFP_KERNEL); + ctrl->queues = kzalloc_objs(*ctrl->queues, ctrl->ctrl.queue_count, + GFP_KERNEL); if (!ctrl->queues) { ret = -ENOMEM; goto out_free_ctrl; diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index deea2dbef5b8..68dbe78c90c4 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -13,7 +13,7 @@ static int nvme_set_max_append(struct nvme_ctrl *ctrl) struct nvme_id_ctrl_zns *id; int status; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) return -ENOMEM; @@ -64,7 +64,7 @@ int nvme_query_zone_info(struct nvme_ns *ns, unsigned lbaf, return status; } - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) return -ENOMEM; diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 5e366502fb75..431702ff21fb 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -203,7 +203,7 @@ static void nvmet_execute_get_supported_log_pages(struct nvmet_req *req) struct nvme_supported_log *logs; u16 status; - logs = kzalloc(sizeof(*logs), GFP_KERNEL); + logs = kzalloc_obj(*logs, GFP_KERNEL); if (!logs) { status = NVME_SC_INTERNAL; goto out; @@ -308,7 +308,7 @@ static void nvmet_execute_get_log_page_rmi(struct nvmet_req *req) goto out; } - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) goto out; @@ -334,7 +334,7 @@ static void nvmet_execute_get_log_page_smart(struct nvmet_req *req) if (req->transfer_len != sizeof(*log)) goto out; - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) goto out; @@ -409,7 +409,7 @@ static void nvmet_execute_get_log_cmd_effects_ns(struct nvmet_req *req) struct nvme_effects_log *log; u16 status = NVME_SC_SUCCESS; - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) { status = NVME_SC_INTERNAL; goto out; @@ -504,7 +504,7 @@ static void nvmet_execute_get_log_page_endgrp(struct nvmet_req *req) if (status) goto out; - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) { status = NVME_SC_INTERNAL; goto out; @@ -542,8 +542,7 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req) u16 status; status = NVME_SC_INTERNAL; - desc = kmalloc(struct_size(desc, nsids, NVMET_MAX_NAMESPACES), - GFP_KERNEL); + desc = kmalloc_flex(*desc, nsids, NVMET_MAX_NAMESPACES, GFP_KERNEL); if (!desc) goto out; @@ -581,7 +580,7 @@ static void nvmet_execute_get_log_page_features(struct nvmet_req *req) struct nvme_supported_features_log *features; u16 status; - features = kzalloc(sizeof(*features), GFP_KERNEL); + features = kzalloc_obj(*features, GFP_KERNEL); if (!features) { status = NVME_SC_INTERNAL; goto out; @@ -660,7 +659,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req) mutex_unlock(&subsys->lock); } - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -809,7 +808,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req) goto out; } - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -1053,7 +1052,7 @@ static void nvme_execute_identify_ns_nvm(struct nvmet_req *req) if (status) goto out; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -1073,7 +1072,7 @@ static void nvmet_execute_id_cs_indep(struct nvmet_req *req) if (status) goto out; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index 127dae51fec1..6df2844dcec1 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -1040,7 +1040,7 @@ static int nvmet_port_subsys_allow_link(struct config_item *parent, return -EINVAL; } subsys = to_subsys(target); - link = kmalloc(sizeof(*link), GFP_KERNEL); + link = kmalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; link->subsys = subsys; @@ -1120,7 +1120,7 @@ static int nvmet_allowed_hosts_allow_link(struct config_item *parent, } host = to_host(target); - link = kmalloc(sizeof(*link), GFP_KERNEL); + link = kmalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; link->host = host; @@ -1825,7 +1825,7 @@ static struct config_group *nvmet_referral_make( { struct nvmet_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); @@ -1943,7 +1943,7 @@ static struct config_group *nvmet_ana_groups_make_group( goto out; ret = -ENOMEM; - grp = kzalloc(sizeof(*grp), GFP_KERNEL); + grp = kzalloc_obj(*grp, GFP_KERNEL); if (!grp) goto out; grp->port = port; @@ -2022,12 +2022,12 @@ static struct config_group *nvmet_ports_make(struct config_group *group, if (kstrtou16(name, 0, &portid)) return ERR_PTR(-EINVAL); - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); - port->ana_state = kcalloc(NVMET_MAX_ANAGRPS + 1, - sizeof(*port->ana_state), GFP_KERNEL); + port->ana_state = kzalloc_objs(*port->ana_state, NVMET_MAX_ANAGRPS + 1, + GFP_KERNEL); if (!port->ana_state) { kfree(port); return ERR_PTR(-ENOMEM); @@ -2257,7 +2257,7 @@ static struct config_group *nvmet_hosts_make_group(struct config_group *group, { struct nvmet_host *host; - host = kzalloc(sizeof(*host), GFP_KERNEL); + host = kzalloc_obj(*host, GFP_KERNEL); if (!host) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index eab3e4fc0f74..255a6c9b2548 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -194,7 +194,7 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type, { struct nvmet_async_event *aen; - aen = kmalloc(sizeof(*aen), GFP_KERNEL); + aen = kmalloc_obj(*aen, GFP_KERNEL); if (!aen) return; @@ -693,7 +693,7 @@ struct nvmet_ns *nvmet_ns_alloc(struct nvmet_subsys *subsys, u32 nsid) if (subsys->nr_namespaces == NVMET_MAX_NAMESPACES) goto out_unlock; - ns = kzalloc(sizeof(*ns), GFP_KERNEL); + ns = kzalloc_obj(*ns, GFP_KERNEL); if (!ns) goto out_unlock; @@ -1609,7 +1609,7 @@ struct nvmet_ctrl *nvmet_alloc_ctrl(struct nvmet_alloc_ctrl_args *args) up_read(&nvmet_config_sem); args->status = NVME_SC_INTERNAL; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) goto out_put_subsystem; mutex_init(&ctrl->lock); @@ -1642,14 +1642,13 @@ struct nvmet_ctrl *nvmet_alloc_ctrl(struct nvmet_alloc_ctrl_args *args) if (!ctrl->changed_ns_list) goto out_free_ctrl; - ctrl->sqs = kcalloc(subsys->max_qid + 1, - sizeof(struct nvmet_sq *), - GFP_KERNEL); + ctrl->sqs = kzalloc_objs(struct nvmet_sq *, subsys->max_qid + 1, + GFP_KERNEL); if (!ctrl->sqs) goto out_free_changed_ns_list; - ctrl->cqs = kcalloc(subsys->max_qid + 1, sizeof(struct nvmet_cq *), - GFP_KERNEL); + ctrl->cqs = kzalloc_objs(struct nvmet_cq *, subsys->max_qid + 1, + GFP_KERNEL); if (!ctrl->cqs) goto out_free_sqs; @@ -1829,7 +1828,7 @@ struct nvmet_subsys *nvmet_subsys_alloc(const char *subsysnqn, char serial[NVMET_SN_MAX_SIZE / 2]; int ret; - subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); + subsys = kzalloc_obj(*subsys, GFP_KERNEL); if (!subsys) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c index c06f3e04296c..8a4a33f82177 100644 --- a/drivers/nvme/target/discovery.c +++ b/drivers/nvme/target/discovery.c @@ -263,7 +263,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req) goto out; } - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c index 7b8d8b397802..5c0a1a3dd5b6 100644 --- a/drivers/nvme/target/fabrics-cmd.c +++ b/drivers/nvme/target/fabrics-cmd.c @@ -280,7 +280,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) return; - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { args.status = NVME_SC_INTERNAL; goto complete; @@ -344,7 +344,7 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) return; - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { status = NVME_SC_INTERNAL; goto complete; diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 0d9784004c9b..69ab0830313d 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -528,8 +528,8 @@ nvmet_fc_alloc_ls_iodlist(struct nvmet_fc_tgtport *tgtport) struct nvmet_fc_ls_iod *iod; int i; - iod = kcalloc(NVMET_LS_CTX_COUNT, sizeof(struct nvmet_fc_ls_iod), - GFP_KERNEL); + iod = kzalloc_objs(struct nvmet_fc_ls_iod, NVMET_LS_CTX_COUNT, + GFP_KERNEL); if (!iod) return -ENOMEM; @@ -789,7 +789,7 @@ nvmet_fc_alloc_target_queue(struct nvmet_fc_tgt_assoc *assoc, if (qid > NVMET_NR_QUEUES) return NULL; - queue = kzalloc(struct_size(queue, fod, sqsize), GFP_KERNEL); + queue = kzalloc_flex(*queue, fod, sqsize, GFP_KERNEL); if (!queue) return NULL; @@ -1034,7 +1034,7 @@ nvmet_fc_alloc_hostport(struct nvmet_fc_tgtport *tgtport, void *hosthandle) if (match) return match; - newhost = kzalloc(sizeof(*newhost), GFP_KERNEL); + newhost = kzalloc_obj(*newhost, GFP_KERNEL); if (!newhost) return ERR_PTR(-ENOMEM); @@ -1116,7 +1116,7 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle) if (!tgtport->pe) return NULL; - assoc = kzalloc(sizeof(*assoc), GFP_KERNEL); + assoc = kzalloc_obj(*assoc, GFP_KERNEL); if (!assoc) return NULL; @@ -2717,7 +2717,7 @@ nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *target_port, spin_unlock_irqrestore(&queue->qlock, flags); /* Now we need to dynamically allocate one */ - deferfcp = kmalloc(sizeof(*deferfcp), GFP_KERNEL); + deferfcp = kmalloc_obj(*deferfcp, GFP_KERNEL); if (!deferfcp) { /* release the queue lookup reference */ nvmet_fc_tgt_q_put(queue); @@ -2882,7 +2882,7 @@ nvmet_fc_add_port(struct nvmet_port *port) if (ret) return ret; - pe = kzalloc(sizeof(*pe), GFP_KERNEL); + pe = kzalloc_obj(*pe, GFP_KERNEL); if (!pe) return -ENOMEM; diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index c30e9a3e014f..8473e41e5856 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -559,7 +559,7 @@ fcloop_tgt_discovery_evt(struct nvmet_fc_target_port *tgtport) { struct fcloop_rscn *tgt_rscn; - tgt_rscn = kzalloc(sizeof(*tgt_rscn), GFP_KERNEL); + tgt_rscn = kzalloc_obj(*tgt_rscn, GFP_KERNEL); if (!tgt_rscn) return; @@ -766,7 +766,7 @@ fcloop_fcp_req(struct nvme_fc_local_port *localport, if (!rport->targetport) return -ECONNREFUSED; - tfcp_req = kzalloc(sizeof(*tfcp_req), GFP_ATOMIC); + tfcp_req = kzalloc_obj(*tfcp_req, GFP_ATOMIC); if (!tfcp_req) return -ENOMEM; @@ -1194,11 +1194,11 @@ fcloop_create_local_port(struct device *dev, struct device_attribute *attr, unsigned long flags; int ret = -ENOMEM; - lport = kzalloc(sizeof(*lport), GFP_KERNEL); + lport = kzalloc_obj(*lport, GFP_KERNEL); if (!lport) return -ENOMEM; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) goto out_free_lport; @@ -1345,7 +1345,7 @@ fcloop_alloc_nport(const char *buf, size_t count, bool remoteport) u32 opts_mask = (remoteport) ? RPORT_OPTS : TGTPORT_OPTS; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return NULL; @@ -1357,7 +1357,7 @@ fcloop_alloc_nport(const char *buf, size_t count, bool remoteport) if ((opts->mask & opts_mask) != opts_mask) goto out_free_opts; - newnport = kzalloc(sizeof(*newnport), GFP_KERNEL); + newnport = kzalloc_obj(*newnport, GFP_KERNEL); if (!newnport) goto out_free_opts; diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index 2d068439b129..6e810a91e6c5 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -228,8 +228,7 @@ static void nvmet_file_execute_rw(struct nvmet_req *req) } if (nr_bvec > NVMET_MAX_INLINE_BIOVEC) - req->f.bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec), - GFP_KERNEL); + req->f.bvec = kmalloc_objs(struct bio_vec, nr_bvec, GFP_KERNEL); else req->f.bvec = req->inline_bvec; diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index fc8e7c9ad858..575c5c31ea29 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -565,7 +565,7 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, struct nvme_loop_ctrl *ctrl; int ret; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return ERR_PTR(-ENOMEM); ctrl->ctrl.opts = opts; @@ -592,8 +592,8 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, ctrl->ctrl.kato = opts->kato; ctrl->port = nvme_loop_find_port(&ctrl->ctrl); - ctrl->queues = kcalloc(opts->nr_io_queues + 1, sizeof(*ctrl->queues), - GFP_KERNEL); + ctrl->queues = kzalloc_objs(*ctrl->queues, opts->nr_io_queues + 1, + GFP_KERNEL); if (!ctrl->queues) goto out_uninit_ctrl; diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c index 5d541c2a46a5..bac8b8f864ce 100644 --- a/drivers/nvme/target/passthru.c +++ b/drivers/nvme/target/passthru.c @@ -86,7 +86,7 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req) unsigned int max_hw_sectors; int page_shift; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) return NVME_SC_INTERNAL; @@ -178,7 +178,7 @@ static u16 nvmet_passthru_override_id_ns(struct nvmet_req *req) struct nvme_id_ns *id; int i; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) return NVME_SC_INTERNAL; diff --git a/drivers/nvme/target/pci-epf.c b/drivers/nvme/target/pci-epf.c index f858a6c9d7cb..f51a7de9f16a 100644 --- a/drivers/nvme/target/pci-epf.c +++ b/drivers/nvme/target/pci-epf.c @@ -502,9 +502,8 @@ static inline int nvmet_pci_epf_transfer(struct nvmet_pci_epf_ctrl *ctrl, static int nvmet_pci_epf_alloc_irq_vectors(struct nvmet_pci_epf_ctrl *ctrl) { - ctrl->irq_vectors = kcalloc(ctrl->nr_queues, - sizeof(struct nvmet_pci_epf_irq_vector), - GFP_KERNEL); + ctrl->irq_vectors = kzalloc_objs(struct nvmet_pci_epf_irq_vector, + ctrl->nr_queues, GFP_KERNEL); if (!ctrl->irq_vectors) return -ENOMEM; @@ -1563,13 +1562,13 @@ static int nvmet_pci_epf_alloc_queues(struct nvmet_pci_epf_ctrl *ctrl) { unsigned int qid; - ctrl->sq = kcalloc(ctrl->nr_queues, - sizeof(struct nvmet_pci_epf_queue), GFP_KERNEL); + ctrl->sq = kzalloc_objs(struct nvmet_pci_epf_queue, ctrl->nr_queues, + GFP_KERNEL); if (!ctrl->sq) return -ENOMEM; - ctrl->cq = kcalloc(ctrl->nr_queues, - sizeof(struct nvmet_pci_epf_queue), GFP_KERNEL); + ctrl->cq = kzalloc_objs(struct nvmet_pci_epf_queue, ctrl->nr_queues, + GFP_KERNEL); if (!ctrl->cq) { kfree(ctrl->sq); ctrl->sq = NULL; diff --git a/drivers/nvme/target/pr.c b/drivers/nvme/target/pr.c index cd22d8333314..254960a844ac 100644 --- a/drivers/nvme/target/pr.c +++ b/drivers/nvme/target/pr.c @@ -230,7 +230,7 @@ static u16 nvmet_pr_register(struct nvmet_req *req, u16 status = NVME_SC_SUCCESS; u64 nrkey = le64_to_cpu(d->nrkey); - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) return NVME_SC_INTERNAL; @@ -331,7 +331,7 @@ static u16 nvmet_pr_update_reg_attr(struct nvmet_pr *pr, return NVME_SC_SUCCESS; } - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) return NVME_SC_INTERNAL; @@ -380,7 +380,7 @@ static void nvmet_execute_pr_register(struct nvmet_req *req) u8 reg_act = cdw10 & 0x07; /* Reservation Register Action, bit 02:00 */ u16 status; - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { status = NVME_SC_INTERNAL; goto out; @@ -662,7 +662,7 @@ static void nvmet_execute_pr_acquire(struct nvmet_req *req) goto out; } - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { status = NVME_SC_INTERNAL; goto out; @@ -773,7 +773,7 @@ static void nvmet_execute_pr_release(struct nvmet_req *req) goto out; } - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kmalloc_obj(*d, GFP_KERNEL); if (!d) { status = NVME_SC_INTERNAL; goto out; @@ -1013,7 +1013,7 @@ static int nvmet_pr_alloc_and_insert_pc_ref(struct nvmet_ns *ns, struct nvmet_pr_per_ctrl_ref *pc_ref; int ret; - pc_ref = kmalloc(sizeof(*pc_ref), GFP_ATOMIC); + pc_ref = kmalloc_obj(*pc_ref, GFP_ATOMIC); if (!pc_ref) return -ENOMEM; diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index 9c12b2361a6d..ae2e27d9cc07 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -222,7 +222,7 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue) if (unlikely(!rsp)) { int ret; - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); if (unlikely(!rsp)) return NULL; ret = nvmet_rdma_alloc_rsp(queue->dev, rsp, @@ -317,7 +317,7 @@ static int nvmet_rdma_alloc_cmd(struct nvmet_rdma_device *ndev, struct nvmet_rdma_cmd *c, bool admin) { /* NVMe command / RDMA RECV */ - c->nvme_cmd = kmalloc(sizeof(*c->nvme_cmd), GFP_KERNEL); + c->nvme_cmd = kmalloc_obj(*c->nvme_cmd, GFP_KERNEL); if (!c->nvme_cmd) goto out; @@ -367,7 +367,7 @@ nvmet_rdma_alloc_cmds(struct nvmet_rdma_device *ndev, struct nvmet_rdma_cmd *cmds; int ret = -EINVAL, i; - cmds = kvcalloc(nr_cmds, sizeof(struct nvmet_rdma_cmd), GFP_KERNEL); + cmds = kvzalloc_objs(struct nvmet_rdma_cmd, nr_cmds, GFP_KERNEL); if (!cmds) goto out; @@ -401,7 +401,7 @@ static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev, struct nvmet_rdma_rsp *r, int tag) { /* NVMe CQE / RDMA SEND */ - r->req.cqe = kmalloc(sizeof(*r->req.cqe), GFP_KERNEL); + r->req.cqe = kmalloc_obj(*r->req.cqe, GFP_KERNEL); if (!r->req.cqe) goto out; @@ -455,8 +455,7 @@ nvmet_rdma_alloc_rsps(struct nvmet_rdma_queue *queue) NUMA_NO_NODE, false, true)) goto out; - queue->rsps = kvcalloc(nr_rsps, sizeof(struct nvmet_rdma_rsp), - GFP_KERNEL); + queue->rsps = kvzalloc_objs(struct nvmet_rdma_rsp, nr_rsps, GFP_KERNEL); if (!queue->rsps) goto out_free_sbitmap; @@ -1096,7 +1095,7 @@ nvmet_rdma_init_srq(struct nvmet_rdma_device *ndev) struct ib_srq *srq; int ret, i; - nsrq = kzalloc(sizeof(*nsrq), GFP_KERNEL); + nsrq = kzalloc_obj(*nsrq, GFP_KERNEL); if (!nsrq) return ERR_PTR(-ENOMEM); @@ -1155,7 +1154,7 @@ static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev) ndev->srq_count = min(ndev->device->num_comp_vectors, ndev->device->attrs.max_srq); - ndev->srqs = kcalloc(ndev->srq_count, sizeof(*ndev->srqs), GFP_KERNEL); + ndev->srqs = kzalloc_objs(*ndev->srqs, ndev->srq_count, GFP_KERNEL); if (!ndev->srqs) return -ENOMEM; @@ -1208,7 +1207,7 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id) goto out_unlock; } - ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); + ndev = kzalloc_obj(*ndev, GFP_KERNEL); if (!ndev) goto out_err; @@ -1430,7 +1429,7 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev, struct nvmet_rdma_queue *queue; int ret; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) { ret = NVME_RDMA_CM_NO_RSC; goto out_reject; @@ -1924,7 +1923,7 @@ static int nvmet_rdma_add_port(struct nvmet_port *nport) __kernel_sa_family_t af; int ret; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index bda816d66846..ac0a44bfa386 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -439,8 +439,7 @@ static int nvmet_tcp_map_data(struct nvmet_tcp_cmd *cmd) cmd->cur_sg = cmd->req.sg; if (nvmet_tcp_has_data_in(cmd)) { - cmd->iov = kmalloc_array(cmd->req.sg_cnt, - sizeof(*cmd->iov), GFP_KERNEL); + cmd->iov = kmalloc_objs(*cmd->iov, cmd->req.sg_cnt, GFP_KERNEL); if (!cmd->iov) goto err; } @@ -1513,7 +1512,7 @@ static int nvmet_tcp_alloc_cmds(struct nvmet_tcp_queue *queue) struct nvmet_tcp_cmd *cmds; int i, ret = -EINVAL, nr_cmds = queue->nr_cmds; - cmds = kvcalloc(nr_cmds, sizeof(struct nvmet_tcp_cmd), GFP_KERNEL); + cmds = kvzalloc_objs(struct nvmet_tcp_cmd, nr_cmds, GFP_KERNEL); if (!cmds) goto out; @@ -1901,7 +1900,7 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port, struct file *sock_file = NULL; int ret; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) { ret = -ENOMEM; goto out_release; @@ -2037,7 +2036,7 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport) __kernel_sa_family_t af; int ret; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c index 15a579cf528c..e895f6b3a308 100644 --- a/drivers/nvme/target/zns.c +++ b/drivers/nvme/target/zns.c @@ -73,7 +73,7 @@ void nvmet_execute_identify_ctrl_zns(struct nvmet_req *req) struct nvme_id_ctrl_zns *id; u16 status; - id = kzalloc(sizeof(*id), GFP_KERNEL); + id = kzalloc_obj(*id, GFP_KERNEL); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -104,7 +104,7 @@ void nvmet_execute_identify_ns_zns(struct nvmet_req *req) goto out; } - id_zns = kzalloc(sizeof(*id_zns), GFP_KERNEL); + id_zns = kzalloc_obj(*id_zns, GFP_KERNEL); if (!id_zns) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index c6180cf1dd91..2c838c0b2b7d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -650,7 +650,7 @@ int nvmem_add_one_cell(struct nvmem_device *nvmem, struct nvmem_cell_entry *cell; int rval; - cell = kzalloc(sizeof(*cell), GFP_KERNEL); + cell = kzalloc_obj(*cell, GFP_KERNEL); if (!cell) return -ENOMEM; @@ -908,7 +908,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (!config->reg_read && !config->reg_write) return ERR_PTR(-EINVAL); - nvmem = kzalloc(sizeof(*nvmem), GFP_KERNEL); + nvmem = kzalloc_obj(*nvmem, GFP_KERNEL); if (!nvmem) return ERR_PTR(-ENOMEM); @@ -1295,7 +1295,7 @@ static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry, struct nvmem_cell *cell; const char *name = NULL; - cell = kzalloc(sizeof(*cell), GFP_KERNEL); + cell = kzalloc_obj(*cell, GFP_KERNEL); if (!cell) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c index 7ebe53249035..13d5b9941059 100644 --- a/drivers/nvmem/layouts.c +++ b/drivers/nvmem/layouts.c @@ -96,7 +96,7 @@ static int nvmem_layout_create_device(struct nvmem_device *nvmem, struct device *dev; int ret; - layout = kzalloc(sizeof(*layout), GFP_KERNEL); + layout = kzalloc_obj(*layout, GFP_KERNEL); if (!layout) return -ENOMEM; diff --git a/drivers/of/address.c b/drivers/of/address.c index 4034d798c55a..590d2db007d2 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -929,7 +929,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) if (!num_ranges) return -EINVAL; - r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL); + r = kzalloc_objs(*r, num_ranges + 1, GFP_KERNEL); if (!r) return -ENOMEM; diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 2eaaddcb0ec4..1b3cc351a895 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -411,7 +411,7 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags) { struct property *new; - new = kzalloc(sizeof(*new), allocflags); + new = kzalloc_obj(*new, allocflags); if (!new) return NULL; @@ -454,7 +454,7 @@ struct device_node *__of_node_dup(const struct device_node *np, { struct device_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; node->full_name = kstrdup(full_name, GFP_KERNEL); @@ -908,7 +908,7 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action, if (WARN_ON(action >= ARRAY_SIZE(action_names))) return -EINVAL; - ce = kzalloc(sizeof(*ce), GFP_KERNEL); + ce = kzalloc_obj(*ce, GFP_KERNEL); if (!ce) return -ENOMEM; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index f374d8b212b8..55c2de65a13a 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -669,7 +669,7 @@ void __init of_irq_init(const struct of_device_id *matches) * Here, we allocate and populate an of_intc_desc with the node * pointer, interrupt-parent device_node etc. */ - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) { of_node_put(np); goto err; diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 31c5bc751d0d..0344c55300b6 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -646,7 +646,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, if (!rmem || !rmem->ops || !rmem->ops->device_init) return -EINVAL; - rd = kmalloc(sizeof(struct rmem_assigned_device), GFP_KERNEL); + rd = kmalloc_obj(struct rmem_assigned_device, GFP_KERNEL); if (!rd) return -ENOMEM; diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 5b4f42230e6c..87faec65c865 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -248,7 +248,7 @@ static struct property *dup_and_fixup_symbol_prop( return NULL; target_path_len = strlen(target_path); - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); if (!new_prop) goto err_free_target_path; @@ -784,7 +784,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, of_node_put(node); } - fragments = kcalloc(cnt, sizeof(*fragments), GFP_KERNEL); + fragments = kzalloc_objs(*fragments, cnt, GFP_KERNEL); if (!fragments) { ret = -ENOMEM; goto err_out; @@ -1009,7 +1009,7 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, if (overlay_fdt_size < size) return -EINVAL; - ovcs = kzalloc(sizeof(*ovcs), GFP_KERNEL); + ovcs = kzalloc_obj(*ovcs, GFP_KERNEL); if (!ovcs) return -ENOMEM; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d90b1677d84e..d9a717c47ad6 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -111,7 +111,7 @@ struct platform_device *of_device_alloc(struct device_node *np, /* Populate the resource table */ if (num_reg) { - res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL); + res = kzalloc_objs(*res, num_reg, GFP_KERNEL); if (!res) { platform_device_put(dev); return NULL; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a9cc2c990562..a8b70b49e780 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -197,7 +197,7 @@ static void __init of_unittest_dynamic(void) } /* Array of 4 properties for the purpose of testing */ - prop = kcalloc(4, sizeof(*prop), GFP_KERNEL); + prop = kzalloc_objs(*prop, 4, GFP_KERNEL); if (!prop) { unittest(0, "kzalloc() failed\n"); return; @@ -379,7 +379,7 @@ static void __init of_unittest_check_phandles(void) } } - nh = kzalloc(sizeof(*nh), GFP_KERNEL); + nh = kzalloc_obj(*nh, GFP_KERNEL); if (!nh) return; @@ -1136,7 +1136,7 @@ static void __init of_unittest_dma_ranges_one(const char *path, dma_addr_t dma_addr; struct device *dev_bogus; - dev_bogus = kzalloc(sizeof(struct device), GFP_KERNEL); + dev_bogus = kzalloc_obj(struct device, GFP_KERNEL); if (!dev_bogus) { unittest(0, "kzalloc() failed\n"); kfree(map); @@ -2275,7 +2275,7 @@ static int unittest_gpio_probe(struct platform_device *pdev) unittest_gpio_probe_count++; - devptr = kzalloc(sizeof(*devptr), GFP_KERNEL); + devptr = kzalloc_obj(*devptr, GFP_KERNEL); if (!devptr) return -ENOMEM; diff --git a/drivers/opp/core.c b/drivers/opp/core.c index ae43c656f108..a109d4dd5316 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1532,7 +1532,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) * Allocate a new OPP table. In the infrequent case where a new * device is needed to be added, we pay this penalty. */ - opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL); + opp_table = kzalloc_obj(*opp_table, GFP_KERNEL); if (!opp_table) return ERR_PTR(-ENOMEM); @@ -2260,9 +2260,8 @@ static int _opp_set_regulators(struct opp_table *opp_table, struct device *dev, if (opp_table->regulators) return 0; - opp_table->regulators = kmalloc_array(count, - sizeof(*opp_table->regulators), - GFP_KERNEL); + opp_table->regulators = kmalloc_objs(*opp_table->regulators, count, + GFP_KERNEL); if (!opp_table->regulators) return -ENOMEM; @@ -2364,8 +2363,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, if (opp_table->clks) return 0; - opp_table->clks = kmalloc_array(count, sizeof(*opp_table->clks), - GFP_KERNEL); + opp_table->clks = kmalloc_objs(*opp_table->clks, count, GFP_KERNEL); if (!opp_table->clks) return -ENOMEM; @@ -2550,7 +2548,7 @@ int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) unsigned int id; int ret; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c index a6da7ee3ec76..9ea7c323a8b9 100644 --- a/drivers/opp/cpu.c +++ b/drivers/opp/cpu.c @@ -51,7 +51,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, if (max_opps <= 0) return max_opps ? max_opps : -ENODATA; - freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); if (!freq_table) return -ENOMEM; diff --git a/drivers/opp/of.c b/drivers/opp/of.c index a268c2b250c0..a6e16f406289 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -303,7 +303,8 @@ static int _of_opp_alloc_required_opps(struct opp_table *opp_table, if (!count) return 0; - opp->required_opps = kcalloc(count, sizeof(*opp->required_opps), GFP_KERNEL); + opp->required_opps = kzalloc_objs(*opp->required_opps, count, + GFP_KERNEL); if (!opp->required_opps) return -ENOMEM; @@ -469,7 +470,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev, } num_paths = count / 2; - paths = kcalloc(num_paths, sizeof(*paths), GFP_KERNEL); + paths = kzalloc_objs(*paths, num_paths, GFP_KERNEL); if (!paths) return -ENOMEM; diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c index 5f0fb3ea385b..b4281f85415b 100644 --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -127,8 +127,7 @@ static int _store_optimized_voltages(struct device *dev, goto out; } - table = kcalloc(data->num_vdd_table, sizeof(*data->vdd_table), - GFP_KERNEL); + table = kzalloc_objs(*data->vdd_table, data->num_vdd_table, GFP_KERNEL); if (!table) { ret = -ENOMEM; goto out; diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 4e7071714356..78bee83bcadd 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1520,7 +1520,7 @@ static int __init ccio_probe(struct parisc_device *dev) struct ioc *ioc, **ioc_p = &ioc_list; struct pci_hba_data *hba; - ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); + ioc = kzalloc_obj(struct ioc, GFP_KERNEL); if (ioc == NULL) { printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); return -ENOMEM; @@ -1550,7 +1550,7 @@ static int __init ccio_probe(struct parisc_device *dev) } hppa_dma_ops = &ccio_ops; - hba = kzalloc(sizeof(*hba), GFP_KERNEL); + hba = kzalloc_obj(*hba, GFP_KERNEL); /* if this fails, no I/O cards will work, so may as well bug */ BUG_ON(hba == NULL); diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 01a50a051296..58c1f5433cbb 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -990,7 +990,7 @@ static int __init dino_probe(struct parisc_device *dev) */ } - dino_dev = kzalloc(sizeof(struct dino_device), GFP_KERNEL); + dino_dev = kzalloc_obj(struct dino_device, GFP_KERNEL); if (!dino_dev) { printk("dino_init_chip - couldn't alloc dino_device\n"); return 1; diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c index f0cb31198a8f..88cca5035c67 100644 --- a/drivers/parisc/eisa_enumerator.c +++ b/drivers/parisc/eisa_enumerator.c @@ -86,7 +86,7 @@ static int configure_memory(const unsigned char *buf, for (i=0;iname = name; @@ -178,7 +178,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent, for (i=0;iname = board; res->start = get_16(buf+len+1); res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1; diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c index 0f9d80384e3d..72f9e7762cc5 100644 --- a/drivers/parisc/hppb.c +++ b/drivers/parisc/hppb.c @@ -54,7 +54,7 @@ static int __init hppb_probe(struct parisc_device *dev) } if(card->hpa) { - card->next = kzalloc(sizeof(struct hppb_card), GFP_KERNEL); + card->next = kzalloc_obj(struct hppb_card, GFP_KERNEL); if(!card->next) { printk(KERN_ERR "HP-PB: Unable to allocate memory.\n"); return 1; diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index a42552608fe4..e8a60a1bfd43 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -221,7 +221,7 @@ static size_t irt_num_entry; static struct irt_entry *iosapic_alloc_irt(int num_entries) { - return kcalloc(num_entries, sizeof(struct irt_entry), GFP_KERNEL); + return kzalloc_objs(struct irt_entry, num_entries, GFP_KERNEL); } /** @@ -915,7 +915,7 @@ void *iosapic_register(unsigned long hpa, void __iomem *vaddr) return NULL; } - isi = kzalloc(sizeof(struct iosapic_info), GFP_KERNEL); + isi = kzalloc_obj(struct iosapic_info, GFP_KERNEL); if (!isi) { BUG(); return NULL; @@ -927,8 +927,8 @@ void *iosapic_register(unsigned long hpa, void __iomem *vaddr) isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; DBG_IRT("iosapic_register: num vectors = %d\n", isi->isi_num_vectors); - vip = isi->isi_vector = kcalloc(isi->isi_num_vectors, - sizeof(struct vector_info), GFP_KERNEL); + vip = isi->isi_vector = kzalloc_objs(struct vector_info, + isi->isi_num_vectors, GFP_KERNEL); if (vip == NULL) { kfree(isi); return NULL; diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c index 73c93e9cfa51..f9cb9bb3af77 100644 --- a/drivers/parisc/lasi.c +++ b/drivers/parisc/lasi.c @@ -162,7 +162,7 @@ static int __init lasi_init_chip(struct parisc_device *dev) struct gsc_asic *lasi; int ret; - lasi = kzalloc(sizeof(*lasi), GFP_KERNEL); + lasi = kzalloc_obj(*lasi, GFP_KERNEL); if (!lasi) return -ENOMEM; diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 1d29fa13650b..c608854c2f0d 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1025,11 +1025,11 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */ int i; - pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); + pa_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t, GFP_KERNEL); if (!pa_pdc_cell) return; - io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); + io_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t, GFP_KERNEL); if (!io_pdc_cell) { kfree(pa_pdc_cell); return; @@ -1546,7 +1546,7 @@ lba_driver_probe(struct parisc_device *dev) ** have an IRT entry will get NULL back from iosapic code. */ - lba_dev = kzalloc(sizeof(struct lba_device), GFP_KERNEL); + lba_dev = kzalloc_obj(struct lba_device, GFP_KERNEL); if (!lba_dev) { printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n"); return(1); diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index eefb2bac8443..9eadbfd70663 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -1939,7 +1939,7 @@ static int __init sba_driver_callback(struct parisc_device *dev) printk(KERN_INFO "%s found %s at 0x%llx\n", MODULE_NAME, version, (unsigned long long)dev->hpa.start); - sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL); + sba_dev = kzalloc_obj(struct sba_device, GFP_KERNEL); if (!sba_dev) { printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); return -ENOMEM; diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c index 834dbe9a767b..94947be33bd0 100644 --- a/drivers/parisc/wax.c +++ b/drivers/parisc/wax.c @@ -70,7 +70,7 @@ static int __init wax_init_chip(struct parisc_device *dev) struct parisc_device *parent; int ret; - wax = kzalloc(sizeof(*wax), GFP_KERNEL); + wax = kzalloc_obj(*wax, GFP_KERNEL); if (!wax) return -ENOMEM; diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 2231dbfd870d..2e3b95ae2718 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -51,7 +51,7 @@ static int assign_addrs(struct parport *port); static void add_dev(int devnum, struct parport *port, int daisy) { struct daisydev *newdev, **p; - newdev = kmalloc(sizeof(struct daisydev), GFP_KERNEL); + newdev = kmalloc_obj(struct daisydev, GFP_KERNEL); if (newdev) { newdev->port = port; newdev->daisy = daisy; diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 8e7e3ac4bb87..f8318db9a75f 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -87,7 +87,7 @@ static int parport_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "parport_attach()\n"); /* Create new parport device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; link->priv = info; info->p_dev = link; diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index c7e18382dc01..f442c1fb0d7a 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -234,7 +234,7 @@ static struct parport *parport_gsc_probe_port(unsigned long base, struct parport tmp; struct parport *p = &tmp; - priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); + priv = kzalloc_obj(struct parport_gsc_private, GFP_KERNEL); if (!priv) { printk(KERN_DEBUG "parport (0x%lx): no memory!\n", base); return NULL; diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c index 0919ed99ba94..84c4bba2756e 100644 --- a/drivers/parport/parport_ip32.c +++ b/drivers/parport/parport_ip32.c @@ -2031,8 +2031,8 @@ static __init struct parport *parport_ip32_probe_port(void) parport_ip32_make_isa_registers(®s, &mace->isa.parallel, &mace->isa.ecp1284, 8 /* regshift */); - ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL); - priv = kmalloc(sizeof(struct parport_ip32_private), GFP_KERNEL); + ops = kmalloc_obj(struct parport_operations, GFP_KERNEL); + priv = kmalloc_obj(struct parport_ip32_private, GFP_KERNEL); p = parport_register_port(0, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, ops); if (ops == NULL || priv == NULL || p == NULL) { err = -ENOMEM; diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index f33b5d1ddfc1..99d44864b9ff 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -2056,11 +2056,11 @@ static struct parport *__parport_pc_probe_port(unsigned long int base, } } - ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL); + ops = kmalloc_obj(struct parport_operations, GFP_KERNEL); if (!ops) goto out1; - priv = kmalloc(sizeof(struct parport_pc_private), GFP_KERNEL); + priv = kmalloc_obj(struct parport_pc_private, GFP_KERNEL); if (!priv) goto out2; @@ -2880,7 +2880,7 @@ static int parport_pc_pci_probe(struct pci_dev *dev, if (err) return err; - data = kmalloc(sizeof(struct pci_parport_data), GFP_KERNEL); + data = kmalloc_obj(struct pci_parport_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 427abdf3c4c4..44e5d37afbf8 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -430,7 +430,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, int device; int ret; - tmp = kzalloc(sizeof(struct parport), GFP_KERNEL); + tmp = kzalloc_obj(struct parport, GFP_KERNEL); if (!tmp) return NULL; @@ -709,11 +709,11 @@ parport_register_dev_model(struct parport *port, const char *name, parport_get_port(port); - par_dev = kzalloc(sizeof(*par_dev), GFP_KERNEL); + par_dev = kzalloc_obj(*par_dev, GFP_KERNEL); if (!par_dev) goto err_put_port; - par_dev->state = kzalloc(sizeof(*par_dev->state), GFP_KERNEL); + par_dev->state = kzalloc_obj(*par_dev->state, GFP_KERNEL); if (!par_dev->state) goto err_put_par_dev; diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 51af9e6c541c..e71aeecba11d 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -65,7 +65,7 @@ void pci_bus_add_resource(struct pci_bus *bus, struct resource *res) { struct pci_bus_resource *bus_res; - bus_res = kzalloc(sizeof(struct pci_bus_resource), GFP_KERNEL); + bus_res = kzalloc_obj(struct pci_bus_resource, GFP_KERNEL); if (!bus_res) { dev_err(&bus->dev, "can't add %pR resource\n", res); return; diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 7fcba05cec30..3f106bd9fe7e 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -945,7 +945,7 @@ static int hv_pci_irqchip_init(void) struct irq_domain *irq_domain_parent = NULL; int ret = -ENOMEM; - chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); if (!chip_data) return ret; @@ -1932,7 +1932,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) hv_int_desc_free(hpdev, int_desc); } - int_desc = kzalloc(sizeof(*int_desc), GFP_ATOMIC); + int_desc = kzalloc_obj(*int_desc, GFP_ATOMIC); if (!int_desc) goto drop_reference; @@ -2592,7 +2592,7 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus, unsigned long flags; int ret; - hpdev = kzalloc(sizeof(*hpdev), GFP_KERNEL); + hpdev = kzalloc_obj(*hpdev, GFP_KERNEL); if (!hpdev) return NULL; @@ -2831,7 +2831,7 @@ static int hv_pci_start_relations_work(struct hv_pcibus_device *hbus, return -ENOENT; } - dr_wrk = kzalloc(sizeof(*dr_wrk), GFP_NOWAIT); + dr_wrk = kzalloc_obj(*dr_wrk, GFP_NOWAIT); if (!dr_wrk) return -ENOMEM; @@ -2871,8 +2871,7 @@ static void hv_pci_devices_present(struct hv_pcibus_device *hbus, struct hv_dr_state *dr; int i; - dr = kzalloc(struct_size(dr, func, relations->device_count), - GFP_NOWAIT); + dr = kzalloc_flex(*dr, func, relations->device_count, GFP_NOWAIT); if (!dr) return; @@ -2906,8 +2905,7 @@ static void hv_pci_devices_present2(struct hv_pcibus_device *hbus, struct hv_dr_state *dr; int i; - dr = kzalloc(struct_size(dr, func, relations->device_count), - GFP_NOWAIT); + dr = kzalloc_flex(*dr, func, relations->device_count, GFP_NOWAIT); if (!dr) return; @@ -3715,7 +3713,7 @@ static int hv_pci_probe(struct hv_device *hdev, if (!bridge) return -ENOMEM; - hbus = kzalloc(sizeof(*hbus), GFP_KERNEL); + hbus = kzalloc_obj(*hbus, GFP_KERNEL); if (!hbus) return -ENOMEM; diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index ec6afc38e898..44bfe301b557 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -270,7 +270,7 @@ static int vmd_msi_alloc(struct irq_domain *domain, unsigned int virq, struct vmd_irq *vmdirq; for (int i = 0; i < nr_irqs; ++i) { - vmdirq = kzalloc(sizeof(*vmdirq), GFP_KERNEL); + vmdirq = kzalloc_obj(*vmdirq, GFP_KERNEL); if (!vmdirq) { vmd_msi_free(domain, virq, i); return -ENOMEM; diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c index 62be9c8dbc52..811276ae9b13 100644 --- a/drivers/pci/doe.c +++ b/drivers/pci/doe.c @@ -167,7 +167,7 @@ static int pci_doe_sysfs_feature_populate(struct pci_dev *pdev, xa_for_each(&doe_mb->feats, i, entry) num_features++; - attrs = kcalloc(num_features, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, num_features, GFP_KERNEL); if (!attrs) { pci_warn(pdev, "Failed allocating the device_attribute array\n"); return -ENOMEM; @@ -641,7 +641,7 @@ static struct pci_doe_mb *pci_doe_create_mb(struct pci_dev *pdev, struct pci_doe_mb *doe_mb; int rc; - doe_mb = kzalloc(sizeof(*doe_mb), GFP_KERNEL); + doe_mb = kzalloc_obj(*doe_mb, GFP_KERNEL); if (!doe_mb) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c index 260b7de2dbd5..8c7559e73bb6 100644 --- a/drivers/pci/ecam.c +++ b/drivers/pci/ecam.c @@ -37,7 +37,7 @@ struct pci_config_window *pci_ecam_create(struct device *dev, if (busr->start > busr->end) return ERR_PTR(-EINVAL); - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return ERR_PTR(-ENOMEM); @@ -75,7 +75,7 @@ struct pci_config_window *pci_ecam_create(struct device *dev, } if (per_bus_mapping) { - cfg->winp = kcalloc(bus_range, sizeof(*cfg->winp), GFP_KERNEL); + cfg->winp = kzalloc_objs(*cfg->winp, bus_range, GFP_KERNEL); if (!cfg->winp) goto err_exit_malloc; } else { diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 27de533f0571..ccee5c6b6ad7 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -525,7 +525,7 @@ static int pci_epf_mhi_edma_read_async(struct mhi_ep_cntrl *mhi_cntrl, goto err_unmap; } - transfer = kzalloc(sizeof(*transfer), GFP_KERNEL); + transfer = kzalloc_obj(*transfer, GFP_KERNEL); if (!transfer) { ret = -ENOMEM; goto err_unmap; @@ -604,7 +604,7 @@ static int pci_epf_mhi_edma_write_async(struct mhi_ep_cntrl *mhi_cntrl, goto err_unmap; } - transfer = kzalloc(sizeof(*transfer), GFP_KERNEL); + transfer = kzalloc_obj(*transfer, GFP_KERNEL); if (!transfer) { ret = -ENOMEM; goto err_unmap; diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 0cb7af0919dc..69f6ac37cdd0 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -872,7 +872,7 @@ static void pci_epf_test_bar_subrange_setup(struct pci_epf_test *epf_test, sub_size = bar->size / nsub; - submap = kcalloc(nsub, sizeof(*submap), GFP_KERNEL); + submap = kzalloc_objs(*submap, nsub, GFP_KERNEL); if (!submap) goto err; diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c index 8b392a8363bb..6c14cf85d336 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -274,7 +274,7 @@ struct config_group *pci_ep_cfs_add_epc_group(const char *name) struct config_group *group; struct pci_epc_group *epc_group; - epc_group = kzalloc(sizeof(*epc_group), GFP_KERNEL); + epc_group = kzalloc_obj(*epc_group, GFP_KERNEL); if (!epc_group) { ret = -ENOMEM; goto err; @@ -599,7 +599,7 @@ static struct config_group *pci_epf_make(struct config_group *group, char *epf_name; int index, err; - epf_group = kzalloc(sizeof(*epf_group), GFP_KERNEL); + epf_group = kzalloc_obj(*epf_group, GFP_KERNEL); if (!epf_group) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/endpoint/pci-ep-msi.c b/drivers/pci/endpoint/pci-ep-msi.c index 1b58357b905f..4625dc9827bc 100644 --- a/drivers/pci/endpoint/pci-ep-msi.c +++ b/drivers/pci/endpoint/pci-ep-msi.c @@ -67,7 +67,7 @@ int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 num_db) dev_set_msi_domain(epc->dev.parent, domain); - msg = kcalloc(num_db, sizeof(struct pci_epf_doorbell_msg), GFP_KERNEL); + msg = kzalloc_objs(struct pci_epf_doorbell_msg, num_db, GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index 068155819c57..d6998e637d3c 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -982,7 +982,7 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops, goto err_ret; } - epc = kzalloc(sizeof(*epc), GFP_KERNEL); + epc = kzalloc_obj(*epc, GFP_KERNEL); if (!epc) { ret = -ENOMEM; goto err_ret; diff --git a/drivers/pci/endpoint/pci-epc-mem.c b/drivers/pci/endpoint/pci-epc-mem.c index 218a60e945db..a3b5f8d1767c 100644 --- a/drivers/pci/endpoint/pci-epc-mem.c +++ b/drivers/pci/endpoint/pci-epc-mem.c @@ -62,7 +62,7 @@ int pci_epc_multi_mem_init(struct pci_epc *epc, if (!windows || !num_windows) return -EINVAL; - epc->windows = kcalloc(num_windows, sizeof(*epc->windows), GFP_KERNEL); + epc->windows = kzalloc_objs(*epc->windows, num_windows, GFP_KERNEL); if (!epc->windows) return -ENOMEM; @@ -74,7 +74,7 @@ int pci_epc_multi_mem_init(struct pci_epc *epc, pages = windows[i].size >> page_shift; bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) { ret = -ENOMEM; i--; diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 9a505c796370..c44f4ddfd60b 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -535,7 +535,7 @@ struct pci_epf *pci_epf_create(const char *name) struct device *dev; int len; - epf = kzalloc(sizeof(*epf), GFP_KERNEL); + epf = kzalloc_obj(*epf, GFP_KERNEL); if (!epf) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 9dad14e80bcf..051af60f999a 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c @@ -260,7 +260,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot, int retval = -ENOMEM; char name[SLOT_NAME_SIZE]; - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) goto error; diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 5b1f271c6034..55620e29b457 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -60,7 +60,7 @@ static struct acpiphp_context *acpiphp_init_context(struct acpi_device *adev) { struct acpiphp_context *context; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return NULL; @@ -279,7 +279,7 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, if (slot->device == device) goto slot_found; - slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL); + slot = kzalloc_obj(struct acpiphp_slot, GFP_KERNEL); if (!slot) { acpi_lock_hp_context(); acpiphp_put_context(context); @@ -869,7 +869,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) return; handle = adev->handle; - bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); + bridge = kzalloc_obj(struct acpiphp_bridge, GFP_KERNEL); if (!bridge) return; @@ -889,7 +889,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) if (pci_is_root_bus(bridge->pci_bus)) { struct acpiphp_root_context *root_context; - root_context = kzalloc(sizeof(*root_context), GFP_KERNEL); + root_context = kzalloc_obj(*root_context, GFP_KERNEL); if (!root_context) goto err; diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index 18e01cd55a8e..f86e39e9dd68 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -141,7 +141,7 @@ static union apci_descriptor *ibm_slot_from_id(int id) ibm_slot_done: if (ret) { - ret = kmalloc(sizeof(union apci_descriptor), GFP_KERNEL); + ret = kmalloc_obj(union apci_descriptor, GFP_KERNEL); if (ret) memcpy(ret, des, sizeof(union apci_descriptor)); } diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index dd93e53ea7c2..50793ca10526 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -189,7 +189,7 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last) * with the pci_hotplug subsystem. */ for (i = first; i <= last; ++i) { - slot = kzalloc(sizeof(struct slot), GFP_KERNEL); + slot = kzalloc_obj(struct slot, GFP_KERNEL); if (!slot) { status = -ENOMEM; goto error; diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 47a3ed16159a..158859352185 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -593,7 +593,7 @@ static int ctrl_slot_setup(struct controller *ctrl, slot_number = ctrl->first_slot; while (number_of_slots) { - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) { result = -ENOMEM; goto error; @@ -822,7 +822,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_disable_device; } - ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL); + ctrl = kzalloc_obj(struct controller, GFP_KERNEL); if (!ctrl) { rc = -ENOMEM; goto err_disable_device; diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 760a5dec0431..2c63bdc61306 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -428,7 +428,7 @@ static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **h /* this one isn't an aligned length, so we'll make a new entry * and split it up. */ - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -553,7 +553,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -573,7 +573,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size /* this one is longer than we need * so we'll make a new entry and split it up */ - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -650,7 +650,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz if ((max->length - (temp_dword - max->base)) < size) continue; - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -668,7 +668,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz /* this one isn't end aligned properly at the top * so we'll make a new entry and split it up */ - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -747,7 +747,7 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -767,7 +767,7 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) /* this one is longer than we need * so we'll make a new entry and split it up */ - split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); + split_node = kmalloc_obj(*split_node, GFP_KERNEL); if (!split_node) return NULL; @@ -955,7 +955,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) struct pci_func *new_slot; struct pci_func *next; - new_slot = kzalloc(sizeof(*new_slot), GFP_KERNEL); + new_slot = kzalloc_obj(*new_slot, GFP_KERNEL); if (new_slot == NULL) return new_slot; @@ -2435,10 +2435,10 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func /* Make copies of the nodes we are going to pass down so that * if there is a problem,we can just use these to free resources */ - hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL); - hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL); - hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL); - hold_p_mem_node = kmalloc(sizeof(*hold_p_mem_node), GFP_KERNEL); + hold_bus_node = kmalloc_obj(*hold_bus_node, GFP_KERNEL); + hold_IO_node = kmalloc_obj(*hold_IO_node, GFP_KERNEL); + hold_mem_node = kmalloc_obj(*hold_mem_node, GFP_KERNEL); + hold_p_mem_node = kmalloc_obj(*hold_p_mem_node, GFP_KERNEL); if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { kfree(hold_bus_node); diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 7a65d427ac11..83c97f72ca3b 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c @@ -504,7 +504,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) return 2; while (nummem--) { - mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); if (!mem_node) break; @@ -532,7 +532,8 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) } while (numpmem--) { - p_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc_obj(struct pci_resource, + GFP_KERNEL); if (!p_mem_node) break; @@ -560,7 +561,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) } while (numio--) { - io_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); if (!io_node) break; @@ -588,7 +589,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) } while (numbus--) { - bus_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + bus_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); if (!bus_node) break; diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 88929360fe77..03e2391f6786 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c @@ -151,8 +151,8 @@ int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) struct pci_bus *fakebus; u16 temp_word; - fakedev = kmalloc(sizeof(*fakedev), GFP_KERNEL); - fakebus = kmalloc(sizeof(*fakebus), GFP_KERNEL); + fakedev = kmalloc_obj(*fakedev, GFP_KERNEL); + fakebus = kmalloc_obj(*fakebus, GFP_KERNEL); if (!fakedev || !fakebus) { kfree(fakedev); kfree(fakebus); @@ -721,7 +721,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); - bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL); + bus_node = kmalloc_obj(*bus_node, GFP_KERNEL); if (!bus_node) return -ENOMEM; @@ -736,7 +736,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length); if ((b_base <= b_length) && (save_command & 0x01)) { - io_node = kmalloc(sizeof(*io_node), GFP_KERNEL); + io_node = kmalloc_obj(*io_node, GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -752,7 +752,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (save_command & 0x02)) { - mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node, GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -768,7 +768,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (save_command & 0x02)) { - p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL); + p_mem_node = kmalloc_obj(*p_mem_node, + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -799,8 +800,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFFE; temp_register = (~temp_register) + 1; - io_node = kmalloc(sizeof(*io_node), - GFP_KERNEL); + io_node = kmalloc_obj(*io_node, + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -817,8 +818,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - p_mem_node = kmalloc(sizeof(*p_mem_node), - GFP_KERNEL); + p_mem_node = kmalloc_obj(*p_mem_node, + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -834,8 +835,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - mem_node = kmalloc(sizeof(*mem_node), - GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node, + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -871,8 +872,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFFE; temp_register = (~temp_register) + 1; - io_node = kmalloc(sizeof(*io_node), - GFP_KERNEL); + io_node = kmalloc_obj(*io_node, + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -888,8 +889,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - p_mem_node = kmalloc(sizeof(*p_mem_node), - GFP_KERNEL); + p_mem_node = kmalloc_obj(*p_mem_node, + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -905,8 +906,8 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - mem_node = kmalloc(sizeof(*mem_node), - GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node, + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -1293,7 +1294,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st temp_dword = io_base + io_length; if ((io_base) && (temp_dword < 0x10000)) { - io_node = kmalloc(sizeof(*io_node), GFP_KERNEL); + io_node = kmalloc_obj(*io_node, GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -1315,7 +1316,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st /* If we've got a valid memory base, use it */ temp_dword = mem_base + mem_length; if ((mem_base) && (temp_dword < 0x10000)) { - mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node, GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -1340,7 +1341,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st */ temp_dword = pre_mem_base + pre_mem_length; if ((pre_mem_base) && (temp_dword < 0x10000)) { - p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL); + p_mem_node = kmalloc_obj(*p_mem_node, GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -1365,7 +1366,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st * populated slots that don't have PCI-PCI bridges */ if (secondary_bus && (secondary_bus != primary_bus)) { - bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL); + bus_node = kmalloc_obj(*bus_node, GFP_KERNEL); if (!bus_node) return -ENOMEM; diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index 6143ebf71f21..055fff069ce3 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c @@ -134,7 +134,7 @@ static int open(struct inode *inode, struct file *file) int retval = -ENOMEM; mutex_lock(&cpqphp_mutex); - dbg = kmalloc(sizeof(*dbg), GFP_KERNEL); + dbg = kmalloc_obj(*dbg, GFP_KERNEL); if (!dbg) goto exit; dbg->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index 197997e264a2..af4e8b032093 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -624,11 +624,11 @@ static u8 bus_structure_fixup(u8 busno) if (pci_find_bus(0, busno) || !(ibmphp_find_same_bus_num(busno))) return 1; - bus = kmalloc(sizeof(*bus), GFP_KERNEL); + bus = kmalloc_obj(*bus, GFP_KERNEL); if (!bus) return 1; - dev = kmalloc(sizeof(*dev), GFP_KERNEL); + dev = kmalloc_obj(*dev, GFP_KERNEL); if (!dev) { kfree(bus); return 1; @@ -986,7 +986,7 @@ static int enable_slot(struct hotplug_slot *hs) goto error_power; } - slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); + slot_cur->func = kzalloc_obj(struct pci_func, GFP_KERNEL); if (!slot_cur->func) { /* do update_slot_info here? */ rc = -ENOMEM; @@ -1093,7 +1093,7 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) if (slot_cur->func == NULL) { /* We need this for functions that were there on bootup */ - slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); + slot_cur->func = kzalloc_obj(struct pci_func, GFP_KERNEL); if (!slot_cur->func) { rc = -ENOMEM; goto error; @@ -1187,7 +1187,7 @@ static int __init ibmphp_init(void) info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); - ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL); + ibmphp_pci_bus = kmalloc_obj(*ibmphp_pci_bus, GFP_KERNEL); if (!ibmphp_pci_bus) { rc = -ENOMEM; goto exit; diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index 7fb75401ad8a..bfd9f11c2d39 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c @@ -57,7 +57,7 @@ static int ebda_rio_table(void); static struct ebda_hpc_list * __init alloc_ebda_hpc_list(void) { - return kzalloc(sizeof(struct ebda_hpc_list), GFP_KERNEL); + return kzalloc_obj(struct ebda_hpc_list, GFP_KERNEL); } static struct controller *alloc_ebda_hpc(u32 slot_count, u32 bus_count) @@ -66,16 +66,16 @@ static struct controller *alloc_ebda_hpc(u32 slot_count, u32 bus_count) struct ebda_hpc_slot *slots; struct ebda_hpc_bus *buses; - controller = kzalloc(sizeof(struct controller), GFP_KERNEL); + controller = kzalloc_obj(struct controller, GFP_KERNEL); if (!controller) goto error; - slots = kcalloc(slot_count, sizeof(struct ebda_hpc_slot), GFP_KERNEL); + slots = kzalloc_objs(struct ebda_hpc_slot, slot_count, GFP_KERNEL); if (!slots) goto error_contr; controller->slots = slots; - buses = kcalloc(bus_count, sizeof(struct ebda_hpc_bus), GFP_KERNEL); + buses = kzalloc_objs(struct ebda_hpc_bus, bus_count, GFP_KERNEL); if (!buses) goto error_slots; controller->buses = buses; @@ -98,12 +98,12 @@ static void free_ebda_hpc(struct controller *controller) static struct ebda_rsrc_list * __init alloc_ebda_rsrc_list(void) { - return kzalloc(sizeof(struct ebda_rsrc_list), GFP_KERNEL); + return kzalloc_obj(struct ebda_rsrc_list, GFP_KERNEL); } static struct ebda_pci_rsrc *alloc_ebda_pci_rsrc(void) { - return kzalloc(sizeof(struct ebda_pci_rsrc), GFP_KERNEL); + return kzalloc_obj(struct ebda_pci_rsrc, GFP_KERNEL); } static void __init print_bus_info(void) @@ -352,7 +352,8 @@ int __init ibmphp_access_ebda(void) debug("now enter io table ---\n"); debug("rio blk id: %x\n", blk_id); - rio_table_ptr = kzalloc(sizeof(struct rio_table_hdr), GFP_KERNEL); + rio_table_ptr = kzalloc_obj(struct rio_table_hdr, + GFP_KERNEL); if (!rio_table_ptr) { rc = -ENOMEM; goto out; @@ -408,7 +409,7 @@ static int __init ebda_rio_table(void) // we do concern about rio details for (i = 0; i < rio_table_ptr->riodev_count; i++) { - rio_detail_ptr = kzalloc(sizeof(struct rio_detail), GFP_KERNEL); + rio_detail_ptr = kzalloc_obj(struct rio_detail, GFP_KERNEL); if (!rio_detail_ptr) return -ENOMEM; rio_detail_ptr->rio_node_id = readb(io_mem + offset); @@ -461,7 +462,7 @@ static int __init combine_wpg_for_chassis(void) list_for_each_entry(rio_detail_ptr, &rio_vg_head, rio_detail_list) { opt_rio_ptr = search_opt_vg(rio_detail_ptr->chassis_num); if (!opt_rio_ptr) { - opt_rio_ptr = kzalloc(sizeof(struct opt_rio), GFP_KERNEL); + opt_rio_ptr = kzalloc_obj(struct opt_rio, GFP_KERNEL); if (!opt_rio_ptr) return -ENOMEM; opt_rio_ptr->rio_type = rio_detail_ptr->rio_type; @@ -499,7 +500,8 @@ static int combine_wpg_for_expansion(void) list_for_each_entry(rio_detail_ptr, &rio_lo_head, rio_detail_list) { opt_rio_lo_ptr = search_opt_lo(rio_detail_ptr->chassis_num); if (!opt_rio_lo_ptr) { - opt_rio_lo_ptr = kzalloc(sizeof(struct opt_rio_lo), GFP_KERNEL); + opt_rio_lo_ptr = kzalloc_obj(struct opt_rio_lo, + GFP_KERNEL); if (!opt_rio_lo_ptr) return -ENOMEM; opt_rio_lo_ptr->rio_type = rio_detail_ptr->rio_type; @@ -738,7 +740,8 @@ static int __init ebda_rsrc_controller(void) bus_info_ptr2 = ibmphp_find_same_bus_num(slot_ptr->slot_bus_num); if (!bus_info_ptr2) { - bus_info_ptr1 = kzalloc(sizeof(struct bus_info), GFP_KERNEL); + bus_info_ptr1 = kzalloc_obj(struct bus_info, + GFP_KERNEL); if (!bus_info_ptr1) { rc = -ENOMEM; goto error_no_slot; @@ -840,7 +843,7 @@ static int __init ebda_rsrc_controller(void) // register slots with hpc core as well as create linked list of ibm slot for (index = 0; index < hpc_ptr->slot_count; index++) { - tmp_slot = kzalloc(sizeof(*tmp_slot), GFP_KERNEL); + tmp_slot = kzalloc_obj(*tmp_slot, GFP_KERNEL); if (!tmp_slot) { rc = -ENOMEM; goto error_no_slot; diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index eeb412cbd9fe..f1ec9ada9faa 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c @@ -152,7 +152,8 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) cleanup_count = 6; goto error; } - newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); + newfunc = kzalloc_obj(*newfunc, + GFP_KERNEL); if (!newfunc) return -ENOMEM; @@ -189,7 +190,8 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) flag = 0; for (i = 0; i < 32; i++) { if (func->devices[i]) { - newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); + newfunc = kzalloc_obj(*newfunc, + GFP_KERNEL); if (!newfunc) return -ENOMEM; @@ -216,7 +218,8 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) } } - newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); + newfunc = kzalloc_obj(*newfunc, + GFP_KERNEL); if (!newfunc) return -ENOMEM; @@ -261,7 +264,8 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) for (i = 0; i < 32; i++) { if (func->devices[i]) { debug("inside for loop, device is %x\n", i); - newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); + newfunc = kzalloc_obj(*newfunc, + GFP_KERNEL); if (!newfunc) return -ENOMEM; @@ -384,7 +388,8 @@ static int configure_device(struct pci_func *func) debug("len[count] in IO %x, count %d\n", len[count], count); - io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + io[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!io[count]) return -ENOMEM; @@ -421,7 +426,8 @@ static int configure_device(struct pci_func *func) debug("len[count] in PFMEM %x, count %d\n", len[count], count); - pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + pfmem[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!pfmem[count]) return -ENOMEM; @@ -435,7 +441,8 @@ static int configure_device(struct pci_func *func) ibmphp_add_resource(pfmem[count]); func->pfmem[count] = pfmem[count]; } else { - mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); + mem_tmp = kzalloc_obj(*mem_tmp, + GFP_KERNEL); if (!mem_tmp) { kfree(pfmem[count]); return -ENOMEM; @@ -485,7 +492,8 @@ static int configure_device(struct pci_func *func) debug("len[count] in Mem %x, count %d\n", len[count], count); - mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + mem[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!mem[count]) return -ENOMEM; @@ -648,7 +656,8 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) debug("len[count] in IO = %x\n", len[count]); - bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + bus_io[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!bus_io[count]) { retval = -ENOMEM; @@ -680,7 +689,8 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) debug("len[count] in PFMEM = %x\n", len[count]); - bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + bus_pfmem[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!bus_pfmem[count]) { retval = -ENOMEM; goto error; @@ -695,7 +705,8 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ibmphp_add_resource(bus_pfmem[count]); func->pfmem[count] = bus_pfmem[count]; } else { - mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); + mem_tmp = kzalloc_obj(*mem_tmp, + GFP_KERNEL); if (!mem_tmp) { retval = -ENOMEM; goto error; @@ -735,7 +746,8 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) debug("len[count] in Memory is %x\n", len[count]); - bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + bus_mem[count] = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!bus_mem[count]) { retval = -ENOMEM; goto error; @@ -804,7 +816,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_io = 1; } else { debug("it wants %x IO behind the bridge\n", amount_needed->io); - io = kzalloc(sizeof(*io), GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!io) { retval = -ENOMEM; @@ -826,7 +838,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_mem = 1; } else { debug("it wants %x memory behind the bridge\n", amount_needed->mem); - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) { retval = -ENOMEM; goto error; @@ -847,7 +859,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_pfmem = 1; } else { debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); - pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); + pfmem = kzalloc_obj(*pfmem, GFP_KERNEL); if (!pfmem) { retval = -ENOMEM; goto error; @@ -861,7 +873,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ibmphp_add_resource(pfmem); flag_pfmem = 1; } else { - mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); + mem_tmp = kzalloc_obj(*mem_tmp, GFP_KERNEL); if (!mem_tmp) { retval = -ENOMEM; goto error; @@ -891,7 +903,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) */ bus = ibmphp_find_res_bus(sec_number); if (!bus) { - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (!bus) { retval = -ENOMEM; goto error; @@ -1064,7 +1076,7 @@ static struct res_needed *scan_behind_bridge(struct pci_func *func, u8 busno) }; struct res_needed *amount; - amount = kzalloc(sizeof(*amount), GFP_KERNEL); + amount = kzalloc_obj(*amount, GFP_KERNEL); if (amount == NULL) return NULL; @@ -1618,7 +1630,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re list_add(&bus->bus_list, &cur_bus->bus_list); } if (io) { - io_range = kzalloc(sizeof(*io_range), GFP_KERNEL); + io_range = kzalloc_obj(*io_range, GFP_KERNEL); if (!io_range) return -ENOMEM; @@ -1629,7 +1641,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re bus->rangeIO = io_range; } if (mem) { - mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL); + mem_range = kzalloc_obj(*mem_range, GFP_KERNEL); if (!mem_range) return -ENOMEM; @@ -1640,7 +1652,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re bus->rangeMem = mem_range; } if (pfmem) { - pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL); + pfmem_range = kzalloc_obj(*pfmem_range, GFP_KERNEL); if (!pfmem_range) return -ENOMEM; diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c index 4a72ade2cddb..c05a2c05e302 100644 --- a/drivers/pci/hotplug/ibmphp_res.c +++ b/drivers/pci/hotplug/ibmphp_res.c @@ -41,7 +41,7 @@ static struct bus_node * __init alloc_error_bus(struct ebda_pci_rsrc *curr, u8 b return NULL; } - newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); + newbus = kzalloc_obj(struct bus_node, GFP_KERNEL); if (!newbus) return NULL; @@ -62,7 +62,7 @@ static struct resource_node * __init alloc_resources(struct ebda_pci_rsrc *curr) return NULL; } - rs = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + rs = kzalloc_obj(struct resource_node, GFP_KERNEL); if (!rs) return NULL; @@ -81,7 +81,7 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * u8 num_ranges = 0; if (first_bus) { - newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); + newbus = kzalloc_obj(struct bus_node, GFP_KERNEL); if (!newbus) return -ENOMEM; @@ -101,7 +101,7 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * } } - newrange = kzalloc(sizeof(struct range_node), GFP_KERNEL); + newrange = kzalloc_obj(struct range_node, GFP_KERNEL); if (!newrange) { if (first_bus) kfree(newbus); @@ -1687,7 +1687,8 @@ static int __init once_over(void) bus_cur->firstPFMemFromMem = pfmem_cur; - mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + mem = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!mem) return -ENOMEM; @@ -1969,7 +1970,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) end_address |= (upper_io_end << 16); if ((start_address) && (start_address <= end_address)) { - range = kzalloc(sizeof(struct range_node), GFP_KERNEL); + range = kzalloc_obj(struct range_node, + GFP_KERNEL); if (!range) return -ENOMEM; @@ -1993,7 +1995,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) fix_resources(bus_sec); if (ibmphp_find_resource(bus_cur, start_address, &io, IO)) { - io = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + io = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!io) { kfree(range); return -ENOMEM; @@ -2016,7 +2019,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) if ((start_address) && (start_address <= end_address)) { - range = kzalloc(sizeof(struct range_node), GFP_KERNEL); + range = kzalloc_obj(struct range_node, + GFP_KERNEL); if (!range) return -ENOMEM; @@ -2041,7 +2045,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) fix_resources(bus_sec); if (ibmphp_find_resource(bus_cur, start_address, &mem, MEM)) { - mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + mem = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!mem) { kfree(range); return -ENOMEM; @@ -2068,7 +2073,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) if ((start_address) && (start_address <= end_address)) { - range = kzalloc(sizeof(struct range_node), GFP_KERNEL); + range = kzalloc_obj(struct range_node, + GFP_KERNEL); if (!range) return -ENOMEM; @@ -2092,7 +2098,8 @@ static int __init update_bridge_ranges(struct bus_node **bus) fix_resources(bus_sec); if (ibmphp_find_resource(bus_cur, start_address, &pfmem, PFMEM)) { - pfmem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); + pfmem = kzalloc_obj(struct resource_node, + GFP_KERNEL); if (!pfmem) { kfree(range); return -ENOMEM; diff --git a/drivers/pci/hotplug/octep_hp.c b/drivers/pci/hotplug/octep_hp.c index 2bce7296c050..109513822589 100644 --- a/drivers/pci/hotplug/octep_hp.c +++ b/drivers/pci/hotplug/octep_hp.c @@ -136,7 +136,7 @@ octep_hp_register_slot(struct octep_hp_controller *hp_ctrl, struct octep_hp_slot *hp_slot; int ret; - hp_slot = kzalloc(sizeof(*hp_slot), GFP_KERNEL); + hp_slot = kzalloc_obj(*hp_slot, GFP_KERNEL); if (!hp_slot) return ERR_PTR(-ENOMEM); @@ -271,7 +271,7 @@ static irqreturn_t octep_hp_intr_handler(int irq, void *data) intr_val = readq(hp_ctrl->base + OCTEP_HP_INTR_OFFSET(type)); writeq(intr_val, hp_ctrl->base + OCTEP_HP_INTR_OFFSET(type)); - hp_cmd = kzalloc(sizeof(*hp_cmd), GFP_ATOMIC); + hp_cmd = kzalloc_obj(*hp_cmd, GFP_ATOMIC); if (!hp_cmd) return IRQ_HANDLED; diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index f59baa912970..b344ccb3cbc1 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -55,7 +55,7 @@ static int init_slot(struct controller *ctrl) int retval; /* Setup hotplug slot ops */ - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (!ops) return -ENOMEM; diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index ad5f28f6a8b1..33396ad0331c 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -1011,7 +1011,7 @@ struct controller *pcie_init(struct pcie_device *dev) struct pci_dev *pdev = dev->port; struct pci_bus *subordinate = pdev->subordinate; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return NULL; diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 35f1758126c6..4364f068fb72 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -791,7 +791,7 @@ static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) if (!bus) return NULL; - php_slot = kzalloc(sizeof(*php_slot), GFP_KERNEL); + php_slot = kzalloc_obj(*php_slot, GFP_KERNEL); if (!php_slot) return NULL; @@ -1028,7 +1028,7 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data) * The PE is left in frozen state if the event is missed. It's * fine as the PCI devices (PE) aren't functional any more. */ - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) { SLOT_WARN(php_slot, "PCI slot [%s] missed hotplug event 0x%04x\n", diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 779eab12e981..730a3d6c12ba 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c @@ -32,7 +32,7 @@ struct slot *alloc_slot_struct(struct device_node *dn, { struct slot *slot; - slot = kzalloc(sizeof(struct slot), GFP_KERNEL); + slot = kzalloc_obj(struct slot, GFP_KERNEL); if (!slot) goto error_nomem; slot->name = kstrdup(drc_name, GFP_KERNEL); diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 56308515ecba..13687b666f7a 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -66,7 +66,7 @@ static int init_slots(struct controller *ctrl) int i; for (i = 0; i < ctrl->num_slots; i++) { - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) { retval = -ENOMEM; goto error; @@ -259,7 +259,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (acpi_get_hp_hw_control_from_firmware(pdev)) return -ENODEV; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) goto err_out_none; diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index e6c6f23bae27..20526c1fa441 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c @@ -29,7 +29,7 @@ static int queue_interrupt_event(struct slot *p_slot, u32 event_type) { struct event_info *info; - info = kmalloc(sizeof(*info), GFP_ATOMIC); + info = kmalloc_obj(*info, GFP_ATOMIC); if (!info) return -ENOMEM; @@ -418,7 +418,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) struct slot *p_slot = container_of(work, struct slot, work.work); struct pushbutton_work_info *info; - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kmalloc_obj(*info, GFP_KERNEL); if (!info) { ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n", __func__); diff --git a/drivers/pci/ide.c b/drivers/pci/ide.c index 23f554490539..94c20f35f86f 100644 --- a/drivers/pci/ide.c +++ b/drivers/pci/ide.c @@ -258,7 +258,7 @@ struct pci_ide *pci_ide_stream_alloc(struct pci_dev *pdev) if (!pdev->ide_cap) return NULL; - struct pci_ide *ide __free(kfree) = kzalloc(sizeof(*ide), GFP_KERNEL); + struct pci_ide *ide __free(kfree) = kzalloc_obj(*ide, GFP_KERNEL); if (!ide) return NULL; diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 4a659c34935e..99b939f233be 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -837,7 +837,7 @@ found: pgsz &= ~(pgsz - 1); pci_write_config_dword(dev, pos + PCI_SRIOV_SYS_PGSIZE, pgsz); - iov = kzalloc(sizeof(*iov), GFP_KERNEL); + iov = kzalloc_obj(*iov, GFP_KERNEL); if (!iov) return -ENOMEM; diff --git a/drivers/pci/npem.c b/drivers/pci/npem.c index 97507e0df769..f900438570bf 100644 --- a/drivers/pci/npem.c +++ b/drivers/pci/npem.c @@ -524,7 +524,7 @@ static int pci_npem_init(struct pci_dev *dev, const struct npem_ops *ops, int led_idx = 0; int ret; - npem = kzalloc(struct_size(npem, leds, supported_cnt), GFP_KERNEL); + npem = kzalloc_flex(*npem, leds, supported_cnt, GFP_KERNEL); if (!npem) return -ENOMEM; diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 9bb5f258759b..492ec76da821 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -696,7 +696,7 @@ void of_pci_make_dev_node(struct pci_dev *pdev) if (!name) return; - cset = kmalloc(sizeof(*cset), GFP_KERNEL); + cset = kmalloc_obj(*cset, GFP_KERNEL); if (!cset) goto out_free_name; of_changeset_init(cset); @@ -784,7 +784,7 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge) if (!name) return; - cset = kmalloc(sizeof(*cset), GFP_KERNEL); + cset = kmalloc_obj(*cset, GFP_KERNEL); if (!cset) goto out_free_name; of_changeset_init(cset); diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c index 7aae46f333d9..9011f890ebf3 100644 --- a/drivers/pci/of_property.c +++ b/drivers/pci/of_property.c @@ -119,7 +119,7 @@ static int of_pci_prop_ranges(struct pci_dev *pdev, struct of_changeset *ocs, res = &pdev->resource[PCI_STD_RESOURCES]; } - rp = kcalloc(num, sizeof(*rp), GFP_KERNEL); + rp = kzalloc_objs(*rp, num, GFP_KERNEL); if (!rp) return -ENOMEM; diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 79a414fd6623..4ab9800c22cc 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -1006,7 +1006,7 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, struct scatterlist *sg; void *addr; - sg = kmalloc(sizeof(*sg), GFP_KERNEL); + sg = kmalloc_obj(*sg, GFP_KERNEL); if (!sg) return NULL; diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 218e1fc1c1e2..854597fe4eab 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -1663,11 +1663,11 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) struct acpi_pci_root_ops *root_ops; struct pci_host_bridge *host; - ri = kzalloc(sizeof(*ri), GFP_KERNEL); + ri = kzalloc_obj(*ri, GFP_KERNEL); if (!ri) return NULL; - root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL); + root_ops = kzalloc_obj(*root_ops, GFP_KERNEL); if (!root_ops) { kfree(ri); return NULL; diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 47887d55994a..206d30324dfd 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -58,7 +58,7 @@ int pci_add_dynid(struct pci_driver *drv, { struct pci_dynid *dynid; - dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); + dynid = kzalloc_obj(*dynid, GFP_KERNEL); if (!dynid) return -ENOMEM; @@ -203,7 +203,7 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf, return -EINVAL; if (fields != 7) { - struct pci_dev *pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); + struct pci_dev *pdev = kzalloc_obj(*pdev, GFP_KERNEL); if (!pdev) return -ENOMEM; diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 363187ba4f56..16eaaf749ba9 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1037,8 +1037,7 @@ void pci_create_legacy_files(struct pci_bus *b) if (!sysfs_initialized) return; - b->legacy_io = kcalloc(2, sizeof(struct bin_attribute), - GFP_ATOMIC); + b->legacy_io = kzalloc_objs(struct bin_attribute, 2, GFP_ATOMIC); if (!b->legacy_io) goto kzalloc_err; diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f3244630bfd0..4aa21fe3b13e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2462,8 +2462,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) if (dev->pme_poll) { struct pci_pme_device *pme_dev; if (enable) { - pme_dev = kmalloc(sizeof(struct pci_pme_device), - GFP_KERNEL); + pme_dev = kmalloc_obj(struct pci_pme_device, GFP_KERNEL); if (!pme_dev) { pci_warn(dev, "can't enable PME#\n"); return; @@ -3980,7 +3979,7 @@ int pci_register_io_range(const struct fwnode_handle *fwnode, phys_addr_t addr, if (!size || addr + size < addr) return -EINVAL; - range = kzalloc(sizeof(*range), GFP_ATOMIC); + range = kzalloc_obj(*range, GFP_ATOMIC); if (!range) return -ENOMEM; diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 8dfbb0fe6cf6..068594aa6878 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -390,7 +390,7 @@ void pci_aer_init(struct pci_dev *dev) if (!dev->aer_cap) return; - dev->aer_info = kzalloc(sizeof(*dev->aer_info), GFP_KERNEL); + dev->aer_info = kzalloc_obj(*dev->aer_info, GFP_KERNEL); if (!dev->aer_info) { dev->aer_cap = 0; return; diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c index 91acc7b17f68..9c8b2dc496b9 100644 --- a/drivers/pci/pcie/aer_inject.c +++ b/drivers/pci/pcie/aer_inject.c @@ -300,7 +300,7 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus) struct pci_bus_ops *bus_ops; unsigned long flags; - bus_ops = kmalloc(sizeof(*bus_ops), GFP_KERNEL); + bus_ops = kmalloc_obj(*bus_ops, GFP_KERNEL); if (!bus_ops) return -ENOMEM; ops = pci_bus_set_ops(bus, &aer_inj_pci_ops); @@ -360,12 +360,12 @@ static int aer_inject(struct aer_error_inj *einj) goto out_put; } - err_alloc = kzalloc(sizeof(struct aer_error), GFP_KERNEL); + err_alloc = kzalloc_obj(struct aer_error, GFP_KERNEL); if (!err_alloc) { ret = -ENOMEM; goto out_put; } - rperr_alloc = kzalloc(sizeof(struct aer_error), GFP_KERNEL); + rperr_alloc = kzalloc_obj(struct aer_error, GFP_KERNEL); if (!rperr_alloc) { ret = -ENOMEM; goto out_put; diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index cedea47a3547..83ea061f2eba 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1063,7 +1063,7 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) { struct pcie_link_state *link; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return NULL; diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index a2daebd9806c..050d814f6eac 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -335,7 +335,7 @@ static int pcie_pme_probe(struct pcie_device *srv) type != PCI_EXP_TYPE_ROOT_PORT) return -ENODEV; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index 88af0dacf351..f033acbd71a4 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -293,7 +293,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq) struct pcie_device *pcie; struct device *device; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return -ENOMEM; pcie->port = pdev; diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index c7c61869bc9c..d8727369e6a5 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -537,7 +537,7 @@ struct pci_ptm_debugfs *pcie_ptm_create_debugfs(struct device *dev, void *pdata, return NULL; } - ptm_debugfs = kzalloc(sizeof(*ptm_debugfs), GFP_KERNEL); + ptm_debugfs = kzalloc_obj(*ptm_debugfs, GFP_KERNEL); if (!ptm_debugfs) return NULL; diff --git a/drivers/pci/pcie/rcec.c b/drivers/pci/pcie/rcec.c index d0bcd141ac9c..531cde54d747 100644 --- a/drivers/pci/pcie/rcec.c +++ b/drivers/pci/pcie/rcec.c @@ -160,7 +160,7 @@ void pci_rcec_init(struct pci_dev *dev) if (!rcec) return; - rcec_ea = kzalloc(sizeof(*rcec_ea), GFP_KERNEL); + rcec_ea = kzalloc_obj(*rcec_ea, GFP_KERNEL); if (!rcec_ea) return; diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2975974f35e8..013334b53bfb 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -53,7 +53,7 @@ static struct resource *get_pci_domain_busn_res(int domain_nr) if (r->domain_nr == domain_nr) return &r->res; - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return NULL; @@ -620,7 +620,7 @@ static struct pci_bus *pci_alloc_bus(struct pci_bus *parent) { struct pci_bus *b; - b = kzalloc(sizeof(*b), GFP_KERNEL); + b = kzalloc_obj(*b, GFP_KERNEL); if (!b) return NULL; @@ -2502,7 +2502,7 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus) { struct pci_dev *dev; - dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); + dev = kzalloc_obj(struct pci_dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 9348a0fb8084..53104f5c6378 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -297,7 +297,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) static int proc_bus_pci_open(struct inode *inode, struct file *file) { - struct pci_filp_private *fpriv = kmalloc(sizeof(*fpriv), GFP_KERNEL); + struct pci_filp_private *fpriv = kmalloc_obj(*fpriv, GFP_KERNEL); if (!fpriv) return -ENOMEM; diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index bd66ac47b3b9..b641f60a2aa5 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -73,7 +73,7 @@ int pci_dev_res_add_to_list(struct list_head *head, struct pci_dev *dev, { struct pci_dev_resource *tmp; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return -ENOMEM; @@ -350,7 +350,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head) continue; } - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) panic("%s: kzalloc() failed!\n", __func__); tmp->res = r; diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 50fb3eb595fe..15e98de7bdbe 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c @@ -256,7 +256,7 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, } placeholder: - slot = kzalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc_obj(*slot, GFP_KERNEL); if (!slot) { err = -ENOMEM; goto err; diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 5ff84fb8fb0f..c6e97d1af1a0 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -86,7 +86,7 @@ static struct switchtec_user *stuser_create(struct switchtec_dev *stdev) { struct switchtec_user *stuser; - stuser = kzalloc(sizeof(*stuser), GFP_KERNEL); + stuser = kzalloc_obj(*stuser, GFP_KERNEL); if (!stuser) return ERR_PTR(-ENOMEM); @@ -895,7 +895,7 @@ static int ioctl_event_summary(struct switchtec_dev *stdev, u32 reg; int ret = 0; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 87143e235033..21204da24e73 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -735,7 +735,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) u16 cmd; /* Allocate structure */ - vgadev = kzalloc(sizeof(struct vga_device), GFP_KERNEL); + vgadev = kzalloc_obj(struct vga_device, GFP_KERNEL); if (vgadev == NULL) { vgaarb_err(&pdev->dev, "failed to allocate VGA arbiter data\n"); /* @@ -1385,7 +1385,7 @@ static int vga_arb_open(struct inode *inode, struct file *file) pr_debug("%s\n", __func__); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; spin_lock_init(&priv->lock); diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index 11636634ae51..bbb43539a2b0 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -462,8 +462,8 @@ static int pcifront_scan_root(struct pcifront_device *pdev, dev_info(&pdev->xdev->dev, "Creating PCI Frontend Bus %04x:%02x\n", domain, bus); - bus_entry = kzalloc(sizeof(*bus_entry), GFP_KERNEL); - sd = kzalloc(sizeof(*sd), GFP_KERNEL); + bus_entry = kzalloc_obj(*bus_entry, GFP_KERNEL); + sd = kzalloc_obj(*sd, GFP_KERNEL); if (!bus_entry || !sd) { err = -ENOMEM; goto err_out; @@ -687,7 +687,7 @@ static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev) { struct pcifront_device *pdev; - pdev = kzalloc(sizeof(struct pcifront_device), GFP_KERNEL); + pdev = kzalloc_obj(struct pcifront_device, GFP_KERNEL); if (pdev == NULL) goto out; diff --git a/drivers/pcmcia/bcm63xx_pcmcia.c b/drivers/pcmcia/bcm63xx_pcmcia.c index d3baed444646..cfb2a3724252 100644 --- a/drivers/pcmcia/bcm63xx_pcmcia.c +++ b/drivers/pcmcia/bcm63xx_pcmcia.c @@ -333,7 +333,7 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev) int ret; int irq; - skt = kzalloc(sizeof(*skt), GFP_KERNEL); + skt = kzalloc_obj(*skt, GFP_KERNEL); if (!skt) return -ENOMEM; spin_lock_init(&skt->lock); diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index 05b67fd93de6..e22ebce496d5 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1393,12 +1393,12 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info) destroy_cis_cache(s); mutex_unlock(&s->ops_mutex); - tuple = kmalloc(sizeof(*tuple), GFP_KERNEL); + tuple = kmalloc_obj(*tuple, GFP_KERNEL); if (tuple == NULL) { dev_warn(&s->dev, "no memory to validate CIS\n"); return -ENOMEM; } - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (p == NULL) { kfree(tuple); dev_warn(&s->dev, "no memory to validate CIS\n"); @@ -1480,11 +1480,11 @@ static ssize_t pccard_extract_cis(struct pcmcia_socket *s, char *buf, u_char *tuplebuffer; u_char *tempbuffer; - tuplebuffer = kmalloc_array(256, sizeof(u_char), GFP_KERNEL); + tuplebuffer = kmalloc_objs(u_char, 256, GFP_KERNEL); if (!tuplebuffer) return -ENOMEM; - tempbuffer = kmalloc_array(258, sizeof(u_char), GFP_KERNEL); + tempbuffer = kmalloc_objs(u_char, 258, GFP_KERNEL); if (!tempbuffer) { ret = -ENOMEM; goto free_tuple; diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c index 85d2616061dd..5f80ad72566b 100644 --- a/drivers/pcmcia/db1xxx_ss.c +++ b/drivers/pcmcia/db1xxx_ss.c @@ -427,7 +427,7 @@ static int db1x_pcmcia_socket_probe(struct platform_device *pdev) struct resource *r; int ret, bid; - sock = kzalloc(sizeof(struct db1x_pcmcia_sock), GFP_KERNEL); + sock = kzalloc_obj(struct db1x_pcmcia_sock, GFP_KERNEL); if (!sock) return -ENOMEM; diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 18f4eef28dbc..9c26aeb39dcf 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -108,7 +108,7 @@ new_id_store(struct device_driver *driver, const char *buf, size_t count) if (fields < 6) return -EINVAL; - dynid = kzalloc(sizeof(struct pcmcia_dynid), GFP_KERNEL); + dynid = kzalloc_obj(struct pcmcia_dynid, GFP_KERNEL); if (!dynid) return -ENOMEM; @@ -402,7 +402,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) cistpl_vers_1_t *vers1; unsigned int i; - vers1 = kmalloc(sizeof(*vers1), GFP_KERNEL); + vers1 = kmalloc_obj(*vers1, GFP_KERNEL); if (!vers1) return -ENOMEM; @@ -428,7 +428,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) * probably memory cards (from pcmcia-cs) */ cistpl_device_geo_t *devgeo; - devgeo = kmalloc(sizeof(*devgeo), GFP_KERNEL); + devgeo = kmalloc_obj(*devgeo, GFP_KERNEL); if (!devgeo) { kfree(vers1); return -ENOMEM; @@ -488,7 +488,7 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, pr_debug("adding device to %d, function %d\n", s->sock, function); - p_dev = kzalloc(sizeof(struct pcmcia_device), GFP_KERNEL); + p_dev = kzalloc_obj(struct pcmcia_device, GFP_KERNEL); if (!p_dev) goto err_put; @@ -542,7 +542,7 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, if (!p_dev->function_config) { config_t *c; dev_dbg(&p_dev->dev, "creating config_t\n"); - c = kzalloc(sizeof(struct config_t), GFP_KERNEL); + c = kzalloc_obj(struct config_t, GFP_KERNEL); if (!c) { mutex_unlock(&s->ops_mutex); goto err_unreg; diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index 2530079d38f4..05d78262e408 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -190,7 +190,7 @@ static int electra_cf_probe(struct platform_device *ofdev) if (err) return -EINVAL; - cf = kzalloc(sizeof(*cf), GFP_KERNEL); + cf = kzalloc_obj(*cf, GFP_KERNEL); if (!cf) return -ENOMEM; diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index d6f24c7d1562..c43f15557906 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -218,7 +218,7 @@ static int __init omap_cf_probe(struct platform_device *pdev) if (!res) return -EINVAL; - cf = kzalloc(sizeof *cf, GFP_KERNEL); + cf = kzalloc_obj(*cf, GFP_KERNEL); if (!cf) return -ENOMEM; timer_setup(&cf->timer, omap_cf_timer, 0); diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c index 6bc0bc24d357..f84ca5cde76b 100644 --- a/drivers/pcmcia/pcmcia_cis.c +++ b/drivers/pcmcia/pcmcia_cis.c @@ -264,7 +264,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev, struct pcmcia_cfg_mem *cfg_mem; int ret; - cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL); + cfg_mem = kzalloc_obj(struct pcmcia_cfg_mem, GFP_KERNEL); if (cfg_mem == NULL) return -ENOMEM; diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 6868b60fd325..3f4fc34d1b54 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -629,8 +629,7 @@ static int pd6729_pci_probe(struct pci_dev *dev, char configbyte; struct pd6729_socket *socket; - socket = kcalloc(MAX_SOCKETS, sizeof(struct pd6729_socket), - GFP_KERNEL); + socket = kzalloc_objs(struct pd6729_socket, MAX_SOCKETS, GFP_KERNEL); if (!socket) { dev_warn(&dev->dev, "failed to kzalloc socket.\n"); return -ENOMEM; diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 3a1d2baa466f..f6606b772eff 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -31,7 +31,7 @@ struct resource *pcmcia_make_resource(resource_size_t start, resource_size_t end, unsigned long flags, const char *name) { - struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); + struct resource *res = kzalloc_obj(*res, GFP_KERNEL); if (res) { res->name = name; diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index da494fe451ba..3531d98e5bb1 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -117,7 +117,7 @@ static int add_interval(struct resource_map *map, u_long base, u_long num) if ((p->next == map) || (p->next->base > base+num-1)) break; } - q = kmalloc(sizeof(struct resource_map), GFP_KERNEL); + q = kmalloc_obj(struct resource_map, GFP_KERNEL); if (!q) { printk(KERN_WARNING "out of memory to update resources\n"); return -ENOMEM; @@ -155,8 +155,7 @@ static int sub_interval(struct resource_map *map, u_long base, u_long num) q->num = base - q->base; } else { /* Split the block into two pieces */ - p = kmalloc(sizeof(struct resource_map), - GFP_KERNEL); + p = kmalloc_obj(struct resource_map, GFP_KERNEL); if (!p) { printk(KERN_WARNING "out of memory to update resources\n"); return -ENOMEM; @@ -1023,7 +1022,7 @@ static int nonstatic_init(struct pcmcia_socket *s) { struct socket_data *data; - data = kzalloc(sizeof(struct socket_data), GFP_KERNEL); + data = kzalloc_obj(struct socket_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 2a67e33fb5f0..b0c08d8a43a8 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c @@ -153,7 +153,7 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ops->socket_state = sa1111_pcmcia_socket_state; for (i = 0; i < ops->nr; i++) { - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c index f84dd5914a6b..2d7e674d86d6 100644 --- a/drivers/pcmcia/xxs1500_ss.c +++ b/drivers/pcmcia/xxs1500_ss.c @@ -212,7 +212,7 @@ static int xxs1500_pcmcia_probe(struct platform_device *pdev) struct resource *r; int ret, irq; - sock = kzalloc(sizeof(struct xxs1500_pcmcia_sock), GFP_KERNEL); + sock = kzalloc_obj(struct xxs1500_pcmcia_sock, GFP_KERNEL); if (!sock) return -ENOMEM; diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 34c4eaee7dfc..ddff589bebc8 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1171,7 +1171,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENODEV; } - socket = kzalloc(sizeof(struct yenta_socket), GFP_KERNEL); + socket = kzalloc_obj(struct yenta_socket, GFP_KERNEL); if (!socket) return -ENOMEM; diff --git a/drivers/peci/core.c b/drivers/peci/core.c index 936c1fadefe5..f54341959769 100644 --- a/drivers/peci/core.c +++ b/drivers/peci/core.c @@ -52,7 +52,7 @@ static struct peci_controller *peci_controller_alloc(struct device *dev, if (!ops->xfer) return ERR_PTR(-EINVAL); - controller = kzalloc(sizeof(*controller), GFP_KERNEL); + controller = kzalloc_obj(*controller, GFP_KERNEL); if (!controller) return ERR_PTR(-ENOMEM); diff --git a/drivers/peci/cpu.c b/drivers/peci/cpu.c index fbccc1d1b637..050612e2d3ca 100644 --- a/drivers/peci/cpu.c +++ b/drivers/peci/cpu.c @@ -199,7 +199,7 @@ static struct auxiliary_device *adev_alloc(struct peci_cpu *priv, int idx) const char *name; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/peci/device.c b/drivers/peci/device.c index 416635029f55..ed4177b72f0e 100644 --- a/drivers/peci/device.c +++ b/drivers/peci/device.c @@ -170,7 +170,7 @@ int peci_device_create(struct peci_controller *controller, u8 addr) return ret; } - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return -ENOMEM; diff --git a/drivers/peci/request.c b/drivers/peci/request.c index e6327af45fc7..437a59146dff 100644 --- a/drivers/peci/request.c +++ b/drivers/peci/request.c @@ -203,7 +203,7 @@ struct peci_request *peci_request_alloc(struct peci_device *device, u8 tx_len, u * should be converted to DMA API once support for controllers that do * allow it is added to avoid an extra copy. */ - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c index 99a0ef9817e0..3c5ec82f0454 100644 --- a/drivers/perf/alibaba_uncore_drw_pmu.c +++ b/drivers/perf/alibaba_uncore_drw_pmu.c @@ -431,7 +431,7 @@ static struct ali_drw_pmu_irq *__ali_drw_pmu_init_irq(struct platform_device return irq; } - irq = kzalloc(sizeof(*irq), GFP_KERNEL); + irq = kzalloc_obj(*irq, GFP_KERNEL); if (!irq) return ERR_PTR(-ENOMEM); diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index 4fbafc4b7984..dd87d29c395a 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -1700,7 +1700,7 @@ static int arm_cmn_validate_group(struct arm_cmn *cmn, struct perf_event *event) if (event->pmu != leader->pmu && !is_software_event(leader)) return -EINVAL; - val = kzalloc(sizeof(*val), GFP_KERNEL); + val = kzalloc_obj(*val, GFP_KERNEL); if (!val) return -ENOMEM; diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 619cf937602f..3354ef908a56 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -432,7 +432,7 @@ static struct dmc620_pmu_irq *__dmc620_pmu_get_irq(int irq_num) if (irq->irq_num == irq_num && refcount_inc_not_zero(&irq->refcount)) return irq; - irq = kzalloc(sizeof(*irq), GFP_KERNEL); + irq = kzalloc_obj(*irq, GFP_KERNEL); if (!irq) return ERR_PTR(-ENOMEM); diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 973a027d9063..5e7da5286d2c 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -864,7 +864,7 @@ struct arm_pmu *armpmu_alloc(void) struct arm_pmu *pmu; int cpu; - pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); + pmu = kzalloc_obj(*pmu, GFP_KERNEL); if (!pmu) goto out; diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index 5410fb7428d0..eca2955693dc 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -1020,7 +1020,7 @@ static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages, if (!buf) return NULL; - pglist = kcalloc(nr_pages, sizeof(*pglist), GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); if (!pglist) goto out_free_buf; diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c index 22f73ac894e9..ceb039306bb6 100644 --- a/drivers/perf/dwc_pcie_pmu.c +++ b/drivers/perf/dwc_pcie_pmu.c @@ -649,7 +649,7 @@ static int dwc_pcie_register_dev(struct pci_dev *pdev) if (IS_ERR(plat_dev)) return PTR_ERR(plat_dev); - dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL); + dev_info = kzalloc_obj(*dev_info, GFP_KERNEL); if (!dev_info) { platform_device_unregister(plat_dev); return -ENOMEM; diff --git a/drivers/perf/riscv_pmu.c b/drivers/perf/riscv_pmu.c index 7644147d50b4..e5e43899ea74 100644 --- a/drivers/perf/riscv_pmu.c +++ b/drivers/perf/riscv_pmu.c @@ -389,7 +389,7 @@ struct riscv_pmu *riscv_pmu_alloc(void) int cpuid, i; struct cpu_hw_events *cpuc; - pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); + pmu = kzalloc_obj(*pmu, GFP_KERNEL); if (!pmu) goto out; diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 9dcc22fd48ef..09acac7ae073 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -309,7 +309,8 @@ static int pmu_sbi_check_event_info(void) int i, j, k, result = 0, count = 0; struct sbiret ret; - event_info_shmem = kcalloc(num_events, sizeof(*event_info_shmem), GFP_KERNEL); + event_info_shmem = kzalloc_objs(*event_info_shmem, num_events, + GFP_KERNEL); if (!event_info_shmem) return -ENOMEM; @@ -872,7 +873,7 @@ static int pmu_sbi_get_ctrinfo(int nctr, unsigned long *mask) int i, num_hw_ctr = 0, num_fw_ctr = 0; union sbi_pmu_ctr_info cinfo; - pmu_ctr_list = kcalloc(nctr, sizeof(*pmu_ctr_list), GFP_KERNEL); + pmu_ctr_list = kzalloc_objs(*pmu_ctr_list, nctr, GFP_KERNEL); if (!pmu_ctr_list) return -ENOMEM; diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 4ad396214d0c..b1b5ddd9e05e 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -75,7 +75,7 @@ int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id) if (!phy || !dev_id || !con_id) return -EINVAL; - pl = kzalloc(sizeof(*pl), GFP_KERNEL); + pl = kzalloc_obj(*pl, GFP_KERNEL); if (!pl) return -ENOMEM; @@ -1004,7 +1004,7 @@ struct phy *phy_create(struct device *dev, struct device_node *node, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - phy = kzalloc(sizeof(*phy), GFP_KERNEL); + phy = kzalloc_obj(*phy, GFP_KERNEL); if (!phy) return ERR_PTR(-ENOMEM); @@ -1174,7 +1174,7 @@ struct phy_provider *__of_phy_provider_register(struct device *dev, children = dev->of_node; } - phy_provider = kzalloc(sizeof(*phy_provider), GFP_KERNEL); + phy_provider = kzalloc_obj(*phy_provider, GFP_KERNEL); if (!phy_provider) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra124.c b/drivers/phy/tegra/xusb-tegra124.c index f4f75ea033b8..f180ef8a8829 100644 --- a/drivers/phy/tegra/xusb-tegra124.c +++ b/drivers/phy/tegra/xusb-tegra124.c @@ -430,7 +430,7 @@ tegra124_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -614,7 +614,7 @@ tegra124_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -679,7 +679,7 @@ tegra124_ulpi_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_ulpi_lane *ulpi; int err; - ulpi = kzalloc(sizeof(*ulpi), GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); if (!ulpi) return ERR_PTR(-ENOMEM); @@ -751,7 +751,7 @@ tegra124_ulpi_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - ulpi = kzalloc(sizeof(*ulpi), GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); if (!ulpi) return ERR_PTR(-ENOMEM); @@ -815,7 +815,7 @@ tegra124_hsic_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_hsic_lane *hsic; int err; - hsic = kzalloc(sizeof(*hsic), GFP_KERNEL); + hsic = kzalloc_obj(*hsic, GFP_KERNEL); if (!hsic) return ERR_PTR(-ENOMEM); @@ -967,7 +967,7 @@ tegra124_hsic_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - hsic = kzalloc(sizeof(*hsic), GFP_KERNEL); + hsic = kzalloc_obj(*hsic, GFP_KERNEL); if (!hsic) return ERR_PTR(-ENOMEM); @@ -1035,7 +1035,7 @@ tegra124_pcie_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_pcie_lane *pcie; int err; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return ERR_PTR(-ENOMEM); @@ -1155,7 +1155,7 @@ tegra124_pcie_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return ERR_PTR(-ENOMEM); @@ -1213,7 +1213,7 @@ tegra124_sata_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_sata_lane *sata; int err; - sata = kzalloc(sizeof(*sata), GFP_KERNEL); + sata = kzalloc_obj(*sata, GFP_KERNEL); if (!sata) return ERR_PTR(-ENOMEM); @@ -1351,7 +1351,7 @@ tegra124_sata_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - sata = kzalloc(sizeof(*sata), GFP_KERNEL); + sata = kzalloc_obj(*sata, GFP_KERNEL); if (!sata) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c index bec9616c4a2e..eb643af34d68 100644 --- a/drivers/phy/tegra/xusb-tegra186.c +++ b/drivers/phy/tegra/xusb-tegra186.c @@ -302,7 +302,7 @@ tegra186_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -1031,7 +1031,7 @@ tegra186_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -1113,7 +1113,7 @@ tegra186_usb3_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb3_lane *usb3; int err; - usb3 = kzalloc(sizeof(*usb3), GFP_KERNEL); + usb3 = kzalloc_obj(*usb3, GFP_KERNEL); if (!usb3) return ERR_PTR(-ENOMEM); @@ -1417,7 +1417,7 @@ tegra186_usb3_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb3 = kzalloc(sizeof(*usb3), GFP_KERNEL); + usb3 = kzalloc_obj(*usb3, GFP_KERNEL); if (!usb3) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c index 3409924498e9..872ae93e0722 100644 --- a/drivers/phy/tegra/xusb-tegra210.c +++ b/drivers/phy/tegra/xusb-tegra210.c @@ -1759,7 +1759,7 @@ tegra210_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -2185,7 +2185,7 @@ tegra210_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) return ERR_PTR(-ENOMEM); @@ -2255,7 +2255,7 @@ tegra210_hsic_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_hsic_lane *hsic; int err; - hsic = kzalloc(sizeof(*hsic), GFP_KERNEL); + hsic = kzalloc_obj(*hsic, GFP_KERNEL); if (!hsic) return ERR_PTR(-ENOMEM); @@ -2439,7 +2439,7 @@ tegra210_hsic_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - hsic = kzalloc(sizeof(*hsic), GFP_KERNEL); + hsic = kzalloc_obj(*hsic, GFP_KERNEL); if (!hsic) return ERR_PTR(-ENOMEM); @@ -2688,7 +2688,7 @@ tegra210_pcie_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_pcie_lane *pcie; int err; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return ERR_PTR(-ENOMEM); @@ -2786,7 +2786,7 @@ tegra210_pcie_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - pcie = kzalloc(sizeof(*pcie), GFP_KERNEL); + pcie = kzalloc_obj(*pcie, GFP_KERNEL); if (!pcie) return ERR_PTR(-ENOMEM); @@ -2858,7 +2858,7 @@ tegra210_sata_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_sata_lane *sata; int err; - sata = kzalloc(sizeof(*sata), GFP_KERNEL); + sata = kzalloc_obj(*sata, GFP_KERNEL); if (!sata) return ERR_PTR(-ENOMEM); @@ -2955,7 +2955,7 @@ tegra210_sata_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - sata = kzalloc(sizeof(*sata), GFP_KERNEL); + sata = kzalloc_obj(*sata, GFP_KERNEL); if (!sata) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index c89df95aa6ca..6667ac08754d 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -796,7 +796,7 @@ static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); + usb2 = kzalloc_obj(*usb2, GFP_KERNEL); if (!usb2) { err = -ENOMEM; goto out; @@ -863,7 +863,7 @@ static int tegra_xusb_add_ulpi_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - ulpi = kzalloc(sizeof(*ulpi), GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); if (!ulpi) { err = -ENOMEM; goto out; @@ -919,7 +919,7 @@ static int tegra_xusb_add_hsic_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - hsic = kzalloc(sizeof(*hsic), GFP_KERNEL); + hsic = kzalloc_obj(*hsic, GFP_KERNEL); if (!hsic) { err = -ENOMEM; goto out; @@ -1004,7 +1004,7 @@ static int tegra_xusb_add_usb3_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - usb3 = kzalloc(sizeof(*usb3), GFP_KERNEL); + usb3 = kzalloc_obj(*usb3, GFP_KERNEL); if (!usb3) { err = -ENOMEM; goto out; diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index c165674c5b4d..8383c14035ef 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -803,7 +803,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc, return -EINVAL; } - configs = kzalloc(sizeof(*configs), GFP_KERNEL); + configs = kzalloc_obj(*configs, GFP_KERNEL); if (!configs) return -ENOMEM; configs[0] = pinconf_to_config_packed(BCM2835_PINCONF_PARAM_PULL, pull); @@ -873,8 +873,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, maps_per_pin++; if (num_pulls) maps_per_pin++; - cur_map = maps = kcalloc(num_pins * maps_per_pin, sizeof(*maps), - GFP_KERNEL); + cur_map = maps = kzalloc_objs(*maps, num_pins * maps_per_pin, + GFP_KERNEL); if (!maps) return -ENOMEM; diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c index 8afcfa4e5694..f58cb046e9ea 100644 --- a/drivers/pinctrl/berlin/berlin.c +++ b/drivers/pinctrl/berlin/berlin.c @@ -215,7 +215,8 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev) } /* we will reallocate later */ - pctrl->functions = kcalloc(max_functions, sizeof(*pctrl->functions), GFP_KERNEL); + pctrl->functions = kzalloc_objs(*pctrl->functions, max_functions, + GFP_KERNEL); if (!pctrl->functions) return -ENOMEM; diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 342bda2a1bd6..3d728ed310f4 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -215,7 +215,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, return -EINVAL; } - pindesc = kzalloc(sizeof(*pindesc), GFP_KERNEL); + pindesc = kzalloc_obj(*pindesc, GFP_KERNEL); if (!pindesc) return -ENOMEM; @@ -955,7 +955,7 @@ static struct pinctrl_state *create_state(struct pinctrl *p, { struct pinctrl_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); @@ -983,7 +983,7 @@ static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev, if (map->type == PIN_MAP_TYPE_DUMMY_STATE) return 0; - setting = kzalloc(sizeof(*setting), GFP_KERNEL); + setting = kzalloc_obj(*setting, GFP_KERNEL); if (!setting) return -ENOMEM; @@ -1063,7 +1063,7 @@ static struct pinctrl *create_pinctrl(struct device *dev, * mapping, this is what consumers will get when requesting * a pin control handle with pinctrl_get() */ - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); p->dev = dev; @@ -1483,7 +1483,7 @@ int pinctrl_register_mappings(const struct pinctrl_map *maps, } } - maps_node = kzalloc(sizeof(*maps_node), GFP_KERNEL); + maps_node = kzalloc_obj(*maps_node, GFP_KERNEL); if (!maps_node) return -ENOMEM; @@ -2076,7 +2076,7 @@ pinctrl_init_controller(const struct pinctrl_desc *pctldesc, struct device *dev, if (!pctldesc->name) return ERR_PTR(-EINVAL); - pctldev = kzalloc(sizeof(*pctldev), GFP_KERNEL); + pctldev = kzalloc_obj(*pctldev, GFP_KERNEL); if (!pctldev) return ERR_PTR(-ENOMEM); diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 0b7f74beb6a6..ed3671f94463 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -84,7 +84,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename, } /* Remember the converted mapping table entries */ - dt_map = kzalloc(sizeof(*dt_map), GFP_KERNEL); + dt_map = kzalloc_obj(*dt_map, GFP_KERNEL); if (!dt_map) goto err_free_map; @@ -187,7 +187,7 @@ static int dt_remember_dummy_state(struct pinctrl *p, const char *statename) { struct pinctrl_map *map; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c index dab2fabdf456..9e3f29e8d993 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c +++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c @@ -99,8 +99,7 @@ static int pinctrl_scmi_imx_dt_node_to_map(struct pinctrl_dev *pctldev, num_pins = size / pin_size; map_num = num_pins; - new_map = kmalloc_array(map_num, sizeof(struct pinctrl_map), - GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 731c58ad43ee..1d892cbb59a6 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -88,8 +88,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, } } - new_map = kmalloc_array(map_num, sizeof(struct pinctrl_map), - GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c index af1ccfc90bff..abffe09bdb83 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c +++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c @@ -244,8 +244,7 @@ static int imx1_dt_node_to_map(struct pinctrl_dev *pctldev, for (i = 0; i < grp->npins; i++) map_num++; - new_map = kmalloc_array(map_num, sizeof(struct pinctrl_map), - GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index edb242d30609..e11697efeb47 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -92,7 +92,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, if (!purecfg && config) new_num = 2; - new_map = kcalloc(new_num, sizeof(*new_map), GFP_KERNEL); + new_map = kzalloc_objs(*new_map, new_num, GFP_KERNEL); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index 84a119718f86..59fede73c31d 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c @@ -430,7 +430,7 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, return 0; } - *map = kmalloc_array(nmaps, sizeof(**map), GFP_KERNEL); + *map = kmalloc_objs(**map, nmaps, GFP_KERNEL); if (!*map) return -ENOMEM; diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvoton/pinctrl-ma35.c index 8d71dc53cc1d..9bbf73de5747 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c +++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c @@ -202,7 +202,7 @@ static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev, } map_num += grp->grp.npins; - new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 35511f83d056..e811803b7cc5 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -386,7 +386,7 @@ static int s32_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, return ret; /* Save current configuration */ - gpio_pin = kmalloc(sizeof(*gpio_pin), GFP_KERNEL); + gpio_pin = kmalloc_obj(*gpio_pin, GFP_KERNEL); if (!gpio_pin) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index 2bd5013b19ac..c0ae52880b2e 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -400,8 +400,8 @@ static int apple_gpio_register(struct apple_gpio_pinctrl *pctl) girq->parents = kmalloc_array(girq->num_parents, sizeof(*girq->parents), GFP_KERNEL); - irq_data = kmalloc_array(girq->num_parents, sizeof(*irq_data), - GFP_KERNEL); + irq_data = kmalloc_objs(*irq_data, girq->num_parents, + GFP_KERNEL); if (!girq->parents || !irq_data) { ret = -ENOMEM; goto out_free_irq_data; diff --git a/drivers/pinctrl/pinctrl-k230.c b/drivers/pinctrl/pinctrl-k230.c index 20f7c0f70eb7..8aeb540390c8 100644 --- a/drivers/pinctrl/pinctrl-k230.c +++ b/drivers/pinctrl/pinctrl-k230.c @@ -211,7 +211,7 @@ static int k230_dt_node_to_map(struct pinctrl_dev *pctldev, map_num += info->groups[grp_id].num_pins + 1; } - new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; *map = new_map; diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 6ea9544ddd06..0fe0527863b8 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -2262,7 +2262,7 @@ static void ocelot_irq_unmask_level(struct irq_data *data) if (active) { struct ocelot_irq_work *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return; diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 816823403e97..7e838a230cfe 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -415,7 +415,7 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev, map_num += grp->npins; - new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); if (!new_map) return -ENOMEM; @@ -3604,7 +3604,7 @@ static int rockchip_pinconf_defer_pin(struct rockchip_pin_bank *bank, { struct rockchip_pin_deferred *cfg; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c index ffc2f0b460a6..15ac2a6625c6 100644 --- a/drivers/pinctrl/pinctrl-rp1.c +++ b/drivers/pinctrl/pinctrl-rp1.c @@ -1158,7 +1158,7 @@ static int rp1_pctl_legacy_map_pull(struct rp1_pinctrl *pc, return -EINVAL; } - configs = kzalloc(sizeof(*configs), GFP_KERNEL); + configs = kzalloc_obj(*configs, GFP_KERNEL); if (!configs) return -ENOMEM; @@ -1233,7 +1233,7 @@ static int rp1_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (num_configs || num_pulls) maps_per_pin++; reserved_maps = num_pins * maps_per_pin; - maps = kcalloc(reserved_maps, sizeof(*maps), GFP_KERNEL); + maps = kzalloc_objs(*maps, reserved_maps, GFP_KERNEL); if (!maps) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index d5fb8649cd9a..51434aa4d99f 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -319,7 +319,7 @@ pinctrl_scmi_alloc_configs(struct pinctrl_dev *pctldev, u32 num_configs, if (!*p_config_value) return -ENOMEM; - *p_config_type = kcalloc(num_configs, sizeof(**p_config_type), GFP_KERNEL); + *p_config_type = kzalloc_objs(**p_config_type, num_configs, GFP_KERNEL); if (!*p_config_type) { kfree(*p_config_value); return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-th1520.c b/drivers/pinctrl/pinctrl-th1520.c index 83e9c9f77370..3539c8b4d107 100644 --- a/drivers/pinctrl/pinctrl-th1520.c +++ b/drivers/pinctrl/pinctrl-th1520.c @@ -447,7 +447,7 @@ static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, nmaps += npins; } - map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, nmaps, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c index 96d6040a8871..ec74bc54286b 100644 --- a/drivers/pinctrl/renesas/core.c +++ b/drivers/pinctrl/renesas/core.c @@ -1273,8 +1273,7 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv) !of_find_matching_node(NULL, pdrv->driver.of_match_table)) return; - sh_pfc_regs = kcalloc(SH_PFC_MAX_REGS, sizeof(*sh_pfc_regs), - GFP_KERNEL); + sh_pfc_regs = kzalloc_objs(*sh_pfc_regs, SH_PFC_MAX_REGS, GFP_KERNEL); if (!sh_pfc_regs) return; diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c index 3cfa4c8be80e..3be4ee9d1419 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1062,7 +1062,7 @@ static int rza1_dt_node_to_map(struct pinctrl_dev *pctldev, /* Create map where to retrieve function and mux settings from */ *num_maps = 0; - *map = kzalloc(sizeof(**map), GFP_KERNEL); + *map = kzalloc_obj(**map, GFP_KERNEL); if (!*map) { ret = -ENOMEM; goto remove_function; diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c index 29a9db197599..1d43abc14df7 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -395,7 +395,7 @@ static int rza2_dt_node_to_map(struct pinctrl_dev *pctldev, /* Create map where to retrieve function and mux settings from */ *num_maps = 0; - *map = kzalloc(sizeof(**map), GFP_KERNEL); + *map = kzalloc_obj(**map, GFP_KERNEL); if (!*map) { ret = -ENOMEM; goto remove_function; diff --git a/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c b/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c index 7f1fd68db19e..5aef2a1082b5 100644 --- a/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c +++ b/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c @@ -94,7 +94,7 @@ int sophgo_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node if (!grpnames) return -ENOMEM; - map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, ngroups * 2, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/spacemit/pinctrl-k1.c b/drivers/pinctrl/spacemit/pinctrl-k1.c index 71390402aaa6..1b29313ab36d 100644 --- a/drivers/pinctrl/spacemit/pinctrl-k1.c +++ b/drivers/pinctrl/spacemit/pinctrl-k1.c @@ -499,7 +499,7 @@ static int spacemit_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, if (!grpnames) return -ENOMEM; - map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, ngroups * 2, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index a8c5fe973cd4..5af70ec62a76 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c @@ -173,7 +173,7 @@ static int spear_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, return -ENODEV; } - *map = kcalloc(count, sizeof(**map), GFP_KERNEL); + *map = kzalloc_objs(**map, count, GFP_KERNEL); if (!*map) return -ENOMEM; diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c index 7fa13f282b85..a58c7e1362a9 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c @@ -517,7 +517,7 @@ static int starfive_dt_node_to_map(struct pinctrl_dev *pctldev, if (!pgnames) return -ENOMEM; - map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, nmaps, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c index eb5cf8c067d1..6822a077d36f 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c @@ -143,7 +143,7 @@ static int jh7110_dt_node_to_map(struct pinctrl_dev *pctldev, if (!pgnames) return -ENOMEM; - map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, nmaps, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c index fabe7efaa837..66575987f34b 100644 --- a/drivers/pinctrl/sunplus/sppctl.c +++ b/drivers/pinctrl/sunplus/sppctl.c @@ -865,7 +865,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node if (nmG <= 0) nmG = 0; - *map = kcalloc(*num_maps + nmG, sizeof(**map), GFP_KERNEL); + *map = kzalloc_objs(**map, *num_maps + nmG, GFP_KERNEL); if (!(*map)) return -ENOMEM; @@ -882,7 +882,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node (*map)[i].type = PIN_MAP_TYPE_CONFIGS_PIN; (*map)[i].data.configs.num_configs = 1; (*map)[i].data.configs.group_or_pin = pin_get_name(pctldev, pin_num); - configs = kmalloc(sizeof(*configs), GFP_KERNEL); + configs = kmalloc_obj(*configs, GFP_KERNEL); if (!configs) goto sppctl_map_err; *configs = FIELD_GET(GENMASK(7, 0), dt_pin); @@ -897,7 +897,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node (*map)[i].type = PIN_MAP_TYPE_CONFIGS_PIN; (*map)[i].data.configs.num_configs = 1; (*map)[i].data.configs.group_or_pin = pin_get_name(pctldev, pin_num); - configs = kmalloc(sizeof(*configs), GFP_KERNEL); + configs = kmalloc_obj(*configs, GFP_KERNEL); if (!configs) goto sppctl_map_err; *configs = SPPCTL_IOP_CONFIGS; diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 0fb057a07dcc..c41b91a5371f 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -435,7 +435,7 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, * any configuration. */ nmaps = npins * 2; - *map = kmalloc_array(nmaps, sizeof(struct pinctrl_map), GFP_KERNEL); + *map = kmalloc_objs(struct pinctrl_map, nmaps, GFP_KERNEL); if (!*map) return -ENOMEM; @@ -1328,9 +1328,8 @@ static int sunxi_pinctrl_build_state(struct platform_device *pdev) * special functions per pin, plus one entry for the sentinel. * We'll reallocate that later anyway. */ - pctl->functions = kcalloc(7 * pctl->ngroups + 4, - sizeof(*pctl->functions), - GFP_KERNEL); + pctl->functions = kzalloc_objs(*pctl->functions, 7 * pctl->ngroups + 4, + GFP_KERNEL); if (!pctl->functions) return -ENOMEM; diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index 7213a8d4bf09..f67a675acd24 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c @@ -251,7 +251,7 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data, return group; } - configs = kzalloc(sizeof(*configs), GFP_KERNEL); + configs = kzalloc_obj(*configs, GFP_KERNEL); if (!configs) return -ENOMEM; @@ -344,8 +344,8 @@ static int wmt_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (num_pulls) maps_per_pin++; - cur_map = maps = kcalloc(num_pins * maps_per_pin, sizeof(*maps), - GFP_KERNEL); + cur_map = maps = kzalloc_objs(*maps, num_pins * maps_per_pin, + GFP_KERNEL); if (!maps) return -ENOMEM; diff --git a/drivers/platform/arm64/huawei-gaokun-ec.c b/drivers/platform/arm64/huawei-gaokun-ec.c index 7170f8eb76f7..23a727bb230c 100644 --- a/drivers/platform/arm64/huawei-gaokun-ec.c +++ b/drivers/platform/arm64/huawei-gaokun-ec.c @@ -680,7 +680,7 @@ static int gaokun_aux_init(struct device *parent, const char *name, struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 0b92047265de..7a019827afa5 100644 --- a/drivers/platform/chrome/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c @@ -807,9 +807,8 @@ chromeos_laptop_prepare_acpi_peripherals(struct chromeos_laptop *cros_laptop, if (!n_peripherals) return 0; - acpi_peripherals = kcalloc(n_peripherals, - sizeof(*src->acpi_peripherals), - GFP_KERNEL); + acpi_peripherals = kzalloc_objs(*src->acpi_peripherals, n_peripherals, + GFP_KERNEL); if (!acpi_peripherals) return -ENOMEM; @@ -881,7 +880,7 @@ chromeos_laptop_prepare(const struct chromeos_laptop *src) struct chromeos_laptop *cros_laptop; int error; - cros_laptop = kzalloc(sizeof(*cros_laptop), GFP_KERNEL); + cros_laptop = kzalloc_obj(*cros_laptop, GFP_KERNEL); if (!cros_laptop) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/chrome/cros_ec_chardev.c b/drivers/platform/chrome/cros_ec_chardev.c index c9d80ad5b57e..a2c919caa220 100644 --- a/drivers/platform/chrome/cros_ec_chardev.c +++ b/drivers/platform/chrome/cros_ec_chardev.c @@ -162,7 +162,7 @@ static int cros_ec_chardev_open(struct inode *inode, struct file *filp) struct chardev_priv *priv; int ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/platform/chrome/wilco_ec/event.c b/drivers/platform/chrome/wilco_ec/event.c index 196e46a1d489..e7f85d6f29f1 100644 --- a/drivers/platform/chrome/wilco_ec/event.c +++ b/drivers/platform/chrome/wilco_ec/event.c @@ -106,7 +106,7 @@ static struct ec_event_queue *event_queue_new(int capacity) { struct ec_event_queue *q; - q = kzalloc(struct_size(q, entries, capacity), GFP_KERNEL); + q = kzalloc_flex(*q, entries, capacity, GFP_KERNEL); if (!q) return NULL; @@ -457,7 +457,7 @@ static int event_device_add(struct acpi_device *adev) return error; } - dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) { error = -ENOMEM; goto free_minor; diff --git a/drivers/platform/chrome/wilco_ec/telemetry.c b/drivers/platform/chrome/wilco_ec/telemetry.c index b18043e31ae4..6375bbb6d6ce 100644 --- a/drivers/platform/chrome/wilco_ec/telemetry.c +++ b/drivers/platform/chrome/wilco_ec/telemetry.c @@ -248,7 +248,7 @@ static int telem_open(struct inode *inode, struct file *filp) get_device(&dev_data->dev); - sess_data = kzalloc(sizeof(*sess_data), GFP_KERNEL); + sess_data = kzalloc_obj(*sess_data, GFP_KERNEL); if (!sess_data) { atomic_set(&dev_data->available, 1); return -ENOMEM; @@ -370,7 +370,7 @@ static int telem_device_probe(struct platform_device *pdev) return error; } - dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) { ida_free(&telem_ida, minor); return -ENOMEM; diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index abc31971fe6a..370259ef3bfe 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -660,7 +660,7 @@ static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev) */ u32 new_capacity = 2 * dev->pipes_capacity; struct goldfish_pipe **pipes = - kcalloc(new_capacity, sizeof(*pipes), GFP_ATOMIC); + kzalloc_objs(*pipes, new_capacity, GFP_ATOMIC); if (!pipes) return -ENOMEM; memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity); @@ -699,7 +699,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file) int status; /* Allocate new pipe kernel object */ - struct goldfish_pipe *pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); + struct goldfish_pipe *pipe = kzalloc_obj(*pipe, GFP_KERNEL); if (!pipe) return -ENOMEM; @@ -826,8 +826,7 @@ static int goldfish_pipe_device_init(struct platform_device *pdev, dev->pdev_dev = &pdev->dev; dev->first_signalled_pipe = NULL; dev->pipes_capacity = INITIAL_PIPES_CAPACITY; - dev->pipes = kcalloc(dev->pipes_capacity, sizeof(*dev->pipes), - GFP_KERNEL); + dev->pipes = kzalloc_objs(*dev->pipes, dev->pipes_capacity, GFP_KERNEL); if (!dev->pipes) { misc_deregister(&dev->miscdev); return -ENOMEM; diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c index 14aa87b39be5..7fea80d3220c 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -1203,7 +1203,7 @@ static int mlxbf_tmfifo_create_vdev(struct device *dev, goto fail; } - tm_vdev = kzalloc(sizeof(*tm_vdev), GFP_KERNEL); + tm_vdev = kzalloc_obj(*tm_vdev, GFP_KERNEL); if (!tm_vdev) { ret = -ENOMEM; goto fail; diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c index 48e9861bb571..6a6f94ee93f4 100644 --- a/drivers/platform/olpc/olpc-ec.c +++ b/drivers/platform/olpc/olpc-ec.c @@ -408,7 +408,7 @@ static int olpc_ec_probe(struct platform_device *pdev) if (!ec_driver) return -ENODEV; - ec = kzalloc(sizeof(*ec), GFP_KERNEL); + ec = kzalloc_obj(*ec, GFP_KERNEL); if (!ec) return -ENOMEM; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c index 6a7b96d3dae6..1e72dc819e2a 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c @@ -358,7 +358,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance __func__, i); } - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) { ret = -ENOMEM; goto failed; @@ -618,7 +618,7 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl } } } else { - waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); + waiter = kzalloc_obj(*waiter, GFP_KERNEL); if (!waiter) return -ENOMEM; } @@ -1249,8 +1249,7 @@ vchiq_dump_service_use_state(struct vchiq_state *state) if (!arm_state) return; - service_data = kmalloc_array(MAX_SERVICES, sizeof(*service_data), - GFP_KERNEL); + service_data = kmalloc_objs(*service_data, MAX_SERVICES, GFP_KERNEL); if (!service_data) return; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c index f50e637d505c..616e05a36918 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c @@ -68,7 +68,7 @@ vchiq_device_register(struct device *parent, const char *name) struct vchiq_device *device; int ret; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) return NULL; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c index 83de27cfd469..1dac7d1ffaa2 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c @@ -2723,7 +2723,7 @@ vchiq_add_service_internal(struct vchiq_state *state, if (ret) return NULL; - service = kzalloc(sizeof(*service), GFP_KERNEL); + service = kzalloc_obj(*service, GFP_KERNEL); if (!service) return service; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c index 0f3dde2657d6..18bcb8c133d1 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c @@ -149,7 +149,7 @@ static int vchiq_ioc_create_service(struct vchiq_instance *instance, if (args->is_open && !instance->connected) return -ENOTCONN; - user_service = kmalloc(sizeof(*user_service), GFP_KERNEL); + user_service = kmalloc_obj(*user_service, GFP_KERNEL); if (!user_service) return -ENOMEM; @@ -298,7 +298,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance, return -EINVAL; if (args->mode == VCHIQ_BULK_MODE_BLOCKING) { - waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); + waiter = kzalloc_obj(*waiter, GFP_KERNEL); if (!waiter) { ret = -ENOMEM; goto out; @@ -1185,7 +1185,7 @@ static int vchiq_open(struct inode *inode, struct file *file) return -ENOTCONN; } - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) return -ENOMEM; diff --git a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c index cd073ed3ea2d..79790867c45c 100644 --- a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c +++ b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c @@ -190,7 +190,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) int handle; /* todo: should this be allocated from a pool to avoid kzalloc */ - msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL); + msg_context = kzalloc_obj(*msg_context, GFP_KERNEL); if (!msg_context) return ERR_PTR(-ENOMEM); @@ -1898,7 +1898,7 @@ int vchiq_mmal_init(struct device *dev, struct vchiq_mmal_instance **out_instanc goto err_shutdown_vchiq; } - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) { err = -ENOMEM; diff --git a/drivers/platform/surface/aggregator/bus.c b/drivers/platform/surface/aggregator/bus.c index d68d231e716e..dba8ca379385 100644 --- a/drivers/platform/surface/aggregator/bus.c +++ b/drivers/platform/surface/aggregator/bus.c @@ -83,7 +83,7 @@ struct ssam_device *ssam_device_alloc(struct ssam_controller *ctrl, { struct ssam_device *sdev; - sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kzalloc_obj(*sdev, GFP_KERNEL); if (!sdev) return NULL; diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c index a265e667538c..5f1940a186a1 100644 --- a/drivers/platform/surface/aggregator/controller.c +++ b/drivers/platform/surface/aggregator/controller.c @@ -344,7 +344,7 @@ ssam_nf_refcount_inc(struct ssam_nf *nf, struct ssam_event_registry reg, } } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); @@ -623,7 +623,7 @@ static struct ssam_event_item *ssam_event_item_alloc(size_t len, gfp_t flags) item->ops.free = __ssam_event_item_free_cached; } else { - item = kzalloc(struct_size(item, event.data, len), flags); + item = kzalloc_flex(*item, event.data, len, flags); if (!item) return NULL; diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c index 82e531023911..9349a1b14ab7 100644 --- a/drivers/platform/surface/aggregator/core.c +++ b/drivers/platform/surface/aggregator/core.c @@ -652,7 +652,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev) } /* Allocate controller. */ - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return -ENOMEM; diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c index 1ee5239269ae..b00f52687fa4 100644 --- a/drivers/platform/surface/surface3_power.c +++ b/drivers/platform/surface/surface3_power.c @@ -454,8 +454,7 @@ static int mshw0011_install_space_handler(struct i2c_client *client) if (!adev) return -ENODEV; - data = kzalloc(sizeof(struct mshw0011_handler_data), - GFP_KERNEL); + data = kzalloc_obj(struct mshw0011_handler_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/platform/surface/surface_aggregator_cdev.c b/drivers/platform/surface/surface_aggregator_cdev.c index bfaa09d1648b..2e4746c700c8 100644 --- a/drivers/platform/surface/surface_aggregator_cdev.c +++ b/drivers/platform/surface/surface_aggregator_cdev.c @@ -154,7 +154,7 @@ static int ssam_cdev_notifier_register(struct ssam_cdev_client *client, u8 tc, i } /* Allocate new notifier. */ - nf = kzalloc(sizeof(*nf), GFP_KERNEL); + nf = kzalloc_obj(*nf, GFP_KERNEL); if (!nf) { mutex_unlock(&client->notifier_lock); return -ENOMEM; @@ -685,7 +685,7 @@ static int ssam_dbg_device_probe(struct platform_device *pdev) if (IS_ERR(ctrl)) return PTR_ERR(ctrl) == -ENODEV ? -EPROBE_DEFER : PTR_ERR(ctrl); - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return -ENOMEM; diff --git a/drivers/platform/surface/surface_dtx.c b/drivers/platform/surface/surface_dtx.c index 97ae010069e4..43a8c23b2bf0 100644 --- a/drivers/platform/surface/surface_dtx.c +++ b/drivers/platform/surface/surface_dtx.c @@ -403,7 +403,7 @@ static int surface_dtx_open(struct inode *inode, struct file *file) struct sdtx_client *client; /* Initialize client. */ - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; @@ -1044,7 +1044,7 @@ static struct sdtx_device *sdtx_device_create(struct device *dev, struct ssam_co struct sdtx_device *ddev; int status; - ddev = kzalloc(sizeof(*ddev), GFP_KERNEL); + ddev = kzalloc_obj(*ddev, GFP_KERNEL); if (!ddev) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/surface/surfacepro3_button.c b/drivers/platform/surface/surfacepro3_button.c index e652c85c9161..28386780177c 100644 --- a/drivers/platform/surface/surfacepro3_button.c +++ b/drivers/platform/surface/surfacepro3_button.c @@ -199,7 +199,7 @@ static int surface_button_add(struct acpi_device *device) if (!surface_button_check_MSHW0040(device)) return -ENODEV; - button = kzalloc(sizeof(struct surface_button), GFP_KERNEL); + button = kzalloc_obj(struct surface_button, GFP_KERNEL); if (!button) return -ENOMEM; diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c index 1601bf9fe135..de11edb40b04 100644 --- a/drivers/platform/wmi/core.c +++ b/drivers/platform/wmi/core.c @@ -1296,7 +1296,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) continue; } - wblock = kzalloc(sizeof(*wblock), GFP_KERNEL); + wblock = kzalloc_obj(*wblock, GFP_KERNEL); if (!wblock) continue; diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 3b9b9f30faa3..73c668b840c7 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -141,7 +141,7 @@ static int amd_stb_handle_efr(struct file *filp) u32 fsize; fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + stb_data_arr = kmalloc_flex(*stb_data_arr, data, fsize, GFP_KERNEL); if (!stb_data_arr) return -ENOMEM; @@ -189,7 +189,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) } fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + stb_data_arr = kmalloc_flex(*stb_data_arr, data, fsize, GFP_KERNEL); if (!stb_data_arr) return -ENOMEM; diff --git a/drivers/platform/x86/amd/wbrf.c b/drivers/platform/x86/amd/wbrf.c index dc10d12bc80d..b7556663223a 100644 --- a/drivers/platform/x86/amd/wbrf.c +++ b/drivers/platform/x86/amd/wbrf.c @@ -72,7 +72,9 @@ static int wbrf_record(struct acpi_device *adev, uint8_t action, struct wbrf_ran */ num_of_elements = 2 * num_of_ranges + 2; - union acpi_object *tmp __free(kfree) = kcalloc(num_of_elements, sizeof(*tmp), GFP_KERNEL); + union acpi_object *tmp __free(kfree) = kzalloc_objs(*tmp, + num_of_elements, + GFP_KERNEL); if (!tmp) return -ENOMEM; diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 1417e230edbd..83f4e96ecbc7 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -799,7 +799,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) return -ENODEV; } - gmux_data = kzalloc(sizeof(*gmux_data), GFP_KERNEL); + gmux_data = kzalloc_obj(*gmux_data, GFP_KERNEL); if (!gmux_data) return -ENOMEM; pnp_set_drvdata(pnp, gmux_data); diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c index 9c1a9ad42bc4..9222e645756f 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -1005,8 +1005,8 @@ static void init_rog_tunables(void) /* Initialize AC power tunables */ ac_limits = power_data->ac_data; if (ac_limits) { - ac_rog_tunables = kzalloc(sizeof(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_AC]), - GFP_KERNEL); + ac_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_AC], + GFP_KERNEL); if (!ac_rog_tunables) goto err_nomem; @@ -1053,8 +1053,8 @@ static void init_rog_tunables(void) /* Initialize DC power tunables */ dc_limits = power_data->dc_data; if (dc_limits) { - dc_rog_tunables = kzalloc(sizeof(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_DC]), - GFP_KERNEL); + dc_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_DC], + GFP_KERNEL); if (!dc_rog_tunables) { kfree(ac_rog_tunables); goto err_nomem; diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index a0a411b4f2d6..2b85315b7bd5 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1831,7 +1831,7 @@ static int asus_acpi_add(struct acpi_device *device) pr_notice("Asus Laptop Support version %s\n", ASUS_LAPTOP_VERSION); - asus = kzalloc(sizeof(struct asus_laptop), GFP_KERNEL); + asus = kzalloc_obj(struct asus_laptop, GFP_KERNEL); if (!asus) return -ENOMEM; asus->handle = device->handle; diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 275b56d6a09f..93905860fe07 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -5014,7 +5014,7 @@ static int asus_wmi_add(struct platform_device *pdev) int err; u32 result; - asus = kzalloc(sizeof(struct asus_wmi), GFP_KERNEL); + asus = kzalloc_obj(struct asus_wmi, GFP_KERNEL); if (!asus) return -ENOMEM; diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 74d3eb83f56a..bc9e26b94c84 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c @@ -400,7 +400,7 @@ static int cmpc_accel_add_v4(struct acpi_device *acpi) struct input_dev *inputdev; struct cmpc_accel *accel; - accel = kmalloc(sizeof(*accel), GFP_KERNEL); + accel = kmalloc_obj(*accel, GFP_KERNEL); if (!accel) return -ENOMEM; @@ -650,7 +650,7 @@ static int cmpc_accel_add(struct acpi_device *acpi) struct input_dev *inputdev; struct cmpc_accel *accel; - accel = kmalloc(sizeof(*accel), GFP_KERNEL); + accel = kmalloc_obj(*accel, GFP_KERNEL); if (!accel) return -ENOMEM; @@ -964,7 +964,7 @@ static int cmpc_ipml_add(struct acpi_device *acpi) struct ipml200_dev *ipml; struct backlight_properties props; - ipml = kmalloc(sizeof(*ipml), GFP_KERNEL); + ipml = kmalloc_obj(*ipml, GFP_KERNEL); if (ipml == NULL) return -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c index 444786102f02..dd011e252713 100644 --- a/drivers/platform/x86/dell/dell-smbios-base.c +++ b/drivers/platform/x86/dell/dell-smbios-base.c @@ -495,12 +495,13 @@ static int build_tokens_sysfs(struct platform_device *dev) int ret; int i, j; - token_entries = kcalloc(da_num_tokens, sizeof(*token_entries), GFP_KERNEL); + token_entries = kzalloc_objs(*token_entries, da_num_tokens, GFP_KERNEL); if (!token_entries) return -ENOMEM; /* need to store both location and value + terminator*/ - token_attrs = kcalloc((2 * da_num_tokens) + 1, sizeof(*token_attrs), GFP_KERNEL); + token_attrs = kzalloc_objs(*token_attrs, (2 * da_num_tokens) + 1, + GFP_KERNEL); if (!token_attrs) goto out_allocate_attrs; diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c index 28076929d6af..f2e63be75fb3 100644 --- a/drivers/platform/x86/dell/dell-wmi-base.c +++ b/drivers/platform/x86/dell/dell-wmi-base.c @@ -586,7 +586,7 @@ static void handle_dmi_entry(const struct dmi_header *dm, void *opaque) return; } - keymap = kcalloc(hotkey_num, sizeof(struct key_entry), GFP_KERNEL); + keymap = kzalloc_objs(struct key_entry, hotkey_num, GFP_KERNEL); if (!keymap) { results->err = -ENOMEM; return; @@ -656,13 +656,9 @@ static int dell_wmi_input_setup(struct wmi_device *wdev) goto err_free_dev; } - keymap = kcalloc(dmi_results.keymap_size + - ARRAY_SIZE(dell_wmi_keymap_type_0000) + - ARRAY_SIZE(dell_wmi_keymap_type_0010) + - ARRAY_SIZE(dell_wmi_keymap_type_0011) + - ARRAY_SIZE(dell_wmi_keymap_type_0012) + - 1, - sizeof(struct key_entry), GFP_KERNEL); + keymap = kzalloc_objs(struct key_entry, + dmi_results.keymap_size + ARRAY_SIZE(dell_wmi_keymap_type_0000) + ARRAY_SIZE(dell_wmi_keymap_type_0010) + ARRAY_SIZE(dell_wmi_keymap_type_0011) + ARRAY_SIZE(dell_wmi_keymap_type_0012) + 1, + GFP_KERNEL); if (!keymap) { kfree(dmi_results.keymap); err = -ENOMEM; @@ -773,7 +769,7 @@ static int dell_wmi_events_set_enabled(bool enable) struct calling_interface_buffer *buffer; int ret; - buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL); + buffer = kzalloc_obj(struct calling_interface_buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; buffer->cmd_class = CLASS_INFO; diff --git a/drivers/platform/x86/dell/dell-wmi-privacy.c b/drivers/platform/x86/dell/dell-wmi-privacy.c index 4b65e1655d42..40fe2c4adedb 100644 --- a/drivers/platform/x86/dell/dell-wmi-privacy.c +++ b/drivers/platform/x86/dell/dell-wmi-privacy.c @@ -314,8 +314,8 @@ static int dell_privacy_wmi_probe(struct wmi_device *wdev, const void *context) return -ENOMEM; /* remap the wmi keymap event to new keymap */ - keymap = kcalloc(ARRAY_SIZE(dell_wmi_keymap_type_0012), - sizeof(struct key_entry), GFP_KERNEL); + keymap = kzalloc_objs(struct key_entry, + ARRAY_SIZE(dell_wmi_keymap_type_0012), GFP_KERNEL); if (!keymap) return -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/enum-attributes.c b/drivers/platform/x86/dell/dell-wmi-sysman/enum-attributes.c index fc2f58b4cbc6..c7c55f8fe0a0 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/enum-attributes.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/enum-attributes.c @@ -119,8 +119,9 @@ int alloc_enum_data(void) wmi_priv.enumeration_instances_count = get_instance_count(DELL_WMI_BIOS_ENUMERATION_ATTRIBUTE_GUID); - wmi_priv.enumeration_data = kcalloc(wmi_priv.enumeration_instances_count, - sizeof(struct enumeration_data), GFP_KERNEL); + wmi_priv.enumeration_data = kzalloc_objs(struct enumeration_data, + wmi_priv.enumeration_instances_count, + GFP_KERNEL); if (!wmi_priv.enumeration_data) { wmi_priv.enumeration_instances_count = 0; ret = -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/int-attributes.c b/drivers/platform/x86/dell/dell-wmi-sysman/int-attributes.c index 735248064239..f00a1cbac2f9 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/int-attributes.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/int-attributes.c @@ -123,8 +123,9 @@ int alloc_int_data(void) int ret = 0; wmi_priv.integer_instances_count = get_instance_count(DELL_WMI_BIOS_INTEGER_ATTRIBUTE_GUID); - wmi_priv.integer_data = kcalloc(wmi_priv.integer_instances_count, - sizeof(struct integer_data), GFP_KERNEL); + wmi_priv.integer_data = kzalloc_objs(struct integer_data, + wmi_priv.integer_instances_count, + GFP_KERNEL); if (!wmi_priv.integer_data) { wmi_priv.integer_instances_count = 0; ret = -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c b/drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c index 3167e06d416e..44ecdcb82d84 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c @@ -143,7 +143,8 @@ int alloc_po_data(void) int ret = 0; wmi_priv.po_instances_count = get_instance_count(DELL_WMI_BIOS_PASSOBJ_ATTRIBUTE_GUID); - wmi_priv.po_data = kcalloc(wmi_priv.po_instances_count, sizeof(struct po_data), GFP_KERNEL); + wmi_priv.po_data = kzalloc_objs(struct po_data, + wmi_priv.po_instances_count, GFP_KERNEL); if (!wmi_priv.po_data) { wmi_priv.po_instances_count = 0; ret = -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/string-attributes.c b/drivers/platform/x86/dell/dell-wmi-sysman/string-attributes.c index 0d2c74f8d1aa..9e11c00ad859 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/string-attributes.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/string-attributes.c @@ -108,8 +108,9 @@ int alloc_str_data(void) int ret = 0; wmi_priv.str_instances_count = get_instance_count(DELL_WMI_BIOS_STRING_ATTRIBUTE_GUID); - wmi_priv.str_data = kcalloc(wmi_priv.str_instances_count, - sizeof(struct str_data), GFP_KERNEL); + wmi_priv.str_data = kzalloc_objs(struct str_data, + wmi_priv.str_instances_count, + GFP_KERNEL); if (!wmi_priv.str_data) { wmi_priv.str_instances_count = 0; ret = -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index f5402b714657..577949ee2e23 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -460,7 +460,7 @@ static int init_bios_attributes(int attr_type, const char *guid) } /* build attribute */ - attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); if (!attr_name_kobj) { retval = -ENOMEM; goto err_attr_init; diff --git a/drivers/platform/x86/dell/dell_rbu.c b/drivers/platform/x86/dell/dell_rbu.c index 403df9bd9522..daf5df8cbafc 100644 --- a/drivers/platform/x86/dell/dell_rbu.c +++ b/drivers/platform/x86/dell/dell_rbu.c @@ -111,7 +111,7 @@ static int create_packet(void *data, size_t length) __must_hold(&rbu_data.lock) spin_unlock(&rbu_data.lock); - newpacket = kzalloc(sizeof (struct packet_data), GFP_KERNEL); + newpacket = kzalloc_obj(struct packet_data, GFP_KERNEL); if (!newpacket) { pr_warn("failed to allocate new packet\n"); diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index d1908815f5a2..e42045494b2c 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -1366,7 +1366,7 @@ static int eeepc_acpi_add(struct acpi_device *device) int result; pr_notice(EEEPC_LAPTOP_NAME "\n"); - eeepc = kzalloc(sizeof(struct eeepc_laptop), GFP_KERNEL); + eeepc = kzalloc_obj(struct eeepc_laptop, GFP_KERNEL); if (!eeepc) return -ENOMEM; eeepc->handle = device->handle; diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index 51e8977d3eb4..bf3d409e5974 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -588,7 +588,7 @@ static int hp_add_other_attributes(int attr_type) int ret; char *attr_name; - attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); if (!attr_name_kobj) return -ENOMEM; @@ -711,7 +711,7 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type, } /* build attribute */ - attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); if (!attr_name_kobj) { ret = -ENOMEM; goto pack_attr_exit; @@ -810,7 +810,7 @@ static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type, } /* build attribute */ - attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); if (!attr_name_kobj) { ret = -ENOMEM; goto buff_attr_exit; diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index f346aad8e9d8..4a09fd32ebc6 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -94,8 +94,9 @@ int hp_alloc_enumeration_data(void) bioscfg_drv.enumeration_instances_count = hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID); - bioscfg_drv.enumeration_data = kcalloc(bioscfg_drv.enumeration_instances_count, - sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL); + bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data, + bioscfg_drv.enumeration_instances_count, + GFP_KERNEL); if (!bioscfg_drv.enumeration_data) { bioscfg_drv.enumeration_instances_count = 0; return -ENOMEM; diff --git a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c index 63b1fda2be4e..84d522f2b491 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c @@ -109,8 +109,9 @@ static const struct attribute_group integer_attr_group = { int hp_alloc_integer_data(void) { bioscfg_drv.integer_instances_count = hp_get_instance_count(HP_WMI_BIOS_INTEGER_GUID); - bioscfg_drv.integer_data = kcalloc(bioscfg_drv.integer_instances_count, - sizeof(*bioscfg_drv.integer_data), GFP_KERNEL); + bioscfg_drv.integer_data = kzalloc_objs(*bioscfg_drv.integer_data, + bioscfg_drv.integer_instances_count, + GFP_KERNEL); if (!bioscfg_drv.integer_data) { bioscfg_drv.integer_instances_count = 0; diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 6a31f47ce3f5..592328280a81 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -98,9 +98,9 @@ int hp_alloc_ordered_list_data(void) { bioscfg_drv.ordered_list_instances_count = hp_get_instance_count(HP_WMI_BIOS_ORDERED_LIST_GUID); - bioscfg_drv.ordered_list_data = kcalloc(bioscfg_drv.ordered_list_instances_count, - sizeof(*bioscfg_drv.ordered_list_data), - GFP_KERNEL); + bioscfg_drv.ordered_list_data = kzalloc_objs(*bioscfg_drv.ordered_list_data, + bioscfg_drv.ordered_list_instances_count, + GFP_KERNEL); if (!bioscfg_drv.ordered_list_data) { bioscfg_drv.ordered_list_instances_count = 0; return -ENOMEM; diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index ec79d9d50377..dc7107ff010b 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -185,8 +185,9 @@ static const struct attribute_group password_attr_group = { int hp_alloc_password_data(void) { bioscfg_drv.password_instances_count = hp_get_instance_count(HP_WMI_BIOS_PASSWORD_GUID); - bioscfg_drv.password_data = kcalloc(bioscfg_drv.password_instances_count, - sizeof(*bioscfg_drv.password_data), GFP_KERNEL); + bioscfg_drv.password_data = kzalloc_objs(*bioscfg_drv.password_data, + bioscfg_drv.password_instances_count, + GFP_KERNEL); if (!bioscfg_drv.password_data) { bioscfg_drv.password_instances_count = 0; return -ENOMEM; diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c index 7b885d25650c..f0ce4f3e7f20 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c @@ -101,8 +101,9 @@ static const struct attribute_group string_attr_group = { int hp_alloc_string_data(void) { bioscfg_drv.string_instances_count = hp_get_instance_count(HP_WMI_BIOS_STRING_GUID); - bioscfg_drv.string_data = kcalloc(bioscfg_drv.string_instances_count, - sizeof(*bioscfg_drv.string_data), GFP_KERNEL); + bioscfg_drv.string_data = kzalloc_objs(*bioscfg_drv.string_data, + bioscfg_drv.string_instances_count, + GFP_KERNEL); if (!bioscfg_drv.string_data) { bioscfg_drv.string_instances_count = 0; return -ENOMEM; diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 8a4c54089ace..64c5543f795d 100644 --- a/drivers/platform/x86/huawei-wmi.c +++ b/drivers/platform/x86/huawei-wmi.c @@ -854,7 +854,7 @@ static __init int huawei_wmi_init(void) struct platform_device *pdev; int err; - huawei_wmi = kzalloc(sizeof(struct huawei_wmi), GFP_KERNEL); + huawei_wmi = kzalloc_obj(struct huawei_wmi, GFP_KERNEL); if (!huawei_wmi) return -ENOMEM; diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index b73e582128c9..1f4f84217d5e 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -125,7 +125,7 @@ static int __init ifs_init(void) if (rdmsrq_safe(MSR_INTEGRITY_CAPS, &msrval)) return -ENODEV; - ifs_pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); + ifs_pkg_auth = kmalloc_objs(bool, topology_max_packages(), GFP_KERNEL); if (!ifs_pkg_auth) return -ENOMEM; diff --git a/drivers/platform/x86/intel/int1092/intel_sar.c b/drivers/platform/x86/intel/int1092/intel_sar.c index e526841aff60..568a2722477b 100644 --- a/drivers/platform/x86/intel/int1092/intel_sar.c +++ b/drivers/platform/x86/intel/int1092/intel_sar.c @@ -91,8 +91,8 @@ static acpi_status parse_package(struct wwan_sar_context *context, union acpi_ob item->package.count <= data->total_dev_mode) return AE_ERROR; - data->device_mode_info = kmalloc_array(data->total_dev_mode, - sizeof(struct wwan_device_mode_info), GFP_KERNEL); + data->device_mode_info = kmalloc_objs(struct wwan_device_mode_info, + data->total_dev_mode, GFP_KERNEL); if (!data->device_mode_info) return AE_ERROR; @@ -248,7 +248,7 @@ static int sar_probe(struct platform_device *device) int reg; int result; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return -ENOMEM; diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 1505fc3ef7a8..ec0994bfa9fc 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -107,7 +107,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, int ret; struct gpiod_lookup_table *lookup __free(kfree) = - kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); + kzalloc_flex(*lookup, table, 2, GFP_KERNEL); if (!lookup) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index 0133405697dc..fdbb8b0005f2 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -180,7 +180,8 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) if (!board_data) return dev_err_probe(&client->dev, -ENODEV, "No board-data found for this model\n"); - cells = kcalloc(TPS68470_WIN_MFD_CELL_COUNT, sizeof(*cells), GFP_KERNEL); + cells = kzalloc_objs(*cells, TPS68470_WIN_MFD_CELL_COUNT, + GFP_KERNEL); if (!cells) return -ENOMEM; diff --git a/drivers/platform/x86/intel/pmc/pltdrv.c b/drivers/platform/x86/intel/pmc/pltdrv.c index 3141d6cbc41b..6fcf0f85a8d7 100644 --- a/drivers/platform/x86/intel/pmc/pltdrv.c +++ b/drivers/platform/x86/intel/pmc/pltdrv.c @@ -65,7 +65,7 @@ static int __init pmc_core_platform_init(void) if (!x86_match_cpu(intel_pmc_core_platform_ids)) return -ENODEV; - pmc_core_device = kzalloc(sizeof(*pmc_core_device), GFP_KERNEL); + pmc_core_device = kzalloc_obj(*pmc_core_device, GFP_KERNEL); if (!pmc_core_device) return -ENOMEM; diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c index a4dfca6cac19..2eee7389dcf9 100644 --- a/drivers/platform/x86/intel/pmt/telemetry.c +++ b/drivers/platform/x86/intel/pmt/telemetry.c @@ -107,7 +107,7 @@ static int pmt_telem_add_endpoint(struct intel_vsec_device *ivdev, struct telem_endpoint *ep; /* Endpoint lifetimes are managed by kref, not devres */ - entry->ep = kzalloc(sizeof(*(entry->ep)), GFP_KERNEL); + entry->ep = kzalloc_obj(*(entry->ep), GFP_KERNEL); if (!entry->ep) return -ENOMEM; diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index 7449873c3d40..33abff1dbe84 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -89,7 +89,7 @@ static int isst_store_new_cmd(int cmd, u32 cpu, int mbox_cmd_type, u32 param, { struct isst_cmd *sst_cmd; - sst_cmd = kmalloc(sizeof(*sst_cmd), GFP_KERNEL); + sst_cmd = kmalloc_obj(*sst_cmd, GFP_KERNEL); if (!sst_cmd) return -ENOMEM; @@ -425,15 +425,13 @@ static int isst_if_cpu_info_init(void) { int ret; - isst_cpu_info = kcalloc(num_possible_cpus(), - sizeof(*isst_cpu_info), - GFP_KERNEL); + isst_cpu_info = kzalloc_objs(*isst_cpu_info, num_possible_cpus(), + GFP_KERNEL); if (!isst_cpu_info) return -ENOMEM; - isst_pkg_info = kcalloc(topology_max_packages(), - sizeof(*isst_pkg_info), - GFP_KERNEL); + isst_pkg_info = kzalloc_objs(*isst_pkg_info, topology_max_packages(), + GFP_KERNEL); if (!isst_pkg_info) { kfree(isst_cpu_info); return -ENOMEM; diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index 9c078c8acb50..9242e29aac59 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -1603,7 +1603,7 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev) * devm_* allocation here as each partition is a * different device, which can be unbound. */ - tpmi_sst = kzalloc(sizeof(*tpmi_sst), GFP_KERNEL); + tpmi_sst = kzalloc_obj(*tpmi_sst, GFP_KERNEL); if (!tpmi_sst) { ret = -ENOMEM; goto unlock_exit; @@ -1819,9 +1819,8 @@ int tpmi_sst_init(void) goto init_done; } - isst_common.sst_inst = kcalloc(topology_max_packages(), - sizeof(*isst_common.sst_inst), - GFP_KERNEL); + isst_common.sst_inst = kzalloc_objs(*isst_common.sst_inst, + topology_max_packages(), GFP_KERNEL); if (!isst_common.sst_inst) { ret = -ENOMEM; goto init_done; diff --git a/drivers/platform/x86/intel/tpmi_power_domains.c b/drivers/platform/x86/intel/tpmi_power_domains.c index 7d93119a4c30..57c8856fc468 100644 --- a/drivers/platform/x86/intel/tpmi_power_domains.c +++ b/drivers/platform/x86/intel/tpmi_power_domains.c @@ -221,8 +221,9 @@ static int __init tpmi_init(void) if (ret) return ret; - tpmi_power_domain_mask = kcalloc(size_mul(topology_max_packages(), MAX_POWER_DOMAINS), - sizeof(*tpmi_power_domain_mask), GFP_KERNEL); + tpmi_power_domain_mask = kzalloc_objs(*tpmi_power_domain_mask, + size_mul(topology_max_packages(), MAX_POWER_DOMAINS), + GFP_KERNEL); if (!tpmi_power_domain_mask) return -ENOMEM; diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c index 0dfc552b2802..89a90bd90c44 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c @@ -278,8 +278,8 @@ static int __init intel_uncore_init(void) uncore_max_entries = topology_max_packages() * topology_max_dies_per_package(); - uncore_instances = kcalloc(uncore_max_entries, - sizeof(*uncore_instances), GFP_KERNEL); + uncore_instances = kzalloc_objs(*uncore_instances, uncore_max_entries, + GFP_KERNEL); if (!uncore_instances) return -ENOMEM; diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index 012d87878afd..b21a9cfabad4 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -299,11 +299,11 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he return -EINVAL; } - intel_vsec_dev = kzalloc(sizeof(*intel_vsec_dev), GFP_KERNEL); + intel_vsec_dev = kzalloc_obj(*intel_vsec_dev, GFP_KERNEL); if (!intel_vsec_dev) return -ENOMEM; - res = kcalloc(header->num_entries, sizeof(*res), GFP_KERNEL); + res = kzalloc_objs(*res, header->num_entries, GFP_KERNEL); if (!res) return -ENOMEM; diff --git a/drivers/platform/x86/intel/vsec_tpmi.c b/drivers/platform/x86/intel/vsec_tpmi.c index 7748b5557a18..9614fb8584f2 100644 --- a/drivers/platform/x86/intel/vsec_tpmi.c +++ b/drivers/platform/x86/intel/vsec_tpmi.c @@ -622,11 +622,11 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, if (!name) return -EOPNOTSUPP; - res = kcalloc(pfs->pfs_header.num_entries, sizeof(*res), GFP_KERNEL); + res = kzalloc_objs(*res, pfs->pfs_header.num_entries, GFP_KERNEL); if (!res) return -ENOMEM; - feature_vsec_dev = kzalloc(sizeof(*feature_vsec_dev), GFP_KERNEL); + feature_vsec_dev = kzalloc_obj(*feature_vsec_dev, GFP_KERNEL); if (!feature_vsec_dev) { kfree(res); return -ENOMEM; diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 3acf6149a9ec..4412e7c2bce0 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -573,7 +573,7 @@ __intel_scu_ipc_register(struct device *parent, if (ipcdev) return ERR_PTR(-EBUSY); - scu = kzalloc(sizeof(*scu), GFP_KERNEL); + scu = kzalloc_obj(*scu, GFP_KERNEL); if (!scu) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c index 06ac002a1ebc..59703574e8ce 100644 --- a/drivers/platform/x86/lenovo/ideapad-laptop.c +++ b/drivers/platform/x86/lenovo/ideapad-laptop.c @@ -1172,7 +1172,7 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv) return -ENODEV; } - priv->dytc = kzalloc(sizeof(*priv->dytc), GFP_KERNEL); + priv->dytc = kzalloc_obj(*priv->dytc, GFP_KERNEL); if (!priv->dytc) return -ENOMEM; diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c index c45f0206b4ab..a89f9436a795 100644 --- a/drivers/platform/x86/lenovo/think-lmi.c +++ b/drivers/platform/x86/lenovo/think-lmi.c @@ -1593,7 +1593,7 @@ static struct tlmi_pwd_setting *tlmi_create_auth(const char *pwd_type, { struct tlmi_pwd_setting *new_pwd; - new_pwd = kzalloc(sizeof(struct tlmi_pwd_setting), GFP_KERNEL); + new_pwd = kzalloc_obj(struct tlmi_pwd_setting, GFP_KERNEL); if (!new_pwd) return NULL; @@ -1668,7 +1668,7 @@ static int tlmi_analyze(struct wmi_device *wdev) strreplace(item, ',', '\0'); /* Create a setting entry */ - setting = kzalloc(sizeof(*setting), GFP_KERNEL); + setting = kzalloc_obj(*setting, GFP_KERNEL); if (!setting) { ret = -ENOMEM; kfree(item); diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 6b0e4b4c485e..9a5b1d793cb9 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -873,7 +873,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) BUG_ON(!ibm->acpi); - ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL); + ibm->acpi->driver = kzalloc_obj(struct acpi_driver, GFP_KERNEL); if (!ibm->acpi->driver) { pr_err("failed to allocate memory for ibm->acpi->driver\n"); return -ENOMEM; @@ -1197,7 +1197,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, BUG_ON(id >= TPACPI_RFK_SW_MAX || tpacpi_rfkill_switches[id]); - atp_rfk = kzalloc(sizeof(struct tpacpi_rfk), GFP_KERNEL); + atp_rfk = kzalloc_obj(struct tpacpi_rfk, GFP_KERNEL); if (atp_rfk) atp_rfk->rfkill = rfkill_alloc(name, &tpacpi_pdev->dev, @@ -5817,8 +5817,7 @@ static int __init led_init(struct ibm_init_struct *iibm) if (led_supported == TPACPI_LED_NONE) return -ENODEV; - tpacpi_leds = kcalloc(TPACPI_LED_NUMLEDS, sizeof(*tpacpi_leds), - GFP_KERNEL); + tpacpi_leds = kzalloc_objs(*tpacpi_leds, TPACPI_LED_NUMLEDS, GFP_KERNEL); if (!tpacpi_leds) { pr_err("Out of memory for LED data\n"); return -ENOMEM; diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 937f1a5b78ed..9990f6b920c5 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -1017,7 +1017,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) */ num_sifr++; - pcc = kzalloc(sizeof(struct pcc_acpi), GFP_KERNEL); + pcc = kzalloc_obj(struct pcc_acpi, GFP_KERNEL); if (!pcc) { pr_err("Couldn't allocate mem for pcc"); return -ENOMEM; diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index 0aa7076bc9cc..3b6edd709543 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -428,7 +428,7 @@ static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap, struct platform_device *clkdev; struct pmc_clk_data *clk_data; - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); if (!clk_data) return -ENOMEM; diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 9d43a12db73c..50e337a85135 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -1671,7 +1671,7 @@ static int __init samsung_init(void) if (!force && !dmi_check_system(samsung_dmi_table)) return -ENODEV; - samsung = kzalloc(sizeof(*samsung), GFP_KERNEL); + samsung = kzalloc_obj(*samsung, GFP_KERNEL); if (!samsung) return -ENOMEM; diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 56beebc38850..a670473b20ab 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -829,7 +829,7 @@ static int sony_nc_handles_setup(struct platform_device *pd) { int i, r, result, arg; - handles = kzalloc(sizeof(*handles), GFP_KERNEL); + handles = kzalloc_obj(*handles, GFP_KERNEL); if (!handles) return -ENOMEM; @@ -1902,7 +1902,7 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, } } - kbdbl_ctl = kzalloc(sizeof(*kbdbl_ctl), GFP_KERNEL); + kbdbl_ctl = kzalloc_obj(*kbdbl_ctl, GFP_KERNEL); if (!kbdbl_ctl) return -ENOMEM; @@ -2070,7 +2070,7 @@ static int sony_nc_battery_care_setup(struct platform_device *pd, { int ret = 0; - bcare_ctl = kzalloc(sizeof(struct battery_care_control), GFP_KERNEL); + bcare_ctl = kzalloc_obj(struct battery_care_control, GFP_KERNEL); if (!bcare_ctl) return -ENOMEM; @@ -2222,7 +2222,7 @@ static ssize_t sony_nc_thermal_mode_show(struct device *dev, static int sony_nc_thermal_setup(struct platform_device *pd) { int ret = 0; - th_handle = kzalloc(sizeof(struct snc_thermal_ctrl), GFP_KERNEL); + th_handle = kzalloc_obj(struct snc_thermal_ctrl, GFP_KERNEL); if (!th_handle) return -ENOMEM; @@ -2370,7 +2370,7 @@ static int sony_nc_lid_resume_setup(struct platform_device *pd, if (sony_call_snc_handle(handle, 0x0000, &result)) return -EIO; - lid_ctl = kzalloc(sizeof(struct snc_lid_resume_control), GFP_KERNEL); + lid_ctl = kzalloc_obj(struct snc_lid_resume_control, GFP_KERNEL); if (!lid_ctl) return -ENOMEM; @@ -2497,7 +2497,7 @@ static int sony_nc_gfx_switch_setup(struct platform_device *pd, { unsigned int result; - gfxs_ctl = kzalloc(sizeof(struct snc_gfx_switch_control), GFP_KERNEL); + gfxs_ctl = kzalloc_obj(struct snc_gfx_switch_control, GFP_KERNEL); if (!gfxs_ctl) return -ENOMEM; @@ -2576,7 +2576,7 @@ static int sony_nc_highspeed_charging_setup(struct platform_device *pd) return 0; } - hsc_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + hsc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!hsc_handle) return -ENOMEM; @@ -2642,7 +2642,7 @@ static int sony_nc_lowbatt_setup(struct platform_device *pd) { unsigned int result; - lowbatt_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + lowbatt_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!lowbatt_handle) return -ENOMEM; @@ -2719,11 +2719,11 @@ static int sony_nc_fanspeed_setup(struct platform_device *pd) { unsigned int result; - fan_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + fan_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!fan_handle) return -ENOMEM; - hsf_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + hsf_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!hsf_handle) { result = -ENOMEM; goto out_hsf_handle_alloc; @@ -2823,7 +2823,7 @@ static int sony_nc_usb_charge_setup(struct platform_device *pd) return 0; } - uc_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + uc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!uc_handle) return -ENOMEM; @@ -2870,7 +2870,7 @@ static int sony_nc_panelid_setup(struct platform_device *pd) { unsigned int result; - panel_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + panel_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!panel_handle) return -ENOMEM; @@ -2925,7 +2925,7 @@ static int sony_nc_smart_conn_setup(struct platform_device *pd) { unsigned int result; - sc_handle = kzalloc(sizeof(struct device_attribute), GFP_KERNEL); + sc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); if (!sc_handle) return -ENOMEM; @@ -2999,7 +2999,7 @@ static int sony_nc_touchpad_setup(struct platform_device *pd, { int ret = 0; - tp_ctl = kzalloc(sizeof(struct touchpad_control), GFP_KERNEL); + tp_ctl = kzalloc_obj(struct touchpad_control, GFP_KERNEL); if (!tp_ctl) return -ENOMEM; @@ -4161,7 +4161,8 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) case ACPI_RESOURCE_TYPE_START_DEPENDENT: { /* start IO enumeration */ - struct sony_pic_ioport *ioport = kzalloc(sizeof(*ioport), GFP_KERNEL); + struct sony_pic_ioport *ioport = kzalloc_obj(*ioport, + GFP_KERNEL); if (!ioport) return AE_ERROR; @@ -4191,8 +4192,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) p->interrupts[i]); continue; } - interrupt = kzalloc(sizeof(*interrupt), - GFP_KERNEL); + interrupt = kzalloc_obj(*interrupt, GFP_KERNEL); if (!interrupt) return AE_ERROR; diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c index 53fc2b364552..955021a0ffa4 100644 --- a/drivers/platform/x86/topstar-laptop.c +++ b/drivers/platform/x86/topstar-laptop.c @@ -292,7 +292,7 @@ static int topstar_acpi_add(struct acpi_device *device) dmi_check_system(topstar_dmi_ids); - topstar = kzalloc(sizeof(struct topstar_laptop), GFP_KERNEL); + topstar = kzalloc_obj(struct topstar_laptop, GFP_KERNEL); if (!topstar) return -ENOMEM; diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 5ad3a7183d33..8e1773f44f64 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -3321,7 +3321,7 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) return -ENODEV; } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->acpi_dev = acpi_dev; diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c index dad2c3e55904..6e71de0abca2 100644 --- a/drivers/platform/x86/toshiba_bluetooth.c +++ b/drivers/platform/x86/toshiba_bluetooth.c @@ -242,7 +242,7 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device) pr_info("Toshiba ACPI Bluetooth device driver\n"); - bt_dev = kzalloc(sizeof(*bt_dev), GFP_KERNEL); + bt_dev = kzalloc_obj(*bt_dev, GFP_KERNEL); if (!bt_dev) return -ENOMEM; bt_dev->acpi_dev = device; diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c index 3c9af441d133..bad9c030295f 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -1293,7 +1293,7 @@ static int uniwill_add_battery(struct power_supply *battery, struct acpi_battery struct uniwill_battery_entry *entry; int ret; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index f6a0627f36db..fa2e31151923 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -216,7 +216,7 @@ static int uv_hubs_init(void) u64 sz; int i, ret; - prev_obj_to_cnode = kmalloc_array(uv_bios_obj_cnt, sizeof(*prev_obj_to_cnode), + prev_obj_to_cnode = kmalloc_objs(*prev_obj_to_cnode, uv_bios_obj_cnt, GFP_KERNEL); if (!prev_obj_to_cnode) return -ENOMEM; @@ -242,14 +242,14 @@ static int uv_hubs_init(void) goto err_enum_objs; } - uv_hubs = kcalloc(uv_bios_obj_cnt, sizeof(*uv_hubs), GFP_KERNEL); + uv_hubs = kzalloc_objs(*uv_hubs, uv_bios_obj_cnt, GFP_KERNEL); if (!uv_hubs) { ret = -ENOMEM; goto err_enum_objs; } for (i = 0; i < uv_bios_obj_cnt; i++) { - uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL); + uv_hubs[i] = kzalloc_obj(*uv_hubs[i], GFP_KERNEL); if (!uv_hubs[i]) { i--; ret = -ENOMEM; @@ -368,7 +368,7 @@ static int uv_ports_init(void) s64 biosr; int j = 0, k = 0, ret, sz; - port_buf = kcalloc(uv_bios_obj_cnt, sizeof(*port_buf), GFP_KERNEL); + port_buf = kzalloc_objs(*port_buf, uv_bios_obj_cnt, GFP_KERNEL); if (!port_buf) return -ENOMEM; @@ -388,8 +388,8 @@ static int uv_ports_init(void) } } for (j = 0; j < uv_bios_obj_cnt; j++) { - uv_hubs[j]->ports = kcalloc(hub_buf[j].ports, - sizeof(*uv_hubs[j]->ports), GFP_KERNEL); + uv_hubs[j]->ports = kzalloc_objs(*uv_hubs[j]->ports, + hub_buf[j].ports, GFP_KERNEL); if (!uv_hubs[j]->ports) { ret = -ENOMEM; j--; @@ -398,7 +398,8 @@ static int uv_ports_init(void) } for (j = 0; j < uv_bios_obj_cnt; j++) { for (k = 0; k < hub_buf[j].ports; k++) { - uv_hubs[j]->ports[k] = kzalloc(sizeof(*uv_hubs[j]->ports[k]), GFP_KERNEL); + uv_hubs[j]->ports[k] = kzalloc_obj(*uv_hubs[j]->ports[k], + GFP_KERNEL); if (!uv_hubs[j]->ports[k]) { ret = -ENOMEM; k--; @@ -674,8 +675,8 @@ static int pci_topology_init(void) } num_pci_lines = l; - uv_pci_objs = kcalloc(num_pci_lines, - sizeof(*uv_pci_objs), GFP_KERNEL); + uv_pci_objs = kzalloc_objs(*uv_pci_objs, num_pci_lines, + GFP_KERNEL); if (!uv_pci_objs) { kfree(pci_top_str); ret = -ENOMEM; @@ -683,7 +684,8 @@ static int pci_topology_init(void) } start = pci_top_str; while ((found = strsep(&start, "\n")) != NULL) { - uv_pci_objs[k] = kzalloc(sizeof(*uv_pci_objs[k]), GFP_KERNEL); + uv_pci_objs[k] = kzalloc_obj(*uv_pci_objs[k], + GFP_KERNEL); if (!uv_pci_objs[k]) { ret = -ENOMEM; goto err_pci_obj; diff --git a/drivers/platform/x86/wireless-hotkey.c b/drivers/platform/x86/wireless-hotkey.c index a220fe4f9ef8..bba55c634e2c 100644 --- a/drivers/platform/x86/wireless-hotkey.c +++ b/drivers/platform/x86/wireless-hotkey.c @@ -91,7 +91,7 @@ static int wl_add(struct acpi_device *device) struct wl_button *button; int err; - button = kzalloc(sizeof(struct wl_button), GFP_KERNEL); + button = kzalloc_obj(struct wl_button, GFP_KERNEL); if (!button) return -ENOMEM; diff --git a/drivers/platform/x86/x86-android-tablets/core.c b/drivers/platform/x86/x86-android-tablets/core.c index 6588fae30356..15a50ced6867 100644 --- a/drivers/platform/x86/x86-android-tablets/core.c +++ b/drivers/platform/x86/x86-android-tablets/core.c @@ -49,7 +49,7 @@ int x86_android_tablet_get_gpiod(const char *chip, int pin, const char *con_id, struct gpiod_lookup_table *lookup; struct gpio_desc *gpiod; - lookup = kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); + lookup = kzalloc_flex(*lookup, table, 2, GFP_KERNEL); if (!lookup) return -ENOMEM; @@ -447,7 +447,8 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) exit_handler = dev_info->exit; } - i2c_clients = kcalloc(dev_info->i2c_client_count, sizeof(*i2c_clients), GFP_KERNEL); + i2c_clients = kzalloc_objs(*i2c_clients, dev_info->i2c_client_count, + GFP_KERNEL); if (!i2c_clients) { x86_android_tablet_remove(pdev); return -ENOMEM; @@ -462,7 +463,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } } - spi_devs = kcalloc(dev_info->spi_dev_count, sizeof(*spi_devs), GFP_KERNEL); + spi_devs = kzalloc_objs(*spi_devs, dev_info->spi_dev_count, GFP_KERNEL); if (!spi_devs) { x86_android_tablet_remove(pdev); return -ENOMEM; @@ -478,7 +479,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } /* + 1 to make space for the (optional) gpio_keys_button platform device */ - pdevs = kcalloc(dev_info->pdev_count + 1, sizeof(*pdevs), GFP_KERNEL); + pdevs = kzalloc_objs(*pdevs, dev_info->pdev_count + 1, GFP_KERNEL); if (!pdevs) { x86_android_tablet_remove(pdev); return -ENOMEM; @@ -494,7 +495,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } } - serdevs = kcalloc(dev_info->serdev_count, sizeof(*serdevs), GFP_KERNEL); + serdevs = kzalloc_objs(*serdevs, dev_info->serdev_count, GFP_KERNEL); if (!serdevs) { x86_android_tablet_remove(pdev); return -ENOMEM; diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c index cb02222c978c..6bc5cd2abfab 100644 --- a/drivers/platform/x86/xo15-ebook.c +++ b/drivers/platform/x86/xo15-ebook.c @@ -86,7 +86,7 @@ static int ebook_switch_add(struct acpi_device *device) struct input_dev *input; int error; - button = kzalloc(sizeof(struct ebook_switch), GFP_KERNEL); + button = kzalloc_obj(struct ebook_switch, GFP_KERNEL); if (!button) return -ENOMEM; diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index bf82775f6a67..a324740b248b 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -1811,7 +1811,7 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, if (ret) return ERR_PTR(ret); - gpd_data = kzalloc(sizeof(*gpd_data), GFP_KERNEL); + gpd_data = kzalloc_obj(*gpd_data, GFP_KERNEL); if (!gpd_data) { ret = -ENOMEM; goto err_put; @@ -1822,7 +1822,7 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, /* Allocate data used by a governor. */ if (has_governor) { - td = kzalloc(sizeof(*td), GFP_KERNEL); + td = kzalloc_obj(*td, GFP_KERNEL); if (!td) { ret = -ENOMEM; goto err_free; @@ -2161,7 +2161,7 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd, return -EINVAL; } - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; @@ -2269,7 +2269,7 @@ static int genpd_set_default_power_state(struct generic_pm_domain *genpd) { struct genpd_power_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; @@ -2295,7 +2295,7 @@ static int genpd_alloc_data(struct generic_pm_domain *genpd) return -ENOMEM; if (genpd->gov) { - gd = kzalloc(sizeof(*gd), GFP_KERNEL); + gd = kzalloc_obj(*gd, GFP_KERNEL); if (!gd) { ret = -ENOMEM; goto free; @@ -2623,7 +2623,7 @@ static int genpd_add_provider(struct device_node *np, genpd_xlate_t xlate, { struct of_genpd_provider *cp; - cp = kzalloc(sizeof(*cp), GFP_KERNEL); + cp = kzalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; @@ -3316,7 +3316,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, return ERR_PTR(-ENODEV); /* Allocate and register device on the genpd bus. */ - virt_dev = kzalloc(sizeof(*virt_dev), GFP_KERNEL); + virt_dev = kzalloc_obj(*virt_dev, GFP_KERNEL); if (!virt_dev) return ERR_PTR(-ENOMEM); @@ -3474,7 +3474,7 @@ int of_genpd_parse_idle_states(struct device_node *dn, return 0; } - st = kcalloc(ret, sizeof(*st), GFP_KERNEL); + st = kzalloc_objs(*st, ret, GFP_KERNEL); if (!st) return -ENOMEM; diff --git a/drivers/pmdomain/renesas/rcar-gen4-sysc.c b/drivers/pmdomain/renesas/rcar-gen4-sysc.c index 7434bf42d215..a62937a9a045 100644 --- a/drivers/pmdomain/renesas/rcar-gen4-sysc.c +++ b/drivers/pmdomain/renesas/rcar-gen4-sysc.c @@ -324,7 +324,7 @@ static int __init rcar_gen4_sysc_pd_init(void) rcar_gen4_sysc_base = base; - domains = kzalloc(sizeof(*domains), GFP_KERNEL); + domains = kzalloc_obj(*domains, GFP_KERNEL); if (!domains) { error = -ENOMEM; goto out_put; diff --git a/drivers/pmdomain/renesas/rcar-sysc.c b/drivers/pmdomain/renesas/rcar-sysc.c index d8a8ffcde38d..aa5485876e0a 100644 --- a/drivers/pmdomain/renesas/rcar-sysc.c +++ b/drivers/pmdomain/renesas/rcar-sysc.c @@ -383,7 +383,7 @@ static int __init rcar_sysc_pd_init(void) rcar_sysc_extmask_offs = info->extmask_offs; rcar_sysc_extmask_val = info->extmask_val; - domains = kzalloc(sizeof(*domains), GFP_KERNEL); + domains = kzalloc_obj(*domains, GFP_KERNEL); if (!domains) { error = -ENOMEM; goto out_put; diff --git a/drivers/pmdomain/renesas/rmobile-sysc.c b/drivers/pmdomain/renesas/rmobile-sysc.c index a6bf7295e909..541f5739c13a 100644 --- a/drivers/pmdomain/renesas/rmobile-sysc.c +++ b/drivers/pmdomain/renesas/rmobile-sysc.c @@ -277,7 +277,7 @@ static int __init rmobile_add_pm_domains(void __iomem *base, /* always-on domain */ } - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return -ENOMEM; diff --git a/drivers/pmdomain/st/ste-ux500-pm-domain.c b/drivers/pmdomain/st/ste-ux500-pm-domain.c index 3d4f111ed156..45ea76b9c7f8 100644 --- a/drivers/pmdomain/st/ste-ux500-pm-domain.c +++ b/drivers/pmdomain/st/ste-ux500-pm-domain.c @@ -65,7 +65,7 @@ static int ux500_pm_domains_probe(struct platform_device *pdev) if (!np) return -ENODEV; - genpd_data = kzalloc(sizeof(*genpd_data), GFP_KERNEL); + genpd_data = kzalloc_obj(*genpd_data, GFP_KERNEL); if (!genpd_data) return -ENOMEM; diff --git a/drivers/pmdomain/tegra/powergate-bpmp.c b/drivers/pmdomain/tegra/powergate-bpmp.c index 9f4366250bfd..43a46edd1ebc 100644 --- a/drivers/pmdomain/tegra/powergate-bpmp.c +++ b/drivers/pmdomain/tegra/powergate-bpmp.c @@ -226,7 +226,7 @@ tegra_bpmp_probe_powergates(struct tegra_bpmp *bpmp, dev_dbg(bpmp->dev, "maximum powergate ID: %u\n", max_id); - powergates = kcalloc(max_id + 1, sizeof(*powergates), GFP_KERNEL); + powergates = kzalloc_objs(*powergates, max_id + 1, GFP_KERNEL); if (!powergates) return -ENOMEM; @@ -260,7 +260,7 @@ static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp, unsigned int i; int err; - domains = kcalloc(count, sizeof(*domains), GFP_KERNEL); + domains = kzalloc_objs(*domains, count, GFP_KERNEL); if (!domains) return -ENOMEM; diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index c7596dc24fbd..226a81cdb664 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -80,7 +80,7 @@ static int card_probe(struct pnp_card *card, struct pnp_card_driver *drv) if (!id) return 0; - clink = kzalloc(sizeof(*clink), GFP_KERNEL); + clink = kzalloc_obj(*clink, GFP_KERNEL); if (!clink) return 0; clink->card = card; @@ -108,7 +108,7 @@ static struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id) { struct pnp_id *dev_id, *ptr; - dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kzalloc_obj(struct pnp_id, GFP_KERNEL); if (!dev_id) return NULL; @@ -159,7 +159,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp struct pnp_card *card; struct pnp_id *dev_id; - card = kzalloc(sizeof(struct pnp_card), GFP_KERNEL); + card = kzalloc_obj(struct pnp_card, GFP_KERNEL); if (!card) return NULL; diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index ac48db6dcfe3..768388ddaeca 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -122,7 +122,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, struct pnp_dev *dev; struct pnp_id *dev_id; - dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL); + dev = kzalloc_obj(struct pnp_dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 05e9840bc3d4..731a37002811 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -315,7 +315,7 @@ struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id) { struct pnp_id *dev_id, *ptr; - dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kzalloc_obj(struct pnp_id, GFP_KERNEL); if (!dev_id) return NULL; diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 44efcdb87e6f..108f7c63ddc5 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -214,7 +214,7 @@ static ssize_t options_show(struct device *dmdev, struct device_attribute *attr, int ret, dep = 0, set = 0; char *indent; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -257,7 +257,7 @@ static ssize_t resources_show(struct device *dmdev, if (!dev) return -EINVAL; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 6e1d4bfd28ac..2afa17c39628 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -29,7 +29,7 @@ static void quirk_awe32_add_ports(struct pnp_dev *dev, { struct pnp_option *new_option; - new_option = kmalloc(sizeof(struct pnp_option), GFP_KERNEL); + new_option = kmalloc_obj(struct pnp_option, GFP_KERNEL); if (!new_option) { dev_err(&dev->dev, "couldn't add ioport region to option set " "%d\n", pnp_option_set(option)); @@ -155,8 +155,7 @@ static struct pnp_option *pnp_clone_dependent_set(struct pnp_dev *dev, list_for_each_entry(option, &dev->options, list) { if (pnp_option_is_dependent(option) && pnp_option_set(option) == set) { - new_option = kmalloc(sizeof(struct pnp_option), - GFP_KERNEL); + new_option = kmalloc_obj(struct pnp_option, GFP_KERNEL); if (!new_option) { dev_err(&dev->dev, "couldn't clone dependent " "set %d\n", set); diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 8f7695624c8c..f62544ec5a1f 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -38,7 +38,7 @@ static struct pnp_option *pnp_build_option(struct pnp_dev *dev, unsigned long ty { struct pnp_option *option; - option = kzalloc(sizeof(struct pnp_option), GFP_KERNEL); + option = kzalloc_obj(struct pnp_option, GFP_KERNEL); if (!option) return NULL; @@ -499,7 +499,7 @@ static struct pnp_resource *pnp_new_resource(struct pnp_dev *dev) { struct pnp_resource *pnp_res; - pnp_res = kzalloc(sizeof(struct pnp_resource), GFP_KERNEL); + pnp_res = kzalloc_obj(struct pnp_resource, GFP_KERNEL); if (!pnp_res) return NULL; diff --git a/drivers/power/sequencing/core.c b/drivers/power/sequencing/core.c index 1fcf0af7cc0b..666bcfd3c655 100644 --- a/drivers/power/sequencing/core.c +++ b/drivers/power/sequencing/core.c @@ -90,7 +90,7 @@ static struct pwrseq_unit *pwrseq_unit_new(const struct pwrseq_unit_data *data) { struct pwrseq_unit *unit; - unit = kzalloc(sizeof(*unit), GFP_KERNEL); + unit = kzalloc_obj(*unit, GFP_KERNEL); if (!unit) return NULL; @@ -138,7 +138,7 @@ static struct pwrseq_unit_dep *pwrseq_unit_dep_new(struct pwrseq_unit *unit) { struct pwrseq_unit_dep *dep; - dep = kzalloc(sizeof(*dep), GFP_KERNEL); + dep = kzalloc_obj(*dep, GFP_KERNEL); if (!dep) return NULL; @@ -195,7 +195,7 @@ pwrseq_target_new(const struct pwrseq_target_data *data) { struct pwrseq_target *target; - target = kzalloc(sizeof(*target), GFP_KERNEL); + target = kzalloc_obj(*target, GFP_KERNEL); if (!target) return NULL; @@ -669,8 +669,7 @@ struct pwrseq_desc *pwrseq_get(struct device *dev, const char *target) struct pwrseq_match_data match_data; int ret; - struct pwrseq_desc *desc __free(kfree) = kzalloc(sizeof(*desc), - GFP_KERNEL); + struct pwrseq_desc *desc __free(kfree) = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/power/sequencing/pwrseq-thead-gpu.c b/drivers/power/sequencing/pwrseq-thead-gpu.c index 7c82a10ca9f6..ce32201f5a21 100644 --- a/drivers/power/sequencing/pwrseq-thead-gpu.c +++ b/drivers/power/sequencing/pwrseq-thead-gpu.c @@ -145,7 +145,7 @@ static int pwrseq_thead_gpu_match(struct pwrseq_device *pwrseq, PWRSEQ_MATCH_OK : PWRSEQ_NO_MATCH; ctx->num_clks = ARRAY_SIZE(clk_names); - ctx->clks = kcalloc(ctx->num_clks, sizeof(*ctx->clks), GFP_KERNEL); + ctx->clks = kzalloc_objs(*ctx->clks, ctx->num_clks, GFP_KERNEL); if (!ctx->clks) return -ENOMEM; diff --git a/drivers/power/supply/cros_peripheral_charger.c b/drivers/power/supply/cros_peripheral_charger.c index 962a6fd29832..7d48ab4a60b2 100644 --- a/drivers/power/supply/cros_peripheral_charger.c +++ b/drivers/power/supply/cros_peripheral_charger.c @@ -64,7 +64,7 @@ static int cros_pchg_ec_command(const struct charger_data *charger, struct cros_ec_command *msg; int ret; - msg = kzalloc(struct_size(msg, data, max(outsize, insize)), GFP_KERNEL); + msg = kzalloc_flex(*msg, data, max(outsize, insize), GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c index 47d3f58aa15c..6b525ed74197 100644 --- a/drivers/power/supply/cros_usbpd-charger.c +++ b/drivers/power/supply/cros_usbpd-charger.c @@ -94,7 +94,7 @@ static int cros_usbpd_charger_ec_command(struct charger_data *charger, struct cros_ec_command *msg; int ret; - msg = kzalloc(struct_size(msg, data, max(outsize, insize)), GFP_KERNEL); + msg = kzalloc_flex(*msg, data, max(outsize, insize), GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/drivers/power/supply/pmu_battery.c b/drivers/power/supply/pmu_battery.c index ed83c5e05ca3..054f75d904a8 100644 --- a/drivers/power/supply/pmu_battery.c +++ b/drivers/power/supply/pmu_battery.c @@ -160,8 +160,7 @@ static int __init pmu_bat_init(void) for (i = 0; i < pmu_battery_count; i++) { struct power_supply_config psy_cfg = {}; - struct pmu_battery_dev *pbat = kzalloc(sizeof(*pbat), - GFP_KERNEL); + struct pmu_battery_dev *pbat = kzalloc_obj(*pbat, GFP_KERNEL); if (!pbat) break; diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 9a28381e2607..91e8b18e09ff 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1426,7 +1426,7 @@ int power_supply_register_extension(struct power_supply *psy, const struct power if (power_supply_has_property(psy, ext->properties[i])) return -EEXIST; - reg = kmalloc(sizeof(*reg), GFP_KERNEL); + reg = kmalloc_obj(*reg, GFP_KERNEL); if (!reg) return -ENOMEM; diff --git a/drivers/power/supply/power_supply_leds.c b/drivers/power/supply/power_supply_leds.c index f4a7e566bea1..af32dc2e0210 100644 --- a/drivers/power/supply/power_supply_leds.c +++ b/drivers/power/supply/power_supply_leds.c @@ -48,7 +48,7 @@ static int power_supply_register_led_trigger(struct power_supply *psy, if (err && *err) return *err; - psy_trig = kzalloc(sizeof(*psy_trig), GFP_KERNEL); + psy_trig = kzalloc_obj(*psy_trig, GFP_KERNEL); if (!psy_trig) goto err_free_trigger; diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c index a081f177e702..798c43e482ae 100644 --- a/drivers/powercap/arm_scmi_powercap.c +++ b/drivers/powercap/arm_scmi_powercap.c @@ -370,7 +370,7 @@ static int scmi_zones_register(struct device *dev, unsigned int sp = 0, reg_zones = 0; struct scmi_powercap_zone *spz, **zones_stack; - zones_stack = kcalloc(pr->num_zones, sizeof(spz), GFP_KERNEL); + zones_stack = kzalloc_objs(spz, pr->num_zones, GFP_KERNEL); if (!zones_stack) return -ENOMEM; diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index 129d55bc705c..afdeecef69ef 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -418,7 +418,7 @@ static struct dtpm *dtpm_setup_virtual(const struct dtpm_node *hierarchy, struct dtpm *dtpm; int ret; - dtpm = kzalloc(sizeof(*dtpm), GFP_KERNEL); + dtpm = kzalloc_obj(*dtpm, GFP_KERNEL); if (!dtpm) return ERR_PTR(-ENOMEM); dtpm_init(dtpm, NULL); diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index 99390ec1481f..25489b3b03be 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -212,7 +212,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) goto release_policy; } - dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); + dtpm_cpu = kzalloc_obj(*dtpm_cpu, GFP_KERNEL); if (!dtpm_cpu) { ret = -ENOMEM; goto release_policy; diff --git a/drivers/powercap/dtpm_devfreq.c b/drivers/powercap/dtpm_devfreq.c index d1dff6ccab12..e941bb241986 100644 --- a/drivers/powercap/dtpm_devfreq.c +++ b/drivers/powercap/dtpm_devfreq.c @@ -160,7 +160,7 @@ static int __dtpm_devfreq_setup(struct devfreq *devfreq, struct dtpm *parent) } } - dtpm_devfreq = kzalloc(sizeof(*dtpm_devfreq), GFP_KERNEL); + dtpm_devfreq = kzalloc_obj(*dtpm_devfreq, GFP_KERNEL); if (!dtpm_devfreq) return -ENOMEM; diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 539625531709..e7f538ebab2f 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1520,8 +1520,8 @@ static int rapl_detect_domains(struct rapl_package *rp) } pr_debug("found %d domains on %s\n", rp->nr_domains, rp->name); - rp->domains = kcalloc(rp->nr_domains, sizeof(struct rapl_domain), - GFP_KERNEL); + rp->domains = kzalloc_objs(struct rapl_domain, rp->nr_domains, + GFP_KERNEL); if (!rp->domains) return -ENOMEM; @@ -2216,7 +2216,7 @@ struct rapl_package *rapl_add_package_cpuslocked(int id, struct rapl_if_priv *pr struct rapl_package *rp; int ret; - rp = kzalloc(sizeof(struct rapl_package), GFP_KERNEL); + rp = kzalloc_obj(struct rapl_package, GFP_KERNEL); if (!rp) return ERR_PTR(-ENOMEM); diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c index 0f8abdc592bc..f68784c7e718 100644 --- a/drivers/powercap/intel_rapl_tpmi.c +++ b/drivers/powercap/intel_rapl_tpmi.c @@ -102,7 +102,7 @@ static struct tpmi_rapl_package *trp_alloc(int pkg_id) } } - trp = kzalloc(sizeof(*trp), GFP_KERNEL); + trp = kzalloc_obj(*trp, GFP_KERNEL); if (!trp) { ret = -ENOMEM; goto err_del_powercap; diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index f3b2ae635305..b32ac11a6c49 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c @@ -501,7 +501,7 @@ struct powercap_zone *powercap_register_zone( return ERR_PTR(-EINVAL); memset(power_zone, 0, sizeof(*power_zone)); } else { - power_zone = kzalloc(sizeof(*power_zone), GFP_KERNEL); + power_zone = kzalloc_obj(*power_zone, GFP_KERNEL); if (!power_zone) return ERR_PTR(-ENOMEM); power_zone->allocated = true; @@ -529,9 +529,8 @@ struct powercap_zone *powercap_register_zone( power_zone->name = kstrdup(name, GFP_KERNEL); if (!power_zone->name) goto err_name_alloc; - power_zone->constraints = kcalloc(nr_constraints, - sizeof(*power_zone->constraints), - GFP_KERNEL); + power_zone->constraints = kzalloc_objs(*power_zone->constraints, + nr_constraints, GFP_KERNEL); if (!power_zone->constraints) goto err_const_alloc; @@ -614,7 +613,7 @@ struct powercap_control_type *powercap_register_control_type( return ERR_PTR(-EINVAL); memset(control_type, 0, sizeof(*control_type)); } else { - control_type = kzalloc(sizeof(*control_type), GFP_KERNEL); + control_type = kzalloc_obj(*control_type, GFP_KERNEL); if (!control_type) return ERR_PTR(-ENOMEM); control_type->allocated = true; diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 24db06750297..975d984b0fd5 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c @@ -142,7 +142,7 @@ static void parport_attach(struct parport *port) return; } - device = kzalloc(sizeof(struct pps_client_pp), GFP_KERNEL); + device = kzalloc_obj(struct pps_client_pp, GFP_KERNEL); if (!device) { pr_err("memory allocation failed, not attaching\n"); return; diff --git a/drivers/pps/generators/pps_gen.c b/drivers/pps/generators/pps_gen.c index 5b8bb454913c..a91f6871f98a 100644 --- a/drivers/pps/generators/pps_gen.c +++ b/drivers/pps/generators/pps_gen.c @@ -230,7 +230,7 @@ struct pps_gen_device *pps_gen_register_source(const struct pps_gen_source_info struct pps_gen_device *pps_gen; int err; - pps_gen = kzalloc(sizeof(struct pps_gen_device), GFP_KERNEL); + pps_gen = kzalloc_obj(struct pps_gen_device, GFP_KERNEL); if (pps_gen == NULL) { err = -ENOMEM; goto pps_gen_register_source_exit; diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index 6985c34de2ce..de2ce4faf262 100644 --- a/drivers/pps/kapi.c +++ b/drivers/pps/kapi.c @@ -83,7 +83,7 @@ struct pps_device *pps_register_source(struct pps_source_info *info, } /* Allocate memory for the new PPS source struct */ - pps = kzalloc(sizeof(struct pps_device), GFP_KERNEL); + pps = kzalloc_obj(struct pps_device, GFP_KERNEL); if (pps == NULL) { err = -ENOMEM; goto pps_register_source_exit; diff --git a/drivers/ps3/ps3-lpm.c b/drivers/ps3/ps3-lpm.c index 188ae2572674..8f1ee4c748bf 100644 --- a/drivers/ps3/ps3-lpm.c +++ b/drivers/ps3/ps3-lpm.c @@ -1181,7 +1181,7 @@ static int ps3_lpm_probe(struct ps3_system_bus_device *dev) return -EBUSY; } - lpm_priv = kzalloc(sizeof(*lpm_priv), GFP_KERNEL); + lpm_priv = kzalloc_obj(*lpm_priv, GFP_KERNEL); if (!lpm_priv) return -ENOMEM; diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c index 5cb92535a4a1..3493a9ef05ce 100644 --- a/drivers/ps3/ps3-vuart.c +++ b/drivers/ps3/ps3-vuart.c @@ -914,7 +914,7 @@ static int ps3_vuart_bus_interrupt_get(void) BUG_ON(vuart_bus_priv.bmp); - vuart_bus_priv.bmp = kzalloc(sizeof(struct ports_bmp), GFP_KERNEL); + vuart_bus_priv.bmp = kzalloc_obj(struct ports_bmp, GFP_KERNEL); if (!vuart_bus_priv.bmp) { result = -ENOMEM; @@ -1015,8 +1015,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev) /* Setup dev->driver_priv. */ - dev->driver_priv = kzalloc(sizeof(struct ps3_vuart_port_priv), - GFP_KERNEL); + dev->driver_priv = kzalloc_obj(struct ps3_vuart_port_priv, GFP_KERNEL); if (!dev->driver_priv) { result = -ENOMEM; diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index f6c9e56bdba7..19f2c5b4f8f3 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c @@ -934,7 +934,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev) return -EBUSY; } - ps3av = kzalloc(sizeof(*ps3av), GFP_KERNEL); + ps3av = kzalloc_obj(*ps3av, GFP_KERNEL); if (!ps3av) return -ENOMEM; diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index b0e167c0b3eb..dc6d9afdd5c6 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -328,7 +328,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, return ERR_PTR(-EINVAL); /* Initialize a clock structure. */ - ptp = kzalloc(sizeof(struct ptp_clock), GFP_KERNEL); + ptp = kzalloc_obj(struct ptp_clock, GFP_KERNEL); if (!ptp) { err = -ENOMEM; goto no_memory; @@ -344,7 +344,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, ptp->devid = MKDEV(major, index); ptp->index = index; INIT_LIST_HEAD(&ptp->tsevqs); - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) { err = -ENOMEM; goto no_memory_queue; diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c index 790eb42b78db..67eda6fb22d1 100644 --- a/drivers/ptp/ptp_ines.c +++ b/drivers/ptp/ptp_ines.c @@ -760,7 +760,7 @@ static int ines_ptp_ctrl_probe(struct platform_device *pld) err = PTR_ERR(addr); goto out; } - clock = kzalloc(sizeof(*clock), GFP_KERNEL); + clock = kzalloc_obj(*clock, GFP_KERNEL); if (!clock) { err = -ENOMEM; goto out; diff --git a/drivers/ptp/ptp_mock.c b/drivers/ptp/ptp_mock.c index bbd14ce24b34..267168e9d0ca 100644 --- a/drivers/ptp/ptp_mock.c +++ b/drivers/ptp/ptp_mock.c @@ -120,7 +120,7 @@ struct mock_phc *mock_phc_create(struct device *dev) struct mock_phc *phc; int err; - phc = kzalloc(sizeof(*phc), GFP_KERNEL); + phc = kzalloc_obj(*phc, GFP_KERNEL); if (!phc) { err = -ENOMEM; goto out; diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index 1b16a9c3d7fd..1ed492c12e1d 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -2241,7 +2241,7 @@ ptp_ocp_register_ext(struct ptp_ocp *bp, struct ocp_resource *r) struct ptp_ocp_ext_src *ext; int err; - ext = kzalloc(sizeof(*ext), GFP_KERNEL); + ext = kzalloc_obj(*ext, GFP_KERNEL); if (!ext) return -ENOMEM; @@ -2378,8 +2378,7 @@ ptp_ocp_attr_group_add(struct ptp_ocp *bp, if (attr_tbl[i].cap & bp->fw_cap) count++; - bp->attr_group = kcalloc(count + 1, sizeof(*bp->attr_group), - GFP_KERNEL); + bp->attr_group = kzalloc_objs(*bp->attr_group, count + 1, GFP_KERNEL); if (!bp->attr_group) return -ENOMEM; @@ -2646,7 +2645,7 @@ ptp_ocp_set_pins(struct ptp_ocp *bp) struct ptp_pin_desc *config; int i; - config = kcalloc(4, sizeof(*config), GFP_KERNEL); + config = kzalloc_objs(*config, 4, GFP_KERNEL); if (!config) return -ENOMEM; diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c index 8da995e36aeb..71f4de4e8fc3 100644 --- a/drivers/ptp/ptp_qoriq.c +++ b/drivers/ptp/ptp_qoriq.c @@ -613,7 +613,7 @@ static int ptp_qoriq_probe(struct platform_device *dev) int err = -ENOMEM; void __iomem *base; - ptp_qoriq = kzalloc(sizeof(*ptp_qoriq), GFP_KERNEL); + ptp_qoriq = kzalloc_obj(*ptp_qoriq, GFP_KERNEL); if (!ptp_qoriq) goto no_memory; diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c index 200eaf500696..f398eac4a263 100644 --- a/drivers/ptp/ptp_sysfs.c +++ b/drivers/ptp/ptp_sysfs.c @@ -443,12 +443,11 @@ int ptp_populate_pin_groups(struct ptp_clock *ptp) if (!n_pins) return 0; - ptp->pin_dev_attr = kcalloc(n_pins, sizeof(*ptp->pin_dev_attr), - GFP_KERNEL); + ptp->pin_dev_attr = kzalloc_objs(*ptp->pin_dev_attr, n_pins, GFP_KERNEL); if (!ptp->pin_dev_attr) goto no_dev_attr; - ptp->pin_attr = kcalloc(1 + n_pins, sizeof(*ptp->pin_attr), GFP_KERNEL); + ptp->pin_attr = kzalloc_objs(*ptp->pin_attr, 1 + n_pins, GFP_KERNEL); if (!ptp->pin_attr) goto no_pin_attr; diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c index 64c950456517..b27b25715e1e 100644 --- a/drivers/ptp/ptp_vclock.c +++ b/drivers/ptp/ptp_vclock.c @@ -191,7 +191,7 @@ struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock) { struct ptp_vclock *vclock; - vclock = kzalloc(sizeof(*vclock), GFP_KERNEL); + vclock = kzalloc_obj(*vclock, GFP_KERNEL); if (!vclock) return NULL; diff --git a/drivers/ptp/ptp_vmclock.c b/drivers/ptp/ptp_vmclock.c index c7c75e19f4dd..431510435376 100644 --- a/drivers/ptp/ptp_vmclock.c +++ b/drivers/ptp/ptp_vmclock.c @@ -460,7 +460,7 @@ static int vmclock_miscdev_open(struct inode *inode, struct file *fp) { struct vmclock_state *st = container_of(fp->private_data, struct vmclock_state, miscdev); - struct vmclock_file_state *fst = kzalloc(sizeof(*fst), GFP_KERNEL); + struct vmclock_file_state *fst = kzalloc_obj(*fst, GFP_KERNEL); if (!fst) return -ENOMEM; diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 8da78b4b21b9..7f54abd61c02 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1333,7 +1333,7 @@ static int pwm_export_child(struct device *pwmchip_dev, struct pwm_device *pwm) if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags)) return -EBUSY; - export = kzalloc(sizeof(*export), GFP_KERNEL); + export = kzalloc_obj(*export, GFP_KERNEL); if (!export) { clear_bit(PWMF_EXPORTED, &pwm->flags); return -ENOMEM; @@ -2138,7 +2138,7 @@ static int pwm_cdev_open(struct inode *inode, struct file *file) if (!chip->operational) return -ENXIO; - cdata = kzalloc(struct_size(cdata, pwm, chip->npwm), GFP_KERNEL); + cdata = kzalloc_flex(*cdata, pwm, chip->npwm, GFP_KERNEL); if (!cdata) return -ENOMEM; diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c index 995cfeca972b..10277dff206e 100644 --- a/drivers/rapidio/devices/rio_mport_cdev.c +++ b/drivers/rapidio/devices/rio_mport_cdev.c @@ -348,7 +348,7 @@ rio_mport_create_outbound_mapping(struct mport_dev *md, struct file *filp, rmcd_debug(OBW, "did=%d ra=0x%llx sz=0x%x", rioid, raddr, size); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) return -ENOMEM; @@ -800,7 +800,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, if (xfer->length == 0) return -EINVAL; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -835,8 +835,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, offset = lower_32_bits(offset_in_page(xfer->loc_addr)); nr_pages = PAGE_ALIGN(xfer->length + offset) >> PAGE_SHIFT; - page_list = kmalloc_array(nr_pages, - sizeof(*page_list), GFP_KERNEL); + page_list = kmalloc_objs(*page_list, nr_pages, GFP_KERNEL); if (page_list == NULL) { ret = -ENOMEM; goto err_req; @@ -1070,7 +1069,7 @@ static int rio_mport_create_dma_mapping(struct mport_dev *md, struct file *filp, { struct rio_mport_mapping *map; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) return -ENOMEM; @@ -1190,7 +1189,7 @@ rio_mport_create_inbound_mapping(struct mport_dev *md, struct file *filp, if (size > 0xffffffff) return -EINVAL; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) return -ENOMEM; @@ -1432,7 +1431,7 @@ static int rio_mport_add_db_filter(struct mport_cdev_priv *priv, return ret; } - db_filter = kzalloc(sizeof(*db_filter), GFP_KERNEL); + db_filter = kzalloc_obj(*db_filter, GFP_KERNEL); if (db_filter == NULL) { rio_release_inb_dbell(md->mport, filter.low, filter.high); return -ENOMEM; @@ -1540,7 +1539,7 @@ static int rio_mport_add_pw_filter(struct mport_cdev_priv *priv, if (copy_from_user(&filter, arg, sizeof(filter))) return -EFAULT; - pw_filter = kzalloc(sizeof(*pw_filter), GFP_KERNEL); + pw_filter = kzalloc_obj(*pw_filter, GFP_KERNEL); if (pw_filter == NULL) return -ENOMEM; @@ -1879,7 +1878,7 @@ static int mport_cdev_open(struct inode *inode, struct file *filp) get_device(&chdev->dev); - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { put_device(&chdev->dev); return -ENOMEM; @@ -2349,7 +2348,7 @@ static struct mport_dev *mport_cdev_add(struct rio_mport *mport) struct mport_dev *md; struct rio_mport_attr attr; - md = kzalloc(sizeof(*md), GFP_KERNEL); + md = kzalloc_obj(*md, GFP_KERNEL); if (!md) { rmcd_error("Unable allocate a device object"); return NULL; diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c index 4b84270a8906..9d3f2577bccb 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -1145,7 +1145,7 @@ static int tsi721_rio_map_inb_mem(struct rio_mport *mport, dma_addr_t lstart, loc_start = ibw_start; - map = kzalloc(sizeof(struct tsi721_ib_win_mapping), GFP_ATOMIC); + map = kzalloc_obj(struct tsi721_ib_win_mapping, GFP_ATOMIC); if (map == NULL) return -ENOMEM; @@ -2774,7 +2774,7 @@ static int tsi721_probe(struct pci_dev *pdev, struct tsi721_device *priv; int err; - priv = kzalloc(sizeof(struct tsi721_device), GFP_KERNEL); + priv = kzalloc_obj(struct tsi721_device, GFP_KERNEL); if (!priv) { err = -ENOMEM; goto err_exit; diff --git a/drivers/rapidio/devices/tsi721_dma.c b/drivers/rapidio/devices/tsi721_dma.c index f77f75172bdc..52749f1d2a11 100644 --- a/drivers/rapidio/devices/tsi721_dma.c +++ b/drivers/rapidio/devices/tsi721_dma.c @@ -739,8 +739,7 @@ static int tsi721_alloc_chan_resources(struct dma_chan *dchan) } /* Allocate queue of transaction descriptors */ - desc = kcalloc(dma_txqueue_sz, sizeof(struct tsi721_tx_desc), - GFP_ATOMIC); + desc = kzalloc_objs(struct tsi721_tx_desc, dma_txqueue_sz, GFP_ATOMIC); if (!desc) { tsi721_bdma_ch_free(bdma_chan); return -ENOMEM; diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 46daf32ea13b..c811cc3ebc5d 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -107,7 +107,7 @@ EXPORT_SYMBOL(rio_query_mport); */ struct rio_net *rio_alloc_net(struct rio_mport *mport) { - struct rio_net *net = kzalloc(sizeof(*net), GFP_KERNEL); + struct rio_net *net = kzalloc_obj(*net, GFP_KERNEL); if (net) { INIT_LIST_HEAD(&net->node); @@ -242,7 +242,7 @@ int rio_request_inb_mbox(struct rio_mport *mport, if (!mport->ops->open_inb_mbox) goto out; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (res) { rio_init_mbox_res(res, mbox, mbox); @@ -326,7 +326,7 @@ int rio_request_outb_mbox(struct rio_mport *mport, if (!mport->ops->open_outb_mbox) goto out; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (res) { rio_init_mbox_res(res, mbox, mbox); @@ -403,7 +403,7 @@ rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res, void (*dinb) (struct rio_mport * mport, void *dev_id, u16 src, u16 dst, u16 info)) { - struct rio_dbell *dbell = kmalloc(sizeof(*dbell), GFP_KERNEL); + struct rio_dbell *dbell = kmalloc_obj(*dbell, GFP_KERNEL); if (!dbell) return -ENOMEM; @@ -438,7 +438,7 @@ int rio_request_inb_dbell(struct rio_mport *mport, u16 dst, u16 info)) { int rc; - struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); + struct resource *res = kzalloc_obj(*res, GFP_KERNEL); if (res) { rio_init_dbell_res(res, start, end); @@ -515,7 +515,7 @@ EXPORT_SYMBOL_GPL(rio_release_inb_dbell); struct resource *rio_request_outb_dbell(struct rio_dev *rdev, u16 start, u16 end) { - struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL); + struct resource *res = kzalloc_obj(struct resource, GFP_KERNEL); if (res) { rio_init_dbell_res(res, start, end); @@ -563,7 +563,7 @@ int rio_add_mport_pw_handler(struct rio_mport *mport, void *context, int (*pwcback)(struct rio_mport *mport, void *context, union rio_pw_msg *msg, int step)) { - struct rio_pwrite *pwrite = kzalloc(sizeof(*pwrite), GFP_KERNEL); + struct rio_pwrite *pwrite = kzalloc_obj(*pwrite, GFP_KERNEL); if (!pwrite) return -ENOMEM; @@ -1865,7 +1865,7 @@ int rio_register_scan(int mport_id, struct rio_scan *scan_ops) /* * Allocate and initialize new scan registration node. */ - scan = kzalloc(sizeof(*scan), GFP_KERNEL); + scan = kzalloc_obj(*scan, GFP_KERNEL); if (!scan) { rc = -ENOMEM; goto err_out; @@ -2000,7 +2000,7 @@ int rio_init_mports(void) goto no_disc; } - work = kcalloc(n, sizeof *work, GFP_KERNEL); + work = kzalloc_objs(*work, n, GFP_KERNEL); if (!work) { destroy_workqueue(rio_wq); goto no_disc; diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c index 66464674223f..d01c749de5fd 100644 --- a/drivers/rapidio/rio_cm.c +++ b/drivers/rapidio/rio_cm.c @@ -389,7 +389,7 @@ static int riocm_req_handler(struct cm_dev *cm, void *req_data) return -EINVAL; } - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) { riocm_put_channel(ch); return -ENOMEM; @@ -702,7 +702,7 @@ static int riocm_queue_req(struct cm_dev *cm, struct rio_dev *rdev, unsigned long flags; struct tx_req *treq; - treq = kzalloc(sizeof(*treq), GFP_KERNEL); + treq = kzalloc_obj(*treq, GFP_KERNEL); if (treq == NULL) return -ENOMEM; @@ -965,7 +965,7 @@ static int riocm_ch_connect(u16 loc_ch, struct cm_dev *cm, * Send connect request to the remote RapidIO device */ - hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); + hdr = kzalloc_obj(*hdr, GFP_KERNEL); if (hdr == NULL) { ret = -ENOMEM; goto conn_done; @@ -1022,7 +1022,7 @@ static int riocm_send_ack(struct rio_channel *ch) struct rio_ch_chan_hdr *hdr; int ret; - hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); + hdr = kzalloc_obj(*hdr, GFP_KERNEL); if (hdr == NULL) return -ENOMEM; @@ -1283,7 +1283,7 @@ static struct rio_channel *riocm_ch_alloc(u16 ch_num) int start, end; struct rio_channel *ch; - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (!ch) return ERR_PTR(-ENOMEM); @@ -1396,7 +1396,7 @@ static int riocm_send_close(struct rio_channel *ch) * Send CH_CLOSE notification to the remote RapidIO device */ - hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); + hdr = kzalloc_obj(*hdr, GFP_KERNEL); if (hdr == NULL) return -ENOMEM; @@ -1952,7 +1952,7 @@ static int riocm_add_dev(struct device *dev, struct subsys_interface *sif) riocm_debug(RDEV, "(%s)", rio_name(rdev)); - peer = kmalloc(sizeof(*peer), GFP_KERNEL); + peer = kmalloc_obj(*peer, GFP_KERNEL); if (!peer) return -ENOMEM; @@ -2099,7 +2099,7 @@ static int riocm_add_mport(struct device *dev) riocm_debug(MPORT, "add mport %s", mport->name); - cm = kzalloc(sizeof(*cm), GFP_KERNEL); + cm = kzalloc_obj(*cm, GFP_KERNEL); if (!cm) return -ENOMEM; diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c index 8877c6ff64c4..c84e26cca724 100644 --- a/drivers/ras/amd/fmpm.c +++ b/drivers/ras/amd/fmpm.c @@ -819,7 +819,7 @@ static int allocate_records(void) { int i, ret = 0; - fru_records = kcalloc(max_nr_fru, sizeof(struct fru_rec *), GFP_KERNEL); + fru_records = kzalloc_objs(struct fru_rec *, max_nr_fru, GFP_KERNEL); if (!fru_records) { ret = -ENOMEM; goto out; diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 80bb95750a20..386304bc200c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1740,7 +1740,7 @@ static int regulator_event_forward_notifier(struct notifier_block *nb, return NOTIFY_DONE; } - rew = kmalloc(sizeof(*rew), GFP_ATOMIC); + rew = kmalloc_obj(*rew, GFP_ATOMIC); if (!rew) return NOTIFY_DONE; @@ -1855,7 +1855,7 @@ static int set_consumer_device_supply(struct regulator_dev *rdev, else has_dev = 0; - new_node = kzalloc(sizeof(struct regulator_map), GFP_KERNEL); + new_node = kzalloc_obj(struct regulator_map, GFP_KERNEL); if (new_node == NULL) return -ENOMEM; @@ -2021,7 +2021,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, return NULL; } - regulator = kzalloc(sizeof(*regulator), GFP_KERNEL); + regulator = kzalloc_obj(*regulator, GFP_KERNEL); if (regulator == NULL) { kfree_const(supply_name); return NULL; @@ -2701,7 +2701,7 @@ int regulator_register_supply_alias(struct device *dev, const char *id, struct regulator_supply_alias *map; struct regulator_supply_alias *new_map; - new_map = kzalloc(sizeof(struct regulator_supply_alias), GFP_KERNEL); + new_map = kzalloc_obj(struct regulator_supply_alias, GFP_KERNEL); if (!new_map) return -ENOMEM; @@ -2825,7 +2825,7 @@ static int regulator_ena_gpio_request(struct regulator_dev *rdev, struct gpio_desc *gpiod; gpiod = config->ena_gpiod; - new_pin = kzalloc(sizeof(*new_pin), GFP_KERNEL); + new_pin = kzalloc_obj(*new_pin, GFP_KERNEL); mutex_lock(®ulator_list_mutex); @@ -5913,7 +5913,7 @@ static int regulator_init_coupling(struct regulator_dev *rdev) else n_phandles = of_get_n_coupled(rdev); - coupled = kcalloc(n_phandles + 1, sizeof(*coupled), GFP_KERNEL); + coupled = kzalloc_objs(*coupled, n_phandles + 1, GFP_KERNEL); if (!coupled) return -ENOMEM; @@ -6034,7 +6034,7 @@ regulator_register(struct device *dev, goto rinse; } - rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL); + rdev = kzalloc_obj(struct regulator_dev, GFP_KERNEL); if (rdev == NULL) { ret = -ENOMEM; goto rinse; @@ -6117,8 +6117,7 @@ regulator_register(struct device *dev, sizeof(*rdev->constraints), GFP_KERNEL); else - rdev->constraints = kzalloc(sizeof(*rdev->constraints), - GFP_KERNEL); + rdev->constraints = kzalloc_obj(*rdev->constraints, GFP_KERNEL); if (!rdev->constraints) { ret = -ENOMEM; goto wash; diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c index b6cb0aaac3b1..186a05b00733 100644 --- a/drivers/regulator/fixed-helper.c +++ b/drivers/regulator/fixed-helper.c @@ -34,7 +34,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name, { struct fixed_regulator_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 33463926a2a6..93fab4fb2adf 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -973,9 +973,8 @@ restart: } if (num_consumers == 0) return 0; - _consumers = kmalloc_array(num_consumers, - sizeof(struct regulator_bulk_data), - GFP_KERNEL); + _consumers = kmalloc_objs(struct regulator_bulk_data, num_consumers, + GFP_KERNEL); if (!_consumers) return -ENOMEM; goto restart; diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 8c8688f99f0a..bb6038bf8bd4 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -370,7 +370,7 @@ static struct qcom_ssr_subsystem *qcom_ssr_get_subsys(const char *name) if (!strcmp(info->name, name)) goto out; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { info = ERR_PTR(-ENOMEM); goto out; @@ -534,7 +534,7 @@ static int pdm_notify_prepare(struct rproc_subdev *subdev) struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c index 660ac6fc4082..bbbe732fe767 100644 --- a/drivers/remoteproc/qcom_sysmon.c +++ b/drivers/remoteproc/qcom_sysmon.c @@ -628,7 +628,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, struct qcom_sysmon *sysmon; int ret; - sysmon = kzalloc(sizeof(*sysmon), GFP_KERNEL); + sysmon = kzalloc_obj(*sysmon, GFP_KERNEL); if (!sysmon) return ERR_PTR(-ENOMEM); diff --git a/drivers/remoteproc/qcom_wcnss_iris.c b/drivers/remoteproc/qcom_wcnss_iris.c index 2b52b403eb3f..78cb8150f64b 100644 --- a/drivers/remoteproc/qcom_wcnss_iris.c +++ b/drivers/remoteproc/qcom_wcnss_iris.c @@ -125,7 +125,7 @@ struct qcom_iris *qcom_iris_probe(struct device *parent, bool *use_48mhz_xo) return ERR_PTR(-EINVAL); } - iris = kzalloc(sizeof(*iris), GFP_KERNEL); + iris = kzalloc_obj(*iris, GFP_KERNEL); if (!iris) { of_node_put(of_node); return ERR_PTR(-ENOMEM); diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index aada2780b343..bb5887a9d2ac 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -557,7 +557,7 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr, return -EINVAL; } - trace = kzalloc(sizeof(*trace), GFP_KERNEL); + trace = kzalloc_obj(*trace, GFP_KERNEL); if (!trace) return -ENOMEM; @@ -635,7 +635,7 @@ static int rproc_handle_devmem(struct rproc *rproc, void *ptr, return -EINVAL; } - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) return -ENOMEM; @@ -727,7 +727,7 @@ static int rproc_alloc_carveout(struct rproc *rproc, * physical address in this case. */ if (mem->da != FW_RSC_ADDR_ANY && rproc->domain) { - mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); + mapping = kzalloc_obj(*mapping, GFP_KERNEL); if (!mapping) { ret = -ENOMEM; goto dma_free; @@ -917,7 +917,7 @@ rproc_mem_entry_init(struct device *dev, struct rproc_mem_entry *mem; va_list args; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return mem; @@ -960,7 +960,7 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len, struct rproc_mem_entry *mem; va_list args; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return mem; diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index 6ede8c0c93ad..f925c8e775a5 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -49,7 +49,7 @@ int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size) { struct rproc_dump_segment *segment; - segment = kzalloc(sizeof(*segment), GFP_KERNEL); + segment = kzalloc_obj(*segment, GFP_KERNEL); if (!segment) return -ENOMEM; @@ -86,7 +86,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, { struct rproc_dump_segment *segment; - segment = kzalloc(sizeof(*segment), GFP_KERNEL); + segment = kzalloc_obj(*segment, GFP_KERNEL); if (!segment) return -ENOMEM; diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index c5d46a878149..92c7c0b0ad65 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -430,7 +430,7 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) } /* Allocate virtio device */ - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) { ret = -ENOMEM; goto out; diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index c28679d3b43c..6185343a6d3f 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -164,7 +164,7 @@ static int stm32_rproc_of_memory_translations(struct platform_device *pdev, p_mems = devm_kcalloc(dev, cnt, sizeof(*p_mems), GFP_KERNEL); if (!p_mems) return -ENOMEM; - mem_range = kcalloc(cnt, sizeof(*mem_range), GFP_KERNEL); + mem_range = kzalloc_objs(*mem_range, cnt, GFP_KERNEL); if (!mem_range) return -ENOMEM; diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index bd619a6c42aa..a8b13fb50992 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -265,7 +265,7 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev) struct mbox_client *mbox_cl; struct mbox_info *ipi; - ipi = kzalloc(sizeof(*ipi), GFP_KERNEL); + ipi = kzalloc_obj(*ipi, GFP_KERNEL); if (!ipi) return NULL; @@ -1337,12 +1337,11 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) core_count = 1; } - child_devs = kcalloc(core_count, sizeof(struct device *), GFP_KERNEL); + child_devs = kzalloc_objs(struct device *, core_count, GFP_KERNEL); if (!child_devs) return -ENOMEM; - r5_cores = kcalloc(core_count, - sizeof(struct zynqmp_r5_core *), GFP_KERNEL); + r5_cores = kzalloc_objs(struct zynqmp_r5_core *, core_count, GFP_KERNEL); if (!r5_cores) { kfree(child_devs); return -ENOMEM; @@ -1503,7 +1502,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int ret; - cluster = kzalloc(sizeof(*cluster), GFP_KERNEL); + cluster = kzalloc_obj(*cluster, GFP_KERNEL); if (!cluster) return -ENOMEM; diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c index b495d5291868..323dba59fce8 100644 --- a/drivers/resctrl/mpam_devices.c +++ b/drivers/resctrl/mpam_devices.c @@ -295,7 +295,7 @@ mpam_class_alloc(u8 level_idx, enum mpam_class_types type) lockdep_assert_held(&mpam_list_lock); - class = kzalloc(sizeof(*class), GFP_KERNEL); + class = kzalloc_obj(*class, GFP_KERNEL); if (!class) return ERR_PTR(-ENOMEM); init_garbage(&class->garbage); @@ -343,7 +343,7 @@ mpam_component_alloc(struct mpam_class *class, int id) lockdep_assert_held(&mpam_list_lock); - comp = kzalloc(sizeof(*comp), GFP_KERNEL); + comp = kzalloc_obj(*comp, GFP_KERNEL); if (!comp) return ERR_PTR(-ENOMEM); init_garbage(&comp->garbage); @@ -398,7 +398,7 @@ mpam_vmsc_alloc(struct mpam_component *comp, struct mpam_msc *msc) lockdep_assert_held(&mpam_list_lock); - vmsc = kzalloc(sizeof(*vmsc), GFP_KERNEL); + vmsc = kzalloc_obj(*vmsc, GFP_KERNEL); if (!vmsc) return ERR_PTR(-ENOMEM); init_garbage(&vmsc->garbage); @@ -2419,7 +2419,7 @@ static int __allocate_component_cfg(struct mpam_component *comp) if (comp->cfg) return 0; - comp->cfg = kcalloc(mpam_partid_max + 1, sizeof(*comp->cfg), GFP_KERNEL); + comp->cfg = kzalloc_objs(*comp->cfg, mpam_partid_max + 1, GFP_KERNEL); if (!comp->cfg) return -ENOMEM; @@ -2444,9 +2444,9 @@ static int __allocate_component_cfg(struct mpam_component *comp) if (!ris->props.num_mbwu_mon) continue; - mbwu_state = kcalloc(ris->props.num_mbwu_mon, - sizeof(*ris->mbwu_state), - GFP_KERNEL); + mbwu_state = kzalloc_objs(*ris->mbwu_state, + ris->props.num_mbwu_mon, + GFP_KERNEL); if (!mbwu_state) { __destroy_component_cfg(comp); return -ENOMEM; diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 0666dfc41ca9..c224e42e0f6c 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -778,7 +778,7 @@ __reset_control_get_internal(struct reset_controller_dev *rcdev, } } - rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); + rstc = kzalloc_obj(*rstc, GFP_KERNEL); if (!rstc) return ERR_PTR(-ENOMEM); @@ -836,7 +836,7 @@ static int reset_add_gpio_aux_device(struct device *parent, struct auxiliary_device *adev; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; @@ -931,7 +931,7 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args) return id; /* Not freed on success, because it is persisent subsystem data. */ - rgpio_dev = kzalloc(sizeof(*rgpio_dev), GFP_KERNEL); + rgpio_dev = kzalloc_obj(*rgpio_dev, GFP_KERNEL); if (!rgpio_dev) { ret = -ENOMEM; goto err_ida_free; @@ -1360,7 +1360,7 @@ of_reset_control_array_get(struct device_node *np, enum reset_control_flags flag if (num < 0) return optional ? NULL : ERR_PTR(num); - resets = kzalloc(struct_size(resets, rstc, num), GFP_KERNEL); + resets = kzalloc_flex(*resets, rstc, num, GFP_KERNEL); if (!resets) return ERR_PTR(-ENOMEM); resets->num_rstcs = num; diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c index e5b6127783a7..c28cb4632883 100644 --- a/drivers/reset/reset-npcm.c +++ b/drivers/reset/reset-npcm.c @@ -399,7 +399,7 @@ static struct auxiliary_device *npcm_clock_adev_alloc(struct npcm_rc_data *rst_d struct auxiliary_device *adev; int ret; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index 8c6492e5693c..a18cc81e0efa 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -27,7 +27,7 @@ static int a10_reset_init(struct device_node *np) int ret; u32 reg_offset = 0x10; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c index e752594b6971..b88d1d001ec3 100644 --- a/drivers/reset/reset-sunxi.c +++ b/drivers/reset/reset-sunxi.c @@ -27,7 +27,7 @@ static int sunxi_reset_init(struct device_node *np) resource_size_t size; int ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c index d1213c33da20..bbeac30cbc8e 100644 --- a/drivers/rpmsg/mtk_rpmsg.c +++ b/drivers/rpmsg/mtk_rpmsg.c @@ -91,7 +91,7 @@ __mtk_create_ept(struct mtk_rpmsg_rproc_subdev *mtk_subdev, struct platform_device *pdev = mtk_subdev->pdev; int ret; - mept = kzalloc(sizeof(*mept), GFP_KERNEL); + mept = kzalloc_obj(*mept, GFP_KERNEL); if (!mept) return NULL; mept->mtk_subdev = mtk_subdev; @@ -201,7 +201,7 @@ static int mtk_rpmsg_register_device(struct mtk_rpmsg_rproc_subdev *mtk_subdev, struct mtk_rpmsg_device *mdev; struct platform_device *pdev = mtk_subdev->pdev; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; @@ -252,7 +252,7 @@ static int mtk_rpmsg_create_device(struct mtk_rpmsg_rproc_subdev *mtk_subdev, { struct mtk_rpmsg_channel_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -380,7 +380,7 @@ mtk_rpmsg_create_rproc_subdev(struct platform_device *pdev, { struct mtk_rpmsg_rproc_subdev *mtk_subdev; - mtk_subdev = kzalloc(sizeof(*mtk_subdev), GFP_KERNEL); + mtk_subdev = kzalloc_obj(*mtk_subdev, GFP_KERNEL); if (!mtk_subdev) return NULL; diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 5ea096acc858..dd775f955bfe 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -227,7 +227,7 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink, { struct glink_channel *channel; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return ERR_PTR(-ENOMEM); @@ -754,7 +754,7 @@ qcom_glink_alloc_intent(struct qcom_glink *glink, int ret; unsigned long flags; - intent = kzalloc(sizeof(*intent), GFP_KERNEL); + intent = kzalloc_obj(*intent, GFP_KERNEL); if (!intent) return NULL; @@ -875,7 +875,7 @@ static int qcom_glink_rx_defer(struct qcom_glink *glink, size_t extra) return -ENXIO; } - dcmd = kzalloc(struct_size(dcmd, data, extra), GFP_ATOMIC); + dcmd = kzalloc_flex(*dcmd, data, extra, GFP_ATOMIC); if (!dcmd) return -ENOMEM; @@ -945,7 +945,7 @@ static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail) if (glink->intentless) { /* Might have an ongoing, fragmented, message to append */ if (!channel->buf) { - intent = kzalloc(sizeof(*intent), GFP_ATOMIC); + intent = kzalloc_obj(*intent, GFP_ATOMIC); if (!intent) return -ENOMEM; @@ -1070,7 +1070,7 @@ static void qcom_glink_handle_intent(struct qcom_glink *glink, count > 0 ? msg->intents[0].iid : 0); for (i = 0; i < count; ++i) { - intent = kzalloc(sizeof(*intent), GFP_ATOMIC); + intent = kzalloc_obj(*intent, GFP_ATOMIC); if (!intent) break; @@ -1669,7 +1669,7 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, complete_all(&channel->open_req); if (create_device) { - rpdev = kzalloc(sizeof(*rpdev), GFP_KERNEL); + rpdev = kzalloc_obj(*rpdev, GFP_KERNEL); if (!rpdev) { ret = -ENOMEM; goto rcid_remove; @@ -1868,7 +1868,7 @@ static int qcom_glink_create_chrdev(struct qcom_glink *glink) struct rpmsg_device *rpdev; struct glink_channel *channel; - rpdev = kzalloc(sizeof(*rpdev), GFP_KERNEL); + rpdev = kzalloc_obj(*rpdev, GFP_KERNEL); if (!rpdev) return -ENOMEM; diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 7a982c60a8dd..26727cbb7ce4 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -230,7 +230,7 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, size_t size; int ret; - smem = kzalloc(sizeof(*smem), GFP_KERNEL); + smem = kzalloc_obj(*smem, GFP_KERNEL); if (!smem) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 42594f5ee438..7faed3530888 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -922,7 +922,7 @@ static struct rpmsg_endpoint *qcom_smd_create_ept(struct rpmsg_device *rpdev, return NULL; } - qsept = kzalloc(sizeof(*qsept), GFP_KERNEL); + qsept = kzalloc_obj(*qsept, GFP_KERNEL); if (!qsept) return NULL; @@ -1077,7 +1077,7 @@ static int qcom_smd_create_device(struct qcom_smd_channel *channel) dev_dbg(&edge->dev, "registering '%s'\n", channel->name); - qsdev = kzalloc(sizeof(*qsdev), GFP_KERNEL); + qsdev = kzalloc_obj(*qsdev, GFP_KERNEL); if (!qsdev) return -ENOMEM; @@ -1104,7 +1104,7 @@ static int qcom_smd_create_chrdev(struct qcom_smd_edge *edge) { struct qcom_smd_device *qsdev; - qsdev = kzalloc(sizeof(*qsdev), GFP_KERNEL); + qsdev = kzalloc_obj(*qsdev, GFP_KERNEL); if (!qsdev) return -ENOMEM; @@ -1132,7 +1132,7 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed void *info; int ret; - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) return ERR_PTR(-ENOMEM); @@ -1484,7 +1484,7 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent, if (!qcom_smem_is_available()) return ERR_PTR(-EPROBE_DEFER); - edge = kzalloc(sizeof(*edge), GFP_KERNEL); + edge = kzalloc_obj(*edge, GFP_KERNEL); if (!edge) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 96fcdd2d7093..a368698113eb 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -410,7 +410,7 @@ static struct rpmsg_eptdev *rpmsg_chrdev_eptdev_alloc(struct rpmsg_device *rpdev struct rpmsg_eptdev *eptdev; struct device *dev; - eptdev = kzalloc(sizeof(*eptdev), GFP_KERNEL); + eptdev = kzalloc_obj(*eptdev, GFP_KERNEL); if (!eptdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/rpmsg_ctrl.c b/drivers/rpmsg/rpmsg_ctrl.c index 28f57945ccd9..95f8be640dfc 100644 --- a/drivers/rpmsg/rpmsg_ctrl.c +++ b/drivers/rpmsg/rpmsg_ctrl.c @@ -141,7 +141,7 @@ static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev) struct device *dev; int ret; - ctrldev = kzalloc(sizeof(*ctrldev), GFP_KERNEL); + ctrldev = kzalloc_obj(*ctrldev, GFP_KERNEL); if (!ctrldev) return -ENOMEM; diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 79d983055b4d..20ba05917841 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -210,7 +210,7 @@ static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, struct rpmsg_endpoint *ept; struct device *dev = rpdev ? &rpdev->dev : &vrp->vdev->dev; - ept = kzalloc(sizeof(*ept), GFP_KERNEL); + ept = kzalloc_obj(*ept, GFP_KERNEL); if (!ept) return NULL; @@ -400,7 +400,7 @@ static struct rpmsg_device *__rpmsg_create_channel(struct virtproc_info *vrp, return NULL; } - vch = kzalloc(sizeof(*vch), GFP_KERNEL); + vch = kzalloc_obj(*vch, GFP_KERNEL); if (!vch) return NULL; @@ -779,7 +779,7 @@ static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev struct rpmsg_device *rpdev_ctrl; int err = 0; - vch = kzalloc(sizeof(*vch), GFP_KERNEL); + vch = kzalloc_obj(*vch, GFP_KERNEL); if (!vch) return ERR_PTR(-ENOMEM); @@ -825,7 +825,7 @@ static int rpmsg_probe(struct virtio_device *vdev) size_t total_buf_space; bool notify; - vrp = kzalloc(sizeof(*vrp), GFP_KERNEL); + vrp = kzalloc_obj(*vrp, GFP_KERNEL); if (!vrp) return -ENOMEM; @@ -898,7 +898,7 @@ static int rpmsg_probe(struct virtio_device *vdev) /* if supported by the remote processor, enable the name service */ if (virtio_has_feature(vdev, VIRTIO_RPMSG_F_NS)) { - vch = kzalloc(sizeof(*vch), GFP_KERNEL); + vch = kzalloc_obj(*vch, GFP_KERNEL); if (!vch) { err = -ENOMEM; goto free_ctrldev; diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index b1a2be1f9e3b..eda2d5d46798 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -208,7 +208,7 @@ static struct rtc_device *rtc_allocate_device(void) { struct rtc_device *rtc; - rtc = kzalloc(sizeof(*rtc), GFP_KERNEL); + rtc = kzalloc_obj(*rtc, GFP_KERNEL); if (!rtc) return NULL; diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index e5e6013d080e..2bc86e8a8a86 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -233,12 +233,12 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, const char *parents[2]; u32 reg; - rtc = kzalloc(sizeof(*rtc), GFP_KERNEL); + rtc = kzalloc_obj(*rtc, GFP_KERNEL); if (!rtc) return; rtc->data = data; - clk_data = kzalloc(struct_size(clk_data, hws, 3), GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, 3, GFP_KERNEL); if (!clk_data) { kfree(rtc); return; diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 35031357ac4d..cc86a2b76a0a 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -86,7 +86,7 @@ struct dasd_device *dasd_alloc_device(void) { struct dasd_device *device; - device = kzalloc(sizeof(struct dasd_device), GFP_ATOMIC); + device = kzalloc_obj(struct dasd_device, GFP_ATOMIC); if (!device) return ERR_PTR(-ENOMEM); @@ -150,7 +150,7 @@ struct dasd_block *dasd_alloc_block(void) { struct dasd_block *block; - block = kzalloc(sizeof(*block), GFP_ATOMIC); + block = kzalloc_obj(*block, GFP_ATOMIC); if (!block) return ERR_PTR(-ENOMEM); /* open_count = 0 means device online but not in use */ @@ -868,7 +868,7 @@ int dasd_profile_on(struct dasd_profile *profile) { struct dasd_profile_info *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; spin_lock_bh(&profile->lock); @@ -3180,7 +3180,7 @@ enum blk_eh_timer_return dasd_times_out(struct request *req) static int dasd_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, unsigned int idx) { - struct dasd_queue *dq = kzalloc(sizeof(*dq), GFP_KERNEL); + struct dasd_queue *dq = kzalloc_obj(*dq, GFP_KERNEL); if (!dq) return -ENOMEM; diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index f7e768d8ca76..f5f3b6da2d4b 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -98,7 +98,7 @@ static struct alias_server *_allocate_server(struct dasd_uid *uid) { struct alias_server *server; - server = kzalloc(sizeof(*server), GFP_KERNEL); + server = kzalloc_obj(*server, GFP_KERNEL); if (!server) return ERR_PTR(-ENOMEM); memcpy(server->uid.vendor, uid->vendor, sizeof(uid->vendor)); @@ -117,17 +117,16 @@ static struct alias_lcu *_allocate_lcu(struct dasd_uid *uid) { struct alias_lcu *lcu; - lcu = kzalloc(sizeof(*lcu), GFP_KERNEL); + lcu = kzalloc_obj(*lcu, GFP_KERNEL); if (!lcu) return ERR_PTR(-ENOMEM); - lcu->uac = kzalloc(sizeof(*(lcu->uac)), GFP_KERNEL | GFP_DMA); + lcu->uac = kzalloc_obj(*(lcu->uac), GFP_KERNEL | GFP_DMA); if (!lcu->uac) goto out_err1; - lcu->rsu_cqr = kzalloc(sizeof(*lcu->rsu_cqr), GFP_KERNEL | GFP_DMA); + lcu->rsu_cqr = kzalloc_obj(*lcu->rsu_cqr, GFP_KERNEL | GFP_DMA); if (!lcu->rsu_cqr) goto out_err2; - lcu->rsu_cqr->cpaddr = kzalloc(sizeof(struct ccw1), - GFP_KERNEL | GFP_DMA); + lcu->rsu_cqr->cpaddr = kzalloc_obj(struct ccw1, GFP_KERNEL | GFP_DMA); if (!lcu->rsu_cqr->cpaddr) goto out_err3; lcu->rsu_cqr->data = kzalloc(16, GFP_KERNEL | GFP_DMA); @@ -323,7 +322,7 @@ static int _add_device_to_lcu(struct alias_lcu *lcu, } group = _find_group(lcu, &uid); if (!group) { - group = kzalloc(sizeof(*group), GFP_ATOMIC); + group = kzalloc_obj(*group, GFP_ATOMIC); if (!group) return -ENOMEM; memcpy(group->uid.vendor, uid.vendor, sizeof(uid.vendor)); diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 73972900fc55..d46274ef2f3e 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -412,7 +412,7 @@ dasd_add_busid(const char *bus_id, int features) struct dasd_devmap *devmap, *new, *tmp; int hash; - new = kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL); + new = kzalloc_obj(struct dasd_devmap, GFP_KERNEL); if (!new) return ERR_PTR(-ENOMEM); spin_lock(&dasd_devmap_lock); @@ -605,7 +605,7 @@ static int dasd_devmap_get_pprc_status(struct dasd_device *device, dev_warn(&device->cdev->dev, "Unable to query copy relation status\n"); return -EOPNOTSUPP; } - temp = kzalloc(sizeof(*temp), GFP_KERNEL); + temp = kzalloc_obj(*temp, GFP_KERNEL); if (!temp) return -ENOMEM; @@ -2274,7 +2274,7 @@ static ssize_t dasd_copy_pair_store(struct device *dev, } else if (sec_devmap->copy) { copy = sec_devmap->copy; } else { - copy = kzalloc(sizeof(*copy), GFP_KERNEL); + copy = kzalloc_obj(*copy, GFP_KERNEL); if (!copy) return -ENOMEM; } diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 56f1af8a7ddd..ac15322a1d06 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -325,7 +325,7 @@ dasd_diag_check_device(struct dasd_device *device) int rc; if (private == NULL) { - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (private == NULL) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Allocating memory for private DASD data " @@ -395,7 +395,7 @@ dasd_diag_check_device(struct dasd_device *device) rc = -ENOMEM; goto out; } - bio = kzalloc(sizeof(*bio), GFP_KERNEL); + bio = kzalloc_obj(*bio, GFP_KERNEL); if (bio == NULL) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "No memory to allocate initialization bio"); diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index b08e900687f3..47ffc255e9b4 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1468,7 +1468,7 @@ static int dasd_eckd_pe_handler(struct dasd_device *device, { struct pe_handler_work_data *data; - data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA); + data = kzalloc_obj(*data, GFP_ATOMIC | GFP_DMA); if (!data) { if (mutex_trylock(&dasd_pe_handler_mutex)) { data = pe_handler_worker; @@ -1720,7 +1720,7 @@ static int dasd_eckd_ext_pool_exhaust(struct dasd_device *device, { struct ext_pool_exhaust_work_data *data; - data = kzalloc(sizeof(*data), GFP_ATOMIC); + data = kzalloc_obj(*data, GFP_ATOMIC); if (!data) return -ENOMEM; INIT_WORK(&data->worker, dasd_eckd_ext_pool_exhaust_work); @@ -2070,7 +2070,7 @@ dasd_eckd_check_characteristics(struct dasd_device *device) "The DASD is not operating in multipath mode\n"); } if (!private) { - private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA); + private = kzalloc_obj(*private, GFP_KERNEL | GFP_DMA); if (!private) { dev_warn(&device->cdev->dev, "Allocating memory for private DASD data " @@ -3729,7 +3729,7 @@ static int dasd_in_copy_relation(struct dasd_device *device) if (!dasd_eckd_pprc_enabled(device)) return 0; - temp = kzalloc(sizeof(*temp), GFP_KERNEL); + temp = kzalloc_obj(*temp, GFP_KERNEL); if (!temp) return -ENOMEM; @@ -5951,7 +5951,7 @@ static int dasd_eckd_query_host_access(struct dasd_device *device, "Could not allocate read message buffer request"); return PTR_ERR(cqr); } - host_access = kzalloc(sizeof(*host_access), GFP_KERNEL | GFP_DMA); + host_access = kzalloc_obj(*host_access, GFP_KERNEL | GFP_DMA); if (!host_access) { dasd_sfree_request(cqr, device); DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", @@ -6017,7 +6017,7 @@ static int dasd_eckd_host_access_count(struct dasd_device *device) int count = 0; int rc, i; - access = kzalloc(sizeof(*access), GFP_NOIO); + access = kzalloc_obj(*access, GFP_NOIO); if (!access) { DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not allocate access buffer"); @@ -6053,7 +6053,7 @@ static int dasd_hosts_print(struct dasd_device *device, struct seq_file *m) char sysplex[9] = ""; int rc, i; - access = kzalloc(sizeof(*access), GFP_NOIO); + access = kzalloc_obj(*access, GFP_NOIO); if (!access) { DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not allocate access buffer"); @@ -6721,7 +6721,7 @@ static void dasd_eckd_check_attention_work(struct work_struct *work) data = container_of(work, struct check_attention_work_data, worker); device = data->device; - messages = kzalloc(sizeof(*messages), GFP_KERNEL); + messages = kzalloc_obj(*messages, GFP_KERNEL); if (!messages) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Could not allocate attention message buffer"); @@ -6748,7 +6748,7 @@ static int dasd_eckd_check_attention(struct dasd_device *device, __u8 lpum) { struct check_attention_work_data *data; - data = kzalloc(sizeof(*data), GFP_ATOMIC); + data = kzalloc_obj(*data, GFP_ATOMIC); if (!data) return -ENOMEM; INIT_WORK(&data->worker, dasd_eckd_check_attention_work); @@ -6912,18 +6912,17 @@ dasd_eckd_init(void) int ret; ASCEBC(dasd_eckd_discipline.ebcname, 4); - dasd_reserve_req = kmalloc(sizeof(*dasd_reserve_req), - GFP_KERNEL | GFP_DMA); + dasd_reserve_req = kmalloc_obj(*dasd_reserve_req, GFP_KERNEL | GFP_DMA); if (!dasd_reserve_req) return -ENOMEM; - dasd_vol_info_req = kmalloc(sizeof(*dasd_vol_info_req), - GFP_KERNEL | GFP_DMA); + dasd_vol_info_req = kmalloc_obj(*dasd_vol_info_req, + GFP_KERNEL | GFP_DMA); if (!dasd_vol_info_req) { kfree(dasd_reserve_req); return -ENOMEM; } - pe_handler_worker = kmalloc(sizeof(*pe_handler_worker), - GFP_KERNEL | GFP_DMA); + pe_handler_worker = kmalloc_obj(*pe_handler_worker, + GFP_KERNEL | GFP_DMA); if (!pe_handler_worker) { kfree(dasd_reserve_req); kfree(dasd_vol_info_req); diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index b177b7952f2e..648ab74ae60f 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c @@ -544,7 +544,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) struct eerbuffer *eerb; unsigned long flags; - eerb = kzalloc(sizeof(struct eerbuffer), GFP_KERNEL); + eerb = kzalloc_obj(struct eerbuffer, GFP_KERNEL); if (!eerb) return -ENOMEM; eerb->buffer_page_count = eer_pages; @@ -689,7 +689,7 @@ int __init dasd_eer_init(void) { int rc; - dasd_eer_dev = kzalloc(sizeof(*dasd_eer_dev), GFP_KERNEL); + dasd_eer_dev = kzalloc_obj(*dasd_eer_dev, GFP_KERNEL); if (!dasd_eer_dev) return -ENOMEM; diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index c2a87201c153..029acb83ecab 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c @@ -119,7 +119,7 @@ dasd_fba_check_characteristics(struct dasd_device *device) int readonly, rc; if (!private) { - private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA); + private = kzalloc_obj(*private, GFP_KERNEL | GFP_DMA); if (!private) { dev_warn(&device->cdev->dev, "Allocating memory for private DASD " diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index f883990be626..d5534ce25558 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -442,7 +442,7 @@ static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) struct dasd_profile_info_t *data; int rc = 0; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -560,7 +560,7 @@ static int dasd_ioctl_information(struct dasd_block *block, void __user *argp, struct dasd_information2_t *dasd_info; int error; - dasd_info = kzalloc(sizeof(*dasd_info), GFP_KERNEL); + dasd_info = kzalloc_obj(*dasd_info, GFP_KERNEL); if (!dasd_info) return -ENOMEM; diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 38e1df8f8a82..5d7229f39480 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -240,9 +240,8 @@ dcssblk_is_continuous(struct dcssblk_dev_info *dev_info) if (dev_info->num_of_segments <= 1) return 0; - sort_list = kcalloc(dev_info->num_of_segments, - sizeof(struct segment_info), - GFP_KERNEL); + sort_list = kzalloc_objs(struct segment_info, dev_info->num_of_segments, + GFP_KERNEL); if (sort_list == NULL) return -ENOMEM; i = 0; @@ -310,7 +309,7 @@ dcssblk_load_segment(char *name, struct segment_info **seg_info) return -EEXIST; /* get a struct segment_info */ - *seg_info = kzalloc(sizeof(struct segment_info), GFP_KERNEL); + *seg_info = kzalloc_obj(struct segment_info, GFP_KERNEL); if (*seg_info == NULL) return -ENOMEM; @@ -606,8 +605,8 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char * get a struct dcssblk_dev_info */ if (num_of_segments == 0) { - dev_info = kzalloc(sizeof(struct dcssblk_dev_info), - GFP_KERNEL); + dev_info = kzalloc_obj(struct dcssblk_dev_info, + GFP_KERNEL); if (dev_info == NULL) { rc = -ENOMEM; goto out; diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index 04e84f45dcc9..0781c7e9d913 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c @@ -77,8 +77,8 @@ static int __scm_alloc_rq(void) if (!scmrq->aob) goto free; - scmrq->request = kcalloc(nr_requests_per_io, sizeof(scmrq->request[0]), - GFP_KERNEL); + scmrq->request = kzalloc_objs(scmrq->request[0], nr_requests_per_io, + GFP_KERNEL); if (!scmrq->request) goto free; @@ -331,7 +331,7 @@ static blk_status_t scm_blk_request(struct blk_mq_hw_ctx *hctx, static int scm_blk_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, unsigned int idx) { - struct scm_queue *qd = kzalloc(sizeof(*qd), GFP_KERNEL); + struct scm_queue *qd = kzalloc_obj(*qd, GFP_KERNEL); if (!qd) return -ENOMEM; diff --git a/drivers/s390/block/scm_drv.c b/drivers/s390/block/scm_drv.c index 6cffbbe83f89..81b32b44b03c 100644 --- a/drivers/s390/block/scm_drv.c +++ b/drivers/s390/block/scm_drv.c @@ -43,7 +43,7 @@ static int scm_probe(struct scm_device *scmdev) if (scmdev->attrs.oper_state != OP_STATE_GOOD) return -EINVAL; - bdev = kzalloc(sizeof(*bdev), GFP_KERNEL); + bdev = kzalloc_obj(*bdev, GFP_KERNEL); if (!bdev) return -ENOMEM; diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 56e43d43c713..46265f4fbfd8 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -670,7 +670,7 @@ static struct raw3215_info *raw3215_alloc_info(void) { struct raw3215_info *info; - info = kzalloc(sizeof(struct raw3215_info), GFP_KERNEL | GFP_DMA); + info = kzalloc_obj(struct raw3215_info, GFP_KERNEL | GFP_DMA); if (!info) return NULL; @@ -916,7 +916,7 @@ static int __init con3215_init(void) /* allocate 3215 request structures */ raw3215_freelist = NULL; for (i = 0; i < NR_3215_REQ; i++) { - req = kzalloc(sizeof(struct raw3215_req), GFP_KERNEL | GFP_DMA); + req = kzalloc_obj(struct raw3215_req, GFP_KERNEL | GFP_DMA); if (!req) return -ENOMEM; req->next = raw3215_freelist; diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index 4a7c084e68a6..1dcf0198d8a7 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -829,7 +829,7 @@ static struct tty3270 *tty3270_alloc_view(void) { struct tty3270 *tp; - tp = kzalloc(sizeof(*tp), GFP_KERNEL); + tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) goto out_err; @@ -895,11 +895,12 @@ static struct tty3270_line *tty3270_alloc_screen(struct tty3270 *tp, unsigned in int allocated, lines; allocated = __roundup_pow_of_two(rows) * TTY3270_SCREEN_PAGES; - screen = kcalloc(allocated, sizeof(struct tty3270_line), GFP_KERNEL); + screen = kzalloc_objs(struct tty3270_line, allocated, GFP_KERNEL); if (!screen) goto out_err; for (lines = 0; lines < allocated; lines++) { - screen[lines].cells = kcalloc(cols, sizeof(struct tty3270_cell), GFP_KERNEL); + screen[lines].cells = kzalloc_objs(struct tty3270_cell, cols, + GFP_KERNEL); if (!screen[lines].cells) goto out_screen; } diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 73555dbe30d0..c601134eee04 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -367,7 +367,7 @@ static struct fs3270 *fs3270_alloc_view(void) { struct fs3270 *fp; - fp = kzalloc(sizeof(*fp), GFP_KERNEL); + fp = kzalloc_obj(*fp, GFP_KERNEL); if (!fp) return ERR_PTR(-ENOMEM); fp->init = raw3270_request_alloc(0); diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index a45f07a2cc8f..006c381e2417 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -78,7 +78,7 @@ kbd_alloc(void) { struct kbd_data *kbd; int i; - kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL); + kbd = kzalloc_obj(struct kbd_data, GFP_KERNEL); if (!kbd) goto out; kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL); @@ -105,7 +105,7 @@ kbd_alloc(void) { } } kbd->fn_handler = - kcalloc(NR_FN_HANDLER, sizeof(fn_handler_fn *), GFP_KERNEL); + kzalloc_objs(fn_handler_fn *, NR_FN_HANDLER, GFP_KERNEL); if (!kbd->fn_handler) goto out_func; kbd->accent_table = kmemdup(ebc_accent_table, diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index 3d84f84b4cbd..9c1bcc4f35c5 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -181,12 +181,11 @@ static struct mon_private *mon_alloc_mem(void) int i; struct mon_private *monpriv; - monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); + monpriv = kzalloc_obj(struct mon_private, GFP_KERNEL); if (!monpriv) return NULL; for (i = 0; i < MON_MSGLIM; i++) { - monpriv->msg_array[i] = kzalloc(sizeof(struct mon_msg), - GFP_KERNEL); + monpriv->msg_array[i] = kzalloc_obj(struct mon_msg, GFP_KERNEL); if (!monpriv->msg_array[i]) { mon_free_mem(monpriv); return NULL; diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index cf2e51061422..d7ef93351a2e 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c @@ -58,8 +58,8 @@ static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn) struct appldata_product_id *id; int rc; - id = kmalloc(sizeof(*id), GFP_KERNEL); - parm_list = kmalloc(sizeof(*parm_list), GFP_KERNEL); + id = kmalloc_obj(*id, GFP_KERNEL); + parm_list = kmalloc_obj(*parm_list, GFP_KERNEL); rc = -ENOMEM; if (!id || !parm_list) goto out; @@ -126,7 +126,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv) } else if (monhdr->mon_function != MONWRITE_STOP_INTERVAL) { if (mon_buf_count >= mon_max_bufs) return -ENOSPC; - monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); + monbuf = kzalloc_obj(struct mon_buf, GFP_KERNEL); if (!monbuf) return -ENOMEM; monbuf->data = kzalloc(monhdr->datalen, @@ -188,7 +188,7 @@ static int monwrite_open(struct inode *inode, struct file *filp) { struct mon_private *monpriv; - monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); + monpriv = kzalloc_obj(struct mon_private, GFP_KERNEL); if (!monpriv) return -ENOMEM; INIT_LIST_HEAD(&monpriv->list); diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 55850b5a7f51..aa9c4d81225c 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c @@ -146,7 +146,7 @@ struct raw3270_request *raw3270_request_alloc(size_t size) struct raw3270_request *rq; /* Allocate request structure */ - rq = kzalloc(sizeof(*rq), GFP_KERNEL | GFP_DMA); + rq = kzalloc_obj(*rq, GFP_KERNEL | GFP_DMA); if (!rq) return ERR_PTR(-ENOMEM); @@ -813,7 +813,7 @@ struct raw3270 __init *raw3270_setup_console(void) if (IS_ERR(cdev)) return ERR_CAST(cdev); - rp = kzalloc(sizeof(*rp), GFP_KERNEL | GFP_DMA); + rp = kzalloc_obj(*rp, GFP_KERNEL | GFP_DMA); ascebc = kzalloc(256, GFP_KERNEL); rc = raw3270_setup_device(cdev, rp, ascebc); if (rc) @@ -858,7 +858,7 @@ static struct raw3270 *raw3270_create_device(struct ccw_device *cdev) char *ascebc; int rc; - rp = kzalloc(sizeof(*rp), GFP_KERNEL | GFP_DMA); + rp = kzalloc_obj(*rp, GFP_KERNEL | GFP_DMA); if (!rp) return ERR_PTR(-ENOMEM); ascebc = kmalloc(256, GFP_KERNEL); diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index be4730936f5c..c4a79cf6db86 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c @@ -66,7 +66,7 @@ int sclp_sync_request_timeout(sclp_cmdw_t cmd, void *sccb, int timeout) struct sclp_req *request; int rc; - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) return -ENOMEM; if (timeout) @@ -134,7 +134,7 @@ static int do_core_configure(sclp_cmdw_t cmd) * Use kmalloc to have a minimum alignment of 8 bytes and ensure sccb * is not going to cross a page boundary. */ - sccb = kzalloc(sizeof(*sccb), GFP_KERNEL | GFP_DMA); + sccb = kzalloc_obj(*sccb, GFP_KERNEL | GFP_DMA); if (!sccb) return -ENOMEM; sccb->header.length = sizeof(*sccb); diff --git a/drivers/s390/char/sclp_cpi_sys.c b/drivers/s390/char/sclp_cpi_sys.c index 8e1636bcf8b5..ea3ee83bac85 100644 --- a/drivers/s390/char/sclp_cpi_sys.c +++ b/drivers/s390/char/sclp_cpi_sys.c @@ -81,7 +81,7 @@ static struct sclp_req *cpi_prepare_req(void) struct cpi_sccb *sccb; struct cpi_evbuf *evb; - req = kzalloc(sizeof(struct sclp_req), GFP_KERNEL); + req = kzalloc_obj(struct sclp_req, GFP_KERNEL); if (!req) return ERR_PTR(-ENOMEM); sccb = (struct cpi_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA); diff --git a/drivers/s390/char/sclp_ftp.c b/drivers/s390/char/sclp_ftp.c index 2a1c4b2cafc8..f9c15f6f8078 100644 --- a/drivers/s390/char/sclp_ftp.c +++ b/drivers/s390/char/sclp_ftp.c @@ -92,7 +92,7 @@ static int sclp_ftp_et7(const struct hmcdrv_ftp_cmdspec *ftp) ssize_t len; int rc; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); sccb = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); if (!req || !sccb) { rc = -ENOMEM; diff --git a/drivers/s390/char/sclp_mem.c b/drivers/s390/char/sclp_mem.c index 27f0d2f12a8b..9417857ce401 100644 --- a/drivers/s390/char/sclp_mem.c +++ b/drivers/s390/char/sclp_mem.c @@ -431,7 +431,7 @@ static int __init sclp_init_mem(void) max_sclp_mems = roundup(sclp.rnmax * sclp.rzm, block_size) / block_size; /* Allocate memory for all blocks ahead of time. */ - sclp_mems = kcalloc(max_sclp_mems, sizeof(struct sclp_mem), GFP_KERNEL); + sclp_mems = kzalloc_objs(struct sclp_mem, max_sclp_mems, GFP_KERNEL); if (!sclp_mems) return -ENOMEM; kset = kset_create_and_add("memory", NULL, firmware_kobj); @@ -453,7 +453,7 @@ static void __init insert_increment(u16 rn, int standby, int assigned) struct list_head *prev; u16 last_rn; - new_incr = kzalloc(sizeof(*new_incr), GFP_KERNEL); + new_incr = kzalloc_obj(*new_incr, GFP_KERNEL); if (!new_incr) return; new_incr->rn = rn; diff --git a/drivers/s390/char/sclp_sd.c b/drivers/s390/char/sclp_sd.c index e4a90a14028a..ee09803db422 100644 --- a/drivers/s390/char/sclp_sd.c +++ b/drivers/s390/char/sclp_sd.c @@ -518,7 +518,7 @@ static __init struct sclp_sd_file *sclp_sd_file_create(const char *name, u8 di) struct sclp_sd_file *sd_file; int rc; - sd_file = kzalloc(sizeof(*sd_file), GFP_KERNEL); + sd_file = kzalloc_obj(*sd_file, GFP_KERNEL); if (!sd_file) return NULL; sd_file->di = di; diff --git a/drivers/s390/char/tape_3490.c b/drivers/s390/char/tape_3490.c index 7302f1121553..ac70055fd8ba 100644 --- a/drivers/s390/char/tape_3490.c +++ b/drivers/s390/char/tape_3490.c @@ -140,7 +140,7 @@ tape_3490_schedule_work(struct tape_device *device, enum tape_op op) { struct tape_3490_work *p; - if ((p = kzalloc(sizeof(*p), GFP_ATOMIC)) == NULL) + if ((p = kzalloc_obj(*p, GFP_ATOMIC)) == NULL) return -ENOMEM; INIT_WORK(&p->work, tape_3490_work_handler); diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 1ae9ad219c08..b211324b801f 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -45,7 +45,7 @@ struct tape_class_device *register_tape_dev( int rc; char * s; - tcd = kzalloc(sizeof(struct tape_class_device), GFP_KERNEL); + tcd = kzalloc_obj(struct tape_class_device, GFP_KERNEL); if (!tcd) return ERR_PTR(-ENOMEM); diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index a62b650ea3c2..f3270f22a1ef 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -249,7 +249,7 @@ tape_med_state_work(struct tape_device *device, enum tape_medium_state state) { struct tape_med_state_work_data *p; - p = kzalloc(sizeof(*p), GFP_ATOMIC); + p = kzalloc_obj(*p, GFP_ATOMIC); if (p) { INIT_WORK(&p->work, tape_med_state_work_handler); p->device = tape_get_device(device); @@ -477,7 +477,7 @@ tape_alloc_device(void) { struct tape_device *device; - device = kzalloc(sizeof(struct tape_device), GFP_KERNEL); + device = kzalloc_obj(struct tape_device, GFP_KERNEL); if (device == NULL) { DBF_EXCEPTION(2, "ti:no mem\n"); return ERR_PTR(-ENOMEM); @@ -678,15 +678,15 @@ tape_alloc_request(int cplength, int datasize) DBF_LH(6, "tape_alloc_request(%d, %d)\n", cplength, datasize); - request = kzalloc(sizeof(struct tape_request), GFP_KERNEL); + request = kzalloc_obj(struct tape_request, GFP_KERNEL); if (request == NULL) { DBF_EXCEPTION(1, "cqra nomem\n"); return ERR_PTR(-ENOMEM); } /* allocate channel program */ if (cplength > 0) { - request->cpaddr = kcalloc(cplength, sizeof(struct ccw1), - GFP_ATOMIC | GFP_DMA); + request->cpaddr = kzalloc_objs(struct ccw1, cplength, + GFP_ATOMIC | GFP_DMA); if (request->cpaddr == NULL) { DBF_EXCEPTION(1, "cqra nomem\n"); kfree(request); diff --git a/drivers/s390/char/uvdevice.c b/drivers/s390/char/uvdevice.c index 2b83fb6dc1d7..83ed0a26e884 100644 --- a/drivers/s390/char/uvdevice.c +++ b/drivers/s390/char/uvdevice.c @@ -196,7 +196,7 @@ static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) goto out; ret = -ENOMEM; - uvio_attest = kzalloc(sizeof(*uvio_attest), GFP_KERNEL); + uvio_attest = kzalloc_obj(*uvio_attest, GFP_KERNEL); if (!uvio_attest) goto out; @@ -216,7 +216,7 @@ static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) goto out; } - uvcb_attest = kzalloc(sizeof(*uvcb_attest), GFP_KERNEL); + uvcb_attest = kzalloc_obj(*uvcb_attest, GFP_KERNEL); if (!uvcb_attest) goto out; diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index bde6c9e59166..4cf82f83c175 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c @@ -104,7 +104,7 @@ static int vmcp_open(struct inode *inode, struct file *file) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - session = kmalloc(sizeof(*session), GFP_KERNEL); + session = kmalloc_obj(*session, GFP_KERNEL); if (!session) return -ENOMEM; diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index a226ff208eda..f855774687b2 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c @@ -107,7 +107,7 @@ static struct urdev *urdev_alloc(struct ccw_device *cdev) { struct urdev *urd; - urd = kzalloc(sizeof(struct urdev), GFP_KERNEL); + urd = kzalloc_obj(struct urdev, GFP_KERNEL); if (!urd) return NULL; urd->reclen = cdev->id.driver_info; @@ -225,8 +225,7 @@ static struct ccw1 *alloc_chan_prog(const char __user *ubuf, int rec_count, * That means we allocate room for CCWs to cover count/reclen * records plus a NOP. */ - cpa = kcalloc(rec_count + 1, sizeof(struct ccw1), - GFP_KERNEL | GFP_DMA); + cpa = kzalloc_objs(struct ccw1, rec_count + 1, GFP_KERNEL | GFP_DMA); if (!cpa) return ERR_PTR(-ENOMEM); @@ -397,7 +396,7 @@ static struct urfile *urfile_alloc(struct urdev *urd) { struct urfile *urf; - urf = kzalloc(sizeof(struct urfile), GFP_KERNEL); + urf = kzalloc_obj(struct urfile, GFP_KERNEL); if (!urf) return NULL; urf->urd = urd; @@ -606,7 +605,7 @@ static int verify_uri_device(struct urdev *urd) char *buf; int rc; - fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA); + fcb = kmalloc_obj(*fcb, GFP_KERNEL | GFP_DMA); if (!fcb) return -ENOMEM; @@ -665,7 +664,7 @@ static int get_uri_file_reclen(struct urdev *urd) struct file_control_block *fcb; int rc; - fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA); + fcb = kmalloc_obj(*fcb, GFP_KERNEL | GFP_DMA); if (!fcb) return -ENOMEM; rc = diag_read_next_file_info(fcb, 0); diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c index f5c59abba221..ecccd5f24a4e 100644 --- a/drivers/s390/cio/airq.c +++ b/drivers/s390/cio/airq.c @@ -130,7 +130,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags, struct airq_iv *iv; unsigned long size; - iv = kzalloc(sizeof(*iv), GFP_KERNEL); + iv = kzalloc_obj(*iv, GFP_KERNEL); if (!iv) goto out; iv->bits = bits; diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 185c99c5d4cc..c7d86cab984b 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -322,7 +322,7 @@ int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv, if (num_devices < 1) return -EINVAL; - gdev = kzalloc(struct_size(gdev, cdev, num_devices), GFP_KERNEL); + gdev = kzalloc_flex(*gdev, cdev, num_devices, GFP_KERNEL); if (!gdev) return -ENOMEM; diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index c10e2444507e..de07d03f1ed4 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c @@ -530,7 +530,7 @@ int chp_new(struct chp_id chpid) if (chp_is_registered(chpid)) goto out; - chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL); + chp = kzalloc_obj(struct channel_path, GFP_KERNEL); if (!chp) { ret = -ENOMEM; goto out; @@ -593,7 +593,7 @@ struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid) chp = chpid_to_chp(chpid); if (!chp) return NULL; - desc = kmalloc(sizeof(*desc), GFP_KERNEL); + desc = kmalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index ce992b2107cb..fcbb2906117f 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c @@ -81,7 +81,7 @@ static int chsc_subchannel_probe(struct subchannel *sch) CHSC_MSG(6, "Detected chsc subchannel 0.%x.%04x\n", sch->schid.ssid, sch->schid.sch_no); sch->isc = CHSC_SCH_ISC; - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (!private) return -ENOMEM; dev_set_drvdata(&sch->dev, private); @@ -295,7 +295,7 @@ static int chsc_ioctl_start(void __user *user_area) chsc_area = (void *)get_zeroed_page(GFP_KERNEL); if (!chsc_area) return -ENOMEM; - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) { ret = -ENOMEM; goto out_free; @@ -335,7 +335,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area) ret = -EBUSY; goto out_unlock; } - on_close_request = kzalloc(sizeof(*on_close_request), GFP_KERNEL); + on_close_request = kzalloc_obj(*on_close_request, GFP_KERNEL); if (!on_close_request) { ret = -ENOMEM; goto out_unlock; @@ -441,7 +441,7 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd) scpcd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scpcd_area) return -ENOMEM; - cd = kzalloc(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); if (!cd) { ret = -ENOMEM; goto out_free; @@ -503,7 +503,7 @@ static int chsc_ioctl_info_cu(void __user *user_cd) scucd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scucd_area) return -ENOMEM; - cd = kzalloc(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); if (!cd) { ret = -ENOMEM; goto out_free; @@ -566,7 +566,7 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud) sscud_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sscud_area) return -ENOMEM; - cud = kzalloc(sizeof(*cud), GFP_KERNEL); + cud = kzalloc_obj(*cud, GFP_KERNEL); if (!cud) { ret = -ENOMEM; goto out_free; @@ -628,7 +628,7 @@ static int chsc_ioctl_conf_info(void __user *user_ci) sci_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sci_area) return -ENOMEM; - ci = kzalloc(sizeof(*ci), GFP_KERNEL); + ci = kzalloc_obj(*ci, GFP_KERNEL); if (!ci) { ret = -ENOMEM; goto out_free; @@ -699,7 +699,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl) sccl_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sccl_area) return -ENOMEM; - ccl = kzalloc(sizeof(*ccl), GFP_KERNEL); + ccl = kzalloc_obj(*ccl, GFP_KERNEL); if (!ccl) { ret = -ENOMEM; goto out_free; @@ -755,7 +755,7 @@ static int chsc_ioctl_chpd(void __user *user_chpd) struct chsc_cpd_info *chpd; int ret; - chpd = kzalloc(sizeof(*chpd), GFP_KERNEL); + chpd = kzalloc_obj(*chpd, GFP_KERNEL); scpd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scpd_area || !chpd) { ret = -ENOMEM; @@ -799,7 +799,7 @@ static int chsc_ioctl_dcal(void __user *user_dcal) sdcal_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sdcal_area) return -ENOMEM; - dcal = kzalloc(sizeof(*dcal), GFP_KERNEL); + dcal = kzalloc_obj(*dcal, GFP_KERNEL); if (!dcal) { ret = -ENOMEM; goto out_free; diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index 7d035e4937ce..cbc0efe0d870 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -483,11 +483,11 @@ static int alloc_cmb(struct ccw_device *cdev) struct cmb_data *cmb_data; /* Allocate private cmb_data. */ - cmb_data = kzalloc(sizeof(struct cmb_data), GFP_KERNEL); + cmb_data = kzalloc_obj(struct cmb_data, GFP_KERNEL); if (!cmb_data) return -ENOMEM; - cmb_data->last_block = kzalloc(sizeof(struct cmb), GFP_KERNEL); + cmb_data->last_block = kzalloc_obj(struct cmb, GFP_KERNEL); if (!cmb_data->last_block) { kfree(cmb_data); return -ENOMEM; @@ -766,11 +766,11 @@ static int alloc_cmbe(struct ccw_device *cdev) if (!cmbe) return ret; - cmb_data = kzalloc(sizeof(*cmb_data), GFP_KERNEL); + cmb_data = kzalloc_obj(*cmb_data, GFP_KERNEL); if (!cmb_data) goto out_free; - cmb_data->last_block = kzalloc(sizeof(struct cmbe), GFP_KERNEL); + cmb_data->last_block = kzalloc_obj(struct cmbe, GFP_KERNEL); if (!cmb_data->last_block) goto out_free; diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index ac24e019020e..b6f943d6e30c 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -203,7 +203,7 @@ struct subchannel *css_alloc_subchannel(struct subchannel_id schid, if (ret < 0) return ERR_PTR(ret); - sch = kzalloc(sizeof(*sch), GFP_KERNEL | GFP_DMA); + sch = kzalloc_obj(*sch, GFP_KERNEL | GFP_DMA); if (!sch) return ERR_PTR(-ENOMEM); @@ -971,7 +971,7 @@ static int __init setup_css(int nr) struct channel_subsystem *css; int ret; - css = kzalloc(sizeof(*css), GFP_KERNEL); + css = kzalloc_obj(*css, GFP_KERNEL); if (!css) return -ENOMEM; @@ -1005,8 +1005,8 @@ static int __init setup_css(int nr) goto out_err; } - css->pseudo_subchannel = kzalloc(sizeof(*css->pseudo_subchannel), - GFP_KERNEL); + css->pseudo_subchannel = kzalloc_obj(*css->pseudo_subchannel, + GFP_KERNEL); if (!css->pseudo_subchannel) { device_unregister(&css->device); ret = -ENOMEM; diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 602f36102c7c..4e6efdcf5617 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -686,13 +686,13 @@ static struct ccw_device * io_subchannel_allocate_dev(struct subchannel *sch) struct gen_pool *dma_pool; int ret; - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) { ret = -ENOMEM; goto err_cdev; } - cdev->private = kzalloc(sizeof(struct ccw_device_private), - GFP_KERNEL | GFP_DMA); + cdev->private = kzalloc_obj(struct ccw_device_private, + GFP_KERNEL | GFP_DMA); if (!cdev->private) { ret = -ENOMEM; goto err_priv; @@ -1060,7 +1060,7 @@ static int io_subchannel_probe(struct subchannel *sch) if (rc) goto out_schedule; /* Allocate I/O subchannel private data. */ - io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); + io_priv = kzalloc_obj(*io_priv, GFP_KERNEL | GFP_DMA); if (!io_priv) goto out_schedule; @@ -1644,7 +1644,7 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) if (IS_ERR(sch)) return ERR_CAST(sch); - io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); + io_priv = kzalloc_obj(*io_priv, GFP_KERNEL | GFP_DMA); if (!io_priv) goto err_priv; io_priv->dma_area = dma_alloc_coherent(&sch->dev, diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c index d60f7d80863a..7ce374313730 100644 --- a/drivers/s390/cio/eadm_sch.c +++ b/drivers/s390/cio/eadm_sch.c @@ -215,7 +215,7 @@ static int eadm_subchannel_probe(struct subchannel *sch) struct eadm_private *private; int ret; - private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA); + private = kzalloc_obj(*private, GFP_KERNEL | GFP_DMA); if (!private) return -ENOMEM; diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c index 4fb900f2d3d9..bbbf89a65445 100644 --- a/drivers/s390/cio/qdio_debug.c +++ b/drivers/s390/cio/qdio_debug.c @@ -81,7 +81,7 @@ int qdio_allocate_dbf(struct qdio_irq *irq_ptr) } debug_set_level(irq_ptr->debug_area, DBF_WARN); DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created"); - new_entry = kzalloc(sizeof(struct qdio_dbf_entry), GFP_KERNEL); + new_entry = kzalloc_obj(struct qdio_dbf_entry, GFP_KERNEL); if (!new_entry) { debug_unregister(irq_ptr->debug_area); return -ENOMEM; diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 7dd967165025..7e594a800525 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c @@ -965,7 +965,7 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs, if (!irq_ptr) return -ENOMEM; - irq_ptr->ccw = kmalloc(sizeof(*irq_ptr->ccw), GFP_KERNEL | GFP_DMA); + irq_ptr->ccw = kmalloc_obj(*irq_ptr->ccw, GFP_KERNEL | GFP_DMA); if (!irq_ptr->ccw) goto err_ccw; diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c index f931954910c5..d3e263fedbca 100644 --- a/drivers/s390/cio/qdio_thinint.c +++ b/drivers/s390/cio/qdio_thinint.c @@ -204,8 +204,8 @@ int __init qdio_thinint_init(void) { int rc; - q_indicators = kcalloc(TIQDIO_NR_INDICATORS, sizeof(struct indicator_t), - GFP_KERNEL); + q_indicators = kzalloc_objs(struct indicator_t, TIQDIO_NR_INDICATORS, + GFP_KERNEL); if (!q_indicators) return -ENOMEM; diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c index 9b4da237a0ed..22da5887e0ab 100644 --- a/drivers/s390/cio/scm.c +++ b/drivers/s390/cio/scm.c @@ -207,7 +207,7 @@ static int scm_add(struct chsc_scm_info *scm_info, size_t num) put_device(&scmdev->dev); continue; } - scmdev = kzalloc(sizeof(*scmdev), GFP_KERNEL); + scmdev = kzalloc_obj(*scmdev, GFP_KERNEL); if (!scmdev) return -ENODEV; scmdev_setup(scmdev, sale, scm_info->is, scm_info->mbc); diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index 5f6e10225627..62c9c005b542 100644 --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c @@ -65,11 +65,11 @@ static int page_array_alloc(struct page_array *pa, unsigned int len) pa->pa_nr = len; - pa->pa_iova = kcalloc(len, sizeof(*pa->pa_iova), GFP_KERNEL); + pa->pa_iova = kzalloc_objs(*pa->pa_iova, len, GFP_KERNEL); if (!pa->pa_iova) return -ENOMEM; - pa->pa_page = kcalloc(len, sizeof(*pa->pa_page), GFP_KERNEL); + pa->pa_page = kzalloc_objs(*pa->pa_page, len, GFP_KERNEL); if (!pa->pa_page) { kfree(pa->pa_iova); return -ENOMEM; @@ -319,15 +319,15 @@ static struct ccwchain *ccwchain_alloc(struct channel_program *cp, int len) { struct ccwchain *chain; - chain = kzalloc(sizeof(*chain), GFP_KERNEL); + chain = kzalloc_obj(*chain, GFP_KERNEL); if (!chain) return NULL; - chain->ch_ccw = kcalloc(len, sizeof(*chain->ch_ccw), GFP_DMA | GFP_KERNEL); + chain->ch_ccw = kzalloc_objs(*chain->ch_ccw, len, GFP_DMA | GFP_KERNEL); if (!chain->ch_ccw) goto out_err; - chain->ch_pa = kcalloc(len, sizeof(*chain->ch_pa), GFP_KERNEL); + chain->ch_pa = kzalloc_objs(*chain->ch_pa, len, GFP_KERNEL); if (!chain->ch_pa) goto out_err; @@ -516,7 +516,7 @@ static dma64_t *get_guest_idal(struct ccw1 *ccw, struct channel_program *cp, int int idaw_mask = ~(idaw_size - 1); int i, ret; - idaws = kcalloc(idaw_nr, sizeof(*idaws), GFP_DMA | GFP_KERNEL); + idaws = kzalloc_objs(*idaws, idaw_nr, GFP_DMA | GFP_KERNEL); if (!idaws) return ERR_PTR(-ENOMEM); diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index 6ff5c9cfb7ed..db0bed2db4eb 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c @@ -171,7 +171,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch) return -ENODEV; } - parent = kzalloc(sizeof(*parent), GFP_KERNEL); + parent = kzalloc_obj(*parent, GFP_KERNEL); if (!parent) return -ENOMEM; @@ -281,7 +281,7 @@ static void vfio_ccw_queue_crw(struct vfio_ccw_private *private, * carry on. The guest will either see a later one or * learn when it issues its own store subchannel. */ - crw = kzalloc(sizeof(*crw), GFP_ATOMIC); + crw = kzalloc_obj(*crw, GFP_ATOMIC); if (!crw) return; diff --git a/drivers/s390/cio/vfio_ccw_ops.c b/drivers/s390/cio/vfio_ccw_ops.c index a596f6013019..ef7becf744da 100644 --- a/drivers/s390/cio/vfio_ccw_ops.c +++ b/drivers/s390/cio/vfio_ccw_ops.c @@ -55,8 +55,8 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev) INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo); INIT_WORK(&private->crw_work, vfio_ccw_crw_todo); - private->cp.guest_cp = kcalloc(CCWCHAIN_LEN_MAX, sizeof(struct ccw1), - GFP_KERNEL); + private->cp.guest_cp = kzalloc_objs(struct ccw1, CCWCHAIN_LEN_MAX, + GFP_KERNEL); if (!private->cp.guest_cp) goto out_free_private; diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c index 8b0ad6f582ec..bf6ae6e099e9 100644 --- a/drivers/s390/crypto/ap_card.c +++ b/drivers/s390/crypto/ap_card.c @@ -233,7 +233,7 @@ struct ap_card *ap_card_create(int id, struct ap_tapq_hwinfo hwinfo, { struct ap_card *ac; - ac = kzalloc(sizeof(*ac), GFP_KERNEL); + ac = kzalloc_obj(*ac, GFP_KERNEL); if (!ac) return NULL; ac->ap_dev.device.release = ap_card_device_release; diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c index a80ab87cad62..cf349627a19c 100644 --- a/drivers/s390/crypto/ap_queue.c +++ b/drivers/s390/crypto/ap_queue.c @@ -1183,7 +1183,7 @@ struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac) { struct ap_queue *aq; - aq = kzalloc(sizeof(*aq), GFP_KERNEL); + aq = kzalloc_obj(*aq, GFP_KERNEL); if (!aq) return NULL; aq->card = ac; diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c index ad1cd699f53b..0f0938cd96d2 100644 --- a/drivers/s390/crypto/pkey_api.c +++ b/drivers/s390/crypto/pkey_api.c @@ -223,7 +223,7 @@ static int pkey_ioctl_findcard(struct pkey_findcard __user *ufc) return -EFAULT; nr_apqns = MAXAPQNSINLIST; - apqns = kmalloc_array(nr_apqns, sizeof(struct pkey_apqn), GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); if (!apqns) return -ENOMEM; @@ -569,9 +569,7 @@ static int pkey_ioctl_apqns4k(struct pkey_apqns4key __user *uak) return -EFAULT; nr_apqns = kak.apqn_entries; if (nr_apqns) { - apqns = kmalloc_array(nr_apqns, - sizeof(struct pkey_apqn), - GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); if (!apqns) return -ENOMEM; } @@ -620,9 +618,7 @@ static int pkey_ioctl_apqns4kt(struct pkey_apqns4keytype __user *uat) return -EFAULT; nr_apqns = kat.apqn_entries; if (nr_apqns) { - apqns = kmalloc_array(nr_apqns, - sizeof(struct pkey_apqn), - GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); if (!apqns) return -ENOMEM; } diff --git a/drivers/s390/crypto/pkey_uv.c b/drivers/s390/crypto/pkey_uv.c index 6cd3c49384b5..a21594c64be6 100644 --- a/drivers/s390/crypto/pkey_uv.c +++ b/drivers/s390/crypto/pkey_uv.c @@ -291,7 +291,7 @@ static int __init pkey_uv_init(void) if (!test_bit_inv(BIT_UVC_CMD_RETR_SECRET, uv_info.inst_calls_list)) return -ENODEV; - uv_list = kmalloc(sizeof(*uv_list), GFP_KERNEL); + uv_list = kmalloc_obj(*uv_list, GFP_KERNEL); if (!uv_list) return -ENOMEM; diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c index 67a807e2e75b..5146a3db53fd 100644 --- a/drivers/s390/crypto/vfio_ap_drv.c +++ b/drivers/s390/crypto/vfio_ap_drv.c @@ -96,7 +96,7 @@ static int vfio_ap_matrix_dev_create(void) if (ret) goto bus_register_err; - matrix_dev = kzalloc(sizeof(*matrix_dev), GFP_KERNEL); + matrix_dev = kzalloc_obj(*matrix_dev, GFP_KERNEL); if (!matrix_dev) { ret = -ENOMEM; goto matrix_alloc_err; diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index 48da32ad0493..b19068ffcdc8 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -2424,7 +2424,7 @@ int vfio_ap_mdev_probe_queue(struct ap_device *apdev) if (ret) return ret; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) { ret = -ENOMEM; goto err_remove_group; diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index c796773fbce8..75e1d69346ae 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -397,7 +397,7 @@ static int zcdn_create(const char *name) } /* alloc and prepare a new zcdn device */ - zcdndev = kzalloc(sizeof(*zcdndev), GFP_KERNEL); + zcdndev = kzalloc_obj(*zcdndev, GFP_KERNEL); if (!zcdndev) { rc = -ENOMEM; goto unlockout; @@ -1065,7 +1065,7 @@ static long _zcrypt_send_ep11_cprb(u32 xflags, struct ap_perms *perms, rc = -ENOMEM; if (target_num != 0) { if (userspace) { - targets = kcalloc(target_num, sizeof(*targets), GFP_KERNEL); + targets = kzalloc_objs(*targets, target_num, GFP_KERNEL); if (!targets) goto out; if (copy_from_user(targets, xcrb->targets, @@ -1627,9 +1627,8 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd, size_t total_size = MAX_ZDEV_ENTRIES_EXT * sizeof(struct zcrypt_device_status_ext); - device_status = kvcalloc(MAX_ZDEV_ENTRIES_EXT, - sizeof(struct zcrypt_device_status_ext), - GFP_KERNEL); + device_status = kvzalloc_objs(struct zcrypt_device_status_ext, + MAX_ZDEV_ENTRIES_EXT, GFP_KERNEL); if (!device_status) return -ENOMEM; zcrypt_device_status_mask_ext(device_status, diff --git a/drivers/s390/crypto/zcrypt_card.c b/drivers/s390/crypto/zcrypt_card.c index 6dea702a5cac..f905132ebad4 100644 --- a/drivers/s390/crypto/zcrypt_card.c +++ b/drivers/s390/crypto/zcrypt_card.c @@ -90,7 +90,7 @@ static ssize_t online_store(struct device *dev, list_for_each_entry(zq, &zc->zqueues, list) maxzqs++; if (maxzqs > 0) - zq_uelist = kcalloc(maxzqs + 1, sizeof(*zq_uelist), GFP_ATOMIC); + zq_uelist = kzalloc_objs(*zq_uelist, maxzqs + 1, GFP_ATOMIC); list_for_each_entry(zq, &zc->zqueues, list) if (zcrypt_queue_force_online(zq, online)) if (zq_uelist) { @@ -138,7 +138,7 @@ struct zcrypt_card *zcrypt_card_alloc(void) { struct zcrypt_card *zc; - zc = kzalloc(sizeof(*zc), GFP_KERNEL); + zc = kzalloc_obj(*zc, GFP_KERNEL); if (!zc) return NULL; INIT_LIST_HEAD(&zc->list); diff --git a/drivers/s390/crypto/zcrypt_queue.c b/drivers/s390/crypto/zcrypt_queue.c index a173d32eb6e8..73a5987499c9 100644 --- a/drivers/s390/crypto/zcrypt_queue.c +++ b/drivers/s390/crypto/zcrypt_queue.c @@ -115,7 +115,7 @@ struct zcrypt_queue *zcrypt_queue_alloc(size_t reply_buf_size) { struct zcrypt_queue *zq; - zq = kzalloc(sizeof(*zq), GFP_KERNEL); + zq = kzalloc_obj(*zq, GFP_KERNEL); if (!zq) return NULL; zq->reply.msg = kmalloc(reply_buf_size, GFP_KERNEL); diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 3d7ccf2366a0..22fbe94e5a7e 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c @@ -1268,7 +1268,7 @@ static int ctcm_probe_device(struct ccwgroup_device *cgdev) if (!get_device(&cgdev->dev)) return -ENODEV; - priv = kzalloc(sizeof(struct ctcm_priv), GFP_KERNEL); + priv = kzalloc_obj(struct ctcm_priv, GFP_KERNEL); if (!priv) { CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, "%s: memory allocation failure", @@ -1307,7 +1307,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, "%s(%s), type %d, proto %d", __func__, dev_name(&cdev->dev), type, priv->protocol); - ch = kzalloc(sizeof(struct channel), GFP_KERNEL); + ch = kzalloc_obj(struct channel, GFP_KERNEL); if (ch == NULL) return -ENOMEM; @@ -1327,7 +1327,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, } else ccw_num = 8; - ch->ccw = kcalloc(ccw_num, sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); + ch->ccw = kzalloc_objs(struct ccw1, ccw_num, GFP_KERNEL | GFP_DMA); if (ch->ccw == NULL) goto nomem_return; @@ -1408,7 +1408,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, fsm_newstate(ch->fsm, CTC_STATE_IDLE); - ch->irb = kzalloc(sizeof(struct irb), GFP_KERNEL); + ch->irb = kzalloc_obj(struct irb, GFP_KERNEL); if (ch->irb == NULL) goto nomem_return; diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c index 0f329fb514ee..35662bd25c3c 100644 --- a/drivers/s390/net/ctcm_mpc.c +++ b/drivers/s390/net/ctcm_mpc.c @@ -1163,7 +1163,7 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) skb_pull(pskb, new_len); /* point to next PDU */ } } else { - mpcginfo = kmalloc(sizeof(struct mpcg_info), GFP_ATOMIC); + mpcginfo = kmalloc_obj(struct mpcg_info, GFP_ATOMIC); if (mpcginfo == NULL) goto done; @@ -1259,7 +1259,7 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv) CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_INFO, "Enter %s(%p)", CTCM_FUNTAIL, priv); - grp = kzalloc(sizeof(struct mpc_group), GFP_KERNEL); + grp = kzalloc_obj(struct mpc_group, GFP_KERNEL); if (grp == NULL) return NULL; diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c index 58f8e2fb6d54..9b8622aef807 100644 --- a/drivers/s390/net/fsm.c +++ b/drivers/s390/net/fsm.c @@ -23,7 +23,7 @@ init_fsm(char *name, const char **state_names, const char **event_names, int nr_ fsm_function_t *m; fsm *f; - this = kzalloc(sizeof(fsm_instance), order); + this = kzalloc_obj(fsm_instance, order); if (this == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc instance\n", name); @@ -32,7 +32,7 @@ init_fsm(char *name, const char **state_names, const char **event_names, int nr_ strscpy(this->name, name, sizeof(this->name)); init_waitqueue_head(&this->wait_q); - f = kzalloc(sizeof(fsm), order); + f = kzalloc_obj(fsm, order); if (f == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc fsm\n", name); @@ -45,7 +45,7 @@ init_fsm(char *name, const char **state_names, const char **event_names, int nr_ f->state_names = state_names; this->f = f; - m = kcalloc(nr_states*nr_events, sizeof(fsm_function_t), order); + m = kzalloc_objs(fsm_function_t, nr_states * nr_events, order); if (m == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc jumptable\n", name); diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 8b8e4f06be0f..c9808772d621 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -598,7 +598,7 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct ism_dev *ism; int ret; - ism = kzalloc(sizeof(*ism), GFP_KERNEL); + ism = kzalloc_obj(*ism, GFP_KERNEL); if (!ism) return -ENOMEM; diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 1c80e8ca67b5..41041abd3d1b 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -225,7 +225,7 @@ static struct qeth_buffer_pool_entry *qeth_alloc_pool_entry(unsigned int pages) struct qeth_buffer_pool_entry *entry; unsigned int i; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -324,7 +324,7 @@ static void qeth_free_qdio_queue(struct qeth_qdio_q *q) static struct qeth_qdio_q *qeth_alloc_qdio_queue(void) { - struct qeth_qdio_q *q = kzalloc(sizeof(*q), GFP_KERNEL); + struct qeth_qdio_q *q = kzalloc_obj(*q, GFP_KERNEL); int i; if (!q) @@ -559,7 +559,7 @@ static void qeth_add_local_addrs4(struct qeth_card *card, if (duplicate) continue; - addr = kmalloc(sizeof(*addr), GFP_ATOMIC); + addr = kmalloc_obj(*addr, GFP_ATOMIC); if (!addr) { dev_err(&card->gdev->dev, "Failed to allocate local addr object. Traffic to %pI4 might suffer.\n", @@ -602,7 +602,7 @@ static void qeth_add_local_addrs6(struct qeth_card *card, if (duplicate) continue; - addr = kmalloc(sizeof(*addr), GFP_ATOMIC); + addr = kmalloc_obj(*addr, GFP_ATOMIC); if (!addr) { dev_err(&card->gdev->dev, "Failed to allocate local addr object. Traffic to %pI6c might suffer.\n", @@ -930,7 +930,7 @@ static struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel, if (length > QETH_BUFSIZE) return NULL; - iob = kzalloc(sizeof(*iob), GFP_KERNEL); + iob = kzalloc_obj(*iob, GFP_KERNEL); if (!iob) return NULL; @@ -1626,7 +1626,7 @@ static struct qeth_card *qeth_alloc_card(struct ccwgroup_device *gdev) struct qeth_card *card; QETH_DBF_TEXT(SETUP, 2, "alloccrd"); - card = kzalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc_obj(*card, GFP_KERNEL); if (!card) goto out; QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); @@ -1837,8 +1837,8 @@ static enum qeth_discipline_id qeth_vm_detect_layer(struct qeth_card *card) if (rc) goto out; - request = kzalloc(sizeof(*request), GFP_KERNEL | GFP_DMA); - response = kzalloc(sizeof(*response), GFP_KERNEL | GFP_DMA); + request = kzalloc_obj(*request, GFP_KERNEL | GFP_DMA); + response = kzalloc_obj(*response, GFP_KERNEL | GFP_DMA); if (!request || !response) { rc = -ENOMEM; goto out; @@ -2591,7 +2591,7 @@ static void qeth_free_output_queue(struct qeth_qdio_out_q *q) static struct qeth_qdio_out_q *qeth_alloc_output_queue(void) { - struct qeth_qdio_out_q *q = kzalloc(sizeof(*q), GFP_KERNEL); + struct qeth_qdio_out_q *q = kzalloc_obj(*q, GFP_KERNEL); unsigned int i; if (!q) @@ -4953,8 +4953,8 @@ int qeth_vm_request_mac(struct qeth_card *card) QETH_CARD_TEXT(card, 2, "vmreqmac"); - request = kzalloc(sizeof(*request), GFP_KERNEL | GFP_DMA); - response = kzalloc(sizeof(*response), GFP_KERNEL | GFP_DMA); + request = kzalloc_obj(*request, GFP_KERNEL | GFP_DMA); + response = kzalloc_obj(*response, GFP_KERNEL | GFP_DMA); if (!request || !response) { rc = -ENOMEM; goto out; @@ -6249,7 +6249,7 @@ static int qeth_add_dbf_entry(struct qeth_card *card, char *name) } if (debug_register_view(card->debug, &debug_hex_ascii_view)) goto err_dbg; - new_entry = kzalloc(sizeof(struct qeth_dbf_entry), GFP_KERNEL); + new_entry = kzalloc_obj(struct qeth_dbf_entry, GFP_KERNEL); if (!new_entry) goto err_dbg; strscpy(new_entry->dbf_name, name, sizeof(new_entry->dbf_name)); diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 7498a83b1f06..a9e7d1d637a2 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -442,7 +442,7 @@ static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha) } } - mac = kzalloc(sizeof(struct qeth_mac), GFP_ATOMIC); + mac = kzalloc_obj(struct qeth_mac, GFP_ATOMIC); if (!mac) return; @@ -827,7 +827,7 @@ static int qeth_l2_br2dev_queue_work(struct net_device *brdev, struct qeth_l2_br2dev_event_work *worker_data; struct qeth_card *card; - worker_data = kzalloc(sizeof(*worker_data), GFP_ATOMIC); + worker_data = kzalloc_obj(*worker_data, GFP_ATOMIC); if (!worker_data) return -ENOMEM; INIT_WORK(&worker_data->work, qeth_l2_br2dev_worker); @@ -1348,7 +1348,7 @@ static void qeth_bridge_state_change(struct qeth_card *card, return; } - data = kzalloc(sizeof(*data), GFP_ATOMIC); + data = kzalloc_obj(*data, GFP_ATOMIC); if (!data) { QETH_CARD_TEXT(card, 2, "BPSalloc"); return; diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 027bc346232f..1542bfc9f561 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -2163,7 +2163,7 @@ static int qeth_l3_ip6_event(struct notifier_block *this, if (!qeth_is_supported(card, IPA_IPV6)) return NOTIFY_DONE; - ip_work = kmalloc(sizeof(*ip_work), GFP_ATOMIC); + ip_work = kmalloc_obj(*ip_work, GFP_ATOMIC); if (!ip_work) return NOTIFY_DONE; diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index a6b64228ead2..db0985fe35b3 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c @@ -431,7 +431,7 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count, if (rc) return rc; - ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL); + ipatoe = kzalloc_obj(struct qeth_ipato_entry, GFP_KERNEL); if (!ipatoe) return -ENOMEM; diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 3dadaacc42a6..645d7edcbf2d 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -92,7 +92,7 @@ int smsg_register_callback(const char *prefix, { struct smsg_callback *cb; - cb = kmalloc(sizeof(struct smsg_callback), GFP_KERNEL); + cb = kmalloc_obj(struct smsg_callback, GFP_KERNEL); if (!cb) return -ENOMEM; cb->prefix = prefix; diff --git a/drivers/s390/net/smsgiucv_app.c b/drivers/s390/net/smsgiucv_app.c index 1bd0370460cd..c53305b4cb25 100644 --- a/drivers/s390/net/smsgiucv_app.c +++ b/drivers/s390/net/smsgiucv_app.c @@ -69,7 +69,7 @@ static struct smsg_app_event *smsg_app_event_alloc(const char *from, { struct smsg_app_event *ev; - ev = kzalloc(sizeof(*ev), GFP_ATOMIC); + ev = kzalloc_obj(*ev, GFP_ATOMIC); if (!ev) return NULL; diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 01f927ae61b5..f8435ea9a967 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -344,7 +344,7 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) if (!get_device(&ccw_device->dev)) return ERR_PTR(-ENODEV); - adapter = kzalloc(sizeof(struct zfcp_adapter), GFP_KERNEL); + adapter = kzalloc_obj(struct zfcp_adapter, GFP_KERNEL); if (!adapter) { put_device(&ccw_device->dev); return ERR_PTR(-ENOMEM); @@ -518,7 +518,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, goto err_put; } - port = kzalloc(sizeof(struct zfcp_port), GFP_KERNEL); + port = kzalloc_obj(struct zfcp_port, GFP_KERNEL); if (!port) goto err_put; diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 6b5561c54e2f..37938e6903ef 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -816,7 +816,7 @@ int zfcp_dbf_adapter_register(struct zfcp_adapter *adapter) char name[DEBUG_MAX_NAME_LEN]; struct zfcp_dbf *dbf; - dbf = kzalloc(sizeof(struct zfcp_dbf), GFP_KERNEL); + dbf = kzalloc_obj(struct zfcp_dbf, GFP_KERNEL); if (!dbf) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_diag.c b/drivers/s390/scsi/zfcp_diag.c index 4d2d89d9c15a..e8c9077b4e96 100644 --- a/drivers/s390/scsi/zfcp_diag.c +++ b/drivers/s390/scsi/zfcp_diag.c @@ -36,7 +36,7 @@ int zfcp_diag_adapter_setup(struct zfcp_adapter *const adapter) struct zfcp_diag_adapter *diag; struct zfcp_diag_header *hdr; - diag = kzalloc(sizeof(*diag), GFP_KERNEL); + diag = kzalloc_obj(*diag, GFP_KERNEL); if (diag == NULL) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 78ca394e1195..c212ca0924f8 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -128,7 +128,7 @@ void zfcp_fc_enqueue_event(struct zfcp_adapter *adapter, { struct zfcp_fc_event *event; - event = kmalloc(sizeof(struct zfcp_fc_event), GFP_ATOMIC); + event = kmalloc_obj(struct zfcp_fc_event, GFP_ATOMIC); if (!event) return; @@ -1116,7 +1116,7 @@ int zfcp_fc_gs_setup(struct zfcp_adapter *adapter) { struct zfcp_fc_wka_ports *wka_ports; - wka_ports = kzalloc(sizeof(struct zfcp_fc_wka_ports), GFP_KERNEL); + wka_ports = kzalloc_obj(struct zfcp_fc_wka_ports, GFP_KERNEL); if (!wka_ports) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9418086368c3..d407f16e77ef 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -806,7 +806,7 @@ static struct zfcp_fsf_req *zfcp_fsf_alloc(mempool_t *pool) if (likely(pool)) req = mempool_alloc(pool, GFP_ATOMIC); else - req = kmalloc(sizeof(*req), GFP_ATOMIC); + req = kmalloc_obj(*req, GFP_ATOMIC); if (unlikely(!req)) return NULL; diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index e15a1eabe42d..3febefc80ccf 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -549,7 +549,7 @@ int zfcp_qdio_setup(struct zfcp_adapter *adapter) { struct zfcp_qdio *qdio; - qdio = kzalloc(sizeof(struct zfcp_qdio), GFP_KERNEL); + qdio = kzalloc_obj(struct zfcp_qdio, GFP_KERNEL); if (!qdio) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_reqlist.h b/drivers/s390/scsi/zfcp_reqlist.h index 59fbb1b128cb..2037424f9981 100644 --- a/drivers/s390/scsi/zfcp_reqlist.h +++ b/drivers/s390/scsi/zfcp_reqlist.h @@ -42,7 +42,7 @@ static inline struct zfcp_reqlist *zfcp_reqlist_alloc(void) size_t i; struct zfcp_reqlist *rl; - rl = kzalloc(sizeof(struct zfcp_reqlist), GFP_KERNEL); + rl = kzalloc_obj(struct zfcp_reqlist, GFP_KERNEL); if (!rl) return NULL; diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 634bd8dceedd..f78df15b384a 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -542,7 +542,7 @@ zfcp_scsi_init_fc_host_stats(struct zfcp_adapter *adapter) struct fc_host_statistics *fc_stats; if (!adapter->fc_stats) { - fc_stats = kmalloc(sizeof(*fc_stats), GFP_KERNEL); + fc_stats = kmalloc_obj(*fc_stats, GFP_KERNEL); if (!fc_stats) return NULL; adapter->fc_stats = fc_stats; /* freed in adapter_release */ @@ -622,7 +622,7 @@ zfcp_scsi_get_fc_host_stats(struct Scsi_Host *host) if (!fc_stats) return NULL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; @@ -651,7 +651,7 @@ static void zfcp_scsi_reset_fc_host_stats(struct Scsi_Host *shost) int ret; adapter = (struct zfcp_adapter *)shost->hostdata[0]; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return; diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 10a3840b2b6b..33ea87286c35 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c @@ -708,7 +708,7 @@ static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev, if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) return -EOPNOTSUPP; - qtcb_port = kzalloc(sizeof(struct fsf_qtcb_bottom_port), GFP_KERNEL); + qtcb_port = kzalloc_obj(struct fsf_qtcb_bottom_port, GFP_KERNEL); if (!qtcb_port) return -ENOMEM; @@ -733,8 +733,7 @@ static int zfcp_sysfs_adapter_ex_config(struct device *dev, if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) return -EOPNOTSUPP; - qtcb_config = kzalloc(sizeof(struct fsf_qtcb_bottom_config), - GFP_KERNEL); + qtcb_config = kzalloc_obj(struct fsf_qtcb_bottom_config, GFP_KERNEL); if (!qtcb_config) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c index 4ef2a635d34f..0f47643cd5d9 100644 --- a/drivers/s390/scsi/zfcp_unit.c +++ b/drivers/s390/scsi/zfcp_unit.c @@ -137,7 +137,7 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) goto out; } - unit = kzalloc(sizeof(struct zfcp_unit), GFP_KERNEL); + unit = kzalloc_obj(struct zfcp_unit, GFP_KERNEL); if (!unit) { retval = -ENOMEM; goto out; diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 1653cc668dcf..ae36a1f410a5 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -277,7 +277,7 @@ static struct airq_info *new_airq_info(int index) struct airq_info *info; int rc; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return NULL; rwlock_init(&info->lock); @@ -566,7 +566,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev, notify = virtio_ccw_kvm_notify; /* Allocate queue. */ - info = kzalloc(sizeof(struct virtio_ccw_vq_info), GFP_KERNEL); + info = kzalloc_obj(struct virtio_ccw_vq_info, GFP_KERNEL); if (!info) { dev_warn(&vcdev->cdev->dev, "no info\n"); err = -ENOMEM; @@ -1370,7 +1370,7 @@ static int virtio_ccw_online(struct ccw_device *cdev) struct virtio_ccw_device *vcdev; unsigned long flags; - vcdev = kzalloc(sizeof(*vcdev), GFP_KERNEL); + vcdev = kzalloc_obj(*vcdev, GFP_KERNEL); if (!vcdev) { dev_warn(&cdev->dev, "Could not get memory for virtio\n"); ret = -ENOMEM; diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index 23af4edd295b..9f9cb764d8be 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c @@ -448,7 +448,7 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op, { struct bbc_cpu_temperature *tp; - tp = kzalloc(sizeof(*tp), GFP_KERNEL); + tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) return; @@ -496,7 +496,7 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op, { struct bbc_fan_control *fp; - fp = kzalloc(sizeof(*fp), GFP_KERNEL); + fp = kzalloc_obj(*fp, GFP_KERNEL); if (!fp) return; diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 90e71ce4bab8..3a4b36514485 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -92,7 +92,7 @@ struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_de struct bbc_i2c_client *client; const u32 *reg; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return NULL; client->bp = bp; @@ -298,7 +298,7 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index struct device_node *dp; int entry; - bp = kzalloc(sizeof(*bp), GFP_KERNEL); + bp = kzalloc_obj(*bp, GFP_KERNEL); if (!bp) return NULL; diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 8643947fee8e..77de0d987d44 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -666,7 +666,7 @@ static int openprom_open(struct inode * inode, struct file * file) { DATA *data; - data = kmalloc(sizeof(DATA), GFP_KERNEL); + data = kmalloc_obj(DATA, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c index a536dd6f4f7c..ff31511a6c85 100644 --- a/drivers/sbus/char/oradax.c +++ b/drivers/sbus/char/oradax.c @@ -643,12 +643,11 @@ static int dax_open(struct inode *inode, struct file *f) struct dax_ctx *ctx = NULL; int i; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (ctx == NULL) goto done; - ctx->ccb_buf = kcalloc(DAX_MAX_CCBS, sizeof(struct dax_ccb), - GFP_KERNEL); + ctx->ccb_buf = kzalloc_objs(struct dax_ccb, DAX_MAX_CCBS, GFP_KERNEL); if (ctx->ccb_buf == NULL) goto done; diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index e3dec78f51e9..e9a28ab02ddb 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -348,7 +348,7 @@ static int uctrl_probe(struct platform_device *op) struct uctrl_driver *p; int err = -ENOMEM; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { printk(KERN_ERR "uctrl: Unable to allocate device struct.\n"); goto out; diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index e64a9a18ec6e..35bc55f8195d 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -1184,7 +1184,7 @@ static int twa_initialize_device_extension(TW_Device_Extension *tw_dev) } /* Allocate event info space */ - tw_dev->event_queue[0] = kcalloc(TW_Q_LENGTH, sizeof(TW_Event), GFP_KERNEL); + tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH, GFP_KERNEL); if (!tw_dev->event_queue[0]) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); goto out; diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index fde12475b712..cbc3af2694cb 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -1052,7 +1052,7 @@ static int twl_initialize_device_extension(TW_Device_Extension *tw_dev) } /* Allocate event info space */ - tw_dev->event_queue[0] = kcalloc(TW_Q_LENGTH, sizeof(TW_Event), GFP_KERNEL); + tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH, GFP_KERNEL); if (!tw_dev->event_queue[0]) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0xc, "Event info memory allocation failed"); goto out; diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 860538c6f8cb..40d640dedfdc 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -2020,8 +2020,8 @@ NCR_700_set_offset(struct scsi_target *STp, int offset) STATIC int NCR_700_sdev_init(struct scsi_device *SDp) { - SDp->hostdata = kzalloc(sizeof(struct NCR_700_Device_Parameters), - GFP_KERNEL); + SDp->hostdata = kzalloc_obj(struct NCR_700_Device_Parameters, + GFP_KERNEL); if (!SDp->hostdata) return -ENOMEM; diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 49929d0339fa..1152a0151545 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -2214,15 +2214,15 @@ static int __init blogic_init(void) if (blogic_probe_options.noprobe) return -ENODEV; blogic_probeinfo_list = - kcalloc(BLOGIC_MAX_ADAPTERS, sizeof(struct blogic_probeinfo), - GFP_KERNEL); + kzalloc_objs(struct blogic_probeinfo, BLOGIC_MAX_ADAPTERS, + GFP_KERNEL); if (blogic_probeinfo_list == NULL) { blogic_err("BusLogic: Unable to allocate Probe Info List\n", NULL); return -ENOMEM; } - adapter = kzalloc(sizeof(struct blogic_adapter), GFP_KERNEL); + adapter = kzalloc_obj(struct blogic_adapter, GFP_KERNEL); if (adapter == NULL) { kfree(blogic_probeinfo_list); blogic_err("BusLogic: Unable to allocate Prototype Host Adapter\n", NULL); diff --git a/drivers/scsi/a4000t.c b/drivers/scsi/a4000t.c index 75b43047a155..cf7d1f867081 100644 --- a/drivers/scsi/a4000t.c +++ b/drivers/scsi/a4000t.c @@ -47,8 +47,7 @@ static int __init amiga_a4000t_scsi_probe(struct platform_device *pdev) "A4000T builtin SCSI")) return -EBUSY; - hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), - GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); if (!hostdata) { dev_err(&pdev->dev, "Failed to allocate host data\n"); goto out_release; diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 0be719f38377..6df882e264f6 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -492,8 +492,8 @@ int aac_get_containers(struct aac_dev *dev) fsa_dev_ptr = dev->fsa_dev; - dev->fsa_dev = kcalloc(maximum_num_containers, - sizeof(*fsa_dev_ptr), GFP_KERNEL); + dev->fsa_dev = kzalloc_objs(*fsa_dev_ptr, + maximum_num_containers, GFP_KERNEL); kfree(fsa_dev_ptr); fsa_dev_ptr = NULL; @@ -820,7 +820,7 @@ int aac_probe_container(struct aac_dev *dev, int cid) { struct aac_cmd_priv *cmd_priv; struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd) + sizeof(*cmd_priv), GFP_KERNEL); - struct scsi_device *scsidev = kzalloc(sizeof(*scsidev), GFP_KERNEL); + struct scsi_device *scsidev = kzalloc_obj(*scsidev, GFP_KERNEL); int status; if (!scsicmd || !scsidev) { @@ -4010,7 +4010,7 @@ static int aac_convert_sgraw2(struct aac_raw_io2 *rio2, int pages, int nseg, int if (aac_convert_sgl == 0) return 0; - sge = kmalloc_array(nseg_new, sizeof(*sge), GFP_ATOMIC); + sge = kmalloc_objs(*sge, nseg_new, GFP_ATOMIC); if (sge == NULL) return -ENOMEM; diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index 68240d6f27ab..f7dca5ab3f6d 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c @@ -169,7 +169,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg) struct aac_fib_context * fibctx; int status; - fibctx = kmalloc(sizeof(struct aac_fib_context), GFP_KERNEL); + fibctx = kmalloc_obj(struct aac_fib_context, GFP_KERNEL); if (fibctx == NULL) { status = -ENOMEM; } else { diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 726c8531b7d3..e425dee827a3 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -632,7 +632,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) * Ok now init the communication subsystem */ - dev->queues = kzalloc(sizeof(struct aac_queue_block), GFP_KERNEL); + dev->queues = kzalloc_obj(struct aac_queue_block, GFP_KERNEL); if (dev->queues == NULL) { printk(KERN_ERR "Error could not allocate comm region.\n"); return NULL; diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 7d9a4dce236b..3502e5e47539 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1907,13 +1907,13 @@ static int fillup_pools(struct aac_dev *dev, struct hw_fib **hw_fib_pool, hw_fib_p = hw_fib_pool; fib_p = fib_pool; while (hw_fib_p < &hw_fib_pool[num]) { - *(hw_fib_p) = kmalloc(sizeof(struct hw_fib), GFP_KERNEL); + *(hw_fib_p) = kmalloc_obj(struct hw_fib, GFP_KERNEL); if (!(*(hw_fib_p++))) { --hw_fib_p; break; } - *(fib_p) = kmalloc(sizeof(struct fib), GFP_KERNEL); + *(fib_p) = kmalloc_obj(struct fib, GFP_KERNEL); if (!(*(fib_p++))) { kfree(*(--hw_fib_p)); break; @@ -2101,12 +2101,11 @@ static void aac_process_events(struct aac_dev *dev) if (!num) goto free_fib; - hw_fib_pool = kmalloc_array(num, sizeof(struct hw_fib *), - GFP_KERNEL); + hw_fib_pool = kmalloc_objs(struct hw_fib *, num, GFP_KERNEL); if (!hw_fib_pool) goto free_fib; - fib_pool = kmalloc_array(num, sizeof(struct fib *), GFP_KERNEL); + fib_pool = kmalloc_objs(struct fib *, num, GFP_KERNEL); if (!fib_pool) goto free_hw_fib_pool; diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c index fbe334c59f37..169c41d080a1 100644 --- a/drivers/scsi/aacraid/dpcsup.c +++ b/drivers/scsi/aacraid/dpcsup.c @@ -184,7 +184,7 @@ unsigned int aac_command_normal(struct aac_queue *q) * a fib object in order to manage the linked lists */ if (dev->aif_thread) - if((fib = kmalloc(sizeof(struct fib), GFP_ATOMIC)) == NULL) + if((fib = kmalloc_obj(struct fib, GFP_ATOMIC)) == NULL) fib = &fibctx; memset(fib, 0, sizeof(struct fib)); @@ -284,9 +284,9 @@ unsigned int aac_intr_normal(struct aac_dev *dev, u32 index, int isAif, * manage the linked lists. */ if ((!dev->aif_thread) - || (!(fib = kzalloc(sizeof(struct fib),GFP_ATOMIC)))) + || (!(fib = kzalloc_obj(struct fib, GFP_ATOMIC)))) return 1; - if (!(hw_fib = kzalloc(sizeof(struct hw_fib),GFP_ATOMIC))) { + if (!(hw_fib = kzalloc_obj(struct hw_fib, GFP_ATOMIC))) { kfree (fib); return 1; } diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index ea468666159a..fe1ab38b7b6a 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1661,9 +1661,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (aac_reset_devices || reset_devices) aac->init_reset = true; - aac->fibs = kcalloc(shost->can_queue + AAC_NUM_MGT_FIB, - sizeof(struct fib), - GFP_KERNEL); + aac->fibs = kzalloc_objs(struct fib, shost->can_queue + AAC_NUM_MGT_FIB, + GFP_KERNEL); if (!aac->fibs) { error = -ENOMEM; goto out_free_host; diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 08bddac49757..f78448254f99 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -7486,8 +7486,8 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp, return ASC_ERROR; } - asc_sg_head = kzalloc(struct_size(asc_sg_head, sg_list, use_sg), - GFP_ATOMIC); + asc_sg_head = kzalloc_flex(*asc_sg_head, sg_list, use_sg, + GFP_ATOMIC); if (!asc_sg_head) { scsi_dma_unmap(scp); set_host_byte(scp, DID_SOFT_ERROR); @@ -11314,7 +11314,7 @@ static int advansys_eisa_probe(struct device *dev) struct eisa_scsi_data *data; err = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto fail; ioport = edev->base_addr + 0xc30; diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 6b87ea004e53..3602a1fc40e4 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -3604,7 +3604,7 @@ ahd_alloc_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel) && ahd->enabled_targets[scsi_id] != master_tstate) panic("%s: ahd_alloc_tstate - Target already allocated", ahd_name(ahd)); - tstate = kmalloc(sizeof(*tstate), GFP_ATOMIC); + tstate = kmalloc_obj(*tstate, GFP_ATOMIC); if (tstate == NULL) return (NULL); @@ -6037,14 +6037,14 @@ ahd_alloc(void *platform_arg, char *name) { struct ahd_softc *ahd; - ahd = kzalloc(sizeof(*ahd), GFP_ATOMIC); + ahd = kzalloc_obj(*ahd, GFP_ATOMIC); if (!ahd) { printk("aic7xxx: cannot malloc softc!\n"); kfree(name); return NULL; } - ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC); + ahd->seep_config = kmalloc_obj(*ahd->seep_config, GFP_ATOMIC); if (ahd->seep_config == NULL) { kfree(ahd); kfree(name); @@ -6777,7 +6777,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) hscb = &((struct hardware_scb *)hscb_map->vaddr)[offset]; hscb_busaddr = hscb_map->physaddr + (offset * sizeof(*hscb)); } else { - hscb_map = kmalloc(sizeof(*hscb_map), GFP_ATOMIC); + hscb_map = kmalloc_obj(*hscb_map, GFP_ATOMIC); if (hscb_map == NULL) return; @@ -6810,7 +6810,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) segs = sg_map->vaddr + offset; sg_busaddr = sg_map->physaddr + offset; } else { - sg_map = kmalloc(sizeof(*sg_map), GFP_ATOMIC); + sg_map = kmalloc_obj(*sg_map, GFP_ATOMIC); if (sg_map == NULL) return; @@ -6847,7 +6847,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) sense_data = sense_map->vaddr + offset; sense_busaddr = sense_map->physaddr + offset; } else { - sense_map = kmalloc(sizeof(*sense_map), GFP_ATOMIC); + sense_map = kmalloc_obj(*sense_map, GFP_ATOMIC); if (sense_map == NULL) return; @@ -6882,11 +6882,11 @@ ahd_alloc_scbs(struct ahd_softc *ahd) struct scb_platform_data *pdata; u_int col_tag; - next_scb = kmalloc(sizeof(*next_scb), GFP_ATOMIC); + next_scb = kmalloc_obj(*next_scb, GFP_ATOMIC); if (next_scb == NULL) break; - pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); + pdata = kmalloc_obj(*pdata, GFP_ATOMIC); if (pdata == NULL) { kfree(next_scb); break; @@ -10339,7 +10339,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) return; } } - lstate = kzalloc(sizeof(*lstate), GFP_ATOMIC); + lstate = kzalloc_obj(*lstate, GFP_ATOMIC); if (lstate == NULL) { xpt_print_path(ccb->ccb_h.path); printk("Couldn't allocate lstate\n"); diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index c8b6dc48300a..feb1707feb7e 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -923,7 +923,7 @@ ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent, { bus_dma_tag_t dmat; - dmat = kmalloc(sizeof(*dmat), GFP_ATOMIC); + dmat = kmalloc_obj(*dmat, GFP_ATOMIC); if (dmat == NULL) return (ENOMEM); @@ -1309,7 +1309,7 @@ int ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) { ahd->platform_data = - kzalloc(sizeof(struct ahd_platform_data), GFP_ATOMIC); + kzalloc_obj(struct ahd_platform_data, GFP_ATOMIC); if (ahd->platform_data == NULL) return (ENOMEM); ahd->platform_data->irq = AHD_LINUX_NOIRQ; diff --git a/drivers/scsi/aic7xxx/aic79xx_proc.c b/drivers/scsi/aic7xxx/aic79xx_proc.c index 746d0ca2a657..aa37838b78a6 100644 --- a/drivers/scsi/aic7xxx/aic79xx_proc.c +++ b/drivers/scsi/aic7xxx/aic79xx_proc.c @@ -242,8 +242,8 @@ ahd_proc_write_seeprom(struct Scsi_Host *shost, char *buffer, int length) u_int start_addr; if (ahd->seep_config == NULL) { - ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), - GFP_ATOMIC); + ahd->seep_config = kmalloc_obj(*ahd->seep_config, + GFP_ATOMIC); if (ahd->seep_config == NULL) { printk("aic79xx: Unable to allocate serial " "eeprom buffer. Write failing\n"); diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index a396f048a031..b9761f9f0bbc 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -2128,7 +2128,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel) && ahc->enabled_targets[scsi_id] != master_tstate) panic("%s: ahc_alloc_tstate - Target already allocated", ahc_name(ahc)); - tstate = kmalloc(sizeof(*tstate), GFP_ATOMIC); + tstate = kmalloc_obj(*tstate, GFP_ATOMIC); if (tstate == NULL) return (NULL); @@ -4381,14 +4381,14 @@ ahc_alloc(void *platform_arg, char *name) struct ahc_softc *ahc; int i; - ahc = kzalloc(sizeof(*ahc), GFP_ATOMIC); + ahc = kzalloc_obj(*ahc, GFP_ATOMIC); if (!ahc) { printk("aic7xxx: cannot malloc softc!\n"); kfree(name); return NULL; } - ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), GFP_ATOMIC); + ahc->seep_config = kmalloc_obj(*ahc->seep_config, GFP_ATOMIC); if (ahc->seep_config == NULL) { kfree(ahc); kfree(name); @@ -4433,7 +4433,7 @@ ahc_softc_init(struct ahc_softc *ahc) ahc->pause = ahc->unpause | PAUSE; /* XXX The shared scb data stuff should be deprecated */ if (ahc->scb_data == NULL) { - ahc->scb_data = kzalloc(sizeof(*ahc->scb_data), GFP_ATOMIC); + ahc->scb_data = kzalloc_obj(*ahc->scb_data, GFP_ATOMIC); if (ahc->scb_data == NULL) return (ENOMEM); } @@ -4738,8 +4738,8 @@ ahc_init_scbdata(struct ahc_softc *ahc) SLIST_INIT(&scb_data->sg_maps); /* Allocate SCB resources */ - scb_data->scbarray = kcalloc(AHC_SCB_MAX_ALLOC, sizeof(struct scb), - GFP_ATOMIC); + scb_data->scbarray = kzalloc_objs(struct scb, AHC_SCB_MAX_ALLOC, + GFP_ATOMIC); if (scb_data->scbarray == NULL) return (ENOMEM); @@ -4943,7 +4943,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) next_scb = &scb_data->scbarray[scb_data->numscbs]; - sg_map = kmalloc(sizeof(*sg_map), GFP_ATOMIC); + sg_map = kmalloc_obj(*sg_map, GFP_ATOMIC); if (sg_map == NULL) return; @@ -4970,7 +4970,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) for (i = 0; i < newcount; i++) { struct scb_platform_data *pdata; - pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); + pdata = kmalloc_obj(*pdata, GFP_ATOMIC); if (pdata == NULL) break; next_scb->platform_data = pdata; @@ -7488,7 +7488,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) return; } } - lstate = kzalloc(sizeof(*lstate), GFP_ATOMIC); + lstate = kzalloc_obj(*lstate, GFP_ATOMIC); if (lstate == NULL) { xpt_print_path(ccb->ccb_h.path); printk("Couldn't allocate lstate\n"); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index c71f80f8fa34..d93b522695eb 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -823,7 +823,7 @@ ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent, { bus_dma_tag_t dmat; - dmat = kmalloc(sizeof(*dmat), GFP_ATOMIC); + dmat = kmalloc_obj(*dmat, GFP_ATOMIC); if (dmat == NULL) return (ENOMEM); @@ -1201,7 +1201,7 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) { ahc->platform_data = - kzalloc(sizeof(struct ahc_platform_data), GFP_ATOMIC); + kzalloc_obj(struct ahc_platform_data, GFP_ATOMIC); if (ahc->platform_data == NULL) return (ENOMEM); ahc->platform_data->irq = AHC_LINUX_NOIRQ; diff --git a/drivers/scsi/aic7xxx/aic7xxx_proc.c b/drivers/scsi/aic7xxx/aic7xxx_proc.c index 4bc9e2dfccf6..3b2ba7b4d61b 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx/aic7xxx_proc.c @@ -255,8 +255,8 @@ ahc_proc_write_seeprom(struct Scsi_Host *shost, char *buffer, int length) u_int start_addr; if (ahc->seep_config == NULL) { - ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), - GFP_ATOMIC); + ahc->seep_config = kmalloc_obj(*ahc->seep_config, + GFP_ATOMIC); if (ahc->seep_config == NULL) { printk("aic7xxx: Unable to allocate serial " "eeprom buffer. Write failing\n"); diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c index e74393357025..caa9d7143894 100644 --- a/drivers/scsi/aic94xx/aic94xx_hwi.c +++ b/drivers/scsi/aic94xx/aic94xx_hwi.c @@ -272,8 +272,7 @@ static int asd_alloc_edbs(struct asd_ha_struct *asd_ha, gfp_t gfp_flags) struct asd_seq_data *seq = &asd_ha->seq; int i; - seq->edb_arr = kmalloc_array(seq->num_edbs, sizeof(*seq->edb_arr), - gfp_flags); + seq->edb_arr = kmalloc_objs(*seq->edb_arr, seq->num_edbs, gfp_flags); if (!seq->edb_arr) return -ENOMEM; @@ -305,8 +304,7 @@ static int asd_alloc_escbs(struct asd_ha_struct *asd_ha, struct asd_ascb *escb; int i, escbs; - seq->escb_arr = kmalloc_array(seq->num_escbs, sizeof(*seq->escb_arr), - gfp_flags); + seq->escb_arr = kmalloc_objs(*seq->escb_arr, seq->num_escbs, gfp_flags); if (!seq->escb_arr) return -ENOMEM; diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 95f3620059f7..243f8d6166a5 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -642,9 +642,9 @@ static int asd_register_sas_ha(struct asd_ha_struct *asd_ha) { int i; struct asd_sas_phy **sas_phys = - kcalloc(ASD_MAX_PHYS, sizeof(*sas_phys), GFP_KERNEL); + kzalloc_objs(*sas_phys, ASD_MAX_PHYS, GFP_KERNEL); struct asd_sas_port **sas_ports = - kcalloc(ASD_MAX_PHYS, sizeof(*sas_ports), GFP_KERNEL); + kzalloc_objs(*sas_ports, ASD_MAX_PHYS, GFP_KERNEL); if (!sas_phys || !sas_ports) { kfree(sas_phys); @@ -710,7 +710,7 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) asd_dev = &asd_pcidev_data[asd_id]; - asd_ha = kzalloc(sizeof(*asd_ha), GFP_KERNEL); + asd_ha = kzalloc_obj(*asd_ha, GFP_KERNEL); if (!asd_ha) { asd_printk("out of memory\n"); goto Err_put; diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c index 5def83c88f13..89d1e385af69 100644 --- a/drivers/scsi/aic94xx/aic94xx_sds.c +++ b/drivers/scsi/aic94xx/aic94xx_sds.c @@ -207,7 +207,7 @@ static int asd_get_bios_chim(struct asd_ha_struct *asd_ha, goto out; } err = -ENOMEM; - bc_struct = kmalloc(sizeof(*bc_struct), GFP_KERNEL); + bc_struct = kmalloc_obj(*bc_struct, GFP_KERNEL); if (!bc_struct) { asd_printk("no memory for bios_chim struct\n"); goto out; @@ -341,7 +341,7 @@ int asd_read_ocm(struct asd_ha_struct *asd_ha) if (asd_hwi_check_ocm_access(asd_ha)) return -1; - dir = kmalloc(sizeof(*dir), GFP_KERNEL); + dir = kmalloc_obj(*dir, GFP_KERNEL); if (!dir) { asd_printk("no memory for ocm dir\n"); return -ENOMEM; @@ -1040,7 +1040,7 @@ int asd_read_flash(struct asd_ha_struct *asd_ha) if (err) return err; - flash_dir = kmalloc(sizeof(*flash_dir), GFP_KERNEL); + flash_dir = kmalloc_obj(*flash_dir, GFP_KERNEL); if (!flash_dir) return -ENOMEM; diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c index 003e61831e33..734b5a9dcf5e 100644 --- a/drivers/scsi/am53c974.c +++ b/drivers/scsi/am53c974.c @@ -396,7 +396,7 @@ static int pci_esp_probe_one(struct pci_dev *pdev, goto fail_disable_device; } - pep = kzalloc(sizeof(struct pci_esp_priv), GFP_KERNEL); + pep = kzalloc_obj(struct pci_esp_priv, GFP_KERNEL); if (!pep) { dev_printk(KERN_INFO, &pdev->dev, "failed to allocate esp_priv\n"); diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c index 978df23ce188..2849f59b6015 100644 --- a/drivers/scsi/arm/queue.c +++ b/drivers/scsi/arm/queue.c @@ -71,7 +71,7 @@ int queue_initialise (Queue_t *queue) * need to keep free lists or allocate this * memory. */ - queue->alloc = q = kmalloc_array(nqueues, sizeof(QE_t), GFP_KERNEL); + queue->alloc = q = kmalloc_objs(QE_t, nqueues, GFP_KERNEL); if (q) { for (; nqueues; q++, nqueues--) { SET_MAGIC(q, QUEUE_MAGIC_FREE); diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index a0e794ffc980..1242ae2694c1 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -303,7 +303,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc) beiscsi_conn = conn->dd_data; phba = beiscsi_conn->phba; - inv_tbl = kzalloc(sizeof(*inv_tbl), GFP_ATOMIC); + inv_tbl = kzalloc_obj(*inv_tbl, GFP_ATOMIC); if (!inv_tbl) { spin_unlock_bh(&session->frwd_lock); beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH, @@ -2476,25 +2476,23 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba) /* Allocate memory for wrb_context */ phwi_ctrlr = phba->phwi_ctrlr; - phwi_ctrlr->wrb_context = kcalloc(phba->params.cxns_per_ctrl, - sizeof(struct hwi_wrb_context), - GFP_KERNEL); + phwi_ctrlr->wrb_context = kzalloc_objs(struct hwi_wrb_context, + phba->params.cxns_per_ctrl, + GFP_KERNEL); if (!phwi_ctrlr->wrb_context) { kfree(phba->phwi_ctrlr); return -ENOMEM; } - phba->init_mem = kcalloc(SE_MEM_MAX, sizeof(*mem_descr), - GFP_KERNEL); + phba->init_mem = kzalloc_objs(*mem_descr, SE_MEM_MAX, GFP_KERNEL); if (!phba->init_mem) { kfree(phwi_ctrlr->wrb_context); kfree(phba->phwi_ctrlr); return -ENOMEM; } - mem_arr_orig = kmalloc_array(BEISCSI_MAX_FRAGS_INIT, - sizeof(*mem_arr_orig), - GFP_KERNEL); + mem_arr_orig = kmalloc_objs(*mem_arr_orig, BEISCSI_MAX_FRAGS_INIT, + GFP_KERNEL); if (!mem_arr_orig) { kfree(phba->init_mem); kfree(phwi_ctrlr->wrb_context); @@ -2542,8 +2540,7 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba) } while (alloc_size); mem_descr->num_elements = j; mem_descr->size_in_bytes = phba->mem_req[i]; - mem_descr->mem_array = kmalloc_array(j, sizeof(*mem_arr), - GFP_KERNEL); + mem_descr->mem_array = kmalloc_objs(*mem_arr, j, GFP_KERNEL); if (!mem_descr->mem_array) goto free_mem; @@ -2629,9 +2626,9 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba) /* Allocate memory for WRBQ */ phwi_ctxt = phwi_ctrlr->phwi_ctxt; - phwi_ctxt->be_wrbq = kcalloc(phba->params.cxns_per_ctrl, - sizeof(struct be_queue_info), - GFP_KERNEL); + phwi_ctxt->be_wrbq = kzalloc_objs(struct be_queue_info, + phba->params.cxns_per_ctrl, + GFP_KERNEL); if (!phwi_ctxt->be_wrbq) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : WRBQ Mem Alloc Failed\n"); @@ -2641,18 +2638,18 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba) for (index = 0; index < phba->params.cxns_per_ctrl; index++) { pwrb_context = &phwi_ctrlr->wrb_context[index]; pwrb_context->pwrb_handle_base = - kcalloc(phba->params.wrbs_per_cxn, - sizeof(struct wrb_handle *), - GFP_KERNEL); + kzalloc_objs(struct wrb_handle *, + phba->params.wrbs_per_cxn, + GFP_KERNEL); if (!pwrb_context->pwrb_handle_base) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : Mem Alloc Failed. Failing to load\n"); goto init_wrb_hndl_failed; } pwrb_context->pwrb_handle_basestd = - kcalloc(phba->params.wrbs_per_cxn, - sizeof(struct wrb_handle *), - GFP_KERNEL); + kzalloc_objs(struct wrb_handle *, + phba->params.wrbs_per_cxn, + GFP_KERNEL); if (!pwrb_context->pwrb_handle_basestd) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : Mem Alloc Failed. Failing to load\n"); @@ -3363,9 +3360,8 @@ beiscsi_create_wrb_rings(struct beiscsi_hba *phba, idx = 0; mem_descr = phba->init_mem; mem_descr += HWI_MEM_WRB; - pwrb_arr = kmalloc_array(phba->params.cxns_per_ctrl, - sizeof(*pwrb_arr), - GFP_KERNEL); + pwrb_arr = kmalloc_objs(*pwrb_arr, phba->params.cxns_per_ctrl, + GFP_KERNEL); if (!pwrb_arr) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : Memory alloc failed in create wrb ring.\n"); @@ -3902,18 +3898,18 @@ static int beiscsi_init_sgl_handle(struct beiscsi_hba *phba) mem_descr_sglh = phba->init_mem; mem_descr_sglh += HWI_MEM_SGLH; if (1 == mem_descr_sglh->num_elements) { - phba->io_sgl_hndl_base = kcalloc(phba->params.ios_per_ctrl, - sizeof(struct sgl_handle *), - GFP_KERNEL); + phba->io_sgl_hndl_base = kzalloc_objs(struct sgl_handle *, + phba->params.ios_per_ctrl, + GFP_KERNEL); if (!phba->io_sgl_hndl_base) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : Mem Alloc Failed. Failing to load\n"); return -ENOMEM; } phba->eh_sgl_hndl_base = - kcalloc(phba->params.icds_per_ctrl - - phba->params.ios_per_ctrl, - sizeof(struct sgl_handle *), GFP_KERNEL); + kzalloc_objs(struct sgl_handle *, + phba->params.icds_per_ctrl - phba->params.ios_per_ctrl, + GFP_KERNEL); if (!phba->eh_sgl_hndl_base) { kfree(phba->io_sgl_hndl_base); beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, @@ -4004,8 +4000,8 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba) for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) { if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) { - ptr_cid_info = kzalloc(sizeof(struct ulp_cid_info), - GFP_KERNEL); + ptr_cid_info = kzalloc_obj(struct ulp_cid_info, + GFP_KERNEL); if (!ptr_cid_info) { ret = -ENOMEM; @@ -4031,18 +4027,16 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba) phba->cid_array_info[ulp_num] = ptr_cid_info; } } - phba->ep_array = kcalloc(phba->params.cxns_per_ctrl, - sizeof(struct iscsi_endpoint *), - GFP_KERNEL); + phba->ep_array = kzalloc_objs(struct iscsi_endpoint *, + phba->params.cxns_per_ctrl, GFP_KERNEL); if (!phba->ep_array) { ret = -ENOMEM; goto free_memory; } - phba->conn_table = kcalloc(phba->params.cxns_per_ctrl, - sizeof(struct beiscsi_conn *), - GFP_KERNEL); + phba->conn_table = kzalloc_objs(struct beiscsi_conn *, + phba->params.cxns_per_ctrl, GFP_KERNEL); if (!phba->conn_table) { kfree(phba->ep_array); phba->ep_array = NULL; diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 9a85f417018f..9285e9922ea8 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c @@ -1863,7 +1863,7 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) u8 *curr_ptr; u16 templen, count; - fcs_hba_attr = kzalloc(sizeof(*fcs_hba_attr), GFP_KERNEL); + fcs_hba_attr = kzalloc_obj(*fcs_hba_attr, GFP_KERNEL); if (!fcs_hba_attr) return -ENOMEM; diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index bdfd06516671..629942abc5ca 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -473,7 +473,7 @@ bfa_fcb_rport_alloc(struct bfad_s *bfad, struct bfa_fcs_rport_s **rport, { bfa_status_t rc = BFA_STATUS_OK; - *rport_drv = kzalloc(sizeof(struct bfad_rport_s), GFP_ATOMIC); + *rport_drv = kzalloc_obj(struct bfad_rport_s, GFP_ATOMIC); if (*rport_drv == NULL) { rc = BFA_STATUS_ENOMEM; goto ext; @@ -496,7 +496,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport) struct bfad_vport_s *vport; int rc; - vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC); + vport = kzalloc_obj(struct bfad_vport_s, GFP_ATOMIC); if (!vport) { bfa_trc(bfad, 0); return; @@ -640,7 +640,7 @@ bfad_vport_create(struct bfad_s *bfad, u16 vf_id, unsigned long flags; struct completion fcomp; - vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL); + vport = kzalloc_obj(struct bfad_vport_s, GFP_KERNEL); if (!vport) { rc = BFA_STATUS_ENOMEM; goto ext; @@ -1271,13 +1271,13 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) (PCI_FUNC(pdev->devfn) != 0)) return -ENODEV; - bfad = kzalloc(sizeof(struct bfad_s), GFP_KERNEL); + bfad = kzalloc_obj(struct bfad_s, GFP_KERNEL); if (!bfad) { error = -ENOMEM; goto out; } - bfad->trcmod = kzalloc(sizeof(struct bfa_trc_mod_s), GFP_KERNEL); + bfad->trcmod = kzalloc_obj(struct bfa_trc_mod_s, GFP_KERNEL); if (!bfad->trcmod) { printk(KERN_WARNING "Error alloc trace buffer!\n"); error = -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index 54bc1539e1e9..50f975d63c07 100644 --- a/drivers/scsi/bfa/bfad_attr.c +++ b/drivers/scsi/bfa/bfad_attr.c @@ -264,7 +264,7 @@ bfad_im_get_stats(struct Scsi_Host *shost) bfa_status_t rc; unsigned long flags; - fcstats = kzalloc(sizeof(union bfa_port_stats_u), GFP_KERNEL); + fcstats = kzalloc_obj(union bfa_port_stats_u, GFP_KERNEL); if (fcstats == NULL) return NULL; @@ -907,8 +907,7 @@ bfad_im_num_of_discovered_ports_show(struct device *dev, struct bfa_rport_qualifier_s *rports = NULL; unsigned long flags; - rports = kcalloc(nrports, sizeof(struct bfa_rport_qualifier_s), - GFP_ATOMIC); + rports = kzalloc_objs(struct bfa_rport_qualifier_s, nrports, GFP_ATOMIC); if (rports == NULL) return sysfs_emit(buf, "Failed\n"); diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 54bd11e6d593..0a33657e67d5 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c @@ -3410,7 +3410,7 @@ bfad_im_bsg_els_ct_request(struct bsg_job *job) goto out; } - drv_fcxp = kzalloc(sizeof(struct bfad_fcxp), GFP_KERNEL); + drv_fcxp = kzalloc_obj(struct bfad_fcxp, GFP_KERNEL); if (drv_fcxp == NULL) { kfree(bsg_fcpt); rc = -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c index f6dd077d47c9..335f5f6a96fa 100644 --- a/drivers/scsi/bfa/bfad_debugfs.c +++ b/drivers/scsi/bfa/bfad_debugfs.c @@ -46,7 +46,7 @@ bfad_debugfs_open_drvtrc(struct inode *inode, struct file *file) struct bfad_s *bfad = port->bfad; struct bfad_debug_info *debug; - debug = kzalloc(sizeof(struct bfad_debug_info), GFP_KERNEL); + debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); if (!debug) return -ENOMEM; @@ -67,7 +67,7 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc(sizeof(struct bfad_debug_info), GFP_KERNEL); + fw_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); if (!fw_debug) return -ENOMEM; @@ -109,7 +109,7 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc(sizeof(struct bfad_debug_info), GFP_KERNEL); + fw_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); if (!fw_debug) return -ENOMEM; @@ -147,7 +147,7 @@ bfad_debugfs_open_reg(struct inode *inode, struct file *file) { struct bfad_debug_info *reg_debug; - reg_debug = kzalloc(sizeof(struct bfad_debug_info), GFP_KERNEL); + reg_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); if (!reg_debug) return -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 6c84982c4726..1feb2a9517c7 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -426,7 +426,7 @@ int bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim, struct bfad_itnim_s **itnim_drv) { - *itnim_drv = kzalloc(sizeof(struct bfad_itnim_s), GFP_ATOMIC); + *itnim_drv = kzalloc_obj(struct bfad_itnim_s, GFP_ATOMIC); if (*itnim_drv == NULL) return -ENOMEM; @@ -622,7 +622,7 @@ bfad_im_port_new(struct bfad_s *bfad, struct bfad_port_s *port) int rc = BFA_STATUS_OK; struct bfad_im_port_s *im_port; - im_port = kzalloc(sizeof(struct bfad_im_port_s), GFP_ATOMIC); + im_port = kzalloc_obj(struct bfad_im_port_s, GFP_ATOMIC); if (im_port == NULL) { rc = BFA_STATUS_ENOMEM; goto ext; @@ -698,7 +698,7 @@ bfad_im_probe(struct bfad_s *bfad) { struct bfad_im_s *im; - im = kzalloc(sizeof(struct bfad_im_s), GFP_KERNEL); + im = kzalloc_obj(struct bfad_im_s, GFP_KERNEL); if (im == NULL) return BFA_STATUS_ENOMEM; @@ -994,7 +994,7 @@ bfad_im_supported_speeds(struct bfa_s *bfa) struct bfa_ioc_attr_s *ioc_attr; u32 supported_speed = 0; - ioc_attr = kzalloc(sizeof(struct bfa_ioc_attr_s), GFP_KERNEL); + ioc_attr = kzalloc_obj(struct bfa_ioc_attr_s, GFP_KERNEL); if (!ioc_attr) return 0; diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c index 754f2e82d955..749e30aaf926 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_els.c +++ b/drivers/scsi/bnx2fc/bnx2fc_els.c @@ -80,7 +80,7 @@ int bnx2fc_send_rrq(struct bnx2fc_cmd *aborted_io_req) aborted_io_req->xid); memset(&rrq, 0, sizeof(rrq)); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_NOIO); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for RRQ\n"); rc = -ENOMEM; @@ -189,7 +189,7 @@ int bnx2fc_send_adisc(struct bnx2fc_rport *tgt, struct fc_frame *fp) int rc; fh = fc_frame_header_get(fp); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for ADISC\n"); return -ENOMEM; @@ -217,7 +217,7 @@ int bnx2fc_send_logo(struct bnx2fc_rport *tgt, struct fc_frame *fp) int rc; fh = fc_frame_header_get(fp); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for LOGO\n"); return -ENOMEM; @@ -245,7 +245,7 @@ int bnx2fc_send_rls(struct bnx2fc_rport *tgt, struct fc_frame *fp) int rc; fh = fc_frame_header_get(fp); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for LOGO\n"); return -ENOMEM; @@ -592,7 +592,7 @@ int bnx2fc_send_rec(struct bnx2fc_cmd *orig_io_req) BNX2FC_IO_DBG(orig_io_req, "Sending REC\n"); memset(&rec, 0, sizeof(rec)); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for REC\n"); rc = -ENOMEM; @@ -633,7 +633,7 @@ int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl) BNX2FC_IO_DBG(orig_io_req, "Sending SRR\n"); memset(&srr, 0, sizeof(srr)); - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to allocate cb_arg for SRR\n"); rc = -ENOMEM; diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 0f68739d380a..84f7f7ef75b3 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -1356,7 +1356,7 @@ static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) struct fcoe_capabilities *fcoe_cap; int rc; - hba = kzalloc(sizeof(*hba), GFP_KERNEL); + hba = kzalloc_obj(*hba, GFP_KERNEL); if (!hba) { printk(KERN_ERR PFX "Unable to allocate hba structure\n"); return NULL; @@ -1381,8 +1381,8 @@ static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) hba->next_conn_id = 0; hba->tgt_ofld_list = - kcalloc(BNX2FC_NUM_MAX_SESS, sizeof(struct bnx2fc_rport *), - GFP_KERNEL); + kzalloc_objs(struct bnx2fc_rport *, BNX2FC_NUM_MAX_SESS, + GFP_KERNEL); if (!hba->tgt_ofld_list) { printk(KERN_ERR PFX "Unable to allocate tgt offload list\n"); goto tgtofld_err; @@ -1492,7 +1492,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, struct bnx2fc_hba *hba = interface->hba; int rc = 0; - blport = kzalloc(sizeof(struct bnx2fc_lport), GFP_KERNEL); + blport = kzalloc_obj(struct bnx2fc_lport, GFP_KERNEL); if (!blport) { BNX2FC_HBA_DBG(ctlr->lp, "Unable to alloc blport\n"); return NULL; @@ -2200,7 +2200,7 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr) if (!hba->cnic->get_fc_npiv_tbl) goto done; - npiv_tbl = kzalloc(sizeof(struct cnic_fc_npiv_tbl), GFP_KERNEL); + npiv_tbl = kzalloc_obj(struct cnic_fc_npiv_tbl, GFP_KERNEL); if (!npiv_tbl) goto done; diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 090d436bcef8..a5ecb87d5b2d 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c @@ -561,7 +561,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, u8 op; - unsol_els = kzalloc(sizeof(*unsol_els), GFP_ATOMIC); + unsol_els = kzalloc_obj(*unsol_els, GFP_ATOMIC); if (!unsol_els) { BNX2FC_TGT_DBG(tgt, "Unable to allocate unsol_work\n"); return; @@ -972,7 +972,7 @@ static struct bnx2fc_work *bnx2fc_alloc_work(struct bnx2fc_rport *tgt, u16 wqe, struct fcoe_task_ctx_entry *task) { struct bnx2fc_work *work; - work = kzalloc(sizeof(struct bnx2fc_work), GFP_ATOMIC); + work = kzalloc_obj(struct bnx2fc_work, GFP_ATOMIC); if (!work) return NULL; diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 90b2b54c549a..ba299196dee9 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -241,15 +241,14 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) } cmgr->hba = hba; - cmgr->free_list = kcalloc(arr_sz, sizeof(*cmgr->free_list), - GFP_KERNEL); + cmgr->free_list = kzalloc_objs(*cmgr->free_list, arr_sz, GFP_KERNEL); if (!cmgr->free_list) { printk(KERN_ERR PFX "failed to alloc free_list\n"); goto mem_err; } - cmgr->free_list_lock = kcalloc(arr_sz, sizeof(*cmgr->free_list_lock), - GFP_KERNEL); + cmgr->free_list_lock = kzalloc_objs(*cmgr->free_list_lock, arr_sz, + GFP_KERNEL); if (!cmgr->free_list_lock) { printk(KERN_ERR PFX "failed to alloc free_list_lock\n"); kfree(cmgr->free_list); @@ -272,7 +271,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) xid = BNX2FC_MIN_XID; num_pri_ios = num_ios - hba->elstm_xids; for (i = 0; i < num_ios; i++) { - io_req = kzalloc(sizeof(*io_req), GFP_KERNEL); + io_req = kzalloc_obj(*io_req, GFP_KERNEL); if (!io_req) { printk(KERN_ERR PFX "failed to alloc io_req\n"); @@ -942,7 +941,7 @@ int bnx2fc_initiate_seq_cleanup(struct bnx2fc_cmd *orig_io_req, u32 offset, port = orig_io_req->port; interface = port->priv; - cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(struct bnx2fc_els_cb_arg, GFP_ATOMIC); if (!cb_arg) { printk(KERN_ERR PFX "Unable to alloc cb_arg for seq clnup\n"); rc = -ENOMEM; diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 40db5190a222..d24cc2c795d6 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -1925,7 +1925,7 @@ static int bnx2i_queue_scsi_cmd_resp(struct iscsi_session *session, goto err; } /* Alloc and copy to the cqe */ - bnx2i_work = kzalloc(sizeof(struct bnx2i_work), GFP_ATOMIC); + bnx2i_work = kzalloc_obj(struct bnx2i_work, GFP_ATOMIC); if (bnx2i_work) { INIT_LIST_HEAD(&bnx2i_work->list); bnx2i_work->session = session; diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c index baf5f4e47937..f276f4f4eadf 100644 --- a/drivers/scsi/bvme6000_scsi.c +++ b/drivers/scsi/bvme6000_scsi.c @@ -44,7 +44,7 @@ bvme6000_probe(struct platform_device *dev) if (!MACH_IS_BVME6000) goto out; - hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); if (!hostdata) { printk(KERN_ERR "bvme6000-scsi: " "Failed to allocate host data\n"); diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index b6ca23a29ef5..3a6ab2d09ded 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -364,8 +364,7 @@ ch_readconfig(scsi_changer *ch) } /* look up the devices of the data transfer elements */ - ch->dt = kcalloc(ch->counts[CHET_DT], sizeof(*ch->dt), - GFP_KERNEL); + ch->dt = kzalloc_objs(*ch->dt, ch->counts[CHET_DT], GFP_KERNEL); if (!ch->dt) { kfree(buffer); @@ -904,7 +903,7 @@ static int ch_probe(struct scsi_device *sd) if (sd->type != TYPE_MEDIUM_CHANGER) return -ENODEV; - ch = kzalloc(sizeof(*ch), GFP_KERNEL); + ch = kzalloc_obj(*ch, GFP_KERNEL); if (NULL == ch) return -ENOMEM; diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 7aa418ebfe01..03299d5e523a 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -2429,7 +2429,7 @@ csio_hw_flash_fw(struct csio_hw *hw, int *reset) /* allocate memory to read the header of the firmware on the * card */ - card_fw = kmalloc(sizeof(*card_fw), GFP_KERNEL); + card_fw = kmalloc_obj(*card_fw, GFP_KERNEL); if (!card_fw) return -ENOMEM; @@ -4389,7 +4389,7 @@ csio_hw_init(struct csio_hw *hw) INIT_LIST_HEAD(&hw->evt_free_q); for (i = 0; i < csio_evtq_sz; i++) { - evt_entry = kzalloc(sizeof(struct csio_evt_msg), GFP_KERNEL); + evt_entry = kzalloc_obj(struct csio_evt_msg, GFP_KERNEL); if (!evt_entry) { rv = -ENOMEM; csio_err(hw, "Failed to initialize eventq"); diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c index db0c2174430a..1d2fcccb46c2 100644 --- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -516,7 +516,7 @@ static struct csio_hw *csio_hw_alloc(struct pci_dev *pdev) { struct csio_hw *hw; - hw = kzalloc(sizeof(struct csio_hw), GFP_KERNEL); + hw = kzalloc_obj(struct csio_hw, GFP_KERNEL); if (!hw) goto err; diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c index 6cc1d53165a0..cdd61b990c64 100644 --- a/drivers/scsi/csiostor/csio_lnode.c +++ b/drivers/scsi/csiostor/csio_lnode.c @@ -1837,7 +1837,7 @@ csio_ln_fdmi_init(struct csio_lnode *ln) struct csio_dma_buf *dma_buf; /* Allocate MGMT request required for FDMI */ - ln->mgmt_req = kzalloc(sizeof(struct csio_ioreq), GFP_KERNEL); + ln->mgmt_req = kzalloc_obj(struct csio_ioreq, GFP_KERNEL); if (!ln->mgmt_req) { csio_ln_err(ln, "Failed to alloc ioreq for FDMI\n"); CSIO_INC_STATS(hw, n_err_nomem); @@ -2002,7 +2002,7 @@ csio_ln_init(struct csio_lnode *ln) /* This is the lnode used during initialization */ - ln->fcfinfo = kzalloc(sizeof(struct csio_fcf_info), GFP_KERNEL); + ln->fcfinfo = kzalloc_obj(struct csio_fcf_info, GFP_KERNEL); if (!ln->fcfinfo) { csio_ln_err(ln, "Failed to alloc FCF record\n"); CSIO_INC_STATS(hw, n_err_nomem); @@ -2029,8 +2029,8 @@ csio_ln_init(struct csio_lnode *ln) ln->fcfinfo = pln->fcfinfo; } else { /* Another non-root physical lnode (FCF) */ - ln->fcfinfo = kzalloc(sizeof(struct csio_fcf_info), - GFP_KERNEL); + ln->fcfinfo = kzalloc_obj(struct csio_fcf_info, + GFP_KERNEL); if (!ln->fcfinfo) { csio_ln_err(ln, "Failed to alloc FCF info\n"); CSIO_INC_STATS(hw, n_err_nomem); diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 05137784f369..2c75c2663f73 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -2341,7 +2341,7 @@ csio_scsi_alloc_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw, for (n = 0; n < num_buf; n++) { /* Set unit size to request size */ unit_size = buf_size; - ddp_desc = kzalloc(sizeof(struct csio_dma_buf), GFP_KERNEL); + ddp_desc = kzalloc_obj(struct csio_dma_buf, GFP_KERNEL); if (!ddp_desc) { csio_err(hw, "Failed to allocate ddp descriptors," @@ -2435,7 +2435,7 @@ csio_scsim_init(struct csio_scsim *scm, struct csio_hw *hw) INIT_LIST_HEAD(&scm->ioreq_freelist); for (i = 0; i < csio_scsi_ioreqs; i++) { - ioreq = kzalloc(sizeof(struct csio_ioreq), GFP_KERNEL); + ioreq = kzalloc_obj(struct csio_ioreq, GFP_KERNEL); if (!ioreq) { csio_err(hw, "I/O request element allocation failed, " diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c index 010a1df37f15..0310fa71ab07 100644 --- a/drivers/scsi/csiostor/csio_wr.c +++ b/drivers/scsi/csiostor/csio_wr.c @@ -278,9 +278,8 @@ csio_wr_alloc_q(struct csio_hw *hw, uint32_t qsize, uint32_t wrsize, q->un.iq.flq_idx = flq_idx; flq = wrm->q_arr[q->un.iq.flq_idx]; - flq->un.fl.bufs = kcalloc(flq->credits, - sizeof(struct csio_dma_buf), - GFP_KERNEL); + flq->un.fl.bufs = kzalloc_objs(struct csio_dma_buf, + flq->credits, GFP_KERNEL); if (!flq->un.fl.bufs) { csio_err(hw, "Failed to allocate FL queue bufs" @@ -1651,12 +1650,12 @@ csio_wrm_init(struct csio_wrm *wrm, struct csio_hw *hw) return -EINVAL; } - wrm->q_arr = kcalloc(wrm->num_q, sizeof(struct csio_q *), GFP_KERNEL); + wrm->q_arr = kzalloc_objs(struct csio_q *, wrm->num_q, GFP_KERNEL); if (!wrm->q_arr) goto err; for (i = 0; i < wrm->num_q; i++) { - wrm->q_arr[i] = kzalloc(sizeof(struct csio_q), GFP_KERNEL); + wrm->q_arr[i] = kzalloc_obj(struct csio_q, GFP_KERNEL); if (!wrm->q_arr[i]) { while (--i >= 0) kfree(wrm->q_arr[i]); diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index bf75940f2be1..ea9631bfe2e2 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -556,7 +556,7 @@ EXPORT_SYMBOL_GPL(cxgbi_sock_free_cpl_skbs); static struct cxgbi_sock *cxgbi_sock_create(struct cxgbi_device *cdev) { - struct cxgbi_sock *csk = kzalloc(sizeof(*csk), GFP_NOIO); + struct cxgbi_sock *csk = kzalloc_obj(*csk, GFP_NOIO); if (!csk) { pr_info("alloc csk %zu failed.\n", sizeof(*csk)); diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 9dc499c89d3e..6183ce05d8cf 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -2990,7 +2990,7 @@ static struct DeviceCtlBlk *device_alloc(struct AdapterCtlBlk *acb, u8 period_index = eeprom->target[target].period & 0x07; struct DeviceCtlBlk *dcb; - dcb = kmalloc(sizeof(struct DeviceCtlBlk), GFP_ATOMIC); + dcb = kmalloc_obj(struct DeviceCtlBlk, GFP_ATOMIC); if (!dcb) return NULL; dcb->acb = NULL; diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 6fd89ae33059..842476f131fd 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -219,7 +219,7 @@ static struct alua_port_group *alua_alloc_pg(struct scsi_device *sdev, { struct alua_port_group *pg, *tmp_pg; - pg = kzalloc(sizeof(struct alua_port_group), GFP_KERNEL); + pg = kzalloc_obj(struct alua_port_group, GFP_KERNEL); if (!pg) return ERR_PTR(-ENOMEM); @@ -1137,7 +1137,7 @@ static int alua_activate(struct scsi_device *sdev, struct alua_queue_data *qdata; struct alua_port_group *pg; - qdata = kzalloc(sizeof(*qdata), GFP_KERNEL); + qdata = kzalloc_obj(*qdata, GFP_KERNEL); if (!qdata) { err = SCSI_DH_RES_TEMP_UNAVAIL; goto out; @@ -1239,7 +1239,7 @@ static int alua_bus_attach(struct scsi_device *sdev) struct alua_dh_data *h; int err; - h = kzalloc(sizeof(*h) , GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return SCSI_DH_NOMEM; spin_lock_init(&h->pg_lock); diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 3cf88db2d5b2..5a2f6f09de07 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -478,7 +478,7 @@ static int clariion_bus_attach(struct scsi_device *sdev) struct clariion_dh_data *h; int err; - h = kzalloc(sizeof(*h) , GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return SCSI_DH_NOMEM; h->lun_state = CLARIION_LUN_UNINITIALIZED; diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index b6eaf49dfb00..36d877afff4b 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -226,7 +226,7 @@ static int hp_sw_bus_attach(struct scsi_device *sdev) struct hp_sw_dh_data *h; int ret; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return SCSI_DH_NOMEM; h->path_state = HP_SW_PATH_UNINITIALIZED; diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 6e1b252cea0e..088dc509d505 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -336,7 +336,7 @@ static struct rdac_controller *get_controller(int index, char *array_name, return tmp; } } - ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC); + ctlr = kmalloc_obj(*ctlr, GFP_ATOMIC); if (!ctlr) return NULL; @@ -601,7 +601,7 @@ static int queue_mode_select(struct scsi_device *sdev, struct rdac_queue_data *qdata; struct rdac_controller *ctlr; - qdata = kzalloc(sizeof(*qdata), GFP_KERNEL); + qdata = kzalloc_obj(*qdata, GFP_KERNEL); if (!qdata) return SCSI_DH_RETRY; @@ -741,7 +741,7 @@ static int rdac_bus_attach(struct scsi_device *sdev) char array_name[ARRAY_LABEL_LEN]; char array_id[UNIQUE_ID_LEN]; - h = kzalloc(sizeof(*h) , GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return SCSI_DH_NOMEM; h->lun = UNINITIALIZED_LUN; diff --git a/drivers/scsi/elx/efct/efct_driver.c b/drivers/scsi/elx/efct/efct_driver.c index 528399f725d4..03c0dbee779f 100644 --- a/drivers/scsi/elx/efct/efct_driver.c +++ b/drivers/scsi/elx/efct/efct_driver.c @@ -93,7 +93,7 @@ efct_efclib_config(struct efct *efct, struct libefc_function_template *tt) struct sli4 *sli; int rc = 0; - efc = kzalloc(sizeof(*efc), GFP_KERNEL); + efc = kzalloc_obj(*efc, GFP_KERNEL); if (!efc) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_hw.c b/drivers/scsi/elx/efct/efct_hw.c index 5b079b8b7a08..aba82cb69459 100644 --- a/drivers/scsi/elx/efct/efct_hw.c +++ b/drivers/scsi/elx/efct/efct_hw.c @@ -487,14 +487,14 @@ efct_hw_setup_io(struct efct_hw *hw) struct efct *efct = hw->os; if (!hw->io) { - hw->io = kmalloc_array(hw->config.n_io, sizeof(io), GFP_KERNEL); + hw->io = kmalloc_objs(io, hw->config.n_io, GFP_KERNEL); if (!hw->io) return -ENOMEM; memset(hw->io, 0, hw->config.n_io * sizeof(io)); for (i = 0; i < hw->config.n_io; i++) { - hw->io[i] = kzalloc(sizeof(*io), GFP_KERNEL); + hw->io[i] = kzalloc_obj(*io, GFP_KERNEL); if (!hw->io[i]) goto error; } @@ -611,7 +611,7 @@ efct_hw_init_prereg_io(struct efct_hw *hw) struct efc_dma req; struct efct *efct = hw->os; - sgls = kmalloc_array(sgls_per_request, sizeof(*sgls), GFP_KERNEL); + sgls = kmalloc_objs(*sgls, sgls_per_request, GFP_KERNEL); if (!sgls) return -ENOMEM; @@ -1182,7 +1182,7 @@ efct_hw_rx_buffer_alloc(struct efct_hw *hw, u32 rqindex, u32 count, if (!count) return NULL; - rq_buf = kmalloc_array(count, sizeof(*rq_buf), GFP_KERNEL); + rq_buf = kmalloc_objs(*rq_buf, count, GFP_KERNEL); if (!rq_buf) return NULL; memset(rq_buf, 0, sizeof(*rq_buf) * count); @@ -1287,8 +1287,8 @@ efct_hw_rx_post(struct efct_hw *hw) for (i = 0; i < hw->hw_rq_count; i++) count += hw->hw_rq[i]->entry_count; - hw->seq_pool = kmalloc_array(count, - sizeof(struct efc_hw_sequence), GFP_KERNEL); + hw->seq_pool = kmalloc_objs(struct efc_hw_sequence, count, + GFP_KERNEL); if (!hw->seq_pool) return -ENOMEM; } @@ -2064,7 +2064,7 @@ efct_hw_reqtag_pool_alloc(struct efct_hw *hw) struct reqtag_pool *reqtag_pool; struct hw_wq_callback *wqcb; - reqtag_pool = kzalloc(sizeof(*reqtag_pool), GFP_KERNEL); + reqtag_pool = kzalloc_obj(*reqtag_pool, GFP_KERNEL); if (!reqtag_pool) return NULL; @@ -2072,7 +2072,7 @@ efct_hw_reqtag_pool_alloc(struct efct_hw *hw) /* initialize reqtag pool lock */ spin_lock_init(&reqtag_pool->lock); for (i = 0; i < U16_MAX; i++) { - wqcb = kmalloc(sizeof(*wqcb), GFP_KERNEL); + wqcb = kmalloc_obj(*wqcb, GFP_KERNEL); if (!wqcb) break; @@ -3105,7 +3105,7 @@ efct_hw_get_link_stats(struct efct_hw *hw, u8 req_ext_counters, struct efct_hw_link_stat_cb_arg *cb_arg; u8 mbxdata[SLI4_BMBX_SIZE]; - cb_arg = kzalloc(sizeof(*cb_arg), GFP_ATOMIC); + cb_arg = kzalloc_obj(*cb_arg, GFP_ATOMIC); if (!cb_arg) return -ENOMEM; @@ -3189,7 +3189,7 @@ efct_hw_get_host_stats(struct efct_hw *hw, u8 cc, struct efct_hw_host_stat_cb_arg *cb_arg; u8 mbxdata[SLI4_BMBX_SIZE]; - cb_arg = kmalloc(sizeof(*cb_arg), GFP_ATOMIC); + cb_arg = kmalloc_obj(*cb_arg, GFP_ATOMIC); if (!cb_arg) return -ENOMEM; @@ -3239,7 +3239,7 @@ efct_hw_async_call(struct efct_hw *hw, efct_hw_async_cb_t callback, void *arg) * we need this to be persistent as the mbox cmd submission may be * queued and executed later execution. */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -3307,7 +3307,7 @@ efct_hw_firmware_write(struct efct_hw *hw, struct efc_dma *dma, u32 size, struct efct_hw_fw_wr_cb_arg *cb_arg; int noc = 0; - cb_arg = kzalloc(sizeof(*cb_arg), GFP_KERNEL); + cb_arg = kzalloc_obj(*cb_arg, GFP_KERNEL); if (!cb_arg) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_hw_queues.c b/drivers/scsi/elx/efct/efct_hw_queues.c index 3a1d1a5864a3..83d8f2c37569 100644 --- a/drivers/scsi/elx/efct/efct_hw_queues.c +++ b/drivers/scsi/elx/efct/efct_hw_queues.c @@ -127,7 +127,7 @@ efct_hw_map_wq_cpu(struct efct_hw *hw) struct hw_eq * efct_hw_new_eq(struct efct_hw *hw, u32 entry_count) { - struct hw_eq *eq = kzalloc(sizeof(*eq), GFP_KERNEL); + struct hw_eq *eq = kzalloc_obj(*eq, GFP_KERNEL); if (!eq) return NULL; @@ -159,7 +159,7 @@ struct hw_cq * efct_hw_new_cq(struct hw_eq *eq, u32 entry_count) { struct efct_hw *hw = eq->hw; - struct hw_cq *cq = kzalloc(sizeof(*cq), GFP_KERNEL); + struct hw_cq *cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) return NULL; @@ -204,7 +204,7 @@ efct_hw_new_cq_set(struct hw_eq *eqs[], struct hw_cq *cqs[], cqs[i] = NULL; for (i = 0; i < num_cqs; i++) { - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_obj(*cq, GFP_KERNEL); if (!cq) goto error; @@ -244,7 +244,7 @@ struct hw_mq * efct_hw_new_mq(struct hw_cq *cq, u32 entry_count) { struct efct_hw *hw = cq->eq->hw; - struct hw_mq *mq = kzalloc(sizeof(*mq), GFP_KERNEL); + struct hw_mq *mq = kzalloc_obj(*mq, GFP_KERNEL); if (!mq) return NULL; @@ -275,7 +275,7 @@ struct hw_wq * efct_hw_new_wq(struct hw_cq *cq, u32 entry_count) { struct efct_hw *hw = cq->eq->hw; - struct hw_wq *wq = kzalloc(sizeof(*wq), GFP_KERNEL); + struct hw_wq *wq = kzalloc_obj(*wq, GFP_KERNEL); if (!wq) return NULL; @@ -324,7 +324,7 @@ efct_hw_new_rq_set(struct hw_cq *cqs[], struct hw_rq *rqs[], * encapsulates 2 SLI queues (for rq pair) */ for (i = 0, q_count = 0; i < num_rq_pairs; i++, q_count += 2) { - rq = kzalloc(sizeof(*rq), GFP_KERNEL); + rq = kzalloc_obj(*rq, GFP_KERNEL); if (!rq) goto error; diff --git a/drivers/scsi/elx/efct/efct_io.c b/drivers/scsi/elx/efct/efct_io.c index c612f0a48839..dabbe996ab7c 100644 --- a/drivers/scsi/elx/efct/efct_io.c +++ b/drivers/scsi/elx/efct/efct_io.c @@ -25,7 +25,7 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl) struct efct_io *io; /* Allocate the IO pool */ - io_pool = kzalloc(sizeof(*io_pool), GFP_KERNEL); + io_pool = kzalloc_obj(*io_pool, GFP_KERNEL); if (!io_pool) return NULL; @@ -35,7 +35,7 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl) spin_lock_init(&io_pool->lock); for (i = 0; i < EFCT_NUM_SCSI_IOS; i++) { - io = kzalloc(sizeof(*io), GFP_KERNEL); + io = kzalloc_obj(*io, GFP_KERNEL); if (!io) break; diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c index bd3d489e56ae..a6ad6b84fc7a 100644 --- a/drivers/scsi/elx/efct/efct_lio.c +++ b/drivers/scsi/elx/efct/efct_lio.c @@ -744,7 +744,7 @@ efct_lio_make_nport(struct target_fabric_configfs *tf, return ERR_PTR(-ENXIO); } - lio_nport = kzalloc(sizeof(*lio_nport), GFP_KERNEL); + lio_nport = kzalloc_obj(*lio_nport, GFP_KERNEL); if (!lio_nport) return ERR_PTR(-ENOMEM); @@ -796,7 +796,7 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, return ERR_PTR(-ENXIO); } - lio_vport = kzalloc(sizeof(*lio_vport), GFP_KERNEL); + lio_vport = kzalloc_obj(*lio_vport, GFP_KERNEL); if (!lio_vport) return ERR_PTR(-ENOMEM); @@ -808,7 +808,7 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, efct_format_wwn(lio_vport->wwpn_str, sizeof(lio_vport->wwpn_str), "naa.", npiv_wwpn); - vport_list = kzalloc(sizeof(*vport_list), GFP_KERNEL); + vport_list = kzalloc_obj(*vport_list, GFP_KERNEL); if (!vport_list) { kfree(lio_vport); return ERR_PTR(-ENOMEM); @@ -895,7 +895,7 @@ efct_lio_make_tpg(struct se_wwn *wwn, const char *name) if (kstrtoul(name + 5, 10, &n) || n > USHRT_MAX) return ERR_PTR(-EINVAL); - tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); + tpg = kzalloc_obj(*tpg, GFP_KERNEL); if (!tpg) return ERR_PTR(-ENOMEM); @@ -958,7 +958,7 @@ efct_lio_npiv_make_tpg(struct se_wwn *wwn, const char *name) return ERR_PTR(-EINVAL); } - tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); + tpg = kzalloc_obj(*tpg, GFP_KERNEL); if (!tpg) return ERR_PTR(-ENOMEM); @@ -1069,7 +1069,7 @@ static int efct_session_cb(struct se_portal_group *se_tpg, struct efct_node *tgt_node; struct efct *efct = node->efc->base; - tgt_node = kzalloc(sizeof(*tgt_node), GFP_KERNEL); + tgt_node = kzalloc_obj(*tgt_node, GFP_KERNEL); if (!tgt_node) return -ENOMEM; @@ -1227,7 +1227,7 @@ int efct_scsi_new_initiator(struct efc *efc, struct efc_node *node) * Since LIO only supports initiator validation at thread level, * we are open minded and accept all callers. */ - wq_data = kzalloc(sizeof(*wq_data), GFP_ATOMIC); + wq_data = kzalloc_obj(*wq_data, GFP_ATOMIC); if (!wq_data) return -ENOMEM; @@ -1292,7 +1292,7 @@ int efct_scsi_del_initiator(struct efc *efc, struct efc_node *node, int reason) return -EIO; } - wq_data = kzalloc(sizeof(*wq_data), GFP_ATOMIC); + wq_data = kzalloc_obj(*wq_data, GFP_ATOMIC); if (!wq_data) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_xport.c b/drivers/scsi/elx/efct/efct_xport.c index dfe05fab7b42..66574b8c9f9e 100644 --- a/drivers/scsi/elx/efct/efct_xport.c +++ b/drivers/scsi/elx/efct/efct_xport.c @@ -28,7 +28,7 @@ efct_xport_alloc(struct efct *efct) { struct efct_xport *xport; - xport = kzalloc(sizeof(*xport), GFP_KERNEL); + xport = kzalloc_obj(*xport, GFP_KERNEL); if (!xport) return xport; diff --git a/drivers/scsi/elx/libefc/efc_domain.c b/drivers/scsi/elx/libefc/efc_domain.c index ca9d7ff2c0d2..554a538ffd33 100644 --- a/drivers/scsi/elx/libefc/efc_domain.c +++ b/drivers/scsi/elx/libefc/efc_domain.c @@ -134,7 +134,7 @@ efc_domain_alloc(struct efc *efc, uint64_t fcf_wwn) { struct efc_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_ATOMIC); + domain = kzalloc_obj(*domain, GFP_ATOMIC); if (!domain) return NULL; diff --git a/drivers/scsi/elx/libefc/efc_fabric.c b/drivers/scsi/elx/libefc/efc_fabric.c index 4ed9f46ded65..12e82deb2a35 100644 --- a/drivers/scsi/elx/libefc/efc_fabric.c +++ b/drivers/scsi/elx/libefc/efc_fabric.c @@ -685,7 +685,7 @@ efc_process_gidpt_payload(struct efc_node *node, } /* Allocate a buffer for all nodes */ - active_nodes = kcalloc(port_count, sizeof(*active_nodes), GFP_ATOMIC); + active_nodes = kzalloc_objs(*active_nodes, port_count, GFP_ATOMIC); if (!active_nodes) { node_printf(node, "efc_malloc failed\n"); return -EIO; diff --git a/drivers/scsi/elx/libefc/efc_nport.c b/drivers/scsi/elx/libefc/efc_nport.c index 1a7437f4328e..1ea26c7337eb 100644 --- a/drivers/scsi/elx/libefc/efc_nport.c +++ b/drivers/scsi/elx/libefc/efc_nport.c @@ -82,7 +82,7 @@ efc_nport_alloc(struct efc_domain *domain, uint64_t wwpn, uint64_t wwnn, } } - nport = kzalloc(sizeof(*nport), GFP_ATOMIC); + nport = kzalloc_obj(*nport, GFP_ATOMIC); if (!nport) return nport; @@ -756,7 +756,7 @@ efc_vport_create_spec(struct efc *efc, uint64_t wwnn, uint64_t wwpn, } } - vport = kzalloc(sizeof(*vport), GFP_ATOMIC); + vport = kzalloc_obj(*vport, GFP_ATOMIC); if (!vport) { spin_unlock_irqrestore(&efc->vport_lock, flags); return NULL; diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 04a07fe57be2..fd72946ec41f 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -103,8 +103,8 @@ static void esas2r_initmem_free(struct esas2r_adapter *a, static bool alloc_vda_req(struct esas2r_adapter *a, struct esas2r_request *rq) { - struct esas2r_mem_desc *memdesc = kzalloc( - sizeof(struct esas2r_mem_desc), GFP_KERNEL); + struct esas2r_mem_desc *memdesc = kzalloc_obj(struct esas2r_mem_desc, + GFP_KERNEL); if (memdesc == NULL) { esas2r_hdebug("could not alloc mem for vda request memdesc\n"); @@ -783,8 +783,7 @@ bool esas2r_init_adapter_struct(struct esas2r_adapter *a, /* allocate requests for asynchronous events */ a->first_ae_req = - kcalloc(num_ae_requests, sizeof(struct esas2r_request), - GFP_KERNEL); + kzalloc_objs(struct esas2r_request, num_ae_requests, GFP_KERNEL); if (a->first_ae_req == NULL) { esas2r_log(ESAS2R_LOG_CRIT, @@ -793,8 +792,8 @@ bool esas2r_init_adapter_struct(struct esas2r_adapter *a, } /* allocate the S/G list memory descriptors */ - a->sg_list_mds = kcalloc(num_sg_lists, sizeof(struct esas2r_mem_desc), - GFP_KERNEL); + a->sg_list_mds = kzalloc_objs(struct esas2r_mem_desc, num_sg_lists, + GFP_KERNEL); if (a->sg_list_mds == NULL) { esas2r_log(ESAS2R_LOG_CRIT, @@ -804,9 +803,8 @@ bool esas2r_init_adapter_struct(struct esas2r_adapter *a, /* allocate the request table */ a->req_table = - kcalloc(num_requests + num_ae_requests + 1, - sizeof(struct esas2r_request *), - GFP_KERNEL); + kzalloc_objs(struct esas2r_request *, + num_requests + num_ae_requests + 1, GFP_KERNEL); if (a->req_table == NULL) { esas2r_log(ESAS2R_LOG_CRIT, diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index fdcffc871d19..454807522250 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -194,8 +194,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj, int length = min(sizeof(struct atto_ioctl), count); if (!a->local_atto_ioctl) { - a->local_atto_ioctl = kmalloc(sizeof(struct atto_ioctl), - GFP_KERNEL); + a->local_atto_ioctl = kmalloc_obj(struct atto_ioctl, GFP_KERNEL); if (a->local_atto_ioctl == NULL) { esas2r_log(ESAS2R_LOG_WARN, "write_hw kzalloc failed for %zu bytes", @@ -1831,7 +1830,7 @@ void esas2r_queue_fw_event(struct esas2r_adapter *a, struct esas2r_fw_event_work *fw_event; unsigned long flags; - fw_event = kzalloc(sizeof(struct esas2r_fw_event_work), GFP_ATOMIC); + fw_event = kzalloc_obj(struct esas2r_fw_event_work, GFP_ATOMIC); if (!fw_event) { esas2r_log(ESAS2R_LOG_WARN, "esas2r_queue_fw_event failed to alloc"); diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 05647ccc3c8a..af46112b4fb0 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -881,7 +881,7 @@ static struct esp_cmd_entry *esp_get_ent(struct esp *esp) struct esp_cmd_entry *ret; if (list_empty(head)) { - ret = kzalloc(sizeof(struct esp_cmd_entry), GFP_ATOMIC); + ret = kzalloc_obj(struct esp_cmd_entry, GFP_ATOMIC); } else { ret = list_entry(head->next, struct esp_cmd_entry, list); list_del(&ret->list); @@ -2447,7 +2447,7 @@ static int esp_sdev_init(struct scsi_device *dev) struct esp_target_data *tp = &esp->target[dev->id]; struct esp_lun_data *lp; - lp = kzalloc(sizeof(*lp), GFP_KERNEL); + lp = kzalloc_obj(*lp, GFP_KERNEL); if (!lp) return -ENOMEM; dev->hostdata = lp; diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index c8c5dfb3ba9a..bc0064da561c 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -820,7 +820,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) if (realdev->netdev_ops->ndo_fcoe_get_hbainfo) { struct netdev_fcoe_hbainfo *fdmi; - fdmi = kzalloc(sizeof(*fdmi), GFP_KERNEL); + fdmi = kzalloc_obj(*fdmi, GFP_KERNEL); if (!fdmi) return; diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index 8e4241c295e3..a356cf072bf1 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -168,7 +168,7 @@ static int fcoe_sysfs_fcf_add(struct fcoe_fcf *new) LIBFCOE_FIP_DBG(fip, "New FCF fab %16.16llx mac %pM\n", new->fabric_name, new->fcf_mac); - temp = kzalloc(sizeof(*temp), GFP_KERNEL); + temp = kzalloc_obj(*temp, GFP_KERNEL); if (!temp) goto out; @@ -1043,7 +1043,7 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb) if (fip->fcf_count >= FCOE_CTLR_FCF_LIMIT) goto out; - fcf = kmalloc(sizeof(*fcf), GFP_ATOMIC); + fcf = kmalloc_obj(*fcf, GFP_ATOMIC); if (!fcf) goto out; @@ -1378,8 +1378,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, */ num_vlink_desc = rlen / sizeof(*vp); if (num_vlink_desc) - vlink_desc_arr = kmalloc_array(num_vlink_desc, sizeof(vp), - GFP_ATOMIC); + vlink_desc_arr = kmalloc_objs(vp, num_vlink_desc, GFP_ATOMIC); if (!vlink_desc_arr) return; num_vlink_desc = 0; diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c index 0609ca6b9353..afea5763a3c0 100644 --- a/drivers/scsi/fcoe/fcoe_sysfs.c +++ b/drivers/scsi/fcoe/fcoe_sysfs.c @@ -986,7 +986,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr, } } - fcf = kzalloc(sizeof(struct fcoe_fcf_device), GFP_ATOMIC); + fcf = kzalloc_obj(struct fcoe_fcf_device, GFP_ATOMIC); if (unlikely(!fcf)) goto out; diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index 2f478426f16e..e1615cc5c092 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c @@ -638,7 +638,7 @@ static int fcoe_add_netdev_mapping(struct net_device *netdev, { struct fcoe_netdev_mapping *nm; - nm = kmalloc(sizeof(*nm), GFP_KERNEL); + nm = kmalloc_obj(*nm, GFP_KERNEL); if (!nm) { printk(KERN_ERR "Unable to allocate netdev_mapping"); return -ENOMEM; diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c index ae37f85f618b..69ffc492ec9d 100644 --- a/drivers/scsi/fnic/fdls_disc.c +++ b/drivers/scsi/fnic/fdls_disc.c @@ -272,7 +272,7 @@ void fdls_schedule_oxid_free(struct fnic_iport_s *iport, uint16_t *active_oxid) *active_oxid = FNIC_UNASSIGNED_OXID; reclaim_entry = (struct reclaim_entry_s *) - kzalloc(sizeof(struct reclaim_entry_s), GFP_ATOMIC); + kzalloc_obj(struct reclaim_entry_s, GFP_ATOMIC); if (!reclaim_entry) { FNIC_FCS_DBG(KERN_WARNING, fnic->host, fnic->fnic_num, @@ -316,7 +316,7 @@ void fdls_schedule_oxid_free_retry_work(struct work_struct *work) FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "Schedule oxid free. oxid idx: %d\n", idx); - reclaim_entry = kzalloc(sizeof(*reclaim_entry), GFP_KERNEL); + reclaim_entry = kzalloc_obj(*reclaim_entry, GFP_KERNEL); if (!reclaim_entry) { schedule_delayed_work(&oxid_pool->schedule_oxid_free_retry, msecs_to_jiffies(SCHEDULE_OXID_FREE_RETRY_TIME)); @@ -1270,7 +1270,7 @@ bool fdls_delete_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport) if (tport->flags & FNIC_FDLS_SCSI_REGISTERED) { tport_del_evt = - kzalloc(sizeof(struct fnic_tport_event_s), GFP_ATOMIC); + kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC); if (!tport_del_evt) { FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "Failed to allocate memory for tport fcid: 0x%0x\n", @@ -1776,7 +1776,7 @@ static struct fnic_tport_s *fdls_create_tport(struct fnic_iport_s *iport, FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "FDLS create tport: fcid: 0x%x wwpn: 0x%llx", fcid, wwpn); - tport = kzalloc(sizeof(struct fnic_tport_s), GFP_ATOMIC); + tport = kzalloc_obj(struct fnic_tport_s, GFP_ATOMIC); if (!tport) { FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "Memory allocation failure while creating tport: 0x%x\n", @@ -2365,7 +2365,7 @@ static void fdls_send_delete_tport_msg(struct fnic_tport_s *tport) struct fnic *fnic = iport->fnic; struct fnic_tport_event_s *tport_del_evt; - tport_del_evt = kzalloc(sizeof(struct fnic_tport_event_s), GFP_ATOMIC); + tport_del_evt = kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC); if (!tport_del_evt) { FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "Failed to allocate memory for tport event fcid: 0x%x", @@ -2852,7 +2852,7 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport, fdls_set_tport_state(tport, FDLS_TGT_STATE_READY); /* Inform the driver about new target added */ - tport_add_evt = kzalloc(sizeof(struct fnic_tport_event_s), GFP_ATOMIC); + tport_add_evt = kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC); if (!tport_add_evt) { FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "tport event memory allocation failure: 0x%0x\n", diff --git a/drivers/scsi/fnic/fip.c b/drivers/scsi/fnic/fip.c index ce62ab1180bd..5072c08e75ad 100644 --- a/drivers/scsi/fnic/fip.c +++ b/drivers/scsi/fnic/fip.c @@ -139,7 +139,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph) FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "process_vlan_resp: FIP VLAN %d\n", vid); - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) { /* retry from timer */ diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index 5767862ae42f..ef5298685054 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -200,7 +200,7 @@ static int fnic_trace_debugfs_open(struct inode *inode, fnic_dbgfs_t *fnic_dbg_prt; u8 *rdata_ptr; rdata_ptr = (u8 *)inode->i_private; - fnic_dbg_prt = kzalloc(sizeof(fnic_dbgfs_t), GFP_KERNEL); + fnic_dbg_prt = kzalloc_obj(fnic_dbgfs_t, GFP_KERNEL); if (!fnic_dbg_prt) return -ENOMEM; @@ -436,7 +436,7 @@ static int fnic_reset_stats_open(struct inode *inode, struct file *file) { struct stats_debug_info *debug; - debug = kzalloc(sizeof(struct stats_debug_info), GFP_KERNEL); + debug = kzalloc_obj(struct stats_debug_info, GFP_KERNEL); if (!debug) return -ENOMEM; @@ -583,7 +583,7 @@ static int fnic_stats_debugfs_open(struct inode *inode, struct stats_debug_info *debug; int buf_size = 2 * PAGE_SIZE; - debug = kzalloc(sizeof(struct stats_debug_info), GFP_KERNEL); + debug = kzalloc_obj(struct stats_debug_info, GFP_KERNEL); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index 103ab6f1f7cd..405b341b73d7 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c @@ -376,7 +376,7 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, void *fp) eh = (struct ethhdr *) fp; if ((eh->h_proto == cpu_to_be16(ETH_P_FIP)) && (fnic->iport.usefip)) { fip_fr_elem = (struct fnic_frame_list *) - kzalloc(sizeof(struct fnic_frame_list), GFP_ATOMIC); + kzalloc_obj(struct fnic_frame_list, GFP_ATOMIC); if (!fip_fr_elem) return 0; fip_fr_elem->fp = fp; diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 4cc4077ea53c..8a8c008ea2c7 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -715,7 +715,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* * Allocate fnic */ - fnic = kzalloc(sizeof(struct fnic), GFP_KERNEL); + fnic = kzalloc_obj(struct fnic, GFP_KERNEL); if (!fnic) { err = -ENOMEM; goto err_out_fnic_alloc; diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c index e0b173cc9d5f..590effeb21e6 100644 --- a/drivers/scsi/fnic/vnic_dev.c +++ b/drivers/scsi/fnic/vnic_dev.c @@ -422,7 +422,7 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev) if (vdev->devcmd2) return 0; - vdev->devcmd2 = kzalloc(sizeof(*vdev->devcmd2), GFP_ATOMIC); + vdev->devcmd2 = kzalloc_obj(*vdev->devcmd2, GFP_ATOMIC); if (!vdev->devcmd2) return -ENOMEM; @@ -911,7 +911,7 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev, void *priv, struct pci_dev *pdev, struct vnic_dev_bar *bar) { if (!vdev) { - vdev = kzalloc(sizeof(struct vnic_dev), GFP_KERNEL); + vdev = kzalloc_obj(struct vnic_dev, GFP_KERNEL); if (!vdev) return NULL; } diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 3e235dbfb67a..ce20f8906ac7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -1597,7 +1597,7 @@ static void hpsa_monitor_offline_device(struct ctlr_info *h, spin_unlock_irqrestore(&h->offline_device_lock, flags); /* Device is not on the list, add it. */ - device = kmalloc(sizeof(*device), GFP_KERNEL); + device = kmalloc_obj(*device, GFP_KERNEL); if (!device) return; @@ -1936,8 +1936,8 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, } spin_unlock_irqrestore(&h->reset_lock, flags); - added = kcalloc(HPSA_MAX_DEVICES, sizeof(*added), GFP_KERNEL); - removed = kcalloc(HPSA_MAX_DEVICES, sizeof(*removed), GFP_KERNEL); + added = kzalloc_objs(*added, HPSA_MAX_DEVICES, GFP_KERNEL); + removed = kzalloc_objs(*removed, HPSA_MAX_DEVICES, GFP_KERNEL); if (!added || !removed) { dev_warn(&h->pdev->dev, "out of memory in " @@ -2200,15 +2200,13 @@ static int hpsa_allocate_ioaccel2_sg_chain_blocks(struct ctlr_info *h) return 0; h->ioaccel2_cmd_sg_list = - kcalloc(h->nr_cmds, sizeof(*h->ioaccel2_cmd_sg_list), - GFP_KERNEL); + kzalloc_objs(*h->ioaccel2_cmd_sg_list, h->nr_cmds, GFP_KERNEL); if (!h->ioaccel2_cmd_sg_list) return -ENOMEM; for (i = 0; i < h->nr_cmds; i++) { h->ioaccel2_cmd_sg_list[i] = - kmalloc_array(h->maxsgentries, - sizeof(*h->ioaccel2_cmd_sg_list[i]), - GFP_KERNEL); + kmalloc_objs(*h->ioaccel2_cmd_sg_list[i], + h->maxsgentries, GFP_KERNEL); if (!h->ioaccel2_cmd_sg_list[i]) goto clean; } @@ -2240,15 +2238,13 @@ static int hpsa_alloc_sg_chain_blocks(struct ctlr_info *h) if (h->chainsize <= 0) return 0; - h->cmd_sg_list = kcalloc(h->nr_cmds, sizeof(*h->cmd_sg_list), - GFP_KERNEL); + h->cmd_sg_list = kzalloc_objs(*h->cmd_sg_list, h->nr_cmds, GFP_KERNEL); if (!h->cmd_sg_list) return -ENOMEM; for (i = 0; i < h->nr_cmds; i++) { - h->cmd_sg_list[i] = kmalloc_array(h->chainsize, - sizeof(*h->cmd_sg_list[i]), - GFP_KERNEL); + h->cmd_sg_list[i] = kmalloc_objs(*h->cmd_sg_list[i], + h->chainsize, GFP_KERNEL); if (!h->cmd_sg_list[i]) goto clean; @@ -3469,11 +3465,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, goto out; } - bssbp = kzalloc(sizeof(*bssbp), GFP_KERNEL); + bssbp = kzalloc_obj(*bssbp, GFP_KERNEL); if (!bssbp) goto out; - id_phys = kzalloc(sizeof(*id_phys), GFP_KERNEL); + id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); if (!id_phys) goto out; @@ -3534,7 +3530,7 @@ static u64 hpsa_get_sas_address_from_report_physical(struct ctlr_info *h, u64 sa = 0; int i; - physdev = kzalloc(sizeof(*physdev), GFP_KERNEL); + physdev = kzalloc_obj(*physdev, GFP_KERNEL); if (!physdev) return 0; @@ -3565,7 +3561,7 @@ static void hpsa_get_sas_address(struct ctlr_info *h, unsigned char *scsi3addr, if (is_hba_lunid(scsi3addr)) { struct bmic_sense_subsystem_info *ssi; - ssi = kzalloc(sizeof(*ssi), GFP_KERNEL); + ssi = kzalloc_obj(*ssi, GFP_KERNEL); if (!ssi) return; @@ -3789,7 +3785,7 @@ static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h, return rc; /* REPORT PHYS EXTENDED is not supported */ - lbuf = kzalloc(sizeof(*lbuf), GFP_KERNEL); + lbuf = kzalloc_obj(*lbuf, GFP_KERNEL); if (!lbuf) return -ENOMEM; @@ -4260,7 +4256,7 @@ static bool hpsa_is_disk_spare(struct ctlr_info *h, u8 *lunaddrbytes) bool is_spare = false; int rc; - id_phys = kzalloc(sizeof(*id_phys), GFP_KERNEL); + id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); if (!id_phys) return false; @@ -4345,12 +4341,12 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) int raid_ctlr_position; bool physical_device; - currentsd = kcalloc(HPSA_MAX_DEVICES, sizeof(*currentsd), GFP_KERNEL); - physdev_list = kzalloc(sizeof(*physdev_list), GFP_KERNEL); - logdev_list = kzalloc(sizeof(*logdev_list), GFP_KERNEL); - tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL); - id_phys = kzalloc(sizeof(*id_phys), GFP_KERNEL); - id_ctlr = kzalloc(sizeof(*id_ctlr), GFP_KERNEL); + currentsd = kzalloc_objs(*currentsd, HPSA_MAX_DEVICES, GFP_KERNEL); + physdev_list = kzalloc_obj(*physdev_list, GFP_KERNEL); + logdev_list = kzalloc_obj(*logdev_list, GFP_KERNEL); + tmpdevice = kzalloc_obj(*tmpdevice, GFP_KERNEL); + id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); + id_ctlr = kzalloc_obj(*id_ctlr, GFP_KERNEL); if (!currentsd || !physdev_list || !logdev_list || !tmpdevice || !id_phys || !id_ctlr) { @@ -4390,7 +4386,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) break; } - currentsd[i] = kzalloc(sizeof(*currentsd[i]), GFP_KERNEL); + currentsd[i] = kzalloc_obj(*currentsd[i], GFP_KERNEL); if (!currentsd[i]) { h->drv_req_rescan = 1; goto out; @@ -6504,7 +6500,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, status = -ENOMEM; goto cleanup1; } - buff_size = kmalloc_array(SG_ENTRIES_IN_CMD, sizeof(int), GFP_KERNEL); + buff_size = kmalloc_objs(int, SG_ENTRIES_IN_CMD, GFP_KERNEL); if (!buff_size) { status = -ENOMEM; goto cleanup1; @@ -8494,7 +8490,7 @@ static int hpsa_luns_changed(struct ctlr_info *h) if (!h->lastlogicals) return rc; - logdev = kzalloc(sizeof(*logdev), GFP_KERNEL); + logdev = kzalloc_obj(*logdev, GFP_KERNEL); if (!logdev) return rc; @@ -8635,7 +8631,7 @@ static struct ctlr_info *hpda_alloc_ctlr_info(void) { struct ctlr_info *h; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return NULL; @@ -8856,7 +8852,7 @@ reinit_after_soft_reset: hpsa_hba_inquiry(h); - h->lastlogicals = kzalloc(sizeof(*(h->lastlogicals)), GFP_KERNEL); + h->lastlogicals = kzalloc_obj(*(h->lastlogicals), GFP_KERNEL); if (!h->lastlogicals) dev_info(&h->pdev->dev, "Can't track change to report lun data\n"); @@ -8960,7 +8956,7 @@ static void hpsa_disable_rld_caching(struct ctlr_info *h) if (unlikely(h->lockup_detected)) return; - options = kzalloc(sizeof(*options), GFP_KERNEL); + options = kzalloc_obj(*options, GFP_KERNEL); if (!options) return; @@ -9557,7 +9553,7 @@ static struct hpsa_sas_phy *hpsa_alloc_sas_phy( struct hpsa_sas_phy *hpsa_sas_phy; struct sas_phy *phy; - hpsa_sas_phy = kzalloc(sizeof(*hpsa_sas_phy), GFP_KERNEL); + hpsa_sas_phy = kzalloc_obj(*hpsa_sas_phy, GFP_KERNEL); if (!hpsa_sas_phy) return NULL; @@ -9642,7 +9638,7 @@ static struct hpsa_sas_port struct hpsa_sas_port *hpsa_sas_port; struct sas_port *port; - hpsa_sas_port = kzalloc(sizeof(*hpsa_sas_port), GFP_KERNEL); + hpsa_sas_port = kzalloc_obj(*hpsa_sas_port, GFP_KERNEL); if (!hpsa_sas_port) return NULL; @@ -9690,7 +9686,7 @@ static struct hpsa_sas_node *hpsa_alloc_sas_node(struct device *parent_dev) { struct hpsa_sas_node *hpsa_sas_node; - hpsa_sas_node = kzalloc(sizeof(*hpsa_sas_node), GFP_KERNEL); + hpsa_sas_node = kzalloc_obj(*hpsa_sas_node, GFP_KERNEL); if (hpsa_sas_node) { hpsa_sas_node->parent_dev = parent_dev; INIT_LIST_HEAD(&hpsa_sas_node->port_list_head); diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 1c370d11b6dd..2973395badab 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -797,7 +797,7 @@ static int ibmvfc_init_event_pool(struct ibmvfc_host *vhost, return 0; pool->size = queue->total_depth; - pool->events = kcalloc(pool->size, sizeof(*pool->events), GFP_KERNEL); + pool->events = kzalloc_objs(*pool->events, pool->size, GFP_KERNEL); if (!pool->events) return -ENOMEM; @@ -6057,9 +6057,8 @@ static int ibmvfc_alloc_channels(struct ibmvfc_host *vhost, int i, j; int rc = 0; - channels->scrqs = kcalloc(channels->max_queues, - sizeof(*channels->scrqs), - GFP_KERNEL); + channels->scrqs = kzalloc_objs(*channels->scrqs, channels->max_queues, + GFP_KERNEL); if (!channels->scrqs) return -ENOMEM; @@ -6211,8 +6210,8 @@ static int ibmvfc_alloc_mem(struct ibmvfc_host *vhost) if (ibmvfc_alloc_disc_buf(dev, &vhost->scsi_scrqs)) goto free_login_buffer; - vhost->trace = kcalloc(IBMVFC_NUM_TRACE_ENTRIES, - sizeof(struct ibmvfc_trace_entry), GFP_KERNEL); + vhost->trace = kzalloc_objs(struct ibmvfc_trace_entry, + IBMVFC_NUM_TRACE_ENTRIES, GFP_KERNEL); atomic_set(&vhost->trace_index, -1); if (!vhost->trace) diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 200debd6f7e8..da88b6b125d6 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -447,7 +447,7 @@ static int initialize_event_pool(struct event_pool *pool, pool->size = size; pool->next = 0; - pool->events = kcalloc(pool->size, sizeof(*pool->events), GFP_KERNEL); + pool->events = kzalloc_objs(*pool->events, pool->size, GFP_KERNEL); if (!pool->events) return -ENOMEM; diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index f259746bc804..a3a6953ba1c7 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -2214,7 +2214,7 @@ static int ibmvscsis_make_nexus(struct ibmvscsis_tport *tport) return 0; } - nexus = kzalloc(sizeof(*nexus), GFP_KERNEL); + nexus = kzalloc_obj(*nexus, GFP_KERNEL); if (!nexus) { dev_err(&vscsi->dev, "Unable to allocate struct ibmvscsis_nexus\n"); return -ENOMEM; @@ -3424,7 +3424,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev, int rc = 0; long hrc = 0; - vscsi = kzalloc(sizeof(*vscsi), GFP_KERNEL); + vscsi = kzalloc_obj(*vscsi, GFP_KERNEL); if (!vscsi) { rc = -ENOMEM; dev_err(&vdev->dev, "probe: allocation of adapter failed\n"); diff --git a/drivers/scsi/ibmvscsi_tgt/libsrp.c b/drivers/scsi/ibmvscsi_tgt/libsrp.c index 0ecad398ed3d..8fd0bc7cb429 100644 --- a/drivers/scsi/ibmvscsi_tgt/libsrp.c +++ b/drivers/scsi/ibmvscsi_tgt/libsrp.c @@ -27,10 +27,10 @@ static int srp_iu_pool_alloc(struct srp_queue *q, size_t max, struct iu_entry *iue; int i; - q->pool = kcalloc(max, sizeof(struct iu_entry *), GFP_KERNEL); + q->pool = kzalloc_objs(struct iu_entry *, max, GFP_KERNEL); if (!q->pool) return -ENOMEM; - q->items = kcalloc(max, sizeof(struct iu_entry), GFP_KERNEL); + q->items = kzalloc_objs(struct iu_entry, max, GFP_KERNEL); if (!q->items) goto free_pool; @@ -61,12 +61,12 @@ static struct srp_buf **srp_ring_alloc(struct device *dev, struct srp_buf **ring; int i; - ring = kcalloc(max, sizeof(struct srp_buf *), GFP_KERNEL); + ring = kzalloc_objs(struct srp_buf *, max, GFP_KERNEL); if (!ring) return NULL; for (i = 0; i < max; i++) { - ring[i] = kzalloc(sizeof(*ring[i]), GFP_KERNEL); + ring[i] = kzalloc_obj(*ring[i], GFP_KERNEL); if (!ring[i]) goto out; ring[i]->buf = dma_alloc_coherent(dev, size, &ring[i]->dma, diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index da7aaac10a73..2ed57ea13884 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -1158,7 +1158,7 @@ static int __imm_attach(struct parport *pb) init_waitqueue_head(&waiting); - dev = kzalloc(sizeof(imm_struct), GFP_KERNEL); + dev = kzalloc_obj(imm_struct, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index c0487ce38d8d..3b3f40eb32f4 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -3776,7 +3776,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len) order = get_order(sg_size); /* Allocate a scatter/gather list for the DMA */ - sglist = kzalloc(sizeof(struct ipr_sglist), GFP_KERNEL); + sglist = kzalloc_obj(struct ipr_sglist, GFP_KERNEL); if (sglist == NULL) { ipr_trace; return NULL; @@ -4273,7 +4273,7 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg) __be32 **ioa_data; unsigned long lock_flags = 0; - dump = kzalloc(sizeof(struct ipr_dump), GFP_KERNEL); + dump = kzalloc_obj(struct ipr_dump, GFP_KERNEL); if (!dump) { ipr_err("Dump memory allocation failed\n"); @@ -8859,8 +8859,10 @@ static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg) if (!ioa_cfg->ipr_cmd_pool) return -ENOMEM; - ioa_cfg->ipr_cmnd_list = kcalloc(IPR_NUM_CMD_BLKS, sizeof(struct ipr_cmnd *), GFP_KERNEL); - ioa_cfg->ipr_cmnd_list_dma = kcalloc(IPR_NUM_CMD_BLKS, sizeof(dma_addr_t), GFP_KERNEL); + ioa_cfg->ipr_cmnd_list = kzalloc_objs(struct ipr_cmnd *, + IPR_NUM_CMD_BLKS, GFP_KERNEL); + ioa_cfg->ipr_cmnd_list_dma = kzalloc_objs(dma_addr_t, IPR_NUM_CMD_BLKS, + GFP_KERNEL); if (!ioa_cfg->ipr_cmnd_list || !ioa_cfg->ipr_cmnd_list_dma) { ipr_free_cmd_blks(ioa_cfg); @@ -8963,9 +8965,9 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg) int i, rc = -ENOMEM; ENTER; - ioa_cfg->res_entries = kcalloc(ioa_cfg->max_devs_supported, - sizeof(struct ipr_resource_entry), - GFP_KERNEL); + ioa_cfg->res_entries = kzalloc_objs(struct ipr_resource_entry, + ioa_cfg->max_devs_supported, + GFP_KERNEL); if (!ioa_cfg->res_entries) goto out; @@ -9026,9 +9028,8 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg) list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q); } - ioa_cfg->trace = kcalloc(IPR_NUM_TRACE_ENTRIES, - sizeof(struct ipr_trace_entry), - GFP_KERNEL); + ioa_cfg->trace = kzalloc_objs(struct ipr_trace_entry, + IPR_NUM_TRACE_ENTRIES, GFP_KERNEL); if (!ioa_cfg->trace) goto out_free_hostrcb_dma; diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 0089b17ed288..6bb87f02b746 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -1086,7 +1086,7 @@ static enum scsi_qc_status ips_queue_lck(struct scsi_cmnd *SC) } /* allocate space for the scribble */ - scratch = kmalloc(sizeof (ips_copp_wait_item_t), GFP_ATOMIC); + scratch = kmalloc_obj(ips_copp_wait_item_t, GFP_ATOMIC); if (!scratch) { SC->result = DID_ERROR << 16; @@ -6874,7 +6874,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) } /* found a controller */ - ha = kzalloc(sizeof (ips_ha_t), GFP_KERNEL); + ha = kzalloc_obj(ips_ha_t, GFP_KERNEL); if (ha == NULL) { IPS_PRINTK(KERN_WARNING, pci_dev, "Unable to allocate temporary ha struct\n"); @@ -6947,7 +6947,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) ha->logical_drive_info_dma_addr = dma_address; - ha->conf = kmalloc(sizeof (IPS_CONF), GFP_KERNEL); + ha->conf = kmalloc_obj(IPS_CONF, GFP_KERNEL); if (!ha->conf) { IPS_PRINTK(KERN_WARNING, pci_dev, @@ -6955,7 +6955,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) return ips_abort_init(ha, index); } - ha->nvram = kmalloc(sizeof (IPS_NVRAM_P5), GFP_KERNEL); + ha->nvram = kmalloc_obj(IPS_NVRAM_P5, GFP_KERNEL); if (!ha->nvram) { IPS_PRINTK(KERN_WARNING, pci_dev, @@ -6963,7 +6963,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) return ips_abort_init(ha, index); } - ha->subsys = kmalloc(sizeof (IPS_SUBSYS), GFP_KERNEL); + ha->subsys = kmalloc_obj(IPS_SUBSYS, GFP_KERNEL); if (!ha->subsys) { IPS_PRINTK(KERN_WARNING, pci_dev, diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c index a64abe38db2d..09fa63fc18f5 100644 --- a/drivers/scsi/iscsi_boot_sysfs.c +++ b/drivers/scsi/iscsi_boot_sysfs.c @@ -344,7 +344,7 @@ iscsi_boot_create_kobj(struct iscsi_boot_kset *boot_kset, { struct iscsi_boot_kobj *boot_kobj; - boot_kobj = kzalloc(sizeof(*boot_kobj), GFP_KERNEL); + boot_kobj = kzalloc_obj(*boot_kobj, GFP_KERNEL); if (!boot_kobj) return NULL; INIT_LIST_HEAD(&boot_kobj->list); @@ -497,7 +497,7 @@ struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name) { struct iscsi_boot_kset *boot_kset; - boot_kset = kzalloc(sizeof(*boot_kset), GFP_KERNEL); + boot_kset = kzalloc_obj(*boot_kset, GFP_KERNEL); if (!boot_kset) return NULL; diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c index 86fe19e0468d..4663927255ba 100644 --- a/drivers/scsi/lasi700.c +++ b/drivers/scsi/lasi700.c @@ -88,7 +88,7 @@ lasi700_probe(struct parisc_device *dev) struct NCR_700_Host_Parameters *hostdata; struct Scsi_Host *host; - hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL); + hostdata = kzalloc_obj(*hostdata, GFP_KERNEL); if (!hostdata) { dev_printk(KERN_ERR, &dev->dev, "Failed to allocate host data\n"); return -ENOMEM; diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 60d621ad0024..5cc10b70b772 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -116,7 +116,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp) case ELS_ADDR_FMT_PORT: FC_DISC_DBG(disc, "Port address format for port " "(%6.6x)\n", ntoh24(pp->rscn_fid)); - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); if (!dp) { redisc = 1; break; diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index f84a7e6ae379..9183a0e9568a 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -2391,7 +2391,7 @@ struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, { struct fc_exch_mgr_anchor *ema; - ema = kmalloc(sizeof(*ema), GFP_ATOMIC); + ema = kmalloc_obj(*ema, GFP_ATOMIC); if (!ema) return ema; @@ -2480,7 +2480,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport, /* * allocate memory for EM */ - mp = kzalloc(sizeof(struct fc_exch_mgr), GFP_ATOMIC); + mp = kzalloc_obj(struct fc_exch_mgr, GFP_ATOMIC); if (!mp) return NULL; diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 2f93f6c65a86..414bd2e45fec 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -2298,7 +2298,7 @@ int fc_fcp_init(struct fc_lport *lport) if (!lport->tt.fcp_abort_io) lport->tt.fcp_abort_io = fc_fcp_abort_io; - si = kzalloc(sizeof(struct fc_fcp_internal), GFP_KERNEL); + si = kzalloc_obj(struct fc_fcp_internal, GFP_KERNEL); if (!si) return -ENOMEM; lport->scsi_priv = si; diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 310fa5add5f0..67583e44ad5b 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -2049,7 +2049,7 @@ static int fc_lport_els_request(struct bsg_job *job, fh->fh_df_ctl = 0; fh->fh_parm_offset = 0; - info = kzalloc(sizeof(struct fc_bsg_info), GFP_KERNEL); + info = kzalloc_obj(struct fc_bsg_info, GFP_KERNEL); if (!info) { fc_frame_free(fp); return -ENOMEM; @@ -2109,7 +2109,7 @@ static int fc_lport_ct_request(struct bsg_job *job, fh->fh_df_ctl = 0; fh->fh_parm_offset = 0; - info = kzalloc(sizeof(struct fc_bsg_info), GFP_KERNEL); + info = kzalloc_obj(struct fc_bsg_info, GFP_KERNEL); if (!info) { fc_frame_free(fp); return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index bcecb4911da9..0d24d6cc2dd8 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -579,7 +579,7 @@ int sas_ata_init(struct domain_device *found_dev) struct ata_port *ap; int rc; - ata_host = kzalloc(sizeof(*ata_host), GFP_KERNEL); + ata_host = kzalloc_obj(*ata_host, GFP_KERNEL); if (!ata_host) { pr_err("ata host alloc failed.\n"); return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index d953225f6cc2..e48b5233c2e9 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -433,7 +433,7 @@ static int sas_expander_discover(struct domain_device *dev) struct expander_device *ex = &dev->ex_dev; int res; - ex->ex_phy = kcalloc(ex->num_phys, sizeof(*ex->ex_phy), GFP_KERNEL); + ex->ex_phy = kzalloc_objs(*ex->ex_phy, ex->num_phys, GFP_KERNEL); if (!ex->ex_phy) return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 6b15ad1bcada..08e641374c85 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -39,7 +39,7 @@ struct sas_task *sas_alloc_task(gfp_t flags) struct sas_task *sas_alloc_slow_task(gfp_t flags) { struct sas_task *task = sas_alloc_task(flags); - struct sas_task_slow *slow = kmalloc(sizeof(*slow), flags); + struct sas_task_slow *slow = kmalloc_obj(*slow, flags); if (!task || !slow) { if (task) @@ -505,7 +505,7 @@ static void phy_enable_work(struct work_struct *work) static int sas_phy_setup(struct sas_phy *phy) { - struct sas_phy_data *d = kzalloc(sizeof(*d), GFP_KERNEL); + struct sas_phy_data *d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index d104c87f04f5..fafcefcf722a 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -192,7 +192,7 @@ static inline void sas_phy_set_target(struct asd_sas_phy *p, struct domain_devic static inline struct domain_device *sas_alloc_device(void) { - struct domain_device *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct domain_device *dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev) { INIT_LIST_HEAD(&dev->siblings); diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 4af5c069635a..fef3f283cfa7 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -2041,7 +2041,7 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr, struct sff_trasnceiver_codes_byte7 *trasn_code_byte7; /* Get transceiver information */ - rdp_context = kmalloc(sizeof(*rdp_context), GFP_KERNEL); + rdp_context = kmalloc_obj(*rdp_context, GFP_KERNEL); if (!rdp_context) { len = scnprintf(buf, PAGE_SIZE - len, "SPF info NA: alloc failure\n"); diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index d61d979f9b77..8c2b303ff144 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -174,7 +174,7 @@ lpfc_alloc_bsg_buffers(struct lpfc_hba *phba, unsigned int size, /* Allocate dma buffer and place in BPL passed */ while (bytes_left) { /* Allocate dma buffer */ - mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!mp) { if (mlist) lpfc_free_bsg_buffers(phba, mlist); @@ -416,7 +416,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) return -ENODEV; /* allocate our bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2733 Failed allocation of dd_data\n"); @@ -430,7 +430,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) goto free_dd; } - bmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!bmp) { rc = -ENOMEM; goto free_cmdiocbq; @@ -683,7 +683,7 @@ lpfc_bsg_rport_els(struct bsg_job *job) } /* allocate our bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2735 Failed allocation of dd_data\n"); @@ -843,7 +843,7 @@ lpfc_bsg_event_unref(struct lpfc_bsg_event *evt) static struct lpfc_bsg_event * lpfc_bsg_event_new(uint32_t ev_mask, int ev_reg_id, uint32_t ev_req_id) { - struct lpfc_bsg_event *evt = kzalloc(sizeof(*evt), GFP_KERNEL); + struct lpfc_bsg_event *evt = kzalloc_obj(*evt, GFP_KERNEL); if (!evt) return NULL; @@ -939,7 +939,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, lpfc_bsg_event_ref(evt); spin_unlock_irqrestore(&phba->ct_ev_lock, flags); - evt_dat = kzalloc(sizeof(*evt_dat), GFP_KERNEL); + evt_dat = kzalloc_obj(*evt_dat, GFP_KERNEL); if (evt_dat == NULL) { spin_lock_irqsave(&phba->ct_ev_lock, flags); lpfc_bsg_event_unref(evt); @@ -1215,7 +1215,7 @@ lpfc_bsg_hba_set_event(struct bsg_job *job) if (&evt->node == &phba->ct_ev_waiters) { /* no event waiting struct yet - first call */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (dd_data == NULL) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2734 Failed allocation of dd_data\n"); @@ -1477,7 +1477,7 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag, } /* allocate our bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2736 Failed allocation of dd_data\n"); @@ -1605,7 +1605,7 @@ lpfc_bsg_send_mgmt_rsp(struct bsg_job *job) goto send_mgmt_rsp_exit; } - bmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!bmp) { rc = -ENOMEM; goto send_mgmt_rsp_exit; @@ -2628,7 +2628,7 @@ static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi, cmdiocbq = lpfc_sli_get_iocbq(phba); rspiocbq = lpfc_sli_get_iocbq(phba); - dmabuf = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + dmabuf = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (dmabuf) { dmabuf->virt = lpfc_mbuf_alloc(phba, 0, &dmabuf->phys); if (dmabuf->virt) { @@ -2733,7 +2733,7 @@ lpfc_bsg_dma_page_alloc(struct lpfc_hba *phba) struct pci_dev *pcidev = phba->pcidev; /* allocate dma buffer struct */ - dmabuf = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + dmabuf = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) return NULL; @@ -2829,7 +2829,7 @@ diag_cmd_data_alloc(struct lpfc_hba *phba, cnt = size; /* allocate struct lpfc_dmabufext buffer header */ - dmp = kmalloc(sizeof(struct lpfc_dmabufext), GFP_KERNEL); + dmp = kmalloc_obj(struct lpfc_dmabufext, GFP_KERNEL); if (!dmp) goto out; @@ -2909,7 +2909,7 @@ static int lpfcdiag_sli3_loop_post_rxbufs(struct lpfc_hba *phba, uint16_t rxxri, pring = lpfc_phba_elsring(phba); cmdiocbq = lpfc_sli_get_iocbq(phba); - rxbmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + rxbmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (rxbmp != NULL) { rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys); if (rxbmp->virt) { @@ -3160,7 +3160,7 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) cmdiocbq = lpfc_sli_get_iocbq(phba); if (phba->sli_rev < LPFC_SLI_REV4) rspiocbq = lpfc_sli_get_iocbq(phba); - txbmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + txbmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (txbmp) { txbmp->virt = lpfc_mbuf_alloc(phba, 0, &txbmp->phys); @@ -4074,7 +4074,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, } /* bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4275,7 +4275,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, if (ext_buf_cnt == 1) { /* bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4624,7 +4624,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, "ebuffers received\n", phba->mbox_ext_buf_ctx.numBuf); - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4896,7 +4896,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, goto job_done; /* must be negative */ /* allocate our bsg tracking structure */ - dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2727 Failed allocation of dd_data\n"); diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index d3caac394291..a6ae7b7cf99c 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -165,7 +165,7 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp, u32 tmo; /* fill in BDEs for command */ - mp = kmalloc(sizeof(*mp), GFP_KERNEL); + mp = kmalloc_obj(*mp, GFP_KERNEL); if (!mp) { rc = 1; goto ct_exit; @@ -178,7 +178,7 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp, } /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc(sizeof(*bmp), GFP_KERNEL); + bmp = kmalloc_obj(*bmp, GFP_KERNEL); if (!bmp) { rc = 3; goto ct_free_mpvirt; @@ -498,7 +498,7 @@ lpfc_alloc_ct_rsp(struct lpfc_hba *phba, __be16 cmdcode, struct ulp_bde64 *bpl, while (size) { /* Allocate buffer for rsp payload */ - mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!mp) { if (mlist) lpfc_free_ct_rsp(phba, mlist); @@ -1924,7 +1924,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!mp) { rc=2; goto ns_cmd_exit; @@ -1938,7 +1938,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, } /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!bmp) { rc=4; goto ns_cmd_free_mpvirt; @@ -3220,7 +3220,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - rq = kmalloc(sizeof(*rq), GFP_KERNEL); + rq = kmalloc_obj(*rq, GFP_KERNEL); if (!rq) goto fdmi_cmd_exit; @@ -3229,7 +3229,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, goto fdmi_cmd_free_rq; /* Allocate buffer for Buffer ptr list */ - rsp = kmalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kmalloc_obj(*rsp, GFP_KERNEL); if (!rsp) goto fdmi_cmd_free_rqvirt; @@ -3716,7 +3716,7 @@ lpfc_vmid_cmd(struct lpfc_vport *vport, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - mp = kmalloc(sizeof(*mp), GFP_KERNEL); + mp = kmalloc_obj(*mp, GFP_KERNEL); if (!mp) goto vmid_free_mp_exit; @@ -3725,7 +3725,7 @@ lpfc_vmid_cmd(struct lpfc_vport *vport, goto vmid_free_mp_virt_exit; /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc(sizeof(*bmp), GFP_KERNEL); + bmp = kmalloc_obj(*bmp, GFP_KERNEL); if (!bmp) goto vmid_free_bmp_exit; diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 646f88c776f5..f9f46119f341 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -1951,7 +1951,7 @@ lpfc_debugfs_disc_trc_open(struct inode *inode, struct file *file) goto out; } - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2001,7 +2001,7 @@ lpfc_debugfs_slow_ring_trc_open(struct inode *inode, struct file *file) goto out; } - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2045,7 +2045,7 @@ lpfc_debugfs_hbqinfo_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2087,7 +2087,7 @@ lpfc_debugfs_multixripools_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2132,7 +2132,7 @@ lpfc_debugfs_lockstat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2269,7 +2269,7 @@ lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) phba->cfg_ras_fwlog_buffsize, &size)) goto out; - debug = kzalloc(sizeof(*debug), GFP_KERNEL); + debug = kzalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2316,7 +2316,7 @@ lpfc_debugfs_dumpHBASlim_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2358,7 +2358,7 @@ lpfc_debugfs_dumpHostSlim_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2522,7 +2522,7 @@ lpfc_debugfs_nodelist_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2688,7 +2688,7 @@ lpfc_debugfs_nvmestat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2776,7 +2776,7 @@ lpfc_debugfs_scsistat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2830,7 +2830,7 @@ lpfc_debugfs_ioktime_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -2957,7 +2957,7 @@ lpfc_debugfs_nvmeio_trc_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -3062,7 +3062,7 @@ lpfc_debugfs_hdwqstat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -3226,7 +3226,7 @@ lpfc_idiag_open(struct inode *inode, struct file *file) { struct lpfc_debug *debug; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) return -ENOMEM; @@ -5471,7 +5471,7 @@ lpfc_cgn_buffer_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -5563,7 +5563,7 @@ lpfc_rx_monitor_open(struct inode *inode, struct file *file) struct lpfc_rx_monitor_debug *debug; int rc = -ENOMEM; - debug = kmalloc(sizeof(*debug), GFP_KERNEL); + debug = kmalloc_obj(*debug, GFP_KERNEL); if (!debug) goto out; @@ -6210,10 +6210,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) phba->hba_debugfs_root, phba, &lpfc_debugfs_op_slow_ring_trc); if (!phba->slow_ring_trc) { - phba->slow_ring_trc = kcalloc( - lpfc_debugfs_max_slow_ring_trc, - sizeof(struct lpfc_debugfs_trc), - GFP_KERNEL); + phba->slow_ring_trc = kzalloc_objs(struct lpfc_debugfs_trc, + lpfc_debugfs_max_slow_ring_trc, + GFP_KERNEL); if (!phba->slow_ring_trc) { lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, "0416 Cannot create debugfs " diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 32da3c23c7f4..5177f0a80670 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -216,7 +216,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - pcmd = kmalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kmalloc_obj(*pcmd, GFP_KERNEL); if (pcmd) pcmd->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pcmd->phys); if (!pcmd || !pcmd->virt) @@ -226,7 +226,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, /* Allocate buffer for response payload */ if (expect_rsp) { - prsp = kmalloc(sizeof(*prsp), GFP_KERNEL); + prsp = kmalloc_obj(*prsp, GFP_KERNEL); if (prsp) prsp->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &prsp->phys); @@ -238,7 +238,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, } /* Allocate buffer for Buffer ptr list */ - pbuflist = kmalloc(sizeof(*pbuflist), GFP_KERNEL); + pbuflist = kmalloc_obj(*pbuflist, GFP_KERNEL); if (pbuflist) pbuflist->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pbuflist->phys); @@ -7537,7 +7537,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, if (RDP_NPORT_ID_SIZE != be32_to_cpu(rdp_req->nport_id_desc.length)) goto rjt_logerr; - rdp_context = kzalloc(sizeof(struct lpfc_rdp_context), GFP_KERNEL); + rdp_context = kzalloc_obj(struct lpfc_rdp_context, GFP_KERNEL); if (!rdp_context) { rjt_err = LSRJT_UNABLE_TPC; goto error; @@ -7842,7 +7842,7 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, goto rjt; } - lcb_context = kmalloc(sizeof(*lcb_context), GFP_KERNEL); + lcb_context = kmalloc_obj(*lcb_context, GFP_KERNEL); if (!lcb_context) { rjt_err = LSRJT_UNABLE_TPC; goto rjt; @@ -9965,7 +9965,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (*payload == ELS_CMD_LOGO) { - logo_data = kmalloc(sizeof(struct lpfc_logo_event), GFP_KERNEL); + logo_data = kmalloc_obj(struct lpfc_logo_event, GFP_KERNEL); if (!logo_data) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "0148 Failed to allocate memory " @@ -9974,8 +9974,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, } els_data = &logo_data->header; } else { - els_data = kmalloc(sizeof(struct lpfc_els_event_header), - GFP_KERNEL); + els_data = kmalloc_obj(struct lpfc_els_event_header, GFP_KERNEL); if (!els_data) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "0149 Failed to allocate memory " @@ -12325,8 +12324,8 @@ lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, if (!vport->qfpa_res) { max_desc = FCELSSIZE / sizeof(*vport->qfpa_res); - vport->qfpa_res = kcalloc(max_desc, sizeof(*vport->qfpa_res), - GFP_KERNEL); + vport->qfpa_res = kzalloc_objs(*vport->qfpa_res, max_desc, + GFP_KERNEL); if (!vport->qfpa_res) goto out; } @@ -12339,8 +12338,8 @@ lpfc_cmpl_els_qfpa(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, desc = (struct priority_range_desc *)(pcmd + 8); vmid_range = vport->vmid_priority.vmid_range; if (!vmid_range) { - vmid_range = kcalloc(MAX_PRIORITY_DESC, sizeof(*vmid_range), - GFP_KERNEL); + vmid_range = kzalloc_objs(*vmid_range, MAX_PRIORITY_DESC, + GFP_KERNEL); if (!vmid_range) { kfree(vport->qfpa_res); goto out; @@ -12438,7 +12437,7 @@ lpfc_vmid_uvem(struct lpfc_vport *vport, if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) return -ENXIO; - vmid_context = kmalloc(sizeof(*vmid_context), GFP_KERNEL); + vmid_context = kmalloc_obj(*vmid_context, GFP_KERNEL); if (!vmid_context) return -ENOMEM; elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_UVEM_SIZE, 2, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 1aeebdc08073..0e6cc42c61c9 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -726,8 +726,7 @@ lpfc_alloc_fast_evt(struct lpfc_hba *phba) { if (atomic_read(&phba->fast_event_count) > LPFC_MAX_EVT_COUNT) return NULL; - ret = kzalloc(sizeof(struct lpfc_fast_path_event), - GFP_ATOMIC); + ret = kzalloc_obj(struct lpfc_fast_path_event, GFP_ATOMIC); if (ret) { atomic_inc(&phba->fast_event_count); INIT_LIST_HEAD(&ret->work_evt.evt_listp); @@ -1141,7 +1140,7 @@ lpfc_workq_post_event(struct lpfc_hba *phba, void *arg1, void *arg2, * All Mailbox completions and LPFC_ELS_RING rcv ring IOCB events will * be queued to worker thread for processing */ - evtp = kmalloc(sizeof(struct lpfc_work_evt), GFP_ATOMIC); + evtp = kmalloc_obj(struct lpfc_work_evt, GFP_ATOMIC); if (!evtp) return 0; @@ -3644,8 +3643,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) * defaults. */ if (!test_bit(HBA_FIP_SUPPORT, &phba->hba_flag)) { - fcf_record = kzalloc(sizeof(struct fcf_record), - GFP_KERNEL); + fcf_record = kzalloc_obj(struct fcf_record, GFP_KERNEL); if (unlikely(!fcf_record)) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4056,7 +4054,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); mb = &pmb->u.mb; - vport_info = kzalloc(sizeof(struct static_vport_info), GFP_KERNEL); + vport_info = kzalloc_obj(struct static_vport_info, GFP_KERNEL); if (!vport_info) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "0543 lpfc_create_static_vport failed to" @@ -7012,8 +7010,7 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba *phba, for (i = 0; i < record_count; i++) { if (!(conn_rec[i].flags & FCFCNCT_VALID)) continue; - conn_entry = kzalloc(sizeof(struct lpfc_fcf_conn_entry), - GFP_KERNEL); + conn_entry = kzalloc_obj(struct lpfc_fcf_conn_entry, GFP_KERNEL); if (!conn_entry) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "2566 Failed to allocate connection" diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a116a16c4a6f..1139fb7dc0fb 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2820,7 +2820,7 @@ lpfc_sli3_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cn /* 2 buffers can be posted per command */ /* Allocate buffer to post */ - mp1 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL); + mp1 = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (mp1) mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &mp1->phys); if (!mp1 || !mp1->virt) { @@ -2833,7 +2833,7 @@ lpfc_sli3_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cn INIT_LIST_HEAD(&mp1->list); /* Allocate buffer to post */ if (cnt > 1) { - mp2 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL); + mp2 = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (mp2) mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &mp2->phys); @@ -3539,7 +3539,7 @@ void lpfc_create_multixri_pools(struct lpfc_hba *phba) count_per_hwq = phba->sli4_hba.io_xri_cnt / hwq_count; for (i = 0; i < hwq_count; i++) { - multixri_pool = kzalloc(sizeof(*multixri_pool), GFP_KERNEL); + multixri_pool = kzalloc_obj(*multixri_pool, GFP_KERNEL); if (!multixri_pool) { lpfc_printf_log(phba, KERN_INFO, LOG_INIT, @@ -4064,8 +4064,7 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba *phba) els_xri_cnt); /* allocate the additional els sgls */ for (i = 0; i < xri_cnt; i++) { - sglq_entry = kzalloc(sizeof(struct lpfc_sglq), - GFP_KERNEL); + sglq_entry = kzalloc_obj(struct lpfc_sglq, GFP_KERNEL); if (sglq_entry == NULL) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4184,8 +4183,7 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba) phba->sli4_hba.nvmet_xri_cnt, nvmet_xri_cnt); /* allocate the additional nvmet sgls */ for (i = 0; i < xri_cnt; i++) { - sglq_entry = kzalloc(sizeof(struct lpfc_sglq), - GFP_KERNEL); + sglq_entry = kzalloc_obj(struct lpfc_sglq, GFP_KERNEL); if (sglq_entry == NULL) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4478,7 +4476,7 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc) phba->sli4_hba.io_xri_cnt = 0; for (bcnt = 0; bcnt < num_to_alloc; bcnt++) { - lpfc_ncmd = kzalloc(sizeof(*lpfc_ncmd), GFP_KERNEL); + lpfc_ncmd = kzalloc_obj(*lpfc_ncmd, GFP_KERNEL); if (!lpfc_ncmd) break; /* @@ -4637,8 +4635,8 @@ lpfc_vmid_res_alloc(struct lpfc_hba *phba, struct lpfc_vport *vport) if (lpfc_is_vmid_enabled(phba)) { vport->vmid = - kcalloc(phba->cfg_max_vmid, sizeof(struct lpfc_vmid), - GFP_KERNEL); + kzalloc_objs(struct lpfc_vmid, phba->cfg_max_vmid, + GFP_KERNEL); if (!vport->vmid) return -ENOMEM; @@ -7773,9 +7771,9 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba) return -ENODEV; if (!phba->sli.sli3_ring) - phba->sli.sli3_ring = kcalloc(LPFC_SLI3_MAX_RING, - sizeof(struct lpfc_sli_ring), - GFP_KERNEL); + phba->sli.sli3_ring = kzalloc_objs(struct lpfc_sli_ring, + LPFC_SLI3_MAX_RING, + GFP_KERNEL); if (!phba->sli.sli3_ring) return -ENOMEM; @@ -8357,9 +8355,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) goto out_remove_rpi_hdrs; } - phba->sli4_hba.hba_eq_hdl = kcalloc(phba->cfg_irq_chann, - sizeof(struct lpfc_hba_eq_hdl), - GFP_KERNEL); + phba->sli4_hba.hba_eq_hdl = kzalloc_objs(struct lpfc_hba_eq_hdl, + phba->cfg_irq_chann, + GFP_KERNEL); if (!phba->sli4_hba.hba_eq_hdl) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "2572 Failed allocate memory for " @@ -8368,9 +8366,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) goto out_free_fcf_rr_bmask; } - phba->sli4_hba.cpu_map = kcalloc(phba->sli4_hba.num_possible_cpu, - sizeof(struct lpfc_vector_map_info), - GFP_KERNEL); + phba->sli4_hba.cpu_map = kzalloc_objs(struct lpfc_vector_map_info, + phba->sli4_hba.num_possible_cpu, + GFP_KERNEL); if (!phba->sli4_hba.cpu_map) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3327 Failed allocate memory for msi-x " @@ -8387,9 +8385,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) goto out_free_hba_cpu_map; } - phba->sli4_hba.idle_stat = kcalloc(phba->sli4_hba.num_possible_cpu, - sizeof(*phba->sli4_hba.idle_stat), - GFP_KERNEL); + phba->sli4_hba.idle_stat = kzalloc_objs(*phba->sli4_hba.idle_stat, + phba->sli4_hba.num_possible_cpu, + GFP_KERNEL); if (!phba->sli4_hba.idle_stat) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3390 Failed allocation for idle_stat\n"); @@ -8663,7 +8661,7 @@ lpfc_init_iocb_list(struct lpfc_hba *phba, int iocb_count) /* Initialize and populate the iocb list per host. */ INIT_LIST_HEAD(&phba->lpfc_iocb_list); for (i = 0; i < iocb_count; i++) { - iocbq_entry = kzalloc(sizeof(struct lpfc_iocbq), GFP_KERNEL); + iocbq_entry = kzalloc_obj(struct lpfc_iocbq, GFP_KERNEL); if (iocbq_entry == NULL) { printk(KERN_ERR "%s: only allocated %d iocbs of " "expected %d count. Unloading driver.\n", @@ -8913,7 +8911,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) * First allocate the protocol header region for the port. The * port expects a 4KB DMA-mapped memory region that is 4K aligned. */ - dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) return NULL; @@ -8931,7 +8929,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) } /* Save the rpi header data for cleanup later. */ - rpi_hdr = kzalloc(sizeof(struct lpfc_rpi_hdr), GFP_KERNEL); + rpi_hdr = kzalloc_obj(struct lpfc_rpi_hdr, GFP_KERNEL); if (!rpi_hdr) goto err_free_coherent; @@ -9004,7 +9002,7 @@ lpfc_hba_alloc(struct pci_dev *pdev) struct lpfc_hba *phba; /* Allocate memory for HBA structure */ - phba = kzalloc(sizeof(struct lpfc_hba), GFP_KERNEL); + phba = kzalloc_obj(struct lpfc_hba, GFP_KERNEL); if (!phba) { dev_err(&pdev->dev, "failed to allocate hba struct\n"); return NULL; @@ -9722,7 +9720,7 @@ lpfc_create_bootstrap_mbox(struct lpfc_hba *phba) uint32_t pa_addr; uint64_t phys_addr; - dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) return -ENOMEM; @@ -10442,9 +10440,9 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) phba->sli4_hba.cq_ecount = LPFC_CQE_DEF_COUNT; if (!phba->sli4_hba.hdwq) { - phba->sli4_hba.hdwq = kcalloc( - phba->cfg_hdw_queue, sizeof(struct lpfc_sli4_hdw_queue), - GFP_KERNEL); + phba->sli4_hba.hdwq = kzalloc_objs(struct lpfc_sli4_hdw_queue, + phba->cfg_hdw_queue, + GFP_KERNEL); if (!phba->sli4_hba.hdwq) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "6427 Failed allocate memory for " @@ -10473,30 +10471,27 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) { if (phba->nvmet_support) { - phba->sli4_hba.nvmet_cqset = kcalloc( - phba->cfg_nvmet_mrq, - sizeof(struct lpfc_queue *), - GFP_KERNEL); + phba->sli4_hba.nvmet_cqset = kzalloc_objs(struct lpfc_queue *, + phba->cfg_nvmet_mrq, + GFP_KERNEL); if (!phba->sli4_hba.nvmet_cqset) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3121 Fail allocate memory for " "fast-path CQ set array\n"); goto out_error; } - phba->sli4_hba.nvmet_mrq_hdr = kcalloc( - phba->cfg_nvmet_mrq, - sizeof(struct lpfc_queue *), - GFP_KERNEL); + phba->sli4_hba.nvmet_mrq_hdr = kzalloc_objs(struct lpfc_queue *, + phba->cfg_nvmet_mrq, + GFP_KERNEL); if (!phba->sli4_hba.nvmet_mrq_hdr) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3122 Fail allocate memory for " "fast-path RQ set hdr array\n"); goto out_error; } - phba->sli4_hba.nvmet_mrq_data = kcalloc( - phba->cfg_nvmet_mrq, - sizeof(struct lpfc_queue *), - GFP_KERNEL); + phba->sli4_hba.nvmet_mrq_data = kzalloc_objs(struct lpfc_queue *, + phba->cfg_nvmet_mrq, + GFP_KERNEL); if (!phba->sli4_hba.nvmet_mrq_data) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3124 Fail allocate memory for " @@ -11381,8 +11376,9 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) if (phba->sli4_hba.cq_max) { kfree(phba->sli4_hba.cq_lookup); - phba->sli4_hba.cq_lookup = kcalloc((phba->sli4_hba.cq_max + 1), - sizeof(struct lpfc_queue *), GFP_KERNEL); + phba->sli4_hba.cq_lookup = kzalloc_objs(struct lpfc_queue *, + (phba->sli4_hba.cq_max + 1), + GFP_KERNEL); if (!phba->sli4_hba.cq_lookup) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "0549 Failed setup of CQ Lookup table: " @@ -11511,7 +11507,7 @@ lpfc_sli4_cq_event_pool_create(struct lpfc_hba *phba) int i; for (i = 0; i < (4 * phba->sli4_hba.cq_ecount); i++) { - cq_event = kmalloc(sizeof(struct lpfc_cq_event), GFP_KERNEL); + cq_event = kmalloc_obj(struct lpfc_cq_event, GFP_KERNEL); if (!cq_event) goto out_pool_create_fail; list_add_tail(&cq_event->list, @@ -14616,8 +14612,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context) "New Version:%s\n", fwrev, image->revision); for (i = 0; i < LPFC_MBX_WR_CONFIG_MAX_BDE; i++) { - dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), - GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) { rc = -ENOMEM; goto release_out; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index fb6dbcb86c09..5f7249e6bda8 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -64,7 +64,7 @@ lpfc_mbox_rsrc_prep(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { struct lpfc_dmabuf *mp; - mp = kmalloc(sizeof(*mp), GFP_KERNEL); + mp = kmalloc_obj(*mp, GFP_KERNEL); if (!mp) return -ENOMEM; @@ -1869,8 +1869,8 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox, pcount = (pcount > LPFC_SLI4_MBX_SGE_MAX_PAGES) ? LPFC_SLI4_MBX_SGE_MAX_PAGES : pcount; /* Allocate record for keeping SGE virtual addresses */ - mbox->sge_array = kzalloc(sizeof(struct lpfc_mbx_nembed_sge_virt), - GFP_KERNEL); + mbox->sge_array = kzalloc_obj(struct lpfc_mbx_nembed_sge_virt, + GFP_KERNEL); if (!mbox->sge_array) { lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, "2527 Failed to allocate non-embedded SGE " diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c index 2697da3248b3..c067d6762ae3 100644 --- a/drivers/scsi/lpfc/lpfc_mem.c +++ b/drivers/scsi/lpfc/lpfc_mem.c @@ -118,9 +118,8 @@ lpfc_mem_alloc(struct lpfc_hba *phba, int align) if (!phba->lpfc_mbuf_pool) goto fail; - pool->elements = kmalloc_array(LPFC_MBUF_POOL_SIZE, - sizeof(struct lpfc_dmabuf), - GFP_KERNEL); + pool->elements = kmalloc_objs(struct lpfc_dmabuf, LPFC_MBUF_POOL_SIZE, + GFP_KERNEL); if (!pool->elements) goto fail_free_lpfc_mbuf_pool; @@ -511,7 +510,7 @@ lpfc_els_hbq_alloc(struct lpfc_hba *phba) { struct hbq_dmabuf *hbqbp; - hbqbp = kzalloc(sizeof(struct hbq_dmabuf), GFP_KERNEL); + hbqbp = kzalloc_obj(struct hbq_dmabuf, GFP_KERNEL); if (!hbqbp) return NULL; @@ -563,7 +562,7 @@ lpfc_sli4_rb_alloc(struct lpfc_hba *phba) { struct hbq_dmabuf *dma_buf; - dma_buf = kzalloc(sizeof(struct hbq_dmabuf), GFP_KERNEL); + dma_buf = kzalloc_obj(struct hbq_dmabuf, GFP_KERNEL); if (!dma_buf) return NULL; @@ -621,7 +620,7 @@ lpfc_sli4_nvmet_alloc(struct lpfc_hba *phba) { struct rqb_dmabuf *dma_buf; - dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL); + dma_buf = kzalloc_obj(*dma_buf, GFP_KERNEL); if (!dma_buf) return NULL; diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 8240d59f4120..9e61021edfe1 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -564,7 +564,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (!login_mbox) goto out; - save_iocb = kzalloc(sizeof(*save_iocb), GFP_KERNEL); + save_iocb = kzalloc_obj(*save_iocb, GFP_KERNEL); if (!save_iocb) goto out; @@ -764,7 +764,7 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, * registered. */ if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { - elsiocb = kmalloc(sizeof(*elsiocb), GFP_KERNEL); + elsiocb = kmalloc_obj(*elsiocb, GFP_KERNEL); if (elsiocb) { /* Save info from cmd IOCB used in * rsp diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index e6f632521cff..edddb1e9a353 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -98,7 +98,7 @@ lpfc_nvme_create_queue(struct nvme_fc_local_port *pnvme_lport, test_bit(HBA_IOQ_FLUSH, &vport->phba->hba_flag)) return -ENODEV; - qhandle = kzalloc(sizeof(struct lpfc_nvme_qhandle), GFP_KERNEL); + qhandle = kzalloc_obj(struct lpfc_nvme_qhandle, GFP_KERNEL); if (qhandle == NULL) return -ENOMEM; @@ -587,7 +587,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, * in the nvme-fc layer. */ - bmp = kmalloc(sizeof(*bmp), GFP_KERNEL); + bmp = kmalloc_obj(*bmp, GFP_KERNEL); if (!bmp) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "6044 NVMEx LS REQ: Could not alloc LS buf " diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index 4cfc928bcf2d..48642f01f2c9 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -1507,9 +1507,9 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) "6403 Allocate NVMET resources for %d XRIs\n", phba->sli4_hba.nvmet_xri_cnt); - phba->sli4_hba.nvmet_ctx_info = kcalloc( - phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq, - sizeof(struct lpfc_nvmet_ctx_info), GFP_KERNEL); + phba->sli4_hba.nvmet_ctx_info = kzalloc_objs(struct lpfc_nvmet_ctx_info, + phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq, + GFP_KERNEL); if (!phba->sli4_hba.nvmet_ctx_info) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "6419 Failed allocate memory for " @@ -1567,15 +1567,14 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) idx = 0; cpu = cpumask_first(cpu_present_mask); for (i = 0; i < phba->sli4_hba.nvmet_xri_cnt; i++) { - ctx_buf = kzalloc(sizeof(*ctx_buf), GFP_KERNEL); + ctx_buf = kzalloc_obj(*ctx_buf, GFP_KERNEL); if (!ctx_buf) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "6404 Ran out of memory for NVMET\n"); return -ENOMEM; } - ctx_buf->context = kzalloc(sizeof(*ctx_buf->context), - GFP_KERNEL); + ctx_buf->context = kzalloc_obj(*ctx_buf->context, GFP_KERNEL); if (!ctx_buf->context) { kfree(ctx_buf); lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index df64948e55ee..ca2bd782608d 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -265,7 +265,7 @@ lpfc_new_scsi_buf_s3(struct lpfc_vport *vport, int num_to_alloc) (int)sizeof(struct fcp_rsp), bpl_size); for (bcnt = 0; bcnt < num_to_alloc; bcnt++) { - psb = kzalloc(sizeof(struct lpfc_io_buf), GFP_KERNEL); + psb = kzalloc_obj(struct lpfc_io_buf, GFP_KERNEL); if (!psb) break; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 734af3d039f8..b328fc772bd8 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -2135,8 +2135,7 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) - LPFC_IOCBQ_LOOKUP_INCREMENT)) { new_len = psli->iocbq_lookup_len + LPFC_IOCBQ_LOOKUP_INCREMENT; spin_unlock_irq(&phba->hbalock); - new_arr = kcalloc(new_len, sizeof(struct lpfc_iocbq *), - GFP_KERNEL); + new_arr = kzalloc_objs(struct lpfc_iocbq *, new_len, GFP_KERNEL); if (new_arr) { spin_lock_irq(&phba->hbalock); old_arr = psli->iocbq_lookup; @@ -3240,7 +3239,7 @@ lpfc_nvme_unsol_ls_handler(struct lpfc_hba *phba, struct lpfc_iocbq *piocb) (FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT))) { failwhy = "Bad NVME LS F_CTL"; } else { - axchg = kzalloc(sizeof(*axchg), GFP_ATOMIC); + axchg = kzalloc_obj(*axchg, GFP_ATOMIC); if (!axchg) failwhy = "No CTX memory"; } @@ -5894,7 +5893,7 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, struct lpfc_dmabuf *dmabuf; struct lpfc_mqe *mqe; - dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) return -ENOMEM; @@ -6944,8 +6943,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba, ras_fwlog->fw_buffcount = fwlog_buff_count; for (i = 0; i < ras_fwlog->fw_buffcount; i++) { - dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), - GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (!dmabuf) { rc = -ENOMEM; lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, @@ -8048,8 +8046,8 @@ static void lpfc_sli4_dip(struct lpfc_hba *phba) int lpfc_rx_monitor_create_ring(struct lpfc_rx_info_monitor *rx_monitor, u32 entries) { - rx_monitor->ring = kmalloc_array(entries, sizeof(struct rx_info_entry), - GFP_KERNEL); + rx_monitor->ring = kmalloc_objs(struct rx_info_entry, entries, + GFP_KERNEL); if (!rx_monitor->ring) return -ENOMEM; @@ -8296,7 +8294,7 @@ lpfc_cmf_setup(struct lpfc_hba *phba) /* Allocate Congestion Information Buffer */ if (!phba->cgn_i) { - mp = kmalloc(sizeof(*mp), GFP_KERNEL); + mp = kmalloc_obj(*mp, GFP_KERNEL); if (mp) mp->virt = dma_alloc_coherent (&phba->pcidev->dev, @@ -8378,8 +8376,7 @@ no_cmf: /* Allocate RX Monitor Buffer */ if (!phba->rx_monitor) { - phba->rx_monitor = kzalloc(sizeof(*phba->rx_monitor), - GFP_KERNEL); + phba->rx_monitor = kzalloc_obj(*phba->rx_monitor, GFP_KERNEL); if (!phba->rx_monitor) { lpfc_printf_log(phba, KERN_ERR, LOG_INIT, @@ -17147,7 +17144,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, } else wq->db_regaddr = phba->sli4_hba.WQDBregaddr; } - wq->pring = kzalloc(sizeof(struct lpfc_sli_ring), GFP_KERNEL); + wq->pring = kzalloc_obj(struct lpfc_sli_ring, GFP_KERNEL); if (wq->pring == NULL) { status = -ENOMEM; goto out; @@ -19466,7 +19463,7 @@ lpfc_sli4_handle_mds_loopback(struct lpfc_vport *vport, } /* Allocate buffer for command payload */ - pcmd = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); + pcmd = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); if (pcmd) pcmd->virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL, &pcmd->phys); @@ -22297,7 +22294,7 @@ lpfc_read_object(struct lpfc_hba *phba, char *rdobject, uint32_t *datap, read_object->u.request.rd_object_name[j] = cpu_to_le32(rd_object_name[j]); - pcmd = kmalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kmalloc_obj(*pcmd, GFP_KERNEL); if (pcmd) pcmd->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pcmd->phys); if (!pcmd || !pcmd->virt) { diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index aff6c9d5e7c2..9572f925406c 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -787,8 +787,8 @@ lpfc_create_vport_work_array(struct lpfc_hba *phba) struct lpfc_vport *port_iterator; struct lpfc_vport **vports; int index = 0; - vports = kcalloc(phba->max_vports + 1, sizeof(struct lpfc_vport *), - GFP_KERNEL); + vports = kzalloc_objs(struct lpfc_vport *, phba->max_vports + 1, + GFP_KERNEL); if (vports == NULL) return NULL; spin_lock_irq(&phba->port_list_lock); diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index 49f856be2e51..74b92a56099a 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c @@ -462,9 +462,8 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat * +1 to allow for aligning. * XXX FIXME: Use DMA consistent routines */ - dma_cmd_space = kmalloc_array(host->sg_tablesize + 2, - sizeof(struct dbdma_cmd), - GFP_KERNEL); + dma_cmd_space = kmalloc_objs(struct dbdma_cmd, + host->sg_tablesize + 2, GFP_KERNEL); if (!dma_cmd_space) { printk(KERN_ERR "mac53c94: couldn't allocate dma " "command space for %pOF\n", node); diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c index ff0253d47a0e..68923dafee42 100644 --- a/drivers/scsi/mac_esp.c +++ b/drivers/scsi/mac_esp.c @@ -323,7 +323,7 @@ static int esp_mac_probe(struct platform_device *dev) host->this_id = esp->scsi_id; esp->scsi_id_mask = 1 << esp->scsi_id; - mep = kzalloc(sizeof(struct mac_esp_priv), GFP_KERNEL); + mep = kzalloc_obj(struct mac_esp_priv, GFP_KERNEL); if (!mep) goto fail_free_command_block; mep->esp = esp; diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 6b088bb049cc..de40a791ed3d 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4254,8 +4254,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_host_put; } - adapter->scb_list = kmalloc_array(MAX_COMMANDS, sizeof(scb_t), - GFP_KERNEL); + adapter->scb_list = kmalloc_objs(scb_t, MAX_COMMANDS, GFP_KERNEL); if (!adapter->scb_list) { dev_warn(&pdev->dev, "out of RAM\n"); goto out_free_cmd_buffer; diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index b6a32bb0bd19..fa10a89d7563 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -429,7 +429,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_master(pdev); // Allocate the per driver initialization structure - adapter = kzalloc(sizeof(adapter_t), GFP_KERNEL); + adapter = kzalloc_obj(adapter_t, GFP_KERNEL); if (adapter == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -713,7 +713,7 @@ megaraid_init_mbox(adapter_t *adapter) * Allocate and initialize the init data structure for mailbox * controllers */ - raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL); + raid_dev = kzalloc_obj(mraid_device_t, GFP_KERNEL); if (raid_dev == NULL) return -1; @@ -1017,7 +1017,7 @@ megaraid_alloc_cmd_packets(adapter_t *adapter) * since the calling routine does not yet know the number of available * commands. */ - adapter->kscb_list = kcalloc(MBOX_MAX_SCSI_CMDS, sizeof(scb_t), GFP_KERNEL); + adapter->kscb_list = kzalloc_objs(scb_t, MBOX_MAX_SCSI_CMDS, GFP_KERNEL); if (adapter->kscb_list == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -3403,7 +3403,7 @@ megaraid_cmm_register(adapter_t *adapter) int i; // Allocate memory for the base list of scb for management module. - adapter->uscb_list = kcalloc(MBOX_MAX_USER_CMDS, sizeof(scb_t), GFP_KERNEL); + adapter->uscb_list = kzalloc_objs(scb_t, MBOX_MAX_USER_CMDS, GFP_KERNEL); if (adapter->uscb_list == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -3763,9 +3763,9 @@ megaraid_sysfs_alloc_resources(adapter_t *adapter) mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); int rval = 0; - raid_dev->sysfs_uioc = kmalloc(sizeof(uioc_t), GFP_KERNEL); + raid_dev->sysfs_uioc = kmalloc_obj(uioc_t, GFP_KERNEL); - raid_dev->sysfs_mbox64 = kmalloc(sizeof(mbox64_t), GFP_KERNEL); + raid_dev->sysfs_mbox64 = kmalloc_obj(mbox64_t, GFP_KERNEL); raid_dev->sysfs_buffer = dma_alloc_coherent(&adapter->pdev->dev, PAGE_SIZE, &raid_dev->sysfs_buffer_dma, GFP_KERNEL); diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 87184e2538b0..0b457f691b1e 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -913,7 +913,7 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) if (lld_adp->drvr_type != DRVRTYPE_MBOX) return (-EINVAL); - adapter = kzalloc(sizeof(mraid_mmadp_t), GFP_KERNEL); + adapter = kzalloc_obj(mraid_mmadp_t, GFP_KERNEL); if (!adapter) return -ENOMEM; @@ -932,12 +932,10 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) * Allocate single blocks of memory for all required kiocs, * mailboxes and passthru structures. */ - adapter->kioc_list = kmalloc_array(lld_adp->max_kioc, - sizeof(uioc_t), - GFP_KERNEL); - adapter->mbox_list = kmalloc_array(lld_adp->max_kioc, - sizeof(mbox64_t), - GFP_KERNEL); + adapter->kioc_list = kmalloc_objs(uioc_t, lld_adp->max_kioc, + GFP_KERNEL); + adapter->mbox_list = kmalloc_objs(mbox64_t, lld_adp->max_kioc, + GFP_KERNEL); adapter->pthru_dma_pool = dma_pool_create("megaraid mm pthru pool", &adapter->pdev->dev, sizeof(mraid_passthru_t), diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 52894e892a92..074ace2c9790 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -2137,8 +2137,7 @@ static int megasas_sdev_init(struct scsi_device *sdev) } scan_target: - mr_device_priv_data = kzalloc(sizeof(*mr_device_priv_data), - GFP_KERNEL); + mr_device_priv_data = kzalloc_obj(*mr_device_priv_data, GFP_KERNEL); if (!mr_device_priv_data) return -ENOMEM; @@ -3255,7 +3254,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) ((instance->issuepend_done == 1))) { struct megasas_aen_event *ev; - ev = kzalloc(sizeof(*ev), GFP_ATOMIC); + ev = kzalloc_obj(*ev, GFP_ATOMIC); if (!ev) { dev_err(&instance->pdev->dev, "megasas_service_aen: out of memory\n"); } else { @@ -4468,7 +4467,8 @@ int megasas_alloc_cmds(struct megasas_instance *instance) * Allocate the dynamic array first and then allocate individual * commands. */ - instance->cmd_list = kcalloc(max_cmd, sizeof(struct megasas_cmd*), GFP_KERNEL); + instance->cmd_list = kzalloc_objs(struct megasas_cmd *, max_cmd, + GFP_KERNEL); if (!instance->cmd_list) { dev_printk(KERN_DEBUG, &instance->pdev->dev, "out of memory\n"); @@ -4476,8 +4476,8 @@ int megasas_alloc_cmds(struct megasas_instance *instance) } for (i = 0; i < max_cmd; i++) { - instance->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd), - GFP_KERNEL); + instance->cmd_list[i] = kmalloc_obj(struct megasas_cmd, + GFP_KERNEL); if (!instance->cmd_list[i]) { @@ -6377,9 +6377,8 @@ static int megasas_init_fw(struct megasas_instance *instance) /* stream detection initialization */ if (instance->adapter_type >= VENTURA_SERIES) { fusion->stream_detect_by_ld = - kcalloc(MAX_LOGICAL_DRIVES_EXT, - sizeof(struct LD_STREAM_DETECT *), - GFP_KERNEL); + kzalloc_objs(struct LD_STREAM_DETECT *, + MAX_LOGICAL_DRIVES_EXT, GFP_KERNEL); if (!fusion->stream_detect_by_ld) { dev_err(&instance->pdev->dev, "unable to allocate stream detection for pool of LDs\n"); @@ -6387,8 +6386,7 @@ static int megasas_init_fw(struct megasas_instance *instance) } for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { fusion->stream_detect_by_ld[i] = - kzalloc(sizeof(struct LD_STREAM_DETECT), - GFP_KERNEL); + kzalloc_obj(struct LD_STREAM_DETECT, GFP_KERNEL); if (!fusion->stream_detect_by_ld[i]) { dev_err(&instance->pdev->dev, "unable to allocate stream detect by LD\n"); @@ -8496,7 +8494,7 @@ megasas_compat_iocpacket_get_user(void __user *arg) int err = -EFAULT; int i; - ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); + ioc = kzalloc_obj(*ioc, GFP_KERNEL); if (!ioc) return ERR_PTR(-ENOMEM); size = offsetof(struct megasas_iocpacket, frame) + sizeof(ioc->frame); diff --git a/drivers/scsi/megaraid/megaraid_sas_debugfs.c b/drivers/scsi/megaraid/megaraid_sas_debugfs.c index c69760775efa..43bb218dea13 100644 --- a/drivers/scsi/megaraid/megaraid_sas_debugfs.c +++ b/drivers/scsi/megaraid/megaraid_sas_debugfs.c @@ -65,7 +65,7 @@ megasas_debugfs_raidmap_open(struct inode *inode, struct file *file) fusion = instance->ctrl_context; - debug = kzalloc(sizeof(struct megasas_debugfs_buffer), GFP_KERNEL); + debug = kzalloc_obj(struct megasas_debugfs_buffer, GFP_KERNEL); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a6794f49e9fa..e3de9c95bf4f 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -598,8 +598,8 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) * commands. */ fusion->cmd_list = - kcalloc(max_mpt_cmd, sizeof(struct megasas_cmd_fusion *), - GFP_KERNEL); + kzalloc_objs(struct megasas_cmd_fusion *, max_mpt_cmd, + GFP_KERNEL); if (!fusion->cmd_list) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); @@ -607,8 +607,8 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) } for (i = 0; i < max_mpt_cmd; i++) { - fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), - GFP_KERNEL); + fusion->cmd_list[i] = kzalloc_obj(struct megasas_cmd_fusion, + GFP_KERNEL); if (!fusion->cmd_list[i]) { for (j = 0; j < i; j++) kfree(fusion->cmd_list[j]); @@ -1744,7 +1744,7 @@ static int megasas_alloc_ioc_init_frame(struct megasas_instance *instance) fusion = instance->ctrl_context; - cmd = kzalloc(sizeof(struct megasas_cmd), GFP_KERNEL); + cmd = kzalloc_obj(struct megasas_cmd, GFP_KERNEL); if (!cmd) { dev_err(&instance->pdev->dev, "Failed from func: %s line: %d\n", @@ -5298,8 +5298,7 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) { struct fusion_context *fusion; - instance->ctrl_context = kzalloc(sizeof(struct fusion_context), - GFP_KERNEL); + instance->ctrl_context = kzalloc_obj(struct fusion_context, GFP_KERNEL); if (!instance->ctrl_context) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index df984e9b5197..b42c14f1442b 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1288,7 +1288,7 @@ static void mpi3mr_fault_uevent_emit(struct mpi3mr_ioc *mrioc) struct kobj_uevent_env *env; int ret; - env = kzalloc(sizeof(*env), GFP_KERNEL); + env = kzalloc_obj(*env, GFP_KERNEL); if (!env) return; @@ -2110,8 +2110,9 @@ static int mpi3mr_alloc_op_reply_q_segments(struct mpi3mr_ioc *mrioc, u16 qidx) op_reply_q->num_segments = DIV_ROUND_UP(op_reply_q->num_replies, op_reply_q->segment_qd); - op_reply_q->q_segments = kcalloc(op_reply_q->num_segments, - sizeof(struct segments), GFP_KERNEL); + op_reply_q->q_segments = kzalloc_objs(struct segments, + op_reply_q->num_segments, + GFP_KERNEL); if (!op_reply_q->q_segments) return -ENOMEM; @@ -2168,8 +2169,8 @@ static int mpi3mr_alloc_op_req_q_segments(struct mpi3mr_ioc *mrioc, u16 qidx) op_req_q->num_segments = DIV_ROUND_UP(op_req_q->num_requests, op_req_q->segment_qd); - op_req_q->q_segments = kcalloc(op_req_q->num_segments, - sizeof(struct segments), GFP_KERNEL); + op_req_q->q_segments = kzalloc_objs(struct segments, + op_req_q->num_segments, GFP_KERNEL); if (!op_req_q->q_segments) return -ENOMEM; @@ -2463,8 +2464,8 @@ static int mpi3mr_create_op_queues(struct mpi3mr_ioc *mrioc) num_queues); if (!mrioc->req_qinfo) { - mrioc->req_qinfo = kcalloc(num_queues, - sizeof(struct op_req_qinfo), GFP_KERNEL); + mrioc->req_qinfo = kzalloc_objs(struct op_req_qinfo, num_queues, + GFP_KERNEL); if (!mrioc->req_qinfo) { retval = -1; goto out_failed; diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 8e5abf620718..5e53b200c19b 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -676,7 +676,7 @@ static struct mpi3mr_tgt_dev *mpi3mr_alloc_tgtdev(void) { struct mpi3mr_tgt_dev *tgtdev; - tgtdev = kzalloc(sizeof(*tgtdev), GFP_ATOMIC); + tgtdev = kzalloc_obj(*tgtdev, GFP_ATOMIC); if (!tgtdev) return NULL; kref_init(&tgtdev->ref_count); @@ -1710,8 +1710,7 @@ static void mpi3mr_encldev_add_chg_evt_bh(struct mpi3mr_ioc *mrioc, encl_handle); if (!enclosure_dev && present) { enclosure_dev = - kzalloc(sizeof(struct mpi3mr_enclosure_node), - GFP_KERNEL); + kzalloc_obj(struct mpi3mr_enclosure_node, GFP_KERNEL); if (!enclosure_dev) return; list_add_tail(&enclosure_dev->list, @@ -2535,8 +2534,7 @@ static void mpi3mr_dev_rmhs_send_tm(struct mpi3mr_ioc *mrioc, u16 handle, } while (retrycount--); if (cmd_idx >= MPI3MR_NUM_DEVRMCMD) { - delayed_dev_rmhs = kzalloc(sizeof(*delayed_dev_rmhs), - GFP_ATOMIC); + delayed_dev_rmhs = kzalloc_obj(*delayed_dev_rmhs, GFP_ATOMIC); if (!delayed_dev_rmhs) return; INIT_LIST_HEAD(&delayed_dev_rmhs->list); @@ -2677,8 +2675,7 @@ static void mpi3mr_send_event_ack(struct mpi3mr_ioc *mrioc, u8 event, } while (retrycount--); if (cmd_idx >= MPI3MR_NUM_EVTACKCMD) { - delayed_evtack = kzalloc(sizeof(*delayed_evtack), - GFP_ATOMIC); + delayed_evtack = kzalloc_obj(*delayed_evtack, GFP_ATOMIC); if (!delayed_evtack) return; INIT_LIST_HEAD(&delayed_evtack->list); @@ -4900,7 +4897,7 @@ static int mpi3mr_sdev_init(struct scsi_device *sdev) spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags); - scsi_dev_priv_data = kzalloc(sizeof(*scsi_dev_priv_data), GFP_KERNEL); + scsi_dev_priv_data = kzalloc_obj(*scsi_dev_priv_data, GFP_KERNEL); if (!scsi_dev_priv_data) return -ENOMEM; @@ -4931,7 +4928,7 @@ static int mpi3mr_target_alloc(struct scsi_target *starget) int retval = 0; struct sas_rphy *rphy = NULL; - scsi_tgt_priv_data = kzalloc(sizeof(*scsi_tgt_priv_data), GFP_KERNEL); + scsi_tgt_priv_data = kzalloc_obj(*scsi_tgt_priv_data, GFP_KERNEL); if (!scsi_tgt_priv_data) return -ENOMEM; diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c index 101161554ef1..c79ba5bf56de 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1022,8 +1022,7 @@ mpi3mr_alloc_hba_port(struct mpi3mr_ioc *mrioc, u16 port_id) { struct mpi3mr_hba_port *hba_port; - hba_port = kzalloc(sizeof(struct mpi3mr_hba_port), - GFP_KERNEL); + hba_port = kzalloc_obj(struct mpi3mr_hba_port, GFP_KERNEL); if (!hba_port) return NULL; hba_port->port_id = port_id; @@ -1221,8 +1220,8 @@ void mpi3mr_sas_host_add(struct mpi3mr_ioc *mrioc) mrioc->sas_hba.host_node = 1; INIT_LIST_HEAD(&mrioc->sas_hba.sas_port_list); mrioc->sas_hba.parent_dev = &mrioc->shost->shost_gendev; - mrioc->sas_hba.phy = kcalloc(num_phys, - sizeof(struct mpi3mr_sas_phy), GFP_KERNEL); + mrioc->sas_hba.phy = kzalloc_objs(struct mpi3mr_sas_phy, num_phys, + GFP_KERNEL); if (!mrioc->sas_hba.phy) return; @@ -1344,7 +1343,7 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, return NULL; } - mr_sas_port = kzalloc(sizeof(struct mpi3mr_sas_port), GFP_KERNEL); + mr_sas_port = kzalloc_obj(struct mpi3mr_sas_port, GFP_KERNEL); if (!mr_sas_port) return NULL; @@ -1721,7 +1720,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) sas_io_unit_pg0 = kzalloc(sz, GFP_KERNEL); if (!sas_io_unit_pg0) return; - h_port = kcalloc(64, sizeof(struct host_port), GFP_KERNEL); + h_port = kzalloc_objs(struct host_port, 64, GFP_KERNEL); if (!h_port) goto out; @@ -2098,8 +2097,7 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle) if (sas_expander) return 0; - sas_expander = kzalloc(sizeof(struct mpi3mr_sas_node), - GFP_KERNEL); + sas_expander = kzalloc_obj(struct mpi3mr_sas_node, GFP_KERNEL); if (!sas_expander) return -ENOMEM; @@ -2118,8 +2116,8 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle) rc = -1; goto out_fail; } - sas_expander->phy = kcalloc(sas_expander->num_phys, - sizeof(struct mpi3mr_sas_phy), GFP_KERNEL); + sas_expander->phy = kzalloc_objs(struct mpi3mr_sas_phy, + sas_expander->num_phys, GFP_KERNEL); if (!sas_expander->phy) { rc = -1; goto out_fail; diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 2f2183f405c9..32e6c1f2f058 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1497,8 +1497,7 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, u32 reply) goto out; smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx); if (!smid) { - delayed_event_ack = kzalloc(sizeof(*delayed_event_ack), - GFP_ATOMIC); + delayed_event_ack = kzalloc_obj(*delayed_event_ack, GFP_ATOMIC); if (!delayed_event_ack) goto out; INIT_LIST_HEAD(&delayed_event_ack->list); @@ -3162,7 +3161,7 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index) struct adapter_reply_queue *reply_q; int r, qid; - reply_q = kzalloc(sizeof(struct adapter_reply_queue), GFP_KERNEL); + reply_q = kzalloc_obj(struct adapter_reply_queue, GFP_KERNEL); if (!reply_q) { ioc_err(ioc, "unable to allocate memory %zu!\n", sizeof(struct adapter_reply_queue)); @@ -3462,8 +3461,9 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) iopoll_q_count = poll_queues; if (iopoll_q_count) { - ioc->io_uring_poll_queues = kcalloc(iopoll_q_count, - sizeof(struct io_uring_poll_queue), GFP_KERNEL); + ioc->io_uring_poll_queues = kzalloc_objs(struct io_uring_poll_queue, + iopoll_q_count, + GFP_KERNEL); if (!ioc->io_uring_poll_queues) iopoll_q_count = 0; } @@ -3727,9 +3727,9 @@ mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc) * each register is at offset bytes of * MPT3_SUP_REPLY_POST_HOST_INDEX_REG_OFFSET from previous one. */ - ioc->replyPostRegisterIndex = kcalloc( - ioc->combined_reply_index_count, - sizeof(resource_size_t *), GFP_KERNEL); + ioc->replyPostRegisterIndex = kzalloc_objs(resource_size_t *, + ioc->combined_reply_index_count, + GFP_KERNEL); if (!ioc->replyPostRegisterIndex) { ioc_err(ioc, "allocation for replyPostRegisterIndex failed!\n"); @@ -6218,8 +6218,8 @@ base_alloc_rdpq_dma_pool(struct MPT3SAS_ADAPTER *ioc, int sz) sizeof(Mpi2DefaultReplyDescriptor_t); int count = ioc->rdpq_array_enable ? ioc->reply_queue_count : 1; - ioc->reply_post = kcalloc(count, sizeof(struct reply_post_struct), - GFP_KERNEL); + ioc->reply_post = kzalloc_objs(struct reply_post_struct, count, + GFP_KERNEL); if (!ioc->reply_post) return -ENOMEM; /* @@ -6562,8 +6562,8 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) } /* initialize hi-priority queue smid's */ - ioc->hpr_lookup = kcalloc(ioc->hi_priority_depth, - sizeof(struct request_tracker), GFP_KERNEL); + ioc->hpr_lookup = kzalloc_objs(struct request_tracker, + ioc->hi_priority_depth, GFP_KERNEL); if (!ioc->hpr_lookup) { ioc_err(ioc, "hpr_lookup: kcalloc failed\n"); goto out; @@ -6575,8 +6575,8 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) ioc->hi_priority_depth, ioc->hi_priority_smid)); /* initialize internal queue smid's */ - ioc->internal_lookup = kcalloc(ioc->internal_depth, - sizeof(struct request_tracker), GFP_KERNEL); + ioc->internal_lookup = kzalloc_objs(struct request_tracker, + ioc->internal_depth, GFP_KERNEL); if (!ioc->internal_lookup) { ioc_err(ioc, "internal_lookup: kcalloc failed\n"); goto out; @@ -8430,8 +8430,9 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) } if (ioc->is_warpdrive) { - ioc->reply_post_host_index = kcalloc(ioc->cpu_msix_table_sz, - sizeof(resource_size_t *), GFP_KERNEL); + ioc->reply_post_host_index = kzalloc_objs(resource_size_t *, + ioc->cpu_msix_table_sz, + GFP_KERNEL); if (!ioc->reply_post_host_index) { ioc_info(ioc, "Allocation for reply_post_host_index failed!!!\n"); r = -ENOMEM; @@ -8520,8 +8521,8 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) if (r) goto out_free_resources; - ioc->pfacts = kcalloc(ioc->facts.NumberOfPorts, - sizeof(struct mpt3sas_port_facts), GFP_KERNEL); + ioc->pfacts = kzalloc_objs(struct mpt3sas_port_facts, + ioc->facts.NumberOfPorts, GFP_KERNEL); if (!ioc->pfacts) { r = -ENOMEM; goto out_free_resources; diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 3b951589feeb..35b78162e8c3 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -1331,8 +1331,8 @@ _ctl_eventenable(struct MPT3SAS_ADAPTER *ioc, void __user *arg) /* initialize event_log */ ioc->event_context = 0; ioc->aen_event_read_flag = 0; - ioc->event_log = kcalloc(MPT3SAS_CTL_EVENT_LOG_SIZE, - sizeof(struct MPT3_IOCTL_EVENTS), GFP_KERNEL); + ioc->event_log = kzalloc_objs(struct MPT3_IOCTL_EVENTS, + MPT3SAS_CTL_EVENT_LOG_SIZE, GFP_KERNEL); if (!ioc->event_log) { pr_err("failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -3881,8 +3881,8 @@ diag_trigger_master_store(struct device *cdev, rc = min(sizeof(struct SL_WH_MASTER_TRIGGER_T), count); if (ioc->supports_trigger_pages) { - master_tg = kzalloc(sizeof(struct SL_WH_MASTER_TRIGGER_T), - GFP_KERNEL); + master_tg = kzalloc_obj(struct SL_WH_MASTER_TRIGGER_T, + GFP_KERNEL); if (!master_tg) return -ENOMEM; @@ -3956,8 +3956,8 @@ diag_trigger_event_store(struct device *cdev, sz = min(sizeof(struct SL_WH_EVENT_TRIGGERS_T), count); if (ioc->supports_trigger_pages) { - event_tg = kzalloc(sizeof(struct SL_WH_EVENT_TRIGGERS_T), - GFP_KERNEL); + event_tg = kzalloc_obj(struct SL_WH_EVENT_TRIGGERS_T, + GFP_KERNEL); if (!event_tg) return -ENOMEM; @@ -4031,8 +4031,7 @@ diag_trigger_scsi_store(struct device *cdev, sz = min(sizeof(struct SL_WH_SCSI_TRIGGERS_T), count); if (ioc->supports_trigger_pages) { - scsi_tg = kzalloc(sizeof(struct SL_WH_SCSI_TRIGGERS_T), - GFP_KERNEL); + scsi_tg = kzalloc_obj(struct SL_WH_SCSI_TRIGGERS_T, GFP_KERNEL); if (!scsi_tg) return -ENOMEM; @@ -4105,8 +4104,7 @@ diag_trigger_mpi_store(struct device *cdev, sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count); if (ioc->supports_trigger_pages) { - mpi_tg = kzalloc(sizeof(struct SL_WH_MPI_TRIGGERS_T), - GFP_KERNEL); + mpi_tg = kzalloc_obj(struct SL_WH_MPI_TRIGGERS_T, GFP_KERNEL); if (!mpi_tg) return -ENOMEM; diff --git a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c index a6ab1db81167..d755f58ad7a0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c +++ b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c @@ -58,7 +58,7 @@ _debugfs_iocdump_open(struct inode *inode, struct file *file) struct MPT3SAS_ADAPTER *ioc = inode->i_private; struct mpt3sas_debugfs_buffer *debug; - debug = kzalloc(sizeof(struct mpt3sas_debugfs_buffer), GFP_KERNEL); + debug = kzalloc_obj(struct mpt3sas_debugfs_buffer, GFP_KERNEL); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 26a13b622c95..1bafd51cdcf6 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -476,7 +476,7 @@ mpt3sas_get_port_by_id(struct MPT3SAS_ADAPTER *ioc, * And add this object to port_table_list. */ if (!ioc->multipath_on_hba) { - port = kzalloc(sizeof(struct hba_port), GFP_ATOMIC); + port = kzalloc_obj(struct hba_port, GFP_ATOMIC); if (!port) return NULL; @@ -1940,8 +1940,7 @@ scsih_target_alloc(struct scsi_target *starget) unsigned long flags; struct sas_rphy *rphy; - sas_target_priv_data = kzalloc(sizeof(*sas_target_priv_data), - GFP_KERNEL); + sas_target_priv_data = kzalloc_obj(*sas_target_priv_data, GFP_KERNEL); if (!sas_target_priv_data) return -ENOMEM; @@ -2109,8 +2108,7 @@ scsih_sdev_init(struct scsi_device *sdev) struct _pcie_device *pcie_device; unsigned long flags; - sas_device_priv_data = kzalloc(sizeof(*sas_device_priv_data), - GFP_KERNEL); + sas_device_priv_data = kzalloc_obj(*sas_device_priv_data, GFP_KERNEL); if (!sas_device_priv_data) return -ENOMEM; @@ -4470,7 +4468,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle) smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_tr_cb_idx); if (!smid) { - delayed_tr = kzalloc(sizeof(*delayed_tr), GFP_ATOMIC); + delayed_tr = kzalloc_obj(*delayed_tr, GFP_ATOMIC); if (!delayed_tr) goto out; INIT_LIST_HEAD(&delayed_tr->list); @@ -4568,7 +4566,7 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, smid_sas_ctrl = mpt3sas_base_get_smid(ioc, ioc->tm_sas_control_cb_idx); if (!smid_sas_ctrl) { - delayed_sc = kzalloc(sizeof(*delayed_sc), GFP_ATOMIC); + delayed_sc = kzalloc_obj(*delayed_sc, GFP_ATOMIC); if (!delayed_sc) return _scsih_check_for_pending_tm(ioc, smid); INIT_LIST_HEAD(&delayed_sc->list); @@ -4694,7 +4692,7 @@ _scsih_tm_tr_volume_send(struct MPT3SAS_ADAPTER *ioc, u16 handle) smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_tr_volume_cb_idx); if (!smid) { - delayed_tr = kzalloc(sizeof(*delayed_tr), GFP_ATOMIC); + delayed_tr = kzalloc_obj(*delayed_tr, GFP_ATOMIC); if (!delayed_tr) return; INIT_LIST_HEAD(&delayed_tr->list); @@ -5215,7 +5213,7 @@ _scsih_check_ir_config_unhide_events(struct MPT3SAS_ADAPTER *ioc, if (!volume_handle) _scsih_tm_tr_send(ioc, handle); else if (volume_handle == a || volume_handle == b) { - delayed_tr = kzalloc(sizeof(*delayed_tr), GFP_ATOMIC); + delayed_tr = kzalloc_obj(*delayed_tr, GFP_ATOMIC); BUG_ON(!delayed_tr); INIT_LIST_HEAD(&delayed_tr->list); delayed_tr->handle = handle; @@ -6378,8 +6376,8 @@ _scsih_update_vphys_after_reset(struct MPT3SAS_ADAPTER *ioc) port_id = sas_iounit_pg0->PhyData[i].Port; mport = mpt3sas_get_port_by_id(ioc, port_id, 1); if (!mport) { - mport = kzalloc( - sizeof(struct hba_port), GFP_KERNEL); + mport = kzalloc_obj(struct hba_port, + GFP_KERNEL); if (!mport) break; mport->port_id = port_id; @@ -6749,8 +6747,8 @@ _scsih_sas_port_refresh(struct MPT3SAS_ADAPTER *ioc) } ioc->sas_hba.num_phys = num_phys; - port_table = kcalloc(ioc->sas_hba.num_phys, - sizeof(struct hba_port), GFP_KERNEL); + port_table = kzalloc_objs(struct hba_port, ioc->sas_hba.num_phys, + GFP_KERNEL); if (!port_table) return; @@ -6841,7 +6839,7 @@ _scsih_alloc_vphy(struct MPT3SAS_ADAPTER *ioc, u8 port_id, u8 phy_num) vphy = mpt3sas_get_vphy_by_phy(ioc, port, phy_num); if (!vphy) { - vphy = kzalloc(sizeof(struct virtual_phy), GFP_KERNEL); + vphy = kzalloc_obj(struct virtual_phy, GFP_KERNEL); if (!vphy) return NULL; @@ -6911,7 +6909,7 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc) sas_iounit_pg0->PhyData[0].ControllerDevHandle); port_id = sas_iounit_pg0->PhyData[i].Port; if (!(mpt3sas_get_port_by_id(ioc, port_id, 0))) { - port = kzalloc(sizeof(struct hba_port), GFP_KERNEL); + port = kzalloc_obj(struct hba_port, GFP_KERNEL); if (!port) goto out; @@ -7031,8 +7029,9 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc) ioc->sas_hba.nr_phys_allocated = max_t(u8, MPT_MAX_HBA_NUM_PHYS, num_phys); - ioc->sas_hba.phy = kcalloc(ioc->sas_hba.nr_phys_allocated, - sizeof(struct _sas_phy), GFP_KERNEL); + ioc->sas_hba.phy = kzalloc_objs(struct _sas_phy, + ioc->sas_hba.nr_phys_allocated, + GFP_KERNEL); if (!ioc->sas_hba.phy) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7117,7 +7116,7 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc) port_id = sas_iounit_pg0->PhyData[i].Port; if (!(mpt3sas_get_port_by_id(ioc, port_id, 0))) { - port = kzalloc(sizeof(struct hba_port), GFP_KERNEL); + port = kzalloc_obj(struct hba_port, GFP_KERNEL); if (!port) goto out; @@ -7258,8 +7257,7 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle) if (sas_expander) return 0; - sas_expander = kzalloc(sizeof(struct _sas_node), - GFP_KERNEL); + sas_expander = kzalloc_obj(struct _sas_node, GFP_KERNEL); if (!sas_expander) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7286,8 +7284,8 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle) rc = -1; goto out_fail; } - sas_expander->phy = kcalloc(sas_expander->num_phys, - sizeof(struct _sas_phy), GFP_KERNEL); + sas_expander->phy = kzalloc_objs(struct _sas_phy, + sas_expander->num_phys, GFP_KERNEL); if (!sas_expander->phy) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7782,7 +7780,7 @@ _scsih_report_luns(struct MPT3SAS_ADAPTER *ioc, u16 handle, void *data, int retries; lun_data = NULL; - transfer_packet = kzalloc(sizeof(struct _scsi_io_transfer), GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); if (!transfer_packet) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7869,7 +7867,7 @@ _scsih_start_unit(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 lun, u8 is_pd, enum device_responsive_state rc; int return_code; - transfer_packet = kzalloc(sizeof(struct _scsi_io_transfer), GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); if (!transfer_packet) { pr_info("failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7930,7 +7928,7 @@ _scsih_test_unit_ready(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 lun, int return_code; int sata_init_failure = 0; - transfer_packet = kzalloc(sizeof(struct _scsi_io_transfer), GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); if (!transfer_packet) { pr_info("failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8002,7 +8000,7 @@ _scsih_ata_pass_thru_idd(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 data_length; idd_data = NULL; - transfer_packet = kzalloc(sizeof(struct _scsi_io_transfer), GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); if (!transfer_packet) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8133,7 +8131,7 @@ _scsih_wait_for_target_to_become_ready(struct MPT3SAS_ADAPTER *ioc, u16 handle, int lun; struct scsi_lun *lunp; - lun_data = kcalloc(MPT3_MAX_LUNS, sizeof(struct scsi_lun), GFP_KERNEL); + lun_data = kzalloc_objs(struct scsi_lun, MPT3_MAX_LUNS, GFP_KERNEL); if (!lun_data) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8482,8 +8480,7 @@ _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 retry_count, } } - sas_device = kzalloc(sizeof(struct _sas_device), - GFP_KERNEL); + sas_device = kzalloc_obj(struct _sas_device, GFP_KERNEL); if (!sas_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -9386,7 +9383,7 @@ _scsih_pcie_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 retry_count) } } - pcie_device = kzalloc(sizeof(struct _pcie_device), GFP_KERNEL); + pcie_device = kzalloc_obj(struct _pcie_device, GFP_KERNEL); if (!pcie_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -9838,8 +9835,7 @@ _scsih_sas_enclosure_dev_status_change_event(struct MPT3SAS_ADAPTER *ioc, case MPI2_EVENT_SAS_ENCL_RC_ADDED: if (!enclosure_dev) { enclosure_dev = - kzalloc(sizeof(struct _enclosure_node), - GFP_KERNEL); + kzalloc_obj(struct _enclosure_node, GFP_KERNEL); if (!enclosure_dev) { ioc_info(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -10264,7 +10260,7 @@ _scsih_sas_volume_add(struct MPT3SAS_ADAPTER *ioc, if (raid_device) return; - raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL); + raid_device = kzalloc_obj(struct _raid_device, GFP_KERNEL); if (!raid_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -10682,7 +10678,7 @@ _scsih_sas_ir_volume_event(struct MPT3SAS_ADAPTER *ioc, break; } - raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL); + raid_device = kzalloc_obj(struct _raid_device, GFP_KERNEL); if (!raid_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -11043,7 +11039,7 @@ _scsih_create_enclosure_list_after_reset(struct MPT3SAS_ADAPTER *ioc) enclosure_handle = 0xFFFF; do { enclosure_dev = - kzalloc(sizeof(struct _enclosure_node), GFP_KERNEL); + kzalloc_obj(struct _enclosure_node, GFP_KERNEL); if (!enclosure_dev) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index f3400d01cc2a..09a36e561da5 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -698,8 +698,7 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, return NULL; } - mpt3sas_port = kzalloc(sizeof(struct _sas_port), - GFP_KERNEL); + mpt3sas_port = kzalloc_obj(struct _sas_port, GFP_KERNEL); if (!mpt3sas_port) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); diff --git a/drivers/scsi/mvme16x_scsi.c b/drivers/scsi/mvme16x_scsi.c index 9b19d5205e50..43c68802d40a 100644 --- a/drivers/scsi/mvme16x_scsi.c +++ b/drivers/scsi/mvme16x_scsi.c @@ -49,7 +49,7 @@ static int mvme16x_probe(struct platform_device *dev) goto out; } - hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); if (hostdata == NULL) { printk(KERN_ERR "mvme16x-scsi: " "Failed to allocate host data\n"); diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 7f1ad305eee6..6f5a98572c33 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -401,7 +401,7 @@ static int mvs_prep_sas_ha_init(struct Scsi_Host *shost, sha->sas_port = arr_port; sha->shost = shost; - sha->lldd_ha = kzalloc(sizeof(struct mvs_prv_info), GFP_KERNEL); + sha->lldd_ha = kzalloc_obj(struct mvs_prv_info, GFP_KERNEL); if (!sha->lldd_ha) goto exit_free; @@ -502,7 +502,7 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent) chip = &mvs_chips[ent->driver_data]; SHOST_TO_SAS_HA(shost) = - kcalloc(1, sizeof(struct sas_ha_struct), GFP_KERNEL); + kzalloc_objs(struct sas_ha_struct, 1, GFP_KERNEL); if (!SHOST_TO_SAS_HA(shost)) { scsi_host_put(shost); rc = -ENOMEM; diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index f2e7997d5b9d..359226e80eae 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -1739,7 +1739,7 @@ static int mvs_handle_event(struct mvs_info *mvi, void *data, int handler) struct mvs_wq *mwq; int ret = 0; - mwq = kmalloc(sizeof(struct mvs_wq), GFP_ATOMIC); + mwq = kmalloc_obj(struct mvs_wq, GFP_ATOMIC); if (mwq) { mwq->mvi = mvi; mwq->data = data; diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index cda8bd083a38..10b40c434977 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -106,7 +106,7 @@ static int mvumi_map_pci_addr(struct pci_dev *dev, void **addr_array) static struct mvumi_res *mvumi_alloc_mem_resource(struct mvumi_hba *mhba, enum resource_type type, unsigned int size) { - struct mvumi_res *res = kzalloc(sizeof(*res), GFP_ATOMIC); + struct mvumi_res *res = kzalloc_obj(*res, GFP_ATOMIC); if (!res) { dev_err(&mhba->pdev->dev, @@ -252,7 +252,7 @@ static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba, { struct mvumi_cmd *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) { dev_err(&mhba->pdev->dev, "failed to create a internal cmd\n"); return NULL; @@ -368,7 +368,7 @@ static int mvumi_alloc_cmds(struct mvumi_hba *mhba) struct mvumi_cmd *cmd; for (i = 0; i < mhba->max_io; i++) { - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) goto err_exit; @@ -1572,8 +1572,8 @@ static int mvumi_probe_devices(struct mvumi_hba *mhba) found = mvumi_match_devices(mhba, id, wwid); if (!found) { mvumi_remove_devices(mhba, id); - mv_dev = kzalloc(sizeof(struct mvumi_device), - GFP_KERNEL); + mv_dev = kzalloc_obj(struct mvumi_device, + GFP_KERNEL); if (!mv_dev) { dev_err(&mhba->pdev->dev, "%s alloc mv_dev failed\n", @@ -1749,7 +1749,7 @@ static void mvumi_launch_events(struct mvumi_hba *mhba, u32 isr_status) continue; } - mu_ev = kzalloc(sizeof(*mu_ev), GFP_ATOMIC); + mu_ev = kzalloc_obj(*mu_ev, GFP_ATOMIC); if (mu_ev) { INIT_WORK(&mu_ev->work_q, mvumi_scan_events); mu_ev->mhba = mhba; @@ -2193,7 +2193,7 @@ static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba) mhba->mmio = mhba->base_addr[0]; base = mhba->mmio; if (!mhba->regs) { - mhba->regs = kzalloc(sizeof(*regs), GFP_KERNEL); + mhba->regs = kzalloc_obj(*regs, GFP_KERNEL); if (mhba->regs == NULL) return -ENOMEM; } @@ -2245,7 +2245,7 @@ static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba) mhba->mmio = mhba->base_addr[2]; base = mhba->mmio; if (!mhba->regs) { - mhba->regs = kzalloc(sizeof(*regs), GFP_KERNEL); + mhba->regs = kzalloc_obj(*regs, GFP_KERNEL); if (mhba->regs == NULL) return -ENOMEM; } diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index efeacb9ffd7c..e24996921e87 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -1628,7 +1628,7 @@ static int myrb_ldev_sdev_init(struct scsi_device *sdev) ldev_info = cb->ldev_info_buf + ldev_num; - sdev->hostdata = kzalloc(sizeof(*ldev_info), GFP_KERNEL); + sdev->hostdata = kzalloc_obj(*ldev_info, GFP_KERNEL); if (!sdev->hostdata) return -ENOMEM; dev_dbg(&sdev->sdev_gendev, @@ -1672,7 +1672,7 @@ static int myrb_pdev_sdev_init(struct scsi_device *sdev) if (sdev->id > MYRB_MAX_TARGETS) return -ENXIO; - pdev_info = kzalloc(sizeof(*pdev_info), GFP_KERNEL); + pdev_info = kzalloc_obj(*pdev_info, GFP_KERNEL); if (!pdev_info) return -ENOMEM; diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 7e8bb533c669..77ed566d7b92 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -538,11 +538,11 @@ static bool myrs_enable_mmio_mbox(struct myrs_hba *cs, cs->fwstat_buf = NULL; goto out_free; } - cs->ctlr_info = kzalloc(sizeof(struct myrs_ctlr_info), GFP_KERNEL); + cs->ctlr_info = kzalloc_obj(struct myrs_ctlr_info, GFP_KERNEL); if (!cs->ctlr_info) goto out_free; - cs->event_buf = kzalloc(sizeof(struct myrs_event), GFP_KERNEL); + cs->event_buf = kzalloc_obj(struct myrs_event, GFP_KERNEL); if (!cs->event_buf) goto out_free; @@ -1803,7 +1803,7 @@ static int myrs_sdev_init(struct scsi_device *sdev) ldev_num = myrs_translate_ldev(cs, sdev); - ldev_info = kzalloc(sizeof(*ldev_info), GFP_KERNEL); + ldev_info = kzalloc_obj(*ldev_info, GFP_KERNEL); if (!ldev_info) return -ENOMEM; @@ -1865,7 +1865,7 @@ static int myrs_sdev_init(struct scsi_device *sdev) } else { struct myrs_pdev_info *pdev_info; - pdev_info = kzalloc(sizeof(*pdev_info), GFP_KERNEL); + pdev_info = kzalloc_obj(*pdev_info, GFP_KERNEL); if (!pdev_info) return -ENOMEM; diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 1b54ba51a485..ae96602a543b 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -96,7 +96,7 @@ static int aha152x_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "aha152x_attach()\n"); /* Create new SCSI device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->p_dev = link; link->priv = info; diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index fb3a1b43d8bd..50d2e4ffe037 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -1520,7 +1520,7 @@ static int nsp_cs_probe(struct pcmcia_device *link) nsp_dbg(NSP_DEBUG_INIT, "in"); /* Create new SCSI device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) { return -ENOMEM; } info->p_dev = link; link->priv = info; diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index 310d0b6586a6..f24223fc58b8 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c @@ -152,7 +152,7 @@ static int qlogic_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "qlogic_attach()\n"); /* Create new SCSI device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 8f56f7277dee..2accb2c538f0 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -849,7 +849,7 @@ SYM53C500_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "SYM53C500_attach()\n"); /* Create new SCSI device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 8005995a317c..68b4ddcb7781 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -1686,7 +1686,7 @@ int pm8001_handle_event(struct pm8001_hba_info *pm8001_ha, void *data, struct pm8001_work *pw; int ret = 0; - pw = kmalloc(sizeof(struct pm8001_work), GFP_ATOMIC); + pw = kmalloc_obj(struct pm8001_work, GFP_ATOMIC); if (pw) { pw->pm8001_ha = pm8001_ha; pw->data = data; @@ -4371,7 +4371,7 @@ int pm8001_chip_get_nvmd_req(struct pm8001_hba_info *pm8001_ha, struct pm8001_ioctl_payload *ioctl_payload = payload; nvmd_type = ioctl_payload->minor_function; - fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); if (!fw_control_context) return -ENOMEM; fw_control_context->usrAddr = (u8 *)ioctl_payload->func_specific; @@ -4464,7 +4464,7 @@ int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha, struct pm8001_ioctl_payload *ioctl_payload = payload; nvmd_type = ioctl_payload->minor_function; - fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); if (!fw_control_context) return -ENOMEM; @@ -4579,7 +4579,7 @@ pm8001_chip_fw_flash_update_req(struct pm8001_hba_info *pm8001_ha, dma_addr_t phys_addr = pm8001_ha->memoryMap.region[FW_FLASH].phys_addr; struct pm8001_ioctl_payload *ioctl_payload = payload; - fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); if (!fw_control_context) return -ENOMEM; fw_control = (struct fw_control_info *)&ioctl_payload->func_specific; diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 9acca83d6958..631b7fa47fce 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -622,7 +622,7 @@ static int pm8001_prep_sas_ha_init(struct Scsi_Host *shost, sha->sas_phy = arr_phy; sha->sas_port = arr_port; - sha->lldd_ha = kzalloc(sizeof(struct pm8001_hba_info), GFP_KERNEL); + sha->lldd_ha = kzalloc_obj(struct pm8001_hba_info, GFP_KERNEL); if (!sha->lldd_ha) goto exit_free1; @@ -1148,7 +1148,7 @@ static int pm8001_pci_probe(struct pci_dev *pdev, goto err_out_regions; } chip = &pm8001_chips[ent->driver_data]; - sha = kzalloc(sizeof(struct sas_ha_struct), GFP_KERNEL); + sha = kzalloc_obj(struct sas_ha_struct, GFP_KERNEL); if (!sha) { rc = -ENOMEM; goto err_out_free_host; @@ -1264,7 +1264,7 @@ static int pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha) /* Memory region for ccb_info*/ pm8001_ha->ccb_count = ccb_count; pm8001_ha->ccb_info = - kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL); + kzalloc_objs(struct pm8001_ccb_info, ccb_count, GFP_KERNEL); if (!pm8001_ha->ccb_info) { pm8001_dbg(pm8001_ha, FAIL, "Unable to allocate memory for ccb\n"); diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 31960b72c1e9..77ded22a26c7 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1563,7 +1563,7 @@ void pm80xx_fatal_error_uevent_emit(struct pm8001_hba_info *pm8001_ha, pm8001_dbg(pm8001_ha, FAIL, "emitting fatal error uevent"); - env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); if (!env) return; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index cf163e63054b..ff31e12aaba0 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3468,7 +3468,7 @@ static long pmcraid_chr_ioctl( void __user *argp = (void __user *)arg; int retval = -ENOTTY; - hdr = kmalloc(sizeof(struct pmcraid_ioctl_header), GFP_KERNEL); + hdr = kmalloc_obj(struct pmcraid_ioctl_header, GFP_KERNEL); if (!hdr) { pmcraid_err("failed to allocate memory for ioctl header\n"); @@ -4385,9 +4385,8 @@ static int pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance) int i; pinstance->res_entries = - kcalloc(PMCRAID_MAX_RESOURCES, - sizeof(struct pmcraid_resource_entry), - GFP_KERNEL); + kzalloc_objs(struct pmcraid_resource_entry, + PMCRAID_MAX_RESOURCES, GFP_KERNEL); if (NULL == pinstance->res_entries) { pmcraid_err("failed to allocate memory for resource table\n"); diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index ddcef40789e5..7c8923368edd 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -1042,7 +1042,7 @@ static int __ppa_attach(struct parport *pb) int err = -ENOMEM; struct pardev_cb ppa_cb; - dev = kzalloc(sizeof(ppa_struct), GFP_KERNEL); + dev = kzalloc_obj(ppa_struct, GFP_KERNEL); if (!dev) return -ENOMEM; dev->base = -1; diff --git a/drivers/scsi/qedf/qedf_debugfs.c b/drivers/scsi/qedf/qedf_debugfs.c index 96174353e389..9b2ed9cb6245 100644 --- a/drivers/scsi/qedf/qedf_debugfs.c +++ b/drivers/scsi/qedf/qedf_debugfs.c @@ -422,7 +422,7 @@ qedf_offload_stats_show(struct seq_file *s, void *unused) struct qedf_ctx *qedf = s->private; struct qed_fcoe_stats *fw_fcoe_stats; - fw_fcoe_stats = kmalloc(sizeof(struct qed_fcoe_stats), GFP_KERNEL); + fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats, GFP_KERNEL); if (!fw_fcoe_stats) { QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate memory for " "fw_fcoe_stats.\n"); diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c index 1ff5bc314fc0..12841516653d 100644 --- a/drivers/scsi/qedf/qedf_els.c +++ b/drivers/scsi/qedf/qedf_els.c @@ -297,7 +297,7 @@ int qedf_send_rrq(struct qedf_ioreq *aborted_io_req) aborted_io_req->xid); memset(&rrq, 0, sizeof(rrq)); - cb_arg = kzalloc(sizeof(struct qedf_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct qedf_els_cb_arg, GFP_NOIO); if (!cb_arg) { QEDF_ERR(&(qedf->dbg_ctx), "Unable to allocate cb_arg for " "RRQ\n"); @@ -510,7 +510,7 @@ int qedf_send_adisc(struct qedf_rport *fcport, struct fc_frame *fp) qedf = fcport->qedf; fh = fc_frame_header_get(fp); - cb_arg = kzalloc(sizeof(struct qedf_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct qedf_els_cb_arg, GFP_NOIO); if (!cb_arg) { QEDF_ERR(&(qedf->dbg_ctx), "Unable to allocate cb_arg for " "ADISC\n"); @@ -659,7 +659,7 @@ static int qedf_send_srr(struct qedf_ioreq *orig_io_req, u32 offset, u8 r_ctl) "orig_xid=0x%x\n", orig_io_req, orig_io_req->xid); memset(&srr, 0, sizeof(srr)); - cb_arg = kzalloc(sizeof(struct qedf_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct qedf_els_cb_arg, GFP_NOIO); if (!cb_arg) { QEDF_ERR(&(qedf->dbg_ctx), "Unable to allocate cb_arg for " "SRR\n"); @@ -708,7 +708,7 @@ static void qedf_initiate_seq_cleanup(struct qedf_ioreq *orig_io_req, "Doing sequence cleanup for xid=0x%x offset=%u.\n", orig_io_req->xid, offset); - cb_arg = kzalloc(sizeof(struct qedf_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct qedf_els_cb_arg, GFP_NOIO); if (!cb_arg) { QEDF_ERR(&(fcport->qedf->dbg_ctx), "Unable to allocate cb_arg " "for sequence cleanup\n"); @@ -1033,7 +1033,7 @@ int qedf_send_rec(struct qedf_ioreq *orig_io_req) memset(&rec, 0, sizeof(rec)); - cb_arg = kzalloc(sizeof(struct qedf_els_cb_arg), GFP_NOIO); + cb_arg = kzalloc_obj(struct qedf_els_cb_arg, GFP_NOIO); if (!cb_arg) { QEDF_ERR(&(qedf->dbg_ctx), "Unable to allocate cb_arg for " "REC\n"); diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index d12c47be016e..73a0ce7e5180 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -230,8 +230,8 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) } /* Allocate task parameters to pass to f/w init funcions */ - io_req->task_params = kzalloc(sizeof(*io_req->task_params), - GFP_KERNEL); + io_req->task_params = kzalloc_obj(*io_req->task_params, + GFP_KERNEL); if (!io_req->task_params) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to allocate task_params for xid=0x%x\n", @@ -243,8 +243,8 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) * Allocate scatter/gather list info to pass to f/w init * functions. */ - io_req->sgl_task_params = kzalloc( - sizeof(struct scsi_sgl_task_params), GFP_KERNEL); + io_req->sgl_task_params = kzalloc_obj(struct scsi_sgl_task_params, + GFP_KERNEL); if (!io_req->sgl_task_params) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to allocate sgl_task_params for xid=0x%x\n", @@ -254,8 +254,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) } /* Allocate pool of io_bdts - one for each qedf_ioreq */ - cmgr->io_bdt_pool = kmalloc_array(num_ios, sizeof(struct io_bdt *), - GFP_KERNEL); + cmgr->io_bdt_pool = kmalloc_objs(struct io_bdt *, num_ios, GFP_KERNEL); if (!cmgr->io_bdt_pool) { QEDF_WARN(&(qedf->dbg_ctx), "Failed to alloc io_bdt_pool.\n"); @@ -263,8 +262,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) } for (i = 0; i < num_ios; i++) { - cmgr->io_bdt_pool[i] = kmalloc(sizeof(struct io_bdt), - GFP_KERNEL); + cmgr->io_bdt_pool[i] = kmalloc_obj(struct io_bdt, GFP_KERNEL); if (!cmgr->io_bdt_pool[i]) { QEDF_WARN(&(qedf->dbg_ctx), "Failed to alloc io_bdt_pool[%d].\n", i); diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 7792e00800ae..c712fdf86911 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -2082,7 +2082,7 @@ static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host if (lport->vport) goto out; - fw_fcoe_stats = kmalloc(sizeof(struct qed_fcoe_stats), GFP_KERNEL); + fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats, GFP_KERNEL); if (!fw_fcoe_stats) { QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate memory for " "fw_fcoe_stats.\n"); @@ -2674,7 +2674,7 @@ static int qedf_ll2_rx(void *cookie, struct sk_buff *skb, return 0; } - skb_work = kzalloc(sizeof(struct qedf_skb_work), GFP_ATOMIC); + skb_work = kzalloc_obj(struct qedf_skb_work, GFP_ATOMIC); if (!skb_work) { QEDF_WARN(&(qedf->dbg_ctx), "Could not allocate skb_work so " "dropping frame.\n"); @@ -2778,8 +2778,7 @@ static int qedf_prepare_sb(struct qedf_ctx *qedf) int ret; qedf->fp_array = - kcalloc(qedf->num_queues, sizeof(struct qedf_fastpath), - GFP_KERNEL); + kzalloc_objs(struct qedf_fastpath, qedf->num_queues, GFP_KERNEL); if (!qedf->fp_array) { QEDF_ERR(&(qedf->dbg_ctx), "fastpath array allocation " @@ -2790,7 +2789,7 @@ static int qedf_prepare_sb(struct qedf_ctx *qedf) for (id = 0; id < qedf->num_queues; id++) { fp = &(qedf->fp_array[id]); fp->sb_id = QEDF_SB_ID_NULL; - fp->sb_info = kcalloc(1, sizeof(*fp->sb_info), GFP_KERNEL); + fp->sb_info = kzalloc_objs(*fp->sb_info, 1, GFP_KERNEL); if (!fp->sb_info) { QEDF_ERR(&(qedf->dbg_ctx), "SB info struct " "allocation failed.\n"); @@ -3083,8 +3082,8 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf) /* Allocate a CQ and an associated PBL for each MSI-X vector */ for (i = 0; i < qedf->num_queues; i++) { - qedf->global_queues[i] = kzalloc(sizeof(struct global_queue), - GFP_KERNEL); + qedf->global_queues[i] = kzalloc_obj(struct global_queue, + GFP_KERNEL); if (!qedf->global_queues[i]) { QEDF_WARN(&(qedf->dbg_ctx), "Unable to allocate " "global queue %d.\n", i); diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 6901738324da..854efa4f61d8 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -190,7 +190,7 @@ static void qedi_process_tmf_resp(struct qedi_ctx *qedi, cqe_tmp_response = &cqe->cqe_common.iscsi_hdr.tmf_response; qedi_cmd = task->dd_data; - qedi_cmd->tmf_resp_buf = kzalloc(sizeof(*resp_hdr_ptr), GFP_ATOMIC); + qedi_cmd->tmf_resp_buf = kzalloc_obj(*resp_hdr_ptr, GFP_ATOMIC); if (!qedi_cmd->tmf_resp_buf) { QEDI_ERR(&qedi->dbg_ctx, "Failed to allocate resp buf, cid=0x%x\n", @@ -1358,7 +1358,7 @@ static void qedi_abort_work(struct work_struct *work) goto clear_cleanup; } - list_work = kzalloc(sizeof(*list_work), GFP_NOIO); + list_work = kzalloc_obj(*list_work, GFP_NOIO); if (!list_work) { QEDI_ERR(&qedi->dbg_ctx, "Memory allocation failed\n"); goto clear_cleanup; diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index 6ed8ef97642c..65fdbc07de43 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -440,7 +440,7 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi, qedi_ep = qedi_conn->ep; - conn_info = kzalloc(sizeof(*conn_info), GFP_KERNEL); + conn_info = kzalloc_obj(*conn_info, GFP_KERNEL); if (!conn_info) { QEDI_ERR(&qedi->dbg_ctx, "memory alloc failed\n"); return -ENOMEM; @@ -505,7 +505,7 @@ static int qedi_iscsi_offload_conn(struct qedi_endpoint *qedi_ep) int rval; int i; - conn_info = kzalloc(sizeof(*conn_info), GFP_KERNEL); + conn_info = kzalloc_obj(*conn_info, GFP_KERNEL); if (!conn_info) { QEDI_ERR(&qedi->dbg_ctx, "Failed to allocate memory ep=%p\n", qedi_ep); diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 56685ee22fdf..14ec6cb44316 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -276,7 +276,7 @@ static int qedi_alloc_uio_rings(struct qedi_ctx *qedi) } } - udev = kzalloc(sizeof(*udev), GFP_KERNEL); + udev = kzalloc_obj(*udev, GFP_KERNEL); if (!udev) goto err_udev; @@ -410,16 +410,16 @@ static int qedi_alloc_fp(struct qedi_ctx *qedi) { int ret = 0; - qedi->fp_array = kcalloc(MIN_NUM_CPUS_MSIX(qedi), - sizeof(struct qedi_fastpath), GFP_KERNEL); + qedi->fp_array = kzalloc_objs(struct qedi_fastpath, + MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL); if (!qedi->fp_array) { QEDI_ERR(&qedi->dbg_ctx, "fastpath fp array allocation failed.\n"); return -ENOMEM; } - qedi->sb_array = kcalloc(MIN_NUM_CPUS_MSIX(qedi), - sizeof(struct qed_sb_info), GFP_KERNEL); + qedi->sb_array = kzalloc_objs(struct qed_sb_info, + MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL); if (!qedi->sb_array) { QEDI_ERR(&qedi->dbg_ctx, "fastpath sb array allocation failed.\n"); @@ -498,9 +498,9 @@ static int qedi_setup_cid_que(struct qedi_ctx *qedi) if (!qedi->cid_que.cid_que_base) return -ENOMEM; - qedi->cid_que.conn_cid_tbl = kmalloc_array(qedi->max_active_conns, - sizeof(struct qedi_conn *), - GFP_KERNEL); + qedi->cid_que.conn_cid_tbl = kmalloc_objs(struct qedi_conn *, + qedi->max_active_conns, + GFP_KERNEL); if (!qedi->cid_que.conn_cid_tbl) { kfree(qedi->cid_que.cid_que_base); qedi->cid_que.cid_que_base = NULL; @@ -706,7 +706,7 @@ static int qedi_ll2_rx(void *cookie, struct sk_buff *skb, u32 arg1, u32 arg2) "Allowed frame ethertype [0x%x] len [0x%x].\n", eh->h_proto, skb->len); - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) { QEDI_WARN(&qedi->dbg_ctx, "Could not allocate work so dropping frame.\n"); @@ -956,7 +956,7 @@ static int qedi_find_boot_info(struct qedi_ctx *qedi, pri_ctrl_flags = !!(block->target[0].ctrl_flags & NVM_ISCSI_CFG_TARGET_ENABLED); if (pri_ctrl_flags) { - pri_tgt = kzalloc(sizeof(*pri_tgt), GFP_KERNEL); + pri_tgt = kzalloc_obj(*pri_tgt, GFP_KERNEL); if (!pri_tgt) return -1; qedi_get_boot_tgt_info(block, pri_tgt, 0); @@ -965,7 +965,7 @@ static int qedi_find_boot_info(struct qedi_ctx *qedi, sec_ctrl_flags = !!(block->target[1].ctrl_flags & NVM_ISCSI_CFG_TARGET_ENABLED); if (sec_ctrl_flags) { - sec_tgt = kzalloc(sizeof(*sec_tgt), GFP_KERNEL); + sec_tgt = kzalloc_obj(*sec_tgt, GFP_KERNEL); if (!sec_tgt) { ret = -1; goto free_tgt; @@ -1066,7 +1066,7 @@ static void qedi_get_protocol_tlv_data(void *dev, void *data) struct qedi_ctx *qedi = dev; int rval = 0; - fw_iscsi_stats = kmalloc(sizeof(*fw_iscsi_stats), GFP_KERNEL); + fw_iscsi_stats = kmalloc_obj(*fw_iscsi_stats, GFP_KERNEL); if (!fw_iscsi_stats) { QEDI_ERR(&qedi->dbg_ctx, "Could not allocate memory for fw_iscsi_stats.\n"); @@ -1239,7 +1239,7 @@ static int qedi_queue_cqe(struct qedi_ctx *qedi, union iscsi_cqe *cqe, case ISCSI_CQE_TYPE_UNSOLICITED: case ISCSI_CQE_TYPE_DUMMY: case ISCSI_CQE_TYPE_TASK_CLEANUP: - qedi_work = kzalloc(sizeof(*qedi_work), GFP_ATOMIC); + qedi_work = kzalloc_obj(*qedi_work, GFP_ATOMIC); if (!qedi_work) { rc = -1; break; @@ -1668,8 +1668,8 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) */ for (i = 0; i < qedi->num_queues; i++) { qedi->global_queues[i] = - kzalloc(sizeof(*qedi->global_queues[0]), - GFP_KERNEL); + kzalloc_obj(*qedi->global_queues[0], + GFP_KERNEL); if (!qedi->global_queues[i]) { QEDI_ERR(&qedi->dbg_ctx, "Unable to allocation global queue %d.\n", i); @@ -1895,8 +1895,8 @@ struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid) static int qedi_alloc_itt(struct qedi_ctx *qedi) { - qedi->itt_map = kcalloc(MAX_ISCSI_TASK_ENTRIES, - sizeof(struct qedi_itt_map), GFP_KERNEL); + qedi->itt_map = kzalloc_objs(struct qedi_itt_map, + MAX_ISCSI_TASK_ENTRIES, GFP_KERNEL); if (!qedi->itt_map) { QEDI_ERR(&qedi->dbg_ctx, "Unable to allocate itt map array memory\n"); diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 2c44a379cb23..924b07f56c80 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -2395,7 +2395,7 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) !IS_QLA28XX(vha->hw)) return -EPERM; - dd = kmalloc(sizeof(*dd), GFP_KERNEL); + dd = kmalloc_obj(*dd, GFP_KERNEL); if (!dd) { ql_log(ql_log_warn, vha, 0x70db, "Failed to allocate memory for dport.\n"); @@ -2441,7 +2441,7 @@ qla2x00_do_dport_diagnostics_v2(struct bsg_job *bsg_job) if (!IS_DPORT_CAPABLE(vha->hw)) return -EPERM; - dd = kzalloc(sizeof(*dd), GFP_KERNEL); + dd = kzalloc_obj(*dd, GFP_KERNEL); if (!dd) return -ENOMEM; @@ -2598,7 +2598,7 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc(sizeof(*req_data), GFP_KERNEL); + req_data = kzalloc_obj(*req_data, GFP_KERNEL); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2669,7 +2669,7 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc(sizeof(*req_data), GFP_KERNEL); + req_data = kzalloc_obj(*req_data, GFP_KERNEL); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2776,7 +2776,7 @@ qla2x00_get_tgt_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc(sizeof(*req_data), GFP_KERNEL); + req_data = kzalloc_obj(*req_data, GFP_KERNEL); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2859,7 +2859,7 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc(sizeof(*req_data), GFP_KERNEL); + req_data = kzalloc_obj(*req_data, GFP_KERNEL); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index ccd4485087a1..a2db229d3af4 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -174,7 +174,7 @@ static int qla_edif_list_add_sa_update_index(fc_port_t *fcport, * when update is called for the first two sa_indexes * followed by a delete of the first sa_index */ - entry = kzalloc((sizeof(struct edif_list_entry)), GFP_ATOMIC); + entry = kzalloc_obj(struct edif_list_entry, GFP_ATOMIC); if (!entry) return -ENOMEM; @@ -1393,7 +1393,7 @@ qla_edif_add_sa_ctl(fc_port_t *fcport, struct qla_sa_update_frame *sa_frame, int index = sa_frame->fast_sa_index; unsigned long flags = 0; - sa_ctl = kzalloc(sizeof(*sa_ctl), GFP_KERNEL); + sa_ctl = kzalloc_obj(*sa_ctl, GFP_KERNEL); if (!sa_ctl) { /* couldn't get space */ ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, @@ -2187,7 +2187,7 @@ qla_edb_node_alloc(scsi_qla_host_t *vha, uint32_t ntype) { struct edb_node *node; - node = kzalloc(sizeof(*node), GFP_ATOMIC); + node = kzalloc_obj(*node, GFP_ATOMIC); if (!node) { /* couldn't get space */ ql_dbg(ql_dbg_edif, vha, 0x9100, @@ -3279,7 +3279,7 @@ static uint16_t qla_edif_sadb_get_sa_index(fc_port_t *fcport, } /* if there is no entry for this nport, add one */ - entry = kzalloc((sizeof(struct edif_sa_index_entry)), GFP_ATOMIC); + entry = kzalloc_obj(struct edif_sa_index_entry, GFP_ATOMIC); if (!entry) return INVALID_EDIF_SA_INDEX; @@ -3381,7 +3381,7 @@ void qla_edif_sadb_release(struct qla_hw_data *ha) int qla_edif_sadb_build_free_pool(struct qla_hw_data *ha) { ha->edif_tx_sa_id_map = - kcalloc(BITS_TO_LONGS(EDIF_NUM_SA_INDEX), sizeof(long), GFP_KERNEL); + kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX), GFP_KERNEL); if (!ha->edif_tx_sa_id_map) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0009, @@ -3390,7 +3390,7 @@ int qla_edif_sadb_build_free_pool(struct qla_hw_data *ha) } ha->edif_rx_sa_id_map = - kcalloc(BITS_TO_LONGS(EDIF_NUM_SA_INDEX), sizeof(long), GFP_KERNEL); + kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX), GFP_KERNEL); if (!ha->edif_rx_sa_id_map) { kfree(ha->edif_tx_sa_id_map); ha->edif_tx_sa_id_map = NULL; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 689f909943b4..808acf7daf4d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4033,9 +4033,8 @@ qla2x00_alloc_outstanding_cmds(struct qla_hw_data *ha, struct req_que *req) req->num_outstanding_cmds = ha->cur_fw_iocb_count; } - req->outstanding_cmds = kcalloc(req->num_outstanding_cmds, - sizeof(srb_t *), - GFP_KERNEL); + req->outstanding_cmds = kzalloc_objs(srb_t *, req->num_outstanding_cmds, + GFP_KERNEL); if (!req->outstanding_cmds) { /* @@ -4043,9 +4042,9 @@ qla2x00_alloc_outstanding_cmds(struct qla_hw_data *ha, struct req_que *req) * initialization. */ req->num_outstanding_cmds = MIN_OUTSTANDING_COMMANDS; - req->outstanding_cmds = kcalloc(req->num_outstanding_cmds, - sizeof(srb_t *), - GFP_KERNEL); + req->outstanding_cmds = kzalloc_objs(srb_t *, + req->num_outstanding_cmds, + GFP_KERNEL); if (!req->outstanding_cmds) { ql_log(ql_log_fatal, NULL, 0x0126, @@ -5574,7 +5573,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) { fc_port_t *fcport; - fcport = kzalloc(sizeof(fc_port_t), flags); + fcport = kzalloc_obj(fc_port_t, flags); if (!fcport) return NULL; @@ -6494,8 +6493,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) /* Try GID_PT to get device list, else GAN. */ if (!ha->swl) - ha->swl = kcalloc(ha->max_fibre_devices, sizeof(sw_info_t), - GFP_KERNEL); + ha->swl = kzalloc_objs(sw_info_t, ha->max_fibre_devices, + GFP_KERNEL); swl = ha->swl; if (!swl) { /*EMPTY*/ @@ -9231,7 +9230,7 @@ qla84xx_get_chip(struct scsi_qla_host *vha) } } - cs84xx = kzalloc(sizeof(*cs84xx), GFP_KERNEL); + cs84xx = kzalloc_obj(*cs84xx, GFP_KERNEL); if (!cs84xx) goto done; @@ -9885,7 +9884,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, } if (ql2xmqsupport || ql2xnvmeenable) { - qpair = kzalloc(sizeof(struct qla_qpair), GFP_KERNEL); + qpair = kzalloc_obj(struct qla_qpair, GFP_KERNEL); if (qpair == NULL) { ql_log(ql_log_warn, vha, 0x0182, "Failed to allocate memory for queue pair.\n"); diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index ef4b3cc1cd77..bb34a3a612cf 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -621,8 +621,8 @@ static inline int qla_mapq_alloc_qp_cpu_map(struct qla_hw_data *ha) scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); if (!ha->qp_cpu_map) { - ha->qp_cpu_map = kcalloc(NR_CPUS, sizeof(struct qla_qpair *), - GFP_KERNEL); + ha->qp_cpu_map = kzalloc_objs(struct qla_qpair *, NR_CPUS, + GFP_KERNEL); if (!ha->qp_cpu_map) { ql_log(ql_log_fatal, vha, 0x0180, "Unable to allocate memory for qp_cpu_map ptrs.\n"); diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 3224044f1775..9038f6723444 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -882,7 +882,7 @@ alloc_and_fill: used_dsds -= avail_dsds; /* allocate tracking DS */ - dsd_ptr = kzalloc(sizeof(struct dsd_dma), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(struct dsd_dma, GFP_ATOMIC); if (!dsd_ptr) return 1; @@ -979,7 +979,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, used_dsds -= avail_dsds; /* allocate tracking DS */ - dsd_ptr = kzalloc(sizeof(struct dsd_dma), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(struct dsd_dma, GFP_ATOMIC); if (!dsd_ptr) return 1; @@ -1123,8 +1123,8 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, * Allocate list item to store * the DMA buffers */ - dsd_ptr = kzalloc(sizeof(*dsd_ptr), - GFP_ATOMIC); + dsd_ptr = kzalloc_obj(*dsd_ptr, + GFP_ATOMIC); if (!dsd_ptr) { ql_dbg(ql_dbg_tgt, vha, 0xe024, "%s: failed alloc dsd_ptr\n", @@ -1209,7 +1209,7 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, used_dsds -= avail_dsds; /* allocate tracking DS */ - dsd_ptr = kzalloc(sizeof(*dsd_ptr), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(*dsd_ptr, GFP_ATOMIC); if (!dsd_ptr) { ql_dbg(ql_dbg_tgt, vha, 0xe026, "%s: failed alloc dsd_ptr\n", @@ -1275,7 +1275,7 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, used_dsds -= avail_dsds; /* allocate tracking DS */ - dsd_ptr = kzalloc(sizeof(*dsd_ptr), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(*dsd_ptr, GFP_ATOMIC); if (!dsd_ptr) { ql_dbg(ql_dbg_tgt + ql_dbg_verbose, vha, 0xe027, @@ -3450,7 +3450,7 @@ qla82xx_start_scsi(srb_t *sp) more_dsd_lists -= qpair->dsd_avail; for (i = 0; i < more_dsd_lists; i++) { - dsd_ptr = kzalloc(sizeof(struct dsd_dma), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(struct dsd_dma, GFP_ATOMIC); if (!dsd_ptr) { ql_log(ql_log_fatal, vha, 0x300e, "Failed to allocate memory for dsd_dma " @@ -4315,7 +4315,7 @@ qla_start_scsi_type6(srb_t *sp) more_dsd_lists -= qpair->dsd_avail; for (i = 0; i < more_dsd_lists; i++) { - dsd_ptr = kzalloc(sizeof(*dsd_ptr), GFP_ATOMIC); + dsd_ptr = kzalloc_obj(*dsd_ptr, GFP_ATOMIC); if (!dsd_ptr) { ql_log(ql_log_fatal, vha, 0x3029, "Failed to allocate memory for dsd_dma for cmd=%p.\n", cmd); diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 608d2f36e7b4..6117b516a23a 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -4562,9 +4562,8 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) } } vha->irq_offset = desc.pre_vectors; - ha->msix_entries = kcalloc(ha->msix_count, - sizeof(struct qla_msix_entry), - GFP_KERNEL); + ha->msix_entries = kzalloc_objs(struct qla_msix_entry, ha->msix_count, + GFP_KERNEL); if (!ha->msix_entries) { ql_log(ql_log_fatal, vha, 0x00c8, "Failed to allocate memory for ha->msix_entries.\n"); diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 0abc47e72e0b..34928d981677 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -707,7 +707,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, device_reg_t *reg; uint32_t cnt; - req = kzalloc(sizeof(struct req_que), GFP_KERNEL); + req = kzalloc_obj(struct req_que, GFP_KERNEL); if (req == NULL) { ql_log(ql_log_fatal, base_vha, 0x00d9, "Failed to allocate memory for request queue.\n"); @@ -834,7 +834,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options, uint16_t que_id = 0; device_reg_t *reg; - rsp = kzalloc(sizeof(struct rsp_que), GFP_KERNEL); + rsp = kzalloc_obj(struct rsp_que, GFP_KERNEL); if (rsp == NULL) { ql_log(ql_log_warn, base_vha, 0x0066, "Failed to allocate memory for response queue.\n"); @@ -1102,7 +1102,8 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp) return -ENOMEM; } sz = qp->req->length * sizeof(dma_addr_t); - qp->buf_pool.dma_array = kcalloc(qp->req->length, sizeof(dma_addr_t), GFP_KERNEL); + qp->buf_pool.dma_array = kzalloc_objs(dma_addr_t, qp->req->length, + GFP_KERNEL); if (!qp->buf_pool.dma_array) { ql_log(ql_log_warn, vha, 0x0186, "Failed to allocate dma_array(%d).\n", sz); diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 42eb65a62f1f..2531e71c39dc 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -1286,7 +1286,7 @@ void qla2xxx_process_purls_iocb(void **pkt, struct rsp_que **rsp) goto out; } - uctx = kzalloc(sizeof(*uctx), GFP_ATOMIC); + uctx = kzalloc_obj(*uctx, GFP_ATOMIC); if (!uctx) { ql_log(ql_log_info, vha, 0x2126, "Failed allocate memory\n"); a.reason = FCNVME_RJT_RC_LOGIC; diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 0cd3db8ed4ef..ec47ef3f0783 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -1183,7 +1183,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x0072, "%d CRB init values found in ROM.\n", n); - buf = kmalloc_array(n, sizeof(struct crb_addr_pair), GFP_KERNEL); + buf = kmalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); if (buf == NULL) { ql_log(ql_log_fatal, vha, 0x010c, "Unable to allocate memory.\n"); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a88b460641f2..89540254b784 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -438,23 +438,23 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, { scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); - ha->req_q_map = kcalloc(ha->max_req_queues, sizeof(struct req_que *), - GFP_KERNEL); + ha->req_q_map = kzalloc_objs(struct req_que *, ha->max_req_queues, + GFP_KERNEL); if (!ha->req_q_map) { ql_log(ql_log_fatal, vha, 0x003b, "Unable to allocate memory for request queue ptrs.\n"); goto fail_req_map; } - ha->rsp_q_map = kcalloc(ha->max_rsp_queues, sizeof(struct rsp_que *), - GFP_KERNEL); + ha->rsp_q_map = kzalloc_objs(struct rsp_que *, ha->max_rsp_queues, + GFP_KERNEL); if (!ha->rsp_q_map) { ql_log(ql_log_fatal, vha, 0x003c, "Unable to allocate memory for response queue ptrs.\n"); goto fail_rsp_map; } - ha->base_qpair = kzalloc(sizeof(struct qla_qpair), GFP_KERNEL); + ha->base_qpair = kzalloc_obj(struct qla_qpair, GFP_KERNEL); if (ha->base_qpair == NULL) { ql_log(ql_log_warn, vha, 0x00e0, "Failed to allocate base queue pair memory.\n"); @@ -464,8 +464,8 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, qla_init_base_qpair(vha, req, rsp); if ((ql2xmqsupport || ql2xnvmeenable) && ha->max_qpairs) { - ha->queue_pair_map = kcalloc(ha->max_qpairs, sizeof(struct qla_qpair *), - GFP_KERNEL); + ha->queue_pair_map = kzalloc_objs(struct qla_qpair *, + ha->max_qpairs, GFP_KERNEL); if (!ha->queue_pair_map) { ql_log(ql_log_fatal, vha, 0x0180, "Unable to allocate memory for queue pair ptrs.\n"); @@ -2960,7 +2960,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } - ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); + ha = kzalloc_obj(struct qla_hw_data, GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, "Unable to allocate memory for ha.\n"); @@ -4151,7 +4151,8 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, int rc; if (QLA_TGT_MODE_ENABLED() || EDIF_CAP(ha)) { - ha->vp_map = kcalloc(MAX_MULTI_ID_FABRIC, sizeof(struct qla_vp_map), GFP_KERNEL); + ha->vp_map = kzalloc_objs(struct qla_vp_map, + MAX_MULTI_ID_FABRIC, GFP_KERNEL); if (!ha->vp_map) goto fail; } @@ -4247,7 +4248,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, ha->pool.good.count = 0; ha->pool.unusable.count = 0; for (i = 0; i < 128; i++) { - dsd = kzalloc(sizeof(*dsd), GFP_ATOMIC); + dsd = kzalloc_obj(*dsd, GFP_ATOMIC); if (!dsd) { ql_dbg_pci(ql_dbg_init, ha->pdev, 0xe0ee, "%s: failed alloc dsd\n", @@ -4335,7 +4336,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, } /* Allocate memory for request ring */ - *req = kzalloc(sizeof(struct req_que), GFP_KERNEL); + *req = kzalloc_obj(struct req_que, GFP_KERNEL); if (!*req) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0028, "Failed to allocate memory for req.\n"); @@ -4351,7 +4352,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, goto fail_req_ring; } /* Allocate memory for response ring */ - *rsp = kzalloc(sizeof(struct rsp_que), GFP_KERNEL); + *rsp = kzalloc_obj(struct rsp_que, GFP_KERNEL); if (!*rsp) { ql_log_pci(ql_log_fatal, ha->pdev, 0x002a, "Failed to allocate memory for rsp.\n"); @@ -4376,9 +4377,8 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, (*rsp)->ring); /* Allocate memory for NVRAM data for vports */ if (ha->nvram_npiv_size) { - ha->npiv_info = kcalloc(ha->nvram_npiv_size, - sizeof(struct qla_npiv_entry), - GFP_KERNEL); + ha->npiv_info = kzalloc_objs(struct qla_npiv_entry, + ha->nvram_npiv_size, GFP_KERNEL); if (!ha->npiv_info) { ql_log_pci(ql_log_fatal, ha->pdev, 0x002d, "Failed to allocate memory for npiv_info.\n"); @@ -4422,9 +4422,8 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, INIT_LIST_HEAD(&ha->vp_list); /* Allocate memory for our loop_id bitmap */ - ha->loop_id_map = kcalloc(BITS_TO_LONGS(LOOPID_MAP_SIZE), - sizeof(long), - GFP_KERNEL); + ha->loop_id_map = kzalloc_objs(long, BITS_TO_LONGS(LOOPID_MAP_SIZE), + GFP_KERNEL); if (!ha->loop_id_map) goto fail_loop_id_map; else { @@ -5136,7 +5135,7 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) if (qla_vha_mark_busy(vha)) return NULL; - e = kzalloc(sizeof(struct qla_work_evt), GFP_ATOMIC); + e = kzalloc_obj(struct qla_work_evt, GFP_ATOMIC); if (!e) { QLA_VHA_MARK_NOT_BUSY(vha); return NULL; @@ -6018,7 +6017,7 @@ qla25xx_rdp_rsp_reduce_size(struct scsi_qla_host *vha, ql_dbg(ql_dbg_init, vha, 0x0181, "%s: s_id=%#x\n", __func__, sid); - pdb = kzalloc(sizeof(*pdb), GFP_KERNEL); + pdb = kzalloc_obj(*pdb, GFP_KERNEL); if (!pdb) { ql_dbg(ql_dbg_init, vha, 0x0181, "%s: Failed allocate pdb\n", __func__); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index ef3a5fac2b48..8062dad21d4e 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1621,7 +1621,7 @@ static int qlt_sched_sess_work(struct qla_tgt *tgt, int type, struct qla_tgt_sess_work_param *prm; unsigned long flags; - prm = kzalloc(sizeof(*prm), GFP_ATOMIC); + prm = kzalloc_obj(*prm, GFP_ATOMIC); if (!prm) { ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xf050, "qla_target(%d): Unable to create session " @@ -3988,7 +3988,7 @@ static int qlt_prepare_srr_ctio(struct qla_qpair *qpair, return 0; } - srr = kzalloc(sizeof(*srr), GFP_ATOMIC); + srr = kzalloc_obj(*srr, GFP_ATOMIC); if (!srr) return -ENOMEM; @@ -5561,7 +5561,7 @@ static void qlt_prepare_srr_imm(struct scsi_qla_host *vha, * safely. */ - srr = kzalloc(sizeof(*srr), GFP_ATOMIC); + srr = kzalloc_obj(*srr, GFP_ATOMIC); if (!srr) goto out_reject; @@ -5707,7 +5707,7 @@ static int qlt_set_data_offset(struct qla_tgt_cmd *cmd, uint32_t offset) */ int n_alloc_sg = min(sg_srr_cnt, 2); struct scatterlist *sg_srr = - kmalloc_array(n_alloc_sg, sizeof(*sg_srr), GFP_ATOMIC); + kmalloc_objs(*sg_srr, n_alloc_sg, GFP_ATOMIC); if (!sg_srr) { ql_dbg(ql_dbg_tgt_mgt, vha, 0x11027, "qla_target(%d): tag %lld: Unable to allocate SRR scatterlist\n", @@ -7458,16 +7458,15 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha) BUG_ON(base_vha->vha_tgt.qla_tgt != NULL); - tgt = kzalloc(sizeof(struct qla_tgt), GFP_KERNEL); + tgt = kzalloc_obj(struct qla_tgt, GFP_KERNEL); if (!tgt) { ql_dbg(ql_dbg_tgt, base_vha, 0xe066, "Unable to allocate struct qla_tgt\n"); return -ENOMEM; } - tgt->qphints = kcalloc(ha->max_qpairs + 1, - sizeof(struct qla_qpair_hint), - GFP_KERNEL); + tgt->qphints = kzalloc_objs(struct qla_qpair_hint, ha->max_qpairs + 1, + GFP_KERNEL); if (!tgt->qphints) { kfree(tgt); ql_log(ql_log_warn, base_vha, 0x0197, @@ -8280,7 +8279,7 @@ qlt_handle_abts_recv(struct scsi_qla_host *vha, struct rsp_que *rsp, { struct qla_tgt_sess_op *op; - op = kzalloc(sizeof(*op), GFP_ATOMIC); + op = kzalloc_obj(*op, GFP_ATOMIC); if (!op) { /* do not reach for ATIO queue here. This is best effort err diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 3177cb7864a7..2eae89aad109 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1015,7 +1015,7 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg(struct se_wwn *wwn, return ERR_PTR(-ENOSYS); } - tpg = kzalloc(sizeof(struct tcm_qla2xxx_tpg), GFP_KERNEL); + tpg = kzalloc_obj(struct tcm_qla2xxx_tpg, GFP_KERNEL); if (!tpg) { pr_err("Unable to allocate struct tcm_qla2xxx_tpg\n"); return ERR_PTR(-ENOMEM); @@ -1106,7 +1106,7 @@ static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(struct se_wwn *wwn, if (kstrtoul(name + 5, 10, &tpgt) || tpgt > USHRT_MAX) return ERR_PTR(-EINVAL); - tpg = kzalloc(sizeof(struct tcm_qla2xxx_tpg), GFP_KERNEL); + tpg = kzalloc_obj(struct tcm_qla2xxx_tpg, GFP_KERNEL); if (!tpg) { pr_err("Unable to allocate struct tcm_qla2xxx_tpg\n"); return ERR_PTR(-ENOMEM); @@ -1609,7 +1609,7 @@ static struct se_wwn *tcm_qla2xxx_make_lport( if (tcm_qla2xxx_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); - lport = kzalloc(sizeof(struct tcm_qla2xxx_lport), GFP_KERNEL); + lport = kzalloc_obj(struct tcm_qla2xxx_lport, GFP_KERNEL); if (!lport) { pr_err("Unable to allocate struct tcm_qla2xxx_lport\n"); return ERR_PTR(-ENOMEM); @@ -1735,7 +1735,7 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport( &npiv_wwpn, &npiv_wwnn) < 0) return ERR_PTR(-EINVAL); - lport = kzalloc(sizeof(struct tcm_qla2xxx_lport), GFP_KERNEL); + lport = kzalloc_obj(struct tcm_qla2xxx_lport, GFP_KERNEL); if (!lport) { pr_err("Unable to allocate struct tcm_qla2xxx_lport for NPIV\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c index 28eab07935ba..3ec9321f41e2 100644 --- a/drivers/scsi/qla4xxx/ql4_iocb.c +++ b/drivers/scsi/qla4xxx/ql4_iocb.c @@ -451,7 +451,7 @@ static struct mrb *qla4xxx_get_new_mrb(struct scsi_qla_host *ha) { struct mrb *mrb; - mrb = kzalloc(sizeof(*mrb), GFP_KERNEL); + mrb = kzalloc_obj(*mrb, GFP_KERNEL); if (!mrb) return mrb; diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index b0a62aaa1cca..47b9fea0a989 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c @@ -1058,7 +1058,7 @@ qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose) ql4_printk(KERN_INFO, ha, "%s: %d CRB init values found in ROM.\n", DRIVER_NAME, n); - buf = kmalloc_array(n, sizeof(struct crb_addr_pair), GFP_KERNEL); + buf = kmalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); if (buf == NULL) { ql4_printk(KERN_WARNING, ha, "%s: [ERROR] Unable to malloc memory.\n", DRIVER_NAME); diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index 95a86e0dfd77..46fb627f61d6 100644 --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c @@ -81,7 +81,7 @@ static int raid_setup(struct transport_container *tc, struct device *dev, BUG_ON(dev_get_drvdata(cdev)); - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; @@ -212,8 +212,7 @@ raid_attr_ro_state_fn(state); struct raid_template * raid_class_attach(struct raid_function_template *ft) { - struct raid_internal *i = kzalloc(sizeof(struct raid_internal), - GFP_KERNEL); + struct raid_internal *i = kzalloc_obj(struct raid_internal, GFP_KERNEL); int count = 0; if (unlikely(!i)) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index c947655db518..fb609d2db056 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1169,7 +1169,7 @@ static ssize_t sdebug_error_write(struct file *file, const char __user *ubuf, return -EINVAL; } - inject = kzalloc(sizeof(struct sdebug_err_inject), GFP_KERNEL); + inject = kzalloc_obj(struct sdebug_err_inject, GFP_KERNEL); if (!inject) { kfree(buf); return -ENOMEM; @@ -1266,7 +1266,7 @@ static int sdebug_target_alloc(struct scsi_target *starget) { struct sdebug_target_info *targetip; - targetip = kzalloc(sizeof(struct sdebug_target_info), GFP_KERNEL); + targetip = kzalloc_obj(struct sdebug_target_info, GFP_KERNEL); if (!targetip) return -ENOMEM; @@ -6504,8 +6504,8 @@ static int sdebug_device_create_zones(struct sdebug_dev_info *devip) devip->max_open = sdeb_zbc_max_open; } - devip->zstate = kcalloc(devip->nr_zones, - sizeof(struct sdeb_zone_state), GFP_KERNEL); + devip->zstate = kzalloc_objs(struct sdeb_zone_state, devip->nr_zones, + GFP_KERNEL); if (!devip->zstate) return -ENOMEM; @@ -6549,7 +6549,7 @@ static struct sdebug_dev_info *sdebug_device_create( { struct sdebug_dev_info *devip; - devip = kzalloc(sizeof(*devip), flags); + devip = kzalloc_obj(*devip, flags); if (devip) { if (sdebug_uuid_ctl == 1) uuid_gen(&devip->lu_name); @@ -6649,8 +6649,8 @@ static int scsi_debug_sdev_configure(struct scsi_device *sdp, if (sdebug_ptype == TYPE_TAPE) { if (!devip->tape_blocks[0]) { devip->tape_blocks[0] = - kcalloc(TAPE_UNITS, sizeof(struct tape_block), - GFP_KERNEL); + kzalloc_objs(struct tape_block, TAPE_UNITS, + GFP_KERNEL); if (!devip->tape_blocks[0]) return 1; } @@ -8791,7 +8791,7 @@ static int sdebug_add_store(void) struct sdeb_store_info *sip = NULL; struct xa_limit xal = { .max = 1 << 16, .min = 0 }; - sip = kzalloc(sizeof(*sip), GFP_KERNEL); + sip = kzalloc_obj(*sip, GFP_KERNEL); if (!sip) return -ENOMEM; @@ -8868,7 +8868,7 @@ static int sdebug_add_host_helper(int per_host_idx) struct sdebug_host_info *sdbg_host; struct sdebug_dev_info *sdbg_devinfo, *tmp; - sdbg_host = kzalloc(sizeof(*sdbg_host), GFP_KERNEL); + sdbg_host = kzalloc_obj(*sdbg_host, GFP_KERNEL); if (!sdbg_host) return -ENOMEM; idx = (per_host_idx < 0) ? sdeb_first_idx : per_host_idx; diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 78346b2b69c9..bb27ae42c594 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -355,7 +355,7 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, if (IS_ERR(devinfo_table)) return PTR_ERR(devinfo_table); - devinfo = kmalloc(sizeof(*devinfo), GFP_KERNEL); + devinfo = kmalloc_obj(*devinfo, GFP_KERNEL); if (!devinfo) { printk(KERN_ERR "%s: no memory\n", __func__); return -ENOMEM; @@ -615,7 +615,7 @@ static int devinfo_seq_show(struct seq_file *m, void *v) static void *devinfo_seq_start(struct seq_file *m, loff_t *ppos) { - struct double_list *dl = kmalloc(sizeof(*dl), GFP_KERNEL); + struct double_list *dl = kmalloc_obj(*dl, GFP_KERNEL); loff_t pos = *ppos; if (!dl) @@ -759,7 +759,7 @@ int scsi_dev_info_add_list(enum scsi_devinfo_key key, const char *name) /* list already exists */ return -EEXIST; - devinfo_table = kmalloc(sizeof(*devinfo_table), GFP_KERNEL); + devinfo_table = kmalloc_obj(*devinfo_table, GFP_KERNEL); if (!devinfo_table) return -ENOMEM; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 68c411aa5665..d3a8cd4166f9 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2751,7 +2751,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send); struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, gfp_t gfpflags) { - struct scsi_event *evt = kzalloc(sizeof(struct scsi_event), gfpflags); + struct scsi_event *evt = kzalloc_obj(struct scsi_event, gfpflags); if (!evt) return NULL; diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 41f23cd0bfb4..046871351dc0 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -162,7 +162,7 @@ int scsi_proc_hostdir_add(const struct scsi_host_template *sht) mutex_lock(&global_host_template_mutex); e = __scsi_lookup_proc_entry(sht); if (!e) { - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) { ret = -ENOMEM; goto unlock; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 7acbfcfc2172..ca2bda973aad 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1954,7 +1954,7 @@ static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) goto err; } - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) goto err; data->shost = scsi_host_get(shost); diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 9532138105c1..3ec584e65fb4 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -2651,8 +2651,7 @@ struct scsi_transport_template * fc_attach_transport(struct fc_function_template *ft) { int count; - struct fc_internal *i = kzalloc(sizeof(struct fc_internal), - GFP_KERNEL); + struct fc_internal *i = kzalloc_obj(struct fc_internal, GFP_KERNEL); if (unlikely(!i)) return NULL; diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index ed21c032bbc4..af050a2c628e 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -4848,7 +4848,7 @@ iscsi_register_transport(struct iscsi_transport *tt) if (priv) return NULL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; INIT_LIST_HEAD(&priv->list); diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index d69c7c444a31..9bc00d950f86 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -712,7 +712,7 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number) struct Scsi_Host *shost = dev_to_shost(parent); struct sas_phy *phy; - phy = kzalloc(sizeof(*phy), GFP_KERNEL); + phy = kzalloc_obj(*phy, GFP_KERNEL); if (!phy) return NULL; @@ -907,7 +907,7 @@ struct sas_port *sas_port_alloc(struct device *parent, int port_id) struct Scsi_Host *shost = dev_to_shost(parent); struct sas_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return NULL; @@ -1467,7 +1467,7 @@ struct sas_rphy *sas_end_device_alloc(struct sas_port *parent) struct Scsi_Host *shost = dev_to_shost(&parent->dev); struct sas_end_device *rdev; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) { return NULL; } @@ -1511,7 +1511,7 @@ struct sas_rphy *sas_expander_alloc(struct sas_port *parent, BUG_ON(type != SAS_EDGE_EXPANDER_DEVICE && type != SAS_FANOUT_EXPANDER_DEVICE); - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) { return NULL; } @@ -1815,7 +1815,7 @@ sas_attach_transport(struct sas_function_template *ft) struct sas_internal *i; int count; - i = kzalloc(sizeof(struct sas_internal), GFP_KERNEL); + i = kzalloc_obj(struct sas_internal, GFP_KERNEL); if (!i) return NULL; diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 17a4a0918fc4..1f4299a61e1f 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1096,7 +1096,7 @@ void spi_schedule_dv_device(struct scsi_device *sdev) { struct work_queue_wrapper *wqw = - kmalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC); + kmalloc_obj(struct work_queue_wrapper, GFP_ATOMIC); if (unlikely(!wqw)) return; @@ -1570,8 +1570,7 @@ static int spi_target_configure(struct transport_container *tc, struct scsi_transport_template * spi_attach_transport(struct spi_function_template *ft) { - struct spi_internal *i = kzalloc(sizeof(struct spi_internal), - GFP_KERNEL); + struct spi_internal *i = kzalloc_obj(struct spi_internal, GFP_KERNEL); if (unlikely(!i)) return NULL; diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index aeb58a9e6b7f..ada7e07e5ae0 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -700,7 +700,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, struct srp_internal *i = to_srp_internal(shost->transportt); int id, ret; - rport = kzalloc(sizeof(*rport), GFP_KERNEL); + rport = kzalloc_obj(*rport, GFP_KERNEL); if (!rport) return ERR_PTR(-ENOMEM); @@ -814,7 +814,7 @@ srp_attach_transport(struct srp_function_template *ft) int count; struct srp_internal *i; - i = kzalloc(sizeof(*i), GFP_KERNEL); + i = kzalloc_obj(*i, GFP_KERNEL); if (!i) return NULL; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d76996d6cbc9..92fbe9caf6be 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3735,7 +3735,7 @@ static void sd_revalidate_disk(struct gendisk *disk) if (!scsi_device_online(sdp)) return; - lim = kmalloc(sizeof(*lim), GFP_KERNEL); + lim = kmalloc_obj(*lim, GFP_KERNEL); if (!lim) return; @@ -3974,7 +3974,7 @@ static int sd_probe(struct scsi_device *sdp) "sd_probe\n")); error = -ENOMEM; - sdkp = kzalloc(sizeof(*sdkp), GFP_KERNEL); + sdkp = kzalloc_obj(*sdkp, GFP_KERNEL); if (!sdkp) goto out; diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 789b170da652..901956cf3c5b 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -715,7 +715,7 @@ static int ses_intf_add(struct device *cdev) if (sdev->type != TYPE_ENCLOSURE) sdev_printk(KERN_NOTICE, sdev, "Embedded Enclosure Device\n"); - ses_dev = kzalloc(sizeof(*ses_dev), GFP_KERNEL); + ses_dev = kzalloc_obj(*ses_dev, GFP_KERNEL); hdr_buf = kzalloc(INIT_ALLOC_SIZE, GFP_KERNEL); if (!hdr_buf || !ses_dev) goto err_init_free; @@ -799,7 +799,8 @@ static int ses_intf_add(struct device *cdev) } page2_not_supported: if (components > 0) { - scomp = kcalloc(components, sizeof(struct ses_component), GFP_KERNEL); + scomp = kzalloc_objs(struct ses_component, components, + GFP_KERNEL); if (!scomp) goto err_free; } diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 1a521f9d821a..b04d8ddeb2eb 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1436,7 +1436,7 @@ sg_alloc(struct scsi_device *scsidp) int error; u32 k; - sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL); + sdp = kzalloc_obj(Sg_device, GFP_KERNEL); if (!sdp) { sdev_printk(KERN_WARNING, scsidp, "%s: kmalloc Sg_device " "failure\n", __func__); @@ -2157,7 +2157,7 @@ sg_add_sfp(Sg_device * sdp) unsigned long iflags; int bufflen; - sfp = kzalloc(sizeof(*sfp), GFP_ATOMIC | __GFP_NOWARN); + sfp = kzalloc_obj(*sfp, GFP_ATOMIC | __GFP_NOWARN); if (!sfp) return ERR_PTR(-ENOMEM); @@ -2456,7 +2456,7 @@ struct sg_proc_deviter { static void * dev_seq_start(struct seq_file *s, loff_t *pos) { - struct sg_proc_deviter * it = kmalloc(sizeof(*it), GFP_KERNEL); + struct sg_proc_deviter * it = kmalloc_obj(*it, GFP_KERNEL); s->private = it; if (! it) diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index 70c75ab1453a..16ca6245c51d 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c @@ -87,7 +87,7 @@ static int sim710_probe_common(struct device *dev, unsigned long base_addr, { struct Scsi_Host * host = NULL; struct NCR_700_Host_Parameters *hostdata = - kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); + kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); printk(KERN_NOTICE "sim710: %s\n", dev_name(dev)); printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n", diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 6f859f0d2046..88b94e611d0f 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -888,7 +888,7 @@ static int pqi_get_advanced_raid_bypass_config(struct pqi_ctrl_info *ctrl_info) struct pqi_raid_path_request request; struct bmic_sense_feature_buffer *buffer; - buffer = kmalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kmalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -953,7 +953,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, int rc; struct bmic_flush_cache *flush_cache; - flush_cache = kzalloc(sizeof(*flush_cache), GFP_KERNEL); + flush_cache = kzalloc_obj(*flush_cache, GFP_KERNEL); if (!flush_cache) return -ENOMEM; @@ -982,7 +982,7 @@ static int pqi_set_diag_rescan(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_diag_options *diag; - diag = kzalloc(sizeof(*diag), GFP_KERNEL); + diag = kzalloc_obj(*diag, GFP_KERNEL); if (!diag) return -ENOMEM; @@ -1164,7 +1164,7 @@ static int pqi_report_phys_logical_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd, void *lun_data = NULL; struct report_lun_header *report_lun_header; - report_lun_header = kmalloc(sizeof(*report_lun_header), GFP_KERNEL); + report_lun_header = kmalloc_obj(*report_lun_header, GFP_KERNEL); if (!report_lun_header) { rc = -ENOMEM; goto out; @@ -1252,8 +1252,8 @@ static inline int pqi_report_phys_luns(struct pqi_ctrl_info *ctrl_info, void **b rpl_8byte_wwid_list = rpl_list; num_physicals = get_unaligned_be32(&rpl_8byte_wwid_list->header.list_length) / sizeof(rpl_8byte_wwid_list->lun_entries[0]); - rpl_16byte_wwid_list = kmalloc(struct_size(rpl_16byte_wwid_list, lun_entries, - num_physicals), GFP_KERNEL); + rpl_16byte_wwid_list = kmalloc_flex(*rpl_16byte_wwid_list, lun_entries, + num_physicals, GFP_KERNEL); if (!rpl_16byte_wwid_list) { rc = -ENOMEM; goto out_free_rpl_list; @@ -1478,7 +1478,7 @@ static int pqi_get_raid_map(struct pqi_ctrl_info *ctrl_info, u32 raid_map_size; struct raid_map *raid_map; - raid_map = kmalloc(sizeof(*raid_map), GFP_KERNEL); + raid_map = kmalloc_obj(*raid_map, GFP_KERNEL); if (!raid_map) return -ENOMEM; @@ -1616,7 +1616,7 @@ static void pqi_get_volume_status(struct pqi_ctrl_info *ctrl_info, u32 volume_flags; struct ciss_vpd_logical_volume_status *vpd; - vpd = kmalloc(sizeof(*vpd), GFP_KERNEL); + vpd = kmalloc_obj(*vpd, GFP_KERNEL); if (!vpd) goto no_buffer; @@ -2447,7 +2447,7 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) * pqi_get_physical_disk_info() because it's a fairly large * buffer. */ - id_phys = kmalloc(sizeof(*id_phys), GFP_KERNEL); + id_phys = kmalloc_obj(*id_phys, GFP_KERNEL); if (!id_phys) { dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg); @@ -2472,9 +2472,8 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) num_new_devices = num_physicals + num_logicals; - new_device_list = kmalloc_array(num_new_devices, - sizeof(*new_device_list), - GFP_KERNEL); + new_device_list = kmalloc_objs(*new_device_list, num_new_devices, + GFP_KERNEL); if (!new_device_list) { dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg); rc = -ENOMEM; @@ -2482,7 +2481,7 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) } for (i = 0; i < num_new_devices; i++) { - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (!device) { dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg); @@ -4751,7 +4750,7 @@ static int pqi_report_device_capability(struct pqi_ctrl_info *ctrl_info) struct pqi_device_capability *capability; struct pqi_iu_layer_descriptor *sop_iu_layer_descriptor; - capability = kmalloc(sizeof(*capability), GFP_KERNEL); + capability = kmalloc_obj(*capability, GFP_KERNEL); if (!capability) return -ENOMEM; @@ -5207,8 +5206,9 @@ static int pqi_alloc_io_resources(struct pqi_ctrl_info *ctrl_info) struct device *dev; struct pqi_io_request *io_request; - ctrl_info->io_request_pool = kcalloc(ctrl_info->max_io_slots, - sizeof(ctrl_info->io_request_pool[0]), GFP_KERNEL); + ctrl_info->io_request_pool = kzalloc_objs(ctrl_info->io_request_pool[0], + ctrl_info->max_io_slots, + GFP_KERNEL); if (!ctrl_info->io_request_pool) { dev_err(&ctrl_info->pci_dev->dev, @@ -7746,7 +7746,7 @@ static int pqi_get_ctrl_serial_number(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_sense_subsystem_info *sense_info; - sense_info = kzalloc(sizeof(*sense_info), GFP_KERNEL); + sense_info = kzalloc_obj(*sense_info, GFP_KERNEL); if (!sense_info) return -ENOMEM; @@ -7769,7 +7769,7 @@ static int pqi_get_ctrl_product_details(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_identify_controller *identify; - identify = kmalloc(sizeof(*identify), GFP_KERNEL); + identify = kmalloc_obj(*identify, GFP_KERNEL); if (!identify) return -ENOMEM; diff --git a/drivers/scsi/smartpqi/smartpqi_sas_transport.c b/drivers/scsi/smartpqi/smartpqi_sas_transport.c index 93e96705754e..093b2ee39e90 100644 --- a/drivers/scsi/smartpqi/smartpqi_sas_transport.c +++ b/drivers/scsi/smartpqi/smartpqi_sas_transport.c @@ -22,7 +22,7 @@ static struct pqi_sas_phy *pqi_alloc_sas_phy(struct pqi_sas_port *pqi_sas_port) struct pqi_sas_phy *pqi_sas_phy; struct sas_phy *phy; - pqi_sas_phy = kzalloc(sizeof(*pqi_sas_phy), GFP_KERNEL); + pqi_sas_phy = kzalloc_obj(*pqi_sas_phy, GFP_KERNEL); if (!pqi_sas_phy) return NULL; @@ -131,7 +131,7 @@ static struct pqi_sas_port *pqi_alloc_sas_port( struct pqi_sas_port *pqi_sas_port; struct sas_port *port; - pqi_sas_port = kzalloc(sizeof(*pqi_sas_port), GFP_KERNEL); + pqi_sas_port = kzalloc_obj(*pqi_sas_port, GFP_KERNEL); if (!pqi_sas_port) return NULL; @@ -180,7 +180,7 @@ static struct pqi_sas_node *pqi_alloc_sas_node(struct device *parent_dev) { struct pqi_sas_node *pqi_sas_node; - pqi_sas_node = kzalloc(sizeof(*pqi_sas_node), GFP_KERNEL); + pqi_sas_node = kzalloc_obj(*pqi_sas_node, GFP_KERNEL); if (pqi_sas_node) { pqi_sas_node->parent_dev = parent_dev; INIT_LIST_HEAD(&pqi_sas_node->port_list_head); @@ -463,7 +463,7 @@ pqi_build_csmi_smp_passthru_buffer(struct sas_rphy *rphy, u32 req_size; u32 resp_size; - smp_buf = kzalloc(sizeof(*smp_buf), GFP_KERNEL); + smp_buf = kzalloc_obj(*smp_buf, GFP_KERNEL); if (!smp_buf) return NULL; diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c index d1d2556c8fc4..0e57e873dc42 100644 --- a/drivers/scsi/sni_53c710.c +++ b/drivers/scsi/sni_53c710.c @@ -64,7 +64,7 @@ static int snirm710_probe(struct platform_device *dev) return -ENODEV; base = res->start; - hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL); + hostdata = kzalloc_obj(*hostdata, GFP_KERNEL); if (!hostdata) return -ENOMEM; diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c index 4db3ba62fcd3..064f2d4d0ffc 100644 --- a/drivers/scsi/snic/snic_disc.c +++ b/drivers/scsi/snic/snic_disc.c @@ -244,7 +244,7 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid) return tgt; } - tgt = kzalloc(sizeof(*tgt), GFP_KERNEL); + tgt = kzalloc_obj(*tgt, GFP_KERNEL); if (!tgt) { SNIC_HOST_ERR(snic->shost, "Failure to allocate snic_tgt.\n"); ret = -ENOMEM; diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index 1c24517e4e65..f9ee2205407e 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -818,7 +818,7 @@ snic_global_data_init(void) struct kmem_cache *cachep; ssize_t len = 0; - snic_glob = kzalloc(sizeof(*snic_glob), GFP_KERNEL); + snic_glob = kzalloc_obj(*snic_glob, GFP_KERNEL); if (!snic_glob) { SNIC_ERR("Failed to allocate Global Context.\n"); diff --git a/drivers/scsi/snic/vnic_dev.c b/drivers/scsi/snic/vnic_dev.c index 760f3f22095c..c692de061f29 100644 --- a/drivers/scsi/snic/vnic_dev.c +++ b/drivers/scsi/snic/vnic_dev.c @@ -352,7 +352,7 @@ static int svnic_dev_init_devcmd2(struct vnic_dev *vdev) if (!p) return -ENODEV; - dc2c = kzalloc(sizeof(*dc2c), GFP_ATOMIC); + dc2c = kzalloc_obj(*dc2c, GFP_ATOMIC); if (!dc2c) return -ENOMEM; @@ -712,7 +712,7 @@ struct vnic_dev *svnic_dev_alloc_discover(struct vnic_dev *vdev, unsigned int num_bars) { if (!vdev) { - vdev = kzalloc(sizeof(struct vnic_dev), GFP_ATOMIC); + vdev = kzalloc_obj(struct vnic_dev, GFP_ATOMIC); if (!vdev) return NULL; } diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 1fb85f548955..f1871d78c30c 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -629,7 +629,7 @@ static int sr_probe(struct scsi_device *sdev) goto fail; error = -ENOMEM; - cd = kzalloc(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); if (!cd) goto fail; diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 413e844fa276..438c4e50d0fd 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -462,7 +462,7 @@ static struct st_request *st_allocate_request(struct scsi_tape *stp) { struct st_request *streq; - streq = kzalloc(sizeof(*streq), GFP_KERNEL); + streq = kzalloc_obj(*streq, GFP_KERNEL); if (streq) streq->stp = stp; else { @@ -3973,7 +3973,7 @@ static struct st_buffer *new_tape_buffer(int max_sg) { struct st_buffer *tb; - tb = kzalloc(sizeof(struct st_buffer), GFP_KERNEL); + tb = kzalloc_obj(struct st_buffer, GFP_KERNEL); if (!tb) { printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n"); return NULL; @@ -3982,8 +3982,7 @@ static struct st_buffer *new_tape_buffer(int max_sg) tb->use_sg = max_sg; tb->buffer_size = 0; - tb->reserved_pages = kcalloc(max_sg, sizeof(struct page *), - GFP_KERNEL); + tb->reserved_pages = kzalloc_objs(struct page *, max_sg, GFP_KERNEL); if (!tb->reserved_pages) { kfree(tb); return NULL; @@ -4374,7 +4373,7 @@ static int st_probe(struct scsi_device *SDp) goto out; } - tpnt = kzalloc(sizeof(struct scsi_tape), GFP_KERNEL); + tpnt = kzalloc_obj(struct scsi_tape, GFP_KERNEL); if (tpnt == NULL) { sdev_printk(KERN_ERR, SDp, "st: Can't allocate device descriptor.\n"); @@ -4457,7 +4456,7 @@ static int st_probe(struct scsi_device *SDp) } tpnt->index = error; sprintf(tpnt->name, "st%d", tpnt->index); - tpnt->stats = kzalloc(sizeof(struct scsi_tape_stats), GFP_KERNEL); + tpnt->stats = kzalloc_obj(struct scsi_tape_stats, GFP_KERNEL); if (tpnt->stats == NULL) { sdev_printk(KERN_ERR, SDp, "st: Can't allocate statistics.\n"); @@ -5007,7 +5006,7 @@ static int sgl_map_user_pages(struct st_buffer *STbp, if (count == 0) return 0; - pages = kmalloc_array(max_pages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, max_pages, GFP_KERNEL); if (pages == NULL) return -ENOMEM; diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 5a3f6fe22ae9..1ff8be01b1b1 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -1757,7 +1757,7 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) } } - hba->ccb = kcalloc(ci->rq_count, sizeof(struct st_ccb), GFP_KERNEL); + hba->ccb = kzalloc_objs(struct st_ccb, ci->rq_count, GFP_KERNEL); if (!hba->ccb) { err = -ENOMEM; printk(KERN_ERR DRV_NAME "(%s): ccb alloc failed\n", diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index b3f83c0dcced..4e3ff9e0a794 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1063,7 +1063,7 @@ do_work: /* * We need to schedule work to process this error; schedule it. */ - wrk = kmalloc(sizeof(struct storvsc_scan_work), GFP_ATOMIC); + wrk = kmalloc_obj(struct storvsc_scan_work, GFP_ATOMIC); if (!wrk) { set_host_byte(scmnd, DID_BAD_TARGET); return; @@ -1970,7 +1970,7 @@ static int storvsc_probe(struct hv_device *device, host_dev->host = host; - stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL); + stor_device = kzalloc_obj(struct storvsc_device, GFP_KERNEL); if (!stor_device) { ret = -ENOMEM; goto err_out0; diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index f0db17e34ea0..b9117acd324d 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -4990,8 +4990,8 @@ struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln) * Allocate the table of pointers for LUN(s) > 0, if needed. */ if (ln && !tp->lunmp) { - tp->lunmp = kcalloc(SYM_CONF_MAX_LUN, sizeof(struct sym_lcb *), - GFP_ATOMIC); + tp->lunmp = kzalloc_objs(struct sym_lcb *, SYM_CONF_MAX_LUN, + GFP_ATOMIC); if (!tp->lunmp) goto fail; } @@ -5655,7 +5655,7 @@ int sym_hcb_attach(struct Scsi_Host *shost, struct sym_fw *fw, struct sym_nvram /* * Allocate the array of lists of CCBs hashed by DSA. */ - np->ccbh = kcalloc(CCB_HASH_SIZE, sizeof(*np->ccbh), GFP_KERNEL); + np->ccbh = kzalloc_objs(*np->ccbh, CCB_HASH_SIZE, GFP_KERNEL); if (!np->ccbh) goto attach_failed; diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 89322717b181..7cccb4e06297 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -853,8 +853,8 @@ static int virtscsi_init(struct virtio_device *vdev, num_req_vqs = vscsi->num_queues; num_vqs = num_req_vqs + VIRTIO_SCSI_VQ_BASE; - vqs = kmalloc_array(num_vqs, sizeof(struct virtqueue *), GFP_KERNEL); - vqs_info = kcalloc(num_vqs, sizeof(*vqs_info), GFP_KERNEL); + vqs = kmalloc_objs(struct virtqueue *, num_vqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, num_vqs, GFP_KERNEL); if (!vqs || !vqs_info) { err = -ENOMEM; diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index 11f86c76f391..b6da5cfe444f 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c @@ -1478,8 +1478,8 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id) */ pvscsi_setup_all_rings(adapter); - adapter->cmd_map = kcalloc(adapter->req_depth, - sizeof(struct pvscsi_ctx), GFP_KERNEL); + adapter->cmd_map = kzalloc_objs(struct pvscsi_ctx, adapter->req_depth, + GFP_KERNEL); if (!adapter->cmd_map) { printk(KERN_ERR "vmw_pvscsi: failed to allocate memory.\n"); error = -ENOMEM; diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index bf36c07c2b47..42cde0017f12 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -494,8 +494,8 @@ static int map_data_for_request(struct vscsifrnt_info *info, return -E2BIG; } seg_grants = vscsiif_grants_sg(data_grants); - shadow->sg = kcalloc(data_grants, - sizeof(struct scsiif_request_segment), GFP_ATOMIC); + shadow->sg = kzalloc_objs(struct scsiif_request_segment, + data_grants, GFP_ATOMIC); if (!shadow->sg) return -ENOMEM; } @@ -669,7 +669,7 @@ static int scsifront_action_handler(struct scsi_cmnd *sc, uint8_t act) if (info->host_active == STATE_ERROR) return FAILED; - shadow = kzalloc(sizeof(*shadow), GFP_NOIO); + shadow = kzalloc_obj(*shadow, GFP_NOIO); if (!shadow) return FAILED; diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c index 7acf9193a9e8..392c905726ef 100644 --- a/drivers/scsi/zorro7xx.c +++ b/drivers/scsi/zorro7xx.c @@ -95,7 +95,7 @@ static int zorro7xx_init_one(struct zorro_dev *z, return -EBUSY; } - hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); if (!hostdata) { printk(KERN_ERR "zorro7xx: Failed to allocate host data\n"); goto out_release; diff --git a/drivers/scsi/zorro_esp.c b/drivers/scsi/zorro_esp.c index 56cae22a4242..39c0357eb8bd 100644 --- a/drivers/scsi/zorro_esp.c +++ b/drivers/scsi/zorro_esp.c @@ -726,7 +726,7 @@ static int zorro_esp_probe(struct zorro_dev *z, pr_info("%s found at address 0x%lx.\n", zdd->name, board); - zep = kzalloc(sizeof(*zep), GFP_KERNEL); + zep = kzalloc_obj(*zep, GFP_KERNEL); if (!zep) { pr_err("Can't allocate device private data!\n"); return -ENOMEM; diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c index 64ed7d64458a..58e64a666b2f 100644 --- a/drivers/sh/clk/cpg.c +++ b/drivers/sh/clk/cpg.c @@ -459,7 +459,7 @@ int __init sh_clk_fsidiv_register(struct clk *clks, int nr) for (i = 0; i < nr; i++) { - map = kzalloc(sizeof(struct clk_mapping), GFP_KERNEL); + map = kzalloc_obj(struct clk_mapping, GFP_KERNEL); if (!map) { pr_err("%s: unable to alloc memory\n", __func__); return -ENOMEM; diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index 3dde703b7766..aa68fe190865 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c @@ -204,7 +204,7 @@ int __init register_intc_controller(struct intc_desc *desc) pr_info("Registered controller '%s' with %u IRQs\n", desc->name, hw->nr_vectors); - d = kzalloc(sizeof(*d), GFP_NOWAIT); + d = kzalloc_obj(*d, GFP_NOWAIT); if (!d) goto err0; @@ -217,8 +217,7 @@ int __init register_intc_controller(struct intc_desc *desc) if (desc->num_resources) { d->nr_windows = desc->num_resources; - d->window = kcalloc(d->nr_windows, sizeof(*d->window), - GFP_NOWAIT); + d->window = kzalloc_objs(*d->window, d->nr_windows, GFP_NOWAIT); if (!d->window) goto err1; @@ -267,8 +266,7 @@ int __init register_intc_controller(struct intc_desc *desc) } if (hw->prio_regs) { - d->prio = kcalloc(hw->nr_vectors, sizeof(*d->prio), - GFP_NOWAIT); + d->prio = kzalloc_objs(*d->prio, hw->nr_vectors, GFP_NOWAIT); if (!d->prio) goto err4; @@ -283,8 +281,7 @@ int __init register_intc_controller(struct intc_desc *desc) } if (hw->sense_regs) { - d->sense = kcalloc(hw->nr_vectors, sizeof(*d->sense), - GFP_NOWAIT); + d->sense = kzalloc_objs(*d->sense, hw->nr_vectors, GFP_NOWAIT); if (!d->sense) goto err5; diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index a638c3048207..291798526519 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c @@ -93,7 +93,7 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq) last = &entry->next; } - entry = kzalloc(sizeof(struct intc_virq_list), GFP_ATOMIC); + entry = kzalloc_obj(struct intc_virq_list, GFP_ATOMIC); if (!entry) return -ENOMEM; @@ -168,7 +168,7 @@ static void __init intc_subgroup_init_one(struct intc_desc *desc, if (!subgroup->enum_ids[i]) continue; - entry = kmalloc(sizeof(*entry), GFP_NOWAIT); + entry = kmalloc_obj(*entry, GFP_NOWAIT); if (!entry) break; diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c index 6dc0549f7900..c9c3ba77653a 100644 --- a/drivers/sh/maple/maple.c +++ b/drivers/sh/maple/maple.c @@ -187,7 +187,7 @@ static struct mapleq *maple_allocq(struct maple_device *mdev) { struct mapleq *mq; - mq = kzalloc(sizeof(*mq), GFP_KERNEL); + mq = kzalloc_obj(*mq, GFP_KERNEL); if (!mq) goto failed_nomem; @@ -215,7 +215,7 @@ static struct maple_device *maple_alloc_dev(int port, int unit) /* zero this out to avoid kobj subsystem * thinking it has already been registered */ - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return NULL; diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c index f98f5a27e659..d058f481a39a 100644 --- a/drivers/siox/siox-core.c +++ b/drivers/siox/siox-core.c @@ -822,7 +822,7 @@ static struct siox_device *siox_device_add(struct siox_master *smaster, int ret; size_t buf_len; - sdevice = kzalloc(sizeof(*sdevice), GFP_KERNEL); + sdevice = kzalloc_obj(*sdevice, GFP_KERNEL); if (!sdevice) return ERR_PTR(-ENOMEM); diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 5079d3271ee8..4f796e24a6ed 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -180,7 +180,7 @@ static struct slim_device *slim_alloc_device(struct slim_controller *ctrl, struct slim_device *sbdev; int ret; - sbdev = kzalloc(sizeof(*sbdev), GFP_KERNEL); + sbdev = kzalloc_obj(*sbdev, GFP_KERNEL); if (!sbdev) return NULL; diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 7338b38697d0..0bead6949410 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1523,7 +1523,7 @@ static int of_qcom_slim_ngd_register(struct device *parent, if (of_property_read_u32(node, "reg", &id)) continue; - ngd = kzalloc(sizeof(*ngd), GFP_KERNEL); + ngd = kzalloc_obj(*ngd, GFP_KERNEL); if (!ngd) return -ENOMEM; diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c index 863ab3075d7e..48711d4cf110 100644 --- a/drivers/slimbus/stream.c +++ b/drivers/slimbus/stream.c @@ -103,7 +103,7 @@ struct slim_stream_runtime *slim_stream_allocate(struct slim_device *dev, { struct slim_stream_runtime *rt; - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) return ERR_PTR(-ENOMEM); @@ -214,7 +214,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, } num_ports = hweight32(cfg->port_mask); - rt->ports = kcalloc(num_ports, sizeof(*port), GFP_KERNEL); + rt->ports = kzalloc_objs(*port, num_ports, GFP_KERNEL); if (!rt->ports) return -ENOMEM; diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c index dcb75baaff24..f10aa0aab8d3 100644 --- a/drivers/soc/amlogic/meson-gx-socinfo.c +++ b/drivers/soc/amlogic/meson-gx-socinfo.c @@ -188,7 +188,7 @@ static int __init meson_gx_socinfo_init(void) return -EINVAL; } - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENODEV; diff --git a/drivers/soc/amlogic/meson-mx-socinfo.c b/drivers/soc/amlogic/meson-mx-socinfo.c index 92125dd65f33..e9003fd55294 100644 --- a/drivers/soc/amlogic/meson-mx-socinfo.c +++ b/drivers/soc/amlogic/meson-mx-socinfo.c @@ -146,7 +146,7 @@ static int __init meson_mx_socinfo_init(void) if (ret < 0) return ret; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENODEV; diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c index 4ad4f964fde7..0cde365c75bb 100644 --- a/drivers/soc/apple/rtkit.c +++ b/drivers/soc/apple/rtkit.c @@ -590,7 +590,7 @@ static void apple_rtkit_rx(struct apple_mbox *mbox, struct apple_mbox_msg msg, rtk->ops->recv_message_early(rtk->cookie, ep, msg.msg0)) return; - work = kzalloc(sizeof(*work), GFP_ATOMIC); + work = kzalloc_obj(*work, GFP_ATOMIC); if (!work) return; @@ -667,7 +667,7 @@ struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie, if (!ops) return ERR_PTR(-EINVAL); - rtk = kzalloc(sizeof(*rtk), GFP_KERNEL); + rtk = kzalloc_obj(*rtk, GFP_KERNEL); if (!rtk) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/aspeed/aspeed-p2a-ctrl.c b/drivers/soc/aspeed/aspeed-p2a-ctrl.c index 3be2e1b1085b..bbab8dabd940 100644 --- a/drivers/soc/aspeed/aspeed-p2a-ctrl.c +++ b/drivers/soc/aspeed/aspeed-p2a-ctrl.c @@ -238,7 +238,7 @@ static int aspeed_p2a_open(struct inode *inode, struct file *file) { struct aspeed_p2a_user *priv; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/soc/aspeed/aspeed-socinfo.c b/drivers/soc/aspeed/aspeed-socinfo.c index 67e9ac3d08ec..b4009164c84c 100644 --- a/drivers/soc/aspeed/aspeed-socinfo.c +++ b/drivers/soc/aspeed/aspeed-socinfo.c @@ -113,7 +113,7 @@ static int __init aspeed_socinfo_init(void) } of_node_put(np); - attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_obj(*attrs, GFP_KERNEL); if (!attrs) return -ENODEV; diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c index 09347bccdb1d..88de5aa41191 100644 --- a/drivers/soc/atmel/soc.c +++ b/drivers/soc/atmel/soc.c @@ -368,7 +368,7 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs) return NULL; } - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return NULL; diff --git a/drivers/soc/bcm/brcmstb/common.c b/drivers/soc/bcm/brcmstb/common.c index 2a010881f4b6..e9cf6897d8bf 100644 --- a/drivers/soc/bcm/brcmstb/common.c +++ b/drivers/soc/bcm/brcmstb/common.c @@ -82,7 +82,7 @@ static int __init brcmstb_soc_device_init(void) if (!sun_top_ctrl) return ret; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) { ret = -ENOMEM; goto out; diff --git a/drivers/soc/cirrus/soc-ep93xx.c b/drivers/soc/cirrus/soc-ep93xx.c index 3e79b3b13aef..d42813382977 100644 --- a/drivers/soc/cirrus/soc-ep93xx.c +++ b/drivers/soc/cirrus/soc-ep93xx.c @@ -92,7 +92,7 @@ static struct auxiliary_device __init *ep93xx_adev_alloc(struct device *parent, struct auxiliary_device *adev; int ret; - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (!rdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c index dd8ade8e9ee8..64b05aa80d2c 100644 --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c @@ -311,7 +311,7 @@ int __init dove_init_pmu_legacy(const struct dove_pmu_initdata *initdata) struct pmu_data *pmu; int ret; - pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); + pmu = kzalloc_obj(*pmu, GFP_KERNEL); if (!pmu) return -ENOMEM; @@ -324,7 +324,7 @@ int __init dove_init_pmu_legacy(const struct dove_pmu_initdata *initdata) domain_initdata++) { struct pmu_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (domain) { domain->pmu = pmu; domain->pwr_mask = domain_initdata->pwr_mask; @@ -386,7 +386,7 @@ int __init dove_init_pmu(void) return 0; } - pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); + pmu = kzalloc_obj(*pmu, GFP_KERNEL); if (!pmu) return -ENOMEM; @@ -408,7 +408,7 @@ int __init dove_init_pmu(void) struct of_phandle_args args; struct pmu_domain *domain; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) break; diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c index 6310f54e68a2..841e0510151c 100644 --- a/drivers/soc/fsl/dpaa2-console.c +++ b/drivers/soc/fsl/dpaa2-console.c @@ -111,7 +111,7 @@ static int dpaa2_generic_console_open(struct inode *node, struct file *fp, u64 base_addr; int err; - cd = kmalloc(sizeof(*cd), GFP_KERNEL); + cd = kmalloc_obj(*cd, GFP_KERNEL); if (!cd) return -ENOMEM; diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c index 0b60ed16297c..2a73d4e846ff 100644 --- a/drivers/soc/fsl/dpio/dpio-service.c +++ b/drivers/soc/fsl/dpio/dpio-service.c @@ -133,7 +133,7 @@ static void dpaa2_io_dim_work(struct work_struct *w) struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc, struct device *dev) { - struct dpaa2_io *obj = kmalloc(sizeof(*obj), GFP_KERNEL); + struct dpaa2_io *obj = kmalloc_obj(*obj, GFP_KERNEL); u32 qman_256_cycles_per_ns; if (!obj) @@ -523,7 +523,7 @@ int dpaa2_io_service_enqueue_multiple_desc_fq(struct dpaa2_io *d, struct qbman_eq_desc *ed; int i, ret; - ed = kcalloc(32, sizeof(struct qbman_eq_desc), GFP_KERNEL); + ed = kzalloc_objs(struct qbman_eq_desc, 32, GFP_KERNEL); if (!ed) return -ENOMEM; @@ -658,7 +658,7 @@ struct dpaa2_io_store *dpaa2_io_store_create(unsigned int max_frames, if (!max_frames || (max_frames > 32)) return NULL; - ret = kmalloc(sizeof(*ret), GFP_KERNEL); + ret = kmalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c index 0a3fb6c115f4..b6adc87f473a 100644 --- a/drivers/soc/fsl/dpio/qbman-portal.c +++ b/drivers/soc/fsl/dpio/qbman-portal.c @@ -246,7 +246,7 @@ static inline u8 qm_cyc_diff(u8 ringsize, u8 first, u8 last) */ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) { - struct qbman_swp *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct qbman_swp *p = kzalloc_obj(*p, GFP_KERNEL); u32 reg; u32 mask_size; u32 eqcr_pi; diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 6bf3e6a980ff..055d0b61ea1d 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -213,7 +213,7 @@ static int __init fsl_guts_init(void) of_node_put(np); /* Register soc device */ - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index 6cc1847e534a..8993cf2d47b5 100644 --- a/drivers/soc/fsl/qbman/bman.c +++ b/drivers/soc/fsl/qbman/bman.c @@ -700,7 +700,7 @@ struct bman_pool *bman_new_pool(void) if (bm_alloc_bpid_range(&bpid, 1)) return NULL; - pool = kmalloc(sizeof(*pool), GFP_KERNEL); + pool = kmalloc_obj(*pool, GFP_KERNEL); if (!pool) goto err; diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 6b392b3ad4b1..210438ea923e 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1270,7 +1270,7 @@ static int qman_create_portal(struct qman_portal *portal, qm_dqrr_set_ithresh(p, QMAN_PIRQ_DQRR_ITHRESH); qm_mr_set_ithresh(p, QMAN_PIRQ_MR_ITHRESH); qm_out(p, QM_REG_ITPR, QMAN_PIRQ_IPERIOD); - portal->cgrs = kmalloc_array(2, sizeof(*portal->cgrs), GFP_KERNEL); + portal->cgrs = kmalloc_objs(*portal->cgrs, 2, GFP_KERNEL); if (!portal->cgrs) goto fail_cgrs; /* initial snapshot is no-depletion */ diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index c54154b404df..488770405e99 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -161,7 +161,7 @@ struct qe_pin *qe_pin_request(struct device *dev, int index) int gpio_num; int err; - qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL); + qe_pin = kzalloc_obj(*qe_pin, GFP_KERNEL); if (!qe_pin) { dev_dbg(dev, "%s: can't allocate memory\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index 02c29f5f86d3..c77a068f64ff 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe/qe_common.c @@ -118,7 +118,7 @@ static s32 cpm_muram_alloc_common(unsigned long size, struct muram_block *entry; s32 start; - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; start = gen_pool_alloc_algo(muram_pool, size, algo, data); diff --git a/drivers/soc/fsl/qe/ucc_fast.c b/drivers/soc/fsl/qe/ucc_fast.c index 53d8aafc9317..3cb45090fe74 100644 --- a/drivers/soc/fsl/qe/ucc_fast.c +++ b/drivers/soc/fsl/qe/ucc_fast.c @@ -191,7 +191,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc return -EINVAL; } - uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); + uccf = kzalloc_obj(struct ucc_fast_private, GFP_KERNEL); if (!uccf) { printk(KERN_ERR "%s: Cannot allocate private data\n", __func__); diff --git a/drivers/soc/fsl/qe/ucc_slow.c b/drivers/soc/fsl/qe/ucc_slow.c index d5ac1ac0ed3c..335c8629a316 100644 --- a/drivers/soc/fsl/qe/ucc_slow.c +++ b/drivers/soc/fsl/qe/ucc_slow.c @@ -148,7 +148,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc return -EINVAL; } - uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); + uccs = kzalloc_obj(struct ucc_slow_private, GFP_KERNEL); if (!uccs) { printk(KERN_ERR "%s: Cannot allocate private data\n", __func__); diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c index 006fec47ea10..62e3b86fa42d 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -616,8 +616,7 @@ static int hccs_get_all_port_info_on_die(struct hccs_dev *hdev, int ret; u8 i; - attrs = kcalloc(die->port_num, sizeof(struct hccs_port_attr), - GFP_KERNEL); + attrs = kzalloc_objs(struct hccs_port_attr, die->port_num, GFP_KERNEL); if (!attrs) return -ENOMEM; diff --git a/drivers/soc/imx/soc-imx.c b/drivers/soc/imx/soc-imx.c index fab668c83f98..5d39cc3f5e7d 100644 --- a/drivers/soc/imx/soc-imx.c +++ b/drivers/soc/imx/soc-imx.c @@ -40,7 +40,7 @@ static int __init imx_soc_device_init(void) if (!__mxc_cpu_type) return 0; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 67e5879374ac..a0f14aa28106 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -114,7 +114,7 @@ struct cmdq_client *cmdq_mbox_create(struct device *dev, int index) { struct cmdq_client *client; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return (struct cmdq_client *)-ENOMEM; diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c index 30bc45d17d34..4ce94066a5a8 100644 --- a/drivers/soc/microchip/mpfs-sys-controller.c +++ b/drivers/soc/microchip/mpfs-sys-controller.c @@ -132,7 +132,7 @@ static int mpfs_sys_controller_probe(struct platform_device *pdev) struct device_node *np; int i, ret; - sys_controller = kzalloc(sizeof(*sys_controller), GFP_KERNEL); + sys_controller = kzalloc_obj(*sys_controller, GFP_KERNEL); if (!sys_controller) return -ENOMEM; diff --git a/drivers/soc/nuvoton/wpcm450-soc.c b/drivers/soc/nuvoton/wpcm450-soc.c index c5e0d11c383b..dc1242bda713 100644 --- a/drivers/soc/nuvoton/wpcm450-soc.c +++ b/drivers/soc/nuvoton/wpcm450-soc.c @@ -74,7 +74,7 @@ static int __init wpcm450_soc_init(void) return -ENODEV; } - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c index a956c407ce03..2c46a25abb24 100644 --- a/drivers/soc/qcom/apr.c +++ b/drivers/soc/qcom/apr.c @@ -95,7 +95,7 @@ gpr_port_t *gpr_alloc_port(struct apr_device *gdev, struct device *dev, struct pkt_router_svc *svc; int id; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); @@ -171,7 +171,7 @@ static int apr_callback(struct rpmsg_device *rpdev, void *buf, return -EINVAL; } - abuf = kzalloc(struct_size(abuf, buf, len), GFP_ATOMIC); + abuf = kzalloc_flex(*abuf, buf, len, GFP_ATOMIC); if (!abuf) return -ENOMEM; @@ -416,7 +416,7 @@ static int apr_add_device(struct device *dev, struct device_node *np, struct pkt_router_svc *svc; int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return -ENOMEM; diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index 1abfda7a58f2..84ceba84d51a 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -4447,7 +4447,7 @@ struct llcc_slice_desc *llcc_slice_getd(u32 uid) if (count == sz || !cfg) return ERR_PTR(-ENODEV); - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 71130a2f62e9..0a6094e17e66 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -226,7 +226,7 @@ struct ocmem_buf *ocmem_allocate(struct ocmem *ocmem, enum ocmem_client client, if (test_and_set_bit_lock(BIT(client), &ocmem->active_allocations)) return ERR_PTR(-EBUSY); - struct ocmem_buf *buf __free(kfree) = kzalloc(sizeof(*buf), GFP_KERNEL); + struct ocmem_buf *buf __free(kfree) = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto err_unlock; diff --git a/drivers/soc/qcom/pdr_interface.c b/drivers/soc/qcom/pdr_interface.c index 71be378d2e43..cd36f3f0b80f 100644 --- a/drivers/soc/qcom/pdr_interface.c +++ b/drivers/soc/qcom/pdr_interface.c @@ -322,7 +322,7 @@ static void pdr_indication_cb(struct qmi_handle *qmi, ind_msg->service_path, ind_msg->curr_state, ind_msg->transaction_id); - ind = kzalloc(sizeof(*ind), GFP_KERNEL); + ind = kzalloc_obj(*ind, GFP_KERNEL); if (!ind) return; @@ -396,8 +396,8 @@ static int pdr_locate_service(struct pdr_handle *pdr, struct pdr_service *pds) int domains_read = 0; int ret, i; - struct servreg_get_domain_list_resp *resp __free(kfree) = kzalloc(sizeof(*resp), - GFP_KERNEL); + struct servreg_get_domain_list_resp *resp __free(kfree) = kzalloc_obj(*resp, + GFP_KERNEL); if (!resp) return -ENOMEM; @@ -520,7 +520,7 @@ struct pdr_service *pdr_add_lookup(struct pdr_handle *pdr, !service_path || strlen(service_path) > SERVREG_NAME_LENGTH) return ERR_PTR(-EINVAL); - struct pdr_service *pds __free(kfree) = kzalloc(sizeof(*pds), GFP_KERNEL); + struct pdr_service *pds __free(kfree) = kzalloc_obj(*pds, GFP_KERNEL); if (!pds) return ERR_PTR(-ENOMEM); @@ -645,7 +645,7 @@ struct pdr_handle *pdr_handle_alloc(void (*status)(int state, if (!status) return ERR_PTR(-EINVAL); - struct pdr_handle *pdr __free(kfree) = kzalloc(sizeof(*pdr), GFP_KERNEL); + struct pdr_handle *pdr __free(kfree) = kzalloc_obj(*pdr, GFP_KERNEL); if (!pdr) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c index 1bcbe69688d2..cb92c214311b 100644 --- a/drivers/soc/qcom/qcom_pd_mapper.c +++ b/drivers/soc/qcom/qcom_pd_mapper.c @@ -77,7 +77,7 @@ static int qcom_pdm_add_service_domain(struct qcom_pdm_data *data, return -EBUSY; } } else { - service = kzalloc(sizeof(*service), GFP_KERNEL); + service = kzalloc_obj(*service, GFP_KERNEL); if (!service) return -ENOMEM; @@ -87,7 +87,7 @@ static int qcom_pdm_add_service_domain(struct qcom_pdm_data *data, list_add_tail(&service->list, &data->services); } - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) { if (list_empty(&service->domains)) { list_del(&service->list); @@ -158,7 +158,7 @@ static void qcom_pdm_get_domain_list(struct qmi_handle *qmi, u32 offset; int ret; - rsp = kzalloc(sizeof(*rsp), GFP_KERNEL); + rsp = kzalloc_obj(*rsp, GFP_KERNEL); if (!rsp) return; @@ -635,7 +635,7 @@ static struct qcom_pdm_data *qcom_pdm_start(void) return ERR_PTR(-ENODEV); } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c index 6500f863aae5..59a11fa572a7 100644 --- a/drivers/soc/qcom/qmi_interface.c +++ b/drivers/soc/qcom/qmi_interface.c @@ -44,7 +44,7 @@ static void qmi_recv_new_server(struct qmi_handle *qmi, if (!node && !port) return; - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) return; @@ -209,7 +209,7 @@ int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, { struct qmi_service *svc; - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) return -ENOMEM; @@ -273,7 +273,7 @@ int qmi_add_server(struct qmi_handle *qmi, unsigned int service, { struct qmi_service *svc; - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) return -ENOMEM; diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c index 1b32469f2789..cec7912f74dd 100644 --- a/drivers/soc/qcom/rmtfs_mem.c +++ b/drivers/soc/qcom/rmtfs_mem.c @@ -192,7 +192,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev) } - rmtfs_mem = kzalloc(sizeof(*rmtfs_mem), GFP_KERNEL); + rmtfs_mem = kzalloc_obj(*rmtfs_mem, GFP_KERNEL); if (!rmtfs_mem) return -ENOMEM; diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 8903ed956312..ca37da3dc2b1 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -121,7 +121,7 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, if (req) goto existing; - req = kzalloc(sizeof(*req), GFP_ATOMIC); + req = kzalloc_obj(*req, GFP_ATOMIC); if (!req) { req = ERR_PTR(-ENOMEM); goto unlock; @@ -225,7 +225,7 @@ int rpmh_write_async(const struct device *dev, enum rpmh_state state, struct rpmh_request *rpm_msg; int ret; - rpm_msg = kzalloc(sizeof(*rpm_msg), GFP_ATOMIC); + rpm_msg = kzalloc_obj(*rpm_msg, GFP_ATOMIC); if (!rpm_msg) return -ENOMEM; rpm_msg->needs_free = true; diff --git a/drivers/soc/qcom/smem_state.c b/drivers/soc/qcom/smem_state.c index cc5be8019b6a..3d9bc96dfd2d 100644 --- a/drivers/soc/qcom/smem_state.c +++ b/drivers/soc/qcom/smem_state.c @@ -197,7 +197,7 @@ struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, { struct qcom_smem_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c index ee4f17bb4db4..d170743d576a 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -487,7 +487,7 @@ static int __init renesas_soc_init(void) chipid = ioremap(family->reg, 4); } - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) { if (chipid) iounmap(chipid); diff --git a/drivers/soc/renesas/rz-sysc.c b/drivers/soc/renesas/rz-sysc.c index ae727d9c8cc5..a3982a8dfba8 100644 --- a/drivers/soc/renesas/rz-sysc.c +++ b/drivers/soc/renesas/rz-sysc.c @@ -110,7 +110,8 @@ static int rz_sysc_probe(struct platform_device *pdev) struct rz_sysc *sysc; int ret; - struct regmap_config *regmap_cfg __free(kfree) = kzalloc(sizeof(*regmap_cfg), GFP_KERNEL); + struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg, + GFP_KERNEL); if (!regmap_cfg) return -ENOMEM; diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index 74d2fedea71c..165fad4f548e 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -441,7 +441,7 @@ struct device *tegra_soc_device_register(void) struct soc_device_attribute *attr; struct soc_device *dev; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return NULL; diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 9cdbd8ba94be..8f2f83c4ad90 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -1131,11 +1131,11 @@ int tegra_pmc_powergate_sequence_power_up(struct tegra_pmc *pmc, if (!tegra_powergate_is_available(pmc, id)) return -EINVAL; - pg = kzalloc(sizeof(*pg), GFP_KERNEL); + pg = kzalloc_obj(*pg, GFP_KERNEL); if (!pg) return -ENOMEM; - pg->clk_rates = kzalloc(sizeof(*pg->clk_rates), GFP_KERNEL); + pg->clk_rates = kzalloc_obj(*pg->clk_rates, GFP_KERNEL); if (!pg->clk_rates) { kfree(pg->clks); return -ENOMEM; @@ -1341,7 +1341,7 @@ static int tegra_powergate_of_get_clks(struct tegra_powergate *pg, if (count == 0) return -ENODEV; - pg->clks = kcalloc(count, sizeof(clk), GFP_KERNEL); + pg->clks = kzalloc_objs(clk, count, GFP_KERNEL); if (!pg->clks) return -ENOMEM; @@ -1402,7 +1402,7 @@ static int tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) int id, err = 0; bool off; - pg = kzalloc(sizeof(*pg), GFP_KERNEL); + pg = kzalloc_obj(*pg, GFP_KERNEL); if (!pg) return -ENOMEM; diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 42275cb5ba1c..8655f829dc7b 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -163,7 +163,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev) partno_id = (jtag_id & CTRLMMR_WKUP_JTAGID_PARTNO_MASK) >> CTRLMMR_WKUP_JTAGID_PARTNO_SHIFT; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c index 27d6e25a0115..eb26a601643a 100644 --- a/drivers/soc/ux500/ux500-soc-id.c +++ b/drivers/soc/ux500/ux500-soc-id.c @@ -205,7 +205,7 @@ static int __init ux500_soc_device_init(void) ux500_setup_id(); - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) { of_node_put(backupram); return -ENOMEM; diff --git a/drivers/soc/versatile/soc-integrator.c b/drivers/soc/versatile/soc-integrator.c index d5099a3386b4..45110efcd4a1 100644 --- a/drivers/soc/versatile/soc-integrator.c +++ b/drivers/soc/versatile/soc-integrator.c @@ -123,7 +123,7 @@ static int __init integrator_soc_init(void) return -ENODEV; integrator_coreid = val; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index 6fdf4d14b7e7..6a45b1b53caf 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -122,7 +122,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons if (!present_in_hash) { /* Add new entry if not present in HASH table */ - eve_data = kmalloc(sizeof(*eve_data), GFP_KERNEL); + eve_data = kmalloc_obj(*eve_data, GFP_KERNEL); if (!eve_data) return -ENOMEM; eve_data->key = key; @@ -130,7 +130,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons eve_data->wake = wake; INIT_LIST_HEAD(&eve_data->cb_list_head); - cb_data = kmalloc(sizeof(*cb_data), GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); if (!cb_data) { kfree(eve_data); return -ENOMEM; @@ -153,7 +153,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons } /* Add multiple handler and private data in list */ - cb_data = kmalloc(sizeof(*cb_data), GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); if (!cb_data) return -ENOMEM; cb_data->eve_cb = cb_fun; @@ -179,7 +179,7 @@ static int xlnx_add_cb_for_suspend(event_cb_func_t cb_fun, void *data) } /* Add new entry if not present */ - eve_data = kmalloc(sizeof(*eve_data), GFP_KERNEL); + eve_data = kmalloc_obj(*eve_data, GFP_KERNEL); if (!eve_data) return -ENOMEM; @@ -187,7 +187,7 @@ static int xlnx_add_cb_for_suspend(event_cb_func_t cb_fun, void *data) eve_data->cb_type = PM_INIT_SUSPEND_CB; INIT_LIST_HEAD(&eve_data->cb_list_head); - cb_data = kmalloc(sizeof(*cb_data), GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); if (!cb_data) { kfree(eve_data); return -ENOMEM; diff --git a/drivers/soundwire/amd_init.c b/drivers/soundwire/amd_init.c index 643e94524fe6..e71cc23523e1 100644 --- a/drivers/soundwire/amd_init.c +++ b/drivers/soundwire/amd_init.c @@ -98,14 +98,14 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res) * the parent .probe. * If devm_ was used, the memory might never be freed on errors. */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; ctx->count = count; ctx->link_mask = res->link_mask; - struct resource *sdw_res __free(kfree) = kzalloc(sizeof(*sdw_res), - GFP_KERNEL); + struct resource *sdw_res __free(kfree) = kzalloc_obj(*sdw_res, + GFP_KERNEL); if (!sdw_res) { kfree(ctx); return NULL; @@ -205,8 +205,8 @@ int sdw_amd_get_slave_info(struct sdw_amd_ctx *ctx) num_slaves++; } - ctx->peripherals = kmalloc(struct_size(ctx->peripherals, array, num_slaves), - GFP_KERNEL); + ctx->peripherals = kmalloc_flex(*ctx->peripherals, array, num_slaves, + GFP_KERNEL); if (!ctx->peripherals) return -ENOMEM; ctx->peripherals->num_peripherals = num_slaves; diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 5fd311ee4107..91dee9499df2 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -718,8 +718,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream, sconfig.bps = snd_pcm_format_width(params_format(params)); /* Port configuration */ - struct sdw_port_config *pconfig __free(kfree) = kzalloc(sizeof(*pconfig), - GFP_KERNEL); + struct sdw_port_config *pconfig __free(kfree) = kzalloc_obj(*pconfig, + GFP_KERNEL); if (!pconfig) return -ENOMEM; @@ -764,7 +764,7 @@ static int amd_set_sdw_stream(struct snd_soc_dai *dai, void *stream, int directi } /* allocate and set dai_runtime info */ - dai_runtime = kzalloc(sizeof(*dai_runtime), GFP_KERNEL); + dai_runtime = kzalloc_obj(*dai_runtime, GFP_KERNEL); if (!dai_runtime) return -ENOMEM; diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index a106e5e482c8..dfdb591c6f6e 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -1846,7 +1846,7 @@ int cdns_set_sdw_stream(struct snd_soc_dai *dai, } /* allocate and set dai_runtime info */ - dai_runtime = kzalloc(sizeof(*dai_runtime), GFP_KERNEL); + dai_runtime = kzalloc_obj(*dai_runtime, GFP_KERNEL); if (!dai_runtime) return -ENOMEM; diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c index 6068011dd0d9..0e9c48ca76e9 100644 --- a/drivers/soundwire/debugfs.c +++ b/drivers/soundwire/debugfs.c @@ -224,7 +224,7 @@ static int do_bpt_sequence(struct sdw_slave *slave, bool write, u8 *buffer) struct sdw_bpt_msg msg = {0}; struct sdw_bpt_section *sec; - sec = kcalloc(1, sizeof(*sec), GFP_KERNEL); + sec = kzalloc_objs(*sec, 1, GFP_KERNEL); if (!sec) return -ENOMEM; msg.sections = 1; diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c index 530ac66ac6fa..f5a7f404aacb 100644 --- a/drivers/soundwire/generic_bandwidth_allocation.c +++ b/drivers/soundwire/generic_bandwidth_allocation.c @@ -402,7 +402,7 @@ static int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtim if (group.count == 0) goto out; - params = kcalloc(group.count, sizeof(*params), GFP_KERNEL); + params = kzalloc_objs(*params, group.count, GFP_KERNEL); if (!params) { ret = -ENOMEM; goto out; diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 9db78f3d7615..5b4d84ceecff 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -769,8 +769,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream, sconfig.bps = snd_pcm_format_width(params_format(params)); /* Port configuration */ - struct sdw_port_config *pconfig __free(kfree) = kzalloc(sizeof(*pconfig), - GFP_KERNEL); + struct sdw_port_config *pconfig __free(kfree) = kzalloc_obj(*pconfig, + GFP_KERNEL); if (!pconfig) return -ENOMEM; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 1ed0251d2592..8a37d185cbca 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -127,7 +127,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave * sconfig.bps = 32; /* this is required for BPT/BRA */ /* Port configuration */ - pconfig = kcalloc(2, sizeof(*pconfig), GFP_KERNEL); + pconfig = kzalloc_objs(*pconfig, 2, GFP_KERNEL); if (!pconfig) { ret = -ENOMEM; goto remove_slave; @@ -747,8 +747,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream, sconfig.bps = snd_pcm_format_width(params_format(params)); /* Port configuration */ - struct sdw_port_config *pconfig __free(kfree) = kzalloc(sizeof(*pconfig), - GFP_KERNEL); + struct sdw_port_config *pconfig __free(kfree) = kzalloc_obj(*pconfig, + GFP_KERNEL); if (!pconfig) return -ENOMEM; diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c index 4ffdabaf9693..982d25f92c7c 100644 --- a/drivers/soundwire/intel_init.c +++ b/drivers/soundwire/intel_init.c @@ -40,7 +40,7 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res * struct auxiliary_device *auxdev; int ret; - ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); + ldev = kzalloc_obj(*ldev, GFP_KERNEL); if (!ldev) return ERR_PTR(-ENOMEM); @@ -186,7 +186,7 @@ static struct sdw_intel_ctx * the parent .probe. * If devm_ was used, the memory might never be freed on errors. */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -198,7 +198,7 @@ static struct sdw_intel_ctx * If some links are disabled, the link pointer will remain NULL. Given that the * number of links is small, this is simpler than using a list to keep track of links. */ - ctx->ldev = kcalloc(ctx->count, sizeof(*ctx->ldev), GFP_KERNEL); + ctx->ldev = kzalloc_objs(*ctx->ldev, ctx->count, GFP_KERNEL); if (!ctx->ldev) { kfree(ctx); return NULL; @@ -253,8 +253,8 @@ static struct sdw_intel_ctx num_slaves++; } - ctx->peripherals = kmalloc(struct_size(ctx->peripherals, array, num_slaves), - GFP_KERNEL); + ctx->peripherals = kmalloc_flex(*ctx->peripherals, array, num_slaves, + GFP_KERNEL); if (!ctx->peripherals) goto err; ctx->peripherals->num_peripherals = num_slaves; diff --git a/drivers/soundwire/master.c b/drivers/soundwire/master.c index b2c64512739d..a0f94877bc91 100644 --- a/drivers/soundwire/master.c +++ b/drivers/soundwire/master.c @@ -133,7 +133,7 @@ int sdw_master_device_add(struct sdw_bus *bus, struct device *parent, if (!parent) return -EINVAL; - md = kzalloc(sizeof(*md), GFP_KERNEL); + md = kzalloc_obj(*md, GFP_KERNEL); if (!md) return -ENOMEM; diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 8102a1b0d516..a85b9ecf1a05 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1230,8 +1230,9 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, unsigned long *port_mask; int maxport, pn, nports = 0; unsigned int m_port; - struct sdw_port_config *pconfig __free(kfree) = kcalloc(ctrl->nports, - sizeof(*pconfig), GFP_KERNEL); + struct sdw_port_config *pconfig __free(kfree) = kzalloc_objs(*pconfig, + ctrl->nports, + GFP_KERNEL); if (!pconfig) return -ENOMEM; diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index d933cebad52b..45e80b9496f4 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -32,7 +32,7 @@ int sdw_slave_add(struct sdw_bus *bus, int ret; int i; - slave = kzalloc(sizeof(*slave), GFP_KERNEL); + slave = kzalloc_obj(*slave, GFP_KERNEL); if (!slave) return -ENOMEM; diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 38c9dbd35606..c6e3f911371b 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -748,11 +748,11 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) int ret; u16 addr; - wr_msg = kzalloc(sizeof(*wr_msg), GFP_KERNEL); + wr_msg = kzalloc_obj(*wr_msg, GFP_KERNEL); if (!wr_msg) return -ENOMEM; - wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL); + wbuf = kzalloc_obj(*wbuf, GFP_KERNEL); if (!wbuf) { ret = -ENOMEM; goto error_1; @@ -956,7 +956,7 @@ static struct sdw_port_runtime *sdw_port_alloc(struct list_head *port_list) { struct sdw_port_runtime *p_rt; - p_rt = kzalloc(sizeof(*p_rt), GFP_KERNEL); + p_rt = kzalloc_obj(*p_rt, GFP_KERNEL); if (!p_rt) return NULL; @@ -1131,7 +1131,7 @@ static struct sdw_slave_runtime { struct sdw_slave_runtime *s_rt; - s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL); + s_rt = kzalloc_obj(*s_rt, GFP_KERNEL); if (!s_rt) return NULL; @@ -1241,7 +1241,7 @@ static struct sdw_master_runtime } } - m_rt = kzalloc(sizeof(*m_rt), GFP_KERNEL); + m_rt = kzalloc_obj(*m_rt, GFP_KERNEL); if (!m_rt) return NULL; @@ -1875,7 +1875,7 @@ struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name, enum sdw_st { struct sdw_stream_runtime *stream; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return NULL; diff --git a/drivers/spi/spi-amlogic-spifc-a4.c b/drivers/spi/spi-amlogic-spifc-a4.c index 35a7c4965e11..786d66304c3d 100644 --- a/drivers/spi/spi-amlogic-spifc-a4.c +++ b/drivers/spi/spi-amlogic-spifc-a4.c @@ -986,7 +986,7 @@ static int aml_sfc_ecc_init_ctx(struct nand_device *nand) nand->ecc.ctx.conf.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; - ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c index bbe97ce89a2f..40890068d840 100644 --- a/drivers/spi/spi-at91-usart.c +++ b/drivers/spi/spi-at91-usart.c @@ -364,7 +364,7 @@ static int at91_usart_spi_setup(struct spi_device *spi) mr &= ~US_MR_LOOP; if (!ausd) { - ausd = kzalloc(sizeof(*ausd), GFP_KERNEL); + ausd = kzalloc_obj(*ausd, GFP_KERNEL); if (!ausd) return -ENOMEM; diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index d71c0dbf1f38..ff4bf4e6bdb5 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1300,7 +1300,7 @@ static int atmel_spi_setup(struct spi_device *spi) asd = spi->controller_state; if (!asd) { - asd = kzalloc(sizeof(struct atmel_spi_device), GFP_KERNEL); + asd = kzalloc_obj(struct atmel_spi_device, GFP_KERNEL); if (!asd) return -ENOMEM; diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c index c75e8da049f7..b22c53c3e5b7 100644 --- a/drivers/spi/spi-axi-spi-engine.c +++ b/drivers/spi/spi-axi-spi-engine.c @@ -815,7 +815,7 @@ static int spi_engine_optimize_message(struct spi_message *msg) p_dry.length = 0; spi_engine_compile_message(msg, true, &p_dry); - p = kzalloc(struct_size(p, instructions, p_dry.length + 1), GFP_KERNEL); + p = kzalloc_flex(*p, instructions, p_dry.length + 1, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 9c06ac562f3e..123d9d4fb08d 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -712,7 +712,7 @@ static int bcm_qspi_setup(struct spi_device *spi) xp = spi_get_ctldata(spi); if (!xp) { - xp = kzalloc(sizeof(*xp), GFP_KERNEL); + xp = kzalloc_obj(*xp, GFP_KERNEL); if (!xp) return -ENOMEM; spi_set_ctldata(spi, xp); @@ -1565,8 +1565,8 @@ int bcm_qspi_probe(struct platform_device *pdev, return PTR_ERR(qspi->base[CHIP_SELECT]); } - qspi->dev_ids = kcalloc(num_irqs, sizeof(struct bcm_qspi_dev_id), - GFP_KERNEL); + qspi->dev_ids = kzalloc_objs(struct bcm_qspi_dev_id, num_irqs, + GFP_KERNEL); if (!qspi->dev_ids) return -ENOMEM; diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 35ae50ca37ac..170118023b2f 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1313,7 +1313,7 @@ static int bcm2835_spi_setup(struct spi_device *spi) * More on the problem that it addresses: * https://www.spinics.net/lists/linux-gpio/msg36218.html */ - lookup = kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); + lookup = kzalloc_flex(*lookup, table, 2, GFP_KERNEL); if (!lookup) { ret = -ENOMEM; goto err_cleanup; diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index ebe18f0b5d23..d9cfb6e18a4c 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -193,7 +193,7 @@ int spi_bitbang_setup(struct spi_device *spi) bitbang = spi_controller_get_devdata(spi->controller); if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index d680142a059f..62171cc0d84d 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -443,7 +443,7 @@ static int davinci_spi_of_setup(struct spi_device *spi) u32 prop; if (spicfg == NULL && np) { - spicfg = kzalloc(sizeof(*spicfg), GFP_KERNEL); + spicfg = kzalloc_obj(*spicfg, GFP_KERNEL); if (!spicfg) return -ENOMEM; *spicfg = davinci_spi_default_cfg; diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 0d59c141beb0..d2aa199bab9d 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -797,7 +797,7 @@ static int dw_spi_setup(struct spi_device *spi) struct dw_spi *dws = spi_controller_get_devdata(spi->controller); u32 rx_sample_dly_ns; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; spi_set_ctldata(spi, chip); diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 76f142a54254..031d6785ecc4 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1290,7 +1290,7 @@ static int dspi_setup(struct spi_device *spi) /* Only alloc on first setup */ chip = spi_get_ctldata(spi); if (chip == NULL) { - chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); + chip = kzalloc_obj(struct chip_data, GFP_KERNEL); if (!chip) return -ENOMEM; } diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index b06555a457f8..f46f5c3cc992 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -482,7 +482,7 @@ static int fsl_espi_setup(struct spi_device *spi) struct fsl_espi_cs *cs = spi_get_ctldata(spi); if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; spi_set_ctldata(spi, cs); diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 481a7b28aacd..e2f15998495f 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -378,7 +378,7 @@ static int fsl_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; spi_set_ctldata(spi, cs); diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index f123cdab9007..798ba06b86bc 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -426,7 +426,7 @@ static int hisi_spi_setup(struct spi_device *spi) /* Only alloc on first setup */ chip = spi_get_ctldata(spi); if (!chip) { - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; spi_set_ctldata(spi, chip); diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index f65c0bf11a73..64c6c09e1e7b 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1666,9 +1666,9 @@ static int spi_imx_dma_data_prepare(struct spi_imx_data *spi_imx, tail_bl = (transfer->len % MX51_ECSPI_CTRL_MAX_BURST) * BITS_PER_BYTE - 1; } - spi_imx->dma_data = kmalloc_array(spi_imx->dma_package_num, - sizeof(struct dma_data_package), - GFP_KERNEL | __GFP_ZERO); + spi_imx->dma_data = kmalloc_objs(struct dma_data_package, + spi_imx->dma_package_num, + GFP_KERNEL | __GFP_ZERO); if (!spi_imx->dma_data) { dev_err(spi_imx->dev, "Failed to allocate DMA package buffer!\n"); return -ENOMEM; diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 965673bac98b..abb380d2791b 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -713,7 +713,7 @@ spi_mem_dirmap_create(struct spi_mem *mem, if (info->op_tmpl.data.dir == SPI_MEM_NO_DATA) return ERR_PTR(-EINVAL); - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index a1aeb5403a74..e8383a79cb2e 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -362,7 +362,7 @@ static int mpc512x_psc_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 73d2383461ca..03ee5f370382 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -222,7 +222,7 @@ static int mpc52xx_psc_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c index 14188a6ba5a1..ea5c15191f23 100644 --- a/drivers/spi/spi-mpc52xx.c +++ b/drivers/spi/spi-mpc52xx.c @@ -443,9 +443,8 @@ static int mpc52xx_spi_probe(struct platform_device *op) ms->gpio_cs_count = gpiod_count(&op->dev, NULL); if (ms->gpio_cs_count > 0) { host->num_chipselect = ms->gpio_cs_count; - ms->gpio_cs = kmalloc_array(ms->gpio_cs_count, - sizeof(*ms->gpio_cs), - GFP_KERNEL); + ms->gpio_cs = kmalloc_objs(*ms->gpio_cs, ms->gpio_cs_count, + GFP_KERNEL); if (!ms->gpio_cs) { rc = -ENOMEM; goto err_alloc_gpio; diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c index 7f7d0dfec743..833f8f8901bf 100644 --- a/drivers/spi/spi-mtk-snfi.c +++ b/drivers/spi/spi-mtk-snfi.c @@ -675,7 +675,7 @@ static int mtk_snand_ecc_init_ctx(struct nand_device *nand) if (ret) return ret; - ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 0ebcbdb1b1f7..35e4300deff5 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -182,7 +182,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, if (!len) return -EINVAL; - dma_xfer = kcalloc(sgs, sizeof(*dma_xfer), GFP_KERNEL); + dma_xfer = kzalloc_objs(*dma_xfer, sgs, GFP_KERNEL); if (!dma_xfer) return -ENOMEM; diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c index d336f4d228d5..de6de1517554 100644 --- a/drivers/spi/spi-offload.c +++ b/drivers/spi/spi-offload.c @@ -117,7 +117,7 @@ struct spi_offload *devm_spi_offload_get(struct device *dev, if (!spi->controller->get_offload) return ERR_PTR(-ENODEV); - resource = kzalloc(sizeof(*resource), GFP_KERNEL); + resource = kzalloc_obj(*resource, GFP_KERNEL); if (!resource) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index b9a91dbfeaef..367a36a1fdc5 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -425,7 +425,7 @@ static int uwire_setup(struct spi_device *spi) int status; if (ust == NULL) { - ust = kzalloc(sizeof(*ust), GFP_KERNEL); + ust = kzalloc_obj(*ust, GFP_KERNEL); if (ust == NULL) return -ENOMEM; spi->controller_state = ust; diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 69c2e9d9be3c..11eca0572733 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1076,7 +1076,7 @@ static int omap2_mcspi_setup(struct spi_device *spi) struct omap2_mcspi_cs *cs = spi->controller_state; if (!cs) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; cs->base = mcspi->base + spi_get_chipselect(spi, 0) * 0x14; diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index fa0c1ee84532..f663ea5983d0 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -467,7 +467,7 @@ static int ring_desc_ring_alloc(struct pic32_sqi *sqi) } /* allocate software ring descriptors */ - sqi->ring = kcalloc(PESQI_BD_COUNT, sizeof(*rdesc), GFP_KERNEL); + sqi->ring = kzalloc_objs(*rdesc, PESQI_BD_COUNT, GFP_KERNEL); if (!sqi->ring) { dma_free_coherent(&sqi->host->dev, sizeof(*bd) * PESQI_BD_COUNT, diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index c32a1fba31ef..87f9d41f0236 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -1606,7 +1606,7 @@ static int pl022_setup(struct spi_device *spi) chip = spi_get_ctldata(spi); if (chip == NULL) { - chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); + chip = kzalloc_obj(struct chip_data, GFP_KERNEL); if (!chip) return -ENOMEM; dev_dbg(&spi->dev, diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c index 688cabcfbc52..c4ebef57c991 100644 --- a/drivers/spi/spi-ppc4xx.c +++ b/drivers/spi/spi-ppc4xx.c @@ -218,7 +218,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi) } if (cs == NULL) { - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 78c399e95ef2..b0424ee64b75 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1184,7 +1184,7 @@ static int setup(struct spi_device *spi) /* Only allocate on the first setup */ chip = spi_get_ctldata(spi); if (!chip) { - chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); + chip = kzalloc_obj(struct chip_data, GFP_KERNEL); if (!chip) return -ENOMEM; } diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c index d7fef48f20ef..eae0edb47652 100644 --- a/drivers/spi/spi-qpic-snand.c +++ b/drivers/spi/spi-qpic-snand.c @@ -258,7 +258,7 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand) cwperpage = mtd->writesize / NANDC_STEP_SIZE; snandc->qspi->num_cw = cwperpage; - ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 4fbefd85d2e2..2591f1d11a9d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -961,7 +961,7 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_target_ctrldata( return ERR_PTR(-EINVAL); } - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index d805da250a10..6983a4567c45 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -920,7 +920,7 @@ static struct tegra_spi_client_data return NULL; } - cdata = kzalloc(sizeof(*cdata), GFP_KERNEL); + cdata = kzalloc_obj(*cdata, GFP_KERNEL); if (!cdata) return NULL; diff --git a/drivers/spi/spi-tle62x0.c b/drivers/spi/spi-tle62x0.c index 663c0136d119..0ef65cc689bd 100644 --- a/drivers/spi/spi-tle62x0.c +++ b/drivers/spi/spi-tle62x0.c @@ -249,7 +249,7 @@ static int tle62x0_probe(struct spi_device *spi) return -EINVAL; } - st = kzalloc(sizeof(struct tle62x0_state), GFP_KERNEL); + st = kzalloc_obj(struct tle62x0_state, GFP_KERNEL); if (st == NULL) return -ENOMEM; diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 60fce5c73031..72316aa1aab9 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -982,7 +982,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) spin_unlock_irqrestore(&data->lock, flags); /* RX */ - dma->sg_rx_p = kmalloc_array(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); + dma->sg_rx_p = kmalloc_objs(*dma->sg_rx_p, num, GFP_ATOMIC); if (!dma->sg_rx_p) return; @@ -1045,7 +1045,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) head = 0; } - dma->sg_tx_p = kmalloc_array(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); + dma->sg_tx_p = kmalloc_objs(*dma->sg_tx_p, num, GFP_ATOMIC); if (!dma->sg_tx_p) return; @@ -1527,11 +1527,11 @@ static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id) int i; struct pch_pd_dev_save *pd_dev_save; - pd_dev_save = kzalloc(sizeof(*pd_dev_save), GFP_KERNEL); + pd_dev_save = kzalloc_obj(*pd_dev_save, GFP_KERNEL); if (!pd_dev_save) return -ENOMEM; - board_dat = kzalloc(sizeof(*board_dat), GFP_KERNEL); + board_dat = kzalloc_obj(*board_dat, GFP_KERNEL); if (!board_dat) { retval = -ENOMEM; goto err_no_mem; diff --git a/drivers/spi/spi-virtio.c b/drivers/spi/spi-virtio.c index 9e66c917fb75..9efadfb7a74f 100644 --- a/drivers/spi/spi-virtio.c +++ b/drivers/spi/spi-virtio.c @@ -158,8 +158,8 @@ static int virtio_spi_transfer_one(struct spi_controller *ctrl, unsigned int incnt = 0; int ret; - struct virtio_spi_req *spi_req __free(kfree) = kzalloc(sizeof(*spi_req), - GFP_KERNEL); + struct virtio_spi_req *spi_req __free(kfree) = kzalloc_obj(*spi_req, + GFP_KERNEL); if (!spi_req) return -ENOMEM; diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 3887fcf8ec86..bd80a8bc8139 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -568,7 +568,7 @@ struct spi_device *spi_alloc_device(struct spi_controller *ctlr) if (!spi_controller_get(ctlr)) return NULL; - spi = kzalloc(sizeof(*spi), GFP_KERNEL); + spi = kzalloc_obj(*spi, GFP_KERNEL); if (!spi) { spi_controller_put(ctlr); return NULL; @@ -921,7 +921,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) if (!n) return 0; - bi = kcalloc(n, sizeof(*bi), GFP_KERNEL); + bi = kzalloc_objs(*bi, n, GFP_KERNEL); if (!bi) return -ENOMEM; diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index f28528ed1c24..840347f404b9 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -214,7 +214,7 @@ static int spidev_message(struct spidev_data *spidev, int status = -EFAULT; spi_message_init(&msg); - k_xfers = kcalloc(n_xfers, sizeof(*k_tmp), GFP_KERNEL); + k_xfers = kzalloc_objs(*k_tmp, n_xfers, GFP_KERNEL); if (k_xfers == NULL) return -ENOMEM; @@ -777,7 +777,7 @@ static int spidev_probe(struct spi_device *spi) } /* Allocate driver data */ - spidev = kzalloc(sizeof(*spidev), GFP_KERNEL); + spidev = kzalloc_obj(*spidev, GFP_KERNEL); if (!spidev) return -ENOMEM; diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c index 3cf8d9bd4566..29de3055443d 100644 --- a/drivers/spmi/spmi.c +++ b/drivers/spmi/spmi.c @@ -418,7 +418,7 @@ struct spmi_device *spmi_device_alloc(struct spmi_controller *ctrl) { struct spmi_device *sdev; - sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kzalloc_obj(*sdev, GFP_KERNEL); if (!sdev) return NULL; diff --git a/drivers/ssb/bridge_pcmcia_80211.c b/drivers/ssb/bridge_pcmcia_80211.c index ffa379efff83..6e958e403dbe 100644 --- a/drivers/ssb/bridge_pcmcia_80211.c +++ b/drivers/ssb/bridge_pcmcia_80211.c @@ -31,7 +31,7 @@ static int ssb_host_pcmcia_probe(struct pcmcia_device *dev) int err = -ENOMEM; int res = 0; - ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); + ssb = kzalloc_obj(*ssb, GFP_KERNEL); if (!ssb) goto out_error; diff --git a/drivers/ssb/driver_gige.c b/drivers/ssb/driver_gige.c index ebee6b0e3c34..fc2bf4ceedee 100644 --- a/drivers/ssb/driver_gige.c +++ b/drivers/ssb/driver_gige.c @@ -173,7 +173,7 @@ static int ssb_gige_probe(struct ssb_device *sdev, struct ssb_gige *dev; u32 base, tmslow, tmshigh; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; dev->dev = sdev; diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index aa6165e3db4a..bb52e5197b1f 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c @@ -481,7 +481,7 @@ static int ssb_devices_register(struct ssb_bus *bus) continue; } - devwrap = kzalloc(sizeof(*devwrap), GFP_KERNEL); + devwrap = kzalloc_obj(*devwrap, GFP_KERNEL); if (!devwrap) { err = -ENOMEM; goto error; diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c index dd70fd41c77d..36011a93f5af 100644 --- a/drivers/ssb/pcihost_wrapper.c +++ b/drivers/ssb/pcihost_wrapper.c @@ -71,7 +71,7 @@ static int ssb_pcihost_probe(struct pci_dev *dev, int err = -ENOMEM; u32 val; - ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); + ssb = kzalloc_obj(*ssb, GFP_KERNEL); if (!ssb) goto out; err = pci_enable_device(dev); diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 207d578547cd..af2dbebefc72 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -283,8 +283,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) int ret = 0; /* buffer to convert RGB565 -> grayscale16 -> Dithered image 1bpp */ - signed short *convert_buf = kmalloc_array(par->info->var.xres * - par->info->var.yres, sizeof(signed short), GFP_NOIO); + signed short *convert_buf = kmalloc_objs(signed short, + par->info->var.xres * par->info->var.yres, + GFP_NOIO); if (!convert_buf) return -ENOMEM; diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c index 4a4dfb42f50f..e87b82ca6d8a 100644 --- a/drivers/staging/greybus/audio_manager_module.c +++ b/drivers/staging/greybus/audio_manager_module.c @@ -188,7 +188,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module, int err; struct gb_audio_manager_module *m; - m = kzalloc(sizeof(*m), GFP_ATOMIC); + m = kzalloc_obj(*m, GFP_ATOMIC); if (!m) return -ENOMEM; diff --git a/drivers/staging/greybus/authentication.c b/drivers/staging/greybus/authentication.c index d53e58f92e81..e52e3f043572 100644 --- a/drivers/staging/greybus/authentication.c +++ b/drivers/staging/greybus/authentication.c @@ -306,7 +306,7 @@ int gb_cap_connection_init(struct gb_connection *connection) if (!connection) return 0; - cap = kzalloc(sizeof(*cap), GFP_KERNEL); + cap = kzalloc_obj(*cap, GFP_KERNEL); if (!cap) return -ENOMEM; diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index d4d86b3898de..bad4091e2433 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -424,7 +424,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_BOOTROM) return -ENODEV; - bootrom = kzalloc(sizeof(*bootrom), GFP_KERNEL); + bootrom = kzalloc_obj(*bootrom, GFP_KERNEL); if (!bootrom) return -ENOMEM; diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 5ac19c0055d9..8ad3785ff467 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -791,7 +791,7 @@ static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams, if (gb_nstreams > GB_CAMERA_MAX_STREAMS) return -EINVAL; - gb_streams = kcalloc(gb_nstreams, sizeof(*gb_streams), GFP_KERNEL); + gb_streams = kzalloc_objs(*gb_streams, gb_nstreams, GFP_KERNEL); if (!gb_streams) return -ENOMEM; @@ -932,7 +932,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, return ret; /* For each stream to configure parse width, height and format */ - streams = kcalloc(nstreams, sizeof(*streams), GFP_KERNEL); + streams = kzalloc_objs(*streams, nstreams, GFP_KERNEL); if (!streams) return -ENOMEM; @@ -1244,7 +1244,7 @@ static int gb_camera_probe(struct gb_bundle *bundle, if (!mgmt_cport_id || !data_cport_id) return -ENODEV; - gcam = kzalloc(sizeof(*gcam), GFP_KERNEL); + gcam = kzalloc_obj(*gcam, GFP_KERNEL); if (!gcam) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c index 0fb15a60412f..8a437361302c 100644 --- a/drivers/staging/greybus/fw-core.c +++ b/drivers/staging/greybus/fw-core.c @@ -68,7 +68,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle, u16 cport_id; u8 protocol_id; - fw_core = kzalloc(sizeof(*fw_core), GFP_KERNEL); + fw_core = kzalloc_obj(*fw_core, GFP_KERNEL); if (!fw_core) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-download.c b/drivers/staging/greybus/fw-download.c index 9a09bd3af79b..0216282f72f2 100644 --- a/drivers/staging/greybus/fw-download.c +++ b/drivers/staging/greybus/fw-download.c @@ -165,7 +165,7 @@ static struct fw_request *find_firmware(struct fw_download *fw_download, struct fw_request *fw_req; int ret, req_count; - fw_req = kzalloc(sizeof(*fw_req), GFP_KERNEL); + fw_req = kzalloc_obj(*fw_req, GFP_KERNEL); if (!fw_req) return ERR_PTR(-ENOMEM); @@ -409,7 +409,7 @@ int gb_fw_download_connection_init(struct gb_connection *connection) if (!connection) return 0; - fw_download = kzalloc(sizeof(*fw_download), GFP_KERNEL); + fw_download = kzalloc_obj(*fw_download, GFP_KERNEL); if (!fw_download) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c index 152949c23d65..012ed95d750e 100644 --- a/drivers/staging/greybus/fw-management.c +++ b/drivers/staging/greybus/fw-management.c @@ -577,7 +577,7 @@ int gb_fw_mgmt_connection_init(struct gb_connection *connection) if (!connection) return 0; - fw_mgmt = kzalloc(sizeof(*fw_mgmt), GFP_KERNEL); + fw_mgmt = kzalloc_obj(*fw_mgmt, GFP_KERNEL); if (!fw_mgmt) return -ENOMEM; diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c index 60cf09a302a7..24556c686e62 100644 --- a/drivers/staging/greybus/gbphy.c +++ b/drivers/staging/greybus/gbphy.c @@ -229,7 +229,7 @@ static struct gbphy_device *gb_gbphy_create_dev(struct gb_bundle *bundle, if (id < 0) return ERR_PTR(id); - gbphy_dev = kzalloc(sizeof(*gbphy_dev), GFP_KERNEL); + gbphy_dev = kzalloc_obj(*gbphy_dev, GFP_KERNEL); if (!gbphy_dev) { ida_free(&gbphy_id, id); return ERR_PTR(-ENOMEM); @@ -282,7 +282,7 @@ static int gb_gbphy_probe(struct gb_bundle *bundle, if (bundle->num_cports == 0) return -ENODEV; - gbphy_host = kzalloc(sizeof(*gbphy_host), GFP_KERNEL); + gbphy_host = kzalloc_obj(*gbphy_host, GFP_KERNEL); if (!gbphy_host) return -ENOMEM; diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index ac62b932e6a4..5b30841a4205 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -485,8 +485,7 @@ static int gb_gpio_controller_setup(struct gb_gpio_controller *ggc) if (ret) return ret; - ggc->lines = kcalloc(ggc->line_max + 1, sizeof(*ggc->lines), - GFP_KERNEL); + ggc->lines = kzalloc_objs(*ggc->lines, ggc->line_max + 1, GFP_KERNEL); if (!ggc->lines) return -ENOMEM; @@ -503,7 +502,7 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev, struct irq_chip *irqc; int ret; - ggc = kzalloc(sizeof(*ggc), GFP_KERNEL); + ggc = kzalloc_obj(*ggc, GFP_KERNEL); if (!ggc) return -ENOMEM; diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c index 63c77a3df591..2b5e6a7b04e6 100644 --- a/drivers/staging/greybus/hid.c +++ b/drivers/staging/greybus/hid.c @@ -434,7 +434,7 @@ static int gb_hid_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_HID) return -ENODEV; - ghid = kzalloc(sizeof(*ghid), GFP_KERNEL); + ghid = kzalloc_obj(*ghid, GFP_KERNEL); if (!ghid) return -ENOMEM; diff --git a/drivers/staging/greybus/i2c.c b/drivers/staging/greybus/i2c.c index 14f1ff6d448c..e6934459c8f6 100644 --- a/drivers/staging/greybus/i2c.c +++ b/drivers/staging/greybus/i2c.c @@ -235,7 +235,7 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev, struct i2c_adapter *adapter; int ret; - gb_i2c_dev = kzalloc(sizeof(*gb_i2c_dev), GFP_KERNEL); + gb_i2c_dev = kzalloc_obj(*gb_i2c_dev, GFP_KERNEL); if (!gb_i2c_dev) return -ENOMEM; diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 38c233a706c4..5b8694d3943b 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -269,14 +269,14 @@ static int channel_attr_groups_set(struct gb_channel *channel, return 0; /* Set attributes based in the channel flags */ - channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL); + channel->attrs = kzalloc_objs(*channel->attrs, size + 1, GFP_KERNEL); if (!channel->attrs) return -ENOMEM; - channel->attr_group = kzalloc(sizeof(*channel->attr_group), GFP_KERNEL); + channel->attr_group = kzalloc_obj(*channel->attr_group, GFP_KERNEL); if (!channel->attr_group) return -ENOMEM; - channel->attr_groups = kcalloc(2, sizeof(*channel->attr_groups), - GFP_KERNEL); + channel->attr_groups = kzalloc_objs(*channel->attr_groups, 2, + GFP_KERNEL); if (!channel->attr_groups) return -ENOMEM; @@ -1011,8 +1011,8 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); if (!light->name) return -ENOMEM; - light->channels = kcalloc(conf.channel_count, - sizeof(struct gb_channel), GFP_KERNEL); + light->channels = kzalloc_objs(struct gb_channel, conf.channel_count, + GFP_KERNEL); if (!light->channels) return -ENOMEM; /* @@ -1153,8 +1153,8 @@ static int gb_lights_create_all(struct gb_lights *glights) if (ret < 0) goto out; - glights->lights = kcalloc(glights->lights_count, - sizeof(struct gb_light), GFP_KERNEL); + glights->lights = kzalloc_objs(struct gb_light, glights->lights_count, + GFP_KERNEL); if (!glights->lights) { ret = -ENOMEM; goto out; @@ -1262,7 +1262,7 @@ static int gb_lights_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LIGHTS) return -ENODEV; - glights = kzalloc(sizeof(*glights), GFP_KERNEL); + glights = kzalloc_obj(*glights, GFP_KERNEL); if (!glights) return -ENOMEM; diff --git a/drivers/staging/greybus/log.c b/drivers/staging/greybus/log.c index 57dcf9453bf1..77fb9880c695 100644 --- a/drivers/staging/greybus/log.c +++ b/drivers/staging/greybus/log.c @@ -77,7 +77,7 @@ static int gb_log_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LOG) return -ENODEV; - log = kzalloc(sizeof(*log), GFP_KERNEL); + log = kzalloc_obj(*log, GFP_KERNEL); if (!log) return -ENOMEM; diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 1f19323b0e1a..37a8cbf140ad 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -471,7 +471,7 @@ static int gb_loopback_async_operation(struct gb_loopback *gb, int type, struct gb_operation *operation; int ret; - op_async = kzalloc(sizeof(*op_async), GFP_KERNEL); + op_async = kzalloc_obj(*op_async, GFP_KERNEL); if (!op_async) return -ENOMEM; @@ -989,7 +989,7 @@ static int gb_loopback_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LOOPBACK) return -ENODEV; - gb = kzalloc(sizeof(*gb), GFP_KERNEL); + gb = kzalloc_obj(*gb, GFP_KERNEL); if (!gb) return -ENOMEM; diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index a484c0ca058d..94e3650a2880 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -545,15 +545,15 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy) } } - gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props), - GFP_KERNEL); + gbpsy->props = kzalloc_objs(*gbpsy->props, gbpsy->properties_count, + GFP_KERNEL); if (!gbpsy->props) { ret = -ENOMEM; goto out_put_operation; } - gbpsy->props_raw = kcalloc(gbpsy->properties_count, - sizeof(*gbpsy->props_raw), GFP_KERNEL); + gbpsy->props_raw = kzalloc_objs(*gbpsy->props_raw, + gbpsy->properties_count, GFP_KERNEL); if (!gbpsy->props_raw) { ret = -ENOMEM; goto out_put_operation; @@ -942,9 +942,8 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies) if (ret < 0) goto out; - supplies->supply = kcalloc(supplies->supplies_count, - sizeof(struct gb_power_supply), - GFP_KERNEL); + supplies->supply = kzalloc_objs(struct gb_power_supply, + supplies->supplies_count, GFP_KERNEL); if (!supplies->supply) { ret = -ENOMEM; @@ -1064,7 +1063,7 @@ static int gb_power_supply_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_POWER_SUPPLY) return -ENODEV; - supplies = kzalloc(sizeof(*supplies), GFP_KERNEL); + supplies = kzalloc_obj(*supplies, GFP_KERNEL); if (!supplies) return -ENOMEM; diff --git a/drivers/staging/greybus/raw.c b/drivers/staging/greybus/raw.c index 71de6776739c..742b3a84cf12 100644 --- a/drivers/staging/greybus/raw.c +++ b/drivers/staging/greybus/raw.c @@ -73,7 +73,7 @@ static int receive_data(struct gb_raw *raw, u32 len, u8 *data) goto exit; } - raw_data = kmalloc(struct_size(raw_data, data, len), GFP_KERNEL); + raw_data = kmalloc_flex(*raw_data, data, len, GFP_KERNEL); if (!raw_data) { retval = -ENOMEM; goto exit; @@ -164,7 +164,7 @@ static int gb_raw_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_RAW) return -ENODEV; - raw = kzalloc(sizeof(*raw), GFP_KERNEL); + raw = kzalloc_obj(*raw, GFP_KERNEL); if (!raw) return -ENOMEM; diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 5cece0a6606f..99eff4b97e7a 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -823,7 +823,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev, goto exit_connection_destroy; } - gb_tty = kzalloc(sizeof(*gb_tty), GFP_KERNEL); + gb_tty = kzalloc_obj(*gb_tty, GFP_KERNEL); if (!gb_tty) { retval = -ENOMEM; goto exit_connection_destroy; diff --git a/drivers/staging/greybus/vibrator.c b/drivers/staging/greybus/vibrator.c index ee112aa13ff1..fc995fe41604 100644 --- a/drivers/staging/greybus/vibrator.c +++ b/drivers/staging/greybus/vibrator.c @@ -128,7 +128,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_VIBRATOR) return -ENODEV; - vib = kzalloc(sizeof(*vib), GFP_KERNEL); + vib = kzalloc_obj(*vib, GFP_KERNEL); if (!vib) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index 6050637a0def..a67eeed04b0c 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -794,7 +794,7 @@ static int gc2235_probe(struct i2c_client *client) int ret; unsigned int i; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index a4519babf37d..38568259bd7f 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -952,7 +952,7 @@ static int ov2722_probe(struct i2c_client *client) void *ovpdev; int ret; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index a3cd9d3e9ce7..4584f0ee15f0 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -2960,7 +2960,7 @@ int atomisp_set_parameters(struct video_device *vdev, * are ready, the parameters will be set to CSS. * per-frame setting only works for the main output frame. */ - param = kvzalloc(sizeof(*param), GFP_KERNEL); + param = kvzalloc_obj(*param, GFP_KERNEL); if (!param) return -ENOMEM; css_param = ¶m->params; diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c index 2a90f86e515f..c934da53f4a3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c @@ -305,8 +305,8 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev) int ret; /* Max num GPIOs we've seen plus a terminator */ - int3472 = kzalloc(struct_size(int3472, gpios.table, INT3472_MAX_SENSOR_GPIOS + 1), - GFP_KERNEL); + int3472 = kzalloc_flex(*int3472, gpios.table, + INT3472_MAX_SENSOR_GPIOS + 1, GFP_KERNEL); if (!int3472) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 964cc3bcc0ac..27d3c7d83e21 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -969,7 +969,7 @@ static int camera_sensor_csi_alloc(struct v4l2_subdev *sd, u32 port, u32 lanes, struct i2c_client *client = v4l2_get_subdevdata(sd); struct camera_mipi_info *csi; - csi = kzalloc(sizeof(*csi), GFP_KERNEL); + csi = kzalloc_obj(*csi, GFP_KERNEL); if (!csi) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index bb8b2f2213b0..a19dc99922ad 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -696,7 +696,8 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, ATOMISP_S3A_BUF_QUEUE_DEPTH_FOR_HAL; dev_dbg(isp->dev, "allocating %d 3a buffers\n", count); while (count--) { - s3a_buf = kzalloc(sizeof(struct atomisp_s3a_buf), GFP_KERNEL); + s3a_buf = kzalloc_obj(struct atomisp_s3a_buf, + GFP_KERNEL); if (!s3a_buf) goto error; @@ -715,7 +716,8 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, count = ATOMISP_CSS_Q_DEPTH + 1; dev_dbg(isp->dev, "allocating %d dis buffers\n", count); while (count--) { - dis_buf = kzalloc(sizeof(struct atomisp_dis_buf), GFP_KERNEL); + dis_buf = kzalloc_obj(struct atomisp_dis_buf, + GFP_KERNEL); if (!dis_buf) goto error; if (atomisp_css_allocate_stat_buffers( @@ -737,8 +739,8 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, dev_dbg(isp->dev, "allocating %d metadata buffers for type %d\n", count, i); while (count--) { - md_buf = kzalloc(sizeof(struct atomisp_metadata_buf), - GFP_KERNEL); + md_buf = kzalloc_obj(struct atomisp_metadata_buf, + GFP_KERNEL); if (!md_buf) goto error; diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c index 5d0cd5260d3a..8181e988266a 100644 --- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c +++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c @@ -676,7 +676,7 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, mutex_lock(&bo->mutex); check_bo_status_no_goto(bo, HMM_BO_PAGE_ALLOCED, status_err); - bo->pages = kcalloc(bo->pgnr, sizeof(struct page *), GFP_KERNEL); + bo->pages = kzalloc_objs(struct page *, bo->pgnr, GFP_KERNEL); if (unlikely(!bo->pages)) { ret = -ENOMEM; goto alloc_err; diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index a1bea8bd1a39..473e71e1bb59 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c @@ -309,7 +309,7 @@ ia_css_isp_dvs_statistics_allocate( if (!grid->enable) return NULL; - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -350,7 +350,7 @@ ia_css_isp_dvs_statistics_map_allocate( * so we use a local char * instead. */ char *base_ptr; - me = kvmalloc(sizeof(*me), GFP_KERNEL); + me = kvmalloc_obj(*me, GFP_KERNEL); if (!me) { IA_CSS_LOG("cannot allocate memory"); goto err; diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c index 027eae0ca69e..f84ee4c683f4 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c @@ -274,7 +274,7 @@ ia_css_isp_dvs2_statistics_allocate( if (!grid->enable) return NULL; - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; diff --git a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c index 2cb96f9a6030..2217e3623a23 100644 --- a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c +++ b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c @@ -650,7 +650,7 @@ static struct ia_css_frame *frame_create(unsigned int width, unsigned int raw_bit_depth, bool valid) { - struct ia_css_frame *me = kvmalloc(sizeof(*me), GFP_KERNEL); + struct ia_css_frame *me = kvmalloc_obj(*me, GFP_KERNEL); if (!me) return NULL; diff --git a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c index cb8d652227a7..2a1ba0a9c916 100644 --- a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +++ b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c @@ -579,7 +579,7 @@ static int pipeline_stage_create( out_frame[i] = stage_desc->out_frame[i]; } - stage = kvzalloc(sizeof(*stage), GFP_KERNEL); + stage = kvzalloc_obj(*stage, GFP_KERNEL); if (!stage) { err = -ENOMEM; goto ERR; diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 73bd87f43a8c..abf598b2811f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1880,7 +1880,7 @@ create_pipe(enum ia_css_pipe_mode mode, return -EINVAL; } - me = kmalloc(sizeof(*me), GFP_KERNEL); + me = kmalloc_obj(*me, GFP_KERNEL); if (!me) return -ENOMEM; @@ -4530,16 +4530,17 @@ static int load_video_binaries(struct ia_css_pipe *pipe) if (err) return err; mycs->num_yuv_scaler = cas_scaler_descr.num_stage; - mycs->yuv_scaler_binary = kcalloc(cas_scaler_descr.num_stage, - sizeof(struct ia_css_binary), - GFP_KERNEL); + mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->yuv_scaler_binary) { mycs->num_yuv_scaler = 0; err = -ENOMEM; return err; } - mycs->is_output_stage = kcalloc(cas_scaler_descr.num_stage, - sizeof(bool), GFP_KERNEL); + mycs->is_output_stage = kzalloc_objs(bool, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->is_output_stage) { err = -ENOMEM; return err; @@ -5110,16 +5111,17 @@ static int load_primary_binaries( return err; } mycs->num_yuv_scaler = cas_scaler_descr.num_stage; - mycs->yuv_scaler_binary = kcalloc(cas_scaler_descr.num_stage, - sizeof(struct ia_css_binary), - GFP_KERNEL); + mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->yuv_scaler_binary) { err = -ENOMEM; IA_CSS_LEAVE_ERR_PRIVATE(err); return err; } - mycs->is_output_stage = kcalloc(cas_scaler_descr.num_stage, - sizeof(bool), GFP_KERNEL); + mycs->is_output_stage = kzalloc_objs(bool, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->is_output_stage) { err = -ENOMEM; IA_CSS_LEAVE_ERR_PRIVATE(err); @@ -5970,9 +5972,8 @@ ia_css_pipe_create_cas_scaler_desc(struct ia_css_pipe *pipe, descr->num_stage = num_stages; - descr->in_info = kmalloc_array(descr->num_stage, - sizeof(struct ia_css_frame_info), - GFP_KERNEL); + descr->in_info = kmalloc_objs(struct ia_css_frame_info, + descr->num_stage, GFP_KERNEL); if (!descr->in_info) { err = -ENOMEM; goto ERR; @@ -6143,15 +6144,16 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) goto ERR; mycs->num_output = cas_scaler_descr.num_output_stage; mycs->num_yuv_scaler = cas_scaler_descr.num_stage; - mycs->yuv_scaler_binary = kcalloc(cas_scaler_descr.num_stage, - sizeof(struct ia_css_binary), - GFP_KERNEL); + mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->yuv_scaler_binary) { err = -ENOMEM; goto ERR; } - mycs->is_output_stage = kcalloc(cas_scaler_descr.num_stage, - sizeof(bool), GFP_KERNEL); + mycs->is_output_stage = kzalloc_objs(bool, + cas_scaler_descr.num_stage, + GFP_KERNEL); if (!mycs->is_output_stage) { err = -ENOMEM; goto ERR; @@ -6250,9 +6252,8 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) mycs->num_vf_pp = 1; } - mycs->vf_pp_binary = kcalloc(mycs->num_vf_pp, - sizeof(struct ia_css_binary), - GFP_KERNEL); + mycs->vf_pp_binary = kzalloc_objs(struct ia_css_binary, mycs->num_vf_pp, + GFP_KERNEL); if (!mycs->vf_pp_binary) { err = -ENOMEM; goto ERR; @@ -7909,7 +7910,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, } /* allocate the stream instance */ - curr_stream = kzalloc(sizeof(struct ia_css_stream), GFP_KERNEL); + curr_stream = kzalloc_obj(struct ia_css_stream, GFP_KERNEL); if (!curr_stream) { err = -ENOMEM; IA_CSS_LEAVE_ERR(err); @@ -7920,7 +7921,8 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, /* allocate pipes */ curr_stream->num_pipes = num_pipes; - curr_stream->pipes = kcalloc(num_pipes, sizeof(struct ia_css_pipe *), GFP_KERNEL); + curr_stream->pipes = kzalloc_objs(struct ia_css_pipe *, num_pipes, + GFP_KERNEL); if (!curr_stream->pipes) { curr_stream->num_pipes = 0; kfree(curr_stream); diff --git a/drivers/staging/media/atomisp/pci/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/sh_css_firmware.c index bed599223717..a2a8a46c628b 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_firmware.c +++ b/drivers/staging/media/atomisp/pci/sh_css_firmware.c @@ -262,8 +262,8 @@ sh_css_load_firmware(struct device *dev, const char *fw_data, sh_css_blob_info = NULL; } - fw_minibuffer = kcalloc(sh_css_num_binaries, sizeof(struct fw_param), - GFP_KERNEL); + fw_minibuffer = kzalloc_objs(struct fw_param, sh_css_num_binaries, + GFP_KERNEL); if (!fw_minibuffer) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/sh_css_host_data.c b/drivers/staging/media/atomisp/pci/sh_css_host_data.c index 39efd8933034..c9400600c241 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_host_data.c +++ b/drivers/staging/media/atomisp/pci/sh_css_host_data.c @@ -12,7 +12,7 @@ struct ia_css_host_data *ia_css_host_data_allocate(size_t size) { struct ia_css_host_data *me; - me = kmalloc(sizeof(struct ia_css_host_data), GFP_KERNEL); + me = kmalloc_obj(struct ia_css_host_data, GFP_KERNEL); if (!me) return NULL; me->size = (uint32_t)size; diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c index 7fa4aab35b06..19f1b71a5c06 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c +++ b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c @@ -22,8 +22,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res, int err = 0; struct ia_css_dvs_6axis_config *dvs_config = NULL; - dvs_config = kvmalloc(sizeof(struct ia_css_dvs_6axis_config), - GFP_KERNEL); + dvs_config = kvmalloc_obj(struct ia_css_dvs_6axis_config, GFP_KERNEL); if (!dvs_config) { IA_CSS_ERROR("out of memory"); err = -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c index 513e272f2fdc..e9ce4ef6a991 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c +++ b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c @@ -328,7 +328,7 @@ ia_css_shading_table_alloc( IA_CSS_ENTER(""); - me = kmalloc(sizeof(*me), GFP_KERNEL); + me = kmalloc_obj(*me, GFP_KERNEL); if (!me) return me; diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index 11d62313c908..ab9ab7b2f177 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -1369,7 +1369,7 @@ struct ia_css_morph_table *ia_css_morph_table_allocate( IA_CSS_ENTER(""); - me = kvmalloc(sizeof(*me), GFP_KERNEL); + me = kvmalloc_obj(*me, GFP_KERNEL); if (!me) { IA_CSS_ERROR("out of memory"); return me; @@ -1516,7 +1516,7 @@ ia_css_isp_3a_statistics_map_allocate( * so we use a local char * instead. */ char *base_ptr; - me = kvmalloc(sizeof(*me), GFP_KERNEL); + me = kvmalloc_obj(*me, GFP_KERNEL); if (!me) { IA_CSS_LEAVE("cannot allocate memory"); goto err; @@ -2136,7 +2136,7 @@ ia_css_isp_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid) if (!grid->enable) return NULL; - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -2200,7 +2200,7 @@ ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info) if (metadata_info->size == 0) return NULL; - md = kvmalloc(sizeof(*md), GFP_KERNEL); + md = kvmalloc_obj(*md, GFP_KERNEL); if (!md) goto error; @@ -2330,7 +2330,7 @@ sh_css_create_isp_params(struct ia_css_stream *stream, int err; size_t params_size; struct ia_css_isp_parameters *params = - kvmalloc(sizeof(struct ia_css_isp_parameters), GFP_KERNEL); + kvmalloc_obj(struct ia_css_isp_parameters, GFP_KERNEL); if (!params) { *isp_params_out = NULL; @@ -4161,7 +4161,7 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid) assert(grid); - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -4201,7 +4201,7 @@ ia_css_dvs_statistics_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -4239,7 +4239,7 @@ ia_css_dvs_coefficients_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -4280,7 +4280,7 @@ ia_css_dvs2_statistics_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -4371,7 +4371,7 @@ ia_css_dvs2_coefficients_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvcalloc(1, sizeof(*me), GFP_KERNEL); + me = kvzalloc_objs(*me, 1, GFP_KERNEL); if (!me) goto err; @@ -4464,8 +4464,8 @@ ia_css_dvs2_6axis_config_allocate(const struct ia_css_stream *stream) if (!params || !params->pipe_dvs_6axis_config[IA_CSS_PIPE_ID_VIDEO]) goto err; - dvs_config = kvcalloc(1, sizeof(struct ia_css_dvs_6axis_config), - GFP_KERNEL); + dvs_config = kvzalloc_objs(struct ia_css_dvs_6axis_config, 1, + GFP_KERNEL); if (!dvs_config) goto err; diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 602342d1174f..bdd3cc28e364 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -2424,7 +2424,7 @@ static int av7110_attach(struct saa7146_dev *dev, } /* prepare the av7110 device struct */ - av7110 = kzalloc(sizeof(*av7110), GFP_KERNEL); + av7110 = kzalloc_obj(*av7110, GFP_KERNEL); if (!av7110) { dprintk(1, "out of memory\n"); return -ENOMEM; diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index 93bf47a62e38..2254a5f3a351 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -563,7 +563,7 @@ struct dvb_frontend *sp8870_attach(const struct sp8870_config *config, struct sp8870_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) goto error; diff --git a/drivers/staging/media/imx/imx-media-csc-scaler.c b/drivers/staging/media/imx/imx-media-csc-scaler.c index 0a27330f9790..f068ead6c088 100644 --- a/drivers/staging/media/imx/imx-media-csc-scaler.c +++ b/drivers/staging/media/imx/imx-media-csc-scaler.c @@ -124,7 +124,7 @@ static void device_run(void *_ctx) src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); - run = kzalloc(sizeof(*run), GFP_KERNEL); + run = kzalloc_obj(*run, GFP_KERNEL); if (!run) goto err; @@ -756,7 +756,7 @@ static int ipu_csc_scaler_open(struct file *file) struct ipu_csc_scaler_ctx *ctx = NULL; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -880,7 +880,7 @@ imx_media_csc_scaler_device_init(struct imx_media_dev *md) struct video_device *vfd; int ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu3/ipu3-css-fw.c b/drivers/staging/media/ipu3/ipu3-css-fw.c index 37482b626c3c..0f242dd27288 100644 --- a/drivers/staging/media/ipu3/ipu3-css-fw.c +++ b/drivers/staging/media/ipu3/ipu3-css-fw.c @@ -236,7 +236,7 @@ int imgu_css_fw_init(struct imgu_css *css) /* Allocate and map fw binaries into IMGU */ - css->binary = kcalloc(binary_nr, sizeof(*css->binary), GFP_KERNEL); + css->binary = kzalloc_objs(*css->binary, binary_nr, GFP_KERNEL); if (!css->binary) { r = -ENOMEM; goto error_out; diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c index 777cac1c27bf..3fb863043c71 100644 --- a/drivers/staging/media/ipu3/ipu3-css.c +++ b/drivers/staging/media/ipu3/ipu3-css.c @@ -1702,7 +1702,7 @@ int imgu_css_fmt_try(struct imgu_css *css, struct v4l2_pix_format_mplane *in, *out, *vf; int i, s, ret; - q = kcalloc(IPU3_CSS_QUEUES, sizeof(struct imgu_css_queue), GFP_KERNEL); + q = kzalloc_objs(struct imgu_css_queue, IPU3_CSS_QUEUES, GFP_KERNEL); if (!q) return -ENOMEM; diff --git a/drivers/staging/media/ipu3/ipu3-dmamap.c b/drivers/staging/media/ipu3/ipu3-dmamap.c index 8a19b0024152..9f6025aa8a1f 100644 --- a/drivers/staging/media/ipu3/ipu3-dmamap.c +++ b/drivers/staging/media/ipu3/ipu3-dmamap.c @@ -39,7 +39,7 @@ static struct page **imgu_dmamap_alloc_buffer(size_t size, gfp_t gfp) const gfp_t high_order_gfp = __GFP_NOWARN | __GFP_NORETRY; /* Allocate mem for array of page ptrs */ - pages = kvmalloc_array(count, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, count, GFP_KERNEL); if (!pages) return NULL; diff --git a/drivers/staging/media/ipu3/ipu3-mmu.c b/drivers/staging/media/ipu3/ipu3-mmu.c index cb9bf5fb29a5..03583d37fdd0 100644 --- a/drivers/staging/media/ipu3/ipu3-mmu.c +++ b/drivers/staging/media/ipu3/ipu3-mmu.c @@ -429,7 +429,7 @@ struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base) struct imgu_mmu *mmu; u32 pteval; - mmu = kzalloc(sizeof(*mmu), GFP_KERNEL); + mmu = kzalloc_obj(*mmu, GFP_KERNEL); if (!mmu) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu7/ipu7-bus.c b/drivers/staging/media/ipu7/ipu7-bus.c index 7da44fde002a..583825d15230 100644 --- a/drivers/staging/media/ipu7/ipu7-bus.c +++ b/drivers/staging/media/ipu7/ipu7-bus.c @@ -89,7 +89,7 @@ ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent, struct ipu7_device *isp = pci_get_drvdata(pdev); int ret; - adev = kzalloc(sizeof(*adev), GFP_KERNEL); + adev = kzalloc_obj(*adev, GFP_KERNEL); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu7/ipu7-dma.c b/drivers/staging/media/ipu7/ipu7-dma.c index a118b41b2f34..4f934e4c930b 100644 --- a/drivers/staging/media/ipu7/ipu7-dma.c +++ b/drivers/staging/media/ipu7/ipu7-dma.c @@ -164,7 +164,7 @@ void *ipu7_dma_alloc(struct ipu7_bus_device *sys, size_t size, unsigned int i; int ret; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return NULL; diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c index ea35cce4830a..dfed9872bdfd 100644 --- a/drivers/staging/media/ipu7/ipu7-mmu.c +++ b/drivers/staging/media/ipu7/ipu7-mmu.c @@ -584,7 +584,7 @@ static struct ipu7_mmu_info *ipu7_mmu_alloc(struct ipu7_device *isp) struct ipu7_mmu_info *mmu_info; int ret; - mmu_info = kzalloc(sizeof(*mmu_info), GFP_KERNEL); + mmu_info = kzalloc_obj(*mmu_info, GFP_KERNEL); if (!mmu_info) return NULL; @@ -654,7 +654,7 @@ static struct ipu7_dma_mapping *alloc_dma_mapping(struct ipu7_device *isp) struct ipu7_dma_mapping *dmap; unsigned long base_pfn; - dmap = kzalloc(sizeof(*dmap), GFP_KERNEL); + dmap = kzalloc_obj(*dmap, GFP_KERNEL); if (!dmap) return NULL; diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c index fa5a1867626f..47b859e1fa0f 100644 --- a/drivers/staging/media/ipu7/ipu7.c +++ b/drivers/staging/media/ipu7/ipu7.c @@ -2150,7 +2150,7 @@ ipu7_isys_init(struct pci_dev *pdev, struct device *parent, } } - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); @@ -2197,7 +2197,7 @@ ipu7_psys_init(struct pci_dev *pdev, struct device *parent, struct ipu7_psys_pdata *pdata; int ret; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + pdata = kzalloc_obj(*pdata, GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); @@ -2271,7 +2271,7 @@ static int ipu7_map_fw_code_region(struct ipu7_bus_device *sys, n_pages = PFN_UP(size); - pages = kmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, n_pages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_h264.c b/drivers/staging/media/meson/vdec/codec_h264.c index c61128fc4bb9..bafa7e99abf1 100644 --- a/drivers/staging/media/meson/vdec/codec_h264.c +++ b/drivers/staging/media/meson/vdec/codec_h264.c @@ -233,7 +233,7 @@ static int codec_h264_load_extended_firmware(struct amvdec_session *sess, if (len < SIZE_EXT_FW) return -EINVAL; - h264 = kzalloc(sizeof(*h264), GFP_KERNEL); + h264 = kzalloc_obj(*h264, GFP_KERNEL); if (!h264) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c index 48869cc3d973..01adf66fb50a 100644 --- a/drivers/staging/media/meson/vdec/codec_mpeg12.c +++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c @@ -66,7 +66,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess) struct codec_mpeg12 *mpeg12; int ret; - mpeg12 = kzalloc(sizeof(*mpeg12), GFP_KERNEL); + mpeg12 = kzalloc_obj(*mpeg12, GFP_KERNEL); if (!mpeg12) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_vp9.c b/drivers/staging/media/meson/vdec/codec_vp9.c index 394df5761556..c82f7be67bc5 100644 --- a/drivers/staging/media/meson/vdec/codec_vp9.c +++ b/drivers/staging/media/meson/vdec/codec_vp9.c @@ -762,7 +762,7 @@ static int codec_vp9_start(struct amvdec_session *sess) int i; int ret; - vp9 = kzalloc(sizeof(*vp9), GFP_KERNEL); + vp9 = kzalloc_obj(*vp9, GFP_KERNEL); if (!vp9) return -ENOMEM; @@ -1192,7 +1192,7 @@ static struct vp9_frame *codec_vp9_get_new_frame(struct amvdec_session *sess) struct vb2_v4l2_buffer *vbuf; struct vp9_frame *new_frame; - new_frame = kzalloc(sizeof(*new_frame), GFP_KERNEL); + new_frame = kzalloc_obj(*new_frame, GFP_KERNEL); if (!new_frame) return NULL; diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 49e497a32973..befd3c3762cc 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -132,7 +132,7 @@ vdec_queue_recycle(struct amvdec_session *sess, struct vb2_buffer *vb) { struct amvdec_buffer *new_buf; - new_buf = kmalloc(sizeof(*new_buf), GFP_KERNEL); + new_buf = kmalloc_obj(*new_buf, GFP_KERNEL); if (!new_buf) return; new_buf->vb = vb; @@ -867,7 +867,7 @@ static int vdec_open(struct file *file) struct amvdec_session *sess; int ret; - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (!sess) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c index 7d2a75653250..86ed5b8113d2 100644 --- a/drivers/staging/media/meson/vdec/vdec_helpers.c +++ b/drivers/staging/media/meson/vdec/vdec_helpers.c @@ -233,7 +233,7 @@ int amvdec_add_ts(struct amvdec_session *sess, u64 ts, struct amvdec_timestamp *new_ts; unsigned long flags; - new_ts = kzalloc(sizeof(*new_ts), GFP_KERNEL); + new_ts = kzalloc_obj(*new_ts, GFP_KERNEL); if (!new_ts) return -ENOMEM; diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index bff42ea1871f..accaee635d21 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -359,7 +359,7 @@ static int cedrus_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c index 3c3f6e3fd1ec..98e3a97ee658 100644 --- a/drivers/staging/media/tegra-video/csi.c +++ b/drivers/staging/media/tegra-video/csi.c @@ -463,7 +463,7 @@ static int tegra_csi_channel_alloc(struct tegra_csi *csi, struct tegra_csi_channel *chan; int ret = 0, i; - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index 14b327afe045..a86d0223f6c3 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1209,7 +1209,7 @@ static int tegra_vi_channel_alloc(struct tegra_vi *vi, unsigned int port_num, * be holding the device node open. Channel memory allocated * with kzalloc is freed during video device release callback. */ - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/video.c b/drivers/staging/media/tegra-video/video.c index 68783d5ffeb1..06d85292c0d2 100644 --- a/drivers/staging/media/tegra-video/video.c +++ b/drivers/staging/media/tegra-video/video.c @@ -46,7 +46,7 @@ static int host1x_video_probe(struct host1x_device *dev) struct tegra_video_device *vid; int ret; - vid = kzalloc(sizeof(*vid), GFP_KERNEL); + vid = kzalloc_obj(*vid, GFP_KERNEL); if (!vid) return -ENOMEM; diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c index 80af965356d0..16b1aca26333 100644 --- a/drivers/staging/most/dim2/dim2.c +++ b/drivers/staging/most/dim2/dim2.c @@ -759,7 +759,7 @@ static int dim2_probe(struct platform_device *pdev) enum { MLB_INT_IDX, AHB0_INT_IDX }; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c index 8eeae209ff1c..b0d7216f5ab5 100644 --- a/drivers/staging/most/video/video.c +++ b/drivers/staging/most/video/video.c @@ -84,7 +84,7 @@ static int comp_vdev_open(struct file *filp) return -EINVAL; } - fh = kzalloc(sizeof(*fh), GFP_KERNEL); + fh = kzalloc_obj(*fh, GFP_KERNEL); if (!fh) return -ENOMEM; @@ -474,7 +474,7 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx, return -EINVAL; } - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c index 2db57795ea2f..3422a5213803 100644 --- a/drivers/staging/nvec/nvec_ps2.c +++ b/drivers/staging/nvec/nvec_ps2.c @@ -102,7 +102,7 @@ static int nvec_mouse_probe(struct platform_device *pdev) struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); struct serio *ser_dev; - ser_dev = kzalloc(sizeof(*ser_dev), GFP_KERNEL); + ser_dev = kzalloc_obj(*ser_dev, GFP_KERNEL); if (!ser_dev) return -ENOMEM; diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index ebe73abab892..a90b117906ce 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -1229,13 +1229,13 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para = kzalloc(sizeof(*psetstakey_para), GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); if (!psetstakey_para) { kfree(ph2c); res = _FAIL; @@ -1269,12 +1269,12 @@ static int rtw_ap_set_key(struct adapter *padapter, struct cmd_priv *pcmdpriv = &padapter->cmdpriv; int res = _SUCCESS; - pcmd = kzalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); if (!pcmd) { res = _FAIL; goto exit; } - psetkeyparm = kzalloc(sizeof(*psetkeyparm), GFP_KERNEL); + psetkeyparm = kzalloc_obj(*psetkeyparm, GFP_KERNEL); if (!psetkeyparm) { kfree(pcmd); res = _FAIL; diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index b2e7f479f72b..59f4e12535f9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -533,11 +533,11 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) return _FAIL; - psurveyPara = kzalloc(sizeof(*psurveyPara), GFP_ATOMIC); + psurveyPara = kzalloc_obj(*psurveyPara, GFP_ATOMIC); if (!psurveyPara) { kfree(ph2c); return _FAIL; @@ -601,7 +601,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter) struct wlan_bssid_ex *pdev_network = &padapter->registrypriv.dev_network; u8 res = _SUCCESS; - pcmd = kzalloc(sizeof(*pcmd), GFP_ATOMIC); + pcmd = kzalloc_obj(*pcmd, GFP_ATOMIC); if (!pcmd) { res = _FAIL; goto exit; @@ -634,7 +634,7 @@ int rtw_startbss_cmd(struct adapter *padapter, int flags) start_bss_network(padapter); } else { /* need enqueue, prepare cmd_obj and enqueue */ - pcmd = kzalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); if (!pcmd) { res = _FAIL; goto exit; @@ -686,7 +686,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) u32 tmp_len; u8 *ptmp = NULL; - pcmd = kzalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); if (!pcmd) { res = _FAIL; goto exit; @@ -795,7 +795,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu u8 res = _SUCCESS; /* prepare cmd parameter */ - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) { res = _FAIL; goto exit; @@ -804,7 +804,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu if (enqueue) { /* need enqueue, prepare cmd_obj and enqueue */ - cmdobj = kzalloc(sizeof(*cmdobj), GFP_KERNEL); + cmdobj = kzalloc_obj(*cmdobj, GFP_KERNEL); if (!cmdobj) { res = _FAIL; kfree(param); @@ -831,7 +831,7 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrast struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - psetop = kzalloc(sizeof(*psetop), GFP_KERNEL); + psetop = kzalloc_obj(*psetop, GFP_KERNEL); if (!psetop) { res = _FAIL; goto exit; @@ -839,7 +839,7 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrast psetop->mode = (u8)networktype; if (enqueue) { - ph2c = kzalloc(sizeof(*ph2c), GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); if (!ph2c) { kfree(psetop); res = _FAIL; @@ -866,7 +866,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ struct security_priv *psecuritypriv = &padapter->securitypriv; u8 res = _SUCCESS; - psetstakey_para = kzalloc(sizeof(*psetstakey_para), GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); if (!psetstakey_para) { res = _FAIL; goto exit; @@ -888,14 +888,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ padapter->securitypriv.busetkipkey = true; if (enqueue) { - ph2c = kzalloc(sizeof(*ph2c), GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); if (!ph2c) { kfree(psetstakey_para); res = _FAIL; goto exit; } - psetstakey_rsp = kzalloc(sizeof(*psetstakey_rsp), GFP_KERNEL); + psetstakey_rsp = kzalloc_obj(*psetstakey_rsp, GFP_KERNEL); if (!psetstakey_rsp) { kfree(ph2c); kfree(psetstakey_para); @@ -933,20 +933,20 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu rtw_camid_free(padapter, cam_id); } } else { - ph2c = kzalloc(sizeof(*ph2c), GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para = kzalloc(sizeof(*psetstakey_para), GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); if (!psetstakey_para) { kfree(ph2c); res = _FAIL; goto exit; } - psetstakey_rsp = kzalloc(sizeof(*psetstakey_rsp), GFP_KERNEL); + psetstakey_rsp = kzalloc_obj(*psetstakey_rsp, GFP_KERNEL); if (!psetstakey_rsp) { kfree(ph2c); kfree(psetstakey_para); @@ -976,13 +976,13 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr) u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - paddbareq_parm = kzalloc(sizeof(*paddbareq_parm), GFP_ATOMIC); + paddbareq_parm = kzalloc_obj(*paddbareq_parm, GFP_ATOMIC); if (!paddbareq_parm) { kfree(ph2c); res = _FAIL; @@ -1009,13 +1009,13 @@ u8 rtw_reset_securitypriv_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1042,13 +1042,13 @@ u8 rtw_free_assoc_resources_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1076,13 +1076,13 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter) u8 res = _SUCCESS; /* only primary padapter does this cmd */ - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1316,13 +1316,14 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue) u8 res = _SUCCESS; if (enqueue) { - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, + GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1357,13 +1358,13 @@ u8 rtw_dm_in_lps_wk_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1419,13 +1420,13 @@ u8 rtw_dm_ra_mask_wk_cmd(struct adapter *padapter, u8 *psta) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1453,13 +1454,13 @@ u8 rtw_ps_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ppscmd = kzalloc(sizeof(*ppscmd), GFP_ATOMIC); + ppscmd = kzalloc_obj(*ppscmd, GFP_ATOMIC); if (!ppscmd) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ppscmd); res = _FAIL; @@ -1523,13 +1524,13 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1615,13 +1616,13 @@ u8 rtw_c2h_packet_wk_cmd(struct adapter *padapter, u8 *pbuf, u16 length) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; @@ -1650,13 +1651,13 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_KERNEL); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_KERNEL); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 22dc36e8e38a..1bc90fa48d36 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -1875,13 +1875,13 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity struct cmd_priv *pcmdpriv = &adapter->cmdpriv; signed int res = _SUCCESS; - pcmd = kzalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); if (!pcmd) { res = _FAIL; /* try again */ goto exit; } - psetauthparm = kzalloc(sizeof(*psetauthparm), GFP_KERNEL); + psetauthparm = kzalloc_obj(*psetauthparm, GFP_KERNEL); if (!psetauthparm) { kfree(pcmd); res = _FAIL; @@ -1912,7 +1912,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp struct cmd_priv *pcmdpriv = &adapter->cmdpriv; signed int res = _SUCCESS; - psetkeyparm = kzalloc(sizeof(*psetkeyparm), GFP_KERNEL); + psetkeyparm = kzalloc_obj(*psetkeyparm, GFP_KERNEL); if (!psetkeyparm) { res = _FAIL; goto exit; @@ -1954,7 +1954,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp } if (enqueue) { - pcmd = kzalloc(sizeof(*pcmd), GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); if (!pcmd) { kfree(psetkeyparm); res = _FAIL; /* try again */ diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 78abc5f5191f..b1f20aa81efb 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -586,7 +586,7 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame) if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) { if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { /* we should update current network before auth, or some IE is wrong */ - pbss = kmalloc(sizeof(*pbss), GFP_ATOMIC); + pbss = kmalloc_obj(*pbss, GFP_ATOMIC); if (pbss) { if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { update_network(&(pmlmepriv->cur_network.network), pbss, padapter, true); @@ -4376,7 +4376,7 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame pmlmeext = &padapter->mlmeextpriv; pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -4429,7 +4429,7 @@ void report_surveydone_event(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -4474,7 +4474,7 @@ void report_join_res(struct adapter *padapter, int res) struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -4523,7 +4523,7 @@ void report_wmm_edca_update(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -4569,7 +4569,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -4620,7 +4620,7 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - pcmd_obj = kzalloc(sizeof(*pcmd_obj), GFP_ATOMIC); + pcmd_obj = kzalloc_obj(*pcmd_obj, GFP_ATOMIC); if (!pcmd_obj) return; @@ -5074,11 +5074,11 @@ void survey_timer_hdl(struct timer_list *t) pmlmeext->scan_abort = false;/* reset */ } - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) return; - psurveyPara = kzalloc(sizeof(*psurveyPara), GFP_ATOMIC); + psurveyPara = kzalloc_obj(*psurveyPara, GFP_ATOMIC); if (!psurveyPara) { kfree(ph2c); return; @@ -5689,7 +5689,7 @@ u8 chk_bmc_sleepq_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &(padapter->cmdpriv); u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; @@ -5713,13 +5713,13 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) u8 res = _SUCCESS; int len_diff = 0; - ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); + ph2c = kzalloc_obj(*ph2c, GFP_ATOMIC); if (!ph2c) { res = _FAIL; goto exit; } - ptxBeacon_parm = kzalloc(sizeof(*ptxBeacon_parm), GFP_ATOMIC); + ptxBeacon_parm = kzalloc_obj(*ptxBeacon_parm, GFP_ATOMIC); if (!ptxBeacon_parm) { kfree(ph2c); res = _FAIL; diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c index 9284657e23c2..aceb1bfde8a4 100644 --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c @@ -1131,7 +1131,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) if (memcmp(cur_network->network.mac_address, pbssid, 6)) return true; - bssid = kzalloc(sizeof(*bssid), GFP_KERNEL); + bssid = kzalloc_obj(*bssid, GFP_KERNEL); if (!bssid) return true; diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 222851e8d985..7b18be8912e6 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -1869,7 +1869,8 @@ s32 rtw_alloc_hwxmits(struct adapter *padapter) pxmitpriv->hwxmits = NULL; - pxmitpriv->hwxmits = kcalloc(pxmitpriv->hwxmit_entry, sizeof(*hwxmits), GFP_ATOMIC); + pxmitpriv->hwxmits = kzalloc_objs(*hwxmits, pxmitpriv->hwxmit_entry, + GFP_ATOMIC); if (!pxmitpriv->hwxmits) return _FAIL; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 54dbcea89491..64d3cbfb1244 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -306,10 +306,10 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw) u8 *fwfilepath; u8 tmp_ps; - pFirmware = kzalloc(sizeof(struct rt_firmware), GFP_KERNEL); + pFirmware = kzalloc_obj(struct rt_firmware, GFP_KERNEL); if (!pFirmware) return _FAIL; - pBTFirmware = kzalloc(sizeof(struct rt_firmware), GFP_KERNEL); + pBTFirmware = kzalloc_obj(struct rt_firmware, GFP_KERNEL); if (!pBTFirmware) { kfree(pFirmware); return _FAIL; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index a47d0d3fa2b7..3922c3920bd8 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1248,7 +1248,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy goto check_need_indicate_scan_done; } - ssid = kcalloc(RTW_SSID_SCAN_AMOUNT, sizeof(*ssid), GFP_KERNEL); + ssid = kzalloc_objs(*ssid, RTW_SSID_SCAN_AMOUNT, GFP_KERNEL); if (!ssid) { ret = -ENOMEM; goto check_need_indicate_scan_done; @@ -2145,7 +2145,7 @@ static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *name, str pnpi->sizeof_priv = sizeof(struct adapter); /* wdev */ - mon_wdev = kzalloc(sizeof(*mon_wdev), GFP_KERNEL); + mon_wdev = kzalloc_obj(*mon_wdev, GFP_KERNEL); if (!mon_wdev) { ret = -ENOMEM; goto out; @@ -2726,7 +2726,7 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev) goto free_wiphy; /* wdev */ - wdev = kzalloc(sizeof(*wdev), GFP_KERNEL); + wdev = kzalloc_obj(*wdev, GFP_KERNEL); if (!wdev) { ret = -ENOMEM; goto unregister_wiphy; diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 21a0c3cf4c31..6260f8f33c6d 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -568,7 +568,7 @@ struct dvobj_priv *devobj_init(void) { struct dvobj_priv *pdvobj = NULL; - pdvobj = kzalloc(sizeof(*pdvobj), GFP_KERNEL); + pdvobj = kzalloc_obj(*pdvobj, GFP_KERNEL); if (!pdvobj) return NULL; diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c index 2a8fdafefcd9..9ad8473762bc 100644 --- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c +++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c @@ -193,7 +193,7 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size) { struct rtw_cbuf *cbuf; - cbuf = kzalloc(struct_size(cbuf, bufs, size), GFP_KERNEL); + cbuf = kzalloc_flex(*cbuf, bufs, size, GFP_KERNEL); cbuf->size = size; return cbuf; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index 68e8d491a7ec..ae9ad7a8815d 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -108,7 +108,7 @@ static int snd_bcm2835_playback_open_generic(struct snd_pcm_substream *substream goto out; } - alsa_stream = kzalloc(sizeof(*alsa_stream), GFP_KERNEL); + alsa_stream = kzalloc_obj(*alsa_stream, GFP_KERNEL); if (!alsa_stream) { err = -ENOMEM; goto out; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 7368b384497f..d9397ac8faca 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -219,7 +219,7 @@ int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream) int err; /* Allocate memory for this instance */ - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) return -ENOMEM; mutex_init(&instance->vchi_mutex); diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 1d169f276bcf..4ab3b572bbd7 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -287,7 +287,7 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, if (!allocated_image) goto err_image; - resource = kmalloc(sizeof(*resource), GFP_KERNEL); + resource = kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; @@ -484,7 +484,7 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, goto err_image; } - resource = kmalloc(sizeof(*resource), GFP_KERNEL); + resource = kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; @@ -854,7 +854,7 @@ struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route) if (!allocated_ctrlr) goto err_ctrlr; - resource = kmalloc(sizeof(*resource), GFP_KERNEL); + resource = kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; @@ -894,7 +894,7 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource) return NULL; } - dma_list = kmalloc(sizeof(*dma_list), GFP_KERNEL); + dma_list = kmalloc_obj(*dma_list, GFP_KERNEL); if (!dma_list) return NULL; @@ -924,11 +924,11 @@ struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, u32 type) struct vme_dma_attr *attributes; struct vme_dma_pattern *pattern_attr; - attributes = kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes = kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; - pattern_attr = kmalloc(sizeof(*pattern_attr), GFP_KERNEL); + pattern_attr = kmalloc_obj(*pattern_attr, GFP_KERNEL); if (!pattern_attr) goto err_pat; @@ -964,11 +964,11 @@ struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t address) /* XXX Run some sanity checks here */ - attributes = kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes = kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; - pci_attr = kmalloc(sizeof(*pci_attr), GFP_KERNEL); + pci_attr = kmalloc_obj(*pci_attr, GFP_KERNEL); if (!pci_attr) goto err_pci; @@ -1005,11 +1005,11 @@ struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long address, struct vme_dma_attr *attributes; struct vme_dma_vme *vme_attr; - attributes = kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes = kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; - vme_attr = kmalloc(sizeof(*vme_attr), GFP_KERNEL); + vme_attr = kmalloc_obj(*vme_attr, GFP_KERNEL); if (!vme_attr) goto err_vme; @@ -1233,7 +1233,7 @@ struct vme_error_handler *vme_register_error_handler(struct vme_bridge *bridge, { struct vme_error_handler *handler; - handler = kmalloc(sizeof(*handler), GFP_ATOMIC); + handler = kmalloc_obj(*handler, GFP_ATOMIC); if (!handler) return NULL; @@ -1458,7 +1458,7 @@ struct vme_resource *vme_lm_request(struct vme_dev *vdev) if (!allocated_lm) goto err_lm; - resource = kmalloc(sizeof(*resource), GFP_KERNEL); + resource = kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; @@ -1810,7 +1810,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv, struct vme_dev *tmp; for (i = 0; i < ndevs; i++) { - vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); + vdev = kzalloc_obj(*vdev, GFP_KERNEL); if (!vdev) { err = -ENOMEM; goto err_devalloc; diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c index 731fbba17dfd..77881a96114f 100644 --- a/drivers/staging/vme_user/vme_fake.c +++ b/drivers/staging/vme_user/vme_fake.c @@ -1073,13 +1073,13 @@ static int __init fake_init(void) /* If we want to support more than one bridge at some point, we need to * dynamically allocate this so we get one per device. */ - fake_bridge = kzalloc(sizeof(*fake_bridge), GFP_KERNEL); + fake_bridge = kzalloc_obj(*fake_bridge, GFP_KERNEL); if (!fake_bridge) { retval = -ENOMEM; goto err_struct; } - fake_device = kzalloc(sizeof(*fake_device), GFP_KERNEL); + fake_device = kzalloc_obj(*fake_device, GFP_KERNEL); if (!fake_device) { retval = -ENOMEM; goto err_driver; @@ -1102,7 +1102,7 @@ static int __init fake_init(void) /* Add master windows to list */ INIT_LIST_HEAD(&fake_bridge->master_resources); for (i = 0; i < FAKE_MAX_MASTER; i++) { - master_image = kmalloc(sizeof(*master_image), GFP_KERNEL); + master_image = kmalloc_obj(*master_image, GFP_KERNEL); if (!master_image) { retval = -ENOMEM; goto err_master; @@ -1128,7 +1128,7 @@ static int __init fake_init(void) /* Add slave windows to list */ INIT_LIST_HEAD(&fake_bridge->slave_resources); for (i = 0; i < FAKE_MAX_SLAVE; i++) { - slave_image = kmalloc(sizeof(*slave_image), GFP_KERNEL); + slave_image = kmalloc_obj(*slave_image, GFP_KERNEL); if (!slave_image) { retval = -ENOMEM; goto err_slave; @@ -1150,7 +1150,7 @@ static int __init fake_init(void) /* Add location monitor to list */ INIT_LIST_HEAD(&fake_bridge->lm_resources); - lm = kmalloc(sizeof(*lm), GFP_KERNEL); + lm = kmalloc_obj(*lm, GFP_KERNEL); if (!lm) { retval = -ENOMEM; goto err_lm; diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c index 733594dde9ae..123408fffb6f 100644 --- a/drivers/staging/vme_user/vme_tsi148.c +++ b/drivers/staging/vme_user/vme_tsi148.c @@ -1611,7 +1611,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *s tsi148_bridge = list->parent->parent; /* Descriptor must be aligned on 64-bit boundaries */ - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { retval = -ENOMEM; goto err_mem; @@ -2260,14 +2260,14 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* If we want to support more than one of each bridge, we need to * dynamically generate this so we get one per device */ - tsi148_bridge = kzalloc(sizeof(*tsi148_bridge), GFP_KERNEL); + tsi148_bridge = kzalloc_obj(*tsi148_bridge, GFP_KERNEL); if (!tsi148_bridge) { retval = -ENOMEM; goto err_struct; } vme_init_bridge(tsi148_bridge); - tsi148_device = kzalloc(sizeof(*tsi148_device), GFP_KERNEL); + tsi148_device = kzalloc_obj(*tsi148_device, GFP_KERNEL); if (!tsi148_device) { retval = -ENOMEM; goto err_driver; @@ -2332,9 +2332,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (err_chk) { master_num--; - tsi148_device->flush_image = - kmalloc(sizeof(*tsi148_device->flush_image), - GFP_KERNEL); + tsi148_device->flush_image = kmalloc_obj(*tsi148_device->flush_image, + GFP_KERNEL); if (!tsi148_device->flush_image) { retval = -ENOMEM; goto err_master; @@ -2350,7 +2349,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add master windows to list */ for (i = 0; i < master_num; i++) { - master_image = kmalloc(sizeof(*master_image), GFP_KERNEL); + master_image = kmalloc_obj(*master_image, GFP_KERNEL); if (!master_image) { retval = -ENOMEM; goto err_master; @@ -2376,7 +2375,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add slave windows to list */ for (i = 0; i < TSI148_MAX_SLAVE; i++) { - slave_image = kmalloc(sizeof(*slave_image), GFP_KERNEL); + slave_image = kmalloc_obj(*slave_image, GFP_KERNEL); if (!slave_image) { retval = -ENOMEM; goto err_slave; @@ -2397,7 +2396,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add dma engines to list */ for (i = 0; i < TSI148_MAX_DMA; i++) { - dma_ctrlr = kmalloc(sizeof(*dma_ctrlr), GFP_KERNEL); + dma_ctrlr = kmalloc_obj(*dma_ctrlr, GFP_KERNEL); if (!dma_ctrlr) { retval = -ENOMEM; goto err_dma; @@ -2417,7 +2416,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* Add location monitor to list */ - lm = kmalloc(sizeof(*lm), GFP_KERNEL); + lm = kmalloc_obj(*lm, GFP_KERNEL); if (!lm) { retval = -ENOMEM; goto err_lm; diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c index 2012cccd0d09..00da869a8056 100644 --- a/drivers/staging/vme_user/vme_user.c +++ b/drivers/staging/vme_user/vme_user.c @@ -464,7 +464,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) return err; } - vma_priv = kmalloc(sizeof(*vma_priv), GFP_KERNEL); + vma_priv = kmalloc_obj(*vma_priv, GFP_KERNEL); if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index d9204c590d9a..0aa4cb9e494e 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c @@ -79,7 +79,7 @@ static struct np_info * cxgbit_np_hash_add(struct cxgbit_device *cdev, struct cxgbit_np *cnp, unsigned int stid) { - struct np_info *p = kzalloc(sizeof(*p), GFP_KERNEL); + struct np_info *p = kzalloc_obj(*p, GFP_KERNEL); if (p) { int bucket = cxgbit_np_hashfn(cnp); @@ -431,7 +431,7 @@ int cxgbit_setup_np(struct iscsi_np *np, struct sockaddr_storage *ksockaddr) (ksockaddr->ss_family != AF_INET6)) return -EINVAL; - cnp = kzalloc(sizeof(*cnp), GFP_KERNEL); + cnp = kzalloc_obj(*cnp, GFP_KERNEL); if (!cnp) return -ENOMEM; @@ -1288,7 +1288,7 @@ cxgbit_pass_accept_req(struct cxgbit_device *cdev, struct sk_buff *skb) goto reject; } - csk = kzalloc(sizeof(*csk), GFP_ATOMIC); + csk = kzalloc_obj(*csk, GFP_ATOMIC); if (!csk) { dst_release(dst); goto rel_skb; diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c index 2c1950df3b3e..e1985e1187b0 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_main.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c @@ -57,7 +57,7 @@ static void *cxgbit_uld_add(const struct cxgb4_lld_info *lldi) if (is_t4(lldi->adapter_type)) return ERR_PTR(-ENODEV); - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return ERR_PTR(-ENOMEM); @@ -646,7 +646,7 @@ cxgbit_dcbevent_notify(struct notifier_block *nb, unsigned long action, struct cxgbit_dcb_work *dcb_work; struct dcb_app_type *dcb_app = data; - dcb_work = kzalloc(sizeof(*dcb_work), GFP_ATOMIC); + dcb_work = kzalloc_obj(*dcb_work, GFP_ATOMIC); if (!dcb_work) return NOTIFY_DONE; diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index a2dde08c8a62..6ff807754304 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -121,7 +121,7 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf) return ERR_PTR(-EINVAL); } - tiqn = kzalloc(sizeof(*tiqn), GFP_KERNEL); + tiqn = kzalloc_obj(*tiqn, GFP_KERNEL); if (!tiqn) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ struct iscsi_np *iscsit_add_np( return np; } - np = kzalloc(sizeof(*np), GFP_KERNEL); + np = kzalloc_obj(*np, GFP_KERNEL); if (!np) { mutex_unlock(&np_lock); return ERR_PTR(-ENOMEM); @@ -674,7 +674,7 @@ static int __init iscsi_target_init_module(void) int ret = 0, size; pr_debug("iSCSI-Target "ISCSIT_VERSION"\n"); - iscsit_global = kzalloc(sizeof(*iscsit_global), GFP_KERNEL); + iscsit_global = kzalloc_obj(*iscsit_global, GFP_KERNEL); if (!iscsit_global) return -1; @@ -981,7 +981,7 @@ static int iscsit_allocate_iovecs(struct iscsit_cmd *cmd) u32 iov_count = max(1UL, DIV_ROUND_UP(cmd->se_cmd.data_length, PAGE_SIZE)); iov_count += ISCSI_IOV_DATA_BUFFER; - cmd->iov_data = kcalloc(iov_count, sizeof(*cmd->iov_data), GFP_KERNEL); + cmd->iov_data = kzalloc_objs(*cmd->iov_data, iov_count, GFP_KERNEL); if (!cmd->iov_data) return -ENOMEM; @@ -1992,7 +1992,7 @@ iscsit_handle_task_mgt_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, hdr->refcmdsn = cpu_to_be32(ISCSI_RESERVED_TAG); cmd->data_direction = DMA_NONE; - cmd->tmr_req = kzalloc(sizeof(*cmd->tmr_req), GFP_KERNEL); + cmd->tmr_req = kzalloc_obj(*cmd->tmr_req, GFP_KERNEL); if (!cmd->tmr_req) { return iscsit_add_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index 2c4d583fe3e6..d6f3611c0d4b 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c @@ -152,7 +152,7 @@ static struct iscsi_chap *chap_server_open( return NULL; } - conn->auth_protocol = kzalloc(sizeof(struct iscsi_chap), GFP_KERNEL); + conn->auth_protocol = kzalloc_obj(struct iscsi_chap, GFP_KERNEL); if (!conn->auth_protocol) return NULL; diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index 56d78af7cec7..7e7193a40959 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c @@ -268,7 +268,7 @@ int iscsit_prepare_cmds_for_reallegiance(struct iscsit_conn *conn) * (struct iscsit_cmd->cr) so we need to allocate this before preparing the * connection's command list for connection recovery. */ - cr = kzalloc(sizeof(struct iscsi_conn_recovery), GFP_KERNEL); + cr = kzalloc_obj(struct iscsi_conn_recovery, GFP_KERNEL); if (!cr) { pr_err("Unable to allocate memory for" " struct iscsi_conn_recovery.\n"); diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 53aca059dc16..8a5a711b505b 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -38,7 +38,7 @@ static struct iscsi_login *iscsi_login_init_conn(struct iscsit_conn *conn) { struct iscsi_login *login; - login = kzalloc(sizeof(struct iscsi_login), GFP_KERNEL); + login = kzalloc_obj(struct iscsi_login, GFP_KERNEL); if (!login) { pr_err("Unable to allocate memory for struct iscsi_login.\n"); return NULL; @@ -219,7 +219,7 @@ static int iscsi_login_zero_tsih_s1( struct iscsi_login_req *pdu = (struct iscsi_login_req *)buf; int ret; - sess = kzalloc(sizeof(struct iscsit_session), GFP_KERNEL); + sess = kzalloc_obj(struct iscsit_session, GFP_KERNEL); if (!sess) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -267,7 +267,7 @@ static int iscsi_login_zero_tsih_s1( */ atomic_set(&sess->max_cmd_sn, be32_to_cpu(pdu->cmdsn)); - sess->sess_ops = kzalloc(sizeof(struct iscsi_sess_ops), GFP_KERNEL); + sess->sess_ops = kzalloc_obj(struct iscsi_sess_ops, GFP_KERNEL); if (!sess->sess_ops) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -1002,7 +1002,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) { struct iscsit_conn *conn; - conn = kzalloc(sizeof(struct iscsit_conn), GFP_KERNEL); + conn = kzalloc_obj(struct iscsit_conn, GFP_KERNEL); if (!conn) { pr_err("Could not allocate memory for new connection\n"); return NULL; @@ -1040,7 +1040,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) if (iscsit_conn_set_transport(conn, np->np_transport) < 0) goto free_conn; - conn->conn_ops = kzalloc(sizeof(struct iscsi_conn_ops), GFP_KERNEL); + conn->conn_ops = kzalloc_obj(struct iscsi_conn_ops, GFP_KERNEL); if (!conn->conn_ops) { pr_err("Unable to allocate memory for struct iscsi_conn_ops.\n"); goto put_transport; diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 1d4e1788e073..fce6c91ac157 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c @@ -73,7 +73,7 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para { struct iscsi_param *param = NULL; - param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL); + param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); if (!param) { pr_err("Unable to allocate memory for parameter.\n"); goto out; @@ -148,7 +148,7 @@ int iscsi_create_default_params(struct iscsi_param_list **param_list_ptr) struct iscsi_param *param = NULL; struct iscsi_param_list *pl; - pl = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); + pl = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); if (!pl) { pr_err("Unable to allocate memory for" " struct iscsi_param_list.\n"); @@ -519,7 +519,7 @@ int iscsi_copy_param_list( struct iscsi_param *new_param = NULL; struct iscsi_param_list *param_list = NULL; - param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); + param_list = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); if (!param_list) { pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); return -ENOMEM; @@ -535,7 +535,7 @@ int iscsi_copy_param_list( continue; } - new_param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL); + new_param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); if (!new_param) { pr_err("Unable to allocate memory for struct iscsi_param.\n"); goto err_out; @@ -670,7 +670,7 @@ static int iscsi_add_notunderstood_response( return -1; } - extra_response = kzalloc(sizeof(struct iscsi_extra_response), GFP_KERNEL); + extra_response = kzalloc_obj(struct iscsi_extra_response, GFP_KERNEL); if (!extra_response) { pr_err("Unable to allocate memory for" " struct iscsi_extra_response.\n"); diff --git a/drivers/target/iscsi/iscsi_target_seq_pdu_list.c b/drivers/target/iscsi/iscsi_target_seq_pdu_list.c index 66de2b8de463..75c37c8866c8 100644 --- a/drivers/target/iscsi/iscsi_target_seq_pdu_list.c +++ b/drivers/target/iscsi/iscsi_target_seq_pdu_list.c @@ -535,7 +535,7 @@ int iscsit_build_pdu_and_seq_lists( iscsit_determine_counts_for_list(cmd, &bl, &seq_count, &pdu_count); if (!conn->sess->sess_ops->DataSequenceInOrder) { - seq = kcalloc(seq_count, sizeof(struct iscsi_seq), GFP_ATOMIC); + seq = kzalloc_objs(struct iscsi_seq, seq_count, GFP_ATOMIC); if (!seq) { pr_err("Unable to allocate struct iscsi_seq list\n"); return -ENOMEM; @@ -545,7 +545,7 @@ int iscsit_build_pdu_and_seq_lists( } if (!conn->sess->sess_ops->DataPDUInOrder) { - pdu = kcalloc(pdu_count, sizeof(struct iscsi_pdu), GFP_ATOMIC); + pdu = kzalloc_objs(struct iscsi_pdu, pdu_count, GFP_ATOMIC); if (!pdu) { pr_err("Unable to allocate struct iscsi_pdu list.\n"); kfree(seq); diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index bf06cfdfb012..82463efca798 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -26,7 +26,7 @@ struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *tiqn, u1 { struct iscsi_portal_group *tpg; - tpg = kzalloc(sizeof(struct iscsi_portal_group), GFP_KERNEL); + tpg = kzalloc_obj(struct iscsi_portal_group, GFP_KERNEL); if (!tpg) { pr_err("Unable to allocate struct iscsi_portal_group\n"); return NULL; @@ -464,7 +464,7 @@ struct iscsi_tpg_np *iscsit_tpg_add_network_portal( } } - tpg_np = kzalloc(sizeof(struct iscsi_tpg_np), GFP_KERNEL); + tpg_np = kzalloc_obj(struct iscsi_tpg_np, GFP_KERNEL); if (!tpg_np) { pr_err("Unable to allocate memory for" " struct iscsi_tpg_np.\n"); diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 0821a149573e..94e191809e1c 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -693,7 +693,7 @@ static int tcm_loop_make_nexus( return -EEXIST; } - tl_nexus = kzalloc(sizeof(*tl_nexus), GFP_KERNEL); + tl_nexus = kzalloc_obj(*tl_nexus, GFP_KERNEL); if (!tl_nexus) return -ENOMEM; @@ -994,7 +994,7 @@ static struct se_wwn *tcm_loop_make_scsi_hba( char *ptr; int ret, off = 0; - tl_hba = kzalloc(sizeof(*tl_hba), GFP_KERNEL); + tl_hba = kzalloc_obj(*tl_hba, GFP_KERNEL); if (!tl_hba) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 09120a538a40..ef69c1321dd0 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -186,7 +186,7 @@ static struct sbp_session *sbp_session_create( snprintf(guid_str, sizeof(guid_str), "%016llx", guid); - sess = kmalloc(sizeof(*sess), GFP_KERNEL); + sess = kmalloc_obj(*sess, GFP_KERNEL); if (!sess) return ERR_PTR(-ENOMEM); @@ -391,7 +391,7 @@ static void sbp_management_request_login( 1 << LOGIN_ORB_RECONNECT(be32_to_cpu(req->orb.misc)), tport->max_reconnect_timeout) - 1; - login = kmalloc(sizeof(*login), GFP_KERNEL); + login = kmalloc_obj(*login, GFP_KERNEL); if (!login) { pr_err("failed to allocate login descriptor\n"); @@ -428,7 +428,7 @@ static void sbp_management_request_login( spin_unlock_bh(&sess->lock); already_logged_in: - response = kzalloc(sizeof(*response), GFP_KERNEL); + response = kzalloc_obj(*response, GFP_KERNEL); if (!response) { pr_err("failed to allocate login response block\n"); @@ -1014,7 +1014,7 @@ static struct sbp_target_agent *sbp_target_agent_register( struct sbp_target_agent *agent; int ret; - agent = kmalloc(sizeof(*agent), GFP_KERNEL); + agent = kmalloc_obj(*agent, GFP_KERNEL); if (!agent) return ERR_PTR(-ENOMEM); @@ -1603,7 +1603,7 @@ static void sbp_mgt_agent_rw(struct fw_card *card, rcode = RCODE_CONFLICT_ERROR; goto out; } - req = kzalloc(sizeof(*req), GFP_ATOMIC); + req = kzalloc_obj(*req, GFP_ATOMIC); if (!req) { rcode = RCODE_CONFLICT_ERROR; goto out; @@ -1636,7 +1636,7 @@ static struct sbp_management_agent *sbp_management_agent_register( int ret; struct sbp_management_agent *agent; - agent = kmalloc(sizeof(*agent), GFP_KERNEL); + agent = kmalloc_obj(*agent, GFP_KERNEL); if (!agent) return ERR_PTR(-ENOMEM); @@ -1973,7 +1973,7 @@ static struct se_portal_group *sbp_make_tpg(struct se_wwn *wwn, return ERR_PTR(-EBUSY); } - tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); + tpg = kzalloc_obj(*tpg, GFP_KERNEL); if (!tpg) return ERR_PTR(-ENOMEM); @@ -2030,7 +2030,7 @@ static struct se_wwn *sbp_make_tport( if (sbp_parse_wwn(name, &guid) < 0) return ERR_PTR(-EINVAL); - tport = kzalloc(sizeof(*tport), GFP_KERNEL); + tport = kzalloc_obj(*tport, GFP_KERNEL); if (!tport) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index b27a3b8dd767..a63de1b6c2b4 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -475,12 +475,12 @@ int target_register_template(const struct target_core_fabric_ops *fo) if (ret) return ret; - tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL); + tf = kzalloc_obj(struct target_fabric_configfs, GFP_KERNEL); if (!tf) { pr_err("%s: could not allocate memory!\n", __func__); return -ENOMEM; } - tfo = kzalloc(sizeof(struct target_core_fabric_ops), GFP_KERNEL); + tfo = kzalloc_obj(struct target_core_fabric_ops, GFP_KERNEL); if (!tfo) { kfree(tf); pr_err("%s: could not allocate memory!\n", __func__); diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 8ccb8541db1c..f082cbc79751 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -324,7 +324,7 @@ int core_enable_device_list_for_node( struct se_dev_entry *orig, *new; int ret = 0; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) { pr_err("Unable to allocate se_dev_entry memory\n"); return -ENOMEM; @@ -591,7 +591,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl( *ret = -EOVERFLOW; return NULL; } - lacl = kzalloc(sizeof(struct se_lun_acl), GFP_KERNEL); + lacl = kzalloc_obj(struct se_lun_acl, GFP_KERNEL); if (!lacl) { pr_err("Unable to allocate memory for struct se_lun_acl.\n"); *ret = -ENOMEM; @@ -726,7 +726,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) if (!dev->stats) goto free_device; - dev->queues = kcalloc(nr_cpu_ids, sizeof(*dev->queues), GFP_KERNEL); + dev->queues = kzalloc_objs(*dev->queues, nr_cpu_ids, GFP_KERNEL); if (!dev->queues) goto free_stats; diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 59713e9be10a..69590c570859 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -899,7 +899,7 @@ target_fabric_setup_tpg_base_cit(struct target_fabric_configfs *tf) nr_attrs++; /* + 1 for final NULL in the array */ - attrs = kcalloc(nr_attrs + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, nr_attrs + 1, GFP_KERNEL); if (!attrs) return -ENOMEM; diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index b2610073e8cc..5347800a276d 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -38,7 +38,7 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id) { struct fd_host *fd_host; - fd_host = kzalloc(sizeof(struct fd_host), GFP_KERNEL); + fd_host = kzalloc_obj(struct fd_host, GFP_KERNEL); if (!fd_host) { pr_err("Unable to allocate memory for struct fd_host\n"); return -ENOMEM; @@ -73,7 +73,7 @@ static struct se_device *fd_alloc_device(struct se_hba *hba, const char *name) struct fd_dev *fd_dev; struct fd_host *fd_host = hba->hba_ptr; - fd_dev = kzalloc(sizeof(struct fd_dev), GFP_KERNEL); + fd_dev = kzalloc_obj(struct fd_dev, GFP_KERNEL); if (!fd_dev) { pr_err("Unable to allocate memory for struct fd_dev\n"); return NULL; @@ -276,7 +276,7 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, ssize_t len = 0; int ret = 0, i; - aio_cmd = kmalloc(struct_size(aio_cmd, bvecs, sgl_nents), GFP_KERNEL); + aio_cmd = kmalloc_flex(*aio_cmd, bvecs, sgl_nents, GFP_KERNEL); if (!aio_cmd) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; @@ -320,7 +320,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd, loff_t pos = (cmd->t_task_lba * block_size); int ret = 0, i; - bvec = kcalloc(sgl_nents, sizeof(struct bio_vec), GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, sgl_nents, GFP_KERNEL); if (!bvec) { pr_err("Unable to allocate fd_do_readv iov[]\n"); return -ENOMEM; @@ -455,7 +455,7 @@ fd_execute_write_same(struct se_cmd *cmd) return TCM_INVALID_CDB_FIELD; } - bvec = kcalloc(nolb, sizeof(struct bio_vec), GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, nolb, GFP_KERNEL); if (!bvec) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; diff --git a/drivers/target/target_core_hba.c b/drivers/target/target_core_hba.c index d508b343ba7b..deafced2c804 100644 --- a/drivers/target/target_core_hba.c +++ b/drivers/target/target_core_hba.c @@ -39,7 +39,7 @@ int transport_backend_register(const struct target_backend_ops *ops) { struct target_backend *tb, *old; - tb = kzalloc(sizeof(*tb), GFP_KERNEL); + tb = kzalloc_obj(*tb, GFP_KERNEL); if (!tb) return -ENOMEM; tb->ops = ops; @@ -111,7 +111,7 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags) struct se_hba *hba; int ret = 0; - hba = kzalloc(sizeof(*hba), GFP_KERNEL); + hba = kzalloc_obj(*hba, GFP_KERNEL); if (!hba) { pr_err("Unable to allocate struct se_hba\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 8ec7b534ad76..8a333c9bd294 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -59,15 +59,15 @@ static struct se_device *iblock_alloc_device(struct se_hba *hba, const char *nam { struct iblock_dev *ib_dev = NULL; - ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL); + ib_dev = kzalloc_obj(struct iblock_dev, GFP_KERNEL); if (!ib_dev) { pr_err("Unable to allocate struct iblock_dev\n"); return NULL; } ib_dev->ibd_exclusive = true; - ib_dev->ibd_plug = kcalloc(nr_cpu_ids, sizeof(*ib_dev->ibd_plug), - GFP_KERNEL); + ib_dev->ibd_plug = kzalloc_objs(*ib_dev->ibd_plug, nr_cpu_ids, + GFP_KERNEL); if (!ib_dev->ibd_plug) goto free_dev; @@ -523,7 +523,7 @@ iblock_execute_write_same(struct se_cmd *cmd) return 0; } - ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); if (!ibr) goto fail; cmd->priv = ibr; @@ -783,7 +783,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, miter_dir = SG_MITER_FROM_SG; } - ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); if (!ibr) goto fail; cmd->priv = ibr; diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 83e172c92238..1272c24512fa 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -1490,7 +1490,7 @@ core_scsi3_decode_spec_i_port( * local_node_acl pointer and add to struct list_head tid_dest_list * for add registration processing in the loop of tid_dest_list below. */ - tidh_new = kzalloc(sizeof(struct pr_transport_id_holder), GFP_KERNEL); + tidh_new = kzalloc_obj(struct pr_transport_id_holder, GFP_KERNEL); if (!tidh_new) { pr_err("Unable to allocate tidh_new\n"); return TCM_INSUFFICIENT_REGISTRATION_RESOURCES; @@ -1712,8 +1712,8 @@ core_scsi3_decode_spec_i_port( * the dest_node_acl and dest_se_deve pointers for the * loop below. */ - tidh_new = kzalloc(sizeof(struct pr_transport_id_holder), - GFP_KERNEL); + tidh_new = kzalloc_obj(struct pr_transport_id_holder, + GFP_KERNEL); if (!tidh_new) { pr_err("Unable to allocate tidh_new\n"); core_scsi3_lunacl_undepend_item(dest_se_deve); diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 823b2665f95b..4f86030c9ad5 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -51,7 +51,7 @@ static int pscsi_attach_hba(struct se_hba *hba, u32 host_id) { struct pscsi_hba_virt *phv; - phv = kzalloc(sizeof(struct pscsi_hba_virt), GFP_KERNEL); + phv = kzalloc_obj(struct pscsi_hba_virt, GFP_KERNEL); if (!phv) { pr_err("Unable to allocate struct pscsi_hba_virt\n"); return -ENOMEM; @@ -247,7 +247,7 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, } pr_debug("T10 VPD Identifier Length: %d\n", ident_len); - vpd = kzalloc(sizeof(struct t10_vpd), GFP_KERNEL); + vpd = kzalloc_obj(struct t10_vpd, GFP_KERNEL); if (!vpd) { pr_err("Unable to allocate memory for" " struct t10_vpd\n"); @@ -334,7 +334,7 @@ static struct se_device *pscsi_alloc_device(struct se_hba *hba, { struct pscsi_dev_virt *pdv; - pdv = kzalloc(sizeof(struct pscsi_dev_virt), GFP_KERNEL); + pdv = kzalloc_obj(struct pscsi_dev_virt, GFP_KERNEL); if (!pdv) { pr_err("Unable to allocate memory for struct pscsi_dev_virt\n"); return NULL; diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c index 6f67cc09c2b5..90ee036ad5ce 100644 --- a/drivers/target/target_core_rd.c +++ b/drivers/target/target_core_rd.c @@ -34,7 +34,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id) { struct rd_host *rd_host; - rd_host = kzalloc(sizeof(*rd_host), GFP_KERNEL); + rd_host = kzalloc_obj(*rd_host, GFP_KERNEL); if (!rd_host) return -ENOMEM; @@ -131,8 +131,7 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table * if (sg_per_table < total_sg_needed) chain_entry = 1; - sg = kmalloc_array(sg_per_table + chain_entry, sizeof(*sg), - GFP_KERNEL); + sg = kmalloc_objs(*sg, sg_per_table + chain_entry, GFP_KERNEL); if (!sg) return -ENOMEM; @@ -192,7 +191,7 @@ static int rd_build_device_space(struct rd_dev *rd_dev) total_sg_needed = rd_dev->rd_page_count; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); if (!sg_table) return -ENOMEM; @@ -249,7 +248,7 @@ static int rd_build_prot_space(struct rd_dev *rd_dev, int prot_length, int block total_sg_needed = (rd_dev->rd_page_count * prot_length / block_size) + 1; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); if (!sg_table) return -ENOMEM; @@ -272,7 +271,7 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name) struct rd_dev *rd_dev; struct rd_host *rd_host = hba->hba_ptr; - rd_dev = kzalloc(sizeof(*rd_dev), GFP_KERNEL); + rd_dev = kzalloc_obj(*rd_dev, GFP_KERNEL); if (!rd_dev) return NULL; diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 4718db628222..db7388e207b2 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -31,7 +31,7 @@ int core_tmr_alloc_req( { struct se_tmr_req *tmr; - tmr = kzalloc(sizeof(struct se_tmr_req), gfp_flags); + tmr = kzalloc_obj(struct se_tmr_req, gfp_flags); if (!tmr) { pr_err("Unable to allocate struct se_tmr_req\n"); return -ENOMEM; diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 8b5ad50baa43..bb4eaace5e77 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -610,7 +610,7 @@ struct se_lun *core_tpg_alloc_lun( { struct se_lun *lun; - lun = kzalloc(sizeof(*lun), GFP_KERNEL); + lun = kzalloc_obj(*lun, GFP_KERNEL); if (!lun) { pr_err("Unable to allocate se_lun memory\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 50d21888a0c9..4b6899a729f7 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -233,7 +233,7 @@ struct target_cmd_counter *target_alloc_cmd_counter(void) struct target_cmd_counter *cmd_cnt; int rc; - cmd_cnt = kzalloc(sizeof(*cmd_cnt), GFP_KERNEL); + cmd_cnt = kzalloc_obj(*cmd_cnt, GFP_KERNEL); if (!cmd_cnt) return NULL; @@ -2740,7 +2740,7 @@ void *transport_kmap_data_sg(struct se_cmd *cmd) return kmap(sg_page(sg)) + sg->offset; /* >1 page. use vmap */ - pages = kmalloc_array(cmd->t_data_nents, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, cmd->t_data_nents, GFP_KERNEL); if (!pages) return NULL; diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 3fd963612775..062e93231794 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1293,7 +1293,7 @@ tcmu_tmr_notify(struct se_device *se_dev, enum tcm_tmreq_table tmf, pr_debug("TMR event %d on dev %s, aborted cmds %d, afflicted cmd_ids %d\n", tcmu_tmr_type(tmf), udev->name, i, cmd_cnt); - tmr = kmalloc(struct_size(tmr, tmr_cmd_ids, cmd_cnt), GFP_NOIO); + tmr = kmalloc_flex(*tmr, tmr_cmd_ids, cmd_cnt, GFP_NOIO); if (!tmr) goto unlock; @@ -1582,7 +1582,7 @@ static int tcmu_attach_hba(struct se_hba *hba, u32 host_id) { struct tcmu_hba *tcmu_hba; - tcmu_hba = kzalloc(sizeof(struct tcmu_hba), GFP_KERNEL); + tcmu_hba = kzalloc_obj(struct tcmu_hba, GFP_KERNEL); if (!tcmu_hba) return -ENOMEM; @@ -1602,7 +1602,7 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name) { struct tcmu_dev *udev; - udev = kzalloc(sizeof(struct tcmu_dev), GFP_KERNEL); + udev = kzalloc_obj(struct tcmu_dev, GFP_KERNEL); if (!udev) return NULL; kref_init(&udev->kref); diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 93534a6e14b7..2447b4abe2cf 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -898,7 +898,7 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) return TCM_PARAMETER_LIST_LENGTH_ERROR; } - xop = kzalloc(sizeof(struct xcopy_op), GFP_KERNEL); + xop = kzalloc_obj(struct xcopy_op, GFP_KERNEL); if (!xop) goto err; xop->xop_se_cmd = se_cmd; diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index a29b20b5f78e..7643503f739c 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c @@ -244,7 +244,7 @@ static struct se_portal_group *ft_add_tpg(struct se_wwn *wwn, const char *name) } ft_wwn = container_of(wwn, struct ft_lport_wwn, se_wwn); - tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); + tpg = kzalloc_obj(*tpg, GFP_KERNEL); if (!tpg) return NULL; tpg->index = index; @@ -334,7 +334,7 @@ static struct se_wwn *ft_add_wwn( pr_debug("add wwn %s\n", name); if (ft_parse_wwn(name, &wwpn, 1) < 0) return NULL; - ft_wwn = kzalloc(sizeof(*ft_wwn), GFP_KERNEL); + ft_wwn = kzalloc_obj(*ft_wwn, GFP_KERNEL); if (!ft_wwn) return NULL; ft_wwn->wwpn = wwpn; diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index d6afaba52ea5..584785ada9a6 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -59,7 +59,7 @@ static struct ft_tport *ft_tport_get(struct fc_lport *lport) return tport; } - tport = kzalloc(sizeof(*tport), GFP_KERNEL); + tport = kzalloc_obj(*tport, GFP_KERNEL); if (!tport) return NULL; @@ -219,7 +219,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id, if (sess->port_id == port_id) return sess; - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (!sess) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/tcm_remote/tcm_remote.c b/drivers/target/tcm_remote/tcm_remote.c index cb8db2558056..480efdccbf67 100644 --- a/drivers/target/tcm_remote/tcm_remote.c +++ b/drivers/target/tcm_remote/tcm_remote.c @@ -156,7 +156,7 @@ static struct se_wwn *tcm_remote_make_wwn( char *ptr; int ret, off = 0; - remote_hba = kzalloc(sizeof(*remote_hba), GFP_KERNEL); + remote_hba = kzalloc_obj(*remote_hba, GFP_KERNEL); if (!remote_hba) return ERR_PTR(-ENOMEM); diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c index 0629f277f7b4..0cdb255f4f13 100644 --- a/drivers/tc/tc.c +++ b/drivers/tc/tc.c @@ -82,7 +82,7 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus) goto out_err; /* Found a board, allocate it an entry in the list */ - tdev = kzalloc(sizeof(*tdev), GFP_KERNEL); + tdev = kzalloc_obj(*tdev, GFP_KERNEL); if (!tdev) { pr_err("tc%x: unable to allocate tc_dev\n", slot); goto out_err; diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c index 460b0c9e511f..3d25cee5c7d0 100644 --- a/drivers/tee/amdtee/call.c +++ b/drivers/tee/amdtee/call.c @@ -134,7 +134,7 @@ static u32 get_ta_refcount(u32 ta_handle) if (ta_data->ta_handle == ta_handle) return ++ta_data->refcount; - ta_data = kzalloc(sizeof(*ta_data), GFP_KERNEL); + ta_data = kzalloc_obj(*ta_data, GFP_KERNEL); if (ta_data) { ta_data->ta_handle = ta_handle; ta_data->refcount = 1; @@ -293,7 +293,7 @@ int handle_map_shmem(u32 count, struct shmem_desc *start, u32 *buf_id) if (!count || !start || !buf_id) return -EINVAL; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c index fb39d9a19c69..1ff4834722f7 100644 --- a/drivers/tee/amdtee/core.c +++ b/drivers/tee/amdtee/core.c @@ -38,7 +38,7 @@ static int amdtee_open(struct tee_context *ctx) { struct amdtee_context_data *ctxdata; - ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); if (!ctxdata) return -ENOMEM; @@ -122,7 +122,7 @@ static struct amdtee_session *alloc_session(struct amdtee_context_data *ctxdata, } /* Allocate a new session and add to list */ - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (sess) { sess->ta_handle = ta_handle; kref_init(&sess->refcount); @@ -351,7 +351,7 @@ int amdtee_map_shmem(struct tee_shm *shm) if (!shm) return -EINVAL; - shmnode = kmalloc(sizeof(*shmnode), GFP_KERNEL); + shmnode = kmalloc_obj(*shmnode, GFP_KERNEL); if (!shmnode) return -ENOMEM; @@ -465,11 +465,11 @@ static int __init amdtee_driver_init(void) return rc; } - drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL); + drv_data = kzalloc_obj(*drv_data, GFP_KERNEL); if (!drv_data) return -ENOMEM; - amdtee = kzalloc(sizeof(*amdtee), GFP_KERNEL); + amdtee = kzalloc_obj(*amdtee, GFP_KERNEL); if (!amdtee) { rc = -ENOMEM; goto err_kfree_drv_data; diff --git a/drivers/tee/amdtee/shm_pool.c b/drivers/tee/amdtee/shm_pool.c index 6346e0bc8a64..fcb0d5da4bfd 100644 --- a/drivers/tee/amdtee/shm_pool.c +++ b/drivers/tee/amdtee/shm_pool.c @@ -59,7 +59,7 @@ static const struct tee_shm_pool_ops pool_ops = { struct tee_shm_pool *amdtee_config_shm(void) { - struct tee_shm_pool *pool = kzalloc(sizeof(*pool), GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index 16eb953e14bb..5fa3edd9b233 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -293,7 +293,7 @@ struct optee_msg_arg *optee_get_msg_arg(struct tee_context *ctx, /* * No entry was found, let's allocate a new. */ - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { res = ERR_PTR(-ENOMEM); goto out; @@ -404,7 +404,7 @@ int optee_open_session(struct tee_context *ctx, if (rc) goto out; - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (!sess) { rc = -ENOMEM; goto out; diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 2d807bc748bc..ec07a8e1a585 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -125,7 +125,7 @@ int optee_open(struct tee_context *ctx, bool cap_memref_null) struct tee_device *teedev = ctx->teedev; struct optee *optee = tee_get_drvdata(teedev); - ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); if (!ctxdata) return -ENOMEM; diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c index 950b4661d5df..3f272c356ce4 100644 --- a/drivers/tee/optee/device.c +++ b/drivers/tee/optee/device.c @@ -81,7 +81,7 @@ static int optee_register_device(const uuid_t *device_uuid, u32 func) struct tee_client_device *optee_device = NULL; int rc; - optee_device = kzalloc(sizeof(*optee_device), GFP_KERNEL); + optee_device = kzalloc_obj(*optee_device, GFP_KERNEL); if (!optee_device) return -ENOMEM; diff --git a/drivers/tee/optee/ffa_abi.c b/drivers/tee/optee/ffa_abi.c index 8fc72aa95722..53ec3204b075 100644 --- a/drivers/tee/optee/ffa_abi.c +++ b/drivers/tee/optee/ffa_abi.c @@ -78,7 +78,7 @@ static int optee_shm_add_ffa_handle(struct optee *optee, struct tee_shm *shm, struct shm_rhash *r; int rc; - r = kmalloc(sizeof(*r), GFP_KERNEL); + r = kmalloc_obj(*r, GFP_KERNEL); if (!r) return -ENOMEM; r->shm = shm; @@ -404,7 +404,7 @@ static const struct tee_shm_pool_ops pool_ffa_ops = { */ static struct tee_shm_pool *optee_ffa_shm_pool_alloc_pages(void) { - struct tee_shm_pool *pool = kzalloc(sizeof(*pool), GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ static int optee_ffa_lend_protmem(struct optee *optee, struct tee_shm *protmem, unsigned int n; int rc; - mem_attr = kcalloc(ma_count, sizeof(*mem_attr), GFP_KERNEL); + mem_attr = kzalloc_objs(*mem_attr, ma_count, GFP_KERNEL); for (n = 0; n < ma_count; n++) { mem_attr[n].receiver = mem_attrs[n] & U16_MAX; mem_attr[n].attrs = mem_attrs[n] >> 16; @@ -1077,7 +1077,7 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev) if (sec_caps & OPTEE_FFA_SEC_CAP_ARG_OFFSET) arg_cache_flags |= OPTEE_SHM_ARG_SHARED; - optee = kzalloc(sizeof(*optee), GFP_KERNEL); + optee = kzalloc_obj(*optee, GFP_KERNEL); if (!optee) return -ENOMEM; diff --git a/drivers/tee/optee/notif.c b/drivers/tee/optee/notif.c index 1970880c796f..7ce65c8a07cf 100644 --- a/drivers/tee/optee/notif.c +++ b/drivers/tee/optee/notif.c @@ -38,7 +38,7 @@ int optee_notif_wait(struct optee *optee, u_int key, u32 timeout) if (key > optee->notif.max_key) return -EINVAL; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; init_completion(&entry->c); diff --git a/drivers/tee/optee/protmem.c b/drivers/tee/optee/protmem.c index 2eba48d5ac73..086df220f758 100644 --- a/drivers/tee/optee/protmem.c +++ b/drivers/tee/optee/protmem.c @@ -294,7 +294,7 @@ struct tee_protmem_pool *optee_protmem_alloc_dyn_pool(struct optee *optee, u_int pa_width; int rc; - rp = kzalloc(sizeof(*rp), GFP_KERNEL); + rp = kzalloc_obj(*rp, GFP_KERNEL); if (!rp) return ERR_PTR(-ENOMEM); rp->use_case = id; diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index 1758eb7e6e8b..ef80f668a6bc 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c @@ -55,8 +55,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, return; } - params = kmalloc_array(arg->num_params, sizeof(struct tee_param), - GFP_KERNEL); + params = kmalloc_objs(struct tee_param, arg->num_params, GFP_KERNEL); if (!params) { arg->ret = TEEC_ERROR_OUT_OF_MEMORY; return; @@ -192,8 +191,7 @@ static void handle_rpc_supp_cmd(struct tee_context *ctx, struct optee *optee, arg->ret_origin = TEEC_ORIGIN_COMMS; - params = kmalloc_array(arg->num_params, sizeof(struct tee_param), - GFP_KERNEL); + params = kmalloc_objs(struct tee_param, arg->num_params, GFP_KERNEL); if (!params) { arg->ret = TEEC_ERROR_OUT_OF_MEMORY; return; diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c index 51fae1ab8ef8..3d33b8d6af37 100644 --- a/drivers/tee/optee/smc_abi.c +++ b/drivers/tee/optee/smc_abi.c @@ -626,7 +626,7 @@ static const struct tee_shm_pool_ops pool_ops = { */ static struct tee_shm_pool *optee_shm_pool_alloc_pages(void) { - struct tee_shm_pool *pool = kzalloc(sizeof(*pool), GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); @@ -1816,7 +1816,7 @@ static int optee_probe(struct platform_device *pdev) if (IS_ERR(pool)) return PTR_ERR(pool); - optee = kzalloc(sizeof(*optee), GFP_KERNEL); + optee = kzalloc_obj(*optee, GFP_KERNEL); if (!optee) { rc = -ENOMEM; goto err_free_shm_pool; diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c index d0f397c90242..3562cb80a95a 100644 --- a/drivers/tee/optee/supp.c +++ b/drivers/tee/optee/supp.c @@ -89,7 +89,7 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, if (!supp->ctx && ctx->supp_nowait) return TEEC_ERROR_COMMUNICATION; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return TEEC_ERROR_OUT_OF_MEMORY; diff --git a/drivers/tee/qcomtee/call.c b/drivers/tee/qcomtee/call.c index 8f8830f0df26..cd138adb5e17 100644 --- a/drivers/tee/qcomtee/call.c +++ b/drivers/tee/qcomtee/call.c @@ -416,8 +416,9 @@ static int qcomtee_object_invoke(struct tee_context *ctx, return -ENOMEM; /* +1 for ending QCOMTEE_ARG_TYPE_INV. */ - struct qcomtee_arg *u __free(kfree) = kcalloc(arg->num_params + 1, sizeof(*u), - GFP_KERNEL); + struct qcomtee_arg *u __free(kfree) = kzalloc_objs(*u, + arg->num_params + 1, + GFP_KERNEL); if (!u) return -ENOMEM; @@ -562,8 +563,8 @@ static int qcomtee_supp_send(struct tee_context *ctx, u32 errno, u32 num_params, static int qcomtee_open(struct tee_context *ctx) { - struct qcomtee_context_data *ctxdata __free(kfree) = kzalloc(sizeof(*ctxdata), - GFP_KERNEL); + struct qcomtee_context_data *ctxdata __free(kfree) = kzalloc_obj(*ctxdata, + GFP_KERNEL); if (!ctxdata) return -ENOMEM; @@ -706,7 +707,7 @@ static int qcomtee_probe(struct platform_device *pdev) struct qcomtee *qcomtee; int err; - qcomtee = kzalloc(sizeof(*qcomtee), GFP_KERNEL); + qcomtee = kzalloc_obj(*qcomtee, GFP_KERNEL); if (!qcomtee) return -ENOMEM; diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c index ecd04403591c..ab477bbc8439 100644 --- a/drivers/tee/qcomtee/core.c +++ b/drivers/tee/qcomtee/core.c @@ -54,7 +54,7 @@ qcomtee_qtee_object_alloc(struct qcomtee_object_invoke_ctx *oic, struct qcomtee *qcomtee = tee_get_drvdata(oic->ctx->teedev); struct qcomtee_object *object; - object = kzalloc(sizeof(*object), GFP_KERNEL); + object = kzalloc_obj(*object, GFP_KERNEL); if (!object) return NULL_QCOMTEE_OBJECT; diff --git a/drivers/tee/qcomtee/mem_obj.c b/drivers/tee/qcomtee/mem_obj.c index a16f8fc39b8d..01bc8dcc22e7 100644 --- a/drivers/tee/qcomtee/mem_obj.c +++ b/drivers/tee/qcomtee/mem_obj.c @@ -91,8 +91,8 @@ int qcomtee_memobj_param_to_object(struct qcomtee_object **object, struct tee_shm *shm; int err; - struct qcomtee_mem_object *mem_object __free(kfree) = kzalloc(sizeof(*mem_object), - GFP_KERNEL); + struct qcomtee_mem_object *mem_object __free(kfree) = kzalloc_obj(*mem_object, + GFP_KERNEL); if (!mem_object) return -ENOMEM; diff --git a/drivers/tee/qcomtee/qcomtee_object.h b/drivers/tee/qcomtee/qcomtee_object.h index 5221449be7db..d763f90c62bb 100644 --- a/drivers/tee/qcomtee/qcomtee_object.h +++ b/drivers/tee/qcomtee/qcomtee_object.h @@ -176,7 +176,7 @@ qcomtee_object_invoke_ctx_alloc(struct tee_context *ctx) { struct qcomtee_object_invoke_ctx *oic; - oic = kzalloc(sizeof(*oic), GFP_KERNEL); + oic = kzalloc_obj(*oic, GFP_KERNEL); if (oic) oic->ctx = ctx; return oic; diff --git a/drivers/tee/qcomtee/shm.c b/drivers/tee/qcomtee/shm.c index 580bd25f98ed..7bef13767e25 100644 --- a/drivers/tee/qcomtee/shm.c +++ b/drivers/tee/qcomtee/shm.c @@ -140,7 +140,7 @@ struct tee_shm_pool *qcomtee_shm_pool_alloc(void) { struct tee_shm_pool *pool; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/qcomtee/user_obj.c b/drivers/tee/qcomtee/user_obj.c index 6aa3aefd67f0..d19c6589574a 100644 --- a/drivers/tee/qcomtee/user_obj.c +++ b/drivers/tee/qcomtee/user_obj.c @@ -326,7 +326,7 @@ static void qcomtee_user_object_release(struct qcomtee_object *object) if (!uo->notify) goto out_no_notify; - ureq = kzalloc(sizeof(*ureq), GFP_KERNEL); + ureq = kzalloc_obj(*ureq, GFP_KERNEL); if (!ureq) goto out_no_notify; @@ -370,7 +370,7 @@ int qcomtee_user_param_to_object(struct qcomtee_object **object, int err; struct qcomtee_user_object *user_object __free(kfree) = - kzalloc(sizeof(*user_object), GFP_KERNEL); + kzalloc_obj(*user_object, GFP_KERNEL); if (!user_object) return -ENOMEM; diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 6c49e2e383c6..29df8cd1efd2 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -51,7 +51,7 @@ struct tee_context *teedev_open(struct tee_device *teedev) if (!tee_device_get(teedev)) return ERR_PTR(-EINVAL); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto err; @@ -560,8 +560,8 @@ static int tee_ioctl_open_session(struct tee_context *ctx, return -EINVAL; if (arg.num_params) { - params = kcalloc(arg.num_params, sizeof(struct tee_param), - GFP_KERNEL); + params = kzalloc_objs(struct tee_param, arg.num_params, + GFP_KERNEL); if (!params) return -ENOMEM; uparams = uarg->params; @@ -638,8 +638,8 @@ static int tee_ioctl_invoke(struct tee_context *ctx, return -EINVAL; if (arg.num_params) { - params = kcalloc(arg.num_params, sizeof(struct tee_param), - GFP_KERNEL); + params = kzalloc_objs(struct tee_param, arg.num_params, + GFP_KERNEL); if (!params) return -ENOMEM; uparams = uarg->params; @@ -699,8 +699,8 @@ static int tee_ioctl_object_invoke(struct tee_context *ctx, return -EINVAL; if (arg.num_params) { - params = kcalloc(arg.num_params, sizeof(struct tee_param), - GFP_KERNEL); + params = kzalloc_objs(struct tee_param, arg.num_params, + GFP_KERNEL); if (!params) return -ENOMEM; uparams = uarg->params; @@ -844,7 +844,7 @@ static int tee_ioctl_supp_recv(struct tee_context *ctx, if (size_add(sizeof(*uarg), TEE_IOCTL_PARAM_SIZE(num_params)) != buf.buf_len) return -EINVAL; - params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL); + params = kzalloc_objs(struct tee_param, num_params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -958,7 +958,7 @@ static int tee_ioctl_supp_send(struct tee_context *ctx, if (size_add(sizeof(*uarg), TEE_IOCTL_PARAM_SIZE(num_params)) > buf.buf_len) return -EINVAL; - params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL); + params = kzalloc_objs(struct tee_param, num_params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -1052,7 +1052,7 @@ struct tee_device *tee_device_alloc(const struct tee_desc *teedesc, !teedesc->ops->release) return ERR_PTR(-EINVAL); - teedev = kzalloc(sizeof(*teedev), GFP_KERNEL); + teedev = kzalloc_obj(*teedev, GFP_KERNEL); if (!teedev) { ret = ERR_PTR(-ENOMEM); goto err; diff --git a/drivers/tee/tee_heap.c b/drivers/tee/tee_heap.c index d8d7735cdffb..71e50d9573c7 100644 --- a/drivers/tee/tee_heap.c +++ b/drivers/tee/tee_heap.c @@ -94,7 +94,7 @@ static int tee_heap_attach(struct dma_buf *dmabuf, struct tee_heap_attachment *a; int ret; - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) return -ENOMEM; @@ -188,7 +188,7 @@ static struct dma_buf *tee_dma_heap_alloc(struct dma_heap *heap, if (!teedev) return ERR_PTR(-EINVAL); - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) { dmabuf = ERR_PTR(-ENOMEM); goto err; @@ -260,7 +260,7 @@ static int alloc_dma_heap(struct tee_device *teedev, enum tee_dma_heap_id id, return -ENOMEM; } - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return -ENOMEM; h->id = id; @@ -472,7 +472,7 @@ struct tee_protmem_pool *tee_protmem_static_pool_alloc(phys_addr_t paddr, if (!pfn_valid(PHYS_PFN(paddr))) return ERR_PTR(-EINVAL); - stp = kzalloc(sizeof(*stp), GFP_KERNEL); + stp = kzalloc_obj(*stp, GFP_KERNEL); if (!stp) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index 4a47de4bb2e5..1ed278fc9e4a 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -106,7 +106,7 @@ static struct tee_shm *shm_alloc_helper(struct tee_context *ctx, size_t size, goto err_dev_put; } - shm = kzalloc(sizeof(*shm), GFP_KERNEL); + shm = kzalloc_obj(*shm, GFP_KERNEL); if (!shm) { ret = ERR_PTR(-ENOMEM); goto err_dev_put; @@ -214,7 +214,7 @@ struct tee_shm *tee_shm_register_fd(struct tee_context *ctx, int fd) teedev_ctx_get(ctx); - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) { rc = -ENOMEM; goto err_put_tee; @@ -315,7 +315,7 @@ struct tee_shm *tee_shm_alloc_dma_mem(struct tee_context *ctx, if (!page) goto err_put_teedev; - dma_mem = kzalloc(sizeof(*dma_mem), GFP_KERNEL); + dma_mem = kzalloc_obj(*dma_mem, GFP_KERNEL); if (!dma_mem) goto err_free_pages; @@ -373,7 +373,7 @@ int tee_dyn_shm_alloc_helper(struct tee_shm *shm, size_t size, size_t align, shm->paddr = virt_to_phys(shm->kaddr); shm->size = nr_pages * PAGE_SIZE; - pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); if (!pages) { rc = -ENOMEM; goto err_pages; @@ -438,7 +438,7 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags, teedev_ctx_get(ctx); - shm = kzalloc(sizeof(*shm), GFP_KERNEL); + shm = kzalloc_obj(*shm, GFP_KERNEL); if (!shm) { ret = ERR_PTR(-ENOMEM); goto err_ctx_put; @@ -456,7 +456,7 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags, goto err_ctx_put; } - shm->pages = kcalloc(num_pages, sizeof(*shm->pages), GFP_KERNEL); + shm->pages = kzalloc_objs(*shm->pages, num_pages, GFP_KERNEL); if (!shm->pages) { ret = ERR_PTR(-ENOMEM); goto err_free_shm; diff --git a/drivers/tee/tee_shm_pool.c b/drivers/tee/tee_shm_pool.c index 80004b55628d..fc82c689c29e 100644 --- a/drivers/tee/tee_shm_pool.c +++ b/drivers/tee/tee_shm_pool.c @@ -65,7 +65,7 @@ struct tee_shm_pool *tee_shm_pool_alloc_res_mem(unsigned long vaddr, if (vaddr & page_mask || paddr & page_mask || size & page_mask) return ERR_PTR(-EINVAL); - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/tstee/core.c b/drivers/tee/tstee/core.c index 533425e9e9e7..4a4aa2bc5ab6 100644 --- a/drivers/tee/tstee/core.c +++ b/drivers/tee/tstee/core.c @@ -59,7 +59,7 @@ static int tstee_open(struct tee_context *ctx) { struct ts_context_data *ctxdata; - ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); if (!ctxdata) return -ENOMEM; @@ -122,7 +122,7 @@ static int tstee_open_session(struct tee_context *ctx, if (ffa_args[TS_RPC_SERVICE_INFO_IFACE] > U8_MAX) return -EINVAL; - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (!sess) return -ENOMEM; @@ -376,7 +376,7 @@ static const struct tee_shm_pool_ops pool_ops = { static struct tee_shm_pool *tstee_create_shm_pool(void) { - struct tee_shm_pool *pool = kzalloc(sizeof(*pool), GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); @@ -414,7 +414,7 @@ static int tstee_probe(struct ffa_device *ffa_dev) if (!tstee_check_rpc_compatible(ffa_dev)) return -EINVAL; - tstee = kzalloc(sizeof(*tstee), GFP_KERNEL); + tstee = kzalloc_obj(*tstee, GFP_KERNEL); if (!tstee) return -ENOMEM; diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index 6b7ab1814c12..d0bb782ff734 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -371,9 +371,8 @@ static int allocate_idle_time(struct cpufreq_cooling_device *cpufreq_cdev) { unsigned int num_cpus = cpumask_weight(cpufreq_cdev->policy->related_cpus); - cpufreq_cdev->idle_time = kcalloc(num_cpus, - sizeof(*cpufreq_cdev->idle_time), - GFP_KERNEL); + cpufreq_cdev->idle_time = kzalloc_objs(*cpufreq_cdev->idle_time, + num_cpus, GFP_KERNEL); if (!cpufreq_cdev->idle_time) return -ENOMEM; @@ -543,7 +542,7 @@ __cpufreq_cooling_register(struct device_node *np, return ERR_PTR(-ENODEV); } - cpufreq_cdev = kzalloc(sizeof(*cpufreq_cdev), GFP_KERNEL); + cpufreq_cdev = kzalloc_obj(*cpufreq_cdev, GFP_KERNEL); if (!cpufreq_cdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/cpuidle_cooling.c b/drivers/thermal/cpuidle_cooling.c index f678c1281862..5a16d4e7e698 100644 --- a/drivers/thermal/cpuidle_cooling.c +++ b/drivers/thermal/cpuidle_cooling.c @@ -179,7 +179,7 @@ static int __cpuidle_cooling_register(struct device_node *np, char *name; int ret; - idle_cdev = kzalloc(sizeof(*idle_cdev), GFP_KERNEL); + idle_cdev = kzalloc_obj(*idle_cdev, GFP_KERNEL); if (!idle_cdev) { ret = -ENOMEM; goto out; diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index 8fd7cf1932cd..72fb23de5f55 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -402,7 +402,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, int err, num_opps; - dfc = kzalloc(sizeof(*dfc), GFP_KERNEL); + dfc = kzalloc_obj(*dfc, GFP_KERNEL); if (!dfc) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 0d9f636c80f4..696932ecb489 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -622,8 +622,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params, goto clean_state; } - params->power = kcalloc(num_actors, sizeof(struct power_actor), - GFP_KERNEL); + params->power = kzalloc_objs(struct power_actor, num_actors, GFP_KERNEL); if (!params->power) { ret = -ENOMEM; goto clean_state; @@ -699,7 +698,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) struct power_allocator_params *params; int ret; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -720,7 +719,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) } if (!tz->tzp) { - tz->tzp = kzalloc(sizeof(*tz->tzp), GFP_KERNEL); + tz->tzp = kzalloc_obj(*tz->tzp, GFP_KERNEL); if (!tz->tzp) { ret = -ENOMEM; goto free_params; diff --git a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c index ce5d53be108b..d1876e76167a 100644 --- a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c @@ -89,7 +89,7 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp, } *trt_count = p->package.count; - trts = kcalloc(*trt_count, sizeof(struct trt), GFP_KERNEL); + trts = kzalloc_objs(struct trt, *trt_count, GFP_KERNEL); if (!trts) { result = -ENOMEM; goto end; @@ -165,7 +165,7 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp, /* ignore p->package.elements[0], as this is _ART Revision field */ *art_count = p->package.count - 1; - arts = kcalloc(*art_count, sizeof(struct art), GFP_KERNEL); + arts = kzalloc_objs(struct art, *art_count, GFP_KERNEL); if (!arts) { result = -ENOMEM; goto end; @@ -253,7 +253,7 @@ static int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **ps goto end; } - psvts = kcalloc(*psvt_count, sizeof(*psvts), GFP_KERNEL); + psvts = kzalloc_objs(*psvts, *psvt_count, GFP_KERNEL); if (!psvts) { result = -ENOMEM; goto end; diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 41d3bc3ed8a2..3a97718e2f5c 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -382,8 +382,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv) if (priv->odvp == NULL) { priv->odvp_count = obj->package.count; - priv->odvp = kmalloc_array(priv->odvp_count, sizeof(int), - GFP_KERNEL); + priv->odvp = kmalloc_objs(int, priv->odvp_count, GFP_KERNEL); if (!priv->odvp) { ret = -ENOMEM; goto out_err; @@ -391,9 +390,8 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv) } if (priv->odvp_attrs == NULL) { - priv->odvp_attrs = kcalloc(priv->odvp_count, - sizeof(struct odvp_attr), - GFP_KERNEL); + priv->odvp_attrs = kzalloc_objs(struct odvp_attr, + priv->odvp_count, GFP_KERNEL); if (!priv->odvp_attrs) { ret = -ENOMEM; goto out_err; @@ -563,7 +561,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) if (!adev) return -ENODEV; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index 3d9efe69d562..7db8fd86c4fd 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -123,7 +123,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, acpi_status status; int i, ret; - int34x_zone = kzalloc(sizeof(*int34x_zone), GFP_KERNEL); + int34x_zone = kzalloc_obj(*int34x_zone, GFP_KERNEL); if (!int34x_zone) return ERR_PTR(-ENOMEM); @@ -133,8 +133,9 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, if (ACPI_SUCCESS(status)) int34x_zone->aux_trip_nr = trip_cnt; - zone_trips = kcalloc(trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT, - sizeof(*zone_trips), GFP_KERNEL); + zone_trips = kzalloc_objs(*zone_trips, + trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT, + GFP_KERNEL); if (!zone_trips) { ret = -ENOMEM; goto err_trips_alloc; diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index 8a2f441cd2ec..5100ad1336ed 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -212,7 +212,7 @@ static void update_capabilities(struct hfi_instance *hfi_instance) if (!cpu_count) goto out; - cpu_caps = kcalloc(cpu_count, sizeof(*cpu_caps), GFP_KERNEL); + cpu_caps = kzalloc_objs(*cpu_caps, cpu_count, GFP_KERNEL); if (!cpu_caps) goto out; @@ -690,8 +690,8 @@ void __init intel_hfi_init(void) * This allocation may fail. CPU hotplug callbacks must check * for a null pointer. */ - hfi_instances = kcalloc(max_hfi_instances, sizeof(*hfi_instances), - GFP_KERNEL); + hfi_instances = kzalloc_objs(*hfi_instances, max_hfi_instances, + GFP_KERNEL); if (!hfi_instances) return; diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c index 89498eb29a89..38a0ae14b69d 100644 --- a/drivers/thermal/intel/intel_quark_dts_thermal.c +++ b/drivers/thermal/intel/intel_quark_dts_thermal.c @@ -336,7 +336,7 @@ static struct soc_sensor_entry *alloc_soc_dts(void) int err; u32 out; - aux_entry = kzalloc(sizeof(*aux_entry), GFP_KERNEL); + aux_entry = kzalloc_obj(*aux_entry, GFP_KERNEL); if (!aux_entry) { err = -ENOMEM; return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index ea87439fe7a9..78123107ac06 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -320,7 +320,7 @@ intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type, if (tj_max < 0) return ERR_PTR(tj_max); - sensors = kzalloc(sizeof(*sensors), GFP_KERNEL); + sensors = kzalloc_obj(*sensors, GFP_KERNEL); if (!sensors) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c index aab5f9fca9c3..64cc0361d440 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -335,7 +335,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) return tj_max; tj_max *= 1000; - zonedev = kzalloc(sizeof(*zonedev), GFP_KERNEL); + zonedev = kzalloc_obj(*zonedev, GFP_KERNEL); if (!zonedev) return -ENOMEM; @@ -492,8 +492,7 @@ static int __init pkg_temp_thermal_init(void) return -ENODEV; max_id = topology_max_packages() * topology_max_dies_per_package(); - zones = kcalloc(max_id, sizeof(struct zone_device *), - GFP_KERNEL); + zones = kzalloc_objs(struct zone_device *, max_id, GFP_KERNEL); if (!zones) return -ENOMEM; diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index d9ec3bf19496..138a8137f790 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -462,7 +462,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) goto err_alloc; } - ref_table = kcalloc(TABLE_SIZE, sizeof(*ref_table), GFP_KERNEL); + ref_table = kzalloc_objs(*ref_table, TABLE_SIZE, GFP_KERNEL); if (!ref_table) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/thermal/testing/zone.c b/drivers/thermal/testing/zone.c index c12c405225bb..014e6e5f0e83 100644 --- a/drivers/thermal/testing/zone.c +++ b/drivers/thermal/testing/zone.c @@ -186,12 +186,13 @@ int tt_add_tz(void) { int ret; - struct tt_thermal_zone *tt_zone __free(kfree) = kzalloc(sizeof(*tt_zone), - GFP_KERNEL); + struct tt_thermal_zone *tt_zone __free(kfree) = kzalloc_obj(*tt_zone, + GFP_KERNEL); if (!tt_zone) return -ENOMEM; - struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL); + struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work, + GFP_KERNEL); if (!tt_work) return -ENOMEM; @@ -244,7 +245,8 @@ int tt_del_tz(const char *arg) if (ret != 1) return -EINVAL; - struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL); + struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work, + GFP_KERNEL); if (!tt_work) return -ENOMEM; @@ -330,11 +332,13 @@ int tt_zone_add_trip(const char *arg) { int id; - struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL); + struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work, + GFP_KERNEL); if (!tt_work) return -ENOMEM; - struct tt_trip *tt_trip __free(kfree) = kzalloc(sizeof(*tt_trip), GFP_KERNEL); + struct tt_trip *tt_trip __free(kfree) = kzalloc_obj(*tt_trip, + GFP_KERNEL); if (!tt_trip) return -ENOMEM; @@ -391,8 +395,9 @@ static int tt_zone_register_tz(struct tt_thermal_zone *tt_zone) if (tt_zone->tz) return -EINVAL; - struct thermal_trip *trips __free(kfree) = kcalloc(tt_zone->num_trips, - sizeof(*trips), GFP_KERNEL); + struct thermal_trip *trips __free(kfree) = kzalloc_objs(*trips, + tt_zone->num_trips, + GFP_KERNEL); if (!trips) return -ENOMEM; diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index dc9f7416f7ff..daaba832b2a0 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -844,7 +844,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz, if (cool_spec->lower > cool_spec->upper || cool_spec->upper > cdev->max_state) return -EINVAL; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; @@ -1070,7 +1070,7 @@ __thermal_cooling_device_register(struct device_node *np, if (!thermal_class) return ERR_PTR(-ENODEV); - cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return ERR_PTR(-ENOMEM); @@ -1542,7 +1542,7 @@ thermal_zone_device_register_with_trips(const char *type, if (!thermal_class) return ERR_PTR(-ENODEV); - tz = kzalloc(struct_size(tz, trips, num_trips), GFP_KERNEL); + tz = kzalloc_flex(*tz, trips, num_trips, GFP_KERNEL); if (!tz) return ERR_PTR(-ENOMEM); @@ -1899,7 +1899,7 @@ static int __init thermal_init(void) if (result) goto unregister_netlink; - thermal_class = kzalloc(sizeof(*thermal_class), GFP_KERNEL); + thermal_class = kzalloc_obj(*thermal_class, GFP_KERNEL); if (!thermal_class) { result = -ENOMEM; goto unregister_governors; diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index 11668f5b3c28..19b050cb4f70 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -193,7 +193,7 @@ static struct thermal_debugfs *thermal_debugfs_add_id(struct dentry *d, int id) struct thermal_debugfs *thermal_dbg; char ids[IDSLENGTH]; - thermal_dbg = kzalloc(sizeof(*thermal_dbg), GFP_KERNEL); + thermal_dbg = kzalloc_obj(*thermal_dbg, GFP_KERNEL); if (!thermal_dbg) return NULL; @@ -226,7 +226,7 @@ thermal_debugfs_cdev_record_alloc(struct thermal_debugfs *thermal_dbg, { struct cdev_record *cdev_record; - cdev_record = kzalloc(sizeof(*cdev_record), GFP_KERNEL); + cdev_record = kzalloc_obj(*cdev_record, GFP_KERNEL); if (!cdev_record) return NULL; @@ -559,7 +559,7 @@ static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_dev struct tz_episode *tze; int i; - tze = kzalloc(struct_size(tze, trip_stats, tz->num_trips), GFP_KERNEL); + tze = kzalloc_flex(*tze, trip_stats, tz->num_trips, GFP_KERNEL); if (!tze) return NULL; @@ -876,7 +876,7 @@ void thermal_debug_tz_add(struct thermal_zone_device *tz) tz_dbg->tz = tz; - tz_dbg->trips_crossed = kcalloc(tz->num_trips, sizeof(int), GFP_KERNEL); + tz_dbg->trips_crossed = kzalloc_objs(int, tz->num_trips, GFP_KERNEL); if (!tz_dbg->trips_crossed) { thermal_debugfs_remove_id(thermal_dbg); return; diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index faf1d0083890..f377175b2663 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -145,7 +145,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) goto register_sys_interface; } - hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); + hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); if (!hwmon) return -ENOMEM; @@ -160,7 +160,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) } register_sys_interface: - temp = kzalloc(sizeof(*temp), GFP_KERNEL); + temp = kzalloc_obj(*temp, GFP_KERNEL); if (!temp) { result = -ENOMEM; goto unregister_name; diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index b6d0c92f5522..085a414d874b 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -107,7 +107,8 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *n if (!count) return NULL; - struct thermal_trip *tt __free(kfree) = kcalloc(count, sizeof(*tt), GFP_KERNEL); + struct thermal_trip *tt __free(kfree) = kzalloc_objs(*tt, count, + GFP_KERNEL); if (!tt) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 2538c2dcf6a9..057460b2e7bb 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -392,7 +392,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz) struct attribute **attrs; int i; - attrs = kcalloc(tz->num_trips * 3 + 1, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, tz->num_trips * 3 + 1, GFP_KERNEL); if (!attrs) return -ENOMEM; @@ -465,7 +465,7 @@ int thermal_zone_create_device_groups(struct thermal_zone_device *tz) /* we need one extra for trips and the NULL to terminate the array */ size = ARRAY_SIZE(thermal_zone_attribute_groups) + 2; /* This also takes care of API requirement to be NULL terminated */ - groups = kcalloc(size, sizeof(*groups), GFP_KERNEL); + groups = kzalloc_objs(*groups, size, GFP_KERNEL); if (!groups) return -ENOMEM; diff --git a/drivers/thermal/thermal_thresholds.c b/drivers/thermal/thermal_thresholds.c index 38f5fd0e8930..421ddf907b6d 100644 --- a/drivers/thermal/thermal_thresholds.c +++ b/drivers/thermal/thermal_thresholds.c @@ -181,7 +181,7 @@ int thermal_thresholds_add(struct thermal_zone_device *tz, t->direction |= direction; } else { - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) return -ENOMEM; diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index d7a535671404..3108727c4ef2 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -89,7 +89,7 @@ struct tb_cfg_request *tb_cfg_request_alloc(void) { struct tb_cfg_request *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; @@ -333,7 +333,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg) static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl) { - struct ctl_pkg *pkg = kzalloc(sizeof(*pkg), GFP_KERNEL); + struct ctl_pkg *pkg = kzalloc_obj(*pkg, GFP_KERNEL); if (!pkg) return NULL; pkg->ctl = ctl; @@ -654,7 +654,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, int index, int timeout_msec, event_cb cb, void *cb_data) { int i; - struct tb_ctl *ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + struct tb_ctl *ctl = kzalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return NULL; diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index 45266ec72f88..7e2a59dddbbd 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -1657,7 +1657,7 @@ static struct tb_margining *margining_alloc(struct tb_port *port, return NULL; } - margining = kzalloc(sizeof(*margining), GFP_KERNEL); + margining = kzalloc_obj(*margining, GFP_KERNEL); if (!margining) return NULL; diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c index dc8ea188a114..ddbf5f9971fb 100644 --- a/drivers/thunderbolt/dma_port.c +++ b/drivers/thunderbolt/dma_port.c @@ -209,7 +209,7 @@ struct tb_dma_port *dma_port_alloc(struct tb_switch *sw) if (port < 0) return NULL; - dma = kzalloc(sizeof(*dma), GFP_KERNEL); + dma = kzalloc_obj(*dma, GFP_KERNEL); if (!dma) return NULL; diff --git a/drivers/thunderbolt/dma_test.c b/drivers/thunderbolt/dma_test.c index 9e47a63f28e7..8298f25ef6bd 100644 --- a/drivers/thunderbolt/dma_test.c +++ b/drivers/thunderbolt/dma_test.c @@ -267,7 +267,7 @@ static int dma_test_submit_rx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc(sizeof(*tf), GFP_KERNEL); + tf = kzalloc_obj(*tf, GFP_KERNEL); if (!tf) return -ENOMEM; @@ -318,7 +318,7 @@ static int dma_test_submit_tx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc(sizeof(*tf), GFP_KERNEL); + tf = kzalloc_obj(*tf, GFP_KERNEL); if (!tf) return -ENOMEM; diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 3ced37b4a869..1e7268e26fc2 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -126,7 +126,7 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr, ssize_t ret; int i; - uuids = kcalloc(tb->nboot_acl, sizeof(uuid_t), GFP_KERNEL); + uuids = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); if (!uuids) return -ENOMEM; @@ -181,7 +181,7 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr, if (!str) return -ENOMEM; - acl = kcalloc(tb->nboot_acl, sizeof(uuid_t), GFP_KERNEL); + acl = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); if (!acl) { ret = -ENOMEM; goto err_free_str; diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index d339ba835376..fda1471c7ef8 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -427,7 +427,7 @@ static int icm_fr_get_route(struct tb *tb, u8 link, u8 depth, u64 *route) int ret, index; u8 i; - switches = kcalloc(npackets, sizeof(*switches), GFP_KERNEL); + switches = kzalloc_objs(*switches, npackets, GFP_KERNEL); if (!switches) return -ENOMEM; @@ -1769,7 +1769,7 @@ static void icm_handle_event(struct tb *tb, enum tb_cfg_pkg_type type, { struct icm_notification *n; - n = kmalloc(sizeof(*n), GFP_KERNEL); + n = kmalloc_obj(*n, GFP_KERNEL); if (!n) return; @@ -2246,7 +2246,7 @@ static int icm_usb4_switch_nvm_authenticate(struct tb *tb, u64 route) struct tb_cfg_request *req; int ret; - auth = kzalloc(sizeof(*auth), GFP_KERNEL); + auth = kzalloc_obj(*auth, GFP_KERNEL); if (!auth) return -ENOMEM; diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 6d0c9d37c55d..6431c411fb17 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -587,7 +587,7 @@ static struct tb_ring *tb_ring_alloc(struct tb_nhi *nhi, u32 hop, int size, dev_dbg(&nhi->pdev->dev, "allocating %s ring %d of size %d\n", transmit ? "TX" : "RX", hop, size); - ring = kzalloc(sizeof(*ring), GFP_KERNEL); + ring = kzalloc_obj(*ring, GFP_KERNEL); if (!ring) return NULL; diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index 6901058b7ac0..ac9c5504cfc1 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -330,7 +330,7 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev) return ERR_PTR(-EOPNOTSUPP); } - nvm = kzalloc(sizeof(*nvm), GFP_KERNEL); + nvm = kzalloc_obj(*nvm, GFP_KERNEL); if (!nvm) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c index 50659bd55d7b..88311c6e599b 100644 --- a/drivers/thunderbolt/path.c +++ b/drivers/thunderbolt/path.c @@ -150,7 +150,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, num_hops++; } - path = kzalloc(sizeof(*path), GFP_KERNEL); + path = kzalloc_obj(*path, GFP_KERNEL); if (!path) return NULL; @@ -160,7 +160,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, path->activated = true; path->alloc_hopid = alloc_hopid; - path->hops = kcalloc(num_hops, sizeof(*path->hops), GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); if (!path->hops) { kfree(path); return NULL; @@ -245,7 +245,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, size_t num_hops; int i, ret; - path = kzalloc(sizeof(*path), GFP_KERNEL); + path = kzalloc_obj(*path, GFP_KERNEL); if (!path) return NULL; @@ -267,7 +267,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, /* Each hop takes two ports */ num_hops = i / 2; - path->hops = kcalloc(num_hops, sizeof(*path->hops), GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); if (!path->hops) { kfree(path); return NULL; diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index 31aa0516932a..a274c02d71c0 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -81,7 +81,7 @@ tb_property_alloc(const char *key, enum tb_property_type type) { struct tb_property *property; - property = kzalloc(sizeof(*property), GFP_KERNEL); + property = kzalloc_obj(*property, GFP_KERNEL); if (!property) return NULL; @@ -166,7 +166,7 @@ static struct tb_property_dir *__tb_property_parse_dir(const u32 *block, unsigned int content_offset; struct tb_property_dir *dir; - dir = kzalloc(sizeof(*dir), GFP_KERNEL); + dir = kzalloc_obj(*dir, GFP_KERNEL); if (!dir) return NULL; @@ -247,7 +247,7 @@ struct tb_property_dir *tb_property_create_dir(const uuid_t *uuid) { struct tb_property_dir *dir; - dir = kzalloc(sizeof(*dir), GFP_KERNEL); + dir = kzalloc_obj(*dir, GFP_KERNEL); if (!dir) return NULL; diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index 13d64dbd2bc5..b95f5c19cca5 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -410,7 +410,7 @@ static int tb_retimer_add(struct tb_port *port, u8 index, u32 auth_status, } - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) return -ENOMEM; diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index e2732c575bad..90d62141ecd8 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -69,7 +69,7 @@ static void nvm_set_auth_status(const struct tb_switch *sw, u32 status) st = __nvm_get_auth_status(sw); if (!st) { - st = kzalloc(sizeof(*st), GFP_KERNEL); + st = kzalloc_obj(*st, GFP_KERNEL); if (!st) goto unlock; @@ -2475,7 +2475,7 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, if (upstream_port < 0) return ERR_PTR(upstream_port); - sw = kzalloc(sizeof(*sw), GFP_KERNEL); + sw = kzalloc_obj(*sw, GFP_KERNEL); if (!sw) return ERR_PTR(-ENOMEM); @@ -2503,8 +2503,8 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, } /* initialize ports */ - sw->ports = kcalloc(sw->config.max_port_number + 1, sizeof(*sw->ports), - GFP_KERNEL); + sw->ports = kzalloc_objs(*sw->ports, sw->config.max_port_number + 1, + GFP_KERNEL); if (!sw->ports) { ret = -ENOMEM; goto err_free_sw_ports; @@ -2577,7 +2577,7 @@ tb_switch_alloc_safe_mode(struct tb *tb, struct device *parent, u64 route) { struct tb_switch *sw; - sw = kzalloc(sizeof(*sw), GFP_KERNEL); + sw = kzalloc_obj(*sw, GFP_KERNEL); if (!sw) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 4f5f1dfc0fbf..4c3b2d48c4a0 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -94,7 +94,7 @@ static void tb_queue_hotplug(struct tb *tb, u64 route, u8 port, bool unplug) { struct tb_hotplug_event *ev; - ev = kmalloc(sizeof(*ev), GFP_KERNEL); + ev = kmalloc_obj(*ev, GFP_KERNEL); if (!ev) return; @@ -2862,7 +2862,7 @@ static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port, { struct tb_hotplug_event *ev; - ev = kmalloc(sizeof(*ev), GFP_KERNEL); + ev = kmalloc_obj(*ev, GFP_KERNEL); if (!ev) return; diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index 9fa95c595ecc..2d537ada98e1 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -180,11 +180,11 @@ static struct tb_tunnel *tb_tunnel_alloc(struct tb *tb, size_t npaths, { struct tb_tunnel *tunnel; - tunnel = kzalloc(sizeof(*tunnel), GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); if (!tunnel) return NULL; - tunnel->paths = kcalloc(npaths, sizeof(tunnel->paths[0]), GFP_KERNEL); + tunnel->paths = kzalloc_objs(tunnel->paths[0], npaths, GFP_KERNEL); if (!tunnel->paths) { kfree(tunnel); return NULL; diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c index b5e06237261b..642822b58b42 100644 --- a/drivers/thunderbolt/usb4_port.c +++ b/drivers/thunderbolt/usb4_port.c @@ -305,7 +305,7 @@ struct usb4_port *usb4_port_device_add(struct tb_port *port) struct usb4_port *usb4; int ret; - usb4 = kzalloc(sizeof(*usb4), GFP_KERNEL); + usb4 = kzalloc_obj(*usb4, GFP_KERNEL); if (!usb4) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 63c7be818b2c..384afd16af72 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -858,7 +858,7 @@ tb_xdp_schedule_request(struct tb *tb, const struct tb_xdp_header *hdr, { struct xdomain_request_work *xw; - xw = kmalloc(sizeof(*xw), GFP_KERNEL); + xw = kmalloc_obj(*xw, GFP_KERNEL); if (!xw) return false; @@ -1094,7 +1094,7 @@ static void enumerate_services(struct tb_xdomain *xd) continue; } - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) break; @@ -1974,7 +1974,7 @@ struct tb_xdomain *tb_xdomain_alloc(struct tb *tb, struct device *parent, down = tb_port_at(route, parent_sw); tb_port_unlock(down); - xd = kzalloc(sizeof(*xd), GFP_KERNEL); + xd = kzalloc_obj(*xd, GFP_KERNEL); if (!xd) return NULL; diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index 69508d7a4135..2cbbaed14ee6 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -772,7 +772,7 @@ static int __init ehv_bc_init(void) * array, then you can use pointer math (e.g. "bc - bcs") to get its * tty index. */ - bcs = kcalloc(count, sizeof(struct ehv_bc_data), GFP_KERNEL); + bcs = kzalloc_objs(struct ehv_bc_data, count, GFP_KERNEL); if (!bcs) return -ENOMEM; diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 3a9582029005..c587ded7f9a5 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -238,9 +238,8 @@ static int goldfish_tty_create_driver(void) int ret; struct tty_driver *tty; - goldfish_ttys = kcalloc(goldfish_tty_line_count, - sizeof(*goldfish_ttys), - GFP_KERNEL); + goldfish_ttys = kzalloc_objs(*goldfish_ttys, goldfish_tty_line_count, + GFP_KERNEL); if (goldfish_ttys == NULL) { ret = -ENOMEM; goto err_alloc_goldfish_ttys_failed; diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 6b58f340f210..9b3856766e8c 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -922,7 +922,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data, return ERR_PTR(err); } - hp = kzalloc(struct_size(hp, outbuf, outbuf_size), GFP_KERNEL); + hp = kzalloc_flex(*hp, outbuf, outbuf_size, GFP_KERNEL); if (!hp) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c index a7939c49c9cf..7fd3937d1396 100644 --- a/drivers/tty/hvc/hvc_iucv.c +++ b/drivers/tty/hvc/hvc_iucv.c @@ -1050,7 +1050,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console) char name[9]; int rc; - priv = kzalloc(sizeof(struct hvc_iucv_private), GFP_KERNEL); + priv = kzalloc_obj(struct hvc_iucv_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index b2ec1f6efa0a..72dfab77890c 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -181,7 +181,7 @@ static int hvc_opal_probe(struct platform_device *dev) pv = hvc_opal_privs[termno]; boot = 1; } else if (hvc_opal_privs[termno] == NULL) { - pv = kzalloc(sizeof(struct hvc_opal_priv), GFP_KERNEL); + pv = kzalloc_obj(struct hvc_opal_priv, GFP_KERNEL); if (!pv) return -ENOMEM; pv->proto = proto; diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 47930601a26a..8725cc77c557 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -338,7 +338,7 @@ static int hvc_vio_probe(struct vio_dev *vdev, pr_devel("->non-boot console, using termno %d\n", termno); if (termno < 0) return -ENODEV; - pv = kzalloc(sizeof(struct hvterm_priv), GFP_KERNEL); + pv = kzalloc_obj(struct hvterm_priv, GFP_KERNEL); if (!pv) return -ENOMEM; pv->termno = vdev->unit_address; diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 95ec01b1aacf..138afdf3bbc4 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -264,7 +264,7 @@ static int xen_hvm_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); + info = kzalloc_obj(struct xencons_info, GFP_KERNEL); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); @@ -328,7 +328,7 @@ static int xen_pv_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); + info = kzalloc_obj(struct xencons_info, GFP_KERNEL); if (!info) return -ENOMEM; } else if (info->intf != NULL) { @@ -352,7 +352,7 @@ static int xen_initial_domain_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); + info = kzalloc_obj(struct xencons_info, GFP_KERNEL); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); @@ -513,7 +513,7 @@ static int xencons_probe(struct xenbus_device *dev, if (devid == 0) return -ENODEV; - info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL); + info = kzalloc_obj(struct xencons_info, GFP_KERNEL); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index f57fd9095f75..7ff3c87354b8 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -748,7 +748,7 @@ static int hvcs_probe( return -EFAULT; } - hvcsd = kzalloc(sizeof(*hvcsd), GFP_KERNEL); + hvcsd = kzalloc_obj(*hvcsd, GFP_KERNEL); if (!hvcsd) return -ENODEV; @@ -1394,8 +1394,7 @@ static int hvcs_alloc_index_list(int n) { int i; - hvcs_index_list = kmalloc_array(n, sizeof(hvcs_index_count), - GFP_KERNEL); + hvcs_index_list = kmalloc_objs(hvcs_index_count, n, GFP_KERNEL); if (!hvcs_index_list) return -ENOMEM; hvcs_index_count = n; diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c index e18848267be4..6e6aa90b33ba 100644 --- a/drivers/tty/ipwireless/hardware.c +++ b/drivers/tty/ipwireless/hardware.c @@ -1618,7 +1618,7 @@ struct ipw_hardware *ipwireless_hardware_create(void) { int i; struct ipw_hardware *hw = - kzalloc(sizeof(struct ipw_hardware), GFP_KERNEL); + kzalloc_obj(struct ipw_hardware, GFP_KERNEL); if (!hw) return NULL; diff --git a/drivers/tty/ipwireless/main.c b/drivers/tty/ipwireless/main.c index 4c18bbfe1a92..3bf160d62a1e 100644 --- a/drivers/tty/ipwireless/main.c +++ b/drivers/tty/ipwireless/main.c @@ -267,7 +267,7 @@ static int ipwireless_attach(struct pcmcia_device *link) struct ipw_dev *ipw; int ret; - ipw = kzalloc(sizeof(struct ipw_dev), GFP_KERNEL); + ipw = kzalloc_obj(struct ipw_dev, GFP_KERNEL); if (!ipw) return -ENOMEM; diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c index fe569f6294a2..cb864142be09 100644 --- a/drivers/tty/ipwireless/network.c +++ b/drivers/tty/ipwireless/network.c @@ -257,7 +257,7 @@ static void do_go_online(struct work_struct *work_go_online) struct ppp_channel *channel; spin_unlock_irqrestore(&network->lock, flags); - channel = kzalloc(sizeof(struct ppp_channel), GFP_KERNEL); + channel = kzalloc_obj(struct ppp_channel, GFP_KERNEL); if (!channel) { printk(KERN_ERR IPWIRELESS_PCCARD_NAME ": unable to allocate PPP channel\n"); @@ -416,7 +416,7 @@ void ipwireless_network_packet_received(struct ipw_network *network, struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw) { struct ipw_network *network = - kzalloc(sizeof(struct ipw_network), GFP_KERNEL); + kzalloc_obj(struct ipw_network, GFP_KERNEL); if (!network) return NULL; diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index b6de40815fb9..79c01ff49c65 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c @@ -437,7 +437,7 @@ static int add_tty(int j, struct ipw_network *network, int channel_idx, int secondary_channel_idx, int tty_type) { - ttys[j] = kzalloc(sizeof(struct ipw_tty), GFP_KERNEL); + ttys[j] = kzalloc_obj(struct ipw_tty, GFP_KERNEL); if (!ttys[j]) return -ENOMEM; ttys[j]->index = j; diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 214abeb89aaa..815e35a24af9 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2065,8 +2065,7 @@ static void gsm_control_retransmit(struct timer_list *t) static struct gsm_control *gsm_control_send(struct gsm_mux *gsm, unsigned int command, u8 *data, int clen) { - struct gsm_control *ctrl = kzalloc(sizeof(struct gsm_control), - GFP_ATOMIC); + struct gsm_control *ctrl = kzalloc_obj(struct gsm_control, GFP_ATOMIC); unsigned long flags; if (ctrl == NULL) return NULL; @@ -2646,7 +2645,7 @@ static int gsm_dlci_config(struct gsm_dlci *dlci, struct gsm_dlci_config *dc, in static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) { - struct gsm_dlci *dlci = kzalloc(sizeof(struct gsm_dlci), GFP_ATOMIC); + struct gsm_dlci *dlci = kzalloc_obj(struct gsm_dlci, GFP_ATOMIC); if (dlci == NULL) return NULL; spin_lock_init(&dlci->lock); @@ -3276,7 +3275,7 @@ static inline unsigned int mux_line_to_num(unsigned int line) static struct gsm_mux *gsm_alloc_mux(void) { int i; - struct gsm_mux *gsm = kzalloc(sizeof(struct gsm_mux), GFP_KERNEL); + struct gsm_mux *gsm = kzalloc_obj(struct gsm_mux, GFP_KERNEL); if (gsm == NULL) return NULL; gsm->buf = kmalloc(MAX_MRU + 1, GFP_KERNEL); diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index f242d73ee4e0..6c685a6d4ddb 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -388,8 +388,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const u8 *data, * buffer unless the maximum count has been reached */ if (n_hdlc->rx_buf_list.count < MAX_RX_BUF_COUNT) - buf = kmalloc(struct_size(buf, buf, maxframe), - GFP_ATOMIC); + buf = kmalloc_flex(*buf, buf, maxframe, GFP_ATOMIC); } if (!buf) { @@ -670,7 +669,7 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count, unsigned int i; for (i = 0; i < count; i++) { - buf = kmalloc(struct_size(buf, buf, maxframe), GFP_KERNEL); + buf = kmalloc_flex(*buf, buf, maxframe, GFP_KERNEL); if (!buf) { pr_debug("%s(), kmalloc() failed for %s buffer %u\n", __func__, name, i); @@ -687,7 +686,7 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count, */ static struct n_hdlc *n_hdlc_alloc(void) { - struct n_hdlc *n_hdlc = kzalloc(sizeof(*n_hdlc), GFP_KERNEL); + struct n_hdlc *n_hdlc = kzalloc_obj(*n_hdlc, GFP_KERNEL); if (!n_hdlc) return NULL; diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index e28a921c1637..b05f4a8553ac 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c @@ -1298,7 +1298,7 @@ static int nozomi_card_init(struct pci_dev *pdev, goto err; } - dc = kzalloc(sizeof(struct nozomi), GFP_KERNEL); + dc = kzalloc_obj(struct nozomi, GFP_KERNEL); if (unlikely(!dc)) { dev_err(&pdev->dev, "Could not allocate memory\n"); ret = -ENOMEM; diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 6120d827a797..ce58997dae93 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -364,8 +364,8 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty, if (driver->subtype != PTY_TYPE_MASTER) return -EIO; - ports[0] = kmalloc(sizeof **ports, GFP_KERNEL); - ports[1] = kmalloc(sizeof **ports, GFP_KERNEL); + ports[0] = kmalloc_obj(**ports, GFP_KERNEL); + ports[1] = kmalloc_obj(**ports, GFP_KERNEL); if (!ports[0] || !ports[1]) goto err; if (!try_module_get(driver->other->owner)) { diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c index 60a2915f5cfe..6ada8e92bbf2 100644 --- a/drivers/tty/rpmsg_tty.c +++ b/drivers/tty/rpmsg_tty.c @@ -134,7 +134,7 @@ static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void) struct rpmsg_tty_port *cport; int ret; - cport = kzalloc(sizeof(*cport), GFP_KERNEL); + cport = kzalloc_obj(*cport, GFP_KERNEL); if (!cport) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 40eedc15277c..aced9d895103 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -442,7 +442,7 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl) { struct serdev_device *serdev; - serdev = kzalloc(sizeof(*serdev), GFP_KERNEL); + serdev = kzalloc_obj(*serdev, GFP_KERNEL); if (!serdev) return NULL; diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c index 758c4aa203ab..84889bb952a2 100644 --- a/drivers/tty/serial/8250/8250_acorn.c +++ b/drivers/tty/serial/8250/8250_acorn.c @@ -44,7 +44,7 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id) unsigned long bus_addr; unsigned int i; - info = kzalloc(sizeof(struct serial_card_info), GFP_KERNEL); + info = kzalloc_obj(struct serial_card_info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 0e81f78c6063..74a358e7ae03 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -140,7 +140,7 @@ static struct irq_info *serial_get_or_create_irq_info(const struct uart_8250_por if (i->irq == up->port.irq) return i; - i = kzalloc(sizeof(*i), GFP_KERNEL); + i = kzalloc_obj(*i, GFP_KERNEL); if (i == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c index 3012ea03d22c..732f1a158e62 100644 --- a/drivers/tty/serial/8250/8250_hp300.c +++ b/drivers/tty/serial/8250/8250_hp300.c @@ -240,7 +240,7 @@ static int __init hp300_8250_init(void) #endif /* Create new serial device */ - port = kmalloc(sizeof(struct hp300_port), GFP_KERNEL); + port = kmalloc_obj(struct hp300_port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c index cb5b42b3609c..3f3dac694e20 100644 --- a/drivers/tty/serial/8250/8250_ni.c +++ b/drivers/tty/serial/8250/8250_ni.c @@ -285,7 +285,7 @@ static int ni16550_probe(struct platform_device *pdev) bool rs232_property; int ret; - uart = kzalloc(sizeof(*uart), GFP_KERNEL); + uart = kzalloc_obj(*uart, GFP_KERNEL); if (!uart) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 9799356b65f7..9c721bafbe37 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -217,7 +217,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev) if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas")) return -EBUSY; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 6589bb531cc6..643e5a620948 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -4148,7 +4148,7 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board) nr_ports = rc; } - priv = kzalloc(struct_size(priv, line, nr_ports), GFP_KERNEL); + priv = kzalloc_flex(*priv, line, nr_ports, GFP_KERNEL); if (!priv) { priv = ERR_PTR(-ENOMEM); goto err_deinit; diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8250/8250_platform.c index 86d12d2b5907..37f3ef4d041d 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -111,7 +111,8 @@ static int serial8250_probe_acpi(struct platform_device *pdev) struct resource *regs; int ret, line; - struct uart_8250_port *uart __free(kfree) = kzalloc(sizeof(*uart), GFP_KERNEL); + struct uart_8250_port *uart __free(kfree) = kzalloc_obj(*uart, + GFP_KERNEL); if (!uart) return -ENOMEM; @@ -156,7 +157,8 @@ static int serial8250_probe_platform(struct platform_device *dev, struct plat_se { int ret, i; - struct uart_8250_port *uart __free(kfree) = kzalloc(sizeof(*uart), GFP_KERNEL); + struct uart_8250_port *uart __free(kfree) = kzalloc_obj(*uart, + GFP_KERNEL); if (!uart) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 719faf92aa8a..cc94af2d578a 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -553,7 +553,7 @@ static int serial8250_em485_init(struct uart_8250_port *p) if (p->em485) goto deassert_rts; - p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_ATOMIC); + p->em485 = kmalloc_obj(struct uart_8250_em485, GFP_ATOMIC); if (!p->em485) return -ENOMEM; diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c index 58e279ea7ee0..5c372bd7f92a 100644 --- a/drivers/tty/serial/8250/serial_cs.c +++ b/drivers/tty/serial/8250/serial_cs.c @@ -305,7 +305,7 @@ static int serial_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "serial_attach()\n"); /* Create new serial device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index b7e33a896589..c0a7f8a0ff55 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -1632,7 +1632,7 @@ static int icom_alloc_adapter(struct icom_adapter struct icom_adapter *icom_adapter; struct icom_adapter *cur_adapter_entry; - icom_adapter = kzalloc(sizeof(struct icom_adapter), GFP_KERNEL); + icom_adapter = kzalloc_obj(struct icom_adapter, GFP_KERNEL); if (!icom_adapter) { return -ENOMEM; diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 8d21373cae57..2a048dc62b96 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -66,7 +66,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_disable_device; } - brd = kzalloc(sizeof(*brd), GFP_KERNEL); + brd = kzalloc_obj(*brd, GFP_KERNEL); if (!brd) { rc = -ENOMEM; goto out_release_regions; diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index be2f130696b3..8c665fc771dd 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -391,7 +391,8 @@ int jsm_tty_init(struct jsm_board *brd) * Okay to malloc with GFP_KERNEL, we are not at * interrupt context, and there are no locks held. */ - brd->channels[i] = kzalloc(sizeof(struct jsm_channel), GFP_KERNEL); + brd->channels[i] = kzalloc_obj(struct jsm_channel, + GFP_KERNEL); if (!brd->channels[i]) { jsm_dbg(CORE, &brd->pci_dev, "%s:%d Unable to allocate memory for channel struct\n", diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 3faa1b6aa3ee..68cef83de47d 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -708,7 +708,7 @@ static int max3100_probe(struct spi_device *spi) return dev_err_probe(dev, -ENOSPC, "too many MAX3100 chips\n"); } - max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL); + max3100s[i] = kzalloc_obj(struct max3100_port, GFP_KERNEL); if (!max3100s[i]) { mutex_unlock(&max3100s_lock); return -ENOMEM; diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 884fefbfd5a1..2983d74a5cf1 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -909,7 +909,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv) priv->tx_dma_use = 1; - priv->sg_tx_p = kmalloc_array(num, sizeof(struct scatterlist), GFP_ATOMIC); + priv->sg_tx_p = kmalloc_objs(struct scatterlist, num, GFP_ATOMIC); if (!priv->sg_tx_p) { dev_err(priv->port.dev, "%s:kzalloc Failed\n", __func__); return 0; @@ -1651,7 +1651,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, board = &drv_dat[id->driver_data]; port_type = board->port_type; - priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL); + priv = kzalloc_obj(struct eg20t_port, GFP_KERNEL); if (priv == NULL) goto init_port_alloc_err; diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index e395ff29c1a2..063720ed9716 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -811,7 +811,7 @@ static int serial_pxa_probe(struct platform_device *dev) if (irq < 0) return irq; - sport = kzalloc(sizeof(struct uart_pxa_port), GFP_KERNEL); + sport = kzalloc_obj(struct uart_pxa_port, GFP_KERNEL); if (!sport) return -ENOMEM; diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c index 1e1ad28d83fc..ffe331831e22 100644 --- a/drivers/tty/serial/serial_base_bus.c +++ b/drivers/tty/serial/serial_base_bus.c @@ -116,7 +116,7 @@ struct serial_ctrl_device *serial_base_ctrl_add(struct uart_port *port, struct serial_ctrl_device *ctrl_dev; int err; - ctrl_dev = kzalloc(sizeof(*ctrl_dev), GFP_KERNEL); + ctrl_dev = kzalloc_obj(*ctrl_dev, GFP_KERNEL); if (!ctrl_dev) return ERR_PTR(-ENOMEM); @@ -156,7 +156,7 @@ struct serial_port_device *serial_base_port_add(struct uart_port *port, int min = 0, max = -1; /* Use -1 for max to apply IDA defaults */ int err; - port_dev = kzalloc(sizeof(*port_dev), GFP_KERNEL); + port_dev = kzalloc_obj(*port_dev, GFP_KERNEL); if (!port_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 2805cad10511..2047d73858ec 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2716,7 +2716,7 @@ int uart_register_driver(struct uart_driver *drv) * Maybe we should be using a slab cache for this, especially if * we have a large number of ports to handle. */ - drv->state = kcalloc(drv->nr, sizeof(struct uart_state), GFP_KERNEL); + drv->state = kzalloc_objs(struct uart_state, drv->nr, GFP_KERNEL); if (!drv->state) goto out; @@ -3088,8 +3088,8 @@ static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *u if (uport->attr_group) num_groups++; - uport->tty_groups = kcalloc(num_groups, sizeof(*uport->tty_groups), - GFP_KERNEL); + uport->tty_groups = kzalloc_objs(*uport->tty_groups, num_groups, + GFP_KERNEL); if (!uport->tty_groups) return -ENOMEM; diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 2b3ec65d595d..219588a8b1ee 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c @@ -529,7 +529,7 @@ static int hv_probe(struct platform_device *op) if (op->archdata.irqs[0] == 0xffffffff) return -ENODEV; - port = kzalloc(sizeof(struct uart_port), GFP_KERNEL); + port = kzalloc_obj(struct uart_port, GFP_KERNEL); if (unlikely(!port)) return -ENOMEM; diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index df906ccf2e8a..7c4cf6d02ece 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c @@ -1117,9 +1117,8 @@ static int __init sunsab_init(void) } if (num_channels) { - sunsab_ports = kcalloc(num_channels, - sizeof(struct uart_sunsab_port), - GFP_KERNEL); + sunsab_ports = kzalloc_objs(struct uart_sunsab_port, + num_channels, GFP_KERNEL); if (!sunsab_ports) return -ENOMEM; diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 383141fe7ba0..884985346226 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c @@ -1398,7 +1398,7 @@ static int su_probe(struct platform_device *op) return -EINVAL; up = &sunsu_ports[nr_inst]; } else { - up = kzalloc(sizeof(*up), GFP_KERNEL); + up = kzalloc_obj(*up, GFP_KERNEL); if (!up) return -ENOMEM; } diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 6fa93c3872a7..48f1ef5e9bac 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -412,7 +412,7 @@ static int timbuart_probe(struct platform_device *dev) dev_dbg(&dev->dev, "%s\n", __func__); - uart = kzalloc(sizeof(*uart), GFP_KERNEL); + uart = kzalloc_obj(*uart, GFP_KERNEL); if (!uart) { err = -EINVAL; goto err_mem; diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 0613f8c11ab1..d7a39e36b53c 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1247,7 +1247,7 @@ static int ucc_uart_probe(struct platform_device *ofdev) if (ret) return ret; - qe_port = kzalloc(sizeof(struct uart_qe_port), GFP_KERNEL); + qe_port = kzalloc_obj(struct uart_qe_port, GFP_KERNEL); if (!qe_port) { dev_err(&ofdev->dev, "can't allocate QE port structure\n"); return -ENOMEM; diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 9d591fb291fd..06af5c4349ec 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3477,7 +3477,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev { struct slgt_info *info; - info = kzalloc(sizeof(struct slgt_info), GFP_KERNEL); + info = kzalloc_obj(struct slgt_info, GFP_KERNEL); if (!info) { DBGERR(("%s device alloc failed adapter=%d port=%d\n", diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 1f78b0db3b25..4aaa3e04e035 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -971,7 +971,7 @@ static int sysrq_connect(struct input_handler *handler, struct sysrq_state *sysrq; int error; - sysrq = kzalloc(sizeof(struct sysrq_state), GFP_KERNEL); + sysrq = kzalloc_obj(struct sysrq_state, GFP_KERNEL); if (!sysrq) return -ENOMEM; diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index 75542333c54a..e7964d319498 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -35,7 +35,7 @@ static struct tty_audit_buf *tty_audit_buf_alloc(void) { struct tty_audit_buf *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) goto err; diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 1a5673acd9b1..79ec953824d5 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -177,7 +177,7 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size) */ if (atomic_read(&port->buf.mem_used) > port->buf.mem_limit) return NULL; - p = kmalloc(struct_size(p, data, 2 * size), GFP_ATOMIC | __GFP_NOWARN); + p = kmalloc_flex(*p, data, 2 * size, GFP_ATOMIC | __GFP_NOWARN); if (p == NULL) return NULL; diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index e2d92cf70eb7..506b6c6329c2 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -183,7 +183,7 @@ int tty_alloc_file(struct file *file) { struct tty_file_private *priv; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1471,7 +1471,7 @@ void tty_save_termios(struct tty_struct *tty) /* Stash the termios data */ tp = tty->driver->termios[idx]; if (tp == NULL) { - tp = kmalloc(sizeof(*tp), GFP_KERNEL); + tp = kmalloc_obj(*tp, GFP_KERNEL); if (tp == NULL) return; tty->driver->termios[idx] = tp; @@ -3099,7 +3099,7 @@ struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx) { struct tty_struct *tty; - tty = kzalloc(sizeof(*tty), GFP_KERNEL_ACCOUNT); + tty = kzalloc_obj(*tty, GFP_KERNEL_ACCOUNT); if (!tty) return NULL; @@ -3244,7 +3244,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver, else tty_line_name(driver, index, name); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); @@ -3333,7 +3333,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, if (!lines || (flags & TTY_DRIVER_UNNUMBERED_NODE && lines > 1)) return ERR_PTR(-EINVAL); - driver = kzalloc(sizeof(*driver), GFP_KERNEL); + driver = kzalloc_obj(*driver, GFP_KERNEL); if (!driver) return ERR_PTR(-ENOMEM); @@ -3343,10 +3343,9 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, driver->flags = flags; if (!(flags & TTY_DRIVER_DEVPTS_MEM)) { - driver->ttys = kcalloc(lines, sizeof(*driver->ttys), - GFP_KERNEL); - driver->termios = kcalloc(lines, sizeof(*driver->termios), - GFP_KERNEL); + driver->ttys = kzalloc_objs(*driver->ttys, lines, GFP_KERNEL); + driver->termios = kzalloc_objs(*driver->termios, lines, + GFP_KERNEL); if (!driver->ttys || !driver->termios) { err = -ENOMEM; goto err_free_all; @@ -3354,8 +3353,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, } if (!(flags & TTY_DRIVER_DYNAMIC_ALLOC)) { - driver->ports = kcalloc(lines, sizeof(*driver->ports), - GFP_KERNEL); + driver->ports = kzalloc_objs(*driver->ports, lines, GFP_KERNEL); if (!driver->ports) { err = -ENOMEM; goto err_free_all; @@ -3363,7 +3361,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, cdevs = lines; } - driver->cdevs = kcalloc(cdevs, sizeof(*driver->cdevs), GFP_KERNEL); + driver->cdevs = kzalloc_objs(*driver->cdevs, cdevs, GFP_KERNEL); if (!driver->cdevs) { err = -ENOMEM; goto err_free_all; diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index d80e9d4c974b..888f2f8f9481 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -162,7 +162,7 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc) * There is no way to handle allocation failure of only 16 bytes. * Let's simplify error handling and save more memory. */ - ld = kmalloc(sizeof(struct tty_ldisc), GFP_KERNEL | __GFP_NOFAIL); + ld = kmalloc_obj(struct tty_ldisc, GFP_KERNEL | __GFP_NOFAIL); ld->ops = ldops; ld->tty = tty; diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index 2960031ace72..cd741fbe6fbe 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -574,7 +574,7 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) return -ENODEV; } - port = kzalloc(sizeof(struct vcc_port), GFP_KERNEL); + port = kzalloc_obj(struct vcc_port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -957,7 +957,7 @@ static int vcc_install(struct tty_driver *driver, struct tty_struct *tty) if (ret) return ret; - port_tty = kzalloc(sizeof(struct tty_port), GFP_KERNEL); + port_tty = kzalloc_obj(struct tty_port, GFP_KERNEL); if (!port_tty) return -ENOMEM; diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 7a11c3f2e875..97cf1ceb6709 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -539,7 +539,7 @@ static int con_allocate_new(struct vc_data *vc) { struct uni_pagedict *new, *old = *vc->uni_pagedict_loc; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 3538d54d6a6a..dba09eb91f38 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -1548,7 +1548,8 @@ static int kbd_connect(struct input_handler *handler, struct input_dev *dev, { int error; - struct input_handle __free(kfree) *handle = kzalloc(sizeof(*handle), GFP_KERNEL); + struct input_handle __free(kfree) *handle = kzalloc_obj(*handle, + GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index c814644ef4ee..824a74626548 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -131,7 +131,7 @@ vcs_poll_data_get(struct file *file) if (poll) return poll; - poll = kzalloc(sizeof(*poll), GFP_KERNEL); + poll = kzalloc_obj(*poll, GFP_KERNEL); if (!poll) return NULL; poll->cons_num = console(file_inode(file)); diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 3bdbd4c52c2f..cca7bdf8f2fe 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1065,7 +1065,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ /* although the numbers above are not valid since long ago, the point is still up-to-date and the comment still has its value even if only as a historical artifact. --mj, July 1998 */ - param.vc = vc = kzalloc(sizeof(struct vc_data), GFP_KERNEL); + param.vc = vc = kzalloc_obj(struct vc_data, GFP_KERNEL); if (!vc) return -ENOMEM; @@ -3777,7 +3777,8 @@ static int __init con_init(void) } for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { - vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT); + vc_cons[currcons].d = vc = kzalloc_obj(struct vc_data, + GFP_NOWAIT); INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); tty_port_init(&vc->port); visual_init(vc, currcons, true); diff --git a/drivers/ufs/core/ufs-hwmon.c b/drivers/ufs/core/ufs-hwmon.c index 34194064367f..1ca027b4caa5 100644 --- a/drivers/ufs/core/ufs-hwmon.c +++ b/drivers/ufs/core/ufs-hwmon.c @@ -169,7 +169,7 @@ void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask) struct ufs_hwmon_data *data; struct device *hwmon; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return; diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index fa0d4e6aee16..14d14389164e 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -306,7 +306,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) goto err_map; } } - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) { ret = -ENOMEM; goto err_map; @@ -335,7 +335,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) goto err_portio; } } - portio = kzalloc(sizeof(*portio), GFP_KERNEL); + portio = kzalloc_obj(*portio, GFP_KERNEL); if (!portio) { ret = -ENOMEM; goto err_portio; @@ -494,7 +494,7 @@ static int uio_open(struct inode *inode, struct file *filep) goto err_module_get; } - listener = kmalloc(sizeof(*listener), GFP_KERNEL); + listener = kmalloc_obj(*listener, GFP_KERNEL); if (!listener) { ret = -ENOMEM; goto err_alloc_listener; @@ -991,7 +991,7 @@ int __uio_register_device(struct module *owner, info->uio_dev = NULL; - idev = kzalloc(sizeof(*idev), GFP_KERNEL); + idev = kzalloc_obj(*idev, GFP_KERNEL); if (!idev) { return -ENOMEM; } diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 68a8e9de8b4f..909fdb56c09a 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -1130,7 +1130,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, int ret; /* instance init */ - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) return -ENOMEM; diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index e6b610a87482..d0a2f1361a91 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -804,7 +804,7 @@ static int speedtch_bind(struct usbatm_data *usbatm, } } - instance = kzalloc(sizeof(*instance), GFP_KERNEL); + instance = kzalloc_obj(*instance, GFP_KERNEL); if (!instance) { ret = -ENOMEM; diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 78a2585f33ec..b27a5f8842b6 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c @@ -2516,7 +2516,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, return ret; } - sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL); + sc = kzalloc_obj(struct uea_softc, GFP_KERNEL); if (!sc) return -ENOMEM; diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 5f3ad9a99d9e..aa4c209cfb91 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -804,7 +804,7 @@ static int usbatm_atm_open(struct atm_vcc *vcc) goto fail; } - new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL); + new = kzalloc_obj(struct usbatm_vcc_data, GFP_KERNEL); if (!new) { ret = -ENOMEM; goto fail; diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c index 8f38e2c5369a..6b6814c1d557 100644 --- a/drivers/usb/c67x00/c67x00-drv.c +++ b/drivers/usb/c67x00/c67x00-drv.c @@ -121,7 +121,7 @@ static int c67x00_drv_probe(struct platform_device *pdev) if (!pdata) return -ENODEV; - c67x00 = kzalloc(sizeof(*c67x00), GFP_KERNEL); + c67x00 = kzalloc_obj(*c67x00, GFP_KERNEL); if (!c67x00) return -ENOMEM; diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index a09fa68a6ce7..a832f5696f2a 100644 --- a/drivers/usb/c67x00/c67x00-sched.c +++ b/drivers/usb/c67x00/c67x00-sched.c @@ -246,7 +246,7 @@ c67x00_ep_data_alloc(struct c67x00_hcd *c67x00, struct urb *urb) } /* Allocate and initialize a new c67x00 endpoint data structure */ - ep_data = kzalloc(sizeof(*ep_data), GFP_ATOMIC); + ep_data = kzalloc_obj(*ep_data, GFP_ATOMIC); if (!ep_data) return NULL; @@ -349,7 +349,7 @@ int c67x00_urb_enqueue(struct usb_hcd *hcd, int port = get_root_port(urb->dev)-1; /* Allocate and initialize urb private data */ - urbp = kzalloc(sizeof(*urbp), mem_flags); + urbp = kzalloc_obj(*urbp, mem_flags); if (!urbp) { ret = -ENOMEM; goto err_urbp; @@ -574,7 +574,7 @@ static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb, || usb_pipeint(urb->pipe))) return -EMSGSIZE; /* Not really an error, but expected */ - td = kzalloc(sizeof(*td), GFP_ATOMIC); + td = kzalloc_obj(*td, GFP_ATOMIC); if (!td) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 168707213ed9..15b0060ce62d 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -903,7 +903,7 @@ static int cdns3_prepare_aligned_request_buf(struct cdns3_request *priv_req) buf = priv_req->aligned_buf; if (!buf || priv_req->request.length > buf->size) { - buf = kzalloc(sizeof(*buf), GFP_ATOMIC); + buf = kzalloc_obj(*buf, GFP_ATOMIC); if (!buf) return -ENOMEM; @@ -2315,7 +2315,7 @@ struct usb_request *cdns3_gadget_ep_alloc_request(struct usb_ep *ep, struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep); struct cdns3_request *priv_req; - priv_req = kzalloc(sizeof(*priv_req), gfp_flags); + priv_req = kzalloc_obj(*priv_req, gfp_flags); if (!priv_req) return NULL; @@ -3287,7 +3287,7 @@ static int cdns3_gadget_start(struct cdns *cdns) u32 max_speed; int ret; - priv_dev = kzalloc(sizeof(*priv_dev), GFP_KERNEL); + priv_dev = kzalloc_obj(*priv_dev, GFP_KERNEL); if (!priv_dev) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdns3-pci-wrap.c b/drivers/usb/cdns3/cdns3-pci-wrap.c index 57f57c24c663..03c9762ad032 100644 --- a/drivers/usb/cdns3/cdns3-pci-wrap.c +++ b/drivers/usb/cdns3/cdns3-pci-wrap.c @@ -97,7 +97,7 @@ static int cdns3_pci_probe(struct pci_dev *pdev, if (pci_is_enabled(func)) { wrap = pci_get_drvdata(func); } else { - wrap = kzalloc(sizeof(*wrap), GFP_KERNEL); + wrap = kzalloc_obj(*wrap, GFP_KERNEL); if (!wrap) return -ENOMEM; } diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c index d37c29a253dd..475ac61ad4c4 100644 --- a/drivers/usb/cdns3/cdnsp-gadget.c +++ b/drivers/usb/cdns3/cdnsp-gadget.c @@ -1102,7 +1102,7 @@ static struct usb_request *cdnsp_gadget_ep_alloc_request(struct usb_ep *ep, struct cdnsp_ep *pep = to_cdnsp_ep(ep); struct cdnsp_request *preq; - preq = kzalloc(sizeof(*preq), gfp_flags); + preq = kzalloc_obj(*preq, gfp_flags); if (!preq) return NULL; @@ -1905,7 +1905,7 @@ static int __cdnsp_gadget_init(struct cdns *cdns) cdns_drd_gadget_on(cdns); - pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); + pdev = kzalloc_obj(*pdev, GFP_KERNEL); if (!pdev) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c index 97866bfb2da9..a2a1b21f2ef8 100644 --- a/drivers/usb/cdns3/cdnsp-mem.c +++ b/drivers/usb/cdns3/cdnsp-mem.c @@ -35,7 +35,7 @@ static struct cdnsp_segment *cdnsp_segment_alloc(struct cdnsp_device *pdev, dma_addr_t dma; int i; - seg = kzalloc(sizeof(*seg), flags); + seg = kzalloc_obj(*seg, flags); if (!seg) return NULL; @@ -376,7 +376,7 @@ static struct cdnsp_ring *cdnsp_ring_alloc(struct cdnsp_device *pdev, struct cdnsp_ring *ring; int ret; - ring = kzalloc(sizeof *(ring), flags); + ring = kzalloc_obj(*(ring), flags); if (!ring) return NULL; @@ -575,9 +575,8 @@ int cdnsp_alloc_stream_info(struct cdnsp_device *pdev, stream_info->num_stream_ctxs = num_stream_ctxs; /* Initialize the array of virtual pointers to stream rings. */ - stream_info->stream_rings = kcalloc(num_streams, - sizeof(struct cdnsp_ring *), - GFP_ATOMIC); + stream_info->stream_rings = kzalloc_objs(struct cdnsp_ring *, + num_streams, GFP_ATOMIC); if (!stream_info->stream_rings) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c index 5e7b88ca8b96..b6199f98ff77 100644 --- a/drivers/usb/cdns3/cdnsp-pci.c +++ b/drivers/usb/cdns3/cdnsp-pci.c @@ -82,7 +82,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev, if (pci_is_enabled(func)) { cdnsp = pci_get_drvdata(func); } else { - cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL); + cdnsp = kzalloc_obj(*cdnsp, GFP_KERNEL); if (!cdnsp) { ret = -ENOMEM; goto put_pci; diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index c8d931d9d433..f2de86d0ce40 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -360,8 +360,8 @@ static int add_td_to_list(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq, { int i; u32 temp; - struct td_node *lastnode, *node = kzalloc(sizeof(struct td_node), - GFP_ATOMIC); + struct td_node *lastnode, *node = kzalloc_obj(struct td_node, + GFP_ATOMIC); if (node == NULL) return -ENOMEM; @@ -1645,7 +1645,7 @@ static struct usb_request *ep_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) if (ep == NULL) return NULL; - hwreq = kzalloc(sizeof(struct ci_hw_req), gfp_flags); + hwreq = kzalloc_obj(struct ci_hw_req, gfp_flags); if (hwreq != NULL) { INIT_LIST_HEAD(&hwreq->queue); INIT_LIST_HEAD(&hwreq->tds); diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 54be4aa1dcb2..8816c6eaba1d 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1350,7 +1350,7 @@ skip_normal_probe: made_compressed_probe: dev_dbg(&intf->dev, "interfaces are valid\n"); - acm = kzalloc(sizeof(struct acm), GFP_KERNEL); + acm = kzalloc_obj(struct acm, GFP_KERNEL); if (!acm) return -ENOMEM; diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index ecd6d1f39e49..28fc93e0c01d 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -1027,7 +1027,7 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor int rv = -ENOMEM; struct wdm_device *desc; - desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL); + desc = kzalloc_obj(struct wdm_device, GFP_KERNEL); if (!desc) goto out; INIT_LIST_HEAD(&desc->device_list); @@ -1050,10 +1050,10 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor desc->wMaxPacketSize = usb_endpoint_maxp(ep); - desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); + desc->orq = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); if (!desc->orq) goto err; - desc->irq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); + desc->irq = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); if (!desc->irq) goto err; diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index a7a1d38b6bef..653583dc7a8d 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -1142,7 +1142,7 @@ static int usblp_probe(struct usb_interface *intf, /* Malloc and start initializing usblp structure so we can use it * directly. */ - usblp = kzalloc(sizeof(struct usblp), GFP_KERNEL); + usblp = kzalloc_obj(struct usblp, GFP_KERNEL); if (!usblp) { retval = -ENOMEM; goto abort_ret; diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 206f1b738ed3..20bc86367660 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -172,7 +172,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp) return -ENODEV; } - file_data = kzalloc(sizeof(*file_data), GFP_KERNEL); + file_data = kzalloc_obj(*file_data, GFP_KERNEL); if (!file_data) return -ENOMEM; @@ -2378,7 +2378,7 @@ static int usbtmc_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "%s called\n", __func__); - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index 4a2ee447b213..2f414b7c3e2c 100644 --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -324,7 +324,7 @@ struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi *ulpi; int ret; - ulpi = kzalloc(sizeof(*ulpi), GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); if (!ulpi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 2bb1ceb9d621..129cbfd74f26 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -823,7 +823,7 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx, nalts[i] = j = USB_MAXALTSETTING; } - intfc = kzalloc(struct_size(intfc, altsetting, j), GFP_KERNEL); + intfc = kzalloc_flex(*intfc, altsetting, j, GFP_KERNEL); config->intf_cache[i] = intfc; if (!intfc) return -ENOMEM; @@ -1045,7 +1045,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) return -ENOMSG; } - bos = kzalloc(sizeof(*bos), GFP_KERNEL); + bos = kzalloc_obj(*bos, GFP_KERNEL); if (!bos) return -ENOMEM; @@ -1066,7 +1066,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) if (total_len < length) return -EINVAL; - dev->bos = kzalloc(sizeof(*dev->bos), GFP_KERNEL); + dev->bos = kzalloc_obj(*dev->bos, GFP_KERNEL); if (!dev->bos) return -ENOMEM; diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index f6ce6e26e0d4..d7ac181454f9 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -245,7 +245,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) if (ret) goto error; - usbm = kzalloc(sizeof(struct usb_memory), GFP_KERNEL); + usbm = kzalloc_obj(struct usb_memory, GFP_KERNEL); if (!usbm) { ret = -ENOMEM; goto error_decrease_mem; @@ -402,7 +402,7 @@ static struct async *alloc_async(unsigned int numisoframes) { struct async *as; - as = kzalloc(sizeof(struct async), GFP_KERNEL); + as = kzalloc_obj(struct async, GFP_KERNEL); if (!as) return NULL; as->urb = usb_alloc_urb(numisoframes, GFP_KERNEL); @@ -970,7 +970,7 @@ static int parse_usbdevfs_streams(struct usb_dev_state *ps, if (num_streams_ret && (num_streams < 2 || num_streams > 65536)) return -EINVAL; - eps = kmalloc_array(num_eps, sizeof(*eps), GFP_KERNEL); + eps = kmalloc_objs(*eps, num_eps, GFP_KERNEL); if (!eps) return -ENOMEM; @@ -1039,7 +1039,7 @@ static int usbdev_open(struct inode *inode, struct file *file) int ret; ret = -ENOMEM; - ps = kzalloc(sizeof(struct usb_dev_state), GFP_KERNEL); + ps = kzalloc_obj(struct usb_dev_state, GFP_KERNEL); if (!ps) goto out_free_ps; @@ -1196,7 +1196,7 @@ static int do_proc_control(struct usb_dev_state *ps, urb = usb_alloc_urb(0, GFP_NOIO); if (!urb) goto done; - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO); + dr = kmalloc_obj(struct usb_ctrlrequest, GFP_NOIO); if (!dr) goto done; @@ -1670,7 +1670,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb /* min 8 byte setup packet */ if (uurb->buffer_length < 8) return -EINVAL; - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); + dr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); if (!dr) return -ENOMEM; if (copy_from_user(dr, uurb->buffer, 8)) { @@ -1805,9 +1805,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb as->mem_usage = u; if (num_sgs) { - as->urb->sg = kmalloc_array(num_sgs, - sizeof(struct scatterlist), - GFP_KERNEL | __GFP_NOWARN); + as->urb->sg = kmalloc_objs(struct scatterlist, num_sgs, + GFP_KERNEL | __GFP_NOWARN); if (!as->urb->sg) { ret = -ENOMEM; goto error; diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 2f5958bc4f7f..db67874879d8 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -57,7 +57,7 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, if (fields < 2) return -EINVAL; - dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); + dynid = kzalloc_obj(*dynid, GFP_KERNEL); if (!dynid) return -ENOMEM; diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index e48399401608..f44f0fffeb41 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -154,7 +154,7 @@ int usb_create_ep_devs(struct device *parent, struct ep_device *ep_dev; int retval; - ep_dev = kzalloc(sizeof(*ep_dev), GFP_KERNEL); + ep_dev = kzalloc_obj(*ep_dev, GFP_KERNEL); if (!ep_dev) { retval = -ENOMEM; goto exit; diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 2d99a59d9f3f..f1b2b0e4c437 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2193,7 +2193,7 @@ int ehset_single_step_set_feature(struct usb_hcd *hcd, int port) if (!buf) return -ENOMEM; - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); + dr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); if (!dr) { kfree(buf); return -ENOMEM; @@ -2567,16 +2567,16 @@ struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver, if (!hcd) return NULL; if (primary_hcd == NULL) { - hcd->address0_mutex = kmalloc(sizeof(*hcd->address0_mutex), - GFP_KERNEL); + hcd->address0_mutex = kmalloc_obj(*hcd->address0_mutex, + GFP_KERNEL); if (!hcd->address0_mutex) { kfree(hcd); dev_dbg(dev, "hcd address0 mutex alloc failed\n"); return NULL; } mutex_init(hcd->address0_mutex); - hcd->bandwidth_mutex = kmalloc(sizeof(*hcd->bandwidth_mutex), - GFP_KERNEL); + hcd->bandwidth_mutex = kmalloc_obj(*hcd->bandwidth_mutex, + GFP_KERNEL); if (!hcd->bandwidth_mutex) { kfree(hcd->address0_mutex); kfree(hcd); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index be50d03034a9..22a54c632c26 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -929,7 +929,7 @@ int usb_hub_clear_tt_buffer(struct urb *urb) * since each TT has "at least two" buffers that can need it (and * there can be many TTs per hub). even if they're uncommon. */ - clear = kmalloc(sizeof *clear, GFP_ATOMIC); + clear = kmalloc_obj(*clear, GFP_ATOMIC); if (clear == NULL) { dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); /* FIXME recover somehow ... RESET_TT? */ @@ -1461,20 +1461,20 @@ static int hub_configure(struct usb_hub *hub, unsigned full_load; unsigned maxchild; - hub->buffer = kmalloc(sizeof(*hub->buffer), GFP_KERNEL); + hub->buffer = kmalloc_obj(*hub->buffer, GFP_KERNEL); if (!hub->buffer) { ret = -ENOMEM; goto fail; } - hub->status = kmalloc(sizeof(*hub->status), GFP_KERNEL); + hub->status = kmalloc_obj(*hub->status, GFP_KERNEL); if (!hub->status) { ret = -ENOMEM; goto fail; } mutex_init(&hub->status_mutex); - hub->descriptor = kzalloc(sizeof(*hub->descriptor), GFP_KERNEL); + hub->descriptor = kzalloc_obj(*hub->descriptor, GFP_KERNEL); if (!hub->descriptor) { ret = -ENOMEM; goto fail; @@ -1522,7 +1522,7 @@ static int hub_configure(struct usb_hub *hub, dev_info(hub_dev, "%d port%s detected\n", maxchild, str_plural(maxchild)); - hub->ports = kcalloc(maxchild, sizeof(struct usb_port *), GFP_KERNEL); + hub->ports = kzalloc_objs(struct usb_port *, maxchild, GFP_KERNEL); if (!hub->ports) { ret = -ENOMEM; goto fail; @@ -1958,7 +1958,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) /* We found a hub */ dev_info(&intf->dev, "USB hub found\n"); - hub = kzalloc(sizeof(*hub), GFP_KERNEL); + hub = kzalloc_obj(*hub, GFP_KERNEL); if (!hub) return -ENOMEM; @@ -4142,7 +4142,7 @@ static int usb_req_set_sel(struct usb_device *udev) * which may be initiated by an error path of a mass storage driver. * Therefore, use GFP_NOIO. */ - sel_values = kmalloc(sizeof *(sel_values), GFP_NOIO); + sel_values = kmalloc_obj(*(sel_values), GFP_NOIO); if (!sel_values) return -ENOMEM; @@ -5236,7 +5236,7 @@ check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc(sizeof *qual, GFP_KERNEL); + qual = kmalloc_obj(*qual, GFP_KERNEL); if (qual == NULL) return; diff --git a/drivers/usb/core/ledtrig-usbport.c b/drivers/usb/core/ledtrig-usbport.c index 5e3c515991f3..e7de8864a527 100644 --- a/drivers/usb/core/ledtrig-usbport.c +++ b/drivers/usb/core/ledtrig-usbport.c @@ -190,7 +190,7 @@ static int usbport_trig_add_port(struct usbport_trig_data *usbport_data, size_t len; int err; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) { err = -ENOMEM; goto err_out; @@ -305,7 +305,7 @@ static int usbport_trig_activate(struct led_classdev *led_cdev) struct usbport_trig_data *usbport_data; int err; - usbport_data = kzalloc(sizeof(*usbport_data), GFP_KERNEL); + usbport_data = kzalloc_obj(*usbport_data, GFP_KERNEL); if (!usbport_data) return -ENOMEM; usbport_data->led_cdev = led_cdev; diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 6138468c67c4..d8f50d468794 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -141,7 +141,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, struct usb_ctrlrequest *dr; int ret; - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO); + dr = kmalloc_obj(struct usb_ctrlrequest, GFP_NOIO); if (!dr) return -ENOMEM; @@ -526,7 +526,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, } /* initialize all the urbs we'll use */ - io->urbs = kmalloc_array(io->entries, sizeof(*io->urbs), mem_flags); + io->urbs = kmalloc_objs(*io->urbs, io->entries, mem_flags); if (!io->urbs) goto nomem; @@ -1058,7 +1058,7 @@ struct usb_device_descriptor *usb_get_device_descriptor(struct usb_device *udev) struct usb_device_descriptor *desc; int ret; - desc = kmalloc(sizeof(*desc), GFP_NOIO); + desc = kmalloc_obj(*desc, GFP_NOIO); if (!desc) return ERR_PTR(-ENOMEM); @@ -2028,15 +2028,13 @@ int usb_set_configuration(struct usb_device *dev, int configuration) n = nintf = 0; if (cp) { nintf = cp->desc.bNumInterfaces; - new_interfaces = kmalloc_array(nintf, sizeof(*new_interfaces), - GFP_NOIO); + new_interfaces = kmalloc_objs(*new_interfaces, nintf, GFP_NOIO); if (!new_interfaces) return -ENOMEM; for (; n < nintf; ++n) { - new_interfaces[n] = kzalloc( - sizeof(struct usb_interface), - GFP_NOIO); + new_interfaces[n] = kzalloc_obj(struct usb_interface, + GFP_NOIO); if (!new_interfaces[n]) { ret = -ENOMEM; free_interfaces: @@ -2289,7 +2287,7 @@ int usb_driver_set_configuration(struct usb_device *udev, int config) { struct set_config_request *req; - req = kmalloc(sizeof(*req), GFP_KERNEL); + req = kmalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; req->udev = udev; diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index f54198171b6a..36096973eb59 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -739,11 +739,11 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) struct usb_device *hdev = hub->hdev; int retval; - port_dev = kzalloc(sizeof(*port_dev), GFP_KERNEL); + port_dev = kzalloc_obj(*port_dev, GFP_KERNEL); if (!port_dev) return -ENOMEM; - port_dev->req = kzalloc(sizeof(*(port_dev->req)), GFP_KERNEL); + port_dev->req = kzalloc_obj(*(port_dev->req), GFP_KERNEL); if (!port_dev->req) { kfree(port_dev); return -ENOMEM; diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index c4d85089d19b..135a89ab2bfa 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -61,8 +61,7 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp) quirk_list = NULL; } - quirk_list = kcalloc(quirk_count, sizeof(struct quirk_entry), - GFP_KERNEL); + quirk_list = kzalloc_objs(struct quirk_entry, quirk_count, GFP_KERNEL); if (!quirk_list) { quirk_count = 0; mutex_unlock(&quirk_mutex); diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index ff8df16cca35..c06b44ca507b 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -72,8 +72,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags) { struct urb *urb; - urb = kmalloc(struct_size(urb, iso_frame_desc, iso_packets), - mem_flags); + urb = kmalloc_flex(*urb, iso_frame_desc, iso_packets, mem_flags); if (!urb) return NULL; usb_init_urb(urb); diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index e740f7852bcd..cfb882b86981 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -648,7 +648,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_hcd *usb_hcd = bus_to_hcd(bus); unsigned raw_port = port1; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 0637bfbc054e..d216e26c787b 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -397,7 +397,7 @@ static struct usb_request *dwc2_hsotg_ep_alloc_request(struct usb_ep *ep, { struct dwc2_hsotg_req *req; - req = kzalloc(sizeof(*req), flags); + req = kzalloc_obj(*req, flags); if (!req) return NULL; diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 30eb8506617c..55809a83f8f8 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -3823,7 +3823,7 @@ static struct dwc2_hcd_urb *dwc2_hcd_urb_alloc(struct dwc2_hsotg *hsotg, { struct dwc2_hcd_urb *urb; - urb = kzalloc(struct_size(urb, iso_descs, iso_desc_count), mem_flags); + urb = kzalloc_flex(*urb, iso_descs, iso_desc_count, mem_flags); if (urb) urb->packet_count = iso_desc_count; return urb; @@ -4743,7 +4743,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, qh_allocated = true; } - qtd = kzalloc(sizeof(*qtd), mem_flags); + qtd = kzalloc_obj(*qtd, mem_flags); if (!qtd) { retval = -ENOMEM; goto fail1; @@ -5218,7 +5218,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) memset(&hsotg->hc_ptr_array[0], 0, sizeof(hsotg->hc_ptr_array)); for (i = 0; i < num_channels; i++) { - channel = kzalloc(sizeof(*channel), GFP_KERNEL); + channel = kzalloc_obj(*channel, GFP_KERNEL); if (!channel) goto error3; channel->hc_num = i; diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index 904fe0632b34..4f00ff1dc3e1 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -1585,7 +1585,7 @@ struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, return NULL; /* Allocate memory */ - qh = kzalloc(sizeof(*qh), mem_flags); + qh = kzalloc_obj(*qh, mem_flags); if (!qh) return NULL; diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index ffb1101f55c7..a005865862c8 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -1003,7 +1003,7 @@ void dwc3_debugfs_init(struct dwc3 *dwc) { struct dentry *root; - dwc->regset = kzalloc(sizeof(*dwc->regset), GFP_KERNEL); + dwc->regset = kzalloc_obj(*dwc->regset, GFP_KERNEL); if (!dwc->regset) return; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c65291e7b8d9..7bd60fc7cd74 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1188,7 +1188,7 @@ static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep, struct dwc3_request *req; struct dwc3_ep *dep = to_dwc3_ep(ep); - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -3373,7 +3373,7 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum) int ret; u8 num = epnum >> 1; - dep = kzalloc(sizeof(*dep), GFP_KERNEL); + dep = kzalloc_obj(*dep, GFP_KERNEL); if (!dep) return -ENOMEM; @@ -4728,7 +4728,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) } init_completion(&dwc->ep0_in_setup); - dwc->gadget = kzalloc(sizeof(struct usb_gadget), GFP_KERNEL); + dwc->gadget = kzalloc_obj(struct usb_gadget, GFP_KERNEL); if (!dwc->gadget) { ret = -ENOMEM; goto err3; diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index fbb5d590eab6..65a16d2cdfd7 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -515,7 +515,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) unsigned i; __hc32 tag; - seen = kmalloc_array(DBG_SCHED_LIMIT, sizeof(*seen), GFP_ATOMIC); + seen = kmalloc_objs(*seen, DBG_SCHED_LIMIT, GFP_ATOMIC); if (!seen) return 0; @@ -738,7 +738,7 @@ static struct debug_buffer { struct debug_buffer *buf; - buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL); + buf = kzalloc_obj(struct debug_buffer, GFP_KERNEL); if (buf) { buf->bus = bus; @@ -1847,7 +1847,7 @@ static struct fotg210_qh *fotg210_qh_alloc(struct fotg210_hcd *fotg210, struct fotg210_qh *qh; dma_addr_t dma; - qh = kzalloc(sizeof(*qh), GFP_ATOMIC); + qh = kzalloc_obj(*qh, GFP_ATOMIC); if (!qh) goto done; qh->hw = (struct fotg210_qh_hw *) @@ -3899,7 +3899,7 @@ static struct fotg210_iso_stream *iso_stream_alloc(gfp_t mem_flags) { struct fotg210_iso_stream *stream; - stream = kzalloc(sizeof(*stream), mem_flags); + stream = kzalloc_obj(*stream, mem_flags); if (likely(stream != NULL)) { INIT_LIST_HEAD(&stream->td_list); INIT_LIST_HEAD(&stream->free_list); @@ -4007,7 +4007,7 @@ static struct fotg210_iso_sched *iso_sched_alloc(unsigned packets, { struct fotg210_iso_sched *iso_sched; - iso_sched = kzalloc(struct_size(iso_sched, packet, packets), mem_flags); + iso_sched = kzalloc_flex(*iso_sched, packet, packets, mem_flags); if (likely(iso_sched != NULL)) INIT_LIST_HEAD(&iso_sched->td_list); diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 0bae12e34f9a..79509ec08be9 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -244,7 +244,7 @@ static struct usb_request *fotg210_ep_alloc_request(struct usb_ep *_ep, { struct fotg210_request *req; - req = kzalloc(sizeof(struct fotg210_request), gfp_flags); + req = kzalloc_obj(struct fotg210_request, gfp_flags); if (!req) return NULL; @@ -1183,7 +1183,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) return irq; /* initialize udc */ - fotg210 = kzalloc(sizeof(struct fotg210_udc), GFP_KERNEL); + fotg210 = kzalloc_obj(struct fotg210_udc, GFP_KERNEL); if (fotg210 == NULL) return -ENOMEM; @@ -1207,7 +1207,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) ret = -ENOMEM; for (i = 0; i < FOTG210_MAX_NUM_EP; i++) { - fotg210->ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL); + fotg210->ep[i] = kzalloc_obj(struct fotg210_ep, GFP_KERNEL); if (!fotg210->ep[i]) goto err_alloc; } diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 5b3866909b75..aba08d058ff9 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -2531,7 +2531,7 @@ static int composite_bind(struct usb_gadget *gadget, struct usb_composite_driver *composite = to_cdriver(gdriver); int status = -ENOMEM; - cdev = kzalloc(sizeof *cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev, GFP_KERNEL); if (!cdev) return status; diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index acef1c6f199c..5163a994f9e7 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -727,7 +727,7 @@ static struct config_group *config_desc_make( if (ret) return ERR_PTR(ret); - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return ERR_PTR(-ENOMEM); cfg->c.label = kstrdup(buf, GFP_KERNEL); @@ -870,7 +870,7 @@ static struct config_item *gadget_language_string_make(struct config_group *grou language = to_gadget_language(&group->cg_item); - string = kzalloc(sizeof(*string), GFP_KERNEL); + string = kzalloc_obj(*string, GFP_KERNEL); if (!string) return ERR_PTR(-ENOMEM); @@ -922,7 +922,7 @@ static struct config_group *gadget_language_make(struct config_group *group, int langs = 0; int ret; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return ERR_PTR(-ENOMEM); @@ -1629,8 +1629,8 @@ configfs_attach_gadget_strings(struct gadget_info *gi) if (!nlangs) return NULL; - gadget_strings = kcalloc(nlangs + 1, /* including NULL terminator */ - sizeof(struct usb_gadget_strings *), GFP_KERNEL); + gadget_strings = kzalloc_objs(struct usb_gadget_strings *, nlangs + 1, + GFP_KERNEL)/* including NULL terminator */; if (!gadget_strings) return ERR_PTR(-ENOMEM); @@ -1645,8 +1645,8 @@ configfs_attach_gadget_strings(struct gadget_info *gi) goto cleanup; } - stringtab = kcalloc(language->nstrings + 1, sizeof(struct usb_string), - GFP_KERNEL); + stringtab = kzalloc_objs(struct usb_string, + language->nstrings + 1, GFP_KERNEL); if (!stringtab) { us = ERR_PTR(-ENOMEM); goto cleanup; @@ -1992,7 +1992,7 @@ static struct config_group *gadgets_make( { struct gadget_info *gi; - gi = kzalloc(sizeof(*gi), GFP_KERNEL); + gi = kzalloc_obj(*gi, GFP_KERNEL); if (!gi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 0ad857f1f325..d34b4710f962 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -748,7 +748,7 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi) struct f_serial_opts *opts; struct f_acm *acm; - acm = kzalloc(sizeof(*acm), GFP_KERNEL); + acm = kzalloc_obj(*acm, GFP_KERNEL); if (!acm) return ERR_PTR(-ENOMEM); @@ -882,7 +882,7 @@ static struct usb_function_instance *acm_alloc_instance(void) struct f_serial_opts *opts; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); opts->protocol = USB_CDC_ACM_PROTO_AT_V25TER; diff --git a/drivers/usb/gadget/function/f_ecm.c b/drivers/usb/gadget/function/f_ecm.c index 675d2bc538a4..aa91d705bc8d 100644 --- a/drivers/usb/gadget/function/f_ecm.c +++ b/drivers/usb/gadget/function/f_ecm.c @@ -847,7 +847,7 @@ static struct usb_function_instance *ecm_alloc_inst(void) { struct f_ecm_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -927,7 +927,7 @@ static struct usb_function *ecm_alloc(struct usb_function_instance *fi) int status; /* allocate and initialize one new instance */ - ecm = kzalloc(sizeof(*ecm), GFP_KERNEL); + ecm = kzalloc_obj(*ecm, GFP_KERNEL); if (!ecm) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c index edbbadad6138..acdd6c637c7b 100644 --- a/drivers/usb/gadget/function/f_eem.c +++ b/drivers/usb/gadget/function/f_eem.c @@ -462,7 +462,7 @@ static int eem_unwrap(struct gether *port, goto next; } - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { kfree(req->buf); usb_ep_free_request(ep, req); @@ -608,7 +608,7 @@ static struct usb_function_instance *eem_alloc_inst(void) { struct f_eem_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -651,7 +651,7 @@ static struct usb_function *eem_alloc(struct usb_function_instance *fi) struct f_eem_opts *opts; /* allocate and initialize one new instance */ - eem = kzalloc(sizeof(*eem), GFP_KERNEL); + eem = kzalloc_obj(*eem, GFP_KERNEL); if (!eem) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 2c6986e381ca..84cfa7a8437a 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -814,7 +814,7 @@ static void *ffs_build_sg_list(struct sg_table *sgt, size_t sz) return NULL; n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; - pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL); + pages = kvmalloc_objs(struct page *, n_pages, GFP_KERNEL); if (!pages) { vfree(vaddr); @@ -957,7 +957,7 @@ static ssize_t __ffs_epfile_read_data(struct ffs_epfile *epfile, data_len, ret); data_len -= ret; - buf = kmalloc(struct_size(buf, storage, data_len), GFP_KERNEL); + buf = kmalloc_flex(*buf, storage, data_len, GFP_KERNEL); if (!buf) return -ENOMEM; buf->length = data_len; @@ -1245,7 +1245,7 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from) ssize_t res; if (!is_sync_kiocb(kiocb)) { - p = kzalloc(sizeof(io_data), GFP_KERNEL); + p = kzalloc_obj(io_data, GFP_KERNEL); if (!p) return -ENOMEM; p->aio = true; @@ -1280,7 +1280,7 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) ssize_t res; if (!is_sync_kiocb(kiocb)) { - p = kzalloc(sizeof(io_data), GFP_KERNEL); + p = kzalloc_obj(io_data, GFP_KERNEL); if (!p) return -ENOMEM; p->aio = true; @@ -1503,7 +1503,7 @@ static int ffs_dmabuf_attach(struct file *file, int fd) goto err_dmabuf_put; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { err = -ENOMEM; goto err_dmabuf_detach; @@ -1652,7 +1652,7 @@ static int ffs_dmabuf_transfer(struct file *file, if (ret) goto err_resv_unlock; - fence = kmalloc(sizeof(*fence), GFP_KERNEL); + fence = kmalloc_obj(*fence, GFP_KERNEL); if (!fence) { ret = -ENOMEM; goto err_resv_unlock; @@ -2067,7 +2067,7 @@ static int ffs_fs_init_fs_context(struct fs_context *fc) { struct ffs_sb_fill_data *ctx; - ctx = kzalloc(sizeof(struct ffs_sb_fill_data), GFP_KERNEL); + ctx = kzalloc_obj(struct ffs_sb_fill_data, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -2183,7 +2183,7 @@ static void ffs_data_closed(struct ffs_data *ffs) static struct ffs_data *ffs_data_new(const char *dev_name) { - struct ffs_data *ffs = kzalloc(sizeof *ffs, GFP_KERNEL); + struct ffs_data *ffs = kzalloc_obj(*ffs, GFP_KERNEL); if (!ffs) return NULL; @@ -2330,7 +2330,7 @@ static int ffs_epfiles_create(struct ffs_data *ffs) int err; count = ffs->eps_count; - epfiles = kcalloc(count, sizeof(*epfiles), GFP_KERNEL); + epfiles = kzalloc_objs(*epfiles, count, GFP_KERNEL); if (!epfiles) return -ENOMEM; @@ -4031,7 +4031,7 @@ static struct usb_function_instance *ffs_alloc_inst(void) struct f_fs_opts *opts; struct ffs_dev *dev; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -4107,7 +4107,7 @@ static struct usb_function *ffs_alloc(struct usb_function_instance *fi) { struct ffs_function *func; - func = kzalloc(sizeof(*func), GFP_KERNEL); + func = kzalloc_obj(*func, GFP_KERNEL); if (!func) return ERR_PTR(-ENOMEM); @@ -4138,7 +4138,7 @@ static struct ffs_dev *_ffs_alloc_dev(void) if (_ffs_get_single_dev()) return ERR_PTR(-EBUSY); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index bee0d0458ff7..93dd678cafe1 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -650,7 +650,7 @@ static int f_hidg_get_report(struct file *file, struct usb_hidg_report __user *b struct report_entry *ptr; __u8 report_id; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -775,7 +775,7 @@ static void hidg_intout_complete(struct usb_ep *ep, struct usb_request *req) switch (req->status) { case 0: - req_list = kzalloc(sizeof(*req_list), GFP_ATOMIC); + req_list = kzalloc_obj(*req_list, GFP_ATOMIC); if (!req_list) { ERROR(cdev, "Unable to allocate mem for req_list\n"); goto free_req; @@ -1530,7 +1530,7 @@ static struct usb_function_instance *hidg_alloc_inst(void) struct usb_function_instance *ret; int status = 0; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -1596,7 +1596,7 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi) int ret; /* allocate and initialize one new instance */ - hidg = kzalloc(sizeof(*hidg), GFP_KERNEL); + hidg = kzalloc_obj(*hidg, GFP_KERNEL); if (!hidg) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c index 39862e236837..b8fa60af9385 100644 --- a/drivers/usb/gadget/function/f_loopback.c +++ b/drivers/usb/gadget/function/f_loopback.c @@ -425,7 +425,7 @@ static struct usb_function *loopback_alloc(struct usb_function_instance *fi) struct f_loopback *loop; struct f_lb_opts *lb_opts; - loop = kzalloc(sizeof *loop, GFP_KERNEL); + loop = kzalloc_obj(*loop, GFP_KERNEL); if (!loop) return ERR_PTR(-ENOMEM); @@ -568,7 +568,7 @@ static struct usb_function_instance *loopback_alloc_instance(void) { struct f_lb_opts *lb_opts; - lb_opts = kzalloc(sizeof(*lb_opts), GFP_KERNEL); + lb_opts = kzalloc_obj(*lb_opts, GFP_KERNEL); if (!lb_opts) return ERR_PTR(-ENOMEM); mutex_init(&lb_opts->lock); diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 5c3f34a2f35c..c894ede6bcd2 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -2699,7 +2699,7 @@ static void fsg_lun_release(struct device *dev) static struct fsg_common *fsg_common_setup(struct fsg_common *common) { if (!common) { - common = kzalloc(sizeof(*common), GFP_KERNEL); + common = kzalloc_obj(*common, GFP_KERNEL); if (!common) return ERR_PTR(-ENOMEM); common->free_storage_on_release = 1; @@ -2740,7 +2740,7 @@ int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n) struct fsg_buffhd *bh, *buffhds; int i; - buffhds = kcalloc(n, sizeof(*buffhds), GFP_KERNEL); + buffhds = kzalloc_objs(*buffhds, n, GFP_KERNEL); if (!buffhds) return -ENOMEM; @@ -2887,7 +2887,7 @@ int fsg_common_create_lun(struct fsg_common *common, struct fsg_lun_config *cfg, return -EINVAL; } - lun = kzalloc(sizeof(*lun), GFP_KERNEL); + lun = kzalloc_obj(*lun, GFP_KERNEL); if (!lun) return -ENOMEM; @@ -3311,7 +3311,7 @@ static struct config_group *fsg_lun_make(struct config_group *group, goto out; } - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) { ret = -ENOMEM; goto out; @@ -3489,7 +3489,7 @@ static struct usb_function_instance *fsg_alloc_inst(void) struct fsg_lun_config config; int rc; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -3554,7 +3554,7 @@ static struct usb_function *fsg_alloc(struct usb_function_instance *fi) struct fsg_common *common = opts->common; struct fsg_dev *fsg; - fsg = kzalloc(sizeof(*fsg), GFP_KERNEL); + fsg = kzalloc_obj(*fsg, GFP_KERNEL); if (unlikely(!fsg)) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index f592f9eb85d4..d98f946b1621 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -931,8 +931,8 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f) goto fail; /* allocate temporary function list */ - midi_function = kcalloc((MAX_PORTS * 4) + 11, sizeof(*midi_function), - GFP_KERNEL); + midi_function = kzalloc_objs(*midi_function, (MAX_PORTS * 4) + 11, + GFP_KERNEL); if (!midi_function) { status = -ENOMEM; goto fail; @@ -1279,7 +1279,7 @@ static struct usb_function_instance *f_midi_alloc_inst(void) { struct f_midi_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -1361,8 +1361,7 @@ static struct usb_function *f_midi_alloc(struct usb_function_instance *fi) } /* allocate and initialize one new instance */ - midi = kzalloc(struct_size(midi, in_ports_array, opts->in_ports), - GFP_KERNEL); + midi = kzalloc_flex(*midi, in_ports_array, opts->in_ports, GFP_KERNEL); if (!midi) { status = -ENOMEM; goto setup_fail; diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index 95ec87bed3ee..1a4feca1f083 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -1187,8 +1187,8 @@ static int f_midi2_init_ep(struct f_midi2 *midi2, struct f_midi2_ep *ep, return -ENODEV; usb_ep->complete = complete; - usb_ep->reqs = kcalloc(midi2->info.num_reqs, sizeof(*usb_ep->reqs), - GFP_KERNEL); + usb_ep->reqs = kzalloc_objs(*usb_ep->reqs, midi2->info.num_reqs, + GFP_KERNEL); if (!usb_ep->reqs) return -ENOMEM; for (i = 0; i < midi2->info.num_reqs; i++) { @@ -2340,7 +2340,7 @@ static int f_midi2_block_opts_create(struct f_midi2_ep_opts *ep_opts, goto out; } - block_opts = kzalloc(sizeof(*block_opts), GFP_KERNEL); + block_opts = kzalloc_obj(*block_opts, GFP_KERNEL); if (!block_opts) { ret = -ENOMEM; goto out; @@ -2502,7 +2502,7 @@ static int f_midi2_ep_opts_create(struct f_midi2_opts *opts, { struct f_midi2_ep_opts *ep_opts; - ep_opts = kzalloc(sizeof(*ep_opts), GFP_KERNEL); + ep_opts = kzalloc_obj(*ep_opts, GFP_KERNEL); if (!ep_opts) return -ENOMEM; @@ -2652,7 +2652,7 @@ static struct usb_function_instance *f_midi2_alloc_inst(void) struct f_midi2_block_opts *block_opts; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -2813,7 +2813,7 @@ static struct usb_function *f_midi2_alloc(struct usb_function_instance *fi) struct f_midi2_block *bp; int i, num_eps, blk; - midi2 = kzalloc(sizeof(*midi2), GFP_KERNEL); + midi2 = kzalloc_obj(*midi2, GFP_KERNEL); if (!midi2) return ERR_PTR(-ENOMEM); @@ -2855,8 +2855,8 @@ static struct usb_function *f_midi2_alloc(struct usb_function_instance *fi) } } - midi2->string_defs = kcalloc(midi2->total_blocks + 1, - sizeof(*midi2->string_defs), GFP_KERNEL); + midi2->string_defs = kzalloc_objs(*midi2->string_defs, + midi2->total_blocks + 1, GFP_KERNEL); if (!midi2->string_defs) { do_f_midi2_free(midi2, opts); return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index e23adc132f88..6bbdb10ce3ca 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1683,7 +1683,7 @@ static struct usb_function_instance *ncm_alloc_inst(void) char *names[1]; struct config_group *ncm_interf_group; - struct f_ncm_opts *opts __free(kfree) = kzalloc(sizeof(*opts), GFP_KERNEL); + struct f_ncm_opts *opts __free(kfree) = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_obex.c b/drivers/usb/gadget/function/f_obex.c index 6d498f63183e..e9e9fd70c243 100644 --- a/drivers/usb/gadget/function/f_obex.c +++ b/drivers/usb/gadget/function/f_obex.c @@ -426,7 +426,7 @@ static struct usb_function_instance *obex_alloc_inst(void) struct f_serial_opts *opts; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -461,7 +461,7 @@ static struct usb_function *obex_alloc(struct usb_function_instance *fi) struct f_serial_opts *opts; /* allocate and initialize one new instance */ - obex = kzalloc(sizeof(*obex), GFP_KERNEL); + obex = kzalloc_obj(*obex, GFP_KERNEL); if (!obex) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_phonet.c b/drivers/usb/gadget/function/f_phonet.c index d644d5495fdc..b427dcae456c 100644 --- a/drivers/usb/gadget/function/f_phonet.c +++ b/drivers/usb/gadget/function/f_phonet.c @@ -623,7 +623,7 @@ static struct usb_function_instance *phonet_alloc_inst(void) { struct f_phonet_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -669,7 +669,7 @@ static struct usb_function *phonet_alloc(struct usb_function_instance *fi) struct f_phonet *fp; struct f_phonet_opts *opts; - fp = kzalloc(struct_size(fp, out_reqv, phonet_rxq_size), GFP_KERNEL); + fp = kzalloc_flex(*fp, out_reqv, phonet_rxq_size, GFP_KERNEL); if (!fp) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index b2fa2b56c37e..d0e6435ac7a6 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1374,7 +1374,7 @@ static struct usb_function_instance *gprinter_alloc_inst(void) struct usb_function_instance *ret; int status = 0; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -1482,7 +1482,7 @@ static struct usb_function *gprinter_alloc(struct usb_function_instance *fi) return ERR_PTR(-ENOENT); } - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { mutex_unlock(&opts->lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index 7451e7cb7a85..39a87458bab4 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -673,7 +673,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) rndis_opts = container_of(f->fi, struct f_rndis_opts, func_inst); if (cdev->use_os_string) { - os_desc_table = kzalloc(sizeof(*os_desc_table), GFP_KERNEL); + os_desc_table = kzalloc_obj(*os_desc_table, GFP_KERNEL); if (!os_desc_table) return -ENOMEM; } @@ -888,7 +888,7 @@ static struct usb_function_instance *rndis_alloc_inst(void) char *names[1]; struct config_group *rndis_interf_group; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); opts->rndis_os_desc.ext_compat_id = opts->rndis_ext_compat_id; @@ -956,7 +956,7 @@ static struct usb_function *rndis_alloc(struct usb_function_instance *fi) struct rndis_params *params; /* allocate and initialize one new instance */ - rndis = kzalloc(sizeof(*rndis), GFP_KERNEL); + rndis = kzalloc_obj(*rndis, GFP_KERNEL); if (!rndis) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_serial.c b/drivers/usb/gadget/function/f_serial.c index e6b412e0e045..01fc06b29ab2 100644 --- a/drivers/usb/gadget/function/f_serial.c +++ b/drivers/usb/gadget/function/f_serial.c @@ -317,7 +317,7 @@ static struct usb_function_instance *gser_alloc_inst(void) struct f_serial_opts *opts; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi) struct f_serial_opts *opts; /* allocate and initialize one new instance */ - gser = kzalloc(sizeof(*gser), GFP_KERNEL); + gser = kzalloc_obj(*gser, GFP_KERNEL); if (!gser) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index 22104e9c6cab..e77e2e83833f 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -844,7 +844,7 @@ static struct usb_function *source_sink_alloc_func( struct f_sourcesink *ss; struct f_ss_opts *ss_opts; - ss = kzalloc(sizeof(*ss), GFP_KERNEL); + ss = kzalloc_obj(*ss, GFP_KERNEL); if (!ss) return ERR_PTR(-ENOMEM); @@ -1297,7 +1297,7 @@ static struct usb_function_instance *source_sink_alloc_inst(void) { struct f_ss_opts *ss_opts; - ss_opts = kzalloc(sizeof(*ss_opts), GFP_KERNEL); + ss_opts = kzalloc_obj(*ss_opts, GFP_KERNEL); if (!ss_opts) return ERR_PTR(-ENOMEM); mutex_init(&ss_opts->lock); diff --git a/drivers/usb/gadget/function/f_subset.c b/drivers/usb/gadget/function/f_subset.c index ea3fdd842462..4913f60db048 100644 --- a/drivers/usb/gadget/function/f_subset.c +++ b/drivers/usb/gadget/function/f_subset.c @@ -428,7 +428,7 @@ static struct usb_function_instance *geth_alloc_inst(void) { struct f_gether_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -467,7 +467,7 @@ static struct usb_function *geth_alloc(struct usb_function_instance *fi) int status; /* allocate and initialize one new instance */ - geth = kzalloc(sizeof(*geth), GFP_KERNEL); + geth = kzalloc_obj(*geth, GFP_KERNEL); if (!geth) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index efb94fd82533..29d6fd6ce935 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1676,7 +1676,7 @@ static struct se_portal_group *usbg_make_tpg(struct se_wwn *wwn, goto unlock_dep; } - tpg = kzalloc(sizeof(struct usbg_tpg), GFP_KERNEL); + tpg = kzalloc_obj(struct usbg_tpg, GFP_KERNEL); ret = -ENOMEM; if (!tpg) goto unref_dep; @@ -1768,7 +1768,7 @@ static struct se_wwn *usbg_make_tport( if (!wnn_name) return ERR_PTR(-EINVAL); - tport = kzalloc(sizeof(struct usbg_tport), GFP_KERNEL); + tport = kzalloc_obj(struct usbg_tport, GFP_KERNEL); if (!(tport)) return ERR_PTR(-ENOMEM); @@ -1861,7 +1861,7 @@ static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name) goto out_unlock; } - tv_nexus = kzalloc(sizeof(*tv_nexus), GFP_KERNEL); + tv_nexus = kzalloc_obj(*tv_nexus, GFP_KERNEL); if (!tv_nexus) { ret = -ENOMEM; goto out_unlock; @@ -2400,7 +2400,7 @@ static int tcm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) if ((alt == USB_G_ALT_INT_BBB) || (alt == USB_G_ALT_INT_UAS)) { struct guas_setup_wq *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (!work) return -ENOMEM; INIT_WORK(&work->work, tcm_delayed_set_alt); @@ -2535,7 +2535,7 @@ static struct usb_function_instance *tcm_alloc_inst(void) int i; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -2590,7 +2590,7 @@ static struct usb_function *tcm_alloc(struct usb_function_instance *fi) return ERR_PTR(-ENODEV); } - fu = kzalloc(sizeof(*fu), GFP_KERNEL); + fu = kzalloc_obj(*fu, GFP_KERNEL); if (!fu) { mutex_unlock(&tpg_instances_lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index efe9f270b02d..58ada4855de8 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -451,7 +451,7 @@ static int audio_notify(struct g_audio *audio, int unit_id, int cs) goto err_dec_int_count; } - msg = kmalloc(sizeof(*msg), GFP_ATOMIC); + msg = kmalloc_obj(*msg, GFP_ATOMIC); if (msg == NULL) { ret = -ENOMEM; goto err_free_request; @@ -1748,7 +1748,7 @@ static struct usb_function_instance *f_audio_alloc_inst(void) { struct f_uac1_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -1831,7 +1831,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) struct f_uac1_opts *opts; /* allocate and initialize one new instance */ - uac1 = kzalloc(sizeof(*uac1), GFP_KERNEL); + uac1 = kzalloc_obj(*uac1, GFP_KERNEL); if (!uac1) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c index 8fc452b4b39a..ed7e1f061784 100644 --- a/drivers/usb/gadget/function/f_uac1_legacy.c +++ b/drivers/usb/gadget/function/f_uac1_legacy.c @@ -251,7 +251,7 @@ static struct f_audio_buf *f_audio_buffer_alloc(int buf_size) { struct f_audio_buf *copy_buf; - copy_buf = kzalloc(sizeof *copy_buf, GFP_ATOMIC); + copy_buf = kzalloc_obj(*copy_buf, GFP_ATOMIC); if (!copy_buf) return ERR_PTR(-ENOMEM); @@ -942,7 +942,7 @@ static struct usb_function_instance *f_audio_alloc_inst(void) { struct f_uac1_legacy_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -985,7 +985,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) struct f_uac1_legacy_opts *opts; /* allocate and initialize one new instance */ - audio = kzalloc(sizeof(*audio), GFP_KERNEL); + audio = kzalloc_obj(*audio, GFP_KERNEL); if (!audio) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 98f0f50dc7a8..c66908bbe714 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -1388,7 +1388,7 @@ afunc_notify(struct g_audio *agdev, int unit_id, int cs) goto err_dec_int_count; } - msg = kzalloc(sizeof(*msg), GFP_ATOMIC); + msg = kzalloc_obj(*msg, GFP_ATOMIC); if (msg == NULL) { ret = -ENOMEM; goto err_free_request; @@ -2189,7 +2189,7 @@ static struct usb_function_instance *afunc_alloc_inst(void) { struct f_uac2_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); @@ -2278,7 +2278,7 @@ static struct usb_function *afunc_alloc(struct usb_function_instance *fi) struct f_uac2 *uac2; struct f_uac2_opts *opts; - uac2 = kzalloc(sizeof(*uac2), GFP_KERNEL); + uac2 = kzalloc_obj(*uac2, GFP_KERNEL); if (uac2 == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index a96476507d2f..4b9846ab99f2 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -887,7 +887,7 @@ static struct usb_function_instance *uvc_alloc_inst(void) struct uvc_descriptor_header **ctl_cls; int ret; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return ERR_PTR(-ENOMEM); opts->func_inst.free_func_inst = uvc_free_inst; @@ -1042,7 +1042,7 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) struct uvc_descriptor_header **strm_cls; struct config_item *streaming, *header, *h; - uvc = kzalloc(sizeof(*uvc), GFP_KERNEL); + uvc = kzalloc_obj(*uvc, GFP_KERNEL); if (uvc == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c index afd75d72412c..1e168666a3f5 100644 --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c @@ -892,7 +892,7 @@ struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v) return ERR_PTR(-ENODEV); } - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) { rndis_put_nr(i); diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index ca8dbec65f73..24c934bbf0e5 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1191,7 +1191,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, if (!g_audio) return -EINVAL; - uac = kzalloc(sizeof(*uac), GFP_KERNEL); + uac = kzalloc_obj(*uac, GFP_KERNEL); if (!uac) return -ENOMEM; g_audio->uac = uac; @@ -1209,9 +1209,8 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, prm->max_psize = g_audio->out_ep_maxpsize; prm->srate = params->c_srates[0]; - prm->reqs = kcalloc(params->req_number, - sizeof(struct usb_request *), - GFP_KERNEL); + prm->reqs = kzalloc_objs(struct usb_request *, + params->req_number, GFP_KERNEL); if (!prm->reqs) { err = -ENOMEM; goto fail; @@ -1234,9 +1233,8 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, prm->max_psize = g_audio->in_ep_maxpsize; prm->srate = params->p_srates[0]; - prm->reqs = kcalloc(params->req_number, - sizeof(struct usb_request *), - GFP_KERNEL); + prm->reqs = kzalloc_objs(struct usb_request *, + params->req_number, GFP_KERNEL); if (!prm->reqs) { err = -ENOMEM; goto fail; diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 1cce5317181a..e61beaa0c53d 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1082,7 +1082,7 @@ static int gs_console_init(struct gs_port *port) if (port->console) return 0; - cons = kzalloc(sizeof(*port->console), GFP_KERNEL); + cons = kzalloc_obj(*port->console, GFP_KERNEL); if (!cons) return -ENOMEM; @@ -1215,7 +1215,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) goto out; } - port = kzalloc(sizeof(struct gs_port), GFP_KERNEL); + port = kzalloc_obj(struct gs_port, GFP_KERNEL); if (port == NULL) { ret = -ENOMEM; goto out; diff --git a/drivers/usb/gadget/function/u_uac1_legacy.c b/drivers/usb/gadget/function/u_uac1_legacy.c index dd21c251542c..e95c2fc7fc10 100644 --- a/drivers/usb/gadget/function/u_uac1_legacy.c +++ b/drivers/usb/gadget/function/u_uac1_legacy.c @@ -106,7 +106,7 @@ static int playback_default_hw_params(struct gaudio_snd_dev *snd) snd->channels = 2; snd->rate = 48000; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 4cec6c586d67..553057cbf63a 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -158,7 +158,7 @@ static int uvcg_config_create_group(struct config_group *parent, { struct config_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; @@ -270,7 +270,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group, { struct uvcg_control_header *h; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -1273,7 +1273,7 @@ static struct config_item *uvcg_extension_make(struct config_group *group, const opts_item = group->cg_item.ci_parent->ci_parent; opts = to_f_uvc_opts(opts_item); - xu = kzalloc(sizeof(*xu), GFP_KERNEL); + xu = kzalloc_obj(*xu, GFP_KERNEL); if (!xu) return ERR_PTR(-ENOMEM); @@ -1437,7 +1437,7 @@ static int uvcg_control_class_create_children(struct config_group *parent) for (i = 0; i < ARRAY_SIZE(names); ++i) { struct uvcg_control_class_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; @@ -1785,7 +1785,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src, uvcg_format_set_indices(to_config_group(target)); - format_ptr = kzalloc(sizeof(*format_ptr), GFP_KERNEL); + format_ptr = kzalloc_obj(*format_ptr, GFP_KERNEL); if (!format_ptr) { ret = -ENOMEM; goto out; @@ -1899,7 +1899,7 @@ static struct config_item { struct uvcg_streaming_header *h; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -2163,7 +2163,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group, struct config_item *opts_item; struct uvcg_frame_ptr *frame_ptr; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -2197,7 +2197,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group, return ERR_PTR(-EINVAL); } - frame_ptr = kzalloc(sizeof(*frame_ptr), GFP_KERNEL); + frame_ptr = kzalloc_obj(*frame_ptr, GFP_KERNEL); if (!frame_ptr) { mutex_unlock(&opts->lock); kfree(h); @@ -2483,7 +2483,7 @@ static struct config_group *uvcg_uncompressed_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -2675,7 +2675,7 @@ static struct config_group *uvcg_mjpeg_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -2926,7 +2926,7 @@ static struct config_group *uvcg_framebased_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (!h) return ERR_PTR(-ENOMEM); @@ -3075,7 +3075,7 @@ static struct config_group *uvcg_color_matching_make(struct config_group *group, { struct uvcg_color_matching *color_match; - color_match = kzalloc(sizeof(*color_match), GFP_KERNEL); + color_match = kzalloc_obj(*color_match, GFP_KERNEL); if (!color_match) return ERR_PTR(-ENOMEM); @@ -3097,7 +3097,7 @@ static int uvcg_color_matching_create_children(struct config_group *parent) { struct uvcg_color_matching *color_match; - color_match = kzalloc(sizeof(*color_match), GFP_KERNEL); + color_match = kzalloc_obj(*color_match, GFP_KERNEL); if (!color_match) return -ENOMEM; @@ -3553,7 +3553,7 @@ static int uvcg_streaming_class_create_children(struct config_group *parent) for (i = 0; i < ARRAY_SIZE(names); ++i) { struct uvcg_streaming_class_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c index fd4b998ccd16..574b3a8986a0 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c @@ -667,7 +667,7 @@ uvc_v4l2_open(struct file *file) struct uvc_device *uvc = video_get_drvdata(vdev); struct uvc_file_handle *handle; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (handle == NULL) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index f568dee08b3b..b2784a57dbcd 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c @@ -559,7 +559,7 @@ uvc_video_alloc_requests(struct uvc_video *video) uvc_video_prep_requests(video); for (i = 0; i < video->uvc_num_requests; i++) { - ureq = kzalloc(sizeof(struct uvc_request), GFP_KERNEL); + ureq = kzalloc_obj(struct uvc_request, GFP_KERNEL); if (ureq == NULL) goto error; diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c index d70fb5bc2357..af8968ef9380 100644 --- a/drivers/usb/gadget/legacy/dbgp.c +++ b/drivers/usb/gadget/legacy/dbgp.c @@ -298,7 +298,7 @@ static int dbgp_bind(struct usb_gadget *gadget, dbgp.req->length = DBGP_REQ_EP0_LEN; #ifdef CONFIG_USB_G_DBGP_SERIAL - dbgp.serial = kzalloc(sizeof(struct gserial), GFP_KERNEL); + dbgp.serial = kzalloc_obj(struct gserial, GFP_KERNEL); if (!dbgp.serial) { stp = 3; err = -ENOMEM; diff --git a/drivers/usb/gadget/legacy/g_ffs.c b/drivers/usb/gadget/legacy/g_ffs.c index 578556422ea3..98a08efe86dd 100644 --- a/drivers/usb/gadget/legacy/g_ffs.c +++ b/drivers/usb/gadget/legacy/g_ffs.c @@ -188,7 +188,7 @@ static int __init gfs_init(void) /* * Allocate in one chunk for easier maintenance */ - f_ffs[0] = kcalloc(func_num * N_CONF, sizeof(*f_ffs[0]), GFP_KERNEL); + f_ffs[0] = kzalloc_objs(*f_ffs[0], func_num * N_CONF, GFP_KERNEL); if (!f_ffs[0]) { ret = -ENOMEM; goto no_func; @@ -196,7 +196,7 @@ static int __init gfs_init(void) for (i = 1; i < N_CONF; ++i) f_ffs[i] = f_ffs[0] + i * func_num; - fi_ffs = kcalloc(func_num, sizeof(*fi_ffs), GFP_KERNEL); + fi_ffs = kzalloc_objs(*fi_ffs, func_num, GFP_KERNEL); if (!fi_ffs) { ret = -ENOMEM; goto no_func; diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c index 3684546e8801..bc25c04daaaf 100644 --- a/drivers/usb/gadget/legacy/hid.c +++ b/drivers/usb/gadget/legacy/hid.c @@ -227,7 +227,7 @@ static int hidg_plat_driver_probe(struct platform_device *pdev) return -ENODEV; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 62566a8e7451..52512fba80ec 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -173,7 +173,7 @@ static struct dev_data *dev_new (void) { struct dev_data *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; dev->state = STATE_DEV_DISABLED; @@ -614,7 +614,7 @@ ep_read_iter(struct kiocb *iocb, struct iov_iter *to) if (value >= 0 && (copy_to_iter(buf, value, to) != value)) value = -EFAULT; } else { - struct kiocb_priv *priv = kzalloc(sizeof *priv, GFP_KERNEL); + struct kiocb_priv *priv = kzalloc_obj(*priv, GFP_KERNEL); value = -ENOMEM; if (!priv) goto fail; @@ -682,7 +682,7 @@ ep_write_iter(struct kiocb *iocb, struct iov_iter *from) } else if (is_sync_kiocb(iocb)) { value = ep_io(epdata, buf, len); } else { - struct kiocb_priv *priv = kzalloc(sizeof *priv, GFP_KERNEL); + struct kiocb_priv *priv = kzalloc_obj(*priv, GFP_KERNEL); value = -ENOMEM; if (priv) { value = ep_aio(iocb, priv, epdata, buf, len); @@ -1598,7 +1598,7 @@ static int activate_ep_files (struct dev_data *dev) gadget_for_each_ep (ep, dev->gadget) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto enomem0; data->state = STATE_EP_DISABLED; diff --git a/drivers/usb/gadget/legacy/raw_gadget.c b/drivers/usb/gadget/legacy/raw_gadget.c index 46f343ba48b3..5cb8d262329f 100644 --- a/drivers/usb/gadget/legacy/raw_gadget.c +++ b/drivers/usb/gadget/legacy/raw_gadget.c @@ -190,7 +190,7 @@ static struct raw_dev *dev_new(void) { struct raw_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; /* Matches kref_put() in raw_release(). */ @@ -1251,7 +1251,7 @@ static int raw_ioctl_eps_info(struct raw_dev *dev, unsigned long value) struct usb_raw_eps_info *info; struct raw_ep *ep; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { ret = -ENOMEM; goto out; diff --git a/drivers/usb/gadget/udc/amd5536udc_pci.c b/drivers/usb/gadget/udc/amd5536udc_pci.c index a36913ae31f9..e709bd4976c5 100644 --- a/drivers/usb/gadget/udc/amd5536udc_pci.c +++ b/drivers/usb/gadget/udc/amd5536udc_pci.c @@ -95,7 +95,7 @@ static int udc_pci_probe( } /* init */ - dev = kzalloc(sizeof(struct udc), GFP_KERNEL); + dev = kzalloc_obj(struct udc, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c b/drivers/usb/gadget/udc/aspeed-vhub/core.c index 19c1849ae665..4a8b9ff8368f 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/core.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c @@ -78,7 +78,7 @@ struct usb_request *ast_vhub_alloc_request(struct usb_ep *u_ep, { struct ast_vhub_req *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; return &req->req; diff --git a/drivers/usb/gadget/udc/aspeed-vhub/dev.c b/drivers/usb/gadget/udc/aspeed-vhub/dev.c index a09f72772e6e..c79522164f18 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/dev.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/dev.c @@ -560,7 +560,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) * endpoint 0. */ d->max_epns = min_t(u32, vhub->max_epns, 30); - d->epns = kcalloc(d->max_epns, sizeof(*d->epns), GFP_KERNEL); + d->epns = kzalloc_objs(*d->epns, d->max_epns, GFP_KERNEL); if (!d->epns) return -ENOMEM; @@ -569,7 +569,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) * named "parent" devices for each port so we create a sub device * here for that purpose */ - d->port_dev = kzalloc(sizeof(struct device), GFP_KERNEL); + d->port_dev = kzalloc_obj(struct device, GFP_KERNEL); if (!d->port_dev) { rc = -ENOMEM; goto fail_alloc; diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c index 353bfb1ff0a1..7fc6696b7694 100644 --- a/drivers/usb/gadget/udc/aspeed_udc.c +++ b/drivers/usb/gadget/udc/aspeed_udc.c @@ -452,7 +452,7 @@ static struct usb_request *ast_udc_ep_alloc_request(struct usb_ep *_ep, struct ast_udc_ep *ep = to_ast_ep(_ep); struct ast_udc_request *req; - req = kzalloc(sizeof(struct ast_udc_request), gfp_flags); + req = kzalloc_obj(struct ast_udc_request, gfp_flags); if (!req) { EP_DBG(ep, "request allocation failed\n"); return NULL; diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index 42b94d858e37..5aa360ba4f03 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -585,7 +585,7 @@ at91_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct at91_request *req; - req = kzalloc(sizeof (struct at91_request), gfp_flags); + req = kzalloc_obj(struct at91_request, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 0c6f2ad81d37..427535bf35a6 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -40,7 +40,7 @@ static int queue_dbg_open(struct inode *inode, struct file *file) struct usba_request *req, *req_copy; struct list_head *queue_data; - queue_data = kmalloc(sizeof(*queue_data), GFP_KERNEL); + queue_data = kmalloc_obj(*queue_data, GFP_KERNEL); if (!queue_data) return -ENOMEM; INIT_LIST_HEAD(queue_data); @@ -702,7 +702,7 @@ usba_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) DBG(DBG_GADGET, "ep_alloc_request: %p, 0x%x\n", _ep, gfp_flags); - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 502612a5650e..c4f9ea45bdbb 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -1115,7 +1115,7 @@ static struct usb_request *bcm63xx_udc_alloc_request(struct usb_ep *ep, { struct bcm63xx_req *breq; - breq = kzalloc(sizeof(*breq), mem_flags); + breq = kzalloc_obj(*breq, mem_flags); if (!breq) return NULL; return &breq->req; diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index f47aac078f6b..51602d9eca02 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -397,8 +397,8 @@ static int bdc_mem_alloc(struct bdc *bdc) "ieps:%d eops:%d num_eps:%d\n", num_ieps, num_oeps, bdc->num_eps); /* allocate array of ep pointers */ - bdc->bdc_ep_array = kcalloc(bdc->num_eps, sizeof(struct bdc_ep *), - GFP_KERNEL); + bdc->bdc_ep_array = kzalloc_objs(struct bdc_ep *, bdc->num_eps, + GFP_KERNEL); if (!bdc->bdc_ep_array) goto fail; diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index f995cfa9b99e..a7f2fe29e433 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -138,16 +138,15 @@ static int ep_bd_list_alloc(struct bdc_ep *ep) __func__, ep, num_tabs); /* Allocate memory for table array */ - ep->bd_list.bd_table_array = kcalloc(num_tabs, - sizeof(struct bd_table *), - GFP_ATOMIC); + ep->bd_list.bd_table_array = kzalloc_objs(struct bd_table *, num_tabs, + GFP_ATOMIC); if (!ep->bd_list.bd_table_array) return -ENOMEM; /* Allocate memory for each table */ for (index = 0; index < num_tabs; index++) { /* Allocate memory for bd_table structure */ - bd_table = kzalloc(sizeof(*bd_table), GFP_ATOMIC); + bd_table = kzalloc_obj(*bd_table, GFP_ATOMIC); if (!bd_table) goto fail; @@ -1829,7 +1828,7 @@ static struct usb_request *bdc_gadget_alloc_request(struct usb_ep *_ep, struct bdc_req *req; struct bdc_ep *ep; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -1946,7 +1945,7 @@ static int init_ep(struct bdc *bdc, u32 epnum, u32 dir) struct bdc_ep *ep; dev_dbg(bdc->dev, "%s epnum=%d dir=%d\n", __func__, epnum, dir); - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c index 9b53daf76583..308d3c468ab1 100644 --- a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c +++ b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c @@ -1505,7 +1505,7 @@ struct usb_request *cdns2_gadget_ep_alloc_request(struct usb_ep *ep, struct cdns2_endpoint *pep = ep_to_cdns2_ep(ep); struct cdns2_request *preq; - preq = kzalloc(sizeof(*preq), gfp_flags); + preq = kzalloc_obj(*preq, gfp_flags); if (!preq) return NULL; diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 8dbe79bdc0f9..394ed540c22f 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -1393,7 +1393,7 @@ int usb_add_gadget(struct usb_gadget *gadget) struct usb_udc *udc; int ret = -ENOMEM; - udc = kzalloc(sizeof(*udc), GFP_KERNEL); + udc = kzalloc_obj(*udc, GFP_KERNEL); if (!udc) goto error; diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 1cefca660773..e183f36b2b0b 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -666,7 +666,7 @@ static struct usb_request *dummy_alloc_request(struct usb_ep *_ep, if (!_ep) return NULL; - req = kzalloc(sizeof(*req), mem_flags); + req = kzalloc_obj(*req, mem_flags); if (!req) return NULL; INIT_LIST_HEAD(&req->queue); @@ -1270,7 +1270,7 @@ static int dummy_urb_enqueue( unsigned long flags; int rc; - urbp = kmalloc(sizeof *urbp, mem_flags); + urbp = kmalloc_obj(*urbp, mem_flags); if (!urbp) return -ENOMEM; urbp->urb = urb; @@ -2819,7 +2819,7 @@ static int __init dummy_hcd_init(void) } } for (i = 0; i < mod_data.num; i++) { - dum[i] = kzalloc(sizeof(struct dummy), GFP_KERNEL); + dum[i] = kzalloc_obj(struct dummy, GFP_KERNEL); if (!dum[i]) { retval = -ENOMEM; goto err_add_pdata; diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index aacfde06387c..edbffafa6fa7 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -417,7 +417,7 @@ static int qe_ep_rxbd_update(struct qe_ep *ep) bd = ep->rxbase; - ep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC); + ep->rxframe = kmalloc_obj(*ep->rxframe, GFP_ATOMIC); if (!ep->rxframe) return -ENOMEM; @@ -666,7 +666,7 @@ static int qe_ep_init(struct qe_udc *udc, } if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) { - ep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC); + ep->txframe = kmalloc_obj(*ep->txframe, GFP_ATOMIC); if (!ep->txframe) goto en_done2; qe_frame_init(ep->txframe); @@ -1670,7 +1670,7 @@ static struct usb_request *qe_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct qe_req *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -2344,7 +2344,7 @@ static struct qe_udc *qe_udc_config(struct platform_device *ofdev) u64 size; u32 offset; - udc = kzalloc(sizeof(*udc), GFP_KERNEL); + udc = kzalloc_obj(*udc, GFP_KERNEL); if (!udc) goto cleanup; diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 4dea8bc30cf6..961728e92a88 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -678,7 +678,7 @@ fsl_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct fsl_req *req; - req = kzalloc(sizeof *req, gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -2250,7 +2250,7 @@ static int struct_udc_setup(struct fsl_udc *udc, pdata = dev_get_platdata(&pdev->dev); udc->phy_mode = pdata->phy_mode; - udc->eps = kcalloc(udc->max_ep, sizeof(struct fsl_ep), GFP_KERNEL); + udc->eps = kzalloc_objs(struct fsl_ep, udc->max_ep, GFP_KERNEL); if (!udc->eps) { dev_err(&udc->gadget.dev, "kmalloc udc endpoint status failed\n"); goto eps_alloc_failed; @@ -2369,7 +2369,7 @@ static int fsl_udc_probe(struct platform_device *pdev) unsigned int i; u32 dccparams; - udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL); + udc_controller = kzalloc_obj(struct fsl_udc, GFP_KERNEL); if (udc_controller == NULL) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index b860c2e76449..f9ddf22c57ef 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c @@ -273,7 +273,7 @@ goku_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) if (!_ep) return NULL; - req = kzalloc(sizeof *req, gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -1755,7 +1755,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* alloc, and start init */ - dev = kzalloc (sizeof *dev, GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { retval = -ENOMEM; goto err; diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c index bf5b3c964c18..cdcbfae140e9 100644 --- a/drivers/usb/gadget/udc/gr_udc.c +++ b/drivers/usb/gadget/udc/gr_udc.c @@ -347,7 +347,7 @@ static struct usb_request *gr_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct gr_request *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 83c7e243dcf9..044c31869cfb 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -1705,7 +1705,7 @@ static struct usb_request *lpc32xx_ep_alloc_request(struct usb_ep *_ep, { struct lpc32xx_request *req; - req = kzalloc(sizeof(struct lpc32xx_request), gfp_flags); + req = kzalloc_obj(struct lpc32xx_request, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 54885175b8a4..08ae3d5a79ff 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1330,7 +1330,7 @@ static struct usb_request *m66592_alloc_request(struct usb_ep *_ep, { struct m66592_request *req; - req = kzalloc(sizeof(struct m66592_request), gfp_flags); + req = kzalloc_obj(struct m66592_request, gfp_flags); if (!req) return NULL; @@ -1571,7 +1571,7 @@ static int m66592_probe(struct platform_device *pdev) } /* initialize ucd */ - m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); + m66592 = kzalloc_obj(struct m66592, GFP_KERNEL); if (m66592 == NULL) { ret = -ENOMEM; goto clean_up; diff --git a/drivers/usb/gadget/udc/max3420_udc.c b/drivers/usb/gadget/udc/max3420_udc.c index 7349ea774adf..11fd61cba5af 100644 --- a/drivers/usb/gadget/udc/max3420_udc.c +++ b/drivers/usb/gadget/udc/max3420_udc.c @@ -1007,7 +1007,7 @@ static struct usb_request *max3420_alloc_request(struct usb_ep *_ep, struct max3420_ep *ep = to_max3420_ep(_ep); struct max3420_req *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 8ea1adc7461d..aa1a88a2aa3b 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -554,7 +554,7 @@ static struct usb_request } ep = container_of(_ep, struct net2280_ep, ep); - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -3625,7 +3625,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id) int retval, i; /* alloc, and start init */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { retval = -ENOMEM; goto done; diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index 062bf2b57d2e..8dda63c38ee5 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -267,7 +267,7 @@ omap_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) { struct omap_req *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; @@ -2627,7 +2627,7 @@ omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv) /* UDC_PULLUP_EN gates the chip clock */ /* OTG_SYSCON_1 |= DEV_IDLE_EN; */ - udc = kzalloc(sizeof(*udc), GFP_KERNEL); + udc = kzalloc_obj(*udc, GFP_KERNEL); if (!udc) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index 0b20ecbe64f9..0a6886428739 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -1717,7 +1717,7 @@ static struct usb_request *pch_udc_alloc_request(struct usb_ep *usbep, if (!usbep) return NULL; ep = container_of(usbep, struct pch_udc_ep, ep); - req = kzalloc(sizeof *req, gfp); + req = kzalloc_obj(*req, gfp); if (!req) return NULL; req->req.dma = DMA_ADDR_INVALID; diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c index b97fb7b0cb2c..b3d58d7c3a77 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.c +++ b/drivers/usb/gadget/udc/pxa25x_udc.c @@ -508,7 +508,7 @@ pxa25x_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags) { struct pxa25x_request *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 897f53601b5b..4fac477d24c0 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -573,7 +573,7 @@ pxa_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct pxa27x_request *req; - req = kzalloc(sizeof *req, gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index e5c2630e3711..e7a5d8553c0e 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c @@ -1580,7 +1580,7 @@ static struct usb_request *r8a66597_alloc_request(struct usb_ep *_ep, { struct r8a66597_request *req; - req = kzalloc(sizeof(struct r8a66597_request), gfp_flags); + req = kzalloc_obj(struct r8a66597_request, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 7cdcc9d16b8b..b0b264d34919 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2265,7 +2265,7 @@ static struct usb_request *__renesas_usb3_ep_alloc_request(gfp_t gfp_flags) { struct renesas_usb3_request *usb3_req; - usb3_req = kzalloc(sizeof(struct renesas_usb3_request), gfp_flags); + usb3_req = kzalloc_obj(struct renesas_usb3_request, gfp_flags); if (!usb3_req) return NULL; diff --git a/drivers/usb/gadget/udc/renesas_usbf.c b/drivers/usb/gadget/udc/renesas_usbf.c index 4c201574a0af..5d510665da1f 100644 --- a/drivers/usb/gadget/udc/renesas_usbf.c +++ b/drivers/usb/gadget/udc/renesas_usbf.c @@ -2081,7 +2081,7 @@ static struct usb_request *usbf_ep_alloc_request(struct usb_ep *_ep, if (!_ep) return NULL; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c index 373942ceb076..5f9514623956 100644 --- a/drivers/usb/gadget/udc/snps_udc_core.c +++ b/drivers/usb/gadget/udc/snps_udc_core.c @@ -523,7 +523,7 @@ udc_alloc_request(struct usb_ep *usbep, gfp_t gfp) ep = container_of(usbep, struct udc_ep, ep); VDBG(ep->dev, "udc_alloc_req(): ep%d\n", ep->num); - req = kzalloc(sizeof(struct udc_request), gfp); + req = kzalloc_obj(struct udc_request, gfp); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c index 7f7251c10e95..e9d33be02866 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -1906,7 +1906,7 @@ tegra_xudc_ep_alloc_request(struct usb_ep *usb_ep, gfp_t gfp) { struct tegra_xudc_request *req; - req = kzalloc(sizeof(*req), gfp); + req = kzalloc_obj(*req, gfp); if (!req) return NULL; diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index 8d803a612bb1..bef06fe7543b 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -970,7 +970,7 @@ static struct usb_request *xudc_ep_alloc_request(struct usb_ep *_ep, struct xusb_ep *ep = to_xusb_ep(_ep); struct xusb_req *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 435001128221..cc3f2da39d71 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c @@ -629,7 +629,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) unsigned i; __hc32 tag; - seen = kmalloc_array(DBG_SCHED_LIMIT, sizeof(*seen), GFP_ATOMIC); + seen = kmalloc_objs(*seen, DBG_SCHED_LIMIT, GFP_ATOMIC); if (!seen) return 0; seen_count = 0; @@ -917,7 +917,7 @@ static struct debug_buffer *alloc_buffer(struct usb_bus *bus, { struct debug_buffer *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (buf) { buf->bus = bus; diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4c6c08b675b5..a2d4499e67e0 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -69,7 +69,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) struct ehci_qh *qh; dma_addr_t dma; - qh = kzalloc(sizeof *qh, GFP_ATOMIC); + qh = kzalloc_obj(*qh, GFP_ATOMIC); if (!qh) goto done; qh->hw = (struct ehci_qh_hw *) diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 7e834587e7de..a241337c9af8 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -117,9 +117,8 @@ static struct ehci_tt *find_tt(struct usb_device *udev) if (utt->multi) { tt_index = utt->hcpriv; if (!tt_index) { /* Create the index array */ - tt_index = kcalloc(utt->hub->maxchild, - sizeof(*tt_index), - GFP_ATOMIC); + tt_index = kzalloc_objs(*tt_index, utt->hub->maxchild, + GFP_ATOMIC); if (!tt_index) return ERR_PTR(-ENOMEM); utt->hcpriv = tt_index; @@ -137,7 +136,7 @@ static struct ehci_tt *find_tt(struct usb_device *udev) struct ehci_hcd *ehci = hcd_to_ehci(bus_to_hcd(udev->bus)); - tt = kzalloc(sizeof(*tt), GFP_ATOMIC); + tt = kzalloc_obj(*tt, GFP_ATOMIC); if (!tt) { if (allocated_index) { utt->hcpriv = NULL; @@ -1003,7 +1002,7 @@ iso_stream_alloc(gfp_t mem_flags) { struct ehci_iso_stream *stream; - stream = kzalloc(sizeof(*stream), mem_flags); + stream = kzalloc_obj(*stream, mem_flags); if (likely(stream != NULL)) { INIT_LIST_HEAD(&stream->td_list); INIT_LIST_HEAD(&stream->free_list); @@ -1167,7 +1166,7 @@ iso_sched_alloc(unsigned packets, gfp_t mem_flags) { struct ehci_iso_sched *iso_sched; - iso_sched = kzalloc(struct_size(iso_sched, packet, packets), mem_flags); + iso_sched = kzalloc_flex(*iso_sched, packet, packets, mem_flags); if (likely(iso_sched != NULL)) INIT_LIST_HEAD(&iso_sched->td_list); diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 22a0942f0bce..445847b92f33 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c @@ -193,7 +193,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) { int i; - fhci->hc_list = kzalloc(sizeof(*fhci->hc_list), GFP_KERNEL); + fhci->hc_list = kzalloc_obj(*fhci->hc_list, GFP_KERNEL); if (!fhci->hc_list) goto err; @@ -203,7 +203,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) INIT_LIST_HEAD(&fhci->hc_list->intr_list); INIT_LIST_HEAD(&fhci->hc_list->done_list); - fhci->vroot_hub = kzalloc(sizeof(*fhci->vroot_hub), GFP_KERNEL); + fhci->vroot_hub = kzalloc_obj(*fhci->vroot_hub, GFP_KERNEL); if (!fhci->vroot_hub) goto err; @@ -217,7 +217,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) for (i = 0; i < MAX_TDS; i++) { struct td *td; - td = kmalloc(sizeof(*td), GFP_KERNEL); + td = kmalloc_obj(*td, GFP_KERNEL); if (!td) goto err; fhci_recycle_empty_td(fhci, td); @@ -225,7 +225,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) for (i = 0; i < MAX_EDS; i++) { struct ed *ed; - ed = kmalloc(sizeof(*ed), GFP_KERNEL); + ed = kmalloc_obj(*ed, GFP_KERNEL); if (!ed) goto err; fhci_recycle_empty_ed(fhci, ed); @@ -264,7 +264,7 @@ static int fhci_usb_init(struct fhci_hcd *fhci) usb->max_frame_usage = FRAME_TIME_USAGE; usb->sw_transaction_time = SW_FIX_TIME_BETWEEN_TRANSACTION; - usb->actual_frame = kzalloc(sizeof(*usb->actual_frame), GFP_KERNEL); + usb->actual_frame = kzalloc_obj(*usb->actual_frame, GFP_KERNEL); if (!usb->actual_frame) { fhci_usb_free(usb); return -ENOMEM; @@ -306,7 +306,7 @@ static struct fhci_usb *fhci_create_lld(struct fhci_hcd *fhci) struct fhci_usb *usb; /* allocate memory for SCC data structure */ - usb = kzalloc(sizeof(*usb), GFP_KERNEL); + usb = kzalloc_obj(*usb, GFP_KERNEL); if (!usb) return NULL; @@ -426,12 +426,12 @@ static int fhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, } /* allocate the private part of the URB */ - urb_priv = kzalloc(sizeof(*urb_priv), mem_flags); + urb_priv = kzalloc_obj(*urb_priv, mem_flags); if (!urb_priv) return -ENOMEM; /* allocate the private part of the URB */ - urb_priv->tds = kcalloc(size, sizeof(*urb_priv->tds), mem_flags); + urb_priv->tds = kzalloc_objs(*urb_priv->tds, size, mem_flags); if (!urb_priv->tds) { kfree(urb_priv); return -ENOMEM; diff --git a/drivers/usb/host/fhci-mem.c b/drivers/usb/host/fhci-mem.c index 658aedc6adc1..d5951fc1964a 100644 --- a/drivers/usb/host/fhci-mem.c +++ b/drivers/usb/host/fhci-mem.c @@ -42,7 +42,7 @@ static struct td *get_empty_td(struct fhci_hcd *fhci) td = list_entry(fhci->empty_tds.next, struct td, node); list_del(fhci->empty_tds.next); } else { - td = kmalloc(sizeof(*td), GFP_ATOMIC); + td = kmalloc_obj(*td, GFP_ATOMIC); if (!td) fhci_err(fhci, "No memory to allocate to TD\n"); else @@ -66,7 +66,7 @@ struct ed *fhci_get_empty_ed(struct fhci_hcd *fhci) ed = list_entry(fhci->empty_eds.next, struct ed, node); list_del(fhci->empty_eds.next); } else { - ed = kmalloc(sizeof(*ed), GFP_ATOMIC); + ed = kmalloc_obj(*ed, GFP_ATOMIC); if (!ed) fhci_err(fhci, "No memory to allocate to ED\n"); else diff --git a/drivers/usb/host/fhci-tds.c b/drivers/usb/host/fhci-tds.c index d98fd9e1af0b..6fb4feb4ad7b 100644 --- a/drivers/usb/host/fhci-tds.c +++ b/drivers/usb/host/fhci-tds.c @@ -161,7 +161,7 @@ u32 fhci_create_ep(struct fhci_usb *usb, enum fhci_mem_alloc data_mem, return -EINVAL; } - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; @@ -183,7 +183,7 @@ u32 fhci_create_ep(struct fhci_usb *usb, enum fhci_mem_alloc data_mem, struct packet *pkt; u8 *buff; - pkt = kmalloc(sizeof(*pkt), GFP_KERNEL); + pkt = kmalloc_obj(*pkt, GFP_KERNEL); if (!pkt) { err_for = "frame"; goto err; diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 71c22c4bd163..b5e9056895e4 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -703,7 +703,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd, } /* avoid all allocations within spinlocks: request or endpoint */ if (!hep->hcpriv) { - ep = kzalloc(sizeof *ep, mem_flags); + ep = kzalloc_obj(*ep, mem_flags); if (!ep) return -ENOMEM; } diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 4b5f03f683f7..82e231e05dc2 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1523,7 +1523,7 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) max3421_ep = urb->ep->hcpriv; if (!max3421_ep) { /* gets freed in max3421_endpoint_disable: */ - max3421_ep = kzalloc(sizeof(struct max3421_ep), GFP_ATOMIC); + max3421_ep = kzalloc_obj(struct max3421_ep, GFP_ATOMIC); if (!max3421_ep) { retval = -ENOMEM; goto out; @@ -1878,10 +1878,10 @@ max3421_probe(struct spi_device *spi) INIT_LIST_HEAD(&max3421_hcd->ep_list); spi_set_drvdata(spi, max3421_hcd); - max3421_hcd->tx = kmalloc(sizeof(*max3421_hcd->tx), GFP_KERNEL); + max3421_hcd->tx = kmalloc_obj(*max3421_hcd->tx, GFP_KERNEL); if (!max3421_hcd->tx) goto error; - max3421_hcd->rx = kmalloc(sizeof(*max3421_hcd->rx), GFP_KERNEL); + max3421_hcd->rx = kmalloc_obj(*max3421_hcd->rx, GFP_KERNEL); if (!max3421_hcd->rx) goto error; diff --git a/drivers/usb/host/octeon-hcd.c b/drivers/usb/host/octeon-hcd.c index 361d33b0c4d2..34ce771fa0f5 100644 --- a/drivers/usb/host/octeon-hcd.c +++ b/drivers/usb/host/octeon-hcd.c @@ -1098,7 +1098,7 @@ static struct cvmx_usb_pipe *cvmx_usb_open_pipe(struct octeon_hcd *usb, { struct cvmx_usb_pipe *pipe; - pipe = kzalloc(sizeof(*pipe), GFP_ATOMIC); + pipe = kzalloc_obj(*pipe, GFP_ATOMIC); if (!pipe) return NULL; if ((device_speed == CVMX_USB_SPEED_HIGH) && @@ -2138,7 +2138,7 @@ static struct cvmx_usb_transaction *cvmx_usb_submit_transaction( if (unlikely(pipe->transfer_type != type)) return NULL; - transaction = kzalloc(sizeof(*transaction), GFP_ATOMIC); + transaction = kzalloc_obj(*transaction, GFP_ATOMIC); if (unlikely(!transaction)) return NULL; @@ -3180,9 +3180,8 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, * Allocate a structure to use for our private list of * isochronous packets. */ - iso_packet = kmalloc_array(urb->number_of_packets, - sizeof(struct cvmx_usb_iso_packet), - GFP_ATOMIC); + iso_packet = kmalloc_objs(struct cvmx_usb_iso_packet, + urb->number_of_packets, GFP_ATOMIC); if (iso_packet) { int i; /* Fill the list with the data from the URB */ diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c index 76bc8d56325d..30e22acd9461 100644 --- a/drivers/usb/host/ohci-dbg.c +++ b/drivers/usb/host/ohci-dbg.c @@ -492,7 +492,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) char *next; unsigned i; - seen = kmalloc_array(DBG_SCHED_LIMIT, sizeof(*seen), GFP_ATOMIC); + seen = kmalloc_objs(*seen, DBG_SCHED_LIMIT, GFP_ATOMIC); if (!seen) return 0; seen_count = 0; @@ -667,7 +667,7 @@ static struct debug_buffer *alloc_buffer(struct ohci_hcd *ohci, { struct debug_buffer *buf; - buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL); + buf = kzalloc_obj(struct debug_buffer, GFP_KERNEL); if (buf) { buf->ohci = ohci; diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 30840922f729..129468b1efc2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -190,7 +190,7 @@ static int ohci_urb_enqueue ( } /* allocate the private part of the URB */ - urb_priv = kzalloc(struct_size(urb_priv, td, size), mem_flags); + urb_priv = kzalloc_flex(*urb_priv, td, size, mem_flags); if (!urb_priv) return -ENOMEM; INIT_LIST_HEAD (&urb_priv->pending); diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 6b7c73eff081..ca96067e6d6d 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -1149,7 +1149,7 @@ static int ehci_mem_init(struct oxu_hcd *oxu, gfp_t flags) for (i = 0; i < QTD_NUM; i++) oxu->qtd_used[i] = 0; - oxu->murb_pool = kcalloc(MURB_NUM, sizeof(struct oxu_murb), flags); + oxu->murb_pool = kzalloc_objs(struct oxu_murb, MURB_NUM, flags); if (!oxu->murb_pool) goto fail; diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index d21a03cf5c17..0a26489a40d0 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -337,7 +337,7 @@ static int make_r8a66597_device(struct r8a66597 *r8a66597, struct r8a66597_device *dev; int usb_address = urb->setup_packet[2]; /* urb->pipe is address 0 */ - dev = kzalloc(sizeof(struct r8a66597_device), GFP_ATOMIC); + dev = kzalloc_obj(struct r8a66597_device, GFP_ATOMIC); if (dev == NULL) return -ENOMEM; @@ -1859,7 +1859,7 @@ static struct r8a66597_td *r8a66597_make_td(struct r8a66597 *r8a66597, struct r8a66597_td *td; u16 pipenum; - td = kzalloc(sizeof(struct r8a66597_td), GFP_ATOMIC); + td = kzalloc_obj(struct r8a66597_td, GFP_ATOMIC); if (td == NULL) return NULL; @@ -1901,8 +1901,7 @@ static int r8a66597_urb_enqueue(struct usb_hcd *hcd, goto error_not_linked; if (!hep->hcpriv) { - hep->hcpriv = kzalloc(sizeof(struct r8a66597_pipe), - GFP_ATOMIC); + hep->hcpriv = kzalloc_obj(struct r8a66597_pipe, GFP_ATOMIC); if (!hep->hcpriv) { ret = -ENOMEM; goto error; diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 5d6dba681e50..4ae47edd4b8b 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -814,7 +814,7 @@ static int sl811h_urb_enqueue( /* avoid all allocations within spinlocks */ if (!hep->hcpriv) { - ep = kzalloc(sizeof *ep, mem_flags); + ep = kzalloc_obj(*ep, mem_flags); if (ep == NULL) return -ENOMEM; } diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index 16d157013018..afdbcac3185c 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c @@ -178,7 +178,7 @@ static int sl811_cs_probe(struct pcmcia_device *link) { local_info_t *local; - local = kzalloc(sizeof(local_info_t), GFP_KERNEL); + local = kzalloc_obj(local_info_t, GFP_KERNEL); if (!local) return -ENOMEM; local->p_dev = link; diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index c4e67c4b51f6..675107e9bae0 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -561,7 +561,7 @@ static int uhci_debug_open(struct inode *inode, struct file *file) struct uhci_debug *up; unsigned long flags; - up = kmalloc(sizeof(*up), GFP_KERNEL); + up = kmalloc_obj(*up, GFP_KERNEL); if (!up) return -ENOMEM; diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 8bb11109b66c..027c3798a581 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c @@ -603,8 +603,8 @@ static int uhci_start(struct usb_hcd *hcd) goto err_alloc_frame; } - uhci->frame_cpu = kcalloc(UHCI_NUMFRAMES, sizeof(*uhci->frame_cpu), - GFP_KERNEL); + uhci->frame_cpu = kzalloc_objs(*uhci->frame_cpu, UHCI_NUMFRAMES, + GFP_KERNEL); if (!uhci->frame_cpu) goto err_alloc_frame_cpu; diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 9fd497e0dc7f..31995b12598f 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -238,7 +238,7 @@ dbc_alloc_request(struct xhci_dbc *dbc, unsigned int direction, gfp_t flags) if (!dbc) return NULL; - req = kzalloc(sizeof(*req), flags); + req = kzalloc_obj(*req, flags); if (!req) return NULL; @@ -446,7 +446,7 @@ dbc_alloc_ctx(struct device *dev, gfp_t flags) { struct xhci_container_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), flags); + ctx = kzalloc_obj(*ctx, flags); if (!ctx) return NULL; @@ -503,14 +503,14 @@ xhci_dbc_ring_alloc(struct device *dev, enum xhci_ring_type type, gfp_t flags) struct xhci_segment *seg; dma_addr_t dma; - ring = kzalloc(sizeof(*ring), flags); + ring = kzalloc_obj(*ring, flags); if (!ring) return NULL; ring->num_segs = 1; ring->type = type; - seg = kzalloc(sizeof(*seg), flags); + seg = kzalloc_obj(*seg, flags); if (!seg) goto seg_fail; @@ -1425,7 +1425,7 @@ xhci_alloc_dbc(struct device *dev, void __iomem *base, const struct dbc_driver * struct xhci_dbc *dbc; int ret; - dbc = kzalloc(sizeof(*dbc), GFP_KERNEL); + dbc = kzalloc_obj(*dbc, GFP_KERNEL); if (!dbc) return NULL; diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c index 90282e51e23e..a058277b5ff9 100644 --- a/drivers/usb/host/xhci-dbgtty.c +++ b/drivers/usb/host/xhci-dbgtty.c @@ -584,7 +584,7 @@ int xhci_dbc_tty_probe(struct device *dev, void __iomem *base, struct xhci_hcd * if (!dbc_tty_driver) return -ENODEV; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c index c1eb1036ede9..296ff14d4e9a 100644 --- a/drivers/usb/host/xhci-debugfs.c +++ b/drivers/usb/host/xhci-debugfs.c @@ -87,7 +87,7 @@ static struct xhci_regset *xhci_debugfs_alloc_regset(struct xhci_hcd *xhci) { struct xhci_regset *regset; - regset = kzalloc(sizeof(*regset), GFP_KERNEL); + regset = kzalloc_obj(*regset, GFP_KERNEL); if (!regset) return NULL; @@ -468,7 +468,7 @@ void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, if (spriv->eps[ep_index]) return; - epriv = kzalloc(sizeof(*epriv), GFP_KERNEL); + epriv = kzalloc_obj(*epriv, GFP_KERNEL); if (!epriv) return; @@ -608,7 +608,7 @@ void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id) struct xhci_slot_priv *priv; struct xhci_virt_device *dev = xhci->devs[slot_id]; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return; diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index c708bdd69f16..75bc1eb98b76 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -977,7 +977,7 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, return 0; } - dev = kzalloc(sizeof(*dev), flags); + dev = kzalloc_obj(*dev, flags); if (!dev) return 0; diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index 27eb384a3963..ef255b968ab6 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -179,8 +179,8 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) if (utt->multi) { tt_index = utt->hcpriv; if (!tt_index) { /* Create the index array */ - tt_index = kcalloc(utt->hub->maxchild, - sizeof(*tt_index), GFP_KERNEL); + tt_index = kzalloc_objs(*tt_index, utt->hub->maxchild, + GFP_KERNEL); if (!tt_index) return ERR_PTR(-ENOMEM); utt->hcpriv = tt_index; @@ -193,7 +193,7 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) tt = *ptt; if (!tt) { /* Create the mu3h_sch_tt */ - tt = kzalloc(sizeof(*tt), GFP_KERNEL); + tt = kzalloc_obj(*tt, GFP_KERNEL); if (!tt) { if (allocated_index) { utt->hcpriv = NULL; @@ -264,7 +264,7 @@ create_sch_ep(struct xhci_hcd_mtk *mtk, struct usb_device *udev, else len = 1; - sch_ep = kzalloc(struct_size(sch_ep, bw_budget_table, len), GFP_KERNEL); + sch_ep = kzalloc_flex(*sch_ep, bw_budget_table, len, GFP_KERNEL); if (!sch_ep) return ERR_PTR(-ENOMEM); @@ -891,7 +891,7 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) /* ss IN and OUT are separated */ num_usb_bus = xhci->usb3_rhub.num_ports * 2 + xhci->usb2_rhub.num_ports; - sch_array = kcalloc(num_usb_bus, sizeof(*sch_array), GFP_KERNEL); + sch_array = kzalloc_objs(*sch_array, num_usb_bus, GFP_KERNEL); if (sch_array == NULL) return -ENOMEM; diff --git a/drivers/usb/host/xhci-sideband.c b/drivers/usb/host/xhci-sideband.c index 2bd77255032b..3ebe22755693 100644 --- a/drivers/usb/host/xhci-sideband.c +++ b/drivers/usb/host/xhci-sideband.c @@ -28,11 +28,11 @@ xhci_ring_to_sgtable(struct xhci_sideband *sb, struct xhci_ring *ring) dev = xhci_to_hcd(sb->xhci)->self.sysdev; sz = ring->num_segs * TRB_SEGMENT_SIZE; n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; - pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL); + pages = kvmalloc_objs(struct page *, n_pages, GFP_KERNEL); if (!pages) return NULL; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kzalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { kvfree(pages); return NULL; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b3ba16b9718c..c36ab323d68e 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1641,7 +1641,7 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag else num_tds = 1; - urb_priv = kzalloc(struct_size(urb_priv, td, num_tds), mem_flags); + urb_priv = kzalloc_flex(*urb_priv, td, num_tds, mem_flags); if (!urb_priv) return -ENOMEM; diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index 7b7e1554ea20..9cb74eb91b07 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -982,7 +982,7 @@ static int __init usb_mdc800_init (void) { int retval = -ENODEV; /* Allocate Memory */ - mdc800=kzalloc (sizeof (struct mdc800_data), GFP_KERNEL); + mdc800=kzalloc_obj(struct mdc800_data, GFP_KERNEL); if (!mdc800) goto cleanup_on_fail; diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 82859374f302..20b0b3736322 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -723,7 +723,7 @@ static int mts_usb_probe(struct usb_interface *intf, } - new_desc = kzalloc(sizeof(struct mts_desc), GFP_KERNEL); + new_desc = kzalloc_obj(struct mts_desc, GFP_KERNEL); if (!new_desc) goto out; diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index 8dcd9cc22413..fbb83c84beee 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -2572,15 +2572,15 @@ int isp1760_hcd_register(struct isp1760_hcd *priv, struct resource *mem, priv->hcd = hcd; - priv->atl_slots = kcalloc(mem_layout->slot_num, - sizeof(struct isp1760_slotinfo), GFP_KERNEL); + priv->atl_slots = kzalloc_objs(struct isp1760_slotinfo, + mem_layout->slot_num, GFP_KERNEL); if (!priv->atl_slots) { ret = -ENOMEM; goto put_hcd; } - priv->int_slots = kcalloc(mem_layout->slot_num, - sizeof(struct isp1760_slotinfo), GFP_KERNEL); + priv->int_slots = kzalloc_objs(struct isp1760_slotinfo, + mem_layout->slot_num, GFP_KERNEL); if (!priv->int_slots) { ret = -ENOMEM; goto free_atl_slots; diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c index 65ac91d0595a..e45a54c4a560 100644 --- a/drivers/usb/isp1760/isp1760-udc.c +++ b/drivers/usb/isp1760/isp1760-udc.c @@ -878,7 +878,7 @@ static struct usb_request *isp1760_ep_alloc_request(struct usb_ep *ep, { struct isp1760_request *req; - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (!req) return NULL; diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index ed6a19254d2f..2c311dc92ab9 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -657,7 +657,7 @@ static int adu_probe(struct usb_interface *interface, int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL); + dev = kzalloc_obj(struct adu_device, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c index 47b38dcc2992..8cf08fbda163 100644 --- a/drivers/usb/misc/apple-mfi-fastcharge.c +++ b/drivers/usb/misc/apple-mfi-fastcharge.c @@ -184,7 +184,7 @@ static int mfi_fc_probe(struct usb_device *udev) if (!mfi_fc_match(udev)) return -ENODEV; - mfi = kzalloc(sizeof(struct mfi_device), GFP_KERNEL); + mfi = kzalloc_obj(struct mfi_device, GFP_KERNEL); if (!mfi) return -ENOMEM; diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 62b5a30edc42..e9b26cf7bcfc 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -226,7 +226,7 @@ static int appledisplay_probe(struct usb_interface *iface, int_in_endpointAddr = endpoint->bEndpointAddress; /* allocate memory for our device state and initialize it */ - pdata = kzalloc(sizeof(struct appledisplay), GFP_KERNEL); + pdata = kzalloc_obj(struct appledisplay, GFP_KERNEL); if (!pdata) { retval = -ENOMEM; goto error; diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index 45cff32656c6..039e2b1bba00 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c @@ -143,7 +143,7 @@ static int chaoskey_probe(struct usb_interface *interface, /* Looks good, allocate and initialize */ - dev = kzalloc(sizeof(struct chaoskey), GFP_KERNEL); + dev = kzalloc_obj(struct chaoskey, GFP_KERNEL); if (dev == NULL) goto out; diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 75f5a740cba3..ace0ec94506c 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c @@ -211,7 +211,7 @@ static int cypress_probe(struct usb_interface *interface, int retval = -ENOMEM; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto error_mem; diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 875016dd073c..6af966118792 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -307,7 +307,7 @@ static int cytherm_probe(struct usb_interface *interface, struct usb_cytherm *dev; int retval = -ENOMEM; - dev = kzalloc(sizeof(struct usb_cytherm), GFP_KERNEL); + dev = kzalloc_obj(struct usb_cytherm, GFP_KERNEL); if (!dev) goto error_mem; diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index ea39243efee3..1f649eedfa68 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -330,7 +330,7 @@ static int idmouse_probe(struct usb_interface *interface, return -ENODEV; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) return -ENOMEM; diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 365c10069345..5f882cb6ff07 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -777,7 +777,7 @@ static int iowarrior_probe(struct usb_interface *interface, int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(struct iowarrior), GFP_KERNEL); + dev = kzalloc_obj(struct iowarrior, GFP_KERNEL); if (!dev) return retval; diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index f392d6f84df9..cb7125a5b27f 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -656,7 +656,7 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id * /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto exit; mutex_init(&dev->mutex); diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 379cf01a6e96..a2909dee0d2a 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -748,7 +748,7 @@ static int tower_probe(struct usb_interface *interface, const struct usb_device_ int result; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto exit; diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c index 25ec5666a75e..52d84e2d8193 100644 --- a/drivers/usb/misc/lvstest.c +++ b/drivers/usb/misc/lvstest.c @@ -260,7 +260,7 @@ static ssize_t get_dev_desc_store(struct device *dev, struct usb_device_descriptor *descriptor; int ret; - descriptor = kmalloc(sizeof(*descriptor), GFP_KERNEL); + descriptor = kmalloc_obj(*descriptor, GFP_KERNEL); if (!descriptor) return -ENOMEM; diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c index 41360a7591e5..40572d7192f6 100644 --- a/drivers/usb/misc/onboard_usb_dev.c +++ b/drivers/usb/misc/onboard_usb_dev.c @@ -202,7 +202,7 @@ static int onboard_dev_add_usbdev(struct onboard_dev *onboard_dev, goto error; } - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) { err = -ENOMEM; goto error; diff --git a/drivers/usb/misc/onboard_usb_dev_pdevs.c b/drivers/usb/misc/onboard_usb_dev_pdevs.c index 722504752ce3..2550108bf73c 100644 --- a/drivers/usb/misc/onboard_usb_dev_pdevs.c +++ b/drivers/usb/misc/onboard_usb_dev_pdevs.c @@ -109,7 +109,7 @@ void onboard_dev_create_pdevs(struct usb_device *parent_hub, struct list_head *p goto node_put; } - pdle = kzalloc(sizeof(*pdle), GFP_KERNEL); + pdle = kzalloc_obj(*pdle, GFP_KERNEL); if (!pdle) { of_platform_device_destroy(&pdev->dev, NULL); goto node_put; diff --git a/drivers/usb/misc/sisusbvga/sisusbvga.c b/drivers/usb/misc/sisusbvga/sisusbvga.c index febf34f9f049..be7e7abc47c6 100644 --- a/drivers/usb/misc/sisusbvga/sisusbvga.c +++ b/drivers/usb/misc/sisusbvga/sisusbvga.c @@ -2797,7 +2797,7 @@ static int sisusb_probe(struct usb_interface *intf, dev->devnum); /* Allocate memory for our private */ - sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL); + sisusb = kzalloc_obj(*sisusb, GFP_KERNEL); if (!sisusb) return -ENOMEM; diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index 26baba3ab7d7..a43f2ef30433 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -86,7 +86,7 @@ static int tv_probe(struct usb_interface *interface, struct trancevibrator *dev; int retval; - dev = kzalloc(sizeof(struct trancevibrator), GFP_KERNEL); + dev = kzalloc_obj(struct trancevibrator, GFP_KERNEL); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c index 9e65bb9577ea..a959dd824f0e 100644 --- a/drivers/usb/misc/usb-ljca.c +++ b/drivers/usb/misc/usb-ljca.c @@ -529,7 +529,7 @@ static int ljca_new_client_device(struct ljca_adapter *adap, u8 type, u8 id, struct ljca_client *client; int ret; - client = kzalloc(sizeof *client, GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) { kfree(data); return -ENOMEM; @@ -597,7 +597,7 @@ static int ljca_enumerate_gpio(struct ljca_adapter *adap) return -EINVAL; /* construct platform data */ - gpio_info = kzalloc(sizeof *gpio_info, GFP_KERNEL); + gpio_info = kzalloc_obj(*gpio_info, GFP_KERNEL); if (!gpio_info) return -ENOMEM; gpio_info->num = gpio_num; @@ -630,7 +630,7 @@ static int ljca_enumerate_i2c(struct ljca_adapter *adap) for (i = 0; i < desc->num; i++) { /* construct platform data */ - i2c_info = kzalloc(sizeof *i2c_info, GFP_KERNEL); + i2c_info = kzalloc_obj(*i2c_info, GFP_KERNEL); if (!i2c_info) return -ENOMEM; @@ -669,7 +669,7 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap) for (i = 0; i < desc->num; i++) { /* construct platform data */ - spi_info = kzalloc(sizeof *spi_info, GFP_KERNEL); + spi_info = kzalloc_obj(*spi_info, GFP_KERNEL); if (!spi_info) return -ENOMEM; diff --git a/drivers/usb/misc/usbio.c b/drivers/usb/misc/usbio.c index 37644dddf157..50ff9f1ca78f 100644 --- a/drivers/usb/misc/usbio.c +++ b/drivers/usb/misc/usbio.c @@ -439,7 +439,7 @@ static int usbio_add_client(struct usbio_device *usbio, char *name, u8 id, void struct auxiliary_device *adev; int ret; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index bb546f624a45..be798a293904 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -323,7 +323,7 @@ static int lcd_probe(struct usb_interface *interface, int retval; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index 546deff754ba..97fcb35513ce 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c @@ -308,7 +308,7 @@ static int sevseg_probe(struct usb_interface *interface, struct usb_sevsegdev *mydev; int rc = -ENOMEM; - mydev = kzalloc(sizeof(struct usb_sevsegdev), GFP_KERNEL); + mydev = kzalloc_obj(struct usb_sevsegdev, GFP_KERNEL); if (!mydev) goto error_mem; diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 5c92c8d8e283..689cf82ce47d 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -545,7 +545,7 @@ alloc_sglist(int nents, int max, int vary, struct usbtest_dev *dev, int pipe) if (max == 0) return NULL; - sg = kmalloc_array(nents, sizeof(*sg), GFP_KERNEL); + sg = kmalloc_objs(*sg, nents, GFP_KERNEL); if (!sg) return NULL; sg_init_table(sg, nents); @@ -1221,7 +1221,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param) * as with bulk/intr sglists, sglen is the queue depth; it also * controls which subtests run (more tests than sglen) or rerun. */ - urb = kcalloc(param->sglen, sizeof(struct urb *), GFP_KERNEL); + urb = kzalloc_objs(struct urb *, param->sglen, GFP_KERNEL); if (!urb) return -ENOMEM; for (i = 0; i < param->sglen; i++) { @@ -1370,7 +1370,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param) if (!u) goto cleanup; - reqp = kmalloc(sizeof(*reqp), GFP_KERNEL); + reqp = kmalloc_obj(*reqp, GFP_KERNEL); if (!reqp) goto cleanup; reqp->setup = req; @@ -1572,7 +1572,7 @@ static int unlink_queued(struct usbtest_dev *dev, int pipe, unsigned num, memset(buf, 0, size); /* Allocate and init the urbs we'll queue */ - ctx.urbs = kcalloc(num, sizeof(struct urb *), GFP_KERNEL); + ctx.urbs = kzalloc_objs(struct urb *, num, GFP_KERNEL); if (!ctx.urbs) goto free_buf; for (i = 0; i < num; i++) { @@ -2052,7 +2052,7 @@ test_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param, if (param->sglen > MAX_SGLEN) return -EINVAL; - urbs = kcalloc(param->sglen, sizeof(*urbs), GFP_KERNEL); + urbs = kzalloc_objs(*urbs, param->sglen, GFP_KERNEL); if (!urbs) return -ENOMEM; @@ -2786,7 +2786,7 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id) } #endif - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; info = (struct usbtest_info *) id->driver_info; diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index b26c1d382d59..46356d099d26 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -134,7 +134,7 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p usbdev = priv->usbdev; if (!usbdev) return NULL; - rq = kzalloc(sizeof(struct uss720_async_request), mem_flags); + rq = kzalloc_obj(struct uss720_async_request, mem_flags); if (!rq) return NULL; kref_init(&rq->ref_count); @@ -147,7 +147,7 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p kref_put(&rq->ref_count, destroy_async); return NULL; } - rq->dr = kmalloc(sizeof(*rq->dr), mem_flags); + rq->dr = kmalloc_obj(*rq->dr, mem_flags); if (!rq->dr) { kref_put(&rq->ref_count, destroy_async); return NULL; @@ -701,7 +701,7 @@ static int uss720_probe(struct usb_interface *intf, /* * Allocate parport interface */ - priv = kzalloc(sizeof(struct parport_uss720_private), GFP_KERNEL); + priv = kzalloc_obj(struct parport_uss720_private, GFP_KERNEL); if (!priv) { usb_put_dev(usbdev); return -ENOMEM; diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 70dff0db5354..2e2057ef5b68 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -197,7 +197,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto error; kref_init(&dev->kref); diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index e713fc5964b1..c0c4eb0a166d 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -694,7 +694,7 @@ static int mon_bin_open(struct inode *inode, struct file *file) return -ENODEV; } - rp = kzalloc(sizeof(struct mon_reader_bin), GFP_KERNEL); + rp = kzalloc_obj(struct mon_reader_bin, GFP_KERNEL); if (rp == NULL) { rc = -ENOMEM; goto err_alloc; @@ -1029,8 +1029,8 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg return -EINVAL; size = CHUNK_ALIGN(arg); - vec = kcalloc(size / CHUNK_SIZE, sizeof(struct mon_pgmap), - GFP_KERNEL); + vec = kzalloc_objs(struct mon_pgmap, size / CHUNK_SIZE, + GFP_KERNEL); if (vec == NULL) { ret = -ENOMEM; break; diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index af852d53aac6..b3a68ac6fb98 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c @@ -273,7 +273,7 @@ static void mon_bus_init(struct usb_bus *ubus) { struct mon_bus *mbus; - mbus = kzalloc(sizeof(struct mon_bus), GFP_KERNEL); + mbus = kzalloc_obj(struct mon_bus, GFP_KERNEL); if (mbus == NULL) goto err_alloc; kref_init(&mbus->ref); diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index 398e02af6a2b..8329c1fc719e 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c @@ -29,7 +29,7 @@ static int mon_stat_open(struct inode *inode, struct file *file) struct mon_bus *mbus; struct snap *sp; - sp = kmalloc(sizeof(struct snap), GFP_KERNEL); + sp = kmalloc_obj(struct snap, GFP_KERNEL); if (sp == NULL) return -ENOMEM; diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index 68b9b2b41189..b55016068b47 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c @@ -330,7 +330,7 @@ static int mon_text_open(struct inode *inode, struct file *file) mutex_lock(&mon_lock); mbus = inode->i_private; - rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL); + rp = kzalloc_obj(struct mon_reader_text, GFP_KERNEL); if (rp == NULL) { rc = -ENOMEM; goto err_alloc; diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 3a25ee18f144..9215373a9738 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -613,7 +613,7 @@ static int mtu3_mem_alloc(struct mtu3 *mtu) /* one for ep0, another is reserved */ mtu->num_eps = min(in_ep_num, out_ep_num) + 1; - ep_array = kcalloc(mtu->num_eps * 2, sizeof(*ep_array), GFP_KERNEL); + ep_array = kzalloc_objs(*ep_array, mtu->num_eps * 2, GFP_KERNEL); if (ep_array == NULL) return -ENOMEM; diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c index bf73fbc29976..da29f467943f 100644 --- a/drivers/usb/mtu3/mtu3_gadget.c +++ b/drivers/usb/mtu3/mtu3_gadget.c @@ -235,7 +235,7 @@ struct usb_request *mtu3_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) struct mtu3_ep *mep = to_mtu3_ep(ep); struct mtu3_request *mreq; - mreq = kzalloc(sizeof(*mreq), gfp_flags); + mreq = kzalloc_obj(*mreq, gfp_flags); if (!mreq) return NULL; diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 4cde3abb7006..240953cdf46d 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -756,7 +756,7 @@ cppi41_dma_controller_create(struct musb *musb, void __iomem *base) return NULL; } - controller = kzalloc(sizeof(*controller), GFP_KERNEL); + controller = kzalloc_obj(*controller, GFP_KERNEL); if (!controller) goto kzalloc_fail; diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index d666c4292753..016d3f3fc1e0 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1133,7 +1133,7 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) struct musb_ep *musb_ep = to_musb_ep(ep); struct musb_request *request; - request = kzalloc(sizeof *request, gfp_flags); + request = kzalloc_obj(*request, gfp_flags); if (!request) return NULL; diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 6b4481a867c5..8efd2fa472f9 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -2154,7 +2154,7 @@ static int musb_urb_enqueue( * REVISIT consider a dedicated qh kmem_cache, so it's harder * for bugs in other kernel code to break this driver... */ - qh = kzalloc(sizeof *qh, mem_flags); + qh = kzalloc_obj(*qh, mem_flags); if (!qh) { spin_lock_irqsave(&musb->lock, flags); usb_hcd_unlink_urb_from_ep(hcd, urb); diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 7acd1635850d..9cd4616d853e 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -395,7 +395,7 @@ dma_controller_alloc(struct musb *musb, void __iomem *base) { struct musb_dma_controller *controller; - controller = kzalloc(sizeof(*controller), GFP_KERNEL); + controller = kzalloc_obj(*controller, GFP_KERNEL); if (!controller) return NULL; diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 60a93b8bbe3c..ed8fea4738cd 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -596,7 +596,7 @@ tusb_dma_controller_create(struct musb *musb, void __iomem *base) | TUSB_DMA_REQ_CONF_DMA_REQ_EN(0x3f) | TUSB_DMA_REQ_CONF_DMA_REQ_ASSER(2)); - tusb_dma = kzalloc(sizeof(struct tusb_omap_dma), GFP_KERNEL); + tusb_dma = kzalloc_obj(struct tusb_omap_dma, GFP_KERNEL); if (!tusb_dma) goto out; @@ -615,13 +615,13 @@ tusb_dma_controller_create(struct musb *musb, void __iomem *base) struct dma_channel *ch; struct tusb_omap_dma_ch *chdat; - ch = kzalloc(sizeof(struct dma_channel), GFP_KERNEL); + ch = kzalloc_obj(struct dma_channel, GFP_KERNEL); if (!ch) goto cleanup; dma_channel_pool[i] = ch; - chdat = kzalloc(sizeof(struct tusb_omap_dma_ch), GFP_KERNEL); + chdat = kzalloc_obj(struct tusb_omap_dma_ch, GFP_KERNEL); if (!chdat) goto cleanup; diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index d5cf5e8bb1ca..0621a6c0c6b6 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -362,7 +362,7 @@ ux500_dma_controller_create(struct musb *musb, void __iomem *base) struct resource *iomem; int ret; - controller = kzalloc(sizeof(*controller), GFP_KERNEL); + controller = kzalloc_obj(*controller, GFP_KERNEL); if (!controller) goto kzalloc_fail; diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index e266a47c4d48..f5712dddd1fd 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -779,11 +779,11 @@ static int fsl_otg_conf(struct platform_device *pdev) return 0; /* allocate space to fsl otg device */ - fsl_otg_tc = kzalloc(sizeof(struct fsl_otg), GFP_KERNEL); + fsl_otg_tc = kzalloc_obj(struct fsl_otg, GFP_KERNEL); if (!fsl_otg_tc) return -ENOMEM; - fsl_otg_tc->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL); + fsl_otg_tc->phy.otg = kzalloc_obj(struct usb_otg, GFP_KERNEL); if (!fsl_otg_tc->phy.otg) { kfree(fsl_otg_tc); return -ENOMEM; diff --git a/drivers/usb/phy/phy-fsl-usb.h b/drivers/usb/phy/phy-fsl-usb.h index d70341ae5a92..487a11ff4391 100644 --- a/drivers/usb/phy/phy-fsl-usb.h +++ b/drivers/usb/phy/phy-fsl-usb.h @@ -345,7 +345,7 @@ inline struct fsl_otg_timer *otg_timer_initializer { struct fsl_otg_timer *timer; - timer = kmalloc(sizeof(struct fsl_otg_timer), GFP_KERNEL); + timer = kmalloc_obj(struct fsl_otg_timer, GFP_KERNEL); if (!timer) return NULL; timer->function = function; diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index e8e5723f5412..ca96c0164593 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -325,7 +325,7 @@ static void __usbhsg_recip_send_status(struct usbhsg_gpriv *gpriv, } /* alloc recip data buffer */ - buf = kmalloc(sizeof(*buf), GFP_ATOMIC); + buf = kmalloc_obj(*buf, GFP_ATOMIC); if (!buf) { usb_ep_free_request(&dcp->ep, req); return; @@ -661,7 +661,7 @@ static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep, { struct usbhsg_request *ureq; - ureq = kzalloc(sizeof *ureq, gfp_flags); + ureq = kzalloc_obj(*ureq, gfp_flags); if (!ureq) return NULL; @@ -1084,11 +1084,11 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) int i; int ret; - gpriv = kzalloc(sizeof(struct usbhsg_gpriv), GFP_KERNEL); + gpriv = kzalloc_obj(struct usbhsg_gpriv, GFP_KERNEL); if (!gpriv) return -ENOMEM; - uep = kcalloc(pipe_size, sizeof(struct usbhsg_uep), GFP_KERNEL); + uep = kzalloc_objs(struct usbhsg_uep, pipe_size, GFP_KERNEL); if (!uep) { ret = -ENOMEM; goto usbhs_mod_gadget_probe_err_gpriv; diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index ae54221011c3..f7ef3a9f82a4 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c @@ -158,7 +158,7 @@ static struct usbhsh_request *usbhsh_ureq_alloc(struct usbhsh_hpriv *hpriv, { struct usbhsh_request *ureq; - ureq = kzalloc(sizeof(struct usbhsh_request), mem_flags); + ureq = kzalloc_obj(struct usbhsh_request, mem_flags); if (!ureq) return NULL; @@ -374,7 +374,7 @@ static int usbhsh_endpoint_attach(struct usbhsh_hpriv *hpriv, struct usb_endpoint_descriptor *desc = &ep->desc; unsigned long flags; - uep = kzalloc(sizeof(struct usbhsh_ep), mem_flags); + uep = kzalloc_obj(struct usbhsh_ep, mem_flags); if (!uep) return -ENOMEM; diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index 56fc3ff5016f..f48a22037f43 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c @@ -822,8 +822,7 @@ int usbhs_pipe_probe(struct usbhs_priv *priv) return -EINVAL; } - info->pipe = kcalloc(pipe_size, sizeof(struct usbhs_pipe), - GFP_KERNEL); + info->pipe = kzalloc_objs(struct usbhs_pipe, pipe_size, GFP_KERNEL); if (!info->pipe) return -ENOMEM; diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c index 30482d4cf826..31c2c3e370dd 100644 --- a/drivers/usb/roles/class.c +++ b/drivers/usb/roles/class.c @@ -364,7 +364,7 @@ usb_role_switch_register(struct device *parent, if (!desc || !desc->set) return ERR_PTR(-EINVAL); - sw = kzalloc(sizeof(*sw), GFP_KERNEL); + sw = kzalloc_obj(*sw, GFP_KERNEL); if (!sw) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 800b04fe37fa..336d199e4994 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -126,7 +126,7 @@ static int ark3116_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct ark3116_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 5c41c1c82c3f..334f59c512d7 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -114,7 +114,7 @@ static int belkin_sa_port_probe(struct usb_serial_port *port) struct usb_device *dev = port->serial->dev; struct belkin_sa_private *priv; - priv = kmalloc(sizeof(struct belkin_sa_private), GFP_KERNEL); + priv = kmalloc_obj(struct belkin_sa_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 7cc36f84821f..ceb2612a9228 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -381,7 +381,7 @@ static int ch341_port_probe(struct usb_serial_port *port) struct ch341_private *priv; int r; - priv = kzalloc(sizeof(struct ch341_private), GFP_KERNEL); + priv = kzalloc_obj(struct ch341_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index c3ea3a46ed76..4b5f56bd01e8 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -133,7 +133,7 @@ static int usb_console_setup(struct console *co, char *options) * the termios structure, then later call set_termios to * configure according to command line arguments */ - tty = kzalloc(sizeof(*tty), GFP_KERNEL); + tty = kzalloc_obj(*tty, GFP_KERNEL); if (!tty) { retval = -ENOMEM; goto reset_open_count; diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 36b25418b214..3c30dd095b32 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -2006,7 +2006,7 @@ static int cp210x_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct cp210x_port_private *port_priv; - port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); if (!port_priv) return -ENOMEM; @@ -2163,7 +2163,7 @@ static int cp210x_attach(struct usb_serial *serial) int result; struct cp210x_serial_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 76dd8e7453b5..609d3a700b70 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -101,7 +101,7 @@ static int cyberjack_port_probe(struct usb_serial_port *port) struct cyberjack_private *priv; int result; - priv = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL); + priv = kmalloc_obj(struct cyberjack_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index e29569d65991..52d52a92b7ea 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -445,7 +445,7 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) return -ENODEV; } - priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); + priv = kzalloc_obj(struct cypress_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index a06485965412..8a8d4dc899b0 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -1209,7 +1209,7 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num) { struct digi_port *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1231,7 +1231,7 @@ static int digi_startup(struct usb_serial *serial) struct digi_serial *serial_priv; int ret; - serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); + serial_priv = kzalloc_obj(*serial_priv, GFP_KERNEL); if (!serial_priv) return -ENOMEM; diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index acb48b1c83f7..7500e1a85c88 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2188,7 +2188,7 @@ static int ftdi_port_probe(struct usb_serial_port *port) struct ftdi_private *priv; int result; - priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); + priv = kzalloc_obj(struct ftdi_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 614de0c2f5f2..aa7561aba927 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -267,7 +267,7 @@ static int pkt_add(struct garmin_data *garmin_data_p, /* process only packets containing data ... */ if (data_length) { - pkt = kmalloc(struct_size(pkt, data, data_length), GFP_ATOMIC); + pkt = kmalloc_flex(*pkt, data, data_length, GFP_ATOMIC); if (!pkt) return 0; @@ -1373,7 +1373,7 @@ static int garmin_port_probe(struct usb_serial_port *port) int status; struct garmin_data *garmin_data_p; - garmin_data_p = kzalloc(sizeof(struct garmin_data), GFP_KERNEL); + garmin_data_p = kzalloc_obj(struct garmin_data, GFP_KERNEL); if (!garmin_data_p) return -ENOMEM; diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 1fffda7647f9..b036fcde63e4 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -498,7 +498,7 @@ static int get_epic_descriptor(struct edgeport_serial *ep) ep->is_epic = 0; - epic = kmalloc(sizeof(*epic), GFP_KERNEL); + epic = kmalloc_obj(*epic, GFP_KERNEL); if (!epic) return -ENOMEM; @@ -2714,7 +2714,7 @@ static int edge_startup(struct usb_serial *serial) dev = serial->dev; /* create our private serial structure */ - edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); + edge_serial = kzalloc_obj(struct edgeport_serial, GFP_KERNEL); if (!edge_serial) return -ENOMEM; @@ -2956,7 +2956,7 @@ static int edge_port_probe(struct usb_serial_port *port) { struct edgeport_port *edge_port; - edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); + edge_port = kzalloc_obj(*edge_port, GFP_KERNEL); if (!edge_port) return -ENOMEM; diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 7d0584b2a234..fed02fdf3dcb 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -528,7 +528,7 @@ static int tx_active(struct edgeport_port *port) u8 *lsr; int bytes_left = 0; - oedb = kmalloc(sizeof(*oedb), GFP_KERNEL); + oedb = kmalloc_obj(*oedb, GFP_KERNEL); if (!oedb) return -ENOMEM; @@ -680,7 +680,7 @@ static int check_i2c_image(struct edgeport_serial *serial) u8 *buffer; u16 ttype; - rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); if (!rom_desc) return -ENOMEM; @@ -759,7 +759,7 @@ static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer) struct edge_ti_manuf_descriptor *desc; struct device *dev = &serial->serial->dev->dev; - rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); if (!rom_desc) return -ENOMEM; @@ -1089,7 +1089,7 @@ static int do_download_mode(struct edgeport_serial *serial, * Validate Hardware version number * Read Manufacturing Descriptor from TI Based Edgeport */ - ti_manuf_desc = kmalloc(sizeof(*ti_manuf_desc), GFP_KERNEL); + ti_manuf_desc = kmalloc_obj(*ti_manuf_desc, GFP_KERNEL); if (!ti_manuf_desc) return -ENOMEM; @@ -1107,7 +1107,7 @@ static int do_download_mode(struct edgeport_serial *serial, return -EINVAL; } - rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); if (!rom_desc) { kfree(ti_manuf_desc); return -ENOMEM; @@ -1123,8 +1123,7 @@ static int do_download_mode(struct edgeport_serial *serial, dev_dbg(dev, "%s - Found Type FIRMWARE (Type 2) record\n", __func__); - firmware_version = kmalloc(sizeof(*firmware_version), - GFP_KERNEL); + firmware_version = kmalloc_obj(*firmware_version, GFP_KERNEL); if (!firmware_version) { kfree(rom_desc); kfree(ti_manuf_desc); @@ -1419,7 +1418,7 @@ static int do_boot_mode(struct edgeport_serial *serial, * Validate Hardware version number * Read Manufacturing Descriptor from TI Based Edgeport */ - ti_manuf_desc = kmalloc(sizeof(*ti_manuf_desc), GFP_KERNEL); + ti_manuf_desc = kmalloc_obj(*ti_manuf_desc, GFP_KERNEL); if (!ti_manuf_desc) return -ENOMEM; @@ -2219,7 +2218,7 @@ static void change_port_settings(struct tty_struct *tty, unsigned cflag; int status; - config = kmalloc (sizeof (*config), GFP_KERNEL); + config = kmalloc_obj(*config, GFP_KERNEL); if (!config) { tty->termios = *old_termios; return; @@ -2458,7 +2457,7 @@ static void edge_heartbeat_work(struct work_struct *work) serial = container_of(work, struct edgeport_serial, heartbeat_work.work); - rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); /* Descriptor address request is enough to reset the firmware timer */ if (!rom_desc || !get_descriptor_addr(serial, I2C_DESC_TYPE_ION, @@ -2497,7 +2496,7 @@ static int edge_startup(struct usb_serial *serial) u16 product_id; /* create our private serial structure */ - edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); + edge_serial = kzalloc_obj(struct edgeport_serial, GFP_KERNEL); if (!edge_serial) return -ENOMEM; @@ -2551,7 +2550,7 @@ static int edge_port_probe(struct usb_serial_port *port) struct edgeport_port *edge_port; int ret; - edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); + edge_port = kzalloc_obj(*edge_port, GFP_KERNEL); if (!edge_port) return -ENOMEM; diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index b1e672c2f423..ec2b061c0e84 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -198,7 +198,7 @@ static int ipw_attach(struct usb_serial *serial) { struct usb_wwan_intf_private *data; - data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL); + data = kzalloc_obj(struct usb_wwan_intf_private, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index a106b71e698f..4eeec9c06a11 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -126,7 +126,7 @@ irda_usb_find_class_desc(struct usb_serial *serial, unsigned int ifnum) struct usb_irda_cs_descriptor *desc; int ret; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index c21dcc9b6f05..6feb886991d6 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c @@ -67,7 +67,7 @@ static int iuu_port_probe(struct usb_serial_port *port) struct iuu_private *priv; int ret; - priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL); + priv = kzalloc_obj(struct iuu_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 9129e0282c24..ba3f80d21e92 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -2789,7 +2789,7 @@ static int keyspan_startup(struct usb_serial *serial) } /* Setup private data for serial driver */ - s_priv = kzalloc(sizeof(struct keyspan_serial_private), GFP_KERNEL); + s_priv = kzalloc_obj(struct keyspan_serial_private, GFP_KERNEL); if (!s_priv) return -ENOMEM; @@ -2886,7 +2886,7 @@ static int keyspan_port_probe(struct usb_serial_port *port) s_priv = usb_get_serial_data(serial); d_details = s_priv->device_details; - p_priv = kzalloc(sizeof(*p_priv), GFP_KERNEL); + p_priv = kzalloc_obj(*p_priv, GFP_KERNEL); if (!p_priv) return -ENOMEM; diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index e98b479593d3..8a0f993ec7c6 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -654,7 +654,7 @@ static int keyspan_pda_port_probe(struct usb_serial_port *port) struct keyspan_pda_private *priv; - priv = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL); + priv = kmalloc_obj(struct keyspan_pda_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index d36155b6d2bf..d2960271a1f7 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -189,7 +189,7 @@ static int klsi_105_port_probe(struct usb_serial_port *port) { struct klsi_105_private *priv; - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -378,7 +378,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, unsigned long flags; speed_t baud; - cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kmalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return; diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 3a1343d88386..3f9311b3bdf9 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -130,7 +130,7 @@ static int kobil_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct kobil_private *priv; - priv = kmalloc(sizeof(struct kobil_private), GFP_KERNEL); + priv = kmalloc_obj(struct kobil_private, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 2bce8cc03aca..2bf86c3cc7ff 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -385,7 +385,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port) return -ENODEV; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index 028878292901..7e7fb49fc3d5 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c @@ -245,7 +245,7 @@ static int metrousb_port_probe(struct usb_serial_port *port) { struct metrousb_private *metro_priv; - metro_priv = kzalloc(sizeof(*metro_priv), GFP_KERNEL); + metro_priv = kzalloc_obj(*metro_priv, GFP_KERNEL); if (!metro_priv) return -ENOMEM; diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index e59bfa7c8030..1495d82bf838 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -555,7 +555,7 @@ static int mos7715_parport_init(struct usb_serial *serial) struct mos7715_parport *mos_parport; /* allocate and initialize parallel port control struct */ - mos_parport = kzalloc(sizeof(struct mos7715_parport), GFP_KERNEL); + mos_parport = kzalloc_obj(struct mos7715_parport, GFP_KERNEL); if (!mos_parport) return -ENOMEM; @@ -1703,7 +1703,7 @@ static int mos7720_port_probe(struct usb_serial_port *port) { struct moschip_port *mos7720_port; - mos7720_port = kzalloc(sizeof(*mos7720_port), GFP_KERNEL); + mos7720_port = kzalloc_obj(*mos7720_port, GFP_KERNEL); if (!mos7720_port) return -ENOMEM; diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 9e9aca271c0a..065ac3777906 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1532,7 +1532,7 @@ static int mos7840_port_probe(struct usb_serial_port *port) pnum = port->port_number; dev_dbg(&port->dev, "mos7840_startup: configuring port %d\n", pnum); - mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL); + mos7840_port = kzalloc_obj(struct moschip_port, GFP_KERNEL); if (!mos7840_port) return -ENOMEM; @@ -1677,8 +1677,8 @@ static int mos7840_port_probe(struct usb_serial_port *port) /* Initialize LED timers */ if (mos7840_port->has_led) { mos7840_port->led_urb = usb_alloc_urb(0, GFP_KERNEL); - mos7840_port->led_dr = kmalloc(sizeof(*mos7840_port->led_dr), - GFP_KERNEL); + mos7840_port->led_dr = kmalloc_obj(*mos7840_port->led_dr, + GFP_KERNEL); if (!mos7840_port->led_urb || !mos7840_port->led_dr) { status = -ENOMEM; goto error; diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 397ebd5a3e74..05f5ab767a53 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -113,7 +113,7 @@ static int omninet_port_probe(struct usb_serial_port *port) { struct omninet_data *od; - od = kzalloc(sizeof(*od), GFP_KERNEL); + od = kzalloc_obj(*od, GFP_KERNEL); if (!od) return -ENOMEM; diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 1ee84ccc4bbd..0ced33c28545 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -220,7 +220,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, /* The connected devices do not have a bulk write endpoint, * to transmit data to de barcode device the control endpoint is used */ - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); + dr = kmalloc_obj(struct usb_ctrlrequest, GFP_ATOMIC); if (!dr) goto error_no_dr; @@ -354,7 +354,7 @@ static int opticon_port_probe(struct usb_serial_port *port) { struct opticon_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index d4505a426446..261d852aaccf 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -2606,7 +2606,7 @@ static int option_attach(struct usb_serial *serial) struct usb_wwan_intf_private *data; unsigned long device_flags; - data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL); + data = kzalloc_obj(struct usb_wwan_intf_private, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index bd206cb9cc08..70ddda6a300e 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c @@ -328,7 +328,7 @@ static int oti6858_port_probe(struct usb_serial_port *port) { struct oti6858_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 22579d0d8ab8..75fd24019cba 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -503,7 +503,7 @@ static int pl2303_startup(struct usb_serial *serial) type = ret; dev_dbg(&serial->interface->dev, "device type: %s\n", pl2303_type_data[type].name); - spriv = kzalloc(sizeof(*spriv), GFP_KERNEL); + spriv = kzalloc_obj(*spriv, GFP_KERNEL); if (!spriv) return -ENOMEM; @@ -555,7 +555,7 @@ static int pl2303_port_probe(struct usb_serial_port *port) { struct pl2303_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 13c664317a05..bbc3e33a2d81 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -431,7 +431,7 @@ static int qc_attach(struct usb_serial *serial) struct usb_wwan_intf_private *data; bool sendsetup; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 72fe83a6c978..606beb6e12aa 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -626,7 +626,7 @@ static int qt2_attach(struct usb_serial *serial) return status; } - serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); + serial_priv = kzalloc_obj(*serial_priv, GFP_KERNEL); if (!serial_priv) return -ENOMEM; @@ -657,7 +657,7 @@ static int qt2_port_probe(struct usb_serial_port *port) struct qt2_port_private *port_priv; u8 bEndpointAddress; - port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); if (!port_priv) return -ENOMEM; diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 741e68e46139..3b6a025cbeb8 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -828,7 +828,7 @@ static int sierra_startup(struct usb_serial *serial) { struct sierra_intf_private *intfdata; - intfdata = kzalloc(sizeof(*intfdata), GFP_KERNEL); + intfdata = kzalloc_obj(*intfdata, GFP_KERNEL); if (!intfdata) return -ENOMEM; @@ -861,7 +861,7 @@ static int sierra_port_probe(struct usb_serial_port *port) const struct sierra_iface_list *himemory_list; u8 ifnum; - portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); + portdata = kzalloc_obj(*portdata, GFP_KERNEL); if (!portdata) return -ENOMEM; diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 11077beb7232..df1d1eed1236 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -145,7 +145,7 @@ static int spcp8x5_port_probe(struct usb_serial_port *port) const struct usb_device_id *id = usb_get_serial_data(port->serial); struct spcp8x5_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index df21009bdf42..f73321fd5dfd 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -326,7 +326,7 @@ static int ssu100_port_probe(struct usb_serial_port *port) { struct ssu100_port_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 58962bcbf9ba..46158cfc546a 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c @@ -149,7 +149,7 @@ static int symbol_port_probe(struct usb_serial_port *port) { struct symbol_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index d671189ecee2..cb6b0c018809 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -519,7 +519,7 @@ static int ti_startup(struct usb_serial *serial) dev->descriptor.bNumConfigurations, dev->actconfig->desc.bConfigurationValue); - tdev = kzalloc(sizeof(struct ti_device), GFP_KERNEL); + tdev = kzalloc_obj(struct ti_device, GFP_KERNEL); if (!tdev) return -ENOMEM; @@ -598,7 +598,7 @@ static int ti_port_probe(struct usb_serial_port *port) { struct ti_port *tport; - tport = kzalloc(sizeof(*tport), GFP_KERNEL); + tport = kzalloc_obj(*tport, GFP_KERNEL); if (!tport) return -ENOMEM; @@ -897,7 +897,7 @@ static void ti_set_termios(struct tty_struct *tty, u16 wbaudrate; u16 wflags = 0; - config = kmalloc(sizeof(*config), GFP_KERNEL); + config = kmalloc_obj(*config, GFP_KERNEL); if (!config) return; diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index 15a17bf111f1..ecf0ecfceccb 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c @@ -161,7 +161,7 @@ static int upd78f0730_port_probe(struct usb_serial_port *port) { struct upd78f0730_port_private *private; - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (!private) return -ENOMEM; diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index c78ff40b1e5f..26c40f8108e4 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -688,7 +688,7 @@ static struct usb_serial *create_serial(struct usb_device *dev, { struct usb_serial *serial; - serial = kzalloc(sizeof(*serial), GFP_KERNEL); + serial = kzalloc_obj(*serial, GFP_KERNEL); if (!serial) return NULL; serial->dev = usb_get_dev(dev); @@ -1005,7 +1005,7 @@ static int usb_serial_probe(struct usb_interface *interface, } /* descriptor matches, let's find the endpoints needed */ - epds = kzalloc(sizeof(*epds), GFP_KERNEL); + epds = kzalloc_obj(*epds, GFP_KERNEL); if (!epds) { retval = -ENOMEM; goto err_release_sibling; @@ -1059,7 +1059,7 @@ static int usb_serial_probe(struct usb_interface *interface, dev_dbg(ddev, "setting up %d port structure(s)\n", max_endpoints); for (i = 0; i < max_endpoints; ++i) { - port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); + port = kzalloc_obj(struct usb_serial_port, GFP_KERNEL); if (!port) { retval = -ENOMEM; goto err_free_epds; @@ -1482,7 +1482,7 @@ int __usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers * Suspend/resume support is implemented in the usb-serial core, * so fill in the PM-related fields in udriver. */ - udriver = kzalloc(sizeof(*udriver), GFP_KERNEL); + udriver = kzalloc_obj(*udriver, GFP_KERNEL); if (!udriver) return -ENOMEM; diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 0017f6e969e1..ea529a15c1f6 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -449,7 +449,7 @@ int usb_wwan_port_probe(struct usb_serial_port *port) if (!port->bulk_in_size || !port->bulk_out_size) return -ENODEV; - portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); + portdata = kzalloc_obj(*portdata, GFP_KERNEL); if (!portdata) return -ENOMEM; diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 009faeb2ef55..c530e7a85cb4 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -278,8 +278,7 @@ static int whiteheat_attach(struct usb_serial *serial) serial->type->description, hw_info->sw_major_rev, hw_info->sw_minor_rev); - command_info = kmalloc(sizeof(struct whiteheat_command_private), - GFP_KERNEL); + command_info = kmalloc_obj(struct whiteheat_command_private, GFP_KERNEL); if (!command_info) goto no_command_private; @@ -330,7 +329,7 @@ static int whiteheat_port_probe(struct usb_serial_port *port) { struct whiteheat_private *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 4186e791b384..91c0a8d0097a 100644 --- a/drivers/usb/serial/xr_serial.c +++ b/drivers/usb/serial/xr_serial.c @@ -756,7 +756,7 @@ static void xr_cdc_set_line_coding(struct tty_struct *tty, struct usb_cdc_line_coding *lc; int ret; - lc = kzalloc(sizeof(*lc), GFP_KERNEL); + lc = kzalloc_obj(*lc, GFP_KERNEL); if (!lc) return; @@ -1020,7 +1020,7 @@ static int xr_port_probe(struct usb_serial_port *port) type_id = (int)(unsigned long)usb_get_serial_data(port->serial); type = &xr_types[type_id]; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index e01f3a42bde4..691fe47009cf 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c @@ -1113,7 +1113,7 @@ static int init_alauda(struct us_data *us) struct usb_host_interface *altsetting = us->pusb_intf->cur_altsetting; nand_init_ecc(); - us->extra = kzalloc(sizeof(struct alauda_info), GFP_NOIO); + us->extra = kzalloc_obj(struct alauda_info, GFP_NOIO); if (!us->extra) return -ENOMEM; diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c index 9ba369483c9b..0ded8ef72efa 100644 --- a/drivers/usb/storage/datafab.c +++ b/drivers/usb/storage/datafab.c @@ -555,7 +555,7 @@ static int datafab_transport(struct scsi_cmnd *srb, struct us_data *us) }; if (!us->extra) { - us->extra = kzalloc(sizeof(struct datafab_info), GFP_NOIO); + us->extra = kzalloc_obj(struct datafab_info, GFP_NOIO); if (!us->extra) return USB_STOR_TRANSPORT_ERROR; diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c index ce91fb105975..5a5f35213c1d 100644 --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -1119,9 +1119,9 @@ static int ms_lib_alloc_writebuf(struct us_data *us) info->MS_Lib.blkpag = kmalloc_array(info->MS_Lib.PagesPerBlock, info->MS_Lib.BytesPerSector, GFP_KERNEL); - info->MS_Lib.blkext = kmalloc_array(info->MS_Lib.PagesPerBlock, - sizeof(struct ms_lib_type_extdat), - GFP_KERNEL); + info->MS_Lib.blkext = kmalloc_objs(struct ms_lib_type_extdat, + info->MS_Lib.PagesPerBlock, + GFP_KERNEL); if ((info->MS_Lib.blkpag == NULL) || (info->MS_Lib.blkext == NULL)) { ms_lib_free_writebuf(us); @@ -2336,7 +2336,7 @@ static int ene_ub6250_probe(struct usb_interface *intf, return result; /* FIXME: where should the code alloc extra buf ? */ - us->extra = kzalloc(sizeof(struct ene_ub6250_info), GFP_KERNEL); + us->extra = kzalloc_obj(struct ene_ub6250_info, GFP_KERNEL); if (!us->extra) return -ENOMEM; us->extra_destructor = ene_ub6250_info_destructor; diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index a1669c35bad5..92113848913d 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c @@ -1463,7 +1463,7 @@ static int isd200_init_info(struct us_data *us) { struct isd200_info *info; - info = kzalloc(sizeof(struct isd200_info), GFP_KERNEL); + info = kzalloc_obj(struct isd200_info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c index 089c6f8ac85f..a9c48091491e 100644 --- a/drivers/usb/storage/jumpshot.c +++ b/drivers/usb/storage/jumpshot.c @@ -482,7 +482,7 @@ static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) }; if (!us->extra) { - us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO); + us->extra = kzalloc_obj(struct jumpshot_info, GFP_NOIO); if (!us->extra) return USB_STOR_TRANSPORT_ERROR; diff --git a/drivers/usb/storage/karma.c b/drivers/usb/storage/karma.c index 341d6839548a..5f199c21bb0c 100644 --- a/drivers/usb/storage/karma.c +++ b/drivers/usb/storage/karma.c @@ -174,7 +174,7 @@ static void rio_karma_destructor(void *extra) static int rio_karma_init(struct us_data *us) { - struct karma_data *data = kzalloc(sizeof(struct karma_data), GFP_NOIO); + struct karma_data *data = kzalloc_obj(struct karma_data, GFP_NOIO); if (!data) return -ENOMEM; diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 5a8a1ffda0ec..083423606ad9 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c @@ -183,7 +183,7 @@ static int onetouch_connect_input(struct us_data *ss) maxp = usb_maxpacket(udev, pipe); maxp = min(maxp, ONETOUCH_PKT_LEN); - onetouch = kzalloc(sizeof(struct usb_onetouch), GFP_KERNEL); + onetouch = kzalloc_obj(struct usb_onetouch, GFP_KERNEL); input_dev = input_allocate_device(); if (!onetouch || !input_dev) goto fail1; diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 3cc243956fd4..12eb1ab224cd 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -976,7 +976,7 @@ static int init_realtek_cr(struct us_data *us) struct rts51x_chip *chip; int size, i, retval; - chip = kzalloc(sizeof(struct rts51x_chip), GFP_KERNEL); + chip = kzalloc_obj(struct rts51x_chip, GFP_KERNEL); if (!chip) return -ENOMEM; diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c index e66b920e99e2..3d45e1b54c66 100644 --- a/drivers/usb/storage/sddr09.c +++ b/drivers/usb/storage/sddr09.c @@ -1232,8 +1232,8 @@ sddr09_read_map(struct us_data *us) { kfree(info->lba_to_pba); kfree(info->pba_to_lba); - info->lba_to_pba = kmalloc_array(numblocks, sizeof(int), GFP_NOIO); - info->pba_to_lba = kmalloc_array(numblocks, sizeof(int), GFP_NOIO); + info->lba_to_pba = kmalloc_objs(int, numblocks, GFP_NOIO); + info->pba_to_lba = kmalloc_objs(int, numblocks, GFP_NOIO); if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) { printk(KERN_WARNING "sddr09_read_map: out of memory\n"); @@ -1428,7 +1428,7 @@ sddr09_common_init(struct us_data *us) { return -EINVAL; } - us->extra = kzalloc(sizeof(struct sddr09_card_info), GFP_NOIO); + us->extra = kzalloc_obj(struct sddr09_card_info, GFP_NOIO); if (!us->extra) return -ENOMEM; us->extra_destructor = sddr09_card_info_destructor; diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index 9d813727e65f..e05e824cd4d1 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c @@ -691,8 +691,8 @@ static int sddr55_read_map(struct us_data *us) { kfree(info->lba_to_pba); kfree(info->pba_to_lba); - info->lba_to_pba = kmalloc_array(numblocks, sizeof(int), GFP_NOIO); - info->pba_to_lba = kmalloc_array(numblocks, sizeof(int), GFP_NOIO); + info->lba_to_pba = kmalloc_objs(int, numblocks, GFP_NOIO); + info->pba_to_lba = kmalloc_objs(int, numblocks, GFP_NOIO); if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) { kfree(info->lba_to_pba); @@ -799,8 +799,7 @@ static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) struct sddr55_card_info *info; if (!us->extra) { - us->extra = kzalloc( - sizeof(struct sddr55_card_info), GFP_NOIO); + us->extra = kzalloc_obj(struct sddr55_card_info, GFP_NOIO); if (!us->extra) return USB_STOR_TRANSPORT_ERROR; us->extra_destructor = sddr55_card_info_destructor; diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c index 27faa0ead11d..7e5424268c73 100644 --- a/drivers/usb/storage/shuttle_usbat.c +++ b/drivers/usb/storage/shuttle_usbat.c @@ -1454,7 +1454,7 @@ static int init_usbat(struct us_data *us, int devicetype) unsigned char subcountL = USBAT_ATA_LBA_ME; unsigned char *status = us->iobuf; - us->extra = kzalloc(sizeof(struct usbat_info), GFP_NOIO); + us->extra = kzalloc_obj(struct usbat_info, GFP_NOIO); if (!us->extra) return -ENOMEM; diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c index 177fa6cd143a..357e5d29da0c 100644 --- a/drivers/usb/storage/sierra_ms.c +++ b/drivers/usb/storage/sierra_ms.c @@ -100,7 +100,7 @@ static ssize_t truinst_show(struct device *dev, struct device_attribute *attr, if (swi_tru_install == TRU_FORCE_MS) { result = sysfs_emit(buf, "Forced Mass Storage\n"); } else { - swocInfo = kmalloc(sizeof(struct swoc_info), GFP_KERNEL); + swocInfo = kmalloc_obj(struct swoc_info, GFP_KERNEL); if (!swocInfo) { sysfs_emit(buf, "Error\n"); return -ENOMEM; @@ -149,8 +149,7 @@ int sierra_ms_init(struct us_data *us) else { usb_stor_dbg(us, "SWIMS: Normal SWoC Logic\n"); - swocInfo = kmalloc(sizeof(struct swoc_info), - GFP_KERNEL); + swocInfo = kmalloc_obj(struct swoc_info, GFP_KERNEL); if (!swocInfo) return -ENOMEM; diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index ac3c0b919fdd..0a9902d2b118 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -480,7 +480,7 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp, if (!urb) goto out; - iu = kzalloc(sizeof(*iu), gfp); + iu = kzalloc_obj(*iu, gfp); if (!iu) goto free; diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 152ee3376550..0d24d426a176 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -537,7 +537,7 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) usb_set_intfdata(intf, us); /* Allocate the control/setup and DMA-mapped buffers */ - us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL); + us->cr = kmalloc_obj(*us->cr, GFP_KERNEL); if (!us->cr) return -ENOMEM; diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index dbba53f02497..19f793ac6389 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -646,7 +646,7 @@ typec_register_altmode(struct device *parent, struct altmode *alt; int ret; - alt = kzalloc(sizeof(*alt), GFP_KERNEL); + alt = kzalloc_obj(*alt, GFP_KERNEL); if (!alt) { altmode_id_remove(parent, id); return ERR_PTR(-ENOMEM); @@ -1113,7 +1113,7 @@ struct typec_partner *typec_register_partner(struct typec_port *port, struct typec_partner *partner; int ret; - partner = kzalloc(sizeof(*partner), GFP_KERNEL); + partner = kzalloc_obj(*partner, GFP_KERNEL); if (!partner) return ERR_PTR(-ENOMEM); @@ -1313,7 +1313,7 @@ struct typec_plug *typec_register_plug(struct typec_cable *cable, char name[8]; int ret; - plug = kzalloc(sizeof(*plug), GFP_KERNEL); + plug = kzalloc_obj(*plug, GFP_KERNEL); if (!plug) return ERR_PTR(-ENOMEM); @@ -1466,7 +1466,7 @@ struct typec_cable *typec_register_cable(struct typec_port *port, struct typec_cable *cable; int ret; - cable = kzalloc(sizeof(*cable), GFP_KERNEL); + cable = kzalloc_obj(*cable, GFP_KERNEL); if (!cable) return ERR_PTR(-ENOMEM); @@ -2703,7 +2703,7 @@ struct typec_port *typec_register_port(struct device *parent, int ret; int id; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/mode_selection.c b/drivers/usb/typec/mode_selection.c index a95b31e21b52..56c6eced5666 100644 --- a/drivers/usb/typec/mode_selection.c +++ b/drivers/usb/typec/mode_selection.c @@ -216,7 +216,7 @@ static int altmode_add_to_list(struct device *dev, void *data) struct mode_state *ms; if (pdev && altmode->ops && altmode->ops->activate) { - ms = kzalloc(sizeof(*ms), GFP_KERNEL); + ms = kzalloc_obj(*ms, GFP_KERNEL); if (!ms) return -ENOMEM; ms->svid = pdev->svid; @@ -240,7 +240,7 @@ int typec_mode_selection_start(struct typec_partner *partner, if (partner->sel) return -EALREADY; - sel = kzalloc(sizeof(*sel), GFP_KERNEL); + sel = kzalloc_obj(*sel, GFP_KERNEL); if (!sel) return -ENOMEM; diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index 182c902c42f6..e09de0d3f32f 100644 --- a/drivers/usb/typec/mux.c +++ b/drivers/usb/typec/mux.c @@ -76,7 +76,7 @@ struct typec_switch *fwnode_typec_switch_get(struct fwnode_handle *fwnode) int err; int i; - sw = kzalloc(sizeof(*sw), GFP_KERNEL); + sw = kzalloc_obj(*sw, GFP_KERNEL); if (!sw) return ERR_PTR(-ENOMEM); @@ -171,7 +171,7 @@ typec_switch_register(struct device *parent, if (!desc || !desc->set) return ERR_PTR(-EINVAL); - sw_dev = kzalloc(sizeof(*sw_dev), GFP_KERNEL); + sw_dev = kzalloc_obj(*sw_dev, GFP_KERNEL); if (!sw_dev) return ERR_PTR(-ENOMEM); @@ -301,7 +301,7 @@ struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode) int err; int i; - mux = kzalloc(sizeof(*mux), GFP_KERNEL); + mux = kzalloc_obj(*mux, GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM); @@ -415,7 +415,7 @@ typec_mux_register(struct device *parent, const struct typec_mux_desc *desc) if (!desc || !desc->set) return ERR_PTR(-EINVAL); - mux_dev = kzalloc(sizeof(*mux_dev), GFP_KERNEL); + mux_dev = kzalloc_obj(*mux_dev, GFP_KERNEL); if (!mux_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c index 67f20b5ffdf4..e3337ff98ab2 100644 --- a/drivers/usb/typec/pd.c +++ b/drivers/usb/typec/pd.c @@ -480,7 +480,7 @@ static int add_pdo(struct usb_power_delivery_capabilities *cap, u32 pdo, int pos struct pdo *p; int ret; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; @@ -569,7 +569,7 @@ usb_power_delivery_register_capabilities(struct usb_power_delivery *pd, int ret; int i; - cap = kzalloc(sizeof(*cap), GFP_KERNEL); + cap = kzalloc_obj(*cap, GFP_KERNEL); if (!cap) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ usb_power_delivery_register(struct device *parent, struct usb_power_delivery_des struct usb_power_delivery *pd; int ret; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/retimer.c b/drivers/usb/typec/retimer.c index b519fcf358ca..9bc896160af1 100644 --- a/drivers/usb/typec/retimer.c +++ b/drivers/usb/typec/retimer.c @@ -110,7 +110,7 @@ typec_retimer_register(struct device *parent, const struct typec_retimer_desc *d if (!desc || !desc->set) return ERR_PTR(-EINVAL); - retimer = kzalloc(sizeof(*retimer), GFP_KERNEL); + retimer = kzalloc_obj(*retimer, GFP_KERNEL); if (!retimer) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index b7828160b81d..13b9873ba92e 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1665,7 +1665,7 @@ static int tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header, u32 *data_cpy; int ret = -ENOMEM; - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) goto err_event; @@ -3803,7 +3803,7 @@ void tcpm_pd_receive(struct tcpm_port *port, const struct pd_message *msg, { struct pd_rx_event *event; - event = kzalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc_obj(*event, GFP_ATOMIC); if (!event) return; diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c index d1f5832165c3..7549fef83d85 100644 --- a/drivers/usb/typec/ucsi/debugfs.c +++ b/drivers/usb/typec/ucsi/debugfs.c @@ -112,7 +112,7 @@ DEFINE_SHOW_ATTRIBUTE(ucsi_vbus_volt); void ucsi_debugfs_register(struct ucsi *ucsi) { - ucsi->debugfs = kzalloc(sizeof(*ucsi->debugfs), GFP_KERNEL); + ucsi->debugfs = kzalloc_obj(*ucsi->debugfs, GFP_KERNEL); if (!ucsi->debugfs) return; diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 91b6c71dd739..fe01a5e915d9 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -293,7 +293,7 @@ static int ucsi_partner_task(struct ucsi_connector *con, if (!con->partner) return 0; - uwork = kzalloc(sizeof(*uwork), GFP_KERNEL); + uwork = kzalloc_obj(*uwork, GFP_KERNEL); if (!uwork) return -ENOMEM; @@ -1865,7 +1865,8 @@ static int ucsi_init(struct ucsi *ucsi) } /* Allocate the connectors. Released in ucsi_unregister() */ - connector = kcalloc(ucsi->cap.num_connectors + 1, sizeof(*connector), GFP_KERNEL); + connector = kzalloc_objs(*connector, ucsi->cap.num_connectors + 1, + GFP_KERNEL); if (!connector) { ret = -ENOMEM; goto err_reset; @@ -2043,7 +2044,7 @@ struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops) !ops->read_message_in || !ops->sync_control || !ops->async_control) return ERR_PTR(-EINVAL); - ucsi = kzalloc(sizeof(*ucsi), GFP_KERNEL); + ucsi = kzalloc_obj(*ucsi, GFP_KERNEL); if (!ucsi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 900a64ad25e4..5fe991baffa2 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -493,7 +493,7 @@ static int skel_probe(struct usb_interface *interface, int retval; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index ce625b1ce9a5..e859c51c94e8 100644 --- a/drivers/usb/usbip/stub_dev.c +++ b/drivers/usb/usbip/stub_dev.c @@ -263,7 +263,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev) dev_dbg(&udev->dev, "allocating stub device"); /* yes, it's a new device */ - sdev = kzalloc(sizeof(struct stub_device), GFP_KERNEL); + sdev = kzalloc_obj(struct stub_device, GFP_KERNEL); if (!sdev) return NULL; diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index 9aa30ef76f3b..7df83464a75f 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers/usb/usbip/stub_rx.c @@ -535,7 +535,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, /* allocate urb array */ priv->num_urbs = num_urbs; - priv->urbs = kmalloc_array(num_urbs, sizeof(*priv->urbs), GFP_KERNEL); + priv->urbs = kmalloc_objs(*priv->urbs, num_urbs, GFP_KERNEL); if (!priv->urbs) goto err_urbs; diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c index cd92d9fac327..9e6187c3ddb0 100644 --- a/drivers/usb/usbip/stub_tx.c +++ b/drivers/usb/usbip/stub_tx.c @@ -17,7 +17,7 @@ void stub_enqueue_ret_unlink(struct stub_device *sdev, __u32 seqnum, { struct stub_unlink *unlink; - unlink = kzalloc(sizeof(struct stub_unlink), GFP_ATOMIC); + unlink = kzalloc_obj(struct stub_unlink, GFP_ATOMIC); if (!unlink) { usbip_event_add(&sdev->ud, VDEV_EVENT_ERROR_MALLOC); return; @@ -191,7 +191,7 @@ static int stub_send_ret_submit(struct stub_device *sdev) else iovnum = 2; - iov = kcalloc(iovnum, sizeof(struct kvec), GFP_KERNEL); + iov = kzalloc_objs(struct kvec, iovnum, GFP_KERNEL); if (!iov) { usbip_event_add(&sdev->ud, SDEV_EVENT_ERROR_MALLOC); diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/usbip/usbip_event.c index 26513540bcdb..0e00c2d000f8 100644 --- a/drivers/usb/usbip/usbip_event.c +++ b/drivers/usb/usbip/usbip_event.c @@ -158,7 +158,7 @@ void usbip_event_add(struct usbip_device *ud, unsigned long event) goto out; } - ue = kmalloc(sizeof(struct usbip_event), GFP_ATOMIC); + ue = kmalloc_obj(struct usbip_event, GFP_ATOMIC); if (ue == NULL) goto out; diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e55690da19e5..4dcda9e8316f 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -671,7 +671,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_device *vdev) struct vhci_hcd *vhci_hcd = vdev_to_vhci_hcd(vdev); unsigned long flags; - priv = kzalloc(sizeof(struct vhci_priv), GFP_ATOMIC); + priv = kzalloc_obj(struct vhci_priv, GFP_ATOMIC); if (!priv) { usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); return; @@ -951,7 +951,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) spin_lock(&vdev->priv_lock); /* setup CMD_UNLINK pdu */ - unlink = kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); + unlink = kzalloc_obj(struct vhci_unlink, GFP_ATOMIC); if (!unlink) { spin_unlock(&vdev->priv_lock); spin_unlock_irqrestore(&vhci->lock, flags); @@ -1537,7 +1537,7 @@ static int __init vhci_hcd_init(void) if (vhci_num_controllers < 1) vhci_num_controllers = 1; - vhcis = kcalloc(vhci_num_controllers, sizeof(struct vhci), GFP_KERNEL); + vhcis = kzalloc_objs(struct vhci, vhci_num_controllers, GFP_KERNEL); if (vhcis == NULL) return -ENOMEM; diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c index d5865460e82d..f7929b4a43a4 100644 --- a/drivers/usb/usbip/vhci_sysfs.c +++ b/drivers/usb/usbip/vhci_sysfs.c @@ -476,8 +476,8 @@ static int init_status_attrs(void) { int id; - status_attrs = kcalloc(vhci_num_controllers, sizeof(struct status_attr), - GFP_KERNEL); + status_attrs = kzalloc_objs(struct status_attr, vhci_num_controllers, + GFP_KERNEL); if (status_attrs == NULL) return -ENOMEM; @@ -501,8 +501,8 @@ int vhci_init_attr_group(void) struct attribute **attrs; int ret, i; - attrs = kcalloc((vhci_num_controllers + 5), sizeof(struct attribute *), - GFP_KERNEL); + attrs = kzalloc_objs(struct attribute *, (vhci_num_controllers + 5), + GFP_KERNEL); if (attrs == NULL) return -ENOMEM; diff --git a/drivers/usb/usbip/vhci_tx.c b/drivers/usb/usbip/vhci_tx.c index 0ae40a13a9fe..a63805d57d94 100644 --- a/drivers/usb/usbip/vhci_tx.c +++ b/drivers/usb/usbip/vhci_tx.c @@ -82,7 +82,7 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev) else iovnum = 3; - iov = kcalloc(iovnum, sizeof(*iov), GFP_KERNEL); + iov = kzalloc_objs(*iov, iovnum, GFP_KERNEL); if (!iov) { usbip_event_add(&vdev->ud, SDEV_EVENT_ERROR_MALLOC); return -ENOMEM; diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c index f11535020e35..80ab3d019b87 100644 --- a/drivers/usb/usbip/vudc_dev.c +++ b/drivers/usb/usbip/vudc_dev.c @@ -43,7 +43,7 @@ struct urbp *alloc_urbp(void) { struct urbp *urb_p; - urb_p = kzalloc(sizeof(*urb_p), GFP_KERNEL); + urb_p = kzalloc_obj(*urb_p, GFP_KERNEL); if (!urb_p) return urb_p; @@ -284,7 +284,7 @@ static struct usb_request *vep_alloc_request(struct usb_ep *_ep, if (!_ep) return NULL; - req = kzalloc(sizeof(*req), mem_flags); + req = kzalloc_obj(*req, mem_flags); if (!req) return NULL; @@ -491,7 +491,7 @@ struct vudc_device *alloc_vudc_device(int devid) { struct vudc_device *udc_dev; - udc_dev = kzalloc(sizeof(*udc_dev), GFP_KERNEL); + udc_dev = kzalloc_obj(*udc_dev, GFP_KERNEL); if (!udc_dev) return NULL; @@ -518,7 +518,7 @@ static int init_vudc_hw(struct vudc *udc) struct usbip_device *ud = &udc->ud; struct vep *ep; - udc->ep = kcalloc(VIRTUAL_ENDPOINTS, sizeof(*udc->ep), GFP_KERNEL); + udc->ep = kzalloc_objs(*udc->ep, VIRTUAL_ENDPOINTS, GFP_KERNEL); if (!udc->ep) goto nomem_ep; @@ -598,7 +598,7 @@ int vudc_probe(struct platform_device *pdev) struct vudc *udc; int ret = -ENOMEM; - udc = kzalloc(sizeof(*udc), GFP_KERNEL); + udc = kzalloc_obj(*udc, GFP_KERNEL); if (!udc) goto out; diff --git a/drivers/usb/usbip/vudc_tx.c b/drivers/usb/usbip/vudc_tx.c index 30c11bf9f4e7..b4b7796319f1 100644 --- a/drivers/usb/usbip/vudc_tx.c +++ b/drivers/usb/usbip/vudc_tx.c @@ -97,7 +97,7 @@ static int v_send_ret_submit(struct vudc *udc, struct urbp *urb_p) else iovnum = 2; - iov = kcalloc(iovnum, sizeof(*iov), GFP_KERNEL); + iov = kzalloc_objs(*iov, iovnum, GFP_KERNEL); if (!iov) { usbip_event_add(&udc->ud, VUDC_EVENT_ERROR_MALLOC); ret = -ENOMEM; @@ -246,12 +246,12 @@ void v_enqueue_ret_unlink(struct vudc *udc, __u32 seqnum, __u32 status) struct tx_item *txi; struct v_unlink *unlink; - txi = kzalloc(sizeof(*txi), GFP_ATOMIC); + txi = kzalloc_obj(*txi, GFP_ATOMIC); if (!txi) { usbip_event_add(&udc->ud, VDEV_EVENT_ERROR_MALLOC); return; } - unlink = kzalloc(sizeof(*unlink), GFP_ATOMIC); + unlink = kzalloc_obj(*unlink, GFP_ATOMIC); if (!unlink) { kfree(txi); usbip_event_add(&udc->ud, VDEV_EVENT_ERROR_MALLOC); @@ -271,7 +271,7 @@ void v_enqueue_ret_submit(struct vudc *udc, struct urbp *urb_p) { struct tx_item *txi; - txi = kzalloc(sizeof(*txi), GFP_ATOMIC); + txi = kzalloc_obj(*txi, GFP_ATOMIC); if (!txi) { usbip_event_add(&udc->ud, VDEV_EVENT_ERROR_MALLOC); return; diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index 6658dc74d915..b1b4c6adeef7 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -793,7 +793,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) } pci_set_master(pdev); - ifcvf_mgmt_dev = kzalloc(sizeof(struct ifcvf_vdpa_mgmt_dev), GFP_KERNEL); + ifcvf_mgmt_dev = kzalloc_obj(struct ifcvf_vdpa_mgmt_dev, GFP_KERNEL); if (!ifcvf_mgmt_dev) { IFCVF_ERR(pdev, "Failed to alloc memory for the vDPA management device\n"); return -ENOMEM; diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c index 8870a7169267..f27316f3fec3 100644 --- a/drivers/vdpa/mlx5/core/mr.c +++ b/drivers/vdpa/mlx5/core/mr.c @@ -215,7 +215,7 @@ static int create_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr * int err = 0; int i = 0; - cmds = kvcalloc(mr->num_directs, sizeof(*cmds), GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); if (!cmds) return -ENOMEM; @@ -287,8 +287,8 @@ static int destroy_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr int err = 0; int i = 0; - cmds = kvcalloc(mr->num_directs, sizeof(*cmds), GFP_KERNEL); - cmd_mem = kvcalloc(mr->num_directs, sizeof(*cmd_mem), GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); + cmd_mem = kvzalloc_objs(*cmd_mem, mr->num_directs, GFP_KERNEL); if (!cmds || !cmd_mem) return -ENOMEM; @@ -456,7 +456,7 @@ static int add_direct_chain(struct mlx5_vdpa_dev *mvdev, st = start; while (size) { sz = (u32)min_t(u64, MAX_KLM_SIZE, size); - dmr = kzalloc(sizeof(*dmr), GFP_KERNEL); + dmr = kzalloc_obj(*dmr, GFP_KERNEL); if (!dmr) { err = -ENOMEM; goto err_alloc; @@ -817,7 +817,7 @@ struct mlx5_vdpa_mr *mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr *mr; int err; - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index b7e46338815f..15a6c91ec335 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1229,8 +1229,8 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev, WARN(start_vq + num_vqs > mvdev->max_vqs, "query vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvcalloc(num_vqs, sizeof(*cmds), GFP_KERNEL); - cmd_mem = kvcalloc(num_vqs, sizeof(*cmd_mem), GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1562,8 +1562,8 @@ static int modify_virtqueues(struct mlx5_vdpa_net *ndev, int start_vq, int num_v WARN(start_vq + num_vqs > mvdev->max_vqs, "modify vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvcalloc(num_vqs, sizeof(*cmds), GFP_KERNEL); - cmd_mem = kvcalloc(num_vqs, sizeof(*cmd_mem), GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1649,7 +1649,7 @@ static int suspend_vqs(struct mlx5_vdpa_net *ndev, int start_vq, int num_vqs) if (err) return err; - attrs = kcalloc(num_vqs, sizeof(struct mlx5_virtq_attr), GFP_KERNEL); + attrs = kzalloc_objs(struct mlx5_virtq_attr, num_vqs, GFP_KERNEL); if (!attrs) return -ENOMEM; @@ -1922,7 +1922,7 @@ static int mlx5_vdpa_add_mac_vlan_rules(struct mlx5_vdpa_net *ndev, u8 *mac, int err; u16 vid; - spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + spec = kvzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; @@ -2034,7 +2034,7 @@ static int mac_vlan_add(struct mlx5_vdpa_net *ndev, u8 *mac, u16 vid, bool tagge if (mac_vlan_lookup(ndev, val)) return -EEXIST; - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); if (!ptr) return -ENOMEM; @@ -2846,7 +2846,7 @@ static int queue_link_work(struct mlx5_vdpa_net *ndev) { struct mlx5_vdpa_wq_ent *wqent; - wqent = kzalloc(sizeof(*wqent), GFP_ATOMIC); + wqent = kzalloc_obj(*wqent, GFP_ATOMIC); if (!wqent) return -ENOMEM; @@ -3809,7 +3809,8 @@ static void allocate_irqs(struct mlx5_vdpa_net *ndev) if (!ndev->mvdev.mdev->pdev) return; - ndev->irqp.entries = kcalloc(ndev->mvdev.max_vqs, sizeof(*ndev->irqp.entries), GFP_KERNEL); + ndev->irqp.entries = kzalloc_objs(*ndev->irqp.entries, + ndev->mvdev.max_vqs, GFP_KERNEL); if (!ndev->irqp.entries) return; @@ -3901,8 +3902,9 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, mlx5_cmd_init_async_ctx(mdev, &mvdev->async_ctx); - ndev->vqs = kcalloc(max_vqs, sizeof(*ndev->vqs), GFP_KERNEL); - ndev->event_cbs = kcalloc(max_vqs + 1, sizeof(*ndev->event_cbs), GFP_KERNEL); + ndev->vqs = kzalloc_objs(*ndev->vqs, max_vqs, GFP_KERNEL); + ndev->event_cbs = kzalloc_objs(*ndev->event_cbs, max_vqs + 1, + GFP_KERNEL); if (!ndev->vqs || !ndev->event_cbs) { err = -ENOMEM; goto err_alloc; @@ -4102,7 +4104,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, struct mlx5_vdpa_mgmtdev *mgtdev; int err; - mgtdev = kzalloc(sizeof(*mgtdev), GFP_KERNEL); + mgtdev = kzalloc_obj(*mgtdev, GFP_KERNEL); if (!mgtdev) return -ENOMEM; diff --git a/drivers/vdpa/pds/aux_drv.c b/drivers/vdpa/pds/aux_drv.c index f57330cf9024..970eec66b117 100644 --- a/drivers/vdpa/pds/aux_drv.c +++ b/drivers/vdpa/pds/aux_drv.c @@ -39,7 +39,7 @@ static int pds_vdpa_probe(struct auxiliary_device *aux_dev, struct pds_vdpa_aux *vdpa_aux; int err; - vdpa_aux = kzalloc(sizeof(*vdpa_aux), GFP_KERNEL); + vdpa_aux = kzalloc_obj(*vdpa_aux, GFP_KERNEL); if (!vdpa_aux) return -ENOMEM; diff --git a/drivers/vdpa/solidrun/snet_main.c b/drivers/vdpa/solidrun/snet_main.c index 4588211d57eb..527efeed912c 100644 --- a/drivers/vdpa/solidrun/snet_main.c +++ b/drivers/vdpa/solidrun/snet_main.c @@ -732,7 +732,7 @@ static int psnet_read_cfg(struct pci_dev *pdev, struct psnet *psnet) /* Load device configuration from BAR */ for (i = 0; i < cfg->devices_num; i++) { - cfg->devs[i] = kzalloc(sizeof(*cfg->devs[i]), GFP_KERNEL); + cfg->devs[i] = kzalloc_obj(*cfg->devs[i], GFP_KERNEL); if (!cfg->devs[i]) { snet_free_cfg(cfg); return -ENOMEM; @@ -827,7 +827,7 @@ static int snet_build_vqs(struct snet *snet) /* Allocate the VQs */ for (i = 0; i < snet->cfg->vq_num; i++) { - snet->vqs[i] = kzalloc(sizeof(*snet->vqs[i]), GFP_KERNEL); + snet->vqs[i] = kzalloc_obj(*snet->vqs[i], GFP_KERNEL); if (!snet->vqs[i]) { snet_free_vqs(snet); return -ENOMEM; @@ -902,7 +902,7 @@ static int snet_vdpa_probe_pf(struct pci_dev *pdev) } /* Allocate a PCI physical function device */ - psnet = kzalloc(sizeof(*psnet), GFP_KERNEL); + psnet = kzalloc_obj(*psnet, GFP_KERNEL); if (!psnet) return -ENOMEM; diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index df9c7ddc5d78..24b4fca22893 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -246,18 +246,18 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, if (!vdpasim->config) goto err_iommu; - vdpasim->vqs = kcalloc(dev_attr->nvqs, sizeof(struct vdpasim_virtqueue), - GFP_KERNEL); + vdpasim->vqs = kzalloc_objs(struct vdpasim_virtqueue, dev_attr->nvqs, + GFP_KERNEL); if (!vdpasim->vqs) goto err_iommu; - vdpasim->iommu = kmalloc_array(vdpasim->dev_attr.nas, - sizeof(*vdpasim->iommu), GFP_KERNEL); + vdpasim->iommu = kmalloc_objs(*vdpasim->iommu, vdpasim->dev_attr.nas, + GFP_KERNEL); if (!vdpasim->iommu) goto err_iommu; - vdpasim->iommu_pt = kmalloc_array(vdpasim->dev_attr.nas, - sizeof(*vdpasim->iommu_pt), GFP_KERNEL); + vdpasim->iommu_pt = kmalloc_objs(*vdpasim->iommu_pt, + vdpasim->dev_attr.nas, GFP_KERNEL); if (!vdpasim->iommu_pt) goto err_iommu; diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c index 0a9f668467a8..44e9babc0b54 100644 --- a/drivers/vdpa/vdpa_user/iova_domain.c +++ b/drivers/vdpa/vdpa_user/iova_domain.c @@ -25,7 +25,7 @@ static int vduse_iotlb_add_range(struct vduse_iova_domain *domain, struct vdpa_map_file *map_file; int ret; - map_file = kmalloc(sizeof(*map_file), GFP_ATOMIC); + map_file = kmalloc_obj(*map_file, GFP_ATOMIC); if (!map_file) return -ENOMEM; @@ -622,7 +622,7 @@ vduse_domain_create(unsigned long iova_limit, size_t bounce_size) if (iova_limit <= bounce_size) return NULL; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) return NULL; diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index 405d59610f76..7478aa8d5489 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1232,7 +1232,7 @@ static int vduse_dev_reg_umem(struct vduse_dev *dev, npages = size >> PAGE_SHIFT; page_list = __vmalloc(array_size(npages, sizeof(struct page *)), GFP_KERNEL_ACCOUNT); - umem = kzalloc(sizeof(*umem), GFP_KERNEL); + umem = kzalloc_obj(*umem, GFP_KERNEL); if (!page_list || !umem) goto unlock; @@ -1800,12 +1800,12 @@ static int vduse_dev_init_vqs(struct vduse_dev *dev, u32 vq_align, u32 vq_num) dev->vq_align = vq_align; dev->vq_num = vq_num; - dev->vqs = kcalloc(dev->vq_num, sizeof(*dev->vqs), GFP_KERNEL); + dev->vqs = kzalloc_objs(*dev->vqs, dev->vq_num, GFP_KERNEL); if (!dev->vqs) return -ENOMEM; for (i = 0; i < vq_num; i++) { - dev->vqs[i] = kzalloc(sizeof(*dev->vqs[i]), GFP_KERNEL); + dev->vqs[i] = kzalloc_obj(*dev->vqs[i], GFP_KERNEL); if (!dev->vqs[i]) { ret = -ENOMEM; goto err; @@ -1839,7 +1839,7 @@ err: static struct vduse_dev *vduse_dev_create(void) { - struct vduse_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct vduse_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; @@ -2076,7 +2076,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->vendor_id = config->vendor_id; dev->nas = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->nas; - dev->as = kcalloc(dev->nas, sizeof(dev->as[0]), GFP_KERNEL); + dev->as = kzalloc_objs(dev->as[0], dev->nas, GFP_KERNEL); if (!dev->as) goto err_as; for (int i = 0; i < dev->nas; i++) @@ -2085,8 +2085,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->ngroups = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->ngroups; - dev->groups = kcalloc(dev->ngroups, sizeof(dev->groups[0]), - GFP_KERNEL); + dev->groups = kzalloc_objs(dev->groups[0], dev->ngroups, GFP_KERNEL); if (!dev->groups) goto err_vq_groups; for (u32 i = 0; i < dev->ngroups; ++i) { @@ -2227,7 +2226,7 @@ static int vduse_open(struct inode *inode, struct file *file) { struct vduse_control *control; - control = kmalloc(sizeof(struct vduse_control), GFP_KERNEL); + control = kmalloc_obj(struct vduse_control, GFP_KERNEL); if (!control) return -ENOMEM; @@ -2357,7 +2356,7 @@ static int vduse_mgmtdev_init(void) { int ret; - vduse_mgmt = kzalloc(sizeof(*vduse_mgmt), GFP_KERNEL); + vduse_mgmt = kzalloc_obj(*vduse_mgmt, GFP_KERNEL); if (!vduse_mgmt) return -ENOMEM; diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index 17a19a728c9c..102f25ccfddf 100644 --- a/drivers/vdpa/virtio_pci/vp_vdpa.c +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c @@ -608,7 +608,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct virtio_device_id *mdev_id = NULL; int err; - vp_vdpa_mgtdev = kzalloc(sizeof(*vp_vdpa_mgtdev), GFP_KERNEL); + vp_vdpa_mgtdev = kzalloc_obj(*vp_vdpa_mgtdev, GFP_KERNEL); if (!vp_vdpa_mgtdev) return -ENOMEM; @@ -616,7 +616,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) mgtdev->ops = &vp_vdpa_mdev_ops; mgtdev->device = dev; - mdev = kzalloc(sizeof(struct virtio_pci_modern_device), GFP_KERNEL); + mdev = kzalloc_obj(struct virtio_pci_modern_device, GFP_KERNEL); if (!mdev) { err = -ENOMEM; goto mdev_err; @@ -626,7 +626,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) * id_table should be a null terminated array, so allocate one additional * entry here, see vdpa_mgmtdev_get_classes(). */ - mdev_id = kcalloc(2, sizeof(struct virtio_device_id), GFP_KERNEL); + mdev_id = kzalloc_objs(struct virtio_device_id, 2, GFP_KERNEL); if (!mdev_id) { err = -ENOMEM; goto mdev_id_err; diff --git a/drivers/vfio/cdx/intr.c b/drivers/vfio/cdx/intr.c index 986fa2a45fa4..0ae39bda7c35 100644 --- a/drivers/vfio/cdx/intr.c +++ b/drivers/vfio/cdx/intr.c @@ -27,7 +27,7 @@ static int vfio_cdx_msi_enable(struct vfio_cdx_device *vdev, int nvec) struct device *dev = vdev->vdev.dev; int msi_idx, ret; - vdev->cdx_irqs = kcalloc(nvec, sizeof(struct vfio_cdx_irq), GFP_KERNEL); + vdev->cdx_irqs = kzalloc_objs(struct vfio_cdx_irq, nvec, GFP_KERNEL); if (!vdev->cdx_irqs) return -ENOMEM; diff --git a/drivers/vfio/cdx/main.c b/drivers/vfio/cdx/main.c index 253031b86b60..8ab97405b2bd 100644 --- a/drivers/vfio/cdx/main.c +++ b/drivers/vfio/cdx/main.c @@ -16,8 +16,8 @@ static int vfio_cdx_open_device(struct vfio_device *core_vdev) int count = cdx_dev->res_count; int i, ret; - vdev->regions = kcalloc(count, sizeof(struct vfio_cdx_region), - GFP_KERNEL_ACCOUNT); + vdev->regions = kzalloc_objs(struct vfio_cdx_region, count, + GFP_KERNEL_ACCOUNT); if (!vdev->regions) return -ENOMEM; diff --git a/drivers/vfio/container.c b/drivers/vfio/container.c index d53d08f16973..937fc1de5965 100644 --- a/drivers/vfio/container.c +++ b/drivers/vfio/container.c @@ -95,7 +95,7 @@ int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops) if (WARN_ON(!ops->register_device != !ops->unregister_device)) return -EINVAL; - driver = kzalloc(sizeof(*driver), GFP_KERNEL); + driver = kzalloc_obj(*driver, GFP_KERNEL); if (!driver) return -ENOMEM; @@ -360,7 +360,7 @@ static int vfio_fops_open(struct inode *inode, struct file *filep) { struct vfio_container *container; - container = kzalloc(sizeof(*container), GFP_KERNEL_ACCOUNT); + container = kzalloc_obj(*container, GFP_KERNEL_ACCOUNT); if (!container) return -ENOMEM; diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c index 3985613e6830..462fae1aa538 100644 --- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c @@ -27,8 +27,8 @@ static int vfio_fsl_mc_open_device(struct vfio_device *core_vdev) int count = mc_dev->obj_desc.region_count; int i; - vdev->regions = kcalloc(count, sizeof(struct vfio_fsl_mc_region), - GFP_KERNEL_ACCOUNT); + vdev->regions = kzalloc_objs(struct vfio_fsl_mc_region, count, + GFP_KERNEL_ACCOUNT); if (!vdev->regions) return -ENOMEM; diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c b/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c index 7e7988c4258f..d0fedd9aa7c5 100644 --- a/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c @@ -29,7 +29,7 @@ static int vfio_fsl_mc_irqs_allocate(struct vfio_fsl_mc_device *vdev) irq_count = mc_dev->obj_desc.irq_count; - mc_irq = kcalloc(irq_count, sizeof(*mc_irq), GFP_KERNEL_ACCOUNT); + mc_irq = kzalloc_objs(*mc_irq, irq_count, GFP_KERNEL_ACCOUNT); if (!mc_irq) return -ENOMEM; diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index d47ffada6912..868e69053050 100644 --- a/drivers/vfio/group.c +++ b/drivers/vfio/group.c @@ -515,7 +515,7 @@ static struct vfio_group *vfio_group_alloc(struct iommu_group *iommu_group, struct vfio_group *group; int minor; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index f2e686f8f1ef..5b6ac30c02bf 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -154,7 +154,7 @@ int mdev_device_create(struct mdev_type *type, const guid_t *uuid) atomic_dec(&parent->available_instances); } - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) { mutex_unlock(&mdev_list_lock); return -ENOMEM; diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index e61df3fe0db9..68b3c1745609 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -831,7 +831,7 @@ hisi_acc_vf_pci_resume(struct hisi_acc_vf_core_device *hisi_acc_vdev) { struct hisi_acc_vf_migration_file *migf; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); @@ -953,7 +953,7 @@ hisi_acc_open_saving_migf(struct hisi_acc_vf_core_device *hisi_acc_vdev) struct hisi_acc_vf_migration_file *migf; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); @@ -1498,7 +1498,7 @@ static int hisi_acc_vf_dev_read(struct seq_file *seq, void *data) } mutex_lock(&hisi_acc_vdev->state_mutex); - vf_data = kzalloc(sizeof(*vf_data), GFP_KERNEL); + vf_data = kzalloc_obj(*vf_data, GFP_KERNEL); if (!vf_data) { ret = -ENOMEM; goto mutex_release; @@ -1679,7 +1679,7 @@ static void hisi_acc_vfio_debug_init(struct hisi_acc_vf_core_device *hisi_acc_vd return; } - migf = kzalloc(sizeof(*migf), GFP_KERNEL); + migf = kzalloc_obj(*migf, GFP_KERNEL); if (!migf) { dput(vfio_dev_migration); return; diff --git a/drivers/vfio/pci/mlx5/cmd.c b/drivers/vfio/pci/mlx5/cmd.c index a92b095b90f6..ca6d95f293cd 100644 --- a/drivers/vfio/pci/mlx5/cmd.c +++ b/drivers/vfio/pci/mlx5/cmd.c @@ -492,7 +492,7 @@ static int mlx5vf_add_pages(struct page ***page_list, unsigned int npages) int i; *page_list = - kvcalloc(npages, sizeof(struct page *), GFP_KERNEL_ACCOUNT); + kvzalloc_objs(struct page *, npages, GFP_KERNEL_ACCOUNT); if (!*page_list) return -ENOMEM; @@ -525,7 +525,7 @@ mlx5vf_alloc_data_buffer(struct mlx5_vf_migration_file *migf, u32 npages, struct mlx5_vhca_data_buffer *buf; int ret; - buf = kzalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT); + buf = kzalloc_obj(*buf, GFP_KERNEL_ACCOUNT); if (!buf) return ERR_PTR(-ENOMEM); @@ -1233,7 +1233,7 @@ mlx5vf_create_rc_qp(struct mlx5_core_dev *mdev, void *in; int err; - qp = kzalloc(sizeof(*qp), GFP_KERNEL_ACCOUNT); + qp = kzalloc_obj(*qp, GFP_KERNEL_ACCOUNT); if (!qp) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c index 9c5970411d07..dbba6173894b 100644 --- a/drivers/vfio/pci/mlx5/main.c +++ b/drivers/vfio/pci/mlx5/main.c @@ -608,7 +608,7 @@ mlx5vf_pci_save_device_data(struct mlx5vf_pci_core_device *mvdev, bool track) u64 full_size; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); @@ -989,7 +989,7 @@ mlx5vf_pci_resume_device_data(struct mlx5vf_pci_core_device *mvdev) struct mlx5_vhca_data_buffer *buf; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/pds/dirty.c b/drivers/vfio/pci/pds/dirty.c index 4915a7c1c491..7a218948c475 100644 --- a/drivers/vfio/pci/pds/dirty.c +++ b/drivers/vfio/pci/pds/dirty.c @@ -43,9 +43,8 @@ pds_vfio_print_guest_region_info(struct pds_vfio_pci_device *pds_vfio, u8 num_regions; int err; - region_info = kcalloc(max_regions, - sizeof(struct pds_lm_dirty_region_info), - GFP_KERNEL); + region_info = kzalloc_objs(struct pds_lm_dirty_region_info, max_regions, + GFP_KERNEL); if (!region_info) return; @@ -286,7 +285,7 @@ static int pds_vfio_dirty_enable(struct pds_vfio_pci_device *pds_vfio, num_ranges = max_regions; } - region_info = kcalloc(num_ranges, sizeof(*region_info), GFP_KERNEL); + region_info = kzalloc_objs(*region_info, num_ranges, GFP_KERNEL); if (!region_info) return -ENOMEM; len = num_ranges * sizeof(*region_info); @@ -398,7 +397,7 @@ static int pds_vfio_dirty_seq_ack(struct pds_vfio_pci_device *pds_vfio, * will be enough pages to represent the bmp_bytes */ npages = DIV_ROUND_UP_ULL(bmp_bytes + page_offset, PAGE_SIZE); - pages = kmalloc_array(npages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/vfio/pci/pds/lm.c b/drivers/vfio/pci/pds/lm.c index 4d70c833fa32..c9a21a049372 100644 --- a/drivers/vfio/pci/pds/lm.c +++ b/drivers/vfio/pci/pds/lm.c @@ -24,7 +24,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) return NULL; /* Alloc file structure */ - lm_file = kzalloc(sizeof(*lm_file), GFP_KERNEL); + lm_file = kzalloc_obj(*lm_file, GFP_KERNEL); if (!lm_file) return NULL; @@ -42,7 +42,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) /* Allocate memory for file pages */ npages = DIV_ROUND_UP_ULL(size, PAGE_SIZE); - pages = kmalloc_array(npages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) goto out_put_file; diff --git a/drivers/vfio/pci/qat/main.c b/drivers/vfio/pci/qat/main.c index 8fbdf7c6d666..591349c2edc8 100644 --- a/drivers/vfio/pci/qat/main.c +++ b/drivers/vfio/pci/qat/main.c @@ -261,7 +261,7 @@ qat_vf_save_device_data(struct qat_vf_core_device *qat_vdev, bool pre_copy) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL); + migf = kzalloc_obj(*migf, GFP_KERNEL); if (!migf) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ qat_vf_resume_device_data(struct qat_vf_core_device *qat_vdev) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL); + migf = kzalloc_obj(*migf, GFP_KERNEL); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index dc4e510e6e1b..b4e39253f98d 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1265,7 +1265,7 @@ static int vfio_msi_cap_len(struct vfio_pci_core_device *vdev, u8 pos) if (vdev->msi_perm) return len; - vdev->msi_perm = kmalloc(sizeof(struct perm_bits), GFP_KERNEL_ACCOUNT); + vdev->msi_perm = kmalloc_obj(struct perm_bits, GFP_KERNEL_ACCOUNT); if (!vdev->msi_perm) return -ENOMEM; diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 72c33b399800..10bfa76f06e5 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -61,7 +61,7 @@ int vfio_pci_eventfd_replace_locked(struct vfio_pci_core_device *vdev, lockdep_assert_held(&vdev->igate); if (ctx) { - new = kzalloc(sizeof(*new), GFP_KERNEL_ACCOUNT); + new = kzalloc_obj(*new, GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM; @@ -175,8 +175,7 @@ static void vfio_pci_probe_mmaps(struct vfio_pci_core_device *vdev) * of the exclusive page in case that hot-add * device's bar is assigned into it. */ - dummy_res = - kzalloc(sizeof(*dummy_res), GFP_KERNEL_ACCOUNT); + dummy_res = kzalloc_obj(*dummy_res, GFP_KERNEL_ACCOUNT); if (dummy_res == NULL) goto no_mmap; @@ -1292,7 +1291,7 @@ static int vfio_pci_ioctl_get_pci_hot_reset_info( goto header; } - devices = kcalloc(count, sizeof(*devices), GFP_KERNEL); + devices = kzalloc_objs(*devices, count, GFP_KERNEL); if (!devices) return -ENOMEM; @@ -1351,8 +1350,8 @@ vfio_pci_ioctl_pci_hot_reset_groups(struct vfio_pci_core_device *vdev, if (array_count > count) return -EINVAL; - group_fds = kcalloc(array_count, sizeof(*group_fds), GFP_KERNEL); - files = kcalloc(array_count, sizeof(*files), GFP_KERNEL); + group_fds = kzalloc_objs(*group_fds, array_count, GFP_KERNEL); + files = kzalloc_objs(*files, array_count, GFP_KERNEL); if (!group_fds || !files) { kfree(group_fds); kfree(files); @@ -2035,7 +2034,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev) if (!pdev->is_physfn) return 0; - vdev->vf_token = kzalloc(sizeof(*vdev->vf_token), GFP_KERNEL); + vdev->vf_token = kzalloc_obj(*vdev->vf_token, GFP_KERNEL); if (!vdev->vf_token) return -ENOMEM; diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c index 9918713d5774..abed6508cd83 100644 --- a/drivers/vfio/pci/vfio_pci_dmabuf.c +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c @@ -246,13 +246,13 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags, if (ret) goto err_free_ranges; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto err_free_ranges; } - priv->phys_vec = kcalloc(get_dma_buf.nr_ranges, sizeof(*priv->phys_vec), - GFP_KERNEL); + priv->phys_vec = kzalloc_objs(*priv->phys_vec, get_dma_buf.nr_ranges, + GFP_KERNEL); if (!priv->phys_vec) { ret = -ENOMEM; goto err_free_priv; diff --git a/drivers/vfio/pci/vfio_pci_igd.c b/drivers/vfio/pci/vfio_pci_igd.c index 988b6919c2c3..24f3118fc61b 100644 --- a/drivers/vfio/pci/vfio_pci_igd.c +++ b/drivers/vfio/pci/vfio_pci_igd.c @@ -180,7 +180,7 @@ static int vfio_pci_igd_opregion_init(struct vfio_pci_core_device *vdev) if (!addr || !(~addr)) return -ENODEV; - opregionvbt = kzalloc(sizeof(*opregionvbt), GFP_KERNEL_ACCOUNT); + opregionvbt = kzalloc_obj(*opregionvbt, GFP_KERNEL_ACCOUNT); if (!opregionvbt) return -ENOMEM; diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index c76e753b3cec..33944d4d9dc4 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c +++ b/drivers/vfio/pci/vfio_pci_intrs.c @@ -69,7 +69,7 @@ vfio_irq_ctx_alloc(struct vfio_pci_core_device *vdev, unsigned long index) struct vfio_pci_irq_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); + ctx = kzalloc_obj(*ctx, GFP_KERNEL_ACCOUNT); if (!ctx) return NULL; diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index b38627b35c35..4251ee03e146 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c @@ -484,7 +484,7 @@ int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset, goto out_unlock; } - ioeventfd = kzalloc(sizeof(*ioeventfd), GFP_KERNEL_ACCOUNT); + ioeventfd = kzalloc_obj(*ioeventfd, GFP_KERNEL_ACCOUNT); if (!ioeventfd) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/vfio/pci/virtio/migrate.c b/drivers/vfio/pci/virtio/migrate.c index 7dd0ac866461..35fa2d6ed611 100644 --- a/drivers/vfio/pci/virtio/migrate.c +++ b/drivers/vfio/pci/virtio/migrate.c @@ -71,7 +71,7 @@ static int virtiovf_add_migration_pages(struct virtiovf_data_buffer *buf, int i; to_fill = min_t(unsigned int, npages, PAGE_SIZE / sizeof(*page_list)); - page_list = kvcalloc(to_fill, sizeof(*page_list), GFP_KERNEL_ACCOUNT); + page_list = kvzalloc_objs(*page_list, to_fill, GFP_KERNEL_ACCOUNT); if (!page_list) return -ENOMEM; @@ -124,7 +124,7 @@ virtiovf_alloc_data_buffer(struct virtiovf_migration_file *migf, size_t length) struct virtiovf_data_buffer *buf; int ret; - buf = kzalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT); + buf = kzalloc_obj(*buf, GFP_KERNEL_ACCOUNT); if (!buf) return ERR_PTR(-ENOMEM); @@ -676,7 +676,7 @@ virtiovf_pci_save_device_data(struct virtiovf_pci_core_device *virtvdev, u32 obj_id; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); @@ -1066,7 +1066,7 @@ virtiovf_pci_resume_device_data(struct virtiovf_pci_core_device *virtvdev) u32 obj_id; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c index 2a5eb9260ec7..fff95b2d5dde 100644 --- a/drivers/vfio/pci/xe/main.c +++ b/drivers/vfio/pci/xe/main.c @@ -252,7 +252,7 @@ xe_vfio_pci_alloc_file(struct xe_vfio_pci_core_device *xe_vdev, int flags; int ret; - migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); + migf = kzalloc_obj(*migf, GFP_KERNEL_ACCOUNT); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index c2990b7e900f..c72db5a99ebd 100644 --- a/drivers/vfio/platform/vfio_platform_common.c +++ b/drivers/vfio/platform/vfio_platform_common.c @@ -141,8 +141,8 @@ static int vfio_platform_regions_init(struct vfio_platform_device *vdev) while (vdev->get_resource(vdev, cnt)) cnt++; - vdev->regions = kcalloc(cnt, sizeof(struct vfio_platform_region), - GFP_KERNEL_ACCOUNT); + vdev->regions = kzalloc_objs(struct vfio_platform_region, cnt, + GFP_KERNEL_ACCOUNT); if (!vdev->regions) return -ENOMEM; diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index ef41ecef83af..d16596e7f266 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -291,8 +291,8 @@ int vfio_platform_irq_init(struct vfio_platform_device *vdev) while (vdev->get_irq(vdev, cnt) >= 0) cnt++; - vdev->irqs = kcalloc(cnt, sizeof(struct vfio_platform_irq), - GFP_KERNEL_ACCOUNT); + vdev->irqs = kzalloc_objs(struct vfio_platform_irq, cnt, + GFP_KERNEL_ACCOUNT); if (!vdev->irqs) return -ENOMEM; diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c index 5f9e7e477078..3867928d2f49 100644 --- a/drivers/vfio/vfio_iommu_spapr_tce.c +++ b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -159,7 +159,7 @@ static long tce_iommu_register_pages(struct tce_container *container, return ret; } - tcemem = kzalloc(sizeof(*tcemem), GFP_KERNEL); + tcemem = kzalloc_obj(*tcemem, GFP_KERNEL); if (!tcemem) { ret = -ENOMEM; goto put_exit; @@ -322,7 +322,7 @@ static void *tce_iommu_open(unsigned long arg) return ERR_PTR(-EINVAL); } - container = kzalloc(sizeof(*container), GFP_KERNEL); + container = kzalloc_obj(*container, GFP_KERNEL); if (!container) return ERR_PTR(-ENOMEM); @@ -1290,7 +1290,7 @@ static int tce_iommu_attach_group(void *iommu_data, } } - tcegrp = kzalloc(sizeof(*tcegrp), GFP_KERNEL); + tcegrp = kzalloc_obj(*tcegrp, GFP_KERNEL); if (!tcegrp) { ret = -ENOMEM; goto unlock_exit; diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5167bec14e36..aedbc2fecb23 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -388,7 +388,7 @@ static int vfio_add_to_pfn_list(struct vfio_dma *dma, dma_addr_t iova, { struct vfio_pfn *vpfn; - vpfn = kzalloc(sizeof(*vpfn), GFP_KERNEL); + vpfn = kzalloc_obj(*vpfn, GFP_KERNEL); if (!vpfn) return -ENOMEM; @@ -1097,7 +1097,7 @@ static size_t unmap_unpin_fast(struct vfio_domain *domain, struct iommu_iotlb_gather *iotlb_gather) { size_t unmapped = 0; - struct vfio_regions *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct vfio_regions *entry = kzalloc_obj(*entry, GFP_KERNEL); if (entry) { unmapped = iommu_unmap_fast(domain->domain, iova, len, @@ -1753,7 +1753,7 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, goto out_unlock; } - dma = kzalloc(sizeof(*dma), GFP_KERNEL); + dma = kzalloc_obj(*dma, GFP_KERNEL); if (!dma) { ret = -ENOMEM; goto out_unlock; @@ -2017,7 +2017,7 @@ static int vfio_iommu_iova_insert(struct list_head *head, { struct vfio_iova *region; - region = kmalloc(sizeof(*region), GFP_KERNEL); + region = kmalloc_obj(*region, GFP_KERNEL); if (!region) return -ENOMEM; @@ -2259,7 +2259,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, goto out_unlock; ret = -ENOMEM; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) goto out_unlock; group->iommu_group = iommu_group; @@ -2278,7 +2278,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, } ret = -ENOMEM; - domain = kzalloc(sizeof(*domain), GFP_KERNEL); + domain = kzalloc_obj(*domain, GFP_KERNEL); if (!domain) goto out_free_group; @@ -2625,7 +2625,7 @@ static void *vfio_iommu_type1_open(unsigned long arg) { struct vfio_iommu *iommu; - iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); + iommu = kzalloc_obj(*iommu, GFP_KERNEL); if (!iommu) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index f7df90c423b4..0028abdfe3cb 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -82,7 +82,7 @@ int vfio_assign_device_set(struct vfio_device *device, void *set_id) goto found_get_ref; xa_unlock(&vfio_device_set_xa); - new_dev_set = kzalloc(sizeof(*new_dev_set), GFP_KERNEL); + new_dev_set = kzalloc_obj(*new_dev_set, GFP_KERNEL); if (!new_dev_set) return -ENOMEM; mutex_init(&new_dev_set->lock); @@ -495,7 +495,7 @@ vfio_allocate_device_file(struct vfio_device *device) { struct vfio_device_file *df; - df = kzalloc(sizeof(*df), GFP_KERNEL_ACCOUNT); + df = kzalloc_obj(*df, GFP_KERNEL_ACCOUNT); if (!df) return ERR_PTR(-ENOMEM); @@ -1083,8 +1083,7 @@ vfio_ioctl_device_feature_logging_start(struct vfio_device *device, return -E2BIG; ranges = u64_to_user_ptr(control.ranges); - nodes = kmalloc_array(nnodes, sizeof(struct interval_tree_node), - GFP_KERNEL); + nodes = kmalloc_objs(struct interval_tree_node, nnodes, GFP_KERNEL); if (!nodes) return -ENOMEM; diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c index aa2891f97508..59105a0ace4c 100644 --- a/drivers/vfio/virqfd.c +++ b/drivers/vfio/virqfd.c @@ -118,7 +118,7 @@ int vfio_virqfd_enable(void *opaque, int ret = 0; __poll_t events; - virqfd = kzalloc(sizeof(*virqfd), GFP_KERNEL_ACCOUNT); + virqfd = kzalloc_obj(*virqfd, GFP_KERNEL_ACCOUNT); if (!virqfd) return -ENOMEM; diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c index ea61330a3431..6528d084f42d 100644 --- a/drivers/vhost/iotlb.c +++ b/drivers/vhost/iotlb.c @@ -79,7 +79,7 @@ int vhost_iotlb_add_range_ctx(struct vhost_iotlb *iotlb, vhost_iotlb_map_free(iotlb, map); } - map = kmalloc(sizeof(*map), GFP_ATOMIC); + map = kmalloc_obj(*map, GFP_ATOMIC); if (!map) return -ENOMEM; @@ -151,7 +151,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_init); */ struct vhost_iotlb *vhost_iotlb_alloc(unsigned int limit, unsigned int flags) { - struct vhost_iotlb *iotlb = kzalloc(sizeof(*iotlb), GFP_KERNEL); + struct vhost_iotlb *iotlb = kzalloc_obj(*iotlb, GFP_KERNEL); if (!iotlb) return NULL; diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 7f886d3dba7d..440d959b6e24 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -240,7 +240,7 @@ vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) /* No zero copy backend? Nothing to count. */ if (!zcopy) return NULL; - ubufs = kmalloc(sizeof(*ubufs), GFP_KERNEL); + ubufs = kmalloc_obj(*ubufs, GFP_KERNEL); if (!ubufs) return ERR_PTR(-ENOMEM); atomic_set(&ubufs->refcount, 1); @@ -293,9 +293,8 @@ static int vhost_net_set_ubuf_info(struct vhost_net *n) if (!zcopy) continue; n->vqs[i].ubuf_info = - kmalloc_array(UIO_MAXIOV, - sizeof(*n->vqs[i].ubuf_info), - GFP_KERNEL); + kmalloc_objs(*n->vqs[i].ubuf_info, UIO_MAXIOV, + GFP_KERNEL); if (!n->vqs[i].ubuf_info) goto err; } @@ -1328,10 +1327,10 @@ static int vhost_net_open(struct inode *inode, struct file *f) struct xdp_buff *xdp; int i; - n = kvmalloc(sizeof *n, GFP_KERNEL | __GFP_RETRY_MAYFAIL); + n = kvmalloc_obj(*n, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!n) return -ENOMEM; - vqs = kmalloc_array(VHOST_NET_VQ_MAX, sizeof(*vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, VHOST_NET_VQ_MAX, GFP_KERNEL); if (!vqs) { kvfree(n); return -ENOMEM; @@ -1346,7 +1345,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) } n->vqs[VHOST_NET_VQ_RX].rxq.queue = queue; - xdp = kmalloc_array(VHOST_NET_BATCH, sizeof(*xdp), GFP_KERNEL); + xdp = kmalloc_objs(*xdp, VHOST_NET_BATCH, GFP_KERNEL); if (!xdp) { kfree(vqs); kvfree(n); diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index f43c1fe9fad9..36ed704562d7 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -382,9 +382,8 @@ static int vhost_scsi_copy_cmd_log(struct vhost_virtqueue *vq, unsigned int log_num) { if (!cmd->tvc_log) - cmd->tvc_log = kmalloc_array(vq->dev->iov_limit, - sizeof(*cmd->tvc_log), - GFP_KERNEL); + cmd->tvc_log = kmalloc_objs(*cmd->tvc_log, vq->dev->iov_limit, + GFP_KERNEL); if (unlikely(!cmd->tvc_log)) { vq_err(vq, "Failed to alloc tvc_log\n"); @@ -549,7 +548,7 @@ vhost_scsi_allocate_evt(struct vhost_scsi *vs, return NULL; } - evt = kzalloc(sizeof(*evt), GFP_KERNEL); + evt = kzalloc_obj(*evt, GFP_KERNEL); if (!evt) { vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); vs->vs_events_missed = true; @@ -897,7 +896,7 @@ vhost_scsi_copy_iov_to_sgl(struct vhost_scsi_cmd *cmd, struct iov_iter *iter, int i, ret; if (data_dir == DMA_FROM_DEVICE) { - cmd->read_iter = kzalloc(sizeof(*cmd->read_iter), GFP_KERNEL); + cmd->read_iter = kzalloc_obj(*cmd->read_iter, GFP_KERNEL); if (!cmd->read_iter) return -ENOMEM; @@ -1264,8 +1263,7 @@ vhost_scsi_setup_resp_iovs(struct vhost_scsi_cmd *cmd, struct iovec *in_iovs, * iov per byte. */ cnt = min(VHOST_SCSI_MAX_RESP_IOVS, in_iovs_cnt); - cmd->tvc_resp_iovs = kcalloc(cnt, sizeof(struct iovec), - GFP_KERNEL); + cmd->tvc_resp_iovs = kzalloc_objs(struct iovec, cnt, GFP_KERNEL); if (!cmd->tvc_resp_iovs) return -ENOMEM; @@ -1603,7 +1601,7 @@ vhost_scsi_handle_tmf(struct vhost_scsi *vs, struct vhost_scsi_tpg *tpg, goto send_reject; } - tmf = kzalloc(sizeof(*tmf), GFP_KERNEL); + tmf = kzalloc_obj(*tmf, GFP_KERNEL); if (!tmf) goto send_reject; @@ -1617,8 +1615,7 @@ vhost_scsi_handle_tmf(struct vhost_scsi *vs, struct vhost_scsi_tpg *tpg, tmf->inflight = vhost_scsi_get_inflight(vq); if (unlikely(log && log_num)) { - tmf->tmf_log = kmalloc_array(log_num, sizeof(*tmf->tmf_log), - GFP_KERNEL); + tmf->tmf_log = kmalloc_objs(*tmf->tmf_log, log_num, GFP_KERNEL); if (tmf->tmf_log) { memcpy(tmf->tmf_log, log, sizeof(*tmf->tmf_log) * log_num); tmf->tmf_log_num = log_num; @@ -1936,14 +1933,14 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds) return -ENOMEM; svq->max_cmds = max_cmds; - svq->scsi_cmds = kcalloc(max_cmds, sizeof(*tv_cmd), GFP_KERNEL); + svq->scsi_cmds = kzalloc_objs(*tv_cmd, max_cmds, GFP_KERNEL); if (!svq->scsi_cmds) { sbitmap_free(&svq->scsi_tags); return -ENOMEM; } - svq->upages = kcalloc(VHOST_SCSI_PREALLOC_UPAGES, sizeof(struct page *), - GFP_KERNEL); + svq->upages = kzalloc_objs(struct page *, VHOST_SCSI_PREALLOC_UPAGES, + GFP_KERNEL); if (!svq->upages) goto out; @@ -1951,9 +1948,9 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds) tv_cmd = &svq->scsi_cmds[i]; if (vs->inline_sg_cnt) { - tv_cmd->sgl = kcalloc(vs->inline_sg_cnt, - sizeof(struct scatterlist), - GFP_KERNEL); + tv_cmd->sgl = kzalloc_objs(struct scatterlist, + vs->inline_sg_cnt, + GFP_KERNEL); if (!tv_cmd->sgl) { pr_err("Unable to allocate tv_cmd->sgl\n"); goto out; @@ -1962,9 +1959,9 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds) if (vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI) && vs->inline_sg_cnt) { - tv_cmd->prot_sgl = kcalloc(vs->inline_sg_cnt, - sizeof(struct scatterlist), - GFP_KERNEL); + tv_cmd->prot_sgl = kzalloc_objs(struct scatterlist, + vs->inline_sg_cnt, + GFP_KERNEL); if (!tv_cmd->prot_sgl) { pr_err("Unable to allocate tv_cmd->prot_sgl\n"); goto out; @@ -2282,7 +2279,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) struct vhost_virtqueue **vqs; int r = -ENOMEM, i, nvqs = vhost_scsi_max_io_vqs; - vs = kvzalloc(sizeof(*vs), GFP_KERNEL); + vs = kvzalloc_obj(*vs, GFP_KERNEL); if (!vs) goto err_vs; vs->inline_sg_cnt = vhost_scsi_inline_sg_cnt; @@ -2297,17 +2294,16 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) } nvqs += VHOST_SCSI_VQ_IO; - vs->old_inflight = kmalloc_array(nvqs, sizeof(*vs->old_inflight), - GFP_KERNEL | __GFP_ZERO); + vs->old_inflight = kmalloc_objs(*vs->old_inflight, nvqs, + GFP_KERNEL | __GFP_ZERO); if (!vs->old_inflight) goto err_inflight; - vs->vqs = kmalloc_array(nvqs, sizeof(*vs->vqs), - GFP_KERNEL | __GFP_ZERO); + vs->vqs = kmalloc_objs(*vs->vqs, nvqs, GFP_KERNEL | __GFP_ZERO); if (!vs->vqs) goto err_vqs; - vqs = kmalloc_array(nvqs, sizeof(*vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, nvqs, GFP_KERNEL); if (!vqs) goto err_local_vqs; @@ -2603,7 +2599,7 @@ static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg, return -EEXIST; } - tv_nexus = kzalloc(sizeof(*tv_nexus), GFP_KERNEL); + tv_nexus = kzalloc_obj(*tv_nexus, GFP_KERNEL); if (!tv_nexus) { mutex_unlock(&tpg->tv_tpg_mutex); pr_err("Unable to allocate struct vhost_scsi_nexus\n"); @@ -2798,7 +2794,7 @@ vhost_scsi_make_tpg(struct se_wwn *wwn, const char *name) if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET) return ERR_PTR(-EINVAL); - tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); + tpg = kzalloc_obj(*tpg, GFP_KERNEL); if (!tpg) { pr_err("Unable to allocate struct vhost_scsi_tpg"); return ERR_PTR(-ENOMEM); @@ -2852,7 +2848,7 @@ vhost_scsi_make_tport(struct target_fabric_configfs *tf, /* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ - tport = kzalloc(sizeof(*tport), GFP_KERNEL); + tport = kzalloc_obj(*tport, GFP_KERNEL); if (!tport) { pr_err("Unable to allocate struct vhost_scsi_tport"); return ERR_PTR(-ENOMEM); diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 1e4e36edbcd2..fc11a048a620 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -110,13 +110,13 @@ static void handle_vq_kick(struct vhost_work *work) static int vhost_test_open(struct inode *inode, struct file *f) { - struct vhost_test *n = kmalloc(sizeof *n, GFP_KERNEL); + struct vhost_test *n = kmalloc_obj(*n, GFP_KERNEL); struct vhost_dev *dev; struct vhost_virtqueue **vqs; if (!n) return -ENOMEM; - vqs = kmalloc_array(VHOST_TEST_VQ_MAX, sizeof(*vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, VHOST_TEST_VQ_MAX, GFP_KERNEL); if (!vqs) { kfree(n); return -ENOMEM; diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index cdee8f320dca..a9f85f05874f 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -110,7 +110,7 @@ static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) if (asid >= v->vdpa->nas) return NULL; - as = kmalloc(sizeof(*as), GFP_KERNEL); + as = kmalloc_obj(*as, GFP_KERNEL); if (!as) return NULL; @@ -1064,7 +1064,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v, !(vma->vm_flags & (VM_IO | VM_PFNMAP)))) goto next; - map_file = kzalloc(sizeof(*map_file), GFP_KERNEL); + map_file = kzalloc_obj(*map_file, GFP_KERNEL); if (!map_file) { ret = -ENOMEM; break; @@ -1420,7 +1420,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) if (r) goto err; - vqs = kmalloc_array(nvqs, sizeof(*vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, nvqs, GFP_KERNEL); if (!vqs) { r = -ENOMEM; goto err; @@ -1572,7 +1572,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa) (vdpa->ngroups > 1 || vdpa->nas > 1)) return -EOPNOTSUPP; - v = kzalloc(sizeof(*v), GFP_KERNEL | __GFP_RETRY_MAYFAIL); + v = kzalloc_obj(*v, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!v) return -ENOMEM; @@ -1593,8 +1593,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa) v->dev.release = vhost_vdpa_release_dev; v->dev.parent = &vdpa->dev; v->dev.devt = MKDEV(MAJOR(vhost_vdpa_major), minor); - v->vqs = kmalloc_array(v->nvqs, sizeof(struct vhost_virtqueue), - GFP_KERNEL); + v->vqs = kmalloc_objs(struct vhost_virtqueue, v->nvqs, GFP_KERNEL); if (!v->vqs) { r = -ENOMEM; goto err; diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index fcf7f10adbbf..dafbc3dd3805 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -514,13 +514,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) for (i = 0; i < dev->nvqs; ++i) { vq = dev->vqs[i]; - vq->indirect = kmalloc_array(UIO_MAXIOV, - sizeof(*vq->indirect), - GFP_KERNEL); - vq->log = kmalloc_array(dev->iov_limit, sizeof(*vq->log), - GFP_KERNEL); - vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), - GFP_KERNEL); + vq->indirect = kmalloc_objs(*vq->indirect, UIO_MAXIOV, + GFP_KERNEL); + vq->log = kmalloc_objs(*vq->log, dev->iov_limit, GFP_KERNEL); + vq->heads = kmalloc_objs(*vq->heads, dev->iov_limit, GFP_KERNEL); vq->nheads = kmalloc_array(dev->iov_limit, sizeof(*vq->nheads), GFP_KERNEL); if (!vq->indirect || !vq->log || !vq->heads || !vq->nheads) @@ -836,7 +833,7 @@ static struct vhost_worker *vhost_worker_create(struct vhost_dev *dev) const struct vhost_worker_ops *ops = dev->fork_owner ? &vhost_task_ops : &kthread_ops; - worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); + worker = kzalloc_obj(*worker, GFP_KERNEL_ACCOUNT); if (!worker) return NULL; @@ -1982,8 +1979,7 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) return -EOPNOTSUPP; if (mem.nregions > max_mem_regions) return -E2BIG; - newmem = kvzalloc(struct_size(newmem, regions, mem.nregions), - GFP_KERNEL); + newmem = kvzalloc_flex(*newmem, regions, mem.nregions, GFP_KERNEL); if (!newmem) return -ENOMEM; @@ -3272,7 +3268,7 @@ EXPORT_SYMBOL_GPL(vhost_disable_notify); struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) { /* Make sure all padding within the structure is initialized. */ - struct vhost_msg_node *node = kzalloc(sizeof(*node), GFP_KERNEL); + struct vhost_msg_node *node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 925858cc6096..9066f9f12ba1 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -227,7 +227,7 @@ static int resize_iovec(struct vringh_kiov *iov, gfp_t gfp) if (flag) new = krealloc_array(iov->iov, new_num, sizeof(*new), gfp); else { - new = kmalloc_array(new_num, sizeof(*new), gfp); + new = kmalloc_objs(*new, new_num, gfp); if (new) { memcpy(new, iov->iov, iov->max_num * sizeof(struct iovec)); diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 488d7fa6e4ec..0bb4e3fdc71c 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -676,11 +676,11 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) /* This struct is large and allocation could fail, fall back to vmalloc * if there is no other way. */ - vsock = kvmalloc(sizeof(*vsock), GFP_KERNEL | __GFP_RETRY_MAYFAIL); + vsock = kvmalloc_obj(*vsock, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!vsock) return -ENOMEM; - vqs = kmalloc_array(ARRAY_SIZE(vsock->vqs), sizeof(*vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, ARRAY_SIZE(vsock->vqs), GFP_KERNEL); if (!vqs) { ret = -ENOMEM; goto out; diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 1e9b7e85d99a..c6e155a150a5 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -371,7 +371,7 @@ struct backlight_device *backlight_device_register(const char *name, pr_debug("backlight_device_register: name=%s\n", name); - new_bd = kzalloc(sizeof(struct backlight_device), GFP_KERNEL); + new_bd = kzalloc_obj(struct backlight_device, GFP_KERNEL); if (!new_bd) return ERR_PTR(-ENOMEM); diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index affe5c52471a..d33c4f370075 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -197,7 +197,7 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, pr_debug("lcd_device_register: name=%s\n", name); - new_ld = kzalloc(sizeof(struct lcd_device), GFP_KERNEL); + new_ld = kzalloc_obj(struct lcd_device, GFP_KERNEL); if (!new_ld) return ERR_PTR(-ENOMEM); diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index f1f3ee8e5e8a..98df1ddfd1e9 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c @@ -186,7 +186,7 @@ static int sticon_set_font(struct vc_data *vc, const struct console_font *op, new_font->underline_height = 0; new_font->underline_pos = 0; - cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); if (!cooked_font) { kfree(new_font); return -ENOMEM; diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c index ec084323115f..990e8038ffb3 100644 --- a/drivers/video/fbdev/arkfb.c +++ b/drivers/video/fbdev/arkfb.c @@ -431,7 +431,8 @@ static struct dac_ops ics5342_ops = { static struct dac_info * ics5342_init(dac_read_regs_t drr, dac_write_regs_t dwr, void *data) { - struct ics5342_info *ics_info = kzalloc(sizeof(struct ics5342_info), GFP_KERNEL); + struct ics5342_info *ics_info = kzalloc_obj(struct ics5342_info, + GFP_KERNEL); struct dac_info *info = &ics_info->dac; if (!ics_info) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 56ef1d88e003..d5e107730a4d 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2976,7 +2976,7 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info, /* nothing */ ; j = i + 4; - par->mmap_map = kcalloc(j, sizeof(*par->mmap_map), GFP_ATOMIC); + par->mmap_map = kzalloc_objs(*par->mmap_map, j, GFP_ATOMIC); if (!par->mmap_map) { PRINTKE("atyfb_setup_sparc() can't alloc mmap_map\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index bf764c92bcf1..908b2be850ac 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c @@ -136,7 +136,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) return; #endif - pdata = kmalloc(sizeof(struct radeon_bl_privdata), GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_bl_privdata, GFP_KERNEL); if (!pdata) { printk("radeonfb: Memory allocation failed\n"); goto error; diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 1d2c57ba25a3..979e8eb6cda4 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -1653,7 +1653,7 @@ static int radeonfb_set_par(struct fb_info *info) int depth = var_to_depth(mode); int use_rmx = 0; - newmode = kmalloc(sizeof(struct radeon_regs), GFP_KERNEL); + newmode = kmalloc_obj(struct radeon_regs, GFP_KERNEL); if (!newmode) return -ENOMEM; diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c index 2bdd67595891..82836c327f05 100644 --- a/drivers/video/fbdev/carminefb.c +++ b/drivers/video/fbdev/carminefb.c @@ -620,7 +620,7 @@ static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent) return ret; ret = -ENOMEM; - hw = kzalloc(sizeof *hw, GFP_KERNEL); + hw = kzalloc_obj(*hw, GFP_KERNEL); if (!hw) goto err_enable_pci; diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 5c5284e8ae0e..b589f46178a2 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -944,7 +944,7 @@ static int __init control_of_init(struct device_node *dp) printk(KERN_ERR "can't get 2 addresses for control\n"); return -ENXIO; } - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; control_fb = p; /* save it for cleanups */ diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index 8df2e51e3390..2b2604255b90 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -307,7 +307,7 @@ int fb_deferred_io_init(struct fb_info *info) npagerefs = DIV_ROUND_UP(info->fix.smem_len, PAGE_SIZE); /* alloc a page ref for each page of the display memory */ - pagerefs = kvcalloc(npagerefs, sizeof(*pagerefs), GFP_KERNEL); + pagerefs = kvzalloc_objs(*pagerefs, npagerefs, GFP_KERNEL); if (!pagerefs) { ret = -ENOMEM; goto err; diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 98387c42e4e5..29ed5b152ac6 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -769,7 +769,7 @@ static int fbcon_open(struct fb_info *info) } unlock_fb_info(info); - par = kzalloc(sizeof(*par), GFP_KERNEL); + par = kzalloc_obj(*par, GFP_KERNEL); if (!par) { fbcon_release(info); return -ENOMEM; diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c index 07df7e98f8a3..67ccb5607ded 100644 --- a/drivers/video/fbdev/core/fbmon.c +++ b/drivers/video/fbdev/core/fbmon.c @@ -388,7 +388,7 @@ static void calc_mode_timings(int xres, int yres, int refresh, { struct fb_var_screeninfo *var; - var = kzalloc(sizeof(struct fb_var_screeninfo), GFP_KERNEL); + var = kzalloc_obj(struct fb_var_screeninfo, GFP_KERNEL); if (var) { var->xres = xres; @@ -626,7 +626,7 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, int num = 0, i, first = 1; int ver, rev; - mode = kcalloc(50, sizeof(struct fb_videomode), GFP_KERNEL); + mode = kzalloc_objs(struct fb_videomode, 50, GFP_KERNEL); if (mode == NULL) return NULL; @@ -677,7 +677,7 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, } *dbsize = num; - m = kmalloc_array(num, sizeof(struct fb_videomode), GFP_KERNEL); + m = kmalloc_objs(struct fb_videomode, num, GFP_KERNEL); if (!m) return mode; memmove(m, mode, num * sizeof(struct fb_videomode)); @@ -1224,7 +1224,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf u32 hfmin, hfmax, vfmin, vfmax, dclkmin, dclkmax, err = 0; - timings = kzalloc(sizeof(struct __fb_timings), GFP_KERNEL); + timings = kzalloc_obj(struct __fb_timings, GFP_KERNEL); if (!timings) return -ENOMEM; diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index 53a610948c4a..fda6066eec99 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c @@ -1070,8 +1070,7 @@ int fb_add_videomode(const struct fb_videomode *mode, struct list_head *head) } } if (!found) { - modelist = kmalloc(sizeof(struct fb_modelist), - GFP_KERNEL); + modelist = kmalloc_obj(struct fb_modelist, GFP_KERNEL); if (!modelist) return -ENOMEM; diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 5cb5ee517f81..172ca6bc2c05 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1363,7 +1363,7 @@ static struct cfb_info *cyberpro_alloc_fb_info(unsigned int id, char *name) { struct cfb_info *cfb; - cfb = kzalloc(sizeof(struct cfb_info), GFP_KERNEL); + cfb = kzalloc_obj(struct cfb_info, GFP_KERNEL); if (!cfb) return NULL; diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index 7704f2ab18c0..fcba50a6f65b 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -180,7 +180,7 @@ static int goldfish_fb_probe(struct platform_device *pdev) u32 width, height; dma_addr_t fbpaddr; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (fb == NULL) { ret = -ENOMEM; goto err_fb_alloc_failed; diff --git a/drivers/video/fbdev/matrox/i2c-matroxfb.c b/drivers/video/fbdev/matrox/i2c-matroxfb.c index bb048e14b2cf..6741028d2d0c 100644 --- a/drivers/video/fbdev/matrox/i2c-matroxfb.c +++ b/drivers/video/fbdev/matrox/i2c-matroxfb.c @@ -144,7 +144,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) { unsigned long flags; struct matroxfb_dh_maven_info* m2info; - m2info = kzalloc(sizeof(*m2info), GFP_KERNEL); + m2info = kzalloc_obj(*m2info, GFP_KERNEL); if (!m2info) return NULL; diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index 5be0cdcd7c71..e7d8e13d1945 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -2073,7 +2073,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm return -1; } - minfo = kzalloc(sizeof(*minfo), GFP_KERNEL); + minfo = kzalloc_obj(*minfo, GFP_KERNEL); if (!minfo) return -ENOMEM; diff --git a/drivers/video/fbdev/matrox/matroxfb_crtc2.c b/drivers/video/fbdev/matrox/matroxfb_crtc2.c index 417fc692468d..6043ebb2bc96 100644 --- a/drivers/video/fbdev/matrox/matroxfb_crtc2.c +++ b/drivers/video/fbdev/matrox/matroxfb_crtc2.c @@ -693,7 +693,7 @@ static void* matroxfb_crtc2_probe(struct matrox_fb_info* minfo) { /* hardware is CRTC2 incapable... */ if (!minfo->devflags.crtc2) return NULL; - m2info = kzalloc(sizeof(*m2info), GFP_KERNEL); + m2info = kzalloc_obj(*m2info, GFP_KERNEL); if (!m2info) return NULL; diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index dcfae770b42d..63cc77ac74ea 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c @@ -1260,7 +1260,7 @@ static int maven_probe(struct i2c_client *client) I2C_FUNC_NOSTART | I2C_FUNC_PROTOCOL_MANGLING)) goto ERROR0; - if (!(data = kzalloc(sizeof(*data), GFP_KERNEL))) { + if (!(data = kzalloc_obj(*data, GFP_KERNEL))) { err = -ENOMEM; goto ERROR0; } diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/core.c index 03707461eced..9e7c138b1290 100644 --- a/drivers/video/fbdev/mmp/core.c +++ b/drivers/video/fbdev/mmp/core.c @@ -155,8 +155,7 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info) struct mmp_path *path = NULL; struct mmp_panel *panel; - path = kzalloc(struct_size(path, overlays, info->overlay_num), - GFP_KERNEL); + path = kzalloc_flex(*path, overlays, info->overlay_num, GFP_KERNEL); if (!path) return NULL; diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c index 2d9797c6fb3e..18cef14e6d4c 100644 --- a/drivers/video/fbdev/mmp/fb/mmpfb.c +++ b/drivers/video/fbdev/mmp/fb/mmpfb.c @@ -476,8 +476,8 @@ static int modes_setup(struct mmpfb_info *fbi) return 0; } /* put videomode list to info structure */ - videomodes = kcalloc(videomode_num, sizeof(struct fb_videomode), - GFP_KERNEL); + videomodes = kzalloc_objs(struct fb_videomode, videomode_num, + GFP_KERNEL); if (!videomodes) return -ENOMEM; diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 03e23173198c..2cd152f7a4be 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -402,7 +402,7 @@ static int path_init(struct mmphw_path_plat *path_plat, dev_info(ctrl->dev, "%s: %s\n", __func__, config->name); /* init driver data */ - path_info = kzalloc(sizeof(*path_info), GFP_KERNEL); + path_info = kzalloc_obj(*path_info, GFP_KERNEL); if (!path_info) return 0; diff --git a/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c b/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c index 34fae588e202..40194c60987d 100644 --- a/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c +++ b/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c @@ -144,7 +144,7 @@ static int tpohvga_probe(struct spi_device *spi) return ret; } - plat_data = kzalloc(sizeof(*plat_data), GFP_KERNEL); + plat_data = kzalloc_obj(*plat_data, GFP_KERNEL); if (plat_data == NULL) return -ENOMEM; diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c index 632ba2455913..7b7a2b2d1a40 100644 --- a/drivers/video/fbdev/neofb.c +++ b/drivers/video/fbdev/neofb.c @@ -1768,7 +1768,7 @@ static int neo_scan_monitor(struct fb_info *info) int w; // Eventually we will have i2c support. - info->monspecs.modedb = kmalloc(sizeof(struct fb_videomode), GFP_KERNEL); + info->monspecs.modedb = kmalloc_obj(struct fb_videomode, GFP_KERNEL); if (!info->monspecs.modedb) return -ENOMEM; info->monspecs.modedb_len = 1; diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c index 5404017e6957..f392da4761da 100644 --- a/drivers/video/fbdev/nvidia/nv_setup.c +++ b/drivers/video/fbdev/nvidia/nv_setup.c @@ -283,9 +283,9 @@ int NVCommonSetup(struct fb_info *info) int Television = 0; int err = 0; - var = kzalloc(sizeof(struct fb_var_screeninfo), GFP_KERNEL); - monitorA = kzalloc(sizeof(struct fb_monspecs), GFP_KERNEL); - monitorB = kzalloc(sizeof(struct fb_monspecs), GFP_KERNEL); + var = kzalloc_obj(struct fb_var_screeninfo, GFP_KERNEL); + monitorA = kzalloc_obj(struct fb_monspecs, GFP_KERNEL); + monitorB = kzalloc_obj(struct fb_monspecs, GFP_KERNEL); if (!var || !monitorA || !monitorB) { err = -ENOMEM; diff --git a/drivers/video/fbdev/omap/lcd_mipid.c b/drivers/video/fbdev/omap/lcd_mipid.c index a0fc4570403b..ffe0ce489adb 100644 --- a/drivers/video/fbdev/omap/lcd_mipid.c +++ b/drivers/video/fbdev/omap/lcd_mipid.c @@ -552,7 +552,7 @@ static int mipid_spi_probe(struct spi_device *spi) struct mipid_device *md; int r; - md = kzalloc(sizeof(*md), GFP_KERNEL); + md = kzalloc_obj(*md, GFP_KERNEL); if (md == NULL) { dev_err(&spi->dev, "out of memory\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index a8740213e891..8306faf01f40 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1630,7 +1630,7 @@ static int omapfb_do_probe(struct platform_device *pdev, goto cleanup; } - fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); + fbdev = kzalloc_obj(*fbdev, GFP_KERNEL); if (fbdev == NULL) { dev_err(&pdev->dev, "unable to allocate memory for device info\n"); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 370e8623754e..19498b7ccb14 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -1539,7 +1539,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, unsigned long flags; struct dsi_irq_stats *stats; - stats = kzalloc(sizeof(*stats), GFP_KERNEL); + stats = kzalloc_obj(*stats, GFP_KERNEL); if (!stats) { seq_printf(s, "out of memory\n"); return; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/manager.c b/drivers/video/fbdev/omap2/omapfb/dss/manager.c index c59e5689d6cc..0fc5d43c58ff 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/manager.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/manager.c @@ -32,8 +32,8 @@ int dss_init_overlay_managers(void) num_managers = dss_feat_get_num_mgrs(); - managers = kcalloc(num_managers, sizeof(struct omap_overlay_manager), - GFP_KERNEL); + managers = kzalloc_objs(struct omap_overlay_manager, num_managers, + GFP_KERNEL); BUG_ON(managers == NULL); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c index d80720c84323..098c02164428 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c @@ -46,7 +46,7 @@ static void __init omapdss_update_prop(struct device_node *node, char *compat, { struct property *prop; - prop = kzalloc(sizeof(*prop), GFP_KERNEL); + prop = kzalloc_obj(*prop, GFP_KERNEL); if (!prop) return; @@ -110,8 +110,7 @@ static void __init omapdss_omapify_node(struct device_node *node) static void __init omapdss_add_to_list(struct device_node *node, bool root) { - struct dss_conv_node *n = kmalloc(sizeof(struct dss_conv_node), - GFP_KERNEL); + struct dss_conv_node *n = kmalloc_obj(struct dss_conv_node, GFP_KERNEL); if (n) { n->node = node; n->root = root; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c index bbbdc233ee61..cb2a230c57a1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c @@ -49,8 +49,7 @@ void dss_init_overlays(struct platform_device *pdev) num_overlays = dss_feat_get_num_ovls(); - overlays = kcalloc(num_overlays, sizeof(struct omap_overlay), - GFP_KERNEL); + overlays = kzalloc_objs(struct omap_overlay, num_overlays, GFP_KERNEL); BUG_ON(overlays == NULL); diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index 211f23648686..599a7d6a6114 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -2023,19 +2023,19 @@ static int omapfb_mode_to_timings(const char *mode_str, var = NULL; fbops = NULL; - fbi = kzalloc(sizeof(*fbi), GFP_KERNEL); + fbi = kzalloc_obj(*fbi, GFP_KERNEL); if (fbi == NULL) { r = -ENOMEM; goto err; } - var = kzalloc(sizeof(*var), GFP_KERNEL); + var = kzalloc_obj(*var, GFP_KERNEL); if (var == NULL) { r = -ENOMEM; goto err; } - fbops = kzalloc(sizeof(*fbops), GFP_KERNEL); + fbops = kzalloc_obj(*fbops, GFP_KERNEL); if (fbops == NULL) { r = -ENOMEM; goto err; @@ -2244,7 +2244,7 @@ static int omapfb_find_best_mode(struct omap_dss_device *display, if (r < 0) goto err1; - specs = kzalloc(sizeof(*specs), GFP_KERNEL); + specs = kzalloc_obj(*specs, GFP_KERNEL); if (specs == NULL) { r = -ENOMEM; goto err1; diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 0b8d23c12b77..d47c173fd8e0 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -652,7 +652,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, nr_pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT; - pages = kmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 4a78b387b343..c2aec9419ae9 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -530,7 +530,7 @@ pxa3xx_gcu_add_buffer(struct device *dev, { struct pxa3xx_gcu_batch *buffer; - buffer = kzalloc(sizeof(struct pxa3xx_gcu_batch), GFP_KERNEL); + buffer = kzalloc_obj(struct pxa3xx_gcu_batch, GFP_KERNEL); if (!buffer) return -ENOMEM; diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index 5f3a0cd27db3..c52391f9893b 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2512,7 +2512,7 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev) return -ENOENT; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 92595af022eb..67f3f2df2064 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -249,7 +249,7 @@ static int simplefb_clocks_get(struct simplefb_par *par, if (!par->clk_count) return 0; - par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL); + par->clks = kzalloc_objs(struct clk *, par->clk_count, GFP_KERNEL); if (!par->clks) return -ENOMEM; diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index ed6f4f43e2d5..abc9bcfe579b 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1947,7 +1947,7 @@ static int sm501fb_probe(struct platform_device *pdev) int ret; /* allocate our framebuffers */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { dev_err(dev, "failed to allocate state\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 891ce7b76d63..ddc45d9a2ca2 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -946,7 +946,8 @@ static int ufx_ops_ioctl(struct fb_info *info, unsigned int cmd, /* TODO: Help propose a standard fb.h ioctl to report mmap damage */ if (cmd == UFX_IOCTL_REPORT_DAMAGE) { - struct dloarea *area __free(kfree) = kmalloc(sizeof(*area), GFP_KERNEL); + struct dloarea *area __free(kfree) = kmalloc_obj(*area, + GFP_KERNEL); if (!area) return -ENOMEM; @@ -1037,7 +1038,7 @@ static int ufx_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kzalloc(sizeof(*fbdefio), GFP_KERNEL); + fbdefio = kzalloc_obj(*fbdefio, GFP_KERNEL); if (fbdefio) { fbdefio->delay = UFX_DEFIO_WRITE_DELAY; fbdefio->deferred_io = ufx_dpy_deferred_io; @@ -1594,7 +1595,7 @@ static int ufx_usb_probe(struct usb_interface *interface, usbdev = interface_to_usbdev(interface); BUG_ON(!usbdev); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) { dev_err(&usbdev->dev, "ufx_usb_probe: failed alloc of dev struct\n"); return -ENOMEM; @@ -1851,7 +1852,7 @@ static int ufx_alloc_urb_list(struct ufx_data *dev, int count, size_t size) INIT_LIST_HEAD(&dev->urbs.list); while (i < count) { - unode = kzalloc(sizeof(*unode), GFP_KERNEL); + unode = kzalloc_obj(*unode, GFP_KERNEL); if (!unode) break; unode->dev = dev; diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index ccede85df1e1..ba060af2b09f 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -918,7 +918,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); + fbdefio = kzalloc_obj(struct fb_deferred_io, GFP_KERNEL); if (fbdefio) { fbdefio->delay = DL_DEFIO_WRITE_DELAY; @@ -1164,7 +1164,8 @@ static const struct fb_ops dlfb_ops = { static void dlfb_deferred_vfree(struct dlfb_data *dlfb, void *mem) { - struct dlfb_deferred_free *d = kmalloc(sizeof(struct dlfb_deferred_free), GFP_KERNEL); + struct dlfb_deferred_free *d = kmalloc_obj(struct dlfb_deferred_free, + GFP_KERNEL); if (!d) return; d->mem = mem; @@ -1606,7 +1607,7 @@ static int dlfb_usb_probe(struct usb_interface *intf, static u8 out_ep[] = {OUT_EP_NUM + USB_DIR_OUT, 0}; /* usb initialization */ - dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); + dlfb = kzalloc_obj(*dlfb, GFP_KERNEL); if (!dlfb) { dev_err(&intf->dev, "%s: failed to allocate dlfb\n", __func__); return -ENOMEM; @@ -1852,7 +1853,7 @@ retry: dlfb->urbs.available = 0; while (dlfb->urbs.count * size < wanted_size) { - unode = kzalloc(sizeof(*unode), GFP_KERNEL); + unode = kzalloc_obj(*unode, GFP_KERNEL); if (!unode) break; unode->dlfb = dlfb; diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index 5d52fd00806e..c9e299afc02b 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -258,9 +258,9 @@ static struct uvesafb_ktask *uvesafb_prep(void) { struct uvesafb_ktask *task; - task = kzalloc(sizeof(*task), GFP_KERNEL); + task = kzalloc_obj(*task, GFP_KERNEL); if (task) { - task->done = kzalloc(sizeof(*task->done), GFP_KERNEL); + task->done = kzalloc_obj(*task->done, GFP_KERNEL); if (!task->done) { kfree(task); task = NULL; @@ -487,9 +487,8 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task, mode++; } - par->vbe_modes = kcalloc(par->vbe_modes_cnt, - sizeof(struct vbe_mode_ib), - GFP_KERNEL); + par->vbe_modes = kzalloc_objs(struct vbe_mode_ib, par->vbe_modes_cnt, + GFP_KERNEL); if (!par->vbe_modes) return -ENOMEM; @@ -862,7 +861,7 @@ static int uvesafb_vbe_init_mode(struct fb_info *info) * Convert the modelist into a modedb so that we can use it with * fb_find_mode(). */ - mode = kcalloc(i, sizeof(*mode), GFP_KERNEL); + mode = kzalloc_objs(*mode, i, GFP_KERNEL); if (mode) { i = 0; list_for_each(pos, &info->modelist) { @@ -1048,8 +1047,7 @@ static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info) info->cmap.len || cmap->start < info->cmap.start) return -EINVAL; - entries = kmalloc_array(cmap->len, sizeof(*entries), - GFP_KERNEL); + entries = kmalloc_objs(*entries, cmap->len, GFP_KERNEL); if (!entries) return -ENOMEM; @@ -1243,7 +1241,7 @@ setmode: info->var.pixclock != 0) { task->t.regs.ebx |= 0x0800; /* use CRTC data */ task->t.flags = TF_BUF_ESDI; - crtc = kzalloc(sizeof(struct vbe_crtc_ib), GFP_KERNEL); + crtc = kzalloc_obj(struct vbe_crtc_ib, GFP_KERNEL); if (!crtc) { err = -ENOMEM; goto out; diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index 6ff059ee1694..ec3cf4589056 100644 --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c @@ -339,7 +339,7 @@ static int __init valkyriefb_init(void) } #endif /* ppc (!CONFIG_MAC) */ - p = kzalloc(sizeof(*p), GFP_ATOMIC); + p = kzalloc_obj(*p, GFP_ATOMIC); if (!p) return -ENOMEM; diff --git a/drivers/video/fbdev/via/via_aux.c b/drivers/video/fbdev/via/via_aux.c index 902191dddbeb..11f28a16e9b1 100644 --- a/drivers/video/fbdev/via/via_aux.c +++ b/drivers/video/fbdev/via/via_aux.c @@ -17,7 +17,7 @@ struct via_aux_bus *via_aux_probe(struct i2c_adapter *adap) if (!adap) return NULL; - bus = kmalloc(sizeof(*bus), GFP_KERNEL); + bus = kmalloc_obj(*bus, GFP_KERNEL); if (!bus) return NULL; diff --git a/drivers/video/fbdev/via/via_aux.h b/drivers/video/fbdev/via/via_aux.h index 464723fd514c..cb28fb21b1c7 100644 --- a/drivers/video/fbdev/via/via_aux.h +++ b/drivers/video/fbdev/via/via_aux.h @@ -42,7 +42,7 @@ const struct fb_videomode *via_aux_get_preferred_mode(struct via_aux_bus *bus); static inline bool via_aux_add(struct via_aux_drv *drv) { - struct via_aux_drv *data = kmalloc(sizeof(*data), GFP_KERNEL); + struct via_aux_drv *data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return false; diff --git a/drivers/video/fbdev/via/via_aux_edid.c b/drivers/video/fbdev/via/via_aux_edid.c index 9791381a9865..75c40aede6f2 100644 --- a/drivers/video/fbdev/via/via_aux_edid.c +++ b/drivers/video/fbdev/via/via_aux_edid.c @@ -24,7 +24,7 @@ static void query_edid(struct via_aux_drv *drv) if (spec) { fb_destroy_modedb(spec->modedb); } else { - spec = kmalloc(sizeof(*spec), GFP_KERNEL); + spec = kmalloc_obj(*spec, GFP_KERNEL); if (!spec) return; } diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 6da5ae7d229a..80f95dac32c8 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -840,7 +840,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) struct { u8 data[CURSOR_SIZE]; u32 bak[CURSOR_SIZE / 4]; - } *cr_data = kzalloc(sizeof(*cr_data), GFP_ATOMIC); + } *cr_data = kzalloc_obj(*cr_data, GFP_ATOMIC); int size = ((cursor->image.width + 7) >> 3) * cursor->image.height; diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c index d8f3bfb2dd6c..a432b487bb76 100644 --- a/drivers/video/fbdev/xen-fbfront.c +++ b/drivers/video/fbdev/xen-fbfront.c @@ -348,7 +348,7 @@ static int xenfb_probe(struct xenbus_device *dev, int val; int ret = 0; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index a6ec392253c3..54b6595e8758 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -157,7 +157,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np) return NULL; } - disp = kzalloc(sizeof(*disp), GFP_KERNEL); + disp = kzalloc_obj(*disp, GFP_KERNEL); if (!disp) { pr_err("%pOF: could not allocate struct disp'\n", np); goto dispfail; @@ -184,9 +184,8 @@ struct display_timings *of_get_display_timings(const struct device_node *np) goto timingfail; } - disp->timings = kcalloc(disp->num_timings, - sizeof(struct display_timing *), - GFP_KERNEL); + disp->timings = kzalloc_objs(struct display_timing *, disp->num_timings, + GFP_KERNEL); if (!disp->timings) { pr_err("%pOF: could not allocate timings array\n", np); goto timingfail; @@ -199,7 +198,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np) struct display_timing *dt; int r; - dt = kmalloc(sizeof(*dt), GFP_KERNEL); + dt = kmalloc_obj(*dt, GFP_KERNEL); if (!dt) { pr_err("%pOF: could not allocate display_timing struct\n", np); diff --git a/drivers/video/sticore.c b/drivers/video/sticore.c index 88a1758616e0..8920c1fa2546 100644 --- a/drivers/video/sticore.c +++ b/drivers/video/sticore.c @@ -558,7 +558,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) dest += sizeof(struct sti_rom_font); memcpy(dest, fbfont->data, bpc * fbfont->charcount); - cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); if (!cooked_font) { kfree(nf); return NULL; @@ -678,7 +678,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom, struct sti_rom_font *raw_font, *font_start; struct sti_cooked_font *cooked_font; - cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); if (!cooked_font) return 0; @@ -692,7 +692,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom, while (raw_font->next_font) { raw_font = ((void *)font_start) + (raw_font->next_font); - cooked_font->next_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); + cooked_font->next_font = kzalloc_obj(*cooked_font, GFP_KERNEL); if (!cooked_font->next_font) return 1; @@ -806,7 +806,7 @@ static int sti_read_rom(int wordmode, struct sti_struct *sti, struct sti_rom *raw = NULL; unsigned long revno; - cooked = kmalloc(sizeof *cooked, GFP_KERNEL); + cooked = kmalloc_obj(*cooked, GFP_KERNEL); if (!cooked) goto out_err; @@ -915,7 +915,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, return NULL; } - sti = kzalloc(sizeof(*sti), GFP_KERNEL); + sti = kzalloc_obj(*sti, GFP_KERNEL); if (!sti) return NULL; diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c index 122fb3c3ec9d..0727716cf5fd 100644 --- a/drivers/video/vgastate.c +++ b/drivers/video/vgastate.c @@ -351,7 +351,7 @@ int save_vga(struct vgastate *state) { struct regstate *saved; - saved = kzalloc(sizeof(struct regstate), GFP_KERNEL); + saved = kzalloc_obj(struct regstate, GFP_KERNEL); if (saved == NULL) return 1; diff --git a/drivers/virt/acrn/hsm.c b/drivers/virt/acrn/hsm.c index e4e196abdaac..c73a566d135d 100644 --- a/drivers/virt/acrn/hsm.c +++ b/drivers/virt/acrn/hsm.c @@ -30,7 +30,7 @@ static int acrn_dev_open(struct inode *inode, struct file *filp) { struct acrn_vm *vm; - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return -ENOMEM; @@ -64,7 +64,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr) kfree(pm_info); break; case ACRN_PMCMD_GET_PX_DATA: - px_data = kzalloc(sizeof(*px_data), GFP_KERNEL); + px_data = kzalloc_obj(*px_data, GFP_KERNEL); if (!px_data) return -ENOMEM; @@ -79,7 +79,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr) kfree(px_data); break; case ACRN_PMCMD_GET_CX_DATA: - cx_data = kzalloc(sizeof(*cx_data), GFP_KERNEL); + cx_data = kzalloc_obj(*cx_data, GFP_KERNEL); if (!cx_data) return -ENOMEM; diff --git a/drivers/virt/acrn/ioeventfd.c b/drivers/virt/acrn/ioeventfd.c index 4e845c6ca0b5..5daccfaa127b 100644 --- a/drivers/virt/acrn/ioeventfd.c +++ b/drivers/virt/acrn/ioeventfd.c @@ -96,7 +96,7 @@ static int acrn_ioeventfd_assign(struct acrn_vm *vm, if (IS_ERR(eventfd)) return PTR_ERR(eventfd); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { ret = -ENOMEM; goto fail; diff --git a/drivers/virt/acrn/ioreq.c b/drivers/virt/acrn/ioreq.c index 55ddfa4840af..2216e62406e0 100644 --- a/drivers/virt/acrn/ioreq.c +++ b/drivers/virt/acrn/ioreq.c @@ -123,7 +123,7 @@ int acrn_ioreq_range_add(struct acrn_ioreq_client *client, return -EINVAL; } - range = kzalloc(sizeof(*range), GFP_KERNEL); + range = kzalloc_obj(*range, GFP_KERNEL); if (!range) return -ENOMEM; @@ -424,7 +424,7 @@ struct acrn_ioreq_client *acrn_ioreq_client_create(struct acrn_vm *vm, "Cannot create non-default client w/o handler!\n"); return NULL; } - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return NULL; @@ -602,7 +602,7 @@ int acrn_ioreq_init(struct acrn_vm *vm, u64 buf_vma) if (vm->ioreq_buf) return -EEXIST; - set_buffer = kzalloc(sizeof(*set_buffer), GFP_KERNEL); + set_buffer = kzalloc_obj(*set_buffer, GFP_KERNEL); if (!set_buffer) return -ENOMEM; diff --git a/drivers/virt/acrn/irqfd.c b/drivers/virt/acrn/irqfd.c index 64d32c8fbf79..f0ff5140699f 100644 --- a/drivers/virt/acrn/irqfd.c +++ b/drivers/virt/acrn/irqfd.c @@ -112,7 +112,7 @@ static int acrn_irqfd_assign(struct acrn_vm *vm, struct acrn_irqfd *args) __poll_t events; int ret = 0; - irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL); + irqfd = kzalloc_obj(*irqfd, GFP_KERNEL); if (!irqfd) return -ENOMEM; diff --git a/drivers/virt/acrn/mm.c b/drivers/virt/acrn/mm.c index bfb3031885e8..86b386761ee3 100644 --- a/drivers/virt/acrn/mm.c +++ b/drivers/virt/acrn/mm.c @@ -21,7 +21,7 @@ static int modify_region(struct acrn_vm *vm, struct vm_memory_region_op *region) struct vm_memory_region_batch *regions; int ret; - regions = kzalloc(sizeof(*regions), GFP_KERNEL); + regions = kzalloc_obj(*regions, GFP_KERNEL); if (!regions) return -ENOMEM; @@ -55,7 +55,7 @@ int acrn_mm_region_add(struct acrn_vm *vm, u64 user_gpa, u64 service_gpa, struct vm_memory_region_op *region; int ret = 0; - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) return -ENOMEM; @@ -87,7 +87,7 @@ int acrn_mm_region_del(struct acrn_vm *vm, u64 user_gpa, u64 size) struct vm_memory_region_op *region; int ret = 0; - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) return -ENOMEM; @@ -285,8 +285,8 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap) } /* Prepare the vm_memory_region_batch */ - regions_info = kzalloc(struct_size(regions_info, regions_op, - nr_regions), GFP_KERNEL); + regions_info = kzalloc_flex(*regions_info, regions_op, nr_regions, + GFP_KERNEL); if (!regions_info) { ret = -ENOMEM; goto unmap_kernel_map; diff --git a/drivers/virt/acrn/vm.c b/drivers/virt/acrn/vm.c index fbc9f1042000..3753b27c5312 100644 --- a/drivers/virt/acrn/vm.c +++ b/drivers/virt/acrn/vm.c @@ -107,7 +107,7 @@ int acrn_msi_inject(struct acrn_vm *vm, u64 msi_addr, u64 msi_data) int ret; /* might be used in interrupt context, so use GFP_ATOMIC */ - msi = kzalloc(sizeof(*msi), GFP_ATOMIC); + msi = kzalloc_obj(*msi, GFP_ATOMIC); if (!msi) return -ENOMEM; diff --git a/drivers/virt/coco/guest/report.c b/drivers/virt/coco/guest/report.c index d3d18fc22bc2..ab50adfec7ec 100644 --- a/drivers/virt/coco/guest/report.c +++ b/drivers/virt/coco/guest/report.c @@ -428,7 +428,7 @@ static struct config_item *tsm_report_make_item(struct config_group *group, if (!provider.ops) return ERR_PTR(-ENXIO); - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/virt/coco/guest/tsm-mr.c b/drivers/virt/coco/guest/tsm-mr.c index bc509df04db1..37859cc8eefb 100644 --- a/drivers/virt/coco/guest/tsm-mr.c +++ b/drivers/virt/coco/guest/tsm-mr.c @@ -176,7 +176,7 @@ tsm_mr_create_attribute_group(const struct tsm_measurements *tm) const struct bin_attribute **attrs __free(kfree) = kzalloc(sizeof(*attrs) * (tm->nr_mrs + 1) + nlen, GFP_KERNEL); struct tm_context *ctx __free(kfree) = - kzalloc(struct_size(ctx, mrs, tm->nr_mrs), GFP_KERNEL); + kzalloc_flex(*ctx, mrs, tm->nr_mrs, GFP_KERNEL); char *name, *end; if (!ctx || !attrs) diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c index b01ec99106cd..e001e6769a43 100644 --- a/drivers/virt/coco/sev-guest/sev-guest.c +++ b/drivers/virt/coco/sev-guest/sev-guest.c @@ -75,7 +75,7 @@ static int get_report(struct snp_guest_dev *snp_dev, struct snp_guest_request_io if (!arg->req_data || !arg->resp_data) return -EINVAL; - report_req = kzalloc(sizeof(*report_req), GFP_KERNEL_ACCOUNT); + report_req = kzalloc_obj(*report_req, GFP_KERNEL_ACCOUNT); if (!report_req) return -ENOMEM; @@ -135,7 +135,7 @@ static int get_derived_key(struct snp_guest_dev *snp_dev, struct snp_guest_reque if (!derived_key_resp) return -ENOMEM; - derived_key_req = kzalloc(sizeof(*derived_key_req), GFP_KERNEL_ACCOUNT); + derived_key_req = kzalloc_obj(*derived_key_req, GFP_KERNEL_ACCOUNT); if (!derived_key_req) return -ENOMEM; @@ -181,7 +181,7 @@ static int get_ext_report(struct snp_guest_dev *snp_dev, struct snp_guest_reques if (sockptr_is_null(io->req_data) || sockptr_is_null(io->resp_data)) return -EINVAL; - report_req = kzalloc(sizeof(*report_req), GFP_KERNEL_ACCOUNT); + report_req = kzalloc_obj(*report_req, GFP_KERNEL_ACCOUNT); if (!report_req) return -ENOMEM; diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-core.c index 8712df8596a1..b783fd36fc7e 100644 --- a/drivers/virt/coco/tsm-core.c +++ b/drivers/virt/coco/tsm-core.c @@ -35,7 +35,7 @@ static struct tsm_dev *alloc_tsm_dev(struct device *parent) int id; struct tsm_dev *tsm_dev __free(kfree) = - kzalloc(sizeof(*tsm_dev), GFP_KERNEL); + kzalloc_obj(*tsm_dev, GFP_KERNEL); if (!tsm_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c index e92e2ceb12a4..541ee3a4909c 100644 --- a/drivers/virt/fsl_hypervisor.c +++ b/drivers/virt/fsl_hypervisor.c @@ -226,7 +226,7 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p) * 'pages' is an array of struct page pointers that's initialized by * get_user_pages_fast(). */ - pages = kcalloc(num_pages, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, num_pages, GFP_KERNEL); if (!pages) { pr_debug("fsl-hv: could not allocate page list\n"); return -ENOMEM; @@ -660,7 +660,7 @@ static int fsl_hv_open(struct inode *inode, struct file *filp) struct doorbell_queue *dbq; unsigned long flags; - dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL); + dbq = kzalloc_obj(struct doorbell_queue, GFP_KERNEL); if (!dbq) { pr_err("fsl-hv: out of memory\n"); return -ENOMEM; @@ -845,7 +845,7 @@ static int __init fsl_hypervisor_init(void) continue; } - dbisr = kzalloc(sizeof(*dbisr), GFP_KERNEL); + dbisr = kzalloc_obj(*dbisr, GFP_KERNEL); if (!dbisr) goto out_of_memory; diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index 241b94f62e56..1ad44e92348a 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -294,9 +294,9 @@ static int ne_setup_cpu_pool(const char *ne_cpu_list) ne_cpu_pool.nr_parent_vm_cores = nr_cpu_ids / ne_cpu_pool.nr_threads_per_core; - ne_cpu_pool.avail_threads_per_core = kcalloc(ne_cpu_pool.nr_parent_vm_cores, - sizeof(*ne_cpu_pool.avail_threads_per_core), - GFP_KERNEL); + ne_cpu_pool.avail_threads_per_core = kzalloc_objs(*ne_cpu_pool.avail_threads_per_core, + ne_cpu_pool.nr_parent_vm_cores, + GFP_KERNEL); if (!ne_cpu_pool.avail_threads_per_core) { rc = -ENOMEM; @@ -928,23 +928,22 @@ static int ne_set_user_memory_region_ioctl(struct ne_enclave *ne_enclave, if (rc < 0) return rc; - ne_mem_region = kzalloc(sizeof(*ne_mem_region), GFP_KERNEL); + ne_mem_region = kzalloc_obj(*ne_mem_region, GFP_KERNEL); if (!ne_mem_region) return -ENOMEM; max_nr_pages = mem_region.memory_size / NE_MIN_MEM_REGION_SIZE; - ne_mem_region->pages = kcalloc(max_nr_pages, sizeof(*ne_mem_region->pages), - GFP_KERNEL); + ne_mem_region->pages = kzalloc_objs(*ne_mem_region->pages, max_nr_pages, + GFP_KERNEL); if (!ne_mem_region->pages) { rc = -ENOMEM; goto free_mem_region; } - phys_contig_mem_regions.regions = kcalloc(max_nr_pages, - sizeof(*phys_contig_mem_regions.regions), - GFP_KERNEL); + phys_contig_mem_regions.regions = kzalloc_objs(*phys_contig_mem_regions.regions, + max_nr_pages, GFP_KERNEL); if (!phys_contig_mem_regions.regions) { rc = -ENOMEM; @@ -1617,7 +1616,7 @@ static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 __user *slot_ui mutex_unlock(&ne_cpu_pool.mutex); - ne_enclave = kzalloc(sizeof(*ne_enclave), GFP_KERNEL); + ne_enclave = kzalloc_obj(*ne_enclave, GFP_KERNEL); if (!ne_enclave) return -ENOMEM; @@ -1629,9 +1628,9 @@ static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 __user *slot_ui mutex_unlock(&ne_cpu_pool.mutex); - ne_enclave->threads_per_core = kcalloc(ne_enclave->nr_parent_vm_cores, - sizeof(*ne_enclave->threads_per_core), - GFP_KERNEL); + ne_enclave->threads_per_core = kzalloc_objs(*ne_enclave->threads_per_core, + ne_enclave->nr_parent_vm_cores, + GFP_KERNEL); if (!ne_enclave->threads_per_core) { rc = -ENOMEM; diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c index 6b81e8f3a5dc..a219657ace80 100644 --- a/drivers/virt/nitro_enclaves/ne_pci_dev.c +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c @@ -468,7 +468,7 @@ static int ne_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct ne_pci_dev *ne_pci_dev = NULL; int rc = -EINVAL; - ne_pci_dev = kzalloc(sizeof(*ne_pci_dev), GFP_KERNEL); + ne_pci_dev = kzalloc_obj(*ne_pci_dev, GFP_KERNEL); if (!ne_pci_dev) return -ENOMEM; diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c index b177a534b6a4..9621606fc5db 100644 --- a/drivers/virt/vboxguest/vboxguest_core.c +++ b/drivers/virt/vboxguest/vboxguest_core.c @@ -74,7 +74,7 @@ static void vbg_guest_mappings_init(struct vbg_dev *gdev) /* Add 4M so that we can align the vmap to 4MiB as the host requires. */ size = PAGE_ALIGN(req->hypervisor_size) + SZ_4M; - pages = kmalloc_array(size >> PAGE_SHIFT, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, size >> PAGE_SHIFT, GFP_KERNEL); if (!pages) goto out; @@ -275,9 +275,8 @@ static int vbg_balloon_inflate(struct vbg_dev *gdev, u32 chunk_idx) struct page **pages; int i, rc, ret; - pages = kmalloc_array(VMMDEV_MEMORY_BALLOON_CHUNK_PAGES, - sizeof(*pages), - GFP_KERNEL | __GFP_NOWARN); + pages = kmalloc_objs(*pages, VMMDEV_MEMORY_BALLOON_CHUNK_PAGES, + GFP_KERNEL | __GFP_NOWARN); if (!pages) return -ENOMEM; @@ -1081,7 +1080,7 @@ struct vbg_session *vbg_core_open_session(struct vbg_dev *gdev, u32 requestor) { struct vbg_session *session; - session = kzalloc(sizeof(*session), GFP_KERNEL); + session = kzalloc_obj(*session, GFP_KERNEL); if (!session) return ERR_PTR(-ENOMEM); diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4e549abe59ff..4151aeebe766 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -927,7 +927,7 @@ static int virtballoon_probe(struct virtio_device *vdev) return -EINVAL; } - vdev->priv = vb = kzalloc(sizeof(*vb), GFP_KERNEL); + vdev->priv = vb = kzalloc_obj(*vb, GFP_KERNEL); if (!vb) { err = -ENOMEM; goto out; diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c index 74df16677da8..2386021e6dc5 100644 --- a/drivers/virtio/virtio_input.c +++ b/drivers/virtio/virtio_input.c @@ -83,7 +83,7 @@ static int virtinput_send_status(struct virtio_input *vi, if (vi->idev->mt && type == EV_MSC && code == MSC_TIMESTAMP) return 0; - stsbuf = kzalloc(sizeof(*stsbuf), GFP_ATOMIC); + stsbuf = kzalloc_obj(*stsbuf, GFP_ATOMIC); if (!stsbuf) return -ENOMEM; @@ -229,7 +229,7 @@ static int virtinput_probe(struct virtio_device *vdev) if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) return -ENODEV; - vi = kzalloc(sizeof(*vi), GFP_KERNEL); + vi = kzalloc_obj(*vi, GFP_KERNEL); if (!vi) return -ENOMEM; diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 1688ecd69a04..065027783822 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2940,7 +2940,7 @@ static int virtio_mem_probe(struct virtio_device *vdev) BUILD_BUG_ON(sizeof(struct virtio_mem_req) != 24); BUILD_BUG_ON(sizeof(struct virtio_mem_resp) != 10); - vdev->priv = vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vdev->priv = vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return -ENOMEM; diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index b152a1eca05a..7b063ea8b7f1 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -575,7 +575,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) unsigned long magic; int rc; - vm_dev = kzalloc(sizeof(*vm_dev), GFP_KERNEL); + vm_dev = kzalloc_obj(*vm_dev, GFP_KERNEL); if (!vm_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_admin_legacy_io.c b/drivers/virtio/virtio_pci_admin_legacy_io.c index 819cfbbc67c3..24733b098703 100644 --- a/drivers/virtio/virtio_pci_admin_legacy_io.c +++ b/drivers/virtio/virtio_pci_admin_legacy_io.c @@ -124,7 +124,7 @@ static int virtio_pci_admin_legacy_io_read(struct pci_dev *pdev, u16 opcode, if (vf_id < 0) return vf_id; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -210,7 +210,7 @@ int virtio_pci_admin_legacy_io_notify_info(struct pci_dev *pdev, if (vf_id < 0) return vf_id; - result = kzalloc(sizeof(*result), GFP_KERNEL); + result = kzalloc_obj(*result, GFP_KERNEL); if (!result) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index d6d79af44569..2749bd6500fb 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -134,14 +134,13 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, vp_dev->msix_vectors = nvectors; - vp_dev->msix_names = kmalloc_array(nvectors, - sizeof(*vp_dev->msix_names), - GFP_KERNEL); + vp_dev->msix_names = kmalloc_objs(*vp_dev->msix_names, nvectors, + GFP_KERNEL); if (!vp_dev->msix_names) goto error; vp_dev->msix_affinity_masks - = kcalloc(nvectors, sizeof(*vp_dev->msix_affinity_masks), - GFP_KERNEL); + = kzalloc_objs(*vp_dev->msix_affinity_masks, nvectors, + GFP_KERNEL); if (!vp_dev->msix_affinity_masks) goto error; for (i = 0; i < nvectors; ++i) @@ -211,7 +210,7 @@ static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned int in struct virtio_pci_vq_info **p_info) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc(sizeof *info, GFP_KERNEL); + struct virtio_pci_vq_info *info = kmalloc_obj(*info, GFP_KERNEL); struct virtqueue *vq; unsigned long flags; @@ -387,7 +386,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs, bool per_vq_vectors; u16 avq_num = 0; - vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); if (!vp_dev->vqs) return -ENOMEM; @@ -464,7 +463,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vq; u16 avq_num = 0; - vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); if (!vp_dev->vqs) return -ENOMEM; @@ -686,7 +685,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, int rc; /* allocate our structure and fill it out */ - vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL); + vp_dev = kzalloc_obj(struct virtio_pci_device, GFP_KERNEL); if (!vp_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index dd0e65f71d41..041a7fd72835 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -137,11 +137,11 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev, if (!virtio_has_feature(vdev, VIRTIO_F_ADMIN_VQ)) return -EOPNOTSUPP; - va_status = kzalloc(sizeof(*va_status), GFP_KERNEL); + va_status = kzalloc_obj(*va_status, GFP_KERNEL); if (!va_status) return -ENOMEM; - va_hdr = kzalloc(sizeof(*va_hdr), GFP_KERNEL); + va_hdr = kzalloc_obj(*va_hdr, GFP_KERNEL); if (!va_hdr) { ret = -ENOMEM; goto err_alloc; @@ -204,7 +204,7 @@ static void virtio_pci_admin_cmd_list_init(struct virtio_device *virtio_dev) __le64 *data; int ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return; @@ -246,11 +246,11 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev) u16 set_data_size; int ret; - get_data = kzalloc(sizeof(*get_data), GFP_KERNEL); + get_data = kzalloc_obj(*get_data, GFP_KERNEL); if (!get_data) return; - result = kzalloc(sizeof(*result), GFP_KERNEL); + result = kzalloc_obj(*result, GFP_KERNEL); if (!result) goto end; @@ -310,7 +310,7 @@ static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev) struct scatterlist result_sg; int ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return; @@ -929,7 +929,7 @@ int virtio_pci_admin_mode_set(struct pci_dev *pdev, u8 flags) if (vf_id < 0) return vf_id; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1054,7 +1054,7 @@ int virtio_pci_admin_obj_destroy(struct pci_dev *pdev, u16 obj_type, u32 id) if (obj_type != VIRTIO_RESOURCE_OBJ_DEV_PARTS) return -EINVAL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1109,11 +1109,11 @@ int virtio_pci_admin_dev_parts_metadata_get(struct pci_dev *pdev, u16 obj_type, if (vf_id < 0) return vf_id; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; - result = kzalloc(sizeof(*result), GFP_KERNEL); + result = kzalloc_obj(*result, GFP_KERNEL); if (!result) { ret = -ENOMEM; goto end; @@ -1173,7 +1173,7 @@ int virtio_pci_admin_dev_parts_get(struct pci_dev *pdev, u16 obj_type, u32 id, if (vf_id < 0) return vf_id; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 4fe0f78df5ec..2cab954906cd 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1209,7 +1209,7 @@ static int vring_alloc_state_extra_split(struct vring_virtqueue_split *vring_spl struct vring_desc_extra *extra; u32 num = vring_split->vring.num; - state = kmalloc_array(num, sizeof(struct vring_desc_state_split), GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_split, num, GFP_KERNEL); if (!state) goto err_state; @@ -1308,7 +1308,7 @@ static struct virtqueue *__vring_new_virtqueue_split(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc(sizeof(*vq), GFP_KERNEL); + vq = kmalloc_obj(*vq, GFP_KERNEL); if (!vq) return NULL; @@ -2349,8 +2349,7 @@ static struct vring_desc_extra *vring_alloc_desc_extra(unsigned int num) struct vring_desc_extra *desc_extra; unsigned int i; - desc_extra = kmalloc_array(num, sizeof(struct vring_desc_extra), - GFP_KERNEL); + desc_extra = kmalloc_objs(struct vring_desc_extra, num, GFP_KERNEL); if (!desc_extra) return NULL; @@ -2450,7 +2449,7 @@ static int vring_alloc_state_extra_packed(struct vring_virtqueue_packed *vring_p struct vring_desc_extra *extra; u32 num = vring_packed->vring.num; - state = kmalloc_array(num, sizeof(struct vring_desc_state_packed), GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_packed, num, GFP_KERNEL); if (!state) goto err_desc_state; @@ -2529,7 +2528,7 @@ static struct virtqueue *__vring_new_virtqueue_packed(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc(sizeof(*vq), GFP_KERNEL); + vq = kmalloc_obj(*vq, GFP_KERNEL); if (!vq) return NULL; diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 0a801f67b599..6c0d2f946817 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -287,7 +287,7 @@ create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) if (!affvecs) return NULL; - masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL); + masks = kzalloc_objs(*masks, nvecs, GFP_KERNEL); if (!masks) return NULL; @@ -462,7 +462,7 @@ static int virtio_vdpa_probe(struct vdpa_device *vdpa) struct virtio_vdpa_device *vd_dev, *reg_dev = NULL; int ret = -EINVAL; - vd_dev = kzalloc(sizeof(*vd_dev), GFP_KERNEL); + vd_dev = kzalloc_obj(*vd_dev, GFP_KERNEL); if (!vd_dev) return -ENOMEM; diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c index e1cac0730cbb..68501b0a2c4d 100644 --- a/drivers/w1/masters/ds2490.c +++ b/drivers/w1/masters/ds2490.c @@ -1018,7 +1018,7 @@ static int ds_probe(struct usb_interface *intf, struct ds_device *dev; int i, err, alt; - dev = kzalloc(sizeof(struct ds_device), GFP_KERNEL); + dev = kzalloc_obj(struct ds_device, GFP_KERNEL); if (!dev) return -ENOMEM; diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c index 3371d804dc6c..54d78060d6ff 100644 --- a/drivers/w1/slaves/w1_ds2433.c +++ b/drivers/w1/slaves/w1_ds2433.c @@ -320,7 +320,7 @@ static int w1_f23_add_slave(struct w1_slave *sl) { struct w1_f23_data *data; - data = kzalloc(sizeof(struct w1_f23_data), GFP_KERNEL); + data = kzalloc_obj(struct w1_f23_data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c index c577b5973032..cb198414d47b 100644 --- a/drivers/w1/slaves/w1_ds28e04.c +++ b/drivers/w1/slaves/w1_ds28e04.c @@ -384,7 +384,7 @@ static int w1_f1C_add_slave(struct w1_slave *sl) struct w1_f1C_data *data = NULL; if (w1_enable_crccheck) { - data = kzalloc(sizeof(struct w1_f1C_data), GFP_KERNEL); + data = kzalloc_obj(struct w1_f1C_data, GFP_KERNEL); if (!data) return -ENOMEM; sl->family_data = data; diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index 832e3da94b20..f72e9b57fe79 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c @@ -973,8 +973,7 @@ static int w1_therm_add_slave(struct w1_slave *sl) struct w1_therm_family_converter *sl_family_conv; /* Allocate memory */ - sl->family_data = kzalloc(sizeof(struct w1_therm_family_data), - GFP_KERNEL); + sl->family_data = kzalloc_obj(struct w1_therm_family_data, GFP_KERNEL); if (!sl->family_data) return -ENOMEM; diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 5f78b0a0b766..a08d5b420f31 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -715,7 +715,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn) int err; struct w1_netlink_msg msg; - sl = kzalloc(sizeof(struct w1_slave), GFP_KERNEL); + sl = kzalloc_obj(struct w1_slave, GFP_KERNEL); if (!sl) { dev_err(&dev->dev, "%s: failed to allocate new slave device.\n", diff --git a/drivers/watchdog/exar_wdt.c b/drivers/watchdog/exar_wdt.c index c2e3bb08df89..30fa33a4c08d 100644 --- a/drivers/watchdog/exar_wdt.c +++ b/drivers/watchdog/exar_wdt.c @@ -342,7 +342,7 @@ static int __init exar_wdt_register(struct wdt_priv *priv, const int idx) { struct wdt_pdev_node *n; - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) return -ENOMEM; diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c index c7a7235e6224..01c44881608c 100644 --- a/drivers/watchdog/mei_wdt.c +++ b/drivers/watchdog/mei_wdt.c @@ -563,7 +563,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev, struct mei_wdt *wdt; int ret; - wdt = kzalloc(sizeof(struct mei_wdt), GFP_KERNEL); + wdt = kzalloc_obj(struct mei_wdt, GFP_KERNEL); if (!wdt) return -ENOMEM; diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index b636650b714b..dbefe9a690d7 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c @@ -641,7 +641,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); /* allocate memory for our device and initialize it */ - usb_pcwd = kzalloc(sizeof(struct usb_pcwd_private), GFP_KERNEL); + usb_pcwd = kzalloc_obj(struct usb_pcwd_private, GFP_KERNEL); if (usb_pcwd == NULL) goto error; diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 9a5e544b886b..cd4c7342a172 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -1019,7 +1019,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd) struct watchdog_core_data *wd_data; int err; - wd_data = kzalloc(sizeof(struct watchdog_core_data), GFP_KERNEL); + wd_data = kzalloc_obj(struct watchdog_core_data, GFP_KERNEL); if (!wd_data) return -ENOMEM; mutex_init(&wd_data->lock); diff --git a/drivers/watchdog/watchdog_pretimeout.c b/drivers/watchdog/watchdog_pretimeout.c index 2526436dc74d..3957b6ba63b7 100644 --- a/drivers/watchdog/watchdog_pretimeout.c +++ b/drivers/watchdog/watchdog_pretimeout.c @@ -119,7 +119,7 @@ int watchdog_register_governor(struct watchdog_governor *gov) struct watchdog_pretimeout *p; struct governor_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -183,7 +183,7 @@ int watchdog_register_pretimeout(struct watchdog_device *wdd) if (!watchdog_have_pretimeout(wdd)) return 0; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c index 87493f92291f..009c76546d85 100644 --- a/drivers/xen/arm-device.c +++ b/drivers/xen/arm-device.c @@ -59,9 +59,9 @@ static int xen_map_device_mmio(const struct resource *resources, if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) continue; - gpfns = kcalloc(nr, sizeof(xen_pfn_t), GFP_KERNEL); - idxs = kcalloc(nr, sizeof(xen_ulong_t), GFP_KERNEL); - errs = kcalloc(nr, sizeof(int), GFP_KERNEL); + gpfns = kzalloc_objs(xen_pfn_t, nr, GFP_KERNEL); + idxs = kzalloc_objs(xen_ulong_t, nr, GFP_KERNEL); + errs = kzalloc_objs(int, nr, GFP_KERNEL); if (!gpfns || !idxs || !errs) { kfree(gpfns); kfree(idxs); diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 9b6531eb28b6..6cbff7e90947 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -242,7 +242,7 @@ static struct resource *additional_memory_resource(phys_addr_t size) struct resource *res; int ret; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return NULL; diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 663df17776fd..515bb5708e7f 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -714,7 +714,7 @@ static struct irq_info *xen_irq_init(unsigned int irq) { struct irq_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (info) { info->irq = irq; info->type = IRQT_UNBOUND; @@ -2292,8 +2292,9 @@ void __init xen_init_IRQ(void) "xen/evtchn:prepare", xen_evtchn_cpu_prepare, xen_evtchn_cpu_dead); - evtchn_to_irq = kcalloc(EVTCHN_ROW(xen_evtchn_max_channels()), - sizeof(*evtchn_to_irq), GFP_KERNEL); + evtchn_to_irq = kzalloc_objs(*evtchn_to_irq, + EVTCHN_ROW(xen_evtchn_max_channels()), + GFP_KERNEL); BUG_ON(!evtchn_to_irq); /* No event channels are 'live' right now. */ diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index 7e4a13e632dc..568f1830f3a3 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c @@ -332,7 +332,7 @@ static int evtchn_resize_ring(struct per_user_data *u) else new_size = 2 * u->ring_size; - new_ring = kvmalloc_array(new_size, sizeof(*new_ring), GFP_KERNEL); + new_ring = kvmalloc_objs(*new_ring, new_size, GFP_KERNEL); if (!new_ring) return -ENOMEM; @@ -386,7 +386,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port, * serialized bind operations.) */ - evtchn = kzalloc(sizeof(*evtchn), GFP_KERNEL); + evtchn = kzalloc_obj(*evtchn, GFP_KERNEL); if (!evtchn) return -ENOMEM; @@ -642,7 +642,7 @@ static int evtchn_open(struct inode *inode, struct file *filp) { struct per_user_data *u; - u = kzalloc(sizeof(*u), GFP_KERNEL); + u = kzalloc_obj(*u, GFP_KERNEL); if (u == NULL) return -ENOMEM; diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index f93f73ecefee..8204135c31f9 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c @@ -128,7 +128,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE); for (i = 0; i < op->count; i++) { - gref = kzalloc(sizeof(*gref), GFP_KERNEL); + gref = kzalloc_obj(*gref, GFP_KERNEL); if (!gref) { rc = -ENOMEM; goto undo; @@ -229,7 +229,7 @@ static int gntalloc_open(struct inode *inode, struct file *filp) { struct gntalloc_file_private_data *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) goto out_nomem; INIT_LIST_HEAD(&priv->list); @@ -501,7 +501,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma) return -EINVAL; } - vm_priv = kmalloc(sizeof(*vm_priv), GFP_KERNEL); + vm_priv = kmalloc_obj(*vm_priv, GFP_KERNEL); if (!vm_priv) return -ENOMEM; diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 550980dd3b0b..649d3a912d20 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -95,7 +95,7 @@ dmabuf_exp_wait_obj_new(struct gntdev_dmabuf_priv *priv, { struct gntdev_dmabuf_wait_obj *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return ERR_PTR(-ENOMEM); @@ -198,7 +198,7 @@ dmabuf_pages_to_sgt(struct page **pages, unsigned int nr_pages) struct sg_table *sgt; int ret; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) { ret = -ENOMEM; goto out; @@ -222,8 +222,7 @@ static int dmabuf_exp_ops_attach(struct dma_buf *dma_buf, { struct gntdev_dmabuf_attachment *gntdev_dmabuf_attach; - gntdev_dmabuf_attach = kzalloc(sizeof(*gntdev_dmabuf_attach), - GFP_KERNEL); + gntdev_dmabuf_attach = kzalloc_obj(*gntdev_dmabuf_attach, GFP_KERNEL); if (!gntdev_dmabuf_attach) return -ENOMEM; @@ -363,7 +362,7 @@ static int dmabuf_exp_from_pages(struct gntdev_dmabuf_export_args *args) if (ret < 0) return ret; - gntdev_dmabuf = kzalloc(sizeof(*gntdev_dmabuf), GFP_KERNEL); + gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL); if (!gntdev_dmabuf) return -ENOMEM; @@ -531,13 +530,12 @@ static struct gntdev_dmabuf *dmabuf_imp_alloc_storage(int count) struct gntdev_dmabuf *gntdev_dmabuf; int i; - gntdev_dmabuf = kzalloc(sizeof(*gntdev_dmabuf), GFP_KERNEL); + gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL); if (!gntdev_dmabuf) goto fail_no_free; - gntdev_dmabuf->u.imp.refs = kcalloc(count, - sizeof(gntdev_dmabuf->u.imp.refs[0]), - GFP_KERNEL); + gntdev_dmabuf->u.imp.refs = kzalloc_objs(gntdev_dmabuf->u.imp.refs[0], + count, GFP_KERNEL); if (!gntdev_dmabuf->u.imp.refs) goto fail; @@ -818,7 +816,7 @@ struct gntdev_dmabuf_priv *gntdev_dmabuf_init(struct file *filp) { struct gntdev_dmabuf_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 2c960f187f7c..1a986cb7324a 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -141,19 +141,16 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count, struct gntdev_grant_map *add; int i; - add = kzalloc(sizeof(*add), GFP_KERNEL); + add = kzalloc_obj(*add, GFP_KERNEL); if (NULL == add) return NULL; - add->grants = kvmalloc_array(count, sizeof(add->grants[0]), - GFP_KERNEL); - add->map_ops = kvmalloc_array(count, sizeof(add->map_ops[0]), - GFP_KERNEL); - add->unmap_ops = kvmalloc_array(count, sizeof(add->unmap_ops[0]), - GFP_KERNEL); - add->pages = kvcalloc(count, sizeof(add->pages[0]), GFP_KERNEL); + add->grants = kvmalloc_objs(add->grants[0], count, GFP_KERNEL); + add->map_ops = kvmalloc_objs(add->map_ops[0], count, GFP_KERNEL); + add->unmap_ops = kvmalloc_objs(add->unmap_ops[0], count, GFP_KERNEL); + add->pages = kvzalloc_objs(add->pages[0], count, GFP_KERNEL); add->being_removed = - kvcalloc(count, sizeof(add->being_removed[0]), GFP_KERNEL); + kvzalloc_objs(add->being_removed[0], count, GFP_KERNEL); if (NULL == add->grants || NULL == add->map_ops || NULL == add->unmap_ops || @@ -161,10 +158,10 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count, NULL == add->being_removed) goto err; if (xen_pv_domain()) { - add->kmap_ops = kvmalloc_array(count, sizeof(add->kmap_ops[0]), - GFP_KERNEL); - add->kunmap_ops = kvmalloc_array(count, sizeof(add->kunmap_ops[0]), - GFP_KERNEL); + add->kmap_ops = kvmalloc_objs(add->kmap_ops[0], count, + GFP_KERNEL); + add->kunmap_ops = kvmalloc_objs(add->kunmap_ops[0], count, + GFP_KERNEL); if (NULL == add->kmap_ops || NULL == add->kunmap_ops) goto err; } @@ -179,8 +176,7 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count, if (dma_flags & (GNTDEV_DMA_FLAG_WC | GNTDEV_DMA_FLAG_COHERENT)) { struct gnttab_dma_alloc_args args; - add->frames = kvcalloc(count, sizeof(add->frames[0]), - GFP_KERNEL); + add->frames = kvzalloc_objs(add->frames[0], count, GFP_KERNEL); if (!add->frames) goto err; @@ -587,7 +583,7 @@ static int gntdev_open(struct inode *inode, struct file *flip) { struct gntdev_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -972,7 +968,7 @@ static long gntdev_ioctl_grant_copy(struct gntdev_priv *priv, void __user *u) mutex_lock(&priv->batch_lock); if (!priv->batch) { - batch = kmalloc(sizeof(*batch), GFP_KERNEL); + batch = kmalloc_obj(*batch, GFP_KERNEL); } else { batch = priv->batch; priv->batch = batch->next; diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 3e76e33f6e08..6fcd5a7f6605 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -556,7 +556,7 @@ static void gnttab_add_deferred(grant_ref_t ref, struct page *page) gfp_t gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; uint64_t leaked, deferred; - entry = kmalloc(sizeof(*entry), gfp); + entry = kmalloc_obj(*entry, gfp); if (!page) { unsigned long gfn = gnttab_interface->read_frame(ref); @@ -831,7 +831,7 @@ int gnttab_setup_auto_xlat_frames(phys_addr_t addr) &addr); return -ENOMEM; } - pfn = kcalloc(max_nr_gframes, sizeof(pfn[0]), GFP_KERNEL); + pfn = kzalloc_objs(pfn[0], max_nr_gframes, GFP_KERNEL); if (!pfn) { memunmap(vaddr); return -ENOMEM; @@ -868,7 +868,7 @@ int gnttab_pages_set_private(int nr_pages, struct page **pages) #if BITS_PER_LONG < 64 struct xen_page_foreign *foreign; - foreign = kzalloc(sizeof(*foreign), GFP_KERNEL); + foreign = kzalloc_obj(*foreign, GFP_KERNEL); if (!foreign) return -ENOMEM; @@ -1635,9 +1635,8 @@ int gnttab_init(void) */ max_nr_glist_frames = max_nr_grefs / RPP; - gnttab_list = kmalloc_array(max_nr_glist_frames, - sizeof(grant_ref_t *), - GFP_KERNEL); + gnttab_list = kmalloc_objs(grant_ref_t *, max_nr_glist_frames, + GFP_KERNEL); if (gnttab_list == NULL) return -ENOMEM; diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c index abe658c73b7b..ca8dbb9be419 100644 --- a/drivers/xen/mcelog.c +++ b/drivers/xen/mcelog.c @@ -373,8 +373,7 @@ static int bind_virq_for_mce(void) /* Fetch each CPU Physical Info for later reference*/ ncpus = mc_op.u.mc_physcpuinfo.ncpus; - g_physinfo = kcalloc(ncpus, sizeof(struct mcinfo_logical_cpu), - GFP_KERNEL); + g_physinfo = kzalloc_objs(struct mcinfo_logical_cpu, ncpus, GFP_KERNEL); if (!g_physinfo) return -ENOMEM; set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo); diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index bfe07adb3e3a..07e6b811c9d3 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -336,7 +336,7 @@ int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain) { struct xen_device_domain_owner *owner; - owner = kzalloc(sizeof(struct xen_device_domain_owner), GFP_KERNEL); + owner = kzalloc_obj(struct xen_device_domain_owner, GFP_KERNEL); if (!owner) return -ENODEV; diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index 093ad4a08672..1d9f3874d099 100644 --- a/drivers/xen/pcpu.c +++ b/drivers/xen/pcpu.c @@ -247,7 +247,7 @@ static struct pcpu *create_and_register_pcpu(struct xenpf_pcpuinfo *info) if (info->flags & XEN_PCPU_FLAGS_INVALID) return ERR_PTR(-ENODEV); - pcpu = kzalloc(sizeof(struct pcpu), GFP_KERNEL); + pcpu = kzalloc_obj(struct pcpu, GFP_KERNEL); if (!pcpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c index 0f0dad427d7e..95d2d5ca5e4f 100644 --- a/drivers/xen/privcmd-buf.c +++ b/drivers/xen/privcmd-buf.c @@ -39,7 +39,7 @@ static int privcmd_buf_open(struct inode *ino, struct file *file) { struct privcmd_buf_private *file_priv; - file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); if (!file_priv) return -ENOMEM; @@ -141,7 +141,7 @@ static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma) if (!(vma->vm_flags & VM_SHARED)) return -EINVAL; - vma_priv = kzalloc(struct_size(vma_priv, pages, count), GFP_KERNEL); + vma_priv = kzalloc_flex(*vma_priv, pages, count, GFP_KERNEL); if (!vma_priv) return -ENOMEM; diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 402be080ad2c..a5d9211f36c3 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -433,7 +433,7 @@ static int alloc_empty_pages(struct vm_area_struct *vma, int numpgs) int rc; struct page **pages; - pages = kvcalloc(numpgs, sizeof(pages[0]), GFP_KERNEL); + pages = kvzalloc_objs(pages[0], numpgs, GFP_KERNEL); if (pages == NULL) return -ENOMEM; @@ -653,7 +653,7 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) if (kdata.num > privcmd_dm_op_max_num) return -E2BIG; - kbufs = kcalloc(kdata.num, sizeof(*kbufs), GFP_KERNEL); + kbufs = kzalloc_objs(*kbufs, kdata.num, GFP_KERNEL); if (!kbufs) return -ENOMEM; @@ -680,13 +680,13 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) PAGE_SIZE); } - pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); if (!pages) { rc = -ENOMEM; goto out; } - xbufs = kcalloc(kdata.num, sizeof(*xbufs), GFP_KERNEL); + xbufs = kzalloc_objs(*xbufs, kdata.num, GFP_KERNEL); if (!xbufs) { rc = -ENOMEM; goto out; @@ -773,7 +773,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file, goto out; } - pfns = kcalloc(kdata.num, sizeof(*pfns), GFP_KERNEL | __GFP_NOWARN); + pfns = kzalloc_objs(*pfns, kdata.num, GFP_KERNEL | __GFP_NOWARN); if (!pfns) { rc = -ENOMEM; goto out; @@ -1355,7 +1355,7 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd) if (!ioeventfd->vcpus || ioeventfd->vcpus > 4096) return -EINVAL; - kioeventfd = kzalloc(sizeof(*kioeventfd), GFP_KERNEL); + kioeventfd = kzalloc_obj(*kioeventfd, GFP_KERNEL); if (!kioeventfd) return -ENOMEM; @@ -1563,7 +1563,7 @@ static long privcmd_ioctl(struct file *file, static int privcmd_open(struct inode *ino, struct file *file) { - struct privcmd_data *data = kzalloc(sizeof(*data), GFP_KERNEL); + struct privcmd_data *data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index c5b6f6fa11eb..8a5dafcaab03 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -324,7 +324,7 @@ static struct sock_mapping *pvcalls_new_active_socket( struct sock_mapping *map; void *page; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { sock_release(sock); return NULL; @@ -632,7 +632,7 @@ static int pvcalls_back_bind(struct xenbus_device *dev, fedata = dev_get_drvdata(&dev->dev); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { ret = -ENOMEM; goto out; @@ -934,7 +934,7 @@ static int backend_connect(struct xenbus_device *dev) grant_ref_t ring_ref; struct pvcalls_fedata *fedata = NULL; - fedata = kzalloc(sizeof(struct pvcalls_fedata), GFP_KERNEL); + fedata = kzalloc_obj(struct pvcalls_fedata, GFP_KERNEL); if (!fedata) return -ENOMEM; diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index 4926d4badc57..c32fd69482e9 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -291,7 +291,7 @@ int pvcalls_front_socket(struct socket *sock) } bedata = dev_get_drvdata(&pvcalls_front_dev->dev); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { pvcalls_exit(); return -ENOMEM; @@ -820,7 +820,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, } } - map2 = kzalloc(sizeof(*map2), GFP_KERNEL); + map2 = kzalloc_obj(*map2, GFP_KERNEL); if (map2 == NULL) { clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, (void *)&map->passive.flags); @@ -1179,7 +1179,7 @@ static int pvcalls_front_probe(struct xenbus_device *dev, return -ENODEV; pr_info("%s max-page-order is %u\n", __func__, max_page_order); - bedata = kzalloc(sizeof(struct pvcalls_bedata), GFP_KERNEL); + bedata = kzalloc_obj(struct pvcalls_bedata, GFP_KERNEL); if (!bedata) return -ENOMEM; diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c index 2f880374b463..25f4e1ff13f6 100644 --- a/drivers/xen/sys-hypervisor.c +++ b/drivers/xen/sys-hypervisor.c @@ -182,7 +182,7 @@ static ssize_t compiler_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -200,7 +200,7 @@ static ssize_t compiled_by_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -218,7 +218,7 @@ static ssize_t compile_date_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -291,7 +291,7 @@ static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_platform_parameters *parms; - parms = kmalloc(sizeof(struct xen_platform_parameters), GFP_KERNEL); + parms = kmalloc_obj(struct xen_platform_parameters, GFP_KERNEL); if (parms) { ret = HYPERVISOR_xen_version(XENVER_platform_parameters, parms); diff --git a/drivers/xen/time.c b/drivers/xen/time.c index 0b18d8a5a2dd..a2be0a4d45b0 100644 --- a/drivers/xen/time.c +++ b/drivers/xen/time.c @@ -94,9 +94,8 @@ void xen_manage_runstate_time(int action) pr_warn_once("%s: memory leak as runstate_delta is not NULL\n", __func__); - runstate_delta = kmalloc_array(num_possible_cpus(), - sizeof(*runstate_delta), - GFP_ATOMIC); + runstate_delta = kmalloc_objs(*runstate_delta, + num_possible_cpus(), GFP_ATOMIC); if (unlikely(!runstate_delta)) { pr_warn("%s: failed to allocate runstate_delta\n", __func__); diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c index 1dc0b495c8e5..4cfb6abdc3d8 100644 --- a/drivers/xen/unpopulated-alloc.c +++ b/drivers/xen/unpopulated-alloc.c @@ -43,7 +43,7 @@ static int fill_list(unsigned int nr_pages) struct range mhp_range; int ret; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); if (!res) return -ENOMEM; @@ -65,7 +65,7 @@ static int fill_list(unsigned int nr_pages) * re-using it by someone else. */ if (target_resource != &iomem_resource) { - tmp_res = kzalloc(sizeof(*tmp_res), GFP_KERNEL); + tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL); if (!tmp_res) { ret = -ENOMEM; goto err_insert; @@ -84,7 +84,7 @@ static int fill_list(unsigned int nr_pages) } } - pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL); + pgmap = kzalloc_obj(*pgmap, GFP_KERNEL); if (!pgmap) { ret = -ENOMEM; goto err_pgmap; diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index f2e8eaf684ba..d7effbaf8948 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c @@ -61,8 +61,8 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr) unsigned int i, ok; int ret = 0; - dst_cx_states = kcalloc(_pr->power.count, - sizeof(struct xen_processor_cx), GFP_KERNEL); + dst_cx_states = kzalloc_objs(struct xen_processor_cx, _pr->power.count, + GFP_KERNEL); if (!dst_cx_states) return -ENOMEM; @@ -142,8 +142,8 @@ xen_copy_pss_data(struct acpi_processor *_pr, BUILD_BUG_ON(sizeof(struct xen_processor_px) != sizeof(struct acpi_processor_px)); - dst_states = kcalloc(_pr->performance->state_count, - sizeof(struct xen_processor_px), GFP_KERNEL); + dst_states = kzalloc_objs(struct xen_processor_px, + _pr->performance->state_count, GFP_KERNEL); if (!dst_states) return ERR_PTR(-ENOMEM); @@ -412,8 +412,8 @@ static int check_acpi_ids(struct acpi_processor *pr_backup) return -ENOMEM; } - acpi_psd = kcalloc(nr_acpi_bits, sizeof(struct acpi_psd_package), - GFP_KERNEL); + acpi_psd = kzalloc_objs(struct acpi_psd_package, nr_acpi_bits, + GFP_KERNEL); if (!acpi_psd) { bitmap_free(acpi_id_present); bitmap_free(acpi_id_cst_present); diff --git a/drivers/xen/xen-front-pgdir-shbuf.c b/drivers/xen/xen-front-pgdir-shbuf.c index 223870a0111b..32e28f044b33 100644 --- a/drivers/xen/xen-front-pgdir-shbuf.c +++ b/drivers/xen/xen-front-pgdir-shbuf.c @@ -205,8 +205,7 @@ static int backend_unmap(struct xen_front_pgdir_shbuf *buf) if (!buf->pages || !buf->backend_map_handles || !buf->grefs) return 0; - unmap_ops = kcalloc(buf->num_pages, sizeof(*unmap_ops), - GFP_KERNEL); + unmap_ops = kzalloc_objs(*unmap_ops, buf->num_pages, GFP_KERNEL); if (!unmap_ops) return -ENOMEM; @@ -250,13 +249,12 @@ static int backend_map(struct xen_front_pgdir_shbuf *buf) unsigned char *ptr; int ret, cur_gref, cur_dir_page, cur_page, grefs_left; - map_ops = kcalloc(buf->num_pages, sizeof(*map_ops), GFP_KERNEL); + map_ops = kzalloc_objs(*map_ops, buf->num_pages, GFP_KERNEL); if (!map_ops) return -ENOMEM; - buf->backend_map_handles = kcalloc(buf->num_pages, - sizeof(*buf->backend_map_handles), - GFP_KERNEL); + buf->backend_map_handles = kzalloc_objs(*buf->backend_map_handles, + buf->num_pages, GFP_KERNEL); if (!buf->backend_map_handles) { kfree(map_ops); return -ENOMEM; @@ -474,7 +472,7 @@ static int grant_references(struct xen_front_pgdir_shbuf *buf) */ static int alloc_storage(struct xen_front_pgdir_shbuf *buf) { - buf->grefs = kcalloc(buf->num_grefs, sizeof(*buf->grefs), GFP_KERNEL); + buf->grefs = kzalloc_objs(*buf->grefs, buf->num_grefs, GFP_KERNEL); if (!buf->grefs) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c index d47eee6c5143..fbc40acd593f 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -401,7 +401,7 @@ int xen_pcibk_config_add_field_offset(struct pci_dev *dev, struct config_field_entry *cfg_entry; void *tmp; - cfg_entry = kmalloc(sizeof(*cfg_entry), GFP_KERNEL); + cfg_entry = kmalloc_obj(*cfg_entry, GFP_KERNEL); if (!cfg_entry) { err = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c index fc0332645966..0efbd85cf7e1 100644 --- a/drivers/xen/xen-pciback/conf_space_header.c +++ b/drivers/xen/xen-pciback/conf_space_header.c @@ -33,7 +33,7 @@ struct pci_bar_info { static void *command_init(struct pci_dev *dev, int offset) { - struct pci_cmd_info *cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); + struct pci_cmd_info *cmd = kmalloc_obj(*cmd, GFP_KERNEL); int err; if (!cmd) @@ -211,7 +211,7 @@ static void *bar_init(struct pci_dev *dev, int offset) { unsigned int pos; const struct resource *res = dev->resource; - struct pci_bar_info *bar = kzalloc(sizeof(*bar), GFP_KERNEL); + struct pci_bar_info *bar = kzalloc_obj(*bar, GFP_KERNEL); if (!bar) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/xen-pciback/conf_space_quirks.c b/drivers/xen/xen-pciback/conf_space_quirks.c index 7dc281086302..52c8d38cb434 100644 --- a/drivers/xen/xen-pciback/conf_space_quirks.c +++ b/drivers/xen/xen-pciback/conf_space_quirks.c @@ -97,7 +97,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev) struct xen_pcibk_config_quirk *quirk; int ret = 0; - quirk = kzalloc(sizeof(*quirk), GFP_KERNEL); + quirk = kzalloc_obj(*quirk, GFP_KERNEL); if (!quirk) { ret = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/passthrough.c b/drivers/xen/xen-pciback/passthrough.c index 66e9b814cc86..9d2583a7a19a 100644 --- a/drivers/xen/xen-pciback/passthrough.c +++ b/drivers/xen/xen-pciback/passthrough.c @@ -51,7 +51,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, unsigned int domain, bus, devfn; int err; - dev_entry = kmalloc(sizeof(*dev_entry), GFP_KERNEL); + dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL); if (!dev_entry) return -ENOMEM; dev_entry->dev = dev; @@ -101,7 +101,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev) { struct passthrough_dev_data *dev_data; - dev_data = kmalloc(sizeof(*dev_data), GFP_KERNEL); + dev_data = kmalloc_obj(*dev_data, GFP_KERNEL); if (!dev_data) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 045e74847fe6..ffc70ce61c8f 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -79,7 +79,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev) dev_dbg(&dev->dev, "pcistub_device_alloc\n"); - psdev = kzalloc(sizeof(*psdev), GFP_KERNEL); + psdev = kzalloc_obj(*psdev, GFP_KERNEL); if (!psdev) return NULL; @@ -623,7 +623,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id) } if (!match) { - pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL); + pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL); if (!pci_dev_id) { err = -ENOMEM; goto out; @@ -1129,7 +1129,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func) || PCI_FUNC(devfn) != func) return -EINVAL; - pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL); + pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL); if (!pci_dev_id) return -ENOMEM; @@ -1189,7 +1189,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, } dev = psdev->dev; - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) { err = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c index 84e014490950..2755ab0b0d85 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c @@ -219,7 +219,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY)) return -ENXIO; - entries = kmalloc_array(op->value, sizeof(*entries), GFP_KERNEL); + entries = kmalloc_objs(*entries, op->value, GFP_KERNEL); if (entries == NULL) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c index cc7450f2b2a9..391ea1040b16 100644 --- a/drivers/xen/xen-pciback/vpci.c +++ b/drivers/xen/xen-pciback/vpci.c @@ -81,7 +81,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, goto out; } - dev_entry = kmalloc(sizeof(*dev_entry), GFP_KERNEL); + dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL); if (!dev_entry) { err = -ENOMEM; xenbus_dev_fatal(pdev->xdev, err, @@ -186,7 +186,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev) int slot; struct vpci_dev_data *vpci_dev; - vpci_dev = kmalloc(sizeof(*vpci_dev), GFP_KERNEL); + vpci_dev = kmalloc_obj(*vpci_dev, GFP_KERNEL); if (!vpci_dev) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c index b11e401f1b1e..d5e001ff0489 100644 --- a/drivers/xen/xen-pciback/xenbus.c +++ b/drivers/xen/xen-pciback/xenbus.c @@ -38,7 +38,7 @@ static struct xen_pcibk_device *alloc_pdev(struct xenbus_device *xdev) { struct xen_pcibk_device *pdev; - pdev = kzalloc(sizeof(struct xen_pcibk_device), GFP_KERNEL); + pdev = kzalloc_obj(struct xen_pcibk_device, GFP_KERNEL); if (pdev == NULL) goto out; dev_dbg(&xdev->dev, "allocated pdev @ 0x%p\n", pdev); diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 7d5117e5efe0..66758c72d5d1 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -543,8 +543,8 @@ static int scsiback_gnttab_data_map(struct vscsiif_request *ring_req, } /* free of (sgl) in fast_flush_area() */ - pending_req->sgl = kmalloc_array(nr_segments, - sizeof(struct scatterlist), GFP_KERNEL); + pending_req->sgl = kmalloc_objs(struct scatterlist, nr_segments, + GFP_KERNEL); if (!pending_req->sgl) return -ENOMEM; @@ -974,7 +974,7 @@ static int scsiback_add_translation_entry(struct vscsibk_info *info, return -ENODEV; } - new = kmalloc(sizeof(struct v2p_entry), GFP_KERNEL); + new = kmalloc_obj(struct v2p_entry, GFP_KERNEL); if (new == NULL) { err = -ENOMEM; goto out_free; @@ -1270,8 +1270,7 @@ static int scsiback_probe(struct xenbus_device *dev, { int err; - struct vscsibk_info *info = kzalloc(sizeof(struct vscsibk_info), - GFP_KERNEL); + struct vscsibk_info *info = kzalloc_obj(struct vscsibk_info, GFP_KERNEL); pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id); @@ -1352,7 +1351,7 @@ scsiback_make_tport(struct target_fabric_configfs *tf, u64 wwpn = 0; int off = 0; - tport = kzalloc(sizeof(struct scsiback_tport), GFP_KERNEL); + tport = kzalloc_obj(struct scsiback_tport, GFP_KERNEL); if (!tport) return ERR_PTR(-ENOMEM); @@ -1532,7 +1531,7 @@ static int scsiback_make_nexus(struct scsiback_tpg *tpg, goto out_unlock; } - tv_nexus = kzalloc(sizeof(struct scsiback_nexus), GFP_KERNEL); + tv_nexus = kzalloc_obj(struct scsiback_nexus, GFP_KERNEL); if (!tv_nexus) { ret = -ENOMEM; goto out_unlock; @@ -1759,7 +1758,7 @@ scsiback_make_tpg(struct se_wwn *wwn, const char *name) if (ret) return ERR_PTR(ret); - tpg = kzalloc(sizeof(struct scsiback_tpg), GFP_KERNEL); + tpg = kzalloc_obj(struct scsiback_tpg, GFP_KERNEL); if (!tpg) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 2dc874fb5506..61739961838c 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -535,11 +535,11 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, if (nr_grefs > XENBUS_MAX_RING_GRANTS) return -EINVAL; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; - info->node = kzalloc(sizeof(*info->node), GFP_KERNEL); + info->node = kzalloc_obj(*info->node, GFP_KERNEL); if (!info->node) err = -ENOMEM; else diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index f5c21ba64df5..7b37d80b82ed 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c @@ -195,7 +195,7 @@ static int queue_reply(struct list_head *queue, const void *data, size_t len) if (len > XENSTORE_PAYLOAD_MAX) return -EINVAL; - rb = kmalloc(struct_size(rb, msg, len), GFP_KERNEL); + rb = kmalloc_flex(*rb, msg, len, GFP_KERNEL); if (rb == NULL) return -ENOMEM; @@ -242,7 +242,7 @@ static struct watch_adapter *alloc_watch_adapter(const char *path, { struct watch_adapter *watch; - watch = kzalloc(sizeof(*watch), GFP_KERNEL); + watch = kzalloc_obj(*watch, GFP_KERNEL); if (watch == NULL) goto out_fail; @@ -454,7 +454,7 @@ static int xenbus_write_transaction(unsigned msg_type, } *msg = (void *)u->u.buffer; if (msg_type == XS_TRANSACTION_START) { - trans = kzalloc(sizeof(*trans), GFP_KERNEL); + trans = kzalloc_obj(*trans, GFP_KERNEL); if (!trans) { rc = -ENOMEM; goto out; @@ -655,7 +655,7 @@ static int xenbus_file_open(struct inode *inode, struct file *filp) stream_open(inode, filp); - u = kzalloc(sizeof(*u), GFP_KERNEL); + u = kzalloc_obj(*u, GFP_KERNEL); if (u == NULL) return -ENOMEM; diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 15f18374020e..82b0a34ded70 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -324,7 +324,7 @@ static void *xs_talkv(struct xenbus_transaction t, unsigned int i; int err; - req = kmalloc(sizeof(*req), GFP_NOIO | __GFP_HIGH); + req = kmalloc_obj(*req, GFP_NOIO | __GFP_HIGH); if (!req) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c index f17c4c03db30..b40ec40eb9a2 100644 --- a/drivers/xen/xlate_mmu.c +++ b/drivers/xen/xlate_mmu.c @@ -223,11 +223,11 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt, BUG_ON(nr_grant_frames == 0); nr_pages = DIV_ROUND_UP(nr_grant_frames, XEN_PFN_PER_PAGE); - pages = kcalloc(nr_pages, sizeof(pages[0]), GFP_KERNEL); + pages = kzalloc_objs(pages[0], nr_pages, GFP_KERNEL); if (!pages) return -ENOMEM; - pfns = kcalloc(nr_grant_frames, sizeof(pfns[0]), GFP_KERNEL); + pfns = kzalloc_objs(pfns[0], nr_grant_frames, GFP_KERNEL); if (!pfns) { kfree(pages); return -ENOMEM; diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index 4e23d53d269e..1959faa6926a 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c @@ -135,8 +135,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev) int error; /* Initialize the Zorro bus */ - bus = kzalloc(struct_size(bus, devices, zorro_num_autocon), - GFP_KERNEL); + bus = kzalloc_flex(*bus, devices, zorro_num_autocon, GFP_KERNEL); if (!bus) return -ENOMEM; diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 315336de6f02..b9872016deae 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -90,7 +90,7 @@ static int v9fs_get_tree(struct fs_context *fc) p9_debug(P9_DEBUG_VFS, "\n"); - v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); + v9ses = kzalloc_obj(struct v9fs_session_info, GFP_KERNEL); if (!v9ses) return -ENOMEM; @@ -308,7 +308,7 @@ static int v9fs_init_fs_context(struct fs_context *fc) { struct v9fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 4f9dc276da6f..366fb93c7b38 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -108,7 +108,7 @@ int adfs_dir_read_buffers(struct super_block *sb, u32 indaddr, if (dir->bhs != dir->bh) return -EINVAL; - bhs = kcalloc(num, sizeof(*bhs), GFP_KERNEL); + bhs = kzalloc_objs(*bhs, num, GFP_KERNEL); if (!bhs) return -ENOMEM; diff --git a/fs/adfs/map.c b/fs/adfs/map.c index a0ce272b4098..9e24e212b3e1 100644 --- a/fs/adfs/map.c +++ b/fs/adfs/map.c @@ -373,7 +373,7 @@ struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_discrecor ((nzones > 1) ? ADFS_DR_SIZE_BITS : 0); map_addr = signed_asl(map_addr, asb->s_map2blk); - dm = kmalloc_array(nzones, sizeof(*dm), GFP_KERNEL); + dm = kmalloc_objs(*dm, nzones, GFP_KERNEL); if (dm == NULL) { adfs_error(sb, "not enough memory"); return ERR_PTR(-ENOMEM); diff --git a/fs/adfs/super.c b/fs/adfs/super.c index fdccdbbfc213..a8e73e980abb 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -437,7 +437,7 @@ static int adfs_init_fs_context(struct fs_context *fc) { struct adfs_sb_info *asb; - asb = kzalloc(sizeof(struct adfs_sb_info), GFP_KERNEL); + asb = kzalloc_obj(struct adfs_sb_info, GFP_KERNEL); if (!asb) return -ENOMEM; diff --git a/fs/affs/dir.c b/fs/affs/dir.c index fe18caaf4d65..39b6ddc4e4b1 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c @@ -36,7 +36,7 @@ static int affs_dir_open(struct inode *inode, struct file *file) { struct affs_dir_data *data; - data = kzalloc(sizeof(struct affs_dir_data), GFP_KERNEL); + data = kzalloc_obj(struct affs_dir_data, GFP_KERNEL); if (!data) return -ENOMEM; file->private_data = data; diff --git a/fs/affs/super.c b/fs/affs/super.c index 44f8aa883100..1a2f72fea1ab 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -327,7 +327,7 @@ static int affs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_time_min = sys_tz.tz_minuteswest * 60 + AFFS_EPOCH_DELTA; sb->s_time_max = 86400LL * U32_MAX + 86400 + sb->s_time_min; - sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct affs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -615,7 +615,7 @@ static int affs_init_fs_context(struct fs_context *fc) { struct affs_context *ctx; - ctx = kzalloc(sizeof(struct affs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct affs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/afs/addr_list.c b/fs/afs/addr_list.c index e941da5b6dd9..26590bfeae91 100644 --- a/fs/afs/addr_list.c +++ b/fs/afs/addr_list.c @@ -66,7 +66,7 @@ struct afs_addr_list *afs_alloc_addrlist(unsigned int nr) if (nr > AFS_MAX_ADDRESSES) nr = AFS_MAX_ADDRESSES; - alist = kzalloc(struct_size(alist, addrs, nr), GFP_KERNEL); + alist = kzalloc_flex(*alist, addrs, nr, GFP_KERNEL); if (!alist) return NULL; diff --git a/fs/afs/addr_prefs.c b/fs/afs/addr_prefs.c index 133736412c3d..f5a4fb6f609a 100644 --- a/fs/afs/addr_prefs.c +++ b/fs/afs/addr_prefs.c @@ -401,7 +401,7 @@ int afs_proc_addr_prefs_write(struct file *file, char *buf, size_t size) max_prefs = min_t(size_t, (psize - sizeof(*old)) / sizeof(old->prefs[0]), 255); ret = -ENOMEM; - preflist = kmalloc(struct_size(preflist, prefs, max_prefs), GFP_KERNEL); + preflist = kmalloc_flex(*preflist, prefs, max_prefs, GFP_KERNEL); if (!preflist) goto done; diff --git a/fs/afs/cell.c b/fs/afs/cell.c index 71c10a05cebe..4331bf8e1dbd 100644 --- a/fs/afs/cell.c +++ b/fs/afs/cell.c @@ -134,7 +134,7 @@ static struct afs_cell *afs_alloc_cell(struct afs_net *net, _enter("%*.*s,%s", namelen, namelen, name, addresses); - cell = kzalloc(sizeof(struct afs_cell), GFP_KERNEL); + cell = kzalloc_obj(struct afs_cell, GFP_KERNEL); if (!cell) { _leave(" = -ENOMEM"); return ERR_PTR(-ENOMEM); diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index 1a906805a9e3..a32e7c2864d2 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c @@ -228,9 +228,8 @@ static int afs_deliver_cb_callback(struct afs_call *call) return ret; _debug("unmarshall FID array"); - call->request = kcalloc(call->count, - sizeof(struct afs_callback_break), - GFP_KERNEL); + call->request = kzalloc_objs(struct afs_callback_break, + call->count, GFP_KERNEL); if (!call->request) return -ENOMEM; @@ -340,7 +339,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); + call->request = kmalloc_obj(struct afs_uuid, GFP_KERNEL); if (!call->request) return -ENOMEM; @@ -457,7 +456,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); + call->request = kmalloc_obj(struct afs_uuid, GFP_KERNEL); if (!call->request) return -ENOMEM; @@ -589,9 +588,8 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call) return ret; _debug("unmarshall FID array"); - call->request = kcalloc(call->count, - sizeof(struct afs_callback_break), - GFP_KERNEL); + call->request = kzalloc_objs(struct afs_callback_break, + call->count, GFP_KERNEL); if (!call->request) return -ENOMEM; diff --git a/fs/afs/dir.c b/fs/afs/dir.c index f4e9e12373ac..6f7380f25365 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -785,7 +785,7 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry) _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry); - cookie = kzalloc(sizeof(struct afs_lookup_cookie), GFP_KERNEL); + cookie = kzalloc_obj(struct afs_lookup_cookie, GFP_KERNEL); if (!cookie) return ERR_PTR(-ENOMEM); @@ -834,9 +834,8 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry) /* Need space for examining all the selected files */ if (op->nr_files > 2) { - op->more_files = kvcalloc(op->nr_files - 2, - sizeof(struct afs_vnode_param), - GFP_KERNEL); + op->more_files = kvzalloc_objs(struct afs_vnode_param, + op->nr_files - 2, GFP_KERNEL); if (!op->more_files) { afs_op_nomem(op); goto out_op; @@ -2095,7 +2094,7 @@ static int afs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto error; ret = -ENOMEM; - op->more_files = kvcalloc(2, sizeof(struct afs_vnode_param), GFP_KERNEL); + op->more_files = kvzalloc_objs(struct afs_vnode_param, 2, GFP_KERNEL); if (!op->more_files) goto error; diff --git a/fs/afs/dir_silly.c b/fs/afs/dir_silly.c index 014495d4b868..f77bed45e808 100644 --- a/fs/afs/dir_silly.c +++ b/fs/afs/dir_silly.c @@ -69,7 +69,7 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode if (IS_ERR(op)) return PTR_ERR(op); - op->more_files = kvcalloc(2, sizeof(struct afs_vnode_param), GFP_KERNEL); + op->more_files = kvzalloc_objs(struct afs_vnode_param, 2, GFP_KERNEL); if (!op->more_files) { afs_put_operation(op); return -ENOMEM; diff --git a/fs/afs/file.c b/fs/afs/file.c index f66a92294284..5c429a746d76 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -86,7 +86,7 @@ int afs_cache_wb_key(struct afs_vnode *vnode, struct afs_file *af) { struct afs_wb_key *wbk, *p; - wbk = kzalloc(sizeof(struct afs_wb_key), GFP_KERNEL); + wbk = kzalloc_obj(struct afs_wb_key, GFP_KERNEL); if (!wbk) return -ENOMEM; refcount_set(&wbk->usage, 2); @@ -130,7 +130,7 @@ int afs_open(struct inode *inode, struct file *file) goto error; } - af = kzalloc(sizeof(*af), GFP_KERNEL); + af = kzalloc_obj(*af, GFP_KERNEL); if (!af) { ret = -ENOMEM; goto error_key; diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 8418813ee043..0ffd19f5279d 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -21,7 +21,7 @@ struct afs_operation *afs_alloc_operation(struct key *key, struct afs_volume *vo _enter(""); - op = kzalloc(sizeof(*op), GFP_KERNEL); + op = kzalloc_obj(*op, GFP_KERNEL); if (!op) return ERR_PTR(-ENOMEM); diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c index e0030ac74ea0..0100ce4c62a0 100644 --- a/fs/afs/fs_probe.c +++ b/fs/afs/fs_probe.c @@ -244,7 +244,7 @@ int afs_fs_probe_fileserver(struct afs_net *net, struct afs_server *server, _enter("%pU", &server->uuid); - estate = kzalloc(sizeof(*estate), GFP_KERNEL); + estate = kzalloc_obj(*estate, GFP_KERNEL); if (!estate) return -ENOMEM; diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index bc9556991d7c..eb3520b9a282 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c @@ -2010,7 +2010,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) size = call->count2 = ntohl(call->tmp); size = round_up(size, 4); - acl = kmalloc(struct_size(acl, data, size), GFP_KERNEL); + acl = kmalloc_flex(*acl, data, size, GFP_KERNEL); if (!acl) return -ENOMEM; op->acl = acl; diff --git a/fs/afs/main.c b/fs/afs/main.c index e6bb8237db98..7e09bf7aa03b 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -93,7 +93,7 @@ static int __net_init afs_net_init(struct net *net_ns) atomic_set(&net->servers_outstanding, 1); ret = -ENOMEM; - sysnames = kzalloc(sizeof(*sysnames), GFP_KERNEL); + sysnames = kzalloc_obj(*sysnames, GFP_KERNEL); if (!sysnames) goto error_sysnames; sysnames->subs[0] = (char *)&afs_init_sysname; diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 44520549b509..52e8195ef2b8 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -572,7 +572,7 @@ static int afs_proc_sysname_write(struct file *file, char *buf, size_t size) char *s, *p, *sub; int ret, len; - sysnames = kzalloc(sizeof(*sysnames), GFP_KERNEL); + sysnames = kzalloc_obj(*sysnames, GFP_KERNEL); if (!sysnames) return -ENOMEM; refcount_set(&sysnames->usage, 1); diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c index 6a4e7da10fc4..69e80c5b6610 100644 --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -46,8 +46,9 @@ static bool afs_start_fs_iteration(struct afs_operation *op, lockdep_is_held(&op->volume->servers_lock))); read_unlock(&op->volume->servers_lock); - op->server_states = kcalloc(op->server_list->nr_servers, sizeof(op->server_states[0]), - GFP_KERNEL); + op->server_states = kzalloc_objs(op->server_states[0], + op->server_list->nr_servers, + GFP_KERNEL); if (!op->server_states) { afs_op_nomem(op); trace_afs_rotate(op, afs_rotate_trace_nomem, 0); diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index bf0e4ea0aafd..588f8de51167 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -160,7 +160,7 @@ static struct afs_call *afs_alloc_call(struct afs_net *net, struct afs_call *call; int o; - call = kzalloc(sizeof(*call), gfp); + call = kzalloc_obj(*call, gfp); if (!call) return NULL; diff --git a/fs/afs/security.c b/fs/afs/security.c index 55ddce94af03..6d00d62a65ed 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c @@ -252,7 +252,7 @@ void afs_cache_permit(struct afs_vnode *vnode, struct key *key, * yet. */ size++; - new = kzalloc(struct_size(new, permits, size), GFP_NOFS); + new = kzalloc_flex(*new, permits, size, GFP_NOFS); if (!new) goto out_put; diff --git a/fs/afs/server.c b/fs/afs/server.c index c4428ebddb1d..8777c566d12d 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c @@ -117,7 +117,7 @@ static struct afs_server *afs_alloc_server(struct afs_cell *cell, const uuid_t * _enter(""); - server = kzalloc(sizeof(struct afs_server), GFP_KERNEL); + server = kzalloc_obj(struct afs_server, GFP_KERNEL); if (!server) return NULL; diff --git a/fs/afs/server_list.c b/fs/afs/server_list.c index 20d5474837df..b948df6dddc7 100644 --- a/fs/afs/server_list.c +++ b/fs/afs/server_list.c @@ -51,7 +51,7 @@ struct afs_server_list *afs_alloc_server_list(struct afs_volume *volume, newrep++; } - slist = kzalloc(struct_size(slist, servers, nr_servers), GFP_KERNEL); + slist = kzalloc_flex(*slist, servers, nr_servers, GFP_KERNEL); if (!slist) goto error; diff --git a/fs/afs/super.c b/fs/afs/super.c index d672b7ab57ae..2b567fe5b4cb 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -502,7 +502,7 @@ static struct afs_super_info *afs_alloc_sbi(struct fs_context *fc) struct afs_fs_context *ctx = fc->fs_private; struct afs_super_info *as; - as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL); + as = kzalloc_obj(struct afs_super_info, GFP_KERNEL); if (as) { as->net_ns = get_net(fc->net_ns); as->flock_mode = ctx->flock_mode; @@ -623,7 +623,7 @@ static int afs_init_fs_context(struct fs_context *fc) struct afs_fs_context *ctx; struct afs_cell *cell; - ctx = kzalloc(sizeof(struct afs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct afs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/afs/vl_list.c b/fs/afs/vl_list.c index 9b1c20daac53..4f430ae01646 100644 --- a/fs/afs/vl_list.c +++ b/fs/afs/vl_list.c @@ -15,8 +15,7 @@ struct afs_vlserver *afs_alloc_vlserver(const char *name, size_t name_len, struct afs_vlserver *vlserver; static atomic_t debug_ids; - vlserver = kzalloc(struct_size(vlserver, name, name_len + 1), - GFP_KERNEL); + vlserver = kzalloc_flex(*vlserver, name, name_len + 1, GFP_KERNEL); if (vlserver) { refcount_set(&vlserver->ref, 1); rwlock_init(&vlserver->lock); @@ -52,7 +51,7 @@ struct afs_vlserver_list *afs_alloc_vlserver_list(unsigned int nr_servers) { struct afs_vlserver_list *vllist; - vllist = kzalloc(struct_size(vllist, servers, nr_servers), GFP_KERNEL); + vllist = kzalloc_flex(*vllist, servers, nr_servers, GFP_KERNEL); if (vllist) { refcount_set(&vllist->ref, 1); rwlock_init(&vllist->lock); diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c index 3a23c0b08eb6..05abd50e4057 100644 --- a/fs/afs/vlclient.c +++ b/fs/afs/vlclient.c @@ -122,7 +122,7 @@ struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc, padsz = (4 - (volnamesz & 3)) & 3; reqsz = 8 + volnamesz + padsz; - entry = kzalloc(sizeof(struct afs_vldb_entry), GFP_KERNEL); + entry = kzalloc_obj(struct afs_vldb_entry, GFP_KERNEL); if (!entry) return ERR_PTR(-ENOMEM); diff --git a/fs/afs/volume.c b/fs/afs/volume.c index 0efff3d25133..260df046143a 100644 --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -81,7 +81,7 @@ static struct afs_volume *afs_alloc_volume(struct afs_fs_context *params, struct afs_volume *volume; int ret = -ENOMEM, i; - volume = kzalloc(sizeof(struct afs_volume), GFP_KERNEL); + volume = kzalloc_obj(struct afs_volume, GFP_KERNEL); if (!volume) goto error_0; diff --git a/fs/afs/xattr.c b/fs/afs/xattr.c index e19f396aa370..2daf23af01e5 100644 --- a/fs/afs/xattr.c +++ b/fs/afs/xattr.c @@ -75,7 +75,7 @@ static bool afs_make_acl(struct afs_operation *op, { struct afs_acl *acl; - acl = kmalloc(struct_size(acl, data, size), GFP_KERNEL); + acl = kmalloc_flex(*acl, data, size, GFP_KERNEL); if (!acl) { afs_op_nomem(op); return false; @@ -157,7 +157,7 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, else return -EOPNOTSUPP; - yacl = kzalloc(sizeof(struct yfs_acl), GFP_KERNEL); + yacl = kzalloc_obj(struct yfs_acl, GFP_KERNEL); if (!yacl) goto error; diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c index febf13a49f0b..9adc2dcde9a7 100644 --- a/fs/afs/yfsclient.c +++ b/fs/afs/yfsclient.c @@ -2048,7 +2048,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) size = round_up(size, 4); if (yacl->flags & YFS_ACL_WANT_ACL) { - acl = kmalloc(struct_size(acl, data, size), GFP_KERNEL); + acl = kmalloc_flex(*acl, data, size, GFP_KERNEL); if (!acl) return -ENOMEM; yacl->acl = acl; @@ -2080,7 +2080,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) size = round_up(size, 4); if (yacl->flags & YFS_ACL_WANT_VOL_ACL) { - acl = kmalloc(struct_size(acl, data, size), GFP_KERNEL); + acl = kmalloc_flex(*acl, data, size, GFP_KERNEL); if (!acl) return -ENOMEM; yacl->vol_acl = acl; diff --git a/fs/aio.c b/fs/aio.c index 59b67b8da1b2..4eb757df3d80 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -510,8 +510,8 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events) ctx->ring_folios = ctx->internal_folios; if (nr_pages > AIO_RING_PAGES) { - ctx->ring_folios = kcalloc(nr_pages, sizeof(struct folio *), - GFP_KERNEL); + ctx->ring_folios = kzalloc_objs(struct folio *, nr_pages, + GFP_KERNEL); if (!ctx->ring_folios) { put_aio_ring_file(ctx); return -ENOMEM; @@ -693,7 +693,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) new_nr = (table ? table->nr : 1) * 4; spin_unlock(&mm->ioctx_lock); - table = kzalloc(struct_size(table, table, new_nr), GFP_KERNEL); + table = kzalloc_flex(*table, table, new_nr, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index b932b1719dfc..5134a042044c 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -13,7 +13,7 @@ struct autofs_info *autofs_new_ino(struct autofs_sb_info *sbi) { struct autofs_info *ino; - ino = kzalloc(sizeof(*ino), GFP_KERNEL); + ino = kzalloc_obj(*ino, GFP_KERNEL); if (ino) { INIT_LIST_HEAD(&ino->active); INIT_LIST_HEAD(&ino->expiring); @@ -242,7 +242,7 @@ static struct autofs_sb_info *autofs_alloc_sbi(void) { struct autofs_sb_info *sbi; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return NULL; @@ -405,7 +405,7 @@ int autofs_init_fs_context(struct fs_context *fc) struct autofs_fs_context *ctx; struct autofs_sb_info *sbi; - ctx = kzalloc(sizeof(struct autofs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct autofs_fs_context, GFP_KERNEL); if (!ctx) goto nomem; diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c index 33dd4660d82f..21ecd0bbc0ca 100644 --- a/fs/autofs/waitq.c +++ b/fs/autofs/waitq.c @@ -376,7 +376,7 @@ int autofs_wait(struct autofs_sb_info *sbi, if (!wq) { /* Create a new wait queue */ - wq = kmalloc(sizeof(struct autofs_wait_queue), GFP_KERNEL); + wq = kmalloc_obj(struct autofs_wait_queue, GFP_KERNEL); if (!wq) { kfree(name); mutex_unlock(&sbi->wq_mutex); diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 53b36aa29978..aa24f1daccdd 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -258,8 +258,7 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, goto error; } - this_node = kmalloc(sizeof(struct befs_btree_node), - GFP_NOFS); + this_node = kmalloc_obj(struct befs_btree_node, GFP_NOFS); if (!this_node) { befs_error(sb, "befs_btree_find() failed to allocate %zu " "bytes of memory", sizeof(struct befs_btree_node)); @@ -431,7 +430,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, goto error; } - this_node = kmalloc(sizeof(struct befs_btree_node), GFP_NOFS); + this_node = kmalloc_obj(struct befs_btree_node, GFP_NOFS); if (this_node == NULL) { befs_error(sb, "befs_btree_read() failed to allocate %zu " "bytes of memory", sizeof(struct befs_btree_node)); diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index d7c5d9270387..df54c52d2f19 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -790,7 +790,7 @@ befs_fill_super(struct super_block *sb, struct fs_context *fc) struct befs_mount_options *parsed_opts = fc->fs_private; int silent = fc->sb_flags & SB_SILENT; - sb->s_fs_info = kzalloc(sizeof(*befs_sb), GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(*befs_sb, GFP_KERNEL); if (sb->s_fs_info == NULL) goto unacquire_none; @@ -956,7 +956,7 @@ static int befs_init_fs_context(struct fs_context *fc) { struct befs_mount_options *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index ce6f83234b67..6ed07d892e3d 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -334,7 +334,7 @@ static int bfs_fill_super(struct super_block *s, struct fs_context *fc) unsigned long i_sblock, i_eblock, i_eoff, s_size; int silent = fc->sb_flags & SB_SILENT; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; mutex_init(&info->bfs_lock); diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 3eb734c192e9..6ea9681cab33 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -916,7 +916,7 @@ static int load_elf_binary(struct linux_binprm *bprm) */ would_dump(bprm, interpreter); - interp_elf_ex = kmalloc(sizeof(*interp_elf_ex), GFP_KERNEL); + interp_elf_ex = kmalloc_obj(*interp_elf_ex, GFP_KERNEL); if (!interp_elf_ex) { retval = -ENOMEM; goto out_free_file; @@ -1798,7 +1798,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, fill_note(&t->notes[0], PRSTATUS, sizeof(t->prstatus), &t->prstatus); info->size += notesize(&t->notes[0]); - fpu = kzalloc(sizeof(elf_fpregset_t), GFP_KERNEL); + fpu = kzalloc_obj(elf_fpregset_t, GFP_KERNEL); if (!fpu || !elf_core_copy_task_fpregs(p, fpu)) { kfree(fpu); return 1; @@ -1824,7 +1824,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, u16 machine; u32 flags; - psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); + psinfo = kmalloc_obj(*psinfo, GFP_KERNEL); if (!psinfo) return 0; fill_note(&info->psinfo, PRPSINFO, sizeof(*psinfo), psinfo); @@ -1873,15 +1873,14 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, /* * Allocate a structure for each thread. */ - info->thread = kzalloc(struct_size(info->thread, notes, info->thread_notes), - GFP_KERNEL); + info->thread = kzalloc_flex(*info->thread, notes, info->thread_notes, + GFP_KERNEL); if (unlikely(!info->thread)) return 0; info->thread->task = dump_task; for (ct = dump_task->signal->core_state->dumper.next; ct; ct = ct->next) { - t = kzalloc(struct_size(t, notes, info->thread_notes), - GFP_KERNEL); + t = kzalloc_flex(*t, notes, info->thread_notes, GFP_KERNEL); if (unlikely(!t)) return 0; @@ -2037,7 +2036,7 @@ static int elf_core_dump(struct coredump_params *cprm) /* For cell spufs and x86 xstate */ sz += elf_coredump_extra_notes_size(); - phdr4note = kmalloc(sizeof(*phdr4note), GFP_KERNEL); + phdr4note = kmalloc_obj(*phdr4note, GFP_KERNEL); if (!phdr4note) goto end_coredump; @@ -2052,7 +2051,7 @@ static int elf_core_dump(struct coredump_params *cprm) e_shoff = offset; if (e_phnum == PN_XNUM) { - shdr4extnum = kmalloc(sizeof(*shdr4extnum), GFP_KERNEL); + shdr4extnum = kmalloc_obj(*shdr4extnum, GFP_KERNEL); if (!shdr4extnum) goto end_coredump; fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 48fd2de3bca0..cee0871b0164 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -761,7 +761,7 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params, if (nloads == 0) return -ELIBBAD; - loadmap = kzalloc(struct_size(loadmap, segs, nloads), GFP_KERNEL); + loadmap = kzalloc_flex(*loadmap, segs, nloads, GFP_KERNEL); if (!loadmap) return -ENOMEM; @@ -1391,7 +1391,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ struct elf_thread_status *t; int i, ret; - t = kzalloc(sizeof(struct elf_thread_status), GFP_KERNEL); + t = kzalloc_obj(struct elf_thread_status, GFP_KERNEL); if (!t) return t; @@ -1486,10 +1486,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) struct elf_thread_status *tmp; /* alloc memory for large data structures: too large to be on stack */ - elf = kmalloc(sizeof(*elf), GFP_KERNEL); + elf = kmalloc_obj(*elf, GFP_KERNEL); if (!elf) goto end_coredump; - psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); + psinfo = kmalloc_obj(*psinfo, GFP_KERNEL); if (!psinfo) goto end_coredump; @@ -1547,7 +1547,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) offset += segs * sizeof(struct elf_phdr); /* Program headers */ /* Write notes phdr entry */ - phdr4note = kmalloc(sizeof(*phdr4note), GFP_KERNEL); + phdr4note = kmalloc_obj(*phdr4note, GFP_KERNEL); if (!phdr4note) goto end_coredump; @@ -1562,7 +1562,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) e_shoff = offset; if (e_phnum == PN_XNUM) { - shdr4extnum = kmalloc(sizeof(*shdr4extnum), GFP_KERNEL); + shdr4extnum = kmalloc_obj(*shdr4extnum, GFP_KERNEL); if (!shdr4extnum) goto end_coredump; fill_extnum_info(elf, shdr4extnum, e_shoff, segs); diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 2b772613a74c..4a15e09bc398 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -961,7 +961,7 @@ static int bm_fill_super(struct super_block *sb, struct fs_context *fc) * create their own separate binfmt_misc mounts we should * consider turning this into a kmem cache. */ - misc = kzalloc(sizeof(struct binfmt_misc), GFP_KERNEL); + misc = kzalloc_obj(struct binfmt_misc, GFP_KERNEL); if (!misc) return -ENOMEM; diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 6c6f3bb58f4e..cce7b2610364 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -85,7 +85,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, const char *name, unsigned int flags, int limit_active, int thresh) { - struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_KERNEL); + struct btrfs_workqueue *ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; @@ -126,7 +126,7 @@ struct btrfs_workqueue *btrfs_alloc_ordered_workqueue( { struct btrfs_workqueue *ret; - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 9bb406f7dd30..78bf0cad1d2d 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -78,7 +78,7 @@ static int check_extent_in_eb(struct btrfs_backref_walk_ctx *ctx, } add_inode_elem: - e = kmalloc(sizeof(*e), GFP_NOFS); + e = kmalloc_obj(*e, GFP_NOFS); if (!e) return -ENOMEM; @@ -1805,7 +1805,7 @@ struct btrfs_backref_share_check_ctx *btrfs_alloc_backref_share_check_ctx(void) { struct btrfs_backref_share_check_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -2797,7 +2797,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, if (IS_ERR(fspath)) return ERR_CAST(fspath); - ifp = kmalloc(sizeof(*ifp), GFP_KERNEL); + ifp = kmalloc_obj(*ifp, GFP_KERNEL); if (!ifp) { kvfree(fspath); return ERR_PTR(-ENOMEM); @@ -2814,7 +2814,7 @@ struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_inf { struct btrfs_backref_iter *ret; - ret = kzalloc(sizeof(*ret), GFP_NOFS); + ret = kzalloc_obj(*ret, GFP_NOFS); if (!ret) return NULL; @@ -3024,7 +3024,7 @@ struct btrfs_backref_node *btrfs_backref_alloc_node( struct btrfs_backref_node *node; ASSERT(level >= 0 && level < BTRFS_MAX_LEVEL); - node = kzalloc(sizeof(*node), GFP_NOFS); + node = kzalloc_obj(*node, GFP_NOFS); if (!node) return node; @@ -3057,7 +3057,7 @@ struct btrfs_backref_edge *btrfs_backref_alloc_edge( { struct btrfs_backref_edge *edge; - edge = kzalloc(sizeof(*edge), GFP_NOFS); + edge = kzalloc_obj(*edge, GFP_NOFS); if (edge) cache->nr_edges++; return edge; diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 4a1528803ff7..2a2a21aec817 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -709,7 +709,7 @@ static bool btrfs_wq_submit_bio(struct btrfs_bio *bbio, struct btrfs_fs_info *fs_info = bbio->inode->root->fs_info; struct async_submit_bio *async; - async = kmalloc(sizeof(*async), GFP_NOFS); + async = kmalloc_obj(*async, GFP_NOFS); if (!async) return false; diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 5f76683b3f21..c284f48cfae4 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -947,7 +947,7 @@ int btrfs_cache_block_group(struct btrfs_block_group *cache, bool wait) if (cache->flags & BTRFS_BLOCK_GROUP_REMAPPED) return 0; - caching_ctl = kzalloc(sizeof(*caching_ctl), GFP_NOFS); + caching_ctl = kzalloc_obj(*caching_ctl, GFP_NOFS); if (!caching_ctl) return -ENOMEM; @@ -2312,12 +2312,11 @@ static struct btrfs_block_group *btrfs_create_block_group( { struct btrfs_block_group *cache; - cache = kzalloc(sizeof(*cache), GFP_NOFS); + cache = kzalloc_obj(*cache, GFP_NOFS); if (!cache) return NULL; - cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), - GFP_NOFS); + cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl, GFP_NOFS); if (!cache->free_space_ctl) { kfree(cache); return NULL; diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c index 93c371db8731..6064dd00d041 100644 --- a/fs/btrfs/block-rsv.c +++ b/fs/btrfs/block-rsv.c @@ -192,7 +192,7 @@ struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info, { struct btrfs_block_rsv *block_rsv; - block_rsv = kmalloc(sizeof(*block_rsv), GFP_NOFS); + block_rsv = kmalloc_obj(*block_rsv, GFP_NOFS); if (!block_rsv) return NULL; diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 1e7174ad32e2..7fde7698c331 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -662,7 +662,7 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info) { struct heuristic_ws *ws; - ws = kzalloc(sizeof(*ws), GFP_KERNEL); + ws = kzalloc_obj(*ws, GFP_KERNEL); if (!ws) return ERR_PTR(-ENOMEM); @@ -670,11 +670,11 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info) if (!ws->sample) goto fail; - ws->bucket = kcalloc(BUCKET_SIZE, sizeof(*ws->bucket), GFP_KERNEL); + ws->bucket = kzalloc_objs(*ws->bucket, BUCKET_SIZE, GFP_KERNEL); if (!ws->bucket) goto fail; - ws->bucket_b = kcalloc(BUCKET_SIZE, sizeof(*ws->bucket_b), GFP_KERNEL); + ws->bucket_b = kzalloc_objs(*ws->bucket_b, BUCKET_SIZE, GFP_KERNEL); if (!ws->bucket_b) goto fail; @@ -734,7 +734,7 @@ static int alloc_workspace_manager(struct btrfs_fs_info *fs_info, struct list_head *workspace; ASSERT(fs_info->compr_wsm[type] == NULL); - gwsm = kzalloc(sizeof(*gwsm), GFP_KERNEL); + gwsm = kzalloc_obj(*gwsm, GFP_KERNEL); if (!gwsm) return -ENOMEM; diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c index ecf05cd64696..7e2db5d3a4d4 100644 --- a/fs/btrfs/defrag.c +++ b/fs/btrfs/defrag.c @@ -1091,7 +1091,7 @@ add: } /* Allocate new defrag_target_range */ - new = kmalloc(sizeof(*new), GFP_NOFS); + new = kmalloc_obj(*new, GFP_NOFS); if (!new) { btrfs_free_extent_map(em); ret = -ENOMEM; @@ -1206,7 +1206,7 @@ static int defrag_one_range(struct btrfs_inode *inode, u64 start, u32 len, ASSERT(nr_pages <= CLUSTER_SIZE / PAGE_SIZE); ASSERT(IS_ALIGNED(start, sectorsize) && IS_ALIGNED(len, sectorsize)); - folios = kcalloc(nr_pages, sizeof(struct folio *), GFP_NOFS); + folios = kzalloc_objs(struct folio *, nr_pages, GFP_NOFS); if (!folios) return -ENOMEM; diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 1739a0b29c49..d97bbbd045e0 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -349,7 +349,7 @@ static struct btrfs_delayed_item *btrfs_alloc_delayed_item(u16 data_len, { struct btrfs_delayed_item *item; - item = kmalloc(struct_size(item, data, data_len), GFP_NOFS); + item = kmalloc_flex(*item, data, data_len, GFP_NOFS); if (item) { item->data_len = data_len; item->type = type; @@ -1384,7 +1384,7 @@ static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, { struct btrfs_async_delayed_work *async_work; - async_work = kmalloc(sizeof(*async_work), GFP_NOFS); + async_work = kmalloc_obj(*async_work, GFP_NOFS); if (!async_work) return -ENOMEM; diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index e8bc37453336..3766ff29fbbb 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -1027,7 +1027,7 @@ static int add_delayed_ref(struct btrfs_trans_handle *trans, delayed_refs = &trans->transaction->delayed_refs; if (btrfs_qgroup_full_accounting(fs_info) && !generic_ref->skip_qgroup) { - record = kzalloc(sizeof(*record), GFP_NOFS); + record = kzalloc_obj(*record, GFP_NOFS); if (!record) { ret = -ENOMEM; goto free_head_ref; diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 13e400046c87..f6fa15a1193f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -605,7 +605,7 @@ static struct btrfs_root *btrfs_alloc_root(struct btrfs_fs_info *fs_info, { struct btrfs_root *root; - root = kzalloc(sizeof(*root), flags); + root = kzalloc_obj(*root, flags); if (!root) return NULL; diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 73571d5d3d5a..a9b0b596429d 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -200,7 +200,7 @@ static inline struct extent_changeset *extent_changeset_alloc(void) { struct extent_changeset *ret; - ret = kmalloc(sizeof(*ret), GFP_KERNEL); + ret = kmalloc_obj(*ret, GFP_KERNEL); if (!ret) return NULL; diff --git a/fs/btrfs/fiemap.c b/fs/btrfs/fiemap.c index f2eaaef8422b..2e113f81a2d8 100644 --- a/fs/btrfs/fiemap.c +++ b/fs/btrfs/fiemap.c @@ -646,9 +646,8 @@ static int extent_fiemap(struct btrfs_inode *inode, int ret; cache.entries_size = PAGE_SIZE / sizeof(struct btrfs_fiemap_entry); - cache.entries = kmalloc_array(cache.entries_size, - sizeof(struct btrfs_fiemap_entry), - GFP_KERNEL); + cache.entries = kmalloc_objs(struct btrfs_fiemap_entry, + cache.entries_size, GFP_KERNEL); backref_ctx = btrfs_alloc_backref_share_check_ctx(); path = btrfs_alloc_path(); if (!cache.entries || !backref_ctx || !path) { diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 7bd715442f3e..927324a2175a 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -845,7 +845,7 @@ int btrfs_csum_one_bio(struct btrfs_bio *bbio, bool async) */ int btrfs_alloc_dummy_sum(struct btrfs_bio *bbio) { - bbio->sums = kmalloc(sizeof(*bbio->sums), GFP_NOFS); + bbio->sums = kmalloc_obj(*bbio->sums, GFP_NOFS); if (!bbio->sums) return -ENOMEM; bbio->sums->len = bbio->bio.bi_iter.bi_size; diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index acaa3dbd2b7b..21cb45e23a6f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2842,7 +2842,7 @@ static int add_falloc_range(struct list_head *head, u64 start, u64 len) } } - range = kmalloc(sizeof(*range), GFP_KERNEL); + range = kmalloc_obj(*range, GFP_KERNEL); if (!range) return -ENOMEM; range->start = start; @@ -3572,7 +3572,7 @@ static loff_t find_desired_extent(struct file *file, loff_t offset, int whence) */ private = NULL; } else if (!private) { - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); /* * No worries if memory allocation failed. * The private structure is used only for speeding up multiple diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index cc075a460a22..ab22e4f9ffdd 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -388,7 +388,7 @@ static int io_ctl_init(struct btrfs_io_ctl *io_ctl, struct inode *inode, memset(io_ctl, 0, sizeof(struct btrfs_io_ctl)); - io_ctl->pages = kcalloc(num_pages, sizeof(struct page *), GFP_NOFS); + io_ctl->pages = kzalloc_objs(struct page *, num_pages, GFP_NOFS); if (!io_ctl->pages) return -ENOMEM; diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5bbbce2224a1..da4be08d133e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -781,7 +781,7 @@ static int add_async_extent(struct async_chunk *cow, u64 start, u64 ram_size, { struct async_extent *async_extent; - async_extent = kmalloc(sizeof(*async_extent), GFP_NOFS); + async_extent = kmalloc_obj(*async_extent, GFP_NOFS); if (!async_extent) return -ENOMEM; ASSERT(ram_size < U32_MAX); @@ -1692,7 +1692,7 @@ static bool run_delalloc_compressed(struct btrfs_inode *inode, const blk_opf_t write_flags = wbc_to_write_flags(wbc); nofs_flag = memalloc_nofs_save(); - ctx = kvmalloc(struct_size(ctx, chunks, num_chunks), GFP_KERNEL); + ctx = kvmalloc_flex(*ctx, chunks, num_chunks, GFP_KERNEL); memalloc_nofs_restore(nofs_flag); if (!ctx) return false; @@ -2991,7 +2991,7 @@ int btrfs_writepage_cow_fixup(struct folio *folio) if (folio_test_checked(folio)) return -EAGAIN; - fixup = kzalloc(sizeof(*fixup), GFP_NOFS); + fixup = kzalloc_obj(*fixup, GFP_NOFS); if (!fixup) return -EAGAIN; @@ -3967,7 +3967,7 @@ static int btrfs_init_file_extent_tree(struct btrfs_inode *inode) if (btrfs_is_free_space_inode(inode)) return 0; - inode->file_extent_tree = kmalloc(sizeof(struct extent_io_tree), GFP_KERNEL); + inode->file_extent_tree = kmalloc_obj(struct extent_io_tree, GFP_KERNEL); if (!inode->file_extent_tree) return -ENOMEM; @@ -6221,7 +6221,7 @@ static int btrfs_opendir(struct inode *inode, struct file *file) if (ret) return ret; - private = kzalloc(sizeof(struct btrfs_file_private), GFP_KERNEL); + private = kzalloc_obj(struct btrfs_file_private, GFP_KERNEL); if (!private) return -ENOMEM; private->last_index = last_index; @@ -8839,7 +8839,7 @@ static struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode { struct btrfs_delalloc_work *work; - work = kmalloc(sizeof(*work), GFP_NOFS); + work = kmalloc_obj(*work, GFP_NOFS); if (!work) return NULL; @@ -9538,7 +9538,7 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode, * needs longer time span. */ if (uring_ctx) { - priv = kmalloc(sizeof(struct btrfs_encoded_read_private), GFP_NOFS); + priv = kmalloc_obj(struct btrfs_encoded_read_private, GFP_NOFS); if (!priv) return -ENOMEM; } else { @@ -9608,7 +9608,7 @@ ssize_t btrfs_encoded_read_regular(struct kiocb *iocb, struct iov_iter *iter, ssize_t ret; nr_pages = DIV_ROUND_UP(disk_io_size, PAGE_SIZE); - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS); + pages = kzalloc_objs(struct page *, nr_pages, GFP_NOFS); if (!pages) return -ENOMEM; ret = btrfs_alloc_page_array(nr_pages, pages, false); @@ -10092,7 +10092,7 @@ static int btrfs_add_swapfile_pin(struct inode *inode, void *ptr, struct rb_node **p; struct rb_node *parent = NULL; - sp = kmalloc(sizeof(*sp), GFP_NOFS); + sp = kmalloc_obj(*sp, GFP_NOFS); if (!sp) return -ENOMEM; sp->ptr = ptr; diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a6cc2d3b414c..af8a9c698b07 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -726,15 +726,15 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir, return -ETXTBSY; } - pending_snapshot = kzalloc(sizeof(*pending_snapshot), GFP_KERNEL); + pending_snapshot = kzalloc_obj(*pending_snapshot, GFP_KERNEL); if (!pending_snapshot) return -ENOMEM; ret = get_anon_bdev(&pending_snapshot->anon_dev); if (ret < 0) goto free_pending; - pending_snapshot->root_item = kzalloc(sizeof(struct btrfs_root_item), - GFP_KERNEL); + pending_snapshot->root_item = kzalloc_obj(struct btrfs_root_item, + GFP_KERNEL); pending_snapshot->path = btrfs_alloc_path(); if (!pending_snapshot->root_item || !pending_snapshot->path) { ret = -ENOMEM; @@ -1958,7 +1958,7 @@ static int btrfs_ioctl_get_subvol_info(struct inode *inode, void __user *argp) if (!path) return -ENOMEM; - subvol_info = kzalloc(sizeof(*subvol_info), GFP_KERNEL); + subvol_info = kzalloc_obj(*subvol_info, GFP_KERNEL); if (!subvol_info) { btrfs_free_path(path); return -ENOMEM; @@ -3423,7 +3423,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) goto out_unlock; } - bctl = kzalloc(sizeof(*bctl), GFP_KERNEL); + bctl = kzalloc_obj(*bctl, GFP_KERNEL); if (!bctl) { ret = -ENOMEM; goto out_unlock; @@ -3604,7 +3604,7 @@ static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) } if (sa->assign) { - prealloc = kzalloc(sizeof(*prealloc), GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); if (!prealloc) { ret = -ENOMEM; goto out; @@ -3924,7 +3924,7 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file, if (IS_ERR(args32)) return PTR_ERR(args32); - args64 = kmalloc(sizeof(*args64), GFP_KERNEL); + args64 = kmalloc_obj(*args64, GFP_KERNEL); if (!args64) { ret = -ENOMEM; goto out; @@ -4234,7 +4234,7 @@ static int _btrfs_ioctl_send(struct btrfs_root *root, void __user *argp, bool co ret = copy_from_user(&args32, argp, sizeof(args32)); if (ret) return -EFAULT; - arg = kzalloc(sizeof(*arg), GFP_KERNEL); + arg = kzalloc_obj(*arg, GFP_KERNEL); if (!arg) return -ENOMEM; arg->send_fd = args32.send_fd; @@ -4588,7 +4588,7 @@ static int btrfs_uring_read_extent(struct kiocb *iocb, struct iov_iter *iter, int ret; nr_pages = DIV_ROUND_UP(disk_io_size, PAGE_SIZE); - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS); + pages = kzalloc_objs(struct page *, nr_pages, GFP_NOFS); if (!pages) return -ENOMEM; ret = btrfs_alloc_page_array(nr_pages, pages, 0); @@ -4597,7 +4597,7 @@ static int btrfs_uring_read_extent(struct kiocb *iocb, struct iov_iter *iter, goto out_fail; } - priv = kmalloc(sizeof(*priv), GFP_NOFS); + priv = kmalloc_obj(*priv, GFP_NOFS); if (!priv) { ret = -ENOMEM; goto out_fail; @@ -4682,7 +4682,7 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue } if (!data) { - data = kzalloc(sizeof(*data), GFP_NOFS); + data = kzalloc_obj(*data, GFP_NOFS); if (!data) { ret = -ENOMEM; goto out_acct; @@ -4817,7 +4817,7 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu } if (!data) { - data = kzalloc(sizeof(*data), GFP_NOFS); + data = kzalloc_obj(*data, GFP_NOFS); if (!data) { ret = -ENOMEM; goto out_acct; diff --git a/fs/btrfs/lru_cache.c b/fs/btrfs/lru_cache.c index fd88af17d8d9..f5a053b905e1 100644 --- a/fs/btrfs/lru_cache.c +++ b/fs/btrfs/lru_cache.c @@ -111,7 +111,7 @@ int btrfs_lru_cache_store(struct btrfs_lru_cache *cache, struct list_head *head; int ret; - head = kmalloc(sizeof(*head), gfp); + head = kmalloc_obj(*head, gfp); if (!head) return -ENOMEM; diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index 8e20497afffe..e37d986f26be 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -88,7 +88,7 @@ struct list_head *lzo_alloc_workspace(struct btrfs_fs_info *fs_info) { struct workspace *workspace; - workspace = kzalloc(sizeof(*workspace), GFP_KERNEL); + workspace = kzalloc_obj(*workspace, GFP_KERNEL); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 38adadb936dc..6bd8739097d3 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -495,7 +495,7 @@ int btrfs_read_qgroup_config(struct btrfs_fs_info *fs_info) struct btrfs_qgroup *prealloc; struct btrfs_root *tree_root = fs_info->tree_root; - prealloc = kzalloc(sizeof(*prealloc), GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); if (!prealloc) { ret = -ENOMEM; goto out; @@ -585,7 +585,7 @@ next1: goto next2; } - list = kzalloc(sizeof(*list), GFP_KERNEL); + list = kzalloc_obj(*list, GFP_KERNEL); if (!list) { ret = -ENOMEM; goto out; @@ -1140,7 +1140,7 @@ int btrfs_quota_enable(struct btrfs_fs_info *fs_info, /* We should not have a stray @prealloc pointer. */ ASSERT(prealloc == NULL); - prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS); + prealloc = kzalloc_obj(*prealloc, GFP_NOFS); if (unlikely(!prealloc)) { ret = -ENOMEM; btrfs_abort_transaction(trans, ret); @@ -1197,7 +1197,7 @@ out_add_root: } ASSERT(prealloc == NULL); - prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS); + prealloc = kzalloc_obj(*prealloc, GFP_NOFS); if (!prealloc) { ret = -ENOMEM; goto out_free_path; @@ -1693,7 +1693,7 @@ int btrfs_create_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid) goto out; } - prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS); + prealloc = kzalloc_obj(*prealloc, GFP_NOFS); if (!prealloc) { ret = -ENOMEM; goto out; @@ -2147,7 +2147,7 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr, if (!btrfs_qgroup_full_accounting(fs_info) || bytenr == 0 || num_bytes == 0) return 0; - record = kzalloc(sizeof(*record), GFP_NOFS); + record = kzalloc_obj(*record, GFP_NOFS); if (!record) return -ENOMEM; @@ -3346,7 +3346,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid, if (!btrfs_qgroup_enabled(fs_info)) return 0; - prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS); + prealloc = kzalloc_obj(*prealloc, GFP_NOFS); if (!prealloc) return -ENOMEM; @@ -3428,16 +3428,15 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid, } ret = 0; - qlist_prealloc = kcalloc(inherit->num_qgroups, - sizeof(struct btrfs_qgroup_list *), - GFP_NOFS); + qlist_prealloc = kzalloc_objs(struct btrfs_qgroup_list *, + inherit->num_qgroups, GFP_NOFS); if (!qlist_prealloc) { ret = -ENOMEM; goto out; } for (int i = 0; i < inherit->num_qgroups; i++) { - qlist_prealloc[i] = kzalloc(sizeof(struct btrfs_qgroup_list), - GFP_NOFS); + qlist_prealloc[i] = kzalloc_obj(struct btrfs_qgroup_list, + GFP_NOFS); if (!qlist_prealloc[i]) { ret = -ENOMEM; goto out; @@ -4753,7 +4752,7 @@ int btrfs_qgroup_add_swapped_blocks(struct btrfs_root *subvol_root, return -EUCLEAN; } - block = kmalloc(sizeof(*block), GFP_NOFS); + block = kmalloc_obj(*block, GFP_NOFS); if (!block) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index baadaaa189c0..8112122c13e6 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -208,7 +208,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info) * Try harder to allocate and fallback to vmalloc to lower the chance * of a failing mount. */ - table = kvzalloc(struct_size(table, table, num_entries), GFP_KERNEL); + table = kvzalloc_flex(*table, table, num_entries, GFP_KERNEL); if (!table) return -ENOMEM; @@ -1090,13 +1090,15 @@ static struct btrfs_raid_bio *alloc_rbio(struct btrfs_fs_info *fs_info, ASSERT(real_stripes >= 2); ASSERT(real_stripes <= U8_MAX); - rbio = kzalloc(sizeof(*rbio), GFP_NOFS); + rbio = kzalloc_obj(*rbio, GFP_NOFS); if (!rbio) return ERR_PTR(-ENOMEM); - rbio->stripe_pages = kcalloc(num_pages, sizeof(struct page *), - GFP_NOFS); - rbio->bio_paddrs = kcalloc(num_sectors * sector_nsteps, sizeof(phys_addr_t), GFP_NOFS); - rbio->stripe_paddrs = kcalloc(num_sectors * sector_nsteps, sizeof(phys_addr_t), GFP_NOFS); + rbio->stripe_pages = kzalloc_objs(struct page *, num_pages, GFP_NOFS); + rbio->bio_paddrs = kzalloc_objs(phys_addr_t, + num_sectors * sector_nsteps, GFP_NOFS); + rbio->stripe_paddrs = kzalloc_objs(phys_addr_t, + num_sectors * sector_nsteps, + GFP_NOFS); rbio->finish_pointers = kcalloc(real_stripes, sizeof(void *), GFP_NOFS); rbio->error_bitmap = bitmap_zalloc(num_sectors, GFP_NOFS); rbio->stripe_uptodate_bitmap = bitmap_zalloc(num_sectors, GFP_NOFS); diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index e9224145d754..f78369ff2a66 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -249,8 +249,8 @@ static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info, struct block_entry *be = NULL, *exist; struct root_entry *re = NULL; - re = kzalloc(sizeof(struct root_entry), GFP_NOFS); - be = kzalloc(sizeof(struct block_entry), GFP_NOFS); + re = kzalloc_obj(struct root_entry, GFP_NOFS); + be = kzalloc_obj(struct block_entry, GFP_NOFS); if (!be || !re) { kfree(re); kfree(be); @@ -298,7 +298,7 @@ static int add_tree_block(struct btrfs_fs_info *fs_info, u64 ref_root, struct root_entry *re; struct ref_entry *ref = NULL, *exist; - ref = kmalloc(sizeof(struct ref_entry), GFP_NOFS); + ref = kmalloc_obj(struct ref_entry, GFP_NOFS); if (!ref) return -ENOMEM; @@ -343,7 +343,7 @@ static int add_shared_data_ref(struct btrfs_fs_info *fs_info, struct block_entry *be; struct ref_entry *ref; - ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); + ref = kzalloc_obj(struct ref_entry, GFP_NOFS); if (!ref) return -ENOMEM; be = add_block_entry(fs_info, bytenr, num_bytes, 0); @@ -378,7 +378,7 @@ static int add_extent_data_ref(struct btrfs_fs_info *fs_info, u64 offset = btrfs_extent_data_ref_offset(leaf, dref); u32 num_refs = btrfs_extent_data_ref_count(leaf, dref); - ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); + ref = kzalloc_obj(struct ref_entry, GFP_NOFS); if (!ref) return -ENOMEM; be = add_block_entry(fs_info, bytenr, num_bytes, ref_root); @@ -680,8 +680,8 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, } metadata = owner < BTRFS_FIRST_FREE_OBJECTID; - ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); - ra = kmalloc(sizeof(struct ref_action), GFP_NOFS); + ref = kzalloc_obj(struct ref_entry, GFP_NOFS); + ra = kmalloc_obj(struct ref_action, GFP_NOFS); if (!ra || !ref) { kfree(ref); kfree(ra); @@ -755,7 +755,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, struct root_entry *tmp; if (!parent) { - re = kmalloc(sizeof(struct root_entry), GFP_NOFS); + re = kmalloc_obj(struct root_entry, GFP_NOFS); if (!re) { kfree(ref); kfree(ra); diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index fcd0a2ba3554..95db7c48fbad 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -483,7 +483,7 @@ static int __add_reloc_root(struct btrfs_root *root) struct mapping_node *node; struct reloc_control *rc = fs_info->reloc_ctl; - node = kmalloc(sizeof(*node), GFP_NOFS); + node = kmalloc_obj(*node, GFP_NOFS); if (!node) return -ENOMEM; @@ -3115,7 +3115,7 @@ static int add_tree_block(struct reloc_control *rc, BUG_ON(level == -1); - block = kmalloc(sizeof(*block), GFP_NOFS); + block = kmalloc_obj(*block, GFP_NOFS); if (!block) return -ENOMEM; @@ -3813,7 +3813,7 @@ static struct reloc_control *alloc_reloc_control(struct btrfs_fs_info *fs_info) { struct reloc_control *rc; - rc = kzalloc(sizeof(*rc), GFP_NOFS); + rc = kzalloc_obj(*rc, GFP_NOFS); if (!rc) return NULL; @@ -4042,7 +4042,7 @@ static int copy_remapped_data(struct btrfs_fs_info *fs_info, u64 old_addr, struct reloc_io_private priv; unsigned int nr_pages = DIV_ROUND_UP(length, PAGE_SIZE); - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS); + pages = kzalloc_objs(struct page *, nr_pages, GFP_NOFS); if (!pages) return -ENOMEM; diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 2a64e2d50ced..dfed8eaf938e 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -373,9 +373,8 @@ static int init_scrub_stripe(struct btrfs_fs_info *fs_info, if (ret < 0) goto error; - stripe->sectors = kcalloc(stripe->nr_sectors, - sizeof(struct scrub_sector_verification), - GFP_KERNEL); + stripe->sectors = kzalloc_objs(struct scrub_sector_verification, + stripe->nr_sectors, GFP_KERNEL); if (!stripe->sectors) goto error; @@ -456,7 +455,7 @@ static noinline_for_stack struct scrub_ctx *scrub_setup_ctx( /* Since sctx has inline 128 stripes, it can go beyond 64K easily. Use * kvzalloc(). */ - sctx = kvzalloc(sizeof(*sctx), GFP_KERNEL); + sctx = kvzalloc_obj(*sctx, GFP_KERNEL); if (!sctx) goto nomem; refcount_set(&sctx->refs, 1); @@ -2474,9 +2473,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, if (profile & BTRFS_BLOCK_GROUP_RAID56_MASK) { ASSERT(sctx->raid56_data_stripes == NULL); - sctx->raid56_data_stripes = kcalloc(nr_data_stripes(map), - sizeof(struct scrub_stripe), - GFP_KERNEL); + sctx->raid56_data_stripes = kzalloc_objs(struct scrub_stripe, + nr_data_stripes(map), + GFP_KERNEL); if (!sctx->raid56_data_stripes) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 3dcfdba018b5..23b0b06ac71c 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -450,7 +450,7 @@ static struct fs_path *fs_path_alloc(void) { struct fs_path *p; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return NULL; init_path(p); @@ -1429,7 +1429,7 @@ static void store_backref_cache(u64 leaf_bytenr, const struct ulist *root_ids, * fs_info->commit_root_sem (at iterate_extent_inodes()), so must do a * NOFS allocation. */ - new_entry = kmalloc(sizeof(struct backref_cache_entry), GFP_NOFS); + new_entry = kmalloc_obj(struct backref_cache_entry, GFP_NOFS); /* No worries, cache is optional. */ if (!new_entry) return; @@ -2743,7 +2743,7 @@ static int cache_dir_utimes(struct send_ctx *sctx, u64 dir, u64 gen) return 0; /* Caching is optional, don't fail if we can't allocate memory. */ - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return send_utimes(sctx, dir, gen); @@ -2870,7 +2870,7 @@ static void cache_dir_created(struct send_ctx *sctx, u64 dir) int ret; /* Caching is optional, ignore any failures. */ - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return; @@ -2974,7 +2974,7 @@ static struct recorded_ref *recorded_ref_alloc(void) { struct recorded_ref *ref; - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) return NULL; RB_CLEAR_NODE(&ref->node); @@ -3083,7 +3083,7 @@ static struct orphan_dir_info *add_orphan_dir_info(struct send_ctx *sctx, return entry; } - odi = kmalloc(sizeof(*odi), GFP_KERNEL); + odi = kmalloc_obj(*odi, GFP_KERNEL); if (!odi) return ERR_PTR(-ENOMEM); odi->ino = dir_ino; @@ -3284,7 +3284,7 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino, bool orphanized) struct rb_node *parent = NULL; struct waiting_dir_move *entry, *dm; - dm = kmalloc(sizeof(*dm), GFP_KERNEL); + dm = kmalloc_obj(*dm, GFP_KERNEL); if (!dm) return -ENOMEM; dm->ino = ino; @@ -3352,7 +3352,7 @@ static int add_pending_dir_move(struct send_ctx *sctx, int exists = 0; int ret; - pm = kmalloc(sizeof(*pm), GFP_KERNEL); + pm = kmalloc_obj(*pm, GFP_KERNEL); if (!pm) return -ENOMEM; pm->parent_ino = parent_ino; @@ -8035,7 +8035,7 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen goto out; } - sctx = kzalloc(sizeof(struct send_ctx), GFP_KERNEL); + sctx = kzalloc_obj(struct send_ctx, GFP_KERNEL); if (!sctx) { ret = -ENOMEM; goto out; @@ -8097,9 +8097,9 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen goto out; } send_buf_num_pages = sctx->send_max_size >> PAGE_SHIFT; - sctx->send_buf_pages = kcalloc(send_buf_num_pages, - sizeof(*sctx->send_buf_pages), - GFP_KERNEL); + sctx->send_buf_pages = kzalloc_objs(*sctx->send_buf_pages, + send_buf_num_pages, + GFP_KERNEL); if (!sctx->send_buf_pages) { ret = -ENOMEM; goto out; @@ -8117,9 +8117,9 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen goto out; } - sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1, - sizeof(*sctx->clone_roots), - GFP_KERNEL); + sctx->clone_roots = kvzalloc_objs(*sctx->clone_roots, + arg->clone_sources_count + 1, + GFP_KERNEL); if (!sctx->clone_roots) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index bb5aac7ee9d2..52a267a5dd80 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -266,7 +266,7 @@ static int create_space_info_sub_group(struct btrfs_space_info *parent, u64 flag "parent->subgroup_id=%d", parent->subgroup_id); ASSERT(id != BTRFS_SUB_GROUP_PRIMARY, "id=%d", id); - sub_group = kzalloc(sizeof(*sub_group), GFP_NOFS); + sub_group = kzalloc_obj(*sub_group, GFP_NOFS); if (!sub_group) return -ENOMEM; @@ -289,7 +289,7 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags) struct btrfs_space_info *space_info; int ret = 0; - space_info = kzalloc(sizeof(*space_info), GFP_NOFS); + space_info = kzalloc_obj(*space_info, GFP_NOFS); if (!space_info) return -ENOMEM; diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index d64d303b6edc..3f9523563259 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2054,7 +2054,7 @@ static int btrfs_get_tree_subvol(struct fs_context *fc) * of the fs_info (locks and such) to make cleanup easier if we find a * superblock with our given fs_devices later on at sget() time. */ - fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL); + fs_info = kvzalloc_obj(struct btrfs_fs_info, GFP_KERNEL); if (!fs_info) return -ENOMEM; @@ -2173,7 +2173,7 @@ static int btrfs_init_fs_context(struct fs_context *fc) { struct btrfs_fs_context *ctx; - ctx = kzalloc(sizeof(struct btrfs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct btrfs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 27bfb7b55ec4..f62278f0c191 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1833,7 +1833,7 @@ void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache) */ nofs_flag = memalloc_nofs_save(); - rkobj = kzalloc(sizeof(*rkobj), GFP_NOFS); + rkobj = kzalloc_obj(*rkobj, GFP_NOFS); if (!rkobj) { memalloc_nofs_restore(nofs_flag); btrfs_warn(cache->fs_info, @@ -2597,7 +2597,7 @@ int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info) if (fs_info->qgroups_kobj) return 0; - fs_info->qgroups_kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL); + fs_info->qgroups_kobj = kzalloc_obj(struct kobject, GFP_KERNEL); if (!fs_info->qgroups_kobj) return -ENOMEM; diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index 7f13c05d3736..c5b1bc0f7f91 100644 --- a/fs/btrfs/tests/btrfs-tests.c +++ b/fs/btrfs/tests/btrfs-tests.c @@ -98,7 +98,7 @@ struct btrfs_device *btrfs_alloc_dummy_device(struct btrfs_fs_info *fs_info) { struct btrfs_device *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); @@ -117,21 +117,19 @@ static void btrfs_free_dummy_device(struct btrfs_device *dev) struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize) { - struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), - GFP_KERNEL); + struct btrfs_fs_info *fs_info = kzalloc_obj(struct btrfs_fs_info, + GFP_KERNEL); if (!fs_info) return fs_info; - fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), - GFP_KERNEL); + fs_info->fs_devices = kzalloc_obj(struct btrfs_fs_devices, GFP_KERNEL); if (!fs_info->fs_devices) { kfree(fs_info); return NULL; } INIT_LIST_HEAD(&fs_info->fs_devices->devices); - fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), - GFP_KERNEL); + fs_info->super_copy = kzalloc_obj(struct btrfs_super_block, GFP_KERNEL); if (!fs_info->super_copy) { kfree(fs_info->fs_devices); kfree(fs_info); @@ -208,11 +206,10 @@ btrfs_alloc_dummy_block_group(struct btrfs_fs_info *fs_info, { struct btrfs_block_group *cache; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); if (!cache) return NULL; - cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), - GFP_KERNEL); + cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl, GFP_KERNEL); if (!cache->free_space_ctl) { kfree(cache); return NULL; diff --git a/fs/btrfs/tests/delayed-refs-tests.c b/fs/btrfs/tests/delayed-refs-tests.c index e2248acb906b..fdc183ebc6da 100644 --- a/fs/btrfs/tests/delayed-refs-tests.c +++ b/fs/btrfs/tests/delayed-refs-tests.c @@ -985,7 +985,7 @@ int btrfs_test_delayed_refs(u32 sectorsize, u32 nodesize) test_std_err(TEST_ALLOC_FS_INFO); return -ENOMEM; } - transaction = kmalloc(sizeof(*transaction), GFP_KERNEL); + transaction = kmalloc_obj(*transaction, GFP_KERNEL); if (!transaction) { test_std_err(TEST_ALLOC_TRANSACTION); ret = -ENOMEM; diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 463238ca8a4d..7ef8c9b7dfc1 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -315,7 +315,7 @@ loop: */ BUG_ON(type == TRANS_JOIN_NOLOCK); - cur_trans = kmalloc(sizeof(*cur_trans), GFP_NOFS); + cur_trans = kmalloc_obj(*cur_trans, GFP_NOFS); if (!cur_trans) return -ENOMEM; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index e1bd03ebfd98..780a06d59240 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5928,7 +5928,7 @@ again: if (ret) goto out; if (ctx->log_new_dentries) { - dir_elem = kmalloc(sizeof(*dir_elem), GFP_NOFS); + dir_elem = kmalloc_obj(*dir_elem, GFP_NOFS); if (!dir_elem) { ret = -ENOMEM; goto out; @@ -6122,7 +6122,7 @@ static int add_conflicting_inode(struct btrfs_trans_handle *trans, return ret; /* Conflicting inode is a directory, so we'll log its parent. */ - ino_elem = kmalloc(sizeof(*ino_elem), GFP_NOFS); + ino_elem = kmalloc_obj(*ino_elem, GFP_NOFS); if (!ino_elem) return -ENOMEM; ino_elem->ino = ino; @@ -6180,7 +6180,7 @@ static int add_conflicting_inode(struct btrfs_trans_handle *trans, btrfs_add_delayed_iput(inode); - ino_elem = kmalloc(sizeof(*ino_elem), GFP_NOFS); + ino_elem = kmalloc_obj(*ino_elem, GFP_NOFS); if (!ino_elem) return -ENOMEM; ino_elem->ino = ino; diff --git a/fs/btrfs/tree-mod-log.c b/fs/btrfs/tree-mod-log.c index 9e8cb3b7c064..603c1457130e 100644 --- a/fs/btrfs/tree-mod-log.c +++ b/fs/btrfs/tree-mod-log.c @@ -243,7 +243,7 @@ static struct tree_mod_elem *alloc_tree_mod_elem(const struct extent_buffer *eb, ASSERT(op != BTRFS_MOD_LOG_MOVE_KEYS); ASSERT(op != BTRFS_MOD_LOG_ROOT_REPLACE); - tm = kzalloc(sizeof(*tm), GFP_NOFS); + tm = kzalloc_obj(*tm, GFP_NOFS); if (!tm) return NULL; @@ -301,7 +301,7 @@ static struct tree_mod_elem *tree_mod_log_alloc_move(const struct extent_buffer { struct tree_mod_elem *tm; - tm = kzalloc(sizeof(*tm), GFP_NOFS); + tm = kzalloc_obj(*tm, GFP_NOFS); if (!tm) return ERR_PTR(-ENOMEM); @@ -328,7 +328,7 @@ int btrfs_tree_mod_log_insert_move(const struct extent_buffer *eb, if (!tree_mod_need_log(eb->fs_info, eb)) return 0; - tm_list = kcalloc(nr_items, sizeof(struct tree_mod_elem *), GFP_NOFS); + tm_list = kzalloc_objs(struct tree_mod_elem *, nr_items, GFP_NOFS); if (!tm_list) { ret = -ENOMEM; goto lock; @@ -439,8 +439,8 @@ int btrfs_tree_mod_log_insert_root(struct extent_buffer *old_root, if (log_removal && btrfs_header_level(old_root) > 0) { nritems = btrfs_header_nritems(old_root); - tm_list = kcalloc(nritems, sizeof(struct tree_mod_elem *), - GFP_NOFS); + tm_list = kzalloc_objs(struct tree_mod_elem *, nritems, + GFP_NOFS); if (!tm_list) { ret = -ENOMEM; goto lock; @@ -455,7 +455,7 @@ int btrfs_tree_mod_log_insert_root(struct extent_buffer *old_root, } } - tm = kzalloc(sizeof(*tm), GFP_NOFS); + tm = kzalloc_obj(*tm, GFP_NOFS); if (!tm) { ret = -ENOMEM; goto lock; @@ -595,8 +595,7 @@ int btrfs_tree_mod_log_eb_copy(struct extent_buffer *dst, if (btrfs_header_level(dst) == 0 && btrfs_header_level(src) == 0) return 0; - tm_list = kcalloc(nr_items * 2, sizeof(struct tree_mod_elem *), - GFP_NOFS); + tm_list = kzalloc_objs(struct tree_mod_elem *, nr_items * 2, GFP_NOFS); if (!tm_list) { ret = -ENOMEM; goto lock; @@ -714,7 +713,7 @@ int btrfs_tree_mod_log_free_eb(struct extent_buffer *eb) return 0; nritems = btrfs_header_nritems(eb); - tm_list = kcalloc(nritems, sizeof(struct tree_mod_elem *), GFP_NOFS); + tm_list = kzalloc_objs(struct tree_mod_elem *, nritems, GFP_NOFS); if (!tm_list) { ret = -ENOMEM; goto lock; diff --git a/fs/btrfs/ulist.c b/fs/btrfs/ulist.c index 7e16a253fb35..7898076ce41c 100644 --- a/fs/btrfs/ulist.c +++ b/fs/btrfs/ulist.c @@ -98,7 +98,7 @@ void ulist_reinit(struct ulist *ulist) */ struct ulist *ulist_alloc(gfp_t gfp_mask) { - struct ulist *ulist = kmalloc(sizeof(*ulist), gfp_mask); + struct ulist *ulist = kmalloc_obj(*ulist, gfp_mask); if (!ulist) return NULL; @@ -111,7 +111,7 @@ struct ulist *ulist_alloc(gfp_t gfp_mask) void ulist_prealloc(struct ulist *ulist, gfp_t gfp_mask) { if (!ulist->prealloc) - ulist->prealloc = kzalloc(sizeof(*ulist->prealloc), gfp_mask); + ulist->prealloc = kzalloc_obj(*ulist->prealloc, gfp_mask); } /* @@ -219,7 +219,7 @@ int ulist_add_merge(struct ulist *ulist, u64 val, u64 aux, node = ulist->prealloc; ulist->prealloc = NULL; } else { - node = kmalloc(sizeof(*node), gfp_mask); + node = kmalloc_obj(*node, gfp_mask); if (!node) return -ENOMEM; } diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 50f7aae70418..71ff7006ca6b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -382,7 +382,7 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid) { struct btrfs_fs_devices *fs_devs; - fs_devs = kzalloc(sizeof(*fs_devs), GFP_KERNEL); + fs_devs = kzalloc_obj(*fs_devs, GFP_KERNEL); if (!fs_devs) return ERR_PTR(-ENOMEM); @@ -4456,7 +4456,7 @@ again: if (chunk_type & BTRFS_BLOCK_GROUP_METADATA_REMAP) { mutex_unlock(&fs_info->reclaim_bgs_lock); - rci = kmalloc(sizeof(struct remap_chunk_info), GFP_NOFS); + rci = kmalloc_obj(struct remap_chunk_info, GFP_NOFS); if (!rci) { ret = -ENOMEM; goto error; @@ -5004,7 +5004,7 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info) return 0; } - bctl = kzalloc(sizeof(*bctl), GFP_NOFS); + bctl = kzalloc_obj(*bctl, GFP_NOFS); if (!bctl) return -ENOMEM; @@ -6338,7 +6338,7 @@ struct btrfs_io_context *alloc_btrfs_io_context(struct btrfs_fs_info *fs_info, { struct btrfs_io_context *bioc; - bioc = kzalloc(struct_size(bioc, stripes, total_stripes), GFP_NOFS); + bioc = kzalloc_flex(*bioc, stripes, total_stripes, GFP_NOFS); if (!bioc) return NULL; @@ -6471,7 +6471,7 @@ struct btrfs_discard_stripe *btrfs_map_discard(struct btrfs_fs_info *fs_info, stripe_nr /= map->num_stripes; } - stripes = kcalloc(*num_stripes, sizeof(*stripes), GFP_NOFS); + stripes = kzalloc_objs(*stripes, *num_stripes, GFP_NOFS); if (!stripes) { ret = -ENOMEM; goto out_free_map; @@ -7202,7 +7202,7 @@ struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, if (WARN_ON(!devid && !fs_info)) return ERR_PTR(-EINVAL); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 0a8fcee16428..5a0913a31991 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -75,7 +75,7 @@ struct list_head *zlib_alloc_workspace(struct btrfs_fs_info *fs_info, unsigned i struct workspace *workspace; int workspacesize; - workspace = kzalloc(sizeof(*workspace), GFP_KERNEL); + workspace = kzalloc_obj(*workspace, GFP_KERNEL); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index ad8621587fd2..fcdfb831b484 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -377,7 +377,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) if (device->zone_info) return 0; - zone_info = kzalloc(sizeof(*zone_info), GFP_KERNEL); + zone_info = kzalloc_obj(*zone_info, GFP_KERNEL); if (!zone_info) return -ENOMEM; @@ -454,7 +454,8 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) goto out; } - zones = kvcalloc(BTRFS_REPORT_NR_ZONES, sizeof(struct blk_zone), GFP_KERNEL); + zones = kvzalloc_objs(struct blk_zone, BTRFS_REPORT_NR_ZONES, + GFP_KERNEL); if (!zones) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c index 32fd7f5454d3..a7a41dd320d9 100644 --- a/fs/btrfs/zstd.c +++ b/fs/btrfs/zstd.c @@ -185,7 +185,7 @@ int zstd_alloc_workspace_manager(struct btrfs_fs_info *fs_info) struct list_head *ws; ASSERT(fs_info->compr_wsm[BTRFS_COMPRESS_ZSTD] == NULL); - zwsm = kzalloc(sizeof(*zwsm), GFP_KERNEL); + zwsm = kzalloc_obj(*zwsm, GFP_KERNEL); if (!zwsm) return -ENOMEM; zstd_calc_ws_mem_sizes(); @@ -373,7 +373,7 @@ struct list_head *zstd_alloc_workspace(struct btrfs_fs_info *fs_info, int level) const u32 blocksize = fs_info->sectorsize; struct workspace *workspace; - workspace = kzalloc(sizeof(*workspace), GFP_KERNEL); + workspace = kzalloc_obj(*workspace, GFP_KERNEL); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/buffer.c b/fs/buffer.c index ed724a902657..22b43642ba57 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -358,8 +358,7 @@ static void end_buffer_async_read_io(struct buffer_head *bh, int uptodate) /* Decrypt (with fscrypt) and/or verify (with fsverity) if needed. */ if (uptodate && (decrypt || vi)) { - struct postprocess_bh_ctx *ctx = - kmalloc(sizeof(*ctx), GFP_ATOMIC); + struct postprocess_bh_ctx *ctx = kmalloc_obj(*ctx, GFP_ATOMIC); if (ctx) { ctx->bh = bh; diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c index 1806bff8e59b..99795864bcb3 100644 --- a/fs/cachefiles/daemon.c +++ b/fs/cachefiles/daemon.c @@ -102,7 +102,7 @@ static int cachefiles_daemon_open(struct inode *inode, struct file *file) return -EBUSY; /* allocate a cache record */ - cache = kzalloc(sizeof(struct cachefiles_cache), GFP_KERNEL); + cache = kzalloc_obj(struct cachefiles_cache, GFP_KERNEL); if (!cache) { cachefiles_open = 0; return -ENOMEM; diff --git a/fs/cachefiles/io.c b/fs/cachefiles/io.c index 3e0576d9db1d..7b9d547ecee6 100644 --- a/fs/cachefiles/io.c +++ b/fs/cachefiles/io.c @@ -132,7 +132,7 @@ static int cachefiles_read(struct netfs_cache_resources *cres, } ret = -ENOMEM; - ki = kzalloc(sizeof(struct cachefiles_kiocb), GFP_KERNEL); + ki = kzalloc_obj(struct cachefiles_kiocb, GFP_KERNEL); if (!ki) goto presubmission_error; @@ -298,7 +298,7 @@ int __cachefiles_write(struct cachefiles_object *object, file, file_inode(file)->i_ino, start_pos, len, i_size_read(file_inode(file))); - ki = kzalloc(sizeof(struct cachefiles_kiocb), GFP_KERNEL); + ki = kzalloc_obj(struct cachefiles_kiocb, GFP_KERNEL); if (!ki) { if (term_func) term_func(term_func_priv, -ENOMEM); diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c index a7ed86fa98bb..b251fff2bed0 100644 --- a/fs/cachefiles/ondemand.c +++ b/fs/cachefiles/ondemand.c @@ -734,8 +734,8 @@ int cachefiles_ondemand_init_obj_info(struct cachefiles_object *object, if (!cachefiles_in_ondemand_mode(volume->cache)) return 0; - object->ondemand = kzalloc(sizeof(struct cachefiles_ondemand_info), - GFP_KERNEL); + object->ondemand = kzalloc_obj(struct cachefiles_ondemand_info, + GFP_KERNEL); if (!object->ondemand) return -ENOMEM; diff --git a/fs/cachefiles/volume.c b/fs/cachefiles/volume.c index 90ba926f488e..655de0cef530 100644 --- a/fs/cachefiles/volume.c +++ b/fs/cachefiles/volume.c @@ -28,7 +28,7 @@ void cachefiles_acquire_volume(struct fscache_volume *vcookie) _enter(""); - volume = kzalloc(sizeof(struct cachefiles_volume), GFP_KERNEL); + volume = kzalloc_obj(struct cachefiles_volume, GFP_KERNEL); if (!volume) return; volume->vcookie = vcookie; diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index ce09ff3e020f..e87b3bb94ee8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -470,7 +470,7 @@ static int ceph_init_request(struct netfs_io_request *rreq, struct file *file) if (rreq->origin != NETFS_READAHEAD) return 0; - priv = kzalloc(sizeof(*priv), GFP_NOFS); + priv = kzalloc_obj(*priv, GFP_NOFS); if (!priv) return -ENOMEM; @@ -1186,9 +1186,7 @@ static inline void __ceph_allocate_page_array(struct ceph_writeback_ctl *ceph_wbc, unsigned int max_pages) { - ceph_wbc->pages = kmalloc_array(max_pages, - sizeof(*ceph_wbc->pages), - GFP_NOFS); + ceph_wbc->pages = kmalloc_objs(*ceph_wbc->pages, max_pages, GFP_NOFS); if (!ceph_wbc->pages) { ceph_wbc->from_pool = true; ceph_wbc->pages = mempool_alloc(ceph_wb_pagevec_pool, GFP_NOFS); @@ -2506,7 +2504,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, } pool_ns_len = pool_ns ? pool_ns->len : 0; - perm = kmalloc(struct_size(perm, pool_ns, pool_ns_len + 1), GFP_NOFS); + perm = kmalloc_flex(*perm, pool_ns, pool_ns_len + 1, GFP_NOFS); if (!perm) { err = -ENOMEM; goto out_unlock; diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 2f663972da99..5d7c2ffae8fa 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2395,7 +2395,7 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode) mutex_lock(&mdsc->mutex); max_sessions = mdsc->max_sessions; - sessions = kcalloc(max_sessions, sizeof(s), GFP_KERNEL); + sessions = kzalloc_objs(s, max_sessions, GFP_KERNEL); if (!sessions) { mutex_unlock(&mdsc->mutex); err = -ENOMEM; diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c index 9a115282f67d..643c8ba28ae7 100644 --- a/fs/ceph/crypto.c +++ b/fs/ceph/crypto.c @@ -50,7 +50,7 @@ static int ceph_crypt_set_context(struct inode *inode, const void *ctx, if (len > FSCRYPT_SET_CONTEXT_MAX_SIZE) return -EINVAL; - cfa = kzalloc(sizeof(*cfa), GFP_KERNEL); + cfa = kzalloc_obj(*cfa, GFP_KERNEL); if (!cfa) return -ENOMEM; @@ -112,7 +112,7 @@ int ceph_fscrypt_prepare_context(struct inode *dir, struct inode *inode, if (!encrypted) return 0; - as->fscrypt_auth = kzalloc(sizeof(*as->fscrypt_auth), GFP_KERNEL); + as->fscrypt_auth = kzalloc_obj(*as->fscrypt_auth, GFP_KERNEL); if (!as->fscrypt_auth) return -ENOMEM; diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 72cc67ab4ead..fdbf4aeaa408 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -140,7 +140,7 @@ static ssize_t iter_get_bvecs_alloc(struct iov_iter *iter, size_t maxsize, * __iter_get_bvecs() may populate only part of the array -- zero it * out. */ - bv = kvmalloc_array(npages, sizeof(*bv), GFP_KERNEL | __GFP_ZERO); + bv = kvmalloc_objs(*bv, npages, GFP_KERNEL | __GFP_ZERO); if (!bv) return -ENOMEM; @@ -1344,7 +1344,7 @@ static void ceph_aio_complete_req(struct ceph_osd_request *req) struct ceph_aio_work *aio_work; BUG_ON(!aio_req->write); - aio_work = kmalloc(sizeof(*aio_work), GFP_NOFS); + aio_work = kmalloc_obj(*aio_work, GFP_NOFS); if (aio_work) { INIT_WORK(&aio_work->work, ceph_aio_retry_work); aio_work->req = req; @@ -1572,7 +1572,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, */ if (pos == iocb->ki_pos && !is_sync_kiocb(iocb) && (len == count || pos + count <= i_size_read(inode))) { - aio_req = kzalloc(sizeof(*aio_req), GFP_KERNEL); + aio_req = kzalloc_obj(*aio_req, GFP_KERNEL); if (aio_req) { aio_req->iocb = iocb; aio_req->write = write; diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 2966f88310e3..d76f9a79dc0c 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -321,7 +321,7 @@ static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci, return frag; } - frag = kmalloc(sizeof(*frag), GFP_NOFS); + frag = kmalloc_obj(*frag, GFP_NOFS); if (!frag) return ERR_PTR(-ENOMEM); diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index c45bd19d4b1c..8933f05f5144 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -973,7 +973,7 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, if (mds >= mdsc->mdsmap->possible_max_rank) return ERR_PTR(-EINVAL); - s = kzalloc(sizeof(*s), GFP_NOFS); + s = kzalloc_obj(*s, GFP_NOFS); if (!s) return ERR_PTR(-ENOMEM); @@ -4230,9 +4230,8 @@ static void handle_session(struct ceph_mds_session *session, goto skip_cap_auths; } - cap_auths = kcalloc(cap_auths_num, - sizeof(struct ceph_mds_cap_auth), - GFP_KERNEL); + cap_auths = kzalloc_objs(struct ceph_mds_cap_auth, + cap_auths_num, GFP_KERNEL); if (!cap_auths) { pr_err_client(cl, "No memory for cap_auths\n"); return; @@ -4731,9 +4730,9 @@ encode_again: num_flock_locks = 0; } if (num_fcntl_locks + num_flock_locks > 0) { - flocks = kmalloc_array(num_fcntl_locks + num_flock_locks, - sizeof(struct ceph_filelock), - GFP_NOFS); + flocks = kmalloc_objs(struct ceph_filelock, + num_fcntl_locks + num_flock_locks, + GFP_NOFS); if (!flocks) { err = -ENOMEM; goto out_err; @@ -5534,12 +5533,12 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc) struct ceph_mds_client *mdsc; int err; - mdsc = kzalloc(sizeof(struct ceph_mds_client), GFP_NOFS); + mdsc = kzalloc_obj(struct ceph_mds_client, GFP_NOFS); if (!mdsc) return -ENOMEM; mdsc->fsc = fsc; mutex_init(&mdsc->mutex); - mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS); + mdsc->mdsmap = kzalloc_obj(*mdsc->mdsmap, GFP_NOFS); if (!mdsc->mdsmap) { err = -ENOMEM; goto err_mdsc; diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c index b228e5ecfb92..d8e46eb7e5eb 100644 --- a/fs/ceph/mdsmap.c +++ b/fs/ceph/mdsmap.c @@ -127,7 +127,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p, u16 mdsmap_ev; u32 target; - m = kzalloc(sizeof(*m), GFP_NOFS); + m = kzalloc_obj(*m, GFP_NOFS); if (!m) return ERR_PTR(-ENOMEM); @@ -169,7 +169,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p, */ m->possible_max_rank = max(m->m_num_active_mds, m->m_max_mds); - m->m_info = kcalloc(m->possible_max_rank, sizeof(*m->m_info), GFP_NOFS); + m->m_info = kzalloc_objs(*m->m_info, m->possible_max_rank, GFP_NOFS); if (!m->m_info) goto nomem; diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c index d90eda19bcc4..514da29469b8 100644 --- a/fs/ceph/quota.c +++ b/fs/ceph/quota.c @@ -103,7 +103,7 @@ find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino) } if (!qri || (qri->ino != ino)) { /* Not found, create a new one and insert it */ - qri = kmalloc(sizeof(*qri), GFP_KERNEL); + qri = kmalloc_obj(*qri, GFP_KERNEL); if (qri) { qri->ino = ino; qri->inode = NULL; diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 521507ea8260..52b4c2684f92 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -118,7 +118,7 @@ static struct ceph_snap_realm *ceph_create_snap_realm( lockdep_assert_held_write(&mdsc->snap_rwsem); - realm = kzalloc(sizeof(*realm), GFP_NOFS); + realm = kzalloc_obj(*realm, GFP_NOFS); if (!realm) return ERR_PTR(-ENOMEM); @@ -1216,7 +1216,7 @@ struct ceph_snapid_map* ceph_get_snapid_map(struct ceph_mds_client *mdsc, return exist; } - sm = kmalloc(sizeof(*sm), GFP_NOFS); + sm = kmalloc_obj(*sm, GFP_NOFS); if (!sm) return NULL; diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 7c1c1dac320d..57320e830eda 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -809,7 +809,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, struct ceph_fs_client *fsc; int err; - fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); + fsc = kzalloc_obj(*fsc, GFP_KERNEL); if (!fsc) { err = -ENOMEM; goto fail; @@ -1429,7 +1429,7 @@ static int ceph_init_fs_context(struct fs_context *fc) struct ceph_parse_opts_ctx *pctx; struct ceph_mount_options *fsopt; - pctx = kzalloc(sizeof(*pctx), GFP_KERNEL); + pctx = kzalloc_obj(*pctx, GFP_KERNEL); if (!pctx) return -ENOMEM; @@ -1437,7 +1437,7 @@ static int ceph_init_fs_context(struct fs_context *fc) if (!pctx->copts) goto nomem; - pctx->opts = kzalloc(sizeof(*pctx->opts), GFP_KERNEL); + pctx->opts = kzalloc_obj(*pctx->opts, GFP_KERNEL); if (!pctx->opts) goto nomem; diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index ad1f30bea175..5f87f62091a1 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -819,15 +819,15 @@ start: xattr_version = ci->i_xattrs.version; spin_unlock(&ci->i_ceph_lock); - xattrs = kcalloc(numattr, sizeof(struct ceph_inode_xattr *), - GFP_NOFS); + xattrs = kzalloc_objs(struct ceph_inode_xattr *, numattr, + GFP_NOFS); err = -ENOMEM; if (!xattrs) goto bad_lock; for (i = 0; i < numattr; i++) { - xattrs[i] = kmalloc(sizeof(struct ceph_inode_xattr), - GFP_NOFS); + xattrs[i] = kmalloc_obj(struct ceph_inode_xattr, + GFP_NOFS); if (!xattrs[i]) goto bad_lock; } @@ -1220,7 +1220,7 @@ int __ceph_setxattr(struct inode *inode, const char *name, goto out; } - xattr = kmalloc(sizeof(struct ceph_inode_xattr), GFP_NOFS); + xattr = kmalloc_obj(struct ceph_inode_xattr, GFP_NOFS); if (!xattr) goto out; diff --git a/fs/char_dev.c b/fs/char_dev.c index bf7b32650e54..49b2641bbe03 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -115,7 +115,7 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor, return ERR_PTR(-EINVAL); } - cd = kzalloc(sizeof(struct char_device_struct), GFP_KERNEL); + cd = kzalloc_obj(struct char_device_struct, GFP_KERNEL); if (cd == NULL) return ERR_PTR(-ENOMEM); @@ -636,7 +636,7 @@ static struct kobj_type ktype_cdev_dynamic = { */ struct cdev *cdev_alloc(void) { - struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); + struct cdev *p = kzalloc_obj(struct cdev, GFP_KERNEL); if (p) { INIT_LIST_HEAD(&p->list); kobject_init(&p->kobj, &ktype_cdev_dynamic); diff --git a/fs/coda/dir.c b/fs/coda/dir.c index ca9990017265..329cefb16fb5 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -362,7 +362,7 @@ static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx) cii = ITOC(file_inode(coda_file)); - vdir = kmalloc(sizeof(*vdir), GFP_KERNEL); + vdir = kmalloc_obj(*vdir, GFP_KERNEL); if (!vdir) return -ENOMEM; if (!dir_emit_dots(coda_file, ctx)) diff --git a/fs/coda/file.c b/fs/coda/file.c index a390b5d21196..a40ba8d0b14b 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -175,7 +175,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma) if (ret) return ret; - cvm_ops = kmalloc(sizeof(struct coda_vm_ops), GFP_KERNEL); + cvm_ops = kmalloc_obj(struct coda_vm_ops, GFP_KERNEL); if (!cvm_ops) return -ENOMEM; @@ -231,7 +231,7 @@ int coda_open(struct inode *coda_inode, struct file *coda_file) unsigned short coda_flags = coda_flags_to_cflags(flags); struct coda_file_info *cfi; - cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL); + cfi = kmalloc_obj(struct coda_file_info, GFP_KERNEL); if (!cfi) return -ENOMEM; diff --git a/fs/coda/inode.c b/fs/coda/inode.c index 08450d006016..d95ae651f528 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -381,7 +381,7 @@ static int coda_init_fs_context(struct fs_context *fc) { struct coda_fs_context *ctx; - ctx = kzalloc(sizeof(struct coda_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct coda_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index cd6a3721f6f6..0abde29b4f47 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c @@ -724,7 +724,7 @@ static int coda_upcall(struct venus_comm *vcp, } /* Format the request message. */ - req = kmalloc(sizeof(struct upc_req), GFP_KERNEL); + req = kmalloc_obj(struct upc_req, GFP_KERNEL); if (!req) { error = -ENOMEM; goto exit; @@ -788,10 +788,10 @@ static int coda_upcall(struct venus_comm *vcp, } error = -ENOMEM; - sig_req = kmalloc(sizeof(struct upc_req), GFP_KERNEL); + sig_req = kmalloc_obj(struct upc_req, GFP_KERNEL); if (!sig_req) goto exit; - sig_inputArgs = kvzalloc(sizeof(*sig_inputArgs), GFP_KERNEL); + sig_inputArgs = kvzalloc_obj(*sig_inputArgs, GFP_KERNEL); if (!sig_inputArgs) { kfree(sig_req); goto exit; diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index ba95f636a5ab..f437b1ab3b68 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -159,7 +159,7 @@ static struct configfs_fragment *new_fragment(void) { struct configfs_fragment *p; - p = kmalloc(sizeof(struct configfs_fragment), GFP_KERNEL); + p = kmalloc_obj(struct configfs_fragment, GFP_KERNEL); if (p) { atomic_set(&p->frag_count, 1); init_rwsem(&p->frag_sem); @@ -1847,7 +1847,7 @@ configfs_register_default_group(struct config_group *parent_group, int ret; struct config_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return ERR_PTR(-ENOMEM); config_group_init_type_name(group, name, item_type); diff --git a/fs/configfs/file.c b/fs/configfs/file.c index affe4742bbb5..a83d1981e96f 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c @@ -296,7 +296,7 @@ static int __configfs_open_file(struct inode *inode, struct file *file, int type int error; error = -ENOMEM; - buffer = kzalloc(sizeof(struct configfs_buffer), GFP_KERNEL); + buffer = kzalloc_obj(struct configfs_buffer, GFP_KERNEL); if (!buffer) goto out; diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index bcda3372e141..e7d8500fee7d 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -47,7 +47,7 @@ int configfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, sd_iattr = sd->s_iattr; if (!sd_iattr) { /* setting attributes for the first time, allocate now */ - sd_iattr = kzalloc(sizeof(struct iattr), GFP_KERNEL); + sd_iattr = kzalloc_obj(struct iattr, GFP_KERNEL); if (!sd_iattr) return -ENOMEM; /* assign default attributes */ diff --git a/fs/coredump.c b/fs/coredump.c index 4ce7c80b39c8..c5b81cacbabb 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -262,7 +262,7 @@ static bool coredump_parse(struct core_name *cn, struct coredump_params *cprm, switch (cn->core_type) { case COREDUMP_PIPE: { int argvs = sizeof(core_pattern) / 2; - (*argv) = kmalloc_array(argvs, sizeof(**argv), GFP_KERNEL); + (*argv) = kmalloc_objs(**argv, argvs, GFP_KERNEL); if (!(*argv)) return false; (*argv)[(*argc)++] = 0; @@ -1736,7 +1736,8 @@ static bool dump_vma_snapshot(struct coredump_params *cprm) gate_vma = get_gate_vma(mm); cprm->vma_count = mm->map_count + (gate_vma ? 1 : 0); - cprm->vma_meta = kvmalloc_array(cprm->vma_count, sizeof(*cprm->vma_meta), GFP_KERNEL); + cprm->vma_meta = kvmalloc_objs(*cprm->vma_meta, cprm->vma_count, + GFP_KERNEL); if (!cprm->vma_meta) { mmap_write_unlock(mm); return false; diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 41b1a869cf13..10403cb81182 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -619,7 +619,7 @@ static int cramfs_blkdev_fill_super(struct super_block *sb, struct fs_context *f struct cramfs_super super; int i, err; - sbi = kzalloc(sizeof(struct cramfs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct cramfs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; @@ -640,7 +640,7 @@ static int cramfs_mtd_fill_super(struct super_block *sb, struct fs_context *fc) struct cramfs_super super; int err; - sbi = kzalloc(sizeof(struct cramfs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct cramfs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c index ed6e926226b5..e286d9fd17f3 100644 --- a/fs/crypto/inline_crypt.c +++ b/fs/crypto/inline_crypt.c @@ -32,7 +32,7 @@ static struct block_device **fscrypt_get_devices(struct super_block *sb, if (devs) return devs; } - devs = kmalloc(sizeof(*devs), GFP_KERNEL); + devs = kmalloc_obj(*devs, GFP_KERNEL); if (!devs) return ERR_PTR(-ENOMEM); devs[0] = sb->s_bdev; @@ -169,7 +169,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key, unsigned int i; int err; - blk_key = kmalloc(sizeof(*blk_key), GFP_KERNEL); + blk_key = kmalloc_obj(*blk_key, GFP_KERNEL); if (!blk_key) return -ENOMEM; diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c index 5e939ea3ac28..855314a28b18 100644 --- a/fs/crypto/keyring.c +++ b/fs/crypto/keyring.c @@ -209,7 +209,7 @@ static int allocate_filesystem_keyring(struct super_block *sb) if (sb->s_master_keys) return 0; - keyring = kzalloc(sizeof(*keyring), GFP_KERNEL); + keyring = kzalloc_obj(*keyring, GFP_KERNEL); if (!keyring) return -ENOMEM; spin_lock_init(&keyring->lock); @@ -434,7 +434,7 @@ static int add_new_master_key(struct super_block *sb, struct fscrypt_master_key *mk; int err; - mk = kzalloc(sizeof(*mk), GFP_KERNEL); + mk = kzalloc_obj(*mk, GFP_KERNEL); if (!mk) return -ENOMEM; diff --git a/fs/crypto/keysetup_v1.c b/fs/crypto/keysetup_v1.c index c4d05168522b..93fc2ab7ee97 100644 --- a/fs/crypto/keysetup_v1.c +++ b/fs/crypto/keysetup_v1.c @@ -221,7 +221,7 @@ fscrypt_get_direct_key(const struct fscrypt_inode_info *ci, const u8 *raw_key) return dk; /* Nope, allocate one. */ - dk = kzalloc(sizeof(*dk), GFP_KERNEL); + dk = kzalloc_obj(*dk, GFP_KERNEL); if (!dk) return ERR_PTR(-ENOMEM); dk->dk_sb = ci->ci_inode->i_sb; diff --git a/fs/crypto/policy.c b/fs/crypto/policy.c index bbb2f5ced988..49309e9da4ea 100644 --- a/fs/crypto/policy.c +++ b/fs/crypto/policy.c @@ -813,7 +813,7 @@ int fscrypt_parse_test_dummy_encryption(const struct fs_parameter *param, if (param->type == fs_value_is_string && *param->string) arg = param->string; - policy = kzalloc(sizeof(*policy), GFP_KERNEL); + policy = kzalloc_obj(*policy, GFP_KERNEL); if (!policy) return -ENOMEM; diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 3ec3324c2060..70b8dcd3599d 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -82,7 +82,7 @@ static int __debugfs_file_get(struct dentry *dentry, enum dbgfs_get_mode mode) if (WARN_ON(mode == DBGFS_GET_ALREADY)) return -EINVAL; - fsd = kmalloc(sizeof(*fsd), GFP_KERNEL); + fsd = kmalloc_obj(*fsd, GFP_KERNEL); if (!fsd) return -ENOMEM; diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 4005d21cf009..a9e161f6fb7d 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -310,7 +310,7 @@ static int debugfs_init_fs_context(struct fs_context *fc) { struct debugfs_fs_info *fsi; - fsi = kzalloc(sizeof(struct debugfs_fs_info), GFP_KERNEL); + fsi = kzalloc_obj(struct debugfs_fs_info, GFP_KERNEL); if (!fsi) return -ENOMEM; diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 9f3de528c358..93af356408ee 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -420,7 +420,7 @@ static int devpts_init_fs_context(struct fs_context *fc) { struct pts_fs_info *fsi; - fsi = kzalloc(sizeof(struct pts_fs_info), GFP_KERNEL); + fsi = kzalloc_obj(struct pts_fs_info, GFP_KERNEL); if (!fsi) return -ENOMEM; diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 82cc3215663f..0f80fda98227 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -426,9 +426,9 @@ static struct config_group *make_cluster(struct config_group *g, struct dlm_spaces *sps = NULL; struct dlm_comms *cms = NULL; - cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS); - sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS); - cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS); + cl = kzalloc_obj(struct dlm_cluster, GFP_NOFS); + sps = kzalloc_obj(struct dlm_spaces, GFP_NOFS); + cms = kzalloc_obj(struct dlm_comms, GFP_NOFS); if (!cl || !sps || !cms) goto fail; @@ -480,8 +480,8 @@ static struct config_group *make_space(struct config_group *g, const char *name) struct dlm_space *sp = NULL; struct dlm_nodes *nds = NULL; - sp = kzalloc(sizeof(struct dlm_space), GFP_NOFS); - nds = kzalloc(sizeof(struct dlm_nodes), GFP_NOFS); + sp = kzalloc_obj(struct dlm_space, GFP_NOFS); + nds = kzalloc_obj(struct dlm_nodes, GFP_NOFS); if (!sp || !nds) goto fail; @@ -531,7 +531,7 @@ static struct config_item *make_comm(struct config_group *g, const char *name) if (rv) return ERR_PTR(rv); - cm = kzalloc(sizeof(struct dlm_comm), GFP_NOFS); + cm = kzalloc_obj(struct dlm_comm, GFP_NOFS); if (!cm) return ERR_PTR(-ENOMEM); @@ -577,7 +577,7 @@ static struct config_item *make_node(struct config_group *g, const char *name) if (rv) return ERR_PTR(rv); - nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS); + nd = kzalloc_obj(struct dlm_node, GFP_NOFS); if (!nd) return ERR_PTR(-ENOMEM); @@ -602,7 +602,7 @@ static void drop_node(struct config_group *g, struct config_item *i) struct dlm_node *nd = config_item_to_node(i); struct dlm_member_gone *mb_gone; - mb_gone = kzalloc(sizeof(*mb_gone), GFP_KERNEL); + mb_gone = kzalloc_obj(*mb_gone, GFP_KERNEL); if (!mb_gone) return; @@ -701,7 +701,7 @@ static ssize_t comm_addr_store(struct config_item *item, const char *buf, if (cm->addr_count >= DLM_MAX_ADDR_COUNT) return -ENOSPC; - addr = kzalloc(sizeof(*addr), GFP_NOFS); + addr = kzalloc_obj(*addr, GFP_NOFS); if (!addr) return -ENOMEM; @@ -946,7 +946,7 @@ int dlm_config_nodes(char *lsname, struct dlm_config_node **nodes_out, count = sp->members_count + sp->members_gone_count; - nodes = kcalloc(count, sizeof(struct dlm_config_node), GFP_NOFS); + nodes = kzalloc_objs(struct dlm_config_node, count, GFP_NOFS); if (!nodes) { rv = -ENOMEM; goto out; diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 01c292379f5b..aa08e8f446a1 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -276,7 +276,7 @@ static struct dlm_dir_dump *init_dir_dump(struct dlm_ls *ls, int nodeid) drop_dir_ctx(ls, nodeid); } - dd = kzalloc(sizeof(*dd), GFP_ATOMIC); + dd = kzalloc_obj(*dd, GFP_ATOMIC); if (!dd) return NULL; diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 47a09d6748cb..3b6e6a29eab8 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -5050,7 +5050,7 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls) int wait_type, local_unlock_result, local_cancel_result; int dir_nodeid; - ms_local = kmalloc(sizeof(*ms_local), GFP_KERNEL); + ms_local = kmalloc_obj(*ms_local, GFP_KERNEL); if (!ms_local) return; @@ -6288,7 +6288,7 @@ int dlm_debug_add_lkb(struct dlm_ls *ls, uint32_t lkb_id, char *name, int len, if (lkb_dflags & BIT(DLM_DFL_USER_BIT)) return -EOPNOTSUPP; - lksb = kzalloc(sizeof(*lksb), GFP_NOFS); + lksb = kzalloc_obj(*lksb, GFP_NOFS); if (!lksb) return -ENOMEM; diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index ddaa76558706..a9c98b4f378f 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -427,7 +427,7 @@ static int new_lockspace(const char *name, const char *cluster, error = -ENOMEM; - ls = kzalloc(sizeof(*ls), GFP_NOFS); + ls = kzalloc_obj(*ls, GFP_NOFS); if (!ls) goto out; memcpy(ls->ls_name, name, namelen); diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index b3958008ba3f..5b6142787919 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -305,7 +305,7 @@ static struct connection *nodeid2con(int nodeid, gfp_t alloc) if (con || !alloc) return con; - con = kzalloc(sizeof(*con), alloc); + con = kzalloc_obj(*con, alloc); if (!con) return NULL; @@ -838,7 +838,7 @@ static struct processqueue_entry *new_processqueue_entry(int nodeid, { struct processqueue_entry *pentry; - pentry = kmalloc(sizeof(*pentry), GFP_NOFS); + pentry = kmalloc_obj(*pentry, GFP_NOFS); if (!pentry) return NULL; @@ -1052,7 +1052,7 @@ static int accept_from_sock(void) struct connection *othercon = newcon->othercon; if (!othercon) { - othercon = kzalloc(sizeof(*othercon), GFP_NOFS); + othercon = kzalloc_obj(*othercon, GFP_NOFS); if (!othercon) { log_print("failed to allocate incoming socket"); up_write(&newcon->sock_lock); diff --git a/fs/dlm/member.c b/fs/dlm/member.c index c1b5598997b7..812d889f1ce5 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -211,7 +211,7 @@ int dlm_slots_assign(struct dlm_ls *ls, int *num_slots, int *slots_size, } array_size = max + need; - array = kcalloc(array_size, sizeof(*array), GFP_NOFS); + array = kzalloc_objs(*array, array_size, GFP_NOFS); if (!array) return -ENOMEM; @@ -323,7 +323,7 @@ static int dlm_add_member(struct dlm_ls *ls, struct dlm_config_node *node) struct dlm_member *memb; int error; - memb = kzalloc(sizeof(*memb), GFP_NOFS); + memb = kzalloc_obj(*memb, GFP_NOFS); if (!memb) return -ENOMEM; @@ -423,7 +423,7 @@ static void make_member_array(struct dlm_ls *ls) } ls->ls_total_weight = total; - array = kmalloc_array(total, sizeof(*array), GFP_NOFS); + array = kmalloc_objs(*array, total, GFP_NOFS); if (!array) return; @@ -511,7 +511,7 @@ void dlm_lsop_recover_done(struct dlm_ls *ls) return; num = ls->ls_num_nodes; - slots = kcalloc(num, sizeof(*slots), GFP_KERNEL); + slots = kzalloc_objs(*slots, num, GFP_KERNEL); if (!slots) return; @@ -726,7 +726,7 @@ int dlm_ls_start(struct dlm_ls *ls) struct dlm_config_node *nodes = NULL; int error, count; - rv = kzalloc(sizeof(*rv), GFP_NOFS); + rv = kzalloc_obj(*rv, GFP_NOFS); if (!rv) return -ENOMEM; diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index 2c101bbe261a..d54bdd8fc4f2 100644 --- a/fs/dlm/midcomms.c +++ b/fs/dlm/midcomms.c @@ -351,7 +351,7 @@ int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr) } srcu_read_unlock(&nodes_srcu, idx); - node = kmalloc(sizeof(*node), GFP_NOFS); + node = kmalloc_obj(*node, GFP_NOFS); if (!node) return -ENOMEM; diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 9ca83ef70ed1..e9598b3fe5d0 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -102,7 +102,7 @@ static int do_lock_cancel(const struct dlm_plock_info *orig_info) struct plock_op *op; int rv; - op = kzalloc(sizeof(*op), GFP_NOFS); + op = kzalloc_obj(*op, GFP_NOFS); if (!op) return -ENOMEM; @@ -131,7 +131,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, if (!ls) return -EINVAL; - op = kzalloc(sizeof(*op), GFP_NOFS); + op = kzalloc_obj(*op, GFP_NOFS); if (!op) { rv = -ENOMEM; goto out; @@ -148,7 +148,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, op->info.owner = (__u64)(long) fl->c.flc_owner; /* async handling */ if (fl->fl_lmops && fl->fl_lmops->lm_grant) { - op_data = kzalloc(sizeof(*op_data), GFP_NOFS); + op_data = kzalloc_obj(*op_data, GFP_NOFS); if (!op_data) { dlm_release_plock_op(op); rv = -ENOMEM; @@ -297,7 +297,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file, if (!ls) return -EINVAL; - op = kzalloc(sizeof(*op), GFP_NOFS); + op = kzalloc_obj(*op, GFP_NOFS); if (!op) { rv = -ENOMEM; goto out; @@ -430,7 +430,7 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file, if (!ls) return -EINVAL; - op = kzalloc(sizeof(*op), GFP_NOFS); + op = kzalloc_obj(*op, GFP_NOFS); if (!op) { rv = -ENOMEM; goto out; diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 51daf4acbe31..a8ed4c8fdc5b 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -262,7 +262,7 @@ static int device_user_lock(struct dlm_user_proc *proc, goto out; } - ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); + ua = kzalloc_obj(struct dlm_user_args, GFP_NOFS); if (!ua) goto out; ua->proc = proc; @@ -307,7 +307,7 @@ static int device_user_unlock(struct dlm_user_proc *proc, if (!ls) return -ENOENT; - ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); + ua = kzalloc_obj(struct dlm_user_args, GFP_NOFS); if (!ua) goto out; ua->proc = proc; @@ -645,7 +645,7 @@ static int device_open(struct inode *inode, struct file *file) if (!ls) return -ENOENT; - proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS); + proc = kzalloc_obj(struct dlm_user_proc, GFP_NOFS); if (!proc) { dlm_put_lockspace(ls); return -ENOMEM; diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 5459f18b3cca..6ada136f3f3f 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -1793,7 +1793,7 @@ int ecryptfs_encrypt_and_encode_filename( & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) { struct ecryptfs_filename *filename; - filename = kzalloc(sizeof(*filename), GFP_KERNEL); + filename = kzalloc_obj(*filename, GFP_KERNEL); if (!filename) { rc = -ENOMEM; goto out; diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index a41c82d610a7..04b6d296a3fa 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -623,7 +623,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, struct key *auth_tok_key = NULL; int rc = 0; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -860,7 +860,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, (*packet_size) = 0; (*filename_size) = 0; (*filename) = NULL; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 7d51e6b60f53..dcfa607fbf15 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -610,7 +610,7 @@ static int ecryptfs_init_fs_context(struct fs_context *fc) struct ecryptfs_fs_context *ctx; struct ecryptfs_sb_info *sbi = NULL; - ctx = kzalloc(sizeof(struct ecryptfs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct ecryptfs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; sbi = kmem_cache_zalloc(ecryptfs_sb_info_cache, GFP_KERNEL); diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 6318f3500e5c..6cf3052e9370 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c @@ -131,7 +131,7 @@ ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file) { int rc = 0; - (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL); + (*daemon) = kzalloc_obj(**daemon, GFP_KERNEL); if (!(*daemon)) { rc = -ENOMEM; goto out; diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 9da992925920..14c2752831c8 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -44,7 +44,7 @@ static int efivarfs_ops_notifier(struct notifier_block *nb, unsigned long event, static struct inode *efivarfs_alloc_inode(struct super_block *sb) { - struct efivar_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct efivar_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -505,7 +505,7 @@ static int efivarfs_init_fs_context(struct fs_context *fc) if (!efivar_is_available()) return -EOPNOTSUPP; - sfi = kzalloc(sizeof(*sfi), GFP_KERNEL); + sfi = kzalloc_obj(*sfi, GFP_KERNEL); if (!sfi) return -ENOMEM; diff --git a/fs/efs/super.c b/fs/efs/super.c index c59086b7eabf..54252bccd6a3 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -243,7 +243,7 @@ static int efs_fill_super(struct super_block *s, struct fs_context *fc) struct buffer_head *bh; struct inode *root; - sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL); + sb = kzalloc_obj(struct efs_sb_info, GFP_KERNEL); if (!sb) return -ENOMEM; s->s_fs_info = sb; diff --git a/fs/erofs/decompressor_deflate.c b/fs/erofs/decompressor_deflate.c index 4f26ab767645..787eb8fc6262 100644 --- a/fs/erofs/decompressor_deflate.c +++ b/fs/erofs/decompressor_deflate.c @@ -71,7 +71,7 @@ static int z_erofs_load_deflate_config(struct super_block *sb, ++z_erofs_deflate_avail_strms) { struct z_erofs_deflate *strm; - strm = kzalloc(sizeof(*strm), GFP_KERNEL); + strm = kzalloc_obj(*strm, GFP_KERNEL); if (!strm) goto failed; /* XXX: in-kernel zlib cannot customize windowbits */ diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c index b4ea6978faae..c1c908d7b6ef 100644 --- a/fs/erofs/decompressor_lzma.c +++ b/fs/erofs/decompressor_lzma.c @@ -54,7 +54,7 @@ static int __init z_erofs_lzma_init(void) z_erofs_lzma_nstrms = num_possible_cpus(); for (i = 0; i < z_erofs_lzma_nstrms; ++i) { - struct z_erofs_lzma *strm = kzalloc(sizeof(*strm), GFP_KERNEL); + struct z_erofs_lzma *strm = kzalloc_obj(*strm, GFP_KERNEL); if (!strm) { z_erofs_lzma_exit(); diff --git a/fs/erofs/decompressor_zstd.c b/fs/erofs/decompressor_zstd.c index beae49165c69..6da93f74431b 100644 --- a/fs/erofs/decompressor_zstd.c +++ b/fs/erofs/decompressor_zstd.c @@ -59,7 +59,7 @@ static int __init z_erofs_zstd_init(void) ++z_erofs_zstd_avail_strms) { struct z_erofs_zstd *strm; - strm = kzalloc(sizeof(*strm), GFP_KERNEL); + strm = kzalloc_obj(*strm, GFP_KERNEL); if (!strm) { z_erofs_zstd_exit(); return -ENOMEM; diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c index 4d5054dcac95..abe873f01297 100644 --- a/fs/erofs/fileio.c +++ b/fs/erofs/fileio.c @@ -68,8 +68,7 @@ static void erofs_fileio_rq_submit(struct erofs_fileio_rq *rq) static struct erofs_fileio_rq *erofs_fileio_rq_alloc(struct erofs_map_dev *mdev) { - struct erofs_fileio_rq *rq = kzalloc(sizeof(*rq), - GFP_KERNEL | __GFP_NOFAIL); + struct erofs_fileio_rq *rq = kzalloc_obj(*rq, GFP_KERNEL | __GFP_NOFAIL); bio_init(&rq->bio, NULL, rq->bvecs, ARRAY_SIZE(rq->bvecs), REQ_OP_READ); rq->iocb.ki_filp = mdev->m_dif->file; diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index a2cc0f3fa9d0..0a231063b341 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -70,7 +70,7 @@ static void erofs_fscache_req_put(struct erofs_fscache_rq *req) static struct erofs_fscache_rq *erofs_fscache_req_alloc(struct address_space *mapping, loff_t start, size_t len) { - struct erofs_fscache_rq *req = kzalloc(sizeof(*req), GFP_KERNEL); + struct erofs_fscache_rq *req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return NULL; @@ -101,7 +101,7 @@ static void erofs_fscache_req_end_io(void *priv, ssize_t transferred_or_error) static struct erofs_fscache_io *erofs_fscache_req_io_alloc(struct erofs_fscache_rq *req) { - struct erofs_fscache_io *io = kzalloc(sizeof(*io), GFP_KERNEL); + struct erofs_fscache_io *io = kzalloc_obj(*io, GFP_KERNEL); if (!io) return NULL; @@ -181,7 +181,7 @@ struct bio *erofs_fscache_bio_alloc(struct erofs_map_dev *mdev) { struct erofs_fscache_bio *io; - io = kmalloc(sizeof(*io), GFP_KERNEL | __GFP_NOFAIL); + io = kmalloc_obj(*io, GFP_KERNEL | __GFP_NOFAIL); bio_init(&io->bio, NULL, io->bvecs, BIO_MAX_VECS, REQ_OP_READ); io->io.private = mdev->m_dif->fscache->cookie; io->io.end_io = erofs_fscache_bio_endio; @@ -417,7 +417,7 @@ static int erofs_fscache_init_domain(struct super_block *sb) struct erofs_domain *domain; struct erofs_sb_info *sbi = EROFS_SB(sb); - domain = kzalloc(sizeof(struct erofs_domain), GFP_KERNEL); + domain = kzalloc_obj(struct erofs_domain, GFP_KERNEL); if (!domain) return -ENOMEM; @@ -482,7 +482,7 @@ static struct erofs_fscache *erofs_fscache_acquire_cookie(struct super_block *sb struct inode *inode; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&ctx->node); diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 7827e61424b7..a333456c7d5d 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -226,7 +226,7 @@ static int erofs_scan_devices(struct super_block *sb, } } else { for (id = 0; id < ondisk_extradevs; id++) { - dif = kzalloc(sizeof(*dif), GFP_KERNEL); + dif = kzalloc_obj(*dif, GFP_KERNEL); if (!dif) { err = -ENOMEM; break; @@ -495,7 +495,7 @@ static int erofs_fc_parse_param(struct fs_context *fc, return -EINVAL; break; case Opt_device: - dif = kzalloc(sizeof(*dif), GFP_KERNEL); + dif = kzalloc_obj(*dif, GFP_KERNEL); if (!dif) return -ENOMEM; dif->path = kstrdup(param->string, GFP_KERNEL); @@ -903,11 +903,11 @@ static int erofs_init_fs_context(struct fs_context *fc) { struct erofs_sb_info *sbi; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; - sbi->devs = kzalloc(sizeof(struct erofs_dev_context), GFP_KERNEL); + sbi->devs = kzalloc_obj(struct erofs_dev_context, GFP_KERNEL); if (!sbi->devs) { kfree(sbi); return -ENOMEM; diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index b7da1ed83160..5997a7ae19d9 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -85,8 +85,8 @@ static int erofs_init_inode_xattrs(struct inode *inode) } vi->xattr_name_filter = le32_to_cpu(ih->h_name_filter); vi->xattr_shared_count = ih->h_shared_count; - vi->xattr_shared_xattrs = kmalloc_array(vi->xattr_shared_count, - sizeof(uint), GFP_KERNEL); + vi->xattr_shared_xattrs = kmalloc_objs(uint, vi->xattr_shared_count, + GFP_KERNEL); if (!vi->xattr_shared_xattrs) { erofs_put_metabuf(&buf); ret = -ENOMEM; @@ -498,7 +498,7 @@ int erofs_xattr_prefixes_init(struct super_block *sb) if (!sbi->xattr_prefix_count) return 0; - pfs = kcalloc(sbi->xattr_prefix_count, sizeof(*pfs), GFP_KERNEL); + pfs = kzalloc_objs(*pfs, sbi->xattr_prefix_count, GFP_KERNEL); if (!pfs) return -ENOMEM; diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index ea9d32e9cb12..3977e42b9516 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -323,8 +323,8 @@ static int erofs_init_percpu_workers(void) struct kthread_worker *worker; unsigned int cpu; - z_erofs_pcpu_workers = kcalloc(num_possible_cpus(), - sizeof(struct kthread_worker *), GFP_ATOMIC); + z_erofs_pcpu_workers = kzalloc_objs(struct kthread_worker *, + num_possible_cpus(), GFP_ATOMIC); if (!z_erofs_pcpu_workers) return -ENOMEM; @@ -1144,7 +1144,7 @@ static void z_erofs_do_decompressed_bvec(struct z_erofs_backend *be, } /* (cold path) one pcluster is requested multiple times */ - item = kmalloc(sizeof(*item), GFP_KERNEL | __GFP_NOFAIL); + item = kmalloc_obj(*item, GFP_KERNEL | __GFP_NOFAIL); item->bvec = *bvec; list_add(&item->list, &be->decompressed_secondary_bvecs); } @@ -1282,12 +1282,12 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, bool eio) if (!be->decompressed_pages) be->decompressed_pages = - kvcalloc(be->nr_pages, sizeof(struct page *), - GFP_KERNEL | __GFP_NOFAIL); + kvzalloc_objs(struct page *, be->nr_pages, + GFP_KERNEL | __GFP_NOFAIL); if (!be->compressed_pages) be->compressed_pages = - kvcalloc(pclusterpages, sizeof(struct page *), - GFP_KERNEL | __GFP_NOFAIL); + kvzalloc_objs(struct page *, pclusterpages, + GFP_KERNEL | __GFP_NOFAIL); z_erofs_parse_out_bvecs(be); err2 = z_erofs_parse_in_bvecs(be, &overlapped); @@ -1590,7 +1590,7 @@ static struct z_erofs_decompressqueue *jobqueue_init(struct super_block *sb, struct z_erofs_decompressqueue *q; if (fg && !*fg) { - q = kvzalloc(sizeof(*q), GFP_KERNEL | __GFP_NOWARN); + q = kvzalloc_obj(*q, GFP_KERNEL | __GFP_NOWARN); if (!q) { *fg = true; goto fg_out; diff --git a/fs/erofs/zutil.c b/fs/erofs/zutil.c index 55ff2ab5128e..9a15088744f0 100644 --- a/fs/erofs/zutil.c +++ b/fs/erofs/zutil.c @@ -79,7 +79,7 @@ int z_erofs_gbuf_growsize(unsigned int nrpages) for (i = 0; i < z_erofs_gbuf_count; ++i) { gbuf = &z_erofs_gbufpool[i]; - tmp_pages = kcalloc(nrpages, sizeof(*tmp_pages), GFP_KERNEL); + tmp_pages = kzalloc_objs(*tmp_pages, nrpages, GFP_KERNEL); if (!tmp_pages) goto out; @@ -131,15 +131,15 @@ int __init z_erofs_gbuf_init(void) /* The last (special) global buffer is the reserved buffer */ total += !!z_erofs_rsv_nrpages; - z_erofs_gbufpool = kcalloc(total, sizeof(*z_erofs_gbufpool), - GFP_KERNEL); + z_erofs_gbufpool = kzalloc_objs(*z_erofs_gbufpool, total, GFP_KERNEL); if (!z_erofs_gbufpool) return -ENOMEM; if (z_erofs_rsv_nrpages) { z_erofs_rsvbuf = &z_erofs_gbufpool[total - 1]; - z_erofs_rsvbuf->pages = kcalloc(z_erofs_rsv_nrpages, - sizeof(*z_erofs_rsvbuf->pages), GFP_KERNEL); + z_erofs_rsvbuf->pages = kzalloc_objs(*z_erofs_rsvbuf->pages, + z_erofs_rsv_nrpages, + GFP_KERNEL); if (!z_erofs_rsvbuf->pages) { z_erofs_rsvbuf = NULL; z_erofs_rsv_nrpages = 0; diff --git a/fs/eventfd.c b/fs/eventfd.c index 3219e0d596fe..a0ea7f30c76f 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -388,7 +388,7 @@ static int do_eventfd(unsigned int count, int flags) if (flags & ~EFD_FLAGS_SET) return -EINVAL; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 6c36d9dc6926..4d0c0ce43cb3 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1147,7 +1147,7 @@ static int ep_alloc(struct eventpoll **pep) { struct eventpoll *ep; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (unlikely(!ep)) return -ENOMEM; diff --git a/fs/exec.c b/fs/exec.c index 2e3a6593c6fd..c367e74cf103 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1402,7 +1402,7 @@ static struct linux_binprm *alloc_bprm(int fd, struct filename *filename, int fl if (IS_ERR(file)) return ERR_CAST(file); - bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); + bprm = kzalloc_obj(*bprm, GFP_KERNEL); if (!bprm) { do_close_execat(file); return ERR_PTR(-ENOMEM); diff --git a/fs/exfat/balloc.c b/fs/exfat/balloc.c index 5429041c7eaf..8dd9e39f8ccf 100644 --- a/fs/exfat/balloc.c +++ b/fs/exfat/balloc.c @@ -96,8 +96,8 @@ static int exfat_allocate_bitmap(struct super_block *sb, } sbi->map_sectors = ((need_map_size - 1) >> (sb->s_blocksize_bits)) + 1; - sbi->vol_amap = kvmalloc_array(sbi->map_sectors, - sizeof(struct buffer_head *), GFP_KERNEL); + sbi->vol_amap = kvmalloc_objs(struct buffer_head *, sbi->map_sectors, + GFP_KERNEL); if (!sbi->vol_amap) return -ENOMEM; diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 2dbf335eafef..3a4853693d8b 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -802,7 +802,7 @@ static int __exfat_get_dentry_set(struct exfat_entry_set_cache *es, num_bh = EXFAT_B_TO_BLK_ROUND_UP(off + num_entries * DENTRY_SIZE, sb); if (num_bh > ARRAY_SIZE(es->__bh)) { - es->bh = kmalloc_array(num_bh, sizeof(*es->bh), GFP_NOFS); + es->bh = kmalloc_objs(*es->bh, num_bh, GFP_NOFS); if (!es->bh) { brelse(bh); return -ENOMEM; diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 10e872a99663..42a232394afb 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -815,7 +815,7 @@ static int exfat_init_fs_context(struct fs_context *fc) { struct exfat_sb_info *sbi; - sbi = kzalloc(sizeof(struct exfat_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct exfat_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index b8cfab8f98b9..2bac6dcb1792 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -419,7 +419,7 @@ void ext2_init_block_alloc_info(struct inode *inode) struct ext2_block_alloc_info *block_i; struct super_block *sb = inode->i_sb; - block_i = kmalloc(sizeof(*block_i), GFP_KERNEL); + block_i = kmalloc_obj(*block_i, GFP_KERNEL); if (block_i) { struct ext2_reserve_window_node *rsv = &block_i->rsv_window_node; diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 121e634c792a..9bb4c63f5628 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -893,12 +893,12 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc) __le32 features; int err; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; sbi->s_blockgroup_lock = - kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); if (!sbi->s_blockgroup_lock) { kfree(sbi); return -ENOMEM; @@ -1122,9 +1122,8 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc) } db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / EXT2_DESC_PER_BLOCK(sb); - sbi->s_group_desc = kvmalloc_array(db_count, - sizeof(struct buffer_head *), - GFP_KERNEL); + sbi->s_group_desc = kvmalloc_objs(struct buffer_head *, db_count, + GFP_KERNEL); if (sbi->s_group_desc == NULL) { ret = -ENOMEM; ext2_msg(sb, KERN_ERR, "error: not enough memory"); @@ -1670,7 +1669,7 @@ static int ext2_init_fs_context(struct fs_context *fc) { struct ext2_fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c index e8c5525afc67..75179be4a488 100644 --- a/fs/ext4/block_validity.c +++ b/fs/ext4/block_validity.c @@ -217,7 +217,7 @@ int ext4_setup_system_zone(struct super_block *sb) ext4_group_t i; int ret; - system_blks = kzalloc(sizeof(*system_blks), GFP_KERNEL); + system_blks = kzalloc_obj(*system_blks, GFP_KERNEL); if (!system_blks) return -ENOMEM; diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 00c4b3c82b65..b285ce18b183 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -480,8 +480,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, p = &info->root.rb_node; /* Create and allocate the fname structure */ - new_fn = kzalloc(struct_size(new_fn, name, ent_name->len + 1), - GFP_KERNEL); + new_fn = kzalloc_flex(*new_fn, name, ent_name->len + 1, GFP_KERNEL); if (!new_fn) return -ENOMEM; new_fn->hash = hash; @@ -673,7 +672,7 @@ static int ext4_dir_open(struct inode *inode, struct file *file) { struct dir_private_info *info; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; file->private_data = info; diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c index 4879e68e465d..913103089799 100644 --- a/fs/ext4/extents-test.c +++ b/fs/ext4/extents-test.c @@ -229,7 +229,7 @@ static int extents_kunit_init(struct kunit *test) sb->s_blocksize = 4096; sb->s_blocksize_bits = 12; - sbi = kzalloc(sizeof(struct ext4_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct ext4_sb_info, GFP_KERNEL); if (sbi == NULL) return -ENOMEM; @@ -240,7 +240,7 @@ static int extents_kunit_init(struct kunit *test) sbi->s_extent_max_zeroout_kb = 32; /* setup the mock inode */ - k_ctx.k_ei = kzalloc(sizeof(struct ext4_inode_info), GFP_KERNEL); + k_ctx.k_ei = kzalloc_obj(struct ext4_inode_info, GFP_KERNEL); if (k_ctx.k_ei == NULL) return -ENOMEM; ei = k_ctx.k_ei; diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3630b27e4fd7..ae3804f36535 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -621,8 +621,7 @@ int ext4_ext_precache(struct inode *inode) return ret; } - path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), - GFP_NOFS); + path = kzalloc_objs(struct ext4_ext_path, depth + 1, GFP_NOFS); if (path == NULL) { up_read(&ei->i_data_sem); return -ENOMEM; @@ -916,8 +915,7 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block, } if (!path) { /* account possible depth increase */ - path = kcalloc(depth + 2, sizeof(struct ext4_ext_path), - gfp_flags); + path = kzalloc_objs(struct ext4_ext_path, depth + 2, gfp_flags); if (unlikely(!path)) return ERR_PTR(-ENOMEM); path[0].p_maxdepth = depth + 1; @@ -1105,7 +1103,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, * We need this to handle errors and free blocks * upon them. */ - ablocks = kcalloc(depth, sizeof(ext4_fsblk_t), gfp_flags); + ablocks = kzalloc_objs(ext4_fsblk_t, depth, gfp_flags); if (!ablocks) return -ENOMEM; @@ -2947,8 +2945,8 @@ again: path[k].p_block = le16_to_cpu(path[k].p_hdr->eh_entries)+1; } else { - path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), - GFP_NOFS | __GFP_NOFAIL); + path = kzalloc_objs(struct ext4_ext_path, depth + 1, + GFP_NOFS | __GFP_NOFAIL); path[0].p_maxdepth = path[0].p_depth = depth; path[0].p_hdr = ext_inode_hdr(inode); i = 0; diff --git a/fs/ext4/fsmap.c b/fs/ext4/fsmap.c index 22fc333244ef..8b1138d2dc8e 100644 --- a/fs/ext4/fsmap.c +++ b/fs/ext4/fsmap.c @@ -348,7 +348,7 @@ static inline int ext4_getfsmap_fill(struct list_head *meta_list, { struct ext4_fsmap *fsm; - fsm = kmalloc(sizeof(*fsm), GFP_NOFS); + fsm = kmalloc_obj(*fsm, GFP_NOFS); if (!fsm) return -ENOMEM; fsm->fmr_device = 0; diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c index 4abb40d4561c..6b448aad6f63 100644 --- a/fs/ext4/mballoc-test.c +++ b/fs/ext4/mballoc-test.c @@ -34,7 +34,7 @@ static struct inode *mbt_alloc_inode(struct super_block *sb) { struct ext4_inode_info *ei; - ei = kmalloc(sizeof(struct ext4_inode_info), GFP_KERNEL); + ei = kmalloc_obj(struct ext4_inode_info, GFP_KERNEL); if (!ei) return NULL; @@ -73,11 +73,11 @@ static int mbt_mb_init(struct super_block *sb) int ret; /* needed by ext4_mb_init->bdev_nonrot(sb->s_bdev) */ - sb->s_bdev = kzalloc(sizeof(*sb->s_bdev), GFP_KERNEL); + sb->s_bdev = kzalloc_obj(*sb->s_bdev, GFP_KERNEL); if (sb->s_bdev == NULL) return -ENOMEM; - sb->s_bdev->bd_queue = kzalloc(sizeof(struct request_queue), GFP_KERNEL); + sb->s_bdev->bd_queue = kzalloc_obj(struct request_queue, GFP_KERNEL); if (sb->s_bdev->bd_queue == NULL) { kfree(sb->s_bdev); return -ENOMEM; @@ -137,7 +137,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void) struct super_block *sb; struct ext4_sb_info *sbi; - fsb = kzalloc(sizeof(*fsb), GFP_KERNEL); + fsb = kzalloc_obj(*fsb, GFP_KERNEL); if (fsb == NULL) return NULL; @@ -148,7 +148,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void) sbi = &fsb->sbi; sbi->s_blockgroup_lock = - kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); if (!sbi->s_blockgroup_lock) goto out_deactivate; @@ -252,8 +252,7 @@ static int mbt_ctx_init(struct super_block *sb) struct mbt_ctx *ctx = MBT_CTX(sb); ext4_group_t i, ngroups = ext4_get_groups_count(sb); - ctx->grp_ctx = kcalloc(ngroups, sizeof(struct mbt_grp_ctx), - GFP_KERNEL); + ctx->grp_ctx = kzalloc_objs(struct mbt_grp_ctx, ngroups, GFP_KERNEL); if (ctx->grp_ctx == NULL) return -ENOMEM; diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index b99d1a7e580e..4d0bf2fcf2d3 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3754,8 +3754,7 @@ int ext4_mb_init(struct super_block *sb) } while (i < MB_NUM_ORDERS(sb)); sbi->s_mb_avg_fragment_size = - kmalloc_array(MB_NUM_ORDERS(sb), sizeof(struct xarray), - GFP_KERNEL); + kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL); if (!sbi->s_mb_avg_fragment_size) { ret = -ENOMEM; goto out; @@ -3764,8 +3763,7 @@ int ext4_mb_init(struct super_block *sb) xa_init(&sbi->s_mb_avg_fragment_size[i]); sbi->s_mb_largest_free_orders = - kmalloc_array(MB_NUM_ORDERS(sb), sizeof(struct xarray), - GFP_KERNEL); + kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL); if (!sbi->s_mb_largest_free_orders) { ret = -ENOMEM; goto out; @@ -3817,8 +3815,9 @@ int ext4_mb_init(struct super_block *sb) sbi->s_mb_nr_global_goals = umin(num_possible_cpus(), DIV_ROUND_UP(sbi->s_groups_count, 4)); - sbi->s_mb_last_groups = kcalloc(sbi->s_mb_nr_global_goals, - sizeof(ext4_group_t), GFP_KERNEL); + sbi->s_mb_last_groups = kzalloc_objs(ext4_group_t, + sbi->s_mb_nr_global_goals, + GFP_KERNEL); if (sbi->s_mb_last_groups == NULL) { ret = -ENOMEM; goto out; diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c index c9b93b670b0f..2dbaf3c01168 100644 --- a/fs/ext4/orphan.c +++ b/fs/ext4/orphan.c @@ -598,8 +598,7 @@ int ext4_init_orphan_info(struct super_block *sb) } oi->of_blocks = inode->i_size >> sb->s_blocksize_bits; oi->of_csum_seed = EXT4_I(inode)->i_csum_seed; - oi->of_binfo = kvmalloc_array(oi->of_blocks, - sizeof(struct ext4_orphan_block), + oi->of_binfo = kvmalloc_objs(struct ext4_orphan_block, oi->of_blocks, GFP_KERNEL); if (!oi->of_binfo) { ret = -ENOMEM; diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 76842f0957b5..780679645b6e 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -32,7 +32,7 @@ static void ext4_rcu_ptr_callback(struct rcu_head *head) void ext4_kvfree_array_rcu(void *to_free) { - struct ext4_rcu_ptr *ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + struct ext4_rcu_ptr *ptr = kzalloc_obj(*ptr, GFP_KERNEL); if (ptr) { ptr->ptr = to_free; @@ -242,7 +242,7 @@ static struct ext4_new_flex_group_data *alloc_flex_gd(unsigned int flexbg_size, unsigned int max_resize_bg; struct ext4_new_flex_group_data *flex_gd; - flex_gd = kmalloc(sizeof(*flex_gd), GFP_NOFS); + flex_gd = kmalloc_obj(*flex_gd, GFP_NOFS); if (flex_gd == NULL) goto out3; @@ -260,9 +260,8 @@ static struct ext4_new_flex_group_data *alloc_flex_gd(unsigned int flexbg_size, if (WARN_ON_ONCE(flex_gd->resize_bg > max_resize_bg)) flex_gd->resize_bg = max_resize_bg; - flex_gd->groups = kmalloc_array(flex_gd->resize_bg, - sizeof(struct ext4_new_group_data), - GFP_NOFS); + flex_gd->groups = kmalloc_objs(struct ext4_new_group_data, + flex_gd->resize_bg, GFP_NOFS); if (flex_gd->groups == NULL) goto out2; @@ -1031,7 +1030,7 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode, int res, i; int err; - primary = kmalloc_array(reserved_gdb, sizeof(*primary), GFP_NOFS); + primary = kmalloc_objs(*primary, reserved_gdb, GFP_NOFS); if (!primary) return -ENOMEM; diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 504148b2142b..63784d9b1874 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2016,7 +2016,7 @@ int ext4_init_fs_context(struct fs_context *fc) { struct ext4_fs_context *ctx; - ctx = kzalloc(sizeof(struct ext4_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -2496,11 +2496,11 @@ static int parse_apply_sb_mount_options(struct super_block *sb, if (strscpy_pad(s_mount_opts, sbi->s_es->s_mount_opts) < 0) return -E2BIG; - fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL); + fc = kzalloc_obj(struct fs_context, GFP_KERNEL); if (!fc) return -ENOMEM; - s_ctx = kzalloc(sizeof(struct ext4_fs_context), GFP_KERNEL); + s_ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL); if (!s_ctx) goto out_free; @@ -3962,7 +3962,7 @@ static int ext4_li_info_new(void) { struct ext4_lazy_init *eli = NULL; - eli = kzalloc(sizeof(*eli), GFP_KERNEL); + eli = kzalloc_obj(*eli, GFP_KERNEL); if (!eli) return -ENOMEM; @@ -3981,7 +3981,7 @@ static struct ext4_li_request *ext4_li_request_new(struct super_block *sb, { struct ext4_li_request *elr; - elr = kzalloc(sizeof(*elr), GFP_KERNEL); + elr = kzalloc_obj(*elr, GFP_KERNEL); if (!elr) return NULL; @@ -4328,7 +4328,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb) { struct ext4_sb_info *sbi; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return NULL; @@ -4336,7 +4336,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb) NULL, NULL); sbi->s_blockgroup_lock = - kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); if (!sbi->s_blockgroup_lock) goto err_out; @@ -4879,9 +4879,7 @@ static int ext4_group_desc_init(struct super_block *sb, } } rcu_assign_pointer(sbi->s_group_desc, - kvmalloc_array(db_count, - sizeof(struct buffer_head *), - GFP_KERNEL)); + kvmalloc_objs(struct buffer_head *, db_count, GFP_KERNEL)); if (sbi->s_group_desc == NULL) { ext4_msg(sb, KERN_ERR, "not enough memory"); return -ENOMEM; diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c index d2ecc1026c0c..cdf78da85861 100644 --- a/fs/ext4/sysfs.c +++ b/fs/ext4/sysfs.c @@ -655,7 +655,7 @@ int __init ext4_init_sysfs(void) if (!ext4_root) return -ENOMEM; - ext4_feat = kzalloc(sizeof(*ext4_feat), GFP_KERNEL); + ext4_feat = kzalloc_obj(*ext4_feat, GFP_KERNEL); if (!ext4_feat) { ret = -ENOMEM; goto root_err; diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 4ed8ddf2a60b..7bf9ba19a89d 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -390,7 +390,7 @@ static int ext4_xattr_inode_read(struct inode *ea_inode, void *buf, size_t size) int i, ret; if (bh_count > ARRAY_SIZE(bhs_inline)) { - bhs = kmalloc_array(bh_count, sizeof(*bhs), GFP_NOFS); + bhs = kmalloc_objs(*bhs, bh_count, GFP_NOFS); if (!bhs) return -ENOMEM; } @@ -2618,8 +2618,8 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode, int needs_kvfree = 0; int error; - is = kzalloc(sizeof(struct ext4_xattr_ibody_find), GFP_NOFS); - bs = kzalloc(sizeof(struct ext4_xattr_block_find), GFP_NOFS); + is = kzalloc_obj(struct ext4_xattr_ibody_find, GFP_NOFS); + bs = kzalloc_obj(struct ext4_xattr_block_find, GFP_NOFS); b_entry_name = kmalloc(entry->e_name_len + 1, GFP_NOFS); if (!is || !bs || !b_entry_name) { error = -ENOMEM; @@ -2876,9 +2876,8 @@ ext4_expand_inode_array(struct ext4_xattr_inode_array **ea_inode_array, /* * Start with 15 inodes, so it fits into a power-of-two size. */ - (*ea_inode_array) = kmalloc( - struct_size(*ea_inode_array, inodes, EIA_MASK), - GFP_NOFS); + (*ea_inode_array) = kmalloc_flex(**ea_inode_array, inodes, + EIA_MASK, GFP_NOFS); if (*ea_inode_array == NULL) return -ENOMEM; (*ea_inode_array)->count = 0; @@ -2886,10 +2885,9 @@ ext4_expand_inode_array(struct ext4_xattr_inode_array **ea_inode_array, /* expand the array once all 15 + n * 16 slots are full */ struct ext4_xattr_inode_array *new_array = NULL; - new_array = kmalloc( - struct_size(*ea_inode_array, inodes, - (*ea_inode_array)->count + EIA_INCR), - GFP_NOFS); + new_array = kmalloc_flex(**ea_inode_array, inodes, + (*ea_inode_array)->count + EIA_INCR, + GFP_NOFS); if (new_array == NULL) return -ENOMEM; memcpy(new_array, *ea_inode_array, diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 7c8e6eea60df..2a12fe8eb668 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3725,7 +3725,7 @@ static struct block_device **f2fs_get_devices(struct super_block *sb, if (!f2fs_is_multi_device(sbi)) return NULL; - devs = kmalloc_array(sbi->s_ndevs, sizeof(*devs), GFP_KERNEL); + devs = kmalloc_objs(*devs, sbi->s_ndevs, GFP_KERNEL); if (!devs) return ERR_PTR(-ENOMEM); @@ -4501,7 +4501,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, struct f2fs_super_block *super; int err = 0; - super = kzalloc(sizeof(struct f2fs_super_block), GFP_KERNEL); + super = kzalloc_obj(struct f2fs_super_block, GFP_KERNEL); if (!super) return -ENOMEM; @@ -4938,7 +4938,7 @@ try_onemore: recovery = 0; /* allocate memory for f2fs-specific super block info */ - sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct f2fs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -5509,7 +5509,7 @@ static int f2fs_init_fs_context(struct fs_context *fc) { struct f2fs_fs_context *ctx; - ctx = kzalloc(sizeof(struct f2fs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct f2fs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 59fa90617b5b..175e8e66c29f 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1554,7 +1554,7 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc, * the filesystem, since we're only just about to mount * it and have no inodes etc active! */ - sbi = kzalloc(sizeof(struct msdos_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct msdos_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; @@ -1905,7 +1905,7 @@ int fat_init_fs_context(struct fs_context *fc, bool is_vfat) { struct fat_mount_options *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 2acfe3123a72..87dcdd86272b 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@ -663,7 +663,7 @@ static int vfat_add_entry(struct inode *dir, const struct qstr *qname, if (len == 0) return -ENOENT; - slots = kmalloc_array(MSDOS_SLOTS, sizeof(*slots), GFP_NOFS); + slots = kmalloc_objs(*slots, MSDOS_SLOTS, GFP_NOFS); if (slots == NULL) return -ENOMEM; diff --git a/fs/fcntl.c b/fs/fcntl.c index f93dbca08435..c9c73305011e 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -100,7 +100,7 @@ int file_f_owner_allocate(struct file *file) if (f_owner) return 0; - f_owner = kzalloc(sizeof(struct fown_struct), GFP_KERNEL); + f_owner = kzalloc_obj(struct fown_struct, GFP_KERNEL); if (!f_owner) return -ENOMEM; diff --git a/fs/fhandle.c b/fs/fhandle.c index e15bcf4b0b23..fa4053f9e015 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -46,8 +46,8 @@ static long do_sys_name_to_handle(const struct path *path, if (f_handle.handle_bytes > MAX_HANDLE_SZ) return -EINVAL; - handle = kzalloc(struct_size(handle, f_handle, f_handle.handle_bytes), - GFP_KERNEL); + handle = kzalloc_flex(*handle, f_handle, f_handle.handle_bytes, + GFP_KERNEL); if (!handle) return -ENOMEM; @@ -368,8 +368,8 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh, if (retval) goto out_path; - handle = kmalloc(struct_size(handle, f_handle, f_handle.handle_bytes), - GFP_KERNEL); + handle = kmalloc_flex(*handle, f_handle, f_handle.handle_bytes, + GFP_KERNEL); if (!handle) { retval = -ENOMEM; goto out_path; diff --git a/fs/file.c b/fs/file.c index 51ddcff0081a..384c83ce768d 100644 --- a/fs/file.c +++ b/fs/file.c @@ -212,11 +212,11 @@ static struct fdtable *alloc_fdtable(unsigned int slots_wanted) if (unlikely(nr > INT_MAX / sizeof(struct file *))) return ERR_PTR(-EMFILE); - fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL_ACCOUNT); + fdt = kmalloc_obj(struct fdtable, GFP_KERNEL_ACCOUNT); if (!fdt) goto out; fdt->max_fds = nr; - data = kvmalloc_array(nr, sizeof(struct file *), GFP_KERNEL_ACCOUNT); + data = kvmalloc_objs(struct file *, nr, GFP_KERNEL_ACCOUNT); if (!data) goto out_fdt; fdt->fd = data; diff --git a/fs/freevxfs/vxfs_fshead.c b/fs/freevxfs/vxfs_fshead.c index c1174a3f8990..c1d90905b7b2 100644 --- a/fs/freevxfs/vxfs_fshead.c +++ b/fs/freevxfs/vxfs_fshead.c @@ -58,7 +58,7 @@ vxfs_getfsh(struct inode *ip, int which) if (bp) { struct vxfs_fsh *fhp; - if (!(fhp = kmalloc(sizeof(*fhp), GFP_KERNEL))) + if (!(fhp = kmalloc_obj(*fhp, GFP_KERNEL))) goto out; memcpy(fhp, bp->b_data, sizeof(*fhp)); diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index fabe60778658..44b4958277ce 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c @@ -193,7 +193,7 @@ static int vxfs_fill_super(struct super_block *sbp, struct fs_context *fc) sbp->s_flags |= SB_RDONLY; - infp = kzalloc(sizeof(*infp), GFP_KERNEL); + infp = kzalloc_obj(*infp, GFP_KERNEL); if (!infp) { warnf(fc, "vxfs: unable to allocate incore superblock"); return -ENOMEM; diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 68228bf89b82..22a1996c00cd 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -653,7 +653,7 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) if (atomic_read(&isw_nr_in_flight) > WB_FRN_MAX_IN_FLIGHT) return; - isw = kzalloc(struct_size(isw, inodes, 2), GFP_ATOMIC); + isw = kzalloc_flex(*isw, inodes, 2, GFP_ATOMIC); if (!isw) return; @@ -724,8 +724,7 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb) int nr; bool restart = false; - isw = kzalloc(struct_size(isw, inodes, WB_MAX_INODES_PER_ISW), - GFP_KERNEL); + isw = kzalloc_flex(*isw, inodes, WB_MAX_INODES_PER_ISW, GFP_KERNEL); if (!isw) return restart; @@ -1075,7 +1074,7 @@ restart: nr_pages = wb_split_bdi_pages(wb, base_work->nr_pages); - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) { *work = *base_work; work->nr_pages = nr_pages; @@ -1173,7 +1172,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, dirty = dirty * 10 / 8; /* issue the writeback work */ - work = kzalloc(sizeof(*work), GFP_NOWAIT); + work = kzalloc_obj(*work, GFP_NOWAIT); if (work) { work->nr_pages = dirty; work->sync_mode = WB_SYNC_NONE; diff --git a/fs/fs_context.c b/fs/fs_context.c index 81ed94f46cac..a37b0a093505 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -264,7 +264,7 @@ static struct fs_context *alloc_fs_context(struct file_system_type *fs_type, struct fs_context *fc; int ret = -ENOMEM; - fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL_ACCOUNT); + fc = kzalloc_obj(struct fs_context, GFP_KERNEL_ACCOUNT); if (!fc) return ERR_PTR(-ENOMEM); diff --git a/fs/fsopen.c b/fs/fsopen.c index 614922623675..a23f003ae056 100644 --- a/fs/fsopen.c +++ b/fs/fsopen.c @@ -102,7 +102,7 @@ static int fscontext_create_fd(struct fs_context *fc, unsigned int o_flags) static int fscontext_alloc_log(struct fs_context *fc) { - fc->log.log = kzalloc(sizeof(*fc->log.log), GFP_KERNEL); + fc->log.log = kzalloc_obj(*fc->log.log, GFP_KERNEL); if (!fc->log.log) return -ENOMEM; refcount_set(&fc->log.log->usage, 1); diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 4afda419dd14..45a78ee15e3c 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -112,7 +112,7 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map) if (backing_sb->s_stack_depth >= fc->max_stack_depth) goto out_fput; - fb = kmalloc(sizeof(struct fuse_backing), GFP_KERNEL); + fb = kmalloc_obj(struct fuse_backing, GFP_KERNEL); res = -ENOMEM; if (!fb) goto out_fput; diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index 28c96961e85d..0aace951541b 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -362,7 +362,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm, /* devt determined, create device */ rc = -ENOMEM; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto err_region; @@ -443,7 +443,7 @@ static int cuse_send_init(struct cuse_conn *cc) if (!folio) goto err; - ia = kzalloc(sizeof(*ia), GFP_KERNEL); + ia = kzalloc_obj(*ia, GFP_KERNEL); if (!ia) goto err_free_folio; @@ -505,7 +505,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file) int rc; /* set up cuse_conn */ - cc = kzalloc(sizeof(*cc), GFP_KERNEL); + cc = kzalloc_obj(*cc, GFP_KERNEL); if (!cc) return -ENOMEM; diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index ac6d4c1064cc..7d11eac4f629 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -257,7 +257,7 @@ static int dmap_removemapping_list(struct inode *inode, unsigned int num, int ret, i = 0, nr_alloc; nr_alloc = min_t(unsigned int, num, FUSE_REMOVEMAPPING_MAX_ENTRY); - remove_one = kmalloc_array(nr_alloc, sizeof(*remove_one), GFP_NOFS); + remove_one = kmalloc_objs(*remove_one, nr_alloc, GFP_NOFS); if (!remove_one) return -ENOMEM; @@ -1219,7 +1219,7 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd) __func__, nr_pages, nr_ranges); for (i = 0; i < nr_ranges; i++) { - range = kzalloc(sizeof(struct fuse_dax_mapping), GFP_KERNEL); + range = kzalloc_obj(struct fuse_dax_mapping, GFP_KERNEL); ret = -ENOMEM; if (!range) goto out_err; @@ -1255,7 +1255,7 @@ int fuse_dax_conn_alloc(struct fuse_conn *fc, enum fuse_dax_mode dax_mode, if (!dax_dev) return 0; - fcd = kzalloc(sizeof(*fcd), GFP_KERNEL); + fcd = kzalloc_obj(*fcd, GFP_KERNEL); if (!fcd) return -ENOMEM; @@ -1277,7 +1277,7 @@ bool fuse_dax_inode_alloc(struct super_block *sb, struct fuse_inode *fi) fi->dax = NULL; if (fc->dax) { - fi->dax = kzalloc(sizeof(*fi->dax), GFP_KERNEL_ACCOUNT); + fi->dax = kzalloc_obj(*fi->dax, GFP_KERNEL_ACCOUNT); if (!fi->dax) return false; diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index a30c8b57d478..3ec0fa236da0 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1598,8 +1598,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, if (IS_ERR(fud)) return PTR_ERR(fud); - bufs = kvmalloc_array(pipe->max_usage, sizeof(struct pipe_buffer), - GFP_KERNEL); + bufs = kvmalloc_objs(struct pipe_buffer, pipe->max_usage, GFP_KERNEL); if (!bufs) return -ENOMEM; @@ -2311,7 +2310,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, tail = pipe->tail; count = pipe_occupancy(head, tail); - bufs = kvmalloc_array(count, sizeof(struct pipe_buffer), GFP_KERNEL); + bufs = kvmalloc_objs(struct pipe_buffer, count, GFP_KERNEL); if (!bufs) { pipe_unlock(pipe); return -ENOMEM; diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 5ceb217ced1b..aee37347b652 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -231,12 +231,12 @@ static struct fuse_ring *fuse_uring_create(struct fuse_conn *fc) struct fuse_ring *res = NULL; size_t max_payload_size; - ring = kzalloc(sizeof(*fc->ring), GFP_KERNEL_ACCOUNT); + ring = kzalloc_obj(*fc->ring, GFP_KERNEL_ACCOUNT); if (!ring) return NULL; - ring->queues = kcalloc(nr_queues, sizeof(struct fuse_ring_queue *), - GFP_KERNEL_ACCOUNT); + ring->queues = kzalloc_objs(struct fuse_ring_queue *, nr_queues, + GFP_KERNEL_ACCOUNT); if (!ring->queues) goto out_err; @@ -274,10 +274,10 @@ static struct fuse_ring_queue *fuse_uring_create_queue(struct fuse_ring *ring, struct fuse_ring_queue *queue; struct list_head *pq; - queue = kzalloc(sizeof(*queue), GFP_KERNEL_ACCOUNT); + queue = kzalloc_obj(*queue, GFP_KERNEL_ACCOUNT); if (!queue) return NULL; - pq = kcalloc(FUSE_PQ_HASH_SIZE, sizeof(struct list_head), GFP_KERNEL); + pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE, GFP_KERNEL); if (!pq) { kfree(queue); return NULL; @@ -1062,7 +1062,7 @@ fuse_uring_create_ring_ent(struct io_uring_cmd *cmd, } err = -ENOMEM; - ent = kzalloc(sizeof(*ent), GFP_KERNEL_ACCOUNT); + ent = kzalloc_obj(*ent, GFP_KERNEL_ACCOUNT); if (!ent) return ERR_PTR(err); diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index f25ee47822ad..7ac6b232ef12 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -473,8 +473,8 @@ static int fuse_dentry_init(struct dentry *dentry) { struct fuse_dentry *fd; - fd = kzalloc(sizeof(struct fuse_dentry), - GFP_KERNEL_ACCOUNT | __GFP_RECLAIMABLE); + fd = kzalloc_obj(struct fuse_dentry, + GFP_KERNEL_ACCOUNT | __GFP_RECLAIMABLE); if (!fd) return -ENOMEM; diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 80765ab6d04a..e29aecdab97e 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -56,13 +56,13 @@ struct fuse_file *fuse_file_alloc(struct fuse_mount *fm, bool release) { struct fuse_file *ff; - ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL_ACCOUNT); + ff = kzalloc_obj(struct fuse_file, GFP_KERNEL_ACCOUNT); if (unlikely(!ff)) return NULL; ff->fm = fm; if (release) { - ff->args = kzalloc(sizeof(*ff->args), GFP_KERNEL_ACCOUNT); + ff->args = kzalloc_obj(*ff->args, GFP_KERNEL_ACCOUNT); if (!ff->args) { kfree(ff); return NULL; @@ -684,7 +684,7 @@ static struct fuse_io_args *fuse_io_alloc(struct fuse_io_priv *io, { struct fuse_io_args *ia; - ia = kzalloc(sizeof(*ia), GFP_KERNEL); + ia = kzalloc_obj(*ia, GFP_KERNEL); if (ia) { ia->io = io; ia->ap.folios = fuse_folios_alloc(nfolios, GFP_KERNEL, @@ -2045,7 +2045,7 @@ static struct fuse_writepage_args *fuse_writepage_args_alloc(void) struct fuse_writepage_args *wpa; struct fuse_args_pages *ap; - wpa = kzalloc(sizeof(*wpa), GFP_NOFS); + wpa = kzalloc_obj(*wpa, GFP_NOFS); if (wpa) { ap = &wpa->ia.ap; ap->num_folios = 0; @@ -2834,7 +2834,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter) if ((iov_iter_rw(iter) == READ) && (offset >= i_size)) return 0; - io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL); + io = kmalloc_obj(struct fuse_io_priv, GFP_KERNEL); if (!io) return -ENOMEM; spin_lock_init(&io->lock); diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 819e50d66622..3db0fe0d764b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -74,14 +74,14 @@ static struct file_system_type fuseblk_fs_type; struct fuse_forget_link *fuse_alloc_forget(void) { - return kzalloc(sizeof(struct fuse_forget_link), GFP_KERNEL_ACCOUNT); + return kzalloc_obj(struct fuse_forget_link, GFP_KERNEL_ACCOUNT); } static struct fuse_submount_lookup *fuse_alloc_submount_lookup(void) { struct fuse_submount_lookup *sl; - sl = kzalloc(sizeof(struct fuse_submount_lookup), GFP_KERNEL_ACCOUNT); + sl = kzalloc_obj(struct fuse_submount_lookup, GFP_KERNEL_ACCOUNT); if (!sl) return NULL; sl->forget = fuse_alloc_forget(); @@ -684,7 +684,7 @@ static struct fuse_sync_bucket *fuse_sync_bucket_alloc(void) { struct fuse_sync_bucket *bucket; - bucket = kzalloc(sizeof(*bucket), GFP_KERNEL | __GFP_NOFAIL); + bucket = kzalloc_obj(*bucket, GFP_KERNEL | __GFP_NOFAIL); if (bucket) { init_waitqueue_head(&bucket->waitq); /* Initial active count */ @@ -1487,7 +1487,7 @@ static struct fuse_init_args *fuse_new_init(struct fuse_mount *fm) struct fuse_init_args *ia; u64 flags; - ia = kzalloc(sizeof(*ia), GFP_KERNEL | __GFP_NOFAIL); + ia = kzalloc_obj(*ia, GFP_KERNEL | __GFP_NOFAIL); ia->in.major = FUSE_KERNEL_VERSION; ia->in.minor = FUSE_KERNEL_MINOR_VERSION; @@ -1618,11 +1618,11 @@ struct fuse_dev *fuse_dev_alloc(void) struct fuse_dev *fud; struct list_head *pq; - fud = kzalloc(sizeof(struct fuse_dev), GFP_KERNEL); + fud = kzalloc_obj(struct fuse_dev, GFP_KERNEL); if (!fud) return NULL; - pq = kcalloc(FUSE_PQ_HASH_SIZE, sizeof(struct list_head), GFP_KERNEL); + pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE, GFP_KERNEL); if (!pq) { kfree(fud); return NULL; @@ -1780,7 +1780,7 @@ static int fuse_get_tree_submount(struct fs_context *fsc) struct super_block *sb; int err; - fm = kzalloc(sizeof(struct fuse_mount), GFP_KERNEL); + fm = kzalloc_obj(struct fuse_mount, GFP_KERNEL); if (!fm) return -ENOMEM; @@ -1981,11 +1981,11 @@ static int fuse_get_tree(struct fs_context *fsc) struct super_block *sb; int err; - fc = kmalloc(sizeof(*fc), GFP_KERNEL); + fc = kmalloc_obj(*fc, GFP_KERNEL); if (!fc) return -ENOMEM; - fm = kzalloc(sizeof(*fm), GFP_KERNEL); + fm = kzalloc_obj(*fm, GFP_KERNEL); if (!fm) { kfree(fc); return -ENOMEM; @@ -2047,7 +2047,7 @@ static int fuse_init_fs_context(struct fs_context *fsc) { struct fuse_fs_context *ctx; - ctx = kzalloc(sizeof(struct fuse_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct fuse_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index b2f6486fe1d5..dc96ee0b952a 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -839,7 +839,7 @@ static void virtio_fs_requests_done_work(struct work_struct *work) if (req->args->may_block) { struct virtio_fs_req_work *w; - w = kzalloc(sizeof(*w), GFP_NOFS | __GFP_NOFAIL); + w = kzalloc_obj(*w, GFP_NOFS | __GFP_NOFAIL); INIT_WORK(&w->done_work, virtio_fs_complete_req_work); w->fsvq = fsvq; w->req = req; @@ -947,14 +947,14 @@ static int virtio_fs_setup_vqs(struct virtio_device *vdev, fs->num_request_queues = min_t(unsigned int, fs->num_request_queues, nr_cpu_ids); fs->nvqs = VQ_REQUEST + fs->num_request_queues; - fs->vqs = kcalloc(fs->nvqs, sizeof(fs->vqs[VQ_HIPRIO]), GFP_KERNEL); + fs->vqs = kzalloc_objs(fs->vqs[VQ_HIPRIO], fs->nvqs, GFP_KERNEL); if (!fs->vqs) return -ENOMEM; - vqs = kmalloc_array(fs->nvqs, sizeof(vqs[VQ_HIPRIO]), GFP_KERNEL); + vqs = kmalloc_objs(vqs[VQ_HIPRIO], fs->nvqs, GFP_KERNEL); fs->mq_map = kcalloc_node(nr_cpu_ids, sizeof(*fs->mq_map), GFP_KERNEL, dev_to_node(&vdev->dev)); - vqs_info = kcalloc(fs->nvqs, sizeof(*vqs_info), GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, fs->nvqs, GFP_KERNEL); if (!vqs || !vqs_info || !fs->mq_map) { ret = -ENOMEM; goto out; @@ -1120,7 +1120,7 @@ static int virtio_fs_probe(struct virtio_device *vdev) struct virtio_fs *fs; int ret; - fs = kzalloc(sizeof(*fs), GFP_KERNEL); + fs = kzalloc_obj(*fs, GFP_KERNEL); if (!fs) return -ENOMEM; kobject_init(&fs->kobj, &virtio_fs_ktype); @@ -1240,7 +1240,7 @@ static void virtio_fs_send_forget(struct fuse_iqueue *fiq, struct fuse_forget_li u64 unique = fuse_get_unique(fiq); /* Allocate a buffer for the request */ - forget = kmalloc(sizeof(*forget), GFP_NOFS | __GFP_NOFAIL); + forget = kmalloc_obj(*forget, GFP_NOFS | __GFP_NOFAIL); req = &forget->req; req->ih = (struct fuse_in_header){ @@ -1390,8 +1390,8 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq, /* Does the sglist fit on the stack? */ total_sgs = sg_count_fuse_req(req); if (total_sgs > ARRAY_SIZE(stack_sgs)) { - sgs = kmalloc_array(total_sgs, sizeof(sgs[0]), gfp); - sg = kmalloc_array(total_sgs, sizeof(sg[0]), gfp); + sgs = kmalloc_objs(sgs[0], total_sgs, gfp); + sg = kmalloc_objs(sg[0], total_sgs, gfp); if (!sgs || !sg) { ret = -ENOMEM; goto out; @@ -1684,11 +1684,11 @@ static int virtio_fs_get_tree(struct fs_context *fsc) goto out_err; err = -ENOMEM; - fc = kzalloc(sizeof(struct fuse_conn), GFP_KERNEL); + fc = kzalloc_obj(struct fuse_conn, GFP_KERNEL); if (!fc) goto out_err; - fm = kzalloc(sizeof(struct fuse_mount), GFP_KERNEL); + fm = kzalloc_obj(struct fuse_mount, GFP_KERNEL); if (!fm) goto out_err; @@ -1743,7 +1743,7 @@ static int virtio_fs_init_fs_context(struct fs_context *fsc) if (fsc->purpose == FS_CONTEXT_FOR_SUBMOUNT) return fuse_init_fs_context_submount(fsc); - ctx = kzalloc(sizeof(struct fuse_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct fuse_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; fsc->fs_private = ctx; diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index fdcac8e3f2ba..1cd8ec0bce83 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -2225,7 +2225,7 @@ static int gfs2_add_jextent(struct gfs2_jdesc *jd, u64 lblock, u64 dblock, u64 b } } - jext = kzalloc(sizeof(struct gfs2_journal_extent), GFP_NOFS); + jext = kzalloc_obj(struct gfs2_journal_extent, GFP_NOFS); if (jext == NULL) return -ENOMEM; jext->dblock = dblock; diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 509e2f0d97e7..022dbb31e0d9 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -1593,7 +1593,7 @@ int gfs2_dir_read(struct inode *inode, struct dir_context *ctx, error = -ENOMEM; /* 96 is max number of dirents which can be stuffed into an inode */ - darr = kmalloc_array(96, sizeof(struct gfs2_dirent *), GFP_NOFS); + darr = kmalloc_objs(struct gfs2_dirent *, 96, GFP_NOFS); if (darr) { g.pdent = (const struct gfs2_dirent **)darr; g.offset = 0; diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 3e061e8115ec..9704f1ef6ad1 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -637,7 +637,7 @@ int gfs2_open_common(struct inode *inode, struct file *file) file->f_mode |= FMODE_CAN_ODIRECT; } - fp = kzalloc(sizeof(struct gfs2_file), GFP_NOFS); + fp = kzalloc_obj(struct gfs2_file, GFP_NOFS); if (!fp) return -ENOMEM; @@ -1029,7 +1029,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb, */ if (inode == sdp->sd_rindex) { - statfs_gh = kmalloc(sizeof(*statfs_gh), GFP_NOFS); + statfs_gh = kmalloc_obj(*statfs_gh, GFP_NOFS); if (!statfs_gh) return -ENOMEM; } diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6fb2731e8be1..2acbabccc8ad 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1764,8 +1764,7 @@ int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs) default: if (num_gh <= 4) break; - pph = kmalloc_array(num_gh, sizeof(struct gfs2_holder *), - GFP_NOFS); + pph = kmalloc_objs(struct gfs2_holder *, num_gh, GFP_NOFS); if (!pph) return -ENOMEM; } diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index c7d57de7c8f0..f3f649fc5cb1 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -76,7 +76,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) { struct gfs2_sbd *sdp; - sdp = kzalloc(sizeof(struct gfs2_sbd), GFP_KERNEL); + sdp = kzalloc_obj(struct gfs2_sbd, GFP_KERNEL); if (!sdp) return NULL; @@ -562,7 +562,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh) break; error = -ENOMEM; - jd = kzalloc(sizeof(struct gfs2_jdesc), GFP_KERNEL); + jd = kzalloc_obj(struct gfs2_jdesc, GFP_KERNEL); if (!jd) break; @@ -631,7 +631,7 @@ static int init_statfs(struct gfs2_sbd *sdp) * per_node metafs directory and save it in the sdp->sd_sc_inodes_list. */ list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) { struct local_statfs_inode *lsi = - kmalloc(sizeof(struct local_statfs_inode), GFP_NOFS); + kmalloc_obj(struct local_statfs_inode, GFP_NOFS); if (!lsi) { error = -ENOMEM; goto free_local; @@ -1637,7 +1637,7 @@ static int gfs2_init_fs_context(struct fs_context *fc) { struct gfs2_args *args; - args = kmalloc(sizeof(*args), GFP_KERNEL); + args = kmalloc_obj(*args, GFP_KERNEL); if (args == NULL) return -ENOMEM; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 1c3455093ae8..af3dfeed62fe 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -908,7 +908,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda, gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota), &data_blocks, &ind_blocks); - ghs = kmalloc_array(num_qd, sizeof(struct gfs2_holder), GFP_NOFS); + ghs = kmalloc_objs(struct gfs2_holder, num_qd, GFP_NOFS); if (!ghs) return -ENOMEM; @@ -1318,7 +1318,7 @@ int gfs2_quota_sync(struct super_block *sb, int type) if (sb_rdonly(sdp->sd_vfs)) return 0; - qda = kcalloc(max_qd, sizeof(struct gfs2_quota_data *), GFP_KERNEL); + qda = kzalloc_objs(struct gfs2_quota_data *, max_qd, GFP_KERNEL); if (!qda) return -ENOMEM; diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 8c8202c68b64..616c46aa3434 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -69,7 +69,7 @@ int gfs2_revoke_add(struct gfs2_jdesc *jd, u64 blkno, unsigned int where) return 0; } - rr = kmalloc(sizeof(struct gfs2_revoke_replay), GFP_NOFS); + rr = kmalloc_obj(struct gfs2_revoke_replay, GFP_NOFS); if (!rr) return -ENOMEM; diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 8a97ca734afc..441774cc07ce 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -763,7 +763,7 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd) if (!length) return -EINVAL; - rgd->rd_bits = kcalloc(length, sizeof(struct gfs2_bitmap), GFP_NOFS); + rgd->rd_bits = kzalloc_objs(struct gfs2_bitmap, length, GFP_NOFS); if (!rgd->rd_bits) return -ENOMEM; @@ -2699,8 +2699,8 @@ void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist, if (rlist->rl_rgrps == rlist->rl_space) { new_space = rlist->rl_space + 10; - tmp = kcalloc(new_space, sizeof(struct gfs2_rgrpd *), - GFP_NOFS | __GFP_NOFAIL); + tmp = kzalloc_objs(struct gfs2_rgrpd *, new_space, + GFP_NOFS | __GFP_NOFAIL); if (rlist->rl_rgd) { memcpy(tmp, rlist->rl_rgd, @@ -2731,9 +2731,8 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, { unsigned int x; - rlist->rl_ghs = kmalloc_array(rlist->rl_rgrps, - sizeof(struct gfs2_holder), - GFP_NOFS | __GFP_NOFAIL); + rlist->rl_ghs = kmalloc_objs(struct gfs2_holder, rlist->rl_rgrps, + GFP_NOFS | __GFP_NOFAIL); for (x = 0; x < rlist->rl_rgrps; x++) gfs2_holder_init(rlist->rl_rgd[x]->rd_gl, state, flags, &rlist->rl_ghs[x]); diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index d96160636161..9a655588c0c5 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -336,7 +336,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) */ list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) { - lfcc = kmalloc(sizeof(struct lfcc), GFP_KERNEL); + lfcc = kmalloc_obj(struct lfcc, GFP_KERNEL); if (!lfcc) { error = -ENOMEM; goto out; @@ -860,7 +860,7 @@ static int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host int error = 0, err; memset(sc, 0, sizeof(struct gfs2_statfs_change_host)); - gha = kmalloc_array(slots, sizeof(struct gfs2_holder), GFP_KERNEL); + gha = kmalloc_objs(struct gfs2_holder, slots, GFP_KERNEL); if (!gha) return -ENOMEM; for (x = 0; x < slots; x++) diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index df9c93de94c7..b9f48d6f10a9 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -467,7 +467,7 @@ static int gfs2_iter_unstuffed(struct gfs2_inode *ip, struct gfs2_ea_header *ea, unsigned char *pos; unsigned cp_size; - bh = kcalloc(nptrs, sizeof(struct buffer_head *), GFP_NOFS); + bh = kzalloc_objs(struct buffer_head *, nptrs, GFP_NOFS); if (!bh) return -ENOMEM; diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index 7bc425283d49..b5ee0e072935 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c @@ -28,7 +28,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke sector_t start_block; loff_t offset; - tree = kzalloc(sizeof(*tree), GFP_KERNEL); + tree = kzalloc_obj(*tree, GFP_KERNEL); if (!tree) return NULL; diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 0c615c078650..80277979c09c 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -148,7 +148,7 @@ static int hfs_readdir(struct file *file, struct dir_context *ctx) } rd = file->private_data; if (!rd) { - rd = kmalloc(sizeof(struct hfs_readdir_data), GFP_KERNEL); + rd = kmalloc_obj(struct hfs_readdir_data, GFP_KERNEL); if (!rd) { err = -ENOMEM; goto out; diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 97546d6b41f4..78dc9dabb0c1 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -411,7 +411,7 @@ static int hfs_init_fs_context(struct fs_context *fc) { struct hfs_sb_info *hsb; - hsb = kzalloc(sizeof(struct hfs_sb_info), GFP_KERNEL); + hsb = kzalloc_obj(struct hfs_sb_info, GFP_KERNEL); if (!hsb) return -ENOMEM; diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c index 229f25dc7c49..5016d97290c8 100644 --- a/fs/hfsplus/btree.c +++ b/fs/hfsplus/btree.c @@ -139,7 +139,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) struct page *page; unsigned int size; - tree = kzalloc(sizeof(*tree), GFP_KERNEL); + tree = kzalloc_obj(*tree, GFP_KERNEL); if (!tree) return NULL; diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index ca5f74a140ec..9998b28aa8f7 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -263,7 +263,7 @@ next: } rd = file->private_data; if (!rd) { - rd = kmalloc(sizeof(struct hfsplus_readdir_data), GFP_KERNEL); + rd = kmalloc_obj(struct hfsplus_readdir_data, GFP_KERNEL); if (!rd) { err = -ENOMEM; goto out; diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 592d8fbb748c..f60f37caea65 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -698,7 +698,7 @@ static int hfsplus_init_fs_context(struct fs_context *fc) { struct hfsplus_sb_info *sbi; - sbi = kzalloc(sizeof(struct hfsplus_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct hfsplus_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; diff --git a/fs/hfsplus/unicode_test.c b/fs/hfsplus/unicode_test.c index 5a7a6859efe3..c162c0fea4a8 100644 --- a/fs/hfsplus/unicode_test.c +++ b/fs/hfsplus/unicode_test.c @@ -22,7 +22,7 @@ static struct test_mock_string_env *setup_mock_str_env(u32 buf_size) { struct test_mock_string_env *env; - env = kzalloc(sizeof(struct test_mock_string_env), GFP_KERNEL); + env = kzalloc_obj(struct test_mock_string_env, GFP_KERNEL); if (!env) return NULL; @@ -393,7 +393,7 @@ static struct test_mock_sb *setup_mock_sb(void) { struct test_mock_sb *ptr; - ptr = kzalloc(sizeof(struct test_mock_sb), GFP_KERNEL); + ptr = kzalloc_obj(struct test_mock_sb, GFP_KERNEL); if (!ptr) return NULL; diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 51d26aa2b93e..2c463a8c0ab4 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -1047,7 +1047,7 @@ static int hostfs_init_fs_context(struct fs_context *fc) { struct hostfs_fs_info *fsi; - fsi = kzalloc(sizeof(*fsi), GFP_KERNEL); + fsi = kzalloc_obj(*fsi, GFP_KERNEL); if (!fsi) return -ENOMEM; diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c index 4ada525c5c43..dde764ebe246 100644 --- a/fs/hpfs/dnode.c +++ b/fs/hpfs/dnode.c @@ -33,7 +33,7 @@ int hpfs_add_pos(struct inode *inode, loff_t *pos) if (hpfs_inode->i_rddir_off[i] == pos) return 0; if (!(i&0x0f)) { - ppos = kmalloc_array(i + 0x11, sizeof(loff_t *), GFP_NOFS); + ppos = kmalloc_objs(loff_t *, i + 0x11, GFP_NOFS); if (!ppos) { pr_err("out of memory for position list\n"); return -ENOMEM; diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 371aa6de8075..0f17b7710ae5 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -513,7 +513,7 @@ static int hpfs_fill_super(struct super_block *s, struct fs_context *fc) struct hpfs_dirent *de = NULL; struct quad_buffer_head qbh; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) { return -ENOMEM; } @@ -715,7 +715,7 @@ static int hpfs_init_fs_context(struct fs_context *fc) { struct hpfs_fc_context *ctx; - ctx = kzalloc(sizeof(struct hpfs_fc_context), GFP_KERNEL); + ctx = kzalloc_obj(struct hpfs_fc_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 95a5b23b4808..8e2c1fbdfd86 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1407,7 +1407,7 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc) struct hugetlbfs_fs_context *ctx = fc->fs_private; struct hugetlbfs_sb_info *sbinfo; - sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); + sbinfo = kmalloc_obj(struct hugetlbfs_sb_info, GFP_KERNEL); if (!sbinfo) return -ENOMEM; sb->s_fs_info = sbinfo; @@ -1478,7 +1478,7 @@ static int hugetlbfs_init_fs_context(struct fs_context *fc) { struct hugetlbfs_fs_context *ctx; - ctx = kzalloc(sizeof(struct hugetlbfs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct hugetlbfs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 1fe19b4ee2f4..a0c46aadb97d 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -229,8 +229,7 @@ static struct iomap_folio_state *ifs_alloc(struct inode *inode, * The first state tracks per-block uptodate and the * second tracks per-block dirty state. */ - ifs = kzalloc(struct_size(ifs, state, - BITS_TO_LONGS(2 * nr_blocks)), gfp); + ifs = kzalloc_flex(*ifs, state, BITS_TO_LONGS(2 * nr_blocks), gfp); if (!ifs) return ifs; diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 8c1fd7573aee..438c00e526c6 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -677,7 +677,7 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, if (!iomi.len) return NULL; - dio = kmalloc(sizeof(*dio), GFP_KERNEL); + dio = kmalloc_obj(*dio, GFP_KERNEL); if (!dio) return ERR_PTR(-ENOMEM); diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 5f3b6da0e022..4aa8f0734456 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c @@ -75,7 +75,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start, /* Because zlib is not thread-safe, do all the I/O at the top. */ blocknum = block_start >> bufshift; - bhs = kcalloc(needblocks + 1, sizeof(*bhs), GFP_KERNEL); + bhs = kzalloc_objs(*bhs, needblocks + 1, GFP_KERNEL); if (!bhs) { *errp = -ENOMEM; return 0; @@ -333,8 +333,9 @@ static int zisofs_read_folio(struct file *file, struct folio *folio) full_page = 0; pcount = 1; } - pages = kcalloc(max_t(unsigned int, zisofs_pages_per_cblock, 1), - sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, + max_t(unsigned int, zisofs_pages_per_cblock, 1), + GFP_KERNEL); if (!pages) { folio_unlock(folio); return -ENOMEM; diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index b7cbe126faf3..6597d0224835 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -589,7 +589,7 @@ static int isofs_fill_super(struct super_block *s, struct fs_context *fc) unsigned int vol_desc_start; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; s->s_fs_info = sbi; @@ -1557,7 +1557,7 @@ static int isofs_init_fs_context(struct fs_context *fc) { struct isofs_options *opt; - opt = kzalloc(sizeof(*opt), GFP_KERNEL); + opt = kzalloc_obj(*opt, GFP_KERNEL); if (!opt) return -ENOMEM; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index c973162d5b31..05ea1e5af80d 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1175,7 +1175,7 @@ static int jbd2_seq_info_open(struct inode *inode, struct file *file) struct jbd2_stats_proc_session *s; int rc, size; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (s == NULL) return -ENOMEM; size = sizeof(struct transaction_stats_s); @@ -1525,7 +1525,7 @@ static journal_t *journal_init_common(struct block_device *bdev, int err; int n; - journal = kzalloc(sizeof(*journal), GFP_KERNEL); + journal = kzalloc_obj(*journal, GFP_KERNEL); if (!journal) return ERR_PTR(-ENOMEM); @@ -1578,8 +1578,7 @@ static journal_t *journal_init_common(struct block_device *bdev, n = journal->j_blocksize / jbd2_min_tag_size(); journal->j_wbufsize = n; journal->j_fc_wbuf = NULL; - journal->j_wbuf = kmalloc_array(n, sizeof(struct buffer_head *), - GFP_KERNEL); + journal->j_wbuf = kmalloc_objs(struct buffer_head *, n, GFP_KERNEL); if (!journal->j_wbuf) goto err_cleanup; @@ -2269,8 +2268,8 @@ jbd2_journal_initialize_fast_commit(journal_t *journal) /* Are we called twice? */ WARN_ON(journal->j_fc_wbuf != NULL); - journal->j_fc_wbuf = kmalloc_array(num_fc_blks, - sizeof(struct buffer_head *), GFP_KERNEL); + journal->j_fc_wbuf = kmalloc_objs(struct buffer_head *, num_fc_blks, + GFP_KERNEL); if (!journal->j_fc_wbuf) return -ENOMEM; diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index 1467f6790747..3aa9f82a8ef7 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -231,7 +231,7 @@ struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size) table->hash_size = hash_size; table->hash_shift = shift; table->hash_table = - kvmalloc_array(hash_size, sizeof(struct list_head), GFP_KERNEL); + kvmalloc_objs(struct list_head, hash_size, GFP_KERNEL); if (!table->hash_table) { kmem_cache_free(jbd2_revoke_table_cache, table); table = NULL; diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 888a7ceb6479..b7ece06cad80 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c @@ -133,8 +133,7 @@ static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size) size_t i; *size = jffs2_acl_size(acl->a_count); - header = kmalloc(struct_size(header, a_entries, acl->a_count), - GFP_KERNEL); + header = kmalloc_flex(*header, a_entries, acl->a_count, GFP_KERNEL); if (!header) return ERR_PTR(-ENOMEM); header->a_version = cpu_to_je32(JFFS2_ACL_VERSION); diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index fda9f4d6093f..d451c8a1fdac 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c @@ -43,7 +43,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, jffs2_dbg(1, "%s(): erase block %#08x (range %#08x-%#08x)\n", __func__, jeb->offset, jeb->offset, jeb->offset + c->sector_size); - instr = kzalloc(sizeof(struct erase_info), GFP_KERNEL); + instr = kzalloc_obj(struct erase_info, GFP_KERNEL); if (!instr) { pr_warn("kzalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); mutex_lock(&c->erase_free_sem); diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 764bba8ba999..ff469d44b92f 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -562,7 +562,8 @@ int jffs2_do_fill_super(struct super_block *sb, struct fs_context *fc) return ret; c->inocache_hashsize = calculate_inocache_hashsize(c->flash_size); - c->inocache_list = kcalloc(c->inocache_hashsize, sizeof(struct jffs2_inode_cache *), GFP_KERNEL); + c->inocache_list = kzalloc_objs(struct jffs2_inode_cache *, + c->inocache_hashsize, GFP_KERNEL); if (!c->inocache_list) { ret = -ENOMEM; goto out_wbuf; diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index f987f78a894e..eeca922d4da4 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -1392,7 +1392,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { struct jffs2_raw_inode n; - struct jffs2_inode_info *f = kzalloc(sizeof(*f), GFP_KERNEL); + struct jffs2_inode_info *f = kzalloc_obj(*f, GFP_KERNEL); int ret; if (!f) diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 62879c218d4b..39063e2131d6 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -132,7 +132,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) } if (jffs2_sum_active()) { - s = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL); + s = kzalloc_obj(struct jffs2_summary, GFP_KERNEL); if (!s) { JFFS2_WARNING("Can't allocate memory for summary\n"); ret = -ENOMEM; diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c index d83372d3e1a0..b9df829eff56 100644 --- a/fs/jffs2/summary.c +++ b/fs/jffs2/summary.c @@ -27,7 +27,7 @@ int jffs2_sum_init(struct jffs2_sb_info *c) { uint32_t sum_size = min_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE); - c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL); + c->summary = kzalloc_obj(struct jffs2_summary, GFP_KERNEL); if (!c->summary) { JFFS2_WARNING("Can't allocate memory for summary information!\n"); @@ -115,7 +115,8 @@ int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size) int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs) { - struct jffs2_sum_inode_mem *temp = kmalloc(sizeof(struct jffs2_sum_inode_mem), GFP_KERNEL); + struct jffs2_sum_inode_mem *temp = kmalloc_obj(struct jffs2_sum_inode_mem, + GFP_KERNEL); if (!temp) return -ENOMEM; @@ -159,7 +160,7 @@ int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, { struct jffs2_sum_xattr_mem *temp; - temp = kmalloc(sizeof(struct jffs2_sum_xattr_mem), GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xattr_mem, GFP_KERNEL); if (!temp) return -ENOMEM; @@ -177,7 +178,7 @@ int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, u { struct jffs2_sum_xref_mem *temp; - temp = kmalloc(sizeof(struct jffs2_sum_xref_mem), GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xref_mem, GFP_KERNEL); if (!temp) return -ENOMEM; @@ -263,7 +264,8 @@ int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, switch (je16_to_cpu(node->u.nodetype)) { case JFFS2_NODETYPE_INODE: { struct jffs2_sum_inode_mem *temp = - kmalloc(sizeof(struct jffs2_sum_inode_mem), GFP_KERNEL); + kmalloc_obj(struct jffs2_sum_inode_mem, + GFP_KERNEL); if (!temp) goto no_mem; @@ -314,7 +316,8 @@ int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, #ifdef CONFIG_JFFS2_FS_XATTR case JFFS2_NODETYPE_XATTR: { struct jffs2_sum_xattr_mem *temp; - temp = kmalloc(sizeof(struct jffs2_sum_xattr_mem), GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xattr_mem, + GFP_KERNEL); if (!temp) goto no_mem; @@ -329,7 +332,8 @@ int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, } case JFFS2_NODETYPE_XREF: { struct jffs2_sum_xref_mem *temp; - temp = kmalloc(sizeof(struct jffs2_sum_xref_mem), GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xref_mem, + GFP_KERNEL); if (!temp) goto no_mem; temp->nodetype = node->r.nodetype; diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 4545f885c41e..48fbf1594ce8 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -311,7 +311,7 @@ static int jffs2_init_fs_context(struct fs_context *fc) { struct jffs2_sb_info *ctx; - ctx = kzalloc(sizeof(struct jffs2_sb_info), GFP_KERNEL); + ctx = kzalloc_obj(struct jffs2_sb_info, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 3ab3f0ff7ebb..9775b9b84504 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c @@ -92,7 +92,7 @@ static void jffs2_wbuf_dirties_inode(struct jffs2_sb_info *c, uint32_t ino) if (jffs2_wbuf_pending_for_ino(c, ino)) return; - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) { jffs2_dbg(1, "No memory to allocate inodirty. Fallback to all considered dirty\n"); jffs2_clear_wbuf_ino_list(c); diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index defb4162c3d5..4452e6837b34 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c @@ -784,8 +784,8 @@ int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING)); - xref_tmphash = kcalloc(XREF_TMPHASH_SIZE, - sizeof(struct jffs2_xattr_ref *), GFP_KERNEL); + xref_tmphash = kzalloc_objs(struct jffs2_xattr_ref *, XREF_TMPHASH_SIZE, + GFP_KERNEL); if (!xref_tmphash) return -ENOMEM; diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index cdfa699cd7c8..368fcdd8c328 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -161,7 +161,7 @@ int dbMount(struct inode *ipbmap) * allocate/initialize the in-memory bmap descriptor */ /* allocate memory for the in-memory bmap descriptor */ - bmp = kmalloc(sizeof(struct bmap), GFP_KERNEL); + bmp = kmalloc_obj(struct bmap, GFP_KERNEL); if (bmp == NULL) return -ENOMEM; @@ -1593,7 +1593,7 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen) max_ranges = nblocks; do_div(max_ranges, minlen); range_cnt = min_t(u64, max_ranges + 1, 32 * 1024); - totrim = kmalloc_array(range_cnt, sizeof(struct range2trim), GFP_NOFS); + totrim = kmalloc_objs(struct range2trim, range_cnt, GFP_NOFS); if (totrim == NULL) { jfs_error(bmp->db_ipbmap->i_sb, "no memory for trim array\n"); IWRITE_UNLOCK(ipbmap); diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index ecb8e05b8b84..739fcb4a6fc8 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -102,7 +102,7 @@ int diMount(struct inode *ipimap) * allocate/initialize the in-memory inode map control structure */ /* allocate the in-memory inode map control structure. */ - imap = kzalloc(sizeof(struct inomap), GFP_KERNEL); + imap = kzalloc_obj(struct inomap, GFP_KERNEL); if (imap == NULL) return -ENOMEM; diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 5b1c5da04163..204cca8dd5d4 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1087,7 +1087,7 @@ int lmLogOpen(struct super_block *sb) } } - if (!(log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL))) { + if (!(log = kzalloc_obj(struct jfs_log, GFP_KERNEL))) { mutex_unlock(&jfs_log_mutex); return -ENOMEM; } @@ -1156,7 +1156,7 @@ static int open_inline_log(struct super_block *sb) struct jfs_log *log; int rc; - if (!(log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL))) + if (!(log = kzalloc_obj(struct jfs_log, GFP_KERNEL))) return -ENOMEM; INIT_LIST_HEAD(&log->sb_list); init_waitqueue_head(&log->syncwait); @@ -1190,7 +1190,7 @@ static int open_dummy_log(struct super_block *sb) mutex_lock(&jfs_log_mutex); if (!dummy_log) { - dummy_log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL); + dummy_log = kzalloc_obj(struct jfs_log, GFP_KERNEL); if (!dummy_log) { mutex_unlock(&jfs_log_mutex); return -ENOMEM; @@ -1818,7 +1818,7 @@ static int lbmLogInit(struct jfs_log * log) goto error; buffer = page_address(page); for (offset = 0; offset < PAGE_SIZE; offset += LOGPSIZE) { - lbuf = kmalloc(sizeof(struct lbuf), GFP_KERNEL); + lbuf = kmalloc_obj(struct lbuf, GFP_KERNEL); if (lbuf == NULL) { if (offset == 0) __free_page(page); diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 871cf4fb3636..64c6eaa7f3f2 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -98,7 +98,7 @@ static inline int insert_metapage(struct folio *folio, struct metapage *mp) a = folio->private; if (!a) { - a = kzalloc(sizeof(struct meta_anchor), GFP_NOFS); + a = kzalloc_obj(struct meta_anchor, GFP_NOFS); if (!a) return -ENOMEM; folio_attach_private(folio, a); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 3cfb86c5a36e..4c1510091fe2 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -449,7 +449,7 @@ static int jfs_fill_super(struct super_block *sb, struct fs_context *fc) jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); - sbi = kzalloc(sizeof(struct jfs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct jfs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -912,7 +912,7 @@ static int jfs_init_fs_context(struct fs_context *fc) { struct jfs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 29baeeb97871..3d0704e21f71 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -989,7 +989,7 @@ struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops, struct kernfs_root *root; struct kernfs_node *kn; - root = kzalloc(sizeof(*root), GFP_KERNEL); + root = kzalloc_obj(*root, GFP_KERNEL); if (!root) return ERR_PTR(-ENOMEM); diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 9adf36e6364b..d338875f0258 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -540,7 +540,7 @@ static int kernfs_get_open_node(struct kernfs_node *kn, if (!on) { /* not there, initialize a new one */ - on = kzalloc(sizeof(*on), GFP_KERNEL); + on = kzalloc_obj(*on, GFP_KERNEL); if (!on) { mutex_unlock(mutex); return -ENOMEM; @@ -638,7 +638,7 @@ static int kernfs_fop_open(struct inode *inode, struct file *file) /* allocate a kernfs_open_file for the file */ error = -ENOMEM; - of = kzalloc(sizeof(struct kernfs_open_file), GFP_KERNEL); + of = kzalloc_obj(struct kernfs_open_file, GFP_KERNEL); if (!of) goto err_out; diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index 3ac52e141766..dd38e2e21a17 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c @@ -370,7 +370,7 @@ int kernfs_get_tree(struct fs_context *fc) struct kernfs_super_info *info; int error; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; @@ -451,7 +451,7 @@ static void __init kernfs_mutex_init(void) static void __init kernfs_lock_init(void) { - kernfs_locks = kmalloc(sizeof(struct kernfs_global_locks), GFP_KERNEL); + kernfs_locks = kmalloc_obj(struct kernfs_global_locks, GFP_KERNEL); WARN_ON(!kernfs_locks); kernfs_mutex_init(); diff --git a/fs/libfs.c b/fs/libfs.c index f1860dff86f2..361d5203e464 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -731,7 +731,7 @@ struct pseudo_fs_context *init_pseudo(struct fs_context *fc, { struct pseudo_fs_context *ctx; - ctx = kzalloc(sizeof(struct pseudo_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct pseudo_fs_context, GFP_KERNEL); if (likely(ctx)) { ctx->magic = magic; fc->fs_private = ctx; @@ -1320,7 +1320,7 @@ int simple_attr_open(struct inode *inode, struct file *file, { struct simple_attr *attr; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) return -ENOMEM; diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index a7e0519ec024..372fe0cf830f 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -233,7 +233,7 @@ reclaimer(void *ptr) u32 nsmstate; struct net *net = host->net; - req = kmalloc(sizeof(*req), GFP_KERNEL); + req = kmalloc_obj(*req, GFP_KERNEL); if (!req) return 0; diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index cebcc283b7ce..e189b3ddfedf 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -105,7 +105,7 @@ static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_ow res = __nlmclnt_find_lockowner(host, owner); if (res == NULL) { spin_unlock(&host->h_lock); - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); spin_lock(&host->h_lock); res = __nlmclnt_find_lockowner(host, owner); if (res == NULL && new != NULL) { @@ -208,7 +208,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) struct nlm_rqst *call; for(;;) { - call = kzalloc(sizeof(*call), GFP_KERNEL); + call = kzalloc_obj(*call, GFP_KERNEL); if (call != NULL) { refcount_set(&call->a_count, 1); locks_init_lock(&call->a_args.lock.fl); diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 5e6877c37f73..12a745a543e0 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -126,7 +126,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, } } - host = kmalloc(sizeof(*host), GFP_KERNEL); + host = kmalloc_obj(*host, GFP_KERNEL); if (unlikely(host == NULL)) { dprintk("lockd: %s failed; no memory\n", __func__); nsm_release(nsm); diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 712df1e025d8..1dee1da9ee0f 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -233,7 +233,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, return NULL; /* Allocate memory for block, and initialize arguments */ - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (block == NULL) goto failed; kref_init(&block->b_count); @@ -380,7 +380,7 @@ static struct nlm_lockowner *nlmsvc_find_lockowner(struct nlm_host *host, pid_t if (res == NULL) { spin_unlock(&host->h_lock); - new = kmalloc(sizeof(*res), GFP_KERNEL); + new = kmalloc_obj(*res, GFP_KERNEL); spin_lock(&host->h_lock); res = __nlmsvc_find_lockowner(host, pid); if (res == NULL && new != NULL) { diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 9103896164f6..fcfeaf6d6855 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -128,7 +128,7 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, nlm_debug_print_fh("creating file for", &lock->fh); nfserr = nlm_lck_denied_nolocks; - file = kzalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc_obj(*file, GFP_KERNEL); if (!file) goto out_free; diff --git a/fs/mbcache.c b/fs/mbcache.c index e60a840999aa..19cb8eb6744e 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -358,16 +358,15 @@ struct mb_cache *mb_cache_create(int bucket_bits) unsigned long bucket_count = 1UL << bucket_bits; unsigned long i; - cache = kzalloc(sizeof(struct mb_cache), GFP_KERNEL); + cache = kzalloc_obj(struct mb_cache, GFP_KERNEL); if (!cache) goto err_out; cache->c_bucket_bits = bucket_bits; cache->c_max_entries = bucket_count << 4; INIT_LIST_HEAD(&cache->c_list); spin_lock_init(&cache->c_list_lock); - cache->c_hash = kmalloc_array(bucket_count, - sizeof(struct hlist_bl_head), - GFP_KERNEL); + cache->c_hash = kmalloc_objs(struct hlist_bl_head, bucket_count, + GFP_KERNEL); if (!cache->c_hash) { kfree(cache); goto err_out; diff --git a/fs/minix/inode.c b/fs/minix/inode.c index c8c6b2135abe..495d31b8cd0e 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -226,7 +226,7 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc) int ret = -EINVAL; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc(sizeof(struct minix_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct minix_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; s->s_fs_info = sbi; diff --git a/fs/mnt_idmapping.c b/fs/mnt_idmapping.c index a37991fdb194..6472c4ea3d1e 100644 --- a/fs/mnt_idmapping.c +++ b/fs/mnt_idmapping.c @@ -289,7 +289,7 @@ struct mnt_idmap *alloc_mnt_idmap(struct user_namespace *mnt_userns) struct mnt_idmap *idmap; int ret; - idmap = kzalloc(sizeof(struct mnt_idmap), GFP_KERNEL_ACCOUNT); + idmap = kzalloc_obj(struct mnt_idmap, GFP_KERNEL_ACCOUNT); if (!idmap) return ERR_PTR(-ENOMEM); diff --git a/fs/namei.c b/fs/namei.c index 5fe6cac48df8..58f715f7657e 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -790,8 +790,8 @@ static bool nd_alloc_stack(struct nameidata *nd) { struct saved *p; - p= kmalloc_array(MAXSYMLINKS, sizeof(struct saved), - nd->flags & LOOKUP_RCU ? GFP_ATOMIC : GFP_KERNEL); + p= kmalloc_objs(struct saved, MAXSYMLINKS, + nd->flags & LOOKUP_RCU ? GFP_ATOMIC : GFP_KERNEL); if (unlikely(!p)) return false; memcpy(p, nd->internal, sizeof(nd->internal)); diff --git a/fs/namespace.c b/fs/namespace.c index a67cbe42746d..1cb7fa1a02ed 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -889,7 +889,7 @@ mountpoint: } if (!mp) - mp = kmalloc(sizeof(struct mountpoint), GFP_KERNEL); + mp = kmalloc_obj(struct mountpoint, GFP_KERNEL); if (!mp) return -ENOMEM; @@ -2226,7 +2226,7 @@ static inline bool extend_array(struct path **res, struct path **to_free, if (likely(n < *count)) return true; - p = kmalloc_array(new_count, sizeof(struct path), GFP_KERNEL); + p = kmalloc_objs(struct path, new_count, GFP_KERNEL); if (p && *count) memcpy(p, *res, *count * sizeof(struct path)); *count = new_count; @@ -4187,7 +4187,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool a if (!ucounts) return ERR_PTR(-ENOSPC); - new_ns = kzalloc(sizeof(struct mnt_namespace), GFP_KERNEL_ACCOUNT); + new_ns = kzalloc_obj(struct mnt_namespace, GFP_KERNEL_ACCOUNT); if (!new_ns) { dec_mnt_namespaces(ucounts); return ERR_PTR(-ENOMEM); diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c index 37ab6f28b5ad..60073d41a387 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -429,7 +429,7 @@ static int netfs_read_gaps(struct file *file, struct folio *folio) * end get copied to, but the middle is discarded. */ ret = -ENOMEM; - bvec = kmalloc_array(nr_bvec, sizeof(*bvec), GFP_KERNEL); + bvec = kmalloc_objs(*bvec, nr_bvec, GFP_KERNEL); if (!bvec) goto discard; diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index f9d62abef2ac..8fe514447df6 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -302,7 +302,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter, goto copied; } - finfo = kzalloc(sizeof(*finfo), GFP_KERNEL); + finfo = kzalloc_obj(*finfo, GFP_KERNEL); if (!finfo) { iov_iter_revert(iter, copied); ret = -ENOMEM; diff --git a/fs/netfs/fscache_cache.c b/fs/netfs/fscache_cache.c index 8f70f8da064b..e709617b64d5 100644 --- a/fs/netfs/fscache_cache.c +++ b/fs/netfs/fscache_cache.c @@ -25,7 +25,7 @@ static struct fscache_cache *fscache_alloc_cache(const char *name) { struct fscache_cache *cache; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); if (cache) { if (name) { cache->name = kstrdup(name, GFP_KERNEL); diff --git a/fs/netfs/fscache_io.c b/fs/netfs/fscache_io.c index e4308457633c..37f05b4d3469 100644 --- a/fs/netfs/fscache_io.c +++ b/fs/netfs/fscache_io.c @@ -223,7 +223,7 @@ void __fscache_write_to_cache(struct fscache_cookie *cookie, _enter("%llx,%zx", start, len); - wreq = kzalloc(sizeof(struct fscache_write_request), GFP_NOFS); + wreq = kzalloc_obj(struct fscache_write_request, GFP_NOFS); if (!wreq) goto abandon; wreq->mapping = mapping; diff --git a/fs/netfs/fscache_volume.c b/fs/netfs/fscache_volume.c index ced14ac78cc1..57a9f12e79aa 100644 --- a/fs/netfs/fscache_volume.c +++ b/fs/netfs/fscache_volume.c @@ -230,8 +230,7 @@ static struct fscache_volume *fscache_alloc_volume(const char *volume_key, if (IS_ERR(cache)) return NULL; - volume = kzalloc(struct_size(volume, coherency, coherency_len), - GFP_KERNEL); + volume = kzalloc_flex(*volume, coherency, coherency_len, GFP_KERNEL); if (!volume) goto err_cache; diff --git a/fs/netfs/rolling_buffer.c b/fs/netfs/rolling_buffer.c index 207b6a326651..a17fbf9853a4 100644 --- a/fs/netfs/rolling_buffer.c +++ b/fs/netfs/rolling_buffer.c @@ -27,7 +27,7 @@ struct folio_queue *netfs_folioq_alloc(unsigned int rreq_id, gfp_t gfp, { struct folio_queue *fq; - fq = kmalloc(sizeof(*fq), gfp); + fq = kmalloc_obj(*fq, gfp); if (fq) { netfs_stat(&netfs_n_folioq); folioq_init(fq, rreq_id); diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 0e4c67373e4f..cb0a645aeb50 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -74,7 +74,7 @@ static inline struct parallel_io *alloc_parallel(void *data) { struct parallel_io *rv; - rv = kmalloc(sizeof(*rv), GFP_NOFS); + rv = kmalloc_obj(*rv, GFP_NOFS); if (rv) { rv->data = data; kref_init(&rv->refcnt); @@ -461,7 +461,7 @@ static struct pnfs_layout_hdr *__bl_alloc_layout_hdr(struct inode *inode, struct pnfs_block_layout *bl; dprintk("%s enter\n", __func__); - bl = kzalloc(sizeof(*bl), gfp_flags); + bl = kzalloc_obj(*bl, gfp_flags); if (!bl) return NULL; @@ -619,7 +619,7 @@ bl_alloc_extent(struct xdr_stream *xdr, struct pnfs_layout_hdr *lo, if (!p) return -EIO; - be = kzalloc(sizeof(*be), GFP_NOFS); + be = kzalloc_obj(*be, GFP_NOFS); if (!be) return -ENOMEM; @@ -684,7 +684,7 @@ bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr, dprintk("---> %s\n", __func__); - lseg = kzalloc(sizeof(*lseg), gfp_mask); + lseg = kzalloc_obj(*lseg, gfp_mask); if (!lseg) return ERR_PTR(-ENOMEM); diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c index 134d7f760a33..cc6327d97a91 100644 --- a/fs/nfs/blocklayout/dev.c +++ b/fs/nfs/blocklayout/dev.c @@ -461,8 +461,8 @@ bl_parse_concat(struct nfs_server *server, struct pnfs_block_dev *d, u64 len = 0; int ret, i; - d->children = kcalloc(v->concat.volumes_count, - sizeof(struct pnfs_block_dev), gfp_mask); + d->children = kzalloc_objs(struct pnfs_block_dev, + v->concat.volumes_count, gfp_mask); if (!d->children) return -ENOMEM; @@ -490,8 +490,8 @@ bl_parse_stripe(struct nfs_server *server, struct pnfs_block_dev *d, u64 len = 0; int ret, i; - d->children = kcalloc(v->stripe.volumes_count, - sizeof(struct pnfs_block_dev), gfp_mask); + d->children = kzalloc_objs(struct pnfs_block_dev, + v->stripe.volumes_count, gfp_mask); if (!d->children) return -ENOMEM; @@ -559,8 +559,7 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, goto out_free_scratch; nr_volumes = be32_to_cpup(p++); - volumes = kcalloc(nr_volumes, sizeof(struct pnfs_block_volume), - gfp_mask); + volumes = kzalloc_objs(struct pnfs_block_volume, nr_volumes, gfp_mask); if (!volumes) goto out_free_scratch; @@ -570,7 +569,7 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, goto out_free_volumes; } - top = kzalloc(sizeof(*top), gfp_mask); + top = kzalloc_obj(*top, gfp_mask); if (!top) goto out_free_volumes; diff --git a/fs/nfs/blocklayout/extent_tree.c b/fs/nfs/blocklayout/extent_tree.c index 315949a7e92d..7393118c42a2 100644 --- a/fs/nfs/blocklayout/extent_tree.c +++ b/fs/nfs/blocklayout/extent_tree.c @@ -201,7 +201,7 @@ __ext_tree_remove(struct rb_root *root, if (len1 > 0) { struct pnfs_block_extent *new; - new = kzalloc(sizeof(*new), GFP_ATOMIC); + new = kzalloc_obj(*new, GFP_ATOMIC); if (!new) return -ENOMEM; @@ -384,7 +384,7 @@ ext_tree_split(struct rb_root *root, struct pnfs_block_extent *be, struct pnfs_block_extent *new; sector_t orig_len = be->be_length; - new = kzalloc(sizeof(*new), GFP_ATOMIC); + new = kzalloc_obj(*new, GFP_ATOMIC); if (!new) return -ENOMEM; @@ -653,8 +653,9 @@ ext_tree_prepare_commit(struct nfs4_layoutcommit_args *arg) count = 0; arg->layoutupdate_pages = - kcalloc(DIV_ROUND_UP(buffer_size, PAGE_SIZE), - sizeof(struct page *), GFP_NOFS); + kzalloc_objs(struct page *, + DIV_ROUND_UP(buffer_size, PAGE_SIZE), + GFP_NOFS); if (!arg->layoutupdate_pages) return -ENOMEM; diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c index ef6729568432..90fa1e4440be 100644 --- a/fs/nfs/cache_lib.c +++ b/fs/nfs/cache_lib.c @@ -96,7 +96,7 @@ struct nfs_cache_defer_req *nfs_cache_defer_req_alloc(void) { struct nfs_cache_defer_req *dreq; - dreq = kzalloc(sizeof(*dreq), GFP_KERNEL); + dreq = kzalloc_obj(*dreq, GFP_KERNEL); if (dreq) { init_completion(&dreq->completion); refcount_set(&dreq->count, 1); diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 805eb3764186..1c94a97efd31 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -718,7 +718,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy, struct nfs4_copy_state *copy, *tmp_copy; bool found = false; - copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL); + copy = kzalloc_obj(struct nfs4_copy_state, GFP_KERNEL); if (!copy) return cpu_to_be32(NFS4ERR_DELAY); diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index c2fa4a91db26..857393803e71 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -272,7 +272,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, if (n == 0) goto out; - args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL); + args->devs = kmalloc_objs(*args->devs, n, GFP_KERNEL); if (!args->devs) { status = htonl(NFS4ERR_DELAY); goto out; @@ -378,9 +378,9 @@ static __be32 decode_rc_list(struct xdr_stream *xdr, rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t)); if (unlikely(p == NULL)) goto out; - rc_list->rcl_refcalls = kmalloc_array(rc_list->rcl_nrefcalls, - sizeof(*rc_list->rcl_refcalls), - GFP_KERNEL); + rc_list->rcl_refcalls = kmalloc_objs(*rc_list->rcl_refcalls, + rc_list->rcl_nrefcalls, + GFP_KERNEL); if (unlikely(rc_list->rcl_refcalls == NULL)) goto out; for (i = 0; i < rc_list->rcl_nrefcalls; i++) { @@ -419,9 +419,8 @@ static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp, args->csa_nrclists = ntohl(*p++); args->csa_rclists = NULL; if (args->csa_nrclists) { - args->csa_rclists = kmalloc_array(args->csa_nrclists, - sizeof(*args->csa_rclists), - GFP_KERNEL); + args->csa_rclists = kmalloc_objs(*args->csa_rclists, + args->csa_nrclists, GFP_KERNEL); if (unlikely(args->csa_rclists == NULL)) return htonl(NFS4ERR_RESOURCE); diff --git a/fs/nfs/client.c b/fs/nfs/client.c index fd15731cf361..be6e3b61735d 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -150,7 +150,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init) struct nfs_client *clp; int err = -ENOMEM; - if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL) + if ((clp = kzalloc_obj(*clp, GFP_KERNEL)) == NULL) goto error_0; clp->cl_minorversion = cl_init->minorversion; @@ -1044,7 +1044,7 @@ struct nfs_server *nfs_alloc_server(void) { struct nfs_server *server; - server = kzalloc(sizeof(struct nfs_server), GFP_KERNEL); + server = kzalloc_obj(struct nfs_server, GFP_KERNEL); if (!server) return NULL; diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 94103f8d3f21..cf40ced95305 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -442,7 +442,7 @@ int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred, struct nfs_delegation *freeme = NULL; int status = 0; - delegation = kmalloc(sizeof(*delegation), GFP_KERNEL_ACCOUNT); + delegation = kmalloc_obj(*delegation, GFP_KERNEL_ACCOUNT); if (delegation == NULL) return -ENOMEM; nfs4_stateid_copy(&delegation->stateid, stateid); @@ -1602,8 +1602,9 @@ int nfs4_delegation_hash_alloc(struct nfs_server *server) delegation_buckets = roundup_pow_of_two(nfs_delegation_watermark / 16); server->delegation_hash_mask = delegation_buckets - 1; - server->delegation_hash_table = kmalloc_array(delegation_buckets, - sizeof(*server->delegation_hash_table), GFP_KERNEL); + server->delegation_hash_table = kmalloc_objs(*server->delegation_hash_table, + delegation_buckets, + GFP_KERNEL); if (!server->delegation_hash_table) return -ENOMEM; for (i = 0; i < delegation_buckets; i++) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b3f5c9461204..624ee989929d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -80,7 +80,7 @@ alloc_nfs_open_dir_context(struct inode *dir) struct nfs_inode *nfsi = NFS_I(dir); struct nfs_open_dir_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); + ctx = kzalloc_obj(*ctx, GFP_KERNEL_ACCOUNT); if (ctx != NULL) { ctx->attr_gencount = nfsi->attr_gencount; ctx->dtsize = min(NFS_SERVER(dir)->dtsize, NFS_INIT_DTSIZE); @@ -912,7 +912,7 @@ static struct page **nfs_readdir_alloc_pages(size_t npages) struct page **pages; size_t i; - pages = kmalloc_array(npages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, npages, GFP_KERNEL); if (!pages) return NULL; for (i = 0; i < npages; i++) { @@ -942,7 +942,7 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc, unsigned int pglen; int status = -ENOMEM; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; entry->cookie = nfs_readdir_folio_last_cookie(folio); @@ -1154,7 +1154,7 @@ static int uncached_readdir(struct nfs_readdir_descriptor *desc) dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %llu\n", (unsigned long long)desc->dir_cookie); - arrays = kcalloc(sz, sizeof(*arrays), GFP_KERNEL); + arrays = kzalloc_objs(*arrays, sz, GFP_KERNEL); if (!arrays) goto out; arrays[0] = nfs_readdir_folio_array_alloc(desc->dir_cookie, GFP_KERNEL); @@ -1245,7 +1245,7 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) nfs_revalidate_mapping(inode, file->f_mapping); res = -ENOMEM; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) goto out; desc->file = file; @@ -3216,7 +3216,7 @@ found: void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set, const struct cred *cred) { - struct nfs_access_entry *cache = kmalloc(sizeof(*cache), GFP_KERNEL); + struct nfs_access_entry *cache = kmalloc_obj(*cache, GFP_KERNEL); if (cache == NULL) return; RB_CLEAR_NODE(&cache->rb_node); diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 714975e5c0db..9bce45de1cb4 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -120,7 +120,7 @@ static void nfs_dns_ent_put(struct kref *ref) static struct cache_head *nfs_dns_ent_alloc(void) { - struct nfs_dns_ent *item = kmalloc(sizeof(*item), GFP_KERNEL); + struct nfs_dns_ent *item = kmalloc_obj(*item, GFP_KERNEL); if (item != NULL) { item->hostname = NULL; diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 5c4551117c58..90a11afa5d05 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -694,15 +694,15 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo, goto out_err; if (fl->num_fh > 0) { - fl->fh_array = kcalloc(fl->num_fh, sizeof(fl->fh_array[0]), - gfp_flags); + fl->fh_array = kzalloc_objs(fl->fh_array[0], fl->num_fh, + gfp_flags); if (!fl->fh_array) goto out_err; } for (i = 0; i < fl->num_fh; i++) { /* Do we want to use a mempool here? */ - fl->fh_array[i] = kmalloc(sizeof(struct nfs_fh), gfp_flags); + fl->fh_array[i] = kmalloc_obj(struct nfs_fh, gfp_flags); if (!fl->fh_array[i]) goto out_err; @@ -763,7 +763,7 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, int rc; dprintk("--> %s\n", __func__); - fl = kzalloc(sizeof(*fl), gfp_flags); + fl = kzalloc_obj(*fl, gfp_flags); if (!fl) return NULL; @@ -1049,7 +1049,7 @@ filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags) { struct nfs4_filelayout *flo; - flo = kzalloc(sizeof(*flo), gfp_flags); + flo = kzalloc_obj(*flo, gfp_flags); if (flo == NULL) return NULL; pnfs_init_ds_commit_info(&flo->commit_info); diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c index df79aeb68db4..7226989ee4d5 100644 --- a/fs/nfs/filelayout/filelayoutdev.c +++ b/fs/nfs/filelayout/filelayoutdev.c @@ -138,7 +138,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, goto out_err_free_stripe_indices; } - dsaddr = kzalloc(struct_size(dsaddr, ds_list, num), gfp_flags); + dsaddr = kzalloc_flex(*dsaddr, ds_list, num, gfp_flags); if (!dsaddr) goto out_err_free_stripe_indices; diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 9056f05a67dc..f67773d52830 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -54,7 +54,7 @@ ff_layout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags) { struct nfs4_flexfile_layout *ffl; - ffl = kzalloc(sizeof(*ffl), gfp_flags); + ffl = kzalloc_obj(*ffl, gfp_flags); if (ffl) { pnfs_init_ds_commit_info(&ffl->commit_info); INIT_LIST_HEAD(&ffl->error_list); @@ -275,7 +275,7 @@ static struct nfs4_ff_layout_mirror *ff_layout_alloc_mirror(u32 dss_count, { struct nfs4_ff_layout_mirror *mirror; - mirror = kzalloc(sizeof(*mirror), gfp_flags); + mirror = kzalloc_obj(*mirror, gfp_flags); if (mirror == NULL) return NULL; @@ -285,8 +285,8 @@ static struct nfs4_ff_layout_mirror *ff_layout_alloc_mirror(u32 dss_count, mirror->dss_count = dss_count; mirror->dss = - kcalloc(dss_count, sizeof(struct nfs4_ff_layout_ds_stripe), - gfp_flags); + kzalloc_objs(struct nfs4_ff_layout_ds_stripe, dss_count, + gfp_flags); if (mirror->dss == NULL) { kfree(mirror); return NULL; @@ -483,8 +483,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh, goto out_err_free; rc = -ENOMEM; - fls = kzalloc(struct_size(fls, mirror_array, mirror_array_cnt), - gfp_flags); + fls = kzalloc_flex(*fls, mirror_array, mirror_array_cnt, gfp_flags); if (!fls) goto out_err_free; @@ -554,8 +553,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh, fh_count = be32_to_cpup(p); dss_info->fh_versions = - kcalloc(fh_count, sizeof(struct nfs_fh), - gfp_flags); + kzalloc_objs(struct nfs_fh, fh_count, gfp_flags); if (dss_info->fh_versions == NULL) { rc = -ENOMEM; goto out_err_free; @@ -2633,7 +2631,7 @@ ff_layout_prepare_layoutreturn(struct nfs4_layoutreturn_args *args) struct nfs4_flexfile_layoutreturn_args *ff_args; struct nfs4_flexfile_layout *ff_layout = FF_LAYOUT_FROM_HDR(args->layout); - ff_args = kmalloc(sizeof(*ff_args), nfs_io_gfp_mask()); + ff_args = kmalloc_obj(*ff_args, nfs_io_gfp_mask()); if (!ff_args) goto out_nomem; ff_args->pages[0] = alloc_page(nfs_io_gfp_mask()); @@ -2674,8 +2672,7 @@ ff_layout_send_layouterror(struct pnfs_layout_segment *lseg) if (list_empty(&head)) return; - errors = kmalloc_array(NFS42_LAYOUTERROR_MAX, sizeof(*errors), - nfs_io_gfp_mask()); + errors = kmalloc_objs(*errors, NFS42_LAYOUTERROR_MAX, nfs_io_gfp_mask()); if (errors != NULL) { const struct nfs4_ff_layout_ds_err *pos; size_t n = 0; @@ -2943,8 +2940,8 @@ static int ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) const int dev_count = PNFS_LAYOUTSTATS_MAXDEV; /* For now, send at most PNFS_LAYOUTSTATS_MAXDEV statistics */ - args->devinfo = kmalloc_array(dev_count, sizeof(*args->devinfo), - nfs_io_gfp_mask()); + args->devinfo = kmalloc_objs(*args->devinfo, dev_count, + nfs_io_gfp_mask()); if (!args->devinfo) return -ENOMEM; diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index c2d8a13a9dbd..c40395ae0814 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -60,7 +60,7 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, if (!scratch) goto out_err; - new_ds = kzalloc(sizeof(struct nfs4_ff_layout_ds), gfp_flags); + new_ds = kzalloc_obj(struct nfs4_ff_layout_ds, gfp_flags); if (!new_ds) goto out_scratch; @@ -99,9 +99,8 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, version_count = be32_to_cpup(p); dprintk("%s: version count %d\n", __func__, version_count); - ds_versions = kcalloc(version_count, - sizeof(struct nfs4_ff_ds_version), - gfp_flags); + ds_versions = kzalloc_objs(struct nfs4_ff_ds_version, version_count, + gfp_flags); if (!ds_versions) goto out_err_drain_dsaddrs; @@ -262,7 +261,7 @@ int ff_layout_track_ds_error(struct nfs4_flexfile_layout *flo, if (IS_ERR_OR_NULL(mirror->dss[dss_id].mirror_ds)) return -EINVAL; - dserr = kmalloc(sizeof(*dserr), gfp_flags); + dserr = kmalloc_obj(*dserr, gfp_flags); if (!dserr) return -ENOMEM; diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c index 86750f110053..2fc851abd187 100644 --- a/fs/nfs/fs_context.c +++ b/fs/nfs/fs_context.c @@ -1692,7 +1692,7 @@ static int nfs_init_fs_context(struct fs_context *fc) { struct nfs_fs_context *ctx; - ctx = kzalloc(sizeof(struct nfs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct nfs_fs_context, GFP_KERNEL); if (unlikely(!ctx)) return -ENOMEM; diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index 8b0785178731..9b7fdad4a920 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c @@ -288,7 +288,7 @@ static struct nfs_netfs_io_data *nfs_netfs_alloc(struct netfs_io_subrequest *sre { struct nfs_netfs_io_data *netfs; - netfs = kzalloc(sizeof(*netfs), GFP_KERNEL_ACCOUNT); + netfs = kzalloc_obj(*netfs, GFP_KERNEL_ACCOUNT); if (!netfs) return NULL; netfs->sreq = sreq; diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 331cdecdd966..ea215fc2ed21 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -383,7 +383,7 @@ struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) if (!(server->caps & NFS_CAP_SECURITY_LABEL)) return NULL; - label = kzalloc(sizeof(struct nfs4_label), flags); + label = kzalloc_obj(struct nfs4_label, flags); if (label == NULL) return ERR_PTR(-ENOMEM); @@ -1131,7 +1131,7 @@ struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx) res = __nfs_find_lock_context(ctx); rcu_read_unlock(); if (res == NULL) { - new = kmalloc(sizeof(*new), GFP_KERNEL_ACCOUNT); + new = kmalloc_obj(*new, GFP_KERNEL_ACCOUNT); if (new == NULL) return ERR_PTR(-ENOMEM); nfs_init_lock_context(new); @@ -1209,7 +1209,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, { struct nfs_open_context *ctx; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); + ctx = kmalloc_obj(*ctx, GFP_KERNEL_ACCOUNT); if (!ctx) return ERR_PTR(-ENOMEM); nfs_sb_active(dentry->d_sb); @@ -1777,7 +1777,7 @@ struct nfs_fattr *nfs_alloc_fattr(void) { struct nfs_fattr *fattr; - fattr = kmalloc(sizeof(*fattr), GFP_KERNEL); + fattr = kmalloc_obj(*fattr, GFP_KERNEL); if (fattr != NULL) { nfs_fattr_init(fattr); fattr->label = NULL; @@ -1807,7 +1807,7 @@ struct nfs_fh *nfs_alloc_fhandle(void) { struct nfs_fh *fh; - fh = kmalloc(sizeof(struct nfs_fh), GFP_KERNEL); + fh = kmalloc_obj(struct nfs_fh, GFP_KERNEL); if (fh != NULL) fh->size = 0; return fh; @@ -2015,7 +2015,7 @@ static void nfs_ooo_merge(struct nfs_inode *nfsi, return; if (!nfsi->ooo) { - nfsi->ooo = kmalloc(sizeof(*nfsi->ooo), GFP_ATOMIC); + nfsi->ooo = kmalloc_obj(*nfsi->ooo, GFP_ATOMIC); if (!nfsi->ooo) { nfsi->cache_validity |= NFS_INO_DATA_INVAL_DEFER; return; diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index 3b47be4e693a..4c7d16a99ed6 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -316,12 +316,11 @@ nfs_local_iocb_alloc(struct nfs_pgio_header *hdr, { struct nfs_local_kiocb *iocb; - iocb = kzalloc(sizeof(*iocb), flags); + iocb = kzalloc_obj(*iocb, flags); if (iocb == NULL) return NULL; - iocb->bvec = kmalloc_array(hdr->page_array.npages, - sizeof(struct bio_vec), flags); + iocb->bvec = kmalloc_objs(struct bio_vec, hdr->page_array.npages, flags); if (iocb->bvec == NULL) { kfree(iocb); return NULL; @@ -1070,7 +1069,7 @@ static struct nfs_local_fsync_ctx * nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, struct nfsd_file *localio, gfp_t flags) { - struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags); + struct nfs_local_fsync_ctx *ctx = kmalloc_obj(*ctx, flags); if (ctx != NULL) { ctx->localio = localio; diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index d3d2fbeba89d..eb9cac652550 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -299,7 +299,7 @@ static struct nfs3_createdata *nfs3_alloc_createdata(void) { struct nfs3_createdata *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (data != NULL) { data->msg.rpc_argp = &data->arg; data->msg.rpc_resp = &data->res; diff --git a/fs/nfs/nfs40client.c b/fs/nfs/nfs40client.c index fc0c6b48fc94..f44d68faea93 100644 --- a/fs/nfs/nfs40client.c +++ b/fs/nfs/nfs40client.c @@ -65,7 +65,7 @@ int nfs40_init_client(struct nfs_client *clp) struct nfs4_slot_table *tbl; int ret; - tbl = kzalloc(sizeof(*tbl), GFP_NOFS); + tbl = kzalloc_obj(*tbl, GFP_NOFS); if (tbl == NULL) return -ENOMEM; diff --git a/fs/nfs/nfs40proc.c b/fs/nfs/nfs40proc.c index 32a2a1a2b216..53f54081942e 100644 --- a/fs/nfs/nfs40proc.c +++ b/fs/nfs/nfs40proc.c @@ -122,7 +122,7 @@ static int nfs4_proc_async_renew(struct nfs_client *clp, const struct cred *cred return 0; if (!refcount_inc_not_zero(&clp->cl_count)) return -EIO; - data = kmalloc(sizeof(*data), GFP_NOFS); + data = kmalloc_obj(*data, GFP_NOFS); if (data == NULL) { nfs_put_client(clp); return -ENOMEM; @@ -320,7 +320,7 @@ nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_state *lsp) if (clp->cl_mvops->minor_version != 0) return; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return; data->lsp = lsp; diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 3487948d7181..46298606e509 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -247,7 +247,7 @@ static int handle_async_copy(struct nfs42_copy_res *res, int status = NFS4_OK; u64 copied; - copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL); + copy = kzalloc_obj(struct nfs4_copy_state, GFP_KERNEL); if (!copy) return -ENOMEM; @@ -351,7 +351,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst, struct nfs_commitres cres; int status = -ENOMEM; - cres.verf = kzalloc(sizeof(struct nfs_writeverf), GFP_KERNEL); + cres.verf = kzalloc_obj(struct nfs_writeverf, GFP_KERNEL); if (!cres.verf) goto out; @@ -461,7 +461,7 @@ static ssize_t _nfs42_proc_copy(struct file *src, res->commit_res.verf = NULL; if (args->sync) { res->commit_res.verf = - kzalloc(sizeof(struct nfs_writeverf), GFP_KERNEL); + kzalloc_obj(struct nfs_writeverf, GFP_KERNEL); if (!res->commit_res.verf) return -ENOMEM; } @@ -659,7 +659,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst, if (!(dst_server->caps & NFS_CAP_OFFLOAD_CANCEL)) return -EOPNOTSUPP; - data = kzalloc(sizeof(struct nfs42_offload_data), GFP_KERNEL); + data = kzalloc_obj(struct nfs42_offload_data, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -756,7 +756,7 @@ nfs42_proc_offload_status(struct file *dst, nfs4_stateid *stateid, u64 *copied) if (!(server->caps & NFS_CAP_OFFLOAD_STATUS)) return -EOPNOTSUPP; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; data->seq_server = server; @@ -838,7 +838,7 @@ int nfs42_proc_copy_notify(struct file *src, struct file *dst, if (!(src_server->caps & NFS_CAP_COPY_NOTIFY)) return -EOPNOTSUPP; - args = kzalloc(sizeof(struct nfs42_copy_notify_args), GFP_KERNEL); + args = kzalloc_obj(struct nfs42_copy_notify_args, GFP_KERNEL); if (args == NULL) return -ENOMEM; @@ -1087,7 +1087,7 @@ nfs42_alloc_layouterror_data(struct pnfs_layout_segment *lseg, gfp_t gfp_flags) struct nfs42_layouterror_data *data; struct inode *inode = lseg->pls_layout->plh_inode; - data = kzalloc(sizeof(*data), gfp_flags); + data = kzalloc_obj(*data, gfp_flags); if (data) { data->args.inode = data->inode = nfs_igrab_and_active(inode); if (data->inode) { @@ -1535,7 +1535,7 @@ static ssize_t _nfs42_proc_listxattrs(struct inode *inode, void *buf, xdrlen = server->lxasize; np = xdrlen / PAGE_SIZE + 1; - pages = kcalloc(np, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, np, GFP_KERNEL); if (!pages) goto out_free_scratch; for (i = 0; i < np; i++) { @@ -1578,7 +1578,7 @@ ssize_t nfs42_proc_getxattr(struct inode *inode, const char *name, struct page **pages; np = nfs_page_array_len(0, buflen ?: XATTR_SIZE_MAX); - pages = kmalloc_array(np, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, np, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index e10d83ba835e..432cfeebeba4 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -1159,7 +1159,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res) if (segments == 0) return 0; - segs = kmalloc_array(segments, sizeof(*segs), GFP_KERNEL); + segs = kmalloc_objs(*segs, segments, GFP_KERNEL); if (!segs) return -ENOMEM; diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 51cf4a37d652..c211639949c2 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -99,7 +99,7 @@ nfs4_alloc_ds_server(struct nfs_client *ds_clp, rpc_authflavor_t flavor) { struct nfs4_ds_server *dss; - dss = kmalloc(sizeof(*dss), GFP_NOFS); + dss = kmalloc_obj(*dss, GFP_NOFS); if (dss == NULL) return ERR_PTR(-ENOMEM); diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 7f43e890d356..bd079b4a6523 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -164,8 +164,7 @@ retry: */ if (sync) return -EOPNOTSUPP; - cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res), - GFP_KERNEL); + cn_resp = kzalloc_obj(struct nfs42_copy_notify_res, GFP_KERNEL); if (unlikely(cn_resp == NULL)) return -ENOMEM; diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index 9e1c48c5c0b8..01fb53132279 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -445,7 +445,7 @@ nfs_idmap_new(struct nfs_client *clp) struct rpc_pipe *pipe; int error; - idmap = kzalloc(sizeof(*idmap), GFP_KERNEL); + idmap = kzalloc_obj(*idmap, GFP_KERNEL); if (idmap == NULL) return -ENOMEM; @@ -579,7 +579,7 @@ static int nfs_idmap_legacy_upcall(struct key *authkey, void *aux) /* msg and im are freed in idmap_pipe_destroy_msg */ ret = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto out1; diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 9a98595bb160..7366f2e6bc12 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -415,7 +415,7 @@ static int nfs_do_refmount(struct fs_context *fc, struct rpc_clnt *client) if (!page) return -ENOMEM; - fs_locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); + fs_locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); if (!fs_locations) goto out_free; fs_locations->fattr = nfs_alloc_fattr(); @@ -490,7 +490,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server, size_t salen; int error; - sap = kmalloc(sizeof(*sap), GFP_KERNEL); + sap = kmalloc_obj(*sap, GFP_KERNEL); if (sap == NULL) return -ENOMEM; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 180229320731..df9ae871726d 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1370,7 +1370,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, struct nfs4_label *label = (c != NULL) ? c->label : NULL; struct nfs4_opendata *p; - p = kzalloc(sizeof(*p), gfp_mask); + p = kzalloc_obj(*p, gfp_mask); if (p == NULL) goto err; @@ -3774,7 +3774,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait) nfs4_state_protect(clp, NFS_SP4_MACH_CRED_CLEANUP, &task_setup_data.rpc_client, &msg); - calldata = kzalloc(sizeof(*calldata), gfp_mask); + calldata = kzalloc_obj(*calldata, gfp_mask); if (calldata == NULL) goto out; nfs4_init_sequence(clp, &calldata->arg.seq_args, @@ -4107,7 +4107,7 @@ static int _nfs4_discover_trunking(struct nfs_server *server, page = alloc_page(GFP_KERNEL); if (!page) goto out_put_cred; - locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); if (!locations) goto out_free; locations->fattr = nfs_alloc_fattr(); @@ -4341,7 +4341,7 @@ static int nfs4_get_referral(struct rpc_clnt *client, struct inode *dir, page = alloc_page(GFP_KERNEL); if (page == NULL) goto out; - locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); if (locations == NULL) goto out; @@ -5130,7 +5130,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, { struct nfs4_createdata *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (data != NULL) { struct nfs_server *server = NFS_SERVER(dir); @@ -6023,7 +6023,7 @@ static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, acl->cached = 1; _copy_from_pages(acl->data, pages, pgbase, acl_len); } else { - acl = kmalloc(sizeof(*acl), GFP_KERNEL); + acl = kmalloc_obj(*acl, GFP_KERNEL); if (acl == NULL) goto out; acl->cached = 0; @@ -6070,7 +6070,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, buflen = server->rsize; npages = DIV_ROUND_UP(buflen, PAGE_SIZE) + 1; - pages = kmalloc_array(npages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, npages, GFP_KERNEL); if (!pages) return -ENOMEM; @@ -6822,7 +6822,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, if (nfs_server_capable(inode, NFS_CAP_MOVEABLE)) task_setup_data.flags |= RPC_TASK_MOVEABLE; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -7026,7 +7026,7 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl, struct inode *inode = state->inode; struct nfs_lock_context *l_ctx; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (p == NULL) return NULL; l_ctx = nfs_get_lock_context(ctx); @@ -7260,7 +7260,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl, struct nfs_server *server = NFS_SERVER(inode); struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); - p = kzalloc(sizeof(*p), gfp_mask); + p = kzalloc_obj(*p, gfp_mask); if (p == NULL) return NULL; @@ -8706,7 +8706,7 @@ nfs4_run_exchange_id(struct nfs_client *clp, const struct cred *cred, return ERR_PTR(-EIO); status = -ENOMEM; - calldata = kzalloc(sizeof(*calldata), GFP_NOFS); + calldata = kzalloc_obj(*calldata, GFP_NOFS); if (!calldata) goto out; @@ -8716,18 +8716,18 @@ nfs4_run_exchange_id(struct nfs_client *clp, const struct cred *cred, if (status) goto out_calldata; - calldata->res.server_owner = kzalloc(sizeof(struct nfs41_server_owner), - GFP_NOFS); + calldata->res.server_owner = kzalloc_obj(struct nfs41_server_owner, + GFP_NOFS); status = -ENOMEM; if (unlikely(calldata->res.server_owner == NULL)) goto out_calldata; - calldata->res.server_scope = kzalloc(sizeof(struct nfs41_server_scope), - GFP_NOFS); + calldata->res.server_scope = kzalloc_obj(struct nfs41_server_scope, + GFP_NOFS); if (unlikely(calldata->res.server_scope == NULL)) goto out_server_owner; - calldata->res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_NOFS); + calldata->res.impl_id = kzalloc_obj(struct nfs41_impl_id, GFP_NOFS); if (unlikely(calldata->res.impl_id == NULL)) goto out_server_scope; @@ -9396,7 +9396,7 @@ static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, goto out_err; ret = ERR_PTR(-ENOMEM); - calldata = kzalloc(sizeof(*calldata), GFP_KERNEL); + calldata = kzalloc_obj(*calldata, GFP_KERNEL); if (calldata == NULL) goto out_put_clp; nfs4_init_sequence(clp, &calldata->args, &calldata->res, 0, is_privileged); @@ -9543,7 +9543,7 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp, }; int status = -ENOMEM; - calldata = kzalloc(sizeof(*calldata), GFP_NOFS); + calldata = kzalloc_obj(*calldata, GFP_NOFS); if (calldata == NULL) goto out; calldata->clp = clp; @@ -10358,7 +10358,7 @@ static int nfs41_free_stateid(struct nfs_server *server, &task_setup.rpc_client, &msg); dprintk("NFS call free_stateid %p\n", stateid); - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; data->server = server; diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index a2fdd4b80dc4..5c128957a0a4 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c @@ -106,7 +106,7 @@ static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table *tbl, { struct nfs4_slot *slot; - slot = kzalloc(sizeof(*slot), gfp_mask); + slot = kzalloc_obj(*slot, gfp_mask); if (slot) { slot->table = tbl; slot->slot_nr = slotid; @@ -558,7 +558,7 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp) { struct nfs4_session *session; - session = kzalloc(sizeof(struct nfs4_session), GFP_NOFS); + session = kzalloc_obj(struct nfs4_session, GFP_NOFS); if (!session) return NULL; diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 963719f35467..7e1f14fad898 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -446,7 +446,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, { struct nfs4_state_owner *sp; - sp = kzalloc(sizeof(*sp), gfp_flags); + sp = kzalloc_obj(*sp, gfp_flags); if (!sp) return NULL; sp->so_seqid.owner_id = atomic64_inc_return(&server->owner_ctr); @@ -612,7 +612,7 @@ nfs4_alloc_open_state(void) { struct nfs4_state *state; - state = kzalloc(sizeof(*state), GFP_KERNEL_ACCOUNT); + state = kzalloc_obj(*state, GFP_KERNEL_ACCOUNT); if (!state) return NULL; refcount_set(&state->count, 1); @@ -815,7 +815,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f struct nfs4_lock_state *lsp; struct nfs_server *server = state->owner->so_server; - lsp = kzalloc(sizeof(*lsp), GFP_KERNEL_ACCOUNT); + lsp = kzalloc_obj(*lsp, GFP_KERNEL_ACCOUNT); if (lsp == NULL) return NULL; nfs4_init_seqid_counter(&lsp->ls_seqid); @@ -1014,7 +1014,7 @@ struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_m { struct nfs_seqid *new; - new = kmalloc(sizeof(*new), gfp_mask); + new = kmalloc_obj(*new, gfp_mask); if (new == NULL) return ERR_PTR(-ENOMEM); new->sequence = counter; @@ -2054,7 +2054,7 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred clp->cl_hostname); page = alloc_page(GFP_KERNEL); - locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); fattr = nfs_alloc_fattr(); if (page == NULL || locations == NULL || fattr == NULL) { dprintk("<-- %s: no memory\n", __func__); diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 5ec9c83f1ef0..678f1f6c62bc 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -100,7 +100,7 @@ static int nfs_referral_loop_protect(void) struct nfs_referral_count *p, *new; int ret = -ENOMEM; - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) goto out; new->task = current; diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 6e69ce43a13f..a9373de891c9 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -893,7 +893,8 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc, if (pagecount <= ARRAY_SIZE(pg_array->page_array)) pg_array->pagevec = pg_array->page_array; else { - pg_array->pagevec = kcalloc(pagecount, sizeof(struct page *), gfp_flags); + pg_array->pagevec = kzalloc_objs(struct page *, pagecount, + gfp_flags); if (!pg_array->pagevec) { pg_array->npages = 0; nfs_pgio_error(hdr); @@ -991,7 +992,7 @@ nfs_pageio_alloc_mirrors(struct nfs_pageio_descriptor *desc, desc->pg_mirrors_dynamic = NULL; if (mirror_count == 1) return desc->pg_mirrors_static; - ret = kmalloc_array(mirror_count, sizeof(*ret), nfs_io_gfp_mask()); + ret = kmalloc_objs(*ret, mirror_count, nfs_io_gfp_mask()); if (ret != NULL) { for (i = 0; i < mirror_count; i++) nfs_pageio_mirror_init(&ret[i], desc->pg_bsize); diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index ff8483d3373a..bc13d1e69449 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1143,7 +1143,7 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags) struct page **pages; int i; - pages = kmalloc_array(size, sizeof(struct page *), gfp_flags); + pages = kmalloc_objs(struct page *, size, gfp_flags); if (!pages) { dprintk("%s: can't alloc array of %zu pages\n", __func__, size); return NULL; @@ -1175,7 +1175,7 @@ pnfs_alloc_init_layoutget_args(struct inode *ino, dprintk("--> %s\n", __func__); - lgp = kzalloc(sizeof(*lgp), gfp_flags); + lgp = kzalloc_obj(*lgp, gfp_flags); if (lgp == NULL) return NULL; @@ -1357,7 +1357,7 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, int status = 0; *pcred = NULL; - lrp = kzalloc(sizeof(*lrp), nfs_io_gfp_mask()); + lrp = kzalloc_obj(*lrp, nfs_io_gfp_mask()); if (unlikely(lrp == NULL)) { status = -ENOMEM; spin_lock(&ino->i_lock); @@ -3379,7 +3379,7 @@ pnfs_layoutcommit_inode(struct inode *inode, bool sync) status = -ENOMEM; /* Note kzalloc ensures data->res.seq_res.sr_slot == NULL */ - data = kzalloc(sizeof(*data), nfs_io_gfp_mask()); + data = kzalloc_obj(*data, nfs_io_gfp_mask()); if (!data) goto clear_layoutcommitting; @@ -3450,7 +3450,7 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) { struct nfs4_threshold *thp; - thp = kzalloc(sizeof(*thp), nfs_io_gfp_mask()); + thp = kzalloc_obj(*thp, nfs_io_gfp_mask()); if (!thp) { dprintk("%s mdsthreshold allocation failed\n", __func__); return NULL; @@ -3487,7 +3487,7 @@ pnfs_report_layoutstat(struct inode *inode, gfp_t gfp_flags) pnfs_get_layout_hdr(hdr); spin_unlock(&inode->i_lock); - data = kzalloc(sizeof(*data), gfp_flags); + data = kzalloc_obj(*data, gfp_flags); if (!data) { status = -ENOMEM; goto out_put; diff --git a/fs/nfs/pnfs_dev.c b/fs/nfs/pnfs_dev.c index bf0f2d67e96c..274abdd6d5f3 100644 --- a/fs/nfs/pnfs_dev.c +++ b/fs/nfs/pnfs_dev.c @@ -114,11 +114,11 @@ nfs4_get_device_info(struct nfs_server *server, dprintk("%s: server %p max_resp_sz %u max_pages %d\n", __func__, server, max_resp_sz, max_pages); - pdev = kzalloc(sizeof(*pdev), gfp_flags); + pdev = kzalloc_obj(*pdev, gfp_flags); if (!pdev) return NULL; - pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags); + pages = kzalloc_objs(struct page *, max_pages, gfp_flags); if (!pages) goto out_free_pdev; diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 9976cc16b689..12632a706da8 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -101,7 +101,7 @@ pnfs_alloc_commit_array(size_t n, gfp_t gfp_flags) struct pnfs_commit_array *p; struct pnfs_commit_bucket *b; - p = kmalloc(struct_size(p, buckets, n), gfp_flags); + p = kmalloc_flex(*p, buckets, n, gfp_flags); if (!p) return NULL; p->nbuckets = n; @@ -618,7 +618,7 @@ _data_server_lookup_locked(const struct nfs_net *nn, const struct list_head *dsa static struct nfs4_pnfs_ds_addr *nfs4_pnfs_ds_addr_alloc(gfp_t gfp_flags) { - struct nfs4_pnfs_ds_addr *da = kzalloc(sizeof(*da), gfp_flags); + struct nfs4_pnfs_ds_addr *da = kzalloc_obj(*da, gfp_flags); if (da) INIT_LIST_HEAD(&da->da_node); return da; @@ -730,7 +730,7 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_fla goto out; } - ds = kzalloc(sizeof(*ds), gfp_flags); + ds = kzalloc_obj(*ds, gfp_flags); if (!ds) goto out; diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 0e440ebf5335..523f44a2a416 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -217,7 +217,7 @@ static struct nfs_createdata *nfs_alloc_createdata(struct inode *dir, { struct nfs_createdata *data; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (data != NULL) { data->arg.fh = NFS_FH(dir); diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c index 7bf650fda1cb..2c723d41b7a7 100644 --- a/fs/nfs/sysfs.c +++ b/fs/nfs/sysfs.c @@ -43,7 +43,7 @@ int nfs_sysfs_init(void) { int ret; - nfs_kset = kzalloc(sizeof(*nfs_kset), GFP_KERNEL); + nfs_kset = kzalloc_obj(*nfs_kset, GFP_KERNEL); if (!nfs_kset) return -ENOMEM; @@ -172,7 +172,7 @@ static struct nfs_netns_client *nfs_netns_client_alloc(struct kobject *parent, { struct nfs_netns_client *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (p) { p->net = net; p->kobject.kset = nfs_kset; diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index 4db818c0f9dd..2a07899c69af 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -175,7 +175,7 @@ nfs_async_unlink(struct dentry *dentry, const struct qstr *name) int status = -ENOMEM; void *devname_garbage = NULL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (data == NULL) goto out; data->args.name.name = kstrdup(name->name, GFP_KERNEL); @@ -355,7 +355,7 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir, nfs_server_capable(new_dir, NFS_CAP_MOVEABLE)) task_setup_data.flags |= RPC_TASK_MOVEABLE; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (data == NULL) return ERR_PTR(-ENOMEM); task_setup_data.task = &data->task; diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 2d0e4a765aeb..1ed4b3590b1a 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -113,7 +113,7 @@ static void nfs_writehdr_free(struct nfs_pgio_header *hdr) static struct nfs_io_completion *nfs_io_completion_alloc(gfp_t gfp_flags) { - return kmalloc(sizeof(struct nfs_io_completion), gfp_flags); + return kmalloc_obj(struct nfs_io_completion, gfp_flags); } static void nfs_io_completion_init(struct nfs_io_completion *ioc, diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index afa16d7a8013..e3553ccb6ab4 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -131,7 +131,7 @@ nfsd4_block_proc_layoutget(struct svc_rqst *rqstp, struct inode *inode, * layouts, so make sure to zero the whole structure. */ nfserr = nfserrno(-ENOMEM); - bl = kzalloc(struct_size(bl, extents, nr_extents_max), GFP_KERNEL); + bl = kzalloc_flex(*bl, extents, nr_extents_max, GFP_KERNEL); if (!bl) goto out_error; bl->nr_extents = nr_extents_max; @@ -208,7 +208,7 @@ nfsd4_block_get_device_info_simple(struct super_block *sb, struct pnfs_block_deviceaddr *dev; struct pnfs_block_volume *b; - dev = kzalloc(struct_size(dev, volumes, 1), GFP_KERNEL); + dev = kzalloc_flex(*dev, volumes, 1, GFP_KERNEL); if (!dev) return -ENOMEM; gdp->gd_device = dev; @@ -319,7 +319,7 @@ nfsd4_block_get_device_info_scsi(struct super_block *sb, const struct pr_ops *ops; int ret; - dev = kzalloc(struct_size(dev, volumes, 1), GFP_KERNEL); + dev = kzalloc_flex(*dev, volumes, 1, GFP_KERNEL); if (!dev) return -ENOMEM; gdp->gd_device = dev; diff --git a/fs/nfsd/blocklayoutxdr.c b/fs/nfsd/blocklayoutxdr.c index 196ef4245604..3c145146a0c8 100644 --- a/fs/nfsd/blocklayoutxdr.c +++ b/fs/nfsd/blocklayoutxdr.c @@ -164,7 +164,7 @@ nfsd4_block_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, if (len != expected) return nfserr_bad_xdr; - iomaps = kcalloc(nr_iomaps, sizeof(*iomaps), GFP_KERNEL); + iomaps = kzalloc_objs(*iomaps, nr_iomaps, GFP_KERNEL); if (!iomaps) return nfserr_delay; @@ -258,7 +258,7 @@ nfsd4_scsi_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, if (len != expected) return nfserr_bad_xdr; - iomaps = kcalloc(nr_iomaps, sizeof(*iomaps), GFP_KERNEL); + iomaps = kzalloc_objs(*iomaps, nr_iomaps, GFP_KERNEL); if (!iomaps) return nfserr_delay; diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 09fe268fe2c7..8fb394afc3f5 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -234,7 +234,7 @@ static inline void expkey_update(struct cache_head *cnew, static struct cache_head *expkey_alloc(void) { - struct svc_expkey *i = kmalloc(sizeof(*i), GFP_KERNEL); + struct svc_expkey *i = kmalloc_obj(*i, GFP_KERNEL); if (i) return &i->h; else @@ -479,9 +479,8 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc) if (fsloc->locations_count == 0) return 0; - fsloc->locations = kcalloc(fsloc->locations_count, - sizeof(struct nfsd4_fs_location), - GFP_KERNEL); + fsloc->locations = kzalloc_objs(struct nfsd4_fs_location, + fsloc->locations_count, GFP_KERNEL); if (!fsloc->locations) return -ENOMEM; for (i=0; i < fsloc->locations_count; i++) { @@ -871,11 +870,11 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem) static struct cache_head *svc_export_alloc(void) { - struct svc_export *i = kmalloc(sizeof(*i), GFP_KERNEL); + struct svc_export *i = kmalloc_obj(*i, GFP_KERNEL); if (!i) return NULL; - i->ex_stats = kmalloc(sizeof(*(i->ex_stats)), GFP_KERNEL); + i->ex_stats = kmalloc_obj(*(i->ex_stats), GFP_KERNEL); if (!i->ex_stats) { kfree(i); return NULL; diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 93798575b807..6b4eeb28c88b 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -899,7 +899,7 @@ nfsd_alloc_fcache_disposal(void) { struct nfsd_fcache_disposal *l; - l = kmalloc(sizeof(*l), GFP_KERNEL); + l = kmalloc_obj(*l, GFP_KERNEL); if (!l) return NULL; spin_lock_init(&l->lock); diff --git a/fs/nfsd/flexfilelayout.c b/fs/nfsd/flexfilelayout.c index 0f1a35400cd5..a65d55bcdc02 100644 --- a/fs/nfsd/flexfilelayout.c +++ b/fs/nfsd/flexfilelayout.c @@ -36,7 +36,7 @@ nfsd4_ff_proc_layoutget(struct svc_rqst *rqstp, struct inode *inode, * Zero it out for the stateid - don't want junk in there! */ error = -ENOMEM; - fl = kzalloc(sizeof(*fl), GFP_KERNEL); + fl = kzalloc_obj(*fl, GFP_KERNEL); if (!fl) goto out_error; args->lg_content = fl; @@ -86,7 +86,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, u16 port; char addr[INET6_ADDRSTRLEN]; - da = kzalloc(sizeof(struct pnfs_ff_device_addr), GFP_KERNEL); + da = kzalloc_obj(struct pnfs_ff_device_addr, GFP_KERNEL); if (!da) return nfserrno(-ENOMEM); diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index e00b2aea8da2..88782df7c3a1 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1378,7 +1378,7 @@ void nfsd41_cb_referring_call(struct nfsd4_callback *cb, } } if (!found) { - rcl = kmalloc(sizeof(*rcl), GFP_KERNEL); + rcl = kmalloc_obj(*rcl, GFP_KERNEL); if (!rcl) return; memcpy(rcl->rcl_sessionid.data, sessionid->data, @@ -1397,7 +1397,7 @@ void nfsd41_cb_referring_call(struct nfsd4_callback *cb, } } if (!found) { - rc = kmalloc(sizeof(*rc), GFP_KERNEL); + rc = kmalloc_obj(*rc, GFP_KERNEL); if (!rc) goto out; rc->rc_sequenceid = seqno; diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index c319c31b0f64..6415b847a939 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -97,7 +97,7 @@ ent_put(struct kref *ref) static struct cache_head * ent_alloc(void) { - struct ent *e = kmalloc(sizeof(*e), GFP_KERNEL); + struct ent *e = kmalloc_obj(*e, GFP_KERNEL); if (e) return &e->h; else diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 37ab3a69c4b6..7dbb1dc184db 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -451,7 +451,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, stru int accmode; __be32 status; - *resfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL); + *resfh = kmalloc_obj(struct svc_fh, GFP_KERNEL); if (!*resfh) return nfserr_jukebox; fh_init(*resfh, NFS4_FHSIZE); @@ -1630,7 +1630,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr, __be32 status = 0; *nsui = NULL; - work = kzalloc(sizeof(*work), GFP_KERNEL); + work = kzalloc_obj(*work, GFP_KERNEL); try_again: spin_lock(&nn->nfsd_ssc_lock); list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) { @@ -2160,7 +2160,7 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, memcpy(©->fh, &cstate->current_fh.fh_handle, sizeof(struct knfsd_fh)); if (nfsd4_copy_is_async(copy)) { - async_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL); + async_copy = kzalloc_obj(struct nfsd4_copy, GFP_KERNEL); if (!async_copy) goto out_err; async_copy->cp_nn = nn; @@ -2171,7 +2171,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, if (atomic_inc_return(&nn->pending_async_copies) > (int)rqstp->rq_pool->sp_nrthreads) goto out_dec_async_copy_err; - async_copy->cp_src = kmalloc(sizeof(*async_copy->cp_src), GFP_KERNEL); + async_copy->cp_src = kmalloc_obj(*async_copy->cp_src, + GFP_KERNEL); if (!async_copy->cp_src) goto out_dec_async_copy_err; if (!nfs4_init_copy_state(nn, copy)) diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 1e6b2dd47ba7..87de08c7f405 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -203,7 +203,7 @@ nfsd4_build_namelist(struct dir_context *__ctx, const char *name, int namlen, if (namlen != HEXDIR_LEN - 1) return true; - entry = kmalloc(sizeof(struct name_list), GFP_KERNEL); + entry = kmalloc_obj(struct name_list, GFP_KERNEL); if (entry == NULL) return false; memcpy(entry->name, name, HEXDIR_LEN - 1); @@ -478,9 +478,8 @@ nfs4_legacy_state_init(struct net *net) struct nfsd_net *nn = net_generic(net, nfsd_net_id); int i; - nn->reclaim_str_hashtbl = kmalloc_array(CLIENT_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + nn->reclaim_str_hashtbl = kmalloc_objs(struct list_head, + CLIENT_HASH_SIZE, GFP_KERNEL); if (!nn->reclaim_str_hashtbl) return -ENOMEM; @@ -898,7 +897,7 @@ __nfsd4_init_cld_pipe(struct net *net) if (nn->cld_net) return 0; - cn = kzalloc(sizeof(*cn), GFP_KERNEL); + cn = kzalloc_obj(*cn, GFP_KERNEL); if (!cn) { ret = -ENOMEM; goto err; @@ -960,7 +959,7 @@ alloc_cld_upcall(struct nfsd_net *nn) struct cld_upcall *new, *tmp; struct cld_net *cn = nn->cld_net; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return new; @@ -1356,9 +1355,8 @@ nfs4_cld_state_init(struct net *net) struct nfsd_net *nn = net_generic(net, nfsd_net_id); int i; - nn->reclaim_str_hashtbl = kmalloc_array(CLIENT_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + nn->reclaim_str_hashtbl = kmalloc_objs(struct list_head, + CLIENT_HASH_SIZE, GFP_KERNEL); if (!nn->reclaim_str_hashtbl) return -ENOMEM; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index f5cb067a1e50..fb5b2ff4201e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -299,7 +299,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh, nbl = find_blocked_lock(lo, fh, nn); if (!nbl) { - nbl = kmalloc(sizeof(*nbl), GFP_KERNEL); + nbl = kmalloc_obj(*nbl, GFP_KERNEL); if (nbl) { INIT_LIST_HEAD(&nbl->nbl_list); INIT_LIST_HEAD(&nbl->nbl_lru); @@ -974,7 +974,7 @@ struct nfs4_cpntf_state *nfs4_alloc_init_cpntf_state(struct nfsd_net *nn, { struct nfs4_cpntf_state *cps; - cps = kzalloc(sizeof(struct nfs4_cpntf_state), GFP_KERNEL); + cps = kzalloc_obj(struct nfs4_cpntf_state, GFP_KERNEL); if (!cps) return NULL; cps->cpntf_time = ktime_get_boottime_seconds(); @@ -2032,7 +2032,7 @@ static struct nfsd4_slot *nfsd4_alloc_slot(struct nfsd4_channel_attrs *fattrs, size = fattrs->maxresp_cached < NFSD_MIN_HDR_SEQ_SZ ? 0 : fattrs->maxresp_cached - NFSD_MIN_HDR_SEQ_SZ; - slot = kzalloc(struct_size(slot, sl_data, size), gfp); + slot = kzalloc_flex(*slot, sl_data, size, gfp); if (!slot) return NULL; slot->sl_index = index; @@ -2047,7 +2047,7 @@ static struct nfsd4_session *alloc_session(struct nfsd4_channel_attrs *fattrs, struct nfsd4_slot *slot; int i; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; xa_init(&new->se_slots); @@ -2108,7 +2108,7 @@ static struct nfsd4_conn *alloc_conn(struct svc_rqst *rqstp, u32 flags) { struct nfsd4_conn *conn; - conn = kmalloc(sizeof(struct nfsd4_conn), GFP_KERNEL); + conn = kmalloc_obj(struct nfsd4_conn, GFP_KERNEL); if (!conn) return NULL; svc_xprt_get(rqstp->rq_xprt); @@ -2357,9 +2357,8 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name, xdr_netobj_dup(&clp->cl_name, &name, GFP_KERNEL); if (clp->cl_name.data == NULL) goto err_no_name; - clp->cl_ownerstr_hashtbl = kmalloc_array(OWNER_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + clp->cl_ownerstr_hashtbl = kmalloc_objs(struct list_head, + OWNER_HASH_SIZE, GFP_KERNEL); if (!clp->cl_ownerstr_hashtbl) goto err_no_hashtbl; clp->cl_callback_wq = alloc_ordered_workqueue("nfsd4_callbacks", 0); @@ -3309,7 +3308,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, free_client(clp); return NULL; } - clp->cl_ra = kzalloc(sizeof(*clp->cl_ra), GFP_KERNEL); + clp->cl_ra = kzalloc_obj(*clp->cl_ra, GFP_KERNEL); if (!clp->cl_ra) { free_client(clp); return NULL; @@ -8823,7 +8822,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, static inline struct nfs4_client_reclaim * alloc_reclaim(void) { - return kmalloc(sizeof(struct nfs4_client_reclaim), GFP_KERNEL); + return kmalloc_obj(struct nfs4_client_reclaim, GFP_KERNEL); } bool @@ -8960,19 +8959,16 @@ static int nfs4_state_create_net(struct net *net) struct nfsd_net *nn = net_generic(net, nfsd_net_id); int i; - nn->conf_id_hashtbl = kmalloc_array(CLIENT_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + nn->conf_id_hashtbl = kmalloc_objs(struct list_head, CLIENT_HASH_SIZE, + GFP_KERNEL); if (!nn->conf_id_hashtbl) goto err; - nn->unconf_id_hashtbl = kmalloc_array(CLIENT_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + nn->unconf_id_hashtbl = kmalloc_objs(struct list_head, CLIENT_HASH_SIZE, + GFP_KERNEL); if (!nn->unconf_id_hashtbl) goto err_unconf_id; - nn->sessionid_hashtbl = kmalloc_array(SESSION_HASH_SIZE, - sizeof(struct list_head), - GFP_KERNEL); + nn->sessionid_hashtbl = kmalloc_objs(struct list_head, + SESSION_HASH_SIZE, GFP_KERNEL); if (!nn->sessionid_hashtbl) goto err_sessionid; diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 5172dbd0cb05..c96d31b7846e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -124,7 +124,7 @@ svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, size_t len) { struct svcxdr_tmpbuf *tb; - tb = kmalloc(struct_size(tb, buf, len), GFP_KERNEL); + tb = kmalloc_flex(*tb, buf, len, GFP_KERNEL); if (!tb) return NULL; tb->next = argp->to_free; @@ -2184,7 +2184,7 @@ nfsd4_decode_copy(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u) if (status) return status; - ns_dummy = kmalloc(sizeof(struct nl4_server), GFP_KERNEL); + ns_dummy = kmalloc_obj(struct nl4_server, GFP_KERNEL); if (ns_dummy == NULL) return nfserr_jukebox; for (i = 0; i < count - 1; i++) { @@ -3956,7 +3956,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr, } if ((attrmask[0] & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && !fhp) { - tempfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL); + tempfh = kmalloc_obj(struct svc_fh, GFP_KERNEL); status = nfserr_jukebox; if (!tempfh) goto out; diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 89fe2c0e8d44..777b7bb9aeca 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -477,7 +477,7 @@ static ssize_t write_pool_threads(struct file *file, char *buf, size_t size) return strlen(buf); } - nthreads = kcalloc(npools, sizeof(int), GFP_KERNEL); + nthreads = kzalloc_objs(int, npools, GFP_KERNEL); rv = -ENOMEM; if (nthreads == NULL) goto out_free; @@ -1596,7 +1596,7 @@ int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info) mutex_lock(&nfsd_mutex); - nthreads = kcalloc(nrpools, sizeof(int), GFP_KERNEL); + nthreads = kzalloc_objs(int, nrpools, GFP_KERNEL); if (!nthreads) { ret = -ENOMEM; goto out_unlock; diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c index 6b506995818d..e7eebb04f9a4 100644 --- a/fs/nilfs2/alloc.c +++ b/fs/nilfs2/alloc.c @@ -54,7 +54,7 @@ int nilfs_palloc_init_blockgroup(struct inode *inode, unsigned int entry_size) { struct nilfs_mdt_info *mi = NILFS_MDT(inode); - mi->mi_bgl = kmalloc(sizeof(*mi->mi_bgl), GFP_NOFS); + mi->mi_bgl = kmalloc_obj(*mi->mi_bgl, GFP_NOFS); if (!mi->mi_bgl) return -ENOMEM; diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c index a9c61d0492cb..4d5a6aa5214c 100644 --- a/fs/nilfs2/recovery.c +++ b/fs/nilfs2/recovery.c @@ -370,7 +370,7 @@ static int nilfs_scan_dsync_log(struct the_nilfs *nilfs, sector_t start_blocknr, if (unlikely(!binfo)) goto out; - rb = kmalloc(sizeof(*rb), GFP_NOFS); + rb = kmalloc_obj(*rb, GFP_NOFS); if (unlikely(!rb)) { err = -ENOMEM; goto out; @@ -414,7 +414,7 @@ struct nilfs_segment_entry { static int nilfs_segment_list_add(struct list_head *head, __u64 segnum) { - struct nilfs_segment_entry *ent = kmalloc(sizeof(*ent), GFP_NOFS); + struct nilfs_segment_entry *ent = kmalloc_obj(*ent, GFP_NOFS); if (unlikely(!ent)) return -ENOMEM; diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index deee16bc9d4e..21c5539c7e84 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2701,7 +2701,7 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct super_block *sb, struct the_nilfs *nilfs = sb->s_fs_info; struct nilfs_sc_info *sci; - sci = kzalloc(sizeof(*sci), GFP_KERNEL); + sci = kzalloc_obj(*sci, GFP_KERNEL); if (!sci) return NULL; diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index badc2cbc895e..55fac3f83232 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1292,7 +1292,7 @@ static int nilfs_init_fs_context(struct fs_context *fc) { struct nilfs_fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index d0bcf744c553..f481532ea8e9 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -56,7 +56,7 @@ struct the_nilfs *alloc_nilfs(struct super_block *sb) { struct the_nilfs *nilfs; - nilfs = kzalloc(sizeof(*nilfs), GFP_KERNEL); + nilfs = kzalloc_obj(*nilfs, GFP_KERNEL); if (!nilfs) return NULL; @@ -877,7 +877,7 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno) if (root) return root; - new = kzalloc(sizeof(*root), GFP_KERNEL); + new = kzalloc_obj(*root, GFP_KERNEL); if (!new) return NULL; diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index d0b9b984002f..c2dcb25151de 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -1573,7 +1573,7 @@ static struct fsnotify_event *fanotify_alloc_overflow_event(void) { struct fanotify_event *oevent; - oevent = kmalloc(sizeof(*oevent), GFP_KERNEL_ACCOUNT); + oevent = kmalloc_obj(*oevent, GFP_KERNEL_ACCOUNT); if (!oevent) return NULL; diff --git a/fs/notify/group.c b/fs/notify/group.c index 18446b7b0d49..b56d1c1d9644 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -117,7 +117,7 @@ static struct fsnotify_group *__fsnotify_alloc_group( { struct fsnotify_group *group; - group = kzalloc(sizeof(struct fsnotify_group), gfp); + group = kzalloc_obj(struct fsnotify_group, gfp); if (!group) return ERR_PTR(-ENOMEM); diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index b372fb2c56bd..5e1845f2c25d 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -660,7 +660,7 @@ static struct fsnotify_group *inotify_new_group(unsigned int max_events) if (IS_ERR(group)) return group; - oevent = kmalloc(sizeof(struct inotify_event_info), GFP_KERNEL_ACCOUNT); + oevent = kmalloc_obj(struct inotify_event_info, GFP_KERNEL_ACCOUNT); if (unlikely(!oevent)) { fsnotify_destroy_group(group); return ERR_PTR(-ENOMEM); diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 8e6997e9aebb..691d36104ae2 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -644,7 +644,7 @@ static int fsnotify_attach_info_to_sb(struct super_block *sb) struct fsnotify_sb_info *sbinfo; /* sb info is freed on fsnotify_sb_delete() */ - sbinfo = kzalloc(sizeof(*sbinfo), GFP_KERNEL); + sbinfo = kzalloc_obj(*sbinfo, GFP_KERNEL); if (!sbinfo) return -ENOMEM; diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c index db7d0ecfb469..60b362f388d9 100644 --- a/fs/ntfs3/bitmap.c +++ b/fs/ntfs3/bitmap.c @@ -519,7 +519,7 @@ static int wnd_rescan(struct wnd_bitmap *wnd) vbo = 0; /* Allocate in memory instead of stack. Not critical if failed. */ - ra = kzalloc(sizeof(*ra), GFP_NOFS); + ra = kzalloc_obj(*ra, GFP_NOFS); if (ra) { file_ra_state_init(ra, mapping); ra->ra_pages = (wnd->nbits / 8 + PAGE_SIZE - 1) >> PAGE_SHIFT; diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index f53037e0ecb6..7eecf1e01f74 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -1006,7 +1006,7 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from) return -EOPNOTSUPP; } - pages = kmalloc_array(pages_per_frame, sizeof(struct page *), GFP_NOFS); + pages = kmalloc_objs(struct page *, pages_per_frame, GFP_NOFS); if (!pages) return -ENOMEM; diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index bd0fa481e4b3..2e901d073fe9 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -316,7 +316,7 @@ bool ni_add_subrecord(struct ntfs_inode *ni, CLST rno, struct mft_inode **mi) { struct mft_inode *m; - m = kzalloc(sizeof(struct mft_inode), GFP_NOFS); + m = kzalloc_obj(struct mft_inode, GFP_NOFS); if (!m) return false; @@ -1915,7 +1915,7 @@ int ni_read_folio_cmpr(struct ntfs_inode *ni, struct folio *folio) idx = (vbo - frame_vbo) >> PAGE_SHIFT; pages_per_frame = frame_size >> PAGE_SHIFT; - pages = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS); + pages = kzalloc_objs(struct page *, pages_per_frame, GFP_NOFS); if (!pages) { err = -ENOMEM; goto out; @@ -1998,7 +1998,7 @@ int ni_decompress_file(struct ntfs_inode *ni) frame_bits = ni_ext_compress_bits(ni); frame_size = 1u << frame_bits; pages_per_frame = frame_size >> PAGE_SHIFT; - pages = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS); + pages = kzalloc_objs(struct page *, pages_per_frame, GFP_NOFS); if (!pages) { err = -ENOMEM; goto out; diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 10863c83c315..272e45276143 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -2473,7 +2473,7 @@ static int read_log_rec_lcb(struct ntfs_log *log, u64 lsn, u32 ctx_mode, if (!verify_client_lsn(log, cr, lsn)) return -EINVAL; - lcb = kzalloc(sizeof(struct lcb), GFP_NOFS); + lcb = kzalloc_obj(struct lcb, GFP_NOFS); if (!lcb) return -ENOMEM; lcb->client = log->client_id; @@ -3117,8 +3117,7 @@ static int do_action(struct ntfs_log *log, struct OPEN_ATTR_ENRTY *oe, /* Read from disk. */ err = mi_get(sbi, rno, &mi); if (err && op == InitializeFileRecordSegment) { - mi = kzalloc(sizeof(struct mft_inode), - GFP_NOFS); + mi = kzalloc_obj(struct mft_inode, GFP_NOFS); if (!mi) return -ENOMEM; err = mi_format_new(mi, sbi, rno, 0, false); @@ -3779,7 +3778,7 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) u16 t16; u32 t32; - log = kzalloc(sizeof(struct ntfs_log), GFP_NOFS); + log = kzalloc_obj(struct ntfs_log, GFP_NOFS); if (!log) return -ENOMEM; @@ -4725,7 +4724,7 @@ next_open_attribute: goto next_dirty_page; } - oa = kzalloc(sizeof(struct OpenAttr), GFP_NOFS); + oa = kzalloc_obj(struct OpenAttr, GFP_NOFS); if (!oa) { err = -ENOMEM; goto out; diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index 2416c61050f1..97f06c26fe1a 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -940,7 +940,7 @@ static struct indx_node *indx_new(struct ntfs_index *indx, u16 fn; u32 eo; - r = kzalloc(sizeof(struct indx_node), GFP_NOFS); + r = kzalloc_obj(struct indx_node, GFP_NOFS); if (!r) return ERR_PTR(-ENOMEM); @@ -1046,7 +1046,7 @@ int indx_read_ra(struct ntfs_index *indx, struct ntfs_inode *ni, CLST vbn, const struct INDEX_NAMES *name; if (!in) { - in = kzalloc(sizeof(struct indx_node), GFP_NOFS); + in = kzalloc_obj(struct indx_node, GFP_NOFS); if (!in) return -ENOMEM; } else { diff --git a/fs/ntfs3/lib/lzx_decompress.c b/fs/ntfs3/lib/lzx_decompress.c index 4d5701024f83..9196bf30011a 100644 --- a/fs/ntfs3/lib/lzx_decompress.c +++ b/fs/ntfs3/lib/lzx_decompress.c @@ -572,7 +572,7 @@ static int lzx_decompress_block(const struct lzx_decompressor *d, */ struct lzx_decompressor *lzx_allocate_decompressor(void) { - return kmalloc(sizeof(struct lzx_decompressor), GFP_NOFS); + return kmalloc_obj(struct lzx_decompressor, GFP_NOFS); } /* diff --git a/fs/ntfs3/lib/xpress_decompress.c b/fs/ntfs3/lib/xpress_decompress.c index 769c6d3dde67..402cf21aede2 100644 --- a/fs/ntfs3/lib/xpress_decompress.c +++ b/fs/ntfs3/lib/xpress_decompress.c @@ -39,7 +39,7 @@ struct xpress_decompressor { */ struct xpress_decompressor *xpress_allocate_decompressor(void) { - return kmalloc(sizeof(struct xpress_decompressor), GFP_NOFS); + return kmalloc_obj(struct xpress_decompressor, GFP_NOFS); } /* diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 921b526eb0f4..daf5a1f47275 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -730,7 +730,7 @@ int indx_used_bit(struct ntfs_index *indx, struct ntfs_inode *ni, size_t *bit); void fnd_clear(struct ntfs_fnd *fnd); static inline struct ntfs_fnd *fnd_get(void) { - return kzalloc(sizeof(struct ntfs_fnd), GFP_NOFS); + return kzalloc_obj(struct ntfs_fnd, GFP_NOFS); } static inline void fnd_put(struct ntfs_fnd *fnd) { @@ -996,7 +996,7 @@ static inline void run_init(struct runs_tree *run) static inline struct runs_tree *run_alloc(void) { - return kzalloc(sizeof(struct runs_tree), GFP_NOFS); + return kzalloc_obj(struct runs_tree, GFP_NOFS); } static inline void run_close(struct runs_tree *run) diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index 167093e8d287..32bdb034c2a3 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -71,7 +71,7 @@ static __le16 mi_new_attt_id(struct ntfs_inode *ni, struct mft_inode *mi) int mi_get(struct ntfs_sb_info *sbi, CLST rno, struct mft_inode **mi) { int err; - struct mft_inode *m = kzalloc(sizeof(struct mft_inode), GFP_NOFS); + struct mft_inode *m = kzalloc_obj(struct mft_inode, GFP_NOFS); if (!m) return -ENOMEM; diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 27411203082a..174a7cb202a0 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -1828,7 +1828,7 @@ static int __ntfs_init_fs_context(struct fs_context *fc) struct ntfs_mount_options *opts; struct ntfs_sb_info *sbi; - opts = kzalloc(sizeof(struct ntfs_mount_options), GFP_NOFS); + opts = kzalloc_obj(struct ntfs_mount_options, GFP_NOFS); if (!opts) return -ENOMEM; @@ -1847,7 +1847,7 @@ static int __ntfs_init_fs_context(struct fs_context *fc) if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) goto ok; - sbi = kzalloc(sizeof(struct ntfs_sb_info), GFP_NOFS); + sbi = kzalloc_obj(struct ntfs_sb_info, GFP_NOFS); if (!sbi) goto free_opts; diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index b7db177d17d6..ce8ce1470981 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -686,7 +686,7 @@ static struct ocfs2_path *ocfs2_new_path(struct buffer_head *root_bh, BUG_ON(le16_to_cpu(root_el->l_tree_depth) >= OCFS2_MAX_PATH_DEPTH); - path = kzalloc(sizeof(*path), GFP_NOFS); + path = kzalloc_obj(*path, GFP_NOFS); if (path) { path->p_tree_depth = le16_to_cpu(root_el->l_tree_depth); get_bh(root_bh); @@ -1202,8 +1202,7 @@ static int ocfs2_add_branch(handle_t *handle, } /* allocate the number of new eb blocks we need */ - new_eb_bhs = kcalloc(new_blocks, sizeof(struct buffer_head *), - GFP_KERNEL); + new_eb_bhs = kzalloc_objs(struct buffer_head *, new_blocks, GFP_KERNEL); if (!new_eb_bhs) { status = -ENOMEM; mlog_errno(status); @@ -6493,7 +6492,7 @@ int ocfs2_cache_cluster_dealloc(struct ocfs2_cached_dealloc_ctxt *ctxt, int ret = 0; struct ocfs2_cached_block_free *item; - item = kzalloc(sizeof(*item), GFP_NOFS); + item = kzalloc_obj(*item, GFP_NOFS); if (item == NULL) { ret = -ENOMEM; mlog_errno(ret); @@ -6619,7 +6618,7 @@ ocfs2_find_per_slot_free_list(int type, fl = fl->f_next_suballocator; } - fl = kmalloc(sizeof(*fl), GFP_NOFS); + fl = kmalloc_obj(*fl, GFP_NOFS); if (fl) { fl->f_inode_type = type; fl->f_slot = slot; @@ -6794,7 +6793,7 @@ int ocfs2_cache_block_dealloc(struct ocfs2_cached_dealloc_ctxt *ctxt, goto out; } - item = kzalloc(sizeof(*item), GFP_NOFS); + item = kzalloc_obj(*item, GFP_NOFS); if (item == NULL) { ret = -ENOMEM; mlog_errno(ret); @@ -6984,8 +6983,8 @@ int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle, if (range_start >= range_end) return 0; - folios = kcalloc(ocfs2_pages_per_cluster(sb), - sizeof(struct folio *), GFP_NOFS); + folios = kzalloc_objs(struct folio *, ocfs2_pages_per_cluster(sb), + GFP_NOFS); if (folios == NULL) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 76c86f1c2b1c..17ba79f443ee 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -823,7 +823,7 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp, u32 cend; struct ocfs2_write_ctxt *wc; - wc = kzalloc(sizeof(struct ocfs2_write_ctxt), GFP_NOFS); + wc = kzalloc_obj(struct ocfs2_write_ctxt, GFP_NOFS); if (!wc) return -ENOMEM; @@ -1325,8 +1325,7 @@ retry: if (new == NULL) { spin_unlock(&oi->ip_lock); - new = kmalloc(sizeof(struct ocfs2_unwritten_extent), - GFP_NOFS); + new = kmalloc_obj(struct ocfs2_unwritten_extent, GFP_NOFS); if (new == NULL) { ret = -ENOMEM; goto out; @@ -2080,7 +2079,7 @@ ocfs2_dio_alloc_write_ctx(struct buffer_head *bh, int *alloc) if (bh->b_private) return bh->b_private; - dwc = kmalloc(sizeof(struct ocfs2_dio_write_ctxt), GFP_NOFS); + dwc = kmalloc_obj(struct ocfs2_dio_write_ctxt, GFP_NOFS); if (dwc == NULL) return NULL; INIT_LIST_HEAD(&dwc->dw_zero_list); diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 8e9cbc334cf4..91fb76a43900 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -1677,8 +1677,8 @@ static int o2hb_map_slot_data(struct o2hb_region *reg) if (reg->hr_tmp_block == NULL) return -ENOMEM; - reg->hr_slots = kcalloc(reg->hr_blocks, - sizeof(struct o2hb_disk_slot), GFP_KERNEL); + reg->hr_slots = kzalloc_objs(struct o2hb_disk_slot, reg->hr_blocks, + GFP_KERNEL); if (reg->hr_slots == NULL) return -ENOMEM; @@ -1694,8 +1694,8 @@ static int o2hb_map_slot_data(struct o2hb_region *reg) "at %u blocks per page\n", reg->hr_num_pages, reg->hr_blocks, spp); - reg->hr_slot_data = kcalloc(reg->hr_num_pages, sizeof(struct page *), - GFP_KERNEL); + reg->hr_slot_data = kzalloc_objs(struct page *, reg->hr_num_pages, + GFP_KERNEL); if (!reg->hr_slot_data) return -ENOMEM; @@ -2001,7 +2001,7 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g struct o2hb_region *reg = NULL; int ret; - reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL); + reg = kzalloc_obj(struct o2hb_region, GFP_KERNEL); if (reg == NULL) return ERR_PTR(-ENOMEM); @@ -2211,7 +2211,7 @@ struct config_group *o2hb_alloc_hb_set(void) struct o2hb_heartbeat_group *hs = NULL; struct config_group *ret = NULL; - hs = kzalloc(sizeof(struct o2hb_heartbeat_group), GFP_KERNEL); + hs = kzalloc_obj(struct o2hb_heartbeat_group, GFP_KERNEL); if (hs == NULL) goto out; diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index bc27301eab6d..2cb3162aeb89 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c @@ -380,7 +380,7 @@ static int sc_common_open(struct file *file, int ctxt) struct o2net_sock_debug *sd; struct o2net_sock_container *dummy_sc; - dummy_sc = kzalloc(sizeof(*dummy_sc), GFP_KERNEL); + dummy_sc = kzalloc_obj(*dummy_sc, GFP_KERNEL); if (!dummy_sc) return -ENOMEM; diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index c5e83c774d73..6fb8bc38c0f7 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c @@ -587,7 +587,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group, if (strlen(name) > O2NM_MAX_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); - node = kzalloc(sizeof(struct o2nm_node), GFP_KERNEL); + node = kzalloc_obj(struct o2nm_node, GFP_KERNEL); if (node == NULL) return ERR_PTR(-ENOMEM); @@ -695,8 +695,8 @@ static struct config_group *o2nm_cluster_group_make_group(struct config_group *g if (o2nm_single_cluster) return ERR_PTR(-ENOSPC); - cluster = kzalloc(sizeof(struct o2nm_cluster), GFP_KERNEL); - ns = kzalloc(sizeof(struct o2nm_node_group), GFP_KERNEL); + cluster = kzalloc_obj(struct o2nm_cluster, GFP_KERNEL); + ns = kzalloc_obj(struct o2nm_node_group, GFP_KERNEL); o2hb_group = o2hb_alloc_hb_set(); if (cluster == NULL || ns == NULL || o2hb_group == NULL) goto out; diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 79b281e32f4c..09a1f3b77bb8 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c @@ -415,7 +415,7 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node) int status = 0; page = alloc_page(GFP_NOFS); - sc = kzalloc(sizeof(*sc), GFP_NOFS); + sc = kzalloc_obj(*sc, GFP_NOFS); if (sc == NULL || page == NULL) goto out; @@ -825,7 +825,7 @@ int o2net_register_handler(u32 msg_type, u32 key, u32 max_len, goto out; } - nmh = kzalloc(sizeof(struct o2net_msg_handler), GFP_NOFS); + nmh = kzalloc_obj(struct o2net_msg_handler, GFP_NOFS); if (nmh == NULL) { ret = -ENOMEM; goto out; @@ -1064,14 +1064,14 @@ int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec, o2net_set_nst_sock_container(&nst, sc); veclen = caller_veclen + 1; - vec = kmalloc_array(veclen, sizeof(struct kvec), GFP_ATOMIC); + vec = kmalloc_objs(struct kvec, veclen, GFP_ATOMIC); if (vec == NULL) { mlog(0, "failed to %zu element kvec!\n", veclen); ret = -ENOMEM; goto out; } - msg = kmalloc(sizeof(struct o2net_msg), GFP_ATOMIC); + msg = kmalloc_obj(struct o2net_msg, GFP_ATOMIC); if (!msg) { mlog(0, "failed to allocate a o2net_msg!\n"); ret = -ENOMEM; diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 1873bbbb7e5b..c4ba968e778b 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -265,7 +265,7 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry, /* * There are no other aliases */ - dl = kmalloc(sizeof(*dl), GFP_NOFS); + dl = kmalloc_obj(*dl, GFP_NOFS); if (!dl) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 782afd9fa934..1c8abf2c592c 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -2550,8 +2550,7 @@ static struct buffer_head **ocfs2_dx_dir_kmalloc_leaves(struct super_block *sb, int num_dx_leaves = ocfs2_clusters_to_blocks(sb, 1); struct buffer_head **dx_leaves; - dx_leaves = kcalloc(num_dx_leaves, sizeof(struct buffer_head *), - GFP_NOFS); + dx_leaves = kzalloc_objs(struct buffer_head *, num_dx_leaves, GFP_NOFS); if (dx_leaves && ret_num_leaves) *ret_num_leaves = num_dx_leaves; diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index cf3ca2f597c2..ff4868619d35 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -1048,7 +1048,7 @@ static int dlm_send_regions(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qr = kzalloc(sizeof(struct dlm_query_region), GFP_KERNEL); + qr = kzalloc_obj(struct dlm_query_region, GFP_KERNEL); if (!qr) { ret = -ENOMEM; mlog_errno(ret); @@ -1220,7 +1220,7 @@ static int dlm_send_nodeinfo(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qn = kzalloc(sizeof(struct dlm_query_nodeinfo), GFP_KERNEL); + qn = kzalloc_obj(struct dlm_query_nodeinfo, GFP_KERNEL); if (!qn) { ret = -ENOMEM; mlog_errno(ret); @@ -1592,7 +1592,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm) mlog(0, "%p", dlm); - ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); if (!ctxt) { status = -ENOMEM; mlog_errno(status); @@ -1946,7 +1946,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, int ret; struct dlm_ctxt *dlm = NULL; - dlm = kzalloc(sizeof(*dlm), GFP_KERNEL); + dlm = kzalloc_obj(*dlm, GFP_KERNEL); if (!dlm) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c index 041fd1791ae7..46120eb75d90 100644 --- a/fs/ocfs2/dlm/dlmlock.c +++ b/fs/ocfs2/dlm/dlmlock.c @@ -414,7 +414,7 @@ struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie, if (!lksb) { /* zero memory only if kernel-allocated */ - lksb = kzalloc(sizeof(*lksb), GFP_NOFS); + lksb = kzalloc_obj(*lksb, GFP_NOFS); if (!lksb) { kmem_cache_free(dlm_lock_cache, lock); return NULL; diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 4145e06d2c08..eb62724bbe9b 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -2040,7 +2040,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, int ignore_higher, u8 request_from, u32 flags) { struct dlm_work_item *item; - item = kzalloc(sizeof(*item), GFP_ATOMIC); + item = kzalloc_obj(*item, GFP_ATOMIC); if (!item) return -ENOMEM; @@ -2303,7 +2303,7 @@ int dlm_deref_lockres_handler(struct o2net_msg *msg, u32 len, void *data, goto done; } - item = kzalloc(sizeof(*item), GFP_NOFS); + item = kzalloc_obj(*item, GFP_NOFS); if (!item) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 843ee02bd85f..128872bd945d 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -743,7 +743,7 @@ static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node) } BUG_ON(num == dead_node); - ndata = kzalloc(sizeof(*ndata), GFP_NOFS); + ndata = kzalloc_obj(*ndata, GFP_NOFS); if (!ndata) { dlm_destroy_recovery_area(dlm); return -ENOMEM; @@ -830,7 +830,7 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data, } BUG_ON(lr->dead_node != dlm->reco.dead_node); - item = kzalloc(sizeof(*item), GFP_NOFS); + item = kzalloc_obj(*item, GFP_NOFS); if (!item) { dlm_put(dlm); return -ENOMEM; @@ -1382,7 +1382,7 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data, ret = -ENOMEM; buf = kmalloc(be16_to_cpu(msg->data_len), GFP_NOFS); - item = kzalloc(sizeof(*item), GFP_NOFS); + item = kzalloc_obj(*item, GFP_NOFS); if (!buf || !item) goto leave; diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 339f0b11cdc8..45cce261da65 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -134,7 +134,7 @@ static int dlmfs_file_open(struct inode *inode, * doesn't make sense for LVB writes. */ file->f_flags &= ~O_APPEND; - fp = kmalloc(sizeof(*fp), GFP_NOFS); + fp = kmalloc_obj(*fp, GFP_NOFS); if (!fp) { status = -ENOMEM; goto bail; diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 619ff03b15d6..627d488b0148 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3030,7 +3030,7 @@ struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void) { struct ocfs2_dlm_debug *dlm_debug; - dlm_debug = kmalloc(sizeof(struct ocfs2_dlm_debug), GFP_KERNEL); + dlm_debug = kmalloc_obj(struct ocfs2_dlm_debug, GFP_KERNEL); if (!dlm_debug) { mlog_errno(-ENOMEM); goto out; diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index ef147e8b3271..d68229422dda 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c @@ -246,7 +246,7 @@ search: if (new_emi == NULL) { spin_unlock(&oi->ip_lock); - new_emi = kmalloc(sizeof(*new_emi), GFP_NOFS); + new_emi = kmalloc_obj(*new_emi, GFP_NOFS); if (new_emi == NULL) goto out; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ed961a854983..70879058b0c9 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -54,7 +54,7 @@ static int ocfs2_init_file_private(struct inode *inode, struct file *file) { struct ocfs2_file_private *fp; - fp = kzalloc(sizeof(struct ocfs2_file_private), GFP_KERNEL); + fp = kzalloc_obj(struct ocfs2_file_private, GFP_KERNEL); if (!fp) return -ENOMEM; diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c index 3ad7baf67658..be713d7d24a7 100644 --- a/fs/ocfs2/filecheck.c +++ b/fs/ocfs2/filecheck.c @@ -169,7 +169,7 @@ int ocfs2_filecheck_create_sysfs(struct ocfs2_super *osb) struct ocfs2_filecheck *fcheck; struct ocfs2_filecheck_sysfs_entry *entry = &osb->osb_fc_ent; - fcheck = kmalloc(sizeof(struct ocfs2_filecheck), GFP_NOFS); + fcheck = kmalloc_obj(struct ocfs2_filecheck, GFP_NOFS); if (!fcheck) return -ENOMEM; @@ -464,7 +464,7 @@ static ssize_t ocfs2_filecheck_attr_store(struct kobject *kobj, goto exit; } - entry = kmalloc(sizeof(struct ocfs2_filecheck_entry), GFP_NOFS); + entry = kmalloc_obj(struct ocfs2_filecheck_entry, GFP_NOFS); if (!entry) { ret = -ENOMEM; goto exit; diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index b6864602814c..872b826979ec 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@ -334,7 +334,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *inode_alloc = NULL; - oifi = kzalloc(sizeof(struct ocfs2_info_freeinode), GFP_KERNEL); + oifi = kzalloc_obj(struct ocfs2_info_freeinode, GFP_KERNEL); if (!oifi) { status = -ENOMEM; mlog_errno(status); @@ -620,7 +620,7 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *gb_inode = NULL; - oiff = kzalloc(sizeof(struct ocfs2_info_freefrag), GFP_KERNEL); + oiff = kzalloc_obj(struct ocfs2_info_freefrag, GFP_KERNEL); if (!oiff) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 85239807dec7..1b9359304aef 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -114,9 +114,8 @@ int ocfs2_compute_replay_slots(struct ocfs2_super *osb) if (osb->replay_map) return 0; - replay_map = kzalloc(struct_size(replay_map, rm_replay_slots, - osb->max_slots), - GFP_KERNEL); + replay_map = kzalloc_flex(*replay_map, rm_replay_slots, osb->max_slots, + GFP_KERNEL); if (!replay_map) { mlog_errno(-ENOMEM); return -ENOMEM; @@ -178,8 +177,7 @@ int ocfs2_recovery_init(struct ocfs2_super *osb) osb->recovery_thread_task = NULL; init_waitqueue_head(&osb->recovery_event); - rm = kzalloc(struct_size(rm, rm_entries, osb->max_slots), - GFP_KERNEL); + rm = kzalloc_flex(*rm, rm_entries, osb->max_slots, GFP_KERNEL); if (!rm) { mlog_errno(-ENOMEM); return -ENOMEM; @@ -878,7 +876,7 @@ int ocfs2_journal_alloc(struct ocfs2_super *osb) int status = 0; struct ocfs2_journal *journal; - journal = kzalloc(sizeof(struct ocfs2_journal), GFP_KERNEL); + journal = kzalloc_obj(struct ocfs2_journal, GFP_KERNEL); if (!journal) { mlog(ML_ERROR, "unable to alloc journal\n"); status = -ENOMEM; @@ -1394,7 +1392,7 @@ static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, { struct ocfs2_la_recovery_item *item; - item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_NOFS); + item = kmalloc_obj(struct ocfs2_la_recovery_item, GFP_NOFS); if (!item) { /* Though we wish to avoid it, we are in fact safe in * skipping local alloc cleanup as fsck.ocfs2 is more @@ -1480,7 +1478,7 @@ static int __ocfs2_recovery_thread(void *arg) } if (quota_enabled) { - rm_quota = kcalloc(osb->max_slots, sizeof(int), GFP_NOFS); + rm_quota = kzalloc_objs(int, osb->max_slots, GFP_NOFS); if (!rm_quota) { status = -ENOMEM; goto bail; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 56be21c695d6..29fa6fb11ea5 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -1094,7 +1094,7 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb, { int status; - *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index e3cdf8788484..c53de4439d93 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -1011,7 +1011,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp) goto out_drop; } - context = kzalloc(sizeof(struct ocfs2_move_extents_context), GFP_NOFS); + context = kzalloc_obj(struct ocfs2_move_extents_context, GFP_NOFS); if (!context) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 4ec6dbed65a8..85ad1a9db734 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -1736,7 +1736,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, goto bail; } - bhs = kcalloc(blocks, sizeof(struct buffer_head *), GFP_KERNEL); + bhs = kzalloc_objs(struct buffer_head *, blocks, GFP_KERNEL); if (!bhs) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index de7f12858729..c4e0117d8977 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -298,7 +298,7 @@ static int ocfs2_add_recovery_chunk(struct super_block *sb, { struct ocfs2_recovery_chunk *rc; - rc = kmalloc(sizeof(struct ocfs2_recovery_chunk), GFP_NOFS); + rc = kmalloc_obj(struct ocfs2_recovery_chunk, GFP_NOFS); if (!rc) return -ENOMEM; rc->rc_chunk = chunk; @@ -372,7 +372,7 @@ static struct ocfs2_quota_recovery *ocfs2_alloc_quota_recovery(void) int type; struct ocfs2_quota_recovery *rec; - rec = kmalloc(sizeof(struct ocfs2_quota_recovery), GFP_NOFS); + rec = kmalloc_obj(struct ocfs2_quota_recovery, GFP_NOFS); if (!rec) return NULL; for (type = 0; type < OCFS2_MAXQUOTAS; type++) @@ -692,7 +692,7 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) info->dqi_max_spc_limit = 0x7fffffffffffffffLL; info->dqi_max_ino_limit = 0x7fffffffffffffffLL; - oinfo = kmalloc(sizeof(struct ocfs2_mem_dqinfo), GFP_NOFS); + oinfo = kmalloc_obj(struct ocfs2_mem_dqinfo, GFP_NOFS); if (!oinfo) { mlog(ML_ERROR, "failed to allocate memory for ocfs2 quota" " info."); diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index c92e0ea85bca..c1cdececdfa4 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -311,7 +311,7 @@ ocfs2_allocate_refcount_tree(struct ocfs2_super *osb, u64 rf_blkno) { struct ocfs2_refcount_tree *new; - new = kzalloc(sizeof(struct ocfs2_refcount_tree), GFP_NOFS); + new = kzalloc_obj(struct ocfs2_refcount_tree, GFP_NOFS); if (!new) return NULL; @@ -3397,7 +3397,7 @@ static int ocfs2_refcount_cow_hunk(struct inode *inode, BUG_ON(cow_len == 0); - context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS); + context = kzalloc_obj(struct ocfs2_cow_context, GFP_NOFS); if (!context) { ret = -ENOMEM; mlog_errno(ret); @@ -3606,7 +3606,7 @@ int ocfs2_refcount_cow_xattr(struct inode *inode, BUG_ON(cow_len == 0); - context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS); + context = kzalloc_obj(struct ocfs2_cow_context, GFP_NOFS); if (!context) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/slot_map.c b/fs/ocfs2/slot_map.c index ea4a68abc25b..3ea14f00e84a 100644 --- a/fs/ocfs2/slot_map.c +++ b/fs/ocfs2/slot_map.c @@ -385,8 +385,8 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb, trace_ocfs2_map_slot_buffers(bytes, si->si_blocks); - si->si_bh = kcalloc(si->si_blocks, sizeof(struct buffer_head *), - GFP_KERNEL); + si->si_bh = kzalloc_objs(struct buffer_head *, si->si_blocks, + GFP_KERNEL); if (!si->si_bh) { status = -ENOMEM; mlog_errno(status); @@ -425,7 +425,7 @@ int ocfs2_init_slot_info(struct ocfs2_super *osb) struct inode *inode = NULL; struct ocfs2_slot_info *si; - si = kzalloc(struct_size(si, si_slots, osb->max_slots), GFP_KERNEL); + si = kzalloc_flex(*si, si_slots, osb->max_slots, GFP_KERNEL); if (!si) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index f58e891aa2da..78a97c37398b 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -334,7 +334,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn) goto out; } - priv = kzalloc(sizeof(struct o2dlm_private), GFP_KERNEL); + priv = kzalloc_obj(struct o2dlm_private, GFP_KERNEL); if (!priv) { rc = -ENOMEM; goto out_free; diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index be0a5758bd40..11b34407de36 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -593,7 +593,7 @@ static int ocfs2_control_open(struct inode *inode, struct file *file) { struct ocfs2_control_private *p; - p = kzalloc(sizeof(struct ocfs2_control_private), GFP_KERNEL); + p = kzalloc_obj(struct ocfs2_control_private, GFP_KERNEL); if (!p) return -ENOMEM; p->op_this_node = -1; @@ -967,7 +967,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn) BUG_ON(conn == NULL); - lc = kzalloc(sizeof(struct ocfs2_live_connection), GFP_KERNEL); + lc = kzalloc_obj(struct ocfs2_live_connection, GFP_KERNEL); if (!lc) return -ENOMEM; diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index fca2fd07c881..46ff5835da2e 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -328,8 +328,7 @@ int ocfs2_cluster_connect(const char *stack_name, goto out; } - new_conn = kzalloc(sizeof(struct ocfs2_cluster_connection), - GFP_KERNEL); + new_conn = kzalloc_obj(struct ocfs2_cluster_connection, GFP_KERNEL); if (!new_conn) { rc = -ENOMEM; goto out; diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 79d1325b2111..872c7b303a3c 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -1034,7 +1034,7 @@ int ocfs2_reserve_new_metadata_blocks(struct ocfs2_super *osb, int status; int slot = ocfs2_get_meta_steal_slot(osb); - *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1105,7 +1105,7 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, int slot = ocfs2_get_inode_steal_slot(osb); u64 alloc_group; - *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1221,7 +1221,7 @@ static int ocfs2_reserve_clusters_with_limit(struct ocfs2_super *osb, int status, ret = 0; int retried = 0; - *ac = kzalloc(sizeof(struct ocfs2_alloc_context), GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -2245,7 +2245,7 @@ int ocfs2_find_new_inode_loc(struct inode *dir, BUG_ON(ac->ac_bits_wanted != 1); BUG_ON(ac->ac_which != OCFS2_AC_USE_INODE); - res = kzalloc(sizeof(*res), GFP_NOFS); + res = kzalloc_obj(*res, GFP_NOFS); if (res == NULL) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 3cbafac50cd1..9779f524ff1a 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1200,7 +1200,7 @@ static int ocfs2_init_fs_context(struct fs_context *fc) { struct mount_options *mopt; - mopt = kzalloc(sizeof(struct mount_options), GFP_KERNEL); + mopt = kzalloc_obj(struct mount_options, GFP_KERNEL); if (!mopt) return -EINVAL; @@ -1953,7 +1953,7 @@ static int ocfs2_initialize_super(struct super_block *sb, struct ocfs2_super *osb; u64 total_blocks; - osb = kzalloc(sizeof(struct ocfs2_super), GFP_KERNEL); + osb = kzalloc_obj(struct ocfs2_super, GFP_KERNEL); if (!osb) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index e434a62dd69f..42ee5db362d3 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -324,7 +324,7 @@ static struct ocfs2_xattr_bucket *ocfs2_xattr_bucket_new(struct inode *inode) BUG_ON(blks > OCFS2_XATTR_MAX_BLOCKS_PER_BUCKET); - bucket = kzalloc(sizeof(struct ocfs2_xattr_bucket), GFP_NOFS); + bucket = kzalloc_obj(struct ocfs2_xattr_bucket, GFP_NOFS); if (bucket) { bucket->bu_inode = inode; bucket->bu_blocks = blks; diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 701ed85d9831..ba2a581f7ab7 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -464,7 +464,7 @@ static int omfs_fill_super(struct super_block *sb, struct fs_context *fc) int ret = -EINVAL; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc(sizeof(struct omfs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct omfs_sb_info, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -612,7 +612,7 @@ static int omfs_init_fs_context(struct fs_context *fc) { struct omfs_mount_options *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index 3c32bf9f1296..84db9f0db9df 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -363,8 +363,7 @@ static int orangefs_dir_iterate(struct file *file, static int orangefs_dir_open(struct inode *inode, struct file *file) { struct orangefs_dir *od; - file->private_data = kmalloc(sizeof(struct orangefs_dir), - GFP_KERNEL); + file->private_data = kmalloc_obj(struct orangefs_dir, GFP_KERNEL); if (!file->private_data) return -ENOMEM; od = file->private_data; diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index f420f48fc069..50836be41cd2 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -184,16 +184,16 @@ static int orangefs_writepages(struct address_space *mapping, int error; struct folio *folio = NULL; - ow = kzalloc(sizeof(struct orangefs_writepages), GFP_KERNEL); + ow = kzalloc_obj(struct orangefs_writepages, GFP_KERNEL); if (!ow) return -ENOMEM; ow->maxpages = orangefs_bufmap_size_query()/PAGE_SIZE; - ow->folios = kcalloc(ow->maxpages, sizeof(struct folio *), GFP_KERNEL); + ow->folios = kzalloc_objs(struct folio *, ow->maxpages, GFP_KERNEL); if (!ow->folios) { kfree(ow); return -ENOMEM; } - ow->bv = kcalloc(ow->maxpages, sizeof(struct bio_vec), GFP_KERNEL); + ow->bv = kzalloc_objs(struct bio_vec, ow->maxpages, GFP_KERNEL); if (!ow->bv) { kfree(ow->folios); kfree(ow); @@ -328,7 +328,7 @@ static int orangefs_write_begin(const struct kiocb *iocb, } } - wr = kmalloc(sizeof *wr, GFP_KERNEL); + wr = kmalloc_obj(*wr, GFP_KERNEL); if (!wr) return -ENOMEM; @@ -644,7 +644,7 @@ vm_fault_t orangefs_page_mkwrite(struct vm_fault *vmf) } } } - wr = kmalloc(sizeof *wr, GFP_KERNEL); + wr = kmalloc_obj(*wr, GFP_KERNEL); if (!wr) { ret = VM_FAULT_LOCKED|VM_FAULT_RETRY; goto out; diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index b562d3dbc76b..bad105dd10fa 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -205,7 +205,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) { struct orangefs_bufmap *bufmap; - bufmap = kzalloc(sizeof(*bufmap), GFP_KERNEL); + bufmap = kzalloc_obj(*bufmap, GFP_KERNEL); if (!bufmap) goto out; @@ -219,8 +219,8 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) goto out_free_bufmap; bufmap->desc_array = - kcalloc(bufmap->desc_count, sizeof(struct orangefs_bufmap_desc), - GFP_KERNEL); + kzalloc_objs(struct orangefs_bufmap_desc, bufmap->desc_count, + GFP_KERNEL); if (!bufmap->desc_array) goto out_free_index_array; @@ -228,7 +228,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) /* allocate storage to track our page mappings */ bufmap->page_array = - kcalloc(bufmap->page_count, sizeof(struct page *), GFP_KERNEL); + kzalloc_objs(struct page *, bufmap->page_count, GFP_KERNEL); if (!bufmap->page_array) goto out_free_desc_array; diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index 002092950605..229981c310bd 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -560,7 +560,7 @@ static int orangefs_prepare_cdm_array(char *debug_array_string) goto out; } - cdm_array = kcalloc(cdm_element_count, sizeof(*cdm_array), GFP_KERNEL); + cdm_array = kzalloc_objs(*cdm_array, cdm_element_count, GFP_KERNEL); if (!cdm_array) { rc = -ENOMEM; goto out; diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c index 7ac16a4d2dc6..30bc3c17daa4 100644 --- a/fs/orangefs/orangefs-mod.c +++ b/fs/orangefs/orangefs-mod.c @@ -99,7 +99,7 @@ static int __init orangefs_init(void) goto cleanup_op; orangefs_htable_ops_in_progress = - kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL); + kzalloc_objs(struct list_head, hash_table_size, GFP_KERNEL); if (!orangefs_htable_ops_in_progress) { ret = -ENOMEM; goto cleanup_inode; diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c index 369455b354ef..8ea25b71b1fb 100644 --- a/fs/orangefs/orangefs-sysfs.c +++ b/fs/orangefs/orangefs-sysfs.c @@ -1170,7 +1170,7 @@ int orangefs_sysfs_init(void) gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_init: start\n"); /* create /sys/fs/orangefs. */ - orangefs_obj = kzalloc(sizeof(*orangefs_obj), GFP_KERNEL); + orangefs_obj = kzalloc_obj(*orangefs_obj, GFP_KERNEL); if (!orangefs_obj) goto out; @@ -1185,7 +1185,7 @@ int orangefs_sysfs_init(void) kobject_uevent(orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/acache. */ - acache_orangefs_obj = kzalloc(sizeof(*acache_orangefs_obj), GFP_KERNEL); + acache_orangefs_obj = kzalloc_obj(*acache_orangefs_obj, GFP_KERNEL); if (!acache_orangefs_obj) { rc = -EINVAL; goto ofs_obj_bail; @@ -1202,8 +1202,7 @@ int orangefs_sysfs_init(void) kobject_uevent(acache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/capcache. */ - capcache_orangefs_obj = - kzalloc(sizeof(*capcache_orangefs_obj), GFP_KERNEL); + capcache_orangefs_obj = kzalloc_obj(*capcache_orangefs_obj, GFP_KERNEL); if (!capcache_orangefs_obj) { rc = -EINVAL; goto acache_obj_bail; @@ -1219,8 +1218,7 @@ int orangefs_sysfs_init(void) kobject_uevent(capcache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ccache. */ - ccache_orangefs_obj = - kzalloc(sizeof(*ccache_orangefs_obj), GFP_KERNEL); + ccache_orangefs_obj = kzalloc_obj(*ccache_orangefs_obj, GFP_KERNEL); if (!ccache_orangefs_obj) { rc = -EINVAL; goto capcache_obj_bail; @@ -1236,7 +1234,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ccache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ncache. */ - ncache_orangefs_obj = kzalloc(sizeof(*ncache_orangefs_obj), GFP_KERNEL); + ncache_orangefs_obj = kzalloc_obj(*ncache_orangefs_obj, GFP_KERNEL); if (!ncache_orangefs_obj) { rc = -EINVAL; goto ccache_obj_bail; @@ -1253,7 +1251,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ncache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/perf_counters. */ - pc_orangefs_obj = kzalloc(sizeof(*pc_orangefs_obj), GFP_KERNEL); + pc_orangefs_obj = kzalloc_obj(*pc_orangefs_obj, GFP_KERNEL); if (!pc_orangefs_obj) { rc = -EINVAL; goto ncache_obj_bail; @@ -1270,7 +1268,7 @@ int orangefs_sysfs_init(void) kobject_uevent(pc_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/stats. */ - stats_orangefs_obj = kzalloc(sizeof(*stats_orangefs_obj), GFP_KERNEL); + stats_orangefs_obj = kzalloc_obj(*stats_orangefs_obj, GFP_KERNEL); if (!stats_orangefs_obj) { rc = -EINVAL; goto pc_obj_bail; diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index b46100a4f529..3030509ddeaf 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -578,7 +578,7 @@ int orangefs_init_fs_context(struct fs_context *fc) { struct orangefs_sb_info_s *osi; - osi = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL); + osi = kzalloc_obj(struct orangefs_sb_info_s, GFP_KERNEL); if (!osi) return -ENOMEM; diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index a431aa07a229..44712bcdcef7 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -171,7 +171,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, " does not exist!\n", get_khandle_from_ino(inode), (char *)new_op->upcall.req.getxattr.key); - cx = kmalloc(sizeof *cx, GFP_KERNEL); + cx = kmalloc_obj(*cx, GFP_KERNEL); if (cx) { strscpy(cx->key, name); cx->length = -1; @@ -225,7 +225,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, cx->length = length; cx->timeout = jiffies + HZ; } else { - cx = kmalloc(sizeof *cx, GFP_KERNEL); + cx = kmalloc_obj(*cx, GFP_KERNEL); if (cx) { strscpy(cx->key, name); memcpy(cx->val, buffer, length); diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 8269431ba3c6..7f7a2c2a7937 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -96,7 +96,7 @@ struct ovl_file { struct ovl_file *ovl_file_alloc(struct file *realfile) { - struct ovl_file *of = kzalloc(sizeof(struct ovl_file), GFP_KERNEL); + struct ovl_file *of = kzalloc_obj(struct ovl_file, GFP_KERNEL); if (unlikely(!of)) return NULL; diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index afb7019fd43a..f30b81ee0d9b 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -481,7 +481,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, goto invalid; if (!*stackp) - *stackp = kmalloc(sizeof(struct ovl_path), GFP_KERNEL); + *stackp = kmalloc_obj(struct ovl_path, GFP_KERNEL); if (!*stackp) { dput(origin); return -ENOMEM; diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c index 63b7346c5ee1..af735a0c310a 100644 --- a/fs/overlayfs/params.c +++ b/fs/overlayfs/params.c @@ -777,7 +777,7 @@ int ovl_init_fs_context(struct fs_context *fc) struct ovl_fs_context *ctx; struct ovl_fs *ofs; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT); + ctx = kzalloc_obj(*ctx, GFP_KERNEL_ACCOUNT); if (!ctx) return -ENOMEM; @@ -785,12 +785,12 @@ int ovl_init_fs_context(struct fs_context *fc) * By default we allocate for three lower layers. It's likely * that it'll cover most users. */ - ctx->lower = kmalloc_array(3, sizeof(*ctx->lower), GFP_KERNEL_ACCOUNT); + ctx->lower = kmalloc_objs(*ctx->lower, 3, GFP_KERNEL_ACCOUNT); if (!ctx->lower) goto out_err; ctx->capacity = 3; - ofs = kzalloc(sizeof(struct ovl_fs), GFP_KERNEL); + ofs = kzalloc_obj(struct ovl_fs, GFP_KERNEL); if (!ofs) goto out_err; diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index bb09142b4e15..953c2cdca1b4 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -180,7 +180,7 @@ static struct ovl_cache_entry *ovl_cache_entry_new(struct ovl_readdir_data *rdd, { struct ovl_cache_entry *p; - p = kmalloc(struct_size(p, name, len + 1), GFP_KERNEL); + p = kmalloc_flex(*p, name, len + 1, GFP_KERNEL); if (!p) return NULL; @@ -493,7 +493,7 @@ static struct ovl_dir_cache *ovl_cache_get(struct dentry *dentry) } ovl_set_dir_cache(d_inode(dentry), NULL); - cache = kzalloc(sizeof(struct ovl_dir_cache), GFP_KERNEL); + cache = kzalloc_obj(struct ovl_dir_cache, GFP_KERNEL); if (!cache) return ERR_PTR(-ENOMEM); @@ -706,7 +706,7 @@ static struct ovl_dir_cache *ovl_cache_get_impure(const struct path *path) ovl_dir_cache_free(inode); ovl_set_dir_cache(inode, NULL); - cache = kzalloc(sizeof(struct ovl_dir_cache), GFP_KERNEL); + cache = kzalloc_obj(struct ovl_dir_cache, GFP_KERNEL); if (!cache) return ERR_PTR(-ENOMEM); diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index c9f166a1390a..f3a39b7703f5 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1031,7 +1031,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, unsigned int i; size_t nr_merged_lower; - ofs->fs = kcalloc(ctx->nr + 2, sizeof(struct ovl_sb), GFP_KERNEL); + ofs->fs = kzalloc_objs(struct ovl_sb, ctx->nr + 2, GFP_KERNEL); if (ofs->fs == NULL) return -ENOMEM; @@ -1393,7 +1393,7 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb) } err = -ENOMEM; - layers = kcalloc(ctx->nr + 1, sizeof(struct ovl_layer), GFP_KERNEL); + layers = kzalloc_objs(struct ovl_layer, ctx->nr + 1, GFP_KERNEL); if (!layers) return err; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 94986d11a166..a28524e83662 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -113,7 +113,7 @@ bool ovl_verify_lower(struct super_block *sb) struct ovl_path *ovl_stack_alloc(unsigned int n) { - return kcalloc(n, sizeof(struct ovl_path), GFP_KERNEL); + return kzalloc_objs(struct ovl_path, n, GFP_KERNEL); } void ovl_stack_cpy(struct ovl_path *dst, struct ovl_path *src, unsigned int n) @@ -143,7 +143,7 @@ struct ovl_entry *ovl_alloc_entry(unsigned int numlower) { struct ovl_entry *oe; - oe = kzalloc(struct_size(oe, __lowerstack, numlower), GFP_KERNEL); + oe = kzalloc_flex(*oe, __lowerstack, numlower, GFP_KERNEL); if (oe) oe->__numlower = numlower; diff --git a/fs/pipe.c b/fs/pipe.c index 22647f50b286..b44a756c0b41 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -797,7 +797,7 @@ struct pipe_inode_info *alloc_pipe_info(void) unsigned long user_bufs; unsigned int max_size = READ_ONCE(pipe_max_size); - pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL_ACCOUNT); + pipe = kzalloc_obj(struct pipe_inode_info, GFP_KERNEL_ACCOUNT); if (pipe == NULL) goto out_free_uid; @@ -814,8 +814,8 @@ struct pipe_inode_info *alloc_pipe_info(void) if (too_many_pipe_buffers_hard(user_bufs) && pipe_is_unprivileged_user()) goto out_revert_acct; - pipe->bufs = kcalloc(pipe_bufs, sizeof(struct pipe_buffer), - GFP_KERNEL_ACCOUNT); + pipe->bufs = kzalloc_objs(struct pipe_buffer, pipe_bufs, + GFP_KERNEL_ACCOUNT); if (pipe->bufs) { init_waitqueue_head(&pipe->rd_wait); @@ -1297,8 +1297,7 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) if (unlikely(nr_slots > (pipe_index_t)-1u)) return -EINVAL; - bufs = kcalloc(nr_slots, sizeof(*bufs), - GFP_KERNEL_ACCOUNT | __GFP_NOWARN); + bufs = kzalloc_objs(*bufs, nr_slots, GFP_KERNEL_ACCOUNT | __GFP_NOWARN); if (unlikely(!bufs)) return -ENOMEM; diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 4ef6f9d2b8d6..12591c95c925 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -204,7 +204,7 @@ posix_acl_alloc(unsigned int count, gfp_t flags) { struct posix_acl *acl; - acl = kmalloc(struct_size(acl, a_entries, count), flags); + acl = kmalloc_flex(*acl, a_entries, count, flags); if (acl) posix_acl_init(acl, count); return acl; diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 728630b10fdf..55438bc0afc8 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -143,7 +143,7 @@ static int kcore_ram_list(struct list_head *head) { struct kcore_list *ent; - ent = kmalloc(sizeof(*ent), GFP_KERNEL); + ent = kmalloc_obj(*ent, GFP_KERNEL); if (!ent) return -ENOMEM; ent->addr = (unsigned long)__va(0); @@ -178,7 +178,7 @@ get_sparsemem_vmemmap_info(struct kcore_list *ent, struct list_head *head) end = tmp->addr; } if (start < end) { - vmm = kmalloc(sizeof(*vmm), GFP_KERNEL); + vmm = kmalloc_obj(*vmm, GFP_KERNEL); if (!vmm) return 0; vmm->addr = start; @@ -210,7 +210,7 @@ kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg) p = pfn_to_page(pfn); - ent = kmalloc(sizeof(*ent), GFP_KERNEL); + ent = kmalloc_obj(*ent, GFP_KERNEL); if (!ent) return -ENOMEM; ent->addr = (unsigned long)page_to_virt(p); diff --git a/fs/proc/root.c b/fs/proc/root.c index d8ca41d823e4..fb0ccacb08e6 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -249,7 +249,7 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc) struct proc_fs_info *fs_info; int ret; - fs_info = kzalloc(sizeof(*fs_info), GFP_KERNEL); + fs_info = kzalloc_obj(*fs_info, GFP_KERNEL); if (!fs_info) return -ENOMEM; @@ -331,7 +331,7 @@ static int proc_init_fs_context(struct fs_context *fc) { struct proc_fs_context *ctx; - ctx = kzalloc(sizeof(struct proc_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct proc_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index d7d52e259055..0418511f69fe 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1534,7 +1534,7 @@ static int smaps_rollup_open(struct inode *inode, struct file *file) int ret; struct proc_maps_private *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL_ACCOUNT); + priv = kzalloc_obj(*priv, GFP_KERNEL_ACCOUNT); if (!priv) return -ENOMEM; @@ -2981,8 +2981,7 @@ static int pagemap_scan_init_bounce_buffer(struct pagemap_scan_private *p) p->vec_buf_len = min_t(size_t, PAGEMAP_WALK_SIZE >> PAGE_SHIFT, p->arg.vec_len); - p->vec_buf = kmalloc_array(p->vec_buf_len, sizeof(*p->vec_buf), - GFP_KERNEL); + p->vec_buf = kmalloc_objs(*p->vec_buf, p->vec_buf_len, GFP_KERNEL); if (!p->vec_buf) return -ENOMEM; diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index fa6b8cb788a1..0c9c8b6fdbb8 100644 --- a/fs/pstore/blk.c +++ b/fs/pstore/blk.c @@ -297,7 +297,7 @@ static int __init __best_effort_init(void) return -EINVAL; } - best_effort_dev = kzalloc(sizeof(*best_effort_dev), GFP_KERNEL); + best_effort_dev = kzalloc_obj(*best_effort_dev, GFP_KERNEL); if (!best_effort_dev) return -ENOMEM; diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 71deffcc3356..8ebcd231e09a 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -70,7 +70,7 @@ static void *pstore_ftrace_seq_start(struct seq_file *s, loff_t *pos) struct pstore_private *ps = s->private; struct pstore_ftrace_seq_data *data __free(kfree) = NULL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; @@ -365,7 +365,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) record->psi->name, record->id, record->compressed ? ".enc.z" : ""); - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (!private) return -ENOMEM; @@ -477,7 +477,7 @@ static int pstore_init_fs_context(struct fs_context *fc) { struct pstore_context *ctx; - ctx = kzalloc(sizeof(struct pstore_context), GFP_KERNEL); + ctx = kzalloc_obj(struct pstore_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index f8b9c9c73997..ff9603bb89db 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -683,7 +683,7 @@ void pstore_get_backend_records(struct pstore_info *psi, struct pstore_record *record; int rc; - record = kzalloc(sizeof(*record), GFP_KERNEL); + record = kzalloc_obj(*record, GFP_KERNEL); if (!record) { pr_err("out of memory creating record\n"); break; diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 39936d6da0dd..79f801c913bf 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -232,8 +232,8 @@ static ssize_t ramoops_pstore_read(struct pstore_record *record) */ struct persistent_ram_zone *tmp_prz, *prz_next; - tmp_prz = kzalloc(sizeof(struct persistent_ram_zone), - GFP_KERNEL); + tmp_prz = kzalloc_obj(struct persistent_ram_zone, + GFP_KERNEL); if (!tmp_prz) return -ENOMEM; prz = tmp_prz; @@ -539,7 +539,7 @@ static int ramoops_init_przs(const char *name, goto fail; } - prz_ar = kcalloc(*cnt, sizeof(**przs), GFP_KERNEL); + prz_ar = kzalloc_objs(**przs, *cnt, GFP_KERNEL); if (!prz_ar) goto fail; diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 7b6d6378a3b8..49d022b85d8a 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -229,9 +229,8 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz, } /* allocate workspace instead of using stack VLA */ - prz->ecc_info.par = kmalloc_array(prz->ecc_info.ecc_size, - sizeof(*prz->ecc_info.par), - GFP_KERNEL); + prz->ecc_info.par = kmalloc_objs(*prz->ecc_info.par, + prz->ecc_info.ecc_size, GFP_KERNEL); if (!prz->ecc_info.par) { pr_err("cannot allocate ECC parity workspace\n"); return -ENOMEM; @@ -439,7 +438,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size, return NULL; } - pages = kmalloc_array(page_count, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, page_count, GFP_KERNEL); if (!pages) { pr_err("%s: Failed to allocate array for %u pages\n", __func__, page_count); @@ -606,7 +605,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, struct persistent_ram_zone *prz; int ret = -ENOMEM; - prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL); + prz = kzalloc_obj(struct persistent_ram_zone, GFP_KERNEL); if (!prz) { pr_err("failed to allocate persistent ram zone\n"); goto err; diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index eb61ba5bb964..6687d255a36b 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -1166,7 +1166,7 @@ static struct pstore_zone *psz_init_zone(enum pstore_type_id type, return ERR_PTR(-ENOMEM); } - zone = kzalloc(sizeof(struct pstore_zone), GFP_KERNEL); + zone = kzalloc_obj(struct pstore_zone, GFP_KERNEL); if (!zone) return ERR_PTR(-ENOMEM); @@ -1218,7 +1218,7 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type, return ERR_PTR(-EINVAL); } - zones = kcalloc(c, sizeof(*zones), GFP_KERNEL); + zones = kzalloc_objs(*zones, c, GFP_KERNEL); if (!zones) { pr_err("allocate for zones %s failed\n", name); return ERR_PTR(-ENOMEM); diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 31d78da203ea..e8c4de5de7be 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -197,7 +197,7 @@ static int qnx4_fill_super(struct super_block *s, struct fs_context *fc) struct qnx4_sb_info *qs; int silent = fc->sb_flags & SB_SILENT; - qs = kzalloc(sizeof(struct qnx4_sb_info), GFP_KERNEL); + qs = kzalloc_obj(struct qnx4_sb_info, GFP_KERNEL); if (!qs) return -ENOMEM; s->s_fs_info = qs; diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 88d285005083..de1e1a61810d 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -302,7 +302,7 @@ static int qnx6_fill_super(struct super_block *s, struct fs_context *fc) int bootblock_offset = QNX6_BOOTBLOCK_SIZE; int silent = fc->sb_flags & SB_SILENT; - qs = kzalloc(sizeof(struct qnx6_sb_info), GFP_KERNEL); + qs = kzalloc_obj(struct qnx6_sb_info, GFP_KERNEL); if (!qs) return -ENOMEM; s->s_fs_info = qs; @@ -645,7 +645,7 @@ static int qnx6_init_fs_context(struct fs_context *fc) { struct qnx6_context *ctx; - ctx = kzalloc(sizeof(struct qnx6_context), GFP_KERNEL); + ctx = kzalloc_obj(struct qnx6_context, GFP_KERNEL); if (!ctx) return -ENOMEM; fc->ops = &qnx6_context_ops; diff --git a/fs/qnx6/super_mmi.c b/fs/qnx6/super_mmi.c index d282c2c73404..d36ade7fc477 100644 --- a/fs/qnx6/super_mmi.c +++ b/fs/qnx6/super_mmi.c @@ -100,7 +100,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) goto out; } - qsb = kmalloc(sizeof(*qsb), GFP_KERNEL); + qsb = kmalloc_obj(*qsb, GFP_KERNEL); if (!qsb) { pr_err("unable to allocate memory.\n"); goto out; diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 1fda93dcbc1b..d022b18782c6 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -121,7 +121,7 @@ static int v2_read_file_info(struct super_block *sb, int type) ret = -EIO; goto out; } - info->dqi_priv = kmalloc(sizeof(struct qtree_mem_dqinfo), GFP_KERNEL); + info->dqi_priv = kmalloc_obj(struct qtree_mem_dqinfo, GFP_KERNEL); if (!info->dqi_priv) { ret = -ENOMEM; goto out; diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 505d10a0cb36..d084b6804b65 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -298,7 +298,7 @@ int ramfs_init_fs_context(struct fs_context *fc) { struct ramfs_fs_info *fsi; - fsi = kzalloc(sizeof(*fsi), GFP_KERNEL); + fsi = kzalloc_obj(*fsi, GFP_KERNEL); if (!fsi) return -ENOMEM; diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 0cd5476a483a..6fd5c0e8a0dd 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -923,7 +923,7 @@ int setup_rmid_lru_list(void) return 0; idx_limit = resctrl_arch_system_num_rmid_idx(); - rmid_ptrs = kcalloc(idx_limit, sizeof(struct rmid_entry), GFP_KERNEL); + rmid_ptrs = kzalloc_objs(struct rmid_entry, idx_limit, GFP_KERNEL); if (!rmid_ptrs) return -ENOMEM; diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c index e81d71abfe54..55e71d257324 100644 --- a/fs/resctrl/pseudo_lock.c +++ b/fs/resctrl/pseudo_lock.c @@ -154,7 +154,7 @@ static int pseudo_lock_cstates_constrain(struct pseudo_lock_region *plr) int ret; for_each_cpu(cpu, &plr->d->hdr.cpu_mask) { - pm_req = kzalloc(sizeof(*pm_req), GFP_KERNEL); + pm_req = kzalloc_obj(*pm_req, GFP_KERNEL); if (!pm_req) { rdt_last_cmd_puts("Failure to allocate memory for PM QoS\n"); ret = -ENOMEM; @@ -270,7 +270,7 @@ static int pseudo_lock_init(struct rdtgroup *rdtgrp) { struct pseudo_lock_region *plr; - plr = kzalloc(sizeof(*plr), GFP_KERNEL); + plr = kzalloc_obj(*plr, GFP_KERNEL); if (!plr) return -ENOMEM; diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index ba8d503551cd..1135208adafb 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2686,7 +2686,7 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type const char *suffix = ""; int ret, cl; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2966,7 +2966,7 @@ static int rdt_init_fs_context(struct fs_context *fc) { struct rdt_fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -3117,7 +3117,7 @@ static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid, return priv; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; @@ -3753,7 +3753,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, } /* allocate the rdtgroup. */ - rdtgrp = kzalloc(sizeof(*rdtgrp), GFP_KERNEL); + rdtgrp = kzalloc_obj(*rdtgrp, GFP_KERNEL); if (!rdtgrp) { ret = -ENOSPC; rdt_last_cmd_puts("Kernel out of memory\n"); diff --git a/fs/select.c b/fs/select.c index 78a1508c84d3..57b0af64cc1e 100644 --- a/fs/select.c +++ b/fs/select.c @@ -993,8 +993,8 @@ static int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, todo -= walk->len; len = min(todo, POLLFD_PER_PAGE); - walk = walk->next = kmalloc(struct_size(walk, entries, len), - GFP_KERNEL); + walk = walk->next = kmalloc_flex(*walk, entries, len, + GFP_KERNEL); if (!walk) { err = -ENOMEM; goto out_fds; diff --git a/fs/seq_file.c b/fs/seq_file.c index 8894cbde8d3a..4745db2a34d1 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -573,7 +573,7 @@ static void single_stop(struct seq_file *p, void *v) int single_open(struct file *file, int (*show)(struct seq_file *, void *), void *data) { - struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL_ACCOUNT); + struct seq_operations *op = kmalloc_obj(*op, GFP_KERNEL_ACCOUNT); int res = -ENOMEM; if (op) { diff --git a/fs/signalfd.c b/fs/signalfd.c index d69eab584bc6..0b663f9c1cff 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -264,7 +264,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags) int fd; struct signalfd_ctx *ctx __free(kfree) = NULL; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index 2a6b8ce80be2..94574dab56f6 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -556,7 +556,7 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb) continue; spin_lock(&cfids->cfid_list_lock); list_for_each_entry(cfid, &cfids->entries, entry) { - tmp_list = kmalloc(sizeof(*tmp_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(*tmp_list, GFP_ATOMIC); if (tmp_list == NULL) { /* * If the malloc() fails, we won't drop all @@ -698,7 +698,7 @@ static struct cached_fid *init_cached_dir(const char *path) { struct cached_fid *cfid; - cfid = kzalloc(sizeof(*cfid), GFP_ATOMIC); + cfid = kzalloc_obj(*cfid, GFP_ATOMIC); if (!cfid) return NULL; cfid->path = kstrdup(path, GFP_ATOMIC); @@ -813,7 +813,7 @@ struct cached_fids *init_cached_dirs(void) { struct cached_fids *cfids; - cfids = kzalloc(sizeof(*cfids), GFP_KERNEL); + cfids = kzalloc_obj(*cfids, GFP_KERNEL); if (!cfids) return NULL; spin_lock_init(&cfids->cfid_list_lock); diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c index 68a1f87c446d..9753a432d099 100644 --- a/fs/smb/client/cifs_swn.c +++ b/fs/smb/client/cifs_swn.c @@ -315,7 +315,7 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon) goto unlock; } - reg = kmalloc(sizeof(struct cifs_swn_reg), GFP_ATOMIC); + reg = kmalloc_obj(struct cifs_swn_reg, GFP_ATOMIC); if (reg == NULL) { ret = -ENOMEM; goto fail_unlock; diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c index f03eda46f452..85ffb8cfe320 100644 --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -805,8 +805,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl, offsetof(struct smb_sid, sub_auth) + sizeof(__le16))) return; - ppace = kmalloc_array(num_aces, sizeof(struct smb_ace *), - GFP_KERNEL); + ppace = kmalloc_objs(struct smb_ace *, num_aces, GFP_KERNEL); if (!ppace) return; @@ -1332,8 +1331,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd, if (uid_valid(uid)) { /* chown */ uid_t id; - nowner_sid_ptr = kzalloc(sizeof(struct smb_sid), - GFP_KERNEL); + nowner_sid_ptr = kzalloc_obj(struct smb_sid, GFP_KERNEL); if (!nowner_sid_ptr) { rc = -ENOMEM; goto chown_chgrp_exit; @@ -1361,8 +1359,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd, } if (gid_valid(gid)) { /* chgrp */ gid_t id; - ngroup_sid_ptr = kzalloc(sizeof(struct smb_sid), - GFP_KERNEL); + ngroup_sid_ptr = kzalloc_obj(struct smb_sid, GFP_KERNEL); if (!ngroup_sid_ptr) { rc = -ENOMEM; goto chown_chgrp_exit; diff --git a/fs/smb/client/cifsencrypt.c b/fs/smb/client/cifsencrypt.c index 50b7ec39053c..b717b348e98e 100644 --- a/fs/smb/client/cifsencrypt.c +++ b/fs/smb/client/cifsencrypt.c @@ -500,7 +500,7 @@ calc_seckey(struct cifs_ses *ses) get_random_bytes(sec_key, CIFS_SESS_KEY_SIZE); - ctx_arc4 = kmalloc(sizeof(*ctx_arc4), GFP_KERNEL); + ctx_arc4 = kmalloc_obj(*ctx_arc4, GFP_KERNEL); if (!ctx_arc4) { cifs_dbg(VFS, "Could not allocate arc4 context\n"); return -ENOMEM; diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index afda1d7c1ee1..85a53cd77f9e 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1016,11 +1016,11 @@ cifs_smb3_do_mount(struct file_system_type *fs_type, } else { cifs_info("Attempting to mount %s\n", old_ctx->source); } - cifs_sb = kzalloc(sizeof(*cifs_sb), GFP_KERNEL); + cifs_sb = kzalloc_obj(*cifs_sb, GFP_KERNEL); if (!cifs_sb) return ERR_PTR(-ENOMEM); - cifs_sb->ctx = kzalloc(sizeof(struct smb3_fs_context), GFP_KERNEL); + cifs_sb->ctx = kzalloc_obj(struct smb3_fs_context, GFP_KERNEL); if (!cifs_sb->ctx) { root = ERR_PTR(-ENOMEM); goto out; diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c index e0c44b46080e..ae536aa63ef1 100644 --- a/fs/smb/client/compress.c +++ b/fs/smb/client/compress.c @@ -229,7 +229,7 @@ static bool is_compressible(const struct iov_iter *data) if (has_repeated_data(sample, len)) goto out; - bkt = kcalloc(bkt_size, sizeof(*bkt), GFP_KERNEL); + bkt = kzalloc_objs(*bkt, bkt_size, GFP_KERNEL); if (!bkt) { WARN_ON_ONCE(1); ret = false; diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 1b479561cbf9..c7ed2ffb66ee 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -1755,7 +1755,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx, if (tcp_ses) return tcp_ses; - tcp_ses = kzalloc(sizeof(struct TCP_Server_Info), GFP_KERNEL); + tcp_ses = kzalloc_obj(struct TCP_Server_Info, GFP_KERNEL); if (!tcp_ses) { rc = -ENOMEM; goto out_err; @@ -3674,7 +3674,7 @@ static int mount_setup_tlink(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, struct tcon_link *tlink; /* hang the tcon off of the superblock */ - tlink = kzalloc(sizeof(*tlink), GFP_KERNEL); + tlink = kzalloc_obj(*tlink, GFP_KERNEL); if (tlink == NULL) return -ENOMEM; @@ -3798,7 +3798,7 @@ mchan_mount_alloc(struct cifs_ses *ses) { struct mchan_mount *mchan_mount; - mchan_mount = kzalloc(sizeof(*mchan_mount), GFP_KERNEL); + mchan_mount = kzalloc_obj(*mchan_mount, GFP_KERNEL); if (!mchan_mount) return ERR_PTR(-ENOMEM); @@ -4193,7 +4193,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) struct smb3_fs_context *ctx; char *origin_fullpath = NULL; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (ctx == NULL) return ERR_PTR(-ENOMEM); @@ -4367,7 +4367,7 @@ cifs_sb_tlink(struct cifs_sb_info *cifs_sb) spin_unlock(&cifs_sb->tlink_tree_lock); if (tlink == NULL) { - newtlink = kzalloc(sizeof(*tlink), GFP_KERNEL); + newtlink = kzalloc_obj(*tlink, GFP_KERNEL); if (newtlink == NULL) return ERR_PTR(-ENOMEM); newtlink->tl_uid = fsuid; diff --git a/fs/smb/client/dfs.h b/fs/smb/client/dfs.h index 6b5b5ca0f55c..0401c55517b8 100644 --- a/fs/smb/client/dfs.h +++ b/fs/smb/client/dfs.h @@ -46,7 +46,7 @@ static inline struct dfs_ref_walk *ref_walk_alloc(void) { struct dfs_ref_walk *rw; - rw = kmalloc(sizeof(*rw), GFP_KERNEL); + rw = kmalloc_obj(*rw, GFP_KERNEL); if (!rw) return ERR_PTR(-ENOMEM); return rw; diff --git a/fs/smb/client/dfs_cache.c b/fs/smb/client/dfs_cache.c index f2ad0ccd08a7..983132735d72 100644 --- a/fs/smb/client/dfs_cache.c +++ b/fs/smb/client/dfs_cache.c @@ -363,7 +363,7 @@ static struct cache_dfs_tgt *alloc_target(const char *name, int path_consumed) { struct cache_dfs_tgt *t; - t = kmalloc(sizeof(*t), GFP_ATOMIC); + t = kmalloc_obj(*t, GFP_ATOMIC); if (!t) return ERR_PTR(-ENOMEM); t->name = kstrdup(name, GFP_ATOMIC); @@ -796,7 +796,7 @@ static int get_targets(struct cache_entry *ce, struct dfs_cache_tgt_list *tl) INIT_LIST_HEAD(head); list_for_each_entry(t, &ce->tlist, list) { - it = kzalloc(sizeof(*it), GFP_ATOMIC); + it = kzalloc_obj(*it, GFP_ATOMIC); if (!it) { rc = -ENOMEM; goto err_free_it; diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 88273f82812b..43b5b48f5a67 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -489,7 +489,7 @@ int cifs_posix_open(const char *full_path, struct inode **pinode, cifs_dbg(FYI, "posix open %s\n", full_path); - presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); + presp_data = kzalloc_obj(FILE_UNIX_BASIC_INFO, GFP_KERNEL); if (presp_data == NULL) return -ENOMEM; @@ -673,11 +673,11 @@ struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file, struct cifs_tcon *tcon = tlink_tcon(tlink); struct TCP_Server_Info *server = tcon->ses->server; - cfile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); + cfile = kzalloc_obj(struct cifsFileInfo, GFP_KERNEL); if (cfile == NULL) return cfile; - fdlocks = kzalloc(sizeof(struct cifs_fid_locks), GFP_KERNEL); + fdlocks = kzalloc_obj(struct cifs_fid_locks, GFP_KERNEL); if (!fdlocks) { kfree(cfile); return NULL; @@ -1458,7 +1458,7 @@ int cifs_close(struct inode *inode, struct file *file) if (file->private_data != NULL) { cfile = file->private_data; file->private_data = NULL; - dclose = kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL); + dclose = kmalloc_obj(struct cifs_deferred_close, GFP_KERNEL); if ((cfile->status_file_deleted == false) && (smb2_can_defer_close(inode, dclose))) { if (test_and_clear_bit(NETFS_ICTX_MODIFIED_ATTR, &cinode->netfs.flags)) { @@ -1582,7 +1582,7 @@ static struct cifsLockInfo * cifs_lock_init(__u64 offset, __u64 length, __u8 type, __u16 flags) { struct cifsLockInfo *lock = - kmalloc(sizeof(struct cifsLockInfo), GFP_KERNEL); + kmalloc_obj(struct cifsLockInfo, GFP_KERNEL); if (!lock) return lock; lock->offset = offset; @@ -1853,7 +1853,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) PAGE_SIZE); max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); + buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num, GFP_KERNEL); if (!buf) { free_xid(xid); return -ENOMEM; @@ -1945,7 +1945,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) * protects locking operations of this inode. */ for (i = 0; i < count; i++) { - lck = kmalloc(sizeof(struct lock_to_push), GFP_KERNEL); + lck = kmalloc_obj(struct lock_to_push, GFP_KERNEL); if (!lck) { rc = -ENOMEM; goto err_out; @@ -2229,7 +2229,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, PAGE_SIZE); max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); + buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num, GFP_KERNEL); if (!buf) return -ENOMEM; diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 412c5b534791..4810f926dccb 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1924,7 +1924,7 @@ int smb3_init_fs_context(struct fs_context *fc) char *nodename = utsname()->nodename; int i; - ctx = kzalloc(sizeof(struct smb3_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct smb3_fs_context, GFP_KERNEL); if (unlikely(!ctx)) return -ENOMEM; diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index c23c057162e6..d40f39f9547c 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -1841,7 +1841,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry, /* set ATTR_HIDDEN and clear ATTR_READONLY, but only if needed */ if (dosattr != origattr) { - info_buf = kzalloc(sizeof(*info_buf), GFP_KERNEL); + info_buf = kzalloc_obj(*info_buf, GFP_KERNEL); if (info_buf == NULL) { rc = -ENOMEM; goto out_close; @@ -2041,7 +2041,7 @@ psx_del_no_retry: } } } else if ((rc == -EACCES) && (dosattr == 0) && inode) { - attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_obj(*attrs, GFP_KERNEL); if (attrs == NULL) { rc = -ENOMEM; goto out_reval; @@ -2197,7 +2197,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode, struct inode *newinode = NULL; struct cifs_fattr fattr; - info = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); + info = kzalloc_obj(FILE_UNIX_BASIC_INFO, GFP_KERNEL); if (info == NULL) { rc = -ENOMEM; goto posix_mkdir_out; @@ -2585,8 +2585,7 @@ cifs_rename2(struct mnt_idmap *idmap, struct inode *source_dir, * with unix extensions enabled. */ info_buf_source = - kmalloc_array(2, sizeof(FILE_UNIX_BASIC_INFO), - GFP_KERNEL); + kmalloc_objs(FILE_UNIX_BASIC_INFO, 2, GFP_KERNEL); if (info_buf_source == NULL) { rc = -ENOMEM; goto cifs_rename_exit; @@ -3167,7 +3166,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) attrs->ia_valid &= ~ATTR_MODE; - args = kmalloc(sizeof(*args), GFP_KERNEL); + args = kmalloc_obj(*args, GFP_KERNEL); if (args == NULL) { rc = -ENOMEM; goto out; diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c index a4aa063cf5ea..6d24184c8735 100644 --- a/fs/smb/client/ioctl.c +++ b/fs/smb/client/ioctl.c @@ -133,7 +133,7 @@ static long smb_mnt_get_fsinfo(unsigned int xid, struct cifs_tcon *tcon, int rc = 0; struct smb_mnt_fs_info *fsinf; - fsinf = kzalloc(sizeof(struct smb_mnt_fs_info), GFP_KERNEL); + fsinf = kzalloc_obj(struct smb_mnt_fs_info, GFP_KERNEL); if (fsinf == NULL) return -ENOMEM; diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 1773e3b471aa..290d0a0bea53 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -67,7 +67,7 @@ sesInfoAlloc(void) { struct cifs_ses *ret_buf; - ret_buf = kzalloc(sizeof(struct cifs_ses), GFP_KERNEL); + ret_buf = kzalloc_obj(struct cifs_ses, GFP_KERNEL); if (ret_buf) { atomic_inc(&sesInfoAllocCount); spin_lock_init(&ret_buf->ses_lock); @@ -118,7 +118,7 @@ tcon_info_alloc(bool dir_leases_enabled, enum smb3_tcon_ref_trace trace) struct cifs_tcon *ret_buf; static atomic_t tcon_debug_id; - ret_buf = kzalloc(sizeof(*ret_buf), GFP_KERNEL); + ret_buf = kzalloc_obj(*ret_buf, GFP_KERNEL); if (!ret_buf) return NULL; @@ -499,7 +499,8 @@ cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode) cifs_del_deferred_close(cfile); spin_unlock(&cifs_inode->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, + GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -531,7 +532,8 @@ cifs_close_all_deferred_files(struct cifs_tcon *tcon) cifs_del_deferred_close(cfile); spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, + GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -564,7 +566,7 @@ void cifs_close_deferred_file_under_dentry(struct cifs_tcon *tcon, cifs_del_deferred_close(cfile); spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -671,8 +673,8 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size, cifs_dbg(FYI, "num_referrals: %d dfs flags: 0x%x ...\n", *num_of_nodes, le32_to_cpu(rsp->DFSFlags)); - *target_nodes = kcalloc(*num_of_nodes, sizeof(struct dfs_info3_param), - GFP_KERNEL); + *target_nodes = kzalloc_objs(struct dfs_info3_param, *num_of_nodes, + GFP_KERNEL); if (*target_nodes == NULL) { rc = -ENOMEM; goto parse_DFS_referrals_exit; diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c index 67a8555efa1e..53e17fb2b6ee 100644 --- a/fs/smb/client/readdir.c +++ b/fs/smb/client/readdir.c @@ -358,7 +358,7 @@ _initiate_cifs_search(const unsigned int xid, struct file *file, if (IS_ERR(tlink)) return PTR_ERR(tlink); - cifsFile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); + cifsFile = kzalloc_obj(struct cifsFileInfo, GFP_KERNEL); if (cifsFile == NULL) { rc = -ENOMEM; goto error_exit; @@ -888,7 +888,7 @@ static bool add_cached_dirent(struct cached_dirents *cde, cde->is_failed = 1; return false; } - de = kzalloc(sizeof(*de), GFP_ATOMIC); + de = kzalloc_obj(*de, GFP_ATOMIC); if (de == NULL) { cde->is_failed = 1; return false; diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index d523540565ef..e32f9e185499 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -510,7 +510,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, * the session and server without caring about memory * management. */ - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto out_free_xid; diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c index 970aeffe936e..689e052c2809 100644 --- a/fs/smb/client/smb1ops.c +++ b/fs/smb/client/smb1ops.c @@ -506,7 +506,7 @@ cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, int rc; FILE_ALL_INFO *file_info; - file_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); + file_info = kmalloc_obj(FILE_ALL_INFO, GFP_KERNEL); if (file_info == NULL) return -ENOMEM; diff --git a/fs/smb/client/smb1session.c b/fs/smb/client/smb1session.c index 1cf6bd640fde..f5ef07d24b5f 100644 --- a/fs/smb/client/smb1session.c +++ b/fs/smb/client/smb1session.c @@ -725,7 +725,7 @@ sess_auth_rawntlmssp_negotiate(struct sess_data *sess_data) * if memory allocation is successful, caller of this function * frees it. */ - ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); + ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth, GFP_KERNEL); if (!ses->ntlmssp) { rc = -ENOMEM; goto out; @@ -969,7 +969,7 @@ int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses, return -EINVAL; } - sess_data = kzalloc(sizeof(struct sess_data), GFP_KERNEL); + sess_data = kzalloc_obj(struct sess_data, GFP_KERNEL); if (!sess_data) return -ENOMEM; diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index 476c53b3711f..6dba874156aa 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -281,7 +281,7 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf / sizeof(struct smb2_lock_element); - buf = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL); + buf = kzalloc_objs(struct smb2_lock_element, max_num, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -424,7 +424,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile) BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf / sizeof(struct smb2_lock_element); - buf = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL); + buf = kzalloc_objs(struct smb2_lock_element, max_num, GFP_KERNEL); if (!buf) { free_xid(xid); return -ENOMEM; diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c index 8a30088fed15..195a38fd61e8 100644 --- a/fs/smb/client/smb2inode.c +++ b/fs/smb/client/smb2inode.c @@ -209,7 +209,7 @@ replay_again: num_rqst = 0; server = cifs_pick_channel(ses); - vars = kzalloc(sizeof(*vars), GFP_ATOMIC); + vars = kzalloc_obj(*vars, GFP_ATOMIC); if (vars == NULL) { rc = -ENOMEM; goto out; diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c index d1ae839e4863..efba7cb9fb70 100644 --- a/fs/smb/client/smb2misc.c +++ b/fs/smb/client/smb2misc.c @@ -526,7 +526,7 @@ smb2_queue_pending_open_break(struct tcon_link *tlink, __u8 *lease_key, { struct smb2_lease_break_work *lw; - lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); + lw = kmalloc_obj(struct smb2_lease_break_work, GFP_KERNEL); if (!lw) { cifs_put_tlink(tlink); return; @@ -798,7 +798,7 @@ __smb2_handle_cancelled_cmd(struct cifs_tcon *tcon, __u16 cmd, __u64 mid, { struct close_cancelled_open *cancelled; - cancelled = kzalloc(sizeof(*cancelled), GFP_KERNEL); + cancelled = kzalloc_obj(*cancelled, GFP_KERNEL); if (!cancelled) return -ENOMEM; diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 7370d7a18cd0..071df7465a8b 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -731,8 +731,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, spin_unlock(&ses->iface_lock); /* no match. insert the entry in the list */ - info = kmalloc(sizeof(struct cifs_server_iface), - GFP_KERNEL); + info = kmalloc_obj(struct cifs_server_iface, GFP_KERNEL); if (!info) { rc = -ENOMEM; goto out; @@ -1202,7 +1201,7 @@ replay_again: ea = NULL; resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - vars = kzalloc(sizeof(*vars), GFP_KERNEL); + vars = kzalloc_obj(*vars, GFP_KERNEL); if (!vars) { rc = -ENOMEM; goto out_free_path; @@ -1594,7 +1593,7 @@ replay_again: oplock = SMB2_OPLOCK_LEVEL_NONE; server = cifs_pick_channel(ses); - vars = kzalloc(sizeof(*vars), GFP_ATOMIC); + vars = kzalloc_obj(*vars, GFP_ATOMIC); if (vars == NULL) return -ENOMEM; rqst = &vars->rqst[0]; @@ -1889,7 +1888,7 @@ retry: goto out; } - cc_req = kzalloc(struct_size(cc_req, Chunks, chunk_count), GFP_KERNEL); + cc_req = kzalloc_flex(*cc_req, Chunks, chunk_count, GFP_KERNEL); if (!cc_req) { rc = -ENOMEM; goto out; @@ -2850,7 +2849,7 @@ replay_again: flags |= CIFS_TRANSFORM_REQ; resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - vars = kzalloc(sizeof(*vars), GFP_KERNEL); + vars = kzalloc_obj(*vars, GFP_KERNEL); if (!vars) { rc = -ENOMEM; goto out_free_path; @@ -4221,7 +4220,7 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock, u8 *parent_lease_key, __le32 fla { struct create_lease *buf; - buf = kzalloc(sizeof(struct create_lease), GFP_KERNEL); + buf = kzalloc_obj(struct create_lease, GFP_KERNEL); if (!buf) return NULL; @@ -4247,7 +4246,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 oplock, u8 *parent_lease_key, __le32 fla { struct create_lease_v2 *buf; - buf = kzalloc(sizeof(struct create_lease_v2), GFP_KERNEL); + buf = kzalloc_obj(struct create_lease_v2, GFP_KERNEL); if (!buf) return NULL; @@ -4931,7 +4930,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid, int rc; struct smb2_decrypt_work *dw; - dw = kzalloc(sizeof(struct smb2_decrypt_work), GFP_KERNEL); + dw = kzalloc_obj(struct smb2_decrypt_work, GFP_KERNEL); if (!dw) return -ENOMEM; INIT_WORK(&dw->decrypt, smb2_decrypt_offload); diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 7f3edf42b9c3..0ebfdfebc5e9 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -1009,8 +1009,7 @@ create_posix_buf(umode_t mode) { struct create_posix *buf; - buf = kzalloc(sizeof(struct create_posix), - GFP_KERNEL); + buf = kzalloc_obj(struct create_posix, GFP_KERNEL); if (!buf) return NULL; @@ -1359,7 +1358,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) cifs_tcon_dbg(VFS, "Unexpected null user (anonymous) auth flag sent by server\n"); - pneg_inbuf = kmalloc(sizeof(*pneg_inbuf), GFP_NOFS); + pneg_inbuf = kmalloc_obj(*pneg_inbuf, GFP_NOFS); if (!pneg_inbuf) return -ENOMEM; @@ -1786,7 +1785,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) * If memory allocation is successful, caller of this function * frees it. */ - ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); + ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth, GFP_KERNEL); if (!ses->ntlmssp) { rc = -ENOMEM; goto out_err; @@ -1984,7 +1983,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, return smb_EIO(smb_eio_trace_null_pointers); } - sess_data = kzalloc(sizeof(struct SMB2_sess_data), GFP_KERNEL); + sess_data = kzalloc_obj(struct SMB2_sess_data, GFP_KERNEL); if (!sess_data) return -ENOMEM; @@ -2298,7 +2297,7 @@ create_durable_buf(void) { create_durable_req_t *buf; - buf = kzalloc(sizeof(create_durable_req_t), GFP_KERNEL); + buf = kzalloc_obj(create_durable_req_t, GFP_KERNEL); if (!buf) return NULL; @@ -2321,7 +2320,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid) { create_durable_req_t *buf; - buf = kzalloc(sizeof(create_durable_req_t), GFP_KERNEL); + buf = kzalloc_obj(create_durable_req_t, GFP_KERNEL); if (!buf) return NULL; @@ -2493,7 +2492,7 @@ create_durable_v2_buf(struct cifs_open_parms *oparms) struct cifs_fid *pfid = oparms->fid; struct create_durable_req_v2 *buf; - buf = kzalloc(sizeof(struct create_durable_req_v2), GFP_KERNEL); + buf = kzalloc_obj(struct create_durable_req_v2, GFP_KERNEL); if (!buf) return NULL; @@ -2534,8 +2533,7 @@ create_reconnect_durable_v2_buf(struct cifs_fid *fid) { struct create_durable_handle_reconnect_v2 *buf; - buf = kzalloc(sizeof(struct create_durable_handle_reconnect_v2), - GFP_KERNEL); + buf = kzalloc_obj(struct create_durable_handle_reconnect_v2, GFP_KERNEL); if (!buf) return NULL; @@ -2626,7 +2624,7 @@ create_twarp_buf(__u64 timewarp) { struct crt_twarp_ctxt *buf; - buf = kzalloc(sizeof(struct crt_twarp_ctxt), GFP_KERNEL); + buf = kzalloc_obj(struct crt_twarp_ctxt, GFP_KERNEL); if (!buf) return NULL; @@ -2793,7 +2791,7 @@ create_query_id_buf(void) { struct crt_query_id_ctxt *buf; - buf = kzalloc(sizeof(struct crt_query_id_ctxt), GFP_KERNEL); + buf = kzalloc_obj(struct crt_query_id_ctxt, GFP_KERNEL); if (!buf) return NULL; @@ -5845,7 +5843,7 @@ replay_again: if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - iov = kmalloc_array(num, sizeof(struct kvec), GFP_KERNEL); + iov = kmalloc_objs(struct kvec, num, GFP_KERNEL); if (!iov) return -ENOMEM; diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index d44847c9d8fc..e2df73c719fd 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -2098,7 +2098,7 @@ static struct smbd_connection *_smbd_get_connection( char wq_name[80]; struct workqueue_struct *workqueue; - info = kzalloc(sizeof(struct smbd_connection), GFP_KERNEL); + info = kzalloc_obj(struct smbd_connection, GFP_KERNEL); if (!info) return NULL; sc = &info->socket; @@ -2786,7 +2786,7 @@ static int allocate_mr_list(struct smbdirect_socket *sc) /* Allocate more MRs (2x) than hardware responder_resources */ for (i = 0; i < sp->responder_resources * 2; i++) { - mr = kzalloc(sizeof(*mr), GFP_KERNEL); + mr = kzalloc_obj(*mr, GFP_KERNEL); if (!mr) { ret = -ENOMEM; goto kzalloc_mr_failed; @@ -2805,9 +2805,8 @@ static int allocate_mr_list(struct smbdirect_socket *sc) goto ib_alloc_mr_failed; } - mr->sgt.sgl = kcalloc(sp->max_frmr_depth, - sizeof(struct scatterlist), - GFP_KERNEL); + mr->sgt.sgl = kzalloc_objs(struct scatterlist, + sp->max_frmr_depth, GFP_KERNEL); if (!mr->sgt.sgl) { ret = -ENOMEM; log_rdma_mr(ERR, "failed to allocate sgl\n"); diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index 09af55b71153..580c4d303dc3 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -239,7 +239,7 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, if (sess_key_len > CIFS_KEY_SIZE) return -EINVAL; - ctx_arc4 = kmalloc(sizeof(*ctx_arc4), KSMBD_DEFAULT_GFP); + ctx_arc4 = kmalloc_obj(*ctx_arc4, KSMBD_DEFAULT_GFP); if (!ctx_arc4) return -ENOMEM; @@ -774,7 +774,7 @@ static struct scatterlist *ksmbd_init_sg(struct kvec *iov, unsigned int nvec, if (!nvec) return NULL; - nr_entries = kcalloc(nvec, sizeof(int), KSMBD_DEFAULT_GFP); + nr_entries = kzalloc_objs(int, nvec, KSMBD_DEFAULT_GFP); if (!nr_entries) return NULL; @@ -794,8 +794,7 @@ static struct scatterlist *ksmbd_init_sg(struct kvec *iov, unsigned int nvec, /* Add two entries for transform header and signature */ total_entries += 2; - sg = kmalloc_array(total_entries, sizeof(struct scatterlist), - KSMBD_DEFAULT_GFP); + sg = kmalloc_objs(struct scatterlist, total_entries, KSMBD_DEFAULT_GFP); if (!sg) { kfree(nr_entries); return NULL; diff --git a/fs/smb/server/connection.c b/fs/smb/server/connection.c index e7e3e77006b1..1bb2081c492c 100644 --- a/fs/smb/server/connection.c +++ b/fs/smb/server/connection.c @@ -111,7 +111,7 @@ struct ksmbd_conn *ksmbd_conn_alloc(void) { struct ksmbd_conn *conn; - conn = kzalloc(sizeof(struct ksmbd_conn), KSMBD_DEFAULT_GFP); + conn = kzalloc_obj(struct ksmbd_conn, KSMBD_DEFAULT_GFP); if (!conn) return NULL; diff --git a/fs/smb/server/crypto_ctx.c b/fs/smb/server/crypto_ctx.c index fe29d186baf6..8fd9713b00b7 100644 --- a/fs/smb/server/crypto_ctx.c +++ b/fs/smb/server/crypto_ctx.c @@ -121,7 +121,7 @@ static struct ksmbd_crypto_ctx *ksmbd_find_crypto_ctx(void) ctx_list.avail_ctx++; spin_unlock(&ctx_list.ctx_lock); - ctx = kzalloc(sizeof(struct ksmbd_crypto_ctx), KSMBD_DEFAULT_GFP); + ctx = kzalloc_obj(struct ksmbd_crypto_ctx, KSMBD_DEFAULT_GFP); if (!ctx) { spin_lock(&ctx_list.ctx_lock); ctx_list.avail_ctx--; @@ -226,7 +226,7 @@ int ksmbd_crypto_create(void) init_waitqueue_head(&ctx_list.ctx_wait); ctx_list.avail_ctx = 1; - ctx = kzalloc(sizeof(struct ksmbd_crypto_ctx), KSMBD_DEFAULT_GFP); + ctx = kzalloc_obj(struct ksmbd_crypto_ctx, KSMBD_DEFAULT_GFP); if (!ctx) return -ENOMEM; list_add(&ctx->list, &ctx_list.idle_ctx); diff --git a/fs/smb/server/ksmbd_work.c b/fs/smb/server/ksmbd_work.c index 4a71f46d7020..ab4958dc3eb0 100644 --- a/fs/smb/server/ksmbd_work.c +++ b/fs/smb/server/ksmbd_work.c @@ -28,8 +28,8 @@ struct ksmbd_work *ksmbd_alloc_work_struct(void) INIT_LIST_HEAD(&work->fp_entry); INIT_LIST_HEAD(&work->aux_read_list); work->iov_alloc_cnt = 4; - work->iov = kcalloc(work->iov_alloc_cnt, sizeof(struct kvec), - KSMBD_DEFAULT_GFP); + work->iov = kzalloc_objs(struct kvec, work->iov_alloc_cnt, + KSMBD_DEFAULT_GFP); if (!work->iov) { kmem_cache_free(work_cache, work); work = NULL; @@ -111,7 +111,7 @@ static int __ksmbd_iov_pin_rsp(struct ksmbd_work *work, void *ib, int len, if (aux_size) { need_iov_cnt++; - ar = kmalloc(sizeof(struct aux_read), KSMBD_DEFAULT_GFP); + ar = kmalloc_obj(struct aux_read, KSMBD_DEFAULT_GFP); if (!ar) return -ENOMEM; } diff --git a/fs/smb/server/mgmt/share_config.c b/fs/smb/server/mgmt/share_config.c index c9b1108d6e96..53f44ff4d376 100644 --- a/fs/smb/server/mgmt/share_config.c +++ b/fs/smb/server/mgmt/share_config.c @@ -102,7 +102,7 @@ static int parse_veto_list(struct ksmbd_share_config *share, if (!sz) break; - p = kzalloc(sizeof(struct ksmbd_veto_pattern), KSMBD_DEFAULT_GFP); + p = kzalloc_obj(struct ksmbd_veto_pattern, KSMBD_DEFAULT_GFP); if (!p) return -ENOMEM; @@ -150,7 +150,7 @@ static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work, goto out; } - share = kzalloc(sizeof(struct ksmbd_share_config), KSMBD_DEFAULT_GFP); + share = kzalloc_obj(struct ksmbd_share_config, KSMBD_DEFAULT_GFP); if (!share) goto out; diff --git a/fs/smb/server/mgmt/tree_connect.c b/fs/smb/server/mgmt/tree_connect.c index 57dd47ef688c..a72d7e42a6c2 100644 --- a/fs/smb/server/mgmt/tree_connect.c +++ b/fs/smb/server/mgmt/tree_connect.c @@ -32,8 +32,7 @@ ksmbd_tree_conn_connect(struct ksmbd_work *work, const char *share_name) if (!sc) return status; - tree_conn = kzalloc(sizeof(struct ksmbd_tree_connect), - KSMBD_DEFAULT_GFP); + tree_conn = kzalloc_obj(struct ksmbd_tree_connect, KSMBD_DEFAULT_GFP); if (!tree_conn) { status.ret = -ENOMEM; goto out_error; diff --git a/fs/smb/server/mgmt/user_config.c b/fs/smb/server/mgmt/user_config.c index 3267b86b8c16..a3183fe5c536 100644 --- a/fs/smb/server/mgmt/user_config.c +++ b/fs/smb/server/mgmt/user_config.c @@ -36,7 +36,7 @@ struct ksmbd_user *ksmbd_alloc_user(struct ksmbd_login_response *resp, { struct ksmbd_user *user; - user = kmalloc(sizeof(struct ksmbd_user), KSMBD_DEFAULT_GFP); + user = kmalloc_obj(struct ksmbd_user, KSMBD_DEFAULT_GFP); if (!user) return NULL; diff --git a/fs/smb/server/mgmt/user_session.c b/fs/smb/server/mgmt/user_session.c index 957a12de6a9d..39be2d2be86c 100644 --- a/fs/smb/server/mgmt/user_session.c +++ b/fs/smb/server/mgmt/user_session.c @@ -322,7 +322,7 @@ int ksmbd_session_rpc_open(struct ksmbd_session *sess, char *rpc_name) if (!method) return -EINVAL; - entry = kzalloc(sizeof(struct ksmbd_session_rpc), KSMBD_DEFAULT_GFP); + entry = kzalloc_obj(struct ksmbd_session_rpc, KSMBD_DEFAULT_GFP); if (!entry) return -ENOMEM; @@ -579,7 +579,7 @@ struct preauth_session *ksmbd_preauth_session_alloc(struct ksmbd_conn *conn, { struct preauth_session *sess; - sess = kmalloc(sizeof(struct preauth_session), KSMBD_DEFAULT_GFP); + sess = kmalloc_obj(struct preauth_session, KSMBD_DEFAULT_GFP); if (!sess) return NULL; @@ -663,7 +663,7 @@ static struct ksmbd_session *__session_create(int protocol) if (protocol != CIFDS_SESSION_FLAG_SMB2) return NULL; - sess = kzalloc(sizeof(struct ksmbd_session), KSMBD_DEFAULT_GFP); + sess = kzalloc_obj(struct ksmbd_session, KSMBD_DEFAULT_GFP); if (!sess) return NULL; diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index a5967ac46604..09d9878db9cb 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -34,7 +34,7 @@ static struct oplock_info *alloc_opinfo(struct ksmbd_work *work, struct ksmbd_session *sess = work->sess; struct oplock_info *opinfo; - opinfo = kzalloc(sizeof(struct oplock_info), KSMBD_DEFAULT_GFP); + opinfo = kzalloc_obj(struct oplock_info, KSMBD_DEFAULT_GFP); if (!opinfo) return NULL; @@ -93,7 +93,7 @@ static int alloc_lease(struct oplock_info *opinfo, struct lease_ctx_info *lctx) { struct lease *lease; - lease = kmalloc(sizeof(struct lease), KSMBD_DEFAULT_GFP); + lease = kmalloc_obj(struct lease, KSMBD_DEFAULT_GFP); if (!lease) return -ENOMEM; @@ -698,7 +698,7 @@ static int smb2_oplock_break_noti(struct oplock_info *opinfo) if (!work) return -ENOMEM; - br_info = kmalloc(sizeof(struct oplock_break_info), KSMBD_DEFAULT_GFP); + br_info = kmalloc_obj(struct oplock_break_info, KSMBD_DEFAULT_GFP); if (!br_info) { ksmbd_free_work_struct(work); return -ENOMEM; @@ -803,7 +803,7 @@ static int smb2_lease_break_noti(struct oplock_info *opinfo) if (!work) return -ENOMEM; - br_info = kmalloc(sizeof(struct lease_break_info), KSMBD_DEFAULT_GFP); + br_info = kmalloc_obj(struct lease_break_info, KSMBD_DEFAULT_GFP); if (!br_info) { ksmbd_free_work_struct(work); return -ENOMEM; @@ -1046,7 +1046,7 @@ static int add_lease_global_list(struct oplock_info *opinfo) } read_unlock(&lease_list_lock); - lb = kmalloc(sizeof(struct lease_table), KSMBD_DEFAULT_GFP); + lb = kmalloc_obj(struct lease_table, KSMBD_DEFAULT_GFP); if (!lb) return -ENOMEM; @@ -1491,7 +1491,7 @@ struct lease_ctx_info *parse_lease_state(void *open_req) if (IS_ERR_OR_NULL(cc)) return NULL; - lreq = kzalloc(sizeof(struct lease_ctx_info), KSMBD_DEFAULT_GFP); + lreq = kzalloc_obj(struct lease_ctx_info, KSMBD_DEFAULT_GFP); if (!lreq) return NULL; diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c index c2c074346da1..c3f1b7219950 100644 --- a/fs/smb/server/server.c +++ b/fs/smb/server/server.c @@ -410,7 +410,7 @@ static int __queue_ctrl_work(int type) { struct server_ctrl_struct *ctrl; - ctrl = kmalloc(sizeof(struct server_ctrl_struct), KSMBD_DEFAULT_GFP); + ctrl = kmalloc_obj(struct server_ctrl_struct, KSMBD_DEFAULT_GFP); if (!ctrl) return -ENOMEM; diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index cbb31efdbaa2..8a3e17fd4af9 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -1164,8 +1164,8 @@ int smb2_handle_negotiate(struct ksmbd_work *work) switch (conn->dialect) { case SMB311_PROT_ID: conn->preauth_info = - kzalloc(sizeof(struct preauth_integrity_info), - KSMBD_DEFAULT_GFP); + kzalloc_obj(struct preauth_integrity_info, + KSMBD_DEFAULT_GFP); if (!conn->preauth_info) { rc = -ENOMEM; rsp->hdr.Status = STATUS_INVALID_PARAMETER; @@ -1560,7 +1560,7 @@ binding_session: if (conn->dialect >= SMB30_PROT_ID) { chann = lookup_chann_list(sess, conn); if (!chann) { - chann = kmalloc(sizeof(struct channel), KSMBD_DEFAULT_GFP); + chann = kmalloc_obj(struct channel, KSMBD_DEFAULT_GFP); if (!chann) return -ENOMEM; @@ -1655,7 +1655,7 @@ binding_session: if (conn->dialect >= SMB30_PROT_ID) { chann = lookup_chann_list(sess, conn); if (!chann) { - chann = kmalloc(sizeof(struct channel), KSMBD_DEFAULT_GFP); + chann = kmalloc_obj(struct channel, KSMBD_DEFAULT_GFP); if (!chann) return -ENOMEM; @@ -7326,7 +7326,7 @@ static struct ksmbd_lock *smb2_lock_init(struct file_lock *flock, { struct ksmbd_lock *lock; - lock = kzalloc(sizeof(struct ksmbd_lock), KSMBD_DEFAULT_GFP); + lock = kzalloc_obj(struct ksmbd_lock, KSMBD_DEFAULT_GFP); if (!lock) return NULL; diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c index 05598d994a68..49c2abb29bf5 100644 --- a/fs/smb/server/smbacl.c +++ b/fs/smb/server/smbacl.c @@ -417,7 +417,7 @@ static void parse_dacl(struct mnt_idmap *idmap, return; } - ppace = kmalloc_array(num_aces, sizeof(struct smb_ace *), KSMBD_DEFAULT_GFP); + ppace = kmalloc_objs(struct smb_ace *, num_aces, KSMBD_DEFAULT_GFP); if (!ppace) { free_acl_state(&default_acl_state); free_acl_state(&acl_state); @@ -603,7 +603,7 @@ static void set_posix_acl_entries_dacl(struct mnt_idmap *idmap, for (i = 0; i < fattr->cf_acls->a_count; i++, pace++) { int flags = 0; - sid = kmalloc(sizeof(struct smb_sid), KSMBD_DEFAULT_GFP); + sid = kmalloc_obj(struct smb_sid, KSMBD_DEFAULT_GFP); if (!sid) break; @@ -670,7 +670,7 @@ posix_default_acl: pace = fattr->cf_dacls->a_entries; for (i = 0; i < fattr->cf_dacls->a_count; i++, pace++) { - sid = kmalloc(sizeof(struct smb_sid), KSMBD_DEFAULT_GFP); + sid = kmalloc_obj(struct smb_sid, KSMBD_DEFAULT_GFP); if (!sid) break; @@ -930,7 +930,7 @@ int build_sec_desc(struct mnt_idmap *idmap, gid_t gid; unsigned int sid_type = SIDOWNER; - nowner_sid_ptr = kmalloc(sizeof(struct smb_sid), KSMBD_DEFAULT_GFP); + nowner_sid_ptr = kmalloc_obj(struct smb_sid, KSMBD_DEFAULT_GFP); if (!nowner_sid_ptr) return -ENOMEM; @@ -939,7 +939,7 @@ int build_sec_desc(struct mnt_idmap *idmap, sid_type = SIDUNIX_USER; id_to_sid(uid, sid_type, nowner_sid_ptr); - ngroup_sid_ptr = kmalloc(sizeof(struct smb_sid), KSMBD_DEFAULT_GFP); + ngroup_sid_ptr = kmalloc_obj(struct smb_sid, KSMBD_DEFAULT_GFP); if (!ngroup_sid_ptr) { kfree(nowner_sid_ptr); return -ENOMEM; diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index fb36fb9d5214..7c53b78b818e 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -411,7 +411,7 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id) struct smbdirect_socket_parameters *sp; struct ksmbd_conn *conn; - t = kzalloc(sizeof(*t), KSMBD_DEFAULT_GFP); + t = kzalloc_obj(*t, KSMBD_DEFAULT_GFP); if (!t) return NULL; sc = &t->socket; @@ -1852,8 +1852,8 @@ static int smb_direct_rdma_xmit(struct smb_direct_transport *t, /* build rdma_rw_ctx for each descriptor */ desc_buf = buf; for (i = 0; i < desc_num; i++) { - msg = kzalloc(struct_size(msg, sg_list, SG_CHUNK_SIZE), - KSMBD_DEFAULT_GFP); + msg = kzalloc_flex(*msg, sg_list, SG_CHUNK_SIZE, + KSMBD_DEFAULT_GFP); if (!msg) { ret = -ENOMEM; goto out; @@ -2860,7 +2860,7 @@ static int smb_direct_ib_client_add(struct ib_device *ib_dev) if (!rdma_frwr_is_supported(&ib_dev->attrs)) return 0; - smb_dev = kzalloc(sizeof(*smb_dev), KSMBD_DEFAULT_GFP); + smb_dev = kzalloc_obj(*smb_dev, KSMBD_DEFAULT_GFP); if (!smb_dev) return -ENOMEM; smb_dev->ib_dev = ib_dev; diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 2436dabada95..7e29b06820e2 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -61,7 +61,7 @@ static struct tcp_transport *alloc_transport(struct socket *client_sk) struct tcp_transport *t; struct ksmbd_conn *conn; - t = kzalloc(sizeof(*t), KSMBD_DEFAULT_GFP); + t = kzalloc_obj(*t, KSMBD_DEFAULT_GFP); if (!t) return NULL; t->sock = client_sk; @@ -156,7 +156,7 @@ static struct kvec *get_conn_iovec(struct tcp_transport *t, unsigned int nr_segs return t->iov; /* not big enough -- allocate a new one and release the old */ - new_iov = kmalloc_array(nr_segs, sizeof(*new_iov), KSMBD_DEFAULT_GFP); + new_iov = kmalloc_objs(*new_iov, nr_segs, KSMBD_DEFAULT_GFP); if (new_iov) { kfree(t->iov); t->iov = new_iov; @@ -636,7 +636,7 @@ static struct interface *alloc_iface(char *ifname) if (!ifname) return NULL; - iface = kzalloc(sizeof(struct interface), KSMBD_DEFAULT_GFP); + iface = kzalloc_obj(struct interface, KSMBD_DEFAULT_GFP); if (!iface) { kfree(ifname); return NULL; diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c index e302e403e55a..ff4ea412d900 100644 --- a/fs/smb/server/vfs_cache.c +++ b/fs/smb/server/vfs_cache.c @@ -303,7 +303,7 @@ static struct ksmbd_inode *ksmbd_inode_get(struct ksmbd_file *fp) if (ci) return ci; - ci = kmalloc(sizeof(struct ksmbd_inode), KSMBD_DEFAULT_GFP); + ci = kmalloc_obj(struct ksmbd_inode, KSMBD_DEFAULT_GFP); if (!ci) return NULL; @@ -1126,7 +1126,7 @@ int ksmbd_reopen_durable_fd(struct ksmbd_work *work, struct ksmbd_file *fp) int ksmbd_init_file_table(struct ksmbd_file_table *ft) { - ft->idr = kzalloc(sizeof(struct idr), KSMBD_DEFAULT_GFP); + ft->idr = kzalloc_obj(struct idr, KSMBD_DEFAULT_GFP); if (!ft->idr) return -ENOMEM; diff --git a/fs/splice.c b/fs/splice.c index 5fb07c01936f..cad3779fa35c 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -275,9 +275,8 @@ int splice_grow_spd(const struct pipe_inode_info *pipe, struct splice_pipe_desc if (max_usage <= PIPE_DEF_BUFFERS) return 0; - spd->pages = kmalloc_array(max_usage, sizeof(struct page *), GFP_KERNEL); - spd->partial = kmalloc_array(max_usage, sizeof(struct partial_page), - GFP_KERNEL); + spd->pages = kmalloc_objs(struct page *, max_usage, GFP_KERNEL); + spd->partial = kmalloc_objs(struct partial_page, max_usage, GFP_KERNEL); if (spd->pages && spd->partial) return 0; @@ -676,7 +675,7 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (!out->f_op->write_iter) return -EINVAL; - array = kcalloc(nbufs, sizeof(struct bio_vec), GFP_KERNEL); + array = kzalloc_objs(struct bio_vec, nbufs, GFP_KERNEL); if (unlikely(!array)) return -ENOMEM; @@ -697,8 +696,7 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (unlikely(nbufs < pipe->max_usage)) { kfree(array); nbufs = pipe->max_usage; - array = kcalloc(nbufs, sizeof(struct bio_vec), - GFP_KERNEL); + array = kzalloc_objs(struct bio_vec, nbufs, GFP_KERNEL); if (!array) { ret = -ENOMEM; break; diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index a05e3793f93a..2d5850168026 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -88,8 +88,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio, int idx = 0; int err = 0; #ifdef CONFIG_SQUASHFS_COMP_CACHE_FULL - struct folio **cache_folios = kmalloc_array(page_count, - sizeof(*cache_folios), GFP_KERNEL | __GFP_ZERO); + struct folio **cache_folios = kmalloc_objs(*cache_folios, page_count, + GFP_KERNEL | __GFP_ZERO); #endif bio_for_each_folio_all(fi, fullbio) { diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c index 181260e72680..5d97b22ce297 100644 --- a/fs/squashfs/cache.c +++ b/fs/squashfs/cache.c @@ -229,13 +229,13 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries, if (entries == 0) return NULL; - cache = kzalloc(sizeof(*cache), GFP_KERNEL); + cache = kzalloc_obj(*cache, GFP_KERNEL); if (cache == NULL) { ERROR("Failed to allocate %s cache\n", name); return ERR_PTR(-ENOMEM); } - cache->entry = kcalloc(entries, sizeof(*(cache->entry)), GFP_KERNEL); + cache->entry = kzalloc_objs(*(cache->entry), entries, GFP_KERNEL); if (cache->entry == NULL) { ERROR("Failed to allocate %s cache\n", name); goto cleanup; diff --git a/fs/squashfs/decompressor_multi.c b/fs/squashfs/decompressor_multi.c index 416c53eedbd1..4d7bc620bef5 100644 --- a/fs/squashfs/decompressor_multi.c +++ b/fs/squashfs/decompressor_multi.c @@ -65,7 +65,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, struct decomp_stream *decomp_strm = NULL; int err = -ENOMEM; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) goto out; @@ -80,7 +80,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, * we could always fall back to default decompressor and * file system works. */ - decomp_strm = kmalloc(sizeof(*decomp_strm), GFP_KERNEL); + decomp_strm = kmalloc_obj(*decomp_strm, GFP_KERNEL); if (!decomp_strm) goto out; @@ -148,7 +148,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk, goto wait; /* Let's allocate new decomp */ - decomp_strm = kmalloc(sizeof(*decomp_strm), GFP_KERNEL); + decomp_strm = kmalloc_obj(*decomp_strm, GFP_KERNEL); if (!decomp_strm) goto wait; diff --git a/fs/squashfs/decompressor_single.c b/fs/squashfs/decompressor_single.c index 6f161887710b..1f1597104ca8 100644 --- a/fs/squashfs/decompressor_single.c +++ b/fs/squashfs/decompressor_single.c @@ -30,7 +30,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, struct squashfs_stream *stream; int err = -ENOMEM; - stream = kmalloc(sizeof(*stream), GFP_KERNEL); + stream = kmalloc_obj(*stream, GFP_KERNEL); if (stream == NULL) goto out; diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index 4be92206e755..8b45020b4a13 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -103,8 +103,9 @@ static struct meta_index *empty_meta_index(struct inode *inode, int offset, * mount time but doing it here means it is allocated only * if a 'large' file is read. */ - msblk->meta_index = kcalloc(SQUASHFS_META_SLOTS, - sizeof(*(msblk->meta_index)), GFP_KERNEL); + msblk->meta_index = kzalloc_objs(*(msblk->meta_index), + SQUASHFS_META_SLOTS, + GFP_KERNEL); if (msblk->meta_index == NULL) { ERROR("Failed to allocate meta_index\n"); goto failed; diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c index 49797729f143..e482757d8f2c 100644 --- a/fs/squashfs/lz4_wrapper.c +++ b/fs/squashfs/lz4_wrapper.c @@ -54,7 +54,7 @@ static void *lz4_init(struct squashfs_sb_info *msblk, void *buff) int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); struct squashfs_lz4 *stream; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (stream == NULL) goto failed; stream->input = vmalloc(block_size); diff --git a/fs/squashfs/lzo_wrapper.c b/fs/squashfs/lzo_wrapper.c index d216aeefa865..961fda720c14 100644 --- a/fs/squashfs/lzo_wrapper.c +++ b/fs/squashfs/lzo_wrapper.c @@ -29,7 +29,7 @@ static void *lzo_init(struct squashfs_sb_info *msblk, void *buff) { int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); - struct squashfs_lzo *stream = kzalloc(sizeof(*stream), GFP_KERNEL); + struct squashfs_lzo *stream = kzalloc_obj(*stream, GFP_KERNEL); if (stream == NULL) goto failed; stream->input = vmalloc(block_size); diff --git a/fs/squashfs/page_actor.c b/fs/squashfs/page_actor.c index 2b3e807d4dea..3d8f0225e240 100644 --- a/fs/squashfs/page_actor.c +++ b/fs/squashfs/page_actor.c @@ -43,7 +43,7 @@ static void cache_finish_page(struct squashfs_page_actor *actor) struct squashfs_page_actor *squashfs_page_actor_init(void **buffer, int pages, int length) { - struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL); + struct squashfs_page_actor *actor = kmalloc_obj(*actor, GFP_KERNEL); if (actor == NULL) return NULL; @@ -110,7 +110,7 @@ static void direct_finish_page(struct squashfs_page_actor *actor) struct squashfs_page_actor *squashfs_page_actor_init_special(struct squashfs_sb_info *msblk, struct page **page, int pages, int length, loff_t start_index) { - struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL); + struct squashfs_page_actor *actor = kmalloc_obj(*actor, GFP_KERNEL); if (actor == NULL) return NULL; diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 4465cf05603a..69217e752bc5 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -196,7 +196,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) return -EINVAL; } - sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(*msblk, GFP_KERNEL); if (sb->s_fs_info == NULL) { ERROR("Failed to allocate squashfs_sb_info\n"); return -ENOMEM; @@ -549,7 +549,7 @@ static int squashfs_init_fs_context(struct fs_context *fc) { struct squashfs_mount_opts *opts; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/fs/squashfs/xz_wrapper.c b/fs/squashfs/xz_wrapper.c index 6c49481a2f8c..d258f4726d2e 100644 --- a/fs/squashfs/xz_wrapper.c +++ b/fs/squashfs/xz_wrapper.c @@ -42,7 +42,7 @@ static void *squashfs_xz_comp_opts(struct squashfs_sb_info *msblk, struct comp_opts *opts; int err = 0, n; - opts = kmalloc(sizeof(*opts), GFP_KERNEL); + opts = kmalloc_obj(*opts, GFP_KERNEL); if (opts == NULL) { err = -ENOMEM; goto out2; @@ -84,7 +84,7 @@ static void *squashfs_xz_init(struct squashfs_sb_info *msblk, void *buff) struct squashfs_xz *stream; int err; - stream = kmalloc(sizeof(*stream), GFP_KERNEL); + stream = kmalloc_obj(*stream, GFP_KERNEL); if (stream == NULL) { err = -ENOMEM; goto failed; diff --git a/fs/squashfs/zlib_wrapper.c b/fs/squashfs/zlib_wrapper.c index cbb7afe7bc46..899629c54d97 100644 --- a/fs/squashfs/zlib_wrapper.c +++ b/fs/squashfs/zlib_wrapper.c @@ -23,7 +23,7 @@ static void *zlib_init(struct squashfs_sb_info *dummy, void *buff) { - z_stream *stream = kmalloc(sizeof(z_stream), GFP_KERNEL); + z_stream *stream = kmalloc_obj(z_stream, GFP_KERNEL); if (stream == NULL) goto failed; stream->workspace = vmalloc(zlib_inflate_workspacesize()); diff --git a/fs/squashfs/zstd_wrapper.c b/fs/squashfs/zstd_wrapper.c index 0e407c4d8b3b..632560e4d6b0 100644 --- a/fs/squashfs/zstd_wrapper.c +++ b/fs/squashfs/zstd_wrapper.c @@ -28,7 +28,7 @@ struct workspace { static void *zstd_init(struct squashfs_sb_info *msblk, void *buff) { - struct workspace *wksp = kmalloc(sizeof(*wksp), GFP_KERNEL); + struct workspace *wksp = kmalloc_obj(*wksp, GFP_KERNEL); if (wksp == NULL) goto failed; diff --git a/fs/super.c b/fs/super.c index 784b5297a7d7..b8a6e156359d 100644 --- a/fs/super.c +++ b/fs/super.c @@ -317,7 +317,7 @@ static void destroy_unused_super(struct super_block *s) static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns) { - struct super_block *s = kzalloc(sizeof(struct super_block), GFP_KERNEL); + struct super_block *s = kzalloc_obj(struct super_block, GFP_KERNEL); static const struct super_operations default_op; int i; @@ -1135,7 +1135,7 @@ void emergency_remount(void) { struct work_struct *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) { INIT_WORK(work, do_emergency_remount); schedule_work(work); @@ -1167,7 +1167,7 @@ void emergency_thaw_all(void) { struct work_struct *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) { INIT_WORK(work, do_thaw_all); schedule_work(work); diff --git a/fs/sync.c b/fs/sync.c index f310a550316f..942a60cfedfb 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -135,7 +135,7 @@ void emergency_sync(void) { struct work_struct *work; - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) { INIT_WORK(work, do_sync_work); schedule_work(work); diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 98467bb76737..a6de7d945fba 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -62,7 +62,7 @@ static int sysfs_init_fs_context(struct fs_context *fc) return -EPERM; } - kfc = kzalloc(sizeof(struct kernfs_fs_context), GFP_KERNEL); + kfc = kzalloc_obj(struct kernfs_fs_context, GFP_KERNEL); if (!kfc) return -ENOMEM; diff --git a/fs/timerfd.c b/fs/timerfd.c index 9fcea7860ddf..f379edab7c02 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -413,7 +413,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) !capable(CAP_WAKE_ALARM)) return -EPERM; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 61cbdafa2411..81a3a7dcf6ce 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -191,8 +191,8 @@ static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry, /* Preallocate the children mode array if necessary */ if (!(dentry->d_inode->i_mode & S_IFDIR)) { if (!ei->entry_attrs) { - ei->entry_attrs = kcalloc(ei->nr_entries, sizeof(*ei->entry_attrs), - GFP_NOFS); + ei->entry_attrs = kzalloc_objs(*ei->entry_attrs, + ei->nr_entries, GFP_NOFS); if (!ei->entry_attrs) { ret = -ENOMEM; goto out; @@ -439,7 +439,7 @@ static inline struct eventfs_inode *init_ei(struct eventfs_inode *ei, const char static inline struct eventfs_inode *alloc_ei(const char *name) { - struct eventfs_inode *ei = kzalloc(sizeof(*ei), GFP_KERNEL); + struct eventfs_inode *ei = kzalloc_obj(*ei, GFP_KERNEL); struct eventfs_inode *result; if (!ei) @@ -454,7 +454,7 @@ static inline struct eventfs_inode *alloc_ei(const char *name) static inline struct eventfs_inode *alloc_root_ei(const char *name) { - struct eventfs_root_inode *rei = kzalloc(sizeof(*rei), GFP_KERNEL); + struct eventfs_root_inode *rei = kzalloc_obj(*rei, GFP_KERNEL); struct eventfs_inode *ei; if (!rei) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index d9d8932a7b9c..780f38c1b52d 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -522,7 +522,7 @@ static int tracefs_init_fs_context(struct fs_context *fc) { struct tracefs_fs_info *fsi; - fsi = kzalloc(sizeof(struct tracefs_fs_info), GFP_KERNEL); + fsi = kzalloc_obj(struct tracefs_fs_info, GFP_KERNEL); if (!fsi) return -ENOMEM; diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index b01f382ce8db..cb24592753b0 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -1846,7 +1846,7 @@ static struct fsck_inode *add_inode(struct ubifs_info *c, return ERR_PTR(-EINVAL); } - fscki = kzalloc(sizeof(struct fsck_inode), GFP_NOFS); + fscki = kzalloc_obj(struct fsck_inode, GFP_NOFS); if (!fscki) return ERR_PTR(-ENOMEM); @@ -3035,7 +3035,7 @@ void ubifs_assert_failed(struct ubifs_info *c, const char *expr, */ int ubifs_debugging_init(struct ubifs_info *c) { - c->dbg = kzalloc(sizeof(struct ubifs_debug_info), GFP_KERNEL); + c->dbg = kzalloc_obj(struct ubifs_debug_info, GFP_KERNEL); if (!c->dbg) return -ENOMEM; diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 3c3d3ad4fa6c..0e088aa661af 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1099,7 +1099,7 @@ static int ubifs_mknod(struct mnt_idmap *idmap, struct inode *dir, dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino); if (S_ISBLK(mode) || S_ISCHR(mode)) { - dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); + dev = kmalloc_obj(union ubifs_dev_desc, GFP_NOFS); if (!dev) return -ENOMEM; devlen = ubifs_encode_dev(dev, rdev); @@ -1399,7 +1399,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, if (flags & RENAME_WHITEOUT) { union ubifs_dev_desc *dev = NULL; - dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); + dev = kmalloc_obj(union ubifs_dev_desc, GFP_NOFS); if (!dev) { err = -ENOMEM; goto out_release; @@ -1725,7 +1725,7 @@ static int ubifs_dir_open(struct inode *inode, struct file *file) { struct ubifs_dir_data *data; - data = kzalloc(sizeof(struct ubifs_dir_data), GFP_KERNEL); + data = kzalloc_obj(struct ubifs_dir_data, GFP_KERNEL); if (!data) return -ENOMEM; file->private_data = data; diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 3dc3ca1cd803..cd04755e792a 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -848,7 +848,7 @@ static int ubifs_bulk_read(struct folio *folio) if (mutex_trylock(&c->bu_mutex)) bu = &c->bu; else { - bu = kmalloc(sizeof(struct bu_info), GFP_NOFS | __GFP_NOWARN); + bu = kmalloc_obj(struct bu_info, GFP_NOFS | __GFP_NOWARN); if (!bu) goto out_unlock; diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index 3134d070fcc0..0bf08b7755b8 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c @@ -559,7 +559,7 @@ int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp) goto out; } - idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); + idx_gc = kmalloc_obj(struct ubifs_gced_idx_leb, GFP_NOFS); if (!idx_gc) { err = -ENOMEM; goto out; @@ -916,7 +916,7 @@ int ubifs_gc_start_commit(struct ubifs_info *c) } if (!lp) break; - idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); + idx_gc = kmalloc_obj(struct ubifs_gced_idx_leb, GFP_NOFS); if (!idx_gc) { err = -ENOMEM; goto out; diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c index b6ac9c4281ef..c6edcbf35ebc 100644 --- a/fs/ubifs/log.c +++ b/fs/ubifs/log.c @@ -167,7 +167,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs) struct ubifs_bud *bud; struct ubifs_ref_node *ref; - bud = kmalloc(sizeof(struct ubifs_bud), GFP_NOFS); + bud = kmalloc_obj(struct ubifs_bud, GFP_NOFS); if (!bud) return -ENOMEM; ref = kzalloc(c->ref_node_alsz, GFP_NOFS); @@ -574,7 +574,7 @@ static int done_already(struct rb_root *done_tree, int lnum) return 1; } - dr = kzalloc(sizeof(struct done_ref), GFP_NOFS); + dr = kzalloc_obj(struct done_ref, GFP_NOFS); if (!dr) return -ENOMEM; diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index dde0aa3287f4..a9cb92e3ee9c 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c @@ -624,9 +624,9 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, if (IS_ERR(desc)) return PTR_ERR(desc); - lsave = kmalloc_array(c->lsave_cnt, sizeof(int), GFP_KERNEL); - pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_KERNEL); - nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_KERNEL); + lsave = kmalloc_objs(int, c->lsave_cnt, GFP_KERNEL); + pnode = kzalloc_obj(struct ubifs_pnode, GFP_KERNEL); + nnode = kzalloc_obj(struct ubifs_nnode, GFP_KERNEL); buf = vmalloc(c->leb_size); ltab = vmalloc_array(c->lpt_lebs, sizeof(struct ubifs_lpt_lprops)); @@ -1215,7 +1215,7 @@ int ubifs_read_nnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip) lnum = c->lpt_lnum; offs = c->lpt_offs; } - nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_NOFS); + nnode = kzalloc_obj(struct ubifs_nnode, GFP_NOFS); if (!nnode) { err = -ENOMEM; goto out; @@ -1278,7 +1278,7 @@ static int read_pnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip) branch = &parent->nbranch[iip]; lnum = branch->lnum; offs = branch->offs; - pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_NOFS); + pnode = kzalloc_obj(struct ubifs_pnode, GFP_NOFS); if (!pnode) return -ENOMEM; @@ -1856,7 +1856,7 @@ static int lpt_init_wr(struct ubifs_info *c) return -ENOMEM; if (c->big_lpt) { - c->lsave = kmalloc_array(c->lsave_cnt, sizeof(int), GFP_NOFS); + c->lsave = kmalloc_objs(int, c->lsave_cnt, GFP_NOFS); if (!c->lsave) return -ENOMEM; err = read_lsave(c); @@ -2099,8 +2099,7 @@ int ubifs_lpt_scan_nolock(struct ubifs_info *c, int start_lnum, int end_lnum, return err; } - path = kmalloc_array(c->lpt_hght + 1, sizeof(struct lpt_scan_node), - GFP_NOFS); + path = kmalloc_objs(struct lpt_scan_node, c->lpt_hght + 1, GFP_NOFS); if (!path) return -ENOMEM; diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index 5555dd740889..85e467646e4a 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c @@ -55,7 +55,7 @@ int ubifs_add_orphan(struct ubifs_info *c, ino_t inum) struct ubifs_orphan *orphan, *o; struct rb_node **p, *parent = NULL; - orphan = kzalloc(sizeof(struct ubifs_orphan), GFP_NOFS); + orphan = kzalloc_obj(struct ubifs_orphan, GFP_NOFS); if (!orphan) return -ENOMEM; orphan->inum = inum; @@ -758,7 +758,7 @@ static int dbg_ins_check_orphan(struct rb_root *root, ino_t inum) struct check_orphan *orphan, *o; struct rb_node **p, *parent = NULL; - orphan = kzalloc(sizeof(struct check_orphan), GFP_NOFS); + orphan = kzalloc_obj(struct check_orphan, GFP_NOFS); if (!orphan) return -ENOMEM; orphan->inum = inum; diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index b36dc9b032f4..d92aed9fbad7 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -508,7 +508,7 @@ static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, dbg_rcvry("need to fix LEB %d start %d endpt %d", lnum, start, sleb->endpt); - ucleb = kzalloc(sizeof(struct ubifs_unclean_leb), GFP_NOFS); + ucleb = kzalloc_obj(struct ubifs_unclean_leb, GFP_NOFS); if (!ucleb) return -ENOMEM; ucleb->lnum = lnum; @@ -1258,7 +1258,7 @@ static int add_ino(struct ubifs_info *c, ino_t inum, loff_t i_size, p = &(*p)->rb_right; } - e = kzalloc(sizeof(struct size_entry), GFP_KERNEL); + e = kzalloc_obj(struct size_entry, GFP_KERNEL); if (!e) return -ENOMEM; diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index a950c5f2560e..7e5435dab283 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -393,7 +393,7 @@ static int insert_node(struct ubifs_info *c, int lnum, int offs, int len, if (key_inum(c, key) >= c->highest_inum) c->highest_inum = key_inum(c, key); - r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); + r = kzalloc_obj(struct replay_entry, GFP_KERNEL); if (!r) return -ENOMEM; @@ -443,7 +443,7 @@ static int insert_dent(struct ubifs_info *c, int lnum, int offs, int len, if (key_inum(c, key) >= c->highest_inum) c->highest_inum = key_inum(c, key); - r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); + r = kzalloc_obj(struct replay_entry, GFP_KERNEL); if (!r) return -ENOMEM; @@ -897,11 +897,11 @@ static int add_replay_bud(struct ubifs_info *c, int lnum, int offs, int jhead, dbg_mnt("add replay bud LEB %d:%d, head %d", lnum, offs, jhead); - bud = kmalloc(sizeof(struct ubifs_bud), GFP_KERNEL); + bud = kmalloc_obj(struct ubifs_bud, GFP_KERNEL); if (!bud) return -ENOMEM; - b = kmalloc(sizeof(struct bud_entry), GFP_KERNEL); + b = kmalloc_obj(struct bud_entry, GFP_KERNEL); if (!b) { err = -ENOMEM; goto out; diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 84a9157dcc32..cbff2d800e27 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -130,7 +130,7 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, dbg_scan("scan LEB %d:%d", lnum, offs); - sleb = kzalloc(sizeof(struct ubifs_scan_leb), GFP_NOFS); + sleb = kzalloc_obj(struct ubifs_scan_leb, GFP_NOFS); if (!sleb) return ERR_PTR(-ENOMEM); @@ -185,7 +185,7 @@ int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, struct ubifs_ino_node *ino = buf; struct ubifs_scan_node *snod; - snod = kmalloc(sizeof(struct ubifs_scan_node), GFP_NOFS); + snod = kmalloc_obj(struct ubifs_scan_node, GFP_NOFS); if (!snod) return -ENOMEM; diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index f453c37cee37..b86b65fcd615 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -208,7 +208,7 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum) dev_t rdev; union ubifs_dev_desc *dev; - ui->data = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); + ui->data = kmalloc_obj(union ubifs_dev_desc, GFP_NOFS); if (!ui->data) { err = -ENOMEM; goto out_ino; @@ -819,8 +819,7 @@ static int alloc_wbufs(struct ubifs_info *c) { int i, err; - c->jheads = kcalloc(c->jhead_cnt, sizeof(struct ubifs_jhead), - GFP_KERNEL); + c->jheads = kzalloc_objs(struct ubifs_jhead, c->jhead_cnt, GFP_KERNEL); if (!c->jheads) return -ENOMEM; @@ -1246,8 +1245,7 @@ static int mount_ubifs(struct ubifs_info *c) * never exceed 64. */ err = -ENOMEM; - c->bottom_up_buf = kmalloc_array(BOTTOM_UP_HEIGHT, sizeof(int), - GFP_KERNEL); + c->bottom_up_buf = kmalloc_objs(int, BOTTOM_UP_HEIGHT, GFP_KERNEL); if (!c->bottom_up_buf) goto out_free; @@ -2083,7 +2081,7 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) { struct ubifs_info *c; - c = kzalloc(sizeof(struct ubifs_info), GFP_KERNEL); + c = kzalloc_obj(struct ubifs_info, GFP_KERNEL); if (c) { spin_lock_init(&c->cnt_lock); spin_lock_init(&c->cs_lock); @@ -2336,7 +2334,7 @@ static int ubifs_init_fs_context(struct fs_context *fc) { struct ubifs_fs_context *ctx; - ctx = kzalloc(sizeof(struct ubifs_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct ubifs_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c index aae32222f11b..1c926e865be3 100644 --- a/fs/ubifs/sysfs.c +++ b/fs/ubifs/sysfs.c @@ -93,7 +93,7 @@ int ubifs_sysfs_register(struct ubifs_info *c) int ret, n; char dfs_dir_name[UBIFS_DFS_DIR_LEN]; - c->stats = kzalloc(sizeof(struct ubifs_stats_info), GFP_KERNEL); + c->stats = kzalloc_obj(struct ubifs_stats_info, GFP_KERNEL); if (!c->stats) { ret = -ENOMEM; goto out_last; diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index 33946b518148..694b08d27d7d 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -99,7 +99,7 @@ static int insert_old_idx(struct ubifs_info *c, int lnum, int offs) { struct ubifs_old_idx *old_idx; - old_idx = kmalloc(sizeof(struct ubifs_old_idx), GFP_NOFS); + old_idx = kmalloc_obj(struct ubifs_old_idx, GFP_NOFS); if (unlikely(!old_idx)) return -ENOMEM; old_idx->lnum = lnum; @@ -294,7 +294,7 @@ static struct ubifs_znode *dirty_cow_znode(struct ubifs_info *c, if (zbr->len) { struct ubifs_old_idx *old_idx; - old_idx = kmalloc(sizeof(struct ubifs_old_idx), GFP_NOFS); + old_idx = kmalloc_obj(struct ubifs_old_idx, GFP_NOFS); if (unlikely(!old_idx)) { err = -ENOMEM; goto out; @@ -1134,9 +1134,8 @@ static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c, ubifs_assert(c, znode); if (c->zroot.znode->level > BOTTOM_UP_HEIGHT) { kfree(c->bottom_up_buf); - c->bottom_up_buf = kmalloc_array(c->zroot.znode->level, - sizeof(int), - GFP_NOFS); + c->bottom_up_buf = kmalloc_objs(int, c->zroot.znode->level, + GFP_NOFS); if (!c->bottom_up_buf) return ERR_PTR(-ENOMEM); path = c->bottom_up_buf; diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c index 7c43e0ccf6d4..7bf2672062a2 100644 --- a/fs/ubifs/tnc_commit.c +++ b/fs/ubifs/tnc_commit.c @@ -359,8 +359,7 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt) dbg_gc("%d znodes to write", cnt); - c->gap_lebs = kmalloc_array(c->lst.idx_lebs + 1, sizeof(int), - GFP_NOFS); + c->gap_lebs = kmalloc_objs(int, c->lst.idx_lebs + 1, GFP_NOFS); if (!c->gap_lebs) return -ENOMEM; @@ -692,7 +691,7 @@ static int alloc_idx_lebs(struct ubifs_info *c, int cnt) dbg_cmt("need about %d empty LEBS for TNC commit", leb_cnt); if (!leb_cnt) return 0; - c->ilebs = kmalloc_array(leb_cnt, sizeof(int), GFP_NOFS); + c->ilebs = kmalloc_objs(int, leb_cnt, GFP_NOFS); if (!c->ilebs) return -ENOMEM; for (i = 0; i < leb_cnt; i++) { diff --git a/fs/udf/super.c b/fs/udf/super.c index b2f168b0a0d1..365cb78097d3 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -270,7 +270,7 @@ static int udf_init_fs_context(struct fs_context *fc) { struct udf_options *uopt; - uopt = kzalloc(sizeof(*uopt), GFP_KERNEL); + uopt = kzalloc_obj(*uopt, GFP_KERNEL); if (!uopt) return -ENOMEM; @@ -320,7 +320,7 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count) { struct udf_sb_info *sbi = UDF_SB(sb); - sbi->s_partmaps = kcalloc(count, sizeof(*sbi->s_partmaps), GFP_KERNEL); + sbi->s_partmaps = kzalloc_objs(*sbi->s_partmaps, count, GFP_KERNEL); if (!sbi->s_partmaps) { sbi->s_partitions = 0; return -ENOMEM; @@ -1047,8 +1047,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) struct udf_bitmap *bitmap; int nr_groups = udf_compute_nr_groups(sb, index); - bitmap = kvzalloc(struct_size(bitmap, s_block_bitmap, nr_groups), - GFP_KERNEL); + bitmap = kvzalloc_flex(*bitmap, s_block_bitmap, nr_groups, GFP_KERNEL); if (!bitmap) return NULL; @@ -1697,7 +1696,7 @@ static struct udf_vds_record *handle_partition_descriptor( struct part_desc_seq_scan_data *new_loc; unsigned int new_size = ALIGN(partnum, PART_DESC_ALLOC_STEP); - new_loc = kcalloc(new_size, sizeof(*new_loc), GFP_KERNEL); + new_loc = kzalloc_objs(*new_loc, new_size, GFP_KERNEL); if (!new_loc) return ERR_PTR(-ENOMEM); memcpy(new_loc, data->part_descs_loc, @@ -1757,9 +1756,8 @@ static noinline int udf_process_sequence( memset(data.vds, 0, sizeof(struct udf_vds_record) * VDS_POS_LENGTH); data.size_part_descs = PART_DESC_ALLOC_STEP; data.num_part_descs = 0; - data.part_descs_loc = kcalloc(data.size_part_descs, - sizeof(*data.part_descs_loc), - GFP_KERNEL); + data.part_descs_loc = kzalloc_objs(*data.part_descs_loc, + data.size_part_descs, GFP_KERNEL); if (!data.part_descs_loc) return -ENOMEM; @@ -2158,7 +2156,7 @@ static int udf_fill_super(struct super_block *sb, struct fs_context *fc) bool lvid_open = false; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 6e4585169f94..2937221f7942 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -483,8 +483,7 @@ static int ufs_read_cylinder_structures(struct super_block *sb) * Read cylinder group (we read only first fragment from block * at this time) and prepare internal data structures for cg caching. */ - sbi->s_ucg = kmalloc_array(uspi->s_ncg, sizeof(struct buffer_head *), - GFP_NOFS); + sbi->s_ucg = kmalloc_objs(struct buffer_head *, uspi->s_ncg, GFP_NOFS); if (!sbi->s_ucg) goto failed; for (i = 0; i < uspi->s_ncg; i++) @@ -503,7 +502,7 @@ static int ufs_read_cylinder_structures(struct super_block *sb) ufs_print_cylinder_stuff(sb, (struct ufs_cylinder_group *) sbi->s_ucg[i]->b_data); } for (i = 0; i < UFS_MAX_GROUP_LOADED; i++) { - if (!(sbi->s_ucpi[i] = kmalloc (sizeof(struct ufs_cg_private_info), GFP_NOFS))) + if (!(sbi->s_ucpi[i] = kmalloc_obj(struct ufs_cg_private_info, GFP_NOFS))) goto failed; sbi->s_cgno[i] = UFS_CGNO_EMPTY; } @@ -744,7 +743,7 @@ static int ufs_fill_super(struct super_block *sb, struct fs_context *fc) } #endif - sbi = kzalloc(sizeof(struct ufs_sb_info), GFP_KERNEL); + sbi = kzalloc_obj(struct ufs_sb_info, GFP_KERNEL); if (!sbi) goto failed_nomem; sb->s_fs_info = sbi; @@ -769,7 +768,7 @@ static int ufs_fill_super(struct super_block *sb, struct fs_context *fc) sbi->s_flavour = UFS_MOUNT_UFSTYPE_OLD; } - uspi = kzalloc(sizeof(struct ufs_sb_private_info), GFP_KERNEL); + uspi = kzalloc_obj(struct ufs_sb_private_info, GFP_KERNEL); sbi->s_uspi = uspi; if (!uspi) goto failed; @@ -1438,7 +1437,7 @@ static int ufs_init_fs_context(struct fs_context *fc) { struct ufs_fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/ufs/util.c b/fs/ufs/util.c index f0e906ab4ddd..034b1d82c355 100644 --- a/fs/ufs/util.c +++ b/fs/ufs/util.c @@ -27,7 +27,7 @@ struct ufs_buffer_head * _ubh_bread_ (struct ufs_sb_private_info * uspi, count = size >> uspi->s_fshift; if (count > UFS_MAXFRAG) return NULL; - ubh = kmalloc (sizeof (struct ufs_buffer_head), GFP_NOFS); + ubh = kmalloc_obj(struct ufs_buffer_head, GFP_NOFS); if (!ubh) return NULL; ubh->fragment = fragment; diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c index 6fc9ab8667e6..3755b8067ad3 100644 --- a/fs/unicode/utf8-core.c +++ b/fs/unicode/utf8-core.c @@ -176,7 +176,7 @@ struct unicode_map *utf8_load(unsigned int version) { struct unicode_map *um; - um = kzalloc(sizeof(struct unicode_map), GFP_KERNEL); + um = kzalloc_obj(struct unicode_map, GFP_KERNEL); if (!um) return ERR_PTR(-ENOMEM); um->version = version; diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index c5ba1f4487bd..e90c4a762917 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -653,7 +653,7 @@ int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs) } if (!ctx) { - fctx = kmalloc(sizeof(*fctx), GFP_KERNEL); + fctx = kmalloc_obj(*fctx, GFP_KERNEL); if (!fctx) return -ENOMEM; @@ -840,7 +840,7 @@ int userfaultfd_unmap_prep(struct vm_area_struct *vma, unsigned long start, has_unmap_ctx(ctx, unmaps, start, end)) return 0; - unmap_ctx = kzalloc(sizeof(*unmap_ctx), GFP_KERNEL); + unmap_ctx = kzalloc_obj(*unmap_ctx, GFP_KERNEL); if (!unmap_ctx) return -ENOMEM; diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c index 111752010edb..174ede512d30 100644 --- a/fs/vboxsf/file.c +++ b/fs/vboxsf/file.c @@ -26,7 +26,7 @@ struct vboxsf_handle *vboxsf_create_sf_handle(struct inode *inode, struct vboxsf_inode *sf_i = VBOXSF_I(inode); struct vboxsf_handle *sf_handle; - sf_handle = kmalloc(sizeof(*sf_handle), GFP_KERNEL); + sf_handle = kmalloc_obj(*sf_handle, GFP_KERNEL); if (!sf_handle) return ERR_PTR(-ENOMEM); diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c index 241647b060ee..fe048ab05c48 100644 --- a/fs/vboxsf/super.c +++ b/fs/vboxsf/super.c @@ -122,7 +122,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) if (!fc->source) return -EINVAL; - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -427,7 +427,7 @@ static int vboxsf_init_fs_context(struct fs_context *fc) { struct vboxsf_fs_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index 9515bbf0b54c..b95c1e42d073 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -478,7 +478,7 @@ static struct vboxsf_dir_buf *vboxsf_dir_buf_alloc(struct list_head *list) { struct vboxsf_dir_buf *b; - b = kmalloc(sizeof(*b), GFP_KERNEL); + b = kmalloc_obj(*b, GFP_KERNEL); if (!b) return NULL; @@ -507,7 +507,7 @@ struct vboxsf_dir_info *vboxsf_dir_info_alloc(void) { struct vboxsf_dir_info *p; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return NULL; diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c index 586918ed1cbf..759da639d386 100644 --- a/fs/xfs/libxfs/xfs_ag.c +++ b/fs/xfs/libxfs/xfs_ag.c @@ -224,7 +224,7 @@ xfs_perag_alloc( struct xfs_perag *pag; int error; - pag = kzalloc(sizeof(*pag), GFP_KERNEL); + pag = kzalloc_obj(*pag, GFP_KERNEL); if (!pag) return -ENOMEM; diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c index c39e40dcb0b0..472c261163ed 100644 --- a/fs/xfs/libxfs/xfs_defer.c +++ b/fs/xfs/libxfs/xfs_defer.c @@ -982,7 +982,7 @@ xfs_defer_ops_capture( return ERR_PTR(error); /* Create an object to capture the defer ops. */ - dfc = kzalloc(sizeof(*dfc), GFP_KERNEL | __GFP_NOFAIL); + dfc = kzalloc_obj(*dfc, GFP_KERNEL | __GFP_NOFAIL); INIT_LIST_HEAD(&dfc->dfc_list); INIT_LIST_HEAD(&dfc->dfc_dfops); diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 107c1a5b8a96..495620cc001f 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c @@ -116,10 +116,10 @@ xfs_da_mount( ASSERT(mp->m_sb.sb_versionnum & XFS_SB_VERSION_DIRV2BIT); ASSERT(xfs_dir2_dirblock_bytes(&mp->m_sb) <= XFS_MAX_BLOCKSIZE); - mp->m_dir_geo = kzalloc(sizeof(struct xfs_da_geometry), - GFP_KERNEL | __GFP_RETRY_MAYFAIL); - mp->m_attr_geo = kzalloc(sizeof(struct xfs_da_geometry), - GFP_KERNEL | __GFP_RETRY_MAYFAIL); + mp->m_dir_geo = kzalloc_obj(struct xfs_da_geometry, + GFP_KERNEL | __GFP_RETRY_MAYFAIL); + mp->m_attr_geo = kzalloc_obj(struct xfs_da_geometry, + GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!mp->m_dir_geo || !mp->m_attr_geo) { kfree(mp->m_dir_geo); kfree(mp->m_attr_geo); @@ -248,7 +248,7 @@ xfs_dir_init( if (error) return error; - args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); + args = kzalloc_obj(*args, GFP_KERNEL | __GFP_NOFAIL); if (!args) return -ENOMEM; @@ -341,7 +341,7 @@ xfs_dir_createname( XFS_STATS_INC(dp->i_mount, xs_dir_create); } - args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); + args = kzalloc_obj(*args, GFP_KERNEL | __GFP_NOFAIL); if (!args) return -ENOMEM; @@ -437,8 +437,7 @@ xfs_dir_lookup( ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_lookup); - args = kzalloc(sizeof(*args), - GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); + args = kzalloc_obj(*args, GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); args->geo = dp->i_mount->m_dir_geo; args->name = name->name; args->namelen = name->len; @@ -503,7 +502,7 @@ xfs_dir_removename( ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_remove); - args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); + args = kzalloc_obj(*args, GFP_KERNEL | __GFP_NOFAIL); if (!args) return -ENOMEM; @@ -563,7 +562,7 @@ xfs_dir_replace( if (rval) return rval; - args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); + args = kzalloc_obj(*args, GFP_KERNEL | __GFP_NOFAIL); if (!args) return -ENOMEM; diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c index 915ec85530e7..40c7f0ff6cf3 100644 --- a/fs/xfs/libxfs/xfs_refcount.c +++ b/fs/xfs/libxfs/xfs_refcount.c @@ -2033,8 +2033,8 @@ xfs_refcount_recover_extent( return -EFSCORRUPTED; } - rr = kmalloc(sizeof(struct xfs_refcount_recovery), - GFP_KERNEL | __GFP_NOFAIL); + rr = kmalloc_obj(struct xfs_refcount_recovery, + GFP_KERNEL | __GFP_NOFAIL); INIT_LIST_HEAD(&rr->rr_list); xfs_refcount_btrec_to_irec(rec, &rr->rr_rrec); diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c index 09328f2d1575..3b7f4819b85b 100644 --- a/fs/xfs/libxfs/xfs_rtgroup.c +++ b/fs/xfs/libxfs/xfs_rtgroup.c @@ -98,7 +98,7 @@ xfs_rtgroup_alloc( struct xfs_rtgroup *rtg; int error; - rtg = kzalloc(sizeof(struct xfs_rtgroup), GFP_KERNEL); + rtg = kzalloc_obj(struct xfs_rtgroup, GFP_KERNEL); if (!rtg) return -ENOMEM; diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c index 7ffe4b0ef0f1..9ed053b5f061 100644 --- a/fs/xfs/scrub/agheader.c +++ b/fs/xfs/scrub/agheader.c @@ -816,8 +816,8 @@ xchk_agfl( xchk_block_set_corrupt(sc, sc->sa.agf_bp); goto out; } - sai.entries = kvcalloc(sai.agflcount, sizeof(xfs_agblock_t), - XCHK_GFP_FLAGS); + sai.entries = kvzalloc_objs(xfs_agblock_t, sai.agflcount, + XCHK_GFP_FLAGS); if (!sai.entries) { error = -ENOMEM; goto out; diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c index 15d58eedb387..ae9ed5f280d0 100644 --- a/fs/xfs/scrub/agheader_repair.c +++ b/fs/xfs/scrub/agheader_repair.c @@ -1719,7 +1719,7 @@ xrep_agi( if (!xfs_has_rmapbt(mp)) return -EOPNOTSUPP; - sc->buf = kzalloc(sizeof(struct xrep_agi), XCHK_GFP_FLAGS); + sc->buf = kzalloc_obj(struct xrep_agi, XCHK_GFP_FLAGS); if (!sc->buf) return -ENOMEM; ragi = sc->buf; diff --git a/fs/xfs/scrub/alloc_repair.c b/fs/xfs/scrub/alloc_repair.c index 5b4c2a39a155..dce6ab0429dc 100644 --- a/fs/xfs/scrub/alloc_repair.c +++ b/fs/xfs/scrub/alloc_repair.c @@ -856,7 +856,7 @@ xrep_allocbt( if (!xfs_has_rmapbt(mp)) return -EOPNOTSUPP; - ra = kzalloc(sizeof(struct xrep_abt), XCHK_GFP_FLAGS); + ra = kzalloc_obj(struct xrep_abt, XCHK_GFP_FLAGS); if (!ra) return -ENOMEM; ra->sc = sc; diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c index c3c122ea2d32..390ac2e11ee0 100644 --- a/fs/xfs/scrub/attr.c +++ b/fs/xfs/scrub/attr.c @@ -85,7 +85,7 @@ xchk_setup_xattr_buf( if (ab) goto resize_value; - ab = kvzalloc(sizeof(struct xchk_xattr_buf), XCHK_GFP_FLAGS); + ab = kvzalloc_obj(struct xchk_xattr_buf, XCHK_GFP_FLAGS); if (!ab) return -ENOMEM; sc->buf = ab; diff --git a/fs/xfs/scrub/attr_repair.c b/fs/xfs/scrub/attr_repair.c index a924b467a844..7d00a1ce0bac 100644 --- a/fs/xfs/scrub/attr_repair.c +++ b/fs/xfs/scrub/attr_repair.c @@ -1534,7 +1534,7 @@ xrep_xattr_setup_scan( int max_len; int error; - rx = kzalloc(sizeof(struct xrep_xattr), XCHK_GFP_FLAGS); + rx = kzalloc_obj(struct xrep_xattr, XCHK_GFP_FLAGS); if (!rx) return -ENOMEM; rx->sc = sc; diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c index 51f3171bc6c8..c7fa908d92b2 100644 --- a/fs/xfs/scrub/bitmap.c +++ b/fs/xfs/scrub/bitmap.c @@ -87,8 +87,8 @@ xbitmap64_clear( xbitmap64_tree_insert(bn, &bitmap->xb_root); /* add an extent */ - new_bn = kmalloc(sizeof(struct xbitmap64_node), - XCHK_GFP_FLAGS); + new_bn = kmalloc_obj(struct xbitmap64_node, + XCHK_GFP_FLAGS); if (!new_bn) return -ENOMEM; new_bn->bn_start = last + 1; @@ -164,7 +164,7 @@ xbitmap64_set( xbitmap64_tree_insert(right, &bitmap->xb_root); } else { /* add an extent */ - left = kmalloc(sizeof(struct xbitmap64_node), XCHK_GFP_FLAGS); + left = kmalloc_obj(struct xbitmap64_node, XCHK_GFP_FLAGS); if (!left) return -ENOMEM; left->bn_start = start; @@ -362,8 +362,8 @@ xbitmap32_clear( xbitmap32_tree_insert(bn, &bitmap->xb_root); /* add an extent */ - new_bn = kmalloc(sizeof(struct xbitmap32_node), - XCHK_GFP_FLAGS); + new_bn = kmalloc_obj(struct xbitmap32_node, + XCHK_GFP_FLAGS); if (!new_bn) return -ENOMEM; new_bn->bn_start = last + 1; @@ -439,7 +439,7 @@ xbitmap32_set( xbitmap32_tree_insert(right, &bitmap->xb_root); } else { /* add an extent */ - left = kmalloc(sizeof(struct xbitmap32_node), XCHK_GFP_FLAGS); + left = kmalloc_obj(struct xbitmap32_node, XCHK_GFP_FLAGS); if (!left) return -ENOMEM; left->bn_start = start; diff --git a/fs/xfs/scrub/bmap_repair.c b/fs/xfs/scrub/bmap_repair.c index 0a83d5845379..822a4af43833 100644 --- a/fs/xfs/scrub/bmap_repair.c +++ b/fs/xfs/scrub/bmap_repair.c @@ -933,7 +933,7 @@ xrep_bmap( if (error) return error; - rb = kzalloc(sizeof(struct xrep_bmap), XCHK_GFP_FLAGS); + rb = kzalloc_obj(struct xrep_bmap, XCHK_GFP_FLAGS); if (!rb) return -ENOMEM; rb->sc = sc; diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c index 1089b1f4c5df..786b1e7c4dc3 100644 --- a/fs/xfs/scrub/btree.c +++ b/fs/xfs/scrub/btree.c @@ -449,7 +449,7 @@ xchk_btree_check_owner( if (xfs_btree_is_bno(cur->bc_ops) || xfs_btree_is_rmap(cur->bc_ops)) { struct check_owner *co; - co = kmalloc(sizeof(struct check_owner), XCHK_GFP_FLAGS); + co = kmalloc_obj(struct check_owner, XCHK_GFP_FLAGS); if (!co) return -ENOMEM; diff --git a/fs/xfs/scrub/cow_repair.c b/fs/xfs/scrub/cow_repair.c index 33749cf43520..bffc4666ce60 100644 --- a/fs/xfs/scrub/cow_repair.c +++ b/fs/xfs/scrub/cow_repair.c @@ -685,7 +685,7 @@ xrep_bmap_cow( return 0; } - xc = kzalloc(sizeof(struct xrep_cow), XCHK_GFP_FLAGS); + xc = kzalloc_obj(struct xrep_cow, XCHK_GFP_FLAGS); if (!xc) return -ENOMEM; diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c index 5858d4d5e279..1a71d36898b1 100644 --- a/fs/xfs/scrub/dabtree.c +++ b/fs/xfs/scrub/dabtree.c @@ -512,7 +512,7 @@ xchk_da_btree( return 0; /* Set up initial da state. */ - ds = kzalloc(sizeof(struct xchk_da_btree), XCHK_GFP_FLAGS); + ds = kzalloc_obj(struct xchk_da_btree, XCHK_GFP_FLAGS); if (!ds) return -ENOMEM; ds->dargs.dp = sc->ip; diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c index 91228623d016..e09724cd3725 100644 --- a/fs/xfs/scrub/dir.c +++ b/fs/xfs/scrub/dir.c @@ -1095,7 +1095,7 @@ xchk_directory( if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) return 0; - sd = kvzalloc(sizeof(struct xchk_dir), XCHK_GFP_FLAGS); + sd = kvzalloc_obj(struct xchk_dir, XCHK_GFP_FLAGS); if (!sd) return -ENOMEM; sd->sc = sc; diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c index f105e49f654b..9dc55c918c78 100644 --- a/fs/xfs/scrub/dir_repair.c +++ b/fs/xfs/scrub/dir_repair.c @@ -198,7 +198,7 @@ xrep_setup_directory( if (error) return error; - rd = kvzalloc(sizeof(struct xrep_dir), XCHK_GFP_FLAGS); + rd = kvzalloc_obj(struct xrep_dir, XCHK_GFP_FLAGS); if (!rd) return -ENOMEM; rd->sc = sc; diff --git a/fs/xfs/scrub/dirtree.c b/fs/xfs/scrub/dirtree.c index e95dc74f1145..143114718d75 100644 --- a/fs/xfs/scrub/dirtree.c +++ b/fs/xfs/scrub/dirtree.c @@ -106,7 +106,7 @@ xchk_setup_dirtree( return error; } - dl = kvzalloc(sizeof(struct xchk_dirtree), XCHK_GFP_FLAGS); + dl = kvzalloc_obj(struct xchk_dirtree, XCHK_GFP_FLAGS); if (!dl) return -ENOMEM; dl->sc = sc; @@ -238,7 +238,7 @@ xchk_dirtree_create_path( * Create a new xchk_path structure to remember this parent pointer * and record the first name step. */ - path = kmalloc(sizeof(struct xchk_dirpath), XCHK_GFP_FLAGS); + path = kmalloc_obj(struct xchk_dirpath, XCHK_GFP_FLAGS); if (!path) return -ENOMEM; diff --git a/fs/xfs/scrub/dirtree_repair.c b/fs/xfs/scrub/dirtree_repair.c index 019feaf0d606..bcfbbf5efc6c 100644 --- a/fs/xfs/scrub/dirtree_repair.c +++ b/fs/xfs/scrub/dirtree_repair.c @@ -567,7 +567,7 @@ xrep_dirtree_create_adoption_path( * Create a new xchk_path structure to remember this parent pointer * and record the first name step. */ - path = kmalloc(sizeof(struct xchk_dirpath), XCHK_GFP_FLAGS); + path = kmalloc_obj(struct xchk_dirpath, XCHK_GFP_FLAGS); if (!path) return -ENOMEM; diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c index b35f65b537ba..916699f3da7b 100644 --- a/fs/xfs/scrub/fscounters.c +++ b/fs/xfs/scrub/fscounters.c @@ -207,7 +207,7 @@ xchk_setup_fscounters( if (!xfs_has_lazysbcount(sc->mp)) xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); - sc->buf = kzalloc(sizeof(struct xchk_fscounters), XCHK_GFP_FLAGS); + sc->buf = kzalloc_obj(struct xchk_fscounters, XCHK_GFP_FLAGS); if (!sc->buf) return -ENOMEM; sc->buf_cleanup = xchk_fscounters_cleanup; diff --git a/fs/xfs/scrub/ialloc_repair.c b/fs/xfs/scrub/ialloc_repair.c index 9b63b9d19e1b..608c7022ac15 100644 --- a/fs/xfs/scrub/ialloc_repair.c +++ b/fs/xfs/scrub/ialloc_repair.c @@ -804,7 +804,7 @@ xrep_iallocbt( if (!xfs_has_rmapbt(mp)) return -EOPNOTSUPP; - ri = kzalloc(sizeof(struct xrep_ibt), XCHK_GFP_FLAGS); + ri = kzalloc_obj(struct xrep_ibt, XCHK_GFP_FLAGS); if (!ri) return -ENOMEM; ri->sc = sc; diff --git a/fs/xfs/scrub/inode_repair.c b/fs/xfs/scrub/inode_repair.c index bf182a18f115..9738b9ce3f2d 100644 --- a/fs/xfs/scrub/inode_repair.c +++ b/fs/xfs/scrub/inode_repair.c @@ -151,7 +151,7 @@ xrep_setup_inode( { struct xrep_inode *ri; - sc->buf = kzalloc(sizeof(struct xrep_inode), XCHK_GFP_FLAGS); + sc->buf = kzalloc_obj(struct xrep_inode, XCHK_GFP_FLAGS); if (!sc->buf) return -ENOMEM; diff --git a/fs/xfs/scrub/metapath.c b/fs/xfs/scrub/metapath.c index 3d9de59c1758..050b86eb12d3 100644 --- a/fs/xfs/scrub/metapath.c +++ b/fs/xfs/scrub/metapath.c @@ -102,7 +102,7 @@ xchk_setup_metapath_scan( return error; } - mpath = kzalloc(sizeof(struct xchk_metapath), XCHK_GFP_FLAGS); + mpath = kzalloc_obj(struct xchk_metapath, XCHK_GFP_FLAGS); if (!mpath) { kfree_const(path); return -ENOMEM; diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c index 43e868f829aa..2e4981c1baf2 100644 --- a/fs/xfs/scrub/newbt.c +++ b/fs/xfs/scrub/newbt.c @@ -195,7 +195,7 @@ xrep_newbt_add_blocks( struct xrep_newbt_resv *resv; int error; - resv = kmalloc(sizeof(struct xrep_newbt_resv), XCHK_GFP_FLAGS); + resv = kmalloc_obj(struct xrep_newbt_resv, XCHK_GFP_FLAGS); if (!resv) return -ENOMEM; diff --git a/fs/xfs/scrub/nlinks.c b/fs/xfs/scrub/nlinks.c index e80fe7395d78..1e0effdb65a6 100644 --- a/fs/xfs/scrub/nlinks.c +++ b/fs/xfs/scrub/nlinks.c @@ -58,7 +58,7 @@ xchk_setup_nlinks( return error; } - xnc = kvzalloc(sizeof(struct xchk_nlink_ctrs), XCHK_GFP_FLAGS); + xnc = kvzalloc_obj(struct xchk_nlink_ctrs, XCHK_GFP_FLAGS); if (!xnc) return -ENOMEM; xnc->xname.name = xnc->namebuf; diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c index 5a259570b154..931604fa1294 100644 --- a/fs/xfs/scrub/parent.c +++ b/fs/xfs/scrub/parent.c @@ -757,7 +757,7 @@ xchk_parent_pptr( struct xchk_pptrs *pp; int error; - pp = kvzalloc(sizeof(struct xchk_pptrs), XCHK_GFP_FLAGS); + pp = kvzalloc_obj(struct xchk_pptrs, XCHK_GFP_FLAGS); if (!pp) return -ENOMEM; pp->sc = sc; diff --git a/fs/xfs/scrub/parent_repair.c b/fs/xfs/scrub/parent_repair.c index 83a8205ae2f1..2ce0cefad362 100644 --- a/fs/xfs/scrub/parent_repair.c +++ b/fs/xfs/scrub/parent_repair.c @@ -217,7 +217,7 @@ xrep_setup_parent( xchk_fsgates_enable(sc, XCHK_FSGATES_DIRENTS); - rp = kvzalloc(sizeof(struct xrep_parent), XCHK_GFP_FLAGS); + rp = kvzalloc_obj(struct xrep_parent, XCHK_GFP_FLAGS); if (!rp) return -ENOMEM; rp->sc = sc; diff --git a/fs/xfs/scrub/quotacheck.c b/fs/xfs/scrub/quotacheck.c index e8cba19334a0..9ea014e2ecfd 100644 --- a/fs/xfs/scrub/quotacheck.c +++ b/fs/xfs/scrub/quotacheck.c @@ -86,7 +86,7 @@ xchk_setup_quotacheck( xchk_fsgates_enable(sc, XCHK_FSGATES_QUOTA); - sc->buf = kzalloc(sizeof(struct xqcheck), XCHK_GFP_FLAGS); + sc->buf = kzalloc_obj(struct xqcheck, XCHK_GFP_FLAGS); if (!sc->buf) return -ENOMEM; @@ -256,7 +256,7 @@ xqcheck_mod_live_ino_dqtrx( dqa = rhashtable_lookup_fast(&xqc->shadow_dquot_acct, &p->tx_id, xqcheck_dqacct_hash_params); if (!dqa) { - dqa = kzalloc(sizeof(struct xqcheck_dqacct), XCHK_GFP_FLAGS); + dqa = kzalloc_obj(struct xqcheck_dqacct, XCHK_GFP_FLAGS); if (!dqa) goto out_abort; diff --git a/fs/xfs/scrub/rcbag.c b/fs/xfs/scrub/rcbag.c index c1a97a073d92..8f3a10f7c908 100644 --- a/fs/xfs/scrub/rcbag.c +++ b/fs/xfs/scrub/rcbag.c @@ -36,7 +36,7 @@ rcbag_init( struct rcbag *bag; int error; - bag = kzalloc(sizeof(struct rcbag), XCHK_GFP_FLAGS); + bag = kzalloc_obj(struct rcbag, XCHK_GFP_FLAGS); if (!bag) return -ENOMEM; diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c index bf87025f24fc..4e1bf23e5b89 100644 --- a/fs/xfs/scrub/refcount.c +++ b/fs/xfs/scrub/refcount.c @@ -142,8 +142,7 @@ xchk_refcountbt_rmap_check( * is healthy each rmap_irec we see will be in agbno order * so we don't need insertion sort here. */ - frag = kmalloc(sizeof(struct xchk_refcnt_frag), - XCHK_GFP_FLAGS); + frag = kmalloc_obj(struct xchk_refcnt_frag, XCHK_GFP_FLAGS); if (!frag) return -ENOMEM; memcpy(&frag->rm, rec, sizeof(frag->rm)); diff --git a/fs/xfs/scrub/refcount_repair.c b/fs/xfs/scrub/refcount_repair.c index 507993e0fb0f..ca9c382005ff 100644 --- a/fs/xfs/scrub/refcount_repair.c +++ b/fs/xfs/scrub/refcount_repair.c @@ -704,7 +704,7 @@ xrep_refcountbt( if (!xfs_has_rmapbt(mp)) return -EOPNOTSUPP; - rr = kzalloc(sizeof(struct xrep_refc), XCHK_GFP_FLAGS); + rr = kzalloc_obj(struct xrep_refc, XCHK_GFP_FLAGS); if (!rr) return -ENOMEM; rr->sc = sc; diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c index 2c25910e2903..0cd3eecd2ca5 100644 --- a/fs/xfs/scrub/rmap.c +++ b/fs/xfs/scrub/rmap.c @@ -548,7 +548,7 @@ xchk_rmapbt( struct xchk_rmap *cr; int error; - cr = kzalloc(sizeof(struct xchk_rmap), XCHK_GFP_FLAGS); + cr = kzalloc_obj(struct xchk_rmap, XCHK_GFP_FLAGS); if (!cr) return -ENOMEM; diff --git a/fs/xfs/scrub/rmap_repair.c b/fs/xfs/scrub/rmap_repair.c index ab7053e25e1c..6766df9922e8 100644 --- a/fs/xfs/scrub/rmap_repair.c +++ b/fs/xfs/scrub/rmap_repair.c @@ -172,7 +172,7 @@ xrep_setup_ag_rmapbt( if (error) return error; - rr = kzalloc(sizeof(struct xrep_rmap), XCHK_GFP_FLAGS); + rr = kzalloc_obj(struct xrep_rmap, XCHK_GFP_FLAGS); if (!rr) return -ENOMEM; diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c index 4bcfd99cec17..b3a4972d423e 100644 --- a/fs/xfs/scrub/rtbitmap.c +++ b/fs/xfs/scrub/rtbitmap.c @@ -41,8 +41,8 @@ xchk_setup_rtbitmap( if (xchk_need_intent_drain(sc)) xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); - rtb = kzalloc(struct_size(rtb, words, xchk_rtbitmap_wordcnt(sc)), - XCHK_GFP_FLAGS); + rtb = kzalloc_flex(*rtb, words, xchk_rtbitmap_wordcnt(sc), + XCHK_GFP_FLAGS); if (!rtb) return -ENOMEM; sc->buf = rtb; diff --git a/fs/xfs/scrub/rtrefcount.c b/fs/xfs/scrub/rtrefcount.c index 8cfe2f120b6b..4951cc271788 100644 --- a/fs/xfs/scrub/rtrefcount.c +++ b/fs/xfs/scrub/rtrefcount.c @@ -156,8 +156,7 @@ xchk_rtrefcountbt_rmap_check( * is healthy each rmap_irec we see will be in agbno order * so we don't need insertion sort here. */ - frag = kmalloc(sizeof(struct xchk_rtrefcnt_frag), - XCHK_GFP_FLAGS); + frag = kmalloc_obj(struct xchk_rtrefcnt_frag, XCHK_GFP_FLAGS); if (!frag) return -ENOMEM; memcpy(&frag->rm, rec, sizeof(frag->rm)); diff --git a/fs/xfs/scrub/rtrefcount_repair.c b/fs/xfs/scrub/rtrefcount_repair.c index f713daf095fb..f165fb397647 100644 --- a/fs/xfs/scrub/rtrefcount_repair.c +++ b/fs/xfs/scrub/rtrefcount_repair.c @@ -709,7 +709,7 @@ xrep_rtrefcountbt( if (error) return error; - rr = kzalloc(sizeof(struct xrep_rtrefc), XCHK_GFP_FLAGS); + rr = kzalloc_obj(struct xrep_rtrefc, XCHK_GFP_FLAGS); if (!rr) return -ENOMEM; rr->sc = sc; diff --git a/fs/xfs/scrub/rtrmap_repair.c b/fs/xfs/scrub/rtrmap_repair.c index 4610d6d80648..f2d16ca8d251 100644 --- a/fs/xfs/scrub/rtrmap_repair.c +++ b/fs/xfs/scrub/rtrmap_repair.c @@ -111,7 +111,7 @@ xrep_setup_rtrmapbt( if (error) return error; - rr = kzalloc(sizeof(struct xrep_rtrmap), XCHK_GFP_FLAGS); + rr = kzalloc_obj(struct xrep_rtrmap, XCHK_GFP_FLAGS); if (!rr) return -ENOMEM; diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c index b510e6bbbd3e..efce39d7a1ef 100644 --- a/fs/xfs/scrub/rtsummary.c +++ b/fs/xfs/scrub/rtsummary.c @@ -49,8 +49,7 @@ xchk_setup_rtsummary( if (xchk_need_intent_drain(sc)) xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); - rts = kvzalloc(struct_size(rts, words, mp->m_blockwsize), - XCHK_GFP_FLAGS); + rts = kvzalloc_flex(*rts, words, mp->m_blockwsize, XCHK_GFP_FLAGS); if (!rts) return -ENOMEM; sc->buf = rts; diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index c1c6415f5055..27511a125b39 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -632,7 +632,7 @@ xchk_scrub_create_subord( { struct xfs_scrub_subord *sub; - sub = kzalloc(sizeof(*sub), XCHK_GFP_FLAGS); + sub = kzalloc_obj(*sub, XCHK_GFP_FLAGS); if (!sub) return NULL; @@ -680,7 +680,7 @@ xfs_scrub_metadata( if (error) goto out; - sc = kzalloc(sizeof(struct xfs_scrub), XCHK_GFP_FLAGS); + sc = kzalloc_obj(struct xfs_scrub, XCHK_GFP_FLAGS); if (!sc) { error = -ENOMEM; goto out; diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c index 4efafc5ae966..8cd018bac5d6 100644 --- a/fs/xfs/scrub/stats.c +++ b/fs/xfs/scrub/stats.c @@ -389,7 +389,7 @@ xchk_mount_stats_alloc( struct xchk_stats *cs; int error; - cs = kvzalloc(sizeof(struct xchk_stats), GFP_KERNEL); + cs = kvzalloc_obj(struct xchk_stats, GFP_KERNEL); if (!cs) return -ENOMEM; diff --git a/fs/xfs/scrub/xfblob.c b/fs/xfs/scrub/xfblob.c index 96fc360312de..84237fb41ccb 100644 --- a/fs/xfs/scrub/xfblob.c +++ b/fs/xfs/scrub/xfblob.c @@ -41,7 +41,7 @@ xfblob_create( if (error) return error; - blob = kmalloc(sizeof(struct xfblob), XCHK_GFP_FLAGS); + blob = kmalloc_obj(struct xfblob, XCHK_GFP_FLAGS); if (!blob) { error = -ENOMEM; goto out_xfile; diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index bee0662fbdb6..05581571854d 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -57,7 +57,7 @@ xfile_create( struct xfile *xf; int error; - xf = kmalloc(sizeof(struct xfile), XCHK_GFP_FLAGS); + xf = kmalloc_obj(struct xfile, XCHK_GFP_FLAGS); if (!xf) return -ENOMEM; diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index db46883991de..d2f3c50d80e7 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -295,8 +295,8 @@ xfs_buf_alloc( if (nmaps == 1) bp->b_maps = &bp->__b_map; else - bp->b_maps = kcalloc(nmaps, sizeof(struct xfs_buf_map), - GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); + bp->b_maps = kzalloc_objs(struct xfs_buf_map, nmaps, + GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); for (i = 0; i < nmaps; i++) { bp->b_maps[i].bm_bn = map[i].bm_bn; bp->b_maps[i].bm_len = map[i].bm_len; @@ -1799,7 +1799,7 @@ xfs_alloc_buftarg( #if defined(CONFIG_FS_DAX) && defined(CONFIG_MEMORY_FAILURE) ops = &xfs_dax_holder_operations; #endif - btp = kzalloc(sizeof(*btp), GFP_KERNEL | __GFP_NOFAIL); + btp = kzalloc_obj(*btp, GFP_KERNEL | __GFP_NOFAIL); btp->bt_mount = mp; btp->bt_file = bdev_file; diff --git a/fs/xfs/xfs_buf_item_recover.c b/fs/xfs/xfs_buf_item_recover.c index 77ad071ebe78..5f391372f188 100644 --- a/fs/xfs/xfs_buf_item_recover.c +++ b/fs/xfs/xfs_buf_item_recover.c @@ -90,7 +90,7 @@ xlog_add_buffer_cancelled( return false; } - bcp = kmalloc(sizeof(struct xfs_buf_cancel), GFP_KERNEL | __GFP_NOFAIL); + bcp = kmalloc_obj(struct xfs_buf_cancel, GFP_KERNEL | __GFP_NOFAIL); bcp->bc_blkno = blkno; bcp->bc_len = len; bcp->bc_refcount = 1; @@ -1180,8 +1180,7 @@ xlog_alloc_buf_cancel_table( ASSERT(log->l_buf_cancel_table == NULL); - p = kmalloc_array(XLOG_BC_TABLE_SIZE, sizeof(struct list_head), - GFP_KERNEL); + p = kmalloc_objs(struct list_head, XLOG_BC_TABLE_SIZE, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/fs/xfs/xfs_buf_mem.c b/fs/xfs/xfs_buf_mem.c index f1f23623e4a4..e0529f380a77 100644 --- a/fs/xfs/xfs_buf_mem.c +++ b/fs/xfs/xfs_buf_mem.c @@ -58,7 +58,7 @@ xmbuf_alloc( struct xfs_buftarg *btp; int error; - btp = kzalloc(struct_size(btp, bt_cache, 1), GFP_KERNEL); + btp = kzalloc_flex(*btp, bt_cache, 1, GFP_KERNEL); if (!btp) return -ENOMEM; diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index 31477a74b523..3ecbb4e0f2c8 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -349,7 +349,7 @@ xfs_trim_perag_extents( do { struct xfs_busy_extents *extents; - extents = kzalloc(sizeof(*extents), GFP_KERNEL); + extents = kzalloc_obj(*extents, GFP_KERNEL); if (!extents) { error = -ENOMEM; break; @@ -537,7 +537,7 @@ xfs_trim_gather_rtextent( return 0; } - busyp = kzalloc(sizeof(struct xfs_rtx_busy), GFP_KERNEL); + busyp = kzalloc_obj(struct xfs_rtx_busy, GFP_KERNEL); if (!busyp) return -ENOMEM; @@ -689,7 +689,7 @@ xfs_trim_rtgroup_extents( * trims the extents returned. */ do { - tr.extents = kzalloc(sizeof(*tr.extents), GFP_KERNEL); + tr.extents = kzalloc_obj(*tr.extents, GFP_KERNEL); if (!tr.extents) { error = -ENOMEM; break; diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c index cfecb2959472..a5f02cac9d31 100644 --- a/fs/xfs/xfs_extent_busy.c +++ b/fs/xfs/xfs_extent_busy.c @@ -41,8 +41,7 @@ xfs_extent_busy_insert_list( struct rb_node **rbp; struct rb_node *parent = NULL; - new = kzalloc(sizeof(struct xfs_extent_busy), - GFP_KERNEL | __GFP_NOFAIL); + new = kzalloc_obj(struct xfs_extent_busy, GFP_KERNEL | __GFP_NOFAIL); new->group = xfs_group_hold(xg); new->bno = bno; new->length = len; @@ -718,7 +717,7 @@ xfs_extent_busy_alloc(void) { struct xfs_extent_busy_tree *eb; - eb = kzalloc(sizeof(*eb), GFP_KERNEL); + eb = kzalloc_obj(*eb, GFP_KERNEL); if (!eb) return NULL; spin_lock_init(&eb->eb_lock); diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index 44e1b14069a3..32e641d76e92 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c @@ -308,7 +308,7 @@ xfs_filestream_create_association( * error for this failure - as long as we return a referenced AG, the * allocation can still go ahead just fine. */ - item = kmalloc(sizeof(*item), GFP_KERNEL | __GFP_RETRY_MAYFAIL); + item = kmalloc_obj(*item, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!item) goto out_put_fstrms; diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 098c2b50bc6f..3724e64898f3 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -1326,11 +1326,11 @@ xfs_ioc_getfsmap( */ count = min_t(unsigned int, head.fmh_count, 131072 / sizeof(struct fsmap)); - recs = kvcalloc(count, sizeof(struct fsmap), GFP_KERNEL); + recs = kvzalloc_objs(struct fsmap, count, GFP_KERNEL); if (!recs) { count = min_t(unsigned int, head.fmh_count, PAGE_SIZE / sizeof(struct fsmap)); - recs = kvcalloc(count, sizeof(struct fsmap), GFP_KERNEL); + recs = kvzalloc_objs(struct fsmap, count, GFP_KERNEL); if (!recs) return -ENOMEM; } diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c index ca7352dcd182..757a4213b2d0 100644 --- a/fs/xfs/xfs_healthmon.c +++ b/fs/xfs/xfs_healthmon.c @@ -1187,7 +1187,7 @@ xfs_ioc_health_monitor( if (!xfs_healthmon_validate(&hmo)) return -EINVAL; - hm = kzalloc(sizeof(*hm), GFP_KERNEL); + hm = kzalloc_obj(*hm, GFP_KERNEL); if (!hm) return -ENOMEM; hm->dev = mp->m_super->s_dev; @@ -1200,7 +1200,7 @@ xfs_ioc_health_monitor( hm->verbose = true; /* Queue up the first event that lets the client know we're running. */ - running_event = kzalloc(sizeof(struct xfs_healthmon_event), GFP_NOFS); + running_event = kzalloc_obj(struct xfs_healthmon_event, GFP_NOFS); if (!running_event) { ret = -ENOMEM; goto out_hm; @@ -1214,8 +1214,7 @@ xfs_ioc_health_monitor( * filesystem later. This is key for triggering fast exit of the * xfs_healer daemon. */ - hm->unmount_event = kzalloc(sizeof(struct xfs_healthmon_event), - GFP_NOFS); + hm->unmount_event = kzalloc_obj(struct xfs_healthmon_event, GFP_NOFS); if (!hm->unmount_event) { ret = -ENOMEM; goto out_hm; diff --git a/fs/xfs/xfs_inode_item_recover.c b/fs/xfs/xfs_inode_item_recover.c index 5d93228783eb..b42106c4a9ef 100644 --- a/fs/xfs/xfs_inode_item_recover.c +++ b/fs/xfs/xfs_inode_item_recover.c @@ -329,8 +329,8 @@ xlog_recover_inode_commit_pass2( if (item->ri_buf[0].iov_len == sizeof(struct xfs_inode_log_format)) { in_f = item->ri_buf[0].iov_base; } else { - in_f = kmalloc(sizeof(struct xfs_inode_log_format), - GFP_KERNEL | __GFP_NOFAIL); + in_f = kmalloc_obj(struct xfs_inode_log_format, + GFP_KERNEL | __GFP_NOFAIL); need_free = 1; error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f); if (error) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 4eeda4d4e3ab..1074e36fa240 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -896,7 +896,7 @@ xfs_ioc_getbmap( if (bmx.bmv_count >= INT_MAX / recsize) return -ENOMEM; - buf = kvcalloc(bmx.bmv_count, sizeof(*buf), GFP_KERNEL); + buf = kvzalloc_objs(*buf, bmx.bmv_count, GFP_KERNEL); if (!buf) return -ENOMEM; diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 9faff287f747..97f106d2b4cd 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -230,8 +230,8 @@ xfs_bulkstat_one( ASSERT(breq->icount == 1); - bc.buf = kzalloc(sizeof(struct xfs_bulkstat), - GFP_KERNEL | __GFP_RETRY_MAYFAIL); + bc.buf = kzalloc_obj(struct xfs_bulkstat, + GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!bc.buf) return -ENOMEM; @@ -317,8 +317,8 @@ xfs_bulkstat( if (xfs_bulkstat_already_done(breq->mp, breq->startino)) return 0; - bc.buf = kzalloc(sizeof(struct xfs_bulkstat), - GFP_KERNEL | __GFP_RETRY_MAYFAIL); + bc.buf = kzalloc_obj(struct xfs_bulkstat, + GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!bc.buf) return -ENOMEM; diff --git a/fs/xfs/xfs_iwalk.c b/fs/xfs/xfs_iwalk.c index ed4033006868..96a4cb3360bc 100644 --- a/fs/xfs/xfs_iwalk.c +++ b/fs/xfs/xfs_iwalk.c @@ -659,8 +659,8 @@ xfs_iwalk_threaded( if (xfs_pwork_ctl_want_abort(&pctl)) break; - iwag = kzalloc(sizeof(struct xfs_iwalk_ag), - GFP_KERNEL | __GFP_NOFAIL); + iwag = kzalloc_obj(struct xfs_iwalk_ag, + GFP_KERNEL | __GFP_NOFAIL); iwag->mp = mp; /* diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index a26378ca247d..b96f262ba139 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1334,7 +1334,7 @@ xlog_alloc_log( int error = -ENOMEM; uint log2_size = 0; - log = kzalloc(sizeof(struct xlog), GFP_KERNEL | __GFP_RETRY_MAYFAIL); + log = kzalloc_obj(struct xlog, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!log) { xfs_warn(mp, "Log allocation failed: No memory!"); goto out; diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 566976b8fef3..edc368938f30 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c @@ -100,7 +100,7 @@ xlog_cil_ctx_alloc(void) { struct xfs_cil_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL | __GFP_NOFAIL); INIT_LIST_HEAD(&ctx->committing); INIT_LIST_HEAD(&ctx->busy_extents.extent_list); INIT_LIST_HEAD(&ctx->log_items); @@ -2006,7 +2006,7 @@ xlog_cil_init( struct xlog_cil_pcp *cilpcp; int cpu; - cil = kzalloc(sizeof(*cil), GFP_KERNEL | __GFP_RETRY_MAYFAIL); + cil = kzalloc_obj(*cil, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!cil) return -ENOMEM; /* diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 935905743f94..09e6678ca487 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2092,8 +2092,7 @@ xlog_recover_add_item( { struct xlog_recover_item *item; - item = kzalloc(sizeof(struct xlog_recover_item), - GFP_KERNEL | __GFP_NOFAIL); + item = kzalloc_obj(struct xlog_recover_item, GFP_KERNEL | __GFP_NOFAIL); INIT_LIST_HEAD(&item->ri_list); list_add_tail(&item->ri_list, head); } @@ -2223,8 +2222,8 @@ xlog_recover_add_to_trans( } item->ri_total = in_f->ilf_size; - item->ri_buf = kcalloc(item->ri_total, sizeof(*item->ri_buf), - GFP_KERNEL | __GFP_NOFAIL); + item->ri_buf = kzalloc_objs(*item->ri_buf, item->ri_total, + GFP_KERNEL | __GFP_NOFAIL); } if (item->ri_total <= item->ri_cnt) { @@ -2367,7 +2366,7 @@ xlog_recover_ophdr_to_trans( * This is a new transaction so allocate a new recovery container to * hold the recovery ops that will follow. */ - trans = kzalloc(sizeof(struct xlog_recover), GFP_KERNEL | __GFP_NOFAIL); + trans = kzalloc_obj(struct xlog_recover, GFP_KERNEL | __GFP_NOFAIL); trans->r_log_tid = tid; trans->r_lsn = be64_to_cpu(rhead->h_lsn); INIT_LIST_HEAD(&trans->r_itemq); diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c index 4e417747688f..d61ec8cb126d 100644 --- a/fs/xfs/xfs_mru_cache.c +++ b/fs/xfs/xfs_mru_cache.c @@ -333,7 +333,7 @@ xfs_mru_cache_create( if (!(grp_time = msecs_to_jiffies(lifetime_ms) / grp_count)) return -EINVAL; - mru = kzalloc(sizeof(*mru), GFP_KERNEL | __GFP_NOFAIL); + mru = kzalloc_obj(*mru, GFP_KERNEL | __GFP_NOFAIL); if (!mru) return -ENOMEM; diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index a3e7d4a107d4..7bd15d9e7fba 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -771,8 +771,8 @@ xfs_qm_init_quotainfo( ASSERT(XFS_IS_QUOTA_ON(mp)); - qinf = mp->m_quotainfo = kzalloc(sizeof(struct xfs_quotainfo), - GFP_KERNEL | __GFP_NOFAIL); + qinf = mp->m_quotainfo = kzalloc_obj(struct xfs_quotainfo, + GFP_KERNEL | __GFP_NOFAIL); error = list_lru_init(&qinf->qi_lru); if (error) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8586f044a14b..0ce953b45852 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -2235,12 +2235,12 @@ xfs_init_fs_context( struct xfs_mount *mp; int i; - mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); + mp = kzalloc_obj(struct xfs_mount, GFP_KERNEL); if (!mp) return -ENOMEM; #ifdef DEBUG - mp->m_errortag = kcalloc(XFS_ERRTAG_MAX, sizeof(*mp->m_errortag), - GFP_KERNEL); + mp->m_errortag = kzalloc_objs(*mp->m_errortag, XFS_ERRTAG_MAX, + GFP_KERNEL); if (!mp->m_errortag) { kfree(mp); return -ENOMEM; diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 363d7f88c2c6..923729af4206 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -922,8 +922,7 @@ xfs_trans_ail_init( { struct xfs_ail *ailp; - ailp = kzalloc(sizeof(struct xfs_ail), - GFP_KERNEL | __GFP_RETRY_MAYFAIL); + ailp = kzalloc_obj(struct xfs_ail, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!ailp) return -ENOMEM; diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c index b60952565737..5d45d88f1f03 100644 --- a/fs/xfs/xfs_zone_alloc.c +++ b/fs/xfs/xfs_zone_alloc.c @@ -417,7 +417,7 @@ xfs_init_open_zone( { struct xfs_open_zone *oz; - oz = kzalloc(sizeof(*oz), GFP_NOFS | __GFP_NOFAIL); + oz = kzalloc_obj(*oz, GFP_NOFS | __GFP_NOFAIL); spin_lock_init(&oz->oz_alloc_lock); atomic_set(&oz->oz_ref, 1); oz->oz_rtg = rtg; @@ -1196,7 +1196,7 @@ xfs_alloc_zone_info( struct xfs_zone_info *zi; int i; - zi = kzalloc(sizeof(*zi), GFP_KERNEL); + zi = kzalloc_obj(*zi, GFP_KERNEL); if (!zi) return NULL; INIT_LIST_HEAD(&zi->zi_open_zones); diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c index 1f1f9fc973af..b8b9c72e955a 100644 --- a/fs/xfs/xfs_zone_gc.c +++ b/fs/xfs/xfs_zone_gc.c @@ -199,11 +199,11 @@ xfs_zone_gc_data_alloc( struct xfs_zone_gc_data *data; int i; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return NULL; - data->iter.recs = kcalloc(XFS_ZONE_GC_RECS, sizeof(*data->iter.recs), - GFP_KERNEL); + data->iter.recs = kzalloc_objs(*data->iter.recs, XFS_ZONE_GC_RECS, + GFP_KERNEL); if (!data->iter.recs) goto out_free_data; diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 086a31269198..28be57db6e4b 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -903,8 +903,8 @@ static int zonefs_get_zone_info(struct zonefs_zone_data *zd) struct block_device *bdev = zd->sb->s_bdev; int ret; - zd->zones = kvcalloc(bdev_nr_zones(bdev), sizeof(struct blk_zone), - GFP_KERNEL); + zd->zones = kvzalloc_objs(struct blk_zone, bdev_nr_zones(bdev), + GFP_KERNEL); if (!zd->zones) return -ENOMEM; @@ -948,8 +948,8 @@ static int zonefs_init_zgroup(struct super_block *sb, if (!zgroup->g_nr_zones) return 0; - zgroup->g_zones = kvcalloc(zgroup->g_nr_zones, - sizeof(struct zonefs_zone), GFP_KERNEL); + zgroup->g_zones = kvzalloc_objs(struct zonefs_zone, zgroup->g_nr_zones, + GFP_KERNEL); if (!zgroup->g_zones) return -ENOMEM; @@ -1243,7 +1243,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc) * ZONEFS_F_AGGRCNV which increases the maximum file size of a file * beyond the zone size is taken into account. */ - sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); + sbi = kzalloc_obj(*sbi, GFP_KERNEL); if (!sbi) return -ENOMEM; @@ -1388,7 +1388,7 @@ static int zonefs_init_fs_context(struct fs_context *fc) { struct zonefs_context *ctx; - ctx = kzalloc(sizeof(struct zonefs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct zonefs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->s_mount_opts = ZONEFS_MNTOPT_ERRORS_RO; diff --git a/include/kunit/resource.h b/include/kunit/resource.h index 4ad69a2642a5..c330ed3e751c 100644 --- a/include/kunit/resource.h +++ b/include/kunit/resource.h @@ -243,7 +243,7 @@ kunit_alloc_and_get_resource(struct kunit *test, struct kunit_resource *res; int ret; - res = kzalloc(sizeof(*res), internal_gfp); + res = kzalloc_obj(*res, internal_gfp); if (!res) return NULL; @@ -285,7 +285,7 @@ static inline void *kunit_alloc_resource(struct kunit *test, { struct kunit_resource *res; - res = kzalloc(sizeof(*res), internal_gfp); + res = kzalloc_obj(*res, internal_gfp); if (!res) return NULL; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3a412dcebc29..8b1d8993793d 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -66,7 +66,7 @@ static inline struct fwnode_handle *acpi_alloc_fwnode_static(void) { struct fwnode_handle *fwnode; - fwnode = kzalloc(sizeof(struct fwnode_handle), GFP_KERNEL); + fwnode = kzalloc_obj(struct fwnode_handle, GFP_KERNEL); if (!fwnode) return NULL; diff --git a/include/linux/bpf.h b/include/linux/bpf.h index cd9b96434904..b78b53198a2e 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2299,7 +2299,7 @@ static inline bool bpf_map_flags_access_ok(u32 access_flags) static inline struct bpf_map_owner *bpf_map_owner_alloc(struct bpf_map *map) { - return kzalloc(sizeof(*map->owner), GFP_ATOMIC); + return kzalloc_obj(*map->owner, GFP_ATOMIC); } static inline void bpf_map_owner_free(struct bpf_map *map) diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index dd6fc3b2133b..2cb211617ecc 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h @@ -136,7 +136,7 @@ struct vmcore_range { static inline int vmcore_alloc_add_range(struct list_head *list, unsigned long long paddr, unsigned long long size) { - struct vmcore_range *m = kzalloc(sizeof(*m), GFP_KERNEL); + struct vmcore_range *m = kzalloc_obj(*m, GFP_KERNEL); if (!m) return -ENOMEM; diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h index 68c3c1e41014..3267ab0e8c54 100644 --- a/include/linux/dma-fence-chain.h +++ b/include/linux/dma-fence-chain.h @@ -91,7 +91,7 @@ dma_fence_chain_contained(struct dma_fence *fence) * intentional to enforce typesafety. */ #define dma_fence_chain_alloc() \ - ((struct dma_fence_chain *)kmalloc(sizeof(struct dma_fence_chain), GFP_KERNEL)) + ((struct dma_fence_chain *) kmalloc_obj(struct dma_fence_chain, GFP_KERNEL)) /** * dma_fence_chain_free diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 86d62fdafd7a..09a1a59034e0 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -97,7 +97,7 @@ void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) static inline struct gameport *gameport_allocate_port(void) { - struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL); + struct gameport *gameport = kzalloc_obj(struct gameport, GFP_KERNEL); return gameport; } diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index c16353cc6e3c..ff9012c6a93a 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h @@ -206,7 +206,7 @@ io_mapping_create_wc(resource_size_t base, { struct io_mapping *iomap; - iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); + iomap = kmalloc_obj(*iomap, GFP_KERNEL); if (!iomap) return NULL; diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d42a95cbcfbc..dde605cb894e 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1664,7 +1664,7 @@ void kvm_arch_create_vm_debugfs(struct kvm *kvm); */ static inline struct kvm *kvm_arch_alloc_vm(void) { - return kzalloc(sizeof(struct kvm), GFP_KERNEL_ACCOUNT); + return kzalloc_obj(struct kvm, GFP_KERNEL_ACCOUNT); } #endif diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 829b281d6c9c..a8513e401760 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -460,8 +460,7 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock, * intentional to enforce typesafety. */ #define sk_psock_init_link() \ - ((struct sk_psock_link *)kzalloc(sizeof(struct sk_psock_link), \ - GFP_ATOMIC | __GFP_NOWARN)) + ((struct sk_psock_link *) kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN)) static inline void sk_psock_free_link(struct sk_psock_link *link) { diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index fd8dce4169f7..af7cfee7b8f6 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -1309,7 +1309,7 @@ static inline struct spi_message *spi_message_alloc(unsigned ntrans, gfp_t flags } *mwt; unsigned i; - mwt = kzalloc(struct_size(mwt, t, ntrans), flags); + mwt = kzalloc_flex(*mwt, t, ntrans, flags); if (!mwt) return NULL; diff --git a/include/net/act_api.h b/include/net/act_api.h index 91a24b5e0b93..453d6e18851b 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -159,7 +159,7 @@ int tc_action_net_init(struct net *net, struct tc_action_net *tn, { int err = 0; - tn->idrinfo = kmalloc(sizeof(*tn->idrinfo), GFP_KERNEL); + tn->idrinfo = kmalloc_obj(*tn->idrinfo, GFP_KERNEL); if (!tn->idrinfo) return -ENOMEM; tn->ops = ops; diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h index 9467e33dfb36..171ee6f7aa83 100644 --- a/include/net/fq_impl.h +++ b/include/net/fq_impl.h @@ -358,7 +358,7 @@ static int fq_init(struct fq *fq, int flows_cnt) fq->limit = 8192; fq->memory_limit = 16 << 20; /* 16 MBytes */ - fq->flows = kvcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL); + fq->flows = kvzalloc_objs(fq->flows[0], fq->flows_cnt, GFP_KERNEL); if (!fq->flows) return -ENOMEM; diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index 5606ed6e7084..18f511da9a09 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h @@ -211,7 +211,7 @@ static inline struct iucv_path *iucv_path_alloc(u16 msglim, u8 flags, gfp_t gfp) { struct iucv_path *path; - path = kzalloc(sizeof(struct iucv_path), gfp); + path = kzalloc_obj(struct iucv_path, gfp); if (path) { path->msglim = msglim; path->flags = flags; diff --git a/include/net/tc_act/tc_gate.h b/include/net/tc_act/tc_gate.h index c1a67149c6b6..b147a3bb1a46 100644 --- a/include/net/tc_act/tc_gate.h +++ b/include/net/tc_act/tc_gate.h @@ -114,7 +114,7 @@ static inline struct action_gate_entry if (i != num_entries) return NULL; - oe = kcalloc(num_entries, sizeof(*oe), GFP_ATOMIC); + oe = kzalloc_objs(*oe, num_entries, GFP_ATOMIC); if (!oe) return NULL; diff --git a/include/net/udp.h b/include/net/udp.h index 700dbedcb15f..24491111477a 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -294,8 +294,8 @@ static inline int udp_lib_init_sock(struct sock *sk) up->forward_threshold = sk->sk_rcvbuf >> 2; set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags); - up->udp_prod_queue = kcalloc(nr_node_ids, sizeof(*up->udp_prod_queue), - GFP_KERNEL); + up->udp_prod_queue = kzalloc_objs(*up->udp_prod_queue, nr_node_ids, + GFP_KERNEL); if (!up->udp_prod_queue) return -ENOMEM; for (int i = 0; i < nr_node_ids; i++) diff --git a/init/initramfs.c b/init/initramfs.c index 6ddbfb17fb8f..3d89e31e0d8a 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -102,7 +102,7 @@ static char __init *find_link(int major, int minor, int ino, continue; return (*p)->name; } - q = kmalloc(sizeof(struct hash), GFP_KERNEL); + q = kmalloc_obj(struct hash, GFP_KERNEL); if (!q) panic_show_mem("can't allocate link hash entry"); q->major = major; @@ -153,7 +153,7 @@ static void __init dir_add(const char *name, size_t nlen, time64_t mtime) { struct dir_entry *de; - de = kmalloc(struct_size(de, name, nlen), GFP_KERNEL); + de = kmalloc_flex(*de, name, nlen, GFP_KERNEL); if (!de) panic_show_mem("can't allocate dir_entry buffer"); INIT_LIST_HEAD(&de->list); @@ -517,7 +517,7 @@ char * __init unpack_to_rootfs(char *buf, unsigned long len) char header[CPIO_HDRLEN]; char symlink[PATH_MAX + N_ALIGN(PATH_MAX) + 1]; char name[N_ALIGN(PATH_MAX)]; - } *bufs = kmalloc(sizeof(*bufs), GFP_KERNEL); + } *bufs = kmalloc_obj(*bufs, GFP_KERNEL); if (!bufs) panic_show_mem("can't allocate buffers"); diff --git a/init/initramfs_test.c b/init/initramfs_test.c index beb6e3cf7808..1e75faec678b 100644 --- a/init/initramfs_test.c +++ b/init/initramfs_test.c @@ -403,7 +403,7 @@ static void __init initramfs_test_fname_pad(struct kunit *test) struct test_fname_pad { char padded_fname[4096 - CPIO_HDRLEN]; char cpio_srcbuf[CPIO_HDRLEN + PATH_MAX + 3 + sizeof(fdata)]; - } *tbufs = kzalloc(sizeof(struct test_fname_pad), GFP_KERNEL); + } *tbufs = kzalloc_obj(struct test_fname_pad, GFP_KERNEL); struct initramfs_test_cpio c[] = { { .magic = "070701", .ino = 1, @@ -457,7 +457,7 @@ static void __init initramfs_test_fname_path_max(struct kunit *test) char fname_oversize[PATH_MAX + 1]; char fname_ok[PATH_MAX]; char cpio_src[(CPIO_HDRLEN + PATH_MAX + 3 + sizeof(fdata)) * 2]; - } *tbufs = kzalloc(sizeof(struct test_fname_path_max), GFP_KERNEL); + } *tbufs = kzalloc_obj(struct test_fname_path_max, GFP_KERNEL); struct initramfs_test_cpio c[] = { { .magic = "070701", .ino = 1, diff --git a/io_uring/bpf_filter.c b/io_uring/bpf_filter.c index 28a23e92ee81..6a98750e38b0 100644 --- a/io_uring/bpf_filter.c +++ b/io_uring/bpf_filter.c @@ -152,13 +152,12 @@ static struct io_bpf_filters *io_new_bpf_filters(void) { struct io_bpf_filters *filters __free(kfree) = NULL; - filters = kzalloc(sizeof(*filters), GFP_KERNEL_ACCOUNT); + filters = kzalloc_obj(*filters, GFP_KERNEL_ACCOUNT); if (!filters) return ERR_PTR(-ENOMEM); - filters->filters = kcalloc(IORING_OP_LAST, - sizeof(struct io_bpf_filter *), - GFP_KERNEL_ACCOUNT); + filters->filters = kzalloc_objs(struct io_bpf_filter *, IORING_OP_LAST, + GFP_KERNEL_ACCOUNT); if (!filters->filters) return ERR_PTR(-ENOMEM); @@ -402,7 +401,7 @@ int io_register_bpf_filter(struct io_restriction *res, old_filters = res->bpf_filters; } - filter = kzalloc(sizeof(*filter), GFP_KERNEL_ACCOUNT); + filter = kzalloc_obj(*filter, GFP_KERNEL_ACCOUNT); if (!filter) { ret = -ENOMEM; goto err; diff --git a/io_uring/eventfd.c b/io_uring/eventfd.c index 78f8ab7db104..0120ecd97321 100644 --- a/io_uring/eventfd.c +++ b/io_uring/eventfd.c @@ -127,7 +127,7 @@ int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg, if (copy_from_user(&fd, fds, sizeof(*fds))) return -EFAULT; - ev_fd = kmalloc(sizeof(*ev_fd), GFP_KERNEL); + ev_fd = kmalloc_obj(*ev_fd, GFP_KERNEL); if (!ev_fd) return -ENOMEM; diff --git a/io_uring/futex.c b/io_uring/futex.c index 1dabcfd503b8..fd503c24b428 100644 --- a/io_uring/futex.c +++ b/io_uring/futex.c @@ -185,8 +185,8 @@ int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (!iof->futex_nr || iof->futex_nr > FUTEX_WAITV_MAX) return -EINVAL; - ifd = kzalloc(struct_size_t(struct io_futexv_data, futexv, iof->futex_nr), - GFP_KERNEL_ACCOUNT); + ifd = kzalloc_flex(struct io_futexv_data, futexv, iof->futex_nr, + GFP_KERNEL_ACCOUNT); if (!ifd) return -ENOMEM; diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 7ed04911f7b9..2d04ff565920 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -897,7 +897,7 @@ static bool create_io_worker(struct io_wq *wq, struct io_wq_acct *acct) __set_current_state(TASK_RUNNING); - worker = kzalloc(sizeof(*worker), GFP_KERNEL); + worker = kzalloc_obj(*worker, GFP_KERNEL); if (!worker) { fail: atomic_dec(&acct->nr_running); @@ -1255,7 +1255,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) if (WARN_ON_ONCE(!bounded)) return ERR_PTR(-EINVAL); - wq = kzalloc(sizeof(struct io_wq), GFP_KERNEL); + wq = kzalloc_obj(struct io_wq, GFP_KERNEL); if (!wq) return ERR_PTR(-ENOMEM); diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index ccab8562d273..3c64c458a281 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -195,8 +195,8 @@ static int io_alloc_hash_table(struct io_hash_table *table, unsigned bits) do { hash_buckets = 1U << bits; - table->hbs = kvmalloc_array(hash_buckets, sizeof(table->hbs[0]), - GFP_KERNEL_ACCOUNT); + table->hbs = kvmalloc_objs(table->hbs[0], hash_buckets, + GFP_KERNEL_ACCOUNT); if (table->hbs) break; if (bits == 1) @@ -226,7 +226,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) int hash_bits; bool ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -1330,7 +1330,7 @@ static __cold void io_drain_req(struct io_kiocb *req) bool drain = req->flags & IOSQE_IO_DRAIN; struct io_defer_entry *de; - de = kmalloc(sizeof(*de), GFP_KERNEL_ACCOUNT); + de = kmalloc_obj(*de, GFP_KERNEL_ACCOUNT); if (!de) { io_req_defer_failed(req, -ENOMEM); return; diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 67d4fe576473..dcfa4d558f72 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -265,7 +265,7 @@ static int io_ring_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg, * a speculative peek operation. */ if (arg->mode & KBUF_MODE_EXPAND && nr_avail > nr_iovs && arg->max_len) { - iov = kmalloc_array(nr_avail, sizeof(struct iovec), GFP_KERNEL); + iov = kmalloc_objs(struct iovec, nr_avail, GFP_KERNEL); if (unlikely(!iov)) return -ENOMEM; if (arg->mode & KBUF_MODE_FREE) @@ -532,7 +532,7 @@ static int io_add_buffers(struct io_ring_ctx *ctx, struct io_provide_buf *pbuf, ret = -EOVERFLOW; break; } - buf = kmalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT); + buf = kmalloc_obj(*buf, GFP_KERNEL_ACCOUNT); if (!buf) break; @@ -559,7 +559,7 @@ static int __io_manage_buffers_legacy(struct io_kiocb *req, if (!bl) { if (req->opcode != IORING_OP_PROVIDE_BUFFERS) return -ENOENT; - bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); + bl = kzalloc_obj(*bl, GFP_KERNEL_ACCOUNT); if (!bl) return -ENOMEM; @@ -628,7 +628,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) io_destroy_bl(ctx, bl); } - bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); + bl = kzalloc_obj(*bl, GFP_KERNEL_ACCOUNT); if (!bl) return -ENOMEM; diff --git a/io_uring/memmap.c b/io_uring/memmap.c index 89f56609e50a..e6958968975a 100644 --- a/io_uring/memmap.c +++ b/io_uring/memmap.c @@ -56,7 +56,7 @@ struct page **io_pin_pages(unsigned long uaddr, unsigned long len, int *npages) if (WARN_ON_ONCE(nr_pages > INT_MAX)) return ERR_PTR(-EOVERFLOW); - pages = kvmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL_ACCOUNT); + pages = kvmalloc_objs(struct page *, nr_pages, GFP_KERNEL_ACCOUNT); if (!pages) return ERR_PTR(-ENOMEM); @@ -158,7 +158,7 @@ static int io_region_allocate_pages(struct io_mapped_region *mr, unsigned long nr_allocated; struct page **pages; - pages = kvmalloc_array(mr->nr_pages, sizeof(*pages), gfp); + pages = kvmalloc_objs(*pages, mr->nr_pages, gfp); if (!pages) return -ENOMEM; diff --git a/io_uring/mock_file.c b/io_uring/mock_file.c index 80c96ad2061f..221b60ad0723 100644 --- a/io_uring/mock_file.c +++ b/io_uring/mock_file.c @@ -115,7 +115,7 @@ static ssize_t io_mock_delay_rw(struct kiocb *iocb, size_t len) struct io_mock_file *mf = iocb->ki_filp->private_data; struct io_mock_iocb *mio; - mio = kzalloc(sizeof(*mio), GFP_KERNEL); + mio = kzalloc_obj(*mio, GFP_KERNEL); if (!mio) return -ENOMEM; @@ -242,7 +242,7 @@ static int io_create_mock_file(struct io_uring_cmd *cmd, unsigned int issue_flag if (mc.rw_delay_ns > NSEC_PER_SEC) return -EINVAL; - mf = kzalloc(sizeof(*mf), GFP_KERNEL_ACCOUNT); + mf = kzalloc_obj(*mf, GFP_KERNEL_ACCOUNT); if (!mf) return -ENOMEM; diff --git a/io_uring/poll.c b/io_uring/poll.c index aac4b3b881fb..b671b84657d9 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -478,7 +478,7 @@ static void __io_queue_proc(struct io_poll *poll, struct io_poll_table *pt, return; } - poll = kmalloc(sizeof(*poll), GFP_ATOMIC); + poll = kmalloc_obj(*poll, GFP_ATOMIC); if (!poll) { pt->error = -ENOMEM; return; @@ -655,7 +655,7 @@ static struct async_poll *io_req_alloc_apoll(struct io_kiocb *req, if (!(issue_flags & IO_URING_F_UNLOCKED)) apoll = io_cache_alloc(&ctx->apoll_cache, GFP_ATOMIC); else - apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC); + apoll = kmalloc_obj(*apoll, GFP_ATOMIC); if (!apoll) return NULL; apoll->poll.retries = APOLL_MAX_RETRY; diff --git a/io_uring/register.c b/io_uring/register.c index 594b1f2ce875..6015a3e9ce69 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -218,7 +218,7 @@ static int io_register_restrictions_task(void __user *arg, unsigned int nr_args) if (!mem_is_zero(tres.resv, sizeof(tres.resv))) return -EINVAL; - res = kzalloc(sizeof(*res), GFP_KERNEL_ACCOUNT); + res = kzalloc_obj(*res, GFP_KERNEL_ACCOUNT); if (!res) return -ENOMEM; @@ -250,7 +250,7 @@ static int io_register_bpf_filter_task(void __user *arg, unsigned int nr_args) /* If no task restrictions exist, setup a new set */ res = current->io_uring_restrict; if (!res) { - res = kzalloc(sizeof(*res), GFP_KERNEL_ACCOUNT); + res = kzalloc_obj(*res, GFP_KERNEL_ACCOUNT); if (!res) return -ENOMEM; } diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 842e231c8a7c..9b799e7ba889 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -113,8 +113,7 @@ static struct io_mapped_ubuf *io_alloc_imu(struct io_ring_ctx *ctx, { if (nr_bvecs <= IO_CACHED_BVECS_SEGS) return io_cache_alloc(&ctx->imu_cache, GFP_KERNEL); - return kvmalloc(struct_size_t(struct io_mapped_ubuf, bvec, nr_bvecs), - GFP_KERNEL); + return kvmalloc_flex(struct io_mapped_ubuf, bvec, nr_bvecs, GFP_KERNEL); } static void io_free_imu(struct io_ring_ctx *ctx, struct io_mapped_ubuf *imu) @@ -200,8 +199,8 @@ __cold void io_rsrc_data_free(struct io_ring_ctx *ctx, __cold int io_rsrc_data_alloc(struct io_rsrc_data *data, unsigned nr) { - data->nodes = kvmalloc_array(nr, sizeof(struct io_rsrc_node *), - GFP_KERNEL_ACCOUNT | __GFP_ZERO); + data->nodes = kvmalloc_objs(struct io_rsrc_node *, nr, + GFP_KERNEL_ACCOUNT | __GFP_ZERO); if (data->nodes) { data->nr = nr; return 0; @@ -684,7 +683,7 @@ static bool io_coalesce_buffer(struct page ***pages, int *nr_pages, unsigned i, j; /* Store head pages only*/ - new_array = kvmalloc_array(nr_folios, sizeof(struct page *), GFP_KERNEL); + new_array = kvmalloc_objs(struct page *, nr_folios, GFP_KERNEL); if (!new_array) return false; @@ -1310,7 +1309,7 @@ int io_vec_realloc(struct iou_vec *iv, unsigned nr_entries) gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_NOWARN; struct iovec *iov; - iov = kmalloc_array(nr_entries, sizeof(iov[0]), gfp); + iov = kmalloc_objs(iov[0], nr_entries, gfp); if (!iov) return -ENOMEM; diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index becdfdd323a9..97e64d7d029f 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -153,7 +153,7 @@ static struct io_sq_data *io_get_sq_data(struct io_uring_params *p, return sqd; } - sqd = kzalloc(sizeof(*sqd), GFP_KERNEL); + sqd = kzalloc_obj(*sqd, GFP_KERNEL); if (!sqd) return ERR_PTR(-ENOMEM); diff --git a/io_uring/tctx.c b/io_uring/tctx.c index 270263699c6f..fa97bc7db6a3 100644 --- a/io_uring/tctx.c +++ b/io_uring/tctx.c @@ -23,7 +23,7 @@ static struct io_wq *io_init_wq_offload(struct io_ring_ctx *ctx, mutex_lock(&ctx->uring_lock); hash = ctx->hash_map; if (!hash) { - hash = kzalloc(sizeof(*hash), GFP_KERNEL); + hash = kzalloc_obj(*hash, GFP_KERNEL); if (!hash) { mutex_unlock(&ctx->uring_lock); return ERR_PTR(-ENOMEM); @@ -80,7 +80,7 @@ __cold int io_uring_alloc_task_context(struct task_struct *task, struct io_uring_task *tctx; int ret; - tctx = kzalloc(sizeof(*tctx), GFP_KERNEL); + tctx = kzalloc_obj(*tctx, GFP_KERNEL); if (unlikely(!tctx)) return -ENOMEM; @@ -139,7 +139,7 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx) if (tctx->io_wq) io_wq_set_exit_on_idle(tctx->io_wq, false); if (!xa_load(&tctx->xa, (unsigned long)ctx)) { - node = kmalloc(sizeof(*node), GFP_KERNEL); + node = kmalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; node->ctx = ctx; @@ -378,7 +378,7 @@ int __io_uring_fork(struct task_struct *tsk) /* Don't leave it dangling on error */ tsk->io_uring_restrict = NULL; - res = kzalloc(sizeof(*res), GFP_KERNEL_ACCOUNT); + res = kzalloc_obj(*res, GFP_KERNEL_ACCOUNT); if (!res) return -ENOMEM; diff --git a/io_uring/xattr.c b/io_uring/xattr.c index ba2b98cf13f9..28475bf8ed47 100644 --- a/io_uring/xattr.c +++ b/io_uring/xattr.c @@ -56,7 +56,7 @@ static int __io_getxattr_prep(struct io_kiocb *req, if (ix->ctx.flags) return -EINVAL; - ix->ctx.kname = kmalloc(sizeof(*ix->ctx.kname), GFP_KERNEL); + ix->ctx.kname = kmalloc_obj(*ix->ctx.kname, GFP_KERNEL); if (!ix->ctx.kname) return -ENOMEM; @@ -133,7 +133,7 @@ static int __io_setxattr_prep(struct io_kiocb *req, ix->ctx.size = READ_ONCE(sqe->len); ix->ctx.flags = READ_ONCE(sqe->xattr_flags); - ix->ctx.kname = kmalloc(sizeof(*ix->ctx.kname), GFP_KERNEL); + ix->ctx.kname = kmalloc_obj(*ix->ctx.kname, GFP_KERNEL); if (!ix->ctx.kname) return -ENOMEM; diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 28150c6578e3..d1ecc55de5ee 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -448,7 +448,7 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq, } ret = -ENOMEM; - area = kzalloc(sizeof(*area), GFP_KERNEL); + area = kzalloc_obj(*area, GFP_KERNEL); if (!area) goto err; area->ifq = ifq; @@ -467,8 +467,8 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq, area->nia.num_niovs = nr_iovs; ret = -ENOMEM; - area->nia.niovs = kvmalloc_array(nr_iovs, sizeof(area->nia.niovs[0]), - GFP_KERNEL_ACCOUNT | __GFP_ZERO); + area->nia.niovs = kvmalloc_objs(area->nia.niovs[0], nr_iovs, + GFP_KERNEL_ACCOUNT | __GFP_ZERO); if (!area->nia.niovs) goto err; @@ -477,7 +477,7 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq, if (!area->freelist) goto err; - area->user_refs = kvmalloc_array(nr_iovs, sizeof(area->user_refs[0]), + area->user_refs = kvmalloc_objs(area->user_refs[0], nr_iovs, GFP_KERNEL_ACCOUNT | __GFP_ZERO); if (!area->user_refs) goto err; @@ -510,7 +510,7 @@ static struct io_zcrx_ifq *io_zcrx_ifq_alloc(struct io_ring_ctx *ctx) { struct io_zcrx_ifq *ifq; - ifq = kzalloc(sizeof(*ifq), GFP_KERNEL); + ifq = kzalloc_obj(*ifq, GFP_KERNEL); if (!ifq) return NULL; diff --git a/ipc/mqueue.c b/ipc/mqueue.c index bb7c9e5d2b90..a90aa6803f1b 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -210,7 +210,7 @@ static int msg_insert(struct msg_msg *msg, struct mqueue_inode_info *info) leaf = info->node_cache; info->node_cache = NULL; } else { - leaf = kmalloc(sizeof(*leaf), GFP_ATOMIC); + leaf = kmalloc_obj(*leaf, GFP_ATOMIC); if (!leaf) return -ENOMEM; INIT_LIST_HEAD(&leaf->msg_list); @@ -449,7 +449,7 @@ static int mqueue_init_fs_context(struct fs_context *fc) { struct mqueue_fs_context *ctx; - ctx = kzalloc(sizeof(struct mqueue_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct mqueue_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -1088,7 +1088,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, * fall back to that if necessary. */ if (!info->node_cache) - new_leaf = kmalloc(sizeof(*new_leaf), GFP_KERNEL); + new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL); spin_lock(&info->lock); @@ -1181,7 +1181,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, * fall back to that if necessary. */ if (!info->node_cache) - new_leaf = kmalloc(sizeof(*new_leaf), GFP_KERNEL); + new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL); spin_lock(&info->lock); diff --git a/ipc/msg.c b/ipc/msg.c index ee6af4fe52bf..62996b97f0ac 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -148,7 +148,7 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) key_t key = params->key; int msgflg = params->flg; - msq = kmalloc(sizeof(*msq), GFP_KERNEL_ACCOUNT); + msq = kmalloc_obj(*msq, GFP_KERNEL_ACCOUNT); if (unlikely(!msq)) return -ENOMEM; diff --git a/ipc/namespace.c b/ipc/namespace.c index 535f16ea40e1..1e71353bdb4a 100644 --- a/ipc/namespace.c +++ b/ipc/namespace.c @@ -58,7 +58,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns, } err = -ENOMEM; - ns = kzalloc(sizeof(struct ipc_namespace), GFP_KERNEL_ACCOUNT); + ns = kzalloc_obj(struct ipc_namespace, GFP_KERNEL_ACCOUNT); if (ns == NULL) goto fail_dec; diff --git a/ipc/sem.c b/ipc/sem.c index 0f06e4bd4673..2a19244cff22 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -514,7 +514,7 @@ static struct sem_array *sem_alloc(size_t nsems) if (nsems > (INT_MAX - sizeof(*sma)) / sizeof(sma->sems[0])) return NULL; - sma = kvzalloc(struct_size(sma, sems, nsems), GFP_KERNEL_ACCOUNT); + sma = kvzalloc_flex(*sma, sems, nsems, GFP_KERNEL_ACCOUNT); if (unlikely(!sma)) return NULL; @@ -1853,7 +1853,7 @@ static inline int get_undo_list(struct sem_undo_list **undo_listp) undo_list = current->sysvsem.undo_list; if (!undo_list) { - undo_list = kzalloc(sizeof(*undo_list), GFP_KERNEL_ACCOUNT); + undo_list = kzalloc_obj(*undo_list, GFP_KERNEL_ACCOUNT); if (undo_list == NULL) return -ENOMEM; spin_lock_init(&undo_list->lock); @@ -1938,7 +1938,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid) rcu_read_unlock(); /* step 2: allocate new undo structure */ - new = kvzalloc(struct_size(new, semadj, nsems), GFP_KERNEL_ACCOUNT); + new = kvzalloc_flex(*new, semadj, nsems, GFP_KERNEL_ACCOUNT); if (!new) { ipc_rcu_putref(&sma->sem_perm, sem_rcu_free); return ERR_PTR(-ENOMEM); @@ -2234,7 +2234,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, return -EINVAL; if (nsops > SEMOPM_FAST) { - sops = kvmalloc_array(nsops, sizeof(*sops), GFP_KERNEL); + sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL); if (sops == NULL) return -ENOMEM; } diff --git a/ipc/shm.c b/ipc/shm.c index e8c7d1924c50..b94248570304 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -722,7 +722,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) ns->shm_tot + numpages > ns->shm_ctlall) return -ENOSPC; - shp = kmalloc(sizeof(*shp), GFP_KERNEL_ACCOUNT); + shp = kmalloc_obj(*shp, GFP_KERNEL_ACCOUNT); if (unlikely(!shp)) return -ENOMEM; @@ -1618,7 +1618,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, rcu_read_unlock(); err = -ENOMEM; - sfd = kzalloc(sizeof(*sfd), GFP_KERNEL); + sfd = kzalloc_obj(*sfd, GFP_KERNEL); if (!sfd) { fput(base); goto out_nattch; diff --git a/ipc/util.c b/ipc/util.c index cae60f11d9c2..59235ffba0d9 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -141,7 +141,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header, struct proc_dir_entry *pde; struct ipc_proc_iface *iface; - iface = kmalloc(sizeof(*iface), GFP_KERNEL); + iface = kmalloc_obj(*iface, GFP_KERNEL); if (!iface) return; iface->path = path; diff --git a/kernel/acct.c b/kernel/acct.c index 812808e5b1b8..06e8b79eaf7e 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -255,7 +255,7 @@ static int acct_on(const char __user *name) if (!(file->f_mode & FMODE_CAN_WRITE)) return -EIO; - acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL); + acct = kzalloc_obj(struct bsd_acct_struct, GFP_KERNEL); if (!acct) return -ENOMEM; diff --git a/kernel/async.c b/kernel/async.c index 4c3e6a44595f..862532ad328a 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -205,7 +205,7 @@ async_cookie_t async_schedule_node_domain(async_func_t func, void *data, async_cookie_t newcookie; /* allow irq-off callers */ - entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC); + entry = kzalloc_obj(struct async_entry, GFP_ATOMIC); /* * If we're out of memory or if there's too much work @@ -261,7 +261,7 @@ bool async_schedule_dev_nocall(async_func_t func, struct device *dev) { struct async_entry *entry; - entry = kzalloc(sizeof(struct async_entry), GFP_KERNEL); + entry = kzalloc_obj(struct async_entry, GFP_KERNEL); /* Give up if there is no memory or too much work. */ if (!entry || atomic_read(&entry_count) > MAX_WORK) { diff --git a/kernel/audit.c b/kernel/audit.c index 592d927e70f9..838ca1648f7b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -545,7 +545,7 @@ static int auditd_set(struct pid *pid, u32 portid, struct net *net, if (!pid || !net) return -EINVAL; - ac_new = kzalloc(sizeof(*ac_new), GFP_KERNEL); + ac_new = kzalloc_obj(*ac_new, GFP_KERNEL); if (!ac_new) return -ENOMEM; ac_new->pid = get_pid(pid); @@ -1044,7 +1044,7 @@ static void audit_send_reply(struct sk_buff *request_skb, int seq, int type, int struct task_struct *tsk; struct audit_reply *reply; - reply = kzalloc(sizeof(*reply), GFP_KERNEL); + reply = kzalloc_obj(*reply, GFP_KERNEL); if (!reply) return; @@ -1517,8 +1517,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh, if (err < 0) return err; } - sig_data = kmalloc(struct_size(sig_data, ctx, lsmctx.len), - GFP_KERNEL); + sig_data = kmalloc_flex(*sig_data, ctx, lsmctx.len, GFP_KERNEL); if (!sig_data) { if (lsmprop_is_set(&audit_sig_lsm)) security_release_secctx(&lsmctx); diff --git a/kernel/audit_fsnotify.c b/kernel/audit_fsnotify.c index b92805b317a2..7b89e1ccb5a4 100644 --- a/kernel/audit_fsnotify.c +++ b/kernel/audit_fsnotify.c @@ -89,7 +89,7 @@ struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, char *pa goto out; } - audit_mark = kzalloc(sizeof(*audit_mark), GFP_KERNEL); + audit_mark = kzalloc_obj(*audit_mark, GFP_KERNEL); if (unlikely(!audit_mark)) { audit_mark = ERR_PTR(-ENOMEM); goto out; diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index fda6beb041e0..3ffd6582bfe5 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c @@ -96,7 +96,7 @@ static struct audit_tree *alloc_tree(const char *s) size_t sz; sz = strlen(s) + 1; - tree = kmalloc(struct_size(tree, pathname, sz), GFP_KERNEL); + tree = kmalloc_flex(*tree, pathname, sz, GFP_KERNEL); if (tree) { refcount_set(&tree->count, 1); tree->goner = 0; @@ -192,7 +192,7 @@ static struct audit_chunk *alloc_chunk(int count) struct audit_chunk *chunk; int i; - chunk = kzalloc(struct_size(chunk, owners, count), GFP_KERNEL); + chunk = kzalloc_flex(*chunk, owners, count, GFP_KERNEL); if (!chunk) return NULL; diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index a700e3c8925f..6a73b30929c0 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c @@ -139,7 +139,7 @@ static struct audit_parent *audit_init_parent(const struct path *path) struct audit_parent *parent; int ret; - parent = kzalloc(sizeof(*parent), GFP_KERNEL); + parent = kzalloc_obj(*parent, GFP_KERNEL); if (unlikely(!parent)) return ERR_PTR(-ENOMEM); @@ -161,7 +161,7 @@ static struct audit_watch *audit_init_watch(char *path) { struct audit_watch *watch; - watch = kzalloc(sizeof(*watch), GFP_KERNEL); + watch = kzalloc_obj(*watch, GFP_KERNEL); if (unlikely(!watch)) return ERR_PTR(-ENOMEM); diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 6a86c0683b67..e2d6f9a91a49 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -108,11 +108,11 @@ static inline struct audit_entry *audit_init_entry(u32 field_count) struct audit_entry *entry; struct audit_field *fields; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (unlikely(!entry)) return NULL; - fields = kcalloc(field_count, sizeof(*fields), GFP_KERNEL); + fields = kzalloc_objs(*fields, field_count, GFP_KERNEL); if (unlikely(!fields)) { kfree(entry); return NULL; @@ -638,7 +638,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule) void *bufp; int i; - data = kzalloc(struct_size(data, buf, krule->buflen), GFP_KERNEL); + data = kzalloc_flex(*data, buf, krule->buflen, GFP_KERNEL); if (unlikely(!data)) return NULL; @@ -1180,7 +1180,7 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq) * happen if we're actually running in the context of auditctl * trying to _send_ the stuff */ - dest = kmalloc(sizeof(*dest), GFP_KERNEL); + dest = kmalloc_obj(*dest, GFP_KERNEL); if (!dest) return -ENOMEM; dest->net = get_net(sock_net(NETLINK_CB(request_skb).sk)); diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 86a44b162a87..e45883de200f 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -255,7 +255,7 @@ static int grow_tree_refs(struct audit_context *ctx) { struct audit_tree_refs *p = ctx->trees; - ctx->trees = kzalloc(sizeof(struct audit_tree_refs), GFP_KERNEL); + ctx->trees = kzalloc_obj(struct audit_tree_refs, GFP_KERNEL); if (!ctx->trees) { ctx->trees = p; return 0; @@ -1032,7 +1032,7 @@ static inline struct audit_context *audit_alloc_context(enum audit_state state) { struct audit_context *context; - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) return NULL; context->context = AUDIT_CTX_UNUSED; @@ -2153,7 +2153,7 @@ static struct audit_names *audit_alloc_name(struct audit_context *context, aname = &context->preallocated_names[context->name_count]; memset(aname, 0, sizeof(*aname)); } else { - aname = kzalloc(sizeof(*aname), GFP_NOFS); + aname = kzalloc_obj(*aname, GFP_NOFS); if (!aname) return NULL; aname->should_free = true; @@ -2650,7 +2650,7 @@ int __audit_sockaddr(int len, void *a) struct audit_context *context = audit_context(); if (!context->sockaddr) { - void *p = kmalloc(sizeof(struct sockaddr_storage), GFP_KERNEL); + void *p = kmalloc_obj(struct sockaddr_storage, GFP_KERNEL); if (!p) return -ENOMEM; @@ -2704,7 +2704,7 @@ int audit_signal_info_syscall(struct task_struct *t) axp = (void *)ctx->aux_pids; if (!axp || axp->pid_count == AUDIT_AUX_PIDS) { - axp = kzalloc(sizeof(*axp), GFP_ATOMIC); + axp = kzalloc_obj(*axp, GFP_ATOMIC); if (!axp) return -ENOMEM; @@ -2743,7 +2743,7 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm, struct audit_context *context = audit_context(); struct cpu_vfs_cap_data vcaps; - ax = kmalloc(sizeof(*ax), GFP_KERNEL); + ax = kmalloc_obj(*ax, GFP_KERNEL); if (!ax) return -ENOMEM; diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c index 42fae0a9f314..5baea15cb07d 100644 --- a/kernel/bpf/arena.c +++ b/kernel/bpf/arena.c @@ -324,7 +324,7 @@ static int remember_vma(struct bpf_arena *arena, struct vm_area_struct *vma) { struct vma_list *vml; - vml = kmalloc(sizeof(*vml), GFP_KERNEL); + vml = kmalloc_obj(*vml, GFP_KERNEL); if (!vml) return -ENOMEM; refcount_set(&vml->mmap_count, 1); diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 67e9e811de3a..188b0e35f856 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -1061,7 +1061,7 @@ static int prog_array_map_poke_track(struct bpf_map *map, goto out; } - elem = kmalloc(sizeof(*elem), GFP_KERNEL); + elem = kmalloc_obj(*elem, GFP_KERNEL); if (!elem) { ret = -ENOMEM; goto out; @@ -1174,7 +1174,7 @@ static struct bpf_map *prog_array_map_alloc(union bpf_attr *attr) struct bpf_array_aux *aux; struct bpf_map *map; - aux = kzalloc(sizeof(*aux), GFP_KERNEL_ACCOUNT); + aux = kzalloc_obj(*aux, GFP_KERNEL_ACCOUNT); if (!aux) return ERR_PTR(-ENOMEM); @@ -1237,7 +1237,7 @@ static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file, { struct bpf_event_entry *ee; - ee = kzalloc(sizeof(*ee), GFP_KERNEL); + ee = kzalloc_obj(*ee, GFP_KERNEL); if (ee) { ee->event = perf_file->private_data; ee->perf_file = perf_file; diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c index 4b58d56ecab1..b5d16050f7b3 100644 --- a/kernel/bpf/bpf_iter.c +++ b/kernel/bpf/bpf_iter.c @@ -295,7 +295,7 @@ int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info) { struct bpf_iter_target_info *tinfo; - tinfo = kzalloc(sizeof(*tinfo), GFP_KERNEL); + tinfo = kzalloc_obj(*tinfo, GFP_KERNEL); if (!tinfo) return -ENOMEM; @@ -548,7 +548,7 @@ int bpf_iter_link_attach(const union bpf_attr *attr, bpfptr_t uattr, if (prog->sleepable && !bpf_iter_target_support_resched(tinfo)) return -EINVAL; - link = kzalloc(sizeof(*link), GFP_USER | __GFP_NOWARN); + link = kzalloc_obj(*link, GFP_USER | __GFP_NOWARN); if (!link) return -ENOMEM; diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c index c43346cb3d76..1ff292a6f3ed 100644 --- a/kernel/bpf/bpf_struct_ops.c +++ b/kernel/bpf/bpf_struct_ops.c @@ -218,7 +218,7 @@ static int prepare_arg_info(struct btf *btf, args = btf_params(func_proto); stub_args = btf_params(stub_func_proto); - info_buf = kcalloc(nargs, sizeof(*info_buf), GFP_KERNEL); + info_buf = kzalloc_objs(*info_buf, nargs, GFP_KERNEL); if (!info_buf) return -ENOMEM; @@ -378,8 +378,7 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc, if (!is_valid_value_type(btf, value_id, t, value_name)) return -EINVAL; - arg_info = kcalloc(btf_type_vlen(t), sizeof(*arg_info), - GFP_KERNEL); + arg_info = kzalloc_objs(*arg_info, btf_type_vlen(t), GFP_KERNEL); if (!arg_info) return -ENOMEM; @@ -721,7 +720,7 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, if (uvalue->common.state || refcount_read(&uvalue->common.refcnt)) return -EINVAL; - tlinks = kcalloc(BPF_TRAMP_MAX, sizeof(*tlinks), GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); if (!tlinks) return -ENOMEM; @@ -815,7 +814,7 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, /* Poison pointer on error instead of return for backward compatibility */ bpf_prog_assoc_struct_ops(prog, &st_map->map); - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { bpf_prog_put(prog); err = -ENOMEM; @@ -825,7 +824,7 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, &bpf_struct_ops_link_lops, prog, prog->expected_attach_type); *plink++ = &link->link; - ksym = kzalloc(sizeof(*ksym), GFP_USER); + ksym = kzalloc_obj(*ksym, GFP_USER); if (!ksym) { err = -ENOMEM; goto reset_unlock; @@ -1376,7 +1375,7 @@ int bpf_struct_ops_link_create(union bpf_attr *attr) goto err_out; } - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto err_out; diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 7708958e3fb8..ee9037aa9ab7 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -1729,8 +1729,8 @@ static int btf_add_type(struct btf_verifier_env *env, struct btf_type *t) new_size = min_t(u32, BTF_MAX_TYPE, btf->types_size + expand_by); - new_types = kvcalloc(new_size, sizeof(*new_types), - GFP_KERNEL | __GFP_NOWARN); + new_types = kvzalloc_objs(*new_types, new_size, + GFP_KERNEL | __GFP_NOWARN); if (!new_types) return -ENOMEM; @@ -4072,7 +4072,7 @@ struct btf_record *btf_parse_fields(const struct btf *btf, const struct btf_type /* This needs to be kzalloc to zero out padding and unused fields, see * comment in btf_record_equal. */ - rec = kzalloc(struct_size(rec, fields, cnt), GFP_KERNEL_ACCOUNT | __GFP_NOWARN); + rec = kzalloc_flex(*rec, fields, cnt, GFP_KERNEL_ACCOUNT | __GFP_NOWARN); if (!rec) return ERR_PTR(-ENOMEM); @@ -5687,7 +5687,7 @@ btf_parse_struct_metas(struct bpf_verifier_log *log, struct btf *btf) BUILD_BUG_ON(offsetof(struct btf_id_set, cnt) != 0); BUILD_BUG_ON(sizeof(struct btf_id_set) != sizeof(u32)); - aof = kmalloc(sizeof(*aof), GFP_KERNEL | __GFP_NOWARN); + aof = kmalloc_obj(*aof, GFP_KERNEL | __GFP_NOWARN); if (!aof) return ERR_PTR(-ENOMEM); aof->cnt = 0; @@ -5885,7 +5885,7 @@ static struct btf *btf_parse(const union bpf_attr *attr, bpfptr_t uattr, u32 uat if (attr->btf_size > BTF_MAX_SIZE) return ERR_PTR(-E2BIG); - env = kzalloc(sizeof(*env), GFP_KERNEL | __GFP_NOWARN); + env = kzalloc_obj(*env, GFP_KERNEL | __GFP_NOWARN); if (!env) return ERR_PTR(-ENOMEM); @@ -5897,7 +5897,7 @@ static struct btf *btf_parse(const union bpf_attr *attr, bpfptr_t uattr, u32 uat if (err) goto errout_free; - btf = kzalloc(sizeof(*btf), GFP_KERNEL | __GFP_NOWARN); + btf = kzalloc_obj(*btf, GFP_KERNEL | __GFP_NOWARN); if (!btf) { err = -ENOMEM; goto errout; @@ -6314,7 +6314,7 @@ static struct btf *btf_parse_base(struct btf_verifier_env *env, const char *name if (!IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) return ERR_PTR(-ENOENT); - btf = kzalloc(sizeof(*btf), GFP_KERNEL | __GFP_NOWARN); + btf = kzalloc_obj(*btf, GFP_KERNEL | __GFP_NOWARN); if (!btf) { err = -ENOMEM; goto errout; @@ -6365,7 +6365,7 @@ struct btf *btf_parse_vmlinux(void) struct btf *btf; int err; - env = kzalloc(sizeof(*env), GFP_KERNEL | __GFP_NOWARN); + env = kzalloc_obj(*env, GFP_KERNEL | __GFP_NOWARN); if (!env) return ERR_PTR(-ENOMEM); @@ -6415,7 +6415,7 @@ static struct btf *btf_parse_module(const char *module_name, const void *data, if (!vmlinux_btf) return ERR_PTR(-EINVAL); - env = kzalloc(sizeof(*env), GFP_KERNEL | __GFP_NOWARN); + env = kzalloc_obj(*env, GFP_KERNEL | __GFP_NOWARN); if (!env) return ERR_PTR(-ENOMEM); @@ -6432,7 +6432,7 @@ static struct btf *btf_parse_module(const char *module_name, const void *data, base_btf = vmlinux_btf; } - btf = kzalloc(sizeof(*btf), GFP_KERNEL | __GFP_NOWARN); + btf = kzalloc_obj(*btf, GFP_KERNEL | __GFP_NOWARN); if (!btf) { err = -ENOMEM; goto errout; @@ -8306,7 +8306,7 @@ static int btf_module_notify(struct notifier_block *nb, unsigned long op, switch (op) { case MODULE_STATE_COMING: - btf_mod = kzalloc(sizeof(*btf_mod), GFP_KERNEL); + btf_mod = kzalloc_obj(*btf_mod, GFP_KERNEL); if (!btf_mod) { err = -ENOMEM; goto out; @@ -8341,7 +8341,7 @@ static int btf_module_notify(struct notifier_block *nb, unsigned long op, if (IS_ENABLED(CONFIG_SYSFS)) { struct bin_attribute *attr; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (!attr) goto out; @@ -8689,7 +8689,7 @@ static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook, } if (!tab) { - tab = kzalloc(sizeof(*tab), GFP_KERNEL | __GFP_NOWARN); + tab = kzalloc_obj(*tab, GFP_KERNEL | __GFP_NOWARN); if (!tab) return -ENOMEM; btf->kfunc_set_tab = tab; @@ -9439,7 +9439,7 @@ int bpf_core_apply(struct bpf_core_ctx *ctx, const struct bpf_core_relo *relo, /* ~4k of temp memory necessary to convert LLVM spec like "0:1:0:5" * into arrays of btf_ids of struct fields and array indices. */ - specs = kcalloc(3, sizeof(*specs), GFP_KERNEL_ACCOUNT); + specs = kzalloc_objs(*specs, 3, GFP_KERNEL_ACCOUNT); if (!specs) return -ENOMEM; @@ -9464,7 +9464,8 @@ int bpf_core_apply(struct bpf_core_ctx *ctx, const struct bpf_core_relo *relo, goto out; } if (cc->cnt) { - cands.cands = kcalloc(cc->cnt, sizeof(*cands.cands), GFP_KERNEL_ACCOUNT); + cands.cands = kzalloc_objs(*cands.cands, cc->cnt, + GFP_KERNEL_ACCOUNT); if (!cands.cands) { err = -ENOMEM; goto out; @@ -9616,7 +9617,7 @@ btf_add_struct_ops(struct btf *btf, struct bpf_struct_ops *st_ops, tab = btf->struct_ops_tab; if (!tab) { - tab = kzalloc(struct_size(tab, ops, 4), GFP_KERNEL); + tab = kzalloc_flex(*tab, ops, 4, GFP_KERNEL); if (!tab) return -ENOMEM; tab->capacity = 4; @@ -9705,7 +9706,7 @@ int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops) if (IS_ERR(btf)) return PTR_ERR(btf); - log = kzalloc(sizeof(*log), GFP_KERNEL | __GFP_NOWARN); + log = kzalloc_obj(*log, GFP_KERNEL | __GFP_NOWARN); if (!log) { err = -ENOMEM; goto errout; diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index b029f0369ecf..5d7a35e476e9 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -845,7 +845,7 @@ static int __cgroup_bpf_attach(struct cgroup *cgrp, if (pl) { old_prog = pl->prog; } else { - pl = kmalloc(sizeof(*pl), GFP_KERNEL); + pl = kmalloc_obj(*pl, GFP_KERNEL); if (!pl) { bpf_cgroup_storages_free(new_storage); return -ENOMEM; @@ -1488,7 +1488,7 @@ int cgroup_bpf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) if (IS_ERR(cgrp)) return PTR_ERR(cgrp); - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto out_put_cgroup; diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 5ab6bace7d0d..80b3e94f3fe3 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -108,7 +108,7 @@ struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flag if (fp == NULL) return NULL; - aux = kzalloc(sizeof(*aux), bpf_memcg_flags(GFP_KERNEL | gfp_extra_flags)); + aux = kzalloc_obj(*aux, bpf_memcg_flags(GFP_KERNEL | gfp_extra_flags)); if (aux == NULL) { vfree(fp); return NULL; @@ -180,9 +180,9 @@ int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog) if (!prog->aux->nr_linfo || !prog->jit_requested) return 0; - prog->aux->jited_linfo = kvcalloc(prog->aux->nr_linfo, - sizeof(*prog->aux->jited_linfo), - bpf_memcg_flags(GFP_KERNEL | __GFP_NOWARN)); + prog->aux->jited_linfo = kvzalloc_objs(*prog->aux->jited_linfo, + prog->aux->nr_linfo, + bpf_memcg_flags(GFP_KERNEL | __GFP_NOWARN)); if (!prog->aux->jited_linfo) return -ENOMEM; @@ -910,8 +910,8 @@ static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_ins struct bpf_prog_pack *pack; int err; - pack = kzalloc(struct_size(pack, bitmap, BITS_TO_LONGS(BPF_PROG_CHUNK_COUNT)), - GFP_KERNEL); + pack = kzalloc_flex(*pack, bitmap, BITS_TO_LONGS(BPF_PROG_CHUNK_COUNT), + GFP_KERNEL); if (!pack) return NULL; pack->ptr = bpf_jit_alloc_exec(BPF_PROG_PACK_SIZE); @@ -2597,7 +2597,7 @@ struct bpf_prog_array *bpf_prog_array_alloc(u32 prog_cnt, gfp_t flags) struct bpf_prog_array *p; if (prog_cnt) - p = kzalloc(struct_size(p, items, prog_cnt + 1), flags); + p = kzalloc_flex(*p, items, prog_cnt + 1, flags); else p = &bpf_empty_prog_array.hdr; diff --git a/kernel/bpf/crypto.c b/kernel/bpf/crypto.c index 7e75a1936256..2b0660c32c92 100644 --- a/kernel/bpf/crypto.c +++ b/kernel/bpf/crypto.c @@ -68,7 +68,7 @@ int bpf_crypto_register_type(const struct bpf_crypto_type *type) goto unlock; } - node = kmalloc(sizeof(*node), GFP_KERNEL); + node = kmalloc_obj(*node, GFP_KERNEL); err = -ENOMEM; if (!node) goto unlock; @@ -176,7 +176,7 @@ bpf_crypto_ctx_create(const struct bpf_crypto_params *params, u32 params__sz, goto err_module_put; } - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { *err = -ENOMEM; goto err_module_put; diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 7ac32798eb04..42a692682f18 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -3993,7 +3993,7 @@ __bpf_kfunc struct bpf_key *bpf_lookup_user_key(s32 serial, u64 flags) if (IS_ERR(key_ref)) return NULL; - bkey = kmalloc(sizeof(*bkey), GFP_KERNEL); + bkey = kmalloc_obj(*bkey, GFP_KERNEL); if (!bkey) { key_put(key_ref_to_ptr(key_ref)); return NULL; @@ -4033,7 +4033,7 @@ __bpf_kfunc struct bpf_key *bpf_lookup_system_key(u64 id) if (system_keyring_id_check(id) < 0) return NULL; - bkey = kmalloc(sizeof(*bkey), GFP_ATOMIC); + bkey = kmalloc_obj(*bkey, GFP_ATOMIC); if (!bkey) return NULL; diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 005ea3a2cda7..a111b0e9214e 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -195,7 +195,7 @@ static struct map_iter *map_iter_alloc(struct bpf_map *map) { struct map_iter *iter; - iter = kzalloc(sizeof(*iter), GFP_KERNEL | __GFP_NOWARN); + iter = kzalloc_obj(*iter, GFP_KERNEL | __GFP_NOWARN); if (!iter) goto error; @@ -1044,7 +1044,7 @@ static int bpf_init_fs_context(struct fs_context *fc) { struct bpf_mount_opts *opts; - opts = kzalloc(sizeof(struct bpf_mount_opts), GFP_KERNEL); + opts = kzalloc_obj(struct bpf_mount_opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c index 60db5d655495..998986853c61 100644 --- a/kernel/bpf/liveness.c +++ b/kernel/bpf/liveness.c @@ -193,8 +193,8 @@ static struct func_instance *__lookup_instance(struct bpf_verifier_env *env, result = kvzalloc(size, GFP_KERNEL_ACCOUNT); if (!result) return ERR_PTR(-ENOMEM); - result->must_write_set = kvcalloc(subprog_sz, sizeof(*result->must_write_set), - GFP_KERNEL_ACCOUNT); + result->must_write_set = kvzalloc_objs(*result->must_write_set, + subprog_sz, GFP_KERNEL_ACCOUNT); if (!result->must_write_set) { kvfree(result); return ERR_PTR(-ENOMEM); @@ -217,7 +217,7 @@ static struct func_instance *lookup_instance(struct bpf_verifier_env *env, int bpf_stack_liveness_init(struct bpf_verifier_env *env) { - env->liveness = kvzalloc(sizeof(*env->liveness), GFP_KERNEL_ACCOUNT); + env->liveness = kvzalloc_obj(*env->liveness, GFP_KERNEL_ACCOUNT); if (!env->liveness) return -ENOMEM; hash_init(env->liveness->func_instances); @@ -266,7 +266,8 @@ static struct per_frame_masks *alloc_frame_masks(struct bpf_verifier_env *env, struct per_frame_masks *arr; if (!instance->frames[frame]) { - arr = kvcalloc(instance->insn_cnt, sizeof(*arr), GFP_KERNEL_ACCOUNT); + arr = kvzalloc_objs(*arr, instance->insn_cnt, + GFP_KERNEL_ACCOUNT); instance->frames[frame] = arr; if (!arr) return ERR_PTR(-ENOMEM); diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c index be66d7e520e0..1adeb4d3b8cf 100644 --- a/kernel/bpf/lpm_trie.c +++ b/kernel/bpf/lpm_trie.c @@ -683,9 +683,9 @@ static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key) if (!key || key->prefixlen > trie->max_prefixlen) goto find_leftmost; - node_stack = kmalloc_array(trie->max_prefixlen + 1, - sizeof(struct lpm_trie_node *), - GFP_ATOMIC | __GFP_NOWARN); + node_stack = kmalloc_objs(struct lpm_trie_node *, + trie->max_prefixlen + 1, + GFP_ATOMIC | __GFP_NOWARN); if (!node_stack) return -ENOMEM; diff --git a/kernel/bpf/net_namespace.c b/kernel/bpf/net_namespace.c index 8e88201c98bf..25f30f9edaef 100644 --- a/kernel/bpf/net_namespace.c +++ b/kernel/bpf/net_namespace.c @@ -494,7 +494,7 @@ int netns_bpf_link_create(const union bpf_attr *attr, struct bpf_prog *prog) if (IS_ERR(net)) return PTR_ERR(net); - net_link = kzalloc(sizeof(*net_link), GFP_USER); + net_link = kzalloc_obj(*net_link, GFP_USER); if (!net_link) { err = -ENOMEM; goto out_put_net; diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c index 227f9b5f388b..7fcbbe0ad925 100644 --- a/kernel/bpf/offload.c +++ b/kernel/bpf/offload.c @@ -72,7 +72,7 @@ static int __bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev, struct bpf_offload_netdev *ondev; int err; - ondev = kzalloc(sizeof(*ondev), GFP_KERNEL); + ondev = kzalloc_obj(*ondev, GFP_KERNEL); if (!ondev) return -ENOMEM; @@ -182,7 +182,7 @@ static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *n struct bpf_prog_offload *offload; int err; - offload = kzalloc(sizeof(*offload), GFP_USER); + offload = kzalloc_obj(*offload, GFP_USER); if (!offload) return -ENOMEM; @@ -777,7 +777,7 @@ bpf_offload_dev_create(const struct bpf_prog_offload_ops *ops, void *priv) { struct bpf_offload_dev *offdev; - offdev = kzalloc(sizeof(*offdev), GFP_KERNEL); + offdev = kzalloc_obj(*offdev, GFP_KERNEL); if (!offdev) return ERR_PTR(-ENOMEM); diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index dd89bf809772..2d14fb6d0ed0 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3633,7 +3633,7 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog, if (prog->expected_attach_type == BPF_TRACE_FSESSION) { struct bpf_fsession_link *fslink; - fslink = kzalloc(sizeof(*fslink), GFP_USER); + fslink = kzalloc_obj(*fslink, GFP_USER); if (fslink) { bpf_link_init(&fslink->fexit.link, BPF_LINK_TYPE_TRACING, &bpf_tracing_link_lops, prog, attach_type); @@ -3643,7 +3643,7 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog, link = NULL; } } else { - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); } if (!link) { err = -ENOMEM; @@ -4183,7 +4183,7 @@ static int bpf_perf_link_attach(const union bpf_attr *attr, struct bpf_prog *pro if (IS_ERR(perf_file)) return PTR_ERR(perf_file); - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto out_put_file; @@ -4261,7 +4261,7 @@ static int bpf_raw_tp_link_attach(struct bpf_prog *prog, if (!btp) return -ENOENT; - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto out_put_btp; @@ -6076,9 +6076,8 @@ static int bpf_prog_bind_map(union bpf_attr *attr) goto out_unlock; } - used_maps_new = kmalloc_array(prog->aux->used_map_cnt + 1, - sizeof(used_maps_new[0]), - GFP_KERNEL); + used_maps_new = kmalloc_objs(used_maps_new[0], + prog->aux->used_map_cnt + 1, GFP_KERNEL); if (!used_maps_new) { ret = -ENOMEM; goto out_unlock; diff --git a/kernel/bpf/tcx.c b/kernel/bpf/tcx.c index efd987ea6872..02db0113b8e7 100644 --- a/kernel/bpf/tcx.c +++ b/kernel/bpf/tcx.c @@ -321,7 +321,7 @@ int tcx_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) ret = -ENODEV; goto out; } - tcx = kzalloc(sizeof(*tcx), GFP_USER); + tcx = kzalloc_obj(*tcx, GFP_USER); if (!tcx) { ret = -ENOMEM; goto out; diff --git a/kernel/bpf/token.c b/kernel/bpf/token.c index 7e4aa1e44b50..e85a179523f0 100644 --- a/kernel/bpf/token.c +++ b/kernel/bpf/token.c @@ -172,7 +172,7 @@ int bpf_token_create(union bpf_attr *attr) if (fdf.err) return fdf.err; - token = kzalloc(sizeof(*token), GFP_USER); + token = kzalloc_obj(*token, GFP_USER); if (!token) return -ENOMEM; diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c index 952cd7932461..b94565843f77 100644 --- a/kernel/bpf/trampoline.c +++ b/kernel/bpf/trampoline.c @@ -256,7 +256,7 @@ static int direct_ops_mod(struct bpf_trampoline *tr, void *addr, bool lock_direc */ static int direct_ops_alloc(struct bpf_trampoline *tr) { - tr->fops = kzalloc(sizeof(struct ftrace_ops), GFP_KERNEL); + tr->fops = kzalloc_obj(struct ftrace_ops, GFP_KERNEL); if (!tr->fops) return -ENOMEM; tr->fops->private = tr; @@ -342,7 +342,7 @@ static struct bpf_trampoline *bpf_trampoline_lookup(u64 key, unsigned long ip) goto out; } } - tr = kzalloc(sizeof(*tr), GFP_KERNEL); + tr = kzalloc_obj(*tr, GFP_KERNEL); if (!tr) goto out; if (direct_ops_alloc(tr)) { @@ -446,7 +446,7 @@ bpf_trampoline_get_progs(const struct bpf_trampoline *tr, int *total, bool *ip_a int kind; *total = 0; - tlinks = kcalloc(BPF_TRAMP_MAX, sizeof(*tlinks), GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); if (!tlinks) return ERR_PTR(-ENOMEM); @@ -569,7 +569,7 @@ static struct bpf_tramp_image *bpf_tramp_image_alloc(u64 key, int size) void *image; int err = -ENOMEM; - im = kzalloc(sizeof(*im), GFP_KERNEL); + im = kzalloc_obj(*im, GFP_KERNEL); if (!im) goto out; @@ -928,7 +928,7 @@ static struct bpf_shim_tramp_link *cgroup_shim_alloc(const struct bpf_prog *prog struct bpf_shim_tramp_link *shim_link = NULL; struct bpf_prog *p; - shim_link = kzalloc(sizeof(*shim_link), GFP_USER); + shim_link = kzalloc_obj(*shim_link, GFP_USER); if (!shim_link) return NULL; diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index dbaafb64d3bd..63f05d90e708 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1779,7 +1779,7 @@ static int copy_verifier_state(struct bpf_verifier_state *dst_state, for (i = 0; i <= src->curframe; i++) { dst = dst_state->frame[i]; if (!dst) { - dst = kzalloc(sizeof(*dst), GFP_KERNEL_ACCOUNT); + dst = kzalloc_obj(*dst, GFP_KERNEL_ACCOUNT); if (!dst) return -ENOMEM; dst_state->frame[i] = dst; @@ -2127,7 +2127,7 @@ static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, struct bpf_verifier_stack_elem *elem; int err; - elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL_ACCOUNT); + elem = kzalloc_obj(struct bpf_verifier_stack_elem, GFP_KERNEL_ACCOUNT); if (!elem) return ERR_PTR(-ENOMEM); @@ -2949,7 +2949,7 @@ static struct bpf_verifier_state *push_async_cb(struct bpf_verifier_env *env, struct bpf_verifier_stack_elem *elem; struct bpf_func_state *frame; - elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL_ACCOUNT); + elem = kzalloc_obj(struct bpf_verifier_stack_elem, GFP_KERNEL_ACCOUNT); if (!elem) return ERR_PTR(-ENOMEM); @@ -2972,7 +2972,7 @@ static struct bpf_verifier_state *push_async_cb(struct bpf_verifier_env *env, */ elem->st.branches = 1; elem->st.in_sleepable = is_sleepable; - frame = kzalloc(sizeof(*frame), GFP_KERNEL_ACCOUNT); + frame = kzalloc_obj(*frame, GFP_KERNEL_ACCOUNT); if (!frame) return ERR_PTR(-ENOMEM); init_func_state(env, frame, @@ -3410,7 +3410,7 @@ static int add_kfunc_call(struct bpf_verifier_env *env, u32 func_id, s16 offset) return -EINVAL; } - tab = kzalloc(sizeof(*tab), GFP_KERNEL_ACCOUNT); + tab = kzalloc_obj(*tab, GFP_KERNEL_ACCOUNT); if (!tab) return -ENOMEM; prog_aux->kfunc_tab = tab; @@ -3426,7 +3426,7 @@ static int add_kfunc_call(struct bpf_verifier_env *env, u32 func_id, s16 offset) return 0; if (!btf_tab && offset) { - btf_tab = kzalloc(sizeof(*btf_tab), GFP_KERNEL_ACCOUNT); + btf_tab = kzalloc_obj(*btf_tab, GFP_KERNEL_ACCOUNT); if (!btf_tab) return -ENOMEM; prog_aux->kfunc_btf_tab = btf_tab; @@ -10580,7 +10580,7 @@ static int setup_func_entry(struct bpf_verifier_env *env, int subprog, int calls } caller = state->frame[state->curframe]; - callee = kzalloc(sizeof(*callee), GFP_KERNEL_ACCOUNT); + callee = kzalloc_obj(*callee, GFP_KERNEL_ACCOUNT); if (!callee) return -ENOMEM; state->frame[state->curframe + 1] = callee; @@ -18860,11 +18860,13 @@ static int check_cfg(struct bpf_verifier_env *env) int *insn_stack, *insn_state; int ex_insn_beg, i, ret = 0; - insn_state = env->cfg.insn_state = kvcalloc(insn_cnt, sizeof(int), GFP_KERNEL_ACCOUNT); + insn_state = env->cfg.insn_state = kvzalloc_objs(int, insn_cnt, + GFP_KERNEL_ACCOUNT); if (!insn_state) return -ENOMEM; - insn_stack = env->cfg.insn_stack = kvcalloc(insn_cnt, sizeof(int), GFP_KERNEL_ACCOUNT); + insn_stack = env->cfg.insn_stack = kvzalloc_objs(int, insn_cnt, + GFP_KERNEL_ACCOUNT); if (!insn_stack) { kvfree(insn_state); return -ENOMEM; @@ -18951,9 +18953,9 @@ static int compute_postorder(struct bpf_verifier_env *env) int *stack = NULL, *postorder = NULL, *state = NULL; struct bpf_iarray *succ; - postorder = kvcalloc(env->prog->len, sizeof(int), GFP_KERNEL_ACCOUNT); - state = kvcalloc(env->prog->len, sizeof(int), GFP_KERNEL_ACCOUNT); - stack = kvcalloc(env->prog->len, sizeof(int), GFP_KERNEL_ACCOUNT); + postorder = kvzalloc_objs(int, env->prog->len, GFP_KERNEL_ACCOUNT); + state = kvzalloc_objs(int, env->prog->len, GFP_KERNEL_ACCOUNT); + stack = kvzalloc_objs(int, env->prog->len, GFP_KERNEL_ACCOUNT); if (!postorder || !state || !stack) { kvfree(postorder); kvfree(state); @@ -19147,7 +19149,8 @@ static int check_btf_func(struct bpf_verifier_env *env, urecord = make_bpfptr(attr->func_info, uattr.is_kernel); krecord = prog->aux->func_info; - info_aux = kcalloc(nfuncs, sizeof(*info_aux), GFP_KERNEL_ACCOUNT | __GFP_NOWARN); + info_aux = kzalloc_objs(*info_aux, nfuncs, + GFP_KERNEL_ACCOUNT | __GFP_NOWARN); if (!info_aux) return -ENOMEM; @@ -19232,8 +19235,8 @@ static int check_btf_line(struct bpf_verifier_env *env, /* Need to zero it in case the userspace may * pass in a smaller bpf_line_info object. */ - linfo = kvcalloc(nr_linfo, sizeof(struct bpf_line_info), - GFP_KERNEL_ACCOUNT | __GFP_NOWARN); + linfo = kvzalloc_objs(struct bpf_line_info, nr_linfo, + GFP_KERNEL_ACCOUNT | __GFP_NOWARN); if (!linfo) return -ENOMEM; @@ -20619,7 +20622,8 @@ hit: if (loop) { struct bpf_scc_backedge *backedge; - backedge = kzalloc(sizeof(*backedge), GFP_KERNEL_ACCOUNT); + backedge = kzalloc_obj(*backedge, + GFP_KERNEL_ACCOUNT); if (!backedge) return -ENOMEM; err = copy_verifier_state(&backedge->state, cur); @@ -20683,7 +20687,7 @@ miss: * When looping the sl->state.branches will be > 0 and this state * will not be considered for equivalence until branches == 0. */ - new_sl = kzalloc(sizeof(struct bpf_verifier_state_list), GFP_KERNEL_ACCOUNT); + new_sl = kzalloc_obj(struct bpf_verifier_state_list, GFP_KERNEL_ACCOUNT); if (!new_sl) return -ENOMEM; env->total_states++; @@ -22765,7 +22769,7 @@ static int jit_subprogs(struct bpf_verifier_env *env) goto out_undo_insn; err = -ENOMEM; - func = kcalloc(env->subprog_cnt, sizeof(prog), GFP_KERNEL); + func = kzalloc_objs(prog, env->subprog_cnt, GFP_KERNEL); if (!func) goto out_undo_insn; @@ -24472,14 +24476,14 @@ static int do_check_common(struct bpf_verifier_env *env, int subprog) env->prev_linfo = NULL; env->pass_cnt++; - state = kzalloc(sizeof(struct bpf_verifier_state), GFP_KERNEL_ACCOUNT); + state = kzalloc_obj(struct bpf_verifier_state, GFP_KERNEL_ACCOUNT); if (!state) return -ENOMEM; state->curframe = 0; state->speculative = false; state->branches = 1; state->in_sleepable = env->prog->sleepable; - state->frame[0] = kzalloc(sizeof(struct bpf_func_state), GFP_KERNEL_ACCOUNT); + state->frame[0] = kzalloc_obj(struct bpf_func_state, GFP_KERNEL_ACCOUNT); if (!state->frame[0]) { kfree(state); return -ENOMEM; @@ -25600,7 +25604,7 @@ static int compute_live_registers(struct bpf_verifier_env *env) * - repeat the computation while {in,out} fields changes for * any instruction. */ - state = kvcalloc(insn_cnt, sizeof(*state), GFP_KERNEL_ACCOUNT); + state = kvzalloc_objs(*state, insn_cnt, GFP_KERNEL_ACCOUNT); if (!state) { err = -ENOMEM; goto out; @@ -25828,7 +25832,8 @@ dfs_continue: dfs_sz--; } } - env->scc_info = kvcalloc(next_scc_id, sizeof(*env->scc_info), GFP_KERNEL_ACCOUNT); + env->scc_info = kvzalloc_objs(*env->scc_info, next_scc_id, + GFP_KERNEL_ACCOUNT); if (!env->scc_info) { err = -ENOMEM; goto exit; @@ -25859,7 +25864,7 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr, __u3 /* 'struct bpf_verifier_env' can be global, but since it's not small, * allocate/free it every time bpf_check() is called */ - env = kvzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL_ACCOUNT); + env = kvzalloc_obj(struct bpf_verifier_env, GFP_KERNEL_ACCOUNT); if (!env) return -ENOMEM; @@ -25923,9 +25928,9 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr, __u3 env->test_state_freq = attr->prog_flags & BPF_F_TEST_STATE_FREQ; env->test_reg_invariants = attr->prog_flags & BPF_F_TEST_REG_INVARIANTS; - env->explored_states = kvcalloc(state_htab_size(env), - sizeof(struct list_head), - GFP_KERNEL_ACCOUNT); + env->explored_states = kvzalloc_objs(struct list_head, + state_htab_size(env), + GFP_KERNEL_ACCOUNT); ret = -ENOMEM; if (!env->explored_states) goto skip_full_check; @@ -26062,9 +26067,9 @@ skip_full_check: if (env->used_map_cnt) { /* if program passed verifier, update used_maps in bpf_prog_info */ - env->prog->aux->used_maps = kmalloc_array(env->used_map_cnt, - sizeof(env->used_maps[0]), - GFP_KERNEL_ACCOUNT); + env->prog->aux->used_maps = kmalloc_objs(env->used_maps[0], + env->used_map_cnt, + GFP_KERNEL_ACCOUNT); if (!env->prog->aux->used_maps) { ret = -ENOMEM; @@ -26077,9 +26082,9 @@ skip_full_check: } if (env->used_btf_cnt) { /* if program passed verifier, update used_btfs in bpf_prog_aux */ - env->prog->aux->used_btfs = kmalloc_array(env->used_btf_cnt, - sizeof(env->used_btfs[0]), - GFP_KERNEL_ACCOUNT); + env->prog->aux->used_btfs = kmalloc_objs(env->used_btfs[0], + env->used_btf_cnt, + GFP_KERNEL_ACCOUNT); if (!env->prog->aux->used_btfs) { ret = -ENOMEM; goto err_release_maps; diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 724950c4b690..0449b062dd1c 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -317,7 +317,7 @@ static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, return l; /* entry not found; create a new one */ - l = kzalloc(sizeof(struct cgroup_pidlist), GFP_KERNEL); + l = kzalloc_obj(struct cgroup_pidlist, GFP_KERNEL); if (!l) return l; @@ -352,7 +352,7 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, * show up until sometime later on. */ length = cgroup_task_count(cgrp); - array = kvmalloc_array(length, sizeof(pid_t), GFP_KERNEL); + array = kvmalloc_objs(pid_t, length, GFP_KERNEL); if (!array) return -ENOMEM; /* now, populate the array */ @@ -1237,7 +1237,7 @@ static int cgroup1_root_to_use(struct fs_context *fc) if (ctx->ns != &init_cgroup_ns) return -EPERM; - root = kzalloc(sizeof(*root), GFP_KERNEL); + root = kzalloc_obj(*root, GFP_KERNEL); if (!root) return -ENOMEM; diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 8af4351536cf..7d220276d019 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1168,7 +1168,7 @@ static int allocate_cgrp_cset_links(int count, struct list_head *tmp_links) INIT_LIST_HEAD(tmp_links); for (i = 0; i < count; i++) { - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) { free_cgrp_cset_links(tmp_links); return -ENOMEM; @@ -1241,7 +1241,7 @@ static struct css_set *find_css_set(struct css_set *old_cset, if (cset) return cset; - cset = kzalloc(sizeof(*cset), GFP_KERNEL); + cset = kzalloc_obj(*cset, GFP_KERNEL); if (!cset) return NULL; @@ -2350,7 +2350,7 @@ static int cgroup_init_fs_context(struct fs_context *fc) { struct cgroup_fs_context *ctx; - ctx = kzalloc(sizeof(struct cgroup_fs_context), GFP_KERNEL); + ctx = kzalloc_obj(struct cgroup_fs_context, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -4251,7 +4251,7 @@ static int cgroup_file_open(struct kernfs_open_file *of) struct cgroup_file_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -5844,7 +5844,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, int ret; /* allocate the cgroup and its ID, 0 is reserved for the root */ - cgrp = kzalloc(struct_size(cgrp, _low_ancestors, level), GFP_KERNEL); + cgrp = kzalloc_flex(*cgrp, _low_ancestors, level, GFP_KERNEL); if (!cgrp) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c index 7a23b9e8778f..8e7ffc205c3b 100644 --- a/kernel/cgroup/cpuset-v1.c +++ b/kernel/cgroup/cpuset-v1.c @@ -316,7 +316,7 @@ void cpuset1_hotplug_update_tasks(struct cpuset *cs, css_tryget_online(&cs->css)) { struct cpuset_remove_tasks_struct *s; - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (WARN_ON_ONCE(!s)) { css_put(&cs->css); return; @@ -653,7 +653,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, if (!doms) goto done; - dattr = kmalloc(sizeof(struct sched_domain_attr), GFP_KERNEL); + dattr = kmalloc_obj(struct sched_domain_attr, GFP_KERNEL); if (dattr) { *dattr = SD_ATTR_INIT; update_domain_attr_tree(dattr, &top_cpuset); @@ -664,7 +664,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, goto done; } - csa = kmalloc_array(nr_cpusets(), sizeof(cp), GFP_KERNEL); + csa = kmalloc_objs(cp, nr_cpusets(), GFP_KERNEL); if (!csa) goto done; csn = 0; @@ -727,8 +727,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, * The rest of the code, including the scheduler, can deal with * dattr==NULL case. No need to abort if alloc fails. */ - dattr = kmalloc_array(ndoms, sizeof(struct sched_domain_attr), - GFP_KERNEL); + dattr = kmalloc_objs(struct sched_domain_attr, ndoms, GFP_KERNEL); for (nslot = 0, i = 0; i < csn; i++) { nslot_update = 0; diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 7607dfe516e6..384d9d6e323b 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -536,7 +536,7 @@ static struct cpuset *dup_or_alloc_cpuset(struct cpuset *cs) /* Allocate base structure */ trial = cs ? kmemdup(cs, sizeof(*cs), GFP_KERNEL) : - kzalloc(sizeof(*cs), GFP_KERNEL); + kzalloc_obj(*cs, GFP_KERNEL); if (!trial) return NULL; @@ -791,7 +791,7 @@ static int generate_sched_domains(cpumask_var_t **domains, goto generate_doms; } - csa = kmalloc_array(nr_cpusets(), sizeof(cp), GFP_KERNEL); + csa = kmalloc_objs(cp, nr_cpusets(), GFP_KERNEL); if (!csa) goto done; @@ -835,8 +835,7 @@ generate_doms: * The rest of the code, including the scheduler, can deal with * dattr==NULL case. No need to abort if alloc fails. */ - dattr = kmalloc_array(ndoms, sizeof(struct sched_domain_attr), - GFP_KERNEL); + dattr = kmalloc_objs(struct sched_domain_attr, ndoms, GFP_KERNEL); /* * Cgroup v2 doesn't support domain attributes, just set all of them @@ -2479,7 +2478,7 @@ static void cpuset_migrate_mm(struct mm_struct *mm, const nodemask_t *from, return; } - mwork = kzalloc(sizeof(*mwork), GFP_KERNEL); + mwork = kzalloc_obj(*mwork, GFP_KERNEL); if (mwork) { mwork->mm = mm; mwork->from = *from; @@ -2501,7 +2500,7 @@ static void schedule_flush_migrate_mm(void) { struct callback_head *flush_cb; - flush_cb = kzalloc(sizeof(struct callback_head), GFP_KERNEL); + flush_cb = kzalloc_obj(struct callback_head, GFP_KERNEL); if (!flush_cb) return; diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c index a5490097fe52..78429dd9e9c6 100644 --- a/kernel/cgroup/debug.c +++ b/kernel/cgroup/debug.c @@ -14,7 +14,7 @@ static struct cgroup_subsys_state * debug_css_alloc(struct cgroup_subsys_state *parent_css) { - struct cgroup_subsys_state *css = kzalloc(sizeof(*css), GFP_KERNEL); + struct cgroup_subsys_state *css = kzalloc_obj(*css, GFP_KERNEL); if (!css) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c index 1ea6afffa985..0c8c0a135231 100644 --- a/kernel/cgroup/dmem.c +++ b/kernel/cgroup/dmem.c @@ -222,7 +222,7 @@ static void dmemcs_free(struct cgroup_subsys_state *css) static struct cgroup_subsys_state * dmemcs_alloc(struct cgroup_subsys_state *parent_css) { - struct dmemcg_state *dmemcs = kzalloc(sizeof(*dmemcs), GFP_KERNEL); + struct dmemcg_state *dmemcs = kzalloc_obj(*dmemcs, GFP_KERNEL); if (!dmemcs) return ERR_PTR(-ENOMEM); @@ -359,7 +359,7 @@ alloc_pool_single(struct dmemcg_state *dmemcs, struct dmem_cgroup_region *region struct dmem_cgroup_pool_state *pool, *ppool = NULL; if (!*allocpool) { - pool = kzalloc(sizeof(*pool), GFP_NOWAIT); + pool = kzalloc_obj(*pool, GFP_NOWAIT); if (!pool) return ERR_PTR(-ENOMEM); } else { @@ -521,7 +521,7 @@ struct dmem_cgroup_region *dmem_cgroup_register_region(u64 size, const char *fmt if (!region_name) return ERR_PTR(-ENOMEM); - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc_obj(*ret, GFP_KERNEL); if (!ret) { kfree(region_name); return ERR_PTR(-ENOMEM); @@ -597,7 +597,7 @@ get_cg_pool_unlocked(struct dmemcg_state *cg, struct dmem_cgroup_region *region) if (WARN_ON(allocpool)) continue; - allocpool = kzalloc(sizeof(*allocpool), GFP_KERNEL); + allocpool = kzalloc_obj(*allocpool, GFP_KERNEL); if (allocpool) { pool = NULL; continue; diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c index 817c33450fee..85344b107873 100644 --- a/kernel/cgroup/legacy_freezer.c +++ b/kernel/cgroup/legacy_freezer.c @@ -81,7 +81,7 @@ freezer_css_alloc(struct cgroup_subsys_state *parent_css) { struct freezer *freezer; - freezer = kzalloc(sizeof(struct freezer), GFP_KERNEL); + freezer = kzalloc_obj(struct freezer, GFP_KERNEL); if (!freezer) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c index 6a01d91ea4cb..7c3ae3a76c8d 100644 --- a/kernel/cgroup/misc.c +++ b/kernel/cgroup/misc.c @@ -445,7 +445,7 @@ misc_cg_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) { cg = &root_cg; } else { - cg = kzalloc(sizeof(*cg), GFP_KERNEL); + cg = kzalloc_obj(*cg, GFP_KERNEL); if (!cg) return ERR_PTR(-ENOMEM); } diff --git a/kernel/cgroup/namespace.c b/kernel/cgroup/namespace.c index db9617556dd7..ea4ee13936be 100644 --- a/kernel/cgroup/namespace.c +++ b/kernel/cgroup/namespace.c @@ -24,7 +24,7 @@ static struct cgroup_namespace *alloc_cgroup_ns(void) struct cgroup_namespace *new_ns __free(kfree) = NULL; int ret; - new_ns = kzalloc(sizeof(struct cgroup_namespace), GFP_KERNEL_ACCOUNT); + new_ns = kzalloc_obj(struct cgroup_namespace, GFP_KERNEL_ACCOUNT); if (!new_ns) return ERR_PTR(-ENOMEM); ret = ns_common_init(new_ns); diff --git a/kernel/cgroup/pids.c b/kernel/cgroup/pids.c index 8f61114c36dd..6221573fc6ad 100644 --- a/kernel/cgroup/pids.c +++ b/kernel/cgroup/pids.c @@ -80,7 +80,7 @@ pids_css_alloc(struct cgroup_subsys_state *parent) { struct pids_cgroup *pids; - pids = kzalloc(sizeof(struct pids_cgroup), GFP_KERNEL); + pids = kzalloc_obj(struct pids_cgroup, GFP_KERNEL); if (!pids) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c index ef5878fb2005..9d3693574b11 100644 --- a/kernel/cgroup/rdma.c +++ b/kernel/cgroup/rdma.c @@ -134,7 +134,7 @@ get_cg_rpool_locked(struct rdma_cgroup *cg, struct rdmacg_device *device) if (rpool) return rpool; - rpool = kzalloc(sizeof(*rpool), GFP_KERNEL); + rpool = kzalloc_obj(*rpool, GFP_KERNEL); if (!rpool) return ERR_PTR(-ENOMEM); @@ -443,7 +443,7 @@ static ssize_t rdmacg_resource_set_max(struct kernfs_open_file *of, goto err; } - new_limits = kcalloc(RDMACG_RESOURCE_MAX, sizeof(int), GFP_KERNEL); + new_limits = kzalloc_objs(int, RDMACG_RESOURCE_MAX, GFP_KERNEL); if (!new_limits) { ret = -ENOMEM; goto err; @@ -566,7 +566,7 @@ rdmacg_css_alloc(struct cgroup_subsys_state *parent) { struct rdma_cgroup *cg; - cg = kzalloc(sizeof(*cg), GFP_KERNEL); + cg = kzalloc_obj(*cg, GFP_KERNEL); if (!cg) return ERR_PTR(-ENOMEM); diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 3952b3e102e0..2146ca0f0ed8 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -368,7 +368,7 @@ static int __crash_shrink_memory(struct resource *old_res, { struct resource *ram_res; - ram_res = kzalloc(sizeof(*ram_res), GFP_KERNEL); + ram_res = kzalloc_obj(*ram_res, GFP_KERNEL); if (!ram_res) return -ENOMEM; diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c index 37129243054d..13191d7c7a32 100644 --- a/kernel/crash_dump_dm_crypt.c +++ b/kernel/crash_dump_dm_crypt.c @@ -252,7 +252,7 @@ static struct config_item *config_keys_make_item(struct config_group *group, return ERR_PTR(-EINVAL); } - config_key = kzalloc(sizeof(struct config_key), GFP_KERNEL); + config_key = kzalloc_obj(struct config_key, GFP_KERNEL); if (!config_key) return ERR_PTR(-ENOMEM); diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 314787fb8ce7..ddce56b47b25 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -661,7 +661,7 @@ static int kdb_defcmd2(const char *cmdstr, const char *argv0) return 0; } - kms = kmalloc(sizeof(*kms), GFP_KDB); + kms = kmalloc_obj(*kms, GFP_KDB); if (!kms) { kdb_printf("Could not allocate new kdb macro command: %s\n", cmdstr); @@ -707,7 +707,7 @@ static int kdb_defcmd(int argc, const char **argv) kdb_printf("Command only available during kdb_init()\n"); return KDB_NOTIMP; } - kdb_macro = kzalloc(sizeof(*kdb_macro), GFP_KDB); + kdb_macro = kzalloc_obj(*kdb_macro, GFP_KDB); if (!kdb_macro) goto fail_defcmd; diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c index 77c8d9487a9a..d580ab6d2e33 100644 --- a/kernel/dma/coherent.c +++ b/kernel/dma/coherent.c @@ -49,7 +49,7 @@ static struct dma_coherent_mem *dma_init_coherent_memory(phys_addr_t phys_addr, if (!mem_base) return ERR_PTR(-EINVAL); - dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); + dma_mem = kzalloc_obj(struct dma_coherent_mem, GFP_KERNEL); if (!dma_mem) goto out_unmap_membase; dma_mem->bitmap = bitmap_zalloc(pages, GFP_KERNEL); diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 43d6a996d7a7..3be263d7afd6 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -900,7 +900,7 @@ void dma_debug_add_bus(const struct bus_type *bus) if (dma_debug_disabled()) return; - nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL); + nb = kzalloc_obj(struct notifier_block, GFP_KERNEL); if (nb == NULL) { pr_err("dma_debug_add_bus: out of memory\n"); return; diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index c9fa983990cd..280ec952c5e1 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -654,7 +654,7 @@ int dma_direct_set_offset(struct device *dev, phys_addr_t cpu_start, if (!offset) return 0; - map = kcalloc(2, sizeof(*map), GFP_KERNEL); + map = kzalloc_objs(*map, 2, GFP_KERNEL); if (!map) return -ENOMEM; map[0].cpu_start = cpu_start; diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index 794041a39e65..48ab3d957960 100644 --- a/kernel/dma/map_benchmark.c +++ b/kernel/dma/map_benchmark.c @@ -121,7 +121,7 @@ static int do_map_benchmark(struct map_benchmark_data *map) int ret = 0; int i; - tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL); + tsk = kmalloc_objs(*tsk, threads, GFP_KERNEL); if (!tsk) return -ENOMEM; diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index ee29c47781e3..3928a509c44c 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -768,7 +768,7 @@ static struct sg_table *alloc_single_sgt(struct device *dev, size_t size, struct sg_table *sgt; struct page *page; - sgt = kmalloc(sizeof(*sgt), gfp); + sgt = kmalloc_obj(*sgt, gfp); if (!sgt) return NULL; if (sg_alloc_table(sgt, 1, gfp)) diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c index b7c1c0c92d0c..b53e66417e5f 100644 --- a/kernel/dma/remap.c +++ b/kernel/dma/remap.c @@ -45,7 +45,7 @@ void *dma_common_contiguous_remap(struct page *page, size_t size, void *vaddr; int i; - pages = kvmalloc_array(count, sizeof(struct page *), GFP_KERNEL); + pages = kvmalloc_objs(struct page *, count, GFP_KERNEL); if (!pages) return NULL; for (i = 0; i < count; i++) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index a547c7693135..cb8efc059e6a 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -1809,19 +1809,18 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem, if (!mem) { struct io_tlb_pool *pool; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return -ENOMEM; pool = &mem->defpool; - pool->slots = kcalloc(nslabs, sizeof(*pool->slots), GFP_KERNEL); + pool->slots = kzalloc_objs(*pool->slots, nslabs, GFP_KERNEL); if (!pool->slots) { kfree(mem); return -ENOMEM; } - pool->areas = kcalloc(nareas, sizeof(*pool->areas), - GFP_KERNEL); + pool->areas = kzalloc_objs(*pool->areas, nareas, GFP_KERNEL); if (!pool->areas) { kfree(pool->slots); kfree(mem); diff --git a/kernel/events/core.c b/kernel/events/core.c index e18119f30c29..33c84a605799 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5058,7 +5058,7 @@ alloc_perf_context(struct task_struct *task) { struct perf_event_context *ctx; - ctx = kzalloc(sizeof(struct perf_event_context), GFP_KERNEL); + ctx = kzalloc_obj(struct perf_event_context, GFP_KERNEL); if (!ctx) return NULL; @@ -5198,7 +5198,7 @@ find_get_pmu_context(struct pmu *pmu, struct perf_event_context *ctx, return epc; } - new = kzalloc(sizeof(*epc), GFP_KERNEL); + new = kzalloc_obj(*epc, GFP_KERNEL); if (!new) return ERR_PTR(-ENOMEM); @@ -5374,7 +5374,7 @@ alloc_perf_ctx_data(struct kmem_cache *ctx_cache, bool global) { struct perf_ctx_data *cd; - cd = kzalloc(sizeof(*cd), GFP_KERNEL); + cd = kzalloc_obj(*cd, GFP_KERNEL); if (!cd) return NULL; @@ -11111,7 +11111,7 @@ static int swevent_hlist_get_cpu(int cpu) cpumask_test_cpu(cpu, perf_online_mask)) { struct swevent_hlist *hlist; - hlist = kzalloc(sizeof(*hlist), GFP_KERNEL); + hlist = kzalloc_obj(*hlist, GFP_KERNEL); if (!hlist) { err = -ENOMEM; goto exit; @@ -12634,7 +12634,7 @@ static int pmu_dev_alloc(struct pmu *pmu) { int ret = -ENOMEM; - pmu->dev = kzalloc(sizeof(struct device), GFP_KERNEL); + pmu->dev = kzalloc_obj(struct device, GFP_KERNEL); if (!pmu->dev) goto out; @@ -15269,7 +15269,7 @@ perf_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) { struct perf_cgroup *jc; - jc = kzalloc(sizeof(*jc), GFP_KERNEL); + jc = kzalloc_obj(*jc, GFP_KERNEL); if (!jc) return ERR_PTR(-ENOMEM); diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c index 8ec2cb688903..6c44fbdcfa4d 100644 --- a/kernel/events/hw_breakpoint.c +++ b/kernel/events/hw_breakpoint.c @@ -185,7 +185,8 @@ static inline int hw_breakpoint_slots_cached(int type) static __init bool bp_slots_histogram_alloc(struct bp_slots_histogram *hist, enum bp_type_idx type) { - hist->count = kcalloc(hw_breakpoint_slots_cached(type), sizeof(*hist->count), GFP_KERNEL); + hist->count = kzalloc_objs(*hist->count, + hw_breakpoint_slots_cached(type), GFP_KERNEL); return hist->count; } diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 424ef2235b07..d39dcc19d21e 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -238,7 +238,7 @@ static int delayed_uprobe_add(struct uprobe *uprobe, struct mm_struct *mm) if (delayed_uprobe_check(uprobe, mm)) return 0; - du = kzalloc(sizeof(*du), GFP_KERNEL); + du = kzalloc_obj(*du, GFP_KERNEL); if (!du) return -ENOMEM; @@ -994,7 +994,7 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset, { struct uprobe *uprobe, *cur_uprobe; - uprobe = kzalloc(sizeof(struct uprobe), GFP_KERNEL); + uprobe = kzalloc_obj(struct uprobe, GFP_KERNEL); if (!uprobe) return ERR_PTR(-ENOMEM); @@ -1219,8 +1219,8 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) * Needs GFP_NOWAIT to avoid i_mmap_rwsem recursion through * reclaim. This is optimistic, no harm done if it fails. */ - prev = kmalloc(sizeof(struct map_info), - GFP_NOWAIT | __GFP_NOMEMALLOC); + prev = kmalloc_obj(struct map_info, + GFP_NOWAIT | __GFP_NOMEMALLOC); if (prev) prev->next = NULL; } @@ -1252,7 +1252,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) } do { - info = kmalloc(sizeof(struct map_info), GFP_KERNEL); + info = kmalloc_obj(struct map_info, GFP_KERNEL); if (!info) { curr = ERR_PTR(-ENOMEM); goto out; @@ -1755,7 +1755,7 @@ static struct xol_area *__create_xol_area(unsigned long vaddr) struct xol_area *area; void *insns; - area = kzalloc(sizeof(*area), GFP_KERNEL); + area = kzalloc_obj(*area, GFP_KERNEL); if (unlikely(!area)) goto out; @@ -2069,7 +2069,7 @@ static struct uprobe_task *alloc_utask(void) { struct uprobe_task *utask; - utask = kzalloc(sizeof(*utask), GFP_KERNEL); + utask = kzalloc_obj(*utask, GFP_KERNEL); if (!utask) return NULL; @@ -2102,7 +2102,7 @@ static struct return_instance *alloc_return_instance(struct uprobe_task *utask) if (ri) return ri; - ri = kzalloc(sizeof(*ri), GFP_KERNEL); + ri = kzalloc_obj(*ri, GFP_KERNEL); if (!ri) return ZERO_SIZE_PTR; diff --git a/kernel/fail_function.c b/kernel/fail_function.c index d971a0189319..18993fcbdbda 100644 --- a/kernel/fail_function.c +++ b/kernel/fail_function.c @@ -57,7 +57,7 @@ static struct fei_attr *fei_attr_new(const char *sym, unsigned long addr) { struct fei_attr *attr; - attr = kzalloc(sizeof(*attr), GFP_KERNEL); + attr = kzalloc_obj(*attr, GFP_KERNEL); if (attr) { attr->kp.symbol_name = kstrdup(sym, GFP_KERNEL); if (!attr->kp.symbol_name) { diff --git a/kernel/futex/pi.c b/kernel/futex/pi.c index dacb2330f1fb..a73b6c713d83 100644 --- a/kernel/futex/pi.c +++ b/kernel/futex/pi.c @@ -17,7 +17,7 @@ int refill_pi_state_cache(void) if (likely(current->pi_state_cache)) return 0; - pi_state = kzalloc(sizeof(*pi_state), GFP_KERNEL); + pi_state = kzalloc_obj(*pi_state, GFP_KERNEL); if (!pi_state) return -ENOMEM; diff --git a/kernel/futex/syscalls.c b/kernel/futex/syscalls.c index 880c9bf2f315..aec0495adabe 100644 --- a/kernel/futex/syscalls.c +++ b/kernel/futex/syscalls.c @@ -333,7 +333,7 @@ SYSCALL_DEFINE5(futex_waitv, struct futex_waitv __user *, waiters, if (timeout && (ret = futex2_setup_timeout(timeout, clockid, &to))) return ret; - futexv = kcalloc(nr_futexes, sizeof(*futexv), GFP_KERNEL); + futexv = kzalloc_objs(*futexv, nr_futexes, GFP_KERNEL); if (!futexv) { ret = -ENOMEM; goto destroy_timer; diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c index 8b888a6193cc..4cfdeb2c9dc2 100644 --- a/kernel/gcov/clang.c +++ b/kernel/gcov/clang.c @@ -81,7 +81,7 @@ static LIST_HEAD(clang_gcov_list); void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) { - struct gcov_info *info = kzalloc(sizeof(*info), GFP_KERNEL); + struct gcov_info *info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return; @@ -112,7 +112,7 @@ EXPORT_SYMBOL(llvm_gcda_start_file); void llvm_gcda_emit_function(u32 ident, u32 func_checksum, u32 cfg_checksum) { - struct gcov_fn_info *info = kzalloc(sizeof(*info), GFP_KERNEL); + struct gcov_fn_info *info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return; diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index 01520689b57c..8430f5cd21b6 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c @@ -116,7 +116,7 @@ static struct gcov_iterator *gcov_iter_new(struct gcov_info *info) /* Dry-run to get the actual buffer size. */ size = convert_to_gcda(NULL, info); - iter = kvmalloc(struct_size(iter, buffer, size), GFP_KERNEL); + iter = kvmalloc_flex(*iter, buffer, size, GFP_KERNEL); if (!iter) return NULL; @@ -482,7 +482,7 @@ static void add_links(struct gcov_node *node, struct dentry *parent) for (num = 0; gcov_link[num].ext; num++) /* Nothing. */; - node->links = kcalloc(num, sizeof(struct dentry *), GFP_KERNEL); + node->links = kzalloc_objs(struct dentry *, num, GFP_KERNEL); if (!node->links) return; for (i = 0; i < num; i++) { @@ -545,8 +545,8 @@ static struct gcov_node *new_node(struct gcov_node *parent, if (!node) goto err_nomem; if (info) { - node->loaded_info = kcalloc(1, sizeof(struct gcov_info *), - GFP_KERNEL); + node->loaded_info = kzalloc_objs(struct gcov_info *, 1, + GFP_KERNEL); if (!node->loaded_info) goto err_nomem; } @@ -731,7 +731,7 @@ static void add_info(struct gcov_node *node, struct gcov_info *info) * case the new data set is incompatible, the node only contains * unloaded data sets and there's not enough memory for the array. */ - loaded_info = kcalloc(num + 1, sizeof(struct gcov_info *), GFP_KERNEL); + loaded_info = kzalloc_objs(struct gcov_info *, num + 1, GFP_KERNEL); if (!loaded_info) { pr_warn("could not add '%s' (out of memory)\n", gcov_info_filename(info)); diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index ffde93d051a4..46dbba7b0efd 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -298,8 +298,8 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info) if (!dup->filename) goto err_free; - dup->functions = kcalloc(info->n_functions, - sizeof(struct gcov_fn_info *), GFP_KERNEL); + dup->functions = kzalloc_objs(struct gcov_fn_info *, info->n_functions, + GFP_KERNEL); if (!dup->functions) goto err_free; diff --git a/kernel/groups.c b/kernel/groups.c index 9b43da22647d..b5e3be6a6b1f 100644 --- a/kernel/groups.c +++ b/kernel/groups.c @@ -15,7 +15,7 @@ struct group_info *groups_alloc(int gidsetsize) { struct group_info *gi; - gi = kvmalloc(struct_size(gi, gid, gidsetsize), GFP_KERNEL_ACCOUNT); + gi = kvmalloc_flex(*gi, gid, gidsetsize, GFP_KERNEL_ACCOUNT); if (!gi) return NULL; diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 4013e6ad2b2f..cf6729888ee3 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -56,7 +56,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) if (!affvecs) return NULL; - masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL); + masks = kzalloc_objs(*masks, nvecs, GFP_KERNEL); if (!masks) return NULL; diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 3cd0c40282c0..da1da1a4b2d0 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c @@ -240,7 +240,7 @@ irq_alloc_generic_chip(const char *name, int num_ct, unsigned int irq_base, { struct irq_chip_generic *gc; - gc = kzalloc(struct_size(gc, chip_types, num_ct), GFP_KERNEL); + gc = kzalloc_flex(*gc, chip_types, num_ct, GFP_KERNEL); if (gc) { irq_init_generic_chip(gc, name, num_ct, irq_base, reg_base, handler); diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index ae4c9cbd1b4b..59b84a10465c 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -148,7 +148,7 @@ static int irq_sim_domain_map(struct irq_domain *domain, struct irq_sim_work_ctx *work_ctx = domain->host_data; struct irq_sim_irq_ctx *irq_ctx; - irq_ctx = kzalloc(sizeof(*irq_ctx), GFP_KERNEL); + irq_ctx = kzalloc_obj(*irq_ctx, GFP_KERNEL); if (!irq_ctx) return -ENOMEM; @@ -202,7 +202,7 @@ struct irq_domain *irq_domain_create_sim_full(struct fwnode_handle *fwnode, void *data) { struct irq_sim_work_ctx *work_ctx __free(kfree) = - kzalloc(sizeof(*work_ctx), GFP_KERNEL); + kzalloc_obj(*work_ctx, GFP_KERNEL); if (!work_ctx) return ERR_PTR(-ENOMEM); diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 022b3741dd7a..ddc9d01b3091 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -969,7 +969,7 @@ int irq_set_percpu_devid(unsigned int irq) if (!desc || desc->percpu_enabled) return -EINVAL; - desc->percpu_enabled = kzalloc(sizeof(*desc->percpu_enabled), GFP_KERNEL); + desc->percpu_enabled = kzalloc_obj(*desc->percpu_enabled, GFP_KERNEL); if (!desc->percpu_enabled) return -ENOMEM; diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index c2258b133939..857fcd74ebda 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -92,7 +92,7 @@ struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, struct irqchip_fwid *fwid; char *n; - fwid = kzalloc(sizeof(*fwid), GFP_KERNEL); + fwid = kzalloc_obj(*fwid, GFP_KERNEL); switch (type) { case IRQCHIP_FWNODE_NAMED: diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index cded3d960eb7..2b05c45be1b3 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1332,7 +1332,7 @@ static int irq_setup_forced_threading(struct irqaction *new) */ if (new->handler && new->thread_fn) { /* Allocate the secondary action */ - new->secondary = kzalloc(sizeof(struct irqaction), GFP_KERNEL); + new->secondary = kzalloc_obj(struct irqaction, GFP_KERNEL); if (!new->secondary) return -ENOMEM; new->secondary->handler = irq_forced_secondary_handler; @@ -2156,7 +2156,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, handler = irq_default_primary_handler; } - action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); + action = kzalloc_obj(struct irqaction, GFP_KERNEL); if (!action) return -ENOMEM; @@ -2486,7 +2486,7 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f if (!affinity) affinity = cpu_possible_mask; - action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); + action = kzalloc_obj(struct irqaction, GFP_KERNEL); if (!action) return NULL; diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c index a50f2305a8dc..8151c14ca35a 100644 --- a/kernel/irq/matrix.c +++ b/kernel/irq/matrix.c @@ -51,7 +51,7 @@ __init struct irq_matrix *irq_alloc_matrix(unsigned int matrix_bits, unsigned int cpu, matrix_size = BITS_TO_LONGS(matrix_bits); struct irq_matrix *m; - m = kzalloc(struct_size(m, scratch_map, matrix_size * 2), GFP_KERNEL); + m = kzalloc_flex(*m, scratch_map, matrix_size * 2, GFP_KERNEL); if (!m) return NULL; diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 68886881fe10..e4bae8f1c414 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -76,7 +76,7 @@ static int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev static struct msi_desc *msi_alloc_desc(struct device *dev, int nvec, const struct irq_affinity_desc *affinity) { - struct msi_desc *desc = kzalloc(sizeof(*desc), GFP_KERNEL); + struct msi_desc *desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return NULL; @@ -530,7 +530,7 @@ static int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc) struct device_attribute *attrs; int ret, i; - attrs = kcalloc(desc->nvec_used, sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, desc->nvec_used, GFP_KERNEL); if (!attrs) return -ENOMEM; diff --git a/kernel/kallsyms_selftest.c b/kernel/kallsyms_selftest.c index 2b082a7e24a2..d2aeb6b7c393 100644 --- a/kernel/kallsyms_selftest.c +++ b/kernel/kallsyms_selftest.c @@ -264,7 +264,7 @@ static int test_kallsyms_basic_function(void) char namebuf[KSYM_NAME_LEN]; struct test_stat *stat, *stat2; - stat = kmalloc_array(2, sizeof(*stat), GFP_KERNEL); + stat = kmalloc_objs(*stat, 2, GFP_KERNEL); if (!stat) return -ENOMEM; stat2 = stat + 1; diff --git a/kernel/kcov.c b/kernel/kcov.c index 5397d0c14127..b9d4db7ea439 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -122,7 +122,7 @@ static struct kcov_remote *kcov_remote_add(struct kcov *kcov, u64 handle) if (kcov_remote_find(handle)) return ERR_PTR(-EEXIST); - remote = kmalloc(sizeof(*remote), GFP_ATOMIC); + remote = kmalloc_obj(*remote, GFP_ATOMIC); if (!remote) return ERR_PTR(-ENOMEM); remote->handle = handle; @@ -527,7 +527,7 @@ static int kcov_open(struct inode *inode, struct file *filep) { struct kcov *kcov; - kcov = kzalloc(sizeof(*kcov), GFP_KERNEL); + kcov = kzalloc_obj(*kcov, GFP_KERNEL); if (!kcov) return -ENOMEM; guard(spinlock_init)(&kcov->lock); diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index 8ef8167be745..edb062fb43b4 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -168,7 +168,7 @@ static bool __report_matches(const struct expect_report *r) if (!report_available()) return false; - expect = kmalloc(sizeof(observed.lines), GFP_KERNEL); + expect = kmalloc_obj(observed.lines, GFP_KERNEL); if (WARN_ON(!expect)) return false; @@ -1538,7 +1538,7 @@ static int test_init(struct kunit *test) if (WARN_ON(!nthreads)) goto err; - threads = kcalloc(nthreads + 1, sizeof(struct task_struct *), GFP_KERNEL); + threads = kzalloc_objs(struct task_struct *, nthreads + 1, GFP_KERNEL); if (WARN_ON(!threads)) goto err; diff --git a/kernel/kexec.c b/kernel/kexec.c index 28008e3d462e..3902e7bb99fe 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -284,8 +284,7 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry, if ((flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_DEFAULT) return -EINVAL; - ksegments = kmalloc_array(nr_segments, sizeof(ksegments[0]), - GFP_KERNEL); + ksegments = kmalloc_objs(ksegments[0], nr_segments, GFP_KERNEL); if (!ksegments) return -ENOMEM; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 95c585c6ddc3..76e4287a4f1d 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -231,7 +231,7 @@ struct kimage *do_kimage_alloc_init(void) struct kimage *image; /* Allocate a controlling structure */ - image = kzalloc(sizeof(*image), GFP_KERNEL); + image = kzalloc_obj(*image, GFP_KERNEL); if (!image) return NULL; @@ -975,7 +975,7 @@ void *kimage_map_segment(struct kimage *image, int idx) * Collect the source pages and map them in a contiguous VA range. */ npages = PFN_UP(eaddr) - PFN_DOWN(addr); - src_pages = kmalloc_array(npages, sizeof(*src_pages), GFP_KERNEL); + src_pages = kmalloc_objs(*src_pages, npages, GFP_KERNEL); if (!src_pages) { pr_err("Could not allocate ima pages array.\n"); return NULL; diff --git a/kernel/kprobes.c b/kernel/kprobes.c index e2cd01cf5968..b6744137b11e 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -172,7 +172,7 @@ kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c) } while (c->nr_garbage && collect_garbage_slots(c) == 0); /* All out of space. Need to allocate a new page. */ - kip = kmalloc(struct_size(kip, slot_used, slots_per_page(c)), GFP_KERNEL); + kip = kmalloc_flex(*kip, slot_used, slots_per_page(c), GFP_KERNEL); if (!kip) return NULL; @@ -900,7 +900,7 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) { struct optimized_kprobe *op; - op = kzalloc(sizeof(struct optimized_kprobe), GFP_KERNEL); + op = kzalloc_obj(struct optimized_kprobe, GFP_KERNEL); if (!op) return NULL; @@ -1117,7 +1117,7 @@ static void free_aggr_kprobe(struct kprobe *p) static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) { - return kzalloc(sizeof(struct kprobe), GFP_KERNEL); + return kzalloc_obj(struct kprobe, GFP_KERNEL); } #endif /* CONFIG_OPTPROBES */ @@ -2295,7 +2295,7 @@ int register_kretprobe(struct kretprobe *rp) rp->rh = NULL; } #else /* !CONFIG_KRETPROBE_ON_RETHOOK */ - rp->rph = kzalloc(sizeof(struct kretprobe_holder), GFP_KERNEL); + rp->rph = kzalloc_obj(struct kretprobe_holder, GFP_KERNEL); if (!rp->rph) return -ENOMEM; @@ -2499,7 +2499,7 @@ int kprobe_add_ksym_blacklist(unsigned long entry) !kallsyms_lookup_size_offset(entry, &size, &offset)) return -EINVAL; - ent = kmalloc(sizeof(*ent), GFP_KERNEL); + ent = kmalloc_obj(*ent, GFP_KERNEL); if (!ent) return -ENOMEM; ent->start_addr = entry; diff --git a/kernel/kthread.c b/kernel/kthread.c index c9507689e181..0b4f7328096f 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -122,7 +122,7 @@ bool set_kthread_struct(struct task_struct *p) if (WARN_ON_ONCE(to_kthread(p))) return false; - kthread = kzalloc(sizeof(*kthread), GFP_KERNEL); + kthread = kzalloc_obj(*kthread, GFP_KERNEL); if (!kthread) return false; @@ -511,8 +511,7 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), { DECLARE_COMPLETION_ONSTACK(done); struct task_struct *task; - struct kthread_create_info *create = kmalloc(sizeof(*create), - GFP_KERNEL); + struct kthread_create_info *create = kmalloc_obj(*create, GFP_KERNEL); if (!create) return ERR_PTR(-ENOMEM); @@ -1084,7 +1083,7 @@ __kthread_create_worker_on_node(unsigned int flags, int node, struct kthread_worker *worker; struct task_struct *task; - worker = kzalloc(sizeof(*worker), GFP_KERNEL); + worker = kzalloc_obj(*worker, GFP_KERNEL); if (!worker) return ERR_PTR(-ENOMEM); diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 1acbad2dbfdf..0d52e48918eb 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -525,7 +525,7 @@ static struct klp_object *klp_alloc_object_dynamic(const char *name, { struct klp_object *obj; - obj = kzalloc(sizeof(*obj), GFP_KERNEL); + obj = kzalloc_obj(*obj, GFP_KERNEL); if (!obj) return NULL; @@ -554,7 +554,7 @@ static struct klp_func *klp_alloc_func_nop(struct klp_func *old_func, { struct klp_func *func; - func = kzalloc(sizeof(*func), GFP_KERNEL); + func = kzalloc_obj(*func, GFP_KERNEL); if (!func) return NULL; diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c index 90408500e5a3..1149840cd538 100644 --- a/kernel/livepatch/patch.c +++ b/kernel/livepatch/patch.c @@ -179,7 +179,7 @@ static int klp_patch_func(struct klp_func *func) return -EINVAL; } - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (!ops) return -ENOMEM; diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index 95601623b4d6..23d76678d233 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -187,7 +187,7 @@ static int __kho_preserve_order(struct kho_mem_track *track, unsigned long pfn, if (!physxa) { int err; - new_physxa = kzalloc(sizeof(*physxa), GFP_KERNEL); + new_physxa = kzalloc_obj(*physxa, GFP_KERNEL); if (!new_physxa) return -ENOMEM; @@ -1090,7 +1090,7 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation) return NULL; total_pages = preservation->total_pages; - pages = kvmalloc_array(total_pages, sizeof(*pages), GFP_KERNEL); + pages = kvmalloc_objs(*pages, total_pages, GFP_KERNEL); if (!pages) return NULL; order = preservation->order; diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c index 2abbf62ba942..d42fc940d14d 100644 --- a/kernel/liveupdate/kexec_handover_debugfs.c +++ b/kernel/liveupdate/kexec_handover_debugfs.c @@ -29,7 +29,7 @@ static int __kho_debugfs_fdt_add(struct list_head *list, struct dentry *dir, struct fdt_debugfs *f; struct dentry *file; - f = kmalloc(sizeof(*f), GFP_KERNEL); + f = kmalloc_obj(*f, GFP_KERNEL); if (!f) return -ENOMEM; diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index 4c7df52a6507..ca96edb3b4e5 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -289,7 +289,7 @@ int luo_preserve_file(struct luo_file_set *file_set, u64 token, int fd) if (err) goto err_free_files_mem; - luo_file = kzalloc(sizeof(*luo_file), GFP_KERNEL); + luo_file = kzalloc_obj(*luo_file, GFP_KERNEL); if (!luo_file) { err = -ENOMEM; goto err_flb_unpreserve; @@ -780,7 +780,7 @@ int luo_file_deserialize(struct luo_file_set *file_set, return -ENOENT; } - luo_file = kzalloc(sizeof(*luo_file), GFP_KERNEL); + luo_file = kzalloc_obj(*luo_file, GFP_KERNEL); if (!luo_file) return -ENOMEM; diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c index 4c437de5c0b0..5f2cdf9caa7b 100644 --- a/kernel/liveupdate/luo_flb.c +++ b/kernel/liveupdate/luo_flb.c @@ -343,7 +343,7 @@ int liveupdate_register_flb(struct liveupdate_file_handler *fh, if (WARN_ON(list_empty(&ACCESS_PRIVATE(fh, list)))) return -EINVAL; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index dbdbc3bd7929..c0262ca00533 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -119,7 +119,7 @@ static struct luo_session_global luo_session_global = { static struct luo_session *luo_session_alloc(const char *name) { - struct luo_session *session = kzalloc(sizeof(*session), GFP_KERNEL); + struct luo_session *session = kzalloc_obj(*session, GFP_KERNEL); if (!session) return ERR_PTR(-ENOMEM); diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 6567e5eeacc0..96a8647a0074 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -610,9 +610,8 @@ static void torture_ww_mutex_init(void) ww_mutex_init(&torture_ww_mutex_1, &torture_ww_class); ww_mutex_init(&torture_ww_mutex_2, &torture_ww_class); - ww_acquire_ctxs = kmalloc_array(cxt.nrealwriters_stress, - sizeof(*ww_acquire_ctxs), - GFP_KERNEL); + ww_acquire_ctxs = kmalloc_objs(*ww_acquire_ctxs, + cxt.nrealwriters_stress, GFP_KERNEL); if (!ww_acquire_ctxs) VERBOSE_TOROUT_STRING("ww_acquire_ctx: Out of memory"); } @@ -1129,7 +1128,8 @@ static int call_rcu_chain_init(void) if (call_rcu_chains <= 0) return 0; - call_rcu_chain_list = kcalloc(call_rcu_chains, sizeof(*call_rcu_chain_list), GFP_KERNEL); + call_rcu_chain_list = kzalloc_objs(*call_rcu_chain_list, + call_rcu_chains, GFP_KERNEL); if (!call_rcu_chain_list) return -ENOMEM; for (i = 0; i < call_rcu_chains; i++) { @@ -1293,9 +1293,8 @@ static int __init lock_torture_init(void) /* Initialize the statistics so that each run gets its own numbers. */ if (nwriters_stress) { lock_is_write_held = false; - cxt.lwsa = kmalloc_array(cxt.nrealwriters_stress, - sizeof(*cxt.lwsa), - GFP_KERNEL); + cxt.lwsa = kmalloc_objs(*cxt.lwsa, cxt.nrealwriters_stress, + GFP_KERNEL); if (cxt.lwsa == NULL) { VERBOSE_TOROUT_STRING("cxt.lwsa: Out of memory"); firsterr = -ENOMEM; @@ -1323,9 +1322,9 @@ static int __init lock_torture_init(void) } if (nreaders_stress) { - cxt.lrsa = kmalloc_array(cxt.nrealreaders_stress, - sizeof(*cxt.lrsa), - GFP_KERNEL); + cxt.lrsa = kmalloc_objs(*cxt.lrsa, + cxt.nrealreaders_stress, + GFP_KERNEL); if (cxt.lrsa == NULL) { VERBOSE_TOROUT_STRING("cxt.lrsa: Out of memory"); firsterr = -ENOMEM; @@ -1372,9 +1371,8 @@ static int __init lock_torture_init(void) } if (nwriters_stress) { - writer_tasks = kcalloc(cxt.nrealwriters_stress, - sizeof(writer_tasks[0]), - GFP_KERNEL); + writer_tasks = kzalloc_objs(writer_tasks[0], + cxt.nrealwriters_stress, GFP_KERNEL); if (writer_tasks == NULL) { TOROUT_ERRSTRING("writer_tasks: Out of memory"); firsterr = -ENOMEM; @@ -1387,9 +1385,8 @@ static int __init lock_torture_init(void) nested_locks = MAX_NESTED_LOCKS; if (cxt.cur_ops->readlock) { - reader_tasks = kcalloc(cxt.nrealreaders_stress, - sizeof(reader_tasks[0]), - GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], + cxt.nrealreaders_stress, GFP_KERNEL); if (reader_tasks == NULL) { TOROUT_ERRSTRING("reader_tasks: Out of memory"); kfree(writer_tasks); diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c index 79b5e45f8d4c..2cc6d1937670 100644 --- a/kernel/locking/test-ww_mutex.c +++ b/kernel/locking/test-ww_mutex.c @@ -324,7 +324,7 @@ static int __test_cycle(struct ww_class *class, unsigned int nthreads) unsigned int n, last = nthreads - 1; int ret; - cycles = kmalloc_array(nthreads, sizeof(*cycles), GFP_KERNEL); + cycles = kmalloc_objs(*cycles, nthreads, GFP_KERNEL); if (!cycles) return -ENOMEM; @@ -412,7 +412,7 @@ static int *get_random_order(int count) int *order; int n, r; - order = kmalloc_array(count, sizeof(*order), GFP_KERNEL); + order = kmalloc_objs(*order, count, GFP_KERNEL); if (!order) return order; @@ -506,7 +506,7 @@ static void stress_reorder_work(struct work_struct *work) return; for (n = 0; n < stress->nlocks; n++) { - ll = kmalloc(sizeof(*ll), GFP_KERNEL); + ll = kmalloc_obj(*ll, GFP_KERNEL); if (!ll) goto out; @@ -582,12 +582,11 @@ static int stress(struct ww_class *class, int nlocks, int nthreads, unsigned int struct stress *stress_array; int n, count; - locks = kmalloc_array(nlocks, sizeof(*locks), GFP_KERNEL); + locks = kmalloc_objs(*locks, nlocks, GFP_KERNEL); if (!locks) return -ENOMEM; - stress_array = kmalloc_array(nthreads, sizeof(*stress_array), - GFP_KERNEL); + stress_array = kmalloc_objs(*stress_array, nthreads, GFP_KERNEL); if (!stress_array) { kfree(locks); return -ENOMEM; diff --git a/kernel/module/dups.c b/kernel/module/dups.c index 0b633f2edda6..bbc72ad93058 100644 --- a/kernel/module/dups.c +++ b/kernel/module/dups.c @@ -125,7 +125,7 @@ bool kmod_dup_request_exists_wait(char *module_name, bool wait, int *dup_ret) * Pre-allocate the entry in case we have to use it later * to avoid contention with the mutex. */ - new_kmod_req = kzalloc(sizeof(*new_kmod_req), GFP_KERNEL); + new_kmod_req = kzalloc_obj(*new_kmod_req, GFP_KERNEL); if (!new_kmod_req) return false; diff --git a/kernel/module/main.c b/kernel/module/main.c index 710ee30b3bea..b2ac20299915 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -662,7 +662,7 @@ static int add_module_usage(struct module *a, struct module *b) struct module_use *use; pr_debug("Allocating new usage for %s.\n", a->name); - use = kmalloc(sizeof(*use), GFP_ATOMIC); + use = kmalloc_obj(*use, GFP_ATOMIC); if (!use) return -ENOMEM; @@ -3024,7 +3024,7 @@ static noinline int do_init_module(struct module *mod) } #endif - freeinit = kmalloc(sizeof(*freeinit), GFP_KERNEL); + freeinit = kmalloc_obj(*freeinit, GFP_KERNEL); if (!freeinit) { ret = -ENOMEM; goto fail; diff --git a/kernel/module/stats.c b/kernel/module/stats.c index 3ba0e98b3c91..2fc64f2729e6 100644 --- a/kernel/module/stats.c +++ b/kernel/module/stats.c @@ -250,7 +250,7 @@ int try_add_failed_module(const char *name, enum fail_dup_mod_reason reason) } } - mod_fail = kzalloc(sizeof(*mod_fail), GFP_KERNEL); + mod_fail = kzalloc_obj(*mod_fail, GFP_KERNEL); if (!mod_fail) return -ENOMEM; memcpy(mod_fail->name, name, strlen(name)); diff --git a/kernel/module/sysfs.c b/kernel/module/sysfs.c index c7622ff5226a..734ea3180478 100644 --- a/kernel/module/sysfs.c +++ b/kernel/module/sysfs.c @@ -74,11 +74,11 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) for (i = 0; i < info->hdr->e_shnum; i++) if (!sect_empty(&info->sechdrs[i])) nloaded++; - sect_attrs = kzalloc(struct_size(sect_attrs, attrs, nloaded), GFP_KERNEL); + sect_attrs = kzalloc_flex(*sect_attrs, attrs, nloaded, GFP_KERNEL); if (!sect_attrs) return -ENOMEM; - gattr = kcalloc(nloaded + 1, sizeof(*gattr), GFP_KERNEL); + gattr = kzalloc_objs(*gattr, nloaded + 1, GFP_KERNEL); if (!gattr) { kfree(sect_attrs); return -ENOMEM; @@ -166,12 +166,11 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) if (notes == 0) return 0; - notes_attrs = kzalloc(struct_size(notes_attrs, attrs, notes), - GFP_KERNEL); + notes_attrs = kzalloc_flex(*notes_attrs, attrs, notes, GFP_KERNEL); if (!notes_attrs) return -ENOMEM; - gattr = kcalloc(notes + 1, sizeof(*gattr), GFP_KERNEL); + gattr = kzalloc_objs(*gattr, notes + 1, GFP_KERNEL); if (!gattr) { kfree(notes_attrs); return -ENOMEM; diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 4fefec5b683c..41425054a97a 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c @@ -33,7 +33,7 @@ int try_add_tainted_module(struct module *mod) } } - mod_taint = kmalloc(sizeof(*mod_taint), GFP_KERNEL); + mod_taint = kmalloc_obj(*mod_taint, GFP_KERNEL); if (unlikely(!mod_taint)) return -ENOMEM; strscpy(mod_taint->name, mod->name, MODULE_NAME_LEN); diff --git a/kernel/padata.c b/kernel/padata.c index db7c75787a2b..f0bf62e9a1f2 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -540,7 +540,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) struct padata_instance *pinst = ps->pinst; struct parallel_data *pd; - pd = kzalloc(sizeof(struct parallel_data), GFP_KERNEL); + pd = kzalloc_obj(struct parallel_data, GFP_KERNEL); if (!pd) goto err; @@ -952,7 +952,7 @@ struct padata_instance *padata_alloc(const char *name) { struct padata_instance *pinst; - pinst = kzalloc(sizeof(struct padata_instance), GFP_KERNEL); + pinst = kzalloc_obj(struct padata_instance, GFP_KERNEL); if (!pinst) goto err; @@ -1038,7 +1038,7 @@ struct padata_shell *padata_alloc_shell(struct padata_instance *pinst) struct parallel_data *pd; struct padata_shell *ps; - ps = kzalloc(sizeof(*ps), GFP_KERNEL); + ps = kzalloc_obj(*ps, GFP_KERNEL); if (!ps) goto out; @@ -1106,8 +1106,8 @@ void __init padata_init(void) #endif possible_cpus = num_possible_cpus(); - padata_works = kmalloc_array(possible_cpus, sizeof(struct padata_work), - GFP_KERNEL); + padata_works = kmalloc_objs(struct padata_work, possible_cpus, + GFP_KERNEL); if (!padata_works) goto remove_dead_state; diff --git a/kernel/params.c b/kernel/params.c index 7c2242f64bf0..d26bdfae96e5 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -633,13 +633,13 @@ static __init_or_module int add_sysfs_param(struct module_kobject *mk, if (!mk->mp) { /* First allocation. */ - mk->mp = kzalloc(sizeof(*mk->mp), GFP_KERNEL); + mk->mp = kzalloc_obj(*mk->mp, GFP_KERNEL); if (!mk->mp) return -ENOMEM; mk->mp->grp.name = "parameters"; /* NULL-terminated attribute array. */ - mk->mp->grp.attrs = kzalloc(sizeof(mk->mp->grp.attrs[0]), - GFP_KERNEL); + mk->mp->grp.attrs = kzalloc_obj(mk->mp->grp.attrs[0], + GFP_KERNEL); /* Caller will cleanup via free_module_param_attrs */ if (!mk->mp->grp.attrs) return -ENOMEM; @@ -766,7 +766,7 @@ lookup_or_create_module_kobject(const char *name) if (kobj) return to_module_kobject(kobj); - mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL); + mk = kzalloc_obj(struct module_kobject, GFP_KERNEL); if (!mk) return NULL; diff --git a/kernel/power/console.c b/kernel/power/console.c index a906a0ac0f9b..5ed9e1be1560 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c @@ -58,7 +58,7 @@ int pm_vt_switch_required(struct device *dev, bool required) } } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { ret = -ENOMEM; goto out; diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index 5b055cbe5341..43ddfc11b84a 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -439,7 +439,7 @@ static int em_create_pd(struct device *dev, int nr_states, cpumask_copy(em_span_cpus(pd), cpus); } else { - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return -ENOMEM; } diff --git a/kernel/power/qos.c b/kernel/power/qos.c index f7d8064e9adc..750b80f45b9f 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -341,7 +341,7 @@ static int cpu_latency_qos_open(struct inode *inode, struct file *filp) { struct pm_qos_request *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -440,7 +440,7 @@ static int cpu_wakeup_latency_qos_open(struct inode *inode, struct file *filp) { struct pm_qos_request *req; - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 0a946932d5c1..be0b3304339f 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -646,7 +646,7 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask) /* New extent is necessary */ struct mem_extent *new_ext; - new_ext = kzalloc(sizeof(struct mem_extent), gfp_mask); + new_ext = kzalloc_obj(struct mem_extent, gfp_mask); if (!new_ext) { free_mem_extents(list); return -ENOMEM; @@ -1124,7 +1124,7 @@ int create_basic_memory_bitmaps(void) else BUG_ON(forbidden_pages_map || free_pages_map); - bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL); + bm1 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL); if (!bm1) return -ENOMEM; @@ -1132,7 +1132,7 @@ int create_basic_memory_bitmaps(void) if (error) goto Free_first_object; - bm2 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL); + bm2 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL); if (!bm2) goto Free_first_bitmap; diff --git a/kernel/power/swap.c b/kernel/power/swap.c index c4eb284b8e72..9bc1241259d3 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -155,7 +155,7 @@ static int swsusp_extents_insert(unsigned long swap_offset) } } /* Add the new node and rebalance the tree. */ - ext = kzalloc(sizeof(struct swsusp_extent), GFP_KERNEL); + ext = kzalloc_obj(struct swsusp_extent, GFP_KERNEL); if (!ext) return -ENOMEM; @@ -577,7 +577,7 @@ static struct crc_data *alloc_crc_data(int nr_threads) { struct crc_data *crc; - crc = kzalloc(sizeof(*crc), GFP_KERNEL); + crc = kzalloc_obj(*crc, GFP_KERNEL); if (!crc) return NULL; @@ -585,7 +585,7 @@ static struct crc_data *alloc_crc_data(int nr_threads) if (!crc->unc) goto err_free_crc; - crc->unc_len = kcalloc(nr_threads, sizeof(*crc->unc_len), GFP_KERNEL); + crc->unc_len = kzalloc_objs(*crc->unc_len, nr_threads, GFP_KERNEL); if (!crc->unc_len) goto err_free_unc; @@ -1016,7 +1016,7 @@ static int get_swap_reader(struct swap_map_handle *handle, last = handle->maps = NULL; offset = swsusp_header->image; while (offset) { - tmp = kzalloc(sizeof(*handle->maps), GFP_KERNEL); + tmp = kzalloc_obj(*handle->maps, GFP_KERNEL); if (!tmp) { release_swap_reader(handle); return -ENOMEM; diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 4e941999a53b..49712d9e7cfa 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -178,7 +178,7 @@ static struct wakelock *wakelock_lookup_add(const char *name, size_t len, return ERR_PTR(-ENOSPC); /* Not found, we have to add a new one. */ - wl = kzalloc(sizeof(*wl), GFP_KERNEL); + wl = kzalloc_obj(*wl, GFP_KERNEL); if (!wl) return ERR_PTR(-ENOMEM); diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index d558b18505cd..c98241238f2a 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -1801,7 +1801,7 @@ bool nbcon_alloc(struct console *con) */ con->pbufs = &printk_shared_pbufs; } else { - con->pbufs = kmalloc(sizeof(*con->pbufs), GFP_KERNEL); + con->pbufs = kmalloc_obj(*con->pbufs, GFP_KERNEL); if (!con->pbufs) { con_printk(KERN_ERR, con, "failed to allocate printing buffer\n"); return false; diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index a181394604d1..599d56300ded 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -933,7 +933,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) return err; } - user = kvmalloc(sizeof(struct devkmsg_user), GFP_KERNEL); + user = kvmalloc_obj(struct devkmsg_user, GFP_KERNEL); if (!user) return -ENOMEM; diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 1c50f89fbd6f..5512686be5d0 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -755,7 +755,8 @@ kfree_scale_thread(void *arg) } for (i = 0; i < kfree_alloc_num; i++) { - alloc_ptr = kcalloc(kfree_mult, sizeof(struct kfree_obj), GFP_KERNEL); + alloc_ptr = kzalloc_objs(struct kfree_obj, kfree_mult, + GFP_KERNEL); if (!alloc_ptr) return -ENOMEM; @@ -908,8 +909,8 @@ kfree_scale_init(void) kfree_mult * sizeof(struct kfree_obj), kfree_by_call_rcu); - kfree_reader_tasks = kcalloc(kfree_nrealthreads, sizeof(kfree_reader_tasks[0]), - GFP_KERNEL); + kfree_reader_tasks = kzalloc_objs(kfree_reader_tasks[0], + kfree_nrealthreads, GFP_KERNEL); if (kfree_reader_tasks == NULL) { firsterr = -ENOMEM; goto unwind; @@ -1129,8 +1130,7 @@ rcu_scale_init(void) goto unwind; schedule_timeout_uninterruptible(1); } - reader_tasks = kcalloc(nrealreaders, sizeof(reader_tasks[0]), - GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL); if (reader_tasks == NULL) { SCALEOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; @@ -1144,10 +1144,11 @@ rcu_scale_init(void) } while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders) schedule_timeout_uninterruptible(1); - writer_tasks = kcalloc(nrealwriters, sizeof(writer_tasks[0]), GFP_KERNEL); + writer_tasks = kzalloc_objs(writer_tasks[0], nrealwriters, GFP_KERNEL); writer_durations = kcalloc(nrealwriters, sizeof(*writer_durations), GFP_KERNEL); - writer_n_durations = kcalloc(nrealwriters, sizeof(*writer_n_durations), GFP_KERNEL); - writer_done = kcalloc(nrealwriters, sizeof(writer_done[0]), GFP_KERNEL); + writer_n_durations = kzalloc_objs(*writer_n_durations, nrealwriters, + GFP_KERNEL); + writer_done = kzalloc_objs(writer_done[0], nrealwriters, GFP_KERNEL); if (gp_async) { if (gp_async_max <= 0) { pr_warn("%s: gp_async_max = %d must be greater than zero.\n", @@ -1156,7 +1157,8 @@ rcu_scale_init(void) firsterr = -EINVAL; goto unwind; } - writer_freelists = kcalloc(nrealwriters, sizeof(writer_freelists[0]), GFP_KERNEL); + writer_freelists = kzalloc_objs(writer_freelists[0], + nrealwriters, GFP_KERNEL); } if (!writer_tasks || !writer_durations || !writer_n_durations || !writer_done || (gp_async && !writer_freelists)) { @@ -1177,8 +1179,9 @@ rcu_scale_init(void) init_llist_head(&wflp->ws_lhg); init_llist_head(&wflp->ws_lhp); - wflp->ws_mblocks = kcalloc(gp_async_max, sizeof(wflp->ws_mblocks[0]), - GFP_KERNEL); + wflp->ws_mblocks = kzalloc_objs(wflp->ws_mblocks[0], + gp_async_max, + GFP_KERNEL); if (!wflp->ws_mblocks) { firsterr = -ENOMEM; goto unwind; diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 47ce7f49b52c..d2e673771295 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1626,7 +1626,7 @@ rcu_torture_writer(void *arg) ulo_size = cur_ops->poll_active; } if (cur_ops->poll_active_full > 0) { - rgo = kcalloc(cur_ops->poll_active_full, sizeof(*rgo), GFP_KERNEL); + rgo = kzalloc_objs(*rgo, cur_ops->poll_active_full, GFP_KERNEL); if (!WARN_ON(!rgo)) rgo_size = cur_ops->poll_active_full; } @@ -2462,7 +2462,7 @@ static void rcu_torture_timer(struct timer_list *unused) /* Test call_rcu() invocation from interrupt handler. */ if (cur_ops->call) { - struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_NOWAIT); + struct rcu_head *rhp = kmalloc_obj(*rhp, GFP_NOWAIT); if (rhp) cur_ops->call(rhp, rcu_torture_timer_cb); @@ -2558,7 +2558,7 @@ static int rcu_torture_updown_init(void) VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Disabling up/down reader tests due to lack of primitives"); return 0; } - updownreaders = kcalloc(n_up_down, sizeof(*updownreaders), GFP_KERNEL); + updownreaders = kzalloc_objs(*updownreaders, n_up_down, GFP_KERNEL); if (!updownreaders) { VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Out of memory, disabling up/down reader tests"); return -ENOMEM; @@ -2891,7 +2891,7 @@ static void rcu_torture_mem_dump_obj(void) mem_dump_obj(&z); kmem_cache_free(kcp, rhp); kmem_cache_destroy(kcp); - rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); + rhp = kmalloc_obj(*rhp, GFP_KERNEL); if (WARN_ON_ONCE(!rhp)) return; pr_alert("mem_dump_obj() kmalloc test: rcu_torture_stats = %px, &rhp = %px, rhp = %px\n", stats_task, &rhp, rhp); @@ -3399,7 +3399,7 @@ static void rcu_torture_fwd_prog_cr(struct rcu_fwd *rfp) n_launders++; n_launders_sa++; } else if (!cur_ops->cbflood_max || cur_ops->cbflood_max > n_max_cbs) { - rfcp = kmalloc(sizeof(*rfcp), GFP_KERNEL); + rfcp = kmalloc_obj(*rfcp, GFP_KERNEL); if (WARN_ON_ONCE(!rfcp)) { schedule_timeout_interruptible(1); continue; @@ -3587,8 +3587,8 @@ static int __init rcu_torture_fwd_prog_init(void) fwd_progress_holdoff = 1; if (fwd_progress_div <= 0) fwd_progress_div = 4; - rfp = kcalloc(fwd_progress, sizeof(*rfp), GFP_KERNEL); - fwd_prog_tasks = kcalloc(fwd_progress, sizeof(*fwd_prog_tasks), GFP_KERNEL); + rfp = kzalloc_objs(*rfp, fwd_progress, GFP_KERNEL); + fwd_prog_tasks = kzalloc_objs(*fwd_prog_tasks, fwd_progress, GFP_KERNEL); if (!rfp || !fwd_prog_tasks) { kfree(rfp); kfree(fwd_prog_tasks); @@ -3754,10 +3754,9 @@ static int rcu_torture_barrier_init(void) atomic_set(&barrier_cbs_count, 0); atomic_set(&barrier_cbs_invoked, 0); barrier_cbs_tasks = - kcalloc(n_barrier_cbs, sizeof(barrier_cbs_tasks[0]), - GFP_KERNEL); + kzalloc_objs(barrier_cbs_tasks[0], n_barrier_cbs, GFP_KERNEL); barrier_cbs_wq = - kcalloc(n_barrier_cbs, sizeof(barrier_cbs_wq[0]), GFP_KERNEL); + kzalloc_objs(barrier_cbs_wq[0], n_barrier_cbs, GFP_KERNEL); if (barrier_cbs_tasks == NULL || !barrier_cbs_wq) return -ENOMEM; for (i = 0; i < n_barrier_cbs; i++) { @@ -4224,7 +4223,7 @@ static void rcu_test_debug_objects(void) (!cur_ops->call || !cur_ops->cb_barrier))) return; - struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); + struct rcu_head *rhp = kmalloc_obj(*rhp, GFP_KERNEL); init_rcu_head_on_stack(&rh1); init_rcu_head_on_stack(&rh2); @@ -4549,9 +4548,8 @@ rcu_torture_init(void) rcu_torture_write_types(); if (nrealfakewriters > 0) { - fakewriter_tasks = kcalloc(nrealfakewriters, - sizeof(fakewriter_tasks[0]), - GFP_KERNEL); + fakewriter_tasks = kzalloc_objs(fakewriter_tasks[0], + nrealfakewriters, GFP_KERNEL); if (fakewriter_tasks == NULL) { TOROUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; @@ -4564,10 +4562,9 @@ rcu_torture_init(void) if (torture_init_error(firsterr)) goto unwind; } - reader_tasks = kcalloc(nrealreaders, sizeof(reader_tasks[0]), - GFP_KERNEL); - rcu_torture_reader_mbchk = kcalloc(nrealreaders, sizeof(*rcu_torture_reader_mbchk), - GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL); + rcu_torture_reader_mbchk = kzalloc_objs(*rcu_torture_reader_mbchk, + nrealreaders, GFP_KERNEL); if (!reader_tasks || !rcu_torture_reader_mbchk) { TOROUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; @@ -4595,7 +4592,8 @@ rcu_torture_init(void) if (WARN_ON(nocbs_toggle < 0)) nocbs_toggle = HZ; if (nrealnocbers > 0) { - nocb_tasks = kcalloc(nrealnocbers, sizeof(nocb_tasks[0]), GFP_KERNEL); + nocb_tasks = kzalloc_objs(nocb_tasks[0], nrealnocbers, + GFP_KERNEL); if (nocb_tasks == NULL) { TOROUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 07a313782dfd..39d679a4c17e 100644 --- a/kernel/rcu/refscale.c +++ b/kernel/rcu/refscale.c @@ -1143,7 +1143,7 @@ static bool typesafe_init(void) else if (si == 0) si = nr_cpu_ids; rtsarray_size = si; - rtsarray = kcalloc(si, sizeof(*rtsarray), GFP_KERNEL); + rtsarray = kzalloc_objs(*rtsarray, si, GFP_KERNEL); if (!rtsarray) return false; for (idx = 0; idx < rtsarray_size; idx++) { @@ -1575,8 +1575,7 @@ ref_scale_init(void) "%s: nreaders * loops will overflow, adjusted loops to %d", __func__, INT_MAX / nreaders)) loops = INT_MAX / nreaders; - reader_tasks = kcalloc(nreaders, sizeof(reader_tasks[0]), - GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nreaders, GFP_KERNEL); if (!reader_tasks) { SCALEOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 66ba6a2f83d3..0faf35f393a3 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -173,7 +173,8 @@ static bool init_srcu_struct_nodes(struct srcu_struct *ssp, gfp_t gfp_flags) /* Initialize geometry if it has not already been initialized. */ rcu_init_geometry(); - ssp->srcu_sup->node = kcalloc(rcu_num_nodes, sizeof(*ssp->srcu_sup->node), gfp_flags); + ssp->srcu_sup->node = kzalloc_objs(*ssp->srcu_sup->node, rcu_num_nodes, + gfp_flags); if (!ssp->srcu_sup->node) return false; @@ -237,7 +238,7 @@ static bool init_srcu_struct_nodes(struct srcu_struct *ssp, gfp_t gfp_flags) static int init_srcu_struct_fields(struct srcu_struct *ssp, bool is_static) { if (!is_static) - ssp->srcu_sup = kzalloc(sizeof(*ssp->srcu_sup), GFP_KERNEL); + ssp->srcu_sup = kzalloc_obj(*ssp->srcu_sup, GFP_KERNEL); if (!ssp->srcu_sup) return -ENOMEM; if (!is_static) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 76f952196a29..d9ccf18eb035 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -259,7 +259,8 @@ static void cblist_init_generic(struct rcu_tasks *rtp) } lim = rcu_task_enqueue_lim; - rtp->rtpcp_array = kcalloc(num_possible_cpus(), sizeof(struct rcu_tasks_percpu *), GFP_KERNEL); + rtp->rtpcp_array = kzalloc_objs(struct rcu_tasks_percpu *, + num_possible_cpus(), GFP_KERNEL); BUG_ON(!rtp->rtpcp_array); for_each_possible_cpu(cpu) { diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index dfeba9b35395..14150f09fd61 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -614,7 +614,7 @@ static void early_boot_test_call_rcu(void) call_rcu(&head, test_callback); early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu); call_srcu(&early_srcu, &shead, test_callback); - rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); + rhp = kmalloc_obj(*rhp, GFP_KERNEL); if (!WARN_ON_ONCE(!rhp)) kfree_rcu(rhp, rh); } diff --git a/kernel/reboot.c b/kernel/reboot.c index ec087827c85c..695c33e75efd 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -374,7 +374,7 @@ static struct sys_off_handler *alloc_sys_off_handler(int priority) else flags = GFP_KERNEL; - handler = kzalloc(sizeof(*handler), flags); + handler = kzalloc_obj(*handler, flags); if (!handler) return ERR_PTR(-ENOMEM); } diff --git a/kernel/relay.c b/kernel/relay.c index 5c665b729132..c28fc5dd3ded 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -59,7 +59,7 @@ static const struct vm_operations_struct relay_file_mmap_ops = { */ static struct page **relay_alloc_page_array(unsigned int n_pages) { - return kvcalloc(n_pages, sizeof(struct page *), GFP_KERNEL); + return kvzalloc_objs(struct page *, n_pages, GFP_KERNEL); } /* @@ -150,11 +150,10 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan) if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t)) return NULL; - buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL); + buf = kzalloc_obj(struct rchan_buf, GFP_KERNEL); if (!buf) return NULL; - buf->padding = kmalloc_array(chan->n_subbufs, sizeof(size_t), - GFP_KERNEL); + buf->padding = kmalloc_objs(size_t, chan->n_subbufs, GFP_KERNEL); if (!buf->padding) goto free_buf; @@ -490,7 +489,7 @@ struct rchan *relay_open(const char *base_filename, if (!cb || !cb->create_buf_file || !cb->remove_buf_file) return NULL; - chan = kzalloc(sizeof(struct rchan), GFP_KERNEL); + chan = kzalloc_obj(struct rchan, GFP_KERNEL); if (!chan) return NULL; diff --git a/kernel/resource.c b/kernel/resource.c index 31341bdd7707..d591e76c1535 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -182,7 +182,7 @@ static void free_resource(struct resource *res) static struct resource *alloc_resource(gfp_t flags) { - return kzalloc(sizeof(struct resource), flags); + return kzalloc_obj(struct resource, flags); } /* Return the conflict entry if you can't request it */ @@ -502,7 +502,7 @@ int walk_system_ram_res_rev(u64 start, u64 end, void *arg, int ret = -1; /* create a list */ - rams = kvcalloc(rams_size, sizeof(struct resource), GFP_KERNEL); + rams = kvzalloc_objs(struct resource, rams_size, GFP_KERNEL); if (!rams) return ret; diff --git a/kernel/resource_kunit.c b/kernel/resource_kunit.c index b8ef75b99eb2..378218df2427 100644 --- a/kernel/resource_kunit.c +++ b/kernel/resource_kunit.c @@ -204,7 +204,7 @@ static void resource_test_insert_resource(struct kunit *test, struct resource *p { struct resource *res; - res = kzalloc(sizeof(*res), GFP_KERNEL); + res = kzalloc_obj(*res, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, res); res->name = name; diff --git a/kernel/scftorture.c b/kernel/scftorture.c index d86d2d9c4624..02b3a5d2f0aa 100644 --- a/kernel/scftorture.c +++ b/kernel/scftorture.c @@ -350,7 +350,7 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra struct scf_selector *scfsp = scf_sel_rand(trsp); if (scfsp->scfs_prim == SCF_PRIM_SINGLE || scfsp->scfs_wait) { - scfcp = kmalloc(sizeof(*scfcp), GFP_ATOMIC); + scfcp = kmalloc_obj(*scfcp, GFP_ATOMIC); if (!scfcp) { WARN_ON_ONCE(!IS_ENABLED(CONFIG_KASAN)); atomic_inc(&n_alloc_errs); @@ -661,7 +661,7 @@ static int __init scf_torture_init(void) // Worker tasks invoking smp_call_function(). if (nthreads < 0) nthreads = num_online_cpus(); - scf_stats_p = kcalloc(nthreads, sizeof(scf_stats_p[0]), GFP_KERNEL); + scf_stats_p = kzalloc_objs(scf_stats_p[0], nthreads, GFP_KERNEL); if (!scf_stats_p) { SCFTORTOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index 954137775f38..c5a1019cbe83 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c @@ -86,7 +86,7 @@ static inline struct autogroup *autogroup_task_get(struct task_struct *p) static inline struct autogroup *autogroup_create(void) { - struct autogroup *ag = kzalloc(sizeof(*ag), GFP_KERNEL); + struct autogroup *ag = kzalloc_obj(*ag, GFP_KERNEL); struct task_group *tg; if (!ag) diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c index 9ede71ecba7f..6065cf725eee 100644 --- a/kernel/sched/core_sched.c +++ b/kernel/sched/core_sched.c @@ -12,7 +12,7 @@ struct sched_core_cookie { static unsigned long sched_core_alloc_cookie(void) { - struct sched_core_cookie *ck = kmalloc(sizeof(*ck), GFP_KERNEL); + struct sched_core_cookie *ck = kmalloc_obj(*ck, GFP_KERNEL); if (!ck) return 0; diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 23a56ba12d81..6e9a2e067886 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -61,7 +61,7 @@ cpuacct_css_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) return &root_cpuacct.css; - ca = kzalloc(sizeof(*ca), GFP_KERNEL); + ca = kzalloc_obj(*ca, GFP_KERNEL); if (!ca) goto out; diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index 37b572cc8aca..bbb2d68df86a 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -252,9 +252,7 @@ int cpudl_init(struct cpudl *cp) raw_spin_lock_init(&cp->lock); cp->size = 0; - cp->elements = kcalloc(nr_cpu_ids, - sizeof(struct cpudl_item), - GFP_KERNEL); + cp->elements = kzalloc_objs(struct cpudl_item, nr_cpu_ids, GFP_KERNEL); if (!cp->elements) return -ENOMEM; diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index cfc40181f66e..d71d09ed1b3b 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -638,7 +638,7 @@ static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) { struct sugov_policy *sg_policy; - sg_policy = kzalloc(sizeof(*sg_policy), GFP_KERNEL); + sg_policy = kzalloc_obj(*sg_policy, GFP_KERNEL); if (!sg_policy) return NULL; @@ -722,7 +722,7 @@ static struct sugov_tunables *sugov_tunables_alloc(struct sugov_policy *sg_polic { struct sugov_tunables *tunables; - tunables = kzalloc(sizeof(*tunables), GFP_KERNEL); + tunables = kzalloc_obj(*tunables, GFP_KERNEL); if (tunables) { gov_attr_set_init(&tunables->attr_set, &sg_policy->tunables_hook); if (!have_governor_per_policy()) diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 76a9ac5eb794..c2642deeaabc 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -288,7 +288,7 @@ int cpupri_init(struct cpupri *cp) goto cleanup; } - cp->cpu_to_pri = kcalloc(nr_cpu_ids, sizeof(int), GFP_KERNEL); + cp->cpu_to_pri = kzalloc_objs(int, nr_cpu_ids, GFP_KERNEL); if (!cp->cpu_to_pri) goto cleanup; diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index c18e81e8ef51..b9fadb2583ea 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4223,11 +4223,11 @@ static struct scx_exit_info *alloc_exit_info(size_t exit_dump_len) { struct scx_exit_info *ei; - ei = kzalloc(sizeof(*ei), GFP_KERNEL); + ei = kzalloc_obj(*ei, GFP_KERNEL); if (!ei) return NULL; - ei->bt = kcalloc(SCX_EXIT_BT_LEN, sizeof(ei->bt[0]), GFP_KERNEL); + ei->bt = kzalloc_objs(ei->bt[0], SCX_EXIT_BT_LEN, GFP_KERNEL); ei->msg = kzalloc(SCX_EXIT_MSG_LEN, GFP_KERNEL); ei->dump = kvzalloc(exit_dump_len, GFP_KERNEL); @@ -4824,7 +4824,7 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops) struct scx_sched *sch; int node, ret; - sch = kzalloc(sizeof(*sch), GFP_KERNEL); + sch = kzalloc_obj(*sch, GFP_KERNEL); if (!sch) return ERR_PTR(-ENOMEM); @@ -4838,8 +4838,8 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops) if (ret < 0) goto err_free_ei; - sch->global_dsqs = kcalloc(nr_node_ids, sizeof(sch->global_dsqs[0]), - GFP_KERNEL); + sch->global_dsqs = kzalloc_objs(sch->global_dsqs[0], nr_node_ids, + GFP_KERNEL); if (!sch->global_dsqs) { ret = -ENOMEM; goto err_free_hash; diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c index 3d9d404d5cd2..cd630772e164 100644 --- a/kernel/sched/ext_idle.c +++ b/kernel/sched/ext_idle.c @@ -664,8 +664,8 @@ void scx_idle_init_masks(void) BUG_ON(!alloc_cpumask_var(&scx_idle_global_masks.smt, GFP_KERNEL)); /* Allocate per-node idle cpumasks */ - scx_idle_node_masks = kcalloc(num_possible_nodes(), - sizeof(*scx_idle_node_masks), GFP_KERNEL); + scx_idle_node_masks = kzalloc_objs(*scx_idle_node_masks, + num_possible_nodes(), GFP_KERNEL); BUG_ON(!scx_idle_node_masks); for_each_node(i) { diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1e22b7fadd70..f6f050f2faec 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3427,7 +3427,7 @@ retry_pids: if (!vma->numab_state) { struct vma_numab_state *ptr; - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); if (!ptr) continue; @@ -13622,10 +13622,10 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) struct cfs_rq *cfs_rq; int i; - tg->cfs_rq = kcalloc(nr_cpu_ids, sizeof(cfs_rq), GFP_KERNEL); + tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids, GFP_KERNEL); if (!tg->cfs_rq) goto err; - tg->se = kcalloc(nr_cpu_ids, sizeof(se), GFP_KERNEL); + tg->se = kzalloc_objs(se, nr_cpu_ids, GFP_KERNEL); if (!tg->se) goto err; diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 59fdb7ebbf22..bf8a70598a09 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1114,7 +1114,7 @@ int psi_cgroup_alloc(struct cgroup *cgroup) if (!static_branch_likely(&psi_cgroups_enabled)) return 0; - cgroup->psi = kzalloc(sizeof(struct psi_group), GFP_KERNEL); + cgroup->psi = kzalloc_obj(struct psi_group, GFP_KERNEL); if (!cgroup->psi) return -ENOMEM; @@ -1340,7 +1340,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, char *buf, if (threshold_us == 0 || threshold_us > window_us) return ERR_PTR(-EINVAL); - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) return ERR_PTR(-ENOMEM); diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index a7680477fa6f..e72df7045592 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -259,10 +259,10 @@ int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent) if (!rt_group_sched_enabled()) return 1; - tg->rt_rq = kcalloc(nr_cpu_ids, sizeof(rt_rq), GFP_KERNEL); + tg->rt_rq = kzalloc_objs(rt_rq, nr_cpu_ids, GFP_KERNEL); if (!tg->rt_rq) goto err; - tg->rt_se = kcalloc(nr_cpu_ids, sizeof(rt_se), GFP_KERNEL); + tg->rt_se = kzalloc_objs(rt_se, nr_cpu_ids, GFP_KERNEL); if (!tg->rt_se) goto err; diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index ac268da91778..ac54fcae5de7 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -350,7 +350,7 @@ static struct perf_domain *pd_init(int cpu) return NULL; } - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return NULL; pd->em_pd = obj; @@ -589,7 +589,7 @@ static struct root_domain *alloc_rootdomain(void) { struct root_domain *rd; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return NULL; @@ -1998,7 +1998,7 @@ static int sched_record_numa_dist(int offline_node, int (*n_dist)(int, int), */ nr_levels = bitmap_weight(distance_map, NR_DISTANCE_VALUES); - distances = kcalloc(nr_levels, sizeof(int), GFP_KERNEL); + distances = kzalloc_objs(int, nr_levels, GFP_KERNEL); if (!distances) return -ENOMEM; @@ -2734,7 +2734,7 @@ cpumask_var_t *alloc_sched_domains(unsigned int ndoms) int i; cpumask_var_t *doms; - doms = kmalloc_array(ndoms, sizeof(*doms), GFP_KERNEL); + doms = kmalloc_objs(*doms, ndoms, GFP_KERNEL); if (!doms) return NULL; for (i = 0; i < ndoms; i++) { diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 25f62867a16d..b2297243071d 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -693,7 +693,7 @@ static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog) return ERR_PTR(-EACCES); /* Allocate a new seccomp_filter */ - sfilter = kzalloc(sizeof(*sfilter), GFP_KERNEL | __GFP_NOWARN); + sfilter = kzalloc_obj(*sfilter, GFP_KERNEL | __GFP_NOWARN); if (!sfilter) return ERR_PTR(-ENOMEM); @@ -1893,7 +1893,7 @@ static struct file *init_listener(struct seccomp_filter *filter) struct file *ret; ret = ERR_PTR(-ENOMEM); - filter->notif = kzalloc(sizeof(*(filter->notif)), GFP_KERNEL); + filter->notif = kzalloc_obj(*(filter->notif), GFP_KERNEL); if (!filter->notif) goto out; diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c index 269683d41aa9..864ae2da708f 100644 --- a/kernel/static_call_inline.c +++ b/kernel/static_call_inline.c @@ -255,7 +255,7 @@ static int __static_call_init(struct module *mod, goto do_transform; } - site_mod = kzalloc(sizeof(*site_mod), GFP_KERNEL); + site_mod = kzalloc_obj(*site_mod, GFP_KERNEL); if (!site_mod) return -ENOMEM; @@ -271,7 +271,7 @@ static int __static_call_init(struct module *mod, key->mods = site_mod; - site_mod = kzalloc(sizeof(*site_mod), GFP_KERNEL); + site_mod = kzalloc_obj(*site_mod, GFP_KERNEL); if (!site_mod) return -ENOMEM; } diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c index e76be24b132c..652744e00eb4 100644 --- a/kernel/time/namespace.c +++ b/kernel/time/namespace.c @@ -89,7 +89,7 @@ static struct time_namespace *clone_time_ns(struct user_namespace *user_ns, goto fail; err = -ENOMEM; - ns = kzalloc(sizeof(*ns), GFP_KERNEL_ACCOUNT); + ns = kzalloc_obj(*ns, GFP_KERNEL_ACCOUNT); if (!ns) goto fail_dec; diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c index 101a0f7c43e0..3a67e7e4c875 100644 --- a/kernel/time/posix-clock.c +++ b/kernel/time/posix-clock.c @@ -103,7 +103,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp) err = -ENODEV; goto out; } - pccontext = kzalloc(sizeof(*pccontext), GFP_KERNEL); + pccontext = kzalloc_obj(*pccontext, GFP_KERNEL); if (!pccontext) { err = -ENOMEM; goto out; diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c index 6da9cd562b20..21e72318aeb8 100644 --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -1766,7 +1766,7 @@ static int tmigr_setup_groups(unsigned int cpu, unsigned int node, int i, top = 0, err = 0, start_lvl = 0; bool root_mismatch = false; - stack = kcalloc(tmigr_hierarchy_levels, sizeof(*stack), GFP_KERNEL); + stack = kzalloc_objs(*stack, tmigr_hierarchy_levels, GFP_KERNEL); if (!stack) return -ENOMEM; @@ -2001,7 +2001,8 @@ static int __init tmigr_init(void) */ tmigr_crossnode_level = cpulvl; - tmigr_level_list = kcalloc(tmigr_hierarchy_levels, sizeof(struct list_head), GFP_KERNEL); + tmigr_level_list = kzalloc_objs(struct list_head, + tmigr_hierarchy_levels, GFP_KERNEL); if (!tmigr_level_list) goto err; diff --git a/kernel/torture.c b/kernel/torture.c index 1ea9f67953a7..27c9bb6122d8 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -494,7 +494,7 @@ void torture_shuffle_task_register(struct task_struct *tp) if (WARN_ON_ONCE(tp == NULL)) return; - stp = kmalloc(sizeof(*stp), GFP_KERNEL); + stp = kmalloc_obj(*stp, GFP_KERNEL); if (WARN_ON_ONCE(stp == NULL)) return; stp->st_t = tp; diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index e6988929ead2..5526b141b433 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -671,7 +671,7 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q, return ERR_PTR(-EBUSY); } - bt = kzalloc(sizeof(*bt), GFP_KERNEL); + bt = kzalloc_obj(*bt, GFP_KERNEL); if (!bt) return ERR_PTR(-ENOMEM); @@ -1904,7 +1904,7 @@ static int blk_trace_setup_queue(struct request_queue *q, struct blk_trace *bt = NULL; int ret = -ENOMEM; - bt = kzalloc(sizeof(*bt), GFP_KERNEL); + bt = kzalloc_obj(*bt, GFP_KERNEL); if (!bt) return -ENOMEM; diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index eadaef8592a3..c09268c6e9b7 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2243,7 +2243,7 @@ static int bpf_event_notify(struct notifier_block *nb, unsigned long op, switch (op) { case MODULE_STATE_COMING: - btm = kzalloc(sizeof(*btm), GFP_KERNEL); + btm = kzalloc_obj(*btm, GFP_KERNEL); if (btm) { btm->module = module; list_add(&btm->list, &bpf_trace_modules); @@ -2819,7 +2819,7 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr goto error; } - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) { err = -ENOMEM; goto error; @@ -3238,8 +3238,8 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr err = -ENOMEM; - link = kzalloc(sizeof(*link), GFP_KERNEL); - uprobes = kvcalloc(cnt, sizeof(*uprobes), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); + uprobes = kvzalloc_objs(*uprobes, cnt, GFP_KERNEL); if (!uprobes || !link) goto error_free; diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 1188eefef07c..0d649ca71ce0 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -749,7 +749,7 @@ static int fprobe_init(struct fprobe *fp, unsigned long *addrs, int num) return -E2BIG; fp->entry_data_size = size; - hlist_array = kzalloc(struct_size(hlist_array, array, num), GFP_KERNEL); + hlist_array = kzalloc_flex(*hlist_array, array, num, GFP_KERNEL); if (!hlist_array) return -ENOMEM; @@ -805,7 +805,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter if (!addrs) return -ENOMEM; - mods = kcalloc(num, sizeof(*mods), GFP_KERNEL); + mods = kzalloc_objs(*mods, num, GFP_KERNEL); if (!mods) return -ENOMEM; diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1ce17c8af409..fb3915a67013 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -702,7 +702,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat->hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); + stat->hash = kzalloc_objs(struct hlist_head, size, GFP_KERNEL); if (!stat->hash) return -ENOMEM; @@ -1215,7 +1215,7 @@ add_ftrace_hash_entry_direct(struct ftrace_hash *hash, unsigned long ip, unsigne { struct ftrace_func_entry *entry; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return NULL; @@ -1335,12 +1335,12 @@ struct ftrace_hash *alloc_ftrace_hash(int size_bits) struct ftrace_hash *hash; int size; - hash = kzalloc(sizeof(*hash), GFP_KERNEL); + hash = kzalloc_obj(*hash, GFP_KERNEL); if (!hash) return NULL; size = 1 << size_bits; - hash->buckets = kcalloc(size, sizeof(*hash->buckets), GFP_KERNEL); + hash->buckets = kzalloc_objs(*hash->buckets, size, GFP_KERNEL); if (!hash->buckets) { kfree(hash); @@ -1360,7 +1360,7 @@ static int ftrace_add_mod(struct trace_array *tr, struct ftrace_mod_load *ftrace_mod; struct list_head *mod_head = enable ? &tr->mod_trace : &tr->mod_notrace; - ftrace_mod = kzalloc(sizeof(*ftrace_mod), GFP_KERNEL); + ftrace_mod = kzalloc_obj(*ftrace_mod, GFP_KERNEL); if (!ftrace_mod) return -ENOMEM; @@ -3911,7 +3911,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages) if (!num_to_init) return NULL; - start_pg = pg = kzalloc(sizeof(*pg), GFP_KERNEL); + start_pg = pg = kzalloc_obj(*pg, GFP_KERNEL); if (!pg) return NULL; @@ -3929,7 +3929,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages) if (!num_to_init) break; - pg->next = kzalloc(sizeof(*pg), GFP_KERNEL); + pg->next = kzalloc_obj(*pg, GFP_KERNEL); if (!pg->next) goto free_pages; @@ -4686,7 +4686,7 @@ ftrace_regex_open(struct ftrace_ops *ops, int flag, if (tracing_check_open_get_tr(tr)) return -ENODEV; - iter = kzalloc(sizeof(*iter), GFP_KERNEL); + iter = kzalloc_obj(*iter, GFP_KERNEL); if (!iter) goto out; @@ -5334,7 +5334,7 @@ int ftrace_func_mapper_add_ip(struct ftrace_func_mapper *mapper, if (entry) return -EBUSY; - map = kmalloc(sizeof(*map), GFP_KERNEL); + map = kmalloc_obj(*map, GFP_KERNEL); if (!map) return -ENOMEM; @@ -5474,7 +5474,7 @@ register_ftrace_function_probe(char *glob, struct trace_array *tr, } } if (!probe) { - probe = kzalloc(sizeof(*probe), GFP_KERNEL); + probe = kzalloc_obj(*probe, GFP_KERNEL); if (!probe) { mutex_unlock(&ftrace_lock); return -ENOMEM; @@ -7223,7 +7223,7 @@ ftrace_graph_open(struct inode *inode, struct file *file) if (unlikely(ftrace_disabled)) return -ENODEV; - fgd = kmalloc(sizeof(*fgd), GFP_KERNEL); + fgd = kmalloc_obj(*fgd, GFP_KERNEL); if (fgd == NULL) return -ENOMEM; @@ -7251,7 +7251,7 @@ ftrace_graph_notrace_open(struct inode *inode, struct file *file) if (unlikely(ftrace_disabled)) return -ENODEV; - fgd = kmalloc(sizeof(*fgd), GFP_KERNEL); + fgd = kmalloc_obj(*fgd, GFP_KERNEL); if (fgd == NULL) return -ENOMEM; @@ -8041,7 +8041,7 @@ static void save_ftrace_mod_rec(struct ftrace_mod_map *mod_map, if (!ret) return; - mod_func = kmalloc(sizeof(*mod_func), GFP_KERNEL); + mod_func = kmalloc_obj(*mod_func, GFP_KERNEL); if (!mod_func) return; @@ -8068,7 +8068,7 @@ allocate_ftrace_mod_map(struct module *mod, if (ftrace_disabled) return NULL; - mod_map = kmalloc(sizeof(*mod_map), GFP_KERNEL); + mod_map = kmalloc_obj(*mod_map, GFP_KERNEL); if (!mod_map) return NULL; @@ -8241,7 +8241,7 @@ static void add_to_clear_hash_list(struct list_head *clear_list, { struct ftrace_init_func *func; - func = kmalloc(sizeof(*func), GFP_KERNEL); + func = kmalloc_obj(*func, GFP_KERNEL); if (!func) { MEM_FAIL(1, "alloc failure, ftrace filter could be stale\n"); return; diff --git a/kernel/trace/pid_list.c b/kernel/trace/pid_list.c index dbee72d69d0a..6d12855b0277 100644 --- a/kernel/trace/pid_list.c +++ b/kernel/trace/pid_list.c @@ -359,7 +359,7 @@ static void pid_list_refill_irq(struct irq_work *iwork) while (upper_count-- > 0) { union upper_chunk *chunk; - chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT); + chunk = kzalloc_obj(*chunk, GFP_NOWAIT); if (!chunk) break; *upper_next = chunk; @@ -370,7 +370,7 @@ static void pid_list_refill_irq(struct irq_work *iwork) while (lower_count-- > 0) { union lower_chunk *chunk; - chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT); + chunk = kzalloc_obj(*chunk, GFP_NOWAIT); if (!chunk) break; *lower_next = chunk; @@ -423,7 +423,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) /* According to linux/thread.h, pids can be no bigger that 30 bits */ WARN_ON_ONCE(init_pid_ns.pid_max > (1 << 30)); - pid_list = kzalloc(sizeof(*pid_list), GFP_KERNEL); + pid_list = kzalloc_obj(*pid_list, GFP_KERNEL); if (!pid_list) return NULL; @@ -435,7 +435,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) for (i = 0; i < CHUNK_ALLOC; i++) { union upper_chunk *chunk; - chunk = kzalloc(sizeof(*chunk), GFP_KERNEL); + chunk = kzalloc_obj(*chunk, GFP_KERNEL); if (!chunk) break; chunk->next = pid_list->upper_list; @@ -446,7 +446,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) for (i = 0; i < CHUNK_ALLOC; i++) { union lower_chunk *chunk; - chunk = kzalloc(sizeof(*chunk), GFP_KERNEL); + chunk = kzalloc_obj(*chunk, GFP_KERNEL); if (!chunk) break; chunk->next = pid_list->lower_list; diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c index 30d224946881..d09d5a204627 100644 --- a/kernel/trace/rethook.c +++ b/kernel/trace/rethook.c @@ -108,7 +108,7 @@ struct rethook *rethook_alloc(void *data, rethook_handler_t handler, if (!handler || num <= 0 || size < sizeof(struct rethook_node)) return ERR_PTR(-EINVAL); - rh = kzalloc(sizeof(struct rethook), GFP_KERNEL); + rh = kzalloc_obj(struct rethook, GFP_KERNEL); if (!rh) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 1e7a34a31851..e1395834886e 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -6001,7 +6001,7 @@ ring_buffer_read_start(struct trace_buffer *buffer, int cpu, gfp_t flags) if (!cpumask_test_cpu(cpu, buffer->cpumask)) return NULL; - iter = kzalloc(sizeof(*iter), flags); + iter = kzalloc_obj(*iter, flags); if (!iter) return NULL; @@ -6509,7 +6509,7 @@ ring_buffer_alloc_read_page(struct trace_buffer *buffer, int cpu) if (!cpumask_test_cpu(cpu, buffer->cpumask)) return ERR_PTR(-ENODEV); - bpage = kzalloc(sizeof(*bpage), GFP_KERNEL); + bpage = kzalloc_obj(*bpage, GFP_KERNEL); if (!bpage) return ERR_PTR(-ENOMEM); @@ -7190,7 +7190,7 @@ static int __rb_map_vma(struct ring_buffer_per_cpu *cpu_buffer, nr_pages = nr_vma_pages; - pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); if (!pages) return -ENOMEM; diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 2f6fbf9e7caf..83ae2e8e931c 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1064,7 +1064,7 @@ int tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data, cond_update_fn_t update) { struct cond_snapshot *cond_snapshot __free(kfree) = - kzalloc(sizeof(*cond_snapshot), GFP_KERNEL); + kzalloc_obj(*cond_snapshot, GFP_KERNEL); int ret; if (!cond_snapshot) @@ -3903,8 +3903,8 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot) if (!iter) return ERR_PTR(-ENOMEM); - iter->buffer_iter = kcalloc(nr_cpu_ids, sizeof(*iter->buffer_iter), - GFP_KERNEL); + iter->buffer_iter = kzalloc_objs(*iter->buffer_iter, nr_cpu_ids, + GFP_KERNEL); if (!iter->buffer_iter) goto release; @@ -5132,7 +5132,7 @@ trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, * where the head holds the module and length of array, and the * tail holds a pointer to the next list. */ - map_array = kmalloc_array(len + 2, sizeof(*map_array), GFP_KERNEL); + map_array = kmalloc_objs(*map_array, len + 2, GFP_KERNEL); if (!map_array) { pr_warn("Unable to allocate trace eval mapping\n"); return; @@ -5809,7 +5809,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) goto fail_pipe_on_cpu; /* create a buffer to store the information to pass to userspace */ - iter = kzalloc(sizeof(*iter), GFP_KERNEL); + iter = kzalloc_obj(*iter, GFP_KERNEL); if (!iter) { ret = -ENOMEM; goto fail_alloc_iter; @@ -6628,7 +6628,7 @@ static int user_buffer_init(struct trace_user_buf_info **tinfo, size_t size) if (!*tinfo) { alloc = true; - *tinfo = kzalloc(sizeof(**tinfo), GFP_KERNEL); + *tinfo = kzalloc_obj(**tinfo, GFP_KERNEL); if (!*tinfo) return -ENOMEM; } @@ -7153,10 +7153,10 @@ static int tracing_snapshot_open(struct inode *inode, struct file *file) } else { /* Writes still need the seq_file to hold the private data */ ret = -ENOMEM; - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (!m) goto out; - iter = kzalloc(sizeof(*iter), GFP_KERNEL); + iter = kzalloc_obj(*iter, GFP_KERNEL); if (!iter) { kfree(m); goto out; @@ -7545,7 +7545,7 @@ static struct tracing_log_err *alloc_tracing_log_err(int len) { struct tracing_log_err *err; - err = kzalloc(sizeof(*err), GFP_KERNEL); + err = kzalloc_obj(*err, GFP_KERNEL); if (!err) return ERR_PTR(-ENOMEM); @@ -7804,7 +7804,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) if (ret) return ret; - info = kvzalloc(sizeof(*info), GFP_KERNEL); + info = kvzalloc_obj(*info, GFP_KERNEL); if (!info) { trace_array_put(tr); return -ENOMEM; @@ -8065,7 +8065,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, struct page *page; int r; - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) { ret = -ENOMEM; break; @@ -8284,7 +8284,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf, unsigned long long t; unsigned long usec_rem; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -8878,7 +8878,7 @@ create_trace_option_files(struct trace_array *tr, struct tracer *tracer, for (cnt = 0; opts[cnt].name; cnt++) ; - topts = kcalloc(cnt + 1, sizeof(*topts), GFP_KERNEL); + topts = kzalloc_objs(*topts, cnt + 1, GFP_KERNEL); if (!topts) return 0; @@ -8950,7 +8950,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer) if (!trace_ok_for_array(tracer, tr)) return 0; - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) return -ENOMEM; @@ -8967,7 +8967,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer) * If the tracer defines default flags, it means the flags are * per trace instance. */ - flags = kmalloc(sizeof(*flags), GFP_KERNEL); + flags = kmalloc_obj(*flags, GFP_KERNEL); if (!flags) return -ENOMEM; @@ -9310,7 +9310,8 @@ static void setup_trace_scratch(struct trace_array *tr, mod_addr_comp, NULL, NULL); if (IS_ENABLED(CONFIG_MODULES)) { - module_delta = kzalloc(struct_size(module_delta, delta, nr_entries), GFP_KERNEL); + module_delta = kzalloc_flex(*module_delta, delta, nr_entries, + GFP_KERNEL); if (!module_delta) { pr_info("module_delta allocation failed. Not able to decode module address."); goto reset; @@ -9537,7 +9538,7 @@ trace_array_create_systems(const char *name, const char *systems, int ret; ret = -ENOMEM; - tr = kzalloc(sizeof(*tr), GFP_KERNEL); + tr = kzalloc_obj(*tr, GFP_KERNEL); if (!tr) return ERR_PTR(ret); @@ -10928,8 +10929,8 @@ void __init ftrace_boot_snapshot(void) void __init early_trace_init(void) { if (tracepoint_printk) { - tracepoint_print_iter = - kzalloc(sizeof(*tracepoint_print_iter), GFP_KERNEL); + tracepoint_print_iter = kzalloc_obj(*tracepoint_print_iter, + GFP_KERNEL); if (MEM_FAIL(!tracepoint_print_iter, "Failed to allocate trace iterator\n")) tracepoint_printk = 0; diff --git a/kernel/trace/trace_btf.c b/kernel/trace/trace_btf.c index 5bbdbcbbde3c..1d3c42527736 100644 --- a/kernel/trace/trace_btf.c +++ b/kernel/trace/trace_btf.c @@ -78,7 +78,7 @@ const struct btf_member *btf_find_struct_member(struct btf *btf, const char *name; int i, top = 0; - anon_stack = kcalloc(BTF_ANON_STACK_MAX, sizeof(*anon_stack), GFP_KERNEL); + anon_stack = kzalloc_objs(*anon_stack, BTF_ANON_STACK_MAX, GFP_KERNEL); if (!anon_stack) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c index 3ee39715d5e4..3adc9a8c29a9 100644 --- a/kernel/trace/trace_eprobe.c +++ b/kernel/trace/trace_eprobe.c @@ -211,7 +211,7 @@ static struct trace_eprobe *alloc_event_probe(const char *group, sys_name = event->class->system; event_name = trace_event_name(event); - ep = kzalloc(struct_size(ep, tp.args, nargs), GFP_KERNEL); + ep = kzalloc_flex(*ep, tp.args, nargs, GFP_KERNEL); if (!ep) { trace_event_put_ref(event); return ERR_PTR(-ENOMEM); @@ -529,8 +529,8 @@ new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file) struct eprobe_data *edata; int ret; - edata = kzalloc(sizeof(*edata), GFP_KERNEL); - trigger = kzalloc(sizeof(*trigger), GFP_KERNEL); + edata = kzalloc_obj(*edata, GFP_KERNEL); + trigger = kzalloc_obj(*trigger, GFP_KERNEL); if (!trigger || !edata) { ret = -ENOMEM; goto error; diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index b659653dc03a..1d5ce0244f8c 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -976,7 +976,7 @@ static int cache_mod(struct trace_array *tr, const char *mod, int set, if (!set) return remove_cache_mod(tr, mod, match, system, event); - event_mod = kzalloc(sizeof(*event_mod), GFP_KERNEL); + event_mod = kzalloc_obj(*event_mod, GFP_KERNEL); if (!event_mod) return -ENOMEM; @@ -1648,7 +1648,7 @@ static void *s_start(struct seq_file *m, loff_t *pos) struct set_event_iter *iter; loff_t l; - iter = kzalloc(sizeof(*iter), GFP_KERNEL); + iter = kzalloc_obj(*iter, GFP_KERNEL); mutex_lock(&event_mutex); if (!iter) return NULL; @@ -2206,7 +2206,7 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt, if (*ppos) return 0; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2320,7 +2320,7 @@ static int system_tr_open(struct inode *inode, struct file *filp) int ret; /* Make a temporary dir that has no system but points to tr */ - dir = kzalloc(sizeof(*dir), GFP_KERNEL); + dir = kzalloc_obj(*dir, GFP_KERNEL); if (!dir) return -ENOMEM; @@ -2366,7 +2366,7 @@ subsystem_filter_read(struct file *filp, char __user *ubuf, size_t cnt, if (*ppos) return 0; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2416,7 +2416,7 @@ show_header_page_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t * if (*ppos) return 0; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2440,7 +2440,7 @@ show_header_event_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t if (*ppos) return 0; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; @@ -2881,7 +2881,7 @@ create_new_subsystem(const char *name) struct event_subsystem *system; /* need to create new entry */ - system = kmalloc(sizeof(*system), GFP_KERNEL); + system = kmalloc_obj(*system, GFP_KERNEL); if (!system) return NULL; @@ -2892,7 +2892,7 @@ create_new_subsystem(const char *name) if (!system->name) goto out_free; - system->filter = kzalloc(sizeof(struct event_filter), GFP_KERNEL); + system->filter = kzalloc_obj(struct event_filter, GFP_KERNEL); if (!system->filter) goto out_free; @@ -2960,7 +2960,7 @@ event_subsystem_dir(struct trace_array *tr, const char *name, } } - dir = kmalloc(sizeof(*dir), GFP_KERNEL); + dir = kmalloc_obj(*dir, GFP_KERNEL); if (!dir) goto out_fail; @@ -3403,7 +3403,7 @@ static void add_str_to_module(struct module *module, char *str) { struct module_string *modstr; - modstr = kmalloc(sizeof(*modstr), GFP_KERNEL); + modstr = kmalloc_obj(*modstr, GFP_KERNEL); /* * If we failed to allocate memory here, then we'll just @@ -4365,7 +4365,7 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash, goto out_put; ret = -ENOMEM; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) goto out_put; diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 7001e34476ee..b84bdad362e9 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -485,10 +485,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, nr_preds += 2; /* For TRUE and FALSE */ - op_stack = kmalloc_array(nr_parens, sizeof(*op_stack), GFP_KERNEL); + op_stack = kmalloc_objs(*op_stack, nr_parens, GFP_KERNEL); if (!op_stack) return ERR_PTR(-ENOMEM); - prog_stack = kcalloc(nr_preds, sizeof(*prog_stack), GFP_KERNEL); + prog_stack = kzalloc_objs(*prog_stack, nr_preds, GFP_KERNEL); if (!prog_stack) { parse_error(pe, -ENOMEM, 0); goto out_free; @@ -1213,7 +1213,7 @@ static void append_filter_err(struct trace_array *tr, if (WARN_ON(!filter->filter_string)) return; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (!s) return; trace_seq_init(s); @@ -1394,13 +1394,13 @@ static void try_delay_free_filter(struct event_filter *filter) struct filter_head *head; struct filter_list *item; - head = kmalloc(sizeof(*head), GFP_KERNEL); + head = kmalloc_obj(*head, GFP_KERNEL); if (!head) goto free_now; INIT_LIST_HEAD(&head->list); - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) { kfree(head); goto free_now; @@ -1442,7 +1442,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, struct filter_head *head; struct filter_list *item; - head = kmalloc(sizeof(*head), GFP_KERNEL); + head = kmalloc_obj(*head, GFP_KERNEL); if (!head) goto free_now; @@ -1451,7 +1451,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, list_for_each_entry(file, &tr->events, list) { if (file->system != dir) continue; - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) goto free_now; item->filter = event_filter(file); @@ -1459,7 +1459,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, event_clear_filter(file); } - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) goto free_now; @@ -1708,7 +1708,7 @@ static int parse_pred(const char *str, void *data, s = i; - pred = kzalloc(sizeof(*pred), GFP_KERNEL); + pred = kzalloc_obj(*pred, GFP_KERNEL); if (!pred) return -ENOMEM; @@ -1819,7 +1819,7 @@ static int parse_pred(const char *str, void *data, goto err_free; } - pred->regex = kzalloc(sizeof(*pred->regex), GFP_KERNEL); + pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL); if (!pred->regex) goto err_mem; pred->regex->len = len; @@ -1984,7 +1984,7 @@ static int parse_pred(const char *str, void *data, goto err_free; } - pred->regex = kzalloc(sizeof(*pred->regex), GFP_KERNEL); + pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL); if (!pred->regex) goto err_mem; pred->regex->len = len; @@ -2261,7 +2261,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, bool fail = true; int err; - filter_list = kmalloc(sizeof(*filter_list), GFP_KERNEL); + filter_list = kmalloc_obj(*filter_list, GFP_KERNEL); if (!filter_list) return -ENOMEM; @@ -2272,7 +2272,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, if (file->system != dir) continue; - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (!filter) goto fail_mem; @@ -2289,7 +2289,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, event_set_filtered_flag(file); - filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); + filter_item = kzalloc_obj(*filter_item, GFP_KERNEL); if (!filter_item) goto fail_mem; @@ -2343,14 +2343,14 @@ static int create_filter_start(char *filter_string, bool set_str, if (WARN_ON_ONCE(*pse || *filterp)) return -EINVAL; - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (filter && set_str) { filter->filter_string = kstrdup(filter_string, GFP_KERNEL); if (!filter->filter_string) err = -ENOMEM; } - pe = kzalloc(sizeof(*pe), GFP_KERNEL); + pe = kzalloc_obj(*pe, GFP_KERNEL); if (!filter || !pe || err) { kfree(pe); diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 768df987419e..da42a087d646 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -732,7 +732,7 @@ static struct track_data *track_data_alloc(unsigned int key_len, struct action_data *action_data, struct hist_trigger_data *hist_data) { - struct track_data *data = kzalloc(sizeof(*data), GFP_KERNEL); + struct track_data *data = kzalloc_obj(*data, GFP_KERNEL); struct hist_elt_data *elt_data; if (!data) @@ -748,7 +748,7 @@ static struct track_data *track_data_alloc(unsigned int key_len, data->action_data = action_data; data->hist_data = hist_data; - elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL); + elt_data = kzalloc_obj(*elt_data, GFP_KERNEL); if (!elt_data) { track_data_free(data); return ERR_PTR(-ENOMEM); @@ -1086,7 +1086,7 @@ static int save_hist_vars(struct hist_trigger_data *hist_data) if (tracing_check_open_get_tr(tr)) return -ENODEV; - var_data = kzalloc(sizeof(*var_data), GFP_KERNEL); + var_data = kzalloc_obj(*var_data, GFP_KERNEL); if (!var_data) { trace_array_put(tr); return -ENOMEM; @@ -1548,7 +1548,7 @@ parse_hist_trigger_attrs(struct trace_array *tr, char *trigger_str) struct hist_trigger_attrs *attrs; int ret = 0; - attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_obj(*attrs, GFP_KERNEL); if (!attrs) return ERR_PTR(-ENOMEM); @@ -1646,7 +1646,7 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt) struct hist_field *hist_field; unsigned int i, n_str; - elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL); + elt_data = kzalloc_obj(*elt_data, GFP_KERNEL); if (!elt_data) return -ENOMEM; @@ -1962,7 +1962,7 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (field && is_function_field(field)) return NULL; - hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL); + hist_field = kzalloc_obj(struct hist_field, GFP_KERNEL); if (!hist_field) return NULL; @@ -3049,7 +3049,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, if (!IS_ERR_OR_NULL(event_var)) return event_var; - var_hist = kzalloc(sizeof(*var_hist), GFP_KERNEL); + var_hist = kzalloc_obj(*var_hist, GFP_KERNEL); if (!var_hist) return ERR_PTR(-ENOMEM); @@ -3231,7 +3231,7 @@ static struct hist_field *create_var(struct hist_trigger_data *hist_data, goto out; } - var = kzalloc(sizeof(struct hist_field), GFP_KERNEL); + var = kzalloc_obj(struct hist_field, GFP_KERNEL); if (!var) { var = ERR_PTR(-ENOMEM); goto out; @@ -3292,7 +3292,7 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data, goto err; } - field_var = kzalloc(sizeof(struct field_var), GFP_KERNEL); + field_var = kzalloc_obj(struct field_var, GFP_KERNEL); if (!field_var) { destroy_hist_field(val, 0); kfree_const(var->type); @@ -3831,7 +3831,7 @@ static struct action_data *track_data_parse(struct hist_trigger_data *hist_data, int ret = -EINVAL; char *var_str; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); @@ -4198,7 +4198,7 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str) struct action_data *data; int ret = -EINVAL; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); @@ -5136,7 +5136,7 @@ create_hist_data(unsigned int map_bits, struct hist_trigger_data *hist_data; int ret = 0; - hist_data = kzalloc(sizeof(*hist_data), GFP_KERNEL); + hist_data = kzalloc_obj(*hist_data, GFP_KERNEL); if (!hist_data) return ERR_PTR(-ENOMEM); @@ -5674,8 +5674,8 @@ static int print_entries(struct seq_file *m, (HIST_FIELD_FL_PERCENT | HIST_FIELD_FL_GRAPH))) continue; if (!stats) { - stats = kcalloc(hist_data->n_vals, sizeof(*stats), - GFP_KERNEL); + stats = kzalloc_objs(*stats, hist_data->n_vals, + GFP_KERNEL); if (!stats) { n_entries = -ENOMEM; goto out; @@ -5828,7 +5828,7 @@ static int event_hist_open(struct inode *inode, struct file *file) goto err; } - hist_file = kzalloc(sizeof(*hist_file), GFP_KERNEL); + hist_file = kzalloc_obj(*hist_file, GFP_KERNEL); if (!hist_file) { ret = -ENOMEM; goto err; @@ -6602,7 +6602,7 @@ static int hist_register_trigger(char *glob, data->private_data = named_data->private_data; set_named_trigger_data(data, named_data); /* Copy the command ops and update some of the functions */ - cmd_ops = kmalloc(sizeof(*cmd_ops), GFP_KERNEL); + cmd_ops = kmalloc_obj(*cmd_ops, GFP_KERNEL); if (!cmd_ops) { ret = -ENOMEM; goto out; diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index ce42fbf16f4a..db74b2c663f8 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -711,7 +711,7 @@ static struct synth_field *parse_synth_field(int argc, char **argv, *field_version = check_field_version(prefix, field_type, field_name); - field = kzalloc(sizeof(*field), GFP_KERNEL); + field = kzalloc_obj(*field, GFP_KERNEL); if (!field) return ERR_PTR(-ENOMEM); @@ -819,7 +819,7 @@ static struct tracepoint *alloc_synth_tracepoint(char *name) { struct tracepoint *tp; - tp = kzalloc(sizeof(*tp), GFP_KERNEL); + tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) return ERR_PTR(-ENOMEM); @@ -973,7 +973,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields, unsigned int i, j, n_dynamic_fields = 0; struct synth_event *event; - event = kzalloc(sizeof(*event), GFP_KERNEL); + event = kzalloc_obj(*event, GFP_KERNEL); if (!event) { event = ERR_PTR(-ENOMEM); goto out; @@ -986,7 +986,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields, goto out; } - event->fields = kcalloc(n_fields, sizeof(*event->fields), GFP_KERNEL); + event->fields = kzalloc_objs(*event->fields, n_fields, GFP_KERNEL); if (!event->fields) { free_synth_event(event); event = ERR_PTR(-ENOMEM); @@ -998,9 +998,9 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields, n_dynamic_fields++; if (n_dynamic_fields) { - event->dynamic_fields = kcalloc(n_dynamic_fields, - sizeof(*event->dynamic_fields), - GFP_KERNEL); + event->dynamic_fields = kzalloc_objs(*event->dynamic_fields, + n_dynamic_fields, + GFP_KERNEL); if (!event->dynamic_fields) { free_synth_event(event); event = ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index 7fa26327c9c7..7ba3548a2f60 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -914,7 +914,7 @@ struct event_trigger_data *trigger_data_alloc(struct event_command *cmd_ops, { struct event_trigger_data *trigger_data; - trigger_data = kzalloc(sizeof(*trigger_data), GFP_KERNEL); + trigger_data = kzalloc_obj(*trigger_data, GFP_KERNEL); if (!trigger_data) return NULL; @@ -1724,7 +1724,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops, #endif ret = -ENOMEM; - enable_data = kzalloc(sizeof(*enable_data), GFP_KERNEL); + enable_data = kzalloc_obj(*enable_data, GFP_KERNEL); if (!enable_data) return ret; diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index dca6e50b3b21..c35182cb7286 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -370,7 +370,7 @@ static struct user_event_group *user_event_group_create(void) { struct user_event_group *group; - group = kzalloc(sizeof(*group), GFP_KERNEL); + group = kzalloc_obj(*group, GFP_KERNEL); if (!group) return NULL; @@ -637,7 +637,7 @@ static bool user_event_enabler_dup(struct user_event_enabler *orig, if (unlikely(test_bit(ENABLE_VAL_FREEING_BIT, ENABLE_BITOPS(orig)))) return true; - enabler = kzalloc(sizeof(*enabler), GFP_NOWAIT | __GFP_ACCOUNT); + enabler = kzalloc_obj(*enabler, GFP_NOWAIT | __GFP_ACCOUNT); if (!enabler) return false; @@ -706,7 +706,7 @@ static struct user_event_mm *user_event_mm_alloc(struct task_struct *t) { struct user_event_mm *user_mm; - user_mm = kzalloc(sizeof(*user_mm), GFP_KERNEL_ACCOUNT); + user_mm = kzalloc_obj(*user_mm, GFP_KERNEL_ACCOUNT); if (!user_mm) return NULL; @@ -892,7 +892,7 @@ static struct user_event_enabler if (!user_mm) return NULL; - enabler = kzalloc(sizeof(*enabler), GFP_KERNEL_ACCOUNT); + enabler = kzalloc_obj(*enabler, GFP_KERNEL_ACCOUNT); if (!enabler) goto out; @@ -1113,7 +1113,7 @@ static int user_event_add_field(struct user_event *user, const char *type, struct ftrace_event_field *field; int validator_flags = 0; - field = kmalloc(sizeof(*field), GFP_KERNEL_ACCOUNT); + field = kmalloc_obj(*field, GFP_KERNEL_ACCOUNT); if (!field) return -ENOMEM; @@ -1132,7 +1132,7 @@ add_validator: if (strstr(type, "char") != NULL) validator_flags |= VALIDATOR_ENSURE_NULL; - validator = kmalloc(sizeof(*validator), GFP_KERNEL_ACCOUNT); + validator = kmalloc_obj(*validator, GFP_KERNEL_ACCOUNT); if (!validator) { kfree(field); @@ -2105,7 +2105,7 @@ static int user_event_parse(struct user_event_group *group, char *name, return 0; } - user = kzalloc(sizeof(*user), GFP_KERNEL_ACCOUNT); + user = kzalloc_obj(*user, GFP_KERNEL_ACCOUNT); if (!user) return -ENOMEM; @@ -2315,7 +2315,7 @@ static int user_events_open(struct inode *node, struct file *file) if (!group) return -ENOENT; - info = kzalloc(sizeof(*info), GFP_KERNEL_ACCOUNT); + info = kzalloc_obj(*info, GFP_KERNEL_ACCOUNT); if (!info) return -ENOMEM; diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 262c0556e4af..7decd8383d67 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -99,7 +99,7 @@ static struct tracepoint_user *__tracepoint_user_init(const char *name, struct t struct tracepoint_user *tuser __free(tuser_free) = NULL; int ret; - tuser = kzalloc(sizeof(*tuser), GFP_KERNEL); + tuser = kzalloc_obj(*tuser, GFP_KERNEL); if (!tuser) return NULL; tuser->name = kstrdup(name, GFP_KERNEL); @@ -579,7 +579,7 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group, struct trace_fprobe *tf __free(free_trace_fprobe) = NULL; int ret = -ENOMEM; - tf = kzalloc(struct_size(tf, tp.args, nargs), GFP_KERNEL); + tf = kzalloc_flex(*tf, tp.args, nargs, GFP_KERNEL); if (!tf) return ERR_PTR(ret); @@ -1403,7 +1403,7 @@ static int trace_fprobe_create_cb(int argc, const char *argv[]) struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index c12795c2fb39..a7e4ad088acf 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c @@ -61,7 +61,7 @@ int ftrace_allocate_ftrace_ops(struct trace_array *tr) if (tr->flags & TRACE_ARRAY_FL_GLOBAL) return 0; - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); if (!ops) return -ENOMEM; diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 1de6f1573621..73f0479aeac0 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -434,7 +434,7 @@ int allocate_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops) { struct fgraph_ops *gops; - gops = kzalloc(sizeof(*gops), GFP_KERNEL); + gops = kzalloc_obj(*gops, GFP_KERNEL); if (!gops) return -ENOMEM; @@ -1613,7 +1613,7 @@ void graph_trace_open(struct trace_iterator *iter) /* We can be called in atomic context via ftrace_dump() */ gfpflags = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL; - data = kzalloc(sizeof(*data), gfpflags); + data = kzalloc_obj(*data, gfpflags); if (!data) goto out_err; diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index b4f62d2e41ed..808b91873bd6 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -275,7 +275,7 @@ static struct trace_kprobe *alloc_trace_kprobe(const char *group, struct trace_kprobe *tk __free(free_trace_kprobe) = NULL; int ret = -ENOMEM; - tk = kzalloc(struct_size(tk, tp.args, nargs), GFP_KERNEL); + tk = kzalloc_flex(*tk, tp.args, nargs, GFP_KERNEL); if (!tk) return ERR_PTR(ret); @@ -1082,7 +1082,7 @@ static int trace_kprobe_create_cb(int argc, const char *argv[]) struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->flags = TPARG_FL_KERNEL; diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index c706544be60c..1c752a691317 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c @@ -101,7 +101,7 @@ static void mmio_pipe_open(struct trace_iterator *iter) trace_seq_puts(s, "VERSION 20070824\n"); - hiter = kzalloc(sizeof(*hiter), GFP_KERNEL); + hiter = kzalloc_obj(*hiter, GFP_KERNEL); if (!hiter) return; diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 827104d00bc0..51e7b0476a7f 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -122,7 +122,7 @@ static int osnoise_register_instance(struct trace_array *tr) */ lockdep_assert_held(&trace_types_lock); - inst = kmalloc(sizeof(*inst), GFP_KERNEL); + inst = kmalloc_obj(*inst, GFP_KERNEL); if (!inst) return -ENOMEM; diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c index 6a29e4350b55..05b61ec67622 100644 --- a/kernel/trace/trace_printk.c +++ b/kernel/trace/trace_printk.c @@ -69,7 +69,7 @@ void hold_module_trace_bprintk_format(const char **start, const char **end) } fmt = NULL; - tb_fmt = kmalloc(sizeof(*tb_fmt), GFP_KERNEL); + tb_fmt = kmalloc_obj(*tb_fmt, GFP_KERNEL); if (tb_fmt) { fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL); if (fmt) { diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index 2f571083ce9e..fff0879cb0e9 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -838,12 +838,12 @@ static int __store_entry_arg(struct trace_probe *tp, int argnum) int i, offset, last_offset = 0; if (!earg) { - earg = kzalloc(sizeof(*tp->entry_arg), GFP_KERNEL); + earg = kzalloc_obj(*tp->entry_arg, GFP_KERNEL); if (!earg) return -ENOMEM; earg->size = 2 * tp->nr_args + 1; - earg->code = kcalloc(earg->size, sizeof(struct fetch_insn), - GFP_KERNEL); + earg->code = kzalloc_objs(struct fetch_insn, earg->size, + GFP_KERNEL); if (!earg->code) { kfree(earg); return -ENOMEM; @@ -1499,7 +1499,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, if (IS_ERR(type)) return PTR_ERR(type); - code = tmp = kcalloc(FETCH_INSN_MAX, sizeof(*code), GFP_KERNEL); + code = tmp = kzalloc_objs(*code, FETCH_INSN_MAX, GFP_KERNEL); if (!code) return -ENOMEM; code[FETCH_INSN_MAX - 1].op = FETCH_OP_END; @@ -1543,7 +1543,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, if (code->op == FETCH_OP_END) break; /* Shrink down the code buffer */ - parg->code = kcalloc(code - tmp + 1, sizeof(*code), GFP_KERNEL); + parg->code = kzalloc_objs(*code, code - tmp + 1, GFP_KERNEL); if (!parg->code) ret = -ENOMEM; else @@ -2149,7 +2149,7 @@ int trace_probe_add_file(struct trace_probe *tp, struct trace_event_file *file) { struct event_file_link *link; - link = kmalloc(sizeof(*link), GFP_KERNEL); + link = kmalloc_obj(*link, GFP_KERNEL); if (!link) return -ENOMEM; diff --git a/kernel/trace/trace_recursion_record.c b/kernel/trace/trace_recursion_record.c index a520b11afb0d..852069484060 100644 --- a/kernel/trace/trace_recursion_record.c +++ b/kernel/trace/trace_recursion_record.c @@ -129,7 +129,7 @@ static void *recursed_function_seq_start(struct seq_file *m, loff_t *pos) ret = &recursed_functions[*pos]; } - tseq = kzalloc(sizeof(*tseq), GFP_KERNEL); + tseq = kzalloc_obj(*tseq, GFP_KERNEL); if (!tseq) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index c46d584ded3b..ded84f1d8121 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c @@ -444,8 +444,7 @@ int trace_alloc_tgid_map(void) return 0; tgid_map_max = init_pid_ns.pid_max; - map = kvcalloc(tgid_map_max + 1, sizeof(*tgid_map), - GFP_KERNEL); + map = kvzalloc_objs(*tgid_map, tgid_map_max + 1, GFP_KERNEL); if (!map) return -ENOMEM; diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index be53fe6fee6a..43ed16b3b160 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c @@ -248,7 +248,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt) goto out; /* Add a dynamic probe */ - dyn_ops = kzalloc(sizeof(*dyn_ops), GFP_KERNEL); + dyn_ops = kzalloc_obj(*dyn_ops, GFP_KERNEL); if (!dyn_ops) { printk("MEMORY ERROR "); goto out; diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index b3b5586f104d..3fec69e8a6d4 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c @@ -77,7 +77,7 @@ static int insert_stat(struct rb_root *root, void *stat, cmp_func_t cmp) struct rb_node **new = &(root->rb_node), *parent = NULL; struct stat_node *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; data->stat = stat; @@ -322,7 +322,7 @@ int register_stat_tracer(struct tracer_stat *trace) } /* Init the session */ - session = kzalloc(sizeof(*session), GFP_KERNEL); + session = kzalloc_obj(*session, GFP_KERNEL); if (!session) return -ENOMEM; diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index e96d0063cbcf..2f495e46034f 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c @@ -617,7 +617,7 @@ static int syscall_fault_buffer_enable(void) return 0; } - sbuf = kmalloc(sizeof(*sbuf), GFP_KERNEL); + sbuf = kmalloc_obj(*sbuf, GFP_KERNEL); if (!sbuf) return -ENOMEM; @@ -1337,9 +1337,8 @@ void __init init_ftrace_syscalls(void) void *ret; if (!IS_ENABLED(CONFIG_HAVE_SPARSE_SYSCALL_NR)) { - syscalls_metadata = kcalloc(NR_syscalls, - sizeof(*syscalls_metadata), - GFP_KERNEL); + syscalls_metadata = kzalloc_objs(*syscalls_metadata, + NR_syscalls, GFP_KERNEL); if (!syscalls_metadata) { WARN_ON(1); return; diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 1b4f32e2b9bd..83c17b90daad 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -338,7 +338,7 @@ alloc_trace_uprobe(const char *group, const char *event, int nargs, bool is_ret) struct trace_uprobe *tu; int ret; - tu = kzalloc(struct_size(tu, tp.args, nargs), GFP_KERNEL); + tu = kzalloc_flex(*tu, tp.args, nargs, GFP_KERNEL); if (!tu) return ERR_PTR(-ENOMEM); @@ -699,7 +699,7 @@ static int __trace_uprobe_create(int argc, const char **argv) memset(&path, 0, sizeof(path)); tu->filename = no_free_ptr(filename); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->flags = (is_return ? TPARG_FL_RETURN : 0) | TPARG_FL_USER; diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index 7f8da4dab69d..ef28c6c52295 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -324,7 +324,7 @@ static struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, struct tracing_map_array *a; unsigned int i; - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) return NULL; @@ -405,7 +405,7 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map) struct tracing_map_elt *elt; int err = 0; - elt = kzalloc(sizeof(*elt), GFP_KERNEL); + elt = kzalloc_obj(*elt, GFP_KERNEL); if (!elt) return ERR_PTR(-ENOMEM); @@ -417,19 +417,19 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map) goto free; } - elt->fields = kcalloc(map->n_fields, sizeof(*elt->fields), GFP_KERNEL); + elt->fields = kzalloc_objs(*elt->fields, map->n_fields, GFP_KERNEL); if (!elt->fields) { err = -ENOMEM; goto free; } - elt->vars = kcalloc(map->n_vars, sizeof(*elt->vars), GFP_KERNEL); + elt->vars = kzalloc_objs(*elt->vars, map->n_vars, GFP_KERNEL); if (!elt->vars) { err = -ENOMEM; goto free; } - elt->var_set = kcalloc(map->n_vars, sizeof(*elt->var_set), GFP_KERNEL); + elt->var_set = kzalloc_objs(*elt->var_set, map->n_vars, GFP_KERNEL); if (!elt->var_set) { err = -ENOMEM; goto free; @@ -777,7 +777,7 @@ struct tracing_map *tracing_map_create(unsigned int map_bits, map_bits > TRACING_MAP_BITS_MAX) return ERR_PTR(-EINVAL); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return ERR_PTR(-ENOMEM); @@ -949,7 +949,7 @@ create_sort_entry(void *key, struct tracing_map_elt *elt) { struct tracing_map_sort_entry *sort_entry; - sort_entry = kzalloc(sizeof(*sort_entry), GFP_KERNEL); + sort_entry = kzalloc_obj(*sort_entry, GFP_KERNEL); if (!sort_entry) return NULL; diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index fd2ee879815c..8287a4ff3f18 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -103,8 +103,7 @@ static void tp_stub_func(void) static inline void *allocate_probes(int count) { - struct tp_probes *p = kmalloc(struct_size(p, probes, count), - GFP_KERNEL); + struct tp_probes *p = kmalloc_flex(*p, probes, count, GFP_KERNEL); return p == NULL ? NULL : p->probes; } @@ -615,7 +614,7 @@ static int tracepoint_module_coming(struct module *mod) if (trace_module_has_bad_taint(mod)) return 0; - tp_mod = kmalloc(sizeof(struct tp_module), GFP_KERNEL); + tp_mod = kmalloc_obj(struct tp_module, GFP_KERNEL); if (!tp_mod) return -ENOMEM; tp_mod->mod = mod; diff --git a/kernel/ucount.c b/kernel/ucount.c index fc4a8f2d3096..d1f723805c6d 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -163,7 +163,7 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid) if (ucounts) return ucounts; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; diff --git a/kernel/umh.c b/kernel/umh.c index b4da45a3a7cf..cffda97d961c 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -359,7 +359,7 @@ struct subprocess_info *call_usermodehelper_setup(const char *path, char **argv, void *data) { struct subprocess_info *sub_info; - sub_info = kzalloc(sizeof(struct subprocess_info), gfp_mask); + sub_info = kzalloc_obj(struct subprocess_info, gfp_mask); if (!sub_info) goto out; diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c index a88fb481c4a3..23a7d7ea93d4 100644 --- a/kernel/unwind/deferred.c +++ b/kernel/unwind/deferred.c @@ -120,8 +120,8 @@ int unwind_user_faultable(struct unwind_stacktrace *trace) return -EINVAL; if (!info->cache) { - info->cache = kzalloc(struct_size(cache, entries, UNWIND_MAX_ENTRIES), - GFP_KERNEL); + info->cache = kzalloc_flex(*cache, entries, UNWIND_MAX_ENTRIES, + GFP_KERNEL); if (!info->cache) return -ENOMEM; } diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 03cb63883d04..bb42a4c35dd3 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -794,9 +794,8 @@ static int insert_extent(struct uid_gid_map *map, struct uid_gid_extent *extent) struct uid_gid_extent *forward; /* Allocate memory for 340 mappings. */ - forward = kmalloc_array(UID_GID_MAP_MAX_EXTENTS, - sizeof(struct uid_gid_extent), - GFP_KERNEL); + forward = kmalloc_objs(struct uid_gid_extent, + UID_GID_MAP_MAX_EXTENTS, GFP_KERNEL); if (!forward) return -ENOMEM; diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c index 27107dcc1cbf..bf84af48dce8 100644 --- a/kernel/vhost_task.c +++ b/kernel/vhost_task.c @@ -132,7 +132,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), struct vhost_task *vtsk; struct task_struct *tsk; - vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL); + vtsk = kzalloc_obj(*vtsk, GFP_KERNEL); if (!vtsk) return ERR_PTR(-ENOMEM); init_completion(&vtsk->exited); diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index 52f89f1137da..d966b8c99052 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -278,7 +278,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) pipe->nr_accounted = nr_pages; ret = -ENOMEM; - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) goto error; @@ -358,7 +358,7 @@ long watch_queue_set_filter(struct pipe_inode_info *pipe, * user-specified filters. */ ret = -ENOMEM; - wfilter = kzalloc(struct_size(wfilter, filters, nr_filter), GFP_KERNEL); + wfilter = kzalloc_flex(*wfilter, filters, nr_filter, GFP_KERNEL); if (!wfilter) goto err_filter; wfilter->nr_filters = nr_filter; @@ -692,7 +692,7 @@ int watch_queue_init(struct pipe_inode_info *pipe) { struct watch_queue *wqueue; - wqueue = kzalloc(sizeof(*wqueue), GFP_KERNEL); + wqueue = kzalloc_obj(*wqueue, GFP_KERNEL); if (!wqueue) return -ENOMEM; diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c515cff01828..ee3e81133f78 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4714,7 +4714,7 @@ struct workqueue_attrs *alloc_workqueue_attrs_noprof(void) { struct workqueue_attrs *attrs; - attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); + attrs = kzalloc_obj(*attrs, GFP_KERNEL); if (!attrs) goto fail; if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL)) @@ -5370,7 +5370,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, attrs->affn_scope >= WQ_AFFN_NR_TYPES)) return ERR_PTR(-EINVAL); - ctx = kzalloc(struct_size(ctx, pwq_tbl, nr_cpu_ids), GFP_KERNEL); + ctx = kzalloc_flex(*ctx, pwq_tbl, nr_cpu_ids, GFP_KERNEL); new_attrs = alloc_workqueue_attrs(); if (!ctx || !new_attrs) @@ -7486,7 +7486,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq) if (WARN_ON(wq->flags & __WQ_ORDERED)) return -EINVAL; - wq->wq_dev = wq_dev = kzalloc(sizeof(*wq_dev), GFP_KERNEL); + wq->wq_dev = wq_dev = kzalloc_obj(*wq_dev, GFP_KERNEL); if (!wq_dev) return -ENOMEM; @@ -7879,9 +7879,9 @@ void __init workqueue_init_early(void) wq_power_efficient = true; /* initialize WQ_AFFN_SYSTEM pods */ - pt->pod_cpus = kcalloc(1, sizeof(pt->pod_cpus[0]), GFP_KERNEL); - pt->pod_node = kcalloc(1, sizeof(pt->pod_node[0]), GFP_KERNEL); - pt->cpu_pod = kcalloc(nr_cpu_ids, sizeof(pt->cpu_pod[0]), GFP_KERNEL); + pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], 1, GFP_KERNEL); + pt->pod_node = kzalloc_objs(pt->pod_node[0], 1, GFP_KERNEL); + pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL); BUG_ON(!pt->pod_cpus || !pt->pod_node || !pt->cpu_pod); BUG_ON(!zalloc_cpumask_var_node(&pt->pod_cpus[0], GFP_KERNEL, NUMA_NO_NODE)); @@ -8063,7 +8063,7 @@ static void __init init_pod_type(struct wq_pod_type *pt, pt->nr_pods = 0; /* init @pt->cpu_pod[] according to @cpus_share_pod() */ - pt->cpu_pod = kcalloc(nr_cpu_ids, sizeof(pt->cpu_pod[0]), GFP_KERNEL); + pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL); BUG_ON(!pt->cpu_pod); for_each_possible_cpu(cur) { @@ -8080,8 +8080,8 @@ static void __init init_pod_type(struct wq_pod_type *pt, } /* init the rest to match @pt->cpu_pod[] */ - pt->pod_cpus = kcalloc(pt->nr_pods, sizeof(pt->pod_cpus[0]), GFP_KERNEL); - pt->pod_node = kcalloc(pt->nr_pods, sizeof(pt->pod_node[0]), GFP_KERNEL); + pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], pt->nr_pods, GFP_KERNEL); + pt->pod_node = kzalloc_objs(pt->pod_node[0], pt->nr_pods, GFP_KERNEL); BUG_ON(!pt->pod_cpus || !pt->pod_node); for (pod = 0; pod < pt->nr_pods; pod++) diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 00ae4673a271..58991ab09d84 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -669,8 +669,9 @@ static int __init alloc_mod_tags_mem(void) return -ENOMEM; } - vm_module_tags->pages = kmalloc_array(get_vm_area_size(vm_module_tags) >> PAGE_SHIFT, - sizeof(struct page *), GFP_KERNEL | __GFP_ZERO); + vm_module_tags->pages = kmalloc_objs(struct page *, + get_vm_area_size(vm_module_tags) >> PAGE_SHIFT, + GFP_KERNEL | __GFP_ZERO); if (!vm_module_tags->pages) { free_vm_area(vm_module_tags); return -ENOMEM; diff --git a/lib/assoc_array.c b/lib/assoc_array.c index 388e656ac974..6cd376ad5030 100644 --- a/lib/assoc_array.c +++ b/lib/assoc_array.c @@ -454,7 +454,7 @@ static bool assoc_array_insert_in_empty_tree(struct assoc_array_edit *edit) pr_devel("-->%s()\n", __func__); - new_n0 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); if (!new_n0) return false; @@ -536,11 +536,11 @@ static bool assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit, * those now. We may also need a new shortcut, but we deal with that * when we need it. */ - new_n0 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); if (!new_n0) return false; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); - new_n1 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n1 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); if (!new_n1) return false; edit->new_meta[1] = assoc_array_node_to_ptr(new_n1); @@ -741,7 +741,7 @@ all_leaves_cluster_together: keylen = round_up(diff, ASSOC_ARRAY_KEY_CHUNK_SIZE); keylen >>= ASSOC_ARRAY_KEY_CHUNK_SHIFT; - new_s0 = kzalloc(struct_size(new_s0, index_key, keylen), GFP_KERNEL); + new_s0 = kzalloc_flex(*new_s0, index_key, keylen, GFP_KERNEL); if (!new_s0) return false; edit->new_meta[2] = assoc_array_shortcut_to_ptr(new_s0); @@ -832,7 +832,7 @@ static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit, edit->excised_meta[0] = assoc_array_shortcut_to_ptr(shortcut); /* Create a new node now since we're going to need it anyway */ - new_n0 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); if (!new_n0) return false; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); @@ -848,8 +848,7 @@ static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit, keylen = round_up(diff, ASSOC_ARRAY_KEY_CHUNK_SIZE); keylen >>= ASSOC_ARRAY_KEY_CHUNK_SHIFT; - new_s0 = kzalloc(struct_size(new_s0, index_key, keylen), - GFP_KERNEL); + new_s0 = kzalloc_flex(*new_s0, index_key, keylen, GFP_KERNEL); if (!new_s0) return false; edit->new_meta[1] = assoc_array_shortcut_to_ptr(new_s0); @@ -898,8 +897,7 @@ static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit, keylen = round_up(shortcut->skip_to_level, ASSOC_ARRAY_KEY_CHUNK_SIZE); keylen >>= ASSOC_ARRAY_KEY_CHUNK_SHIFT; - new_s1 = kzalloc(struct_size(new_s1, index_key, keylen), - GFP_KERNEL); + new_s1 = kzalloc_flex(*new_s1, index_key, keylen, GFP_KERNEL); if (!new_s1) return false; edit->new_meta[2] = assoc_array_shortcut_to_ptr(new_s1); @@ -977,7 +975,7 @@ struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, */ BUG_ON(assoc_array_ptr_is_meta(object)); - edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1089,7 +1087,7 @@ struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, pr_devel("-->%s()\n", __func__); - edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1206,7 +1204,8 @@ found_leaf: node = parent; /* Create a new node to collapse into */ - new_n0 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node, + GFP_KERNEL); if (!new_n0) goto enomem; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); @@ -1281,7 +1280,7 @@ struct assoc_array_edit *assoc_array_clear(struct assoc_array *array, if (!array->root) return NULL; - edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1469,7 +1468,7 @@ int assoc_array_gc(struct assoc_array *array, if (!array->root) return 0; - edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); if (!edit) return -ENOMEM; edit->array = array; @@ -1490,8 +1489,7 @@ descend: shortcut = assoc_array_ptr_to_shortcut(cursor); keylen = round_up(shortcut->skip_to_level, ASSOC_ARRAY_KEY_CHUNK_SIZE); keylen >>= ASSOC_ARRAY_KEY_CHUNK_SHIFT; - new_s = kmalloc(struct_size(new_s, index_key, keylen), - GFP_KERNEL); + new_s = kmalloc_flex(*new_s, index_key, keylen, GFP_KERNEL); if (!new_s) goto enomem; pr_devel("dup shortcut %p -> %p\n", shortcut, new_s); @@ -1505,7 +1503,7 @@ descend: /* Duplicate the node at this position */ node = assoc_array_ptr_to_node(cursor); - new_n = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); + new_n = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); if (!new_n) goto enomem; pr_devel("dup node %p -> %p\n", node, new_n); diff --git a/lib/bch.c b/lib/bch.c index 1c0cb07cdfeb..82a363dc73c4 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -1320,7 +1320,7 @@ struct bch_control *bch_init(int m, int t, unsigned int prim_poly, if (prim_poly == 0) prim_poly = prim_poly_tab[m-min_m]; - bch = kzalloc(sizeof(*bch), GFP_KERNEL); + bch = kzalloc_obj(*bch, GFP_KERNEL); if (bch == NULL) goto fail; diff --git a/lib/bucket_locks.c b/lib/bucket_locks.c index 64b92e1dbace..d29516ca0554 100644 --- a/lib/bucket_locks.c +++ b/lib/bucket_locks.c @@ -31,7 +31,7 @@ int __alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *locks_mask, } if (sizeof(spinlock_t) != 0) { - tlocks = kvmalloc_array(size, sizeof(spinlock_t), gfp); + tlocks = kvmalloc_objs(spinlock_t, size, gfp); if (!tlocks) return -ENOMEM; for (i = 0; i < size; i++) { diff --git a/lib/codetag.c b/lib/codetag.c index 545911cebd25..465952125bcb 100644 --- a/lib/codetag.c +++ b/lib/codetag.c @@ -193,7 +193,7 @@ static int codetag_module_init(struct codetag_type *cttype, struct module *mod) BUG_ON(range.start > range.stop); - cmod = kmalloc(sizeof(*cmod), GFP_KERNEL); + cmod = kmalloc_obj(*cmod, GFP_KERNEL); if (unlikely(!cmod)) return -ENOMEM; @@ -383,7 +383,7 @@ codetag_register_type(const struct codetag_type_desc *desc) BUG_ON(desc->tag_size <= 0); - cttype = kzalloc(sizeof(*cttype), GFP_KERNEL); + cttype = kzalloc_obj(*cttype, GFP_KERNEL); if (unlikely(!cttype)) return ERR_PTR(-ENOMEM); diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c index f03d9be3f06b..dfc6219532b9 100644 --- a/lib/cpu_rmap.c +++ b/lib/cpu_rmap.c @@ -309,7 +309,7 @@ EXPORT_SYMBOL(irq_cpu_rmap_remove); */ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq) { - struct irq_glue *glue = kzalloc(sizeof(*glue), GFP_KERNEL); + struct irq_glue *glue = kzalloc_obj(*glue, GFP_KERNEL); int rc; if (!glue) diff --git a/lib/crypto/gf128mul.c b/lib/crypto/gf128mul.c index 2a34590fe3f1..42c5fdc2d4ca 100644 --- a/lib/crypto/gf128mul.c +++ b/lib/crypto/gf128mul.c @@ -245,12 +245,12 @@ struct gf128mul_64k *gf128mul_init_64k_bbe(const be128 *g) struct gf128mul_64k *t; int i, j, k; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) goto out; for (i = 0; i < 16; i++) { - t->t[i] = kzalloc(sizeof(*t->t[i]), GFP_KERNEL); + t->t[i] = kzalloc_obj(*t->t[i], GFP_KERNEL); if (!t->t[i]) { gf128mul_free_64k(t); t = NULL; @@ -326,7 +326,7 @@ struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g) struct gf128mul_4k *t; int j, k; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) goto out; diff --git a/lib/crypto/mpi/mpih-mul.c b/lib/crypto/mpi/mpih-mul.c index a93647564054..9cd0843e9d36 100644 --- a/lib/crypto/mpi/mpih-mul.c +++ b/lib/crypto/mpi/mpih-mul.c @@ -372,7 +372,7 @@ mpihelp_mul_karatsuba_case(mpi_ptr_t prodp, return -ENOMEM; } else { if (!ctx->next) { - ctx->next = kzalloc(sizeof *ctx, GFP_KERNEL); + ctx->next = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx->next) return -ENOMEM; } diff --git a/lib/crypto/mpi/mpiutil.c b/lib/crypto/mpi/mpiutil.c index 7f2db830f404..4999f756f50e 100644 --- a/lib/crypto/mpi/mpiutil.c +++ b/lib/crypto/mpi/mpiutil.c @@ -33,7 +33,7 @@ MPI mpi_alloc(unsigned nlimbs) { MPI a; - a = kmalloc(sizeof *a, GFP_KERNEL); + a = kmalloc_obj(*a, GFP_KERNEL); if (!a) return a; @@ -93,14 +93,14 @@ int mpi_resize(MPI a, unsigned nlimbs) return 0; /* no need to do it */ if (a->d) { - p = kcalloc(nlimbs, sizeof(mpi_limb_t), GFP_KERNEL); + p = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL); if (!p) return -ENOMEM; memcpy(p, a->d, a->alloced * sizeof(mpi_limb_t)); kfree_sensitive(a->d); a->d = p; } else { - a->d = kcalloc(nlimbs, sizeof(mpi_limb_t), GFP_KERNEL); + a->d = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL); if (!a->d) return -ENOMEM; } diff --git a/lib/dhry_1.c b/lib/dhry_1.c index ca6c87232c58..134cc1c746c2 100644 --- a/lib/dhry_1.c +++ b/lib/dhry_1.c @@ -139,11 +139,11 @@ int dhry(int n) /* Initializations */ - Next_Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC); + Next_Ptr_Glob = (Rec_Pointer) kzalloc_obj(Rec_Type, GFP_ATOMIC); if (!Next_Ptr_Glob) return -ENOMEM; - Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC); + Ptr_Glob = (Rec_Pointer) kzalloc_obj(Rec_Type, GFP_ATOMIC); if (!Ptr_Glob) { kfree(Next_Ptr_Glob); return -ENOMEM; diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c index d6aa09a979b3..d66940b0c165 100644 --- a/lib/dim/net_dim.c +++ b/lib/dim/net_dim.c @@ -105,7 +105,7 @@ int net_dim_init_irq_moder(struct net_device *dev, u8 profile_flags, struct dim_irq_moder *moder; int len; - dev->irq_moder = kzalloc(sizeof(*dev->irq_moder), GFP_KERNEL); + dev->irq_moder = kzalloc_obj(*dev->irq_moder, GFP_KERNEL); if (!dev->irq_moder) return -ENOMEM; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 7d7892e57a01..a5b5e936e2ab 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1241,7 +1241,7 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) return 0; } - dt = kzalloc(sizeof(*dt), GFP_KERNEL); + dt = kzalloc_obj(*dt, GFP_KERNEL); if (dt == NULL) { pr_err("error adding module: %s\n", modname); return -ENOMEM; diff --git a/lib/error-inject.c b/lib/error-inject.c index 887acd9a6ea6..06c913ec2c1f 100644 --- a/lib/error-inject.c +++ b/lib/error-inject.c @@ -80,7 +80,7 @@ static void populate_error_injection_list(struct error_injection_entry *start, continue; } - ent = kmalloc(sizeof(*ent), GFP_KERNEL); + ent = kmalloc_obj(*ent, GFP_KERNEL); if (!ent) break; ent->start_addr = entry; diff --git a/lib/group_cpus.c b/lib/group_cpus.c index d496c5001961..5d1758a05407 100644 --- a/lib/group_cpus.c +++ b/lib/group_cpus.c @@ -47,7 +47,7 @@ static cpumask_var_t *alloc_node_to_cpumask(void) cpumask_var_t *masks; int node; - masks = kcalloc(nr_node_ids, sizeof(cpumask_var_t), GFP_KERNEL); + masks = kzalloc_objs(cpumask_var_t, nr_node_ids, GFP_KERNEL); if (!masks) return NULL; @@ -320,10 +320,10 @@ static int alloc_cluster_groups(unsigned int ncpus, goto no_cluster; /* Allocate memory based on cluster number. */ - clusters = kcalloc(ncluster, sizeof(*clusters), GFP_KERNEL); + clusters = kzalloc_objs(*clusters, ncluster, GFP_KERNEL); if (!clusters) goto no_cluster; - cluster_groups = kcalloc(ncluster, sizeof(struct node_groups), GFP_KERNEL); + cluster_groups = kzalloc_objs(struct node_groups, ncluster, GFP_KERNEL); if (!cluster_groups) goto fail_cluster_groups; @@ -432,9 +432,7 @@ static int __group_cpus_evenly(unsigned int startgrp, unsigned int numgrps, return numgrps; } - node_groups = kcalloc(nr_node_ids, - sizeof(struct node_groups), - GFP_KERNEL); + node_groups = kzalloc_objs(struct node_groups, nr_node_ids, GFP_KERNEL); if (!node_groups) return -ENOMEM; @@ -508,7 +506,7 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps, unsigned int *nummasks) if (!node_to_cpumask) goto fail_npresmsk; - masks = kcalloc(numgrps, sizeof(*masks), GFP_KERNEL); + masks = kzalloc_objs(*masks, numgrps, GFP_KERNEL); if (!masks) goto fail_node_to_cpumask; @@ -574,7 +572,7 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps, unsigned int *nummasks) if (numgrps == 0) return NULL; - masks = kcalloc(numgrps, sizeof(*masks), GFP_KERNEL); + masks = kzalloc_objs(*masks, numgrps, GFP_KERNEL); if (!masks) return NULL; diff --git a/lib/idr.c b/lib/idr.c index 457430cff8c5..69bee5369670 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -417,7 +417,7 @@ next: } bitmap = alloc; if (!bitmap) - bitmap = kzalloc(sizeof(*bitmap), GFP_NOWAIT); + bitmap = kzalloc_obj(*bitmap, GFP_NOWAIT); if (!bitmap) goto alloc; bitmap->bitmap[0] = tmp; @@ -444,7 +444,7 @@ next: } else { bitmap = alloc; if (!bitmap) - bitmap = kzalloc(sizeof(*bitmap), GFP_NOWAIT); + bitmap = kzalloc_obj(*bitmap, GFP_NOWAIT); if (!bitmap) goto alloc; __set_bit(bit, bitmap->bitmap); @@ -465,7 +465,7 @@ out: return xas.xa_index * IDA_BITMAP_BITS + bit; alloc: xas_unlock_irqrestore(&xas, flags); - alloc = kzalloc(sizeof(*bitmap), gfp); + alloc = kzalloc_obj(*bitmap, gfp); if (!alloc) return -ENOMEM; xas_set(&xas, min / IDA_BITMAP_BITS); diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c index 5fd62656f42e..d1ab3d40a645 100644 --- a/lib/interval_tree_test.c +++ b/lib/interval_tree_test.c @@ -311,8 +311,7 @@ static inline int span_iteration_check(void) {return 0; } static int interval_tree_test_init(void) { - nodes = kmalloc_array(nnodes, sizeof(struct interval_tree_node), - GFP_KERNEL); + nodes = kmalloc_objs(struct interval_tree_node, nnodes, GFP_KERNEL); if (!nodes) return -ENOMEM; diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 545250507f08..a9768fae1f44 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -903,7 +903,7 @@ static int want_pages_array(struct page ***res, size_t size, count = maxpages; WARN_ON(!count); // caller should've prevented that if (!*res) { - *res = kvmalloc_array(count, sizeof(struct page *), GFP_KERNEL); + *res = kvmalloc_objs(struct page *, count, GFP_KERNEL); if (!*res) return 0; } @@ -1318,7 +1318,7 @@ struct iovec *iovec_from_user(const struct iovec __user *uvec, if (nr_segs > UIO_MAXIOV) return ERR_PTR(-EINVAL); if (nr_segs > fast_segs) { - iov = kmalloc_array(nr_segs, sizeof(struct iovec), GFP_KERNEL); + iov = kmalloc_objs(struct iovec, nr_segs, GFP_KERNEL); if (!iov) return ERR_PTR(-ENOMEM); } diff --git a/lib/kobject.c b/lib/kobject.c index abe5f5b856ce..b178d248617b 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -765,7 +765,7 @@ static struct kobject *kobject_create(void) { struct kobject *kobj; - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + kobj = kzalloc_obj(*kobj, GFP_KERNEL); if (!kobj) return NULL; @@ -962,7 +962,7 @@ static struct kset *kset_create(const char *name, struct kset *kset; int retval; - kset = kzalloc(sizeof(*kset), GFP_KERNEL); + kset = kzalloc_obj(*kset, GFP_KERNEL); if (!kset) return NULL; retval = kobject_set_name(&kset->kobj, "%s", name); diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 78e16b95d210..29a28a3b957f 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -124,7 +124,7 @@ static int kobject_action_args(const char *buf, size_t count, if (!count) return -EINVAL; - env = kzalloc(sizeof(*env), GFP_KERNEL); + env = kzalloc_obj(*env, GFP_KERNEL); if (!env) return -ENOMEM; @@ -537,7 +537,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, } /* environment buffer */ - env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); if (!env) return -ENOMEM; @@ -776,7 +776,7 @@ static int uevent_net_init(struct net *net) .flags = NL_CFG_F_NONROOT_RECV }; - ue_sk = kzalloc(sizeof(*ue_sk), GFP_KERNEL); + ue_sk = kzalloc_obj(*ue_sk, GFP_KERNEL); if (!ue_sk) return -ENOMEM; diff --git a/lib/kunit/attributes.c b/lib/kunit/attributes.c index 2cf04cc09372..6b7803a16e22 100644 --- a/lib/kunit/attributes.c +++ b/lib/kunit/attributes.c @@ -410,7 +410,7 @@ struct kunit_suite *kunit_filter_attr_tests(const struct kunit_suite *const suit kunit_suite_for_each_test_case(suite, test_case) { n++; } - filtered = kcalloc(n + 1, sizeof(*filtered), GFP_KERNEL); + filtered = kzalloc_objs(*filtered, n + 1, GFP_KERNEL); if (!filtered) { kfree(copy); return ERR_PTR(-ENOMEM); diff --git a/lib/kunit/device.c b/lib/kunit/device.c index f201aaacd4cf..7c18d4ae2de3 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -111,7 +111,7 @@ static struct kunit_device *kunit_device_register_internal(struct kunit *test, struct kunit_device *kunit_dev; int err = -ENOMEM; - kunit_dev = kzalloc(sizeof(*kunit_dev), GFP_KERNEL); + kunit_dev = kzalloc_obj(*kunit_dev, GFP_KERNEL); if (!kunit_dev) return ERR_PTR(err); diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 02ff380ab793..27740d975082 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -131,7 +131,7 @@ kunit_filter_glob_tests(const struct kunit_suite *const suite, const char *test_ if (!copy) return ERR_PTR(-ENOMEM); - filtered = kcalloc(n + 1, sizeof(*filtered), GFP_KERNEL); + filtered = kzalloc_objs(*filtered, n + 1, GFP_KERNEL); if (!filtered) { kfree(copy); return ERR_PTR(-ENOMEM); @@ -179,7 +179,7 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set, const size_t max = suite_set->end - suite_set->start; - copy = kcalloc(max, sizeof(*copy), GFP_KERNEL); + copy = kzalloc_objs(*copy, max, GFP_KERNEL); if (!copy) { /* won't be able to run anything, return an empty set */ return filtered; } @@ -194,7 +194,8 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set, /* Parse attribute filters */ if (filters) { filter_count = kunit_get_filter_count(filters); - parsed_filters = kcalloc(filter_count, sizeof(*parsed_filters), GFP_KERNEL); + parsed_filters = kzalloc_objs(*parsed_filters, filter_count, + GFP_KERNEL); if (!parsed_filters) { *err = -ENOMEM; goto free_parsed_glob; diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c index f0090c2729cd..f28093153516 100644 --- a/lib/kunit/executor_test.c +++ b/lib/kunit/executor_test.c @@ -272,7 +272,7 @@ static void free_suite_set_at_end(struct kunit *test, const void *to_free) if (!((struct kunit_suite_set *)to_free)->start) return; - free = kzalloc(sizeof(struct kunit_suite_set), GFP_KERNEL); + free = kzalloc_obj(struct kunit_suite_set, GFP_KERNEL); *free = *(struct kunit_suite_set *)to_free; kunit_add_action(test, free_suite_set, (void *)free); diff --git a/lib/kunit/kunit-example-test.c b/lib/kunit/kunit-example-test.c index 9452b163956f..34ba0bd74504 100644 --- a/lib/kunit/kunit-example-test.c +++ b/lib/kunit/kunit-example-test.c @@ -283,7 +283,7 @@ static void example_slow_test(struct kunit *test) */ static int example_resource_init(struct kunit_resource *res, void *context) { - int *info = kmalloc(sizeof(*info), GFP_KERNEL); + int *info = kmalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index 63130a48e237..393b90bd2ec2 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-test.c @@ -538,8 +538,7 @@ static void kunit_resource_test_action_ordering(struct kunit *test) static int kunit_resource_test_init(struct kunit *test) { - struct kunit_test_resource_context *ctx = - kzalloc(sizeof(*ctx), GFP_KERNEL); + struct kunit_test_resource_context *ctx = kzalloc_obj(*ctx, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); diff --git a/lib/kunit/resource.c b/lib/kunit/resource.c index f0209252b179..08a16622a2c9 100644 --- a/lib/kunit/resource.c +++ b/lib/kunit/resource.c @@ -98,7 +98,7 @@ int kunit_add_action(struct kunit *test, void (*action)(void *), void *ctx) KUNIT_ASSERT_NOT_NULL_MSG(test, action, "Tried to action a NULL function!"); - action_ctx = kzalloc(sizeof(*action_ctx), GFP_KERNEL); + action_ctx = kzalloc_obj(*action_ctx, GFP_KERNEL); if (!action_ctx) return -ENOMEM; diff --git a/lib/kunit/static_stub.c b/lib/kunit/static_stub.c index 484fd85251b4..29a91129d7a3 100644 --- a/lib/kunit/static_stub.c +++ b/lib/kunit/static_stub.c @@ -111,7 +111,7 @@ void __kunit_activate_static_stub(struct kunit *test, /* We got an extra reference from find_resource(), so put it. */ kunit_put_resource(res); } else { - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ctx->real_fn_addr = real_fn_addr; ctx->replacement_addr = replacement_addr; diff --git a/lib/kunit/string-stream.c b/lib/kunit/string-stream.c index 54f4fdcbfac8..0d8f1b30559b 100644 --- a/lib/kunit/string-stream.c +++ b/lib/kunit/string-stream.c @@ -18,7 +18,7 @@ static struct string_stream_fragment *alloc_string_stream_fragment(int len, gfp_ { struct string_stream_fragment *frag; - frag = kzalloc(sizeof(*frag), gfp); + frag = kzalloc_obj(*frag, gfp); if (!frag) return ERR_PTR(-ENOMEM); @@ -158,7 +158,7 @@ struct string_stream *alloc_string_stream(gfp_t gfp) { struct string_stream *stream; - stream = kzalloc(sizeof(*stream), gfp); + stream = kzalloc_obj(*stream, gfp); if (!stream) return ERR_PTR(-ENOMEM); diff --git a/lib/logic_iomem.c b/lib/logic_iomem.c index b247d412ddef..d0ba023f79fb 100644 --- a/lib/logic_iomem.c +++ b/lib/logic_iomem.c @@ -48,7 +48,7 @@ int logic_iomem_add_region(struct resource *resource, if (WARN_ON((resource->flags & IORESOURCE_TYPE_BITS) != IORESOURCE_MEM)) return -EINVAL; - rreg = kzalloc(sizeof(*rreg), GFP_KERNEL); + rreg = kzalloc_obj(*rreg, GFP_KERNEL); if (!rreg) return -ENOMEM; diff --git a/lib/lru_cache.c b/lib/lru_cache.c index 9e0d469c7658..b1ee3b2540c9 100644 --- a/lib/lru_cache.c +++ b/lib/lru_cache.c @@ -94,14 +94,14 @@ struct lru_cache *lc_create(const char *name, struct kmem_cache *cache, if (e_count > LC_MAX_ACTIVE) return NULL; - slot = kcalloc(e_count, sizeof(struct hlist_head), GFP_KERNEL); + slot = kzalloc_objs(struct hlist_head, e_count, GFP_KERNEL); if (!slot) goto out_fail; - element = kcalloc(e_count, sizeof(struct lc_element *), GFP_KERNEL); + element = kzalloc_objs(struct lc_element *, e_count, GFP_KERNEL); if (!element) goto out_fail; - lc = kzalloc(sizeof(*lc), GFP_KERNEL); + lc = kzalloc_obj(*lc, GFP_KERNEL); if (!lc) goto out_fail; diff --git a/lib/lwq.c b/lib/lwq.c index 57d080a4d53d..3a8fc05d9420 100644 --- a/lib/lwq.c +++ b/lib/lwq.c @@ -110,7 +110,7 @@ static int lwq_test(void) for (i = 0; i < ARRAY_SIZE(threads); i++) threads[i] = kthread_run(lwq_exercise, &q, "lwq-test-%d", i); for (i = 0; i < 100; i++) { - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) break; t->i = i; diff --git a/lib/objagg.c b/lib/objagg.c index 363e43e849ac..c508b78850c0 100644 --- a/lib/objagg.c +++ b/lib/objagg.c @@ -525,7 +525,7 @@ struct objagg *objagg_create(const struct objagg_ops *ops, !ops->delta_destroy)) return ERR_PTR(-EINVAL); - objagg = kzalloc(sizeof(*objagg), GFP_KERNEL); + objagg = kzalloc_obj(*objagg, GFP_KERNEL); if (!objagg) return ERR_PTR(-ENOMEM); objagg->ops = ops; @@ -610,8 +610,8 @@ const struct objagg_stats *objagg_stats_get(struct objagg *objagg) struct objagg_obj *objagg_obj; int i; - objagg_stats = kzalloc(struct_size(objagg_stats, stats_info, - objagg->obj_count), GFP_KERNEL); + objagg_stats = kzalloc_flex(*objagg_stats, stats_info, + objagg->obj_count, GFP_KERNEL); if (!objagg_stats) return ERR_PTR(-ENOMEM); @@ -786,11 +786,11 @@ static struct objagg_tmp_graph *objagg_tmp_graph_create(struct objagg *objagg) struct objagg_obj *objagg_obj; int i, j; - graph = kzalloc(sizeof(*graph), GFP_KERNEL); + graph = kzalloc_obj(*graph, GFP_KERNEL); if (!graph) return NULL; - graph->nodes = kcalloc(nodes_count, sizeof(*graph->nodes), GFP_KERNEL); + graph->nodes = kzalloc_objs(*graph->nodes, nodes_count, GFP_KERNEL); if (!graph->nodes) goto err_nodes_alloc; graph->nodes_count = nodes_count; @@ -930,7 +930,7 @@ struct objagg_hints *objagg_hints_get(struct objagg *objagg, struct objagg_hints *objagg_hints; int err; - objagg_hints = kzalloc(sizeof(*objagg_hints), GFP_KERNEL); + objagg_hints = kzalloc_obj(*objagg_hints, GFP_KERNEL); if (!objagg_hints) return ERR_PTR(-ENOMEM); @@ -1010,9 +1010,8 @@ objagg_hints_stats_get(struct objagg_hints *objagg_hints) struct objagg_hints_node *hnode; int i; - objagg_stats = kzalloc(struct_size(objagg_stats, stats_info, - objagg_hints->node_count), - GFP_KERNEL); + objagg_stats = kzalloc_flex(*objagg_stats, stats_info, + objagg_hints->node_count, GFP_KERNEL); if (!objagg_stats) return ERR_PTR(-ENOMEM); diff --git a/lib/once.c b/lib/once.c index 8557eb489f34..d801bfa945e6 100644 --- a/lib/once.c +++ b/lib/once.c @@ -26,7 +26,7 @@ static void once_disable_jump(struct static_key_true *key, struct module *mod) { struct once_work *w; - w = kmalloc(sizeof(*w), GFP_ATOMIC); + w = kmalloc_obj(*w, GFP_ATOMIC); if (!w) return; diff --git a/lib/parman.c b/lib/parman.c index 3f8f8d422e62..e93b82b73522 100644 --- a/lib/parman.c +++ b/lib/parman.c @@ -268,7 +268,7 @@ struct parman *parman_create(const struct parman_ops *ops, void *priv) { struct parman *parman; - parman = kzalloc(sizeof(*parman), GFP_KERNEL); + parman = kzalloc_obj(*parman, GFP_KERNEL); if (!parman) return NULL; INIT_LIST_HEAD(&parman->prio_list); diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c index 668f6aa6a75d..97772e42b9b2 100644 --- a/lib/percpu-refcount.c +++ b/lib/percpu-refcount.c @@ -73,7 +73,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release, if (!ref->percpu_count_ptr) return -ENOMEM; - data = kzalloc(sizeof(*ref->data), gfp); + data = kzalloc_obj(*ref->data, gfp); if (!data) { free_percpu((void __percpu *)ref->percpu_count_ptr); ref->percpu_count_ptr = 0; diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c index b45ceb725780..c1222c11f6a8 100644 --- a/lib/pldmfw/pldmfw.c +++ b/lib/pldmfw/pldmfw.c @@ -287,7 +287,7 @@ pldm_parse_desc_tlvs(struct pldmfw_priv *data, struct pldmfw_record *record, u8 if (err) return err; - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc, GFP_KERNEL); if (!desc) return -ENOMEM; @@ -328,7 +328,7 @@ pldm_parse_one_record(struct pldmfw_priv *data, int i; /* Make a copy and insert it into the record list */ - record = kzalloc(sizeof(*record), GFP_KERNEL); + record = kzalloc_obj(*record, GFP_KERNEL); if (!record) return -ENOMEM; @@ -465,7 +465,7 @@ static int pldm_parse_components(struct pldmfw_priv *data) if (err) return err; - component = kzalloc(sizeof(*component), GFP_KERNEL); + component = kzalloc_obj(*component, GFP_KERNEL); if (!component) return -ENOMEM; @@ -848,7 +848,7 @@ int pldmfw_flash_image(struct pldmfw *context, const struct firmware *fw) struct pldmfw_priv *data; int err; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index 690cede46ac2..862318e99c9a 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -399,7 +399,7 @@ static int augmented_check(void) static int __init rbtree_test_init(void) { - nodes = kmalloc_array(nnodes, sizeof(*nodes), GFP_KERNEL); + nodes = kmalloc_objs(*nodes, nnodes, GFP_KERNEL); if (!nodes) return -ENOMEM; diff --git a/lib/reed_solomon/reed_solomon.c b/lib/reed_solomon/reed_solomon.c index a9e2dcb6f2a7..864484c01827 100644 --- a/lib/reed_solomon/reed_solomon.c +++ b/lib/reed_solomon/reed_solomon.c @@ -73,7 +73,7 @@ static struct rs_codec *codec_init(int symsize, int gfpoly, int (*gffunc)(int), int i, j, sr, root, iprim; struct rs_codec *rs; - rs = kzalloc(sizeof(*rs), gfp); + rs = kzalloc_obj(*rs, gfp); if (!rs) return NULL; diff --git a/lib/reed_solomon/test_rslib.c b/lib/reed_solomon/test_rslib.c index 75cb1adac884..3c17b04a0a0a 100644 --- a/lib/reed_solomon/test_rslib.c +++ b/lib/reed_solomon/test_rslib.c @@ -111,7 +111,7 @@ static struct wspace *alloc_ws(struct rs_codec *rs) struct wspace *ws; int nn = rs->nn; - ws = kzalloc(sizeof(*ws), GFP_KERNEL); + ws = kzalloc_obj(*ws, GFP_KERNEL); if (!ws) return NULL; @@ -124,7 +124,7 @@ static struct wspace *alloc_ws(struct rs_codec *rs) ws->s = ws->r + nn; ws->corr = ws->s + nroots; - ws->errlocs = kmalloc_array(nn + nroots, sizeof(int), GFP_KERNEL); + ws->errlocs = kmalloc_objs(int, nn + nroots, GFP_KERNEL); if (!ws->errlocs) goto err; diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c index 258fb0e7abdf..30c999d57b10 100644 --- a/lib/ref_tracker.c +++ b/lib/ref_tracker.c @@ -74,8 +74,7 @@ ref_tracker_get_stats(struct ref_tracker_dir *dir, unsigned int limit) struct ref_tracker_dir_stats *stats; struct ref_tracker *tracker; - stats = kmalloc(struct_size(stats, stacks, limit), - GFP_NOWAIT); + stats = kmalloc_flex(*stats, stacks, limit, GFP_NOWAIT); if (!stats) return ERR_PTR(-ENOMEM); stats->total = 0; @@ -268,7 +267,7 @@ int ref_tracker_alloc(struct ref_tracker_dir *dir, } if (gfp & __GFP_DIRECT_RECLAIM) gfp_mask |= __GFP_NOFAIL; - *trackerp = tracker = kzalloc(sizeof(*tracker), gfp_mask); + *trackerp = tracker = kzalloc_obj(*tracker, gfp_mask); if (unlikely(!tracker)) { pr_err_once("memory allocation failure, unreliable refcount tracker.\n"); refcount_inc(&dir->untracked); diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 21bc9c1f7c06..d773720d11bf 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -168,8 +168,7 @@ static struct scatterlist *sg_kmalloc(unsigned int nents, gfp_t gfp_mask) kmemleak_alloc(ptr, PAGE_SIZE, 1, gfp_mask); return ptr; } else - return kmalloc_array(nents, sizeof(struct scatterlist), - gfp_mask); + return kmalloc_objs(struct scatterlist, nents, gfp_mask); } static void sg_kfree(struct scatterlist *sg, unsigned int nents) @@ -632,8 +631,7 @@ struct scatterlist *sgl_alloc_order(unsigned long long length, return NULL; nalloc++; } - sgl = kmalloc_array(nalloc, sizeof(struct scatterlist), - gfp & ~GFP_DMA); + sgl = kmalloc_objs(struct scatterlist, nalloc, gfp & ~GFP_DMA); if (!sgl) return NULL; diff --git a/lib/sg_split.c b/lib/sg_split.c index 0f89aab5c671..24e8f5e48e63 100644 --- a/lib/sg_split.c +++ b/lib/sg_split.c @@ -152,7 +152,7 @@ int sg_split(struct scatterlist *in, const int in_mapped_nents, int i, ret; struct sg_splitter *splitters; - splitters = kcalloc(nb_splits, sizeof(*splitters), gfp_mask); + splitters = kzalloc_objs(*splitters, nb_splits, gfp_mask); if (!splitters) return -ENOMEM; @@ -163,9 +163,8 @@ int sg_split(struct scatterlist *in, const int in_mapped_nents, ret = -ENOMEM; for (i = 0; i < nb_splits; i++) { - splitters[i].out_sg = kmalloc_array(splitters[i].nents, - sizeof(struct scatterlist), - gfp_mask); + splitters[i].out_sg = kmalloc_objs(struct scatterlist, + splitters[i].nents, gfp_mask); if (!splitters[i].out_sg) goto err; } diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 166f50ad8391..b58f01c2ca7e 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -260,7 +260,7 @@ int stack_depot_init(void) entries = 1UL << STACK_BUCKET_NUMBER_ORDER_MAX; pr_info("allocating hash table of %lu entries via kvcalloc\n", entries); - stack_table = kvcalloc(entries, sizeof(struct list_head), GFP_KERNEL); + stack_table = kvzalloc_objs(struct list_head, entries, GFP_KERNEL); if (!stack_table) { pr_err("hash table allocation failed, disabling\n"); stack_depot_disabled = true; diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 8cb6f66c9c2b..72a15e7132b9 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -147,7 +147,7 @@ int parse_int_array(const char *buf, size_t count, int **array) if (!nints) return -ENOENT; - ints = kcalloc(nints + 1, sizeof(*ints), GFP_KERNEL); + ints = kzalloc_objs(*ints, nints + 1, GFP_KERNEL); if (!ints) return -ENOMEM; diff --git a/lib/test_bpf.c b/lib/test_bpf.c index af0041df2b72..e4cb339f322e 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -94,7 +94,7 @@ static int bpf_fill_maxinsns1(struct bpf_test *self) __u32 k = ~0; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -113,7 +113,7 @@ static int bpf_fill_maxinsns2(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -133,7 +133,7 @@ static int bpf_fill_maxinsns3(struct bpf_test *self) struct rnd_state rnd; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -159,7 +159,7 @@ static int bpf_fill_maxinsns4(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -178,7 +178,7 @@ static int bpf_fill_maxinsns5(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -201,7 +201,7 @@ static int bpf_fill_maxinsns6(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -223,7 +223,7 @@ static int bpf_fill_maxinsns7(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -249,7 +249,7 @@ static int bpf_fill_maxinsns8(struct bpf_test *self) struct sock_filter *insn; int i, jmp_off = len - 3; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -272,7 +272,7 @@ static int bpf_fill_maxinsns9(struct bpf_test *self) struct bpf_insn *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -298,7 +298,7 @@ static int bpf_fill_maxinsns10(struct bpf_test *self) struct bpf_insn *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -324,7 +324,7 @@ static int __bpf_fill_ja(struct bpf_test *self, unsigned int len, unsigned int rlen; int i, j; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -358,7 +358,7 @@ static int bpf_fill_maxinsns12(struct bpf_test *self) struct sock_filter *insn; int i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -381,7 +381,7 @@ static int bpf_fill_maxinsns13(struct bpf_test *self) struct sock_filter *insn; int i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -410,7 +410,7 @@ static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -434,7 +434,7 @@ static int __bpf_fill_stxdw(struct bpf_test *self, int size) struct bpf_insn *insn; int i; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -484,7 +484,7 @@ static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm, bool alu3 int len = S16_MAX + 5; int i; - insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL); + insns = kmalloc_objs(*insns, len, GFP_KERNEL); if (!insns) return -ENOMEM; @@ -626,7 +626,7 @@ static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op, int imm, k; int i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -759,7 +759,7 @@ static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op, int i = 0; u64 val; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -1244,7 +1244,7 @@ static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op, bool alu32) u32 imm; int rd; - insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL); + insns = kmalloc_objs(*insns, len, GFP_KERNEL); if (!insns) return -ENOMEM; @@ -1426,7 +1426,7 @@ static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32) int rd, rs; int i = 0; - insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL); + insns = kmalloc_objs(*insns, len, GFP_KERNEL); if (!insns) return -ENOMEM; @@ -1917,7 +1917,7 @@ static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op) u64 mem, upd, res; int rd, rs, i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -2163,7 +2163,7 @@ static int bpf_fill_ld_imm64_magn(struct bpf_test *self) int bit, adj, sign; int i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -2217,7 +2217,7 @@ static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self, u32 rand = 1; int i = 0; - insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); + insn = kmalloc_objs(*insn, len, GFP_KERNEL); if (!insn) return -ENOMEM; @@ -2724,7 +2724,7 @@ static int __bpf_fill_staggered_jumps(struct bpf_test *self, struct bpf_insn *insns; int off, ind; - insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL); + insns = kmalloc_objs(*insns, len, GFP_KERNEL); if (!insns) return -ENOMEM; @@ -15461,7 +15461,7 @@ static __init int prepare_tail_call_tests(struct bpf_array **pprogs) int which, err; /* Allocate the table of programs to be used for tail calls */ - progs = kzalloc(struct_size(progs, ptrs, ntests + 1), GFP_KERNEL); + progs = kzalloc_flex(*progs, ptrs, ntests + 1, GFP_KERNEL); if (!progs) goto out_nomem; diff --git a/lib/test_debug_virtual.c b/lib/test_debug_virtual.c index b7cc0aaee173..288d5510406c 100644 --- a/lib/test_debug_virtual.c +++ b/lib/test_debug_virtual.c @@ -29,7 +29,7 @@ static int __init test_debug_virtual_init(void) pr_info("PA: %pa for VA: 0x%lx\n", &pa, (unsigned long)va); - foo = kzalloc(sizeof(*foo), GFP_KERNEL); + foo = kzalloc_obj(*foo, GFP_KERNEL); if (!foo) return -ENOMEM; diff --git a/lib/test_firmware.c b/lib/test_firmware.c index be4f93124901..1a933a874148 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -1309,7 +1309,7 @@ static ssize_t upload_register_store(struct device *dev, goto free_name; } - tst = kzalloc(sizeof(*tst), GFP_KERNEL); + tst = kzalloc_obj(*tst, GFP_KERNEL); if (!tst) { ret = -ENOMEM; goto free_name; @@ -1526,7 +1526,7 @@ static int __init test_firmware_init(void) { int rc; - test_fw_config = kzalloc(sizeof(struct test_config), GFP_KERNEL); + test_fw_config = kzalloc_obj(struct test_config, GFP_KERNEL); if (!test_fw_config) return -ENOMEM; diff --git a/lib/test_hmm.c b/lib/test_hmm.c index 455a6862ae50..0f9eb1c16ef0 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -166,7 +166,7 @@ static int dmirror_fops_open(struct inode *inode, struct file *filp) int ret; /* Mirror this process address space */ - dmirror = kzalloc(sizeof(*dmirror), GFP_KERNEL); + dmirror = kzalloc_obj(*dmirror, GFP_KERNEL); if (dmirror == NULL) return -ENOMEM; @@ -504,7 +504,7 @@ static int dmirror_allocate_chunk(struct dmirror_device *mdevice, void *ptr; int ret = -ENOMEM; - devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); + devmem = kzalloc_obj(*devmem, GFP_KERNEL); if (!devmem) return ret; diff --git a/lib/test_kho.c b/lib/test_kho.c index a20fafaf9846..601f2323ef7e 100644 --- a/lib/test_kho.c +++ b/lib/test_kho.c @@ -211,7 +211,7 @@ static int kho_test_save(void) max_mem = PAGE_ALIGN(max_mem); max_nr = max_mem >> PAGE_SHIFT; - folios = kvmalloc_array(max_nr, sizeof(*state->folios), GFP_KERNEL); + folios = kvmalloc_objs(*state->folios, max_nr, GFP_KERNEL); if (!folios) return -ENOMEM; state->folios = folios; diff --git a/lib/test_memcat_p.c b/lib/test_memcat_p.c index 7e0797a6bebf..0f0a15fea6e2 100644 --- a/lib/test_memcat_p.c +++ b/lib/test_memcat_p.c @@ -24,20 +24,20 @@ static int __init test_memcat_p_init(void) struct test_struct **in0, **in1, **out, **p; int err = -ENOMEM, i, r, total = 0; - in0 = kcalloc(INPUT_MAX, sizeof(*in0), GFP_KERNEL); + in0 = kzalloc_objs(*in0, INPUT_MAX, GFP_KERNEL); if (!in0) return err; - in1 = kcalloc(INPUT_MAX, sizeof(*in1), GFP_KERNEL); + in1 = kzalloc_objs(*in1, INPUT_MAX, GFP_KERNEL); if (!in1) goto err_free_in0; for (i = 0, r = 1; i < INPUT_MAX - 1; i++) { - in0[i] = kmalloc(sizeof(**in0), GFP_KERNEL); + in0[i] = kmalloc_obj(**in0, GFP_KERNEL); if (!in0[i]) goto err_free_elements; - in1[i] = kmalloc(sizeof(**in1), GFP_KERNEL); + in1[i] = kmalloc_obj(**in1, GFP_KERNEL); if (!in1[i]) { kfree(in0[i]); goto err_free_elements; diff --git a/lib/test_objagg.c b/lib/test_objagg.c index ce5c4c36a084..a391f0b998c9 100644 --- a/lib/test_objagg.c +++ b/lib/test_objagg.c @@ -107,7 +107,7 @@ static void *delta_create(void *priv, void *parent_obj, void *obj) if (!delta_check(priv, parent_obj, obj)) return ERR_PTR(-EINVAL); - delta = kzalloc(sizeof(*delta), GFP_KERNEL); + delta = kzalloc_obj(*delta, GFP_KERNEL); if (!delta) return ERR_PTR(-ENOMEM); delta->key_id_diff = diff; @@ -130,7 +130,7 @@ static void *root_create(void *priv, void *obj, unsigned int id) struct tokey *key = obj; struct root *root; - root = kzalloc(sizeof(*root), GFP_KERNEL); + root = kzalloc_obj(*root, GFP_KERNEL); if (!root) return ERR_PTR(-ENOMEM); memcpy(&root->key, key, sizeof(root->key)); diff --git a/lib/test_parman.c b/lib/test_parman.c index f9b97426a337..ae5a0a2f63c3 100644 --- a/lib/test_parman.c +++ b/lib/test_parman.c @@ -219,7 +219,7 @@ static struct test_parman *test_parman_create(const struct parman_ops *ops) struct test_parman *test_parman; int err; - test_parman = kzalloc(sizeof(*test_parman), GFP_KERNEL); + test_parman = kzalloc_obj(*test_parman, GFP_KERNEL); if (!test_parman) return ERR_PTR(-ENOMEM); err = test_parman_resize(test_parman, TEST_PARMAN_BASE_COUNT); diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index c63db03ebb9d..12de6388cd9b 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c @@ -524,7 +524,7 @@ static int __init test_insert_dup(struct test_obj_rhl *rhl_test_objects, const char *key; int err = 0; - rhlt = kmalloc(sizeof(*rhlt), GFP_KERNEL); + rhlt = kmalloc_obj(*rhlt, GFP_KERNEL); if (WARN_ON(!rhlt)) return -EINVAL; diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index 270b6f7ca807..5ed369a92c75 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -396,7 +396,7 @@ vm_map_ram_test(void) int i; map_nr_pages = nr_pages > 0 ? nr_pages:1; - pages = kcalloc(map_nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, map_nr_pages, GFP_KERNEL); if (!pages) return -1; @@ -542,7 +542,7 @@ init_test_configuration(void) nr_threads = clamp(nr_threads, 1, (int) USHRT_MAX); /* Allocate the space for test instances. */ - tdriver = kvcalloc(nr_threads, sizeof(*tdriver), GFP_KERNEL); + tdriver = kvzalloc_objs(*tdriver, nr_threads, GFP_KERNEL); if (tdriver == NULL) return -1; diff --git a/lib/tests/kunit_iov_iter.c b/lib/tests/kunit_iov_iter.c index 48342736d016..500565631cbd 100644 --- a/lib/tests/kunit_iov_iter.c +++ b/lib/tests/kunit_iov_iter.c @@ -387,7 +387,7 @@ static void __init iov_kunit_load_folioq(struct kunit *test, for (i = 0; i < npages; i++) { if (folioq_full(p)) { - p->next = kzalloc(sizeof(struct folio_queue), GFP_KERNEL); + p->next = kzalloc_obj(struct folio_queue, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, p->next); folioq_init(p->next, 0); p->next->prev = p; @@ -403,7 +403,7 @@ static struct folio_queue *iov_kunit_create_folioq(struct kunit *test) { struct folio_queue *folioq; - folioq = kzalloc(sizeof(struct folio_queue), GFP_KERNEL); + folioq = kzalloc_obj(struct folio_queue, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, folioq); kunit_add_action_or_reset(test, iov_kunit_destroy_folioq, folioq); folioq_init(folioq, 0); @@ -565,7 +565,7 @@ static struct xarray *iov_kunit_create_xarray(struct kunit *test) { struct xarray *xarray; - xarray = kzalloc(sizeof(struct xarray), GFP_KERNEL); + xarray = kzalloc_obj(struct xarray, GFP_KERNEL); xa_init(xarray); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xarray); kunit_add_action_or_reset(test, iov_kunit_destroy_xarray, xarray); diff --git a/lib/tests/list-test.c b/lib/tests/list-test.c index 9135cdc1bb39..6d9227a2b204 100644 --- a/lib/tests/list-test.c +++ b/lib/tests/list-test.c @@ -26,10 +26,10 @@ static void list_test_list_init(struct kunit *test) INIT_LIST_HEAD(&list2); - list4 = kzalloc(sizeof(*list4), GFP_KERNEL | __GFP_NOFAIL); + list4 = kzalloc_obj(*list4, GFP_KERNEL | __GFP_NOFAIL); INIT_LIST_HEAD(list4); - list5 = kmalloc(sizeof(*list5), GFP_KERNEL | __GFP_NOFAIL); + list5 = kmalloc_obj(*list5, GFP_KERNEL | __GFP_NOFAIL); memset(list5, 0xFF, sizeof(*list5)); INIT_LIST_HEAD(list5); @@ -829,10 +829,10 @@ static void hlist_test_init(struct kunit *test) INIT_HLIST_HEAD(&list2); - list4 = kzalloc(sizeof(*list4), GFP_KERNEL | __GFP_NOFAIL); + list4 = kzalloc_obj(*list4, GFP_KERNEL | __GFP_NOFAIL); INIT_HLIST_HEAD(list4); - list5 = kmalloc(sizeof(*list5), GFP_KERNEL | __GFP_NOFAIL); + list5 = kmalloc_obj(*list5, GFP_KERNEL | __GFP_NOFAIL); memset(list5, 0xFF, sizeof(*list5)); INIT_HLIST_HEAD(list5); diff --git a/lib/tests/test_ratelimit.c b/lib/tests/test_ratelimit.c index bfaeca49304a..365f1fc1f256 100644 --- a/lib/tests/test_ratelimit.c +++ b/lib/tests/test_ratelimit.c @@ -104,7 +104,8 @@ static void test_ratelimit_stress(struct kunit *test) int i; const int n_stress_kthread = cpumask_weight(cpu_online_mask); struct stress_kthread skt = { 0 }; - struct stress_kthread *sktp = kcalloc(n_stress_kthread, sizeof(*sktp), GFP_KERNEL); + struct stress_kthread *sktp = kzalloc_objs(*sktp, n_stress_kthread, + GFP_KERNEL); KUNIT_EXPECT_NOT_NULL_MSG(test, sktp, "Memory allocation failure"); for (i = 0; i < n_stress_kthread; i++) { diff --git a/lib/xz/xz_dec_bcj.c b/lib/xz/xz_dec_bcj.c index 610d58d947ab..6e0fa5bef841 100644 --- a/lib/xz/xz_dec_bcj.c +++ b/lib/xz/xz_dec_bcj.c @@ -591,7 +591,7 @@ enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s, struct xz_dec_lzma2 *lzma2, struct xz_dec_bcj *xz_dec_bcj_create(bool single_call) { - struct xz_dec_bcj *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct xz_dec_bcj *s = kmalloc_obj(*s, GFP_KERNEL); if (s != NULL) s->single_call = single_call; diff --git a/lib/xz/xz_dec_lzma2.c b/lib/xz/xz_dec_lzma2.c index 83bb66b6016d..02fccb7795b5 100644 --- a/lib/xz/xz_dec_lzma2.c +++ b/lib/xz/xz_dec_lzma2.c @@ -1138,7 +1138,7 @@ enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, struct xz_buf *b) struct xz_dec_lzma2 *xz_dec_lzma2_create(enum xz_mode mode, uint32_t dict_max) { - struct xz_dec_lzma2 *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct xz_dec_lzma2 *s = kmalloc_obj(*s, GFP_KERNEL); if (s == NULL) return NULL; @@ -1296,7 +1296,7 @@ struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode, if (dict_size < 4096 || dict_size > (3U << 30)) return NULL; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kmalloc_obj(*s, GFP_KERNEL); if (s == NULL) return NULL; diff --git a/lib/xz/xz_dec_stream.c b/lib/xz/xz_dec_stream.c index f9d003684d56..0844eb6e990c 100644 --- a/lib/xz/xz_dec_stream.c +++ b/lib/xz/xz_dec_stream.c @@ -784,7 +784,7 @@ enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b) struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max) { - struct xz_dec *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct xz_dec *s = kmalloc_obj(*s, GFP_KERNEL); if (s == NULL) return NULL; diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c index 4824c2cc7a09..d5f9a77e41c6 100644 --- a/lib/zlib_inflate/infutil.c +++ b/lib/zlib_inflate/infutil.c @@ -14,7 +14,7 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz, int rc; rc = -ENOMEM; - strm = kmalloc(sizeof(*strm), GFP_KERNEL); + strm = kmalloc_obj(*strm, GFP_KERNEL); if (strm == NULL) goto gunzip_nomem1; strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); diff --git a/mm/backing-dev.c b/mm/backing-dev.c index e319bd5e8b75..7a18fa6c7272 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -689,7 +689,7 @@ static int cgwb_create(struct backing_dev_info *bdi, goto out_put; /* need to create a new one */ - wb = kmalloc(sizeof(*wb), gfp); + wb = kmalloc_obj(*wb, gfp); if (!wb) { ret = -ENOMEM; goto out_put; diff --git a/mm/cma_debug.c b/mm/cma_debug.c index 8c7d7f8e8fbd..cb94f897169d 100644 --- a/mm/cma_debug.c +++ b/mm/cma_debug.c @@ -131,7 +131,7 @@ static int cma_alloc_mem(struct cma *cma, int count) struct cma_mem *mem; struct page *p; - mem = kzalloc(sizeof(*mem), GFP_KERNEL); + mem = kzalloc_obj(*mem, GFP_KERNEL); if (!mem) return -ENOMEM; diff --git a/mm/cma_sysfs.c b/mm/cma_sysfs.c index 97acd3e5a6a5..ee76baaf843c 100644 --- a/mm/cma_sysfs.c +++ b/mm/cma_sysfs.c @@ -117,7 +117,7 @@ static int __init cma_sysfs_init(void) return -ENOMEM; for (i = 0; i < cma_area_count; i++) { - cma_kobj = kzalloc(sizeof(*cma_kobj), GFP_KERNEL); + cma_kobj = kzalloc_obj(*cma_kobj, GFP_KERNEL); if (!cma_kobj) { err = -ENOMEM; goto out; diff --git a/mm/damon/core.c b/mm/damon/core.c index 5e2724a4f285..2d73d7effa3b 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -273,7 +273,7 @@ struct damos_filter *damos_new_filter(enum damos_filter_type type, { struct damos_filter *filter; - filter = kmalloc(sizeof(*filter), GFP_KERNEL); + filter = kmalloc_obj(*filter, GFP_KERNEL); if (!filter) return NULL; filter->type = type; @@ -332,7 +332,7 @@ struct damos_quota_goal *damos_new_quota_goal( { struct damos_quota_goal *goal; - goal = kmalloc(sizeof(*goal), GFP_KERNEL); + goal = kmalloc_obj(*goal, GFP_KERNEL); if (!goal) return NULL; goal->metric = metric; @@ -385,7 +385,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, { struct damos *scheme; - scheme = kmalloc(sizeof(*scheme), GFP_KERNEL); + scheme = kmalloc_obj(*scheme, GFP_KERNEL); if (!scheme) return NULL; scheme->pattern = *pattern; @@ -473,7 +473,7 @@ struct damon_target *damon_new_target(void) { struct damon_target *t; - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmalloc_obj(*t, GFP_KERNEL); if (!t) return NULL; @@ -529,7 +529,7 @@ struct damon_ctx *damon_new_ctx(void) { struct damon_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return NULL; @@ -1153,7 +1153,7 @@ static int damon_commit_target_regions(struct damon_target *dst, if (!i) return 0; - ranges = kmalloc_array(i, sizeof(*ranges), GFP_KERNEL | __GFP_NOWARN); + ranges = kmalloc_objs(*ranges, i, GFP_KERNEL | __GFP_NOWARN); if (!ranges) return -ENOMEM; i = 0; diff --git a/mm/damon/stat.c b/mm/damon/stat.c index bcf6c8ae9b90..06fc95861dd4 100644 --- a/mm/damon/stat.c +++ b/mm/damon/stat.c @@ -90,8 +90,8 @@ static int damon_stat_sort_regions(struct damon_ctx *c, damon_for_each_target(t, c) { /* there is only one target */ - region_pointers = kmalloc_array(damon_nr_regions(t), - sizeof(*region_pointers), GFP_KERNEL); + region_pointers = kmalloc_objs(*region_pointers, + damon_nr_regions(t), GFP_KERNEL); if (!region_pointers) return -ENOMEM; damon_for_each_region(r, t) { diff --git a/mm/damon/sysfs-common.c b/mm/damon/sysfs-common.c index ffaf285e241a..2149008135ef 100644 --- a/mm/damon/sysfs-common.c +++ b/mm/damon/sysfs-common.c @@ -19,8 +19,7 @@ struct damon_sysfs_ul_range *damon_sysfs_ul_range_alloc( unsigned long min, unsigned long max) { - struct damon_sysfs_ul_range *range = kmalloc(sizeof(*range), - GFP_KERNEL); + struct damon_sysfs_ul_range *range = kmalloc_obj(*range, GFP_KERNEL); if (!range) return NULL; diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 2b05a6477188..ba700da545af 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -26,8 +26,8 @@ struct damon_sysfs_scheme_region { static struct damon_sysfs_scheme_region *damon_sysfs_scheme_region_alloc( struct damon_region *region) { - struct damon_sysfs_scheme_region *sysfs_region = kmalloc( - sizeof(*sysfs_region), GFP_KERNEL); + struct damon_sysfs_scheme_region *sysfs_region = kmalloc_obj(*sysfs_region, + GFP_KERNEL); if (!sysfs_region) return NULL; @@ -138,8 +138,8 @@ struct damon_sysfs_scheme_regions { static struct damon_sysfs_scheme_regions * damon_sysfs_scheme_regions_alloc(void) { - struct damon_sysfs_scheme_regions *regions = kmalloc(sizeof(*regions), - GFP_KERNEL); + struct damon_sysfs_scheme_regions *regions = kmalloc_obj(*regions, + GFP_KERNEL); if (!regions) return NULL; @@ -210,7 +210,7 @@ struct damon_sysfs_stats { static struct damon_sysfs_stats *damon_sysfs_stats_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_stats), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_stats, GFP_KERNEL); } static ssize_t nr_tried_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -376,7 +376,7 @@ static struct damon_sysfs_scheme_filter *damon_sysfs_scheme_filter_alloc( { struct damon_sysfs_scheme_filter *filter; - filter = kzalloc(sizeof(struct damon_sysfs_scheme_filter), GFP_KERNEL); + filter = kzalloc_obj(struct damon_sysfs_scheme_filter, GFP_KERNEL); if (filter) filter->handle_layer = layer; return filter; @@ -724,7 +724,7 @@ damon_sysfs_scheme_filters_alloc(enum damos_sysfs_filter_handle_layer layer) { struct damon_sysfs_scheme_filters *filters; - filters = kzalloc(sizeof(struct damon_sysfs_scheme_filters), GFP_KERNEL); + filters = kzalloc_obj(struct damon_sysfs_scheme_filters, GFP_KERNEL); if (filters) filters->handle_layer = layer; return filters; @@ -753,8 +753,8 @@ static int damon_sysfs_scheme_filters_add_dirs( if (!nr_filters) return 0; - filters_arr = kmalloc_array(nr_filters, sizeof(*filters_arr), - GFP_KERNEL | __GFP_NOWARN); + filters_arr = kmalloc_objs(*filters_arr, nr_filters, + GFP_KERNEL | __GFP_NOWARN); if (!filters_arr) return -ENOMEM; filters->filters_arr = filters_arr; @@ -851,8 +851,8 @@ static struct damon_sysfs_watermarks *damon_sysfs_watermarks_alloc( enum damos_wmark_metric metric, unsigned long interval_us, unsigned long high, unsigned long mid, unsigned long low) { - struct damon_sysfs_watermarks *watermarks = kmalloc( - sizeof(*watermarks), GFP_KERNEL); + struct damon_sysfs_watermarks *watermarks = kmalloc_obj(*watermarks, + GFP_KERNEL); if (!watermarks) return NULL; @@ -1045,7 +1045,7 @@ struct damos_sysfs_quota_goal { static struct damos_sysfs_quota_goal *damos_sysfs_quota_goal_alloc(void) { - return kzalloc(sizeof(struct damos_sysfs_quota_goal), GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_quota_goal, GFP_KERNEL); } struct damos_sysfs_qgoal_metric_name { @@ -1263,7 +1263,7 @@ struct damos_sysfs_quota_goals { static struct damos_sysfs_quota_goals *damos_sysfs_quota_goals_alloc(void) { - return kzalloc(sizeof(struct damos_sysfs_quota_goals), GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_quota_goals, GFP_KERNEL); } static void damos_sysfs_quota_goals_rm_dirs( @@ -1289,8 +1289,8 @@ static int damos_sysfs_quota_goals_add_dirs( if (!nr_goals) return 0; - goals_arr = kmalloc_array(nr_goals, sizeof(*goals_arr), - GFP_KERNEL | __GFP_NOWARN); + goals_arr = kmalloc_objs(*goals_arr, nr_goals, + GFP_KERNEL | __GFP_NOWARN); if (!goals_arr) return -ENOMEM; goals->goals_arr = goals_arr; @@ -1383,8 +1383,7 @@ struct damon_sysfs_weights { static struct damon_sysfs_weights *damon_sysfs_weights_alloc(unsigned int sz, unsigned int nr_accesses, unsigned int age) { - struct damon_sysfs_weights *weights = kmalloc(sizeof(*weights), - GFP_KERNEL); + struct damon_sysfs_weights *weights = kmalloc_obj(*weights, GFP_KERNEL); if (!weights) return NULL; @@ -1496,7 +1495,7 @@ struct damon_sysfs_quotas { static struct damon_sysfs_quotas *damon_sysfs_quotas_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_quotas), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_quotas, GFP_KERNEL); } static int damon_sysfs_quotas_add_dirs(struct damon_sysfs_quotas *quotas) @@ -1660,8 +1659,8 @@ struct damon_sysfs_access_pattern { static struct damon_sysfs_access_pattern *damon_sysfs_access_pattern_alloc(void) { - struct damon_sysfs_access_pattern *access_pattern = - kmalloc(sizeof(*access_pattern), GFP_KERNEL); + struct damon_sysfs_access_pattern *access_pattern = kmalloc_obj(*access_pattern, + GFP_KERNEL); if (!access_pattern) return NULL; @@ -1757,7 +1756,7 @@ struct damos_sysfs_dest { static struct damos_sysfs_dest *damos_sysfs_dest_alloc(void) { - return kzalloc(sizeof(struct damos_sysfs_dest), GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_dest, GFP_KERNEL); } static ssize_t id_show( @@ -1837,7 +1836,7 @@ struct damos_sysfs_dests { static struct damos_sysfs_dests * damos_sysfs_dests_alloc(void) { - return kzalloc(sizeof(struct damos_sysfs_dests), GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_dests, GFP_KERNEL); } static void damos_sysfs_dests_rm_dirs( @@ -1863,8 +1862,8 @@ static int damos_sysfs_dests_add_dirs( if (!nr_dests) return 0; - dests_arr = kmalloc_array(nr_dests, sizeof(*dests_arr), - GFP_KERNEL | __GFP_NOWARN); + dests_arr = kmalloc_objs(*dests_arr, nr_dests, + GFP_KERNEL | __GFP_NOWARN); if (!dests_arr) return -ENOMEM; dests->dests_arr = dests_arr; @@ -2014,8 +2013,7 @@ static struct damos_sysfs_action_name damos_sysfs_action_names[] = { static struct damon_sysfs_scheme *damon_sysfs_scheme_alloc( enum damos_action action, unsigned long apply_interval_us) { - struct damon_sysfs_scheme *scheme = kmalloc(sizeof(*scheme), - GFP_KERNEL); + struct damon_sysfs_scheme *scheme = kmalloc_obj(*scheme, GFP_KERNEL); if (!scheme) return NULL; @@ -2376,7 +2374,7 @@ static const struct kobj_type damon_sysfs_scheme_ktype = { struct damon_sysfs_schemes *damon_sysfs_schemes_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_schemes), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_schemes, GFP_KERNEL); } void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes) @@ -2403,8 +2401,8 @@ static int damon_sysfs_schemes_add_dirs(struct damon_sysfs_schemes *schemes, if (!nr_schemes) return 0; - schemes_arr = kmalloc_array(nr_schemes, sizeof(*schemes_arr), - GFP_KERNEL | __GFP_NOWARN); + schemes_arr = kmalloc_objs(*schemes_arr, nr_schemes, + GFP_KERNEL | __GFP_NOWARN); if (!schemes_arr) return -ENOMEM; schemes->schemes_arr = schemes_arr; @@ -2683,12 +2681,12 @@ static int damos_sysfs_add_migrate_dest(struct damos *scheme, struct damos_migrate_dests *dests = &scheme->migrate_dests; int i; - dests->node_id_arr = kmalloc_array(sysfs_dests->nr, - sizeof(*dests->node_id_arr), GFP_KERNEL); + dests->node_id_arr = kmalloc_objs(*dests->node_id_arr, sysfs_dests->nr, + GFP_KERNEL); if (!dests->node_id_arr) return -ENOMEM; - dests->weight_arr = kmalloc_array(sysfs_dests->nr, - sizeof(*dests->weight_arr), GFP_KERNEL); + dests->weight_arr = kmalloc_objs(*dests->weight_arr, sysfs_dests->nr, + GFP_KERNEL); if (!dests->weight_arr) /* ->node_id_arr will be freed by scheme destruction */ return -ENOMEM; diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index b7f66196bec4..9561ad8b7852 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -22,7 +22,7 @@ struct damon_sysfs_region { static struct damon_sysfs_region *damon_sysfs_region_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_region), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_region, GFP_KERNEL); } static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -99,7 +99,7 @@ struct damon_sysfs_regions { static struct damon_sysfs_regions *damon_sysfs_regions_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_regions), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_regions, GFP_KERNEL); } static void damon_sysfs_regions_rm_dirs(struct damon_sysfs_regions *regions) @@ -124,8 +124,8 @@ static int damon_sysfs_regions_add_dirs(struct damon_sysfs_regions *regions, if (!nr_regions) return 0; - regions_arr = kmalloc_array(nr_regions, sizeof(*regions_arr), - GFP_KERNEL | __GFP_NOWARN); + regions_arr = kmalloc_objs(*regions_arr, nr_regions, + GFP_KERNEL | __GFP_NOWARN); if (!regions_arr) return -ENOMEM; regions->regions_arr = regions_arr; @@ -217,7 +217,7 @@ struct damon_sysfs_target { static struct damon_sysfs_target *damon_sysfs_target_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_target), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_target, GFP_KERNEL); } static int damon_sysfs_target_add_dirs(struct damon_sysfs_target *target) @@ -323,7 +323,7 @@ struct damon_sysfs_targets { static struct damon_sysfs_targets *damon_sysfs_targets_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_targets), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_targets, GFP_KERNEL); } static void damon_sysfs_targets_rm_dirs(struct damon_sysfs_targets *targets) @@ -350,8 +350,8 @@ static int damon_sysfs_targets_add_dirs(struct damon_sysfs_targets *targets, if (!nr_targets) return 0; - targets_arr = kmalloc_array(nr_targets, sizeof(*targets_arr), - GFP_KERNEL | __GFP_NOWARN); + targets_arr = kmalloc_objs(*targets_arr, nr_targets, + GFP_KERNEL | __GFP_NOWARN); if (!targets_arr) return -ENOMEM; targets->targets_arr = targets_arr; @@ -452,8 +452,7 @@ static struct damon_sysfs_intervals_goal *damon_sysfs_intervals_goal_alloc( unsigned long access_bp, unsigned long aggrs, unsigned long min_sample_us, unsigned long max_sample_us) { - struct damon_sysfs_intervals_goal *goal = kmalloc(sizeof(*goal), - GFP_KERNEL); + struct damon_sysfs_intervals_goal *goal = kmalloc_obj(*goal, GFP_KERNEL); if (!goal) return NULL; @@ -610,8 +609,8 @@ static struct damon_sysfs_intervals *damon_sysfs_intervals_alloc( unsigned long sample_us, unsigned long aggr_us, unsigned long update_us) { - struct damon_sysfs_intervals *intervals = kmalloc(sizeof(*intervals), - GFP_KERNEL); + struct damon_sysfs_intervals *intervals = kmalloc_obj(*intervals, + GFP_KERNEL); if (!intervals) return NULL; @@ -761,7 +760,7 @@ struct damon_sysfs_attrs { static struct damon_sysfs_attrs *damon_sysfs_attrs_alloc(void) { - struct damon_sysfs_attrs *attrs = kmalloc(sizeof(*attrs), GFP_KERNEL); + struct damon_sysfs_attrs *attrs = kmalloc_obj(*attrs, GFP_KERNEL); if (!attrs) return NULL; @@ -873,8 +872,7 @@ struct damon_sysfs_context { static struct damon_sysfs_context *damon_sysfs_context_alloc( enum damon_ops_id ops_id) { - struct damon_sysfs_context *context = kmalloc(sizeof(*context), - GFP_KERNEL); + struct damon_sysfs_context *context = kmalloc_obj(*context, GFP_KERNEL); if (!context) return NULL; @@ -1096,7 +1094,7 @@ struct damon_sysfs_contexts { static struct damon_sysfs_contexts *damon_sysfs_contexts_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_contexts), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_contexts, GFP_KERNEL); } static void damon_sysfs_contexts_rm_dirs(struct damon_sysfs_contexts *contexts) @@ -1123,8 +1121,8 @@ static int damon_sysfs_contexts_add_dirs(struct damon_sysfs_contexts *contexts, if (!nr_contexts) return 0; - contexts_arr = kmalloc_array(nr_contexts, sizeof(*contexts_arr), - GFP_KERNEL | __GFP_NOWARN); + contexts_arr = kmalloc_objs(*contexts_arr, nr_contexts, + GFP_KERNEL | __GFP_NOWARN); if (!contexts_arr) return -ENOMEM; contexts->contexts_arr = contexts_arr; @@ -1223,7 +1221,7 @@ struct damon_sysfs_kdamond { static struct damon_sysfs_kdamond *damon_sysfs_kdamond_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_kdamond), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_kdamond, GFP_KERNEL); } static int damon_sysfs_kdamond_add_dirs(struct damon_sysfs_kdamond *kdamond) @@ -1367,8 +1365,9 @@ static int damon_sysfs_set_regions(struct damon_target *t, struct damon_sysfs_regions *sysfs_regions, unsigned long min_region_sz) { - struct damon_addr_range *ranges = kmalloc_array(sysfs_regions->nr, - sizeof(*ranges), GFP_KERNEL | __GFP_NOWARN); + struct damon_addr_range *ranges = kmalloc_objs(*ranges, + sysfs_regions->nr, + GFP_KERNEL | __GFP_NOWARN); int i, err = -EINVAL; if (!ranges) @@ -1643,8 +1642,7 @@ static int damon_sysfs_turn_damon_on(struct damon_sysfs_kdamond *kdamond) damon_destroy_ctx(kdamond->damon_ctx); kdamond->damon_ctx = NULL; - repeat_call_control = kmalloc(sizeof(*repeat_call_control), - GFP_KERNEL); + repeat_call_control = kmalloc_obj(*repeat_call_control, GFP_KERNEL); if (!repeat_call_control) return -ENOMEM; @@ -1897,7 +1895,7 @@ struct damon_sysfs_kdamonds { static struct damon_sysfs_kdamonds *damon_sysfs_kdamonds_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_kdamonds), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_kdamonds, GFP_KERNEL); } static void damon_sysfs_kdamonds_rm_dirs(struct damon_sysfs_kdamonds *kdamonds) @@ -1940,8 +1938,8 @@ static int damon_sysfs_kdamonds_add_dirs(struct damon_sysfs_kdamonds *kdamonds, if (!nr_kdamonds) return 0; - kdamonds_arr = kmalloc_array(nr_kdamonds, sizeof(*kdamonds_arr), - GFP_KERNEL | __GFP_NOWARN); + kdamonds_arr = kmalloc_objs(*kdamonds_arr, nr_kdamonds, + GFP_KERNEL | __GFP_NOWARN); if (!kdamonds_arr) return -ENOMEM; kdamonds->kdamonds_arr = kdamonds_arr; @@ -2038,7 +2036,7 @@ struct damon_sysfs_ui_dir { static struct damon_sysfs_ui_dir *damon_sysfs_ui_dir_alloc(void) { - return kzalloc(sizeof(struct damon_sysfs_ui_dir), GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_ui_dir, GFP_KERNEL); } static int damon_sysfs_ui_dir_add_dirs(struct damon_sysfs_ui_dir *ui_dir) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 92ea25e2dc9e..d3a30b170564 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -725,12 +725,12 @@ static int damos_test_help_dests_setup(struct damos_migrate_dests *dests, { size_t i; - dests->node_id_arr = kmalloc_array(nr_dests, - sizeof(*dests->node_id_arr), GFP_KERNEL); + dests->node_id_arr = kmalloc_objs(*dests->node_id_arr, nr_dests, + GFP_KERNEL); if (!dests->node_id_arr) return -ENOMEM; - dests->weight_arr = kmalloc_array(nr_dests, - sizeof(*dests->weight_arr), GFP_KERNEL); + dests->weight_arr = kmalloc_objs(*dests->weight_arr, nr_dests, + GFP_KERNEL); if (!dests->weight_arr) { kfree(dests->node_id_arr); dests->node_id_arr = NULL; diff --git a/mm/damon/tests/sysfs-kunit.h b/mm/damon/tests/sysfs-kunit.h index 0c665ed255a3..8dcd4a01684e 100644 --- a/mm/damon/tests/sysfs-kunit.h +++ b/mm/damon/tests/sysfs-kunit.h @@ -48,8 +48,8 @@ static void damon_sysfs_test_add_targets(struct kunit *test) if (!sysfs_targets) kunit_skip(test, "sysfs_targets alloc fail"); sysfs_targets->nr = 1; - sysfs_targets->targets_arr = kmalloc_array(1, - sizeof(*sysfs_targets->targets_arr), GFP_KERNEL); + sysfs_targets->targets_arr = kmalloc_objs(*sysfs_targets->targets_arr, + 1, GFP_KERNEL); if (!sysfs_targets->targets_arr) { kfree(sysfs_targets); kunit_skip(test, "targets_arr alloc fail"); diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index 83ab3d8c3792..862835d69af1 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -821,8 +821,8 @@ static unsigned long damos_va_migrate(struct damon_target *target, use_target_nid = dests->nr_dests == 0; nr_dests = use_target_nid ? 1 : dests->nr_dests; priv.scheme = s; - priv.migration_lists = kmalloc_array(nr_dests, - sizeof(*priv.migration_lists), GFP_KERNEL); + priv.migration_lists = kmalloc_objs(*priv.migration_lists, nr_dests, + GFP_KERNEL); if (!priv.migration_lists) return 0; diff --git a/mm/dmapool_test.c b/mm/dmapool_test.c index e8172d708308..454952ac9f0e 100644 --- a/mm/dmapool_test.c +++ b/mm/dmapool_test.c @@ -67,7 +67,7 @@ static int dmapool_test_block(const struct dmapool_parms *parms) struct dma_pool_pair *p; int i, ret; - p = kcalloc(blocks, sizeof(*p), GFP_KERNEL); + p = kzalloc_objs(*p, blocks, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/mm/hmm.c b/mm/hmm.c index 4ec74c18bef6..f6c4ddff4bd6 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -723,8 +723,8 @@ int hmm_dma_map_alloc(struct device *dev, struct hmm_dma_map *map, use_iova = dma_iova_try_alloc(dev, &map->state, 0, nr_entries * PAGE_SIZE); if (!use_iova && dma_need_unmap(dev)) { - map->dma_list = kvcalloc(nr_entries, sizeof(*map->dma_list), - GFP_KERNEL | __GFP_NOWARN); + map->dma_list = kvzalloc_objs(*map->dma_list, nr_entries, + GFP_KERNEL | __GFP_NOWARN); if (!map->dma_list) goto err_dma; } diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 0d487649e4de..809c99ee81b9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -718,7 +718,7 @@ static struct thpsize *thpsize_create(int order, struct kobject *parent) struct thpsize *thpsize; int ret = -ENOMEM; - thpsize = kzalloc(sizeof(*thpsize), GFP_KERNEL); + thpsize = kzalloc_obj(*thpsize, GFP_KERNEL); if (!thpsize) goto err; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6e855a32de3d..6793a5b07882 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -154,7 +154,7 @@ struct hugepage_subpool *hugepage_new_subpool(struct hstate *h, long max_hpages, { struct hugepage_subpool *spool; - spool = kzalloc(sizeof(*spool), GFP_KERNEL); + spool = kzalloc_obj(*spool, GFP_KERNEL); if (!spool) return NULL; @@ -429,7 +429,7 @@ int hugetlb_vma_lock_alloc(struct vm_area_struct *vma) if (vma->vm_private_data) return -EINVAL; - vma_lock = kmalloc(sizeof(*vma_lock), GFP_KERNEL); + vma_lock = kmalloc_obj(*vma_lock, GFP_KERNEL); if (!vma_lock) { /* * If we can not allocate structure, then vma can not @@ -687,7 +687,7 @@ static int allocate_file_region_entries(struct resv_map *resv, spin_unlock(&resv->lock); for (i = 0; i < to_allocate; i++) { - trg = kmalloc(sizeof(*trg), GFP_KERNEL); + trg = kmalloc_obj(*trg, GFP_KERNEL); if (!trg) goto out_of_memory; list_add(&trg->link, &allocated_regions); @@ -891,7 +891,7 @@ retry: if (!nrg) { spin_unlock(&resv->lock); - nrg = kmalloc(sizeof(*nrg), GFP_KERNEL); + nrg = kmalloc_obj(*nrg, GFP_KERNEL); if (!nrg) return -ENOMEM; goto retry; @@ -1105,8 +1105,8 @@ resv_map_set_hugetlb_cgroup_uncharge_info(struct resv_map *resv_map, struct resv_map *resv_map_alloc(void) { - struct resv_map *resv_map = kmalloc(sizeof(*resv_map), GFP_KERNEL); - struct file_region *rg = kmalloc(sizeof(*rg), GFP_KERNEL); + struct resv_map *resv_map = kmalloc_obj(*resv_map, GFP_KERNEL); + struct file_region *rg = kmalloc_obj(*rg, GFP_KERNEL); if (!resv_map || !rg) { kfree(resv_map); @@ -4190,8 +4190,7 @@ static int __init hugetlb_init(void) num_fault_mutexes = 1; #endif hugetlb_fault_mutex_table = - kmalloc_array(num_fault_mutexes, sizeof(struct mutex), - GFP_KERNEL); + kmalloc_objs(struct mutex, num_fault_mutexes, GFP_KERNEL); BUG_ON(!hugetlb_fault_mutex_table); for (i = 0; i < num_fault_mutexes; i++) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index 792d06538fa9..6e4706d6ee82 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -139,8 +139,7 @@ hugetlb_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) struct hugetlb_cgroup *h_cgroup; int node; - h_cgroup = kzalloc(struct_size(h_cgroup, nodeinfo, nr_node_ids), - GFP_KERNEL); + h_cgroup = kzalloc_flex(*h_cgroup, nodeinfo, nr_node_ids, GFP_KERNEL); if (!h_cgroup) return ERR_PTR(-ENOMEM); @@ -857,10 +856,10 @@ static void __init __hugetlb_cgroup_file_pre_init(void) int cft_count; cft_count = hugetlb_max_hstate * DFL_TMPL_SIZE + 1; /* add terminator */ - dfl_files = kcalloc(cft_count, sizeof(struct cftype), GFP_KERNEL); + dfl_files = kzalloc_objs(struct cftype, cft_count, GFP_KERNEL); BUG_ON(!dfl_files); cft_count = hugetlb_max_hstate * LEGACY_TMPL_SIZE + 1; /* add terminator */ - legacy_files = kcalloc(cft_count, sizeof(struct cftype), GFP_KERNEL); + legacy_files = kzalloc_objs(struct cftype, cft_count, GFP_KERNEL); BUG_ON(!legacy_files); } diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index b4d157962121..cb9c95ed7821 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -511,7 +511,7 @@ static void kmalloc_oob_16(struct kunit *test) ptr1 = RELOC_HIDE(kmalloc(sizeof(*ptr1) - 3, GFP_KERNEL), 0); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr1); - ptr2 = kmalloc(sizeof(*ptr2), GFP_KERNEL); + ptr2 = kmalloc_obj(*ptr2, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr2); OPTIMIZER_HIDE_VAR(ptr1); @@ -529,10 +529,10 @@ static void kmalloc_uaf_16(struct kunit *test) KASAN_TEST_NEEDS_CHECKED_MEMINTRINSICS(test); - ptr1 = kmalloc(sizeof(*ptr1), GFP_KERNEL); + ptr1 = kmalloc_obj(*ptr1, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr1); - ptr2 = kmalloc(sizeof(*ptr2), GFP_KERNEL); + ptr2 = kmalloc_obj(*ptr2, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr2); kfree(ptr2); @@ -859,7 +859,7 @@ static void kasan_atomics(struct kunit *test) */ a1 = kzalloc(48, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, a1); - a2 = kzalloc(sizeof(atomic_long_t), GFP_KERNEL); + a2 = kzalloc_obj(atomic_long_t, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, a2); /* Use atomics to access the redzone. */ @@ -954,7 +954,7 @@ static void rcu_uaf(struct kunit *test) { struct kasan_rcu_info *ptr; - ptr = kmalloc(sizeof(struct kasan_rcu_info), GFP_KERNEL); + ptr = kmalloc_obj(struct kasan_rcu_info, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); global_rcu_ptr = rcu_dereference_protected( @@ -978,7 +978,7 @@ static void workqueue_uaf(struct kunit *test) workqueue = create_workqueue("kasan_workqueue_test"); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, workqueue); - work = kmalloc(sizeof(struct work_struct), GFP_KERNEL); + work = kmalloc_obj(struct work_struct, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, work); INIT_WORK(work, workqueue_uaf_work); diff --git a/mm/khugepaged.c b/mm/khugepaged.c index eff9e3061925..f2f95b32317c 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2769,7 +2769,7 @@ int madvise_collapse(struct vm_area_struct *vma, unsigned long start, if (!thp_vma_allowable_order(vma, vma->vm_flags, TVA_FORCED_COLLAPSE, PMD_ORDER)) return -EINVAL; - cc = kmalloc(sizeof(*cc), GFP_KERNEL); + cc = kmalloc_obj(*cc, GFP_KERNEL); if (!cc) return -ENOMEM; cc->is_khugepaged = false; diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c index 7a7fbaff7350..27cc936176ea 100644 --- a/mm/kmsan/kmsan_test.c +++ b/mm/kmsan/kmsan_test.c @@ -168,7 +168,7 @@ static void test_uninit_kmalloc(struct kunit *test) int *ptr; kunit_info(test, "uninitialized kmalloc test (UMR report)\n"); - ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kmalloc_obj(*ptr, GFP_KERNEL); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); } @@ -182,7 +182,7 @@ static void test_init_kmalloc(struct kunit *test) int *ptr; kunit_info(test, "initialized kmalloc test (no reports)\n"); - ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kmalloc_obj(*ptr, GFP_KERNEL); memset(ptr, 0, sizeof(*ptr)); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); @@ -195,7 +195,7 @@ static void test_init_kzalloc(struct kunit *test) int *ptr; kunit_info(test, "initialized kzalloc test (no reports)\n"); - ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kzalloc_obj(*ptr, GFP_KERNEL); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); } @@ -322,7 +322,7 @@ static void test_init_kmsan_vmap_vunmap(struct kunit *test) kunit_info(test, "pages initialized via vmap (no reports)\n"); - pages = kmalloc_array(npages, sizeof(*pages), GFP_KERNEL); + pages = kmalloc_objs(*pages, npages, GFP_KERNEL); for (int i = 0; i < npages; i++) pages[i] = alloc_page(GFP_KERNEL); vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL); diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index 9e1c5f2b7a41..8fde939784a7 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -230,8 +230,8 @@ int kmsan_vmap_pages_range_noflush(unsigned long start, unsigned long end, return 0; nr = (end - start) / PAGE_SIZE; - s_pages = kcalloc(nr, sizeof(*s_pages), gfp_mask); - o_pages = kcalloc(nr, sizeof(*o_pages), gfp_mask); + s_pages = kzalloc_objs(*s_pages, nr, gfp_mask); + o_pages = kzalloc_objs(*o_pages, nr, gfp_mask); if (!s_pages || !o_pages) { err = -ENOMEM; goto ret; diff --git a/mm/ksm.c b/mm/ksm.c index 2d89a7c8b4eb..85481c3e3f2c 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -3586,8 +3586,8 @@ static ssize_t merge_across_nodes_store(struct kobject *kobj, * Allocate stable and unstable together: * MAXSMP NODES_SHIFT 10 will use 16kB. */ - buf = kcalloc(nr_node_ids + nr_node_ids, sizeof(*buf), - GFP_KERNEL); + buf = kzalloc_objs(*buf, nr_node_ids + nr_node_ids, + GFP_KERNEL); /* Let us assume that RB_ROOT is NULL is zero */ if (!buf) err = -ENOMEM; diff --git a/mm/list_lru.c b/mm/list_lru.c index 13b9f66d950e..16526b9d71b5 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -407,7 +407,7 @@ static struct list_lru_memcg *memcg_init_list_lru_one(struct list_lru *lru, gfp_ int nid; struct list_lru_memcg *mlru; - mlru = kmalloc(struct_size(mlru, node, nr_node_ids), gfp); + mlru = kmalloc_flex(*mlru, node, nr_node_ids, gfp); if (!mlru) return NULL; @@ -585,7 +585,7 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, struct shrinker *shr memcg_aware = false; #endif - lru->node = kcalloc(nr_node_ids, sizeof(*lru->node), GFP_KERNEL); + lru->node = kzalloc_objs(*lru->node, nr_node_ids, GFP_KERNEL); if (!lru->node) return -ENOMEM; diff --git a/mm/madvise.c b/mm/madvise.c index 8debb2d434aa..30c7a642e7fc 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -91,7 +91,7 @@ struct anon_vma_name *anon_vma_name_alloc(const char *name) /* Add 1 for NUL terminator at the end of the anon_name->name */ count = strlen(name) + 1; - anon_name = kmalloc(struct_size(anon_name, name, count), GFP_KERNEL); + anon_name = kmalloc_flex(*anon_name, name, count, GFP_KERNEL); if (anon_name) { kref_init(&anon_name->kref); memcpy(anon_name->name, name, count); diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index c6078cd7f7e5..597af8a80163 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -783,7 +783,7 @@ static int __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, size = thresholds->primary ? thresholds->primary->size + 1 : 1; /* Allocate memory for new array of thresholds */ - new = kmalloc(struct_size(new, entries, size), GFP_KERNEL_ACCOUNT); + new = kmalloc_flex(*new, entries, size, GFP_KERNEL_ACCOUNT); if (!new) { ret = -ENOMEM; goto unlock; @@ -946,7 +946,7 @@ static int mem_cgroup_oom_register_event(struct mem_cgroup *memcg, { struct mem_cgroup_eventfd_list *event; - event = kmalloc(sizeof(*event), GFP_KERNEL_ACCOUNT); + event = kmalloc_obj(*event, GFP_KERNEL_ACCOUNT); if (!event) return -ENOMEM; @@ -1109,7 +1109,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of, CLASS(fd, cfile)(cfd); - event = kzalloc(sizeof(*event), GFP_KERNEL_ACCOUNT); + event = kzalloc_obj(*event, GFP_KERNEL_ACCOUNT); if (!event) return -ENOMEM; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f2b87e02574e..63773a0b91f7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -192,7 +192,7 @@ static struct obj_cgroup *obj_cgroup_alloc(void) struct obj_cgroup *objcg; int ret; - objcg = kzalloc(sizeof(struct obj_cgroup), GFP_KERNEL); + objcg = kzalloc_obj(struct obj_cgroup, GFP_KERNEL); if (!objcg) return NULL; @@ -3761,8 +3761,7 @@ static struct mem_cgroup *mem_cgroup_alloc(struct mem_cgroup *parent) goto fail; error = -ENOMEM; - memcg->vmstats = kzalloc(sizeof(struct memcg_vmstats), - GFP_KERNEL_ACCOUNT); + memcg->vmstats = kzalloc_obj(struct memcg_vmstats, GFP_KERNEL_ACCOUNT); if (!memcg->vmstats) goto fail; diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index a34fccc23b6a..c69774c19c88 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -112,7 +112,7 @@ static int memfd_luo_preserve_folios(struct file *file, * up being smaller if there are higher order folios. */ max_folios = PAGE_ALIGN(size) / PAGE_SIZE; - folios = kvmalloc_array(max_folios, sizeof(*folios), GFP_KERNEL); + folios = kvmalloc_objs(*folios, max_folios, GFP_KERNEL); if (!folios) return -ENOMEM; diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ba4231858a36..ee42d4361309 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -387,7 +387,7 @@ static void __add_to_kill(struct task_struct *tsk, const struct page *p, { struct to_kill *tk; - tk = kmalloc(sizeof(struct to_kill), GFP_ATOMIC); + tk = kmalloc_obj(struct to_kill, GFP_ATOMIC); if (!tk) { pr_err("Out of memory while machine check handling\n"); return; @@ -1917,7 +1917,7 @@ static int hugetlb_update_hwpoison(struct folio *folio, struct page *page) return MF_HUGETLB_PAGE_PRE_POISONED; } - raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC); + raw_hwp = kmalloc_obj(struct raw_hwp_page, GFP_ATOMIC); if (raw_hwp) { raw_hwp->page = page; llist_add(&raw_hwp->node, head); @@ -2214,7 +2214,7 @@ static void add_to_kill_pgoff(struct task_struct *tsk, { struct to_kill *tk; - tk = kmalloc(sizeof(*tk), GFP_ATOMIC); + tk = kmalloc_obj(*tk, GFP_ATOMIC); if (!tk) { pr_info("Unable to kill proc %d\n", tsk->pid); return; diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index 545e34626df7..b05c916fa5f4 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -227,7 +227,7 @@ static struct memory_tier *find_create_memory_tier(struct memory_dev_type *memty } } - new_memtier = kzalloc(sizeof(struct memory_tier), GFP_KERNEL); + new_memtier = kzalloc_obj(struct memory_tier, GFP_KERNEL); if (!new_memtier) return ERR_PTR(-ENOMEM); @@ -625,7 +625,7 @@ struct memory_dev_type *alloc_memory_type(int adistance) { struct memory_dev_type *memtype; - memtype = kmalloc(sizeof(*memtype), GFP_KERNEL); + memtype = kmalloc_obj(*memtype, GFP_KERNEL); if (!memtype) return ERR_PTR(-ENOMEM); @@ -912,8 +912,8 @@ static int __init memory_tier_init(void) panic("%s() failed to register memory tier subsystem\n", __func__); #ifdef CONFIG_MIGRATION - node_demotion = kcalloc(nr_node_ids, sizeof(struct demotion_nodes), - GFP_KERNEL); + node_demotion = kzalloc_objs(struct demotion_nodes, nr_node_ids, + GFP_KERNEL); WARN_ON(!node_demotion); #endif diff --git a/mm/memory.c b/mm/memory.c index 876bf73959c6..144e30d2825f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3035,7 +3035,7 @@ static inline struct pfnmap_track_ctx *pfnmap_track_ctx_alloc(unsigned long pfn, if (pfnmap_track(pfn, size, prot)) return ERR_PTR(-EINVAL); - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (unlikely(!ctx)) { pfnmap_untrack(pfn, size); return ERR_PTR(-ENOMEM); diff --git a/mm/mempolicy.c b/mm/mempolicy.c index dbd48502ac24..0835743f6575 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -229,8 +229,8 @@ int mempolicy_set_node_perf(unsigned int node, struct access_coordinate *coords) if (!new_bw) return -ENOMEM; - new_wi_state = kmalloc(struct_size(new_wi_state, iw_table, nr_node_ids), - GFP_KERNEL); + new_wi_state = kmalloc_flex(*new_wi_state, iw_table, nr_node_ids, + GFP_KERNEL); if (!new_wi_state) { kfree(new_bw); return -ENOMEM; @@ -3642,8 +3642,8 @@ static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, kstrtou8(buf, 0, &weight) || weight == 0) return -EINVAL; - new_wi_state = kzalloc(struct_size(new_wi_state, iw_table, nr_node_ids), - GFP_KERNEL); + new_wi_state = kzalloc_flex(*new_wi_state, iw_table, nr_node_ids, + GFP_KERNEL); if (!new_wi_state) return -ENOMEM; @@ -3695,8 +3695,8 @@ static ssize_t weighted_interleave_auto_store(struct kobject *kobj, if (kstrtobool(buf, &input)) return -EINVAL; - new_wi_state = kzalloc(struct_size(new_wi_state, iw_table, nr_node_ids), - GFP_KERNEL); + new_wi_state = kzalloc_flex(*new_wi_state, iw_table, nr_node_ids, + GFP_KERNEL); if (!new_wi_state) return -ENOMEM; for (i = 0; i < nr_node_ids; i++) @@ -3815,7 +3815,7 @@ static int sysfs_wi_node_add(int nid) return -EINVAL; } - new_attr = kzalloc(sizeof(*new_attr), GFP_KERNEL); + new_attr = kzalloc_obj(*new_attr, GFP_KERNEL); if (!new_attr) return -ENOMEM; @@ -3880,8 +3880,7 @@ static int __init add_weighted_interleave_group(struct kobject *mempolicy_kobj) { int nid, err; - wi_group = kzalloc(struct_size(wi_group, nattrs, nr_node_ids), - GFP_KERNEL); + wi_group = kzalloc_flex(*wi_group, nattrs, nr_node_ids, GFP_KERNEL); if (!wi_group) return -ENOMEM; mutex_init(&wi_group->kobj_lock); diff --git a/mm/mempool.c b/mm/mempool.c index c290e5261b47..c22c63ccbbcd 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -371,8 +371,7 @@ int mempool_resize(struct mempool *pool, int new_min_nr) spin_unlock_irqrestore(&pool->lock, flags); /* Grow the pool */ - new_elements = kmalloc_array(new_min_nr, sizeof(*new_elements), - GFP_KERNEL); + new_elements = kmalloc_objs(*new_elements, new_min_nr, GFP_KERNEL); if (!new_elements) return -ENOMEM; diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 8e0125dc0522..1aa561a055eb 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -618,8 +618,8 @@ int __mmu_notifier_register(struct mmu_notifier *subscription, * know that mm->notifier_subscriptions can't change while we * hold the write side of the mmap_lock. */ - subscriptions = kzalloc( - sizeof(struct mmu_notifier_subscriptions), GFP_KERNEL); + subscriptions = kzalloc_obj(struct mmu_notifier_subscriptions, + GFP_KERNEL); if (!subscriptions) return -ENOMEM; diff --git a/mm/page_owner.c b/mm/page_owner.c index b6a394a130ec..8178e0be557f 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -181,7 +181,7 @@ static void add_stack_record_to_list(struct stack_record *stack_record, return; set_current_in_page_owner(); - stack = kmalloc(sizeof(*stack), gfp_nested_mask(gfp_mask)); + stack = kmalloc_obj(*stack, gfp_nested_mask(gfp_mask)); if (!stack) { unset_current_in_page_owner(); return; diff --git a/mm/page_reporting.c b/mm/page_reporting.c index 8a03effda749..7323284d2f7d 100644 --- a/mm/page_reporting.c +++ b/mm/page_reporting.c @@ -322,7 +322,7 @@ static void page_reporting_process(struct work_struct *work) atomic_set(&prdev->state, state); /* allocate scatterlist to store pages being reported on */ - sgl = kmalloc_array(PAGE_REPORTING_CAPACITY, sizeof(*sgl), GFP_KERNEL); + sgl = kmalloc_objs(*sgl, PAGE_REPORTING_CAPACITY, GFP_KERNEL); if (!sgl) goto err_out; diff --git a/mm/shmem.c b/mm/shmem.c index d129f4eb5ca9..5f2e8e3d5b75 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -5328,7 +5328,7 @@ int shmem_init_fs_context(struct fs_context *fc) { struct shmem_options *ctx; - ctx = kzalloc(sizeof(struct shmem_options), GFP_KERNEL); + ctx = kzalloc_obj(struct shmem_options, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/mm/shmem_quota.c b/mm/shmem_quota.c index d1e32ac01407..d0b92d6da50f 100644 --- a/mm/shmem_quota.c +++ b/mm/shmem_quota.c @@ -67,7 +67,7 @@ static int shmem_read_file_info(struct super_block *sb, int type) struct quota_info *dqopt = sb_dqopt(sb); struct mem_dqinfo *info = &dqopt->info[type]; - info->dqi_priv = kzalloc(sizeof(struct rb_root), GFP_NOFS); + info->dqi_priv = kzalloc_obj(struct rb_root, GFP_NOFS); if (!info->dqi_priv) return -ENOMEM; @@ -190,7 +190,7 @@ static int shmem_acquire_dquot(struct dquot *dquot) } /* We don't have entry for this id yet, create it */ - new_entry = kzalloc(sizeof(struct quota_id), GFP_NOFS); + new_entry = kzalloc_obj(struct quota_id, GFP_NOFS); if (!new_entry) { ret = -ENOMEM; goto out_unlock; diff --git a/mm/shrinker.c b/mm/shrinker.c index 4a93fd433689..52e7bebe4579 100644 --- a/mm/shrinker.c +++ b/mm/shrinker.c @@ -682,7 +682,7 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...) va_list ap; int err; - shrinker = kzalloc(sizeof(struct shrinker), GFP_KERNEL); + shrinker = kzalloc_obj(struct shrinker, GFP_KERNEL); if (!shrinker) return NULL; diff --git a/mm/slub.c b/mm/slub.c index 865bc050f654..b8e9c0b62435 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2636,7 +2636,7 @@ bool slab_free_hook(struct kmem_cache *s, void *x, bool init, if (still_accessible) { struct rcu_delayed_free *delayed_free; - delayed_free = kmalloc(sizeof(*delayed_free), GFP_NOWAIT); + delayed_free = kmalloc_obj(*delayed_free, GFP_NOWAIT); if (delayed_free) { /* * Let KASAN track our call stack as a "related work @@ -4928,7 +4928,7 @@ kmem_cache_prefill_sheaf(struct kmem_cache *s, gfp_t gfp, unsigned int size) if (unlikely(size > s->sheaf_capacity)) { - sheaf = kzalloc(struct_size(sheaf, objects, size), gfp); + sheaf = kzalloc_flex(*sheaf, objects, size, gfp); if (!sheaf) return NULL; @@ -9139,7 +9139,7 @@ static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si) unsigned long sum = 0; int cpu; int len = 0; - int *data = kmalloc_array(nr_cpu_ids, sizeof(int), GFP_KERNEL); + int *data = kmalloc_objs(int, nr_cpu_ids, GFP_KERNEL); if (!data) return -ENOMEM; @@ -9510,7 +9510,7 @@ int sysfs_slab_alias(struct kmem_cache *s, const char *name) return sysfs_create_link(&slab_kset->kobj, &s->kobj, name); } - al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL); + al = kmalloc_obj(struct saved_alias, GFP_KERNEL); if (!al) return -ENOMEM; diff --git a/mm/swapfile.c b/mm/swapfile.c index c2377c4b6bb9..8a1e2af356ba 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2575,7 +2575,7 @@ add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, } /* No merge, insert a new extent. */ - new_se = kmalloc(sizeof(*se), GFP_KERNEL); + new_se = kmalloc_obj(*se, GFP_KERNEL); if (new_se == NULL) return -ENOMEM; new_se->start_page = start_page; @@ -3048,7 +3048,7 @@ static struct swap_info_struct *alloc_swap_info(void) struct swap_info_struct *defer = NULL; unsigned int type; - p = kvzalloc(sizeof(struct swap_info_struct), GFP_KERNEL); + p = kvzalloc_obj(struct swap_info_struct, GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -3257,7 +3257,7 @@ static struct swap_cluster_info *setup_clusters(struct swap_info_struct *si, int err = -ENOMEM; unsigned long i; - cluster_info = kvcalloc(nr_clusters, sizeof(*cluster_info), GFP_KERNEL); + cluster_info = kvzalloc_objs(*cluster_info, nr_clusters, GFP_KERNEL); if (!cluster_info) goto err; @@ -3265,8 +3265,8 @@ static struct swap_cluster_info *setup_clusters(struct swap_info_struct *si, spin_lock_init(&cluster_info[i].lock); if (!(si->flags & SWP_SOLIDSTATE)) { - si->global_cluster = kmalloc(sizeof(*si->global_cluster), - GFP_KERNEL); + si->global_cluster = kmalloc_obj(*si->global_cluster, + GFP_KERNEL); if (!si->global_cluster) goto err; for (i = 0; i < SWAP_NR_ORDERS; i++) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 03e1117480d5..672c56d8bfe1 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4920,14 +4920,14 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, return NULL; } - vms = kcalloc(nr_vms, sizeof(vms[0]), GFP_KERNEL); - vas = kcalloc(nr_vms, sizeof(vas[0]), GFP_KERNEL); + vms = kzalloc_objs(vms[0], nr_vms, GFP_KERNEL); + vas = kzalloc_objs(vas[0], nr_vms, GFP_KERNEL); if (!vas || !vms) goto err_free2; for (area = 0; area < nr_vms; area++) { vas[area] = kmem_cache_zalloc(vmap_area_cachep, GFP_KERNEL); - vms[area] = kzalloc(sizeof(struct vm_struct), GFP_KERNEL); + vms[area] = kzalloc_obj(struct vm_struct, GFP_KERNEL); if (!vas[area] || !vms[area]) goto err_free; } @@ -5366,7 +5366,7 @@ static void vmap_init_nodes(void) int n = clamp_t(unsigned int, num_possible_cpus(), 1, 128); if (n > 1) { - vn = kmalloc_array(n, sizeof(*vn), GFP_NOWAIT); + vn = kmalloc_objs(*vn, n, GFP_NOWAIT); if (vn) { /* Node partition is 16 pages. */ vmap_zone_size = (1 << 4) * PAGE_SIZE; diff --git a/mm/vmpressure.c b/mm/vmpressure.c index c197ed47bcc4..035e0384e39b 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -402,7 +402,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, mode = ret; } - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) { ret = -ENOMEM; goto out; diff --git a/mm/vmscan.c b/mm/vmscan.c index 44e4fcd6463c..0fc9373e8251 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3821,7 +3821,8 @@ static struct lru_gen_mm_walk *set_mm_walk(struct pglist_data *pgdat, bool force } else if (!walk && force_alloc) { VM_WARN_ON_ONCE(current_is_kswapd()); - walk = kzalloc(sizeof(*walk), __GFP_HIGH | __GFP_NOMEMALLOC | __GFP_NOWARN); + walk = kzalloc_obj(*walk, + __GFP_HIGH | __GFP_NOMEMALLOC | __GFP_NOWARN); } current->reclaim_state->mm_walk = walk; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index d5d1c27b3852..fa0b726dcec7 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2062,7 +2062,7 @@ struct zs_pool *zs_create_pool(const char *name) struct zs_pool *pool; struct size_class *prev_class = NULL; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -2128,7 +2128,7 @@ struct zs_pool *zs_create_pool(const char *name) } } - class = kzalloc(sizeof(struct size_class), GFP_KERNEL); + class = kzalloc_obj(struct size_class, GFP_KERNEL); if (!class) goto err; diff --git a/mm/zswap.c b/mm/zswap.c index af3f0fbb0558..bbfd8a51e4c8 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -251,7 +251,7 @@ static struct zswap_pool *zswap_pool_create(char *compressor) if (!zswap_has_pool && !strcmp(compressor, ZSWAP_PARAM_UNSET)) return NULL; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; @@ -1665,7 +1665,7 @@ int zswap_swapon(int type, unsigned long nr_pages) unsigned int nr, i; nr = DIV_ROUND_UP(nr_pages, ZSWAP_ADDRESS_SPACE_PAGES); - trees = kvcalloc(nr, sizeof(*tree), GFP_KERNEL); + trees = kvzalloc_objs(*tree, nr, GFP_KERNEL); if (!trees) { pr_err("alloc failed, zswap disabled for swap type %d\n", type); return -ENOMEM; diff --git a/net/802/garp.c b/net/802/garp.c index 2d1ffc4d9462..ceeb5f5fac02 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -547,7 +547,7 @@ static int garp_init_port(struct net_device *dev) { struct garp_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; rcu_assign_pointer(dev->garp_port, port); @@ -581,7 +581,7 @@ int garp_init_applicant(struct net_device *dev, struct garp_application *appl) } err = -ENOMEM; - app = kzalloc(sizeof(*app), GFP_KERNEL); + app = kzalloc_obj(*app, GFP_KERNEL); if (!app) goto err2; diff --git a/net/802/mrp.c b/net/802/mrp.c index 23a88305f900..f65c95d43a4e 100644 --- a/net/802/mrp.c +++ b/net/802/mrp.c @@ -832,7 +832,7 @@ static int mrp_init_port(struct net_device *dev) { struct mrp_port *port; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; rcu_assign_pointer(dev->mrp_port, port); @@ -866,7 +866,7 @@ int mrp_init_applicant(struct net_device *dev, struct mrp_application *appl) } err = -ENOMEM; - app = kzalloc(sizeof(*app), GFP_KERNEL); + app = kzalloc_obj(*app, GFP_KERNEL); if (!app) goto err2; diff --git a/net/802/psnap.c b/net/802/psnap.c index 389df460c8c4..8ae835e1cbae 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -132,7 +132,7 @@ struct datalink_proto *register_snap_client(const unsigned char *desc, if (find_snap_client(desc)) goto out; - proto = kmalloc(sizeof(*proto), GFP_ATOMIC); + proto = kmalloc_obj(*proto, GFP_ATOMIC); if (proto) { memcpy(proto->type, desc, 5); proto->rcvfunc = rcvfunc; diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 9404dd551dfd..d7849667ddf0 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -150,7 +150,7 @@ static struct vlan_info *vlan_info_alloc(struct net_device *dev) { struct vlan_info *vlan_info; - vlan_info = kzalloc(sizeof(struct vlan_info), GFP_KERNEL); + vlan_info = kzalloc_obj(struct vlan_info, GFP_KERNEL); if (!vlan_info) return NULL; @@ -193,7 +193,7 @@ static struct vlan_vid_info *vlan_vid_info_alloc(__be16 proto, u16 vid) { struct vlan_vid_info *vid_info; - vid_info = kzalloc(sizeof(struct vlan_vid_info), GFP_KERNEL); + vid_info = kzalloc_obj(struct vlan_vid_info, GFP_KERNEL); if (!vid_info) return NULL; vid_info->proto = proto; diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index fbf296137b09..176912c62915 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -192,7 +192,7 @@ int vlan_dev_set_egress_priority(const struct net_device *dev, /* Create a new mapping then. */ mp = vlan->egress_priority_map[skb_prio & 0xF]; - np = kmalloc(sizeof(struct vlan_priority_tci_mapping), GFP_KERNEL); + np = kmalloc_obj(struct vlan_priority_tci_mapping, GFP_KERNEL); if (!np) return -ENOBUFS; @@ -708,7 +708,7 @@ static int vlan_dev_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err = 0; - netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); err = -ENOMEM; if (!netpoll) goto out; diff --git a/net/9p/client.c b/net/9p/client.c index 1b475525ac5b..3e8de85c7f7f 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -730,7 +730,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) struct p9_fid *fid; p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt); - fid = kzalloc(sizeof(*fid), GFP_KERNEL); + fid = kzalloc_obj(*fid, GFP_KERNEL); if (!fid) return NULL; @@ -859,7 +859,7 @@ struct p9_client *p9_client_create(struct fs_context *fc) char *client_id; char *cache_name; - clnt = kmalloc(sizeof(*clnt), GFP_KERNEL); + clnt = kmalloc_obj(*clnt, GFP_KERNEL); if (!clnt) return ERR_PTR(-ENOMEM); @@ -1615,7 +1615,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid) p9_debug(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid); - ret = kmalloc(sizeof(*ret), GFP_KERNEL); + ret = kmalloc_obj(*ret, GFP_KERNEL); if (!ret) return ERR_PTR(-ENOMEM); @@ -1667,7 +1667,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid, p9_debug(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n", fid->fid, request_mask); - ret = kmalloc(sizeof(*ret), GFP_KERNEL); + ret = kmalloc_obj(*ret, GFP_KERNEL); if (!ret) return ERR_PTR(-ENOMEM); diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 0e6603b1ec90..67b0586d807f 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -451,9 +451,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, p9pdu_readf(pdu, proto_version, "w", nwqid); if (!errcode) { *wqids = - kmalloc_array(*nwqid, - sizeof(struct p9_qid), - GFP_NOFS); + kmalloc_objs(struct p9_qid, *nwqid, + GFP_NOFS); if (*wqids == NULL) errcode = -ENOMEM; } diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 0e331c1b2112..4e0f4a382ac4 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -719,8 +719,7 @@ static int p9_fd_show_options(struct seq_file *m, struct p9_client *clnt) static int p9_fd_open(struct p9_client *client, int rfd, int wfd) { - struct p9_trans_fd *ts = kzalloc(sizeof(struct p9_trans_fd), - GFP_KERNEL); + struct p9_trans_fd *ts = kzalloc_obj(struct p9_trans_fd, GFP_KERNEL); if (!ts) return -ENOMEM; @@ -764,7 +763,7 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket) struct p9_trans_fd *p; struct file *file; - p = kzalloc(sizeof(struct p9_trans_fd), GFP_KERNEL); + p = kzalloc_obj(struct p9_trans_fd, GFP_KERNEL); if (!p) { sock_release(csocket); return -ENOMEM; diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 4d406479f83b..c8e27c08a3a2 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -334,7 +334,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) } /* Allocate an fcall for the reply */ - rpl_context = kmalloc(sizeof *rpl_context, GFP_NOFS); + rpl_context = kmalloc_obj(*rpl_context, GFP_NOFS); if (!rpl_context) { err = -ENOMEM; goto recv_error; @@ -363,7 +363,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) dont_need_post_recv: /* Post the request */ - c = kmalloc(sizeof *c, GFP_NOFS); + c = kmalloc_obj(*c, GFP_NOFS); if (!c) { err = -ENOMEM; goto send_error; @@ -460,7 +460,7 @@ static struct p9_trans_rdma *alloc_rdma(struct p9_rdma_opts *opts) { struct p9_trans_rdma *rdma; - rdma = kzalloc(sizeof(struct p9_trans_rdma), GFP_KERNEL); + rdma = kzalloc_obj(struct p9_trans_rdma, GFP_KERNEL); if (!rdma) return NULL; diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c index 93547637deae..e167f9f23d65 100644 --- a/net/9p/trans_usbg.c +++ b/net/9p/trans_usbg.c @@ -757,7 +757,7 @@ static struct usb_function *usb9pfs_alloc(struct usb_function_instance *fi) struct f_usb9pfs_opts *usb9pfs_opts; struct f_usb9pfs *usb9pfs; - usb9pfs = kzalloc(sizeof(*usb9pfs), GFP_KERNEL); + usb9pfs = kzalloc_obj(*usb9pfs, GFP_KERNEL); if (!usb9pfs) return ERR_PTR(-ENOMEM); @@ -910,7 +910,7 @@ static struct usb_function_instance *usb9pfs_alloc_instance(void) struct f_usb9pfs_opts *usb9pfs_opts; struct f_usb9pfs_dev *dev; - usb9pfs_opts = kzalloc(sizeof(*usb9pfs_opts), GFP_KERNEL); + usb9pfs_opts = kzalloc_obj(*usb9pfs_opts, GFP_KERNEL); if (!usb9pfs_opts) return ERR_PTR(-ENOMEM); @@ -921,7 +921,7 @@ static struct usb_function_instance *usb9pfs_alloc_instance(void) usb9pfs_opts->buflen = DEFAULT_BUFLEN; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) { kfree(usb9pfs_opts); return ERR_PTR(-ENOMEM); diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 370f4f37dcec..0577bdcb67bf 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -358,8 +358,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan, nr_pages = DIV_ROUND_UP((unsigned long)p + len, PAGE_SIZE) - (unsigned long)p / PAGE_SIZE; - *pages = kmalloc_array(nr_pages, sizeof(struct page *), - GFP_NOFS); + *pages = kmalloc_objs(struct page *, nr_pages, GFP_NOFS); if (!*pages) return -ENOMEM; @@ -602,7 +601,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) return -EINVAL; } - chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL); + chan = kmalloc_obj(struct virtio_chan, GFP_KERNEL); if (!chan) { pr_err("Failed to allocate virtio 9P channel\n"); err = -ENOMEM; @@ -642,7 +641,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) if (err) { goto out_free_tag; } - chan->vc_wq = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL); + chan->vc_wq = kmalloc_obj(wait_queue_head_t, GFP_KERNEL); if (!chan->vc_wq) { err = -ENOMEM; goto out_remove_file; diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index dde9cbf1426c..fd6ac8658549 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -417,12 +417,11 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) if (p9_xen_trans.maxsize > XEN_FLEX_RING_SIZE(max_ring_order)) p9_xen_trans.maxsize = XEN_FLEX_RING_SIZE(max_ring_order) / 2; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; priv->dev = dev; - priv->rings = kcalloc(XEN_9PFS_NUM_RINGS, sizeof(*priv->rings), - GFP_KERNEL); + priv->rings = kzalloc_objs(*priv->rings, XEN_9PFS_NUM_RINGS, GFP_KERNEL); if (!priv->rings) { kfree(priv); return -ENOMEM; diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 4744e3fd4544..e7315c01a299 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c @@ -393,7 +393,7 @@ static void aarp_purge(void) */ static struct aarp_entry *aarp_alloc(void) { - struct aarp_entry *a = kmalloc(sizeof(*a), GFP_ATOMIC); + struct aarp_entry *a = kmalloc_obj(*a, GFP_ATOMIC); if (!a) return NULL; diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 2a01fff46c9d..53c613e36245 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -233,7 +233,7 @@ static void atif_drop_device(struct net_device *dev) static struct atalk_iface *atif_add_device(struct net_device *dev, struct atalk_addr *sa) { - struct atalk_iface *iface = kzalloc(sizeof(*iface), GFP_KERNEL); + struct atalk_iface *iface = kzalloc_obj(*iface, GFP_KERNEL); if (!iface) goto out; @@ -564,7 +564,7 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint) } if (!rt) { - rt = kzalloc(sizeof(*rt), GFP_ATOMIC); + rt = kzalloc_obj(*rt, GFP_ATOMIC); retval = -ENOBUFS; if (!rt) diff --git a/net/atm/addr.c b/net/atm/addr.c index 0530b63f509a..938f360ae230 100644 --- a/net/atm/addr.c +++ b/net/atm/addr.c @@ -87,7 +87,7 @@ int atm_add_addr(struct atm_dev *dev, const struct sockaddr_atmsvc *addr, return -EEXIST; } } - this = kmalloc(sizeof(struct atm_dev_addr), GFP_ATOMIC); + this = kmalloc_obj(struct atm_dev_addr, GFP_ATOMIC); if (!this) { spin_unlock_irqrestore(&dev->lock, flags); return -ENOMEM; diff --git a/net/atm/br2684.c b/net/atm/br2684.c index f666f2f98ba5..8fdc25271708 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -538,7 +538,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg) if (copy_from_user(&be, arg, sizeof be)) return -EFAULT; - brvcc = kzalloc(sizeof(struct br2684_vcc), GFP_KERNEL); + brvcc = kzalloc_obj(struct br2684_vcc, GFP_KERNEL); if (!brvcc) return -ENOMEM; /* diff --git a/net/atm/clip.c b/net/atm/clip.c index 8f152e5fa659..40553fcab389 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c @@ -431,7 +431,7 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout) return -EBADFD; if (vcc->user_back) return -EINVAL; - clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL); + clip_vcc = kmalloc_obj(struct clip_vcc, GFP_KERNEL); if (!clip_vcc) return -ENOMEM; pr_debug("%p vcc %p\n", clip_vcc, vcc); diff --git a/net/atm/lec.c b/net/atm/lec.c index afb8d3eb2185..cba26158c4ad 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -696,7 +696,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg) ioc_data.dev_num = array_index_nospec(ioc_data.dev_num, MAX_LEC_ITF); if (!dev_lec[ioc_data.dev_num]) return -EINVAL; - vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL); + vpriv = kmalloc_obj(struct lec_vcc_priv, GFP_KERNEL); if (!vpriv) return -ENOMEM; vpriv->xoff = 0; @@ -1541,7 +1541,7 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv, { struct lec_arp_table *to_return; - to_return = kzalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); + to_return = kzalloc_obj(struct lec_arp_table, GFP_ATOMIC); if (!to_return) return NULL; ether_addr_copy(to_return->mac_addr, mac_addr); @@ -2125,7 +2125,7 @@ static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) struct lec_vcc_priv *vpriv; int err = 0; - vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL); + vpriv = kmalloc_obj(struct lec_vcc_priv, GFP_KERNEL); if (!vpriv) return -ENOMEM; vpriv->xoff = 0; diff --git a/net/atm/mpc.c b/net/atm/mpc.c index f6b447bba329..3e2b13734fc4 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c @@ -184,7 +184,7 @@ struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos) return entry; } - entry = kmalloc(sizeof(struct atm_mpoa_qos), GFP_KERNEL); + entry = kmalloc_obj(struct atm_mpoa_qos, GFP_KERNEL); if (entry == NULL) { pr_info("mpoa: out of memory\n"); return entry; @@ -282,7 +282,7 @@ static struct mpoa_client *alloc_mpc(void) { struct mpoa_client *mpc; - mpc = kzalloc(sizeof(struct mpoa_client), GFP_KERNEL); + mpc = kzalloc_obj(struct mpoa_client, GFP_KERNEL); if (mpc == NULL) return NULL; rwlock_init(&mpc->ingress_lock); diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index f7a2f0e41105..b584ab72ed2f 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm/mpoa_caches.c @@ -97,7 +97,7 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc, static in_cache_entry *in_cache_add_entry(__be32 dst_ip, struct mpoa_client *client) { - in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL); + in_cache_entry *entry = kzalloc_obj(in_cache_entry, GFP_KERNEL); if (entry == NULL) { pr_info("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n"); @@ -456,7 +456,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry, static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_client *client) { - eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL); + eg_cache_entry *entry = kzalloc_obj(eg_cache_entry, GFP_KERNEL); if (entry == NULL) { pr_info("out of memory\n"); diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 3e4f17d335fe..133b0cda7063 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c @@ -397,7 +397,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg) if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) return -EINVAL; - pvcc = kzalloc(sizeof(*pvcc), GFP_KERNEL); + pvcc = kzalloc_obj(*pvcc, GFP_KERNEL); if (pvcc == NULL) return -ENOMEM; pvcc->atmvcc = atmvcc; diff --git a/net/atm/resources.c b/net/atm/resources.c index 7c6fdedbcf4e..9849521feaf3 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c @@ -36,7 +36,7 @@ static struct atm_dev *__alloc_atm_dev(const char *type) { struct atm_dev *dev; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return NULL; dev->type = type; diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 7ebbff2f0020..855ae9df824d 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -528,7 +528,7 @@ ax25_cb *ax25_create_cb(void) { ax25_cb *ax25; - if ((ax25 = kzalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL) + if ((ax25 = kzalloc_obj(*ax25, GFP_ATOMIC)) == NULL) return NULL; refcount_set(&ax25->refcount, 1); @@ -1249,7 +1249,7 @@ static int __must_check ax25_connect(struct socket *sock, goto out_release; } - if ((digi = kmalloc(sizeof(ax25_digi), GFP_KERNEL)) == NULL) { + if ((digi = kmalloc_obj(ax25_digi, GFP_KERNEL)) == NULL) { err = -ENOBUFS; goto out_release; } diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c index c504ed9c3a88..56f605ddd88d 100644 --- a/net/ax25/ax25_dev.c +++ b/net/ax25/ax25_dev.c @@ -54,7 +54,7 @@ void ax25_dev_device_up(struct net_device *dev) { ax25_dev *ax25_dev; - ax25_dev = kzalloc(sizeof(*ax25_dev), GFP_KERNEL); + ax25_dev = kzalloc_obj(*ax25_dev, GFP_KERNEL); if (!ax25_dev) { printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n"); return; diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c index 979bc4b828a0..3ad454416a5c 100644 --- a/net/ax25/ax25_iface.c +++ b/net/ax25/ax25_iface.c @@ -105,7 +105,7 @@ int ax25_listen_register(const ax25_address *callsign, struct net_device *dev) if (ax25_listen_mine(callsign, dev)) return 0; - if ((listen = kmalloc(sizeof(*listen), GFP_ATOMIC)) == NULL) + if ((listen = kmalloc_obj(*listen, GFP_ATOMIC)) == NULL) return -ENOMEM; listen->callsign = *callsign; diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c index f2d66af86359..d75b3e9ed93d 100644 --- a/net/ax25/ax25_in.c +++ b/net/ax25/ax25_in.c @@ -377,7 +377,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev, * Sort out any digipeated paths. */ if (dp.ndigi && !ax25->digipeat && - (ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { + (ax25->digipeat = kmalloc_obj(ax25_digi, GFP_ATOMIC)) == NULL) { kfree_skb(skb); ax25_destroy_socket(ax25); if (sk) diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 10577434f40b..1d5c59ccf142 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c @@ -91,7 +91,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route) kfree(ax25_rt->digipeat); ax25_rt->digipeat = NULL; if (route->digi_count != 0) { - if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { + if ((ax25_rt->digipeat = kmalloc_obj(ax25_digi, GFP_ATOMIC)) == NULL) { write_unlock_bh(&ax25_route_lock); ax25_dev_put(ax25_dev); return -ENOMEM; @@ -110,7 +110,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route) ax25_rt = ax25_rt->next; } - if ((ax25_rt = kmalloc(sizeof(ax25_route), GFP_ATOMIC)) == NULL) { + if ((ax25_rt = kmalloc_obj(ax25_route, GFP_ATOMIC)) == NULL) { write_unlock_bh(&ax25_route_lock); ax25_dev_put(ax25_dev); return -ENOMEM; @@ -121,7 +121,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route) ax25_rt->digipeat = NULL; ax25_rt->ip_mode = ' '; if (route->digi_count != 0) { - if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { + if ((ax25_rt->digipeat = kmalloc_obj(ax25_digi, GFP_ATOMIC)) == NULL) { write_unlock_bh(&ax25_route_lock); kfree(ax25_rt); ax25_dev_put(ax25_dev); diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 241e4680ecb1..95c5915f1ab9 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c @@ -101,7 +101,7 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) } if (sax->sax25_uid == 0) return -EINVAL; - if ((ax25_uid = kmalloc(sizeof(*ax25_uid), GFP_KERNEL)) == NULL) + if ((ax25_uid = kmalloc_obj(*ax25_uid, GFP_KERNEL)) == NULL) return -ENOMEM; refcount_set(&ax25_uid->refcount, 1); diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index cb16c1ed2a58..2ce4e5bf9292 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -355,7 +355,7 @@ static void batadv_v_elp_periodic_work(struct work_struct *work) * context. Therefore add it to metric_queue and process it * outside rcu protected context. */ - metric_entry = kzalloc(sizeof(*metric_entry), GFP_ATOMIC); + metric_entry = kzalloc_obj(*metric_entry, GFP_ATOMIC); if (!metric_entry) { batadv_hardif_neigh_put(hardif_neigh); continue; diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 3dc791c15bf7..49ae92b9a152 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -505,7 +505,7 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, const u8 *orig, "%s(): not found (%pM, %d), creating new entry\n", __func__, orig, batadv_print_vid(vid)); - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return NULL; @@ -699,7 +699,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv, /* create a new claim entry if it does not exist yet. */ if (!claim) { - claim = kzalloc(sizeof(*claim), GFP_ATOMIC); + claim = kzalloc_obj(*claim, GFP_ATOMIC); if (!claim) return; diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 8b8132eb0a79..3efc4cf50b46 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -381,7 +381,7 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip, goto out; } - dat_entry = kmalloc(sizeof(*dat_entry), GFP_ATOMIC); + dat_entry = kmalloc_obj(*dat_entry, GFP_ATOMIC); if (!dat_entry) goto out; @@ -635,8 +635,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst, if (!bat_priv->orig_hash) return NULL; - res = kmalloc_array(BATADV_DAT_CANDIDATES_NUM, sizeof(*res), - GFP_ATOMIC); + res = kmalloc_objs(*res, BATADV_DAT_CANDIDATES_NUM, GFP_ATOMIC); if (!res) return NULL; diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index cc14bc41381e..f4e45cc25816 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -156,7 +156,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node, seqno = ntohs(frag_packet->seqno); bucket = seqno % BATADV_FRAG_BUFFER_COUNT; - frag_entry_new = kmalloc(sizeof(*frag_entry_new), GFP_ATOMIC); + frag_entry_new = kmalloc_obj(*frag_entry_new, GFP_ATOMIC); if (!frag_entry_new) goto err; diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 7a11b245e9f4..51e9c081a2a4 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -332,7 +332,7 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv, if (gateway->bandwidth_down == 0) return; - gw_node = kzalloc(sizeof(*gw_node), GFP_ATOMIC); + gw_node = kzalloc_obj(*gw_node, GFP_ATOMIC); if (!gw_node) return; diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 5113f879736b..7b7640f3ffe2 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -871,7 +871,7 @@ batadv_hardif_add_interface(struct net_device *net_dev) if (!batadv_is_valid_iface(net_dev)) return NULL; - hard_iface = kzalloc(sizeof(*hard_iface), GFP_ATOMIC); + hard_iface = kzalloc_obj(*hard_iface, GFP_ATOMIC); if (!hard_iface) return NULL; diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c index 8016e619787f..759fa29176db 100644 --- a/net/batman-adv/hash.c +++ b/net/batman-adv/hash.c @@ -45,16 +45,15 @@ struct batadv_hashtable *batadv_hash_new(u32 size) { struct batadv_hashtable *hash; - hash = kmalloc(sizeof(*hash), GFP_ATOMIC); + hash = kmalloc_obj(*hash, GFP_ATOMIC); if (!hash) return NULL; - hash->table = kmalloc_array(size, sizeof(*hash->table), GFP_ATOMIC); + hash->table = kmalloc_objs(*hash->table, size, GFP_ATOMIC); if (!hash->table) goto free_hash; - hash->list_locks = kmalloc_array(size, sizeof(*hash->list_locks), - GFP_ATOMIC); + hash->list_locks = kmalloc_objs(*hash->list_locks, size, GFP_ATOMIC); if (!hash->list_locks) goto free_table; diff --git a/net/batman-adv/mesh-interface.c b/net/batman-adv/mesh-interface.c index df7e95811ef5..56ca1c1b83f2 100644 --- a/net/batman-adv/mesh-interface.c +++ b/net/batman-adv/mesh-interface.c @@ -555,7 +555,7 @@ int batadv_meshif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid) return -EEXIST; } - vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); + vlan = kzalloc_obj(*vlan, GFP_ATOMIC); if (!vlan) { spin_unlock_bh(&bat_priv->meshif_vlan_list_lock); return -ENOMEM; diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c index e8c6b0bf670f..a3d3efe22d30 100644 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c @@ -399,7 +399,7 @@ batadv_mcast_mla_meshif_get_ipv4(struct net_device *dev, if (batadv_mcast_mla_is_duplicate(mcast_addr, mcast_list)) continue; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) { ret = -ENOMEM; break; @@ -472,7 +472,7 @@ batadv_mcast_mla_meshif_get_ipv6(struct net_device *dev, if (batadv_mcast_mla_is_duplicate(mcast_addr, mcast_list)) continue; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) { ret = -ENOMEM; break; @@ -632,7 +632,7 @@ static int batadv_mcast_mla_bridge_get(struct net_device *dev, if (batadv_mcast_mla_is_duplicate(mcast_addr, mcast_list)) continue; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) { ret = -ENOMEM; break; diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index a662408ad867..b3468ccab535 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -179,7 +179,7 @@ batadv_orig_node_vlan_new(struct batadv_orig_node *orig_node, if (vlan) goto out; - vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); + vlan = kzalloc_obj(*vlan, GFP_ATOMIC); if (!vlan) goto out; @@ -417,7 +417,7 @@ batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node, if (orig_ifinfo) goto out; - orig_ifinfo = kzalloc(sizeof(*orig_ifinfo), GFP_ATOMIC); + orig_ifinfo = kzalloc_obj(*orig_ifinfo, GFP_ATOMIC); if (!orig_ifinfo) goto out; @@ -495,7 +495,7 @@ batadv_neigh_ifinfo_new(struct batadv_neigh_node *neigh, if (neigh_ifinfo) goto out; - neigh_ifinfo = kzalloc(sizeof(*neigh_ifinfo), GFP_ATOMIC); + neigh_ifinfo = kzalloc_obj(*neigh_ifinfo, GFP_ATOMIC); if (!neigh_ifinfo) goto out; @@ -575,7 +575,7 @@ batadv_hardif_neigh_create(struct batadv_hard_iface *hard_iface, if (hardif_neigh) goto out; - hardif_neigh = kzalloc(sizeof(*hardif_neigh), GFP_ATOMIC); + hardif_neigh = kzalloc_obj(*hardif_neigh, GFP_ATOMIC); if (!hardif_neigh) goto out; @@ -683,7 +683,7 @@ batadv_neigh_node_create(struct batadv_orig_node *orig_node, if (!hardif_neigh) goto out; - neigh_node = kzalloc(sizeof(*neigh_node), GFP_ATOMIC); + neigh_node = kzalloc_obj(*neigh_node, GFP_ATOMIC); if (!neigh_node) goto out; @@ -947,7 +947,7 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv, batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "Creating new originator: %pM\n", addr); - orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC); + orig_node = kzalloc_obj(*orig_node, GFP_ATOMIC); if (!orig_node) return NULL; diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 20d85c681064..60cd67ec9cea 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -503,7 +503,7 @@ batadv_forw_packet_alloc(struct batadv_hard_iface *if_incoming, return NULL; } - forw_packet = kmalloc(sizeof(*forw_packet), GFP_ATOMIC); + forw_packet = kmalloc_obj(*forw_packet, GFP_ATOMIC); if (!forw_packet) goto err; diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 350b149e48be..2e42f6b348c8 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -967,7 +967,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, return; } - tp_vars = kmalloc(sizeof(*tp_vars), GFP_ATOMIC); + tp_vars = kmalloc_obj(*tp_vars, GFP_ATOMIC); if (!tp_vars) { spin_unlock_bh(&bat_priv->tp_list_lock); batadv_dbg(BATADV_DBG_TP_METER, bat_priv, @@ -1228,7 +1228,7 @@ static bool batadv_tp_handle_out_of_order(struct batadv_tp_vars *tp_vars, u32 payload_len; bool added = false; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (unlikely(!new)) return false; @@ -1343,7 +1343,7 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv, goto out_unlock; } - tp_vars = kmalloc(sizeof(*tp_vars), GFP_ATOMIC); + tp_vars = kmalloc_obj(*tp_vars, GFP_ATOMIC); if (!tp_vars) goto out_unlock; diff --git a/net/batman-adv/tvlv.c b/net/batman-adv/tvlv.c index 76dff1f9c559..8129a3f9c44d 100644 --- a/net/batman-adv/tvlv.c +++ b/net/batman-adv/tvlv.c @@ -557,7 +557,7 @@ void batadv_tvlv_handler_register(struct batadv_priv *bat_priv, return; } - tvlv_handler = kzalloc(sizeof(*tvlv_handler), GFP_ATOMIC); + tvlv_handler = kzalloc_obj(*tvlv_handler, GFP_ATOMIC); if (!tvlv_handler) { spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); return; diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 2c21ae8abadc..acaf7c9e4a69 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -645,7 +645,7 @@ static struct l2cap_chan *add_peer_chan(struct l2cap_chan *chan, { struct lowpan_peer *peer; - peer = kzalloc(sizeof(*peer), GFP_ATOMIC); + peer = kzalloc_obj(*peer, GFP_ATOMIC); if (!peer) return NULL; @@ -1107,7 +1107,7 @@ static int lowpan_enable_set(void *data, u64 val) { struct set_enable *set_enable; - set_enable = kzalloc(sizeof(*set_enable), GFP_KERNEL); + set_enable = kzalloc_obj(*set_enable, GFP_KERNEL); if (!set_enable) return -ENOMEM; @@ -1245,7 +1245,7 @@ static void disconnect_devices(void) rcu_read_lock(); list_for_each_entry_rcu(entry, &bt_6lowpan_devices, list) { - new_dev = kmalloc(sizeof(*new_dev), GFP_ATOMIC); + new_dev = kmalloc_obj(*new_dev, GFP_ATOMIC); if (!new_dev) break; diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c index 884703fda979..df4edd43176e 100644 --- a/net/bluetooth/cmtp/capi.c +++ b/net/bluetooth/cmtp/capi.c @@ -72,7 +72,7 @@ static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl) { - struct cmtp_application *app = kzalloc(sizeof(*app), GFP_KERNEL); + struct cmtp_application *app = kzalloc_obj(*app, GFP_KERNEL); BT_DBG("session %p application %p appl %u", session, app, appl); diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 90d130588a3e..ebfa049598dc 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c @@ -341,7 +341,7 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) if (req->flags & ~valid_flags) return -EINVAL; - session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL); + session = kzalloc_obj(struct cmtp_session, GFP_KERNEL); if (!session) return -ENOMEM; diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 0795818963a5..02d33fe11042 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -462,7 +462,7 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) struct conn_handle_t *conn_handle; if (enhanced_sync_conn_capable(conn->hdev)) { - conn_handle = kzalloc(sizeof(*conn_handle), GFP_KERNEL); + conn_handle = kzalloc_obj(*conn_handle, GFP_KERNEL); if (!conn_handle) return false; @@ -726,7 +726,7 @@ static int hci_le_terminate_big(struct hci_dev *hdev, struct hci_conn *conn) bt_dev_dbg(hdev, "big 0x%2.2x bis 0x%2.2x", conn->iso_qos.bcast.big, conn->iso_qos.bcast.bis); - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; @@ -777,7 +777,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn) bt_dev_dbg(hdev, "hcon %p big 0x%2.2x sync_handle 0x%4.4x", conn, conn->iso_qos.bcast.big, conn->sync_handle); - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (!d) return -ENOMEM; @@ -960,7 +960,7 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bt_dev_dbg(hdev, "dst %pMR handle 0x%4.4x", dst, handle); - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) return ERR_PTR(-ENOMEM); @@ -1739,7 +1739,7 @@ static struct hci_link *hci_conn_link(struct hci_conn *parent, if (conn->parent) return NULL; - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) return NULL; @@ -2781,7 +2781,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn) return NULL; } - chan = kzalloc(sizeof(*chan), GFP_KERNEL); + chan = kzalloc_obj(*chan, GFP_KERNEL); if (!chan) return NULL; diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index b069607b145b..a0cad792be0b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -262,7 +262,7 @@ u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, } /* Entry not in the cache. Add new one. */ - ie = kzalloc(sizeof(*ie), GFP_KERNEL); + ie = kzalloc_obj(*ie, GFP_KERNEL); if (!ie) { flags |= MGMT_DEV_FOUND_CONFIRM_NAME; goto done; @@ -797,7 +797,7 @@ int hci_get_dev_list(void __user *arg) if (!dev_num || dev_num > (PAGE_SIZE * 2) / sizeof(*dr)) return -EINVAL; - dl = kzalloc(struct_size(dl, dev_req, dev_num), GFP_KERNEL); + dl = kzalloc_flex(*dl, dev_req, dev_num, GFP_KERNEL); if (!dl) return -ENOMEM; @@ -1286,7 +1286,7 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, key = old_key; } else { old_key_type = conn ? conn->key_type : 0xff; - key = kzalloc(sizeof(*key), GFP_KERNEL); + key = kzalloc_obj(*key, GFP_KERNEL); if (!key) return NULL; list_add_rcu(&key->list, &hdev->link_keys); @@ -1331,7 +1331,7 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, if (old_key) key = old_key; else { - key = kzalloc(sizeof(*key), GFP_KERNEL); + key = kzalloc_obj(*key, GFP_KERNEL); if (!key) return NULL; list_add_rcu(&key->list, &hdev->long_term_keys); @@ -1356,7 +1356,7 @@ struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type); if (!irk) { - irk = kzalloc(sizeof(*irk), GFP_KERNEL); + irk = kzalloc_obj(*irk, GFP_KERNEL); if (!irk) return NULL; @@ -1550,7 +1550,7 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, data = hci_find_remote_oob_data(hdev, bdaddr, bdaddr_type); if (!data) { - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1718,7 +1718,7 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance, instance < 1 || instance > hdev->le_num_of_adv_sets + 1) return ERR_PTR(-EOVERFLOW); - adv = kzalloc(sizeof(*adv), GFP_KERNEL); + adv = kzalloc_obj(*adv, GFP_KERNEL); if (!adv) return ERR_PTR(-ENOMEM); @@ -2107,7 +2107,7 @@ int hci_bdaddr_list_add(struct list_head *list, bdaddr_t *bdaddr, u8 type) if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -2130,7 +2130,7 @@ int hci_bdaddr_list_add_with_irk(struct list_head *list, bdaddr_t *bdaddr, if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -2159,7 +2159,7 @@ int hci_bdaddr_list_add_with_flags(struct list_head *list, bdaddr_t *bdaddr, if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -2276,7 +2276,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, if (params) return params; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) { bt_dev_err(hdev, "out of memory"); return NULL; diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index f04a90bce4a9..ed5db3eb3df3 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -711,7 +711,7 @@ int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func, goto unlock; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto unlock; @@ -2685,7 +2685,7 @@ static struct conn_params *conn_params_copy(struct list_head *list, size_t *n) rcu_read_unlock(); - p = kvcalloc(*n, sizeof(struct conn_params), GFP_KERNEL); + p = kvzalloc_objs(struct conn_params, *n, GFP_KERNEL); if (!p) return NULL; @@ -7341,7 +7341,7 @@ int hci_past_sync(struct hci_conn *conn, struct hci_conn *le) if (!past_sender_capable(conn->hdev)) return -EOPNOTSUPP; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -7473,7 +7473,7 @@ int hci_acl_change_pkt_type(struct hci_conn *conn, u16 pkt_type) struct hci_dev *hdev = conn->hdev; struct hci_cp_change_conn_ptype *cp; - cp = kmalloc(sizeof(*cp), GFP_KERNEL); + cp = kmalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; @@ -7508,7 +7508,7 @@ int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys) struct hci_dev *hdev = conn->hdev; struct hci_cp_le_set_phy *cp; - cp = kmalloc(sizeof(*cp), GFP_KERNEL); + cp = kmalloc_obj(*cp, GFP_KERNEL); if (!cp) return -ENOMEM; diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 6724adce615b..a91d5452f24a 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -920,7 +920,7 @@ static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr, ctrl = bt_sk(ctrl_sock->sk); intr = bt_sk(intr_sock->sk); - session = kzalloc(sizeof(*session), GFP_KERNEL); + session = kzalloc_obj(*session, GFP_KERNEL); if (!session) return -ENOMEM; diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 1459ab161fd2..693271af6c22 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -212,7 +212,7 @@ static struct iso_conn *iso_conn_add(struct hci_conn *hcon) return conn; } - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) return NULL; diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index b628b0fa39b2..4804377781b6 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -442,7 +442,7 @@ struct l2cap_chan *l2cap_chan_create(void) { struct l2cap_chan *chan; - chan = kzalloc(sizeof(*chan), GFP_ATOMIC); + chan = kzalloc_obj(*chan, GFP_ATOMIC); if (!chan) return NULL; @@ -6902,7 +6902,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon) if (!hchan) return NULL; - conn = kzalloc(sizeof(*conn), GFP_KERNEL); + conn = kzalloc_obj(*conn, GFP_KERNEL); if (!conn) { hci_chan_del(hchan); return NULL; diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 3ba3ce7eaa98..66ab920d8f50 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1564,8 +1564,8 @@ static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) (chan->mode == L2CAP_MODE_ERTM || chan->mode == L2CAP_MODE_LE_FLOWCTL || chan->mode == L2CAP_MODE_EXT_FLOWCTL)) { - struct l2cap_rx_busy *rx_busy = - kmalloc(sizeof(*rx_busy), GFP_KERNEL); + struct l2cap_rx_busy *rx_busy = kmalloc_obj(*rx_busy, + GFP_KERNEL); if (!rx_busy) { err = -ENOMEM; goto done; diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 0e46f9e08b10..c9725ca3356c 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -560,7 +560,7 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, list_for_each_entry(d, &hci_dev_list, list) count++; - rp = kmalloc(struct_size(rp, entry, count), GFP_ATOMIC); + rp = kmalloc_flex(*rp, entry, count, GFP_ATOMIC); if (!rp) { read_unlock(&hci_dev_list_lock); return -ENOMEM; @@ -2767,7 +2767,7 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) goto failed; } - uuid = kmalloc(sizeof(*uuid), GFP_KERNEL); + uuid = kmalloc_obj(*uuid, GFP_KERNEL); if (!uuid) { err = -ENOMEM; goto failed; @@ -3360,7 +3360,7 @@ static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data, i++; } - rp = kmalloc(struct_size(rp, addr, i), GFP_KERNEL); + rp = kmalloc_flex(*rp, addr, i, GFP_KERNEL); if (!rp) { err = -ENOMEM; goto unlock; @@ -4377,7 +4377,7 @@ static int set_blocked_keys(struct sock *sk, struct hci_dev *hdev, void *data, hci_blocked_keys_clear(hdev); for (i = 0; i < key_count; ++i) { - struct blocked_key *b = kzalloc(sizeof(*b), GFP_KERNEL); + struct blocked_key *b = kzalloc_obj(*b, GFP_KERNEL); if (!b) { err = MGMT_STATUS_NO_RESOURCES; @@ -5490,7 +5490,7 @@ static u8 parse_adv_monitor_pattern(struct adv_monitor *m, u8 pattern_count, (offset + length) > HCI_MAX_AD_LENGTH) return MGMT_STATUS_INVALID_PARAMS; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return MGMT_STATUS_NO_RESOURCES; @@ -5527,7 +5527,7 @@ static int add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev, goto done; } - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (!m) { status = MGMT_STATUS_NO_RESOURCES; goto done; @@ -5564,7 +5564,7 @@ static int add_adv_patterns_monitor_rssi(struct sock *sk, struct hci_dev *hdev, goto done; } - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc_obj(*m, GFP_KERNEL); if (!m) { status = MGMT_STATUS_NO_RESOURCES; goto done; diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c index aa7b5585cb26..4ed16ca8771d 100644 --- a/net/bluetooth/mgmt_util.c +++ b/net/bluetooth/mgmt_util.c @@ -266,7 +266,7 @@ struct mgmt_pending_cmd *mgmt_pending_new(struct sock *sk, u16 opcode, { struct mgmt_pending_cmd *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return NULL; @@ -413,7 +413,7 @@ struct mgmt_mesh_tx *mgmt_mesh_add(struct sock *sk, struct hci_dev *hdev, { struct mgmt_mesh_tx *mesh_tx; - mesh_tx = kzalloc(sizeof(*mesh_tx), GFP_KERNEL); + mesh_tx = kzalloc_obj(*mesh_tx, GFP_KERNEL); if (!mesh_tx) return NULL; diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c index c560d8467669..25cde1ea5d23 100644 --- a/net/bluetooth/msft.c +++ b/net/bluetooth/msft.c @@ -276,7 +276,7 @@ static int msft_le_monitor_advertisement_cb(struct hci_dev *hdev, u16 opcode, if (status) goto unlock; - handle_data = kmalloc(sizeof(*handle_data), GFP_KERNEL); + handle_data = kmalloc_obj(*handle_data, GFP_KERNEL); if (!handle_data) { status = HCI_ERROR_UNSPECIFIED; goto unlock; @@ -756,7 +756,7 @@ void msft_register(struct hci_dev *hdev) bt_dev_dbg(hdev, "Register MSFT extension"); - msft = kzalloc(sizeof(*msft), GFP_KERNEL); + msft = kzalloc_obj(*msft, GFP_KERNEL); if (!msft) { bt_dev_err(hdev, "Failed to register MSFT extension"); return; @@ -790,7 +790,7 @@ static void msft_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, { struct monitored_device *dev; - dev = kmalloc(sizeof(*dev), GFP_KERNEL); + dev = kmalloc_obj(*dev, GFP_KERNEL); if (!dev) { bt_dev_err(hdev, "MSFT vendor event %u: no memory", MSFT_EV_LE_MONITOR_DEVICE); @@ -932,7 +932,7 @@ static struct msft_monitor_addr_filter_data *msft_add_address_filter struct msft_data *msft = hdev->msft_data; int err; - address_filter = kzalloc(sizeof(*address_filter), GFP_KERNEL); + address_filter = kzalloc_obj(*address_filter, GFP_KERNEL); if (!address_filter) return NULL; diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 57b1dca8141f..d7718844c520 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c @@ -302,7 +302,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) { - struct rfcomm_dlc *d = kzalloc(sizeof(*d), prio); + struct rfcomm_dlc *d = kzalloc_obj(*d, prio); if (!d) return NULL; @@ -680,7 +680,7 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig) /* ---- RFCOMM sessions ---- */ static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) { - struct rfcomm_session *s = kzalloc(sizeof(*s), GFP_KERNEL); + struct rfcomm_session *s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return NULL; diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index b783526ab588..4d8ab1a49e92 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -221,7 +221,7 @@ static struct rfcomm_dev *__rfcomm_dev_add(struct rfcomm_dev_req *req, struct list_head *head = &rfcomm_dev_list; int err = 0; - dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); + dev = kzalloc_obj(struct rfcomm_dev, GFP_KERNEL); if (!dev) return ERR_PTR(-ENOMEM); @@ -510,7 +510,7 @@ static int rfcomm_get_dev_list(void __user *arg) if (!dev_num || dev_num > (PAGE_SIZE * 4) / sizeof(*di)) return -EINVAL; - dl = kzalloc(struct_size(dl, dev_info, dev_num), GFP_KERNEL); + dl = kzalloc_flex(*dl, dev_info, dev_num, GFP_KERNEL); if (!dl) return -ENOMEM; diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 87ba90336e80..26c5c5fe7c5a 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -204,7 +204,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon) return conn; } - conn = kzalloc(sizeof(struct sco_conn), GFP_KERNEL); + conn = kzalloc_obj(struct sco_conn, GFP_KERNEL); if (!conn) return NULL; diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index bf61e8841535..e0e66dc95007 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1344,7 +1344,7 @@ static void smp_distribute_keys(struct smp_chan *smp) /* Generate a new random key */ get_random_bytes(sign.csrk, sizeof(sign.csrk)); - csrk = kzalloc(sizeof(*csrk), GFP_KERNEL); + csrk = kzalloc_obj(*csrk, GFP_KERNEL); if (csrk) { if (hcon->sec_level > BT_SECURITY_MEDIUM) csrk->type = MGMT_CSRK_LOCAL_AUTHENTICATED; @@ -1388,7 +1388,7 @@ static struct smp_chan *smp_chan_create(struct l2cap_conn *conn) struct l2cap_chan *chan = conn->smp; struct smp_chan *smp; - smp = kzalloc(sizeof(*smp), GFP_ATOMIC); + smp = kzalloc_obj(*smp, GFP_ATOMIC); if (!smp) return NULL; @@ -2664,7 +2664,7 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) skb_pull(skb, sizeof(*rp)); - csrk = kzalloc(sizeof(*csrk), GFP_KERNEL); + csrk = kzalloc_obj(*csrk, GFP_KERNEL); if (csrk) { if (conn->hcon->sec_level > BT_SECURITY_MEDIUM) csrk->type = MGMT_CSRK_REMOTE_AUTHENTICATED; @@ -3293,7 +3293,7 @@ static struct l2cap_chan *smp_add_cid(struct hci_dev *hdev, u16 cid) goto create_chan; } - smp = kzalloc(sizeof(*smp), GFP_KERNEL); + smp = kzalloc_obj(*smp, GFP_KERNEL); if (!smp) return ERR_PTR(-ENOMEM); diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c index 812457819b5a..52117422e0f2 100644 --- a/net/bpf/bpf_dummy_struct_ops.c +++ b/net/bpf/bpf_dummy_struct_ops.c @@ -36,7 +36,7 @@ dummy_ops_init_args(const union bpf_attr *kattr, unsigned int nr) if (size_in != sizeof(u64) * nr) return ERR_PTR(-EINVAL); - args = kzalloc(sizeof(*args), GFP_KERNEL); + args = kzalloc_obj(*args, GFP_KERNEL); if (!args) return ERR_PTR(-ENOMEM); @@ -158,13 +158,13 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr, if (err) goto out; - tlinks = kcalloc(BPF_TRAMP_MAX, sizeof(*tlinks), GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); if (!tlinks) { err = -ENOMEM; goto out; } - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto out; diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c index c2c1c7d44c61..a2276ce350fa 100644 --- a/net/bridge/br_cfm.c +++ b/net/bridge/br_cfm.c @@ -547,7 +547,7 @@ int br_cfm_mep_create(struct net_bridge *br, } } - mep = kzalloc(sizeof(*mep), GFP_KERNEL); + mep = kzalloc_obj(*mep, GFP_KERNEL); if (!mep) return -ENOMEM; @@ -693,7 +693,7 @@ int br_cfm_cc_peer_mep_add(struct net_bridge *br, const u32 instance, return -EEXIST; } - peer_mep = kzalloc(sizeof(*peer_mep), GFP_KERNEL); + peer_mep = kzalloc_obj(*peer_mep, GFP_KERNEL); if (!peer_mep) return -ENOMEM; diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index a818fdc22da9..1a3bcb5dd955 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -308,7 +308,7 @@ static int __br_netpoll_enable(struct net_bridge_port *p) struct netpoll *np; int err; - np = kzalloc(sizeof(*p->np), GFP_KERNEL); + np = kzalloc_obj(*p->np, GFP_KERNEL); if (!np) return -ENOMEM; diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 4c67a32745f6..4737ee16bebb 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -429,7 +429,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, if (index < 0) return ERR_PTR(index); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (p == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 6bc0a11f2ed3..7245ca29c5ea 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c @@ -204,7 +204,7 @@ int br_dev_siocdevprivate(struct net_device *dev, struct ifreq *rq, if (num > BR_MAX_PORTS) num = BR_MAX_PORTS; - indices = kcalloc(num, sizeof(int), GFP_KERNEL); + indices = kzalloc_objs(int, num, GFP_KERNEL); if (indices == NULL) return -ENOMEM; @@ -357,7 +357,7 @@ static int old_deviceless(struct net *net, void __user *data) if (args[2] >= 2048) return -ENOMEM; - indices = kcalloc(args[2], sizeof(int), GFP_KERNEL); + indices = kzalloc_objs(int, args[2], GFP_KERNEL); if (indices == NULL) return -ENOMEM; diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 400eb872b403..a5f0b74b59f3 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -1133,8 +1133,8 @@ static int br_mdb_config_src_list_init(struct nlattr *src_list, return -EINVAL; } - cfg->src_entries = kcalloc(cfg->num_src_entries, - sizeof(struct br_mdb_src_entry), GFP_KERNEL); + cfg->src_entries = kzalloc_objs(struct br_mdb_src_entry, + cfg->num_src_entries, GFP_KERNEL); if (!cfg->src_entries) return -ENOMEM; diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c index 3c36fa24bc05..d587f99afef6 100644 --- a/net/bridge/br_mrp.c +++ b/net/bridge/br_mrp.c @@ -516,7 +516,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance) !br_mrp_unique_ifindex(br, instance->s_ifindex)) return -EINVAL; - mrp = kzalloc(sizeof(*mrp), GFP_KERNEL); + mrp = kzalloc_obj(*mrp, GFP_KERNEL); if (!mrp) return -ENOMEM; diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index b6a5147886ca..881d866d687a 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1290,7 +1290,7 @@ struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br, return ERR_PTR(-E2BIG); } - mp = kzalloc(sizeof(*mp), GFP_ATOMIC); + mp = kzalloc_obj(*mp, GFP_ATOMIC); if (unlikely(!mp)) return ERR_PTR(-ENOMEM); @@ -1381,7 +1381,7 @@ br_multicast_new_group_src(struct net_bridge_port_group *pg, struct br_ip *src_i #endif } - grp_src = kzalloc(sizeof(*grp_src), GFP_ATOMIC); + grp_src = kzalloc_obj(*grp_src, GFP_ATOMIC); if (unlikely(!grp_src)) return NULL; @@ -1414,7 +1414,7 @@ struct net_bridge_port_group *br_multicast_new_port_group( if (err) return NULL; - p = kzalloc(sizeof(*p), GFP_ATOMIC); + p = kzalloc_obj(*p, GFP_ATOMIC); if (unlikely(!p)) { NL_SET_ERR_MSG_MOD(extack, "Couldn't allocate new port group"); goto dec_out; @@ -4891,7 +4891,7 @@ int br_multicast_list_adjacent(struct net_device *dev, continue; hlist_for_each_entry_rcu(group, &port->mglist, mglist) { - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) goto unlock; diff --git a/net/bridge/br_multicast_eht.c b/net/bridge/br_multicast_eht.c index adfd74102019..18eaf9c0dada 100644 --- a/net/bridge/br_multicast_eht.c +++ b/net/bridge/br_multicast_eht.c @@ -266,7 +266,7 @@ __eht_lookup_create_host(struct net_bridge_port_group *pg, if (br_multicast_eht_hosts_over_limit(pg)) return NULL; - eht_host = kzalloc(sizeof(*eht_host), GFP_ATOMIC); + eht_host = kzalloc_obj(*eht_host, GFP_ATOMIC); if (!eht_host) return NULL; @@ -313,7 +313,7 @@ __eht_lookup_create_set_entry(struct net_bridge *br, if (!allow_zero_src && eht_host->num_entries >= PG_SRC_ENT_LIMIT) return NULL; - set_h = kzalloc(sizeof(*set_h), GFP_ATOMIC); + set_h = kzalloc_obj(*set_h, GFP_ATOMIC); if (!set_h) return NULL; @@ -360,7 +360,7 @@ __eht_lookup_create_set(struct net_bridge_port_group *pg, return this; } - eht_set = kzalloc(sizeof(*eht_set), GFP_ATOMIC); + eht_set = kzalloc_obj(*eht_set, GFP_ATOMIC); if (!eht_set) return NULL; diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c index fe3f7bbe86ee..4fac002922d2 100644 --- a/net/bridge/br_switchdev.c +++ b/net/bridge/br_switchdev.c @@ -661,7 +661,7 @@ void br_switchdev_mdb_notify(struct net_device *dev, mdb.obj.orig_dev = pg->key.port->dev; switch (type) { case RTM_NEWMDB: - complete_info = kmalloc(sizeof(*complete_info), GFP_ATOMIC); + complete_info = kmalloc_obj(*complete_info, GFP_ATOMIC); if (!complete_info) break; complete_info->port = pg->key.port; diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index ce72b837ff8e..e3a5eb9e6ed1 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -787,7 +787,7 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags, bool *changed, return br_vlan_add_existing(br, vg, vlan, flags, changed, extack); - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; @@ -1224,7 +1224,7 @@ int br_vlan_init(struct net_bridge *br) struct net_bridge_vlan_group *vg; int ret = -ENOMEM; - vg = kzalloc(sizeof(*vg), GFP_KERNEL); + vg = kzalloc_obj(*vg, GFP_KERNEL); if (!vg) goto out; ret = rhashtable_init(&vg->vlan_hash, &br_vlan_rht_params); @@ -1260,7 +1260,7 @@ int nbp_vlan_init(struct net_bridge_port *p, struct netlink_ext_ack *extack) struct net_bridge_vlan_group *vg; int ret = -ENOMEM; - vg = kzalloc(sizeof(struct net_bridge_vlan_group), GFP_KERNEL); + vg = kzalloc_obj(struct net_bridge_vlan_group, GFP_KERNEL); if (!vg) goto out; @@ -1334,7 +1334,7 @@ int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags, return 0; } - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index a04fc1757528..f01efd0b139e 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -1303,7 +1303,7 @@ int ebt_register_template(const struct ebt_table *t, int (*table_init)(struct ne } } - tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); if (!tmpl) { mutex_unlock(&ebt_mutex); return -ENOMEM; diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 24e85c5487ef..18f7769405f9 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -94,7 +94,7 @@ static struct caif_device_entry *caif_device_alloc(struct net_device *dev) { struct caif_device_entry *caifd; - caifd = kzalloc(sizeof(*caifd), GFP_KERNEL); + caifd = kzalloc_obj(*caifd, GFP_KERNEL); if (!caifd) return NULL; caifd->pcpu_refcnt = alloc_percpu(int); diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c index 5dc05a1e3178..4d44960d4c2f 100644 --- a/net/caif/caif_usb.c +++ b/net/caif/caif_usb.c @@ -85,7 +85,7 @@ static void cfusbl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, static struct cflayer *cfusbl_create(int phyid, const u8 ethaddr[ETH_ALEN], u8 braddr[ETH_ALEN]) { - struct cfusbl *this = kmalloc(sizeof(struct cfusbl), GFP_ATOMIC); + struct cfusbl *this = kmalloc_obj(struct cfusbl, GFP_ATOMIC); if (!this) return NULL; diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 52509e185960..8a80914783e8 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c @@ -77,7 +77,7 @@ struct cfcnfg *cfcnfg_create(void) might_sleep(); /* Initiate this layer */ - this = kzalloc(sizeof(struct cfcnfg), GFP_ATOMIC); + this = kzalloc_obj(struct cfcnfg, GFP_ATOMIC); if (!this) return NULL; this->mux = cfmuxl_create(); @@ -477,7 +477,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, goto out; got_phyid: - phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC); + phyinfo = kzalloc_obj(struct cfcnfg_phyinfo, GFP_ATOMIC); if (!phyinfo) { res = -ENOMEM; goto out; diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c index 2aa1e7d46eb2..566546da4152 100644 --- a/net/caif/cfctrl.c +++ b/net/caif/cfctrl.c @@ -36,7 +36,7 @@ struct cflayer *cfctrl_create(void) { struct dev_info dev_info; struct cfctrl *this = - kzalloc(sizeof(struct cfctrl), GFP_ATOMIC); + kzalloc_obj(struct cfctrl, GFP_ATOMIC); if (!this) return NULL; caif_assert(offsetof(struct cfctrl, serv.layer) == 0); @@ -270,7 +270,7 @@ int cfctrl_linkup_request(struct cflayer *layer, cfpkt_destroy(pkt); return -EINVAL; } - req = kzalloc(sizeof(*req), GFP_KERNEL); + req = kzalloc_obj(*req, GFP_KERNEL); if (!req) { cfpkt_destroy(pkt); return -ENOMEM; diff --git a/net/caif/cfdbgl.c b/net/caif/cfdbgl.c index 77f428428b47..57ad3f82e004 100644 --- a/net/caif/cfdbgl.c +++ b/net/caif/cfdbgl.c @@ -19,7 +19,7 @@ static int cfdbgl_transmit(struct cflayer *layr, struct cfpkt *pkt); struct cflayer *cfdbgl_create(u8 channel_id, struct dev_info *dev_info) { - struct cfsrvl *dbg = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); + struct cfsrvl *dbg = kzalloc_obj(struct cfsrvl, GFP_ATOMIC); if (!dbg) return NULL; caif_assert(offsetof(struct cfsrvl, layer) == 0); diff --git a/net/caif/cfdgml.c b/net/caif/cfdgml.c index eb6f8ef47a79..c451ddd155a7 100644 --- a/net/caif/cfdgml.c +++ b/net/caif/cfdgml.c @@ -26,7 +26,7 @@ static int cfdgml_transmit(struct cflayer *layr, struct cfpkt *pkt); struct cflayer *cfdgml_create(u8 channel_id, struct dev_info *dev_info) { - struct cfsrvl *dgm = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); + struct cfsrvl *dgm = kzalloc_obj(struct cfsrvl, GFP_ATOMIC); if (!dgm) return NULL; caif_assert(offsetof(struct cfsrvl, layer) == 0); diff --git a/net/caif/cffrml.c b/net/caif/cffrml.c index d4d63586053a..0f4979d89fcb 100644 --- a/net/caif/cffrml.c +++ b/net/caif/cffrml.c @@ -34,7 +34,7 @@ static u32 cffrml_rcv_error; static u32 cffrml_rcv_checsum_error; struct cflayer *cffrml_create(u16 phyid, bool use_fcs) { - struct cffrml *this = kzalloc(sizeof(struct cffrml), GFP_ATOMIC); + struct cffrml *this = kzalloc_obj(struct cffrml, GFP_ATOMIC); if (!this) return NULL; this->pcpu_refcnt = alloc_percpu(int); diff --git a/net/caif/cfmuxl.c b/net/caif/cfmuxl.c index 4172b0d0db63..77a1f31639b7 100644 --- a/net/caif/cfmuxl.c +++ b/net/caif/cfmuxl.c @@ -47,7 +47,7 @@ static struct cflayer *get_up(struct cfmuxl *muxl, u16 id); struct cflayer *cfmuxl_create(void) { - struct cfmuxl *this = kzalloc(sizeof(struct cfmuxl), GFP_ATOMIC); + struct cfmuxl *this = kzalloc_obj(struct cfmuxl, GFP_ATOMIC); if (!this) return NULL; diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c index 3c335057f255..93732ebbd1e2 100644 --- a/net/caif/cfrfml.c +++ b/net/caif/cfrfml.c @@ -46,7 +46,7 @@ struct cflayer *cfrfml_create(u8 channel_id, struct dev_info *dev_info, int mtu_size) { int tmp; - struct cfrfml *this = kzalloc(sizeof(struct cfrfml), GFP_ATOMIC); + struct cfrfml *this = kzalloc_obj(struct cfrfml, GFP_ATOMIC); if (!this) return NULL; diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c index aee11c74d3c8..faf78fb754e2 100644 --- a/net/caif/cfserl.c +++ b/net/caif/cfserl.c @@ -38,7 +38,7 @@ void cfserl_release(struct cflayer *layer) struct cflayer *cfserl_create(int instance, bool use_stx) { - struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC); + struct cfserl *this = kzalloc_obj(struct cfserl, GFP_ATOMIC); if (!this) return NULL; caif_assert(offsetof(struct cfserl, layer) == 0); diff --git a/net/caif/cfutill.c b/net/caif/cfutill.c index b2e47ede912f..5111090bb2c0 100644 --- a/net/caif/cfutill.c +++ b/net/caif/cfutill.c @@ -26,7 +26,7 @@ static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt); struct cflayer *cfutill_create(u8 channel_id, struct dev_info *dev_info) { - struct cfsrvl *util = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); + struct cfsrvl *util = kzalloc_obj(struct cfsrvl, GFP_ATOMIC); if (!util) return NULL; caif_assert(offsetof(struct cfsrvl, layer) == 0); diff --git a/net/caif/cfveil.c b/net/caif/cfveil.c index db2274b94a5d..53f844c49bbb 100644 --- a/net/caif/cfveil.c +++ b/net/caif/cfveil.c @@ -25,7 +25,7 @@ static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt); struct cflayer *cfvei_create(u8 channel_id, struct dev_info *dev_info) { - struct cfsrvl *vei = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); + struct cfsrvl *vei = kzalloc_obj(struct cfsrvl, GFP_ATOMIC); if (!vei) return NULL; caif_assert(offsetof(struct cfsrvl, layer) == 0); diff --git a/net/caif/cfvidl.c b/net/caif/cfvidl.c index 134bad43196c..39e075b0a259 100644 --- a/net/caif/cfvidl.c +++ b/net/caif/cfvidl.c @@ -21,7 +21,7 @@ static int cfvidl_transmit(struct cflayer *layr, struct cfpkt *pkt); struct cflayer *cfvidl_create(u8 channel_id, struct dev_info *dev_info) { - struct cfsrvl *vid = kzalloc(sizeof(struct cfsrvl), GFP_ATOMIC); + struct cfsrvl *vid = kzalloc_obj(struct cfsrvl, GFP_ATOMIC); if (!vid) return NULL; caif_assert(offsetof(struct cfsrvl, layer) == 0); diff --git a/net/can/af_can.c b/net/can/af_can.c index 22c65a014861..6fa0dd649d0c 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -798,14 +798,15 @@ EXPORT_SYMBOL(can_proto_unregister); static int can_pernet_init(struct net *net) { spin_lock_init(&net->can.rcvlists_lock); - net->can.rx_alldev_list = - kzalloc(sizeof(*net->can.rx_alldev_list), GFP_KERNEL); + net->can.rx_alldev_list = kzalloc_obj(*net->can.rx_alldev_list, + GFP_KERNEL); if (!net->can.rx_alldev_list) goto out; - net->can.pkg_stats = kzalloc(sizeof(*net->can.pkg_stats), GFP_KERNEL); + net->can.pkg_stats = kzalloc_obj(*net->can.pkg_stats, GFP_KERNEL); if (!net->can.pkg_stats) goto out_free_rx_alldev_list; - net->can.rcv_lists_stats = kzalloc(sizeof(*net->can.rcv_lists_stats), GFP_KERNEL); + net->can.rcv_lists_stats = kzalloc_obj(*net->can.rcv_lists_stats, + GFP_KERNEL); if (!net->can.rcv_lists_stats) goto out_free_pkg_stats; diff --git a/net/can/gw.c b/net/can/gw.c index 61a1e6b1b83f..c6cf4cb72891 100644 --- a/net/can/gw.c +++ b/net/can/gw.c @@ -1099,7 +1099,7 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh, if (r->gwtype != CGW_TYPE_CAN_CAN) return -EINVAL; - mod = kmalloc(sizeof(*mod), GFP_KERNEL); + mod = kmalloc_obj(*mod, GFP_KERNEL); if (!mod) return -ENOMEM; diff --git a/net/can/j1939/bus.c b/net/can/j1939/bus.c index 797719cb227e..dc374286eeb6 100644 --- a/net/can/j1939/bus.c +++ b/net/can/j1939/bus.c @@ -151,7 +151,7 @@ struct j1939_ecu *j1939_ecu_create_locked(struct j1939_priv *priv, name_t name) lockdep_assert_held(&priv->lock); - ecu = kzalloc(sizeof(*ecu), gfp_any()); + ecu = kzalloc_obj(*ecu, gfp_any()); if (!ecu) return ERR_PTR(-ENOMEM); kref_init(&ecu->kref); diff --git a/net/can/j1939/main.c b/net/can/j1939/main.c index a93af55df5fd..45b718c680e0 100644 --- a/net/can/j1939/main.c +++ b/net/can/j1939/main.c @@ -128,7 +128,7 @@ static struct j1939_priv *j1939_priv_create(struct net_device *ndev) { struct j1939_priv *priv; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return NULL; diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index 2cbe94fc487a..df93d57907da 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -1508,7 +1508,7 @@ static struct j1939_session *j1939_session_new(struct j1939_priv *priv, struct j1939_session *session; struct j1939_sk_buff_cb *skcb; - session = kzalloc(sizeof(*session), gfp_any()); + session = kzalloc_obj(*session, gfp_any()); if (!session) return NULL; diff --git a/net/ceph/auth.c b/net/ceph/auth.c index d38c9eadbe2f..343c841784ce 100644 --- a/net/ceph/auth.c +++ b/net/ceph/auth.c @@ -59,7 +59,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, { struct ceph_auth_client *ac; - ac = kzalloc(sizeof(*ac), GFP_NOFS); + ac = kzalloc_obj(*ac, GFP_NOFS); if (!ac) return ERR_PTR(-ENOMEM); diff --git a/net/ceph/auth_none.c b/net/ceph/auth_none.c index 77b5519bc45f..99e1f3e10a4c 100644 --- a/net/ceph/auth_none.c +++ b/net/ceph/auth_none.c @@ -97,7 +97,7 @@ static int ceph_auth_none_create_authorizer( struct ceph_none_authorizer *au; int ret; - au = kmalloc(sizeof(*au), GFP_NOFS); + au = kmalloc_obj(*au, GFP_NOFS); if (!au) return -ENOMEM; @@ -133,7 +133,7 @@ int ceph_auth_none_init(struct ceph_auth_client *ac) struct ceph_auth_none_info *xi; dout("ceph_auth_none_init %p\n", ac); - xi = kzalloc(sizeof(*xi), GFP_NOFS); + xi = kzalloc_obj(*xi, GFP_NOFS); if (!xi) return -ENOMEM; diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index 13b3df9af0ac..692e0b868822 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c @@ -166,7 +166,7 @@ get_ticket_handler(struct ceph_auth_client *ac, int service) } /* add it */ - th = kzalloc(sizeof(*th), GFP_NOFS); + th = kzalloc_obj(*th, GFP_NOFS); if (!th) return ERR_PTR(-ENOMEM); th->service = service; @@ -808,7 +808,7 @@ static int ceph_x_create_authorizer( if (IS_ERR(th)) return PTR_ERR(th); - au = kzalloc(sizeof(*au), GFP_NOFS); + au = kzalloc_obj(*au, GFP_NOFS); if (!au) return -ENOMEM; @@ -1174,7 +1174,7 @@ int ceph_x_init(struct ceph_auth_client *ac) int ret; dout("ceph_x_init %p\n", ac); - xi = kzalloc(sizeof(*xi), GFP_NOFS); + xi = kzalloc_obj(*xi, GFP_NOFS); if (!xi) return -ENOMEM; diff --git a/net/ceph/buffer.c b/net/ceph/buffer.c index 7e51f128045d..98c2ac4387ae 100644 --- a/net/ceph/buffer.c +++ b/net/ceph/buffer.c @@ -13,7 +13,7 @@ struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp) { struct ceph_buffer *b; - b = kmalloc(sizeof(*b), gfp); + b = kmalloc_obj(*b, gfp); if (!b) return NULL; diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index e734e57be083..455787422784 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -309,13 +309,12 @@ struct ceph_options *ceph_alloc_options(void) { struct ceph_options *opt; - opt = kzalloc(sizeof(*opt), GFP_KERNEL); + opt = kzalloc_obj(*opt, GFP_KERNEL); if (!opt) return NULL; opt->crush_locs = RB_ROOT; - opt->mon_addr = kcalloc(CEPH_MAX_MON, sizeof(*opt->mon_addr), - GFP_KERNEL); + opt->mon_addr = kzalloc_objs(*opt->mon_addr, CEPH_MAX_MON, GFP_KERNEL); if (!opt->mon_addr) { kfree(opt); return NULL; @@ -456,7 +455,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, ceph_crypto_key_destroy(opt->key); kfree(opt->key); - opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); + opt->key = kzalloc_obj(*opt->key, GFP_KERNEL); if (!opt->key) return -ENOMEM; err = ceph_crypto_key_unarmor(opt->key, param->string); @@ -469,7 +468,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, ceph_crypto_key_destroy(opt->key); kfree(opt->key); - opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); + opt->key = kzalloc_obj(*opt->key, GFP_KERNEL); if (!opt->key) return -ENOMEM; return get_secret(opt->key, param->string, &log); @@ -714,7 +713,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private) if (err < 0) return ERR_PTR(err); - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (client == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/ceph/cls_lock_client.c b/net/ceph/cls_lock_client.c index 66136a4c1ce7..c6956f1df333 100644 --- a/net/ceph/cls_lock_client.c +++ b/net/ceph/cls_lock_client.c @@ -300,7 +300,7 @@ static int decode_lockers(void **p, void *end, u8 *type, char **tag, return ret; *num_lockers = ceph_decode_32(p); - *lockers = kcalloc(*num_lockers, sizeof(**lockers), GFP_NOIO); + *lockers = kzalloc_objs(**lockers, *num_lockers, GFP_NOIO); if (!*lockers) return -ENOMEM; diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index b2067ea6c38a..ef8a98c1174f 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -466,7 +466,7 @@ static int ceph_key_preparse(struct key_preparsed_payload *prep) goto err; ret = -ENOMEM; - ckey = kzalloc(sizeof(*ckey), GFP_KERNEL); + ckey = kzalloc_obj(*ckey, GFP_KERNEL); if (!ckey) goto err; diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 70b25f4ecba6..108adb583744 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1993,8 +1993,7 @@ struct ceph_msg *ceph_msg_new2(int type, int front_len, int max_data_items, m->front_alloc_len = m->front.iov_len = front_len; if (max_data_items) { - m->data = kmalloc_array(max_data_items, sizeof(*m->data), - flags); + m->data = kmalloc_objs(*m->data, max_data_items, flags); if (!m->data) goto out2; diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index fa8dd2a20f7d..2e2fd241dd19 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -117,7 +117,7 @@ static struct ceph_monmap *ceph_monmap_decode(void **p, void *end, bool msgr2) if (num_mon > CEPH_MAX_MON) goto e_inval; - monmap = kmalloc(struct_size(monmap, mon_inst, num_mon), GFP_NOIO); + monmap = kmalloc_flex(*monmap, mon_inst, num_mon, GFP_NOIO); if (!monmap) { ret = -ENOMEM; goto fail; @@ -611,7 +611,7 @@ alloc_generic_request(struct ceph_mon_client *monc, gfp_t gfp) { struct ceph_mon_generic_request *req; - req = kzalloc(sizeof(*req), gfp); + req = kzalloc_obj(*req, gfp); if (!req) return NULL; @@ -1140,8 +1140,8 @@ static int build_initial_monmap(struct ceph_mon_client *monc) int i; /* build initial monmap */ - monc->monmap = kzalloc(struct_size(monc->monmap, mon_inst, num_mon), - GFP_KERNEL); + monc->monmap = kzalloc_flex(*monc->monmap, mon_inst, num_mon, + GFP_KERNEL); if (!monc->monmap) return -ENOMEM; monc->monmap->num_mon = num_mon; diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 610e584524d1..2ff00070c181 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -556,7 +556,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, req = kmem_cache_alloc(ceph_osd_request_cache, gfp_flags); } else { BUG_ON(num_ops > CEPH_OSD_MAX_OPS); - req = kmalloc(struct_size(req, r_ops, num_ops), gfp_flags); + req = kmalloc_flex(*req, r_ops, num_ops, gfp_flags); } if (unlikely(!req)) return NULL; @@ -1153,9 +1153,8 @@ int __ceph_alloc_sparse_ext_map(struct ceph_osd_req_op *op, int cnt) WARN_ON(op->op != CEPH_OSD_OP_SPARSE_READ); op->extent.sparse_ext_cnt = cnt; - op->extent.sparse_ext = kmalloc_array(cnt, - sizeof(*op->extent.sparse_ext), - GFP_NOFS); + op->extent.sparse_ext = kmalloc_objs(*op->extent.sparse_ext, cnt, + GFP_NOFS); if (!op->extent.sparse_ext) return -ENOMEM; return 0; @@ -1264,7 +1263,7 @@ static struct ceph_osd *create_osd(struct ceph_osd_client *osdc, int onum) WARN_ON(onum == CEPH_HOMELESS_OSD); - osd = kzalloc(sizeof(*osd), GFP_NOIO | __GFP_NOFAIL); + osd = kzalloc_obj(*osd, GFP_NOIO | __GFP_NOFAIL); osd_init(osd); osd->o_osdc = osdc; osd->o_osd = onum; @@ -1718,7 +1717,7 @@ static struct ceph_spg_mapping *alloc_spg_mapping(void) { struct ceph_spg_mapping *spg; - spg = kmalloc(sizeof(*spg), GFP_NOIO); + spg = kmalloc_obj(*spg, GFP_NOIO); if (!spg) return NULL; @@ -1913,7 +1912,7 @@ static struct ceph_osd_backoff *alloc_backoff(void) { struct ceph_osd_backoff *backoff; - backoff = kzalloc(sizeof(*backoff), GFP_NOIO); + backoff = kzalloc_obj(*backoff, GFP_NOIO); if (!backoff) return NULL; @@ -2806,7 +2805,7 @@ linger_alloc(struct ceph_osd_client *osdc) { struct ceph_osd_linger_request *lreq; - lreq = kzalloc(sizeof(*lreq), GFP_NOIO); + lreq = kzalloc_obj(*lreq, GFP_NOIO); if (!lreq) return NULL; @@ -2948,7 +2947,7 @@ static struct linger_work *lwork_alloc(struct ceph_osd_linger_request *lreq, { struct linger_work *lwork; - lwork = kzalloc(sizeof(*lwork), GFP_NOIO); + lwork = kzalloc_obj(*lwork, GFP_NOIO); if (!lwork) return NULL; @@ -4329,7 +4328,7 @@ static int decode_MOSDBackoff(const struct ceph_msg *msg, struct MOSDBackoff *m) ceph_decode_8_safe(&p, end, m->op, e_inval); ceph_decode_64_safe(&p, end, m->id, e_inval); - m->begin = kzalloc(sizeof(*m->begin), GFP_NOIO); + m->begin = kzalloc_obj(*m->begin, GFP_NOIO); if (!m->begin) return -ENOMEM; @@ -4339,7 +4338,7 @@ static int decode_MOSDBackoff(const struct ceph_msg *msg, struct MOSDBackoff *m) return ret; } - m->end = kzalloc(sizeof(*m->end), GFP_NOIO); + m->end = kzalloc_obj(*m->end, GFP_NOIO); if (!m->end) { free_hoid(m->begin); return -ENOMEM; @@ -5032,7 +5031,7 @@ static int decode_watchers(void **p, void *end, return ret; *num_watchers = ceph_decode_32(p); - *watchers = kcalloc(*num_watchers, sizeof(**watchers), GFP_NOIO); + *watchers = kzalloc_objs(**watchers, *num_watchers, GFP_NOIO); if (!*watchers) return -ENOMEM; @@ -5832,9 +5831,8 @@ next_op: if (!sr->sr_extent || count > sr->sr_ext_len) { /* no extent array provided, or too short */ kfree(sr->sr_extent); - sr->sr_extent = kmalloc_array(count, - sizeof(*sr->sr_extent), - GFP_NOIO); + sr->sr_extent = kmalloc_objs(*sr->sr_extent, + count, GFP_NOIO); if (!sr->sr_extent) { pr_err("%s: failed to allocate %u extents\n", __func__, count); diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 92a44026de29..c89e66d4fcb7 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -231,7 +231,7 @@ static struct crush_choose_arg_map *alloc_choose_arg_map(void) { struct crush_choose_arg_map *arg_map; - arg_map = kzalloc(sizeof(*arg_map), GFP_NOIO); + arg_map = kzalloc_obj(*arg_map, GFP_NOIO); if (!arg_map) return NULL; @@ -320,9 +320,8 @@ static int decode_choose_arg(void **p, void *end, struct crush_choose_arg *arg) if (arg->weight_set_size) { u32 i; - arg->weight_set = kmalloc_array(arg->weight_set_size, - sizeof(*arg->weight_set), - GFP_NOIO); + arg->weight_set = kmalloc_objs(*arg->weight_set, + arg->weight_set_size, GFP_NOIO); if (!arg->weight_set) return -ENOMEM; @@ -368,8 +367,8 @@ static int decode_choose_args(void **p, void *end, struct crush_map *c) ceph_decode_64_safe(p, end, arg_map->choose_args_index, e_inval); arg_map->size = c->max_buckets; - arg_map->args = kcalloc(arg_map->size, sizeof(*arg_map->args), - GFP_NOIO); + arg_map->args = kzalloc_objs(*arg_map->args, arg_map->size, + GFP_NOIO); if (!arg_map->args) { ret = -ENOMEM; goto fail; @@ -443,7 +442,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end) dout("crush_decode %p to %p len %d\n", *p, end, (int)(end - *p)); - c = kzalloc(sizeof(*c), GFP_NOFS); + c = kzalloc_obj(*c, GFP_NOFS); if (c == NULL) return ERR_PTR(-ENOMEM); @@ -468,10 +467,10 @@ static struct crush_map *crush_decode(void *pbyval, void *end) c->max_rules = ceph_decode_32(p); c->max_devices = ceph_decode_32(p); - c->buckets = kcalloc(c->max_buckets, sizeof(*c->buckets), GFP_NOFS); + c->buckets = kzalloc_objs(*c->buckets, c->max_buckets, GFP_NOFS); if (c->buckets == NULL) goto badmem; - c->rules = kcalloc(c->max_rules, sizeof(*c->rules), GFP_NOFS); + c->rules = kzalloc_objs(*c->rules, c->max_rules, GFP_NOFS); if (c->rules == NULL) goto badmem; @@ -524,7 +523,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end) dout("crush_decode bucket size %d off %x %p to %p\n", b->size, (int)(*p-start), *p, end); - b->items = kcalloc(b->size, sizeof(__s32), GFP_NOFS); + b->items = kzalloc_objs(__s32, b->size, GFP_NOFS); if (b->items == NULL) goto badmem; @@ -590,7 +589,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end) / sizeof(struct crush_rule_step)) goto bad; #endif - r = kmalloc(struct_size(r, steps, yes), GFP_NOFS); + r = kmalloc_flex(*r, steps, yes, GFP_NOFS); if (r == NULL) goto badmem; dout(" rule %d is at %p\n", i, r); @@ -1116,7 +1115,7 @@ struct ceph_osdmap *ceph_osdmap_alloc(void) { struct ceph_osdmap *map; - map = kzalloc(sizeof(*map), GFP_NOIO); + map = kzalloc_obj(*map, GFP_NOIO); if (!map) return NULL; @@ -1343,7 +1342,7 @@ static int __decode_pools(void **p, void *end, struct ceph_osdmap *map, pi = lookup_pg_pool(&map->pg_pools, pool); if (!incremental || !pi) { - pi = kzalloc(sizeof(*pi), GFP_NOFS); + pi = kzalloc_obj(*pi, GFP_NOFS); if (!pi) return -ENOMEM; diff --git a/net/ceph/pagelist.c b/net/ceph/pagelist.c index 5a9c4be5f222..40847d873cff 100644 --- a/net/ceph/pagelist.c +++ b/net/ceph/pagelist.c @@ -10,7 +10,7 @@ struct ceph_pagelist *ceph_pagelist_alloc(gfp_t gfp_flags) { struct ceph_pagelist *pl; - pl = kmalloc(sizeof(*pl), gfp_flags); + pl = kmalloc_obj(*pl, gfp_flags); if (!pl) return NULL; diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 4509757d8b3b..858359873c4d 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c @@ -41,7 +41,7 @@ struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags) struct page **pages; int i; - pages = kmalloc_array(num_pages, sizeof(*pages), flags); + pages = kmalloc_objs(*pages, num_pages, flags); if (!pages) return ERR_PTR(-ENOMEM); for (i = 0; i < num_pages; i++) { diff --git a/net/ceph/striper.c b/net/ceph/striper.c index 3b3fa75d1189..2b8288858079 100644 --- a/net/ceph/striper.c +++ b/net/ceph/striper.c @@ -230,8 +230,8 @@ int ceph_extent_to_file(struct ceph_file_layout *l, *num_file_extents = DIV_ROUND_UP_ULL(objoff + objlen, l->stripe_unit) - DIV_ROUND_DOWN_ULL(objoff, l->stripe_unit); - *file_extents = kmalloc_array(*num_file_extents, sizeof(**file_extents), - GFP_NOIO); + *file_extents = kmalloc_objs(**file_extents, *num_file_extents, + GFP_NOIO); if (!*file_extents) return -ENOMEM; diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c index 1eb3e060994e..8165d606bfd4 100644 --- a/net/core/bpf_sk_storage.c +++ b/net/core/bpf_sk_storage.c @@ -500,7 +500,7 @@ bpf_sk_storage_diag_alloc(const struct nlattr *nla_stgs) nr_maps++; } - diag = kzalloc(struct_size(diag, maps, nr_maps), GFP_KERNEL); + diag = kzalloc_flex(*diag, maps, nr_maps, GFP_KERNEL); if (!diag) return ERR_PTR(-ENOMEM); diff --git a/net/core/dev.c b/net/core/dev.c index 096b3ff13f6b..525cf5952101 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -273,7 +273,7 @@ static struct netdev_name_node *netdev_name_node_alloc(struct net_device *dev, { struct netdev_name_node *name_node; - name_node = kmalloc(sizeof(*name_node), GFP_KERNEL); + name_node = kmalloc_obj(*name_node, GFP_KERNEL); if (!name_node) return NULL; INIT_HLIST_NODE(&name_node->hlist); @@ -6510,8 +6510,7 @@ struct flush_backlogs { static struct flush_backlogs *flush_backlogs_alloc(void) { - return kmalloc(struct_size_t(struct flush_backlogs, w, nr_cpu_ids), - GFP_KERNEL); + return kmalloc_flex(struct flush_backlogs, w, nr_cpu_ids, GFP_KERNEL); } static struct flush_backlogs *flush_backlogs_fallback; @@ -8694,7 +8693,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev, return 0; } - adj = kmalloc(sizeof(*adj), GFP_KERNEL); + adj = kmalloc_obj(*adj, GFP_KERNEL); if (!adj) return -ENOMEM; @@ -9134,8 +9133,8 @@ static int netdev_offload_xstats_enable_l3(struct net_device *dev, int err; int rc; - dev->offload_xstats_l3 = kzalloc(sizeof(*dev->offload_xstats_l3), - GFP_KERNEL); + dev->offload_xstats_l3 = kzalloc_obj(*dev->offload_xstats_l3, + GFP_KERNEL); if (!dev->offload_xstats_l3) return -ENOMEM; @@ -10660,7 +10659,7 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) return -EINVAL; } - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; goto unlock; @@ -11941,7 +11940,7 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev) #ifdef CONFIG_NET_CLS_ACT if (queue) return queue; - queue = kzalloc(sizeof(*queue), GFP_KERNEL); + queue = kzalloc_obj(*queue, GFP_KERNEL); if (!queue) return NULL; netdev_init_one_queue(dev, queue, NULL); @@ -12016,8 +12015,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, maxqs = max(txqs, rxqs); - dev = kvzalloc(struct_size(dev, priv, sizeof_priv), - GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); + dev = kvzalloc_flex(*dev, priv, sizeof_priv, + GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); if (!dev) return NULL; @@ -12088,11 +12087,11 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, dev->real_num_rx_queues = rxqs; if (netif_alloc_rx_queues(dev)) goto free_all; - dev->ethtool = kzalloc(sizeof(*dev->ethtool), GFP_KERNEL_ACCOUNT); + dev->ethtool = kzalloc_obj(*dev->ethtool, GFP_KERNEL_ACCOUNT); if (!dev->ethtool) goto free_all; - dev->cfg = kzalloc(sizeof(*dev->cfg), GFP_KERNEL_ACCOUNT); + dev->cfg = kzalloc_obj(*dev->cfg, GFP_KERNEL_ACCOUNT); if (!dev->cfg) goto free_all; dev->cfg_pending = dev->cfg; @@ -12858,7 +12857,7 @@ static struct hlist_head * __net_init netdev_create_hash(void) int i; struct hlist_head *hash; - hash = kmalloc_array(NETDEV_HASHENTRIES, sizeof(*hash), GFP_KERNEL); + hash = kmalloc_objs(*hash, NETDEV_HASHENTRIES, GFP_KERNEL); if (hash != NULL) for (i = 0; i < NETDEV_HASHENTRIES; i++) INIT_HLIST_HEAD(&hash[i]); diff --git a/net/core/devmem.c b/net/core/devmem.c index 63f093f7d2b2..16a1949dbed1 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -241,9 +241,9 @@ net_devmem_bind_dmabuf(struct net_device *dev, } if (direction == DMA_TO_DEVICE) { - binding->tx_vec = kvmalloc_array(dmabuf->size / PAGE_SIZE, - sizeof(struct net_iov *), - GFP_KERNEL); + binding->tx_vec = kvmalloc_objs(struct net_iov *, + dmabuf->size / PAGE_SIZE, + GFP_KERNEL); if (!binding->tx_vec) { err = -ENOMEM; goto err_unmap; @@ -289,9 +289,9 @@ net_devmem_bind_dmabuf(struct net_device *dev, goto err_free_chunks; } - owner->area.niovs = kvmalloc_array(owner->area.num_niovs, - sizeof(*owner->area.niovs), - GFP_KERNEL); + owner->area.niovs = kvmalloc_objs(*owner->area.niovs, + owner->area.num_niovs, + GFP_KERNEL); if (!owner->area.niovs) { err = -ENOMEM; goto err_free_chunks; diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 60d31c2feed3..99f9d4dfb866 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -306,8 +306,8 @@ net_dm_hw_reset_per_cpu_data(struct per_cpu_dm_data *hw_data) struct net_dm_hw_entries *hw_entries; unsigned long flags; - hw_entries = kzalloc(struct_size(hw_entries, entries, dm_hit_limit), - GFP_KERNEL); + hw_entries = kzalloc_flex(*hw_entries, entries, dm_hit_limit, + GFP_KERNEL); if (!hw_entries) { /* If the memory allocation failed, we try to perform another * allocation in 1/10 second. Otherwise, the probe function @@ -856,7 +856,7 @@ net_dm_hw_metadata_copy(const struct devlink_trap_metadata *metadata) const char *trap_group_name; const char *trap_name; - hw_metadata = kzalloc(sizeof(*hw_metadata), GFP_ATOMIC); + hw_metadata = kzalloc_obj(*hw_metadata, GFP_ATOMIC); if (!hw_metadata) return NULL; @@ -1583,7 +1583,7 @@ static int dropmon_net_event(struct notifier_block *ev_block, case NETDEV_REGISTER: if (WARN_ON_ONCE(rtnl_dereference(dev->dm_private))) break; - stat = kzalloc(sizeof(*stat), GFP_KERNEL); + stat = kzalloc_obj(*stat, GFP_KERNEL); if (!stat) break; diff --git a/net/core/dst.c b/net/core/dst.c index 1dae26c51ebe..092861133023 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -191,7 +191,7 @@ EXPORT_SYMBOL(dst_release_immediate); u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old) { - struct dst_metrics *p = kmalloc(sizeof(*p), GFP_ATOMIC); + struct dst_metrics *p = kmalloc_obj(*p, GFP_ATOMIC); if (p) { struct dst_metrics *old_p = (struct dst_metrics *)__DST_METRICS_PTR(old); @@ -295,8 +295,7 @@ struct metadata_dst *metadata_dst_alloc(u8 optslen, enum metadata_type type, { struct metadata_dst *md_dst; - md_dst = kmalloc(struct_size(md_dst, u.tun_info.options, optslen), - flags); + md_dst = kmalloc_flex(*md_dst, u.tun_info.options, optslen, flags); if (!md_dst) return NULL; diff --git a/net/core/failover.c b/net/core/failover.c index 2a140b3ea669..fcc04e6995d0 100644 --- a/net/core/failover.c +++ b/net/core/failover.c @@ -247,7 +247,7 @@ struct failover *failover_register(struct net_device *dev, if (dev->type != ARPHRD_ETHER) return ERR_PTR(-EINVAL); - failover = kzalloc(sizeof(*failover), GFP_KERNEL); + failover = kzalloc_obj(*failover, GFP_KERNEL); if (!failover) return ERR_PTR(-ENOMEM); diff --git a/net/core/filter.c b/net/core/filter.c index ba019ded773d..6957d3449f2c 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -600,8 +600,7 @@ static int bpf_convert_filter(struct sock_filter *prog, int len, if (new_prog) { first_insn = new_prog->insnsi; - addrs = kcalloc(len, sizeof(*addrs), - GFP_KERNEL | __GFP_NOWARN); + addrs = kzalloc_objs(*addrs, len, GFP_KERNEL | __GFP_NOWARN); if (!addrs) return -ENOMEM; } @@ -1162,7 +1161,7 @@ static int bpf_prog_store_orig_filter(struct bpf_prog *fp, unsigned int fsize = bpf_classic_proglen(fprog); struct sock_fprog_kern *fkprog; - fp->orig_prog = kmalloc(sizeof(*fkprog), GFP_KERNEL); + fp->orig_prog = kmalloc_obj(*fkprog, GFP_KERNEL); if (!fp->orig_prog) return -ENOMEM; @@ -1482,7 +1481,7 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) { struct sk_filter *fp, *old_fp; - fp = kmalloc(sizeof(*fp), GFP_KERNEL); + fp = kmalloc_obj(*fp, GFP_KERNEL); if (!fp) return -ENOMEM; diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index bc5169482710..630f94e2c2c1 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -12,8 +12,7 @@ struct flow_rule *flow_rule_alloc(unsigned int num_actions) struct flow_rule *rule; int i; - rule = kzalloc(struct_size(rule, action.entries, num_actions), - GFP_KERNEL); + rule = kzalloc_flex(*rule, action.entries, num_actions, GFP_KERNEL); if (!rule) return NULL; @@ -33,8 +32,8 @@ struct flow_offload_action *offload_action_alloc(unsigned int num_actions) struct flow_offload_action *fl_action; int i; - fl_action = kzalloc(struct_size(fl_action, action.entries, num_actions), - GFP_KERNEL); + fl_action = kzalloc_flex(*fl_action, action.entries, num_actions, + GFP_KERNEL); if (!fl_action) return NULL; @@ -264,7 +263,7 @@ struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb, { struct flow_block_cb *block_cb; - block_cb = kzalloc(sizeof(*block_cb), GFP_KERNEL); + block_cb = kzalloc_obj(*block_cb, GFP_KERNEL); if (!block_cb) return ERR_PTR(-ENOMEM); @@ -391,7 +390,7 @@ static struct flow_indr_dev *flow_indr_dev_alloc(flow_indr_block_bind_cb_t *cb, { struct flow_indr_dev *indr_dev; - indr_dev = kmalloc(sizeof(*indr_dev), GFP_KERNEL); + indr_dev = kmalloc_obj(*indr_dev, GFP_KERNEL); if (!indr_dev) return NULL; @@ -571,7 +570,7 @@ static int indir_dev_add(void *data, struct net_device *dev, struct Qdisc *sch, if (info) return -EEXIST; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index f112156db587..64d0d55fa2b2 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -154,7 +154,7 @@ int gen_new_estimator(struct gnet_stats_basic_sync *bstats, if (parm->ewma_log == 0 || parm->ewma_log >= 31) return -EINVAL; - est = kzalloc(sizeof(*est), GFP_KERNEL); + est = kzalloc_obj(*est, GFP_KERNEL); if (!est) return -ENOBUFS; diff --git a/net/core/gro_cells.c b/net/core/gro_cells.c index a725d21159a6..1b84385c04bd 100644 --- a/net/core/gro_cells.c +++ b/net/core/gro_cells.c @@ -132,7 +132,7 @@ void gro_cells_destroy(struct gro_cells *gcells) * because we might be called from cleanup_net(), and we * definitely do not want to block this critical task. */ - defer = kmalloc(sizeof(*defer), GFP_KERNEL | __GFP_NOWARN); + defer = kmalloc_obj(*defer, GFP_KERNEL | __GFP_NOWARN); if (likely(defer)) { defer->ptr = gcells->cells; call_rcu(&defer->rcu, percpu_free_defer_callback); diff --git a/net/core/neighbour.c b/net/core/neighbour.c index e0897eb41c8d..a95cfe77f7f0 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -562,7 +562,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift) struct neigh_hash_table *ret; int i; - ret = kmalloc(sizeof(*ret), GFP_ATOMIC); + ret = kmalloc_obj(*ret, GFP_ATOMIC); if (!ret) return NULL; diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index aef44e617361..7a040a9233e7 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -492,7 +492,7 @@ static struct net *net_alloc(void) goto out_free; #ifdef CONFIG_KEYS - net->key_domain = kzalloc(sizeof(struct key_tag), GFP_KERNEL); + net->key_domain = kzalloc_obj(struct key_tag, GFP_KERNEL); if (!net->key_domain) goto out_free_2; refcount_set(&net->key_domain->usage, 1); diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c index db9a5354f9de..9267880a0a17 100644 --- a/net/core/netclassid_cgroup.c +++ b/net/core/netclassid_cgroup.c @@ -32,7 +32,7 @@ cgrp_css_alloc(struct cgroup_subsys_state *parent_css) { struct cgroup_cls_state *cs; - cs = kzalloc(sizeof(*cs), GFP_KERNEL); + cs = kzalloc_obj(*cs, GFP_KERNEL); if (!cs) return ERR_PTR(-ENOMEM); diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 09f72f10813c..70e458893ea5 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -565,7 +565,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev) npinfo = rtnl_dereference(ndev->npinfo); if (!npinfo) { - npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); + npinfo = kmalloc_obj(*npinfo, GFP_KERNEL); if (!npinfo) { err = -ENOMEM; goto out; diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 8456dfbe2eb4..fb3cd2886e1f 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c @@ -135,7 +135,7 @@ cgrp_css_alloc(struct cgroup_subsys_state *parent_css) { struct cgroup_subsys_state *css; - css = kzalloc(sizeof(*css), GFP_KERNEL); + css = kzalloc_obj(*css, GFP_KERNEL); if (!css) return ERR_PTR(-ENOMEM); diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index b1ed55141d8a..da268fc45356 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -414,7 +414,7 @@ static int rtnl_register_internal(struct module *owner, if (!link) goto unlock; } else { - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) goto unlock; } @@ -3969,7 +3969,7 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, int ops_srcu_index; int ret; - tbs = kmalloc(sizeof(*tbs), GFP_KERNEL); + tbs = kmalloc_obj(*tbs, GFP_KERNEL); if (!tbs) return -ENOMEM; diff --git a/net/core/scm.c b/net/core/scm.c index cd87f66671aa..a29aa8fb8065 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -83,7 +83,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) if (!fpl) { - fpl = kmalloc(sizeof(struct scm_fp_list), GFP_KERNEL_ACCOUNT); + fpl = kmalloc_obj(struct scm_fp_list, GFP_KERNEL_ACCOUNT); if (!fpl) return -ENOMEM; *fplp = fpl; diff --git a/net/core/selftests.c b/net/core/selftests.c index 8b81feb82c4a..248112bd51a8 100644 --- a/net/core/selftests.c +++ b/net/core/selftests.c @@ -237,7 +237,7 @@ static int __net_test_loopback(struct net_device *ndev, struct sk_buff *skb = NULL; int ret = 0; - tpriv = kzalloc(sizeof(*tpriv), GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); if (!tpriv) return -ENOMEM; diff --git a/net/core/skmsg.c b/net/core/skmsg.c index ddde93dd8bc6..2e26174c9919 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -522,7 +522,7 @@ static struct sk_msg *alloc_sk_msg(gfp_t gfp) { struct sk_msg *msg; - msg = kzalloc(sizeof(*msg), gfp | __GFP_NOWARN); + msg = kzalloc_obj(*msg, gfp | __GFP_NOWARN); if (unlikely(!msg)) return NULL; sg_init_marker(msg->sg.data, NR_MSG_FRAG_IDS); diff --git a/net/core/sock.c b/net/core/sock.c index 693e6d80f501..b62e509e06d9 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1097,7 +1097,7 @@ sock_devmem_dontneed(struct sock *sk, sockptr_t optval, unsigned int optlen) return -EINVAL; num_tokens = optlen / sizeof(*tokens); - tokens = kvmalloc_array(num_tokens, sizeof(*tokens), GFP_KERNEL); + tokens = kvmalloc_objs(*tokens, num_tokens, GFP_KERNEL); if (!tokens) return -ENOMEM; diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index 026ce9bd9e5e..c83335c62360 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c @@ -177,7 +177,7 @@ void sock_diag_broadcast_destroy(struct sock *sk) { /* Note, this function is often called from an interrupt context. */ struct broadcast_sk *bsk = - kmalloc(sizeof(struct broadcast_sk), GFP_ATOMIC); + kmalloc_obj(struct broadcast_sk, GFP_ATOMIC); if (!bsk) return sk_destruct(sk); bsk->sk = sk; diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 5947b38e4f8b..b0e96337a269 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -1858,7 +1858,7 @@ int sock_map_link_create(const union bpf_attr *attr, struct bpf_prog *prog) goto out; } - sockmap_link = kzalloc(sizeof(*sockmap_link), GFP_USER); + sockmap_link = kzalloc_obj(*sockmap_link, GFP_USER); if (!sockmap_link) { ret = -ENOMEM; goto out; diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c index 4211710393a8..29948cb44b7d 100644 --- a/net/core/sock_reuseport.c +++ b/net/core/sock_reuseport.c @@ -175,7 +175,7 @@ static struct sock_reuseport *__reuseport_alloc(unsigned int max_socks) { struct sock_reuseport *reuse; - reuse = kzalloc(struct_size(reuse, socks, max_socks), GFP_ATOMIC); + reuse = kzalloc_flex(*reuse, socks, max_socks, GFP_ATOMIC); if (!reuse) return NULL; diff --git a/net/core/xdp.c b/net/core/xdp.c index fee6d080ee85..8c65d7dafd89 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -214,7 +214,7 @@ static int __mem_id_init_hash_table(void) if (unlikely(mem_id_init)) return 0; - rht = kzalloc(sizeof(*rht), GFP_KERNEL); + rht = kzalloc_obj(*rht, GFP_KERNEL); if (!rht) return -ENOMEM; @@ -297,7 +297,7 @@ static struct xdp_mem_allocator *__xdp_reg_mem_model(struct xdp_mem_info *mem, return ERR_PTR(ret); } - xdp_alloc = kzalloc(sizeof(*xdp_alloc), gfp); + xdp_alloc = kzalloc_obj(*xdp_alloc, gfp); if (!xdp_alloc) return ERR_PTR(-ENOMEM); diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 03eb1d941fca..ff2198133213 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1021,8 +1021,7 @@ static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb, */ err = ops->peer_getappinfo(netdev, &info, &app_count); if (!err && app_count) { - table = kmalloc_array(app_count, sizeof(struct dcb_app), - GFP_KERNEL); + table = kmalloc_objs(struct dcb_app, app_count, GFP_KERNEL); if (!table) return -ENOMEM; @@ -2004,7 +2003,7 @@ static int dcb_app_add(struct list_head *list, const struct dcb_app *app, { struct dcb_app_type *entry; - entry = kmalloc(sizeof(*entry), GFP_ATOMIC); + entry = kmalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; diff --git a/net/devlink/core.c b/net/devlink/core.c index da56e2b8afc1..44584f3613ca 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -111,7 +111,7 @@ static struct devlink_rel *devlink_rel_alloc(void) static u32 next; int err; - rel = kzalloc(sizeof(*rel), GFP_KERNEL); + rel = kzalloc_obj(*rel, GFP_KERNEL); if (!rel) return ERR_PTR(-ENOMEM); @@ -418,7 +418,7 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops, if (!devlink_reload_actions_valid(ops)) return NULL; - devlink = kvzalloc(struct_size(devlink, priv, priv_size), GFP_KERNEL); + devlink = kvzalloc_flex(*devlink, priv, priv_size, GFP_KERNEL); if (!devlink) return NULL; diff --git a/net/devlink/dpipe.c b/net/devlink/dpipe.c index e55701b007f0..3b86dc25e7f2 100644 --- a/net/devlink/dpipe.c +++ b/net/devlink/dpipe.c @@ -851,7 +851,7 @@ int devl_dpipe_table_register(struct devlink *devlink, devlink)) return -EEXIST; - table = kzalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc_obj(*table, GFP_KERNEL); if (!table) return -ENOMEM; diff --git a/net/devlink/health.c b/net/devlink/health.c index 136a67c36a20..0578f7b460f5 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -32,7 +32,7 @@ static struct devlink_fmsg *devlink_fmsg_alloc(void) { struct devlink_fmsg *fmsg; - fmsg = kzalloc(sizeof(*fmsg), GFP_KERNEL); + fmsg = kzalloc_obj(*fmsg, GFP_KERNEL); if (!fmsg) return NULL; @@ -119,7 +119,7 @@ __devlink_health_reporter_create(struct devlink *devlink, if (WARN_ON(ops->default_burst_period && !ops->default_graceful_period)) return ERR_PTR(-EINVAL); - reporter = kzalloc(sizeof(*reporter), GFP_KERNEL); + reporter = kzalloc_obj(*reporter, GFP_KERNEL); if (!reporter) return ERR_PTR(-ENOMEM); @@ -738,7 +738,7 @@ static void devlink_fmsg_nest_common(struct devlink_fmsg *fmsg, int attrtype) if (fmsg->err) return; - item = kzalloc(sizeof(*item), GFP_KERNEL); + item = kzalloc_obj(*item, GFP_KERNEL); if (!item) { fmsg->err = -ENOMEM; return; diff --git a/net/devlink/linecard.c b/net/devlink/linecard.c index 67f70a621d27..110f1347b9c6 100644 --- a/net/devlink/linecard.c +++ b/net/devlink/linecard.c @@ -404,8 +404,7 @@ static int devlink_linecard_types_init(struct devlink_linecard *linecard) int i; count = linecard->ops->types_count(linecard, linecard->priv); - linecard->types = kmalloc_array(count, sizeof(*linecard_type), - GFP_KERNEL); + linecard->types = kmalloc_objs(*linecard_type, count, GFP_KERNEL); if (!linecard->types) return -ENOMEM; linecard->types_count = count; @@ -451,7 +450,7 @@ devl_linecard_create(struct devlink *devlink, unsigned int linecard_index, if (devlink_linecard_index_exists(devlink, linecard_index)) return ERR_PTR(-EEXIST); - linecard = kzalloc(sizeof(*linecard), GFP_KERNEL); + linecard = kzalloc_obj(*linecard, GFP_KERNEL); if (!linecard) return ERR_PTR(-ENOMEM); diff --git a/net/devlink/param.c b/net/devlink/param.c index e0ea93eded43..74adb0fdb5f7 100644 --- a/net/devlink/param.c +++ b/net/devlink/param.c @@ -718,7 +718,7 @@ static int devlink_param_register(struct devlink *devlink, else WARN_ON(!param->get || !param->set); - param_item = kzalloc(sizeof(*param_item), GFP_KERNEL); + param_item = kzalloc_obj(*param_item, GFP_KERNEL); if (!param_item) return -ENOMEM; diff --git a/net/devlink/rate.c b/net/devlink/rate.c index 0d68b5c477dc..8d8a688ad140 100644 --- a/net/devlink/rate.c +++ b/net/devlink/rate.c @@ -627,7 +627,7 @@ int devlink_nl_rate_new_doit(struct sk_buff *skb, struct genl_info *info) else if (rate_node == ERR_PTR(-EINVAL)) return -EINVAL; - rate_node = kzalloc(sizeof(*rate_node), GFP_KERNEL); + rate_node = kzalloc_obj(*rate_node, GFP_KERNEL); if (!rate_node) return -ENOMEM; @@ -721,7 +721,7 @@ devl_rate_node_create(struct devlink *devlink, void *priv, char *node_name, if (!IS_ERR(rate_node)) return ERR_PTR(-EEXIST); - rate_node = kzalloc(sizeof(*rate_node), GFP_KERNEL); + rate_node = kzalloc_obj(*rate_node, GFP_KERNEL); if (!rate_node) return ERR_PTR(-ENOMEM); @@ -766,7 +766,7 @@ int devl_rate_leaf_create(struct devlink_port *devlink_port, void *priv, if (WARN_ON(devlink_port->devlink_rate)) return -EBUSY; - devlink_rate = kzalloc(sizeof(*devlink_rate), GFP_KERNEL); + devlink_rate = kzalloc_obj(*devlink_rate, GFP_KERNEL); if (!devlink_rate) return -ENOMEM; diff --git a/net/devlink/region.c b/net/devlink/region.c index d6e5805cf3a0..654e3766710f 100644 --- a/net/devlink/region.c +++ b/net/devlink/region.c @@ -428,7 +428,7 @@ __devlink_region_snapshot_create(struct devlink_region *region, if (devlink_region_snapshot_get_by_id(region, snapshot_id)) return -EEXIST; - snapshot = kzalloc(sizeof(*snapshot), GFP_KERNEL); + snapshot = kzalloc_obj(*snapshot, GFP_KERNEL); if (!snapshot) return -ENOMEM; @@ -1055,7 +1055,7 @@ struct devlink_region *devl_region_create(struct devlink *devlink, if (devlink_region_get_by_name(devlink, ops->name)) return ERR_PTR(-EEXIST); - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) return ERR_PTR(-ENOMEM); @@ -1128,7 +1128,7 @@ devlink_port_region_create(struct devlink_port *port, goto unlock; } - region = kzalloc(sizeof(*region), GFP_KERNEL); + region = kzalloc_obj(*region, GFP_KERNEL); if (!region) { err = -ENOMEM; goto unlock; diff --git a/net/devlink/resource.c b/net/devlink/resource.c index 2d6324f3d91f..aa3621c28a00 100644 --- a/net/devlink/resource.c +++ b/net/devlink/resource.c @@ -347,7 +347,7 @@ int devl_resource_register(struct devlink *devlink, if (resource) return -EEXIST; - resource = kzalloc(sizeof(*resource), GFP_KERNEL); + resource = kzalloc_obj(*resource, GFP_KERNEL); if (!resource) return -ENOMEM; diff --git a/net/devlink/sb.c b/net/devlink/sb.c index 0a76bb32502b..bcfeed079433 100644 --- a/net/devlink/sb.c +++ b/net/devlink/sb.c @@ -943,7 +943,7 @@ int devl_sb_register(struct devlink *devlink, unsigned int sb_index, if (devlink_sb_index_exists(devlink, sb_index)) return -EEXIST; - devlink_sb = kzalloc(sizeof(*devlink_sb), GFP_KERNEL); + devlink_sb = kzalloc_obj(*devlink_sb, GFP_KERNEL); if (!devlink_sb) return -ENOMEM; devlink_sb->index = sb_index; diff --git a/net/devlink/trap.c b/net/devlink/trap.c index f36087f90db5..e4255c0a6a30 100644 --- a/net/devlink/trap.c +++ b/net/devlink/trap.c @@ -1271,7 +1271,7 @@ devlink_trap_register(struct devlink *devlink, if (devlink_trap_item_lookup(devlink, trap->name)) return -EEXIST; - trap_item = kzalloc(sizeof(*trap_item), GFP_KERNEL); + trap_item = kzalloc_obj(*trap_item, GFP_KERNEL); if (!trap_item) return -ENOMEM; @@ -1545,7 +1545,7 @@ devlink_trap_group_register(struct devlink *devlink, if (devlink_trap_group_item_lookup(devlink, group->name)) return -EEXIST; - group_item = kzalloc(sizeof(*group_item), GFP_KERNEL); + group_item = kzalloc_obj(*group_item, GFP_KERNEL); if (!group_item) return -ENOMEM; @@ -1751,7 +1751,7 @@ devlink_trap_policer_register(struct devlink *devlink, if (devlink_trap_policer_item_lookup(devlink, policer->id)) return -EEXIST; - policer_item = kzalloc(sizeof(*policer_item), GFP_KERNEL); + policer_item = kzalloc_obj(*policer_item, GFP_KERNEL); if (!policer_item) return -ENOMEM; diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 35ce3941fae3..b0ae980ca684 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -213,7 +213,7 @@ static struct dsa_switch_tree *dsa_tree_alloc(int index) { struct dsa_switch_tree *dst; - dst = kzalloc(sizeof(*dst), GFP_KERNEL); + dst = kzalloc_obj(*dst, GFP_KERNEL); if (!dst) return NULL; @@ -298,7 +298,7 @@ static struct dsa_link *dsa_link_touch(struct dsa_port *dp, if (dl->dp == dp && dl->link_dp == link_dp) return dl; - dl = kzalloc(sizeof(*dl), GFP_KERNEL); + dl = kzalloc_obj(*dl, GFP_KERNEL); if (!dl) return NULL; @@ -844,7 +844,7 @@ static int dsa_tree_setup_lags(struct dsa_switch_tree *dst) if (!len) return 0; - dst->lags = kcalloc(len, sizeof(*dst->lags), GFP_KERNEL); + dst->lags = kzalloc_objs(*dst->lags, len, GFP_KERNEL); if (!dst->lags) return -ENOMEM; @@ -1092,7 +1092,7 @@ static struct dsa_port *dsa_port_touch(struct dsa_switch *ds, int index) if (dp->index == index) return dp; - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); if (!dp) return NULL; diff --git a/net/dsa/port.c b/net/dsa/port.c index ca3a7f52229b..4da911edc512 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -431,7 +431,7 @@ static int dsa_port_bridge_create(struct dsa_port *dp, return 0; } - bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); + bridge = kzalloc_obj(*bridge, GFP_KERNEL); if (!bridge) return -ENOMEM; @@ -617,7 +617,7 @@ static int dsa_port_lag_create(struct dsa_port *dp, return 0; } - lag = kzalloc(sizeof(*lag), GFP_KERNEL); + lag = kzalloc_obj(*lag, GFP_KERNEL); if (!lag) return -ENOMEM; diff --git a/net/dsa/switch.c b/net/dsa/switch.c index 3d2feeea897b..e00997977c93 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -182,7 +182,7 @@ static int dsa_port_do_mdb_add(struct dsa_port *dp, goto out; } - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) { err = -ENOMEM; goto out; @@ -280,7 +280,7 @@ static int dsa_port_do_fdb_add(struct dsa_port *dp, const unsigned char *addr, goto out; } - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) { err = -ENOMEM; goto out; @@ -368,7 +368,7 @@ static int dsa_switch_do_lag_fdb_add(struct dsa_switch *ds, struct dsa_lag *lag, goto out; } - a = kzalloc(sizeof(*a), GFP_KERNEL); + a = kzalloc_obj(*a, GFP_KERNEL); if (!a) { err = -ENOMEM; goto out; @@ -719,7 +719,7 @@ static int dsa_port_do_vlan_add(struct dsa_port *dp, goto out; } - v = kzalloc(sizeof(*v), GFP_KERNEL); + v = kzalloc_obj(*v, GFP_KERNEL); if (!v) { err = -ENOMEM; goto out; diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c index 53e03fd8071b..c9bea6808da3 100644 --- a/net/dsa/tag_8021q.c +++ b/net/dsa/tag_8021q.c @@ -158,7 +158,7 @@ static int dsa_port_do_tag_8021q_vlan_add(struct dsa_port *dp, u16 vid, return 0; } - v = kzalloc(sizeof(*v), GFP_KERNEL); + v = kzalloc_obj(*v, GFP_KERNEL); if (!v) return -ENOMEM; @@ -420,7 +420,7 @@ int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto) struct dsa_8021q_context *ctx; int err; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 9170a0148cc4..15aa44478807 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -62,7 +62,7 @@ static int ksz_connect(struct dsa_switch *ds) struct ksz_tagger_private *priv; int ret; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; @@ -258,7 +258,7 @@ static struct sk_buff *ksz_defer_xmit(struct dsa_port *dp, struct sk_buff *skb) if (!xmit_work_fn || !xmit_worker) return NULL; - xmit_work = kzalloc(sizeof(*xmit_work), GFP_ATOMIC); + xmit_work = kzalloc_obj(*xmit_work, GFP_ATOMIC); if (!xmit_work) return NULL; diff --git a/net/dsa/tag_ocelot_8021q.c b/net/dsa/tag_ocelot_8021q.c index 3929584791e4..b9bf2895309a 100644 --- a/net/dsa/tag_ocelot_8021q.c +++ b/net/dsa/tag_ocelot_8021q.c @@ -43,7 +43,7 @@ static struct sk_buff *ocelot_defer_xmit(struct dsa_port *dp, if (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) return NULL; - xmit_work = kzalloc(sizeof(*xmit_work), GFP_ATOMIC); + xmit_work = kzalloc_obj(*xmit_work, GFP_ATOMIC); if (!xmit_work) return NULL; @@ -106,7 +106,7 @@ static int ocelot_connect(struct dsa_switch *ds) struct ocelot_8021q_tagger_private *priv; int err; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index 6d56a28c914c..4326487c1f29 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -92,7 +92,7 @@ static int qca_tag_connect(struct dsa_switch *ds) { struct qca_tagger_data *tagger_data; - tagger_data = kzalloc(sizeof(*tagger_data), GFP_KERNEL); + tagger_data = kzalloc_obj(*tagger_data, GFP_KERNEL); if (!tagger_data) return -ENOMEM; diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index 02adec693811..2083ef3b4b90 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -152,7 +152,7 @@ static struct sk_buff *sja1105_defer_xmit(struct dsa_port *dp, if (!xmit_work_fn || !xmit_worker) return NULL; - xmit_work = kzalloc(sizeof(*xmit_work), GFP_ATOMIC); + xmit_work = kzalloc_obj(*xmit_work, GFP_ATOMIC); if (!xmit_work) return NULL; @@ -701,7 +701,7 @@ static int sja1105_connect(struct dsa_switch *ds) struct kthread_worker *xmit_worker; int err; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/net/dsa/user.c b/net/dsa/user.c index 5697291d43cf..5df8cb69295d 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -147,7 +147,7 @@ static int dsa_user_schedule_standalone_work(struct net_device *dev, { struct dsa_standalone_event_work *standalone_work; - standalone_work = kzalloc(sizeof(*standalone_work), GFP_ATOMIC); + standalone_work = kzalloc_obj(*standalone_work, GFP_ATOMIC); if (!standalone_work) return -ENOMEM; @@ -1318,7 +1318,7 @@ static int dsa_user_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err = 0; - netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); if (!netpoll) return -ENOMEM; @@ -1430,7 +1430,7 @@ dsa_user_add_cls_matchall_mirred(struct net_device *dev, return -EOPNOTSUPP; } - mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL); + mall_tc_entry = kzalloc_obj(*mall_tc_entry, GFP_KERNEL); if (!mall_tc_entry) return -ENOMEM; @@ -1490,7 +1490,7 @@ dsa_user_add_cls_matchall_police(struct net_device *dev, act = &cls->rule->action.entries[0]; - mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL); + mall_tc_entry = kzalloc_obj(*mall_tc_entry, GFP_KERNEL); if (!mall_tc_entry) return -ENOMEM; @@ -1823,7 +1823,7 @@ static int dsa_user_vlan_rx_add_vid(struct net_device *dev, __be16 proto, !dsa_switch_supports_mc_filtering(ds)) return 0; - v = kzalloc(sizeof(*v), GFP_KERNEL); + v = kzalloc_obj(*v, GFP_KERNEL); if (!v) { ret = -ENOMEM; goto rollback; @@ -2070,7 +2070,7 @@ static void dsa_bridge_mtu_normalization(struct dsa_port *dp) if (min_mtu > user->mtu) min_mtu = user->mtu; - hw_port = kzalloc(sizeof(*hw_port), GFP_KERNEL); + hw_port = kzalloc_obj(*hw_port, GFP_KERNEL); if (!hw_port) goto out; @@ -3738,7 +3738,7 @@ static int dsa_user_fdb_event(struct net_device *dev, return -EOPNOTSUPP; } - switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); + switchdev_work = kzalloc_obj(*switchdev_work, GFP_ATOMIC); if (!switchdev_work) return -ENOMEM; diff --git a/net/ethtool/cmis_cdb.c b/net/ethtool/cmis_cdb.c index 3057576bc81e..674439bedd49 100644 --- a/net/ethtool/cmis_cdb.c +++ b/net/ethtool/cmis_cdb.c @@ -276,7 +276,7 @@ ethtool_cmis_cdb_init(struct net_device *dev, struct ethtool_cmis_cdb *cdb; int err; - cdb = kzalloc(sizeof(*cdb), GFP_KERNEL); + cdb = kzalloc_obj(*cdb, GFP_KERNEL); if (!cdb) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 5fae329795c8..7a302a93f52c 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -687,7 +687,7 @@ static int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max) if (rule_cnt <= 0) return -EINVAL; - info = kvzalloc(struct_size(info, rule_locs, rule_cnt), GFP_KERNEL); + info = kvzalloc_flex(*info, rule_locs, rule_cnt, GFP_KERNEL); if (!info) return -ENOMEM; @@ -770,7 +770,7 @@ static u32 ethtool_get_max_rxfh_channel(struct net_device *dev) if (dev_size == 0) return current_max; - rxfh.indir = kcalloc(dev_size, sizeof(rxfh.indir[0]), GFP_USER); + rxfh.indir = kzalloc_objs(rxfh.indir[0], dev_size, GFP_USER); if (!rxfh.indir) return U32_MAX; @@ -841,7 +841,7 @@ int ethtool_check_rss_ctx_busy(struct net_device *dev, u32 rss_context) if (rule_cnt < 0) return -EINVAL; - info = kvzalloc(struct_size(info, rule_locs, rule_cnt), GFP_KERNEL); + info = kvzalloc_flex(*info, rule_locs, rule_cnt, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 9431e305b233..b4e7c6ccf9f3 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -3040,7 +3040,7 @@ ethtool_set_per_queue_coalesce(struct net_device *dev, bitmap_from_arr32(queue_mask, per_queue_opt->queue_mask, MAX_NUM_QUEUE); n_queue = bitmap_weight(queue_mask, MAX_NUM_QUEUE); - tmp = backup = kmalloc_array(n_queue, sizeof(*backup), GFP_KERNEL); + tmp = backup = kmalloc_objs(*backup, n_queue, GFP_KERNEL); if (!backup) return -ENOMEM; @@ -3554,7 +3554,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *useraddr) if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) return -EFAULT; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/net/ethtool/module.c b/net/ethtool/module.c index 4d4e0a82579a..d033a20aa48c 100644 --- a/net/ethtool/module.c +++ b/net/ethtool/module.c @@ -301,7 +301,7 @@ module_flash_fw_schedule(struct net_device *dev, const char *file_name, struct ethtool_module_fw_flash *module_fw; int err; - module_fw = kzalloc(sizeof(*module_fw), GFP_KERNEL); + module_fw = kzalloc_obj(*module_fw, GFP_KERNEL); if (!module_fw) return -ENOMEM; diff --git a/net/ethtool/mse.c b/net/ethtool/mse.c index 6aac004c3ffc..4de15aad543b 100644 --- a/net/ethtool/mse.c +++ b/net/ethtool/mse.c @@ -64,8 +64,8 @@ static int mse_get_channels(struct phy_device *phydev, if (!data->capability.supported_caps) return 0; - data->snapshots = kcalloc(PHY_MSE_CHANNEL_COUNT, - sizeof(*data->snapshots), GFP_KERNEL); + data->snapshots = kzalloc_objs(*data->snapshots, PHY_MSE_CHANNEL_COUNT, + GFP_KERNEL); if (!data->snapshots) return -ENOMEM; diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c index 169b413b31fc..acd0477b3a2d 100644 --- a/net/ethtool/tsconfig.c +++ b/net/ethtool/tsconfig.c @@ -202,10 +202,10 @@ static int tsconfig_send_reply(struct net_device *dev, struct genl_info *info) int reply_len = 0; int ret; - req_info = kzalloc(sizeof(*req_info), GFP_KERNEL); + req_info = kzalloc_obj(*req_info, GFP_KERNEL); if (!req_info) return -ENOMEM; - reply_data = kmalloc(sizeof(*reply_data), GFP_KERNEL); + reply_data = kmalloc_obj(*reply_data, GFP_KERNEL); if (!reply_data) { kfree(req_info); return -ENOMEM; @@ -280,7 +280,7 @@ tsconfig_set_hwprov_from_desc(struct net_device *dev, source = HWTSTAMP_SOURCE_PHYLIB; } - hwprov = kzalloc(sizeof(*hwprov), GFP_KERNEL); + hwprov = kzalloc_obj(*hwprov, GFP_KERNEL); if (!hwprov) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c index 8c654caa6805..df9c7de9a640 100644 --- a/net/ethtool/tsinfo.c +++ b/net/ethtool/tsinfo.c @@ -505,10 +505,10 @@ int ethnl_tsinfo_start(struct netlink_callback *cb) BUILD_BUG_ON(sizeof(*ctx) > sizeof(cb->ctx)); - req_info = kzalloc(sizeof(*req_info), GFP_KERNEL); + req_info = kzalloc_obj(*req_info, GFP_KERNEL); if (!req_info) return -ENOMEM; - reply_data = kzalloc(sizeof(*reply_data), GFP_KERNEL); + reply_data = kzalloc_obj(*reply_data, GFP_KERNEL); if (!reply_data) { ret = -ENOMEM; goto free_req_info; diff --git a/net/handshake/request.c b/net/handshake/request.c index 6b7e3e0bf399..2829adbeb149 100644 --- a/net/handshake/request.c +++ b/net/handshake/request.c @@ -119,7 +119,7 @@ struct handshake_req *handshake_req_alloc(const struct handshake_proto *proto, if (!proto->hp_accept || !proto->hp_done) return NULL; - req = kzalloc(struct_size(req, hr_priv, proto->hp_privsize), flags); + req = kzalloc_flex(*req, hr_priv, proto->hp_privsize, flags); if (!req) return NULL; diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 7d87f304ded4..d5a742cb77d1 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -80,7 +80,7 @@ int hsr_create_self_node(struct hsr_priv *hsr, { struct hsr_self_node *sn, *old; - sn = kmalloc(sizeof(*sn), GFP_KERNEL); + sn = kmalloc_obj(*sn, GFP_KERNEL); if (!sn) return -ENOMEM; @@ -159,7 +159,7 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *hsr, size_t block_sz; int i; - new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC); + new_node = kzalloc_obj(*new_node, GFP_ATOMIC); if (!new_node) return NULL; diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index afe06ba00ea4..9a3f3add4b47 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -198,7 +198,7 @@ int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev, if (port) return -EBUSY; /* This port already exists */ - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 5a024ca60d35..f743d1568f3f 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -603,7 +603,7 @@ nl802154_dump_wpan_phy(struct sk_buff *skb, struct netlink_callback *cb) rtnl_lock(); if (!state) { - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { rtnl_unlock(); return -ENOMEM; @@ -1418,7 +1418,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; } - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) return -ENOMEM; @@ -1586,7 +1586,7 @@ nl802154_send_beacons(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; } - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) return -ENOMEM; diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 08d811f11896..6e62e80236a4 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1737,8 +1737,8 @@ static __net_init int ipv4_mib_init_net(struct net *net) net->mib.icmp_statistics = alloc_percpu(struct icmp_mib); if (!net->mib.icmp_statistics) goto err_icmp_mib; - net->mib.icmpmsg_statistics = kzalloc(sizeof(struct icmpmsg_mib), - GFP_KERNEL); + net->mib.icmpmsg_statistics = kzalloc_obj(struct icmpmsg_mib, + GFP_KERNEL); if (!net->mib.icmpmsg_statistics) goto err_icmpmsg_mib; diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 64aec3dff8ec..f4a207c7cfc6 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -484,7 +484,7 @@ static int ah_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) goto error; } - ahp = kzalloc(sizeof(*ahp), GFP_KERNEL); + ahp = kzalloc_obj(*ahp, GFP_KERNEL); if (!ahp) return -ENOMEM; diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 32b951ebc0c2..3fb181a3f3c0 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c @@ -168,9 +168,8 @@ static int __init cipso_v4_cache_init(void) { u32 iter; - cipso_v4_cache = kcalloc(CIPSO_V4_CACHE_BUCKETS, - sizeof(struct cipso_v4_map_cache_bkt), - GFP_KERNEL); + cipso_v4_cache = kzalloc_objs(struct cipso_v4_map_cache_bkt, + CIPSO_V4_CACHE_BUCKETS, GFP_KERNEL); if (!cipso_v4_cache) return -ENOMEM; @@ -308,7 +307,7 @@ int cipso_v4_cache_add(const unsigned char *cipso_ptr, cipso_ptr_len = cipso_ptr[1]; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; entry->key = kmemdup(cipso_ptr, cipso_ptr_len, GFP_ATOMIC); diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 942a887bf089..9fd41dfbe788 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -209,7 +209,7 @@ static struct in_ifaddr *inet_alloc_ifa(struct in_device *in_dev) { struct in_ifaddr *ifa; - ifa = kzalloc(sizeof(*ifa), GFP_KERNEL_ACCOUNT); + ifa = kzalloc_obj(*ifa, GFP_KERNEL_ACCOUNT); if (!ifa) return NULL; @@ -270,7 +270,7 @@ static struct in_device *inetdev_init(struct net_device *dev) ASSERT_RTNL(); - in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); + in_dev = kzalloc_obj(*in_dev, GFP_KERNEL); if (!in_dev) goto out; memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, @@ -2754,9 +2754,8 @@ static __net_init int devinet_init_net(struct net *net) int i; err = -ENOMEM; - net->ipv4.inet_addr_lst = kmalloc_array(IN4_ADDR_HSIZE, - sizeof(struct hlist_head), - GFP_KERNEL); + net->ipv4.inet_addr_lst = kmalloc_objs(struct hlist_head, + IN4_ADDR_HSIZE, GFP_KERNEL); if (!net->ipv4.inet_addr_lst) goto err_alloc_hash; diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 0caf38e44c73..ceef080112a9 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -365,8 +365,8 @@ static struct hlist_head *fib_info_laddrhash_bucket(const struct net *net, static struct hlist_head *fib_info_hash_alloc(unsigned int hash_bits) { /* The second half is used for prefsrc */ - return kvcalloc((1 << hash_bits) * 2, sizeof(struct hlist_head), - GFP_KERNEL); + return kvzalloc_objs(struct hlist_head, (1 << hash_bits) * 2, + GFP_KERNEL); } static void fib_info_hash_free(struct hlist_head *head) @@ -1399,7 +1399,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, fib_info_hash_grow(net); - fi = kzalloc(struct_size(fi, fib_nh, nhs), GFP_KERNEL); + fi = kzalloc_flex(*fi, fib_nh, nhs, GFP_KERNEL); if (!fi) { err = -ENOBUFS; goto failure; diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c index ab8f309f8925..885f3b06f6e9 100644 --- a/net/ipv4/fou_core.c +++ b/net/ipv4/fou_core.c @@ -581,7 +581,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg, goto error; /* Allocate FOU port structure */ - fou = kzalloc(sizeof(*fou), GFP_KERNEL); + fou = kzalloc_obj(*fou, GFP_KERNEL); if (!fou) { err = -ENOMEM; goto error; diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 0adc993c211d..a674fb44ec25 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1187,7 +1187,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im, * for deleted items allows change reports to use common code with * non-deleted or query-response MCA's. */ - pmc = kzalloc(sizeof(*pmc), gfp); + pmc = kzalloc_obj(*pmc, gfp); if (!pmc) return; spin_lock_init(&pmc->lock); @@ -1532,7 +1532,7 @@ static void ____ip_mc_inc_group(struct in_device *in_dev, __be32 addr, goto out; } - im = kzalloc(sizeof(*im), gfp); + im = kzalloc_obj(*im, gfp); if (!im) goto out; @@ -2075,7 +2075,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, psf_prev = psf; } if (!psf) { - psf = kzalloc(sizeof(*psf), GFP_ATOMIC); + psf = kzalloc_obj(*psf, GFP_ATOMIC); if (!psf) return -ENOBUFS; psf->sf_inaddr = *psfsrc; @@ -2150,7 +2150,7 @@ static int sf_setstate(struct ip_mc_list *pmc) if (dpsf->sf_inaddr == psf->sf_inaddr) break; if (!dpsf) { - dpsf = kmalloc(sizeof(*dpsf), GFP_ATOMIC); + dpsf = kmalloc_obj(*dpsf, GFP_ATOMIC); if (!dpsf) continue; *dpsf = *psf; diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 3f5b1418a610..89f99c7ee69e 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -845,7 +845,7 @@ static int __inet_diag_dump_start(struct netlink_callback *cb, int hdrlen) struct nlattr *nla; int err; - cb_data = kzalloc(sizeof(*cb_data), GFP_KERNEL); + cb_data = kzalloc_obj(*cb_data, GFP_KERNEL); if (!cb_data) return -ENOMEM; diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 4e6d7467ed44..b006606ebb1d 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -188,7 +188,7 @@ static void fqdir_work_fn(struct work_struct *work) int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) { - struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL); + struct fqdir *fqdir = kzalloc_obj(*fqdir, GFP_KERNEL); int res; if (!fqdir) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index f5826ec4bcaa..50bf4ec8213a 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -1284,7 +1284,7 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, int inet_hashinfo2_init_mod(struct inet_hashinfo *h) { - h->lhash2 = kmalloc_array(INET_LHTABLE_SIZE, sizeof(*h->lhash2), GFP_KERNEL); + h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE, GFP_KERNEL); if (!h->lhash2) return -ENOMEM; diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index c062d9519818..d09377780942 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -350,7 +350,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num == IPPROTO_RAW) return -EINVAL; - new_ra = on ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL; + new_ra = on ? kmalloc_obj(*new_ra, GFP_KERNEL) : NULL; if (on && !new_ra) return -ENOMEM; diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index b1e1be00ff8b..5dcac1fb4209 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -244,7 +244,7 @@ static int __init ic_open_devs(void) dev->name); continue; } - if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { + if (!(d = kmalloc_obj(struct ic_device, GFP_KERNEL))) { rtnl_unlock(); return -ENOMEM; } diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c index 28d77d454d44..77b7717b9c14 100644 --- a/net/ipv4/ipmr_base.c +++ b/net/ipv4/ipmr_base.c @@ -38,7 +38,7 @@ mr_table_alloc(struct net *net, u32 id, struct mr_table *mrt; int err; - mrt = kzalloc(sizeof(*mrt), GFP_KERNEL); + mrt = kzalloc_obj(*mrt, GFP_KERNEL); if (!mrt) return ERR_PTR(-ENOMEM); mrt->id = id; diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c index 82cf8a9e5ded..8b88d674a1ea 100644 --- a/net/ipv4/metrics.c +++ b/net/ipv4/metrics.c @@ -73,7 +73,7 @@ struct dst_metrics *ip_fib_metrics_init(struct nlattr *fc_mx, if (!fc_mx) return (struct dst_metrics *)&dst_default_metrics; - fib_metrics = kzalloc(sizeof(*fib_metrics), GFP_KERNEL); + fib_metrics = kzalloc_obj(*fib_metrics, GFP_KERNEL); if (unlikely(!fib_metrics)) return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 7b9d70f9b31c..36b52a92e999 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -116,7 +116,7 @@ static int nh_notifier_single_info_init(struct nh_notifier_info *info, struct nh_info *nhi = rtnl_dereference(nh->nh_info); info->type = NH_NOTIFIER_INFO_TYPE_SINGLE; - info->nh = kzalloc(sizeof(*info->nh), GFP_KERNEL); + info->nh = kzalloc_obj(*info->nh, GFP_KERNEL); if (!info->nh) return -ENOMEM; @@ -137,8 +137,8 @@ static int nh_notifier_mpath_info_init(struct nh_notifier_info *info, int i; info->type = NH_NOTIFIER_INFO_TYPE_GRP; - info->nh_grp = kzalloc(struct_size(info->nh_grp, nh_entries, num_nh), - GFP_KERNEL); + info->nh_grp = kzalloc_flex(*info->nh_grp, nh_entries, num_nh, + GFP_KERNEL); if (!info->nh_grp) return -ENOMEM; @@ -318,8 +318,7 @@ static int nh_notifier_res_bucket_info_init(struct nh_notifier_info *info, return err; info->type = NH_NOTIFIER_INFO_TYPE_RES_BUCKET; - info->nh_res_bucket = kzalloc(sizeof(*info->nh_res_bucket), - GFP_KERNEL); + info->nh_res_bucket = kzalloc_obj(*info->nh_res_bucket, GFP_KERNEL); if (!info->nh_res_bucket) return -ENOMEM; @@ -535,7 +534,7 @@ static struct nexthop *nexthop_alloc(void) { struct nexthop *nh; - nh = kzalloc(sizeof(struct nexthop), GFP_KERNEL); + nh = kzalloc_obj(struct nexthop, GFP_KERNEL); if (nh) { INIT_LIST_HEAD(&nh->fi_list); INIT_LIST_HEAD(&nh->f6i_list); @@ -550,7 +549,7 @@ static struct nh_group *nexthop_grp_alloc(u16 num_nh) { struct nh_group *nhg; - nhg = kzalloc(struct_size(nhg, nh_entries, num_nh), GFP_KERNEL); + nhg = kzalloc_flex(*nhg, nh_entries, num_nh, GFP_KERNEL); if (nhg) nhg->num_nh = num_nh; @@ -715,9 +714,8 @@ static int nh_notifier_grp_hw_stats_init(struct nh_notifier_info *info, info->id = nh->id; info->type = NH_NOTIFIER_INFO_TYPE_GRP_HW_STATS; - info->nh_grp_hw_stats = kzalloc(struct_size(info->nh_grp_hw_stats, - stats, nhg->num_nh), - GFP_KERNEL); + info->nh_grp_hw_stats = kzalloc_flex(*info->nh_grp_hw_stats, stats, + nhg->num_nh, GFP_KERNEL); if (!info->nh_grp_hw_stats) return -ENOMEM; @@ -2897,7 +2895,7 @@ static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg, if (!nh) return ERR_PTR(-ENOMEM); - nhi = kzalloc(sizeof(*nhi), GFP_KERNEL); + nhi = kzalloc_obj(*nhi, GFP_KERNEL); if (!nhi) { kfree(nh); return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 06aa39ae80d6..c75b92f60742 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -315,7 +315,7 @@ static int rt_acct_proc_show(struct seq_file *m, void *v) struct ip_rt_acct *dst, *src; unsigned int i, j; - dst = kcalloc(256, sizeof(struct ip_rt_acct), GFP_KERNEL); + dst = kzalloc_objs(struct ip_rt_acct, 256, GFP_KERNEL); if (!dst) return -ENOMEM; @@ -659,7 +659,7 @@ static void update_or_create_fnhe(struct fib_nh_common *nhc, __be32 daddr, hash = rcu_dereference(nhc->nhc_exceptions); if (!hash) { - hash = kcalloc(FNHE_HASH_SIZE, sizeof(*hash), GFP_ATOMIC); + hash = kzalloc_objs(*hash, FNHE_HASH_SIZE, GFP_ATOMIC); if (!hash) goto out_unlock; rcu_assign_pointer(nhc->nhc_exceptions, hash); @@ -702,7 +702,7 @@ static void update_or_create_fnhe(struct fib_nh_common *nhc, __be32 daddr, depth--; } - fnhe = kzalloc(sizeof(*fnhe), GFP_ATOMIC); + fnhe = kzalloc_obj(*fnhe, GFP_ATOMIC); if (!fnhe) goto out_unlock; @@ -3687,7 +3687,7 @@ static __net_initdata struct pernet_operations rt_genid_ops = { static int __net_init ipv4_inetpeer_init(struct net *net) { - struct inet_peer_base *bp = kmalloc(sizeof(*bp), GFP_KERNEL); + struct inet_peer_base *bp = kmalloc_obj(*bp, GFP_KERNEL); if (!bp) return -ENOMEM; diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6ce03a9adb4a..f84d9a45cc9d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1077,8 +1077,8 @@ int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, int *copied, if (tp->fastopen_req) return -EALREADY; /* Another Fast Open is in progress */ - tp->fastopen_req = kzalloc(sizeof(struct tcp_fastopen_request), - sk->sk_allocation); + tp->fastopen_req = kzalloc_obj(struct tcp_fastopen_request, + sk->sk_allocation); if (unlikely(!tp->fastopen_req)) return -ENOBUFS; tp->fastopen_req->data = msg; diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c index 34b8450829d0..4980caddb0fc 100644 --- a/net/ipv4/tcp_ao.c +++ b/net/ipv4/tcp_ao.c @@ -227,7 +227,7 @@ static struct tcp_ao_info *tcp_ao_alloc_info(gfp_t flags) { struct tcp_ao_info *ao; - ao = kzalloc(sizeof(*ao), flags); + ao = kzalloc_obj(*ao, flags); if (!ao) return NULL; INIT_HLIST_HEAD(&ao->head); diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c index ca8a5cb8e569..c449a044895e 100644 --- a/net/ipv4/tcp_bpf.c +++ b/net/ipv4/tcp_bpf.c @@ -39,7 +39,7 @@ static int bpf_tcp_ingress(struct sock *sk, struct sk_psock *psock, struct sk_msg *tmp; int i, ret = 0; - tmp = kzalloc(sizeof(*tmp), __GFP_NOWARN | GFP_KERNEL); + tmp = kzalloc_obj(*tmp, __GFP_NOWARN | GFP_KERNEL); if (unlikely(!tmp)) return -ENOMEM; @@ -426,8 +426,8 @@ more_data: msg->cork_bytes > msg->sg.size && !enospc) { psock->cork_bytes = msg->cork_bytes - msg->sg.size; if (!psock->cork) { - psock->cork = kzalloc(sizeof(*psock->cork), - GFP_ATOMIC | __GFP_NOWARN); + psock->cork = kzalloc_obj(*psock->cork, + GFP_ATOMIC | __GFP_NOWARN); if (!psock->cork) { sk_msg_free(sk, msg); *copied = 0; diff --git a/net/ipv4/tcp_cdg.c b/net/ipv4/tcp_cdg.c index fbad6c35dee9..ceabfd690a29 100644 --- a/net/ipv4/tcp_cdg.c +++ b/net/ipv4/tcp_cdg.c @@ -378,8 +378,8 @@ static void tcp_cdg_init(struct sock *sk) ca->gradients = NULL; /* We silently fall back to window = 1 if allocation fails. */ if (window > 1) - ca->gradients = kcalloc(window, sizeof(ca->gradients[0]), - GFP_NOWAIT); + ca->gradients = kzalloc_objs(ca->gradients[0], window, + GFP_NOWAIT); ca->rtt_seq = tp->snd_nxt; ca->shadow_wnd = tcp_snd_cwnd(tp); } diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index b30090cff3cf..b4309dc4b9c5 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c @@ -149,7 +149,7 @@ int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk, struct fastopen_queue *q; int err = 0; - ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc_obj(*ctx, GFP_KERNEL); if (!ctx) { err = -ENOMEM; goto out; @@ -549,8 +549,8 @@ bool tcp_fastopen_defer_connect(struct sock *sk, int *err) /* Alloc fastopen_req in order for FO option to be included * in SYN */ - tp->fastopen_req = kzalloc(sizeof(*tp->fastopen_req), - sk->sk_allocation); + tp->fastopen_req = kzalloc_obj(*tp->fastopen_req, + sk->sk_allocation); if (tp->fastopen_req) tp->fastopen_req->cookie = cookie; else diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index e7b41abb82aa..65a7a5ea8eb7 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -7598,8 +7598,7 @@ static void tcp_reqsk_record_syn(const struct sock *sk, mac_hdrlen = 0; } - saved_syn = kmalloc(struct_size(saved_syn, data, len), - GFP_ATOMIC); + saved_syn = kmalloc_flex(*saved_syn, data, len, GFP_ATOMIC); if (saved_syn) { saved_syn->mac_hdrlen = mac_hdrlen; saved_syn->network_hdrlen = skb_network_header_len(skb); diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 6264fc0b2be5..63a8b174cf99 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1354,7 +1354,7 @@ static int tcp_md5sig_info_add(struct sock *sk, gfp_t gfp) struct tcp_sock *tp = tcp_sk(sk); struct tcp_md5sig_info *md5sig; - md5sig = kmalloc(sizeof(*md5sig), gfp); + md5sig = kmalloc_obj(*md5sig, gfp); if (!md5sig) return -ENOMEM; diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 45b6ecd16412..06b1d5d3b6df 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c @@ -197,7 +197,7 @@ static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, } tm = oldest; } else { - tm = kzalloc(sizeof(*tm), GFP_ATOMIC); + tm = kzalloc_obj(*tm, GFP_ATOMIC); if (!tm) goto out_unlock; } diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index b96e47f1c8a2..5fcf81a833e8 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -3859,7 +3859,7 @@ static struct udp_table __net_init *udp_pernet_table_alloc(unsigned int hash_ent unsigned int slot_size; int i; - udptable = kmalloc(sizeof(*udptable), GFP_KERNEL); + udptable = kmalloc_obj(*udptable, GFP_KERNEL); if (!udptable) goto out; @@ -3972,8 +3972,8 @@ static int bpf_iter_udp_realloc_batch(struct bpf_udp_iter_state *iter, { union bpf_udp_iter_batch_item *new_batch; - new_batch = kvmalloc_array(new_batch_sz, sizeof(*new_batch), - flags | __GFP_NOWARN); + new_batch = kvmalloc_objs(*new_batch, new_batch_sz, + flags | __GFP_NOWARN); if (!new_batch) return -ENOMEM; diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c index 944b3cf25468..ae674e3ed9b8 100644 --- a/net/ipv4/udp_tunnel_nic.c +++ b/net/ipv4/udp_tunnel_nic.c @@ -753,7 +753,7 @@ udp_tunnel_nic_alloc(const struct udp_tunnel_nic_info *info, struct udp_tunnel_nic *utn; unsigned int i; - utn = kzalloc(struct_size(utn, entries, n_tables), GFP_KERNEL); + utn = kzalloc_flex(*utn, entries, n_tables, GFP_KERNEL); if (!utn) return NULL; utn->n_tables = n_tables; @@ -761,8 +761,9 @@ udp_tunnel_nic_alloc(const struct udp_tunnel_nic_info *info, mutex_init(&utn->lock); for (i = 0; i < n_tables; i++) { - utn->entries[i] = kcalloc(info->tables[i].n_entries, - sizeof(*utn->entries[i]), GFP_KERNEL); + utn->entries[i] = kzalloc_objs(*utn->entries[i], + info->tables[i].n_entries, + GFP_KERNEL); if (!utn->entries[i]) goto err_free_prev_entries; } @@ -820,7 +821,7 @@ static int udp_tunnel_nic_register(struct net_device *dev) /* Create UDP tunnel state structures */ if (info->shared) { - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 6db9cf9e2a50..5696ceb09dc7 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -355,12 +355,12 @@ static int snmp6_alloc_dev(struct inet6_dev *idev) } - idev->stats.icmpv6dev = kzalloc(sizeof(struct icmpv6_mib_device), - GFP_KERNEL); + idev->stats.icmpv6dev = kzalloc_obj(struct icmpv6_mib_device, + GFP_KERNEL); if (!idev->stats.icmpv6dev) goto err_icmp; - idev->stats.icmpv6msgdev = kzalloc(sizeof(struct icmpv6msg_mib_device), - GFP_KERNEL_ACCOUNT); + idev->stats.icmpv6msgdev = kzalloc_obj(struct icmpv6msg_mib_device, + GFP_KERNEL_ACCOUNT); if (!idev->stats.icmpv6msgdev) goto err_icmpmsg; @@ -385,7 +385,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev) if (dev->mtu < IPV6_MIN_MTU && dev != blackhole_netdev) return ERR_PTR(-EINVAL); - ndev = kzalloc(sizeof(*ndev), GFP_KERNEL_ACCOUNT); + ndev = kzalloc_obj(*ndev, GFP_KERNEL_ACCOUNT); if (!ndev) return ERR_PTR(err); @@ -1117,7 +1117,7 @@ ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg, goto out; } - ifa = kzalloc(sizeof(*ifa), gfp_flags | __GFP_ACCOUNT); + ifa = kzalloc_obj(*ifa, gfp_flags | __GFP_ACCOUNT); if (!ifa) { err = -ENOBUFS; goto out; @@ -7398,9 +7398,8 @@ static int __net_init addrconf_init_net(struct net *net) spin_lock_init(&net->ipv6.addrconf_hash_lock); INIT_DEFERRABLE_WORK(&net->ipv6.addr_chk_work, addrconf_verify_work); - net->ipv6.inet6_addr_lst = kcalloc(IN6_ADDR_HSIZE, - sizeof(struct hlist_head), - GFP_KERNEL); + net->ipv6.inet6_addr_lst = kzalloc_objs(struct hlist_head, + IN6_ADDR_HSIZE, GFP_KERNEL); if (!net->ipv6.inet6_addr_lst) goto err_alloc_addr; diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index 567efd626ab4..e3b6b9a3f02e 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c @@ -180,7 +180,7 @@ static struct ip6addrlbl_entry *ip6addrlbl_alloc(const struct in6_addr *prefix, break; } - newp = kmalloc(sizeof(*newp), GFP_KERNEL); + newp = kmalloc_obj(*newp, GFP_KERNEL); if (!newp) return ERR_PTR(-ENOMEM); diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 69be0a67a140..25ff5148c926 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -921,8 +921,8 @@ static int __net_init ipv6_init_mibs(struct net *net) net->mib.icmpv6_statistics = alloc_percpu(struct icmpv6_mib); if (!net->mib.icmpv6_statistics) goto err_icmp_mib; - net->mib.icmpv6msg_statistics = kzalloc(sizeof(struct icmpv6msg_mib), - GFP_KERNEL); + net->mib.icmpv6msg_statistics = kzalloc_obj(struct icmpv6msg_mib, + GFP_KERNEL); if (!net->mib.icmpv6msg_statistics) goto err_icmpmsg_mib; return 0; diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 95372e0f1d21..7ad0c894f2fd 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c @@ -691,7 +691,7 @@ static int ah6_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) goto error; } - ahp = kzalloc(sizeof(*ahp), GFP_KERNEL); + ahp = kzalloc_obj(*ahp, GFP_KERNEL); if (!ahp) return -ENOMEM; diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 52599584422b..67a42e01dfc3 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c @@ -279,7 +279,7 @@ static struct ifacaddr6 *aca_alloc(struct fib6_info *f6i, { struct ifacaddr6 *aca; - aca = kzalloc(sizeof(*aca), GFP_ATOMIC); + aca = kzalloc_obj(*aca, GFP_ATOMIC); if (!aca) return NULL; diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c index 21f6ed126253..ff39220fef8a 100644 --- a/net/ipv6/calipso.c +++ b/net/ipv6/calipso.c @@ -133,9 +133,8 @@ static int __init calipso_cache_init(void) { u32 iter; - calipso_cache = kcalloc(CALIPSO_CACHE_BUCKETS, - sizeof(struct calipso_map_cache_bkt), - GFP_KERNEL); + calipso_cache = kzalloc_objs(struct calipso_map_cache_bkt, + CALIPSO_CACHE_BUCKETS, GFP_KERNEL); if (!calipso_cache) return -ENOMEM; @@ -275,7 +274,7 @@ static int calipso_cache_add(const unsigned char *calipso_ptr, calipso_ptr_len = calipso_ptr[1]; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return -ENOMEM; entry->key = kmemdup(calipso_ptr + 2, calipso_ptr_len, GFP_ATOMIC); diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 1d41b2ab4884..c5ff34040175 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -220,7 +220,7 @@ static int ila_add_mapping(struct net *net, struct ila_xlat_params *xp) return err; } - ila = kzalloc(sizeof(*ila), GFP_KERNEL); + ila = kzalloc_obj(*ila, GFP_KERNEL); if (!ila) return -ENOMEM; @@ -509,7 +509,7 @@ int ila_xlat_nl_dump_start(struct netlink_callback *cb) struct ila_net *ilan = net_generic(net, ila_net_id); struct ila_dump_iter *iter; - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return -ENOMEM; diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c index 08b7ac8c99b7..b6c9e48891fe 100644 --- a/net/ipv6/ioam6.c +++ b/net/ipv6/ioam6.c @@ -127,7 +127,7 @@ static int ioam6_genl_addns(struct sk_buff *skb, struct genl_info *info) goto out_unlock; } - ns = kzalloc(sizeof(*ns), GFP_KERNEL); + ns = kzalloc_obj(*ns, GFP_KERNEL); if (!ns) { err = -ENOMEM; goto out_unlock; @@ -245,7 +245,7 @@ static int ioam6_genl_dumpns_start(struct netlink_callback *cb) struct rhashtable_iter *iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return -ENOMEM; @@ -431,7 +431,7 @@ static int ioam6_genl_dumpsc_start(struct netlink_callback *cb) struct rhashtable_iter *iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return -ENOMEM; @@ -975,7 +975,7 @@ static int __net_init ioam6_net_init(struct net *net) struct ioam6_pernet_data *nsdata; int err = -ENOMEM; - nsdata = kzalloc(sizeof(*nsdata), GFP_KERNEL); + nsdata = kzalloc_obj(*nsdata, GFP_KERNEL); if (!nsdata) goto out; diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 56058e6de490..6a26d9448395 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -234,7 +234,7 @@ static struct fib6_table *fib6_alloc_table(struct net *net, u32 id) { struct fib6_table *table; - table = kzalloc(sizeof(*table), GFP_ATOMIC); + table = kzalloc_obj(*table, GFP_ATOMIC); if (table) { table->tb6_id = id; rcu_assign_pointer(table->tb6_root.leaf, @@ -494,7 +494,7 @@ int fib6_tables_dump(struct net *net, struct notifier_block *nb, unsigned int h; int err = 0; - w = kzalloc(sizeof(*w), GFP_ATOMIC); + w = kzalloc_obj(*w, GFP_ATOMIC); if (!w) return -ENOMEM; @@ -659,7 +659,7 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) * * 1. allocate and initialize walker. */ - w = kzalloc(sizeof(*w), GFP_ATOMIC); + w = kzalloc_obj(*w, GFP_ATOMIC); if (!w) { err = -ENOMEM; goto unlock; @@ -731,7 +731,7 @@ void fib6_metric_set(struct fib6_info *f6i, int metric, u32 val) return; if (f6i->fib6_metrics == &dst_default_metrics) { - struct dst_metrics *p = kzalloc(sizeof(*p), GFP_ATOMIC); + struct dst_metrics *p = kzalloc_obj(*p, GFP_ATOMIC); if (!p) return; @@ -2464,7 +2464,7 @@ static int __net_init fib6_net_init(struct net *net) INIT_LIST_HEAD(&net->ipv6.fib6_walkers); timer_setup(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, 0); - net->ipv6.rt6_stats = kzalloc(sizeof(*net->ipv6.rt6_stats), GFP_KERNEL); + net->ipv6.rt6_stats = kzalloc_obj(*net->ipv6.rt6_stats, GFP_KERNEL); if (!net->ipv6.rt6_stats) goto out_notifier; @@ -2477,8 +2477,8 @@ static int __net_init fib6_net_init(struct net *net) spin_lock_init(&net->ipv6.fib_table_hash_lock); - net->ipv6.fib6_main_tbl = kzalloc(sizeof(*net->ipv6.fib6_main_tbl), - GFP_KERNEL); + net->ipv6.fib6_main_tbl = kzalloc_obj(*net->ipv6.fib6_main_tbl, + GFP_KERNEL); if (!net->ipv6.fib6_main_tbl) goto out_fib_table_hash; @@ -2491,8 +2491,8 @@ static int __net_init fib6_net_init(struct net *net) INIT_HLIST_HEAD(&net->ipv6.fib6_main_tbl->tb6_gc_hlist); #ifdef CONFIG_IPV6_MULTIPLE_TABLES - net->ipv6.fib6_local_tbl = kzalloc(sizeof(*net->ipv6.fib6_local_tbl), - GFP_KERNEL); + net->ipv6.fib6_local_tbl = kzalloc_obj(*net->ipv6.fib6_local_tbl, + GFP_KERNEL); if (!net->ipv6.fib6_local_tbl) goto out_fib6_main_tbl; net->ipv6.fib6_local_tbl->tb6_id = RT6_TABLE_LOCAL; diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 60d0be47a9f3..f89e0af5a9ed 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -386,7 +386,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, goto done; err = -ENOMEM; - fl = kzalloc(sizeof(*fl), GFP_KERNEL); + fl = kzalloc_obj(*fl, GFP_KERNEL); if (!fl) goto done; @@ -638,7 +638,7 @@ static int ipv6_flowlabel_get(struct sock *sk, struct in6_flowlabel_req *freq, if (!fl) return err; - sfl1 = kmalloc(sizeof(*sfl1), GFP_KERNEL); + sfl1 = kmalloc_obj(*sfl1, GFP_KERNEL); if (freq->flr_label) { err = -EEXIST; diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 769c39fed1f3..8e2a6b28cea7 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -1359,7 +1359,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, if (WARN_ON(v6_cork->opt)) return -EINVAL; - nopt = v6_cork->opt = kzalloc(sizeof(*opt), sk->sk_allocation); + nopt = v6_cork->opt = kzalloc_obj(*opt, sk->sk_allocation); if (unlikely(!nopt)) return -ENOBUFS; diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index d784a8644ff2..152388dc96ec 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -66,7 +66,7 @@ int ip6_ra_control(struct sock *sk, int sel) if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num != IPPROTO_RAW) return -ENOPROTOOPT; - new_ra = (sel >= 0) ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL; + new_ra = (sel >= 0) ? kmalloc_obj(*new_ra, GFP_KERNEL) : NULL; if (sel >= 0 && !new_ra) return -ENOMEM; diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 016b572e7d6f..f982f3b71435 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -740,7 +740,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) * for deleted items allows change reports to use common code with * non-deleted or query-response MCA's. */ - pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); + pmc = kzalloc_obj(*pmc, GFP_KERNEL); if (!pmc) return; @@ -868,7 +868,7 @@ static struct ifmcaddr6 *mca_alloc(struct inet6_dev *idev, mc_assert_locked(idev); - mc = kzalloc(sizeof(*mc), GFP_KERNEL); + mc = kzalloc_obj(*mc, GFP_KERNEL); if (!mc) return NULL; @@ -2415,7 +2415,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, psf_prev = psf; } if (!psf) { - psf = kzalloc(sizeof(*psf), GFP_KERNEL); + psf = kzalloc_obj(*psf, GFP_KERNEL); if (!psf) return -ENOBUFS; @@ -2500,7 +2500,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc) &psf->sf_addr)) break; if (!dpsf) { - dpsf = kmalloc(sizeof(*dpsf), GFP_KERNEL); + dpsf = kmalloc_obj(*dpsf, GFP_KERNEL); if (!dpsf) continue; *dpsf = *psf; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c0350d97307e..dd50cf2bf6ef 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -684,14 +684,14 @@ static void rt6_probe(struct fib6_nh *fib6_nh) time_after(jiffies, neigh->updated + READ_ONCE(idev->cnf.rtr_probe_interval))) { - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); if (work) __neigh_set_probe_once(neigh); } write_unlock_bh(&neigh->lock); } else if (time_after(jiffies, last_probe + READ_ONCE(idev->cnf.rtr_probe_interval))) { - work = kmalloc(sizeof(*work), GFP_ATOMIC); + work = kmalloc_obj(*work, GFP_ATOMIC); } if (!work || cmpxchg(&fib6_nh->last_probe, @@ -1723,8 +1723,8 @@ static int rt6_insert_exception(struct rt6_info *nrt, bucket = rcu_dereference_protected(nh->rt6i_exception_bucket, lockdep_is_held(&rt6_exception_lock)); if (!bucket) { - bucket = kcalloc(FIB6_EXCEPTION_BUCKET_SIZE, sizeof(*bucket), - GFP_ATOMIC); + bucket = kzalloc_objs(*bucket, FIB6_EXCEPTION_BUCKET_SIZE, + GFP_ATOMIC); if (!bucket) { err = -ENOMEM; goto out; @@ -1759,7 +1759,7 @@ static int rt6_insert_exception(struct rt6_info *nrt, if (rt6_ex) rt6_remove_exception(bucket, rt6_ex); - rt6_ex = kzalloc(sizeof(*rt6_ex), GFP_ATOMIC); + rt6_ex = kzalloc_obj(*rt6_ex, GFP_ATOMIC); if (!rt6_ex) { err = -ENOMEM; goto out; @@ -5331,7 +5331,7 @@ static int ip6_route_info_append(struct list_head *rt6_nh_list, return -EEXIST; } - nh = kzalloc(sizeof(*nh), GFP_KERNEL); + nh = kzalloc_obj(*nh, GFP_KERNEL); if (!nh) return -ENOMEM; @@ -6778,7 +6778,7 @@ static struct pernet_operations ip6_route_net_ops = { static int __net_init ipv6_inetpeer_init(struct net *net) { - struct inet_peer_base *bp = kmalloc(sizeof(*bp), GFP_KERNEL); + struct inet_peer_base *bp = kmalloc_obj(*bp, GFP_KERNEL); if (!bp) return -ENOMEM; diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index a5c4c629b788..b53c491079cd 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c @@ -202,7 +202,7 @@ static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info) secret = (char *)nla_data(info->attrs[SEG6_ATTR_SECRET]); - hinfo = kzalloc(sizeof(*hinfo), GFP_KERNEL); + hinfo = kzalloc_obj(*hinfo, GFP_KERNEL); if (!hinfo) { err = -ENOMEM; goto out_unlock; @@ -339,7 +339,7 @@ static int seg6_genl_dumphmac_start(struct netlink_callback *cb) iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return -ENOMEM; @@ -421,13 +421,13 @@ static int __net_init seg6_net_init(struct net *net) { struct seg6_pernet_data *sdata; - sdata = kzalloc(sizeof(*sdata), GFP_KERNEL); + sdata = kzalloc_obj(*sdata, GFP_KERNEL); if (!sdata) return -ENOMEM; mutex_init(&sdata->lock); - sdata->tun_src = kzalloc(sizeof(*sdata->tun_src), GFP_KERNEL); + sdata->tun_src = kzalloc_obj(*sdata->tun_src, GFP_KERNEL); if (!sdata->tun_src) { kfree(sdata); return -ENOMEM; diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 439c8a1c6625..ca7955831c28 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -323,7 +323,7 @@ static int ipip6_tunnel_get_prl(struct net_device *dev, struct ip_tunnel_prl __u * we try harder to allocate. */ kp = (cmax <= 1 || capable(CAP_NET_ADMIN)) ? - kcalloc(cmax, sizeof(*kp), GFP_KERNEL_ACCOUNT | __GFP_NOWARN) : + kzalloc_objs(*kp, cmax, GFP_KERNEL_ACCOUNT | __GFP_NOWARN) : NULL; ca = min(t->prl_count, cmax); @@ -334,8 +334,8 @@ static int ipip6_tunnel_get_prl(struct net_device *dev, struct ip_tunnel_prl __u * For root users, retry allocating enough memory for * the answer. */ - kp = kcalloc(ca, sizeof(*kp), GFP_ATOMIC | __GFP_ACCOUNT | - __GFP_NOWARN); + kp = kzalloc_objs(*kp, ca, + GFP_ATOMIC | __GFP_ACCOUNT | __GFP_NOWARN); if (!kp) { ret = -ENOMEM; goto out; @@ -394,7 +394,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg) goto out; } - p = kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL); + p = kzalloc_obj(struct ip_tunnel_prl_entry, GFP_KERNEL); if (!p) { err = -ENOBUFS; goto out; diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 1e62fbc22cb7..6554d2cffc19 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -1719,7 +1719,7 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg) goto out_unlock; save_message: - save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA); + save_msg = kzalloc_obj(struct sock_msg_q, GFP_ATOMIC | GFP_DMA); if (!save_msg) goto out_unlock; save_msg->path = path; diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index b43b1059eea8..0c3492c873ca 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -90,7 +90,7 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs, char buf[20]; int rc; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) goto out_error; va_start(vargs, fmt); @@ -378,7 +378,7 @@ static int iucv_query_maxconn(void) void *param; int ccode; - param = kzalloc(sizeof(union iucv_param), GFP_KERNEL | GFP_DMA); + param = kzalloc_obj(union iucv_param, GFP_KERNEL | GFP_DMA); if (!param) return -ENOMEM; ccode = __iucv_query_maxconn(param, &max_pathid); @@ -1808,7 +1808,7 @@ static void iucv_external_interrupt(struct ext_code ext_code, return; } BUG_ON(p->iptype < 0x01 || p->iptype > 0x09); - work = kmalloc(sizeof(struct iucv_irq_list), GFP_ATOMIC); + work = kmalloc_obj(struct iucv_irq_list, GFP_ATOMIC); if (!work) { pr_warn("iucv_external_interrupt: out of memory\n"); return; diff --git a/net/key/af_key.c b/net/key/af_key.c index 571200433aa9..83c7697c679a 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1196,7 +1196,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, err = -ENOSYS; goto out; } - x->calg = kmalloc(sizeof(*x->calg), GFP_KERNEL); + x->calg = kmalloc_obj(*x->calg, GFP_KERNEL); if (!x->calg) { err = -ENOMEM; goto out; @@ -1261,7 +1261,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, const struct sadb_x_nat_t_type* n_type; struct xfrm_encap_tmpl *natt; - x->encap = kzalloc(sizeof(*x->encap), GFP_KERNEL); + x->encap = kzalloc_obj(*x->encap, GFP_KERNEL); if (!x->encap) { err = -ENOMEM; goto out; @@ -1855,7 +1855,7 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, const struct sadb_ms mutex_unlock(&pfk->dump_lock); return -EINVAL; } - filter = kmalloc(sizeof(*filter), GFP_KERNEL); + filter = kmalloc_obj(*filter, GFP_KERNEL); if (filter == NULL) { mutex_unlock(&pfk->dump_lock); return -ENOMEM; diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index f9b0f666600f..1b84338f2a90 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -487,7 +487,7 @@ static int l2tp_session_collision_add(struct l2tp_net *pn, /* First collision. Allocate list to manage the collided sessions * and add the existing session to the list. */ - clist = kmalloc(sizeof(*clist), GFP_ATOMIC); + clist = kmalloc_obj(*clist, GFP_ATOMIC); if (!clist) return -ENOMEM; @@ -1572,7 +1572,7 @@ int l2tp_tunnel_create(int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, if (cfg) encap = cfg->encap; - tunnel = kzalloc(sizeof(*tunnel), GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); if (!tunnel) { err = -ENOMEM; goto err; diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c index 5cfaab7d0890..56ea3ed20581 100644 --- a/net/l2tp/l2tp_debugfs.c +++ b/net/l2tp/l2tp_debugfs.c @@ -269,7 +269,7 @@ static int l2tp_dfs_seq_open(struct inode *inode, struct file *file) struct seq_file *seq; int rc = -ENOMEM; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) goto out; diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index a0596e1f91da..670e0859a3e6 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c @@ -110,7 +110,7 @@ static struct lapb_cb *lapb_devtostruct(struct net_device *dev) */ static struct lapb_cb *lapb_create_cb(void) { - struct lapb_cb *lapb = kzalloc(sizeof(*lapb), GFP_ATOMIC); + struct lapb_cb *lapb = kzalloc_obj(*lapb, GFP_ATOMIC); if (!lapb) goto out; diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index 4f16d9c88350..d73f5414d8ce 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c @@ -32,7 +32,7 @@ static DEFINE_SPINLOCK(llc_sap_list_lock); */ static struct llc_sap *llc_sap_alloc(void) { - struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); + struct llc_sap *sap = kzalloc_obj(*sap, GFP_ATOMIC); int i; if (sap) { diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 7da909d78c68..e8670a46371c 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -395,7 +395,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, } /* prepare A-MPDU MLME for Rx aggregation */ - tid_agg_rx = kzalloc(sizeof(*tid_agg_rx), GFP_KERNEL); + tid_agg_rx = kzalloc_obj(*tid_agg_rx, GFP_KERNEL); if (!tid_agg_rx) goto end; @@ -411,7 +411,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, /* prepare reordering buffer */ tid_agg_rx->reorder_buf = - kcalloc(buf_size, sizeof(struct sk_buff_head), GFP_KERNEL); + kzalloc_objs(struct sk_buff_head, buf_size, GFP_KERNEL); tid_agg_rx->reorder_time = kcalloc(buf_size, sizeof(unsigned long), GFP_KERNEL); if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) { diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index d981b0fc57bf..93b47a7ba9c4 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c @@ -710,7 +710,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, } /* prepare A-MPDU MLME for Tx aggregation */ - tid_tx = kzalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC); + tid_tx = kzalloc_obj(struct tid_ampdu_tx, GFP_ATOMIC); if (!tid_tx) { ret = -ENOMEM; goto err_unlock_sta; diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5d04d7d550b0..d1adbc4984d1 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3940,9 +3940,8 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) if (beacon->mbssid_ies && beacon->mbssid_ies->cnt) { new_beacon->mbssid_ies = - kzalloc(struct_size(new_beacon->mbssid_ies, - elem, beacon->mbssid_ies->cnt), - GFP_KERNEL); + kzalloc_flex(*new_beacon->mbssid_ies, elem, + beacon->mbssid_ies->cnt, GFP_KERNEL); if (!new_beacon->mbssid_ies) { kfree(new_beacon); return NULL; @@ -3950,9 +3949,8 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) if (beacon->rnr_ies && beacon->rnr_ies->cnt) { new_beacon->rnr_ies = - kzalloc(struct_size(new_beacon->rnr_ies, - elem, beacon->rnr_ies->cnt), - GFP_KERNEL); + kzalloc_flex(*new_beacon->rnr_ies, elem, + beacon->rnr_ies->cnt, GFP_KERNEL); if (!new_beacon->rnr_ies) { kfree(new_beacon->mbssid_ies); kfree(new_beacon); @@ -4744,7 +4742,7 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy, struct mac80211_qos_map *new_qos_map, *old_qos_map; if (qos_map) { - new_qos_map = kzalloc(sizeof(*new_qos_map), GFP_KERNEL); + new_qos_map = kzalloc_obj(*new_qos_map, GFP_KERNEL); if (!new_qos_map) return -ENOMEM; memcpy(&new_qos_map->qos_map, qos_map, sizeof(*qos_map)); diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index d8c5f11afc15..60654b0b542d 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -1612,7 +1612,7 @@ static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, lockdep_assert_wiphy(local->hw.wiphy); - vif_chsw = kcalloc(n_vifs, sizeof(vif_chsw[0]), GFP_KERNEL); + vif_chsw = kzalloc_objs(vif_chsw[0], n_vifs, GFP_KERNEL); if (!vif_chsw) return -ENOMEM; diff --git a/net/mac80211/led.c b/net/mac80211/led.c index fabbffdd3ac2..f93fe928c4bc 100644 --- a/net/mac80211/led.c +++ b/net/mac80211/led.c @@ -298,7 +298,7 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, if (WARN_ON(local->tpt_led_trigger)) return NULL; - tpt_trig = kzalloc(sizeof(struct tpt_led_trigger), GFP_KERNEL); + tpt_trig = kzalloc_obj(struct tpt_led_trigger, GFP_KERNEL); if (!tpt_trig) return NULL; diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 17bf55dabd31..7102d113d89d 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -295,7 +295,7 @@ static int ieee80211_vif_update_links(struct ieee80211_sub_if_data *sdata, /* allocate new link structures first */ for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = kzalloc_obj(*link, GFP_KERNEL); if (!link) { ret = -ENOMEM; goto free; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index bedc81956fbc..9825d7c70cbc 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1359,9 +1359,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); - local->int_scan_req = kzalloc(struct_size(local->int_scan_req, - channels, channels), - GFP_KERNEL); + local->int_scan_req = kzalloc_flex(*local->int_scan_req, channels, + channels, GFP_KERNEL); if (!local->int_scan_req) return -ENOMEM; diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 68901f1def0d..a7bd4dd9aa19 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -178,7 +178,7 @@ int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) { int i; - sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); + sdata->u.mesh.rmc = kmalloc_obj(struct mesh_rmc, GFP_KERNEL); if (!sdata->u.mesh.rmc) return -ENOMEM; sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; @@ -1560,8 +1560,7 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, lockdep_assert_wiphy(sdata->local->hw.wiphy); - tmp_csa_settings = kmalloc(sizeof(*tmp_csa_settings), - GFP_ATOMIC); + tmp_csa_settings = kmalloc_obj(*tmp_csa_settings, GFP_ATOMIC); if (!tmp_csa_settings) return -ENOMEM; diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index a41b57bd11ff..98d5aaa36d00 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -1005,7 +1005,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags) struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct mesh_preq_queue *preq_node; - preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); + preq_node = kmalloc_obj(struct mesh_preq_queue, GFP_ATOMIC); if (!preq_node) { mhwmp_dbg(sdata, "could not allocate PREQ node\n"); return; diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 0319674be832..03171cf00855 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -405,7 +405,7 @@ struct mesh_path *mesh_path_new(struct ieee80211_sub_if_data *sdata, { struct mesh_path *new_mpath; - new_mpath = kzalloc(sizeof(struct mesh_path), gfp_flags); + new_mpath = kzalloc_obj(struct mesh_path, gfp_flags); if (!new_mpath) return NULL; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e83582b2c377..c1d0808f2545 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -10839,7 +10839,7 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata, if (added_links) { bool uapsd_supported; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index ae82533e3c02..00ef339f7de4 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -579,7 +579,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local, if (!local->emulate_chanctx && !local->ops->remain_on_channel) return -EOPNOTSUPP; - roc = kzalloc(sizeof(*roc), GFP_KERNEL); + roc = kzalloc_obj(*roc, GFP_KERNEL); if (!roc) return -ENOMEM; diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c index 8260f6bdd5b2..2b3632c6008a 100644 --- a/net/mac80211/parse.c +++ b/net/mac80211/parse.c @@ -1048,8 +1048,8 @@ ieee802_11_parse_elems_full(struct ieee80211_elems_parse_params *params) if (WARN_ON(params->link_id >= 0 && params->bss)) return NULL; - elems_parse = kzalloc(struct_size(elems_parse, scratch, scratch_len), - GFP_ATOMIC); + elems_parse = kzalloc_flex(*elems_parse, scratch, scratch_len, + GFP_ATOMIC); if (!elems_parse) return NULL; diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index e441f8541603..3ae891be800b 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -163,7 +163,7 @@ int ieee80211_rate_control_register(const struct rate_control_ops *ops) } } - alg = kzalloc(sizeof(*alg), GFP_KERNEL); + alg = kzalloc_obj(*alg, GFP_KERNEL); if (alg == NULL) { mutex_unlock(&rate_ctrl_mutex); return -ENOMEM; @@ -263,7 +263,7 @@ rate_control_alloc(const char *name, struct ieee80211_local *local) { struct rate_control_ref *ref; - ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL); + ref = kmalloc_obj(struct rate_control_ref, GFP_KERNEL); if (!ref) return NULL; ref->ops = ieee80211_rate_control_ops_get(name); diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index f66910013218..62745ca00e06 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1553,7 +1553,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) int i = 0; int max_rates = min_t(int, mp->hw->max_rates, IEEE80211_TX_RATE_TABLE_SIZE); - rates = kzalloc(sizeof(*rates), GFP_ATOMIC); + rates = kzalloc_obj(*rates, GFP_ATOMIC); if (!rates) return; @@ -1862,7 +1862,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) max_rates = sband->n_bitrates; } - return kzalloc(sizeof(*mi), gfp); + return kzalloc_obj(*mi, gfp); } static void @@ -1930,7 +1930,7 @@ minstrel_ht_alloc(struct ieee80211_hw *hw) struct minstrel_priv *mp; int i; - mp = kzalloc(sizeof(struct minstrel_priv), GFP_ATOMIC); + mp = kzalloc_obj(struct minstrel_priv, GFP_ATOMIC); if (!mp) return NULL; diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index a79ebeb43585..6abcf410a0ca 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -644,7 +644,7 @@ __sta_info_alloc(struct ieee80211_sub_if_data *sdata, wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work); #ifdef CONFIG_MAC80211_MESH if (ieee80211_vif_is_mesh(&sdata->vif)) { - sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); + sta->mesh = kzalloc_obj(*sta->mesh, gfp); if (!sta->mesh) goto free; sta->mesh->plink_sta = sta; @@ -903,7 +903,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) goto out_cleanup; } - sinfo = kzalloc(sizeof(struct station_info), GFP_KERNEL); + sinfo = kzalloc_obj(struct station_info, GFP_KERNEL); if (!sinfo) { err = -ENOMEM; goto out_cleanup; @@ -1545,7 +1545,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc) } } - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); if (sinfo) sta_set_sinfo(sta, sinfo, true); @@ -3306,7 +3306,7 @@ int ieee80211_sta_allocate_link(struct sta_info *sta, unsigned int link_id) sta->link[link_id])) return -EBUSY; - alloc = kzalloc(sizeof(*alloc), GFP_KERNEL); + alloc = kzalloc_obj(*alloc, GFP_KERNEL); if (!alloc) return -ENOMEM; diff --git a/net/mac80211/tests/util.c b/net/mac80211/tests/util.c index 9c2d63a5cd2b..cddc46eeb648 100644 --- a/net/mac80211/tests/util.c +++ b/net/mac80211/tests/util.c @@ -195,16 +195,16 @@ int t_sdata_init(struct kunit_resource *resource, void *ctx) struct kunit *test = kunit_get_current_test(); struct t_sdata *t_sdata; - t_sdata = kzalloc(sizeof(*t_sdata), GFP_KERNEL); + t_sdata = kzalloc_obj(*t_sdata, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, t_sdata); resource->data = t_sdata; resource->name = "sdata"; - t_sdata->sdata = kzalloc(sizeof(*t_sdata->sdata), GFP_KERNEL); + t_sdata->sdata = kzalloc_obj(*t_sdata->sdata, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, t_sdata->sdata); - t_sdata->wiphy = kzalloc(sizeof(*t_sdata->wiphy), GFP_KERNEL); + t_sdata->wiphy = kzalloc_obj(*t_sdata->wiphy, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, t_sdata->wiphy); strscpy(t_sdata->sdata->name, "kunit"); diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 007f5a368d41..a3113e1d9829 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1611,8 +1611,7 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local) local->cparams.target = MS2TIME(20); local->cparams.ecn = true; - local->cvars = kvcalloc(fq->flows_cnt, sizeof(local->cvars[0]), - GFP_KERNEL); + local->cvars = kvzalloc_objs(local->cvars[0], fq->flows_cnt, GFP_KERNEL); if (!local->cvars) { spin_lock_bh(&fq->lock); fq_reset(fq, fq_skb_free_func); @@ -5549,8 +5548,7 @@ ieee80211_beacon_get_ap_ema_list(struct ieee80211_hw *hw, if (!beacon->mbssid_ies || !beacon->mbssid_ies->cnt) return NULL; - ema = kzalloc(struct_size(ema, bcn, beacon->mbssid_ies->cnt), - GFP_ATOMIC); + ema = kzalloc_flex(*ema, bcn, beacon->mbssid_ies->cnt, GFP_ATOMIC); if (!ema) return NULL; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a5e09c0fa6b3..22efb399b5bc 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1742,9 +1742,8 @@ static int ieee80211_reconfig_nan(struct ieee80211_sub_if_data *sdata) if (WARN_ON(res)) return res; - funcs = kcalloc(sdata->local->hw.max_nan_de_entries + 1, - sizeof(*funcs), - GFP_KERNEL); + funcs = kzalloc_objs(*funcs, sdata->local->hw.max_nan_de_entries + 1, + GFP_KERNEL); if (!funcs) return -ENOMEM; diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c index ef7f23af043f..44ad05726db3 100644 --- a/net/mac802154/cfg.c +++ b/net/mac802154/cfg.c @@ -339,7 +339,7 @@ static int mac802154_associate(struct wpan_phy *wpan_phy, if (coord->mode == IEEE802154_SHORT_ADDRESSING) return -EINVAL; - parent = kzalloc(sizeof(*parent), GFP_KERNEL); + parent = kzalloc_obj(*parent, GFP_KERNEL); if (!parent) return -ENOMEM; diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c index f13b07ebfb98..0489f2515eb6 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -117,7 +117,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template) struct mac802154_llsec_key *key; int i; - key = kzalloc(sizeof(*key), GFP_KERNEL); + key = kzalloc_obj(*key, GFP_KERNEL); if (!key) return NULL; @@ -241,7 +241,7 @@ int mac802154_llsec_key_add(struct mac802154_llsec *sec, break; } - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOMEM; @@ -369,7 +369,7 @@ int mac802154_llsec_dev_add(struct mac802154_llsec *sec, llsec_dev_find_long(sec, dev->hwaddr)) return -EEXIST; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -441,7 +441,7 @@ int mac802154_llsec_devkey_add(struct mac802154_llsec *sec, if (llsec_devkey_find(dev, &key->key_id)) return -EEXIST; - devkey = kmalloc(sizeof(*devkey), GFP_KERNEL); + devkey = kmalloc_obj(*devkey, GFP_KERNEL); if (!devkey) return -ENOMEM; @@ -500,7 +500,7 @@ int mac802154_llsec_seclevel_add(struct mac802154_llsec *sec, if (llsec_find_seclevel(sec, sl)) return -EEXIST; - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -925,7 +925,7 @@ llsec_update_devkey_record(struct mac802154_llsec_device *dev, if (!devkey) { struct mac802154_llsec_device_key *next; - next = kzalloc(sizeof(*devkey), GFP_ATOMIC); + next = kzalloc_obj(*devkey, GFP_ATOMIC); if (!next) return -ENOMEM; diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index aac359b5c71d..cd8f2a11920d 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c @@ -213,7 +213,7 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata, if (!mac802154_is_scanning(sdata->local)) goto fail; - mac_pkt = kzalloc(sizeof(*mac_pkt), GFP_ATOMIC); + mac_pkt = kzalloc_obj(*mac_pkt, GFP_ATOMIC); if (!mac_pkt) goto fail; @@ -227,7 +227,7 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata, case IEEE802154_FC_TYPE_MAC_CMD: dev_dbg(&sdata->dev->dev, "MAC COMMAND received\n"); - mac_pkt = kzalloc(sizeof(*mac_pkt), GFP_ATOMIC); + mac_pkt = kzalloc_obj(*mac_pkt, GFP_ATOMIC); if (!mac_pkt) goto fail; diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index a6dab3cc3ad8..583178784c9b 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -798,7 +798,7 @@ int mac802154_process_association_req(struct ieee802154_sub_if_data *sdata, goto unlock; } - child = kzalloc(sizeof(*child), GFP_KERNEL); + child = kzalloc_obj(*child, GFP_KERNEL); if (!child) { ret = -ENOMEM; goto unlock; diff --git a/net/mctp/device.c b/net/mctp/device.c index 04c5570bacff..08f3d35fa45b 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -336,7 +336,7 @@ static struct mctp_dev *mctp_add_dev(struct net_device *dev) ASSERT_RTNL(); - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return ERR_PTR(-ENOMEM); diff --git a/net/mctp/neigh.c b/net/mctp/neigh.c index fc85f0e69301..5894433535eb 100644 --- a/net/mctp/neigh.c +++ b/net/mctp/neigh.c @@ -40,7 +40,7 @@ static int mctp_neigh_add(struct mctp_dev *mdev, mctp_eid_t eid, goto out; } - neigh = kzalloc(sizeof(*neigh), GFP_KERNEL); + neigh = kzalloc_obj(*neigh, GFP_KERNEL); if (!neigh) { rc = -ENOMEM; goto out; diff --git a/net/mctp/route.c b/net/mctp/route.c index ecbbe4beb213..349fc650a805 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -227,7 +227,7 @@ static struct mctp_sk_key *mctp_key_alloc(struct mctp_sock *msk, { struct mctp_sk_key *key; - key = kzalloc(sizeof(*key), gfp); + key = kzalloc_obj(*key, gfp); if (!key) return NULL; @@ -675,7 +675,7 @@ static struct mctp_route *mctp_route_alloc(void) { struct mctp_route *rt; - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) return NULL; diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c index 37f1ba62a2ab..922b2c353a4e 100644 --- a/net/mctp/test/utils.c +++ b/net/mctp/test/utils.c @@ -106,7 +106,7 @@ static struct mctp_test_route *mctp_route_test_alloc(void) { struct mctp_test_route *rt; - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) return NULL; diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 580aac112dd2..82d885b8478a 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1470,7 +1470,7 @@ static struct mpls_dev *mpls_add_dev(struct net_device *dev) int err = -ENOMEM; int i; - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return ERR_PTR(err); @@ -1977,7 +1977,7 @@ static int mpls_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, struct mpls_route_config *cfg; int err; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; @@ -2002,7 +2002,7 @@ static int mpls_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, struct mpls_route_config *cfg; int err; - cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + cfg = kzalloc_obj(*cfg, GFP_KERNEL); if (!cfg) return -ENOMEM; diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index e2040c327af6..7298836469b3 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -388,7 +388,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, goto reset_timer; } - add_entry = kmalloc(sizeof(*add_entry), GFP_ATOMIC); + add_entry = kmalloc_obj(*add_entry, GFP_ATOMIC); if (!add_entry) return false; diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index f66129f1e649..7ef1d2bd26e4 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1842,7 +1842,7 @@ static struct mptcp_subflow_context *subflow_create_ctx(struct sock *sk, struct inet_connection_sock *icsk = inet_csk(sk); struct mptcp_subflow_context *ctx; - ctx = kzalloc(sizeof(*ctx), priority); + ctx = kzalloc_obj(*ctx, priority); if (!ctx) return NULL; diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 446e4e3b9553..dec9812c3fbb 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -211,7 +211,7 @@ struct ncsi_channel *ncsi_add_channel(struct ncsi_package *np, unsigned char id) int index; unsigned long flags; - nc = kzalloc(sizeof(*nc), GFP_ATOMIC); + nc = kzalloc_obj(*nc, GFP_ATOMIC); if (!nc) return NULL; @@ -285,7 +285,7 @@ struct ncsi_package *ncsi_add_package(struct ncsi_dev_priv *ndp, struct ncsi_package *np, *tmp; unsigned long flags; - np = kzalloc(sizeof(*np), GFP_ATOMIC); + np = kzalloc_obj(*np, GFP_ATOMIC); if (!np) return NULL; @@ -1697,7 +1697,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) return -ENOSPC; } - vlan = kzalloc(sizeof(*vlan), GFP_KERNEL); + vlan = kzalloc_obj(*vlan, GFP_KERNEL); if (!vlan) return -ENOMEM; @@ -1767,7 +1767,7 @@ struct ncsi_dev *ncsi_register_dev(struct net_device *dev, return nd; /* Create NCSI device */ - ndp = kzalloc(sizeof(*ndp), GFP_ATOMIC); + ndp = kzalloc_obj(*ndp, GFP_ATOMIC); if (!ndp) return NULL; diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index cc20e6d56807..c3beef6155b6 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -1077,7 +1077,7 @@ static int ip_set_create(struct sk_buff *skb, const struct nfnl_info *info, /* First, and without any locks, allocate and initialize * a normal base set structure. */ - set = kzalloc(sizeof(*set), GFP_KERNEL); + set = kzalloc_obj(*set, GFP_KERNEL); if (!set) return -ENOMEM; spin_lock_init(&set->lock); @@ -1135,7 +1135,7 @@ static int ip_set_create(struct sk_buff *skb, const struct nfnl_info *info, /* Wraparound */ goto cleanup; - list = kvcalloc(i, sizeof(struct ip_set *), GFP_KERNEL); + list = kvzalloc_objs(struct ip_set *, i, GFP_KERNEL); if (!list) goto cleanup; /* nfnl mutex is held, both lists are valid */ @@ -2377,7 +2377,7 @@ ip_set_net_init(struct net *net) if (inst->ip_set_max >= IPSET_INVALID_ID) inst->ip_set_max = IPSET_INVALID_ID - 1; - list = kvcalloc(inst->ip_set_max, sizeof(struct ip_set *), GFP_KERNEL); + list = kvzalloc_objs(struct ip_set *, inst->ip_set_max, GFP_KERNEL); if (!list) return -ENOMEM; inst->is_deleted = false; diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 5e4453e9ef8e..181daa9c2019 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -998,7 +998,7 @@ resize: /* Resize is in process and kernel side add, save values */ struct mtype_resize_ad *x; - x = kzalloc(sizeof(struct mtype_resize_ad), GFP_ATOMIC); + x = kzalloc_obj(struct mtype_resize_ad, GFP_ATOMIC); if (!x) /* Don't bother */ goto out; @@ -1086,8 +1086,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext, /* Resize is in process and kernel side del, * save values */ - x = kzalloc(sizeof(struct mtype_resize_ad), - GFP_ATOMIC); + x = kzalloc_obj(struct mtype_resize_ad, GFP_ATOMIC); if (x) { x->ad = IPSET_DEL; memcpy(&x->d, value, diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c index 13c7a08aa868..39165c014bd9 100644 --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -598,7 +598,7 @@ init_list_set(struct net *net, struct ip_set *set, u32 size) { struct list_set *map; - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (!map) return false; diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index 50cc492c7553..e05991ec49f3 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c @@ -1510,8 +1510,8 @@ int __init ip_vs_conn_init(void) */ tab_array_size = array_size(ip_vs_conn_tab_size, sizeof(*ip_vs_conn_tab)); - ip_vs_conn_tab = kvmalloc_array(ip_vs_conn_tab_size, - sizeof(*ip_vs_conn_tab), GFP_KERNEL); + ip_vs_conn_tab = kvmalloc_objs(*ip_vs_conn_tab, ip_vs_conn_tab_size, + GFP_KERNEL); if (!ip_vs_conn_tab) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 068702894377..d38867c52180 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -938,7 +938,7 @@ int ip_vs_stats_init_alloc(struct ip_vs_stats *s) struct ip_vs_stats *ip_vs_stats_alloc(void) { - struct ip_vs_stats *s = kzalloc(sizeof(*s), GFP_KERNEL); + struct ip_vs_stats *s = kzalloc_obj(*s, GFP_KERNEL); if (s && ip_vs_stats_init_alloc(s) >= 0) return s; @@ -1079,7 +1079,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest) return -EINVAL; } - dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); + dest = kzalloc_obj(struct ip_vs_dest, GFP_KERNEL); if (dest == NULL) return -ENOMEM; @@ -1421,7 +1421,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u, ret_hooks = ret; } - svc = kzalloc(sizeof(struct ip_vs_service), GFP_KERNEL); + svc = kzalloc_obj(struct ip_vs_service, GFP_KERNEL); if (svc == NULL) { IP_VS_DBG(1, "%s(): no memory\n", __func__); ret = -ENOMEM; @@ -4439,7 +4439,7 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) INIT_DELAYED_WORK(&ipvs->est_reload_work, est_reload_work_handler); /* procfs stats */ - ipvs->tot_stats = kzalloc(sizeof(*ipvs->tot_stats), GFP_KERNEL); + ipvs->tot_stats = kzalloc_obj(*ipvs->tot_stats, GFP_KERNEL); if (!ipvs->tot_stats) goto out; if (ip_vs_stats_init_alloc(&ipvs->tot_stats->s) < 0) diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c index bb7aca4601ff..ac1d6f5bfe8a 100644 --- a/net/netfilter/ipvs/ip_vs_dh.c +++ b/net/netfilter/ipvs/ip_vs_dh.c @@ -153,7 +153,7 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc) struct ip_vs_dh_state *s; /* allocate the DH table for this service */ - s = kzalloc(sizeof(struct ip_vs_dh_state), GFP_KERNEL); + s = kzalloc_obj(struct ip_vs_dh_state, GFP_KERNEL); if (s == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index 77f4f637ff67..06999a17519b 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c @@ -325,7 +325,7 @@ static int ip_vs_est_add_kthread(struct netns_ipvs *ipvs) id = i; } - kd = kzalloc(sizeof(*kd), GFP_KERNEL); + kd = kzalloc_obj(*kd, GFP_KERNEL); if (!kd) goto out; kd->ipvs = ipvs; @@ -443,7 +443,7 @@ add_est: td = rcu_dereference_protected(kd->ticks[row], 1); if (!td) { - td = kzalloc(sizeof(*td), GFP_KERNEL); + td = kzalloc_obj(*td, GFP_KERNEL); if (!td) { ret = -ENOMEM; goto out; diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index e6c8ed0c92f6..36d91153712c 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -204,7 +204,7 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr, return en; ip_vs_lblc_del(en); } - en = kmalloc(sizeof(*en), GFP_ATOMIC); + en = kmalloc_obj(*en, GFP_ATOMIC); if (!en) return NULL; @@ -347,7 +347,7 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) /* * Allocate the ip_vs_lblc_table for this service */ - tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kmalloc_obj(*tbl, GFP_KERNEL); if (tbl == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index a25cf7bb6185..eba6600decbe 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c @@ -107,7 +107,7 @@ static void ip_vs_dest_set_insert(struct ip_vs_dest_set *set, } } - e = kmalloc(sizeof(*e), GFP_ATOMIC); + e = kmalloc_obj(*e, GFP_ATOMIC); if (e == NULL) return; @@ -363,7 +363,7 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, en = ip_vs_lblcr_get(af, tbl, daddr); if (!en) { - en = kmalloc(sizeof(*en), GFP_ATOMIC); + en = kmalloc_obj(*en, GFP_ATOMIC); if (!en) return NULL; @@ -510,7 +510,7 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) /* * Allocate the ip_vs_lblcr_table for this service */ - tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); + tbl = kmalloc_obj(*tbl, GFP_KERNEL); if (tbl == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_mh.c b/net/netfilter/ipvs/ip_vs_mh.c index f61f54004c9e..7f5be86bab4d 100644 --- a/net/netfilter/ipvs/ip_vs_mh.c +++ b/net/netfilter/ipvs/ip_vs_mh.c @@ -293,9 +293,8 @@ static int ip_vs_mh_reassign(struct ip_vs_mh_state *s, return -EINVAL; if (svc->num_dests >= 1) { - s->dest_setup = kcalloc(svc->num_dests, - sizeof(struct ip_vs_mh_dest_setup), - GFP_KERNEL); + s->dest_setup = kzalloc_objs(struct ip_vs_mh_dest_setup, + svc->num_dests, GFP_KERNEL); if (!s->dest_setup) return -ENOMEM; } @@ -383,12 +382,12 @@ static int ip_vs_mh_init_svc(struct ip_vs_service *svc) struct ip_vs_mh_state *s; /* Allocate the MH table for this service */ - s = kzalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc_obj(*s, GFP_KERNEL); if (!s) return -ENOMEM; - s->lookup = kcalloc(IP_VS_MH_TAB_SIZE, sizeof(struct ip_vs_mh_lookup), - GFP_KERNEL); + s->lookup = kzalloc_objs(struct ip_vs_mh_lookup, IP_VS_MH_TAB_SIZE, + GFP_KERNEL); if (!s->lookup) { kfree(s); return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index fd9dbca24c85..a62c1e8fc1da 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c @@ -66,7 +66,7 @@ register_ip_vs_proto_netns(struct netns_ipvs *ipvs, struct ip_vs_protocol *pp) { unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); struct ip_vs_proto_data *pd = - kzalloc(sizeof(struct ip_vs_proto_data), GFP_KERNEL); + kzalloc_obj(struct ip_vs_proto_data, GFP_KERNEL); if (!pd) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index 0e85e07e23b9..a4616433b445 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c @@ -229,7 +229,7 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc) struct ip_vs_sh_state *s; /* allocate the SH table for this service */ - s = kzalloc(sizeof(struct ip_vs_sh_state), GFP_KERNEL); + s = kzalloc_obj(struct ip_vs_sh_state, GFP_KERNEL); if (s == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index 54dd1514ac45..f83732777228 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -329,7 +329,7 @@ ip_vs_sync_buff_create(struct netns_ipvs *ipvs, unsigned int len) { struct ip_vs_sync_buff *sb; - if (!(sb=kmalloc(sizeof(struct ip_vs_sync_buff), GFP_ATOMIC))) + if (!(sb=kmalloc_obj(struct ip_vs_sync_buff, GFP_ATOMIC))) return NULL; len = max_t(unsigned int, len + sizeof(struct ip_vs_sync_mesg), @@ -417,7 +417,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs, unsigned int len) struct ip_vs_sync_buff *sb; struct ip_vs_sync_mesg_v0 *mesg; - if (!(sb=kmalloc(sizeof(struct ip_vs_sync_buff), GFP_ATOMIC))) + if (!(sb=kmalloc_obj(struct ip_vs_sync_buff, GFP_ATOMIC))) return NULL; len = max_t(unsigned int, len + sizeof(struct ip_vs_sync_mesg_v0), @@ -1827,7 +1827,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, struct ipvs_master_sync_state *ms; result = -ENOMEM; - ipvs->ms = kcalloc(count, sizeof(ipvs->ms[0]), GFP_KERNEL); + ipvs->ms = kzalloc_objs(ipvs->ms[0], count, GFP_KERNEL); if (!ipvs->ms) goto out; ms = ipvs->ms; @@ -1841,8 +1841,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, } } result = -ENOMEM; - ti = kcalloc(count, sizeof(struct ip_vs_sync_thread_data), - GFP_KERNEL); + ti = kzalloc_objs(struct ip_vs_sync_thread_data, count, GFP_KERNEL); if (!ti) goto out; diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c index 99f09cbf2d9b..58c65af9830a 100644 --- a/net/netfilter/ipvs/ip_vs_wrr.c +++ b/net/netfilter/ipvs/ip_vs_wrr.c @@ -109,7 +109,7 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc) /* * Allocate the mark variable for WRR scheduling */ - mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_KERNEL); + mark = kmalloc_obj(struct ip_vs_wrr_mark, GFP_KERNEL); if (mark == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index 4389bfe3050d..3601eb86d025 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c @@ -57,7 +57,7 @@ enum { static inline struct ip_vs_dest_dst *ip_vs_dest_dst_alloc(void) { - return kmalloc(sizeof(struct ip_vs_dest_dst), GFP_ATOMIC); + return kmalloc_obj(struct ip_vs_dest_dst, GFP_ATOMIC); } static inline void ip_vs_dest_dst_free(struct ip_vs_dest_dst *dest_dst) diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c index 46e667a50d98..6f3a6411f4af 100644 --- a/net/netfilter/nf_bpf_link.c +++ b/net/netfilter/nf_bpf_link.c @@ -221,7 +221,7 @@ int bpf_nf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) if (err) return err; - link = kzalloc(sizeof(*link), GFP_USER); + link = kzalloc_obj(*link, GFP_USER); if (!link) return -ENOMEM; diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c index 14e62b3263cd..520781335fc8 100644 --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c @@ -632,7 +632,7 @@ struct nf_conncount_data *nf_conncount_init(struct net *net, unsigned int keylen net_get_random_once(&conncount_rnd, sizeof(conncount_rnd)); - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return ERR_PTR(-ENOMEM); diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index d1f8eb725d42..42da155ab028 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -536,7 +536,7 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, if (tmpl != p) tmpl->proto.tmpl_padto = (char *)tmpl - (char *)p; } else { - tmpl = kzalloc(sizeof(*tmpl), flags); + tmpl = kzalloc_obj(*tmpl, flags); if (!tmpl) return NULL; } @@ -2535,7 +2535,7 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls) if (nr_slots > (INT_MAX / sizeof(struct hlist_nulls_head))) return NULL; - hash = kvcalloc(nr_slots, sizeof(struct hlist_nulls_head), GFP_KERNEL); + hash = kvzalloc_objs(struct hlist_nulls_head, nr_slots, GFP_KERNEL); if (hash && nulls) for (i = 0; i < nr_slots; i++) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 662f6bbfa805..cd1ab584fb2f 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -999,7 +999,7 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family) return ERR_PTR(-EOPNOTSUPP); #endif - filter = kzalloc(sizeof(*filter), GFP_KERNEL); + filter = kzalloc_obj(*filter, GFP_KERNEL); if (filter == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c index b894bb7a97ad..94c19bc4edc5 100644 --- a/net/netfilter/nf_conntrack_proto_gre.c +++ b/net/netfilter/nf_conntrack_proto_gre.c @@ -108,7 +108,7 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, return -EEXIST; } - km = kmalloc(sizeof(*km), GFP_ATOMIC); + km = kmalloc_obj(*km, GFP_ATOMIC); if (!km) return -ENOMEM; memcpy(&km->tuple, t, sizeof(*t)); diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c index b1966b68c48a..c95a18ca178b 100644 --- a/net/netfilter/nf_flow_table_offload.c +++ b/net/netfilter/nf_flow_table_offload.c @@ -741,7 +741,7 @@ nf_flow_offload_rule_alloc(struct net *net, struct nf_flow_rule *flow_rule; int err = -ENOMEM; - flow_rule = kzalloc(sizeof(*flow_rule), GFP_KERNEL); + flow_rule = kzalloc_obj(*flow_rule, GFP_KERNEL); if (!flow_rule) goto err_flow; @@ -1022,7 +1022,7 @@ nf_flow_offload_work_alloc(struct nf_flowtable *flowtable, if (test_and_set_bit(NF_FLOW_HW_PENDING, &flow->flags)) return NULL; - offload = kmalloc(sizeof(struct flow_offload_work), GFP_ATOMIC); + offload = kmalloc_obj(struct flow_offload_work, GFP_ATOMIC); if (!offload) { clear_bit(NF_FLOW_HW_PENDING, &flow->flags); return NULL; diff --git a/net/netfilter/nf_flow_table_xdp.c b/net/netfilter/nf_flow_table_xdp.c index e1252d042699..86ac65e9b579 100644 --- a/net/netfilter/nf_flow_table_xdp.c +++ b/net/netfilter/nf_flow_table_xdp.c @@ -54,7 +54,7 @@ static int nf_flowtable_by_dev_insert(struct nf_flowtable *ft, unsigned long key = (unsigned long)dev; struct flow_offload_xdp_ft *ft_elem; - ft_elem = kzalloc(sizeof(*ft_elem), GFP_KERNEL_ACCOUNT); + ft_elem = kzalloc_obj(*ft_elem, GFP_KERNEL_ACCOUNT); if (!ft_elem) return -ENOMEM; @@ -70,7 +70,7 @@ static int nf_flowtable_by_dev_insert(struct nf_flowtable *ft, } if (!elem) { - elem = kzalloc(sizeof(*elem), GFP_KERNEL_ACCOUNT); + elem = kzalloc_obj(*elem, GFP_KERNEL_ACCOUNT); if (!elem) goto err_unlock; diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 62cf6a30875e..f4d80654dfe6 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c @@ -317,7 +317,7 @@ EXPORT_SYMBOL_GPL(nf_log_buf_add); struct nf_log_buf *nf_log_buf_open(void) { - struct nf_log_buf *m = kmalloc(sizeof(*m), GFP_ATOMIC); + struct nf_log_buf *m = kmalloc_obj(*m, GFP_ATOMIC); if (unlikely(!m)) { local_bh_disable(); diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c index e6b24586d2fe..b4053e5ee07f 100644 --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c @@ -1213,7 +1213,7 @@ int nf_nat_register_fn(struct net *net, u8 pf, const struct nf_hook_ops *ops, } for (i = 0; i < ops_count; i++) { - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv) { nat_ops[i].priv = priv; continue; diff --git a/net/netfilter/nf_nat_masquerade.c b/net/netfilter/nf_nat_masquerade.c index 1a506b0c6511..a5a23c03fda9 100644 --- a/net/netfilter/nf_nat_masquerade.c +++ b/net/netfilter/nf_nat_masquerade.c @@ -115,7 +115,7 @@ static void nf_nat_masq_schedule(struct net *net, union nf_inet_addr *addr, if (!try_module_get(THIS_MODULE)) goto err_module; - w = kzalloc(sizeof(*w), gfp_flags); + w = kzalloc_obj(*w, gfp_flags); if (w) { /* We can overshoot MAX_MASQ_WORKER_COUNT, no big deal */ atomic_inc(&masq_worker_count); diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0c5a4855b97d..6044f1ec6953 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -1104,7 +1104,7 @@ __printf(2, 3) int nft_request_module(struct net *net, const char *fmt, } } - req = kmalloc(sizeof(*req), GFP_KERNEL); + req = kmalloc_obj(*req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -1624,7 +1624,7 @@ static int nf_tables_newtable(struct sk_buff *skb, const struct nfnl_info *info, } err = -ENOMEM; - table = kzalloc(sizeof(*table), GFP_KERNEL_ACCOUNT); + table = kzalloc_obj(*table, GFP_KERNEL_ACCOUNT); if (table == NULL) goto err_kzalloc; @@ -2348,7 +2348,7 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net, struct nft_hook *hook; int err; - hook = kzalloc(sizeof(struct nft_hook), GFP_KERNEL_ACCOUNT); + hook = kzalloc_obj(struct nft_hook, GFP_KERNEL_ACCOUNT); if (!hook) return ERR_PTR(-ENOMEM); @@ -2369,7 +2369,7 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net, if (strncmp(dev->name, hook->ifname, hook->ifnamelen)) continue; - ops = kzalloc(sizeof(struct nf_hook_ops), GFP_KERNEL_ACCOUNT); + ops = kzalloc_obj(struct nf_hook_ops, GFP_KERNEL_ACCOUNT); if (!ops) { err = -ENOMEM; goto err_hook_free; @@ -2716,7 +2716,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 policy, if (err < 0) return err; - basechain = kzalloc(sizeof(*basechain), GFP_KERNEL_ACCOUNT); + basechain = kzalloc_obj(*basechain, GFP_KERNEL_ACCOUNT); if (basechain == NULL) { nft_chain_release_hook(&hook); return -ENOMEM; @@ -2748,7 +2748,7 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 policy, if (flags & NFT_CHAIN_HW_OFFLOAD) return -EOPNOTSUPP; - chain = kzalloc(sizeof(*chain), GFP_KERNEL_ACCOUNT); + chain = kzalloc_obj(*chain, GFP_KERNEL_ACCOUNT); if (chain == NULL) return -ENOMEM; @@ -4315,9 +4315,8 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info, n = 0; size = 0; if (nla[NFTA_RULE_EXPRESSIONS]) { - expr_info = kvmalloc_array(NFT_RULE_MAXEXPRS, - sizeof(struct nft_expr_info), - GFP_KERNEL); + expr_info = kvmalloc_objs(struct nft_expr_info, + NFT_RULE_MAXEXPRS, GFP_KERNEL); if (!expr_info) return -ENOMEM; @@ -6929,7 +6928,7 @@ static int nft_setelem_catchall_insert(const struct net *net, } } - catchall = kmalloc(sizeof(*catchall), GFP_KERNEL_ACCOUNT); + catchall = kmalloc_obj(*catchall, GFP_KERNEL_ACCOUNT); if (!catchall) return -ENOMEM; @@ -8076,7 +8075,7 @@ static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, struct nft_object *obj; int err = -ENOMEM; - tb = kmalloc_array(type->maxattr + 1, sizeof(*tb), GFP_KERNEL); + tb = kmalloc_objs(*tb, type->maxattr + 1, GFP_KERNEL); if (!tb) goto err1; @@ -9145,7 +9144,7 @@ static int nf_tables_newflowtable(struct sk_buff *skb, if (!nft_use_inc(&table->use)) return -EMFILE; - flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL_ACCOUNT); + flowtable = kzalloc_obj(*flowtable, GFP_KERNEL_ACCOUNT); if (!flowtable) { err = -ENOMEM; goto flowtable_alloc; @@ -9465,7 +9464,7 @@ static int nf_tables_dump_flowtable_start(struct netlink_callback *cb) struct nft_flowtable_filter *filter = NULL; if (nla[NFTA_FLOWTABLE_TABLE]) { - filter = kzalloc(sizeof(*filter), GFP_ATOMIC); + filter = kzalloc_obj(*filter, GFP_ATOMIC); if (!filter) return -ENOMEM; @@ -9682,8 +9681,8 @@ static int nft_flowtable_event(unsigned long event, struct net_device *dev, if (!match || (changename && ops)) continue; - ops = kzalloc(sizeof(struct nf_hook_ops), - GFP_KERNEL_ACCOUNT); + ops = kzalloc_obj(struct nf_hook_ops, + GFP_KERNEL_ACCOUNT); if (!ops) return 1; @@ -10453,7 +10452,7 @@ struct nft_trans_gc *nft_trans_gc_alloc(struct nft_set *set, struct net *net = read_pnet(&set->net); struct nft_trans_gc *trans; - trans = kzalloc(sizeof(*trans), gfp); + trans = kzalloc_obj(*trans, gfp); if (!trans) return NULL; @@ -10689,7 +10688,7 @@ static int nf_tables_commit_audit_alloc(struct list_head *adl, if (adp->table == table) return 0; } - adp = kzalloc(sizeof(*adp), GFP_KERNEL); + adp = kzalloc_obj(*adp, GFP_KERNEL); if (!adp) return -ENOMEM; adp->table = table; diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c index fd30e205de84..42f11cb0c0f5 100644 --- a/net/netfilter/nf_tables_offload.c +++ b/net/netfilter/nf_tables_offload.c @@ -11,7 +11,7 @@ static struct nft_flow_rule *nft_flow_rule_alloc(int num_actions) { struct nft_flow_rule *flow; - flow = kzalloc(sizeof(struct nft_flow_rule), GFP_KERNEL); + flow = kzalloc_obj(struct nft_flow_rule, GFP_KERNEL); if (!flow) return NULL; @@ -111,7 +111,7 @@ struct nft_flow_rule *nft_flow_rule_create(struct net *net, expr = nft_expr_first(rule); - ctx = kzalloc(sizeof(struct nft_offload_ctx), GFP_KERNEL); + ctx = kzalloc_obj(struct nft_offload_ctx, GFP_KERNEL); if (!ctx) { err = -ENOMEM; goto err_out; diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 811d02b4c4f7..39c3d54de9f6 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -325,7 +325,7 @@ static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err, { struct nfnl_err *nfnl_err; - nfnl_err = kmalloc(sizeof(struct nfnl_err), GFP_KERNEL); + nfnl_err = kmalloc_obj(struct nfnl_err, GFP_KERNEL); if (nfnl_err == NULL) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index 505f46a32173..bd3d960a1adb 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c @@ -260,7 +260,7 @@ static int nfnl_acct_start(struct netlink_callback *cb) if (!tb[NFACCT_FILTER_MASK] || !tb[NFACCT_FILTER_VALUE]) return -EINVAL; - filter = kzalloc(sizeof(struct nfacct_filter), GFP_KERNEL); + filter = kzalloc_obj(struct nfacct_filter, GFP_KERNEL); if (!filter) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index 97248963a7d3..1a3d333e45dd 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -192,9 +192,8 @@ nfnl_cthelper_parse_expect_policy(struct nf_conntrack_helper *helper, if (class_max > NF_CT_MAX_EXPECT_CLASSES) return -EOVERFLOW; - expect_policy = kcalloc(class_max, - sizeof(struct nf_conntrack_expect_policy), - GFP_KERNEL); + expect_policy = kzalloc_objs(struct nf_conntrack_expect_policy, + class_max, GFP_KERNEL); if (expect_policy == NULL) return -ENOMEM; @@ -228,7 +227,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[], if (!tb[NFCTH_TUPLE] || !tb[NFCTH_POLICY] || !tb[NFCTH_PRIV_DATA_LEN]) return -EINVAL; - nfcth = kzalloc(sizeof(*nfcth), GFP_KERNEL); + nfcth = kzalloc_obj(*nfcth, GFP_KERNEL); if (nfcth == NULL) return -ENOMEM; helper = &nfcth->helper; @@ -323,8 +322,8 @@ static int nfnl_cthelper_update_policy_all(struct nlattr *tb[], struct nf_conntrack_expect_policy *policy; int i, ret = 0; - new_policy = kmalloc_array(helper->expect_class_max + 1, - sizeof(*new_policy), GFP_KERNEL); + new_policy = kmalloc_objs(*new_policy, helper->expect_class_max + 1, + GFP_KERNEL); if (!new_policy) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c index 38d75484e531..6b91f9d3161a 100644 --- a/net/netfilter/nfnetlink_cttimeout.c +++ b/net/netfilter/nfnetlink_cttimeout.c @@ -74,8 +74,7 @@ ctnl_timeout_parse_policy(void *timeout, struct nlattr **tb; int ret = 0; - tb = kcalloc(l4proto->ctnl_timeout.nlattr_max + 1, sizeof(*tb), - GFP_KERNEL); + tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1, GFP_KERNEL); if (!tb) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c index 92d869317cba..c2a572d86853 100644 --- a/net/netfilter/nfnetlink_hook.c +++ b/net/netfilter/nfnetlink_hook.c @@ -408,7 +408,7 @@ static int nfnl_hook_dump_start(struct netlink_callback *cb) if (head && IS_ERR(head)) return PTR_ERR(head); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index bfcb9cd335bf..b35a90955e2e 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -179,7 +179,7 @@ instance_create(struct net *net, u_int16_t group_num, goto out_unlock; } - inst = kzalloc(sizeof(*inst), GFP_ATOMIC); + inst = kzalloc_obj(*inst, GFP_ATOMIC); if (!inst) { err = -ENOMEM; goto out_unlock; diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c index c0fc431991e8..1ba43e562a5e 100644 --- a/net/netfilter/nfnetlink_osf.c +++ b/net/netfilter/nfnetlink_osf.c @@ -323,7 +323,7 @@ static int nfnl_osf_add_callback(struct sk_buff *skb, !memchr(f->version, 0, MAXGENRELEN)) return -EINVAL; - kf = kmalloc(sizeof(struct nf_osf_finger), GFP_KERNEL); + kf = kmalloc_obj(struct nf_osf_finger, GFP_KERNEL); if (!kf) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index f1c8049861a6..7f5248b5f1ee 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -178,7 +178,7 @@ instance_create(struct nfnl_queue_net *q, u_int16_t queue_num, u32 portid) unsigned int h; int err; - inst = kzalloc(sizeof(*inst), GFP_KERNEL_ACCOUNT); + inst = kzalloc_obj(*inst, GFP_KERNEL_ACCOUNT); if (!inst) return ERR_PTR(-ENOMEM); diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c index 08f620311b03..27cc983a7cdf 100644 --- a/net/netfilter/nft_compat.c +++ b/net/netfilter/nft_compat.c @@ -815,7 +815,7 @@ nft_match_select_ops(const struct nft_ctx *ctx, goto err; } - ops = kzalloc(sizeof(struct nft_expr_ops), GFP_KERNEL_ACCOUNT); + ops = kzalloc_obj(struct nft_expr_ops, GFP_KERNEL_ACCOUNT); if (!ops) { err = -ENOMEM; goto err; @@ -905,7 +905,7 @@ nft_target_select_ops(const struct nft_ctx *ctx, goto err; } - ops = kzalloc(sizeof(struct nft_expr_ops), GFP_KERNEL_ACCOUNT); + ops = kzalloc_obj(struct nft_expr_ops, GFP_KERNEL_ACCOUNT); if (!ops) { err = -ENOMEM; goto err; diff --git a/net/netfilter/nft_connlimit.c b/net/netfilter/nft_connlimit.c index 657764774a2d..43357f99eb00 100644 --- a/net/netfilter/nft_connlimit.c +++ b/net/netfilter/nft_connlimit.c @@ -71,7 +71,7 @@ static int nft_connlimit_do_init(const struct nft_ctx *ctx, invert = true; } - priv->list = kmalloc(sizeof(*priv->list), GFP_KERNEL_ACCOUNT); + priv->list = kmalloc_obj(*priv->list, GFP_KERNEL_ACCOUNT); if (!priv->list) return -ENOMEM; @@ -220,7 +220,7 @@ static int nft_connlimit_clone(struct nft_expr *dst, const struct nft_expr *src, struct nft_connlimit *priv_dst = nft_expr_priv(dst); struct nft_connlimit *priv_src = nft_expr_priv(src); - priv_dst->list = kmalloc(sizeof(*priv_dst->list), gfp); + priv_dst->list = kmalloc_obj(*priv_dst->list, gfp); if (!priv_dst->list) return -ENOMEM; diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index 6f2ae7cad731..8d7f6c8e8aad 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c @@ -894,8 +894,7 @@ nft_ct_timeout_parse_policy(void *timeouts, struct nlattr **tb; int ret = 0; - tb = kcalloc(l4proto->ctnl_timeout.nlattr_max + 1, sizeof(*tb), - GFP_KERNEL); + tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1, GFP_KERNEL); if (!tb) return -ENOMEM; diff --git a/net/netfilter/nft_last.c b/net/netfilter/nft_last.c index de1b6066bfa8..20706be12807 100644 --- a/net/netfilter/nft_last.c +++ b/net/netfilter/nft_last.c @@ -30,7 +30,7 @@ static int nft_last_init(const struct nft_ctx *ctx, const struct nft_expr *expr, u64 last_jiffies; int err; - last = kzalloc(sizeof(*last), GFP_KERNEL_ACCOUNT); + last = kzalloc_obj(*last, GFP_KERNEL_ACCOUNT); if (!last) return -ENOMEM; @@ -107,7 +107,7 @@ static int nft_last_clone(struct nft_expr *dst, const struct nft_expr *src, gfp_ struct nft_last_priv *priv_dst = nft_expr_priv(dst); struct nft_last_priv *priv_src = nft_expr_priv(src); - priv_dst->last = kzalloc(sizeof(*priv_dst->last), gfp); + priv_dst->last = kzalloc_obj(*priv_dst->last, gfp); if (!priv_dst->last) return -ENOMEM; diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c index 21d26b79b460..f3b1f791942b 100644 --- a/net/netfilter/nft_limit.c +++ b/net/netfilter/nft_limit.c @@ -110,7 +110,7 @@ static int nft_limit_init(struct nft_limit_priv *priv, invert = true; } - priv->limit = kmalloc(sizeof(*priv->limit), GFP_KERNEL_ACCOUNT); + priv->limit = kmalloc_obj(*priv->limit, GFP_KERNEL_ACCOUNT); if (!priv->limit) return -ENOMEM; @@ -158,7 +158,7 @@ static int nft_limit_clone(struct nft_limit_priv *priv_dst, priv_dst->burst = priv_src->burst; priv_dst->invert = priv_src->invert; - priv_dst->limit = kmalloc(sizeof(*priv_dst->limit), gfp); + priv_dst->limit = kmalloc_obj(*priv_dst->limit, gfp); if (!priv_dst->limit) return -ENOMEM; diff --git a/net/netfilter/nft_numgen.c b/net/netfilter/nft_numgen.c index bd058babfc82..0a39e51ec9b7 100644 --- a/net/netfilter/nft_numgen.c +++ b/net/netfilter/nft_numgen.c @@ -66,7 +66,7 @@ static int nft_ng_inc_init(const struct nft_ctx *ctx, if (priv->offset + priv->modulus - 1 < priv->offset) return -EOVERFLOW; - priv->counter = kmalloc(sizeof(*priv->counter), GFP_KERNEL_ACCOUNT); + priv->counter = kmalloc_obj(*priv->counter, GFP_KERNEL_ACCOUNT); if (!priv->counter) return -ENOMEM; diff --git a/net/netfilter/nft_quota.c b/net/netfilter/nft_quota.c index cb6c0e04ff67..2390a993aed9 100644 --- a/net/netfilter/nft_quota.c +++ b/net/netfilter/nft_quota.c @@ -96,7 +96,7 @@ static int nft_quota_do_init(const struct nlattr * const tb[], return -EOPNOTSUPP; } - priv->consumed = kmalloc(sizeof(*priv->consumed), GFP_KERNEL_ACCOUNT); + priv->consumed = kmalloc_obj(*priv->consumed, GFP_KERNEL_ACCOUNT); if (!priv->consumed) return -ENOMEM; @@ -248,7 +248,7 @@ static int nft_quota_clone(struct nft_expr *dst, const struct nft_expr *src, gfp priv_dst->quota = priv_src->quota; priv_dst->flags = priv_src->flags; - priv_dst->consumed = kmalloc(sizeof(*priv_dst->consumed), gfp); + priv_dst->consumed = kmalloc_obj(*priv_dst->consumed, gfp); if (!priv_dst->consumed) return -ENOMEM; diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index 18e1903b1d3d..6341b5bcb4cf 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -652,7 +652,7 @@ static int pipapo_realloc_mt(struct nft_pipapo_field *f, if (rules_alloc > (INT_MAX / sizeof(*new_mt))) return -ENOMEM; - new_mt = kvmalloc_array(rules_alloc, sizeof(*new_mt), GFP_KERNEL_ACCOUNT); + new_mt = kvmalloc_objs(*new_mt, rules_alloc, GFP_KERNEL_ACCOUNT); if (!new_mt) return -ENOMEM; @@ -1413,7 +1413,7 @@ static struct nft_pipapo_match *pipapo_clone(struct nft_pipapo_match *old) struct nft_pipapo_match *new; int i; - new = kmalloc(struct_size(new, f, old->field_count), GFP_KERNEL_ACCOUNT); + new = kmalloc_flex(*new, f, old->field_count, GFP_KERNEL_ACCOUNT); if (!new) return NULL; @@ -1460,9 +1460,8 @@ static struct nft_pipapo_match *pipapo_clone(struct nft_pipapo_match *old) if (src->rules_alloc > (INT_MAX / sizeof(*src->mt))) goto out_mt; - dst->mt = kvmalloc_array(src->rules_alloc, - sizeof(*src->mt), - GFP_KERNEL_ACCOUNT); + dst->mt = kvmalloc_objs(*src->mt, src->rules_alloc, + GFP_KERNEL_ACCOUNT); if (!dst->mt) goto out_mt; @@ -2237,7 +2236,7 @@ static int nft_pipapo_init(const struct nft_set *set, if (field_count > NFT_PIPAPO_MAX_FIELDS) return -EINVAL; - m = kmalloc(struct_size(m, f, field_count), GFP_KERNEL); + m = kmalloc_flex(*m, f, field_count, GFP_KERNEL); if (!m) return -ENOMEM; diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 644d4b916705..3f02e4478216 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -586,8 +586,8 @@ static int nft_array_intervals_alloc(struct nft_array *array, u32 max_intervals) { struct nft_array_interval *intervals; - intervals = kvcalloc(max_intervals, sizeof(struct nft_array_interval), - GFP_KERNEL_ACCOUNT); + intervals = kvzalloc_objs(struct nft_array_interval, max_intervals, + GFP_KERNEL_ACCOUNT); if (!intervals) return -ENOMEM; @@ -604,7 +604,7 @@ static struct nft_array *nft_array_alloc(u32 max_intervals) { struct nft_array *array; - array = kzalloc(sizeof(*array), GFP_KERNEL_ACCOUNT); + array = kzalloc_obj(*array, GFP_KERNEL_ACCOUNT); if (!array) return NULL; diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 48105ea3df15..f5d720c9ee32 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -1742,7 +1742,7 @@ xt_hook_ops_alloc(const struct xt_table *table, nf_hookfn *fn) if (!num_hooks) return ERR_PTR(-EINVAL); - ops = kcalloc(num_hooks, sizeof(*ops), GFP_KERNEL); + ops = kzalloc_objs(*ops, num_hooks, GFP_KERNEL); if (ops == NULL) return ERR_PTR(-ENOMEM); @@ -1775,7 +1775,7 @@ int xt_register_template(const struct xt_table *table, } ret = -ENOMEM; - t = kzalloc(sizeof(*t), GFP_KERNEL); + t = kzalloc_obj(*t, GFP_KERNEL); if (!t) goto out_unlock; @@ -1993,7 +1993,7 @@ static int __init xt_init(void) } } - xt = kcalloc(NFPROTO_NUMPROTO, sizeof(struct xt_af), GFP_KERNEL); + xt = kzalloc_objs(struct xt_af, NFPROTO_NUMPROTO, GFP_KERNEL); if (!xt) return -ENOMEM; diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index d73957592c9d..746abeee6775 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -135,7 +135,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) { int ret; - info->timer = kzalloc(sizeof(*info->timer), GFP_KERNEL); + info->timer = kzalloc_obj(*info->timer, GFP_KERNEL); if (!info->timer) { ret = -ENOMEM; goto out; @@ -184,7 +184,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info) { int ret; - info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL); + info->timer = kmalloc_obj(*info->timer, GFP_KERNEL); if (!info->timer) { ret = -ENOMEM; goto out; diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index 90dcf088071a..6b21810e1b97 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c @@ -111,7 +111,7 @@ static int led_tg_check(const struct xt_tgchk_param *par) } err = -ENOMEM; - ledinternal = kzalloc(sizeof(struct xt_led_info_internal), GFP_KERNEL); + ledinternal = kzalloc_obj(struct xt_led_info_internal, GFP_KERNEL); if (!ledinternal) goto exit_mutex_only; diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c index 4f49cfc27831..d75b1e101a5b 100644 --- a/net/netfilter/xt_RATEEST.c +++ b/net/netfilter/xt_RATEEST.c @@ -139,7 +139,7 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par) } ret = -ENOMEM; - est = kzalloc(sizeof(*est), GFP_KERNEL); + est = kzalloc_obj(*est, GFP_KERNEL); if (!est) goto err1; diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c index a5ebd5640457..c6044ea31d16 100644 --- a/net/netfilter/xt_TEE.c +++ b/net/netfilter/xt_TEE.c @@ -106,7 +106,7 @@ static int tee_tg_check(const struct xt_tgchk_param *par) if (info->oif[sizeof(info->oif)-1] != '\0') return -EINVAL; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 3b507694e81e..64ed12a32906 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -293,7 +293,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg, if (size < 16) size = 16; } - hinfo = kvmalloc(struct_size(hinfo, hash, size), GFP_KERNEL); + hinfo = kvmalloc_flex(*hinfo, hash, size, GFP_KERNEL); if (hinfo == NULL) return -ENOMEM; *out_hinfo = hinfo; diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index 8b4fd27857f2..203f8bb28132 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c @@ -115,7 +115,7 @@ static int limit_mt_check(const struct xt_mtchk_param *par) return -ERANGE; } - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 4452cc93b990..7952a4ef4c51 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c @@ -50,7 +50,7 @@ static int quota_mt_check(const struct xt_mtchk_param *par) if (q->flags & ~XT_QUOTA_MASK) return -EINVAL; - q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); + q->master = kmalloc_obj(*q->master, GFP_KERNEL); if (q->master == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 588a5e6ad899..c9a1cc591171 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c @@ -188,7 +188,7 @@ recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr, } nstamps_max += 1; - e = kmalloc(struct_size(e, stamps, nstamps_max), GFP_ATOMIC); + e = kmalloc_flex(*e, stamps, nstamps_max, GFP_ATOMIC); if (e == NULL) return NULL; memcpy(&e->addr, addr, sizeof(e->addr)); @@ -391,7 +391,7 @@ static int recent_mt_check(const struct xt_mtchk_param *par, goto out; } - t = kvzalloc(struct_size(t, iphash, ip_list_hash_size), GFP_KERNEL); + t = kvzalloc_flex(*t, iphash, ip_list_hash_size, GFP_KERNEL); if (t == NULL) { ret = -ENOMEM; goto out; diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c index b26c1dcfc27b..e80ddc317ca5 100644 --- a/net/netfilter/xt_statistic.c +++ b/net/netfilter/xt_statistic.c @@ -58,7 +58,7 @@ static int statistic_mt_check(const struct xt_mtchk_param *par) info->flags & ~XT_STATISTIC_MASK) return -EINVAL; - info->master = kzalloc(sizeof(*info->master), GFP_KERNEL); + info->master = kzalloc_obj(*info->master, GFP_KERNEL); if (info->master == NULL) return -ENOMEM; atomic_set(&info->master->count, info->u.nth.count); diff --git a/net/netlabel/netlabel_calipso.c b/net/netlabel/netlabel_calipso.c index a07c2216d28b..fae0bee5c065 100644 --- a/net/netlabel/netlabel_calipso.c +++ b/net/netlabel/netlabel_calipso.c @@ -95,7 +95,7 @@ static int netlbl_calipso_add_pass(struct genl_info *info, int ret_val; struct calipso_doi *doi_def = NULL; - doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); if (!doi_def) return -ENOMEM; doi_def->type = CALIPSO_MAP_PASS; diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index fa08ee75ac06..526f3dc3e67a 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c @@ -139,10 +139,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info, NULL) != 0) return -EINVAL; - doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); if (doi_def == NULL) return -ENOMEM; - doi_def->map.std = kzalloc(sizeof(*doi_def->map.std), GFP_KERNEL); + doi_def->map.std = kzalloc_obj(*doi_def->map.std, GFP_KERNEL); if (doi_def->map.std == NULL) { kfree(doi_def); return -ENOMEM; @@ -332,7 +332,7 @@ static int netlbl_cipsov4_add_pass(struct genl_info *info, if (!info->attrs[NLBL_CIPSOV4_A_TAGLST]) return -EINVAL; - doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); if (doi_def == NULL) return -ENOMEM; doi_def->type = CIPSO_V4_MAP_PASS; @@ -371,7 +371,7 @@ static int netlbl_cipsov4_add_local(struct genl_info *info, if (!info->attrs[NLBL_CIPSOV4_A_TAGLST]) return -EINVAL; - doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); if (doi_def == NULL) return -ENOMEM; doi_def->type = CIPSO_V4_MAP_LOCAL; diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index 8158a25972b4..fc014849d6b3 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c @@ -367,13 +367,11 @@ int __init netlbl_domhsh_init(u32 size) if (size == 0) return -EINVAL; - hsh_tbl = kmalloc(sizeof(*hsh_tbl), GFP_KERNEL); + hsh_tbl = kmalloc_obj(*hsh_tbl, GFP_KERNEL); if (hsh_tbl == NULL) return -ENOMEM; hsh_tbl->size = 1 << size; - hsh_tbl->tbl = kcalloc(hsh_tbl->size, - sizeof(struct list_head), - GFP_KERNEL); + hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size, GFP_KERNEL); if (hsh_tbl->tbl == NULL) { kfree(hsh_tbl); return -ENOMEM; @@ -453,7 +451,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, ret_val = -EINVAL; goto add_return; } - entry_b = kzalloc(sizeof(*entry_b), GFP_ATOMIC); + entry_b = kzalloc_obj(*entry_b, GFP_ATOMIC); if (entry_b == NULL) { ret_val = -ENOMEM; goto add_return; diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 33b77084a4e5..3583fa63dd01 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c @@ -104,7 +104,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain, struct netlbl_domaddr4_map *map4 = NULL; struct netlbl_domaddr6_map *map6 = NULL; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (entry == NULL) return -ENOMEM; if (domain != NULL) { @@ -117,7 +117,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain, if (addr == NULL && mask == NULL) entry->def.type = NETLBL_NLTYPE_UNLABELED; else if (addr != NULL && mask != NULL) { - addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); + addrmap = kzalloc_obj(*addrmap, GFP_ATOMIC); if (addrmap == NULL) goto cfg_unlbl_map_add_failure; INIT_LIST_HEAD(&addrmap->list4); @@ -127,7 +127,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain, case AF_INET: { const struct in_addr *addr4 = addr; const struct in_addr *mask4 = mask; - map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); + map4 = kzalloc_obj(*map4, GFP_ATOMIC); if (map4 == NULL) goto cfg_unlbl_map_add_failure; map4->def.type = NETLBL_NLTYPE_UNLABELED; @@ -144,7 +144,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain, case AF_INET6: { const struct in6_addr *addr6 = addr; const struct in6_addr *mask6 = mask; - map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); + map6 = kzalloc_obj(*map6, GFP_ATOMIC); if (map6 == NULL) goto cfg_unlbl_map_add_failure; map6->def.type = NETLBL_NLTYPE_UNLABELED; @@ -336,7 +336,7 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, if (doi_def == NULL) return -ENOENT; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (entry == NULL) goto out_entry; entry->family = AF_INET; @@ -350,13 +350,13 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, entry->def.cipso = doi_def; entry->def.type = NETLBL_NLTYPE_CIPSOV4; } else if (addr != NULL && mask != NULL) { - addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); + addrmap = kzalloc_obj(*addrmap, GFP_ATOMIC); if (addrmap == NULL) goto out_addrmap; INIT_LIST_HEAD(&addrmap->list4); INIT_LIST_HEAD(&addrmap->list6); - addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC); + addrinfo = kzalloc_obj(*addrinfo, GFP_ATOMIC); if (addrinfo == NULL) goto out_addrinfo; addrinfo->def.cipso = doi_def; @@ -462,7 +462,7 @@ int netlbl_cfg_calipso_map_add(u32 doi, if (doi_def == NULL) return -ENOENT; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (entry == NULL) goto out_entry; entry->family = AF_INET6; @@ -476,13 +476,13 @@ int netlbl_cfg_calipso_map_add(u32 doi, entry->def.calipso = doi_def; entry->def.type = NETLBL_NLTYPE_CALIPSO; } else if (addr != NULL && mask != NULL) { - addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); + addrmap = kzalloc_obj(*addrmap, GFP_ATOMIC); if (addrmap == NULL) goto out_addrmap; INIT_LIST_HEAD(&addrmap->list4); INIT_LIST_HEAD(&addrmap->list6); - addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC); + addrinfo = kzalloc_obj(*addrinfo, GFP_ATOMIC); if (addrinfo == NULL) goto out_addrinfo; addrinfo->def.calipso = doi_def; diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 079fe72a6384..13f45fbff824 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c @@ -84,7 +84,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct calipso_doi *calipso = NULL; #endif u32 tmp_val; - struct netlbl_dom_map *entry = kzalloc(sizeof(*entry), GFP_KERNEL); + struct netlbl_dom_map *entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -148,7 +148,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct in_addr *mask; struct netlbl_domaddr4_map *map; - addrmap = kzalloc(sizeof(*addrmap), GFP_KERNEL); + addrmap = kzalloc_obj(*addrmap, GFP_KERNEL); if (addrmap == NULL) { ret_val = -ENOMEM; goto add_doi_put_def; @@ -169,7 +169,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, addr = nla_data(info->attrs[NLBL_MGMT_A_IPV4ADDR]); mask = nla_data(info->attrs[NLBL_MGMT_A_IPV4MASK]); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { ret_val = -ENOMEM; goto add_free_addrmap; @@ -195,7 +195,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct in6_addr *mask; struct netlbl_domaddr6_map *map; - addrmap = kzalloc(sizeof(*addrmap), GFP_KERNEL); + addrmap = kzalloc_obj(*addrmap, GFP_KERNEL); if (addrmap == NULL) { ret_val = -ENOMEM; goto add_doi_put_def; @@ -216,7 +216,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, addr = nla_data(info->attrs[NLBL_MGMT_A_IPV6ADDR]); mask = nla_data(info->attrs[NLBL_MGMT_A_IPV6MASK]); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc_obj(*map, GFP_KERNEL); if (map == NULL) { ret_val = -ENOMEM; goto add_free_addrmap; diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index dfda9ea61971..ab68324c08d9 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c @@ -236,7 +236,7 @@ static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, int ret_val; struct netlbl_unlhsh_addr4 *entry; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (entry == NULL) return -ENOMEM; @@ -276,7 +276,7 @@ static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface, int ret_val; struct netlbl_unlhsh_addr6 *entry; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (entry == NULL) return -ENOMEM; @@ -314,7 +314,7 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) u32 bkt; struct netlbl_unlhsh_iface *iface; - iface = kzalloc(sizeof(*iface), GFP_ATOMIC); + iface = kzalloc_obj(*iface, GFP_ATOMIC); if (iface == NULL) return NULL; @@ -1413,13 +1413,11 @@ int __init netlbl_unlabel_init(u32 size) if (size == 0) return -EINVAL; - hsh_tbl = kmalloc(sizeof(*hsh_tbl), GFP_KERNEL); + hsh_tbl = kmalloc_obj(*hsh_tbl, GFP_KERNEL); if (hsh_tbl == NULL) return -ENOMEM; hsh_tbl->size = 1 << size; - hsh_tbl->tbl = kcalloc(hsh_tbl->size, - sizeof(struct list_head), - GFP_KERNEL); + hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size, GFP_KERNEL); if (hsh_tbl->tbl == NULL) { kfree(hsh_tbl); return -ENOMEM; @@ -1534,7 +1532,7 @@ int __init netlbl_unlabel_defconf(void) audit_info.loginuid = GLOBAL_ROOT_UID; audit_info.sessionid = 0; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (entry == NULL) return -ENOMEM; entry->family = AF_UNSPEC; diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 8e5151f0c6e4..2d91b8b8ba9a 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2927,7 +2927,7 @@ static int __init netlink_proto_init(void) BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > sizeof_field(struct sk_buff, cb)); - nl_table = kcalloc(MAX_LINKS, sizeof(*nl_table), GFP_KERNEL); + nl_table = kzalloc_objs(*nl_table, MAX_LINKS, GFP_KERNEL); if (!nl_table) goto panic; diff --git a/net/netlink/diag.c b/net/netlink/diag.c index b8e58132e8af..25e930a64d07 100644 --- a/net/netlink/diag.c +++ b/net/netlink/diag.c @@ -107,7 +107,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, num--; if (!hti) { - hti = kmalloc(sizeof(*hti), GFP_KERNEL); + hti = kmalloc_obj(*hti, GFP_KERNEL); if (!hti) return -ENOMEM; diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 978c129c6095..ac1fdf7d7327 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -659,7 +659,7 @@ static int genl_sk_privs_alloc(struct genl_family *family) if (!family->sock_priv_size) return 0; - family->sock_privs = kzalloc(sizeof(*family->sock_privs), GFP_KERNEL); + family->sock_privs = kzalloc_obj(*family->sock_privs, GFP_KERNEL); if (!family->sock_privs) return -ENOMEM; xa_init(family->sock_privs); @@ -912,7 +912,7 @@ EXPORT_SYMBOL(genlmsg_put); static struct genl_dumpit_info *genl_dumpit_info_alloc(void) { - return kmalloc(sizeof(struct genl_dumpit_info), GFP_KERNEL); + return kmalloc_obj(struct genl_dumpit_info, GFP_KERNEL); } static void genl_dumpit_info_free(const struct genl_dumpit_info *info) @@ -937,8 +937,7 @@ genl_family_rcv_msg_attrs_parse(const struct genl_family *family, if (!ops->maxattr) return NULL; - attrbuf = kmalloc_array(ops->maxattr + 1, - sizeof(struct nlattr *), GFP_KERNEL); + attrbuf = kmalloc_objs(struct nlattr *, ops->maxattr + 1, GFP_KERNEL); if (!attrbuf) return ERR_PTR(-ENOMEM); @@ -1591,7 +1590,7 @@ static int ctrl_dumppolicy_start(struct netlink_callback *cb) return 0; } - ctx->op_iter = kmalloc(sizeof(*ctx->op_iter), GFP_KERNEL); + ctx->op_iter = kmalloc_obj(*ctx->op_iter, GFP_KERNEL); if (!ctx->op_iter) return -ENOMEM; diff --git a/net/netlink/policy.c b/net/netlink/policy.c index 99458da6be32..a3e818c7c0cf 100644 --- a/net/netlink/policy.c +++ b/net/netlink/policy.c @@ -102,8 +102,8 @@ static struct netlink_policy_dump_state *alloc_state(void) { struct netlink_policy_dump_state *state; - state = kzalloc(struct_size(state, policies, INITIAL_POLICIES_ALLOC), - GFP_KERNEL); + state = kzalloc_flex(*state, policies, INITIAL_POLICIES_ALLOC, + GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM); state->n_alloc = INITIAL_POLICIES_ALLOC; diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 5ed1a71ceec1..d7090dad8113 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -1401,7 +1401,7 @@ static int __init nr_proto_init(void) goto unregister_proto; } - dev_nr = kcalloc(nr_ndevs, sizeof(struct net_device *), GFP_KERNEL); + dev_nr = kzalloc_objs(struct net_device *, nr_ndevs, GFP_KERNEL); if (!dev_nr) { pr_err("NET/ROM: %s - unable to allocate device array\n", __func__); diff --git a/net/nfc/core.c b/net/nfc/core.c index f50e5bab35d8..c39d00b2a0d7 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -879,7 +879,7 @@ int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type) if (se) return -EALREADY; - se = kzalloc(sizeof(struct nfc_se), GFP_KERNEL); + se = kzalloc_obj(struct nfc_se, GFP_KERNEL); if (!se) return -ENOMEM; @@ -1062,7 +1062,7 @@ struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops, if (!supported_protocols) return NULL; - dev = kzalloc(sizeof(struct nfc_dev), GFP_KERNEL); + dev = kzalloc_obj(struct nfc_dev, GFP_KERNEL); if (!dev) return NULL; diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c index dae378f1d52b..be9a048b583b 100644 --- a/net/nfc/digital_core.c +++ b/net/nfc/digital_core.c @@ -231,7 +231,7 @@ int digital_send_cmd(struct nfc_digital_dev *ddev, u8 cmd_type, { struct digital_cmd *cmd; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; @@ -279,7 +279,7 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech) struct digital_tg_mdaa_params *params; int rc; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -706,7 +706,7 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target, struct digital_data_exch *data_exch; int rc; - data_exch = kzalloc(sizeof(*data_exch), GFP_KERNEL); + data_exch = kzalloc_obj(*data_exch, GFP_KERNEL); if (!data_exch) return -ENOMEM; @@ -762,7 +762,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops !ops->switch_rf || (ops->tg_listen_md && !ops->tg_get_rf_tech)) return NULL; - ddev = kzalloc(sizeof(*ddev), GFP_KERNEL); + ddev = kzalloc_obj(*ddev, GFP_KERNEL); if (!ddev) return NULL; diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c index 3adf4589852a..df2bfb4734c5 100644 --- a/net/nfc/digital_technology.c +++ b/net/nfc/digital_technology.c @@ -490,7 +490,7 @@ static void digital_in_recv_sens_res(struct nfc_digital_dev *ddev, void *arg, goto exit; } - target = kzalloc(sizeof(struct nfc_target), GFP_KERNEL); + target = kzalloc_obj(struct nfc_target, GFP_KERNEL); if (!target) { rc = -ENOMEM; goto exit; @@ -688,7 +688,7 @@ static void digital_in_recv_sensb_res(struct nfc_digital_dev *ddev, void *arg, else ddev->target_fsc = digital_ats_fsc[fsci]; - target = kzalloc(sizeof(struct nfc_target), GFP_KERNEL); + target = kzalloc_obj(struct nfc_target, GFP_KERNEL); if (!target) { rc = -ENOMEM; goto exit; @@ -863,7 +863,7 @@ static void digital_in_recv_iso15693_inv_res(struct nfc_digital_dev *ddev, goto out_free_skb; } - target = kzalloc(sizeof(*target), GFP_KERNEL); + target = kzalloc_obj(*target, GFP_KERNEL); if (!target) { rc = -ENOMEM; goto out_free_skb; diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 8618d57c23da..10bcd9d2576a 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c @@ -291,7 +291,7 @@ int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) pr_debug("from gate %d\n", gate); - targets = kzalloc(sizeof(struct nfc_target), GFP_KERNEL); + targets = kzalloc_obj(struct nfc_target, GFP_KERNEL); if (targets == NULL) return -ENOMEM; @@ -964,7 +964,7 @@ struct nfc_hci_dev *nfc_hci_allocate_device(const struct nfc_hci_ops *ops, if (protocols == 0) return NULL; - hdev = kzalloc(sizeof(struct nfc_hci_dev), GFP_KERNEL); + hdev = kzalloc_obj(struct nfc_hci_dev, GFP_KERNEL); if (hdev == NULL) return NULL; diff --git a/net/nfc/hci/hcp.c b/net/nfc/hci/hcp.c index 4902f5064098..903fb134cd80 100644 --- a/net/nfc/hci/hcp.c +++ b/net/nfc/hci/hcp.c @@ -30,7 +30,7 @@ int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, int hci_len, err; bool firstfrag = true; - cmd = kzalloc(sizeof(struct hci_msg), GFP_KERNEL); + cmd = kzalloc_obj(struct hci_msg, GFP_KERNEL); if (cmd == NULL) return -ENOMEM; diff --git a/net/nfc/hci/llc.c b/net/nfc/hci/llc.c index e6cf4eb06b46..12d7940c6217 100644 --- a/net/nfc/hci/llc.c +++ b/net/nfc/hci/llc.c @@ -49,7 +49,7 @@ int nfc_llc_register(const char *name, const struct nfc_llc_ops *ops) { struct nfc_llc_engine *llc_engine; - llc_engine = kzalloc(sizeof(struct nfc_llc_engine), GFP_KERNEL); + llc_engine = kzalloc_obj(struct nfc_llc_engine, GFP_KERNEL); if (llc_engine == NULL) return -ENOMEM; @@ -90,7 +90,7 @@ struct nfc_llc *nfc_llc_allocate(const char *name, struct nfc_hci_dev *hdev, if (llc_engine == NULL) return NULL; - llc = kzalloc(sizeof(struct nfc_llc), GFP_KERNEL); + llc = kzalloc_obj(struct nfc_llc, GFP_KERNEL); if (llc == NULL) return NULL; diff --git a/net/nfc/hci/llc_nop.c b/net/nfc/hci/llc_nop.c index a58716f16954..eb940330fd5d 100644 --- a/net/nfc/hci/llc_nop.c +++ b/net/nfc/hci/llc_nop.c @@ -28,7 +28,7 @@ static void *llc_nop_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, *rx_headroom = 0; *rx_tailroom = 0; - llc_nop = kzalloc(sizeof(struct llc_nop), GFP_KERNEL); + llc_nop = kzalloc_obj(struct llc_nop, GFP_KERNEL); if (llc_nop == NULL) return NULL; diff --git a/net/nfc/hci/llc_shdlc.c b/net/nfc/hci/llc_shdlc.c index 08c8aa1530d8..7e0d84c29cb1 100644 --- a/net/nfc/hci/llc_shdlc.c +++ b/net/nfc/hci/llc_shdlc.c @@ -728,7 +728,7 @@ static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, *rx_headroom = SHDLC_LLC_HEAD_ROOM; *rx_tailroom = 0; - shdlc = kzalloc(sizeof(struct llc_shdlc), GFP_KERNEL); + shdlc = kzalloc_obj(struct llc_shdlc, GFP_KERNEL); if (shdlc == NULL) return NULL; diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c index b652323bc2c1..90f68199ecca 100644 --- a/net/nfc/llcp_commands.c +++ b/net/nfc/llcp_commands.c @@ -108,7 +108,7 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdres_tlv(u8 tid, u8 sap) struct nfc_llcp_sdp_tlv *sdres; u8 value[2]; - sdres = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL); + sdres = kzalloc_obj(struct nfc_llcp_sdp_tlv, GFP_KERNEL); if (sdres == NULL) return NULL; @@ -141,7 +141,7 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, const char *uri, if (WARN_ON_ONCE(uri_len > U8_MAX - 4)) return NULL; - sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL); + sdreq = kzalloc_obj(struct nfc_llcp_sdp_tlv, GFP_KERNEL); if (sdreq == NULL) return NULL; diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c index 444a3774c8e8..98f0c3281281 100644 --- a/net/nfc/llcp_core.c +++ b/net/nfc/llcp_core.c @@ -1621,7 +1621,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) { struct nfc_llcp_local *local; - local = kzalloc(sizeof(struct nfc_llcp_local), GFP_KERNEL); + local = kzalloc_obj(struct nfc_llcp_local, GFP_KERNEL); if (local == NULL) return -ENOMEM; diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index e419e020a70a..dc17ed8be242 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -1171,7 +1171,7 @@ struct nci_dev *nci_allocate_device(const struct nci_ops *ops, if (!supported_protocols) return NULL; - ndev = kzalloc(sizeof(struct nci_dev), GFP_KERNEL); + ndev = kzalloc_obj(struct nci_dev, GFP_KERNEL); if (!ndev) return NULL; diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index 082ab66f120b..cd3e87b2dd3e 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c @@ -777,7 +777,7 @@ struct nci_hci_dev *nci_hci_allocate(struct nci_dev *ndev) { struct nci_hci_dev *hdev; - hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); + hdev = kzalloc_obj(*hdev, GFP_KERNEL); if (!hdev) return NULL; diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c index aab107727f18..25dc2868fd27 100644 --- a/net/nfc/nci/uart.c +++ b/net/nfc/nci/uart.c @@ -113,7 +113,7 @@ static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver) if (!nci_uart_drivers[driver]) return -ENOENT; - nu = kzalloc(sizeof(*nu), GFP_KERNEL); + nu = kzalloc_obj(*nu, GFP_KERNEL); if (!nu) return -ENOMEM; diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index a18e2c503da6..a69322721c31 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -604,7 +604,7 @@ static int nfc_genl_dump_devices(struct sk_buff *skb, if (!iter) { first_call = true; - iter = kmalloc(sizeof(struct class_dev_iter), GFP_KERNEL); + iter = kmalloc_obj(struct class_dev_iter, GFP_KERNEL); if (!iter) return -ENOMEM; cb->args[0] = (long) iter; @@ -1370,7 +1370,7 @@ static int nfc_genl_dump_ses(struct sk_buff *skb, if (!iter) { first_call = true; - iter = kmalloc(sizeof(struct class_dev_iter), GFP_KERNEL); + iter = kmalloc_obj(struct class_dev_iter, GFP_KERNEL); if (!iter) return -ENOMEM; cb->args[0] = (long) iter; @@ -1541,7 +1541,7 @@ static int nfc_genl_se_io(struct sk_buff *skb, struct genl_info *info) apdu = nla_data(info->attrs[NFC_ATTR_SE_APDU]); - ctx = kzalloc(sizeof(struct se_io_ctx), GFP_KERNEL); + ctx = kzalloc_obj(struct se_io_ctx, GFP_KERNEL); if (!ctx) { rc = -ENOMEM; goto put_dev; @@ -1875,7 +1875,7 @@ static int nfc_genl_rcv_nl_event(struct notifier_block *this, pr_debug("NETLINK_URELEASE event from id %d\n", n->portid); - w = kmalloc(sizeof(*w), GFP_ATOMIC); + w = kmalloc_obj(*w, GFP_ATOMIC); if (w) { INIT_WORK(&w->w, nfc_urelease_event_work); w->portid = n->portid; diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index a0811e1fba65..8051e3127d2c 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -1586,15 +1586,15 @@ static int ovs_ct_limit_init(struct net *net, struct ovs_net *ovs_net) { int i, err; - ovs_net->ct_limit_info = kmalloc(sizeof(*ovs_net->ct_limit_info), - GFP_KERNEL); + ovs_net->ct_limit_info = kmalloc_obj(*ovs_net->ct_limit_info, + GFP_KERNEL); if (!ovs_net->ct_limit_info) return -ENOMEM; ovs_net->ct_limit_info->default_limit = OVS_CT_LIMIT_DEFAULT; ovs_net->ct_limit_info->limits = - kmalloc_array(CT_LIMIT_HASH_BUCKETS, sizeof(struct hlist_head), - GFP_KERNEL); + kmalloc_objs(struct hlist_head, CT_LIMIT_HASH_BUCKETS, + GFP_KERNEL); if (!ovs_net->ct_limit_info->limits) { kfree(ovs_net->ct_limit_info); return -ENOMEM; @@ -1688,8 +1688,7 @@ static int ovs_ct_limit_set_zone_limit(struct nlattr *nla_zone_limit, } else { struct ovs_ct_limit *ct_limit; - ct_limit = kmalloc(sizeof(*ct_limit), - GFP_KERNEL_ACCOUNT); + ct_limit = kmalloc_obj(*ct_limit, GFP_KERNEL_ACCOUNT); if (!ct_limit) return -ENOMEM; diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index d5b6e2002bc1..b4fb83c3c0f9 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1029,7 +1029,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) } /* Extract key. */ - key = kzalloc(sizeof(*key), GFP_KERNEL); + key = kzalloc_obj(*key, GFP_KERNEL); if (!key) { error = -ENOMEM; goto err_kfree_flow; @@ -1797,9 +1797,8 @@ static int ovs_dp_vport_init(struct datapath *dp) { int i; - dp->ports = kmalloc_array(DP_VPORT_HASH_BUCKETS, - sizeof(struct hlist_head), - GFP_KERNEL); + dp->ports = kmalloc_objs(struct hlist_head, DP_VPORT_HASH_BUCKETS, + GFP_KERNEL); if (!dp->ports) return -ENOMEM; @@ -1828,7 +1827,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) return -ENOMEM; err = -ENOMEM; - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); if (dp == NULL) goto err_destroy_reply; diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 2d536901309e..54fd208a1a68 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -1890,7 +1890,7 @@ int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid, return 0; /* If UFID was not provided, use unmasked key. */ - new_key = kmalloc(sizeof(*new_key), GFP_KERNEL); + new_key = kmalloc_obj(*new_key, GFP_KERNEL); if (!new_key) return -ENOMEM; memcpy(new_key, key, sizeof(*key)); diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index ffc72a741a50..b75236aa4414 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -150,14 +150,13 @@ static void __table_instance_destroy(struct table_instance *ti) static struct table_instance *table_instance_alloc(int new_size) { - struct table_instance *ti = kmalloc(sizeof(*ti), GFP_KERNEL); + struct table_instance *ti = kmalloc_obj(*ti, GFP_KERNEL); int i; if (!ti) return NULL; - ti->buckets = kvmalloc_array(new_size, sizeof(struct hlist_head), - GFP_KERNEL); + ti->buckets = kvmalloc_objs(struct hlist_head, new_size, GFP_KERNEL); if (!ti->buckets) { kfree(ti); return NULL; @@ -367,7 +366,7 @@ static struct mask_cache *tbl_mask_cache_alloc(u32 size) (size * sizeof(struct mask_cache_entry)) > PCPU_MIN_UNIT_SIZE) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; @@ -965,7 +964,7 @@ static struct sw_flow_mask *mask_alloc(void) { struct sw_flow_mask *mask; - mask = kmalloc(sizeof(*mask), GFP_KERNEL); + mask = kmalloc_obj(*mask, GFP_KERNEL); if (mask) mask->ref_count = 1; @@ -1110,8 +1109,7 @@ void ovs_flow_masks_rebalance(struct flow_table *table) int i; /* Build array of all current entries with use counters. */ - masks_and_count = kmalloc_array(ma->max, sizeof(*masks_and_count), - GFP_KERNEL); + masks_and_count = kmalloc_objs(*masks_and_count, ma->max, GFP_KERNEL); if (!masks_and_count) return; diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index cc08e0403909..0c2db78bb71e 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -69,7 +69,7 @@ static struct dp_meter_instance *dp_meter_instance_alloc(const u32 size) { struct dp_meter_instance *ti; - ti = kvzalloc(struct_size(ti, dp_meters, size), GFP_KERNEL); + ti = kvzalloc_flex(*ti, dp_meters, size, GFP_KERNEL); if (!ti) return NULL; @@ -341,7 +341,7 @@ static struct dp_meter *dp_meter_create(struct nlattr **a) return ERR_PTR(-EINVAL); /* Allocate and set up the meter before locking anything. */ - meter = kzalloc(struct_size(meter, bands, n_bands), GFP_KERNEL_ACCOUNT); + meter = kzalloc_flex(*meter, bands, n_bands, GFP_KERNEL_ACCOUNT); if (!meter) return ERR_PTR(-ENOMEM); diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index f0ce8ce1dce0..4b83512cbc65 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -34,8 +34,8 @@ static struct hlist_head *dev_table; */ int ovs_vport_init(void) { - dev_table = kcalloc(VPORT_HASH_BUCKETS, sizeof(struct hlist_head), - GFP_KERNEL); + dev_table = kzalloc_objs(struct hlist_head, VPORT_HASH_BUCKETS, + GFP_KERNEL); if (!dev_table) return -ENOMEM; diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index a1005359085a..a78c5122a3d7 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1711,7 +1711,7 @@ static int fanout_add(struct sock *sk, struct fanout_args *args) if (type == PACKET_FANOUT_ROLLOVER || (type_flags & PACKET_FANOUT_FLAG_ROLLOVER)) { err = -ENOMEM; - rollover = kzalloc(sizeof(*rollover), GFP_KERNEL); + rollover = kzalloc_obj(*rollover, GFP_KERNEL); if (!rollover) goto out; atomic_long_set(&rollover->num, 0); @@ -1754,8 +1754,8 @@ static int fanout_add(struct sock *sk, struct fanout_args *args) /* legacy PACKET_FANOUT_MAX */ args->max_num_members = 256; err = -ENOMEM; - match = kvzalloc(struct_size(match, arr, args->max_num_members), - GFP_KERNEL); + match = kvzalloc_flex(*match, arr, args->max_num_members, + GFP_KERNEL); if (!match) goto out; write_pnet(&match->net, sock_net(sk)); @@ -3693,7 +3693,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) goto done; err = -ENOBUFS; - i = kmalloc(sizeof(*i), GFP_KERNEL); + i = kmalloc_obj(*i, GFP_KERNEL); if (i == NULL) goto done; @@ -4390,7 +4390,7 @@ static struct pgv *alloc_pg_vec(struct tpacket_req *req, int order) struct pgv *pg_vec; int i; - pg_vec = kcalloc(block_nr, sizeof(struct pgv), GFP_KERNEL | __GFP_NOWARN); + pg_vec = kzalloc_objs(struct pgv, block_nr, GFP_KERNEL | __GFP_NOWARN); if (unlikely(!pg_vec)) goto out; diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 5c36bae37b8f..86325b7fc1b6 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -48,7 +48,7 @@ struct phonet_device_list *phonet_device_list(struct net *net) static struct phonet_device *__phonet_device_alloc(struct net_device *dev) { struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev)); - struct phonet_device *pnd = kmalloc(sizeof(*pnd), GFP_ATOMIC); + struct phonet_device *pnd = kmalloc_obj(*pnd, GFP_ATOMIC); if (pnd == NULL) return NULL; pnd->netdev = dev; diff --git a/net/psample/psample.c b/net/psample/psample.c index 25f92ba0840c..7763662036fb 100644 --- a/net/psample/psample.c +++ b/net/psample/psample.c @@ -143,7 +143,7 @@ static struct psample_group *psample_group_create(struct net *net, { struct psample_group *group; - group = kzalloc(sizeof(*group), GFP_ATOMIC); + group = kzalloc_obj(*group, GFP_ATOMIC); if (!group) return NULL; diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c index a8534124f626..08decafee7a6 100644 --- a/net/psp/psp_main.c +++ b/net/psp/psp_main.c @@ -64,7 +64,7 @@ psp_dev_create(struct net_device *netdev, !psd_ops->get_stats)) return ERR_PTR(-EINVAL); - psd = kzalloc(sizeof(*psd), GFP_KERNEL); + psd = kzalloc_obj(*psd, GFP_KERNEL); if (!psd) return ERR_PTR(-ENOMEM); diff --git a/net/psp/psp_sock.c b/net/psp/psp_sock.c index f785672b7df6..a85b0ed88842 100644 --- a/net/psp/psp_sock.c +++ b/net/psp/psp_sock.c @@ -50,8 +50,8 @@ struct psp_assoc *psp_assoc_create(struct psp_dev *psd) lockdep_assert_held(&psd->lock); - pas = kzalloc(struct_size(pas, drv_data, psd->caps->assoc_drv_spc), - GFP_KERNEL_ACCOUNT); + pas = kzalloc_flex(*pas, drv_data, psd->caps->assoc_drv_spc, + GFP_KERNEL_ACCOUNT); if (!pas) return NULL; diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index dab839f61ee9..70e7a210fd42 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -271,7 +271,7 @@ static int qrtr_tx_wait(struct qrtr_node *node, int dest_node, int dest_port, mutex_lock(&node->qrtr_tx_lock); flow = radix_tree_lookup(&node->qrtr_tx_flow, key); if (!flow) { - flow = kzalloc(sizeof(*flow), GFP_KERNEL); + flow = kzalloc_obj(*flow, GFP_KERNEL); if (flow) { init_waitqueue_head(&flow->resume_tx); if (radix_tree_insert(&node->qrtr_tx_flow, key, flow)) { @@ -589,7 +589,7 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid) if (!ep || !ep->xmit) return -EINVAL; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return -ENOMEM; diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index bfcc1a453f23..36b5c1990bf5 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -78,7 +78,7 @@ static struct qrtr_node *node_get(unsigned int node_id) return node; /* If node didn't exist, allocate and insert it to the tree */ - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node, GFP_KERNEL); if (!node) return NULL; @@ -229,7 +229,7 @@ static struct qrtr_server *server_add(unsigned int service, if (!service || !port) return NULL; - srv = kzalloc(sizeof(*srv), GFP_KERNEL); + srv = kzalloc_obj(*srv, GFP_KERNEL); if (!srv) return NULL; @@ -534,7 +534,7 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from, if (from->sq_node != qrtr_ns.local_node) return -EINVAL; - lookup = kzalloc(sizeof(*lookup), GFP_KERNEL); + lookup = kzalloc_obj(*lookup, GFP_KERNEL); if (!lookup) return -ENOMEM; diff --git a/net/qrtr/tun.c b/net/qrtr/tun.c index 304b41fea5ab..9ad17a773593 100644 --- a/net/qrtr/tun.c +++ b/net/qrtr/tun.c @@ -33,7 +33,7 @@ static int qrtr_tun_open(struct inode *inode, struct file *filp) struct qrtr_tun *tun; int ret; - tun = kzalloc(sizeof(*tun), GFP_KERNEL); + tun = kzalloc_obj(*tun, GFP_KERNEL); if (!tun) return -ENOMEM; diff --git a/net/rds/cong.c b/net/rds/cong.c index ac1f120c10f9..e7f019c3a625 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c @@ -143,7 +143,7 @@ static struct rds_cong_map *rds_cong_from_addr(const struct in6_addr *addr) unsigned long i; unsigned long flags; - map = kzalloc(sizeof(struct rds_cong_map), GFP_KERNEL); + map = kzalloc_obj(struct rds_cong_map, GFP_KERNEL); if (!map) return NULL; diff --git a/net/rds/connection.c b/net/rds/connection.c index 185f73b01694..e23fd9a628ac 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -197,7 +197,7 @@ static struct rds_connection *__rds_conn_create(struct net *net, conn = ERR_PTR(-ENOMEM); goto out; } - conn->c_path = kcalloc(npaths, sizeof(struct rds_conn_path), gfp); + conn->c_path = kzalloc_objs(struct rds_conn_path, npaths, gfp); if (!conn->c_path) { kmem_cache_free(rds_conn_slab, conn); conn = ERR_PTR(-ENOMEM); diff --git a/net/rds/ib.c b/net/rds/ib.c index 9826fe7f9d00..8457ec7c3ab8 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -172,9 +172,8 @@ static int rds_ib_add_one(struct ib_device *device) rds_ibdev->max_initiator_depth = device->attrs.max_qp_init_rd_atom; rds_ibdev->max_responder_resources = device->attrs.max_qp_rd_atom; - rds_ibdev->vector_load = kcalloc(device->num_comp_vectors, - sizeof(int), - GFP_KERNEL); + rds_ibdev->vector_load = kzalloc_objs(int, device->num_comp_vectors, + GFP_KERNEL); if (!rds_ibdev->vector_load) { pr_err("RDS/IB: %s failed to allocate vector memory\n", __func__); diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 26b069e1999d..0c64c504f79d 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -1203,7 +1203,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp) int ret; /* XXX too lazy? */ - ic = kzalloc(sizeof(struct rds_ib_connection), gfp); + ic = kzalloc_obj(struct rds_ib_connection, gfp); if (!ic) return -ENOMEM; diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 6585164c7059..651f658a6a0a 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -67,7 +67,7 @@ static int rds_ib_add_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr) { struct rds_ib_ipaddr *i_ipaddr; - i_ipaddr = kmalloc(sizeof *i_ipaddr, GFP_KERNEL); + i_ipaddr = kmalloc_obj(*i_ipaddr, GFP_KERNEL); if (!i_ipaddr) return -ENOMEM; @@ -585,7 +585,7 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents, if (key_ret) *key_ret = ib_mr->rkey; - ibmr = kzalloc(sizeof(*ibmr), GFP_KERNEL); + ibmr = kzalloc_obj(*ibmr, GFP_KERNEL); if (!ibmr) { ib_dereg_mr(ib_mr); ret = -ENOMEM; @@ -641,7 +641,7 @@ struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_ibdev, { struct rds_ib_mr_pool *pool; - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/net/rds/info.c b/net/rds/info.c index b6b46a8214a0..696e957c41a9 100644 --- a/net/rds/info.c +++ b/net/rds/info.c @@ -187,7 +187,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval, nr_pages = (PAGE_ALIGN(start + len) - (start & PAGE_MASK)) >> PAGE_SHIFT; - pages = kmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) { ret = -ENOMEM; goto out; diff --git a/net/rds/loop.c b/net/rds/loop.c index 1d73ad79c847..ac9295a766b1 100644 --- a/net/rds/loop.c +++ b/net/rds/loop.c @@ -137,7 +137,7 @@ static int rds_loop_conn_alloc(struct rds_connection *conn, gfp_t gfp) struct rds_loop_connection *lc; unsigned long flags; - lc = kzalloc(sizeof(struct rds_loop_connection), gfp); + lc = kzalloc_obj(struct rds_loop_connection, gfp); if (!lc) return -ENOMEM; diff --git a/net/rds/message.c b/net/rds/message.c index 54fd000806ea..e367ca4f4f31 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -415,7 +415,7 @@ static int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter * */ sg = rm->data.op_sg; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; INIT_LIST_HEAD(&info->rs_zcookie_next); diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 00dbcd4d28e6..0015531aff05 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -228,13 +228,13 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args, args->vec.addr, args->vec.bytes, nr_pages); /* XXX clamp nr_pages to limit the size of this alloc? */ - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) { ret = -ENOMEM; goto out; } - mr = kzalloc(sizeof(struct rds_mr), GFP_KERNEL); + mr = kzalloc_obj(struct rds_mr, GFP_KERNEL); if (!mr) { ret = -ENOMEM; goto out; @@ -269,7 +269,7 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args, goto out; } else { nents = ret; - sg = kmalloc_array(nents, sizeof(*sg), GFP_KERNEL); + sg = kmalloc_objs(*sg, nents, GFP_KERNEL); if (!sg) { ret = -ENOMEM; goto out; @@ -571,9 +571,7 @@ int rds_rdma_extra_size(struct rds_rdma_args *args, if (args->nr_local > UIO_MAXIOV) return -EMSGSIZE; - iov->iov = kcalloc(args->nr_local, - sizeof(struct rds_iovec), - GFP_KERNEL); + iov->iov = kzalloc_objs(struct rds_iovec, args->nr_local, GFP_KERNEL); if (!iov->iov) return -ENOMEM; @@ -654,7 +652,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, goto out_ret; } - pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); if (!pages) { ret = -ENOMEM; goto out_ret; @@ -681,7 +679,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, * would have to use GFP_ATOMIC there, and don't want to deal * with failed allocations. */ - op->op_notifier = kmalloc(sizeof(struct rds_notifier), GFP_KERNEL); + op->op_notifier = kmalloc_obj(struct rds_notifier, GFP_KERNEL); if (!op->op_notifier) { ret = -ENOMEM; goto out_pages; @@ -730,8 +728,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, ret = -EOPNOTSUPP; goto out_pages; } - local_odp_mr = - kzalloc(sizeof(*local_odp_mr), GFP_KERNEL); + local_odp_mr = kzalloc_obj(*local_odp_mr, GFP_KERNEL); if (!local_odp_mr) { ret = -ENOMEM; goto out_pages; @@ -937,7 +934,8 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, * would have to use GFP_ATOMIC there, and don't want to deal * with failed allocations. */ - rm->atomic.op_notifier = kmalloc(sizeof(*rm->atomic.op_notifier), GFP_KERNEL); + rm->atomic.op_notifier = kmalloc_obj(*rm->atomic.op_notifier, + GFP_KERNEL); if (!rm->atomic.op_notifier) { ret = -ENOMEM; goto err; diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 7d3e82e4c2fc..0f64aa4797f7 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -279,7 +279,7 @@ static void rfkill_send_events(struct rfkill *rfkill, enum rfkill_operation op) struct rfkill_int_event *ev; list_for_each_entry(data, &rfkill_fds, list) { - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) continue; rfkill_fill_event(&ev->ev, rfkill, op); @@ -1165,7 +1165,7 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) struct rfkill *rfkill; struct rfkill_int_event *ev, *tmp; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1182,7 +1182,7 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) */ list_for_each_entry(rfkill, &rfkill_list, node) { - ev = kzalloc(sizeof(*ev), GFP_KERNEL); + ev = kzalloc_obj(*ev, GFP_KERNEL); if (!ev) goto free; rfkill_sync(rfkill); diff --git a/net/rfkill/input.c b/net/rfkill/input.c index 53d286b10843..2be6d13ba6ba 100644 --- a/net/rfkill/input.c +++ b/net/rfkill/input.c @@ -221,7 +221,7 @@ static int rfkill_connect(struct input_handler *handler, struct input_dev *dev, struct input_handle *handle; int error; - handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL); + handle = kzalloc_obj(struct input_handle, GFP_KERNEL); if (!handle) return -ENOMEM; diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index c0f5a515a8ce..83c62af80d7c 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -1571,8 +1571,7 @@ static int __init rose_proto_init(void) rose_callsign = null_ax25_address; - dev_rose = kcalloc(rose_ndevs, sizeof(struct net_device *), - GFP_KERNEL); + dev_rose = kzalloc_objs(struct net_device *, rose_ndevs, GFP_KERNEL); if (dev_rose == NULL) { printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); rc = -ENOMEM; diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index a1e9b05ef6f5..4330df1b1b59 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c @@ -82,7 +82,7 @@ static int __must_check rose_add_node(struct rose_route_struct *rose_route, } if (rose_neigh == NULL) { - rose_neigh = kmalloc(sizeof(*rose_neigh), GFP_ATOMIC); + rose_neigh = kmalloc_obj(*rose_neigh, GFP_ATOMIC); if (rose_neigh == NULL) { res = -ENOMEM; goto out; @@ -106,7 +106,7 @@ static int __must_check rose_add_node(struct rose_route_struct *rose_route, if (rose_route->ndigis != 0) { rose_neigh->digipeat = - kmalloc(sizeof(ax25_digi), GFP_ATOMIC); + kmalloc_obj(ax25_digi, GFP_ATOMIC); if (rose_neigh->digipeat == NULL) { kfree(rose_neigh); res = -ENOMEM; @@ -148,7 +148,7 @@ static int __must_check rose_add_node(struct rose_route_struct *rose_route, } /* create new node */ - rose_node = kmalloc(sizeof(*rose_node), GFP_ATOMIC); + rose_node = kmalloc_obj(*rose_node, GFP_ATOMIC); if (rose_node == NULL) { res = -ENOMEM; goto out; @@ -368,7 +368,7 @@ void rose_add_loopback_neigh(void) { struct rose_neigh *sn; - rose_loopback_neigh = kmalloc(sizeof(struct rose_neigh), GFP_KERNEL); + rose_loopback_neigh = kmalloc_obj(struct rose_neigh, GFP_KERNEL); if (!rose_loopback_neigh) return; sn = rose_loopback_neigh; @@ -417,7 +417,7 @@ int rose_add_loopback_node(const rose_address *address) if (rose_node != NULL) goto out; - if ((rose_node = kmalloc(sizeof(*rose_node), GFP_ATOMIC)) == NULL) { + if ((rose_node = kmalloc_obj(*rose_node, GFP_ATOMIC)) == NULL) { err = -ENOMEM; goto out; } @@ -1055,7 +1055,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25) goto put_neigh; } - if ((rose_route = kmalloc(sizeof(*rose_route), GFP_ATOMIC)) == NULL) { + if ((rose_route = kmalloc_obj(*rose_route, GFP_ATOMIC)) == NULL) { rose_transmit_clear_request(rose_neigh, lci, ROSE_NETWORK_CONGESTION, 120); goto put_neigh; } diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c index 00982a030744..ee2d1319e69a 100644 --- a/net/rxrpc/call_accept.c +++ b/net/rxrpc/call_accept.c @@ -164,7 +164,7 @@ int rxrpc_service_prealloc(struct rxrpc_sock *rx, gfp_t gfp) struct rxrpc_backlog *b = rx->backlog; if (!b) { - b = kzalloc(sizeof(struct rxrpc_backlog), gfp); + b = kzalloc_obj(struct rxrpc_backlog, gfp); if (!b) return -ENOMEM; rx->backlog = b; diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 63bbcc567f59..9b757798dedd 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -76,7 +76,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call, static atomic_t rxrpc_bundle_id; struct rxrpc_bundle *bundle; - bundle = kzalloc(sizeof(*bundle), gfp); + bundle = kzalloc_obj(*bundle, gfp); if (bundle) { bundle->local = call->local; bundle->peer = rxrpc_get_peer(call->peer, rxrpc_peer_get_bundle); diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index 37340becb224..0ece717db0f8 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -59,7 +59,7 @@ struct rxrpc_connection *rxrpc_alloc_connection(struct rxrpc_net *rxnet, _enter(""); - conn = kzalloc(sizeof(struct rxrpc_connection), gfp); + conn = kzalloc_obj(struct rxrpc_connection, gfp); if (conn) { INIT_LIST_HEAD(&conn->cache_link); timer_setup(&conn->timer, &rxrpc_connection_timer, 0); diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index 9fdc1f031c9d..cd65bff97a8e 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -75,7 +75,7 @@ static int rxrpc_preparse_xdr_rxkad(struct key_preparsed_payload *prep, prep->quotalen = datalen + plen; plen -= sizeof(*token); - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kzalloc_obj(*token, GFP_KERNEL); if (!token) return -ENOMEM; @@ -202,7 +202,7 @@ static int rxrpc_preparse_xdr_yfs_rxgk(struct key_preparsed_payload *prep, prep->quotalen = datalen + plen; plen -= sizeof(*token); - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kzalloc_obj(*token, GFP_KERNEL); if (!token) goto nomem; @@ -500,7 +500,7 @@ static int rxrpc_preparse(struct key_preparsed_payload *prep) prep->quotalen = plen + sizeof(*token); ret = -ENOMEM; - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kzalloc_obj(*token, GFP_KERNEL); if (!token) goto error; token->kad = kzalloc(plen, GFP_KERNEL); diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index a74a4b43904f..6f799b26d4d5 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -112,7 +112,7 @@ static struct rxrpc_local *rxrpc_alloc_local(struct net *net, struct rxrpc_local *local; u32 tmp; - local = kzalloc(sizeof(struct rxrpc_local), GFP_KERNEL); + local = kzalloc_obj(struct rxrpc_local, GFP_KERNEL); if (local) { refcount_set(&local->ref, 1); atomic_set(&local->active_users, 1); diff --git a/net/rxrpc/peer_object.c b/net/rxrpc/peer_object.c index 366431b0736c..fa9a406e1168 100644 --- a/net/rxrpc/peer_object.c +++ b/net/rxrpc/peer_object.c @@ -226,7 +226,7 @@ struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *local, gfp_t gfp, _enter(""); - peer = kzalloc(sizeof(struct rxrpc_peer), gfp); + peer = kzalloc_obj(struct rxrpc_peer, gfp); if (peer) { refcount_set(&peer->ref, 1); peer->local = rxrpc_get_local(local, rxrpc_local_get_peer); diff --git a/net/rxrpc/rxgk.c b/net/rxrpc/rxgk.c index 43cbf9efd89f..f9f5a2dc62ed 100644 --- a/net/rxrpc/rxgk.c +++ b/net/rxrpc/rxgk.c @@ -351,7 +351,7 @@ static int rxgk_secure_packet_integrity(const struct rxrpc_call *call, _enter(""); - hdr = kzalloc(sizeof(*hdr), GFP_NOFS); + hdr = kzalloc_obj(*hdr, GFP_NOFS); if (!hdr) goto error_gk; @@ -483,7 +483,7 @@ static int rxgk_verify_packet_integrity(struct rxrpc_call *call, crypto_krb5_where_is_the_data(gk->krb5, KRB5_CHECKSUM_MODE, &data_offset, &data_len); - hdr = kzalloc(sizeof(*hdr), GFP_NOFS); + hdr = kzalloc_obj(*hdr, GFP_NOFS); if (!hdr) goto put_gk; diff --git a/net/rxrpc/rxgk_kdf.c b/net/rxrpc/rxgk_kdf.c index b4db5aa30e5b..6011fa7cf221 100644 --- a/net/rxrpc/rxgk_kdf.c +++ b/net/rxrpc/rxgk_kdf.c @@ -213,7 +213,7 @@ struct rxgk_context *rxgk_generate_transport_key(struct rxrpc_connection *conn, _enter(""); - gk = kzalloc(sizeof(*gk), GFP_KERNEL); + gk = kzalloc_obj(*gk, GFP_KERNEL); if (!gk) return ERR_PTR(-ENOMEM); refcount_set(&gk->usage, 1); diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index a756855a0a62..e923d6829008 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -511,7 +511,7 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, if (nsg <= 4) { nsg = 4; } else { - sg = kmalloc_array(nsg, sizeof(*sg), GFP_NOIO); + sg = kmalloc_objs(*sg, nsg, GFP_NOIO); if (!sg) return -ENOMEM; } @@ -1139,7 +1139,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, } ret = -ENOMEM; - response = kzalloc(sizeof(struct rxkad_response), GFP_NOFS); + response = kzalloc_obj(struct rxkad_response, GFP_NOFS); if (!response) goto temporary_error; diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c index 98ea76fae70f..1345ffffb109 100644 --- a/net/rxrpc/rxperf.c +++ b/net/rxrpc/rxperf.c @@ -151,7 +151,7 @@ static void rxperf_charge_preallocation(struct work_struct *work) struct rxperf_call *call; for (;;) { - call = kzalloc(sizeof(*call), GFP_KERNEL); + call = kzalloc_obj(*call, GFP_KERNEL); if (!call) break; diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index ebbb78b842de..04f9c5f2dc24 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -282,7 +282,7 @@ static int rxrpc_alloc_txqueue(struct sock *sk, struct rxrpc_call *call) { struct rxrpc_txqueue *tq; - tq = kzalloc(sizeof(*tq), sk->sk_allocation); + tq = kzalloc_obj(*tq, sk->sk_allocation); if (!tq) return -ENOMEM; diff --git a/net/rxrpc/txbuf.c b/net/rxrpc/txbuf.c index 29767038691a..55ef7a04852e 100644 --- a/net/rxrpc/txbuf.c +++ b/net/rxrpc/txbuf.c @@ -23,7 +23,7 @@ struct rxrpc_txbuf *rxrpc_alloc_data_txbuf(struct rxrpc_call *call, size_t data_ size_t total, doff, jsize = sizeof(struct rxrpc_jumbo_header); void *buf; - txb = kzalloc(sizeof(*txb), gfp); + txb = kzalloc_obj(*txb, gfp); if (!txb) return NULL; diff --git a/net/sched/act_api.c b/net/sched/act_api.c index e1ab0faeb811..389874842982 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -985,7 +985,7 @@ static int tcf_pernet_add_id_list(unsigned int id) } } - id_ptr = kzalloc(sizeof(*id_ptr), GFP_KERNEL); + id_ptr = kzalloc_obj(*id_ptr, GFP_KERNEL); if (!id_ptr) { ret = -ENOMEM; goto err_out; @@ -1272,7 +1272,7 @@ errout: static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb) { - struct tc_cookie *c = kzalloc(sizeof(*c), GFP_KERNEL); + struct tc_cookie *c = kzalloc_obj(*c, GFP_KERNEL); if (!c) return NULL; diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 26ba8c2d20ab..19eea8daa6b5 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c @@ -121,7 +121,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, if (!tb[TCA_CONNMARK_PARMS]) return -EINVAL; - nparms = kzalloc(sizeof(*nparms), GFP_KERNEL); + nparms = kzalloc_obj(*nparms, GFP_KERNEL); if (!nparms) return -ENOMEM; diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 0939e6b2ba4d..1cd3336eeeea 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -93,7 +93,7 @@ static int tcf_csum_init(struct net *net, struct nlattr *nla, p = to_tcf_csum(*a); - params_new = kzalloc(sizeof(*params_new), GFP_KERNEL); + params_new = kzalloc_obj(*params_new, GFP_KERNEL); if (unlikely(!params_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 81d488655793..5f45bec69c50 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -332,7 +332,7 @@ static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params) if (ct_ft && refcount_inc_not_zero(&ct_ft->ref)) goto out_unlock; - ct_ft = kzalloc(sizeof(*ct_ft), GFP_KERNEL); + ct_ft = kzalloc_obj(*ct_ft, GFP_KERNEL); if (!ct_ft) goto err_alloc; refcount_set(&ct_ft->ref, 1); @@ -1397,7 +1397,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, c = to_ct(*a); - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (unlikely(!params)) { err = -ENOMEM; goto cleanup; diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c index d2c750bab1d3..00e303a01241 100644 --- a/net/sched/act_ctinfo.c +++ b/net/sched/act_ctinfo.c @@ -236,7 +236,7 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla, ci = to_ctinfo(*a); - cp_new = kzalloc(sizeof(*cp_new), GFP_KERNEL); + cp_new = kzalloc_obj(*cp_new, GFP_KERNEL); if (unlikely(!cp_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c index c1f75f272757..686eaed81b81 100644 --- a/net/sched/act_gate.c +++ b/net/sched/act_gate.c @@ -243,7 +243,7 @@ static int parse_gate_list(struct nlattr *list_attr, continue; } - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) { NL_SET_ERR_MSG(extack, "Not enough memory for entry"); err = -ENOMEM; diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index 8e8f6af731d5..6895834a929c 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c @@ -299,7 +299,7 @@ static int __add_metainfo(const struct tcf_meta_ops *ops, struct tcf_meta_info *mi = NULL; int ret = 0; - mi = kzalloc(sizeof(*mi), atomic ? GFP_ATOMIC : GFP_KERNEL); + mi = kzalloc_obj(*mi, atomic ? GFP_ATOMIC : GFP_KERNEL); if (!mi) return -ENOMEM; @@ -520,7 +520,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, if (parm->flags & ~IFE_ENCODE) return -EINVAL; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index 6654011dcd2b..30c915d43432 100644 --- a/net/sched/act_mpls.c +++ b/net/sched/act_mpls.c @@ -279,7 +279,7 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla, m = to_mpls(*a); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 26241d80ebe0..7ca2af5a10c3 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -81,7 +81,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, if (err < 0) goto release_idr; - nparm = kzalloc(sizeof(*nparm), GFP_KERNEL); + nparm = kzalloc_obj(*nparm, GFP_KERNEL); if (!nparm) { err = -ENOMEM; goto release_idr; diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 4b65901397a8..fb960a05cbc8 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -51,7 +51,7 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, if (!nla) return NULL; - keys_ex = kcalloc(n, sizeof(*k), GFP_KERNEL); + keys_ex = kzalloc_objs(*k, n, GFP_KERNEL); if (!keys_ex) return ERR_PTR(-ENOMEM); @@ -223,7 +223,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, goto out_release; } - nparms = kzalloc(sizeof(*nparms), GFP_KERNEL); + nparms = kzalloc_obj(*nparms, GFP_KERNEL); if (!nparms) { ret = -ENOMEM; goto out_release; diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 0e1c61183379..4778c3ebd5db 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -151,7 +151,7 @@ static int tcf_police_init(struct net *net, struct nlattr *nla, goto failure; } - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (unlikely(!new)) { err = -ENOMEM; goto failure; diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 5450c1293eb5..e3764d9862ad 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -242,7 +242,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, if (err < 0) goto release_idr; - params_new = kzalloc(sizeof(*params_new), GFP_KERNEL); + params_new = kzalloc_obj(*params_new, GFP_KERNEL); if (unlikely(!params_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index a9e0c1326e2a..2eaf82dc2179 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c @@ -185,7 +185,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, d = to_skbmod(*a); - p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL); + p = kzalloc_obj(struct tcf_skbmod_params, GFP_KERNEL); if (unlikely(!p)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index a74621797d69..51ac783f7d6c 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -233,7 +233,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, v = to_vlan(*a); - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index ebca4b926dcf..22e8527657af 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -84,7 +84,7 @@ tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, if (WARN_ON(!handle || !tp->ops->get_exts)) return -EINVAL; - n = kzalloc(sizeof(*n), GFP_KERNEL); + n = kzalloc_obj(*n, GFP_KERNEL); if (!n) return -ENOMEM; @@ -377,7 +377,7 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol, struct tcf_proto *tp; int err; - tp = kzalloc(sizeof(*tp), GFP_KERNEL); + tp = kzalloc_obj(*tp, GFP_KERNEL); if (!tp) return ERR_PTR(-ENOBUFS); @@ -502,7 +502,7 @@ static struct tcf_chain *tcf_chain_create(struct tcf_block *block, ASSERT_BLOCK_LOCKED(block); - chain = kzalloc(sizeof(*chain), GFP_KERNEL); + chain = kzalloc_obj(*chain, GFP_KERNEL); if (!chain) return NULL; list_add_tail_rcu(&chain->list, &block->chain_list); @@ -918,7 +918,7 @@ tcf_chain0_head_change_cb_add(struct tcf_block *block, struct tcf_filter_chain_list_item *item; struct tcf_chain *chain0; - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) { NL_SET_ERR_MSG(extack, "Memory allocation for head change callback item failed"); return -ENOMEM; @@ -1016,7 +1016,7 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, { struct tcf_block *block; - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) { NL_SET_ERR_MSG(extack, "Memory allocation for block failed"); return ERR_PTR(-ENOMEM); @@ -1428,7 +1428,7 @@ static int tcf_block_owner_add(struct tcf_block *block, { struct tcf_block_owner_item *item; - item = kmalloc(sizeof(*item), GFP_KERNEL); + item = kmalloc_obj(*item, GFP_KERNEL); if (!item) return -ENOMEM; item->q = q; @@ -3341,8 +3341,8 @@ int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, * This reference might be taken later from tcf_exts_get_net(). */ exts->net = net; - exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), - GFP_KERNEL); + exts->actions = kzalloc_objs(struct tc_action *, TCA_ACT_MAX_PRIO, + GFP_KERNEL); if (!exts->actions) return -ENOMEM; #endif diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index ecfaa4f9a04e..5479fd5341b2 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -77,7 +77,7 @@ static int basic_init(struct tcf_proto *tp) { struct basic_head *head; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (head == NULL) return -ENOBUFS; INIT_LIST_HEAD(&head->flist); @@ -193,7 +193,7 @@ static int basic_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; } - fnew = kzalloc(sizeof(*fnew), GFP_KERNEL); + fnew = kzalloc_obj(*fnew, GFP_KERNEL); if (!fnew) return -ENOBUFS; diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index a32754a2658b..f42b89ba10a8 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c @@ -242,7 +242,7 @@ static int cls_bpf_init(struct tcf_proto *tp) { struct cls_bpf_head *head; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (head == NULL) return -ENOBUFS; @@ -427,7 +427,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, if (ret < 0) return ret; - prog = kzalloc(sizeof(*prog), GFP_KERNEL); + prog = kzalloc_obj(*prog, GFP_KERNEL); if (!prog) return -ENOBUFS; diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 424252982d6a..d177b1cfde60 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -95,7 +95,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, if (head && handle != head->handle) return -ENOENT; - new = kzalloc(sizeof(*head), GFP_KERNEL); + new = kzalloc_obj(*head, GFP_KERNEL); if (!new) return -ENOBUFS; diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 5693b41b093f..83d837c4bced 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -433,7 +433,7 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, return -EOPNOTSUPP; } - fnew = kzalloc(sizeof(*fnew), GFP_KERNEL); + fnew = kzalloc_obj(*fnew, GFP_KERNEL); if (!fnew) return -ENOBUFS; @@ -583,7 +583,7 @@ static int flow_init(struct tcf_proto *tp) { struct flow_head *head; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (head == NULL) return -ENOBUFS; INIT_LIST_HEAD(&head->filters); diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 7669371c1354..3c930039bacb 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -363,7 +363,7 @@ static int fl_init(struct tcf_proto *tp) { struct cls_fl_head *head; - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (!head) return -ENOBUFS; @@ -2237,7 +2237,7 @@ static struct fl_flow_mask *fl_create_new_mask(struct cls_fl_head *head, struct fl_flow_mask *newmask; int err; - newmask = kzalloc(sizeof(*newmask), GFP_KERNEL); + newmask = kzalloc_obj(*newmask, GFP_KERNEL); if (!newmask) return ERR_PTR(-ENOMEM); @@ -2376,13 +2376,13 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, goto errout_fold; } - mask = kzalloc(sizeof(struct fl_flow_mask), GFP_KERNEL); + mask = kzalloc_obj(struct fl_flow_mask, GFP_KERNEL); if (!mask) { err = -ENOBUFS; goto errout_fold; } - tb = kcalloc(TCA_FLOWER_MAX + 1, sizeof(struct nlattr *), GFP_KERNEL); + tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1, GFP_KERNEL); if (!tb) { err = -ENOBUFS; goto errout_mask_alloc; @@ -2398,7 +2398,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, goto errout_tb; } - fnew = kzalloc(sizeof(*fnew), GFP_KERNEL); + fnew = kzalloc_obj(*fnew, GFP_KERNEL); if (!fnew) { err = -ENOBUFS; goto errout_tb; @@ -2815,7 +2815,7 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain, if (!tca_opts) return ERR_PTR(-EINVAL); - tb = kcalloc(TCA_FLOWER_MAX + 1, sizeof(struct nlattr *), GFP_KERNEL); + tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1, GFP_KERNEL); if (!tb) return ERR_PTR(-ENOBUFS); err = nla_parse_nested_deprecated(tb, TCA_FLOWER_MAX, @@ -2823,7 +2823,7 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain, if (err) goto errout_tb; - tmplt = kzalloc(sizeof(*tmplt), GFP_KERNEL); + tmplt = kzalloc_obj(*tmplt, GFP_KERNEL); if (!tmplt) { err = -ENOMEM; goto errout_tb; diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index cdddc8695228..8eb3bea06e3b 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c @@ -262,7 +262,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, if (f->id != handle && handle) return -EINVAL; - fnew = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); + fnew = kzalloc_obj(struct fw_filter, GFP_KERNEL); if (!fnew) return -ENOBUFS; @@ -308,7 +308,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, if (tb[TCA_FW_MASK]) mask = nla_get_u32(tb[TCA_FW_MASK]); - head = kzalloc(sizeof(*head), GFP_KERNEL); + head = kzalloc_obj(*head, GFP_KERNEL); if (!head) return -ENOBUFS; head->mask = mask; @@ -316,7 +316,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, rcu_assign_pointer(tp->root, head); } - f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); + f = kzalloc_obj(struct fw_filter, GFP_KERNEL); if (f == NULL) return -ENOBUFS; diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index f03bf5da39ee..e78b6da59782 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -189,7 +189,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; } - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return -ENOBUFS; diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index b9c58c040c30..6e16819ba91f 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -244,7 +244,7 @@ static int route4_init(struct tcf_proto *tp) { struct route4_head *head; - head = kzalloc(sizeof(struct route4_head), GFP_KERNEL); + head = kzalloc_obj(struct route4_head, GFP_KERNEL); if (head == NULL) return -ENOBUFS; @@ -438,7 +438,7 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp, h1 = to_hash(nhandle); b = rtnl_dereference(head->table[h1]); if (!b) { - b = kzalloc(sizeof(struct route4_bucket), GFP_KERNEL); + b = kzalloc_obj(struct route4_bucket, GFP_KERNEL); if (b == NULL) return -ENOBUFS; @@ -507,7 +507,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; err = -ENOBUFS; - f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL); + f = kzalloc_obj(struct route4_filter, GFP_KERNEL); if (!f) goto errout; diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 58e849c0acf4..2bdc14c5e533 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -364,7 +364,7 @@ static int u32_init(struct tcf_proto *tp) void *key = tc_u_common_ptr(tp); struct tc_u_common *tp_c = tc_u_common_find(key); - root_ht = kzalloc(struct_size(root_ht, ht, 1), GFP_KERNEL); + root_ht = kzalloc_flex(*root_ht, ht, 1, GFP_KERNEL); if (root_ht == NULL) return -ENOBUFS; @@ -375,7 +375,7 @@ static int u32_init(struct tcf_proto *tp) idr_init(&root_ht->handle_idr); if (tp_c == NULL) { - tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL); + tp_c = kzalloc_obj(*tp_c, GFP_KERNEL); if (tp_c == NULL) { kfree(root_ht); return -ENOBUFS; @@ -825,7 +825,7 @@ static struct tc_u_knode *u32_init_knode(struct net *net, struct tcf_proto *tp, struct tc_u32_sel *s = &n->sel; struct tc_u_knode *new; - new = kzalloc(struct_size(new, sel.keys, s->nkeys), GFP_KERNEL); + new = kzalloc_flex(*new, sel.keys, s->nkeys, GFP_KERNEL); if (!new) return NULL; @@ -974,7 +974,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, NL_SET_ERR_MSG_MOD(extack, "Divisor can only be used on a hash table"); return -EINVAL; } - ht = kzalloc(struct_size(ht, ht, divisor + 1), GFP_KERNEL); + ht = kzalloc_flex(*ht, ht, divisor + 1, GFP_KERNEL); if (ht == NULL) return -ENOBUFS; if (handle == 0) { @@ -1104,7 +1104,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, goto erridr; } - n = kzalloc(struct_size(n, sel.keys, s->nkeys), GFP_KERNEL); + n = kzalloc_flex(*n, sel.keys, s->nkeys, GFP_KERNEL); if (n == NULL) { err = -ENOBUFS; goto erridr; @@ -1417,7 +1417,7 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh, goto nla_put_failure; } #ifdef CONFIG_CLS_U32_PERF - gpf = kzalloc(struct_size(gpf, kcnts, n->sel.nkeys), GFP_KERNEL); + gpf = kzalloc_flex(*gpf, kcnts, n->sel.nkeys, GFP_KERNEL); if (!gpf) goto nla_put_failure; @@ -1480,9 +1480,8 @@ static int __init init_u32(void) #ifdef CONFIG_NET_CLS_ACT pr_info(" Actions configured\n"); #endif - tc_u_common_hash = kvmalloc_array(U32_HASH_SIZE, - sizeof(struct hlist_head), - GFP_KERNEL); + tc_u_common_hash = kvmalloc_objs(struct hlist_head, U32_HASH_SIZE, + GFP_KERNEL); if (!tc_u_common_hash) return -ENOMEM; diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 3f2e707a11d1..bc47af8a45c6 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -927,7 +927,7 @@ static int em_meta_change(struct net *net, void *data, int len, TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) goto errout; - meta = kzalloc(sizeof(*meta), GFP_KERNEL); + meta = kzalloc_obj(*meta, GFP_KERNEL); if (meta == NULL) { err = -ENOMEM; goto errout; diff --git a/net/sched/em_text.c b/net/sched/em_text.c index 692e2be1793e..a69889159537 100644 --- a/net/sched/em_text.c +++ b/net/sched/em_text.c @@ -84,7 +84,7 @@ retry: return -EAGAIN; } - tm = kmalloc(sizeof(*tm), GFP_KERNEL); + tm = kmalloc_obj(*tm, GFP_KERNEL); if (tm == NULL) { textsearch_destroy(ts_conf); return -ENOBUFS; diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 443c116e8663..bcf82bbc60fd 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -437,7 +437,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, } } - rtab = kmalloc(sizeof(*rtab), GFP_KERNEL); + rtab = kmalloc_obj(*rtab, GFP_KERNEL); if (rtab) { rtab->rate = *r; rtab->refcnt = 1; @@ -530,7 +530,7 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt, return ERR_PTR(-EINVAL); } - stab = kmalloc(struct_size(stab, data, tsize), GFP_KERNEL); + stab = kmalloc_flex(*stab, data, tsize, GFP_KERNEL); if (!stab) return ERR_PTR(-ENOMEM); @@ -668,7 +668,7 @@ static struct hlist_head *qdisc_class_hash_alloc(unsigned int n) struct hlist_head *h; unsigned int i; - h = kvmalloc_array(n, sizeof(struct hlist_head), GFP_KERNEL); + h = kvmalloc_objs(struct hlist_head, n, GFP_KERNEL); if (h != NULL) { for (i = 0; i < n; i++) diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index d2bbd5654d5b..7c7a068513e7 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c @@ -2849,8 +2849,8 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt, for (i = 1; i <= CAKE_QUEUES; i++) quantum_div[i] = 65535 / i; - qd->tins = kvcalloc(CAKE_MAX_TINS, sizeof(struct cake_tin_data), - GFP_KERNEL); + qd->tins = kvzalloc_objs(struct cake_tin_data, CAKE_MAX_TINS, + GFP_KERNEL); if (!qd->tins) return -ENOMEM; diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index 59e7bdf5063e..8d2dd1c4f3dc 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c @@ -370,7 +370,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, if (mask != q->tab_mask) { struct sk_buff **ntab; - ntab = kvcalloc(mask + 1, sizeof(struct sk_buff *), GFP_KERNEL); + ntab = kvzalloc_objs(struct sk_buff *, mask + 1, GFP_KERNEL); if (!ntab) return -ENOMEM; diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 9b6d79bd8737..80d845dfbe80 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -105,7 +105,7 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, return 0; } - cl = kzalloc(sizeof(struct drr_class), GFP_KERNEL); + cl = kzalloc_obj(struct drr_class, GFP_KERNEL); if (cl == NULL) return -ENOBUFS; diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index dc187c7f06b1..16cd38a179e5 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -496,9 +496,8 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, goto init_failure; if (!q->flows) { - q->flows = kvcalloc(q->flows_cnt, - sizeof(struct fq_codel_flow), - GFP_KERNEL); + q->flows = kvzalloc_objs(struct fq_codel_flow, q->flows_cnt, + GFP_KERNEL); if (!q->flows) { err = -ENOMEM; goto init_failure; diff --git a/net/sched/sch_fq_pie.c b/net/sched/sch_fq_pie.c index 7b96bc3ff891..8784f89619d0 100644 --- a/net/sched/sch_fq_pie.c +++ b/net/sched/sch_fq_pie.c @@ -448,8 +448,7 @@ static int fq_pie_init(struct Qdisc *sch, struct nlattr *opt, if (err) goto init_failure; - q->flows = kvcalloc(q->flows_cnt, sizeof(struct fq_pie_flow), - GFP_KERNEL); + q->flows = kvzalloc_objs(struct fq_pie_flow, q->flows_cnt, GFP_KERNEL); if (!q->flows) { err = -ENOMEM; goto init_failure; diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 532fde548b88..ec4c8513e617 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -359,7 +359,7 @@ static int gred_offload_dump_stats(struct Qdisc *sch) unsigned int i; int ret; - hw_stats = kzalloc(sizeof(*hw_stats), GFP_KERNEL); + hw_stats = kzalloc_obj(*hw_stats, GFP_KERNEL); if (!hw_stats) return -ENOMEM; @@ -700,7 +700,7 @@ static int gred_change(struct Qdisc *sch, struct nlattr *opt, prio = ctl->prio; } - prealloc = kzalloc(sizeof(*prealloc), GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); sch_tree_lock(sch); err = gred_change_vq(sch, ctl->DP, ctl, prio, stab, max_P, &prealloc, @@ -757,7 +757,7 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt, * psched_mtu(qdisc_dev(sch)); if (qdisc_dev(sch)->netdev_ops->ndo_setup_tc) { - table->opt = kzalloc(sizeof(*table->opt), GFP_KERNEL); + table->opt = kzalloc_obj(*table->opt, GFP_KERNEL); if (!table->opt) return -ENOMEM; } diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index d8fd35da32a7..3f08daae26d8 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -1025,7 +1025,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, if (rsc == NULL && fsc == NULL) return -EINVAL; - cl = kzalloc(sizeof(struct hfsc_class), GFP_KERNEL); + cl = kzalloc_obj(struct hfsc_class, GFP_KERNEL); if (cl == NULL) return -ENOBUFS; diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c index 2d4855e28a28..a386c40b67da 100644 --- a/net/sched/sch_hhf.c +++ b/net/sched/sch_hhf.c @@ -230,7 +230,7 @@ static struct hh_flow_state *alloc_new_hh(struct list_head *head, return NULL; } /* Create new entry. */ - flow = kzalloc(sizeof(struct hh_flow_state), GFP_ATOMIC); + flow = kzalloc_obj(struct hh_flow_state, GFP_ATOMIC); if (!flow) return NULL; @@ -604,8 +604,8 @@ static int hhf_init(struct Qdisc *sch, struct nlattr *opt, if (!q->hh_flows) { /* Initialize heavy-hitter flow table. */ - q->hh_flows = kvcalloc(HH_FLOWS_CNT, sizeof(struct list_head), - GFP_KERNEL); + q->hh_flows = kvzalloc_objs(struct list_head, HH_FLOWS_CNT, + GFP_KERNEL); if (!q->hh_flows) return -ENOMEM; for (i = 0; i < HH_FLOWS_CNT; i++) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index b5e40c51655a..7b34e40d4bd2 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1095,9 +1095,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt, } q->num_direct_qdiscs = dev->real_num_tx_queues; - q->direct_qdiscs = kcalloc(q->num_direct_qdiscs, - sizeof(*q->direct_qdiscs), - GFP_KERNEL); + q->direct_qdiscs = kzalloc_objs(*q->direct_qdiscs, + q->num_direct_qdiscs, + GFP_KERNEL); if (!q->direct_qdiscs) return -ENOMEM; } @@ -1845,7 +1845,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, goto failure; } err = -ENOBUFS; - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) goto failure; diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index bb94cd577943..4dd8379c97b6 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c @@ -82,8 +82,8 @@ int mq_init_common(struct Qdisc *sch, struct nlattr *opt, return -EOPNOTSUPP; /* pre-allocate qdiscs, attachment can't fail */ - priv->qdiscs = kcalloc(dev->num_tx_queues, sizeof(priv->qdiscs[0]), - GFP_KERNEL); + priv->qdiscs = kzalloc_objs(priv->qdiscs[0], dev->num_tx_queues, + GFP_KERNEL); if (!priv->qdiscs) return -ENOMEM; diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index f3e5ef9a9592..ddb18e97bb91 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -388,8 +388,8 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt, } /* pre-allocate qdisc, attachment can't fail */ - priv->qdiscs = kcalloc(dev->num_tx_queues, sizeof(priv->qdiscs[0]), - GFP_KERNEL); + priv->qdiscs = kzalloc_objs(priv->qdiscs[0], dev->num_tx_queues, + GFP_KERNEL); if (!priv->qdiscs) return -ENOMEM; diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 06e03f5cd7ce..e61e53e3711f 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -249,7 +249,7 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt, q->max_bands = qdisc_dev(sch)->num_tx_queues; - q->queues = kcalloc(q->max_bands, sizeof(struct Qdisc *), GFP_KERNEL); + q->queues = kzalloc_objs(struct Qdisc *, q->max_bands, GFP_KERNEL); if (!q->queues) return -ENOBUFS; for (i = 0; i < q->max_bands; i++) diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 32a5f3304046..334d2f93ae89 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -814,7 +814,7 @@ static int get_dist_table(struct disttable **tbl, const struct nlattr *attr) if (!n || n > NETEM_DIST_MAX) return -EINVAL; - d = kvmalloc(struct_size(d, table, n), GFP_KERNEL); + d = kvmalloc_flex(*d, table, n, GFP_KERNEL); if (!d) return -ENOMEM; diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index e7778413e72f..6eb71d3f03dd 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -392,7 +392,7 @@ static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight, new_agg = qfq_find_agg(q, lmax, weight); if (new_agg == NULL) { /* create new aggregate */ - new_agg = kzalloc(sizeof(*new_agg), GFP_ATOMIC); + new_agg = kzalloc_obj(*new_agg, GFP_ATOMIC); if (new_agg == NULL) return -ENOBUFS; qfq_init_agg(q, new_agg, lmax, weight); @@ -476,7 +476,7 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, } /* create and init new class */ - cl = kzalloc(sizeof(struct qfq_class), GFP_KERNEL); + cl = kzalloc_obj(struct qfq_class, GFP_KERNEL); if (cl == NULL) return -ENOBUFS; @@ -508,7 +508,7 @@ set_change_agg: new_agg = qfq_find_agg(q, lmax, weight); if (new_agg == NULL) { /* create new aggregate */ sch_tree_unlock(sch); - new_agg = kzalloc(sizeof(*new_agg), GFP_KERNEL); + new_agg = kzalloc_obj(*new_agg, GFP_KERNEL); if (new_agg == NULL) { err = -ENOBUFS; gen_kill_estimator(&cl->rate_est); diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 96eb2f122973..31ee70314431 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -668,7 +668,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt, ctl_v1->Wlog, ctl_v1->Scell_log, NULL)) return -EINVAL; if (ctl_v1 && ctl_v1->qth_min) { - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; } diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 300d577b3286..31e59e875932 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1103,7 +1103,7 @@ static int parse_sched_list(struct taprio_sched *q, struct nlattr *list, continue; } - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { NL_SET_ERR_MSG(extack, "Not enough memory for entry"); return -ENOMEM; @@ -1376,8 +1376,8 @@ static struct tc_taprio_qopt_offload *taprio_offload_alloc(int num_entries) { struct __tc_taprio_qopt_offload *__offload; - __offload = kzalloc(struct_size(__offload, offload.entries, num_entries), - GFP_KERNEL); + __offload = kzalloc_flex(*__offload, offload.entries, num_entries, + GFP_KERNEL); if (!__offload) return NULL; @@ -1870,7 +1870,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, if (err) return err; - new_admin = kzalloc(sizeof(*new_admin), GFP_KERNEL); + new_admin = kzalloc_obj(*new_admin, GFP_KERNEL); if (!new_admin) { NL_SET_ERR_MSG(extack, "Not enough memory for a new schedule"); return -ENOMEM; @@ -2091,8 +2091,7 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, return -EOPNOTSUPP; } - q->qdiscs = kcalloc(dev->num_tx_queues, sizeof(q->qdiscs[0]), - GFP_KERNEL); + q->qdiscs = kzalloc_objs(q->qdiscs[0], dev->num_tx_queues, GFP_KERNEL); if (!q->qdiscs) return -ENOMEM; diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 5793d71852b8..62d3cc155809 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -289,7 +289,7 @@ struct sctp_association *sctp_association_new(const struct sctp_endpoint *ep, { struct sctp_association *asoc; - asoc = kzalloc(sizeof(*asoc), gfp); + asoc = kzalloc_obj(*asoc, gfp); if (!asoc) goto fail; diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 82aad477590e..be9782760f50 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c @@ -82,7 +82,7 @@ struct sctp_shared_key *sctp_auth_shkey_create(__u16 key_id, gfp_t gfp) struct sctp_shared_key *new; /* Allocate the shared key container */ - new = kzalloc(sizeof(struct sctp_shared_key), gfp); + new = kzalloc_obj(struct sctp_shared_key, gfp); if (!new) return NULL; @@ -931,8 +931,8 @@ int sctp_auth_init(struct sctp_endpoint *ep, gfp_t gfp) if (!ep->auth_hmacs_list) { struct sctp_hmac_algo_param *auth_hmacs; - auth_hmacs = kzalloc(struct_size(auth_hmacs, hmac_ids, - SCTP_AUTH_NUM_HMACS), gfp); + auth_hmacs = kzalloc_flex(*auth_hmacs, hmac_ids, + SCTP_AUTH_NUM_HMACS, gfp); if (!auth_hmacs) goto nomem; /* Initialize the HMACS parameter. diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 6b95d3ba8fe1..75e3e61d494e 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c @@ -147,7 +147,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, struct sctp_sockaddr_entry *addr; /* Add the address to the bind address list. */ - addr = kzalloc(sizeof(*addr), gfp); + addr = kzalloc_obj(*addr, gfp); if (!addr) return -ENOMEM; diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index c655b571ca01..5b889e89e9f2 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c @@ -47,7 +47,7 @@ static void sctp_datamsg_init(struct sctp_datamsg *msg) static struct sctp_datamsg *sctp_datamsg_new(gfp_t gfp) { struct sctp_datamsg *msg; - msg = kmalloc(sizeof(struct sctp_datamsg), gfp); + msg = kmalloc_obj(struct sctp_datamsg, gfp); if (msg) { sctp_datamsg_init(msg); SCTP_DBG_OBJCNT_INC(datamsg); diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 31e989dfe846..8d342b514142 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c @@ -135,7 +135,7 @@ struct sctp_endpoint *sctp_endpoint_new(struct sock *sk, gfp_t gfp) struct sctp_endpoint *ep; /* Build a local endpoint. */ - ep = kzalloc(sizeof(*ep), gfp); + ep = kzalloc_obj(*ep, gfp); if (!ep) goto fail; diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 531cb0690007..53a5c027f8e3 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -83,7 +83,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, switch (ev) { case NETDEV_UP: - addr = kzalloc(sizeof(*addr), GFP_ATOMIC); + addr = kzalloc_obj(*addr, GFP_ATOMIC); if (addr) { addr->a.v6.sin6_family = AF_INET6; addr->a.v6.sin6_addr = ifa->addr; @@ -471,7 +471,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist, read_lock_bh(&in6_dev->lock); list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { /* Add the address to the local list. */ - addr = kzalloc(sizeof(*addr), GFP_ATOMIC); + addr = kzalloc_obj(*addr, GFP_ATOMIC); if (addr) { addr->a.v6.sin6_family = AF_INET6; addr->a.v6.sin6_addr = ifp->addr; diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 2c3398f75d76..0723cbdbc366 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -86,7 +86,7 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, in_dev_for_each_ifa_rcu(ifa, in_dev) { /* Add the address to the local list. */ - addr = kzalloc(sizeof(*addr), GFP_ATOMIC); + addr = kzalloc_obj(*addr, GFP_ATOMIC); if (addr) { addr->a.v4.sin_family = AF_INET; addr->a.v4.sin_addr.s_addr = ifa->ifa_local; @@ -774,7 +774,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, switch (ev) { case NETDEV_UP: - addr = kzalloc(sizeof(*addr), GFP_ATOMIC); + addr = kzalloc_obj(*addr, GFP_ATOMIC); if (addr) { addr->a.v4.sin_family = AF_INET; addr->a.v4.sin_addr.s_addr = ifa->ifa_local; @@ -1538,7 +1538,7 @@ static __init int sctp_init(void) /* Allocate and initialize the endpoint hash table. */ sctp_ep_hashsize = 64; sctp_ep_hashtable = - kmalloc_array(64, sizeof(struct sctp_hashbucket), GFP_KERNEL); + kmalloc_objs(struct sctp_hashbucket, 64, GFP_KERNEL); if (!sctp_ep_hashtable) { pr_err("Failed endpoint_hash alloc\n"); status = -ENOMEM; diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 2493a5b1fa3c..05fb00c9c335 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -828,7 +828,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk, if (asoc->asconf_addr_del_pending) continue; asoc->asconf_addr_del_pending = - kzalloc(sizeof(union sctp_addr), GFP_ATOMIC); + kzalloc_obj(union sctp_addr, GFP_ATOMIC); if (asoc->asconf_addr_del_pending == NULL) { retval = -ENOMEM; goto out; diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 0615e4426341..03636bed60ff 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -166,7 +166,7 @@ int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid) struct sctp_stream_out_ext *soute; int ret; - soute = kzalloc(sizeof(*soute), GFP_KERNEL); + soute = kzalloc_obj(*soute, GFP_KERNEL); if (!soute) return -ENOMEM; SCTP_SO(stream, sid)->ext = soute; diff --git a/net/sctp/stream_sched_prio.c b/net/sctp/stream_sched_prio.c index fb6c55e5615d..bd4f98db2822 100644 --- a/net/sctp/stream_sched_prio.c +++ b/net/sctp/stream_sched_prio.c @@ -42,7 +42,7 @@ static struct sctp_stream_priorities *sctp_sched_prio_new_head( { struct sctp_stream_priorities *p; - p = kmalloc(sizeof(*p), gfp); + p = kmalloc_obj(*p, gfp); if (!p) return NULL; diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 0c56d9673cc1..6ea55b9fbde4 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -92,7 +92,7 @@ struct sctp_transport *sctp_transport_new(struct net *net, { struct sctp_transport *transport; - transport = kzalloc(sizeof(*transport), gfp); + transport = kzalloc_obj(*transport, gfp); if (!transport) return NULL; diff --git a/net/shaper/shaper.c b/net/shaper/shaper.c index 7101a48bce54..ca7a6167702d 100644 --- a/net/shaper/shaper.c +++ b/net/shaper/shaper.c @@ -272,7 +272,7 @@ net_shaper_hierarchy_setup(struct net_shaper_binding *binding) if (hierarchy) return hierarchy; - hierarchy = kmalloc(sizeof(*hierarchy), GFP_KERNEL); + hierarchy = kmalloc_obj(*hierarchy, GFP_KERNEL); if (!hierarchy) return NULL; @@ -329,7 +329,7 @@ static int net_shaper_pre_insert(struct net_shaper_binding *binding, id_allocated = true; } - cur = kzalloc(sizeof(*cur), GFP_KERNEL); + cur = kzalloc_obj(*cur, GFP_KERNEL); if (!cur) { ret = -ENOMEM; goto free_id; @@ -1033,8 +1033,7 @@ static int net_shaper_pre_del_node(struct net_shaper_binding *binding, return -EINVAL; } - leaves = kcalloc(shaper->leaves, sizeof(struct net_shaper), - GFP_KERNEL); + leaves = kzalloc_objs(struct net_shaper, shaper->leaves, GFP_KERNEL); if (!leaves) return -ENOMEM; diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index d8201eb3ac5f..242101f269c3 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -1195,7 +1195,7 @@ void smc_fill_gid_list(struct smc_link_group *lgr, memset(gidlist, 0, sizeof(*gidlist)); memcpy(gidlist->list[gidlist->len++], known_gid, SMC_GID_SIZE); - alt_ini = kzalloc(sizeof(*alt_ini), GFP_KERNEL); + alt_ini = kzalloc_obj(*alt_ini, GFP_KERNEL); if (!alt_ini) goto out; @@ -1522,7 +1522,7 @@ static int __smc_connect(struct smc_sock *smc) return smc_connect_decline_fallback(smc, SMC_CLC_DECL_IPSEC, version); - ini = kzalloc(sizeof(*ini), GFP_KERNEL); + ini = kzalloc_obj(*ini, GFP_KERNEL); if (!ini) return smc_connect_decline_fallback(smc, SMC_CLC_DECL_MEM, version); @@ -2470,7 +2470,7 @@ static void smc_listen_work(struct work_struct *work) /* do inband token exchange - * wait for and receive SMC Proposal CLC message */ - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) { rc = SMC_CLC_DECL_MEM; goto out_decl; @@ -2490,7 +2490,7 @@ static void smc_listen_work(struct work_struct *work) goto out_decl; } - ini = kzalloc(sizeof(*ini), GFP_KERNEL); + ini = kzalloc_obj(*ini, GFP_KERNEL); if (!ini) { rc = SMC_CLC_DECL_MEM; goto out_decl; diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c index 87c87edadde7..992fd2b9f05f 100644 --- a/net/smc/smc_clc.c +++ b/net/smc/smc_clc.c @@ -88,7 +88,7 @@ static int smc_clc_ueid_add(char *ueid) return -EINVAL; /* add a new ueid entry to the ueid table if there isn't one */ - new_ueid = kzalloc(sizeof(*new_ueid), GFP_KERNEL); + new_ueid = kzalloc_obj(*new_ueid, GFP_KERNEL); if (!new_ueid) return -ENOMEM; memcpy(new_ueid->eid, ueid, SMC_MAX_EID_LEN); @@ -861,7 +861,7 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini) struct kvec vec[8]; struct msghdr msg; - pclc = kzalloc(sizeof(*pclc), GFP_KERNEL); + pclc = kzalloc_obj(*pclc, GFP_KERNEL); if (!pclc) return -ENOMEM; diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index e4eabc83719e..50d01a573042 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -905,7 +905,7 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini) } } - lgr = kzalloc(sizeof(*lgr), GFP_KERNEL); + lgr = kzalloc_obj(*lgr, GFP_KERNEL); if (!lgr) { rc = SMC_CLC_DECL_MEM; goto ism_put_vlan; @@ -2320,7 +2320,7 @@ static struct smc_buf_desc *smcr_new_buf_create(struct smc_link_group *lgr, struct smc_buf_desc *buf_desc; /* try to alloc a new buffer */ - buf_desc = kzalloc(sizeof(*buf_desc), GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); if (!buf_desc) return ERR_PTR(-ENOMEM); @@ -2394,7 +2394,7 @@ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr, int rc; /* try to alloc a new DMB */ - buf_desc = kzalloc(sizeof(*buf_desc), GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); if (!buf_desc) return ERR_PTR(-ENOMEM); if (is_dmb) { @@ -2578,7 +2578,7 @@ int smcd_buf_attach(struct smc_sock *smc) struct smc_buf_desc *buf_desc; int rc; - buf_desc = kzalloc(sizeof(*buf_desc), GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); if (!buf_desc) return -ENOMEM; diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index 1154907c5c05..5a1384126f91 100644 --- a/net/smc/smc_ib.c +++ b/net/smc/smc_ib.c @@ -944,7 +944,7 @@ static int smc_ib_add_dev(struct ib_device *ibdev) if (ibdev->node_type != RDMA_NODE_IB_CA) return -EOPNOTSUPP; - smcibdev = kzalloc(sizeof(*smcibdev), GFP_KERNEL); + smcibdev = kzalloc_obj(*smcibdev, GFP_KERNEL); if (!smcibdev) return -ENOMEM; diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index 7b228ca2f96a..4ee7362e91c5 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c @@ -142,7 +142,7 @@ int smc_ism_get_vlan(struct smcd_dev *smcd, unsigned short vlanid) return -EOPNOTSUPP; /* create new vlan entry, in case we need it */ - new_vlan = kzalloc(sizeof(*new_vlan), GFP_KERNEL); + new_vlan = kzalloc_obj(*new_vlan, GFP_KERNEL); if (!new_vlan) return -ENOMEM; new_vlan->vlanid = vlanid; @@ -467,11 +467,10 @@ static struct smcd_dev *smcd_alloc_dev(const char *name, int max_dmbs) { struct smcd_dev *smcd; - smcd = kzalloc(sizeof(*smcd), GFP_KERNEL); + smcd = kzalloc_obj(*smcd, GFP_KERNEL); if (!smcd) return NULL; - smcd->conn = kcalloc(max_dmbs, sizeof(struct smc_connection *), - GFP_KERNEL); + smcd->conn = kzalloc_objs(struct smc_connection *, max_dmbs, GFP_KERNEL); if (!smcd->conn) goto free_smcd; @@ -582,7 +581,7 @@ static void smcd_handle_event(struct dibs_dev *dibs, if (smcd->going_away) return; /* copy event to event work queue, and let it be handled there */ - wrk = kmalloc(sizeof(*wrk), GFP_ATOMIC); + wrk = kmalloc_obj(*wrk, GFP_ATOMIC); if (!wrk) return; INIT_WORK(&wrk->work, smc_ism_event_work); diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index f5d5eb617526..f82d5fc7f068 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c @@ -1040,7 +1040,7 @@ int smc_llc_cli_add_link(struct smc_link *link, struct smc_llc_qentry *qentry) if (!llc->qp_mtu) goto out_reject; - ini = kzalloc(sizeof(*ini), GFP_KERNEL); + ini = kzalloc_obj(*ini, GFP_KERNEL); if (!ini) { rc = -ENOMEM; goto out_reject; @@ -1180,7 +1180,7 @@ static void smc_llc_cli_add_link_invite(struct smc_link *link, if (lgr->type == SMC_LGR_SINGLE && lgr->max_links <= 1) goto out; - ini = kzalloc(sizeof(*ini), GFP_KERNEL); + ini = kzalloc_obj(*ini, GFP_KERNEL); if (!ini) goto out; @@ -1419,7 +1419,7 @@ int smc_llc_srv_add_link(struct smc_link *link, req_qentry->msg.raw.hdr.common.llc_type == SMC_LLC_REQ_ADD_LINK) send_req_add_link_resp = true; - ini = kzalloc(sizeof(*ini), GFP_KERNEL); + ini = kzalloc_obj(*ini, GFP_KERNEL); if (!ini) { rc = -ENOMEM; goto out; @@ -2069,7 +2069,7 @@ static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc) struct smc_llc_qentry *qentry; unsigned long flags; - qentry = kmalloc(sizeof(*qentry), GFP_ATOMIC); + qentry = kmalloc_obj(*qentry, GFP_ATOMIC); if (!qentry) return; qentry->link = link; diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index a3a1e1fde8eb..239da54ba01c 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c @@ -368,7 +368,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, /* add a new netdev entry to the pnet table if there isn't one */ rc = -ENOMEM; - new_pe = kzalloc(sizeof(*new_pe), GFP_KERNEL); + new_pe = kzalloc_obj(*new_pe, GFP_KERNEL); if (!new_pe) goto out_put; new_pe->type = SMC_PNET_ETH; @@ -445,7 +445,7 @@ static int smc_pnet_add_ib(struct smc_pnettable *pnettable, char *ib_name, return -EEXIST; /* add a new ib entry to the pnet table if there isn't one */ - new_pe = kzalloc(sizeof(*new_pe), GFP_KERNEL); + new_pe = kzalloc_obj(*new_pe, GFP_KERNEL); if (!new_pe) return -ENOMEM; new_pe->type = SMC_PNET_IB; @@ -747,7 +747,7 @@ static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid) struct smc_net *sn = net_generic(net, smc_net_id); struct smc_pnetids_ndev_entry *pe, *pi; - pe = kzalloc(sizeof(*pe), GFP_KERNEL); + pe = kzalloc_obj(*pe, GFP_KERNEL); if (!pe) return -ENOMEM; diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c index e7f1134453ef..bde9bc1ed4c0 100644 --- a/net/smc/smc_rx.c +++ b/net/smc/smc_rx.c @@ -161,17 +161,17 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len, nr_pages = !lgr->is_smcd && smc->conn.rmb_desc->is_vm ? PAGE_ALIGN(len + offset) / PAGE_SIZE : 1; - pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); if (!pages) goto out; - partial = kcalloc(nr_pages, sizeof(*partial), GFP_KERNEL); + partial = kzalloc_objs(*partial, nr_pages, GFP_KERNEL); if (!partial) goto out_page; - priv = kcalloc(nr_pages, sizeof(*priv), GFP_KERNEL); + priv = kzalloc_objs(*priv, nr_pages, GFP_KERNEL); if (!priv) goto out_part; for (i = 0; i < nr_pages; i++) { - priv[i] = kzalloc(sizeof(**priv), GFP_KERNEL); + priv[i] = kzalloc_obj(**priv, GFP_KERNEL); if (!priv[i]) goto out_priv; } diff --git a/net/smc/smc_stats.c b/net/smc/smc_stats.c index e71b17d1e21c..aeb462dbbb2c 100644 --- a/net/smc/smc_stats.c +++ b/net/smc/smc_stats.c @@ -20,7 +20,7 @@ int smc_stats_init(struct net *net) { - net->smc.fback_rsn = kzalloc(sizeof(*net->smc.fback_rsn), GFP_KERNEL); + net->smc.fback_rsn = kzalloc_obj(*net->smc.fback_rsn, GFP_KERNEL); if (!net->smc.fback_rsn) goto err_fback; net->smc.smc_stats = alloc_percpu(struct smc_stats); @@ -285,7 +285,7 @@ int smc_nl_get_stats(struct sk_buff *skb, attrs = nla_nest_start(skb, SMC_GEN_STATS); if (!attrs) goto errnest; - stats = kzalloc(sizeof(*stats), GFP_KERNEL); + stats = kzalloc_obj(*stats, GFP_KERNEL); if (!stats) goto erralloc; size = sizeof(*stats) / sizeof(u64); diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c index 5feafa98ab1a..bad014f353b3 100644 --- a/net/smc/smc_wr.c +++ b/net/smc/smc_wr.c @@ -749,27 +749,24 @@ int smc_wr_alloc_link_mem(struct smc_link *link) GFP_KERNEL); if (!link->wr_rx_bufs) goto no_mem_wr_tx_bufs; - link->wr_tx_ibs = kcalloc(link->max_send_wr, - sizeof(link->wr_tx_ibs[0]), GFP_KERNEL); + link->wr_tx_ibs = kzalloc_objs(link->wr_tx_ibs[0], link->max_send_wr, + GFP_KERNEL); if (!link->wr_tx_ibs) goto no_mem_wr_rx_bufs; - link->wr_rx_ibs = kcalloc(link->max_recv_wr, - sizeof(link->wr_rx_ibs[0]), - GFP_KERNEL); + link->wr_rx_ibs = kzalloc_objs(link->wr_rx_ibs[0], link->max_recv_wr, + GFP_KERNEL); if (!link->wr_rx_ibs) goto no_mem_wr_tx_ibs; - link->wr_tx_rdmas = kcalloc(link->max_send_wr, - sizeof(link->wr_tx_rdmas[0]), - GFP_KERNEL); + link->wr_tx_rdmas = kzalloc_objs(link->wr_tx_rdmas[0], + link->max_send_wr, GFP_KERNEL); if (!link->wr_tx_rdmas) goto no_mem_wr_rx_ibs; - link->wr_tx_rdma_sges = kcalloc(link->max_send_wr, - sizeof(link->wr_tx_rdma_sges[0]), - GFP_KERNEL); + link->wr_tx_rdma_sges = kzalloc_objs(link->wr_tx_rdma_sges[0], + link->max_send_wr, GFP_KERNEL); if (!link->wr_tx_rdma_sges) goto no_mem_wr_tx_rdmas; - link->wr_tx_sges = kcalloc(link->max_send_wr, sizeof(link->wr_tx_sges[0]), - GFP_KERNEL); + link->wr_tx_sges = kzalloc_objs(link->wr_tx_sges[0], link->max_send_wr, + GFP_KERNEL); if (!link->wr_tx_sges) goto no_mem_wr_tx_rdma_sges; link->wr_rx_sges = kcalloc(link->max_recv_wr, @@ -780,28 +777,25 @@ int smc_wr_alloc_link_mem(struct smc_link *link) link->wr_tx_mask = bitmap_zalloc(link->max_send_wr, GFP_KERNEL); if (!link->wr_tx_mask) goto no_mem_wr_rx_sges; - link->wr_tx_pends = kcalloc(link->max_send_wr, - sizeof(link->wr_tx_pends[0]), - GFP_KERNEL); + link->wr_tx_pends = kzalloc_objs(link->wr_tx_pends[0], + link->max_send_wr, GFP_KERNEL); if (!link->wr_tx_pends) goto no_mem_wr_tx_mask; - link->wr_tx_compl = kcalloc(link->max_send_wr, - sizeof(link->wr_tx_compl[0]), - GFP_KERNEL); + link->wr_tx_compl = kzalloc_objs(link->wr_tx_compl[0], + link->max_send_wr, GFP_KERNEL); if (!link->wr_tx_compl) goto no_mem_wr_tx_pends; if (link->lgr->smc_version == SMC_V2) { - link->wr_tx_v2_ib = kzalloc(sizeof(*link->wr_tx_v2_ib), - GFP_KERNEL); + link->wr_tx_v2_ib = kzalloc_obj(*link->wr_tx_v2_ib, GFP_KERNEL); if (!link->wr_tx_v2_ib) goto no_mem_tx_compl; - link->wr_tx_v2_sge = kzalloc(sizeof(*link->wr_tx_v2_sge), - GFP_KERNEL); + link->wr_tx_v2_sge = kzalloc_obj(*link->wr_tx_v2_sge, + GFP_KERNEL); if (!link->wr_tx_v2_sge) goto no_mem_v2_ib; - link->wr_tx_v2_pend = kzalloc(sizeof(*link->wr_tx_v2_pend), - GFP_KERNEL); + link->wr_tx_v2_pend = kzalloc_obj(*link->wr_tx_v2_pend, + GFP_KERNEL); if (!link->wr_tx_v2_pend) goto no_mem_v2_sge; } diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 5a827afd8e3b..fb33a4d0cdc7 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -290,12 +290,12 @@ rpcauth_init_credcache(struct rpc_auth *auth) struct rpc_cred_cache *new; unsigned int hashsize; - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) goto out_nocache; new->hashbits = auth_hashbits; hashsize = 1U << new->hashbits; - new->hashtable = kcalloc(hashsize, sizeof(new->hashtable[0]), GFP_KERNEL); + new->hashtable = kzalloc_objs(new->hashtable[0], hashsize, GFP_KERNEL); if (!new->hashtable) goto out_nohashtbl; spin_lock_init(&new->lock); diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index bb3c3db2713b..f8a0d6386635 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -164,7 +164,7 @@ gss_alloc_context(void) { struct gss_cl_ctx *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (ctx != NULL) { ctx->gc_proc = RPC_GSS_PROC_DATA; ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ @@ -529,7 +529,7 @@ gss_alloc_msg(struct gss_auth *gss_auth, int vers; int err = -ENOMEM; - gss_msg = kzalloc(sizeof(*gss_msg), GFP_KERNEL); + gss_msg = kzalloc_obj(*gss_msg, GFP_KERNEL); if (gss_msg == NULL) goto err; vers = get_pipe_version(gss_auth->net); @@ -914,7 +914,7 @@ static struct gss_pipe *gss_pipe_alloc(struct rpc_clnt *clnt, struct gss_pipe *p; int err = -ENOMEM; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc_obj(*p, GFP_KERNEL); if (p == NULL) goto err; p->pipe = rpc_mkpipe_data(upcall_ops, RPC_PIPE_WAIT_FOR_OPEN); @@ -1029,7 +1029,7 @@ gss_create_new(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) if (!try_module_get(THIS_MODULE)) return ERR_PTR(err); - if (!(gss_auth = kmalloc(sizeof(*gss_auth), GFP_KERNEL))) + if (!(gss_auth = kmalloc_obj(*gss_auth, GFP_KERNEL))) goto out_dec; INIT_HLIST_NODE(&gss_auth->hash); gss_auth->target_name = NULL; @@ -1246,7 +1246,7 @@ gss_dup_cred(struct gss_auth *gss_auth, struct gss_cred *gss_cred) struct gss_cred *new; /* Make a copy of the cred so that we can reference count it */ - new = kzalloc(sizeof(*gss_cred), GFP_KERNEL); + new = kzalloc_obj(*gss_cred, GFP_KERNEL); if (new) { struct auth_cred acred = { .cred = gss_cred->gc_base.cr_cred, @@ -1380,7 +1380,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags, gfp_t struct gss_cred *cred = NULL; int err = -ENOMEM; - if (!(cred = kzalloc(sizeof(*cred), gfp))) + if (!(cred = kzalloc_obj(*cred, gfp))) goto out_err; rpcauth_init_cred(&cred->gc_base, acred, auth, &gss_credops); @@ -1817,9 +1817,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) last = (snd_buf->page_base + snd_buf->page_len - 1) >> PAGE_SHIFT; rqstp->rq_enc_pages_num = last - first + 1 + 1; rqstp->rq_enc_pages - = kmalloc_array(rqstp->rq_enc_pages_num, - sizeof(struct page *), - GFP_KERNEL); + = kmalloc_objs(struct page *, rqstp->rq_enc_pages_num, + GFP_KERNEL); if (!rqstp->rq_enc_pages) goto out; for (i=0; i < rqstp->rq_enc_pages_num; i++) { diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index 3366505bc669..6db64a9111a9 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c @@ -473,7 +473,7 @@ gss_krb5_import_sec_context(const void *p, size_t len, struct gss_ctx *ctx_id, struct krb5_ctx *ctx; int ret; - ctx = kzalloc(sizeof(*ctx), gfp_mask); + ctx = kzalloc_obj(*ctx, gfp_mask); if (ctx == NULL) return -ENOMEM; diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index c84d0cf61980..78eab245f94a 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c @@ -355,7 +355,7 @@ gss_import_sec_context(const void *input_token, size_t bufsize, time64_t *endtime, gfp_t gfp_mask) { - if (!(*ctx_id = kzalloc(sizeof(**ctx_id), gfp_mask))) + if (!(*ctx_id = kzalloc_obj(**ctx_id, gfp_mask))) return -ENOMEM; (*ctx_id)->mech_type = gss_mech_get(mech); diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c index f549e4c05def..e02e6d4a3185 100644 --- a/net/sunrpc/auth_gss/gss_rpc_upcall.c +++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c @@ -214,7 +214,7 @@ static int gssp_alloc_receive_pages(struct gssx_arg_accept_sec_context *arg) unsigned int i; arg->npages = DIV_ROUND_UP(NGROUPS_MAX * 4, PAGE_SIZE); - arg->pages = kcalloc(arg->npages, sizeof(struct page *), GFP_KERNEL); + arg->pages = kzalloc_objs(struct page *, arg->npages, GFP_KERNEL); if (!arg->pages) return -ENOMEM; for (i = 0; i < arg->npages; i++) { diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c index f320c0a8e604..e1e01965ef58 100644 --- a/net/sunrpc/auth_gss/gss_rpc_xdr.c +++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c @@ -244,11 +244,11 @@ static int gssx_dec_option_array(struct xdr_stream *xdr, /* we recognize only 1 currently: CREDS_VALUE */ oa->count = 1; - oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); + oa->data = kmalloc_obj(struct gssx_option, GFP_KERNEL); if (!oa->data) return -ENOMEM; - creds = kzalloc(sizeof(struct svc_cred), GFP_KERNEL); + creds = kzalloc_obj(struct svc_cred, GFP_KERNEL); if (!creds) { err = -ENOMEM; goto free_oa; diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index e2f0df8cdaa6..411297c9527d 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -197,7 +197,7 @@ static void update_rsi(struct cache_head *cnew, struct cache_head *citem) static struct cache_head *rsi_alloc(void) { - struct rsi *rsii = kmalloc(sizeof(*rsii), GFP_KERNEL); + struct rsi *rsii = kmalloc_obj(*rsii, GFP_KERNEL); if (rsii) return &rsii->h; else @@ -449,7 +449,7 @@ update_rsc(struct cache_head *cnew, struct cache_head *ctmp) static struct cache_head * rsc_alloc(void) { - struct rsc *rsci = kmalloc(sizeof(*rsci), GFP_KERNEL); + struct rsc *rsci = kmalloc_obj(*rsci, GFP_KERNEL); if (rsci) return &rsci->h; else @@ -814,7 +814,7 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) struct auth_domain *test; int stat = -ENOMEM; - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (!new) goto out; kref_init(&new->h.ref); @@ -1069,7 +1069,7 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp, goto out_denied_free; pages = DIV_ROUND_UP(inlen, PAGE_SIZE); - in_token->pages = kcalloc(pages + 1, sizeof(struct page *), GFP_KERNEL); + in_token->pages = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); if (!in_token->pages) goto out_denied_free; in_token->page_base = 0; @@ -1631,7 +1631,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp) rqstp->rq_auth_stat = rpc_autherr_failed; if (!svcdata) - svcdata = kmalloc(sizeof(*svcdata), GFP_KERNEL); + svcdata = kmalloc_obj(*svcdata, GFP_KERNEL); if (!svcdata) goto auth_err; rqstp->rq_auth_data = svcdata; diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 1e091d3fa607..6c742a3400c4 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c @@ -45,7 +45,7 @@ static struct rpc_cred *unx_lookup_cred(struct rpc_auth *auth, { struct rpc_cred *ret; - ret = kmalloc(sizeof(*ret), rpc_task_gfp_mask()); + ret = kmalloc_obj(*ret, rpc_task_gfp_mask()); if (!ret) { if (!(flags & RPCAUTH_LOOKUP_ASYNC)) return ERR_PTR(-ENOMEM); diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index 6b9dee4119d5..0ffa4d01a938 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c @@ -94,7 +94,7 @@ static struct rpc_rqst *xprt_alloc_bc_req(struct rpc_xprt *xprt) struct rpc_rqst *req; /* Pre-allocate one backchannel rpc_rqst */ - req = kzalloc(sizeof(*req), gfp_flags); + req = kzalloc_obj(*req, gfp_flags); if (req == NULL) return NULL; diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index d808c0b63f30..5129f3dace8c 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1038,7 +1038,7 @@ static int cache_open(struct inode *inode, struct file *filp, return -EACCES; nonseekable_open(inode, filp); if (filp->f_mode & FMODE_READ) { - rp = kmalloc(sizeof(*rp), GFP_KERNEL); + rp = kmalloc_obj(*rp, GFP_KERNEL); if (!rp) { module_put(cd->owner); return -ENOMEM; @@ -1225,7 +1225,7 @@ static int cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) if (!buf) return -EAGAIN; - crq = kmalloc(sizeof (*crq), GFP_KERNEL); + crq = kmalloc_obj(*crq, GFP_KERNEL); if (!crq) { kfree(buf); return -EAGAIN; @@ -1745,8 +1745,8 @@ struct cache_detail *cache_create_net(const struct cache_detail *tmpl, struct ne if (cd == NULL) return ERR_PTR(-ENOMEM); - cd->hash_table = kcalloc(cd->hash_size, sizeof(struct hlist_head), - GFP_KERNEL); + cd->hash_table = kzalloc_objs(struct hlist_head, cd->hash_size, + GFP_KERNEL); if (cd->hash_table == NULL) { kfree(cd); return ERR_PTR(-ENOMEM); diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 58442ae1c2da..f6e086b62053 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -374,7 +374,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, goto out_err; err = -ENOMEM; - clnt = kzalloc(sizeof(*clnt), GFP_KERNEL); + clnt = kzalloc_obj(*clnt, GFP_KERNEL); if (!clnt) goto out_err; clnt->cl_parent = parent ? : clnt; @@ -2976,7 +2976,7 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, return -EINVAL; } - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; data->xps = xprt_switch_get(xps); diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 379daefc4847..a4b3c51be0f3 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -511,7 +511,7 @@ struct rpc_pipe *rpc_mkpipe_data(const struct rpc_pipe_ops *ops, int flags) { struct rpc_pipe *pipe; - pipe = kzalloc(sizeof(struct rpc_pipe), GFP_KERNEL); + pipe = kzalloc_obj(struct rpc_pipe, GFP_KERNEL); if (!pipe) return ERR_PTR(-ENOMEM); init_pipe(pipe); diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 53bcca365fb1..6aa372188c86 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -737,7 +737,7 @@ void rpcb_getport_async(struct rpc_task *task) goto bailout_nofree; } - map = kzalloc(sizeof(struct rpcbind_args), rpc_task_gfp_mask()); + map = kzalloc_obj(struct rpcbind_args, rpc_task_gfp_mask()); if (!map) { status = -ENOMEM; goto bailout_release_client; diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 383860cb1d5b..36308711e0e9 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -126,7 +126,7 @@ struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) struct rpc_iostats *stats; int i; - stats = kcalloc(clnt->cl_maxproc, sizeof(*stats), GFP_KERNEL); + stats = kzalloc_objs(*stats, clnt->cl_maxproc, GFP_KERNEL); if (stats) { for (i = 0; i < clnt->cl_maxproc; i++) spin_lock_init(&stats[i].om_lock); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 346ac560dcc2..bc160368a7dc 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -488,7 +488,7 @@ __svc_create(struct svc_program *prog, int nprogs, struct svc_stat *stats, unsigned int xdrsize; unsigned int i; - if (!(serv = kzalloc(sizeof(*serv), GFP_KERNEL))) + if (!(serv = kzalloc_obj(*serv, GFP_KERNEL))) return NULL; serv->sv_name = prog->pg_name; serv->sv_programs = prog; @@ -523,8 +523,7 @@ __svc_create(struct svc_program *prog, int nprogs, struct svc_stat *stats, serv->sv_nrpools = npools; serv->sv_pools = - kcalloc(serv->sv_nrpools, sizeof(struct svc_pool), - GFP_KERNEL); + kzalloc_objs(struct svc_pool, serv->sv_nrpools, GFP_KERNEL); if (!serv->sv_pools) { kfree(serv); return NULL; diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 8ca98b146ec8..7f952d9201f5 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -72,7 +72,7 @@ struct auth_domain *unix_domain_find(char *name) return rv; } - new = kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc_obj(*new, GFP_KERNEL); if (new == NULL) return NULL; kref_init(&new->h.ref); @@ -143,7 +143,7 @@ static void update(struct cache_head *cnew, struct cache_head *citem) } static struct cache_head *ip_map_alloc(void) { - struct ip_map *i = kmalloc(sizeof(*i), GFP_KERNEL); + struct ip_map *i = kmalloc_obj(*i, GFP_KERNEL); if (i) return &i->h; else @@ -458,7 +458,7 @@ static void unix_gid_update(struct cache_head *cnew, struct cache_head *citem) } static struct cache_head *unix_gid_alloc(void) { - struct unix_gid *g = kmalloc(sizeof(*g), GFP_KERNEL); + struct unix_gid *g = kmalloc_obj(*g, GFP_KERNEL); if (g) return &g->h; else diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index d61cd9b40491..e1576c807e07 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1436,12 +1436,13 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv, return ERR_PTR(sendpages); pages = svc_serv_maxpages(serv); - svsk = kzalloc(struct_size(svsk, sk_pages, pages), GFP_KERNEL); + svsk = kzalloc_flex(*svsk, sk_pages, pages, GFP_KERNEL); if (!svsk) return ERR_PTR(-ENOMEM); if (sendpages) { - svsk->sk_bvec = kcalloc(sendpages, sizeof(*svsk->sk_bvec), GFP_KERNEL); + svsk->sk_bvec = kzalloc_objs(*svsk->sk_bvec, sendpages, + GFP_KERNEL); if (!svsk->sk_bvec) { kfree(svsk); return ERR_PTR(-ENOMEM); diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index 8b01b7ae2690..ec6ddfa11f86 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -48,7 +48,7 @@ static struct kobject *rpc_sysfs_object_alloc(const char *name, { struct kobject *kobj; - kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + kobj = kzalloc_obj(*kobj, GFP_KERNEL); if (kobj) { kobj->kset = kset; if (kobject_init_and_add(kobj, &rpc_sysfs_object_type, @@ -397,7 +397,7 @@ static ssize_t rpc_sysfs_xprt_dstaddr_store(struct kobject *kobj, dst_addr = kstrndup(buf, buf_len, GFP_KERNEL); if (!dst_addr) goto out_err; - saved_addr = kzalloc(sizeof(*saved_addr), GFP_KERNEL); + saved_addr = kzalloc_obj(*saved_addr, GFP_KERNEL); if (!saved_addr) goto out_err_free; saved_addr->addr = @@ -663,7 +663,7 @@ static struct rpc_sysfs_client *rpc_sysfs_client_alloc(struct kobject *parent, { struct rpc_sysfs_client *p; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (p) { p->net = net; p->kobject.kset = rpc_sunrpc_kset; @@ -683,7 +683,7 @@ rpc_sysfs_xprt_switch_alloc(struct kobject *parent, { struct rpc_sysfs_xprt_switch *p; - p = kzalloc(sizeof(*p), gfp_flags); + p = kzalloc_obj(*p, gfp_flags); if (p) { p->net = net; p->kobject.kset = rpc_sunrpc_kset; @@ -703,7 +703,7 @@ static struct rpc_sysfs_xprt *rpc_sysfs_xprt_alloc(struct kobject *parent, { struct rpc_sysfs_xprt *p; - p = kzalloc(sizeof(*p), gfp_flags); + p = kzalloc_obj(*p, gfp_flags); if (!p) goto out; p->kobject.kset = rpc_sunrpc_kset; diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 70efc727a9cd..e83d5d0be78b 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -118,7 +118,7 @@ xdr_alloc_bvec(struct xdr_buf *buf, gfp_t gfp) size_t i, n = xdr_buf_pagecount(buf); if (n != 0 && buf->bvec == NULL) { - buf->bvec = kmalloc_array(n, sizeof(buf->bvec[0]), gfp); + buf->bvec = kmalloc_objs(buf->bvec[0], n, gfp); if (!buf->bvec) return -ENOMEM; for (i = 0; i < n; i++) { diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 1023361845f9..16f6989a0a2d 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1709,7 +1709,7 @@ static struct rpc_rqst *xprt_dynamic_alloc_slot(struct rpc_xprt *xprt) goto out; ++xprt->num_reqs; spin_unlock(&xprt->reserve_lock); - req = kzalloc(sizeof(*req), rpc_task_gfp_mask()); + req = kzalloc_obj(*req, rpc_task_gfp_mask()); spin_lock(&xprt->reserve_lock); if (req != NULL) goto out; @@ -1829,7 +1829,7 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size, xprt_init(xprt, net); for (i = 0; i < num_prealloc; i++) { - req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL); + req = kzalloc_obj(struct rpc_rqst, GFP_KERNEL); if (!req) goto out_free; list_add(&req->rq_list, &xprt->free); diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c index 4c5e08b0aa64..3ba818d637be 100644 --- a/net/sunrpc/xprtmultipath.c +++ b/net/sunrpc/xprtmultipath.c @@ -150,7 +150,7 @@ struct rpc_xprt_switch *xprt_switch_alloc(struct rpc_xprt *xprt, { struct rpc_xprt_switch *xps; - xps = kmalloc(sizeof(*xps), gfp_flags); + xps = kmalloc_obj(*xps, gfp_flags); if (xps != NULL) { spin_lock_init(&xps->xps_lock); kref_init(&xps->xps_kref); diff --git a/net/sunrpc/xprtrdma/ib_client.c b/net/sunrpc/xprtrdma/ib_client.c index 28c68b5f6823..e5b6dfaf01aa 100644 --- a/net/sunrpc/xprtrdma/ib_client.c +++ b/net/sunrpc/xprtrdma/ib_client.c @@ -108,7 +108,7 @@ static int rpcrdma_add_one(struct ib_device *device) { struct rpcrdma_device *rd; - rd = kzalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc_obj(*rd, GFP_KERNEL); if (!rd) return -ENOMEM; diff --git a/net/sunrpc/xprtrdma/svc_rdma_pcl.c b/net/sunrpc/xprtrdma/svc_rdma_pcl.c index b63cfeaa2923..b7c09a1f1c62 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_pcl.c +++ b/net/sunrpc/xprtrdma/svc_rdma_pcl.c @@ -29,7 +29,7 @@ static struct svc_rdma_chunk *pcl_alloc_chunk(u32 segcount, u32 position) { struct svc_rdma_chunk *chunk; - chunk = kmalloc(struct_size(chunk, ch_segments, segcount), GFP_KERNEL); + chunk = kmalloc_flex(*chunk, ch_segments, segcount, GFP_KERNEL); if (!chunk) return NULL; diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 63262ef0c2e3..15bbf953dfad 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -383,7 +383,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) struct rpcrdma_ep *ep; int rc; - ep = kzalloc(sizeof(*ep), XPRTRDMA_GFP_FLAGS); + ep = kzalloc_obj(*ep, XPRTRDMA_GFP_FLAGS); if (!ep) return -ENOTCONN; ep->re_xprt = &r_xprt->rx_xprt; @@ -615,8 +615,8 @@ static struct rpcrdma_sendctx *rpcrdma_sendctx_create(struct rpcrdma_ep *ep) { struct rpcrdma_sendctx *sc; - sc = kzalloc(struct_size(sc, sc_sges, ep->re_attr.cap.max_send_sge), - XPRTRDMA_GFP_FLAGS); + sc = kzalloc_flex(*sc, sc_sges, ep->re_attr.cap.max_send_sge, + XPRTRDMA_GFP_FLAGS); if (!sc) return NULL; @@ -639,7 +639,7 @@ static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt) * Sends are posted. */ i = r_xprt->rx_ep->re_max_requests + RPCRDMA_MAX_BC_REQUESTS; - buf->rb_sc_ctxs = kcalloc(i, sizeof(sc), XPRTRDMA_GFP_FLAGS); + buf->rb_sc_ctxs = kzalloc_objs(sc, i, XPRTRDMA_GFP_FLAGS); if (!buf->rb_sc_ctxs) return -ENOMEM; @@ -822,7 +822,7 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt, struct rpcrdma_buffer *buffer = &r_xprt->rx_buf; struct rpcrdma_req *req; - req = kzalloc(sizeof(*req), XPRTRDMA_GFP_FLAGS); + req = kzalloc_obj(*req, XPRTRDMA_GFP_FLAGS); if (req == NULL) goto out1; @@ -952,7 +952,7 @@ struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt) struct ib_device *device = ep->re_id->device; struct rpcrdma_rep *rep; - rep = kzalloc(sizeof(*rep), XPRTRDMA_GFP_FLAGS); + rep = kzalloc_obj(*rep, XPRTRDMA_GFP_FLAGS); if (rep == NULL) goto out; diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 4d5fbacef496..b55df183e6d5 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -114,7 +114,7 @@ static int switchdev_deferred_enqueue(struct net_device *dev, { struct switchdev_deferred_item *dfitem; - dfitem = kmalloc(struct_size(dfitem, data, data_len), GFP_ATOMIC); + dfitem = kmalloc_flex(*dfitem, data, data_len, GFP_ATOMIC); if (!dfitem) return -ENOMEM; dfitem->dev = dev; diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 114fef65f92e..c7c7f08eee9a 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -692,7 +692,7 @@ int tipc_bcast_init(struct net *net) struct tipc_bc_base *bb = NULL; struct tipc_link *l = NULL; - bb = kzalloc(sizeof(*bb), GFP_KERNEL); + bb = kzalloc_obj(*bb, GFP_KERNEL); if (!bb) goto enomem; tn->bcbase = bb; diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index ae1ddbf71853..a3bd1ef17558 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -322,7 +322,7 @@ static int tipc_enable_bearer(struct net *net, const char *name, goto rejected; } - b = kzalloc(sizeof(*b), GFP_ATOMIC); + b = kzalloc_obj(*b, GFP_ATOMIC); if (!b) return -ENOMEM; diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index a3f9ca28c3d5..abd191a3ac4a 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -524,7 +524,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey, return -EEXIST; /* Allocate a new AEAD */ - tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); + tmp = kzalloc_obj(*tmp, GFP_ATOMIC); if (unlikely(!tmp)) return -ENOMEM; @@ -560,7 +560,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey, break; } - tfm_entry = kmalloc(sizeof(*tfm_entry), GFP_KERNEL); + tfm_entry = kmalloc_obj(*tfm_entry, GFP_KERNEL); if (unlikely(!tfm_entry)) { crypto_free_aead(tfm); err = -ENOMEM; @@ -637,7 +637,7 @@ static int tipc_aead_clone(struct tipc_aead **dst, struct tipc_aead *src) if (unlikely(*dst)) return -EEXIST; - aead = kzalloc(sizeof(*aead), GFP_ATOMIC); + aead = kzalloc_obj(*aead, GFP_ATOMIC); if (unlikely(!aead)) return -ENOMEM; @@ -1472,7 +1472,7 @@ int tipc_crypto_start(struct tipc_crypto **crypto, struct net *net, return -EEXIST; /* Allocate crypto */ - c = kzalloc(sizeof(*c), GFP_ATOMIC); + c = kzalloc_obj(*c, GFP_ATOMIC); if (!c) return -ENOMEM; diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 775fd4f3f072..3e54d2df5683 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -353,7 +353,7 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b, struct tipc_net *tn = tipc_net(net); struct tipc_discoverer *d; - d = kmalloc(sizeof(*d), GFP_ATOMIC); + d = kmalloc_obj(*d, GFP_ATOMIC); if (!d) return -ENOMEM; d->skb = tipc_buf_acquire(MAX_H_SIZE + NODE_ID_LEN, GFP_ATOMIC); diff --git a/net/tipc/group.c b/net/tipc/group.c index 3e137d8c9d2f..e0e6227b433b 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c @@ -169,7 +169,7 @@ struct tipc_group *tipc_group_create(struct net *net, u32 portid, struct tipc_group *grp; u32 type = mreq->type; - grp = kzalloc(sizeof(*grp), GFP_ATOMIC); + grp = kzalloc_obj(*grp, GFP_ATOMIC); if (!grp) return NULL; tipc_nlist_init(&grp->dests, tipc_own_addr(net)); @@ -306,7 +306,7 @@ static struct tipc_member *tipc_group_create_member(struct tipc_group *grp, struct tipc_member *m; int ret; - m = kzalloc(sizeof(*m), GFP_ATOMIC); + m = kzalloc_obj(*m, GFP_ATOMIC); if (!m) return NULL; INIT_LIST_HEAD(&m->list); diff --git a/net/tipc/link.c b/net/tipc/link.c index 931f55f781a1..49dfc098d89b 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -487,7 +487,7 @@ bool tipc_link_create(struct net *net, char *if_name, int bearer_id, char self_str[NODE_ID_STR_LEN] = {0,}; struct tipc_link *l; - l = kzalloc(sizeof(*l), GFP_ATOMIC); + l = kzalloc_obj(*l, GFP_ATOMIC); if (!l) return false; *link = l; diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 572b79bf76ce..a94b9b36a700 100644 --- a/net/tipc/monitor.c +++ b/net/tipc/monitor.c @@ -393,7 +393,7 @@ static bool tipc_mon_add_peer(struct tipc_monitor *mon, u32 addr, struct tipc_peer *self = mon->self; struct tipc_peer *cur, *prev, *p; - p = kzalloc(sizeof(*p), GFP_ATOMIC); + p = kzalloc_obj(*p, GFP_ATOMIC); *peer = p; if (!p) return false; @@ -654,9 +654,9 @@ int tipc_mon_create(struct net *net, int bearer_id) if (tn->monitors[bearer_id]) return 0; - mon = kzalloc(sizeof(*mon), GFP_ATOMIC); - self = kzalloc(sizeof(*self), GFP_ATOMIC); - dom = kzalloc(sizeof(*dom), GFP_ATOMIC); + mon = kzalloc_obj(*mon, GFP_ATOMIC); + self = kzalloc_obj(*self, GFP_ATOMIC); + dom = kzalloc_obj(*dom, GFP_ATOMIC); if (!mon || !self || !dom) { kfree(mon); kfree(self); diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index e74940eab3a4..ec0ac85ca70b 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -230,7 +230,7 @@ static struct publication *tipc_publ_create(struct tipc_uaddr *ua, struct tipc_socket_addr *sk, u32 key) { - struct publication *p = kzalloc(sizeof(*p), GFP_ATOMIC); + struct publication *p = kzalloc_obj(*p, GFP_ATOMIC); if (!p) return NULL; @@ -261,7 +261,7 @@ static struct tipc_service *tipc_service_create(struct net *net, struct tipc_service *service; struct hlist_head *hd; - service = kzalloc(sizeof(*service), GFP_ATOMIC); + service = kzalloc_obj(*service, GFP_ATOMIC); if (!service) { pr_warn("Service creation failed, no memory\n"); return NULL; @@ -314,7 +314,7 @@ static struct service_range *tipc_service_create_range(struct tipc_service *sc, else n = &parent->rb_right; } - sr = kzalloc(sizeof(*sr), GFP_ATOMIC); + sr = kzalloc_obj(*sr, GFP_ATOMIC); if (!sr) return NULL; sr->lower = lower; @@ -888,7 +888,7 @@ int tipc_nametbl_init(struct net *net) struct name_table *nt; int i; - nt = kzalloc(sizeof(*nt), GFP_KERNEL); + nt = kzalloc_obj(*nt, GFP_KERNEL); if (!nt) return -ENOMEM; @@ -1156,7 +1156,7 @@ bool tipc_dest_push(struct list_head *l, u32 node, u32 port) if (tipc_dest_find(l, node, port)) return false; - dst = kmalloc(sizeof(*dst), GFP_ATOMIC); + dst = kmalloc_obj(*dst, GFP_ATOMIC); if (unlikely(!dst)) return false; dst->node = node; diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 079aebb16ed8..f64f03ab4933 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -202,8 +202,8 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, return -ENOMEM; } - attrbuf = kcalloc(tipc_genl_family.maxattr + 1, - sizeof(struct nlattr *), GFP_KERNEL); + attrbuf = kzalloc_objs(struct nlattr *, tipc_genl_family.maxattr + 1, + GFP_KERNEL); if (!attrbuf) { err = -ENOMEM; goto err_out; @@ -338,9 +338,8 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, if (!trans_buf) return -ENOMEM; - attrbuf = kmalloc_array(tipc_genl_family.maxattr + 1, - sizeof(struct nlattr *), - GFP_KERNEL); + attrbuf = kmalloc_objs(struct nlattr *, tipc_genl_family.maxattr + 1, + GFP_KERNEL); if (!attrbuf) { err = -ENOMEM; goto trans_out; diff --git a/net/tipc/node.c b/net/tipc/node.c index a07fb073368c..af442a5ef8f3 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -535,7 +535,7 @@ update: goto exit; } - n = kzalloc(sizeof(*n), GFP_ATOMIC); + n = kzalloc_obj(*n, GFP_ATOMIC); if (!n) { pr_warn("Node creation failed, no memory\n"); goto exit; @@ -703,7 +703,7 @@ int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port) pr_warn("Connecting sock to node 0x%x failed\n", dnode); return -EHOSTUNREACH; } - conn = kmalloc(sizeof(*conn), GFP_ATOMIC); + conn = kmalloc_obj(*conn, GFP_ATOMIC); if (!conn) { err = -EHOSTUNREACH; goto exit; diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 817b07d95a91..d52f700b5493 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -3595,7 +3595,7 @@ int __tipc_dump_start(struct netlink_callback *cb, struct net *net) struct tipc_net *tn = tipc_net(net); if (!iter) { - iter = kmalloc(sizeof(*iter), GFP_KERNEL); + iter = kmalloc_obj(*iter, GFP_KERNEL); if (!iter) return -ENOMEM; diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index f8490d94e323..352d304c3acd 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c @@ -143,7 +143,7 @@ struct tipc_subscription *tipc_sub_subscribe(struct net *net, pr_warn("Subscription rejected, illegal request\n"); return NULL; } - sub = kmalloc(sizeof(*sub), GFP_ATOMIC); + sub = kmalloc_obj(*sub, GFP_ATOMIC); if (!sub) { pr_warn("Subscription rejected, no memory\n"); return NULL; diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index aad7f96b6009..af530c9ed840 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c @@ -182,7 +182,7 @@ static struct tipc_conn *tipc_conn_alloc(struct tipc_topsrv *s, struct socket *s struct tipc_conn *con; int ret; - con = kzalloc(sizeof(*con), GFP_ATOMIC); + con = kzalloc_obj(*con, GFP_ATOMIC); if (!con) return ERR_PTR(-ENOMEM); @@ -325,7 +325,7 @@ void tipc_topsrv_queue_evt(struct net *net, int conid, if (!connected(con)) goto err; - e = kmalloc(sizeof(*e), GFP_ATOMIC); + e = kmalloc_obj(*e, GFP_ATOMIC); if (!e) goto err; e->inactive = (event == TIPC_SUBSCR_TIMEOUT); @@ -661,7 +661,7 @@ static int tipc_topsrv_start(struct net *net) struct tipc_topsrv *srv; int ret; - srv = kzalloc(sizeof(*srv), GFP_ATOMIC); + srv = kzalloc_obj(*srv, GFP_ATOMIC); if (!srv) return -ENOMEM; diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index b85ab0fb3b8c..2b8e385d1e51 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -309,7 +309,7 @@ static int tipc_udp_rcast_add(struct tipc_bearer *b, if (!ub) return -ENODEV; - rcast = kmalloc(sizeof(*rcast), GFP_ATOMIC); + rcast = kmalloc_obj(*rcast, GFP_ATOMIC); if (!rcast) return -ENOMEM; @@ -675,7 +675,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, struct net_device *dev; int rmcast = 0; - ub = kzalloc(sizeof(*ub), GFP_ATOMIC); + ub = kzalloc_obj(*ub, GFP_ATOMIC); if (!ub) return -ENOMEM; diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 82ea407e520a..7a85ef064e4c 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -346,7 +346,7 @@ static int tls_create_new_record(struct tls_offload_context_tx *offload_ctx, struct tls_record_info *record; skb_frag_t *frag; - record = kmalloc(sizeof(*record), GFP_KERNEL); + record = kmalloc_obj(*record, GFP_KERNEL); if (!record) return -ENOMEM; @@ -1040,7 +1040,7 @@ static struct tls_offload_context_tx *alloc_offload_ctx_tx(struct tls_context *c struct tls_offload_context_tx *offload_ctx; __be64 rcd_sn; - offload_ctx = kzalloc(sizeof(*offload_ctx), GFP_KERNEL); + offload_ctx = kzalloc_obj(*offload_ctx, GFP_KERNEL); if (!offload_ctx) return NULL; @@ -1110,7 +1110,7 @@ int tls_set_device_offload(struct sock *sk) memcpy(ctx->tx.iv + cipher_desc->salt, iv, cipher_desc->iv); memcpy(ctx->tx.rec_seq, rec_seq, cipher_desc->rec_seq); - start_marker_record = kmalloc(sizeof(*start_marker_record), GFP_KERNEL); + start_marker_record = kmalloc_obj(*start_marker_record, GFP_KERNEL); if (!start_marker_record) { rc = -ENOMEM; goto release_netdev; @@ -1224,7 +1224,7 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) goto release_lock; } - context = kzalloc(sizeof(*context), GFP_KERNEL); + context = kzalloc_obj(*context, GFP_KERNEL); if (!context) { rc = -ENOMEM; goto release_lock; diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c index 03d508a45aae..d3c72f509baa 100644 --- a/net/tls/tls_device_fallback.c +++ b/net/tls/tls_device_fallback.c @@ -383,7 +383,7 @@ static struct sk_buff *tls_sw_fallback(struct sock *sk, struct sk_buff *skb) if (!payload_len) return skb; - sg_in = kmalloc_array(sg_in_max_elements, sizeof(*sg_in), GFP_ATOMIC); + sg_in = kmalloc_objs(*sg_in, sg_in_max_elements, GFP_ATOMIC); if (!sg_in) goto free_orig; diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 56ce0bc8317b..fd39acf41a61 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -915,7 +915,7 @@ struct tls_context *tls_ctx_create(struct sock *sk) struct inet_connection_sock *icsk = inet_csk(sk); struct tls_context *ctx; - ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC); + ctx = kzalloc_obj(*ctx, GFP_ATOMIC); if (!ctx) return NULL; diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 9937d4c810f2..36bacedd6177 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2698,7 +2698,7 @@ static struct tls_sw_context_tx *init_ctx_tx(struct tls_context *ctx, struct soc struct tls_sw_context_tx *sw_ctx_tx; if (!ctx->priv_ctx_tx) { - sw_ctx_tx = kzalloc(sizeof(*sw_ctx_tx), GFP_KERNEL); + sw_ctx_tx = kzalloc_obj(*sw_ctx_tx, GFP_KERNEL); if (!sw_ctx_tx) return NULL; } else { @@ -2719,7 +2719,7 @@ static struct tls_sw_context_rx *init_ctx_rx(struct tls_context *ctx) struct tls_sw_context_rx *sw_ctx_rx; if (!ctx->priv_ctx_rx) { - sw_ctx_rx = kzalloc(sizeof(*sw_ctx_rx), GFP_KERNEL); + sw_ctx_rx = kzalloc_obj(*sw_ctx_rx, GFP_KERNEL); if (!sw_ctx_rx) return NULL; } else { diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index f6d56e70c7a2..1c4d298a9eb3 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -3798,14 +3798,13 @@ static int __net_init unix_net_init(struct net *net) goto err_sysctl; #endif - net->unx.table.locks = kvmalloc_array(UNIX_HASH_SIZE, - sizeof(spinlock_t), GFP_KERNEL); + net->unx.table.locks = kvmalloc_objs(spinlock_t, UNIX_HASH_SIZE, + GFP_KERNEL); if (!net->unx.table.locks) goto err_proc; - net->unx.table.buckets = kvmalloc_array(UNIX_HASH_SIZE, - sizeof(struct hlist_head), - GFP_KERNEL); + net->unx.table.buckets = kvmalloc_objs(struct hlist_head, + UNIX_HASH_SIZE, GFP_KERNEL); if (!net->unx.table.buckets) goto free_locks; diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 25f65817faab..a15e7eb50851 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -288,15 +288,15 @@ int unix_prepare_fpl(struct scm_fp_list *fpl) return 0; for (i = 0; i < fpl->count_unix; i++) { - vertex = kmalloc(sizeof(*vertex), GFP_KERNEL); + vertex = kmalloc_obj(*vertex, GFP_KERNEL); if (!vertex) goto err; list_add(&vertex->entry, &fpl->vertices); } - fpl->edges = kvmalloc_array(fpl->count_unix, sizeof(*fpl->edges), - GFP_KERNEL_ACCOUNT); + fpl->edges = kvmalloc_objs(*fpl->edges, fpl->count_unix, + GFP_KERNEL_ACCOUNT); if (!fpl->edges) goto err; diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c index c3010c874308..b1bf64b5cc97 100644 --- a/net/vmw_vsock/hyperv_transport.c +++ b/net/vmw_vsock/hyperv_transport.c @@ -444,7 +444,7 @@ static int hvs_sock_init(struct vsock_sock *vsk, struct vsock_sock *psk) struct hvsock *hvs; struct sock *sk = sk_vsock(vsk); - hvs = kzalloc(sizeof(*hvs), GFP_KERNEL); + hvs = kzalloc_obj(*hvs, GFP_KERNEL); if (!hvs) return -ENOMEM; @@ -655,7 +655,7 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg, BUILD_BUG_ON(sizeof(*send_buf) != HV_HYP_PAGE_SIZE); - send_buf = kmalloc(sizeof(*send_buf), GFP_KERNEL); + send_buf = kmalloc_obj(*send_buf, GFP_KERNEL); if (!send_buf) return -ENOMEM; diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 357e80ac3f3a..d6c07334bf94 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -805,7 +805,7 @@ static int virtio_vsock_probe(struct virtio_device *vdev) goto out; } - vsock = kzalloc(sizeof(*vsock), GFP_KERNEL); + vsock = kzalloc_obj(*vsock, GFP_KERNEL); if (!vsock) { ret = -ENOMEM; goto out; diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index d017ab318a7e..925ed086058c 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -920,7 +920,7 @@ int virtio_transport_do_socket_init(struct vsock_sock *vsk, { struct virtio_vsock_sock *vvs; - vvs = kzalloc(sizeof(*vvs), GFP_KERNEL); + vvs = kzalloc_obj(*vvs, GFP_KERNEL); if (!vvs) return -ENOMEM; diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index a64522be1bad..3e80639b7c08 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -262,7 +262,7 @@ vmci_transport_alloc_send_control_pkt(struct sockaddr_vm *src, struct vmci_transport_packet *pkt; int err; - pkt = kmalloc(sizeof(*pkt), GFP_KERNEL); + pkt = kmalloc_obj(*pkt, GFP_KERNEL); if (!pkt) return -ENOMEM; @@ -779,7 +779,7 @@ static int vmci_transport_recv_stream_cb(void *data, struct vmci_datagram *dg) if (!bh_process_pkt) { struct vmci_transport_recv_pkt_info *recv_pkt_info; - recv_pkt_info = kmalloc(sizeof(*recv_pkt_info), GFP_ATOMIC); + recv_pkt_info = kmalloc_obj(*recv_pkt_info, GFP_ATOMIC); if (!recv_pkt_info) { if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) pr_err("unable to send reset\n"); @@ -1583,7 +1583,7 @@ static int vmci_transport_recv_connected(struct sock *sk, static int vmci_transport_socket_init(struct vsock_sock *vsk, struct vsock_sock *psk) { - vsk->trans = kmalloc(sizeof(struct vmci_transport), GFP_KERNEL); + vsk->trans = kmalloc_obj(struct vmci_transport, GFP_KERNEL); if (!vsk->trans) return -ENOMEM; diff --git a/net/wireless/core.c b/net/wireless/core.c index 9af85d655027..bd53317e44ef 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -1000,9 +1000,8 @@ int wiphy_register(struct wiphy *wiphy) if (wiphy->n_radio > 0) { int idx; - wiphy->radio_cfg = kcalloc(wiphy->n_radio, - sizeof(*wiphy->radio_cfg), - GFP_KERNEL); + wiphy->radio_cfg = kzalloc_objs(*wiphy->radio_cfg, + wiphy->n_radio, GFP_KERNEL); if (!wiphy->radio_cfg) return -ENOMEM; /* @@ -1446,7 +1445,7 @@ void cfg80211_stop_link(struct wiphy *wiphy, struct wireless_dev *wdev, trace_cfg80211_stop_link(wiphy, wdev, link_id); - ev = kzalloc(sizeof(*ev), gfp); + ev = kzalloc_obj(*ev, gfp); if (!ev) return; diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 1e3ed29f7cfc..a7024af39b40 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c @@ -69,7 +69,7 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, if (WARN_ON(!channel)) return; - ev = kzalloc(sizeof(*ev), gfp); + ev = kzalloc_obj(*ev, gfp); if (!ev) return; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 6e58b238a1f8..33782370fbaf 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1106,8 +1106,8 @@ static int nl80211_prepare_wdev_dump(struct netlink_callback *cb, struct nlattr **attrbuf_free = NULL; if (!attrbuf) { - attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), - GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, + GFP_KERNEL); if (!attrbuf) return -ENOMEM; attrbuf_free = attrbuf; @@ -1615,7 +1615,7 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev, if (!have_key) return NULL; - result = kzalloc(sizeof(*result), GFP_KERNEL); + result = kzalloc_obj(*result, GFP_KERNEL); if (!result) return ERR_PTR(-ENOMEM); @@ -3367,7 +3367,7 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, struct netlink_callback *cb, struct nl80211_dump_wiphy_state *state) { - struct nlattr **tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL); + struct nlattr **tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); int ret; if (!tb) @@ -3419,7 +3419,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) rtnl_lock(); if (!state) { - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) { rtnl_unlock(); return -ENOMEM; @@ -5333,7 +5333,7 @@ static struct cfg80211_acl_data *parse_acl_data(struct wiphy *wiphy, if (n_entries > wiphy->max_acl_mac_addrs) return ERR_PTR(-EOPNOTSUPP); - acl = kzalloc(struct_size(acl, mac_addrs, n_entries), GFP_KERNEL); + acl = kzalloc_flex(*acl, mac_addrs, n_entries, GFP_KERNEL); if (!acl) return ERR_PTR(-ENOMEM); acl->n_acl_entries = n_entries; @@ -6113,7 +6113,7 @@ nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs) num_elems++; } - elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL); + elems = kzalloc_flex(*elems, elem, num_elems, GFP_KERNEL); if (!elems) return ERR_PTR(-ENOMEM); elems->cnt = num_elems; @@ -6145,7 +6145,7 @@ nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs, num_elems++; } - elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL); + elems = kzalloc_flex(*elems, elem, num_elems, GFP_KERNEL); if (!elems) return ERR_PTR(-ENOMEM); elems->cnt = num_elems; @@ -6702,7 +6702,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]) != NL80211_SMPS_OFF) return -EOPNOTSUPP; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -6995,7 +6995,7 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info) if (!wdev->links[link_id].ap.beacon_interval) return -EINVAL; - params = kzalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -7985,7 +7985,7 @@ static int nl80211_dump_station(struct sk_buff *skb, for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { sinfo.links[i] = - kzalloc(sizeof(*sinfo.links[0]), GFP_KERNEL); + kzalloc_obj(*sinfo.links[0], GFP_KERNEL); if (!sinfo.links[i]) { err = -ENOMEM; goto out_err; @@ -8049,7 +8049,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { - sinfo.links[i] = kzalloc(sizeof(*sinfo.links[0]), GFP_KERNEL); + sinfo.links[i] = kzalloc_obj(*sinfo.links[0], GFP_KERNEL); if (!sinfo.links[i]) { cfg80211_sinfo_release_content(&sinfo); return -ENOMEM; @@ -10157,7 +10157,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) goto out; } - rd = kzalloc(struct_size(rd, reg_rules, num_rules), GFP_KERNEL); + rd = kzalloc_flex(*rd, reg_rules, num_rules, GFP_KERNEL); if (!rd) { r = -ENOMEM; goto out; @@ -11520,8 +11520,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) if (err) goto free; - csa_attrs = kcalloc(NL80211_ATTR_MAX + 1, sizeof(*csa_attrs), - GFP_KERNEL); + csa_attrs = kzalloc_objs(*csa_attrs, NL80211_ATTR_MAX + 1, GFP_KERNEL); if (!csa_attrs) { err = -ENOMEM; goto free; @@ -11781,7 +11780,7 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) bool dump_include_use_data; int err; - attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); if (!attrbuf) return -ENOMEM; @@ -11921,7 +11920,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) int res; bool radio_stats; - attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); if (!attrbuf) return -ENOMEM; @@ -13112,8 +13111,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, goto out_err; } } else { - attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), - GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); if (!attrbuf) { err = -ENOMEM; goto out_err; @@ -14310,9 +14308,8 @@ static int nl80211_set_cqm_rssi(struct genl_info *info, } if (n_thresholds) { - cqm_config = kzalloc(struct_size(cqm_config, rssi_thresholds, - n_thresholds), - GFP_KERNEL); + cqm_config = kzalloc_flex(*cqm_config, rssi_thresholds, + n_thresholds, GFP_KERNEL); if (!cqm_config) return -ENOMEM; @@ -14938,7 +14935,7 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev, struct nlattr **tb; int err; - tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL); + tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); if (!tb) return -ENOMEM; @@ -15054,9 +15051,8 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) if (n_patterns > wowlan->n_patterns) return -EINVAL; - new_triggers.patterns = kcalloc(n_patterns, - sizeof(new_triggers.patterns[0]), - GFP_KERNEL); + new_triggers.patterns = kzalloc_objs(new_triggers.patterns[0], + n_patterns, GFP_KERNEL); if (!new_triggers.patterns) return -ENOMEM; @@ -15303,8 +15299,8 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, if (n_patterns > coalesce->n_patterns) return -EINVAL; - new_rule->patterns = kcalloc(n_patterns, sizeof(new_rule->patterns[0]), - GFP_KERNEL); + new_rule->patterns = kzalloc_objs(new_rule->patterns[0], n_patterns, + GFP_KERNEL); if (!new_rule->patterns) return -ENOMEM; @@ -15382,8 +15378,7 @@ static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info) if (n_rules > coalesce->n_rules) return -EINVAL; - new_coalesce = kzalloc(struct_size(new_coalesce, rules, n_rules), - GFP_KERNEL); + new_coalesce = kzalloc_flex(*new_coalesce, rules, n_rules, GFP_KERNEL); if (!new_coalesce) return -ENOMEM; @@ -15543,7 +15538,7 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info) if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) return -EOPNOTSUPP; - nreg = kzalloc(sizeof(*nreg), GFP_KERNEL); + nreg = kzalloc_obj(*nreg, GFP_KERNEL); if (!nreg) return -ENOMEM; @@ -15900,7 +15895,7 @@ static int handle_nan_filter(struct nlattr *attr_filter, BUILD_BUG_ON(sizeof(*func->rx_filters) != sizeof(*func->tx_filters)); - filter = kcalloc(n_entries, sizeof(*func->rx_filters), GFP_KERNEL); + filter = kzalloc_objs(*func->rx_filters, n_entries, GFP_KERNEL); if (!filter) return -ENOMEM; @@ -15960,7 +15955,7 @@ static int nl80211_nan_add_func(struct sk_buff *skb, if (err) return err; - func = kzalloc(sizeof(*func), GFP_KERNEL); + func = kzalloc_obj(*func, GFP_KERNEL); if (!func) return -ENOMEM; @@ -16099,8 +16094,8 @@ static int nl80211_nan_add_func(struct sk_buff *skb, func->srf_num_macs = n_entries; func->srf_macs = - kcalloc(n_entries, sizeof(*func->srf_macs), - GFP_KERNEL); + kzalloc_objs(*func->srf_macs, n_entries, + GFP_KERNEL); if (!func->srf_macs) { err = -ENOMEM; goto out; @@ -16602,7 +16597,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, return 0; } - attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); if (!attrbuf) return -ENOMEM; @@ -16833,7 +16828,7 @@ static int nl80211_set_qos_map(struct sk_buff *skb, if (len % 2) return -EINVAL; - qos_map = kzalloc(sizeof(struct cfg80211_qos_map), GFP_KERNEL); + qos_map = kzalloc_obj(struct cfg80211_qos_map, GFP_KERNEL); if (!qos_map) return -ENOMEM; @@ -17467,8 +17462,7 @@ static int nl80211_set_tid_config(struct sk_buff *skb, rem_conf) num_conf++; - tid_config = kzalloc(struct_size(tid_config, tid_conf, num_conf), - GFP_KERNEL); + tid_config = kzalloc_flex(*tid_config, tid_conf, num_conf, GFP_KERNEL); if (!tid_config) return -ENOMEM; @@ -17534,7 +17528,7 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info) if (err) return err; - tb = kcalloc(NL80211_ATTR_MAX + 1, sizeof(*tb), GFP_KERNEL); + tb = kzalloc_objs(*tb, NL80211_ATTR_MAX + 1, GFP_KERNEL); if (!tb) return -ENOMEM; @@ -18262,7 +18256,7 @@ static int nl80211_set_sar_specs(struct sk_buff *skb, struct genl_info *info) if (specs > rdev->wiphy.sar_capa->num_freq_ranges) return -EINVAL; - sar_spec = kzalloc(struct_size(sar_spec, sub_specs, specs), GFP_KERNEL); + sar_spec = kzalloc_flex(*sar_spec, sub_specs, specs, GFP_KERNEL); if (!sar_spec) return -ENOMEM; diff --git a/net/wireless/of.c b/net/wireless/of.c index de221f0edca5..35a3bcd84b6f 100644 --- a/net/wireless/of.c +++ b/net/wireless/of.c @@ -98,7 +98,7 @@ void wiphy_read_of_freq_limits(struct wiphy *wiphy) } n_freq_limits = len / sizeof(u32) / 2; - freq_limits = kcalloc(n_freq_limits, sizeof(*freq_limits), GFP_KERNEL); + freq_limits = kzalloc_objs(*freq_limits, n_freq_limits, GFP_KERNEL); if (!freq_limits) { err = -ENOMEM; goto out_kfree; diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c index 60e1e31c2185..41aa8636a243 100644 --- a/net/wireless/pmsr.c +++ b/net/wireless/pmsr.c @@ -312,7 +312,7 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info) } } - req = kzalloc(struct_size(req, peers, count), GFP_KERNEL); + req = kzalloc_flex(*req, peers, count, GFP_KERNEL); if (!req) return -ENOMEM; req->n_peers = count; diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 139cb27e5a81..d6f3282fe986 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -452,8 +452,7 @@ reg_copy_regd(const struct ieee80211_regdomain *src_regd) struct ieee80211_regdomain *regd; unsigned int i; - regd = kzalloc(struct_size(regd, reg_rules, src_regd->n_reg_rules), - GFP_KERNEL); + regd = kzalloc_flex(*regd, reg_rules, src_regd->n_reg_rules, GFP_KERNEL); if (!regd) return ERR_PTR(-ENOMEM); @@ -510,7 +509,7 @@ static int reg_schedule_apply(const struct ieee80211_regdomain *regdom) { struct reg_regdb_apply_request *request; - request = kzalloc(sizeof(struct reg_regdb_apply_request), GFP_KERNEL); + request = kzalloc_obj(struct reg_regdb_apply_request, GFP_KERNEL); if (!request) { kfree(regdom); return -ENOMEM; @@ -933,8 +932,7 @@ static int regdb_query_country(const struct fwdb_header *db, struct ieee80211_regdomain *regdom; unsigned int i; - regdom = kzalloc(struct_size(regdom, reg_rules, coll->n_rules), - GFP_KERNEL); + regdom = kzalloc_flex(*regdom, reg_rules, coll->n_rules, GFP_KERNEL); if (!regdom) return -ENOMEM; @@ -1100,7 +1098,7 @@ int reg_reload_regdb(void) /* reset regulatory domain */ current_regdomain = get_cfg80211_regdom(); - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) { err = -ENOMEM; goto out_unlock; @@ -1532,7 +1530,7 @@ regdom_intersect(const struct ieee80211_regdomain *rd1, if (!num_rules) return NULL; - rd = kzalloc(struct_size(rd, reg_rules, num_rules), GFP_KERNEL); + rd = kzalloc_flex(*rd, reg_rules, num_rules, GFP_KERNEL); if (!rd) return NULL; @@ -3224,7 +3222,7 @@ static int regulatory_hint_core(const char *alpha2) { struct regulatory_request *request; - request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); if (!request) return -ENOMEM; @@ -3250,7 +3248,7 @@ int regulatory_hint_user(const char *alpha2, if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2)) return -EINVAL; - request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); if (!request) return -ENOMEM; @@ -3320,7 +3318,7 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG; - request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); if (!request) return -ENOMEM; @@ -3353,7 +3351,7 @@ void regulatory_hint_country_ie(struct wiphy *wiphy, enum nl80211_band band, if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN) return; - request = kzalloc(sizeof(*request), GFP_KERNEL); + request = kzalloc_obj(*request, GFP_KERNEL); if (!request) return; @@ -3666,7 +3664,7 @@ void regulatory_hint_found_beacon(struct wiphy *wiphy, if (processing) return; - reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp); + reg_beacon = kzalloc_obj(struct reg_beacon, gfp); if (!reg_beacon) return; diff --git a/net/wireless/scan.c b/net/wireless/scan.c index eb0e77813d46..89174a9049a3 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -729,7 +729,7 @@ cfg80211_parse_colocated_ap_iter(void *_data, u8 type, bss_params))) return RNR_ITER_CONTINUE; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) return RNR_ITER_ERROR; @@ -895,7 +895,7 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev, if (ret) continue; - entry = kzalloc(sizeof(*entry), GFP_ATOMIC); + entry = kzalloc_obj(*entry, GFP_ATOMIC); if (!entry) continue; @@ -1085,8 +1085,7 @@ int cfg80211_scan(struct cfg80211_registered_device *rdev) if (!n_channels) return cfg80211_scan_6ghz(rdev, true); - request = kzalloc(struct_size(request, req.channels, n_channels), - GFP_KERNEL); + request = kzalloc_flex(*request, req.channels, n_channels, GFP_KERNEL); if (!request) return -ENOMEM; @@ -2694,7 +2693,7 @@ cfg80211_defrag_mle(const struct element *mle, const u8 *ie, size_t ielen, buf_len += elem->datalen; } - res = kzalloc(struct_size(res, data, buf_len), gfp); + res = kzalloc_flex(*res, data, buf_len, gfp); if (!res) return NULL; @@ -2910,9 +2909,8 @@ cfg80211_gen_reporter_rnr(struct cfg80211_bss *source_bss, bool is_mbssid, le16_encode_bits(bss_change_count, IEEE80211_RNR_MLD_PARAMS_BSS_CHANGE_COUNT); - res = kzalloc(struct_size(res, data, - sizeof(ap_info) + ap_info.tbtt_info_len), - gfp); + res = kzalloc_flex(*res, data, sizeof(ap_info) + ap_info.tbtt_info_len, + gfp); if (!res) return NULL; diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 4e629ca305bc..cb1a75fda5ca 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -570,7 +570,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, if (wdev->conn) return -EINPROGRESS; - wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL); + wdev->conn = kzalloc_obj(*wdev->conn, GFP_KERNEL); if (!wdev->conn) return -ENOMEM; diff --git a/net/wireless/tests/util.c b/net/wireless/tests/util.c index 8abdaeb820ce..6f870b06307d 100644 --- a/net/wireless/tests/util.c +++ b/net/wireless/tests/util.c @@ -17,7 +17,7 @@ int t_wiphy_init(struct kunit_resource *resource, void *ctx) struct wiphy *wiphy; struct t_wiphy_priv *priv; - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kzalloc_obj(*ops, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, ops); wiphy = wiphy_new_nm(ops, sizeof(*priv), "kunit"); diff --git a/net/wireless/util.c b/net/wireless/util.c index 404fe604a8db..b78530c3e3f8 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -2713,8 +2713,8 @@ bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, int cfg80211_link_sinfo_alloc_tid_stats(struct link_station_info *link_sinfo, gfp_t gfp) { - link_sinfo->pertid = kcalloc(IEEE80211_NUM_TIDS + 1, - sizeof(*link_sinfo->pertid), gfp); + link_sinfo->pertid = kzalloc_objs(*link_sinfo->pertid, + IEEE80211_NUM_TIDS + 1, gfp); if (!link_sinfo->pertid) return -ENOMEM; @@ -2724,9 +2724,8 @@ EXPORT_SYMBOL(cfg80211_link_sinfo_alloc_tid_stats); int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp) { - sinfo->pertid = kcalloc(IEEE80211_NUM_TIDS + 1, - sizeof(*(sinfo->pertid)), - gfp); + sinfo->pertid = kzalloc_objs(*(sinfo->pertid), IEEE80211_NUM_TIDS + 1, + gfp); if (!sinfo->pertid) return -ENOMEM; diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 1241fda78a68..3ce845cd1936 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -414,8 +414,7 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev, * to do it first in case the allocation fails. Don't use wext. */ if (!wdev->wext.keys) { - wdev->wext.keys = kzalloc(sizeof(*wdev->wext.keys), - GFP_KERNEL); + wdev->wext.keys = kzalloc_obj(*wdev->wext.keys, GFP_KERNEL); if (!wdev->wext.keys) return -ENOMEM; for (i = 0; i < 4; i++) diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c index 21b30b56e889..3b406906eb9e 100644 --- a/net/x25/x25_forward.c +++ b/net/x25/x25_forward.c @@ -55,8 +55,7 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from, /* Save the forwarding details for future traffic */ if (!same_lci){ - if ((new_frwd = kmalloc(sizeof(struct x25_forward), - GFP_ATOMIC)) == NULL){ + if ((new_frwd = kmalloc_obj(struct x25_forward, GFP_ATOMIC)) == NULL){ rc = -ENOMEM; goto out_put_nb; } diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index 4608aa5b4f31..d1e8cd81c214 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c @@ -262,7 +262,7 @@ void x25_link_terminated(struct x25_neigh *nb) */ void x25_link_device_up(struct net_device *dev) { - struct x25_neigh *nb = kmalloc(sizeof(*nb), GFP_ATOMIC); + struct x25_neigh *nb = kmalloc_obj(*nb, GFP_ATOMIC); if (!nb) return; diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c index 647f325ed867..b28055f852df 100644 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c @@ -37,7 +37,7 @@ static int x25_add_route(struct x25_address *address, unsigned int sigdigits, goto out; } - rt = kmalloc(sizeof(*rt), GFP_ATOMIC); + rt = kmalloc_obj(*rt, GFP_ATOMIC); rc = -ENOMEM; if (!rt) goto out; diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 9f76ca591d54..4c94ec312d75 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c @@ -97,7 +97,8 @@ static int xdp_umem_pin_pages(struct xdp_umem *umem, unsigned long address) long npgs; int err; - umem->pgs = kvcalloc(umem->npgs, sizeof(*umem->pgs), GFP_KERNEL | __GFP_NOWARN); + umem->pgs = kvzalloc_objs(*umem->pgs, umem->npgs, + GFP_KERNEL | __GFP_NOWARN); if (!umem->pgs) return -ENOMEM; @@ -249,7 +250,7 @@ struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr) struct xdp_umem *umem; int err; - umem = kzalloc(sizeof(*umem), GFP_KERNEL); + umem = kzalloc_obj(*umem, GFP_KERNEL); if (!umem) return ERR_PTR(-ENOMEM); diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index cd5125b6af53..a8f932b28ee3 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -42,8 +42,8 @@ void xp_destroy(struct xsk_buff_pool *pool) int xp_alloc_tx_descs(struct xsk_buff_pool *pool, struct xdp_sock *xs) { - pool->tx_descs = kvcalloc(xs->tx->nentries, sizeof(*pool->tx_descs), - GFP_KERNEL); + pool->tx_descs = kvzalloc_objs(*pool->tx_descs, xs->tx->nentries, + GFP_KERNEL); if (!pool->tx_descs) return -ENOMEM; @@ -59,11 +59,11 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs, u32 i, entries; entries = unaligned ? umem->chunks : 0; - pool = kvzalloc(struct_size(pool, free_heads, entries), GFP_KERNEL); + pool = kvzalloc_flex(*pool, free_heads, entries, GFP_KERNEL); if (!pool) goto out; - pool->heads = kvcalloc(umem->chunks, sizeof(*pool->heads), GFP_KERNEL); + pool->heads = kvzalloc_objs(*pool->heads, umem->chunks, GFP_KERNEL); if (!pool->heads) goto out; @@ -328,11 +328,12 @@ static struct xsk_dma_map *xp_create_dma_map(struct device *dev, struct net_devi { struct xsk_dma_map *dma_map; - dma_map = kzalloc(sizeof(*dma_map), GFP_KERNEL); + dma_map = kzalloc_obj(*dma_map, GFP_KERNEL); if (!dma_map) return NULL; - dma_map->dma_pages = kvcalloc(nr_pages, sizeof(*dma_map->dma_pages), GFP_KERNEL); + dma_map->dma_pages = kvzalloc_objs(*dma_map->dma_pages, nr_pages, + GFP_KERNEL); if (!dma_map->dma_pages) { kfree(dma_map); return NULL; @@ -420,7 +421,8 @@ static int xp_init_dma_info(struct xsk_buff_pool *pool, struct xsk_dma_map *dma_ } } - pool->dma_pages = kvcalloc(dma_map->dma_pages_cnt, sizeof(*pool->dma_pages), GFP_KERNEL); + pool->dma_pages = kvzalloc_objs(*pool->dma_pages, + dma_map->dma_pages_cnt, GFP_KERNEL); if (!pool->dma_pages) return -ENOMEM; diff --git a/net/xdp/xsk_queue.c b/net/xdp/xsk_queue.c index d2c264030017..ef089b9c4fc8 100644 --- a/net/xdp/xsk_queue.c +++ b/net/xdp/xsk_queue.c @@ -26,7 +26,7 @@ struct xsk_queue *xskq_create(u32 nentries, bool umem_queue) struct xsk_queue *q; size_t size; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index bf744ac9d5a7..3f6eda9364ec 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -465,7 +465,7 @@ static int espintcp_init_sk(struct sock *sk) if (sk->sk_user_data) return -EBUSY; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 43fdc6ed8dd1..35f8236059a7 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -336,7 +336,7 @@ int ipcomp_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) } err = -ENOMEM; - ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL); + ipcd = kzalloc_obj(*ipcd, GFP_KERNEL); if (!ipcd) goto out; diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c index 3b6d7284fc70..92b9a5b80804 100644 --- a/net/xfrm/xfrm_iptfs.c +++ b/net/xfrm/xfrm_iptfs.c @@ -2526,8 +2526,8 @@ static int iptfs_user_init(struct net *net, struct xfrm_state *x, nla_get_u16(attrs[XFRMA_IPTFS_REORDER_WINDOW]); /* saved array is for saving 1..N seq nums from wantseq */ if (xc->reorder_win_size) { - xtfs->w_saved = kcalloc(xc->reorder_win_size, - sizeof(*xtfs->w_saved), GFP_KERNEL); + xtfs->w_saved = kzalloc_objs(*xtfs->w_saved, + xc->reorder_win_size, GFP_KERNEL); if (!xtfs->w_saved) { NL_SET_ERR_MSG(extack, "Cannot alloc reorder window"); return -ENOMEM; @@ -2658,8 +2658,9 @@ static int iptfs_clone_state(struct xfrm_state *x, struct xfrm_state *orig) xtfs->ra_newskb = NULL; if (xtfs->cfg.reorder_win_size) { - xtfs->w_saved = kcalloc(xtfs->cfg.reorder_win_size, - sizeof(*xtfs->w_saved), GFP_KERNEL); + xtfs->w_saved = kzalloc_objs(*xtfs->w_saved, + xtfs->cfg.reorder_win_size, + GFP_KERNEL); if (!xtfs->w_saved) { kfree_sensitive(xtfs); return -ENOMEM; @@ -2677,7 +2678,7 @@ static int iptfs_init_state(struct xfrm_state *x) /* We have arrived here from xfrm_state_clone() */ xtfs = x->mode_data; } else { - xtfs = kzalloc(sizeof(*xtfs), GFP_KERNEL); + xtfs = kzalloc_obj(*xtfs, GFP_KERNEL); if (!xtfs) return -ENOMEM; } diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 62486f866975..ee8bb445c4d3 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -429,7 +429,7 @@ struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp) { struct xfrm_policy *policy; - policy = kzalloc(sizeof(struct xfrm_policy), gfp); + policy = kzalloc_obj(struct xfrm_policy, gfp); if (policy) { write_pnet(&policy->xp_net, net); @@ -765,7 +765,7 @@ xfrm_policy_inexact_alloc_bin(const struct xfrm_policy *pol, u8 dir) if (bin) return bin; - bin = kzalloc(sizeof(*bin), GFP_ATOMIC); + bin = kzalloc_obj(*bin, GFP_ATOMIC); if (!bin) return NULL; @@ -836,7 +836,7 @@ xfrm_pol_inexact_node_alloc(const xfrm_address_t *addr, u8 prefixlen) { struct xfrm_pol_inexact_node *node; - node = kzalloc(sizeof(*node), GFP_ATOMIC); + node = kzalloc_obj(*node, GFP_ATOMIC); if (node) xfrm_pol_inexact_node_init(node, addr, prefixlen); diff --git a/scripts/livepatch/init.c b/scripts/livepatch/init.c index 638c95cffe76..bbfd2e479099 100644 --- a/scripts/livepatch/init.c +++ b/scripts/livepatch/init.c @@ -28,7 +28,7 @@ static int __init livepatch_mod_init(void) goto err; } - patch = kzalloc(sizeof(*patch), GFP_KERNEL); + patch = kzalloc_obj(*patch, GFP_KERNEL); if (!patch) { ret = -ENOMEM; goto err; diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 5a848c1be056..283e622a7ccc 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -570,7 +570,7 @@ static ssize_t ns_revision_read(struct file *file, char __user *buf, static int ns_revision_open(struct inode *inode, struct file *file) { - struct aa_revision *rev = kzalloc(sizeof(*rev), GFP_KERNEL); + struct aa_revision *rev = kzalloc_obj(*rev, GFP_KERNEL); if (!rev) return -ENOMEM; diff --git a/security/apparmor/audit.c b/security/apparmor/audit.c index ac89602aa2d9..4a60b6fda75f 100644 --- a/security/apparmor/audit.c +++ b/security/apparmor/audit.c @@ -230,7 +230,7 @@ int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule, gfp_t gfp return -EINVAL; } - rule = kzalloc(sizeof(struct aa_audit_rule), gfp); + rule = kzalloc_obj(struct aa_audit_rule, gfp); if (!rule) return -ENOMEM; diff --git a/security/apparmor/label.c b/security/apparmor/label.c index 03a92a52acf9..e478283bc514 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -61,7 +61,7 @@ struct aa_proxy *aa_alloc_proxy(struct aa_label *label, gfp_t gfp) { struct aa_proxy *new; - new = kzalloc(sizeof(struct aa_proxy), gfp); + new = kzalloc_obj(struct aa_proxy, gfp); if (new) { kref_init(&new->count); rcu_assign_pointer(new->label, aa_get_label(label)); @@ -434,7 +434,7 @@ struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp) AA_BUG(size < 1); /* + 1 for null terminator entry on vec */ - new = kzalloc(struct_size(new, vec, size + 1), gfp); + new = kzalloc_flex(*new, vec, size + 1, gfp); AA_DEBUG(DEBUG_LABEL, "%s (%p)\n", __func__, new); if (!new) goto fail; diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index d0b82771df01..e41ff57798b2 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -125,7 +125,7 @@ bool aa_resize_str_table(struct aa_str_table *t, int newsize, gfp_t gfp) if (t->size == newsize) return true; - n = kcalloc(newsize, sizeof(*n), gfp); + n = kzalloc_objs(*n, newsize, gfp); if (!n) return false; for (i = 0; i < min(t->size, newsize); i++) @@ -235,7 +235,7 @@ __counted char *aa_str_alloc(int size, gfp_t gfp) { struct counted_str *str; - str = kmalloc(struct_size(str, name, size), gfp); + str = kmalloc_flex(*str, name, size, gfp); if (!str) return NULL; diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index dcd066e04d2b..92ea1bc7b9e0 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -2468,7 +2468,7 @@ static int __init aa_setup_dfa_engine(void) goto fail; } nullpdb->dfa = aa_get_dfa(nulldfa); - nullpdb->perms = kcalloc(2, sizeof(struct aa_perms), GFP_KERNEL); + nullpdb->perms = kzalloc_objs(struct aa_perms, 2, GFP_KERNEL); if (!nullpdb->perms) goto fail; nullpdb->size = 2; diff --git a/security/apparmor/match.c b/security/apparmor/match.c index bbeb3be68572..5ee25d4016e0 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -301,7 +301,7 @@ struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags) int error = -ENOMEM; char *data = blob; struct table_header *table = NULL; - struct aa_dfa *dfa = kzalloc(sizeof(struct aa_dfa), GFP_KERNEL); + struct aa_dfa *dfa = kzalloc_obj(struct aa_dfa, GFP_KERNEL); if (!dfa) goto fail; diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index a64cfd24cedc..9108d74c6b46 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -131,7 +131,7 @@ void aa_pdb_free_kref(struct kref *kref) struct aa_policydb *aa_alloc_pdb(gfp_t gfp) { - struct aa_policydb *pdb = kzalloc(sizeof(struct aa_policydb), gfp); + struct aa_policydb *pdb = kzalloc_obj(struct aa_policydb, gfp); if (!pdb) return NULL; @@ -275,7 +275,7 @@ struct aa_ruleset *aa_alloc_ruleset(gfp_t gfp) { struct aa_ruleset *rules; - rules = kzalloc(sizeof(*rules), gfp); + rules = kzalloc_obj(*rules, gfp); return rules; } @@ -349,7 +349,7 @@ struct aa_profile *aa_alloc_profile(const char *hname, struct aa_proxy *proxy, * this adds space for a single ruleset in the rules section of the * label */ - profile = kzalloc(struct_size(profile, label.rules, 1), gfp); + profile = kzalloc_flex(*profile, label.rules, 1, gfp); if (!profile) return NULL; diff --git a/security/apparmor/policy_compat.c b/security/apparmor/policy_compat.c index c863fc10a6f7..928dbb10cec1 100644 --- a/security/apparmor/policy_compat.c +++ b/security/apparmor/policy_compat.c @@ -158,7 +158,7 @@ static struct aa_perms *compute_fperms(struct aa_dfa *dfa, state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - table = kvcalloc(state_count * 2, sizeof(struct aa_perms), GFP_KERNEL); + table = kvzalloc_objs(struct aa_perms, state_count * 2, GFP_KERNEL); if (!table) return NULL; *size = state_count * 2; @@ -182,7 +182,7 @@ static struct aa_perms *compute_xmatch_perms(struct aa_dfa *xmatch, state_count = xmatch->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - perms = kvcalloc(state_count, sizeof(struct aa_perms), GFP_KERNEL); + perms = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL); if (!perms) return NULL; *size = state_count; @@ -257,7 +257,7 @@ static struct aa_perms *compute_perms(struct aa_dfa *dfa, u32 version, state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - table = kvcalloc(state_count, sizeof(struct aa_perms), GFP_KERNEL); + table = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL); if (!table) return NULL; *size = state_count; diff --git a/security/apparmor/policy_ns.c b/security/apparmor/policy_ns.c index 64783ca3b0f2..099b71957ccb 100644 --- a/security/apparmor/policy_ns.c +++ b/security/apparmor/policy_ns.c @@ -106,7 +106,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name) { struct aa_ns *ns; - ns = kzalloc(sizeof(*ns), GFP_KERNEL); + ns = kzalloc_obj(*ns, GFP_KERNEL); AA_DEBUG(DEBUG_POLICY, "%s(%p)\n", __func__, ns); if (!ns) return NULL; diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index dc908e1f5a88..9001c6ebc235 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -145,7 +145,7 @@ struct aa_loaddata *aa_loaddata_alloc(size_t size) { struct aa_loaddata *d; - d = kzalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc_obj(*d, GFP_KERNEL); if (d == NULL) return ERR_PTR(-ENOMEM); d->data = kvzalloc(size, GFP_KERNEL); @@ -528,8 +528,7 @@ static int unpack_strs_table(struct aa_ext *e, const char *name, bool multi, * for size check here */ goto fail; - table = kcalloc(size, sizeof(struct aa_str_table_ent), - GFP_KERNEL); + table = kzalloc_objs(struct aa_str_table_ent, size, GFP_KERNEL); if (!table) { error = -ENOMEM; goto fail; @@ -612,8 +611,8 @@ static bool unpack_secmark(struct aa_ext *e, struct aa_ruleset *rules) if (!aa_unpack_array(e, NULL, &size)) goto fail; - rules->secmark = kcalloc(size, sizeof(struct aa_secmark), - GFP_KERNEL); + rules->secmark = kzalloc_objs(struct aa_secmark, size, + GFP_KERNEL); if (!rules->secmark) goto fail; @@ -810,7 +809,7 @@ static int unpack_tag_headers(struct aa_ext *e, struct aa_tags_struct *tags) if (!aa_unpack_array(e, "hdrs", &size)) goto fail_reset; - hdrs = kcalloc(size, sizeof(struct aa_tags_header), GFP_KERNEL); + hdrs = kzalloc_objs(struct aa_tags_header, size, GFP_KERNEL); if (!hdrs) { error = -ENOMEM; goto fail_reset; @@ -923,7 +922,7 @@ static ssize_t unpack_perms_table(struct aa_ext *e, struct aa_perms **perms) goto fail_reset; if (!aa_unpack_array(e, NULL, &size)) goto fail_reset; - *perms = kcalloc(size, sizeof(struct aa_perms), GFP_KERNEL); + *perms = kzalloc_objs(struct aa_perms, size, GFP_KERNEL); if (!*perms) { e->pos = pos; return -ENOMEM; @@ -1321,7 +1320,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) error = -EPROTO; if (aa_unpack_nameX(e, AA_STRUCT, "data")) { info = "out of memory"; - profile->data = kzalloc(sizeof(*profile->data), GFP_KERNEL); + profile->data = kzalloc_obj(*profile->data, GFP_KERNEL); if (!profile->data) { error = -ENOMEM; goto fail; @@ -1339,7 +1338,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) } while (aa_unpack_strdup(e, &key, NULL)) { - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { kfree_sensitive(key); error = -ENOMEM; @@ -1584,7 +1583,7 @@ void aa_load_ent_free(struct aa_load_ent *ent) struct aa_load_ent *aa_load_ent_alloc(void) { - struct aa_load_ent *ent = kzalloc(sizeof(*ent), GFP_KERNEL); + struct aa_load_ent *ent = kzalloc_obj(*ent, GFP_KERNEL); if (ent) INIT_LIST_HEAD(&ent->list); return ent; diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 7fec575d32d6..27610fa31b61 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -223,7 +223,7 @@ devcgroup_css_alloc(struct cgroup_subsys_state *parent_css) { struct dev_cgroup *dev_cgroup; - dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL); + dev_cgroup = kzalloc_obj(*dev_cgroup, GFP_KERNEL); if (!dev_cgroup) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&dev_cgroup->exceptions); diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c index 45c3e5dda355..aec350abad86 100644 --- a/security/integrity/digsig.c +++ b/security/integrity/digsig.c @@ -141,7 +141,7 @@ int __init integrity_init_keyring(const unsigned int id) if (!IS_ENABLED(CONFIG_INTEGRITY_TRUSTED_KEYRING)) return 0; - restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); if (!restriction) return -ENOMEM; diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index 73d500a375cb..41b053c900f2 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/integrity/evm/evm_main.c @@ -1045,7 +1045,7 @@ int evm_inode_init_security(struct inode *inode, struct inode *dir, "%s: xattrs terminator is not the first non-filled slot\n", __func__); - xattr_data = kzalloc(sizeof(*xattr_data), GFP_NOFS); + xattr_data = kzalloc_obj(*xattr_data, GFP_NOFS); if (!xattr_data) return -ENOMEM; diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index c26724690cec..a8893b90a0fa 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c @@ -199,7 +199,7 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, if (!ab && IS_ENABLED(CONFIG_AUDIT)) return -ENOMEM; - xattr = kmalloc(sizeof(struct xattr_list), GFP_KERNEL); + xattr = kmalloc_obj(struct xattr_list, GFP_KERNEL); if (!xattr) { err = -ENOMEM; goto out; diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c index c6d1c7be8a3e..d15becc8c640 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c @@ -48,13 +48,14 @@ int ima_alloc_init_template(struct ima_event_data *event_data, else template_desc = ima_template_desc_current(); - *entry = kzalloc(struct_size(*entry, template_data, - template_desc->num_fields), GFP_NOFS); + *entry = kzalloc_flex(**entry, template_data, template_desc->num_fields, + GFP_NOFS); if (!*entry) return -ENOMEM; - digests = kcalloc(NR_BANKS(ima_tpm_chip) + ima_extra_slots, - sizeof(*digests), GFP_NOFS); + digests = kzalloc_objs(*digests, + NR_BANKS(ima_tpm_chip) + ima_extra_slots, + GFP_NOFS); if (!digests) { kfree(*entry); *entry = NULL; diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 6f5696d999d0..d4af5f0e7d6c 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c @@ -138,8 +138,9 @@ int __init ima_init_crypto(void) if (ima_hash_algo_idx < 0) ima_hash_algo_idx = NR_BANKS(ima_tpm_chip) + ima_extra_slots++; - ima_algo_array = kcalloc(NR_BANKS(ima_tpm_chip) + ima_extra_slots, - sizeof(*ima_algo_array), GFP_KERNEL); + ima_algo_array = kzalloc_objs(*ima_algo_array, + NR_BANKS(ima_tpm_chip) + ima_extra_slots, + GFP_KERNEL); if (!ima_algo_array) { rc = -ENOMEM; goto out; diff --git a/security/integrity/ima/ima_modsig.c b/security/integrity/ima/ima_modsig.c index 3265d744d5ce..daeeddae3878 100644 --- a/security/integrity/ima/ima_modsig.c +++ b/security/integrity/ima/ima_modsig.c @@ -65,7 +65,7 @@ int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, buf_len -= sig_len + sizeof(*sig); /* Allocate sig_len additional bytes to hold the raw PKCS#7 data. */ - hdr = kzalloc(struct_size(hdr, raw_pkcs7, sig_len), GFP_KERNEL); + hdr = kzalloc_flex(*hdr, raw_pkcs7, sig_len, GFP_KERNEL); if (!hdr) return -ENOMEM; diff --git a/security/integrity/ima/ima_mok.c b/security/integrity/ima/ima_mok.c index 95cc31525c57..c647f4fd114d 100644 --- a/security/integrity/ima/ima_mok.c +++ b/security/integrity/ima/ima_mok.c @@ -27,7 +27,7 @@ static __init int ima_mok_init(void) pr_notice("Allocating IMA blacklist keyring.\n"); - restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); if (!restriction) panic("Can't allocate IMA blacklist restriction."); diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 8fbd8755f5bc..c99f52458cd5 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -342,7 +342,7 @@ static struct ima_rule_opt_list *ima_alloc_rule_opt_list(const substring_t *src) return ERR_PTR(-EINVAL); } - opt_list = kzalloc(struct_size(opt_list, items, count), GFP_KERNEL); + opt_list = kzalloc_flex(*opt_list, items, count, GFP_KERNEL); if (!opt_list) { kfree(src_copy); return ERR_PTR(-ENOMEM); @@ -921,8 +921,8 @@ static int __init ima_init_arch_policy(void) for (rules = arch_rules; *rules != NULL; rules++) arch_entries++; - arch_policy_entry = kcalloc(arch_entries + 1, - sizeof(*arch_policy_entry), GFP_KERNEL); + arch_policy_entry = kzalloc_objs(*arch_policy_entry, arch_entries + 1, + GFP_KERNEL); if (!arch_policy_entry) return 0; @@ -1976,7 +1976,7 @@ ssize_t ima_parse_add_rule(char *rule) if (*p == '#' || *p == '\0') return len; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL, op, "-ENOMEM", -ENOMEM, audit_info); diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index 590637e81ad1..859c83ab5a2b 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c @@ -103,7 +103,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry, struct ima_queue_entry *qe; unsigned int key; - qe = kmalloc(sizeof(*qe), GFP_KERNEL); + qe = kmalloc_obj(*qe, GFP_KERNEL); if (qe == NULL) { pr_err("OUT OF MEMORY ERROR creating queue entry\n"); return -ENOMEM; @@ -269,8 +269,8 @@ int __init ima_init_digests(void) if (!ima_tpm_chip) return 0; - digests = kcalloc(ima_tpm_chip->nr_allocated_banks, sizeof(*digests), - GFP_NOFS); + digests = kzalloc_objs(*digests, ima_tpm_chip->nr_allocated_banks, + GFP_NOFS); if (!digests) return -ENOMEM; diff --git a/security/integrity/ima/ima_queue_keys.c b/security/integrity/ima/ima_queue_keys.c index 4f0aea155bf9..da29e5b8f6df 100644 --- a/security/integrity/ima/ima_queue_keys.c +++ b/security/integrity/ima/ima_queue_keys.c @@ -72,7 +72,7 @@ static struct ima_key_entry *ima_alloc_key_entry(struct key *keyring, const char *audit_cause = "ENOMEM"; struct ima_key_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (entry) { entry->payload = kmemdup(payload, payload_len, GFP_KERNEL); entry->keyring_name = kstrdup(keyring->description, diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c index 04c49f05cb74..9712eb6b4b88 100644 --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c @@ -245,7 +245,7 @@ int template_desc_init_fields(const char *template_fmt, } if (fields && num_fields) { - *fields = kmalloc_array(i, sizeof(**fields), GFP_KERNEL); + *fields = kmalloc_objs(**fields, i, GFP_KERNEL); if (*fields == NULL) return -ENOMEM; @@ -334,7 +334,7 @@ static struct ima_template_desc *restore_template_fmt(char *template_name) goto out; } - template_desc = kzalloc(sizeof(*template_desc), GFP_KERNEL); + template_desc = kzalloc_obj(*template_desc, GFP_KERNEL); if (!template_desc) goto out; @@ -362,13 +362,14 @@ static int ima_restore_template_data(struct ima_template_desc *template_desc, int ret = 0; int i; - *entry = kzalloc(struct_size(*entry, template_data, - template_desc->num_fields), GFP_NOFS); + *entry = kzalloc_flex(**entry, template_data, template_desc->num_fields, + GFP_NOFS); if (!*entry) return -ENOMEM; - digests = kcalloc(NR_BANKS(ima_tpm_chip) + ima_extra_slots, - sizeof(*digests), GFP_NOFS); + digests = kzalloc_objs(*digests, + NR_BANKS(ima_tpm_chip) + ima_extra_slots, + GFP_NOFS); if (!digests) { kfree(*entry); return -ENOMEM; diff --git a/security/ipe/digest.c b/security/ipe/digest.c index 5006366837ba..747768ba0e52 100644 --- a/security/ipe/digest.c +++ b/security/ipe/digest.c @@ -29,7 +29,7 @@ struct digest_info *ipe_digest_parse(const char *valstr) char *alg = NULL; int rc = 0; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); diff --git a/security/ipe/hooks.c b/security/ipe/hooks.c index 603abdc9ce3b..b8d677f87845 100644 --- a/security/ipe/hooks.c +++ b/security/ipe/hooks.c @@ -287,7 +287,7 @@ int ipe_bdev_setintegrity(struct block_device *bdev, enum lsm_integrity_type typ } digest = value; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/security/ipe/policy.c b/security/ipe/policy.c index 1c58c29886e8..c2ff142aed37 100644 --- a/security/ipe/policy.c +++ b/security/ipe/policy.c @@ -162,7 +162,7 @@ struct ipe_policy *ipe_new_policy(const char *text, size_t textlen, struct ipe_policy *new = NULL; int rc = 0; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return ERR_PTR(-ENOMEM); diff --git a/security/ipe/policy_parser.c b/security/ipe/policy_parser.c index 7f27e39931d6..180de3e5f200 100644 --- a/security/ipe/policy_parser.c +++ b/security/ipe/policy_parser.c @@ -30,7 +30,7 @@ static struct ipe_parsed_policy *new_parsed_policy(void) struct ipe_op_table *t = NULL; size_t i = 0; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -305,7 +305,7 @@ static int parse_property(char *t, struct ipe_rule *r) int token; char *dup = NULL; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return -ENOMEM; @@ -373,7 +373,7 @@ static int parse_rule(char *line, struct ipe_parsed_policy *p) if (IS_ERR_OR_NULL(line)) return -EBADMSG; - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) return -ENOMEM; diff --git a/security/keys/key.c b/security/keys/key.c index 3bbdde778631..8ca0777f22d3 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -77,7 +77,7 @@ try_again: spin_unlock(&key_user_lock); user = NULL; - candidate = kmalloc(sizeof(struct key_user), GFP_KERNEL); + candidate = kmalloc_obj(struct key_user, GFP_KERNEL); if (unlikely(!candidate)) goto out; diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index ab927a142f51..7d8a0de7c7c4 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1796,13 +1796,13 @@ long keyctl_watch_key(key_serial_t id, int watch_queue_fd, int watch_id) if (watch_id >= 0) { ret = -ENOMEM; if (!key->watchers) { - wlist = kzalloc(sizeof(*wlist), GFP_KERNEL); + wlist = kzalloc_obj(*wlist, GFP_KERNEL); if (!wlist) goto err_wqueue; init_watch_list(wlist, NULL); } - watch = kzalloc(sizeof(*watch), GFP_KERNEL); + watch = kzalloc_obj(*watch, GFP_KERNEL); if (!watch) goto err_wlist; diff --git a/security/keys/keyring.c b/security/keys/keyring.c index f331725d5a37..9a1685035be5 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -977,7 +977,7 @@ static struct key_restriction *keyring_restriction_alloc( key_restrict_link_func_t check) { struct key_restriction *keyres = - kzalloc(sizeof(struct key_restriction), GFP_KERNEL); + kzalloc_obj(struct key_restriction, GFP_KERNEL); if (!keyres) return ERR_PTR(-ENOMEM); diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c index 8f33cd170e42..f0de3e9d9743 100644 --- a/security/keys/request_key_auth.c +++ b/security/keys/request_key_auth.c @@ -171,7 +171,7 @@ struct key *request_key_auth_new(struct key *target, const char *op, kenter("%d,", target->serial); /* allocate a auth record */ - rka = kzalloc(sizeof(*rka), GFP_KERNEL); + rka = kzalloc_obj(*rka, GFP_KERNEL); if (!rka) goto error; rka->callout_info = kmemdup(callout_info, callout_len, GFP_KERNEL); diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c index 9046123d94de..fb9ff3d18292 100644 --- a/security/keys/trusted-keys/trusted_core.c +++ b/security/keys/trusted-keys/trusted_core.c @@ -134,7 +134,7 @@ static struct trusted_key_payload *trusted_payload_alloc(struct key *key) ret = key_payload_reserve(key, sizeof(*p)); if (ret < 0) goto err; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) goto err; diff --git a/security/keys/trusted-keys/trusted_pkwm.c b/security/keys/trusted-keys/trusted_pkwm.c index 4f391b77a907..aab8fbc49280 100644 --- a/security/keys/trusted-keys/trusted_pkwm.c +++ b/security/keys/trusted-keys/trusted_pkwm.c @@ -62,10 +62,10 @@ static struct trusted_key_options *trusted_options_alloc(void) struct trusted_key_options *options; struct trusted_pkwm_options *pkwm; - options = kzalloc(sizeof(*options), GFP_KERNEL); + options = kzalloc_obj(*options, GFP_KERNEL); if (options) { - pkwm = kzalloc(sizeof(*pkwm), GFP_KERNEL); + pkwm = kzalloc_obj(*pkwm, GFP_KERNEL); if (!pkwm) { kfree_sensitive(options); diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c index c865c97aa1b4..ce9b26dd846e 100644 --- a/security/keys/trusted-keys/trusted_tpm1.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -440,7 +440,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype, int i; /* alloc some work space for all the hashes */ - td = kmalloc(sizeof *td, GFP_KERNEL); + td = kmalloc_obj(*td, GFP_KERNEL); if (!td) return -ENOMEM; @@ -838,7 +838,7 @@ static struct trusted_key_options *trusted_options_alloc(void) if (tpm2 < 0) return NULL; - options = kzalloc(sizeof *options, GFP_KERNEL); + options = kzalloc_obj(*options, GFP_KERNEL); if (options) { /* set any non-zero defaults */ options->keytype = SRK_keytype; @@ -946,8 +946,7 @@ static int __init init_digests(void) { int i; - digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests), - GFP_KERNEL); + digests = kzalloc_objs(*digests, chip->nr_allocated_banks, GFP_KERNEL); if (!digests) return -ENOMEM; diff --git a/security/landlock/domain.c b/security/landlock/domain.c index 79cb3bbdf4c5..29a0f9789eee 100644 --- a/security/landlock/domain.c +++ b/security/landlock/domain.c @@ -95,7 +95,7 @@ static struct landlock_details *get_current_details(void) * caller. */ details = - kzalloc(struct_size(details, exe_path, path_size), GFP_KERNEL); + kzalloc_flex(*details, exe_path, path_size, GFP_KERNEL); if (!details) return ERR_PTR(-ENOMEM); diff --git a/security/landlock/object.c b/security/landlock/object.c index 1f50612f0185..0d6e159ef8b5 100644 --- a/security/landlock/object.c +++ b/security/landlock/object.c @@ -25,7 +25,7 @@ landlock_create_object(const struct landlock_object_underops *const underops, if (WARN_ON_ONCE(!underops || !underobj)) return ERR_PTR(-ENOENT); - new_object = kzalloc(sizeof(*new_object), GFP_KERNEL_ACCOUNT); + new_object = kzalloc_obj(*new_object, GFP_KERNEL_ACCOUNT); if (!new_object) return ERR_PTR(-ENOMEM); refcount_set(&new_object->usage, 1); diff --git a/security/landlock/ruleset.c b/security/landlock/ruleset.c index 419b237de635..319873586385 100644 --- a/security/landlock/ruleset.c +++ b/security/landlock/ruleset.c @@ -33,8 +33,8 @@ static struct landlock_ruleset *create_ruleset(const u32 num_layers) struct landlock_ruleset *new_ruleset; new_ruleset = - kzalloc(struct_size(new_ruleset, access_masks, num_layers), - GFP_KERNEL_ACCOUNT); + kzalloc_flex(*new_ruleset, access_masks, num_layers, + GFP_KERNEL_ACCOUNT); if (!new_ruleset) return ERR_PTR(-ENOMEM); refcount_set(&new_ruleset->usage, 1); @@ -123,8 +123,8 @@ create_rule(const struct landlock_id id, } else { new_num_layers = num_layers; } - new_rule = kzalloc(struct_size(new_rule, layers, new_num_layers), - GFP_KERNEL_ACCOUNT); + new_rule = kzalloc_flex(*new_rule, layers, new_num_layers, + GFP_KERNEL_ACCOUNT); if (!new_rule) return ERR_PTR(-ENOMEM); RB_CLEAR_NODE(&new_rule->node); @@ -559,8 +559,8 @@ landlock_merge_ruleset(struct landlock_ruleset *const parent, if (IS_ERR(new_dom)) return new_dom; - new_dom->hierarchy = - kzalloc(sizeof(*new_dom->hierarchy), GFP_KERNEL_ACCOUNT); + new_dom->hierarchy = kzalloc_obj(*new_dom->hierarchy, + GFP_KERNEL_ACCOUNT); if (!new_dom->hierarchy) return ERR_PTR(-ENOMEM); diff --git a/security/landlock/tsync.c b/security/landlock/tsync.c index 0d2b9c646030..de01aa899751 100644 --- a/security/landlock/tsync.c +++ b/security/landlock/tsync.c @@ -237,7 +237,7 @@ static int tsync_works_grow_by(struct tsync_works *s, size_t n, gfp_t flags) s->works = works; for (i = s->capacity; i < new_capacity; i++) { - work = kzalloc(sizeof(*work), flags); + work = kzalloc_obj(*work, flags); if (!work) { /* * Leave the object in a consistent state, diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c index 6d5f3208f9ca..62b9ee7caefb 100644 --- a/security/loadpin/loadpin.c +++ b/security/loadpin/loadpin.c @@ -327,7 +327,7 @@ static int read_trusted_verity_root_digests(unsigned int fd) len /= 2; - trd = kzalloc(struct_size(trd, data, len), GFP_KERNEL); + trd = kzalloc_flex(*trd, data, len, GFP_KERNEL); if (!trd) { rc = -ENOMEM; goto err; diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index ece259f75b0d..8cc2bcb07324 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -118,7 +118,7 @@ static int verify_ruleset(struct setid_ruleset *pol) res = -EINVAL; /* fix it up */ - nrule = kmalloc(sizeof(struct setid_rule), GFP_KERNEL); + nrule = kmalloc_obj(struct setid_rule, GFP_KERNEL); if (!nrule) return -ENOMEM; if (pol->type == UID){ @@ -146,7 +146,7 @@ static ssize_t handle_policy_update(struct file *file, if (len >= KMALLOC_MAX_SIZE) return -EINVAL; - pol = kmalloc(sizeof(struct setid_ruleset), GFP_KERNEL); + pol = kmalloc_obj(struct setid_ruleset, GFP_KERNEL); if (!pol) return -ENOMEM; pol->policy_str = NULL; @@ -175,7 +175,7 @@ static ssize_t handle_policy_update(struct file *file, } *end = '\0'; - rule = kmalloc(sizeof(struct setid_rule), GFP_KERNEL); + rule = kmalloc_obj(struct setid_rule, GFP_KERNEL); if (!rule) { err = -ENOMEM; goto out_free_buf; diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 8f77b9a732e1..584b1d6bdff1 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -794,7 +794,7 @@ int __init avc_add_callback(int (*callback)(u32 event), u32 events) struct avc_callback_node *c; int rc = 0; - c = kmalloc(sizeof(*c), GFP_KERNEL); + c = kmalloc_obj(*c, GFP_KERNEL); if (!c) { rc = -ENOMEM; goto out; diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index feda34b18d83..58ce110272ef 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1030,7 +1030,7 @@ static int selinux_add_opt(int token, const char *s, void **mnt_opts) } if (!opts) { - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; *mnt_opts = opts; @@ -2822,7 +2822,7 @@ static int selinux_fs_context_submount(struct fs_context *fc, if (!(sbsec->flags & (FSCONTEXT_MNT|CONTEXT_MNT|DEFCONTEXT_MNT))) return 0; - opts = kzalloc(sizeof(*opts), GFP_KERNEL); + opts = kzalloc_obj(*opts, GFP_KERNEL); if (!opts) return -ENOMEM; diff --git a/security/selinux/ibpkey.c b/security/selinux/ibpkey.c index ea1d9b2c7d2b..93a5637fbcd8 100644 --- a/security/selinux/ibpkey.c +++ b/security/selinux/ibpkey.c @@ -147,7 +147,7 @@ static int sel_ib_pkey_sid_slow(u64 subnet_prefix, u16 pkey_num, u32 *sid) if (ret) goto out; - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (!new) { /* If this memory allocation fails still return 0. The SID * is valid, it just won't be added to the cache. diff --git a/security/selinux/netif.c b/security/selinux/netif.c index e24b2cba28ea..fa6d24a37c39 100644 --- a/security/selinux/netif.c +++ b/security/selinux/netif.c @@ -161,7 +161,7 @@ static int sel_netif_sid_slow(struct net *ns, int ifindex, u32 *sid) /* If this memory allocation fails still return 0. The SID * is valid, it just won't be added to the cache. */ - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (new) { new->nsec.ns = ns; new->nsec.ifindex = ifindex; diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c index 9b3da5ce8d39..adb93003b8c4 100644 --- a/security/selinux/netnode.c +++ b/security/selinux/netnode.c @@ -205,7 +205,7 @@ static int sel_netnode_sid_slow(const void *addr, u16 family, u32 *sid) /* If this memory allocation fails still return 0. The SID * is valid, it just won't be added to the cache. */ - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); switch (family) { case PF_INET: ret = security_node_sid(PF_INET, diff --git a/security/selinux/netport.c b/security/selinux/netport.c index 9e62f7285e81..006a6ec71319 100644 --- a/security/selinux/netport.c +++ b/security/selinux/netport.c @@ -150,7 +150,7 @@ static int sel_netport_sid_slow(u8 protocol, u16 pnum, u32 *sid) /* If this memory allocation fails still return 0. The SID * is valid, it just won't be added to the cache. */ - new = kmalloc(sizeof(*new), GFP_ATOMIC); + new = kmalloc_obj(*new, GFP_ATOMIC); if (new) { new->psec.port = pnum; new->psec.protocol = protocol; diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 4d58c7ad1a23..010499520d38 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -85,7 +85,7 @@ static int selinux_fs_info_create(struct super_block *sb) { struct selinux_fs_info *fsi; - fsi = kzalloc(sizeof(*fsi), GFP_KERNEL); + fsi = kzalloc_obj(*fsi, GFP_KERNEL); if (!fsi) return -ENOMEM; @@ -380,7 +380,7 @@ static int sel_open_policy(struct inode *inode, struct file *filp) goto err; rc = -ENOMEM; - plm = kzalloc(sizeof(*plm), GFP_KERNEL); + plm = kzalloc_obj(*plm, GFP_KERNEL); if (!plm) goto err; diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index 1bebfcb9c6a1..b238fa9756cf 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -165,8 +165,8 @@ void cond_policydb_destroy(struct policydb *p) int cond_init_bool_indexes(struct policydb *p) { kfree(p->bool_val_to_struct); - p->bool_val_to_struct = kmalloc_array( - p->p_bools.nprim, sizeof(*p->bool_val_to_struct), GFP_KERNEL); + p->bool_val_to_struct = kmalloc_objs(*p->bool_val_to_struct, + p->p_bools.nprim, GFP_KERNEL); if (!p->bool_val_to_struct) return -ENOMEM; @@ -214,7 +214,7 @@ int cond_read_bool(struct policydb *p, struct symtab *s, struct policy_file *fp) u32 len; int rc; - booldatum = kzalloc(sizeof(*booldatum), GFP_KERNEL); + booldatum = kzalloc_obj(*booldatum, GFP_KERNEL); if (!booldatum) return -ENOMEM; @@ -334,7 +334,7 @@ static int cond_read_av_list(struct policydb *p, struct policy_file *fp, if (len == 0) return 0; - list->nodes = kcalloc(len, sizeof(*list->nodes), GFP_KERNEL); + list->nodes = kzalloc_objs(*list->nodes, len, GFP_KERNEL); if (!list->nodes) return -ENOMEM; @@ -383,7 +383,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, struct pol /* expr */ len = le32_to_cpu(buf[1]); - node->expr.nodes = kcalloc(len, sizeof(*node->expr.nodes), GFP_KERNEL); + node->expr.nodes = kzalloc_objs(*node->expr.nodes, len, GFP_KERNEL); if (!node->expr.nodes) return -ENOMEM; @@ -421,7 +421,7 @@ int cond_read_list(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); - p->cond_list = kcalloc(len, sizeof(*p->cond_list), GFP_KERNEL); + p->cond_list = kzalloc_objs(*p->cond_list, len, GFP_KERNEL); if (!p->cond_list) return -ENOMEM; @@ -605,7 +605,7 @@ static int cond_dup_av_list(struct cond_av_list *new, memset(new, 0, sizeof(*new)); - new->nodes = kcalloc(orig->len, sizeof(*new->nodes), GFP_KERNEL); + new->nodes = kzalloc_objs(*new->nodes, orig->len, GFP_KERNEL); if (!new->nodes) return -ENOMEM; @@ -631,8 +631,8 @@ static int duplicate_policydb_cond_list(struct policydb *newp, return rc; newp->cond_list_len = 0; - newp->cond_list = kcalloc(origp->cond_list_len, - sizeof(*newp->cond_list), GFP_KERNEL); + newp->cond_list = kzalloc_objs(*newp->cond_list, origp->cond_list_len, + GFP_KERNEL); if (!newp->cond_list) goto error; @@ -710,9 +710,8 @@ static int duplicate_policydb_bools(struct policydb *newdb, struct cond_bool_datum **cond_bool_array; int rc; - cond_bool_array = kmalloc_array(orig->p_bools.nprim, - sizeof(*orig->bool_val_to_struct), - GFP_KERNEL); + cond_bool_array = kmalloc_objs(*orig->bool_val_to_struct, + orig->p_bools.nprim, GFP_KERNEL); if (!cond_bool_array) return -ENOMEM; diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c index 1382eb3bfde1..1eb542725c94 100644 --- a/security/selinux/ss/hashtab.c +++ b/security/selinux/ss/hashtab.c @@ -40,8 +40,8 @@ int hashtab_init(struct hashtab *h, u32 nel_hint) h->htable = NULL; if (size) { - h->htable = kcalloc(size, sizeof(*h->htable), - GFP_KERNEL | __GFP_NOWARN); + h->htable = kzalloc_objs(*h->htable, size, + GFP_KERNEL | __GFP_NOWARN); if (!h->htable) return -ENOMEM; h->size = size; @@ -149,7 +149,7 @@ int hashtab_duplicate(struct hashtab *new, const struct hashtab *orig, memset(new, 0, sizeof(*new)); - new->htable = kcalloc(orig->size, sizeof(*new->htable), GFP_KERNEL); + new->htable = kzalloc_objs(*new->htable, orig->size, GFP_KERNEL); if (!new->htable) return -ENOMEM; diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 91df3db6a88c..a96c671d0d51 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -390,7 +390,7 @@ static int roles_init(struct policydb *p) int rc; struct role_datum *role; - role = kzalloc(sizeof(*role), GFP_KERNEL); + role = kzalloc_obj(*role, GFP_KERNEL); if (!role) return -ENOMEM; @@ -738,24 +738,23 @@ static int policydb_index(struct policydb *p) avtab_hash_eval(&p->te_avtab, "rules"); symtab_hash_eval(p->symtab); - p->class_val_to_struct = kcalloc(p->p_classes.nprim, - sizeof(*p->class_val_to_struct), - GFP_KERNEL); + p->class_val_to_struct = kzalloc_objs(*p->class_val_to_struct, + p->p_classes.nprim, GFP_KERNEL); if (!p->class_val_to_struct) return -ENOMEM; - p->role_val_to_struct = kcalloc( - p->p_roles.nprim, sizeof(*p->role_val_to_struct), GFP_KERNEL); + p->role_val_to_struct = kzalloc_objs(*p->role_val_to_struct, + p->p_roles.nprim, GFP_KERNEL); if (!p->role_val_to_struct) return -ENOMEM; - p->user_val_to_struct = kcalloc( - p->p_users.nprim, sizeof(*p->user_val_to_struct), GFP_KERNEL); + p->user_val_to_struct = kzalloc_objs(*p->user_val_to_struct, + p->p_users.nprim, GFP_KERNEL); if (!p->user_val_to_struct) return -ENOMEM; - p->type_val_to_struct = kvcalloc( - p->p_types.nprim, sizeof(*p->type_val_to_struct), GFP_KERNEL); + p->type_val_to_struct = kvzalloc_objs(*p->type_val_to_struct, + p->p_types.nprim, GFP_KERNEL); if (!p->type_val_to_struct) return -ENOMEM; @@ -1131,7 +1130,7 @@ static int perm_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[2]; u32 len; - perdatum = kzalloc(sizeof(*perdatum), GFP_KERNEL); + perdatum = kzalloc_obj(*perdatum, GFP_KERNEL); if (!perdatum) return -ENOMEM; @@ -1164,7 +1163,7 @@ static int common_read(struct policydb *p, struct symtab *s, struct policy_file u32 i, len, nel; int rc; - comdatum = kzalloc(sizeof(*comdatum), GFP_KERNEL); + comdatum = kzalloc_obj(*comdatum, GFP_KERNEL); if (!comdatum) return -ENOMEM; @@ -1237,7 +1236,7 @@ static int read_cons_helper(struct policydb *p, struct constraint_node **nodep, lc = NULL; for (i = 0; i < ncons; i++) { - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) return -ENOMEM; @@ -1254,7 +1253,7 @@ static int read_cons_helper(struct policydb *p, struct constraint_node **nodep, le = NULL; depth = -1; for (j = 0; j < nexpr; j++) { - e = kzalloc(sizeof(*e), GFP_KERNEL); + e = kzalloc_obj(*e, GFP_KERNEL); if (!e) return -ENOMEM; @@ -1297,9 +1296,8 @@ static int read_cons_helper(struct policydb *p, struct constraint_node **nodep, return rc; if (p->policyvers >= POLICYDB_VERSION_CONSTRAINT_NAMES) { - e->type_names = - kzalloc(sizeof(*e->type_names), - GFP_KERNEL); + e->type_names = kzalloc_obj(*e->type_names, + GFP_KERNEL); if (!e->type_names) return -ENOMEM; type_set_init(e->type_names); @@ -1329,7 +1327,7 @@ static int class_read(struct policydb *p, struct symtab *s, struct policy_file * u32 i, len, len2, ncons, nel; int rc; - cladatum = kzalloc(sizeof(*cladatum), GFP_KERNEL); + cladatum = kzalloc_obj(*cladatum, GFP_KERNEL); if (!cladatum) return -ENOMEM; @@ -1427,7 +1425,7 @@ static int role_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[3]; u32 len; - role = kzalloc(sizeof(*role), GFP_KERNEL); + role = kzalloc_obj(*role, GFP_KERNEL); if (!role) return -ENOMEM; @@ -1484,7 +1482,7 @@ static int type_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[4]; u32 len; - typdatum = kzalloc(sizeof(*typdatum), GFP_KERNEL); + typdatum = kzalloc_obj(*typdatum, GFP_KERNEL); if (!typdatum) return -ENOMEM; @@ -1558,7 +1556,7 @@ static int user_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[3]; u32 len; - usrdatum = kzalloc(sizeof(*usrdatum), GFP_KERNEL); + usrdatum = kzalloc_obj(*usrdatum, GFP_KERNEL); if (!usrdatum) return -ENOMEM; @@ -1608,7 +1606,7 @@ static int sens_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[2]; u32 len; - levdatum = kzalloc(sizeof(*levdatum), GFP_KERNEL); + levdatum = kzalloc_obj(*levdatum, GFP_KERNEL); if (!levdatum) return -ENOMEM; @@ -1644,7 +1642,7 @@ static int cat_read(struct policydb *p, struct symtab *s, struct policy_file *fp __le32 buf[3]; u32 len; - catdatum = kzalloc(sizeof(*catdatum), GFP_KERNEL); + catdatum = kzalloc_obj(*catdatum, GFP_KERNEL); if (!catdatum) return -ENOMEM; @@ -1864,7 +1862,7 @@ static int range_read(struct policydb *p, struct policy_file *fp) for (i = 0; i < nel; i++) { rc = -ENOMEM; - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) goto out; @@ -1889,7 +1887,7 @@ static int range_read(struct policydb *p, struct policy_file *fp) goto out; rc = -ENOMEM; - r = kzalloc(sizeof(*r), GFP_KERNEL); + r = kzalloc_obj(*r, GFP_KERNEL); if (!r) goto out; @@ -1965,7 +1963,7 @@ static int filename_trans_read_helper_compat(struct policydb *p, struct policy_f } if (!datum) { rc = -ENOMEM; - datum = kmalloc(sizeof(*datum), GFP_KERNEL); + datum = kmalloc_obj(*datum, GFP_KERNEL); if (!datum) goto out; @@ -2040,7 +2038,7 @@ static int filename_trans_read_helper(struct policydb *p, struct policy_file *fp dst = &first; for (i = 0; i < ndatum; i++) { rc = -ENOMEM; - datum = kmalloc(sizeof(*datum), GFP_KERNEL); + datum = kmalloc_obj(*datum, GFP_KERNEL); if (!datum) goto out; @@ -2062,7 +2060,7 @@ static int filename_trans_read_helper(struct policydb *p, struct policy_file *fp } rc = -ENOMEM; - ft = kmalloc(sizeof(*ft), GFP_KERNEL); + ft = kmalloc_obj(*ft, GFP_KERNEL); if (!ft) goto out; @@ -2155,7 +2153,7 @@ static int genfs_read(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); rc = -ENOMEM; - newgenfs = kzalloc(sizeof(*newgenfs), GFP_KERNEL); + newgenfs = kzalloc_obj(*newgenfs, GFP_KERNEL); if (!newgenfs) goto out; @@ -2194,7 +2192,7 @@ static int genfs_read(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); rc = -ENOMEM; - newc = kzalloc(sizeof(*newc), GFP_KERNEL); + newc = kzalloc_obj(*newc, GFP_KERNEL); if (!newc) goto out; @@ -2266,7 +2264,7 @@ static int ocontext_read(struct policydb *p, l = NULL; for (j = 0; j < nel; j++) { rc = -ENOMEM; - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc_obj(*c, GFP_KERNEL); if (!c) goto out; if (l) @@ -2623,12 +2621,12 @@ int policydb_read(struct policydb *p, struct policy_file *fp) goto bad; for (i = 0; i < nel; i++) { rc = -ENOMEM; - rtk = kmalloc(sizeof(*rtk), GFP_KERNEL); + rtk = kmalloc_obj(*rtk, GFP_KERNEL); if (!rtk) goto bad; rc = -ENOMEM; - rtd = kmalloc(sizeof(*rtd), GFP_KERNEL); + rtd = kmalloc_obj(*rtd, GFP_KERNEL); if (!rtd) goto bad; @@ -2671,7 +2669,7 @@ int policydb_read(struct policydb *p, struct policy_file *fp) lra = NULL; for (i = 0; i < nel; i++) { rc = -ENOMEM; - ra = kzalloc(sizeof(*ra), GFP_KERNEL); + ra = kzalloc_obj(*ra, GFP_KERNEL); if (!ra) goto bad; if (lra) @@ -2726,8 +2724,8 @@ int policydb_read(struct policydb *p, struct policy_file *fp) goto bad; rc = -ENOMEM; - p->type_attr_map_array = kvcalloc( - p->p_types.nprim, sizeof(*p->type_attr_map_array), GFP_KERNEL); + p->type_attr_map_array = kvzalloc_objs(*p->type_attr_map_array, + p->p_types.nprim, GFP_KERNEL); if (!p->type_attr_map_array) goto bad; diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 13fc712d5923..6f20e941c059 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -108,7 +108,7 @@ static int selinux_set_mapping(struct policydb *pol, i++; /* Allocate space for the class records, plus one for class zero */ - out_map->mapping = kcalloc(++i, sizeof(*out_map->mapping), GFP_ATOMIC); + out_map->mapping = kzalloc_objs(*out_map->mapping, ++i, GFP_ATOMIC); if (!out_map->mapping) return -ENOMEM; @@ -2312,11 +2312,11 @@ int security_load_policy(void *data, size_t len, int rc = 0; struct policy_file file = { data, len }, *fp = &file; - newpolicy = kzalloc(sizeof(*newpolicy), GFP_KERNEL); + newpolicy = kzalloc_obj(*newpolicy, GFP_KERNEL); if (!newpolicy) return -ENOMEM; - newpolicy->sidtab = kzalloc(sizeof(*newpolicy->sidtab), GFP_KERNEL); + newpolicy->sidtab = kzalloc_obj(*newpolicy->sidtab, GFP_KERNEL); if (!newpolicy->sidtab) { rc = -ENOMEM; goto err_policy; @@ -2360,7 +2360,7 @@ int security_load_policy(void *data, size_t len, * in the new SID table. */ - convert_data = kmalloc(sizeof(*convert_data), GFP_KERNEL); + convert_data = kmalloc_obj(*convert_data, GFP_KERNEL); if (!convert_data) { rc = -ENOMEM; goto err_free_isids; @@ -3065,7 +3065,7 @@ int security_get_bools(struct selinux_policy *policy, goto err; rc = -ENOMEM; - *values = kcalloc(*len, sizeof(int), GFP_ATOMIC); + *values = kzalloc_objs(int, *len, GFP_ATOMIC); if (!*values) goto err; @@ -3629,7 +3629,7 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule, return -EINVAL; } - tmprule = kzalloc(sizeof(struct selinux_audit_rule), gfp); + tmprule = kzalloc_obj(struct selinux_audit_rule, gfp); if (!tmprule) return -ENOMEM; context_init(&tmprule->au_ctxt); @@ -3844,7 +3844,7 @@ static void security_netlbl_cache_add(struct netlbl_lsm_secattr *secattr, { u32 *sid_cache; - sid_cache = kmalloc(sizeof(*sid_cache), GFP_ATOMIC); + sid_cache = kmalloc_obj(*sid_cache, GFP_ATOMIC); if (sid_cache == NULL) return; secattr->cache = netlbl_secattr_cache_alloc(GFP_ATOMIC); diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c index 59f8c09158ef..118af0aa2767 100644 --- a/security/selinux/ss/sidtab.c +++ b/security/selinux/ss/sidtab.c @@ -580,7 +580,7 @@ void sidtab_sid2str_put(struct sidtab *s, struct sidtab_entry *entry, goto out_unlock; } - cache = kmalloc(struct_size(cache, str, str_len), GFP_ATOMIC); + cache = kmalloc_flex(*cache, str, str_len, GFP_ATOMIC); if (!cache) goto out_unlock; diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index 61d56b0c2be1..8e00b3306574 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c @@ -88,7 +88,7 @@ static int selinux_xfrm_alloc_user(struct xfrm_sec_ctx **ctxp, if (str_len >= PAGE_SIZE) return -ENOMEM; - ctx = kmalloc(struct_size(ctx, ctx_str, str_len + 1), gfp); + ctx = kmalloc_flex(*ctx, ctx_str, str_len + 1, gfp); if (!ctx) return -ENOMEM; @@ -354,7 +354,7 @@ int selinux_xfrm_state_alloc_acquire(struct xfrm_state *x, if (rc) return rc; - ctx = kmalloc(struct_size(ctx, ctx_str, str_len), GFP_ATOMIC); + ctx = kmalloc_flex(*ctx, ctx_str, str_len, GFP_ATOMIC); if (!ctx) { rc = -ENOMEM; goto out; diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index 86ad910d5631..350b88d582b3 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c @@ -592,7 +592,7 @@ smk_import_allocated_label(char *smack, gfp_t gfp) if (skp != NULL) goto freeout; - skp = kzalloc(sizeof(*skp), gfp); + skp = kzalloc_obj(*skp, gfp); if (skp == NULL) { skp = ERR_PTR(-ENOMEM); goto freeout; diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index a0bd4919a9d9..e2add0c8c739 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -372,7 +372,7 @@ static int smk_copy_relabel(struct list_head *nhead, struct list_head *ohead, struct smack_known_list_elem *oklep; list_for_each_entry(oklep, ohead, list) { - nklep = kzalloc(sizeof(struct smack_known_list_elem), gfp); + nklep = kzalloc_obj(struct smack_known_list_elem, gfp); if (nklep == NULL) { smk_destroy_label_list(nhead); return -ENOMEM; @@ -562,7 +562,7 @@ static int smack_add_opt(int token, const char *s, void **mnt_opts) struct smack_known *skp; if (!opts) { - opts = kzalloc(sizeof(struct smack_mnt_opts), GFP_KERNEL); + opts = kzalloc_obj(struct smack_mnt_opts, GFP_KERNEL); if (!opts) return -ENOMEM; *mnt_opts = opts; @@ -622,7 +622,7 @@ static int smack_fs_context_submount(struct fs_context *fc, struct smack_mnt_opts *ctx; struct inode_smack *isp; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kzalloc_obj(*ctx, GFP_KERNEL); if (!ctx) return -ENOMEM; fc->security = ctx; @@ -673,7 +673,7 @@ static int smack_fs_context_dup(struct fs_context *fc, if (!src) return 0; - fc->security = kzalloc(sizeof(struct smack_mnt_opts), GFP_KERNEL); + fc->security = kzalloc_obj(struct smack_mnt_opts, GFP_KERNEL); if (!fc->security) return -ENOMEM; @@ -2817,7 +2817,7 @@ static void smk_ipv6_port_label(struct socket *sock, struct sockaddr *address) /* * A new port entry is required. */ - spp = kzalloc(sizeof(*spp), GFP_KERNEL); + spp = kzalloc_obj(*spp, GFP_KERNEL); if (spp == NULL) return; diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 8919e330d2f6..35b98f11e32d 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -682,7 +682,7 @@ smk_cipso_doi(u32 ndoi, gfp_t gfp_flags) smk_netlabel_audit_set(&nai); - doip = kmalloc(sizeof(struct cipso_v4_doi), gfp_flags); + doip = kmalloc_obj(struct cipso_v4_doi, gfp_flags); if (!doip) { rc = -ENOMEM; goto clr_doi_lock; @@ -1249,7 +1249,7 @@ static ssize_t smk_write_net4addr(struct file *file, const char __user *buf, smk_netlabel_audit_set(&audit_info); if (found == 0) { - snp = kzalloc(sizeof(*snp), GFP_KERNEL); + snp = kzalloc_obj(*snp, GFP_KERNEL); if (snp == NULL) rc = -ENOMEM; else { @@ -1526,7 +1526,7 @@ static ssize_t smk_write_net6addr(struct file *file, const char __user *buf, break; } if (found == 0) { - snp = kzalloc(sizeof(*snp), GFP_KERNEL); + snp = kzalloc_obj(*snp, GFP_KERNEL); if (snp == NULL) rc = -ENOMEM; else { @@ -1970,7 +1970,7 @@ static int smk_parse_label_list(char *data, struct list_head *list) if (IS_ERR(skp)) return PTR_ERR(skp); - sklep = kzalloc(sizeof(*sklep), GFP_KERNEL); + sklep = kzalloc_obj(*sklep, GFP_KERNEL); if (sklep == NULL) return -ENOMEM; diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c index 610c1536cf70..bfacb3f2e2ed 100644 --- a/security/tomoyo/audit.c +++ b/security/tomoyo/audit.c @@ -376,7 +376,7 @@ void tomoyo_write_log2(struct tomoyo_request_info *r, int len, const char *fmt, buf = tomoyo_init_log(r, len, fmt, args); if (!buf) goto out; - entry = kzalloc(sizeof(*entry), GFP_NOFS); + entry = kzalloc_obj(*entry, GFP_NOFS); if (!entry) { kfree(buf); goto out; diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 7e1f825d903b..fdaeaff01fc1 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -493,7 +493,7 @@ static struct tomoyo_profile *tomoyo_assign_profile ptr = ns->profile_ptr[profile]; if (ptr) return ptr; - entry = kzalloc(sizeof(*entry), GFP_NOFS | __GFP_NOWARN); + entry = kzalloc_obj(*entry, GFP_NOFS | __GFP_NOWARN); if (mutex_lock_interruptible(&tomoyo_policy_lock)) goto out; ptr = ns->profile_ptr[profile]; @@ -2553,7 +2553,7 @@ static int tomoyo_write_stat(struct tomoyo_io_buffer *head) */ int tomoyo_open_control(const u8 type, struct file *file) { - struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_NOFS); + struct tomoyo_io_buffer *head = kzalloc_obj(*head, GFP_NOFS); if (!head) return -ENOMEM; diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 0612eac7f2f2..eeaad421f15b 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c @@ -708,7 +708,7 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm) bool reject_on_transition_failure = false; const struct tomoyo_path_info *candidate; struct tomoyo_path_info exename; - struct tomoyo_execve *ee = kzalloc(sizeof(*ee), GFP_NOFS); + struct tomoyo_execve *ee = kzalloc_obj(*ee, GFP_NOFS); if (!ee) return -ENOMEM; diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 38b21ee0c560..57fd421f8c31 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c @@ -89,7 +89,7 @@ static void report_access(const char *access, struct task_struct *target, return; } - info = kmalloc(sizeof(*info), GFP_ATOMIC); + info = kmalloc_obj(*info, GFP_ATOMIC); if (!info) return; init_task_work(&info->work, __report_access); @@ -143,7 +143,7 @@ static int yama_ptracer_add(struct task_struct *tracer, { struct ptrace_relation *relation, *added; - added = kmalloc(sizeof(*added), GFP_KERNEL); + added = kmalloc_obj(*added, GFP_KERNEL); if (!added) return -ENOMEM; diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index bb9b795e0226..0dda1f4d5cbd 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -104,7 +104,7 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, struct ac97_codec_device *codec; int ret; - codec = kzalloc(sizeof(*codec), GFP_KERNEL); + codec = kzalloc_obj(*codec, GFP_KERNEL); if (!codec) return -ENOMEM; ac97_ctrl->codecs[idx] = codec; @@ -351,7 +351,7 @@ struct ac97_controller *snd_ac97_controller_register( struct ac97_controller *ac97_ctrl; int ret, i; - ac97_ctrl = kzalloc(sizeof(*ac97_ctrl), GFP_KERNEL); + ac97_ctrl = kzalloc_obj(*ac97_ctrl, GFP_KERNEL); if (!ac97_ctrl) return ERR_PTR(-ENOMEM); diff --git a/sound/ac97/snd_ac97_compat.c b/sound/ac97/snd_ac97_compat.c index d2479bba75bf..e6c43556c8f6 100644 --- a/sound/ac97/snd_ac97_compat.c +++ b/sound/ac97/snd_ac97_compat.c @@ -69,7 +69,7 @@ struct snd_ac97 *snd_ac97_compat_alloc(struct ac97_codec_device *adev) struct snd_ac97 *ac97; int ret; - ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); + ac97 = kzalloc_obj(struct snd_ac97, GFP_KERNEL); if (ac97 == NULL) return ERR_PTR(-ENOMEM); diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index 4cf959017c9d..bce8b35c5c27 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -855,7 +855,8 @@ static int onyx_init_codec(struct aoa_codec *codec) /* if no inputs are present... */ if ((onyx->codec.connected & 0xC) == 0) { if (!onyx->codec_info) - onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL); + onyx->codec_info = kmalloc_obj(struct codec_info, + GFP_KERNEL); if (!onyx->codec_info) return -ENOMEM; ci = onyx->codec_info; @@ -866,7 +867,8 @@ static int onyx_init_codec(struct aoa_codec *codec) /* if no outputs are present... */ if ((onyx->codec.connected & 3) == 0) { if (!onyx->codec_info) - onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL); + onyx->codec_info = kmalloc_obj(struct codec_info, + GFP_KERNEL); if (!onyx->codec_info) return -ENOMEM; ci = onyx->codec_info; @@ -957,7 +959,7 @@ static int onyx_i2c_probe(struct i2c_client *client) struct onyx *onyx; u8 dummy; - onyx = kzalloc(sizeof(struct onyx), GFP_KERNEL); + onyx = kzalloc_obj(struct onyx, GFP_KERNEL); if (!onyx) return -ENOMEM; diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c index 7085e0b93e29..9c9b35cb5b6a 100644 --- a/sound/aoa/codecs/tas.c +++ b/sound/aoa/codecs/tas.c @@ -845,7 +845,7 @@ static int tas_i2c_probe(struct i2c_client *client) struct device_node *node = client->dev.of_node; struct tas *tas; - tas = kzalloc(sizeof(struct tas), GFP_KERNEL); + tas = kzalloc_obj(struct tas, GFP_KERNEL); if (!tas) return -ENOMEM; diff --git a/sound/aoa/codecs/toonie.c b/sound/aoa/codecs/toonie.c index b59967c49e0a..19653cf19292 100644 --- a/sound/aoa/codecs/toonie.c +++ b/sound/aoa/codecs/toonie.c @@ -121,7 +121,7 @@ static struct toonie *toonie; static int __init toonie_init(void) { - toonie = kzalloc(sizeof(struct toonie), GFP_KERNEL); + toonie = kzalloc_obj(struct toonie, GFP_KERNEL); if (!toonie) return -ENOMEM; diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c index e76bde25e41a..155a503e1e9b 100644 --- a/sound/aoa/core/gpio-pmf.c +++ b/sound/aoa/core/gpio-pmf.c @@ -173,8 +173,7 @@ static int pmf_set_notify(struct gpio_runtime *rt, notif->gpio_private = NULL; } if (!old && notify) { - irq_client = kzalloc(sizeof(struct pmf_irq_client), - GFP_KERNEL); + irq_client = kzalloc_obj(struct pmf_irq_client, GFP_KERNEL); if (!irq_client) return -ENOMEM; irq_client->data = notif; diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index bb2a0ef3004b..0b73ecda1b1d 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -1025,7 +1025,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) goto outnodev; } - ldev = kzalloc(sizeof(struct layout_dev), GFP_KERNEL); + ldev = kzalloc_obj(struct layout_dev, GFP_KERNEL); if (!ldev) goto outnodev; diff --git a/sound/aoa/soundbus/i2sbus/control.c b/sound/aoa/soundbus/i2sbus/control.c index a003ef06de63..09e5070e0ae2 100644 --- a/sound/aoa/soundbus/i2sbus/control.c +++ b/sound/aoa/soundbus/i2sbus/control.c @@ -19,7 +19,7 @@ int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c) { - *c = kzalloc(sizeof(struct i2sbus_control), GFP_KERNEL); + *c = kzalloc_obj(struct i2sbus_control, GFP_KERNEL); if (!*c) return -ENOMEM; diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index f4d43c854bbd..8941f3266947 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -171,7 +171,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, if (strncmp(node_name, "i2s-", 4)) return 0; - dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL); + dev = kzalloc_obj(struct i2sbus_dev, GFP_KERNEL); if (!dev) return 0; diff --git a/sound/aoa/soundbus/i2sbus/pcm.c b/sound/aoa/soundbus/i2sbus/pcm.c index 4c480ad2c05d..ceee3320a932 100644 --- a/sound/aoa/soundbus/i2sbus/pcm.c +++ b/sound/aoa/soundbus/i2sbus/pcm.c @@ -879,7 +879,7 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card, tmp++; } - cii = kzalloc(sizeof(struct codec_info_item), GFP_KERNEL); + cii = kzalloc_obj(struct codec_info_item, GFP_KERNEL); if (!cii) return -ENOMEM; diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index ed2eeb914c6d..27d916c8fb29 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -519,7 +519,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) return -ENXIO; struct snd_compr_codec_caps *caps __free(kfree) = - kzalloc(sizeof(*caps), GFP_KERNEL); + kzalloc_obj(*caps, GFP_KERNEL); if (!caps) return -ENOMEM; @@ -539,7 +539,7 @@ int snd_compr_malloc_pages(struct snd_compr_stream *stream, size_t size) if (snd_BUG_ON(!(stream) || !(stream)->runtime)) return -EINVAL; - dmab = kzalloc(sizeof(*dmab), GFP_KERNEL); + dmab = kzalloc_obj(*dmab, GFP_KERNEL); if (!dmab) return -ENOMEM; dmab->dev = stream->dma_buffer.dev; @@ -694,7 +694,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg) return -EBADFD; struct snd_codec *params __free(kfree) = - kzalloc(sizeof(*params), GFP_KERNEL); + kzalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; retval = stream->ops->get_params(stream, params); @@ -1066,7 +1066,7 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_ return -EBUSY; if (utask->origin_seqno != 0 || utask->input_size != 0) return -EINVAL; - task = kzalloc(sizeof(*task), GFP_KERNEL); + task = kzalloc_obj(*task, GFP_KERNEL); if (task == NULL) return -ENOMEM; task->seqno = utask->seqno = snd_compr_seqno_next(stream); diff --git a/sound/core/control.c b/sound/core/control.c index 486d1bc4dac2..eb4a3c1214fb 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -233,7 +233,7 @@ static int snd_ctl_new(struct snd_kcontrol **kctl, unsigned int count, if (count == 0 || count > MAX_CONTROL_COUNT) return -EINVAL; - *kctl = kzalloc(struct_size(*kctl, vd, count), GFP_KERNEL); + *kctl = kzalloc_flex(**kctl, vd, count, GFP_KERNEL); if (!*kctl) return -ENOMEM; @@ -2057,7 +2057,7 @@ static int _snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn, struct list_head * { struct snd_kctl_ioctl *pn; - pn = kzalloc(sizeof(struct snd_kctl_ioctl), GFP_KERNEL); + pn = kzalloc_obj(struct snd_kctl_ioctl, GFP_KERNEL); if (pn == NULL) return -ENOMEM; pn->fioctl = fcn; diff --git a/sound/core/control_compat.c b/sound/core/control_compat.c index b8988a4bcd9b..174395322c51 100644 --- a/sound/core/control_compat.c +++ b/sound/core/control_compat.c @@ -82,7 +82,7 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl, struct snd_card *card = ctl->card; int err; struct snd_ctl_elem_info *data __free(kfree) = - kzalloc(sizeof(*data), GFP_KERNEL); + kzalloc_obj(*data, GFP_KERNEL); if (! data) return -ENOMEM; @@ -177,7 +177,7 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id, return -ENOENT; struct snd_ctl_elem_info *info __free(kfree) = - kzalloc(sizeof(*info), GFP_KERNEL); + kzalloc_obj(*info, GFP_KERNEL); if (info == NULL) return -ENOMEM; info->id = *id; @@ -283,7 +283,7 @@ static int __ctl_elem_read_user(struct snd_card *card, { int err, type, count; struct snd_ctl_elem_value *data __free(kfree) = - kzalloc(sizeof(*data), GFP_KERNEL); + kzalloc_obj(*data, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -318,7 +318,7 @@ static int __ctl_elem_write_user(struct snd_ctl_file *file, struct snd_card *card = file->card; int err, type, count; struct snd_ctl_elem_value *data __free(kfree) = - kzalloc(sizeof(*data), GFP_KERNEL); + kzalloc_obj(*data, GFP_KERNEL); if (data == NULL) return -ENOMEM; @@ -380,7 +380,7 @@ static int snd_ctl_elem_add_compat(struct snd_ctl_file *file, int replace) { struct snd_ctl_elem_info *data __free(kfree) = - kzalloc(sizeof(*data), GFP_KERNEL); + kzalloc_obj(*data, GFP_KERNEL); if (! data) return -ENOMEM; diff --git a/sound/core/control_led.c b/sound/core/control_led.c index c7641d5084e7..07eebf849ae3 100644 --- a/sound/core/control_led.c +++ b/sound/core/control_led.c @@ -653,7 +653,7 @@ static void snd_ctl_led_sysfs_add(struct snd_card *card) for (group = 0; group < MAX_LED; group++) { led = &snd_ctl_leds[group]; - led_card = kzalloc(sizeof(*led_card), GFP_KERNEL); + led_card = kzalloc_obj(*led_card, GFP_KERNEL); if (!led_card) goto cerr2; led_card->number = card->number; diff --git a/sound/core/device.c b/sound/core/device.c index cdc5af526739..80c02914877f 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -34,7 +34,7 @@ int snd_device_new(struct snd_card *card, enum snd_device_type type, if (snd_BUG_ON(!card || !device_data || !ops)) return -ENXIO; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; INIT_LIST_HEAD(&dev->list); diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c index 2d5f4d47071f..a98de8d9ce16 100644 --- a/sound/core/hrtimer.c +++ b/sound/core/hrtimer.c @@ -64,7 +64,7 @@ static int snd_hrtimer_open(struct snd_timer *t) { struct snd_hrtimer *stime; - stime = kzalloc(sizeof(*stime), GFP_KERNEL); + stime = kzalloc_obj(*stime, GFP_KERNEL); if (!stime) return -ENOMEM; stime->timer = t; diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 09200df2932c..a493db2160ed 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -375,7 +375,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, return -ENXIO; if (rhwdep) *rhwdep = NULL; - hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); + hwdep = kzalloc_obj(*hwdep, GFP_KERNEL); if (!hwdep) return -ENOMEM; diff --git a/sound/core/info.c b/sound/core/info.c index 1f5b8a3d9e3b..de8ec34360ee 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -79,7 +79,7 @@ static int alloc_info_private(struct snd_info_entry *entry, return -ENODEV; if (!try_module_get(entry->module)) return -EFAULT; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) { module_put(entry->module); return -ENOMEM; @@ -311,7 +311,7 @@ static ssize_t snd_info_text_entry_write(struct file *file, guard(mutex)(&entry->access); buf = data->wbuffer; if (!buf) { - data->wbuffer = buf = kzalloc(sizeof(*buf), GFP_KERNEL); + data->wbuffer = buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return -ENOMEM; } @@ -355,7 +355,7 @@ static int snd_info_text_entry_open(struct inode *inode, struct file *file) if (err < 0) return err; - data->rbuffer = kzalloc(sizeof(*data->rbuffer), GFP_KERNEL); + data->rbuffer = kzalloc_obj(*data->rbuffer, GFP_KERNEL); if (!data->rbuffer) { err = -ENOMEM; goto error; @@ -663,7 +663,7 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent, struct module *module) { struct snd_info_entry *entry; - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (entry == NULL) return NULL; entry->name = kstrdup(name, GFP_KERNEL); diff --git a/sound/core/init.c b/sound/core/init.c index c372b3228785..84c11bd49a95 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -129,7 +129,7 @@ int snd_device_alloc(struct device **dev_p, struct snd_card *card) struct device *dev; *dev_p = NULL; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (!dev) return -ENOMEM; device_initialize(dev); @@ -1060,7 +1060,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file) { struct snd_monitor_file *mfile; - mfile = kmalloc(sizeof(*mfile), GFP_KERNEL); + mfile = kmalloc_obj(*mfile, GFP_KERNEL); if (mfile == NULL) return -ENOMEM; mfile->file = file; diff --git a/sound/core/jack.c b/sound/core/jack.c index 93e357a23f17..7160c260d06c 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -440,7 +440,7 @@ static struct snd_jack_kctl * snd_jack_kctl_new(struct snd_card *card, const cha if (err < 0) return NULL; - jack_kctl = kzalloc(sizeof(*jack_kctl), GFP_KERNEL); + jack_kctl = kzalloc_obj(*jack_kctl, GFP_KERNEL); if (!jack_kctl) goto error; @@ -516,7 +516,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, return -ENOMEM; } - jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL); + jack = kzalloc_obj(struct snd_jack, GFP_KERNEL); if (jack == NULL) return -ENOMEM; diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index b3853583d2ae..bb483a2d7ff2 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -719,12 +719,12 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) unsigned int idx, npages; void *p; - sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); + sgbuf = kzalloc_obj(*sgbuf, GFP_KERNEL); if (!sgbuf) return NULL; size = PAGE_ALIGN(size); sgbuf->count = size >> PAGE_SHIFT; - sgbuf->pages = kvcalloc(sgbuf->count, sizeof(*sgbuf->pages), GFP_KERNEL); + sgbuf->pages = kvzalloc_objs(*sgbuf->pages, sgbuf->count, GFP_KERNEL); sgbuf->npages = kvcalloc(sgbuf->count, sizeof(*sgbuf->npages), GFP_KERNEL); if (!sgbuf->pages || !sgbuf->npages) goto error; diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f4ad0bfb4dac..05c8e44cd428 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -47,7 +47,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file) snd_card_unref(card); return err; } - fmixer = kzalloc(sizeof(*fmixer), GFP_KERNEL); + fmixer = kzalloc_obj(*fmixer, GFP_KERNEL); if (fmixer == NULL) { snd_card_file_remove(card, file); snd_card_unref(card); @@ -530,9 +530,9 @@ static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -566,9 +566,9 @@ static void snd_mixer_oss_get_volume1_sw(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -629,9 +629,9 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -669,9 +669,9 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -798,9 +798,9 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned int err, idx; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return -ENOMEM; guard(rwsem_read)(&card->controls_rwsem); @@ -843,9 +843,9 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned unsigned int idx; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (uinfo == NULL || uctl == NULL) return -ENOMEM; guard(rwsem_read)(&card->controls_rwsem); @@ -1027,7 +1027,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); if (kctl) { struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc(sizeof(*uinfo), GFP_KERNEL); + kzalloc_obj(*uinfo, GFP_KERNEL); if (!uinfo) return -ENOMEM; @@ -1055,7 +1055,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, } } if (slot.present != 0) { - pslot = kmalloc(sizeof(slot), GFP_KERNEL); + pslot = kmalloc_obj(slot, GFP_KERNEL); if (! pslot) return -ENOMEM; *pslot = slot; @@ -1315,7 +1315,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd) if (cmd == SND_MIXER_OSS_NOTIFY_REGISTER) { int idx, err; - mixer = kcalloc(2, sizeof(*mixer), GFP_KERNEL); + mixer = kzalloc_objs(*mixer, 2, GFP_KERNEL); if (mixer == NULL) return -ENOMEM; mutex_init(&mixer->reg_mutex); diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 3bc94d34b35e..cf3509c2be15 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -398,7 +398,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, } struct snd_pcm_hw_params *save __free(kfree) = - kmalloc(sizeof(*save), GFP_KERNEL); + kmalloc_obj(*save, GFP_KERNEL); if (save == NULL) return -ENOMEM; *save = *params; @@ -411,7 +411,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, goto _end; struct snd_pcm_hw_params *params1 __free(kfree) = - kmalloc(sizeof(*params1), GFP_KERNEL); + kmalloc_obj(*params1, GFP_KERNEL); if (params1 == NULL) return -ENOMEM; *params1 = *save; @@ -786,7 +786,7 @@ static int choose_rate(struct snd_pcm_substream *substream, unsigned int rate, prev; struct snd_pcm_hw_params *save __free(kfree) = - kmalloc(sizeof(*save), GFP_KERNEL); + kmalloc_obj(*save, GFP_KERNEL); if (save == NULL) return -ENOMEM; *save = *params; @@ -861,9 +861,9 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) if (!runtime->oss.params) return 0; - sw_params = kzalloc(sizeof(*sw_params), GFP_KERNEL); - params = kmalloc(sizeof(*params), GFP_KERNEL); - sparams = kmalloc(sizeof(*sparams), GFP_KERNEL); + sw_params = kzalloc_obj(*sw_params, GFP_KERNEL); + params = kmalloc_obj(*params, GFP_KERNEL); + sparams = kmalloc_obj(*sparams, GFP_KERNEL); if (!sw_params || !params || !sparams) { err = -ENOMEM; goto failure; @@ -1859,7 +1859,7 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file) AFMT_S24_PACKED; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc(sizeof(*params), GFP_KERNEL); + kmalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; _snd_pcm_hw_params_any(params); @@ -2418,7 +2418,7 @@ static int snd_pcm_oss_open_file(struct file *file, if (rpcm_oss_file) *rpcm_oss_file = NULL; - pcm_oss_file = kzalloc(sizeof(*pcm_oss_file), GFP_KERNEL); + pcm_oss_file = kzalloc_obj(*pcm_oss_file, GFP_KERNEL); if (pcm_oss_file == NULL) return -ENOMEM; @@ -3032,7 +3032,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, } } while (*str); if (setup == NULL) { - setup = kmalloc(sizeof(*setup), GFP_KERNEL); + setup = kmalloc_obj(*setup, GFP_KERNEL); if (! setup) { buffer->error = -ENOMEM; return; diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index a4c8c9f538f1..e5a0e3c79f7e 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -163,7 +163,8 @@ int snd_pcm_plugin_build(struct snd_pcm_substream *plug, channels = src_format->channels; else channels = dst_format->channels; - plugin->buf_channels = kcalloc(channels, sizeof(*plugin->buf_channels), GFP_KERNEL); + plugin->buf_channels = kzalloc_objs(*plugin->buf_channels, channels, + GFP_KERNEL); if (plugin->buf_channels == NULL) { snd_pcm_plugin_free(plugin); return -ENOMEM; diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 0b512085eb63..e3c43b365207 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -334,7 +334,7 @@ static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, return; struct snd_pcm_info *info __free(kfree) = - kmalloc(sizeof(*info), GFP_KERNEL); + kmalloc_obj(*info, GFP_KERNEL); if (!info) return; @@ -657,7 +657,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) } prev = NULL; for (idx = 0, prev = NULL; idx < substream_count; idx++) { - substream = kzalloc(sizeof(*substream), GFP_KERNEL); + substream = kzalloc_obj(*substream, GFP_KERNEL); if (!substream) return -ENOMEM; substream->pcm = pcm; @@ -713,7 +713,7 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, return -ENXIO; if (rpcm) *rpcm = NULL; - pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); + pcm = kzalloc_obj(*pcm, GFP_KERNEL); if (!pcm) return -ENOMEM; pcm->card = card; @@ -935,7 +935,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, if (substream == NULL) return -EAGAIN; - runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); + runtime = kzalloc_obj(*runtime, GFP_KERNEL); if (runtime == NULL) return -ENOMEM; diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index e86f68f1f23c..71c74830083e 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -243,7 +243,7 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, return -ENOTTY; struct snd_pcm_hw_params *data __free(kfree) = - kmalloc(sizeof(*data), GFP_KERNEL); + kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index f0c17503df42..cc6ce33f4ff7 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -318,7 +318,7 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, if (ret < 0) return ret; - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (!prtd) return -ENOMEM; diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6eaa950504cf..70f279865adc 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -2601,7 +2601,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, if (WARN_ON(pcm->streams[stream].chmap_kctl)) return -EBUSY; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->pcm = pcm; diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 56725d36825b..2ef02871f84f 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -448,7 +448,7 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) /* dma_max=0 means the fixed size preallocation */ if (substream->dma_buffer.area && !substream->dma_max) return -ENOMEM; - dmab = kzalloc(sizeof(*dmab), GFP_KERNEL); + dmab = kzalloc_obj(*dmab, GFP_KERNEL); if (! dmab) return -ENOMEM; dmab->dev = substream->dma_buffer.dev; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 0a358d94b17c..a7e24be8c7db 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -244,7 +244,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, { int err; struct snd_pcm_info *info __free(kfree) = - kmalloc(sizeof(*info), GFP_KERNEL); + kmalloc_obj(*info, GFP_KERNEL); if (! info) return -ENOMEM; @@ -2812,7 +2812,7 @@ static int snd_pcm_open_file(struct file *file, if (err < 0) return err; - pcm_file = kzalloc(sizeof(*pcm_file), GFP_KERNEL); + pcm_file = kzalloc_obj(*pcm_file, GFP_KERNEL); if (pcm_file == NULL) { snd_pcm_release_substream(substream); return -ENOMEM; @@ -4111,7 +4111,7 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream, int err; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc(sizeof(*params), GFP_KERNEL); + kmalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; @@ -4140,7 +4140,7 @@ static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream, int err; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc(sizeof(*params), GFP_KERNEL); + kmalloc_obj(*params, GFP_KERNEL); if (!params) return -ENOMEM; diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 8969ee2757f1..ae93d968e083 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -159,7 +159,7 @@ static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) { struct snd_rawmidi_runtime *runtime; - runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); + runtime = kzalloc_obj(*runtime, GFP_KERNEL); if (!runtime) return -ENOMEM; runtime->substream = substream; @@ -472,7 +472,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) fflags = snd_rawmidi_file_flags(file); if ((file->f_flags & O_APPEND) || maj == SOUND_MAJOR) /* OSS emul? */ fflags |= SNDRV_RAWMIDI_LFLG_APPEND; - rawmidi_file = kmalloc(sizeof(*rawmidi_file), GFP_KERNEL); + rawmidi_file = kmalloc_obj(*rawmidi_file, GFP_KERNEL); if (rawmidi_file == NULL) { err = -ENOMEM; goto __error; @@ -1803,7 +1803,7 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, int idx; for (idx = 0; idx < count; idx++) { - substream = kzalloc(sizeof(*substream), GFP_KERNEL); + substream = kzalloc_obj(*substream, GFP_KERNEL); if (!substream) return -ENOMEM; substream->stream = direction; @@ -1891,7 +1891,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, if (rrawmidi) *rrawmidi = NULL; - rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL); + rmidi = kzalloc_obj(*rmidi, GFP_KERNEL); if (!rmidi) return -ENOMEM; err = snd_rawmidi_init(rmidi, card, id, device, diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index e0c368bd09cb..af8e14325239 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -65,7 +65,7 @@ snd_seq_oss_create_client(void) int rc; struct snd_seq_port_callback port_callback; struct snd_seq_port_info *port __free(kfree) = - kzalloc(sizeof(*port), GFP_KERNEL); + kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -168,7 +168,7 @@ snd_seq_oss_open(struct file *file, int level) int i, rc; struct seq_oss_devinfo *dp; - dp = kzalloc(sizeof(*dp), GFP_KERNEL); + dp = kzalloc_obj(*dp, GFP_KERNEL); if (!dp) return -ENOMEM; diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c index 2d48c25ff4df..989e9a7069e3 100644 --- a/sound/core/seq/oss/seq_oss_midi.c +++ b/sound/core/seq/oss/seq_oss_midi.c @@ -66,9 +66,9 @@ int snd_seq_oss_midi_lookup_ports(int client) { struct snd_seq_client_info *clinfo __free(kfree) = - kzalloc(sizeof(*clinfo), GFP_KERNEL); + kzalloc_obj(*clinfo, GFP_KERNEL); struct snd_seq_port_info *pinfo __free(kfree) = - kzalloc(sizeof(*pinfo), GFP_KERNEL); + kzalloc_obj(*pinfo, GFP_KERNEL); if (!clinfo || !pinfo) return -ENOMEM; @@ -153,7 +153,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo) /* * allocate midi info record */ - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + mdev = kzalloc_obj(*mdev, GFP_KERNEL); if (!mdev) return -ENOMEM; diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c index bbaf72e70b35..014efc191c71 100644 --- a/sound/core/seq/oss/seq_oss_readq.c +++ b/sound/core/seq/oss/seq_oss_readq.c @@ -34,11 +34,11 @@ snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen) { struct seq_oss_readq *q; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; - q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL); + q->q = kzalloc_objs(union evrec, maxlen, GFP_KERNEL); if (!q->q) { kfree(q); return NULL; diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c index c7f81f2053a7..b19b8756638d 100644 --- a/sound/core/seq/oss/seq_oss_synth.c +++ b/sound/core/seq/oss/seq_oss_synth.c @@ -213,7 +213,8 @@ snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp) } info->nr_voices = rec->nr_voices; if (info->nr_voices > 0) { - info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL); + info->ch = kzalloc_objs(struct seq_oss_chinfo, + info->nr_voices, GFP_KERNEL); if (!info->ch) { rec->oper.close(&info->arg); module_put(rec->oper.owner); diff --git a/sound/core/seq/oss/seq_oss_timer.c b/sound/core/seq/oss/seq_oss_timer.c index f9f57232a83f..32f1ff225cf5 100644 --- a/sound/core/seq/oss/seq_oss_timer.c +++ b/sound/core/seq/oss/seq_oss_timer.c @@ -34,7 +34,7 @@ snd_seq_oss_timer_new(struct seq_oss_devinfo *dp) { struct seq_oss_timer *rec; - rec = kzalloc(sizeof(*rec), GFP_KERNEL); + rec = kzalloc_obj(*rec, GFP_KERNEL); if (rec == NULL) return NULL; diff --git a/sound/core/seq/oss/seq_oss_writeq.c b/sound/core/seq/oss/seq_oss_writeq.c index a93ff8315b8e..dfc20d9bcc30 100644 --- a/sound/core/seq/oss/seq_oss_writeq.c +++ b/sound/core/seq/oss/seq_oss_writeq.c @@ -27,7 +27,7 @@ snd_seq_oss_writeq_new(struct seq_oss_devinfo *dp, int maxlen) struct seq_oss_writeq *q; struct snd_seq_client_pool pool; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; q->dp = dp; diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c index 260428747e33..a771684eac34 100644 --- a/sound/core/seq/seq_compat.c +++ b/sound/core/seq/seq_compat.c @@ -33,7 +33,7 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned { int err; struct snd_seq_port_info *data __free(kfree) = - kmalloc(sizeof(*data), GFP_KERNEL); + kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index 783fc72c2ef6..d8b77385aa3f 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c @@ -115,7 +115,7 @@ create_port(int idx, int type) struct snd_seq_port_callback pcb; struct snd_seq_dummy_port *rec; - rec = kzalloc(sizeof(*rec), GFP_KERNEL); + rec = kzalloc_obj(*rec, GFP_KERNEL); if (!rec) return NULL; diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index 91cce1890111..ad15d001cef7 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c @@ -19,7 +19,7 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize) { struct snd_seq_fifo *f; - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) return NULL; diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index ccde0ca3d208..8a14d6e59c82 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -441,9 +441,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) if (snd_BUG_ON(!pool)) return -EINVAL; - cellptr = kvmalloc_array(pool->size, - sizeof(struct snd_seq_event_cell), - GFP_KERNEL); + cellptr = kvmalloc_objs(struct snd_seq_event_cell, pool->size, + GFP_KERNEL); if (!cellptr) return -ENOMEM; @@ -518,7 +517,7 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize) struct snd_seq_pool *pool; /* create pool block */ - pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return NULL; spin_lock_init(&pool->lock); diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index 88e930980f16..72e798ddbe4e 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c @@ -281,7 +281,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) return -EINVAL; struct snd_rawmidi_info *info __free(kfree) = - kmalloc(sizeof(*info), GFP_KERNEL); + kmalloc_obj(*info, GFP_KERNEL); if (! info) return -ENOMEM; info->device = device; @@ -305,7 +305,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) client = synths[card->number]; if (client == NULL) { newclient = 1; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (client == NULL) return -ENOMEM; client->seq_client = @@ -318,10 +318,10 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) } } - msynth = kcalloc(ports, sizeof(struct seq_midisynth), GFP_KERNEL); + msynth = kzalloc_objs(struct seq_midisynth, ports, GFP_KERNEL); struct snd_seq_port_info *port __free(kfree) = - kmalloc(sizeof(*port), GFP_KERNEL); + kmalloc_obj(*port, GFP_KERNEL); if (msynth == NULL || port == NULL) goto __nomem; diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 81d2ef5e5811..0e9461d0f9f8 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -650,7 +650,7 @@ static struct snd_midi_channel *snd_midi_channel_init_set(int n) struct snd_midi_channel *chan; int i; - chan = kmalloc_array(n, sizeof(struct snd_midi_channel), GFP_KERNEL); + chan = kmalloc_objs(struct snd_midi_channel, n, GFP_KERNEL); if (chan) { for (i = 0; i < n; i++) snd_midi_channel_init(chan+i, i); @@ -688,7 +688,7 @@ struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n) { struct snd_midi_channel_set *chset; - chset = kmalloc(sizeof(*chset), GFP_KERNEL); + chset = kmalloc_obj(*chset, GFP_KERNEL); if (chset) { chset->channels = snd_midi_channel_init_set(n); chset->private_data = NULL; diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index fa9dfc53c3fc..c2a9b0540c09 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c @@ -104,7 +104,7 @@ int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev) struct snd_midi_event *dev; *rdev = NULL; - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc_obj(*dev, GFP_KERNEL); if (dev == NULL) return -ENOMEM; if (bufsize > 0) { diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index bbec34bba4f9..1b395caaae49 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c @@ -129,7 +129,7 @@ int snd_seq_create_port(struct snd_seq_client *client, int port, } /* create a new port */ - new_port = kzalloc(sizeof(*new_port), GFP_KERNEL); + new_port = kzalloc_obj(*new_port, GFP_KERNEL); if (!new_port) return -ENOMEM; /* failure, out of memory */ /* init port data */ @@ -572,7 +572,7 @@ int snd_seq_port_connect(struct snd_seq_client *connector, bool exclusive; int err; - subs = kzalloc(sizeof(*subs), GFP_KERNEL); + subs = kzalloc_obj(*subs, GFP_KERNEL); if (!subs) return -ENOMEM; diff --git a/sound/core/seq/seq_prioq.c b/sound/core/seq/seq_prioq.c index e649485a8772..805c4ebbfdac 100644 --- a/sound/core/seq/seq_prioq.c +++ b/sound/core/seq/seq_prioq.c @@ -43,7 +43,7 @@ struct snd_seq_prioq *snd_seq_prioq_new(void) { struct snd_seq_prioq *f; - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) return NULL; diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index c0c5e1424c5a..8c7b24a9421a 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c @@ -89,7 +89,7 @@ static struct snd_seq_queue *queue_new(int owner, int locked) { struct snd_seq_queue *q; - q = kzalloc(sizeof(*q), GFP_KERNEL); + q = kzalloc_obj(*q, GFP_KERNEL); if (!q) return NULL; diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c index 5b5603e5970b..d7d84576c3d6 100644 --- a/sound/core/seq/seq_system.c +++ b/sound/core/seq/seq_system.c @@ -130,7 +130,7 @@ int __init snd_seq_system_client_init(void) struct snd_seq_port_info *port; int err; - port = kzalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index 29b018a212fc..c5728efa05af 100644 --- a/sound/core/seq/seq_timer.c +++ b/sound/core/seq/seq_timer.c @@ -43,7 +43,7 @@ struct snd_seq_timer *snd_seq_timer_new(void) { struct snd_seq_timer *tmr; - tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); + tmr = kzalloc_obj(*tmr, GFP_KERNEL); if (!tmr) return NULL; spin_lock_init(&tmr->lock); diff --git a/sound/core/seq/seq_ump_client.c b/sound/core/seq/seq_ump_client.c index 7bc18415a540..3ca808c787e2 100644 --- a/sound/core/seq/seq_ump_client.c +++ b/sound/core/seq/seq_ump_client.c @@ -220,7 +220,7 @@ static int seq_ump_group_init(struct seq_ump_client *client, int group_index) return 0; struct snd_seq_port_info *port __free(kfree) = - kzalloc(sizeof(*port), GFP_KERNEL); + kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -246,9 +246,9 @@ static void update_port_infos(struct seq_ump_client *client) int i, err; struct snd_seq_port_info *old __free(kfree) = - kzalloc(sizeof(*old), GFP_KERNEL); + kzalloc_obj(*old, GFP_KERNEL); struct snd_seq_port_info *new __free(kfree) = - kzalloc(sizeof(*new), GFP_KERNEL); + kzalloc_obj(*new, GFP_KERNEL); if (!old || !new) return; @@ -283,7 +283,7 @@ static int create_ump_endpoint_port(struct seq_ump_client *client) int err; struct snd_seq_port_info *port __free(kfree) = - kzalloc(sizeof(*port), GFP_KERNEL); + kzalloc_obj(*port, GFP_KERNEL); if (!port) return -ENOMEM; @@ -461,7 +461,7 @@ static int snd_seq_ump_probe(struct snd_seq_device *dev) struct snd_seq_client *cptr; int p, err; - client = kzalloc(sizeof(*client), GFP_KERNEL); + client = kzalloc_obj(*client, GFP_KERNEL); if (!client) return -ENOMEM; diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 574493fbd50d..16d61847c7fe 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -216,7 +216,7 @@ static int snd_virmidi_output_open(struct snd_rawmidi_substream *substream) struct snd_rawmidi_runtime *runtime = substream->runtime; struct snd_virmidi *vmidi; - vmidi = kzalloc(sizeof(*vmidi), GFP_KERNEL); + vmidi = kzalloc_obj(*vmidi, GFP_KERNEL); if (vmidi == NULL) return -ENOMEM; vmidi->substream = substream; @@ -367,7 +367,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) return 0; struct snd_seq_port_info *pinfo __free(kfree) = - kzalloc(sizeof(*pinfo), GFP_KERNEL); + kzalloc_obj(*pinfo, GFP_KERNEL); if (!pinfo) return -ENOMEM; @@ -498,7 +498,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi if (err < 0) return err; strscpy(rmidi->name, rmidi->id); - rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); + rdev = kzalloc_obj(*rdev, GFP_KERNEL); if (rdev == NULL) { snd_device_free(card, rmidi); return -ENOMEM; diff --git a/sound/core/sound.c b/sound/core/sound.c index 6531a67f13b3..876fac770749 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -257,7 +257,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, if (snd_BUG_ON(!device)) return -EINVAL; - preg = kmalloc(sizeof *preg, GFP_KERNEL); + preg = kmalloc_obj(*preg, GFP_KERNEL); if (preg == NULL) return -ENOMEM; preg->type = type; diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index d65cc6fee2e6..6d4e44656e19 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c @@ -96,7 +96,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, return 0; /* ignore silently */ if (minor < 0) return minor; - preg = kmalloc(sizeof(struct snd_minor), GFP_KERNEL); + preg = kmalloc_obj(struct snd_minor, GFP_KERNEL); if (preg == NULL) return -ENOMEM; preg->type = type; diff --git a/sound/core/timer.c b/sound/core/timer.c index 9a4a1748ff80..7d10f079b5b3 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -151,7 +151,7 @@ struct snd_timer_instance *snd_timer_instance_new(const char *owner) { struct snd_timer_instance *timeri; - timeri = kzalloc(sizeof(*timeri), GFP_KERNEL); + timeri = kzalloc_obj(*timeri, GFP_KERNEL); if (timeri == NULL) return NULL; timeri->owner = kstrdup(owner, GFP_KERNEL); @@ -930,7 +930,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, } if (rtimer) *rtimer = NULL; - timer = kzalloc(sizeof(*timer), GFP_KERNEL); + timer = kzalloc_obj(*timer, GFP_KERNEL); if (!timer) return -ENOMEM; timer->tmr_class = tid->dev_class; @@ -1197,7 +1197,7 @@ static int snd_timer_register_system(void) return err; strscpy(timer->name, "system timer"); timer->hw = snd_timer_system; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) { snd_timer_free(timer); return -ENOMEM; @@ -1432,11 +1432,11 @@ static int realloc_user_queue(struct snd_timer_user *tu, int size) struct snd_timer_tread64 *tqueue = NULL; if (tu->tread) { - tqueue = kcalloc(size, sizeof(*tqueue), GFP_KERNEL); + tqueue = kzalloc_objs(*tqueue, size, GFP_KERNEL); if (!tqueue) return -ENOMEM; } else { - queue = kcalloc(size, sizeof(*queue), GFP_KERNEL); + queue = kzalloc_objs(*queue, size, GFP_KERNEL); if (!queue) return -ENOMEM; } @@ -1461,7 +1461,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file) if (err < 0) return err; - tu = kzalloc(sizeof(*tu), GFP_KERNEL); + tu = kzalloc_obj(*tu, GFP_KERNEL); if (tu == NULL) return -ENOMEM; spin_lock_init(&tu->qlock); @@ -2128,7 +2128,7 @@ static int snd_utimer_create(struct snd_timer_uinfo *utimer_info, if (!utimer_info || utimer_info->resolution == 0) return -EINVAL; - utimer = kzalloc(sizeof(*utimer), GFP_KERNEL); + utimer = kzalloc_obj(*utimer, GFP_KERNEL); if (!utimer) return -ENOMEM; diff --git a/sound/core/ump.c b/sound/core/ump.c index 8d8681a42ca5..543330c67b69 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -166,7 +166,7 @@ int snd_ump_endpoint_new(struct snd_card *card, char *id, int device, if (input && output) info_flags |= SNDRV_RAWMIDI_INFO_DUPLEX; - ump = kzalloc(sizeof(*ump), GFP_KERNEL); + ump = kzalloc_obj(*ump, GFP_KERNEL); if (!ump) return -ENOMEM; INIT_LIST_HEAD(&ump->block_list); @@ -408,7 +408,7 @@ int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk, if (snd_ump_get_block(ump, blk)) return -EBUSY; - fb = kzalloc(sizeof(*fb), GFP_KERNEL); + fb = kzalloc_obj(*fb, GFP_KERNEL); if (!fb) return -ENOMEM; @@ -1352,8 +1352,8 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, bool input, output; int err, num; - ump->out_cvts = kcalloc(SNDRV_UMP_MAX_GROUPS, - sizeof(*ump->out_cvts), GFP_KERNEL); + ump->out_cvts = kzalloc_objs(*ump->out_cvts, SNDRV_UMP_MAX_GROUPS, + GFP_KERNEL); if (!ump->out_cvts) return -ENOMEM; diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index 76cc64245f5d..e4185c3a2629 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c @@ -58,7 +58,7 @@ static int follower_update(struct link_follower *follower) { int err, ch; struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (!uctl) return -ENOMEM; @@ -84,7 +84,7 @@ static int follower_init(struct link_follower *follower) } struct snd_ctl_elem_info *uinfo __free(kfree) = - kmalloc(sizeof(*uinfo), GFP_KERNEL); + kmalloc_obj(*uinfo, GFP_KERNEL); if (!uinfo) return -ENOMEM; uinfo->id = follower->follower.id; @@ -256,8 +256,7 @@ int _snd_ctl_add_follower(struct snd_kcontrol *master, struct link_master *master_link = snd_kcontrol_chip(master); struct link_follower *srec; - srec = kzalloc(struct_size(srec, follower.vd, follower->count), - GFP_KERNEL); + srec = kzalloc_flex(*srec, follower.vd, follower->count, GFP_KERNEL); if (!srec) return -ENOMEM; srec->kctl = follower; @@ -342,7 +341,7 @@ static int sync_followers(struct link_master *master, int old_val, int new_val) { struct link_follower *follower; struct snd_ctl_elem_value *uval __free(kfree) = - kmalloc(sizeof(*uval), GFP_KERNEL); + kmalloc_obj(*uval, GFP_KERNEL); if (!uval) return -ENOMEM; @@ -430,7 +429,7 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, knew.name = name; knew.info = master_info; - master = kzalloc(sizeof(*master), GFP_KERNEL); + master = kzalloc_obj(*master, GFP_KERNEL); if (!master) return NULL; INIT_LIST_HEAD(&master->followers); diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 1860ff75fe15..33323c1f8dfe 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -329,7 +329,7 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream) { struct dummy_systimer_pcm *dpcm; - dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); if (!dpcm) return -ENOMEM; substream->runtime->private_data = dpcm; @@ -450,7 +450,7 @@ static int dummy_hrtimer_create(struct snd_pcm_substream *substream) { struct dummy_hrtimer_pcm *dpcm; - dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); if (!dpcm) return -ENOMEM; substream->runtime->private_data = dpcm; diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index 4af89822bf32..1b573969918f 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -518,7 +518,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device, out_enable, in_enable, &rmidi); if (err < 0) return err; - mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); + mpu = kzalloc_obj(*mpu, GFP_KERNEL); if (!mpu) { err = -ENOMEM; goto free_device; diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index fe50b48c10e7..eeaa05ad9e5b 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -75,7 +75,7 @@ static int snd_mts64_create(struct snd_card *card, *rchip = NULL; - mts = kzalloc(sizeof(struct mts64), GFP_KERNEL); + mts = kzalloc_obj(struct mts64, GFP_KERNEL); if (mts == NULL) return -ENOMEM; diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index fa8a2ccbbd51..ce96b0fd1f43 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -324,7 +324,7 @@ int snd_opl3_new(struct snd_card *card, int err; *ropl3 = NULL; - opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL); + opl3 = kzalloc_obj(*opl3, GFP_KERNEL); if (!opl3) return -ENOMEM; diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index 10f622b439a0..7cdd4abb0b7c 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c @@ -313,7 +313,7 @@ struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank, if (!create_patch) return NULL; - patch = kzalloc(sizeof(*patch), GFP_KERNEL); + patch = kzalloc_obj(*patch, GFP_KERNEL); if (!patch) return NULL; patch->prog = prog; diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 44fbc6bf0654..d476fb7be15e 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -187,7 +187,7 @@ int snd_opl4_create(struct snd_card *card, if (ropl4) *ropl4 = NULL; - opl4 = kzalloc(sizeof(*opl4), GFP_KERNEL); + opl4 = kzalloc_obj(*opl4, GFP_KERNEL); if (!opl4) return -ENOMEM; diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index b8474631f0b5..8d3a19b628a2 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -377,7 +377,7 @@ static int snd_pcmtst_pcm_open(struct snd_pcm_substream *substream) if (inject_open_err) return -EBUSY; - v_iter = kzalloc(sizeof(*v_iter), GFP_KERNEL); + v_iter = kzalloc_obj(*v_iter, GFP_KERNEL); if (!v_iter) return -ENOMEM; @@ -575,7 +575,7 @@ static int snd_pcmtst_create(struct snd_card *card, struct platform_device *pdev .dev_free = snd_pcmtst_dev_free, }; - pcmtst = kzalloc(sizeof(*pcmtst), GFP_KERNEL); + pcmtst = kzalloc_obj(*pcmtst, GFP_KERNEL); if (!pcmtst) return -ENOMEM; pcmtst->card = card; diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index b903a138fc2a..3dac519c4c45 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -88,7 +88,7 @@ static int portman_create(struct snd_card *card, *rchip = NULL; - pm = kzalloc(sizeof(struct portman), GFP_KERNEL); + pm = kzalloc_obj(struct portman, GFP_KERNEL); if (pm == NULL) return -ENOMEM; diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 7fd8f413d6cf..0e7a4cdc1390 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -414,7 +414,7 @@ static int vx_alloc_pipe(struct vx_core *chip, int capture, return err; /* initialize the pipe record */ - pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); + pipe = kzalloc_obj(*pipe, GFP_KERNEL); if (! pipe) { /* release the pipe */ vx_init_rmh(&rmh, CMD_FREE_PIPE); @@ -1154,10 +1154,12 @@ static int vx_init_audio_io(struct vx_core *chip) chip->audio_info = rmh.Stat[1]; /* allocate pipes */ - chip->playback_pipes = kcalloc(chip->audio_outs, sizeof(struct vx_pipe *), GFP_KERNEL); + chip->playback_pipes = kzalloc_objs(struct vx_pipe *, chip->audio_outs, + GFP_KERNEL); if (!chip->playback_pipes) return -ENOMEM; - chip->capture_pipes = kcalloc(chip->audio_ins, sizeof(struct vx_pipe *), GFP_KERNEL); + chip->capture_pipes = kzalloc_objs(struct vx_pipe *, chip->audio_ins, + GFP_KERNEL); if (!chip->capture_pipes) { kfree(chip->playback_pipes); return -ENOMEM; diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 223c880af802..3f9471694b04 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1735,8 +1735,9 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed, s->ctx_data.tx.cache.size = max_t(unsigned int, s->syt_interval * 2, queue_size * 3 / 2); s->ctx_data.tx.cache.pos = 0; - s->ctx_data.tx.cache.descs = kcalloc(s->ctx_data.tx.cache.size, - sizeof(*s->ctx_data.tx.cache.descs), GFP_KERNEL); + s->ctx_data.tx.cache.descs = kzalloc_objs(*s->ctx_data.tx.cache.descs, + s->ctx_data.tx.cache.size, + GFP_KERNEL); if (!s->ctx_data.tx.cache.descs) { err = -ENOMEM; goto err_context; @@ -1756,7 +1757,8 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed, [CIP_SFC_176400] = { 0, 67 }, }; - s->ctx_data.rx.seq.descs = kcalloc(queue_size, sizeof(*s->ctx_data.rx.seq.descs), GFP_KERNEL); + s->ctx_data.rx.seq.descs = kzalloc_objs(*s->ctx_data.rx.seq.descs, + queue_size, GFP_KERNEL); if (!s->ctx_data.rx.seq.descs) { err = -ENOMEM; goto err_context; @@ -1781,7 +1783,7 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed, // for runtime of PCM substream in the interval equivalent to the size of PCM buffer. It // could take a round over queue of AMDTP packet descriptors and small loss of history. For // safe, keep more 8 elements for the queue, equivalent to 1 ms. - descs = kcalloc(s->queue_size + 8, sizeof(*descs), GFP_KERNEL); + descs = kzalloc_objs(*descs, s->queue_size + 8, GFP_KERNEL); if (!descs) { err = -ENOMEM; goto err_context; diff --git a/sound/firewire/bebob/bebob_proc.c b/sound/firewire/bebob/bebob_proc.c index f659b888a6d1..c5e060728fdc 100644 --- a/sound/firewire/bebob/bebob_proc.c +++ b/sound/firewire/bebob/bebob_proc.c @@ -38,7 +38,7 @@ proc_read_hw_info(struct snd_info_entry *entry, struct snd_bebob *bebob = entry->private_data; struct hw_info *info; - info = kzalloc(sizeof(struct hw_info), GFP_KERNEL); + info = kzalloc_obj(struct hw_info, GFP_KERNEL); if (info == NULL) return; diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 3378c7dce88a..8b6b0e5ba497 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -76,7 +76,7 @@ get_hardware_info(struct snd_efw *efw) char version[12] = {0}; int err; - hwinfo = kzalloc(sizeof(struct snd_efw_hwinfo), GFP_KERNEL); + hwinfo = kzalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL); if (hwinfo == NULL) return -ENOMEM; diff --git a/sound/firewire/fireworks/fireworks_proc.c b/sound/firewire/fireworks/fireworks_proc.c index 12288567b0cd..179b7110c8e2 100644 --- a/sound/firewire/fireworks/fireworks_proc.c +++ b/sound/firewire/fireworks/fireworks_proc.c @@ -31,7 +31,7 @@ proc_read_hwinfo(struct snd_info_entry *entry, struct snd_info_buffer *buffer) unsigned short i; struct snd_efw_hwinfo *hwinfo; - hwinfo = kmalloc(sizeof(struct snd_efw_hwinfo), GFP_KERNEL); + hwinfo = kmalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL); if (hwinfo == NULL) return; diff --git a/sound/firewire/motu/motu-hwdep.c b/sound/firewire/motu/motu-hwdep.c index 89dc436a0652..ea7f5d215060 100644 --- a/sound/firewire/motu/motu-hwdep.c +++ b/sound/firewire/motu/motu-hwdep.c @@ -185,7 +185,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP)) return -ENXIO; - meter = kzalloc(sizeof(*meter), GFP_KERNEL); + meter = kzalloc_obj(*meter, GFP_KERNEL); if (!meter) return -ENOMEM; @@ -207,7 +207,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_COMMAND_DSP)) return -ENXIO; - meter = kzalloc(sizeof(*meter), GFP_KERNEL); + meter = kzalloc_obj(*meter, GFP_KERNEL); if (!meter) return -ENOMEM; @@ -229,7 +229,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP)) return -ENXIO; - param = kzalloc(sizeof(*param), GFP_KERNEL); + param = kzalloc_obj(*param, GFP_KERNEL); if (!param) return -ENOMEM; diff --git a/sound/firewire/packets-buffer.c b/sound/firewire/packets-buffer.c index 0ecafd0c6722..3d5c3baf7e48 100644 --- a/sound/firewire/packets-buffer.c +++ b/sound/firewire/packets-buffer.c @@ -27,7 +27,7 @@ int iso_packets_buffer_init(struct iso_packets_buffer *b, struct fw_unit *unit, void *p; int err; - b->packets = kmalloc_array(count, sizeof(*b->packets), GFP_KERNEL); + b->packets = kmalloc_objs(*b->packets, count, GFP_KERNEL); if (!b->packets) { err = -ENOMEM; goto error; diff --git a/sound/hda/codecs/analog.c b/sound/hda/codecs/analog.c index 357ad5a6c0db..122d14e57313 100644 --- a/sound/hda/codecs/analog.c +++ b/sound/hda/codecs/analog.c @@ -191,7 +191,7 @@ static int alloc_ad_spec(struct hda_codec *codec) { struct ad198x_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; codec->spec = spec; diff --git a/sound/hda/codecs/ca0110.c b/sound/hda/codecs/ca0110.c index c75a9ff9460d..8638cef4ef20 100644 --- a/sound/hda/codecs/ca0110.c +++ b/sound/hda/codecs/ca0110.c @@ -35,7 +35,7 @@ static int ca0110_probe(struct hda_codec *codec, const struct hda_device_id *id) struct hda_gen_spec *spec; int err; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(spec); diff --git a/sound/hda/codecs/ca0132.c b/sound/hda/codecs/ca0132.c index dd054aedd501..af9236c56db4 100644 --- a/sound/hda/codecs/ca0132.c +++ b/sound/hda/codecs/ca0132.c @@ -3392,11 +3392,11 @@ static int dspxfr_image(struct hda_codec *codec, if (fls_data == NULL) return -EINVAL; - dma_engine = kzalloc(sizeof(*dma_engine), GFP_KERNEL); + dma_engine = kzalloc_obj(*dma_engine, GFP_KERNEL); if (!dma_engine) return -ENOMEM; - dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL); + dma_engine->dmab = kzalloc_obj(*dma_engine->dmab, GFP_KERNEL); if (!dma_engine->dmab) { kfree(dma_engine); return -ENOMEM; @@ -9831,9 +9831,8 @@ static int ca0132_prepare_verbs(struct hda_codec *codec) */ if (ca0132_use_pci_mmio(spec)) spec->desktop_init_verbs = ca0132_init_verbs1; - spec->spec_init_verbs = kcalloc(NUM_SPEC_VERBS, - sizeof(struct hda_verb), - GFP_KERNEL); + spec->spec_init_verbs = kzalloc_objs(struct hda_verb, NUM_SPEC_VERBS, + GFP_KERNEL); if (!spec->spec_init_verbs) return -ENOMEM; @@ -9900,7 +9899,7 @@ static int ca0132_codec_probe(struct hda_codec *codec, codec_dbg(codec, "%s\n", __func__); - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs420x.c b/sound/hda/codecs/cirrus/cs420x.c index 13f5f1711fa4..454b6946b4a3 100644 --- a/sound/hda/codecs/cirrus/cs420x.c +++ b/sound/hda/codecs/cirrus/cs420x.c @@ -524,7 +524,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) { struct cs_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs421x.c b/sound/hda/codecs/cirrus/cs421x.c index a93e2e0bb391..28f3317a9ffd 100644 --- a/sound/hda/codecs/cirrus/cs421x.c +++ b/sound/hda/codecs/cirrus/cs421x.c @@ -162,7 +162,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) { struct cs_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs8409.c b/sound/hda/codecs/cirrus/cs8409.c index 61b6a15d6291..24b224c70e9f 100644 --- a/sound/hda/codecs/cirrus/cs8409.c +++ b/sound/hda/codecs/cirrus/cs8409.c @@ -61,7 +61,7 @@ static struct cs8409_spec *cs8409_alloc_spec(struct hda_codec *codec) { struct cs8409_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cm9825.c b/sound/hda/codecs/cm9825.c index 52ee431f2e2c..a5330cff42ec 100644 --- a/sound/hda/codecs/cm9825.c +++ b/sound/hda/codecs/cm9825.c @@ -488,7 +488,7 @@ static int cm9825_probe(struct hda_codec *codec, const struct hda_device_id *id) struct auto_pin_cfg *cfg; int err = 0; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (spec == NULL) return -ENOMEM; diff --git a/sound/hda/codecs/cmedia.c b/sound/hda/codecs/cmedia.c index 15e5a1118a6e..0494bbe15431 100644 --- a/sound/hda/codecs/cmedia.c +++ b/sound/hda/codecs/cmedia.c @@ -24,7 +24,7 @@ static int cmedia_probe(struct hda_codec *codec, const struct hda_device_id *id) bool is_cmi8888 = id->vendor_id == 0x13f68888; int err; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (spec == NULL) return -ENOMEM; diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c index f71123a47546..8f032102e558 100644 --- a/sound/hda/codecs/conexant.c +++ b/sound/hda/codecs/conexant.c @@ -1187,7 +1187,7 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id) codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/generic.c b/sound/hda/codecs/generic.c index b75a5e9470df..147582c5e51f 100644 --- a/sound/hda/codecs/generic.c +++ b/sound/hda/codecs/generic.c @@ -1991,7 +1991,7 @@ static int parse_output_paths(struct hda_codec *codec) bool best_wired = true, best_mio = true; bool hp_spk_swapped = false; struct auto_pin_cfg *best_cfg __free(kfree) = - kmalloc(sizeof(*best_cfg), GFP_KERNEL); + kmalloc_obj(*best_cfg, GFP_KERNEL); if (!best_cfg) return -ENOMEM; @@ -6095,7 +6095,7 @@ static int snd_hda_gen_probe(struct hda_codec *codec, struct hda_gen_spec *spec; int err; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(spec); diff --git a/sound/hda/codecs/hdmi/hdmi.c b/sound/hda/codecs/hdmi/hdmi.c index c2e3adc7b3c0..bcc81018fff3 100644 --- a/sound/hda/codecs/hdmi/hdmi.c +++ b/sound/hda/codecs/hdmi/hdmi.c @@ -2105,7 +2105,7 @@ int snd_hda_hdmi_generic_alloc(struct hda_codec *codec) { struct hdmi_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; diff --git a/sound/hda/codecs/hdmi/simplehdmi.c b/sound/hda/codecs/hdmi/simplehdmi.c index 193c8dc882af..fe4e73c3d6e6 100644 --- a/sound/hda/codecs/hdmi/simplehdmi.c +++ b/sound/hda/codecs/hdmi/simplehdmi.c @@ -175,7 +175,7 @@ int snd_hda_hdmi_simple_probe(struct hda_codec *codec, struct hdmi_spec_per_cvt *per_cvt; struct hdmi_spec_per_pin *per_pin; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; diff --git a/sound/hda/codecs/realtek/realtek.c b/sound/hda/codecs/realtek/realtek.c index efe20b450529..3356fd95fb7f 100644 --- a/sound/hda/codecs/realtek/realtek.c +++ b/sound/hda/codecs/realtek/realtek.c @@ -221,7 +221,7 @@ void alc_update_knob_master(struct hda_codec *codec, return; struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc(sizeof(*uctl), GFP_KERNEL); + kzalloc_obj(*uctl, GFP_KERNEL); if (!uctl) return; val = snd_hda_codec_read(codec, jack->nid, 0, @@ -1028,7 +1028,7 @@ EXPORT_SYMBOL_NS_GPL(alc_parse_auto_config, "SND_HDA_CODEC_REALTEK"); /* common preparation job for alc_spec */ int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) { - struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); + struct alc_spec *spec = kzalloc_obj(*spec, GFP_KERNEL); int err; if (!spec) diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c index 63cda57cf786..ed3d9cbb3ea6 100644 --- a/sound/hda/codecs/senarytech.c +++ b/sound/hda/codecs/senarytech.c @@ -170,7 +170,7 @@ static int senary_probe(struct hda_codec *codec, const struct hda_device_id *id) codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/si3054.c b/sound/hda/codecs/si3054.c index 87cf9da9f3bf..9074c74a0ed0 100644 --- a/sound/hda/codecs/si3054.c +++ b/sound/hda/codecs/si3054.c @@ -256,7 +256,7 @@ static void si3054_remove(struct hda_codec *codec) static int si3054_probe(struct hda_codec *codec, const struct hda_device_id *id) { - codec->spec = kzalloc(sizeof(struct si3054_spec), GFP_KERNEL); + codec->spec = kzalloc_obj(struct si3054_spec, GFP_KERNEL); if (!codec->spec) return -ENOMEM; return 0; diff --git a/sound/hda/codecs/sigmatel.c b/sound/hda/codecs/sigmatel.c index ecbee408d771..69d75cc63bd6 100644 --- a/sound/hda/codecs/sigmatel.c +++ b/sound/hda/codecs/sigmatel.c @@ -4456,7 +4456,7 @@ static int alloc_stac_spec(struct hda_codec *codec) { struct sigmatel_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/via.c b/sound/hda/codecs/via.c index 6becea9bb810..42cce9f51931 100644 --- a/sound/hda/codecs/via.c +++ b/sound/hda/codecs/via.c @@ -102,7 +102,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) { struct via_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (spec == NULL) return NULL; diff --git a/sound/hda/common/beep.c b/sound/hda/common/beep.c index 13a7d92e8d8d..006eef5ceea8 100644 --- a/sound/hda/common/beep.c +++ b/sound/hda/common/beep.c @@ -220,7 +220,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) return 0; /* disabled by module option */ } - beep = kzalloc(sizeof(*beep), GFP_KERNEL); + beep = kzalloc_obj(*beep, GFP_KERNEL); if (beep == NULL) return -ENOMEM; snprintf(beep->phys, sizeof(beep->phys), diff --git a/sound/hda/common/codec.c b/sound/hda/common/codec.c index ffe7c69d5a32..6c787b603179 100644 --- a/sound/hda/common/codec.c +++ b/sound/hda/common/codec.c @@ -117,7 +117,7 @@ static int add_conn_list(struct hda_codec *codec, hda_nid_t nid, int len, { struct hda_conn_list *p; - p = kmalloc(struct_size(p, conns, len), GFP_KERNEL); + p = kmalloc_flex(*p, conns, len, GFP_KERNEL); if (!p) return -ENOMEM; p->len = len; @@ -147,7 +147,7 @@ static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid) len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list)); if (len == -ENOSPC) { len = snd_hda_get_num_raw_conns(codec, nid); - result = kmalloc_array(len, sizeof(hda_nid_t), GFP_KERNEL); + result = kmalloc_objs(hda_nid_t, len, GFP_KERNEL); if (!result) return -ENOMEM; len = snd_hda_get_raw_connections(codec, nid, result, len); @@ -703,7 +703,7 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec, struct hda_pcm *pcm; va_list args; - pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); + pcm = kzalloc_obj(*pcm, GFP_KERNEL); if (!pcm) return NULL; @@ -895,7 +895,7 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr, if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) return ERR_PTR(-EINVAL); - codec = kzalloc(sizeof(*codec), GFP_KERNEL); + codec = kzalloc_obj(*codec, GFP_KERNEL); if (!codec) return ERR_PTR(-ENOMEM); @@ -1855,7 +1855,7 @@ static int check_follower_present(struct hda_codec *codec, static int put_kctl_with_value(struct snd_kcontrol *kctl, int val) { struct snd_ctl_elem_value *ucontrol __free(kfree) = - kzalloc(sizeof(*ucontrol), GFP_KERNEL); + kzalloc_obj(*ucontrol, GFP_KERNEL); if (!ucontrol) return -ENOMEM; diff --git a/sound/hda/common/controller.c b/sound/hda/common/controller.c index b1cfd9bd4dcb..cf8502834484 100644 --- a/sound/hda/common/controller.c +++ b/sound/hda/common/controller.c @@ -715,7 +715,7 @@ int snd_hda_attach_pcm_stream(struct hda_bus *_bus, struct hda_codec *codec, if (err < 0) return err; strscpy(pcm->name, cpcm->name, sizeof(pcm->name)); - apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); + apcm = kzalloc_obj(*apcm, GFP_KERNEL); if (apcm == NULL) { snd_device_free(chip->card, pcm); return -ENOMEM; @@ -1283,7 +1283,7 @@ int azx_init_streams(struct azx *chip) * and initialize */ for (i = 0; i < chip->num_streams; i++) { - struct azx_dev *azx_dev = kzalloc(sizeof(*azx_dev), GFP_KERNEL); + struct azx_dev *azx_dev = kzalloc_obj(*azx_dev, GFP_KERNEL); int dir, tag; if (!azx_dev) diff --git a/sound/hda/common/jack.c b/sound/hda/common/jack.c index 7d7786df60ea..87120868d123 100644 --- a/sound/hda/common/jack.c +++ b/sound/hda/common/jack.c @@ -329,7 +329,7 @@ snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid, callback = find_callback_from_list(jack, func); if (func && !callback) { - callback = kzalloc(sizeof(*callback), GFP_KERNEL); + callback = kzalloc_obj(*callback, GFP_KERNEL); if (!callback) return ERR_PTR(-ENOMEM); callback->func = func; diff --git a/sound/hda/common/proc.c b/sound/hda/common/proc.c index 5f3f61519ba6..98cad7ea8cf1 100644 --- a/sound/hda/common/proc.c +++ b/sound/hda/common/proc.c @@ -689,7 +689,7 @@ static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_c if (conn_len <= 0) return; - conn = kmalloc_array(conn_len, sizeof(hda_nid_t), GFP_KERNEL); + conn = kmalloc_objs(hda_nid_t, conn_len, GFP_KERNEL); if (!conn) return; @@ -845,9 +845,8 @@ static void print_codec_info(struct snd_info_entry *entry, if (wid_caps & AC_WCAP_CONN_LIST) { conn_len = snd_hda_get_num_raw_conns(codec, nid); if (conn_len > 0) { - conn = kmalloc_array(conn_len, - sizeof(hda_nid_t), - GFP_KERNEL); + conn = kmalloc_objs(hda_nid_t, conn_len, + GFP_KERNEL); if (!conn) return; if (snd_hda_get_raw_connections(codec, nid, conn, diff --git a/sound/hda/core/ext/controller.c b/sound/hda/core/ext/controller.c index 9eea3ea2dae0..0c12ff36d992 100644 --- a/sound/hda/core/ext/controller.c +++ b/sound/hda/core/ext/controller.c @@ -89,7 +89,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus) dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count); for (idx = 0; idx < link_count; idx++) { - hlink = kzalloc(sizeof(*hlink), GFP_KERNEL); + hlink = kzalloc_obj(*hlink, GFP_KERNEL); if (!hlink) return -ENOMEM; hlink->index = idx; diff --git a/sound/hda/core/ext/stream.c b/sound/hda/core/ext/stream.c index b4759198e51d..a213e5b06bdb 100644 --- a/sound/hda/core/ext/stream.c +++ b/sound/hda/core/ext/stream.c @@ -101,8 +101,8 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx, setup_op = snd_hdac_stream_setup; for (i = 0; i < num_stream; i++) { - struct hdac_ext_stream *hext_stream = - kzalloc(sizeof(*hext_stream), GFP_KERNEL); + struct hdac_ext_stream *hext_stream = kzalloc_obj(*hext_stream, + GFP_KERNEL); if (!hext_stream) return -ENOMEM; tag = ++stream_tag; diff --git a/sound/hda/core/sysfs.c b/sound/hda/core/sysfs.c index bffe52859dba..443f00d037a3 100644 --- a/sound/hda/core/sysfs.c +++ b/sound/hda/core/sysfs.c @@ -339,7 +339,7 @@ static int add_widget_node(struct kobject *parent, hda_nid_t nid, const struct attribute_group *group, struct kobject **res) { - struct kobject *kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); + struct kobject *kobj = kzalloc_obj(*kobj, GFP_KERNEL); int err; if (!kobj) @@ -366,7 +366,7 @@ static int widget_tree_create(struct hdac_device *codec) int i, err; hda_nid_t nid; - tree = codec->widgets = kzalloc(sizeof(*tree), GFP_KERNEL); + tree = codec->widgets = kzalloc_obj(*tree, GFP_KERNEL); if (!tree) return -ENOMEM; @@ -374,8 +374,8 @@ static int widget_tree_create(struct hdac_device *codec) if (!tree->root) return -ENOMEM; - tree->nodes = kcalloc(codec->num_nodes + 1, sizeof(*tree->nodes), - GFP_KERNEL); + tree->nodes = kzalloc_objs(*tree->nodes, codec->num_nodes + 1, + GFP_KERNEL); if (!tree->nodes) return -ENOMEM; @@ -436,7 +436,7 @@ int hda_widget_sysfs_reinit(struct hdac_device *codec, if (!tree) return -ENOMEM; - tree->nodes = kcalloc(num_nodes + 1, sizeof(*tree->nodes), GFP_KERNEL); + tree->nodes = kzalloc_objs(*tree->nodes, num_nodes + 1, GFP_KERNEL); if (!tree->nodes) { kfree(tree); return -ENOMEM; diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c index 46f081268348..a4717449cc2f 100644 --- a/sound/i2c/cs8427.c +++ b/sound/i2c/cs8427.c @@ -269,7 +269,7 @@ int snd_cs8427_create(struct snd_i2c_bus *bus, &device); if (err < 0) return err; - chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = device->private_data = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) { snd_i2c_device_free(device); return -ENOMEM; diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c index 847e3b6ca601..8bb49f0d97e6 100644 --- a/sound/i2c/i2c.c +++ b/sound/i2c/i2c.c @@ -72,7 +72,7 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name, }; *ri2c = NULL; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (bus == NULL) return -ENOMEM; mutex_init(&bus->lock_mutex); @@ -104,7 +104,7 @@ int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name, *rdevice = NULL; if (snd_BUG_ON(!bus)) return -EINVAL; - device = kzalloc(sizeof(*device), GFP_KERNEL); + device = kzalloc_obj(*device, GFP_KERNEL); if (device == NULL) return -ENOMEM; device->addr = addr; diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index 70b3f7e17f9e..b1bfc71aab22 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c @@ -64,7 +64,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, .dev_free = snd_ak4113_dev_free, }; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index 0e3a272c1490..6d51e2a8db2b 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c @@ -64,7 +64,7 @@ int snd_ak4114_create(struct snd_card *card, .dev_free = snd_ak4114_dev_free, }; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index d2ec20f885f0..8f4657aa6525 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -57,7 +57,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t .dev_free = snd_ak4117_dev_free, }; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/tea6330t.c b/sound/i2c/tea6330t.c index 676d58054944..b63dfc50c1c2 100644 --- a/sound/i2c/tea6330t.c +++ b/sound/i2c/tea6330t.c @@ -285,7 +285,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card, u8 default_treble, default_bass; unsigned char bytes[7]; - tea = kzalloc(sizeof(*tea), GFP_KERNEL); + tea = kzalloc_obj(*tea, GFP_KERNEL); if (tea == NULL) return -ENOMEM; err = snd_i2c_device_create(bus, "TEA6330T", TEA6330T_ADDR, &device); diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c index 5f50a39c6f16..0b6e56c16e38 100644 --- a/sound/isa/gus/gus_main.c +++ b/sound/isa/gus/gus_main.c @@ -116,7 +116,7 @@ int snd_gus_create(struct snd_card *card, }; *rgus = NULL; - gus = kzalloc(sizeof(*gus), GFP_KERNEL); + gus = kzalloc_obj(*gus, GFP_KERNEL); if (gus == NULL) return -ENOMEM; spin_lock_init(&gus->reg_lock); diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c index 8d95d8d5abdf..65e5426a43fd 100644 --- a/sound/isa/gus/gus_mem.c +++ b/sound/isa/gus/gus_mem.c @@ -21,7 +21,7 @@ snd_gf1_mem_xalloc(struct snd_gf1_mem *alloc, struct snd_gf1_mem_block *block, { struct snd_gf1_mem_block *pblock, *nblock; - nblock = kmalloc(sizeof(struct snd_gf1_mem_block), GFP_KERNEL); + nblock = kmalloc_obj(struct snd_gf1_mem_block, GFP_KERNEL); if (nblock == NULL) return NULL; *nblock = *block; diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c index b5e1d1649500..fdb14acaddcf 100644 --- a/sound/isa/gus/gus_mem_proc.c +++ b/sound/isa/gus/gus_mem_proc.c @@ -50,7 +50,7 @@ int snd_gf1_mem_proc_init(struct snd_gus_card * gus) for (idx = 0; idx < 4; idx++) { if (gus->gf1.mem_alloc.banks_8[idx].size > 0) { - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; priv->gus = gus; @@ -67,7 +67,7 @@ int snd_gf1_mem_proc_init(struct snd_gus_card * gus) } for (idx = 0; idx < 4; idx++) { if (gus->gf1.rom_present & (1 << idx)) { - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; priv->rom = 1; diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 9249cbff30f3..b5da8d970b3f 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -638,7 +638,7 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int err; - pcmp = kzalloc(sizeof(*pcmp), GFP_KERNEL); + pcmp = kzalloc_obj(*pcmp, GFP_KERNEL); if (pcmp == NULL) return -ENOMEM; pcmp->gus = gus; diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index 656a655d618d..a3071cd2e9a8 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -221,7 +221,7 @@ static int emu8k_pcm_open(struct snd_pcm_substream *subs) struct snd_emu8k_pcm *rec; struct snd_pcm_runtime *runtime = subs->runtime; - rec = kzalloc(sizeof(*rec), GFP_KERNEL); + rec = kzalloc_obj(*rec, GFP_KERNEL); if (! rec) return -ENOMEM; diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c index 9ad71a9fc18d..834b38de9afd 100644 --- a/sound/isa/sb/sb16_csp.c +++ b/sound/isa/sb/sb16_csp.c @@ -117,7 +117,7 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep) if (err < 0) return err; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) { snd_device_free(chip->card, hw); return -ENOMEM; diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index 0d78533e1cfd..0b91b3b28f7f 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -1381,7 +1381,7 @@ wavefront_load_patch (snd_wavefront_t *dev, const char __user *addr) wavefront_patch_info *header; int err; - header = kmalloc(sizeof(*header), GFP_KERNEL); + header = kmalloc_obj(*header, GFP_KERNEL); if (! header) return -ENOMEM; diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index f88e6a6733a5..c865c7ba3636 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c @@ -773,7 +773,7 @@ static int hal2_create(struct snd_card *card, struct snd_hal2 **rchip) struct hpc3_regs *hpc3 = hpc3c0; int err; - hal2 = kzalloc(sizeof(*hal2), GFP_KERNEL); + hal2 = kzalloc_obj(*hal2, GFP_KERNEL); if (!hal2) return -ENOMEM; diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index 077fdf2181c1..af2690d901b4 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -788,7 +788,7 @@ static int snd_sgio2audio_create(struct snd_card *card, if (!(readq(&mace->perif.audio.control) & AUDIO_CONTROL_CODEC_PRESENT)) return -ENOENT; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index 4b5a54da25fb..e9f30201cf4b 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -852,7 +852,7 @@ snd_harmony_create(struct snd_card *card, *rchip = NULL; - h = kzalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc_obj(*h, GFP_KERNEL); if (h == NULL) return -ENOMEM; diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index c54bdefa5afe..7392bc15affa 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1957,7 +1957,7 @@ int snd_ac97_bus(struct snd_card *card, int num, if (snd_BUG_ON(!card)) return -EINVAL; - bus = kzalloc(sizeof(*bus), GFP_KERNEL); + bus = kzalloc_obj(*bus, GFP_KERNEL); if (bus == NULL) return -ENOMEM; bus->card = card; @@ -2069,7 +2069,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, return -EBUSY; card = bus->card; - ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL); + ac97 = kzalloc_obj(*ac97, GFP_KERNEL); if (ac97 == NULL) return -ENOMEM; ac97->private_data = template->private_data; diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 4715d88ff8f4..9df21c42d624 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -441,7 +441,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus, unsigned int rates; struct snd_ac97 *codec; - rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL); + rpcms = kzalloc_objs(struct ac97_pcm, pcms_count, GFP_KERNEL); if (rpcms == NULL) return -ENOMEM; memset(avail_slots, 0, sizeof(avail_slots)); diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index cdad47e4098d..c7f32b1de462 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c @@ -373,7 +373,7 @@ int snd_ak4531_mixer(struct snd_card *card, return -EINVAL; if (rak4531) *rak4531 = NULL; - ak4531 = kzalloc(sizeof(*ak4531), GFP_KERNEL); + ak4531 = kzalloc_obj(*ak4531, GFP_KERNEL); if (ak4531 == NULL) return -ENOMEM; *ak4531 = *_ak4531; diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 733e84def5a7..5b82777522d8 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -342,8 +342,7 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream) { struct snd_als300 *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_als300_substream_data *data = kzalloc(sizeof(*data), - GFP_KERNEL); + struct snd_als300_substream_data *data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -370,8 +369,7 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream) { struct snd_als300 *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_als300_substream_data *data = kzalloc(sizeof(*data), - GFP_KERNEL); + struct snd_als300_substream_data *data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index fd0a67b772d1..c5f38fc88c86 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -975,7 +975,7 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_hardware snd_card_asihpi_playback; int err; - dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); if (dpcm == NULL) return -ENOMEM; @@ -1145,7 +1145,7 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) struct snd_pcm_hardware snd_card_asihpi_capture; int err; - dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); if (dpcm == NULL) return -ENOMEM; diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c index b08578c93c6a..41b2892a9312 100644 --- a/sound/pci/asihpi/hpi6000.c +++ b/sound/pci/asihpi/hpi6000.c @@ -406,7 +406,7 @@ static void subsys_create_adapter(struct hpi_message *phm, memset(&ao, 0, sizeof(ao)); - ao.priv = kzalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL); + ao.priv = kzalloc_obj(struct hpi_hw_obj, GFP_KERNEL); if (!ao.priv) { HPI_DEBUG_LOG(ERROR, "can't get mem for adapter object\n"); phr->error = HPI_ERROR_MEMORY_ALLOC; diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index c7d7eff86727..c484d929d6da 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c @@ -461,7 +461,7 @@ static void subsys_create_adapter(struct hpi_message *phm, memset(&ao, 0, sizeof(ao)); - ao.priv = kzalloc(sizeof(struct hpi_hw_obj), GFP_KERNEL); + ao.priv = kzalloc_obj(struct hpi_hw_obj, GFP_KERNEL); if (!ao.priv) { HPI_DEBUG_LOG(ERROR, "can't get mem for adapter object\n"); phr->error = HPI_ERROR_MEMORY_ALLOC; diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 7d1abaedb46a..2378bdeb1f23 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c @@ -641,13 +641,12 @@ void hpi_cmn_control_cache_sync_to_msg(struct hpi_control_cache *p_cache, struct hpi_control_cache *hpi_alloc_control_cache(const u32 control_count, const u32 size_in_bytes, u8 *p_dsp_control_buffer) { - struct hpi_control_cache *p_cache = - kmalloc(sizeof(*p_cache), GFP_KERNEL); + struct hpi_control_cache *p_cache = kmalloc_obj(*p_cache, GFP_KERNEL); if (!p_cache) return NULL; p_cache->p_info = - kcalloc(control_count, sizeof(*p_cache->p_info), GFP_KERNEL); + kzalloc_objs(*p_cache->p_info, control_count, GFP_KERNEL); if (!p_cache->p_info) { kfree(p_cache); return NULL; diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index 9acc0ac75eca..8eda87107b28 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c @@ -69,7 +69,7 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, } HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); - dsp_code->pvt = kmalloc(sizeof(*dsp_code->pvt), GFP_KERNEL); + dsp_code->pvt = kmalloc_obj(*dsp_code->pvt, GFP_KERNEL); if (!dsp_code->pvt) { err_ret = HPI_ERROR_MEMORY_ALLOC; goto error2; diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 9fb0c8e503df..24c116ab9cf5 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -105,8 +105,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (cmd != HPI_IOCTL_LINUX) return -EINVAL; - hm = kmalloc(sizeof(*hm), GFP_KERNEL); - hr = kzalloc(sizeof(*hr), GFP_KERNEL); + hm = kmalloc_obj(*hm, GFP_KERNEL); + hr = kzalloc_obj(*hr, GFP_KERNEL); if (!hm || !hr) { err = -ENOMEM; goto out; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 41774e2ef53f..bdf9453939f3 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -543,7 +543,7 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr struct snd_pcm_runtime *runtime = substream->runtime; int err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; @@ -638,7 +638,7 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre struct snd_pcm_runtime *runtime = substream->runtime; int err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (!epcm) return -ENOMEM; diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 0666be543474..189948f70d84 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -1096,7 +1096,7 @@ static int save_mixer_state(struct cmipci *cm) struct snd_ctl_elem_value *val; unsigned int i; - val = kmalloc(sizeof(*val), GFP_KERNEL); + val = kmalloc_obj(*val, GFP_KERNEL); if (!val) return -ENOMEM; for (i = 0; i < CM_SAVED_MIXERS; i++) { @@ -1130,7 +1130,7 @@ static void restore_mixer_state(struct cmipci *cm) struct snd_ctl_elem_value *val; unsigned int i; - val = kmalloc(sizeof(*val), GFP_KERNEL); + val = kmalloc_obj(*val, GFP_KERNEL); if (!val) return; cm->mixer_insensitive = 0; /* at first clear this; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index b96ab7fd464c..d7bed722d939 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -401,7 +401,7 @@ static int load_firmware(struct snd_cs46xx *chip, } err = -ENOMEM; - module = kzalloc(sizeof(*module), GFP_KERNEL); + module = kzalloc_obj(*module, GFP_KERNEL); if (!module) goto error; module->module_name = kstrdup(fw_name, GFP_KERNEL); @@ -414,7 +414,7 @@ static int load_firmware(struct snd_cs46xx *chip, if (nums >= 40) goto error_inval; module->symbol_table.symbols = - kcalloc(nums, sizeof(struct dsp_symbol_entry), GFP_KERNEL); + kzalloc_objs(struct dsp_symbol_entry, nums, GFP_KERNEL); if (!module->symbol_table.symbols) goto error; for (i = 0; i < nums; i++) { @@ -434,7 +434,7 @@ static int load_firmware(struct snd_cs46xx *chip, if (nums > 10) goto error_inval; module->segments = - kcalloc(nums, sizeof(struct dsp_segment_desc), GFP_KERNEL); + kzalloc_objs(struct dsp_segment_desc, nums, GFP_KERNEL); if (!module->segments) goto error; for (i = 0; i < nums; i++) { diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 3d34575a0e8f..f106f46aeb87 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -221,7 +221,8 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type) struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) { - struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL); + struct dsp_spos_instance * ins = kzalloc_obj(struct dsp_spos_instance, + GFP_KERNEL); if (ins == NULL) return NULL; @@ -231,9 +232,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) vmalloc(array_size(DSP_MAX_SYMBOLS, sizeof(struct dsp_symbol_entry))); ins->code.data = kmalloc(DSP_CODE_BYTE_SIZE, GFP_KERNEL); - ins->modules = kmalloc_array(DSP_MAX_MODULES, - sizeof(struct dsp_module_desc), - GFP_KERNEL); + ins->modules = kmalloc_objs(struct dsp_module_desc, DSP_MAX_MODULES, + GFP_KERNEL); if (!ins->symbol_table.symbols || !ins->code.data || !ins->modules) { cs46xx_dsp_spos_destroy(chip); goto error; diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 32ed415bf427..c55ff043d1d7 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -234,7 +234,7 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, ins->proc_dsp_dir); if (entry) { - scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL); + scb_info = kmalloc_obj(struct proc_scb_info, GFP_KERNEL); if (!scb_info) { snd_info_free_entry(entry); entry = NULL; diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c index c30162be27ee..c22e3173ec1b 100644 --- a/sound/pci/ctxfi/ctamixer.c +++ b/sound/pci/ctxfi/ctamixer.c @@ -296,7 +296,7 @@ int amixer_mgr_create(struct hw *hw, void **ramixer_mgr) struct amixer_mgr *amixer_mgr; *ramixer_mgr = NULL; - amixer_mgr = kzalloc(sizeof(*amixer_mgr), GFP_KERNEL); + amixer_mgr = kzalloc_obj(*amixer_mgr, GFP_KERNEL); if (!amixer_mgr) return -ENOMEM; @@ -448,7 +448,7 @@ int sum_mgr_create(struct hw *hw, void **rsum_mgr) struct sum_mgr *sum_mgr; *rsum_mgr = NULL; - sum_mgr = kzalloc(sizeof(*sum_mgr), GFP_KERNEL); + sum_mgr = kzalloc_obj(*sum_mgr, GFP_KERNEL); if (!sum_mgr) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index a25a599fc5be..f130a2722a70 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1723,7 +1723,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci, *ratc = NULL; - atc = kzalloc(sizeof(*atc), GFP_KERNEL); + atc = kzalloc_obj(*atc, GFP_KERNEL); if (!atc) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 1c8f8efd836c..12653f7cd9e8 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c @@ -159,7 +159,7 @@ static int dao_set_left_input(struct dao *dao, struct rsc *input) struct daio *daio = &dao->daio; int i; - entry = kcalloc(daio->rscl.msr, sizeof(*entry), GFP_KERNEL); + entry = kzalloc_objs(*entry, daio->rscl.msr, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -188,7 +188,7 @@ static int dao_set_right_input(struct dao *dao, struct rsc *input) struct daio *daio = &dao->daio; int i; - entry = kcalloc(daio->rscr.msr, sizeof(*entry), GFP_KERNEL); + entry = kzalloc_objs(*entry, daio->rscr.msr, GFP_KERNEL); if (!entry) return -ENOMEM; @@ -660,7 +660,7 @@ int daio_mgr_create(struct hw *hw, void **rdaio_mgr) struct imapper *entry; *rdaio_mgr = NULL; - daio_mgr = kzalloc(sizeof(*daio_mgr), GFP_KERNEL); + daio_mgr = kzalloc_obj(*daio_mgr, GFP_KERNEL); if (!daio_mgr) return -ENOMEM; @@ -671,7 +671,7 @@ int daio_mgr_create(struct hw *hw, void **rdaio_mgr) spin_lock_init(&daio_mgr->mgr_lock); spin_lock_init(&daio_mgr->imap_lock); INIT_LIST_HEAD(&daio_mgr->imappers); - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto error2; diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index ea0a928937b6..0851453b8565 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -157,7 +157,7 @@ static int src_get_rsc_ctrl_blk(void **rblk) struct src_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -483,7 +483,7 @@ static int src_mgr_get_ctrl_blk(void **rblk) struct src_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -504,7 +504,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk) struct srcimp_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -691,7 +691,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk) struct amixer_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -898,7 +898,7 @@ static int dai_get_ctrl_blk(void **rblk) struct dai_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -947,7 +947,7 @@ static int dao_get_ctrl_blk(void **rblk) struct dao_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -1141,7 +1141,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk) struct daio_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -2227,7 +2227,7 @@ int create_20k1_hw_obj(struct hw **rhw) struct hw20k1 *hw20k1; *rhw = NULL; - hw20k1 = kzalloc(sizeof(*hw20k1), GFP_KERNEL); + hw20k1 = kzalloc_obj(*hw20k1, GFP_KERNEL); if (!hw20k1) return -ENOMEM; diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index fac88f5590c9..1d558914a26a 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -157,7 +157,7 @@ static int src_get_rsc_ctrl_blk(void **rblk) struct src_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -483,7 +483,7 @@ static int src_mgr_get_ctrl_blk(void **rblk) struct src_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -504,7 +504,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk) struct srcimp_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -693,7 +693,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk) struct amixer_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -882,7 +882,7 @@ static int dai_get_ctrl_blk(void **rblk) struct dai_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -932,7 +932,7 @@ static int dao_get_ctrl_blk(void **rblk) struct dao_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -1084,7 +1084,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk) int i; *rblk = NULL; - blk = kzalloc(sizeof(*blk), GFP_KERNEL); + blk = kzalloc_obj(*blk, GFP_KERNEL); if (!blk) return -ENOMEM; @@ -2369,7 +2369,7 @@ int create_20k2_hw_obj(struct hw **rhw) struct hw20k2 *hw20k2; *rhw = NULL; - hw20k2 = kzalloc(sizeof(*hw20k2), GFP_KERNEL); + hw20k2 = kzalloc_obj(*hw20k2, GFP_KERNEL); if (!hw20k2) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c index fc9fde284fb3..3c5b89f3eae3 100644 --- a/sound/pci/ctxfi/ctmixer.c +++ b/sound/pci/ctxfi/ctmixer.c @@ -969,7 +969,7 @@ static int ct_mixer_get_mem(struct ct_mixer **rmixer) *rmixer = NULL; /* Allocate mem for mixer obj */ - mixer = kzalloc(sizeof(*mixer), GFP_KERNEL); + mixer = kzalloc_obj(*mixer, GFP_KERNEL); if (!mixer) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 81dfc6a76b18..2b0f4130642c 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c @@ -119,7 +119,7 @@ static int ct_pcm_playback_open(struct snd_pcm_substream *substream) struct ct_atc_pcm *apcm; int err; - apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); + apcm = kzalloc_obj(*apcm, GFP_KERNEL); if (!apcm) return -ENOMEM; @@ -265,7 +265,7 @@ static int ct_pcm_capture_open(struct snd_pcm_substream *substream) struct ct_atc_pcm *apcm; int err; - apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); + apcm = kzalloc_obj(*apcm, GFP_KERNEL); if (!apcm) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index 46afc9604c08..b781201c7f0e 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c @@ -540,7 +540,7 @@ int src_mgr_create(struct hw *hw, void **rsrc_mgr) struct src_mgr *src_mgr; *rsrc_mgr = NULL; - src_mgr = kzalloc(sizeof(*src_mgr), GFP_KERNEL); + src_mgr = kzalloc_obj(*src_mgr, GFP_KERNEL); if (!src_mgr) return -ENOMEM; @@ -669,8 +669,7 @@ static int srcimp_rsc_init(struct srcimp *srcimp, return err; /* Reserve memory for imapper nodes */ - srcimp->imappers = kcalloc(desc->msr, sizeof(struct imapper), - GFP_KERNEL); + srcimp->imappers = kzalloc_objs(struct imapper, desc->msr, GFP_KERNEL); if (!srcimp->imappers) { err = -ENOMEM; goto error1; @@ -811,7 +810,7 @@ int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr) struct imapper *entry; *rsrcimp_mgr = NULL; - srcimp_mgr = kzalloc(sizeof(*srcimp_mgr), GFP_KERNEL); + srcimp_mgr = kzalloc_obj(*srcimp_mgr, GFP_KERNEL); if (!srcimp_mgr) return -ENOMEM; @@ -822,7 +821,7 @@ int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr) spin_lock_init(&srcimp_mgr->mgr_lock); spin_lock_init(&srcimp_mgr->imap_lock); INIT_LIST_HEAD(&srcimp_mgr->imappers); - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) { err = -ENOMEM; goto error2; diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c index 609b10320ff7..53d16f575c38 100644 --- a/sound/pci/ctxfi/cttimer.c +++ b/sound/pci/ctxfi/cttimer.c @@ -390,7 +390,7 @@ struct ct_timer *ct_timer_new(struct ct_atc *atc) struct ct_timer *atimer; struct hw *hw; - atimer = kzalloc(sizeof(*atimer), GFP_KERNEL); + atimer = kzalloc_obj(*atimer, GFP_KERNEL); if (!atimer) return NULL; spin_lock_init(&atimer->lock); diff --git a/sound/pci/ctxfi/ctvmem.c b/sound/pci/ctxfi/ctvmem.c index 823d6e240a07..316072863dbf 100644 --- a/sound/pci/ctxfi/ctvmem.c +++ b/sound/pci/ctxfi/ctvmem.c @@ -55,7 +55,7 @@ get_vm_block(struct ct_vm *vm, unsigned int size, struct ct_atc *atc) return entry; } - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (!block) return NULL; @@ -170,7 +170,7 @@ int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci) *rvm = NULL; - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = kzalloc_obj(*vm, GFP_KERNEL); if (!vm) return -ENOMEM; @@ -195,7 +195,7 @@ int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci) vm->get_ptp_phys = ct_get_ptp_phys; INIT_LIST_HEAD(&vm->unused); INIT_LIST_HEAD(&vm->used); - block = kzalloc(sizeof(*block), GFP_KERNEL); + block = kzalloc_obj(*block, GFP_KERNEL); if (NULL != block) { block->addr = 0; block->size = vm->size; diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 8b7b6838106f..fdf309633c8a 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -265,7 +265,7 @@ static int pcm_open(struct snd_pcm_substream *substream, chip = snd_pcm_substream_chip(substream); runtime = substream->runtime; - pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL); + pipe = kzalloc_obj(struct audiopipe, GFP_KERNEL); if (!pipe) return -ENOMEM; pipe->index = -1; /* Not configured yet */ diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 9607a0f7174b..e79f773941cd 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -367,7 +367,7 @@ static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream) if (err < 0) return err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = chip; @@ -547,7 +547,7 @@ static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream) if (err < 0) return err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index 37af7bf76347..a9c786fe638a 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -776,7 +776,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu, if (snd_emu10k1_look_for_ctl(emu, &id) == NULL) return -ENOENT; } - gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); + gctl = kmalloc_obj(*gctl, GFP_KERNEL); if (! gctl) return -ENOMEM; err = 0; @@ -864,9 +864,9 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, struct snd_ctl_elem_value *val; int err = 0; - val = kmalloc(sizeof(*val), GFP_KERNEL); - gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); - nctl = kmalloc(sizeof(*nctl), GFP_KERNEL); + val = kmalloc_obj(*val, GFP_KERNEL); + gctl = kmalloc_obj(*gctl, GFP_KERNEL); + nctl = kmalloc_obj(*nctl, GFP_KERNEL); if (!val || !gctl || !nctl) { err = -ENOMEM; goto __error; @@ -914,7 +914,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, nctl->max = gctl->max; nctl->translation = gctl->translation; if (ctl == NULL) { - ctl = kmalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kmalloc_obj(*ctl, GFP_KERNEL); if (ctl == NULL) { err = -ENOMEM; kfree(knew.tlv.p); @@ -980,7 +980,7 @@ static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu, struct snd_emu10k1_fx8010_ctl *ctl; struct snd_ctl_elem_id *id; - gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); + gctl = kmalloc_obj(*gctl, GFP_KERNEL); if (! gctl) return -ENOMEM; @@ -1282,16 +1282,15 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) u32 *gpr_map; err = -ENOMEM; - icode = kzalloc(sizeof(*icode), GFP_KERNEL); + icode = kzalloc_obj(*icode, GFP_KERNEL); if (!icode) return err; - icode->gpr_map = kcalloc(512 + 256 + 256 + 2 * 1024, - sizeof(u_int32_t), GFP_KERNEL); + icode->gpr_map = kzalloc_objs(u_int32_t, 512 + 256 + 256 + 2 * 1024, + GFP_KERNEL); if (!icode->gpr_map) goto __err_gpr; - controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, - sizeof(*controls), GFP_KERNEL); + controls = kzalloc_objs(*controls, SND_EMU10K1_GPR_CONTROLS, GFP_KERNEL); if (!controls) goto __err_ctrls; @@ -1800,22 +1799,21 @@ static int _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) u32 *gpr_map; err = -ENOMEM; - icode = kzalloc(sizeof(*icode), GFP_KERNEL); + icode = kzalloc_obj(*icode, GFP_KERNEL); if (!icode) return err; - icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512, - sizeof(u_int32_t), GFP_KERNEL); + icode->gpr_map = kzalloc_objs(u_int32_t, 256 + 160 + 160 + 2 * 512, + GFP_KERNEL); if (!icode->gpr_map) goto __err_gpr; - controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, - sizeof(struct snd_emu10k1_fx8010_control_gpr), - GFP_KERNEL); + controls = kzalloc_objs(struct snd_emu10k1_fx8010_control_gpr, + SND_EMU10K1_GPR_CONTROLS, GFP_KERNEL); if (!controls) goto __err_ctrls; - ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL); + ipcm = kzalloc_obj(*ipcm, GFP_KERNEL); if (!ipcm) goto __err_ipcm; diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 071c75ba81fd..1a0fd2014691 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1132,7 +1132,7 @@ static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int i, j, err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1171,7 +1171,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int i, err, sample_rate; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1222,7 +1222,7 @@ static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_emu10k1_pcm *epcm; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1259,7 +1259,7 @@ static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream) struct snd_emu10k1_pcm *epcm; struct snd_pcm_runtime *runtime = substream->runtime; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1299,7 +1299,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) int nefx = emu->audigy ? 64 : 32; int idx, err; - epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); + epcm = kzalloc_obj(*epcm, GFP_KERNEL); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 51aee2c4d461..6650f0192281 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -1307,7 +1307,7 @@ static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size) __found: if (buf->buf.bytes > size) { - struct esm_memory *chunk = kmalloc(sizeof(*chunk), GFP_KERNEL); + struct esm_memory *chunk = kmalloc_obj(*chunk, GFP_KERNEL); if (chunk == NULL) return NULL; chunk->buf = buf->buf; @@ -1385,7 +1385,7 @@ snd_es1968_init_dmabuf(struct es1968 *chip) INIT_LIST_HEAD(&chip->buf_list); /* allocate an empty chunk */ - chunk = kmalloc(sizeof(*chunk), GFP_KERNEL); + chunk = kmalloc_obj(*chunk, GFP_KERNEL); if (chunk == NULL) { snd_es1968_free_dmabuf(chip); return -ENOMEM; @@ -1488,7 +1488,7 @@ static int snd_es1968_playback_open(struct snd_pcm_substream *substream) if (apu1 < 0) return apu1; - es = kzalloc(sizeof(*es), GFP_KERNEL); + es = kzalloc_obj(*es, GFP_KERNEL); if (!es) { snd_es1968_free_apu_pair(chip, apu1); return -ENOMEM; @@ -1529,7 +1529,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream) return apu2; } - es = kzalloc(sizeof(*es), GFP_KERNEL); + es = kzalloc_obj(*es, GFP_KERNEL); if (!es) { snd_es1968_free_apu_pair(chip, apu1); snd_es1968_free_apu_pair(chip, apu2); diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c index cad33a2f26bc..e82bfc02599e 100644 --- a/sound/pci/ice1712/ak4xxx.c +++ b/sound/pci/ice1712/ak4xxx.c @@ -115,7 +115,7 @@ int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *t struct snd_ak4xxx_private *priv; if (_priv != NULL) { - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kmalloc_obj(*priv, GFP_KERNEL); if (priv == NULL) return -ENOMEM; *priv = *_priv; diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index b4c9e7d11609..92c4950137b0 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c @@ -2076,7 +2076,7 @@ static int aureon_init(struct snd_ice1712 *ice) struct aureon_spec *spec; int i, err; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -2091,7 +2091,7 @@ static int aureon_init(struct snd_ice1712 *ice) } /* to remember the register values of CS8415 */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (!ice->akm) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index e5a9585cba4c..5ea80bd596e6 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c @@ -707,7 +707,7 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) } /* second stage of initialization, analog parts and others */ - ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ak = ice->akm = kmalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index 1dffcb011deb..43a0a569de1b 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -431,7 +431,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) break; } - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -530,7 +530,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) } /* analog section */ - ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ak = ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c index 071f94dc7390..ab651526aba9 100644 --- a/sound/pci/ice1712/hoontech.c +++ b/sound/pci/ice1712/hoontech.c @@ -156,7 +156,7 @@ static int hoontech_init(struct snd_ice1712 *ice, bool staudio) ice->num_total_dacs = 8; ice->num_total_adcs = 8; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -301,7 +301,7 @@ static int snd_ice1712_value_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; /* analog section */ - ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ak = ice->akm = kmalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index d679842ae1bd..10f0eb7b347d 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -560,7 +560,7 @@ static int juli_init(struct snd_ice1712 *ice) struct juli_spec *spec; struct snd_akm4xxx *ak; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -594,7 +594,7 @@ static int juli_init(struct snd_ice1712 *ice) ice->num_total_dacs = 2; ice->num_total_adcs = 2; - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index 551f478c59c4..b854fec347c4 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c @@ -668,7 +668,7 @@ static int maya44_init(struct snd_ice1712 *ice) int i; struct snd_maya44 *chip; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; mutex_init(&chip->mutex); diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index 151b740ce66d..00f97b87b06c 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c @@ -125,7 +125,7 @@ static int phase22_init(struct snd_ice1712 *ice) } /* Initialize analog chips */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); ak = ice->akm; if (!ak) return -ENOMEM; @@ -411,13 +411,13 @@ static int phase28_init(struct snd_ice1712 *ice) ice->num_total_dacs = 8; ice->num_total_adcs = 2; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; /* Initialize analog chips */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 557473f0d59e..80f7bb3af420 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -728,7 +728,7 @@ static int pontis_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; /* to remember the register values */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index cd7db2b65b51..039ead80dd64 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c @@ -713,7 +713,7 @@ static int prodigy192_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */ - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index eac233093865..105409daf071 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c @@ -1060,12 +1060,12 @@ static int prodigy_hifi_init(struct snd_ice1712 *ice) ice->gpio.saved[0] = 0; /* to remember the register values */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -1143,12 +1143,12 @@ static int prodigy_hd2_init(struct snd_ice1712 *ice) ice->gpio.saved[0] = 0; /* to remember the register values */ - ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/psc724.c b/sound/pci/ice1712/psc724.c index 0818e42c94ca..bb69d5173983 100644 --- a/sound/pci/ice1712/psc724.c +++ b/sound/pci/ice1712/psc724.c @@ -383,7 +383,7 @@ static int psc724_init(struct snd_ice1712 *ice) { struct psc724_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 099601edf1d0..a4f13a3ed6cf 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -969,7 +969,7 @@ static int qtet_init(struct snd_ice1712 *ice) val = inb(ICEMT1724(ice, RATE)); outb(val | VT1724_SPDIF_MASTER, ICEMT1724(ice, RATE)); - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; /* qtet is clocked by Xilinx array */ @@ -1005,7 +1005,7 @@ static int qtet_init(struct snd_ice1712 *ice) ice->num_total_dacs = 2; ice->num_total_adcs = 2; - ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL); + ice->akm = kzalloc_objs(struct snd_akm4xxx, 2, GFP_KERNEL); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index bcf114152dfd..37556ff6fb36 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c @@ -147,7 +147,7 @@ static int revo51_i2c_init(struct snd_ice1712 *ice, struct revo51_spec *spec; int err; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -470,7 +470,7 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice) int err; struct revo51_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; @@ -515,7 +515,7 @@ static int revo_init(struct snd_ice1712 *ice) } /* second stage of initialization, analog parts and others */ - ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL); + ak = ice->akm = kzalloc_objs(struct snd_akm4xxx, 2, GFP_KERNEL); if (! ak) return -ENOMEM; switch (ice->eeprom.subvendor) { diff --git a/sound/pci/ice1712/se.c b/sound/pci/ice1712/se.c index ffa9d8860a5a..09f5085d2dde 100644 --- a/sound/pci/ice1712/se.c +++ b/sound/pci/ice1712/se.c @@ -660,7 +660,7 @@ static int se_init(struct snd_ice1712 *ice) { struct se_spec *spec; - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c index 57a79536e7ba..0c961b588cd2 100644 --- a/sound/pci/ice1712/wtm.c +++ b/sound/pci/ice1712/wtm.c @@ -579,7 +579,7 @@ static int wtm_init(struct snd_ice1712 *ice) ice->force_rdma1 = 1; /*init mutex for dac mute conflict*/ - spec = kzalloc(sizeof(*spec), GFP_KERNEL); + spec = kzalloc_obj(*spec, GFP_KERNEL); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index c6319e75beab..bcf36b102f6f 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -255,7 +255,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, "add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); - buf = kmalloc(sizeof(*buf), GFP_KERNEL); + buf = kmalloc_obj(*buf, GFP_KERNEL); if (!buf) return NULL; @@ -1017,7 +1017,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int .dev_free = snd_mixart_chip_dev_free, }; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; @@ -1243,7 +1243,7 @@ static int snd_mixart_probe(struct pci_dev *pci, /* */ - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (! mgr) { pci_disable_device(pci); return -ENOMEM; diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index 689c0f995a9c..9b19c83a26c5 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c @@ -135,9 +135,9 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) struct mixart_audio_info_req *audio_info_req; struct mixart_audio_info_resp *audio_info; - connector = kmalloc(sizeof(*connector), GFP_KERNEL); - audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL); - audio_info = kmalloc(sizeof(*audio_info), GFP_KERNEL); + connector = kmalloc_obj(*connector, GFP_KERNEL); + audio_info_req = kmalloc_obj(*audio_info_req, GFP_KERNEL); + audio_info = kmalloc_obj(*audio_info, GFP_KERNEL); if (! connector || ! audio_info_req || ! audio_info) { err = -ENOMEM; goto __error; diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 83066d08367e..66e71bdfbc77 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1163,7 +1163,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr, .dev_free = pcxhr_chip_dev_free, }; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (!chip) return -ENOMEM; @@ -1488,7 +1488,7 @@ static int pcxhr_probe(struct pci_dev *pci, } /* alloc card manager */ - mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); + mgr = kzalloc_obj(*mgr, GFP_KERNEL); if (! mgr) { pci_disable_device(pci); return -ENOMEM; diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index f91fe64bf4f9..8217a42c5bb7 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -1595,7 +1595,7 @@ static int snd_riptide_playback_open(struct snd_pcm_substream *substream) chip->playback_substream[sub_num] = substream; runtime->hw = snd_riptide_playback; - data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); + data = kzalloc_obj(struct pcmhw, GFP_KERNEL); if (data == NULL) return -ENOMEM; data->paths = lbus_play_paths[sub_num]; @@ -1618,7 +1618,7 @@ static int snd_riptide_capture_open(struct snd_pcm_substream *substream) chip->capture_substream = substream; runtime->hw = snd_riptide_capture; - data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); + data = kzalloc_obj(struct pcmhw, GFP_KERNEL); if (data == NULL) return -ENOMEM; data->paths = lbus_rec_path; @@ -1768,7 +1768,7 @@ static int snd_riptide_initialize(struct snd_riptide *chip) cif = chip->cif; if (!cif) { - cif = kzalloc(sizeof(struct cmdif), GFP_KERNEL); + cif = kzalloc_obj(struct cmdif, GFP_KERNEL); if (!cif) return -ENOMEM; cif->dev = chip->card->dev; diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 3ba5bdc96d9d..2978036aa8c5 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -6671,7 +6671,7 @@ static int snd_hdspm_create(struct snd_card *card, if (hdspm_read(hdspm, HDSPM_statusRegister2) & HDSPM_s2_tco_detect) { hdspm->midiPorts++; - hdspm->tco = kzalloc(sizeof(*hdspm->tco), GFP_KERNEL); + hdspm->tco = kzalloc_obj(*hdspm->tco, GFP_KERNEL); if (hdspm->tco) hdspm_tco_write(hdspm); @@ -6685,7 +6685,7 @@ static int snd_hdspm_create(struct snd_card *card, case AES32: if (hdspm_read(hdspm, HDSPM_statusRegister) & HDSPM_tco_detect) { hdspm->midiPorts++; - hdspm->tco = kzalloc(sizeof(*hdspm->tco), GFP_KERNEL); + hdspm->tco = kzalloc_obj(*hdspm->tco, GFP_KERNEL); if (hdspm->tco) hdspm_tco_write(hdspm); diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 55515c58b8aa..b0f1433e530f 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -2888,7 +2888,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) .read = snd_trident_codec_read, }; - uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); + uctl = kzalloc_obj(*uctl, GFP_KERNEL); if (!uctl) return -ENOMEM; diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 2b0f9e38863e..0290bf6b089d 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -423,9 +423,8 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre return -ENOMEM; } if (! dev->idx_table) { - dev->idx_table = kmalloc_array(VIA_TABLE_SIZE, - sizeof(*dev->idx_table), - GFP_KERNEL); + dev->idx_table = kmalloc_objs(*dev->idx_table, VIA_TABLE_SIZE, + GFP_KERNEL); if (! dev->idx_table) return -ENOMEM; } diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 6ce2cd88cda6..94430e87791d 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -278,9 +278,8 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre return -ENOMEM; } if (! dev->idx_table) { - dev->idx_table = kmalloc_array(VIA_TABLE_SIZE, - sizeof(*dev->idx_table), - GFP_KERNEL); + dev->idx_table = kmalloc_objs(*dev->idx_table, VIA_TABLE_SIZE, + GFP_KERNEL); if (! dev->idx_table) return -ENOMEM; } diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index eb373d9395e3..dc6f603160ac 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -864,7 +864,7 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream) if (err < 0) return err; - ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); + ypcm = kzalloc_obj(*ypcm, GFP_KERNEL); if (ypcm == NULL) return -ENOMEM; ypcm->chip = chip; @@ -990,7 +990,7 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream, if (err < 0) return err; - ypcm = kzalloc(sizeof(*ypcm), GFP_KERNEL); + ypcm = kzalloc_obj(*ypcm, GFP_KERNEL); if (ypcm == NULL) return -ENOMEM; ypcm->chip = chip; diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index a104baac3a94..c0ae099963c8 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c @@ -142,7 +142,7 @@ struct snd_pdacf *snd_pdacf_create(struct snd_card *card) { struct snd_pdacf *chip; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return NULL; chip->card = card; diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index c231a9d6d1de..5d5fccb71d70 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c @@ -896,7 +896,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf; #ifdef PMAC_AMP_AVAIL if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) { - struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL); + struct awacs_amp *amp = kzalloc_obj(*amp, GFP_KERNEL); if (! amp) return -ENOMEM; chip->mixer_data = amp; diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index ab2468790b0c..5e5370e83d56 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c @@ -208,7 +208,7 @@ int snd_pmac_attach_beep(struct snd_pmac *chip) void *dmabuf; int err = -ENOMEM; - beep = kzalloc(sizeof(*beep), GFP_KERNEL); + beep = kzalloc_obj(*beep, GFP_KERNEL); if (! beep) return -ENOMEM; dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4, diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index a74114225b67..12829f724d86 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -244,7 +244,7 @@ int snd_pmac_daca_init(struct snd_pmac *chip) request_module("i2c-powermac"); - mix = kzalloc(sizeof(*mix), GFP_KERNEL); + mix = kzalloc_obj(*mix, GFP_KERNEL); if (! mix) return -ENOMEM; chip->mixer_data = mix; diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 6d7dab26ddf2..1384484fd996 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1143,7 +1143,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) *chip_return = NULL; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; chip->card = card; diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 3c09660e1522..6cc51dcecb7e 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -1348,7 +1348,7 @@ int snd_pmac_tumbler_init(struct snd_pmac *chip) request_module("i2c-powermac"); - mix = kzalloc(sizeof(*mix), GFP_KERNEL); + mix = kzalloc_obj(*mix, GFP_KERNEL); if (! mix) return -ENOMEM; mix->headphone_irq = -1; diff --git a/sound/sh/aica.c b/sound/sh/aica.c index fa81bfba59c1..f6a80f04d043 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c @@ -330,7 +330,7 @@ static int snd_aicapcm_pcm_open(struct snd_pcm_substream if (!enable) return -ENOENT; dreamcastcard = substream->pcm->private_data; - channel = kmalloc(sizeof(struct aica_channel), GFP_KERNEL); + channel = kmalloc_obj(struct aica_channel, GFP_KERNEL); if (!channel) return -ENOMEM; /* set defaults for channel */ @@ -559,7 +559,7 @@ static int snd_aica_probe(struct platform_device *devptr) { int err; struct snd_card_aica *dreamcastcard; - dreamcastcard = kzalloc(sizeof(struct snd_card_aica), GFP_KERNEL); + dreamcastcard = kzalloc_obj(struct snd_card_aica, GFP_KERNEL); if (unlikely(!dreamcastcard)) return -ENOMEM; err = snd_card_new(&devptr->dev, index, SND_AICA_DRIVER, diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index 164f91240d02..e0ba12662da1 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c @@ -306,7 +306,7 @@ static int snd_sh_dac_create(struct snd_card *card, *rchip = NULL; - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = kzalloc_obj(*chip, GFP_KERNEL); if (chip == NULL) return -ENOMEM; diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 897dde630022..19c09ba2b510 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -775,7 +775,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_runtime *runtime = substream->runtime; struct audio_drv_data *intr_data = dev_get_drvdata(component->dev); struct audio_substream_data *adata = - kzalloc(sizeof(struct audio_substream_data), GFP_KERNEL); + kzalloc_obj(struct audio_substream_data, GFP_KERNEL); if (!adata) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index b25ac5612808..66a30da4b801 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -196,7 +196,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs struct acp_stream *stream; int ret; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c index c93fc0920a3e..c1c28fee0496 100644 --- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c +++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c @@ -395,13 +395,13 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) /* One per DAI link, worst case is a DAI link for every endpoint */ struct asoc_sdw_dailink *soc_dais __free(kfree) = - kcalloc(num_ends, sizeof(*soc_dais), GFP_KERNEL); + kzalloc_objs(*soc_dais, num_ends, GFP_KERNEL); if (!soc_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ struct asoc_sdw_endpoint *soc_ends __free(kfree) = - kcalloc(num_ends, sizeof(*soc_ends), GFP_KERNEL); + kzalloc_objs(*soc_ends, num_ends, GFP_KERNEL); if (!soc_ends) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index da815b3f6389..3319f0996fe6 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -288,13 +288,13 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) /* One per DAI link, worst case is a DAI link for every endpoint */ struct asoc_sdw_dailink *sof_dais __free(kfree) = - kcalloc(num_ends, sizeof(*sof_dais), GFP_KERNEL); + kzalloc_objs(*sof_dais, num_ends, GFP_KERNEL); if (!sof_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ struct asoc_sdw_endpoint *sof_ends __free(kfree) = - kcalloc(num_ends, sizeof(*sof_ends), GFP_KERNEL); + kzalloc_objs(*sof_ends, num_ends, GFP_KERNEL); if (!sof_ends) return -ENOMEM; diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 9cfbe05ad996..5a4ba65847fd 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -189,7 +189,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc(sizeof(*pdm_data), GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 5449323e2728..0c7af398de3a 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -318,7 +318,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component, runtime = substream->runtime; cpu_dai = snd_soc_rtd_to_cpu(prtd, 0); amd_manager = snd_soc_dai_get_drvdata(cpu_dai); - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index bb9ed52d744d..2716c4e18c1f 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -218,7 +218,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, prtd = snd_soc_substream_to_rtd(substream); component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); adata = dev_get_drvdata(component->dev); - i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL); + i2s_data = kzalloc_obj(*i2s_data, GFP_KERNEL); if (!i2s_data) return -EINVAL; diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index a560d06097d5..c2dd512118ad 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -211,7 +211,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc(sizeof(*pdm_data), GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index aa4726899434..c52d2bed5c6c 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -213,7 +213,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); adata = dev_get_drvdata(component->dev); - i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL); + i2s_data = kzalloc_obj(*i2s_data, GFP_KERNEL); if (!i2s_data) return -ENOMEM; diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index ac758b90f441..b4fece9d3fac 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -187,7 +187,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc(sizeof(*pdm_data), GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7db8df85c54f..3b3e6b2b3a50 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -288,7 +288,7 @@ static int atmel_pcm_open(struct snd_soc_component *component, if (ret < 0) goto out; - prtd = kzalloc(sizeof(struct atmel_runtime_data), GFP_KERNEL); + prtd = kzalloc_obj(struct atmel_runtime_data, GFP_KERNEL); if (prtd == NULL) { ret = -ENOMEM; goto out; diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c index 06dc3c48e7e8..d31508419fe3 100644 --- a/sound/soc/atmel/mchp-pdmc.c +++ b/sound/soc/atmel/mchp-pdmc.c @@ -706,7 +706,7 @@ static int mchp_pdmc_add_chmap_ctls(struct snd_pcm *pcm, struct mchp_pdmc *dd) if (WARN_ON(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].chmap_kctl)) return -EBUSY; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return -ENOMEM; info->pcm = pcm; diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index c9c2b1e71d55..46bcdaa0532c 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -81,7 +81,7 @@ static int au1000_setup_dma_link(struct audio_stream *stream, stream->period_size = period_bytes; stream->periods = periods; - stream->buffer = kmalloc(sizeof(struct pcm_period), GFP_KERNEL); + stream->buffer = kmalloc_obj(struct pcm_period, GFP_KERNEL); if (!stream->buffer) return -ENOMEM; pointer = stream->buffer; @@ -89,8 +89,8 @@ static int au1000_setup_dma_link(struct audio_stream *stream, pointer->start = (u32)(dma_start + (i * period_bytes)); pointer->relative_end = (u32) (((i+1) * period_bytes) - 0x1); if (i < periods - 1) { - pointer->next = kmalloc(sizeof(struct pcm_period), - GFP_KERNEL); + pointer->next = kmalloc_obj(struct pcm_period, + GFP_KERNEL); if (!pointer->next) { au1000_release_dma_link(stream); return -ENOMEM; diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c index efeb06ddabeb..a7bc7060f742 100644 --- a/sound/soc/bcm/bcm63xx-pcm-whistler.c +++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c @@ -48,7 +48,7 @@ static int bcm63xx_pcm_hw_params(struct snd_soc_component *component, struct i2s_dma_desc *dma_desc; struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - dma_desc = kzalloc(sizeof(*dma_desc), GFP_NOWAIT); + dma_desc = kzalloc_obj(*dma_desc, GFP_NOWAIT); if (!dma_desc) return -ENOMEM; @@ -210,7 +210,7 @@ static int bcm63xx_pcm_open(struct snd_soc_component *component, goto out; ret = -ENOMEM; - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (!prtd) goto out; diff --git a/sound/soc/codecs/aw88395/aw88395_lib.c b/sound/soc/codecs/aw88395/aw88395_lib.c index ceb7fc43d018..31799ca5bb0f 100644 --- a/sound/soc/codecs/aw88395/aw88395_lib.c +++ b/sound/soc/codecs/aw88395/aw88395_lib.c @@ -665,8 +665,8 @@ static int aw_dev_load_cfg_by_hdr(struct aw_device *aw_dev, { int ret; - struct aw_all_prof_info *all_prof_info __free(kfree) = kzalloc(sizeof(*all_prof_info), - GFP_KERNEL); + struct aw_all_prof_info *all_prof_info __free(kfree) = kzalloc_obj(*all_prof_info, + GFP_KERNEL); if (!all_prof_info) return -ENOMEM; diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index d6121c0a2616..b0383eb47407 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c @@ -346,7 +346,7 @@ static int cx20442_component_probe(struct snd_soc_component *component) { struct cx20442_priv *cx20442; - cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL); + cx20442 = kzalloc_obj(struct cx20442_priv, GFP_KERNEL); if (cx20442 == NULL) return -ENOMEM; diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 298a626df3ad..1f890294064c 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -2143,8 +2143,8 @@ static int da7219_register_dai_clks(struct snd_soc_component *component) /* For DT platforms allocate onecell data for clock registration */ if (np) { - clk_data = kzalloc(struct_size(clk_data, hws, DA7219_DAI_NUM_CLKS), - GFP_KERNEL); + clk_data = kzalloc_flex(*clk_data, hws, DA7219_DAI_NUM_CLKS, + GFP_KERNEL); if (!clk_data) return -ENOMEM; diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index 0a8de5620e72..b6a2c39882ac 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -3820,7 +3820,8 @@ static int rx_macro_probe(struct platform_device *pdev) rx->rxn_reg_stride = 0x80; rx->rxn_reg_stride2 = 0xc; def_count = ARRAY_SIZE(rx_defaults) + ARRAY_SIZE(rx_pre_2_5_defaults); - reg_defaults = kmalloc_array(def_count, sizeof(struct reg_default), GFP_KERNEL); + reg_defaults = kmalloc_objs(struct reg_default, def_count, + GFP_KERNEL); if (!reg_defaults) return -ENOMEM; memcpy(®_defaults[0], rx_defaults, sizeof(rx_defaults)); @@ -3834,7 +3835,8 @@ static int rx_macro_probe(struct platform_device *pdev) rx->rxn_reg_stride = 0xc0; rx->rxn_reg_stride2 = 0x0; def_count = ARRAY_SIZE(rx_defaults) + ARRAY_SIZE(rx_2_5_defaults); - reg_defaults = kmalloc_array(def_count, sizeof(struct reg_default), GFP_KERNEL); + reg_defaults = kmalloc_objs(struct reg_default, def_count, + GFP_KERNEL); if (!reg_defaults) return -ENOMEM; memcpy(®_defaults[0], rx_defaults, sizeof(rx_defaults)); diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c index b695c77c18ac..e26aaea450d6 100644 --- a/sound/soc/codecs/lpass-wsa-macro.c +++ b/sound/soc/codecs/lpass-wsa-macro.c @@ -2725,8 +2725,8 @@ static int wsa_macro_probe(struct platform_device *pdev) case LPASS_CODEC_VERSION_2_1: wsa->reg_layout = &wsa_codec_v2_1; def_count = ARRAY_SIZE(wsa_defaults) + ARRAY_SIZE(wsa_defaults_v2_1); - reg_defaults = kmalloc_array(def_count, sizeof(*reg_defaults), - GFP_KERNEL); + reg_defaults = kmalloc_objs(*reg_defaults, def_count, + GFP_KERNEL); if (!reg_defaults) return -ENOMEM; memcpy(®_defaults[0], wsa_defaults, sizeof(wsa_defaults)); @@ -2741,8 +2741,8 @@ static int wsa_macro_probe(struct platform_device *pdev) case LPASS_CODEC_VERSION_2_9: wsa->reg_layout = &wsa_codec_v2_5; def_count = ARRAY_SIZE(wsa_defaults) + ARRAY_SIZE(wsa_defaults_v2_5); - reg_defaults = kmalloc_array(def_count, sizeof(*reg_defaults), - GFP_KERNEL); + reg_defaults = kmalloc_objs(*reg_defaults, def_count, + GFP_KERNEL); if (!reg_defaults) return -ENOMEM; memcpy(®_defaults[0], wsa_defaults, sizeof(wsa_defaults)); diff --git a/sound/soc/codecs/pcm6240.c b/sound/soc/codecs/pcm6240.c index bde190a659b1..6911de5a8c7e 100644 --- a/sound/soc/codecs/pcm6240.c +++ b/sound/soc/codecs/pcm6240.c @@ -1234,7 +1234,7 @@ static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt, struct pcmdevice_block_data **bk_da; unsigned int config_offset = 0, i; - cfg_info = kzalloc(sizeof(struct pcmdevice_config_info), GFP_KERNEL); + cfg_info = kzalloc_obj(struct pcmdevice_config_info, GFP_KERNEL); if (!cfg_info) { *status = -ENOMEM; goto out; @@ -1261,8 +1261,8 @@ static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt, get_unaligned_be32(&config_data[config_offset]); config_offset += 4; - bk_da = cfg_info->blk_data = kcalloc(cfg_info->nblocks, - sizeof(struct pcmdevice_block_data *), GFP_KERNEL); + bk_da = cfg_info->blk_data = kzalloc_objs(struct pcmdevice_block_data *, + cfg_info->nblocks, GFP_KERNEL); if (!bk_da) { *status = -ENOMEM; goto out; @@ -1276,8 +1276,7 @@ static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt, __func__, i, cfg_info->nblocks); break; } - bk_da[i] = kzalloc(sizeof(struct pcmdevice_block_data), - GFP_KERNEL); + bk_da[i] = kzalloc_obj(struct pcmdevice_block_data, GFP_KERNEL); if (!bk_da[i]) { *status = -ENOMEM; break; @@ -1549,7 +1548,7 @@ static int pcmdev_regbin_ready(const struct firmware *fmw, void *ctxt) ret = -EINVAL; goto out; } - cfg_info = kcalloc(fw_hdr->nconfig, sizeof(*cfg_info), GFP_KERNEL); + cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig, GFP_KERNEL); if (!cfg_info) { pcm_dev->fw_state = PCMDEVICE_FW_LOAD_FAILED; ret = -ENOMEM; diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c index 201f74e3a7ae..c2a6a1f446d6 100644 --- a/sound/soc/codecs/sigmadsp.c +++ b/sound/soc/codecs/sigmadsp.c @@ -270,7 +270,7 @@ static int sigma_fw_load_data(struct sigmadsp *sigmadsp, length -= sizeof(*data_chunk); - data = kzalloc(struct_size(data, data, length), GFP_KERNEL); + data = kzalloc_flex(*data, data, length, GFP_KERNEL); if (!data) return -ENOMEM; @@ -413,8 +413,7 @@ static int process_sigma_action(struct sigmadsp *sigmadsp, if (len < 3) return -EINVAL; - data = kzalloc(struct_size(data, data, size_sub(len, 2)), - GFP_KERNEL); + data = kzalloc_flex(*data, data, size_sub(len, 2), GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c index 0e084c3a162d..d3ded7d5efa1 100644 --- a/sound/soc/codecs/tas2781-fmwlib.c +++ b/sound/soc/codecs/tas2781-fmwlib.c @@ -176,7 +176,7 @@ static struct tasdevice_config_info *tasdevice_add_config( * of audio cases, flexible configs have been introduced in the * dsp firmware. */ - cfg_info = kzalloc(sizeof(struct tasdevice_config_info), GFP_KERNEL); + cfg_info = kzalloc_obj(struct tasdevice_config_info, GFP_KERNEL); if (!cfg_info) { *status = -ENOMEM; goto out; @@ -217,8 +217,8 @@ static struct tasdevice_config_info *tasdevice_add_config( * the number and size of blk are not fixed and different among * these firmwares. */ - bk_da = cfg_info->blk_data = kcalloc(cfg_info->nblocks, - sizeof(struct tasdev_blk_data *), GFP_KERNEL); + bk_da = cfg_info->blk_data = kzalloc_objs(struct tasdev_blk_data *, + cfg_info->nblocks, GFP_KERNEL); if (!bk_da) { *status = -ENOMEM; goto out; @@ -232,7 +232,7 @@ static struct tasdevice_config_info *tasdevice_add_config( __func__, i, cfg_info->nblocks); break; } - bk_da[i] = kzalloc(sizeof(struct tasdev_blk_data), GFP_KERNEL); + bk_da[i] = kzalloc_obj(struct tasdev_blk_data, GFP_KERNEL); if (!bk_da[i]) { *status = -ENOMEM; break; @@ -379,7 +379,7 @@ int tasdevice_rca_parser(void *context, const struct firmware *fmw) goto out; } - cfg_info = kcalloc(fw_hdr->nconfig, sizeof(*cfg_info), GFP_KERNEL); + cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig, GFP_KERNEL); if (!cfg_info) { ret = -ENOMEM; tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; @@ -509,8 +509,8 @@ static int fw_parse_data_kernel(struct tasdevice_fw *tas_fmw, img_data->nr_blk = get_unaligned_be32(&data[offset]); offset += 4; - img_data->dev_blks = kcalloc(img_data->nr_blk, - sizeof(struct tasdev_blk), GFP_KERNEL); + img_data->dev_blks = kzalloc_objs(struct tasdev_blk, img_data->nr_blk, + GFP_KERNEL); if (!img_data->dev_blks) { offset = -ENOMEM; goto out; @@ -805,8 +805,8 @@ static int fw_parse_variable_header_kernel( goto out; } - tas_fmw->programs = kcalloc(tas_fmw->nr_programs, - sizeof(struct tasdevice_prog), GFP_KERNEL); + tas_fmw->programs = kzalloc_objs(struct tasdevice_prog, + tas_fmw->nr_programs, GFP_KERNEL); if (!tas_fmw->programs) { offset = -ENOMEM; goto out; @@ -844,8 +844,8 @@ static int fw_parse_variable_header_kernel( goto out; } - tas_fmw->configs = kcalloc(tas_fmw->nr_configurations, - sizeof(struct tasdevice_config), GFP_KERNEL); + tas_fmw->configs = kzalloc_objs(struct tasdevice_config, + tas_fmw->nr_configurations, GFP_KERNEL); if (!tas_fmw->configs) { offset = -ENOMEM; goto out; @@ -1239,8 +1239,8 @@ static int fw_parse_data(struct tasdevice_fw *tas_fmw, img_data->nr_blk = get_unaligned_be16(&data[offset]); offset += 2; - img_data->dev_blks = kcalloc(img_data->nr_blk, - sizeof(struct tasdev_blk), GFP_KERNEL); + img_data->dev_blks = kzalloc_objs(struct tasdev_blk, img_data->nr_blk, + GFP_KERNEL); if (!img_data->dev_blks) { offset = -ENOMEM; goto out; @@ -1284,8 +1284,8 @@ static int fw_parse_program_data(struct tasdevice_priv *tas_priv, } tas_fmw->programs = - kcalloc(tas_fmw->nr_programs, sizeof(struct tasdevice_prog), - GFP_KERNEL); + kzalloc_objs(struct tasdevice_prog, tas_fmw->nr_programs, + GFP_KERNEL); if (!tas_fmw->programs) { offset = -ENOMEM; goto out; @@ -1348,8 +1348,8 @@ static int fw_parse_configuration_data( /*Not error for calibration Data file, return directly*/ goto out; } - tas_fmw->configs = kcalloc(tas_fmw->nr_configurations, - sizeof(struct tasdevice_config), GFP_KERNEL); + tas_fmw->configs = kzalloc_objs(struct tasdevice_config, + tas_fmw->nr_configurations, GFP_KERNEL); if (!tas_fmw->configs) { offset = -ENOMEM; goto out; @@ -2143,8 +2143,9 @@ static int fw_parse_calibration_data(struct tasdevice_priv *tas_priv, goto out; } - tas_fmw->calibrations = kcalloc(tas_fmw->nr_calibrations, - sizeof(struct tasdevice_calibration), GFP_KERNEL); + tas_fmw->calibrations = kzalloc_objs(struct tasdevice_calibration, + tas_fmw->nr_calibrations, + GFP_KERNEL); if (!tas_fmw->calibrations) { offset = -ENOMEM; goto out; @@ -2206,8 +2207,8 @@ int tas2781_load_calibration(void *context, char *file_name, fmw.size = fw_entry->size; fmw.data = fw_entry->data; - tas_fmw = tasdev->cali_data_fmw = kzalloc(sizeof(struct tasdevice_fw), - GFP_KERNEL); + tas_fmw = tasdev->cali_data_fmw = kzalloc_obj(struct tasdevice_fw, + GFP_KERNEL); if (!tasdev->cali_data_fmw) { ret = -ENOMEM; goto out; @@ -2267,7 +2268,7 @@ static int tasdevice_dspfw_ready(const struct firmware *fmw, return -EINVAL; } - tas_priv->fmw = kzalloc(sizeof(struct tasdevice_fw), GFP_KERNEL); + tas_priv->fmw = kzalloc_obj(struct tasdevice_fw, GFP_KERNEL); if (!tas_priv->fmw) return -ENOMEM; diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c index 84d45eab3523..ab3620761f5d 100644 --- a/sound/soc/codecs/tas2783-sdw.c +++ b/sound/soc/codecs/tas2783-sdw.c @@ -733,8 +733,8 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) s32 img_sz, ret = 0, cur_file = 0; s32 offset = 0; - struct tas_fw_hdr *hdr __free(kfree) = kzalloc(sizeof(*hdr), GFP_KERNEL); - struct tas_fw_file *file __free(kfree) = kzalloc(sizeof(*file), GFP_KERNEL); + struct tas_fw_hdr *hdr __free(kfree) = kzalloc_obj(*hdr, GFP_KERNEL); + struct tas_fw_file *file __free(kfree) = kzalloc_obj(*file, GFP_KERNEL); if (!file || !hdr) { ret = -ENOMEM; goto out; diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c index d96e23ec43d4..1da1a85cbe6b 100644 --- a/sound/soc/codecs/wcd-clsh-v2.c +++ b/sound/soc/codecs/wcd-clsh-v2.c @@ -883,7 +883,7 @@ struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp, { struct wcd_clsh_ctrl *ctrl; - ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); if (!ctrl) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 0c842aaa7eec..56b112946b37 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1515,7 +1515,7 @@ struct wcd_mbhc *wcd_mbhc_init(struct snd_soc_component *component, return ERR_PTR(-EINVAL); } - mbhc = kzalloc(sizeof(*mbhc), GFP_KERNEL); + mbhc = kzalloc_obj(*mbhc, GFP_KERNEL); if (!mbhc) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index 6e097d8ed288..f6166428a000 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -396,7 +396,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_component *comp rec->command, rec->length); len = rec->length + 8; - xfer = kzalloc(sizeof(*xfer), GFP_KERNEL); + xfer = kzalloc_obj(*xfer, GFP_KERNEL); if (!xfer) { ret = -ENOMEM; goto abort; diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 17cec79245d4..8a584fd8f5de 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -542,7 +542,7 @@ static void wm_adsp_ctl_work(struct work_struct *work) cs_dsp); struct snd_kcontrol_new *kcontrol; - kcontrol = kzalloc(sizeof(*kcontrol), GFP_KERNEL); + kcontrol = kzalloc_obj(*kcontrol, GFP_KERNEL); if (!kcontrol) return; @@ -627,7 +627,7 @@ int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) " %.*s", cs_ctl->subname_len - skip, cs_ctl->subname + skip); } - ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + ctl = kzalloc_obj(*ctl, GFP_KERNEL); if (!ctl) return -ENOMEM; ctl->cs_ctl = cs_ctl; @@ -1259,7 +1259,7 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream) } } - compr = kzalloc(sizeof(*compr), GFP_KERNEL); + compr = kzalloc_obj(*compr, GFP_KERNEL); if (!compr) { ret = -ENOMEM; goto out; @@ -1430,8 +1430,8 @@ static int wm_adsp_buffer_populate(struct wm_adsp_compr_buf *buf) u32 offset = 0; int i, ret; - buf->regions = kcalloc(caps->num_regions, sizeof(*buf->regions), - GFP_KERNEL); + buf->regions = kzalloc_objs(*buf->regions, caps->num_regions, + GFP_KERNEL); if (!buf->regions) return -ENOMEM; @@ -1477,7 +1477,7 @@ static struct wm_adsp_compr_buf *wm_adsp_buffer_alloc(struct wm_adsp *dsp) { struct wm_adsp_compr_buf *buf; - buf = kzalloc(sizeof(*buf), GFP_KERNEL); + buf = kzalloc_obj(*buf, GFP_KERNEL); if (!buf) return NULL; diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 77999526dd9e..7a16a895cb0e 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -155,7 +155,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair, if (buf_len % max_period_size) sg_len += 1; - sg = kmalloc_array(sg_len, sizeof(*sg), GFP_KERNEL); + sg = kmalloc_objs(*sg, sg_len, GFP_KERNEL); if (!sg) return -ENOMEM; @@ -420,7 +420,7 @@ static struct sg_table *fsl_asrc_m2m_map_dma_buf(struct dma_buf_attachment *atta struct snd_dma_buffer *dmab = attachment->dmabuf->priv; struct sg_table *sgt; - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + sgt = kmalloc_obj(*sgt, GFP_KERNEL); if (!sgt) return NULL; diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index aca066b5a43c..44834dba4cb7 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -848,7 +848,7 @@ static int fsl_soc_dma_probe(struct platform_device *pdev) return ret; } - dma = kzalloc(sizeof(*dma), GFP_KERNEL); + dma = kzalloc_obj(*dma, GFP_KERNEL); if (!dma) { of_node_put(ssi_np); return -ENOMEM; diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c index 3de448ef724c..747c8253b77b 100644 --- a/sound/soc/fsl/fsl_qmc_audio.c +++ b/sound/soc/fsl/fsl_qmc_audio.c @@ -316,7 +316,7 @@ static int qmc_audio_pcm_open(struct snd_soc_component *component, if (ret < 0) return ret; - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (!prtd) return -ENOMEM; diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 83de3ae33691..8a1a7c89781f 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -176,7 +176,7 @@ static int snd_imx_open(struct snd_soc_component *component, struct imx_pcm_runtime_data *iprtd; int ret; - iprtd = kzalloc(sizeof(*iprtd), GFP_KERNEL); + iprtd = kzalloc_obj(*iprtd, GFP_KERNEL); if (iprtd == NULL) return -ENOMEM; runtime->private_data = iprtd; diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 345f338251ac..41255ff305b3 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -333,7 +333,7 @@ int mpc5200_audio_dma_create(struct platform_device *op) } /* Allocate and initialize the driver private data */ - psc_dma = kzalloc(sizeof *psc_dma, GFP_KERNEL); + psc_dma = kzalloc_obj(*psc_dma, GFP_KERNEL); if (!psc_dma) { ret = -ENOMEM; goto out_unmap; diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 66db05970d82..44b62f5615f2 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c @@ -211,7 +211,7 @@ static int p1022_ds_probe(struct platform_device *pdev) return -EINVAL; } - mdata = kzalloc(sizeof(struct machine_data), GFP_KERNEL); + mdata = kzalloc_obj(struct machine_data, GFP_KERNEL); if (!mdata) { ret = -ENOMEM; goto error_put; diff --git a/sound/soc/fsl/p1022_rdk.c b/sound/soc/fsl/p1022_rdk.c index d4568346714f..43a95cd590cf 100644 --- a/sound/soc/fsl/p1022_rdk.c +++ b/sound/soc/fsl/p1022_rdk.c @@ -226,7 +226,7 @@ static int p1022_rdk_probe(struct platform_device *pdev) return -EINVAL; } - mdata = kzalloc(sizeof(struct machine_data), GFP_KERNEL); + mdata = kzalloc_obj(struct machine_data, GFP_KERNEL); if (!mdata) { ret = -ENOMEM; goto error_put; diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 7720cf1fd6e1..965d7bb55929 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -553,7 +553,7 @@ int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev) struct snd_soc_card *card = simple_priv_to_card(priv); int ret = -ENOMEM; - struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); if (!li) goto end; diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 5dcc78c551a2..85043bc3c3d3 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -1305,7 +1305,7 @@ int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev, struct snd_soc_card *card = simple_priv_to_card(priv); int ret; - struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); if (!li) return -ENOMEM; diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 5af6d1b308f2..5bc6d7cd1921 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -726,7 +726,7 @@ static int simple_probe(struct platform_device *pdev) card->driver_name = "simple-card"; ret = -ENOMEM; - struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); if (!li) goto end; diff --git a/sound/soc/intel/atom/sst-mfld-platform-compress.c b/sound/soc/intel/atom/sst-mfld-platform-compress.c index 9dfb0a814b94..877df5ce156d 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-compress.c +++ b/sound/soc/intel/atom/sst-mfld-platform-compress.c @@ -47,7 +47,7 @@ static int sst_platform_compr_open(struct snd_soc_component *component, struct snd_compr_runtime *runtime = cstream->runtime; struct sst_runtime_stream *stream; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index 373d68b4cf88..e007db432b49 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -306,7 +306,7 @@ static int sst_media_open(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; struct sst_runtime_stream *stream; - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; spin_lock_init(&stream->status_lock); diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c index 3c47c8de04b7..5313c8ec605e 100644 --- a/sound/soc/intel/atom/sst/sst.c +++ b/sound/soc/intel/atom/sst/sst.c @@ -463,7 +463,7 @@ static int intel_sst_suspend(struct device *dev) return -EBUSY; /* save the memories */ - fw_save = kzalloc(sizeof(*fw_save), GFP_KERNEL); + fw_save = kzalloc_obj(*fw_save, GFP_KERNEL); if (!fw_save) return -ENOMEM; fw_save->iram = kvzalloc(ctx->iram_end - ctx->iram_base, GFP_KERNEL); diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c index 0630e58b9d6b..bdf68d69127f 100644 --- a/sound/soc/intel/atom/sst/sst_ipc.c +++ b/sound/soc/intel/atom/sst/sst_ipc.c @@ -31,7 +31,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx, struct sst_block *msg; dev_dbg(ctx->dev, "Enter\n"); - msg = kzalloc(sizeof(*msg), GFP_KERNEL); + msg = kzalloc_obj(*msg, GFP_KERNEL); if (!msg) return NULL; msg->condition = false; diff --git a/sound/soc/intel/atom/sst/sst_loader.c b/sound/soc/intel/atom/sst/sst_loader.c index bf4ba6bcc429..60b73c9c2306 100644 --- a/sound/soc/intel/atom/sst/sst_loader.c +++ b/sound/soc/intel/atom/sst/sst_loader.c @@ -148,7 +148,7 @@ static int sst_fill_memcpy_list(struct list_head *memcpy_list, { struct sst_memcpy_list *listnode; - listnode = kzalloc(sizeof(*listnode), GFP_KERNEL); + listnode = kzalloc_obj(*listnode, GFP_KERNEL); if (listnode == NULL) return -ENOMEM; listnode->dstn = destn; diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c index c01b29616ebc..67b1ab14239f 100644 --- a/sound/soc/intel/atom/sst/sst_pvt.c +++ b/sound/soc/intel/atom/sst/sst_pvt.c @@ -124,7 +124,7 @@ int sst_create_ipc_msg(struct ipc_post **arg, bool large) { struct ipc_post *msg; - msg = kzalloc(sizeof(*msg), GFP_ATOMIC); + msg = kzalloc_obj(*msg, GFP_ATOMIC); if (!msg) return -ENOMEM; if (large) { diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c index 899906e0bcb4..a080d85d30a6 100644 --- a/sound/soc/intel/avs/path.c +++ b/sound/soc/intel/avs/path.c @@ -880,7 +880,7 @@ avs_path_module_create(struct avs_dev *adev, if (module_id < 0) return ERR_PTR(module_id); - mod = kzalloc(sizeof(*mod), GFP_KERNEL); + mod = kzalloc_obj(*mod, GFP_KERNEL); if (!mod) return ERR_PTR(-ENOMEM); @@ -968,7 +968,7 @@ static struct avs_path_binding *avs_path_binding_create(struct avs_dev *adev, { struct avs_path_binding *binding; - binding = kzalloc(sizeof(*binding), GFP_KERNEL); + binding = kzalloc_obj(*binding, GFP_KERNEL); if (!binding) return ERR_PTR(-ENOMEM); @@ -1043,7 +1043,7 @@ avs_path_pipeline_create(struct avs_dev *adev, struct avs_path *owner, struct avs_tplg_module *tmod; int ret, i; - ppl = kzalloc(sizeof(*ppl), GFP_KERNEL); + ppl = kzalloc_obj(*ppl, GFP_KERNEL); if (!ppl) return ERR_PTR(-ENOMEM); @@ -1173,7 +1173,7 @@ static struct avs_path *avs_path_create_unlocked(struct avs_dev *adev, u32 dma_i struct avs_path *path; int ret; - path = kzalloc(sizeof(*path), GFP_KERNEL); + path = kzalloc_obj(*path, GFP_KERNEL); if (!path) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 4a6deb599c88..b8f5e1185a1a 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -130,7 +130,7 @@ static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_d return -EINVAL; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/soc/intel/avs/utils.c b/sound/soc/intel/avs/utils.c index 81f9b67d8e29..df4d4e2f6c4f 100644 --- a/sound/soc/intel/avs/utils.c +++ b/sound/soc/intel/avs/utils.c @@ -124,7 +124,7 @@ avs_module_ida_alloc(struct avs_dev *adev, struct avs_mods_info *newinfo, bool p tocopy_count = oldinfo->count; } - ida_ptrs = kcalloc(newinfo->count, sizeof(*ida_ptrs), GFP_KERNEL); + ida_ptrs = kzalloc_objs(*ida_ptrs, newinfo->count, GFP_KERNEL); if (!ida_ptrs) return -ENOMEM; @@ -132,7 +132,7 @@ avs_module_ida_alloc(struct avs_dev *adev, struct avs_mods_info *newinfo, bool p memcpy(ida_ptrs, adev->mod_idas, tocopy_count * sizeof(*ida_ptrs)); for (i = tocopy_count; i < newinfo->count; i++) { - ida_ptrs[i] = kzalloc(sizeof(**ida_ptrs), GFP_KERNEL); + ida_ptrs[i] = kzalloc_obj(**ida_ptrs, GFP_KERNEL); if (!ida_ptrs[i]) { while (i--) kfree(ida_ptrs[i]); @@ -246,7 +246,7 @@ int avs_request_firmware(struct avs_dev *adev, const struct firmware **fw_p, con } /* FW is not loaded, let's load it now and add to the list */ - entry = kzalloc(sizeof(*entry), GFP_KERNEL); + entry = kzalloc_obj(*entry, GFP_KERNEL); if (!entry) return -ENOMEM; diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index ee34282828e4..65bc023ab01b 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1251,12 +1251,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) * add one additional to act as a terminator such that code can iterate * until it hits an uninitialised DAI. */ - sof_dais = kcalloc(num_ends + 1, sizeof(*sof_dais), GFP_KERNEL); + sof_dais = kzalloc_objs(*sof_dais, num_ends + 1, GFP_KERNEL); if (!sof_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ - sof_ends = kcalloc(num_ends, sizeof(*sof_ends), GFP_KERNEL); + sof_ends = kzalloc_objs(*sof_ends, num_ends, GFP_KERNEL); if (!sof_ends) { ret = -ENOMEM; goto err_dai; diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index 2c3405686f79..b3e8ea4b92b4 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -263,7 +263,7 @@ static int catpt_dai_startup(struct snd_pcm_substream *substream, template = catpt_get_stream_template(substream); - stream = kzalloc(sizeof(*stream), GFP_KERNEL); + stream = kzalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c index 20e4a0641340..8cf0feb64ff9 100644 --- a/sound/soc/loongson/loongson_dma.c +++ b/sound/soc/loongson/loongson_dma.c @@ -243,7 +243,7 @@ static int loongson_pcm_open(struct snd_soc_component *component, SNDRV_PCM_HW_PARAM_PERIODS); snd_soc_set_runtime_hwparams(substream, &ls_pcm_hardware); - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (!prtd) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c b/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c index 5666be6b1bd2..53f30d12195b 100644 --- a/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c +++ b/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c @@ -135,7 +135,7 @@ int mt8186_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c index 40d2ab0a7677..2ef5ed3ee200 100644 --- a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c @@ -193,7 +193,7 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c index 38594bc3f2f7..ec069729253e 100644 --- a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c +++ b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c @@ -199,7 +199,7 @@ int mt8195_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc(sizeof(*cl), GFP_KERNEL); + cl = kzalloc_obj(*cl, GFP_KERNEL); if (!cl) return -ENOMEM; diff --git a/sound/soc/meson/aiu-fifo.c b/sound/soc/meson/aiu-fifo.c index b222bde1f61b..b17a62727fc7 100644 --- a/sound/soc/meson/aiu-fifo.c +++ b/sound/soc/meson/aiu-fifo.c @@ -196,7 +196,7 @@ int aiu_fifo_dai_probe(struct snd_soc_dai *dai) { struct aiu_fifo *fifo; - fifo = kzalloc(sizeof(*fifo), GFP_KERNEL); + fifo = kzalloc_obj(*fifo, GFP_KERNEL); if (!fifo) return -ENOMEM; diff --git a/sound/soc/meson/axg-tdm-formatter.c b/sound/soc/meson/axg-tdm-formatter.c index a6579efd3775..1fd78790c967 100644 --- a/sound/soc/meson/axg-tdm-formatter.c +++ b/sound/soc/meson/axg-tdm-formatter.c @@ -368,7 +368,7 @@ struct axg_tdm_stream *axg_tdm_stream_alloc(struct axg_tdm_iface *iface) { struct axg_tdm_stream *ts; - ts = kzalloc(sizeof(*ts), GFP_KERNEL); + ts = kzalloc_obj(*ts, GFP_KERNEL); if (ts) { INIT_LIST_HEAD(&ts->formatter_list); mutex_init(&ts->lock); diff --git a/sound/soc/meson/meson-codec-glue.c b/sound/soc/meson/meson-codec-glue.c index f8c5643f3cfe..bd9a91d8bc3a 100644 --- a/sound/soc/meson/meson-codec-glue.c +++ b/sound/soc/meson/meson-codec-glue.c @@ -122,7 +122,7 @@ int meson_codec_glue_input_dai_probe(struct snd_soc_dai *dai) { struct meson_codec_glue_input *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index b8a3cb8b7597..790e4db9d91b 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -85,7 +85,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, clk_prepare_enable(priv->extclk); - dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL); + dma = kzalloc_obj(struct snd_dmaengine_dai_dma_data, GFP_KERNEL); if (!dma) return -ENOMEM; dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? @@ -749,7 +749,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai) struct ssp_priv *priv; int ret; - priv = kzalloc(sizeof(struct ssp_priv), GFP_KERNEL); + priv = kzalloc_obj(struct ssp_priv, GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index b456e096f138..84909af310b4 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -202,7 +202,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component, struct regmap *map; unsigned int dai_id = cpu_dai->driver->id; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c index 40bc44003453..db0ae71f2983 100644 --- a/sound/soc/qcom/qdsp6/q6adm.c +++ b/sound/soc/qcom/qdsp6/q6adm.c @@ -284,7 +284,7 @@ static struct q6copp *q6adm_alloc_copp(struct q6adm *adm, int port_idx) if (idx >= MAX_COPPS_PER_PORT) return ERR_PTR(-EBUSY); - c = kzalloc(sizeof(*c), GFP_ATOMIC); + c = kzalloc_obj(*c, GFP_ATOMIC); if (!c) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 76e14fc1b2b5..b1851dac61fa 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -1359,7 +1359,7 @@ void q6afe_tdm_port_prepare(struct q6afe_port *port, pcfg->tdm_cfg.slot_width = cfg->slot_width; pcfg->tdm_cfg.slot_mask = cfg->slot_mask; - port->scfg = kzalloc(sizeof(*port->scfg), GFP_KERNEL); + port->scfg = kzalloc_obj(*port->scfg, GFP_KERNEL); if (!port->scfg) return; diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index aaeeadded7aa..dcd960aeab2f 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -348,7 +348,7 @@ static int q6apm_dai_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (prtd == NULL) return -ENOMEM; @@ -490,7 +490,7 @@ static int q6apm_dai_compr_open(struct snd_soc_component *component, if (!pdata) return -EINVAL; - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (prtd == NULL) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 1d5edf285793..99d2dcdfac25 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -57,7 +57,7 @@ static struct audioreach_graph *q6apm_get_audioreach_graph(struct q6apm *apm, ui if (!info) return ERR_PTR(-ENODEV); - graph = kzalloc(sizeof(*graph), GFP_KERNEL); + graph = kzalloc_obj(*graph, GFP_KERNEL); if (!graph) return ERR_PTR(-ENOMEM); @@ -220,7 +220,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a return 0; } - buf = kcalloc(periods, sizeof(struct audio_buffer), GFP_KERNEL); + buf = kzalloc_objs(struct audio_buffer, periods, GFP_KERNEL); if (!buf) { mutex_unlock(&graph->lock); return -ENOMEM; @@ -615,7 +615,7 @@ struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb, return ERR_CAST(ar_graph); } - graph = kzalloc(sizeof(*graph), GFP_KERNEL); + graph = kzalloc_obj(*graph, GFP_KERNEL); if (!graph) { ret = -ENOMEM; goto put_ar_graph; diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 709b4f3318ff..99c1969d5cdc 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -378,7 +378,7 @@ static int q6asm_dai_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc(sizeof(struct q6asm_dai_rtd), GFP_KERNEL); + prtd = kzalloc_obj(struct q6asm_dai_rtd, GFP_KERNEL); if (prtd == NULL) return -ENOMEM; @@ -621,7 +621,7 @@ static int q6asm_dai_compr_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); + prtd = kzalloc_obj(*prtd, GFP_KERNEL); if (!prtd) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 1bb295407c60..424306da4a25 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -506,7 +506,7 @@ int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac, return 0; } - buf = kcalloc(periods, sizeof(*buf), GFP_ATOMIC); + buf = kzalloc_objs(*buf, periods, GFP_ATOMIC); if (!buf) { spin_unlock_irqrestore(&ac->lock, flags); return -ENOMEM; @@ -850,7 +850,7 @@ struct audio_client *q6asm_audio_client_alloc(struct device *dev, q6asm_cb cb, return ac; } - ac = kzalloc(sizeof(*ac), GFP_KERNEL); + ac = kzalloc_obj(*ac, GFP_KERNEL); if (!ac) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c index f4939302b88a..393488c571cd 100644 --- a/sound/soc/qcom/qdsp6/q6core.c +++ b/sound/soc/qcom/qdsp6/q6core.c @@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(q6core_is_adsp_ready); static int q6core_probe(struct apr_device *adev) { - g_core = kzalloc(sizeof(*g_core), GFP_KERNEL); + g_core = kzalloc_obj(*g_core, GFP_KERNEL); if (!g_core) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index aaa3af9f1993..c3b26b318718 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -1133,7 +1133,7 @@ static int q6pcm_routing_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - routing_data = kzalloc(sizeof(*routing_data), GFP_KERNEL); + routing_data = kzalloc_obj(*routing_data, GFP_KERNEL); if (!routing_data) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 2e71eaa90441..076b55c1f729 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -42,7 +42,7 @@ static struct audioreach_graph_info *audioreach_tplg_alloc_graph_info(struct q6a } *found = false; - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM); @@ -92,7 +92,7 @@ static struct audioreach_sub_graph *audioreach_tplg_alloc_sub_graph(struct q6apm } *found = false; - sg = kzalloc(sizeof(*sg), GFP_KERNEL); + sg = kzalloc_obj(*sg, GFP_KERNEL); if (!sg) return ERR_PTR(-ENOMEM); @@ -134,7 +134,7 @@ static struct audioreach_container *audioreach_tplg_alloc_container(struct q6apm } *found = false; - cont = kzalloc(sizeof(*cont), GFP_KERNEL); + cont = kzalloc_obj(*cont, GFP_KERNEL); if (!cont) return ERR_PTR(-ENOMEM); @@ -176,7 +176,7 @@ static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm, return mod; } *found = false; - mod = kzalloc(sizeof(*mod), GFP_KERNEL); + mod = kzalloc_obj(*mod, GFP_KERNEL); if (!mod) return ERR_PTR(-ENOMEM); @@ -317,8 +317,9 @@ audioreach_get_module_priv_data(const struct snd_soc_tplg_private *private) if (le32_to_cpu(mod_array->type) == SND_SOC_AR_TPLG_MODULE_CFG_TYPE) { struct audioreach_module_priv_data *pdata; - pdata = kzalloc(struct_size(pdata, data, le32_to_cpu(mod_array->size)), - GFP_KERNEL); + pdata = kzalloc_flex(*pdata, data, + le32_to_cpu(mod_array->size), + GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); @@ -829,7 +830,7 @@ static int audioreach_widget_load_mixer(struct snd_soc_component *component, w_array = &tplg_w->priv.array[0]; - scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); if (!scontrol) return -ENOMEM; @@ -1246,7 +1247,7 @@ static int audioreach_control_load(struct snd_soc_component *scomp, int index, struct snd_soc_dobj *dobj; int ret = 0; - scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); if (!scontrol) return -ENOMEM; diff --git a/sound/soc/renesas/siu_dai.c b/sound/soc/renesas/siu_dai.c index 7e771a164a80..5e7751c8b1e3 100644 --- a/sound/soc/renesas/siu_dai.c +++ b/sound/soc/renesas/siu_dai.c @@ -453,7 +453,7 @@ int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card) struct snd_kcontrol *kctrl; int ret; - *port_info = kzalloc(sizeof(**port_info), GFP_KERNEL); + *port_info = kzalloc_obj(**port_info, GFP_KERNEL); if (!*port_info) return -ENOMEM; diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 402ccadad46c..58fade080976 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -290,7 +290,7 @@ static int idma_open(struct snd_soc_component *component, snd_soc_set_runtime_hwparams(substream, &idma_hardware); - prtd = kzalloc(sizeof(struct idma_ctrl), GFP_KERNEL); + prtd = kzalloc_obj(struct idma_ctrl, GFP_KERNEL); if (prtd == NULL) return -ENOMEM; diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c index bb6e74e80a3e..51ccaa14b443 100644 --- a/sound/soc/sdca/sdca_asoc.c +++ b/sound/soc/sdca/sdca_asoc.c @@ -1349,7 +1349,7 @@ int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap, dev_dbg(dev, "%s: set channel constraint mask: %#x\n", entity->label, channel_mask); - constraint = kzalloc(sizeof(*constraint), GFP_KERNEL); + constraint = kzalloc_obj(*constraint, GFP_KERNEL); if (!constraint) return -ENOMEM; diff --git a/sound/soc/sdca/sdca_function_device.c b/sound/soc/sdca/sdca_function_device.c index c6cc880a150e..dd419f426ba6 100644 --- a/sound/soc/sdca/sdca_function_device.c +++ b/sound/soc/sdca/sdca_function_device.c @@ -39,7 +39,7 @@ static struct sdca_dev *sdca_dev_register(struct device *parent, int ret; int rc; - sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kzalloc_obj(*sdev, GFP_KERNEL); if (!sdev) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/sdca/sdca_jack.c b/sound/soc/sdca/sdca_jack.c index 605514f02045..0ce9cf8f850c 100644 --- a/sound/soc/sdca/sdca_jack.c +++ b/sound/soc/sdca/sdca_jack.c @@ -99,7 +99,7 @@ int sdca_jack_process(struct sdca_interrupt *interrupt) if (kctl) { struct soc_enum *soc_enum = (struct soc_enum *)kctl->private_value; - ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL); + ucontrol = kzalloc_obj(*ucontrol, GFP_KERNEL); if (!ucontrol) return -ENOMEM; diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index 37486d6a438e..f71413a186b8 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -181,7 +181,7 @@ struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *componen { struct snd_ac97 *ac97; - ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); + ac97 = kzalloc_obj(struct snd_ac97, GFP_KERNEL); if (ac97 == NULL) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 5811d053ce7a..7c1f2c93d5d3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -507,7 +507,7 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( /* * for rtd->dev */ - dev = kzalloc(sizeof(struct device), GFP_KERNEL); + dev = kzalloc_obj(struct device, GFP_KERNEL); if (!dev) return NULL; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index c23ccf4a602d..54ee54dcba87 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -638,7 +638,7 @@ static int dapm_add_path( if (ret) return ret; - path = kzalloc(sizeof(struct snd_soc_dapm_path), GFP_KERNEL); + path = kzalloc_obj(struct snd_soc_dapm_path, GFP_KERNEL); if (!path) return -ENOMEM; @@ -713,7 +713,7 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, const char *name; int ret; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; @@ -1435,7 +1435,7 @@ static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list, list_for_each(it, widgets) size++; - *list = kzalloc(struct_size(*list, widgets, size), GFP_KERNEL); + *list = kzalloc_flex(**list, widgets, size, GFP_KERNEL); if (*list == NULL) return -ENOMEM; @@ -3332,9 +3332,9 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card) continue; if (w->num_kcontrols) { - w->kcontrols = kcalloc(w->num_kcontrols, - sizeof(struct snd_kcontrol *), - GFP_KERNEL); + w->kcontrols = kzalloc_objs(struct snd_kcontrol *, + w->num_kcontrols, + GFP_KERNEL); if (!w->kcontrols) { snd_soc_dapm_mutex_unlock(card); return -ENOMEM; @@ -3972,12 +3972,12 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, * stuff that increases stack usage. * So, we use kzalloc()/kfree() for params in this function. */ - struct snd_pcm_hw_params *params __free(kfree) = kzalloc(sizeof(*params), - GFP_KERNEL); + struct snd_pcm_hw_params *params __free(kfree) = kzalloc_obj(*params, + GFP_KERNEL); if (!params) return -ENOMEM; - runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); + runtime = kzalloc_obj(*runtime, GFP_KERNEL); if (!runtime) return -ENOMEM; diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index a63e942fdc0b..1a2b5a8fd198 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -437,7 +437,7 @@ int snd_dmaengine_pcm_register(struct device *dev, struct dmaengine_pcm *pcm; int ret; - pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); + pcm = kzalloc_obj(*pcm, GFP_KERNEL); if (!pcm) return -ENOMEM; diff --git a/sound/soc/soc-ops-test.c b/sound/soc/soc-ops-test.c index 1bafa5626d48..0f924a6b0d15 100644 --- a/sound/soc/soc-ops-test.c +++ b/sound/soc/soc-ops-test.c @@ -486,7 +486,7 @@ static void soc_ops_test_access(struct kunit *test) /* it is too large struct. use kzalloc() */ struct snd_ctl_elem_value *result; - result = kzalloc(sizeof(*result), GFP_KERNEL); + result = kzalloc_obj(*result, GFP_KERNEL); if (!result) return; diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index ba42939d5f01..1d2ebb4f63e4 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -454,7 +454,7 @@ static int snd_soc_clip_to_platform_max(struct snd_kcontrol *kctl) if (!mc->platform_max) return 0; - uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); + uctl = kzalloc_obj(*uctl, GFP_KERNEL); if (!uctl) return -ENOMEM; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 6b134962c71c..b3e3ffdcce6f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1323,7 +1323,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, be_substream->pcm->nonatomic = 1; } - dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_KERNEL); + dpcm = kzalloc_obj(struct snd_soc_dpcm, GFP_KERNEL); if (!dpcm) return -ENOMEM; diff --git a/sound/soc/soc-usb.c b/sound/soc/soc-usb.c index 26baa66d29a8..57e537edb637 100644 --- a/sound/soc/soc-usb.c +++ b/sound/soc/soc-usb.c @@ -189,7 +189,7 @@ struct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *componen { struct snd_soc_usb *usb; - usb = kzalloc(sizeof(*usb), GFP_KERNEL); + usb = kzalloc_obj(*usb, GFP_KERNEL); if (!usb) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 86d563c864e5..f68fa3551df8 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -101,7 +101,7 @@ static int sof_compr_open(struct snd_soc_component *component, struct snd_sof_pcm *spcm; int dir; - sstream = kzalloc(sizeof(*sstream), GFP_KERNEL); + sstream = kzalloc_obj(*sstream, GFP_KERNEL); if (!sstream) return -ENOMEM; diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c index 0c68ae41a8a8..31494c686c72 100644 --- a/sound/soc/sof/intel/apl.c +++ b/sound/soc/sof/intel/apl.c @@ -54,7 +54,7 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index 69376fb5b20d..b55dd9ace41f 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -401,7 +401,7 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c index 6f15213937a3..c9790f37928f 100644 --- a/sound/soc/sof/intel/hda-mlink.c +++ b/sound/soc/sof/intel/hda-mlink.c @@ -392,7 +392,7 @@ static int hda_ml_alloc_h2link(struct hdac_bus *bus, int index) struct hdac_ext_link *hlink; int ret; - h2link = kzalloc(sizeof(*h2link), GFP_KERNEL); + h2link = kzalloc_obj(*h2link, GFP_KERNEL); if (!h2link) return -ENOMEM; diff --git a/sound/soc/sof/intel/icl.c b/sound/soc/sof/intel/icl.c index dbc5ad62258b..8079a1363b45 100644 --- a/sound/soc/sof/intel/icl.c +++ b/sound/soc/sof/intel/icl.c @@ -122,7 +122,7 @@ int sof_icl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c index 4ac81537ca05..e46b0fd5746f 100644 --- a/sound/soc/sof/intel/mtl.c +++ b/sound/soc/sof/intel/mtl.c @@ -734,7 +734,7 @@ int sof_mtl_set_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *dsp_ops) dsp_ops->core_get = mtl_dsp_core_get; dsp_ops->core_put = mtl_dsp_core_put; - sdev->private = kzalloc(sizeof(struct sof_ipc4_fw_data), GFP_KERNEL); + sdev->private = kzalloc_obj(struct sof_ipc4_fw_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/skl.c b/sound/soc/sof/intel/skl.c index 90a3c2e2334c..eb94027a5724 100644 --- a/sound/soc/sof/intel/skl.c +++ b/sound/soc/sof/intel/skl.c @@ -62,7 +62,7 @@ int sof_skl_ops_init(struct snd_sof_dev *sdev) /* probe/remove/shutdown */ sof_skl_ops.shutdown = hda_dsp_shutdown; - sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/telemetry.c b/sound/soc/sof/intel/telemetry.c index dcaaf03599db..2e2cc6e2ea3a 100644 --- a/sound/soc/sof/intel/telemetry.c +++ b/sound/soc/sof/intel/telemetry.c @@ -29,7 +29,7 @@ void sof_ipc4_intel_dump_telemetry_state(struct snd_sof_dev *sdev, u32 flags) if (!slot_offset) return; - telemetry_data = kmalloc(sizeof(*telemetry_data), GFP_KERNEL); + telemetry_data = kmalloc_obj(*telemetry_data, GFP_KERNEL); if (!telemetry_data) return; sof_mailbox_read(sdev, slot_offset, telemetry_data, sizeof(*telemetry_data)); @@ -39,7 +39,7 @@ void sof_ipc4_intel_dump_telemetry_state(struct snd_sof_dev *sdev, u32 flags) goto free_telemetry_data; } - block = kmalloc(sizeof(*block), GFP_KERNEL); + block = kmalloc_obj(*block, GFP_KERNEL); if (!block) goto free_telemetry_data; @@ -71,7 +71,7 @@ void sof_ipc4_intel_dump_telemetry_state(struct snd_sof_dev *sdev, u32 flags) break; } - xoops = kzalloc(struct_size(xoops, ar, XTENSA_CORE_AR_REGS_COUNT), GFP_KERNEL); + xoops = kzalloc_flex(*xoops, ar, XTENSA_CORE_AR_REGS_COUNT, GFP_KERNEL); if (!xoops) goto free_block; diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c index e68bbe685ba3..1c07f5882e1c 100644 --- a/sound/soc/sof/intel/tgl.c +++ b/sound/soc/sof/intel/tgl.c @@ -90,7 +90,7 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/ipc3-dtrace.c b/sound/soc/sof/ipc3-dtrace.c index 50700f5cb0ef..d5cb86b2ad08 100644 --- a/sound/soc/sof/ipc3-dtrace.c +++ b/sound/soc/sof/ipc3-dtrace.c @@ -126,7 +126,7 @@ static int trace_filter_parse(struct snd_sof_dev *sdev, char *string, capacity += TRACE_FILTER_ELEMENTS_PER_ENTRY; entry = strchr(entry + 1, entry_delimiter[0]); } - *out = kmalloc_array(capacity, sizeof(**out), GFP_KERNEL); + *out = kmalloc_objs(**out, capacity, GFP_KERNEL); if (!*out) return -ENOMEM; diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index 743f42fb26c0..b4fc27727106 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -524,7 +524,7 @@ static int sof_ipc3_widget_setup_comp_pipeline(struct snd_sof_widget *swidget) struct snd_sof_widget *comp_swidget; int ret; - pipeline = kzalloc(sizeof(*pipeline), GFP_KERNEL); + pipeline = kzalloc_obj(*pipeline, GFP_KERNEL); if (!pipeline) return -ENOMEM; @@ -589,7 +589,7 @@ static int sof_ipc3_widget_setup_comp_buffer(struct snd_sof_widget *swidget) struct sof_ipc_buffer *buffer; int ret; - buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); + buffer = kzalloc_obj(*buffer, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -893,7 +893,7 @@ static int sof_process_load(struct snd_soc_component *scomp, /* allocate struct for widget control data sizes and types */ if (widget->num_kcontrols) { - wdata = kcalloc(widget->num_kcontrols, sizeof(*wdata), GFP_KERNEL); + wdata = kzalloc_objs(*wdata, widget->num_kcontrols, GFP_KERNEL); if (!wdata) return -ENOMEM; @@ -1567,7 +1567,7 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget) struct snd_sof_dai_link *slink; int ret; - private = kzalloc(sizeof(*private), GFP_KERNEL); + private = kzalloc_obj(*private, GFP_KERNEL); if (!private) return -ENOMEM; @@ -1622,7 +1622,8 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget) continue; /* Reserve memory for all hw configs, eventually freed by widget */ - config = kcalloc(slink->num_hw_configs, sizeof(*config), GFP_KERNEL); + config = kzalloc_objs(*config, slink->num_hw_configs, + GFP_KERNEL); if (!config) { ret = -ENOMEM; goto free_comp; diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index c3337c3f08c1..a21dc53e1026 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -476,8 +476,8 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component, } /* allocate memory for the pipeline data */ - trigger_list = kzalloc(struct_size(trigger_list, pipeline_instance_ids, - pipeline_list->count), GFP_KERNEL); + trigger_list = kzalloc_flex(*trigger_list, pipeline_instance_ids, + pipeline_list->count, GFP_KERNEL); if (!trigger_list) return -ENOMEM; @@ -931,15 +931,15 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm pipeline_list = &spcm->stream[stream].pipeline_list; /* allocate memory for max number of pipeline IDs */ - pipeline_list->pipelines = kcalloc(ipc4_data->max_num_pipelines, - sizeof(*pipeline_list->pipelines), - GFP_KERNEL); + pipeline_list->pipelines = kzalloc_objs(*pipeline_list->pipelines, + ipc4_data->max_num_pipelines, + GFP_KERNEL); if (!pipeline_list->pipelines) { sof_ipc4_pcm_free(sdev, spcm); return -ENOMEM; } - stream_priv = kzalloc(sizeof(*stream_priv), GFP_KERNEL); + stream_priv = kzalloc_obj(*stream_priv, GFP_KERNEL); if (!stream_priv) { sof_ipc4_pcm_free(sdev, spcm); return -ENOMEM; @@ -951,7 +951,7 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm if (!support_info || stream == SNDRV_PCM_STREAM_CAPTURE) continue; - time_info = kzalloc(sizeof(*time_info), GFP_KERNEL); + time_info = kzalloc_obj(*time_info, GFP_KERNEL); if (!time_info) { sof_ipc4_pcm_free(sdev, spcm); return -ENOMEM; diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index 622bffb50a1c..051b02b222f9 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -436,8 +436,9 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp, module_base_cfg->is_pages); if (available_fmt->num_input_formats) { - in_format = kcalloc(available_fmt->num_input_formats, - sizeof(*in_format), GFP_KERNEL); + in_format = kzalloc_objs(*in_format, + available_fmt->num_input_formats, + GFP_KERNEL); if (!in_format) return -ENOMEM; available_fmt->input_pin_fmts = in_format; @@ -457,8 +458,9 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp, } if (available_fmt->num_output_formats) { - out_format = kcalloc(available_fmt->num_output_formats, sizeof(*out_format), - GFP_KERNEL); + out_format = kzalloc_objs(*out_format, + available_fmt->num_output_formats, + GFP_KERNEL); if (!out_format) { ret = -ENOMEM; goto err_in; @@ -627,7 +629,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) int node_type = 0; int ret, dir; - ipc4_copier = kzalloc(sizeof(*ipc4_copier), GFP_KERNEL); + ipc4_copier = kzalloc_obj(*ipc4_copier, GFP_KERNEL); if (!ipc4_copier) return -ENOMEM; @@ -688,7 +690,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) } skip_gtw_cfg: - ipc4_copier->gtw_attr = kzalloc(sizeof(*ipc4_copier->gtw_attr), GFP_KERNEL); + ipc4_copier->gtw_attr = kzalloc_obj(*ipc4_copier->gtw_attr, GFP_KERNEL); if (!ipc4_copier->gtw_attr) { ret = -ENOMEM; goto free_available_fmt; @@ -757,7 +759,7 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) int node_type = 0; int ret; - ipc4_copier = kzalloc(sizeof(*ipc4_copier), GFP_KERNEL); + ipc4_copier = kzalloc_obj(*ipc4_copier, GFP_KERNEL); if (!ipc4_copier) return -ENOMEM; @@ -824,7 +826,7 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) break; } - blob = kzalloc(sizeof(*blob), GFP_KERNEL); + blob = kzalloc_obj(*blob, GFP_KERNEL); if (!blob) { ret = -ENOMEM; goto free_available_fmt; @@ -863,7 +865,8 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) SOF_IPC4_NODE_INDEX_INTEL_DMIC(ipc4_copier->dai_index); break; default: - ipc4_copier->gtw_attr = kzalloc(sizeof(*ipc4_copier->gtw_attr), GFP_KERNEL); + ipc4_copier->gtw_attr = kzalloc_obj(*ipc4_copier->gtw_attr, + GFP_KERNEL); if (!ipc4_copier->gtw_attr) { ret = -ENOMEM; goto free_available_fmt; @@ -930,7 +933,7 @@ static int sof_ipc4_widget_setup_comp_pipeline(struct snd_sof_widget *swidget) struct snd_sof_pipeline *spipe = swidget->spipe; int ret; - pipeline = kzalloc(sizeof(*pipeline), GFP_KERNEL); + pipeline = kzalloc_obj(*pipeline, GFP_KERNEL); if (!pipeline) return -ENOMEM; @@ -989,7 +992,7 @@ static int sof_ipc4_widget_setup_comp_pga(struct snd_sof_widget *swidget) struct sof_ipc4_gain *gain; int ret; - gain = kzalloc(sizeof(*gain), GFP_KERNEL); + gain = kzalloc_obj(*gain, GFP_KERNEL); if (!gain) return -ENOMEM; @@ -1048,7 +1051,7 @@ static int sof_ipc4_widget_setup_comp_mixer(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - mixer = kzalloc(sizeof(*mixer), GFP_KERNEL); + mixer = kzalloc_obj(*mixer, GFP_KERNEL); if (!mixer) return -ENOMEM; @@ -1080,7 +1083,7 @@ static int sof_ipc4_widget_setup_comp_src(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - src = kzalloc(sizeof(*src), GFP_KERNEL); + src = kzalloc_obj(*src, GFP_KERNEL); if (!src) return -ENOMEM; @@ -1123,7 +1126,7 @@ static int sof_ipc4_widget_setup_comp_asrc(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - asrc = kzalloc(sizeof(*asrc), GFP_KERNEL); + asrc = kzalloc_obj(*asrc, GFP_KERNEL); if (!asrc) return -ENOMEM; @@ -1206,7 +1209,7 @@ static int sof_ipc4_widget_setup_comp_process(struct snd_sof_widget *swidget) void *cfg; int ret; - process = kzalloc(sizeof(*process), GFP_KERNEL); + process = kzalloc_obj(*process, GFP_KERNEL); if (!process) return -ENOMEM; diff --git a/sound/soc/sof/sof-client-probes-ipc4.c b/sound/soc/sof/sof-client-probes-ipc4.c index d3fa37106b64..2ab282e98a61 100644 --- a/sound/soc/sof/sof-client-probes-ipc4.c +++ b/sound/soc/sof/sof-client-probes-ipc4.c @@ -327,7 +327,7 @@ static int ipc4_probes_points_add(struct sof_client_dev *cdev, * performance issue I wrote the conversion explicitly open for * future development. */ - points = kcalloc(num_desc, sizeof(*points), GFP_KERNEL); + points = kzalloc_objs(*points, num_desc, GFP_KERNEL); if (!points) return -ENOMEM; diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index 38f1d7cec470..6cc9b7616100 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -554,7 +554,7 @@ int sof_client_register_ipc_rx_handler(struct sof_client_dev *cdev, return -EINVAL; } - event = kmalloc(sizeof(*event), GFP_KERNEL); + event = kmalloc_obj(*event, GFP_KERNEL); if (!event) return -ENOMEM; @@ -608,7 +608,7 @@ int sof_client_register_fw_state_handler(struct sof_client_dev *cdev, if (!callback) return -EINVAL; - event = kmalloc(sizeof(*event), GFP_KERNEL); + event = kmalloc_obj(*event, GFP_KERNEL); if (!event) return -ENOMEM; diff --git a/sound/soc/sof/stream-ipc.c b/sound/soc/sof/stream-ipc.c index 8262443ac89a..e7541e1976b8 100644 --- a/sound/soc/sof/stream-ipc.c +++ b/sound/soc/sof/stream-ipc.c @@ -99,7 +99,7 @@ EXPORT_SYMBOL(sof_set_stream_data_offset); int sof_stream_pcm_open(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream) { - struct sof_stream *stream = kmalloc(sizeof(*stream), GFP_KERNEL); + struct sof_stream *stream = kmalloc_obj(*stream, GFP_KERNEL); if (!stream) return -ENOMEM; diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 9bf8ab610a7e..46d78de5d9da 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -973,7 +973,7 @@ static int sof_control_load(struct snd_soc_component *scomp, int index, dev_dbg(scomp->dev, "tplg: load control type %d name : %s\n", hdr->type, hdr->name); - scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); if (!scontrol) return -ENOMEM; @@ -1233,7 +1233,7 @@ static int sof_widget_parse_tokens(struct snd_soc_component *scomp, struct snd_s num_tuples += token_list[object_token_list[i]].count; /* allocate memory for tuples array */ - swidget->tuples = kcalloc(num_tuples, sizeof(*swidget->tuples), GFP_KERNEL); + swidget->tuples = kzalloc_objs(*swidget->tuples, num_tuples, GFP_KERNEL); if (!swidget->tuples) return -ENOMEM; @@ -1420,7 +1420,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, int token_list_size = 0; int ret = 0; - swidget = kzalloc(sizeof(*swidget), GFP_KERNEL); + swidget = kzalloc_obj(*swidget, GFP_KERNEL); if (!swidget) return -ENOMEM; @@ -1496,7 +1496,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, switch (w->id) { case snd_soc_dapm_dai_in: case snd_soc_dapm_dai_out: - dai = kzalloc(sizeof(*dai), GFP_KERNEL); + dai = kzalloc_obj(*dai, GFP_KERNEL); if (!dai) { ret = -ENOMEM; goto widget_free; @@ -1586,7 +1586,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, if (w->id == snd_soc_dapm_scheduler) { struct snd_sof_pipeline *spipe; - spipe = kzalloc(sizeof(*spipe), GFP_KERNEL); + spipe = kzalloc_obj(*spipe, GFP_KERNEL); if (!spipe) { ret = -ENOMEM; goto free; @@ -1739,7 +1739,7 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, if (!pcm) return 0; - spcm = kzalloc(sizeof(*spcm), GFP_KERNEL); + spcm = kzalloc_obj(*spcm, GFP_KERNEL); if (!spcm) return -ENOMEM; @@ -1906,7 +1906,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ return -EINVAL; } - slink = kzalloc(sizeof(*slink), GFP_KERNEL); + slink = kzalloc_obj(*slink, GFP_KERNEL); if (!slink) return -ENOMEM; @@ -1999,7 +1999,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ } /* allocate memory for tuples array */ - slink->tuples = kcalloc(num_tuples, sizeof(*slink->tuples), GFP_KERNEL); + slink->tuples = kzalloc_objs(*slink->tuples, num_tuples, GFP_KERNEL); if (!slink->tuples) { kfree(slink->hw_configs); kfree(slink); @@ -2094,7 +2094,7 @@ static int sof_route_load(struct snd_soc_component *scomp, int index, int ret = 0; /* allocate memory for sroute and connect */ - sroute = kzalloc(sizeof(*sroute), GFP_KERNEL); + sroute = kzalloc_obj(*sroute, GFP_KERNEL); if (!sroute) return -ENOMEM; @@ -2398,11 +2398,11 @@ static int sof_dspless_widget_ready(struct snd_soc_component *scomp, int index, struct snd_sof_widget *swidget; struct snd_sof_dai *sdai; - swidget = kzalloc(sizeof(*swidget), GFP_KERNEL); + swidget = kzalloc_obj(*swidget, GFP_KERNEL); if (!swidget) return -ENOMEM; - sdai = kzalloc(sizeof(*sdai), GFP_KERNEL); + sdai = kzalloc_obj(*sdai, GFP_KERNEL); if (!sdai) { kfree(swidget); return -ENOMEM; diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c index 4b6ebfa5b033..0d544ff5a24f 100644 --- a/sound/soc/sprd/sprd-pcm-compress.c +++ b/sound/soc/sprd/sprd-pcm-compress.c @@ -160,7 +160,7 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component, return -ENODEV; } - sgt = sg = kcalloc(sg_num, sizeof(*sg), GFP_KERNEL); + sgt = sg = kzalloc_objs(*sg, sg_num, GFP_KERNEL); if (!sg) { ret = -ENOMEM; goto sg_err; diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c index 17ef05309469..7cfe09fdd2a0 100644 --- a/sound/soc/xilinx/xlnx_formatter_pcm.c +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c @@ -341,7 +341,7 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component, !adata->s2mm_presence) return -ENODEV; - stream_data = kzalloc(sizeof(*stream_data), GFP_KERNEL); + stream_data = kzalloc_obj(*stream_data, GFP_KERNEL); if (!stream_data) return -ENOMEM; diff --git a/sound/sound_core.c b/sound/sound_core.c index d81fed1c1226..741e62cffe6e 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c @@ -238,7 +238,7 @@ static DEFINE_SPINLOCK(sound_loader_lock); static int sound_insert_unit(struct sound_unit **list, const struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev) { - struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct sound_unit *s = kmalloc_obj(*s, GFP_KERNEL); int r; if (!s) diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index 01444fc960d0..f690e8f812d9 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -26,7 +26,7 @@ int snd_emux_new(struct snd_emux **remu) struct snd_emux *emu; *remu = NULL; - emu = kzalloc(sizeof(*emu), GFP_KERNEL); + emu = kzalloc_obj(*emu, GFP_KERNEL); if (emu == NULL) return -ENOMEM; @@ -86,8 +86,8 @@ int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, ch emu->card = card; emu->name = kstrdup_const(name, GFP_KERNEL); - emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), - GFP_KERNEL); + emu->voices = kzalloc_objs(struct snd_emux_voice, emu->max_voices, + GFP_KERNEL); if (emu->name == NULL || emu->voices == NULL) return -ENOMEM; diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c index bfe383fa90ba..dacbdf8cd39a 100644 --- a/sound/synth/emux/emux_effect.c +++ b/sound/synth/emux/emux_effect.c @@ -272,8 +272,8 @@ void snd_emux_create_effect(struct snd_emux_port *p) { int i; - p->effect = kcalloc(p->chset.max_channels, - sizeof(struct snd_emux_effect_table), GFP_KERNEL); + p->effect = kzalloc_objs(struct snd_emux_effect_table, + p->chset.max_channels, GFP_KERNEL); if (p->effect) { for (i = 0; i < p->chset.max_channels; i++) p->chset.channels[i].private = p->effect + i; diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 9d63ac006aa5..9a279d07364d 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -132,12 +132,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name, int i, type, cap; /* Allocate structures for this channel */ - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc_obj(*p, GFP_KERNEL); if (!p) return NULL; - p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels), - GFP_KERNEL); + p->chset.channels = kzalloc_objs(*p->chset.channels, max_channels, + GFP_KERNEL); if (!p->chset.channels) { kfree(p); return NULL; @@ -351,7 +351,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) if (emu->midi_ports <= 0) return 0; - emu->vmidi = kcalloc(emu->midi_ports, sizeof(*emu->vmidi), GFP_KERNEL); + emu->vmidi = kzalloc_objs(*emu->vmidi, emu->midi_ports, GFP_KERNEL); if (!emu->vmidi) return -ENOMEM; diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c index 59f3b1b6df4a..01996637d257 100644 --- a/sound/synth/emux/soundfont.c +++ b/sound/synth/emux/soundfont.c @@ -230,7 +230,7 @@ newsf(struct snd_sf_list *sflist, int type, char *name) } /* not found -- create a new one */ - sf = kzalloc(sizeof(*sf), GFP_KERNEL); + sf = kzalloc_obj(*sf, GFP_KERNEL); if (sf == NULL) return NULL; sf->id = sflist->fonts_size; @@ -309,7 +309,7 @@ sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) { struct snd_sf_zone *zp; - zp = kzalloc(sizeof(*zp), GFP_KERNEL); + zp = kzalloc_obj(*zp, GFP_KERNEL); if (!zp) return NULL; zp->next = sf->zones; @@ -342,7 +342,7 @@ sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) { struct snd_sf_sample *sp; - sp = kzalloc(sizeof(*sp), GFP_KERNEL); + sp = kzalloc_obj(*sp, GFP_KERNEL); if (!sp) return NULL; @@ -1391,7 +1391,7 @@ snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr) { struct snd_sf_list *sflist; - sflist = kzalloc(sizeof(*sflist), GFP_KERNEL); + sflist = kzalloc_obj(*sflist, GFP_KERNEL); if (!sflist) return NULL; diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c index 2fd577c2a8eb..36fa4fc9632c 100644 --- a/sound/synth/util_mem.c +++ b/sound/synth/util_mem.c @@ -26,7 +26,7 @@ snd_util_memhdr_new(int memsize) { struct snd_util_memhdr *hdr; - hdr = kzalloc(sizeof(*hdr), GFP_KERNEL); + hdr = kzalloc_obj(*hdr, GFP_KERNEL); if (hdr == NULL) return NULL; hdr->size = memsize; diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index 49629d4bb327..b7378a514e21 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c @@ -141,8 +141,7 @@ static int usb6fire_comm_write16(struct comm_runtime *rt, u8 request, int usb6fire_comm_init(struct sfire_chip *chip) { - struct comm_runtime *rt = kzalloc(sizeof(struct comm_runtime), - GFP_KERNEL); + struct comm_runtime *rt = kzalloc_obj(struct comm_runtime, GFP_KERNEL); struct urb *urb; int ret; diff --git a/sound/usb/6fire/control.c b/sound/usb/6fire/control.c index 9bd8dcbb68e4..0e8be4efbf44 100644 --- a/sound/usb/6fire/control.c +++ b/sound/usb/6fire/control.c @@ -551,8 +551,8 @@ int usb6fire_control_init(struct sfire_chip *chip) { int i; int ret; - struct control_runtime *rt = kzalloc(sizeof(struct control_runtime), - GFP_KERNEL); + struct control_runtime *rt = kzalloc_obj(struct control_runtime, + GFP_KERNEL); struct comm_runtime *comm_rt = chip->comm; if (!rt) diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index cc8caec946cc..6707fb8a2d1e 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c @@ -195,8 +195,7 @@ static int usb6fire_fw_ezusb_upload( u8 data; struct usb_device *device = interface_to_usbdev(intf); const struct firmware *fw = NULL; - struct ihex_record *rec = kmalloc(sizeof(struct ihex_record), - GFP_KERNEL); + struct ihex_record *rec = kmalloc_obj(struct ihex_record, GFP_KERNEL); if (!rec) return -ENOMEM; diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index 4d1eeb32c5fe..40c935fb7592 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c @@ -140,8 +140,7 @@ static const struct snd_rawmidi_ops in_ops = { int usb6fire_midi_init(struct sfire_chip *chip) { int ret; - struct midi_runtime *rt = kzalloc(sizeof(struct midi_runtime), - GFP_KERNEL); + struct midi_runtime *rt = kzalloc_obj(struct midi_runtime, GFP_KERNEL); struct comm_runtime *comm_rt = chip->comm; if (!rt) diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index 08515da5dcc8..abd1338eb972 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c @@ -587,7 +587,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) int ret; struct snd_pcm *pcm; struct pcm_runtime *rt = - kzalloc(sizeof(struct pcm_runtime), GFP_KERNEL); + kzalloc_obj(struct pcm_runtime, GFP_KERNEL); if (!rt) return -ENOMEM; diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 95d425dd9d70..06837b9f8bf8 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -681,7 +681,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBACK) : usb_rcvisocpipe(usb_dev, ENDPOINT_CAPTURE); - urbs = kmalloc_array(N_URBS, sizeof(*urbs), GFP_KERNEL); + urbs = kmalloc_objs(*urbs, N_URBS, GFP_KERNEL); if (!urbs) { *ret = -ENOMEM; return NULL; @@ -813,8 +813,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev) NULL, 0, 0); cdev->data_cb_info = - kmalloc_array(N_URBS, sizeof(struct snd_usb_caiaq_cb_info), - GFP_KERNEL); + kmalloc_objs(struct snd_usb_caiaq_cb_info, N_URBS, GFP_KERNEL); if (!cdev->data_cb_info) return -ENOMEM; diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index a855b2cc60c7..8a2bb82c1a18 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -621,7 +621,7 @@ iface_ref_find(struct snd_usb_audio *chip, int iface) if (ip->iface == iface) return ip; - ip = kzalloc(sizeof(*ip), GFP_KERNEL); + ip = kzalloc_obj(*ip, GFP_KERNEL); if (!ip) return NULL; ip->iface = iface; @@ -639,7 +639,7 @@ clock_ref_find(struct snd_usb_audio *chip, int clock) if (ref->clock == clock) return ref; - ref = kzalloc(sizeof(*ref), GFP_KERNEL); + ref = kzalloc_obj(*ref, GFP_KERNEL); if (!ref) return NULL; ref->clock = clock; @@ -698,7 +698,7 @@ int snd_usb_add_endpoint(struct snd_usb_audio *chip, int ep_num, int type) usb_audio_dbg(chip, "Creating new %s endpoint #%x\n", ep_type_name(type), ep_num); - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; diff --git a/sound/usb/fcp.c b/sound/usb/fcp.c index 1f4595d1e217..2ca41460aa5b 100644 --- a/sound/usb/fcp.c +++ b/sound/usb/fcp.c @@ -329,7 +329,7 @@ static int fcp_add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc(sizeof(*elem), GFP_KERNEL); + elem = kzalloc_obj(*elem, GFP_KERNEL); if (!elem) return -ENOMEM; @@ -654,7 +654,7 @@ static int fcp_ioctl_set_meter_map(struct usb_mixer_interface *mixer, if (!private->meter_ctl) { /* Allocate buffer for the map */ s16 *new_map __free(kfree) = - kmalloc_array(map.map_size, sizeof(s16), GFP_KERNEL); + kmalloc_objs(s16, map.map_size, GFP_KERNEL); if (!new_map) return -ENOMEM; @@ -1045,7 +1045,7 @@ static int fcp_init(struct usb_mixer_interface *mixer, static int fcp_init_private(struct usb_mixer_interface *mixer) { struct fcp_data *private = - kzalloc(sizeof(struct fcp_data), GFP_KERNEL); + kzalloc_obj(struct fcp_data, GFP_KERNEL); if (!private) return -ENOMEM; diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index 27cd427fbaa5..2603a88a9d27 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c @@ -547,7 +547,7 @@ int hiface_pcm_init(struct hiface_chip *chip, u8 extra_freq) struct snd_pcm *pcm; struct pcm_runtime *rt; - rt = kzalloc(sizeof(*rt), GFP_KERNEL); + rt = kzalloc_obj(*rt, GFP_KERNEL); if (!rt) return -ENOMEM; diff --git a/sound/usb/line6/capture.c b/sound/usb/line6/capture.c index 9ef4faa006a0..bad575fa4ed2 100644 --- a/sound/usb/line6/capture.c +++ b/sound/usb/line6/capture.c @@ -255,8 +255,8 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm) struct usb_line6 *line6 = line6pcm->line6; int i; - line6pcm->in.urbs = kcalloc(line6->iso_buffers, sizeof(struct urb *), - GFP_KERNEL); + line6pcm->in.urbs = kzalloc_objs(struct urb *, line6->iso_buffers, + GFP_KERNEL); if (line6pcm->in.urbs == NULL) return -ENOMEM; diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index e97368c31417..191682894f04 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -202,7 +202,7 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, struct urb *urb; /* create message: */ - msg = kzalloc(sizeof(struct message), GFP_ATOMIC); + msg = kzalloc_obj(struct message, GFP_ATOMIC); if (msg == NULL) return -ENOMEM; diff --git a/sound/usb/line6/midi.c b/sound/usb/line6/midi.c index 4731293728e6..0e5cb8a86922 100644 --- a/sound/usb/line6/midi.c +++ b/sound/usb/line6/midi.c @@ -264,7 +264,7 @@ int line6_init_midi(struct usb_line6 *line6) if (err < 0) return err; - line6midi = kzalloc(sizeof(struct snd_line6_midi), GFP_KERNEL); + line6midi = kzalloc_obj(struct snd_line6_midi, GFP_KERNEL); if (!line6midi) return -ENOMEM; diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index f61d9f6cf754..ea1cea5d1105 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c @@ -528,7 +528,7 @@ int line6_init_pcm(struct usb_line6 *line6, if (err < 0) return err; - line6pcm = kzalloc(sizeof(*line6pcm), GFP_KERNEL); + line6pcm = kzalloc_obj(*line6pcm, GFP_KERNEL); if (!line6pcm) return -ENOMEM; diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c index 9f26f66e6792..5d3666ebaf83 100644 --- a/sound/usb/line6/playback.c +++ b/sound/usb/line6/playback.c @@ -404,8 +404,8 @@ int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm) struct usb_line6 *line6 = line6pcm->line6; int i; - line6pcm->out.urbs = kcalloc(line6->iso_buffers, sizeof(struct urb *), - GFP_KERNEL); + line6pcm->out.urbs = kzalloc_objs(struct urb *, line6->iso_buffers, + GFP_KERNEL); if (line6pcm->out.urbs == NULL) return -ENOMEM; diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c index 68cda7bf330c..abc1a750a921 100644 --- a/sound/usb/line6/toneport.c +++ b/sound/usb/line6/toneport.c @@ -363,7 +363,7 @@ static int toneport_setup(struct usb_line6_toneport *toneport) struct usb_line6 *line6 = &toneport->line6; struct usb_device *usbdev = line6->usbdev; - ticks = kmalloc(sizeof(*ticks), GFP_KERNEL); + ticks = kmalloc_obj(*ticks, GFP_KERNEL); if (!ticks) return -ENOMEM; diff --git a/sound/usb/media.c b/sound/usb/media.c index 0064f8d12422..0aab1eb5c4e9 100644 --- a/sound/usb/media.c +++ b/sound/usb/media.c @@ -49,7 +49,7 @@ int snd_media_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm, return 0; /* allocate media_ctl */ - mctl = kzalloc(sizeof(*mctl), GFP_KERNEL); + mctl = kzalloc_obj(*mctl, GFP_KERNEL); if (!mctl) return -ENOMEM; @@ -188,7 +188,7 @@ static int snd_media_mixer_init(struct snd_usb_audio *chip) continue; /* allocate media_mixer_ctl */ - mctl = kzalloc(sizeof(*mctl), GFP_KERNEL); + mctl = kzalloc_obj(*mctl, GFP_KERNEL); if (!mctl) return -ENOMEM; diff --git a/sound/usb/midi.c b/sound/usb/midi.c index dd8249e75970..c72434ac581d 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1328,7 +1328,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, int err; rep->in = NULL; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; ep->umidi = umidi; @@ -1414,7 +1414,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi, int err; rep->out = NULL; - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; ep->umidi = umidi; @@ -2506,7 +2506,7 @@ int __snd_usbmidi_create(struct snd_card *card, int out_ports, in_ports; int i, err; - umidi = kzalloc(sizeof(*umidi), GFP_KERNEL); + umidi = kzalloc_obj(*umidi, GFP_KERNEL); if (!umidi) return -ENOMEM; umidi->dev = interface_to_usbdev(iface); diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index e6793f3bdfc3..cf05e4cb97b1 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -432,7 +432,7 @@ static int create_midi2_endpoint(struct snd_usb_midi2_interface *umidi, hostep->desc.bEndpointAddress, ms_ep->bNumGrpTrmBlock); - ep = kzalloc(sizeof(*ep), GFP_KERNEL); + ep = kzalloc_obj(*ep, GFP_KERNEL); if (!ep) return -ENOMEM; @@ -693,7 +693,7 @@ static int create_midi2_ump(struct snd_usb_midi2_interface *umidi, char idstr[16]; int err; - rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL); + rmidi = kzalloc_obj(*rmidi, GFP_KERNEL); if (!rmidi) return -ENOMEM; INIT_LIST_HEAD(&rmidi->list); @@ -1101,7 +1101,7 @@ int snd_usb_midi_v2_create(struct snd_usb_audio *chip, hostif->desc.bInterfaceNumber, hostif->desc.bAlternateSetting); - umidi = kzalloc(sizeof(*umidi), GFP_KERNEL); + umidi = kzalloc_obj(*umidi, GFP_KERNEL); if (!umidi) return -ENOMEM; umidi->chip = chip; diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 76b6eb55dcc2..62be8a00a826 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c @@ -1062,7 +1062,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, while (size >= max_packet_size) { if (u >= stream->queue_length) goto bufsize_error; - urb = kmalloc(sizeof(*urb), GFP_KERNEL); + urb = kmalloc_obj(*urb, GFP_KERNEL); if (!urb) return -ENOMEM; usb_init_urb(&urb->urb); diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index bfe15b1cb66c..1b66f9581b4a 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1684,7 +1684,7 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer, if (check_ignored_ctl(map)) return; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return; snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid); @@ -1894,7 +1894,7 @@ static void build_connector_control(struct usb_mixer_interface *mixer, if (check_ignored_ctl(map)) return; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return; snd_usb_mixer_elem_init_std(&cval->head, mixer, term->id); @@ -1956,7 +1956,7 @@ static int parse_clock_source_unit(struct mixer_build *state, int unitid, UAC2_CS_CONTROL_CLOCK_VALID)) return 0; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return -ENOMEM; @@ -2177,7 +2177,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, if (check_ignored_ctl(map)) return; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return; @@ -2525,7 +2525,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, map = find_map(state->map, unitid, valinfo->control); if (check_ignored_ctl(map)) continue; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid); @@ -2771,7 +2771,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, if (check_ignored_ctl(map)) return 0; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid); @@ -3598,13 +3598,13 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) strscpy(chip->card->mixername, "USB Mixer"); - mixer = kzalloc(sizeof(*mixer), GFP_KERNEL); + mixer = kzalloc_obj(*mixer, GFP_KERNEL); if (!mixer) return -ENOMEM; mixer->chip = chip; mixer->ignore_ctl_error = !!(chip->quirk_flags & QUIRK_FLAG_IGNORE_CTL_ERROR); - mixer->id_elems = kcalloc(MAX_ID_ELEMS, sizeof(*mixer->id_elems), - GFP_KERNEL); + mixer->id_elems = kzalloc_objs(*mixer->id_elems, MAX_ID_ELEMS, + GFP_KERNEL); if (!mixer->id_elems) { kfree(mixer); return -ENOMEM; diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index ec65e8a71919..dc538450f3b9 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -67,7 +67,7 @@ static int snd_create_std_mono_ctl_offset(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *cval; struct snd_kcontrol *kctl; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return -ENOMEM; @@ -151,7 +151,7 @@ static int add_single_ctl_with_resume(struct usb_mixer_interface *mixer, struct usb_mixer_elem_list *list; struct snd_kcontrol *kctl; - list = kzalloc(sizeof(*list), GFP_KERNEL); + list = kzalloc_obj(*list, GFP_KERNEL); if (!list) return -ENOMEM; if (listp) @@ -274,7 +274,8 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL); if (!mixer->rc_urb) return -ENOMEM; - mixer->rc_setup_packet = kmalloc(sizeof(*mixer->rc_setup_packet), GFP_KERNEL); + mixer->rc_setup_packet = kmalloc_obj(*mixer->rc_setup_packet, + GFP_KERNEL); if (!mixer->rc_setup_packet) { usb_free_urb(mixer->rc_urb); mixer->rc_urb = NULL; @@ -616,7 +617,7 @@ static int snd_dualsense_ih_connect(struct input_handler *handler, struct input_handle *handle; int err; - handle = kzalloc(sizeof(*handle), GFP_KERNEL); + handle = kzalloc_obj(*handle, GFP_KERNEL); if (!handle) return -ENOMEM; @@ -713,7 +714,7 @@ static int snd_dualsense_jack_create(struct usb_mixer_interface *mixer, struct snd_kcontrol *kctl; int err; - mei = kzalloc(sizeof(*mei), GFP_KERNEL); + mei = kzalloc_obj(*mei, GFP_KERNEL); if (!mei) return -ENOMEM; @@ -2278,7 +2279,7 @@ static int realtek_add_jack(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *cval; struct snd_kcontrol *kctl; - cval = kzalloc(sizeof(*cval), GFP_KERNEL); + cval = kzalloc_obj(*cval, GFP_KERNEL); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid); diff --git a/sound/usb/mixer_s1810c.c b/sound/usb/mixer_s1810c.c index b4ce89afb25b..f931643db1c5 100644 --- a/sound/usb/mixer_s1810c.c +++ b/sound/usb/mixer_s1810c.c @@ -534,7 +534,7 @@ snd_s1810c_switch_init(struct usb_mixer_interface *mixer, struct snd_kcontrol *kctl; struct usb_mixer_elem_info *elem; - elem = kzalloc(sizeof(struct usb_mixer_elem_info), GFP_KERNEL); + elem = kzalloc_obj(struct usb_mixer_elem_info, GFP_KERNEL); if (!elem) return -ENOMEM; @@ -645,7 +645,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer) if (ret < 0) return ret; - private = kzalloc(sizeof(struct s1810_mixer_state), GFP_KERNEL); + private = kzalloc_obj(struct s1810_mixer_state, GFP_KERNEL); if (!private) return -ENOMEM; diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index fa11f25288b7..8582153cb4a7 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -819,7 +819,7 @@ static int add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc(sizeof(*elem), GFP_KERNEL); + elem = kzalloc_obj(*elem, GFP_KERNEL); if (!elem) return -ENOMEM; diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 88b7e42d159e..41a496adcc09 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -3197,7 +3197,7 @@ static int scarlett2_add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc(sizeof(*elem), GFP_KERNEL); + elem = kzalloc_obj(*elem, GFP_KERNEL); if (!elem) return -ENOMEM; @@ -8272,7 +8272,7 @@ static int scarlett2_init_private(struct usb_mixer_interface *mixer, const struct scarlett2_device_entry *entry) { struct scarlett2_data *private = - kzalloc(sizeof(struct scarlett2_data), GFP_KERNEL); + kzalloc_obj(struct scarlett2_data, GFP_KERNEL); if (!private) return -ENOMEM; diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c index f9df40730eff..c7b63c29cbf6 100644 --- a/sound/usb/mixer_us16x08.c +++ b/sound/usb/mixer_us16x08.c @@ -969,7 +969,7 @@ static struct snd_us16x08_comp_store *snd_us16x08_create_comp_store(void) int i; struct snd_us16x08_comp_store *tmp; - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kmalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return NULL; @@ -991,7 +991,7 @@ static struct snd_us16x08_eq_store *snd_us16x08_create_eq_store(void) int i, b_idx; struct snd_us16x08_eq_store *tmp; - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kmalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return NULL; @@ -1027,7 +1027,7 @@ static struct snd_us16x08_meter_store *snd_us16x08_create_meter_store(void) { struct snd_us16x08_meter_store *tmp; - tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kzalloc_obj(*tmp, GFP_KERNEL); if (!tmp) return NULL; tmp->comp_index = 1; @@ -1059,7 +1059,7 @@ static int add_new_ctl(struct usb_mixer_interface *mixer, usb_audio_dbg(mixer->chip, "us16x08 add mixer %s\n", name); - elem = kzalloc(sizeof(*elem), GFP_KERNEL); + elem = kzalloc_obj(*elem, GFP_KERNEL); if (!elem) return -ENOMEM; diff --git a/sound/usb/power.c b/sound/usb/power.c index 66bd4daa68fd..47863b688b4d 100644 --- a/sound/usb/power.c +++ b/sound/usb/power.c @@ -20,7 +20,7 @@ snd_usb_find_power_domain(struct usb_host_interface *ctrl_iface, struct snd_usb_power_domain *pd; void *p; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) return NULL; diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c index cfb30a195364..b709b6cb3051 100644 --- a/sound/usb/qcom/qc_audio_offload.c +++ b/sound/usb/qcom/qc_audio_offload.c @@ -438,7 +438,7 @@ static unsigned long uaudio_get_iova(unsigned long *curr_iova, } } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc_obj(*info, GFP_KERNEL); if (!info) { iova = 0; goto done; @@ -1432,9 +1432,9 @@ static int prepare_qmi_response(struct snd_usb_substream *subs, init_waitqueue_head(&uadev[card_num].disconnect_wq); uadev[card_num].num_intf = subs->dev->config->desc.bNumInterfaces; - uadev[card_num].info = kcalloc(uadev[card_num].num_intf, - sizeof(struct intf_info), - GFP_KERNEL); + uadev[card_num].info = kzalloc_objs(struct intf_info, + uadev[card_num].num_intf, + GFP_KERNEL); if (!uadev[card_num].info) { ret = -ENOMEM; goto unmap_er; @@ -1687,7 +1687,7 @@ static struct qmi_msg_handler uaudio_stream_req_handlers = { */ static int qc_usb_audio_offload_init_qmi_dev(void) { - uaudio_qdev = kzalloc(sizeof(*uaudio_qdev), GFP_KERNEL); + uaudio_qdev = kzalloc_obj(*uaudio_qdev, GFP_KERNEL); if (!uaudio_qdev) return -ENOMEM; @@ -1759,7 +1759,7 @@ static void qc_usb_audio_offload_probe(struct snd_usb_audio *chip) guard(mutex)(&qdev_mutex); guard(mutex)(&chip->mutex); if (!uadev[chip->card->number].chip) { - sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kzalloc_obj(*sdev, GFP_KERNEL); if (!sdev) return; @@ -1914,11 +1914,11 @@ static int qc_usb_audio_probe(struct auxiliary_device *auxdev, struct uaudio_qmi_svc *svc; int ret; - svc = kzalloc(sizeof(*svc), GFP_KERNEL); + svc = kzalloc_obj(*svc, GFP_KERNEL); if (!svc) return -ENOMEM; - svc->uaudio_svc_hdl = kzalloc(sizeof(*svc->uaudio_svc_hdl), GFP_KERNEL); + svc->uaudio_svc_hdl = kzalloc_obj(*svc->uaudio_svc_hdl, GFP_KERNEL); if (!svc->uaudio_svc_hdl) { ret = -ENOMEM; goto free_svc; diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 17e49617218b..975b57adf2f4 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -566,7 +566,7 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac if (err < 0) dev_dbg(&dev->dev, "error sending boot message: %d\n", err); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); + kmalloc_obj(*new_device_descriptor, GFP_KERNEL); if (!new_device_descriptor) return -ENOMEM; err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, @@ -944,7 +944,7 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) dev_dbg(&dev->dev, "device initialised!\n"); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); + kmalloc_obj(*new_device_descriptor, GFP_KERNEL); if (!new_device_descriptor) return -ENOMEM; @@ -1279,7 +1279,7 @@ static int snd_usb_mbox3_boot_quirk(struct usb_device *dev) dev_dbg(&dev->dev, "MBOX3: device initialised!\n"); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); + kmalloc_obj(*new_device_descriptor, GFP_KERNEL); if (!new_device_descriptor) return -ENOMEM; diff --git a/sound/usb/stream.c b/sound/usb/stream.c index ec7d756d78d1..adf1827807d4 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -291,7 +291,7 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, if (channels > ARRAY_SIZE(chmap->map)) return NULL; - chmap = kzalloc(sizeof(*chmap), GFP_KERNEL); + chmap = kzalloc_obj(*chmap, GFP_KERNEL); if (!chmap) return NULL; @@ -335,7 +335,7 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor if (channels > ARRAY_SIZE(chmap->map)) return NULL; - chmap = kzalloc(sizeof(*chmap), GFP_KERNEL); + chmap = kzalloc_obj(*chmap, GFP_KERNEL); if (!chmap) return NULL; @@ -526,7 +526,7 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, } /* create a new pcm */ - as = kzalloc(sizeof(*as), GFP_KERNEL); + as = kzalloc_obj(*as, GFP_KERNEL); if (!as) return -ENOMEM; as->pcm_index = chip->pcm_devs; @@ -693,7 +693,7 @@ audio_format_alloc_init(struct snd_usb_audio *chip, struct usb_host_endpoint *ep = &alts->endpoint[0]; struct audioformat *fp; - fp = kzalloc(sizeof(*fp), GFP_KERNEL); + fp = kzalloc_obj(*fp, GFP_KERNEL); if (!fp) return NULL; @@ -927,7 +927,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip, break; } - chmap = kzalloc(sizeof(*chmap), GFP_KERNEL); + chmap = kzalloc_obj(*chmap, GFP_KERNEL); if (!chmap) return ERR_PTR(-ENOMEM); @@ -1078,7 +1078,7 @@ found_clock: fp->rate_max = UAC3_BADD_SAMPLING_RATE; fp->rates = SNDRV_PCM_RATE_CONTINUOUS; - pd = kzalloc(sizeof(*pd), GFP_KERNEL); + pd = kzalloc_obj(*pd, GFP_KERNEL); if (!pd) { audioformat_free(fp); return NULL; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index c7c7ec9c228b..c8f2f07d7f8d 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -657,15 +657,13 @@ static int usx2y_rate_set(struct usx2ydev *usx2y, int rate) struct urb *urb; if (usx2y->rate != rate) { - us = kzalloc(struct_size(us, urb, NOOF_SETRATE_URBS), - GFP_KERNEL); + us = kzalloc_flex(*us, urb, NOOF_SETRATE_URBS, GFP_KERNEL); if (!us) { err = -ENOMEM; goto cleanup; } us->len = NOOF_SETRATE_URBS; - usbdata = kmalloc_array(NOOF_SETRATE_URBS, sizeof(int), - GFP_KERNEL); + usbdata = kmalloc_objs(int, NOOF_SETRATE_URBS, GFP_KERNEL); if (!usbdata) { err = -ENOMEM; goto cleanup; @@ -944,7 +942,8 @@ static int usx2y_audio_stream_new(struct snd_card *card, int playback_endpoint, for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; i <= SNDRV_PCM_STREAM_CAPTURE; ++i) { - usx2y_substream[i] = kzalloc(sizeof(struct snd_usx2y_substream), GFP_KERNEL); + usx2y_substream[i] = kzalloc_obj(struct snd_usx2y_substream, + GFP_KERNEL); if (!usx2y_substream[i]) return -ENOMEM; diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c index 52c5757585c6..65abd8510ff4 100644 --- a/sound/virtio/virtio_card.c +++ b/sound/virtio/virtio_card.c @@ -137,8 +137,7 @@ static int virtsnd_find_vqs(struct virtio_snd *snd) n = virtqueue_get_vring_size(vqs[VIRTIO_SND_VQ_EVENT]); - snd->event_msgs = kmalloc_array(n, sizeof(*snd->event_msgs), - GFP_KERNEL); + snd->event_msgs = kmalloc_objs(*snd->event_msgs, n, GFP_KERNEL); if (!snd->event_msgs) return -ENOMEM; diff --git a/sound/virtio/virtio_jack.c b/sound/virtio/virtio_jack.c index c69f1dcdcc84..2f1ec3ac02f0 100644 --- a/sound/virtio/virtio_jack.c +++ b/sound/virtio/virtio_jack.c @@ -144,7 +144,7 @@ int virtsnd_jack_parse_cfg(struct virtio_snd *snd) if (!snd->jacks) return -ENOMEM; - info = kcalloc(snd->njacks, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, snd->njacks, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/sound/virtio/virtio_pcm.c b/sound/virtio/virtio_pcm.c index 3602b6690fcd..ef5a8a507b24 100644 --- a/sound/virtio/virtio_pcm.c +++ b/sound/virtio/virtio_pcm.c @@ -354,7 +354,7 @@ int virtsnd_pcm_parse_cfg(struct virtio_snd *snd) spin_lock_init(&vss->lock); } - info = kcalloc(snd->nsubstreams, sizeof(*info), GFP_KERNEL); + info = kzalloc_objs(*info, snd->nsubstreams, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c index 9778020a7ba8..79af520ef12e 100644 --- a/sound/virtio/virtio_pcm_msg.c +++ b/sound/virtio/virtio_pcm_msg.c @@ -135,7 +135,7 @@ int virtsnd_pcm_msg_alloc(struct virtio_pcm_substream *vss, struct snd_pcm_runtime *runtime = vss->substream->runtime; unsigned int i; - vss->msgs = kcalloc(periods, sizeof(*vss->msgs), GFP_KERNEL); + vss->msgs = kzalloc_objs(*vss->msgs, periods, GFP_KERNEL); if (!vss->msgs) return -ENOMEM; @@ -146,7 +146,7 @@ int virtsnd_pcm_msg_alloc(struct virtio_pcm_substream *vss, int sg_num = virtsnd_pcm_sg_num(data, period_bytes); struct virtio_pcm_msg *msg; - msg = kzalloc(struct_size(msg, sgs, sg_num + 2), GFP_KERNEL); + msg = kzalloc_flex(*msg, sgs, sg_num + 2, GFP_KERNEL); if (!msg) return -ENOMEM; diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index f5807fc73c54..dc7501c95b99 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -475,7 +475,7 @@ static void had_build_channel_allocation_map(struct snd_intelhad *intelhaddata) kfree(intelhaddata->chmap->chmap); intelhaddata->chmap->chmap = NULL; - chmap = kzalloc(sizeof(*chmap), GFP_KERNEL); + chmap = kzalloc_obj(*chmap, GFP_KERNEL); if (!chmap) return; diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c index b229eb6f7057..379a4a1cb911 100644 --- a/sound/xen/xen_snd_front_alsa.c +++ b/sound/xen/xen_snd_front_alsa.c @@ -442,8 +442,8 @@ static int shbuf_setup_backstore(struct xen_snd_front_pcm_stream_info *stream, stream->buffer_sz = buffer_sz; stream->num_pages = DIV_ROUND_UP(stream->buffer_sz, PAGE_SIZE); - stream->pages = kcalloc(stream->num_pages, sizeof(struct page *), - GFP_KERNEL); + stream->pages = kzalloc_objs(struct page *, stream->num_pages, + GFP_KERNEL); if (!stream->pages) return -ENOMEM; diff --git a/sound/xen/xen_snd_front_evtchnl.c b/sound/xen/xen_snd_front_evtchnl.c index 2fbed8e4a490..8a8807cbc80c 100644 --- a/sound/xen/xen_snd_front_evtchnl.c +++ b/sound/xen/xen_snd_front_evtchnl.c @@ -267,9 +267,8 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, int d, ret = 0; front_info->evt_pairs = - kcalloc(num_streams, - sizeof(struct xen_snd_front_evtchnl_pair), - GFP_KERNEL); + kzalloc_objs(struct xen_snd_front_evtchnl_pair, + num_streams, GFP_KERNEL); if (!front_info->evt_pairs) return -ENOMEM; diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c index 375d6285475e..6b1d90161099 100644 --- a/virt/kvm/coalesced_mmio.c +++ b/virt/kvm/coalesced_mmio.c @@ -128,8 +128,7 @@ int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm, if (zone->pio != 1 && zone->pio != 0) return -EINVAL; - dev = kzalloc(sizeof(struct kvm_coalesced_mmio_dev), - GFP_KERNEL_ACCOUNT); + dev = kzalloc_obj(struct kvm_coalesced_mmio_dev, GFP_KERNEL_ACCOUNT); if (!dev) return -ENOMEM; diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index a369b20d47f0..0e8b8a2c5b79 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -382,7 +382,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) if (!kvm_arch_irqfd_allowed(kvm, args)) return -EINVAL; - irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL_ACCOUNT); + irqfd = kzalloc_obj(*irqfd, GFP_KERNEL_ACCOUNT); if (!irqfd) return -ENOMEM; @@ -430,8 +430,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) } if (!irqfd->resampler) { - resampler = kzalloc(sizeof(*resampler), - GFP_KERNEL_ACCOUNT); + resampler = kzalloc_obj(*resampler, GFP_KERNEL_ACCOUNT); if (!resampler) { ret = -ENOMEM; mutex_unlock(&kvm->irqfds.resampler_lock); @@ -874,7 +873,7 @@ static int kvm_assign_ioeventfd_idx(struct kvm *kvm, if (IS_ERR(eventfd)) return PTR_ERR(eventfd); - p = kzalloc(sizeof(*p), GFP_KERNEL_ACCOUNT); + p = kzalloc_obj(*p, GFP_KERNEL_ACCOUNT); if (!p) { ret = -ENOMEM; goto fail; diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c index 923c51a3a525..e73339295a44 100644 --- a/virt/kvm/guest_memfd.c +++ b/virt/kvm/guest_memfd.c @@ -568,7 +568,7 @@ static int __kvm_gmem_create(struct kvm *kvm, loff_t size, u64 flags) if (fd < 0) return fd; - f = kzalloc(sizeof(*f), GFP_KERNEL); + f = kzalloc_obj(*f, GFP_KERNEL); if (!f) { err = -ENOMEM; goto err_fd; diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 6ccabfd32287..462c70621247 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -183,7 +183,7 @@ int kvm_set_irq_routing(struct kvm *kvm, nr_rt_entries += 1; - new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT); + new = kzalloc_flex(*new, map, nr_rt_entries, GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM; @@ -194,7 +194,7 @@ int kvm_set_irq_routing(struct kvm *kvm, for (i = 0; i < nr; ++i) { r = -ENOMEM; - e = kzalloc(sizeof(*e), GFP_KERNEL_ACCOUNT); + e = kzalloc_obj(*e, GFP_KERNEL_ACCOUNT); if (!e) goto out; @@ -246,7 +246,7 @@ int kvm_init_irq_routing(struct kvm *kvm) struct kvm_irq_routing_table *new; int chip_size; - new = kzalloc(struct_size(new, map, 1), GFP_KERNEL_ACCOUNT); + new = kzalloc_flex(*new, map, 1, GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 61dca8d37abc..b798903540b6 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1043,15 +1043,15 @@ static int kvm_create_vm_debugfs(struct kvm *kvm, const char *fdname) return 0; kvm->debugfs_dentry = dent; - kvm->debugfs_stat_data = kcalloc(kvm_debugfs_num_entries, - sizeof(*kvm->debugfs_stat_data), - GFP_KERNEL_ACCOUNT); + kvm->debugfs_stat_data = kzalloc_objs(*kvm->debugfs_stat_data, + kvm_debugfs_num_entries, + GFP_KERNEL_ACCOUNT); if (!kvm->debugfs_stat_data) goto out_err; for (i = 0; i < kvm_vm_stats_header.num_desc; ++i) { pdesc = &kvm_vm_stats_desc[i]; - stat_data = kzalloc(sizeof(*stat_data), GFP_KERNEL_ACCOUNT); + stat_data = kzalloc_obj(*stat_data, GFP_KERNEL_ACCOUNT); if (!stat_data) goto out_err; @@ -1066,7 +1066,7 @@ static int kvm_create_vm_debugfs(struct kvm *kvm, const char *fdname) for (i = 0; i < kvm_vcpu_stats_header.num_desc; ++i) { pdesc = &kvm_vcpu_stats_desc[i]; - stat_data = kzalloc(sizeof(*stat_data), GFP_KERNEL_ACCOUNT); + stat_data = kzalloc_obj(*stat_data, GFP_KERNEL_ACCOUNT); if (!stat_data) goto out_err; @@ -1185,7 +1185,7 @@ static struct kvm *kvm_create_vm(unsigned long type, const char *fdname) r = -ENOMEM; for (i = 0; i < KVM_NR_BUSES; i++) { rcu_assign_pointer(kvm->buses[i], - kzalloc(sizeof(struct kvm_io_bus), GFP_KERNEL_ACCOUNT)); + kzalloc_obj(struct kvm_io_bus, GFP_KERNEL_ACCOUNT)); if (!kvm->buses[i]) goto out_err_no_arch_destroy_vm; } @@ -1944,7 +1944,7 @@ static int kvm_set_memslot(struct kvm *kvm, * invalidation needs to be reverted. */ if (change == KVM_MR_DELETE || change == KVM_MR_MOVE) { - invalid_slot = kzalloc(sizeof(*invalid_slot), GFP_KERNEL_ACCOUNT); + invalid_slot = kzalloc_obj(*invalid_slot, GFP_KERNEL_ACCOUNT); if (!invalid_slot) { mutex_unlock(&kvm->slots_arch_lock); return -ENOMEM; @@ -2117,7 +2117,7 @@ static int kvm_set_memory_region(struct kvm *kvm, return -EEXIST; /* Allocate a slot that will persist in the memslot. */ - new = kzalloc(sizeof(*new), GFP_KERNEL_ACCOUNT); + new = kzalloc_obj(*new, GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM; @@ -4505,7 +4505,7 @@ static long kvm_vcpu_ioctl(struct file *filp, struct kvm_regs *kvm_regs; r = -ENOMEM; - kvm_regs = kzalloc(sizeof(struct kvm_regs), GFP_KERNEL); + kvm_regs = kzalloc_obj(struct kvm_regs, GFP_KERNEL); if (!kvm_regs) goto out; r = kvm_arch_vcpu_ioctl_get_regs(vcpu, kvm_regs); @@ -4532,7 +4532,7 @@ out_free1: break; } case KVM_GET_SREGS: { - kvm_sregs = kzalloc(sizeof(struct kvm_sregs), GFP_KERNEL); + kvm_sregs = kzalloc_obj(struct kvm_sregs, GFP_KERNEL); r = -ENOMEM; if (!kvm_sregs) goto out; @@ -4624,7 +4624,7 @@ out_free1: break; } case KVM_GET_FPU: { - fpu = kzalloc(sizeof(struct kvm_fpu), GFP_KERNEL); + fpu = kzalloc_obj(struct kvm_fpu, GFP_KERNEL); r = -ENOMEM; if (!fpu) goto out; @@ -4844,7 +4844,7 @@ static int kvm_ioctl_create_device(struct kvm *kvm, if (test) return 0; - dev = kzalloc(sizeof(*dev), GFP_KERNEL_ACCOUNT); + dev = kzalloc_obj(*dev, GFP_KERNEL_ACCOUNT); if (!dev) return -ENOMEM; @@ -6006,8 +6006,8 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, if (bus->dev_count - bus->ioeventfd_count > NR_IOBUS_DEVS - 1) return -ENOSPC; - new_bus = kmalloc(struct_size(bus, range, bus->dev_count + 1), - GFP_KERNEL_ACCOUNT); + new_bus = kmalloc_flex(*bus, range, bus->dev_count + 1, + GFP_KERNEL_ACCOUNT); if (!new_bus) return -ENOMEM; @@ -6053,8 +6053,8 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, if (i == bus->dev_count) return 0; - new_bus = kmalloc(struct_size(bus, range, bus->dev_count - 1), - GFP_KERNEL_ACCOUNT); + new_bus = kmalloc_flex(*bus, range, bus->dev_count - 1, + GFP_KERNEL_ACCOUNT); if (new_bus) { memcpy(new_bus, bus, struct_size(bus, range, i)); new_bus->dev_count--; @@ -6326,7 +6326,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm) active = kvm_active_vms; mutex_unlock(&kvm_lock); - env = kzalloc(sizeof(*env), GFP_KERNEL); + env = kzalloc_obj(*env, GFP_KERNEL); if (!env) return; diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c index be50514bbd11..9f9acb66cc1e 100644 --- a/virt/kvm/vfio.c +++ b/virt/kvm/vfio.c @@ -166,7 +166,7 @@ static int kvm_vfio_file_add(struct kvm_device *dev, unsigned int fd) } } - kvf = kzalloc(sizeof(*kvf), GFP_KERNEL_ACCOUNT); + kvf = kzalloc_obj(*kvf, GFP_KERNEL_ACCOUNT); if (!kvf) { ret = -ENOMEM; goto out_unlock; @@ -364,7 +364,7 @@ static int kvm_vfio_create(struct kvm_device *dev, u32 type) if (tmp->ops == &kvm_vfio_ops) return -EBUSY; - kv = kzalloc(sizeof(*kv), GFP_KERNEL_ACCOUNT); + kv = kzalloc_obj(*kv, GFP_KERNEL_ACCOUNT); if (!kv) return -ENOMEM; -- cgit v1.2.3 From bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 21 Feb 2026 16:37:42 -0800 Subject: Convert 'alloc_obj' family to use the new default GFP_KERNEL argument This was done entirely with mindless brute force, using git grep -l '\ --- arch/alpha/kernel/core_marvel.c | 4 +- arch/alpha/kernel/core_titan.c | 4 +- arch/alpha/kernel/module.c | 4 +- arch/alpha/kernel/pci.c | 2 +- arch/alpha/kernel/setup.c | 2 +- arch/arc/kernel/unwind.c | 2 +- arch/arc/net/bpf_jit_core.c | 2 +- arch/arm/common/locomo.c | 6 +- arch/arm/common/sa1111.c | 4 +- arch/arm/common/scoop.c | 2 +- arch/arm/kernel/smp.c | 2 +- arch/arm/kernel/sys_oabi-compat.c | 2 +- arch/arm/kernel/unwind.c | 2 +- arch/arm/kernel/vdso.c | 2 +- arch/arm/mach-footbridge/dc21285.c | 2 +- arch/arm/mach-footbridge/ebsa285.c | 2 +- arch/arm/mach-footbridge/netwinder-hw.c | 2 +- arch/arm/mach-imx/mmdc.c | 2 +- arch/arm/mach-mvebu/board-v7.c | 2 +- arch/arm/mach-mvebu/coherency.c | 2 +- arch/arm/mach-mvebu/mvebu-soc-id.c | 2 +- arch/arm/mach-mxs/mach-mxs.c | 2 +- arch/arm/mach-omap1/dma.c | 2 +- arch/arm/mach-omap1/timer.c | 2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 2 +- arch/arm/mach-omap2/id.c | 2 +- arch/arm/mach-omap2/omap-iommu.c | 2 +- arch/arm/mach-omap2/omap_device.c | 4 +- arch/arm/mach-omap2/omap_hwmod.c | 8 +- arch/arm/mach-omap2/pm33xx-core.c | 2 +- arch/arm/mach-omap2/sr_device.c | 2 +- arch/arm/mach-orion5x/pci.c | 4 +- arch/arm/mach-rpc/ecard.c | 2 +- arch/arm/mach-sa1100/clock.c | 4 +- arch/arm/mach-sa1100/generic.c | 2 +- arch/arm/mach-sa1100/neponset.c | 2 +- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 2 +- arch/arm/mach-versatile/spc.c | 6 +- arch/arm/mach-versatile/versatile.c | 2 +- arch/arm/mach-zynq/common.c | 2 +- arch/arm/mm/cache-l2x0-pmu.c | 2 +- arch/arm/mm/cache-uniphier.c | 2 +- arch/arm/mm/dma-mapping.c | 2 +- arch/arm/xen/enlighten.c | 4 +- arch/arm64/kvm/mmu.c | 4 +- arch/arm64/kvm/pmu-emul.c | 2 +- arch/arm64/kvm/vgic/vgic-debug.c | 4 +- arch/arm64/kvm/vgic/vgic-init.c | 2 +- arch/arm64/net/bpf_jit_comp.c | 4 +- arch/csky/kernel/vdso.c | 2 +- arch/loongarch/kvm/intc/eiointc.c | 2 +- arch/loongarch/kvm/intc/ipi.c | 2 +- arch/loongarch/kvm/intc/pch_pic.c | 4 +- arch/loongarch/kvm/main.c | 2 +- arch/loongarch/kvm/vcpu.c | 2 +- arch/loongarch/net/bpf_jit.c | 2 +- arch/loongarch/pci/acpi.c | 6 +- arch/m68k/amiga/chipram.c | 2 +- arch/m68k/atari/stram.c | 2 +- arch/m68k/emu/nfblock.c | 2 +- arch/m68k/mm/kmap.c | 2 +- arch/mips/alchemy/common/clock.c | 8 +- arch/mips/alchemy/common/dbdma.c | 2 +- arch/mips/alchemy/common/platform.c | 4 +- arch/mips/alchemy/devboards/platform.c | 8 +- arch/mips/bcm47xx/setup.c | 2 +- arch/mips/cavium-octeon/octeon-irq.c | 10 +- arch/mips/kernel/module.c | 2 +- arch/mips/kernel/smp-cps.c | 2 +- arch/mips/kernel/vpe.c | 6 +- arch/mips/lantiq/falcon/sysctrl.c | 2 +- arch/mips/lantiq/xway/gptu.c | 2 +- arch/mips/lantiq/xway/sysctrl.c | 10 +- arch/mips/pci/pci-alchemy.c | 2 +- arch/mips/pci/pci-xtalk-bridge.c | 2 +- arch/mips/ralink/mt7620.c | 2 +- arch/mips/ralink/mt7621.c | 2 +- arch/mips/ralink/rt288x.c | 2 +- arch/mips/ralink/rt305x.c | 2 +- arch/mips/ralink/rt3883.c | 2 +- arch/mips/sgi-ip22/ip22-gio.c | 2 +- arch/mips/sgi-ip27/ip27-irq.c | 2 +- arch/mips/sgi-ip27/ip27-xtalk.c | 4 +- arch/mips/sgi-ip30/ip30-irq.c | 2 +- arch/mips/sgi-ip30/ip30-xtalk.c | 4 +- arch/mips/txx9/generic/pci.c | 2 +- arch/mips/txx9/generic/setup.c | 4 +- arch/nios2/platform/platform.c | 2 +- arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/inventory.c | 4 +- arch/parisc/kernel/processor.c | 2 +- arch/parisc/kernel/vdso.c | 2 +- arch/parisc/net/bpf_jit_core.c | 4 +- arch/powerpc/kernel/cacheinfo.c | 6 +- arch/powerpc/kernel/nvram_64.c | 4 +- arch/powerpc/kernel/pci-common.c | 8 +- arch/powerpc/kernel/pci_dn.c | 6 +- arch/powerpc/kernel/secvar-sysfs.c | 2 +- arch/powerpc/kernel/smp-tbsync.c | 2 +- arch/powerpc/kernel/smp.c | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +- arch/powerpc/kvm/book3s_64_mmu_radix.c | 2 +- arch/powerpc/kvm/book3s_64_vio.c | 2 +- arch/powerpc/kvm/book3s_hv.c | 8 +- arch/powerpc/kvm/book3s_hv_nested.c | 4 +- arch/powerpc/kvm/book3s_hv_uvmem.c | 4 +- arch/powerpc/kvm/book3s_rtas.c | 2 +- arch/powerpc/kvm/book3s_xics.c | 6 +- arch/powerpc/kvm/book3s_xive.c | 6 +- arch/powerpc/kvm/book3s_xive_native.c | 2 +- arch/powerpc/kvm/e500.c | 2 +- arch/powerpc/kvm/e500_mmu.c | 6 +- arch/powerpc/kvm/mpic.c | 4 +- arch/powerpc/mm/book3s64/iommu_api.c | 2 +- arch/powerpc/mm/book3s64/subpage_prot.c | 2 +- arch/powerpc/mm/drmem.c | 6 +- arch/powerpc/mm/mem.c | 2 +- arch/powerpc/net/bpf_jit_comp.c | 2 +- arch/powerpc/perf/hv-24x7.c | 8 +- arch/powerpc/perf/hv-gpci.c | 2 +- arch/powerpc/perf/imc-pmu.c | 8 +- arch/powerpc/perf/vpa-dtl.c | 2 +- arch/powerpc/platforms/44x/hsta_msi.c | 2 +- arch/powerpc/platforms/44x/pci.c | 2 +- arch/powerpc/platforms/44x/uic.c | 2 +- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 2 +- arch/powerpc/platforms/book3s/vas-api.c | 2 +- arch/powerpc/platforms/cell/spu_base.c | 2 +- arch/powerpc/platforms/cell/spufs/context.c | 2 +- arch/powerpc/platforms/cell/spufs/file.c | 2 +- arch/powerpc/platforms/cell/spufs/gang.c | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 4 +- arch/powerpc/platforms/cell/spufs/sched.c | 2 +- arch/powerpc/platforms/pasemi/gpio_mdio.c | 2 +- arch/powerpc/platforms/powermac/low_i2c.c | 6 +- arch/powerpc/platforms/powermac/pfunc_core.c | 4 +- arch/powerpc/platforms/powernv/ocxl.c | 4 +- arch/powerpc/platforms/powernv/opal-core.c | 4 +- arch/powerpc/platforms/powernv/opal-dump.c | 2 +- arch/powerpc/platforms/powernv/opal-elog.c | 2 +- arch/powerpc/platforms/powernv/opal-imc.c | 2 +- arch/powerpc/platforms/powernv/opal-irqchip.c | 2 +- arch/powerpc/platforms/powernv/opal-lpc.c | 2 +- arch/powerpc/platforms/powernv/opal-powercap.c | 2 +- .../powerpc/platforms/powernv/opal-sensor-groups.c | 2 +- arch/powerpc/platforms/powernv/opal-sysparam.c | 2 +- arch/powerpc/platforms/powernv/opal-xscom.c | 2 +- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- arch/powerpc/platforms/powernv/pci-sriov.c | 2 +- arch/powerpc/platforms/powernv/rng.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 2 +- arch/powerpc/platforms/powernv/vas.c | 2 +- arch/powerpc/platforms/ps3/device-init.c | 16 ++-- arch/powerpc/platforms/ps3/spu.c | 2 +- arch/powerpc/platforms/pseries/dlpar.c | 4 +- arch/powerpc/platforms/pseries/hotplug-memory.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 14 +-- arch/powerpc/platforms/pseries/lparcfg.c | 2 +- arch/powerpc/platforms/pseries/mobility.c | 2 +- arch/powerpc/platforms/pseries/msi.c | 2 +- arch/powerpc/platforms/pseries/papr-sysparm.c | 2 +- .../platforms/pseries/papr_platform_attributes.c | 2 +- arch/powerpc/platforms/pseries/papr_scm.c | 4 +- arch/powerpc/platforms/pseries/pci.c | 2 +- arch/powerpc/platforms/pseries/reconfig.c | 4 +- arch/powerpc/platforms/pseries/vas-sysfs.c | 2 +- arch/powerpc/platforms/pseries/vas.c | 4 +- arch/powerpc/platforms/pseries/vio.c | 6 +- arch/powerpc/sysdev/ehv_pic.c | 2 +- arch/powerpc/sysdev/fsl_gtm.c | 2 +- arch/powerpc/sysdev/fsl_lbc.c | 4 +- arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c | 2 +- arch/powerpc/sysdev/fsl_msi.c | 4 +- arch/powerpc/sysdev/fsl_pci.c | 2 +- arch/powerpc/sysdev/fsl_rio.c | 10 +- arch/powerpc/sysdev/fsl_rmu.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 4 +- arch/powerpc/sysdev/mpic_msgr.c | 2 +- arch/powerpc/sysdev/mpic_timer.c | 2 +- arch/powerpc/sysdev/of_rtc.c | 2 +- arch/powerpc/sysdev/xics/ics-native.c | 2 +- arch/powerpc/sysdev/xive/common.c | 2 +- arch/powerpc/sysdev/xive/spapr.c | 2 +- arch/riscv/kernel/hibernate.c | 2 +- arch/riscv/kernel/module.c | 6 +- arch/riscv/kernel/tests/kprobes/test-kprobes.c | 2 +- arch/riscv/kernel/unaligned_access_speed.c | 2 +- arch/riscv/kvm/aia_aplic.c | 4 +- arch/riscv/kvm/aia_imsic.c | 2 +- arch/riscv/kvm/vm.c | 2 +- arch/riscv/net/bpf_jit_comp64.c | 2 +- arch/riscv/net/bpf_jit_core.c | 4 +- arch/s390/appldata/appldata_base.c | 4 +- arch/s390/appldata/appldata_mem.c | 2 +- arch/s390/appldata/appldata_net_sum.c | 2 +- arch/s390/hypfs/hypfs_dbfs.c | 2 +- arch/s390/hypfs/hypfs_diag0c.c | 2 +- arch/s390/hypfs/hypfs_sprp.c | 2 +- arch/s390/hypfs/inode.c | 2 +- arch/s390/include/asm/idals.h | 2 +- arch/s390/kernel/cert_store.c | 2 +- arch/s390/kernel/debug.c | 10 +- arch/s390/kernel/guarded_storage.c | 4 +- arch/s390/kernel/os_info.c | 2 +- arch/s390/kernel/perf_cpum_cf.c | 4 +- arch/s390/kernel/perf_cpum_cf_events.c | 2 +- arch/s390/kernel/perf_cpum_sf.c | 2 +- arch/s390/kernel/perf_pai.c | 6 +- arch/s390/kernel/ptrace.c | 6 +- arch/s390/kernel/runtime_instr.c | 2 +- arch/s390/kernel/smp.c | 2 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/kvm/pci.c | 6 +- arch/s390/kvm/pv.c | 2 +- arch/s390/mm/extmem.c | 2 +- arch/s390/net/bpf_jit_comp.c | 2 +- arch/s390/pci/pci.c | 4 +- arch/s390/pci/pci_bus.c | 2 +- arch/s390/pci/pci_irq.c | 4 +- arch/sh/drivers/dma/dmabrg.c | 2 +- arch/sh/drivers/heartbeat.c | 2 +- arch/sh/drivers/push-switch.c | 2 +- arch/sh/kernel/cpu/sh4/sq.c | 2 +- arch/sh/kernel/dwarf.c | 4 +- arch/sparc/kernel/central.c | 4 +- arch/sparc/kernel/chmc.c | 4 +- arch/sparc/kernel/ds.c | 2 +- arch/sparc/kernel/ioport.c | 2 +- arch/sparc/kernel/ldc.c | 2 +- arch/sparc/kernel/leon_pci_grpci2.c | 2 +- arch/sparc/kernel/of_device_32.c | 2 +- arch/sparc/kernel/of_device_64.c | 2 +- arch/sparc/kernel/pci.c | 2 +- arch/sparc/kernel/pci_common.c | 2 +- arch/sparc/kernel/pci_fire.c | 4 +- arch/sparc/kernel/pci_psycho.c | 4 +- arch/sparc/kernel/pci_sabre.c | 4 +- arch/sparc/kernel/pci_schizo.c | 4 +- arch/sparc/kernel/pci_sun4v.c | 8 +- arch/sparc/kernel/setup_32.c | 2 +- arch/sparc/kernel/starfire.c | 2 +- arch/sparc/kernel/vio.c | 2 +- arch/sparc/mm/init_64.c | 2 +- arch/sparc/mm/iommu.c | 2 +- arch/sparc/net/bpf_jit_comp_64.c | 2 +- arch/sparc/vdso/vma.c | 4 +- arch/um/drivers/hostaudio_kern.c | 4 +- arch/um/drivers/line.c | 2 +- arch/um/drivers/port_kern.c | 4 +- arch/um/drivers/vector_kern.c | 4 +- arch/um/drivers/vector_transports.c | 4 +- arch/um/drivers/vfio_kern.c | 4 +- arch/um/drivers/virtio_pcidev.c | 2 +- arch/um/drivers/virtio_uml.c | 4 +- arch/um/drivers/xterm_kern.c | 2 +- arch/x86/coco/sev/core.c | 6 +- arch/x86/events/amd/iommu.c | 4 +- arch/x86/events/amd/uncore.c | 4 +- arch/x86/events/core.c | 2 +- arch/x86/events/intel/uncore.c | 4 +- arch/x86/events/intel/uncore_discovery.c | 6 +- arch/x86/events/intel/uncore_snbep.c | 10 +- arch/x86/events/rapl.c | 2 +- arch/x86/hyperv/ivm.c | 4 +- arch/x86/kernel/alternative.c | 2 +- arch/x86/kernel/amd_node.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apm_32.c | 2 +- arch/x86/kernel/cpu/amd_cache_disable.c | 2 +- arch/x86/kernel/cpu/mce/amd.c | 6 +- arch/x86/kernel/cpu/mce/core.c | 2 +- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/legacy.c | 2 +- arch/x86/kernel/cpu/sgx/driver.c | 2 +- arch/x86/kernel/cpu/sgx/encl.c | 4 +- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- arch/x86/kernel/cpu/sgx/virt.c | 2 +- arch/x86/kernel/hpet.c | 4 +- arch/x86/kernel/ioport.c | 2 +- arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kexec-bzimage64.c | 2 +- arch/x86/kernel/ksysfs.c | 2 +- arch/x86/kernel/uprobes.c | 2 +- arch/x86/kernel/vm86_32.c | 2 +- arch/x86/kvm/svm/nested.c | 2 +- arch/x86/kvm/vmx/tdx.c | 2 +- arch/x86/kvm/x86.c | 8 +- arch/x86/kvm/xen.c | 6 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/pat/memtype.c | 4 +- arch/x86/net/bpf_jit_comp.c | 4 +- arch/x86/net/bpf_jit_comp32.c | 2 +- arch/x86/pci/acpi.c | 2 +- arch/x86/pci/bus_numa.c | 4 +- arch/x86/pci/common.c | 2 +- arch/x86/pci/fixup.c | 2 +- arch/x86/pci/i386.c | 2 +- arch/x86/pci/mmconfig-shared.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/platform/efi/runtime-map.c | 4 +- arch/x86/platform/geode/geode-common.c | 4 +- arch/x86/power/cpu.c | 2 +- arch/x86/virt/svm/sev.c | 2 +- arch/x86/virt/vmx/tdx/tdx.c | 2 +- arch/x86/xen/grant-table.c | 2 +- arch/x86/xen/smp_pv.c | 2 +- arch/xtensa/kernel/ptrace.c | 4 +- arch/xtensa/platforms/iss/simdisk.c | 2 +- block/bio-integrity.c | 2 +- block/bio.c | 2 +- block/blk-cgroup.c | 2 +- block/blk-crypto-profile.c | 2 +- block/blk-crypto-sysfs.c | 2 +- block/blk-iocost.c | 2 +- block/blk-iolatency.c | 2 +- block/blk-mq-sched.c | 2 +- block/blk-mq.c | 4 +- block/blk-stat.c | 6 +- block/blk-wbt.c | 2 +- block/bsg-lib.c | 2 +- block/bsg.c | 2 +- block/disk-events.c | 2 +- block/fops.c | 2 +- block/genhd.c | 4 +- block/holder.c | 2 +- block/partitions/aix.c | 2 +- block/partitions/cmdline.c | 4 +- block/partitions/core.c | 2 +- block/partitions/efi.c | 2 +- block/partitions/ibm.c | 6 +- block/partitions/ldm.c | 10 +- block/sed-opal.c | 4 +- certs/blacklist.c | 2 +- certs/system_keyring.c | 2 +- crypto/af_alg.c | 2 +- crypto/algboss.c | 4 +- crypto/algif_rng.c | 2 +- crypto/api.c | 2 +- crypto/asymmetric_keys/asymmetric_type.c | 2 +- crypto/asymmetric_keys/pkcs7_parser.c | 12 +-- crypto/asymmetric_keys/pkcs8_parser.c | 2 +- crypto/asymmetric_keys/x509_cert_parser.c | 8 +- crypto/asymmetric_keys/x509_public_key.c | 2 +- crypto/drbg.c | 4 +- crypto/ecc.c | 2 +- crypto/gcm.c | 2 +- crypto/simd.c | 4 +- crypto/tcrypt.c | 12 +-- crypto/testmgr.c | 10 +- drivers/accel/amdxdna/aie2_ctx.c | 4 +- drivers/accel/amdxdna/aie2_pci.c | 6 +- drivers/accel/amdxdna/aie2_solver.c | 2 +- drivers/accel/amdxdna/amdxdna_ctx.c | 4 +- drivers/accel/amdxdna/amdxdna_gem.c | 4 +- drivers/accel/amdxdna/amdxdna_mailbox.c | 2 +- drivers/accel/amdxdna/amdxdna_pci_drv.c | 2 +- drivers/accel/amdxdna/amdxdna_ubuf.c | 8 +- drivers/accel/ethosu/ethosu_gem.c | 2 +- drivers/accel/ethosu/ethosu_job.c | 6 +- drivers/accel/habanalabs/common/command_buffer.c | 2 +- .../accel/habanalabs/common/command_submission.c | 14 +-- drivers/accel/habanalabs/common/context.c | 2 +- drivers/accel/habanalabs/common/decoder.c | 2 +- drivers/accel/habanalabs/common/device.c | 8 +- drivers/accel/habanalabs/common/firmware_if.c | 2 +- drivers/accel/habanalabs/common/habanalabs_drv.c | 4 +- drivers/accel/habanalabs/common/habanalabs_ioctl.c | 10 +- drivers/accel/habanalabs/common/hldio.c | 2 +- drivers/accel/habanalabs/common/hwmon.c | 2 +- drivers/accel/habanalabs/common/memory.c | 22 ++--- drivers/accel/habanalabs/common/mmu/mmu.c | 6 +- drivers/accel/habanalabs/common/state_dump.c | 2 +- drivers/accel/habanalabs/gaudi/gaudi.c | 6 +- drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +- drivers/accel/habanalabs/goya/goya.c | 6 +- drivers/accel/ivpu/ivpu_drv.c | 2 +- drivers/accel/ivpu/ivpu_gem_userptr.c | 4 +- drivers/accel/ivpu/ivpu_job.c | 4 +- drivers/accel/ivpu/ivpu_ms.c | 2 +- drivers/accel/qaic/qaic_control.c | 6 +- drivers/accel/qaic/qaic_data.c | 12 +-- drivers/accel/qaic/qaic_drv.c | 2 +- drivers/accel/qaic/qaic_ras.c | 2 +- drivers/accel/qaic/qaic_ssr.c | 8 +- drivers/accel/qaic/qaic_timesync.c | 8 +- drivers/accel/rocket/rocket_drv.c | 4 +- drivers/accel/rocket/rocket_gem.c | 2 +- drivers/accel/rocket/rocket_job.c | 8 +- drivers/accessibility/speakup/spk_ttyio.c | 2 +- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_apd.c | 2 +- drivers/acpi/acpi_configfs.c | 2 +- drivers/acpi/acpi_ipmi.c | 4 +- drivers/acpi/acpi_lpat.c | 4 +- drivers/acpi/acpi_memhotplug.c | 4 +- drivers/acpi/acpi_mrrm.c | 2 +- drivers/acpi/acpi_pcc.c | 2 +- drivers/acpi/acpi_platform.c | 2 +- drivers/acpi/acpi_processor.c | 2 +- drivers/acpi/acpi_video.c | 6 +- drivers/acpi/acpi_watchdog.c | 2 +- drivers/acpi/apei/apei-base.c | 4 +- drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/arm64/ffh.c | 2 +- drivers/acpi/arm64/iort.c | 6 +- drivers/acpi/button.c | 2 +- drivers/acpi/container.c | 2 +- drivers/acpi/cppc_acpi.c | 2 +- drivers/acpi/dock.c | 2 +- drivers/acpi/ec.c | 6 +- drivers/acpi/glue.c | 2 +- drivers/acpi/ioapic.c | 2 +- drivers/acpi/mipi-disco-img.c | 2 +- drivers/acpi/nfit/core.c | 4 +- drivers/acpi/numa/hmat.c | 8 +- drivers/acpi/nvs.c | 4 +- drivers/acpi/osl.c | 4 +- drivers/acpi/pci_irq.c | 2 +- drivers/acpi/pci_link.c | 2 +- drivers/acpi/pci_mcfg.c | 2 +- drivers/acpi/pci_root.c | 2 +- drivers/acpi/pci_slot.c | 2 +- drivers/acpi/power.c | 6 +- drivers/acpi/prmt.c | 2 +- drivers/acpi/processor_idle.c | 4 +- drivers/acpi/processor_pdc.c | 4 +- drivers/acpi/property.c | 4 +- drivers/acpi/riscv/irq.c | 2 +- drivers/acpi/sbs.c | 2 +- drivers/acpi/sbshc.c | 2 +- drivers/acpi/scan.c | 12 +-- drivers/acpi/sysfs.c | 12 +-- drivers/acpi/thermal.c | 2 +- drivers/acpi/utils.c | 2 +- drivers/acpi/viot.c | 4 +- drivers/acpi/wakeup.c | 2 +- drivers/acpi/x86/lpss.c | 2 +- drivers/amba/bus.c | 2 +- drivers/android/binder.c | 26 +++--- drivers/android/binder/rust_binderfs.c | 8 +- drivers/android/binder_alloc.c | 6 +- drivers/android/binderfs.c | 8 +- drivers/ata/libata-acpi.c | 4 +- drivers/ata/libata-core.c | 6 +- drivers/ata/libata-sata.c | 2 +- drivers/ata/libata-transport.c | 2 +- drivers/ata/libata-zpodd.c | 2 +- drivers/ata/pata_parport/pata_parport.c | 2 +- drivers/ata/sata_dwc_460ex.c | 2 +- drivers/ata/sata_fsl.c | 4 +- drivers/atm/adummy.c | 2 +- drivers/atm/atmtcp.c | 2 +- drivers/atm/eni.c | 4 +- drivers/atm/fore200e.c | 10 +- drivers/atm/he.c | 2 +- drivers/atm/idt77105.c | 2 +- drivers/atm/idt77252.c | 12 +-- drivers/atm/iphase.c | 6 +- drivers/atm/lanai.c | 4 +- drivers/atm/nicstar.c | 6 +- drivers/atm/solos-pci.c | 2 +- drivers/atm/suni.c | 2 +- drivers/auxdisplay/hd44780.c | 2 +- drivers/auxdisplay/line-display.c | 4 +- drivers/auxdisplay/panel.c | 2 +- drivers/base/arch_topology.c | 2 +- drivers/base/attribute_container.c | 2 +- drivers/base/auxiliary.c | 2 +- drivers/base/auxiliary_sysfs.c | 2 +- drivers/base/bus.c | 6 +- drivers/base/class.c | 6 +- drivers/base/component.c | 6 +- drivers/base/core.c | 14 +-- drivers/base/cpu.c | 2 +- drivers/base/faux.c | 4 +- drivers/base/firmware_loader/main.c | 2 +- drivers/base/firmware_loader/sysfs.c | 2 +- drivers/base/firmware_loader/sysfs_upload.c | 4 +- drivers/base/isa.c | 2 +- drivers/base/map.c | 6 +- drivers/base/memory.c | 4 +- drivers/base/node.c | 8 +- drivers/base/power/clock_ops.c | 4 +- drivers/base/power/common.c | 4 +- drivers/base/power/qos.c | 10 +- drivers/base/power/wakeirq.c | 4 +- drivers/base/power/wakeup.c | 2 +- drivers/base/power/wakeup_stats.c | 2 +- drivers/base/regmap/regcache.c | 2 +- drivers/base/regmap/regmap-debugfs.c | 4 +- drivers/base/regmap/regmap-irq.c | 2 +- drivers/base/regmap/regmap-kunit.c | 4 +- drivers/base/regmap/regmap-mmio.c | 2 +- drivers/base/regmap/regmap-ram.c | 4 +- drivers/base/regmap/regmap-raw-ram.c | 4 +- drivers/base/regmap/regmap-spi-avmm.c | 2 +- drivers/base/regmap/regmap-spi.c | 2 +- drivers/base/regmap/regmap.c | 8 +- drivers/base/soc.c | 4 +- drivers/base/swnode.c | 6 +- drivers/bcma/driver_pci_host.c | 2 +- drivers/bcma/host_pci.c | 2 +- drivers/bcma/scan.c | 2 +- drivers/block/aoe/aoecmd.c | 6 +- drivers/block/brd.c | 2 +- drivers/block/drbd/drbd_bitmap.c | 2 +- drivers/block/drbd/drbd_main.c | 10 +- drivers/block/drbd/drbd_nl.c | 12 +-- drivers/block/drbd/drbd_receiver.c | 6 +- drivers/block/loop.c | 2 +- drivers/block/nbd.c | 8 +- drivers/block/null_blk/main.c | 4 +- drivers/block/ps3disk.c | 2 +- drivers/block/ps3vram.c | 2 +- drivers/block/rbd.c | 8 +- drivers/block/rnbd/rnbd-clt-sysfs.c | 2 +- drivers/block/rnbd/rnbd-clt.c | 8 +- drivers/block/rnbd/rnbd-srv.c | 8 +- drivers/block/sunvdc.c | 2 +- drivers/block/swim.c | 2 +- drivers/block/virtio_blk.c | 8 +- drivers/block/xen-blkback/xenbus.c | 4 +- drivers/block/xen-blkfront.c | 2 +- drivers/block/zram/backend_deflate.c | 2 +- drivers/block/zram/backend_lz4.c | 6 +- drivers/block/zram/backend_lz4hc.c | 6 +- drivers/block/zram/backend_zstd.c | 4 +- drivers/block/zram/zcomp.c | 2 +- drivers/block/zram/zram_drv.c | 6 +- drivers/bluetooth/bpa10x.c | 2 +- drivers/bluetooth/btintel.c | 2 +- drivers/bluetooth/btintel_pcie.c | 4 +- drivers/bluetooth/btmrvl_debugfs.c | 2 +- drivers/bluetooth/btmrvl_main.c | 4 +- drivers/bluetooth/btmtk.c | 2 +- drivers/bluetooth/btrsi.c | 2 +- drivers/bluetooth/btrtl.c | 6 +- drivers/bluetooth/btusb.c | 4 +- drivers/bluetooth/hci_ag6xx.c | 2 +- drivers/bluetooth/hci_aml.c | 2 +- drivers/bluetooth/hci_ath.c | 2 +- drivers/bluetooth/hci_bcm.c | 2 +- drivers/bluetooth/hci_bcsp.c | 2 +- drivers/bluetooth/hci_h4.c | 2 +- drivers/bluetooth/hci_h5.c | 4 +- drivers/bluetooth/hci_intel.c | 2 +- drivers/bluetooth/hci_ldisc.c | 2 +- drivers/bluetooth/hci_ll.c | 2 +- drivers/bluetooth/hci_mrvl.c | 2 +- drivers/bluetooth/hci_qca.c | 2 +- drivers/bluetooth/hci_vhci.c | 2 +- drivers/bluetooth/virtio_bt.c | 2 +- drivers/bus/arm-cci.c | 2 +- drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +- drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +- drivers/bus/mhi/ep/main.c | 2 +- drivers/bus/mhi/host/boot.c | 6 +- drivers/bus/mhi/host/init.c | 6 +- drivers/bus/mips_cdmm.c | 2 +- drivers/bus/moxtet.c | 2 +- drivers/bus/omap_l3_smx.c | 2 +- drivers/bus/stm32_firewall.c | 2 +- drivers/bus/sunxi-rsb.c | 4 +- drivers/bus/ti-sysc.c | 8 +- drivers/cdrom/cdrom.c | 8 +- drivers/cdrom/gdrom.c | 14 +-- drivers/cdx/cdx.c | 4 +- drivers/cdx/controller/cdx_controller.c | 4 +- drivers/cdx/controller/mcdi.c | 6 +- drivers/char/agp/amd-k7-agp.c | 4 +- drivers/char/agp/ati-agp.c | 4 +- drivers/char/agp/backend.c | 2 +- drivers/char/agp/generic.c | 4 +- drivers/char/agp/isoch.c | 6 +- drivers/char/agp/sworks-agp.c | 2 +- drivers/char/apm-emulation.c | 2 +- drivers/char/bsr.c | 2 +- drivers/char/hw_random/amd-rng.c | 2 +- drivers/char/hw_random/geode-rng.c | 2 +- drivers/char/hw_random/intel-rng.c | 2 +- drivers/char/hw_random/virtio-rng.c | 2 +- drivers/char/ipmi/ipmi_devintf.c | 4 +- drivers/char/ipmi/ipmi_dmi.c | 2 +- drivers/char/ipmi/ipmi_msghandler.c | 10 +- drivers/char/ipmi/ipmi_si_intf.c | 2 +- drivers/char/ipmi/ipmi_ssif.c | 6 +- drivers/char/ipmi/kcs_bmc_serio.c | 2 +- drivers/char/powernv-op-panel.c | 2 +- drivers/char/ppdev.c | 2 +- drivers/char/ps3flash.c | 2 +- drivers/char/random.c | 2 +- drivers/char/tlclk.c | 2 +- drivers/char/tpm/tpm-chip.c | 2 +- drivers/char/tpm/tpm-dev.c | 2 +- drivers/char/tpm/tpm2-sessions.c | 2 +- drivers/char/tpm/tpm_crb_ffa.c | 2 +- drivers/char/tpm/tpm_ibmvtpm.c | 2 +- drivers/char/tpm/tpm_vtpm_proxy.c | 2 +- drivers/char/tpm/tpmrm-dev.c | 2 +- drivers/char/tpm/xen-tpmfront.c | 2 +- drivers/char/virtio_console.c | 10 +- drivers/char/xillybus/xillybus_class.c | 2 +- drivers/char/xillybus/xillybus_core.c | 2 +- drivers/char/xillybus/xillyusb.c | 10 +- drivers/clk/aspeed/clk-aspeed.c | 2 +- drivers/clk/aspeed/clk-ast2600.c | 2 +- drivers/clk/aspeed/clk-ast2700.c | 2 +- drivers/clk/at91/clk-audio-pll.c | 6 +- drivers/clk/at91/clk-generated.c | 2 +- drivers/clk/at91/clk-h32mx.c | 2 +- drivers/clk/at91/clk-i2s-mux.c | 2 +- drivers/clk/at91/clk-main.c | 8 +- drivers/clk/at91/clk-master.c | 4 +- drivers/clk/at91/clk-peripheral.c | 4 +- drivers/clk/at91/clk-pll.c | 2 +- drivers/clk/at91/clk-plldiv.c | 2 +- drivers/clk/at91/clk-programmable.c | 2 +- drivers/clk/at91/clk-sam9x60-pll.c | 4 +- drivers/clk/at91/clk-slow.c | 2 +- drivers/clk/at91/clk-smd.c | 2 +- drivers/clk/at91/clk-system.c | 2 +- drivers/clk/at91/clk-usb.c | 6 +- drivers/clk/at91/clk-utmi.c | 2 +- drivers/clk/at91/dt-compat.c | 6 +- drivers/clk/at91/sckc.c | 8 +- drivers/clk/axis/clk-artpec6.c | 2 +- drivers/clk/axs10x/pll_clock.c | 2 +- drivers/clk/baikal-t1/ccu-div.c | 8 +- drivers/clk/baikal-t1/ccu-pll.c | 6 +- drivers/clk/baikal-t1/ccu-rst.c | 2 +- drivers/clk/baikal-t1/clk-ccu-div.c | 4 +- drivers/clk/baikal-t1/clk-ccu-pll.c | 2 +- drivers/clk/bcm/clk-bcm2835.c | 2 +- drivers/clk/bcm/clk-bcm53573-ilp.c | 2 +- drivers/clk/bcm/clk-iproc-armpll.c | 2 +- drivers/clk/bcm/clk-iproc-asiu.c | 4 +- drivers/clk/bcm/clk-iproc-pll.c | 4 +- drivers/clk/berlin/berlin2-avpll.c | 4 +- drivers/clk/berlin/berlin2-div.c | 2 +- drivers/clk/berlin/berlin2-pll.c | 2 +- drivers/clk/clk-bm1880.c | 6 +- drivers/clk/clk-bulk.c | 2 +- drivers/clk/clk-composite.c | 2 +- drivers/clk/clk-divider.c | 2 +- drivers/clk/clk-eyeq.c | 2 +- drivers/clk/clk-fixed-factor.c | 2 +- drivers/clk/clk-fixed-rate.c | 2 +- drivers/clk/clk-fractional-divider.c | 2 +- drivers/clk/clk-gate.c | 2 +- drivers/clk/clk-gemini.c | 2 +- drivers/clk/clk-highbank.c | 2 +- drivers/clk/clk-hsdk-pll.c | 2 +- drivers/clk/clk-k210.c | 2 +- drivers/clk/clk-milbeaut.c | 4 +- drivers/clk/clk-mux.c | 2 +- drivers/clk/clk-nomadik.c | 4 +- drivers/clk/clk-npcm7xx.c | 2 +- drivers/clk/clk-qoriq.c | 8 +- drivers/clk/clk-stm32f4.c | 16 ++-- drivers/clk/clk-stm32h7.c | 12 +-- drivers/clk/clk-vt8500.c | 4 +- drivers/clk/clk-xgene.c | 6 +- drivers/clk/clk.c | 14 +-- drivers/clk/clkdev.c | 2 +- drivers/clk/davinci/pll.c | 24 ++--- drivers/clk/davinci/psc.c | 8 +- drivers/clk/hisilicon/clk-hi3620.c | 6 +- drivers/clk/hisilicon/clk-hix5hd2.c | 2 +- drivers/clk/hisilicon/clk.c | 4 +- drivers/clk/hisilicon/clkdivider-hi6220.c | 4 +- drivers/clk/hisilicon/clkgate-separated.c | 2 +- drivers/clk/imx/clk-busy.c | 4 +- drivers/clk/imx/clk-composite-7ulp.c | 6 +- drivers/clk/imx/clk-composite-8m.c | 6 +- drivers/clk/imx/clk-composite-93.c | 6 +- drivers/clk/imx/clk-cpu.c | 2 +- drivers/clk/imx/clk-divider-gate.c | 2 +- drivers/clk/imx/clk-fixup-div.c | 2 +- drivers/clk/imx/clk-fixup-mux.c | 2 +- drivers/clk/imx/clk-frac-pll.c | 2 +- drivers/clk/imx/clk-fracn-gppll.c | 2 +- drivers/clk/imx/clk-gate-93.c | 2 +- drivers/clk/imx/clk-gate-exclusive.c | 2 +- drivers/clk/imx/clk-gate2.c | 2 +- drivers/clk/imx/clk-gpr-mux.c | 2 +- drivers/clk/imx/clk-lpcg-scu.c | 2 +- drivers/clk/imx/clk-pfd.c | 2 +- drivers/clk/imx/clk-pfdv2.c | 2 +- drivers/clk/imx/clk-pll14xx.c | 2 +- drivers/clk/imx/clk-pllv1.c | 2 +- drivers/clk/imx/clk-pllv2.c | 2 +- drivers/clk/imx/clk-pllv3.c | 2 +- drivers/clk/imx/clk-pllv4.c | 2 +- drivers/clk/imx/clk-scu.c | 6 +- drivers/clk/imx/clk-sscg-pll.c | 2 +- drivers/clk/imx/clk.c | 2 +- drivers/clk/ingenic/cgu.c | 4 +- drivers/clk/ingenic/tcu.c | 4 +- drivers/clk/keystone/gate.c | 4 +- drivers/clk/keystone/pll.c | 4 +- drivers/clk/mediatek/clk-apmixed.c | 2 +- drivers/clk/mediatek/clk-cpumux.c | 2 +- drivers/clk/mediatek/clk-gate.c | 2 +- drivers/clk/mediatek/clk-mtk.c | 6 +- drivers/clk/mediatek/clk-mux.c | 2 +- drivers/clk/mediatek/clk-pll.c | 2 +- drivers/clk/mediatek/clk-pllfh.c | 2 +- drivers/clk/meson/meson8b.c | 2 +- drivers/clk/mmp/clk-apbc.c | 2 +- drivers/clk/mmp/clk-apmu.c | 2 +- drivers/clk/mmp/clk-frac.c | 2 +- drivers/clk/mmp/clk-gate.c | 2 +- drivers/clk/mmp/clk-mix.c | 2 +- drivers/clk/mmp/clk-of-mmp2.c | 4 +- drivers/clk/mmp/clk-of-pxa168.c | 4 +- drivers/clk/mmp/clk-of-pxa1928.c | 8 +- drivers/clk/mmp/clk-of-pxa910.c | 4 +- drivers/clk/mmp/clk-pll.c | 2 +- drivers/clk/mmp/clk.c | 2 +- drivers/clk/mmp/pwr-island.c | 2 +- drivers/clk/mmp/reset.c | 2 +- drivers/clk/mvebu/clk-corediv.c | 4 +- drivers/clk/mvebu/clk-cpu.c | 4 +- drivers/clk/mvebu/common.c | 4 +- drivers/clk/mvebu/cp110-system-controller.c | 2 +- drivers/clk/mvebu/kirkwood.c | 4 +- drivers/clk/mxs/clk-div.c | 2 +- drivers/clk/mxs/clk-frac.c | 2 +- drivers/clk/mxs/clk-pll.c | 2 +- drivers/clk/mxs/clk-ref.c | 2 +- drivers/clk/nxp/clk-lpc18xx-ccu.c | 4 +- drivers/clk/pistachio/clk-pll.c | 2 +- drivers/clk/pistachio/clk.c | 4 +- drivers/clk/pxa/clk-pxa.c | 2 +- drivers/clk/qcom/clk-rcg2.c | 2 +- drivers/clk/ralink/clk-mt7621.c | 2 +- drivers/clk/ralink/clk-mtmips.c | 2 +- drivers/clk/renesas/clk-mstp.c | 4 +- drivers/clk/renesas/clk-r8a73a4.c | 4 +- drivers/clk/renesas/clk-r8a7740.c | 4 +- drivers/clk/renesas/clk-r8a7778.c | 4 +- drivers/clk/renesas/clk-r8a7779.c | 4 +- drivers/clk/renesas/clk-rz.c | 4 +- drivers/clk/renesas/clk-sh73a0.c | 4 +- drivers/clk/renesas/r9a06g032-clocks.c | 8 +- drivers/clk/renesas/rcar-cpg-lib.c | 6 +- drivers/clk/renesas/rcar-gen2-cpg.c | 10 +- drivers/clk/renesas/rcar-gen3-cpg.c | 6 +- drivers/clk/renesas/rcar-gen4-cpg.c | 4 +- drivers/clk/renesas/renesas-cpg-mssr.c | 2 +- drivers/clk/rockchip/clk-cpu.c | 8 +- drivers/clk/rockchip/clk-ddr.c | 2 +- drivers/clk/rockchip/clk-gate-grf.c | 2 +- drivers/clk/rockchip/clk-half-divider.c | 6 +- drivers/clk/rockchip/clk-inverter.c | 2 +- drivers/clk/rockchip/clk-mmc-phase.c | 2 +- drivers/clk/rockchip/clk-muxgrf.c | 2 +- drivers/clk/rockchip/clk-pll.c | 2 +- drivers/clk/rockchip/clk-rk3576.c | 4 +- drivers/clk/rockchip/clk.c | 16 ++-- drivers/clk/rockchip/softrst.c | 2 +- drivers/clk/samsung/clk-cpu.c | 2 +- drivers/clk/samsung/clk-pll.c | 2 +- drivers/clk/samsung/clk.c | 6 +- drivers/clk/socfpga/clk-gate-a10.c | 2 +- drivers/clk/socfpga/clk-gate-s10.c | 6 +- drivers/clk/socfpga/clk-gate.c | 2 +- drivers/clk/socfpga/clk-periph-a10.c | 2 +- drivers/clk/socfpga/clk-periph-s10.c | 8 +- drivers/clk/socfpga/clk-periph.c | 2 +- drivers/clk/socfpga/clk-pll-a10.c | 2 +- drivers/clk/socfpga/clk-pll-s10.c | 8 +- drivers/clk/socfpga/clk-pll.c | 2 +- drivers/clk/spacemit/ccu_common.c | 2 +- drivers/clk/spear/clk-aux-synth.c | 2 +- drivers/clk/spear/clk-frac-synth.c | 2 +- drivers/clk/spear/clk-gpt-synth.c | 2 +- drivers/clk/spear/clk-vco-pll.c | 4 +- drivers/clk/sprd/pll.c | 2 +- drivers/clk/st/clk-flexgen.c | 6 +- drivers/clk/st/clkgen-fsyn.c | 10 +- drivers/clk/st/clkgen-pll.c | 8 +- drivers/clk/starfive/clk-starfive-jh7110-sys.c | 2 +- drivers/clk/stm32/reset-stm32.c | 2 +- drivers/clk/sunxi-ng/ccu_common.c | 2 +- drivers/clk/sunxi/clk-a10-hosc.c | 4 +- drivers/clk/sunxi/clk-a10-mod1.c | 4 +- drivers/clk/sunxi/clk-a10-pll2.c | 8 +- drivers/clk/sunxi/clk-a10-ve.c | 6 +- drivers/clk/sunxi/clk-a20-gmac.c | 4 +- drivers/clk/sunxi/clk-factors.c | 6 +- drivers/clk/sunxi/clk-mod0.c | 6 +- drivers/clk/sunxi/clk-simple-gates.c | 4 +- drivers/clk/sunxi/clk-sun4i-display.c | 8 +- drivers/clk/sunxi/clk-sun4i-pll3.c | 4 +- drivers/clk/sunxi/clk-sun4i-tcon-ch1.c | 2 +- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 4 +- drivers/clk/sunxi/clk-sun8i-mbus.c | 6 +- drivers/clk/sunxi/clk-sun9i-cpus.c | 4 +- drivers/clk/sunxi/clk-sunxi.c | 10 +- drivers/clk/sunxi/clk-usb.c | 6 +- drivers/clk/tegra/clk-audio-sync.c | 2 +- drivers/clk/tegra/clk-bpmp.c | 2 +- drivers/clk/tegra/clk-divider.c | 2 +- drivers/clk/tegra/clk-periph-fixed.c | 2 +- drivers/clk/tegra/clk-periph-gate.c | 2 +- drivers/clk/tegra/clk-pll-out.c | 2 +- drivers/clk/tegra/clk-pll.c | 2 +- drivers/clk/tegra/clk-sdmmc-mux.c | 2 +- drivers/clk/tegra/clk-super.c | 4 +- drivers/clk/tegra/clk-tegra-super-cclk.c | 2 +- drivers/clk/tegra/clk-tegra124-emc.c | 2 +- drivers/clk/tegra/clk-tegra20-emc.c | 2 +- drivers/clk/tegra/clk-tegra210-emc.c | 2 +- drivers/clk/tegra/clk-tegra210.c | 2 +- drivers/clk/tegra/clk.c | 2 +- drivers/clk/ti/apll.c | 12 +-- drivers/clk/ti/autoidle.c | 2 +- drivers/clk/ti/clk-dra7-atl.c | 2 +- drivers/clk/ti/clk.c | 6 +- drivers/clk/ti/clkctrl.c | 14 +-- drivers/clk/ti/composite.c | 4 +- drivers/clk/ti/divider.c | 8 +- drivers/clk/ti/dpll.c | 6 +- drivers/clk/ti/fapll.c | 8 +- drivers/clk/ti/gate.c | 4 +- drivers/clk/ti/interface.c | 2 +- drivers/clk/ti/mux.c | 6 +- drivers/clk/ux500/clk-prcc.c | 2 +- drivers/clk/ux500/clk-prcmu.c | 4 +- drivers/clk/ux500/u8500_of_clk.c | 2 +- drivers/clk/versatile/clk-icst.c | 2 +- drivers/clk/versatile/clk-sp810.c | 2 +- drivers/clk/visconti/pll.c | 2 +- drivers/clk/zynq/clkc.c | 6 +- drivers/clk/zynq/pll.c | 2 +- drivers/clk/zynqmp/clk-gate-zynqmp.c | 2 +- drivers/clk/zynqmp/clk-mux-zynqmp.c | 2 +- drivers/clk/zynqmp/clkc.c | 2 +- drivers/clk/zynqmp/divider.c | 2 +- drivers/clk/zynqmp/pll.c | 2 +- drivers/clocksource/bcm2835_timer.c | 2 +- drivers/clocksource/clps711x-timer.c | 2 +- drivers/clocksource/dw_apb_timer.c | 2 +- drivers/clocksource/ingenic-sysost.c | 4 +- drivers/clocksource/mmio.c | 2 +- drivers/clocksource/mps2-timer.c | 2 +- drivers/clocksource/renesas-ostm.c | 2 +- drivers/clocksource/sh_cmt.c | 2 +- drivers/clocksource/sh_mtu2.c | 2 +- drivers/clocksource/sh_tmu.c | 2 +- drivers/clocksource/timer-atmel-pit.c | 2 +- drivers/clocksource/timer-cadence-ttc.c | 4 +- drivers/clocksource/timer-davinci.c | 2 +- drivers/clocksource/timer-ep93xx.c | 2 +- drivers/clocksource/timer-fsl-ftm.c | 2 +- drivers/clocksource/timer-fttmr010.c | 2 +- drivers/clocksource/timer-goldfish.c | 2 +- drivers/clocksource/timer-gxp.c | 2 +- drivers/clocksource/timer-imx-gpt.c | 2 +- drivers/clocksource/timer-imx-sysctr.c | 2 +- drivers/clocksource/timer-ixp4xx.c | 2 +- drivers/clocksource/timer-microchip-pit64b.c | 4 +- drivers/clocksource/timer-msc313e.c | 2 +- drivers/clocksource/timer-nxp-pit.c | 2 +- drivers/clocksource/timer-rockchip.c | 4 +- drivers/clocksource/timer-stm32.c | 4 +- drivers/clocksource/timer-ti-dm-systimer.c | 4 +- drivers/clocksource/timer-zevio.c | 2 +- drivers/comedi/comedi_buf.c | 2 +- drivers/comedi/comedi_fops.c | 8 +- drivers/comedi/drivers.c | 4 +- drivers/comedi/drivers/addi_apci_2032.c | 2 +- drivers/comedi/drivers/comedi_8254.c | 2 +- drivers/comedi/drivers/comedi_bond.c | 2 +- drivers/comedi/drivers/comedi_isadma.c | 4 +- drivers/comedi/drivers/dt9812.c | 4 +- drivers/comedi/drivers/mite.c | 4 +- drivers/comedi/drivers/ni_tio.c | 4 +- drivers/comedi/drivers/usbduxsigma.c | 4 +- drivers/connector/cn_queue.c | 4 +- drivers/counter/counter-chrdev.c | 4 +- drivers/cpufreq/acpi-cpufreq.c | 2 +- drivers/cpufreq/amd-pstate.c | 4 +- drivers/cpufreq/apple-soc-cpufreq.c | 2 +- drivers/cpufreq/armada-8k-cpufreq.c | 2 +- drivers/cpufreq/bmips-cpufreq.c | 2 +- drivers/cpufreq/cppc_cpufreq.c | 2 +- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/cpufreq_conservative.c | 4 +- drivers/cpufreq/cpufreq_governor.c | 2 +- drivers/cpufreq/cpufreq_ondemand.c | 4 +- drivers/cpufreq/cpufreq_stats.c | 2 +- drivers/cpufreq/cpufreq_userspace.c | 2 +- drivers/cpufreq/e_powersaver.c | 2 +- drivers/cpufreq/gx-suspmod.c | 2 +- drivers/cpufreq/intel_pstate.c | 4 +- drivers/cpufreq/powernow-k7.c | 2 +- drivers/cpufreq/powernow-k8.c | 2 +- drivers/cpufreq/powernv-cpufreq.c | 8 +- drivers/cpufreq/pxa3xx-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- drivers/cpufreq/qoriq-cpufreq.c | 6 +- drivers/cpufreq/scmi-cpufreq.c | 2 +- drivers/cpufreq/scpi-cpufreq.c | 2 +- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 2 +- drivers/cpufreq/tegra186-cpufreq.c | 2 +- drivers/cpufreq/tegra194-cpufreq.c | 2 +- drivers/cpufreq/vexpress-spc-cpufreq.c | 2 +- drivers/cpufreq/virtual-cpufreq.c | 2 +- drivers/cpuidle/coupled.c | 2 +- drivers/cpuidle/cpuidle-psci-domain.c | 2 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_genpd.c | 2 +- drivers/cpuidle/sysfs.c | 6 +- drivers/crypto/amcc/crypto4xx_core.c | 2 +- drivers/crypto/amcc/crypto4xx_trng.c | 2 +- drivers/crypto/atmel-ecc.c | 2 +- drivers/crypto/atmel-i2c.c | 2 +- drivers/crypto/atmel-sha.c | 2 +- drivers/crypto/caam/caamalg_qi2.c | 6 +- drivers/crypto/caam/caamhash.c | 2 +- drivers/crypto/caam/qi.c | 2 +- drivers/crypto/cavium/cpt/cptvf_main.c | 6 +- drivers/crypto/cavium/nitrox/nitrox_isr.c | 4 +- drivers/crypto/cavium/nitrox/nitrox_lib.c | 2 +- drivers/crypto/cavium/nitrox/nitrox_main.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-galois.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes.c | 2 +- drivers/crypto/ccp/ccp-crypto-des3.c | 2 +- drivers/crypto/ccp/ccp-crypto-rsa.c | 2 +- drivers/crypto/ccp/ccp-crypto-sha.c | 4 +- drivers/crypto/ccp/ccp-ops.c | 2 +- drivers/crypto/ccp/hsti.c | 2 +- drivers/crypto/ccp/sev-dev-tio.c | 2 +- drivers/crypto/ccp/sev-dev-tsm.c | 4 +- drivers/crypto/ccp/sev-dev.c | 4 +- drivers/crypto/ccp/sfs.c | 2 +- drivers/crypto/ccp/tee-dev.c | 2 +- drivers/crypto/ccree/cc_request_mgr.c | 2 +- drivers/crypto/chelsio/chcr_core.c | 2 +- drivers/crypto/hifn_795x.c | 2 +- drivers/crypto/hisilicon/debugfs.c | 2 +- drivers/crypto/hisilicon/qm.c | 6 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 4 +- drivers/crypto/hisilicon/sec2/sec_main.c | 2 +- drivers/crypto/hisilicon/sgl.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-aead.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-cipher.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-common.c | 2 +- drivers/crypto/inside-secure/safexcel.c | 2 +- drivers/crypto/inside-secure/safexcel_hash.c | 2 +- drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 +- drivers/crypto/intel/keembay/ocs-hcu.c | 2 +- .../crypto/intel/qat/qat_common/adf_accel_engine.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_aer.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_cfg.c | 6 +- drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c | 4 +- .../crypto/intel/qat/qat_common/adf_gen4_vf_mig.c | 2 +- .../crypto/intel/qat/qat_common/adf_heartbeat.c | 2 +- .../crypto/intel/qat/qat_common/adf_mstate_mgr.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_rl.c | 4 +- drivers/crypto/intel/qat/qat_common/adf_timer.c | 2 +- .../intel/qat/qat_common/adf_transport_debug.c | 2 +- drivers/crypto/intel/qat/qat_common/qat_hal.c | 6 +- drivers/crypto/intel/qat/qat_common/qat_mig_dev.c | 2 +- drivers/crypto/intel/qat/qat_common/qat_uclo.c | 18 ++-- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 4 +- drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 6 +- .../crypto/marvell/octeontx2/otx2_cptpf_ucode.c | 2 +- drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 2 +- drivers/crypto/nx/nx-842.c | 2 +- drivers/crypto/nx/nx-common-powernv.c | 4 +- drivers/crypto/nx/nx-common-pseries.c | 6 +- drivers/crypto/omap-crypto.c | 2 +- drivers/crypto/omap-sham.c | 2 +- drivers/crypto/qce/aead.c | 2 +- drivers/crypto/qce/sha.c | 2 +- drivers/crypto/qce/skcipher.c | 2 +- drivers/crypto/s5p-sss.c | 2 +- drivers/crypto/tegra/tegra-se-main.c | 6 +- .../crypto/virtio/virtio_crypto_akcipher_algs.c | 4 +- drivers/crypto/virtio/virtio_crypto_core.c | 4 +- .../crypto/virtio/virtio_crypto_skcipher_algs.c | 4 +- drivers/cxl/acpi.c | 4 +- drivers/cxl/core/cdat.c | 18 ++-- drivers/cxl/core/edac.c | 2 +- drivers/cxl/core/features.c | 2 +- drivers/cxl/core/memdev.c | 2 +- drivers/cxl/core/pmem.c | 4 +- drivers/cxl/core/pmu.c | 2 +- drivers/cxl/core/port.c | 10 +- drivers/cxl/core/region.c | 8 +- drivers/cxl/pmem.c | 2 +- drivers/dax/bus.c | 8 +- drivers/devfreq/devfreq-event.c | 2 +- drivers/devfreq/devfreq.c | 2 +- drivers/devfreq/governor_passive.c | 2 +- drivers/dibs/dibs_loopback.c | 4 +- drivers/dibs/dibs_main.c | 2 +- drivers/dio/dio.c | 2 +- drivers/dma-buf/dma-buf-mapping.c | 4 +- drivers/dma-buf/dma-buf.c | 4 +- drivers/dma-buf/dma-fence-unwrap.c | 2 +- drivers/dma-buf/dma-fence.c | 4 +- drivers/dma-buf/dma-heap.c | 2 +- drivers/dma-buf/heaps/cma_heap.c | 8 +- drivers/dma-buf/heaps/system_heap.c | 4 +- drivers/dma-buf/st-dma-fence-chain.c | 2 +- drivers/dma-buf/st-dma-fence-unwrap.c | 4 +- drivers/dma-buf/st-dma-resv.c | 2 +- drivers/dma-buf/sw_sync.c | 4 +- drivers/dma-buf/sync_file.c | 2 +- drivers/dma-buf/udmabuf.c | 8 +- drivers/dma/acpi-dma.c | 2 +- drivers/dma/amba-pl08x.c | 6 +- drivers/dma/at_hdmac.c | 2 +- drivers/dma/bestcomm/bestcomm.c | 2 +- drivers/dma/bestcomm/sram.c | 2 +- drivers/dma/dmaengine.c | 2 +- drivers/dma/dmatest.c | 8 +- drivers/dma/dw-edma/dw-edma-pcie.c | 2 +- drivers/dma/dw/rzn1-dmamux.c | 2 +- drivers/dma/ep93xx_dma.c | 2 +- drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 6 +- drivers/dma/fsl-qdma.c | 2 +- drivers/dma/fsl_raid.c | 2 +- drivers/dma/fsldma.c | 4 +- drivers/dma/idxd/cdev.c | 4 +- drivers/dma/idxd/irq.c | 2 +- drivers/dma/idxd/perfmon.c | 4 +- drivers/dma/imx-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/ioat/init.c | 4 +- drivers/dma/mpc512x_dma.c | 2 +- drivers/dma/mv_xor.c | 2 +- drivers/dma/of-dma.c | 4 +- drivers/dma/pch_dma.c | 2 +- drivers/dma/pl330.c | 4 +- drivers/dma/plx_dma.c | 4 +- drivers/dma/ppc4xx/adma.c | 8 +- drivers/dma/pxa_dma.c | 2 +- drivers/dma/sa11x0-dma.c | 4 +- drivers/dma/sh/rz-dmac.c | 2 +- drivers/dma/sh/shdma-base.c | 4 +- drivers/dma/stm32/stm32-dmamux.c | 2 +- drivers/dma/ti/dma-crossbar.c | 6 +- drivers/dma/ti/k3-udma.c | 6 +- drivers/dma/ti/omap-dma.c | 2 +- drivers/dma/timb_dma.c | 2 +- drivers/dpll/dpll_core.c | 14 +-- drivers/dpll/zl3073x/dpll.c | 4 +- drivers/dpll/zl3073x/fw.c | 4 +- drivers/dpll/zl3073x/prop.c | 4 +- drivers/edac/amd64_edac.c | 12 +-- drivers/edac/edac_device.c | 6 +- drivers/edac/edac_mc.c | 14 +-- drivers/edac/edac_mc_sysfs.c | 2 +- drivers/edac/edac_pci.c | 2 +- drivers/edac/edac_pci_sysfs.c | 2 +- drivers/edac/i7core_edac.c | 4 +- drivers/edac/igen6_edac.c | 2 +- drivers/edac/imh_base.c | 2 +- drivers/edac/sb_edac.c | 2 +- drivers/edac/versalnet_edac.c | 4 +- drivers/eisa/eisa-bus.c | 4 +- drivers/extcon/extcon.c | 2 +- drivers/firewire/core-cdev.c | 14 +-- drivers/firewire/core-device.c | 2 +- drivers/firewire/net.c | 2 +- drivers/firewire/nosy.c | 4 +- drivers/firewire/sbp2.c | 2 +- drivers/firmware/arm_ffa/bus.c | 2 +- drivers/firmware/arm_ffa/driver.c | 10 +- drivers/firmware/arm_scmi/bus.c | 6 +- drivers/firmware/arm_scmi/notify.c | 2 +- drivers/firmware/arm_scmi/raw_mode.c | 2 +- drivers/firmware/arm_scpi.c | 4 +- drivers/firmware/arm_sdei.c | 4 +- drivers/firmware/cirrus/cs_dsp.c | 4 +- drivers/firmware/dmi-id.c | 2 +- drivers/firmware/dmi-sysfs.c | 4 +- drivers/firmware/edd.c | 2 +- drivers/firmware/efi/arm-runtime.c | 2 +- drivers/firmware/efi/capsule-loader.c | 4 +- drivers/firmware/efi/capsule.c | 2 +- drivers/firmware/efi/efibc.c | 2 +- drivers/firmware/efi/embedded-firmware.c | 2 +- drivers/firmware/efi/esrt.c | 2 +- drivers/firmware/efi/mokvar-table.c | 2 +- drivers/firmware/efi/riscv-runtime.c | 2 +- drivers/firmware/google/gsmi.c | 2 +- drivers/firmware/google/vpd.c | 2 +- drivers/firmware/iscsi_ibft.c | 4 +- drivers/firmware/microchip/mpfs-auto-update.c | 8 +- drivers/firmware/psci/psci_checker.c | 4 +- drivers/firmware/qcom/qcom_qseecom.c | 2 +- drivers/firmware/qemu_fw_cfg.c | 8 +- drivers/firmware/raspberrypi.c | 2 +- drivers/firmware/smccc/soc_id.c | 2 +- drivers/firmware/stratix10-svc.c | 8 +- drivers/firmware/thead,th1520-aon.c | 2 +- drivers/fpga/dfl-afu-dma-region.c | 2 +- drivers/fpga/dfl-pci.c | 2 +- drivers/fpga/dfl.c | 2 +- drivers/fpga/fpga-bridge.c | 2 +- drivers/fpga/fpga-mgr.c | 4 +- drivers/fpga/fpga-region.c | 2 +- drivers/fsi/fsi-core.c | 4 +- drivers/fsi/fsi-master-aspeed.c | 2 +- drivers/fsi/fsi-master-ast-cf.c | 2 +- drivers/fsi/fsi-master-gpio.c | 2 +- drivers/fsi/fsi-master-hub.c | 2 +- drivers/fsi/fsi-master-i2cr.c | 2 +- drivers/fsi/fsi-occ.c | 2 +- drivers/fsi/fsi-sbefifo.c | 4 +- drivers/fsi/fsi-scom.c | 2 +- drivers/fwctl/mlx5/main.c | 2 +- drivers/fwctl/pds/main.c | 2 +- drivers/gnss/core.c | 2 +- drivers/gnss/usb.c | 2 +- drivers/gpib/cb7210/cb7210.c | 4 +- drivers/gpib/cec/cec_gpib.c | 2 +- drivers/gpib/common/gpib_os.c | 8 +- drivers/gpib/eastwood/fluke_gpib.c | 2 +- drivers/gpib/fmh_gpib/fmh_gpib.c | 2 +- drivers/gpib/gpio/gpib_bitbang.c | 2 +- drivers/gpib/hp_82335/hp82335.c | 2 +- drivers/gpib/hp_82341/hp_82341.c | 2 +- drivers/gpib/ines/ines_gpib.c | 4 +- drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 4 +- drivers/gpib/ni_usb/ni_usb_gpib.c | 4 +- drivers/gpib/pc2/pc2_gpib.c | 2 +- drivers/gpib/tnt4882/mite.c | 2 +- drivers/gpib/tnt4882/tnt4882_gpib.c | 4 +- drivers/gpio/gpio-aggregator.c | 2 +- drivers/gpio/gpio-reg.c | 2 +- drivers/gpio/gpio-regmap.c | 2 +- drivers/gpio/gpio-sim.c | 8 +- drivers/gpio/gpio-virtuser.c | 4 +- drivers/gpio/gpiolib-acpi-core.c | 6 +- drivers/gpio/gpiolib-cdev.c | 8 +- drivers/gpio/gpiolib-shared.c | 4 +- drivers/gpio/gpiolib-sysfs.c | 4 +- drivers/gpio/gpiolib.c | 6 +- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 4 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 4 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 10 +- drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 2 +- drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 2 +- drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 2 +- drivers/gpu/drm/amd/amdgpu/umc_v12_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 10 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 6 +- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 10 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 30 +++--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 16 ++-- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 10 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 4 +- drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c | 8 +- drivers/gpu/drm/amd/display/dc/basics/vector.c | 4 +- drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 4 +- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 22 ++--- drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_state.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 6 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c | 4 +- .../drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c | 2 +- .../gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c | 2 +- .../drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c | 10 +- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 8 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 +- .../drm/amd/display/dc/dce110/dce110_compressor.c | 2 +- .../drm/amd/display/dc/dce112/dce112_compressor.c | 2 +- .../dc/dio/virtual/virtual_stream_encoder.c | 2 +- .../drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 4 +- drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 +- .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../amd/display/dc/irq/dce110/irq_service_dce110.c | 2 +- .../amd/display/dc/irq/dce120/irq_service_dce120.c | 2 +- .../amd/display/dc/irq/dce60/irq_service_dce60.c | 2 +- .../amd/display/dc/irq/dce80/irq_service_dce80.c | 2 +- .../amd/display/dc/irq/dcn10/irq_service_dcn10.c | 2 +- .../amd/display/dc/irq/dcn20/irq_service_dcn20.c | 2 +- .../amd/display/dc/irq/dcn201/irq_service_dcn201.c | 2 +- .../amd/display/dc/irq/dcn21/irq_service_dcn21.c | 2 +- .../amd/display/dc/irq/dcn30/irq_service_dcn30.c | 2 +- .../amd/display/dc/irq/dcn302/irq_service_dcn302.c | 2 +- .../amd/display/dc/irq/dcn303/irq_service_dcn303.c | 2 +- .../amd/display/dc/irq/dcn31/irq_service_dcn31.c | 2 +- .../amd/display/dc/irq/dcn314/irq_service_dcn314.c | 2 +- .../amd/display/dc/irq/dcn315/irq_service_dcn315.c | 2 +- .../amd/display/dc/irq/dcn32/irq_service_dcn32.c | 2 +- .../amd/display/dc/irq/dcn35/irq_service_dcn35.c | 2 +- .../amd/display/dc/irq/dcn351/irq_service_dcn351.c | 2 +- .../amd/display/dc/irq/dcn36/irq_service_dcn36.c | 2 +- .../amd/display/dc/irq/dcn401/irq_service_dcn401.c | 2 +- drivers/gpu/drm/amd/display/dc/link/link_factory.c | 4 +- .../drm/amd/display/dc/link/protocols/link_ddc.c | 2 +- .../drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c | 2 +- .../display/dc/resource/dce100/dce100_resource.c | 24 ++--- .../display/dc/resource/dce110/dce110_resource.c | 28 +++--- .../display/dc/resource/dce112/dce112_resource.c | 24 ++--- .../display/dc/resource/dce120/dce120_resource.c | 26 +++--- .../amd/display/dc/resource/dce60/dce60_resource.c | 30 +++--- .../amd/display/dc/resource/dce80/dce80_resource.c | 30 +++--- .../amd/display/dc/resource/dcn10/dcn10_resource.c | 30 +++--- .../amd/display/dc/resource/dcn20/dcn20_resource.c | 32 +++---- .../display/dc/resource/dcn201/dcn201_resource.c | 26 +++--- .../amd/display/dc/resource/dcn21/dcn21_resource.c | 32 +++---- .../amd/display/dc/resource/dcn30/dcn30_resource.c | 32 +++---- .../display/dc/resource/dcn301/dcn301_resource.c | 32 +++---- .../display/dc/resource/dcn302/dcn302_resource.c | 20 ++-- .../display/dc/resource/dcn303/dcn303_resource.c | 20 ++-- .../amd/display/dc/resource/dcn31/dcn31_resource.c | 40 ++++---- .../display/dc/resource/dcn314/dcn314_resource.c | 40 ++++---- .../display/dc/resource/dcn315/dcn315_resource.c | 38 ++++---- .../display/dc/resource/dcn316/dcn316_resource.c | 38 ++++---- .../amd/display/dc/resource/dcn32/dcn32_resource.c | 36 ++++---- .../display/dc/resource/dcn321/dcn321_resource.c | 34 +++---- .../amd/display/dc/resource/dcn35/dcn35_resource.c | 38 ++++---- .../display/dc/resource/dcn351/dcn351_resource.c | 38 ++++---- .../amd/display/dc/resource/dcn36/dcn36_resource.c | 38 ++++---- .../display/dc/resource/dcn401/dcn401_resource.c | 36 ++++---- .../soc_and_ip_translator/soc_and_ip_translator.c | 2 +- .../drm/amd/display/modules/color/color_gamma.c | 8 +- .../drm/amd/display/modules/freesync/freesync.c | 2 +- drivers/gpu/drm/amd/display/modules/vmid/vmid.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 10 +- drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 4 +- drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 2 +- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 12 +-- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 2 +- .../amd/pm/powerplay/hwmgr/process_pptables_v1_0.c | 4 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 4 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c | 4 +- .../gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 4 +- .../pm/powerplay/hwmgr/vega10_processpptables.c | 2 +- .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 2 +- .../pm/powerplay/hwmgr/vega12_processpptables.c | 2 +- .../gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 2 +- .../pm/powerplay/hwmgr/vega20_processpptables.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 4 +- .../gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 4 +- .../drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c | 4 +- .../drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/vega12_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/vega20_smumgr.c | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 6 +- .../drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 6 +- .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 4 +- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 6 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 4 +- .../gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 4 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 6 +- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 2 +- .../gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 2 +- drivers/gpu/drm/amd/ras/rascore/ras_core.c | 4 +- drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c | 2 +- drivers/gpu/drm/amd/ras/rascore/ras_umc.c | 8 +- drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 4 +- .../drm/arm/display/komeda/komeda_framebuffer.c | 2 +- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 6 +- .../drm/arm/display/komeda/komeda_private_obj.c | 16 ++-- .../drm/arm/display/komeda/komeda_wb_connector.c | 2 +- drivers/gpu/drm/arm/malidp_crtc.c | 4 +- drivers/gpu/drm/arm/malidp_mw.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/armada/armada_crtc.c | 4 +- drivers/gpu/drm/armada/armada_fb.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/armada/armada_overlay.c | 4 +- drivers/gpu/drm/armada/armada_plane.c | 2 +- drivers/gpu/drm/ast/ast_dp.c | 2 +- drivers/gpu/drm/ast/ast_mode.c | 4 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 4 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +- drivers/gpu/drm/bridge/aux-bridge.c | 2 +- drivers/gpu/drm/bridge/aux-hpd-bridge.c | 2 +- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 +- .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 +- drivers/gpu/drm/bridge/display-connector.c | 4 +- drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 2 +- .../gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 2 +- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 2 +- drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 2 +- drivers/gpu/drm/bridge/ite-it6263.c | 2 +- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- drivers/gpu/drm/bridge/sil-sii8620.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/clients/drm_fbdev_client.c | 2 +- drivers/gpu/drm/clients/drm_log.c | 4 +- drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +- drivers/gpu/drm/display/drm_dp_aux_dev.c | 2 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 32 +++---- drivers/gpu/drm/display/drm_dp_tunnel.c | 14 +-- drivers/gpu/drm/display/drm_hdmi_cec_helper.c | 2 +- drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 6 +- drivers/gpu/drm/drm_atomic_state_helper.c | 14 +-- drivers/gpu/drm/drm_atomic_uapi.c | 2 +- drivers/gpu/drm/drm_auth.c | 2 +- drivers/gpu/drm/drm_blend.c | 2 +- drivers/gpu/drm/drm_bridge.c | 2 +- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_client_modeset.c | 12 +-- drivers/gpu/drm/drm_colorop.c | 4 +- drivers/gpu/drm/drm_connector.c | 2 +- drivers/gpu/drm/drm_crtc.c | 2 +- drivers/gpu/drm/drm_damage_helper.c | 2 +- drivers/gpu/drm/drm_debugfs_crc.c | 2 +- drivers/gpu/drm/drm_edid.c | 4 +- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_gem.c | 2 +- drivers/gpu/drm/drm_gem_atomic_helper.c | 2 +- drivers/gpu/drm/drm_gem_dma_helper.c | 4 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 2 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +- drivers/gpu/drm/drm_gpusvm.c | 6 +- drivers/gpu/drm/drm_gpuvm.c | 14 +-- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- drivers/gpu/drm/drm_modes.c | 2 +- drivers/gpu/drm/drm_pagemap.c | 4 +- drivers/gpu/drm/drm_pagemap_util.c | 6 +- drivers/gpu/drm/drm_plane.c | 2 +- drivers/gpu/drm/drm_prime.c | 8 +- drivers/gpu/drm/drm_privacy_screen.c | 2 +- drivers/gpu/drm/drm_property.c | 4 +- drivers/gpu/drm/drm_self_refresh_helper.c | 2 +- drivers/gpu/drm/drm_syncobj.c | 8 +- drivers/gpu/drm/drm_sysfs.c | 4 +- drivers/gpu/drm/drm_vblank.c | 4 +- drivers/gpu/drm/drm_vma_manager.c | 2 +- drivers/gpu/drm/drm_writeback.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_iommu.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_crt.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/intel_bios.c | 6 +- drivers/gpu/drm/gma500/intel_gmbus.c | 2 +- drivers/gpu/drm/gma500/intel_i2c.c | 2 +- drivers/gpu/drm/gma500/mid_bios.c | 2 +- drivers/gpu/drm/gma500/mmu.c | 6 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 6 +- drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 2 +- drivers/gpu/drm/gma500/oaktrail_lvds.c | 6 +- drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 4 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 +- drivers/gpu/drm/gud/gud_connector.c | 4 +- drivers/gpu/drm/gud/gud_drv.c | 6 +- drivers/gpu/drm/i915/display/dvo_ch7017.c | 2 +- drivers/gpu/drm/i915/display/dvo_ch7xxx.c | 2 +- drivers/gpu/drm/i915/display/dvo_ivch.c | 2 +- drivers/gpu/drm/i915/display/dvo_ns2501.c | 2 +- drivers/gpu/drm/i915/display/dvo_sil164.c | 2 +- drivers/gpu/drm/i915/display/dvo_tfp410.c | 2 +- drivers/gpu/drm/i915/display/icl_dsi.c | 2 +- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- drivers/gpu/drm/i915/display/intel_bios.c | 10 +- drivers/gpu/drm/i915/display/intel_bw.c | 2 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 2 +- drivers/gpu/drm/i915/display/intel_colorop.c | 2 +- drivers/gpu/drm/i915/display/intel_connector.c | 4 +- drivers/gpu/drm/i915/display/intel_crt.c | 2 +- drivers/gpu/drm/i915/display/intel_crtc.c | 4 +- drivers/gpu/drm/i915/display/intel_dbuf_bw.c | 2 +- drivers/gpu/drm/i915/display/intel_display.c | 2 +- .../gpu/drm/i915/display/intel_display_device.c | 2 +- drivers/gpu/drm/i915/display/intel_display_rps.c | 2 +- drivers/gpu/drm/i915/display/intel_dmc.c | 2 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/display/intel_dpt.c | 2 +- drivers/gpu/drm/i915/display/intel_dsb.c | 2 +- drivers/gpu/drm/i915/display/intel_dsb_buffer.c | 2 +- drivers/gpu/drm/i915/display/intel_dsi.c | 4 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_encoder.c | 2 +- drivers/gpu/drm/i915/display/intel_fb.c | 4 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_global_state.c | 2 +- drivers/gpu/drm/i915/display/intel_gmbus.c | 2 +- .../gpu/drm/i915/display/intel_hdcp_gsc_message.c | 2 +- drivers/gpu/drm/i915/display/intel_lpe_audio.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- drivers/gpu/drm/i915/display/intel_opregion.c | 2 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_plane.c | 4 +- drivers/gpu/drm/i915/display/intel_pmdemand.c | 2 +- drivers/gpu/drm/i915/display/intel_rom.c | 4 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 8 +- drivers/gpu/drm/i915/display/intel_tc.c | 2 +- drivers/gpu/drm/i915/display/intel_tv.c | 2 +- drivers/gpu/drm/i915/display/skl_watermark.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 10 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +- .../gpu/drm/i915/gem/i915_gem_object_frontbuffer.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_phys.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 6 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 4 +- .../drm/i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 6 +- drivers/gpu/drm/i915/gem/selftests/mock_context.c | 2 +- drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c | 2 +- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 2 +- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +- drivers/gpu/drm/i915/gt/intel_gsc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 2 +- drivers/gpu/drm/i915/gt/intel_timeline.c | 2 +- .../gpu/drm/i915/gt/selftest_engine_heartbeat.c | 2 +- drivers/gpu/drm/i915/gt/selftest_execlists.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +- drivers/gpu/drm/i915/gt/selftest_migrate.c | 2 +- drivers/gpu/drm/i915/gt/selftest_rc6.c | 2 +- drivers/gpu/drm/i915/gt/selftest_slpc.c | 2 +- drivers/gpu/drm/i915/gt/selftest_timeline.c | 2 +- drivers/gpu/drm/i915/gt/selftest_workarounds.c | 4 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 2 +- drivers/gpu/drm/i915/gt/sysfs_engines.c | 4 +- drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 6 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 +- drivers/gpu/drm/i915/gt/uc/selftest_guc.c | 2 +- drivers/gpu/drm/i915/gvt/cmd_parser.c | 4 +- drivers/gpu/drm/i915/gvt/display.c | 4 +- drivers/gpu/drm/i915/gvt/dmabuf.c | 6 +- drivers/gpu/drm/i915/gvt/gtt.c | 6 +- drivers/gpu/drm/i915/gvt/handlers.c | 2 +- drivers/gpu/drm/i915/gvt/kvmgt.c | 6 +- drivers/gpu/drm/i915/gvt/page_track.c | 2 +- drivers/gpu/drm/i915/gvt/sched_policy.c | 4 +- drivers/gpu/drm/i915/gvt/vgpu.c | 4 +- drivers/gpu/drm/i915/i915_active.c | 4 +- drivers/gpu/drm/i915/i915_drm_client.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_hdcp_gsc.c | 2 +- drivers/gpu/drm/i915/i915_hwmon.c | 2 +- drivers/gpu/drm/i915/i915_perf.c | 10 +- drivers/gpu/drm/i915/i915_pmu.c | 6 +- drivers/gpu/drm/i915/i915_scheduler.c | 2 +- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 4 +- drivers/gpu/drm/i915/i915_vma.c | 8 +- drivers/gpu/drm/i915/intel_memory_region.c | 2 +- drivers/gpu/drm/i915/intel_uncore.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp.c | 2 +- drivers/gpu/drm/i915/selftests/i915_active.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +- drivers/gpu/drm/i915/selftests/i915_perf.c | 4 +- drivers/gpu/drm/i915/selftests/i915_request.c | 20 ++-- drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 6 +- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +- drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 +- drivers/gpu/drm/i915/vlv_suspend.c | 2 +- drivers/gpu/drm/imagination/pvr_ccb.c | 2 +- drivers/gpu/drm/imagination/pvr_context.c | 2 +- drivers/gpu/drm/imagination/pvr_drv.c | 2 +- drivers/gpu/drm/imagination/pvr_free_list.c | 4 +- drivers/gpu/drm/imagination/pvr_fw.c | 2 +- drivers/gpu/drm/imagination/pvr_fw_trace.c | 2 +- drivers/gpu/drm/imagination/pvr_gem.c | 2 +- drivers/gpu/drm/imagination/pvr_hwrt.c | 2 +- drivers/gpu/drm/imagination/pvr_job.c | 2 +- drivers/gpu/drm/imagination/pvr_mmu.c | 8 +- drivers/gpu/drm/imagination/pvr_power.c | 4 +- drivers/gpu/drm/imagination/pvr_queue.c | 4 +- drivers/gpu/drm/imagination/pvr_sync.c | 2 +- drivers/gpu/drm/imagination/pvr_vm.c | 12 +-- drivers/gpu/drm/imx/dcss/dcss-plane.c | 2 +- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c | 4 +- drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 4 +- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +- drivers/gpu/drm/ingenic/ingenic-ipu.c | 2 +- drivers/gpu/drm/kmb/kmb_dsi.c | 4 +- drivers/gpu/drm/lima/lima_ctx.c | 2 +- drivers/gpu/drm/lima/lima_drv.c | 2 +- drivers/gpu/drm/lima/lima_gem.c | 4 +- drivers/gpu/drm/lima/lima_vm.c | 4 +- drivers/gpu/drm/loongson/lsdc_crtc.c | 4 +- drivers/gpu/drm/loongson/lsdc_gfxpll.c | 2 +- drivers/gpu/drm/loongson/lsdc_i2c.c | 2 +- drivers/gpu/drm/loongson/lsdc_pixpll.c | 2 +- drivers/gpu/drm/loongson/lsdc_ttm.c | 4 +- drivers/gpu/drm/mediatek/mtk_crtc.c | 4 +- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- drivers/gpu/drm/mediatek/mtk_gem.c | 4 +- drivers/gpu/drm/mediatek/mtk_plane.c | 4 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a2xx_gpummu.c | 2 +- drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +- drivers/gpu/drm/msm/disp/msm_disp_snapshot.c | 2 +- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 2 +- drivers/gpu/drm/msm/dp/dp_ctrl.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 2 +- drivers/gpu/drm/msm/msm_debugfs.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_fb.c | 2 +- drivers/gpu/drm/msm/msm_fence.c | 4 +- drivers/gpu/drm/msm/msm_gem.c | 4 +- drivers/gpu/drm/msm/msm_gem_vma.c | 6 +- drivers/gpu/drm/msm/msm_gpu.c | 2 +- drivers/gpu/drm/msm/msm_iommu.c | 6 +- drivers/gpu/drm/msm/msm_perf.c | 2 +- drivers/gpu/drm/msm/msm_rd.c | 2 +- drivers/gpu/drm/msm/msm_ringbuffer.c | 2 +- drivers/gpu/drm/msm/msm_submitqueue.c | 4 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/dac.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/core507d.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 16 ++-- drivers/gpu/drm/nouveau/dispnv50/head.c | 6 +- drivers/gpu/drm/nouveau/dispnv50/lut.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 8 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 10 +- drivers/gpu/drm/nouveau/nouveau_backlight.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 4 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 6 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 4 +- drivers/gpu/drm/nouveau/nouveau_exec.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_hwmon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_led.c | 2 +- drivers/gpu/drm/nouveau/nouveau_mem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_sched.c | 2 +- drivers/gpu/drm/nouveau/nouveau_sgdma.c | 2 +- drivers/gpu/drm/nouveau/nouveau_svm.c | 6 +- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 +- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 10 +- drivers/gpu/drm/nouveau/nouveau_vmm.c | 2 +- drivers/gpu/drm/nouveau/nv04_fence.c | 4 +- drivers/gpu/drm/nouveau/nv10_fence.c | 4 +- drivers/gpu/drm/nouveau/nv17_fence.c | 4 +- drivers/gpu/drm/nouveau/nv50_fence.c | 4 +- drivers/gpu/drm/nouveau/nv84_fence.c | 4 +- drivers/gpu/drm/nouveau/nvif/fifo.c | 2 +- drivers/gpu/drm/nouveau/nvif/mmu.c | 6 +- drivers/gpu/drm/nouveau/nvif/object.c | 2 +- drivers/gpu/drm/nouveau/nvif/outp.c | 2 +- drivers/gpu/drm/nouveau/nvif/vmm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/client.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/engine.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c | 4 +- drivers/gpu/drm/nouveau/nvkm/core/intr.c | 4 +- drivers/gpu/drm/nouveau/nvkm/core/memory.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/mm.c | 8 +- drivers/gpu/drm/nouveau/nvkm/core/object.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/oproxy.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/subdev.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/uevent.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/device/user.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergf100.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergf119.c | 2 +- .../gpu/drm/nouveau/nvkm/engine/dma/usergv100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c | 6 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 6 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c | 4 +- drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c | 8 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c | 4 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 6 +- .../gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c | 10 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 6 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c | 2 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +- drivers/gpu/drm/omapdrm/dss/dss.c | 4 +- drivers/gpu/drm/omapdrm/omap_crtc.c | 6 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 6 +- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 12 +-- drivers/gpu/drm/omapdrm/omap_irq.c | 2 +- drivers/gpu/drm/omapdrm/omap_overlay.c | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 6 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +- drivers/gpu/drm/panfrost/panfrost_gem.c | 4 +- drivers/gpu/drm/panfrost/panfrost_job.c | 4 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/gpu/drm/panthor/panthor_drv.c | 4 +- drivers/gpu/drm/panthor/panthor_gem.c | 4 +- drivers/gpu/drm/panthor/panthor_heap.c | 6 +- drivers/gpu/drm/panthor/panthor_mmu.c | 8 +- drivers/gpu/drm/panthor/panthor_sched.c | 10 +- drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/qxl/qxl_image.c | 4 +- drivers/gpu/drm/qxl/qxl_object.c | 2 +- drivers/gpu/drm/qxl/qxl_release.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- drivers/gpu/drm/radeon/atom.c | 2 +- drivers/gpu/drm/radeon/atombios_encoders.c | 4 +- drivers/gpu/drm/radeon/btc_dpm.c | 4 +- drivers/gpu/drm/radeon/ci_dpm.c | 6 +- drivers/gpu/drm/radeon/cypress_dpm.c | 2 +- drivers/gpu/drm/radeon/evergreen_cs.c | 2 +- drivers/gpu/drm/radeon/kv_dpm.c | 4 +- drivers/gpu/drm/radeon/ni_dpm.c | 10 +- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 2 +- drivers/gpu/drm/radeon/radeon_agp.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 4 +- drivers/gpu/drm/radeon/radeon_combios.c | 12 +-- drivers/gpu/drm/radeon/radeon_connectors.c | 4 +- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 6 +- drivers/gpu/drm/radeon/radeon_fbdev.c | 2 +- drivers/gpu/drm/radeon/radeon_fence.c | 2 +- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 8 +- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- drivers/gpu/drm/radeon/radeon_test.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 4 +- drivers/gpu/drm/radeon/radeon_vm.c | 4 +- drivers/gpu/drm/radeon/rs780_dpm.c | 4 +- drivers/gpu/drm/radeon/rv6xx_dpm.c | 4 +- drivers/gpu/drm/radeon/rv770_dpm.c | 4 +- drivers/gpu/drm/radeon/si_dpm.c | 12 +-- drivers/gpu/drm/radeon/sumo_dpm.c | 4 +- drivers/gpu/drm/radeon/trinity_dpm.c | 4 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c | 2 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 6 +- .../gpu/drm/renesas/rcar-du/rcar_du_writeback.c | 6 +- drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 2 +- drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c | 4 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 +- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +- drivers/gpu/drm/sitronix/st7920.c | 8 +- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/sti/sti_drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_layer.c | 4 +- drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 8 +- drivers/gpu/drm/tegra/dc.c | 10 +- drivers/gpu/drm/tegra/drm.c | 8 +- drivers/gpu/drm/tegra/dsi.c | 2 +- drivers/gpu/drm/tegra/fb.c | 2 +- drivers/gpu/drm/tegra/gem.c | 10 +- drivers/gpu/drm/tegra/hub.c | 4 +- drivers/gpu/drm/tegra/plane.c | 4 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/tegra/submit.c | 10 +- drivers/gpu/drm/tegra/uapi.c | 4 +- drivers/gpu/drm/tests/drm_gem_shmem_test.c | 2 +- drivers/gpu/drm/tests/drm_mm_test.c | 2 +- drivers/gpu/drm/tests/drm_panic_test.c | 2 +- drivers/gpu/drm/tidss/tidss_crtc.c | 6 +- drivers/gpu/drm/tidss/tidss_plane.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- drivers/gpu/drm/tiny/appletbdrm.c | 8 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 2 +- drivers/gpu/drm/ttm/tests/ttm_mock_manager.c | 6 +- drivers/gpu/drm/ttm/ttm_agp_backend.c | 2 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- drivers/gpu/drm/ttm/ttm_pool.c | 2 +- drivers/gpu/drm/ttm/ttm_range_manager.c | 2 +- drivers/gpu/drm/ttm/ttm_sys_manager.c | 2 +- drivers/gpu/drm/udl/udl_main.c | 2 +- drivers/gpu/drm/v3d/v3d_bo.c | 2 +- drivers/gpu/drm/v3d/v3d_drv.c | 2 +- drivers/gpu/drm/v3d/v3d_fence.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 +- drivers/gpu/drm/vc4/vc4_bo.c | 4 +- drivers/gpu/drm/vc4/vc4_crtc.c | 6 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_gem.c | 8 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/vc4/vc4_kms.c | 10 +- drivers/gpu/drm/vc4/vc4_plane.c | 2 +- drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +- drivers/gpu/drm/vgem/vgem_drv.c | 4 +- drivers/gpu/drm/vgem/vgem_fence.c | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 +- drivers/gpu/drm/virtio/virtgpu_object.c | 4 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +- drivers/gpu/drm/virtio/virtgpu_submit.c | 6 +- drivers/gpu/drm/virtio/virtgpu_vq.c | 14 +-- drivers/gpu/drm/virtio/virtgpu_vram.c | 4 +- drivers/gpu/drm/vkms/vkms_colorop.c | 8 +- drivers/gpu/drm/vkms/vkms_config.c | 10 +- drivers/gpu/drm/vkms/vkms_configfs.c | 2 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 6 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- drivers/gpu/drm/vmwgfx/ttm_object.c | 6 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 +-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 6 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- drivers/gpu/drm/xe/display/intel_bo.c | 2 +- drivers/gpu/drm/xe/display/xe_dsb_buffer.c | 2 +- drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 2 +- drivers/gpu/drm/xe/display/xe_panic.c | 2 +- drivers/gpu/drm/xe/display/xe_stolen.c | 2 +- drivers/gpu/drm/xe/tests/xe_bo.c | 2 +- drivers/gpu/drm/xe/xe_bb.c | 4 +- drivers/gpu/drm/xe/xe_bo.c | 4 +- drivers/gpu/drm/xe/xe_configfs.c | 2 +- drivers/gpu/drm/xe/xe_dep_scheduler.c | 2 +- drivers/gpu/drm/xe/xe_device.c | 2 +- drivers/gpu/drm/xe/xe_drm_client.c | 2 +- drivers/gpu/drm/xe/xe_eu_stall.c | 4 +- drivers/gpu/drm/xe/xe_exec.c | 2 +- drivers/gpu/drm/xe/xe_exec_queue.c | 2 +- drivers/gpu/drm/xe/xe_execlist.c | 2 +- drivers/gpu/drm/xe/xe_gt_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_guc_submit.c | 10 +- drivers/gpu/drm/xe/xe_heci_gsc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 6 +- drivers/gpu/drm/xe/xe_lrc.c | 2 +- drivers/gpu/drm/xe/xe_migrate.c | 2 +- drivers/gpu/drm/xe/xe_mmio_gem.c | 2 +- drivers/gpu/drm/xe/xe_nvm.c | 2 +- drivers/gpu/drm/xe/xe_oa.c | 10 +- drivers/gpu/drm/xe/xe_pmu.c | 2 +- drivers/gpu/drm/xe/xe_preempt_fence.c | 2 +- drivers/gpu/drm/xe/xe_pt.c | 6 +- drivers/gpu/drm/xe/xe_reg_sr.c | 2 +- drivers/gpu/drm/xe/xe_shrinker.c | 2 +- drivers/gpu/drm/xe/xe_sriov_packet.c | 2 +- drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_svm.c | 4 +- drivers/gpu/drm/xe/xe_sync.c | 4 +- drivers/gpu/drm/xe/xe_tile_sysfs.c | 2 +- drivers/gpu/drm/xe/xe_tlb_inval_job.c | 4 +- drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 4 +- drivers/gpu/drm/xe/xe_vm.c | 16 ++-- drivers/gpu/drm/xen/xen_drm_front.c | 4 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_disp.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +- drivers/gpu/host1x/bus.c | 4 +- drivers/gpu/host1x/context.c | 2 +- drivers/gpu/host1x/fence.c | 2 +- drivers/gpu/host1x/mipi.c | 2 +- drivers/gpu/ipu-v3/ipu-common.c | 2 +- drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +- drivers/gpu/vga/vga_switcheroo.c | 2 +- drivers/greybus/bundle.c | 2 +- drivers/greybus/connection.c | 2 +- drivers/greybus/control.c | 2 +- drivers/greybus/es2.c | 8 +- drivers/greybus/interface.c | 2 +- drivers/greybus/manifest.c | 2 +- drivers/greybus/svc.c | 4 +- drivers/greybus/svc_watchdog.c | 2 +- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 2 +- drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 2 +- drivers/hid/bpf/hid_bpf_dispatch.c | 2 +- drivers/hid/hid-apple.c | 2 +- drivers/hid/hid-axff.c | 2 +- drivers/hid/hid-betopff.c | 2 +- drivers/hid/hid-cmedia.c | 2 +- drivers/hid/hid-core.c | 8 +- drivers/hid/hid-corsair.c | 4 +- drivers/hid/hid-cougar.c | 2 +- drivers/hid/hid-debug.c | 2 +- drivers/hid/hid-dr.c | 2 +- drivers/hid/hid-elo.c | 2 +- drivers/hid/hid-emsff.c | 2 +- drivers/hid/hid-gaff.c | 2 +- drivers/hid/hid-holtekff.c | 2 +- drivers/hid/hid-hyperv.c | 2 +- drivers/hid/hid-input.c | 4 +- drivers/hid/hid-lg.c | 2 +- drivers/hid/hid-lg2ff.c | 2 +- drivers/hid/hid-lg4ff.c | 2 +- drivers/hid/hid-logitech-dj.c | 8 +- drivers/hid/hid-logitech-hidpp.c | 8 +- drivers/hid/hid-megaworld.c | 2 +- drivers/hid/hid-mf.c | 2 +- drivers/hid/hid-ntrig.c | 2 +- drivers/hid/hid-picolcd_core.c | 4 +- drivers/hid/hid-pl.c | 2 +- drivers/hid/hid-playstation.c | 2 +- drivers/hid/hid-prodikeys.c | 2 +- drivers/hid/hid-quirks.c | 4 +- drivers/hid/hid-roccat-arvo.c | 2 +- drivers/hid/hid-roccat-isku.c | 2 +- drivers/hid/hid-roccat-kone.c | 2 +- drivers/hid/hid-roccat-koneplus.c | 2 +- drivers/hid/hid-roccat-konepure.c | 2 +- drivers/hid/hid-roccat-kovaplus.c | 2 +- drivers/hid/hid-roccat-lua.c | 2 +- drivers/hid/hid-roccat-pyra.c | 2 +- drivers/hid/hid-roccat-ryos.c | 2 +- drivers/hid/hid-roccat-savu.c | 2 +- drivers/hid/hid-roccat.c | 4 +- drivers/hid/hid-sensor-custom.c | 2 +- drivers/hid/hid-sjoy.c | 2 +- drivers/hid/hid-thrustmaster.c | 4 +- drivers/hid/hid-tmff.c | 2 +- drivers/hid/hid-uclogic-params.c | 4 +- drivers/hid/hid-wiimote-core.c | 2 +- drivers/hid/hid-wiimote-debug.c | 2 +- drivers/hid/hid-zpff.c | 2 +- drivers/hid/hidraw.c | 4 +- drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +- drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +- drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 4 +- drivers/hid/intel-ish-hid/ishtp/client.c | 2 +- drivers/hid/uhid.c | 14 +-- drivers/hid/usbhid/hid-core.c | 4 +- drivers/hid/usbhid/hid-pidff.c | 2 +- drivers/hid/usbhid/hiddev.c | 4 +- drivers/hid/usbhid/usbkbd.c | 4 +- drivers/hid/usbhid/usbmouse.c | 2 +- drivers/hid/wacom_sys.c | 2 +- drivers/hsi/clients/cmt_speech.c | 4 +- drivers/hsi/clients/hsi_char.c | 2 +- drivers/hsi/clients/ssi_protocol.c | 4 +- drivers/hsi/hsi_boardinfo.c | 2 +- drivers/hsi/hsi_core.c | 8 +- drivers/hv/hv_kvp.c | 4 +- drivers/hv/hv_proc.c | 2 +- drivers/hv/hv_snapshot.c | 4 +- drivers/hv/hv_utils_transport.c | 2 +- drivers/hv/mshv_debugfs.c | 2 +- drivers/hv/mshv_eventfd.c | 4 +- drivers/hv/mshv_root_main.c | 6 +- drivers/hv/mshv_synic.c | 2 +- drivers/hv/mshv_vtl_main.c | 6 +- drivers/hv/vmbus_drv.c | 6 +- drivers/hwmon/acpi_power_meter.c | 2 +- drivers/hwmon/applesmc.c | 4 +- drivers/hwmon/coretemp.c | 4 +- drivers/hwmon/drivetemp.c | 2 +- drivers/hwmon/fschmd.c | 2 +- drivers/hwmon/hwmon.c | 8 +- drivers/hwmon/i5k_amb.c | 2 +- drivers/hwmon/ibmaem.c | 4 +- drivers/hwmon/ibmpex.c | 2 +- drivers/hwmon/sch56xx-common.c | 2 +- drivers/hwmon/via-cputemp.c | 2 +- drivers/hwmon/w83793.c | 2 +- drivers/hwtracing/coresight/coresight-catu.c | 2 +- drivers/hwtracing/coresight/coresight-core.c | 6 +- .../hwtracing/coresight/coresight-cti-platform.c | 2 +- drivers/hwtracing/coresight/coresight-etm-perf.c | 2 +- drivers/hwtracing/coresight/coresight-syscfg.c | 4 +- drivers/hwtracing/coresight/coresight-tmc-etr.c | 12 +-- drivers/hwtracing/coresight/coresight-trbe.c | 2 +- drivers/hwtracing/intel_th/core.c | 2 +- drivers/hwtracing/intel_th/msu-sink.c | 2 +- drivers/hwtracing/intel_th/msu.c | 6 +- drivers/hwtracing/ptt/hisi_ptt.c | 6 +- drivers/hwtracing/stm/core.c | 6 +- drivers/hwtracing/stm/policy.c | 2 +- drivers/i2c/busses/i2c-cp2615.c | 6 +- drivers/i2c/busses/i2c-cpm.c | 2 +- drivers/i2c/busses/i2c-designware-amdpsp.c | 2 +- drivers/i2c/busses/i2c-diolan-u2c.c | 2 +- drivers/i2c/busses/i2c-eg20t.c | 2 +- drivers/i2c/busses/i2c-fsi.c | 2 +- drivers/i2c/busses/i2c-highlander.c | 2 +- drivers/i2c/busses/i2c-ibm_iic.c | 2 +- drivers/i2c/busses/i2c-iop3xx.c | 4 +- drivers/i2c/busses/i2c-nforce2.c | 2 +- drivers/i2c/busses/i2c-parport.c | 2 +- drivers/i2c/busses/i2c-piix4.c | 4 +- drivers/i2c/busses/i2c-pxa-pci.c | 2 +- drivers/i2c/busses/i2c-scmi.c | 2 +- drivers/i2c/busses/i2c-sh7760.c | 2 +- drivers/i2c/busses/i2c-simtec.c | 2 +- drivers/i2c/busses/i2c-stm32f7.c | 2 +- drivers/i2c/busses/i2c-taos-evm.c | 2 +- drivers/i2c/busses/i2c-tiny-usb.c | 6 +- drivers/i2c/busses/i2c-virtio.c | 2 +- drivers/i2c/busses/scx200_acb.c | 2 +- drivers/i2c/i2c-atr.c | 6 +- drivers/i2c/i2c-boardinfo.c | 2 +- drivers/i2c/i2c-core-acpi.c | 4 +- drivers/i2c/i2c-core-base.c | 4 +- drivers/i2c/i2c-core-of-prober.c | 2 +- drivers/i2c/i2c-dev.c | 4 +- drivers/i2c/i2c-mux.c | 2 +- drivers/i2c/i2c-smbus.c | 2 +- drivers/i2c/i2c-stub.c | 2 +- drivers/i3c/master.c | 12 +-- drivers/i3c/master/adi-i3c-master.c | 4 +- drivers/i3c/master/dw-i3c-master.c | 4 +- drivers/i3c/master/i3c-master-cdns.c | 4 +- drivers/i3c/master/mipi-i3c-hci/core.c | 4 +- drivers/i3c/master/mipi-i3c-hci/dma.c | 2 +- drivers/i3c/master/mipi-i3c-hci/hci.h | 2 +- drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 2 +- drivers/i3c/master/mipi-i3c-hci/pio.c | 2 +- drivers/i3c/master/renesas-i3c.c | 4 +- drivers/i3c/master/svc-i3c-master.c | 4 +- drivers/iio/buffer/industrialio-buffer-cb.c | 2 +- drivers/iio/buffer/industrialio-buffer-dma.c | 2 +- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 +- drivers/iio/buffer/industrialio-hw-consumer.c | 2 +- drivers/iio/buffer/kfifo_buf.c | 2 +- drivers/iio/common/ssp_sensors/ssp_spi.c | 2 +- drivers/iio/dummy/iio_dummy_evgen.c | 2 +- drivers/iio/dummy/iio_simple_dummy.c | 2 +- drivers/iio/dummy/iio_simple_dummy_buffer.c | 2 +- drivers/iio/imu/adis_buffer.c | 4 +- drivers/iio/industrialio-buffer.c | 16 ++-- drivers/iio/industrialio-core.c | 4 +- drivers/iio/industrialio-event.c | 2 +- drivers/iio/industrialio-gts-helper.c | 6 +- drivers/iio/industrialio-trigger.c | 4 +- drivers/iio/inkern.c | 8 +- drivers/iio/trigger/iio-trig-hrtimer.c | 2 +- drivers/iio/trigger/iio-trig-interrupt.c | 2 +- drivers/iio/trigger/iio-trig-loop.c | 2 +- drivers/iio/trigger/iio-trig-sysfs.c | 2 +- drivers/infiniband/core/addr.c | 2 +- drivers/infiniband/core/agent.c | 2 +- drivers/infiniband/core/cache.c | 8 +- drivers/infiniband/core/cm.c | 6 +- drivers/infiniband/core/cma.c | 30 +++--- drivers/infiniband/core/cma_configfs.c | 4 +- drivers/infiniband/core/cq.c | 4 +- drivers/infiniband/core/device.c | 2 +- drivers/infiniband/core/ib_core_uverbs.c | 2 +- drivers/infiniband/core/iwcm.c | 4 +- drivers/infiniband/core/iwpm_util.c | 2 +- drivers/infiniband/core/mad.c | 8 +- drivers/infiniband/core/mad_rmpp.c | 2 +- drivers/infiniband/core/restrack.c | 2 +- drivers/infiniband/core/rw.c | 8 +- drivers/infiniband/core/sa_query.c | 6 +- drivers/infiniband/core/security.c | 6 +- drivers/infiniband/core/sysfs.c | 6 +- drivers/infiniband/core/ucaps.c | 2 +- drivers/infiniband/core/ucma.c | 10 +- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_dmabuf.c | 2 +- drivers/infiniband/core/umem_odp.c | 6 +- drivers/infiniband/core/user_mad.c | 4 +- drivers/infiniband/core/uverbs_cmd.c | 18 ++-- drivers/infiniband/core/uverbs_main.c | 6 +- drivers/infiniband/core/uverbs_uapi.c | 2 +- drivers/infiniband/core/verbs.c | 4 +- drivers/infiniband/hw/bng_re/bng_dev.c | 8 +- drivers/infiniband/hw/bnxt_re/debugfs.c | 4 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 22 ++--- drivers/infiniband/hw/bnxt_re/main.c | 8 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_res.c | 2 +- drivers/infiniband/hw/cxgb4/cq.c | 4 +- drivers/infiniband/hw/cxgb4/device.c | 8 +- drivers/infiniband/hw/cxgb4/mem.c | 8 +- drivers/infiniband/hw/cxgb4/provider.c | 2 +- drivers/infiniband/hw/cxgb4/qp.c | 14 +-- drivers/infiniband/hw/cxgb4/resource.c | 16 ++-- drivers/infiniband/hw/cxgb4/restrack.c | 2 +- drivers/infiniband/hw/efa/efa_main.c | 2 +- drivers/infiniband/hw/efa/efa_verbs.c | 6 +- drivers/infiniband/hw/erdma/erdma_cm.c | 6 +- drivers/infiniband/hw/erdma/erdma_verbs.c | 14 +-- drivers/infiniband/hw/hfi1/affinity.c | 2 +- drivers/infiniband/hw/hfi1/chip.c | 4 +- drivers/infiniband/hw/hfi1/efivar.c | 2 +- drivers/infiniband/hw/hfi1/fault.c | 2 +- drivers/infiniband/hw/hfi1/file_ops.c | 2 +- drivers/infiniband/hw/hfi1/init.c | 4 +- drivers/infiniband/hw/hfi1/mad.c | 2 +- drivers/infiniband/hw/hfi1/msix.c | 2 +- drivers/infiniband/hw/hfi1/pin_system.c | 4 +- drivers/infiniband/hw/hfi1/qsfp.c | 2 +- drivers/infiniband/hw/hfi1/sdma.c | 4 +- drivers/infiniband/hw/hfi1/user_exp_rcv.c | 2 +- drivers/infiniband/hw/hfi1/user_sdma.c | 6 +- drivers/infiniband/hw/hns/hns_roce_bond.c | 4 +- drivers/infiniband/hw/hns/hns_roce_cmd.c | 4 +- drivers/infiniband/hw/hns/hns_roce_db.c | 4 +- drivers/infiniband/hw/hns/hns_roce_hem.c | 8 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 18 ++-- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- drivers/infiniband/hw/hns/hns_roce_mr.c | 8 +- drivers/infiniband/hw/ionic/ionic_admin.c | 8 +- drivers/infiniband/hw/ionic/ionic_controlpath.c | 12 +-- drivers/infiniband/hw/ionic/ionic_hw_stats.c | 2 +- drivers/infiniband/hw/irdma/cm.c | 2 +- drivers/infiniband/hw/irdma/hw.c | 6 +- drivers/infiniband/hw/irdma/i40iw_if.c | 2 +- drivers/infiniband/hw/irdma/icrdma_if.c | 2 +- drivers/infiniband/hw/irdma/ig3rdma_if.c | 2 +- drivers/infiniband/hw/irdma/verbs.c | 12 +-- drivers/infiniband/hw/mana/cq.c | 2 +- drivers/infiniband/hw/mana/mr.c | 10 +- drivers/infiniband/hw/mana/qp.c | 2 +- drivers/infiniband/hw/mana/wq.c | 2 +- drivers/infiniband/hw/mlx4/alias_GUID.c | 4 +- drivers/infiniband/hw/mlx4/cm.c | 4 +- drivers/infiniband/hw/mlx4/cq.c | 4 +- drivers/infiniband/hw/mlx4/doorbell.c | 2 +- drivers/infiniband/hw/mlx4/mad.c | 8 +- drivers/infiniband/hw/mlx4/main.c | 34 +++---- drivers/infiniband/hw/mlx4/mcg.c | 8 +- drivers/infiniband/hw/mlx4/mr.c | 6 +- drivers/infiniband/hw/mlx4/qp.c | 16 ++-- drivers/infiniband/hw/mlx4/sysfs.c | 6 +- drivers/infiniband/hw/mlx5/cong.c | 2 +- drivers/infiniband/hw/mlx5/counters.c | 2 +- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/data_direct.c | 4 +- drivers/infiniband/hw/mlx5/devx.c | 6 +- drivers/infiniband/hw/mlx5/dm.c | 4 +- drivers/infiniband/hw/mlx5/doorbell.c | 2 +- drivers/infiniband/hw/mlx5/fs.c | 22 ++--- drivers/infiniband/hw/mlx5/gsi.c | 2 +- drivers/infiniband/hw/mlx5/ib_rep.c | 2 +- drivers/infiniband/hw/mlx5/ib_virt.c | 8 +- drivers/infiniband/hw/mlx5/macsec.c | 4 +- drivers/infiniband/hw/mlx5/mad.c | 32 +++---- drivers/infiniband/hw/mlx5/main.c | 12 +-- drivers/infiniband/hw/mlx5/mr.c | 20 ++-- drivers/infiniband/hw/mlx5/odp.c | 2 +- drivers/infiniband/hw/mlx5/qp.c | 2 +- drivers/infiniband/hw/mlx5/srq.c | 2 +- drivers/infiniband/hw/mthca/mthca_allocator.c | 2 +- drivers/infiniband/hw/mthca/mthca_eq.c | 2 +- drivers/infiniband/hw/mthca/mthca_mad.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/mthca/mthca_mr.c | 2 +- drivers/infiniband/hw/mthca/mthca_profile.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 26 +++--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 10 +- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 +- drivers/infiniband/hw/qedr/main.c | 8 +- drivers/infiniband/hw/qedr/qedr_iw_cm.c | 4 +- drivers/infiniband/hw/qedr/qedr_roce_cm.c | 4 +- drivers/infiniband/hw/qedr/verbs.c | 16 ++-- drivers/infiniband/hw/usnic/usnic_fwd.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 2 +- drivers/infiniband/hw/usnic/usnic_uiom.c | 4 +- drivers/infiniband/hw/usnic/usnic_vnic.c | 6 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c | 6 +- drivers/infiniband/sw/rdmavt/mcast.c | 4 +- drivers/infiniband/sw/rdmavt/mr.c | 2 +- drivers/infiniband/sw/rdmavt/qp.c | 2 +- drivers/infiniband/sw/rdmavt/vt.c | 2 +- drivers/infiniband/sw/rxe/rxe_mcast.c | 4 +- drivers/infiniband/sw/rxe/rxe_mmap.c | 2 +- drivers/infiniband/sw/rxe/rxe_mr.c | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 2 +- drivers/infiniband/sw/rxe/rxe_queue.c | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +- drivers/infiniband/sw/siw/siw_cm.c | 6 +- drivers/infiniband/sw/siw/siw_main.c | 4 +- drivers/infiniband/sw/siw/siw_mem.c | 8 +- drivers/infiniband/sw/siw/siw_qp.c | 4 +- drivers/infiniband/sw/siw/siw_verbs.c | 8 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 +- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 12 +-- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 2 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- drivers/infiniband/ulp/iser/iser_verbs.c | 4 +- drivers/infiniband/ulp/isert/ib_isert.c | 6 +- drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c | 4 +- drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c | 2 +- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 12 +-- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 20 ++-- drivers/infiniband/ulp/rtrs/rtrs.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 18 ++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 22 ++--- drivers/input/apm-power.c | 2 +- drivers/input/evdev.c | 2 +- drivers/input/ff-core.c | 2 +- drivers/input/ff-memless.c | 2 +- drivers/input/gameport/emu10k1-gp.c | 2 +- drivers/input/gameport/fm801-gp.c | 2 +- drivers/input/gameport/ns558.c | 4 +- drivers/input/input-mt.c | 2 +- drivers/input/input-poller.c | 2 +- drivers/input/input.c | 6 +- drivers/input/joydev.c | 4 +- drivers/input/joystick/a3d.c | 2 +- drivers/input/joystick/adi.c | 2 +- drivers/input/joystick/analog.c | 2 +- drivers/input/joystick/as5011.c | 2 +- drivers/input/joystick/cobra.c | 2 +- drivers/input/joystick/db9.c | 2 +- drivers/input/joystick/fsia6b.c | 2 +- drivers/input/joystick/gamecon.c | 4 +- drivers/input/joystick/gf2k.c | 2 +- drivers/input/joystick/grip.c | 2 +- drivers/input/joystick/grip_mp.c | 2 +- drivers/input/joystick/guillemot.c | 2 +- drivers/input/joystick/iforce/iforce-serio.c | 2 +- drivers/input/joystick/iforce/iforce-usb.c | 2 +- drivers/input/joystick/interact.c | 2 +- drivers/input/joystick/joydump.c | 2 +- drivers/input/joystick/magellan.c | 2 +- drivers/input/joystick/maplecontrol.c | 2 +- drivers/input/joystick/n64joy.c | 2 +- drivers/input/joystick/sidewinder.c | 2 +- drivers/input/joystick/spaceball.c | 2 +- drivers/input/joystick/spaceorb.c | 2 +- drivers/input/joystick/stinger.c | 2 +- drivers/input/joystick/tmdc.c | 4 +- drivers/input/joystick/turbografx.c | 2 +- drivers/input/joystick/twidjoy.c | 2 +- drivers/input/joystick/warrior.c | 2 +- drivers/input/joystick/xpad.c | 4 +- drivers/input/joystick/zhenhua.c | 2 +- drivers/input/keyboard/atkbd.c | 2 +- drivers/input/keyboard/hil_kbd.c | 2 +- drivers/input/keyboard/lkkbd.c | 2 +- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/maple_keyb.c | 2 +- drivers/input/keyboard/newtonkbd.c | 2 +- drivers/input/keyboard/sh_keysc.c | 2 +- drivers/input/keyboard/stowaway.c | 2 +- drivers/input/keyboard/sunkbd.c | 2 +- drivers/input/keyboard/xtkbd.c | 2 +- drivers/input/misc/88pm80x_onkey.c | 2 +- drivers/input/misc/ati_remote2.c | 2 +- drivers/input/misc/cm109.c | 4 +- drivers/input/misc/cma3000_d0x.c | 2 +- drivers/input/misc/cs40l50-vibra.c | 2 +- drivers/input/misc/da9052_onkey.c | 2 +- drivers/input/misc/ims-pcu.c | 4 +- drivers/input/misc/keyspan_remote.c | 2 +- drivers/input/misc/max8997_haptic.c | 2 +- drivers/input/misc/mc13783-pwrbutton.c | 2 +- drivers/input/misc/palmas-pwrbutton.c | 2 +- drivers/input/misc/pcap_keys.c | 2 +- drivers/input/misc/pcf8574_keypad.c | 2 +- drivers/input/misc/powermate.c | 4 +- drivers/input/misc/uinput.c | 2 +- drivers/input/misc/xen-kbdfront.c | 2 +- drivers/input/misc/yealink.c | 4 +- drivers/input/mouse/alps.c | 2 +- drivers/input/mouse/appletouch.c | 2 +- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/byd.c | 2 +- drivers/input/mouse/cypress_ps2.c | 2 +- drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/focaltech.c | 2 +- drivers/input/mouse/hgpk.c | 2 +- drivers/input/mouse/lifebook.c | 2 +- drivers/input/mouse/maplemouse.c | 2 +- drivers/input/mouse/psmouse-base.c | 2 +- drivers/input/mouse/psmouse-smbus.c | 2 +- drivers/input/mouse/sentelic.c | 2 +- drivers/input/mouse/sermouse.c | 2 +- drivers/input/mouse/synaptics.c | 4 +- drivers/input/mouse/synaptics_usb.c | 2 +- drivers/input/mouse/trackpoint.c | 2 +- drivers/input/mouse/vmmouse.c | 2 +- drivers/input/mouse/vsxxxaa.c | 2 +- drivers/input/mousedev.c | 4 +- drivers/input/rmi4/rmi_bus.c | 2 +- drivers/input/rmi4/rmi_f03.c | 2 +- drivers/input/serio/altera_ps2.c | 2 +- drivers/input/serio/ambakmi.c | 4 +- drivers/input/serio/ams_delta_serio.c | 2 +- drivers/input/serio/apbps2.c | 2 +- drivers/input/serio/arc_ps2.c | 2 +- drivers/input/serio/ct82c710.c | 2 +- drivers/input/serio/gscps2.c | 4 +- drivers/input/serio/hil_mlc.c | 2 +- drivers/input/serio/hyperv-keyboard.c | 4 +- drivers/input/serio/i8042.c | 4 +- drivers/input/serio/ioc3kbd.c | 4 +- drivers/input/serio/maceps2.c | 2 +- drivers/input/serio/olpc_apsp.c | 4 +- drivers/input/serio/parkbd.c | 2 +- drivers/input/serio/pcips2.c | 4 +- drivers/input/serio/ps2-gpio.c | 2 +- drivers/input/serio/ps2mult.c | 4 +- drivers/input/serio/q40kbd.c | 4 +- drivers/input/serio/rpckbd.c | 4 +- drivers/input/serio/sa1111ps2.c | 4 +- drivers/input/serio/serio_raw.c | 2 +- drivers/input/serio/serport.c | 4 +- drivers/input/serio/sun4i-ps2.c | 4 +- drivers/input/serio/userio.c | 4 +- drivers/input/serio/xilinx_ps2.c | 4 +- drivers/input/tablet/acecad.c | 2 +- drivers/input/tablet/aiptek.c | 2 +- drivers/input/tablet/hanwang.c | 2 +- drivers/input/tablet/kbtab.c | 2 +- drivers/input/tablet/pegasus_notetaker.c | 2 +- drivers/input/tablet/wacom_serial4.c | 2 +- drivers/input/touchscreen/ad7877.c | 6 +- drivers/input/touchscreen/ads7846.c | 4 +- drivers/input/touchscreen/da9052_tsi.c | 2 +- drivers/input/touchscreen/dynapro.c | 2 +- drivers/input/touchscreen/egalax_ts_serial.c | 2 +- drivers/input/touchscreen/elo.c | 2 +- drivers/input/touchscreen/fujitsu_ts.c | 2 +- drivers/input/touchscreen/gunze.c | 2 +- drivers/input/touchscreen/hampshire.c | 2 +- drivers/input/touchscreen/inexio.c | 2 +- drivers/input/touchscreen/mc13783_ts.c | 2 +- drivers/input/touchscreen/migor_ts.c | 2 +- drivers/input/touchscreen/mtouch.c | 2 +- drivers/input/touchscreen/pcap_ts.c | 2 +- drivers/input/touchscreen/penmount.c | 2 +- drivers/input/touchscreen/sur40.c | 2 +- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- drivers/input/touchscreen/touchit213.c | 2 +- drivers/input/touchscreen/touchright.c | 2 +- drivers/input/touchscreen/touchwin.c | 2 +- drivers/input/touchscreen/tsc40.c | 2 +- drivers/input/touchscreen/usbtouchscreen.c | 6 +- drivers/input/touchscreen/wacom_w8001.c | 2 +- drivers/interconnect/core.c | 4 +- drivers/interconnect/debugfs-client.c | 2 +- drivers/interconnect/qcom/icc-common.c | 2 +- drivers/iommu/amd/init.c | 12 +-- drivers/iommu/amd/iommu.c | 12 +-- drivers/iommu/amd/iommufd.c | 2 +- drivers/iommu/amd/nested.c | 4 +- drivers/iommu/amd/pasid.c | 2 +- drivers/iommu/apple-dart.c | 4 +- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 6 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +- drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 8 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 2 +- drivers/iommu/dma-iommu.c | 10 +- drivers/iommu/exynos-iommu.c | 4 +- drivers/iommu/fsl_pamu.c | 2 +- drivers/iommu/hyperv-iommu.c | 2 +- drivers/iommu/intel/cache.c | 2 +- drivers/iommu/intel/dmar.c | 4 +- drivers/iommu/intel/iommu.c | 12 +-- drivers/iommu/intel/irq_remapping.c | 6 +- drivers/iommu/intel/pasid.c | 2 +- drivers/iommu/intel/perfmon.c | 2 +- drivers/iommu/intel/svm.c | 2 +- drivers/iommu/io-pgfault.c | 8 +- drivers/iommu/io-pgtable-arm-v7s.c | 2 +- drivers/iommu/io-pgtable-arm.c | 2 +- drivers/iommu/io-pgtable-dart.c | 2 +- drivers/iommu/iommu-sva.c | 4 +- drivers/iommu/iommu-sysfs.c | 2 +- drivers/iommu/iommu.c | 8 +- drivers/iommu/iommufd/device.c | 8 +- drivers/iommu/iommufd/driver.c | 2 +- drivers/iommu/iommufd/iova_bitmap.c | 2 +- drivers/iommu/iommufd/pages.c | 2 +- drivers/iommu/iommufd/selftest.c | 12 +-- drivers/iommu/ipmmu-vmsa.c | 2 +- drivers/iommu/msm_iommu.c | 2 +- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- drivers/iommu/omap-iommu-debug.c | 2 +- drivers/iommu/omap-iommu.c | 6 +- drivers/iommu/riscv/iommu.c | 6 +- drivers/iommu/rockchip-iommu.c | 2 +- drivers/iommu/s390-iommu.c | 2 +- drivers/iommu/sprd-iommu.c | 2 +- drivers/iommu/sun50i-iommu.c | 2 +- drivers/iommu/tegra-smmu.c | 4 +- drivers/iommu/virtio-iommu.c | 4 +- drivers/ipack/carriers/tpci200.c | 8 +- drivers/ipack/devices/ipoctal.c | 2 +- drivers/ipack/ipack.c | 2 +- drivers/irqchip/exynos-combiner.c | 2 +- drivers/irqchip/irq-al-fic.c | 2 +- drivers/irqchip/irq-apple-aic.c | 4 +- drivers/irqchip/irq-armada-370-xp.c | 2 +- drivers/irqchip/irq-aspeed-i2c-ic.c | 2 +- drivers/irqchip/irq-aspeed-intc.c | 2 +- drivers/irqchip/irq-aspeed-scu-ic.c | 2 +- drivers/irqchip/irq-aspeed-vic.c | 2 +- drivers/irqchip/irq-atmel-aic-common.c | 2 +- drivers/irqchip/irq-bcm2712-mip.c | 2 +- drivers/irqchip/irq-bcm6345-l1.c | 2 +- drivers/irqchip/irq-bcm7038-l1.c | 2 +- drivers/irqchip/irq-bcm7120-l2.c | 2 +- drivers/irqchip/irq-brcmstb-l2.c | 2 +- drivers/irqchip/irq-clps711x.c | 2 +- drivers/irqchip/irq-crossbar.c | 4 +- drivers/irqchip/irq-gic-v2m.c | 2 +- drivers/irqchip/irq-gic-v3-its.c | 12 +-- drivers/irqchip/irq-gic-v3-mbi.c | 2 +- drivers/irqchip/irq-gic-v3.c | 4 +- drivers/irqchip/irq-gic-v5-irs.c | 4 +- drivers/irqchip/irq-gic-v5-its.c | 6 +- drivers/irqchip/irq-goldfish-pic.c | 2 +- drivers/irqchip/irq-idt3243x.c | 2 +- drivers/irqchip/irq-imx-gpcv2.c | 2 +- drivers/irqchip/irq-ingenic-tcu.c | 2 +- drivers/irqchip/irq-ingenic.c | 2 +- drivers/irqchip/irq-loongarch-avec.c | 2 +- drivers/irqchip/irq-loongson-eiointc.c | 4 +- drivers/irqchip/irq-loongson-htpic.c | 2 +- drivers/irqchip/irq-loongson-htvec.c | 2 +- drivers/irqchip/irq-loongson-liointc.c | 2 +- drivers/irqchip/irq-loongson-pch-lpc.c | 2 +- drivers/irqchip/irq-loongson-pch-msi.c | 2 +- drivers/irqchip/irq-loongson-pch-pic.c | 2 +- drivers/irqchip/irq-lpc32xx.c | 2 +- drivers/irqchip/irq-ls1x.c | 2 +- drivers/irqchip/irq-mchp-eic.c | 2 +- drivers/irqchip/irq-meson-gpio.c | 2 +- drivers/irqchip/irq-mips-cpu.c | 2 +- drivers/irqchip/irq-mst-intc.c | 2 +- drivers/irqchip/irq-mtk-cirq.c | 2 +- drivers/irqchip/irq-mtk-sysirq.c | 2 +- drivers/irqchip/irq-mvebu-odmi.c | 2 +- drivers/irqchip/irq-owl-sirq.c | 2 +- drivers/irqchip/irq-pic32-evic.c | 2 +- drivers/irqchip/irq-riscv-imsic-state.c | 6 +- drivers/irqchip/irq-riscv-intc.c | 2 +- drivers/irqchip/irq-sifive-plic.c | 2 +- drivers/irqchip/irq-sni-exiu.c | 2 +- drivers/irqchip/irq-starfive-jh8100-intc.c | 2 +- drivers/irqchip/irq-stm32-exti.c | 2 +- drivers/irqchip/irq-sun4i.c | 4 +- drivers/irqchip/irq-tegra.c | 2 +- drivers/irqchip/irq-ti-sci-inta.c | 2 +- drivers/irqchip/irq-vf610-mscm-ir.c | 2 +- drivers/irqchip/irq-vt8500.c | 2 +- drivers/irqchip/irq-wpcm450-aic.c | 2 +- drivers/irqchip/irq-xilinx-intc.c | 2 +- drivers/irqchip/qcom-pdc.c | 2 +- drivers/isdn/capi/capi.c | 6 +- drivers/isdn/capi/capiutil.c | 4 +- drivers/isdn/hardware/mISDN/avmfritz.c | 2 +- drivers/isdn/hardware/mISDN/hfcmulti.c | 10 +- drivers/isdn/hardware/mISDN/hfcpci.c | 2 +- drivers/isdn/hardware/mISDN/hfcsusb.c | 4 +- drivers/isdn/hardware/mISDN/mISDNinfineon.c | 4 +- drivers/isdn/hardware/mISDN/netjet.c | 2 +- drivers/isdn/hardware/mISDN/speedfax.c | 2 +- drivers/isdn/hardware/mISDN/w6692.c | 2 +- drivers/isdn/mISDN/l1oip_core.c | 4 +- drivers/isdn/mISDN/layer2.c | 2 +- drivers/isdn/mISDN/stack.c | 2 +- drivers/isdn/mISDN/tei.c | 6 +- drivers/isdn/mISDN/timerdev.c | 4 +- drivers/leds/led-triggers.c | 2 +- drivers/leds/rgb/leds-qcom-lpg.c | 2 +- drivers/leds/trigger/ledtrig-activity.c | 2 +- drivers/leds/trigger/ledtrig-backlight.c | 2 +- drivers/leds/trigger/ledtrig-gpio.c | 2 +- drivers/leds/trigger/ledtrig-heartbeat.c | 2 +- drivers/leds/trigger/ledtrig-input-events.c | 2 +- drivers/leds/trigger/ledtrig-netdev.c | 2 +- drivers/leds/trigger/ledtrig-oneshot.c | 2 +- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- drivers/leds/trigger/ledtrig-tty.c | 2 +- drivers/leds/uleds.c | 2 +- drivers/macintosh/adb.c | 4 +- drivers/macintosh/adbhid.c | 2 +- drivers/macintosh/mac_hid.c | 2 +- drivers/macintosh/macio_asic.c | 2 +- drivers/macintosh/rack-meter.c | 2 +- drivers/macintosh/smu.c | 2 +- drivers/macintosh/therm_adt746x.c | 2 +- drivers/macintosh/via-pmu.c | 2 +- drivers/macintosh/windfarm_ad7417_sensor.c | 2 +- drivers/macintosh/windfarm_cpufreq_clamp.c | 2 +- drivers/macintosh/windfarm_fcu_controls.c | 4 +- drivers/macintosh/windfarm_lm75_sensor.c | 2 +- drivers/macintosh/windfarm_lm87_sensor.c | 2 +- drivers/macintosh/windfarm_max6690_sensor.c | 2 +- drivers/macintosh/windfarm_pm121.c | 2 +- drivers/macintosh/windfarm_pm81.c | 4 +- drivers/macintosh/windfarm_pm91.c | 2 +- drivers/macintosh/windfarm_smu_controls.c | 2 +- drivers/macintosh/windfarm_smu_sat.c | 2 +- drivers/macintosh/windfarm_smu_sensors.c | 4 +- drivers/mcb/mcb-core.c | 4 +- drivers/mcb/mcb-parse.c | 4 +- drivers/md/bcache/alloc.c | 2 +- drivers/md/bcache/debug.c | 2 +- drivers/md/bcache/super.c | 14 +-- drivers/md/bcache/sysfs.c | 2 +- drivers/md/dm-bio-prison-v1.c | 2 +- drivers/md/dm-bio-prison-v2.c | 2 +- drivers/md/dm-cache-background-tracker.c | 2 +- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-cache-policy-smq.c | 2 +- drivers/md/dm-cache-target.c | 4 +- drivers/md/dm-clone-metadata.c | 2 +- drivers/md/dm-clone-target.c | 4 +- drivers/md/dm-crypt.c | 2 +- drivers/md/dm-delay.c | 2 +- drivers/md/dm-dust.c | 4 +- drivers/md/dm-ebs-target.c | 2 +- drivers/md/dm-era-target.c | 4 +- drivers/md/dm-exception-store.c | 2 +- drivers/md/dm-flakey.c | 2 +- drivers/md/dm-init.c | 4 +- drivers/md/dm-integrity.c | 4 +- drivers/md/dm-io.c | 2 +- drivers/md/dm-ioctl.c | 4 +- drivers/md/dm-kcopyd.c | 2 +- drivers/md/dm-linear.c | 2 +- drivers/md/dm-log-userspace-base.c | 2 +- drivers/md/dm-log-writes.c | 4 +- drivers/md/dm-log.c | 4 +- drivers/md/dm-mpath.c | 6 +- drivers/md/dm-path-selector.c | 2 +- drivers/md/dm-pcache/dm_pcache.c | 2 +- drivers/md/dm-ps-historical-service-time.c | 4 +- drivers/md/dm-ps-io-affinity.c | 6 +- drivers/md/dm-ps-queue-length.c | 4 +- drivers/md/dm-ps-round-robin.c | 4 +- drivers/md/dm-ps-service-time.c | 4 +- drivers/md/dm-region-hash.c | 2 +- drivers/md/dm-snap-persistent.c | 2 +- drivers/md/dm-snap-transient.c | 2 +- drivers/md/dm-snap.c | 10 +- drivers/md/dm-table.c | 6 +- drivers/md/dm-target.c | 2 +- drivers/md/dm-thin-metadata.c | 2 +- drivers/md/dm-thin.c | 6 +- drivers/md/dm-unstripe.c | 2 +- drivers/md/dm-verity-fec.c | 2 +- drivers/md/dm-verity-target.c | 4 +- drivers/md/dm-writecache.c | 2 +- drivers/md/dm-zoned-metadata.c | 6 +- drivers/md/dm-zoned-reclaim.c | 2 +- drivers/md/dm-zoned-target.c | 6 +- drivers/md/md-bitmap.c | 6 +- drivers/md/md-cluster.c | 4 +- drivers/md/md-llbitmap.c | 2 +- drivers/md/md.c | 12 +-- drivers/md/persistent-data/dm-block-manager.c | 2 +- drivers/md/persistent-data/dm-space-map-disk.c | 4 +- drivers/md/persistent-data/dm-space-map-metadata.c | 2 +- .../md/persistent-data/dm-transaction-manager.c | 4 +- drivers/md/raid0.c | 2 +- drivers/md/raid1.c | 6 +- drivers/md/raid10.c | 2 +- drivers/md/raid5-cache.c | 4 +- drivers/md/raid5-ppl.c | 2 +- drivers/md/raid5.c | 6 +- drivers/media/cec/core/cec-adap.c | 6 +- drivers/media/cec/core/cec-api.c | 2 +- drivers/media/cec/core/cec-core.c | 2 +- drivers/media/cec/core/cec-notifier.c | 2 +- drivers/media/cec/core/cec-pin.c | 2 +- .../extron-da-hd-4k-plus/extron-da-hd-4k-plus.c | 4 +- drivers/media/cec/usb/pulse8/pulse8-cec.c | 2 +- drivers/media/cec/usb/rainshadow/rainshadow-cec.c | 2 +- drivers/media/common/cypress_firmware.c | 2 +- drivers/media/common/saa7146/saa7146_core.c | 4 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/common/siano/smscoreapi.c | 12 +-- drivers/media/common/siano/smsdvb-debugfs.c | 2 +- drivers/media/common/siano/smsdvb-main.c | 2 +- drivers/media/common/videobuf2/videobuf2-core.c | 6 +- .../media/common/videobuf2/videobuf2-dma-contig.c | 12 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 10 +- drivers/media/common/videobuf2/videobuf2-dvb.c | 2 +- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 6 +- drivers/media/dvb-core/dmxdev.c | 2 +- drivers/media/dvb-core/dvb_ca_en50221.c | 4 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-core/dvbdev.c | 14 +-- drivers/media/dvb-frontends/a8293.c | 2 +- drivers/media/dvb-frontends/af9013.c | 2 +- drivers/media/dvb-frontends/af9033.c | 2 +- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/ascot2e.c | 2 +- drivers/media/dvb-frontends/atbm8830.c | 2 +- drivers/media/dvb-frontends/bcm3510.c | 2 +- drivers/media/dvb-frontends/cx22700.c | 2 +- drivers/media/dvb-frontends/cx22702.c | 2 +- drivers/media/dvb-frontends/cx24110.c | 2 +- drivers/media/dvb-frontends/cx24113.c | 2 +- drivers/media/dvb-frontends/cx24116.c | 2 +- drivers/media/dvb-frontends/cx24117.c | 2 +- drivers/media/dvb-frontends/cx24120.c | 2 +- drivers/media/dvb-frontends/cx24123.c | 2 +- drivers/media/dvb-frontends/cxd2099.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/dvb-frontends/cxd2841er.c | 2 +- drivers/media/dvb-frontends/cxd2880/cxd2880_top.c | 2 +- drivers/media/dvb-frontends/dib0090.c | 2 +- drivers/media/dvb-frontends/dib3000mb.c | 2 +- drivers/media/dvb-frontends/dib3000mc.c | 4 +- drivers/media/dvb-frontends/dib7000m.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 4 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 4 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 +- drivers/media/dvb-frontends/drxd_hard.c | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 2 +- drivers/media/dvb-frontends/ds3000.c | 2 +- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/dvb_dummy_fe.c | 6 +- drivers/media/dvb-frontends/ec100.c | 2 +- drivers/media/dvb-frontends/gp8psk-fe.c | 2 +- drivers/media/dvb-frontends/helene.c | 4 +- drivers/media/dvb-frontends/horus3a.c | 2 +- drivers/media/dvb-frontends/isl6405.c | 2 +- drivers/media/dvb-frontends/isl6421.c | 2 +- drivers/media/dvb-frontends/isl6423.c | 2 +- drivers/media/dvb-frontends/itd1000.c | 2 +- drivers/media/dvb-frontends/ix2505v.c | 2 +- drivers/media/dvb-frontends/l64781.c | 2 +- drivers/media/dvb-frontends/lg2160.c | 2 +- drivers/media/dvb-frontends/lgdt3305.c | 2 +- drivers/media/dvb-frontends/lgdt3306a.c | 2 +- drivers/media/dvb-frontends/lgdt330x.c | 2 +- drivers/media/dvb-frontends/lgs8gl5.c | 2 +- drivers/media/dvb-frontends/lgs8gxx.c | 2 +- drivers/media/dvb-frontends/lnbh25.c | 2 +- drivers/media/dvb-frontends/lnbh29.c | 2 +- drivers/media/dvb-frontends/lnbp21.c | 2 +- drivers/media/dvb-frontends/lnbp22.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 2 +- drivers/media/dvb-frontends/m88rs2000.c | 2 +- drivers/media/dvb-frontends/mb86a16.c | 2 +- drivers/media/dvb-frontends/mb86a20s.c | 2 +- drivers/media/dvb-frontends/mn88472.c | 2 +- drivers/media/dvb-frontends/mn88473.c | 2 +- drivers/media/dvb-frontends/mt312.c | 2 +- drivers/media/dvb-frontends/mt352.c | 2 +- drivers/media/dvb-frontends/mxl5xx.c | 4 +- drivers/media/dvb-frontends/mxl692.c | 2 +- drivers/media/dvb-frontends/nxt200x.c | 2 +- drivers/media/dvb-frontends/nxt6000.c | 2 +- drivers/media/dvb-frontends/or51132.c | 2 +- drivers/media/dvb-frontends/or51211.c | 2 +- drivers/media/dvb-frontends/rtl2830.c | 2 +- drivers/media/dvb-frontends/rtl2832.c | 2 +- drivers/media/dvb-frontends/rtl2832_sdr.c | 2 +- drivers/media/dvb-frontends/s5h1409.c | 2 +- drivers/media/dvb-frontends/s5h1411.c | 2 +- drivers/media/dvb-frontends/s5h1432.c | 2 +- drivers/media/dvb-frontends/s921.c | 2 +- drivers/media/dvb-frontends/si2165.c | 2 +- drivers/media/dvb-frontends/si2168.c | 2 +- drivers/media/dvb-frontends/si21xx.c | 2 +- drivers/media/dvb-frontends/sp2.c | 2 +- drivers/media/dvb-frontends/sp887x.c | 2 +- drivers/media/dvb-frontends/stb0899_drv.c | 2 +- drivers/media/dvb-frontends/stb6000.c | 2 +- drivers/media/dvb-frontends/stb6100.c | 2 +- drivers/media/dvb-frontends/stv0288.c | 2 +- drivers/media/dvb-frontends/stv0297.c | 2 +- drivers/media/dvb-frontends/stv0299.c | 2 +- drivers/media/dvb-frontends/stv0367.c | 14 +-- drivers/media/dvb-frontends/stv0900_core.c | 4 +- drivers/media/dvb-frontends/stv090x.c | 8 +- drivers/media/dvb-frontends/stv0910.c | 4 +- drivers/media/dvb-frontends/stv6110.c | 2 +- drivers/media/dvb-frontends/stv6110x.c | 4 +- drivers/media/dvb-frontends/stv6111.c | 2 +- drivers/media/dvb-frontends/tc90522.c | 4 +- drivers/media/dvb-frontends/tda10021.c | 2 +- drivers/media/dvb-frontends/tda10023.c | 2 +- drivers/media/dvb-frontends/tda10048.c | 2 +- drivers/media/dvb-frontends/tda1004x.c | 4 +- drivers/media/dvb-frontends/tda10071.c | 2 +- drivers/media/dvb-frontends/tda10086.c | 2 +- drivers/media/dvb-frontends/tda18271c2dd.c | 2 +- drivers/media/dvb-frontends/tda665x.c | 2 +- drivers/media/dvb-frontends/tda8083.c | 2 +- drivers/media/dvb-frontends/tda8261.c | 2 +- drivers/media/dvb-frontends/tda826x.c | 2 +- drivers/media/dvb-frontends/ts2020.c | 2 +- drivers/media/dvb-frontends/tua6100.c | 2 +- drivers/media/dvb-frontends/ves1820.c | 2 +- drivers/media/dvb-frontends/ves1x93.c | 2 +- drivers/media/dvb-frontends/zd1301_demod.c | 2 +- drivers/media/dvb-frontends/zl10036.c | 2 +- drivers/media/dvb-frontends/zl10039.c | 2 +- drivers/media/dvb-frontends/zl10353.c | 2 +- drivers/media/firewire/firedtv-fw.c | 4 +- drivers/media/i2c/alvium-csi2.c | 2 +- drivers/media/i2c/cs3308.c | 2 +- drivers/media/i2c/ds90ub960.c | 4 +- drivers/media/i2c/tda1997x.c | 2 +- drivers/media/i2c/video-i2c.c | 2 +- drivers/media/mc/mc-dev-allocator.c | 2 +- drivers/media/mc/mc-device.c | 2 +- drivers/media/mc/mc-entity.c | 8 +- drivers/media/mc/mc-request.c | 2 +- drivers/media/mmc/siano/smssdio.c | 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/bt8xx/bttv-gpio.c | 2 +- drivers/media/pci/bt8xx/bttv-input.c | 2 +- drivers/media/pci/bt8xx/dst_ca.c | 8 +- drivers/media/pci/bt8xx/dvb-bt8xx.c | 4 +- drivers/media/pci/cobalt/cobalt-alsa-main.c | 2 +- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- drivers/media/pci/cx18/cx18-alsa-main.c | 2 +- drivers/media/pci/cx18/cx18-driver.c | 4 +- drivers/media/pci/cx18/cx18-fileops.c | 2 +- drivers/media/pci/cx18/cx18-streams.c | 2 +- drivers/media/pci/cx23885/altera-ci.c | 12 +-- drivers/media/pci/cx23885/cimax2.c | 2 +- drivers/media/pci/cx23885/cx23885-alsa.c | 2 +- drivers/media/pci/cx23885/cx23885-core.c | 2 +- drivers/media/pci/cx23885/cx23885-input.c | 2 +- drivers/media/pci/cx23885/cx23888-ir.c | 2 +- drivers/media/pci/cx25821/cx25821-alsa.c | 2 +- drivers/media/pci/cx25821/cx25821-core.c | 2 +- drivers/media/pci/cx88/cx88-alsa.c | 2 +- drivers/media/pci/cx88/cx88-cards.c | 2 +- drivers/media/pci/cx88/cx88-dsp.c | 2 +- drivers/media/pci/cx88/cx88-input.c | 2 +- drivers/media/pci/cx88/cx88-mpeg.c | 4 +- drivers/media/pci/cx88/cx88-video.c | 2 +- drivers/media/pci/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/pci/ddbridge/ddbridge-ci.c | 4 +- drivers/media/pci/ddbridge/ddbridge-dummy-fe.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 2 +- drivers/media/pci/intel/ipu-bridge.c | 4 +- drivers/media/pci/intel/ipu6/ipu6-bus.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-buttress.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-dma.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-fw-com.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 +- drivers/media/pci/intel/ipu6/ipu6.c | 4 +- drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 +- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- drivers/media/pci/mantis/hopper_cards.c | 2 +- drivers/media/pci/mantis/mantis_ca.c | 2 +- drivers/media/pci/mantis/mantis_cards.c | 2 +- drivers/media/pci/mgb4/mgb4_core.c | 2 +- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 2 +- drivers/media/pci/pt1/pt1.c | 4 +- drivers/media/pci/pt3/pt3.c | 2 +- drivers/media/pci/saa7134/saa7134-alsa.c | 2 +- drivers/media/pci/saa7134/saa7134-core.c | 4 +- drivers/media/pci/saa7134/saa7134-go7007.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 2 +- drivers/media/pci/saa7146/hexium_gemini.c | 2 +- drivers/media/pci/saa7146/hexium_orion.c | 2 +- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/saa7164/saa7164-buffer.c | 4 +- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/saa7164/saa7164-encoder.c | 2 +- drivers/media/pci/saa7164/saa7164-vbi.c | 2 +- drivers/media/pci/smipcie/smipcie-main.c | 2 +- drivers/media/pci/solo6x10/solo6x10-core.c | 2 +- drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 2 +- drivers/media/pci/ttpci/budget-av.c | 2 +- drivers/media/pci/ttpci/budget-ci.c | 2 +- drivers/media/pci/ttpci/budget.c | 2 +- drivers/media/pci/tw686x/tw686x-core.c | 2 +- drivers/media/pci/zoran/videocodec.c | 4 +- drivers/media/pci/zoran/zr36016.c | 2 +- drivers/media/pci/zoran/zr36050.c | 2 +- drivers/media/pci/zoran/zr36060.c | 2 +- drivers/media/platform/allegro-dvt/allegro-core.c | 14 +-- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 2 +- drivers/media/platform/amphion/vdec.c | 4 +- drivers/media/platform/amphion/venc.c | 6 +- drivers/media/platform/amphion/vpu_cmds.c | 4 +- drivers/media/platform/broadcom/bcm2835-unicam.c | 2 +- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- drivers/media/platform/cadence/cdns-csi2tx.c | 2 +- drivers/media/platform/chips-media/coda/coda-bit.c | 2 +- .../media/platform/chips-media/coda/coda-common.c | 2 +- .../media/platform/chips-media/coda/coda-jpeg.c | 6 +- drivers/media/platform/chips-media/coda/imx-vdoa.c | 2 +- .../platform/chips-media/wave5/wave5-vpu-dec.c | 4 +- .../platform/chips-media/wave5/wave5-vpu-enc.c | 4 +- .../media/platform/imagination/e5010-jpeg-enc.c | 2 +- drivers/media/platform/intel/pxa_camera.c | 2 +- drivers/media/platform/m2m-deinterlace.c | 2 +- drivers/media/platform/marvell/cafe-driver.c | 4 +- .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 2 +- drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c | 2 +- .../media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 6 +- .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 +- .../media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 2 +- .../mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 2 +- .../mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 2 +- .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 2 +- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_h264_if.c | 2 +- .../vcodec/decoder/vdec/vdec_h264_req_if.c | 2 +- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 2 +- .../vcodec/decoder/vdec/vdec_hevc_req_multi_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_vp8_if.c | 2 +- .../mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c | 2 +- .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 2 +- .../mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c | 2 +- .../mediatek/vcodec/encoder/venc/venc_h264_if.c | 2 +- .../mediatek/vcodec/encoder/venc/venc_vp8_if.c | 2 +- drivers/media/platform/nuvoton/npcm-video.c | 6 +- .../media/platform/nvidia/tegra-vde/dmabuf-cache.c | 2 +- drivers/media/platform/nvidia/tegra-vde/vde.c | 2 +- drivers/media/platform/nxp/dw100/dw100.c | 2 +- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 +- drivers/media/platform/nxp/imx-pxp.c | 2 +- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 6 +- drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c | 2 +- drivers/media/platform/nxp/mx2_emmaprp.c | 2 +- drivers/media/platform/qcom/iris/iris_buffer.c | 2 +- .../platform/qcom/iris/iris_hfi_gen1_command.c | 2 +- .../platform/qcom/iris/iris_hfi_gen2_command.c | 2 +- drivers/media/platform/qcom/iris/iris_vdec.c | 4 +- drivers/media/platform/qcom/iris/iris_venc.c | 4 +- drivers/media/platform/qcom/venus/core.c | 4 +- drivers/media/platform/qcom/venus/helpers.c | 4 +- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 2 +- drivers/media/platform/raspberrypi/rp1-cfe/cfe.c | 2 +- .../media/platform/renesas/rcar-vin/rcar-core.c | 2 +- drivers/media/platform/renesas/rcar_fdp1.c | 2 +- drivers/media/platform/renesas/rcar_jpu.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 2 +- drivers/media/platform/renesas/vsp1/vsp1_dl.c | 10 +- drivers/media/platform/renesas/vsp1/vsp1_video.c | 4 +- drivers/media/platform/rockchip/rga/rga.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-h264.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-hevc.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c | 2 +- .../platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 2 +- .../media/platform/rockchip/rkvdec/rkvdec-vp9.c | 2 +- drivers/media/platform/rockchip/rkvdec/rkvdec.c | 2 +- .../media/platform/samsung/exynos-gsc/gsc-m2m.c | 2 +- .../platform/samsung/exynos4-is/fimc-capture.c | 2 +- .../media/platform/samsung/exynos4-is/fimc-m2m.c | 2 +- .../media/platform/samsung/exynos4-is/media-dev.c | 2 +- drivers/media/platform/samsung/s5p-g2d/g2d.c | 2 +- .../media/platform/samsung/s5p-jpeg/jpeg-core.c | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 2 +- drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 2 +- .../media/platform/st/sti/delta/delta-mjpeg-dec.c | 2 +- drivers/media/platform/st/sti/delta/delta-v4l2.c | 4 +- drivers/media/platform/st/sti/hva/hva-v4l2.c | 2 +- drivers/media/platform/st/stm32/dma2d/dma2d.c | 2 +- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 2 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 2 +- .../platform/st/stm32/stm32-dcmipp/dcmipp-common.c | 2 +- .../platform/st/stm32/stm32-dcmipp/dcmipp-input.c | 2 +- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 2 +- .../platform/sunxi/sun8i-rotate/sun8i_rotate.c | 2 +- drivers/media/platform/ti/cal/cal.c | 2 +- drivers/media/platform/ti/davinci/vpif.c | 6 +- drivers/media/platform/ti/davinci/vpif_capture.c | 4 +- drivers/media/platform/ti/davinci/vpif_display.c | 4 +- drivers/media/platform/ti/omap/omap_vout.c | 4 +- drivers/media/platform/ti/omap3isp/isp.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 2 +- drivers/media/platform/ti/omap3isp/isph3a_aewb.c | 4 +- drivers/media/platform/ti/omap3isp/isph3a_af.c | 4 +- drivers/media/platform/ti/omap3isp/isphist.c | 2 +- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 2 +- drivers/media/platform/ti/vpe/vip.c | 2 +- drivers/media/platform/ti/vpe/vpe.c | 2 +- drivers/media/platform/verisilicon/hantro_drv.c | 2 +- drivers/media/platform/via/via-camera.c | 2 +- drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/radio-aimslab.c | 2 +- drivers/media/radio/radio-aztech.c | 2 +- drivers/media/radio/radio-gemtek.c | 2 +- drivers/media/radio/radio-keene.c | 2 +- drivers/media/radio/radio-ma901.c | 2 +- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-mr800.c | 2 +- drivers/media/radio/radio-raremono.c | 2 +- drivers/media/radio/radio-rtrack2.c | 2 +- drivers/media/radio/radio-sf16fmr2.c | 4 +- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c | 2 +- drivers/media/radio/radio-tea5764.c | 2 +- drivers/media/radio/radio-terratec.c | 2 +- drivers/media/radio/radio-trust.c | 2 +- drivers/media/radio/radio-typhoon.c | 2 +- drivers/media/radio/radio-zoltrix.c | 2 +- drivers/media/radio/saa7706h.c | 2 +- drivers/media/radio/si470x/radio-si470x-usb.c | 2 +- drivers/media/radio/si4713/radio-usb-si4713.c | 2 +- drivers/media/radio/tef6862.c | 2 +- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/ene_ir.c | 2 +- drivers/media/rc/fintek-cir.c | 2 +- drivers/media/rc/iguanair.c | 2 +- drivers/media/rc/imon.c | 4 +- drivers/media/rc/ir_toy.c | 2 +- drivers/media/rc/ite-cir.c | 2 +- drivers/media/rc/lirc_dev.c | 4 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/nuvoton-cir.c | 2 +- drivers/media/rc/rc-ir-raw.c | 2 +- drivers/media/rc/rc-loopback.c | 2 +- drivers/media/rc/rc-main.c | 2 +- drivers/media/rc/redrat3.c | 8 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/rc/ttusbir.c | 2 +- drivers/media/rc/winbond-cir.c | 2 +- drivers/media/rc/xbox_remote.c | 2 +- drivers/media/spi/cxd2880-spi.c | 2 +- drivers/media/test-drivers/vicodec/vicodec-core.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 2 +- drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_demod.c | 2 +- drivers/media/test-drivers/vidtv/vidtv_mux.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_psi.c | 30 +++--- drivers/media/test-drivers/vidtv/vidtv_s302m.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_tuner.c | 2 +- drivers/media/test-drivers/vim2m.c | 4 +- drivers/media/test-drivers/vimc/vimc-capture.c | 2 +- drivers/media/test-drivers/vimc/vimc-core.c | 2 +- drivers/media/test-drivers/vimc/vimc-debayer.c | 2 +- drivers/media/test-drivers/vimc/vimc-lens.c | 2 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 2 +- drivers/media/test-drivers/vimc/vimc-sensor.c | 2 +- drivers/media/test-drivers/visl/visl-core.c | 4 +- drivers/media/test-drivers/visl/visl-debugfs.c | 2 +- drivers/media/test-drivers/vivid/vivid-core.c | 2 +- drivers/media/tuners/e4000.c | 2 +- drivers/media/tuners/fc0011.c | 2 +- drivers/media/tuners/fc0012.c | 2 +- drivers/media/tuners/fc0013.c | 2 +- drivers/media/tuners/fc2580.c | 2 +- drivers/media/tuners/it913x.c | 2 +- drivers/media/tuners/m88rs6000t.c | 2 +- drivers/media/tuners/max2165.c | 2 +- drivers/media/tuners/mc44s803.c | 2 +- drivers/media/tuners/msi001.c | 2 +- drivers/media/tuners/mt2060.c | 2 +- drivers/media/tuners/mt2063.c | 2 +- drivers/media/tuners/mt20xx.c | 2 +- drivers/media/tuners/mt2131.c | 2 +- drivers/media/tuners/mt2266.c | 2 +- drivers/media/tuners/mxl301rf.c | 2 +- drivers/media/tuners/mxl5005s.c | 2 +- drivers/media/tuners/qm1d1b0004.c | 2 +- drivers/media/tuners/qm1d1c0042.c | 2 +- drivers/media/tuners/qt1010.c | 2 +- drivers/media/tuners/si2157.c | 2 +- drivers/media/tuners/tda18212.c | 2 +- drivers/media/tuners/tda18218.c | 2 +- drivers/media/tuners/tda18250.c | 2 +- drivers/media/tuners/tda827x.c | 2 +- drivers/media/tuners/tda8290.c | 2 +- drivers/media/tuners/tea5761.c | 2 +- drivers/media/tuners/tea5767.c | 2 +- drivers/media/tuners/tua9001.c | 2 +- drivers/media/tuners/tuner-i2c.h | 2 +- drivers/media/tuners/xc2028.c | 2 +- drivers/media/tuners/xc4000.c | 2 +- drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/as102/as102_fw.c | 2 +- drivers/media/usb/as102/as102_usb_drv.c | 2 +- drivers/media/usb/au0828/au0828-core.c | 2 +- drivers/media/usb/au0828/au0828-input.c | 2 +- drivers/media/usb/cx231xx/cx231xx-cards.c | 4 +- drivers/media/usb/cx231xx/cx231xx-dvb.c | 2 +- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 +- drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 2 +- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 2 +- drivers/media/usb/dvb-usb/af9005-fe.c | 2 +- drivers/media/usb/dvb-usb/dtt200u-fe.c | 2 +- drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 2 +- drivers/media/usb/dvb-usb/dvb-usb-init.c | 2 +- drivers/media/usb/em28xx/em28xx-audio.c | 2 +- drivers/media/usb/em28xx/em28xx-cards.c | 4 +- drivers/media/usb/em28xx/em28xx-dvb.c | 2 +- drivers/media/usb/em28xx/em28xx-input.c | 4 +- drivers/media/usb/em28xx/em28xx-video.c | 2 +- drivers/media/usb/go7007/go7007-driver.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 2 +- drivers/media/usb/go7007/snd-go7007.c | 2 +- drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c | 4 +- drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/hdpvr/hdpvr-core.c | 2 +- drivers/media/usb/hdpvr/hdpvr-video.c | 4 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-context.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-io.c | 6 +- drivers/media/usb/pvrusb2/pvrusb2-ioread.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-sysfs.c | 8 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 8 +- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/s2255/s2255drv.c | 4 +- drivers/media/usb/siano/smsusb.c | 4 +- drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/usb/ttusb-dec/ttusb_dec.c | 2 +- drivers/media/usb/ttusb-dec/ttusbdecfe.c | 4 +- drivers/media/usb/usbtv/usbtv-core.c | 2 +- drivers/media/usb/uvc/uvc_ctrl.c | 4 +- drivers/media/usb/uvc/uvc_debugfs.c | 2 +- drivers/media/usb/uvc/uvc_driver.c | 6 +- drivers/media/usb/uvc/uvc_metadata.c | 2 +- drivers/media/usb/uvc/uvc_status.c | 2 +- drivers/media/usb/uvc/uvc_v4l2.c | 4 +- drivers/media/usb/uvc/uvc_video.c | 2 +- drivers/media/v4l2-core/tuner-core.c | 2 +- drivers/media/v4l2-core/v4l2-async.c | 2 +- drivers/media/v4l2-core/v4l2-ctrls-api.c | 4 +- drivers/media/v4l2-core/v4l2-ctrls-request.c | 4 +- drivers/media/v4l2-core/v4l2-dev.c | 2 +- drivers/media/v4l2-core/v4l2-device.c | 2 +- drivers/media/v4l2-core/v4l2-dv-timings.c | 2 +- drivers/media/v4l2-core/v4l2-fh.c | 2 +- drivers/media/v4l2-core/v4l2-fwnode.c | 4 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 4 +- drivers/media/v4l2-core/v4l2-subdev.c | 4 +- drivers/memory/samsung/exynos-srom.c | 2 +- drivers/memory/tegra/tegra124-emc.c | 2 +- drivers/memory/tegra/tegra124.c | 2 +- drivers/memory/tegra/tegra20-emc.c | 2 +- drivers/memory/tegra/tegra20.c | 4 +- drivers/memory/tegra/tegra30-emc.c | 2 +- drivers/memory/tegra/tegra30.c | 2 +- drivers/memstick/core/memstick.c | 2 +- drivers/memstick/core/ms_block.c | 6 +- drivers/memstick/core/mspro_block.c | 6 +- drivers/message/fusion/mptbase.c | 4 +- drivers/message/fusion/mptfc.c | 6 +- drivers/message/fusion/mptlan.c | 4 +- drivers/message/fusion/mptsas.c | 16 ++-- drivers/message/fusion/mptspi.c | 4 +- drivers/mfd/cros_ec_dev.c | 2 +- drivers/mfd/dln2.c | 4 +- drivers/mfd/ezx-pcap.c | 2 +- drivers/mfd/sm501.c | 4 +- drivers/mfd/syscon.c | 4 +- drivers/mfd/timberdale.c | 2 +- drivers/mfd/twl4030-irq.c | 2 +- drivers/mfd/ucb1x00-core.c | 4 +- drivers/mfd/ucb1x00-ts.c | 2 +- drivers/mfd/viperboard.c | 2 +- drivers/mfd/wm831x-auxadc.c | 2 +- drivers/misc/ad525x_dpot.c | 2 +- drivers/misc/altera-stapl/altera.c | 8 +- drivers/misc/apds9802als.c | 2 +- drivers/misc/apds990x.c | 2 +- drivers/misc/bcm-vk/bcm_vk_dev.c | 2 +- drivers/misc/bcm-vk/bcm_vk_sg.c | 2 +- drivers/misc/c2port/core.c | 2 +- drivers/misc/cardreader/rtsx_pcr.c | 6 +- drivers/misc/cs5535-mfgpt.c | 2 +- drivers/misc/eeprom/max6875.c | 2 +- drivers/misc/fastrpc.c | 18 ++-- drivers/misc/genwqe/card_base.c | 4 +- drivers/misc/genwqe/card_ddcb.c | 2 +- drivers/misc/genwqe/card_debugfs.c | 4 +- drivers/misc/genwqe/card_dev.c | 6 +- drivers/misc/hpilo.c | 4 +- drivers/misc/ibmasm/command.c | 2 +- drivers/misc/ibmasm/event.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 6 +- drivers/misc/ibmasm/module.c | 2 +- drivers/misc/ibmvmc.c | 2 +- drivers/misc/ics932s401.c | 2 +- drivers/misc/isl29003.c | 2 +- drivers/misc/keba/cp500.c | 10 +- drivers/misc/lan966x_pci.c | 2 +- drivers/misc/lis3lv02d/lis3lv02d.c | 2 +- drivers/misc/lkdtm/bugs.c | 4 +- drivers/misc/mei/bus.c | 2 +- drivers/misc/mei/client.c | 6 +- drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c | 2 +- drivers/misc/mei/hbm.c | 2 +- drivers/misc/mei/hdcp/mei_hdcp.c | 2 +- drivers/misc/mei/pxp/mei_pxp.c | 2 +- drivers/misc/mei/vsc-fw-loader.c | 2 +- drivers/misc/ntsync.c | 4 +- drivers/misc/ocxl/afu_irq.c | 2 +- drivers/misc/ocxl/context.c | 2 +- drivers/misc/ocxl/core.c | 4 +- drivers/misc/ocxl/file.c | 2 +- drivers/misc/ocxl/link.c | 6 +- drivers/misc/ocxl/pasid.c | 2 +- drivers/misc/pch_phub.c | 2 +- drivers/misc/phantom.c | 2 +- drivers/misc/rpmb-core.c | 2 +- drivers/misc/sgi-gru/grumain.c | 2 +- drivers/misc/sgi-gru/grutlbpurge.c | 2 +- drivers/misc/sgi-xp/xpc_uv.c | 4 +- drivers/misc/sram.c | 2 +- drivers/misc/tifm_core.c | 2 +- drivers/misc/tsl2550.c | 2 +- drivers/misc/uacce/uacce.c | 6 +- drivers/misc/vmw_balloon.c | 2 +- drivers/misc/vmw_vmci/vmci_context.c | 6 +- drivers/misc/vmw_vmci/vmci_datagram.c | 2 +- drivers/misc/vmw_vmci/vmci_doorbell.c | 2 +- drivers/misc/vmw_vmci/vmci_event.c | 2 +- drivers/misc/vmw_vmci/vmci_host.c | 2 +- drivers/misc/vmw_vmci/vmci_queue_pair.c | 4 +- drivers/mmc/core/block.c | 12 +-- drivers/mmc/core/bus.c | 2 +- drivers/mmc/core/mmc_test.c | 18 ++-- drivers/mmc/core/sdio_bus.c | 2 +- drivers/mmc/core/sdio_uart.c | 2 +- drivers/mmc/host/dw_mmc-rockchip.c | 2 +- drivers/mmc/host/dw_mmc.c | 2 +- drivers/mmc/host/mmc_spi.c | 2 +- drivers/mmc/host/of_mmc_spi.c | 2 +- drivers/mmc/host/ushc.c | 6 +- drivers/most/configfs.c | 6 +- drivers/most/core.c | 6 +- drivers/most/most_cdev.c | 2 +- drivers/most/most_snd.c | 4 +- drivers/most/most_usb.c | 12 +-- drivers/mtd/chips/cfi_cmdset_0001.c | 2 +- drivers/mtd/chips/cfi_cmdset_0002.c | 4 +- drivers/mtd/chips/cfi_cmdset_0020.c | 2 +- drivers/mtd/chips/map_absent.c | 2 +- drivers/mtd/chips/map_ram.c | 2 +- drivers/mtd/chips/map_rom.c | 2 +- drivers/mtd/devices/block2mtd.c | 2 +- drivers/mtd/devices/docg3.c | 4 +- drivers/mtd/devices/ms02-nv.c | 12 +-- drivers/mtd/devices/mtd_dataflash.c | 2 +- drivers/mtd/devices/mtd_intel_dg.c | 2 +- drivers/mtd/devices/mtdram.c | 2 +- drivers/mtd/devices/phram.c | 2 +- drivers/mtd/devices/pmc551.c | 4 +- drivers/mtd/devices/slram.c | 6 +- drivers/mtd/ftl.c | 6 +- drivers/mtd/inftlcore.c | 2 +- drivers/mtd/lpddr/lpddr_cmds.c | 4 +- drivers/mtd/lpddr/qinfo_probe.c | 2 +- drivers/mtd/maps/amd76xrom.c | 2 +- drivers/mtd/maps/ck804xrom.c | 2 +- drivers/mtd/maps/esb2rom.c | 2 +- drivers/mtd/maps/ichxrom.c | 2 +- drivers/mtd/maps/pci.c | 2 +- drivers/mtd/maps/pcmciamtd.c | 2 +- drivers/mtd/maps/pismo.c | 2 +- drivers/mtd/maps/plat-ram.c | 2 +- drivers/mtd/maps/pxa2xx-flash.c | 2 +- drivers/mtd/maps/sa1100-flash.c | 2 +- drivers/mtd/maps/sun_uflash.c | 2 +- drivers/mtd/maps/vmu-flash.c | 12 +-- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/mtd/mtdblock.c | 2 +- drivers/mtd/mtdblock_ro.c | 2 +- drivers/mtd/mtdchar.c | 6 +- drivers/mtd/mtdconcat.c | 2 +- drivers/mtd/mtdpart.c | 2 +- drivers/mtd/mtdswap.c | 4 +- drivers/mtd/nand/ecc-sw-bch.c | 2 +- drivers/mtd/nand/ecc-sw-hamming.c | 2 +- drivers/mtd/nand/onenand/generic.c | 2 +- drivers/mtd/nand/onenand/onenand_bbt.c | 2 +- drivers/mtd/nand/qpic_common.c | 4 +- drivers/mtd/nand/raw/au1550nd.c | 2 +- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/cs553x_nand.c | 2 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 4 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 2 +- drivers/mtd/nand/raw/nand_bbt.c | 2 +- drivers/mtd/nand/raw/nand_hynix.c | 2 +- drivers/mtd/nand/raw/nand_jedec.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 2 +- drivers/mtd/nand/raw/nand_onfi.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 8 +- drivers/mtd/nand/raw/pasemi_nand.c | 2 +- drivers/mtd/nand/raw/r852.c | 4 +- drivers/mtd/nand/raw/sharpsl.c | 2 +- drivers/mtd/nand/raw/txx9ndfmc.c | 2 +- drivers/mtd/nand/spi/core.c | 2 +- drivers/mtd/nand/spi/gigadevice.c | 2 +- drivers/mtd/nand/spi/macronix.c | 2 +- drivers/mtd/nftlcore.c | 2 +- drivers/mtd/parsers/brcm_u-boot.c | 2 +- drivers/mtd/parsers/ofpart_core.c | 4 +- drivers/mtd/parsers/qcomsmempart.c | 2 +- drivers/mtd/parsers/redboot.c | 2 +- drivers/mtd/parsers/scpart.c | 2 +- drivers/mtd/parsers/tplink_safeloader.c | 2 +- drivers/mtd/rfd_ftl.c | 4 +- drivers/mtd/sm_ftl.c | 10 +- drivers/mtd/spi-nor/core.c | 2 +- drivers/mtd/spi-nor/sfdp.c | 2 +- drivers/mtd/ssfdc.c | 2 +- drivers/mtd/tests/stresstest.c | 2 +- drivers/mtd/ubi/attach.c | 4 +- drivers/mtd/ubi/block.c | 2 +- drivers/mtd/ubi/build.c | 2 +- drivers/mtd/ubi/cdev.c | 6 +- drivers/mtd/ubi/eba.c | 8 +- drivers/mtd/ubi/fastmap.c | 4 +- drivers/mtd/ubi/gluebi.c | 2 +- drivers/mtd/ubi/kapi.c | 2 +- drivers/mtd/ubi/nvmem.c | 2 +- drivers/mtd/ubi/vmt.c | 2 +- drivers/mtd/ubi/vtbl.c | 4 +- drivers/mux/core.c | 2 +- drivers/net/arcnet/com20020_cs.c | 2 +- drivers/net/bonding/bond_main.c | 6 +- drivers/net/can/ctucanfd/ctucanfd_pci.c | 2 +- drivers/net/can/grcan.c | 2 +- drivers/net/can/sja1000/ems_pci.c | 2 +- drivers/net/can/sja1000/ems_pcmcia.c | 2 +- drivers/net/can/sja1000/peak_pci.c | 2 +- drivers/net/can/sja1000/peak_pcmcia.c | 2 +- drivers/net/can/sja1000/plx_pci.c | 2 +- drivers/net/can/softing/softing_cs.c | 2 +- drivers/net/can/softing/softing_main.c | 2 +- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 +- drivers/net/can/usb/esd_usb.c | 12 +-- drivers/net/can/usb/f81604.c | 4 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 18 ++-- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 12 +-- drivers/net/can/usb/nct6694_canfd.c | 6 +- drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 +- drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 6 +- drivers/net/dsa/bcm_sf2_cfp.c | 2 +- drivers/net/dsa/hirschmann/hellcreek.c | 4 +- drivers/net/dsa/microchip/ksz9477_acl.c | 2 +- drivers/net/dsa/microchip/ksz_common.c | 2 +- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/mv88e6xxx/pcs-6185.c | 2 +- drivers/net/dsa/mv88e6xxx/pcs-6352.c | 2 +- drivers/net/dsa/mv88e6xxx/pcs-639x.c | 2 +- drivers/net/dsa/ocelot/felix.c | 6 +- drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +- drivers/net/dsa/sja1105/sja1105_flower.c | 4 +- drivers/net/dsa/sja1105/sja1105_vl.c | 6 +- drivers/net/dsa/vitesse-vsc73xx-core.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ethernet/agere/et131x.c | 4 +- drivers/net/ethernet/airoha/airoha_npu.c | 6 +- drivers/net/ethernet/airoha/airoha_ppe.c | 2 +- drivers/net/ethernet/alacritech/slicoss.c | 4 +- drivers/net/ethernet/alteon/acenic.c | 2 +- drivers/net/ethernet/altera/altera_tse_main.c | 4 +- drivers/net/ethernet/amd/pcnet32.c | 4 +- drivers/net/ethernet/amd/pds_core/auxbus.c | 2 +- drivers/net/ethernet/amd/pds_core/dev.c | 2 +- drivers/net/ethernet/amd/pds_core/main.c | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-selftest.c | 2 +- drivers/net/ethernet/apm/xgene-v2/main.c | 2 +- .../net/ethernet/aquantia/atlantic/aq_filters.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_macsec.c | 2 +- .../net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 2 +- drivers/net/ethernet/atheros/ag71xx.c | 2 +- drivers/net/ethernet/atheros/alx/main.c | 10 +- drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +- drivers/net/ethernet/broadcom/bcmsysport.c | 2 +- drivers/net/ethernet/broadcom/bnge/bnge_auxr.c | 6 +- drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c | 2 +- drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c | 4 +- drivers/net/ethernet/broadcom/bnge/bnge_netdev.c | 12 +-- drivers/net/ethernet/broadcom/bnge/bnge_resc.c | 2 +- drivers/net/ethernet/broadcom/bnge/bnge_rmem.c | 2 +- drivers/net/ethernet/broadcom/bnx2.c | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 10 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 28 +++--- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 8 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +- drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 6 +- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 2 +- drivers/net/ethernet/broadcom/cnic.c | 2 +- drivers/net/ethernet/brocade/bna/bnad.c | 2 +- drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 8 +- drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 4 +- drivers/net/ethernet/cadence/macb_main.c | 2 +- drivers/net/ethernet/cavium/liquidio/lio_core.c | 6 +- .../net/ethernet/cavium/liquidio/octeon_device.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 2 +- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 +- drivers/net/ethernet/chelsio/cxgb/espi.c | 2 +- drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c | 2 +- drivers/net/ethernet/chelsio/cxgb/mv88x201x.c | 2 +- drivers/net/ethernet/chelsio/cxgb/my3126.c | 2 +- drivers/net/ethernet/chelsio/cxgb/sge.c | 4 +- drivers/net/ethernet/chelsio/cxgb/tp.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 16 ++-- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 2 +- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c | 2 +- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c | 4 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 10 +- drivers/net/ethernet/chelsio/cxgb4/sched.c | 4 +- drivers/net/ethernet/chelsio/cxgb4/srq.c | 2 +- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 4 +- .../chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c | 4 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 4 +- .../chelsio/inline_crypto/chtls/chtls_cm.c | 4 +- .../chelsio/inline_crypto/chtls/chtls_main.c | 8 +- drivers/net/ethernet/cisco/enic/enic_main.c | 8 +- drivers/net/ethernet/cisco/enic/vnic_dev.c | 4 +- drivers/net/ethernet/cortina/gemini.c | 4 +- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- drivers/net/ethernet/engleder/tsnep_rxnfc.c | 2 +- drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 2 +- .../ethernet/freescale/dpaa2/dpaa2-eth-devlink.c | 2 +- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 6 +- .../ethernet/freescale/dpaa2/dpaa2-switch-flower.c | 8 +- .../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 +- drivers/net/ethernet/freescale/enetc/enetc.c | 6 +- drivers/net/ethernet/freescale/enetc/enetc_pf.c | 2 +- drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 2 +- drivers/net/ethernet/freescale/enetc/enetc_qos.c | 6 +- drivers/net/ethernet/freescale/fec_main.c | 8 +- drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 2 +- drivers/net/ethernet/freescale/fman/fman.c | 6 +- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 4 +- drivers/net/ethernet/freescale/fman/fman_keygen.c | 2 +- drivers/net/ethernet/freescale/fman/fman_mac.h | 4 +- drivers/net/ethernet/freescale/fman/fman_memac.c | 4 +- drivers/net/ethernet/freescale/fman/fman_muram.c | 2 +- drivers/net/ethernet/freescale/fman/fman_port.c | 4 +- drivers/net/ethernet/freescale/fman/fman_tgec.c | 4 +- .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 +- .../net/ethernet/freescale/fs_enet/mii-bitbang.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 2 +- drivers/net/ethernet/freescale/gianfar.c | 2 +- drivers/net/ethernet/freescale/gianfar_ethtool.c | 4 +- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- drivers/net/ethernet/fungible/funcore/fun_dev.c | 2 +- drivers/net/ethernet/fungible/funcore/fun_queue.c | 2 +- drivers/net/ethernet/fungible/funeth/funeth_main.c | 8 +- drivers/net/ethernet/google/gve/gve_ethtool.c | 2 +- drivers/net/ethernet/google/gve/gve_flow_rule.c | 2 +- drivers/net/ethernet/google/gve/gve_main.c | 6 +- drivers/net/ethernet/google/gve/gve_ptp.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 6 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 6 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_regs.c | 8 +- drivers/net/ethernet/huawei/hinic/hinic_debugfs.c | 4 +- drivers/net/ethernet/huawei/hinic/hinic_devlink.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c | 6 +- drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_port.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_lld.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c | 4 +- drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c | 6 +- drivers/net/ethernet/huawei/hinic3/hinic3_rx.c | 2 +- drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 2 +- drivers/net/ethernet/ibm/ehea/ehea_main.c | 6 +- drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 12 +-- drivers/net/ethernet/ibm/ibmveth.c | 2 +- drivers/net/ethernet/ibm/ibmvnic.c | 10 +- drivers/net/ethernet/intel/e100.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 6 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 22 ++--- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 +- drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 +- drivers/net/ethernet/intel/ice/devlink/port.c | 2 +- drivers/net/ethernet/intel/ice/ice_adapter.c | 2 +- drivers/net/ethernet/intel/ice/ice_arfs.c | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_common.c | 10 +- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 8 +- drivers/net/ethernet/intel/ice/ice_dpll.c | 4 +- drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 16 ++-- drivers/net/ethernet/intel/ice/ice_ethtool.c | 16 ++-- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 +- drivers/net/ethernet/intel/ice/ice_flow.c | 8 +- drivers/net/ethernet/intel/ice/ice_fw_update.c | 2 +- drivers/net/ethernet/intel/ice/ice_gnss.c | 2 +- drivers/net/ethernet/intel/ice/ice_idc.c | 6 +- drivers/net/ethernet/intel/ice/ice_irq.c | 2 +- drivers/net/ethernet/intel/ice/ice_lag.c | 4 +- drivers/net/ethernet/intel/ice/ice_lib.c | 16 ++-- drivers/net/ethernet/intel/ice/ice_main.c | 32 +++---- drivers/net/ethernet/intel/ice/ice_parser.c | 4 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- drivers/net/ethernet/intel/ice/ice_repr.c | 2 +- drivers/net/ethernet/intel/ice/ice_sf_eth.c | 2 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 2 +- drivers/net/ethernet/intel/ice/ice_switch.c | 14 +-- drivers/net/ethernet/intel/ice/ice_tc_lib.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 2 +- drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c | 26 +++--- drivers/net/ethernet/intel/ice/virt/fdir.c | 6 +- drivers/net/ethernet/intel/ice/virt/rss.c | 2 +- drivers/net/ethernet/intel/ice/virt/virtchnl.c | 4 +- drivers/net/ethernet/intel/idpf/idpf_controlq.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_dev.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_idc.c | 10 +- drivers/net/ethernet/intel/idpf/idpf_lib.c | 8 +- drivers/net/ethernet/intel/idpf/idpf_main.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_ptp.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 +- drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 16 ++-- .../net/ethernet/intel/idpf/idpf_virtchnl_ptp.c | 2 +- drivers/net/ethernet/intel/idpf/xdp.c | 2 +- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/intel/igbvf/netdev.c | 6 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- drivers/net/ethernet/intel/igc/igc_leds.c | 2 +- drivers/net/ethernet/intel/ixgbe/devlink/devlink.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 +-- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 2 +- drivers/net/ethernet/intel/ixgbevf/ipsec.c | 2 +- drivers/net/ethernet/intel/libie/fwlog.c | 6 +- drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 2 +- .../net/ethernet/marvell/octeon_ep/octep_main.c | 2 +- .../ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 4 +- drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 2 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 2 +- .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 2 +- .../ethernet/marvell/octeontx2/af/rvu_devlink.c | 8 +- .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 8 +- .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 +- .../ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 4 +- .../ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 6 +- .../ethernet/marvell/octeontx2/nic/otx2_common.c | 4 +- .../ethernet/marvell/octeontx2/nic/otx2_flows.c | 4 +- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +- .../net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +- .../net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 2 +- drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 18 ++-- drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 6 +- .../net/ethernet/marvell/prestera/prestera_acl.c | 10 +- .../ethernet/marvell/prestera/prestera_counter.c | 6 +- .../ethernet/marvell/prestera/prestera_devlink.c | 2 +- .../net/ethernet/marvell/prestera/prestera_flow.c | 4 +- .../ethernet/marvell/prestera/prestera_flower.c | 2 +- .../net/ethernet/marvell/prestera/prestera_hw.c | 2 +- .../net/ethernet/marvell/prestera/prestera_main.c | 8 +- .../ethernet/marvell/prestera/prestera_router.c | 6 +- .../ethernet/marvell/prestera/prestera_router_hw.c | 10 +- .../net/ethernet/marvell/prestera/prestera_rxtx.c | 6 +- .../net/ethernet/marvell/prestera/prestera_span.c | 4 +- .../ethernet/marvell/prestera/prestera_switchdev.c | 14 +-- drivers/net/ethernet/marvell/pxa168_eth.c | 4 +- drivers/net/ethernet/marvell/skge.c | 2 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 2 +- drivers/net/ethernet/mediatek/mtk_wed.c | 8 +- drivers/net/ethernet/mellanox/mlx4/alloc.c | 6 +- drivers/net/ethernet/mellanox/mlx4/cmd.c | 6 +- drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 16 ++-- drivers/net/ethernet/mellanox/mlx4/en_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +- drivers/net/ethernet/mellanox/mlx4/eq.c | 2 +- drivers/net/ethernet/mellanox/mlx4/icm.c | 2 +- drivers/net/ethernet/mellanox/mlx4/intf.c | 2 +- drivers/net/ethernet/mellanox/mlx4/main.c | 22 ++--- drivers/net/ethernet/mellanox/mlx4/mcg.c | 10 +- drivers/net/ethernet/mellanox/mlx4/pd.c | 2 +- drivers/net/ethernet/mellanox/mlx4/profile.c | 2 +- drivers/net/ethernet/mellanox/mlx4/qp.c | 2 +- .../net/ethernet/mellanox/mlx4/resource_tracker.c | 28 +++--- drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/dev.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 2 +- .../ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 4 +- .../ethernet/mellanox/mlx5/core/diag/rsc_dump.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/dpll.c | 2 +- .../mellanox/mlx5/core/en/fs_tt_redirect.c | 12 +-- drivers/net/ethernet/mellanox/mlx5/core/en/htb.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/mapping.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/rep/bond.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/rep/neigh.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/rss.c | 8 +- .../net/ethernet/mellanox/mlx5/core/en/rx_res.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/en/selq.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/act_stats.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c | 2 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c | 2 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/int_port.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/tc/meter.c | 4 +- .../ethernet/mellanox/mlx5/core/en/tc/post_act.c | 6 +- .../ethernet/mellanox/mlx5/core/en/tc/post_meter.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/tc/sample.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 14 +-- .../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 10 +- drivers/net/ethernet/mellanox/mlx5/core/en/tir.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 2 +- .../ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 6 +- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 12 +-- .../mellanox/mlx5/core/en_accel/ipsec_fs.c | 34 +++---- .../mellanox/mlx5/core/en_accel/ipsec_offload.c | 2 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls.c | 2 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c | 6 +- .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 4 +- .../ethernet/mellanox/mlx5/core/en_accel/macsec.c | 14 +-- .../net/ethernet/mellanox/mlx5/core/en_accel/psp.c | 14 +-- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en_common.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 16 ++-- .../ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 8 +- .../net/ethernet/mellanox/mlx5/core/en_selftest.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 16 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/acl/helper.c | 2 +- .../mellanox/mlx5/core/esw/acl/ingress_lgcy.c | 2 +- .../mellanox/mlx5/core/esw/acl/ingress_ofld.c | 2 +- .../net/ethernet/mellanox/mlx5/core/esw/bridge.c | 18 ++-- .../ethernet/mellanox/mlx5/core/esw/bridge_mcast.c | 16 ++-- .../ethernet/mellanox/mlx5/core/esw/devlink_port.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/indir_table.c | 6 +- .../net/ethernet/mellanox/mlx5/core/esw/legacy.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 4 +- .../net/ethernet/mellanox/mlx5/core/esw/vporttbl.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 +- .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 24 ++--- .../mellanox/mlx5/core/eswitch_offloads_termtbl.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/events.c | 2 +- .../net/ethernet/mellanox/mlx5/core/fpga/conn.c | 2 +- .../net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 26 +++--- .../net/ethernet/mellanox/mlx5/core/fs_counters.c | 10 +- .../net/ethernet/mellanox/mlx5/core/fs_ft_pool.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/hwmon.c | 2 +- .../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 4 +- .../net/ethernet/mellanox/mlx5/core/irq_affinity.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/clock.c | 4 +- .../net/ethernet/mellanox/mlx5/core/lib/crypto.c | 8 +- .../net/ethernet/mellanox/mlx5/core/lib/devcom.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c | 2 +- .../ethernet/mellanox/mlx5/core/lib/fs_chains.c | 6 +- .../net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c | 16 ++-- .../net/ethernet/mellanox/mlx5/core/lib/geneve.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c | 6 +- .../mellanox/mlx5/core/lib/ipsec_fs_roce.c | 6 +- .../ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 36 ++++---- drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/st.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/vxlan.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +- .../net/ethernet/mellanox/mlx5/core/pagealloc.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 2 +- .../net/ethernet/mellanox/mlx5/core/sf/dev/dev.c | 6 +- .../net/ethernet/mellanox/mlx5/core/sf/devlink.c | 4 +- .../net/ethernet/mellanox/mlx5/core/sf/hw_table.c | 4 +- .../ethernet/mellanox/mlx5/core/sf/vhca_event.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 4 +- .../mellanox/mlx5/core/steering/hws/action.c | 16 ++-- .../mlx5/core/steering/hws/action_ste_pool.c | 4 +- .../mellanox/mlx5/core/steering/hws/buddy.c | 2 +- .../ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 6 +- .../ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 2 +- .../mellanox/mlx5/core/steering/hws/context.c | 4 +- .../mellanox/mlx5/core/steering/hws/definer.c | 8 +- .../mellanox/mlx5/core/steering/hws/fs_hws.c | 4 +- .../mellanox/mlx5/core/steering/hws/fs_hws_pools.c | 4 +- .../mellanox/mlx5/core/steering/hws/matcher.c | 8 +- .../mellanox/mlx5/core/steering/hws/pat_arg.c | 4 +- .../mellanox/mlx5/core/steering/hws/pool.c | 4 +- .../mellanox/mlx5/core/steering/hws/rule.c | 2 +- .../mellanox/mlx5/core/steering/hws/send.c | 2 +- .../mellanox/mlx5/core/steering/hws/table.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_action.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_arg.c | 6 +- .../mellanox/mlx5/core/steering/sws/dr_dbg.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_definer.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_domain.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_fw.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_icm_pool.c | 6 +- .../mellanox/mlx5/core/steering/sws/dr_matcher.c | 2 +- .../mellanox/mlx5/core/steering/sws/dr_ptrn.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_rule.c | 4 +- .../mellanox/mlx5/core/steering/sws/dr_send.c | 12 +-- .../mellanox/mlx5/core/steering/sws/dr_table.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/vport.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/wc.c | 2 +- drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/core.c | 8 +- .../mellanox/mlxsw/core_acl_flex_actions.c | 22 ++--- .../ethernet/mellanox/mlxsw/core_acl_flex_keys.c | 4 +- .../ethernet/mellanox/mlxsw/core_linecard_dev.c | 2 +- .../net/ethernet/mellanox/mlxsw/core_linecards.c | 4 +- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/pci.c | 6 +- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 8 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 2 +- .../ethernet/mellanox/mlxsw/spectrum_acl_atcam.c | 6 +- .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c | 10 +- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 8 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_flow.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_matchall.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c | 6 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c | 6 +- .../net/ethernet/mellanox/mlxsw/spectrum_policer.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_port_range.c | 4 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 8 +- .../net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 10 +- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 32 +++---- .../net/ethernet/mellanox/mlxsw/spectrum_span.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 14 +-- drivers/net/ethernet/micrel/ksz884x.c | 4 +- drivers/net/ethernet/microchip/lan743x_main.c | 4 +- .../net/ethernet/microchip/lan966x/lan966x_fdb.c | 2 +- .../net/ethernet/microchip/lan966x/lan966x_mdb.c | 4 +- .../ethernet/microchip/lan966x/lan966x_vcap_impl.c | 4 +- .../microchip/sparx5/lan969x/lan969x_fdma.c | 2 +- .../ethernet/microchip/sparx5/sparx5_calendar.c | 2 +- .../ethernet/microchip/sparx5/sparx5_switchdev.c | 2 +- .../ethernet/microchip/sparx5/sparx5_tc_flower.c | 2 +- .../ethernet/microchip/sparx5/sparx5_tc_matchall.c | 2 +- .../ethernet/microchip/sparx5/sparx5_vcap_impl.c | 4 +- drivers/net/ethernet/microchip/vcap/vcap_api.c | 14 +-- .../net/ethernet/microchip/vcap/vcap_api_kunit.c | 4 +- drivers/net/ethernet/microsoft/mana/gdma_main.c | 16 ++-- drivers/net/ethernet/microsoft/mana/hw_channel.c | 10 +- drivers/net/ethernet/microsoft/mana/mana_en.c | 10 +- drivers/net/ethernet/mscc/ocelot.c | 12 +-- drivers/net/ethernet/mscc/ocelot_flower.c | 2 +- drivers/net/ethernet/mscc/ocelot_mrp.c | 2 +- drivers/net/ethernet/mscc/ocelot_vcap.c | 2 +- drivers/net/ethernet/netronome/nfp/abm/cls.c | 2 +- drivers/net/ethernet/netronome/nfp/abm/main.c | 4 +- drivers/net/ethernet/netronome/nfp/abm/qdisc.c | 2 +- drivers/net/ethernet/netronome/nfp/bpf/main.c | 4 +- drivers/net/ethernet/netronome/nfp/bpf/offload.c | 6 +- .../net/ethernet/netronome/nfp/flower/conntrack.c | 6 +- .../net/ethernet/netronome/nfp/flower/lag_conf.c | 2 +- drivers/net/ethernet/netronome/nfp/flower/main.c | 6 +- .../net/ethernet/netronome/nfp/flower/metadata.c | 6 +- .../net/ethernet/netronome/nfp/flower/offload.c | 12 +-- .../net/ethernet/netronome/nfp/flower/qos_conf.c | 2 +- .../ethernet/netronome/nfp/flower/tunnel_conf.c | 6 +- drivers/net/ethernet/netronome/nfp/nfp_app.c | 2 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_net_dp.c | 4 +- .../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 4 +- .../net/ethernet/netronome/nfp/nfp_netvf_main.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_port.c | 2 +- .../ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c | 2 +- .../ethernet/netronome/nfp/nfpcore/nfp_cppcore.c | 4 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_mip.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c | 2 +- .../net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 4 +- .../ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c | 4 +- .../ethernet/netronome/nfp/nfpcore/nfp_resource.c | 2 +- drivers/net/ethernet/netronome/nfp/nic/main.c | 2 +- drivers/net/ethernet/pensando/ionic/ionic_aux.c | 2 +- .../net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 +- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 6 +- .../net/ethernet/qlogic/netxen/netxen_nic_init.c | 4 +- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 4 +- drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_dev.c | 10 +- drivers/net/ethernet/qlogic/qed/qed_fcoe.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_hw.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_init_ops.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_int.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_iscsi.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_ll2.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_main.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_ooo.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 8 +- drivers/net/ethernet/qlogic/qed/qed_spq.c | 6 +- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 4 +- drivers/net/ethernet/qlogic/qed/qed_vf.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_filter.c | 6 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +- drivers/net/ethernet/qlogic/qede/qede_ptp.c | 2 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 2 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 +- .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 2 +- .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 4 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 +- drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 4 +- drivers/net/ethernet/realtek/r8169_leds.c | 4 +- drivers/net/ethernet/realtek/r8169_main.c | 2 +- drivers/net/ethernet/renesas/rswitch_main.c | 2 +- drivers/net/ethernet/renesas/rtsn.c | 4 +- drivers/net/ethernet/rocker/rocker_main.c | 6 +- drivers/net/ethernet/rocker/rocker_ofdpa.c | 22 ++--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 +- drivers/net/ethernet/sfc/ef10.c | 6 +- drivers/net/ethernet/sfc/ef100.c | 2 +- drivers/net/ethernet/sfc/ef100_nic.c | 4 +- drivers/net/ethernet/sfc/ef10_sriov.c | 2 +- drivers/net/ethernet/sfc/efx.c | 2 +- drivers/net/ethernet/sfc/efx_channels.c | 4 +- drivers/net/ethernet/sfc/ethtool_common.c | 2 +- drivers/net/ethernet/sfc/falcon/efx.c | 4 +- drivers/net/ethernet/sfc/falcon/ethtool.c | 2 +- drivers/net/ethernet/sfc/falcon/falcon.c | 6 +- drivers/net/ethernet/sfc/falcon/farch.c | 2 +- drivers/net/ethernet/sfc/falcon/qt202x_phy.c | 2 +- drivers/net/ethernet/sfc/falcon/rx.c | 2 +- drivers/net/ethernet/sfc/falcon/selftest.c | 2 +- drivers/net/ethernet/sfc/falcon/tenxpress.c | 2 +- drivers/net/ethernet/sfc/falcon/tx.c | 2 +- drivers/net/ethernet/sfc/falcon/txc43128_phy.c | 2 +- drivers/net/ethernet/sfc/mae.c | 4 +- drivers/net/ethernet/sfc/mcdi.c | 2 +- drivers/net/ethernet/sfc/mcdi_filters.c | 4 +- drivers/net/ethernet/sfc/mcdi_mon.c | 2 +- drivers/net/ethernet/sfc/mcdi_port_common.c | 2 +- drivers/net/ethernet/sfc/ptp.c | 4 +- drivers/net/ethernet/sfc/rx_common.c | 2 +- drivers/net/ethernet/sfc/selftest.c | 2 +- drivers/net/ethernet/sfc/siena/efx_channels.c | 4 +- drivers/net/ethernet/sfc/siena/ethtool_common.c | 2 +- drivers/net/ethernet/sfc/siena/farch.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi_mon.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi_port_common.c | 2 +- drivers/net/ethernet/sfc/siena/ptp.c | 2 +- drivers/net/ethernet/sfc/siena/rx_common.c | 2 +- drivers/net/ethernet/sfc/siena/selftest.c | 2 +- drivers/net/ethernet/sfc/siena/siena.c | 4 +- drivers/net/ethernet/sfc/siena/siena_sriov.c | 4 +- drivers/net/ethernet/sfc/siena/tx_common.c | 2 +- drivers/net/ethernet/sfc/tc.c | 8 +- drivers/net/ethernet/sfc/tc_bindings.c | 2 +- drivers/net/ethernet/sfc/tx_common.c | 2 +- drivers/net/ethernet/sis/sis190.c | 2 +- drivers/net/ethernet/sis/sis900.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 2 +- drivers/net/ethernet/socionext/sni_ave.c | 4 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 30 +++--- drivers/net/ethernet/sun/ldmvsw.c | 2 +- drivers/net/ethernet/sun/niu.c | 8 +- drivers/net/ethernet/sun/sunhme.c | 4 +- drivers/net/ethernet/sun/sunqe.c | 2 +- drivers/net/ethernet/sun/sunvnet.c | 2 +- .../net/ethernet/ti/icssm/icssm_prueth_switch.c | 2 +- drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 2 +- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +- drivers/net/ethernet/via/via-velocity.c | 2 +- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 4 +- drivers/net/ethernet/wangxun/libwx/wx_mbx.c | 2 +- drivers/net/ethernet/wangxun/libwx/wx_sriov.c | 4 +- drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c | 2 +- drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c | 2 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 +- drivers/net/fjes/fjes_hw.c | 2 +- drivers/net/geneve.c | 2 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/hyperv/netvsc.c | 2 +- drivers/net/hyperv/rndis_filter.c | 4 +- drivers/net/ieee802154/ca8210.c | 2 +- drivers/net/ieee802154/mac802154_hwsim.c | 8 +- drivers/net/ifb.c | 2 +- drivers/net/ipa/gsi_trans.c | 2 +- drivers/net/ipa/ipa_interrupt.c | 2 +- drivers/net/ipa/ipa_main.c | 2 +- drivers/net/ipa/ipa_smp2p.c | 2 +- drivers/net/ipvlan/ipvlan_main.c | 2 +- drivers/net/macsec.c | 8 +- drivers/net/macvlan.c | 6 +- drivers/net/mctp/mctp-i2c.c | 2 +- drivers/net/mctp/mctp-i3c.c | 2 +- drivers/net/netconsole.c | 4 +- drivers/net/netdevsim/bpf.c | 2 +- drivers/net/netdevsim/bus.c | 2 +- drivers/net/netdevsim/dev.c | 6 +- drivers/net/netdevsim/fib.c | 10 +- drivers/net/netdevsim/hwstats.c | 2 +- drivers/net/netdevsim/psample.c | 2 +- drivers/net/ovpn/crypto_aead.c | 2 +- drivers/net/ovpn/main.c | 2 +- drivers/net/ovpn/peer.c | 2 +- drivers/net/ovpn/socket.c | 2 +- drivers/net/pcs/pcs-lynx.c | 2 +- drivers/net/pcs/pcs-mtk-lynxi.c | 2 +- drivers/net/pcs/pcs-rzn1-miic.c | 2 +- drivers/net/pcs/pcs-xpcs.c | 2 +- drivers/net/phy/as21xxx.c | 2 +- drivers/net/phy/dp83640.c | 4 +- drivers/net/phy/mdio_device.c | 2 +- drivers/net/phy/micrel.c | 2 +- drivers/net/phy/microchip_rds_ptp.c | 2 +- drivers/net/phy/mii_timestamper.c | 2 +- drivers/net/phy/mscc/mscc_macsec.c | 2 +- drivers/net/phy/nxp-c45-tja11xx-macsec.c | 4 +- drivers/net/phy/phy.c | 2 +- drivers/net/phy/phy_device.c | 4 +- drivers/net/phy/phy_led_triggers.c | 2 +- drivers/net/phy/phy_link_topology.c | 4 +- drivers/net/phy/phy_package.c | 2 +- drivers/net/phy/phy_port.c | 2 +- drivers/net/phy/phylink.c | 2 +- drivers/net/phy/sfp-bus.c | 2 +- drivers/net/phy/sfp.c | 2 +- drivers/net/ppp/bsd_comp.c | 2 +- drivers/net/ppp/ppp_async.c | 2 +- drivers/net/ppp/ppp_deflate.c | 4 +- drivers/net/ppp/ppp_generic.c | 2 +- drivers/net/ppp/ppp_mppe.c | 2 +- drivers/net/ppp/ppp_synctty.c | 2 +- drivers/net/pse-pd/pd692x0.c | 2 +- drivers/net/pse-pd/pse_core.c | 4 +- drivers/net/pse-pd/tps23881.c | 2 +- drivers/net/rionet.c | 2 +- drivers/net/slip/slhc.c | 2 +- drivers/net/slip/slip.c | 2 +- drivers/net/tap.c | 2 +- drivers/net/team/team_core.c | 10 +- drivers/net/team/team_mode_loadbalance.c | 4 +- drivers/net/tun.c | 4 +- drivers/net/usb/aqc111.c | 2 +- drivers/net/usb/asix_devices.c | 2 +- drivers/net/usb/ax88172a.c | 2 +- drivers/net/usb/ax88179_178a.c | 2 +- drivers/net/usb/cdc_ncm.c | 2 +- drivers/net/usb/cx82310_eth.c | 2 +- drivers/net/usb/hso.c | 10 +- drivers/net/usb/lan78xx.c | 4 +- drivers/net/usb/lg-vl600.c | 2 +- drivers/net/usb/r8152.c | 2 +- drivers/net/usb/sierra_net.c | 2 +- drivers/net/usb/smsc95xx.c | 2 +- drivers/net/virtio_net.c | 34 +++---- drivers/net/vxlan/vxlan_core.c | 2 +- drivers/net/vxlan/vxlan_mdb.c | 10 +- drivers/net/vxlan/vxlan_vnifilter.c | 4 +- drivers/net/wan/c101.c | 2 +- drivers/net/wan/farsync.c | 2 +- drivers/net/wan/framer/framer-core.c | 4 +- drivers/net/wan/framer/pef2256/pef2256.c | 2 +- drivers/net/wan/fsl_ucc_hdlc.c | 6 +- drivers/net/wan/n2.c | 2 +- drivers/net/wan/pc300too.c | 2 +- drivers/net/wan/pci200syn.c | 2 +- drivers/net/wireguard/noise.c | 2 +- drivers/net/wireguard/peerlookup.c | 4 +- drivers/net/wireguard/ratelimiter.c | 4 +- drivers/net/wireguard/selftest/allowedips.c | 10 +- drivers/net/wireguard/selftest/counter.c | 2 +- drivers/net/wireless/ath/ar5523/ar5523.c | 4 +- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +- drivers/net/wireless/ath/ath10k/mac.c | 6 +- drivers/net/wireless/ath/ath10k/qmi.c | 8 +- drivers/net/wireless/ath/ath10k/sdio.c | 4 +- drivers/net/wireless/ath/ath10k/usb.c | 2 +- drivers/net/wireless/ath/ath10k/wow.c | 4 +- drivers/net/wireless/ath/ath11k/cfr.c | 2 +- drivers/net/wireless/ath/ath11k/debugfs.c | 2 +- drivers/net/wireless/ath/ath11k/mac.c | 16 ++-- drivers/net/wireless/ath/ath11k/mhi.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.c | 10 +- drivers/net/wireless/ath/ath11k/wow.c | 4 +- drivers/net/wireless/ath/ath12k/core.c | 2 +- drivers/net/wireless/ath/ath12k/dp_peer.c | 2 +- drivers/net/wireless/ath/ath12k/mac.c | 30 +++--- drivers/net/wireless/ath/ath12k/mhi.c | 2 +- drivers/net/wireless/ath/ath12k/peer.c | 2 +- drivers/net/wireless/ath/ath12k/qmi.c | 10 +- drivers/net/wireless/ath/ath12k/wifi7/dp.c | 2 +- drivers/net/wireless/ath/ath12k/wow.c | 6 +- drivers/net/wireless/ath/ath5k/debug.c | 2 +- drivers/net/wireless/ath/ath6kl/core.c | 2 +- drivers/net/wireless/ath/ath6kl/htc_mbox.c | 6 +- drivers/net/wireless/ath/ath6kl/htc_pipe.c | 8 +- drivers/net/wireless/ath/ath6kl/main.c | 2 +- drivers/net/wireless/ath/ath6kl/sdio.c | 2 +- drivers/net/wireless/ath/ath6kl/txrx.c | 4 +- drivers/net/wireless/ath/ath6kl/usb.c | 4 +- drivers/net/wireless/ath/ath6kl/wmi.c | 2 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 10 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/wmi.c | 2 +- drivers/net/wireless/ath/carl9170/main.c | 2 +- drivers/net/wireless/ath/dfs_pattern_detector.c | 2 +- drivers/net/wireless/ath/wcn36xx/dxe.c | 2 +- drivers/net/wireless/ath/wcn36xx/smd.c | 8 +- drivers/net/wireless/ath/wil6210/cfg80211.c | 4 +- drivers/net/wireless/ath/wil6210/debugfs.c | 2 +- drivers/net/wireless/ath/wil6210/rx_reorder.c | 4 +- drivers/net/wireless/ath/wil6210/txrx.c | 2 +- drivers/net/wireless/ath/wil6210/txrx_edma.c | 2 +- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- drivers/net/wireless/atmel/at76c50x-usb.c | 20 ++-- drivers/net/wireless/broadcom/b43/bus.c | 4 +- drivers/net/wireless/broadcom/b43/debugfs.c | 2 +- drivers/net/wireless/broadcom/b43/dma.c | 2 +- drivers/net/wireless/broadcom/b43/lo.c | 2 +- drivers/net/wireless/broadcom/b43/main.c | 4 +- drivers/net/wireless/broadcom/b43/phy_ac.c | 2 +- drivers/net/wireless/broadcom/b43/phy_g.c | 4 +- drivers/net/wireless/broadcom/b43/phy_ht.c | 2 +- drivers/net/wireless/broadcom/b43/phy_lcn.c | 2 +- drivers/net/wireless/broadcom/b43/phy_lp.c | 2 +- drivers/net/wireless/broadcom/b43/phy_n.c | 4 +- drivers/net/wireless/broadcom/b43/pio.c | 4 +- drivers/net/wireless/broadcom/b43/sdio.c | 2 +- drivers/net/wireless/broadcom/b43legacy/debugfs.c | 2 +- drivers/net/wireless/broadcom/b43legacy/dma.c | 2 +- drivers/net/wireless/broadcom/b43legacy/main.c | 2 +- drivers/net/wireless/broadcom/b43legacy/pio.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +- .../wireless/broadcom/brcm80211/brcmfmac/btcoex.c | 2 +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 22 ++--- .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 4 +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +- .../broadcom/brcm80211/brcmfmac/firmware.c | 2 +- .../broadcom/brcm80211/brcmfmac/flowring.c | 4 +- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 6 +- .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 12 +-- .../net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 4 +- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 8 +- drivers/net/wireless/intel/ipw2x00/libipw_crypto.c | 2 +- drivers/net/wireless/intel/ipw2x00/libipw_wx.c | 4 +- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 +- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 4 +- drivers/net/wireless/intel/iwlegacy/common.c | 8 +- drivers/net/wireless/intel/iwlwifi/dvm/devices.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 6 +- drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 2 +- drivers/net/wireless/intel/iwlwifi/mei/main.c | 4 +- drivers/net/wireless/intel/iwlwifi/mld/d3.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/iface.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/link.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 +- .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- .../net/wireless/intel/iwlwifi/pcie/ctxt-info.c | 4 +- .../net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c | 2 +- .../wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c | 4 +- .../net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c | 2 +- drivers/net/wireless/intersil/p54/eeprom.c | 4 +- drivers/net/wireless/marvell/libertas/cfg.c | 2 +- drivers/net/wireless/marvell/libertas/debugfs.c | 4 +- drivers/net/wireless/marvell/libertas/if_sdio.c | 2 +- drivers/net/wireless/marvell/libertas/if_spi.c | 2 +- drivers/net/wireless/marvell/libertas/if_usb.c | 2 +- drivers/net/wireless/marvell/libertas/mesh.c | 2 +- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 +- .../net/wireless/marvell/mwifiex/11n_rxreorder.c | 2 +- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 14 +-- drivers/net/wireless/marvell/mwifiex/ie.c | 14 +-- drivers/net/wireless/marvell/mwifiex/init.c | 2 +- drivers/net/wireless/marvell/mwifiex/main.c | 8 +- drivers/net/wireless/marvell/mwifiex/scan.c | 10 +- drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 +- drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 2 +- drivers/net/wireless/marvell/mwifiex/uap_event.c | 2 +- drivers/net/wireless/marvell/mwl8k.c | 80 ++++++++-------- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 2 +- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +- drivers/net/wireless/microchip/wilc1000/hif.c | 6 +- drivers/net/wireless/microchip/wilc1000/sdio.c | 2 +- drivers/net/wireless/microchip/wilc1000/spi.c | 2 +- drivers/net/wireless/microchip/wilc1000/wlan.c | 2 +- drivers/net/wireless/microchip/wilc1000/wlan_cfg.c | 2 +- drivers/net/wireless/purelifi/plfxlc/usb.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/event.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/util.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00debug.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 4 +- drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt61pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt73usb.c | 2 +- drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 2 +- drivers/net/wireless/realtek/rtl8xxxu/core.c | 4 +- .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 4 +- drivers/net/wireless/realtek/rtw88/fw.c | 2 +- drivers/net/wireless/realtek/rtw89/cam.c | 2 +- drivers/net/wireless/realtek/rtw89/core.c | 4 +- drivers/net/wireless/realtek/rtw89/debug.c | 2 +- drivers/net/wireless/realtek/rtw89/fw.c | 26 +++--- drivers/net/wireless/realtek/rtw89/mac80211.c | 2 +- drivers/net/wireless/realtek/rtw89/phy.c | 2 +- drivers/net/wireless/realtek/rtw89/sar.c | 2 +- drivers/net/wireless/realtek/rtw89/wow.c | 2 +- drivers/net/wireless/rsi/rsi_91x_coex.c | 2 +- drivers/net/wireless/rsi/rsi_91x_debugfs.c | 2 +- drivers/net/wireless/rsi/rsi_91x_hal.c | 2 +- drivers/net/wireless/rsi/rsi_91x_main.c | 4 +- drivers/net/wireless/rsi/rsi_91x_sdio.c | 2 +- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- drivers/net/wireless/silabs/wfx/debug.c | 2 +- drivers/net/wireless/st/cw1200/cw1200_sdio.c | 2 +- drivers/net/wireless/st/cw1200/pm.c | 2 +- drivers/net/wireless/st/cw1200/queue.c | 2 +- drivers/net/wireless/st/cw1200/wsm.c | 2 +- drivers/net/wireless/ti/wl1251/acx.c | 70 +++++++------- drivers/net/wireless/ti/wl1251/cmd.c | 14 +-- drivers/net/wireless/ti/wl1251/debugfs.c | 2 +- drivers/net/wireless/ti/wl1251/event.c | 2 +- drivers/net/wireless/ti/wl1251/init.c | 4 +- drivers/net/wireless/ti/wl1251/io.c | 2 +- drivers/net/wireless/ti/wl1251/main.c | 4 +- drivers/net/wireless/ti/wl1251/sdio.c | 2 +- drivers/net/wireless/ti/wl1251/tx.c | 2 +- drivers/net/wireless/ti/wl12xx/acx.c | 2 +- drivers/net/wireless/ti/wl12xx/cmd.c | 12 +-- drivers/net/wireless/ti/wl12xx/main.c | 2 +- drivers/net/wireless/ti/wl12xx/scan.c | 14 +-- drivers/net/wireless/ti/wl18xx/acx.c | 20 ++-- drivers/net/wireless/ti/wl18xx/cmd.c | 14 +-- drivers/net/wireless/ti/wl18xx/scan.c | 10 +- drivers/net/wireless/ti/wlcore/acx.c | 102 ++++++++++----------- drivers/net/wireless/ti/wlcore/cmd.c | 50 +++++----- drivers/net/wireless/ti/wlcore/init.c | 6 +- drivers/net/wireless/ti/wlcore/main.c | 10 +- drivers/net/wireless/ti/wlcore/scan.c | 2 +- drivers/net/wireless/ti/wlcore/testmode.c | 2 +- drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +- drivers/net/wireless/virtual/virt_wifi.c | 2 +- drivers/net/wireless/zydas/zd1211rw/zd_mac.c | 2 +- drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c | 2 +- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_imem.c | 4 +- drivers/net/wwan/iosm/iosm_ipc_mmio.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_mux.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_port.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_task_queue.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_trace.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_wwan.c | 2 +- drivers/net/wwan/mhi_wwan_ctrl.c | 2 +- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 6 +- drivers/net/wwan/wwan_core.c | 4 +- drivers/net/wwan/wwan_hwsim.c | 4 +- drivers/net/xen-netback/xenbus.c | 2 +- drivers/nfc/mei_phy.c | 2 +- drivers/nfc/microread/microread.c | 4 +- drivers/nfc/nfcmrvl/main.c | 2 +- drivers/nfc/nfcsim.c | 4 +- drivers/nfc/pn533/pn533.c | 10 +- drivers/nfc/pn533/uart.c | 2 +- drivers/nfc/pn544/pn544.c | 2 +- drivers/nfc/port100.c | 8 +- drivers/nfc/st21nfca/core.c | 2 +- drivers/nfc/virtual_ncidev.c | 2 +- drivers/nubus/proc.c | 2 +- drivers/nvdimm/badrange.c | 2 +- drivers/nvdimm/btt.c | 4 +- drivers/nvdimm/btt_devs.c | 2 +- drivers/nvdimm/bus.c | 4 +- drivers/nvdimm/core.c | 2 +- drivers/nvdimm/dax_devs.c | 2 +- drivers/nvdimm/dimm.c | 2 +- drivers/nvdimm/dimm_devs.c | 2 +- drivers/nvdimm/label.c | 2 +- drivers/nvdimm/namespace_devs.c | 16 ++-- drivers/nvdimm/nd_perf.c | 2 +- drivers/nvdimm/nd_virtio.c | 2 +- drivers/nvdimm/of_pmem.c | 2 +- drivers/nvdimm/pfn_devs.c | 2 +- drivers/nvdimm/ramdax.c | 4 +- drivers/nvme/host/core.c | 22 ++--- drivers/nvme/host/fabrics.c | 6 +- drivers/nvme/host/fc.c | 8 +- drivers/nvme/host/hwmon.c | 4 +- drivers/nvme/host/pci.c | 2 +- drivers/nvme/host/rdma.c | 8 +- drivers/nvme/host/tcp.c | 6 +- drivers/nvme/host/zns.c | 4 +- drivers/nvme/target/admin-cmd.c | 20 ++-- drivers/nvme/target/configfs.c | 12 +-- drivers/nvme/target/core.c | 8 +- drivers/nvme/target/discovery.c | 2 +- drivers/nvme/target/fabrics-cmd.c | 4 +- drivers/nvme/target/fc.c | 8 +- drivers/nvme/target/fcloop.c | 10 +- drivers/nvme/target/io-cmd-file.c | 2 +- drivers/nvme/target/loop.c | 2 +- drivers/nvme/target/passthru.c | 4 +- drivers/nvme/target/pr.c | 8 +- drivers/nvme/target/rdma.c | 20 ++-- drivers/nvme/target/tcp.c | 8 +- drivers/nvme/target/zns.c | 4 +- drivers/nvmem/core.c | 6 +- drivers/nvmem/layouts.c | 2 +- drivers/of/address.c | 2 +- drivers/of/dynamic.c | 4 +- drivers/of/irq.c | 2 +- drivers/of/of_reserved_mem.c | 2 +- drivers/of/overlay.c | 6 +- drivers/of/platform.c | 2 +- drivers/of/unittest.c | 8 +- drivers/opp/core.c | 6 +- drivers/opp/cpu.c | 2 +- drivers/opp/of.c | 2 +- drivers/opp/ti-opp-supply.c | 2 +- drivers/parisc/ccio-dma.c | 4 +- drivers/parisc/dino.c | 2 +- drivers/parisc/eisa_enumerator.c | 4 +- drivers/parisc/hppb.c | 2 +- drivers/parisc/iosapic.c | 4 +- drivers/parisc/lasi.c | 2 +- drivers/parisc/lba_pci.c | 6 +- drivers/parisc/sba_iommu.c | 2 +- drivers/parisc/wax.c | 2 +- drivers/parport/daisy.c | 2 +- drivers/parport/parport_cs.c | 2 +- drivers/parport/parport_gsc.c | 2 +- drivers/parport/parport_ip32.c | 4 +- drivers/parport/parport_pc.c | 6 +- drivers/parport/share.c | 6 +- drivers/pci/bus.c | 2 +- drivers/pci/controller/pci-hyperv.c | 6 +- drivers/pci/controller/vmd.c | 2 +- drivers/pci/doe.c | 4 +- drivers/pci/ecam.c | 4 +- drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 +- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- drivers/pci/endpoint/pci-ep-cfs.c | 4 +- drivers/pci/endpoint/pci-ep-msi.c | 2 +- drivers/pci/endpoint/pci-epc-core.c | 2 +- drivers/pci/endpoint/pci-epc-mem.c | 4 +- drivers/pci/endpoint/pci-epf-core.c | 2 +- drivers/pci/hotplug/acpiphp_core.c | 2 +- drivers/pci/hotplug/acpiphp_glue.c | 8 +- drivers/pci/hotplug/acpiphp_ibm.c | 2 +- drivers/pci/hotplug/cpci_hotplug_core.c | 2 +- drivers/pci/hotplug/cpqphp_core.c | 4 +- drivers/pci/hotplug/cpqphp_ctrl.c | 24 ++--- drivers/pci/hotplug/cpqphp_nvram.c | 6 +- drivers/pci/hotplug/cpqphp_pci.c | 18 ++-- drivers/pci/hotplug/cpqphp_sysfs.c | 2 +- drivers/pci/hotplug/ibmphp_core.c | 10 +- drivers/pci/hotplug/ibmphp_ebda.c | 18 ++-- drivers/pci/hotplug/ibmphp_pci.c | 18 ++-- drivers/pci/hotplug/ibmphp_res.c | 8 +- drivers/pci/hotplug/octep_hp.c | 2 +- drivers/pci/hotplug/pciehp_core.c | 2 +- drivers/pci/hotplug/pciehp_hpc.c | 2 +- drivers/pci/hotplug/pnv_php.c | 2 +- drivers/pci/hotplug/rpaphp_slot.c | 2 +- drivers/pci/hotplug/shpchp_core.c | 4 +- drivers/pci/hotplug/shpchp_ctrl.c | 2 +- drivers/pci/ide.c | 2 +- drivers/pci/iov.c | 2 +- drivers/pci/of.c | 4 +- drivers/pci/of_property.c | 2 +- drivers/pci/p2pdma.c | 2 +- drivers/pci/pci-acpi.c | 4 +- drivers/pci/pci-driver.c | 4 +- drivers/pci/pci.c | 2 +- drivers/pci/pcie/aer.c | 2 +- drivers/pci/pcie/aer_inject.c | 6 +- drivers/pci/pcie/aspm.c | 2 +- drivers/pci/pcie/pme.c | 2 +- drivers/pci/pcie/portdrv.c | 2 +- drivers/pci/pcie/ptm.c | 2 +- drivers/pci/pcie/rcec.c | 2 +- drivers/pci/probe.c | 6 +- drivers/pci/proc.c | 2 +- drivers/pci/setup-bus.c | 4 +- drivers/pci/slot.c | 2 +- drivers/pci/switch/switchtec.c | 4 +- drivers/pci/vgaarb.c | 4 +- drivers/pci/xen-pcifront.c | 6 +- drivers/pcmcia/bcm63xx_pcmcia.c | 2 +- drivers/pcmcia/cistpl.c | 8 +- drivers/pcmcia/db1xxx_ss.c | 2 +- drivers/pcmcia/ds.c | 10 +- drivers/pcmcia/electra_cf.c | 2 +- drivers/pcmcia/omap_cf.c | 2 +- drivers/pcmcia/pcmcia_cis.c | 2 +- drivers/pcmcia/pd6729.c | 2 +- drivers/pcmcia/rsrc_mgr.c | 2 +- drivers/pcmcia/rsrc_nonstatic.c | 6 +- drivers/pcmcia/sa1111_generic.c | 2 +- drivers/pcmcia/xxs1500_ss.c | 2 +- drivers/pcmcia/yenta_socket.c | 2 +- drivers/peci/core.c | 2 +- drivers/peci/cpu.c | 2 +- drivers/peci/device.c | 2 +- drivers/peci/request.c | 2 +- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/riscv_pmu.c | 2 +- drivers/perf/riscv_pmu_sbi.c | 2 +- drivers/phy/phy-core.c | 6 +- drivers/phy/tegra/xusb-tegra124.c | 20 ++-- drivers/phy/tegra/xusb-tegra186.c | 8 +- drivers/phy/tegra/xusb-tegra210.c | 16 ++-- drivers/phy/tegra/xusb.c | 8 +- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- drivers/pinctrl/core.c | 12 +-- drivers/pinctrl/devicetree.c | 4 +- drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 2 +- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2 +- drivers/pinctrl/freescale/pinctrl-mxs.c | 2 +- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 2 +- drivers/pinctrl/nuvoton/pinctrl-ma35.c | 2 +- drivers/pinctrl/nxp/pinctrl-s32cc.c | 2 +- drivers/pinctrl/pinctrl-k230.c | 2 +- drivers/pinctrl/pinctrl-rockchip.c | 4 +- drivers/pinctrl/pinctrl-rp1.c | 4 +- drivers/pinctrl/pinctrl-scmi.c | 2 +- drivers/pinctrl/pinctrl-th1520.c | 2 +- drivers/pinctrl/renesas/core.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza2.c | 2 +- drivers/pinctrl/sophgo/pinctrl-sophgo-common.c | 2 +- drivers/pinctrl/spacemit/pinctrl-k1.c | 2 +- drivers/pinctrl/spear/pinctrl-spear.c | 2 +- drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 2 +- drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 2 +- drivers/pinctrl/sunplus/sppctl.c | 6 +- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +- drivers/pinctrl/vt8500/pinctrl-wmt.c | 2 +- drivers/platform/arm64/huawei-gaokun-ec.c | 2 +- drivers/platform/chrome/chromeos_laptop.c | 2 +- drivers/platform/chrome/cros_ec_chardev.c | 2 +- drivers/platform/chrome/wilco_ec/event.c | 2 +- drivers/platform/chrome/wilco_ec/telemetry.c | 4 +- drivers/platform/goldfish/goldfish_pipe.c | 4 +- drivers/platform/mellanox/mlxbf-tmfifo.c | 2 +- drivers/platform/olpc/olpc-ec.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_arm.c | 6 +- .../raspberrypi/vchiq-interface/vchiq_bus.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_core.c | 2 +- .../raspberrypi/vchiq-interface/vchiq_dev.c | 6 +- .../platform/raspberrypi/vchiq-mmal/mmal-vchiq.c | 4 +- drivers/platform/surface/aggregator/bus.c | 2 +- drivers/platform/surface/aggregator/controller.c | 2 +- drivers/platform/surface/aggregator/core.c | 2 +- drivers/platform/surface/surface3_power.c | 2 +- drivers/platform/surface/surface_aggregator_cdev.c | 4 +- drivers/platform/surface/surface_dtx.c | 4 +- drivers/platform/surface/surfacepro3_button.c | 2 +- drivers/platform/wmi/core.c | 2 +- drivers/platform/x86/apple-gmux.c | 2 +- drivers/platform/x86/asus-laptop.c | 2 +- drivers/platform/x86/asus-wmi.c | 2 +- drivers/platform/x86/classmate-laptop.c | 6 +- drivers/platform/x86/dell/dell-smbios-base.c | 2 +- drivers/platform/x86/dell/dell-wmi-base.c | 4 +- drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 2 +- drivers/platform/x86/dell/dell_rbu.c | 2 +- drivers/platform/x86/eeepc-laptop.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 6 +- drivers/platform/x86/huawei-wmi.c | 2 +- drivers/platform/x86/intel/ifs/core.c | 2 +- drivers/platform/x86/intel/int1092/intel_sar.c | 2 +- drivers/platform/x86/intel/pmc/pltdrv.c | 2 +- drivers/platform/x86/intel/pmt/telemetry.c | 2 +- .../x86/intel/speed_select_if/isst_if_common.c | 2 +- .../x86/intel/speed_select_if/isst_tpmi_core.c | 2 +- drivers/platform/x86/intel/vsec.c | 4 +- drivers/platform/x86/intel/vsec_tpmi.c | 4 +- drivers/platform/x86/intel_scu_ipc.c | 2 +- drivers/platform/x86/lenovo/ideapad-laptop.c | 2 +- drivers/platform/x86/lenovo/think-lmi.c | 4 +- drivers/platform/x86/lenovo/thinkpad_acpi.c | 6 +- drivers/platform/x86/panasonic-laptop.c | 2 +- drivers/platform/x86/pmc_atom.c | 2 +- drivers/platform/x86/samsung-laptop.c | 2 +- drivers/platform/x86/sony-laptop.c | 30 +++--- drivers/platform/x86/topstar-laptop.c | 2 +- drivers/platform/x86/toshiba_acpi.c | 2 +- drivers/platform/x86/toshiba_bluetooth.c | 2 +- drivers/platform/x86/uniwill/uniwill-acpi.c | 2 +- drivers/platform/x86/uv_sysfs.c | 6 +- drivers/platform/x86/wireless-hotkey.c | 2 +- drivers/platform/x86/x86-android-tablets/core.c | 6 +- drivers/platform/x86/xo15-ebook.c | 2 +- drivers/pmdomain/core.c | 16 ++-- drivers/pmdomain/renesas/rcar-gen4-sysc.c | 2 +- drivers/pmdomain/renesas/rcar-sysc.c | 2 +- drivers/pmdomain/renesas/rmobile-sysc.c | 2 +- drivers/pmdomain/st/ste-ux500-pm-domain.c | 2 +- drivers/pmdomain/tegra/powergate-bpmp.c | 4 +- drivers/pnp/card.c | 6 +- drivers/pnp/core.c | 2 +- drivers/pnp/driver.c | 2 +- drivers/pnp/interface.c | 4 +- drivers/pnp/quirks.c | 4 +- drivers/pnp/resource.c | 4 +- drivers/power/sequencing/core.c | 8 +- drivers/power/sequencing/pwrseq-thead-gpu.c | 2 +- drivers/power/supply/pmu_battery.c | 2 +- drivers/power/supply/power_supply_core.c | 2 +- drivers/power/supply/power_supply_leds.c | 2 +- drivers/powercap/arm_scmi_powercap.c | 2 +- drivers/powercap/dtpm.c | 2 +- drivers/powercap/dtpm_cpu.c | 2 +- drivers/powercap/dtpm_devfreq.c | 2 +- drivers/powercap/intel_rapl_common.c | 2 +- drivers/powercap/intel_rapl_tpmi.c | 2 +- drivers/powercap/powercap_sys.c | 4 +- drivers/pps/clients/pps_parport.c | 2 +- drivers/pps/generators/pps_gen.c | 2 +- drivers/pps/kapi.c | 2 +- drivers/ps3/ps3-lpm.c | 2 +- drivers/ps3/ps3-vuart.c | 4 +- drivers/ps3/ps3av.c | 2 +- drivers/ptp/ptp_clock.c | 4 +- drivers/ptp/ptp_ines.c | 2 +- drivers/ptp/ptp_mock.c | 2 +- drivers/ptp/ptp_ocp.c | 6 +- drivers/ptp/ptp_qoriq.c | 2 +- drivers/ptp/ptp_sysfs.c | 4 +- drivers/ptp/ptp_vclock.c | 2 +- drivers/ptp/ptp_vmclock.c | 2 +- drivers/pwm/core.c | 2 +- drivers/rapidio/devices/rio_mport_cdev.c | 18 ++-- drivers/rapidio/devices/tsi721.c | 2 +- drivers/rapidio/rio.c | 18 ++-- drivers/rapidio/rio_cm.c | 16 ++-- drivers/ras/amd/fmpm.c | 2 +- drivers/regulator/core.c | 14 +-- drivers/regulator/fixed-helper.c | 2 +- drivers/remoteproc/qcom_common.c | 4 +- drivers/remoteproc/qcom_sysmon.c | 2 +- drivers/remoteproc/qcom_wcnss_iris.c | 2 +- drivers/remoteproc/remoteproc_core.c | 10 +- drivers/remoteproc/remoteproc_coredump.c | 4 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/remoteproc/stm32_rproc.c | 2 +- drivers/remoteproc/xlnx_r5_remoteproc.c | 8 +- drivers/resctrl/mpam_devices.c | 8 +- drivers/reset/core.c | 6 +- drivers/reset/reset-npcm.c | 2 +- drivers/reset/reset-socfpga.c | 2 +- drivers/reset/reset-sunxi.c | 2 +- drivers/rpmsg/mtk_rpmsg.c | 8 +- drivers/rpmsg/qcom_glink_native.c | 8 +- drivers/rpmsg/qcom_glink_smem.c | 2 +- drivers/rpmsg/qcom_smd.c | 10 +- drivers/rpmsg/rpmsg_char.c | 2 +- drivers/rpmsg/rpmsg_ctrl.c | 2 +- drivers/rpmsg/virtio_rpmsg_bus.c | 10 +- drivers/rtc/class.c | 2 +- drivers/rtc/rtc-sun6i.c | 2 +- drivers/s390/block/dasd.c | 4 +- drivers/s390/block/dasd_alias.c | 4 +- drivers/s390/block/dasd_devmap.c | 6 +- drivers/s390/block/dasd_diag.c | 4 +- drivers/s390/block/dasd_eckd.c | 4 +- drivers/s390/block/dasd_eer.c | 4 +- drivers/s390/block/dasd_ioctl.c | 4 +- drivers/s390/block/dcssblk.c | 2 +- drivers/s390/block/scm_blk.c | 2 +- drivers/s390/block/scm_drv.c | 2 +- drivers/s390/char/con3270.c | 4 +- drivers/s390/char/fs3270.c | 2 +- drivers/s390/char/keyboard.c | 4 +- drivers/s390/char/monreader.c | 4 +- drivers/s390/char/monwriter.c | 8 +- drivers/s390/char/sclp_cmd.c | 2 +- drivers/s390/char/sclp_cpi_sys.c | 2 +- drivers/s390/char/sclp_ftp.c | 2 +- drivers/s390/char/sclp_mem.c | 4 +- drivers/s390/char/sclp_sd.c | 2 +- drivers/s390/char/tape_class.c | 2 +- drivers/s390/char/tape_core.c | 4 +- drivers/s390/char/uvdevice.c | 4 +- drivers/s390/char/vmcp.c | 2 +- drivers/s390/char/vmur.c | 4 +- drivers/s390/cio/airq.c | 2 +- drivers/s390/cio/chp.c | 4 +- drivers/s390/cio/chsc_sch.c | 20 ++-- drivers/s390/cio/cmf.c | 8 +- drivers/s390/cio/css.c | 2 +- drivers/s390/cio/device.c | 2 +- drivers/s390/cio/qdio_debug.c | 2 +- drivers/s390/cio/scm.c | 2 +- drivers/s390/cio/vfio_ccw_cp.c | 8 +- drivers/s390/cio/vfio_ccw_drv.c | 2 +- drivers/s390/crypto/ap_card.c | 2 +- drivers/s390/crypto/ap_queue.c | 2 +- drivers/s390/crypto/pkey_api.c | 6 +- drivers/s390/crypto/pkey_uv.c | 2 +- drivers/s390/crypto/vfio_ap_drv.c | 2 +- drivers/s390/crypto/vfio_ap_ops.c | 2 +- drivers/s390/crypto/zcrypt_api.c | 4 +- drivers/s390/crypto/zcrypt_card.c | 2 +- drivers/s390/crypto/zcrypt_queue.c | 2 +- drivers/s390/net/ctcm_main.c | 6 +- drivers/s390/net/ctcm_mpc.c | 2 +- drivers/s390/net/ism_drv.c | 2 +- drivers/s390/net/qeth_core_main.c | 12 +-- drivers/s390/net/qeth_l3_sys.c | 2 +- drivers/s390/net/smsgiucv.c | 2 +- drivers/s390/scsi/zfcp_aux.c | 4 +- drivers/s390/scsi/zfcp_dbf.c | 2 +- drivers/s390/scsi/zfcp_diag.c | 2 +- drivers/s390/scsi/zfcp_fc.c | 2 +- drivers/s390/scsi/zfcp_qdio.c | 2 +- drivers/s390/scsi/zfcp_reqlist.h | 2 +- drivers/s390/scsi/zfcp_scsi.c | 6 +- drivers/s390/scsi/zfcp_sysfs.c | 4 +- drivers/s390/scsi/zfcp_unit.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 6 +- drivers/sbus/char/bbc_envctrl.c | 4 +- drivers/sbus/char/bbc_i2c.c | 4 +- drivers/sbus/char/openprom.c | 2 +- drivers/sbus/char/oradax.c | 4 +- drivers/sbus/char/uctrl.c | 2 +- drivers/scsi/3w-9xxx.c | 2 +- drivers/scsi/3w-sas.c | 2 +- drivers/scsi/BusLogic.c | 2 +- drivers/scsi/a4000t.c | 2 +- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commctrl.c | 2 +- drivers/scsi/aacraid/comminit.c | 2 +- drivers/scsi/aacraid/commsup.c | 8 +- drivers/scsi/advansys.c | 2 +- drivers/scsi/aic94xx/aic94xx_init.c | 6 +- drivers/scsi/aic94xx/aic94xx_sds.c | 6 +- drivers/scsi/am53c974.c | 2 +- drivers/scsi/arm/queue.c | 2 +- drivers/scsi/be2iscsi/be_main.c | 4 +- drivers/scsi/bfa/bfa_fcs_lport.c | 2 +- drivers/scsi/bfa/bfad.c | 6 +- drivers/scsi/bfa/bfad_attr.c | 2 +- drivers/scsi/bfa/bfad_bsg.c | 2 +- drivers/scsi/bfa/bfad_debugfs.c | 8 +- drivers/scsi/bfa/bfad_im.c | 4 +- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 6 +- drivers/scsi/bnx2fc/bnx2fc_io.c | 4 +- drivers/scsi/bvme6000_scsi.c | 2 +- drivers/scsi/ch.c | 4 +- drivers/scsi/csiostor/csio_hw.c | 4 +- drivers/scsi/csiostor/csio_init.c | 2 +- drivers/scsi/csiostor/csio_lnode.c | 4 +- drivers/scsi/csiostor/csio_scsi.c | 4 +- drivers/scsi/csiostor/csio_wr.c | 4 +- drivers/scsi/device_handler/scsi_dh_alua.c | 6 +- drivers/scsi/device_handler/scsi_dh_emc.c | 2 +- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 2 +- drivers/scsi/device_handler/scsi_dh_rdac.c | 4 +- drivers/scsi/elx/efct/efct_driver.c | 2 +- drivers/scsi/elx/efct/efct_hw.c | 16 ++-- drivers/scsi/elx/efct/efct_hw_queues.c | 12 +-- drivers/scsi/elx/efct/efct_io.c | 4 +- drivers/scsi/elx/efct/efct_lio.c | 12 +-- drivers/scsi/elx/efct/efct_xport.c | 2 +- drivers/scsi/esas2r/esas2r_init.c | 2 +- drivers/scsi/esas2r/esas2r_main.c | 2 +- drivers/scsi/esp_scsi.c | 2 +- drivers/scsi/fcoe/fcoe.c | 2 +- drivers/scsi/fcoe/fcoe_ctlr.c | 2 +- drivers/scsi/fcoe/fcoe_transport.c | 2 +- drivers/scsi/fnic/fdls_disc.c | 2 +- drivers/scsi/fnic/fip.c | 2 +- drivers/scsi/fnic/fnic_debugfs.c | 6 +- drivers/scsi/fnic/fnic_main.c | 2 +- drivers/scsi/fnic/vnic_dev.c | 2 +- drivers/scsi/hpsa.c | 52 +++++------ drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4 +- drivers/scsi/ibmvscsi_tgt/libsrp.c | 8 +- drivers/scsi/imm.c | 2 +- drivers/scsi/ipr.c | 4 +- drivers/scsi/ips.c | 8 +- drivers/scsi/iscsi_boot_sysfs.c | 4 +- drivers/scsi/lasi700.c | 2 +- drivers/scsi/libfc/fc_disc.c | 2 +- drivers/scsi/libfc/fc_fcp.c | 2 +- drivers/scsi/libfc/fc_lport.c | 4 +- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_init.c | 2 +- drivers/scsi/libsas/sas_internal.h | 2 +- drivers/scsi/lpfc/lpfc_attr.c | 2 +- drivers/scsi/lpfc/lpfc_bsg.c | 36 ++++---- drivers/scsi/lpfc/lpfc_ct.c | 18 ++-- drivers/scsi/lpfc/lpfc_debugfs.c | 34 +++---- drivers/scsi/lpfc/lpfc_els.c | 16 ++-- drivers/scsi/lpfc/lpfc_hbadisc.c | 6 +- drivers/scsi/lpfc/lpfc_init.c | 26 +++--- drivers/scsi/lpfc/lpfc_mbox.c | 2 +- drivers/scsi/lpfc/lpfc_mem.c | 6 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 4 +- drivers/scsi/lpfc/lpfc_nvme.c | 4 +- drivers/scsi/lpfc/lpfc_nvmet.c | 4 +- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 16 ++-- drivers/scsi/mac_esp.c | 2 +- drivers/scsi/megaraid.c | 2 +- drivers/scsi/megaraid/megaraid_mbox.c | 12 +-- drivers/scsi/megaraid/megaraid_mm.c | 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 6 +- drivers/scsi/megaraid/megaraid_sas_debugfs.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 +- drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +- drivers/scsi/mpi3mr/mpi3mr_os.c | 6 +- drivers/scsi/mpi3mr/mpi3mr_transport.c | 8 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 4 +- drivers/scsi/mpt3sas/mpt3sas_debugfs.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 34 +++---- drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 +- drivers/scsi/mvme16x_scsi.c | 2 +- drivers/scsi/mvsas/mv_init.c | 4 +- drivers/scsi/mvumi.c | 8 +- drivers/scsi/myrb.c | 4 +- drivers/scsi/myrs.c | 8 +- drivers/scsi/pcmcia/aha152x_stub.c | 2 +- drivers/scsi/pcmcia/nsp_cs.c | 2 +- drivers/scsi/pcmcia/qlogic_stub.c | 2 +- drivers/scsi/pcmcia/sym53c500_cs.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.c | 6 +- drivers/scsi/pm8001/pm8001_init.c | 6 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- drivers/scsi/pmcraid.c | 2 +- drivers/scsi/ppa.c | 2 +- drivers/scsi/qedf/qedf_debugfs.c | 2 +- drivers/scsi/qedf/qedf_io.c | 4 +- drivers/scsi/qedf/qedf_main.c | 6 +- drivers/scsi/qedi/qedi_iscsi.c | 4 +- drivers/scsi/qedi/qedi_main.c | 8 +- drivers/scsi/qla2xxx/qla_bsg.c | 12 +-- drivers/scsi/qla2xxx/qla_edif.c | 6 +- drivers/scsi/qla2xxx/qla_init.c | 4 +- drivers/scsi/qla2xxx/qla_mid.c | 4 +- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 10 +- drivers/scsi/qla2xxx/qla_target.c | 2 +- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 8 +- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_nx.c | 2 +- drivers/scsi/raid_class.c | 4 +- drivers/scsi/scsi_debug.c | 8 +- drivers/scsi/scsi_devinfo.c | 6 +- drivers/scsi/scsi_proc.c | 2 +- drivers/scsi/scsi_scan.c | 2 +- drivers/scsi/scsi_transport_fc.c | 2 +- drivers/scsi/scsi_transport_iscsi.c | 2 +- drivers/scsi/scsi_transport_sas.c | 10 +- drivers/scsi/scsi_transport_spi.c | 2 +- drivers/scsi/scsi_transport_srp.c | 4 +- drivers/scsi/sd.c | 4 +- drivers/scsi/ses.c | 2 +- drivers/scsi/sg.c | 4 +- drivers/scsi/sim710.c | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 22 ++--- drivers/scsi/smartpqi/smartpqi_sas_transport.c | 8 +- drivers/scsi/sni_53c710.c | 2 +- drivers/scsi/snic/snic_disc.c | 2 +- drivers/scsi/snic/snic_main.c | 2 +- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 12 +-- drivers/scsi/stex.c | 2 +- drivers/scsi/storvsc_drv.c | 2 +- drivers/scsi/sym53c8xx_2/sym_hipd.c | 2 +- drivers/scsi/virtio_scsi.c | 4 +- drivers/scsi/zorro7xx.c | 2 +- drivers/scsi/zorro_esp.c | 2 +- drivers/sh/clk/cpg.c | 2 +- drivers/sh/maple/maple.c | 4 +- drivers/siox/siox-core.c | 2 +- drivers/slimbus/core.c | 2 +- drivers/slimbus/qcom-ngd-ctrl.c | 2 +- drivers/slimbus/stream.c | 4 +- drivers/soc/amlogic/meson-gx-socinfo.c | 2 +- drivers/soc/amlogic/meson-mx-socinfo.c | 2 +- drivers/soc/apple/rtkit.c | 2 +- drivers/soc/aspeed/aspeed-p2a-ctrl.c | 2 +- drivers/soc/aspeed/aspeed-socinfo.c | 2 +- drivers/soc/atmel/soc.c | 2 +- drivers/soc/bcm/brcmstb/common.c | 2 +- drivers/soc/cirrus/soc-ep93xx.c | 2 +- drivers/soc/dove/pmu.c | 8 +- drivers/soc/fsl/dpaa2-console.c | 2 +- drivers/soc/fsl/dpio/dpio-service.c | 6 +- drivers/soc/fsl/dpio/qbman-portal.c | 2 +- drivers/soc/fsl/guts.c | 2 +- drivers/soc/fsl/qbman/bman.c | 2 +- drivers/soc/fsl/qbman/qman.c | 2 +- drivers/soc/fsl/qe/gpio.c | 2 +- drivers/soc/fsl/qe/ucc_fast.c | 2 +- drivers/soc/fsl/qe/ucc_slow.c | 2 +- drivers/soc/hisilicon/kunpeng_hccs.c | 2 +- drivers/soc/imx/soc-imx.c | 2 +- drivers/soc/mediatek/mtk-cmdq-helper.c | 2 +- drivers/soc/microchip/mpfs-sys-controller.c | 2 +- drivers/soc/nuvoton/wpcm450-soc.c | 2 +- drivers/soc/qcom/apr.c | 4 +- drivers/soc/qcom/llcc-qcom.c | 2 +- drivers/soc/qcom/ocmem.c | 2 +- drivers/soc/qcom/pdr_interface.c | 6 +- drivers/soc/qcom/qcom_pd_mapper.c | 8 +- drivers/soc/qcom/qmi_interface.c | 6 +- drivers/soc/qcom/rmtfs_mem.c | 2 +- drivers/soc/qcom/smem_state.c | 2 +- drivers/soc/renesas/renesas-soc.c | 2 +- drivers/soc/tegra/fuse/fuse-tegra.c | 2 +- drivers/soc/tegra/pmc.c | 8 +- drivers/soc/ti/k3-socinfo.c | 2 +- drivers/soc/ux500/ux500-soc-id.c | 2 +- drivers/soc/versatile/soc-integrator.c | 2 +- drivers/soc/xilinx/xlnx_event_manager.c | 10 +- drivers/soundwire/amd_init.c | 2 +- drivers/soundwire/amd_manager.c | 2 +- drivers/soundwire/cadence_master.c | 2 +- drivers/soundwire/debugfs.c | 2 +- drivers/soundwire/generic_bandwidth_allocation.c | 2 +- drivers/soundwire/intel_ace2x.c | 2 +- drivers/soundwire/intel_init.c | 6 +- drivers/soundwire/master.c | 2 +- drivers/soundwire/slave.c | 2 +- drivers/soundwire/stream.c | 12 +-- drivers/spi/spi-amlogic-spifc-a4.c | 2 +- drivers/spi/spi-at91-usart.c | 2 +- drivers/spi/spi-atmel.c | 2 +- drivers/spi/spi-bcm-qspi.c | 2 +- drivers/spi/spi-bitbang.c | 2 +- drivers/spi/spi-davinci.c | 2 +- drivers/spi/spi-dw-core.c | 2 +- drivers/spi/spi-fsl-dspi.c | 2 +- drivers/spi/spi-fsl-espi.c | 2 +- drivers/spi/spi-fsl-spi.c | 2 +- drivers/spi/spi-hisi-kunpeng.c | 2 +- drivers/spi/spi-mem.c | 2 +- drivers/spi/spi-mpc512x-psc.c | 2 +- drivers/spi/spi-mpc52xx-psc.c | 2 +- drivers/spi/spi-mtk-snfi.c | 2 +- drivers/spi/spi-mxs.c | 2 +- drivers/spi/spi-offload.c | 2 +- drivers/spi/spi-omap-uwire.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 2 +- drivers/spi/spi-pic32-sqi.c | 2 +- drivers/spi/spi-pl022.c | 2 +- drivers/spi/spi-ppc4xx.c | 2 +- drivers/spi/spi-pxa2xx.c | 2 +- drivers/spi/spi-qpic-snand.c | 2 +- drivers/spi/spi-s3c64xx.c | 2 +- drivers/spi/spi-tegra114.c | 2 +- drivers/spi/spi-tle62x0.c | 2 +- drivers/spi/spi-topcliff-pch.c | 4 +- drivers/spi/spi.c | 4 +- drivers/spi/spidev.c | 4 +- drivers/spmi/spmi.c | 2 +- drivers/ssb/bridge_pcmcia_80211.c | 2 +- drivers/ssb/driver_gige.c | 2 +- drivers/ssb/main.c | 2 +- drivers/ssb/pcihost_wrapper.c | 2 +- drivers/staging/greybus/authentication.c | 2 +- drivers/staging/greybus/bootrom.c | 2 +- drivers/staging/greybus/camera.c | 6 +- drivers/staging/greybus/fw-core.c | 2 +- drivers/staging/greybus/fw-download.c | 4 +- drivers/staging/greybus/fw-management.c | 2 +- drivers/staging/greybus/gbphy.c | 4 +- drivers/staging/greybus/gpio.c | 4 +- drivers/staging/greybus/hid.c | 2 +- drivers/staging/greybus/i2c.c | 2 +- drivers/staging/greybus/light.c | 6 +- drivers/staging/greybus/log.c | 2 +- drivers/staging/greybus/loopback.c | 4 +- drivers/staging/greybus/power_supply.c | 2 +- drivers/staging/greybus/raw.c | 2 +- drivers/staging/greybus/uart.c | 2 +- drivers/staging/greybus/vibrator.c | 2 +- drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +- drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 2 +- .../media/atomisp/pci/atomisp_gmin_platform.c | 2 +- drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 2 +- .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c | 4 +- .../isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c | 2 +- .../media/atomisp/pci/runtime/frame/src/frame.c | 2 +- .../atomisp/pci/runtime/pipeline/src/pipeline.c | 2 +- drivers/staging/media/atomisp/pci/sh_css.c | 4 +- .../staging/media/atomisp/pci/sh_css_host_data.c | 2 +- .../staging/media/atomisp/pci/sh_css_param_dvs.c | 2 +- .../media/atomisp/pci/sh_css_param_shading.c | 2 +- drivers/staging/media/atomisp/pci/sh_css_params.c | 20 ++-- drivers/staging/media/av7110/av7110.c | 2 +- drivers/staging/media/av7110/sp8870.c | 2 +- drivers/staging/media/imx/imx-media-csc-scaler.c | 6 +- drivers/staging/media/ipu3/ipu3-css-fw.c | 2 +- drivers/staging/media/ipu3/ipu3-css.c | 2 +- drivers/staging/media/ipu3/ipu3-dmamap.c | 2 +- drivers/staging/media/ipu3/ipu3-mmu.c | 2 +- drivers/staging/media/ipu7/ipu7-bus.c | 2 +- drivers/staging/media/ipu7/ipu7-dma.c | 2 +- drivers/staging/media/ipu7/ipu7-mmu.c | 4 +- drivers/staging/media/ipu7/ipu7.c | 6 +- drivers/staging/media/meson/vdec/codec_h264.c | 2 +- drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +- drivers/staging/media/meson/vdec/codec_vp9.c | 4 +- drivers/staging/media/meson/vdec/vdec.c | 4 +- drivers/staging/media/meson/vdec/vdec_helpers.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 2 +- drivers/staging/media/tegra-video/csi.c | 2 +- drivers/staging/media/tegra-video/vi.c | 2 +- drivers/staging/media/tegra-video/video.c | 2 +- drivers/staging/most/dim2/dim2.c | 2 +- drivers/staging/most/video/video.c | 4 +- drivers/staging/nvec/nvec_ps2.c | 2 +- drivers/staging/rtl8723bs/core/rtw_ap.c | 8 +- drivers/staging/rtl8723bs/core/rtw_cmd.c | 28 +++--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 +- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 4 +- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 6 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +- .../vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +- drivers/staging/vme_user/vme.c | 24 ++--- drivers/staging/vme_user/vme_fake.c | 10 +- drivers/staging/vme_user/vme_tsi148.c | 14 +-- drivers/staging/vme_user/vme_user.c | 2 +- drivers/target/iscsi/cxgbit/cxgbit_cm.c | 4 +- drivers/target/iscsi/cxgbit/cxgbit_main.c | 2 +- drivers/target/iscsi/iscsi_target.c | 10 +- drivers/target/iscsi/iscsi_target_auth.c | 2 +- drivers/target/iscsi/iscsi_target_erl2.c | 2 +- drivers/target/iscsi/iscsi_target_login.c | 10 +- drivers/target/iscsi/iscsi_target_parameters.c | 10 +- drivers/target/iscsi/iscsi_target_tpg.c | 4 +- drivers/target/loopback/tcm_loop.c | 4 +- drivers/target/sbp/sbp_target.c | 14 +-- drivers/target/target_core_configfs.c | 4 +- drivers/target/target_core_device.c | 6 +- drivers/target/target_core_fabric_configfs.c | 2 +- drivers/target/target_core_file.c | 8 +- drivers/target/target_core_hba.c | 4 +- drivers/target/target_core_iblock.c | 6 +- drivers/target/target_core_pr.c | 2 +- drivers/target/target_core_pscsi.c | 6 +- drivers/target/target_core_rd.c | 10 +- drivers/target/target_core_tpg.c | 2 +- drivers/target/target_core_transport.c | 4 +- drivers/target/target_core_user.c | 4 +- drivers/target/target_core_xcopy.c | 2 +- drivers/target/tcm_fc/tfc_conf.c | 4 +- drivers/target/tcm_fc/tfc_sess.c | 4 +- drivers/target/tcm_remote/tcm_remote.c | 2 +- drivers/tc/tc.c | 2 +- drivers/tee/amdtee/call.c | 4 +- drivers/tee/amdtee/core.c | 10 +- drivers/tee/amdtee/shm_pool.c | 2 +- drivers/tee/optee/call.c | 4 +- drivers/tee/optee/core.c | 2 +- drivers/tee/optee/device.c | 2 +- drivers/tee/optee/ffa_abi.c | 8 +- drivers/tee/optee/notif.c | 2 +- drivers/tee/optee/protmem.c | 2 +- drivers/tee/optee/rpc.c | 4 +- drivers/tee/optee/smc_abi.c | 4 +- drivers/tee/optee/supp.c | 2 +- drivers/tee/qcomtee/call.c | 2 +- drivers/tee/qcomtee/core.c | 2 +- drivers/tee/qcomtee/qcomtee_object.h | 2 +- drivers/tee/qcomtee/shm.c | 2 +- drivers/tee/qcomtee/user_obj.c | 4 +- drivers/tee/tee_core.c | 8 +- drivers/tee/tee_heap.c | 8 +- drivers/tee/tee_shm.c | 12 +-- drivers/tee/tee_shm_pool.c | 2 +- drivers/tee/tstee/core.c | 8 +- drivers/thermal/cpufreq_cooling.c | 2 +- drivers/thermal/cpuidle_cooling.c | 2 +- drivers/thermal/devfreq_cooling.c | 2 +- drivers/thermal/gov_power_allocator.c | 6 +- .../intel/int340x_thermal/acpi_thermal_rel.c | 6 +- .../intel/int340x_thermal/int3400_thermal.c | 4 +- .../intel/int340x_thermal/int340x_thermal_zone.c | 2 +- drivers/thermal/intel/intel_hfi.c | 2 +- drivers/thermal/intel/intel_quark_dts_thermal.c | 2 +- drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- drivers/thermal/intel/x86_pkg_temp_thermal.c | 4 +- drivers/thermal/k3_j72xx_bandgap.c | 2 +- drivers/thermal/thermal_core.c | 6 +- drivers/thermal/thermal_debugfs.c | 6 +- drivers/thermal/thermal_hwmon.c | 4 +- drivers/thermal/thermal_sysfs.c | 4 +- drivers/thermal/thermal_thresholds.c | 2 +- drivers/thunderbolt/ctl.c | 6 +- drivers/thunderbolt/debugfs.c | 2 +- drivers/thunderbolt/dma_port.c | 2 +- drivers/thunderbolt/dma_test.c | 4 +- drivers/thunderbolt/domain.c | 4 +- drivers/thunderbolt/icm.c | 6 +- drivers/thunderbolt/nhi.c | 2 +- drivers/thunderbolt/nvm.c | 2 +- drivers/thunderbolt/path.c | 8 +- drivers/thunderbolt/property.c | 6 +- drivers/thunderbolt/retimer.c | 2 +- drivers/thunderbolt/switch.c | 6 +- drivers/thunderbolt/tb.c | 4 +- drivers/thunderbolt/tunnel.c | 4 +- drivers/thunderbolt/usb4_port.c | 2 +- drivers/thunderbolt/xdomain.c | 6 +- drivers/tty/ehv_bytechan.c | 2 +- drivers/tty/hvc/hvc_iucv.c | 2 +- drivers/tty/hvc/hvc_opal.c | 2 +- drivers/tty/hvc/hvc_vio.c | 2 +- drivers/tty/hvc/hvc_xen.c | 8 +- drivers/tty/hvc/hvcs.c | 4 +- drivers/tty/ipwireless/hardware.c | 2 +- drivers/tty/ipwireless/main.c | 2 +- drivers/tty/ipwireless/network.c | 4 +- drivers/tty/ipwireless/tty.c | 2 +- drivers/tty/n_gsm.c | 2 +- drivers/tty/n_hdlc.c | 2 +- drivers/tty/nozomi.c | 2 +- drivers/tty/pty.c | 4 +- drivers/tty/rpmsg_tty.c | 2 +- drivers/tty/serdev/core.c | 2 +- drivers/tty/serial/8250/8250_acorn.c | 2 +- drivers/tty/serial/8250/8250_core.c | 2 +- drivers/tty/serial/8250/8250_hp300.c | 2 +- drivers/tty/serial/8250/8250_ni.c | 2 +- drivers/tty/serial/8250/8250_of.c | 2 +- drivers/tty/serial/8250/serial_cs.c | 2 +- drivers/tty/serial/icom.c | 2 +- drivers/tty/serial/jsm/jsm_driver.c | 2 +- drivers/tty/serial/max3100.c | 2 +- drivers/tty/serial/pch_uart.c | 2 +- drivers/tty/serial/pxa.c | 2 +- drivers/tty/serial/serial_base_bus.c | 4 +- drivers/tty/serial/serial_core.c | 2 +- drivers/tty/serial/sunhv.c | 2 +- drivers/tty/serial/sunsu.c | 2 +- drivers/tty/serial/timbuart.c | 2 +- drivers/tty/serial/ucc_uart.c | 2 +- drivers/tty/synclink_gt.c | 2 +- drivers/tty/sysrq.c | 2 +- drivers/tty/tty_audit.c | 2 +- drivers/tty/tty_io.c | 14 +-- drivers/tty/vcc.c | 4 +- drivers/tty/vt/consolemap.c | 2 +- drivers/tty/vt/vc_screen.c | 2 +- drivers/tty/vt/vt.c | 2 +- drivers/ufs/core/ufs-hwmon.c | 2 +- drivers/uio/uio.c | 8 +- drivers/usb/atm/cxacru.c | 2 +- drivers/usb/atm/speedtch.c | 2 +- drivers/usb/atm/ueagle-atm.c | 2 +- drivers/usb/atm/usbatm.c | 2 +- drivers/usb/c67x00/c67x00-drv.c | 2 +- drivers/usb/cdns3/cdns3-gadget.c | 2 +- drivers/usb/cdns3/cdns3-pci-wrap.c | 2 +- drivers/usb/cdns3/cdnsp-gadget.c | 2 +- drivers/usb/cdns3/cdnsp-pci.c | 2 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/class/cdc-wdm.c | 6 +- drivers/usb/class/usblp.c | 2 +- drivers/usb/class/usbtmc.c | 4 +- drivers/usb/common/ulpi.c | 2 +- drivers/usb/core/config.c | 4 +- drivers/usb/core/devio.c | 10 +- drivers/usb/core/driver.c | 2 +- drivers/usb/core/endpoint.c | 2 +- drivers/usb/core/hcd.c | 2 +- drivers/usb/core/hub.c | 12 +-- drivers/usb/core/ledtrig-usbport.c | 4 +- drivers/usb/core/message.c | 2 +- drivers/usb/core/port.c | 4 +- drivers/usb/core/quirks.c | 2 +- drivers/usb/core/usb.c | 2 +- drivers/usb/dwc2/hcd.c | 2 +- drivers/usb/dwc3/debugfs.c | 2 +- drivers/usb/dwc3/gadget.c | 4 +- drivers/usb/fotg210/fotg210-hcd.c | 2 +- drivers/usb/fotg210/fotg210-udc.c | 4 +- drivers/usb/gadget/composite.c | 2 +- drivers/usb/gadget/configfs.c | 8 +- drivers/usb/gadget/function/f_acm.c | 4 +- drivers/usb/gadget/function/f_ecm.c | 4 +- drivers/usb/gadget/function/f_eem.c | 6 +- drivers/usb/gadget/function/f_fs.c | 22 ++--- drivers/usb/gadget/function/f_hid.c | 6 +- drivers/usb/gadget/function/f_loopback.c | 4 +- drivers/usb/gadget/function/f_mass_storage.c | 12 +-- drivers/usb/gadget/function/f_midi.c | 2 +- drivers/usb/gadget/function/f_midi2.c | 8 +- drivers/usb/gadget/function/f_ncm.c | 2 +- drivers/usb/gadget/function/f_obex.c | 4 +- drivers/usb/gadget/function/f_phonet.c | 2 +- drivers/usb/gadget/function/f_printer.c | 4 +- drivers/usb/gadget/function/f_rndis.c | 6 +- drivers/usb/gadget/function/f_serial.c | 4 +- drivers/usb/gadget/function/f_sourcesink.c | 4 +- drivers/usb/gadget/function/f_subset.c | 4 +- drivers/usb/gadget/function/f_tcm.c | 10 +- drivers/usb/gadget/function/f_uac1.c | 4 +- drivers/usb/gadget/function/f_uac1_legacy.c | 4 +- drivers/usb/gadget/function/f_uac2.c | 4 +- drivers/usb/gadget/function/f_uvc.c | 4 +- drivers/usb/gadget/function/rndis.c | 2 +- drivers/usb/gadget/function/u_audio.c | 2 +- drivers/usb/gadget/function/u_serial.c | 4 +- drivers/usb/gadget/function/u_uac1_legacy.c | 2 +- drivers/usb/gadget/function/uvc_configfs.c | 28 +++--- drivers/usb/gadget/function/uvc_v4l2.c | 2 +- drivers/usb/gadget/function/uvc_video.c | 2 +- drivers/usb/gadget/legacy/dbgp.c | 2 +- drivers/usb/gadget/legacy/g_ffs.c | 4 +- drivers/usb/gadget/legacy/hid.c | 2 +- drivers/usb/gadget/legacy/inode.c | 8 +- drivers/usb/gadget/legacy/raw_gadget.c | 4 +- drivers/usb/gadget/udc/amd5536udc_pci.c | 2 +- drivers/usb/gadget/udc/aspeed-vhub/dev.c | 4 +- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- drivers/usb/gadget/udc/core.c | 2 +- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- drivers/usb/gadget/udc/fsl_qe_udc.c | 2 +- drivers/usb/gadget/udc/fsl_udc_core.c | 4 +- drivers/usb/gadget/udc/goku_udc.c | 2 +- drivers/usb/gadget/udc/m66592-udc.c | 2 +- drivers/usb/gadget/udc/net2280.c | 2 +- drivers/usb/gadget/udc/omap_udc.c | 2 +- drivers/usb/host/ehci-dbg.c | 2 +- drivers/usb/host/fhci-hcd.c | 12 +-- drivers/usb/host/fhci-tds.c | 4 +- drivers/usb/host/max3421-hcd.c | 4 +- drivers/usb/host/ohci-dbg.c | 2 +- drivers/usb/host/sl811_cs.c | 2 +- drivers/usb/host/uhci-debug.c | 2 +- drivers/usb/host/xhci-dbgcap.c | 2 +- drivers/usb/host/xhci-dbgtty.c | 2 +- drivers/usb/host/xhci-debugfs.c | 6 +- drivers/usb/host/xhci-mtk-sch.c | 4 +- drivers/usb/host/xhci-sideband.c | 4 +- drivers/usb/image/mdc800.c | 2 +- drivers/usb/image/microtek.c | 2 +- drivers/usb/misc/adutux.c | 2 +- drivers/usb/misc/apple-mfi-fastcharge.c | 2 +- drivers/usb/misc/appledisplay.c | 2 +- drivers/usb/misc/chaoskey.c | 2 +- drivers/usb/misc/cypress_cy7c63.c | 2 +- drivers/usb/misc/cytherm.c | 2 +- drivers/usb/misc/idmouse.c | 2 +- drivers/usb/misc/iowarrior.c | 2 +- drivers/usb/misc/ldusb.c | 2 +- drivers/usb/misc/legousbtower.c | 2 +- drivers/usb/misc/lvstest.c | 2 +- drivers/usb/misc/onboard_usb_dev.c | 2 +- drivers/usb/misc/onboard_usb_dev_pdevs.c | 2 +- drivers/usb/misc/sisusbvga/sisusbvga.c | 2 +- drivers/usb/misc/trancevibrator.c | 2 +- drivers/usb/misc/usb-ljca.c | 8 +- drivers/usb/misc/usbio.c | 2 +- drivers/usb/misc/usblcd.c | 2 +- drivers/usb/misc/usbsevseg.c | 2 +- drivers/usb/misc/usbtest.c | 12 +-- drivers/usb/misc/uss720.c | 2 +- drivers/usb/misc/yurex.c | 2 +- drivers/usb/mon/mon_bin.c | 2 +- drivers/usb/mon/mon_main.c | 2 +- drivers/usb/mon/mon_stat.c | 2 +- drivers/usb/mon/mon_text.c | 2 +- drivers/usb/mtu3/mtu3_core.c | 2 +- drivers/usb/musb/musb_cppi41.c | 2 +- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/musb/tusb6010_omap.c | 6 +- drivers/usb/musb/ux500_dma.c | 2 +- drivers/usb/phy/phy-fsl-usb.c | 4 +- drivers/usb/phy/phy-fsl-usb.h | 2 +- drivers/usb/renesas_usbhs/mod_gadget.c | 4 +- drivers/usb/renesas_usbhs/pipe.c | 2 +- drivers/usb/roles/class.c | 2 +- drivers/usb/serial/ark3116.c | 2 +- drivers/usb/serial/belkin_sa.c | 2 +- drivers/usb/serial/ch341.c | 2 +- drivers/usb/serial/console.c | 2 +- drivers/usb/serial/cp210x.c | 4 +- drivers/usb/serial/cyberjack.c | 2 +- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/digi_acceleport.c | 4 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/garmin_gps.c | 2 +- drivers/usb/serial/io_edgeport.c | 6 +- drivers/usb/serial/io_ti.c | 22 ++--- drivers/usb/serial/ipw.c | 2 +- drivers/usb/serial/ir-usb.c | 2 +- drivers/usb/serial/iuu_phoenix.c | 2 +- drivers/usb/serial/keyspan.c | 4 +- drivers/usb/serial/keyspan_pda.c | 2 +- drivers/usb/serial/kl5kusb105.c | 4 +- drivers/usb/serial/kobil_sct.c | 2 +- drivers/usb/serial/mct_u232.c | 2 +- drivers/usb/serial/metro-usb.c | 2 +- drivers/usb/serial/mos7720.c | 4 +- drivers/usb/serial/mos7840.c | 2 +- drivers/usb/serial/omninet.c | 2 +- drivers/usb/serial/opticon.c | 2 +- drivers/usb/serial/option.c | 2 +- drivers/usb/serial/oti6858.c | 2 +- drivers/usb/serial/pl2303.c | 4 +- drivers/usb/serial/qcserial.c | 2 +- drivers/usb/serial/quatech2.c | 4 +- drivers/usb/serial/sierra.c | 4 +- drivers/usb/serial/spcp8x5.c | 2 +- drivers/usb/serial/ssu100.c | 2 +- drivers/usb/serial/symbolserial.c | 2 +- drivers/usb/serial/ti_usb_3410_5052.c | 6 +- drivers/usb/serial/upd78f0730.c | 2 +- drivers/usb/serial/usb-serial.c | 8 +- drivers/usb/serial/usb_wwan.c | 2 +- drivers/usb/serial/whiteheat.c | 4 +- drivers/usb/serial/xr_serial.c | 4 +- drivers/usb/storage/ene_ub6250.c | 2 +- drivers/usb/storage/isd200.c | 2 +- drivers/usb/storage/onetouch.c | 2 +- drivers/usb/storage/realtek_cr.c | 2 +- drivers/usb/storage/sierra_ms.c | 4 +- drivers/usb/storage/usb.c | 2 +- drivers/usb/typec/class.c | 10 +- drivers/usb/typec/mode_selection.c | 4 +- drivers/usb/typec/mux.c | 8 +- drivers/usb/typec/pd.c | 6 +- drivers/usb/typec/retimer.c | 2 +- drivers/usb/typec/tcpm/tcpm.c | 2 +- drivers/usb/typec/ucsi/debugfs.c | 2 +- drivers/usb/typec/ucsi/ucsi.c | 4 +- drivers/usb/usb-skeleton.c | 2 +- drivers/usb/usbip/stub_dev.c | 2 +- drivers/usb/usbip/stub_rx.c | 2 +- drivers/usb/usbip/stub_tx.c | 2 +- drivers/usb/usbip/vhci_hcd.c | 2 +- drivers/usb/usbip/vhci_tx.c | 2 +- drivers/usb/usbip/vudc_dev.c | 8 +- drivers/usb/usbip/vudc_tx.c | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/mlx5/core/mr.c | 10 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 18 ++-- drivers/vdpa/pds/aux_drv.c | 2 +- drivers/vdpa/solidrun/snet_main.c | 6 +- drivers/vdpa/vdpa_user/iova_domain.c | 2 +- drivers/vdpa/vdpa_user/vduse_dev.c | 16 ++-- drivers/vdpa/virtio_pci/vp_vdpa.c | 6 +- drivers/vfio/cdx/intr.c | 2 +- drivers/vfio/container.c | 2 +- drivers/vfio/group.c | 2 +- drivers/vfio/mdev/mdev_core.c | 2 +- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 4 +- drivers/vfio/pci/pds/dirty.c | 4 +- drivers/vfio/pci/pds/lm.c | 4 +- drivers/vfio/pci/qat/main.c | 4 +- drivers/vfio/pci/vfio_pci_core.c | 8 +- drivers/vfio/pci/vfio_pci_dmabuf.c | 2 +- drivers/vfio/vfio_iommu_spapr_tce.c | 6 +- drivers/vfio/vfio_iommu_type1.c | 14 +-- drivers/vfio/vfio_main.c | 4 +- drivers/vhost/iotlb.c | 2 +- drivers/vhost/net.c | 6 +- drivers/vhost/scsi.c | 22 ++--- drivers/vhost/test.c | 4 +- drivers/vhost/vdpa.c | 8 +- drivers/vhost/vhost.c | 6 +- drivers/vhost/vsock.c | 2 +- drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 +- drivers/video/console/sticon.c | 2 +- drivers/video/fbdev/aty/radeon_backlight.c | 2 +- drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/carminefb.c | 2 +- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/core/fb_defio.c | 2 +- drivers/video/fbdev/core/fbcon.c | 2 +- drivers/video/fbdev/core/fbmon.c | 8 +- drivers/video/fbdev/core/modedb.c | 2 +- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/goldfishfb.c | 2 +- drivers/video/fbdev/matrox/i2c-matroxfb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_base.c | 2 +- drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +- drivers/video/fbdev/matrox/matroxfb_maven.c | 2 +- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c | 2 +- drivers/video/fbdev/neofb.c | 2 +- drivers/video/fbdev/nvidia/nv_setup.c | 6 +- drivers/video/fbdev/omap/lcd_mipid.c | 2 +- drivers/video/fbdev/omap/omapfb_main.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 2 +- .../fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 4 +- drivers/video/fbdev/omap2/omapfb/dss/overlay.c | 2 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 8 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/pxa3xx-gcu.c | 2 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 2 +- drivers/video/fbdev/simplefb.c | 2 +- drivers/video/fbdev/sm501fb.c | 2 +- drivers/video/fbdev/smscufx.c | 6 +- drivers/video/fbdev/udlfb.c | 6 +- drivers/video/fbdev/uvesafb.c | 10 +- drivers/video/fbdev/via/via_aux.c | 2 +- drivers/video/fbdev/via/via_aux.h | 2 +- drivers/video/fbdev/via/via_aux_edid.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- drivers/video/of_display_timing.c | 4 +- drivers/video/sticore.c | 10 +- drivers/video/vgastate.c | 2 +- drivers/virt/acrn/hsm.c | 6 +- drivers/virt/acrn/ioeventfd.c | 2 +- drivers/virt/acrn/ioreq.c | 6 +- drivers/virt/acrn/irqfd.c | 2 +- drivers/virt/acrn/mm.c | 6 +- drivers/virt/coco/guest/report.c | 2 +- drivers/virt/coco/tsm-core.c | 2 +- drivers/virt/fsl_hypervisor.c | 6 +- drivers/virt/nitro_enclaves/ne_misc_dev.c | 4 +- drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 +- drivers/virt/vboxguest/vboxguest_core.c | 4 +- drivers/virtio/virtio_balloon.c | 2 +- drivers/virtio/virtio_input.c | 2 +- drivers/virtio/virtio_mem.c | 2 +- drivers/virtio/virtio_mmio.c | 2 +- drivers/virtio/virtio_pci_admin_legacy_io.c | 4 +- drivers/virtio/virtio_pci_common.c | 8 +- drivers/virtio/virtio_pci_modern.c | 22 ++--- drivers/virtio/virtio_ring.c | 10 +- drivers/virtio/virtio_vdpa.c | 4 +- drivers/w1/masters/ds2490.c | 2 +- drivers/w1/slaves/w1_ds2433.c | 2 +- drivers/w1/slaves/w1_ds28e04.c | 2 +- drivers/w1/slaves/w1_therm.c | 2 +- drivers/w1/w1.c | 2 +- drivers/watchdog/exar_wdt.c | 2 +- drivers/watchdog/mei_wdt.c | 2 +- drivers/watchdog/pcwd_usb.c | 2 +- drivers/watchdog/watchdog_dev.c | 2 +- drivers/watchdog/watchdog_pretimeout.c | 4 +- drivers/xen/arm-device.c | 6 +- drivers/xen/balloon.c | 2 +- drivers/xen/events/events_base.c | 2 +- drivers/xen/evtchn.c | 6 +- drivers/xen/gntalloc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 12 +-- drivers/xen/gntdev.c | 18 ++-- drivers/xen/grant-table.c | 4 +- drivers/xen/mcelog.c | 2 +- drivers/xen/pci.c | 2 +- drivers/xen/pcpu.c | 2 +- drivers/xen/privcmd-buf.c | 2 +- drivers/xen/privcmd.c | 12 +-- drivers/xen/pvcalls-back.c | 6 +- drivers/xen/pvcalls-front.c | 6 +- drivers/xen/sys-hypervisor.c | 8 +- drivers/xen/unpopulated-alloc.c | 6 +- drivers/xen/xen-front-pgdir-shbuf.c | 6 +- drivers/xen/xen-pciback/conf_space.c | 2 +- drivers/xen/xen-pciback/conf_space_header.c | 4 +- drivers/xen/xen-pciback/conf_space_quirks.c | 2 +- drivers/xen/xen-pciback/passthrough.c | 4 +- drivers/xen/xen-pciback/pci_stub.c | 8 +- drivers/xen/xen-pciback/pciback_ops.c | 2 +- drivers/xen/xen-pciback/vpci.c | 4 +- drivers/xen/xen-pciback/xenbus.c | 2 +- drivers/xen/xen-scsiback.c | 10 +- drivers/xen/xenbus/xenbus_client.c | 4 +- drivers/xen/xenbus/xenbus_dev_frontend.c | 6 +- drivers/xen/xlate_mmu.c | 4 +- fs/9p/vfs_super.c | 4 +- fs/adfs/dir.c | 2 +- fs/adfs/map.c | 2 +- fs/adfs/super.c | 2 +- fs/affs/dir.c | 2 +- fs/affs/super.c | 4 +- fs/afs/cell.c | 2 +- fs/afs/cmservice.c | 4 +- fs/afs/dir.c | 4 +- fs/afs/dir_silly.c | 2 +- fs/afs/file.c | 4 +- fs/afs/fs_operation.c | 2 +- fs/afs/fs_probe.c | 2 +- fs/afs/main.c | 2 +- fs/afs/proc.c | 2 +- fs/afs/server.c | 2 +- fs/afs/super.c | 4 +- fs/afs/vlclient.c | 2 +- fs/afs/volume.c | 2 +- fs/afs/xattr.c | 2 +- fs/autofs/inode.c | 6 +- fs/autofs/waitq.c | 2 +- fs/befs/linuxvfs.c | 4 +- fs/bfs/inode.c | 2 +- fs/binfmt_elf.c | 10 +- fs/binfmt_elf_fdpic.c | 10 +- fs/binfmt_misc.c | 2 +- fs/btrfs/async-thread.c | 4 +- fs/btrfs/backref.c | 4 +- fs/btrfs/compression.c | 8 +- fs/btrfs/extent_io.h | 2 +- fs/btrfs/file.c | 4 +- fs/btrfs/inode.c | 4 +- fs/btrfs/ioctl.c | 12 +-- fs/btrfs/lzo.c | 2 +- fs/btrfs/qgroup.c | 4 +- fs/btrfs/scrub.c | 2 +- fs/btrfs/send.c | 16 ++-- fs/btrfs/super.c | 4 +- fs/btrfs/sysfs.c | 2 +- fs/btrfs/tests/btrfs-tests.c | 10 +- fs/btrfs/tests/delayed-refs-tests.c | 2 +- fs/btrfs/volumes.c | 4 +- fs/btrfs/zlib.c | 2 +- fs/btrfs/zoned.c | 2 +- fs/btrfs/zstd.c | 4 +- fs/cachefiles/daemon.c | 2 +- fs/cachefiles/io.c | 4 +- fs/cachefiles/volume.c | 2 +- fs/ceph/caps.c | 2 +- fs/ceph/crypto.c | 4 +- fs/ceph/file.c | 2 +- fs/ceph/quota.c | 2 +- fs/ceph/super.c | 6 +- fs/char_dev.c | 4 +- fs/coda/dir.c | 2 +- fs/coda/file.c | 4 +- fs/coda/inode.c | 2 +- fs/coda/upcall.c | 6 +- fs/configfs/dir.c | 4 +- fs/configfs/file.c | 2 +- fs/configfs/inode.c | 2 +- fs/coredump.c | 2 +- fs/cramfs/inode.c | 4 +- fs/crypto/inline_crypt.c | 4 +- fs/crypto/keyring.c | 4 +- fs/crypto/keysetup_v1.c | 2 +- fs/crypto/policy.c | 2 +- fs/debugfs/file.c | 2 +- fs/debugfs/inode.c | 2 +- fs/devpts/inode.c | 2 +- fs/dlm/config.c | 2 +- fs/dlm/lock.c | 2 +- fs/dlm/member.c | 2 +- fs/ecryptfs/crypto.c | 2 +- fs/ecryptfs/keystore.c | 4 +- fs/ecryptfs/main.c | 2 +- fs/ecryptfs/messaging.c | 2 +- fs/efivarfs/super.c | 4 +- fs/efs/super.c | 2 +- fs/erofs/decompressor_deflate.c | 2 +- fs/erofs/decompressor_lzma.c | 2 +- fs/erofs/decompressor_zstd.c | 2 +- fs/erofs/fscache.c | 8 +- fs/erofs/super.c | 8 +- fs/erofs/xattr.c | 2 +- fs/erofs/zutil.c | 4 +- fs/eventfd.c | 2 +- fs/eventpoll.c | 2 +- fs/exec.c | 2 +- fs/exfat/super.c | 2 +- fs/ext2/balloc.c | 2 +- fs/ext2/super.c | 6 +- fs/ext4/block_validity.c | 2 +- fs/ext4/dir.c | 2 +- fs/ext4/extents-test.c | 4 +- fs/ext4/mballoc-test.c | 12 +-- fs/ext4/mballoc.c | 4 +- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 16 ++-- fs/ext4/sysfs.c | 2 +- fs/f2fs/super.c | 8 +- fs/fat/inode.c | 4 +- fs/fcntl.c | 2 +- fs/freevxfs/vxfs_fshead.c | 2 +- fs/freevxfs/vxfs_super.c | 2 +- fs/fsopen.c | 2 +- fs/fuse/backing.c | 2 +- fs/fuse/cuse.c | 6 +- fs/fuse/dax.c | 4 +- fs/fuse/dev.c | 4 +- fs/fuse/dev_uring.c | 2 +- fs/fuse/file.c | 4 +- fs/fuse/inode.c | 12 +-- fs/fuse/virtio_fs.c | 14 +-- fs/gfs2/ops_fstype.c | 6 +- fs/gfs2/quota.c | 2 +- fs/gfs2/super.c | 4 +- fs/hfs/btree.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfs/super.c | 2 +- fs/hfsplus/btree.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hfsplus/super.c | 2 +- fs/hfsplus/unicode_test.c | 4 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/super.c | 4 +- fs/hugetlbfs/inode.c | 4 +- fs/iomap/direct-io.c | 2 +- fs/isofs/compress.c | 2 +- fs/isofs/inode.c | 4 +- fs/jbd2/journal.c | 6 +- fs/jbd2/revoke.c | 2 +- fs/jffs2/erase.c | 2 +- fs/jffs2/readinode.c | 2 +- fs/jffs2/scan.c | 2 +- fs/jffs2/summary.c | 6 +- fs/jffs2/super.c | 2 +- fs/jffs2/wbuf.c | 2 +- fs/jfs/jfs_dmap.c | 2 +- fs/jfs/jfs_imap.c | 2 +- fs/jfs/jfs_logmgr.c | 8 +- fs/jfs/super.c | 4 +- fs/kernfs/dir.c | 2 +- fs/kernfs/file.c | 4 +- fs/kernfs/mount.c | 4 +- fs/libfs.c | 4 +- fs/lockd/clntlock.c | 2 +- fs/lockd/clntproc.c | 4 +- fs/lockd/host.c | 2 +- fs/lockd/svclock.c | 4 +- fs/lockd/svcsubs.c | 2 +- fs/mbcache.c | 2 +- fs/minix/inode.c | 2 +- fs/namespace.c | 4 +- fs/netfs/buffered_read.c | 2 +- fs/netfs/buffered_write.c | 2 +- fs/netfs/fscache_cache.c | 2 +- fs/nfs/cache_lib.c | 2 +- fs/nfs/callback_proc.c | 2 +- fs/nfs/callback_xdr.c | 2 +- fs/nfs/client.c | 4 +- fs/nfs/dir.c | 10 +- fs/nfs/dns_resolve.c | 2 +- fs/nfs/fs_context.c | 2 +- fs/nfs/inode.c | 4 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs40proc.c | 2 +- fs/nfs/nfs42proc.c | 16 ++-- fs/nfs/nfs42xdr.c | 2 +- fs/nfs/nfs4file.c | 2 +- fs/nfs/nfs4idmap.c | 4 +- fs/nfs/nfs4namespace.c | 4 +- fs/nfs/nfs4proc.c | 18 ++-- fs/nfs/nfs4state.c | 2 +- fs/nfs/nfs4super.c | 2 +- fs/nfs/proc.c | 2 +- fs/nfs/sysfs.c | 4 +- fs/nfs/unlink.c | 4 +- fs/nfsd/blocklayoutxdr.c | 4 +- fs/nfsd/export.c | 6 +- fs/nfsd/filecache.c | 2 +- fs/nfsd/flexfilelayout.c | 4 +- fs/nfsd/nfs4callback.c | 4 +- fs/nfsd/nfs4idmap.c | 2 +- fs/nfsd/nfs4proc.c | 6 +- fs/nfsd/nfs4recover.c | 6 +- fs/nfsd/nfs4state.c | 12 +-- fs/nfsd/nfs4xdr.c | 4 +- fs/nfsd/nfsctl.c | 4 +- fs/nilfs2/segment.c | 2 +- fs/nilfs2/super.c | 2 +- fs/nilfs2/the_nilfs.c | 4 +- fs/notify/mark.c | 2 +- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/cluster/heartbeat.c | 4 +- fs/ocfs2/cluster/netdebug.c | 2 +- fs/ocfs2/cluster/nodemanager.c | 6 +- fs/ocfs2/dlm/dlmdomain.c | 8 +- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/ioctl.c | 4 +- fs/ocfs2/journal.c | 2 +- fs/ocfs2/localalloc.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/ocfs2/stack_o2cb.c | 2 +- fs/ocfs2/stack_user.c | 4 +- fs/ocfs2/stackglue.c | 2 +- fs/ocfs2/suballoc.c | 6 +- fs/ocfs2/super.c | 4 +- fs/omfs/inode.c | 4 +- fs/orangefs/dir.c | 2 +- fs/orangefs/inode.c | 10 +- fs/orangefs/orangefs-bufmap.c | 4 +- fs/orangefs/orangefs-debugfs.c | 2 +- fs/orangefs/orangefs-mod.c | 2 +- fs/orangefs/orangefs-sysfs.c | 14 +-- fs/orangefs/super.c | 2 +- fs/orangefs/xattr.c | 4 +- fs/overlayfs/file.c | 2 +- fs/overlayfs/namei.c | 2 +- fs/overlayfs/params.c | 2 +- fs/overlayfs/readdir.c | 4 +- fs/overlayfs/super.c | 4 +- fs/overlayfs/util.c | 2 +- fs/proc/kcore.c | 6 +- fs/proc/root.c | 4 +- fs/proc/task_mmu.c | 2 +- fs/pstore/blk.c | 2 +- fs/pstore/inode.c | 6 +- fs/pstore/platform.c | 2 +- fs/pstore/ram.c | 2 +- fs/pstore/ram_core.c | 4 +- fs/pstore/zone.c | 4 +- fs/qnx4/inode.c | 2 +- fs/qnx6/inode.c | 4 +- fs/qnx6/super_mmi.c | 2 +- fs/quota/quota_v2.c | 2 +- fs/ramfs/inode.c | 2 +- fs/resctrl/monitor.c | 2 +- fs/resctrl/pseudo_lock.c | 4 +- fs/resctrl/rdtgroup.c | 8 +- fs/signalfd.c | 2 +- fs/smb/client/cached_dir.c | 2 +- fs/smb/client/cifsacl.c | 6 +- fs/smb/client/cifsencrypt.c | 2 +- fs/smb/client/cifsfs.c | 4 +- fs/smb/client/compress.c | 2 +- fs/smb/client/connect.c | 10 +- fs/smb/client/dfs.h | 2 +- fs/smb/client/file.c | 16 ++-- fs/smb/client/fs_context.c | 2 +- fs/smb/client/inode.c | 10 +- fs/smb/client/ioctl.c | 2 +- fs/smb/client/misc.c | 4 +- fs/smb/client/readdir.c | 2 +- fs/smb/client/sess.c | 2 +- fs/smb/client/smb1ops.c | 2 +- fs/smb/client/smb1session.c | 4 +- fs/smb/client/smb2file.c | 4 +- fs/smb/client/smb2misc.c | 4 +- fs/smb/client/smb2ops.c | 12 +-- fs/smb/client/smb2pdu.c | 20 ++-- fs/smb/client/smbdirect.c | 4 +- fs/splice.c | 8 +- fs/squashfs/cache.c | 4 +- fs/squashfs/decompressor_multi.c | 6 +- fs/squashfs/decompressor_single.c | 2 +- fs/squashfs/lz4_wrapper.c | 2 +- fs/squashfs/lzo_wrapper.c | 2 +- fs/squashfs/page_actor.c | 4 +- fs/squashfs/super.c | 4 +- fs/squashfs/xz_wrapper.c | 4 +- fs/squashfs/zlib_wrapper.c | 2 +- fs/squashfs/zstd_wrapper.c | 2 +- fs/super.c | 2 +- fs/sysfs/mount.c | 2 +- fs/timerfd.c | 2 +- fs/tracefs/event_inode.c | 4 +- fs/tracefs/inode.c | 2 +- fs/ubifs/debug.c | 2 +- fs/ubifs/dir.c | 2 +- fs/ubifs/lpt.c | 6 +- fs/ubifs/recovery.c | 2 +- fs/ubifs/replay.c | 8 +- fs/ubifs/super.c | 8 +- fs/ubifs/sysfs.c | 2 +- fs/udf/super.c | 8 +- fs/ufs/super.c | 6 +- fs/unicode/utf8-core.c | 2 +- fs/userfaultfd.c | 4 +- fs/vboxsf/file.c | 2 +- fs/vboxsf/super.c | 4 +- fs/vboxsf/utils.c | 4 +- fs/xfs/libxfs/xfs_ag.c | 2 +- fs/xfs/libxfs/xfs_rtgroup.c | 2 +- fs/xfs/scrub/stats.c | 2 +- fs/xfs/xfs_buf_item_recover.c | 2 +- fs/xfs/xfs_discard.c | 6 +- fs/xfs/xfs_extent_busy.c | 2 +- fs/xfs/xfs_fsmap.c | 4 +- fs/xfs/xfs_healthmon.c | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_super.c | 2 +- fs/xfs/xfs_zone_alloc.c | 2 +- fs/xfs/xfs_zone_gc.c | 2 +- fs/zonefs/super.c | 4 +- include/linux/acpi.h | 2 +- include/linux/crash_dump.h | 2 +- include/linux/dma-fence-chain.h | 2 +- include/linux/gameport.h | 2 +- include/linux/io-mapping.h | 2 +- include/net/act_api.h | 2 +- include/net/fq_impl.h | 2 +- init/initramfs.c | 4 +- init/initramfs_test.c | 4 +- io_uring/eventfd.c | 2 +- io_uring/io-wq.c | 4 +- io_uring/io_uring.c | 2 +- io_uring/kbuf.c | 2 +- io_uring/mock_file.c | 2 +- io_uring/rsrc.c | 2 +- io_uring/sqpoll.c | 2 +- io_uring/tctx.c | 6 +- io_uring/xattr.c | 4 +- io_uring/zcrx.c | 4 +- ipc/mqueue.c | 6 +- ipc/sem.c | 2 +- ipc/shm.c | 2 +- ipc/util.c | 2 +- kernel/acct.c | 2 +- kernel/async.c | 2 +- kernel/audit.c | 4 +- kernel/audit_fsnotify.c | 2 +- kernel/audit_watch.c | 4 +- kernel/auditfilter.c | 6 +- kernel/auditsc.c | 8 +- kernel/bpf/arena.c | 2 +- kernel/bpf/arraymap.c | 4 +- kernel/bpf/bpf_iter.c | 2 +- kernel/bpf/bpf_struct_ops.c | 6 +- kernel/bpf/btf.c | 4 +- kernel/bpf/cgroup.c | 2 +- kernel/bpf/crypto.c | 4 +- kernel/bpf/helpers.c | 2 +- kernel/bpf/inode.c | 2 +- kernel/bpf/offload.c | 4 +- kernel/bpf/trampoline.c | 8 +- kernel/bpf/verifier.c | 2 +- kernel/cgroup/cgroup-v1.c | 6 +- kernel/cgroup/cgroup.c | 8 +- kernel/cgroup/cpuset-v1.c | 8 +- kernel/cgroup/cpuset.c | 10 +- kernel/cgroup/debug.c | 2 +- kernel/cgroup/dmem.c | 6 +- kernel/cgroup/legacy_freezer.c | 2 +- kernel/cgroup/misc.c | 2 +- kernel/cgroup/pids.c | 2 +- kernel/cgroup/rdma.c | 6 +- kernel/crash_core.c | 2 +- kernel/crash_dump_dm_crypt.c | 2 +- kernel/dma/coherent.c | 2 +- kernel/dma/debug.c | 2 +- kernel/dma/direct.c | 2 +- kernel/dma/map_benchmark.c | 2 +- kernel/dma/remap.c | 2 +- kernel/dma/swiotlb.c | 6 +- kernel/events/core.c | 12 +-- kernel/events/uprobes.c | 12 +-- kernel/fail_function.c | 2 +- kernel/futex/pi.c | 2 +- kernel/futex/syscalls.c | 2 +- kernel/gcov/clang.c | 4 +- kernel/gcov/fs.c | 4 +- kernel/irq/affinity.c | 2 +- kernel/irq/irq_sim.c | 4 +- kernel/irq/irqdesc.c | 2 +- kernel/irq/irqdomain.c | 2 +- kernel/irq/manage.c | 6 +- kernel/irq/msi.c | 4 +- kernel/kallsyms_selftest.c | 2 +- kernel/kcov.c | 2 +- kernel/kcsan/kcsan_test.c | 4 +- kernel/kexec.c | 2 +- kernel/kexec_core.c | 4 +- kernel/kprobes.c | 8 +- kernel/kthread.c | 6 +- kernel/livepatch/core.c | 4 +- kernel/livepatch/patch.c | 2 +- kernel/liveupdate/kexec_handover.c | 4 +- kernel/liveupdate/kexec_handover_debugfs.c | 2 +- kernel/liveupdate/luo_file.c | 4 +- kernel/liveupdate/luo_flb.c | 2 +- kernel/liveupdate/luo_session.c | 2 +- kernel/locking/test-ww_mutex.c | 10 +- kernel/module/dups.c | 2 +- kernel/module/main.c | 2 +- kernel/module/stats.c | 2 +- kernel/module/sysfs.c | 4 +- kernel/module/tracking.c | 2 +- kernel/padata.c | 6 +- kernel/params.c | 4 +- kernel/power/console.c | 2 +- kernel/power/energy_model.c | 2 +- kernel/power/qos.c | 4 +- kernel/power/snapshot.c | 4 +- kernel/power/swap.c | 8 +- kernel/power/wakelock.c | 2 +- kernel/printk/nbcon.c | 2 +- kernel/printk/printk.c | 2 +- kernel/rcu/rcuscale.c | 6 +- kernel/rcu/rcutorture.c | 20 ++-- kernel/rcu/refscale.c | 4 +- kernel/rcu/srcutree.c | 2 +- kernel/rcu/update.c | 2 +- kernel/relay.c | 8 +- kernel/resource.c | 2 +- kernel/resource_kunit.c | 2 +- kernel/scftorture.c | 2 +- kernel/sched/autogroup.c | 2 +- kernel/sched/core_sched.c | 2 +- kernel/sched/cpuacct.c | 2 +- kernel/sched/cpudeadline.c | 2 +- kernel/sched/cpufreq_schedutil.c | 4 +- kernel/sched/cpupri.c | 2 +- kernel/sched/ext.c | 6 +- kernel/sched/fair.c | 6 +- kernel/sched/psi.c | 4 +- kernel/sched/rt.c | 4 +- kernel/sched/topology.c | 8 +- kernel/seccomp.c | 2 +- kernel/static_call_inline.c | 4 +- kernel/time/posix-clock.c | 2 +- kernel/time/timer_migration.c | 2 +- kernel/torture.c | 2 +- kernel/trace/blktrace.c | 4 +- kernel/trace/bpf_trace.c | 8 +- kernel/trace/fprobe.c | 2 +- kernel/trace/ftrace.c | 30 +++--- kernel/trace/pid_list.c | 6 +- kernel/trace/rethook.c | 2 +- kernel/trace/ring_buffer.c | 4 +- kernel/trace/trace.c | 28 +++--- kernel/trace/trace_btf.c | 2 +- kernel/trace/trace_eprobe.c | 4 +- kernel/trace/trace_events.c | 24 ++--- kernel/trace/trace_events_filter.c | 32 +++---- kernel/trace/trace_events_hist.c | 28 +++--- kernel/trace/trace_events_synth.c | 8 +- kernel/trace/trace_events_trigger.c | 4 +- kernel/trace/trace_events_user.c | 2 +- kernel/trace/trace_fprobe.c | 4 +- kernel/trace/trace_functions.c | 2 +- kernel/trace/trace_functions_graph.c | 2 +- kernel/trace/trace_kprobe.c | 2 +- kernel/trace/trace_mmiotrace.c | 2 +- kernel/trace/trace_osnoise.c | 2 +- kernel/trace/trace_printk.c | 2 +- kernel/trace/trace_probe.c | 8 +- kernel/trace/trace_recursion_record.c | 2 +- kernel/trace/trace_sched_switch.c | 2 +- kernel/trace/trace_selftest.c | 2 +- kernel/trace/trace_stat.c | 4 +- kernel/trace/trace_syscalls.c | 2 +- kernel/trace/trace_uprobe.c | 2 +- kernel/trace/tracing_map.c | 14 +-- kernel/tracepoint.c | 2 +- kernel/ucount.c | 2 +- kernel/vhost_task.c | 2 +- kernel/watch_queue.c | 4 +- kernel/workqueue.c | 16 ++-- lib/assoc_array.c | 18 ++-- lib/bch.c | 2 +- lib/codetag.c | 4 +- lib/cpu_rmap.c | 2 +- lib/crypto/gf128mul.c | 6 +- lib/crypto/mpi/mpih-mul.c | 2 +- lib/crypto/mpi/mpiutil.c | 6 +- lib/dim/net_dim.c | 2 +- lib/dynamic_debug.c | 2 +- lib/error-inject.c | 2 +- lib/group_cpus.c | 12 +-- lib/interval_tree_test.c | 2 +- lib/iov_iter.c | 4 +- lib/kobject.c | 4 +- lib/kobject_uevent.c | 6 +- lib/kunit/attributes.c | 2 +- lib/kunit/device.c | 2 +- lib/kunit/executor.c | 4 +- lib/kunit/executor_test.c | 2 +- lib/kunit/kunit-example-test.c | 2 +- lib/kunit/kunit-test.c | 2 +- lib/kunit/resource.c | 2 +- lib/kunit/static_stub.c | 2 +- lib/logic_iomem.c | 2 +- lib/lru_cache.c | 6 +- lib/lwq.c | 2 +- lib/objagg.c | 8 +- lib/parman.c | 2 +- lib/pldmfw/pldmfw.c | 8 +- lib/rbtree_test.c | 2 +- lib/reed_solomon/test_rslib.c | 4 +- lib/stackdepot.c | 2 +- lib/string_helpers.c | 2 +- lib/test_bpf.c | 48 +++++----- lib/test_debug_virtual.c | 2 +- lib/test_firmware.c | 4 +- lib/test_hmm.c | 4 +- lib/test_kho.c | 2 +- lib/test_memcat_p.c | 8 +- lib/test_objagg.c | 4 +- lib/test_parman.c | 2 +- lib/test_rhashtable.c | 2 +- lib/test_vmalloc.c | 4 +- lib/tests/kunit_iov_iter.c | 6 +- lib/xz/xz_dec_bcj.c | 2 +- lib/xz/xz_dec_lzma2.c | 4 +- lib/xz/xz_dec_stream.c | 2 +- lib/zlib_inflate/infutil.c | 2 +- mm/cma_debug.c | 2 +- mm/cma_sysfs.c | 2 +- mm/damon/core.c | 10 +- mm/damon/sysfs-common.c | 2 +- mm/damon/sysfs-schemes.c | 22 ++--- mm/damon/sysfs.c | 24 ++--- mm/dmapool_test.c | 2 +- mm/huge_memory.c | 2 +- mm/hugetlb.c | 14 +-- mm/hugetlb_cgroup.c | 4 +- mm/kasan/kasan_test_c.c | 12 +-- mm/khugepaged.c | 2 +- mm/kmsan/kmsan_test.c | 8 +- mm/list_lru.c | 2 +- mm/memcontrol.c | 2 +- mm/memfd_luo.c | 2 +- mm/memory-tiers.c | 4 +- mm/memory.c | 2 +- mm/mempolicy.c | 2 +- mm/mempool.c | 2 +- mm/page_reporting.c | 2 +- mm/shmem.c | 2 +- mm/shrinker.c | 2 +- mm/slub.c | 4 +- mm/swapfile.c | 6 +- mm/vmalloc.c | 6 +- mm/vmpressure.c | 2 +- mm/zsmalloc.c | 4 +- mm/zswap.c | 4 +- net/802/garp.c | 4 +- net/802/mrp.c | 4 +- net/8021q/vlan_core.c | 4 +- net/8021q/vlan_dev.c | 4 +- net/9p/client.c | 8 +- net/9p/trans_fd.c | 4 +- net/9p/trans_rdma.c | 2 +- net/9p/trans_usbg.c | 6 +- net/9p/trans_virtio.c | 4 +- net/9p/trans_xen.c | 4 +- net/appletalk/ddp.c | 2 +- net/atm/br2684.c | 2 +- net/atm/clip.c | 2 +- net/atm/lec.c | 4 +- net/atm/mpc.c | 4 +- net/atm/mpoa_caches.c | 4 +- net/atm/pppoatm.c | 2 +- net/atm/resources.c | 2 +- net/ax25/af_ax25.c | 2 +- net/ax25/ax25_dev.c | 2 +- net/ax25/ax25_uid.c | 2 +- net/bluetooth/6lowpan.c | 2 +- net/bluetooth/cmtp/capi.c | 2 +- net/bluetooth/cmtp/core.c | 2 +- net/bluetooth/hci_conn.c | 12 +-- net/bluetooth/hci_core.c | 20 ++-- net/bluetooth/hci_sync.c | 10 +- net/bluetooth/hidp/core.c | 2 +- net/bluetooth/iso.c | 2 +- net/bluetooth/l2cap_core.c | 2 +- net/bluetooth/mgmt.c | 10 +- net/bluetooth/mgmt_util.c | 4 +- net/bluetooth/msft.c | 8 +- net/bluetooth/rfcomm/core.c | 2 +- net/bluetooth/rfcomm/tty.c | 2 +- net/bluetooth/sco.c | 2 +- net/bluetooth/smp.c | 6 +- net/bpf/bpf_dummy_struct_ops.c | 4 +- net/bridge/br_cfm.c | 4 +- net/bridge/br_device.c | 2 +- net/bridge/br_if.c | 2 +- net/bridge/br_ioctl.c | 4 +- net/bridge/br_mrp.c | 2 +- net/bridge/br_vlan.c | 8 +- net/bridge/netfilter/ebtables.c | 2 +- net/caif/caif_dev.c | 2 +- net/caif/cfctrl.c | 2 +- net/can/af_can.c | 2 +- net/can/gw.c | 2 +- net/can/j1939/main.c | 2 +- net/ceph/ceph_common.c | 10 +- net/ceph/crypto.c | 2 +- net/core/dev.c | 8 +- net/core/drop_monitor.c | 2 +- net/core/failover.c | 2 +- net/core/filter.c | 4 +- net/core/flow_offload.c | 6 +- net/core/gen_estimator.c | 2 +- net/core/net_namespace.c | 2 +- net/core/netclassid_cgroup.c | 2 +- net/core/netpoll.c | 2 +- net/core/netprio_cgroup.c | 2 +- net/core/rtnetlink.c | 4 +- net/core/selftests.c | 2 +- net/core/sock.c | 2 +- net/core/xdp.c | 2 +- net/dcb/dcbnl.c | 2 +- net/devlink/core.c | 2 +- net/devlink/dpipe.c | 2 +- net/devlink/health.c | 6 +- net/devlink/linecard.c | 4 +- net/devlink/param.c | 2 +- net/devlink/rate.c | 6 +- net/devlink/region.c | 6 +- net/devlink/resource.c | 2 +- net/devlink/sb.c | 2 +- net/devlink/trap.c | 6 +- net/dsa/dsa.c | 8 +- net/dsa/port.c | 4 +- net/dsa/switch.c | 8 +- net/dsa/tag_8021q.c | 4 +- net/dsa/tag_ksz.c | 2 +- net/dsa/tag_ocelot_8021q.c | 2 +- net/dsa/tag_qca.c | 2 +- net/dsa/tag_sja1105.c | 2 +- net/dsa/user.c | 10 +- net/ethtool/cmis_cdb.c | 2 +- net/ethtool/ioctl.c | 4 +- net/ethtool/module.c | 2 +- net/ethtool/tsconfig.c | 6 +- net/ethtool/tsinfo.c | 4 +- net/hsr/hsr_framereg.c | 2 +- net/hsr/hsr_slave.c | 2 +- net/ieee802154/nl802154.c | 6 +- net/ipv4/ah4.c | 2 +- net/ipv4/devinet.c | 2 +- net/ipv4/fou_core.c | 2 +- net/ipv4/inet_diag.c | 2 +- net/ipv4/inet_fragment.c | 2 +- net/ipv4/inet_hashtables.c | 2 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/ipconfig.c | 2 +- net/ipv4/ipmr_base.c | 2 +- net/ipv4/metrics.c | 2 +- net/ipv4/nexthop.c | 8 +- net/ipv4/route.c | 4 +- net/ipv4/tcp_fastopen.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv4/udp_tunnel_nic.c | 2 +- net/ipv6/addrlabel.c | 2 +- net/ipv6/ah6.c | 2 +- net/ipv6/ila/ila_xlat.c | 4 +- net/ipv6/ioam6.c | 8 +- net/ipv6/ip6_fib.c | 2 +- net/ipv6/ip6_flowlabel.c | 4 +- net/ipv6/ipv6_sockglue.c | 2 +- net/ipv6/mcast.c | 8 +- net/ipv6/route.c | 4 +- net/ipv6/seg6.c | 8 +- net/ipv6/sit.c | 2 +- net/iucv/iucv.c | 2 +- net/key/af_key.c | 6 +- net/l2tp/l2tp_core.c | 2 +- net/l2tp/l2tp_debugfs.c | 2 +- net/mac80211/agg-rx.c | 4 +- net/mac80211/cfg.c | 2 +- net/mac80211/chan.c | 2 +- net/mac80211/led.c | 2 +- net/mac80211/link.c | 2 +- net/mac80211/mesh.c | 2 +- net/mac80211/mlme.c | 2 +- net/mac80211/offchannel.c | 2 +- net/mac80211/rate.c | 4 +- net/mac80211/sta_info.c | 6 +- net/mac80211/tests/util.c | 6 +- net/mac80211/tx.c | 2 +- net/mac802154/cfg.c | 2 +- net/mac802154/llsec.c | 10 +- net/mac802154/scan.c | 2 +- net/mctp/device.c | 2 +- net/mctp/neigh.c | 2 +- net/mctp/route.c | 2 +- net/mctp/test/utils.c | 2 +- net/mpls/af_mpls.c | 6 +- net/ncsi/ncsi-manage.c | 2 +- net/netfilter/ipset/ip_set_core.c | 6 +- net/netfilter/ipset/ip_set_list_set.c | 2 +- net/netfilter/ipvs/ip_vs_ctl.c | 8 +- net/netfilter/ipvs/ip_vs_dh.c | 2 +- net/netfilter/ipvs/ip_vs_est.c | 4 +- net/netfilter/ipvs/ip_vs_lblc.c | 2 +- net/netfilter/ipvs/ip_vs_lblcr.c | 2 +- net/netfilter/ipvs/ip_vs_mh.c | 2 +- net/netfilter/ipvs/ip_vs_proto.c | 2 +- net/netfilter/ipvs/ip_vs_sh.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 4 +- net/netfilter/ipvs/ip_vs_wrr.c | 2 +- net/netfilter/nf_conncount.c | 2 +- net/netfilter/nf_conntrack_core.c | 2 +- net/netfilter/nf_conntrack_netlink.c | 2 +- net/netfilter/nf_flow_table_offload.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nf_tables_api.c | 6 +- net/netfilter/nf_tables_offload.c | 4 +- net/netfilter/nfnetlink.c | 2 +- net/netfilter/nfnetlink_acct.c | 2 +- net/netfilter/nfnetlink_cthelper.c | 2 +- net/netfilter/nfnetlink_cttimeout.c | 2 +- net/netfilter/nfnetlink_hook.c | 2 +- net/netfilter/nfnetlink_osf.c | 2 +- net/netfilter/nft_ct.c | 2 +- net/netfilter/x_tables.c | 6 +- net/netfilter/xt_IDLETIMER.c | 4 +- net/netfilter/xt_LED.c | 2 +- net/netfilter/xt_RATEEST.c | 2 +- net/netfilter/xt_TEE.c | 2 +- net/netfilter/xt_limit.c | 2 +- net/netfilter/xt_quota.c | 2 +- net/netfilter/xt_statistic.c | 2 +- net/netlabel/netlabel_calipso.c | 2 +- net/netlabel/netlabel_cipso_v4.c | 8 +- net/netlabel/netlabel_domainhash.c | 4 +- net/netlabel/netlabel_mgmt.c | 10 +- net/netlabel/netlabel_unlabeled.c | 6 +- net/netlink/af_netlink.c | 2 +- net/netlink/diag.c | 2 +- net/netlink/genetlink.c | 8 +- net/netrom/af_netrom.c | 2 +- net/nfc/core.c | 4 +- net/nfc/digital_core.c | 8 +- net/nfc/digital_technology.c | 6 +- net/nfc/hci/core.c | 4 +- net/nfc/hci/hcp.c | 2 +- net/nfc/hci/llc.c | 4 +- net/nfc/hci/llc_nop.c | 2 +- net/nfc/hci/llc_shdlc.c | 2 +- net/nfc/llcp_commands.c | 4 +- net/nfc/llcp_core.c | 2 +- net/nfc/nci/core.c | 2 +- net/nfc/nci/hci.c | 2 +- net/nfc/nci/uart.c | 2 +- net/nfc/netlink.c | 6 +- net/openvswitch/datapath.c | 4 +- net/openvswitch/flow_netlink.c | 2 +- net/openvswitch/flow_table.c | 10 +- net/packet/af_packet.c | 4 +- net/psp/psp_main.c | 2 +- net/qrtr/af_qrtr.c | 4 +- net/qrtr/ns.c | 6 +- net/qrtr/tun.c | 2 +- net/rds/cong.c | 2 +- net/rds/ib_rdma.c | 6 +- net/rds/info.c | 2 +- net/rds/message.c | 2 +- net/rds/rdma.c | 14 +-- net/rfkill/core.c | 6 +- net/rfkill/input.c | 2 +- net/rose/af_rose.c | 2 +- net/rose/rose_route.c | 2 +- net/rxrpc/key.c | 6 +- net/rxrpc/local_object.c | 2 +- net/rxrpc/rxgk_kdf.c | 2 +- net/rxrpc/rxperf.c | 2 +- net/sched/act_api.c | 4 +- net/sched/act_connmark.c | 2 +- net/sched/act_csum.c | 2 +- net/sched/act_ct.c | 4 +- net/sched/act_ctinfo.c | 2 +- net/sched/act_ife.c | 2 +- net/sched/act_mpls.c | 2 +- net/sched/act_nat.c | 2 +- net/sched/act_pedit.c | 4 +- net/sched/act_police.c | 2 +- net/sched/act_skbedit.c | 2 +- net/sched/act_skbmod.c | 2 +- net/sched/act_vlan.c | 2 +- net/sched/cls_api.c | 12 +-- net/sched/cls_basic.c | 4 +- net/sched/cls_bpf.c | 4 +- net/sched/cls_cgroup.c | 2 +- net/sched/cls_flow.c | 4 +- net/sched/cls_flower.c | 14 +-- net/sched/cls_fw.c | 6 +- net/sched/cls_matchall.c | 2 +- net/sched/cls_route.c | 6 +- net/sched/cls_u32.c | 2 +- net/sched/em_meta.c | 2 +- net/sched/em_text.c | 2 +- net/sched/sch_api.c | 4 +- net/sched/sch_choke.c | 2 +- net/sched/sch_drr.c | 2 +- net/sched/sch_fq_pie.c | 2 +- net/sched/sch_gred.c | 6 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_htb.c | 2 +- net/sched/sch_multiq.c | 2 +- net/sched/sch_qfq.c | 4 +- net/sched/sch_sfq.c | 2 +- net/sched/sch_taprio.c | 6 +- net/sctp/protocol.c | 2 +- net/sctp/stream.c | 2 +- net/shaper/shaper.c | 6 +- net/smc/af_smc.c | 8 +- net/smc/smc_clc.c | 4 +- net/smc/smc_core.c | 8 +- net/smc/smc_ib.c | 2 +- net/smc/smc_ism.c | 6 +- net/smc/smc_llc.c | 6 +- net/smc/smc_pnet.c | 6 +- net/smc/smc_rx.c | 8 +- net/smc/smc_stats.c | 4 +- net/smc/smc_wr.c | 2 +- net/sunrpc/auth.c | 4 +- net/sunrpc/auth_gss/auth_gss.c | 10 +- net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- net/sunrpc/auth_gss/gss_rpc_xdr.c | 4 +- net/sunrpc/auth_gss/svcauth_gss.c | 10 +- net/sunrpc/cache.c | 4 +- net/sunrpc/clnt.c | 4 +- net/sunrpc/rpc_pipe.c | 2 +- net/sunrpc/stats.c | 2 +- net/sunrpc/svc.c | 4 +- net/sunrpc/svcauth_unix.c | 6 +- net/sunrpc/sysfs.c | 6 +- net/sunrpc/xprt.c | 2 +- net/sunrpc/xprtrdma/ib_client.c | 2 +- net/tipc/bcast.c | 2 +- net/tipc/crypto.c | 2 +- net/tipc/name_table.c | 2 +- net/tipc/socket.c | 2 +- net/tls/tls_device.c | 8 +- net/tls/tls_sw.c | 4 +- net/unix/garbage.c | 2 +- net/vmw_vsock/hyperv_transport.c | 4 +- net/vmw_vsock/virtio_transport.c | 2 +- net/vmw_vsock/virtio_transport_common.c | 2 +- net/vmw_vsock/vmci_transport.c | 4 +- net/wireless/nl80211.c | 36 ++++---- net/wireless/of.c | 2 +- net/wireless/reg.c | 12 +-- net/wireless/sme.c | 2 +- net/wireless/tests/util.c | 2 +- net/wireless/wext-compat.c | 2 +- net/xdp/xdp_umem.c | 2 +- net/xdp/xsk_buff_pool.c | 4 +- net/xdp/xsk_queue.c | 2 +- net/xfrm/espintcp.c | 2 +- net/xfrm/xfrm_ipcomp.c | 2 +- net/xfrm/xfrm_iptfs.c | 2 +- scripts/livepatch/init.c | 2 +- security/apparmor/apparmorfs.c | 2 +- security/apparmor/lsm.c | 2 +- security/apparmor/match.c | 2 +- security/apparmor/policy_compat.c | 6 +- security/apparmor/policy_ns.c | 2 +- security/apparmor/policy_unpack.c | 14 +-- security/device_cgroup.c | 2 +- security/integrity/digsig.c | 2 +- security/integrity/evm/evm_secfs.c | 2 +- security/integrity/ima/ima_mok.c | 2 +- security/integrity/ima/ima_policy.c | 2 +- security/integrity/ima/ima_queue.c | 2 +- security/integrity/ima/ima_queue_keys.c | 2 +- security/integrity/ima/ima_template.c | 4 +- security/ipe/digest.c | 2 +- security/ipe/hooks.c | 2 +- security/ipe/policy.c | 2 +- security/ipe/policy_parser.c | 6 +- security/keys/key.c | 2 +- security/keys/keyctl.c | 4 +- security/keys/keyring.c | 2 +- security/keys/request_key_auth.c | 2 +- security/keys/trusted-keys/trusted_core.c | 2 +- security/keys/trusted-keys/trusted_pkwm.c | 4 +- security/keys/trusted-keys/trusted_tpm1.c | 6 +- security/safesetid/securityfs.c | 6 +- security/selinux/avc.c | 2 +- security/selinux/hooks.c | 4 +- security/selinux/selinuxfs.c | 4 +- security/selinux/ss/conditional.c | 10 +- security/selinux/ss/hashtab.c | 2 +- security/selinux/ss/policydb.c | 44 ++++----- security/selinux/ss/services.c | 6 +- security/smack/smack_lsm.c | 8 +- security/smack/smackfs.c | 6 +- security/yama/yama_lsm.c | 2 +- sound/ac97/bus.c | 4 +- sound/ac97/snd_ac97_compat.c | 2 +- sound/aoa/codecs/onyx.c | 2 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/codecs/toonie.c | 2 +- sound/aoa/core/gpio-pmf.c | 2 +- sound/aoa/fabrics/layout.c | 2 +- sound/aoa/soundbus/i2sbus/control.c | 2 +- sound/aoa/soundbus/i2sbus/core.c | 2 +- sound/aoa/soundbus/i2sbus/pcm.c | 2 +- sound/core/compress_offload.c | 8 +- sound/core/control.c | 2 +- sound/core/control_compat.c | 10 +- sound/core/control_led.c | 2 +- sound/core/device.c | 2 +- sound/core/hrtimer.c | 2 +- sound/core/hwdep.c | 2 +- sound/core/info.c | 8 +- sound/core/init.c | 4 +- sound/core/jack.c | 4 +- sound/core/memalloc.c | 4 +- sound/core/oss/mixer_oss.c | 32 +++---- sound/core/oss/pcm_oss.c | 18 ++-- sound/core/pcm.c | 8 +- sound/core/pcm_compat.c | 2 +- sound/core/pcm_dmaengine.c | 2 +- sound/core/pcm_lib.c | 2 +- sound/core/pcm_memory.c | 2 +- sound/core/pcm_native.c | 8 +- sound/core/rawmidi.c | 8 +- sound/core/seq/oss/seq_oss_init.c | 4 +- sound/core/seq/oss/seq_oss_midi.c | 6 +- sound/core/seq/oss/seq_oss_readq.c | 4 +- sound/core/seq/oss/seq_oss_timer.c | 2 +- sound/core/seq/oss/seq_oss_writeq.c | 2 +- sound/core/seq/seq_compat.c | 2 +- sound/core/seq/seq_dummy.c | 2 +- sound/core/seq/seq_fifo.c | 2 +- sound/core/seq/seq_memory.c | 2 +- sound/core/seq/seq_midi.c | 8 +- sound/core/seq/seq_midi_emul.c | 4 +- sound/core/seq/seq_midi_event.c | 2 +- sound/core/seq/seq_ports.c | 4 +- sound/core/seq/seq_prioq.c | 2 +- sound/core/seq/seq_queue.c | 2 +- sound/core/seq/seq_system.c | 2 +- sound/core/seq/seq_timer.c | 2 +- sound/core/seq/seq_ump_client.c | 10 +- sound/core/seq/seq_virmidi.c | 6 +- sound/core/sound.c | 2 +- sound/core/sound_oss.c | 2 +- sound/core/timer.c | 14 +-- sound/core/ump.c | 4 +- sound/core/vmaster.c | 8 +- sound/drivers/dummy.c | 4 +- sound/drivers/mpu401/mpu401_uart.c | 2 +- sound/drivers/mts64.c | 2 +- sound/drivers/opl3/opl3_lib.c | 2 +- sound/drivers/opl3/opl3_synth.c | 2 +- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/pcmtest.c | 4 +- sound/drivers/portman2x4.c | 2 +- sound/drivers/vx/vx_pcm.c | 2 +- sound/firewire/amdtp-stream.c | 2 +- sound/firewire/bebob/bebob_proc.c | 2 +- sound/firewire/fireworks/fireworks.c | 2 +- sound/firewire/fireworks/fireworks_proc.c | 2 +- sound/firewire/motu/motu-hwdep.c | 6 +- sound/firewire/packets-buffer.c | 2 +- sound/hda/codecs/analog.c | 2 +- sound/hda/codecs/ca0110.c | 2 +- sound/hda/codecs/ca0132.c | 6 +- sound/hda/codecs/cirrus/cs420x.c | 2 +- sound/hda/codecs/cirrus/cs421x.c | 2 +- sound/hda/codecs/cirrus/cs8409.c | 2 +- sound/hda/codecs/cm9825.c | 2 +- sound/hda/codecs/cmedia.c | 2 +- sound/hda/codecs/conexant.c | 2 +- sound/hda/codecs/generic.c | 4 +- sound/hda/codecs/hdmi/hdmi.c | 2 +- sound/hda/codecs/hdmi/simplehdmi.c | 2 +- sound/hda/codecs/realtek/realtek.c | 4 +- sound/hda/codecs/senarytech.c | 2 +- sound/hda/codecs/si3054.c | 2 +- sound/hda/codecs/sigmatel.c | 2 +- sound/hda/codecs/via.c | 2 +- sound/hda/common/beep.c | 2 +- sound/hda/common/codec.c | 8 +- sound/hda/common/controller.c | 4 +- sound/hda/common/jack.c | 2 +- sound/hda/common/proc.c | 2 +- sound/hda/core/ext/controller.c | 2 +- sound/hda/core/sysfs.c | 6 +- sound/i2c/cs8427.c | 2 +- sound/i2c/i2c.c | 4 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- sound/i2c/tea6330t.c | 2 +- sound/isa/gus/gus_main.c | 2 +- sound/isa/gus/gus_mem.c | 2 +- sound/isa/gus/gus_mem_proc.c | 4 +- sound/isa/gus/gus_pcm.c | 2 +- sound/isa/sb/emu8000_pcm.c | 2 +- sound/isa/sb/sb16_csp.c | 2 +- sound/isa/wavefront/wavefront_synth.c | 2 +- sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- sound/parisc/harmony.c | 2 +- sound/pci/ac97/ac97_codec.c | 4 +- sound/pci/ac97/ac97_pcm.c | 2 +- sound/pci/ak4531_codec.c | 2 +- sound/pci/als300.c | 4 +- sound/pci/asihpi/asihpi.c | 4 +- sound/pci/asihpi/hpi6000.c | 2 +- sound/pci/asihpi/hpi6205.c | 2 +- sound/pci/asihpi/hpicmn.c | 4 +- sound/pci/asihpi/hpidspcd.c | 2 +- sound/pci/asihpi/hpioctl.c | 4 +- sound/pci/ca0106/ca0106_main.c | 4 +- sound/pci/cmipci.c | 4 +- sound/pci/cs46xx/cs46xx_lib.c | 6 +- sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 +- sound/pci/ctxfi/ctamixer.c | 4 +- sound/pci/ctxfi/ctatc.c | 2 +- sound/pci/ctxfi/ctdaio.c | 8 +- sound/pci/ctxfi/cthw20k1.c | 16 ++-- sound/pci/ctxfi/cthw20k2.c | 16 ++-- sound/pci/ctxfi/ctmixer.c | 2 +- sound/pci/ctxfi/ctpcm.c | 4 +- sound/pci/ctxfi/ctsrc.c | 8 +- sound/pci/ctxfi/cttimer.c | 2 +- sound/pci/ctxfi/ctvmem.c | 6 +- sound/pci/echoaudio/echoaudio.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 4 +- sound/pci/emu10k1/emufx.c | 20 ++-- sound/pci/emu10k1/emupcm.c | 10 +- sound/pci/es1968.c | 8 +- sound/pci/ice1712/ak4xxx.c | 2 +- sound/pci/ice1712/aureon.c | 4 +- sound/pci/ice1712/delta.c | 2 +- sound/pci/ice1712/ews.c | 4 +- sound/pci/ice1712/hoontech.c | 4 +- sound/pci/ice1712/juli.c | 4 +- sound/pci/ice1712/maya44.c | 2 +- sound/pci/ice1712/phase.c | 6 +- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 2 +- sound/pci/ice1712/prodigy_hifi.c | 8 +- sound/pci/ice1712/psc724.c | 2 +- sound/pci/ice1712/quartet.c | 4 +- sound/pci/ice1712/revo.c | 6 +- sound/pci/ice1712/se.c | 2 +- sound/pci/ice1712/wtm.c | 2 +- sound/pci/mixart/mixart.c | 6 +- sound/pci/mixart/mixart_hwdep.c | 6 +- sound/pci/pcxhr/pcxhr.c | 4 +- sound/pci/riptide/riptide.c | 6 +- sound/pci/rme9652/hdspm.c | 4 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 4 +- sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 2 +- sound/ppc/awacs.c | 2 +- sound/ppc/beep.c | 2 +- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/tumbler.c | 2 +- sound/sh/aica.c | 4 +- sound/sh/sh_dac_audio.c | 2 +- sound/soc/amd/acp-pcm-dma.c | 2 +- sound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 +- sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 +- sound/soc/amd/ps/ps-pdm-dma.c | 2 +- sound/soc/amd/ps/ps-sdw-dma.c | 2 +- sound/soc/amd/raven/acp3x-pcm-dma.c | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +- sound/soc/atmel/atmel-pcm-pdc.c | 2 +- sound/soc/atmel/mchp-pdmc.c | 2 +- sound/soc/au1x/dma.c | 2 +- sound/soc/bcm/bcm63xx-pcm-whistler.c | 2 +- sound/soc/codecs/cx20442.c | 2 +- sound/soc/codecs/pcm6240.c | 6 +- sound/soc/codecs/tas2781-fmwlib.c | 8 +- sound/soc/codecs/tas2783-sdw.c | 4 +- sound/soc/codecs/wcd-clsh-v2.c | 2 +- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- sound/soc/codecs/wm0010.c | 2 +- sound/soc/codecs/wm_adsp.c | 8 +- sound/soc/fsl/fsl_asrc_m2m.c | 4 +- sound/soc/fsl/fsl_dma.c | 2 +- sound/soc/fsl/fsl_qmc_audio.c | 2 +- sound/soc/fsl/imx-pcm-fiq.c | 2 +- sound/soc/fsl/mpc5200_dma.c | 2 +- sound/soc/fsl/p1022_ds.c | 2 +- sound/soc/fsl/p1022_rdk.c | 2 +- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/audio-graph-card2.c | 2 +- sound/soc/generic/simple-card.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-compress.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- sound/soc/intel/atom/sst/sst.c | 2 +- sound/soc/intel/atom/sst/sst_ipc.c | 2 +- sound/soc/intel/atom/sst/sst_loader.c | 2 +- sound/soc/intel/avs/path.c | 8 +- sound/soc/intel/avs/pcm.c | 2 +- sound/soc/intel/avs/utils.c | 6 +- sound/soc/intel/boards/sof_sdw.c | 4 +- sound/soc/intel/catpt/pcm.c | 2 +- sound/soc/loongson/loongson_dma.c | 2 +- sound/soc/mediatek/mt8186/mt8186-audsys-clk.c | 2 +- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 2 +- sound/soc/mediatek/mt8195/mt8195-audsys-clk.c | 2 +- sound/soc/meson/aiu-fifo.c | 2 +- sound/soc/meson/axg-tdm-formatter.c | 2 +- sound/soc/meson/meson-codec-glue.c | 2 +- sound/soc/pxa/pxa-ssp.c | 4 +- sound/soc/qcom/lpass-platform.c | 2 +- sound/soc/qcom/qdsp6/q6afe.c | 2 +- sound/soc/qcom/qdsp6/q6apm-dai.c | 4 +- sound/soc/qcom/qdsp6/q6apm.c | 6 +- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 +- sound/soc/qcom/qdsp6/q6asm.c | 2 +- sound/soc/qcom/qdsp6/q6core.c | 2 +- sound/soc/qcom/qdsp6/q6routing.c | 2 +- sound/soc/qcom/qdsp6/topology.c | 12 +-- sound/soc/renesas/siu_dai.c | 2 +- sound/soc/samsung/idma.c | 2 +- sound/soc/sdca/sdca_asoc.c | 2 +- sound/soc/sdca/sdca_function_device.c | 2 +- sound/soc/sdca/sdca_jack.c | 2 +- sound/soc/soc-ac97.c | 2 +- sound/soc/soc-core.c | 2 +- sound/soc/soc-dapm.c | 6 +- sound/soc/soc-generic-dmaengine-pcm.c | 2 +- sound/soc/soc-ops-test.c | 2 +- sound/soc/soc-ops.c | 2 +- sound/soc/soc-pcm.c | 2 +- sound/soc/soc-usb.c | 2 +- sound/soc/sof/compress.c | 2 +- sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/cnl.c | 2 +- sound/soc/sof/intel/hda-mlink.c | 2 +- sound/soc/sof/intel/icl.c | 2 +- sound/soc/sof/intel/mtl.c | 2 +- sound/soc/sof/intel/skl.c | 2 +- sound/soc/sof/intel/telemetry.c | 4 +- sound/soc/sof/intel/tgl.c | 2 +- sound/soc/sof/ipc3-dtrace.c | 2 +- sound/soc/sof/ipc3-topology.c | 8 +- sound/soc/sof/ipc4-pcm.c | 4 +- sound/soc/sof/ipc4-topology.c | 20 ++-- sound/soc/sof/sof-client-probes-ipc4.c | 2 +- sound/soc/sof/sof-client.c | 4 +- sound/soc/sof/stream-ipc.c | 2 +- sound/soc/sof/topology.c | 22 ++--- sound/soc/sprd/sprd-pcm-compress.c | 2 +- sound/soc/xilinx/xlnx_formatter_pcm.c | 2 +- sound/sound_core.c | 2 +- sound/synth/emux/emux.c | 2 +- sound/synth/emux/emux_seq.c | 4 +- sound/synth/emux/soundfont.c | 8 +- sound/synth/util_mem.c | 2 +- sound/usb/6fire/comm.c | 2 +- sound/usb/6fire/firmware.c | 2 +- sound/usb/6fire/midi.c | 2 +- sound/usb/6fire/pcm.c | 2 +- sound/usb/caiaq/audio.c | 4 +- sound/usb/endpoint.c | 6 +- sound/usb/fcp.c | 6 +- sound/usb/hiface/pcm.c | 2 +- sound/usb/line6/midi.c | 2 +- sound/usb/line6/pcm.c | 2 +- sound/usb/line6/toneport.c | 2 +- sound/usb/media.c | 4 +- sound/usb/midi.c | 6 +- sound/usb/midi2.c | 6 +- sound/usb/misc/ua101.c | 2 +- sound/usb/mixer.c | 14 +-- sound/usb/mixer_quirks.c | 10 +- sound/usb/mixer_s1810c.c | 4 +- sound/usb/mixer_scarlett.c | 2 +- sound/usb/mixer_scarlett2.c | 4 +- sound/usb/mixer_us16x08.c | 8 +- sound/usb/power.c | 2 +- sound/usb/qcom/qc_audio_offload.c | 10 +- sound/usb/quirks.c | 6 +- sound/usb/stream.c | 12 +-- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/virtio/virtio_card.c | 2 +- sound/virtio/virtio_jack.c | 2 +- sound/virtio/virtio_pcm.c | 2 +- sound/virtio/virtio_pcm_msg.c | 2 +- sound/x86/intel_hdmi_audio.c | 2 +- virt/kvm/guest_memfd.c | 2 +- virt/kvm/kvm_main.c | 8 +- 6673 files changed, 13013 insertions(+), 13013 deletions(-) (limited to 'scripts/livepatch') diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index b5b547732398..92e3312e786e 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c @@ -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; diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c index ddaef7b75ba7..6b6b9e6d631f 100644 --- a/arch/alpha/kernel/core_titan.c +++ b/arch/alpha/kernel/core_titan.c @@ -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; diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index 6fbc2d179e93..548d1591cfa9 100644 --- a/arch/alpha/kernel/module.c +++ b/arch/alpha/kernel/module.c @@ -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", diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 93eb07018e6b..51a8a4c4572a 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -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; diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index ea4e7243c0e9..4cbcfb1852d5 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -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); diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index dcdc8bd916db..6fdc751f906e 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -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; diff --git a/arch/arc/net/bpf_jit_core.c b/arch/arc/net/bpf_jit_core.c index 5695da795536..1421eeced0f5 100644 --- a/arch/arc/net/bpf_jit_core.c +++ b/arch/arc/net/bpf_jit_core.c @@ -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; } diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 4820b1094dfa..55e360452828 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -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; diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 8bd217789439..449c8bb86453 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -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; diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index 10e8e9716bd3..90474994757c 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -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; diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 504f22b420a8..4e8e89a26ca3 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -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; } diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index fe73d759d078..3d7f7fcf2d87 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c @@ -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; diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 2b40c22234a9..c91cb0e1585e 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -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); diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index 884f1899dfba..e306d0c5a21c 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -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; diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 765a97a30b8a..e1b336624883 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -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; diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c index d75fc4b541f1..1cb7d674bc81 100644 --- a/arch/arm/mach-footbridge/ebsa285.c +++ b/arch/arm/mach-footbridge/ebsa285.c @@ -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; diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c index ae5cf7f1f74a..c024eefd4978 100644 --- a/arch/arm/mach-footbridge/netwinder-hw.c +++ b/arch/arm/mach-footbridge/netwinder-hw.c @@ -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; diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index d1d1ef3aa927..b71467c48b87 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -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; diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index f7f142d6e49e..a0740ab0dca9 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -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"); diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 4af0df12f654..fa2c1e1aeb96 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -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); } diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index ea4159a5b567..850ed3ea3cc4 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c @@ -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; diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 24dd8a0c6567..f639d5004351 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -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; diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 491254010c0c..e5d102887c22 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -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; diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c index 09dab51d5728..399e6d840986 100644 --- a/arch/arm/mach-omap1/timer.c +++ b/arch/arm/mach-omap1/timer.c @@ -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; diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 0b9d4c7b6711..2b04e422b46c 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -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"; diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index fd9e4146db35..43f5944850e6 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -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; diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index debc3f0d0184..3b48fb20afe4 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c @@ -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; diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index ab8adccbd7dd..79db4c49ffc9 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -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; diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 3591ca1f59c6..974107ff18b4 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -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; diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c index e3f47fb2d4ef..865b5251ef67 100644 --- a/arch/arm/mach-omap2/pm33xx-core.c +++ b/arch/arm/mach-omap2/pm33xx-core.c @@ -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; diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 9d1a14771590..758d90e0340b 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -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; diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 2ee1ff7335db..06f5320036b1 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -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"); diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index 9f0edac1697c..972465840548 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c @@ -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; diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index e4c7a0b78783..eafeb38502af 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -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; diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 078667b52b8a..99ff55e8131d 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -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; diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index f8960373fa06..9e8a3284a6cf 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -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; diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c index c6659131f21b..4277ba5b3ae0 100644 --- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c @@ -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); diff --git a/arch/arm/mach-versatile/spc.c b/arch/arm/mach-versatile/spc.c index d77ed8ce5f32..7c3191aa3e12 100644 --- a/arch/arm/mach-versatile/spc.c +++ b/arch/arm/mach-versatile/spc.c @@ -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); diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c index 53d02ce2ad43..581c97dc4ed2 100644 --- a/arch/arm/mach-versatile/versatile.c +++ b/arch/arm/mach-versatile/versatile.c @@ -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; diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index ddb06d5ca55d..f181a287d53d 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -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; diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 3d62bd48086b..3d9caf7464bf 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -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; diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c index c601532f7a77..06e99ea1a221 100644 --- a/arch/arm/mm/cache-uniphier.c +++ b/arch/arm/mm/cache-uniphier.c @@ -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; diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 7aca3e747ad5..f304037d1c34 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -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; diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 9c3e6145b810..4feed2c2498d 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -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; diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index f6d8b294525d..070a01e53fcb 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -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; diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index 3a7b6e78a949..93cc9bbb5cec 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -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; diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index fa1de8784617..8046f9e9719b 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -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); diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 6eb273100ade..9b3091ad868c 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -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; } diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index da036853ee8a..356d33c7a4ae 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -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; diff --git a/arch/csky/kernel/vdso.c b/arch/csky/kernel/vdso.c index 0f49ce6919e6..6886c0b3f60b 100644 --- a/arch/csky/kernel/vdso.c +++ b/arch/csky/kernel/vdso.c @@ -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; diff --git a/arch/loongarch/kvm/intc/eiointc.c b/arch/loongarch/kvm/intc/eiointc.c index fe4173b4a102..d2acb4d09e73 100644 --- a/arch/loongarch/kvm/intc/eiointc.c +++ b/arch/loongarch/kvm/intc/eiointc.c @@ -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; diff --git a/arch/loongarch/kvm/intc/ipi.c b/arch/loongarch/kvm/intc/ipi.c index 6e87cefbb3e2..1f6ebbd0af5c 100644 --- a/arch/loongarch/kvm/intc/ipi.c +++ b/arch/loongarch/kvm/intc/ipi.c @@ -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; diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c index 1fead3f36f4d..dd7e7f8d53db 100644 --- a/arch/loongarch/kvm/intc/pch_pic.c +++ b/arch/loongarch/kvm/intc/pch_pic.c @@ -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; diff --git a/arch/loongarch/kvm/main.c b/arch/loongarch/kvm/main.c index c86f9f5fedb5..2c593ac7892f 100644 --- a/arch/loongarch/kvm/main.c +++ b/arch/loongarch/kvm/main.c @@ -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; diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index 483ed31f2008..09e137f2f841 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -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; diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c index 07f876834b24..3bd89f55960d 100644 --- a/arch/loongarch/net/bpf_jit.c +++ b/arch/loongarch/net/bpf_jit.c @@ -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; diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c index 324a19d88ca1..0dde3ddcd544 100644 --- a/arch/loongarch/pci/acpi.c +++ b/arch/loongarch/pci/acpi.c @@ -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; diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c index 388cb652e51e..19a7bfefb5d7 100644 --- a/arch/m68k/amiga/chipram.c +++ b/arch/m68k/amiga/chipram.c @@ -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; diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index 958c12a29884..82b31321f61c 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -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; diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index 921a96ea83df..93536cf2a38e 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c @@ -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; diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 0ef6e6894a96..6167999402b1 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -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; diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c index 7ed84f26ac40..62a7304ff35f 100644 --- a/arch/mips/alchemy/common/clock.c +++ b/arch/mips/alchemy/common/clock.c @@ -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; diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index eb420a6f2f9f..b441d6f3f5ae 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c @@ -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; diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 931cf459facb..02bf02164752 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c @@ -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; diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c index 40e804a898ec..46262c823fcb 100644 --- a/arch/mips/alchemy/devboards/platform.c +++ b/arch/mips/alchemy/devboards/platform.c @@ -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; diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index d9e569af0d86..5b0504e3771c 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c @@ -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; diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 2a91e678fc1a..900cda918a9a 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c @@ -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); diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index 9ef50013c818..37dea772fd78 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c @@ -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; diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index ef5dca1313b2..70a846c5ddba 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -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; diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index fdbb5c4de834..b05ee21a1d67 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -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; diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sysctrl.c index ee0e634f6fe1..139a65c42a78 100644 --- a/arch/mips/lantiq/falcon/sysctrl.c +++ b/arch/mips/lantiq/falcon/sysctrl.c @@ -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; diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c index f8f3f5383a34..cbf0639cb3d6 100644 --- a/arch/mips/lantiq/xway/gptu.c +++ b/arch/mips/lantiq/xway/gptu.c @@ -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; diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index b7be6c710a15..dd187726e3b2 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c @@ -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; diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index d5b4f0e6bee3..19175171905e 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c @@ -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; diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c index c78f99eebe1a..cf115abb54e0 100644 --- a/arch/mips/pci/pci-xtalk-bridge.c +++ b/arch/mips/pci/pci-xtalk-bridge.c @@ -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; diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c index c493fe67802c..c5f1ebce006f 100644 --- a/arch/mips/ralink/mt7620.c +++ b/arch/mips/ralink/mt7620.c @@ -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; diff --git a/arch/mips/ralink/mt7621.c b/arch/mips/ralink/mt7621.c index ca70966da6f7..a4bdda8541c0 100644 --- a/arch/mips/ralink/mt7621.c +++ b/arch/mips/ralink/mt7621.c @@ -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; diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c index d60fd84e4b9c..19bb81eba57a 100644 --- a/arch/mips/ralink/rt288x.c +++ b/arch/mips/ralink/rt288x.c @@ -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; diff --git a/arch/mips/ralink/rt305x.c b/arch/mips/ralink/rt305x.c index 6abd2a56ba27..ed4159135ed9 100644 --- a/arch/mips/ralink/rt305x.c +++ b/arch/mips/ralink/rt305x.c @@ -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; diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c index 60605941b4b2..98aee412f532 100644 --- a/arch/mips/ralink/rt3883.c +++ b/arch/mips/ralink/rt3883.c @@ -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; diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c index 08604e5836bc..9eec8842ffb7 100644 --- a/arch/mips/sgi-ip22/ip22-gio.c +++ b/arch/mips/sgi-ip22/ip22-gio.c @@ -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; diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index fb3e9bfa6abf..7e5aa04c6695 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -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; diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c index 5504c3234d5a..10834880c261 100644 --- a/arch/mips/sgi-ip27/ip27-xtalk.c +++ b/arch/mips/sgi-ip27/ip27-xtalk.c @@ -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; diff --git a/arch/mips/sgi-ip30/ip30-irq.c b/arch/mips/sgi-ip30/ip30-irq.c index 1ffa97c578fa..4b21b7b6ffe1 100644 --- a/arch/mips/sgi-ip30/ip30-irq.c +++ b/arch/mips/sgi-ip30/ip30-irq.c @@ -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; diff --git a/arch/mips/sgi-ip30/ip30-xtalk.c b/arch/mips/sgi-ip30/ip30-xtalk.c index e5525f1b617e..1e14d59a5787 100644 --- a/arch/mips/sgi-ip30/ip30-xtalk.c +++ b/arch/mips/sgi-ip30/ip30-xtalk.c @@ -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; diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index 1976c06ee667..a52082878e8c 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -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"; diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 5cf490edea5a..6c5025806914 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c @@ -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); diff --git a/arch/nios2/platform/platform.c b/arch/nios2/platform/platform.c index 567e41095a40..7948f063f55d 100644 --- a/arch/nios2/platform/platform.c +++ b/arch/nios2/platform/platform.c @@ -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) diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 0a5868035ff0..bc47bbe3026e 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -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; diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index af827d32bcca..103f58dac948 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -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__); diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 742e831de73c..d09be22babdb 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -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!"); diff --git a/arch/parisc/kernel/vdso.c b/arch/parisc/kernel/vdso.c index a91a6a67d680..54c18574424a 100644 --- a/arch/parisc/kernel/vdso.c +++ b/arch/parisc/kernel/vdso.c @@ -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++) diff --git a/arch/parisc/net/bpf_jit_core.c b/arch/parisc/net/bpf_jit_core.c index af852116adf8..a5eb6b51e27a 100644 --- a/arch/parisc/net/bpf_jit_core.c +++ b/arch/parisc/net/bpf_jit_core.c @@ -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; diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index 1298c868f9b6..90d51d9b3ed2 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c @@ -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; diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 0c0d3c30432b..42b29324287c 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -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"); diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 7845c9c7f136..a7a2fb605971 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -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; diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 25310680fcc5..a7b664befed2 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -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; diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 6b2a7ab69d78..395399bbab2c 100644 --- a/arch/powerpc/kernel/secvar-sysfs.c +++ b/arch/powerpc/kernel/secvar-sysfs.c @@ -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; diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index 5f26c0352538..e6377ff08be9 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c @@ -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; diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 288763d59adb..3467f86fd78f 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -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); } diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 2729631d9d07..d3ef251048c9 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -245,7 +245,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end) struct page **pagelist; int pages = (end - start) >> PAGE_SHIFT; - 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__); diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 347847aec315..2ccb3d138f46 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c @@ -1494,7 +1494,7 @@ int kvm_vm_ioctl_resize_hpt_prepare(struct kvm *kvm, /* start new resize */ - resize = kzalloc_obj(*resize, GFP_KERNEL); + resize = kzalloc_obj(*resize); if (!resize) { ret = -ENOMEM; goto out; @@ -1943,7 +1943,7 @@ int kvm_vm_ioctl_get_htab_fd(struct kvm *kvm, struct kvm_get_htab_fd *ghf) /* reject flags we don't recognize */ if (ghf->flags & ~(KVM_GET_HTAB_BOLTED_ONLY | KVM_GET_HTAB_WRITE)) return -EINVAL; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; kvm_get_kvm(kvm); @@ -1985,7 +1985,7 @@ static int debugfs_htab_open(struct inode *inode, struct file *file) struct kvm *kvm = inode->i_private; struct debugfs_htab_state *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c index 82af0508993c..933fc7cb9afc 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_radix.c +++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c @@ -1256,7 +1256,7 @@ static int debugfs_radix_open(struct inode *inode, struct file *file) struct kvm *kvm = inode->i_private; struct debugfs_radix_state *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c index 70c73864aab8..c5f3f5b29d89 100644 --- a/arch/powerpc/kvm/book3s_64_vio.c +++ b/arch/powerpc/kvm/book3s_64_vio.c @@ -178,7 +178,7 @@ long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd, } rcu_read_unlock(); - stit = kzalloc_obj(*stit, GFP_KERNEL); + stit = kzalloc_obj(*stit); if (!stit) { iommu_tce_table_put(tbl); return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index e6f6a58c5e36..08e5816fdd61 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -2790,7 +2790,7 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int id) { struct kvmppc_vcore *vcore; - vcore = kzalloc_obj(struct kvmppc_vcore, GFP_KERNEL); + vcore = kzalloc_obj(struct kvmppc_vcore); if (vcore == NULL) return NULL; @@ -2842,7 +2842,7 @@ static int debugfs_timings_open(struct inode *inode, struct file *file) struct kvm_vcpu *vcpu = inode->i_private; struct debugfs_timings_state *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; @@ -5637,7 +5637,7 @@ void kvmppc_alloc_host_rm_ops(void) if (kvmppc_host_rm_ops_hv != NULL) return; - ops = kzalloc_obj(struct kvmppc_host_rm_ops, GFP_KERNEL); + ops = kzalloc_obj(struct kvmppc_host_rm_ops); if (!ops) return; @@ -5960,7 +5960,7 @@ void kvmppc_free_pimap(struct kvm *kvm) static struct kvmppc_passthru_irqmap *kvmppc_alloc_pimap(void) { - return kzalloc_obj(struct kvmppc_passthru_irqmap, GFP_KERNEL); + return kzalloc_obj(struct kvmppc_passthru_irqmap); } static int kvmppc_set_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi) diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c index 9bbac7fe2046..22e616662255 100644 --- a/arch/powerpc/kvm/book3s_hv_nested.c +++ b/arch/powerpc/kvm/book3s_hv_nested.c @@ -726,7 +726,7 @@ static struct kvm_nested_guest *kvmhv_alloc_nested(struct kvm *kvm, unsigned int struct kvm_nested_guest *gp; long shadow_lpid; - gp = kzalloc_obj(*gp, GFP_KERNEL); + gp = kzalloc_obj(*gp); if (!gp) return NULL; gp->l1_host = kvm; @@ -1671,7 +1671,7 @@ static long int __kvmhv_nested_page_fault(struct kvm_vcpu *vcpu, /* 4. Insert the pte into our shadow_pgtable */ - n_rmap = kzalloc_obj(*n_rmap, GFP_KERNEL); + n_rmap = kzalloc_obj(*n_rmap); if (!n_rmap) return RESUME_GUEST; /* Let the guest try again */ n_rmap->rmap = (n_gpa & RMAP_NESTED_GPA_MASK) | diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c index f960294dfc79..5fbb95d90e99 100644 --- a/arch/powerpc/kvm/book3s_hv_uvmem.c +++ b/arch/powerpc/kvm/book3s_hv_uvmem.c @@ -249,7 +249,7 @@ int kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot) { struct kvmppc_uvmem_slot *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; p->pfns = vcalloc(slot->npages, sizeof(*p->pfns)); @@ -711,7 +711,7 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm) bitmap_set(kvmppc_uvmem_bitmap, bit, 1); spin_unlock(&kvmppc_uvmem_bitmap_lock); - pvt = kzalloc_obj(*pvt, GFP_KERNEL); + pvt = kzalloc_obj(*pvt); if (!pvt) goto out_clear; diff --git a/arch/powerpc/kvm/book3s_rtas.c b/arch/powerpc/kvm/book3s_rtas.c index d6f8f33cc98b..0507715d0fdd 100644 --- a/arch/powerpc/kvm/book3s_rtas.c +++ b/arch/powerpc/kvm/book3s_rtas.c @@ -183,7 +183,7 @@ static int rtas_token_define(struct kvm *kvm, char *name, u64 token) if (!found) return -ENOENT; - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) return -ENOMEM; diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index 3ba148b1d22f..74a44fa702b0 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c @@ -1037,7 +1037,7 @@ static struct kvmppc_ics *kvmppc_xics_create_ics(struct kvm *kvm, goto out; /* Create the ICS */ - ics = kzalloc_obj(struct kvmppc_ics, GFP_KERNEL); + ics = kzalloc_obj(struct kvmppc_ics); if (!ics) goto out; @@ -1069,7 +1069,7 @@ static int kvmppc_xics_create_icp(struct kvm_vcpu *vcpu, unsigned long server_nu if (kvmppc_xics_find_server(vcpu->kvm, server_num)) return -EEXIST; - icp = kzalloc_obj(struct kvmppc_icp, GFP_KERNEL); + icp = kzalloc_obj(struct kvmppc_icp); if (!icp) return -ENOMEM; @@ -1388,7 +1388,7 @@ static struct kvmppc_xics *kvmppc_xics_get_device(struct kvm *kvm) struct kvmppc_xics *xics = *kvm_xics_device; if (!xics) { - xics = kzalloc_obj(*xics, GFP_KERNEL); + xics = kzalloc_obj(*xics); *kvm_xics_device = xics; } else { memset(xics, 0, sizeof(*xics)); diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index ae69a1e1dd17..1d67237783b7 100644 --- a/arch/powerpc/kvm/book3s_xive.c +++ b/arch/powerpc/kvm/book3s_xive.c @@ -1924,7 +1924,7 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev, if (r) goto bail; - xc = kzalloc_obj(*xc, GFP_KERNEL); + xc = kzalloc_obj(*xc); if (!xc) { r = -ENOMEM; goto bail; @@ -2276,7 +2276,7 @@ struct kvmppc_xive_src_block *kvmppc_xive_create_src_block( goto out; /* Create the ICS */ - sb = kzalloc_obj(*sb, GFP_KERNEL); + sb = kzalloc_obj(*sb); if (!sb) goto out; @@ -2719,7 +2719,7 @@ struct kvmppc_xive *kvmppc_xive_get_device(struct kvm *kvm, u32 type) struct kvmppc_xive *xive = *kvm_xive_device; if (!xive) { - xive = kzalloc_obj(*xive, GFP_KERNEL); + xive = kzalloc_obj(*xive); *kvm_xive_device = xive; } else { memset(xive, 0, sizeof(*xive)); diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c index 179bd6094d62..728b5606dd14 100644 --- a/arch/powerpc/kvm/book3s_xive_native.c +++ b/arch/powerpc/kvm/book3s_xive_native.c @@ -145,7 +145,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev, if (rc) goto bail; - xc = kzalloc_obj(*xc, GFP_KERNEL); + xc = kzalloc_obj(*xc); if (!xc) { rc = -ENOMEM; goto bail; diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index 891c936af1df..c58a5a5fb64c 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c @@ -119,7 +119,7 @@ static inline void local_sid_destroy_all(void) static void *kvmppc_e500_id_table_alloc(struct kvmppc_vcpu_e500 *vcpu_e500) { - vcpu_e500->idt = kzalloc_obj(struct vcpu_id_table, GFP_KERNEL); + vcpu_e500->idt = kzalloc_obj(struct vcpu_id_table); return vcpu_e500->idt; } diff --git a/arch/powerpc/kvm/e500_mmu.c b/arch/powerpc/kvm/e500_mmu.c index ecbd7c4cd93d..13bcadccb2b7 100644 --- a/arch/powerpc/kvm/e500_mmu.c +++ b/arch/powerpc/kvm/e500_mmu.c @@ -772,7 +772,7 @@ int kvm_vcpu_ioctl_config_tlb(struct kvm_vcpu *vcpu, num_pages = DIV_ROUND_UP(cfg->array + array_len - 1, PAGE_SIZE) - cfg->array / PAGE_SIZE; - pages = kmalloc_objs(*pages, num_pages, GFP_KERNEL); + pages = kmalloc_objs(*pages, num_pages); if (!pages) return -ENOMEM; @@ -792,13 +792,13 @@ int kvm_vcpu_ioctl_config_tlb(struct kvm_vcpu *vcpu, goto put_pages; } - privs[0] = kzalloc_objs(*privs[0], params.tlb_sizes[0], GFP_KERNEL); + privs[0] = kzalloc_objs(*privs[0], params.tlb_sizes[0]); if (!privs[0]) { ret = -ENOMEM; goto put_pages; } - privs[1] = kzalloc_objs(*privs[1], params.tlb_sizes[1], GFP_KERNEL); + privs[1] = kzalloc_objs(*privs[1], params.tlb_sizes[1]); if (!privs[1]) { ret = -ENOMEM; goto free_privs_first; diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c index a8ee6204cc08..3070f36d9fb8 100644 --- a/arch/powerpc/kvm/mpic.c +++ b/arch/powerpc/kvm/mpic.c @@ -1642,7 +1642,7 @@ static int mpic_set_default_irq_routing(struct openpic *opp) struct kvm_irq_routing_entry *routing; /* Create a nop default map, so that dereferencing it still works */ - routing = kzalloc_obj(*routing, GFP_KERNEL); + routing = kzalloc_obj(*routing); if (!routing) return -ENOMEM; @@ -1661,7 +1661,7 @@ static int mpic_create(struct kvm_device *dev, u32 type) if (dev->kvm->arch.mpic) return -EINVAL; - opp = kzalloc_obj(struct openpic, GFP_KERNEL); + opp = kzalloc_obj(struct openpic); if (!opp) return -ENOMEM; diff --git a/arch/powerpc/mm/book3s64/iommu_api.c b/arch/powerpc/mm/book3s64/iommu_api.c index f9aa4e08b5bb..60d00c9e7f19 100644 --- a/arch/powerpc/mm/book3s64/iommu_api.c +++ b/arch/powerpc/mm/book3s64/iommu_api.c @@ -70,7 +70,7 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua, locked_entries = entries; } - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) { ret = -ENOMEM; goto unlock_exit; diff --git a/arch/powerpc/mm/book3s64/subpage_prot.c b/arch/powerpc/mm/book3s64/subpage_prot.c index 240880a38965..37d47282c368 100644 --- a/arch/powerpc/mm/book3s64/subpage_prot.c +++ b/arch/powerpc/mm/book3s64/subpage_prot.c @@ -221,7 +221,7 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, * Allocate subpage prot table if not already done. * Do this with mmap_lock held */ - spt = kzalloc_obj(struct subpage_prot_table, GFP_KERNEL); + spt = kzalloc_obj(struct subpage_prot_table); if (!spt) { err = -ENOMEM; goto out; diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c index 45c1d47ec458..f168ff5a2b30 100644 --- a/arch/powerpc/mm/drmem.c +++ b/arch/powerpc/mm/drmem.c @@ -41,7 +41,7 @@ static struct property *clone_property(struct property *prop, u32 prop_sz) { struct property *new_prop; - new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop); if (!new_prop) return NULL; @@ -430,7 +430,7 @@ static void __init init_drmem_v1_lmbs(const __be32 *prop) if (drmem_info->n_lmbs == 0) return; - drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs, GFP_KERNEL); + drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs); if (!drmem_info->lmbs) return; @@ -457,7 +457,7 @@ static void __init init_drmem_v2_lmbs(const __be32 *prop) drmem_info->n_lmbs += dr_cell.seq_lmbs; } - drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs, GFP_KERNEL); + drmem_info->lmbs = kzalloc_objs(*lmb, drmem_info->n_lmbs); if (!drmem_info->lmbs) return; diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index bab22aabbb9b..a985fc96b953 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -318,7 +318,7 @@ static int __init add_system_ram_resources(void) for_each_mem_range(i, &start, &end) { struct resource *res; - res = kzalloc_obj(struct resource, GFP_KERNEL); + res = kzalloc_obj(struct resource); WARN_ON(!res); if (res) { diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index baf5b6e69647..52162e4a7f84 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c @@ -165,7 +165,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit_data = fp->aux->jit_data; if (!jit_data) { - jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data); if (!jit_data) { fp = org_fp; goto out; diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 210d16c76b40..8a8d8c2b8930 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -451,7 +451,7 @@ static ssize_t coresperchip_show(struct device *dev, static struct attribute *device_str_attr_create_(char *name, char *str) { - struct dev_ext_attribute *attr = kzalloc_obj(*attr, GFP_KERNEL); + struct dev_ext_attribute *attr = kzalloc_obj(*attr); if (!attr) return NULL; @@ -647,7 +647,7 @@ static int event_uniq_add(struct rb_root *root, const char *name, int nl, } } - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; @@ -905,13 +905,13 @@ static int create_events_from_catalog(struct attribute ***events_, pr_warn("event buffer ended before listed # of events were parsed (got %zu, wanted %zu, junk %zu)\n", event_idx_last, event_entry_count, junk_events); - events = kmalloc_objs(*events, attr_max + 1, GFP_KERNEL); + events = kmalloc_objs(*events, attr_max + 1); if (!events) { ret = -ENOMEM; goto e_event_data; } - event_descs = kmalloc_objs(*event_descs, event_idx + 1, GFP_KERNEL); + event_descs = kmalloc_objs(*event_descs, event_idx + 1); if (!event_descs) { ret = -ENOMEM; goto e_event_attrs; diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c index 11e774857030..5cac2cf3bd1e 100644 --- a/arch/powerpc/perf/hv-gpci.c +++ b/arch/powerpc/perf/hv-gpci.c @@ -910,7 +910,7 @@ static struct device_attribute *sysinfo_device_attr_create(int * attribute array, only for valid return types. */ if (!ret || ret == H_AUTHORITY || ret == H_PARAMETER) { - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return NULL; diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index c4b2c0a19f58..e3cb23906fcd 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -136,7 +136,7 @@ static struct attribute *device_str_attr_create(const char *name, const char *st { struct perf_pmu_events_attr *attr; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return NULL; sysfs_attr_init(&attr->attr.attr); @@ -257,7 +257,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) of_property_read_u32(node, "reg", &base_reg); /* Allocate memory for the events */ - pmu->events = kzalloc_objs(struct imc_events, ct, GFP_KERNEL); + pmu->events = kzalloc_objs(struct imc_events, ct); if (!pmu->events) { of_node_put(pmu_events); return -ENOMEM; @@ -274,7 +274,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) of_node_put(pmu_events); /* Allocate memory for attribute group */ - attr_group = kzalloc_obj(*attr_group, GFP_KERNEL); + attr_group = kzalloc_obj(*attr_group); if (!attr_group) { imc_free_events(pmu->events, ct); return -ENOMEM; @@ -288,7 +288,7 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu) * So allocate three times the "ct" (this includes event, event_scale and * event_unit). */ - attrs = kzalloc_objs(struct attribute *, ((ct * 3) + 1), GFP_KERNEL); + attrs = kzalloc_objs(struct attribute *, ((ct * 3) + 1)); if (!attrs) { kfree(attr_group); imc_free_events(pmu->events, ct); diff --git a/arch/powerpc/perf/vpa-dtl.c b/arch/powerpc/perf/vpa-dtl.c index ab19101a8928..3e3d65b6c796 100644 --- a/arch/powerpc/perf/vpa-dtl.c +++ b/arch/powerpc/perf/vpa-dtl.c @@ -523,7 +523,7 @@ static void *vpa_dtl_setup_aux(struct perf_event *event, void **pages, if (!buf) return NULL; - pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages); if (!pglist) return NULL; diff --git a/arch/powerpc/platforms/44x/hsta_msi.c b/arch/powerpc/platforms/44x/hsta_msi.c index a6b1c004888e..0f61bd446ce2 100644 --- a/arch/powerpc/platforms/44x/hsta_msi.c +++ b/arch/powerpc/platforms/44x/hsta_msi.c @@ -151,7 +151,7 @@ static int hsta_msi_probe(struct platform_device *pdev) if (ret) goto out; - ppc4xx_hsta_msi.irq_map = kmalloc_objs(int, irq_count, GFP_KERNEL); + ppc4xx_hsta_msi.irq_map = kmalloc_objs(int, irq_count); if (!ppc4xx_hsta_msi.irq_map) { ret = -ENOMEM; goto out1; diff --git a/arch/powerpc/platforms/44x/pci.c b/arch/powerpc/platforms/44x/pci.c index 6ac53865b872..e454b48fa9db 100644 --- a/arch/powerpc/platforms/44x/pci.c +++ b/arch/powerpc/platforms/44x/pci.c @@ -1339,7 +1339,7 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np) count = ppc4xx_pciex_hwops->core_init(np); if (count > 0) { ppc4xx_pciex_ports = - kzalloc_objs(struct ppc4xx_pciex_port, count, GFP_KERNEL); + kzalloc_objs(struct ppc4xx_pciex_port, count); if (ppc4xx_pciex_ports) { ppc4xx_pciex_port_count = count; return 0; diff --git a/arch/powerpc/platforms/44x/uic.c b/arch/powerpc/platforms/44x/uic.c index a484474df432..cf4fc5263c89 100644 --- a/arch/powerpc/platforms/44x/uic.c +++ b/arch/powerpc/platforms/44x/uic.c @@ -233,7 +233,7 @@ static struct uic * __init uic_init_one(struct device_node *node) BUG_ON(! of_device_is_compatible(node, "ibm,uic")); - uic = kzalloc_obj(*uic, GFP_KERNEL); + uic = kzalloc_obj(*uic); if (! uic) return NULL; /* FIXME: panic? */ diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index d8cdd077a554..9b693594a5f7 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c @@ -146,7 +146,7 @@ static int mcu_probe(struct i2c_client *client) struct mcu *mcu; int ret; - mcu = kzalloc_obj(*mcu, GFP_KERNEL); + mcu = kzalloc_obj(*mcu); if (!mcu) return -ENOMEM; diff --git a/arch/powerpc/platforms/book3s/vas-api.c b/arch/powerpc/platforms/book3s/vas-api.c index 6f6c9d776dd7..ea4ffa63f043 100644 --- a/arch/powerpc/platforms/book3s/vas-api.c +++ b/arch/powerpc/platforms/book3s/vas-api.c @@ -266,7 +266,7 @@ static int coproc_open(struct inode *inode, struct file *fp) { struct coproc_instance *cp_inst; - cp_inst = kzalloc_obj(*cp_inst, GFP_KERNEL); + cp_inst = kzalloc_obj(*cp_inst); if (!cp_inst) return -ENOMEM; diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 2c536040ae0a..0ec7b3bdda56 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -558,7 +558,7 @@ static int __init create_spu(void *data) unsigned long flags; ret = -ENOMEM; - spu = kzalloc_obj(*spu, GFP_KERNEL); + spu = kzalloc_obj(*spu); if (!spu) goto out; diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index ade2a5e041a3..44377dfff1f8 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -26,7 +26,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) { struct spu_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) goto out; /* Binding to physical processor deferred diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 60d9b9154997..d4665daa34c2 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -47,7 +47,7 @@ static int spufs_attr_open(struct inode *inode, struct file *file, { struct spufs_attr *attr; - attr = kmalloc_obj(*attr, GFP_KERNEL); + attr = kmalloc_obj(*attr); if (!attr) return -ENOMEM; diff --git a/arch/powerpc/platforms/cell/spufs/gang.c b/arch/powerpc/platforms/cell/spufs/gang.c index 6ab8122bc833..572c4bf8e512 100644 --- a/arch/powerpc/platforms/cell/spufs/gang.c +++ b/arch/powerpc/platforms/cell/spufs/gang.c @@ -16,7 +16,7 @@ struct spu_gang *alloc_spu_gang(void) { struct spu_gang *gang; - gang = kzalloc_obj(*gang, GFP_KERNEL); + gang = kzalloc_obj(*gang); if (!gang) goto out; diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 419ce7fee040..2b54afb31529 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -727,11 +727,11 @@ static int spufs_init_fs_context(struct fs_context *fc) struct spufs_fs_context *ctx; struct spufs_sb_info *sbi; - ctx = kzalloc_obj(struct spufs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct spufs_fs_context); if (!ctx) goto nomem; - sbi = kzalloc_obj(struct spufs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct spufs_sb_info); if (!sbi) goto nomem_ctx; diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index f61fa34b62f1..c52af883e01c 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -1082,7 +1082,7 @@ int __init spu_sched_init(void) struct proc_dir_entry *entry; int err = -ENOMEM, i; - spu_prio = kzalloc_obj(struct spu_prio_array, GFP_KERNEL); + spu_prio = kzalloc_obj(struct spu_prio_array); if (!spu_prio) goto out; diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index fd31677b38e2..9b7bc8efe8f7 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -214,7 +214,7 @@ static int gpio_mdio_probe(struct platform_device *ofdev) int err; err = -ENOMEM; - priv = kzalloc_obj(struct gpio_priv, GFP_KERNEL); + priv = kzalloc_obj(struct gpio_priv); if (!priv) goto out; diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index ec4b03fbfab2..73b7f4e8c047 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c @@ -489,7 +489,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) const u32 *psteps, *prate, *addrp; u32 steps; - host = kzalloc_obj(*host, GFP_KERNEL); + host = kzalloc_obj(*host); if (host == NULL) { printk(KERN_ERR "low_i2c: Can't allocate host for %pOF\n", np); @@ -569,7 +569,7 @@ static void __init kw_i2c_add(struct pmac_i2c_host_kw *host, { struct pmac_i2c_bus *bus; - bus = kzalloc_obj(struct pmac_i2c_bus, GFP_KERNEL); + bus = kzalloc_obj(struct pmac_i2c_bus); if (bus == NULL) return; @@ -1254,7 +1254,7 @@ static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args) * near OOM that need to be resolved, the allocator itself should * probably make GFP_NOIO implicit during suspend */ - inst = kzalloc_obj(struct pmac_i2c_pf_inst, GFP_KERNEL); + inst = kzalloc_obj(struct pmac_i2c_pf_inst); if (inst == NULL) { pmac_i2c_close(bus); return NULL; diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index d1e2e557de15..c76b9d501d3a 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c @@ -644,7 +644,7 @@ static int pmf_add_function_prop(struct pmf_device *dev, void *driverdata, while (length >= 12) { /* Allocate a structure */ - func = kzalloc_obj(*func, GFP_KERNEL); + func = kzalloc_obj(*func); if (func == NULL) goto bail; kref_init(&func->ref); @@ -720,7 +720,7 @@ int pmf_register_driver(struct device_node *np, return -EBUSY; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { DBG("pmf: no memory !\n"); return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/ocxl.c b/arch/powerpc/platforms/powernv/ocxl.c index 5ae7e3960364..6192caaf85e6 100644 --- a/arch/powerpc/platforms/powernv/ocxl.c +++ b/arch/powerpc/platforms/powernv/ocxl.c @@ -149,7 +149,7 @@ static struct npu_link *find_link(struct pci_dev *dev) } /* link doesn't exist yet. Allocate one */ - link = kzalloc_obj(struct npu_link, GFP_KERNEL); + link = kzalloc_obj(struct npu_link); if (!link) return NULL; link->domain = pci_domain_nr(dev->bus); @@ -439,7 +439,7 @@ int pnv_ocxl_spa_setup(struct pci_dev *dev, void *spa_mem, int PE_mask, u32 bdfn; int rc; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c index 4f1533bcaa10..e76e462f55f6 100644 --- a/arch/powerpc/platforms/powernv/opal-core.c +++ b/arch/powerpc/platforms/powernv/opal-core.c @@ -81,7 +81,7 @@ bool kernel_initiated; static struct opalcore * __init get_new_element(void) { - return kzalloc_obj(struct opalcore, GFP_KERNEL); + return kzalloc_obj(struct opalcore); } static inline int is_opalcore_usable(void) @@ -497,7 +497,7 @@ static void __init opalcore_config_init(void) opalc_cpu_metadata = __va(addr); /* Allocate memory for config buffer */ - oc_conf = kzalloc_obj(struct opalcore_config, GFP_KERNEL); + oc_conf = kzalloc_obj(struct opalcore_config); if (oc_conf == NULL) goto error_out; diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c index a832afb4cbf5..2e4bffa74163 100644 --- a/arch/powerpc/platforms/powernv/opal-dump.c +++ b/arch/powerpc/platforms/powernv/opal-dump.c @@ -329,7 +329,7 @@ static void create_dump_obj(uint32_t id, size_t size, uint32_t type) struct dump_obj *dump; int rc; - dump = kzalloc_obj(*dump, GFP_KERNEL); + dump = kzalloc_obj(*dump); if (!dump) return; diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c index 39e9eb162ed7..2b8331922ab9 100644 --- a/arch/powerpc/platforms/powernv/opal-elog.c +++ b/arch/powerpc/platforms/powernv/opal-elog.c @@ -190,7 +190,7 @@ static void create_elog_obj(uint64_t id, size_t size, uint64_t type) struct elog_obj *elog; int rc; - elog = kzalloc_obj(*elog, GFP_KERNEL); + elog = kzalloc_obj(*elog); if (!elog) return; diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index c57525c1fecd..ed2842bea1cb 100644 --- a/arch/powerpc/platforms/powernv/opal-imc.c +++ b/arch/powerpc/platforms/powernv/opal-imc.c @@ -146,7 +146,7 @@ static struct imc_pmu *imc_pmu_create(struct device_node *parent, int pmu_index, return NULL; /* memory for pmu */ - pmu_ptr = kzalloc_obj(*pmu_ptr, GFP_KERNEL); + pmu_ptr = kzalloc_obj(*pmu_ptr); if (!pmu_ptr) return NULL; diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c index 7cf5cae6ef42..fc0a1eae59c5 100644 --- a/arch/powerpc/platforms/powernv/opal-irqchip.c +++ b/arch/powerpc/platforms/powernv/opal-irqchip.c @@ -221,7 +221,7 @@ int __init opal_event_init(void) opal_irq_count, old_style ? "old" : "new"); /* Allocate an IRQ resources array */ - opal_irqs = kzalloc_objs(struct resource, opal_irq_count, GFP_KERNEL); + opal_irqs = kzalloc_objs(struct resource, opal_irq_count); if (WARN_ON(!opal_irqs)) { rc = -ENOMEM; goto out; diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c index c41ca500669d..2bb326b58ff8 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c @@ -355,7 +355,7 @@ static int opal_lpc_debugfs_create_type(struct dentry *folder, enum OpalLPCAddressType type) { struct lpc_debugfs_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; entry->lpc_type = type; diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c index d530ac77b0e2..0e297d70647f 100644 --- a/arch/powerpc/platforms/powernv/opal-powercap.c +++ b/arch/powerpc/platforms/powernv/opal-powercap.c @@ -150,7 +150,7 @@ void __init opal_powercap_init(void) return; } - pcaps = kzalloc_objs(*pcaps, of_get_child_count(powercap), GFP_KERNEL); + pcaps = kzalloc_objs(*pcaps, of_get_child_count(powercap)); if (!pcaps) goto out_put_powercap; diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c index c91e48d773ff..2a3474246908 100644 --- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c +++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c @@ -168,7 +168,7 @@ void __init opal_sensor_groups_init(void) return; } - sgs = kzalloc_objs(*sgs, of_get_child_count(sg), GFP_KERNEL); + sgs = kzalloc_objs(*sgs, of_get_child_count(sg)); if (!sgs) goto out_sg_put; diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c index 358d1b8a3e86..7fe6433517ca 100644 --- a/arch/powerpc/platforms/powernv/opal-sysparam.c +++ b/arch/powerpc/platforms/powernv/opal-sysparam.c @@ -222,7 +222,7 @@ void __init opal_sys_param_init(void) goto out_free_perm; } - attr = kzalloc_objs(*attr, count, GFP_KERNEL); + attr = kzalloc_objs(*attr, count); if (!attr) { pr_err("SYSPARAM: Failed to allocate memory for parameter " "attributes\n"); diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index bd788d62af5f..2ad5787a922f 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c @@ -158,7 +158,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, struct scom_debug_entry *ent; struct dentry *dir; - ent = kzalloc_obj(*ent, GFP_KERNEL); + ent = kzalloc_obj(*ent); if (!ent) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index b1b1d3496739..1946dbdc9fa1 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -801,7 +801,7 @@ static int opal_add_one_export(struct kobject *parent, const char *export_name, if (rc) goto out; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) { rc = -ENOMEM; goto out; diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index d77ff328eb37..885392f4cd94 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -2522,7 +2522,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, phb_id = be64_to_cpup(prop64); pr_debug(" PHB-ID : 0x%016llx\n", phb_id); - phb = kzalloc_obj(*phb, GFP_KERNEL); + phb = kzalloc_obj(*phb); if (!phb) panic("%s: Failed to allocate %zu bytes\n", __func__, sizeof(*phb)); diff --git a/arch/powerpc/platforms/powernv/pci-sriov.c b/arch/powerpc/platforms/powernv/pci-sriov.c index f1a8fcfdb2ba..7105a573aec4 100644 --- a/arch/powerpc/platforms/powernv/pci-sriov.c +++ b/arch/powerpc/platforms/powernv/pci-sriov.c @@ -149,7 +149,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) struct pnv_iov_data *iov; int mul; - iov = kzalloc_obj(*iov, GFP_KERNEL); + iov = kzalloc_obj(*iov); if (!iov) goto disable_iov; pdev->dev.archdata.iov_data = iov; diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c index 6034f2cdcaf2..7a4c38cd6a82 100644 --- a/arch/powerpc/platforms/powernv/rng.c +++ b/arch/powerpc/platforms/powernv/rng.c @@ -120,7 +120,7 @@ static __init int rng_create(struct device_node *dn) struct resource res; unsigned long val; - rng = kzalloc_obj(*rng, GFP_KERNEL); + rng = kzalloc_obj(*rng); if (!rng) return -ENOMEM; diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c index 06748e0d5c32..9f093176b8db 100644 --- a/arch/powerpc/platforms/powernv/vas-window.c +++ b/arch/powerpc/platforms/powernv/vas-window.c @@ -543,7 +543,7 @@ static struct pnv_vas_window *vas_window_alloc(struct vas_instance *vinst) if (winid < 0) return ERR_PTR(winid); - window = kzalloc_obj(*window, GFP_KERNEL); + window = kzalloc_obj(*window); if (!window) goto out_free; diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c index ca3553003b7c..815684c2b56e 100644 --- a/arch/powerpc/platforms/powernv/vas.c +++ b/arch/powerpc/platforms/powernv/vas.c @@ -74,7 +74,7 @@ static int init_vas_instance(struct platform_device *pdev) return -ENODEV; } - vinst = kzalloc_obj(*vinst, GFP_KERNEL); + vinst = kzalloc_obj(*vinst); if (!vinst) return -ENOMEM; diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 74e7fb0adcdb..37c1a52e4f7e 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -31,7 +31,7 @@ static int __init ps3_register_lpm_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -126,7 +126,7 @@ static int __init ps3_setup_gelic_device( BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB); BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_GELIC); - p = kzalloc_obj(struct layout, GFP_KERNEL); + p = kzalloc_obj(struct layout); if (!p) { result = -ENOMEM; @@ -197,7 +197,7 @@ static int __init ps3_setup_uhc_device( BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB); BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_USB); - p = kzalloc_obj(struct layout, GFP_KERNEL); + p = kzalloc_obj(struct layout); if (!p) { result = -ENOMEM; @@ -294,7 +294,7 @@ static int __init ps3_setup_vuart_device(enum ps3_match_id match_id, pr_debug(" -> %s:%d: match_id %u, port %u\n", __func__, __LINE__, match_id, port_number); - p = kzalloc_obj(struct layout, GFP_KERNEL); + p = kzalloc_obj(struct layout); if (!p) return -ENOMEM; @@ -447,7 +447,7 @@ static int __init ps3_register_sound_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; @@ -481,7 +481,7 @@ static int __init ps3_register_graphics_devices(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc_obj(struct layout, GFP_KERNEL); + p = kzalloc_obj(struct layout); if (!p) return -ENOMEM; @@ -516,7 +516,7 @@ static int __init ps3_register_ramdisk_device(void) pr_debug(" -> %s:%d\n", __func__, __LINE__); - p = kzalloc_obj(struct layout, GFP_KERNEL); + p = kzalloc_obj(struct layout); if (!p) return -ENOMEM; @@ -783,7 +783,7 @@ static int ps3_probe_thread(void *data) pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__); - local = kzalloc_obj(*local, GFP_KERNEL); + local = kzalloc_obj(*local); if (!local) return -ENOMEM; diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c index cd4ff2032cb0..10ab256b675c 100644 --- a/arch/powerpc/platforms/ps3/spu.c +++ b/arch/powerpc/platforms/ps3/spu.c @@ -336,7 +336,7 @@ static int __init ps3_create_spu(struct spu *spu, void *data) pr_debug("%s:%d spu_%d\n", __func__, __LINE__, spu->number); - spu->pdata = kzalloc_obj(struct spu_pdata, GFP_KERNEL); + spu->pdata = kzalloc_obj(struct spu_pdata); if (!spu->pdata) { result = -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index ea5e97f1f054..a7c451c2507d 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -53,7 +53,7 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa) char *name; char *value; - prop = kzalloc_obj(*prop, GFP_KERNEL); + prop = kzalloc_obj(*prop); if (!prop) return NULL; @@ -80,7 +80,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa) struct device_node *dn; const char *name; - dn = kzalloc_obj(*dn, GFP_KERNEL); + dn = kzalloc_obj(*dn); if (!dn) return NULL; diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index a040d34c4e40..b2f14db59034 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -33,7 +33,7 @@ static struct property *dlpar_clone_property(struct property *prop, { struct property *new_prop; - new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop); if (!new_prop) return NULL; diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 27de08d8fa15..3e1f915fe4f6 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -1000,7 +1000,7 @@ static void copy_property(struct device_node *pdn, const char *from, const char if (!src) return; - dst = kzalloc_obj(*dst, GFP_KERNEL); + dst = kzalloc_obj(*dst); if (!dst) return; @@ -1089,7 +1089,7 @@ static struct dma_win *ddw_list_new_entry(struct device_node *pdn, { struct dma_win *window; - window = kzalloc_obj(*window, GFP_KERNEL); + window = kzalloc_obj(*window); if (!window) return NULL; @@ -1409,12 +1409,12 @@ static struct property *ddw_property_create(const char *propname, u32 liobn, u64 struct dynamic_dma_window_prop *ddwprop; struct property *win64; - win64 = kzalloc_obj(*win64, GFP_KERNEL); + win64 = kzalloc_obj(*win64); if (!win64) return NULL; win64->name = kstrdup(propname, GFP_KERNEL); - ddwprop = kzalloc_obj(*ddwprop, GFP_KERNEL); + ddwprop = kzalloc_obj(*ddwprop); win64->value = ddwprop; win64->length = sizeof(*ddwprop); if (!win64->name || !win64->value) { @@ -1760,7 +1760,7 @@ out_failed: if (default_win_removed || limited_addr_enabled) reset_dma_window(dev, pdn); - fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; @@ -2235,7 +2235,7 @@ remove_window: __remove_dma_window(pdn, ddw_avail, create.liobn); out_failed: - fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; @@ -2322,7 +2322,7 @@ static long spapr_tce_unset_window(struct iommu_table_group *table_group, int nu goto out_unlock; out_failed: - fpdn = kzalloc_obj(*fpdn, GFP_KERNEL); + fpdn = kzalloc_obj(*fpdn); if (!fpdn) goto out_unlock; fpdn->pdn = pdn; diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c index bf6f9789167f..8821c378bfff 100644 --- a/arch/powerpc/platforms/pseries/lparcfg.c +++ b/arch/powerpc/platforms/pseries/lparcfg.c @@ -146,7 +146,7 @@ static void show_gpci_data(struct seq_file *m) unsigned int affinity_score; long ret; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (buf == NULL) return; diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 892f59c41d83..b5c2abd12432 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -146,7 +146,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, new_prop->value = new_data; new_prop->length += vd; } else { - new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop); if (!new_prop) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 3bc617a96671..64ffc6476ad6 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -441,7 +441,7 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev int ret; struct pseries_msi_device *pseries_dev __free(kfree) - = kmalloc_obj(*pseries_dev, GFP_KERNEL); + = kmalloc_obj(*pseries_dev); if (!pseries_dev) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/papr-sysparm.c b/arch/powerpc/platforms/pseries/papr-sysparm.c index 7974750ab868..fdff151ed8bb 100644 --- a/arch/powerpc/platforms/pseries/papr-sysparm.c +++ b/arch/powerpc/platforms/pseries/papr-sysparm.c @@ -19,7 +19,7 @@ struct papr_sysparm_buf *papr_sysparm_buf_alloc(void) { - struct papr_sysparm_buf *buf = kzalloc_obj(*buf, GFP_KERNEL); + struct papr_sysparm_buf *buf = kzalloc_obj(*buf); return buf; } diff --git a/arch/powerpc/platforms/pseries/papr_platform_attributes.c b/arch/powerpc/platforms/pseries/papr_platform_attributes.c index a7821279661a..38b417c158ba 100644 --- a/arch/powerpc/platforms/pseries/papr_platform_attributes.c +++ b/arch/powerpc/platforms/pseries/papr_platform_attributes.c @@ -295,7 +295,7 @@ retry: goto out_free_esi_buf; } - papr_groups = kzalloc_objs(*papr_groups, num_attrs, GFP_KERNEL); + papr_groups = kzalloc_objs(*papr_groups, num_attrs); if (!papr_groups) goto out_free_esi_buf; diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index 5d41c0223f10..63eca4ebb5e5 100644 --- a/arch/powerpc/platforms/pseries/papr_scm.c +++ b/arch/powerpc/platforms/pseries/papr_scm.c @@ -445,7 +445,7 @@ static void papr_scm_pmu_register(struct papr_scm_priv *p) struct nvdimm_pmu *nd_pmu; int rc, nodeid; - nd_pmu = kzalloc_obj(*nd_pmu, GFP_KERNEL); + nd_pmu = kzalloc_obj(*nd_pmu); if (!nd_pmu) { rc = -ENOMEM; goto pmu_err_print; @@ -1398,7 +1398,7 @@ static int papr_scm_probe(struct platform_device *pdev) */ update_numa_distance(dn); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 8ce3f591a2b4..84e4ffe957a8 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c @@ -141,7 +141,7 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) } pdn = pci_get_pdn(pdev); - pdn->pe_num_map = kmalloc_objs(*pdn->pe_num_map, num_vfs, GFP_KERNEL); + pdn->pe_num_map = kmalloc_objs(*pdn->pe_num_map, num_vfs); if (!pdn->pe_num_map) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 38f4312f5210..7faebcffc9df 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -25,7 +25,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist struct device_node *np; int err = -ENOMEM; - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); if (!np) goto out_err; @@ -168,7 +168,7 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last) { - struct property *new = kzalloc_obj(*new, GFP_KERNEL); + struct property *new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c index 44ed41dd4b5f..4f6fbbb672ae 100644 --- a/arch/powerpc/platforms/pseries/vas-sysfs.c +++ b/arch/powerpc/platforms/pseries/vas-sysfs.c @@ -202,7 +202,7 @@ int sysfs_add_vas_caps(struct vas_cop_feat_caps *caps) int ret = 0; char *name; - centry = kzalloc_obj(*centry, GFP_KERNEL); + centry = kzalloc_obj(*centry); if (!centry) return -ENOMEM; diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index d8890b62197b..ceb0a8788c0a 100644 --- a/arch/powerpc/platforms/pseries/vas.c +++ b/arch/powerpc/platforms/pseries/vas.c @@ -324,7 +324,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags, struct pseries_vas_window *txwin; int rc; - txwin = kzalloc_obj(*txwin, GFP_KERNEL); + txwin = kzalloc_obj(*txwin); if (!txwin) return ERR_PTR(-ENOMEM); @@ -1087,7 +1087,7 @@ static int __init pseries_vas_init(void) return -ENOTSUPP; } - hv_caps = kmalloc_obj(*hv_caps, GFP_KERNEL); + hv_caps = kmalloc_obj(*hv_caps); if (!hv_caps) return -ENOMEM; /* diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c index 4cb192cd5aa9..08e2add48adb 100644 --- a/arch/powerpc/platforms/pseries/vio.c +++ b/arch/powerpc/platforms/pseries/vio.c @@ -744,7 +744,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev) viodev->cmo.desired = VIO_CMO_MIN_ENT; size = VIO_CMO_MIN_ENT; - dev_ent = kmalloc_obj(struct vio_cmo_dev_entry, GFP_KERNEL); + dev_ent = kmalloc_obj(struct vio_cmo_dev_entry); if (!dev_ent) return -ENOMEM; @@ -1164,7 +1164,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) if (!dma_window) return NULL; - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (tbl == NULL) return NULL; @@ -1375,7 +1375,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) } /* allocate a vio_dev for this node */ - viodev = kzalloc_obj(struct vio_dev, GFP_KERNEL); + viodev = kzalloc_obj(struct vio_dev); if (viodev == NULL) { pr_warn("%s: allocation failure for VIO device.\n", __func__); return NULL; diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c index c4c61216b96a..02411b0cf46f 100644 --- a/arch/powerpc/sysdev/ehv_pic.c +++ b/arch/powerpc/sysdev/ehv_pic.c @@ -263,7 +263,7 @@ void __init ehv_pic_init(void) return; } - ehv_pic = kzalloc_obj(struct ehv_pic, GFP_KERNEL); + ehv_pic = kzalloc_obj(struct ehv_pic); if (!ehv_pic) { of_node_put(np); return; diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index fabf39586eba..87fe47f41a39 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c @@ -382,7 +382,7 @@ static int __init fsl_gtm_init(void) const u32 *clock; int size; - gtm = kzalloc_obj(*gtm, GFP_KERNEL); + gtm = kzalloc_obj(*gtm); if (!gtm) { pr_err("%pOF: unable to allocate memory\n", np); diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c index 01ddc6ac8277..839cf5adc7d9 100644 --- a/arch/powerpc/sysdev/fsl_lbc.c +++ b/arch/powerpc/sysdev/fsl_lbc.c @@ -283,7 +283,7 @@ static int fsl_lbc_ctrl_probe(struct platform_device *dev) return -EFAULT; } - fsl_lbc_ctrl_dev = kzalloc_obj(*fsl_lbc_ctrl_dev, GFP_KERNEL); + fsl_lbc_ctrl_dev = kzalloc_obj(*fsl_lbc_ctrl_dev); if (!fsl_lbc_ctrl_dev) return -ENOMEM; @@ -363,7 +363,7 @@ static int fsl_lbc_syscore_suspend(void *data) if (!lbc) goto out; - ctrl->saved_regs = kmalloc_obj(struct fsl_lbc_regs, GFP_KERNEL); + ctrl->saved_regs = kmalloc_obj(struct fsl_lbc_regs); if (!ctrl->saved_regs) return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c b/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c index 43d6fba2bd42..f9e64f54dc14 100644 --- a/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c +++ b/arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c @@ -111,7 +111,7 @@ static int __init fsl_wakeup_sys_init(void) struct device *dev_root; int ret = -EINVAL; - fsl_wakeup = kzalloc_obj(struct fsl_mpic_timer_wakeup, GFP_KERNEL); + fsl_wakeup = kzalloc_obj(struct fsl_mpic_timer_wakeup); if (!fsl_wakeup) return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 525ea894c14a..5dbc78713193 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -361,7 +361,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev, return 0; } - cascade_data = kzalloc_obj(struct fsl_msi_cascade_data, GFP_KERNEL); + cascade_data = kzalloc_obj(struct fsl_msi_cascade_data); if (!cascade_data) { dev_err(&dev->dev, "No memory for MSI cascade data\n"); return -ENOMEM; @@ -405,7 +405,7 @@ static int fsl_of_msi_probe(struct platform_device *dev) printk(KERN_DEBUG "Setting up Freescale MSI support\n"); - msi = kzalloc_obj(struct fsl_msi, GFP_KERNEL); + msi = kzalloc_obj(struct fsl_msi); if (!msi) { dev_err(&dev->dev, "No memory for MSI structure\n"); return -ENOMEM; diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 0952b5ff8a16..600f83cea1cd 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -767,7 +767,7 @@ static int __init mpc83xx_pcie_setup(struct pci_controller *hose, u32 cfg_bar; int ret = -ENOMEM; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return ret; diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 249b876daaee..eb55dabb4748 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -470,7 +470,7 @@ static int fsl_rio_setup(struct platform_device *dev) goto err_rio_regs; } - ops = kzalloc_obj(struct rio_ops, GFP_KERNEL); + ops = kzalloc_obj(struct rio_ops); if (!ops) { rc = -ENOMEM; goto err_ops; @@ -517,7 +517,7 @@ static int fsl_rio_setup(struct platform_device *dev) rc = -ENODEV; goto err_dbell; } - dbell = kzalloc_obj(struct fsl_rio_dbell, GFP_KERNEL); + dbell = kzalloc_obj(struct fsl_rio_dbell); if (!(dbell)) { dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_dbell'\n"); rc = -ENOMEM; @@ -543,7 +543,7 @@ static int fsl_rio_setup(struct platform_device *dev) rc = -ENODEV; goto err_pw; } - pw = kzalloc_obj(struct fsl_rio_pw, GFP_KERNEL); + pw = kzalloc_obj(struct fsl_rio_pw); if (!(pw)) { dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_pw'\n"); rc = -ENOMEM; @@ -580,7 +580,7 @@ static int fsl_rio_setup(struct platform_device *dev) dev_info(&dev->dev, "%pOF: LAW %pR\n", np, &res); - port = kzalloc_obj(struct rio_mport, GFP_KERNEL); + port = kzalloc_obj(struct rio_mport); if (!port) continue; @@ -593,7 +593,7 @@ static int fsl_rio_setup(struct platform_device *dev) i = *port_index - 1; port->index = (unsigned char)i; - priv = kzalloc_obj(struct rio_priv, GFP_KERNEL); + priv = kzalloc_obj(struct rio_priv); if (!priv) { dev_err(&dev->dev, "Can't alloc memory for 'priv'\n"); kfree(port); diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index c0e358cf7822..4f2afd021e3c 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -1079,7 +1079,7 @@ int fsl_rio_setup_rmu(struct rio_mport *mport, struct device_node *node) return -EINVAL; } - rmu = kzalloc_obj(struct fsl_rmu, GFP_KERNEL); + rmu = kzalloc_obj(struct fsl_rmu); if (!rmu) return -ENOMEM; diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 2351604cc24a..77e6f23c5f52 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c @@ -707,7 +707,7 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) if (ret) return NULL; - ipic = kzalloc_obj(*ipic, GFP_KERNEL); + ipic = kzalloc_obj(*ipic); if (ipic == NULL) return NULL; diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index cb4cdd853cc8..eba277134224 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -547,7 +547,7 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic) printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n"); /* Allocate fixups array */ - mpic->fixups = kzalloc_objs(*mpic->fixups, 128, GFP_KERNEL); + mpic->fixups = kzalloc_objs(*mpic->fixups, 128); BUG_ON(mpic->fixups == NULL); /* Init spinlock */ @@ -1273,7 +1273,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, mpic_tm_chip.flags |= IRQCHIP_SKIP_SET_WAKE; } - mpic = kzalloc_obj(struct mpic, GFP_KERNEL); + mpic = kzalloc_obj(struct mpic); if (mpic == NULL) goto err_of_node_put; diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index 8b1c02f5b1b3..e9af4fa940b1 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -227,7 +227,7 @@ static int mpic_msgr_probe(struct platform_device *dev) struct mpic_msgr *msgr; unsigned int reg_number; - msgr = kzalloc_obj(struct mpic_msgr, GFP_KERNEL); + msgr = kzalloc_obj(struct mpic_msgr); if (!msgr) { dev_err(&dev->dev, "No memory for message register\n"); return -ENOMEM; diff --git a/arch/powerpc/sysdev/mpic_timer.c b/arch/powerpc/sysdev/mpic_timer.c index 7b237b6f7151..10acf9988016 100644 --- a/arch/powerpc/sysdev/mpic_timer.c +++ b/arch/powerpc/sysdev/mpic_timer.c @@ -464,7 +464,7 @@ static void __init timer_group_init(struct device_node *np) unsigned int i = 0; int ret; - priv = kzalloc_obj(struct timer_group_priv, GFP_KERNEL); + priv = kzalloc_obj(struct timer_group_priv); if (!priv) { pr_err("%pOF: cannot allocate memory for group.\n", np); return; diff --git a/arch/powerpc/sysdev/of_rtc.c b/arch/powerpc/sysdev/of_rtc.c index 6c2ba4c44b11..ab0d6be0fc97 100644 --- a/arch/powerpc/sysdev/of_rtc.c +++ b/arch/powerpc/sysdev/of_rtc.c @@ -33,7 +33,7 @@ void __init of_instantiate_rtc(void) of_rtc_table[i].compatible) { struct resource *res; - res = kmalloc_obj(*res, GFP_KERNEL); + res = kmalloc_obj(*res); if (!res) { printk(KERN_ERR "OF RTC: Out of memory " "allocating resource structure for %pOF\n", diff --git a/arch/powerpc/sysdev/xics/ics-native.c b/arch/powerpc/sysdev/xics/ics-native.c index 50634a0ae478..0b0d07db6998 100644 --- a/arch/powerpc/sysdev/xics/ics-native.c +++ b/arch/powerpc/sysdev/xics/ics-native.c @@ -186,7 +186,7 @@ static int __init ics_native_add_one(struct device_node *np) u32 ranges[2]; int rc, count; - ics = kzalloc_obj(struct ics_native, GFP_KERNEL); + ics = kzalloc_obj(struct ics_native); if (!ics) return -ENOMEM; ics->node = of_node_get(np); diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index f0fbee162f47..e1a4f8a97393 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1016,7 +1016,7 @@ static struct xive_irq_data *xive_irq_alloc_data(unsigned int virq, irq_hw_numbe struct xive_irq_data *xd; int rc; - xd = kzalloc_obj(struct xive_irq_data, GFP_KERNEL); + xd = kzalloc_obj(struct xive_irq_data); if (!xd) return ERR_PTR(-ENOMEM); rc = xive_ops->populate_irq_data(hw, xd); diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index dca293f07303..61f8a8acf81f 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -52,7 +52,7 @@ static int __init xive_irq_bitmap_add(int base, int count) { struct xive_irq_bitmap *xibm; - xibm = kzalloc_obj(*xibm, GFP_KERNEL); + xibm = kzalloc_obj(*xibm); if (!xibm) return -ENOMEM; diff --git a/arch/riscv/kernel/hibernate.c b/arch/riscv/kernel/hibernate.c index 0e31c02cb554..982843828adb 100644 --- a/arch/riscv/kernel/hibernate.c +++ b/arch/riscv/kernel/hibernate.c @@ -415,7 +415,7 @@ int hibernate_resume_nonboot_cpu_disable(void) static int __init riscv_hibernate_init(void) { - hibernate_cpu_context = kzalloc_obj(*hibernate_cpu_context, GFP_KERNEL); + hibernate_cpu_context = kzalloc_obj(*hibernate_cpu_context); if (WARN_ON(!hibernate_cpu_context)) return -ENOMEM; diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index addc7dac2424..cc2f980700f3 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -663,7 +663,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, struct used_bucket *bucket; unsigned long hash; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -697,7 +697,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, * relocation_entry. */ if (!found) { - rel_head = kmalloc_obj(*rel_head, GFP_KERNEL); + rel_head = kmalloc_obj(*rel_head); if (!rel_head) { kfree(entry); @@ -709,7 +709,7 @@ static int add_relocation_to_accumulate(struct module *me, int type, INIT_HLIST_NODE(&rel_head->node); if (!current_head->first) { bucket = - kmalloc_obj(struct used_bucket, GFP_KERNEL); + kmalloc_obj(struct used_bucket); if (!bucket) { kfree(entry); diff --git a/arch/riscv/kernel/tests/kprobes/test-kprobes.c b/arch/riscv/kernel/tests/kprobes/test-kprobes.c index c0526c0c7527..027424a3ff7b 100644 --- a/arch/riscv/kernel/tests/kprobes/test-kprobes.c +++ b/arch/riscv/kernel/tests/kprobes/test-kprobes.c @@ -20,7 +20,7 @@ static void test_kprobe_riscv(struct kunit *test) while (test_kprobes_addresses[num_kprobe]) num_kprobe++; - kp = kzalloc_objs(*kp, num_kprobe, GFP_KERNEL); + kp = kzalloc_objs(*kp, num_kprobe); KUNIT_EXPECT_TRUE(test, kp); if (!kp) return; diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 63ed6e6b24eb..b36a6a56f404 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -139,7 +139,7 @@ static void __init check_unaligned_access_speed_all_cpus(void) { unsigned int cpu; unsigned int cpu_count = num_possible_cpus(); - struct page **bufs = kzalloc_objs(*bufs, cpu_count, GFP_KERNEL); + struct page **bufs = kzalloc_objs(*bufs, cpu_count); if (!bufs) { pr_warn("Allocation failure, not measuring misaligned performance\n"); diff --git a/arch/riscv/kvm/aia_aplic.c b/arch/riscv/kvm/aia_aplic.c index 25d9c2a3a85a..d1e50bf5c351 100644 --- a/arch/riscv/kvm/aia_aplic.c +++ b/arch/riscv/kvm/aia_aplic.c @@ -580,7 +580,7 @@ int kvm_riscv_aia_aplic_init(struct kvm *kvm) return 0; /* Allocate APLIC global state */ - aplic = kzalloc_obj(*aplic, GFP_KERNEL); + aplic = kzalloc_obj(*aplic); if (!aplic) return -ENOMEM; kvm->arch.aia.aplic_state = aplic; @@ -588,7 +588,7 @@ int kvm_riscv_aia_aplic_init(struct kvm *kvm) /* Setup APLIC IRQs */ aplic->nr_irqs = kvm->arch.aia.nr_sources + 1; aplic->nr_words = DIV_ROUND_UP(aplic->nr_irqs, 32); - aplic->irqs = kzalloc_objs(*aplic->irqs, aplic->nr_irqs, GFP_KERNEL); + aplic->irqs = kzalloc_objs(*aplic->irqs, aplic->nr_irqs); if (!aplic->irqs) { ret = -ENOMEM; goto fail_free_aplic; diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c index aafa19629524..06752fa24798 100644 --- a/arch/riscv/kvm/aia_imsic.c +++ b/arch/riscv/kvm/aia_imsic.c @@ -1095,7 +1095,7 @@ int kvm_riscv_vcpu_aia_imsic_init(struct kvm_vcpu *vcpu) return -EINVAL; /* Allocate IMSIC context */ - imsic = kzalloc_obj(*imsic, GFP_KERNEL); + imsic = kzalloc_obj(*imsic); if (!imsic) return -ENOMEM; vcpu->arch.aia_context.imsic_state = imsic; diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c index ca3da58dc968..7cbd2340c190 100644 --- a/arch/riscv/kvm/vm.c +++ b/arch/riscv/kvm/vm.c @@ -95,7 +95,7 @@ int kvm_riscv_setup_default_irq_routing(struct kvm *kvm, u32 lines) struct kvm_irq_routing_entry *ents; int i, rc; - ents = kzalloc_objs(*ents, lines, GFP_KERNEL); + ents = kzalloc_objs(*ents, lines); if (!ents) return -ENOMEM; diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index 4d1c2639a64f..2f1109dbf105 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -1195,7 +1195,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, } if (fmod_ret->nr_links) { - branches_off = kzalloc_objs(int, fmod_ret->nr_links, GFP_KERNEL); + branches_off = kzalloc_objs(int, fmod_ret->nr_links); if (!branches_off) return -ENOMEM; diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c index af48c94e300a..b3581e926436 100644 --- a/arch/riscv/net/bpf_jit_core.c +++ b/arch/riscv/net/bpf_jit_core.c @@ -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; @@ -82,7 +82,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) ctx->arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena); ctx->user_vm_start = bpf_arena_get_user_vm_start(prog->aux->arena); 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; diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 0d6725fd881e..edbedbb2a773 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -140,7 +140,7 @@ int appldata_diag(char record_nr, u16 function, unsigned long buffer, struct appldata_product_id *id; int rc; - parm_list = kmalloc_obj(*parm_list, GFP_KERNEL); + parm_list = kmalloc_obj(*parm_list); id = kmemdup(&appldata_id, sizeof(appldata_id), GFP_KERNEL); rc = -ENOMEM; if (parm_list && id) { @@ -350,7 +350,7 @@ int appldata_register_ops(struct appldata_ops *ops) if (ops->size > APPLDATA_MAX_REC_SIZE) return -EINVAL; - ops->ctl_table = kzalloc_objs(struct ctl_table, 1, GFP_KERNEL); + ops->ctl_table = kzalloc_objs(struct ctl_table, 1); if (!ops->ctl_table) return -ENOMEM; diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index e24369ec3134..659af5545a38 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c @@ -130,7 +130,7 @@ static int __init appldata_mem_init(void) { int ret; - ops.data = kzalloc_obj(struct appldata_mem_data, GFP_KERNEL); + ops.data = kzalloc_obj(struct appldata_mem_data); if (!ops.data) return -ENOMEM; diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index 3a0574f33664..972f6d592c32 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c @@ -132,7 +132,7 @@ static int __init appldata_net_init(void) { int ret; - ops.data = kzalloc_obj(struct appldata_net_sum_data, GFP_KERNEL); + ops.data = kzalloc_obj(struct appldata_net_sum_data); if (!ops.data) return -ENOMEM; diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c index 8002bdc692d6..25a59c048857 100644 --- a/arch/s390/hypfs/hypfs_dbfs.c +++ b/arch/s390/hypfs/hypfs_dbfs.c @@ -16,7 +16,7 @@ static struct hypfs_dbfs_data *hypfs_dbfs_data_alloc(struct hypfs_dbfs_file *f) { struct hypfs_dbfs_data *data; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return NULL; data->dbfs_file = f; diff --git a/arch/s390/hypfs/hypfs_diag0c.c b/arch/s390/hypfs/hypfs_diag0c.c index 5e27dc7a7569..8f726e6558a8 100644 --- a/arch/s390/hypfs/hypfs_diag0c.c +++ b/arch/s390/hypfs/hypfs_diag0c.c @@ -35,7 +35,7 @@ static void *diag0c_store(unsigned int *count) cpus_read_lock(); cpu_count = num_online_cpus(); - cpu_vec = kmalloc_objs(*cpu_vec, num_possible_cpus(), GFP_KERNEL); + cpu_vec = kmalloc_objs(*cpu_vec, num_possible_cpus()); if (!cpu_vec) goto fail_unlock_cpus; /* Note: Diag 0c needs 8 byte alignment and real storage */ diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c index 2e8847048dc1..08042d3a9d56 100644 --- a/arch/s390/hypfs/hypfs_sprp.c +++ b/arch/s390/hypfs/hypfs_sprp.c @@ -74,7 +74,7 @@ static int __hypfs_sprp_ioctl(void __user *user_area) rc = -ENOMEM; data = (void *)get_zeroed_page(GFP_KERNEL); - diag304 = kzalloc_obj(*diag304, GFP_KERNEL); + diag304 = kzalloc_obj(*diag304); if (!data || !diag304) goto out; diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 0f4a9113ec1a..559b011e6880 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -292,7 +292,7 @@ static int hypfs_init_fs_context(struct fs_context *fc) { struct hypfs_sb_info *sbi; - sbi = kzalloc_obj(struct hypfs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct hypfs_sb_info); if (!sbi) return -ENOMEM; diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h index 94de4ddf503f..06e1ec2afd5a 100644 --- a/arch/s390/include/asm/idals.h +++ b/arch/s390/include/asm/idals.h @@ -195,7 +195,7 @@ static inline struct idal_buffer **idal_buffer_array_alloc(size_t size, int page int i; count = (size + CCW_MAX_BYTE_COUNT - 1) / CCW_MAX_BYTE_COUNT; - ibs = kmalloc_objs(*ibs, count + 1, GFP_KERNEL); + ibs = kmalloc_objs(*ibs, count + 1); for (i = 0; i < count; i++) { /* Determine size for the current idal buffer */ ib_size = min(size, CCW_MAX_BYTE_COUNT); diff --git a/arch/s390/kernel/cert_store.c b/arch/s390/kernel/cert_store.c index 8e3964c33ebb..dc1992a675de 100644 --- a/arch/s390/kernel/cert_store.c +++ b/arch/s390/kernel/cert_store.c @@ -322,7 +322,7 @@ static int invalidate_keyring_keys(struct key *keyring) keyring_payload_len = key_type_keyring.read(keyring, NULL, 0); num_keys = keyring_payload_len / sizeof(key_serial_t); - key_array = kzalloc_objs(key_serial_t, num_keys, GFP_KERNEL); + key_array = kzalloc_objs(key_serial_t, num_keys); if (!key_array) return -ENOMEM; diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index a917b4c899ef..31430e9bcfdd 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -181,7 +181,7 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas) debug_entry_t ***areas; int i, j; - areas = kmalloc_objs(debug_entry_t **, nr_areas, GFP_KERNEL); + areas = kmalloc_objs(debug_entry_t **, nr_areas); if (!areas) goto fail_malloc_areas; for (i = 0; i < nr_areas; i++) { @@ -224,13 +224,13 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area, debug_info_t *rc; /* alloc everything */ - rc = kmalloc_obj(debug_info_t, GFP_KERNEL); + rc = kmalloc_obj(debug_info_t); if (!rc) goto fail_malloc_rc; - rc->active_entries = kzalloc_objs(int, nr_areas, GFP_KERNEL); + rc->active_entries = kzalloc_objs(int, nr_areas); if (!rc->active_entries) goto fail_malloc_active_entries; - rc->active_pages = kzalloc_objs(int, nr_areas, GFP_KERNEL); + rc->active_pages = kzalloc_objs(int, nr_areas); if (!rc->active_pages) goto fail_malloc_active_pages; if ((mode == ALL_AREAS) && (pages_per_area != 0)) { @@ -630,7 +630,7 @@ static file_private_info_t *debug_file_private_alloc(debug_info_t *debug_info, if (!debug_info_snapshot) return NULL; - p_info = kmalloc_obj(file_private_info_t, GFP_KERNEL); + p_info = kmalloc_obj(file_private_info_t); if (!p_info) { debug_info_free(debug_info_snapshot); return NULL; diff --git a/arch/s390/kernel/guarded_storage.c b/arch/s390/kernel/guarded_storage.c index 4d4101f19e3c..cab8ac25a010 100644 --- a/arch/s390/kernel/guarded_storage.c +++ b/arch/s390/kernel/guarded_storage.c @@ -24,7 +24,7 @@ static int gs_enable(void) struct gs_cb *gs_cb; if (!current->thread.gs_cb) { - gs_cb = kzalloc_obj(*gs_cb, GFP_KERNEL); + gs_cb = kzalloc_obj(*gs_cb); if (!gs_cb) return -ENOMEM; gs_cb->gsd = 25; @@ -55,7 +55,7 @@ static int gs_set_bc_cb(struct gs_cb __user *u_gs_cb) gs_cb = current->thread.gs_bc_cb; if (!gs_cb) { - gs_cb = kzalloc_obj(*gs_cb, GFP_KERNEL); + gs_cb = kzalloc_obj(*gs_cb); if (!gs_cb) return -ENOMEM; current->thread.gs_bc_cb = gs_cb; diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c index 37ab1c671b4d..4a30c10ae63b 100644 --- a/arch/s390/kernel/os_info.c +++ b/arch/s390/kernel/os_info.c @@ -154,7 +154,7 @@ static void os_info_old_init(void) goto fail; if (addr == 0 || addr % PAGE_SIZE) goto fail; - os_info_old = kzalloc_obj(*os_info_old, GFP_KERNEL); + os_info_old = kzalloc_obj(*os_info_old); if (!os_info_old) goto fail; if (copy_oldmem_kernel(os_info_old, addr, sizeof(*os_info_old))) diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 0c4074e717d4..7aa655664ecc 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -252,7 +252,7 @@ static int cpum_cf_alloc_cpu(int cpu) cpuhw = p->cpucf; if (!cpuhw) { - cpuhw = kzalloc_obj(*cpuhw, GFP_KERNEL); + cpuhw = kzalloc_obj(*cpuhw); if (cpuhw) { p->cpucf = cpuhw; refcount_set(&cpuhw->refcnt, 1); @@ -1616,7 +1616,7 @@ static long cfset_ioctl_start(unsigned long arg, struct file *file) if (!start.counter_sets) return -EINVAL; /* No counter set at all? */ - preq = kzalloc_obj(*preq, GFP_KERNEL); + preq = kzalloc_obj(*preq); if (!preq) return -ENOMEM; cpumask_clear(&preq->mask); diff --git a/arch/s390/kernel/perf_cpum_cf_events.c b/arch/s390/kernel/perf_cpum_cf_events.c index eb067beb5c51..ad8c32f0aaed 100644 --- a/arch/s390/kernel/perf_cpum_cf_events.c +++ b/arch/s390/kernel/perf_cpum_cf_events.c @@ -976,7 +976,7 @@ static __init struct attribute **merge_attr(struct attribute **a, j++; j++; - new = kmalloc_objs(struct attribute *, j, GFP_KERNEL); + new = kmalloc_objs(struct attribute *, j); if (!new) return NULL; j = 0; diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index d0adeabfce0c..c92c29de725e 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -1609,7 +1609,7 @@ static void *aux_buffer_setup(struct perf_event *event, void **pages, } /* Allocate aux_buffer struct for the event */ - aux = kzalloc_obj(struct aux_buffer, GFP_KERNEL); + aux = kzalloc_obj(struct aux_buffer); if (!aux) goto no_aux; sfb = &aux->sfb; diff --git a/arch/s390/kernel/perf_pai.c b/arch/s390/kernel/perf_pai.c index 4c2ce0a2a8e4..8fd3e47307a3 100644 --- a/arch/s390/kernel/perf_pai.c +++ b/arch/s390/kernel/perf_pai.c @@ -252,7 +252,7 @@ static int pai_alloc_cpu(struct perf_event *event, int cpu) cpump = mp->mapptr; if (!cpump) { /* Paicrypt_map allocated? */ rc = -ENOMEM; - cpump = kzalloc_obj(*cpump, GFP_KERNEL); + cpump = kzalloc_obj(*cpump); if (!cpump) goto undo; /* Allocate memory for counter page and counter extraction. @@ -315,7 +315,7 @@ static int pai_alloc(struct perf_event *event) struct cpumask *maskptr; int cpu, rc = -ENOMEM; - maskptr = kzalloc_obj(*maskptr, GFP_KERNEL); + maskptr = kzalloc_obj(*maskptr); if (!maskptr) goto out; @@ -1070,7 +1070,7 @@ static struct attribute * __init attr_event_init_one(int num, { struct perf_pmu_events_attr *pa; - pa = kzalloc_obj(*pa, GFP_KERNEL); + pa = kzalloc_obj(*pa); if (!pa) return NULL; diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 3a08f8f6c865..125ca4c4e30c 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -749,7 +749,7 @@ static int s390_gs_cb_set(struct task_struct *target, if (!cpu_has_gs()) return -ENODEV; if (!target->thread.gs_cb) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; } @@ -800,7 +800,7 @@ static int s390_gs_bc_set(struct task_struct *target, if (!cpu_has_gs()) return -ENODEV; if (!data) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; target->thread.gs_bc_cb = data; @@ -861,7 +861,7 @@ static int s390_runtime_instr_set(struct task_struct *target, return -ENODEV; if (!target->thread.ri_cb) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; } diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c index 0331ee7af39d..928bff8fcd4a 100644 --- a/arch/s390/kernel/runtime_instr.c +++ b/arch/s390/kernel/runtime_instr.c @@ -83,7 +83,7 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum) return -EINVAL; if (!current->thread.ri_cb) { - cb = kzalloc_obj(*cb, GFP_KERNEL); + cb = kzalloc_obj(*cb); if (!cb) return -ENOMEM; } else { diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 615b76a7f2a0..50bb499cf3e5 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -1145,7 +1145,7 @@ int __ref smp_rescan_cpus(bool early) struct sclp_core_info *info; int nr; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; smp_get_core_info(info, 0); diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index 1838a4696747..0fe616c49fcc 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -132,7 +132,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++) diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c index 2ac911e388bd..fc80495027ba 100644 --- a/arch/s390/kvm/pci.c +++ b/arch/s390/kvm/pci.c @@ -54,7 +54,7 @@ static int zpci_setup_aipb(u8 nisc) struct page *page; int size, rc; - zpci_aipb = kzalloc_obj(union zpci_sic_iib, GFP_KERNEL); + zpci_aipb = kzalloc_obj(union zpci_sic_iib); if (!zpci_aipb) return -ENOMEM; @@ -404,7 +404,7 @@ static int kvm_s390_pci_dev_open(struct zpci_dev *zdev) { struct kvm_zdev *kzdev; - kzdev = kzalloc_obj(struct kvm_zdev, GFP_KERNEL); + kzdev = kzalloc_obj(struct kvm_zdev); if (!kzdev) return -ENOMEM; @@ -666,7 +666,7 @@ int __init kvm_s390_pci_init(void) if (!kvm_s390_pci_interp_allowed()) return 0; - aift = kzalloc_obj(struct zpci_aift, GFP_KERNEL); + aift = kzalloc_obj(struct zpci_aift); if (!aift) return -ENOMEM; diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c index fd34a2f46ce3..c2dafd812a3b 100644 --- a/arch/s390/kvm/pv.c +++ b/arch/s390/kvm/pv.c @@ -466,7 +466,7 @@ int kvm_s390_pv_set_aside(struct kvm *kvm, u16 *rc, u16 *rrc) if (kvm->arch.gmap->asce.dt == TABLE_TYPE_SEGMENT) return -EINVAL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c index db1ef34ad03e..1c3a1eed4381 100644 --- a/arch/s390/mm/extmem.c +++ b/arch/s390/mm/extmem.c @@ -317,7 +317,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long goto out_free; } - seg->res = kzalloc_obj(struct resource, GFP_KERNEL); + seg->res = kzalloc_obj(struct resource); if (seg->res == NULL) { rc = -ENOMEM; goto out_free; diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 582afb486093..bf92964246eb 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -2323,7 +2323,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit_data = fp->aux->jit_data; if (!jit_data) { - jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); + jit_data = kzalloc_obj(*jit_data); if (!jit_data) { fp = orig_fp; goto out; diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index b75065130639..0ae82e529c21 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -523,7 +523,7 @@ static struct resource *__alloc_res(struct zpci_dev *zdev, unsigned long start, { struct resource *r; - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) return NULL; @@ -824,7 +824,7 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state) struct zpci_dev *zdev; int rc; - zdev = kzalloc_obj(*zdev, GFP_KERNEL); + zdev = kzalloc_obj(*zdev); if (!zdev) return ERR_PTR(-ENOMEM); diff --git a/arch/s390/pci/pci_bus.c b/arch/s390/pci/pci_bus.c index 3eba87a036b1..36a4807285fa 100644 --- a/arch/s390/pci/pci_bus.c +++ b/arch/s390/pci/pci_bus.c @@ -315,7 +315,7 @@ static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid) { struct zpci_bus *zbus; - zbus = kzalloc_obj(*zbus, GFP_KERNEL); + zbus = kzalloc_obj(*zbus); if (!zbus) return NULL; diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c index 441356767437..9c9ed3d8d959 100644 --- a/arch/s390/pci/pci_irq.c +++ b/arch/s390/pci/pci_irq.c @@ -563,7 +563,7 @@ static int __init zpci_directed_irq_init(void) iib.diib.disb_addr = virt_to_phys(zpci_sbv->vector); zpci_set_irq_ctrl(SIC_IRQ_MODE_DIRECT, 0, &iib); - zpci_ibv = kzalloc_objs(*zpci_ibv, num_possible_cpus(), GFP_KERNEL); + zpci_ibv = kzalloc_objs(*zpci_ibv, num_possible_cpus()); if (!zpci_ibv) return -ENOMEM; @@ -589,7 +589,7 @@ static int __init zpci_directed_irq_init(void) static int __init zpci_floating_irq_init(void) { - zpci_ibv = kzalloc_objs(*zpci_ibv, ZPCI_NR_DEVICES, GFP_KERNEL); + zpci_ibv = kzalloc_objs(*zpci_ibv, ZPCI_NR_DEVICES); if (!zpci_ibv) return -ENOMEM; diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c index 72f90f0c799e..3778c6a363ec 100644 --- a/arch/sh/drivers/dma/dmabrg.c +++ b/arch/sh/drivers/dma/dmabrg.c @@ -153,7 +153,7 @@ static int __init dmabrg_init(void) unsigned long or; int ret; - dmabrg_handlers = kzalloc_objs(struct dmabrg_handler, 10, GFP_KERNEL); + dmabrg_handlers = kzalloc_objs(struct dmabrg_handler, 10); if (!dmabrg_handlers) return -ENOMEM; diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c index aae320cef692..e55ef3c16a0f 100644 --- a/arch/sh/drivers/heartbeat.c +++ b/arch/sh/drivers/heartbeat.c @@ -91,7 +91,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev) if (pdev->dev.platform_data) { hd = pdev->dev.platform_data; } else { - hd = kzalloc_obj(struct heartbeat_data, GFP_KERNEL); + hd = kzalloc_obj(struct heartbeat_data); if (unlikely(!hd)) return -ENOMEM; } diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c index 492315fc96fd..a39e2edd4dcb 100644 --- a/arch/sh/drivers/push-switch.c +++ b/arch/sh/drivers/push-switch.c @@ -46,7 +46,7 @@ static int switch_drv_probe(struct platform_device *pdev) struct push_switch *psw; int ret, irq; - psw = kzalloc_obj(struct push_switch, GFP_KERNEL); + psw = kzalloc_obj(struct push_switch); if (unlikely(!psw)) return -ENOMEM; diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index 2a465c440168..908a8e09113b 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -342,7 +342,7 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif) struct kobject *kobj; int error; - sq_kobject[cpu] = kzalloc_obj(struct kobject, GFP_KERNEL); + sq_kobject[cpu] = kzalloc_obj(struct kobject); if (unlikely(!sq_kobject[cpu])) return -ENOMEM; diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 46df80942418..edcf3b172284 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c @@ -741,7 +741,7 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len, unsigned long flags; int count; - cie = kzalloc_obj(*cie, GFP_KERNEL); + cie = kzalloc_obj(*cie); if (!cie) return -ENOMEM; @@ -874,7 +874,7 @@ static int dwarf_parse_fde(void *entry, u32 entry_type, int count; void *p = start; - fde = kzalloc_obj(*fde, GFP_KERNEL); + fde = kzalloc_obj(*fde); if (!fde) return -ENOMEM; diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 904c4223230f..16b45d172fb0 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c @@ -63,7 +63,7 @@ static int clock_board_calc_nslots(struct clock_board *p) static int clock_board_probe(struct platform_device *op) { - struct clock_board *p = kzalloc_obj(*p, GFP_KERNEL); + struct clock_board *p = kzalloc_obj(*p); int err = -ENOMEM; if (!p) { @@ -159,7 +159,7 @@ static struct platform_driver clock_board_driver = { static int fhc_probe(struct platform_device *op) { - struct fhc *p = kzalloc_obj(*p, GFP_KERNEL); + struct fhc *p = kzalloc_obj(*p); int err = -ENOMEM; u32 reg; diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index 663b2d7ff7bc..d935177b6953 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c @@ -417,7 +417,7 @@ static int jbusmc_probe(struct platform_device *op) num_mem_regs = len / sizeof(*mem_regs); err = -ENOMEM; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { printk(KERN_ERR PFX "Cannot allocate struct jbusmc.\n"); goto out; @@ -718,7 +718,7 @@ static int chmc_probe(struct platform_device *op) } err = -ENOMEM; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { printk(KERN_ERR PFX "Could not allocate struct chmc.\n"); goto out; diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index df3fa6d96074..b34db8125bba 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -1175,7 +1175,7 @@ static int ds_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (ds_version_printed++ == 0) printk(KERN_INFO "%s", version); - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); err = -ENOMEM; if (!dp) goto out_err; diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 82d248e6b822..cbc0680a4642 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -238,7 +238,7 @@ unsigned long sparc_dma_alloc_resource(struct device *dev, size_t len) { struct resource *res; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return 0; res->name = dev->of_node->full_name; diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index 4fd357d5fc29..826fe8ed0289 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -1171,7 +1171,7 @@ struct ldc_channel *ldc_alloc(unsigned long id, mssbuf = NULL; - lp = kzalloc_obj(*lp, GFP_KERNEL); + lp = kzalloc_obj(*lp); err = -ENOMEM; if (!lp) goto out_err; diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index c6d5cec12b67..c1cbdf88146c 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c @@ -721,7 +721,7 @@ static int grpci2_of_probe(struct platform_device *ofdev) goto err1; } - priv = grpci2priv = kzalloc_obj(struct grpci2_priv, GFP_KERNEL); + priv = grpci2priv = kzalloc_obj(struct grpci2_priv); if (grpci2priv == NULL) { err = -ENOMEM; goto err1; diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 51e90a093ee0..b62b1d0291a4 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c @@ -340,7 +340,7 @@ static void __init build_device_resources(struct platform_device *op, static struct platform_device * __init scan_one_device(struct device_node *dp, struct device *parent) { - struct platform_device *op = kzalloc_obj(*op, GFP_KERNEL); + struct platform_device *op = kzalloc_obj(*op); const struct linux_prom_irqs *intr; struct dev_archdata *sd; int len, i; diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index c30ad34525bd..0b87eb629a62 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c @@ -633,7 +633,7 @@ out: static struct platform_device * __init scan_one_device(struct device_node *dp, struct device *parent) { - struct platform_device *op = kzalloc_obj(*op, GFP_KERNEL); + struct platform_device *op = kzalloc_obj(*op); const unsigned int *irq; struct dev_archdata *sd; int len, i; diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 432f83cf61aa..7e41574634b3 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -650,7 +650,7 @@ static void pci_claim_legacy_resources(struct pci_dev *dev) if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) return; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return; diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 588cfc595b84..0eafcb2d88ce 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c @@ -336,7 +336,7 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) NULL); if (vdma) { - struct resource *rp = kzalloc_obj(*rp, GFP_KERNEL); + struct resource *rp = kzalloc_obj(*rp); if (!rp) { pr_info("%s: Cannot allocate IOMMU resource.\n", diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index b72cf5acbdba..c35a8e3c1eae 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c @@ -468,13 +468,13 @@ static int fire_probe(struct platform_device *op) portid = of_getintprop_default(dp, "portid", 0xff); err = -ENOMEM; - pbm = kzalloc_obj(*pbm, GFP_KERNEL); + pbm = kzalloc_obj(*pbm); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbminfo.\n"); goto out_err; } - iommu = kzalloc_obj(struct iommu, GFP_KERNEL); + iommu = kzalloc_obj(struct iommu); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index 9880b341a631..199ab73f84af 100644 --- a/arch/sparc/kernel/pci_psycho.c +++ b/arch/sparc/kernel/pci_psycho.c @@ -519,7 +519,7 @@ static int psycho_probe(struct platform_device *op) upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); err = -ENOMEM; - pbm = kzalloc_obj(*pbm, GFP_KERNEL); + pbm = kzalloc_obj(*pbm); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; @@ -529,7 +529,7 @@ static int psycho_probe(struct platform_device *op) if (pbm->sibling) { iommu = pbm->sibling->iommu; } else { - iommu = kzalloc_obj(struct iommu, GFP_KERNEL); + iommu = kzalloc_obj(struct iommu); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index 3b4116f23862..1109d5b344eb 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c @@ -482,13 +482,13 @@ static int sabre_probe(struct platform_device *op) } err = -ENOMEM; - pbm = kzalloc_obj(*pbm, GFP_KERNEL); + pbm = kzalloc_obj(*pbm); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; } - iommu = kzalloc_obj(*iommu, GFP_KERNEL); + iommu = kzalloc_obj(*iommu); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); goto out_free_controller; diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 519a80a639d6..4348ca2c4a3f 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c @@ -1426,7 +1426,7 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type) portid = of_getintprop_default(dp, "portid", 0xff); err = -ENOMEM; - pbm = kzalloc_obj(*pbm, GFP_KERNEL); + pbm = kzalloc_obj(*pbm); if (!pbm) { printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); goto out_err; @@ -1434,7 +1434,7 @@ static int __schizo_init(struct platform_device *op, unsigned long chip_type) pbm->sibling = schizo_find_sibling(portid, chip_type); - iommu = kzalloc_obj(struct iommu, GFP_KERNEL); + iommu = kzalloc_obj(struct iommu); if (!iommu) { printk(KERN_ERR PFX "Cannot allocate PBM A iommu.\n"); goto out_free_pbm; diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 4e842fb48602..440284cc804e 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c @@ -754,7 +754,7 @@ static int pci_sun4v_atu_alloc_iotsb(struct pci_pbm_info *pbm) unsigned long order; unsigned long err; - iotsb = kzalloc_obj(*iotsb, GFP_KERNEL); + iotsb = kzalloc_obj(*iotsb); if (!iotsb) { err = -ENOMEM; goto out_err; @@ -1292,13 +1292,13 @@ static int pci_sun4v_probe(struct platform_device *op) iommu_batch_initialized = 1; } - pbm = kzalloc_obj(*pbm, GFP_KERNEL); + pbm = kzalloc_obj(*pbm); if (!pbm) { printk(KERN_ERR PFX "Could not allocate pci_pbm_info\n"); goto out_err; } - iommu = kzalloc_obj(struct iommu, GFP_KERNEL); + iommu = kzalloc_obj(struct iommu); if (!iommu) { printk(KERN_ERR PFX "Could not allocate pbm iommu\n"); goto out_free_controller; @@ -1307,7 +1307,7 @@ static int pci_sun4v_probe(struct platform_device *op) pbm->iommu = iommu; iommu->atu = NULL; if (hv_atu) { - atu = kzalloc_obj(*atu, GFP_KERNEL); + atu = kzalloc_obj(*atu); if (!atu) pr_err(PFX "Could not allocate atu\n"); else diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 46a7b53737d4..1b0db16cd37b 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -388,7 +388,7 @@ static int __init topology_init(void) err = 0; for_each_online_cpu(i) { - struct cpu *p = kzalloc_obj(*p, GFP_KERNEL); + struct cpu *p = kzalloc_obj(*p); if (!p) err = -ENOMEM; else diff --git a/arch/sparc/kernel/starfire.c b/arch/sparc/kernel/starfire.c index 7736dc34f6ad..d8ee9a69ae31 100644 --- a/arch/sparc/kernel/starfire.c +++ b/arch/sparc/kernel/starfire.c @@ -50,7 +50,7 @@ void starfire_hookup(int upaid) struct starfire_irqinfo *p; unsigned long treg_base, hwmid, i; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) { prom_printf("starfire_hookup: No memory, this is insane.\n"); prom_halt(); diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index 0d21a8e567da..8b4f55047716 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -325,7 +325,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, return NULL; } - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) { printk(KERN_ERR "VIO: Could not allocate vio_dev\n"); return NULL; diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 2c4986e95713..f46394c46a76 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -3070,7 +3070,7 @@ static int __init report_memory(void) kernel_lds_init(); for (i = 0; i < pavail_ents; i++) { - res = kzalloc_obj(struct resource, GFP_KERNEL); + res = kzalloc_obj(struct resource); if (!res) { pr_warn("Failed to allocate source.\n"); diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index 3ca7cc2b9bfb..df0eb99a4175 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -64,7 +64,7 @@ static void __init sbus_iommu_init(struct platform_device *op) unsigned long base; unsigned long tmp; - iommu = kmalloc_obj(struct iommu_struct, GFP_KERNEL); + iommu = kmalloc_obj(struct iommu_struct); if (!iommu) { prom_printf("Unable to allocate iommu structure\n"); prom_halt(); diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 884b201259d6..b23d1c645ae5 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +++ b/arch/sparc/net/bpf_jit_comp_64.c @@ -1505,7 +1505,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; diff --git a/arch/sparc/vdso/vma.c b/arch/sparc/vdso/vma.c index bba84959c69d..c454689ce5fa 100644 --- a/arch/sparc/vdso/vma.c +++ b/arch/sparc/vdso/vma.c @@ -266,7 +266,7 @@ static int __init init_vdso_image(const struct vdso_image *image, if (WARN_ON(image->size % PAGE_SIZE != 0)) goto oom; - cpp = kzalloc_objs(struct page *, cnpages, GFP_KERNEL); + cpp = kzalloc_objs(struct page *, cnpages); vdso_mapping->pages = cpp; if (!cpp) @@ -288,7 +288,7 @@ static int __init init_vdso_image(const struct vdso_image *image, dnpages = (sizeof(struct vvar_data) / PAGE_SIZE) + 1; if (WARN_ON(dnpages != 1)) goto oom; - dpp = kzalloc_objs(struct page *, dnpages, GFP_KERNEL); + dpp = kzalloc_objs(struct page *, dnpages); vvar_mapping.pages = dpp; if (!dpp) diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 6983a35a9ead..7ce98f148eb3 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c @@ -186,7 +186,7 @@ static int hostaudio_open(struct inode *inode, struct file *file) kernel_param_unlock(THIS_MODULE); #endif - state = kmalloc_obj(struct hostaudio_state, GFP_KERNEL); + state = kmalloc_obj(struct hostaudio_state); if (state == NULL) return -ENOMEM; @@ -247,7 +247,7 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file) printk(KERN_DEBUG "hostmixer: open called (host: %s)\n", mixer); #endif - state = kmalloc_obj(struct hostmixer_state, GFP_KERNEL); + state = kmalloc_obj(struct hostmixer_state); if (state == NULL) return -ENOMEM; diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 62545319d0eb..c851a592809c 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -672,7 +672,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port, { struct winch *winch; - winch = kmalloc_obj(*winch, GFP_KERNEL); + winch = kmalloc_obj(*winch); if (winch == NULL) { printk(KERN_ERR "register_winch_irq - kmalloc failed\n"); goto cleanup; diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index c51d6ca4de70..7b3ff4af1db6 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -170,7 +170,7 @@ void *port_data(int port_num) if (port->port == port_num) goto found; } - port = kmalloc_obj(struct port_list, GFP_KERNEL); + port = kmalloc_obj(struct port_list); if (port == NULL) { printk(KERN_ERR "Allocation of port list failed\n"); goto out; @@ -202,7 +202,7 @@ void *port_data(int port_num) list_add(&port->list, &ports); found: - dev = kmalloc_obj(struct port_dev, GFP_KERNEL); + dev = kmalloc_obj(struct port_dev); if (dev == NULL) { printk(KERN_ERR "Allocation of port device entry failed\n"); goto out; diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 8882ad7c983a..5434c87542e5 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -515,7 +515,7 @@ static struct vector_queue *create_queue( struct iovec *iov; struct mmsghdr *mmsg_vector; - result = kmalloc_obj(struct vector_queue, GFP_KERNEL); + result = kmalloc_obj(struct vector_queue); if (result == NULL) return NULL; result->max_depth = max_size; @@ -1583,7 +1583,7 @@ static void vector_eth_configure( struct vector_private *vp; int err; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (device == NULL) { pr_err("Failed to allocate struct vector_device for vec%d\n", n); return; diff --git a/arch/um/drivers/vector_transports.c b/arch/um/drivers/vector_transports.c index da5d2083ed49..ddd127ee9678 100644 --- a/arch/um/drivers/vector_transports.c +++ b/arch/um/drivers/vector_transports.c @@ -245,7 +245,7 @@ static int build_gre_transport_data(struct vector_private *vp) int temp_rx; int temp_tx; - vp->transport_data = kmalloc_obj(struct uml_gre_data, GFP_KERNEL); + vp->transport_data = kmalloc_obj(struct uml_gre_data); if (vp->transport_data == NULL) return -ENOMEM; td = vp->transport_data; @@ -307,7 +307,7 @@ static int build_l2tpv3_transport_data(struct vector_private *vp) unsigned long temp_rx; unsigned long temp_tx; - vp->transport_data = kmalloc_obj(struct uml_l2tpv3_data, GFP_KERNEL); + vp->transport_data = kmalloc_obj(struct uml_l2tpv3_data); if (vp->transport_data == NULL) return -ENOMEM; diff --git a/arch/um/drivers/vfio_kern.c b/arch/um/drivers/vfio_kern.c index 5f349be2fce7..7b6492174da0 100644 --- a/arch/um/drivers/vfio_kern.c +++ b/arch/um/drivers/vfio_kern.c @@ -107,7 +107,7 @@ static int uml_vfio_open_group(int group_id) } } - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; @@ -599,7 +599,7 @@ static struct uml_vfio_device *uml_vfio_add_device(const char *device) if (uml_vfio_find_device(device)) return ERR_PTR(-EEXIST); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/arch/um/drivers/virtio_pcidev.c b/arch/um/drivers/virtio_pcidev.c index 5db9a4461766..2bf5a645db45 100644 --- a/arch/um/drivers/virtio_pcidev.c +++ b/arch/um/drivers/virtio_pcidev.c @@ -537,7 +537,7 @@ static int virtio_pcidev_virtio_probe(struct virtio_device *vdev) struct virtio_pcidev_device *dev; int err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index ac269e6148fc..7425a8548141 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -965,7 +965,7 @@ static struct virtqueue *vu_setup_vq(struct virtio_device *vdev, int num = MAX_SUPPORTED_QUEUE_SIZE; int rc; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { rc = -ENOMEM; goto error_kzalloc; @@ -1217,7 +1217,7 @@ static int virtio_uml_probe(struct platform_device *pdev) return PTR_ERR(pdata); } - vu_dev = kzalloc_obj(*vu_dev, GFP_KERNEL); + vu_dev = kzalloc_obj(*vu_dev); if (!vu_dev) return -ENOMEM; diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c index 7740d9a3b090..d630cb19e14a 100644 --- a/arch/um/drivers/xterm_kern.c +++ b/arch/um/drivers/xterm_kern.c @@ -45,7 +45,7 @@ int xterm_fd(int socket, int *pid_out) struct xterm_wait *data; int err, ret; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (data == NULL) { printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n"); return -ENOMEM; diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index 7bf44927519d..907981b94c40 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -1542,7 +1542,7 @@ static struct aesgcm_ctx *snp_init_crypto(u8 *key, size_t keylen) { struct aesgcm_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -1590,7 +1590,7 @@ struct snp_msg_desc *snp_msg_alloc(void) BUILD_BUG_ON(sizeof(struct snp_guest_msg) > PAGE_SIZE); - mdesc = kzalloc_obj(struct snp_msg_desc, GFP_KERNEL); + mdesc = kzalloc_obj(struct snp_msg_desc); if (!mdesc) return ERR_PTR(-ENOMEM); @@ -1945,7 +1945,7 @@ static int __init snp_get_tsc_info(void) struct snp_guest_req req = {}; int rc = -ENOMEM; - tsc_req = kzalloc_obj(*tsc_req, GFP_KERNEL); + tsc_req = kzalloc_obj(*tsc_req); if (!tsc_req) return rc; diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index 17e383c20271..07b110e8418a 100644 --- a/arch/x86/events/amd/iommu.c +++ b/arch/x86/events/amd/iommu.c @@ -387,7 +387,7 @@ static __init int _init_events_attrs(void) while (amd_iommu_v2_event_descs[i].attr.attr.name) i++; - attrs = kzalloc_objs(*attrs, i + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, i + 1); if (!attrs) return -ENOMEM; @@ -422,7 +422,7 @@ static __init int init_one_iommu(unsigned int idx) struct perf_amd_iommu *perf_iommu; int ret; - perf_iommu = kzalloc_obj(struct perf_amd_iommu, GFP_KERNEL); + perf_iommu = kzalloc_obj(struct perf_amd_iommu); if (!perf_iommu) return -ENOMEM; diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index c0ed0dfbaeaa..dd956cfcadef 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -726,7 +726,7 @@ int amd_uncore_df_ctx_init(struct amd_uncore *uncore, unsigned int cpu) goto done; /* No grouping, single instance for a system */ - uncore->pmus = kzalloc_obj(*uncore->pmus, GFP_KERNEL); + uncore->pmus = kzalloc_obj(*uncore->pmus); if (!uncore->pmus) goto done; @@ -860,7 +860,7 @@ int amd_uncore_l3_ctx_init(struct amd_uncore *uncore, unsigned int cpu) goto done; /* No grouping, single instance for a system */ - uncore->pmus = kzalloc_obj(*uncore->pmus, GFP_KERNEL); + uncore->pmus = kzalloc_obj(*uncore->pmus); if (!uncore->pmus) goto done; diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 52f7ad5adeb1..03ce1bc7ef2e 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2389,7 +2389,7 @@ static struct cpu_hw_events *allocate_fake_cpuc(struct pmu *event_pmu) struct cpu_hw_events *cpuc; int cpu; - cpuc = kzalloc_obj(*cpuc, GFP_KERNEL); + cpuc = kzalloc_obj(*cpuc); if (!cpuc) return ERR_PTR(-ENOMEM); cpuc->is_fake = 1; diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index 9095f1eeff6e..3e68d60f8c14 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -107,7 +107,7 @@ lookup: if (!alloc) { raw_spin_unlock(&pci2phy_map_lock); - alloc = kmalloc_obj(struct pci2phy_map, GFP_KERNEL); + alloc = kmalloc_obj(struct pci2phy_map); raw_spin_lock(&pci2phy_map_lock); if (!alloc) @@ -990,7 +990,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type) size_t size; int i, j; - pmus = kzalloc_objs(*pmus, type->num_boxes, GFP_KERNEL); + pmus = kzalloc_objs(*pmus, type->num_boxes); if (!pmus) return -ENOMEM; diff --git a/arch/x86/events/intel/uncore_discovery.c b/arch/x86/events/intel/uncore_discovery.c index f8d1328d8346..c8bf3983accf 100644 --- a/arch/x86/events/intel/uncore_discovery.c +++ b/arch/x86/events/intel/uncore_discovery.c @@ -68,7 +68,7 @@ add_uncore_discovery_type(struct uncore_unit_discovery *unit) return NULL; } - type = kzalloc_obj(struct intel_uncore_discovery_type, GFP_KERNEL); + type = kzalloc_obj(struct intel_uncore_discovery_type); if (!type) return NULL; @@ -215,7 +215,7 @@ uncore_insert_box_info(struct uncore_unit_discovery *unit, return; } - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return; @@ -755,7 +755,7 @@ intel_uncore_generic_init_uncores(enum uncore_access_type type_id, int num_extra if (type->access_type != type_id) continue; - uncore = kzalloc_obj(struct intel_uncore_type, GFP_KERNEL); + uncore = kzalloc_obj(struct intel_uncore_type); if (!uncore) break; diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 94682b067e35..069e6b788280 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3748,7 +3748,7 @@ static int pmu_alloc_topology(struct intel_uncore_type *type, int topology_type) if (!type->num_boxes) return -EPERM; - topology = kzalloc_objs(*topology, uncore_max_dies(), GFP_KERNEL); + topology = kzalloc_objs(*topology, uncore_max_dies()); if (!topology) goto err; @@ -3883,11 +3883,11 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag, goto clear_topology; /* One more for NULL. */ - attrs = kzalloc_objs(*attrs, (uncore_max_dies() + 1), GFP_KERNEL); + attrs = kzalloc_objs(*attrs, (uncore_max_dies() + 1)); if (!attrs) goto clear_topology; - eas = kzalloc_objs(*eas, uncore_max_dies(), GFP_KERNEL); + eas = kzalloc_objs(*eas, uncore_max_dies()); if (!eas) goto clear_attrs; @@ -6412,7 +6412,7 @@ static void spr_update_device_location(int type_id) } else return; - root = kzalloc_obj(struct rb_root, GFP_KERNEL); + root = kzalloc_obj(struct rb_root); if (!root) { type->num_boxes = 0; return; @@ -6425,7 +6425,7 @@ static void spr_update_device_location(int type_id) if (die < 0) continue; - unit = kzalloc_obj(*unit, GFP_KERNEL); + unit = kzalloc_obj(*unit); if (!unit) continue; unit->die = die; diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index 27b3fd6e663c..efee5ce03e54 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -704,7 +704,7 @@ static int __init init_rapl_pmu(struct rapl_pmus *rapl_pmus) int idx; for (idx = 0; idx < rapl_pmus->nr_rapl_pmu; idx++) { - rapl_pmu = kzalloc_obj(*rapl_pmu, GFP_KERNEL); + rapl_pmu = kzalloc_obj(*rapl_pmu); if (!rapl_pmu) goto free; diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index 07f125668852..2ce4dfe53472 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c @@ -531,7 +531,7 @@ static int hv_list_enc_add(const u64 *pfn_list, int count) raw_spin_unlock_irqrestore(&hv_list_enc_lock, flags); /* No adjacent region found -- create a new one */ - ent = kzalloc_obj(struct hv_enc_pfn_region, GFP_KERNEL); + ent = kzalloc_obj(struct hv_enc_pfn_region); if (!ent) return -ENOMEM; @@ -598,7 +598,7 @@ unlock_done: unlock_split: raw_spin_unlock_irqrestore(&hv_list_enc_lock, flags); - ent = kzalloc_obj(struct hv_enc_pfn_region, GFP_KERNEL); + ent = kzalloc_obj(struct hv_enc_pfn_region); if (!ent) return -ENOMEM; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 0ffc7de200b1..a888ae0f01fb 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -2160,7 +2160,7 @@ void __init_or_module alternatives_smp_module_add(struct module *mod, /* Don't bother remembering, we'll never have to undo it. */ goto smp_unlock; - smp = kzalloc_obj(*smp, GFP_KERNEL); + smp = kzalloc_obj(*smp); if (NULL == smp) /* we'll run the (safe but slow) SMP code then ... */ goto unlock; diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c index 2091cb1089a2..0be01725a2a4 100644 --- a/arch/x86/kernel/amd_node.c +++ b/arch/x86/kernel/amd_node.c @@ -282,7 +282,7 @@ static int __init amd_smn_init(void) return -ENODEV; num_nodes = amd_num_nodes(); - amd_roots = kzalloc_objs(*amd_roots, num_nodes, GFP_KERNEL); + amd_roots = kzalloc_objs(*amd_roots, num_nodes); if (!amd_roots) return -ENOMEM; diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index aa3675ba08bb..352ed5558cbc 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2876,7 +2876,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, if (irq_resolve_mapping(domain, (irq_hw_number_t)pin)) return -EEXIST; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 13efc166bd3f..a57c026fb58a 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -1576,7 +1576,7 @@ static int do_open(struct inode *inode, struct file *filp) { struct apm_user *as; - as = kmalloc_obj(*as, GFP_KERNEL); + as = kmalloc_obj(*as); if (as == NULL) return -ENOMEM; diff --git a/arch/x86/kernel/cpu/amd_cache_disable.c b/arch/x86/kernel/cpu/amd_cache_disable.c index 13985d2f8b1d..9ab460bc11a2 100644 --- a/arch/x86/kernel/cpu/amd_cache_disable.c +++ b/arch/x86/kernel/cpu/amd_cache_disable.c @@ -255,7 +255,7 @@ static void init_amd_l3_attrs(void) if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) n += 1; - amd_l3_attrs = kzalloc_objs(*amd_l3_attrs, n, GFP_KERNEL); + amd_l3_attrs = kzalloc_objs(*amd_l3_attrs, n); if (!amd_l3_attrs) return; diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index 4e7a6101e7ed..da13c1e37f87 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -1088,7 +1088,7 @@ static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb (high & MASK_LOCKED_HI)) goto recurse; - b = kzalloc_obj(struct threshold_block, GFP_KERNEL); + b = kzalloc_obj(struct threshold_block); if (!b) return -ENOMEM; @@ -1147,7 +1147,7 @@ static int threshold_create_bank(struct threshold_bank **bp, unsigned int cpu, if (!dev) return -ENODEV; - b = kzalloc_obj(struct threshold_bank, GFP_KERNEL); + b = kzalloc_obj(struct threshold_bank); if (!b) { err = -ENOMEM; goto out; @@ -1250,7 +1250,7 @@ void mce_threshold_create_device(unsigned int cpu) return; numbanks = this_cpu_read(mce_num_banks); - bp = kzalloc_objs(*bp, numbanks, GFP_KERNEL); + bp = kzalloc_objs(*bp, numbanks); if (!bp) return; diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index dd6a06ab5270..8dd424ac5de8 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2692,7 +2692,7 @@ static int mce_device_create(unsigned int cpu) if (dev) return 0; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; dev->id = cpu; diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index e58a73ae431b..e533881284a1 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -1086,7 +1086,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover, if (ret) return ret; - patch = kzalloc_obj(*patch, GFP_KERNEL); + patch = kzalloc_obj(*patch); if (!patch) { pr_err("Patch allocation failure.\n"); return -EINVAL; diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index d7db12c06950..3a8317060732 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -410,7 +410,7 @@ void __init mtrr_copy_map(void) mutex_lock(&mtrr_mutex); - cache_map = kzalloc_objs(*cache_map, new_size, GFP_KERNEL); + cache_map = kzalloc_objs(*cache_map, new_size); if (cache_map) { memmove(cache_map, init_cache_map, cache_map_n * sizeof(*cache_map)); diff --git a/arch/x86/kernel/cpu/mtrr/legacy.c b/arch/x86/kernel/cpu/mtrr/legacy.c index ee7bc7b5ce96..ca1209cdea5f 100644 --- a/arch/x86/kernel/cpu/mtrr/legacy.c +++ b/arch/x86/kernel/cpu/mtrr/legacy.c @@ -80,7 +80,7 @@ static struct syscore mtrr_syscore = { void mtrr_register_syscore(void) { - mtrr_value = kzalloc_objs(*mtrr_value, num_var_ranges, GFP_KERNEL); + mtrr_value = kzalloc_objs(*mtrr_value, num_var_ranges); /* * The CPU has no MTRR and seems to not support SMP. They have diff --git a/arch/x86/kernel/cpu/sgx/driver.c b/arch/x86/kernel/cpu/sgx/driver.c index 74fb59d96730..473619741bc4 100644 --- a/arch/x86/kernel/cpu/sgx/driver.c +++ b/arch/x86/kernel/cpu/sgx/driver.c @@ -19,7 +19,7 @@ static int __sgx_open(struct inode *inode, struct file *file) struct sgx_encl *encl; int ret; - encl = kzalloc_obj(*encl, GFP_KERNEL); + encl = kzalloc_obj(*encl); if (!encl) return -ENOMEM; diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index 8b6c400c4008..ac60ebde5d9b 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -854,7 +854,7 @@ int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm) if (sgx_encl_find_mm(encl, mm)) return 0; - encl_mm = kzalloc_obj(*encl_mm, GFP_KERNEL); + encl_mm = kzalloc_obj(*encl_mm); if (!encl_mm) return -ENOMEM; @@ -1163,7 +1163,7 @@ struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl, struct sgx_encl_page *encl_page; unsigned long prot; - encl_page = kzalloc_obj(*encl_page, GFP_KERNEL); + encl_page = kzalloc_obj(*encl_page); if (!encl_page) return ERR_PTR(-ENOMEM); diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index ef6674067d80..c236a8ac78a8 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -27,7 +27,7 @@ struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl, bool reclaim) (SGX_ENCL_PAGE_VA_OFFSET_MASK >> 3) + 1); if (!(encl->page_cnt % SGX_VA_SLOT_COUNT)) { - va_page = kzalloc_obj(*va_page, GFP_KERNEL); + va_page = kzalloc_obj(*va_page); if (!va_page) return ERR_PTR(-ENOMEM); diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c index c7be8d0ea869..db6806c40483 100644 --- a/arch/x86/kernel/cpu/sgx/virt.c +++ b/arch/x86/kernel/cpu/sgx/virt.c @@ -264,7 +264,7 @@ static int __sgx_vepc_open(struct inode *inode, struct file *file) { struct sgx_vepc *vepc; - vepc = kzalloc_obj(struct sgx_vepc, GFP_KERNEL); + vepc = kzalloc_obj(struct sgx_vepc); if (!vepc) return -ENOMEM; mutex_init(&vepc->lock); diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 43884229c421..610590e83445 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -544,7 +544,7 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id) if (x86_vector_domain == NULL) return NULL; - domain_info = kzalloc_obj(*domain_info, GFP_KERNEL); + domain_info = kzalloc_obj(*domain_info); if (!domain_info) return NULL; @@ -1038,7 +1038,7 @@ int __init hpet_enable(void) if (IS_ENABLED(CONFIG_HPET_EMULATE_RTC) && channels < 2) goto out_nohpet; - hc = kzalloc_objs(*hc, channels, GFP_KERNEL); + hc = kzalloc_objs(*hc, channels); if (!hc) { pr_warn("Disabling HPET.\n"); goto out_nohpet; diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 30ab130329dc..2b9de8e1a090 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -90,7 +90,7 @@ long ksys_ioperm(unsigned long from, unsigned long num, int turn_on) /* No point to allocate a bitmap just to clear permissions */ if (!turn_on) return 0; - iobm = kmalloc_obj(*iobm, GFP_KERNEL); + iobm = kmalloc_obj(*iobm); if (!iobm) return -ENOMEM; diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index 4d7bf56524d8..e14ace32009f 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c @@ -102,7 +102,7 @@ static int __init create_setup_data_nodes(struct dentry *parent) pa_data = boot_params.hdr.setup_data; while (pa_data) { - node = kmalloc_obj(*node, GFP_KERNEL); + node = kmalloc_obj(*node); if (!node) { error = -ENOMEM; goto err_dir; diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index b7ba1ec486f9..5630c7dca1f3 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -682,7 +682,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, goto out_free_params; /* Allocate loader specific data */ - ldata = kzalloc_obj(struct bzimage64_data, GFP_KERNEL); + ldata = kzalloc_obj(struct bzimage64_data); if (!ldata) { ret = -ENOMEM; goto out_free_params; diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c index c5614b59be4a..1a6e1f89f294 100644 --- a/arch/x86/kernel/ksysfs.c +++ b/arch/x86/kernel/ksysfs.c @@ -344,7 +344,7 @@ static int __init create_setup_data_nodes(struct kobject *parent) if (ret) goto out_setup_data_kobj; - kobjp = kmalloc_objs(*kobjp, nr, GFP_KERNEL); + kobjp = kmalloc_objs(*kobjp, nr); if (!kobjp) { ret = -ENOMEM; goto out_setup_data_kobj; diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 61d37f5a5ff9..ebb1baf1eb1d 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c @@ -696,7 +696,7 @@ static struct uprobe_trampoline *create_uprobe_trampoline(unsigned long vaddr) if (IS_ERR_VALUE(vaddr)) return NULL; - tramp = kzalloc_obj(*tramp, GFP_KERNEL); + tramp = kzalloc_obj(*tramp); if (unlikely(!tramp)) return NULL; diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index 3bb70763af9c..b4c1cabc7a4b 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -232,7 +232,7 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus) } if (!vm86) { - if (!(vm86 = kzalloc_obj(*vm86, GFP_KERNEL))) + if (!(vm86 = kzalloc_obj(*vm86))) return -ENOMEM; tsk->thread.vm86 = vm86; } diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 999fd3373dba..53ab6ce3cc26 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1781,7 +1781,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu, if (clear_user(user_vmcb, KVM_STATE_NESTED_SVM_VMCB_SIZE)) return -EFAULT; - ctl = kzalloc_obj(*ctl, GFP_KERNEL); + ctl = kzalloc_obj(*ctl); if (!ctl) return -ENOMEM; diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c index adbb3060ae2f..8517d5fbf79c 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -2743,7 +2743,7 @@ static int tdx_td_init(struct kvm *kvm, struct kvm_tdx_cmd *cmd) goto out; } - td_params = kzalloc_obj(struct td_params, GFP_KERNEL); + td_params = kzalloc_obj(struct td_params); if (!td_params) { ret = -ENOMEM; goto out; diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4344847f7119..3fb64905d190 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6208,7 +6208,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, r = -EINVAL; if (!lapic_in_kernel(vcpu)) goto out; - u.lapic = kzalloc_obj(struct kvm_lapic_state, GFP_KERNEL); + u.lapic = kzalloc_obj(struct kvm_lapic_state); r = -ENOMEM; if (!u.lapic) @@ -6410,7 +6410,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, if (vcpu->arch.guest_fpu.uabi_size > sizeof(struct kvm_xsave)) break; - u.xsave = kzalloc_obj(struct kvm_xsave, GFP_KERNEL); + u.xsave = kzalloc_obj(struct kvm_xsave); r = -ENOMEM; if (!u.xsave) break; @@ -6459,7 +6459,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, } case KVM_GET_XCRS: { - u.xcrs = kzalloc_obj(struct kvm_xcrs, GFP_KERNEL); + u.xcrs = kzalloc_obj(struct kvm_xcrs); r = -ENOMEM; if (!u.xcrs) break; @@ -6619,7 +6619,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, vcpu->arch.guest_state_protected) goto out; - u.sregs2 = kzalloc_obj(struct kvm_sregs2, GFP_KERNEL); + u.sregs2 = kzalloc_obj(struct kvm_sregs2); r = -ENOMEM; if (!u.sregs2) goto out; diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 1838a49eee76..91fd3673c09a 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -1514,7 +1514,7 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode, return true; } - ports = kmalloc_objs(*ports, sched_poll.nr_ports, GFP_KERNEL); + ports = kmalloc_objs(*ports, sched_poll.nr_ports); if (!ports) { *r = -ENOMEM; return true; @@ -2115,7 +2115,7 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm, struct evtchnfd *evtchnfd; int ret = -EINVAL; - evtchnfd = kzalloc_obj(struct evtchnfd, GFP_KERNEL); + evtchnfd = kzalloc_obj(struct evtchnfd); if (!evtchnfd) return -ENOMEM; @@ -2213,7 +2213,7 @@ static int kvm_xen_eventfd_reset(struct kvm *kvm) idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) n++; - all_evtchnfds = kmalloc_objs(struct evtchnfd *, n, GFP_KERNEL); + all_evtchnfds = kmalloc_objs(struct evtchnfd *, n); if (!all_evtchnfds) { mutex_unlock(&kvm->arch.xen.xen_lock); return -ENOMEM; diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 63294d590346..265ad1a0ae0a 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -220,7 +220,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size, void __iomem *addr) { static atomic_t next_id; - struct remap_trace *trace = kmalloc_obj(*trace, GFP_KERNEL); + struct remap_trace *trace = kmalloc_obj(*trace); /* These are page-unaligned. */ struct mmiotrace_map map = { .phys = offset, diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index fdf6ed96cbd0..cf94fb561310 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -574,7 +574,7 @@ int memtype_reserve(u64 start, u64 end, enum page_cache_mode req_type, return -EINVAL; } - entry_new = kzalloc_obj(struct memtype, GFP_KERNEL); + entry_new = kzalloc_obj(struct memtype); if (!entry_new) return -ENOMEM; @@ -966,7 +966,7 @@ static struct memtype *memtype_get_idx(loff_t pos) struct memtype *entry_print; int ret; - entry_print = kzalloc_obj(struct memtype, GFP_KERNEL); + entry_print = kzalloc_obj(struct memtype); if (!entry_print) return NULL; diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 0a0127c9e2e2..8f10080e6fe3 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -3758,7 +3758,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; @@ -3794,7 +3794,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) padding = true; goto skip_init_addrs; } - addrs = kvmalloc_objs(*addrs, prog->len + 1, GFP_KERNEL); + addrs = kvmalloc_objs(*addrs, prog->len + 1); if (!addrs) { prog = orig_prog; goto out_addrs; diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index e6f3475bb773..dda423025c3d 100644 --- a/arch/x86/net/bpf_jit_comp32.c +++ b/arch/x86/net/bpf_jit_comp32.c @@ -2545,7 +2545,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) prog = tmp; } - addrs = kmalloc_objs(*addrs, prog->len, GFP_KERNEL); + addrs = kmalloc_objs(*addrs, prog->len); if (!addrs) { prog = orig_prog; goto out; diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index d0e1cd677eba..7cd5388edc75 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -562,7 +562,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) } else { struct pci_root_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) dev_err(&root->device->dev, "pci_bus %04x:%02x: ignored (out of memory)\n", diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index 53037dba4c97..0e165149d0e9 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c @@ -72,7 +72,7 @@ struct pci_root_info __init *alloc_pci_root_info(int bus_min, int bus_max, { struct pci_root_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return info; @@ -132,7 +132,7 @@ void update_res(struct pci_root_info *info, resource_size_t start, addit: /* need to add that */ - root_res = kzalloc_obj(*root_res, GFP_KERNEL); + root_res = kzalloc_obj(*root_res); if (!root_res) return; diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 12d4e522d863..63105b29fbf5 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -461,7 +461,7 @@ void pcibios_scan_root(int busnum) struct pci_sysdata *sd; LIST_HEAD(resources); - sd = kzalloc_obj(*sd, GFP_KERNEL); + sd = kzalloc_obj(*sd); if (!sd) { printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum); return; diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 3c92893ba725..b301c6c8df75 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -771,7 +771,7 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) if (i == 8) return; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return; diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 5e99b12300c9..c4ec39ad276b 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -81,7 +81,7 @@ pcibios_save_fw_addr(struct pci_dev *dev, int idx, resource_size_t fw_addr) map = pcibios_fwaddrmap_lookup(dev); if (!map) { spin_unlock_irqrestore(&pcibios_fwaddrmap_lock, flags); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return; diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 14098363b841..acdb8dcaeb52 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -77,7 +77,7 @@ static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, if (addr == 0) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 4f356d67cc31..6818515a501b 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -173,7 +173,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) if (type == PCI_CAP_ID_MSI && nvec > 1) return 1; - v = kzalloc_objs(int, max(1, nvec), GFP_KERNEL); + v = kzalloc_objs(int, max(1, nvec)); if (!v) return -ENOMEM; diff --git a/arch/x86/platform/efi/runtime-map.c b/arch/x86/platform/efi/runtime-map.c index 77699893b5bb..053ff161eb9a 100644 --- a/arch/x86/platform/efi/runtime-map.c +++ b/arch/x86/platform/efi/runtime-map.c @@ -114,7 +114,7 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr, return ERR_PTR(-ENOMEM); } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { kset_unregister(map_kset); map_kset = NULL; @@ -166,7 +166,7 @@ static int __init efi_runtime_map_init(void) if (!efi_enabled(EFI_MEMMAP) || !efi_kobj) return 0; - map_entries = kzalloc_objs(entry, efi.memmap.nr_map, GFP_KERNEL); + map_entries = kzalloc_objs(entry, efi.memmap.nr_map); if (!map_entries) { ret = -ENOMEM; goto out; diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geode/geode-common.c index f3c9eff2d374..05189c5f7d2a 100644 --- a/arch/x86/platform/geode/geode-common.c +++ b/arch/x86/platform/geode/geode-common.c @@ -113,7 +113,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds, return -EINVAL; } - swnodes = kzalloc_objs(*swnodes, n_leds, GFP_KERNEL); + swnodes = kzalloc_objs(*swnodes, n_leds); if (!swnodes) return -ENOMEM; @@ -121,7 +121,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds, * Each LED is represented by 3 properties: "gpios", * "linux,default-trigger", and am empty terminator. */ - props = kzalloc_objs(*props, n_leds * 3, GFP_KERNEL); + props = kzalloc_objs(*props, n_leds * 3); if (!props) { err = -ENOMEM; goto err_free_swnodes; diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 5a7d96bbd6d8..702f30eaf9c4 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -394,7 +394,7 @@ static int msr_build_context(const u32 *msr_id, const int num) total_num = saved_msrs->num + num; - msr_array = kmalloc_objs(struct saved_msr, total_num, GFP_KERNEL); + msr_array = kmalloc_objs(struct saved_msr, total_num); if (!msr_array) { pr_err("x86/pm: Can not allocate memory to save/restore MSRs during suspend.\n"); return -ENOMEM; diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index 5a31ced2788c..a4f3a364fb65 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -313,7 +313,7 @@ static bool __init alloc_rmp_segment_desc(u64 segment_pa, u64 segment_size, u64 return false; } - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) { memunmap(rmp_segment); return false; diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index 047cb2063202..8b8e165a2001 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -194,7 +194,7 @@ static int add_tdx_memblock(struct list_head *tmb_list, unsigned long start_pfn, { struct tdx_memblock *tmb; - tmb = kmalloc_obj(*tmb, GFP_KERNEL); + tmb = kmalloc_obj(*tmb); if (!tmb) return -ENOMEM; diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c index d8149572b4f7..5f4060b5a40d 100644 --- a/arch/x86/xen/grant-table.c +++ b/arch/x86/xen/grant-table.c @@ -101,7 +101,7 @@ static int gnttab_apply(pte_t *pte, unsigned long addr, void *data) static int arch_gnttab_valloc(struct gnttab_vm_area *area, unsigned nr_frames) { - area->ptes = kmalloc_objs(*area->ptes, nr_frames, GFP_KERNEL); + area->ptes = kmalloc_objs(*area->ptes, nr_frames); if (area->ptes == NULL) return -ENOMEM; area->area = get_vm_area(PAGE_SIZE * nr_frames, VM_IOREMAP); diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c index 82894426cb99..db9b8e222b38 100644 --- a/arch/x86/xen/smp_pv.c +++ b/arch/x86/xen/smp_pv.c @@ -230,7 +230,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map)) return 0; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (ctxt == NULL) { cpumask_clear_cpu(cpu, xen_cpu_initialized_map); return -ENOMEM; diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index b5de377dc96f..b80d54b2ea34 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c @@ -123,7 +123,7 @@ static int tie_get(struct task_struct *target, int ret; struct pt_regs *regs = task_pt_regs(target); struct thread_info *ti = task_thread_info(target); - elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t, GFP_KERNEL); + elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t); if (!newregs) return -ENOMEM; @@ -156,7 +156,7 @@ static int tie_set(struct task_struct *target, int ret; struct pt_regs *regs = task_pt_regs(target); struct thread_info *ti = task_thread_info(target); - elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t, GFP_KERNEL); + elf_xtregs_t *newregs = kzalloc_obj(elf_xtregs_t); if (!newregs) return -ENOMEM; diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index 3e54f6377c81..7c7a2aa749f8 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c @@ -320,7 +320,7 @@ static int __init simdisk_init(void) if (simdisk_count > MAX_SIMDISK_COUNT) simdisk_count = MAX_SIMDISK_COUNT; - sddev = kmalloc_objs(*sddev, simdisk_count, GFP_KERNEL); + sddev = kmalloc_objs(*sddev, simdisk_count); if (sddev == NULL) goto out_unregister; diff --git a/block/bio-integrity.c b/block/bio-integrity.c index dc2e771f11ae..20f5d301d32d 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -322,7 +322,7 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter) if (nr_vecs > BIO_MAX_VECS) return -E2BIG; if (nr_vecs > UIO_FASTIOV) { - bvec = kzalloc_objs(*bvec, nr_vecs, GFP_KERNEL); + bvec = kzalloc_objs(*bvec, nr_vecs); if (!bvec) return -ENOMEM; pages = NULL; diff --git a/block/bio.c b/block/bio.c index c8e14c330a35..d80d5d26804e 100644 --- a/block/bio.c +++ b/block/bio.c @@ -84,7 +84,7 @@ static DEFINE_XARRAY(bio_slabs); static struct bio_slab *create_bio_slab(unsigned int size) { - struct bio_slab *bslab = kzalloc_obj(*bslab, GFP_KERNEL); + struct bio_slab *bslab = kzalloc_obj(*bslab); if (!bslab) return NULL; diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index de609a3e0228..b70096497d38 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1417,7 +1417,7 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) { blkcg = &blkcg_root; } else { - blkcg = kzalloc_obj(*blkcg, GFP_KERNEL); + blkcg = kzalloc_obj(*blkcg); if (!blkcg) goto unlock; } diff --git a/block/blk-crypto-profile.c b/block/blk-crypto-profile.c index 58032fd7faff..970880d9adf4 100644 --- a/block/blk-crypto-profile.c +++ b/block/blk-crypto-profile.c @@ -93,7 +93,7 @@ int blk_crypto_profile_init(struct blk_crypto_profile *profile, /* Initialize keyslot management data. */ - profile->slots = kvzalloc_objs(profile->slots[0], num_slots, GFP_KERNEL); + profile->slots = kvzalloc_objs(profile->slots[0], num_slots); if (!profile->slots) goto err_destroy; diff --git a/block/blk-crypto-sysfs.c b/block/blk-crypto-sysfs.c index e6c76d672829..ea7a0b85a46f 100644 --- a/block/blk-crypto-sysfs.c +++ b/block/blk-crypto-sysfs.c @@ -170,7 +170,7 @@ int blk_crypto_sysfs_register(struct gendisk *disk) if (!q->crypto_profile) return 0; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return -ENOMEM; obj->profile = q->crypto_profile; diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 32faf0a56bd3..d145db61e5c3 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -2882,7 +2882,7 @@ static int blk_iocost_init(struct gendisk *disk) struct ioc *ioc; int i, cpu, ret; - ioc = kzalloc_obj(*ioc, GFP_KERNEL); + ioc = kzalloc_obj(*ioc); if (!ioc) return -ENOMEM; diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 609a71476bff..53e8dd2dfa8a 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -760,7 +760,7 @@ static int blk_iolatency_init(struct gendisk *disk) struct blk_iolatency *blkiolat; int ret; - blkiolat = kzalloc_obj(*blkiolat, GFP_KERNEL); + blkiolat = kzalloc_obj(*blkiolat); if (!blkiolat) return -ENOMEM; diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 0d085a53f0d7..0a00f5a76f5a 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -489,7 +489,7 @@ int blk_mq_alloc_sched_ctx_batch(struct xarray *elv_tbl, lockdep_assert_held_write(&set->update_nr_hwq_lock); list_for_each_entry(q, &set->tag_list, tag_set_list) { - ctx = kzalloc_obj(struct elv_change_ctx, GFP_KERNEL); + ctx = kzalloc_obj(struct elv_change_ctx); if (!ctx) return -ENOMEM; diff --git a/block/blk-mq.c b/block/blk-mq.c index e0bbe087766f..9af8c3dec3f6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4362,7 +4362,7 @@ static int blk_mq_alloc_ctxs(struct request_queue *q) struct blk_mq_ctxs *ctxs; int cpu; - ctxs = kzalloc_obj(*ctxs, GFP_KERNEL); + ctxs = kzalloc_obj(*ctxs); if (!ctxs) return -ENOMEM; @@ -4879,7 +4879,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) set->nr_hw_queues = nr_cpu_ids; if (set->flags & BLK_MQ_F_BLOCKING) { - set->srcu = kmalloc_obj(*set->srcu, GFP_KERNEL); + set->srcu = kmalloc_obj(*set->srcu); if (!set->srcu) return -ENOMEM; ret = init_srcu_struct(set->srcu); diff --git a/block/blk-stat.c b/block/blk-stat.c index 2eaa5e27cdb8..de126e1ea5ac 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -103,11 +103,11 @@ blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *), { struct blk_stat_callback *cb; - cb = kmalloc_obj(*cb, GFP_KERNEL); + cb = kmalloc_obj(*cb); if (!cb) return NULL; - cb->stat = kmalloc_objs(struct blk_rq_stat, buckets, GFP_KERNEL); + cb->stat = kmalloc_objs(struct blk_rq_stat, buckets); if (!cb->stat) { kfree(cb); return NULL; @@ -206,7 +206,7 @@ struct blk_queue_stats *blk_alloc_queue_stats(void) { struct blk_queue_stats *stats; - stats = kmalloc_obj(*stats, GFP_KERNEL); + stats = kmalloc_obj(*stats); if (!stats) return NULL; diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 91115508179b..33006edfccd4 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -713,7 +713,7 @@ static int wbt_data_dir(const struct request *rq) static struct rq_wb *wbt_alloc(void) { - struct rq_wb *rwb = kzalloc_obj(*rwb, GFP_KERNEL); + struct rq_wb *rwb = kzalloc_obj(*rwb); if (!rwb) return NULL; diff --git a/block/bsg-lib.c b/block/bsg-lib.c index ca08c6b7fb9c..20cd0ef3c394 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -368,7 +368,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name, struct request_queue *q; int ret = -ENOMEM; - bset = kzalloc_obj(*bset, GFP_KERNEL); + bset = kzalloc_obj(*bset); if (!bset) return ERR_PTR(-ENOMEM); diff --git a/block/bsg.c b/block/bsg.c index 5f87ea8d5f64..e0af6206ed28 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -192,7 +192,7 @@ struct bsg_device *bsg_register_queue(struct request_queue *q, struct bsg_device *bd; int ret; - bd = kzalloc_obj(*bd, GFP_KERNEL); + bd = kzalloc_obj(*bd); if (!bd) return ERR_PTR(-ENOMEM); bd->max_queue = BSG_DEFAULT_CMDS; diff --git a/block/disk-events.c b/block/disk-events.c index 04d44d05ed53..9f9f9f8a2d6b 100644 --- a/block/disk-events.c +++ b/block/disk-events.c @@ -436,7 +436,7 @@ int disk_alloc_events(struct gendisk *disk) if (!disk->fops->check_events || !disk->events) return 0; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) { pr_warn("%s: failed to initialize events\n", disk->disk_name); return -ENOMEM; diff --git a/block/fops.c b/block/fops.c index 57a53e0d1016..bb6642b45937 100644 --- a/block/fops.c +++ b/block/fops.c @@ -65,7 +65,7 @@ static ssize_t __blkdev_direct_IO_simple(struct kiocb *iocb, if (nr_pages <= DIO_INLINE_BIO_VECS) vecs = inline_vecs; else { - vecs = kmalloc_objs(struct bio_vec, nr_pages, GFP_KERNEL); + vecs = kmalloc_objs(struct bio_vec, nr_pages); if (!vecs) return -ENOMEM; } diff --git a/block/genhd.c b/block/genhd.c index 15866ccf5c33..7d6854fd28e9 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -264,7 +264,7 @@ int __register_blkdev(unsigned int major, const char *name, goto out; } - p = kmalloc_obj(struct blk_major_name, GFP_KERNEL); + p = kmalloc_obj(struct blk_major_name); if (p == NULL) { ret = -ENOMEM; goto out; @@ -914,7 +914,7 @@ static void *disk_seqf_start(struct seq_file *seqf, loff_t *pos) struct class_dev_iter *iter; struct device *dev; - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return ERR_PTR(-ENOMEM); diff --git a/block/holder.c b/block/holder.c index 1e7b88815323..267beb3dc7a7 100644 --- a/block/holder.c +++ b/block/holder.c @@ -92,7 +92,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) goto out_unlock; } - holder = kzalloc_obj(*holder, GFP_KERNEL); + holder = kzalloc_obj(*holder); if (!holder) { ret = -ENOMEM; goto out_unlock; diff --git a/block/partitions/aix.c b/block/partitions/aix.c index 97c8fa2a866f..a886cefbefbb 100644 --- a/block/partitions/aix.c +++ b/block/partitions/aix.c @@ -199,7 +199,7 @@ int aix_partition(struct parsed_partitions *state) numlvs = be16_to_cpu(p->numlvs); put_dev_sector(sect); } - lvip = kzalloc_objs(struct lv_info, state->limit, GFP_KERNEL); + lvip = kzalloc_objs(struct lv_info, state->limit); if (!lvip) return 0; if (numlvs && (d = read_part_sector(state, vgda_sector + 1, §))) { diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c index 5d604a64842e..a2b1870c3fd4 100644 --- a/block/partitions/cmdline.c +++ b/block/partitions/cmdline.c @@ -46,7 +46,7 @@ static int parse_subpart(struct cmdline_subpart **subpart, char *partdef) *subpart = NULL; - new_subpart = kzalloc_obj(struct cmdline_subpart, GFP_KERNEL); + new_subpart = kzalloc_obj(struct cmdline_subpart); if (!new_subpart) return -ENOMEM; @@ -122,7 +122,7 @@ static int parse_parts(struct cmdline_parts **parts, char *bdevdef) *parts = NULL; - newparts = kzalloc_obj(struct cmdline_parts, GFP_KERNEL); + newparts = kzalloc_obj(struct cmdline_parts); if (!newparts) return -ENOMEM; diff --git a/block/partitions/core.c b/block/partitions/core.c index 189ab5650351..740228750aaf 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -94,7 +94,7 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd) struct parsed_partitions *state; int nr = DISK_MAX_PARTS; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/block/partitions/efi.c b/block/partitions/efi.c index ff145c6306e0..75474fb3848e 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -595,7 +595,7 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt, lastlba = last_lba(state->disk); if (!force_gpt) { /* This will be added to the EFI Spec. per Intel after v1.02. */ - legacymbr = kzalloc_obj(*legacymbr, GFP_KERNEL); + legacymbr = kzalloc_obj(*legacymbr); if (!legacymbr) goto fail; diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c index b81b7a690787..9311ad5fb95d 100644 --- a/block/partitions/ibm.c +++ b/block/partitions/ibm.c @@ -347,13 +347,13 @@ int ibm_partition(struct parsed_partitions *state) nr_sectors = bdev_nr_sectors(bdev); if (nr_sectors == 0) goto out_symbol; - info = kmalloc_obj(dasd_information2_t, GFP_KERNEL); + info = kmalloc_obj(dasd_information2_t); if (info == NULL) goto out_symbol; - geo = kmalloc_obj(struct hd_geometry, GFP_KERNEL); + geo = kmalloc_obj(struct hd_geometry); if (geo == NULL) goto out_nogeo; - label = kmalloc_obj(union label_t, GFP_KERNEL); + label = kmalloc_obj(union label_t); if (label == NULL) goto out_nolab; /* set start if not filled by getgeo function e.g. virtblk */ diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index 27ffddd74e11..776b4ad95091 100644 --- a/block/partitions/ldm.c +++ b/block/partitions/ldm.c @@ -273,8 +273,8 @@ static bool ldm_validate_privheads(struct parsed_partitions *state, BUG_ON (!state || !ph1); - ph[1] = kmalloc_obj(*ph[1], GFP_KERNEL); - ph[2] = kmalloc_obj(*ph[2], GFP_KERNEL); + ph[1] = kmalloc_obj(*ph[1]); + ph[2] = kmalloc_obj(*ph[2]); if (!ph[1] || !ph[2]) { ldm_crit ("Out of memory."); goto out; @@ -362,7 +362,7 @@ static bool ldm_validate_tocblocks(struct parsed_partitions *state, BUG_ON(!state || !ldb); ph = &ldb->ph; tb[0] = &ldb->toc; - tb[1] = kmalloc_objs(*tb[1], 3, GFP_KERNEL); + tb[1] = kmalloc_objs(*tb[1], 3); if (!tb[1]) { ldm_crit("Out of memory."); goto err; @@ -1158,7 +1158,7 @@ static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb) BUG_ON (!data || !ldb); - vb = kmalloc_obj(*vb, GFP_KERNEL); + vb = kmalloc_obj(*vb); if (!vb) { ldm_crit ("Out of memory."); return false; @@ -1438,7 +1438,7 @@ int ldm_partition(struct parsed_partitions *state) if (!ldm_validate_partition_table(state)) return 0; - ldb = kmalloc_obj(*ldb, GFP_KERNEL); + ldb = kmalloc_obj(*ldb); if (!ldb) { ldm_crit ("Out of memory."); goto out; diff --git a/block/sed-opal.c b/block/sed-opal.c index fbe0fe4dce8a..3ded1ca723ca 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -2512,7 +2512,7 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv) { struct opal_dev *dev; - dev = kmalloc_obj(*dev, GFP_KERNEL); + dev = kmalloc_obj(*dev); if (!dev) return NULL; @@ -2719,7 +2719,7 @@ static int opal_save(struct opal_dev *dev, struct opal_lock_unlock *lk_unlk) { struct opal_suspend_data *suspend; - suspend = kzalloc_obj(*suspend, GFP_KERNEL); + suspend = kzalloc_obj(*suspend); if (!suspend) return -ENOMEM; diff --git a/certs/blacklist.c b/certs/blacklist.c index 725c2f18fa31..fa561c12eabf 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -328,7 +328,7 @@ static int __init blacklist_init(void) if (register_key_type(&key_type_blacklist) < 0) panic("Can't allocate system blacklist key type\n"); - restriction = kzalloc_obj(*restriction, GFP_KERNEL); + restriction = kzalloc_obj(*restriction); if (!restriction) panic("Can't allocate blacklist keyring restriction\n"); restriction->check = restrict_link_for_blacklist; diff --git a/certs/system_keyring.c b/certs/system_keyring.c index afe67e2a47ed..e0761436ec7f 100644 --- a/certs/system_keyring.c +++ b/certs/system_keyring.c @@ -140,7 +140,7 @@ static __init struct key_restriction *get_builtin_and_secondary_restriction(void { struct key_restriction *restriction; - restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction); if (!restriction) panic("Can't allocate secondary trusted keyring restriction\n"); diff --git a/crypto/af_alg.c b/crypto/af_alg.c index d6f14649bd13..0bb609fbec7d 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -70,7 +70,7 @@ int af_alg_register_type(const struct af_alg_type *type) goto unlock; } - node = kmalloc_obj(*node, GFP_KERNEL); + node = kmalloc_obj(*node); err = -ENOMEM; if (!node) goto unlock; diff --git a/crypto/algboss.c b/crypto/algboss.c index 09ceeb0db431..8b936cae6608 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -84,7 +84,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) if (!try_module_get(THIS_MODULE)) goto err; - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) goto err_put_module; @@ -195,7 +195,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) if (!try_module_get(THIS_MODULE)) goto err; - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) goto err_put_module; diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c index 8578b9d1c569..a9fb492e929a 100644 --- a/crypto/algif_rng.c +++ b/crypto/algif_rng.c @@ -202,7 +202,7 @@ static void *rng_bind(const char *name, u32 type, u32 mask) struct rng_parent_ctx *pctx; struct crypto_rng *rng; - pctx = kzalloc_obj(*pctx, GFP_KERNEL); + pctx = kzalloc_obj(*pctx); if (!pctx) return ERR_PTR(-ENOMEM); diff --git a/crypto/api.c b/crypto/api.c index b0b69ca789f3..74e17d5049c9 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -105,7 +105,7 @@ struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask) { struct crypto_larval *larval; - larval = kzalloc_obj(*larval, GFP_KERNEL); + larval = kzalloc_obj(*larval); if (!larval) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c index 33c9e68ab28d..16a7ae16593c 100644 --- a/crypto/asymmetric_keys/asymmetric_type.c +++ b/crypto/asymmetric_keys/asymmetric_type.c @@ -486,7 +486,7 @@ static struct key_restriction *asymmetric_restriction_alloc( struct key *key) { struct key_restriction *keyres = - kzalloc_obj(struct key_restriction, GFP_KERNEL); + kzalloc_obj(struct key_restriction); if (!keyres) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c index ab400d62c587..6e3ffdac83ac 100644 --- a/crypto/asymmetric_keys/pkcs7_parser.c +++ b/crypto/asymmetric_keys/pkcs7_parser.c @@ -133,16 +133,16 @@ struct pkcs7_message *pkcs7_parse_message(const void *data, size_t datalen) struct pkcs7_message *msg = ERR_PTR(-ENOMEM); int ret; - ctx = kzalloc_obj(struct pkcs7_parse_context, GFP_KERNEL); + ctx = kzalloc_obj(struct pkcs7_parse_context); if (!ctx) goto out_no_ctx; - ctx->msg = kzalloc_obj(struct pkcs7_message, GFP_KERNEL); + ctx->msg = kzalloc_obj(struct pkcs7_message); if (!ctx->msg) goto out_no_msg; - ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info, GFP_KERNEL); + ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info); if (!ctx->sinfo) goto out_no_sinfo; - ctx->sinfo->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); + ctx->sinfo->sig = kzalloc_obj(struct public_key_signature); if (!ctx->sinfo->sig) goto out_no_sig; @@ -728,10 +728,10 @@ int pkcs7_note_signed_info(void *context, size_t hdrlen, sinfo->index = ++ctx->sinfo_index; *ctx->ppsinfo = sinfo; ctx->ppsinfo = &sinfo->next; - ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info, GFP_KERNEL); + ctx->sinfo = kzalloc_obj(struct pkcs7_signed_info); if (!ctx->sinfo) return -ENOMEM; - ctx->sinfo->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); + ctx->sinfo->sig = kzalloc_obj(struct public_key_signature); if (!ctx->sinfo->sig) return -ENOMEM; return 0; diff --git a/crypto/asymmetric_keys/pkcs8_parser.c b/crypto/asymmetric_keys/pkcs8_parser.c index c7f04dbadbd1..9dd1c181789a 100644 --- a/crypto/asymmetric_keys/pkcs8_parser.c +++ b/crypto/asymmetric_keys/pkcs8_parser.c @@ -103,7 +103,7 @@ static struct public_key *pkcs8_parse(const void *data, size_t datalen) memset(&ctx, 0, sizeof(ctx)); ret = -ENOMEM; - ctx.pub = kzalloc_obj(struct public_key, GFP_KERNEL); + ctx.pub = kzalloc_obj(struct public_key); if (!ctx.pub) goto error; diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index ba446683358a..37e4fb9da106 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -65,16 +65,16 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen) struct asymmetric_key_id *kid; long ret; - cert = kzalloc_obj(struct x509_certificate, GFP_KERNEL); + cert = kzalloc_obj(struct x509_certificate); if (!cert) return ERR_PTR(-ENOMEM); - cert->pub = kzalloc_obj(struct public_key, GFP_KERNEL); + cert->pub = kzalloc_obj(struct public_key); if (!cert->pub) return ERR_PTR(-ENOMEM); - cert->sig = kzalloc_obj(struct public_key_signature, GFP_KERNEL); + cert->sig = kzalloc_obj(struct public_key_signature); if (!cert->sig) return ERR_PTR(-ENOMEM); - ctx = kzalloc_obj(struct x509_parse_context, GFP_KERNEL); + ctx = kzalloc_obj(struct x509_parse_context); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index 9a936e255397..25cf8ac7f257 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c @@ -210,7 +210,7 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) p = bin2hex(p, q, srlen); *p = 0; - kids = kmalloc_obj(struct asymmetric_key_ids, GFP_KERNEL); + kids = kmalloc_obj(struct asymmetric_key_ids); if (!kids) return -ENOMEM; kids->id[0] = cert->id; diff --git a/crypto/drbg.c b/crypto/drbg.c index 8a915da08fa9..1ed209e5d5dd 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1522,7 +1522,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) unsigned int alignmask; char ctr_name[CRYPTO_MAX_ALG_NAME]; - aeskey = kzalloc_obj(*aeskey, GFP_KERNEL); + aeskey = kzalloc_obj(*aeskey); if (!aeskey) return -ENOMEM; drbg->priv_data = aeskey; @@ -1761,7 +1761,7 @@ static inline int __init drbg_healthcheck_sanity(void) drbg_convert_tfm_core("drbg_nopr_hmac_sha512", &coreref, &pr); #endif - drbg = kzalloc_obj(struct drbg_state, GFP_KERNEL); + drbg = kzalloc_obj(struct drbg_state); if (!drbg) return -ENOMEM; diff --git a/crypto/ecc.c b/crypto/ecc.c index 3d07383a26f4..08150b14e17e 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c @@ -98,7 +98,7 @@ struct ecc_point *ecc_alloc_point(unsigned int ndigits) if (!ndigits) return NULL; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return NULL; diff --git a/crypto/gcm.c b/crypto/gcm.c index 154138dbf19a..e1e878d37410 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c @@ -1098,7 +1098,7 @@ static int __init crypto_gcm_module_init(void) { int err; - gcm_zeroes = kzalloc_obj(*gcm_zeroes, GFP_KERNEL); + gcm_zeroes = kzalloc_obj(*gcm_zeroes); if (!gcm_zeroes) return -ENOMEM; diff --git a/crypto/simd.c b/crypto/simd.c index e343bda70fc8..f71c4a334c7d 100644 --- a/crypto/simd.c +++ b/crypto/simd.c @@ -145,7 +145,7 @@ struct simd_skcipher_alg *simd_skcipher_create_compat(struct skcipher_alg *ialg, struct skcipher_alg *alg; int err; - salg = kzalloc_obj(*salg, GFP_KERNEL); + salg = kzalloc_obj(*salg); if (!salg) { salg = ERR_PTR(-ENOMEM); goto out; @@ -370,7 +370,7 @@ static struct simd_aead_alg *simd_aead_create_compat(struct aead_alg *ialg, struct aead_alg *alg; int err; - salg = kzalloc_obj(*salg, GFP_KERNEL); + salg = kzalloc_obj(*salg); if (!salg) { salg = ERR_PTR(-ENOMEM); goto out; diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 4217d3d1ca41..aded37546137 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -180,7 +180,7 @@ static int test_mb_aead_jiffies(struct test_mb_aead_data *data, int enc, int ret = 0; int *rc; - rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb); if (!rc) return -ENOMEM; @@ -207,7 +207,7 @@ static int test_mb_aead_cycles(struct test_mb_aead_data *data, int enc, int i; int *rc; - rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb); if (!rc) return -ENOMEM; @@ -270,7 +270,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs, else e = "decryption"; - data = kzalloc_objs(*data, num_mb, GFP_KERNEL); + data = kzalloc_objs(*data, num_mb); if (!data) goto out_free_iv; @@ -997,7 +997,7 @@ static int test_mb_acipher_jiffies(struct test_mb_skcipher_data *data, int enc, int ret = 0; int *rc; - rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb); if (!rc) return -ENOMEM; @@ -1024,7 +1024,7 @@ static int test_mb_acipher_cycles(struct test_mb_skcipher_data *data, int enc, int i; int *rc; - rc = kzalloc_objs(*rc, num_mb, GFP_KERNEL); + rc = kzalloc_objs(*rc, num_mb); if (!rc) return -ENOMEM; @@ -1075,7 +1075,7 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs, else e = "decryption"; - data = kzalloc_objs(*data, num_mb, GFP_KERNEL); + data = kzalloc_objs(*data, num_mb); if (!data) return; diff --git a/crypto/testmgr.c b/crypto/testmgr.c index c13aa351898d..49b607f65f63 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -739,7 +739,7 @@ static struct cipher_test_sglists *alloc_cipher_test_sglists(void) { struct cipher_test_sglists *tsgls; - tsgls = kmalloc_obj(*tsgls, GFP_KERNEL); + tsgls = kmalloc_obj(*tsgls); if (!tsgls) return NULL; @@ -1796,7 +1796,7 @@ static int test_hash_vs_generic_impl(const char *generic_driver, return err; } - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) { err = -ENOMEM; goto out; @@ -1941,7 +1941,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, if (err) goto out; - tsgl = kmalloc_obj(*tsgl, GFP_KERNEL); + tsgl = kmalloc_obj(*tsgl); if (!tsgl || init_test_sglist(tsgl) != 0) { pr_err("alg: hash: failed to allocate test buffers for %s\n", driver); @@ -2598,7 +2598,7 @@ static int test_aead_slow(const struct alg_test_desc *test_desc, if (noslowtests) return 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; init_rnd_state(&ctx->rng); @@ -3106,7 +3106,7 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, return err; } - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) { err = -ENOMEM; goto out; diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index d4869f2fef02..4503c7c77a3e 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -464,7 +464,7 @@ static int aie2_alloc_resource(struct amdxdna_hwctx *hwctx) return aie2_create_context(xdna->dev_handle, hwctx); } - xrs_req = kzalloc_obj(*xrs_req, GFP_KERNEL); + xrs_req = kzalloc_obj(*xrs_req); if (!xrs_req) return -ENOMEM; @@ -559,7 +559,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx) struct amdxdna_gem_obj *heap; int i, ret; - priv = kzalloc_obj(*hwctx->priv, GFP_KERNEL); + priv = kzalloc_obj(*hwctx->priv); if (!priv) return -ENOMEM; hwctx->priv = priv; diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c index 47346684bb75..2a51b2658bfc 100644 --- a/drivers/accel/amdxdna/aie2_pci.c +++ b/drivers/accel/amdxdna/aie2_pci.c @@ -653,7 +653,7 @@ static int aie2_get_aie_metadata(struct amdxdna_client *client, int ret = 0; ndev = xdna->dev_handle; - meta = kzalloc_obj(*meta, GFP_KERNEL); + meta = kzalloc_obj(*meta); if (!meta) return -ENOMEM; @@ -748,7 +748,7 @@ static int aie2_get_clock_metadata(struct amdxdna_client *client, int ret = 0; ndev = xdna->dev_handle; - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) return -ENOMEM; @@ -775,7 +775,7 @@ static int aie2_hwctx_status_cb(struct amdxdna_hwctx *hwctx, void *arg) if (!array_args->num_element) return -EINVAL; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/accel/amdxdna/aie2_solver.c b/drivers/accel/amdxdna/aie2_solver.c index 6154ef9f9e9d..f5d88d707551 100644 --- a/drivers/accel/amdxdna/aie2_solver.c +++ b/drivers/accel/amdxdna/aie2_solver.c @@ -197,7 +197,7 @@ static int get_free_partition(struct solver_state *xrs, if (i == snode->cols_len) return -ENODEV; - pt_node = kzalloc_obj(*pt_node, GFP_KERNEL); + pt_node = kzalloc_obj(*pt_node); if (!pt_node) return -ENOMEM; diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c index edbac9f4054c..29722ae34133 100644 --- a/drivers/accel/amdxdna/amdxdna_ctx.c +++ b/drivers/accel/amdxdna/amdxdna_ctx.c @@ -50,7 +50,7 @@ static struct dma_fence *amdxdna_fence_create(struct amdxdna_hwctx *hwctx) { struct amdxdna_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; @@ -161,7 +161,7 @@ int amdxdna_drm_create_hwctx_ioctl(struct drm_device *dev, void *data, struct dr if (args->ext || args->ext_flags) return -EINVAL; - hwctx = kzalloc_obj(*hwctx, GFP_KERNEL); + hwctx = kzalloc_obj(*hwctx); if (!hwctx) return -ENOMEM; diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index d862d5fe5385..a561674bac97 100644 --- a/drivers/accel/amdxdna/amdxdna_gem.c +++ b/drivers/accel/amdxdna/amdxdna_gem.c @@ -205,7 +205,7 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo, if (!xdna->dev_info->ops->hmm_invalidate) return 0; - mapp = kzalloc_obj(*mapp, GFP_KERNEL); + mapp = kzalloc_obj(*mapp); if (!mapp) return -ENOMEM; @@ -499,7 +499,7 @@ amdxdna_gem_create_obj(struct drm_device *dev, size_t size) { struct amdxdna_gem_obj *abo; - abo = kzalloc_obj(*abo, GFP_KERNEL); + abo = kzalloc_obj(*abo); if (!abo) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c b/drivers/accel/amdxdna/amdxdna_mailbox.c index 04d1d30184ca..235a94047530 100644 --- a/drivers/accel/amdxdna/amdxdna_mailbox.c +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c @@ -475,7 +475,7 @@ xdna_mailbox_create_channel(struct mailbox *mb, return NULL; } - mb_chann = kzalloc_obj(*mb_chann, GFP_KERNEL); + mb_chann = kzalloc_obj(*mb_chann); if (!mb_chann) return NULL; diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index 86f46f59b9dc..4ada45d06fcf 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -63,7 +63,7 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp) struct amdxdna_client *client; int ret; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; diff --git a/drivers/accel/amdxdna/amdxdna_ubuf.c b/drivers/accel/amdxdna/amdxdna_ubuf.c index 44db2cef40cb..b509f10b155c 100644 --- a/drivers/accel/amdxdna/amdxdna_ubuf.c +++ b/drivers/accel/amdxdna/amdxdna_ubuf.c @@ -27,7 +27,7 @@ static struct sg_table *amdxdna_ubuf_map(struct dma_buf_attachment *attach, struct sg_table *sg; int ret; - sg = kzalloc_obj(*sg, GFP_KERNEL); + sg = kzalloc_obj(*sg); if (!sg) return ERR_PTR(-ENOMEM); @@ -147,7 +147,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, if (!can_do_mlock()) return ERR_PTR(-EPERM); - ubuf = kzalloc_obj(*ubuf, GFP_KERNEL); + ubuf = kzalloc_obj(*ubuf); if (!ubuf) return ERR_PTR(-ENOMEM); @@ -155,7 +155,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, ubuf->mm = current->mm; mmgrab(ubuf->mm); - va_ent = kvzalloc_objs(*va_ent, num_entries, GFP_KERNEL); + va_ent = kvzalloc_objs(*va_ent, num_entries); if (!va_ent) { ret = -ENOMEM; goto free_ubuf; @@ -189,7 +189,7 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev, goto sub_pin_cnt; } - ubuf->pages = kvmalloc_objs(*ubuf->pages, ubuf->nr_pages, GFP_KERNEL); + ubuf->pages = kvmalloc_objs(*ubuf->pages, ubuf->nr_pages); if (!ubuf->pages) { ret = -ENOMEM; goto sub_pin_cnt; diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 7a5405db5a6c..cbd74e3adb9f 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -50,7 +50,7 @@ struct drm_gem_object *ethosu_gem_create_object(struct drm_device *ddev, size_t { struct ethosu_gem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/ethosu/ethosu_job.c b/drivers/accel/ethosu/ethosu_job.c index 91d1b996852e..8598a3634340 100644 --- a/drivers/accel/ethosu/ethosu_job.c +++ b/drivers/accel/ethosu/ethosu_job.c @@ -375,7 +375,7 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file if (edev->npu_info.sram_size < job->sram_size) return -EINVAL; - ejob = kzalloc_obj(*ejob, GFP_KERNEL); + ejob = kzalloc_obj(*ejob); if (!ejob) return -ENOMEM; @@ -384,7 +384,7 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file ejob->dev = edev; ejob->sram_size = job->sram_size; - ejob->done_fence = kzalloc_obj(*ejob->done_fence, GFP_KERNEL); + ejob->done_fence = kzalloc_obj(*ejob->done_fence); if (!ejob->done_fence) { ret = -ENOMEM; goto out_cleanup_job; @@ -476,7 +476,7 @@ int ethosu_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil } struct drm_ethosu_job __free(kvfree) *jobs = - kvmalloc_objs(*jobs, args->job_count, GFP_KERNEL); + kvmalloc_objs(*jobs, args->job_count); if (!jobs) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/command_buffer.c b/drivers/accel/habanalabs/common/command_buffer.c index b27323afd12d..e929db8bc023 100644 --- a/drivers/accel/habanalabs/common/command_buffer.c +++ b/drivers/accel/habanalabs/common/command_buffer.c @@ -119,7 +119,7 @@ static struct hl_cb *hl_cb_alloc(struct hl_device *hdev, u32 cb_size, cb = kzalloc_obj(*cb, GFP_ATOMIC); if (!cb) - cb = kzalloc_obj(*cb, GFP_KERNEL); + cb = kzalloc_obj(*cb); if (!cb) return NULL; diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index f990d16f6c2f..6c896eb816de 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -909,7 +909,7 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, cs = kzalloc_obj(*cs, GFP_ATOMIC); if (!cs) - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) { atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt); @@ -938,7 +938,7 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, cs_cmpl = kzalloc_obj(*cs_cmpl, GFP_ATOMIC); if (!cs_cmpl) - cs_cmpl = kzalloc_obj(*cs_cmpl, GFP_KERNEL); + cs_cmpl = kzalloc_obj(*cs_cmpl); if (!cs_cmpl) { atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt); @@ -1304,7 +1304,7 @@ struct hl_cs_job *hl_cs_allocate_job(struct hl_device *hdev, job = kzalloc_obj(*job, GFP_ATOMIC); if (!job) - job = kzalloc_obj(*job, GFP_KERNEL); + job = kzalloc_obj(*job); if (!job) return NULL; @@ -2039,7 +2039,7 @@ static int cs_ioctl_reserve_signals(struct hl_fpriv *hpriv, prop = &hdev->kernel_queues[q_idx].sync_stream_prop; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) { rc = -ENOMEM; goto out; @@ -3052,7 +3052,7 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data) } /* allocate array for the fences */ - fence_arr = kmalloc_objs(struct hl_fence *, seq_arr_len, GFP_KERNEL); + fence_arr = kmalloc_objs(struct hl_fence *, seq_arr_len); if (!fence_arr) { rc = -ENOMEM; goto free_seq_arr; @@ -3411,7 +3411,7 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx, goto put_cq_cb; } - pend = kzalloc_obj(*pend, GFP_KERNEL); + pend = kzalloc_obj(*pend); if (!pend) { rc = -ENOMEM; goto put_cq_cb; @@ -3520,7 +3520,7 @@ static int _hl_interrupt_wait_ioctl_user_addr(struct hl_device *hdev, struct hl_ hl_ctx_get(ctx); - pend = kzalloc_obj(*pend, GFP_KERNEL); + pend = kzalloc_obj(*pend); if (!pend) { hl_ctx_put(ctx); return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/context.c b/drivers/accel/habanalabs/common/context.c index 4d69a3f48616..276c97aba992 100644 --- a/drivers/accel/habanalabs/common/context.c +++ b/drivers/accel/habanalabs/common/context.c @@ -155,7 +155,7 @@ int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv) struct hl_ctx *ctx; int rc; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto out_err; diff --git a/drivers/accel/habanalabs/common/decoder.c b/drivers/accel/habanalabs/common/decoder.c index 602e53f963ca..e4802f30c08a 100644 --- a/drivers/accel/habanalabs/common/decoder.c +++ b/drivers/accel/habanalabs/common/decoder.c @@ -98,7 +98,7 @@ int hl_dec_init(struct hl_device *hdev) if (!prop->max_dec) return 0; - hdev->dec = kzalloc_objs(struct hl_dec, prop->max_dec, GFP_KERNEL); + hdev->dec = kzalloc_objs(struct hl_dec, prop->max_dec); if (!hdev->dec) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 20ddf6617e02..d4c3473fb64f 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -722,7 +722,7 @@ static int device_init_cdev(struct hl_device *hdev, const struct class *class, cdev_init(cdev, fops); cdev->owner = THIS_MODULE; - *dev = kzalloc_obj(**dev, GFP_KERNEL); + *dev = kzalloc_obj(**dev); if (!*dev) return -ENOMEM; @@ -945,7 +945,7 @@ static int device_early_init(struct hl_device *hdev) goto free_ts_free_wq; } - hdev->hl_chip_info = kzalloc_obj(struct hwmon_chip_info, GFP_KERNEL); + hdev->hl_chip_info = kzalloc_obj(struct hwmon_chip_info); if (!hdev->hl_chip_info) { rc = -ENOMEM; goto free_prefetch_wq; @@ -1851,7 +1851,7 @@ kill_processes: } /* Allocate the kernel context */ - hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx, GFP_KERNEL); + hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx); if (!hdev->kernel_ctx) { rc = -ENOMEM; hl_mmu_fini(hdev); @@ -2275,7 +2275,7 @@ int hl_device_init(struct hl_device *hdev) } /* Allocate the kernel context */ - hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx, GFP_KERNEL); + hdev->kernel_ctx = kzalloc_obj(*hdev->kernel_ctx); if (!hdev->kernel_ctx) { rc = -ENOMEM; goto mmu_fini; diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c index f6a2c48ad74e..c8f1e252241d 100644 --- a/drivers/accel/habanalabs/common/firmware_if.c +++ b/drivers/accel/habanalabs/common/firmware_if.c @@ -2681,7 +2681,7 @@ static int hl_fw_dynamic_send_msg(struct hl_device *hdev, struct lkd_msg_comms *msg; int rc; - msg = kzalloc_obj(*msg, GFP_KERNEL); + msg = kzalloc_obj(*msg); if (!msg) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c index 63b4a91e291c..483e1ad9fc41 100644 --- a/drivers/accel/habanalabs/common/habanalabs_drv.c +++ b/drivers/accel/habanalabs/common/habanalabs_drv.c @@ -181,7 +181,7 @@ int hl_device_open(struct drm_device *ddev, struct drm_file *file_priv) struct hl_fpriv *hpriv; int rc; - hpriv = kzalloc_obj(*hpriv, GFP_KERNEL); + hpriv = kzalloc_obj(*hpriv); if (!hpriv) return -ENOMEM; @@ -291,7 +291,7 @@ int hl_device_open_ctrl(struct inode *inode, struct file *filp) return -ENXIO; } - hpriv = kzalloc_obj(*hpriv, GFP_KERNEL); + hpriv = kzalloc_obj(*hpriv); if (!hpriv) return -ENOMEM; diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index ace0aaa7b836..fef542afe035 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -201,7 +201,7 @@ static int debug_coresight(struct hl_device *hdev, struct hl_ctx *ctx, struct hl void *input = NULL, *output = NULL; int rc; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -682,11 +682,11 @@ static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args) if ((!max_size) || (!out)) return -EINVAL; - sec_attest_info = kmalloc_obj(*sec_attest_info, GFP_KERNEL); + sec_attest_info = kmalloc_obj(*sec_attest_info); if (!sec_attest_info) return -ENOMEM; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { rc = -ENOMEM; goto free_sec_attest_info; @@ -731,11 +731,11 @@ static int dev_info_signed(struct hl_fpriv *hpriv, struct hl_info_args *args) if ((!max_size) || (!out)) return -EINVAL; - dev_info_signed = kzalloc_obj(*dev_info_signed, GFP_KERNEL); + dev_info_signed = kzalloc_obj(*dev_info_signed); if (!dev_info_signed) return -ENOMEM; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { rc = -ENOMEM; goto free_dev_info_signed; diff --git a/drivers/accel/habanalabs/common/hldio.c b/drivers/accel/habanalabs/common/hldio.c index 2cef50bbfa9b..c33c817a962a 100644 --- a/drivers/accel/habanalabs/common/hldio.c +++ b/drivers/accel/habanalabs/common/hldio.c @@ -308,7 +308,7 @@ int hl_dio_ssd2hl(struct hl_device *hdev, struct hl_ctx *ctx, int fd, dev_dbg(hdev->dev, "SSD2HL fd=%d va=%#llx len=%#lx\n", fd, device_va, len_bytes); - io = kzalloc_obj(*io, GFP_KERNEL); + io = kzalloc_obj(*io); if (!io) { rc = -ENOMEM; goto out; diff --git a/drivers/accel/habanalabs/common/hwmon.c b/drivers/accel/habanalabs/common/hwmon.c index a8b00a80fa10..3c0f405a5148 100644 --- a/drivers/accel/habanalabs/common/hwmon.c +++ b/drivers/accel/habanalabs/common/hwmon.c @@ -203,7 +203,7 @@ int hl_build_hwmon_channel_info(struct hl_device *hdev, struct cpucp_sensor *sen } for (i = 0 ; i < num_active_sensor_types ; i++) { - channels_info[i] = kzalloc_obj(*channels_info[i], GFP_KERNEL); + channels_info[i] = kzalloc_obj(*channels_info[i]); if (!channels_info[i]) { rc = -ENOMEM; goto channel_info_err; diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index 8700e341ff94..361cff577381 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -125,7 +125,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args, } } - phys_pg_pack = kzalloc_obj(*phys_pg_pack, GFP_KERNEL); + phys_pg_pack = kzalloc_obj(*phys_pg_pack); if (!phys_pg_pack) { rc = -ENOMEM; goto pages_pack_err; @@ -228,7 +228,7 @@ static int dma_map_host_va(struct hl_device *hdev, u64 addr, u64 size, struct hl_userptr *userptr; int rc; - userptr = kzalloc_obj(*userptr, GFP_KERNEL); + userptr = kzalloc_obj(*userptr); if (!userptr) { rc = -ENOMEM; goto userptr_err; @@ -501,7 +501,7 @@ static int add_va_block_locked(struct hl_device *hdev, res = va_block; } - va_block = kmalloc_obj(*va_block, GFP_KERNEL); + va_block = kmalloc_obj(*va_block); if (!va_block) return -ENOMEM; @@ -850,7 +850,7 @@ static int init_phys_pg_pack_from_userptr(struct hl_ctx *ctx, dma_addr_t dma_addr; int rc, i, j; - phys_pg_pack = kzalloc_obj(*phys_pg_pack, GFP_KERNEL); + phys_pg_pack = kzalloc_obj(*phys_pg_pack); if (!phys_pg_pack) return -ENOMEM; @@ -1152,7 +1152,7 @@ static int map_device_va(struct hl_ctx *ctx, struct hl_mem_in *args, u64 *device goto shared_err; } - hnode = kzalloc_obj(*hnode, GFP_KERNEL); + hnode = kzalloc_obj(*hnode); if (!hnode) { rc = -ENOMEM; goto hnode_err; @@ -1482,7 +1482,7 @@ int hl_hw_block_mmap(struct hl_fpriv *hpriv, struct vm_area_struct *vma) return -EINVAL; } - lnode = kzalloc_obj(*lnode, GFP_KERNEL); + lnode = kzalloc_obj(*lnode); if (!lnode) return -ENOMEM; @@ -1553,7 +1553,7 @@ static struct sg_table *alloc_sgt_from_device_pages(struct hl_device *hdev, u64 return ERR_PTR(-EINVAL); } - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); @@ -2046,7 +2046,7 @@ static int export_dmabuf_from_addr(struct hl_ctx *ctx, u64 addr, u64 size, u64 o return -EINVAL; } - hl_dmabuf = kzalloc_obj(*hl_dmabuf, GFP_KERNEL); + hl_dmabuf = kzalloc_obj(*hl_dmabuf); if (!hl_dmabuf) return -ENOMEM; @@ -2323,7 +2323,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size, return -EFAULT; } - userptr->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); + userptr->pages = kvmalloc_objs(struct page *, npages); if (!userptr->pages) return -ENOMEM; @@ -2395,7 +2395,7 @@ int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size, } userptr->pid = current->pid; - userptr->sgt = kzalloc_obj(*userptr->sgt, GFP_KERNEL); + userptr->sgt = kzalloc_obj(*userptr->sgt); if (!userptr->sgt) return -ENOMEM; @@ -2611,7 +2611,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx, for (i = 0 ; i < HL_VA_RANGE_TYPE_MAX ; i++) { ctx->va_range[i] = - kzalloc_obj(struct hl_va_range, GFP_KERNEL); + kzalloc_obj(struct hl_va_range); if (!ctx->va_range[i]) { rc = -ENOMEM; goto free_va_range; diff --git a/drivers/accel/habanalabs/common/mmu/mmu.c b/drivers/accel/habanalabs/common/mmu/mmu.c index 8a661408af20..1f8f7cf2d3fb 100644 --- a/drivers/accel/habanalabs/common/mmu/mmu.c +++ b/drivers/accel/habanalabs/common/mmu/mmu.c @@ -697,7 +697,7 @@ int hl_mmu_prefetch_cache_range(struct hl_ctx *ctx, u32 flags, u32 asid, u64 va, { struct hl_prefetch_work *handle_prefetch_work; - handle_prefetch_work = kmalloc_obj(*handle_prefetch_work, GFP_KERNEL); + handle_prefetch_work = kmalloc_obj(*handle_prefetch_work); if (!handle_prefetch_work) return -ENOMEM; @@ -1072,7 +1072,7 @@ struct pgt_info *hl_mmu_hr_alloc_hop(struct hl_ctx *ctx, struct hl_mmu_hr_priv * void *virt_addr; int i, retry = 1; - pgt_info = kmalloc_obj(*pgt_info, GFP_KERNEL); + pgt_info = kmalloc_obj(*pgt_info); if (!pgt_info) return NULL; @@ -1326,7 +1326,7 @@ u64 hl_mmu_dr_alloc_hop(struct hl_ctx *ctx) struct pgt_info *pgt_info; u64 phys_addr, shadow_addr; - pgt_info = kmalloc_obj(*pgt_info, GFP_KERNEL); + pgt_info = kmalloc_obj(*pgt_info); if (!pgt_info) return ULLONG_MAX; diff --git a/drivers/accel/habanalabs/common/state_dump.c b/drivers/accel/habanalabs/common/state_dump.c index ec25d55d89e2..1c70a363a328 100644 --- a/drivers/accel/habanalabs/common/state_dump.c +++ b/drivers/accel/habanalabs/common/state_dump.c @@ -400,7 +400,7 @@ static int hl_state_dump_print_syncs(struct hl_device *hdev, u32 index; int rc = 0; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return -ENOMEM; diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c b/drivers/accel/habanalabs/gaudi/gaudi.c index e7dce0d57692..76fdf3b77b87 100644 --- a/drivers/accel/habanalabs/gaudi/gaudi.c +++ b/drivers/accel/habanalabs/gaudi/gaudi.c @@ -1852,7 +1852,7 @@ static int gaudi_sw_init(struct hl_device *hdev) int rc; /* Allocate device structure */ - gaudi = kzalloc_obj(*gaudi, GFP_KERNEL); + gaudi = kzalloc_obj(*gaudi); if (!gaudi) return -ENOMEM; @@ -4905,7 +4905,7 @@ static int gaudi_pin_memory_before_cs(struct hl_device *hdev, parser->job_userptr_list, &userptr)) goto already_pinned; - userptr = kzalloc_obj(*userptr, GFP_KERNEL); + userptr = kzalloc_obj(*userptr); if (!userptr) return -ENOMEM; @@ -8842,7 +8842,7 @@ static int gaudi_add_sync_to_engine_map_entry( reg_value -= lower_32_bits(CFG_BASE); /* create a new hash entry */ - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; entry->engine_type = engine_type; diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index e6690698cde4..91f46719931c 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -4057,7 +4057,7 @@ static int gaudi2_sw_init(struct hl_device *hdev) int i, rc; /* Allocate device structure */ - gaudi2 = kzalloc_obj(*gaudi2, GFP_KERNEL); + gaudi2 = kzalloc_obj(*gaudi2); if (!gaudi2) return -ENOMEM; diff --git a/drivers/accel/habanalabs/goya/goya.c b/drivers/accel/habanalabs/goya/goya.c index fb37a2339f12..f94a331f4c32 100644 --- a/drivers/accel/habanalabs/goya/goya.c +++ b/drivers/accel/habanalabs/goya/goya.c @@ -969,7 +969,7 @@ static int goya_sw_init(struct hl_device *hdev) int rc; /* Allocate device structure */ - goya = kzalloc_obj(*goya, GFP_KERNEL); + goya = kzalloc_obj(*goya); if (!goya) return -ENOMEM; @@ -1030,7 +1030,7 @@ static int goya_sw_init(struct hl_device *hdev) hdev->asic_funcs->set_pci_memory_regions(hdev); - goya->goya_work = kmalloc_obj(struct goya_work_freq, GFP_KERNEL); + goya->goya_work = kmalloc_obj(struct goya_work_freq); if (!goya->goya_work) { rc = -ENOMEM; goto free_cpu_accessible_dma_pool; @@ -3335,7 +3335,7 @@ static int goya_pin_memory_before_cs(struct hl_device *hdev, parser->job_userptr_list, &userptr)) goto already_pinned; - userptr = kzalloc_obj(*userptr, GFP_KERNEL); + userptr = kzalloc_obj(*userptr); if (!userptr) return -ENOMEM; diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c index ab910d201e68..5900a40c7a78 100644 --- a/drivers/accel/ivpu/ivpu_drv.c +++ b/drivers/accel/ivpu/ivpu_drv.c @@ -237,7 +237,7 @@ static int ivpu_open(struct drm_device *dev, struct drm_file *file) if (!drm_dev_enter(dev, &idx)) return -ENODEV; - file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv); if (!file_priv) { ret = -ENOMEM; goto err_dev_exit; diff --git a/drivers/accel/ivpu/ivpu_gem_userptr.c b/drivers/accel/ivpu/ivpu_gem_userptr.c index 7dcd127471bb..7cbf3a4cdc73 100644 --- a/drivers/accel/ivpu/ivpu_gem_userptr.c +++ b/drivers/accel/ivpu/ivpu_gem_userptr.c @@ -77,7 +77,7 @@ ivpu_create_userptr_dmabuf(struct ivpu_device *vdev, void __user *user_ptr, if (!(flags & DRM_IVPU_BO_READ_ONLY)) gup_flags |= FOLL_WRITE; - pages = kvmalloc_objs(*pages, nr_pages, GFP_KERNEL); + pages = kvmalloc_objs(*pages, nr_pages); if (!pages) return ERR_PTR(-ENOMEM); @@ -94,7 +94,7 @@ ivpu_create_userptr_dmabuf(struct ivpu_device *vdev, void __user *user_ptr, goto unpin_pages; } - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto unpin_pages; diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index cb478d946ae9..124f018667a9 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -98,7 +98,7 @@ static struct ivpu_cmdq *ivpu_cmdq_alloc(struct ivpu_file_priv *file_priv) struct ivpu_device *vdev = file_priv->vdev; struct ivpu_cmdq *cmdq; - cmdq = kzalloc_obj(*cmdq, GFP_KERNEL); + cmdq = kzalloc_obj(*cmdq); if (!cmdq) return NULL; @@ -491,7 +491,7 @@ static struct dma_fence *ivpu_fence_create(struct ivpu_device *vdev) { struct ivpu_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; diff --git a/drivers/accel/ivpu/ivpu_ms.c b/drivers/accel/ivpu/ivpu_ms.c index f3468c9533ca..be43851f5f32 100644 --- a/drivers/accel/ivpu/ivpu_ms.c +++ b/drivers/accel/ivpu/ivpu_ms.c @@ -59,7 +59,7 @@ int ivpu_ms_start_ioctl(struct drm_device *dev, void *data, struct drm_file *fil goto unlock; } - ms = kzalloc_obj(*ms, GFP_KERNEL); + ms = kzalloc_obj(*ms); if (!ms) { ret = -ENOMEM; goto unlock; diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_control.c index 517cd3a9cab2..f698d5dfd326 100644 --- a/drivers/accel/qaic/qaic_control.c +++ b/drivers/accel/qaic/qaic_control.c @@ -443,7 +443,7 @@ static int find_and_map_user_pages(struct qaic_device *qdev, goto put_pages; } - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto put_pages; @@ -582,7 +582,7 @@ static int encode_dma(struct qaic_device *qdev, void *trans, struct wrapper_list QAIC_MANAGE_WIRE_MSG_LENGTH) return -ENOMEM; - xfer = kmalloc_obj(*xfer, GFP_KERNEL); + xfer = kmalloc_obj(*xfer); if (!xfer) return -ENOMEM; @@ -1166,7 +1166,7 @@ static struct wrapper_list *alloc_wrapper_list(void) { struct wrapper_list *wrappers; - wrappers = kmalloc_obj(*wrappers, GFP_KERNEL); + wrappers = kmalloc_obj(*wrappers); if (!wrappers) return NULL; INIT_LIST_HEAD(&wrappers->list); diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c index 6405f849ad5f..95300c2f7d8a 100644 --- a/drivers/accel/qaic/qaic_data.c +++ b/drivers/accel/qaic/qaic_data.c @@ -213,7 +213,7 @@ static int clone_range_of_sgt_for_slice(struct qaic_device *qdev, struct sg_tabl goto out; } - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto out; @@ -399,13 +399,13 @@ static int qaic_map_one_slice(struct qaic_device *qdev, struct qaic_bo *bo, if (ret) goto out; - slice = kmalloc_obj(*slice, GFP_KERNEL); + slice = kmalloc_obj(*slice); if (!slice) { ret = -ENOMEM; goto free_sgt; } - slice->reqs = kvzalloc_objs(*slice->reqs, sgt->nents, GFP_KERNEL); + slice->reqs = kvzalloc_objs(*slice->reqs, sgt->nents); if (!slice->reqs) { ret = -ENOMEM; goto free_slice; @@ -507,7 +507,7 @@ static int create_sgt(struct qaic_device *qdev, struct sg_table **sgt_out, u64 s i++; } - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto free_partial_alloc; @@ -653,7 +653,7 @@ static struct sg_table *qaic_get_sg_table(struct drm_gem_object *obj) sgt_in = bo->sgt; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ static struct qaic_bo *qaic_alloc_init_bo(void) { struct qaic_bo *bo; - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c index 7127364068ae..63fb8c7b4abc 100644 --- a/drivers/accel/qaic/qaic_drv.c +++ b/drivers/accel/qaic/qaic_drv.c @@ -152,7 +152,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file) goto dev_unlock; } - usr = kmalloc_obj(*usr, GFP_KERNEL); + usr = kmalloc_obj(*usr); if (!usr) { ret = -ENOMEM; goto dev_unlock; diff --git a/drivers/accel/qaic/qaic_ras.c b/drivers/accel/qaic/qaic_ras.c index b488e6ef66c5..cc0b75461e1a 100644 --- a/drivers/accel/qaic/qaic_ras.c +++ b/drivers/accel/qaic/qaic_ras.c @@ -556,7 +556,7 @@ static int qaic_ras_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_devic if (ret) return ret; - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) { mhi_unprepare_from_transfer(mhi_dev); return -ENOMEM; diff --git a/drivers/accel/qaic/qaic_ssr.c b/drivers/accel/qaic/qaic_ssr.c index 77ac30498ad0..e3daeaad057d 100644 --- a/drivers/accel/qaic/qaic_ssr.c +++ b/drivers/accel/qaic/qaic_ssr.c @@ -260,7 +260,7 @@ static int send_xfer_done(struct qaic_device *qdev, void *resp, u32 dbc_id) struct ssr_debug_transfer_done *xfer_done; int ret; - xfer_done = kmalloc_obj(*xfer_done, GFP_KERNEL); + xfer_done = kmalloc_obj(*xfer_done); if (!xfer_done) { ret = -ENOMEM; goto out; @@ -450,7 +450,7 @@ static struct ssr_dump_info *alloc_dump_info(struct qaic_device *qdev, } /* Allocate SSR crashdump book keeping structure */ - dump_info = kzalloc_obj(*dump_info, GFP_KERNEL); + dump_info = kzalloc_obj(*dump_info); if (!dump_info) { ret = -ENOMEM; goto out; @@ -491,7 +491,7 @@ static int dbg_xfer_info_rsp(struct qaic_device *qdev, struct dma_bridge_chan *d struct ssr_crashdump *ssr_crash = NULL; int ret = 0, ret2; - debug_rsp = kmalloc_obj(*debug_rsp, GFP_KERNEL); + debug_rsp = kmalloc_obj(*debug_rsp); if (!debug_rsp) return -ENOMEM; @@ -641,7 +641,7 @@ static void ssr_worker(struct work_struct *work) break; } - event_rsp = kmalloc_obj(*event_rsp, GFP_KERNEL); + event_rsp = kmalloc_obj(*event_rsp); if (!event_rsp) break; diff --git a/drivers/accel/qaic/qaic_timesync.c b/drivers/accel/qaic/qaic_timesync.c index b2400d6b2f4f..939462b9958d 100644 --- a/drivers/accel/qaic/qaic_timesync.c +++ b/drivers/accel/qaic/qaic_timesync.c @@ -185,7 +185,7 @@ static int qaic_timesync_probe(struct mhi_device *mhi_dev, const struct mhi_devi struct timer_list *timer; int ret; - mqtsdev = kzalloc_obj(*mqtsdev, GFP_KERNEL); + mqtsdev = kzalloc_obj(*mqtsdev); if (!mqtsdev) { ret = -ENOMEM; goto out; @@ -196,7 +196,7 @@ static int qaic_timesync_probe(struct mhi_device *mhi_dev, const struct mhi_devi mqtsdev->qdev = qdev; mqtsdev->dev = &qdev->pdev->dev; - mqtsdev->sync_msg = kzalloc_obj(*mqtsdev->sync_msg, GFP_KERNEL); + mqtsdev->sync_msg = kzalloc_obj(*mqtsdev->sync_msg); if (!mqtsdev->sync_msg) { ret = -ENOMEM; goto free_mqts_dev; @@ -275,7 +275,7 @@ static void qaic_boot_timesync_worker(struct work_struct *work) switch (data.hdr.msg_type) { case QAIC_TS_CMD_TO_HOST: - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) break; @@ -304,7 +304,7 @@ static int qaic_boot_timesync_queue_resp(struct mhi_device *mhi_dev, struct qaic struct qts_resp *resp; int ret; - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) return -ENOMEM; diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c index f09c3800ab31..8bbbce594883 100644 --- a/drivers/accel/rocket/rocket_drv.c +++ b/drivers/accel/rocket/rocket_drv.c @@ -38,7 +38,7 @@ rocket_iommu_domain_destroy(struct kref *kref) static struct rocket_iommu_domain* rocket_iommu_domain_create(struct device *dev) { - struct rocket_iommu_domain *domain = kmalloc_obj(*domain, GFP_KERNEL); + struct rocket_iommu_domain *domain = kmalloc_obj(*domain); void *err; if (!domain) @@ -79,7 +79,7 @@ rocket_open(struct drm_device *dev, struct drm_file *file) if (!try_module_get(THIS_MODULE)) return -EINVAL; - rocket_priv = kzalloc_obj(*rocket_priv, GFP_KERNEL); + rocket_priv = kzalloc_obj(*rocket_priv); if (!rocket_priv) { ret = -ENOMEM; goto err_put_mod; diff --git a/drivers/accel/rocket/rocket_gem.c b/drivers/accel/rocket/rocket_gem.c index 3808dfc97916..b6a385d2edfc 100644 --- a/drivers/accel/rocket/rocket_gem.c +++ b/drivers/accel/rocket/rocket_gem.c @@ -48,7 +48,7 @@ struct drm_gem_object *rocket_gem_create_object(struct drm_device *dev, size_t s { struct rocket_gem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c index 518dd5779016..755971c13caf 100644 --- a/drivers/accel/rocket/rocket_job.c +++ b/drivers/accel/rocket/rocket_job.c @@ -45,7 +45,7 @@ static struct dma_fence *rocket_fence_create(struct rocket_core *core) { struct dma_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return ERR_PTR(-ENOMEM); @@ -71,7 +71,7 @@ rocket_copy_tasks(struct drm_device *dev, if (!rjob->task_count) return 0; - rjob->tasks = kvmalloc_objs(*rjob->tasks, job->task_count, GFP_KERNEL); + rjob->tasks = kvmalloc_objs(*rjob->tasks, job->task_count); if (!rjob->tasks) { drm_dbg(dev, "Failed to allocate task array\n"); return -ENOMEM; @@ -543,7 +543,7 @@ static int rocket_ioctl_submit_job(struct drm_device *dev, struct drm_file *file if (job->task_count == 0) return -EINVAL; - rjob = kzalloc_obj(*rjob, GFP_KERNEL); + rjob = kzalloc_obj(*rjob); if (!rjob) return -ENOMEM; @@ -610,7 +610,7 @@ int rocket_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil return -EINVAL; } - jobs = kvmalloc_objs(*jobs, args->job_count, GFP_KERNEL); + jobs = kvmalloc_objs(*jobs, args->job_count); if (!jobs) { drm_dbg(dev, "Failed to allocate incoming job array\n"); return -ENOMEM; diff --git a/drivers/accessibility/speakup/spk_ttyio.c b/drivers/accessibility/speakup/spk_ttyio.c index a9aab12a7836..6bff78e3d872 100644 --- a/drivers/accessibility/speakup/spk_ttyio.c +++ b/drivers/accessibility/speakup/spk_ttyio.c @@ -55,7 +55,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty) if (!tty->ops->write) return -EOPNOTSUPP; - ldisc_data = kmalloc_obj(*ldisc_data, GFP_KERNEL); + ldisc_data = kmalloc_obj(*ldisc_data); if (!ldisc_data) return -ENOMEM; diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 94049a15f7b9..c5d77c3cb4bc 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -208,7 +208,7 @@ static int acpi_ac_probe(struct platform_device *pdev) struct acpi_ac *ac; int result; - ac = kzalloc_obj(struct acpi_ac, GFP_KERNEL); + ac = kzalloc_obj(struct acpi_ac); if (!ac) return -ENOMEM; diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index d9cd3f97aa00..bed0791c17fc 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -202,7 +202,7 @@ static int acpi_apd_create_device(struct acpi_device *adev, return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1; } - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return -ENOMEM; diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c index c20bedff2c04..12ffec795803 100644 --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c @@ -210,7 +210,7 @@ static struct config_item *acpi_table_make_item(struct config_group *group, { struct acpi_table *table; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 5ec5a841afce..8f1aeae8b72e 100644 --- a/drivers/acpi/acpi_ipmi.c +++ b/drivers/acpi/acpi_ipmi.c @@ -117,7 +117,7 @@ ipmi_dev_alloc(int iface, struct device *dev, acpi_handle handle) int err; struct ipmi_user *user; - ipmi_device = kzalloc_obj(*ipmi_device, GFP_KERNEL); + ipmi_device = kzalloc_obj(*ipmi_device); if (!ipmi_device) return NULL; @@ -197,7 +197,7 @@ static struct acpi_ipmi_msg *ipmi_msg_alloc(void) if (!ipmi) return NULL; - ipmi_msg = kzalloc_obj(struct acpi_ipmi_msg, GFP_KERNEL); + ipmi_msg = kzalloc_obj(struct acpi_ipmi_msg); if (!ipmi_msg) { acpi_ipmi_dev_put(ipmi); return NULL; diff --git a/drivers/acpi/acpi_lpat.c b/drivers/acpi/acpi_lpat.c index b238f9f371dd..6141c9070eca 100644 --- a/drivers/acpi/acpi_lpat.c +++ b/drivers/acpi/acpi_lpat.c @@ -104,7 +104,7 @@ struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle (obj_p->package.count % 2) || (obj_p->package.count < 4)) goto out; - lpat = kzalloc_objs(int, obj_p->package.count, GFP_KERNEL); + lpat = kzalloc_objs(int, obj_p->package.count); if (!lpat) goto out; @@ -117,7 +117,7 @@ struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle lpat[i] = (s64)obj_e->integer.value; } - lpat_table = kzalloc_obj(*lpat_table, GFP_KERNEL); + lpat_table = kzalloc_obj(*lpat_table); if (!lpat_table) { kfree(lpat); goto out; diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index f12a9766696b..02a472fa85fc 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -80,7 +80,7 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context) } } - new = kzalloc_obj(struct acpi_memory_info, GFP_KERNEL); + new = kzalloc_obj(struct acpi_memory_info); if (!new) return AE_ERROR; @@ -290,7 +290,7 @@ static int acpi_memory_device_add(struct acpi_device *device, if (!device) return -EINVAL; - mem_device = kzalloc_obj(struct acpi_memory_device, GFP_KERNEL); + mem_device = kzalloc_obj(struct acpi_memory_device); if (!mem_device) return -ENOMEM; diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c index df771e49333f..e99cbda83452 100644 --- a/drivers/acpi/acpi_mrrm.c +++ b/drivers/acpi/acpi_mrrm.c @@ -161,7 +161,7 @@ static __init int add_boot_memory_ranges(void) if (!pkobj) return -ENOMEM; - kobjs = kzalloc_objs(*kobjs, mrrm_mem_entry_num, GFP_KERNEL); + kobjs = kzalloc_objs(*kobjs, mrrm_mem_entry_num); if (!kobjs) { kobject_put(pkobj); return -ENOMEM; diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c index 6914071d640b..438c67189511 100644 --- a/drivers/acpi/acpi_pcc.c +++ b/drivers/acpi/acpi_pcc.c @@ -54,7 +54,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, struct pcc_mbox_chan *pcc_chan; acpi_status ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return AE_NO_MEMORY; diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 3ea6d941aabd..64199b19ceff 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -145,7 +145,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, if (count > 0) { struct resource_entry *rentry; - resources = kzalloc_objs(*resources, count, GFP_KERNEL); + resources = kzalloc_objs(*resources, count); if (!resources) { acpi_dev_free_resource_list(&resource_list); return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 02a80803962c..b34a48068a8d 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -428,7 +428,7 @@ static int acpi_processor_add(struct acpi_device *device, if (!acpi_device_is_enabled(device)) return -ENODEV; - pr = kzalloc_obj(struct acpi_processor, GFP_KERNEL); + pr = kzalloc_obj(struct acpi_processor); if (!pr) return -ENOMEM; diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index a2e07d946ce3..5f4751478752 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -825,7 +825,7 @@ int acpi_video_get_levels(struct acpi_device *device, goto out; } - br = kzalloc_obj(*br, GFP_KERNEL); + br = kzalloc_obj(*br); if (!br) { result = -ENOMEM; goto out; @@ -1141,7 +1141,7 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg) if (acpi_get_local_u64_address(device->handle, &device_id)) goto exit; - data = kzalloc_obj(struct acpi_video_device, GFP_KERNEL); + data = kzalloc_obj(struct acpi_video_device); if (!data) { dev_dbg(&device->dev, "Cannot attach\n"); return -ENOMEM; @@ -2003,7 +2003,7 @@ static int acpi_video_bus_probe(struct platform_device *pdev) return -ENODEV; } - video = kzalloc_obj(struct acpi_video_bus, GFP_KERNEL); + video = kzalloc_obj(struct acpi_video_bus); if (!video) return -ENOMEM; diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 7e22fc35ed6d..c04f242a6aa2 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c @@ -166,7 +166,7 @@ void __init acpi_watchdog_init(void) } } - resources = kzalloc_objs(*resources, nresources, GFP_KERNEL); + resources = kzalloc_objs(*resources, nresources); if (!resources) goto fail_free_resource_list; diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 95b8483b9e98..7a06d30bd40e 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c @@ -316,7 +316,7 @@ repeat: if (res_ins) list_add(&res_ins->list, res_list); else { - res_ins = kmalloc_obj(*res_ins, GFP_KERNEL); + res_ins = kmalloc_obj(*res_ins); if (!res_ins) return -ENOMEM; res_ins->start = start; @@ -345,7 +345,7 @@ static int apei_res_sub(struct list_head *res_list1, break; } else if (res1->end > res2->end && res1->start < res2->start) { - res = kmalloc_obj(*res, GFP_KERNEL); + res = kmalloc_obj(*res); if (!res) return -ENOMEM; res->start = res2->end; diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 442561637f88..8acd2742bb27 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -272,7 +272,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic) unsigned int error_block_length; int rc; - ghes = kzalloc_obj(*ghes, GFP_KERNEL); + ghes = kzalloc_obj(*ghes); if (!ghes) return ERR_PTR(-ENOMEM); diff --git a/drivers/acpi/arm64/ffh.c b/drivers/acpi/arm64/ffh.c index d850af765ba1..04380bab193d 100644 --- a/drivers/acpi/arm64/ffh.c +++ b/drivers/acpi/arm64/ffh.c @@ -33,7 +33,7 @@ int acpi_ffh_address_space_arch_setup(void *handler_ctxt, void **region_ctxt) return -EOPNOTSUPP; } - ffh_ctxt = kzalloc_obj(*ffh_ctxt, GFP_KERNEL); + ffh_ctxt = kzalloc_obj(*ffh_ctxt); if (!ffh_ctxt) return -ENOMEM; diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 8e74b4eaf9bd..af7a9b2fd5bc 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -165,7 +165,7 @@ int iort_register_domain_token(int trans_id, phys_addr_t base, { struct iort_its_msi_chip *its_msi_chip; - its_msi_chip = kzalloc_obj(*its_msi_chip, GFP_KERNEL); + its_msi_chip = kzalloc_obj(*its_msi_chip); if (!its_msi_chip) return -ENOMEM; @@ -938,7 +938,7 @@ static struct iommu_iort_rmr_data *iort_rmr_alloc( u32 *sids_copy; u64 addr = rmr_desc->base_address, size = rmr_desc->length; - rmr_data = kmalloc_obj(*rmr_data, GFP_KERNEL); + rmr_data = kmalloc_obj(*rmr_data); if (!rmr_data) return NULL; @@ -1942,7 +1942,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node, count = ops->dev_count_resources(node); - r = kzalloc_objs(*r, count, GFP_KERNEL); + r = kzalloc_objs(*r, count); if (!r) { ret = -ENOMEM; goto dev_put; diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index b9929b6ef62d..97b05246efab 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -544,7 +544,7 @@ static int acpi_button_probe(struct platform_device *pdev) lid_init_state == ACPI_BUTTON_LID_INIT_DISABLED) return -ENODEV; - button = kzalloc_obj(struct acpi_button, GFP_KERNEL); + button = kzalloc_obj(struct acpi_button); if (!button) return -ENOMEM; diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 055ad5f4782d..f138a433554a 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c @@ -52,7 +52,7 @@ static int container_device_attach(struct acpi_device *adev, if (adev->flags.is_dock_station) return 0; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return -ENOMEM; diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index d2e13252fce6..5c2116171789 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -712,7 +712,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) out_obj = (union acpi_object *) output.pointer; - cpc_ptr = kzalloc_obj(struct cpc_desc, GFP_KERNEL); + cpc_ptr = kzalloc_obj(struct cpc_desc); if (!cpc_ptr) { ret = -ENOMEM; goto out_buf_free; diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index e2239d4bb9df..d7f3a8912e6a 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -73,7 +73,7 @@ static int add_dock_dependent_device(struct dock_station *ds, { struct dock_dependent_device *dd; - dd = kzalloc_obj(*dd, GFP_KERNEL); + dd = kzalloc_obj(*dd); if (!dd) return -ENOMEM; diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 8da0971f2238..5f63ed120a2c 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1100,7 +1100,7 @@ int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, if (!handle && !func) return -EINVAL; - handler = kzalloc_obj(*handler, GFP_KERNEL); + handler = kzalloc_obj(*handler); if (!handler) return -ENOMEM; @@ -1177,7 +1177,7 @@ static struct acpi_ec_query *acpi_ec_create_query(struct acpi_ec *ec, u8 *pval) struct acpi_ec_query *q; struct transaction *t; - q = kzalloc_obj(struct acpi_ec_query, GFP_KERNEL); + q = kzalloc_obj(struct acpi_ec_query); if (!q) return NULL; @@ -1422,7 +1422,7 @@ static void acpi_ec_free(struct acpi_ec *ec) static struct acpi_ec *acpi_ec_alloc(void) { - struct acpi_ec *ec = kzalloc_obj(struct acpi_ec, GFP_KERNEL); + struct acpi_ec *ec = kzalloc_obj(struct acpi_ec); if (!ec) return NULL; diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index e96def7db715..b1776809279d 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -246,7 +246,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) acpi_dev_get(acpi_dev); get_device(dev); - physical_node = kzalloc_obj(*physical_node, GFP_KERNEL); + physical_node = kzalloc_obj(*physical_node); if (!physical_node) { retval = -ENOMEM; goto err; diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 5a432899875b..533ddd75922b 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -120,7 +120,7 @@ static acpi_status handle_ioapic_add(acpi_handle handle, u32 lvl, goto exit; } - ioapic = kzalloc_obj(*ioapic, GFP_KERNEL); + ioapic = kzalloc_obj(*ioapic); if (!ioapic) { pr_err("cannot allocate memory for new IOAPIC\n"); goto exit; diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index 6351a66c555d..328093ed7136 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -111,7 +111,7 @@ static struct crs_csi2 *acpi_mipi_add_crs_csi2(acpi_handle handle, { struct crs_csi2 *csi2; - csi2 = kzalloc_obj(*csi2, GFP_KERNEL); + csi2 = kzalloc_obj(*csi2); if (!csi2) return NULL; diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index b59dcbff25c1..d13264fb9e02 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2271,9 +2271,9 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, { u16 nr = ndr_desc->num_mappings; struct nfit_set_info2 *info2 __free(kfree) = - kzalloc_objs(*info2, nr, GFP_KERNEL); + kzalloc_objs(*info2, nr); struct nfit_set_info *info __free(kfree) = - kzalloc_objs(*info, nr, GFP_KERNEL); + kzalloc_objs(*info, nr); struct device *dev = acpi_desc->dev; struct nd_interleave_set *nd_set; int i; diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 3f68ba64537d..9792dc394756 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -202,7 +202,7 @@ static __init void alloc_memory_initiator(unsigned int cpu_pxm) if (initiator) return; - initiator = kzalloc_obj(*initiator, GFP_KERNEL); + initiator = kzalloc_obj(*initiator); if (!initiator) return; @@ -217,7 +217,7 @@ static __init struct memory_target *alloc_target(unsigned int mem_pxm) target = find_mem_target(mem_pxm); if (!target) { - target = kzalloc_obj(*target, GFP_KERNEL); + target = kzalloc_obj(*target); if (!target) return NULL; target->memory_pxm = mem_pxm; @@ -371,7 +371,7 @@ static __init void hmat_add_locality(struct acpi_hmat_locality *hmat_loc) { struct memory_locality *loc; - loc = kzalloc_obj(*loc, GFP_KERNEL); + loc = kzalloc_obj(*loc); if (!loc) { pr_notice_once("Failed to allocate HMAT locality\n"); return; @@ -502,7 +502,7 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header, if (!target) return 0; - tcache = kzalloc_obj(*tcache, GFP_KERNEL); + tcache = kzalloc_obj(*tcache); if (!tcache) { pr_notice_once("Failed to allocate HMAT cache info\n"); return 0; diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c index 354783ede8f1..6eaad7dd0241 100644 --- a/drivers/acpi/nvs.c +++ b/drivers/acpi/nvs.c @@ -39,7 +39,7 @@ int acpi_nvs_register(__u64 start, __u64 size) { struct nvs_region *region; - region = kmalloc_obj(*region, GFP_KERNEL); + region = kmalloc_obj(*region); if (!region) return -ENOMEM; region->phys_start = start; @@ -102,7 +102,7 @@ static int suspend_nvs_register(unsigned long start, unsigned long size) while (size > 0) { unsigned int nr_bytes; - entry = kzalloc_obj(struct nvs_page, GFP_KERNEL); + entry = kzalloc_obj(struct nvs_page); if (!entry) goto Error; diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0fa12dd40840..5b777316b9ac 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -344,7 +344,7 @@ void __iomem __ref goto out; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { mutex_unlock(&acpi_ioremap_lock); return NULL; @@ -1197,7 +1197,7 @@ acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src) "Scheduling hotplug event %u for deferred handling\n", src); - hpw = kmalloc_obj(*hpw, GFP_KERNEL); + hpw = kmalloc_obj(*hpw); if (!hpw) return AE_NO_MEMORY; diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 5a4169db5ea6..8558f0ef64e3 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -147,7 +147,7 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev, prt->pin + 1 != pin) return -ENODEV; - entry = kzalloc_obj(struct acpi_prt_entry, GFP_KERNEL); + entry = kzalloc_obj(struct acpi_prt_entry); if (!entry) return -ENOMEM; diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index e3b03237fa57..45bdfd06bd21 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -720,7 +720,7 @@ static int acpi_pci_link_add(struct acpi_device *device, int result; int i; - link = kzalloc_obj(struct acpi_pci_link, GFP_KERNEL); + link = kzalloc_obj(struct acpi_pci_link); if (!link) return -ENOMEM; diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index 99a50e9c12dd..0782a5d839bf 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -304,7 +304,7 @@ static __init int pci_mcfg_parse(struct acpi_table_header *header) mcfg = (struct acpi_table_mcfg *)header; mptr = (struct acpi_mcfg_allocation *) &mcfg[1]; - arr = kzalloc_objs(*arr, n, GFP_KERNEL); + arr = kzalloc_objs(*arr, n); if (!arr) return -ENOMEM; diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index bd2525fcda8e..4a882e939525 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -648,7 +648,7 @@ static int acpi_pci_root_add(struct acpi_device *device, bool hotadd = system_state == SYSTEM_RUNNING; const char *acpi_hid; - root = kzalloc_obj(struct acpi_pci_root, GFP_KERNEL); + root = kzalloc_obj(struct acpi_pci_root); if (!root) return -ENOMEM; diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index 031d00a4a75f..33a123074071 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -104,7 +104,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) return AE_OK; } - slot = kmalloc_obj(*slot, GFP_KERNEL); + slot = kmalloc_obj(*slot); if (!slot) return AE_OK; diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index e377446b5cce..4611159ee734 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -104,7 +104,7 @@ static int acpi_power_resources_list_add(acpi_handle handle, if (!resource || !list) return -EINVAL; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -265,7 +265,7 @@ acpi_power_resource_add_dependent(struct acpi_power_resource *resource, goto unlock; } - dep = kzalloc_obj(*dep, GFP_KERNEL); + dep = kzalloc_obj(*dep); if (!dep) { ret = -ENOMEM; goto unlock; @@ -945,7 +945,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) if (device) return device; - resource = kzalloc_obj(*resource, GFP_KERNEL); + resource = kzalloc_obj(*resource); if (!resource) return NULL; diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index 5d4b0f7904d6..7f5851371e5f 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -135,7 +135,7 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) goto parse_prmt_out4; memmove(tm->mmio_info, temp_mmio, mmio_range_size); } else { - tm->mmio_info = kmalloc_obj(*tm->mmio_info, GFP_KERNEL); + tm->mmio_info = kmalloc_obj(*tm->mmio_info); if (!tm->mmio_info) goto parse_prmt_out2; diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index aa7020d71b55..f6c72e3a2be1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -910,7 +910,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle, goto end; } - lpi_state = kzalloc_objs(*lpi_state, pkg_count, GFP_KERNEL); + lpi_state = kzalloc_objs(*lpi_state, pkg_count); if (!lpi_state) { ret = -ENOMEM; goto end; @@ -1417,7 +1417,7 @@ void acpi_processor_power_init(struct acpi_processor *pr) if (!pr->flags.power) return; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return; diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index e174d144f1d9..a46bd9876b11 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c @@ -32,11 +32,11 @@ static struct acpi_object_list *acpi_processor_alloc_pdc(void) u32 *buf; /* allocate and initialize pdc. It will be used later. */ - obj_list = kmalloc_obj(struct acpi_object_list, GFP_KERNEL); + obj_list = kmalloc_obj(struct acpi_object_list); if (!obj_list) goto out; - obj = kmalloc_obj(union acpi_object, GFP_KERNEL); + obj = kmalloc_obj(union acpi_object); if (!obj) { kfree(obj_list); goto out; diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 710dccae595b..8ee5a1f0eb48 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -89,7 +89,7 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc, if (acpi_graph_ignore_port(handle)) return false; - dn = kzalloc_obj(*dn, GFP_KERNEL); + dn = kzalloc_obj(*dn); if (!dn) return false; @@ -383,7 +383,7 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid, { struct acpi_device_properties *props; - props = kzalloc_obj(*props, GFP_KERNEL); + props = kzalloc_obj(*props); if (props) { INIT_LIST_HEAD(&props->list); props->guid = guid; diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c index f3cef56ff59e..c1f759fb5758 100644 --- a/drivers/acpi/riscv/irq.c +++ b/drivers/acpi/riscv/irq.c @@ -136,7 +136,7 @@ static int __init riscv_acpi_register_ext_intc(u32 gsi_base, u32 nr_irqs, u32 nr { struct riscv_ext_intc_list *ext_intc_element, *node, *prev; - ext_intc_element = kzalloc_obj(*ext_intc_element, GFP_KERNEL); + ext_intc_element = kzalloc_obj(*ext_intc_element); if (!ext_intc_element) return -ENOMEM; diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index bcbd02d665d5..bbd3938f7b52 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -636,7 +636,7 @@ static int acpi_sbs_probe(struct platform_device *pdev) int result = 0; int id; - sbs = kzalloc_obj(struct acpi_sbs, GFP_KERNEL); + sbs = kzalloc_obj(struct acpi_sbs); if (!sbs) { result = -ENOMEM; goto end; diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index 969c1da7a015..36850831910b 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c @@ -254,7 +254,7 @@ static int acpi_smbus_hc_probe(struct platform_device *pdev) strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); - hc = kzalloc_obj(struct acpi_smb_hc, GFP_KERNEL); + hc = kzalloc_obj(struct acpi_smb_hc); if (!hc) return -ENOMEM; mutex_init(&hc->lock); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 490242bf161b..a6f453d4785b 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1330,7 +1330,7 @@ static void acpi_add_id(struct acpi_device_pnp *pnp, const char *dev_id) { struct acpi_hardware_id *id; - id = kmalloc_obj(*id, GFP_KERNEL); + id = kmalloc_obj(*id); if (!id) return; @@ -1568,7 +1568,7 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map) ret = acpi_dev_get_dma_resources(adev, &list); if (ret > 0) { - r = kzalloc_objs(*r, ret + 1, GFP_KERNEL); + r = kzalloc_objs(*r, ret + 1); if (!r) { ret = -ENOMEM; goto out; @@ -1863,7 +1863,7 @@ static int acpi_add_single_object(struct acpi_device **child, bool release_dep_lock = false; int result; - device = kzalloc_obj(struct acpi_device, GFP_KERNEL); + device = kzalloc_obj(struct acpi_device); if (!device) return -ENOMEM; @@ -2028,7 +2028,7 @@ int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices) if (skip) continue; - dep = kzalloc_obj(*dep, GFP_KERNEL); + dep = kzalloc_obj(*dep); if (!dep) continue; @@ -2225,7 +2225,7 @@ static void acpi_default_enumeration(struct acpi_device *device) * other device objects have been processed and PCI has claimed * BARs in case there are resource conflicts. */ - sd = kmalloc_obj(*sd, GFP_KERNEL); + sd = kmalloc_obj(*sd); if (sd) { sd->adev = device; list_add_tail(&sd->node, &acpi_scan_system_dev_list); @@ -2899,7 +2899,7 @@ void acpi_scan_table_notify(void) if (!acpi_scan_initialized) return; - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) return; diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 44ea37f998e6..a625de3c3c8b 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -385,7 +385,7 @@ acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context) switch (event) { case ACPI_TABLE_EVENT_INSTALL: - table_attr = kzalloc_obj(*table_attr, GFP_KERNEL); + table_attr = kzalloc_obj(*table_attr); if (!table_attr) return AE_NO_MEMORY; @@ -491,7 +491,7 @@ static int acpi_table_data_init(struct acpi_table_header *th) for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) { if (ACPI_COMPARE_NAMESEG(th->signature, acpi_data_objs[i].name)) { - data_attr = kzalloc_obj(*data_attr, GFP_KERNEL); + data_attr = kzalloc_obj(*data_attr); if (!data_attr) return -ENOMEM; sysfs_attr_init(&data_attr->attr.attr); @@ -532,7 +532,7 @@ static int acpi_tables_sysfs_init(void) if (ACPI_FAILURE(status)) continue; - table_attr = kzalloc_obj(*table_attr, GFP_KERNEL); + table_attr = kzalloc_obj(*table_attr); if (!table_attr) return -ENOMEM; @@ -864,11 +864,11 @@ void acpi_irq_stats_init(void) num_gpes = acpi_current_gpe_count; num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA; - all_attrs = kzalloc_objs(*all_attrs, num_counters + 1, GFP_KERNEL); + all_attrs = kzalloc_objs(*all_attrs, num_counters + 1); if (all_attrs == NULL) return; - all_counters = kzalloc_objs(*all_counters, num_counters, GFP_KERNEL); + all_counters = kzalloc_objs(*all_counters, num_counters); if (all_counters == NULL) goto fail; @@ -876,7 +876,7 @@ void acpi_irq_stats_init(void) if (ACPI_FAILURE(status)) goto fail; - counter_attrs = kzalloc_objs(*counter_attrs, num_counters, GFP_KERNEL); + counter_attrs = kzalloc_objs(*counter_attrs, num_counters); if (counter_attrs == NULL) goto fail; diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index b2a1e1773840..64356b004a57 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -792,7 +792,7 @@ static int acpi_thermal_probe(struct platform_device *pdev) if (!device) return -EINVAL; - tz = kzalloc_obj(struct acpi_thermal, GFP_KERNEL); + tz = kzalloc_obj(struct acpi_thermal); if (!tz) return -ENOMEM; diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 67b9a17e33ec..6ab27e4826d1 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -365,7 +365,7 @@ bool acpi_evaluate_reference(acpi_handle handle, acpi_string pathname, goto err; list->count = package->package.count; - list->handles = kzalloc_objs(*list->handles, list->count, GFP_KERNEL); + list->handles = kzalloc_objs(*list->handles, list->count); if (!list->handles) goto err_clear; diff --git a/drivers/acpi/viot.c b/drivers/acpi/viot.c index 26fe65dd4a6c..c05fcc060e63 100644 --- a/drivers/acpi/viot.c +++ b/drivers/acpi/viot.c @@ -142,7 +142,7 @@ static struct viot_iommu * __init viot_get_iommu(unsigned int offset) if (viot_check_bounds(hdr)) return NULL; - viommu = kzalloc_obj(*viommu, GFP_KERNEL); + viommu = kzalloc_obj(*viommu); if (!viommu) return NULL; @@ -193,7 +193,7 @@ static int __init viot_parse_node(const struct acpi_viot_header *hdr) hdr->type == ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO) return 0; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c index f82e6f3127b6..0cbee0f06f0d 100644 --- a/drivers/acpi/wakeup.c +++ b/drivers/acpi/wakeup.c @@ -120,7 +120,7 @@ int acpi_register_wakeup_handler(int wake_irq, bool (*wakeup)(void *context), if (!acpi_sci_irq_valid() || wake_irq != acpi_sci_irq) return 0; - handler = kmalloc_obj(*handler, GFP_KERNEL); + handler = kmalloc_obj(*handler); if (!handler) return -ENOMEM; diff --git a/drivers/acpi/x86/lpss.c b/drivers/acpi/x86/lpss.c index 3dfb8c2400f5..0171eef00484 100644 --- a/drivers/acpi/x86/lpss.c +++ b/drivers/acpi/x86/lpss.c @@ -623,7 +623,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev, if (!dev_desc) return -EINVAL; - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return -ENOMEM; diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 9d3d4607c5f2..6d479caf89cb 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -611,7 +611,7 @@ struct amba_device *amba_device_alloc(const char *name, resource_size_t base, { struct amba_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev) { amba_device_initialize(dev, name); dev->res.start = base; diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 3cb7798873bb..0dccb4526a7c 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -795,7 +795,7 @@ static struct binder_node *binder_new_node(struct binder_proc *proc, struct flat_binder_object *fp) { struct binder_node *node; - struct binder_node *new_node = kzalloc_obj(*node, GFP_KERNEL); + struct binder_node *new_node = kzalloc_obj(*node); if (!new_node) return NULL; @@ -1469,7 +1469,7 @@ static int binder_inc_ref_for_node(struct binder_proc *proc, ref = binder_get_ref_for_node_olocked(proc, node, NULL); if (!ref) { binder_proc_unlock(proc); - new_ref = kzalloc_obj(*ref, GFP_KERNEL); + new_ref = kzalloc_obj(*ref); if (!new_ref) return -ENOMEM; binder_proc_lock(proc); @@ -2009,7 +2009,7 @@ static void binder_deferred_fd_close(int fd) { struct binder_task_work_cb *twcb; - twcb = kzalloc_obj(*twcb, GFP_KERNEL); + twcb = kzalloc_obj(*twcb); if (!twcb) return; init_task_work(&twcb->twork, binder_do_fd_close); @@ -2386,7 +2386,7 @@ static int binder_translate_fd(u32 fd, binder_size_t fd_offset, * of the fd in the target needs to be done from a * target thread. */ - fixup = kzalloc_obj(*fixup, GFP_KERNEL); + fixup = kzalloc_obj(*fixup); if (!fixup) { ret = -ENOMEM; goto err_alloc; @@ -2579,7 +2579,7 @@ static void binder_cleanup_deferred_txn_lists(struct list_head *sgc_head, static int binder_defer_copy(struct list_head *sgc_head, binder_size_t offset, const void __user *sender_uaddr, size_t length) { - struct binder_sg_copy *bc = kzalloc_obj(*bc, GFP_KERNEL); + struct binder_sg_copy *bc = kzalloc_obj(*bc); if (!bc) return -ENOMEM; @@ -2622,7 +2622,7 @@ static int binder_defer_copy(struct list_head *sgc_head, binder_size_t offset, static int binder_add_fixup(struct list_head *pf_head, binder_size_t offset, binder_uintptr_t fixup, size_t skip_size) { - struct binder_ptr_fixup *pf = kzalloc_obj(*pf, GFP_KERNEL); + struct binder_ptr_fixup *pf = kzalloc_obj(*pf); struct binder_ptr_fixup *tmppf; if (!pf) @@ -3101,7 +3101,7 @@ static void binder_transaction(struct binder_proc *proc, binder_set_extended_error(&thread->ee, t_debug_id, BR_OK, 0); binder_inner_proc_unlock(proc); - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) { binder_txn_error("%d:%d cannot allocate transaction\n", thread->pid, proc->pid); @@ -3320,7 +3320,7 @@ static void binder_transaction(struct binder_proc *proc, e->to_thread = target_thread->pid; e->to_proc = target_proc->pid; - tcomplete = kzalloc_obj(*tcomplete, GFP_KERNEL); + tcomplete = kzalloc_obj(*tcomplete); if (tcomplete == NULL) { binder_txn_error("%d:%d cannot allocate work for transaction\n", thread->pid, proc->pid); @@ -3926,7 +3926,7 @@ binder_request_freeze_notification(struct binder_proc *proc, struct binder_ref_freeze *freeze; struct binder_ref *ref; - freeze = kzalloc_obj(*freeze, GFP_KERNEL); + freeze = kzalloc_obj(*freeze); if (!freeze) return -ENOMEM; binder_proc_lock(proc); @@ -4394,7 +4394,7 @@ static int binder_thread_write(struct binder_proc *proc, * Allocate memory for death notification * before taking lock */ - death = kzalloc_obj(*death, GFP_KERNEL); + death = kzalloc_obj(*death); if (death == NULL) { WARN_ON(thread->return_error.cmd != BR_OK); @@ -5293,7 +5293,7 @@ static struct binder_thread *binder_get_thread(struct binder_proc *proc) thread = binder_get_thread_ilocked(proc, NULL); binder_inner_proc_unlock(proc); if (!thread) { - new_thread = kzalloc_obj(*thread, GFP_KERNEL); + new_thread = kzalloc_obj(*thread); if (new_thread == NULL) return NULL; binder_inner_proc_lock(proc); @@ -6060,7 +6060,7 @@ static int binder_open(struct inode *nodp, struct file *filp) binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__, current->tgid, current->pid); - proc = kzalloc_obj(*proc, GFP_KERNEL); + proc = kzalloc_obj(*proc); if (proc == NULL) return -ENOMEM; @@ -7064,7 +7064,7 @@ static int __init init_binder_device(const char *name) int ret; struct binder_device *binder_device; - binder_device = kzalloc_obj(*binder_device, GFP_KERNEL); + binder_device = kzalloc_obj(*binder_device); if (!binder_device) return -ENOMEM; diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c index 2b640f6eddc2..ade1c4d92499 100644 --- a/drivers/android/binder/rust_binderfs.c +++ b/drivers/android/binder/rust_binderfs.c @@ -145,7 +145,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, mutex_unlock(&binderfs_minors_mutex); ret = -ENOMEM; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) goto err; @@ -387,7 +387,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) bool use_reserve = true; #endif - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return -ENOMEM; @@ -642,7 +642,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_op = &binderfs_super_ops; sb->s_time_gran = 1; - sb->s_fs_info = kzalloc_obj(struct binderfs_info, GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(struct binderfs_info); if (!sb->s_fs_info) return -ENOMEM; info = sb->s_fs_info; @@ -721,7 +721,7 @@ static int binderfs_init_fs_context(struct fs_context *fc) { struct binderfs_mount_opts *ctx; - ctx = kzalloc_obj(struct binderfs_mount_opts, GFP_KERNEL); + ctx = kzalloc_obj(struct binderfs_mount_opts); if (!ctx) return -ENOMEM; diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index aab88f2347eb..4dd3415d8fdb 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -289,7 +289,7 @@ static struct page *binder_page_alloc(struct binder_alloc *alloc, return NULL; /* allocate and install shrinker metadata under page->private */ - mdata = kzalloc_obj(*mdata, GFP_KERNEL); + mdata = kzalloc_obj(*mdata); if (!mdata) { __free_page(page); return NULL; @@ -672,7 +672,7 @@ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, } /* Preallocate the next buffer */ - next = kzalloc_obj(*next, GFP_KERNEL); + next = kzalloc_obj(*next); if (!next) return ERR_PTR(-ENOMEM); @@ -924,7 +924,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, goto err_alloc_pages_failed; } - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) { ret = -ENOMEM; failure_string = "alloc buffer struct"; diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 73a7c3b54f21..361d69f756f5 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -145,7 +145,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, mutex_unlock(&binderfs_minors_mutex); ret = -ENOMEM; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) goto err; @@ -396,7 +396,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) bool use_reserve = true; #endif - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return -ENOMEM; @@ -638,7 +638,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_op = &binderfs_super_ops; sb->s_time_gran = 1; - sb->s_fs_info = kzalloc_obj(struct binderfs_info, GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(struct binderfs_info); if (!sb->s_fs_info) return -ENOMEM; info = sb->s_fs_info; @@ -717,7 +717,7 @@ static int binderfs_init_fs_context(struct fs_context *fc) { struct binderfs_mount_opts *ctx; - ctx = kzalloc_obj(struct binderfs_mount_opts, GFP_KERNEL); + ctx = kzalloc_obj(struct binderfs_mount_opts); if (!ctx) return -ENOMEM; diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index a618313dea03..4433f626246b 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -194,7 +194,7 @@ void ata_acpi_bind_port(struct ata_port *ap) if (!adev || adev->hp) return; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return; @@ -236,7 +236,7 @@ void ata_acpi_bind_dev(struct ata_device *dev) if (!adev || adev->hp) return; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return; diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 02dde2517122..8ef2619c129c 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2557,7 +2557,7 @@ static int ata_dev_init_cdl_resources(struct ata_device *dev) unsigned int err_mask; if (!cdl) { - cdl = kzalloc_obj(*cdl, GFP_KERNEL); + cdl = kzalloc_obj(*cdl); if (!cdl) return -ENOMEM; dev->cdl = cdl; @@ -5638,7 +5638,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) struct ata_port *ap; int id; - ap = kzalloc_obj(*ap, GFP_KERNEL); + ap = kzalloc_obj(*ap); if (!ap) return NULL; @@ -6714,7 +6714,7 @@ static void __init ata_parse_force_param(void) if (*p == ',') size++; - ata_force_tbl = kzalloc_objs(ata_force_tbl[0], size, GFP_KERNEL); + ata_force_tbl = kzalloc_objs(ata_force_tbl[0], size); if (!ata_force_tbl) { printk(KERN_WARNING "ata: failed to extend force table, " "libata.force ignored\n"); diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 04a0ad66958e..b9d635088f5f 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -849,7 +849,7 @@ int ata_slave_link_init(struct ata_port *ap) WARN_ON(ap->slave_link); WARN_ON(ap->flags & ATA_FLAG_PMP); - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index 85340ef98be3..2099d94c4f68 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -758,7 +758,7 @@ struct scsi_transport_template *ata_attach_transport(void) struct ata_internal *i; int count; - i = kzalloc_obj(struct ata_internal, GFP_KERNEL); + i = kzalloc_obj(struct ata_internal); if (!i) return NULL; diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index e550327e7bd9..414e7c63bd85 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -274,7 +274,7 @@ void zpodd_init(struct ata_device *dev) if (mech_type == ODD_MECH_TYPE_UNSUPPORTED) return; - zpodd = kzalloc_obj(struct zpodd, GFP_KERNEL); + zpodd = kzalloc_obj(struct zpodd); if (!zpodd) return; diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c index 93ca62cc6390..a5b959891cb7 100644 --- a/drivers/ata/pata_parport/pata_parport.c +++ b/drivers/ata/pata_parport/pata_parport.c @@ -511,7 +511,7 @@ static struct pi_adapter *pi_init_one(struct parport *parport, if (id < 0) return NULL; - pi = kzalloc_obj(struct pi_adapter, GFP_KERNEL); + pi = kzalloc_obj(struct pi_adapter); if (!pi) { ida_free(&pata_parport_bus_dev_ids, id); return NULL; diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index e4fe47c8fa75..64cb544903d8 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -850,7 +850,7 @@ static int sata_dwc_port_start(struct ata_port *ap) } /* Allocate Port Struct */ - hsdevp = kzalloc_obj(*hsdevp, GFP_KERNEL); + hsdevp = kzalloc_obj(*hsdevp); if (!hsdevp) { err = -ENOMEM; goto CLEANUP; diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 703febbe0c03..be829fcc584d 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -706,7 +706,7 @@ static int sata_fsl_port_start(struct ata_port *ap) void __iomem *hcr_base = host_priv->hcr_base; u32 temp; - pp = kzalloc_obj(*pp, GFP_KERNEL); + pp = kzalloc_obj(*pp); if (!pp) return -ENOMEM; @@ -1451,7 +1451,7 @@ static int sata_fsl_probe(struct platform_device *ofdev) dev_dbg(&ofdev->dev, "@reset i/o = 0x%x\n", ioread32(csr_base + TRANSCFG)); - host_priv = kzalloc_obj(struct sata_fsl_host_priv, GFP_KERNEL); + host_priv = kzalloc_obj(struct sata_fsl_host_priv); if (!host_priv) goto error_exit_with_cleanup; diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c index c85bca1af835..c8d00537d236 100644 --- a/drivers/atm/adummy.c +++ b/drivers/atm/adummy.c @@ -148,7 +148,7 @@ static int __init adummy_init(void) printk(KERN_ERR "adummy: version %s\n", DRV_VERSION); - adummy_dev = kzalloc_obj(struct adummy_dev, GFP_KERNEL); + adummy_dev = kzalloc_obj(struct adummy_dev); if (!adummy_dev) { printk(KERN_ERR DEV_LABEL ": kzalloc() failed\n"); err = -ENOMEM; diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index da7226b1aa66..96719851ae2a 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c @@ -375,7 +375,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) struct atmtcp_dev_data *dev_data; struct atm_dev *dev; - dev_data = kmalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kmalloc_obj(*dev_data); if (!dev_data) return -ENOMEM; diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index b00ddead5390..d155f9dab44c 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -1925,7 +1925,7 @@ static int eni_open(struct atm_vcc *vcc) DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi, vcc->vci); if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) { - eni_vcc = kmalloc_obj(struct eni_vcc, GFP_KERNEL); + eni_vcc = kmalloc_obj(struct eni_vcc); if (!eni_vcc) return -ENOMEM; vcc->dev_data = eni_vcc; eni_vcc->tx = NULL; /* for eni_close after open_rx */ @@ -2229,7 +2229,7 @@ static int eni_init_one(struct pci_dev *pci_dev, goto err_disable; rc = -ENOMEM; - eni_dev = kmalloc_obj(struct eni_dev, GFP_KERNEL); + eni_dev = kmalloc_obj(struct eni_dev); if (!eni_dev) goto err_disable; diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 0a3e9abd72f2..2423eed506c1 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -1676,7 +1676,7 @@ fore200e_getstats(struct fore200e* fore200e) u32 stats_dma_addr; if (fore200e->stats == NULL) { - fore200e->stats = kzalloc_obj(struct stats, GFP_KERNEL); + fore200e->stats = kzalloc_obj(struct stats); if (fore200e->stats == NULL) return -ENOMEM; } @@ -1955,7 +1955,7 @@ static int fore200e_irq_request(struct fore200e *fore200e) static int fore200e_get_esi(struct fore200e *fore200e) { - struct prom_data* prom = kzalloc_obj(struct prom_data, GFP_KERNEL); + struct prom_data* prom = kzalloc_obj(struct prom_data); int ok, i; if (!prom) @@ -2000,7 +2000,7 @@ static int fore200e_alloc_rx_buf(struct fore200e *fore200e) DPRINTK(2, "rx buffers %d / %d are being allocated\n", scheme, magn); /* allocate the array of receive buffers */ - buffer = bsq->buffer = kzalloc_objs(struct buffer, nbr, GFP_KERNEL); + buffer = bsq->buffer = kzalloc_objs(struct buffer, nbr); if (buffer == NULL) return -ENOMEM; @@ -2528,7 +2528,7 @@ static int fore200e_sba_probe(struct platform_device *op) static int index = 0; int err; - fore200e = kzalloc_obj(struct fore200e, GFP_KERNEL); + fore200e = kzalloc_obj(struct fore200e); if (!fore200e) return -ENOMEM; @@ -2596,7 +2596,7 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev, goto out; } - fore200e = kzalloc_obj(struct fore200e, GFP_KERNEL); + fore200e = kzalloc_obj(struct fore200e); if (fore200e == NULL) { err = -ENOMEM; goto out_disable; diff --git a/drivers/atm/he.c b/drivers/atm/he.c index d2e41a7aaa3a..8108ef0c089a 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c @@ -372,7 +372,7 @@ static int he_init_one(struct pci_dev *pci_dev, } pci_set_drvdata(pci_dev, atm_dev); - he_dev = kzalloc_obj(struct he_dev, GFP_KERNEL); + he_dev = kzalloc_obj(struct he_dev); if (!he_dev) { err = -ENOMEM; goto init_one_failure; diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index 7ac597f9c673..4bbcca7f77c8 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev) { unsigned long flags; - if (!(dev->phy_data = kmalloc_obj(struct idt77105_priv, GFP_KERNEL))) + if (!(dev->phy_data = kmalloc_obj(struct idt77105_priv))) return -ENOMEM; PRIV(dev)->dev = dev; spin_lock_irqsave(&idt77105_priv_lock, flags); diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index d984d0766301..7f8aaf5e6e43 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -638,7 +638,7 @@ alloc_scq(struct idt77252_dev *card, int class) { struct scq_info *scq; - scq = kzalloc_obj(struct scq_info, GFP_KERNEL); + scq = kzalloc_obj(struct scq_info); if (!scq) return NULL; scq->base = dma_alloc_coherent(&card->pcidev->dev, SCQ_SIZE, @@ -2116,7 +2116,7 @@ idt77252_init_est(struct vc_map *vc, int pcr) { struct rate_estimator *est; - est = kzalloc_obj(struct rate_estimator, GFP_KERNEL); + est = kzalloc_obj(struct rate_estimator); if (!est) return NULL; est->maxcps = pcr < 0 ? -pcr : pcr; @@ -2424,7 +2424,7 @@ idt77252_open(struct atm_vcc *vcc) index = VPCI2VC(card, vpi, vci); if (!card->vcs[index]) { - card->vcs[index] = kzalloc_obj(struct vc_map, GFP_KERNEL); + card->vcs[index] = kzalloc_obj(struct vc_map); if (!card->vcs[index]) { printk("%s: can't alloc vc in open()\n", card->name); mutex_unlock(&card->mutex); @@ -2855,7 +2855,7 @@ open_card_oam(struct idt77252_dev *card) for (vci = 3; vci < 5; vci++) { index = VPCI2VC(card, vpi, vci); - vc = kzalloc_obj(struct vc_map, GFP_KERNEL); + vc = kzalloc_obj(struct vc_map); if (!vc) { printk("%s: can't alloc vc\n", card->name); return -ENOMEM; @@ -2923,7 +2923,7 @@ open_card_ubr0(struct idt77252_dev *card) { struct vc_map *vc; - vc = kzalloc_obj(struct vc_map, GFP_KERNEL); + vc = kzalloc_obj(struct vc_map); if (!vc) { printk("%s: can't alloc vc\n", card->name); return -ENOMEM; @@ -3621,7 +3621,7 @@ static int idt77252_init_one(struct pci_dev *pcidev, goto err_out_disable_pdev; } - card = kzalloc_obj(struct idt77252_dev, GFP_KERNEL); + card = kzalloc_obj(struct idt77252_dev); if (!card) { printk("idt77252-%d: can't allocate private data\n", index); err = -ENOMEM; diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 727b5d044115..b90761dcd87f 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2709,7 +2709,7 @@ static int ia_open(struct atm_vcc *vcc) vcc->dev->number, vcc->vpi, vcc->vci);) /* Device dependent initialization */ - ia_vcc = kmalloc_obj(*ia_vcc, GFP_KERNEL); + ia_vcc = kmalloc_obj(*ia_vcc); if (!ia_vcc) return -ENOMEM; vcc->dev_data = ia_vcc; @@ -2795,7 +2795,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) rfredn_t *rfL; if (!capable(CAP_NET_ADMIN)) return -EPERM; - regs_local = kmalloc_obj(*regs_local, GFP_KERNEL); + regs_local = kmalloc_obj(*regs_local); if (!regs_local) return -ENOMEM; ffL = ®s_local->ffredn; rfL = ®s_local->rfredn; @@ -3165,7 +3165,7 @@ static int ia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) IADEV *iadev; int ret; - iadev = kzalloc_obj(*iadev, GFP_KERNEL); + iadev = kzalloc_obj(*iadev); if (!iadev) { ret = -ENOMEM; goto err_out; diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 682089aedbe4..d6af999a9ebb 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1464,7 +1464,7 @@ static inline void vcc_table_deallocate(const struct lanai_dev *lanai) static inline struct lanai_vcc *new_lanai_vcc(void) { struct lanai_vcc *lvcc; - lvcc = kzalloc_obj(*lvcc, GFP_KERNEL); + lvcc = kzalloc_obj(*lvcc); if (likely(lvcc != NULL)) { skb_queue_head_init(&lvcc->tx.backlog); #ifdef DEBUG @@ -2555,7 +2555,7 @@ static int lanai_init_one(struct pci_dev *pci, struct atm_dev *atmdev; int result; - lanai = kzalloc_obj(*lanai, GFP_KERNEL); + lanai = kzalloc_obj(*lanai); if (lanai == NULL) { printk(KERN_ERR DEV_LABEL ": couldn't allocate dev_data structure!\n"); diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 67486f363c2c..24e51343df15 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -373,7 +373,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev) return error; } - card = kmalloc_obj(*card, GFP_KERNEL); + card = kmalloc_obj(*card); if (!card) { printk ("nicstar%d: can't allocate memory for device structure.\n", @@ -867,7 +867,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd) if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) return NULL; - scq = kmalloc_obj(*scq, GFP_KERNEL); + scq = kmalloc_obj(*scq); if (!scq) return NULL; scq->org = dma_alloc_coherent(&card->pcidev->dev, @@ -876,7 +876,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd) kfree(scq); return NULL; } - scq->skb = kzalloc_objs(*scq->skb, size / NS_SCQE_SIZE, GFP_KERNEL); + scq->skb = kzalloc_objs(*scq->skb, size / NS_SCQE_SIZE); if (!scq->skb) { dma_free_coherent(&card->pcidev->dev, 2 * size, scq->org, scq->dma); diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 1c86cd84ce69..24c764664c24 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -1196,7 +1196,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) uint32_t data32; struct solos_card *card; - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) return -ENOMEM; diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c index 0eb3ad488d1e..bb588c98216d 100644 --- a/drivers/atm/suni.c +++ b/drivers/atm/suni.c @@ -367,7 +367,7 @@ int suni_init(struct atm_dev *dev) { unsigned char mri; - if (!(dev->phy_data = kmalloc_obj(struct suni_priv, GFP_KERNEL))) + if (!(dev->phy_data = kmalloc_obj(struct suni_priv))) return -ENOMEM; PRIV(dev)->dev = dev; diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index aee1f5a60c0d..b046513987b5 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -226,7 +226,7 @@ static int hd44780_probe(struct platform_device *pdev) if (!lcd) return -ENOMEM; - hd = kzalloc_obj(*hd, GFP_KERNEL); + hd = kzalloc_obj(*hd); if (!hd) goto fail2; diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index d3860953b0de..81b4aac65807 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -56,7 +56,7 @@ static int create_attachment(struct device *dev, struct linedisp *linedisp, bool { struct linedisp_attachment *attachment; - attachment = kzalloc_obj(*attachment, GFP_KERNEL); + attachment = kzalloc_obj(*attachment); if (!attachment) return -ENOMEM; @@ -390,7 +390,7 @@ static int linedisp_init_map(struct linedisp *linedisp) if (err < 0) return err; - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) return -ENOMEM; diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 8aad34f96068..d8854cf15268 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -1428,7 +1428,7 @@ static struct logical_input *panel_bind_key(const char *name, const char *press, { struct logical_input *key; - key = kzalloc_obj(*key, GFP_KERNEL); + key = kzalloc_obj(*key); if (!key) return NULL; diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 0a2a19d50b54..8c5e47c28d9a 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -892,7 +892,7 @@ __weak int __init parse_acpi_topology(void) hetero_id = find_acpi_cpu_topology_hetero_id(cpu); entry = xa_load(&hetero_cpu, hetero_id); if (!entry) { - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); WARN_ON_ONCE(!entry); if (entry) { diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 2264c3647247..4ad26b8dd6a5 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c @@ -153,7 +153,7 @@ attribute_container_add_device(struct device *dev, if (!cont->match(cont, dev)) continue; - ic = kzalloc_obj(*ic, GFP_KERNEL); + ic = kzalloc_obj(*ic); if (!ic) { dev_err(dev, "failed to allocate class container\n"); continue; diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index 8e7bae67f3c0..9fd3820d1f8a 100644 --- a/drivers/base/auxiliary.c +++ b/drivers/base/auxiliary.c @@ -420,7 +420,7 @@ struct auxiliary_device *auxiliary_device_create(struct device *dev, struct auxiliary_device *auxdev; int ret; - auxdev = kzalloc_obj(*auxdev, GFP_KERNEL); + auxdev = kzalloc_obj(*auxdev); if (!auxdev) return NULL; diff --git a/drivers/base/auxiliary_sysfs.c b/drivers/base/auxiliary_sysfs.c index e432fa6b4ce9..dea7f46f7dd0 100644 --- a/drivers/base/auxiliary_sysfs.c +++ b/drivers/base/auxiliary_sysfs.c @@ -63,7 +63,7 @@ int auxiliary_device_sysfs_irq_add(struct auxiliary_device *auxdev, int irq) if (ret) return ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 5745f51f5901..bb61d8adbab1 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -696,7 +696,7 @@ int bus_add_driver(struct device_driver *drv) */ pr_debug("bus: '%s': add driver %s\n", sp->bus->name, drv->name); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto out_put_bus; @@ -897,7 +897,7 @@ int bus_register(const struct bus_type *bus) struct kobject *bus_kobj; struct lock_class_key *key; - priv = kzalloc_obj(struct subsys_private, GFP_KERNEL); + priv = kzalloc_obj(struct subsys_private); if (!priv) return -ENOMEM; @@ -1263,7 +1263,7 @@ static int subsys_register(const struct bus_type *subsys, goto err_sp; } - dev = kzalloc_obj(struct device, GFP_KERNEL); + dev = kzalloc_obj(struct device); if (!dev) { err = -ENOMEM; goto err_dev; diff --git a/drivers/base/class.c b/drivers/base/class.c index 2650dead5af1..827fc7adacc7 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -194,7 +194,7 @@ int class_register(const struct class *cls) return -EINVAL; } - cp = kzalloc_obj(*cp, GFP_KERNEL); + cp = kzalloc_obj(*cp); if (!cp) return -ENOMEM; klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); @@ -268,7 +268,7 @@ struct class *class_create(const char *name) struct class *cls; int retval; - cls = kzalloc_obj(*cls, GFP_KERNEL); + cls = kzalloc_obj(*cls); if (!cls) { retval = -ENOMEM; goto error; @@ -573,7 +573,7 @@ struct class_compat *class_compat_register(const char *name) { struct class_compat *cls; - cls = kmalloc_obj(struct class_compat, GFP_KERNEL); + cls = kmalloc_obj(struct class_compat); if (!cls) return NULL; cls->kobj = kobject_create_and_add(name, &class_kset->kobj); diff --git a/drivers/base/component.c b/drivers/base/component.c index fef563aa13e5..655d68deb590 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -363,7 +363,7 @@ static int component_match_realloc(struct component_match *match, size_t num) if (match->alloc == num) return 0; - new = kmalloc_objs(*new, num, GFP_KERNEL); + new = kmalloc_objs(*new, num); if (!new) return -ENOMEM; @@ -521,7 +521,7 @@ int component_master_add_with_match(struct device *parent, if (ret) return ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; @@ -732,7 +732,7 @@ static int __component_add(struct device *dev, const struct component_ops *ops, struct component *component; int ret; - component = kzalloc_obj(*component, GFP_KERNEL); + component = kzalloc_obj(*component); if (!component) return -ENOMEM; diff --git a/drivers/base/core.c b/drivers/base/core.c index a8ea302c504c..791f9e444df8 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -76,7 +76,7 @@ static int __fwnode_link_add(struct fwnode_handle *con, return 0; } - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; @@ -844,7 +844,7 @@ struct device_link *device_link_add(struct device *consumer, goto out; } - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) goto out; @@ -2748,7 +2748,7 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr, if (!kset->uevent_ops->filter(&dev->kobj)) goto out; - env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env); if (!env) return -ENOMEM; @@ -3220,7 +3220,7 @@ static struct kobject *class_dir_create_and_add(struct subsys_private *sp, struct class_dir *dir; int retval; - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return ERR_PTR(-ENOMEM); @@ -3531,7 +3531,7 @@ static void device_remove_sys_dev_entry(struct device *dev) static int device_private_init(struct device *dev) { - dev->p = kzalloc_obj(*dev->p, GFP_KERNEL); + dev->p = kzalloc_obj(*dev->p); if (!dev->p) return -ENOMEM; dev->p->device = dev; @@ -4278,7 +4278,7 @@ struct device *__root_device_register(const char *name, struct module *owner) struct root_device *root; int err = -ENOMEM; - root = kzalloc_obj(struct root_device, GFP_KERNEL); + root = kzalloc_obj(struct root_device); if (!root) return ERR_PTR(err); @@ -4350,7 +4350,7 @@ device_create_groups_vargs(const struct class *class, struct device *parent, if (IS_ERR_OR_NULL(class)) goto error; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 517609371f4c..875abdc9942e 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -466,7 +466,7 @@ __cpu_device_create(struct device *parent, void *drvdata, struct device *dev = NULL; int retval = -ENOMEM; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto error; diff --git a/drivers/base/faux.c b/drivers/base/faux.c index 33dd8efdd541..fb3e42f21362 100644 --- a/drivers/base/faux.c +++ b/drivers/base/faux.c @@ -133,7 +133,7 @@ struct faux_device *faux_device_create_with_groups(const char *name, struct device *dev; int ret; - faux_obj = kzalloc_obj(*faux_obj, GFP_KERNEL); + faux_obj = kzalloc_obj(*faux_obj); if (!faux_obj) return NULL; @@ -234,7 +234,7 @@ int __init faux_bus_init(void) { int ret; - faux_bus_root = kzalloc_obj(*faux_bus_root, GFP_KERNEL); + faux_bus_root = kzalloc_obj(*faux_bus_root); if (!faux_bus_root) return -ENOMEM; diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 49eabc50c66d..a11b30dda23b 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -747,7 +747,7 @@ _request_firmware_prepare(struct firmware **firmware_p, const char *name, struct fw_priv *fw_priv; int ret; - *firmware_p = firmware = kzalloc_obj(*firmware, GFP_KERNEL); + *firmware_p = firmware = kzalloc_obj(*firmware); if (!firmware) { dev_err(device, "%s: kmalloc(struct firmware) failed\n", __func__); diff --git a/drivers/base/firmware_loader/sysfs.c b/drivers/base/firmware_loader/sysfs.c index d921570026cc..29a10d2ad537 100644 --- a/drivers/base/firmware_loader/sysfs.c +++ b/drivers/base/firmware_loader/sysfs.c @@ -405,7 +405,7 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, struct fw_sysfs *fw_sysfs; struct device *f_dev; - fw_sysfs = kzalloc_obj(*fw_sysfs, GFP_KERNEL); + fw_sysfs = kzalloc_obj(*fw_sysfs); if (!fw_sysfs) { fw_sysfs = ERR_PTR(-ENOMEM); goto exit; diff --git a/drivers/base/firmware_loader/sysfs_upload.c b/drivers/base/firmware_loader/sysfs_upload.c index fdc928b8cd1d..f59a7856934c 100644 --- a/drivers/base/firmware_loader/sysfs_upload.c +++ b/drivers/base/firmware_loader/sysfs_upload.c @@ -315,13 +315,13 @@ firmware_upload_register(struct module *module, struct device *parent, if (!try_module_get(module)) return ERR_PTR(-EFAULT); - fw_upload = kzalloc_obj(*fw_upload, GFP_KERNEL); + fw_upload = kzalloc_obj(*fw_upload); if (!fw_upload) { ret = -ENOMEM; goto exit_module_put; } - fw_upload_priv = kzalloc_obj(*fw_upload_priv, GFP_KERNEL); + fw_upload_priv = kzalloc_obj(*fw_upload_priv); if (!fw_upload_priv) { ret = -ENOMEM; goto free_fw_upload; diff --git a/drivers/base/isa.c b/drivers/base/isa.c index ca2765ef9ab9..fd076cc63cb6 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -125,7 +125,7 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) for (id = 0; id < ndev; id++) { struct isa_dev *isa_dev; - isa_dev = kzalloc_obj(*isa_dev, GFP_KERNEL); + isa_dev = kzalloc_obj(*isa_dev); if (!isa_dev) { error = -ENOMEM; break; diff --git a/drivers/base/map.c b/drivers/base/map.c index f5c01efe6b55..bde415f93d67 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c @@ -41,7 +41,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, if (n > 255) n = 255; - p = kmalloc_objs(struct probe, n, GFP_KERNEL); + p = kmalloc_objs(struct probe, n); if (p == NULL) return -ENOMEM; @@ -134,8 +134,8 @@ retry: struct kobj_map *kobj_map_init(kobj_probe_t *base_probe, struct mutex *lock) { - struct kobj_map *p = kmalloc_obj(struct kobj_map, GFP_KERNEL); - struct probe *base = kzalloc_obj(*base, GFP_KERNEL); + struct kobj_map *p = kmalloc_obj(struct kobj_map); + struct probe *base = kzalloc_obj(*base); int i; if ((p == NULL) || (base == NULL)) { diff --git a/drivers/base/memory.c b/drivers/base/memory.c index ea915e6a4781..a3091924918b 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -800,7 +800,7 @@ static int add_memory_block(unsigned long block_id, int nid, unsigned long state put_device(&mem->dev); return -EEXIST; } - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return -ENOMEM; @@ -1078,7 +1078,7 @@ static int memory_group_register(struct memory_group group) if (!node_possible(group.nid)) return -EINVAL; - new_group = kzalloc_obj(group, GFP_KERNEL); + new_group = kzalloc_obj(group); if (!new_group) return -ENOMEM; *new_group = group; diff --git a/drivers/base/node.c b/drivers/base/node.c index 2b65b5eba708..d7647d077b66 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -158,7 +158,7 @@ static struct node_access_nodes *node_init_node_access(struct node *node, if (access_node->access == access) return access_node; - access_node = kzalloc_obj(*access_node, GFP_KERNEL); + access_node = kzalloc_obj(*access_node); if (!access_node) return NULL; @@ -340,7 +340,7 @@ static void node_init_cache_dev(struct node *node) { struct device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return; @@ -389,7 +389,7 @@ void node_add_cache(unsigned int nid, struct node_cache_attrs *cache_attrs) if (!node->cache_dev) return; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return; @@ -875,7 +875,7 @@ int register_node(int nid) int cpu; struct node *node; - node = kzalloc_obj(struct node, GFP_KERNEL); + node = kzalloc_obj(struct node); if (!node) return -ENOMEM; diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index 0ac1e6757ec5..59bb37e8244c 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c @@ -201,7 +201,7 @@ static int __pm_clk_add(struct device *dev, const char *con_id, if (!psd) return -EINVAL; - ce = kzalloc_obj(*ce, GFP_KERNEL); + ce = kzalloc_obj(*ce); if (!ce) return -ENOMEM; @@ -282,7 +282,7 @@ int of_pm_clk_add_clks(struct device *dev) if (count <= 0) return -ENODEV; - clks = kzalloc_objs(*clks, count, GFP_KERNEL); + clks = kzalloc_objs(*clks, count); if (!clks) return -ENOMEM; diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index 5902658ee94f..9bef9248a705 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -27,7 +27,7 @@ int dev_pm_get_subsys_data(struct device *dev) { struct pm_subsys_data *psd; - psd = kzalloc_obj(*psd, GFP_KERNEL); + psd = kzalloc_obj(*psd); if (!psd) return -ENOMEM; @@ -222,7 +222,7 @@ int dev_pm_domain_attach_list(struct device *dev, if (num_pds <= 0) return 0; - pds = kzalloc_obj(*pds, GFP_KERNEL); + pds = kzalloc_obj(*pds); if (!pds) return -ENOMEM; diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 31acf7ef5d87..9b69827cb0d0 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -198,11 +198,11 @@ static int dev_pm_qos_constraints_allocate(struct device *dev) struct pm_qos_constraints *c; struct blocking_notifier_head *n; - qos = kzalloc_obj(*qos, GFP_KERNEL); + qos = kzalloc_obj(*qos); if (!qos) return -ENOMEM; - n = kzalloc_objs(*n, 3, GFP_KERNEL); + n = kzalloc_objs(*n, 3); if (!n) { kfree(qos); return -ENOMEM; @@ -704,7 +704,7 @@ int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) if (!device_is_registered(dev) || value < 0) return -EINVAL; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -780,7 +780,7 @@ int dev_pm_qos_expose_flags(struct device *dev, s32 val) if (!device_is_registered(dev)) return -EINVAL; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -919,7 +919,7 @@ int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val) ret = -EINVAL; goto out; } - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) { ret = -ENOMEM; goto out; diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index 19abc6a8eaa3..ad23f0fa5d1a 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -55,7 +55,7 @@ int dev_pm_set_wake_irq(struct device *dev, int irq) if (irq < 0) return -EINVAL; - wirq = kzalloc_obj(*wirq, GFP_KERNEL); + wirq = kzalloc_obj(*wirq); if (!wirq) return -ENOMEM; @@ -179,7 +179,7 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned if (irq < 0) return -EINVAL; - wirq = kzalloc_obj(*wirq, GFP_KERNEL); + wirq = kzalloc_obj(*wirq); if (!wirq) return -ENOMEM; diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index a3714a9e4e46..b8e48a023bf0 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -83,7 +83,7 @@ static struct wakeup_source *wakeup_source_create(const char *name) const char *ws_name; int id; - ws = kzalloc_obj(*ws, GFP_KERNEL); + ws = kzalloc_obj(*ws); if (!ws) goto err_ws; diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c index af888678156f..308f8bde9aa3 100644 --- a/drivers/base/power/wakeup_stats.c +++ b/drivers/base/power/wakeup_stats.c @@ -141,7 +141,7 @@ static struct device *wakeup_source_device_create(struct device *parent, struct device *dev = NULL; int retval; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 750a4c4b755e..a35f2b20298b 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -66,7 +66,7 @@ static int regcache_hw_init(struct regmap *map) } map->num_reg_defaults = count; - map->reg_defaults = kmalloc_objs(struct reg_default, count, GFP_KERNEL); + map->reg_defaults = kmalloc_objs(struct reg_default, count); if (!map->reg_defaults) return -ENOMEM; diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 611ab7bbdeda..5a46ce5fee72 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -130,7 +130,7 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, /* No cache entry? Start a new one */ if (!c) { - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) { regmap_debugfs_free_dump_cache(map); mutex_unlock(&map->cache_lock); @@ -555,7 +555,7 @@ void regmap_debugfs_init(struct regmap *map) /* If we don't have the debugfs root yet, postpone init */ if (!regmap_debugfs_root) { struct regmap_debugfs_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return; node->map = map; diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index d3e9c6fef37d..07234d415b51 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -706,7 +706,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, } } - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) return -ENOMEM; diff --git a/drivers/base/regmap/regmap-kunit.c b/drivers/base/regmap/regmap-kunit.c index e22bc2a0ea27..2999d9c185d5 100644 --- a/drivers/base/regmap/regmap-kunit.c +++ b/drivers/base/regmap/regmap-kunit.c @@ -211,7 +211,7 @@ static struct regmap *gen_regmap(struct kunit *test, get_random_bytes(buf, size); - *data = kzalloc_obj(**data, GFP_KERNEL); + *data = kzalloc_obj(**data); if (!(*data)) goto out_free; (*data)->vals = buf; @@ -1759,7 +1759,7 @@ static struct regmap *gen_raw_regmap(struct kunit *test, get_random_bytes(buf, size); - *data = kzalloc_obj(**data, GFP_KERNEL); + *data = kzalloc_obj(**data); if (!(*data)) goto out_free; (*data)->vals = (void *)buf; diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c index 983ffe7f035a..1de2278fa572 100644 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c @@ -430,7 +430,7 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev, if (config->use_relaxed_mmio && config->io_port) return ERR_PTR(-EINVAL); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-ram.c b/drivers/base/regmap/regmap-ram.c index 300745d400ee..0272d53fead1 100644 --- a/drivers/base/regmap/regmap-ram.c +++ b/drivers/base/regmap/regmap-ram.c @@ -66,11 +66,11 @@ struct regmap *__regmap_init_ram(struct device *dev, return ERR_PTR(-EINVAL); } - data->read = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); + data->read = kzalloc_objs(bool, config->max_register + 1); if (!data->read) return ERR_PTR(-ENOMEM); - data->written = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); + data->written = kzalloc_objs(bool, config->max_register + 1); if (!data->written) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-raw-ram.c b/drivers/base/regmap/regmap-raw-ram.c index 6a87df7269c6..60d6e95cdd1b 100644 --- a/drivers/base/regmap/regmap-raw-ram.c +++ b/drivers/base/regmap/regmap-raw-ram.c @@ -123,11 +123,11 @@ struct regmap *__regmap_init_raw_ram(struct device *dev, return ERR_PTR(-EINVAL); } - data->read = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); + data->read = kzalloc_objs(bool, config->max_register + 1); if (!data->read) return ERR_PTR(-ENOMEM); - data->written = kzalloc_objs(bool, config->max_register + 1, GFP_KERNEL); + data->written = kzalloc_objs(bool, config->max_register + 1); if (!data->written) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-spi-avmm.c b/drivers/base/regmap/regmap-spi-avmm.c index d5cfa8eeffdc..692108cbc152 100644 --- a/drivers/base/regmap/regmap-spi-avmm.c +++ b/drivers/base/regmap/regmap-spi-avmm.c @@ -630,7 +630,7 @@ spi_avmm_bridge_ctx_gen(struct spi_device *spi) return ERR_PTR(-EINVAL); } - br = kzalloc_obj(*br, GFP_KERNEL); + br = kzalloc_obj(*br); if (!br) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 56cad7763f56..b9fec387997e 100644 --- a/drivers/base/regmap/regmap-spi.c +++ b/drivers/base/regmap/regmap-spi.c @@ -81,7 +81,7 @@ static struct regmap_async *regmap_spi_async_alloc(void) { struct regmap_async_spi *async_spi; - async_spi = kzalloc_obj(*async_spi, GFP_KERNEL); + async_spi = kzalloc_obj(*async_spi); if (!async_spi) return NULL; diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 443dc31f69d3..607c1246d994 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -689,7 +689,7 @@ struct regmap *__regmap_init(struct device *dev, if (!config) goto err; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { ret = -ENOMEM; goto err; @@ -1117,7 +1117,7 @@ skip_format_initialization: } } - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (new == NULL) { ret = -ENOMEM; goto err_range; @@ -1274,7 +1274,7 @@ int regmap_field_bulk_alloc(struct regmap *regmap, struct regmap_field *rf; int i; - rf = kzalloc_objs(*rf, num_fields, GFP_KERNEL); + rf = kzalloc_objs(*rf, num_fields); if (!rf) return -ENOMEM; @@ -1384,7 +1384,7 @@ EXPORT_SYMBOL_GPL(devm_regmap_field_free); struct regmap_field *regmap_field_alloc(struct regmap *regmap, struct reg_field reg_field) { - struct regmap_field *rm_field = kzalloc_obj(*rm_field, GFP_KERNEL); + struct regmap_field *rm_field = kzalloc_obj(*rm_field); if (!rm_field) return ERR_PTR(-ENOMEM); diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 89326dbbf172..c8d3db9daa2f 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -140,13 +140,13 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr return NULL; } - soc_dev = kzalloc_obj(*soc_dev, GFP_KERNEL); + soc_dev = kzalloc_obj(*soc_dev); if (!soc_dev) { ret = -ENOMEM; goto out1; } - soc_attr_groups = kzalloc_objs(*soc_attr_groups, 3, GFP_KERNEL); + soc_attr_groups = kzalloc_objs(*soc_attr_groups, 3); if (!soc_attr_groups) { ret = -ENOMEM; goto out2; diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 6fcb0c4f13ff..51320837f3a9 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -332,7 +332,7 @@ property_entries_dup(const struct property_entry *properties) while (properties[n].name) n++; - p = kzalloc_objs(*p, n + 1, GFP_KERNEL); + p = kzalloc_objs(*p, n + 1); if (!p) return ERR_PTR(-ENOMEM); @@ -758,7 +758,7 @@ static struct software_node *software_node_alloc(const struct property_entry *pr if (IS_ERR(props)) return ERR_CAST(props); - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) { property_entries_free(props); return ERR_PTR(-ENOMEM); @@ -805,7 +805,7 @@ swnode_register(const struct software_node *node, struct swnode *parent, struct swnode *swnode; int ret; - swnode = kzalloc_obj(*swnode, GFP_KERNEL); + swnode = kzalloc_obj(*swnode); if (!swnode) return ERR_PTR(-ENOMEM); diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c index 2acf87f8de9a..f121be2ed813 100644 --- a/drivers/bcma/driver_pci_host.c +++ b/drivers/bcma/driver_pci_host.c @@ -399,7 +399,7 @@ void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) return; } - pc_host = kzalloc_obj(*pc_host, GFP_KERNEL); + pc_host = kzalloc_obj(*pc_host); if (!pc_host) { bcma_err(bus, "can not allocate memory"); return; diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index 55a4ad2c704a..3dc2985063f1 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c @@ -165,7 +165,7 @@ static int bcma_host_pci_probe(struct pci_dev *dev, u32 val; /* Alloc */ - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) goto out; diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index 5e77d570767c..84742408a59c 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c @@ -479,7 +479,7 @@ int bcma_bus_scan(struct bcma_bus *bus) while (eromptr < eromend) { struct bcma_device *other_core; - struct bcma_device *core = kzalloc_obj(*core, GFP_KERNEL); + struct bcma_device *core = kzalloc_obj(*core); if (!core) { err = -ENOMEM; goto out; diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 9897dc9ae678..a4744a30a8af 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1699,17 +1699,17 @@ aoecmd_init(void) ncpus = num_online_cpus(); - iocq = kzalloc_objs(struct iocq_ktio, ncpus, GFP_KERNEL); + iocq = kzalloc_objs(struct iocq_ktio, ncpus); if (!iocq) return -ENOMEM; - kts = kzalloc_objs(struct ktstate, ncpus, GFP_KERNEL); + kts = kzalloc_objs(struct ktstate, ncpus); if (!kts) { ret = -ENOMEM; goto kts_fail; } - ktiowq = kzalloc_objs(wait_queue_head_t, ncpus, GFP_KERNEL); + ktiowq = kzalloc_objs(wait_queue_head_t, ncpus); if (!ktiowq) { ret = -ENOMEM; goto ktiowq_fail; diff --git a/drivers/block/brd.c b/drivers/block/brd.c index fe9b3b70f22d..00cc8122068f 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -272,7 +272,7 @@ static struct brd_device *brd_find_or_alloc_device(int i) } } - brd = kzalloc_obj(*brd, GFP_KERNEL); + brd = kzalloc_obj(*brd); if (!brd) { mutex_unlock(&brd_devices_mutex); return ERR_PTR(-ENOMEM); diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 2735ddb58b91..65ea6ec66bfd 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -434,7 +434,7 @@ int drbd_bm_init(struct drbd_device *device) { struct drbd_bitmap *b = device->bitmap; WARN_ON(b != NULL); - b = kzalloc_obj(struct drbd_bitmap, GFP_KERNEL); + b = kzalloc_obj(struct drbd_bitmap); if (!b) return -ENOMEM; spin_lock_init(&b->bm_lock); diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 64c545f5788c..b8f0eddf7e87 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2510,7 +2510,7 @@ struct drbd_resource *drbd_create_resource(const char *name) { struct drbd_resource *resource; - resource = kzalloc_obj(struct drbd_resource, GFP_KERNEL); + resource = kzalloc_obj(struct drbd_resource); if (!resource) goto fail; resource->name = kstrdup(name, GFP_KERNEL); @@ -2543,7 +2543,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) struct drbd_resource *resource; struct drbd_connection *connection; - connection = kzalloc_obj(struct drbd_connection, GFP_KERNEL); + connection = kzalloc_obj(struct drbd_connection); if (!connection) return NULL; @@ -2552,7 +2552,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) if (drbd_alloc_socket(&connection->meta)) goto fail; - connection->current_epoch = kzalloc_obj(struct drbd_epoch, GFP_KERNEL); + connection->current_epoch = kzalloc_obj(struct drbd_epoch); if (!connection->current_epoch) goto fail; @@ -2666,7 +2666,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig return ERR_MINOR_OR_VOLUME_EXISTS; /* GFP_KERNEL, we are outside of all write-out paths */ - device = kzalloc_obj(struct drbd_device, GFP_KERNEL); + device = kzalloc_obj(struct drbd_device); if (!device) return ERR_NOMEM; kref_init(&device->kref); @@ -2725,7 +2725,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig INIT_LIST_HEAD(&device->peer_devices); INIT_LIST_HEAD(&device->pending_bitmap_io); for_each_connection(connection, resource) { - peer_device = kzalloc_obj(struct drbd_peer_device, GFP_KERNEL); + peer_device = kzalloc_obj(struct drbd_peer_device); if (!peer_device) goto out_idr_remove_from_resource; peer_device->connection = connection; diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index fbeb8061e549..e201f0087a0f 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1536,7 +1536,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info) goto out; } - new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -1785,14 +1785,14 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) atomic_set(&device->rs_pending_cnt, 0); /* allocation not in the IO path, drbdsetup context */ - nbc = kzalloc_obj(struct drbd_backing_dev, GFP_KERNEL); + nbc = kzalloc_obj(struct drbd_backing_dev); if (!nbc) { retcode = ERR_NOMEM; goto fail; } spin_lock_init(&nbc->md.uuid_lock); - new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -2390,7 +2390,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) connection = adm_ctx.connection; mutex_lock(&adm_ctx.resource->adm_mutex); - new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf); if (!new_net_conf) { retcode = ERR_NOMEM; goto out; @@ -2570,7 +2570,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) } /* allocation not in the IO path, drbdsetup / netlink process context */ - new_net_conf = kzalloc_obj(*new_net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(*new_net_conf); if (!new_net_conf) { retcode = ERR_NOMEM; goto fail; @@ -2840,7 +2840,7 @@ int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info) u_size = rcu_dereference(device->ldev->disk_conf)->disk_size; rcu_read_unlock(); if (u_size != (sector_t)rs.resize_size) { - new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail_ldev; diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 2545f949ce45..c2dd784bc14b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3547,7 +3547,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in } } - new_net_conf = kmalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kmalloc_obj(struct net_conf); if (!new_net_conf) goto disconnect; @@ -3708,7 +3708,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i mutex_lock(&connection->resource->conf_update); old_net_conf = peer_device->connection->net_conf; if (get_ldev(device)) { - new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf); if (!new_disk_conf) { put_ldev(device); mutex_unlock(&connection->resource->conf_update); @@ -3794,7 +3794,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i } if (verify_tfm || csums_tfm) { - new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf); if (!new_net_conf) goto disconnect; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 949bb4adc4bf..0000913f7efc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -2009,7 +2009,7 @@ static int loop_add(int i) int err; err = -ENOMEM; - lo = kzalloc_obj(*lo, GFP_KERNEL); + lo = kzalloc_obj(*lo); if (!lo) goto out; lo->worker_tree = RB_ROOT; diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index d4993d7355dc..fe63f3c55d0d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1274,7 +1274,7 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, goto put_socket; } - nsock = kzalloc_obj(*nsock, GFP_KERNEL); + nsock = kzalloc_obj(*nsock); if (!nsock) { err = -ENOMEM; goto put_socket; @@ -1322,7 +1322,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) if (!sock) return err; - args = kzalloc_obj(*args, GFP_KERNEL); + args = kzalloc_obj(*args); if (!args) { sockfd_put(sock); return -ENOMEM; @@ -1510,7 +1510,7 @@ retry: for (i = 0; i < num_connections; i++) { struct recv_thread_args *args; - args = kzalloc_obj(*args, GFP_KERNEL); + args = kzalloc_obj(*args); if (!args) { sock_shutdown(nbd); /* @@ -1916,7 +1916,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) struct gendisk *disk; int err = -ENOMEM; - nbd = kzalloc_obj(struct nbd_device, GFP_KERNEL); + nbd = kzalloc_obj(struct nbd_device); if (!nbd) goto out; diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 6eab18d814e5..f8c0fd57e041 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -778,7 +778,7 @@ static struct nullb_device *null_alloc_dev(void) { struct nullb_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -1818,7 +1818,7 @@ static int setup_queues(struct nullb *nullb) if (g_poll_queues) nqueues += g_poll_queues; - nullb->queues = kzalloc_objs(struct nullb_queue, nqueues, GFP_KERNEL); + nullb->queues = kzalloc_objs(struct nullb_queue, nqueues); if (!nullb->queues) return -ENOMEM; diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 4d4b6bcbfa5f..700dd0552cd7 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -416,7 +416,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) __set_bit(devidx, &ps3disk_mask); mutex_unlock(&ps3disk_mask_mutex); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 01c743c092be..7844424f7b17 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -612,7 +612,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev) reports_size, xdr_lpar; char *rest; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c9cf07416fa5..e7da06200c1e 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -707,7 +707,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts) int ret = -ENOMEM; dout("%s:\n", __func__); - rbdc = kmalloc_obj(struct rbd_client, GFP_KERNEL); + rbdc = kmalloc_obj(struct rbd_client); if (!rbdc) goto out_opt; @@ -5289,7 +5289,7 @@ static struct rbd_spec *rbd_spec_alloc(void) { struct rbd_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return NULL; @@ -5352,7 +5352,7 @@ static struct rbd_device *__rbd_dev_create(struct rbd_spec *spec) { struct rbd_device *rbd_dev; - rbd_dev = kzalloc_obj(*rbd_dev, GFP_KERNEL); + rbd_dev = kzalloc_obj(*rbd_dev); if (!rbd_dev) return NULL; @@ -6509,7 +6509,7 @@ static int rbd_add_parse_args(const char *buf, /* Initialize all rbd options to the defaults */ - pctx.opts = kzalloc_obj(*pctx.opts, GFP_KERNEL); + pctx.opts = kzalloc_obj(*pctx.opts); if (!pctx.opts) goto out_mem; diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c index 6ca1221693ff..eb485e4c12e2 100644 --- a/drivers/block/rnbd/rnbd-clt-sysfs.c +++ b/drivers/block/rnbd/rnbd-clt-sysfs.c @@ -591,7 +591,7 @@ static ssize_t rnbd_clt_map_device_store(struct kobject *kobj, opt.dest_port = &port_nr; opt.access_mode = &access_mode; opt.nr_poll_queues = &nr_poll_queues; - addrs = kzalloc_objs(*addrs, ARRAY_SIZE(paths) * 2, GFP_KERNEL); + addrs = kzalloc_objs(*addrs, ARRAY_SIZE(paths) * 2); if (!addrs) return -ENOMEM; diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c index 59896090d856..c60dafbe79e8 100644 --- a/drivers/block/rnbd/rnbd-clt.c +++ b/drivers/block/rnbd/rnbd-clt.c @@ -324,7 +324,7 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess, struct rnbd_iu *iu; struct rtrs_permit *permit; - iu = kzalloc_obj(*iu, GFP_KERNEL); + iu = kzalloc_obj(*iu); if (!iu) return NULL; @@ -541,7 +541,7 @@ static int send_msg_open(struct rnbd_clt_dev *dev, enum wait_type wait) }; int err, errno; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) return -ENOMEM; @@ -587,7 +587,7 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, enum wait_type wait }; int err, errno; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) return -ENOMEM; @@ -1564,7 +1564,7 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname, goto put_dev; } - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) { ret = -ENOMEM; goto del_dev; diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c index d644e59529ca..10e8c438bb43 100644 --- a/drivers/block/rnbd/rnbd-srv.c +++ b/drivers/block/rnbd/rnbd-srv.c @@ -128,7 +128,7 @@ static int process_rdma(struct rnbd_srv_session *srv_sess, trace_process_rdma(srv_sess, msg, id, datalen, usrlen); - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -287,7 +287,7 @@ static int create_sess(struct rtrs_srv_sess *rtrs) return err; } - srv_sess = kzalloc_obj(*srv_sess, GFP_KERNEL); + srv_sess = kzalloc_obj(*srv_sess); if (!srv_sess) return -ENOMEM; @@ -422,7 +422,7 @@ static struct rnbd_srv_sess_dev struct rnbd_srv_sess_dev *sess_dev; int error; - sess_dev = kzalloc_obj(*sess_dev, GFP_KERNEL); + sess_dev = kzalloc_obj(*sess_dev); if (!sess_dev) return ERR_PTR(-ENOMEM); @@ -441,7 +441,7 @@ static struct rnbd_srv_dev *rnbd_srv_init_srv_dev(struct block_device *bdev) { struct rnbd_srv_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index 7cf8f8899892..020bd9f1a7b6 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -992,7 +992,7 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto err_out_release_mdesc; } - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { err = -ENOMEM; goto err_out_release_mdesc; diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 3b015a9c752f..0ccc12a72388 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -896,7 +896,7 @@ static int swim_probe(struct platform_device *dev) /* set platform driver data */ - swd = kzalloc_obj(struct swim_priv, GFP_KERNEL); + swd = kzalloc_obj(struct swim_priv); if (!swd) { ret = -ENOMEM; goto out_release_io; diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 1ee1ebe693bf..b1c9a27fe00f 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -991,12 +991,12 @@ static int init_vq(struct virtio_blk *vblk) vblk->io_queues[HCTX_TYPE_READ], vblk->io_queues[HCTX_TYPE_POLL]); - vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs, GFP_KERNEL); + vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs); if (!vblk->vqs) return -ENOMEM; - vqs_info = kzalloc_objs(*vqs_info, num_vqs, GFP_KERNEL); - vqs = kmalloc_objs(*vqs, num_vqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, num_vqs); + vqs = kmalloc_objs(*vqs, num_vqs); if (!vqs_info || !vqs) { err = -ENOMEM; goto out; @@ -1455,7 +1455,7 @@ static int virtblk_probe(struct virtio_device *vdev) goto out; index = err; - vdev->priv = vblk = kmalloc_obj(*vblk, GFP_KERNEL); + vdev->priv = vblk = kmalloc_obj(*vblk); if (!vblk) { err = -ENOMEM; goto out_free_index; diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 448417097837..adfd61af86ee 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -628,7 +628,7 @@ static int xen_blkbk_probe(struct xenbus_device *dev, const struct xenbus_device_id *id) { int err; - struct backend_info *be = kzalloc_obj(struct backend_info, GFP_KERNEL); + struct backend_info *be = kzalloc_obj(struct backend_info); /* match the pr_debug in xen_blkbk_remove */ pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id); @@ -1009,7 +1009,7 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir) err = -ENOMEM; for (i = 0; i < nr_grefs * XEN_BLKIF_REQS_PER_PAGE; i++) { - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) goto fail; list_add_tail(&req->free_list, &ring->pending_free); diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index e8aec3857dd5..777a5ae0cd33 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1980,7 +1980,7 @@ static int blkfront_probe(struct xenbus_device *dev, } kfree(type); } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index 7dee3aacb2d8..f92a52a720d1 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -54,7 +54,7 @@ static int deflate_create(struct zcomp_params *params, struct zcomp_ctx *ctx) size_t sz; int ret; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c index 3416fec9e982..04e186614760 100644 --- a/drivers/block/zram/backend_lz4.c +++ b/drivers/block/zram/backend_lz4.c @@ -41,7 +41,7 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4_ctx *zctx; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c index fd94df9193d3..f6a336acfe20 100644 --- a/drivers/block/zram/backend_lz4hc.c +++ b/drivers/block/zram/backend_lz4hc.c @@ -41,7 +41,7 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4hc_ctx *zctx; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index d9303269b90d..d00b548056dc 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -53,7 +53,7 @@ static int zstd_setup_params(struct zcomp_params *params) zstd_compression_parameters prm; struct zstd_params *zp; - zp = kzalloc_obj(*zp, GFP_KERNEL); + zp = kzalloc_obj(*zp); if (!zp) return -ENOMEM; @@ -122,7 +122,7 @@ static int zstd_create(struct zcomp_params *params, struct zcomp_ctx *ctx) zstd_parameters prm; size_t sz; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index b53fb5fbc041..a771a8ecc540 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c @@ -238,7 +238,7 @@ struct zcomp *zcomp_create(const char *alg, struct zcomp_params *params) */ BUILD_BUG_ON(ARRAY_SIZE(backends) <= 1); - comp = kzalloc_obj(struct zcomp, GFP_KERNEL); + comp = kzalloc_obj(struct zcomp); if (!comp) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 3cc82b88b07e..bca33403fc8b 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -250,7 +250,7 @@ static struct zram_pp_ctl *init_pp_ctl(void) struct zram_pp_ctl *ctl; u32 idx; - ctl = kmalloc_obj(*ctl, GFP_KERNEL); + ctl = kmalloc_obj(*ctl); if (!ctl) return NULL; @@ -855,7 +855,7 @@ static struct zram_wb_ctl *init_wb_ctl(struct zram *zram) struct zram_wb_ctl *wb_ctl; int i; - wb_ctl = kmalloc_obj(*wb_ctl, GFP_KERNEL); + wb_ctl = kmalloc_obj(*wb_ctl); if (!wb_ctl) return NULL; @@ -3079,7 +3079,7 @@ static int zram_add(void) struct zram *zram; int ret, device_id; - zram = kzalloc_obj(struct zram, GFP_KERNEL); + zram = kzalloc_obj(struct zram); if (!zram) return -ENOMEM; diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index af7cd7b217ca..2ae38a321c4b 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -284,7 +284,7 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) switch (hci_skb_pkt_type(skb)) { case HCI_COMMAND_PKT: - dr = kmalloc_obj(*dr, GFP_KERNEL); + dr = kmalloc_obj(*dr); if (!dr) { usb_free_urb(urb); return -ENOMEM; diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index b810c748f4d5..246b6205c5e0 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -871,7 +871,7 @@ struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, opcode_write); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 54a3705e9063..37b744e35bc4 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -1665,7 +1665,7 @@ static int btintel_pcie_setup_txq_bufs(struct btintel_pcie_data *data, struct data_buf *buf; /* Allocate the same number of buffers as the descriptor */ - txq->bufs = kmalloc_objs(*buf, txq->count, GFP_KERNEL); + txq->bufs = kmalloc_objs(*buf, txq->count); if (!txq->bufs) return -ENOMEM; @@ -1709,7 +1709,7 @@ static int btintel_pcie_setup_rxq_bufs(struct btintel_pcie_data *data, struct data_buf *buf; /* Allocate the same number of buffers as the descriptor */ - rxq->bufs = kmalloc_objs(*buf, rxq->count, GFP_KERNEL); + rxq->bufs = kmalloc_objs(*buf, rxq->count); if (!rxq->bufs) return -ENOMEM; diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c index 3ffb54501b11..9b3e768c09f4 100644 --- a/drivers/bluetooth/btmrvl_debugfs.c +++ b/drivers/bluetooth/btmrvl_debugfs.c @@ -144,7 +144,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) if (!hdev->debugfs) return; - dbg = kzalloc_obj(*dbg, GFP_KERNEL); + dbg = kzalloc_obj(*dbg); priv->debugfs_data = dbg; if (!dbg) { diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 78be98c029bf..d6f0ad0b4b6e 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c @@ -710,13 +710,13 @@ struct btmrvl_private *btmrvl_add_card(void *card) { struct btmrvl_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { BT_ERR("Can not allocate priv"); goto err_priv; } - priv->adapter = kzalloc_obj(*priv->adapter, GFP_KERNEL); + priv->adapter = kzalloc_obj(*priv->adapter); if (!priv->adapter) { BT_ERR("Allocate buffer for btmrvl_adapter failed!"); goto err_adapter; diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 9e75e06607b4..fa7533578f85 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -537,7 +537,7 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev) if (!urb) return -ENOMEM; - dr = kmalloc_obj(*dr, GFP_KERNEL); + dr = kmalloc_obj(*dr); if (!dr) { usb_free_urb(urb); return -ENOMEM; diff --git a/drivers/bluetooth/btrsi.c b/drivers/bluetooth/btrsi.c index 9710655472fe..c68dd2fba01c 100644 --- a/drivers/bluetooth/btrsi.c +++ b/drivers/bluetooth/btrsi.c @@ -112,7 +112,7 @@ static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops) struct hci_dev *hdev; int err = 0; - h_adapter = kzalloc_obj(*h_adapter, GFP_KERNEL); + h_adapter = kzalloc_obj(*h_adapter); if (!h_adapter) return -ENOMEM; diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index d8a29e8ff524..62f9d4df3a4f 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -524,7 +524,7 @@ static int btrtl_parse_section(struct hci_dev *hdev, break; } - subsec = kzalloc_obj(*subsec, GFP_KERNEL); + subsec = kzalloc_obj(*subsec); if (!subsec) return -ENOMEM; subsec->opcode = opcode; @@ -828,7 +828,7 @@ static int rtl_download_firmware(struct hci_dev *hdev, struct sk_buff *skb; struct hci_rp_read_local_version *rp; - dl_cmd = kmalloc_obj(*dl_cmd, GFP_KERNEL); + dl_cmd = kmalloc_obj(*dl_cmd); if (!dl_cmd) return -ENOMEM; @@ -1077,7 +1077,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, u8 key_id; u8 reg_val[2]; - btrtl_dev = kzalloc_obj(*btrtl_dev, GFP_KERNEL); + btrtl_dev = kzalloc_obj(*btrtl_dev); if (!btrtl_dev) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 21fd5e7914f6..a1c5eb993e47 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2071,7 +2071,7 @@ static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb) if (!urb) return ERR_PTR(-ENOMEM); - dr = kmalloc_obj(*dr, GFP_KERNEL); + dr = kmalloc_obj(*dr); if (!dr) { usb_free_urb(urb); return ERR_PTR(-ENOMEM); @@ -4059,7 +4059,7 @@ static int btusb_probe(struct usb_interface *intf, return -ENODEV; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ag6xx.c b/drivers/bluetooth/hci_ag6xx.c index 1ee31387c0be..3729d956782d 100644 --- a/drivers/bluetooth/hci_ag6xx.c +++ b/drivers/bluetooth/hci_ag6xx.c @@ -36,7 +36,7 @@ static int ag6xx_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - ag6xx = kzalloc_obj(*ag6xx, GFP_KERNEL); + ag6xx = kzalloc_obj(*ag6xx); if (!ag6xx) return -ENOMEM; diff --git a/drivers/bluetooth/hci_aml.c b/drivers/bluetooth/hci_aml.c index 0d874aaca316..959d9e67b669 100644 --- a/drivers/bluetooth/hci_aml.c +++ b/drivers/bluetooth/hci_aml.c @@ -541,7 +541,7 @@ static int aml_open(struct hci_uart *hu) return -EOPNOTSUPP; } - aml_data = kzalloc_obj(*aml_data, GFP_KERNEL); + aml_data = kzalloc_obj(*aml_data); if (!aml_data) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c index f8d794ea81ef..fa679ad0acdf 100644 --- a/drivers/bluetooth/hci_ath.c +++ b/drivers/bluetooth/hci_ath.c @@ -101,7 +101,7 @@ static int ath_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - ath = kzalloc_obj(*ath, GFP_KERNEL); + ath = kzalloc_obj(*ath); if (!ath) return -ENOMEM; diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 97068809a713..1a4fc3882fd2 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -448,7 +448,7 @@ static int bcm_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - bcm = kzalloc_obj(*bcm, GFP_KERNEL); + bcm = kzalloc_obj(*bcm); if (!bcm) return -ENOMEM; diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 09416cc468d4..b386f91d8b46 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -716,7 +716,7 @@ static int bcsp_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - bcsp = kzalloc_obj(*bcsp, GFP_KERNEL); + bcsp = kzalloc_obj(*bcsp); if (!bcsp) return -ENOMEM; diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index 2ee2eef954e0..07cc2a79a77b 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c @@ -44,7 +44,7 @@ static int h4_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - h4 = kzalloc_obj(*h4, GFP_KERNEL); + h4 = kzalloc_obj(*h4); if (!h4) return -ENOMEM; diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index c31403acb9df..cfdf75dc2847 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -222,7 +222,7 @@ static int h5_open(struct hci_uart *hu) if (hu->serdev) { h5 = serdev_device_get_drvdata(hu->serdev); } else { - h5 = kzalloc_obj(*h5, GFP_KERNEL); + h5 = kzalloc_obj(*h5); if (!h5) return -ENOMEM; } @@ -1069,7 +1069,7 @@ static int h5_btrtl_resume(struct h5 *h5) if (test_bit(H5_WAKEUP_DISABLE, &h5->flags)) { struct h5_btrtl_reprobe *reprobe; - reprobe = kzalloc_obj(*reprobe, GFP_KERNEL); + reprobe = kzalloc_obj(*reprobe); if (!reprobe) return -ENOMEM; diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index 989e87f24273..c31105b91e47 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -384,7 +384,7 @@ static int intel_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - intel = kzalloc_obj(*intel, GFP_KERNEL); + intel = kzalloc_obj(*intel); if (!intel) return -ENOMEM; diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 7638bf6d6b09..71c1997a0f73 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -491,7 +491,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) if (tty->ops->write == NULL) return -EOPNOTSUPP; - hu = kzalloc_obj(*hu, GFP_KERNEL); + hu = kzalloc_obj(*hu); if (!hu) { BT_ERR("Can't allocate control structure"); return -ENFILE; diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index 9c3b24d90462..91acf24f1ef5 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -114,7 +114,7 @@ static int ll_open(struct hci_uart *hu) BT_DBG("hu %p", hu); - ll = kzalloc_obj(*ll, GFP_KERNEL); + ll = kzalloc_obj(*ll); if (!ll) return -ENOMEM; diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c index 8e8a283e4cb9..516b8f74c434 100644 --- a/drivers/bluetooth/hci_mrvl.c +++ b/drivers/bluetooth/hci_mrvl.c @@ -64,7 +64,7 @@ static int mrvl_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - mrvl = kzalloc_obj(*mrvl, GFP_KERNEL); + mrvl = kzalloc_obj(*mrvl); if (!mrvl) return -ENOMEM; diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index cac861991b52..5b02e7c3f56d 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -585,7 +585,7 @@ static int qca_open(struct hci_uart *hu) if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; - qca = kzalloc_obj(*qca, GFP_KERNEL); + qca = kzalloc_obj(*qca); if (!qca) return -ENOMEM; diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 6e653bb8efcc..2762eacf7f20 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -640,7 +640,7 @@ static int vhci_open(struct inode *inode, struct file *file) { struct vhci_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c index bc33d2755ced..76d61af8a275 100644 --- a/drivers/bluetooth/virtio_bt.c +++ b/drivers/bluetooth/virtio_bt.c @@ -275,7 +275,7 @@ static int virtbt_probe(struct virtio_device *vdev) return -EINVAL; } - vbt = kzalloc_obj(*vbt, GFP_KERNEL); + vbt = kzalloc_obj(*vbt); if (!vbt) return -ENOMEM; diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index bc7698cbf5e1..7f2baf057128 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -451,7 +451,7 @@ static int cci_probe_ports(struct device_node *np) nb_cci_ports = cci_config->nb_ace + cci_config->nb_ace_lite; - ports = kzalloc_objs(*ports, nb_cci_ports, GFP_KERNEL); + ports = kzalloc_objs(*ports, nb_cci_ports); if (!ports) return -ENOMEM; diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 3e12cde4443b..c117745cf206 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -672,7 +672,7 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, return -EINVAL; } - regions = kmalloc_objs(regions[0], obj_desc->region_count, GFP_KERNEL); + regions = kmalloc_objs(regions[0], obj_desc->region_count); if (!regions) return -ENOMEM; @@ -787,7 +787,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, /* * Allocate an MC bus device object: */ - mc_bus = kzalloc_obj(*mc_bus, GFP_KERNEL); + mc_bus = kzalloc_obj(*mc_bus); if (!mc_bus) return -ENOMEM; @@ -797,7 +797,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, /* * Allocate a regular fsl_mc_device object: */ - mc_dev = kzalloc_obj(*mc_dev, GFP_KERNEL); + mc_dev = kzalloc_obj(*mc_dev); if (!mc_dev) return -ENOMEM; } diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c index db20ea5ade01..aaa14f17aef4 100644 --- a/drivers/bus/fsl-mc/fsl-mc-uapi.c +++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c @@ -483,7 +483,7 @@ static int fsl_mc_uapi_dev_open(struct inode *inode, struct file *filep) struct fsl_mc_bus *mc_bus; int error; - priv_data = kzalloc_obj(*priv_data, GFP_KERNEL); + priv_data = kzalloc_obj(*priv_data); if (!priv_data) return -ENOMEM; diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 48f76438a138..a27261914bd1 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -1275,7 +1275,7 @@ static struct mhi_ep_device *mhi_ep_alloc_device(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_device *mhi_dev; struct device *dev; - mhi_dev = kzalloc_obj(*mhi_dev, GFP_KERNEL); + mhi_dev = kzalloc_obj(*mhi_dev); if (!mhi_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c index b295992476e4..7845fc7fe6c2 100644 --- a/drivers/bus/mhi/host/boot.c +++ b/drivers/bus/mhi/host/boot.c @@ -333,12 +333,12 @@ static int mhi_alloc_bhi_buffer(struct mhi_controller *mhi_cntrl, struct image_info *img_info; struct mhi_buf *mhi_buf; - img_info = kzalloc_obj(*img_info, GFP_KERNEL); + img_info = kzalloc_obj(*img_info); if (!img_info) return -ENOMEM; /* Allocate memory for entry */ - img_info->mhi_buf = kzalloc_obj(*img_info->mhi_buf, GFP_KERNEL); + img_info->mhi_buf = kzalloc_obj(*img_info->mhi_buf); if (!img_info->mhi_buf) goto error_alloc_mhi_buf; @@ -375,7 +375,7 @@ int mhi_alloc_bhie_table(struct mhi_controller *mhi_cntrl, struct image_info *img_info; struct mhi_buf *mhi_buf; - img_info = kzalloc_obj(*img_info, GFP_KERNEL); + img_info = kzalloc_obj(*img_info); if (!img_info) return -ENOMEM; diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c index fa62f8219510..790b36286813 100644 --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -313,7 +313,7 @@ static int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) atomic_set(&mhi_cntrl->dev_wake, 0); atomic_set(&mhi_cntrl->pending_pkts, 0); - mhi_ctxt = kzalloc_obj(*mhi_ctxt, GFP_KERNEL); + mhi_ctxt = kzalloc_obj(*mhi_ctxt); if (!mhi_ctxt) return -ENOMEM; @@ -1095,7 +1095,7 @@ struct mhi_controller *mhi_alloc_controller(void) { struct mhi_controller *mhi_cntrl; - mhi_cntrl = kzalloc_obj(*mhi_cntrl, GFP_KERNEL); + mhi_cntrl = kzalloc_obj(*mhi_cntrl); return mhi_cntrl; } @@ -1232,7 +1232,7 @@ struct mhi_device *mhi_alloc_device(struct mhi_controller *mhi_cntrl) struct mhi_device *mhi_dev; struct device *dev; - mhi_dev = kzalloc_obj(*mhi_dev, GFP_KERNEL); + mhi_dev = kzalloc_obj(*mhi_dev); if (!mhi_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c index 7d43ecc9d2fa..9804921dfe3d 100644 --- a/drivers/bus/mips_cdmm.c +++ b/drivers/bus/mips_cdmm.c @@ -541,7 +541,7 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus) (drb + size + 1) * CDMM_DRB_SIZE - 1, type, rev); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) break; diff --git a/drivers/bus/moxtet.c b/drivers/bus/moxtet.c index e7caa6b63318..0d68c1a9f493 100644 --- a/drivers/bus/moxtet.c +++ b/drivers/bus/moxtet.c @@ -145,7 +145,7 @@ moxtet_alloc_device(struct moxtet *moxtet) if (!get_device(moxtet->dev)) return NULL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { put_device(moxtet->dev); return NULL; diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c index 63b64da191b1..ee260c1fc087 100644 --- a/drivers/bus/omap_l3_smx.c +++ b/drivers/bus/omap_l3_smx.c @@ -215,7 +215,7 @@ static int omap3_l3_probe(struct platform_device *pdev) struct resource *res; int ret; - l3 = kzalloc_obj(*l3, GFP_KERNEL); + l3 = kzalloc_obj(*l3); if (!l3) return -ENOMEM; diff --git a/drivers/bus/stm32_firewall.c b/drivers/bus/stm32_firewall.c index aa282083c8cd..7e7afe8007db 100644 --- a/drivers/bus/stm32_firewall.c +++ b/drivers/bus/stm32_firewall.c @@ -260,7 +260,7 @@ int stm32_firewall_populate_bus(struct stm32_firewall_controller *firewall_contr return -EINVAL; } - firewalls = kzalloc_objs(*firewalls, len, GFP_KERNEL); + firewalls = kzalloc_objs(*firewalls, len); if (!firewalls) { of_node_put(child); return -ENOMEM; diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index df9c0a0adfbb..b4f2c64ac181 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -205,7 +205,7 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, int err; struct sunxi_rsb_device *rdev; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return ERR_PTR(-ENOMEM); @@ -477,7 +477,7 @@ static struct sunxi_rsb_ctx *regmap_sunxi_rsb_init_ctx(struct sunxi_rsb_device * return ERR_PTR(-EINVAL); } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 931948d05a03..a5b9507de37c 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -354,7 +354,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata, * limit for clk_get(). If cl ever needs to be freed, it should be done * with clkdev_drop(). */ - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return -ENOMEM; @@ -2470,7 +2470,7 @@ static void sysc_add_restored(struct sysc *ddata) { struct sysc_module *restored_module; - restored_module = kzalloc_obj(*restored_module, GFP_KERNEL); + restored_module = kzalloc_obj(*restored_module); if (!restored_module) return; @@ -2953,7 +2953,7 @@ static int sysc_add_disabled(unsigned long base) { struct sysc_address *disabled_module; - disabled_module = kzalloc_obj(*disabled_module, GFP_KERNEL); + disabled_module = kzalloc_obj(*disabled_module); if (!disabled_module) return -ENOMEM; @@ -2984,7 +2984,7 @@ static int sysc_init_static_data(struct sysc *ddata) if (sysc_soc) return 0; - sysc_soc = kzalloc_obj(*sysc_soc, GFP_KERNEL); + sysc_soc = kzalloc_obj(*sysc_soc); if (!sysc_soc) return -ENOMEM; diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index fe0f633bc655..fc049612d6dc 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -1318,7 +1318,7 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot) if (cdi->sanyo_slot) return CDS_NO_INFO; - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) return -ENOMEM; @@ -1347,7 +1347,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi) /* cdrom_read_mech_status requires a valid value for capacity: */ cdi->capacity = 0; - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) return -ENOMEM; @@ -1406,7 +1406,7 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot) return cdrom_load_unload(cdi, -1); } - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) return -ENOMEM; @@ -2311,7 +2311,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi, /* Prevent arg from speculatively bypassing the length check */ arg = array_index_nospec(arg, cdi->capacity); - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 1a59241cbd23..4ba4dd06cbf4 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c @@ -227,7 +227,7 @@ static char gdrom_execute_diagnostic(void) static int gdrom_preparedisk_cmd(void) { struct packet_command *spin_command; - spin_command = kzalloc_obj(struct packet_command, GFP_KERNEL); + spin_command = kzalloc_obj(struct packet_command); if (!spin_command) return -ENOMEM; spin_command->cmd[0] = 0x70; @@ -261,7 +261,7 @@ static int gdrom_readtoc_cmd(struct gdromtoc *toc, int session) struct packet_command *toc_command; int err = 0; - toc_command = kzalloc_obj(struct packet_command, GFP_KERNEL); + toc_command = kzalloc_obj(struct packet_command); if (!toc_command) return -ENOMEM; tocsize = sizeof(struct gdromtoc); @@ -415,7 +415,7 @@ static int gdrom_getsense(short *bufstring) int sense_key; int err = -EIO; - sense_command = kzalloc_obj(struct packet_command, GFP_KERNEL); + sense_command = kzalloc_obj(struct packet_command); if (!sense_command) return -ENOMEM; sense_command->cmd[0] = 0x13; @@ -574,7 +574,7 @@ static blk_status_t gdrom_readdisk_dma(struct request *req) struct packet_command *read_command; unsigned long timeout; - read_command = kzalloc_obj(struct packet_command, GFP_KERNEL); + read_command = kzalloc_obj(struct packet_command); if (!read_command) return BLK_STS_RESOURCE; @@ -656,7 +656,7 @@ static int gdrom_outputversion(void) int err = -ENOMEM; /* query device ID */ - id = kzalloc_obj(struct gdrom_id, GFP_KERNEL); + id = kzalloc_obj(struct gdrom_id); if (!id) return err; gdrom_identifydevice(id); @@ -769,7 +769,7 @@ static int probe_gdrom(struct platform_device *devptr) pr_info("Registered with major number %d\n", gdrom_major); /* Specify basic properties of drive */ - gd.cd_info = kzalloc_obj(struct cdrom_device_info, GFP_KERNEL); + gd.cd_info = kzalloc_obj(struct cdrom_device_info); if (!gd.cd_info) { err = -ENOMEM; goto probe_fail_no_mem; @@ -803,7 +803,7 @@ static int probe_gdrom(struct platform_device *devptr) if (err) goto probe_fail_free_irqs; - gd.toc = kzalloc_obj(struct gdromtoc, GFP_KERNEL); + gd.toc = kzalloc_obj(struct gdromtoc); if (!gd.toc) { err = -ENOMEM; goto probe_fail_free_irqs; diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c index 236403a269b6..9196dc50a48d 100644 --- a/drivers/cdx/cdx.c +++ b/drivers/cdx/cdx.c @@ -789,7 +789,7 @@ int cdx_device_add(struct cdx_dev_params *dev_params) struct cdx_device *cdx_dev; int ret, i; - cdx_dev = kzalloc_obj(*cdx_dev, GFP_KERNEL); + cdx_dev = kzalloc_obj(*cdx_dev); if (!cdx_dev) return -ENOMEM; @@ -876,7 +876,7 @@ struct device *cdx_bus_add(struct cdx_controller *cdx, u8 bus_num) struct cdx_device *cdx_dev; int ret; - cdx_dev = kzalloc_obj(*cdx_dev, GFP_KERNEL); + cdx_dev = kzalloc_obj(*cdx_dev); if (!cdx_dev) return NULL; diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c index abd8f9cdb0b5..280bb7490c0f 100644 --- a/drivers/cdx/controller/cdx_controller.c +++ b/drivers/cdx/controller/cdx_controller.c @@ -168,7 +168,7 @@ static int xlnx_cdx_probe(struct platform_device *pdev) struct cdx_mcdi *cdx_mcdi; int ret; - cdx_mcdi = kzalloc_obj(*cdx_mcdi, GFP_KERNEL); + cdx_mcdi = kzalloc_obj(*cdx_mcdi); if (!cdx_mcdi) return -ENOMEM; @@ -181,7 +181,7 @@ static int xlnx_cdx_probe(struct platform_device *pdev) goto mcdi_init_fail; } - cdx = kzalloc_obj(*cdx, GFP_KERNEL); + cdx = kzalloc_obj(*cdx); if (!cdx) { ret = -ENOMEM; goto cdx_alloc_fail; diff --git a/drivers/cdx/controller/mcdi.c b/drivers/cdx/controller/mcdi.c index 4b3d8f1ef964..34a07d6f41a0 100644 --- a/drivers/cdx/controller/mcdi.c +++ b/drivers/cdx/controller/mcdi.c @@ -118,7 +118,7 @@ int cdx_mcdi_init(struct cdx_mcdi *cdx) struct cdx_mcdi_iface *mcdi; int rc = -ENOMEM; - cdx->mcdi = kzalloc_obj(*cdx->mcdi, GFP_KERNEL); + cdx->mcdi = kzalloc_obj(*cdx->mcdi); if (!cdx->mcdi) goto fail; @@ -456,11 +456,11 @@ static int cdx_mcdi_rpc_sync(struct cdx_mcdi *cdx, unsigned int cmd, if (outlen_actual) *outlen_actual = 0; - wait_data = kmalloc_obj(*wait_data, GFP_KERNEL); + wait_data = kmalloc_obj(*wait_data); if (!wait_data) return -ENOMEM; - cmd_item = kmalloc_obj(*cmd_item, GFP_KERNEL); + cmd_item = kmalloc_obj(*cmd_item); if (!cmd_item) { kfree(wait_data); return -ENOMEM; diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 7cf521d36e3b..898ff30ffd46 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -85,12 +85,12 @@ static int amd_create_gatt_pages(int nr_tables) int retval = 0; int i; - tables = kzalloc_objs(struct amd_page_map *, nr_tables + 1, GFP_KERNEL); + tables = kzalloc_objs(struct amd_page_map *, nr_tables + 1); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc_obj(struct amd_page_map, GFP_KERNEL); + entry = kzalloc_obj(struct amd_page_map); tables[i] = entry; if (entry == NULL) { retval = -ENOMEM; diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 65afee75d8e3..485b02fc9b18 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c @@ -112,12 +112,12 @@ static int ati_create_gatt_pages(int nr_tables) int retval = 0; int i; - tables = kzalloc_objs(struct ati_page_map *, nr_tables + 1, GFP_KERNEL); + tables = kzalloc_objs(struct ati_page_map *, nr_tables + 1); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc_obj(struct ati_page_map, GFP_KERNEL); + entry = kzalloc_obj(struct ati_page_map); tables[i] = entry; if (entry == NULL) { retval = -ENOMEM; diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 90554f4f2146..4d920ca534a4 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -238,7 +238,7 @@ struct agp_bridge_data *agp_alloc_bridge(void) { struct agp_bridge_data *bridge; - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return NULL; diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 66ba14eac583..41752ed2b075 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -101,7 +101,7 @@ static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) if (INT_MAX/sizeof(struct page *) < num_agp_pages) return NULL; - new = kzalloc_obj(struct agp_memory, GFP_KERNEL); + new = kzalloc_obj(struct agp_memory); if (new == NULL) return NULL; @@ -127,7 +127,7 @@ struct agp_memory *agp_create_memory(int scratch_pages) { struct agp_memory *new; - new = kzalloc_obj(struct agp_memory, GFP_KERNEL); + new = kzalloc_obj(struct agp_memory); if (new == NULL) return NULL; diff --git a/drivers/char/agp/isoch.c b/drivers/char/agp/isoch.c index b7deecb40922..698182609b92 100644 --- a/drivers/char/agp/isoch.c +++ b/drivers/char/agp/isoch.c @@ -92,7 +92,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge, * We'll work with an array of isoch_data's (one for each * device in dev_list) throughout this function. */ - master = kmalloc_objs(*master, ndevs, GFP_KERNEL); + master = kmalloc_objs(*master, ndevs); if (master == NULL) { ret = -ENOMEM; goto get_out; @@ -333,7 +333,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge) * Allocate a head for our AGP 3.5 device list * (multiple AGP v3 devices are allowed behind a single bridge). */ - if ((dev_list = kmalloc_obj(*dev_list, GFP_KERNEL)) == NULL) { + if ((dev_list = kmalloc_obj(*dev_list)) == NULL) { ret = -ENOMEM; goto get_out; } @@ -362,7 +362,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge) case 0x0300: /* Display controller */ case 0x0400: /* Multimedia controller */ - if ((cur = kmalloc_obj(*cur, GFP_KERNEL)) == NULL) { + if ((cur = kmalloc_obj(*cur)) == NULL) { ret = -ENOMEM; goto free_and_exit; } diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index 03f21b90d368..a6d8988538ec 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c @@ -102,7 +102,7 @@ static int serverworks_create_gatt_pages(int nr_tables) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc_obj(struct serverworks_page_map, GFP_KERNEL); + entry = kzalloc_obj(struct serverworks_page_map); if (entry == NULL) { retval = -ENOMEM; break; diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index 54e921eac4d3..389874f44967 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c @@ -343,7 +343,7 @@ static int apm_open(struct inode * inode, struct file * filp) { struct apm_user *as; - as = kzalloc_obj(*as, GFP_KERNEL); + as = kzalloc_obj(*as); if (as) { /* * XXX - this is a tiny bit broken, when we consider BSD diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 57d236398a81..98e9327bf65d 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c @@ -186,7 +186,7 @@ static int bsr_add_node(struct device_node *bn) num_bsr_devs = bsr_bytes_len / sizeof(u32); for (i = 0 ; i < num_bsr_devs; i++) { - struct bsr_dev *cur = kzalloc_obj(struct bsr_dev, GFP_KERNEL); + struct bsr_dev *cur = kzalloc_obj(struct bsr_dev); struct resource res; int result; diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index bc228e26929e..332d594bdf70 100644 --- a/drivers/char/hw_random/amd-rng.c +++ b/drivers/char/hw_random/amd-rng.c @@ -154,7 +154,7 @@ found: goto put_dev; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { err = -ENOMEM; goto put_dev; diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index 45e2696fad23..1b21d58e1768 100644 --- a/drivers/char/hw_random/geode-rng.c +++ b/drivers/char/hw_random/geode-rng.c @@ -107,7 +107,7 @@ static int __init geode_rng_init(void) return err; found: - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { err = -ENOMEM; goto put_dev; diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index e18041c2610d..d24e747203c1 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c @@ -346,7 +346,7 @@ static int __init intel_rng_mod_init(void) goto fwh_done; } - intel_rng_hw = kmalloc_obj(*intel_rng_hw, GFP_KERNEL); + intel_rng_hw = kmalloc_obj(*intel_rng_hw); if (!intel_rng_hw) { pci_dev_put(dev); goto out; diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index ba35f83d5c31..0ce02d7e5048 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -134,7 +134,7 @@ static int probe_common(struct virtio_device *vdev) int err, index; struct virtrng_info *vi = NULL; - vi = kzalloc_obj(struct virtrng_info, GFP_KERNEL); + vi = kzalloc_obj(struct virtrng_info); if (!vi) return -ENOMEM; diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index c8a4f261bd58..38d0f1bc10b0 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c @@ -90,7 +90,7 @@ static int ipmi_open(struct inode *inode, struct file *file) int rv; struct ipmi_file_private *priv; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -813,7 +813,7 @@ static void ipmi_new_smi(int if_num, struct device *device) dev_t dev = MKDEV(ipmi_major, if_num); struct ipmi_reg_list *entry; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { pr_err("ipmi_devintf: Unable to create the ipmi class device link\n"); return; diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c index 2462d2557331..505e32911c34 100644 --- a/drivers/char/ipmi/ipmi_dmi.c +++ b/drivers/char/ipmi/ipmi_dmi.c @@ -74,7 +74,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr, p.slave_addr = slave_addr; p.addr_source = SI_SMBIOS; - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) { pr_warn("Could not allocate dmi info\n"); } else { diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index b4f05d15d2df..c530966c4e07 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -761,11 +761,11 @@ int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher) list_for_each_entry(intf, &ipmi_interfaces, link) count++; if (count > 0) { - interfaces = kmalloc_objs(*interfaces, count, GFP_KERNEL); + interfaces = kmalloc_objs(*interfaces, count); if (!interfaces) { rv = -ENOMEM; } else { - devices = kmalloc_objs(*devices, count, GFP_KERNEL); + devices = kmalloc_objs(*devices, count); if (!devices) { kfree(interfaces); interfaces = NULL; @@ -1684,7 +1684,7 @@ int ipmi_register_for_cmd(struct ipmi_user *user, if (!user) return -ENODEV; - rcvr = kmalloc_obj(*rcvr, GFP_KERNEL); + rcvr = kmalloc_obj(*rcvr); if (!rcvr) { rv = -ENOMEM; goto out_release; @@ -3144,7 +3144,7 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, bmc->id.product_id, bmc->id.device_id); } else { - bmc = kzalloc_obj(*bmc, GFP_KERNEL); + bmc = kzalloc_obj(*bmc); if (!bmc) { rv = -ENOMEM; goto out; @@ -3580,7 +3580,7 @@ int ipmi_add_smi(struct module *owner, if (rv) return rv; - intf = kzalloc_obj(*intf, GFP_KERNEL); + intf = kzalloc_obj(*intf); if (!intf) return -ENOMEM; diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index c6137eb56548..6bdf624c37ce 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -1914,7 +1914,7 @@ int ipmi_si_add_smi(struct si_sm_io *io) } } - new_smi = kzalloc_obj(*new_smi, GFP_KERNEL); + new_smi = kzalloc_obj(*new_smi); if (!new_smi) return -ENOMEM; spin_lock_init(&new_smi->si_lock); diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 579cf30cd52f..37a5cb5c53f1 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1602,7 +1602,7 @@ static int ssif_add_infos(struct i2c_client *client) { struct ssif_addr_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->addr_src = SI_ACPI; @@ -1667,7 +1667,7 @@ static int ssif_probe(struct i2c_client *client) return -ENOMEM; } - ssif_info = kzalloc_obj(*ssif_info, GFP_KERNEL); + ssif_info = kzalloc_obj(*ssif_info); if (!ssif_info) { kfree(resp); mutex_unlock(&ssif_infos_mutex); @@ -1948,7 +1948,7 @@ static int new_ssif_client(int addr, char *adapter_name, goto out_unlock; } - addr_info = kzalloc_obj(*addr_info, GFP_KERNEL); + addr_info = kzalloc_obj(*addr_info); if (!addr_info) { rv = -ENOMEM; goto out_unlock; diff --git a/drivers/char/ipmi/kcs_bmc_serio.c b/drivers/char/ipmi/kcs_bmc_serio.c index 4c3a70dc7425..1a95d6f258ea 100644 --- a/drivers/char/ipmi/kcs_bmc_serio.c +++ b/drivers/char/ipmi/kcs_bmc_serio.c @@ -77,7 +77,7 @@ static int kcs_bmc_serio_add_device(struct kcs_bmc_device *kcs_bmc) return -ENOMEM; /* Use kzalloc() as the allocation is cleaned up with kfree() via serio_unregister_port() */ - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/char/powernv-op-panel.c b/drivers/char/powernv-op-panel.c index 7405d645ff62..63175b765c90 100644 --- a/drivers/char/powernv-op-panel.c +++ b/drivers/char/powernv-op-panel.c @@ -167,7 +167,7 @@ static int oppanel_probe(struct platform_device *pdev) if (!oppanel_data) return -ENOMEM; - oppanel_lines = kzalloc_objs(oppanel_line_t, num_lines, GFP_KERNEL); + oppanel_lines = kzalloc_objs(oppanel_line_t, num_lines); if (!oppanel_lines) { rc = -ENOMEM; goto free_oppanel_data; diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 2468040d745f..6da817b9849f 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -689,7 +689,7 @@ static int pp_open(struct inode *inode, struct file *file) if (minor >= PARPORT_MAX) return -ENXIO; - pp = kmalloc_obj(struct pp_struct, GFP_KERNEL); + pp = kmalloc_obj(struct pp_struct); if (!pp) return -ENOMEM; diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index 5892d2b1cb72..c73f443077a4 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c @@ -361,7 +361,7 @@ static int ps3flash_probe(struct ps3_system_bus_device *_dev) ps3flash_dev = dev; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/char/random.c b/drivers/char/random.c index 91dc486b9ffa..dcd002e1b890 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1248,7 +1248,7 @@ void __cold rand_initialize_disk(struct gendisk *disk) * If kzalloc returns null, we just won't use that entropy * source. */ - state = kzalloc_obj(struct timer_rand_state, GFP_KERNEL); + state = kzalloc_obj(struct timer_rand_state); if (state) { state->last_time = INITIAL_JIFFIES; disk->random = state; diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 8f3dd530f56c..677d230a226c 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c @@ -776,7 +776,7 @@ static int __init tlclk_init(void) telclk_interrupt = (inb(TLCLK_REG7) & 0x0f); - alarm_events = kzalloc_obj(struct tlclk_alarms, GFP_KERNEL); + alarm_events = kzalloc_obj(struct tlclk_alarms); if (!alarm_events) { ret = -ENOMEM; goto out1; diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 986990723db2..0719577e584d 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -295,7 +295,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev, struct tpm_chip *chip; int rc; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c index bd197be15923..2779a8738c59 100644 --- a/drivers/char/tpm/tpm-dev.c +++ b/drivers/char/tpm/tpm-dev.c @@ -30,7 +30,7 @@ static int tpm_open(struct inode *inode, struct file *file) return -EBUSY; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) goto out; diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c index c00817faf88e..3b1cf1ca0420 100644 --- a/drivers/char/tpm/tpm2-sessions.c +++ b/drivers/char/tpm/tpm2-sessions.c @@ -991,7 +991,7 @@ int tpm2_start_auth_session(struct tpm_chip *chip) return 0; } - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) return -ENOMEM; diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c index 1bc1c6c2f257..99f1c1e5644b 100644 --- a/drivers/char/tpm/tpm_crb_ffa.c +++ b/drivers/char/tpm/tpm_crb_ffa.c @@ -346,7 +346,7 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev) return -EINVAL; } - p = kzalloc_obj(*tpm_crb_ffa, GFP_KERNEL); + p = kzalloc_obj(*tpm_crb_ffa); if (!p) return -ENOMEM; tpm_crb_ffa = p; diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 2bd4e1dce322..6fb4d30eb6f6 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -611,7 +611,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, if (IS_ERR(chip)) return PTR_ERR(chip); - ibmvtpm = kzalloc_obj(struct ibmvtpm_dev, GFP_KERNEL); + ibmvtpm = kzalloc_obj(struct ibmvtpm_dev); if (!ibmvtpm) { dev_err(dev, "kzalloc for ibmvtpm failed\n"); goto cleanup; diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c index b84d745a9797..7bb0f4d4a2ed 100644 --- a/drivers/char/tpm/tpm_vtpm_proxy.c +++ b/drivers/char/tpm/tpm_vtpm_proxy.c @@ -491,7 +491,7 @@ static struct proxy_dev *vtpm_proxy_create_proxy_dev(void) struct tpm_chip *chip; int err; - proxy_dev = kzalloc_obj(*proxy_dev, GFP_KERNEL); + proxy_dev = kzalloc_obj(*proxy_dev); if (proxy_dev == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/char/tpm/tpmrm-dev.c b/drivers/char/tpm/tpmrm-dev.c index cace5bc7369a..f48d4d9e179c 100644 --- a/drivers/char/tpm/tpmrm-dev.c +++ b/drivers/char/tpm/tpmrm-dev.c @@ -17,7 +17,7 @@ static int tpmrm_open(struct inode *inode, struct file *file) int rc; chip = container_of(inode->i_cdev, struct tpm_chip, cdevs); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return -ENOMEM; diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c index c1a4a5531b0a..3c0cce57c4ae 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c @@ -338,7 +338,7 @@ static int tpmfront_probe(struct xenbus_device *dev, struct tpm_private *priv; int rv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { xenbus_dev_fatal(dev, -ENOMEM, "allocating priv structure"); return -ENOMEM; diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 2c1c864a9de9..a341073d5c3a 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1325,7 +1325,7 @@ static int add_port(struct ports_device *portdev, u32 id) dev_t devt; int err; - port = kmalloc_obj(*port, GFP_KERNEL); + port = kmalloc_obj(*port); if (!port) { err = -ENOMEM; goto fail; @@ -1809,9 +1809,9 @@ static int init_vqs(struct ports_device *portdev) nr_ports = portdev->max_nr_ports; nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2; - vqs = kmalloc_objs(struct virtqueue *, nr_queues, GFP_KERNEL); - vqs_info = kzalloc_objs(*vqs_info, nr_queues, GFP_KERNEL); - portdev->in_vqs = kmalloc_objs(struct virtqueue *, nr_ports, GFP_KERNEL); + vqs = kmalloc_objs(struct virtqueue *, nr_queues); + vqs_info = kzalloc_objs(*vqs_info, nr_queues); + portdev->in_vqs = kmalloc_objs(struct virtqueue *, nr_ports); portdev->out_vqs = kmalloc_objs(struct virtqueue *, nr_ports, GFP_KERNEL); if (!vqs || !vqs_info || !portdev->in_vqs || !portdev->out_vqs) { @@ -1964,7 +1964,7 @@ static int virtcons_probe(struct virtio_device *vdev) return -EINVAL; } - portdev = kmalloc_obj(*portdev, GFP_KERNEL); + portdev = kmalloc_obj(*portdev); if (!portdev) { err = -ENOMEM; goto fail; diff --git a/drivers/char/xillybus/xillybus_class.c b/drivers/char/xillybus/xillybus_class.c index 4bc5a2152abb..5e8f03b77064 100644 --- a/drivers/char/xillybus/xillybus_class.c +++ b/drivers/char/xillybus/xillybus_class.c @@ -57,7 +57,7 @@ int xillybus_init_chrdev(struct device *dev, size_t namelen; struct xilly_unit *unit, *u; - unit = kzalloc_obj(*unit, GFP_KERNEL); + unit = kzalloc_obj(*unit); if (!unit) return -ENOMEM; diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c index 86dccc6009f8..952ef149aba1 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c @@ -319,7 +319,7 @@ static int xilly_map_single(struct xilly_endpoint *ep, dma_addr_t addr; struct xilly_mapping *this; - this = kzalloc_obj(*this, GFP_KERNEL); + this = kzalloc_obj(*this); if (!this) return -ENOMEM; diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xillyusb.c index 568e82b73823..34e7ad3bcab3 100644 --- a/drivers/char/xillybus/xillyusb.c +++ b/drivers/char/xillybus/xillyusb.c @@ -495,7 +495,7 @@ static struct xillyusb_endpoint struct xillyusb_endpoint *ep; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return NULL; @@ -522,7 +522,7 @@ static struct xillyusb_endpoint struct xillybuffer *xb; unsigned long addr; - xb = kzalloc_obj(*xb, GFP_KERNEL); + xb = kzalloc_obj(*xb); if (!xb) { endpoint_dealloc(ep); @@ -1336,7 +1336,7 @@ static int xillyusb_open(struct inode *inode, struct file *filp) } if (filp->f_mode & FMODE_READ) { - in_fifo = kzalloc_obj(*in_fifo, GFP_KERNEL); + in_fifo = kzalloc_obj(*in_fifo); if (!in_fifo) { rc = -ENOMEM; @@ -1943,7 +1943,7 @@ static int setup_channels(struct xillyusb_dev *xdev, struct xillyusb_channel *chan, *new_channels; int i; - chan = kzalloc_objs(*chan, num_channels, GFP_KERNEL); + chan = kzalloc_objs(*chan, num_channels); if (!chan) return -ENOMEM; @@ -2149,7 +2149,7 @@ static int xillyusb_probe(struct usb_interface *interface, struct xillyusb_dev *xdev; int rc; - xdev = kzalloc_obj(*xdev, GFP_KERNEL); + xdev = kzalloc_obj(*xdev); if (!xdev) return -ENOMEM; diff --git a/drivers/clk/aspeed/clk-aspeed.c b/drivers/clk/aspeed/clk-aspeed.c index c8449e49ea08..0614fca4feb1 100644 --- a/drivers/clk/aspeed/clk-aspeed.c +++ b/drivers/clk/aspeed/clk-aspeed.c @@ -354,7 +354,7 @@ static struct clk_hw *aspeed_clk_hw_register_gate(struct device *dev, struct clk_hw *hw; int ret; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/aspeed/clk-ast2600.c b/drivers/clk/aspeed/clk-ast2600.c index e24b536e68ce..bc9a5b81009d 100644 --- a/drivers/clk/aspeed/clk-ast2600.c +++ b/drivers/clk/aspeed/clk-ast2600.c @@ -431,7 +431,7 @@ static struct clk_hw *aspeed_g6_clk_hw_register_gate(struct device *dev, struct clk_hw *hw; int ret; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/aspeed/clk-ast2700.c b/drivers/clk/aspeed/clk-ast2700.c index df491bae39b7..8b7b382f6f3e 100644 --- a/drivers/clk/aspeed/clk-ast2700.c +++ b/drivers/clk/aspeed/clk-ast2700.c @@ -820,7 +820,7 @@ static struct clk_hw *ast2700_clk_hw_register_gate(struct device *dev, const cha struct clk_hw *hw; int ret = -EINVAL; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-pll.c index 9133c0ec7f08..732037bfbda8 100644 --- a/drivers/clk/at91/clk-audio-pll.c +++ b/drivers/clk/at91/clk-audio-pll.c @@ -460,7 +460,7 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, struct clk_init_data init = {}; int ret; - frac_ck = kzalloc_obj(*frac_ck, GFP_KERNEL); + frac_ck = kzalloc_obj(*frac_ck); if (!frac_ck) return ERR_PTR(-ENOMEM); @@ -490,7 +490,7 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - apad_ck = kzalloc_obj(*apad_ck, GFP_KERNEL); + apad_ck = kzalloc_obj(*apad_ck); if (!apad_ck) return ERR_PTR(-ENOMEM); @@ -521,7 +521,7 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - apmc_ck = kzalloc_obj(*apmc_ck, GFP_KERNEL); + apmc_ck = kzalloc_obj(*apmc_ck); if (!apmc_ck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c index 0427f112829b..5d3a62433187 100644 --- a/drivers/clk/at91/clk-generated.c +++ b/drivers/clk/at91/clk-generated.c @@ -332,7 +332,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, if (!(parent_names || parent_hws)) return ERR_PTR(-ENOMEM); - gck = kzalloc_obj(*gck, GFP_KERNEL); + gck = kzalloc_obj(*gck); if (!gck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c index a56e65eb2333..12bd112d3c50 100644 --- a/drivers/clk/at91/clk-h32mx.c +++ b/drivers/clk/at91/clk-h32mx.c @@ -100,7 +100,7 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - h32mxclk = kzalloc_obj(*h32mxclk, GFP_KERNEL); + h32mxclk = kzalloc_obj(*h32mxclk); if (!h32mxclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-i2s-mux.c b/drivers/clk/at91/clk-i2s-mux.c index 309a8d6136d5..a762c56dcadd 100644 --- a/drivers/clk/at91/clk-i2s-mux.c +++ b/drivers/clk/at91/clk-i2s-mux.c @@ -57,7 +57,7 @@ at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, struct clk_i2s_mux *i2s_ck; int ret; - i2s_ck = kzalloc_obj(*i2s_ck, GFP_KERNEL); + i2s_ck = kzalloc_obj(*i2s_ck); if (!i2s_ck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 51b0421d01e3..ab515239adcf 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -163,7 +163,7 @@ at91_clk_register_main_osc(struct regmap *regmap, if (!name || !(parent_name || parent_data)) return ERR_PTR(-EINVAL); - osc = kzalloc_obj(*osc, GFP_KERNEL); + osc = kzalloc_obj(*osc); if (!osc) return ERR_PTR(-ENOMEM); @@ -306,7 +306,7 @@ at91_clk_register_main_rc_osc(struct regmap *regmap, if (!name || !frequency) return ERR_PTR(-EINVAL); - osc = kzalloc_obj(*osc, GFP_KERNEL); + osc = kzalloc_obj(*osc); if (!osc) return ERR_PTR(-ENOMEM); @@ -415,7 +415,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap, if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - clkmain = kzalloc_obj(*clkmain, GFP_KERNEL); + clkmain = kzalloc_obj(*clkmain); if (!clkmain) return ERR_PTR(-ENOMEM); @@ -567,7 +567,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, if (!(parent_hws || parent_names) || !num_parents) return ERR_PTR(-EINVAL); - clkmain = kzalloc_obj(*clkmain, GFP_KERNEL); + clkmain = kzalloc_obj(*clkmain); if (!clkmain) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index 5e4f5fcc0645..05001e7700ca 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -488,7 +488,7 @@ at91_clk_register_master_internal(struct regmap *regmap, if (!name || !num_parents || !(parent_names || parent_hws) || !lock) return ERR_PTR(-EINVAL); - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return ERR_PTR(-ENOMEM); @@ -831,7 +831,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, !lock || id > MASTER_MAX_ID) return ERR_PTR(-EINVAL); - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c index dda4217aaf85..4946ea0cdbba 100644 --- a/drivers/clk/at91/clk-peripheral.c +++ b/drivers/clk/at91/clk-peripheral.c @@ -109,7 +109,7 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name, if (!name || !(parent_name || parent_hw) || id > PERIPHERAL_ID_MAX) return ERR_PTR(-EINVAL); - periph = kzalloc_obj(*periph, GFP_KERNEL); + periph = kzalloc_obj(*periph); if (!periph) return ERR_PTR(-ENOMEM); @@ -471,7 +471,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, if (!name || !(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - periph = kzalloc_obj(*periph, GFP_KERNEL); + periph = kzalloc_obj(*periph); if (!periph) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index 083e7524ff8f..b89f60cf0241 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -326,7 +326,7 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, if (id > PLL_MAX_ID) return ERR_PTR(-EINVAL); - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c index 27feb5207b40..5f93aead03fa 100644 --- a/drivers/clk/at91/clk-plldiv.c +++ b/drivers/clk/at91/clk-plldiv.c @@ -91,7 +91,7 @@ at91_clk_register_plldiv(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - plldiv = kzalloc_obj(*plldiv, GFP_KERNEL); + plldiv = kzalloc_obj(*plldiv); if (!plldiv) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index a87e63f4c3f8..bfd8b03b035c 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -227,7 +227,7 @@ at91_clk_register_programmable(struct regmap *regmap, if (id > PROG_ID_MAX || !(parent_names || parent_hws)) return ERR_PTR(-EINVAL); - prog = kzalloc_obj(*prog, GFP_KERNEL); + prog = kzalloc_obj(*prog); if (!prog) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c index 5f5cecbcf207..9d9b5adecf0d 100644 --- a/drivers/clk/at91/clk-sam9x60-pll.c +++ b/drivers/clk/at91/clk-sam9x60-pll.c @@ -652,7 +652,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, if (id > PLL_MAX_ID || !lock || !parent_hw) return ERR_PTR(-EINVAL); - frac = kzalloc_obj(*frac, GFP_KERNEL); + frac = kzalloc_obj(*frac); if (!frac) return ERR_PTR(-ENOMEM); @@ -744,7 +744,7 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, if (safe_div >= PLL_DIV_MAX) safe_div = PLL_DIV_MAX - 1; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index e39db89e2a37..f0cad50e490b 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -52,7 +52,7 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, if (!parent_names || !num_parents) return ERR_PTR(-EINVAL); - slowck = kzalloc_obj(*slowck, GFP_KERNEL); + slowck = kzalloc_obj(*slowck); if (!slowck) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 3c07dcd3cc2c..77f2b8fe6cab 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -118,7 +118,7 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - smd = kzalloc_obj(*smd, GFP_KERNEL); + smd = kzalloc_obj(*smd); if (!smd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c index c3de1dabf283..93e1e8cebce8 100644 --- a/drivers/clk/at91/clk-system.c +++ b/drivers/clk/at91/clk-system.c @@ -116,7 +116,7 @@ at91_clk_register_system(struct regmap *regmap, const char *name, if (!(parent_name || parent_hw) || id > SYSTEM_MAX_ID) return ERR_PTR(-EINVAL); - sys = kzalloc_obj(*sys, GFP_KERNEL); + sys = kzalloc_obj(*sys); if (!sys) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c index e5107d0cf383..b4dc86193e09 100644 --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -229,7 +229,7 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc_obj(*usb, GFP_KERNEL); + usb = kzalloc_obj(*usb); if (!usb) return ERR_PTR(-ENOMEM); @@ -280,7 +280,7 @@ at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc_obj(*usb, GFP_KERNEL); + usb = kzalloc_obj(*usb); if (!usb) return ERR_PTR(-ENOMEM); @@ -399,7 +399,7 @@ at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, struct clk_init_data init; int ret; - usb = kzalloc_obj(*usb, GFP_KERNEL); + usb = kzalloc_obj(*usb); if (!usb) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c index f318c11bbc44..40b335b0195c 100644 --- a/drivers/clk/at91/clk-utmi.c +++ b/drivers/clk/at91/clk-utmi.c @@ -155,7 +155,7 @@ at91_clk_register_utmi_internal(struct regmap *regmap_pmc, if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); - utmi = kzalloc_obj(*utmi, GFP_KERNEL); + utmi = kzalloc_obj(*utmi); if (!utmi) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index dddcfcf453a1..5d543e807843 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -369,7 +369,7 @@ of_at91_clk_master_get_characteristics(struct device_node *np) { struct clk_master_characteristics *characteristics; - characteristics = kzalloc_obj(*characteristics, GFP_KERNEL); + characteristics = kzalloc_obj(*characteristics); if (!characteristics) return NULL; @@ -568,11 +568,11 @@ of_at91_clk_pll_get_characteristics(struct device_node *np) return NULL; num_output /= num_cells; - characteristics = kzalloc_obj(*characteristics, GFP_KERNEL); + characteristics = kzalloc_obj(*characteristics); if (!characteristics) return NULL; - output = kzalloc_objs(*output, num_output, GFP_KERNEL); + output = kzalloc_objs(*output, num_output); if (!output) goto out_free_characteristics; diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c index 8ce851dc3e3f..61fcb3d1ee40 100644 --- a/drivers/clk/at91/sckc.c +++ b/drivers/clk/at91/sckc.c @@ -132,7 +132,7 @@ at91_clk_register_slow_osc(void __iomem *sckcr, if (!sckcr || !name || !parent_data) return ERR_PTR(-EINVAL); - osc = kzalloc_obj(*osc, GFP_KERNEL); + osc = kzalloc_obj(*osc); if (!osc) return ERR_PTR(-ENOMEM); @@ -239,7 +239,7 @@ at91_clk_register_slow_rc_osc(void __iomem *sckcr, if (!sckcr || !name) return ERR_PTR(-EINVAL); - osc = kzalloc_obj(*osc, GFP_KERNEL); + osc = kzalloc_obj(*osc); if (!osc) return ERR_PTR(-ENOMEM); @@ -332,7 +332,7 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr, if (!sckcr || !name || !parent_hws || !num_parents) return ERR_PTR(-EINVAL); - slowck = kzalloc_obj(*slowck, GFP_KERNEL); + slowck = kzalloc_obj(*slowck); if (!slowck) return ERR_PTR(-ENOMEM); @@ -611,7 +611,7 @@ static void __init of_sama5d4_sckc_setup(struct device_node *np) goto unregister_slow_rc; parent_data.fw_name = xtal_name; - osc = kzalloc_obj(*osc, GFP_KERNEL); + osc = kzalloc_obj(*osc); if (!osc) goto unregister_slow_rc; diff --git a/drivers/clk/axis/clk-artpec6.c b/drivers/clk/axis/clk-artpec6.c index 792f00b7c94e..a6f1499629dd 100644 --- a/drivers/clk/axis/clk-artpec6.c +++ b/drivers/clk/axis/clk-artpec6.c @@ -49,7 +49,7 @@ static void of_artpec6_clkctrl_setup(struct device_node *np) sys_refclk_name = of_clk_get_parent_name(np, i); - clkdata = kzalloc_obj(*clkdata, GFP_KERNEL); + clkdata = kzalloc_obj(*clkdata); if (!clkdata) return; diff --git a/drivers/clk/axs10x/pll_clock.c b/drivers/clk/axs10x/pll_clock.c index 594455f0918a..5ab1c220c62d 100644 --- a/drivers/clk/axs10x/pll_clock.c +++ b/drivers/clk/axs10x/pll_clock.c @@ -265,7 +265,7 @@ static void __init of_axs10x_pll_clk_setup(struct device_node *node) struct clk_init_data init = { }; int ret; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (!pll_clk) return; diff --git a/drivers/clk/baikal-t1/ccu-div.c b/drivers/clk/baikal-t1/ccu-div.c index c9dd59b1c551..cc48e580e159 100644 --- a/drivers/clk/baikal-t1/ccu-div.c +++ b/drivers/clk/baikal-t1/ccu-div.c @@ -447,7 +447,7 @@ static void ccu_div_var_debug_init(struct clk_hw *hw, struct dentry *dentry) num += !!(div->flags & CLK_SET_RATE_GATE) + !!(div->features & CCU_DIV_RESET_DOMAIN); - bits = kzalloc_objs(*bits, num, GFP_KERNEL); + bits = kzalloc_objs(*bits, num); if (!bits) return; @@ -489,7 +489,7 @@ static void ccu_div_gate_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_div *div = to_ccu_div(hw); struct ccu_div_dbgfs_bit *bit; - bit = kmalloc_obj(*bit, GFP_KERNEL); + bit = kmalloc_obj(*bit); if (!bit) return; @@ -507,7 +507,7 @@ static void ccu_div_buf_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_div *div = to_ccu_div(hw); struct ccu_div_dbgfs_bit *bit; - bit = kmalloc_obj(*bit, GFP_KERNEL); + bit = kmalloc_obj(*bit); if (!bit) return; @@ -585,7 +585,7 @@ struct ccu_div *ccu_div_hw_register(const struct ccu_div_init_data *div_init) if (!div_init) return ERR_PTR(-EINVAL); - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/ccu-pll.c b/drivers/clk/baikal-t1/ccu-pll.c index 02b3390cf87f..da7fbebb39ab 100644 --- a/drivers/clk/baikal-t1/ccu-pll.c +++ b/drivers/clk/baikal-t1/ccu-pll.c @@ -445,7 +445,7 @@ static void ccu_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) struct ccu_pll_dbgfs_fld *flds; int idx; - bits = kzalloc_objs(*bits, CCU_PLL_DBGFS_BIT_NUM, GFP_KERNEL); + bits = kzalloc_objs(*bits, CCU_PLL_DBGFS_BIT_NUM); if (!bits) return; @@ -458,7 +458,7 @@ static void ccu_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) &ccu_pll_dbgfs_bit_fops); } - flds = kzalloc_objs(*flds, CCU_PLL_DBGFS_FLD_NUM, GFP_KERNEL); + flds = kzalloc_objs(*flds, CCU_PLL_DBGFS_FLD_NUM); if (!flds) return; @@ -508,7 +508,7 @@ struct ccu_pll *ccu_pll_hw_register(const struct ccu_pll_init_data *pll_init) if (!pll_init) return ERR_PTR(-EINVAL); - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/ccu-rst.c b/drivers/clk/baikal-t1/ccu-rst.c index 18a60273a174..969e5de381a8 100644 --- a/drivers/clk/baikal-t1/ccu-rst.c +++ b/drivers/clk/baikal-t1/ccu-rst.c @@ -172,7 +172,7 @@ struct ccu_rst *ccu_rst_hw_register(const struct ccu_rst_init_data *rst_init) if (!rst_init) return ERR_PTR(-EINVAL); - rst = kzalloc_obj(*rst, GFP_KERNEL); + rst = kzalloc_obj(*rst); if (!rst) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/baikal-t1/clk-ccu-div.c b/drivers/clk/baikal-t1/clk-ccu-div.c index addccc4014f9..d32072e4dd49 100644 --- a/drivers/clk/baikal-t1/clk-ccu-div.c +++ b/drivers/clk/baikal-t1/clk-ccu-div.c @@ -271,7 +271,7 @@ static struct ccu_div_data *ccu_div_create_data(struct device_node *np) struct ccu_div_data *data; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); @@ -289,7 +289,7 @@ static struct ccu_div_data *ccu_div_create_data(struct device_node *np) goto err_kfree_data; } - data->divs = kzalloc_objs(*data->divs, data->divs_num, GFP_KERNEL); + data->divs = kzalloc_objs(*data->divs, data->divs_num); if (!data->divs) { ret = -ENOMEM; goto err_kfree_data; diff --git a/drivers/clk/baikal-t1/clk-ccu-pll.c b/drivers/clk/baikal-t1/clk-ccu-pll.c index ace46b60497e..e5e4a6ea6f78 100644 --- a/drivers/clk/baikal-t1/clk-ccu-pll.c +++ b/drivers/clk/baikal-t1/clk-ccu-pll.c @@ -100,7 +100,7 @@ static struct ccu_pll_data *ccu_pll_create_data(struct device_node *np) { struct ccu_pll_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 971131677b5a..118df86d717c 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1357,7 +1357,7 @@ static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman, init.ops = &bcm2835_pll_clk_ops; init.flags = pll_data->flags | CLK_IGNORE_UNUSED; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return NULL; diff --git a/drivers/clk/bcm/clk-bcm53573-ilp.c b/drivers/clk/bcm/clk-bcm53573-ilp.c index e12a5384b95f..fb4f3b756282 100644 --- a/drivers/clk/bcm/clk-bcm53573-ilp.c +++ b/drivers/clk/bcm/clk-bcm53573-ilp.c @@ -102,7 +102,7 @@ static void bcm53573_ilp_init(struct device_node *np) const char *parent_name; int err; - ilp = kzalloc_obj(*ilp, GFP_KERNEL); + ilp = kzalloc_obj(*ilp); if (!ilp) return; diff --git a/drivers/clk/bcm/clk-iproc-armpll.c b/drivers/clk/bcm/clk-iproc-armpll.c index e08e828666ea..8485428fe49c 100644 --- a/drivers/clk/bcm/clk-iproc-armpll.c +++ b/drivers/clk/bcm/clk-iproc-armpll.c @@ -238,7 +238,7 @@ void __init iproc_armpll_setup(struct device_node *node) struct clk_init_data init; const char *parent_name; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (WARN_ON(!pll)) return; diff --git a/drivers/clk/bcm/clk-iproc-asiu.c b/drivers/clk/bcm/clk-iproc-asiu.c index 258c6b2921bd..eea99037a4ed 100644 --- a/drivers/clk/bcm/clk-iproc-asiu.c +++ b/drivers/clk/bcm/clk-iproc-asiu.c @@ -188,7 +188,7 @@ void __init iproc_asiu_setup(struct device_node *node, if (WARN_ON(!gate || !div)) return; - asiu = kzalloc_obj(*asiu, GFP_KERNEL); + asiu = kzalloc_obj(*asiu); if (WARN_ON(!asiu)) return; @@ -198,7 +198,7 @@ void __init iproc_asiu_setup(struct device_node *node, goto err_clks; asiu->clk_data->num = num_clks; - asiu->clks = kzalloc_objs(*asiu->clks, num_clks, GFP_KERNEL); + asiu->clks = kzalloc_objs(*asiu->clks, num_clks); if (WARN_ON(!asiu->clks)) goto err_asiu_clks; diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c index 3eab95a59b50..a40c85f833f2 100644 --- a/drivers/clk/bcm/clk-iproc-pll.c +++ b/drivers/clk/bcm/clk-iproc-pll.c @@ -731,7 +731,7 @@ void iproc_pll_clk_setup(struct device_node *node, if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl)) return; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (WARN_ON(!pll)) return; @@ -740,7 +740,7 @@ void iproc_pll_clk_setup(struct device_node *node, goto err_clk_data; clk_data->num = num_clks; - iclk_array = kzalloc_objs(struct iproc_clk, num_clks, GFP_KERNEL); + iclk_array = kzalloc_objs(struct iproc_clk, num_clks); if (WARN_ON(!iclk_array)) goto err_clks; diff --git a/drivers/clk/berlin/berlin2-avpll.c b/drivers/clk/berlin/berlin2-avpll.c index 4c5881baf027..c801d42397bf 100644 --- a/drivers/clk/berlin/berlin2-avpll.c +++ b/drivers/clk/berlin/berlin2-avpll.c @@ -184,7 +184,7 @@ int __init berlin2_avpll_vco_register(void __iomem *base, struct berlin2_avpll_vco *vco; struct clk_init_data init; - vco = kzalloc_obj(*vco, GFP_KERNEL); + vco = kzalloc_obj(*vco); if (!vco) return -ENOMEM; @@ -360,7 +360,7 @@ int __init berlin2_avpll_channel_register(void __iomem *base, struct berlin2_avpll_channel *ch; struct clk_init_data init; - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) return -ENOMEM; diff --git a/drivers/clk/berlin/berlin2-div.c b/drivers/clk/berlin/berlin2-div.c index 6498823133c0..8d2123f0bea2 100644 --- a/drivers/clk/berlin/berlin2-div.c +++ b/drivers/clk/berlin/berlin2-div.c @@ -236,7 +236,7 @@ berlin2_div_register(const struct berlin2_div_map *map, const struct clk_ops *gate_ops = &berlin2_div_gate_ops; struct berlin2_div *div; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/berlin/berlin2-pll.c b/drivers/clk/berlin/berlin2-pll.c index 6557b275a718..d0ec3d0bcf3e 100644 --- a/drivers/clk/berlin/berlin2-pll.c +++ b/drivers/clk/berlin/berlin2-pll.c @@ -81,7 +81,7 @@ berlin2_pll_register(const struct berlin2_pll_map *map, struct clk_init_data init; struct berlin2_pll *pll; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return -ENOMEM; diff --git a/drivers/clk/clk-bm1880.c b/drivers/clk/clk-bm1880.c index 47c64f16e129..46251008c83f 100644 --- a/drivers/clk/clk-bm1880.c +++ b/drivers/clk/clk-bm1880.c @@ -764,7 +764,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc int ret; if (clks->mux_shift >= 0) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -784,7 +784,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc } if (clks->gate_shift >= 0) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { ret = -ENOMEM; goto err_out; @@ -799,7 +799,7 @@ static struct clk_hw *bm1880_clk_register_composite(struct bm1880_composite_cloc } if (clks->div_shift >= 0) { - div_hws = kzalloc_obj(*div_hws, GFP_KERNEL); + div_hws = kzalloc_obj(*div_hws); if (!div_hws) { ret = -ENOMEM; goto err_out; diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index 1039cf038850..d85dae4bdf89 100644 --- a/drivers/clk/clk-bulk.c +++ b/drivers/clk/clk-bulk.c @@ -54,7 +54,7 @@ static int __must_check of_clk_bulk_get_all(struct device_node *np, if (!num_clks) return 0; - clk_bulk = kmalloc_objs(*clk_bulk, num_clks, GFP_KERNEL); + clk_bulk = kmalloc_objs(*clk_bulk, num_clks); if (!clk_bulk) return -ENOMEM; diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c index 20e45856e8d6..44d010bccfb1 100644 --- a/drivers/clk/clk-composite.c +++ b/drivers/clk/clk-composite.c @@ -248,7 +248,7 @@ static struct clk_hw *__clk_hw_register_composite(struct device *dev, struct clk_ops *clk_composite_ops; int ret; - composite = kzalloc_obj(*composite, GFP_KERNEL); + composite = kzalloc_obj(*composite); if (!composite) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index e91bcdb092db..45e7ebde4a8b 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -538,7 +538,7 @@ struct clk_hw *__clk_hw_register_divider(struct device *dev, } /* allocate the divider */ - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index a41f8706df18..ec0c953e4428 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -335,7 +335,7 @@ static int eqc_auxdev_create(struct device *dev, void __iomem *base, struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index 40cfb6af38bb..850e8b95f352 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -110,7 +110,7 @@ __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np, fix = devres_alloc(devm_clk_hw_register_fixed_factor_release, sizeof(*fix), GFP_KERNEL); else - fix = kmalloc_obj(*fix, GFP_KERNEL); + fix = kmalloc_obj(*fix); if (!fix) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index ef48ee88df46..5dcb1bccf2b4 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -78,7 +78,7 @@ struct clk_hw *__clk_hw_register_fixed_rate(struct device *dev, fixed = devres_alloc(devm_clk_hw_register_fixed_rate_release, sizeof(*fixed), GFP_KERNEL); else - fixed = kzalloc_obj(*fixed, GFP_KERNEL); + fixed = kzalloc_obj(*fixed); if (!fixed) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index 065ceb9b3a49..1c5fdcb68a50 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -275,7 +275,7 @@ struct clk_hw *clk_hw_register_fractional_divider(struct device *dev, struct clk_hw *hw; int ret; - fd = kzalloc_obj(*fd, GFP_KERNEL); + fd = kzalloc_obj(*fd); if (!fd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 0c5cbb3f3e75..44f5e0c53786 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -145,7 +145,7 @@ struct clk_hw *__clk_hw_register_gate(struct device *dev, } /* allocate the gate */ - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c index 877db2e6efd1..e51de3498d2c 100644 --- a/drivers/clk/clk-gemini.c +++ b/drivers/clk/clk-gemini.c @@ -197,7 +197,7 @@ static struct clk_hw *gemini_pci_clk_setup(const char *name, struct clk_init_data init; int ret; - pciclk = kzalloc_obj(*pciclk, GFP_KERNEL); + pciclk = kzalloc_obj(*pciclk); if (!pciclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-highbank.c b/drivers/clk/clk-highbank.c index 2642314b4735..e9b177811dfc 100644 --- a/drivers/clk/clk-highbank.c +++ b/drivers/clk/clk-highbank.c @@ -277,7 +277,7 @@ static void __init hb_clk_init(struct device_node *node, const struct clk_ops *o if (WARN_ON(rc)) return; - hb_clk = kzalloc_obj(*hb_clk, GFP_KERNEL); + hb_clk = kzalloc_obj(*hb_clk); if (WARN_ON(!hb_clk)) return; diff --git a/drivers/clk/clk-hsdk-pll.c b/drivers/clk/clk-hsdk-pll.c index 0ea108366136..0e257cce588e 100644 --- a/drivers/clk/clk-hsdk-pll.c +++ b/drivers/clk/clk-hsdk-pll.c @@ -357,7 +357,7 @@ static void __init of_hsdk_pll_clk_setup(struct device_node *node) struct hsdk_pll_clk *pll_clk; struct clk_init_data init = { }; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (!pll_clk) return; diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c index ffcb4e1b3488..6e27f5334cf8 100644 --- a/drivers/clk/clk-k210.c +++ b/drivers/clk/clk-k210.c @@ -893,7 +893,7 @@ static void __init k210_clk_init(struct device_node *np) struct k210_sysclk *ksc; int i, ret; - ksc = kzalloc_obj(*ksc, GFP_KERNEL); + ksc = kzalloc_obj(*ksc); if (!ksc) return; diff --git a/drivers/clk/clk-milbeaut.c b/drivers/clk/clk-milbeaut.c index 6a27411c9f9f..60224187b336 100644 --- a/drivers/clk/clk-milbeaut.c +++ b/drivers/clk/clk-milbeaut.c @@ -333,7 +333,7 @@ static struct clk_hw *m10v_clk_hw_register_mux(struct device *dev, struct clk_init_data init; int ret; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -464,7 +464,7 @@ static struct clk_hw *m10v_clk_hw_register_divider(struct device *dev, struct clk_init_data init; int ret; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index ee4a7065817f..1d5b6b68711e 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -169,7 +169,7 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np, } /* allocate the mux */ - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index d165ef6f320d..da6b89759a14 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -270,7 +270,7 @@ pll_clk_register(struct device *dev, const char *name, return ERR_PTR(-EINVAL); } - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); @@ -357,7 +357,7 @@ src_clk_register(struct device *dev, const char *name, struct clk_src *sclk; struct clk_init_data init; - sclk = kzalloc_obj(*sclk, GFP_KERNEL); + sclk = kzalloc_obj(*sclk); if (!sclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c index e02f3f1d5ea7..2cd1ae4f152d 100644 --- a/drivers/clk/clk-npcm7xx.c +++ b/drivers/clk/clk-npcm7xx.c @@ -74,7 +74,7 @@ npcm7xx_clk_register_pll(void __iomem *pllcon, const char *name, struct clk_hw *hw; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index c1e0b0a80da7..f05631e55310 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c @@ -976,7 +976,7 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) u64 max_rate, pct80_rate; u32 clksel; - hwc = kzalloc_obj(*hwc, GFP_KERNEL); + hwc = kzalloc_obj(*hwc); if (!hwc) return NULL; @@ -1020,7 +1020,7 @@ static struct clk * __init create_one_hwaccel(struct clockgen *cg, int idx) { struct mux_hwclock *hwc; - hwc = kzalloc_obj(*hwc, GFP_KERNEL); + hwc = kzalloc_obj(*hwc); if (!hwc) return NULL; @@ -1319,11 +1319,11 @@ static void __init legacy_pll_init(struct device_node *np, int idx) count = of_property_count_strings(np, "clock-output-names"); BUILD_BUG_ON(ARRAY_SIZE(pll->div) < 4); - subclks = kzalloc_objs(struct clk *, 4, GFP_KERNEL); + subclks = kzalloc_objs(struct clk *, 4); if (!subclks) return; - onecell_data = kmalloc_obj(*onecell_data, GFP_KERNEL); + onecell_data = kmalloc_obj(*onecell_data); if (!onecell_data) goto err_clks; diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c index 4e518b92797b..090e7f136e6e 100644 --- a/drivers/clk/clk-stm32f4.c +++ b/drivers/clk/clk-stm32f4.c @@ -489,7 +489,7 @@ static struct clk *clk_register_apb_mul(struct device *dev, const char *name, struct clk_init_data init; struct clk *clk; - am = kzalloc_obj(*am, GFP_KERNEL); + am = kzalloc_obj(*am); if (!am) return ERR_PTR(-ENOMEM); @@ -815,7 +815,7 @@ static struct clk_hw *clk_register_pll_div(const char *name, int ret; /* allocate the divider */ - pll_div = kzalloc_obj(*pll_div, GFP_KERNEL); + pll_div = kzalloc_obj(*pll_div); if (!pll_div) return ERR_PTR(-ENOMEM); @@ -937,7 +937,7 @@ static struct clk_hw *stm32f4_rcc_register_pll(const char *pllsrc, const struct stm32f4_vco_data *vco; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); @@ -1107,7 +1107,7 @@ static struct clk_hw *clk_register_rgate(struct device *dev, const char *name, struct clk_hw *hw; int ret; - rgate = kzalloc_obj(*rgate, GFP_KERNEL); + rgate = kzalloc_obj(*rgate); if (!rgate) return ERR_PTR(-ENOMEM); @@ -1202,13 +1202,13 @@ static struct clk_hw *stm32_register_cclk(struct device *dev, const char *name, struct clk_gate *gate; struct clk_mux *mux; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { hw = ERR_PTR(-EINVAL); goto fail; } - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) { kfree(gate); hw = ERR_PTR(-EINVAL); @@ -1776,7 +1776,7 @@ static struct clk_hw *stm32_register_aux_clk(const char *name, const struct clk_ops *mux_ops = NULL, *gate_ops = NULL; if (offset_gate != NO_GATE) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { hw = ERR_PTR(-EINVAL); goto fail; @@ -1791,7 +1791,7 @@ static struct clk_hw *stm32_register_aux_clk(const char *name, } if (offset_mux != NO_MUX) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) { hw = ERR_PTR(-EINVAL); goto fail; diff --git a/drivers/clk/clk-stm32h7.c b/drivers/clk/clk-stm32h7.c index 66fd934070b7..6909bb95dc5e 100644 --- a/drivers/clk/clk-stm32h7.c +++ b/drivers/clk/clk-stm32h7.c @@ -222,7 +222,7 @@ static struct clk_hw *clk_register_ready_gate(struct device *dev, struct clk_hw *hw; int ret; - rgate = kzalloc_obj(*rgate, GFP_KERNEL); + rgate = kzalloc_obj(*rgate); if (!rgate) return ERR_PTR(-ENOMEM); @@ -297,7 +297,7 @@ static struct clk_mux *_get_cmux(void __iomem *reg, u8 shift, u8 width, { struct clk_mux *mux; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -315,7 +315,7 @@ static struct clk_divider *_get_cdiv(void __iomem *reg, u8 shift, u8 width, { struct clk_divider *div; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); @@ -334,7 +334,7 @@ static struct clk_gate *_get_cgate(void __iomem *reg, u8 bit_idx, u32 flags, { struct clk_gate *gate; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); @@ -467,7 +467,7 @@ static struct clk_hw *clk_register_stm32_timer_ker(struct device *dev, struct clk_hw *hw; int err; - element = kzalloc_obj(*element, GFP_KERNEL); + element = kzalloc_obj(*element); if (!element) return ERR_PTR(-ENOMEM); @@ -792,7 +792,7 @@ static struct clk_hw *clk_register_stm32_pll(struct device *dev, struct stm32_fractional_divider *div = NULL; struct stm32_ready_gate *rgate; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index 6065141750af..3e62cb853d5e 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c @@ -235,7 +235,7 @@ static __init void vtwm_device_clk_init(struct device_node *node) if (!pmc_base) vtwm_set_pmc_base(); - dev_clk = kzalloc_obj(*dev_clk, GFP_KERNEL); + dev_clk = kzalloc_obj(*dev_clk); if (WARN_ON(!dev_clk)) return; @@ -698,7 +698,7 @@ static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) if (WARN_ON(rc)) return; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c index ebf47b1f5433..ba3b1057e4f0 100644 --- a/drivers/clk/clk-xgene.c +++ b/drivers/clk/clk-xgene.c @@ -131,7 +131,7 @@ static struct clk *xgene_register_clk_pll(struct device *dev, struct clk_init_data init; /* allocate the APM clock structure */ - apmclk = kzalloc_obj(*apmclk, GFP_KERNEL); + apmclk = kzalloc_obj(*apmclk); if (!apmclk) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ xgene_register_clk_pmd(struct device *dev, struct clk_init_data init; struct clk *clk; - fd = kzalloc_obj(*fd, GFP_KERNEL); + fd = kzalloc_obj(*fd); if (!fd) return ERR_PTR(-ENOMEM); @@ -638,7 +638,7 @@ static struct clk *xgene_register_clk(struct device *dev, int rc; /* allocate the APM clock structure */ - apmclk = kzalloc_obj(*apmclk, GFP_KERNEL); + apmclk = kzalloc_obj(*apmclk); if (!apmclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 5789cd93bfc2..47093cda9df3 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -4121,7 +4121,7 @@ static struct clk *alloc_clk(struct clk_core *core, const char *dev_id, { struct clk *clk; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); @@ -4238,7 +4238,7 @@ static int clk_core_populate_parent_map(struct clk_core *core, * Avoid unnecessary string look-ups of clk_core's possible parents by * having a cache of names/clk_hw pointers to clk_core pointers. */ - parents = kzalloc_objs(*parents, num_parents, GFP_KERNEL); + parents = kzalloc_objs(*parents, num_parents); core->parents = parents; if (!parents) return -ENOMEM; @@ -4328,7 +4328,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) */ hw->init = NULL; - core = kzalloc_obj(*core, GFP_KERNEL); + core = kzalloc_obj(*core); if (!core) { ret = -ENOMEM; goto fail_out; @@ -4813,7 +4813,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) goto found; /* if clk wasn't in the notifier list, allocate new clk_notifier */ - cn = kzalloc_obj(*cn, GFP_KERNEL); + cn = kzalloc_obj(*cn); if (!cn) goto out; @@ -5009,7 +5009,7 @@ int of_clk_add_provider(struct device_node *np, if (!np) return 0; - cp = kzalloc_obj(*cp, GFP_KERNEL); + cp = kzalloc_obj(*cp); if (!cp) return -ENOMEM; @@ -5051,7 +5051,7 @@ int of_clk_add_hw_provider(struct device_node *np, if (!np) return 0; - cp = kzalloc_obj(*cp, GFP_KERNEL); + cp = kzalloc_obj(*cp); if (!cp) return -ENOMEM; @@ -5548,7 +5548,7 @@ void __init of_clk_init(const struct of_device_id *matches) if (!of_device_is_available(np)) continue; - parent = kzalloc_obj(*parent, GFP_KERNEL); + parent = kzalloc_obj(*parent); if (!parent) { list_for_each_entry_safe(clk_provider, next, &clk_provider_list, node) { diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 4d1dbd9fb807..abaa0f9e0083 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -164,7 +164,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt, size_t max_size; ssize_t res; - cla = kzalloc_obj(*cla, GFP_KERNEL); + cla = kzalloc_obj(*cla); if (!cla) return NULL; diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c index eda3c3a45c52..f73b0ac5d8a0 100644 --- a/drivers/clk/davinci/pll.c +++ b/drivers/clk/davinci/pll.c @@ -243,14 +243,14 @@ static struct clk *davinci_pll_div_register(struct device *dev, struct clk *clk; int ret; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); gate->reg = reg; gate->bit_idx = DIV_ENABLE_SHIFT; - divider = kzalloc_obj(*divider, GFP_KERNEL); + divider = kzalloc_obj(*divider); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -433,7 +433,7 @@ struct clk *davinci_pll_clk_register(struct device *dev, info->unlock_mask, 0); } - pllout = kzalloc_obj(*pllout, GFP_KERNEL); + pllout = kzalloc_obj(*pllout); if (!pllout) { ret = -ENOMEM; goto err_unregister_prediv; @@ -489,7 +489,7 @@ struct clk *davinci_pll_clk_register(struct device *dev, parent_name = postdiv_name; } - pllen = kzalloc_obj(*pllen, GFP_KERNEL); + pllen = kzalloc_obj(*pllen); if (!pllen) { ret = -ENOMEM; goto err_unregister_postdiv; @@ -579,7 +579,7 @@ davinci_pll_obsclk_register(struct device *dev, u32 oscdiv; int ret; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -587,7 +587,7 @@ davinci_pll_obsclk_register(struct device *dev, mux->table = info->table; mux->mask = info->ocsrc_mask; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { ret = -ENOMEM; goto err_free_mux; @@ -596,7 +596,7 @@ davinci_pll_obsclk_register(struct device *dev, gate->reg = base + CKEN; gate->bit_idx = CKEN_OBSCLK_SHIFT; - divider = kzalloc_obj(*divider, GFP_KERNEL); + divider = kzalloc_obj(*divider); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -690,14 +690,14 @@ davinci_pll_sysclk_register(struct device *dev, else reg = PLLDIV4 + 4 * (info->id - 4); - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); gate->reg = base + reg; gate->bit_idx = DIV_ENABLE_SHIFT; - divider = kzalloc_obj(*divider, GFP_KERNEL); + divider = kzalloc_obj(*divider); if (!divider) { ret = -ENOMEM; goto err_free_gate; @@ -776,13 +776,13 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node, int n_clks = max_sysclk_id + 1; int i; - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) { of_node_put(child); return -ENOMEM; } - clks = kmalloc_objs(*clks, n_clks, GFP_KERNEL); + clks = kmalloc_objs(*clks, n_clks); if (!clks) { kfree(clk_data); of_node_put(child); @@ -942,7 +942,7 @@ static void davinci_pll_debug_init(struct clk_hw *hw, struct dentry *dentry) struct davinci_pll_clk *pll = to_davinci_pll_clk(hw); struct debugfs_regset32 *regset; - regset = kzalloc_obj(*regset, GFP_KERNEL); + regset = kzalloc_obj(*regset); if (!regset) return; diff --git a/drivers/clk/davinci/psc.c b/drivers/clk/davinci/psc.c index 5a593f20ce81..ff603520d56f 100644 --- a/drivers/clk/davinci/psc.c +++ b/drivers/clk/davinci/psc.c @@ -239,7 +239,7 @@ davinci_lpsc_clk_register(struct device *dev, const char *name, int ret; bool is_on; - lpsc = kzalloc_obj(*lpsc, GFP_KERNEL); + lpsc = kzalloc_obj(*lpsc); if (!lpsc) return ERR_PTR(-ENOMEM); @@ -372,11 +372,11 @@ __davinci_psc_register_clocks(struct device *dev, struct regmap *regmap; int i, ret; - psc = kzalloc_obj(*psc, GFP_KERNEL); + psc = kzalloc_obj(*psc); if (!psc) return ERR_PTR(-ENOMEM); - clks = kmalloc_objs(*clks, num_clks, GFP_KERNEL); + clks = kmalloc_objs(*clks, num_clks); if (!clks) { ret = -ENOMEM; goto err_free_psc; @@ -392,7 +392,7 @@ __davinci_psc_register_clocks(struct device *dev, for (i = 0; i < num_clks; i++) clks[i] = ERR_PTR(-ENOENT); - pm_domains = kzalloc_objs(*pm_domains, num_clks, GFP_KERNEL); + pm_domains = kzalloc_objs(*pm_domains, num_clks); if (!pm_domains) { ret = -ENOMEM; goto err_free_clks; diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c index 069ea7b56c09..8dcad74e679a 100644 --- a/drivers/clk/hisilicon/clk-hi3620.c +++ b/drivers/clk/hisilicon/clk-hi3620.c @@ -414,7 +414,7 @@ static struct clk *hisi_register_clk_mmc(struct hisi_mmc_clock *mmc_clk, struct clk *clk; struct clk_init_data init; - mclk = kzalloc_obj(*mclk, GFP_KERNEL); + mclk = kzalloc_obj(*mclk); if (!mclk) return ERR_PTR(-ENOMEM); @@ -461,11 +461,11 @@ static void __init hi3620_mmc_clk_init(struct device_node *node) return; } - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (WARN_ON(!clk_data)) return; - clk_data->clks = kzalloc_objs(*clk_data->clks, num, GFP_KERNEL); + clk_data->clks = kzalloc_objs(*clk_data->clks, num); if (!clk_data->clks) { kfree(clk_data); return; diff --git a/drivers/clk/hisilicon/clk-hix5hd2.c b/drivers/clk/hisilicon/clk-hix5hd2.c index 31a9ab1758f1..57db6fab43aa 100644 --- a/drivers/clk/hisilicon/clk-hix5hd2.c +++ b/drivers/clk/hisilicon/clk-hix5hd2.c @@ -261,7 +261,7 @@ hix5hd2_clk_register_complex(struct hix5hd2_complex_clock *clks, int nums, struct clk *clk; struct clk_init_data init; - p_clk = kzalloc_obj(*p_clk, GFP_KERNEL); + p_clk = kzalloc_obj(*p_clk); if (!p_clk) return; diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index 8b37a6310289..fae65127cd4a 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -68,12 +68,12 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np, goto err; } - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) goto err; clk_data->base = base; - clk_table = kzalloc_objs(*clk_table, nr_clks, GFP_KERNEL); + clk_table = kzalloc_objs(*clk_table, nr_clks); if (!clk_table) goto err_data; diff --git a/drivers/clk/hisilicon/clkdivider-hi6220.c b/drivers/clk/hisilicon/clkdivider-hi6220.c index c59c2c38812b..1787ecefe601 100644 --- a/drivers/clk/hisilicon/clkdivider-hi6220.c +++ b/drivers/clk/hisilicon/clkdivider-hi6220.c @@ -109,7 +109,7 @@ struct clk *hi6220_register_clkdiv(struct device *dev, const char *name, int i; /* allocate the divider */ - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); @@ -117,7 +117,7 @@ struct clk *hi6220_register_clkdiv(struct device *dev, const char *name, max_div = div_mask(width) + 1; min_div = 1; - table = kzalloc_objs(*table, max_div + 1, GFP_KERNEL); + table = kzalloc_objs(*table, max_div + 1); if (!table) { kfree(div); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/hisilicon/clkgate-separated.c b/drivers/clk/hisilicon/clkgate-separated.c index cb4fd20f7639..199303157ebd 100644 --- a/drivers/clk/hisilicon/clkgate-separated.c +++ b/drivers/clk/hisilicon/clkgate-separated.c @@ -90,7 +90,7 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name, struct clk *clk; struct clk_init_data init; - sclk = kzalloc_obj(*sclk, GFP_KERNEL); + sclk = kzalloc_obj(*sclk); if (!sclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-busy.c b/drivers/clk/imx/clk-busy.c index a6886a73aa24..b8b6e7c7e1fe 100644 --- a/drivers/clk/imx/clk-busy.c +++ b/drivers/clk/imx/clk-busy.c @@ -82,7 +82,7 @@ struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name struct clk_init_data init; int ret; - busy = kzalloc_obj(*busy, GFP_KERNEL); + busy = kzalloc_obj(*busy); if (!busy) return ERR_PTR(-ENOMEM); @@ -162,7 +162,7 @@ struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift struct clk_init_data init; int ret; - busy = kzalloc_obj(*busy, GFP_KERNEL); + busy = kzalloc_obj(*busy); if (!busy) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index 59c2b392db44..689e3479d14d 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -99,7 +99,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (mux_present) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); mux_hw = &mux->hw; @@ -111,7 +111,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (rate_present) { - fd = kzalloc_obj(*fd, GFP_KERNEL); + fd = kzalloc_obj(*fd); if (!fd) { kfree(mux); return ERR_PTR(-ENOMEM); @@ -128,7 +128,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, } if (gate_present) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { kfree(mux); kfree(fd); diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index e5ccb6810822..e63e0cb4b203 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -231,7 +231,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, const struct clk_ops *mux_ops; const struct clk_ops *gate_ops; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_CAST(hw); @@ -241,7 +241,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, mux->mask = PCG_PCS_MASK; mux->lock = &imx_ccm_lock; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto free_mux; @@ -270,7 +270,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, div->flags = CLK_DIVIDER_ROUND_CLOSEST; /* skip registering the gate ops if M4 is enabled */ - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto free_div; diff --git a/drivers/clk/imx/clk-composite-93.c b/drivers/clk/imx/clk-composite-93.c index db006eba18f8..ef20ceb2d255 100644 --- a/drivers/clk/imx/clk-composite-93.c +++ b/drivers/clk/imx/clk-composite-93.c @@ -193,7 +193,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p bool clk_ro = false; u32 authen; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) goto fail; @@ -203,7 +203,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p mux->mask = CCM_MUX_MASK; mux->lock = &imx_ccm_lock; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto fail; @@ -223,7 +223,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p mux_hw, &clk_mux_ro_ops, div_hw, &clk_divider_ro_ops, NULL, NULL, flags); } else { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto fail; diff --git a/drivers/clk/imx/clk-cpu.c b/drivers/clk/imx/clk-cpu.c index e63296483504..f53dbaacddcc 100644 --- a/drivers/clk/imx/clk-cpu.c +++ b/drivers/clk/imx/clk-cpu.c @@ -81,7 +81,7 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name, struct clk_init_data init; int ret; - cpu = kzalloc_obj(*cpu, GFP_KERNEL); + cpu = kzalloc_obj(*cpu); if (!cpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-divider-gate.c b/drivers/clk/imx/clk-divider-gate.c index 51042ba556d0..957d132c4607 100644 --- a/drivers/clk/imx/clk-divider-gate.c +++ b/drivers/clk/imx/clk-divider-gate.c @@ -185,7 +185,7 @@ struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name u32 val; int ret; - div_gate = kzalloc_obj(*div_gate, GFP_KERNEL); + div_gate = kzalloc_obj(*div_gate); if (!div_gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fixup-div.c b/drivers/clk/imx/clk-fixup-div.c index a90609aec218..3866319af54e 100644 --- a/drivers/clk/imx/clk-fixup-div.c +++ b/drivers/clk/imx/clk-fixup-div.c @@ -97,7 +97,7 @@ struct clk_hw *imx_clk_hw_fixup_divider(const char *name, const char *parent, if (!fixup) return ERR_PTR(-EINVAL); - fixup_div = kzalloc_obj(*fixup_div, GFP_KERNEL); + fixup_div = kzalloc_obj(*fixup_div); if (!fixup_div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fixup-mux.c b/drivers/clk/imx/clk-fixup-mux.c index b1c887fc99c4..7188cdad79d3 100644 --- a/drivers/clk/imx/clk-fixup-mux.c +++ b/drivers/clk/imx/clk-fixup-mux.c @@ -77,7 +77,7 @@ struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg, if (!fixup) return ERR_PTR(-EINVAL); - fixup_mux = kzalloc_obj(*fixup_mux, GFP_KERNEL); + fixup_mux = kzalloc_obj(*fixup_mux); if (!fixup_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-frac-pll.c b/drivers/clk/imx/clk-frac-pll.c index fba0c0f449df..cd4e26bac19c 100644 --- a/drivers/clk/imx/clk-frac-pll.c +++ b/drivers/clk/imx/clk-frac-pll.c @@ -213,7 +213,7 @@ struct clk_hw *imx_clk_hw_frac_pll(const char *name, struct clk_hw *hw; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c index 3cd1fd106aac..89ed7749bf47 100644 --- a/drivers/clk/imx/clk-fracn-gppll.c +++ b/drivers/clk/imx/clk-fracn-gppll.c @@ -366,7 +366,7 @@ static struct clk_hw *_imx_clk_fracn_gppll(const char *name, const char *parent_ struct clk_init_data init; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gate-93.c b/drivers/clk/imx/clk-gate-93.c index 0422e17a8233..7acbcfec9610 100644 --- a/drivers/clk/imx/clk-gate-93.c +++ b/drivers/clk/imx/clk-gate-93.c @@ -164,7 +164,7 @@ struct clk_hw *imx93_clk_gate(struct device *dev, const char *name, const char * int ret; u32 authen; - gate = kzalloc_obj(struct imx93_clk_gate, GFP_KERNEL); + gate = kzalloc_obj(struct imx93_clk_gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gate-exclusive.c b/drivers/clk/imx/clk-gate-exclusive.c index 2f0db88cbbcf..504cfeef28a0 100644 --- a/drivers/clk/imx/clk-gate-exclusive.c +++ b/drivers/clk/imx/clk-gate-exclusive.c @@ -67,7 +67,7 @@ struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent, if (exclusive_mask == 0) return ERR_PTR(-EINVAL); - exgate = kzalloc_obj(*exgate, GFP_KERNEL); + exgate = kzalloc_obj(*exgate); if (!exgate) return ERR_PTR(-ENOMEM); gate = &exgate->gate; diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c index d57c146a66cf..f07cf82dd9c9 100644 --- a/drivers/clk/imx/clk-gate2.c +++ b/drivers/clk/imx/clk-gate2.c @@ -144,7 +144,7 @@ struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name, struct clk_init_data init; int ret; - gate = kzalloc_obj(struct clk_gate2, GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate2); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-gpr-mux.c b/drivers/clk/imx/clk-gpr-mux.c index 01f7142e7a98..27b9a6e26997 100644 --- a/drivers/clk/imx/clk-gpr-mux.c +++ b/drivers/clk/imx/clk-gpr-mux.c @@ -87,7 +87,7 @@ struct clk_hw *imx_clk_gpr_mux(const char *name, const char *compatible, return ERR_CAST(regmap); } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-lpcg-scu.c b/drivers/clk/imx/clk-lpcg-scu.c index 9e1247bb1edd..03bbfbe9bff3 100644 --- a/drivers/clk/imx/clk-lpcg-scu.c +++ b/drivers/clk/imx/clk-lpcg-scu.c @@ -119,7 +119,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name, struct clk_hw *hw; int ret; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c index 5222e5ee37d1..e7a5d80c5008 100644 --- a/drivers/clk/imx/clk-pfd.c +++ b/drivers/clk/imx/clk-pfd.c @@ -132,7 +132,7 @@ struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name, struct clk_init_data init; int ret; - pfd = kzalloc_obj(*pfd, GFP_KERNEL); + pfd = kzalloc_obj(*pfd); if (!pfd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c index ce37a151c745..0f92b92e2229 100644 --- a/drivers/clk/imx/clk-pfdv2.c +++ b/drivers/clk/imx/clk-pfdv2.c @@ -210,7 +210,7 @@ struct clk_hw *imx_clk_hw_pfdv2(enum imx_pfdv2_type type, const char *name, WARN_ON(idx > 3); - pfd = kzalloc_obj(*pfd, GFP_KERNEL); + pfd = kzalloc_obj(*pfd); if (!pfd) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index 33974d762e4d..7552aaafc339 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -504,7 +504,7 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, int ret; u32 val; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv1.c b/drivers/clk/imx/clk-pllv1.c index 502f29d44f52..da5531e57da2 100644 --- a/drivers/clk/imx/clk-pllv1.c +++ b/drivers/clk/imx/clk-pllv1.c @@ -119,7 +119,7 @@ struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, struct clk_init_data init; int ret; - pll = kmalloc_obj(*pll, GFP_KERNEL); + pll = kmalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c index 1faa289b8e69..43396388030e 100644 --- a/drivers/clk/imx/clk-pllv2.c +++ b/drivers/clk/imx/clk-pllv2.c @@ -254,7 +254,7 @@ struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent, struct clk_init_data init; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c index 78d40dad7b4a..a0ad6f4aae8f 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -426,7 +426,7 @@ struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name, struct clk_init_data init; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-pllv4.c b/drivers/clk/imx/clk-pllv4.c index d7a4e9ed55b3..8fa2f7111ce9 100644 --- a/drivers/clk/imx/clk-pllv4.c +++ b/drivers/clk/imx/clk-pllv4.c @@ -251,7 +251,7 @@ struct clk_hw *imx_clk_hw_pllv4(enum imx_pllv4_type type, const char *name, struct clk_init_data init; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index 9ec9fe99c391..33e637ad3579 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -457,7 +457,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name, struct clk_hw *hw; int ret; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); @@ -856,7 +856,7 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na if (rsrc_id >= IMX_SC_R_LAST || gpr_id >= IMX_SC_C_LAST) return ERR_PTR(-EINVAL); - clk_node = kzalloc_obj(*clk_node, GFP_KERNEL); + clk_node = kzalloc_obj(*clk_node); if (!clk_node) return ERR_PTR(-ENOMEM); @@ -870,7 +870,7 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na return NULL; } - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) { kfree(clk_node); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk-sscg-pll.c b/drivers/clk/imx/clk-sscg-pll.c index 4017b194e085..7f104ecfa80f 100644 --- a/drivers/clk/imx/clk-sscg-pll.c +++ b/drivers/clk/imx/clk-sscg-pll.c @@ -509,7 +509,7 @@ struct clk_hw *imx_clk_hw_sscg_pll(const char *name, struct clk_hw *hw; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index c9c8397e9149..f38506830ccf 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -189,7 +189,7 @@ void imx_register_uart_clocks(void) if (!of_stdout) return; - imx_uart_clocks = kzalloc_objs(struct clk *, num, GFP_KERNEL); + imx_uart_clocks = kzalloc_objs(struct clk *, num); if (!imx_uart_clocks) return; diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c index 69055ef880eb..1a73ceb1a758 100644 --- a/drivers/clk/ingenic/cgu.c +++ b/drivers/clk/ingenic/cgu.c @@ -676,7 +676,7 @@ static int ingenic_register_clock(struct ingenic_cgu *cgu, unsigned idx) goto out; } - ingenic_clk = kzalloc_obj(*ingenic_clk, GFP_KERNEL); + ingenic_clk = kzalloc_obj(*ingenic_clk); if (!ingenic_clk) { err = -ENOMEM; goto out; @@ -790,7 +790,7 @@ ingenic_cgu_new(const struct ingenic_cgu_clk_info *clock_info, { struct ingenic_cgu *cgu; - cgu = kzalloc_obj(*cgu, GFP_KERNEL); + cgu = kzalloc_obj(*cgu); if (!cgu) goto err_out; diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c index 6ae7c2f66824..6a096ba4d40c 100644 --- a/drivers/clk/ingenic/tcu.c +++ b/drivers/clk/ingenic/tcu.c @@ -273,7 +273,7 @@ static int __init ingenic_tcu_register_clock(struct ingenic_tcu *tcu, struct ingenic_tcu_clk *tcu_clk; int err; - tcu_clk = kzalloc_obj(*tcu_clk, GFP_KERNEL); + tcu_clk = kzalloc_obj(*tcu_clk); if (!tcu_clk) return -ENOMEM; @@ -344,7 +344,7 @@ static int __init ingenic_tcu_probe(struct device_node *np) if (IS_ERR(map)) return PTR_ERR(map); - tcu = kzalloc_obj(*tcu, GFP_KERNEL); + tcu = kzalloc_obj(*tcu); if (!tcu) return -ENOMEM; diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c index dff8ed64df85..03e854f10fd9 100644 --- a/drivers/clk/keystone/gate.c +++ b/drivers/clk/keystone/gate.c @@ -168,7 +168,7 @@ static struct clk *clk_register_psc(struct device *dev, struct clk_psc *psc; struct clk *clk; - psc = kzalloc_obj(*psc, GFP_KERNEL); + psc = kzalloc_obj(*psc); if (!psc) return ERR_PTR(-ENOMEM); @@ -202,7 +202,7 @@ static void __init of_psc_clk_init(struct device_node *node, spinlock_t *lock) struct clk *clk; int i; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { pr_err("%s: Out of memory\n", __func__); return; diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c index 9cdf1ecad45c..ed197ee0cc88 100644 --- a/drivers/clk/keystone/pll.c +++ b/drivers/clk/keystone/pll.c @@ -126,7 +126,7 @@ static struct clk *clk_register_pll(struct device *dev, struct clk_pll *pll; struct clk *clk; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); @@ -162,7 +162,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl) struct clk *clk; int i; - pll_data = kzalloc_obj(*pll_data, GFP_KERNEL); + pll_data = kzalloc_obj(*pll_data); if (!pll_data) { pr_err("%s: Out of memory\n", __func__); return; diff --git a/drivers/clk/mediatek/clk-apmixed.c b/drivers/clk/mediatek/clk-apmixed.c index 43c72621f4c9..16e8a325b5bf 100644 --- a/drivers/clk/mediatek/clk-apmixed.c +++ b/drivers/clk/mediatek/clk-apmixed.c @@ -77,7 +77,7 @@ struct clk_hw *mtk_clk_register_ref2usb_tx(const char *name, struct clk_init_data init = {}; int ret; - tx = kzalloc_obj(*tx, GFP_KERNEL); + tx = kzalloc_obj(*tx); if (!tx) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c index abcc1c41a6f9..412558b95127 100644 --- a/drivers/clk/mediatek/clk-cpumux.c +++ b/drivers/clk/mediatek/clk-cpumux.c @@ -66,7 +66,7 @@ mtk_clk_register_cpumux(struct device *dev, const struct mtk_composite *mux, int ret; struct clk_init_data init; - cpumux = kzalloc_obj(*cpumux, GFP_KERNEL); + cpumux = kzalloc_obj(*cpumux); if (!cpumux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c index 3689ec69da5d..bd2fcd489a3f 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c @@ -212,7 +212,7 @@ static struct clk_hw *mtk_clk_register_gate(struct device *dev, int ret; struct clk_init_data init = {}; - cg = kzalloc_obj(*cg, GFP_KERNEL); + cg = kzalloc_obj(*cg); if (!cg) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index de093f9665af..ab038ffb90df 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -230,7 +230,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, int ret; if (mc->mux_shift >= 0) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -251,7 +251,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, } if (mc->gate_shift >= 0) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { ret = -ENOMEM; goto err_out; @@ -267,7 +267,7 @@ static struct clk_hw *mtk_clk_register_composite(struct device *dev, } if (mc->divider_shift >= 0) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) { ret = -ENOMEM; goto err_out; diff --git a/drivers/clk/mediatek/clk-mux.c b/drivers/clk/mediatek/clk-mux.c index 0cc6de7ab29b..5f4b07e7c757 100644 --- a/drivers/clk/mediatek/clk-mux.c +++ b/drivers/clk/mediatek/clk-mux.c @@ -281,7 +281,7 @@ static struct clk_hw *mtk_clk_register_mux(struct device *dev, struct clk_init_data init = {}; int ret; - clk_mux = kzalloc_obj(*clk_mux, GFP_KERNEL); + clk_mux = kzalloc_obj(*clk_mux); if (!clk_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index ff414d9b560a..e97064868908 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -385,7 +385,7 @@ struct clk_hw *mtk_clk_register_pll(struct device *dev, struct clk_hw *hw; const struct clk_ops *pll_ops = data->ops ? data->ops : &mtk_pll_ops; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mediatek/clk-pllfh.c b/drivers/clk/mediatek/clk-pllfh.c index 6b9f43ddd57f..aa95cd9197b3 100644 --- a/drivers/clk/mediatek/clk-pllfh.c +++ b/drivers/clk/mediatek/clk-pllfh.c @@ -157,7 +157,7 @@ mtk_clk_register_pllfh(struct device *dev, const struct mtk_pll_data *pll_data, struct mtk_fh *fh; int ret; - fh = kzalloc_obj(*fh, GFP_KERNEL); + fh = kzalloc_obj(*fh); if (!fh) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index d56be70ab02f..bc029c6ab622 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -3646,7 +3646,7 @@ static void __init meson8b_clkc_init_common(struct device_node *np, return; } - rstc = kzalloc_obj(*rstc, GFP_KERNEL); + rstc = kzalloc_obj(*rstc); if (!rstc) return; diff --git a/drivers/clk/mmp/clk-apbc.c b/drivers/clk/mmp/clk-apbc.c index 1d6fd5e5d6c0..84532ce8fd09 100644 --- a/drivers/clk/mmp/clk-apbc.c +++ b/drivers/clk/mmp/clk-apbc.c @@ -124,7 +124,7 @@ struct clk *mmp_clk_register_apbc(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - apbc = kzalloc_obj(*apbc, GFP_KERNEL); + apbc = kzalloc_obj(*apbc); if (!apbc) return NULL; diff --git a/drivers/clk/mmp/clk-apmu.c b/drivers/clk/mmp/clk-apmu.c index e457436c522c..30bbac1deca1 100644 --- a/drivers/clk/mmp/clk-apmu.c +++ b/drivers/clk/mmp/clk-apmu.c @@ -69,7 +69,7 @@ struct clk *mmp_clk_register_apmu(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - apmu = kzalloc_obj(*apmu, GFP_KERNEL); + apmu = kzalloc_obj(*apmu); if (!apmu) return NULL; diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c index 4307698741c6..13bfc4c99f3a 100644 --- a/drivers/clk/mmp/clk-frac.c +++ b/drivers/clk/mmp/clk-frac.c @@ -180,7 +180,7 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name, return ERR_PTR(-EINVAL); } - factor = kzalloc_obj(*factor, GFP_KERNEL); + factor = kzalloc_obj(*factor); if (!factor) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-gate.c b/drivers/clk/mmp/clk-gate.c index 59f4070be33c..cc2f841ae9d9 100644 --- a/drivers/clk/mmp/clk-gate.c +++ b/drivers/clk/mmp/clk-gate.c @@ -99,7 +99,7 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name, struct clk_init_data init; /* allocate the gate */ - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c index 14aa90342664..b1c9899c71af 100644 --- a/drivers/clk/mmp/clk-mix.c +++ b/drivers/clk/mmp/clk-mix.c @@ -448,7 +448,7 @@ struct clk *mmp_clk_register_mix(struct device *dev, struct clk *clk; struct clk_init_data init; - mix = kzalloc_obj(*mix, GFP_KERNEL); + mix = kzalloc_obj(*mix); if (!mix) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c index 2067b4bb261d..77e9244b53e5 100644 --- a/drivers/clk/mmp/clk-of-mmp2.c +++ b/drivers/clk/mmp/clk-of-mmp2.c @@ -462,7 +462,7 @@ static void mmp2_clk_reset_init(struct device_node *np, int i, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets); if (!cells) return; @@ -516,7 +516,7 @@ static void __init mmp2_clk_init(struct device_node *np) { struct mmp2_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa168.c b/drivers/clk/mmp/clk-of-pxa168.c index f5b8a6749829..e3d6f4b407ed 100644 --- a/drivers/clk/mmp/clk-of-pxa168.c +++ b/drivers/clk/mmp/clk-of-pxa168.c @@ -282,7 +282,7 @@ static void pxa168_clk_reset_init(struct device_node *np, int i, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets); if (!cells) return; @@ -301,7 +301,7 @@ static void __init pxa168_clk_init(struct device_node *np) { struct pxa168_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa1928.c b/drivers/clk/mmp/clk-of-pxa1928.c index 24fc9054a667..3bc9866a2191 100644 --- a/drivers/clk/mmp/clk-of-pxa1928.c +++ b/drivers/clk/mmp/clk-of-pxa1928.c @@ -187,7 +187,7 @@ static void pxa1928_clk_reset_init(struct device_node *np, int i, base, nr_resets; nr_resets = ARRAY_SIZE(apbc_gate_clks); - cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets); if (!cells) return; @@ -208,7 +208,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; @@ -227,7 +227,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; @@ -248,7 +248,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np) { struct pxa1928_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-of-pxa910.c b/drivers/clk/mmp/clk-of-pxa910.c index 43c40b949326..d90bcc9a8ae7 100644 --- a/drivers/clk/mmp/clk-of-pxa910.c +++ b/drivers/clk/mmp/clk-of-pxa910.c @@ -239,7 +239,7 @@ static void pxa910_clk_reset_init(struct device_node *np, nr_resets_apbc = ARRAY_SIZE(apbc_gate_clks); nr_resets_apbcp = ARRAY_SIZE(apbcp_gate_clks); nr_resets = nr_resets_apbc + nr_resets_apbcp; - cells = kzalloc_objs(*cells, nr_resets, GFP_KERNEL); + cells = kzalloc_objs(*cells, nr_resets); if (!cells) return; @@ -270,7 +270,7 @@ static void __init pxa910_clk_init(struct device_node *np) { struct pxa910_clk_unit *pxa_unit; - pxa_unit = kzalloc_obj(*pxa_unit, GFP_KERNEL); + pxa_unit = kzalloc_obj(*pxa_unit); if (!pxa_unit) return; diff --git a/drivers/clk/mmp/clk-pll.c b/drivers/clk/mmp/clk-pll.c index bf2d691fcc92..430f5e3c8540 100644 --- a/drivers/clk/mmp/clk-pll.c +++ b/drivers/clk/mmp/clk-pll.c @@ -108,7 +108,7 @@ static struct clk *mmp_clk_register_pll(char *name, struct clk *clk; struct clk_init_data init; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/clk.c b/drivers/clk/mmp/clk.c index c31c3a9f4f57..48b746bef833 100644 --- a/drivers/clk/mmp/clk.c +++ b/drivers/clk/mmp/clk.c @@ -12,7 +12,7 @@ void mmp_clk_init(struct device_node *np, struct mmp_clk_unit *unit, { struct clk **clk_table; - clk_table = kzalloc_objs(struct clk *, nr_clks, GFP_KERNEL); + clk_table = kzalloc_objs(struct clk *, nr_clks); if (!clk_table) return; diff --git a/drivers/clk/mmp/pwr-island.c b/drivers/clk/mmp/pwr-island.c index 1253e383aa44..1f57917133da 100644 --- a/drivers/clk/mmp/pwr-island.c +++ b/drivers/clk/mmp/pwr-island.c @@ -95,7 +95,7 @@ struct generic_pm_domain *mmp_pm_domain_register(const char *name, { struct mmp_pm_domain *pm_domain; - pm_domain = kzalloc_obj(*pm_domain, GFP_KERNEL); + pm_domain = kzalloc_obj(*pm_domain); if (!pm_domain) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mmp/reset.c b/drivers/clk/mmp/reset.c index c7068976a378..1e4e105ef6ff 100644 --- a/drivers/clk/mmp/reset.c +++ b/drivers/clk/mmp/reset.c @@ -85,7 +85,7 @@ void mmp_clk_reset_register(struct device_node *np, { struct mmp_clk_reset_unit *unit; - unit = kzalloc_obj(*unit, GFP_KERNEL); + unit = kzalloc_obj(*unit); if (!unit) return; diff --git a/drivers/clk/mvebu/clk-corediv.c b/drivers/clk/mvebu/clk-corediv.c index 487542d61662..ae48293b0c41 100644 --- a/drivers/clk/mvebu/clk-corediv.c +++ b/drivers/clk/mvebu/clk-corediv.c @@ -270,11 +270,11 @@ mvebu_corediv_clk_init(struct device_node *node, clk_data.clk_num = soc_desc->ndescs; /* clks holds the clock array */ - clks = kzalloc_objs(struct clk *, clk_data.clk_num, GFP_KERNEL); + clks = kzalloc_objs(struct clk *, clk_data.clk_num); if (WARN_ON(!clks)) goto err_unmap; /* corediv holds the clock specific array */ - corediv = kzalloc_objs(struct clk_corediv, clk_data.clk_num, GFP_KERNEL); + corediv = kzalloc_objs(struct clk_corediv, clk_data.clk_num); if (WARN_ON(!corediv)) goto err_free_clks; diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index 8c74edbcce9a..26d52ecaac50 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c @@ -183,11 +183,11 @@ static void __init of_cpu_clk_setup(struct device_node *node) pr_warn("%s: pmu-dfs base register not set, dynamic frequency scaling not available\n", __func__); - cpuclk = kzalloc_objs(*cpuclk, ncpus, GFP_KERNEL); + cpuclk = kzalloc_objs(*cpuclk, ncpus); if (WARN_ON(!cpuclk)) goto cpuclk_out; - clks = kzalloc_objs(*clks, ncpus, GFP_KERNEL); + clks = kzalloc_objs(*clks, ncpus); if (WARN_ON(!clks)) goto clks_out; diff --git a/drivers/clk/mvebu/common.c b/drivers/clk/mvebu/common.c index 41c5cd7739b2..4f4457fa5d97 100644 --- a/drivers/clk/mvebu/common.c +++ b/drivers/clk/mvebu/common.c @@ -258,7 +258,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, clk_put(clk); } - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (WARN_ON(!ctrl)) goto ctrl_out; @@ -272,7 +272,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, n++; ctrl->num_gates = n; - ctrl->gates = kzalloc_objs(*ctrl->gates, ctrl->num_gates, GFP_KERNEL); + ctrl->gates = kzalloc_objs(*ctrl->gates, ctrl->num_gates); if (WARN_ON(!ctrl->gates)) goto gates_out; diff --git a/drivers/clk/mvebu/cp110-system-controller.c b/drivers/clk/mvebu/cp110-system-controller.c index c6b5b2205f2e..fa95eb7197af 100644 --- a/drivers/clk/mvebu/cp110-system-controller.c +++ b/drivers/clk/mvebu/cp110-system-controller.c @@ -180,7 +180,7 @@ static struct clk_hw *cp110_register_gate(const char *name, struct clk_init_data init; int ret; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mvebu/kirkwood.c b/drivers/clk/mvebu/kirkwood.c index 967f0be794ab..ed061d82fb65 100644 --- a/drivers/clk/mvebu/kirkwood.c +++ b/drivers/clk/mvebu/kirkwood.c @@ -297,7 +297,7 @@ static void __init kirkwood_clk_muxing_setup(struct device_node *np, if (WARN_ON(!base)) return; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (WARN_ON(!ctrl)) goto ctrl_out; @@ -309,7 +309,7 @@ static void __init kirkwood_clk_muxing_setup(struct device_node *np, n++; ctrl->num_muxes = n; - ctrl->muxes = kzalloc_objs(struct clk *, ctrl->num_muxes, GFP_KERNEL); + ctrl->muxes = kzalloc_objs(struct clk *, ctrl->num_muxes); if (WARN_ON(!ctrl->muxes)) goto muxes_out; diff --git a/drivers/clk/mxs/clk-div.c b/drivers/clk/mxs/clk-div.c index 47c5c2fe8e5e..fe7224162b3c 100644 --- a/drivers/clk/mxs/clk-div.c +++ b/drivers/clk/mxs/clk-div.c @@ -74,7 +74,7 @@ struct clk *mxs_clk_div(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-frac.c b/drivers/clk/mxs/clk-frac.c index 7de0c20baabb..52eb82fde322 100644 --- a/drivers/clk/mxs/clk-frac.c +++ b/drivers/clk/mxs/clk-frac.c @@ -116,7 +116,7 @@ struct clk *mxs_clk_frac(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - frac = kzalloc_obj(*frac, GFP_KERNEL); + frac = kzalloc_obj(*frac); if (!frac) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-pll.c b/drivers/clk/mxs/clk-pll.c index f67bfe743479..581868e0693c 100644 --- a/drivers/clk/mxs/clk-pll.c +++ b/drivers/clk/mxs/clk-pll.c @@ -86,7 +86,7 @@ struct clk *mxs_clk_pll(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/mxs/clk-ref.c b/drivers/clk/mxs/clk-ref.c index e6674fb58add..9667d4d3c2a8 100644 --- a/drivers/clk/mxs/clk-ref.c +++ b/drivers/clk/mxs/clk-ref.c @@ -117,7 +117,7 @@ struct clk *mxs_clk_ref(const char *name, const char *parent_name, struct clk *clk; struct clk_init_data init; - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/nxp/clk-lpc18xx-ccu.c b/drivers/clk/nxp/clk-lpc18xx-ccu.c index 8bb5a44c9b59..dcb6d0c0b41a 100644 --- a/drivers/clk/nxp/clk-lpc18xx-ccu.c +++ b/drivers/clk/nxp/clk-lpc18xx-ccu.c @@ -208,7 +208,7 @@ static void lpc18xx_ccu_register_branch_gate_div(struct lpc18xx_clk_branch *bran struct clk_hw *div_hw = NULL; if (branch->flags & CCU_BRANCH_HAVE_DIV2) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return; @@ -274,7 +274,7 @@ static void __init lpc18xx_ccu_init(struct device_node *np) return; } - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) { iounmap(reg_base); return; diff --git a/drivers/clk/pistachio/clk-pll.c b/drivers/clk/pistachio/clk-pll.c index dd4fe9a114a7..5b268a985a9c 100644 --- a/drivers/clk/pistachio/clk-pll.c +++ b/drivers/clk/pistachio/clk-pll.c @@ -457,7 +457,7 @@ static struct clk *pll_register(const char *name, const char *parent_name, struct clk_init_data init; struct clk *clk; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/pistachio/clk.c b/drivers/clk/pistachio/clk.c index 80f60f2ce7de..80c722c77a1b 100644 --- a/drivers/clk/pistachio/clk.c +++ b/drivers/clk/pistachio/clk.c @@ -17,11 +17,11 @@ pistachio_clk_alloc_provider(struct device_node *node, unsigned int num_clks) { struct pistachio_clk_provider *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return p; - p->clk_data.clks = kzalloc_objs(struct clk *, num_clks, GFP_KERNEL); + p->clk_data.clks = kzalloc_objs(struct clk *, num_clks); if (!p->clk_data.clks) goto free_provider; p->clk_data.clk_num = num_clks; diff --git a/drivers/clk/pxa/clk-pxa.c b/drivers/clk/pxa/clk-pxa.c index 1c5dedaefec8..d153ce76c64b 100644 --- a/drivers/clk/pxa/clk-pxa.c +++ b/drivers/clk/pxa/clk-pxa.c @@ -104,7 +104,7 @@ int __init clk_pxa_cken_init(const struct desc_clk_cken *clks, struct clk *clk; for (i = 0; i < nb_clks; i++) { - pxa_clk = kzalloc_obj(*pxa_clk, GFP_KERNEL); + pxa_clk = kzalloc_obj(*pxa_clk); if (!pxa_clk) return -ENOMEM; pxa_clk->is_in_low_power = clks[i].is_in_low_power; diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 0977b61f242e..fc696b66ccda 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -1650,7 +1650,7 @@ static int clk_rcg2_dfs_populate_freq_table(struct clk_rcg2 *rcg) int i; /* Allocate space for 1 extra since table is NULL terminated */ - freq_tbl = kzalloc_objs(*freq_tbl, MAX_PERF_LEVEL + 1, GFP_KERNEL); + freq_tbl = kzalloc_objs(*freq_tbl, MAX_PERF_LEVEL + 1); if (!freq_tbl) return -ENOMEM; rcg->freq_tbl = freq_tbl; diff --git a/drivers/clk/ralink/clk-mt7621.c b/drivers/clk/ralink/clk-mt7621.c index 3079d7ce0e57..aa7902bd5e0e 100644 --- a/drivers/clk/ralink/clk-mt7621.c +++ b/drivers/clk/ralink/clk-mt7621.c @@ -354,7 +354,7 @@ static void __init mt7621_clk_init(struct device_node *node) struct clk_hw_onecell_data *clk_data; int ret, i, count; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return; diff --git a/drivers/clk/ralink/clk-mtmips.c b/drivers/clk/ralink/clk-mtmips.c index c6ee73a8fa22..46a8eb023c38 100644 --- a/drivers/clk/ralink/clk-mtmips.c +++ b/drivers/clk/ralink/clk-mtmips.c @@ -916,7 +916,7 @@ static void __init mtmips_clk_init(struct device_node *node) struct clk_hw_onecell_data *clk_data; int ret, i, count; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return; diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c index 79414c2c2e9c..c8c0a603d974 100644 --- a/drivers/clk/renesas/clk-mstp.c +++ b/drivers/clk/renesas/clk-mstp.c @@ -150,7 +150,7 @@ static struct clk * __init cpg_mstp_clock_register(const char *name, struct mstp_clock *clock; struct clk *clk; - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) return ERR_PTR(-ENOMEM); @@ -316,7 +316,7 @@ void __init cpg_mstp_add_clk_domain(struct device_node *np) return; } - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return; diff --git a/drivers/clk/renesas/clk-r8a73a4.c b/drivers/clk/renesas/clk-r8a73a4.c index 708506671a78..7f47644396e6 100644 --- a/drivers/clk/renesas/clk-r8a73a4.c +++ b/drivers/clk/renesas/clk-r8a73a4.c @@ -196,8 +196,8 @@ static void __init r8a73a4_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc_obj(*cpg, GFP_KERNEL); - clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); + cpg = kzalloc_obj(*cpg); + clks = kzalloc_objs(*clks, num_clks); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7740.c b/drivers/clk/renesas/clk-r8a7740.c index f4c4ef44cff9..635d59ead499 100644 --- a/drivers/clk/renesas/clk-r8a7740.c +++ b/drivers/clk/renesas/clk-r8a7740.c @@ -155,8 +155,8 @@ static void __init r8a7740_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc_obj(*cpg, GFP_KERNEL); - clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); + cpg = kzalloc_obj(*cpg); + clks = kzalloc_objs(*clks, num_clks); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c index 2f664c7efba5..9120f86fcc2a 100644 --- a/drivers/clk/renesas/clk-r8a7778.c +++ b/drivers/clk/renesas/clk-r8a7778.c @@ -92,8 +92,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np) return; } - data = kzalloc_obj(*data, GFP_KERNEL); - clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); + data = kzalloc_obj(*data); + clks = kzalloc_objs(*clks, num_clks); if (data == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-r8a7779.c b/drivers/clk/renesas/clk-r8a7779.c index 9243848863f2..f2d6cbaf6329 100644 --- a/drivers/clk/renesas/clk-r8a7779.c +++ b/drivers/clk/renesas/clk-r8a7779.c @@ -128,8 +128,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np) return; } - data = kzalloc_obj(*data, GFP_KERNEL); - clks = kzalloc_objs(*clks, CPG_NUM_CLOCKS, GFP_KERNEL); + data = kzalloc_obj(*data); + clks = kzalloc_objs(*clks, CPG_NUM_CLOCKS); if (data == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/clk-rz.c b/drivers/clk/renesas/clk-rz.c index 0a89be1fce79..5347c067e256 100644 --- a/drivers/clk/renesas/clk-rz.c +++ b/drivers/clk/renesas/clk-rz.c @@ -91,8 +91,8 @@ static void __init rz_cpg_clocks_init(struct device_node *np) if (WARN(num_clks <= 0, "can't count CPG clocks\n")) return; - data = kzalloc_obj(*data, GFP_KERNEL); - clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); + data = kzalloc_obj(*data); + clks = kzalloc_objs(*clks, num_clks); BUG_ON(!data || !clks); data->clks = clks; diff --git a/drivers/clk/renesas/clk-sh73a0.c b/drivers/clk/renesas/clk-sh73a0.c index a3bbd8a0ac4d..efae041ac6e8 100644 --- a/drivers/clk/renesas/clk-sh73a0.c +++ b/drivers/clk/renesas/clk-sh73a0.c @@ -170,8 +170,8 @@ static void __init sh73a0_cpg_clocks_init(struct device_node *np) return; } - cpg = kzalloc_obj(*cpg, GFP_KERNEL); - clks = kzalloc_objs(*clks, num_clks, GFP_KERNEL); + cpg = kzalloc_obj(*cpg); + clks = kzalloc_objs(*clks, num_clks); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c index 58255bf6da83..7407a4183a6c 100644 --- a/drivers/clk/renesas/r9a06g032-clocks.c +++ b/drivers/clk/renesas/r9a06g032-clocks.c @@ -891,7 +891,7 @@ r9a06g032_register_gate(struct r9a06g032_priv *clocks, struct r9a06g032_clk_gate *g; struct clk_init_data init = {}; - g = kzalloc_obj(*g, GFP_KERNEL); + g = kzalloc_obj(*g); if (!g) return NULL; @@ -1063,7 +1063,7 @@ r9a06g032_register_div(struct r9a06g032_priv *clocks, struct clk_init_data init = {}; unsigned int i; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return NULL; @@ -1149,7 +1149,7 @@ r9a06g032_register_bitsel(struct r9a06g032_priv *clocks, const char *names[2]; /* allocate the gate */ - g = kzalloc_obj(*g, GFP_KERNEL); + g = kzalloc_obj(*g); if (!g) return NULL; @@ -1239,7 +1239,7 @@ r9a06g032_register_dualgate(struct r9a06g032_priv *clocks, struct clk_init_data init = {}; /* allocate the gate */ - g = kzalloc_obj(*g, GFP_KERNEL); + g = kzalloc_obj(*g); if (!g) return NULL; g->clocks = clocks; diff --git a/drivers/clk/renesas/rcar-cpg-lib.c b/drivers/clk/renesas/rcar-cpg-lib.c index f4279af8787f..fc73aa685281 100644 --- a/drivers/clk/renesas/rcar-cpg-lib.c +++ b/drivers/clk/renesas/rcar-cpg-lib.c @@ -94,7 +94,7 @@ struct clk * __init cpg_sdh_clk_register(const char *name, struct cpg_simple_notifier *csn; struct clk *clk; - csn = kzalloc_obj(*csn, GFP_KERNEL); + csn = kzalloc_obj(*csn); if (!csn) return ERR_PTR(-ENOMEM); @@ -144,7 +144,7 @@ struct clk * __init cpg_rpc_clk_register(const char *name, struct rpc_clock *rpc; struct clk *clk; - rpc = kzalloc_obj(*rpc, GFP_KERNEL); + rpc = kzalloc_obj(*rpc); if (!rpc) return ERR_PTR(-ENOMEM); @@ -185,7 +185,7 @@ struct clk * __init cpg_rpcd2_clk_register(const char *name, struct rpcd2_clock *rpcd2; struct clk *clk; - rpcd2 = kzalloc_obj(*rpcd2, GFP_KERNEL); + rpcd2 = kzalloc_obj(*rpcd2); if (!rpcd2) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen2-cpg.c b/drivers/clk/renesas/rcar-gen2-cpg.c index 69618ec0b638..484b27edf863 100644 --- a/drivers/clk/renesas/rcar-gen2-cpg.c +++ b/drivers/clk/renesas/rcar-gen2-cpg.c @@ -141,7 +141,7 @@ static struct clk * __init cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc_obj(*zclk, GFP_KERNEL); + zclk = kzalloc_obj(*zclk); if (!zclk) return ERR_PTR(-ENOMEM); @@ -169,14 +169,14 @@ static struct clk * __init cpg_rcan_clk_register(const char *name, struct clk_gate *gate; struct clk *clk; - fixed = kzalloc_obj(*fixed, GFP_KERNEL); + fixed = kzalloc_obj(*fixed); if (!fixed) return ERR_PTR(-ENOMEM); fixed->mult = 1; fixed->div = 6; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { kfree(fixed); return ERR_PTR(-ENOMEM); @@ -213,7 +213,7 @@ static struct clk * __init cpg_adsp_clk_register(const char *name, struct clk_gate *gate; struct clk *clk; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); @@ -222,7 +222,7 @@ static struct clk * __init cpg_adsp_clk_register(const char *name, div->table = cpg_adsp_div_table; div->lock = &cpg_lock; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { kfree(div); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c index 605854200b04..e5b503332217 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -123,7 +123,7 @@ static struct clk * __init cpg_pll_clk_register(const char *name, struct clk_init_data init = {}; struct clk *clk; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (!pll_clk) return ERR_PTR(-ENOMEM); @@ -271,7 +271,7 @@ static struct clk * __init __cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc_obj(*zclk, GFP_KERNEL); + zclk = kzalloc_obj(*zclk); if (!zclk) return ERR_PTR(-ENOMEM); @@ -410,7 +410,7 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev, if (cpg_quirks & RCKCR_CKSEL) { struct cpg_simple_notifier *csn; - csn = kzalloc_obj(*csn, GFP_KERNEL); + csn = kzalloc_obj(*csn); if (!csn) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/rcar-gen4-cpg.c b/drivers/clk/renesas/rcar-gen4-cpg.c index 7168939ddb65..96922789e02a 100644 --- a/drivers/clk/renesas/rcar-gen4-cpg.c +++ b/drivers/clk/renesas/rcar-gen4-cpg.c @@ -234,7 +234,7 @@ static struct clk * __init cpg_pll_clk_register(const char *name, struct cpg_pll_clk *pll_clk; struct clk *clk; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (!pll_clk) return ERR_PTR(-ENOMEM); @@ -374,7 +374,7 @@ static struct clk * __init cpg_z_clk_register(const char *name, struct cpg_z_clk *zclk; struct clk *clk; - zclk = kzalloc_obj(*zclk, GFP_KERNEL); + zclk = kzalloc_obj(*zclk); if (!zclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c index 48105ee90c83..52932ba777f4 100644 --- a/drivers/clk/renesas/renesas-cpg-mssr.c +++ b/drivers/clk/renesas/renesas-cpg-mssr.c @@ -512,7 +512,7 @@ static void __init cpg_mssr_register_mod_clk(const struct mssr_mod_clk *mod, goto fail; } - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) { clk = ERR_PTR(-ENOMEM); goto fail; diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c index 456b23e6be42..6205af9ba88a 100644 --- a/drivers/clk/rockchip/clk-cpu.c +++ b/drivers/clk/rockchip/clk-cpu.c @@ -313,7 +313,7 @@ struct clk *rockchip_clk_register_cpuclk(const char *name, return ERR_PTR(-EINVAL); } - cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk); if (!cpuclk) return ERR_PTR(-ENOMEM); @@ -479,7 +479,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, int ret; if (num_parents > 1) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -493,7 +493,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, } if (div_width > 0) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) { ret = -ENOMEM; goto free_mux; @@ -521,7 +521,7 @@ struct clk *rockchip_clk_register_cpuclk_multi_pll(const char *name, goto free_div; } - cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk); if (!cpuclk) { ret = -ENOMEM; goto unregister_clk; diff --git a/drivers/clk/rockchip/clk-ddr.c b/drivers/clk/rockchip/clk-ddr.c index 96985682b98c..81ae8a4ee30e 100644 --- a/drivers/clk/rockchip/clk-ddr.c +++ b/drivers/clk/rockchip/clk-ddr.c @@ -100,7 +100,7 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags, struct clk_init_data init; struct clk *clk; - ddrclk = kzalloc_obj(*ddrclk, GFP_KERNEL); + ddrclk = kzalloc_obj(*ddrclk); if (!ddrclk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-gate-grf.c b/drivers/clk/rockchip/clk-gate-grf.c index b3df39f9b317..88e409e91a63 100644 --- a/drivers/clk/rockchip/clk-gate-grf.c +++ b/drivers/clk/rockchip/clk-gate-grf.c @@ -81,7 +81,7 @@ struct clk *rockchip_clk_register_gate_grf(const char *name, return ERR_PTR(-EOPNOTSUPP); } - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c index ac77911fa058..bafe3e998954 100644 --- a/drivers/clk/rockchip/clk-half-divider.c +++ b/drivers/clk/rockchip/clk-half-divider.c @@ -176,7 +176,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, *gate_ops = NULL; if (num_parents > 1) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -190,7 +190,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, } if (gate_offset >= 0) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto err_gate; @@ -202,7 +202,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name, } if (div_width > 0) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto err_div; diff --git a/drivers/clk/rockchip/clk-inverter.c b/drivers/clk/rockchip/clk-inverter.c index 53c17047077c..bf9072ed9fd4 100644 --- a/drivers/clk/rockchip/clk-inverter.c +++ b/drivers/clk/rockchip/clk-inverter.c @@ -79,7 +79,7 @@ struct clk *rockchip_clk_register_inverter(const char *name, struct rockchip_inv_clock *inv_clock; struct clk *clk; - inv_clock = kmalloc_obj(*inv_clock, GFP_KERNEL); + inv_clock = kmalloc_obj(*inv_clock); if (!inv_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c index c8bb8a217eaa..4efd22953f3e 100644 --- a/drivers/clk/rockchip/clk-mmc-phase.c +++ b/drivers/clk/rockchip/clk-mmc-phase.c @@ -210,7 +210,7 @@ struct clk *rockchip_clk_register_mmc(const char *name, struct clk *clk; int ret; - mmc_clock = kmalloc_obj(*mmc_clock, GFP_KERNEL); + mmc_clock = kmalloc_obj(*mmc_clock); if (!mmc_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-muxgrf.c b/drivers/clk/rockchip/clk-muxgrf.c index 7545df0adabe..ccbb1379501a 100644 --- a/drivers/clk/rockchip/clk-muxgrf.c +++ b/drivers/clk/rockchip/clk-muxgrf.c @@ -67,7 +67,7 @@ struct clk *rockchip_clk_register_muxgrf(const char *name, return ERR_PTR(-ENOTSUPP); } - muxgrf_clock = kmalloc_obj(*muxgrf_clock, GFP_KERNEL); + muxgrf_clock = kmalloc_obj(*muxgrf_clock); if (!muxgrf_clock) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c index 865151d88b9f..6b853800cb6b 100644 --- a/drivers/clk/rockchip/clk-pll.c +++ b/drivers/clk/rockchip/clk-pll.c @@ -1076,7 +1076,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx, /* name the actual pll */ snprintf(pll_name, sizeof(pll_name), "pll_%s", name); - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/rockchip/clk-rk3576.c b/drivers/clk/rockchip/clk-rk3576.c index 59285a784cd0..2557358e0b9d 100644 --- a/drivers/clk/rockchip/clk-rk3576.c +++ b/drivers/clk/rockchip/clk-rk3576.c @@ -1769,7 +1769,7 @@ static void __init rk3576_clk_init(struct device_node *np) goto err_unmap; } - pmu0_grf_e = kzalloc_obj(*pmu0_grf_e, GFP_KERNEL); + pmu0_grf_e = kzalloc_obj(*pmu0_grf_e); if (!pmu0_grf_e) goto err_unmap; @@ -1777,7 +1777,7 @@ static void __init rk3576_clk_init(struct device_node *np) pmu0_grf_e->type = grf_type_pmu0; hash_add(ctx->aux_grf_table, &pmu0_grf_e->node, grf_type_pmu0); - ioc_grf_e = kzalloc_obj(*ioc_grf_e, GFP_KERNEL); + ioc_grf_e = kzalloc_obj(*ioc_grf_e); if (!ioc_grf_e) goto err_free_pmu0; diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index ec9517d7c2b7..e8b3b0b9a4f8 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c @@ -55,7 +55,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, int ret; if (num_parents > 1) { - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -70,7 +70,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, } if (gate_offset >= 0) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { ret = -ENOMEM; goto err_gate; @@ -84,7 +84,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, } if (div_width > 0) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) { ret = -ENOMEM; goto err_div; @@ -221,7 +221,7 @@ static struct clk *rockchip_clk_register_frac_branch( return ERR_PTR(-EINVAL); } - frac = kzalloc_obj(*frac, GFP_KERNEL); + frac = kzalloc_obj(*frac); if (!frac) return ERR_PTR(-ENOMEM); @@ -323,7 +323,7 @@ static struct clk *rockchip_clk_register_factor_branch(const char *name, div); } - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); @@ -332,7 +332,7 @@ static struct clk *rockchip_clk_register_factor_branch(const char *name, gate->bit_idx = gate_shift; gate->lock = lock; - fix = kzalloc_obj(*fix, GFP_KERNEL); + fix = kzalloc_obj(*fix); if (!fix) { kfree(gate); return ERR_PTR(-ENOMEM); @@ -365,11 +365,11 @@ static struct rockchip_clk_provider *rockchip_clk_init_base( default_clk_val = ERR_PTR(has_late_clocks ? -EPROBE_DEFER : -ENOENT); - ctx = kzalloc_obj(struct rockchip_clk_provider, GFP_KERNEL); + ctx = kzalloc_obj(struct rockchip_clk_provider); if (!ctx) return ERR_PTR(-ENOMEM); - clk_table = kzalloc_objs(struct clk *, nr_clks, GFP_KERNEL); + clk_table = kzalloc_objs(struct clk *, nr_clks); if (!clk_table) goto err_free; diff --git a/drivers/clk/rockchip/softrst.c b/drivers/clk/rockchip/softrst.c index 01caa91e7ce3..115f317a99a2 100644 --- a/drivers/clk/rockchip/softrst.c +++ b/drivers/clk/rockchip/softrst.c @@ -96,7 +96,7 @@ void rockchip_register_softrst_lut(struct device_node *np, struct rockchip_softrst *softrst; int ret; - softrst = kzalloc_obj(*softrst, GFP_KERNEL); + softrst = kzalloc_obj(*softrst); if (!softrst) return; diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index d8729dceabb0..ffc33e5decf5 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -660,7 +660,7 @@ static int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, return -EINVAL; } - cpuclk = kzalloc_obj(*cpuclk, GFP_KERNEL); + cpuclk = kzalloc_obj(*cpuclk); if (!cpuclk) return -ENOMEM; diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 1bd8def3973e..026ac556fa2e 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -1435,7 +1435,7 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, struct clk_init_data init; int ret, len; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) { pr_err("%s: could not allocate pll clk %s\n", __func__, pll_clk->name); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 39580d82077b..fbb64b082188 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -55,7 +55,7 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( struct samsung_clk_reg_dump *rd; unsigned int i; - rd = kzalloc_objs(*rd, nr_rdump, GFP_KERNEL); + rd = kzalloc_objs(*rd, nr_rdump); if (!rd) return NULL; @@ -301,7 +301,7 @@ struct clk_hw *samsung_register_auto_gate(struct device *dev, int ret = -EINVAL; /* allocate the gate */ - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); @@ -431,7 +431,7 @@ void samsung_clk_extended_sleep_init(void __iomem *reg_base, { struct samsung_clock_reg_cache *reg_cache; - reg_cache = kzalloc_obj(struct samsung_clock_reg_cache, GFP_KERNEL); + reg_cache = kzalloc_obj(struct samsung_clock_reg_cache); if (!reg_cache) panic("could not allocate register reg_cache.\n"); reg_cache->rdump = samsung_clk_alloc_reg_dump(rdump, nr_rdump); diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c index c6505046b63b..dd8d1713aaff 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -52,7 +52,7 @@ static void __init __socfpga_gate_init(struct device_node *node, struct clk_init_data init; int rc; - socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk); if (WARN_ON(!socfpga_clk)) return; diff --git a/drivers/clk/socfpga/clk-gate-s10.c b/drivers/clk/socfpga/clk-gate-s10.c index 913c31d94319..24f56a9edc44 100644 --- a/drivers/clk/socfpga/clk-gate-s10.c +++ b/drivers/clk/socfpga/clk-gate-s10.c @@ -132,7 +132,7 @@ struct clk_hw *s10_register_gate(const struct stratix10_gate_clock *clks, void _ const char *parent_name = clks->parent_name; int ret; - socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk); if (!socfpga_clk) return NULL; @@ -190,7 +190,7 @@ struct clk_hw *agilex_register_gate(const struct stratix10_gate_clock *clks, voi const char *parent_name = clks->parent_name; int ret; - socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk); if (!socfpga_clk) return NULL; @@ -247,7 +247,7 @@ struct clk_hw *agilex5_register_gate(const struct agilex5_gate_clock *clks, void struct clk_init_data init; int ret; - socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk); if (!socfpga_clk) return NULL; diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c index 52dd6e2f19f9..ced8e0988406 100644 --- a/drivers/clk/socfpga/clk-gate.c +++ b/drivers/clk/socfpga/clk-gate.c @@ -147,7 +147,7 @@ void __init socfpga_gate_init(struct device_node *node) struct clk_ops *ops; int rc; - socfpga_clk = kzalloc_obj(*socfpga_clk, GFP_KERNEL); + socfpga_clk = kzalloc_obj(*socfpga_clk); if (WARN_ON(!socfpga_clk)) return; diff --git a/drivers/clk/socfpga/clk-periph-a10.c b/drivers/clk/socfpga/clk-periph-a10.c index 7f61ce1793b2..4eb5787f0dea 100644 --- a/drivers/clk/socfpga/clk-periph-a10.c +++ b/drivers/clk/socfpga/clk-periph-a10.c @@ -72,7 +72,7 @@ static void __init __socfpga_periph_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return; diff --git a/drivers/clk/socfpga/clk-periph-s10.c b/drivers/clk/socfpga/clk-periph-s10.c index f43ffd4dfa82..5195b9476da1 100644 --- a/drivers/clk/socfpga/clk-periph-s10.c +++ b/drivers/clk/socfpga/clk-periph-s10.c @@ -108,7 +108,7 @@ struct clk_hw *s10_register_periph(const struct stratix10_perip_c_clock *clks, const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return NULL; @@ -144,7 +144,7 @@ struct clk_hw *n5x_register_periph(const struct n5x_perip_c_clock *clks, const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return NULL; @@ -179,7 +179,7 @@ struct clk_hw *s10_register_cnt_periph(const struct stratix10_perip_cnt_clock *c const char *parent_name = clks->parent_name; int ret; - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return NULL; @@ -224,7 +224,7 @@ struct clk_hw *agilex5_register_cnt_periph(const struct agilex5_perip_cnt_clock const char *name = clks->name; int ret; - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return NULL; diff --git a/drivers/clk/socfpga/clk-periph.c b/drivers/clk/socfpga/clk-periph.c index 2719af1502c1..3821db6777e7 100644 --- a/drivers/clk/socfpga/clk-periph.c +++ b/drivers/clk/socfpga/clk-periph.c @@ -62,7 +62,7 @@ static void __init __socfpga_periph_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - periph_clk = kzalloc_obj(*periph_clk, GFP_KERNEL); + periph_clk = kzalloc_obj(*periph_clk); if (WARN_ON(!periph_clk)) return; diff --git a/drivers/clk/socfpga/clk-pll-a10.c b/drivers/clk/socfpga/clk-pll-a10.c index 633c30b70d25..c56f276e8d51 100644 --- a/drivers/clk/socfpga/clk-pll-a10.c +++ b/drivers/clk/socfpga/clk-pll-a10.c @@ -78,7 +78,7 @@ static void __init __socfpga_pll_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c index 3c8302a7ec5b..ee236e87da33 100644 --- a/drivers/clk/socfpga/clk-pll-s10.c +++ b/drivers/clk/socfpga/clk-pll-s10.c @@ -196,7 +196,7 @@ struct clk_hw *s10_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return NULL; @@ -236,7 +236,7 @@ struct clk_hw *agilex_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return NULL; @@ -275,7 +275,7 @@ struct clk_hw *n5x_register_pll(const struct stratix10_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return NULL; @@ -314,7 +314,7 @@ struct clk_hw *agilex5_register_pll(const struct agilex5_pll_clock *clks, const char *name = clks->name; int ret; - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return NULL; diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c index 877c7f1a4216..f85adb16d414 100644 --- a/drivers/clk/socfpga/clk-pll.c +++ b/drivers/clk/socfpga/clk-pll.c @@ -84,7 +84,7 @@ static void __init __socfpga_pll_init(struct device_node *node, of_property_read_u32(node, "reg", ®); - pll_clk = kzalloc_obj(*pll_clk, GFP_KERNEL); + pll_clk = kzalloc_obj(*pll_clk); if (WARN_ON(!pll_clk)) return; diff --git a/drivers/clk/spacemit/ccu_common.c b/drivers/clk/spacemit/ccu_common.c index cbe11eb49f0b..8696bb9cba2d 100644 --- a/drivers/clk/spacemit/ccu_common.c +++ b/drivers/clk/spacemit/ccu_common.c @@ -91,7 +91,7 @@ static int spacemit_ccu_reset_register(struct device *dev, if (!reset_name) return 0; - cadev = kzalloc_obj(*cadev, GFP_KERNEL); + cadev = kzalloc_obj(*cadev); if (!cadev) return -ENOMEM; diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c index 6358c9d87f4d..61a8c3d4c1e4 100644 --- a/drivers/clk/spear/clk-aux-synth.c +++ b/drivers/clk/spear/clk-aux-synth.c @@ -147,7 +147,7 @@ struct clk *clk_register_aux(const char *aux_name, const char *gate_name, return ERR_PTR(-EINVAL); } - aux = kzalloc_obj(*aux, GFP_KERNEL); + aux = kzalloc_obj(*aux); if (!aux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c index 37457eb1df1d..3549f1cfdae1 100644 --- a/drivers/clk/spear/clk-frac-synth.c +++ b/drivers/clk/spear/clk-frac-synth.c @@ -134,7 +134,7 @@ struct clk *clk_register_frac(const char *name, const char *parent_name, return ERR_PTR(-EINVAL); } - frac = kzalloc_obj(*frac, GFP_KERNEL); + frac = kzalloc_obj(*frac); if (!frac) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c index dfc8c01d8a41..1a431d7ec20c 100644 --- a/drivers/clk/spear/clk-gpt-synth.c +++ b/drivers/clk/spear/clk-gpt-synth.c @@ -123,7 +123,7 @@ struct clk *clk_register_gpt(const char *name, const char *parent_name, unsigned return ERR_PTR(-EINVAL); } - gpt = kzalloc_obj(*gpt, GFP_KERNEL); + gpt = kzalloc_obj(*gpt); if (!gpt) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c index 8b1fab349a1c..601e123f5c4b 100644 --- a/drivers/clk/spear/clk-vco-pll.c +++ b/drivers/clk/spear/clk-vco-pll.c @@ -293,11 +293,11 @@ struct clk *clk_register_vco_pll(const char *vco_name, const char *pll_name, return ERR_PTR(-EINVAL); } - vco = kzalloc_obj(*vco, GFP_KERNEL); + vco = kzalloc_obj(*vco); if (!vco) return ERR_PTR(-ENOMEM); - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) goto free_vco; diff --git a/drivers/clk/sprd/pll.c b/drivers/clk/sprd/pll.c index 3c70a32e993f..bc2db19aec0e 100644 --- a/drivers/clk/sprd/pll.c +++ b/drivers/clk/sprd/pll.c @@ -155,7 +155,7 @@ static int _sprd_pll_set_rate(const struct sprd_pll *pll, unsigned long kint, nint; u64 tmp, refin, fvco = rate; - cfg = kzalloc_objs(*cfg, regs_num, GFP_KERNEL); + cfg = kzalloc_objs(*cfg, regs_num); if (!cfg) return -ENOMEM; diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index ea14dec68fef..6362ffb73b0b 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -213,7 +213,7 @@ static struct clk *clk_register_flexgen(const char *name, u32 xbar_shift; void __iomem *xbar_reg, *fdiv_reg; - fgxbar = kzalloc_obj(struct flexgen, GFP_KERNEL); + fgxbar = kzalloc_obj(struct flexgen); if (!fgxbar) return ERR_PTR(-ENOMEM); @@ -596,7 +596,7 @@ static void __init st_of_flexgen_setup(struct device_node *np) clk_mode = data->mode; } - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) goto err; @@ -617,7 +617,7 @@ static void __init st_of_flexgen_setup(struct device_node *np) if (!clk_data->clks) goto err; - rlock = kzalloc_obj(spinlock_t, GFP_KERNEL); + rlock = kzalloc_obj(spinlock_t); if (!rlock) goto err; diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c index 74dd344eba4f..3fcc1da20c04 100644 --- a/drivers/clk/st/clkgen-fsyn.c +++ b/drivers/clk/st/clkgen-fsyn.c @@ -454,7 +454,7 @@ static struct clk * __init st_clk_register_quadfs_pll( if (WARN_ON(!name || !parent_name)) return ERR_PTR(-EINVAL); - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); @@ -894,7 +894,7 @@ static struct clk * __init st_clk_register_quadfs_fsynth( if (WARN_ON(!name || !parent_name)) return ERR_PTR(-EINVAL); - fs = kzalloc_obj(*fs, GFP_KERNEL); + fs = kzalloc_obj(*fs); if (!fs) return ERR_PTR(-ENOMEM); @@ -926,12 +926,12 @@ static void __init st_of_create_quadfs_fsynths( struct clk_onecell_data *clk_data; int fschan; - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) return; clk_data->clk_num = QUADFS_MAX_CHAN; - clk_data->clks = kzalloc_objs(struct clk *, QUADFS_MAX_CHAN, GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, QUADFS_MAX_CHAN); if (!clk_data->clks) { kfree(clk_data); @@ -1012,7 +1012,7 @@ static void __init st_of_quadfs_setup(struct device_node *np, if (!pll_name) return; - lock = kzalloc_obj(*lock, GFP_KERNEL); + lock = kzalloc_obj(*lock); if (!lock) goto err_exit; diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c index 9a6b0df5aabc..38d1d2e357f3 100644 --- a/drivers/clk/st/clkgen-pll.c +++ b/drivers/clk/st/clkgen-pll.c @@ -656,7 +656,7 @@ static struct clk * __init clkgen_pll_register(const char *parent_name, struct clk *clk; struct clk_init_data init; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); @@ -716,7 +716,7 @@ static struct clk * __init clkgen_odf_register(const char *parent_name, flags = pll_flags | CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); @@ -725,7 +725,7 @@ static struct clk * __init clkgen_odf_register(const char *parent_name, gate->bit_idx = pll_data->odf_gate[odf].shift; gate->lock = odf_lock; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) { kfree(gate); return ERR_PTR(-ENOMEM); @@ -783,7 +783,7 @@ static void __init clkgen_c32_pll_setup(struct device_node *np, num_odfs = datac->data->num_odfs; - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) return; diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c index d8a1e45fc6bd..03c17cd2032f 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c @@ -347,7 +347,7 @@ int jh7110_reset_controller_register(struct jh71x0_clk_priv *priv, struct auxiliary_device *adev; int ret; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return -ENOMEM; diff --git a/drivers/clk/stm32/reset-stm32.c b/drivers/clk/stm32/reset-stm32.c index 6c4a3a1bfa38..fc237fccae68 100644 --- a/drivers/clk/stm32/reset-stm32.c +++ b/drivers/clk/stm32/reset-stm32.c @@ -130,7 +130,7 @@ int stm32_rcc_reset_init(struct device *dev, struct clk_stm32_reset_data *data, { struct stm32_reset_data *reset_data; - reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data); if (!reset_data) return -ENOMEM; diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c index eff61cb0d8a5..1c083b4d0b7e 100644 --- a/drivers/clk/sunxi-ng/ccu_common.c +++ b/drivers/clk/sunxi-ng/ccu_common.c @@ -242,7 +242,7 @@ void of_sunxi_ccu_probe(struct device_node *node, void __iomem *reg, struct sunxi_ccu *ccu; int ret; - ccu = kzalloc_obj(*ccu, GFP_KERNEL); + ccu = kzalloc_obj(*ccu); if (!ccu) return; diff --git a/drivers/clk/sunxi/clk-a10-hosc.c b/drivers/clk/sunxi/clk-a10-hosc.c index 3a0d899c395a..29eb5a024ac2 100644 --- a/drivers/clk/sunxi/clk-a10-hosc.c +++ b/drivers/clk/sunxi/clk-a10-hosc.c @@ -26,10 +26,10 @@ static void __init sun4i_osc_clk_setup(struct device_node *node) return; /* allocate fixed-rate and gate clock structs */ - fixed = kzalloc_obj(struct clk_fixed_rate, GFP_KERNEL); + fixed = kzalloc_obj(struct clk_fixed_rate); if (!fixed) return; - gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate); if (!gate) goto err_free_fixed; diff --git a/drivers/clk/sunxi/clk-a10-mod1.c b/drivers/clk/sunxi/clk-a10-mod1.c index 45dfe0b2e8d1..3e267e293ae5 100644 --- a/drivers/clk/sunxi/clk-a10-mod1.c +++ b/drivers/clk/sunxi/clk-a10-mod1.c @@ -32,11 +32,11 @@ static void __init sun4i_mod1_clk_setup(struct device_node *node) if (IS_ERR(reg)) return; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) goto err_unmap; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto err_free_mux; diff --git a/drivers/clk/sunxi/clk-a10-pll2.c b/drivers/clk/sunxi/clk-a10-pll2.c index 046e23831fc2..96ebe72429b6 100644 --- a/drivers/clk/sunxi/clk-a10-pll2.c +++ b/drivers/clk/sunxi/clk-a10-pll2.c @@ -50,11 +50,11 @@ static void __init sun4i_pll2_setup(struct device_node *node, if (IS_ERR(reg)) return; - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) goto err_unmap; - clks = kzalloc_objs(struct clk *, SUN4I_PLL2_OUTPUTS, GFP_KERNEL); + clks = kzalloc_objs(struct clk *, SUN4I_PLL2_OUTPUTS); if (!clks) goto err_free_data; @@ -71,7 +71,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, } /* Setup the gate part of the PLL2 */ - gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate); if (!gate) goto err_unregister_prediv; @@ -80,7 +80,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, gate->lock = &sun4i_a10_pll2_lock; /* Setup the multiplier part of the PLL2 */ - mult = kzalloc_obj(struct clk_multiplier, GFP_KERNEL); + mult = kzalloc_obj(struct clk_multiplier); if (!mult) goto err_free_gate; diff --git a/drivers/clk/sunxi/clk-a10-ve.c b/drivers/clk/sunxi/clk-a10-ve.c index d353d0d1200a..75a5019565d8 100644 --- a/drivers/clk/sunxi/clk-a10-ve.c +++ b/drivers/clk/sunxi/clk-a10-ve.c @@ -97,11 +97,11 @@ static void __init sun4i_ve_clk_setup(struct device_node *node) if (IS_ERR(reg)) return; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto err_unmap; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto err_free_div; @@ -129,7 +129,7 @@ static void __init sun4i_ve_clk_setup(struct device_node *node) if (err) goto err_unregister_clk; - reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data); if (!reset_data) goto err_del_provider; diff --git a/drivers/clk/sunxi/clk-a20-gmac.c b/drivers/clk/sunxi/clk-a20-gmac.c index 3ef842034fa2..2a81536b645c 100644 --- a/drivers/clk/sunxi/clk-a20-gmac.c +++ b/drivers/clk/sunxi/clk-a20-gmac.c @@ -63,11 +63,11 @@ static void __init sun7i_a20_gmac_clk_setup(struct device_node *node) return; /* allocate mux and gate clock structs */ - mux = kzalloc_obj(struct clk_mux, GFP_KERNEL); + mux = kzalloc_obj(struct clk_mux); if (!mux) return; - gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate); if (!gate) goto free_mux; diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c index 0b4a25305e93..149187f189d6 100644 --- a/drivers/clk/sunxi/clk-factors.c +++ b/drivers/clk/sunxi/clk-factors.c @@ -200,7 +200,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, else of_property_read_string(node, "clock-output-names", &clk_name); - factors = kzalloc_obj(struct clk_factors, GFP_KERNEL); + factors = kzalloc_obj(struct clk_factors); if (!factors) goto err_factors; @@ -213,7 +213,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, /* Add a gate if this factor clock can be gated */ if (data->enable) { - gate = kzalloc_obj(struct clk_gate, GFP_KERNEL); + gate = kzalloc_obj(struct clk_gate); if (!gate) goto err_gate; @@ -228,7 +228,7 @@ static struct clk *__sunxi_factors_register(struct device_node *node, /* Add a mux if this factor clock can be muxed */ if (data->mux) { - mux = kzalloc_obj(struct clk_mux, GFP_KERNEL); + mux = kzalloc_obj(struct clk_mux); if (!mux) goto err_mux; diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c index dcfaa8a936c4..b409a8d70962 100644 --- a/drivers/clk/sunxi/clk-mod0.c +++ b/drivers/clk/sunxi/clk-mod0.c @@ -300,11 +300,11 @@ static void __init sunxi_mmc_setup(struct device_node *node, return; } - clk_data = kmalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kmalloc_obj(*clk_data); if (!clk_data) return; - clk_data->clks = kzalloc_objs(*clk_data->clks, 3, GFP_KERNEL); + clk_data->clks = kzalloc_objs(*clk_data->clks, 3); if (!clk_data->clks) goto err_free_data; @@ -323,7 +323,7 @@ static void __init sunxi_mmc_setup(struct device_node *node, }; struct mmc_phase *phase; - phase = kmalloc_obj(*phase, GFP_KERNEL); + phase = kmalloc_obj(*phase); if (!phase) continue; diff --git a/drivers/clk/sunxi/clk-simple-gates.c b/drivers/clk/sunxi/clk-simple-gates.c index 3852972a8600..99e83ada7af6 100644 --- a/drivers/clk/sunxi/clk-simple-gates.c +++ b/drivers/clk/sunxi/clk-simple-gates.c @@ -34,14 +34,14 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, clk_parent = of_clk_get_parent_name(node, 0); - clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data); if (!clk_data) goto err_unmap; number = of_property_count_u32_elems(node, "clock-indices"); of_property_read_u32_index(node, "clock-indices", number - 1, &number); - clk_data->clks = kzalloc_objs(struct clk *, number + 1, GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, number + 1); if (!clk_data->clks) goto err_free_data; diff --git a/drivers/clk/sunxi/clk-sun4i-display.c b/drivers/clk/sunxi/clk-sun4i-display.c index a4e00d516b68..e17325e741e1 100644 --- a/drivers/clk/sunxi/clk-sun4i-display.c +++ b/drivers/clk/sunxi/clk-sun4i-display.c @@ -126,7 +126,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, goto unmap; } - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) goto unmap; @@ -135,7 +135,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, mux->mask = (1 << data->width_mux) - 1; mux->lock = &sun4i_a10_display_lock; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto free_mux; @@ -144,7 +144,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, gate->lock = &sun4i_a10_display_lock; if (data->has_div) { - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto free_gate; @@ -175,7 +175,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, if (!data->num_rst) return; - reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data); if (!reset_data) goto free_of_clk; diff --git a/drivers/clk/sunxi/clk-sun4i-pll3.c b/drivers/clk/sunxi/clk-sun4i-pll3.c index 2977e71ea35a..1b8b1959dc19 100644 --- a/drivers/clk/sunxi/clk-sun4i-pll3.c +++ b/drivers/clk/sunxi/clk-sun4i-pll3.c @@ -37,7 +37,7 @@ static void __init sun4i_a10_pll3_setup(struct device_node *node) return; } - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto err_unmap; @@ -45,7 +45,7 @@ static void __init sun4i_a10_pll3_setup(struct device_node *node) gate->bit_idx = SUN4I_A10_PLL3_GATE_BIT; gate->lock = &sun4i_a10_pll3_lock; - mult = kzalloc_obj(*mult, GFP_KERNEL); + mult = kzalloc_obj(*mult); if (!mult) goto err_free_gate; diff --git a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c index 6e4c9db335e6..b61eba112a7f 100644 --- a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c +++ b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c @@ -246,7 +246,7 @@ static void __init tcon_ch1_setup(struct device_node *node) goto err_unmap; } - tclk = kzalloc_obj(*tclk, GFP_KERNEL); + tclk = kzalloc_obj(*tclk); if (!tclk) goto err_unmap; diff --git a/drivers/clk/sunxi/clk-sun8i-bus-gates.c b/drivers/clk/sunxi/clk-sun8i-bus-gates.c index c212200d49f4..df0f055bae5c 100644 --- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c +++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c @@ -44,14 +44,14 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node) parents[i] = of_clk_get_parent_name(node, idx); } - clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data); if (!clk_data) goto err_unmap; number = of_property_count_u32_elems(node, "clock-indices"); of_property_read_u32_index(node, "clock-indices", number - 1, &number); - clk_data->clks = kzalloc_objs(struct clk *, number + 1, GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, number + 1); if (!clk_data->clks) goto err_free_data; diff --git a/drivers/clk/sunxi/clk-sun8i-mbus.c b/drivers/clk/sunxi/clk-sun8i-mbus.c index 9156830f04a6..fe7a0693b15d 100644 --- a/drivers/clk/sunxi/clk-sun8i-mbus.c +++ b/drivers/clk/sunxi/clk-sun8i-mbus.c @@ -44,15 +44,15 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node) goto err_free_parents; } - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) goto err_unmap; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) goto err_free_div; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto err_free_mux; diff --git a/drivers/clk/sunxi/clk-sun9i-cpus.c b/drivers/clk/sunxi/clk-sun9i-cpus.c index f49f4df71bc2..516a94f28750 100644 --- a/drivers/clk/sunxi/clk-sun9i-cpus.c +++ b/drivers/clk/sunxi/clk-sun9i-cpus.c @@ -191,7 +191,7 @@ static void sun9i_a80_cpus_setup(struct device_node *node) struct clk *clk; int ret; - cpus = kzalloc_obj(*cpus, GFP_KERNEL); + cpus = kzalloc_obj(*cpus); if (!cpus) return; @@ -204,7 +204,7 @@ static void sun9i_a80_cpus_setup(struct device_node *node) /* we have a mux, we will have >1 parents */ ret = of_clk_parent_fill(node, parents, SUN9I_CPUS_MAX_PARENTS); - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) goto err_unmap; diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 1451ebec1ac6..c6557c1de33f 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -991,11 +991,11 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, return NULL; } - clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data); if (!clk_data) goto out_unmap; - clks = kzalloc_objs(*clks, ndivs, GFP_KERNEL); + clks = kzalloc_objs(*clks, ndivs); if (!clks) goto free_clkdata; @@ -1022,7 +1022,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, /* If this leaf clock can be gated, create a gate */ if (data->div[i].gate) { - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) goto free_clks; @@ -1035,7 +1035,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, /* Leaves can be fixed or configurable divisors */ if (data->div[i].fixed) { - fix_factor = kzalloc_obj(*fix_factor, GFP_KERNEL); + fix_factor = kzalloc_obj(*fix_factor); if (!fix_factor) goto free_gate; @@ -1045,7 +1045,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, rate_hw = &fix_factor->hw; rate_ops = &clk_fixed_factor_ops; } else { - divider = kzalloc_obj(*divider, GFP_KERNEL); + divider = kzalloc_obj(*divider); if (!divider) goto free_gate; diff --git a/drivers/clk/sunxi/clk-usb.c b/drivers/clk/sunxi/clk-usb.c index f993884c58d6..903d22c002cc 100644 --- a/drivers/clk/sunxi/clk-usb.c +++ b/drivers/clk/sunxi/clk-usb.c @@ -113,11 +113,11 @@ static void __init sunxi_usb_clk_setup(struct device_node *node, qty = find_last_bit((unsigned long *)&data->clk_mask, SUNXI_USB_MAX_SIZE); - clk_data = kmalloc_obj(struct clk_onecell_data, GFP_KERNEL); + clk_data = kmalloc_obj(struct clk_onecell_data); if (!clk_data) return; - clk_data->clks = kzalloc_objs(struct clk *, qty + 1, GFP_KERNEL); + clk_data->clks = kzalloc_objs(struct clk *, qty + 1); if (!clk_data->clks) { kfree(clk_data); return; @@ -144,7 +144,7 @@ static void __init sunxi_usb_clk_setup(struct device_node *node, if (data->reset_mask == 0) return; - reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data); if (!reset_data) return; diff --git a/drivers/clk/tegra/clk-audio-sync.c b/drivers/clk/tegra/clk-audio-sync.c index 41db1d5978e3..0bbfcf46bedd 100644 --- a/drivers/clk/tegra/clk-audio-sync.c +++ b/drivers/clk/tegra/clk-audio-sync.c @@ -50,7 +50,7 @@ struct clk *tegra_clk_register_sync_source(const char *name, struct clk_init_data init; struct clk *clk; - sync = kzalloc_obj(*sync, GFP_KERNEL); + sync = kzalloc_obj(*sync); if (!sync) { pr_err("%s: could not allocate sync source clk\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-bpmp.c b/drivers/clk/tegra/clk-bpmp.c index 064d9ee431e5..f6d2b934228b 100644 --- a/drivers/clk/tegra/clk-bpmp.c +++ b/drivers/clk/tegra/clk-bpmp.c @@ -434,7 +434,7 @@ static int tegra_bpmp_probe_clocks(struct tegra_bpmp *bpmp, dev_dbg(bpmp->dev, "maximum clock ID: %u\n", max_id); - clocks = kzalloc_objs(*clocks, max_id + 1, GFP_KERNEL); + clocks = kzalloc_objs(*clocks, max_id + 1); if (!clocks) return -ENOMEM; diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c index 62fd39a849b1..27f43c3da156 100644 --- a/drivers/clk/tegra/clk-divider.c +++ b/drivers/clk/tegra/clk-divider.c @@ -148,7 +148,7 @@ struct clk *tegra_clk_register_divider(const char *name, struct clk *clk; struct clk_init_data init; - divider = kzalloc_obj(*divider, GFP_KERNEL); + divider = kzalloc_obj(*divider); if (!divider) { pr_err("%s: could not allocate fractional divider clk\n", __func__); diff --git a/drivers/clk/tegra/clk-periph-fixed.c b/drivers/clk/tegra/clk-periph-fixed.c index 363a0e0aed3d..bb33e32cad4a 100644 --- a/drivers/clk/tegra/clk-periph-fixed.c +++ b/drivers/clk/tegra/clk-periph-fixed.c @@ -84,7 +84,7 @@ struct clk *tegra_clk_register_periph_fixed(const char *name, if (!regs) return ERR_PTR(-EINVAL); - fixed = kzalloc_obj(*fixed, GFP_KERNEL); + fixed = kzalloc_obj(*fixed); if (!fixed) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-periph-gate.c b/drivers/clk/tegra/clk-periph-gate.c index 1892a5b78fc7..fa39d6487515 100644 --- a/drivers/clk/tegra/clk-periph-gate.c +++ b/drivers/clk/tegra/clk-periph-gate.c @@ -146,7 +146,7 @@ struct clk *tegra_clk_register_periph_gate(const char *name, if (!pregs) return ERR_PTR(-EINVAL); - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) { pr_err("%s: could not allocate periph gate clk\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-pll-out.c b/drivers/clk/tegra/clk-pll-out.c index cf10c7bea32d..2299545fc386 100644 --- a/drivers/clk/tegra/clk-pll-out.c +++ b/drivers/clk/tegra/clk-pll-out.c @@ -93,7 +93,7 @@ struct clk *tegra_clk_register_pll_out(const char *name, struct clk *clk; struct clk_init_data init; - pll_out = kzalloc_obj(*pll_out, GFP_KERNEL); + pll_out = kzalloc_obj(*pll_out); if (!pll_out) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c index 3031725e2a9d..d86003b6d94f 100644 --- a/drivers/clk/tegra/clk-pll.c +++ b/drivers/clk/tegra/clk-pll.c @@ -1882,7 +1882,7 @@ static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base, { struct tegra_clk_pll *pll; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-sdmmc-mux.c b/drivers/clk/tegra/clk-sdmmc-mux.c index 524469ff0805..14b5439a100a 100644 --- a/drivers/clk/tegra/clk-sdmmc-mux.c +++ b/drivers/clk/tegra/clk-sdmmc-mux.c @@ -250,7 +250,7 @@ struct clk *tegra_clk_register_sdmmc_mux_div(const char *name, if (!bank) return ERR_PTR(-EINVAL); - sdmmc_mux = kzalloc_obj(*sdmmc_mux, GFP_KERNEL); + sdmmc_mux = kzalloc_obj(*sdmmc_mux); if (!sdmmc_mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-super.c b/drivers/clk/tegra/clk-super.c index 3882efd05427..370445e3d5ac 100644 --- a/drivers/clk/tegra/clk-super.c +++ b/drivers/clk/tegra/clk-super.c @@ -207,7 +207,7 @@ struct clk *tegra_clk_register_super_mux(const char *name, struct clk *clk; struct clk_init_data init; - super = kzalloc_obj(*super, GFP_KERNEL); + super = kzalloc_obj(*super); if (!super) return ERR_PTR(-ENOMEM); @@ -243,7 +243,7 @@ struct clk *tegra_clk_register_super_clk(const char *name, struct clk *clk; struct clk_init_data init; - super = kzalloc_obj(*super, GFP_KERNEL); + super = kzalloc_obj(*super); if (!super) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra-super-cclk.c b/drivers/clk/tegra/clk-tegra-super-cclk.c index 0f4ec781024c..e7aeb67606b1 100644 --- a/drivers/clk/tegra/clk-tegra-super-cclk.c +++ b/drivers/clk/tegra/clk-tegra-super-cclk.c @@ -142,7 +142,7 @@ struct clk *tegra_clk_register_super_cclk(const char *name, if (WARN_ON(cclk_super)) return ERR_PTR(-EBUSY); - super = kzalloc_obj(*super, GFP_KERNEL); + super = kzalloc_obj(*super); if (!super) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c index c92fc64c79dc..f3b2c96fdcfc 100644 --- a/drivers/clk/tegra/clk-tegra124-emc.c +++ b/drivers/clk/tegra/clk-tegra124-emc.c @@ -492,7 +492,7 @@ struct clk *tegra124_clk_register_emc(void __iomem *base, struct device_node *np struct clk *clk; int err; - tegra = kzalloc_objs(*tegra, 1, GFP_KERNEL); + tegra = kzalloc_objs(*tegra, 1); if (!tegra) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra20-emc.c b/drivers/clk/tegra/clk-tegra20-emc.c index 20efe7827d27..44465726a8a6 100644 --- a/drivers/clk/tegra/clk-tegra20-emc.c +++ b/drivers/clk/tegra/clk-tegra20-emc.c @@ -249,7 +249,7 @@ struct clk *tegra20_clk_register_emc(void __iomem *ioaddr, bool low_jitter) struct clk_init_data init; struct clk *clk; - emc = kzalloc_obj(*emc, GFP_KERNEL); + emc = kzalloc_obj(*emc); if (!emc) return NULL; diff --git a/drivers/clk/tegra/clk-tegra210-emc.c b/drivers/clk/tegra/clk-tegra210-emc.c index 9e88cd587183..9f140d94bef7 100644 --- a/drivers/clk/tegra/clk-tegra210-emc.c +++ b/drivers/clk/tegra/clk-tegra210-emc.c @@ -278,7 +278,7 @@ struct clk *tegra210_clk_register_emc(struct device_node *np, struct clk_init_data init; struct clk *clk; - emc = kzalloc_obj(*emc, GFP_KERNEL); + emc = kzalloc_obj(*emc); if (!emc) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index ad21a735723e..0c86cff719e3 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3705,7 +3705,7 @@ static void tegra210_mbist_clk_init(void) if (!num_clks) continue; - clk_data = kmalloc_objs(*clk_data, num_clks, GFP_KERNEL); + clk_data = kmalloc_objs(*clk_data, num_clks); if (WARN_ON(!clk_data)) return; diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c index 7f11d1795d79..e6c787261cb6 100644 --- a/drivers/clk/tegra/clk.c +++ b/drivers/clk/tegra/clk.c @@ -234,7 +234,7 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) periph_banks = banks; - clks = kzalloc_objs(struct clk *, num, GFP_KERNEL); + clks = kzalloc_objs(struct clk *, num); if (!clks) { kfree(periph_clk_enb_refcnt); return NULL; diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 5ec7cfd5e669..31bf097f8aba 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -183,9 +183,9 @@ static void __init of_dra7_apll_setup(struct device_node *node) const char **parent_names = NULL; int ret; - ad = kzalloc_obj(*ad, GFP_KERNEL); - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); - init = kzalloc_obj(*init, GFP_KERNEL); + ad = kzalloc_obj(*ad); + clk_hw = kzalloc_obj(*clk_hw); + init = kzalloc_obj(*init); if (!ad || !clk_hw || !init) goto cleanup; @@ -347,9 +347,9 @@ static void __init of_omap2_apll_setup(struct device_node *node) u32 val; int ret; - ad = kzalloc_obj(*ad, GFP_KERNEL); - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); - init = kzalloc_obj(*init, GFP_KERNEL); + ad = kzalloc_obj(*ad); + clk_hw = kzalloc_obj(*clk_hw); + init = kzalloc_obj(*init); if (!ad || !clk_hw || !init) goto cleanup; diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c index 62b136861f95..610f225a8295 100644 --- a/drivers/clk/ti/autoidle.c +++ b/drivers/clk/ti/autoidle.c @@ -191,7 +191,7 @@ int __init of_ti_clk_autoidle_setup(struct device_node *node) if (of_property_read_u32(node, "ti,autoidle-shift", &shift)) return 0; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return -ENOMEM; diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index fd41aa9fbab1..fb41f55d44e7 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -170,7 +170,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node) const char *name; struct clk *clk; - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); if (!clk_hw) { pr_err("%s: could not allocate dra7_atl_desc\n", __func__); return; diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 23ab4f380956..efdb6ab4a5be 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c @@ -268,7 +268,7 @@ int __init ti_clk_retry_init(struct device_node *node, void *user, struct clk_init_item *retry; pr_debug("%pOFn: adding to retry list...\n", node); - retry = kzalloc_obj(*retry, GFP_KERNEL); + retry = kzalloc_obj(*retry); if (!retry) return -ENOMEM; @@ -411,7 +411,7 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index, /* add clocks node info */ clocks_node_ptr[index] = clocks; - io = kzalloc_obj(*io, GFP_KERNEL); + io = kzalloc_obj(*io); if (!io) return -ENOMEM; @@ -576,7 +576,7 @@ int ti_clk_add_alias(struct clk *clk, const char *con) if (IS_ERR(clk)) return PTR_ERR(clk); - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return -ENOMEM; diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 06a39d981733..f779906cc8ef 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -297,7 +297,7 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider, ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT); - clkctrl_clk = kzalloc_obj(*clkctrl_clk, GFP_KERNEL); + clkctrl_clk = kzalloc_obj(*clkctrl_clk); if (!init.name || !clkctrl_clk) { ret = -ENOMEM; goto cleanup; @@ -337,7 +337,7 @@ _ti_clkctrl_setup_gate(struct omap_clkctrl_provider *provider, { struct clk_hw_omap *clk_hw; - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); if (!clk_hw) return; @@ -360,7 +360,7 @@ _ti_clkctrl_setup_mux(struct omap_clkctrl_provider *provider, int num_parents = 0; const char * const *pname; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return; @@ -395,7 +395,7 @@ _ti_clkctrl_setup_div(struct omap_clkctrl_provider *provider, const struct omap_clkctrl_div_data *div_data = data->data; u8 div_flags = 0; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return; @@ -579,7 +579,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) return; } - provider = kzalloc_obj(*provider, GFP_KERNEL); + provider = kzalloc_obj(*provider); if (!provider) return; @@ -650,7 +650,7 @@ clkdm_found: continue; } - hw = kzalloc_obj(*hw, GFP_KERNEL); + hw = kzalloc_obj(*hw); if (!hw) return; @@ -683,7 +683,7 @@ clkdm_found: if (!init.name) goto cleanup; - clkctrl_clk = kzalloc_obj(*clkctrl_clk, GFP_KERNEL); + clkctrl_clk = kzalloc_obj(*clkctrl_clk); if (!clkctrl_clk) goto cleanup; diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c index 0403995cd8ac..c379bbdae25a 100644 --- a/drivers/clk/ti/composite.c +++ b/drivers/clk/ti/composite.c @@ -211,7 +211,7 @@ static void __init of_ti_composite_clk_setup(struct device_node *node) return; } - cclk = kzalloc_obj(*cclk, GFP_KERNEL); + cclk = kzalloc_obj(*cclk); if (!cclk) return; @@ -253,7 +253,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, of_clk_parent_fill(node, parent_names, num_parents); - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) { kfree(parent_names); return -ENOMEM; diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c index af2776f13413..af923b8cb0ed 100644 --- a/drivers/clk/ti/divider.c +++ b/drivers/clk/ti/divider.c @@ -357,7 +357,7 @@ int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div, num_dividers = i; - tmp = kzalloc_objs(*tmp, valid_div + 1, GFP_KERNEL); + tmp = kzalloc_objs(*tmp, valid_div + 1); if (!tmp) return -ENOMEM; @@ -413,7 +413,7 @@ static int __init ti_clk_get_div_table(struct device_node *node, return -EINVAL; } - table = kzalloc_objs(*table, valid_div + 1, GFP_KERNEL); + table = kzalloc_objs(*table, valid_div + 1); if (!table) return -ENOMEM; @@ -517,7 +517,7 @@ static void __init of_ti_divider_clk_setup(struct device_node *node) u32 flags = 0; struct clk_omap_divider *div; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return; @@ -542,7 +542,7 @@ static void __init of_ti_composite_divider_clk_setup(struct device_node *node) struct clk_omap_divider *div; u32 tmp; - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return; diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index bce9af95d7aa..e01272cd628d 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c @@ -222,7 +222,7 @@ static void _register_dpll_x2(struct device_node *node, return; } - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); if (!clk_hw) return; @@ -281,8 +281,8 @@ static void __init of_ti_dpll_setup(struct device_node *node, u32 min_div; dd = kmemdup(ddt, sizeof(*dd), GFP_KERNEL); - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); - init = kzalloc_obj(*init, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); + init = kzalloc_obj(*init); if (!dd || !clk_hw || !init) goto cleanup; diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c index 22be4570b038..e54b1df3436e 100644 --- a/drivers/clk/ti/fapll.c +++ b/drivers/clk/ti/fapll.c @@ -499,7 +499,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, struct fapll_synth *synth; struct clk *clk = ERR_PTR(-ENOMEM); - init = kzalloc_obj(*init, GFP_KERNEL); + init = kzalloc_obj(*init); if (!init) return ERR_PTR(-ENOMEM); @@ -508,7 +508,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, init->parent_names = &parent; init->num_parents = 1; - synth = kzalloc_obj(*synth, GFP_KERNEL); + synth = kzalloc_obj(*synth); if (!synth) goto free; @@ -544,7 +544,7 @@ static void __init ti_fapll_setup(struct device_node *node) const char *name; int i; - fd = kzalloc_obj(*fd, GFP_KERNEL); + fd = kzalloc_obj(*fd); if (!fd) return; @@ -554,7 +554,7 @@ static void __init ti_fapll_setup(struct device_node *node) if (!fd->outputs.clks) goto free; - init = kzalloc_obj(*init, GFP_KERNEL); + init = kzalloc_obj(*init); if (!init) goto free; diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c index 73986d78492a..74741227013b 100644 --- a/drivers/clk/ti/gate.c +++ b/drivers/clk/ti/gate.c @@ -95,7 +95,7 @@ static struct clk *_register_gate(struct device_node *node, const char *name, struct clk_hw_omap *clk_hw; struct clk *clk; - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); if (!clk_hw) return ERR_PTR(-ENOMEM); @@ -169,7 +169,7 @@ _of_ti_composite_gate_clk_setup(struct device_node *node, { struct clk_hw_omap *gate; - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return; diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c index 999e230d7414..039c8075eca4 100644 --- a/drivers/clk/ti/interface.c +++ b/drivers/clk/ti/interface.c @@ -34,7 +34,7 @@ static struct clk *_register_interface(struct device_node *node, struct clk_hw_omap *clk_hw; struct clk *clk; - clk_hw = kzalloc_obj(*clk_hw, GFP_KERNEL); + clk_hw = kzalloc_obj(*clk_hw); if (!clk_hw) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 3911e43a6716..d6a0ccfd81db 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -129,7 +129,7 @@ static struct clk *_register_mux(struct device_node *node, const char *name, struct clk_init_data init; /* allocate the mux */ - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -227,7 +227,7 @@ struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup) if (!setup) return NULL; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -253,7 +253,7 @@ static void __init of_ti_composite_mux_clk_setup(struct device_node *node) struct clk_omap_mux *mux; unsigned int num_parents; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return; diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c index 5639474557fe..dce235df2576 100644 --- a/drivers/clk/ux500/clk-prcc.c +++ b/drivers/clk/ux500/clk-prcc.c @@ -106,7 +106,7 @@ static struct clk *clk_reg_prcc(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c index 95efbc4f84a7..ddc86551bf57 100644 --- a/drivers/clk/ux500/clk-prcmu.c +++ b/drivers/clk/ux500/clk-prcmu.c @@ -209,7 +209,7 @@ static struct clk_hw *clk_reg_prcmu(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ struct clk_hw *clk_reg_prcmu_clkout(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c index 42c1df2382ee..6f78808387b1 100644 --- a/drivers/clk/ux500/u8500_of_clk.c +++ b/drivers/clk/ux500/u8500_of_clk.c @@ -137,7 +137,7 @@ static void u8500_clk_init(struct device_node *np) * base addresses properly and pass to the reset controller init * function later on. */ - rstc = kzalloc_obj(*rstc, GFP_KERNEL); + rstc = kzalloc_obj(*rstc); if (!rstc) return; diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index d95d66cd5b6a..6bd3db54dd22 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -363,7 +363,7 @@ struct clk *icst_clk_setup(struct device *dev, struct clk_init_data init; struct icst_params *pclone; - icst = kzalloc_obj(*icst, GFP_KERNEL); + icst = kzalloc_obj(*icst); if (!icst) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c index 5f83760b68d4..b0e69686f7a9 100644 --- a/drivers/clk/versatile/clk-sp810.c +++ b/drivers/clk/versatile/clk-sp810.c @@ -82,7 +82,7 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec, static void __init clk_sp810_of_setup(struct device_node *node) { - struct clk_sp810 *sp810 = kzalloc_obj(*sp810, GFP_KERNEL); + struct clk_sp810 *sp810 = kzalloc_obj(*sp810); const char *parent_names[2]; int num = ARRAY_SIZE(parent_names); char name[12]; diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c index 7494a24134de..fadf81ff932f 100644 --- a/drivers/clk/visconti/pll.c +++ b/drivers/clk/visconti/pll.c @@ -255,7 +255,7 @@ static struct clk_hw *visconti_register_pll(struct visconti_pll_provider *ctx, size_t len; int ret; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c index 4a5f2b6267c0..6a22cbbc1235 100644 --- a/drivers/clk/zynq/clkc.c +++ b/drivers/clk/zynq/clkc.c @@ -112,10 +112,10 @@ static void __init zynq_clk_register_fclk(enum zynq_clk fclk, spinlock_t *fclk_gate_lock; void __iomem *fclk_gate_reg = fclk_ctrl_reg + 8; - fclk_lock = kmalloc_obj(*fclk_lock, GFP_KERNEL); + fclk_lock = kmalloc_obj(*fclk_lock); if (!fclk_lock) goto err; - fclk_gate_lock = kmalloc_obj(*fclk_gate_lock, GFP_KERNEL); + fclk_gate_lock = kmalloc_obj(*fclk_gate_lock); if (!fclk_gate_lock) goto err_fclk_gate_lock; spin_lock_init(fclk_lock); @@ -180,7 +180,7 @@ static void __init zynq_clk_register_periph_clk(enum zynq_clk clk0, char *div_name; spinlock_t *lock; - lock = kmalloc_obj(*lock, GFP_KERNEL); + lock = kmalloc_obj(*lock); if (!lock) goto err; spin_lock_init(lock); diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c index 0c411ad86575..44c609378364 100644 --- a/drivers/clk/zynq/pll.c +++ b/drivers/clk/zynq/pll.c @@ -200,7 +200,7 @@ struct clk *clk_register_zynq_pll(const char *name, const char *parent, .flags = 0 }; - pll = kmalloc_obj(*pll, GFP_KERNEL); + pll = kmalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index 2e36f14d0a52..db10eb69f3fe 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -115,7 +115,7 @@ struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id, struct clk_init_data init; /* allocate the gate */ - gate = kzalloc_obj(*gate, GFP_KERNEL); + gate = kzalloc_obj(*gate); if (!gate) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c index f8d67adfd258..e37bd3516974 100644 --- a/drivers/clk/zynqmp/clk-mux-zynqmp.c +++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c @@ -138,7 +138,7 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id, struct clk_init_data init; int ret; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c index c71401b3aa1f..3911700d4ca7 100644 --- a/drivers/clk/zynqmp/clkc.c +++ b/drivers/clk/zynqmp/clkc.c @@ -763,7 +763,7 @@ static int zynqmp_clk_setup(struct device_node *np) if (!zynqmp_data) return -ENOMEM; - clock = kzalloc_objs(*clock, clock_max_idx, GFP_KERNEL); + clock = kzalloc_objs(*clock, clock_max_idx); if (!clock) { kfree(zynqmp_data); return -ENOMEM; diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index 3c147ba7dbcc..4075f6ecf076 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -284,7 +284,7 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, int ret; /* allocate the divider */ - div = kzalloc_obj(*div, GFP_KERNEL); + div = kzalloc_obj(*div); if (!div) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 1cd5e0493e98..6463787cf57b 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -326,7 +326,7 @@ struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, init.parent_names = parents; init.num_parents = 1; - pll = kzalloc_obj(*pll, GFP_KERNEL); + pll = kzalloc_obj(*pll); if (!pll) return ERR_PTR(-ENOMEM); diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index ff0e21edd9c1..d7662301bf0e 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c @@ -98,7 +98,7 @@ static int __init bcm2835_timer_init(struct device_node *node) goto err_iounmap; } - timer = kzalloc_obj(*timer, GFP_KERNEL); + timer = kzalloc_obj(*timer); if (!timer) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c index 75c17eeef689..bb0a44adaf28 100644 --- a/drivers/clocksource/clps711x-timer.c +++ b/drivers/clocksource/clps711x-timer.c @@ -54,7 +54,7 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, struct clock_event_device *clkevt; unsigned long rate; - clkevt = kzalloc_obj(*clkevt, GFP_KERNEL); + clkevt = kzalloc_obj(*clkevt); if (!clkevt) return -ENOMEM; diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c index 043793728e23..b719b2483e87 100644 --- a/drivers/clocksource/dw_apb_timer.c +++ b/drivers/clocksource/dw_apb_timer.c @@ -340,7 +340,7 @@ struct dw_apb_clocksource * dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base, unsigned long freq) { - struct dw_apb_clocksource *dw_cs = kzalloc_obj(*dw_cs, GFP_KERNEL); + struct dw_apb_clocksource *dw_cs = kzalloc_obj(*dw_cs); if (!dw_cs) return NULL; diff --git a/drivers/clocksource/ingenic-sysost.c b/drivers/clocksource/ingenic-sysost.c index 22caa69197a2..d967972c1fdc 100644 --- a/drivers/clocksource/ingenic-sysost.c +++ b/drivers/clocksource/ingenic-sysost.c @@ -279,7 +279,7 @@ static int __init ingenic_ost_register_clock(struct ingenic_ost *ost, struct ingenic_ost_clk *ost_clk; int val, err; - ost_clk = kzalloc_obj(*ost_clk, GFP_KERNEL); + ost_clk = kzalloc_obj(*ost_clk); if (!ost_clk) return -ENOMEM; @@ -432,7 +432,7 @@ static int __init ingenic_ost_probe(struct device_node *np) unsigned int i; int ret; - ost = kzalloc_obj(*ost, GFP_KERNEL); + ost = kzalloc_obj(*ost); if (!ost) return -ENOMEM; diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c index 286513486542..cd5fbf49ac29 100644 --- a/drivers/clocksource/mmio.c +++ b/drivers/clocksource/mmio.c @@ -55,7 +55,7 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name, if (bits > 64 || bits < 16) return -EINVAL; - cs = kzalloc_obj(struct clocksource_mmio, GFP_KERNEL); + cs = kzalloc_obj(struct clocksource_mmio); if (!cs) return -ENOMEM; diff --git a/drivers/clocksource/mps2-timer.c b/drivers/clocksource/mps2-timer.c index 53c484d29195..ebca55d8cfed 100644 --- a/drivers/clocksource/mps2-timer.c +++ b/drivers/clocksource/mps2-timer.c @@ -136,7 +136,7 @@ static int __init mps2_clockevent_init(struct device_node *np) goto out_iounmap; } - ce = kzalloc_obj(*ce, GFP_KERNEL); + ce = kzalloc_obj(*ce); if (!ce) { ret = -ENOMEM; goto out_iounmap; diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c index 36132692bae5..9404ccb1bda9 100644 --- a/drivers/clocksource/renesas-ostm.c +++ b/drivers/clocksource/renesas-ostm.c @@ -165,7 +165,7 @@ static int __init ostm_init(struct device_node *np) struct timer_of *to; int ret; - to = kzalloc_obj(*to, GFP_KERNEL); + to = kzalloc_obj(*to); if (!to) return -ENOMEM; diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index fd8cdabef9bc..66d00514600a 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -1139,7 +1139,7 @@ static int sh_cmt_probe(struct platform_device *pdev) goto out; } - cmt = kzalloc_obj(*cmt, GFP_KERNEL); + cmt = kzalloc_obj(*cmt); if (cmt == NULL) return -ENOMEM; diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 333548989ed5..eb9ecc9fd840 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -462,7 +462,7 @@ static int sh_mtu2_probe(struct platform_device *pdev) goto out; } - mtu = kzalloc_obj(*mtu, GFP_KERNEL); + mtu = kzalloc_obj(*mtu); if (mtu == NULL) return -ENOMEM; diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 365739e1fbad..ba2074536a82 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -593,7 +593,7 @@ static int sh_tmu_probe(struct platform_device *pdev) goto out; } - tmu = kzalloc_obj(*tmu, GFP_KERNEL); + tmu = kzalloc_obj(*tmu); if (tmu == NULL) return -ENOMEM; diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c index 253c3e4d0296..888b06731e54 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c @@ -170,7 +170,7 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) int ret; struct pit_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c index 836141e51118..3c50d6892849 100644 --- a/drivers/clocksource/timer-cadence-ttc.c +++ b/drivers/clocksource/timer-cadence-ttc.c @@ -334,7 +334,7 @@ static int __init ttc_setup_clocksource(struct clk *clk, void __iomem *base, struct ttc_timer_clocksource *ttccs; int err; - ttccs = kzalloc_obj(*ttccs, GFP_KERNEL); + ttccs = kzalloc_obj(*ttccs); if (!ttccs) return -ENOMEM; @@ -417,7 +417,7 @@ static int __init ttc_setup_clockevent(struct clk *clk, struct ttc_timer_clockevent *ttcce; int err; - ttcce = kzalloc_obj(*ttcce, GFP_KERNEL); + ttcce = kzalloc_obj(*ttcce); if (!ttcce) return -ENOMEM; diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c index 9bf1728a87dc..16ee0687ef31 100644 --- a/drivers/clocksource/timer-davinci.c +++ b/drivers/clocksource/timer-davinci.c @@ -271,7 +271,7 @@ int __init davinci_timer_register(struct clk *clk, davinci_timer_init(base); tick_rate = clk_get_rate(clk); - clockevent = kzalloc_obj(*clockevent, GFP_KERNEL); + clockevent = kzalloc_obj(*clockevent); if (!clockevent) { rv = -ENOMEM; goto exit_iounmap_base; diff --git a/drivers/clocksource/timer-ep93xx.c b/drivers/clocksource/timer-ep93xx.c index 04eeda15d997..1b719282c07f 100644 --- a/drivers/clocksource/timer-ep93xx.c +++ b/drivers/clocksource/timer-ep93xx.c @@ -141,7 +141,7 @@ static int __init ep93xx_timer_of_init(struct device_node *np) struct ep93xx_tcu *tcu; int ret; - tcu = kzalloc_obj(*tcu, GFP_KERNEL); + tcu = kzalloc_obj(*tcu); if (!tcu) return -ENOMEM; diff --git a/drivers/clocksource/timer-fsl-ftm.c b/drivers/clocksource/timer-fsl-ftm.c index df82307e690c..4eed6cb46132 100644 --- a/drivers/clocksource/timer-fsl-ftm.c +++ b/drivers/clocksource/timer-fsl-ftm.c @@ -300,7 +300,7 @@ static int __init ftm_timer_init(struct device_node *np) unsigned long freq; int ret, irq; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index e0f7d5976518..308f94bfbaed 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -295,7 +295,7 @@ static int __init fttmr010_common_init(struct device_node *np, return ret; } - fttmr010 = kzalloc_obj(*fttmr010, GFP_KERNEL); + fttmr010 = kzalloc_obj(*fttmr010); if (!fttmr010) { ret = -ENOMEM; goto out_disable_clock; diff --git a/drivers/clocksource/timer-goldfish.c b/drivers/clocksource/timer-goldfish.c index 60982561e8b6..3fe12c7ee7b7 100644 --- a/drivers/clocksource/timer-goldfish.c +++ b/drivers/clocksource/timer-goldfish.c @@ -102,7 +102,7 @@ int __init goldfish_timer_init(int irq, void __iomem *base) struct goldfish_timer *timerdrv; int ret; - timerdrv = kzalloc_obj(*timerdrv, GFP_KERNEL); + timerdrv = kzalloc_obj(*timerdrv); if (!timerdrv) return -ENOMEM; diff --git a/drivers/clocksource/timer-gxp.c b/drivers/clocksource/timer-gxp.c index 7442e9bdd0d5..1becc943339d 100644 --- a/drivers/clocksource/timer-gxp.c +++ b/drivers/clocksource/timer-gxp.c @@ -76,7 +76,7 @@ static int __init gxp_timer_init(struct device_node *node) u32 freq; int ret, irq; - gxp_timer = kzalloc_obj(*gxp_timer, GFP_KERNEL); + gxp_timer = kzalloc_obj(*gxp_timer); if (!gxp_timer) { ret = -ENOMEM; pr_err("Can't allocate gxp_timer"); diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c index ad310be44cb6..8335bd7f8c6c 100644 --- a/drivers/clocksource/timer-imx-gpt.c +++ b/drivers/clocksource/timer-imx-gpt.c @@ -428,7 +428,7 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t if (initialized) return 0; - imxtm = kzalloc_obj(*imxtm, GFP_KERNEL); + imxtm = kzalloc_obj(*imxtm); if (!imxtm) return -ENOMEM; diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index 5eb3b3c6d0ad..dfbd77950e02 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -139,7 +139,7 @@ static int __init __sysctr_timer_init(struct device_node *np) void __iomem *base; int ret; - priv = kzalloc_obj(struct sysctr_private, GFP_KERNEL); + priv = kzalloc_obj(struct sysctr_private); if (!priv) return -ENOMEM; diff --git a/drivers/clocksource/timer-ixp4xx.c b/drivers/clocksource/timer-ixp4xx.c index 42f679b1165b..4238a004fdef 100644 --- a/drivers/clocksource/timer-ixp4xx.c +++ b/drivers/clocksource/timer-ixp4xx.c @@ -166,7 +166,7 @@ static __init int ixp4xx_timer_register(void __iomem *base, struct ixp4xx_timer *tmr; int ret; - tmr = kzalloc_obj(*tmr, GFP_KERNEL); + tmr = kzalloc_obj(*tmr); if (!tmr) return -ENOMEM; tmr->base = base; diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c index d54a1c91781f..7439bff42233 100644 --- a/drivers/clocksource/timer-microchip-pit64b.c +++ b/drivers/clocksource/timer-microchip-pit64b.c @@ -350,7 +350,7 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer, struct mchp_pit64b_clksrc *cs; int ret; - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; @@ -397,7 +397,7 @@ static int __init mchp_pit64b_init_clkevt(struct mchp_pit64b_timer *timer, struct mchp_pit64b_clkevt *ce; int ret; - ce = kzalloc_obj(*ce, GFP_KERNEL); + ce = kzalloc_obj(*ce); if (!ce) return -ENOMEM; diff --git a/drivers/clocksource/timer-msc313e.c b/drivers/clocksource/timer-msc313e.c index 33822f0bc339..e4b9e3f161bb 100644 --- a/drivers/clocksource/timer-msc313e.c +++ b/drivers/clocksource/timer-msc313e.c @@ -171,7 +171,7 @@ static int __init msc313e_clkevt_init(struct device_node *np) int ret; struct timer_of *to; - to = kzalloc_obj(*to, GFP_KERNEL); + to = kzalloc_obj(*to); if (!to) return -ENOMEM; diff --git a/drivers/clocksource/timer-nxp-pit.c b/drivers/clocksource/timer-nxp-pit.c index 9109dedab08c..bc5157e2ba57 100644 --- a/drivers/clocksource/timer-nxp-pit.c +++ b/drivers/clocksource/timer-nxp-pit.c @@ -276,7 +276,7 @@ static int pit_timer_init(struct device_node *np) unsigned long clk_rate; int irq, ret; - pit = kzalloc_obj(*pit, GFP_KERNEL); + pit = kzalloc_obj(*pit); if (!pit) return -ENOMEM; diff --git a/drivers/clocksource/timer-rockchip.c b/drivers/clocksource/timer-rockchip.c index c866127ee1e5..540a16667145 100644 --- a/drivers/clocksource/timer-rockchip.c +++ b/drivers/clocksource/timer-rockchip.c @@ -207,7 +207,7 @@ static int __init rk_clkevt_init(struct device_node *np) struct clock_event_device *ce; int ret = -EINVAL; - rk_clkevt = kzalloc_obj(struct rk_clkevt, GFP_KERNEL); + rk_clkevt = kzalloc_obj(struct rk_clkevt); if (!rk_clkevt) { ret = -ENOMEM; goto out; @@ -254,7 +254,7 @@ static int __init rk_clksrc_init(struct device_node *np) { int ret = -EINVAL; - rk_clksrc = kzalloc_obj(struct rk_timer, GFP_KERNEL); + rk_clksrc = kzalloc_obj(struct rk_timer); if (!rk_clksrc) { ret = -ENOMEM; goto out; diff --git a/drivers/clocksource/timer-stm32.c b/drivers/clocksource/timer-stm32.c index 4a0f06a419d7..fee65914f99a 100644 --- a/drivers/clocksource/timer-stm32.c +++ b/drivers/clocksource/timer-stm32.c @@ -291,7 +291,7 @@ static int __init stm32_timer_init(struct device_node *node) struct timer_of *to; int ret; - to = kzalloc_obj(*to, GFP_KERNEL); + to = kzalloc_obj(*to); if (!to) return -ENOMEM; @@ -302,7 +302,7 @@ static int __init stm32_timer_init(struct device_node *node) if (ret) goto err; - to->private_data = kzalloc_obj(struct stm32_timer_private, GFP_KERNEL); + to->private_data = kzalloc_obj(struct stm32_timer_private); if (!to->private_data) { ret = -ENOMEM; goto deinit; diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c index 3bffd7198a38..eb0dfe4b9b7c 100644 --- a/drivers/clocksource/timer-ti-dm-systimer.c +++ b/drivers/clocksource/timer-ti-dm-systimer.c @@ -600,7 +600,7 @@ static int __init dmtimer_clockevent_init(struct device_node *np) struct dmtimer_clockevent *clkevt; int error; - clkevt = kzalloc_obj(*clkevt, GFP_KERNEL); + clkevt = kzalloc_obj(*clkevt); if (!clkevt) return -ENOMEM; @@ -757,7 +757,7 @@ static int __init dmtimer_clocksource_init(struct device_node *np) struct clocksource *dev; int error; - clksrc = kzalloc_obj(*clksrc, GFP_KERNEL); + clksrc = kzalloc_obj(*clksrc); if (!clksrc) return -ENOMEM; diff --git a/drivers/clocksource/timer-zevio.c b/drivers/clocksource/timer-zevio.c index db1ba9b2c2c9..9a67b84b3e4c 100644 --- a/drivers/clocksource/timer-zevio.c +++ b/drivers/clocksource/timer-zevio.c @@ -119,7 +119,7 @@ static int __init zevio_timer_add(struct device_node *node) struct resource res; int irqnr, ret; - timer = kzalloc_obj(*timer, GFP_KERNEL); + timer = kzalloc_obj(*timer); if (!timer) return -ENOMEM; diff --git a/drivers/comedi/comedi_buf.c b/drivers/comedi/comedi_buf.c index 7215d4b9152b..ed372619bf54 100644 --- a/drivers/comedi/comedi_buf.c +++ b/drivers/comedi/comedi_buf.c @@ -70,7 +70,7 @@ comedi_buf_map_alloc(struct comedi_device *dev, enum dma_data_direction dma_dir, struct comedi_buf_page *buf; unsigned int i; - bm = kzalloc_obj(*bm, GFP_KERNEL); + bm = kzalloc_obj(*bm); if (!bm) return NULL; diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c index 627680057812..48a8a607a84c 100644 --- a/drivers/comedi/comedi_fops.c +++ b/drivers/comedi/comedi_fops.c @@ -1058,7 +1058,7 @@ static int do_subdinfo_ioctl(struct comedi_device *dev, struct comedi_subdevice *s; lockdep_assert_held(&dev->mutex); - tmp = kzalloc_objs(*tmp, dev->n_subdevices, GFP_KERNEL); + tmp = kzalloc_objs(*tmp, dev->n_subdevices); if (!tmp) return -ENOMEM; @@ -2969,7 +2969,7 @@ static int comedi_open(struct inode *inode, struct file *file) return -ENODEV; } - cfp = kzalloc_obj(*cfp, GFP_KERNEL); + cfp = kzalloc_obj(*cfp); if (!cfp) { comedi_dev_put(dev); return -ENOMEM; @@ -3322,7 +3322,7 @@ static int compat_insnlist(struct file *file, unsigned long arg) rc = check_insnlist_len(dev, insnlist32.n_insns); if (rc) return rc; - insns = kzalloc_objs(*insns, insnlist32.n_insns, GFP_KERNEL); + insns = kzalloc_objs(*insns, insnlist32.n_insns); if (!insns) return -ENOMEM; @@ -3505,7 +3505,7 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device) struct device *csdev; unsigned int i; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); comedi_device_init(dev); diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c index b0e39a04f0b3..db225a3bf012 100644 --- a/drivers/comedi/drivers.c +++ b/drivers/comedi/drivers.c @@ -101,7 +101,7 @@ int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices) if (num_subdevices < 1) return -EINVAL; - s = kzalloc_objs(*s, num_subdevices, GFP_KERNEL); + s = kzalloc_objs(*s, num_subdevices); if (!s) return -ENOMEM; dev->subdevices = s; @@ -733,7 +733,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev, dev_warn(dev->class_dev, "async subdevices should have a cancel() function\n"); - async = kzalloc_obj(*async, GFP_KERNEL); + async = kzalloc_obj(*async); if (!async) return -ENOMEM; diff --git a/drivers/comedi/drivers/addi_apci_2032.c b/drivers/comedi/drivers/addi_apci_2032.c index b81837cd4ad5..d0f52d5ece8f 100644 --- a/drivers/comedi/drivers/addi_apci_2032.c +++ b/drivers/comedi/drivers/addi_apci_2032.c @@ -274,7 +274,7 @@ static int apci2032_auto_attach(struct comedi_device *dev, struct apci2032_int_private *subpriv; dev->read_subdev = s; - subpriv = kzalloc_obj(*subpriv, GFP_KERNEL); + subpriv = kzalloc_obj(*subpriv); if (!subpriv) return -ENOMEM; spin_lock_init(&subpriv->spinlock); diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c index a748b452d76d..a297dd650dab 100644 --- a/drivers/comedi/drivers/comedi_8254.c +++ b/drivers/comedi/drivers/comedi_8254.c @@ -633,7 +633,7 @@ static struct comedi_8254 *__i8254_init(comedi_8254_iocb_fn *iocb, if (!iocb) return ERR_PTR(-EINVAL); - i8254 = kzalloc_obj(*i8254, GFP_KERNEL); + i8254 = kzalloc_obj(*i8254); if (!i8254) return ERR_PTR(-ENOMEM); diff --git a/drivers/comedi/drivers/comedi_bond.c b/drivers/comedi/drivers/comedi_bond.c index 1b530c819fc0..8e10ecab4f0d 100644 --- a/drivers/comedi/drivers/comedi_bond.c +++ b/drivers/comedi/drivers/comedi_bond.c @@ -223,7 +223,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) nchans, minor, sdev); return -EINVAL; } - bdev = kmalloc_obj(*bdev, GFP_KERNEL); + bdev = kmalloc_obj(*bdev); if (!bdev) return -ENOMEM; diff --git a/drivers/comedi/drivers/comedi_isadma.c b/drivers/comedi/drivers/comedi_isadma.c index 259678bfd1f3..04ce3eb9ae4f 100644 --- a/drivers/comedi/drivers/comedi_isadma.c +++ b/drivers/comedi/drivers/comedi_isadma.c @@ -161,11 +161,11 @@ struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *dev, if (n_desc < 1 || n_desc > 2) goto no_dma; - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) goto no_dma; - desc = kzalloc_objs(*desc, n_desc, GFP_KERNEL); + desc = kzalloc_objs(*desc, n_desc); if (!desc) goto no_dma; dma->desc = desc; diff --git a/drivers/comedi/drivers/dt9812.c b/drivers/comedi/drivers/dt9812.c index cace17d6e70e..2541f75aff60 100644 --- a/drivers/comedi/drivers/dt9812.c +++ b/drivers/comedi/drivers/dt9812.c @@ -329,7 +329,7 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev, int i, count; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -358,7 +358,7 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev, int i, count; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/comedi/drivers/mite.c b/drivers/comedi/drivers/mite.c index 3a16f4b6a292..e93150d6dc57 100644 --- a/drivers/comedi/drivers/mite.c +++ b/drivers/comedi/drivers/mite.c @@ -749,7 +749,7 @@ struct mite_ring *mite_alloc_ring(struct mite *mite) { struct mite_ring *ring; - ring = kmalloc_obj(*ring, GFP_KERNEL); + ring = kmalloc_obj(*ring); if (!ring) return NULL; ring->hw_dev = get_device(&mite->pcidev->dev); @@ -879,7 +879,7 @@ struct mite *mite_attach(struct comedi_device *dev, bool use_win1) unsigned int i; int ret; - mite = kzalloc_obj(*mite, GFP_KERNEL); + mite = kzalloc_obj(*mite); if (!mite) return NULL; diff --git a/drivers/comedi/drivers/ni_tio.c b/drivers/comedi/drivers/ni_tio.c index 56b5995e2c58..d6e7e2006981 100644 --- a/drivers/comedi/drivers/ni_tio.c +++ b/drivers/comedi/drivers/ni_tio.c @@ -1778,7 +1778,7 @@ ni_gpct_device_construct(struct comedi_device *dev, if (num_counters == 0 || counters_per_chip == 0) return NULL; - counter_dev = kzalloc_obj(*counter_dev, GFP_KERNEL); + counter_dev = kzalloc_obj(*counter_dev); if (!counter_dev) return NULL; @@ -1793,7 +1793,7 @@ ni_gpct_device_construct(struct comedi_device *dev, counter_dev->num_counters = num_counters; counter_dev->num_chips = DIV_ROUND_UP(num_counters, counters_per_chip); - counter_dev->counters = kzalloc_objs(*counter, num_counters, GFP_KERNEL); + counter_dev->counters = kzalloc_objs(*counter, num_counters); counter_dev->regs = kzalloc_objs(*counter_dev->regs, counter_dev->num_chips, GFP_KERNEL); if (!counter_dev->regs || !counter_dev->counters) { diff --git a/drivers/comedi/drivers/usbduxsigma.c b/drivers/comedi/drivers/usbduxsigma.c index bcf9116c4bd7..361b76d106ae 100644 --- a/drivers/comedi/drivers/usbduxsigma.c +++ b/drivers/comedi/drivers/usbduxsigma.c @@ -1336,8 +1336,8 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev) devpriv->dux_commands = kzalloc(SIZEOFDUXBUFFER, GFP_KERNEL); devpriv->in_buf = kzalloc(SIZEINBUF, GFP_KERNEL); devpriv->insn_buf = kzalloc(SIZEINSNBUF, GFP_KERNEL); - devpriv->ai_urbs = kzalloc_objs(urb, devpriv->n_ai_urbs, GFP_KERNEL); - devpriv->ao_urbs = kzalloc_objs(urb, devpriv->n_ao_urbs, GFP_KERNEL); + devpriv->ai_urbs = kzalloc_objs(urb, devpriv->n_ai_urbs); + devpriv->ao_urbs = kzalloc_objs(urb, devpriv->n_ao_urbs); if (!devpriv->dux_commands || !devpriv->in_buf || !devpriv->insn_buf || !devpriv->ai_urbs || !devpriv->ao_urbs) return -ENOMEM; diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 3ef917ebc49b..2573b3000633 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c @@ -25,7 +25,7 @@ cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name, { struct cn_callback_entry *cbq; - cbq = kzalloc_obj(*cbq, GFP_KERNEL); + cbq = kzalloc_obj(*cbq); if (!cbq) { pr_err("Failed to create new callback queue.\n"); return NULL; @@ -113,7 +113,7 @@ struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *nls) { struct cn_queue_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; diff --git a/drivers/counter/counter-chrdev.c b/drivers/counter/counter-chrdev.c index 0a4af153e049..61451ba74ca1 100644 --- a/drivers/counter/counter-chrdev.c +++ b/drivers/counter/counter-chrdev.c @@ -152,7 +152,7 @@ static int counter_set_event_node(struct counter_device *const counter, /* If event is not already in the list */ if (&event_node->l == &counter->next_events_list) { /* Allocate new event node */ - event_node = kmalloc_obj(*event_node, GFP_KERNEL); + event_node = kmalloc_obj(*event_node); if (!event_node) return -ENOMEM; @@ -172,7 +172,7 @@ static int counter_set_event_node(struct counter_device *const counter, } /* Allocate component node */ - comp_node = kmalloc_obj(*comp_node, GFP_KERNEL); + comp_node = kmalloc_obj(*comp_node); if (!comp_node) { err = -ENOMEM; goto exit_free_event_node; diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 8576c8290ea5..3b95a3609cde 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -700,7 +700,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) return blacklisted; #endif - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index dec47f7ce192..5aa9fcd80cf5 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -993,7 +993,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) if (!dev) return -ENODEV; - cpudata = kzalloc_obj(*cpudata, GFP_KERNEL); + cpudata = kzalloc_obj(*cpudata); if (!cpudata) return -ENOMEM; @@ -1478,7 +1478,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) if (!dev) return -ENODEV; - cpudata = kzalloc_obj(*cpudata, GFP_KERNEL); + cpudata = kzalloc_obj(*cpudata); if (!cpudata) return -ENOMEM; diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index bf6061e2089a..9396034167e5 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -276,7 +276,7 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto out_free_opp; diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index c7d4a15f10bc..9d55398f3797 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -143,7 +143,7 @@ static int __init armada_8k_cpufreq_init(void) of_node_put(node); nb_cpus = num_possible_cpus(); - freq_tables = kzalloc_objs(*freq_tables, nb_cpus, GFP_KERNEL); + freq_tables = kzalloc_objs(*freq_tables, nb_cpus); if (!freq_tables) return -ENOMEM; cpumask_copy(&cpus, cpu_possible_mask); diff --git a/drivers/cpufreq/bmips-cpufreq.c b/drivers/cpufreq/bmips-cpufreq.c index f8c91796b498..a8e35bc75fb2 100644 --- a/drivers/cpufreq/bmips-cpufreq.c +++ b/drivers/cpufreq/bmips-cpufreq.c @@ -71,7 +71,7 @@ bmips_cpufreq_get_freq_table(const struct cpufreq_policy *policy) cpu_freq = htp_freq_to_cpu_freq(priv->clk_mult); - table = kmalloc_objs(*table, priv->max_freqs + 1, GFP_KERNEL); + table = kmalloc_objs(*table, priv->max_freqs + 1); if (!table) return ERR_PTR(-ENOMEM); diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 7abfd2753946..011f35cb47b9 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -575,7 +575,7 @@ static struct cppc_cpudata *cppc_cpufreq_get_cpu_data(unsigned int cpu) struct cppc_cpudata *cpu_data; int ret; - cpu_data = kzalloc_obj(struct cppc_cpudata, GFP_KERNEL); + cpu_data = kzalloc_obj(struct cppc_cpudata); if (!cpu_data) goto out; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 98035c9fbc17..277884d91913 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1263,7 +1263,7 @@ static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu) if (!dev) return NULL; - policy = kzalloc_obj(*policy, GFP_KERNEL); + policy = kzalloc_obj(*policy); if (!policy) return NULL; diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index f0c16e615a46..e0e847764511 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -273,7 +273,7 @@ static struct policy_dbs_info *cs_alloc(void) { struct cs_policy_dbs_info *dbs_info; - dbs_info = kzalloc_obj(*dbs_info, GFP_KERNEL); + dbs_info = kzalloc_obj(*dbs_info); return dbs_info ? &dbs_info->policy_dbs : NULL; } @@ -286,7 +286,7 @@ static int cs_init(struct dbs_data *dbs_data) { struct cs_dbs_tuners *tuners; - tuners = kzalloc_obj(*tuners, GFP_KERNEL); + tuners = kzalloc_obj(*tuners); if (!tuners) return -ENOMEM; diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 1dbb3b10ee83..36eb7aee4bcd 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -429,7 +429,7 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy) goto out; } - dbs_data = kzalloc_obj(*dbs_data, GFP_KERNEL); + dbs_data = kzalloc_obj(*dbs_data); if (!dbs_data) { ret = -ENOMEM; goto free_policy_dbs_info; diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index ecb5021f46bd..9942dbb38dae 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -322,7 +322,7 @@ static struct policy_dbs_info *od_alloc(void) { struct od_policy_dbs_info *dbs_info; - dbs_info = kzalloc_obj(*dbs_info, GFP_KERNEL); + dbs_info = kzalloc_obj(*dbs_info); return dbs_info ? &dbs_info->policy_dbs : NULL; } @@ -335,7 +335,7 @@ static int od_init(struct dbs_data *dbs_data) { struct od_dbs_tuners *tuners; - tuners = kzalloc_obj(*tuners, GFP_KERNEL); + tuners = kzalloc_obj(*tuners); if (!tuners) return -ENOMEM; diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 407b8fcf0723..670a10c3ecfa 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -222,7 +222,7 @@ void cpufreq_stats_create_table(struct cpufreq_policy *policy) if (policy->stats) return; - stats = kzalloc_obj(*stats, GFP_KERNEL); + stats = kzalloc_obj(*stats); if (!stats) return; diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index c8e941b4ec03..d738d31995f9 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c @@ -58,7 +58,7 @@ static int cpufreq_userspace_policy_init(struct cpufreq_policy *policy) { struct userspace_policy *userspace; - userspace = kzalloc_obj(*userspace, GFP_KERNEL); + userspace = kzalloc_obj(*userspace); if (!userspace) return -ENOMEM; diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index e079f1fed352..05209d9e9d27 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -55,7 +55,7 @@ static struct acpi_processor_performance *eps_acpi_cpu_perf; /* Minimum necessary to get acpi_processor_get_bios_limit() working */ static int eps_acpi_init(void) { - eps_acpi_cpu_perf = kzalloc_obj(*eps_acpi_cpu_perf, GFP_KERNEL); + eps_acpi_cpu_perf = kzalloc_obj(*eps_acpi_cpu_perf); if (!eps_acpi_cpu_perf) return -ENOMEM; diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c index ceadf0654838..d269a4f26f98 100644 --- a/drivers/cpufreq/gx-suspmod.c +++ b/drivers/cpufreq/gx-suspmod.c @@ -458,7 +458,7 @@ static int __init cpufreq_gx_init(void) pr_debug("geode suspend modulation available.\n"); - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (params == NULL) return -ENOMEM; diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 00232f178630..a48af3540c74 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2745,7 +2745,7 @@ static int intel_pstate_init_cpu(unsigned int cpunum) cpu = all_cpu_data[cpunum]; if (!cpu) { - cpu = kzalloc_obj(*cpu, GFP_KERNEL); + cpu = kzalloc_obj(*cpu); if (!cpu) return -ENOMEM; @@ -3301,7 +3301,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy) /* This reflects the intel_pstate_get_cpu_pstates() setting. */ policy->cur = policy->cpuinfo.min_freq; - req = kzalloc_objs(*req, 2, GFP_KERNEL); + req = kzalloc_objs(*req, 2); if (!req) { ret = -ENOMEM; goto pstate_exit; diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 77847b52d613..6b7caf4ae20d 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -304,7 +304,7 @@ static int powernow_acpi_init(void) goto err0; } - acpi_processor_perf = kzalloc_obj(*acpi_processor_perf, GFP_KERNEL); + acpi_processor_perf = kzalloc_obj(*acpi_processor_perf); if (!acpi_processor_perf) { retval = -ENOMEM; goto err0; diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index b7c9676c96ef..4d77eef53fe0 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1029,7 +1029,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) if (rc) return -ENODEV; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 7ab29fd8e4e5..4a6f4d9043e9 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -323,7 +323,7 @@ next: powernv_freqs[i].frequency = freq * 1000; /* kHz */ powernv_freqs[i].driver_data = id & 0xFF; - revmap_data = kmalloc_obj(*revmap_data, GFP_KERNEL); + revmap_data = kmalloc_obj(*revmap_data); if (!revmap_data) { rc = -ENOMEM; goto out; @@ -857,7 +857,7 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) return 0; /* Initialise Gpstate ramp-down timer only on POWER8 */ - gpstates = kzalloc_obj(*gpstates, GFP_KERNEL); + gpstates = kzalloc_obj(*gpstates); if (!gpstates) return -ENOMEM; @@ -1053,7 +1053,7 @@ static int init_chip_info(void) return -ENOMEM; /* Allocate a chip cpu mask large enough to fit mask for all chips */ - chip_cpu_mask = kzalloc_objs(cpumask_t, MAX_NR_CHIPS, GFP_KERNEL); + chip_cpu_mask = kzalloc_objs(cpumask_t, MAX_NR_CHIPS); if (!chip_cpu_mask) { ret = -ENOMEM; goto free_and_return; @@ -1069,7 +1069,7 @@ static int init_chip_info(void) cpumask_set_cpu(cpu, &chip_cpu_mask[nr_chips-1]); } - chips = kzalloc_objs(struct chip, nr_chips, GFP_KERNEL); + chips = kzalloc_objs(struct chip, nr_chips); if (!chips) { ret = -ENOMEM; goto out_free_chip_cpu_mask; diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index 839a55bee151..50ff3b6a6900 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -110,7 +110,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table; int i; - table = kzalloc_objs(*table, num + 1, GFP_KERNEL); + table = kzalloc_objs(*table, num + 1); if (table == NULL) return -ENOMEM; diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 3dbf432efaeb..ea9a20d27b8f 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -211,7 +211,7 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev, struct qcom_cpufreq_data *drv_data = policy->driver_data; const struct qcom_cpufreq_soc_data *soc_data = qcom_cpufreq.soc_data; - table = kzalloc_objs(*table, LUT_MAX_ENTRIES + 1, GFP_KERNEL); + table = kzalloc_objs(*table, LUT_MAX_ENTRIES + 1); if (!table) return -ENOMEM; diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index df560851ffa8..42edb41ad459 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -168,7 +168,7 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) if (!np) return -ENODEV; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto err_np; @@ -181,11 +181,11 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) hwclk = __clk_get_hw(policy->clk); count = clk_hw_get_num_parents(hwclk); - data->pclk = kzalloc_objs(struct clk *, count, GFP_KERNEL); + data->pclk = kzalloc_objs(struct clk *, count); if (!data->pclk) goto err_nomem2; - table = kzalloc_objs(*table, count + 1, GFP_KERNEL); + table = kzalloc_objs(*table, count + 1); if (!table) goto err_pclk; diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 9c0a903f4fb0..4edb4f7a8aa9 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -214,7 +214,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) if (domain < 0) return domain; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 1799e40596b7..09e29b2a6d8e 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -128,7 +128,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto out_free_opp; diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 9a52d8030449..81a0780b2ebf 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -191,7 +191,7 @@ static int spear_cpufreq_probe(struct platform_device *pdev) goto out_put_node; } - freq_tbl = kzalloc_objs(*freq_tbl, cnt + 1, GFP_KERNEL); + freq_tbl = kzalloc_objs(*freq_tbl, cnt + 1); if (!freq_tbl) { ret = -ENOMEM; goto out_put_node; diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index f4e5a09103d2..9261d148a165 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -244,7 +244,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) int speed; int ret; - opp_tokens = kzalloc_objs(*opp_tokens, num_possible_cpus(), GFP_KERNEL); + opp_tokens = kzalloc_objs(*opp_tokens, num_possible_cpus()); if (!opp_tokens) return -ENOMEM; diff --git a/drivers/cpufreq/tegra186-cpufreq.c b/drivers/cpufreq/tegra186-cpufreq.c index 5c2f134f8033..4fa6894f6371 100644 --- a/drivers/cpufreq/tegra186-cpufreq.c +++ b/drivers/cpufreq/tegra186-cpufreq.c @@ -135,7 +135,7 @@ static int tegra_cpufreq_init_cpufreq_table(struct cpufreq_policy *policy, dev_pm_opp_disable(cpu_dev, rate); } - freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1)); if (!freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c index 22f51dc2fa67..7a41cfc71a46 100644 --- a/drivers/cpufreq/tegra194-cpufreq.c +++ b/drivers/cpufreq/tegra194-cpufreq.c @@ -463,7 +463,7 @@ static int tegra_cpufreq_init_cpufreq_table(struct cpufreq_policy *policy, return ret; } - freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1)); if (!freq_table) return -ENOMEM; diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index 894f801b1b41..8e4e29138464 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -252,7 +252,7 @@ static int merge_cluster_tables(void) for (i = 0; i < MAX_CLUSTERS; i++) count += get_table_count(freq_table[i]); - table = kzalloc_objs(*table, count, GFP_KERNEL); + table = kzalloc_objs(*table, count); if (!table) return -ENOMEM; diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cpufreq.c index 92da4d5606e1..4159f31349b1 100644 --- a/drivers/cpufreq/virtual-cpufreq.c +++ b/drivers/cpufreq/virtual-cpufreq.c @@ -171,7 +171,7 @@ static int virt_cpufreq_get_freq_info(struct cpufreq_policy *policy) return 0; } - table = kzalloc_objs(*table, num_perftbl_entries + 1, GFP_KERNEL); + table = kzalloc_objs(*table, num_perftbl_entries + 1); if (!table) return -ENOMEM; diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c index e22df988bb07..fb91a9e0e3c2 100644 --- a/drivers/cpuidle/coupled.c +++ b/drivers/cpuidle/coupled.c @@ -651,7 +651,7 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev) } /* No existing coupled info found, create a new one */ - coupled = kzalloc_obj(struct cpuidle_coupled, GFP_KERNEL); + coupled = kzalloc_obj(struct cpuidle_coupled); if (!coupled) return -ENOMEM; diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index a53ad31f9b3d..b9e4ad7d43a3 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -55,7 +55,7 @@ static int psci_pd_init(struct device_node *np, bool use_osi) if (!pd) goto out; - pd_provider = kzalloc_obj(*pd_provider, GFP_KERNEL); + pd_provider = kzalloc_obj(*pd_provider); if (!pd_provider) goto free_pd; diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c index 875c4697b953..a13e90bb43bd 100644 --- a/drivers/cpuidle/cpuidle-riscv-sbi.c +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c @@ -380,7 +380,7 @@ static int sbi_pd_init(struct device_node *np) if (!pd) goto out; - pd_provider = kzalloc_obj(*pd_provider, GFP_KERNEL); + pd_provider = kzalloc_obj(*pd_provider); if (!pd_provider) goto free_pd; diff --git a/drivers/cpuidle/dt_idle_genpd.c b/drivers/cpuidle/dt_idle_genpd.c index 6b1f6d4686a7..d292975cc468 100644 --- a/drivers/cpuidle/dt_idle_genpd.c +++ b/drivers/cpuidle/dt_idle_genpd.c @@ -95,7 +95,7 @@ struct generic_pm_domain *dt_idle_pd_alloc(struct device_node *np, struct genpd_power_state *states = NULL; int ret, state_count = 0; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) goto out; diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index abee6f73a6e1..b81d22479234 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -482,7 +482,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device) /* state statistics */ for (i = 0; i < drv->state_count; i++) { - kobj = kzalloc_obj(struct cpuidle_state_kobj, GFP_KERNEL); + kobj = kzalloc_obj(struct cpuidle_state_kobj); if (!kobj) { ret = -ENOMEM; goto error_state; @@ -618,7 +618,7 @@ static int cpuidle_add_driver_sysfs(struct cpuidle_device *dev) struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); int ret; - kdrv = kzalloc_obj(*kdrv, GFP_KERNEL); + kdrv = kzalloc_obj(*kdrv); if (!kdrv) return -ENOMEM; @@ -712,7 +712,7 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev) if (!cpu_dev) return -ENODEV; - kdev = kzalloc_obj(*kdev, GFP_KERNEL); + kdev = kzalloc_obj(*kdev); if (!kdev) return -ENOMEM; kdev->dev = dev; diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 772509993079..c61f4473c0fa 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -974,7 +974,7 @@ static int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, int rc = 0; for (i = 0; i < array_size; i++) { - alg = kzalloc_obj(struct crypto4xx_alg, GFP_KERNEL); + alg = kzalloc_obj(struct crypto4xx_alg); if (!alg) return -ENOMEM; diff --git a/drivers/crypto/amcc/crypto4xx_trng.c b/drivers/crypto/amcc/crypto4xx_trng.c index 6738cdbaded9..cfd66b779ce1 100644 --- a/drivers/crypto/amcc/crypto4xx_trng.c +++ b/drivers/crypto/amcc/crypto4xx_trng.c @@ -87,7 +87,7 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev) if (!dev->trng_base) goto err_out; - rng = kzalloc_obj(*rng, GFP_KERNEL); + rng = kzalloc_obj(*rng); if (!rng) goto err_out; diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index d19694400693..b6a77c8d439c 100644 --- a/drivers/crypto/atmel-ecc.c +++ b/drivers/crypto/atmel-ecc.c @@ -99,7 +99,7 @@ static int atmel_ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, return crypto_kpp_set_secret(ctx->fallback, buf, len); } - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.c index 27dd37997872..da3cd986b1eb 100644 --- a/drivers/crypto/atmel-i2c.c +++ b/drivers/crypto/atmel-i2c.c @@ -321,7 +321,7 @@ static int device_sanity_check(struct i2c_client *client) struct atmel_i2c_cmd *cmd; int ret; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index a925c7afbbdb..1f1341a16c42 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2207,7 +2207,7 @@ struct atmel_sha_authenc_ctx *atmel_sha_authenc_spawn(unsigned long mode) tctx->start = atmel_sha_authenc_start; tctx->flags = mode; - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) { err = -ENOMEM; goto err_free_ahash; diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c index 810917475c4f..167372936ca7 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -3224,14 +3224,14 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, int ret = -ENOMEM; struct dpaa2_fl_entry *in_fle, *out_fle; - req_ctx = kzalloc_obj(*req_ctx, GFP_KERNEL); + req_ctx = kzalloc_obj(*req_ctx); if (!req_ctx) return -ENOMEM; in_fle = &req_ctx->fd_flt[1]; out_fle = &req_ctx->fd_flt[0]; - flc = kzalloc_obj(*flc, GFP_KERNEL); + flc = kzalloc_obj(*flc); if (!flc) goto err_flc; @@ -4635,7 +4635,7 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev, struct ahash_alg *halg; struct crypto_alg *alg; - t_alg = kzalloc_obj(*t_alg, GFP_KERNEL); + t_alg = kzalloc_obj(*t_alg); if (!t_alg) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index cee9034aa87b..628c43a7efc4 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1904,7 +1904,7 @@ caam_hash_alloc(struct caam_hash_template *template, struct ahash_alg *halg; struct crypto_alg *alg; - t_alg = kzalloc_obj(*t_alg, GFP_KERNEL); + t_alg = kzalloc_obj(*t_alg); if (!t_alg) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index a4e1984053da..c4bfe8e4aa2c 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -619,7 +619,7 @@ static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu) struct qman_fq *fq; int ret; - fq = kzalloc_obj(*fq, GFP_KERNEL); + fq = kzalloc_obj(*fq); if (!fq) return -ENOMEM; diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c index 41084767c577..2c9a2af38876 100644 --- a/drivers/crypto/cavium/cpt/cptvf_main.c +++ b/drivers/crypto/cavium/cpt/cptvf_main.c @@ -35,7 +35,7 @@ static int init_worker_threads(struct cpt_vf *cptvf) struct cptvf_wqe_info *cwqe_info; int i; - cwqe_info = kzalloc_obj(*cwqe_info, GFP_KERNEL); + cwqe_info = kzalloc_obj(*cwqe_info); if (!cwqe_info) return -ENOMEM; @@ -111,7 +111,7 @@ static int alloc_pending_queues(struct pending_qinfo *pqinfo, u32 qlen, pqinfo->qlen = qlen; for_each_pending_queue(pqinfo, queue, i) { - queue->head = kzalloc_objs(*queue->head, qlen, GFP_KERNEL); + queue->head = kzalloc_objs(*queue->head, qlen); if (!queue->head) { ret = -ENOMEM; goto pending_qfail; @@ -225,7 +225,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf, queue = &cqinfo->queue[i]; INIT_HLIST_HEAD(&cqinfo->queue[i].chead); do { - curr = kzalloc_obj(*curr, GFP_KERNEL); + curr = kzalloc_obj(*curr); if (!curr) goto cmd_qfail; diff --git a/drivers/crypto/cavium/nitrox/nitrox_isr.c b/drivers/crypto/cavium/nitrox/nitrox_isr.c index 5ffb1aa90cba..cf09f7451f6f 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_isr.c +++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c @@ -320,7 +320,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev) } ndev->num_vecs = nr_vecs; - ndev->qvec = kzalloc_objs(*qvec, nr_vecs, GFP_KERNEL); + ndev->qvec = kzalloc_objs(*qvec, nr_vecs); if (!ndev->qvec) { pci_free_irq_vectors(pdev); return -ENOMEM; @@ -424,7 +424,7 @@ int nitrox_sriov_register_interupts(struct nitrox_device *ndev) return ret; } - qvec = kzalloc_objs(*qvec, NR_NON_RING_VECTORS, GFP_KERNEL); + qvec = kzalloc_objs(*qvec, NR_NON_RING_VECTORS); if (!qvec) { pci_disable_msix(pdev); return -ENOMEM; diff --git a/drivers/crypto/cavium/nitrox/nitrox_lib.c b/drivers/crypto/cavium/nitrox/nitrox_lib.c index 31eb8c874257..d35303857476 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_lib.c +++ b/drivers/crypto/cavium/nitrox/nitrox_lib.c @@ -219,7 +219,7 @@ void *crypto_alloc_context(struct nitrox_device *ndev) void *vaddr; dma_addr_t dma; - chdr = kmalloc_obj(*chdr, GFP_KERNEL); + chdr = kmalloc_obj(*chdr); if (!chdr) return NULL; diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c index d0e1e34a7b8b..8664d97261fe 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_main.c +++ b/drivers/crypto/cavium/nitrox/nitrox_main.c @@ -441,7 +441,7 @@ static int nitrox_probe(struct pci_dev *pdev, goto flr_fail; pci_set_master(pdev); - ndev = kzalloc_obj(*ndev, GFP_KERNEL); + ndev = kzalloc_obj(*ndev); if (!ndev) { err = -ENOMEM; goto ndev_fail; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index 240bcfa26c62..ead7566d78da 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c @@ -354,7 +354,7 @@ int ccp_register_aes_cmac_algs(struct list_head *head) struct crypto_alg *base; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-galois.c b/drivers/crypto/ccp/ccp-crypto-aes-galois.c index db5c498f379b..6c8d1b87d60d 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-galois.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-galois.c @@ -212,7 +212,7 @@ static int ccp_register_aes_aead(struct list_head *head, struct aead_alg *alg; int ret; - ccp_aead = kzalloc_obj(*ccp_aead, GFP_KERNEL); + ccp_aead = kzalloc_obj(*ccp_aead); if (!ccp_aead) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index 5cd8c2d270c3..c7e26ce71156 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c @@ -231,7 +231,7 @@ static int ccp_register_aes_xts_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-aes.c b/drivers/crypto/ccp/ccp-crypto-aes.c index 97ce93434953..01d298350b92 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes.c +++ b/drivers/crypto/ccp/ccp-crypto-aes.c @@ -294,7 +294,7 @@ static int ccp_register_aes_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-des3.c b/drivers/crypto/ccp/ccp-crypto-des3.c index 8c0f903c3330..c20b5a6a340a 100644 --- a/drivers/crypto/ccp/ccp-crypto-des3.c +++ b/drivers/crypto/ccp/ccp-crypto-des3.c @@ -182,7 +182,7 @@ static int ccp_register_des3_alg(struct list_head *head, struct skcipher_alg *alg; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-rsa.c b/drivers/crypto/ccp/ccp-crypto-rsa.c index 80d9ddc1f644..090adacaaf93 100644 --- a/drivers/crypto/ccp/ccp-crypto-rsa.c +++ b/drivers/crypto/ccp/ccp-crypto-rsa.c @@ -249,7 +249,7 @@ static int ccp_register_rsa_alg(struct list_head *head, struct akcipher_alg *alg; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index 91d0d8ea182b..286b2d716236 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c @@ -418,7 +418,7 @@ static int ccp_register_hmac_alg(struct list_head *head, struct crypto_alg *base; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; @@ -462,7 +462,7 @@ static int ccp_register_sha_alg(struct list_head *head, struct crypto_alg *base; int ret; - ccp_alg = kzalloc_obj(*ccp_alg, GFP_KERNEL); + ccp_alg = kzalloc_obj(*ccp_alg); if (!ccp_alg) return -ENOMEM; diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index 0170edef5b43..f35803c37ab4 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -642,7 +642,7 @@ ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd) struct ccp_data dst; struct ccp_data aad; struct ccp_op op; - } *wa __free(kfree) = kzalloc_obj(*wa, GFP_KERNEL); + } *wa __free(kfree) = kzalloc_obj(*wa); unsigned int dm_offset; unsigned int authsize; unsigned int jobid; diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 404829c41a13..df09e0322304 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -87,7 +87,7 @@ static int psp_populate_hsti(struct psp_device *psp) return 0; /* Allocate command-response buffer */ - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/crypto/ccp/sev-dev-tio.c b/drivers/crypto/ccp/sev-dev-tio.c index d51bb67460b0..c84e23982b43 100644 --- a/drivers/crypto/ccp/sev-dev-tio.c +++ b/drivers/crypto/ccp/sev-dev-tio.c @@ -330,7 +330,7 @@ static struct sla_buffer_hdr *sla_buffer_map(struct sla_addr_t sla) if (WARN_ON_ONCE(!npages)) return NULL; - struct page **pp = kmalloc_objs(pp[0], npages, GFP_KERNEL); + struct page **pp = kmalloc_objs(pp[0], npages); if (!pp) return NULL; diff --git a/drivers/crypto/ccp/sev-dev-tsm.c b/drivers/crypto/ccp/sev-dev-tsm.c index a3e7a9bca95b..adc9542ae806 100644 --- a/drivers/crypto/ccp/sev-dev-tsm.c +++ b/drivers/crypto/ccp/sev-dev-tsm.c @@ -207,7 +207,7 @@ static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide, static struct pci_tsm *tio_pf0_probe(struct pci_dev *pdev, struct sev_device *sev) { - struct tio_dsm *dsm __free(kfree) = kzalloc_obj(*dsm, GFP_KERNEL); + struct tio_dsm *dsm __free(kfree) = kzalloc_obj(*dsm); int rc; if (!dsm) @@ -341,7 +341,7 @@ static struct pci_tsm_ops sev_tsm_ops = { void sev_tsm_init_locked(struct sev_device *sev, void *tio_status_page) { - struct sev_tio_status *t = kzalloc_obj(*t, GFP_KERNEL); + struct sev_tio_status *t = kzalloc_obj(*t); struct tsm_dev *tsmdev; int ret; diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 4dc642ecde76..096f993974d1 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1144,7 +1144,7 @@ struct page *snp_alloc_hv_fixed_pages(unsigned int num_2mb_pages) if (!page) return NULL; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { __free_pages(page, order); return NULL; @@ -2658,7 +2658,7 @@ static int sev_misc_init(struct sev_device *sev) if (!misc_dev) { struct miscdevice *misc; - misc_dev = kzalloc_obj(*misc_dev, GFP_KERNEL); + misc_dev = kzalloc_obj(*misc_dev); if (!misc_dev) return -ENOMEM; diff --git a/drivers/crypto/ccp/sfs.c b/drivers/crypto/ccp/sfs.c index c98900672ea8..a4777839790b 100644 --- a/drivers/crypto/ccp/sfs.c +++ b/drivers/crypto/ccp/sfs.c @@ -223,7 +223,7 @@ static int sfs_misc_init(struct sfs_device *sfs) if (!misc_dev) { struct miscdevice *misc; - misc_dev = kzalloc_obj(*misc_dev, GFP_KERNEL); + misc_dev = kzalloc_obj(*misc_dev); if (!misc_dev) return -ENOMEM; diff --git a/drivers/crypto/ccp/tee-dev.c b/drivers/crypto/ccp/tee-dev.c index 50716472586a..3e3645980e89 100644 --- a/drivers/crypto/ccp/tee-dev.c +++ b/drivers/crypto/ccp/tee-dev.c @@ -67,7 +67,7 @@ struct tee_init_ring_cmd *tee_alloc_cmd_buffer(struct psp_tee_device *tee) { struct tee_init_ring_cmd *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return NULL; diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c index 31fc0d37db21..aa0220212406 100644 --- a/drivers/crypto/ccree/cc_request_mgr.c +++ b/drivers/crypto/ccree/cc_request_mgr.c @@ -116,7 +116,7 @@ int cc_req_mgr_init(struct cc_drvdata *drvdata) struct device *dev = drvdata_to_dev(drvdata); int rc = 0; - req_mgr_h = kzalloc_obj(*req_mgr_h, GFP_KERNEL); + req_mgr_h = kzalloc_obj(*req_mgr_h); if (!req_mgr_h) { rc = -ENOMEM; goto req_mgr_init_err; diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index a1a0034780c5..2609a8c3c18b 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -189,7 +189,7 @@ static void *chcr_uld_add(const struct cxgb4_lld_info *lld) return ERR_PTR(-EOPNOTSUPP); /* Create the device and add it in the device list */ - u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 19f0bf3f3f92..a897541f897b 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -2248,7 +2248,7 @@ static int hifn_alg_alloc(struct hifn_device *dev, const struct hifn_alg_templat struct hifn_crypto_alg *alg; int err; - alg = kzalloc_obj(*alg, GFP_KERNEL); + alg = kzalloc_obj(*alg); if (!alg) return -ENOMEM; diff --git a/drivers/crypto/hisilicon/debugfs.c b/drivers/crypto/hisilicon/debugfs.c index b7c5c4ade11f..32e9f8350289 100644 --- a/drivers/crypto/hisilicon/debugfs.c +++ b/drivers/crypto/hisilicon/debugfs.c @@ -838,7 +838,7 @@ static struct dfx_diff_registers *dfx_regs_init(struct hisi_qm *qm, u32 j, base_offset; int i; - diff_regs = kzalloc_objs(*diff_regs, reg_len, GFP_KERNEL); + diff_regs = kzalloc_objs(*diff_regs, reg_len); if (!diff_regs) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 07421f53a7ee..d00a79070bac 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -2722,7 +2722,7 @@ static int qm_hw_err_isolate(struct hisi_qm *qm) if (qm->uacce->is_vf || isolate->is_isolate || !isolate->err_threshold) return 0; - hw_err = kzalloc_obj(*hw_err, GFP_KERNEL); + hw_err = kzalloc_obj(*hw_err); if (!hw_err) return -ENOMEM; @@ -3747,7 +3747,7 @@ static int hisi_qm_sort_devices(int node, struct list_head *head, if (dev_node < 0) dev_node = 0; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return -ENOMEM; @@ -5767,7 +5767,7 @@ static int hisi_qp_alloc_memory(struct hisi_qm *qm) size_t qp_dma_size; int i, ret; - qm->qp_array = kzalloc_objs(struct hisi_qp, qm->qp_num, GFP_KERNEL); + qm->qp_array = kzalloc_objs(struct hisi_qp, qm->qp_num); if (!qm->qp_array) return -ENOMEM; diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index c8b71945f9f8..3373f9be2e42 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -569,11 +569,11 @@ static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ struct device *dev = ctx->dev; int ret = -ENOMEM; - qp_ctx->req_list = kzalloc_objs(struct sec_req *, q_depth, GFP_KERNEL); + qp_ctx->req_list = kzalloc_objs(struct sec_req *, q_depth); if (!qp_ctx->req_list) return ret; - qp_ctx->res = kzalloc_objs(struct sec_alg_res, q_depth, GFP_KERNEL); + qp_ctx->res = kzalloc_objs(struct sec_alg_res, q_depth); if (!qp_ctx->res) goto err_free_req_list; qp_ctx->res->depth = q_depth; diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index a4db14adc6da..efda8646fc60 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -420,7 +420,7 @@ struct hisi_qp **sec_create_qps(void) u8 *type; int ret; - qps = kzalloc_objs(struct hisi_qp *, ctx_num, GFP_KERNEL); + qps = kzalloc_objs(struct hisi_qp *, ctx_num); if (!qps) return NULL; diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c index ab20665cbfbc..1b26077970d4 100644 --- a/drivers/crypto/hisilicon/sgl.c +++ b/drivers/crypto/hisilicon/sgl.c @@ -83,7 +83,7 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev, (remain_sgl > 0 && block_num > HISI_ACC_MEM_BLOCK_NR - 1)) return ERR_PTR(-EINVAL); - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); block = pool->mem_block; diff --git a/drivers/crypto/inside-secure/eip93/eip93-aead.c b/drivers/crypto/inside-secure/eip93/eip93-aead.c index 8d72644fdc74..1a08aed5de13 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-aead.c +++ b/drivers/crypto/inside-secure/eip93/eip93-aead.c @@ -70,7 +70,7 @@ static int eip93_aead_cra_init(struct crypto_tfm *tfm) ctx->type = tmpl->type; ctx->set_assoc = true; - ctx->sa_record = kzalloc_obj(*ctx->sa_record, GFP_KERNEL); + ctx->sa_record = kzalloc_obj(*ctx->sa_record); if (!ctx->sa_record) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/eip93/eip93-cipher.c b/drivers/crypto/inside-secure/eip93/eip93-cipher.c index 74f4abeba646..0713c71ab458 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-cipher.c +++ b/drivers/crypto/inside-secure/eip93/eip93-cipher.c @@ -61,7 +61,7 @@ static int eip93_skcipher_cra_init(struct crypto_tfm *tfm) ctx->eip93 = tmpl->eip93; ctx->type = tmpl->type; - ctx->sa_record = kzalloc_obj(*ctx->sa_record, GFP_KERNEL); + ctx->sa_record = kzalloc_obj(*ctx->sa_record); if (!ctx->sa_record) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/eip93/eip93-common.c b/drivers/crypto/inside-secure/eip93/eip93-common.c index b19afd311c84..f4ad6beff15e 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-common.c +++ b/drivers/crypto/inside-secure/eip93/eip93-common.c @@ -152,7 +152,7 @@ static int eip93_make_sg_copy(struct scatterlist *src, struct scatterlist **dst, { void *pages; - *dst = kmalloc_obj(**dst, GFP_KERNEL); + *dst = kmalloc_obj(**dst); if (!*dst) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index 077da171fdf2..660f45ab8647 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -1889,7 +1889,7 @@ static int safexcel_pci_probe(struct pci_dev *pdev, ent->vendor, ent->device, ent->subvendor, ent->subdevice, ent->driver_data); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index f84def61ceb0..3402e570d045 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -2008,7 +2008,7 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm) struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); safexcel_ahash_cra_init(tfm); - ctx->aes = kmalloc_obj(*ctx->aes, GFP_KERNEL); + ctx->aes = kmalloc_obj(*ctx->aes); return ctx->aes == NULL ? -ENOMEM : 0; } diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index bcd2bfcc19af..547abf453d4a 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -335,7 +335,7 @@ int add_iaa_compression_mode(const char *name, goto out; } - mode = kzalloc_obj(*mode, GFP_KERNEL); + mode = kzalloc_obj(*mode); if (!mode) goto out; @@ -422,7 +422,7 @@ static int init_device_compression_mode(struct iaa_device *iaa_device, struct iaa_device_compression_mode *device_mode; int ret = -ENOMEM; - device_mode = kzalloc_obj(*device_mode, GFP_KERNEL); + device_mode = kzalloc_obj(*device_mode); if (!device_mode) return -ENOMEM; @@ -503,7 +503,7 @@ static struct iaa_device *iaa_device_alloc(void) { struct iaa_device *iaa_device; - iaa_device = kzalloc_obj(*iaa_device, GFP_KERNEL); + iaa_device = kzalloc_obj(*iaa_device); if (!iaa_device) return NULL; @@ -561,7 +561,7 @@ static int add_iaa_wq(struct iaa_device *iaa_device, struct idxd_wq *wq, struct device *dev = &pdev->dev; struct iaa_wq *iaa_wq; - iaa_wq = kzalloc_obj(*iaa_wq, GFP_KERNEL); + iaa_wq = kzalloc_obj(*iaa_wq); if (!iaa_wq) return -ENOMEM; @@ -718,7 +718,7 @@ static int alloc_wq_table(int max_wqs) for (cpu = 0; cpu < nr_cpus; cpu++) { entry = per_cpu_ptr(wq_table, cpu); - entry->wqs = kzalloc_objs(*entry->wqs, max_wqs, GFP_KERNEL); + entry->wqs = kzalloc_objs(*entry->wqs, max_wqs); if (!entry->wqs) { free_wq_table(); return -ENOMEM; diff --git a/drivers/crypto/intel/keembay/ocs-hcu.c b/drivers/crypto/intel/keembay/ocs-hcu.c index 2c9e523361df..87711068d747 100644 --- a/drivers/crypto/intel/keembay/ocs-hcu.c +++ b/drivers/crypto/intel/keembay/ocs-hcu.c @@ -491,7 +491,7 @@ struct ocs_hcu_dma_list *ocs_hcu_dma_list_alloc(struct ocs_hcu_dev *hcu_dev, { struct ocs_hcu_dma_list *dma_list; - dma_list = kmalloc_obj(*dma_list, GFP_KERNEL); + dma_list = kmalloc_obj(*dma_list); if (!dma_list) return NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c b/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c index 935f4f9d8a7c..f9f1018a2823 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c +++ b/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c @@ -178,7 +178,7 @@ int adf_ae_init(struct adf_accel_dev *accel_dev) if (!hw_device->fw_name) return 0; - loader_data = kzalloc_obj(*loader_data, GFP_KERNEL); + loader_data = kzalloc_obj(*loader_data); if (!loader_data) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_aer.c b/drivers/crypto/intel/qat/qat_common/adf_aer.c index a65e88d28f53..ed01fb9ad74e 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_aer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_aer.c @@ -160,7 +160,7 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev, return 0; set_bit(ADF_STATUS_RESTARTING, &accel_dev->status); - reset_data = kzalloc_obj(*reset_data, GFP_KERNEL); + reset_data = kzalloc_obj(*reset_data); if (!reset_data) return -ENOMEM; reset_data->accel_dev = accel_dev; diff --git a/drivers/crypto/intel/qat/qat_common/adf_cfg.c b/drivers/crypto/intel/qat/qat_common/adf_cfg.c index c348d290fc51..c202209f17d5 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_cfg.c +++ b/drivers/crypto/intel/qat/qat_common/adf_cfg.c @@ -68,7 +68,7 @@ int adf_cfg_dev_add(struct adf_accel_dev *accel_dev) { struct adf_cfg_device_data *dev_cfg_data; - dev_cfg_data = kzalloc_obj(*dev_cfg_data, GFP_KERNEL); + dev_cfg_data = kzalloc_obj(*dev_cfg_data); if (!dev_cfg_data) return -ENOMEM; INIT_LIST_HEAD(&dev_cfg_data->sec_list); @@ -289,7 +289,7 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev, if (!section) return -EFAULT; - key_val = kzalloc_obj(*key_val, GFP_KERNEL); + key_val = kzalloc_obj(*key_val); if (!key_val) return -ENOMEM; @@ -356,7 +356,7 @@ int adf_cfg_section_add(struct adf_accel_dev *accel_dev, const char *name) if (sec) return 0; - sec = kzalloc_obj(*sec, GFP_KERNEL); + sec = kzalloc_obj(*sec); if (!sec) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c b/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c index 2068fe29a24c..e050de16ab5d 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c @@ -172,7 +172,7 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, goto unlock; } num_devices++; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { ret = -ENOMEM; goto unlock; @@ -204,7 +204,7 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, goto unlock; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { ret = -ENOMEM; goto unlock; diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c index 622da38ce385..bf2bae78a40d 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c +++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c @@ -59,7 +59,7 @@ static int adf_gen4_vfmig_open_device(struct qat_mig_dev *mdev) vf_info = &accel_dev->pf.vf_info[mdev->vf_id]; - vfmig = kzalloc_obj(*vfmig, GFP_KERNEL); + vfmig = kzalloc_obj(*vfmig); if (!vfmig) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c b/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c index 95a9efceda6d..0cdb4241f04b 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c +++ b/drivers/crypto/intel/qat/qat_common/adf_heartbeat.c @@ -281,7 +281,7 @@ int adf_heartbeat_init(struct adf_accel_dev *accel_dev) { struct adf_heartbeat *hb; - hb = kzalloc_obj(*hb, GFP_KERNEL); + hb = kzalloc_obj(*hb); if (!hb) goto err_ret; diff --git a/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c b/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c index 1fbade552370..f9017e03ec0f 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.c @@ -37,7 +37,7 @@ struct adf_mstate_mgr *adf_mstate_mgr_new(u8 *buf, u32 size) { struct adf_mstate_mgr *mgr; - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (!mgr) return NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_rl.c b/drivers/crypto/intel/qat/qat_common/adf_rl.c index 2e037df286cc..997ef448a4df 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_rl.c +++ b/drivers/crypto/intel/qat/qat_common/adf_rl.c @@ -622,7 +622,7 @@ static int add_new_sla_entry(struct adf_accel_dev *accel_dev, struct rl_sla *sla; int ret = 0; - sla = kzalloc_obj(*sla, GFP_KERNEL); + sla = kzalloc_obj(*sla); if (!sla) { ret = -ENOMEM; goto ret_err; @@ -1065,7 +1065,7 @@ int adf_rl_init(struct adf_accel_dev *accel_dev) goto err_ret; } - rl = kzalloc_obj(*rl, GFP_KERNEL); + rl = kzalloc_obj(*rl); if (!rl) { ret = -ENOMEM; goto err_ret; diff --git a/drivers/crypto/intel/qat/qat_common/adf_timer.c b/drivers/crypto/intel/qat/qat_common/adf_timer.c index 3f5267c98ff3..cee965f9368d 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_timer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_timer.c @@ -40,7 +40,7 @@ int adf_timer_start(struct adf_accel_dev *accel_dev) { struct adf_timer *timer_ctx; - timer_ctx = kzalloc_obj(*timer_ctx, GFP_KERNEL); + timer_ctx = kzalloc_obj(*timer_ctx); if (!timer_ctx) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c b/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c index a27f1d76998e..a8f853516a3f 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c +++ b/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c @@ -99,7 +99,7 @@ int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name) struct adf_etr_ring_debug_entry *ring_debug; char entry_name[16]; - ring_debug = kzalloc_obj(*ring_debug, GFP_KERNEL); + ring_debug = kzalloc_obj(*ring_debug); if (!ring_debug) return -ENOMEM; diff --git a/drivers/crypto/intel/qat/qat_common/qat_hal.c b/drivers/crypto/intel/qat/qat_common/qat_hal.c index 86523a70b3a9..7a6ba6f22e3e 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_hal.c +++ b/drivers/crypto/intel/qat/qat_common/qat_hal.c @@ -832,17 +832,17 @@ int qat_hal_init(struct adf_accel_dev *accel_dev) struct icp_qat_fw_loader_handle *handle; int ret = 0; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; - handle->hal_handle = kzalloc_obj(*handle->hal_handle, GFP_KERNEL); + handle->hal_handle = kzalloc_obj(*handle->hal_handle); if (!handle->hal_handle) { ret = -ENOMEM; goto out_hal_handle; } - handle->chip_info = kzalloc_obj(*handle->chip_info, GFP_KERNEL); + handle->chip_info = kzalloc_obj(*handle->chip_info); if (!handle->chip_info) { ret = -ENOMEM; goto out_chip_info; diff --git a/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c b/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c index 4fb4b0cac64e..3869ada0190d 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c +++ b/drivers/crypto/intel/qat/qat_common/qat_mig_dev.c @@ -24,7 +24,7 @@ struct qat_mig_dev *qat_vfmig_create(struct pci_dev *pdev, int vf_id) !ops->load_state || !ops->save_setup || !ops->load_setup) return ERR_PTR(-EINVAL); - mdev = kmalloc_obj(*mdev, GFP_KERNEL); + mdev = kmalloc_obj(*mdev); if (!mdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/intel/qat/qat_common/qat_uclo.c b/drivers/crypto/intel/qat/qat_common/qat_uclo.c index be0cfd9dd09a..30f83f06d185 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/intel/qat/qat_common/qat_uclo.c @@ -42,10 +42,10 @@ static int qat_uclo_init_ae_data(struct icp_qat_uclo_objhandle *obj_handle, } else { ae_slice->ctx_mask_assigned = 0; } - ae_slice->region = kzalloc_obj(*ae_slice->region, GFP_KERNEL); + ae_slice->region = kzalloc_obj(*ae_slice->region); if (!ae_slice->region) return -ENOMEM; - ae_slice->page = kzalloc_obj(*ae_slice->page, GFP_KERNEL); + ae_slice->page = kzalloc_obj(*ae_slice->page); if (!ae_slice->page) goto out_err; page = ae_slice->page; @@ -258,7 +258,7 @@ static int qat_uclo_create_batch_init_list(struct icp_qat_fw_loader_handle init_header = *init_tab_base; if (!init_header) { - init_header = kzalloc_obj(*init_header, GFP_KERNEL); + init_header = kzalloc_obj(*init_header); if (!init_header) return -ENOMEM; init_header->size = 1; @@ -270,7 +270,7 @@ static int qat_uclo_create_batch_init_list(struct icp_qat_fw_loader_handle tail_old = tail_old->next; tail = tail_old; for (i = 0; i < init_mem->val_attr_num; i++) { - mem_init = kzalloc_obj(*mem_init, GFP_KERNEL); + mem_init = kzalloc_obj(*mem_init); if (!mem_init) goto out_err; mem_init->ae = ae; @@ -501,7 +501,7 @@ qat_uclo_map_chunk(char *buf, struct icp_qat_uof_filehdr *file_hdr, if (file_chunk->checksum != qat_uclo_calc_str_checksum( chunk, file_chunk->size)) break; - obj_hdr = kzalloc_obj(*obj_hdr, GFP_KERNEL); + obj_hdr = kzalloc_obj(*obj_hdr); if (!obj_hdr) break; obj_hdr->file_buff = chunk; @@ -634,7 +634,7 @@ static int qat_uclo_map_uimage(struct icp_qat_uclo_objhandle *obj_handle, if (qat_uclo_check_image_compat(encap_uof_obj, image)) goto out_err; ae_uimage[j].page = - kzalloc_obj(struct icp_qat_uclo_encap_page, GFP_KERNEL); + kzalloc_obj(struct icp_qat_uclo_encap_page); if (!ae_uimage[j].page) goto out_err; qat_uclo_map_image_page(encap_uof_obj, image, @@ -1719,7 +1719,7 @@ static int qat_uclo_map_suof_obj(struct icp_qat_fw_loader_handle *handle, { struct icp_qat_suof_handle *suof_handle; - suof_handle = kzalloc_obj(*suof_handle, GFP_KERNEL); + suof_handle = kzalloc_obj(*suof_handle); if (!suof_handle) return -ENOMEM; handle->sobj_handle = suof_handle; @@ -1763,7 +1763,7 @@ static int qat_uclo_map_uof_obj(struct icp_qat_fw_loader_handle *handle, struct icp_qat_uof_filehdr *filehdr; struct icp_qat_uclo_objhandle *objhdl; - objhdl = kzalloc_obj(*objhdl, GFP_KERNEL); + objhdl = kzalloc_obj(*objhdl); if (!objhdl) return -ENOMEM; objhdl->obj_buf = kmemdup(addr_ptr, mem_size, GFP_KERNEL); @@ -2003,7 +2003,7 @@ static int qat_uclo_map_mof_obj(struct icp_qat_fw_loader_handle *handle, if (qat_uclo_check_mof_format(mof_ptr)) return -EINVAL; - mobj_handle = kzalloc_obj(*mobj_handle, GFP_KERNEL); + mobj_handle = kzalloc_obj(*mobj_handle); if (!mobj_handle) return -ENOMEM; diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c index b35c57a868e7..09e6a8474d1a 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c @@ -318,7 +318,7 @@ static int process_tar_file(struct device *dev, return -EINVAL; } - tar_info = kzalloc_obj(struct tar_ucode_info_t, GFP_KERNEL); + tar_info = kzalloc_obj(struct tar_ucode_info_t); if (!tar_info) return -ENOMEM; @@ -412,7 +412,7 @@ static struct tar_arch_info_t *load_tar_archive(struct device *dev, size_t tar_size; int ret; - tar_arch = kzalloc_obj(struct tar_arch_info_t, GFP_KERNEL); + tar_arch = kzalloc_obj(struct tar_arch_info_t); if (!tar_arch) return NULL; diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c index 32f6616a60eb..587609db6c69 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c +++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c @@ -31,7 +31,7 @@ static int init_worker_threads(struct otx_cptvf *cptvf) struct otx_cptvf_wqe_info *cwqe_info; int i; - cwqe_info = kzalloc_obj(*cwqe_info, GFP_KERNEL); + cwqe_info = kzalloc_obj(*cwqe_info); if (!cwqe_info) return -ENOMEM; @@ -100,7 +100,7 @@ static int alloc_pending_queues(struct otx_cpt_pending_qinfo *pqinfo, u32 qlen, pqinfo->num_queues = num_queues; for_each_pending_queue(pqinfo, queue, i) { - queue->head = kzalloc_objs(*queue->head, qlen, GFP_KERNEL); + queue->head = kzalloc_objs(*queue->head, qlen); if (!queue->head) { ret = -ENOMEM; goto pending_qfail; @@ -212,7 +212,7 @@ static int alloc_command_queues(struct otx_cptvf *cptvf, queue = &cqinfo->queue[i]; INIT_LIST_HEAD(&queue->chead); do { - curr = kzalloc_obj(*curr, GFP_KERNEL); + curr = kzalloc_obj(*curr); if (!curr) goto cmd_qfail; diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c index 97d948fbc4b3..9b0887d7e62c 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c @@ -372,7 +372,7 @@ static int load_fw(struct device *dev, struct fw_info_t *fw_info, int ucode_type, ucode_size; int ret; - uc_info = kzalloc_obj(*uc_info, GFP_KERNEL); + uc_info = kzalloc_obj(*uc_info); if (!uc_info) return -ENOMEM; diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c index bec0a4cd2662..858f851c9c8a 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c @@ -150,7 +150,7 @@ static int init_tasklet_work(struct otx2_cptlfs_info *lfs) int i, ret = 0; for (i = 0; i < lfs->lfs_num; i++) { - wqe = kzalloc_obj(struct otx2_cptlf_wqe, GFP_KERNEL); + wqe = kzalloc_obj(struct otx2_cptlf_wqe); if (!wqe) { ret = -ENOMEM; goto cleanup_tasklet; diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c index f388027b1256..b61f2545e165 100644 --- a/drivers/crypto/nx/nx-842.c +++ b/drivers/crypto/nx/nx-842.c @@ -105,7 +105,7 @@ void *nx842_crypto_alloc_ctx(struct nx842_driver *driver) { struct nx842_crypto_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/crypto/nx/nx-common-powernv.c b/drivers/crypto/nx/nx-common-powernv.c index a9253e34a0e5..d6185740ff93 100644 --- a/drivers/crypto/nx/nx-common-powernv.c +++ b/drivers/crypto/nx/nx-common-powernv.c @@ -810,7 +810,7 @@ static int __init vas_cfg_coproc_info(struct device_node *dn, int chip_id, return ret; } - coproc = kzalloc_obj(*coproc, GFP_KERNEL); + coproc = kzalloc_obj(*coproc); if (!coproc) return -ENOMEM; @@ -968,7 +968,7 @@ static int __init nx842_powernv_probe(struct device_node *dn) return -EINVAL; } - coproc = kzalloc_obj(*coproc, GFP_KERNEL); + coproc = kzalloc_obj(*coproc); if (!coproc) return -ENOMEM; diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c index ecf84448b797..a6e65c3d2873 100644 --- a/drivers/crypto/nx/nx-common-pseries.c +++ b/drivers/crypto/nx/nx-common-pseries.c @@ -1148,7 +1148,7 @@ static void __init nxcop_get_capabilities(void) u64 feat; int rc; - hv_caps = kmalloc_obj(*hv_caps, GFP_KERNEL); + hv_caps = kmalloc_obj(*hv_caps); if (!hv_caps) return; /* @@ -1167,7 +1167,7 @@ static void __init nxcop_get_capabilities(void) /* * NX-GZIP feature available */ - hv_nxc = kmalloc_obj(*hv_nxc, GFP_KERNEL); + hv_nxc = kmalloc_obj(*hv_nxc); if (!hv_nxc) return; /* @@ -1217,7 +1217,7 @@ static int __init nx842_pseries_init(void) of_node_put(np); RCU_INIT_POINTER(devdata, NULL); - new_devdata = kzalloc_obj(*new_devdata, GFP_KERNEL); + new_devdata = kzalloc_obj(*new_devdata); if (!new_devdata) return -ENOMEM; diff --git a/drivers/crypto/omap-crypto.c b/drivers/crypto/omap-crypto.c index 441f0e5eb458..7bd6869c2b21 100644 --- a/drivers/crypto/omap-crypto.c +++ b/drivers/crypto/omap-crypto.c @@ -21,7 +21,7 @@ static int omap_crypto_copy_sg_lists(int total, int bs, struct scatterlist *tmp; if (!(flags & OMAP_CRYPTO_FORCE_SINGLE_ENTRY)) { - new_sg = kmalloc_objs(*new_sg, n, GFP_KERNEL); + new_sg = kmalloc_objs(*new_sg, n); if (!new_sg) return -ENOMEM; diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 48f6ba92ee93..6a3c7f9277cf 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -636,7 +636,7 @@ static int omap_sham_copy_sg_lists(struct omap_sham_reqctx *ctx, if (ctx->bufcnt) n++; - ctx->sg = kmalloc_objs(*sg, n, GFP_KERNEL); + ctx->sg = kmalloc_objs(*sg, n); if (!ctx->sg) return -ENOMEM; diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c index ffc31a1d72c5..846e1d42775d 100644 --- a/drivers/crypto/qce/aead.c +++ b/drivers/crypto/qce/aead.c @@ -762,7 +762,7 @@ static int qce_aead_register_one(const struct qce_aead_def *def, struct qce_devi struct aead_alg *alg; int ret; - tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index f09d0d7da518..402e4e64347d 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -457,7 +457,7 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def, struct crypto_alg *base; int ret; - tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c index 1571ede06b86..4ad3a1702010 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -440,7 +440,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, struct skcipher_alg *alg; int ret; - tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl); if (!tmpl) return -ENOMEM; diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index ea13b0fd4d89..eece1ff6c62f 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -1056,7 +1056,7 @@ static int s5p_hash_copy_sg_lists(struct s5p_hash_reqctx *ctx, if (ctx->bufcnt) n++; - ctx->sg = kmalloc_objs(*sg, n, GFP_KERNEL); + ctx->sg = kmalloc_objs(*sg, n); if (!ctx->sg) { ctx->error = true; return -ENOMEM; diff --git a/drivers/crypto/tegra/tegra-se-main.c b/drivers/crypto/tegra/tegra-se-main.c index caca5e365f8b..eb71113ed146 100644 --- a/drivers/crypto/tegra/tegra-se-main.c +++ b/drivers/crypto/tegra/tegra-se-main.c @@ -47,7 +47,7 @@ tegra_se_cmdbuf_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_dire struct host1x_bo_mapping *map; int err; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return ERR_PTR(-ENOMEM); @@ -56,7 +56,7 @@ tegra_se_cmdbuf_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_dire map->direction = direction; map->dev = dev; - map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt); if (!map->sgt) { err = -ENOMEM; goto free; @@ -123,7 +123,7 @@ static struct tegra_se_cmdbuf *tegra_se_host1x_bo_alloc(struct tegra_se *se, ssi struct tegra_se_cmdbuf *cmdbuf; struct device *dev = se->dev->parent; - cmdbuf = kzalloc_obj(*cmdbuf, GFP_KERNEL); + cmdbuf = kzalloc_obj(*cmdbuf); if (!cmdbuf) return NULL; diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c index 01077166b2f1..d8d452cac391 100644 --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c @@ -112,7 +112,7 @@ static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher if (!pkey) return -ENOMEM; - vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req); if (!vc_ctrl_req) { err = -ENOMEM; goto out; @@ -169,7 +169,7 @@ static int virtio_crypto_alg_akcipher_close_session(struct virtio_crypto_akciphe if (!ctx->session_valid) return 0; - vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req); if (!vc_ctrl_req) return -ENOMEM; diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c index ae100e315185..a3cdcf67886b 100644 --- a/drivers/crypto/virtio/virtio_crypto_core.c +++ b/drivers/crypto/virtio/virtio_crypto_core.c @@ -115,10 +115,10 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi) total_vqs = vi->max_data_queues + 1; /* Allocate space for find_vqs parameters */ - vqs = kzalloc_objs(*vqs, total_vqs, GFP_KERNEL); + vqs = kzalloc_objs(*vqs, total_vqs); if (!vqs) goto err_vq; - vqs_info = kzalloc_objs(*vqs_info, total_vqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, total_vqs); if (!vqs_info) goto err_vqs_info; diff --git a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c index b25b7982c942..e82fc16cab25 100644 --- a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c @@ -131,7 +131,7 @@ static int virtio_crypto_alg_skcipher_init_session( if (!cipher_key) return -ENOMEM; - vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req); if (!vc_ctrl_req) { err = -ENOMEM; goto out; @@ -200,7 +200,7 @@ static int virtio_crypto_alg_skcipher_close_session( struct virtio_crypto_inhdr *ctrl_status; struct virtio_crypto_ctrl_request *vc_ctrl_req; - vc_ctrl_req = kzalloc_obj(*vc_ctrl_req, GFP_KERNEL); + vc_ctrl_req = kzalloc_obj(*vc_ctrl_req); if (!vc_ctrl_req) return -ENOMEM; diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index 11320e88eb09..127537628817 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -336,7 +336,7 @@ static void del_cxl_resource(struct resource *res) static struct resource *alloc_cxl_resource(resource_size_t base, resource_size_t n, int id) { - struct resource *res __free(kfree) = kzalloc_obj(*res, GFP_KERNEL); + struct resource *res __free(kfree) = kzalloc_obj(*res); if (!res) return NULL; @@ -825,7 +825,7 @@ static int add_cxl_resources(struct resource *cxl_res) struct resource *res, *new, *next; for (res = cxl_res->child; res; res = next) { - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return -ENOMEM; new->name = res->name; diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c index a024083bae2d..5c9f07262513 100644 --- a/drivers/cxl/core/cdat.c +++ b/drivers/cxl/core/cdat.c @@ -69,7 +69,7 @@ static int cdat_dsmas_handler(union acpi_subtable_headers *header, void *arg, /* Skip common header */ dsmas = (struct acpi_cdat_dsmas *)(hdr + 1); - dent = kzalloc_obj(*dent, GFP_KERNEL); + dent = kzalloc_obj(*dent); if (!dent) return -ENOMEM; @@ -669,7 +669,7 @@ static int cxl_endpoint_gather_bandwidth(struct cxl_region *cxlr, perf_ctx = xa_load(usp_xa, index); if (!perf_ctx) { struct cxl_perf_ctx *c __free(kfree) = - kzalloc_obj(*perf_ctx, GFP_KERNEL); + kzalloc_obj(*perf_ctx); if (!c) return -ENOMEM; @@ -756,7 +756,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, bool *gp_is_root) { struct xarray *res_xa __free(free_perf_xa) = - kzalloc_obj(*res_xa, GFP_KERNEL); + kzalloc_obj(*res_xa); struct access_coordinate coords[ACCESS_COORDINATE_MAX]; struct cxl_perf_ctx *ctx, *us_ctx; unsigned long index, us_index; @@ -795,7 +795,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, us_ctx = xa_load(res_xa, us_index); if (!us_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc_obj(*n, GFP_KERNEL); + kzalloc_obj(*n); if (!n) return ERR_PTR(-ENOMEM); @@ -862,7 +862,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr, static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) { struct xarray *hb_xa __free(free_perf_xa) = - kzalloc_obj(*hb_xa, GFP_KERNEL); + kzalloc_obj(*hb_xa); struct cxl_perf_ctx *ctx; unsigned long index; @@ -879,7 +879,7 @@ static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) hb_ctx = xa_load(hb_xa, hb_index); if (!hb_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc_obj(*n, GFP_KERNEL); + kzalloc_obj(*n); if (!n) return ERR_PTR(-ENOMEM); @@ -906,7 +906,7 @@ static struct xarray *cxl_rp_gather_bandwidth(struct xarray *xa) static struct xarray *cxl_hb_gather_bandwidth(struct xarray *xa) { struct xarray *mw_xa __free(free_perf_xa) = - kzalloc_obj(*mw_xa, GFP_KERNEL); + kzalloc_obj(*mw_xa); struct cxl_perf_ctx *ctx; unsigned long index; @@ -928,7 +928,7 @@ static struct xarray *cxl_hb_gather_bandwidth(struct xarray *xa) mw_ctx = xa_load(mw_xa, mw_index); if (!mw_ctx) { struct cxl_perf_ctx *n __free(kfree) = - kzalloc_obj(*n, GFP_KERNEL); + kzalloc_obj(*n); if (!n) return ERR_PTR(-ENOMEM); @@ -987,7 +987,7 @@ void cxl_region_shared_upstream_bandwidth_update(struct cxl_region *cxlr) lockdep_assert_held(&cxl_rwsem.dpa); struct xarray *usp_xa __free(free_perf_xa) = - kzalloc_obj(*usp_xa, GFP_KERNEL); + kzalloc_obj(*usp_xa); if (!usp_xa) return; diff --git a/drivers/cxl/core/edac.c b/drivers/cxl/core/edac.c index 7f5457adb26c..b321971fef58 100644 --- a/drivers/cxl/core/edac.c +++ b/drivers/cxl/core/edac.c @@ -2009,7 +2009,7 @@ static void err_rec_free(void *_cxlmd) static int devm_cxl_memdev_setup_err_rec(struct cxl_memdev *cxlmd) { - struct cxl_mem_err_rec *array_rec = kzalloc_obj(*array_rec, GFP_KERNEL); + struct cxl_mem_err_rec *array_rec = kzalloc_obj(*array_rec); if (!array_rec) return -ENOMEM; diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c index 2007d8ebe1c4..75c5534ce205 100644 --- a/drivers/cxl/core/features.c +++ b/drivers/cxl/core/features.c @@ -204,7 +204,7 @@ int devm_cxl_setup_features(struct cxl_dev_state *cxlds) return -ENODEV; struct cxl_features_state *cxlfs __free(kfree) = - kzalloc_obj(*cxlfs, GFP_KERNEL); + kzalloc_obj(*cxlfs); if (!cxlfs) return -ENOMEM; diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c index a81df0de4889..d0159fb19b0f 100644 --- a/drivers/cxl/core/memdev.c +++ b/drivers/cxl/core/memdev.c @@ -665,7 +665,7 @@ static struct cxl_memdev *cxl_memdev_alloc(struct cxl_dev_state *cxlds, struct cdev *cdev; int rc; - cxlmd = kzalloc_obj(*cxlmd, GFP_KERNEL); + cxlmd = kzalloc_obj(*cxlmd); if (!cxlmd) return ERR_PTR(-ENOMEM); diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c index be7538e58b9c..3c6e76721522 100644 --- a/drivers/cxl/core/pmem.c +++ b/drivers/cxl/core/pmem.c @@ -83,7 +83,7 @@ static struct cxl_nvdimm_bridge *cxl_nvdimm_bridge_alloc(struct cxl_port *port) struct device *dev; int rc; - cxl_nvb = kzalloc_obj(*cxl_nvb, GFP_KERNEL); + cxl_nvb = kzalloc_obj(*cxl_nvb); if (!cxl_nvb) return ERR_PTR(-ENOMEM); @@ -198,7 +198,7 @@ static struct cxl_nvdimm *cxl_nvdimm_alloc(struct cxl_nvdimm_bridge *cxl_nvb, struct cxl_nvdimm *cxl_nvd; struct device *dev; - cxl_nvd = kzalloc_obj(*cxl_nvd, GFP_KERNEL); + cxl_nvd = kzalloc_obj(*cxl_nvd); if (!cxl_nvd) return ERR_PTR(-ENOMEM); diff --git a/drivers/cxl/core/pmu.c b/drivers/cxl/core/pmu.c index 8eb175c3ff22..57e9a99f3639 100644 --- a/drivers/cxl/core/pmu.c +++ b/drivers/cxl/core/pmu.c @@ -33,7 +33,7 @@ int devm_cxl_pmu_add(struct device *parent, struct cxl_pmu_regs *regs, struct device *dev; int rc; - pmu = kzalloc_obj(*pmu, GFP_KERNEL); + pmu = kzalloc_obj(*pmu); if (!pmu) return -ENOMEM; diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 491c7485db60..d6433c544e3c 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -688,11 +688,11 @@ static struct cxl_port *cxl_port_alloc(struct device *uport_dev, /* No parent_dport, root cxl_port */ if (!parent_dport) { - cxl_root = kzalloc_obj(*cxl_root, GFP_KERNEL); + cxl_root = kzalloc_obj(*cxl_root); if (!cxl_root) return ERR_PTR(-ENOMEM); } else { - _port = kzalloc_obj(*port, GFP_KERNEL); + _port = kzalloc_obj(*port); if (!_port) return ERR_PTR(-ENOMEM); } @@ -1184,7 +1184,7 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, CXL_TARGET_STRLEN) return ERR_PTR(-EINVAL); - dport = kzalloc_obj(*dport, GFP_KERNEL); + dport = kzalloc_obj(*dport); if (!dport) return ERR_PTR(-ENOMEM); @@ -1350,7 +1350,7 @@ static int cxl_add_ep(struct cxl_dport *dport, struct device *ep_dev) struct cxl_ep *ep; int rc; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; @@ -2101,7 +2101,7 @@ struct cxl_endpoint_decoder *cxl_endpoint_decoder_alloc(struct cxl_port *port) if (!is_cxl_endpoint(port)) return ERR_PTR(-EINVAL); - cxled = kzalloc_obj(*cxled, GFP_KERNEL); + cxled = kzalloc_obj(*cxled); if (!cxled) return ERR_PTR(-ENOMEM); diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 288448cff91b..e7fedfe8f1b6 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -998,7 +998,7 @@ alloc_region_ref(struct cxl_port *port, struct cxl_region *cxlr, return ERR_PTR(-EBUSY); } - cxl_rr = kzalloc_obj(*cxl_rr, GFP_KERNEL); + cxl_rr = kzalloc_obj(*cxl_rr); if (!cxl_rr) return ERR_PTR(-ENOMEM); cxl_rr->port = port; @@ -2474,7 +2474,7 @@ static struct cxl_region *cxl_region_alloc(struct cxl_root_decoder *cxlrd, int i struct cxl_region *cxlr; struct device *dev; - cxlr = kzalloc_obj(*cxlr, GFP_KERNEL); + cxlr = kzalloc_obj(*cxlr); if (!cxlr) { memregion_free(id); return ERR_PTR(-ENOMEM); @@ -3552,7 +3552,7 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr) if (p->state != CXL_CONFIG_COMMIT) return ERR_PTR(-ENXIO); - cxlr_dax = kzalloc_obj(*cxlr_dax, GFP_KERNEL); + cxlr_dax = kzalloc_obj(*cxlr_dax); if (!cxlr_dax) return ERR_PTR(-ENOMEM); @@ -3835,7 +3835,7 @@ static int __construct_region(struct cxl_region *cxlr, set_bit(CXL_REGION_F_AUTO, &cxlr->flags); cxlr->hpa_range = *hpa_range; - res = kmalloc_obj(*res, GFP_KERNEL); + res = kmalloc_obj(*res); if (!res) return -ENOMEM; diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c index ead92ca37a4e..46d37ffef95e 100644 --- a/drivers/cxl/pmem.c +++ b/drivers/cxl/pmem.c @@ -426,7 +426,7 @@ static int cxl_pmem_region_probe(struct device *dev) set_bit(ND_REGION_CXL, &ndr_desc.flags); set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags); - info = kmalloc_objs(*info, cxlr_pmem->nr_mappings, GFP_KERNEL); + info = kmalloc_objs(*info, cxlr_pmem->nr_mappings); if (!info) return -ENOMEM; diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 3faaaa7a507b..c94c09622516 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -110,7 +110,7 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf, dax_id = __dax_match_id(dax_drv, buf); if (!dax_id) { if (action == ID_ADD) { - dax_id = kzalloc_obj(*dax_id, GFP_KERNEL); + dax_id = kzalloc_obj(*dax_id); if (dax_id) { strscpy(dax_id->dev_name, buf, DAX_NAME_LEN); list_add(&dax_id->list, &dax_drv->ids); @@ -650,7 +650,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id, || !IS_ALIGNED(range_len(range), align)) return NULL; - dax_region = kzalloc_obj(*dax_region, GFP_KERNEL); + dax_region = kzalloc_obj(*dax_region); if (!dax_region) return NULL; @@ -807,7 +807,7 @@ static int devm_register_dax_mapping(struct dev_dax *dev_dax, int range_id) "region disabled\n")) return -ENXIO; - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) return -ENOMEM; mapping->range_id = range_id; @@ -1427,7 +1427,7 @@ static struct dev_dax *__devm_create_dev_dax(struct dev_dax_data *data) struct device *dev; int rc; - dev_dax = kzalloc_obj(*dev_dax, GFP_KERNEL); + dev_dax = kzalloc_obj(*dev_dax); if (!dev_dax) return ERR_PTR(-ENOMEM); diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 36bb954e27ca..179de3cf6d6c 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -313,7 +313,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, if (!desc->ops->set_event || !desc->ops->get_event) return ERR_PTR(-EINVAL); - edev = kzalloc_obj(struct devfreq_event_dev, GFP_KERNEL); + edev = kzalloc_obj(struct devfreq_event_dev); if (!edev) return ERR_PTR(-ENOMEM); diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 5c094c884aba..c0a74091b904 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -821,7 +821,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_out; } - devfreq = kzalloc_obj(struct devfreq, GFP_KERNEL); + devfreq = kzalloc_obj(struct devfreq); if (!devfreq) { err = -ENOMEM; goto err_out; diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index c0271cc76bd9..d7feecd900f1 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -310,7 +310,7 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq) continue; } - parent_cpu_data = kzalloc_obj(*parent_cpu_data, GFP_KERNEL); + parent_cpu_data = kzalloc_obj(*parent_cpu_data); if (!parent_cpu_data) { ret = -ENOMEM; goto err_put_policy; diff --git a/drivers/dibs/dibs_loopback.c b/drivers/dibs/dibs_loopback.c index 95ddc7712a89..ec3b48cb0e87 100644 --- a/drivers/dibs/dibs_loopback.c +++ b/drivers/dibs/dibs_loopback.c @@ -64,7 +64,7 @@ static int dibs_lo_register_dmb(struct dibs_dev *dibs, struct dibs_dmb *dmb, if (sba_idx == DIBS_LO_MAX_DMBS) return -ENOSPC; - dmb_node = kzalloc_obj(*dmb_node, GFP_KERNEL); + dmb_node = kzalloc_obj(*dmb_node); if (!dmb_node) { rc = -ENOMEM; goto err_bit; @@ -303,7 +303,7 @@ static int dibs_lo_dev_probe(void) struct dibs_dev *dibs; int ret; - ldev = kzalloc_obj(*ldev, GFP_KERNEL); + ldev = kzalloc_obj(*ldev); if (!ldev) return -ENOMEM; diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c index b763c4ab1a4e..f1816361b74d 100644 --- a/drivers/dibs/dibs_main.c +++ b/drivers/dibs/dibs_main.c @@ -133,7 +133,7 @@ struct dibs_dev *dibs_dev_alloc(void) { struct dibs_dev *dibs; - dibs = kzalloc_obj(*dibs, GFP_KERNEL); + dibs = kzalloc_obj(*dibs); if (!dibs) return dibs; dibs->dev.release = dibs_dev_release; diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index 86500b6c4c53..419b3c13d491 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c @@ -221,7 +221,7 @@ static int __init dio_init(void) } /* Found a board, allocate it an entry in the list */ - dev = kzalloc_obj(struct dio_dev, GFP_KERNEL); + dev = kzalloc_obj(struct dio_dev); if (!dev) { if (scode >= DIOII_SCBASE) iounmap(va); diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c index d9374f2ff0ca..794acff2546a 100644 --- a/drivers/dma-buf/dma-buf-mapping.c +++ b/drivers/dma-buf/dma-buf-mapping.c @@ -108,7 +108,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach, /* This function is supposed to work on MMIO memory only */ return ERR_PTR(-EINVAL); - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) return ERR_PTR(-ENOMEM); @@ -119,7 +119,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach, */ break; case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE: - dma->state = kzalloc_obj(*dma->state, GFP_KERNEL); + dma->state = kzalloc_obj(*dma->state); if (!dma->state) { ret = -ENOMEM; goto err_free_dma; diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 71d5e7e42653..11711874a325 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -866,7 +866,7 @@ static int dma_buf_wrap_sg_table(struct sg_table **sg_table) * sg_table without copying the page_link and give only the copy back to * the importer. */ - to = kzalloc_obj(*to, GFP_KERNEL); + to = kzalloc_obj(*to); if (!to) return -ENOMEM; @@ -1020,7 +1020,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, if (WARN_ON(importer_ops && !importer_ops->move_notify)) return ERR_PTR(-EINVAL); - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/dma-fence-unwrap.c b/drivers/dma-buf/dma-fence-unwrap.c index dc2525b2a03f..07fe9bf45aea 100644 --- a/drivers/dma-buf/dma-fence-unwrap.c +++ b/drivers/dma-buf/dma-fence-unwrap.c @@ -155,7 +155,7 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences, dma_fence_put(unsignaled); - array = kmalloc_objs(*array, count, GFP_KERNEL); + array = kmalloc_objs(*array, count); if (!array) return NULL; diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 97f0f150e49a..35afcfcac591 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -156,7 +156,7 @@ struct dma_fence *dma_fence_allocate_private_stub(ktime_t timestamp) { struct dma_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (fence == NULL) return NULL; @@ -905,7 +905,7 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, return 0; } - cb = kzalloc_objs(struct default_wait_cb, count, GFP_KERNEL); + cb = kzalloc_objs(struct default_wait_cb, count); if (cb == NULL) { ret = -ENOMEM; goto err_free_cb; diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index e0b9eb871c35..ac5f8685a649 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -244,7 +244,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) return ERR_PTR(-EINVAL); } - heap = kzalloc_obj(*heap, GFP_KERNEL); + heap = kzalloc_obj(*heap); if (!heap) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 06ed40c9d528..bd3370b9a3f6 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -74,7 +74,7 @@ static int cma_heap_attach(struct dma_buf *dmabuf, struct dma_heap_attachment *a; int ret; - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) return -ENOMEM; @@ -308,7 +308,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, int ret = -ENOMEM; pgoff_t pg; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return ERR_PTR(-ENOMEM); @@ -346,7 +346,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, memset(page_address(cma_pages), 0, size); } - buffer->pages = kmalloc_objs(*buffer->pages, pagecount, GFP_KERNEL); + buffer->pages = kmalloc_objs(*buffer->pages, pagecount); if (!buffer->pages) { ret = -ENOMEM; goto free_cma; @@ -391,7 +391,7 @@ static int __init __add_cma_heap(struct cma *cma, const char *name) struct dma_heap_export_info exp_info; struct cma_heap *cma_heap; - cma_heap = kzalloc_obj(*cma_heap, GFP_KERNEL); + cma_heap = kzalloc_obj(*cma_heap); if (!cma_heap) return -ENOMEM; cma_heap->cma = cma; diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 27ba8e55d909..b3650d8fd651 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -77,7 +77,7 @@ static int system_heap_attach(struct dma_buf *dmabuf, struct dma_heap_attachment *a; int ret; - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) return -ENOMEM; @@ -354,7 +354,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap, struct page *page, *tmp_page; int i, ret = -ENOMEM; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-fence-chain.c index 4ae7a6257e57..821023dd34df 100644 --- a/drivers/dma-buf/st-dma-fence-chain.c +++ b/drivers/dma-buf/st-dma-fence-chain.c @@ -450,7 +450,7 @@ static int find_race(void *arg) if (err) return err; - threads = kmalloc_objs(*threads, ncpus, GFP_KERNEL); + threads = kmalloc_objs(*threads, ncpus); if (!threads) { err = -ENOMEM; goto err; diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c index 56802a39874e..9c74195f47fd 100644 --- a/drivers/dma-buf/st-dma-fence-unwrap.c +++ b/drivers/dma-buf/st-dma-fence-unwrap.c @@ -32,7 +32,7 @@ static struct dma_fence *__mock_fence(u64 context, u64 seqno) { struct mock_fence *f; - f = kmalloc_obj(*f, GFP_KERNEL); + f = kmalloc_obj(*f); if (!f) return NULL; @@ -54,7 +54,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...) va_list valist; int i; - fences = kzalloc_objs(*fences, num_fences, GFP_KERNEL); + fences = kzalloc_objs(*fences, num_fences); if (!fences) goto error_put; diff --git a/drivers/dma-buf/st-dma-resv.c b/drivers/dma-buf/st-dma-resv.c index fad024820f85..ad4dfb49dcd9 100644 --- a/drivers/dma-buf/st-dma-resv.c +++ b/drivers/dma-buf/st-dma-resv.c @@ -27,7 +27,7 @@ static struct dma_fence *alloc_fence(void) { struct dma_fence *f; - f = kmalloc_obj(*f, GFP_KERNEL); + f = kmalloc_obj(*f); if (!f) return NULL; diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index d04f479edaee..963a72324d16 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -101,7 +101,7 @@ static struct sync_timeline *sync_timeline_create(const char *name) { struct sync_timeline *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; @@ -252,7 +252,7 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj, { struct sync_pt *pt; - pt = kzalloc_obj(*pt, GFP_KERNEL); + pt = kzalloc_obj(*pt); if (!pt) return NULL; diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index ad2c3e9e23bc..2166bbdf7e4a 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -24,7 +24,7 @@ static struct sync_file *sync_file_alloc(void) { struct sync_file *sync_file; - sync_file = kzalloc_obj(*sync_file, GFP_KERNEL); + sync_file = kzalloc_obj(*sync_file); if (!sync_file) return NULL; diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 816ee45f4f99..7173dad6ead5 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -115,7 +115,7 @@ static int vmap_udmabuf(struct dma_buf *buf, struct iosys_map *map) dma_resv_assert_held(buf->resv); - pages = kvmalloc_objs(*pages, ubuf->pagecount, GFP_KERNEL); + pages = kvmalloc_objs(*pages, ubuf->pagecount); if (!pages) return -ENOMEM; @@ -150,7 +150,7 @@ static struct sg_table *get_sg_table(struct device *dev, struct dma_buf *buf, unsigned int i = 0; int ret; - sg = kzalloc_obj(*sg, GFP_KERNEL); + sg = kzalloc_obj(*sg); if (!sg) return ERR_PTR(-ENOMEM); @@ -207,11 +207,11 @@ static void unpin_all_folios(struct udmabuf *ubuf) static __always_inline int init_udmabuf(struct udmabuf *ubuf, pgoff_t pgcnt) { - ubuf->folios = kvmalloc_objs(*ubuf->folios, pgcnt, GFP_KERNEL); + ubuf->folios = kvmalloc_objs(*ubuf->folios, pgcnt); if (!ubuf->folios) return -ENOMEM; - ubuf->offsets = kvzalloc_objs(*ubuf->offsets, pgcnt, GFP_KERNEL); + ubuf->offsets = kvzalloc_objs(*ubuf->offsets, pgcnt); if (!ubuf->offsets) return -ENOMEM; diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index d7a033822045..be73021ecbd6 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -189,7 +189,7 @@ int acpi_dma_controller_register(struct device *dev, if (!adev) return -EINVAL; - adma = kzalloc_obj(*adma, GFP_KERNEL); + adma = kzalloc_obj(*adma); if (!adma) return -ENOMEM; diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index fb9dad69c314..a960d0467bfc 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -2372,7 +2372,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, * to cope with that situation. */ for (i = 0; i < channels; i++) { - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return -ENOMEM; @@ -2390,7 +2390,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, chan->signal = i; pl08x_dma_slave_init(chan); } else { - chan->cd = kzalloc_obj(*chan->cd, GFP_KERNEL); + chan->cd = kzalloc_obj(*chan->cd); if (!chan->cd) { kfree(chan); return -ENOMEM; @@ -2709,7 +2709,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id) goto out_no_pl08x; /* Create the driver state holder */ - pl08x = kzalloc_obj(*pl08x, GFP_KERNEL); + pl08x = kzalloc_obj(*pl08x); if (!pl08x) { ret = -ENOMEM; goto out_no_pl08x; diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 935e3264ccec..e5b30a57c477 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1818,7 +1818,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - atslave = kmalloc_obj(*atslave, GFP_KERNEL); + atslave = kmalloc_obj(*atslave); if (!atslave) { put_device(&dmac_pdev->dev); return NULL; diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c index e1b259c781ca..432b43520ddc 100644 --- a/drivers/dma/bestcomm/bestcomm.c +++ b/drivers/dma/bestcomm/bestcomm.c @@ -393,7 +393,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op) } /* Get a clean struct */ - bcom_eng = kzalloc_obj(struct bcom_engine, GFP_KERNEL); + bcom_eng = kzalloc_obj(struct bcom_engine); if (!bcom_eng) { rv = -ENOMEM; goto error_sramclean; diff --git a/drivers/dma/bestcomm/sram.c b/drivers/dma/bestcomm/sram.c index c34639c30986..09ef5142c26c 100644 --- a/drivers/dma/bestcomm/sram.c +++ b/drivers/dma/bestcomm/sram.c @@ -48,7 +48,7 @@ int bcom_sram_init(struct device_node *sram_node, char *owner) return -EBUSY; } - bcom_sram = kmalloc_obj(struct bcom_sram, GFP_KERNEL); + bcom_sram = kmalloc_obj(struct bcom_sram); if (!bcom_sram) { printk(KERN_ERR "%s: bcom_sram_init: " "Couldn't allocate internal state !\n", owner); diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index b43a7b3a6a8d..27a8980b03dd 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -1075,7 +1075,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, chan->local = alloc_percpu(typeof(*chan->local)); if (!chan->local) return -ENOMEM; - chan->dev = kzalloc_obj(*chan->dev, GFP_KERNEL); + chan->dev = kzalloc_obj(*chan->dev); if (!chan->dev) { rc = -ENOMEM; goto err_free_local; diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 1a18b8985afc..df38681a1ff4 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -677,11 +677,11 @@ static int dmatest_func(void *data) set_user_nice(current, 10); - srcs = kzalloc_objs(dma_addr_t, src->cnt, GFP_KERNEL); + srcs = kzalloc_objs(dma_addr_t, src->cnt); if (!srcs) goto err_dst; - dma_pq = kzalloc_objs(dma_addr_t, dst->cnt, GFP_KERNEL); + dma_pq = kzalloc_objs(dma_addr_t, dst->cnt); if (!dma_pq) goto err_srcs_array; @@ -987,7 +987,7 @@ static int dmatest_add_threads(struct dmatest_info *info, return -EINVAL; for (i = 0; i < params->threads_per_chan; i++) { - thread = kzalloc_obj(struct dmatest_thread, GFP_KERNEL); + thread = kzalloc_obj(struct dmatest_thread); if (!thread) { pr_warn("No memory for %s-%s%u\n", dma_chan_name(chan), op, i); @@ -1025,7 +1025,7 @@ static int dmatest_add_channel(struct dmatest_info *info, unsigned int thread_count = 0; int cnt; - dtc = kmalloc_obj(struct dmatest_chan, GFP_KERNEL); + dtc = kmalloc_obj(struct dmatest_chan); if (!dtc) { pr_warn("No memory for %s\n", dma_chan_name(chan)); return -ENOMEM; diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index df599b563124..83230acaa597 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -167,7 +167,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, int i, mask; struct dw_edma_pcie_data *vsec_data __free(kfree) = - kmalloc_obj(*vsec_data, GFP_KERNEL); + kmalloc_obj(*vsec_data); if (!vsec_data) return -ENOMEM; diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c index b0b4ccae2c77..fb495ee6edfc 100644 --- a/drivers/dma/dw/rzn1-dmamux.c +++ b/drivers/dma/dw/rzn1-dmamux.c @@ -53,7 +53,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec, goto put_device; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { ret = -ENOMEM; goto put_device; diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 375f608c8266..8eceb96d058c 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -966,7 +966,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan) for (i = 0; i < DMA_MAX_CHAN_DESCRIPTORS; i++) { struct ep93xx_dma_desc *desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) { dev_warn(chan2dev(edmac), "not enough descriptors\n"); break; diff --git a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c index 206e6bdaf99d..bf771251264d 100644 --- a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +++ b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c @@ -353,7 +353,7 @@ static int __cold dpaa2_qdma_setup(struct fsl_mc_device *ls_dev) } priv->num_pairs = min(priv->dpdmai_attr.num_of_priorities, prio_def); - ppriv = kzalloc_objs(*ppriv, priv->num_pairs, GFP_KERNEL); + ppriv = kzalloc_objs(*ppriv, priv->num_pairs); if (!ppriv) { err = -ENOMEM; goto exit; @@ -659,7 +659,7 @@ static int dpaa2_qdma_probe(struct fsl_mc_device *dpdmai_dev) struct dpaa2_qdma_priv *priv; int err; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; dev_set_drvdata(dev, priv); @@ -707,7 +707,7 @@ static int dpaa2_qdma_probe(struct fsl_mc_device *dpdmai_dev) goto err_enable; } - dpaa2_qdma = kzalloc_obj(*dpaa2_qdma, GFP_KERNEL); + dpaa2_qdma = kzalloc_obj(*dpaa2_qdma); if (!dpaa2_qdma) { err = -ENOMEM; goto err_eng; diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index db863bf7b0e6..0bbff9df362f 100644 --- a/drivers/dma/fsl-qdma.c +++ b/drivers/dma/fsl-qdma.c @@ -406,7 +406,7 @@ static int fsl_qdma_pre_request_enqueue_desc(struct fsl_qdma_queue *queue) struct fsl_qdma_comp *comp_temp, *_comp_temp; for (i = 0; i < queue->n_cq + FSL_COMMAND_QUEUE_OVERFLLOW; i++) { - comp_temp = kzalloc_obj(*comp_temp, GFP_KERNEL); + comp_temp = kzalloc_obj(*comp_temp); if (!comp_temp) goto err_alloc; comp_temp->virt_addr = diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c index 5ba9a14bb78a..99945845d8b5 100644 --- a/drivers/dma/fsl_raid.c +++ b/drivers/dma/fsl_raid.c @@ -579,7 +579,7 @@ static int fsl_re_alloc_chan_resources(struct dma_chan *chan) re_chan = container_of(chan, struct fsl_re_chan, chan); for (i = 0; i < FSL_RE_MIN_DESCS; i++) { - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) break; diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 1525b6fe54b4..22d62d958abd 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -1111,7 +1111,7 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev, int err; /* alloc channel */ - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) { err = -ENOMEM; goto out_return; @@ -1218,7 +1218,7 @@ static int fsldma_of_probe(struct platform_device *op) unsigned int i; int err; - fdev = kzalloc_obj(*fdev, GFP_KERNEL); + fdev = kzalloc_obj(*fdev); if (!fdev) { err = -ENOMEM; goto out_return; diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c index 49fcc429d262..c37d233535f9 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -232,7 +232,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq)); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -538,7 +538,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq) struct idxd_cdev_context *cdev_ctx; int rc, minor; - idxd_cdev = kzalloc_obj(*idxd_cdev, GFP_KERNEL); + idxd_cdev = kzalloc_obj(*idxd_cdev); if (!idxd_cdev) return -ENOMEM; diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c index 976d8aaa4517..7782f8c51c32 100644 --- a/drivers/dma/idxd/irq.c +++ b/drivers/dma/idxd/irq.c @@ -567,7 +567,7 @@ bool idxd_queue_int_handle_resubmit(struct idxd_desc *desc) struct idxd_device *idxd = wq->idxd; struct idxd_resubmit *irw; - irw = kzalloc_obj(*irw, GFP_KERNEL); + irw = kzalloc_obj(*irw); if (!irw) return false; diff --git a/drivers/dma/idxd/perfmon.c b/drivers/dma/idxd/perfmon.c index 3283841d3ddc..f854bd31a4f5 100644 --- a/drivers/dma/idxd/perfmon.c +++ b/drivers/dma/idxd/perfmon.c @@ -128,7 +128,7 @@ static int perfmon_validate_group(struct idxd_pmu *pmu, struct idxd_pmu *fake_pmu; int i, ret = 0, n, idx; - fake_pmu = kzalloc_obj(*fake_pmu, GFP_KERNEL); + fake_pmu = kzalloc_obj(*fake_pmu); if (!fake_pmu) return -ENOMEM; @@ -484,7 +484,7 @@ int perfmon_pmu_init(struct idxd_device *idxd) if (idxd->perfmon_offset == 0) return -ENODEV; - idxd_pmu = kzalloc_obj(*idxd_pmu, GFP_KERNEL); + idxd_pmu = kzalloc_obj(*idxd_pmu); if (!idxd_pmu) return -ENOMEM; diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index d20c14f297a7..81c6276436f8 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -746,7 +746,7 @@ static int imxdma_alloc_chan_resources(struct dma_chan *chan) while (imxdmac->descs_allocated < IMXDMA_MAX_CHAN_DESCRIPTORS) { struct imxdma_desc *desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) break; dma_async_tx_descriptor_init(&desc->desc, chan); diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 4093fba9cc23..4c8196d78001 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2288,7 +2288,7 @@ static int sdma_probe(struct platform_device *pdev) sdma->irq = irq; - sdma->script_addrs = kzalloc_obj(*sdma->script_addrs, GFP_KERNEL); + sdma->script_addrs = kzalloc_obj(*sdma->script_addrs); if (!sdma->script_addrs) { ret = -ENOMEM; goto err_irq; diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index a4e539e48444..737496391109 100644 --- a/drivers/dma/ioat/init.c +++ b/drivers/dma/ioat/init.c @@ -574,7 +574,7 @@ static void ioat_enumerate_channels(struct ioatdma_device *ioat_dma) dev_dbg(dev, "%s: xfercap = %d\n", __func__, 1 << xfercap_log); for (i = 0; i < chancnt; i++) { - ioat_chan = kzalloc_obj(*ioat_chan, GFP_KERNEL); + ioat_chan = kzalloc_obj(*ioat_chan); if (!ioat_chan) break; @@ -1332,7 +1332,7 @@ static void release_ioatdma(struct dma_device *device) static struct ioatdma_device * alloc_ioatdma(struct pci_dev *pdev, void __iomem *iobase) { - struct ioatdma_device *d = kzalloc_obj(*d, GFP_KERNEL); + struct ioatdma_device *d = kzalloc_obj(*d); if (!d) return NULL; diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 37550b42c30e..0adc8e01057e 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -503,7 +503,7 @@ static int mpc_dma_alloc_chan_resources(struct dma_chan *chan) /* Alloc descriptors for this channel */ for (i = 0; i < MPC_DMA_DESCRIPTORS; i++) { - mdesc = kzalloc_obj(struct mpc_dma_desc, GFP_KERNEL); + mdesc = kzalloc_obj(struct mpc_dma_desc); if (!mdesc) { dev_notice(mdma->dma.dev, "Memory allocation error. Allocated only %u descriptors\n", i); diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index f4f65ef44234..25ed61f1b089 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c @@ -443,7 +443,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) /* Allocate descriptor slots */ idx = mv_chan->slots_allocated; while (idx < num_descs_in_pool) { - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) { dev_info(mv_chan_to_devp(mv_chan), "channel only initialized %d descriptor slots", diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index d27c74f1669b..53d11063a4f2 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -127,7 +127,7 @@ int of_dma_controller_register(struct device_node *np, return -EINVAL; } - ofdma = kzalloc_obj(*ofdma, GFP_KERNEL); + ofdma = kzalloc_obj(*ofdma); if (!ofdma) return -ENOMEM; @@ -194,7 +194,7 @@ int of_dma_router_register(struct device_node *np, return -EINVAL; } - ofdma = kzalloc_obj(*ofdma, GFP_KERNEL); + ofdma = kzalloc_obj(*ofdma); if (!ofdma) return -ENOMEM; diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index 69560dd8c365..e9fbfd5a3d51 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -806,7 +806,7 @@ static int pch_dma_probe(struct pci_dev *pdev, int i; nr_channels = id->driver_data; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return -ENOMEM; diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 996c259107e3..25ba84b18704 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1887,7 +1887,7 @@ static int dmac_alloc_threads(struct pl330_dmac *pl330) int i; /* Allocate 1 Manager and 'chans' Channel threads */ - pl330->channels = kzalloc_objs(*thrd, 1 + chans, GFP_KERNEL); + pl330->channels = kzalloc_objs(*thrd, 1 + chans); if (!pl330->channels) return -ENOMEM; @@ -3092,7 +3092,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) pl330->num_peripherals = num_chan; - pl330->peripherals = kzalloc_objs(*pch, num_chan, GFP_KERNEL); + pl330->peripherals = kzalloc_objs(*pch, num_chan); if (!pl330->peripherals) { ret = -ENOMEM; goto probe_err2; diff --git a/drivers/dma/plx_dma.c b/drivers/dma/plx_dma.c index 1958fa8f96e4..33354fc35a43 100644 --- a/drivers/dma/plx_dma.c +++ b/drivers/dma/plx_dma.c @@ -384,7 +384,7 @@ static int plx_dma_alloc_desc(struct plx_dma_dev *plxdev) return -ENOMEM; for (i = 0; i < PLX_DMA_RING_COUNT; i++) { - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) goto free_and_exit; @@ -501,7 +501,7 @@ static int plx_dma_create(struct pci_dev *pdev) struct dma_chan *chan; int rc; - plxdev = kzalloc_obj(*plxdev, GFP_KERNEL); + plxdev = kzalloc_obj(*plxdev); if (!plxdev) return -ENOMEM; diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index 7c08e80dcc4c..279a431ccae3 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -1781,7 +1781,7 @@ static int ppc440spe_adma_alloc_chan_resources(struct dma_chan *chan) db_sz = sizeof(struct xor_cb); for (; i < (ppc440spe_chan->device->pool_size / db_sz); i++) { - slot = kzalloc_obj(struct ppc440spe_adma_desc_slot, GFP_KERNEL); + slot = kzalloc_obj(struct ppc440spe_adma_desc_slot); if (!slot) { printk(KERN_INFO "SPE ADMA Channel only initialized" " %d descriptor slots", i--); @@ -4063,7 +4063,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) } /* create a device */ - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) { initcode = PPC_ADMA_INIT_ALLOC; ret = -ENOMEM; @@ -4123,7 +4123,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) platform_set_drvdata(ofdev, adev); /* create a channel */ - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) { initcode = PPC_ADMA_INIT_CHANNEL; ret = -ENOMEM; @@ -4160,7 +4160,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) PAGE_SIZE, DMA_BIDIRECTIONAL); } - ref = kmalloc_obj(*ref, GFP_KERNEL); + ref = kmalloc_obj(*ref); if (ref) { ref->chan = &chan->common; INIT_LIST_HEAD(&ref->node); diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index a48ba9fc9f49..fa2ee0b3e09f 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -342,7 +342,7 @@ static void pxad_init_debugfs(struct pxad_device *pdev) struct dentry *chandir; pdev->dbgfs_chan = - kmalloc_objs(struct dentry *, pdev->nr_chans, GFP_KERNEL); + kmalloc_objs(struct dentry *, pdev->nr_chans); if (!pdev->dbgfs_chan) return; diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index bcbdaf75db15..a6fa431530e3 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c @@ -848,7 +848,7 @@ static int sa11x0_dma_init_dmadev(struct dma_device *dmadev, for (i = 0; i < ARRAY_SIZE(chan_desc); i++) { struct sa11x0_dma_chan *c; - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) { dev_err(dev, "no memory for channel %u\n", i); return -ENOMEM; @@ -907,7 +907,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev) if (!res) return -ENXIO; - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 7f9b45c4553d..d84ca551b2bf 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -443,7 +443,7 @@ static int rz_dmac_alloc_chan_resources(struct dma_chan *chan) while (channel->descs_allocated < RZ_DMAC_MAX_CHAN_DESCRIPTORS) { struct rz_dmac_desc *desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) break; diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c index 59eab919a3e3..89a78e685b1d 100644 --- a/drivers/dma/sh/shdma-base.c +++ b/drivers/dma/sh/shdma-base.c @@ -740,7 +740,7 @@ static struct dma_async_tx_descriptor *shdma_prep_dma_cyclic( * Allocate the sg list dynamically as it would consume too much stack * space. */ - sgl = kmalloc_objs(*sgl, sg_len, GFP_KERNEL); + sgl = kmalloc_objs(*sgl, sg_len); if (!sgl) return NULL; @@ -1012,7 +1012,7 @@ int shdma_init(struct device *dev, struct shdma_dev *sdev, !sdev->ops->desc_completed) return -EINVAL; - sdev->schan = kzalloc_objs(*sdev->schan, chan_num, GFP_KERNEL); + sdev->schan = kzalloc_objs(*sdev->schan, chan_num); if (!sdev->schan) return -ENOMEM; diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c index 4abd5ba32969..57318715d9f3 100644 --- a/drivers/dma/stm32/stm32-dmamux.c +++ b/drivers/dma/stm32/stm32-dmamux.c @@ -104,7 +104,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec, goto err_put_pdev; } - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) { ret = -ENOMEM; goto err_put_pdev; diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c index cf1ceab10f14..f6d75ee94e8d 100644 --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -103,7 +103,7 @@ static void *ti_am335x_xbar_route_allocate(struct of_phandle_args *dma_spec, goto out_put_pdev; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { of_node_put(dma_spec->np); map = ERR_PTR(-ENOMEM); @@ -260,7 +260,7 @@ static void *ti_dra7_xbar_route_allocate(struct of_phandle_args *dma_spec, goto out_put_pdev; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { of_node_put(dma_spec->np); map = ERR_PTR(-ENOMEM); @@ -393,7 +393,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev) if (!nelm) return -EINVAL; - rsv_events = kzalloc_objs(*rsv_events, nelm, GFP_KERNEL); + rsv_events = kzalloc_objs(*rsv_events, nelm); if (!rsv_events) return -ENOMEM; diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index b547b19bc9d8..c964ebfcf3b6 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -4686,7 +4686,7 @@ static int udma_setup_resources(struct udma_dev *ud) irq_res.sets += rm_res->sets; } - irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets); if (!irq_res.desc) return -ENOMEM; rm_res = tisci_rm->rm_ranges[RM_RANGE_TCHAN]; @@ -4878,7 +4878,7 @@ static int bcdma_setup_resources(struct udma_dev *ud) } } - irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets); if (!irq_res.desc) return -ENOMEM; if (ud->bchan_cnt) { @@ -5080,7 +5080,7 @@ static int pktdma_setup_resources(struct udma_dev *ud) irq_res.sets += rm_res->sets; } - irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets, GFP_KERNEL); + irq_res.desc = kzalloc_objs(*irq_res.desc, irq_res.sets); if (!irq_res.desc) return -ENOMEM; rm_res = tisci_rm->rm_ranges[RM_RANGE_TFLOW]; diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index 70591c2bf92a..55ece7fd0d99 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -1503,7 +1503,7 @@ static int omap_dma_chan_init(struct omap_dmadev *od) { struct omap_chan *c; - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) return -ENOMEM; diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index 968f8cf19ec0..6f5a214954a5 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -325,7 +325,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan) struct timb_dma_desc *td_desc; int err; - td_desc = kzalloc_obj(struct timb_dma_desc, GFP_KERNEL); + td_desc = kzalloc_obj(struct timb_dma_desc); if (!td_desc) goto out; diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index cd41fbedd9fe..3f54754cdec4 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -205,7 +205,7 @@ dpll_xa_ref_pin_add(struct xarray *xa_pins, struct dpll_pin *pin, } if (!ref_exists) { - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) return -ENOMEM; ref->pin = pin; @@ -218,7 +218,7 @@ dpll_xa_ref_pin_add(struct xarray *xa_pins, struct dpll_pin *pin, refcount_set(&ref->refcount, 1); } - reg = kzalloc_obj(*reg, GFP_KERNEL); + reg = kzalloc_obj(*reg); if (!reg) { if (!ref_exists) { xa_erase(xa_pins, pin->pin_idx); @@ -286,7 +286,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll, } if (!ref_exists) { - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) return -ENOMEM; ref->dpll = dpll; @@ -299,7 +299,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll, refcount_set(&ref->refcount, 1); } - reg = kzalloc_obj(*reg, GFP_KERNEL); + reg = kzalloc_obj(*reg); if (!reg) { if (!ref_exists) { xa_erase(xa_dplls, dpll->id); @@ -360,7 +360,7 @@ dpll_device_alloc(const u64 clock_id, u32 device_idx, struct module *module) struct dpll_device *dpll; int ret; - dpll = kzalloc_obj(*dpll, GFP_KERNEL); + dpll = kzalloc_obj(*dpll); if (!dpll) return ERR_PTR(-ENOMEM); refcount_set(&dpll->refcount, 1); @@ -490,7 +490,7 @@ int dpll_device_register(struct dpll_device *dpll, enum dpll_type type, return -EEXIST; } - reg = kzalloc_obj(*reg, GFP_KERNEL); + reg = kzalloc_obj(*reg); if (!reg) { mutex_unlock(&dpll_lock); return -ENOMEM; @@ -644,7 +644,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module, } else if (pin_idx > INT_MAX) { return ERR_PTR(-EINVAL); } - pin = kzalloc_obj(*pin, GFP_KERNEL); + pin = kzalloc_obj(*pin); if (!pin) { ret = -ENOMEM; goto err_pin_alloc; diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c index e532fedf0d36..d33175d192c8 100644 --- a/drivers/dpll/zl3073x/dpll.c +++ b/drivers/dpll/zl3073x/dpll.c @@ -1372,7 +1372,7 @@ zl3073x_dpll_pin_alloc(struct zl3073x_dpll *zldpll, enum dpll_pin_direction dir, { struct zl3073x_dpll_pin *pin; - pin = kzalloc_obj(*pin, GFP_KERNEL); + pin = kzalloc_obj(*pin); if (!pin) return ERR_PTR(-ENOMEM); @@ -1944,7 +1944,7 @@ zl3073x_dpll_alloc(struct zl3073x_dev *zldev, u8 ch) { struct zl3073x_dpll *zldpll; - zldpll = kzalloc_obj(*zldpll, GFP_KERNEL); + zldpll = kzalloc_obj(*zldpll); if (!zldpll) return ERR_PTR(-ENOMEM); diff --git a/drivers/dpll/zl3073x/fw.c b/drivers/dpll/zl3073x/fw.c index 56b4eeadf4e3..3acbb33ed7b8 100644 --- a/drivers/dpll/zl3073x/fw.c +++ b/drivers/dpll/zl3073x/fw.c @@ -129,7 +129,7 @@ zl3073x_fw_component_alloc(size_t size) { struct zl3073x_fw_component *comp; - comp = kzalloc_obj(*comp, GFP_KERNEL); + comp = kzalloc_obj(*comp); if (!comp) return NULL; @@ -313,7 +313,7 @@ struct zl3073x_fw *zl3073x_fw_load(struct zl3073x_dev *zldev, const char *data, ssize_t rc; /* Allocate firmware structure */ - fw = kzalloc_obj(*fw, GFP_KERNEL); + fw = kzalloc_obj(*fw); if (!fw) return ERR_PTR(-ENOMEM); diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c index 36b843f17156..ac9d41d0f978 100644 --- a/drivers/dpll/zl3073x/prop.c +++ b/drivers/dpll/zl3073x/prop.c @@ -198,7 +198,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, const char *type; u32 curr_freq; - props = kzalloc_obj(*props, GFP_KERNEL); + props = kzalloc_obj(*props); if (!props) return ERR_PTR(-ENOMEM); @@ -289,7 +289,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, skip_fwnode_props: /* Allocate frequency ranges list - extra slot for current frequency */ - ranges = kzalloc_objs(*ranges, num_freqs + 1, GFP_KERNEL); + ranges = kzalloc_objs(*ranges, num_freqs + 1); if (!ranges) { rc = -ENOMEM; goto err_alloc_ranges; diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 183357b9f99a..8908ab881c85 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3485,7 +3485,7 @@ static int dct_hw_info_get(struct amd64_pvt *pvt) static int umc_hw_info_get(struct amd64_pvt *pvt) { - pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs, GFP_KERNEL); + pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs); if (!pvt->umc) return -ENOMEM; @@ -3716,7 +3716,7 @@ static int gpu_hw_info_get(struct amd64_pvt *pvt) if (ret) return ret; - pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs, GFP_KERNEL); + pvt->umc = kzalloc_objs(struct amd64_umc, pvt->max_mcs); if (!pvt->umc) return -ENOMEM; @@ -3916,7 +3916,7 @@ static int per_family_init(struct amd64_pvt *pvt) scnprintf(pvt->ctl_name, sizeof(pvt->ctl_name), "F%02Xh_M%02Xh", pvt->fam, pvt->model); - pvt->csels = kzalloc_objs(*pvt->csels, pvt->max_mcs, GFP_KERNEL); + pvt->csels = kzalloc_objs(*pvt->csels, pvt->max_mcs); if (!pvt->csels) return -ENOMEM; @@ -4000,13 +4000,13 @@ static int probe_one_instance(unsigned int nid) int ret; ret = -ENOMEM; - s = kzalloc_obj(struct ecc_settings, GFP_KERNEL); + s = kzalloc_obj(struct ecc_settings); if (!s) goto err_out; ecc_stngs[nid] = s; - pvt = kzalloc_obj(struct amd64_pvt, GFP_KERNEL); + pvt = kzalloc_obj(struct amd64_pvt); if (!pvt) goto err_settings; @@ -4146,7 +4146,7 @@ static int __init amd64_edac_init(void) opstate_init(); err = -ENOMEM; - ecc_stngs = kzalloc_objs(ecc_stngs[0], amd_nb_num(), GFP_KERNEL); + ecc_stngs = kzalloc_objs(ecc_stngs[0], amd_nb_num()); if (!ecc_stngs) goto err_free; diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 6bb6e4d435a4..4ff421b518ce 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -67,7 +67,7 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance edac_dbg(4, "instances=%d blocks=%d\n", nr_instances, nr_blocks); - dev_ctl = kzalloc_obj(struct edac_device_ctl_info, GFP_KERNEL); + dev_ctl = kzalloc_obj(struct edac_device_ctl_info); if (!dev_ctl) return NULL; @@ -644,7 +644,7 @@ int edac_dev_register(struct device *parent, char *name, } } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -654,7 +654,7 @@ int edac_dev_register(struct device *parent, char *name, goto ctx_free; if (scrub_cnt) { - ctx->scrub = kzalloc_objs(*ctx->scrub, scrub_cnt, GFP_KERNEL); + ctx->scrub = kzalloc_objs(*ctx->scrub, scrub_cnt); if (!ctx->scrub) goto groups_free; } diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 2d74438837f4..47bd26f5086a 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -216,14 +216,14 @@ static int edac_mc_alloc_csrows(struct mem_ctl_info *mci) /* * Allocate and fill the csrow/channels structs */ - mci->csrows = kzalloc_objs(*mci->csrows, tot_csrows, GFP_KERNEL); + mci->csrows = kzalloc_objs(*mci->csrows, tot_csrows); if (!mci->csrows) return -ENOMEM; for (row = 0; row < tot_csrows; row++) { struct csrow_info *csr; - csr = kzalloc_obj(**mci->csrows, GFP_KERNEL); + csr = kzalloc_obj(**mci->csrows); if (!csr) return -ENOMEM; @@ -239,7 +239,7 @@ static int edac_mc_alloc_csrows(struct mem_ctl_info *mci) for (chn = 0; chn < tot_channels; chn++) { struct rank_info *chan; - chan = kzalloc_obj(**csr->channels, GFP_KERNEL); + chan = kzalloc_obj(**csr->channels); if (!chan) return -ENOMEM; @@ -262,7 +262,7 @@ static int edac_mc_alloc_dimms(struct mem_ctl_info *mci) /* * Allocate and fill the dimm structs */ - mci->dimms = kzalloc_objs(*mci->dimms, mci->tot_dimms, GFP_KERNEL); + mci->dimms = kzalloc_objs(*mci->dimms, mci->tot_dimms); if (!mci->dimms) return -ENOMEM; @@ -276,7 +276,7 @@ static int edac_mc_alloc_dimms(struct mem_ctl_info *mci) chan = mci->csrows[row]->channels[chn]; - dimm = kzalloc_obj(**mci->dimms, GFP_KERNEL); + dimm = kzalloc_obj(**mci->dimms); if (!dimm) return -ENOMEM; mci->dimms[idx] = dimm; @@ -362,11 +362,11 @@ struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num, per_rank = true; } - mci = kzalloc_obj(struct mem_ctl_info, GFP_KERNEL); + mci = kzalloc_obj(struct mem_ctl_info); if (!mci) return NULL; - mci->layers = kzalloc_objs(struct edac_mc_layer, n_layers, GFP_KERNEL); + mci->layers = kzalloc_objs(struct edac_mc_layer, n_layers); if (!mci->layers) goto error; diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 629158cd505c..c2ed6c696e54 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -648,7 +648,7 @@ int __init edac_mc_sysfs_init(void) { int err; - mci_pdev = kzalloc_obj(*mci_pdev, GFP_KERNEL); + mci_pdev = kzalloc_obj(*mci_pdev); if (!mci_pdev) return -ENOMEM; diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index c1c9dc6ffa2f..327994a95073 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c @@ -32,7 +32,7 @@ struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, edac_dbg(1, "\n"); - pci = kzalloc_obj(struct edac_pci_ctl_info, GFP_KERNEL); + pci = kzalloc_obj(struct edac_pci_ctl_info); if (!pci) return NULL; diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index f1b0f3ba7f72..446fef0a9399 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c @@ -361,7 +361,7 @@ static int edac_pci_main_kobj_setup(void) goto decrement_count_fail; } - edac_pci_top_main_kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + edac_pci_top_main_kobj = kzalloc_obj(struct kobject); if (!edac_pci_top_main_kobj) { edac_dbg(1, "Failed to allocate\n"); err = -ENOMEM; diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index dd1a5e575230..5a8cd90b39a7 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -455,7 +455,7 @@ static struct i7core_dev *alloc_i7core_dev(u8 socket, { struct i7core_dev *i7core_dev; - i7core_dev = kzalloc_obj(*i7core_dev, GFP_KERNEL); + i7core_dev = kzalloc_obj(*i7core_dev); if (!i7core_dev) return NULL; @@ -1159,7 +1159,7 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) struct i7core_pvt *pvt = mci->pvt_info; int rc; - pvt->addrmatch_dev = kzalloc_obj(*pvt->addrmatch_dev, GFP_KERNEL); + pvt->addrmatch_dev = kzalloc_obj(*pvt->addrmatch_dev); if (!pvt->addrmatch_dev) return -ENOMEM; diff --git a/drivers/edac/igen6_edac.c b/drivers/edac/igen6_edac.c index fa1cabfe6909..fcb8ab44cba5 100644 --- a/drivers/edac/igen6_edac.c +++ b/drivers/edac/igen6_edac.c @@ -1549,7 +1549,7 @@ static int igen6_probe(struct pci_dev *pdev, const struct pci_device_id *ent) edac_dbg(2, "\n"); - igen6_pvt = kzalloc_obj(*igen6_pvt, GFP_KERNEL); + igen6_pvt = kzalloc_obj(*igen6_pvt); if (!igen6_pvt) return -ENOMEM; diff --git a/drivers/edac/imh_base.c b/drivers/edac/imh_base.c index a37be2372764..722573a2729a 100644 --- a/drivers/edac/imh_base.c +++ b/drivers/edac/imh_base.c @@ -171,7 +171,7 @@ static int __get_ddr_munits(struct res_config *cfg, struct skx_dev *d, d->imc[lmc].lmc = lmc; /* Create the imc device instance. */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 79fc3ace6a10..fc434739b3c3 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -771,7 +771,7 @@ static struct sbridge_dev *alloc_sbridge_dev(int seg, u8 bus, enum domain dom, { struct sbridge_dev *sbridge_dev; - sbridge_dev = kzalloc_obj(*sbridge_dev, GFP_KERNEL); + sbridge_dev = kzalloc_obj(*sbridge_dev); if (!sbridge_dev) return NULL; diff --git a/drivers/edac/versalnet_edac.c b/drivers/edac/versalnet_edac.c index 3cc885fa384c..2cbc13d9bd00 100644 --- a/drivers/edac/versalnet_edac.c +++ b/drivers/edac/versalnet_edac.c @@ -559,7 +559,7 @@ static int setup_mcdi(struct mc_priv *mc_priv) struct cdx_mcdi *amd_mcdi; int ret, i; - amd_mcdi = kzalloc_obj(*amd_mcdi, GFP_KERNEL); + amd_mcdi = kzalloc_obj(*amd_mcdi); if (!amd_mcdi) return -ENOMEM; @@ -812,7 +812,7 @@ static int init_versalnet(struct mc_priv *priv, struct platform_device *pdev) priv->mci[i] = mci; priv->dwidth = dt; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); dev->release = versal_edac_release; name = kmalloc(32, GFP_KERNEL); sprintf(name, "versal-net-ddrmc5-edac-%d", i); diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c index ffabe1bf4c13..79ab44fe26aa 100644 --- a/drivers/eisa/eisa-bus.c +++ b/drivers/eisa/eisa-bus.c @@ -317,7 +317,7 @@ static int __init eisa_probe(struct eisa_root_device *root) /* First try to get hold of slot 0. If there is no device * here, simply fail, unless root->force_probe is set. */ - edev = kzalloc_obj(*edev, GFP_KERNEL); + edev = kzalloc_obj(*edev); if (!edev) return -ENOMEM; @@ -350,7 +350,7 @@ static int __init eisa_probe(struct eisa_root_device *root) force_probe: for (c = 0, i = 1; i <= root->slots; i++) { - edev = kzalloc_obj(*edev, GFP_KERNEL); + edev = kzalloc_obj(*edev); if (!edev) { dev_err(root->dev, "EISA: Out of memory for slot %d\n", i); diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 8fc412ad3cf2..b5d32236da68 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1060,7 +1060,7 @@ struct extcon_dev *extcon_dev_allocate(const unsigned int *supported_cable) if (!supported_cable) return ERR_PTR(-EINVAL); - edev = kzalloc_obj(*edev, GFP_KERNEL); + edev = kzalloc_obj(*edev); if (!edev) return ERR_PTR(-ENOMEM); diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 6d1a59e33d2e..c9b67bc720be 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -291,7 +291,7 @@ static int fw_device_op_open(struct inode *inode, struct file *file) return -ENODEV; } - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (client == NULL) { fw_device_put(device); return -ENOMEM; @@ -412,7 +412,7 @@ static void queue_bus_reset_event(struct client *client) struct client_resource *resource; unsigned long index; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (e == NULL) return; @@ -837,7 +837,7 @@ static int ioctl_allocate(struct client *client, union ioctl_arg *arg) struct fw_address_region region; int ret; - r = kmalloc_obj(*r, GFP_KERNEL); + r = kmalloc_obj(*r); if (r == NULL) return -ENOMEM; @@ -1006,7 +1006,7 @@ static void iso_mc_callback(struct fw_iso_context *context, struct client *client = data; struct iso_interrupt_mc_event *e; - e = kmalloc_obj(*e, GFP_KERNEL); + e = kmalloc_obj(*e); if (e == NULL) return; @@ -1409,9 +1409,9 @@ static int init_iso_resource(struct client *client, request->bandwidth > BANDWIDTH_AVAILABLE_INITIAL) return -EINVAL; - r = kmalloc_obj(*r, GFP_KERNEL); - e1 = kmalloc_obj(*e1, GFP_KERNEL); - e2 = kmalloc_obj(*e2, GFP_KERNEL); + r = kmalloc_obj(*r); + e1 = kmalloc_obj(*e1); + e2 = kmalloc_obj(*e2); if (r == NULL || e1 == NULL || e2 == NULL) { ret = -ENOMEM; goto fail; diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 3281f6c6bedb..c0f17da27a22 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -849,7 +849,7 @@ static void create_units(struct fw_device *device) * Get the address of the unit directory and try to * match the drivers id_tables against it. */ - unit = kzalloc_obj(*unit, GFP_KERNEL); + unit = kzalloc_obj(*unit); if (unit == NULL) continue; diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index b9f01e871fe3..f1a2bee39bf1 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1402,7 +1402,7 @@ static int fwnet_add_peer(struct fwnet_device *dev, { struct fwnet_peer *peer; - peer = kmalloc_obj(*peer, GFP_KERNEL); + peer = kmalloc_obj(*peer); if (!peer) return -ENOMEM; diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index 547d560f353f..900b7d904b41 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c @@ -281,7 +281,7 @@ nosy_open(struct inode *inode, struct file *file) if (lynx == NULL) return -ENODEV; - client = kmalloc_obj(*client, GFP_KERNEL); + client = kmalloc_obj(*client); if (client == NULL) goto fail; @@ -545,7 +545,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) } pci_set_master(dev); - lynx = kzalloc_obj(*lynx, GFP_KERNEL); + lynx = kzalloc_obj(*lynx); if (lynx == NULL) { dev_err(&dev->dev, "Failed to allocate control structure\n"); ret = -ENOMEM; diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 89e0873501f5..021b8f698e34 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -966,7 +966,7 @@ static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) { struct sbp2_logical_unit *lu; - lu = kmalloc_obj(*lu, GFP_KERNEL); + lu = kmalloc_obj(*lu); if (!lu) return -ENOMEM; diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index fbd9af875a69..9576862d89c4 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -203,7 +203,7 @@ ffa_device_register(const struct ffa_partition_info *part_info, if (id < 0) return NULL; - ffa_dev = kzalloc_obj(*ffa_dev, GFP_KERNEL); + ffa_dev = kzalloc_obj(*ffa_dev); if (!ffa_dev) { ida_free(&ffa_bus_id, id); return NULL; diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 8962212ad218..12a625387d6e 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -410,7 +410,7 @@ ffa_partition_probe(const uuid_t *uuid, struct ffa_partition_info **buffer) if (count <= 0) return count; - pbuf = kzalloc_objs(*pbuf, count, GFP_KERNEL); + pbuf = kzalloc_objs(*pbuf, count); if (!pbuf) return -ENOMEM; @@ -1376,7 +1376,7 @@ static int __ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu, if (notify_id >= FFA_MAX_NOTIFICATIONS) return -EINVAL; - cb_info = kzalloc_obj(*cb_info, GFP_KERNEL); + cb_info = kzalloc_obj(*cb_info); if (!cb_info) return -ENOMEM; @@ -1647,7 +1647,7 @@ static int ffa_xa_add_partition_info(struct ffa_device *dev) } } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ret; @@ -1655,7 +1655,7 @@ static int ffa_xa_add_partition_info(struct ffa_device *dev) info->dev = dev; if (!phead) { - phead = kzalloc_obj(*phead, GFP_KERNEL); + phead = kzalloc_obj(*phead); if (!phead) goto free_out; @@ -2039,7 +2039,7 @@ static int __init ffa_init(void) if (ret) return ret; - drv_info = kzalloc_obj(*drv_info, GFP_KERNEL); + drv_info = kzalloc_obj(*drv_info); if (!drv_info) return -ENOMEM; diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 49a168c5ff85..793be9eabaed 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -90,7 +90,7 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table) * No duplicate found for requested id_table, so let's create a new * requested device entry for this new valid request. */ - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) { ret = -ENOMEM; goto out; @@ -103,7 +103,7 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table) * there. */ if (!phead) { - phead = kzalloc_obj(*phead, GFP_KERNEL); + phead = kzalloc_obj(*phead); if (!phead) { kfree(rdev); ret = -ENOMEM; @@ -445,7 +445,7 @@ __scmi_device_create(struct device_node *np, struct device *parent, return NULL; } - scmi_dev = kzalloc_obj(*scmi_dev, GFP_KERNEL); + scmi_dev = kzalloc_obj(*scmi_dev); if (!scmi_dev) return NULL; diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c index d2a6390cbc5c..9168794adae4 100644 --- a/drivers/firmware/arm_scmi/notify.c +++ b/drivers/firmware/arm_scmi/notify.c @@ -897,7 +897,7 @@ scmi_allocate_event_handler(struct scmi_notify_instance *ni, u32 evt_key) { struct scmi_event_handler *hndl; - hndl = kzalloc_obj(*hndl, GFP_KERNEL); + hndl = kzalloc_obj(*hndl); if (!hndl) return NULL; hndl->key = evt_key; diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 99a4a70cf117..1f6e51670208 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -908,7 +908,7 @@ static int scmi_dbg_raw_mode_open(struct inode *inode, struct file *filp) return -ENODEV; raw = inode->i_private; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 70a1697a1e6b..00e74449ce09 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -633,14 +633,14 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain) if (!buf.opp_count) return ERR_PTR(-ENOENT); - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); info->count = buf.opp_count; info->latency = le16_to_cpu(buf.latency) * 1000; /* uS to nS */ - info->opps = kzalloc_objs(*opp, info->count, GFP_KERNEL); + info->opps = kzalloc_objs(*opp, info->count); if (!info->opps) { kfree(info); return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index c8d737e754e6..f39ed7ba3a38 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -205,7 +205,7 @@ static struct sdei_event *sdei_event_create(u32 event_num, lockdep_assert_held(&sdei_events_lock); - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) { err = -ENOMEM; goto fail; @@ -227,7 +227,7 @@ static struct sdei_event *sdei_event_create(u32 event_num, event->type = result; if (event->type == SDEI_EVENT_TYPE_SHARED) { - reg = kzalloc_obj(*reg, GFP_KERNEL); + reg = kzalloc_obj(*reg); if (!reg) { err = -ENOMEM; goto fail; diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c index 148d31eea977..b4f1c01e3b5b 100644 --- a/drivers/firmware/cirrus/cs_dsp.c +++ b/drivers/firmware/cirrus/cs_dsp.c @@ -1059,7 +1059,7 @@ static int cs_dsp_create_control(struct cs_dsp *dsp, } } - ctl = kzalloc_obj(*ctl, GFP_KERNEL); + ctl = kzalloc_obj(*ctl); if (!ctl) return -ENOMEM; @@ -1781,7 +1781,7 @@ static struct cs_dsp_alg_region *cs_dsp_create_region(struct cs_dsp *dsp, { struct cs_dsp_alg_region_list_item *item; - item = kzalloc_obj(*item, GFP_KERNEL); + item = kzalloc_obj(*item); if (!item) return ERR_PTR(-ENOMEM); diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index dddddfbc479d..477a37e2ef80 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -237,7 +237,7 @@ static int __init dmi_id_init(void) if (ret) return ret; - dmi_dev = kzalloc_obj(*dmi_dev, GFP_KERNEL); + dmi_dev = kzalloc_obj(*dmi_dev); if (!dmi_dev) { ret = -ENOMEM; goto fail_class_unregister; diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index 4424ad075aff..cda53d037715 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -451,7 +451,7 @@ static int dmi_system_event_log(struct dmi_sysfs_entry *entry) { int ret; - entry->child = kzalloc_obj(*entry->child, GFP_KERNEL); + entry->child = kzalloc_obj(*entry->child); if (!entry->child) return -ENOMEM; ret = kobject_init_and_add(entry->child, @@ -586,7 +586,7 @@ static void __init dmi_sysfs_register_handle(const struct dmi_header *dh, return; /* Allocate and register a new entry into the entries set */ - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { *ret = -ENOMEM; return; diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 631fbd3ea60c..f980c5b56858 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c @@ -740,7 +740,7 @@ edd_init(void) return -ENOMEM; for (i = 0; i < edd_num_devices(); i++) { - edev = kzalloc_obj(*edev, GFP_KERNEL); + edev = kzalloc_obj(*edev); if (!edev) { rc = -ENOMEM; goto out; diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 35b69e629d6d..3167cab62014 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -113,7 +113,7 @@ static int __init arm_enable_runtime_services(void) if (!(md->attribute & EFI_MEMORY_SP)) continue; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (WARN_ON(!res)) break; diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c index 609637f88acc..2c628a127091 100644 --- a/drivers/firmware/efi/capsule-loader.c +++ b/drivers/firmware/efi/capsule-loader.c @@ -282,7 +282,7 @@ static int efi_capsule_open(struct inode *inode, struct file *file) { struct capsule_info *cap_info; - cap_info = kzalloc_obj(*cap_info, GFP_KERNEL); + cap_info = kzalloc_obj(*cap_info); if (!cap_info) return -ENOMEM; @@ -292,7 +292,7 @@ static int efi_capsule_open(struct inode *inode, struct file *file) return -ENOMEM; } - cap_info->phys = kzalloc_obj(phys_addr_t, GFP_KERNEL); + cap_info->phys = kzalloc_obj(phys_addr_t); if (!cap_info->phys) { kfree(cap_info->pages); kfree(cap_info); diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c index dbbff6ade4e3..dd62526380d2 100644 --- a/drivers/firmware/efi/capsule.c +++ b/drivers/firmware/efi/capsule.c @@ -230,7 +230,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages) count = DIV_ROUND_UP(imagesize, PAGE_SIZE); sg_count = sg_pages_num(count); - sg_pages = kzalloc_objs(*sg_pages, sg_count, GFP_KERNEL); + sg_pages = kzalloc_objs(*sg_pages, sg_count); if (!sg_pages) return -ENOMEM; diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 99268c14e01e..345a10aa7086 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -47,7 +47,7 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier, if (ret || !data) return NOTIFY_DONE; - wdata = kmalloc_objs(efi_char16_t, MAX_DATA_LEN, GFP_KERNEL); + wdata = kmalloc_objs(efi_char16_t, MAX_DATA_LEN); if (!wdata) return NOTIFY_DONE; diff --git a/drivers/firmware/efi/embedded-firmware.c b/drivers/firmware/efi/embedded-firmware.c index e750ef2b57e8..82744b6a5582 100644 --- a/drivers/firmware/efi/embedded-firmware.c +++ b/drivers/firmware/efi/embedded-firmware.c @@ -64,7 +64,7 @@ static int __init efi_check_md_for_embedded_firmware( pr_info("Found EFI embedded fw '%s'\n", desc->name); - fw = kmalloc_obj(*fw, GFP_KERNEL); + fw = kmalloc_obj(*fw); if (!fw) { memunmap(map); return -ENOMEM; diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index 74f38a2df8d7..df148f7331f4 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -164,7 +164,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num) { struct esre_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c index 78afd0fa2919..4ff0c2926097 100644 --- a/drivers/firmware/efi/mokvar-table.c +++ b/drivers/firmware/efi/mokvar-table.c @@ -329,7 +329,7 @@ static int __init efi_mokvar_sysfs_init(void) } while (efi_mokvar_entry_next(&mokvar_entry)) { - mokvar_sysfs = kzalloc_obj(*mokvar_sysfs, GFP_KERNEL); + mokvar_sysfs = kzalloc_obj(*mokvar_sysfs); if (!mokvar_sysfs) { err = -ENOMEM; break; diff --git a/drivers/firmware/efi/riscv-runtime.c b/drivers/firmware/efi/riscv-runtime.c index ee799399da62..60cdf7bf141f 100644 --- a/drivers/firmware/efi/riscv-runtime.c +++ b/drivers/firmware/efi/riscv-runtime.c @@ -83,7 +83,7 @@ static int __init riscv_enable_runtime_services(void) if (!(md->attribute & EFI_MEMORY_SP)) continue; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (WARN_ON(!res)) break; diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index a142ce5c7288..e21e7408cc6d 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -153,7 +153,7 @@ static struct gsmi_buf *gsmi_buf_alloc(void) { struct gsmi_buf *smibuf; - smibuf = kzalloc_obj(*smibuf, GFP_KERNEL); + smibuf = kzalloc_obj(*smibuf); if (!smibuf) { printk(KERN_ERR "gsmi: out of memory\n"); return NULL; diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c index 721dfa756c45..54349e579b0d 100644 --- a/drivers/firmware/google/vpd.c +++ b/drivers/firmware/google/vpd.c @@ -107,7 +107,7 @@ static int vpd_section_attrib_add(const u8 *key, u32 key_len, if (vpd_section_check_key_name(key, key_len) != VPD_OK) return VPD_OK; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 1af5a9ef4474..e457b6049e83 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -634,7 +634,7 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header, struct pci_dev *pci_dev; int rc = 0; - ibft_kobj = kzalloc_obj(*ibft_kobj, GFP_KERNEL); + ibft_kobj = kzalloc_obj(*ibft_kobj); if (!ibft_kobj) return -ENOMEM; @@ -773,7 +773,7 @@ static int __init ibft_register_kobjects(struct acpi_table_ibft *header) if (rc) return rc; - ibft_kobj = kzalloc_obj(*ibft_kobj, GFP_KERNEL); + ibft_kobj = kzalloc_obj(*ibft_kobj); if (!ibft_kobj) return -ENOMEM; diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index 5fa85af40c33..46b19d803446 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -162,9 +162,9 @@ static int mpfs_auto_update_verify_image(struct fw_upload *fw_uploader) u32 *response_msg __free(kfree) = kzalloc(AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); struct mpfs_mss_response *response __free(kfree) = - kzalloc_obj(struct mpfs_mss_response, GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_response); struct mpfs_mss_msg *message __free(kfree) = - kzalloc_obj(struct mpfs_mss_msg, GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_msg); int ret; if (!response_msg || !response || !message) @@ -364,9 +364,9 @@ static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv) u32 *response_msg __free(kfree) = kzalloc(AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); struct mpfs_mss_response *response __free(kfree) = - kzalloc_obj(struct mpfs_mss_response, GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_response); struct mpfs_mss_msg *message __free(kfree) = - kzalloc_obj(struct mpfs_mss_msg, GFP_KERNEL); + kzalloc_obj(struct mpfs_mss_msg); int ret; if (!response_msg || !response || !message) diff --git a/drivers/firmware/psci/psci_checker.c b/drivers/firmware/psci/psci_checker.c index 2aaf3519cdfb..e67ba9891082 100644 --- a/drivers/firmware/psci/psci_checker.c +++ b/drivers/firmware/psci/psci_checker.c @@ -155,7 +155,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) return -ENOMEM; - cpu_groups = kzalloc_objs(*cpu_groups, nb_available_cpus, GFP_KERNEL); + cpu_groups = kzalloc_objs(*cpu_groups, nb_available_cpus); if (!cpu_groups) { free_cpumask_var(tmp); return -ENOMEM; @@ -369,7 +369,7 @@ static int suspend_tests(void) struct task_struct **threads; int nb_threads = 0; - threads = kmalloc_objs(*threads, nb_available_cpus, GFP_KERNEL); + threads = kmalloc_objs(*threads, nb_available_cpus); if (!threads) return -ENOMEM; diff --git a/drivers/firmware/qcom/qcom_qseecom.c b/drivers/firmware/qcom/qcom_qseecom.c index 7eed43fc8174..320ec2a77524 100644 --- a/drivers/firmware/qcom/qcom_qseecom.c +++ b/drivers/firmware/qcom/qcom_qseecom.c @@ -50,7 +50,7 @@ static int qseecom_client_register(struct platform_device *qseecom_dev, dev_info(&qseecom_dev->dev, "setting up client for %s\n", desc->app_name); /* Allocate and set-up the client device */ - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 50224b95d22b..87a5421bc7d5 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -94,7 +94,7 @@ static ssize_t fw_cfg_dma_transfer(void *address, u32 length, u32 control) struct fw_cfg_dma_access *d = NULL; ssize_t ret = length; - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { ret = -ENOMEM; goto end; @@ -325,7 +325,7 @@ static ssize_t fw_cfg_write_vmcoreinfo(const struct fw_cfg_file *f) static struct fw_cfg_vmcoreinfo *data; ssize_t ret; - data = kmalloc_obj(struct fw_cfg_vmcoreinfo, GFP_KERNEL); + data = kmalloc_obj(struct fw_cfg_vmcoreinfo); if (!data) return -ENOMEM; @@ -530,7 +530,7 @@ static int fw_cfg_build_symlink(struct kset *dir, dir = to_kset(ko); } else { /* create new subdirectory kset */ - subdir = kzalloc_obj(struct kset, GFP_KERNEL); + subdir = kzalloc_obj(struct kset); if (!subdir) { ret = -ENOMEM; break; @@ -593,7 +593,7 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) #endif /* allocate new entry */ - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index 3b45bb74d312..0aa322e9a2e7 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -282,7 +282,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) * Memory will be freed by rpi_firmware_delete() once all users have * released their firmware handles. Don't use devm_kzalloc() here. */ - fw = kzalloc_obj(*fw, GFP_KERNEL); + fw = kzalloc_obj(*fw); if (!fw) return -ENOMEM; diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c index 95f9163058bb..2f7475e66b3c 100644 --- a/drivers/firmware/smccc/soc_id.c +++ b/drivers/firmware/smccc/soc_id.c @@ -137,7 +137,7 @@ static int __init smccc_soc_init(void) return -EINVAL; } - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index aefb28933990..6f5c298582ab 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -535,11 +535,11 @@ static int svc_normal_to_secure_thread(void *data) unsigned long a0, a1, a2, a3, a4, a5, a6, a7; int ret_fifo = 0; - pdata = kmalloc_obj(*pdata, GFP_KERNEL); + pdata = kmalloc_obj(*pdata); if (!pdata) return -ENOMEM; - cbdata = kmalloc_obj(*cbdata, GFP_KERNEL); + cbdata = kmalloc_obj(*cbdata); if (!cbdata) { kfree(pdata); return -ENOMEM; @@ -1119,7 +1119,7 @@ int stratix10_svc_add_async_client(struct stratix10_svc_chan *chan, return 0; } - achan = kzalloc_obj(*achan, GFP_KERNEL); + achan = kzalloc_obj(*achan); if (!achan) return -ENOMEM; @@ -1692,7 +1692,7 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg) int ret = 0; unsigned int cpu = 0; - p_data = kzalloc_obj(*p_data, GFP_KERNEL); + p_data = kzalloc_obj(*p_data); if (!p_data) return -ENOMEM; diff --git a/drivers/firmware/thead,th1520-aon.c b/drivers/firmware/thead,th1520-aon.c index 7dc871060c38..a35fd5e2a07f 100644 --- a/drivers/firmware/thead,th1520-aon.c +++ b/drivers/firmware/thead,th1520-aon.c @@ -205,7 +205,7 @@ struct th1520_aon_chan *th1520_aon_init(struct device *dev) struct mbox_client *cl; int ret; - aon_chan = kzalloc_obj(*aon_chan, GFP_KERNEL); + aon_chan = kzalloc_obj(*aon_chan); if (!aon_chan) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c index c71a93d8aee3..87652d58d03f 100644 --- a/drivers/fpga/dfl-afu-dma-region.c +++ b/drivers/fpga/dfl-afu-dma-region.c @@ -42,7 +42,7 @@ static int afu_dma_pin_pages(struct dfl_feature_dev_data *fdata, if (ret) return ret; - region->pages = kzalloc_objs(struct page *, npages, GFP_KERNEL); + region->pages = kzalloc_objs(struct page *, npages); if (!region->pages) { ret = -ENOMEM; goto unlock_vm; diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c index 3e560e5d7241..e25205c6d8f0 100644 --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -139,7 +139,7 @@ static int *cci_pci_create_irq_table(struct pci_dev *pcidev, unsigned int nvec) unsigned int i; int *table; - table = kzalloc_objs(int, nvec, GFP_KERNEL); + table = kzalloc_objs(int, nvec); if (!table) return table; diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c index d26003d3c931..138fefd7f7f8 100644 --- a/drivers/fpga/dfl.c +++ b/drivers/fpga/dfl.c @@ -347,7 +347,7 @@ dfl_dev_add(struct dfl_feature_dev_data *fdata, struct dfl_device *ddev; int id, i, ret; - ddev = kzalloc_obj(*ddev, GFP_KERNEL); + ddev = kzalloc_obj(*ddev); if (!ddev) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index c709aa3ef04c..ca68c38aa4a1 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -346,7 +346,7 @@ __fpga_bridge_register(struct device *parent, const char *name, return ERR_PTR(-EINVAL); } - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index 215303dd6a64..2672070ced02 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c @@ -486,7 +486,7 @@ static int fpga_mgr_buf_load(struct fpga_manager *mgr, */ nr_pages = DIV_ROUND_UP((unsigned long)buf + count, PAGE_SIZE) - (unsigned long)buf / PAGE_SIZE; - pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages); if (!pages) return -ENOMEM; @@ -801,7 +801,7 @@ __fpga_mgr_register_full(struct device *parent, const struct fpga_manager_info * return ERR_PTR(-EINVAL); } - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (!mgr) return ERR_PTR(-ENOMEM); diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index 43dbdacfd87e..662e8e4203ca 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -201,7 +201,7 @@ __fpga_region_register_full(struct device *parent, const struct fpga_region_info return ERR_PTR(-EINVAL); } - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) return ERR_PTR(-ENOMEM); diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index abc3cf7f4ae4..91b60b1fb86a 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -211,7 +211,7 @@ static struct fsi_device *fsi_create_device(struct fsi_slave *slave) { struct fsi_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -1083,7 +1083,7 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) /* We can communicate with a slave; create the slave device and * register. */ - slave = kzalloc_obj(*slave, GFP_KERNEL); + slave = kzalloc_obj(*slave); if (!slave) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 2589f04c8d5b..aa1380cdff33 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -546,7 +546,7 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev) return rc; } - aspeed = kzalloc_obj(*aspeed, GFP_KERNEL); + aspeed = kzalloc_obj(*aspeed); if (!aspeed) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c index 3b83ebeaf7c1..c3ac76bf7e97 100644 --- a/drivers/fsi/fsi-master-ast-cf.c +++ b/drivers/fsi/fsi-master-ast-cf.c @@ -1220,7 +1220,7 @@ static int fsi_master_acf_probe(struct platform_device *pdev) uint32_t cf_mem_align; int rc; - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index 8c78ab1051d0..0884e143b30e 100644 --- a/drivers/fsi/fsi-master-gpio.c +++ b/drivers/fsi/fsi-master-gpio.c @@ -774,7 +774,7 @@ static int fsi_master_gpio_probe(struct platform_device *pdev) struct gpio_desc *gpio; int rc; - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return -ENOMEM; diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c index 6cee9f1a1d3a..e5ac9025762e 100644 --- a/drivers/fsi/fsi-master-hub.c +++ b/drivers/fsi/fsi-master-hub.c @@ -215,7 +215,7 @@ static int hub_master_probe(struct fsi_device *fsi_dev) return rc; } - hub = kzalloc_obj(*hub, GFP_KERNEL); + hub = kzalloc_obj(*hub); if (!hub) { rc = -ENOMEM; goto err_release; diff --git a/drivers/fsi/fsi-master-i2cr.c b/drivers/fsi/fsi-master-i2cr.c index 055e850a8115..d36a4328ad73 100644 --- a/drivers/fsi/fsi-master-i2cr.c +++ b/drivers/fsi/fsi-master-i2cr.c @@ -261,7 +261,7 @@ static int i2cr_probe(struct i2c_client *client) struct fsi_master_i2cr *i2cr; int ret; - i2cr = kzalloc_obj(*i2cr, GFP_KERNEL); + i2cr = kzalloc_obj(*i2cr); if (!i2cr) return -ENOMEM; diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index 0ef1eccff91a..416d176f0936 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -79,7 +79,7 @@ static DEFINE_IDA(occ_ida); static int occ_open(struct inode *inode, struct file *file) { - struct occ_client *client = kzalloc_obj(*client, GFP_KERNEL); + struct occ_client *client = kzalloc_obj(*client); struct miscdevice *mdev = file->private_data; struct occ *occ = to_occ(mdev); diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c index 5e62212f5ae4..619b8e1b26fd 100644 --- a/drivers/fsi/fsi-sbefifo.c +++ b/drivers/fsi/fsi-sbefifo.c @@ -792,7 +792,7 @@ static int sbefifo_user_open(struct inode *inode, struct file *file) struct sbefifo *sbefifo = container_of(inode->i_cdev, struct sbefifo, cdev); struct sbefifo_user *user; - user = kzalloc_obj(struct sbefifo_user, GFP_KERNEL); + user = kzalloc_obj(struct sbefifo_user); if (!user) return -ENOMEM; @@ -1033,7 +1033,7 @@ static int sbefifo_probe(struct fsi_device *fsi_dev) dev_dbg(dev, "Found sbefifo device\n"); - sbefifo = kzalloc_obj(*sbefifo, GFP_KERNEL); + sbefifo = kzalloc_obj(*sbefifo); if (!sbefifo) return -ENOMEM; diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index bbdbc75ae192..bb4d3700c934 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -533,7 +533,7 @@ static int scom_probe(struct fsi_device *fsi_dev) struct scom_device *scom; int rc, didx; - scom = kzalloc_obj(*scom, GFP_KERNEL); + scom = kzalloc_obj(*scom); if (!scom) return -ENOMEM; fsi_set_drvdata(fsi_dev, scom); diff --git a/drivers/fwctl/mlx5/main.c b/drivers/fwctl/mlx5/main.c index c4262abfd77a..e86ab703c767 100644 --- a/drivers/fwctl/mlx5/main.c +++ b/drivers/fwctl/mlx5/main.c @@ -167,7 +167,7 @@ static void *mlx5ctl_info(struct fwctl_uctx *uctx, size_t *length) container_of(uctx, struct mlx5ctl_uctx, uctx); struct fwctl_info_mlx5 *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c index 8c622267782f..08872ee8422f 100644 --- a/drivers/fwctl/pds/main.c +++ b/drivers/fwctl/pds/main.c @@ -58,7 +58,7 @@ static void *pdsfc_info(struct fwctl_uctx *uctx, size_t *length) struct pdsfc_uctx *pdsfc_uctx = container_of(uctx, struct pdsfc_uctx, uctx); struct fwctl_info_pds *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c index fb17b7811025..006f5533e97b 100644 --- a/drivers/gnss/core.c +++ b/drivers/gnss/core.c @@ -227,7 +227,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent) int id; int ret; - gdev = kzalloc_obj(*gdev, GFP_KERNEL); + gdev = kzalloc_obj(*gdev); if (!gdev) return NULL; diff --git a/drivers/gnss/usb.c b/drivers/gnss/usb.c index 919ea2ab4572..0d9dde02397c 100644 --- a/drivers/gnss/usb.c +++ b/drivers/gnss/usb.c @@ -131,7 +131,7 @@ static int gnss_usb_probe(struct usb_interface *intf, const struct usb_device_id if (ret) return ret; - gusb = kzalloc_obj(*gusb, GFP_KERNEL); + gusb = kzalloc_obj(*gusb); if (!gusb) return -ENOMEM; diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index e8ea37ff4fbf..6dd8637c5964 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -856,7 +856,7 @@ static int cb7210_allocate_private(struct gpib_board *board) { struct cb7210_priv *priv; - board->private_data = kzalloc_obj(struct cb7210_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct cb7210_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; @@ -1188,7 +1188,7 @@ static int cb_gpib_probe(struct pcmcia_device *link) int ret; /* Allocate space for private device-specific data */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/gpib/cec/cec_gpib.c b/drivers/gpib/cec/cec_gpib.c index 45db380aeebe..c13bc302d9e9 100644 --- a/drivers/gpib/cec/cec_gpib.c +++ b/drivers/gpib/cec/cec_gpib.c @@ -220,7 +220,7 @@ static int cec_allocate_private(struct gpib_board *board) { struct cec_priv *priv; - board->private_data = kzalloc_obj(struct cec_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct cec_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/common/gpib_os.c b/drivers/gpib/common/gpib_os.c index 08da67543bac..06d19e9f97f6 100644 --- a/drivers/gpib/common/gpib_os.c +++ b/drivers/gpib/common/gpib_os.c @@ -199,7 +199,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, return retval; } - status = kmalloc_obj(*status, GFP_KERNEL); + status = kmalloc_obj(*status); if (!status) return -ENOMEM; @@ -513,7 +513,7 @@ static int init_gpib_file_private(struct gpib_file_private *priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); - priv->descriptors[0] = kmalloc_obj(struct gpib_descriptor, GFP_KERNEL); + priv->descriptors[0] = kmalloc_obj(struct gpib_descriptor); if (!priv->descriptors[0]) { pr_err("gpib: failed to allocate default board descriptor\n"); return -ENOMEM; @@ -537,7 +537,7 @@ int ibopen(struct inode *inode, struct file *filep) board = &board_array[minor]; - filep->private_data = kmalloc_obj(struct gpib_file_private, GFP_KERNEL); + filep->private_data = kmalloc_obj(struct gpib_file_private); if (!filep->private_data) return -ENOMEM; @@ -2042,7 +2042,7 @@ int gpib_register_driver(struct gpib_interface *interface, struct module *provid { struct gpib_interface_list *entry; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/gpib/eastwood/fluke_gpib.c b/drivers/gpib/eastwood/fluke_gpib.c index ae4d99dcae04..2069c771ecef 100644 --- a/drivers/gpib/eastwood/fluke_gpib.c +++ b/drivers/gpib/eastwood/fluke_gpib.c @@ -853,7 +853,7 @@ static int fluke_allocate_private(struct gpib_board *board) { struct fluke_priv *priv; - board->private_data = kzalloc_obj(struct fluke_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct fluke_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/fmh_gpib/fmh_gpib.c b/drivers/gpib/fmh_gpib/fmh_gpib.c index 0858cf5ab557..fcafdc02ea2e 100644 --- a/drivers/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/gpib/fmh_gpib/fmh_gpib.c @@ -1250,7 +1250,7 @@ static int fmh_gpib_allocate_private(struct gpib_board *board) { struct fmh_priv *priv; - board->private_data = kzalloc_obj(struct fmh_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct fmh_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/gpio/gpib_bitbang.c b/drivers/gpib/gpio/gpib_bitbang.c index a3b63fd33bd8..0e227980b493 100644 --- a/drivers/gpib/gpio/gpib_bitbang.c +++ b/drivers/gpib/gpio/gpib_bitbang.c @@ -1066,7 +1066,7 @@ static int bb_line_status(const struct gpib_board *board) static int allocate_private(struct gpib_board *board) { - board->private_data = kzalloc_obj(struct bb_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct bb_priv); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/hp_82335/hp82335.c b/drivers/gpib/hp_82335/hp82335.c index d5e158c4dd72..b7544b3c15c6 100644 --- a/drivers/gpib/hp_82335/hp82335.c +++ b/drivers/gpib/hp_82335/hp82335.c @@ -210,7 +210,7 @@ static struct gpib_interface hp82335_interface = { static int hp82335_allocate_private(struct gpib_board *board) { - board->private_data = kzalloc_obj(struct hp82335_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct hp82335_priv); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/hp_82341/hp_82341.c b/drivers/gpib/hp_82341/hp_82341.c index 6755982d8a2a..46175ba2ac36 100644 --- a/drivers/gpib/hp_82341/hp_82341.c +++ b/drivers/gpib/hp_82341/hp_82341.c @@ -462,7 +462,7 @@ static struct gpib_interface hp_82341_interface = { static int hp_82341_allocate_private(struct gpib_board *board) { - board->private_data = kzalloc_obj(struct hp_82341_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct hp_82341_priv); if (!board->private_data) return -ENOMEM; return 0; diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c index 7fbe3beb1d67..c000f647fbb5 100644 --- a/drivers/gpib/ines/ines_gpib.c +++ b/drivers/gpib/ines/ines_gpib.c @@ -657,7 +657,7 @@ static int ines_allocate_private(struct gpib_board *board) { struct ines_priv *priv; - board->private_data = kzalloc_obj(struct ines_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct ines_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; @@ -1061,7 +1061,7 @@ static int ines_gpib_probe(struct pcmcia_device *link) // int ret, i; /* Allocate space for private device-specific data */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 5c189e6f22dc..6fc4e3452b88 100644 --- a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -440,7 +440,7 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con return -EIO; } - board->private_data = kzalloc_obj(struct usb_gpib_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct usb_gpib_priv); if (!board->private_data) return -ENOMEM; @@ -1864,7 +1864,7 @@ static int skel_probe(struct usb_interface *interface, mutex_init(&minors_lock); /* required for handling minor numbers table */ /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/gpib/ni_usb/ni_usb_gpib.c b/drivers/gpib/ni_usb/ni_usb_gpib.c index e9d7dd6e2fa7..a24cd6521362 100644 --- a/drivers/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/gpib/ni_usb/ni_usb_gpib.c @@ -1659,7 +1659,7 @@ static int ni_usb_allocate_private(struct gpib_board *board) { struct ni_usb_priv *ni_priv; - board->private_data = kzalloc_obj(struct ni_usb_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct ni_usb_priv); if (!board->private_data) return -ENOMEM; ni_priv = board->private_data; @@ -1793,7 +1793,7 @@ static int ni_usb_init(struct gpib_board *board) unsigned int ibsta; int writes_len; - writes = kmalloc_objs(*writes, NUM_INIT_WRITES, GFP_KERNEL); + writes = kmalloc_objs(*writes, NUM_INIT_WRITES); if (!writes) return -ENOMEM; diff --git a/drivers/gpib/pc2/pc2_gpib.c b/drivers/gpib/pc2/pc2_gpib.c index 2c0b464025b5..d7260181925f 100644 --- a/drivers/gpib/pc2/pc2_gpib.c +++ b/drivers/gpib/pc2/pc2_gpib.c @@ -237,7 +237,7 @@ static int allocate_private(struct gpib_board *board) { struct pc2_priv *priv; - board->private_data = kzalloc_obj(struct pc2_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct pc2_priv); if (!board->private_data) return -ENOMEM; priv = board->private_data; diff --git a/drivers/gpib/tnt4882/mite.c b/drivers/gpib/tnt4882/mite.c index 8906f5c41494..c75c45cdf03f 100644 --- a/drivers/gpib/tnt4882/mite.c +++ b/drivers/gpib/tnt4882/mite.c @@ -57,7 +57,7 @@ void mite_init(void) for (pcidev = pci_get_device(PCI_VENDOR_ID_NATINST, PCI_ANY_ID, NULL); pcidev; pcidev = pci_get_device(PCI_VENDOR_ID_NATINST, PCI_ANY_ID, pcidev)) { - mite = kzalloc_obj(*mite, GFP_KERNEL); + mite = kzalloc_obj(*mite); if (!mite) return; diff --git a/drivers/gpib/tnt4882/tnt4882_gpib.c b/drivers/gpib/tnt4882/tnt4882_gpib.c index 8d593d3489ad..51a920e1d9a4 100644 --- a/drivers/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/gpib/tnt4882/tnt4882_gpib.c @@ -843,7 +843,7 @@ static int tnt4882_allocate_private(struct gpib_board *board) { struct tnt4882_priv *tnt_priv; - board->private_data = kzalloc_obj(struct tnt4882_priv, GFP_KERNEL); + board->private_data = kzalloc_obj(struct tnt4882_priv); if (!board->private_data) return -ENOMEM; tnt_priv = board->private_data; @@ -1567,7 +1567,7 @@ static int ni_gpib_probe(struct pcmcia_device *link) //struct struct gpib_board *dev; /* Allocate space for private device-specific data */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c index 19857285f28c..0f015a122dec 100644 --- a/drivers/gpio/gpio-aggregator.c +++ b/drivers/gpio/gpio-aggregator.c @@ -159,7 +159,7 @@ gpio_aggregator_line_alloc(struct gpio_aggregator *parent, unsigned int idx, { struct gpio_aggregator_line *line; - line = kzalloc_obj(*line, GFP_KERNEL); + line = kzalloc_obj(*line); if (!line) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-reg.c b/drivers/gpio/gpio-reg.c index 1daa05bbf35b..296c210b228c 100644 --- a/drivers/gpio/gpio-reg.c +++ b/drivers/gpio/gpio-reg.c @@ -150,7 +150,7 @@ struct gpio_chip *gpio_reg_init(struct device *dev, void __iomem *reg, if (dev) r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL); else - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 5891983810af..9ae4a41a2427 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -259,7 +259,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config if (config->reg_dir_out_base && config->reg_dir_in_base) return ERR_PTR(-EINVAL); - gpio = kzalloc_obj(*gpio, GFP_KERNEL); + gpio = kzalloc_obj(*gpio); if (!gpio) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 5299500e7617..8dc164939ec3 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -813,7 +813,7 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev) return 0; /* Allocate one more for the sentinel. */ - dev->hogs = kzalloc_objs(*dev->hogs, num_hogs + 1, GFP_KERNEL); + dev->hogs = kzalloc_objs(*dev->hogs, num_hogs + 1); if (!dev->hogs) return -ENOMEM; @@ -1406,7 +1406,7 @@ gpio_sim_line_config_make_hog_item(struct config_group *group, const char *name) guard(mutex)(&dev->lock); - hog = kzalloc_obj(*hog, GFP_KERNEL); + hog = kzalloc_obj(*hog); if (!hog) return ERR_PTR(-ENOMEM); @@ -1467,7 +1467,7 @@ gpio_sim_bank_config_make_line_group(struct config_group *group, if (gpio_sim_device_is_live(dev)) return ERR_PTR(-EBUSY); - line = kzalloc_obj(*line, GFP_KERNEL); + line = kzalloc_obj(*line); if (!line) return ERR_PTR(-ENOMEM); @@ -1521,7 +1521,7 @@ gpio_sim_device_config_make_bank_group(struct config_group *group, if (gpio_sim_device_is_live(dev)) return ERR_PTR(-EBUSY); - bank = kzalloc_obj(*bank, GFP_KERNEL); + bank = kzalloc_obj(*bank); if (!bank) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index 5b8cb4e65e56..3d998939120e 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -1605,7 +1605,7 @@ gpio_virtuser_make_lookup_entry_group(struct config_group *group, return ERR_PTR(-EBUSY); struct gpio_virtuser_lookup_entry *entry __free(kfree) = - kzalloc_obj(*entry, GFP_KERNEL); + kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -1661,7 +1661,7 @@ gpio_virtuser_make_lookup_group(struct config_group *group, const char *name) return ERR_PTR(-EBUSY); struct gpio_virtuser_lookup *lookup __free(kfree) = - kzalloc_obj(*lookup, GFP_KERNEL); + kzalloc_obj(*lookup); if (!lookup) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c index df60f6eac137..ced6375d1bad 100644 --- a/drivers/gpio/gpiolib-acpi-core.c +++ b/drivers/gpio/gpiolib-acpi-core.c @@ -403,7 +403,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, goto fail_unlock_irq; } - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) goto fail_unlock_irq; @@ -1144,7 +1144,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, goto out; } - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) { gpiochip_free_own_desc(desc); mutex_unlock(&achip->conn_lock); @@ -1302,7 +1302,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip) if (!adev) return; - acpi_gpio = kzalloc_obj(*acpi_gpio, GFP_KERNEL); + acpi_gpio = kzalloc_obj(*acpi_gpio); if (!acpi_gpio) { dev_err(chip->parent, "Failed to allocate memory for ACPI GPIO chip\n"); diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index f50b067e1de3..fdc2a6539786 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -318,7 +318,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) if (ret) return ret; - lh = kzalloc_obj(*lh, GFP_KERNEL); + lh = kzalloc_obj(*lh); if (!lh) return -ENOMEM; lh->gdev = gpio_device_get(gdev); @@ -1280,7 +1280,7 @@ static long linereq_get_values(struct linereq *lr, void __user *ip) if (num_get != 1) { /* build compacted desc array */ - descs = kmalloc_objs(*descs, num_get, GFP_KERNEL); + descs = kmalloc_objs(*descs, num_get); if (!descs) return -ENOMEM; for (didx = 0, i = 0; i < lr->num_lines; i++) { @@ -1355,7 +1355,7 @@ static long linereq_set_values(struct linereq *lr, void __user *ip) if (num_set != 1) { /* build compacted desc array */ - descs = kmalloc_objs(*descs, num_set, GFP_KERNEL); + descs = kmalloc_objs(*descs, num_set); if (!descs) return -ENOMEM; for (didx = 0, i = 0; i < lr->num_lines; i++) { @@ -2054,7 +2054,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) (lflags & GPIOHANDLE_REQUEST_BIAS_PULL_UP))) return -EINVAL; - le = kzalloc_obj(*le, GFP_KERNEL); + le = kzalloc_obj(*le); if (!le) return -ENOMEM; le->gdev = gpio_device_get(gdev); diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c index bb53f803b2e3..48de8cf141db 100644 --- a/drivers/gpio/gpiolib-shared.c +++ b/drivers/gpio/gpiolib-shared.c @@ -228,7 +228,7 @@ static int gpio_shared_of_traverse(struct device_node *curr) entry = gpio_shared_find_entry(fwnode, offset); if (!entry) { - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -627,7 +627,7 @@ gpiod_shared_desc_create(struct gpio_shared_entry *entry) lockdep_assert_held(&entry->lock); - shared_desc = kzalloc_obj(*shared_desc, GFP_KERNEL); + shared_desc = kzalloc_obj(*shared_desc); if (!shared_desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 99e0cf963b19..270e8060e761 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -761,7 +761,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change) goto err_clear_bit; } - desc_data = kzalloc_obj(*desc_data, GFP_KERNEL); + desc_data = kzalloc_obj(*desc_data); if (!desc_data) { status = -ENOMEM; goto err_clear_bit; @@ -1014,7 +1014,7 @@ int gpiochip_sysfs_register(struct gpio_device *gdev) else parent = &gdev->dev; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 654505cd21da..da0029628f2f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2332,7 +2332,7 @@ int gpiochip_add_pingroup_range(struct gpio_chip *gc, struct gpio_device *gdev = gc->gpiodev; int ret; - pin_range = kzalloc_obj(*pin_range, GFP_KERNEL); + pin_range = kzalloc_obj(*pin_range); if (!pin_range) return -ENOMEM; @@ -2393,7 +2393,7 @@ int gpiochip_add_pin_range_with_pins(struct gpio_chip *gc, struct gpio_device *gdev = gc->gpiodev; int ret; - pin_range = kzalloc_obj(*pin_range, GFP_KERNEL); + pin_range = kzalloc_obj(*pin_range); if (!pin_range) return -ENOMEM; @@ -5369,7 +5369,7 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos) s->private = NULL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c index 5d8d9c73434a..938fb0b2368d 100644 --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c @@ -447,7 +447,7 @@ int aldebaran_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c index 1c7597c19249..afe5ca81beec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c @@ -52,7 +52,7 @@ static int aca_banks_add_bank(struct aca_banks *banks, struct aca_bank *bank) if (!bank) return -EINVAL; - node = kvzalloc_obj(*node, GFP_KERNEL); + node = kvzalloc_obj(*node); if (!node) return -ENOMEM; @@ -230,7 +230,7 @@ static struct aca_bank_error *new_bank_error(struct aca_error *aerr, struct aca_ { struct aca_bank_error *bank_error; - bank_error = kvzalloc_obj(*bank_error, GFP_KERNEL); + bank_error = kvzalloc_obj(*bank_error); if (!bank_error) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index c544f0dbb93f..b08752c57a7e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -246,7 +246,7 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) return -EINVAL; acp_base = adev->rmmio_base; - adev->acp.acp_genpd = kzalloc_obj(struct acp_pm_domain, GFP_KERNEL); + adev->acp.acp_genpd = kzalloc_obj(struct acp_pm_domain); if (!adev->acp.acp_genpd) return -ENOMEM; @@ -267,7 +267,7 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) goto failure; } - adev->acp.acp_res = kzalloc_objs(struct resource, 3, GFP_KERNEL); + adev->acp.acp_res = kzalloc_objs(struct resource, 3); if (!adev->acp.acp_res) { r = -ENOMEM; goto failure; @@ -333,7 +333,7 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block) goto failure; } - adev->acp.acp_res = kzalloc_objs(struct resource, 5, GFP_KERNEL); + adev->acp.acp_res = kzalloc_objs(struct resource, 5); if (!adev->acp.acp_res) { r = -ENOMEM; goto failure; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 742fc381149e..516ab9cf88fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -897,7 +897,7 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm) if (!numa_info) { struct sysinfo info; - numa_info = kzalloc_obj(*numa_info, GFP_KERNEL); + numa_info = kzalloc_obj(*numa_info); if (!numa_info) return NULL; @@ -1016,7 +1016,7 @@ static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info, int ret = -ENOENT; *dev_info = NULL; - tmp = kzalloc_obj(struct amdgpu_acpi_dev_info, GFP_KERNEL); + tmp = kzalloc_obj(struct amdgpu_acpi_dev_info); if (!tmp) return -ENOMEM; @@ -1166,7 +1166,7 @@ int amdgpu_acpi_enumerate_xcc(void) break; } - xcc_info = kzalloc_obj(struct amdgpu_acpi_xcc_info, GFP_KERNEL); + xcc_info = kzalloc_obj(struct amdgpu_acpi_xcc_info); if (!xcc_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 16baf713be78..40c22438b1d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -829,11 +829,11 @@ int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off, if (!kiq_ring->sched.ready || amdgpu_in_reset(adev)) return 0; - ring_funcs = kzalloc_obj(*ring_funcs, GFP_KERNEL); + ring_funcs = kzalloc_obj(*ring_funcs); if (!ring_funcs) return -ENOMEM; - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) { r = -ENOMEM; goto free_ring_funcs; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c index c74e3866ffb8..a1d93f217844 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c @@ -199,7 +199,7 @@ int kgd_arcturus_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c index fff60109cf9c..6a364357522b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c @@ -67,7 +67,7 @@ struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context, { struct amdgpu_amdkfd_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (fence == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c index a2e00dd114a6..f35947be3763 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c @@ -141,7 +141,7 @@ static int kgd_gfx_v9_4_3_hqd_sdma_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c index 70d63690dccd..88acf75f0edd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c @@ -352,7 +352,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32_SOC15_IP(GC, addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -449,7 +449,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c index 41564319441e..e31afee42979 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c @@ -338,7 +338,7 @@ static int hqd_dump_v10_3(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32_SOC15_IP(GC, addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -435,7 +435,7 @@ static int hqd_sdma_dump_v10_3(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+12) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c index 50c57914c90c..8aa068a4d3e3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c @@ -323,7 +323,7 @@ static int hqd_dump_v11(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -420,7 +420,7 @@ static int hqd_sdma_dump_v11(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (7+11+1+12+12) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c index 4e43ad423713..bf0bd7688ee4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c @@ -115,7 +115,7 @@ static int hqd_dump_v12(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -146,7 +146,7 @@ static int hqd_sdma_dump_v12(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (last_reg - first_reg + 1) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c index ba7e901322b3..2f62e5e306e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c @@ -214,7 +214,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -301,7 +301,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+4) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c index 9f51fd11c5ae..dc74fa26cf02 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c @@ -238,7 +238,7 @@ static int kgd_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -324,7 +324,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+4+2+3+7) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c index cc2073cf43f4..2e116c06d5be 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c @@ -363,7 +363,7 @@ int kgd_gfx_v9_hqd_dump(struct amdgpu_device *adev, (*dump)[i++][1] = RREG32(addr); \ } while (0) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; @@ -460,7 +460,7 @@ static int kgd_hqd_sdma_dump(struct amdgpu_device *adev, #undef HQD_N_REGS #define HQD_N_REGS (19+6+7+10) - *dump = kmalloc_objs(**dump, HQD_N_REGS, GFP_KERNEL); + *dump = kmalloc_objs(**dump, HQD_N_REGS); if (*dump == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index fd7bfe418099..06c1913d5a3f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -540,7 +540,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct amdgpu_vm *vm, */ static struct sg_table *create_sg_table(uint64_t addr, uint32_t size) { - struct sg_table *sg = kmalloc_obj(*sg, GFP_KERNEL); + struct sg_table *sg = kmalloc_obj(*sg); if (!sg) return NULL; @@ -573,7 +573,7 @@ kfd_mem_dmamap_userptr(struct kgd_mem *mem, if (WARN_ON(ttm->num_pages != src_ttm->num_pages)) return -EINVAL; - ttm->sg = kmalloc_obj(*ttm->sg, GFP_KERNEL); + ttm->sg = kmalloc_obj(*ttm->sg); if (unlikely(!ttm->sg)) return -ENOMEM; @@ -1409,7 +1409,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, process = container_of(process_info, struct kfd_process, kgd_process_info); if (!*process_info) { - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -1773,7 +1773,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( if (flags & KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED) alloc_flags |= AMDGPU_GEM_CREATE_UNCACHED; - *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem); if (!*mem) { ret = -ENOMEM; goto err; @@ -2374,7 +2374,7 @@ static int import_obj_create(struct amdgpu_device *adev, /* Only VRAM and GTT BOs are supported */ return -EINVAL; - *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem); if (!*mem) return -ENOMEM; @@ -3129,7 +3129,7 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem if (!info || !gws) return -EINVAL; - *mem = kzalloc_obj(struct kgd_mem, GFP_KERNEL); + *mem = kzalloc_obj(struct kgd_mem); if (!*mem) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 59ddc14cbb7d..9f38b7dd1011 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1897,7 +1897,7 @@ void amdgpu_atombios_fini(struct amdgpu_device *adev) int amdgpu_atombios_init(struct amdgpu_device *adev) { struct card_info *atom_card_info = - kzalloc_obj(struct card_info, GFP_KERNEL); + kzalloc_obj(struct card_info); if (!atom_card_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index 198ad026222d..fa008b858e39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1652,7 +1652,7 @@ amdgpu_connector_add(struct amdgpu_device *adev, } } - amdgpu_connector = kzalloc_obj(struct amdgpu_connector, GFP_KERNEL); + amdgpu_connector = kzalloc_obj(struct amdgpu_connector); if (!amdgpu_connector) return; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index c9345783ac26..2b2636e65279 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -523,7 +523,7 @@ static int amdgpu_cs_p2_syncobj_out(struct amdgpu_cs_parser *p, if (p->post_deps) return -EINVAL; - p->post_deps = kmalloc_objs(*p->post_deps, num_deps, GFP_KERNEL); + p->post_deps = kmalloc_objs(*p->post_deps, num_deps); p->num_post_deps = 0; if (!p->post_deps) @@ -556,7 +556,7 @@ static int amdgpu_cs_p2_syncobj_timeline_signal(struct amdgpu_cs_parser *p, if (p->post_deps) return -EINVAL; - p->post_deps = kmalloc_objs(*p->post_deps, num_deps, GFP_KERNEL); + p->post_deps = kmalloc_objs(*p->post_deps, num_deps); p->num_post_deps = 0; if (!p->post_deps) @@ -1689,7 +1689,7 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, long r; /* Prepare the fence array */ - array = kzalloc_objs(struct dma_fence *, fence_count, GFP_KERNEL); + array = kzalloc_objs(struct dma_fence *, fence_count); if (array == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 1eb2e89fcdeb..c0f501a61198 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -482,7 +482,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev, struct amdgpu_ctx *ctx; int r; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 56a13637bb8c..f7467af2e102 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -206,7 +206,7 @@ static int amdgpu_debugfs_regs2_open(struct inode *inode, struct file *file) { struct amdgpu_debugfs_regs2_data *rd; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; rd->adev = file_inode(file)->i_private; @@ -371,7 +371,7 @@ static int amdgpu_debugfs_gprwave_open(struct inode *inode, struct file *file) { struct amdgpu_debugfs_gprwave_data *rd; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; rd->adev = file_inode(file)->i_private; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c57cbf497eba..d9789e0b5201 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2596,7 +2596,7 @@ out: static void amdgpu_uid_init(struct amdgpu_device *adev) { /* Initialize the UID for the device */ - adev->uid_info = kzalloc_obj(struct amdgpu_uid, GFP_KERNEL); + adev->uid_info = kzalloc_obj(struct amdgpu_uid); if (!adev->uid_info) { dev_warn(adev->dev, "Failed to allocate memory for UID\n"); return; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index c51eedd96fb0..6d1f5cae1a65 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -1149,7 +1149,7 @@ static int amdgpu_discovery_sysfs_ips(struct amdgpu_device *adev, * block if not yet registered. */ if (!ip_hw_id) { - ip_hw_id = kzalloc_obj(*ip_hw_id, GFP_KERNEL); + ip_hw_id = kzalloc_obj(*ip_hw_id); if (!ip_hw_id) return -ENOMEM; ip_hw_id->hw_id = ii; @@ -1255,7 +1255,7 @@ static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev) * amdgpu_discovery_reg_base_init(). */ - ip_die_entry = kzalloc_obj(*ip_die_entry, GFP_KERNEL); + ip_die_entry = kzalloc_obj(*ip_die_entry); if (!ip_die_entry) return -ENOMEM; @@ -1287,7 +1287,7 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev) if (!discovery_bin) return -EINVAL; - ip_top = kzalloc_obj(*ip_top, GFP_KERNEL); + ip_top = kzalloc_obj(*ip_top); if (!ip_top) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index eb94a0b97b94..bef9dce2e7ea 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -204,7 +204,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, u64 tiling_flags; int i, r; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (work == NULL) return -ENOMEM; @@ -1323,7 +1323,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - amdgpu_fb = kzalloc_obj(*amdgpu_fb, GFP_KERNEL); + amdgpu_fb = kzalloc_obj(*amdgpu_fb); if (amdgpu_fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c index 432de34d177f..3b588c7740ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c @@ -161,7 +161,7 @@ amdgpu_eviction_fence_create(struct amdgpu_eviction_fence_mgr *evf_mgr) { struct amdgpu_eviction_fence *ev_fence; - ev_fence = kzalloc_obj(*ev_fence, GFP_KERNEL); + ev_fence = kzalloc_obj(*ev_fence); if (!ev_fence) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c index cb33a04d94c9..514bd302365f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c @@ -130,7 +130,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev) return 0; if (!adev->fru_info) { - adev->fru_info = kzalloc_obj(*adev->fru_info, GFP_KERNEL); + adev->fru_info = kzalloc_obj(*adev->fru_info); if (!adev->fru_info) return -ENOMEM; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 07e43b446e44..e2d32c29668a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c @@ -153,7 +153,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev) dev_info(adev->dev, "%s dma_addr:%pad\n", __func__, &dma_addr); /* Create SG table */ - sg = kmalloc_obj(*sg, GFP_KERNEL); + sg = kmalloc_obj(*sg); if (!sg) { ret = -ENOMEM; goto error; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 27b77a82b174..a6107109a2b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -1183,7 +1183,7 @@ int amdgpu_gem_list_handles_ioctl(struct drm_device *dev, void *data, return 0; } - bo_entries = kvzalloc_objs(*bo_entries, num_bos, GFP_KERNEL); + bo_entries = kvzalloc_objs(*bo_entries, num_bos); if (!bo_entries) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c index 4cc345f77db0..f72990ac046e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c @@ -265,7 +265,7 @@ struct amdgpu_hmm_range *amdgpu_hmm_range_alloc(struct amdgpu_bo *bo) { struct amdgpu_hmm_range *range; - range = kzalloc_obj(*range, GFP_KERNEL); + range = kzalloc_obj(*range); if (!range) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c index 9dc4a5f426eb..c576e103a783 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c @@ -168,7 +168,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev, if (rec->mm_i2c && (amdgpu_hw_i2c == 0)) return NULL; - i2c = kzalloc_obj(struct amdgpu_i2c_chan, GFP_KERNEL); + i2c = kzalloc_obj(struct amdgpu_i2c_chan); if (i2c == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c index 52bad6d28915..64c519cd7395 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c @@ -119,7 +119,7 @@ void amdgpu_pasid_free_delayed(struct dma_resv *resv, return; } - cb = kmalloc_obj(*cb, GFP_KERNEL); + cb = kmalloc_obj(*cb); if (!cb) { /* Last resort when we are OOM */ dma_fence_wait(fence, false); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c index d51ce25474f5..49eedfbfb5e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c @@ -448,7 +448,7 @@ int amdgpu_irq_add_id(struct amdgpu_device *adev, if (source->num_types && !source->enabled_types) { atomic_t *types; - types = kzalloc_objs(atomic_t, source->num_types, GFP_KERNEL); + types = kzalloc_objs(atomic_t, source->num_types); if (!types) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 8865b4802963..bee7fcf006a2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -202,14 +202,14 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (!*job) return -ENOMEM; - af = kzalloc_obj(struct amdgpu_fence, GFP_KERNEL); + af = kzalloc_obj(struct amdgpu_fence); if (!af) { r = -ENOMEM; goto err_job; } (*job)->hw_fence = af; - af = kzalloc_obj(struct amdgpu_fence, GFP_KERNEL); + af = kzalloc_obj(struct amdgpu_fence); if (!af) { r = -ENOMEM; goto err_fence; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index a5b72ed77162..77e2133de5cf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -942,7 +942,7 @@ out: uint64_t vm_size; uint32_t pcie_gen_mask, pcie_width_mask; - dev_info = kzalloc_obj(*dev_info, GFP_KERNEL); + dev_info = kzalloc_obj(*dev_info); if (!dev_info) return -ENOMEM; @@ -1329,7 +1329,7 @@ out: return -EINVAL; } - caps = kzalloc_obj(*caps, GFP_KERNEL); + caps = kzalloc_obj(*caps); if (!caps) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c index 6b52dbdb7e54..823ba17e32af 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c @@ -169,7 +169,7 @@ static int amdgpu_mca_bank_set_add_entry(struct mca_bank_set *mca_set, struct mc if (!entry) return -EINVAL; - node = kvzalloc_obj(*node, GFP_KERNEL); + node = kvzalloc_obj(*node); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c index 0cfe3a91db84..ad5d2fcd03d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c @@ -446,7 +446,7 @@ static int amdgpu_pmu_alloc_pmu_attrs( struct amdgpu_pmu_event_attribute **evt_attr, struct amdgpu_pmu_config *config) { - *fmt_attr = kzalloc_objs(**fmt_attr, config->num_formats, GFP_KERNEL); + *fmt_attr = kzalloc_objs(**fmt_attr, config->num_formats); if (!(*fmt_attr)) return -ENOMEM; @@ -458,7 +458,7 @@ static int amdgpu_pmu_alloc_pmu_attrs( if (!fmt_attr_group->attrs) goto err_fmt_attr_grp; - *evt_attr = kzalloc_objs(**evt_attr, config->num_events, GFP_KERNEL); + *evt_attr = kzalloc_objs(**evt_attr, config->num_events); if (!(*evt_attr)) goto err_evt_attr; @@ -599,7 +599,7 @@ static struct amdgpu_pmu_entry *create_pmu_entry(struct amdgpu_device *adev, { struct amdgpu_pmu_entry *pmu_entry; - pmu_entry = kzalloc_obj(struct amdgpu_pmu_entry, GFP_KERNEL); + pmu_entry = kzalloc_obj(struct amdgpu_pmu_entry); if (!pmu_entry) return pmu_entry; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c index 5420362b4261..b1dc33301d83 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c @@ -61,7 +61,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc_obj(**res, GFP_KERNEL); + *res = kzalloc_obj(**res); if (!*res) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 01ce996bfacd..27b67da9fdac 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -457,7 +457,7 @@ static int psp_sw_init(struct amdgpu_ip_block *ip_block) struct psp_memory_training_context *mem_training_ctx = &psp->mem_train_ctx; struct psp_runtime_scpm_entry scpm_entry; - psp->cmd = kzalloc_obj(struct psp_gfx_cmd_resp, GFP_KERNEL); + psp->cmd = kzalloc_obj(struct psp_gfx_cmd_resp); if (!psp->cmd) { dev_err(adev->dev, "Failed to allocate memory to command buffer!\n"); return -ENOMEM; @@ -4384,7 +4384,7 @@ static int psp_read_spirom_debugfs_open(struct inode *inode, struct file *filp) return -EBUSY; } - bo_triplet = kzalloc_obj(struct spirom_bo, GFP_KERNEL); + bo_triplet = kzalloc_obj(struct spirom_bo); if (!bo_triplet) { mutex_unlock(&adev->psp.mutex); return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index c363953c2a74..eb3e62eb7b20 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -891,7 +891,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, if (head->block == AMDGPU_RAS_BLOCK__GFX && !amdgpu_sriov_vf(adev) && !amdgpu_ras_intr_triggered()) { - info = kzalloc_obj(union ta_ras_cmd_input, GFP_KERNEL); + info = kzalloc_obj(union ta_ras_cmd_input); if (!info) return -ENOMEM; @@ -1904,7 +1904,7 @@ static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f, memset(buf, 0, count); bps_count = end - start; - bps = kmalloc_objs(*bps, bps_count, GFP_KERNEL); + bps = kmalloc_objs(*bps, bps_count); if (!bps) return 0; @@ -2811,7 +2811,7 @@ static int amdgpu_uniras_badpages_read(struct amdgpu_device *adev, if (!bps || !count) return -EINVAL; - output = kmalloc_obj(*output, GFP_KERNEL); + output = kmalloc_obj(*output); if (!output) return -ENOMEM; @@ -2991,7 +2991,7 @@ static int amdgpu_ras_realloc_eh_data_space(struct amdgpu_device *adev, unsigned int old_space = data->count + data->space_left; unsigned int new_space = old_space + pages; unsigned int align_space = ALIGN(new_space, 512); - void *bps = kmalloc_objs(*data->bps, align_space, GFP_KERNEL); + void *bps = kmalloc_objs(*data->bps, align_space); if (!bps) { return -ENOMEM; @@ -3375,7 +3375,7 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev) if (control->ras_num_recs == 0 || amdgpu_bad_page_threshold == 0) return 0; - bps = kzalloc_objs(*bps, control->ras_num_recs, GFP_KERNEL); + bps = kzalloc_objs(*bps, control->ras_num_recs); if (!bps) return -ENOMEM; @@ -3863,7 +3863,7 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev, bool init_bp_info) return 0; data = &con->eh_data; - *data = kzalloc_obj(**data, GFP_KERNEL); + *data = kzalloc_obj(**data); if (!*data) { ret = -ENOMEM; goto out; @@ -4499,7 +4499,7 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev, /* Those are the cached values at init. */ - query_info = kzalloc_obj(*query_info, GFP_KERNEL); + query_info = kzalloc_obj(*query_info); if (!query_info) return -ENOMEM; memcpy(&query_info->head, ras_block, sizeof(struct ras_common_if)); @@ -5188,7 +5188,7 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, if (!adev || !ras_block_obj) return -EINVAL; - ras_node = kzalloc_obj(*ras_node, GFP_KERNEL); + ras_node = kzalloc_obj(*ras_node); if (!ras_node) return -ENOMEM; @@ -5389,7 +5389,7 @@ static struct ras_err_node *amdgpu_ras_error_node_new(void) { struct ras_err_node *err_node; - err_node = kvzalloc_obj(*err_node, GFP_KERNEL); + err_node = kvzalloc_obj(*err_node); if (!err_node) return NULL; @@ -5682,7 +5682,7 @@ int amdgpu_ras_add_critical_region(struct amdgpu_device *adev, /* Record new critical amdgpu bo */ list_for_each_entry(block, &vres->blocks, link) { - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c index d3413d1b9fb0..7a2fcb7ded1d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c @@ -276,7 +276,7 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d { struct amdgpu_reset_domain *reset_domain; - reset_domain = kvzalloc_obj(struct amdgpu_reset_domain, GFP_KERNEL); + reset_domain = kvzalloc_obj(struct amdgpu_reset_domain); if (!reset_domain) { DRM_ERROR("Failed to allocate amdgpu_reset_domain!"); return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index ac71b2d7e139..4638a686a84e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -507,13 +507,13 @@ static ssize_t amdgpu_ras_cper_debugfs_read(struct file *f, char __user *buf, const uint8_t ring_header_size = 12; struct amdgpu_ring *ring = file_inode(f)->i_private; struct ras_cmd_cper_snapshot_req *snapshot_req __free(kfree) = - kzalloc_obj(struct ras_cmd_cper_snapshot_req, GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_snapshot_req); struct ras_cmd_cper_snapshot_rsp *snapshot_rsp __free(kfree) = - kzalloc_obj(struct ras_cmd_cper_snapshot_rsp, GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_snapshot_rsp); struct ras_cmd_cper_record_req *record_req __free(kfree) = - kzalloc_obj(struct ras_cmd_cper_record_req, GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_record_req); struct ras_cmd_cper_record_rsp *record_rsp __free(kfree) = - kzalloc_obj(struct ras_cmd_cper_record_rsp, GFP_KERNEL); + kzalloc_obj(struct ras_cmd_cper_record_rsp); uint8_t *ring_header __free(kfree) = kzalloc(ring_header_size, GFP_KERNEL); uint32_t total_cper_num; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index dd412186c4f0..d319c37e0d4e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1122,7 +1122,7 @@ int amdgpu_ttm_mmio_remap_alloc_sgt(struct amdgpu_device *adev, phys = adev->rmmio_remap.bus_addr + cur.start; /* Build a single-entry sg_table mapped as I/O (no struct page backing). */ - *sgt = kzalloc_obj(**sgt, GFP_KERNEL); + *sgt = kzalloc_obj(**sgt); if (!*sgt) return -ENOMEM; r = sg_alloc_table(*sgt, 1, GFP_KERNEL); @@ -1172,7 +1172,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo, struct amdgpu_ttm_tt *gtt; enum ttm_caching caching; - gtt = kzalloc_obj(struct amdgpu_ttm_tt, GFP_KERNEL); + gtt = kzalloc_obj(struct amdgpu_ttm_tt); if (!gtt) return NULL; @@ -1213,7 +1213,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev, /* user pages are bound by amdgpu_ttm_tt_pin_userptr() */ if (gtt->userptr) { - ttm->sg = kzalloc_obj(struct sg_table, GFP_KERNEL); + ttm->sg = kzalloc_obj(struct sg_table); if (!ttm->sg) return -ENOMEM; return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index 97352c56e7a2..9d67b770bcc2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -217,7 +217,7 @@ static int amdgpu_userq_buffer_va_list_add(struct amdgpu_usermode_queue *queue, struct amdgpu_userq_va_cursor *va_cursor; struct userq_va_list; - va_cursor = kzalloc_obj(*va_cursor, GFP_KERNEL); + va_cursor = kzalloc_obj(*va_cursor); if (!va_cursor) return -ENOMEM; @@ -781,7 +781,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) goto unlock; } - queue = kzalloc_obj(struct amdgpu_usermode_queue, GFP_KERNEL); + queue = kzalloc_obj(struct amdgpu_usermode_queue); if (!queue) { drm_file_err(uq_mgr->file, "Failed to allocate memory for queue\n"); r = -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 38693bb7f8d4..8013260e29dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c @@ -82,7 +82,7 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev, unsigned long flags; int r; - fence_drv = kzalloc_obj(*fence_drv, GFP_KERNEL); + fence_drv = kzalloc_obj(*fence_drv); if (!fence_drv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index 50b75c562281..522d5bd76269 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -294,15 +294,15 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev) void *bps = NULL; struct amdgpu_bo **bps_bo = NULL; - *data = kmalloc_obj(struct amdgpu_virt_ras_err_handler_data, GFP_KERNEL); + *data = kmalloc_obj(struct amdgpu_virt_ras_err_handler_data); if (!*data) goto data_failure; - bps = kmalloc_objs(*(*data)->bps, align_space, GFP_KERNEL); + bps = kmalloc_objs(*(*data)->bps, align_space); if (!bps) goto bps_failure; - bps_bo = kmalloc_objs(*(*data)->bps_bo, align_space, GFP_KERNEL); + bps_bo = kmalloc_objs(*(*data)->bps_bo, align_space); if (!bps_bo) goto bps_bo_failure; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index 8931279cdea6..2c19b65de840 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -411,7 +411,7 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev, struct drm_plane *plane; int ret; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index d946c39c4acb..f2beb980e3c3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1118,7 +1118,7 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm, if (!drm_dev_enter(adev_to_drm(adev), &idx)) return -ENODEV; - tlb_cb = kmalloc_obj(*tlb_cb, GFP_KERNEL); + tlb_cb = kmalloc_obj(*tlb_cb); if (!tlb_cb) { drm_dev_exit(idx); return -ENOMEM; @@ -1471,7 +1471,7 @@ static void amdgpu_vm_add_prt_cb(struct amdgpu_device *adev, if (!adev->gmc.gmc_funcs->set_prt) return; - cb = kmalloc_obj(struct amdgpu_prt_cb, GFP_KERNEL); + cb = kmalloc_obj(struct amdgpu_prt_cb); if (!cb) { /* Last resort when we are OOM */ if (fence) @@ -1737,7 +1737,7 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev, amdgpu_vm_assert_locked(vm); - bo_va = kzalloc_obj(struct amdgpu_bo_va, GFP_KERNEL); + bo_va = kzalloc_obj(struct amdgpu_bo_va); if (bo_va == NULL) { return NULL; } @@ -1866,7 +1866,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, return -EINVAL; } - mapping = kmalloc_obj(*mapping, GFP_KERNEL); + mapping = kmalloc_obj(*mapping); if (!mapping) return -ENOMEM; @@ -1913,7 +1913,7 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev, return r; /* Allocate all the needed memory */ - mapping = kmalloc_obj(*mapping, GFP_KERNEL); + mapping = kmalloc_obj(*mapping); if (!mapping) return -ENOMEM; @@ -2033,12 +2033,12 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev, eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE; /* Allocate all the needed memory */ - before = kzalloc_obj(*before, GFP_KERNEL); + before = kzalloc_obj(*before); if (!before) return -ENOMEM; INIT_LIST_HEAD(&before->list); - after = kzalloc_obj(*after, GFP_KERNEL); + after = kzalloc_obj(*after); if (!after) { kfree(before); return -ENOMEM; @@ -2533,7 +2533,7 @@ amdgpu_vm_get_task_info_pasid(struct amdgpu_device *adev, u32 pasid) static int amdgpu_vm_create_task_info(struct amdgpu_vm *vm) { - vm->task_info = kzalloc_obj(struct amdgpu_task_info, GFP_KERNEL); + vm->task_info = kzalloc_obj(struct amdgpu_task_info); if (!vm->task_info) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c index b3e47efeef62..82b8badde453 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c @@ -80,7 +80,7 @@ void amdgpu_vm_tlb_fence_create(struct amdgpu_device *adev, struct amdgpu_vm *vm { struct amdgpu_tlb_fence *f; - f = kmalloc_obj(*f, GFP_KERNEL); + f = kmalloc_obj(*f); if (!f) { /* * We can't fail since the PDEs and PTEs are already updated, so diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 6252246dcd68..6c9b3e21e15c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -340,7 +340,7 @@ int amdgpu_vram_mgr_reserve_range(struct amdgpu_vram_mgr *mgr, { struct amdgpu_vram_reservation *rsv; - rsv = kzalloc_obj(*rsv, GFP_KERNEL); + rsv = kzalloc_obj(*rsv); if (!rsv) return -ENOMEM; @@ -478,7 +478,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, tbo->page_alignment); } - vres = kzalloc_obj(*vres, GFP_KERNEL); + vres = kzalloc_obj(*vres); if (!vres) return -ENOMEM; @@ -684,7 +684,7 @@ int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev, int num_entries = 0; int i, r; - *sgt = kmalloc_obj(**sgt, GFP_KERNEL); + *sgt = kmalloc_obj(**sgt); if (!*sgt) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index df5b70c9f911..cc5f4e01e38f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@ -334,7 +334,7 @@ int amdgpu_xcp_mgr_init(struct amdgpu_device *adev, int init_mode, if (!xcp_funcs || !xcp_funcs->get_ip_details) return -EINVAL; - xcp_mgr = kzalloc_obj(*xcp_mgr, GFP_KERNEL); + xcp_mgr = kzalloc_obj(*xcp_mgr); if (!xcp_mgr) return -ENOMEM; @@ -907,7 +907,7 @@ static void amdgpu_xcp_cfg_sysfs_init(struct amdgpu_device *adev) if (!adev->xcp_mgr) return; - xcp_cfg = kzalloc_obj(*xcp_cfg, GFP_KERNEL); + xcp_cfg = kzalloc_obj(*xcp_cfg); if (!xcp_cfg) return; xcp_cfg->xcp_mgr = adev->xcp_mgr; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index fe06ab35ba76..11e56df1d91b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -690,7 +690,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev) goto pro_end; } - hive = kzalloc_obj(*hive, GFP_KERNEL); + hive = kzalloc_obj(*hive); if (!hive) { dev_err(adev->dev, "XGMI: allocation failed\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c index 51fa402e8b64..e4ce3029d3fb 100644 --- a/drivers/gpu/drm/amd/amdgpu/atom.c +++ b/drivers/gpu/drm/amd/amdgpu/atom.c @@ -1524,7 +1524,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios) { int base; struct atom_context *ctx = - kzalloc_obj(struct atom_context, GFP_KERNEL); + kzalloc_obj(struct atom_context); struct _ATOM_ROM_HEADER *atom_rom_header; struct _ATOM_MASTER_DATA_TABLE *master_table; struct _ATOM_FIRMWARE_INFO *atom_fw_info; diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 8e0841d3ca75..afb788d61011 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -191,7 +191,7 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode goto register_acpi_backlight; } - pdata = kmalloc_obj(struct amdgpu_backlight_privdata, GFP_KERNEL); + pdata = kmalloc_obj(struct amdgpu_backlight_privdata); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -1980,7 +1980,7 @@ amdgpu_atombios_encoder_get_lcd_info(struct amdgpu_encoder *encoder) lvds_info = (union lvds_info *)(mode_info->atom_context->bios + data_offset); lvds = - kzalloc_obj(struct amdgpu_encoder_atom_dig, GFP_KERNEL); + kzalloc_obj(struct amdgpu_encoder_atom_dig); if (!lvds) return NULL; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index de1ccfe584d7..0bbc29ec5a3a 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -3517,7 +3517,7 @@ static void dce_v10_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 723a71c8bd38..103642f156ed 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -3414,7 +3414,7 @@ static void dce_v6_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 0a4a8f0084b1..e016cbdf28e4 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -3425,7 +3425,7 @@ static void dce_v8_0_encoder_add(struct amdgpu_device *adev, } /* add a new one */ - amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder, GFP_KERNEL); + amdgpu_encoder = kzalloc_obj(struct amdgpu_encoder); if (!amdgpu_encoder) return; diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c index f5785d9c6212..3a2473655b6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c @@ -50,7 +50,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp_base = adev->rmmio_base; - isp->isp_cell = kzalloc_objs(struct mfd_cell, 3, GFP_KERNEL); + isp->isp_cell = kzalloc_objs(struct mfd_cell, 3); if (!isp->isp_cell) { r = -ENOMEM; drm_err(&adev->ddev, @@ -59,7 +59,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) } num_res = MAX_ISP410_MEM_RES + MAX_ISP410_INT_SRC; - isp->isp_res = kzalloc_objs(struct resource, num_res, GFP_KERNEL); + isp->isp_res = kzalloc_objs(struct resource, num_res); if (!isp->isp_res) { r = -ENOMEM; drm_err(&adev->ddev, @@ -67,7 +67,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) goto failure; } - isp->isp_pdata = kzalloc_obj(*isp->isp_pdata, GFP_KERNEL); + isp->isp_pdata = kzalloc_obj(*isp->isp_pdata); if (!isp->isp_pdata) { r = -ENOMEM; drm_err(&adev->ddev, @@ -106,7 +106,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data); /* initialize isp i2c platform data */ - isp->isp_i2c_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); + isp->isp_i2c_res = kzalloc_objs(struct resource, 1); if (!isp->isp_i2c_res) { r = -ENOMEM; drm_err(&adev->ddev, @@ -126,7 +126,7 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) isp->isp_cell[1].pdata_size = sizeof(struct isp_platform_data); /* initialize isp gpiochip platform data */ - isp->isp_gpio_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); + isp->isp_gpio_res = kzalloc_objs(struct resource, 1); if (!isp->isp_gpio_res) { r = -ENOMEM; drm_err(&adev->ddev, diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c index e757087d51d2..b3590b33cab9 100644 --- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c @@ -259,7 +259,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) return -EINVAL; } - isp->isp_cell = kzalloc_objs(struct mfd_cell, 3, GFP_KERNEL); + isp->isp_cell = kzalloc_objs(struct mfd_cell, 3); if (!isp->isp_cell) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd cell alloc failed (%d)\n", r); @@ -268,14 +268,14 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) num_res = MAX_ISP411_MEM_RES + MAX_ISP411_INT_SRC; - isp->isp_res = kzalloc_objs(struct resource, num_res, GFP_KERNEL); + isp->isp_res = kzalloc_objs(struct resource, num_res); if (!isp->isp_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd resource alloc failed (%d)\n", r); goto failure; } - isp->isp_pdata = kzalloc_obj(*isp->isp_pdata, GFP_KERNEL); + isp->isp_pdata = kzalloc_obj(*isp->isp_pdata); if (!isp->isp_pdata) { r = -ENOMEM; drm_err(&adev->ddev, "isp platform data alloc failed (%d)\n", r); @@ -317,7 +317,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data); /* initialize isp i2c platform data */ - isp->isp_i2c_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); + isp->isp_i2c_res = kzalloc_objs(struct resource, 1); if (!isp->isp_i2c_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp mfd res alloc failed (%d)\n", r); @@ -336,7 +336,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) isp->isp_cell[1].pdata_size = sizeof(struct isp_platform_data); /* initialize isp gpiochip platform data */ - isp->isp_gpio_res = kzalloc_objs(struct resource, 1, GFP_KERNEL); + isp->isp_gpio_res = kzalloc_objs(struct resource, 1); if (!isp->isp_gpio_res) { r = -ENOMEM; drm_err(&adev->ddev, "isp gpio resource alloc failed (%d)\n", r); diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c index 9e9a8e354c06..8c74894254f7 100644 --- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c +++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c @@ -283,7 +283,7 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, int r; /* Structure to initialize MQD for userqueue using generic MQD init function */ - userq_props = kzalloc_obj(struct amdgpu_mqd_prop, GFP_KERNEL); + userq_props = kzalloc_obj(struct amdgpu_mqd_prop); if (!userq_props) { DRM_ERROR("Failed to allocate memory for userq_props\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c index 4de461fa9cdd..cb58032109e2 100644 --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c @@ -273,7 +273,7 @@ int sienna_cichlid_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c index e91e70844e49..11a574e8d3d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c @@ -270,7 +270,7 @@ int smu_v13_0_10_reset_init(struct amdgpu_device *adev) { struct amdgpu_reset_control *reset_ctl; - reset_ctl = kzalloc_obj(*reset_ctl, GFP_KERNEL); + reset_ctl = kzalloc_obj(*reset_ctl); if (!reset_ctl) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c index 25af2707b5ca..1f80045775f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c @@ -567,7 +567,7 @@ static int umc_v12_0_update_ecc_status(struct amdgpu_device *adev, if (ret) return ret; - ecc_err = kzalloc_obj(*ecc_err, GFP_KERNEL); + ecc_err = kzalloc_obj(*ecc_err); if (!ecc_err) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index f8c9ccbc4851..b188f099077e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -2468,7 +2468,7 @@ static int criu_restore_bos(struct kfd_process *p, /* Prevent MMU notifications until stage-4 IOCTL (CRIU_RESUME) is received */ amdgpu_amdkfd_block_mmu_notifications(p->kgd_process_info); - bo_buckets = kvmalloc_objs(*bo_buckets, args->num_bos, GFP_KERNEL); + bo_buckets = kvmalloc_objs(*bo_buckets, args->num_bos); if (!bo_buckets) return -ENOMEM; @@ -2486,7 +2486,7 @@ static int criu_restore_bos(struct kfd_process *p, goto exit; } - bo_privs = kvmalloc_objs(*bo_privs, args->num_bos, GFP_KERNEL); + bo_privs = kvmalloc_objs(*bo_privs, args->num_bos); if (!bo_privs) { ret = -ENOMEM; goto exit; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c index 46ea876629bc..7d4e07452cdb 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c @@ -146,7 +146,7 @@ void kfd_debugfs_add_process(struct kfd_process *p) char name[MAX_DEBUGFS_FILENAME_LEN]; struct debugfs_proc_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index d03c3398695b..8ff97bf7d95a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -478,7 +478,7 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf) return NULL; } - kfd = kzalloc_obj(*kfd, GFP_KERNEL); + kfd = kzalloc_obj(*kfd); if (!kfd) return NULL; @@ -864,7 +864,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, /* Allocate the KFD nodes */ for (i = 0, xcp_idx = 0; i < kfd->num_nodes; i++) { - node = kzalloc_obj(struct kfd_node, GFP_KERNEL); + node = kzalloc_obj(struct kfd_node); if (!node) goto node_alloc_error; @@ -1328,7 +1328,7 @@ int kfd_gtt_sa_allocate(struct kfd_node *node, unsigned int size, if (size > kfd->gtt_sa_num_of_chunks * kfd->gtt_sa_chunk_size) return -ENOMEM; - *mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); + *mem_obj = kzalloc_obj(struct kfd_mem_obj); if (!(*mem_obj)) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 7707496761ea..3ddf06c755b5 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1401,7 +1401,7 @@ static int register_process(struct device_queue_manager *dqm, uint64_t pd_base; int retval; - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) return -ENOMEM; @@ -2921,7 +2921,7 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_node *dev) pr_debug("Loading device queue manager\n"); - dqm = kzalloc_obj(*dqm, GFP_KERNEL); + dqm = kzalloc_obj(*dqm); if (!dqm) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index 950717576e20..a2fdf0d451ef 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -67,7 +67,7 @@ static struct kfd_signal_page *allocate_signal_page(struct kfd_process *p) void *backing_store; struct kfd_signal_page *page; - page = kzalloc_obj(*page, GFP_KERNEL); + page = kzalloc_obj(*page); if (!page) return NULL; @@ -337,7 +337,7 @@ static int kfd_event_page_set(struct kfd_process *p, void *kernel_address, return -EINVAL; } - page = kzalloc_obj(*page, GFP_KERNEL); + page = kzalloc_obj(*page); if (!page) return -ENOMEM; @@ -405,7 +405,7 @@ int kfd_event_create(struct file *devkfd, struct kfd_process *p, uint64_t *event_page_offset, uint32_t *event_slot_index) { int ret = 0; - struct kfd_event *ev = kzalloc_obj(*ev, GFP_KERNEL); + struct kfd_event *ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -458,11 +458,11 @@ int kfd_criu_restore_event(struct file *devkfd, struct kfd_event *ev = NULL; int ret = 0; - ev_priv = kmalloc_obj(*ev_priv, GFP_KERNEL); + ev_priv = kmalloc_obj(*ev_priv); if (!ev_priv) return -ENOMEM; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) { ret = -ENOMEM; goto exit; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index 9e28dda09285..3ffa081daaec 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c @@ -309,7 +309,7 @@ struct kernel_queue *kernel_queue_init(struct kfd_node *dev, { struct kernel_queue *kq; - kq = kzalloc_obj(*kq, GFP_KERNEL); + kq = kzalloc_obj(*kq); if (!kq) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c index 93f389ba8cc9..723b725d20b8 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c @@ -51,7 +51,7 @@ struct kfd_mem_obj *allocate_hiq_mqd(struct mqd_manager *mm, struct queue_proper struct kfd_mem_obj *mqd_mem_obj; struct kfd_node *dev = mm->dev; - mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj); if (!mqd_mem_obj) return NULL; @@ -69,7 +69,7 @@ struct kfd_mem_obj *allocate_sdma_mqd(struct mqd_manager *mm, struct kfd_node *dev = mm->dev; uint64_t offset; - mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj); if (!mqd_mem_obj) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c index 575aebee8ad1..562d475cf4c9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c @@ -389,7 +389,7 @@ struct mqd_manager *mqd_manager_init_cik(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c index daf5e487d87e..d6067316d7f4 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c @@ -451,7 +451,7 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c index fd258bbc37b4..e3a7acb0ccbc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c @@ -465,7 +465,7 @@ struct mqd_manager *mqd_manager_init_v11(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c index e826a4149ff0..0b97376fc6f9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c @@ -385,7 +385,7 @@ struct mqd_manager *mqd_manager_init_v12(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c index 6fa17465d3fa..eef6bdce4be3 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c @@ -646,7 +646,7 @@ struct mqd_manager *mqd_manager_init_v12_1(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c index 5d3b500a4146..d5c234f30e8d 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c @@ -147,7 +147,7 @@ static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, * amdgpu memory functions to do so. */ if (node->kfd->cwsr_enabled && (q->type == KFD_QUEUE_TYPE_COMPUTE)) { - mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj, GFP_KERNEL); + mqd_mem_obj = kzalloc_obj(struct kfd_mem_obj); if (!mqd_mem_obj) return NULL; retval = amdgpu_amdkfd_alloc_kernel_mem(node->adev, @@ -960,7 +960,7 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c index 27875d88a5ea..69c1b8a690b8 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c @@ -446,7 +446,7 @@ struct mqd_manager *mqd_manager_init_vi(enum KFD_MQD_TYPE type, if (WARN_ON(type >= KFD_MQD_TYPE_MAX)) return NULL; - mqd = kzalloc_obj(*mqd, GFP_KERNEL); + mqd = kzalloc_obj(*mqd); if (!mqd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index a5f479af3607..e5b56412931b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -91,7 +91,7 @@ /* Macro for allocating structures */ #define kfd_alloc_struct(ptr_to_struct) \ - ((typeof(ptr_to_struct)) kzalloc_obj(*ptr_to_struct, GFP_KERNEL)) + ((typeof(ptr_to_struct)) kzalloc_obj(*ptr_to_struct)) #define KFD_MAX_NUM_OF_PROCESSES 512 #define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024 diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index ff64bde0acd2..8283098b2388 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -153,7 +153,7 @@ static void kfd_sdma_activity_worker(struct work_struct *work) (q->properties.type != KFD_QUEUE_TYPE_SDMA_XGMI)) continue; - sdma_q = kzalloc_obj(struct temp_sdma_queue_list, GFP_KERNEL); + sdma_q = kzalloc_obj(struct temp_sdma_queue_list); if (!sdma_q) { dqm_unlock(dqm); goto cleanup; @@ -1593,7 +1593,7 @@ struct kfd_process *create_process(const struct task_struct *thread, bool primar struct mmu_notifier *mn; int err = -ENOMEM; - process = kzalloc_obj(*process, GFP_KERNEL); + process = kzalloc_obj(*process); if (!process) goto err_alloc_process; @@ -1709,7 +1709,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, if (WARN_ON_ONCE(p->n_pdds >= MAX_GPU_INSTANCE)) return NULL; - pdd = kzalloc_obj(*pdd, GFP_KERNEL); + pdd = kzalloc_obj(*pdd); if (!pdd) return NULL; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index dac1f9604d8e..8ea31699d38b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -383,7 +383,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, memset(pdd->proc_ctx_cpu_ptr, 0, AMDGPU_MES_PROC_CTX_SIZE); } - pqn = kzalloc_obj(*pqn, GFP_KERNEL); + pqn = kzalloc_obj(*pqn); if (!pqn) { retval = -ENOMEM; goto err_allocate_pqn; @@ -991,7 +991,7 @@ int kfd_criu_restore_queue(struct kfd_process *p, if (*priv_data_offset + sizeof(*q_data) > max_priv_data_size) return -EINVAL; - q_data = kmalloc_obj(*q_data, GFP_KERNEL); + q_data = kmalloc_obj(*q_data); if (!q_data) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c index 1285c70a1c3b..bbe869ceae3f 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_queue.c @@ -70,7 +70,7 @@ int init_queue(struct queue **q, const struct queue_properties *properties) { struct queue *tmp_q; - tmp_q = kzalloc_obj(*tmp_q, GFP_KERNEL); + tmp_q = kzalloc_obj(*tmp_q); if (!tmp_q) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c index 242e58fea05e..15975c23a88e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c @@ -370,7 +370,7 @@ int kfd_smi_event_open(struct kfd_node *dev, uint32_t *fd) struct kfd_smi_client *client; int ret; - client = kzalloc_obj(struct kfd_smi_client, GFP_KERNEL); + client = kzalloc_obj(struct kfd_smi_client); if (!client) return -ENOMEM; INIT_LIST_HEAD(&client->list); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index e168a74190e3..080242f9981b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -168,7 +168,7 @@ svm_range_dma_map_dev(struct amdgpu_device *adev, struct svm_range *prange, int i, r; if (!addr) { - addr = kvzalloc_objs(*addr, prange->npages, GFP_KERNEL); + addr = kvzalloc_objs(*addr, prange->npages); if (!addr) return -ENOMEM; prange->dma_addr[gpuidx] = addr; @@ -329,7 +329,7 @@ svm_range *svm_range_new(struct svm_range_list *svms, uint64_t start, struct svm_range *prange; struct kfd_process *p; - prange = kzalloc_obj(*prange, GFP_KERNEL); + prange = kzalloc_obj(*prange); if (!prange) return NULL; @@ -539,7 +539,7 @@ static struct svm_range_bo *svm_range_bo_new(void) { struct svm_range_bo *svm_bo; - svm_bo = kzalloc_obj(*svm_bo, GFP_KERNEL); + svm_bo = kzalloc_obj(*svm_bo); if (!svm_bo) return NULL; @@ -1674,7 +1674,7 @@ static int svm_range_validate_and_map(struct mm_struct *mm, int32_t idx; int r = 0; - ctx = kzalloc_obj(struct svm_validate_context, GFP_KERNEL); + ctx = kzalloc_obj(struct svm_validate_context); if (!ctx) return -ENOMEM; ctx->process = container_of(prange->svms, struct kfd_process, svms); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 8aa86502fceb..995f2c2528a9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -711,7 +711,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(mem, &dev->mem_props, list) { - mem->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + mem->kobj = kzalloc_obj(struct kobject); if (!mem->kobj) return -ENOMEM; ret = kobject_init_and_add(mem->kobj, &mem_type, @@ -732,7 +732,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(cache, &dev->cache_props, list) { - cache->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + cache->kobj = kzalloc_obj(struct kobject); if (!cache->kobj) return -ENOMEM; ret = kobject_init_and_add(cache->kobj, &cache_type, @@ -753,7 +753,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(iolink, &dev->io_link_props, list) { - iolink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + iolink->kobj = kzalloc_obj(struct kobject); if (!iolink->kobj) return -ENOMEM; ret = kobject_init_and_add(iolink->kobj, &iolink_type, @@ -774,7 +774,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, i = 0; list_for_each_entry(p2plink, &dev->p2p_link_props, list) { - p2plink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + p2plink->kobj = kzalloc_obj(struct kobject); if (!p2plink->kobj) return -ENOMEM; ret = kobject_init_and_add(p2plink->kobj, &iolink_type, @@ -1381,7 +1381,7 @@ static int kfd_build_p2p_node_entry(struct kfd_topology_device *dev, { int ret; - p2plink->kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + p2plink->kobj = kzalloc_obj(struct kobject); if (!p2plink->kobj) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 10bc1d252b1f..988f42998010 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1724,7 +1724,7 @@ dm_allocate_gpu_mem( AMDGPU_GEM_DOMAIN_GTT : AMDGPU_GEM_DOMAIN_VRAM; int ret; - da = kzalloc_obj(struct dal_allocation, GFP_KERNEL); + da = kzalloc_obj(struct dal_allocation); if (!da) return NULL; @@ -2526,7 +2526,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) } - adev->dm.dmub_srv = kzalloc_obj(*adev->dm.dmub_srv, GFP_KERNEL); + adev->dm.dmub_srv = kzalloc_obj(*adev->dm.dmub_srv); dmub_srv = adev->dm.dmub_srv; if (!dmub_srv) { @@ -2607,7 +2607,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) memory_params.region_info = ®ion_info; memory_params.window_memory_type = window_memory_type; - adev->dm.dmub_fb_info = kzalloc_obj(*adev->dm.dmub_fb_info, GFP_KERNEL); + adev->dm.dmub_fb_info = kzalloc_obj(*adev->dm.dmub_fb_info); fb_info = adev->dm.dmub_fb_info; if (!fb_info) { @@ -3363,7 +3363,7 @@ static void dm_gpureset_commit_state(struct dc_state *dc_state, } *bundle __free(kfree); int k, m; - bundle = kzalloc_obj(*bundle, GFP_KERNEL); + bundle = kzalloc_obj(*bundle); if (!bundle) { drm_err(dm->ddev, "Failed to allocate update bundle\n"); @@ -3931,7 +3931,7 @@ void amdgpu_dm_update_connector_after_detect( if (!aconnector->timing_requested) { aconnector->timing_requested = - kzalloc_obj(struct dc_crtc_timing, GFP_KERNEL); + kzalloc_obj(struct dc_crtc_timing); if (!aconnector->timing_requested) drm_err(dev, "failed to create aconnector->requested_timing\n"); @@ -4882,7 +4882,7 @@ dm_atomic_duplicate_state(struct drm_private_obj *obj) { struct dm_atomic_state *old_state, *new_state; - new_state = kzalloc_obj(*new_state, GFP_KERNEL); + new_state = kzalloc_obj(*new_state); if (!new_state) return NULL; @@ -4939,7 +4939,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) /* indicates support for immediate flip */ adev_to_drm(adev)->mode_config.async_page_flip = true; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; @@ -5367,7 +5367,7 @@ static int initialize_plane(struct amdgpu_display_manager *dm, unsigned long possible_crtcs; int ret = 0; - plane = kzalloc_obj(struct drm_plane, GFP_KERNEL); + plane = kzalloc_obj(struct drm_plane); if (!plane) { drm_err(adev_to_drm(dm->adev), "KMS: Failed to allocate plane\n"); return -ENOMEM; @@ -5626,11 +5626,11 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) continue; } - aconnector = kzalloc_obj(*aconnector, GFP_KERNEL); + aconnector = kzalloc_obj(*aconnector); if (!aconnector) goto fail; - aencoder = kzalloc_obj(*aencoder, GFP_KERNEL); + aencoder = kzalloc_obj(*aencoder); if (!aencoder) goto fail; @@ -7824,7 +7824,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) kfree(state); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) { state->scaling = RMX_OFF; @@ -9099,7 +9099,7 @@ static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap, if (!ddc_service->ddc_pin) return result; - cmd.payloads = kzalloc_objs(struct i2c_payload, num, GFP_KERNEL); + cmd.payloads = kzalloc_objs(struct i2c_payload, num); if (!cmd.payloads) return result; @@ -9148,7 +9148,7 @@ create_i2c(struct ddc_service *ddc_service, bool oem) struct amdgpu_device *adev = ddc_service->ctx->driver_context; struct amdgpu_i2c_adapter *i2c; - i2c = kzalloc_obj(struct amdgpu_i2c_adapter, GFP_KERNEL); + i2c = kzalloc_obj(struct amdgpu_i2c_adapter); if (!i2c) return NULL; i2c->base.owner = THIS_MODULE; @@ -9949,7 +9949,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, struct dc_stream_update stream_update; } *bundle; - bundle = kzalloc_obj(*bundle, GFP_KERNEL); + bundle = kzalloc_obj(*bundle); if (!bundle) { drm_err(dev, "Failed to allocate update bundle\n"); @@ -10624,7 +10624,7 @@ static void dm_set_writeback(struct amdgpu_display_manager *dm, struct amdgpu_framebuffer *afb; int i = 0; - wb_info = kzalloc_obj(*wb_info, GFP_KERNEL); + wb_info = kzalloc_obj(*wb_info); if (!wb_info) { drm_err(adev_to_drm(adev), "Failed to allocate wb_info\n"); return; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index 76405a351111..2ba98f384685 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -1227,7 +1227,7 @@ int amdgpu_dm_check_crtc_color_mgmt(struct dm_crtc_state *crtc, crtc->cm_is_degamma_srgb = false; if (check_only) { - out_tf = kvzalloc_obj(*out_tf, GFP_KERNEL); + out_tf = kvzalloc_obj(*out_tf); if (!out_tf) return -ENOMEM; } else { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c index 2f072167bcc5..f25c0ede7199 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c @@ -66,7 +66,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr memset(ops, 0, sizeof(ops)); /* 1D curve - DEGAM TF */ - ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0]); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -83,7 +83,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* Multiplier */ - ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -98,7 +98,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3x4 matrix */ - ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -114,7 +114,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr if (adev->dm.dc->caps.color.dpp.hw_3d_lut) { /* 1D curve - SHAPER TF */ - ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0]); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -131,7 +131,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 1D LUT - SHAPER LUT */ - ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0]); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -148,7 +148,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3D LUT */ - ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0]); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -166,7 +166,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr } /* 1D curve - BLND TF */ - ops[i] = kzalloc_obj(*ops[0], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[0]); if (!ops[i]) { ret = -ENOMEM; goto cleanup; @@ -183,7 +183,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 1D LUT - BLND LUT */ - ops[i] = kzalloc_obj(struct drm_colorop, GFP_KERNEL); + ops[i] = kzalloc_obj(struct drm_colorop); if (!ops[i]) { ret = -ENOMEM; goto cleanup; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 49f68ddcfec8..130190e8a1b2 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -231,7 +231,7 @@ struct idle_workqueue *idle_create_workqueue(struct amdgpu_device *adev) { struct idle_workqueue *idle_work; - idle_work = kzalloc_obj(*idle_work, GFP_KERNEL); + idle_work = kzalloc_obj(*idle_work); if (ZERO_OR_NULL_PTR(idle_work)) return NULL; @@ -447,7 +447,7 @@ static struct drm_crtc_state *amdgpu_dm_crtc_duplicate_state(struct drm_crtc *cr if (WARN_ON(!crtc->state)) return NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; @@ -487,7 +487,7 @@ static void amdgpu_dm_crtc_reset_state(struct drm_crtc *crtc) if (crtc->state) amdgpu_dm_crtc_destroy_state(crtc, crtc->state); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (WARN_ON(!state)) return; @@ -728,14 +728,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, bool has_degamma; int res = -ENOMEM; - cursor_plane = kzalloc_obj(*cursor_plane, GFP_KERNEL); + cursor_plane = kzalloc_obj(*cursor_plane); if (!cursor_plane) goto fail; cursor_plane->type = DRM_PLANE_TYPE_CURSOR; res = amdgpu_dm_plane_init(dm, cursor_plane, 0, NULL); - acrtc = kzalloc_obj(struct amdgpu_crtc, GFP_KERNEL); + acrtc = kzalloc_obj(struct amdgpu_crtc); if (!acrtc) goto fail; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index b43ec19848fd..24bc2a86904b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -4301,7 +4301,7 @@ static ssize_t dcc_en_bits_read( int *dcc_en_bits; int i, r; - dcc_en_bits = kzalloc_objs(int, num_pipes, GFP_KERNEL); + dcc_en_bits = kzalloc_objs(int, num_pipes); if (!dcc_en_bits) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c index 3b26797c9d03..eb73bbf8f411 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c @@ -746,7 +746,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct hdcp_workqueue *hdcp_work; int i = 0; - hdcp_work = kzalloc_objs(*hdcp_work, max_caps, GFP_KERNEL); + hdcp_work = kzalloc_objs(*hdcp_work, max_caps); if (ZERO_OR_NULL_PTR(hdcp_work)) return NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index d26003d2a2cc..a09761f9882d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -617,7 +617,7 @@ bool dm_helpers_submit_i2c( return false; } - msgs = kzalloc_objs(struct i2c_msg, num, GFP_KERNEL); + msgs = kzalloc_objs(struct i2c_msg, num); if (!msgs) return false; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c index dfb80689d889..e49803a90eda 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c @@ -313,7 +313,7 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev, if (false == validate_irq_registration_params(int_params, ih)) return DAL_INVALID_IRQ_HANDLER_IDX; - handler_data = kzalloc_obj(*handler_data, GFP_KERNEL); + handler_data = kzalloc_obj(*handler_data); if (!handler_data) { DRM_ERROR("DM_IRQ: failed to allocate irq handler!\n"); return DAL_INVALID_IRQ_HANDLER_IDX; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 781163d6b23b..7be50e8c0636 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -640,7 +640,7 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_connector *connector; int i; - aconnector = kzalloc_obj(*aconnector, GFP_KERNEL); + aconnector = kzalloc_obj(*aconnector); if (!aconnector) return NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index c50583a05ce3..70587e5a8d46 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1470,7 +1470,7 @@ static void amdgpu_dm_plane_drm_plane_reset(struct drm_plane *plane) if (plane->state) plane->funcs->atomic_destroy_state(plane, plane->state); - amdgpu_state = kzalloc_obj(*amdgpu_state, GFP_KERNEL); + amdgpu_state = kzalloc_obj(*amdgpu_state); WARN_ON(amdgpu_state == NULL); if (!amdgpu_state) @@ -1488,7 +1488,7 @@ static struct drm_plane_state *amdgpu_dm_plane_drm_plane_duplicate_state(struct struct dm_plane_state *dm_plane_state, *old_dm_plane_state; old_dm_plane_state = to_dm_plane_state(plane->state); - dm_plane_state = kzalloc_obj(*dm_plane_state, GFP_KERNEL); + dm_plane_state = kzalloc_obj(*dm_plane_state); if (!dm_plane_state) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c index dbc4c2e0e514..9ae1399549c3 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c @@ -120,11 +120,11 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; - yclk = kzalloc_objs(*yclk, 3, GFP_KERNEL); + yclk = kzalloc_objs(*yclk, 3); if (!yclk) return; - sclk = kzalloc_objs(*sclk, 8, GFP_KERNEL); + sclk = kzalloc_objs(*sclk, 8); if (!sclk) goto free_yclk; @@ -2051,11 +2051,11 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id); - dceip = kzalloc_obj(*dceip, GFP_KERNEL); + dceip = kzalloc_obj(*dceip); if (!dceip) return; - vbios = kzalloc_obj(*vbios, GFP_KERNEL); + vbios = kzalloc_obj(*vbios); if (!vbios) { kfree(dceip); return; diff --git a/drivers/gpu/drm/amd/display/dc/basics/vector.c b/drivers/gpu/drm/amd/display/dc/basics/vector.c index 8f6b780b7778..a8b750ff8573 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/vector.c +++ b/drivers/gpu/drm/amd/display/dc/basics/vector.c @@ -94,7 +94,7 @@ struct vector *dal_vector_presized_create( void *initial_value, uint32_t struct_size) { - struct vector *vector = kzalloc_obj(struct vector, GFP_KERNEL); + struct vector *vector = kzalloc_obj(struct vector); if (vector == NULL) return NULL; @@ -113,7 +113,7 @@ struct vector *dal_vector_create( uint32_t capacity, uint32_t struct_size) { - struct vector *vector = kzalloc_obj(struct vector, GFP_KERNEL); + struct vector *vector = kzalloc_obj(struct vector); if (vector == NULL) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c index 65993314c5cd..73e3c45eeeba 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c @@ -98,7 +98,7 @@ struct dc_bios *bios_parser_create( { struct bios_parser *bp; - bp = kzalloc_obj(struct bios_parser, GFP_KERNEL); + bp = kzalloc_obj(struct bios_parser); if (!bp) return NULL; @@ -2667,7 +2667,7 @@ static struct integrated_info *bios_parser_create_integrated_info( struct bios_parser *bp = BP_FROM_DCB(dcb); struct integrated_info *info; - info = kzalloc_obj(struct integrated_info, GFP_KERNEL); + info = kzalloc_obj(struct integrated_info); if (info == NULL) { ASSERT_CRITICAL(0); diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c index 9da95c59a68b..94fddf22f5a9 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c @@ -3207,7 +3207,7 @@ static struct integrated_info *bios_parser_create_integrated_info( struct bios_parser *bp = BP_FROM_DCB(dcb); struct integrated_info *info; - info = kzalloc_obj(struct integrated_info, GFP_KERNEL); + info = kzalloc_obj(struct integrated_info); if (info == NULL) { ASSERT_CRITICAL(0); @@ -3793,7 +3793,7 @@ struct dc_bios *firmware_parser_create( { struct bios_parser *bp; - bp = kzalloc_obj(struct bios_parser, GFP_KERNEL); + bp = kzalloc_obj(struct bios_parser); if (!bp) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index e05a6a9d66ff..1481915d4d71 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -284,7 +284,7 @@ static bool create_links( } for (i = 0; i < num_virtual_links; i++) { - struct dc_link *link = kzalloc_obj(*link, GFP_KERNEL); + struct dc_link *link = kzalloc_obj(*link); struct encoder_init_data enc_init = {0}; if (link == NULL) { @@ -304,7 +304,7 @@ static bool create_links( link->link_id.enum_id = ENUM_ID_1; link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED; link->replay_settings.config.replay_version = DC_REPLAY_VERSION_UNSUPPORTED; - link->link_enc = kzalloc_obj(*link->link_enc, GFP_KERNEL); + link->link_enc = kzalloc_obj(*link->link_enc); if (!link->link_enc) { BREAK_TO_DEBUGGER(); @@ -409,7 +409,7 @@ static void destroy_link_encoders(struct dc *dc) static struct dc_perf_trace *dc_perf_trace_create(void) { - return kzalloc_obj(struct dc_perf_trace, GFP_KERNEL); + return kzalloc_obj(struct dc_perf_trace); } static void dc_perf_trace_destroy(struct dc_perf_trace **perf_trace) @@ -1005,7 +1005,7 @@ static bool dc_construct_ctx(struct dc *dc, { struct dc_context *dc_ctx; - dc_ctx = kzalloc_obj(*dc_ctx, GFP_KERNEL); + dc_ctx = kzalloc_obj(*dc_ctx); if (!dc_ctx) return false; @@ -1023,7 +1023,7 @@ static bool dc_construct_ctx(struct dc *dc, dc_ctx->clk_reg_offsets = init_params->clk_reg_offsets; /* Create logger */ - dc_ctx->logger = kmalloc_obj(*dc_ctx->logger, GFP_KERNEL); + dc_ctx->logger = kmalloc_obj(*dc_ctx->logger); if (!dc_ctx->logger) { kfree(dc_ctx); @@ -1063,7 +1063,7 @@ static bool dc_construct(struct dc *dc, dc->config = init_params->flags; // Allocate memory for the vm_helper - dc->vm_helper = kzalloc_obj(struct vm_helper, GFP_KERNEL); + dc->vm_helper = kzalloc_obj(struct vm_helper); if (!dc->vm_helper) { dm_error("%s: failed to create dc->vm_helper\n", __func__); goto fail; @@ -1071,7 +1071,7 @@ static bool dc_construct(struct dc *dc, memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides)); - dc_dceip = kzalloc_obj(*dc_dceip, GFP_KERNEL); + dc_dceip = kzalloc_obj(*dc_dceip); if (!dc_dceip) { dm_error("%s: failed to create dceip\n", __func__); goto fail; @@ -1079,14 +1079,14 @@ static bool dc_construct(struct dc *dc, dc->bw_dceip = dc_dceip; - dc_vbios = kzalloc_obj(*dc_vbios, GFP_KERNEL); + dc_vbios = kzalloc_obj(*dc_vbios); if (!dc_vbios) { dm_error("%s: failed to create vbios\n", __func__); goto fail; } dc->bw_vbios = dc_vbios; - dcn_soc = kzalloc_obj(*dcn_soc, GFP_KERNEL); + dcn_soc = kzalloc_obj(*dcn_soc); if (!dcn_soc) { dm_error("%s: failed to create dcn_soc\n", __func__); goto fail; @@ -1094,7 +1094,7 @@ static bool dc_construct(struct dc *dc, dc->dcn_soc = dcn_soc; - dcn_ip = kzalloc_obj(*dcn_ip, GFP_KERNEL); + dcn_ip = kzalloc_obj(*dcn_ip); if (!dcn_ip) { dm_error("%s: failed to create dcn_ip\n", __func__); goto fail; @@ -1496,7 +1496,7 @@ static void disable_vbios_mode_if_required( struct dc *dc_create(const struct dc_init_data *init_params) { - struct dc *dc = kzalloc_obj(*dc, GFP_KERNEL); + struct dc *dc = kzalloc_obj(*dc); unsigned int full_pipe_count; if (!dc) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c index 0bcd7445fe97..e5ac7056a187 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c @@ -76,7 +76,7 @@ void dc_sink_release(struct dc_sink *sink) struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) { - struct dc_sink *sink = kzalloc_obj(*sink, GFP_KERNEL); + struct dc_sink *sink = kzalloc_obj(*sink); if (NULL == sink) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c index c85b8915bbd3..a40e5c44143f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c @@ -195,7 +195,7 @@ struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *p { struct dc_state *state; - state = kvzalloc_obj(struct dc_state, GFP_KERNEL); + state = kvzalloc_obj(struct dc_state); if (!state) return NULL; @@ -251,7 +251,7 @@ struct dc_state *dc_state_create_copy(struct dc_state *src_state) { struct dc_state *new_state; - new_state = kvmalloc_obj(struct dc_state, GFP_KERNEL); + new_state = kvmalloc_obj(struct dc_state); if (!new_state) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index def02e26cb1f..246893d80f1f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -170,7 +170,7 @@ struct dc_stream_state *dc_create_stream_for_sink( if (sink == NULL) goto fail; - stream = kzalloc_obj(struct dc_stream_state, GFP_KERNEL); + stream = kzalloc_obj(struct dc_stream_state); if (stream == NULL) goto fail; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c index 11c237720bd2..d4c40b44d909 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c @@ -195,7 +195,7 @@ void dc_gamma_release(struct dc_gamma **gamma) struct dc_gamma *dc_create_gamma(void) { - struct dc_gamma *gamma = kvzalloc_obj(*gamma, GFP_KERNEL); + struct dc_gamma *gamma = kvzalloc_obj(*gamma); if (gamma == NULL) goto alloc_fail; @@ -225,7 +225,7 @@ void dc_transfer_func_release(struct dc_transfer_func *tf) struct dc_transfer_func *dc_create_transfer_func(void) { - struct dc_transfer_func *tf = kvzalloc_obj(*tf, GFP_KERNEL); + struct dc_transfer_func *tf = kvzalloc_obj(*tf); if (tf == NULL) goto alloc_fail; @@ -247,7 +247,7 @@ static void dc_3dlut_func_free(struct kref *kref) struct dc_3dlut *dc_create_3dlut_func(void) { - struct dc_3dlut *lut = kvzalloc_obj(*lut, GFP_KERNEL); + struct dc_3dlut *lut = kvzalloc_obj(*lut); if (lut == NULL) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c index 9b70c4e96ffe..b15360bcdacf 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c @@ -60,7 +60,7 @@ static void dc_dmub_srv_handle_failure(struct dc_dmub_srv *dc_dmub_srv) struct dc_dmub_srv *dc_dmub_srv_create(struct dc *dc, struct dmub_srv *dmub) { struct dc_dmub_srv *dc_srv = - kzalloc_obj(struct dc_dmub_srv, GFP_KERNEL); + kzalloc_obj(struct dc_dmub_srv); if (dc_srv == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c index 7c578d10cbca..13ba7f5ce13e 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c @@ -200,7 +200,7 @@ struct dccg *dccg2_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c index b147456a8cd4..5b9ba9a811ea 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c @@ -70,7 +70,7 @@ struct dccg *dccg201_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c index f14abe712f2d..75c69348027e 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c @@ -116,7 +116,7 @@ struct dccg *dccg21_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c index f264cf2285ce..ca947d710ad1 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c @@ -62,7 +62,7 @@ struct dccg *dccg3_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { @@ -87,7 +87,7 @@ struct dccg *dccg30_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c index 93ff864def88..837f4e3d1a60 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c @@ -61,7 +61,7 @@ struct dccg *dccg301_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c index 5ab0325f3615..7f58acfe1177 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c @@ -863,7 +863,7 @@ struct dccg *dccg31_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c index 5193883bfb41..ac6a909187c0 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c @@ -392,7 +392,7 @@ struct dccg *dccg314_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c index be44bc057bee..e817cd7c2b6a 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c @@ -360,7 +360,7 @@ struct dccg *dccg32_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c index 34414be7efb6..0b7908fbb115 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c @@ -2461,7 +2461,7 @@ struct dccg *dccg35_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c index 9554d24b882b..a37f94dec6f2 100644 --- a/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c @@ -892,7 +892,7 @@ struct dccg *dccg401_create( const struct dccg_shift *dccg_shift, const struct dccg_mask *dccg_mask) { - struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn, GFP_KERNEL); + struct dcn_dccg *dccg_dcn = kzalloc_obj(*dccg_dcn); struct dccg *base; if (dccg_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c index 71bb5794a513..41169b42534c 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c @@ -283,7 +283,7 @@ struct abm *dce_abm_create( const struct dce_abm_shift *abm_shift, const struct dce_abm_mask *abm_mask) { - struct dce_abm *abm_dce = kzalloc_obj(*abm_dce, GFP_KERNEL); + struct dce_abm *abm_dce = kzalloc_obj(*abm_dce); if (abm_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c index ba30394b828f..d18490cd0f1e 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c @@ -1331,7 +1331,7 @@ struct audio *dce_audio_create( const struct dce_audio_mask *masks ) { - struct dce_audio *audio = kzalloc_obj(*audio, GFP_KERNEL); + struct dce_audio *audio = kzalloc_obj(*audio); if (audio == NULL) { ASSERT_CRITICAL(audio); @@ -1357,7 +1357,7 @@ struct audio *dce60_audio_create( const struct dce_audio_mask *masks ) { - struct dce_audio *audio = kzalloc_obj(*audio, GFP_KERNEL); + struct dce_audio *audio = kzalloc_obj(*audio); if (audio == NULL) { ASSERT_CRITICAL(audio); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c index 405758106101..dca025b5ff1f 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c @@ -848,7 +848,7 @@ struct clk_mgr *dce_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -871,7 +871,7 @@ struct clk_mgr *dce110_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -896,7 +896,7 @@ struct clk_mgr *dce112_clk_mgr_create( const struct clk_mgr_shift *clk_shift, const struct clk_mgr_mask *clk_mask) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -917,7 +917,7 @@ struct clk_mgr *dce112_clk_mgr_create( struct clk_mgr *dce120_clk_mgr_create(struct dc_context *ctx) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -939,7 +939,7 @@ struct clk_mgr *dce120_clk_mgr_create(struct dc_context *ctx) struct clk_mgr *dce121_clk_mgr_create(struct dc_context *ctx) { - struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce, GFP_KERNEL); + struct dce_clk_mgr *clk_mgr_dce = kzalloc_obj(*clk_mgr_dce); if (clk_mgr_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c index dd33218dcbab..e871b72e43ef 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c @@ -1105,7 +1105,7 @@ struct dmcu *dce_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1126,7 +1126,7 @@ struct dmcu *dcn10_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1147,7 +1147,7 @@ struct dmcu *dcn20_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); @@ -1168,7 +1168,7 @@ struct dmcu *dcn21_dmcu_create( const struct dce_dmcu_shift *dmcu_shift, const struct dce_dmcu_mask *dmcu_mask) { - struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce, GFP_KERNEL); + struct dce_dmcu *dmcu_dce = kzalloc_obj(*dmcu_dce); if (dmcu_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c index 11ba6e59f5b5..b686d89b79b2 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c @@ -222,7 +222,7 @@ struct abm *dmub_abm_create( const struct dce_abm_mask *abm_mask) { if (ctx->dc->caps.dmcub_support) { - struct dce_abm *abm_dce = kzalloc_obj(*abm_dce, GFP_KERNEL); + struct dce_abm *abm_dce = kzalloc_obj(*abm_dce); if (abm_dce == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c index 4527e35a0666..f94fd007af23 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c @@ -488,7 +488,7 @@ static void dmub_psr_construct(struct dmub_psr *psr, struct dc_context *ctx) */ struct dmub_psr *dmub_psr_create(struct dc_context *ctx) { - struct dmub_psr *psr = kzalloc_obj(struct dmub_psr, GFP_KERNEL); + struct dmub_psr *psr = kzalloc_obj(struct dmub_psr); if (psr == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c index c590c9274f21..28a218149b8b 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c @@ -438,7 +438,7 @@ static void dmub_replay_construct(struct dmub_replay *replay, struct dc_context */ struct dmub_replay *dmub_replay_create(struct dc_context *ctx) { - struct dmub_replay *replay = kzalloc_obj(struct dmub_replay, GFP_KERNEL); + struct dmub_replay *replay = kzalloc_obj(struct dmub_replay); if (replay == NULL) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c index 68849d518e76..9be578ff8c88 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c @@ -394,7 +394,7 @@ void dce110_compressor_set_fbc_invalidation_triggers( struct compressor *dce110_compressor_create(struct dc_context *ctx) { struct dce110_compressor *cp110 = - kzalloc_obj(struct dce110_compressor, GFP_KERNEL); + kzalloc_obj(struct dce110_compressor); if (!cp110) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c index 24effd7d3ea3..187f45a7f5e1 100644 --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c @@ -831,7 +831,7 @@ void dce112_compressor_construct(struct dce112_compressor *compressor, struct compressor *dce112_compressor_create(struct dc_context *ctx) { struct dce112_compressor *cp110 = - kzalloc_obj(struct dce112_compressor, GFP_KERNEL); + kzalloc_obj(struct dce112_compressor); if (!cp110) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c index f30eeda44842..a9c8857476ac 100644 --- a/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dio/virtual/virtual_stream_encoder.c @@ -159,7 +159,7 @@ bool virtual_stream_encoder_construct( struct stream_encoder *virtual_stream_encoder_create( struct dc_context *ctx, struct dc_bios *bp) { - struct stream_encoder *enc = kzalloc_obj(*enc, GFP_KERNEL); + struct stream_encoder *enc = kzalloc_obj(*enc); if (!enc) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c index c4b1a337ac92..37adf0e6a166 100644 --- a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c +++ b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c @@ -280,7 +280,7 @@ bool dwb3_ogam_set_input_transfer_func( if (in_transfer_func_dwb_ogam == NULL) return result; - dwb_ogam_lut = kzalloc_obj(*dwb_ogam_lut, GFP_KERNEL); + dwb_ogam_lut = kzalloc_obj(*dwb_ogam_lut); if (dwb_ogam_lut) { cm_helper_translate_curve_to_hw_format(dwbc->ctx, diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c index 4e3a5b3513d8..95532b7ee884 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c @@ -270,7 +270,7 @@ struct gpio *dal_gpio_create( uint32_t en, enum gpio_pin_output_state output_state) { - struct gpio *gpio = kzalloc_obj(struct gpio, GFP_KERNEL); + struct gpio *gpio = kzalloc_obj(struct gpio); if (!gpio) { ASSERT_CRITICAL(false); diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c index fd7be0a35d0f..a2c46350e44e 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c @@ -58,7 +58,7 @@ struct gpio_service *dal_gpio_service_create( struct gpio_service *service; int32_t index_of_id; - service = kzalloc_obj(struct gpio_service, GFP_KERNEL); + service = kzalloc_obj(struct gpio_service); if (!service) { BREAK_TO_DEBUGGER(); @@ -498,7 +498,7 @@ struct ddc *dal_gpio_create_ddc( if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) return NULL; - ddc = kzalloc_obj(struct ddc, GFP_KERNEL); + ddc = kzalloc_obj(struct ddc); if (!ddc) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c index 05fa4119bf55..86d60986d669 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c @@ -233,7 +233,7 @@ void dal_hw_ddc_init( *hw_ddc = NULL; } - *hw_ddc = kzalloc_obj(struct hw_ddc, GFP_KERNEL); + *hw_ddc = kzalloc_obj(struct hw_ddc); if (!*hw_ddc) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c index 61bbcade18cb..7f137cb96895 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c @@ -111,7 +111,7 @@ void dal_hw_generic_init( *hw_generic = NULL; } - *hw_generic = kzalloc_obj(struct hw_generic, GFP_KERNEL); + *hw_generic = kzalloc_obj(struct hw_generic); if (!*hw_generic) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c index ee7d794a8c60..79e107904e21 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c @@ -132,7 +132,7 @@ void dal_hw_hpd_init( *hw_hpd = NULL; } - *hw_hpd = kzalloc_obj(struct hw_hpd, GFP_KERNEL); + *hw_hpd = kzalloc_obj(struct hw_hpd); if (!*hw_hpd) { ASSERT_CRITICAL(false); return; diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c index 7083c57da007..a2d28be480e8 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c @@ -2399,7 +2399,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size, DC_LOGGER_INIT(dc_ctx->logger); - hw_crtc_timing = kzalloc_objs(*hw_crtc_timing, MAX_PIPES, GFP_KERNEL); + hw_crtc_timing = kzalloc_objs(*hw_crtc_timing, MAX_PIPES); if (!hw_crtc_timing) return master; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c index 002210b6bb62..676df39079fc 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c @@ -419,7 +419,7 @@ static void dce110_irq_construct(struct irq_service *irq_service, struct irq_service * dal_irq_service_dce110_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c index 47714407252d..b473dae2abbb 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c @@ -257,7 +257,7 @@ static void dce120_irq_construct( struct irq_service *dal_irq_service_dce120_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c b/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c index 47a2a53979db..68692a126f60 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce60/irq_service_dce60.c @@ -355,7 +355,7 @@ static void dce60_irq_construct( struct irq_service *dal_irq_service_dce60_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c index bad0e02713f8..b5c5f42cf8f2 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c @@ -267,7 +267,7 @@ static void dce80_irq_construct( struct irq_service *dal_irq_service_dce80_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c index 51f3a5042788..ca2e13702fbb 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c @@ -369,7 +369,7 @@ static void dcn10_irq_construct( struct irq_service *dal_irq_service_dcn10_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c b/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c index cd09fa6e6706..1c4c51abc259 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c @@ -374,7 +374,7 @@ static void dcn20_irq_construct( struct irq_service *dal_irq_service_dcn20_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c index 7ca085b418e3..04b5d748e03a 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c @@ -328,7 +328,7 @@ static void dcn201_irq_construct( struct irq_service *dal_irq_service_dcn201_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c b/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c index 67fbcce3409f..9e0881472e38 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c @@ -402,7 +402,7 @@ static void dcn21_irq_construct( struct irq_service *dal_irq_service_dcn21_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c b/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c index 10a16dc17487..92bcd35723ca 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c @@ -411,7 +411,7 @@ static void dcn30_irq_construct( struct irq_service *dal_irq_service_dcn30_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c b/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c index 55c863790402..16685d066c1a 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn302/irq_service_dcn302.c @@ -377,7 +377,7 @@ static void dcn302_irq_construct(struct irq_service *irq_service, struct irq_ser struct irq_service *dal_irq_service_dcn302_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c b/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c index 2ce7c829a445..01d83e1922d6 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn303/irq_service_dcn303.c @@ -273,7 +273,7 @@ static void dcn303_irq_construct(struct irq_service *irq_service, struct irq_ser struct irq_service *dal_irq_service_dcn303_create(struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c b/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c index 710cda204bee..2114c5669e6e 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn31/irq_service_dcn31.c @@ -393,7 +393,7 @@ static void dcn31_irq_construct( struct irq_service *dal_irq_service_dcn31_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c b/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c index 8cb120a3ceb7..16f158e0fb60 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn314/irq_service_dcn314.c @@ -395,7 +395,7 @@ static void dcn314_irq_construct( struct irq_service *dal_irq_service_dcn314_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c b/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c index f3a0f8f176d8..8ee03c006ad6 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c @@ -400,7 +400,7 @@ static void dcn315_irq_construct( struct irq_service *dal_irq_service_dcn315_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c b/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c index 80b388ac3511..07e6f7dd6b99 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c @@ -425,7 +425,7 @@ static void dcn32_irq_construct( struct irq_service *dal_irq_service_dcn32_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c b/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c index 44b3c3b0c657..3d28a5007f53 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn35/irq_service_dcn35.c @@ -389,7 +389,7 @@ static void dcn35_irq_construct( struct irq_service *dal_irq_service_dcn35_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c b/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c index e4600282cf18..f716c2590876 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn351/irq_service_dcn351.c @@ -371,7 +371,7 @@ static void dcn351_irq_construct( struct irq_service *dal_irq_service_dcn351_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c b/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c index e81077f764df..e718004901cf 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn36/irq_service_dcn36.c @@ -370,7 +370,7 @@ static void dcn36_irq_construct( struct irq_service *dal_irq_service_dcn36_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c b/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c index 97c80aa30e8b..2cde50b2ae22 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn401/irq_service_dcn401.c @@ -403,7 +403,7 @@ static void dcn401_irq_construct( struct irq_service *dal_irq_service_dcn401_create( struct irq_service_init_data *init_data) { - struct irq_service *irq_service = kzalloc_obj(*irq_service, GFP_KERNEL); + struct irq_service *irq_service = kzalloc_obj(*irq_service); if (!irq_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c index e1cf56cdc8c0..21815ad01a29 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c @@ -302,7 +302,7 @@ static void construct_link_service(struct link_service *link_srv) struct link_service *link_create_link_service(void) { - struct link_service *link_srv = kzalloc_obj(*link_srv, GFP_KERNEL); + struct link_service *link_srv = kzalloc_obj(*link_srv); if (link_srv == NULL) goto fail; @@ -897,7 +897,7 @@ static bool link_construct(struct dc_link *link, struct dc_link *link_create(const struct link_init_data *init_params) { - struct dc_link *link = kzalloc_obj(*link, GFP_KERNEL); + struct dc_link *link = kzalloc_obj(*link); if (NULL == link) goto alloc_fail; diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c index 1a7c73263615..a66217e54a09 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c @@ -156,7 +156,7 @@ struct ddc_service *link_create_ddc_service( { struct ddc_service *ddc_service; - ddc_service = kzalloc_obj(struct ddc_service, GFP_KERNEL); + ddc_service = kzalloc_obj(struct ddc_service); if (!ddc_service) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c b/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c index 0df983c70ba3..f5bf5940e748 100644 --- a/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c +++ b/drivers/gpu/drm/amd/display/dc/pg/dcn35/dcn35_pg_cntl.c @@ -542,7 +542,7 @@ struct pg_cntl *pg_cntl35_create( const struct pg_cntl_shift *pg_cntl_shift, const struct pg_cntl_mask *pg_cntl_mask) { - struct dcn_pg_cntl *pg_cntl_dcn = kzalloc_obj(*pg_cntl_dcn, GFP_KERNEL); + struct dcn_pg_cntl *pg_cntl_dcn = kzalloc_obj(*pg_cntl_dcn); struct pg_cntl *base; if (pg_cntl_dcn == NULL) { diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c index e562c71fb432..8e0b38762c96 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c @@ -472,7 +472,7 @@ static struct timing_generator *dce100_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -486,7 +486,7 @@ static struct stream_encoder *dce100_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -520,7 +520,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce100_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -597,7 +597,7 @@ static struct transform *dce100_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -610,7 +610,7 @@ static struct transform *dce100_transform_create( static struct input_pixel_processor *dce100_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -634,7 +634,7 @@ static struct link_encoder *dce100_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110) @@ -669,7 +669,7 @@ static struct link_encoder *dce100_link_encoder_create( static struct panel_cntl *dce100_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -688,7 +688,7 @@ static struct output_pixel_processor *dce100_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -703,7 +703,7 @@ static struct dce_aux *dce100_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -741,7 +741,7 @@ static struct dce_i2c_hw *dce100_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -759,7 +759,7 @@ static struct clock_source *dce100_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1215,7 +1215,7 @@ struct resource_pool *dce100_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c index 68964e8ce10b..0a28d3573549 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c @@ -516,7 +516,7 @@ static struct timing_generator *dce110_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -530,7 +530,7 @@ static struct stream_encoder *dce110_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -563,7 +563,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce110_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -632,7 +632,7 @@ static struct transform *dce110_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -645,7 +645,7 @@ static struct transform *dce110_transform_create( static struct input_pixel_processor *dce110_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -669,7 +669,7 @@ static struct link_encoder *dce110_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -690,7 +690,7 @@ static struct link_encoder *dce110_link_encoder_create( static struct panel_cntl *dce110_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -709,7 +709,7 @@ static struct output_pixel_processor *dce110_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -724,7 +724,7 @@ static struct dce_aux *dce110_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -762,7 +762,7 @@ static struct dce_i2c_hw *dce110_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -780,7 +780,7 @@ static struct clock_source *dce110_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1254,8 +1254,8 @@ static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool) GFP_KERNEL); struct dce_transform *dce110_xfmv = kzalloc_obj(*dce110_xfmv, GFP_KERNEL); - struct dce_mem_input *dce110_miv = kzalloc_obj(*dce110_miv, GFP_KERNEL); - struct dce110_opp *dce110_oppv = kzalloc_obj(*dce110_oppv, GFP_KERNEL); + struct dce_mem_input *dce110_miv = kzalloc_obj(*dce110_miv); + struct dce110_opp *dce110_oppv = kzalloc_obj(*dce110_oppv); if (!dce110_tgv || !dce110_xfmv || !dce110_miv || !dce110_oppv) { kfree(dce110_tgv); @@ -1543,7 +1543,7 @@ struct resource_pool *dce110_create_resource_pool( struct hw_asic_id asic_id) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c index 9c3f6e96f0ae..678ee1a73ac6 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c @@ -497,7 +497,7 @@ static struct timing_generator *dce112_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -511,7 +511,7 @@ static struct stream_encoder *dce112_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -540,7 +540,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce112_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -603,7 +603,7 @@ static struct transform *dce112_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -630,7 +630,7 @@ static struct link_encoder *dce112_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -651,7 +651,7 @@ static struct link_encoder *dce112_link_encoder_create( static struct panel_cntl *dce112_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -668,7 +668,7 @@ static struct panel_cntl *dce112_panel_cntl_create(const struct panel_cntl_init_ static struct input_pixel_processor *dce112_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -685,7 +685,7 @@ static struct output_pixel_processor *dce112_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -700,7 +700,7 @@ static struct dce_aux *dce112_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -738,7 +738,7 @@ static struct dce_i2c_hw *dce112_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -756,7 +756,7 @@ static struct clock_source *dce112_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1423,7 +1423,7 @@ struct resource_pool *dce112_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c index 48f8a418f324..c0c2f4da5cd2 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c @@ -428,7 +428,7 @@ static struct output_pixel_processor *dce120_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -442,7 +442,7 @@ static struct dce_aux *dce120_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -480,7 +480,7 @@ static struct dce_i2c_hw *dce120_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -541,7 +541,7 @@ static struct clock_source *dce120_clock_source_create( const struct dce110_clk_src_regs *regs, bool dp_clk_src) { - struct dce110_clk_src *clk_src = kzalloc_obj(*clk_src, GFP_KERNEL); + struct dce110_clk_src *clk_src = kzalloc_obj(*clk_src); if (!clk_src) return NULL; @@ -582,7 +582,7 @@ static struct timing_generator *dce120_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -713,7 +713,7 @@ static struct link_encoder *dce120_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -735,7 +735,7 @@ static struct link_encoder *dce120_link_encoder_create( static struct panel_cntl *dce120_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -752,7 +752,7 @@ static struct panel_cntl *dce120_panel_cntl_create(const struct panel_cntl_init_ static struct input_pixel_processor *dce120_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -769,7 +769,7 @@ static struct stream_encoder *dce120_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -812,7 +812,7 @@ static const struct dce_hwseq_mask dce121_hwseq_mask = { static struct dce_hwseq *dce120_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -826,7 +826,7 @@ static struct dce_hwseq *dce120_hwseq_create( static struct dce_hwseq *dce121_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -891,7 +891,7 @@ static struct transform *dce120_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -1295,7 +1295,7 @@ struct resource_pool *dce120_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c index 621739d0b024..31aa80943c16 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c @@ -507,7 +507,7 @@ static struct timing_generator *dce60_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -521,7 +521,7 @@ static struct output_pixel_processor *dce60_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -536,7 +536,7 @@ static struct dce_aux *dce60_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -574,7 +574,7 @@ static struct dce_i2c_hw *dce60_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -589,7 +589,7 @@ static struct dce_i2c_sw *dce60_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = - kzalloc_obj(struct dce_i2c_sw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_sw); if (!dce_i2c_sw) return NULL; @@ -603,7 +603,7 @@ static struct stream_encoder *dce60_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -638,7 +638,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce60_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -707,7 +707,7 @@ static struct transform *dce60_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -730,7 +730,7 @@ static struct link_encoder *dce60_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110) @@ -765,7 +765,7 @@ static struct link_encoder *dce60_link_encoder_create( static struct panel_cntl *dce60_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -787,7 +787,7 @@ static struct clock_source *dce60_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -812,7 +812,7 @@ static void dce60_clock_source_destroy(struct clock_source **clk_src) static struct input_pixel_processor *dce60_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -1098,7 +1098,7 @@ struct resource_pool *dce60_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; @@ -1296,7 +1296,7 @@ struct resource_pool *dce61_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; @@ -1493,7 +1493,7 @@ struct resource_pool *dce64_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c index bef4a30caf7e..d1f781e61f1e 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c @@ -513,7 +513,7 @@ static struct timing_generator *dce80_timing_generator_create( const struct dce110_timing_generator_offsets *offsets) { struct dce110_timing_generator *tg110 = - kzalloc_obj(struct dce110_timing_generator, GFP_KERNEL); + kzalloc_obj(struct dce110_timing_generator); if (!tg110) return NULL; @@ -527,7 +527,7 @@ static struct output_pixel_processor *dce80_opp_create( uint32_t inst) { struct dce110_opp *opp = - kzalloc_obj(struct dce110_opp, GFP_KERNEL); + kzalloc_obj(struct dce110_opp); if (!opp) return NULL; @@ -542,7 +542,7 @@ static struct dce_aux *dce80_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -580,7 +580,7 @@ static struct dce_i2c_hw *dce80_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -595,7 +595,7 @@ static struct dce_i2c_sw *dce80_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = - kzalloc_obj(struct dce_i2c_sw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_sw); if (!dce_i2c_sw) return NULL; @@ -609,7 +609,7 @@ static struct stream_encoder *dce80_stream_encoder_create( struct dc_context *ctx) { struct dce110_stream_encoder *enc110 = - kzalloc_obj(struct dce110_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_stream_encoder); if (!enc110) return NULL; @@ -644,7 +644,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dce80_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -713,7 +713,7 @@ static struct transform *dce80_transform_create( uint32_t inst) { struct dce_transform *transform = - kzalloc_obj(struct dce_transform, GFP_KERNEL); + kzalloc_obj(struct dce_transform); if (!transform) return NULL; @@ -736,7 +736,7 @@ static struct link_encoder *dce80_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = - kzalloc_obj(struct dce110_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dce110_link_encoder); int link_regs_id; if (!enc110) @@ -771,7 +771,7 @@ static struct link_encoder *dce80_link_encoder_create( static struct panel_cntl *dce80_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -793,7 +793,7 @@ static struct clock_source *dce80_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -818,7 +818,7 @@ static void dce80_clock_source_destroy(struct clock_source **clk_src) static struct input_pixel_processor *dce80_ipp_create( struct dc_context *ctx, uint32_t inst) { - struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp, GFP_KERNEL); + struct dce_ipp *ipp = kzalloc_obj(struct dce_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -1109,7 +1109,7 @@ struct resource_pool *dce80_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; @@ -1309,7 +1309,7 @@ struct resource_pool *dce81_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; @@ -1507,7 +1507,7 @@ struct resource_pool *dce83_create_resource_pool( struct dc *dc) { struct dce110_resource_pool *pool = - kzalloc_obj(struct dce110_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dce110_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c index 6c066576a5a5..3d1c8344c8bb 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c @@ -574,7 +574,7 @@ static struct dpp *dcn10_dpp_create( uint32_t inst) { struct dcn10_dpp *dpp = - kzalloc_obj(struct dcn10_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn10_dpp); if (!dpp) return NULL; @@ -588,7 +588,7 @@ static struct input_pixel_processor *dcn10_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -605,7 +605,7 @@ static struct output_pixel_processor *dcn10_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_opp *opp = - kzalloc_obj(struct dcn10_opp, GFP_KERNEL); + kzalloc_obj(struct dcn10_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -621,7 +621,7 @@ static struct dce_aux *dcn10_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -658,7 +658,7 @@ static struct dce_i2c_hw *dcn10_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -670,7 +670,7 @@ static struct dce_i2c_hw *dcn10_i2c_hw_create(struct dc_context *ctx, } static struct mpc *dcn10_mpc_create(struct dc_context *ctx) { - struct dcn10_mpc *mpc10 = kzalloc_obj(struct dcn10_mpc, GFP_KERNEL); + struct dcn10_mpc *mpc10 = kzalloc_obj(struct dcn10_mpc); if (!mpc10) return NULL; @@ -705,7 +705,7 @@ static struct timing_generator *dcn10_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -738,7 +738,7 @@ static struct link_encoder *dcn10_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn10_link_encoder *enc10 = - kzalloc_obj(struct dcn10_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn10_link_encoder); int link_regs_id; if (!enc10 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -762,7 +762,7 @@ static struct link_encoder *dcn10_link_encoder_create( static struct panel_cntl *dcn10_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -784,7 +784,7 @@ static struct clock_source *dcn10_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -820,7 +820,7 @@ static struct stream_encoder *dcn10_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder); if (!enc1) return NULL; @@ -846,7 +846,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn10_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -890,7 +890,7 @@ static void dcn10_clock_source_destroy(struct clock_source **clk_src) static struct pp_smu_funcs *dcn10_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu); if (!pp_smu) return pp_smu; @@ -983,7 +983,7 @@ static struct hubp *dcn10_hubp_create( uint32_t inst) { struct dcn10_hubp *hubp1 = - kzalloc_obj(struct dcn10_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn10_hubp); if (!hubp1) return NULL; @@ -1680,7 +1680,7 @@ struct resource_pool *dcn10_create_resource_pool( struct dc *dc) { struct dcn10_resource_pool *pool = - kzalloc_obj(struct dcn10_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn10_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c index ba83a78f7fc1..9906ecdc51ea 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c @@ -736,7 +736,7 @@ struct dpp *dcn20_dpp_create( uint32_t inst) { struct dcn20_dpp *dpp = - kzalloc_obj(struct dcn20_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn20_dpp); if (!dpp) return NULL; @@ -754,7 +754,7 @@ struct input_pixel_processor *dcn20_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -771,7 +771,7 @@ struct output_pixel_processor *dcn20_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -788,7 +788,7 @@ struct dce_aux *dcn20_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -826,7 +826,7 @@ struct dce_i2c_hw *dcn20_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -838,7 +838,7 @@ struct dce_i2c_hw *dcn20_i2c_hw_create( } struct mpc *dcn20_mpc_create(struct dc_context *ctx) { - struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc, GFP_KERNEL); + struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc); if (!mpc20) return NULL; @@ -884,7 +884,7 @@ struct timing_generator *dcn20_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -918,7 +918,7 @@ struct link_encoder *dcn20_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); int link_regs_id; if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -942,7 +942,7 @@ struct link_encoder *dcn20_link_encoder_create( static struct panel_cntl *dcn20_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -964,7 +964,7 @@ static struct clock_source *dcn20_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1000,7 +1000,7 @@ struct stream_encoder *dcn20_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder); if (!enc1) return NULL; @@ -1032,7 +1032,7 @@ static const struct dce_hwseq_mask hwseq_mask = { struct dce_hwseq *dcn20_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1063,7 +1063,7 @@ struct display_stream_compressor *dcn20_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1200,7 +1200,7 @@ struct hubp *dcn20_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -2288,7 +2288,7 @@ bool dcn20_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool) static struct pp_smu_funcs *dcn20_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu); if (!pp_smu) return pp_smu; @@ -2768,7 +2768,7 @@ struct resource_pool *dcn20_create_resource_pool( struct dc *dc) { struct dcn20_resource_pool *pool = - kzalloc_obj(struct dcn20_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn20_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c index 71629186eb30..86281ee78f8c 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c @@ -632,7 +632,7 @@ static struct dpp *dcn201_dpp_create( uint32_t inst) { struct dcn201_dpp *dpp = - kzalloc_obj(struct dcn201_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn201_dpp); if (!dpp) return NULL; @@ -649,7 +649,7 @@ static struct input_pixel_processor *dcn201_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp); if (!ipp) { return NULL; @@ -665,7 +665,7 @@ static struct output_pixel_processor *dcn201_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn201_opp *opp = - kzalloc_obj(struct dcn201_opp, GFP_KERNEL); + kzalloc_obj(struct dcn201_opp); if (!opp) { return NULL; @@ -680,7 +680,7 @@ static struct dce_aux *dcn201_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -713,7 +713,7 @@ static struct dce_i2c_hw *dcn201_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -726,7 +726,7 @@ static struct dce_i2c_hw *dcn201_i2c_hw_create(struct dc_context *ctx, static struct mpc *dcn201_mpc_create(struct dc_context *ctx, uint32_t num_mpcc) { - struct dcn201_mpc *mpc201 = kzalloc_obj(struct dcn201_mpc, GFP_KERNEL); + struct dcn201_mpc *mpc201 = kzalloc_obj(struct dcn201_mpc); if (!mpc201) return NULL; @@ -761,7 +761,7 @@ static struct timing_generator *dcn201_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -795,7 +795,7 @@ static struct link_encoder *dcn201_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); struct dcn10_link_encoder *enc10; if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -823,7 +823,7 @@ static struct clock_source *dcn201_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -858,7 +858,7 @@ static struct stream_encoder *dcn201_stream_encoder_create( struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder); if (!enc1) return NULL; @@ -885,7 +885,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn201_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -985,7 +985,7 @@ static struct hubp *dcn201_hubp_create( uint32_t inst) { struct dcn201_hubp *hubp201 = - kzalloc_obj(struct dcn201_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn201_hubp); if (!hubp201) return NULL; @@ -1306,7 +1306,7 @@ struct resource_pool *dcn201_create_resource_pool( struct dc *dc) { struct dcn201_resource_pool *pool = - kzalloc_obj(struct dcn201_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn201_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c index 0e93bc342011..a1bee2257362 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c @@ -484,7 +484,7 @@ static struct input_pixel_processor *dcn21_ipp_create( struct dc_context *ctx, uint32_t inst) { struct dcn10_ipp *ipp = - kzalloc_obj(struct dcn10_ipp, GFP_KERNEL); + kzalloc_obj(struct dcn10_ipp); if (!ipp) { BREAK_TO_DEBUGGER(); @@ -501,7 +501,7 @@ static struct dpp *dcn21_dpp_create( uint32_t inst) { struct dcn20_dpp *dpp = - kzalloc_obj(struct dcn20_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn20_dpp); if (!dpp) return NULL; @@ -520,7 +520,7 @@ static struct dce_aux *dcn21_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -557,7 +557,7 @@ static struct dce_i2c_hw *dcn21_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -960,7 +960,7 @@ static struct clock_source *dcn21_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -981,7 +981,7 @@ static struct hubp *dcn21_hubp_create( uint32_t inst) { struct dcn21_hubp *hubp21 = - kzalloc_obj(struct dcn21_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn21_hubp); if (!hubp21) return NULL; @@ -1028,7 +1028,7 @@ static struct output_pixel_processor *dcn21_opp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -1044,7 +1044,7 @@ static struct timing_generator *dcn21_timing_generator_create(struct dc_context uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1063,7 +1063,7 @@ static struct timing_generator *dcn21_timing_generator_create(struct dc_context static struct mpc *dcn21_mpc_create(struct dc_context *ctx) { - struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc, GFP_KERNEL); + struct dcn20_mpc *mpc20 = kzalloc_obj(struct dcn20_mpc); if (!mpc20) return NULL; @@ -1091,7 +1091,7 @@ static struct display_stream_compressor *dcn21_dsc_create(struct dc_context *ctx uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1104,7 +1104,7 @@ static struct display_stream_compressor *dcn21_dsc_create(struct dc_context *ctx static struct pp_smu_funcs *dcn21_pp_smu_create(struct dc_context *ctx) { - struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu, GFP_KERNEL); + struct pp_smu_funcs *pp_smu = kzalloc_obj(*pp_smu); if (!pp_smu) return pp_smu; @@ -1141,7 +1141,7 @@ static struct stream_encoder *dcn21_stream_encoder_create(enum engine_id eng_id, struct dc_context *ctx) { struct dcn10_stream_encoder *enc1 = - kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn10_stream_encoder); if (!enc1) return NULL; @@ -1168,7 +1168,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn21_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1295,7 +1295,7 @@ static struct link_encoder *dcn21_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn21_link_encoder *enc21 = - kzalloc_obj(struct dcn21_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn21_link_encoder); int link_regs_id; if (!enc21 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) @@ -1319,7 +1319,7 @@ static struct link_encoder *dcn21_link_encoder_create( static struct panel_cntl *dcn21_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -1704,7 +1704,7 @@ struct resource_pool *dcn21_create_resource_pool( struct dc *dc) { struct dcn21_resource_pool *pool = - kzalloc_obj(struct dcn21_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn21_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c index 75aa4b6d7133..465a31eb94c3 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c @@ -753,7 +753,7 @@ static struct dpp *dcn30_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -771,7 +771,7 @@ static struct output_pixel_processor *dcn30_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -788,7 +788,7 @@ static struct dce_aux *dcn30_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -827,7 +827,7 @@ static struct dce_i2c_hw *dcn30_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -843,7 +843,7 @@ static struct mpc *dcn30_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -892,7 +892,7 @@ static struct timing_generator *dcn30_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -926,7 +926,7 @@ static struct link_encoder *dcn30_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -946,7 +946,7 @@ static struct link_encoder *dcn30_link_encoder_create( static struct panel_cntl *dcn30_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dce_panel_cntl *panel_cntl = - kzalloc_obj(struct dce_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dce_panel_cntl); if (!panel_cntl) return NULL; @@ -980,7 +980,7 @@ static struct vpg *dcn30_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -997,7 +997,7 @@ static struct afmt *dcn30_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -1026,7 +1026,7 @@ static struct stream_encoder *dcn30_stream_encoder_create(enum engine_id eng_id, } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn30_vpg_create(ctx, vpg_inst); afmt = dcn30_afmt_create(ctx, afmt_inst); @@ -1047,7 +1047,7 @@ static struct stream_encoder *dcn30_stream_encoder_create(enum engine_id eng_id, static struct dce_hwseq *dcn30_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1200,7 +1200,7 @@ static struct hubp *dcn30_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1268,7 +1268,7 @@ static struct display_stream_compressor *dcn30_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1302,7 +1302,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2622,7 +2622,7 @@ struct resource_pool *dcn30_create_resource_pool( struct dc *dc) { struct dcn30_resource_pool *pool = - kzalloc_obj(struct dcn30_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn30_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c index 6bced8def669..b08f5d3cb673 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c @@ -717,7 +717,7 @@ static void dcn301_dpp_destroy(struct dpp **dpp) static struct dpp *dcn301_dpp_create(struct dc_context *ctx, uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -734,7 +734,7 @@ static struct output_pixel_processor *dcn301_opp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -749,7 +749,7 @@ static struct output_pixel_processor *dcn301_opp_create(struct dc_context *ctx, static struct dce_aux *dcn301_aux_engine_create(struct dc_context *ctx, uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -783,7 +783,7 @@ static const struct dce_i2c_mask i2c_masks = { static struct dce_i2c_hw *dcn301_i2c_hw_create(struct dc_context *ctx, uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -798,7 +798,7 @@ static struct mpc *dcn301_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -848,7 +848,7 @@ static struct timing_generator *dcn301_timing_generator_create( struct dc_context *ctx, uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -882,7 +882,7 @@ static struct link_encoder *dcn301_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -902,7 +902,7 @@ static struct link_encoder *dcn301_link_encoder_create( static struct panel_cntl *dcn301_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn301_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn301_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn301_panel_cntl); if (!panel_cntl) return NULL; @@ -951,7 +951,7 @@ static struct vpg *dcn301_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -968,7 +968,7 @@ static struct afmt *dcn301_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -997,7 +997,7 @@ static struct stream_encoder *dcn301_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn301_vpg_create(ctx, vpg_inst); afmt = dcn301_afmt_create(ctx, afmt_inst); @@ -1018,7 +1018,7 @@ static struct stream_encoder *dcn301_stream_encoder_create(enum engine_id eng_id static struct dce_hwseq *dcn301_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1160,7 +1160,7 @@ static void dcn301_destruct(struct dcn301_resource_pool *pool) static struct hubp *dcn301_hubp_create(struct dc_context *ctx, uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1228,7 +1228,7 @@ static struct display_stream_compressor *dcn301_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1257,7 +1257,7 @@ static struct clock_source *dcn301_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1727,7 +1727,7 @@ struct resource_pool *dcn301_create_resource_pool( struct dc *dc) { struct dcn301_resource_pool *pool = - kzalloc_obj(struct dcn301_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn301_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c index 1dba37343c0f..c69a7f962a42 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c @@ -300,7 +300,7 @@ static const struct dcn30_vpg_mask vpg_mask = { static struct vpg *dcn302_vpg_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -332,7 +332,7 @@ static const struct dcn30_afmt_mask afmt_mask = { static struct afmt *dcn302_afmt_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -407,7 +407,7 @@ static struct stream_encoder *dcn302_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn302_vpg_create(ctx, vpg_inst); afmt = dcn302_afmt_create(ctx, afmt_inst); @@ -476,7 +476,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn302_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -508,7 +508,7 @@ static const struct dcn_hubp2_mask hubp_mask = { static struct hubp *dcn302_hubp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -542,7 +542,7 @@ static const struct dcn3_dpp_mask tf_mask = { static struct dpp *dcn302_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -576,7 +576,7 @@ static const struct dcn20_opp_mask opp_mask = { static struct output_pixel_processor *dcn302_opp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -608,7 +608,7 @@ static const struct dcn_optc_mask optc_mask = { static struct timing_generator *dcn302_timing_generator_create(struct dc_context *ctx, uint32_t instance) { - struct optc *tgn10 = kzalloc_obj(struct optc, GFP_KERNEL); + struct optc *tgn10 = kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -653,7 +653,7 @@ static const struct dcn30_mpc_mask mpc_mask = { static struct mpc *dcn302_mpc_create(struct dc_context *ctx, int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -684,7 +684,7 @@ static const struct dcn20_dsc_mask dsc_mask = { static struct display_stream_compressor *dcn302_dsc_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c index 2f81c0b51d1a..e4e179212d57 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c @@ -293,7 +293,7 @@ static const struct dcn30_vpg_mask vpg_mask = { static struct vpg *dcn303_vpg_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -322,7 +322,7 @@ static const struct dcn30_afmt_mask afmt_mask = { static struct afmt *dcn303_afmt_create(struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -394,7 +394,7 @@ static struct stream_encoder *dcn303_stream_encoder_create(enum engine_id eng_id } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn303_vpg_create(ctx, vpg_inst); afmt = dcn303_afmt_create(ctx, afmt_inst); @@ -460,7 +460,7 @@ static const struct dce_hwseq_mask hwseq_mask = { static struct dce_hwseq *dcn303_hwseq_create(struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -489,7 +489,7 @@ static const struct dcn_hubp2_mask hubp_mask = { static struct hubp *dcn303_hubp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + struct dcn20_hubp *hubp2 = kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -520,7 +520,7 @@ static const struct dcn3_dpp_mask tf_mask = { static struct dpp *dcn303_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -551,7 +551,7 @@ static const struct dcn20_opp_mask opp_mask = { static struct output_pixel_processor *dcn303_opp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + struct dcn20_opp *opp = kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -580,7 +580,7 @@ static const struct dcn_optc_mask optc_mask = { static struct timing_generator *dcn303_timing_generator_create(struct dc_context *ctx, uint32_t instance) { - struct optc *tgn10 = kzalloc_obj(struct optc, GFP_KERNEL); + struct optc *tgn10 = kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -617,7 +617,7 @@ static const struct dcn30_mpc_mask mpc_mask = { static struct mpc *dcn303_mpc_create(struct dc_context *ctx, int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -645,7 +645,7 @@ static const struct dcn20_dsc_mask dsc_mask = { static struct display_stream_compressor *dcn303_dsc_create(struct dc_context *ctx, uint32_t inst) { - struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + struct dcn20_dsc *dsc = kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c index 4fb54637f41e..b1b598dd97f2 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c @@ -919,7 +919,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -937,7 +937,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -954,7 +954,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -991,7 +991,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -1006,7 +1006,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1058,7 +1058,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1092,7 +1092,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1121,7 +1121,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1138,7 +1138,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1168,7 +1168,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1185,7 +1185,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1204,7 +1204,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1234,7 +1234,7 @@ static struct stream_encoder *dcn31_stream_encoder_create( } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1311,7 +1311,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1325,7 +1325,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1499,7 +1499,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1567,7 +1567,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1595,7 +1595,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1867,7 +1867,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2228,7 +2228,7 @@ struct resource_pool *dcn31_create_resource_pool( struct dc *dc) { struct dcn31_resource_pool *pool = - kzalloc_obj(struct dcn31_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn31_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c index 8c451d2a040a..d3b8de5c9b32 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c @@ -955,7 +955,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -973,7 +973,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -990,7 +990,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -1049,7 +1049,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -1064,7 +1064,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1116,7 +1116,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1150,7 +1150,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1179,7 +1179,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1196,7 +1196,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1226,7 +1226,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1243,7 +1243,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1262,7 +1262,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1292,7 +1292,7 @@ static struct stream_encoder *dcn314_stream_encoder_create( } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1370,7 +1370,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1384,7 +1384,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn314_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1557,7 +1557,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1625,7 +1625,7 @@ static struct display_stream_compressor *dcn314_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1653,7 +1653,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -1798,7 +1798,7 @@ static struct clock_source *dcn30_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2146,7 +2146,7 @@ struct resource_pool *dcn314_create_resource_pool( struct dc *dc) { struct dcn314_resource_pool *pool = - kzalloc_obj(struct dcn314_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn314_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c index 1a63eaf5e1d9..4398b5db4834 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c @@ -918,7 +918,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -936,7 +936,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -953,7 +953,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -990,7 +990,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -1005,7 +1005,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1057,7 +1057,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1091,7 +1091,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1120,7 +1120,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1137,7 +1137,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1167,7 +1167,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1184,7 +1184,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1203,7 +1203,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1235,7 +1235,7 @@ static struct stream_encoder *dcn315_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1312,7 +1312,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1326,7 +1326,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1500,7 +1500,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1568,7 +1568,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1596,7 +1596,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2167,7 +2167,7 @@ struct resource_pool *dcn315_create_resource_pool( struct dc *dc) { struct dcn315_resource_pool *pool = - kzalloc_obj(struct dcn315_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn315_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c index 4b8dddba34b8..68845cbf8383 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c @@ -911,7 +911,7 @@ static struct dpp *dcn31_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp) return NULL; @@ -929,7 +929,7 @@ static struct output_pixel_processor *dcn31_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -946,7 +946,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -983,7 +983,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -998,7 +998,7 @@ static struct mpc *dcn31_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1050,7 +1050,7 @@ static struct timing_generator *dcn31_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1084,7 +1084,7 @@ static struct link_encoder *dcn31_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1113,7 +1113,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1130,7 +1130,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1160,7 +1160,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1177,7 +1177,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1197,7 +1197,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1228,7 +1228,7 @@ static struct stream_encoder *dcn316_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1306,7 +1306,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1321,7 +1321,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn31_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); if (hws) { hws->ctx = ctx; @@ -1492,7 +1492,7 @@ static struct hubp *dcn31_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1560,7 +1560,7 @@ static struct display_stream_compressor *dcn31_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1588,7 +1588,7 @@ static struct clock_source *dcn31_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2034,7 +2034,7 @@ struct resource_pool *dcn316_create_resource_pool( struct dc *dc) { struct dcn316_resource_pool *pool = - kzalloc_obj(struct dcn316_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn316_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c index a93862071ff5..debf6a08e012 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c @@ -750,7 +750,7 @@ static struct dce_aux *dcn32_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -790,7 +790,7 @@ static struct dce_i2c_hw *dcn32_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -817,7 +817,7 @@ static struct clock_source *dcn32_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -893,7 +893,7 @@ static struct hubp *dcn32_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -925,7 +925,7 @@ static struct dpp *dcn32_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp3 = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp3) return NULL; @@ -951,7 +951,7 @@ static struct mpc *dcn32_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -974,7 +974,7 @@ static struct output_pixel_processor *dcn32_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp2 = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp2) { BREAK_TO_DEBUGGER(); @@ -999,7 +999,7 @@ static struct timing_generator *dcn32_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1040,7 +1040,7 @@ static struct link_encoder *dcn32_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1084,7 +1084,7 @@ static struct link_encoder *dcn32_link_encoder_create( struct panel_cntl *dcn32_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1123,7 +1123,7 @@ static struct vpg *dcn32_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -1153,7 +1153,7 @@ static struct afmt *dcn32_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -1179,7 +1179,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1216,7 +1216,7 @@ static struct stream_encoder *dcn32_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn32_vpg_create(ctx, vpg_inst); afmt = dcn32_afmt_create(ctx, afmt_inst); @@ -1308,7 +1308,7 @@ static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1327,7 +1327,7 @@ static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn32_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1566,7 +1566,7 @@ static struct display_stream_compressor *dcn32_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -2572,7 +2572,7 @@ struct resource_pool *dcn32_create_resource_pool( struct dc *dc) { struct dcn32_resource_pool *pool = - kzalloc_obj(struct dcn32_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn32_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c index 97976318f4c0..d936192c3a6c 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c @@ -744,7 +744,7 @@ static struct dce_aux *dcn321_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -784,7 +784,7 @@ static struct dce_i2c_hw *dcn321_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -811,7 +811,7 @@ static struct clock_source *dcn321_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -887,7 +887,7 @@ static struct hubp *dcn321_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -919,7 +919,7 @@ static struct dpp *dcn321_dpp_create( uint32_t inst) { struct dcn3_dpp *dpp3 = - kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn3_dpp); if (!dpp3) return NULL; @@ -945,7 +945,7 @@ static struct mpc *dcn321_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -968,7 +968,7 @@ static struct output_pixel_processor *dcn321_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp2 = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp2) { BREAK_TO_DEBUGGER(); @@ -993,7 +993,7 @@ static struct timing_generator *dcn321_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1034,7 +1034,7 @@ static struct link_encoder *dcn321_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1104,7 +1104,7 @@ static struct vpg *dcn321_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg, GFP_KERNEL); + struct dcn30_vpg *vpg3 = kzalloc_obj(struct dcn30_vpg); if (!vpg3) return NULL; @@ -1134,7 +1134,7 @@ static struct afmt *dcn321_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt3 = kzalloc_obj(struct dcn30_afmt); if (!afmt3) return NULL; @@ -1160,7 +1160,7 @@ static struct apg *dcn321_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1197,7 +1197,7 @@ static struct stream_encoder *dcn321_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn321_vpg_create(ctx, vpg_inst); afmt = dcn321_afmt_create(ctx, afmt_inst); @@ -1289,7 +1289,7 @@ static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1308,7 +1308,7 @@ static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn321_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1546,7 +1546,7 @@ static struct display_stream_compressor *dcn321_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -2064,7 +2064,7 @@ struct resource_pool *dcn321_create_resource_pool( struct dc *dc) { struct dcn321_resource_pool *pool = - kzalloc_obj(struct dcn321_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn321_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c index 26493ed5a6fc..2be765f70889 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c @@ -810,7 +810,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp); bool success = (dpp != NULL); if (!success) @@ -841,7 +841,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -868,7 +868,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -931,7 +931,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -954,7 +954,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1033,7 +1033,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1074,7 +1074,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1127,7 +1127,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1144,7 +1144,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1185,7 +1185,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1215,7 +1215,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1243,7 +1243,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1280,7 +1280,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1372,7 +1372,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1391,7 +1391,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn35_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1572,7 +1572,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1673,7 +1673,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1710,7 +1710,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2210,7 +2210,7 @@ struct resource_pool *dcn35_create_resource_pool( struct dc *dc) { struct dcn35_resource_pool *pool = - kzalloc_obj(struct dcn35_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn35_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c index 0e204d8e1336..bc41df90715c 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c @@ -790,7 +790,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp); bool success = (dpp != NULL); if (!success) @@ -821,7 +821,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -848,7 +848,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -911,7 +911,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -934,7 +934,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1013,7 +1013,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1054,7 +1054,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1107,7 +1107,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1124,7 +1124,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1165,7 +1165,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1195,7 +1195,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1223,7 +1223,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1260,7 +1260,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( vpg_inst = eng_id; afmt_inst = eng_id; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1352,7 +1352,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1371,7 +1371,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn351_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1552,7 +1552,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1653,7 +1653,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1690,7 +1690,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2183,7 +2183,7 @@ struct resource_pool *dcn351_create_resource_pool( struct dc *dc) { struct dcn351_resource_pool *pool = - kzalloc_obj(struct dcn351_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn351_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c index c0cf8c46031f..ae95b1497af3 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c @@ -797,7 +797,7 @@ static void dcn35_dpp_destroy(struct dpp **dpp) static struct dpp *dcn35_dpp_create(struct dc_context *ctx, uint32_t inst) { - struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp, GFP_KERNEL); + struct dcn3_dpp *dpp = kzalloc_obj(struct dcn3_dpp); bool success = (dpp != NULL); if (!success) @@ -828,7 +828,7 @@ static struct output_pixel_processor *dcn35_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp) { BREAK_TO_DEBUGGER(); @@ -855,7 +855,7 @@ static struct dce_aux *dcn31_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -918,7 +918,7 @@ static struct dce_i2c_hw *dcn31_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -941,7 +941,7 @@ static struct mpc *dcn35_mpc_create( int num_mpcc, int num_rmu) { - struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc, GFP_KERNEL); + struct dcn30_mpc *mpc30 = kzalloc_obj(struct dcn30_mpc); if (!mpc30) return NULL; @@ -1020,7 +1020,7 @@ static struct timing_generator *dcn35_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1061,7 +1061,7 @@ static struct link_encoder *dcn35_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1114,7 +1114,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( if ((eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc) return NULL; - enc20 = kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + enc20 = kzalloc_obj(struct dcn20_link_encoder); if (!enc20) return NULL; @@ -1131,7 +1131,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal( static struct panel_cntl *dcn31_panel_cntl_create(const struct panel_cntl_init_data *init_data) { struct dcn31_panel_cntl *panel_cntl = - kzalloc_obj(struct dcn31_panel_cntl, GFP_KERNEL); + kzalloc_obj(struct dcn31_panel_cntl); if (!panel_cntl) return NULL; @@ -1172,7 +1172,7 @@ static struct vpg *dcn31_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg31 = kzalloc_obj(struct dcn31_vpg); if (!vpg31) return NULL; @@ -1202,7 +1202,7 @@ static struct afmt *dcn31_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt, GFP_KERNEL); + struct dcn31_afmt *afmt31 = kzalloc_obj(struct dcn31_afmt); if (!afmt31) return NULL; @@ -1230,7 +1230,7 @@ static struct apg *dcn31_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1267,7 +1267,7 @@ static struct stream_encoder *dcn35_stream_encoder_create( } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn31_vpg_create(ctx, vpg_inst); afmt = dcn31_afmt_create(ctx, afmt_inst); @@ -1359,7 +1359,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1378,7 +1378,7 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create( static struct dce_hwseq *dcn36_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1559,7 +1559,7 @@ static struct hubp *dcn35_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -1660,7 +1660,7 @@ static struct display_stream_compressor *dcn35_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_dsc *dsc = - kzalloc_obj(struct dcn20_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn20_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -1697,7 +1697,7 @@ static struct clock_source *dcn35_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -2189,7 +2189,7 @@ struct resource_pool *dcn36_create_resource_pool( struct dc *dc) { struct dcn36_resource_pool *pool = - kzalloc_obj(struct dcn36_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn36_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c index db8a0c0b8cda..ce272e279c5f 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c @@ -762,7 +762,7 @@ static struct dce_aux *dcn401_aux_engine_create( uint32_t inst) { struct aux_engine_dce110 *aux_engine = - kzalloc_obj(struct aux_engine_dce110, GFP_KERNEL); + kzalloc_obj(struct aux_engine_dce110); if (!aux_engine) return NULL; @@ -801,7 +801,7 @@ static struct dce_i2c_hw *dcn401_i2c_hw_create( uint32_t inst) { struct dce_i2c_hw *dce_i2c_hw = - kzalloc_obj(struct dce_i2c_hw, GFP_KERNEL); + kzalloc_obj(struct dce_i2c_hw); if (!dce_i2c_hw) return NULL; @@ -827,7 +827,7 @@ static struct clock_source *dcn401_clock_source_create( bool dp_clk_src) { struct dce110_clk_src *clk_src = - kzalloc_obj(struct dce110_clk_src, GFP_KERNEL); + kzalloc_obj(struct dce110_clk_src); if (!clk_src) return NULL; @@ -900,7 +900,7 @@ static struct hubbub *dcn401_hubbub_create(struct dc_context *ctx) static struct dio *dcn401_dio_create(struct dc_context *ctx) { - struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio, GFP_KERNEL); + struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio); if (!dio10) return NULL; @@ -919,7 +919,7 @@ static struct hubp *dcn401_hubp_create( uint32_t inst) { struct dcn20_hubp *hubp2 = - kzalloc_obj(struct dcn20_hubp, GFP_KERNEL); + kzalloc_obj(struct dcn20_hubp); if (!hubp2) return NULL; @@ -951,7 +951,7 @@ static struct dpp *dcn401_dpp_create( uint32_t inst) { struct dcn401_dpp *dpp401 = - kzalloc_obj(struct dcn401_dpp, GFP_KERNEL); + kzalloc_obj(struct dcn401_dpp); if (!dpp401) return NULL; @@ -977,7 +977,7 @@ static struct mpc *dcn401_mpc_create( int num_mpcc, int num_rmu) { - struct dcn401_mpc *mpc401 = kzalloc_obj(struct dcn401_mpc, GFP_KERNEL); + struct dcn401_mpc *mpc401 = kzalloc_obj(struct dcn401_mpc); if (!mpc401) return NULL; @@ -1000,7 +1000,7 @@ static struct output_pixel_processor *dcn401_opp_create( struct dc_context *ctx, uint32_t inst) { struct dcn20_opp *opp4 = - kzalloc_obj(struct dcn20_opp, GFP_KERNEL); + kzalloc_obj(struct dcn20_opp); if (!opp4) { BREAK_TO_DEBUGGER(); @@ -1025,7 +1025,7 @@ static struct timing_generator *dcn401_timing_generator_create( uint32_t instance) { struct optc *tgn10 = - kzalloc_obj(struct optc, GFP_KERNEL); + kzalloc_obj(struct optc); if (!tgn10) return NULL; @@ -1065,7 +1065,7 @@ static struct link_encoder *dcn401_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dcn20_link_encoder *enc20 = - kzalloc_obj(struct dcn20_link_encoder, GFP_KERNEL); + kzalloc_obj(struct dcn20_link_encoder); if (!enc20 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs)) return NULL; @@ -1130,7 +1130,7 @@ static struct vpg *dcn401_vpg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_vpg *vpg4 = kzalloc_obj(struct dcn31_vpg, GFP_KERNEL); + struct dcn31_vpg *vpg4 = kzalloc_obj(struct dcn31_vpg); if (!vpg4) return NULL; @@ -1160,7 +1160,7 @@ static struct afmt *dcn401_afmt_create( struct dc_context *ctx, uint32_t inst) { - struct dcn30_afmt *afmt401 = kzalloc_obj(struct dcn30_afmt, GFP_KERNEL); + struct dcn30_afmt *afmt401 = kzalloc_obj(struct dcn30_afmt); if (!afmt401) return NULL; @@ -1185,7 +1185,7 @@ static struct apg *dcn401_apg_create( struct dc_context *ctx, uint32_t inst) { - struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg, GFP_KERNEL); + struct dcn31_apg *apg31 = kzalloc_obj(struct dcn31_apg); if (!apg31) return NULL; @@ -1222,7 +1222,7 @@ static struct stream_encoder *dcn401_stream_encoder_create( } else return NULL; - enc1 = kzalloc_obj(struct dcn10_stream_encoder, GFP_KERNEL); + enc1 = kzalloc_obj(struct dcn10_stream_encoder); vpg = dcn401_vpg_create(ctx, vpg_inst); afmt = dcn401_afmt_create(ctx, afmt_inst); @@ -1312,7 +1312,7 @@ static struct hpo_dp_link_encoder *dcn401_hpo_dp_link_encoder_create( struct dcn31_hpo_dp_link_encoder *hpo_dp_enc31; /* allocate HPO link encoder */ - hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder, GFP_KERNEL); + hpo_dp_enc31 = kzalloc_obj(struct dcn31_hpo_dp_link_encoder); if (!hpo_dp_enc31) return NULL; /* out of memory */ @@ -1356,7 +1356,7 @@ static unsigned int dcn401_calc_num_avail_chans_for_mall(struct dc *dc, unsigned static struct dce_hwseq *dcn401_hwseq_create( struct dc_context *ctx) { - struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq, GFP_KERNEL); + struct dce_hwseq *hws = kzalloc_obj(struct dce_hwseq); #undef REG_STRUCT #define REG_STRUCT hwseq_reg @@ -1609,7 +1609,7 @@ static struct display_stream_compressor *dcn401_dsc_create( struct dc_context *ctx, uint32_t inst) { struct dcn401_dsc *dsc = - kzalloc_obj(struct dcn401_dsc, GFP_KERNEL); + kzalloc_obj(struct dcn401_dsc); if (!dsc) { BREAK_TO_DEBUGGER(); @@ -2314,7 +2314,7 @@ struct resource_pool *dcn401_create_resource_pool( struct dc *dc) { struct dcn401_resource_pool *pool = - kzalloc_obj(struct dcn401_resource_pool, GFP_KERNEL); + kzalloc_obj(struct dcn401_resource_pool); if (!pool) return NULL; diff --git a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c index 1334d0efe6e3..6617c9d2d5f8 100644 --- a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c +++ b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/soc_and_ip_translator.c @@ -21,7 +21,7 @@ struct soc_and_ip_translator *dc_create_soc_and_ip_translator(enum dce_version d { struct soc_and_ip_translator *soc_and_ip_translator; - soc_and_ip_translator = kzalloc_obj(*soc_and_ip_translator, GFP_KERNEL); + soc_and_ip_translator = kzalloc_obj(*soc_and_ip_translator); if (!soc_and_ip_translator) return NULL; diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c index 33a7627191f8..a62ff18f3434 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c @@ -933,7 +933,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma, struct pwl_float_data_ex *rgb = rgb_regamma; const struct hw_x_point *coord_x = coordinate_x; - coeff = kvzalloc_obj(*coeff, GFP_KERNEL); + coeff = kvzalloc_obj(*coeff); if (!coeff) goto release; @@ -1738,11 +1738,11 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps, scale_gamma(rgb_user, ramp, dividers); } - curve = kvzalloc_objs(*curve, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); + curve = kvzalloc_objs(*curve, MAX_HW_POINTS + _EXTRA_POINTS); if (!curve) goto curve_alloc_fail; - coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); + coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS); if (!coeff) goto coeff_alloc_fail; @@ -1970,7 +1970,7 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf, if (!rgb_regamma) goto rgb_regamma_alloc_fail; - coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS, GFP_KERNEL); + coeff = kvzalloc_objs(*coeff, MAX_HW_POINTS + _EXTRA_POINTS); if (!coeff) goto coeff_alloc_fail; diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index b819610021f2..19de72173052 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -61,7 +61,7 @@ struct core_freesync { struct mod_freesync *mod_freesync_create(struct dc *dc) { struct core_freesync *core_freesync = - kzalloc_obj(struct core_freesync, GFP_KERNEL); + kzalloc_obj(struct core_freesync); if (core_freesync == NULL) goto fail_alloc_context; diff --git a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c index ccd35d1f05ec..9f408cb11ac9 100644 --- a/drivers/gpu/drm/amd/display/modules/vmid/vmid.c +++ b/drivers/gpu/drm/amd/display/modules/vmid/vmid.c @@ -144,7 +144,7 @@ struct mod_vmid *mod_vmid_create( if (dc == NULL) goto fail_dc_null; - core_vmid = kzalloc_obj(struct core_vmid, GFP_KERNEL); + core_vmid = kzalloc_obj(struct core_vmid); if (core_vmid == NULL) goto fail_alloc_context; diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 28b178d0aff6..eca93a9d0b84 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -2746,7 +2746,7 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev, name, ret); } - attr_entry = kmalloc_obj(*attr_entry, GFP_KERNEL); + attr_entry = kmalloc_obj(*attr_entry); if (!attr_entry) return -ENOMEM; @@ -4592,7 +4592,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) int ret; /* Setup the top `gpu_od` directory which holds all other OD interfaces */ - top_set = kzalloc_obj(*top_set, GFP_KERNEL); + top_set = kzalloc_obj(*top_set); if (!top_set) return -ENOMEM; list_add(&top_set->entry, &adev->pm.od_kobj_list); @@ -4629,7 +4629,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) * The container is presented as a plain file under top `gpu_od` * directory. */ - attribute = kzalloc_obj(*attribute, GFP_KERNEL); + attribute = kzalloc_obj(*attribute); if (!attribute) { ret = -ENOMEM; goto err_out; @@ -4649,7 +4649,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) goto err_out; } else { /* The container is presented as a sub directory. */ - sub_set = kzalloc_obj(*sub_set, GFP_KERNEL); + sub_set = kzalloc_obj(*sub_set); if (!sub_set) { ret = -ENOMEM; goto err_out; @@ -4679,7 +4679,7 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) * With the container presented as a sub directory, the entry within * it is presented as a plain file under the sub directory. */ - attribute = kzalloc_obj(*attribute, GFP_KERNEL); + attribute = kzalloc_obj(*attribute); if (!attribute) { ret = -ENOMEM; goto err_out; diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c index 5d0c0c5a706b..7a0d6e05e83b 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c @@ -2735,7 +2735,7 @@ static int kv_parse_power_table(struct amdgpu_device *adev) non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; - ps = kzalloc_obj(struct kv_ps, GFP_KERNEL); + ps = kzalloc_obj(struct kv_ps); if (ps == NULL) return -ENOMEM; adev->pm.dpm.ps[i].ps_priv = ps; @@ -2782,7 +2782,7 @@ static int kv_dpm_init(struct amdgpu_device *adev) struct kv_power_info *pi; int ret, i; - pi = kzalloc_obj(struct kv_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct kv_power_info); if (pi == NULL) return -ENOMEM; adev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c index c41bcc8a7efb..37d704ac3841 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c @@ -502,7 +502,7 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(ext_hdr->usPPMTableOffset)); adev->pm.dpm.dyn_state.ppm_table = - kzalloc_obj(struct amdgpu_ppm_table, GFP_KERNEL); + kzalloc_obj(struct amdgpu_ppm_table); if (!adev->pm.dpm.dyn_state.ppm_table) return -ENOMEM; adev->pm.dpm.dyn_state.ppm_table->ppm_design = ppm->ucPpmDesign; diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c index b4fc0106f973..c81327da1f72 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c @@ -2586,7 +2586,7 @@ static int si_initialize_smc_dte_tables(struct amdgpu_device *adev) if (dte_data->k <= 0) return -EINVAL; - dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration, GFP_KERNEL); + dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration); if (dte_tables == NULL) { si_pi->enable_dte = false; return -ENOMEM; @@ -2767,7 +2767,7 @@ static int si_initialize_smc_cac_tables(struct amdgpu_device *adev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc_obj(PP_SIslands_CacConfig, GFP_KERNEL); + cac_tables = kzalloc_obj(PP_SIslands_CacConfig); if (!cac_tables) return -ENOMEM; @@ -2964,7 +2964,7 @@ static int si_init_smc_spll_table(struct amdgpu_device *adev) if (si_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); + spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE); if (spll_table == NULL) return -ENOMEM; @@ -6054,7 +6054,7 @@ static int si_initialize_mc_reg_table(struct amdgpu_device *adev) u8 module_index = rv770_get_memory_module_index(adev); int ret; - table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table); if (!table) return -ENOMEM; @@ -7352,7 +7352,7 @@ static int si_parse_power_table(struct amdgpu_device *adev) non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; - ps = kzalloc_obj(struct si_ps, GFP_KERNEL); + ps = kzalloc_obj(struct si_ps); if (ps == NULL) return -ENOMEM; adev->pm.dpm.ps[i].ps_priv = ps; @@ -7405,7 +7405,7 @@ static int si_dpm_init(struct amdgpu_device *adev) struct atom_clock_dividers dividers; int ret; - si_pi = kzalloc_obj(struct si_power_info, GFP_KERNEL); + si_pi = kzalloc_obj(struct si_power_info); if (si_pi == NULL) return -ENOMEM; adev->pm.dpm.priv = si_pi; diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c index cd3036e33c5a..e558b81b25c9 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c @@ -41,7 +41,7 @@ static int amd_powerplay_create(struct amdgpu_device *adev) if (adev == NULL) return -EINVAL; - hwmgr = kzalloc_obj(struct pp_hwmgr, GFP_KERNEL); + hwmgr = kzalloc_obj(struct pp_hwmgr); if (hwmgr == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c index a1292d5b0a1c..37a85d8a3db2 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c @@ -200,7 +200,7 @@ static int get_platform_power_management_table( struct pp_hwmgr *hwmgr, ATOM_Tonga_PPM_Table *atom_ppm_table) { - struct phm_ppm_table *ptr = kzalloc_obj(*ptr, GFP_KERNEL); + struct phm_ppm_table *ptr = kzalloc_obj(*ptr); struct phm_ppt_v1_information *pp_table_information = (struct phm_ppt_v1_information *)(hwmgr->pptable); @@ -1142,7 +1142,7 @@ static int pp_tables_v1_0_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Tonga_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc_obj(struct phm_ppt_v1_information, GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v1_information); PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c index 49dc20b790ad..d83e5c53bd43 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c @@ -550,7 +550,7 @@ static int smu10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) int result = 0; struct smu10_hwmgr *data; - data = kzalloc_obj(struct smu10_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct smu10_hwmgr); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index a97136743723..e38222877f7e 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -2961,7 +2961,7 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct smu7_hwmgr *data; int result = 0; - data = kzalloc_obj(struct smu7_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct smu7_hwmgr); if (data == NULL) return -ENOMEM; @@ -4652,7 +4652,7 @@ static const struct amdgpu_irq_src_funcs smu7_irq_funcs = { static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr) { struct amdgpu_irq_src *source = - kzalloc_obj(struct amdgpu_irq_src, GFP_KERNEL); + kzalloc_obj(struct amdgpu_irq_src); if (!source) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c index 5d20c41b3803..8133f2cc5e1d 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c @@ -1121,7 +1121,7 @@ static int smu8_hwmgr_backend_init(struct pp_hwmgr *hwmgr) int result = 0; struct smu8_hwmgr *data; - data = kzalloc_obj(struct smu8_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct smu8_hwmgr); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c index 68ae1bc36a7f..29837c0f42ed 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c @@ -211,7 +211,7 @@ int phm_trim_voltage_table(struct pp_atomctrl_voltage_table *vol_table) PP_ASSERT_WITH_CODE((NULL != vol_table), "Voltage Table empty.", return -EINVAL); - table = kzalloc_obj(struct pp_atomctrl_voltage_table, GFP_KERNEL); + table = kzalloc_obj(struct pp_atomctrl_voltage_table); if (NULL == table) return -EINVAL; @@ -644,7 +644,7 @@ static const struct amdgpu_irq_src_funcs smu9_irq_funcs = { int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr) { struct amdgpu_irq_src *source = - kzalloc_obj(struct amdgpu_irq_src, GFP_KERNEL); + kzalloc_obj(struct amdgpu_irq_src); if (!source) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c index 255fa6c96120..d9899cf7020b 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c @@ -831,7 +831,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct pp_atomfwctrl_voltage_table vol_table; struct amdgpu_device *adev = hwmgr->adev; - data = kzalloc_obj(struct vega10_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct vega10_hwmgr); if (data == NULL) return -ENOMEM; @@ -1029,7 +1029,7 @@ static int vega10_trim_voltage_table(struct pp_hwmgr *hwmgr, PP_ASSERT_WITH_CODE(vol_table, "Voltage Table empty.", return -EINVAL); - table = kzalloc_obj(struct pp_atomfwctrl_voltage_table, GFP_KERNEL); + table = kzalloc_obj(struct pp_atomfwctrl_voltage_table); if (!table) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c index 2b9a1840a35a..b9a1ab27d995 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c @@ -1148,7 +1148,7 @@ static int vega10_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega10_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc_obj(struct phm_ppt_v2_information, GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v2_information); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c index eca05a6c868f..a9a85fd639b2 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c @@ -395,7 +395,7 @@ static int vega12_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct vega12_hwmgr *data; struct amdgpu_device *adev = hwmgr->adev; - data = kzalloc_obj(struct vega12_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct vega12_hwmgr); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c index b8fad7417190..55e13f376039 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c @@ -263,7 +263,7 @@ static int vega12_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega12_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information, GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c index 1dc84beaf440..dab9b78a9fc8 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c @@ -436,7 +436,7 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr) struct amdgpu_device *adev = hwmgr->adev; int result; - data = kzalloc_obj(struct vega20_hwmgr, GFP_KERNEL); + data = kzalloc_obj(struct vega20_hwmgr); if (data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c index 4316b5e4b848..36cb7aa80d07 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c @@ -336,7 +336,7 @@ static int vega20_pp_tables_initialize(struct pp_hwmgr *hwmgr) int result = 0; const ATOM_Vega20_POWERPLAYTABLE *powerplay_table; - hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information, GFP_KERNEL); + hwmgr->pptable = kzalloc_obj(struct phm_ppt_v3_information); PP_ASSERT_WITH_CODE((hwmgr->pptable != NULL), "Failed to allocate hwmgr->pptable!", return -ENOMEM); diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c index 12a699a8c954..62ebec1c6fe3 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c @@ -2681,7 +2681,7 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct ci_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = ci_get_memory_modile_index(hwmgr); - table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table); if (NULL == table) return -ENOMEM; @@ -2735,7 +2735,7 @@ static int ci_smu_init(struct pp_hwmgr *hwmgr) { struct ci_smumgr *ci_priv; - ci_priv = kzalloc_obj(struct ci_smumgr, GFP_KERNEL); + ci_priv = kzalloc_obj(struct ci_smumgr); if (ci_priv == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c index d7fd3a36ac95..7cf389e4717e 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c @@ -334,7 +334,7 @@ static int fiji_smu_init(struct pp_hwmgr *hwmgr) { struct fiji_smumgr *fiji_priv; - fiji_priv = kzalloc_obj(struct fiji_smumgr, GFP_KERNEL); + fiji_priv = kzalloc_obj(struct fiji_smumgr); if (fiji_priv == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c index b990def7d1aa..8f1bcbb482b5 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c @@ -261,7 +261,7 @@ static int iceland_smu_init(struct pp_hwmgr *hwmgr) { struct iceland_smumgr *iceland_priv; - iceland_priv = kzalloc_obj(struct iceland_smumgr, GFP_KERNEL); + iceland_priv = kzalloc_obj(struct iceland_smumgr); if (iceland_priv == NULL) return -ENOMEM; @@ -2608,7 +2608,7 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct iceland_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = iceland_get_memory_modile_index(hwmgr); - table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table); if (NULL == table) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c index 497a70988960..e59b87238e76 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c @@ -336,7 +336,7 @@ static int polaris10_smu_init(struct pp_hwmgr *hwmgr) { struct polaris10_smumgr *smu_data; - smu_data = kzalloc_obj(struct polaris10_smumgr, GFP_KERNEL); + smu_data = kzalloc_obj(struct polaris10_smumgr); if (smu_data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c index 22e0db4e097f..c9fdca88c96a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c @@ -244,7 +244,7 @@ static int smu10_smu_init(struct pp_hwmgr *hwmgr) struct smu10_smumgr *priv; int r; - priv = kzalloc_obj(struct smu10_smumgr, GFP_KERNEL); + priv = kzalloc_obj(struct smu10_smumgr); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c index 9d6203998b5c..3e0068a6aeb2 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c @@ -333,7 +333,7 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) if (!smu_data->toc) { struct SMU_DRAMData_TOC *toc; - smu_data->toc = kzalloc_obj(struct SMU_DRAMData_TOC, GFP_KERNEL); + smu_data->toc = kzalloc_obj(struct SMU_DRAMData_TOC); if (!smu_data->toc) return -ENOMEM; toc = smu_data->toc; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c index 82f4f466db8a..f3f2b8fe8d63 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c @@ -758,7 +758,7 @@ static int smu8_smu_init(struct pp_hwmgr *hwmgr) int ret = 0; struct smu8_smumgr *smu8_smu; - smu8_smu = kzalloc_obj(struct smu8_smumgr, GFP_KERNEL); + smu8_smu = kzalloc_obj(struct smu8_smumgr); if (smu8_smu == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c index 95d87b12df04..28fe988c2262 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c @@ -228,7 +228,7 @@ static int tonga_smu_init(struct pp_hwmgr *hwmgr) { struct tonga_smumgr *tonga_priv; - tonga_priv = kzalloc_obj(struct tonga_smumgr, GFP_KERNEL); + tonga_priv = kzalloc_obj(struct tonga_smumgr); if (tonga_priv == NULL) return -ENOMEM; @@ -3072,7 +3072,7 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) struct tonga_mc_reg_table *ni_table = &smu_data->mc_reg_table; uint8_t module_index = tonga_get_memory_modile_index(hwmgr); - table = kzalloc_obj(pp_atomctrl_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(pp_atomctrl_mc_reg_table); if (table == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c index fe960e3c1010..39192adf441f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c @@ -218,7 +218,7 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc_obj(struct vega10_smumgr, GFP_KERNEL); + priv = kzalloc_obj(struct vega10_smumgr); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c index bd846c4f09a1..99db4cf8e11d 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c @@ -221,7 +221,7 @@ static int vega12_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc_obj(struct vega12_smumgr, GFP_KERNEL); + priv = kzalloc_obj(struct vega12_smumgr); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c index 7dda3ad13861..b982c03f9e9a 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c @@ -430,7 +430,7 @@ static int vega20_smu_init(struct pp_hwmgr *hwmgr) if (ret || !info.kptr) return -EINVAL; - priv = kzalloc_obj(struct vega20_smumgr, GFP_KERNEL); + priv = kzalloc_obj(struct vega20_smumgr); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c index 57eed236baa4..cca6693853ec 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c @@ -83,7 +83,7 @@ static int vegam_smu_init(struct pp_hwmgr *hwmgr) { struct vegam_smumgr *smu_data; - smu_data = kzalloc_obj(struct vegam_smumgr, GFP_KERNEL); + smu_data = kzalloc_obj(struct vegam_smumgr); if (smu_data == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 2f02410376b9..b05c8bbdf2f3 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -803,7 +803,7 @@ static int smu_early_init(struct amdgpu_ip_block *ip_block) struct smu_context *smu; int r; - smu = kzalloc_obj(struct smu_context, GFP_KERNEL); + smu = kzalloc_obj(struct smu_context); if (!smu) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c index 747879cbb4e6..ff3776eb0c69 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c @@ -267,7 +267,7 @@ static int arcturus_tables_init(struct smu_context *smu) sizeof(DpmActivityMonitorCoeffInt_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) return -ENOMEM; smu_table->metrics_time = 0; @@ -314,7 +314,7 @@ static int arcturus_allocate_dpm_context(struct smu_context *smu) smu_dpm->dpm_context_size = sizeof(struct smu_11_0_dpm_context); smu_dpm->dpm_policies = - kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt); if (!smu_dpm->dpm_policies) return -ENOMEM; @@ -1579,7 +1579,7 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c index 97a785182e58..4e70308a455e 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c @@ -97,7 +97,7 @@ static int cyan_skillfish_tables_init(struct smu_context *smu) PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err0_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index 48c75e293541..4f12543270c3 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -516,7 +516,7 @@ static int navi10_tables_init(struct smu_context *smu) dummy_read_1_table->align = PAGE_SIZE; dummy_read_1_table->domain = AMDGPU_GEM_DOMAIN_VRAM; - smu_table->metrics_table = kzalloc_obj(SmuMetrics_NV1X_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_NV1X_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -527,7 +527,7 @@ static int navi10_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; @@ -2793,7 +2793,7 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 2c6378c51333..317cc269cc06 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -555,7 +555,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_DRIVER_SMU_CONFIG, sizeof(DriverSmuConfigExternal_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -566,7 +566,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; @@ -2507,7 +2507,7 @@ static int sienna_cichlid_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c index 87502f9b5ca4..12b052d920f5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c @@ -378,7 +378,7 @@ int smu_v11_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc_obj(struct smu_11_0_max_sustainable_clocks, GFP_KERNEL); + kzalloc_obj(struct smu_11_0_max_sustainable_clocks); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index 86d8e5df1eb1..16eb73ba6b0c 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -253,11 +253,11 @@ static int vangogh_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err3_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c index f4951630375b..186020ed6708 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c @@ -157,16 +157,16 @@ static int renoir_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 618d0098208d..35495da90ee7 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -245,7 +245,7 @@ static int aldebaran_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_ECCINFO, sizeof(EccInfoTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) return -ENOMEM; smu_table->metrics_time = 0; @@ -301,7 +301,7 @@ static int aldebaran_allocate_dpm_context(struct smu_context *smu) smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context); smu_dpm->dpm_policies = - kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt); if (!smu_dpm->dpm_policies) return -ENOMEM; @@ -1422,7 +1422,7 @@ static int aldebaran_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c index 531fb265c948..f06608df14c4 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -449,7 +449,7 @@ int smu_v13_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc_obj(struct smu_13_0_max_sustainable_clocks, GFP_KERNEL); + kzalloc_obj(struct smu_13_0_max_sustainable_clocks); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 013942fac955..a0d146a99f2a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -495,7 +495,7 @@ static int smu_v13_0_0_tables_init(struct smu_context *smu) sizeof(WifiBandEntryTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -506,7 +506,7 @@ static int smu_v13_0_0_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; @@ -2638,7 +2638,7 @@ static int smu_v13_0_0_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c index 5ada870f8b65..32d5e2170d80 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c @@ -223,7 +223,7 @@ static int smu_v13_0_12_fru_get_product_info(struct smu_context *smu, struct amdgpu_device *adev = smu->adev; if (!adev->fru_info) { - adev->fru_info = kzalloc_obj(*adev->fru_info, GFP_KERNEL); + adev->fru_info = kzalloc_obj(*adev->fru_info); if (!adev->fru_info) return -ENOMEM; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c index 9e8b330f34dc..5b1a038d6a19 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c @@ -161,16 +161,16 @@ static int smu_v13_0_4_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c index 25de5e2dde83..d534723fef91 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c @@ -136,16 +136,16 @@ static int smu_v13_0_5_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c index b85130bd8c08..896b51c8a9a7 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c @@ -586,7 +586,7 @@ static int smu_v13_0_6_tables_init(struct smu_context *smu) return -ENOMEM; smu_table->metrics_time = 0; - driver_pptable = kzalloc_obj(struct PPTable_t, GFP_KERNEL); + driver_pptable = kzalloc_obj(struct PPTable_t); if (!driver_pptable) return -ENOMEM; @@ -690,13 +690,13 @@ static int smu_v13_0_6_allocate_dpm_context(struct smu_context *smu) struct smu_dpm_policy *policy; smu_dpm->dpm_context = - kzalloc_obj(struct smu_13_0_dpm_context, GFP_KERNEL); + kzalloc_obj(struct smu_13_0_dpm_context); if (!smu_dpm->dpm_context) return -ENOMEM; smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context); smu_dpm->dpm_policies = - kzalloc_obj(struct smu_dpm_policy_ctxt, GFP_KERNEL); + kzalloc_obj(struct smu_dpm_policy_ctxt); if (!smu_dpm->dpm_policies) { kfree(smu_dpm->dpm_context); return -ENOMEM; @@ -2341,7 +2341,7 @@ static int smu_v13_0_6_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c index 6aefebdb0bad..b82034f3bc2a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -530,7 +530,7 @@ static int smu_v13_0_7_tables_init(struct smu_context *smu) sizeof(WifiBandEntryTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -541,7 +541,7 @@ static int smu_v13_0_7_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c index e3700c704016..f43a91ac6970 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c @@ -163,16 +163,16 @@ static int yellow_carp_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err0_out; - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err1_out; smu_table->metrics_time = 0; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c index 2cfa8eb70cb3..1334776dd034 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c @@ -439,7 +439,7 @@ int smu_v14_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc_obj(struct smu_14_0_max_sustainable_clocks, GFP_KERNEL); + kzalloc_obj(struct smu_14_0_max_sustainable_clocks); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c index a863e637e37f..2353524b8821 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c @@ -197,7 +197,7 @@ static int smu_v14_0_0_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -206,7 +206,7 @@ static int smu_v14_0_0_init_smc_tables(struct smu_context *smu) if (!smu_table->clocks_table) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c index b051a1f58760..fc50552771a4 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c @@ -393,7 +393,7 @@ static int smu_v14_0_2_tables_init(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_ECCINFO, sizeof(EccInfoTable_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetricsExternal_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -404,7 +404,7 @@ static int smu_v14_0_2_tables_init(struct smu_context *smu) if (ret) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; @@ -1876,7 +1876,7 @@ static int smu_v14_0_2_i2c_xfer(struct i2c_adapter *i2c_adap, if (!adev->pm.dpm_enabled) return -EBUSY; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c index 2070cb31f185..1fbc104afa6a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c @@ -408,7 +408,7 @@ int smu_v15_0_init_smc_tables(struct smu_context *smu) } smu_table->max_sustainable_clocks = - kzalloc_obj(struct smu_15_0_max_sustainable_clocks, GFP_KERNEL); + kzalloc_obj(struct smu_15_0_max_sustainable_clocks); if (!smu_table->max_sustainable_clocks) { ret = -ENOMEM; goto err1_out; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c index 18c31a50d281..49cf2b9d931e 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c @@ -173,16 +173,16 @@ static int smu_v15_0_0_init_smc_tables(struct smu_context *smu) SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc_obj(SmuMetrics_t, GFP_KERNEL); + smu_table->metrics_table = kzalloc_obj(SmuMetrics_t); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; - smu_table->clocks_table = kzalloc_obj(DpmClocks_t, GFP_KERNEL); + smu_table->clocks_table = kzalloc_obj(DpmClocks_t); if (!smu_table->clocks_table) goto err1_out; - smu_table->watermarks_table = kzalloc_obj(Watermarks_t, GFP_KERNEL); + smu_table->watermarks_table = kzalloc_obj(Watermarks_t); if (!smu_table->watermarks_table) goto err2_out; diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c index 611171fea3cb..9190c9cd7993 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c @@ -299,7 +299,7 @@ static int amdgpu_ras_mgr_sw_init(struct amdgpu_ip_block *ip_block) if (!con->uniras_enabled) return 0; - ras_mgr = kzalloc_obj(*ras_mgr, GFP_KERNEL); + ras_mgr = kzalloc_obj(*ras_mgr); if (!ras_mgr) return -EINVAL; diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c index 65223bfec688..087a893afbba 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c @@ -195,7 +195,7 @@ static int amdgpu_virt_ras_get_cper_records(struct ras_core_context *ras_core, if (!req->buf_size || !req->buf_ptr || !req->cper_num) return RAS_CMD__ERROR_INVALID_INPUT_DATA; - trace = kzalloc_objs(*trace, MAX_RECORD_PER_BATCH, GFP_KERNEL); + trace = kzalloc_objs(*trace, MAX_RECORD_PER_BATCH); if (!trace) return RAS_CMD__ERROR_GENERIC; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_core.c b/drivers/gpu/drm/amd/ras/rascore/ras_core.c index e4a6f6cfd2d5..3f56f26abd6d 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_core.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_core.c @@ -263,11 +263,11 @@ struct ras_core_context *ras_core_create(struct ras_core_config *init_config) struct ras_core_context *ras_core; struct ras_core_config *config; - ras_core = kzalloc_obj(*ras_core, GFP_KERNEL); + ras_core = kzalloc_obj(*ras_core); if (!ras_core) return NULL; - config = kzalloc_obj(*config, GFP_KERNEL); + config = kzalloc_obj(*config); if (!config) { kfree(ras_core); return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c index 5d3e46c7740f..f10e856f3c8c 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c @@ -202,7 +202,7 @@ struct ras_log_batch_tag *ras_log_ring_create_batch_tag(struct ras_core_context struct ras_log_batch_tag *batch_tag; unsigned long flags = 0; - batch_tag = kzalloc_obj(*batch_tag, GFP_KERNEL); + batch_tag = kzalloc_obj(*batch_tag); if (!batch_tag) return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c index 7c69a7a8c5f6..2abe8553e479 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c @@ -199,7 +199,7 @@ int ras_umc_log_bad_bank_pending(struct ras_core_context *ras_core, struct ras_b struct ras_umc *ras_umc = &ras_core->ras_umc; struct ras_bank_ecc_node *ecc_node; - ecc_node = kzalloc_obj(*ecc_node, GFP_KERNEL); + ecc_node = kzalloc_obj(*ecc_node); if (!ecc_node) return -ENOMEM; @@ -246,7 +246,7 @@ int ras_umc_log_bad_bank(struct ras_core_context *ras_core, struct ras_bank_ecc if (ret) goto out; - err_rec = kzalloc_obj(*err_rec, GFP_KERNEL); + err_rec = kzalloc_obj(*err_rec); if (!err_rec) { ret = -ENOMEM; goto out; @@ -454,7 +454,7 @@ int ras_umc_load_bad_pages(struct ras_core_context *ras_core) ras_core->ras_eeprom.record_threshold_config == DISABLE_RETIRE_PAGE) return 0; - bps = kzalloc_objs(*bps, ras_num_recs, GFP_KERNEL); + bps = kzalloc_objs(*bps, ras_num_recs); if (!bps) return -ENOMEM; @@ -512,7 +512,7 @@ int ras_umc_handle_bad_pages(struct ras_core_context *ras_core, void *data) struct eeprom_umc_record *records; int count, ret; - records = kzalloc_objs(*records, MAX_ECC_NUM_PER_RETIREMENT, GFP_KERNEL); + records = kzalloc_objs(*records, MAX_ECC_NUM_PER_RETIREMENT); if (!records) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 7221dc4731ab..9c8b8da531a7 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -503,7 +503,7 @@ static void komeda_crtc_reset(struct drm_crtc *crtc) kfree(to_kcrtc_st(crtc->state)); crtc->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -514,7 +514,7 @@ komeda_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct komeda_crtc_state *old = to_kcrtc_st(crtc->state); struct komeda_crtc_state *new; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index ec34491f4f8b..6ee909f8d534 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -165,7 +165,7 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file, struct komeda_fb *kfb; int ret = 0, i; - kfb = kzalloc_obj(*kfb, GFP_KERNEL); + kfb = kzalloc_obj(*kfb); if (!kfb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 05342c6d5b6d..835c11fdd7ff 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -142,7 +142,7 @@ static void komeda_plane_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_plane_reset(plane, &state->base); } @@ -155,7 +155,7 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; @@ -247,7 +247,7 @@ static int komeda_plane_add(struct komeda_kms_dev *kms, u32 *formats, n_formats = 0; int err; - kplane = kzalloc_obj(*kplane, GFP_KERNEL); + kplane = kzalloc_obj(*kplane); if (!kplane) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c index 56703456fbfa..ee57e306bf7b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c @@ -50,7 +50,7 @@ static int komeda_layer_obj_add(struct komeda_kms_dev *kms, { struct komeda_layer_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -92,7 +92,7 @@ static int komeda_scaler_obj_add(struct komeda_kms_dev *kms, { struct komeda_scaler_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -135,7 +135,7 @@ static int komeda_compiz_obj_add(struct komeda_kms_dev *kms, { struct komeda_compiz_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -178,7 +178,7 @@ static int komeda_splitter_obj_add(struct komeda_kms_dev *kms, { struct komeda_splitter_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -221,7 +221,7 @@ static int komeda_merger_obj_add(struct komeda_kms_dev *kms, { struct komeda_merger_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -265,7 +265,7 @@ static int komeda_improc_obj_add(struct komeda_kms_dev *kms, { struct komeda_improc_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -308,7 +308,7 @@ static int komeda_timing_ctrlr_obj_add(struct komeda_kms_dev *kms, { struct komeda_compiz_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; @@ -352,7 +352,7 @@ static int komeda_pipeline_obj_add(struct komeda_kms_dev *kms, { struct komeda_pipeline_state *st; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index 5e290815c32b..41cc3e080dc9 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -149,7 +149,7 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, if (!kcrtc->master->wb_layer) return 0; - kwb_conn = kzalloc_obj(*kwb_conn, GFP_KERNEL); + kwb_conn = kzalloc_obj(*kwb_conn); if (!kwb_conn) return -ENOMEM; diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index c3a295f3c82d..18e6157b1047 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -447,7 +447,7 @@ static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc) return NULL; old_state = to_malidp_crtc_state(crtc->state); - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; @@ -478,7 +478,7 @@ static void malidp_crtc_destroy_state(struct drm_crtc *crtc, static void malidp_crtc_reset(struct drm_crtc *crtc) { - struct malidp_crtc_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct malidp_crtc_state *state = kzalloc_obj(*state); if (crtc->state) malidp_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c index 81442a011b09..0af7eaf9abc1 100644 --- a/drivers/gpu/drm/arm/malidp_mw.c +++ b/drivers/gpu/drm/arm/malidp_mw.c @@ -98,7 +98,7 @@ malidp_mw_connector_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - mw_state = kzalloc_obj(*mw_state, GFP_KERNEL); + mw_state = kzalloc_obj(*mw_state); if (!mw_state) return NULL; diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 1ba8fdf2dc4f..4b9876322501 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -81,7 +81,7 @@ static void malidp_plane_reset(struct drm_plane *plane) __drm_atomic_helper_plane_destroy_state(&state->base); kfree(state); plane->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_plane_reset(plane, &state->base); } @@ -94,7 +94,7 @@ drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane) if (!plane->state) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index ed57b60d0f12..d40bb9cf9ff1 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -921,7 +921,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, if (IS_ERR(base)) return PTR_ERR(base); - dcrtc = kzalloc_obj(*dcrtc, GFP_KERNEL); + dcrtc = kzalloc_obj(*dcrtc); if (!dcrtc) { DRM_ERROR("failed to allocate Armada crtc\n"); return -ENOMEM; @@ -970,7 +970,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, dcrtc->crtc.port = port; - primary = kzalloc_obj(*primary, GFP_KERNEL); + primary = kzalloc_obj(*primary); if (!primary) { ret = -ENOMEM; goto err_crtc; diff --git a/drivers/gpu/drm/armada/armada_fb.c b/drivers/gpu/drm/armada/armada_fb.c index 9355a7a20a50..b828bba419bf 100644 --- a/drivers/gpu/drm/armada/armada_fb.c +++ b/drivers/gpu/drm/armada/armada_fb.c @@ -57,7 +57,7 @@ struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - dfb = kzalloc_obj(*dfb, GFP_KERNEL); + dfb = kzalloc_obj(*dfb); if (!dfb) { DRM_ERROR("failed to allocate Armada fb object\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 56563816ca54..da7335cbe82d 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -137,7 +137,7 @@ armada_gem_linear_back(struct drm_device *dev, struct armada_gem_object *obj) void __iomem *ptr; int ret; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOSPC; @@ -200,7 +200,7 @@ armada_gem_alloc_private_object(struct drm_device *dev, size_t size) size = roundup_gem_size(size); - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; @@ -221,7 +221,7 @@ static struct armada_gem_object *armada_gem_alloc_object(struct drm_device *dev, size = roundup_gem_size(size); - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; @@ -393,7 +393,7 @@ armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sgt; int i; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) return NULL; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index c003a8dce805..361fdcece4b0 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -310,7 +310,7 @@ static void armada_overlay_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) { state->colorkey_yr = 0xfefefe00; state->colorkey_ug = 0x01010100; @@ -550,7 +550,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) if (ret) return ret; - overlay = kzalloc_obj(*overlay, GFP_KERNEL); + overlay = kzalloc_obj(*overlay); if (!overlay) return -ENOMEM; diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c index 88cac3e7e592..eba12bba1e09 100644 --- a/drivers/gpu/drm/armada/armada_plane.c +++ b/drivers/gpu/drm/armada/armada_plane.c @@ -262,7 +262,7 @@ void armada_plane_reset(struct drm_plane *plane) if (plane->state) __drm_atomic_helper_plane_destroy_state(plane->state); kfree(plane->state); - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (st) __drm_atomic_helper_plane_reset(plane, &st->base); } diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index 056b372803b1..19acd1eff4f3 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -500,7 +500,7 @@ ast_astdp_connector_atomic_duplicate_state(struct drm_connector *connector) if (drm_WARN_ON(dev, !connector->state)) return NULL; - new_astdp_state = kmalloc_obj(*new_astdp_state, GFP_KERNEL); + new_astdp_state = kmalloc_obj(*new_astdp_state); if (!new_astdp_state) return NULL; __drm_atomic_helper_connector_duplicate_state(connector, &new_astdp_state->base); diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index b017afe7e546..21abb6a6d8bc 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -876,7 +876,7 @@ static const struct drm_crtc_helper_funcs ast_crtc_helper_funcs = { static void ast_crtc_reset(struct drm_crtc *crtc) { - struct ast_crtc_state *ast_state = kzalloc_obj(*ast_state, GFP_KERNEL); + struct ast_crtc_state *ast_state = kzalloc_obj(*ast_state); if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); @@ -896,7 +896,7 @@ ast_crtc_atomic_duplicate_state(struct drm_crtc *crtc) if (drm_WARN_ON(dev, !crtc->state)) return NULL; - new_ast_state = kmalloc_obj(*new_ast_state, GFP_KERNEL); + new_ast_state = kmalloc_obj(*new_ast_state); if (!new_ast_state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &new_ast_state->base); diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 7204ef72c4d2..d8cf3d231920 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -540,7 +540,7 @@ static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -554,7 +554,7 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 1a1e76dc4727..bccd1564216e 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -1194,7 +1194,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) p->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) { if (atmel_hlcdc_plane_alloc_dscrs(p, state)) { kfree(state); diff --git a/drivers/gpu/drm/bridge/aux-bridge.c b/drivers/gpu/drm/bridge/aux-bridge.c index 50309a23dbea..1ed21a8713bf 100644 --- a/drivers/gpu/drm/bridge/aux-bridge.c +++ b/drivers/gpu/drm/bridge/aux-bridge.c @@ -47,7 +47,7 @@ int drm_aux_bridge_register(struct device *parent) struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c index 0f8a0fb50fbc..f02a38a2638a 100644 --- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c @@ -52,7 +52,7 @@ struct auxiliary_device *devm_drm_dp_hpd_bridge_alloc(struct device *parent, str struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index c094740523ea..0dd85e26248c 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -902,7 +902,7 @@ static u32 *cdns_dsi_bridge_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts); if (!input_fmts) return NULL; @@ -985,7 +985,7 @@ cdns_dsi_bridge_atomic_duplicate_state(struct drm_bridge *bridge) bridge_state = drm_priv_to_bridge_state(bridge->base.state); old_dsi_state = to_cdns_dsi_bridge_state(bridge_state); - dsi_state = kzalloc_obj(*dsi_state, GFP_KERNEL); + dsi_state = kzalloc_obj(*dsi_state); if (!dsi_state) return NULL; @@ -1013,7 +1013,7 @@ cdns_dsi_bridge_atomic_reset(struct drm_bridge *bridge) { struct cdns_dsi_bridge_state *dsi_state; - dsi_state = kzalloc_obj(*dsi_state, GFP_KERNEL); + dsi_state = kzalloc_obj(*dsi_state); if (!dsi_state) return NULL; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 9d41e824e757..9392c226ff5b 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2055,7 +2055,7 @@ cdns_mhdp_bridge_atomic_duplicate_state(struct drm_bridge *bridge) { struct cdns_mhdp_bridge_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; @@ -2085,7 +2085,7 @@ cdns_mhdp_bridge_atomic_reset(struct drm_bridge *bridge) { struct cdns_mhdp_bridge_state *cdns_mhdp_state; - cdns_mhdp_state = kzalloc_obj(*cdns_mhdp_state, GFP_KERNEL); + cdns_mhdp_state = kzalloc_obj(*cdns_mhdp_state); if (!cdns_mhdp_state) return NULL; @@ -2105,7 +2105,7 @@ static u32 *cdns_mhdp_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index f5ffef625a9b..16c0631adeb1 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -116,7 +116,7 @@ static u32 *display_connector_get_output_bus_fmts(struct drm_bridge *bridge, u32 *out_bus_fmts; *num_output_fmts = 1; - out_bus_fmts = kmalloc_obj(*out_bus_fmts, GFP_KERNEL); + out_bus_fmts = kmalloc_obj(*out_bus_fmts); if (!out_bus_fmts) return NULL; @@ -158,7 +158,7 @@ static u32 *display_connector_get_input_bus_fmts(struct drm_bridge *bridge, u32 *in_bus_fmts; *num_input_fmts = 1; - in_bus_fmts = kmalloc_obj(*in_bus_fmts, GFP_KERNEL); + in_bus_fmts = kmalloc_obj(*in_bus_fmts); if (!in_bus_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c index 157cda9d2fb1..bdecee56fa49 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c @@ -319,7 +319,7 @@ imx8qm_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c index eb06266f15fb..fbd7a37c0812 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c @@ -333,7 +333,7 @@ imx8qxp_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index a7dd49e2d3bb..5582456a4490 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -216,7 +216,7 @@ imx8qxp_pc_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index 85976abdda63..b52b7c7ce183 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -206,7 +206,7 @@ imx8qxp_pixel_link_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c index 7c86760171dc..441fd32dc91c 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -175,7 +175,7 @@ imx8qxp_pxl2dpi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c index e672a37950e0..8f312f9edf97 100644 --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c @@ -609,7 +609,7 @@ static u32 *imx93_dsi_get_input_bus_fmts(void *priv_data, return NULL; } - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; input_fmts[0] = input_fmt; diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c index 85fbf57001ec..e77681047bb2 100644 --- a/drivers/gpu/drm/bridge/ite-it6263.c +++ b/drivers/gpu/drm/bridge/ite-it6263.c @@ -735,7 +735,7 @@ it6263_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, if (!it6263_is_input_bus_fmt_valid(it->lvds_data_mapping)) return NULL; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 810c6984cf6b..930aaa659c97 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1741,7 +1741,7 @@ samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, { u32 *input_fmts; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 10fcec9d653b..d3f238b1f2a9 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -384,7 +384,7 @@ static void sii8620_mt_msc_cmd_send(struct sii8620 *ctx, static struct sii8620_mt_msg *sii8620_mt_msg_new(struct sii8620 *ctx) { - struct sii8620_mt_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); + struct sii8620_mt_msg *msg = kzalloc_obj(*msg); if (!msg) ctx->error = -ENOMEM; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c index 04e2e19c9e25..4ab6922dd79c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c @@ -1809,7 +1809,7 @@ static struct drm_bridge_state *dw_dp_bridge_atomic_duplicate_state(struct drm_b { struct dw_dp_bridge_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 8d5d8a196479..ca4dea226f4b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -561,7 +561,7 @@ dw_mipi_dsi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, output_fmt, num_input_fmts); /* Fall back to MEDIA_BUS_FMT_FIXED as the only input format. */ - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; input_fmts[0] = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c index 9f06d00569ec..e6eaf9fd0251 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c @@ -711,7 +711,7 @@ dw_mipi_dsi2_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, output_fmt, num_input_fmts); /* Fall back to MEDIA_BUS_FMT_FIXED as the only input format. */ - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; input_fmts[0] = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index cae2ea075670..3b6b0e92cf89 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -213,7 +213,7 @@ static u32 *tfp410_get_input_bus_fmts(struct drm_bridge *bridge, *num_input_fmts = 0; - input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c index f708c0d2bf6a..91d196a397cf 100644 --- a/drivers/gpu/drm/clients/drm_fbdev_client.c +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c @@ -154,7 +154,7 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info drm_WARN(dev, !dev->registered, "Device has not been registered.\n"); drm_WARN(dev, dev->fb_helper, "fb_helper is already set!\n"); - fb_helper = kzalloc_obj(*fb_helper, GFP_KERNEL); + fb_helper = kzalloc_obj(*fb_helper); if (!fb_helper) return -ENOMEM; drm_fb_helper_prepare(dev, fb_helper, color_mode, NULL); diff --git a/drivers/gpu/drm/clients/drm_log.c b/drivers/gpu/drm/clients/drm_log.c index 1055f05dbfa2..8d21b785bead 100644 --- a/drivers/gpu/drm/clients/drm_log.c +++ b/drivers/gpu/drm/clients/drm_log.c @@ -248,7 +248,7 @@ static void drm_log_init_client(struct drm_log *dlog) if (!max_modeset) return; - dlog->scanout = kzalloc_objs(*dlog->scanout, max_modeset, GFP_KERNEL); + dlog->scanout = kzalloc_objs(*dlog->scanout, max_modeset); if (!dlog->scanout) return; @@ -419,7 +419,7 @@ void drm_log_register(struct drm_device *dev) { struct drm_log *new; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) goto err_warn; diff --git a/drivers/gpu/drm/display/drm_dp_aux_bus.c b/drivers/gpu/drm/display/drm_dp_aux_bus.c index a36feef1cd6a..6e5e3e542290 100644 --- a/drivers/gpu/drm/display/drm_dp_aux_bus.c +++ b/drivers/gpu/drm/display/drm_dp_aux_bus.c @@ -280,7 +280,7 @@ int of_dp_aux_populate_bus(struct drm_dp_aux *aux, goto err_did_get_np; } - aux_ep_with_data = kzalloc_obj(*aux_ep_with_data, GFP_KERNEL); + aux_ep_with_data = kzalloc_obj(*aux_ep_with_data); if (!aux_ep_with_data) { ret = -ENOMEM; goto err_did_set_populated; diff --git a/drivers/gpu/drm/display/drm_dp_aux_dev.c b/drivers/gpu/drm/display/drm_dp_aux_dev.c index df02dbca7338..f0632e43b69e 100644 --- a/drivers/gpu/drm/display/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/display/drm_dp_aux_dev.c @@ -75,7 +75,7 @@ static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) struct drm_dp_aux_dev *aux_dev; int index; - aux_dev = kzalloc_obj(*aux_dev, GFP_KERNEL); + aux_dev = kzalloc_obj(*aux_dev); if (!aux_dev) return ERR_PTR(-ENOMEM); aux_dev->aux = aux; diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 954ecaa6fd6b..953228cc46cb 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -1333,7 +1333,7 @@ static struct drm_dp_mst_branch *drm_dp_add_mst_branch_device(u8 lct, u8 *rad) { struct drm_dp_mst_branch *mstb; - mstb = kzalloc_obj(*mstb, GFP_KERNEL); + mstb = kzalloc_obj(*mstb); if (!mstb) return NULL; @@ -2317,7 +2317,7 @@ drm_dp_mst_add_port(struct drm_device *dev, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb, u8 port_number) { - struct drm_dp_mst_port *port = kzalloc_obj(*port, GFP_KERNEL); + struct drm_dp_mst_port *port = kzalloc_obj(*port); if (!port) return NULL; @@ -2923,7 +2923,7 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, int i, ret, port_mask = 0; bool changed = false; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) return -ENOMEM; @@ -3000,7 +3000,7 @@ drm_dp_send_clear_payload_id_table(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg; int ret; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) return; @@ -3025,7 +3025,7 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg; int ret; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) return -ENOMEM; @@ -3138,7 +3138,7 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, return -EINVAL; } - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3185,7 +3185,7 @@ int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr, if (!port) return -EINVAL; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { drm_dp_mst_topology_put_port(port); return -ENOMEM; @@ -3219,7 +3219,7 @@ int drm_dp_send_query_stream_enc_status(struct drm_dp_mst_topology_mgr *mgr, u8 nonce[7]; int ret; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) return -ENOMEM; @@ -3470,7 +3470,7 @@ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, if (!mstb) return -EINVAL; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3521,7 +3521,7 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, if (!mstb) return -EINVAL; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { ret = -ENOMEM; goto fail_put; @@ -3562,7 +3562,7 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, { struct drm_dp_sideband_msg_tx *txmsg; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) return -ENOMEM; @@ -4135,7 +4135,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) if (!mgr->up_req_recv.have_eomt) return 0; - up_req = kzalloc_obj(*up_req, GFP_KERNEL); + up_req = kzalloc_obj(*up_req); if (!up_req) { ret = -ENOMEM; goto out_clear_reply; @@ -4479,7 +4479,7 @@ int drm_dp_atomic_find_time_slots(struct drm_atomic_state *state, /* Add the new allocation to the state, note the VCPI isn't assigned until the end */ if (!payload) { - payload = kzalloc_obj(*payload, GFP_KERNEL); + payload = kzalloc_obj(*payload); if (!payload) return -ENOMEM; @@ -5744,7 +5744,7 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, mgr->max_payloads = max_payloads; mgr->conn_base_id = conn_base_id; - mst_state = kzalloc_obj(*mst_state, GFP_KERNEL); + mst_state = kzalloc_obj(*mst_state); if (mst_state == NULL) return -ENOMEM; @@ -5844,7 +5844,7 @@ static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb, msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr; msg.u.i2c_read.num_bytes_read = msgs[num - 1].len; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { ret = -ENOMEM; goto out; @@ -5884,7 +5884,7 @@ static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb, struct drm_dp_sideband_msg_tx *txmsg = NULL; int ret; - txmsg = kzalloc_obj(*txmsg, GFP_KERNEL); + txmsg = kzalloc_obj(*txmsg); if (!txmsg) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/display/drm_dp_tunnel.c b/drivers/gpu/drm/display/drm_dp_tunnel.c index 005ee68e6cd4..7aee57416902 100644 --- a/drivers/gpu/drm/display/drm_dp_tunnel.c +++ b/drivers/gpu/drm/display/drm_dp_tunnel.c @@ -476,7 +476,7 @@ create_tunnel(struct drm_dp_tunnel_mgr *mgr, u8 drv_group_id = tunnel_reg_drv_group_id(regs); struct drm_dp_tunnel *tunnel; - tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel); if (!tunnel) return NULL; @@ -1387,7 +1387,7 @@ add_tunnel_state(struct drm_dp_tunnel_group_state *group_state, "Adding state for tunnel %p to group state %p\n", tunnel, group_state); - tunnel_state = kzalloc_obj(*tunnel_state, GFP_KERNEL); + tunnel_state = kzalloc_obj(*tunnel_state); if (!tunnel_state) return NULL; @@ -1458,7 +1458,7 @@ tunnel_group_duplicate_state(struct drm_private_obj *obj) struct drm_dp_tunnel_group_state *group_state; struct drm_dp_tunnel_state *tunnel_state; - group_state = kzalloc_obj(*group_state, GFP_KERNEL); + group_state = kzalloc_obj(*group_state); if (!group_state) return NULL; @@ -1583,7 +1583,7 @@ static bool init_group(struct drm_dp_tunnel_mgr *mgr, struct drm_dp_tunnel_group { struct drm_dp_tunnel_group_state *group_state; - group_state = kzalloc_obj(*group_state, GFP_KERNEL); + group_state = kzalloc_obj(*group_state); if (!group_state) return false; @@ -1644,7 +1644,7 @@ static int resize_bw_array(struct drm_dp_tunnel_state *tunnel_state, if (old_mask == new_mask) return 0; - new_bws = kzalloc_objs(*new_bws, hweight32(new_mask), GFP_KERNEL); + new_bws = kzalloc_objs(*new_bws, hweight32(new_mask)); if (!new_bws) return -ENOMEM; @@ -1906,14 +1906,14 @@ drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count) struct drm_dp_tunnel_mgr *mgr; int i; - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (!mgr) return ERR_PTR(-ENOMEM); mgr->dev = dev; init_waitqueue_head(&mgr->bw_req_queue); - mgr->groups = kzalloc_objs(*mgr->groups, max_group_count, GFP_KERNEL); + mgr->groups = kzalloc_objs(*mgr->groups, max_group_count); if (!mgr->groups) { kfree(mgr); diff --git a/drivers/gpu/drm/display/drm_hdmi_cec_helper.c b/drivers/gpu/drm/display/drm_hdmi_cec_helper.c index 7308ed792089..ef6dbaa59dee 100644 --- a/drivers/gpu/drm/display/drm_hdmi_cec_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_cec_helper.c @@ -97,7 +97,7 @@ int drmm_connector_hdmi_cec_register(struct drm_connector *connector, if (!funcs->init || !funcs->enable || !funcs->log_addr || !funcs->transmit) return -EINVAL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index a666fca65d6c..565c47f976b1 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -177,7 +177,7 @@ drm_atomic_state_alloc(struct drm_device *dev) if (!config->funcs->atomic_state_alloc) { struct drm_atomic_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; if (drm_atomic_state_init(dev, state) < 0) { diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 8626f903fdd5..3bdf32234bb3 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2525,7 +2525,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, funcs = state->dev->mode_config.helper_private; for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { - commit = kzalloc_obj(*commit, GFP_KERNEL); + commit = kzalloc_obj(*commit); if (!commit) return -ENOMEM; @@ -2554,7 +2554,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, } if (!new_crtc_state->event) { - commit->event = kzalloc_obj(*commit->event, GFP_KERNEL); + commit->event = kzalloc_obj(*commit->event); if (!commit->event) return -ENOMEM; @@ -4080,7 +4080,7 @@ drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge, { u32 *input_fmts; - input_fmts = kzalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kzalloc_obj(*input_fmts); if (!input_fmts) { *num_input_fmts = 0; return NULL; diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index 67812085dca7..2a101fd5a714 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -114,7 +114,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_reset); void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) { struct drm_crtc_state *crtc_state = - kzalloc_obj(*crtc->state, GFP_KERNEL); + kzalloc_obj(*crtc->state); if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); @@ -175,7 +175,7 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (state) __drm_atomic_helper_crtc_duplicate_state(crtc, state); @@ -333,7 +333,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane) __drm_atomic_helper_plane_destroy_state(plane->state); kfree(plane->state); - plane->state = kzalloc_obj(*plane->state, GFP_KERNEL); + plane->state = kzalloc_obj(*plane->state); if (plane->state) __drm_atomic_helper_plane_reset(plane, plane->state); } @@ -377,7 +377,7 @@ drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (state) __drm_atomic_helper_plane_duplicate_state(plane, state); @@ -666,7 +666,7 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (state) __drm_atomic_helper_connector_duplicate_state(connector, state); @@ -763,7 +763,7 @@ drm_atomic_helper_bridge_duplicate_state(struct drm_bridge *bridge) if (WARN_ON(!bridge->base.state)) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (new) __drm_atomic_helper_bridge_duplicate_state(bridge, new); @@ -821,7 +821,7 @@ drm_atomic_helper_bridge_reset(struct drm_bridge *bridge) { struct drm_bridge_state *bridge_state; - bridge_state = kzalloc_obj(*bridge_state, GFP_KERNEL); + bridge_state = kzalloc_obj(*bridge_state); if (!bridge_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index ac2175f5e5b0..87de41fb4459 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1088,7 +1088,7 @@ static struct drm_pending_vblank_event *create_vblank_event( { struct drm_pending_vblank_event *e = NULL; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return NULL; diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index d9d984ae62c4..e17bb0f1f9e0 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -132,7 +132,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) { struct drm_master *master; - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return NULL; diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 9a81992b04e9..3b1f5f72885e 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -459,7 +459,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, drm_dbg_atomic(dev, "[CRTC:%d:%s] calculating normalized zpos values\n", crtc->base.id, crtc->name); - states = kmalloc_objs(*states, total_planes, GFP_KERNEL); + states = kmalloc_objs(*states, total_planes); if (!states) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 5518760a88c1..d6f11c68bb6a 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1189,7 +1189,7 @@ drm_atomic_bridge_chain_select_bus_fmts(struct drm_bridge *bridge, return -ENOMEM; } else { num_out_bus_fmts = 1; - out_bus_fmts = kmalloc_obj(*out_bus_fmts, GFP_KERNEL); + out_bus_fmts = kmalloc_obj(*out_bus_fmts); if (!out_bus_fmts) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 0e6f4b73827d..6236ec46d62a 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -225,7 +225,7 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, struct drm_framebuffer *fb; int ret; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index fce35c27b361..8e41cb8d0011 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -567,7 +567,7 @@ static int drm_client_pick_crtcs(struct drm_client_dev *client, if (modes[n] == NULL) return best_score; - crtcs = kzalloc_objs(*crtcs, connector_count, GFP_KERNEL); + crtcs = kzalloc_objs(*crtcs, connector_count); if (!crtcs) return best_score; @@ -643,7 +643,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, if (drm_WARN_ON(dev, count <= 0)) return false; - save_enabled = kzalloc_objs(bool, count, GFP_KERNEL); + save_enabled = kzalloc_objs(bool, count); if (!save_enabled) return false; @@ -855,10 +855,10 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, if (!connector_count) return 0; - crtcs = kzalloc_objs(*crtcs, connector_count, GFP_KERNEL); - modes = kzalloc_objs(*modes, connector_count, GFP_KERNEL); - offsets = kzalloc_objs(*offsets, connector_count, GFP_KERNEL); - enabled = kzalloc_objs(bool, connector_count, GFP_KERNEL); + crtcs = kzalloc_objs(*crtcs, connector_count); + modes = kzalloc_objs(*modes, connector_count); + offsets = kzalloc_objs(*offsets, connector_count); + enabled = kzalloc_objs(bool, connector_count); if (!crtcs || !modes || !enabled || !offsets) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c index 2f3cd856df03..398cc81ae588 100644 --- a/drivers/gpu/drm/drm_colorop.c +++ b/drivers/gpu/drm/drm_colorop.c @@ -453,7 +453,7 @@ drm_atomic_helper_colorop_duplicate_state(struct drm_colorop *colorop) if (WARN_ON(!colorop->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (state) __drm_atomic_helper_colorop_duplicate_state(colorop, state); @@ -514,7 +514,7 @@ static void __drm_colorop_reset(struct drm_colorop *colorop, void drm_colorop_reset(struct drm_colorop *colorop) { kfree(colorop->state); - colorop->state = kzalloc_obj(*colorop->state, GFP_KERNEL); + colorop->state = kzalloc_obj(*colorop->state); if (colorop->state) __drm_colorop_reset(colorop, colorop->state); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 7528c848ccfb..2a3a1fa0594b 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -3605,7 +3605,7 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, struct drm_tile_group *tg; int ret; - tg = kzalloc_obj(*tg, GFP_KERNEL); + tg = kzalloc_obj(*tg); if (!tg) return NULL; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f24b5593b613..6d0bf06b4d31 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -185,7 +185,7 @@ struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc) { struct dma_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c index 928cccac527e..1b6850aa1688 100644 --- a/drivers/gpu/drm/drm_damage_helper.c +++ b/drivers/gpu/drm/drm_damage_helper.c @@ -140,7 +140,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, num_clips /= 2; } - rects = kzalloc_objs(*rects, num_clips, GFP_KERNEL); + rects = kzalloc_objs(*rects, num_clips); if (!rects) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index 835deddcc538..371edb0b9b17 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -224,7 +224,7 @@ static int crtc_crc_open(struct inode *inode, struct file *filep) if (WARN_ON(values_cnt == 0)) return -EINVAL; - entries = kzalloc_objs(*entries, DRM_CRC_ENTRIES_NR, GFP_KERNEL); + entries = kzalloc_objs(*entries, DRM_CRC_ENTRIES_NR); if (!entries) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index d248d2b295a0..ff432ac6b569 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2503,7 +2503,7 @@ static const struct drm_edid *_drm_edid_alloc(const void *edid, size_t size) if (!edid || !size || size < EDID_LENGTH) return NULL; - drm_edid = kzalloc_obj(*drm_edid, GFP_KERNEL); + drm_edid = kzalloc_obj(*drm_edid); if (drm_edid) { drm_edid->edid = edid; drm_edid->size = size; @@ -5764,7 +5764,7 @@ static int _drm_edid_to_sad(const struct drm_edid *drm_edid, int i; count = cea_db_payload_len(db) / 3; /* SAD is 3B */ - sads = kzalloc_objs(*sads, count, GFP_KERNEL); + sads = kzalloc_objs(*sads, count); *psads = sads; if (!sads) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 608763984794..ec820686b302 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -136,7 +136,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) struct drm_file *file; int ret; - file = kzalloc_obj(*file, GFP_KERNEL); + file = kzalloc_obj(*file); if (!file) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 45963ff2192c..147ac19f851b 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -747,7 +747,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, ret = -EINVAL; goto out_err1; } - clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips); if (!clips) { ret = -ENOMEM; goto out_err1; diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 4eb96aa589a1..891c3bff5ae0 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -684,7 +684,7 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj) npages = obj->size >> PAGE_SHIFT; - pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); + pages = kvmalloc_objs(struct page *, npages); if (pages == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c index fa43e586eb49..b2e3778fb7a7 100644 --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -338,7 +338,7 @@ void drm_gem_reset_shadow_plane(struct drm_plane *plane) plane->state = NULL; /* must be set to NULL here */ } - shadow_plane_state = kzalloc_obj(*shadow_plane_state, GFP_KERNEL); + shadow_plane_state = kzalloc_obj(*shadow_plane_state); __drm_gem_reset_shadow_plane(plane, shadow_plane_state); } EXPORT_SYMBOL(drm_gem_reset_shadow_plane); diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index ffcdf733984f..ecb9746f4da8 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -82,7 +82,7 @@ __drm_gem_dma_create(struct drm_device *drm, size_t size, bool private) return ERR_CAST(gem_obj); dma_obj = to_drm_gem_dma_obj(gem_obj); } else { - dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj); if (!dma_obj) return ERR_PTR(-ENOMEM); gem_obj = &dma_obj->base; @@ -428,7 +428,7 @@ struct sg_table *drm_gem_dma_get_sg_table(struct drm_gem_dma_object *dma_obj) struct sg_table *sgt; int ret; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index e8b81ea55878..9166c353f131 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -238,7 +238,7 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file, struct drm_framebuffer *fb; int ret; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 4acc632e73b1..7b5a49935ae4 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -127,7 +127,7 @@ __drm_gem_shmem_create(struct drm_device *dev, size_t size, bool private) return ERR_CAST(obj); shmem = to_drm_gem_shmem_obj(obj); } else { - shmem = kzalloc_obj(*shmem, GFP_KERNEL); + shmem = kzalloc_obj(*shmem); if (!shmem) return ERR_PTR(-ENOMEM); obj = &shmem->base; diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 27ceae40cfe3..d7fcced75e79 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -197,7 +197,7 @@ struct drm_gem_vram_object *drm_gem_vram_create(struct drm_device *dev, return ERR_CAST(gem); gbo = drm_gem_vram_of_gem(gem); } else { - gbo = kzalloc_obj(*gbo, GFP_KERNEL); + gbo = kzalloc_obj(*gbo); if (!gbo) return ERR_PTR(-ENOMEM); gem = &gbo->bo.base; @@ -721,7 +721,7 @@ static struct ttm_tt *bo_driver_ttm_tt_create(struct ttm_buffer_object *bo, struct ttm_tt *tt; int ret; - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); if (!tt) return NULL; @@ -890,7 +890,7 @@ static struct drm_vram_mm *drm_vram_helper_alloc_mm(struct drm_device *dev, uint if (WARN_ON(dev->vram_mm)) return dev->vram_mm; - dev->vram_mm = kzalloc_obj(*dev->vram_mm, GFP_KERNEL); + dev->vram_mm = kzalloc_obj(*dev->vram_mm); if (!dev->vram_mm) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index 7570a0e05450..24180bfdf5a2 100644 --- a/drivers/gpu/drm/drm_gpusvm.c +++ b/drivers/gpu/drm/drm_gpusvm.c @@ -522,7 +522,7 @@ drm_gpusvm_notifier_alloc(struct drm_gpusvm *gpusvm, unsigned long fault_addr) if (gpusvm->ops->notifier_alloc) notifier = gpusvm->ops->notifier_alloc(); else - notifier = kzalloc_obj(*notifier, GFP_KERNEL); + notifier = kzalloc_obj(*notifier); if (!notifier) return ERR_PTR(-ENOMEM); @@ -629,7 +629,7 @@ drm_gpusvm_range_alloc(struct drm_gpusvm *gpusvm, if (gpusvm->ops->range_alloc) range = gpusvm->ops->range_alloc(gpusvm); else - range = kzalloc_obj(*range, GFP_KERNEL); + range = kzalloc_obj(*range); if (!range) return ERR_PTR(-ENOMEM); @@ -1471,7 +1471,7 @@ map_pages: /* Unlock and restart mapping to allocate memory. */ drm_gpusvm_notifier_unlock(gpusvm); svm_pages->dma_addr = - kvmalloc_objs(*svm_pages->dma_addr, npages, GFP_KERNEL); + kvmalloc_objs(*svm_pages->dma_addr, npages); if (!svm_pages->dma_addr) { err = -ENOMEM; goto err_free; diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 9d2f4ae8cc9d..44acfe4120d2 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1060,7 +1060,7 @@ drm_gpuvm_resv_object_alloc(struct drm_device *drm) { struct drm_gem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; @@ -1581,7 +1581,7 @@ drm_gpuvm_bo_create(struct drm_gpuvm *gpuvm, if (ops && ops->vm_bo_alloc) vm_bo = ops->vm_bo_alloc(); else - vm_bo = kzalloc_obj(*vm_bo, GFP_KERNEL); + vm_bo = kzalloc_obj(*vm_bo); if (unlikely(!vm_bo)) return NULL; @@ -2852,7 +2852,7 @@ gpuva_op_alloc(struct drm_gpuvm *gpuvm) if (fn && fn->op_alloc) op = fn->op_alloc(); else - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (unlikely(!op)) return NULL; @@ -2946,7 +2946,7 @@ __drm_gpuvm_sm_map_ops_create(struct drm_gpuvm *gpuvm, } args; int ret; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (unlikely(!ops)) return ERR_PTR(-ENOMEM); @@ -3080,7 +3080,7 @@ drm_gpuvm_sm_unmap_ops_create(struct drm_gpuvm *gpuvm, } args; int ret; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (unlikely(!ops)) return ERR_PTR(-ENOMEM); @@ -3130,7 +3130,7 @@ drm_gpuvm_prefetch_ops_create(struct drm_gpuvm *gpuvm, u64 end = addr + range; int ret; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (!ops) return ERR_PTR(-ENOMEM); @@ -3184,7 +3184,7 @@ drm_gpuvm_bo_unmap_ops_create(struct drm_gpuvm_bo *vm_bo) drm_gem_gpuva_assert_lock_held(vm_bo->vm, vm_bo->obj); - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (!ops) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 55542a360adc..0390e14d3157 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -134,7 +134,7 @@ static struct mipi_dsi_device *mipi_dsi_device_alloc(struct mipi_dsi_host *host) { struct mipi_dsi_device *dsi; - dsi = kzalloc_obj(*dsi, GFP_KERNEL); + dsi = kzalloc_obj(*dsi); if (!dsi) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index e1293ef88581..3f8e025fd6d9 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -75,7 +75,7 @@ struct drm_display_mode *drm_mode_create(struct drm_device *dev) { struct drm_display_mode *nmode; - nmode = kzalloc_obj(struct drm_display_mode, GFP_KERNEL); + nmode = kzalloc_obj(struct drm_display_mode); if (!nmode) return NULL; diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c index 4e9b5f5f2539..bdc79140875c 100644 --- a/drivers/gpu/drm/drm_pagemap.c +++ b/drivers/gpu/drm/drm_pagemap.c @@ -94,7 +94,7 @@ drm_pagemap_zdd_alloc(struct drm_pagemap *dpagemap) { struct drm_pagemap_zdd *zdd; - zdd = kmalloc_obj(*zdd, GFP_KERNEL); + zdd = kmalloc_obj(*zdd); if (!zdd) return NULL; @@ -861,7 +861,7 @@ drm_pagemap_dev_hold(struct drm_pagemap *dpagemap) struct drm_pagemap_dev_hold *dev_hold; struct drm_device *drm = dpagemap->drm; - dev_hold = kzalloc_obj(*dev_hold, GFP_KERNEL); + dev_hold = kzalloc_obj(*dev_hold); if (!dev_hold) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_pagemap_util.c b/drivers/gpu/drm/drm_pagemap_util.c index c53031308308..14ddb948a32e 100644 --- a/drivers/gpu/drm/drm_pagemap_util.c +++ b/drivers/gpu/drm/drm_pagemap_util.c @@ -94,7 +94,7 @@ out: */ struct drm_pagemap_cache *drm_pagemap_cache_create_devm(struct drm_pagemap_shrinker *shrinker) { - struct drm_pagemap_cache *cache = kzalloc_obj(*cache, GFP_KERNEL); + struct drm_pagemap_cache *cache = kzalloc_obj(*cache); int err; if (!cache) @@ -424,7 +424,7 @@ struct drm_pagemap_shrinker *drm_pagemap_shrinker_create_devm(struct drm_device struct shrinker *shrink; int err; - shrinker = kzalloc_obj(*shrinker, GFP_KERNEL); + shrinker = kzalloc_obj(*shrinker); if (!shrinker) return ERR_PTR(-ENOMEM); @@ -548,7 +548,7 @@ int drm_pagemap_acquire_owner(struct drm_pagemap_peer *peer, } if (!interconnect) { - owner = kmalloc_obj(*owner, GFP_KERNEL); + owner = kmalloc_obj(*owner); if (!owner) { mutex_unlock(&owner_list->lock); return -ENOMEM; diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 75ec5ca579b0..3e8c36484b06 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1514,7 +1514,7 @@ retry: } if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index ad09be486ea0..51fdb06d3e9f 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -100,7 +100,7 @@ int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, struct drm_prime_member *member; struct rb_node **p, *rb; - member = kmalloc_obj(*member, GFP_KERNEL); + member = kmalloc_obj(*member); if (!member) return -ENOMEM; @@ -780,8 +780,8 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) return 0; } - priv = kzalloc_obj(*priv, GFP_KERNEL); - fil = kzalloc_obj(*fil, GFP_KERNEL); + priv = kzalloc_obj(*priv); + fil = kzalloc_obj(*fil); if (!priv || !fil) { ret = -ENOMEM; goto out; @@ -854,7 +854,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev, size_t max_segment = 0; int err; - sg = kmalloc_obj(struct sg_table, GFP_KERNEL); + sg = kmalloc_obj(struct sg_table); if (!sg) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_privacy_screen.c b/drivers/gpu/drm/drm_privacy_screen.c index d9d0c5a38ffd..a2a6e8368131 100644 --- a/drivers/gpu/drm/drm_privacy_screen.c +++ b/drivers/gpu/drm/drm_privacy_screen.c @@ -395,7 +395,7 @@ struct drm_privacy_screen *drm_privacy_screen_register( struct drm_privacy_screen *priv; int ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index fb8a23832c37..f38f2c5437e6 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -107,7 +107,7 @@ struct drm_property *drm_property_create(struct drm_device *dev, if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN)) return NULL; - property = kzalloc_obj(struct drm_property, GFP_KERNEL); + property = kzalloc_obj(struct drm_property); if (!property) return NULL; @@ -417,7 +417,7 @@ int drm_property_add_enum(struct drm_property *property, if (WARN_ON(index >= property->num_values)) return -EINVAL; - prop_enum = kzalloc_obj(struct drm_property_enum, GFP_KERNEL); + prop_enum = kzalloc_obj(struct drm_property_enum); if (!prop_enum) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c index 294343259f8a..74907f33841c 100644 --- a/drivers/gpu/drm/drm_self_refresh_helper.c +++ b/drivers/gpu/drm/drm_self_refresh_helper.c @@ -238,7 +238,7 @@ int drm_self_refresh_helper_init(struct drm_crtc *crtc) if (WARN_ON(sr_data)) return -EINVAL; - sr_data = kzalloc_obj(*sr_data, GFP_KERNEL); + sr_data = kzalloc_obj(*sr_data); if (!sr_data) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index bed005abf08e..250734dee928 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -557,7 +557,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, int ret; struct drm_syncobj *syncobj; - syncobj = kzalloc_obj(struct drm_syncobj, GFP_KERNEL); + syncobj = kzalloc_obj(struct drm_syncobj); if (!syncobj) return -ENOMEM; @@ -1062,7 +1062,7 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, goto err_free_points; } - entries = kzalloc_objs(*entries, count, GFP_KERNEL); + entries = kzalloc_objs(*entries, count); if (!entries) { timeout = -ENOMEM; goto err_free_points; @@ -1279,7 +1279,7 @@ static int drm_syncobj_array_find(struct drm_file *file_private, goto err_free_handles; } - syncobjs = kmalloc_objs(*syncobjs, count_handles, GFP_KERNEL); + syncobjs = kmalloc_objs(*syncobjs, count_handles); if (syncobjs == NULL) { ret = -ENOMEM; goto err_free_handles; @@ -1485,7 +1485,7 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data, goto err_fdget; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { ret = -ENOMEM; goto err_kzalloc; diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 0dccd5362138..ef4e923a8728 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -349,7 +349,7 @@ int drm_sysfs_connector_add(struct drm_connector *connector) if (connector->kdev) return 0; - kdev = kzalloc_obj(*kdev, GFP_KERNEL); + kdev = kzalloc_obj(*kdev); if (!kdev) return -ENOMEM; @@ -554,7 +554,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) struct device *kdev; int r; - kdev = kzalloc_obj(*kdev, GFP_KERNEL); + kdev = kzalloc_obj(*kdev); if (!kdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 4b196e48c8fe..f78bf37f1e0a 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -1615,7 +1615,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, u64 seq; int ret; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (e == NULL) { ret = -ENOMEM; goto err_put; @@ -2094,7 +2094,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data, vblank = drm_crtc_vblank_crtc(crtc); - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (e == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c index 7978b6276a6a..1b8daec1013e 100644 --- a/drivers/gpu/drm/drm_vma_manager.c +++ b/drivers/gpu/drm/drm_vma_manager.c @@ -253,7 +253,7 @@ static int vma_node_allow(struct drm_vma_offset_node *node, * unlikely that an open-file is added twice to a single node so we * don't optimize for this case. OOM is checked below only if the entry * is actually used. */ - new = kmalloc_obj(*entry, GFP_KERNEL); + new = kmalloc_obj(*entry); write_lock(&node->vm_lock); diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c index 7b1dbc0df135..a4805d47ea4d 100644 --- a/drivers/gpu/drm/drm_writeback.c +++ b/drivers/gpu/drm/drm_writeback.c @@ -581,7 +581,7 @@ drm_writeback_get_out_fence(struct drm_writeback_connector *wb_connector) DRM_MODE_CONNECTOR_WRITEBACK)) return NULL; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c index 57a82526a54f..854292066ce8 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c @@ -33,7 +33,7 @@ etnaviv_cmdbuf_suballoc_new(struct device *dev) struct etnaviv_cmdbuf_suballoc *suballoc; int ret; - suballoc = kzalloc_obj(*suballoc, GFP_KERNEL); + suballoc = kzalloc_obj(*suballoc); if (!suballoc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 06e76d6d2e47..08aca9035fc1 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -66,7 +66,7 @@ static int etnaviv_open(struct drm_device *dev, struct drm_file *file) struct etnaviv_file_private *ctx; int ret, i; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -531,7 +531,7 @@ static int etnaviv_bind(struct device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { dev_err(dev, "failed to allocate private data\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 3e330f30eaa2..b0436a1e103f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -288,7 +288,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get( */ mapping = etnaviv_gem_get_vram_mapping(etnaviv_obj, NULL); if (!mapping) { - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) { ret = -ENOMEM; goto out; @@ -675,7 +675,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj) if (userptr->mm != current->mm) return -EPERM; - pvec = kvmalloc_objs(struct page *, npages, GFP_KERNEL); + pvec = kvmalloc_objs(struct page *, npages); if (!pvec) return -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index 1d9a4ca5d5e6..6757ae6ec304 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c @@ -126,7 +126,7 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev, npages = size / PAGE_SIZE; etnaviv_obj->sgt = sgt; - etnaviv_obj->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); + etnaviv_obj->pages = kvmalloc_objs(struct page *, npages); if (!etnaviv_obj->pages) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c index e3accccf22be..c35a3f77118c 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c @@ -468,9 +468,9 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, * Copy the command submission and bo array to kernel space in * one go, and do this outside of any locks. */ - bos = kvmalloc_objs(*bos, args->nr_bos, GFP_KERNEL); - relocs = kvmalloc_objs(*relocs, args->nr_relocs, GFP_KERNEL); - pmrs = kvmalloc_objs(*pmrs, args->nr_pmrs, GFP_KERNEL); + bos = kvmalloc_objs(*bos, args->nr_bos); + relocs = kvmalloc_objs(*relocs, args->nr_relocs); + pmrs = kvmalloc_objs(*pmrs, args->nr_pmrs); stream = kvmalloc_array(1, args->stream_size, GFP_KERNEL); if (!bos || !relocs || !pmrs || !stream) { ret = -ENOMEM; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 0d2a2684b2a6..a891d4f1f843 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1184,7 +1184,7 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu) */ lockdep_assert_held(&gpu->lock); - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c index 7cb29d6daa90..38377b2065b7 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c @@ -143,7 +143,7 @@ etnaviv_iommuv1_context_alloc(struct etnaviv_iommu_global *global) return context; } - v1_context = kzalloc_obj(*v1_context, GFP_KERNEL); + v1_context = kzalloc_obj(*v1_context); if (!v1_context) { mutex_unlock(&global->lock); return NULL; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c index 2ffb18ccde61..e3572461b599 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c @@ -494,7 +494,7 @@ int etnaviv_iommu_global_init(struct etnaviv_gpu *gpu) return 0; } - global = kzalloc_obj(*global, GFP_KERNEL); + global = kzalloc_obj(*global); if (!global) return -ENOMEM; diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 03ad7dd8bf07..41252caccd67 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -180,7 +180,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_crtc *crtc; int ret; - exynos_crtc = kzalloc_obj(*exynos_crtc, GFP_KERNEL); + exynos_crtc = kzalloc_obj(*exynos_crtc); if (!exynos_crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 311d5077a2bf..2101a74dc1ed 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -50,7 +50,7 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) struct drm_exynos_file_private *file_priv; int ret; - file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv); if (!file_priv) return -ENOMEM; @@ -245,7 +245,7 @@ static int exynos_drm_bind(struct device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - private = kzalloc_obj(struct exynos_drm_private, GFP_KERNEL); + private = kzalloc_obj(struct exynos_drm_private); if (!private) { ret = -ENOMEM; goto err_free_drm; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index b078295c96e2..ab0e0c74ec47 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -66,7 +66,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev, int i; int ret; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index aa70e249f512..a63087ceaf9e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -287,7 +287,7 @@ static int g2d_init_cmdlist(struct g2d_data *g2d) return -ENOMEM; } - node = kzalloc_objs(*node, G2D_CMDLIST_NUM, GFP_KERNEL); + node = kzalloc_objs(*node, G2D_CMDLIST_NUM); if (!node) { ret = -ENOMEM; goto err; @@ -459,7 +459,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d, } } - g2d_userptr = kzalloc_obj(*g2d_userptr, GFP_KERNEL); + g2d_userptr = kzalloc_obj(*g2d_userptr); if (!g2d_userptr) return ERR_PTR(-ENOMEM); @@ -491,7 +491,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d, } g2d_userptr->npages = npages; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto err_unpin_pages; @@ -1169,7 +1169,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, node->event = NULL; if (req->event_type != G2D_EVENT_NOT) { - e = kzalloc_obj(*node->event, GFP_KERNEL); + e = kzalloc_obj(*node->event); if (!e) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 8b21623c2075..69ef6cda1ce9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -152,7 +152,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev, struct drm_gem_object *obj; int ret; - exynos_gem = kzalloc_obj(*exynos_gem, GFP_KERNEL); + exynos_gem = kzalloc_obj(*exynos_gem); if (!exynos_gem) return ERR_PTR(-ENOMEM); @@ -411,7 +411,7 @@ struct sg_table *exynos_drm_gem_prime_get_sg_table(struct drm_gem_object *obj) struct sg_table *sgt; int ret; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index a4d72e12d1a6..ee3d61345a66 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -260,7 +260,7 @@ static inline struct exynos_drm_ipp_task * { struct exynos_drm_ipp_task *task; - task = kzalloc_obj(*task, GFP_KERNEL); + task = kzalloc_obj(*task); if (!task) return NULL; @@ -699,7 +699,7 @@ static int exynos_drm_ipp_event_create(struct exynos_drm_ipp_task *task, struct drm_pending_exynos_ipp_event *e = NULL; int ret; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index fec9033ec13e..da043bd357a4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -134,7 +134,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) plane->state = NULL; } - exynos_state = kzalloc_obj(*exynos_state, GFP_KERNEL); + exynos_state = kzalloc_obj(*exynos_state); if (exynos_state) { __drm_atomic_helper_plane_reset(plane, &exynos_state->base); plane->state->zpos = exynos_plane->config->zpos; @@ -148,7 +148,7 @@ exynos_drm_plane_duplicate_state(struct drm_plane *plane) struct exynos_drm_plane_state *copy; exynos_state = to_exynos_plane_state(plane->state); - copy = kzalloc_obj(*exynos_state, GFP_KERNEL); + copy = kzalloc_obj(*exynos_state); if (!copy) return NULL; diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index 7702788003a7..a9b3467263d6 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -209,7 +209,7 @@ struct drm_plane *fsl_dcu_drm_primary_create_plane(struct drm_device *dev) struct drm_plane *primary; int ret; - primary = kzalloc_obj(*primary, GFP_KERNEL); + primary = kzalloc_obj(*primary); if (!primary) { DRM_DEBUG_KMS("Failed to allocate primary plane\n"); return NULL; diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c index df38fefd4722..342a57c82846 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_crt.c +++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c @@ -250,11 +250,11 @@ void cdv_intel_crt_init(struct drm_device *dev, struct drm_encoder *encoder; int ret; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto err_free_encoder; diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index 1f6e2f65c33f..a901721ea73a 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c @@ -939,7 +939,7 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev, vsync = p->vsync; } - mode = kzalloc_obj(*mode, GFP_KERNEL); + mode = kzalloc_obj(*mode); if (!mode) return NULL; diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index 4f3fbe31a779..fbed35cf7603 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -1953,13 +1953,13 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev const char *name = NULL; int type = DRM_MODE_CONNECTOR_DisplayPort; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto err_connector; - intel_dp = kzalloc_obj(struct cdv_intel_dp, GFP_KERNEL); + intel_dp = kzalloc_obj(struct cdv_intel_dp); if (!intel_dp) goto err_priv; diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c index 5bfdc7adcaab..ce7850647778 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c @@ -284,15 +284,15 @@ void cdv_hdmi_init(struct drm_device *dev, int ddc_reg; int ret; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto err_free_encoder; - hdmi_priv = kzalloc_obj(struct mid_intel_hdmi_priv, GFP_KERNEL); + hdmi_priv = kzalloc_obj(struct mid_intel_hdmi_priv); if (!hdmi_priv) goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c index 5b6b0ac77c99..d7fd9a783cde 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c @@ -501,15 +501,15 @@ void cdv_intel_lvds_init(struct drm_device *dev, return; } - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto err_free_encoder; - lvds_priv = kzalloc_obj(struct cdv_intel_lvds_priv, GFP_KERNEL); + lvds_priv = kzalloc_obj(struct cdv_intel_lvds_priv); if (!lvds_priv) goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 808feee5fe2a..fe1f43f0abff 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -75,7 +75,7 @@ struct drm_framebuffer *psb_framebuffer_create(struct drm_device *dev, struct drm_framebuffer *fb; int ret; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 238f0dfafacf..88f1e86c8903 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -146,7 +146,7 @@ psb_gem_create(struct drm_device *dev, u64 size, const char *name, bool stolen, size = roundup(size, PAGE_SIZE); - pobj = kzalloc_obj(*pobj, GFP_KERNEL); + pobj = kzalloc_obj(*pobj); if (!pobj) return ERR_PTR(-ENOMEM); obj = &pobj->base; diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c index 527adf563bfa..c6a945358e3e 100644 --- a/drivers/gpu/drm/gma500/intel_bios.c +++ b/drivers/gpu/drm/gma500/intel_bios.c @@ -247,7 +247,7 @@ static void parse_lfp_panel_data(struct drm_psb_private *dev_priv, entry = &lvds_lfp_data->data[lvds_options->panel_type]; dvo_timing = &entry->dvo_timing; - panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode); if (panel_fixed_mode == NULL) { dev_err(dev_priv->dev.dev, "out of memory for fixed panel mode\n"); return; @@ -285,7 +285,7 @@ static void parse_sdvo_panel_data(struct drm_psb_private *dev_priv, if (!dvo_timing) return; - panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode); if (!panel_fixed_mode) return; @@ -477,7 +477,7 @@ parse_device_mapping(struct drm_psb_private *dev_priv, DRM_DEBUG_KMS("no child dev is parsed from VBT\n"); return; } - dev_priv->child_dev = kzalloc_objs(*p_child, count, GFP_KERNEL); + dev_priv->child_dev = kzalloc_objs(*p_child, count); if (!dev_priv->child_dev) { DRM_DEBUG_KMS("No memory space for child devices\n"); return; diff --git a/drivers/gpu/drm/gma500/intel_gmbus.c b/drivers/gpu/drm/gma500/intel_gmbus.c index 04eba78fa816..71782c369acf 100644 --- a/drivers/gpu/drm/gma500/intel_gmbus.c +++ b/drivers/gpu/drm/gma500/intel_gmbus.c @@ -187,7 +187,7 @@ intel_gpio_create(struct drm_psb_private *dev_priv, u32 pin) if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin]) return NULL; - gpio = kzalloc_obj(struct intel_gpio, GFP_KERNEL); + gpio = kzalloc_obj(struct intel_gpio); if (gpio == NULL) return NULL; diff --git a/drivers/gpu/drm/gma500/intel_i2c.c b/drivers/gpu/drm/gma500/intel_i2c.c index e121c7c27638..ab8217796817 100644 --- a/drivers/gpu/drm/gma500/intel_i2c.c +++ b/drivers/gpu/drm/gma500/intel_i2c.c @@ -107,7 +107,7 @@ struct gma_i2c_chan *gma_i2c_create(struct drm_device *dev, const u32 reg, { struct gma_i2c_chan *chan; - chan = kzalloc_obj(struct gma_i2c_chan, GFP_KERNEL); + chan = kzalloc_obj(struct gma_i2c_chan); if (!chan) goto out_free; diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c index 16128e84936a..428aff92a7bb 100644 --- a/drivers/gpu/drm/gma500/mid_bios.c +++ b/drivers/gpu/drm/gma500/mid_bios.c @@ -228,7 +228,7 @@ static int mid_get_vbt_data_r10(struct drm_psb_private *dev_priv, u32 addr) if (read_vbt_r10(addr, &vbt)) return -1; - gct = kmalloc_objs(*gct, vbt.panel_count, GFP_KERNEL); + gct = kmalloc_objs(*gct, vbt.panel_count); if (!gct) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/mmu.c b/drivers/gpu/drm/gma500/mmu.c index 7bc6a914a378..6b6b44e426cf 100644 --- a/drivers/gpu/drm/gma500/mmu.c +++ b/drivers/gpu/drm/gma500/mmu.c @@ -158,7 +158,7 @@ static inline uint32_t psb_mmu_mask_pte(uint32_t pfn, int type) struct psb_mmu_pd *psb_mmu_alloc_pd(struct psb_mmu_driver *driver, int trap_pagefaults, int invalid_type) { - struct psb_mmu_pd *pd = kmalloc_obj(*pd, GFP_KERNEL); + struct psb_mmu_pd *pd = kmalloc_obj(*pd); uint32_t *v; int i; @@ -260,7 +260,7 @@ void psb_mmu_free_pagedir(struct psb_mmu_pd *pd) static struct psb_mmu_pt *psb_mmu_alloc_pt(struct psb_mmu_pd *pd) { - struct psb_mmu_pt *pt = kmalloc_obj(*pt, GFP_KERNEL); + struct psb_mmu_pt *pt = kmalloc_obj(*pt); void *v; uint32_t clflush_add = pd->driver->clflush_add >> PAGE_SHIFT; uint32_t clflush_count = PAGE_SIZE / clflush_add; @@ -425,7 +425,7 @@ struct psb_mmu_driver *psb_mmu_driver_init(struct drm_device *dev, struct psb_mmu_driver *driver; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); - driver = kmalloc_obj(*driver, GFP_KERNEL); + driver = kmalloc_obj(*driver); if (!driver) return NULL; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index d48c9711e95a..58d7e191fd56 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -633,11 +633,11 @@ void oaktrail_hdmi_init(struct drm_device *dev, struct drm_connector *connector; struct drm_encoder *encoder; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto failed_connector; @@ -677,7 +677,7 @@ void oaktrail_hdmi_setup(struct drm_device *dev) if (!pdev) return; - hdmi_dev = kzalloc_obj(struct oaktrail_hdmi_dev, GFP_KERNEL); + hdmi_dev = kzalloc_obj(struct oaktrail_hdmi_dev); if (!hdmi_dev) { dev_err(dev->dev, "failed to allocate memory\n"); goto out; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c index 7c02a92c60cb..2a7916ca5907 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c @@ -280,7 +280,7 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev) hdmi_dev = pci_get_drvdata(dev); - i2c_dev = kzalloc_obj(struct hdmi_i2c_dev, GFP_KERNEL); + i2c_dev = kzalloc_obj(struct hdmi_i2c_dev); if (!i2c_dev) return -ENOMEM; diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c index f6ca1559081d..884d324f0044 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c @@ -223,7 +223,7 @@ static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev, /* Use the firmware provided data on Moorestown */ if (dev_priv->has_gct) { - mode = kzalloc_obj(*mode, GFP_KERNEL); + mode = kzalloc_obj(*mode); if (!mode) return; @@ -302,11 +302,11 @@ void oaktrail_lvds_init(struct drm_device *dev, struct drm_display_mode *scan; /* *modes, *bios_mode; */ int ret; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) return; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) goto err_free_encoder; diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c b/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c index 2b5ef15df09f..bbfbe893d1c4 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c @@ -135,7 +135,7 @@ struct gma_i2c_chan *oaktrail_lvds_i2c_init(struct drm_device *dev) struct gma_i2c_chan *chan; int ret; - chan = kzalloc_obj(struct gma_i2c_chan, GFP_KERNEL); + chan = kzalloc_obj(struct gma_i2c_chan); if (!chan) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index 2864b209fcdf..0df75a4a7739 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c @@ -404,7 +404,7 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev, vsync = p->vsync; } - mode = kzalloc_obj(*mode, GFP_KERNEL); + mode = kzalloc_obj(*mode); if (!mode) return NULL; @@ -487,7 +487,7 @@ void psb_intel_crtc_init(struct drm_device *dev, int pipe, return; gma_crtc->crtc_state = - kzalloc_obj(struct psb_intel_crtc_state, GFP_KERNEL); + kzalloc_obj(struct psb_intel_crtc_state); if (!gma_crtc->crtc_state) { dev_err(dev->dev, "Crtc state error: No memory\n"); kfree(gma_crtc); diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c index 6183360b1a81..2ca164b21293 100644 --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c @@ -639,20 +639,20 @@ void psb_intel_lvds_init(struct drm_device *dev, int pipe; int ret; - gma_encoder = kzalloc_obj(struct gma_encoder, GFP_KERNEL); + gma_encoder = kzalloc_obj(struct gma_encoder); if (!gma_encoder) { dev_err(dev->dev, "gma_encoder allocation error\n"); return; } encoder = &gma_encoder->base; - gma_connector = kzalloc_obj(struct gma_connector, GFP_KERNEL); + gma_connector = kzalloc_obj(struct gma_connector); if (!gma_connector) { dev_err(dev->dev, "gma_connector allocation error\n"); goto err_free_encoder; } - lvds_priv = kzalloc_obj(struct psb_intel_lvds_priv, GFP_KERNEL); + lvds_priv = kzalloc_obj(struct psb_intel_lvds_priv); if (!lvds_priv) { dev_err(dev->dev, "LVDS private allocation error\n"); goto err_free_connector; diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c index 6f973c9044e0..e81431957e7f 100644 --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c @@ -2446,7 +2446,7 @@ bool psb_intel_sdvo_init(struct drm_device *dev, int sdvo_reg) struct psb_intel_sdvo *psb_intel_sdvo; int i; - psb_intel_sdvo = kzalloc_obj(struct psb_intel_sdvo, GFP_KERNEL); + psb_intel_sdvo = kzalloc_obj(struct psb_intel_sdvo); if (!psb_intel_sdvo) return false; diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c index b3d5df5f7a5c..78be37092748 100644 --- a/drivers/gpu/drm/gud/gud_connector.c +++ b/drivers/gpu/drm/gud/gud_connector.c @@ -621,7 +621,7 @@ static int gud_connector_create(struct gud_device *gdrm, unsigned int index, int ret, connector_type; u32 flags; - gconn = kzalloc_obj(*gconn, GFP_KERNEL); + gconn = kzalloc_obj(*gconn); if (!gconn) return -ENOMEM; @@ -700,7 +700,7 @@ int gud_get_connectors(struct gud_device *gdrm) unsigned int i, num_connectors; int ret; - descs = kmalloc_objs(*descs, GUD_CONNECTORS_MAX_NUM, GFP_KERNEL); + descs = kmalloc_objs(*descs, GUD_CONNECTORS_MAX_NUM); if (!descs) return -ENOMEM; diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 66780b9f6026..a301e1580b3f 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -82,7 +82,7 @@ static int gud_get_display_descriptor(struct usb_interface *intf, void *buf; int ret; - buf = kmalloc_obj(*desc, GFP_KERNEL); + buf = kmalloc_obj(*desc); if (!buf) return -ENOMEM; @@ -135,7 +135,7 @@ static int gud_usb_get_status(struct usb_interface *intf) int ret, status = -EIO; u8 *buf; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) return -ENOMEM; @@ -402,7 +402,7 @@ static int gud_alloc_bulk_buffer(struct gud_device *gdrm) return -ENOMEM; num_pages = DIV_ROUND_UP(gdrm->bulk_len, PAGE_SIZE); - pages = kmalloc_objs(struct page *, num_pages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, num_pages); if (!pages) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/dvo_ch7017.c b/drivers/gpu/drm/i915/display/dvo_ch7017.c index 032c41e55a07..326b08e7a362 100644 --- a/drivers/gpu/drm/i915/display/dvo_ch7017.c +++ b/drivers/gpu/drm/i915/display/dvo_ch7017.c @@ -207,7 +207,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo, const char *str; u8 val; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ch7xxx.c b/drivers/gpu/drm/i915/display/dvo_ch7xxx.c index b85c9afb0c64..1382fe195bb1 100644 --- a/drivers/gpu/drm/i915/display/dvo_ch7xxx.c +++ b/drivers/gpu/drm/i915/display/dvo_ch7xxx.c @@ -218,7 +218,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo, u8 vendor, device; char *name, *devid; - ch7xxx = kzalloc_obj(*ch7xxx, GFP_KERNEL); + ch7xxx = kzalloc_obj(*ch7xxx); if (ch7xxx == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ivch.c b/drivers/gpu/drm/i915/display/dvo_ivch.c index 9bcdd02d5f36..0970dc6fd73d 100644 --- a/drivers/gpu/drm/i915/display/dvo_ivch.c +++ b/drivers/gpu/drm/i915/display/dvo_ivch.c @@ -269,7 +269,7 @@ static bool ivch_init(struct intel_dvo_device *dvo, u16 temp; int i; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_ns2501.c b/drivers/gpu/drm/i915/display/dvo_ns2501.c index 248b79795edf..6a6072b78410 100644 --- a/drivers/gpu/drm/i915/display/dvo_ns2501.c +++ b/drivers/gpu/drm/i915/display/dvo_ns2501.c @@ -476,7 +476,7 @@ static bool ns2501_init(struct intel_dvo_device *dvo, struct ns2501_priv *ns; unsigned char ch; - ns = kzalloc_obj(*ns, GFP_KERNEL); + ns = kzalloc_obj(*ns); if (ns == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_sil164.c b/drivers/gpu/drm/i915/display/dvo_sil164.c index 765d2517fb10..c6989a4bad0f 100644 --- a/drivers/gpu/drm/i915/display/dvo_sil164.c +++ b/drivers/gpu/drm/i915/display/dvo_sil164.c @@ -143,7 +143,7 @@ static bool sil164_init(struct intel_dvo_device *dvo, struct sil164_priv *sil; unsigned char ch; - sil = kzalloc_obj(*sil, GFP_KERNEL); + sil = kzalloc_obj(*sil); if (sil == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/dvo_tfp410.c b/drivers/gpu/drm/i915/display/dvo_tfp410.c index 9bd8305bc291..10d8dd4f4d17 100644 --- a/drivers/gpu/drm/i915/display/dvo_tfp410.c +++ b/drivers/gpu/drm/i915/display/dvo_tfp410.c @@ -175,7 +175,7 @@ static bool tfp410_init(struct intel_dvo_device *dvo, struct tfp410_priv *tfp; int id; - tfp = kzalloc_obj(*tfp, GFP_KERNEL); + tfp = kzalloc_obj(*tfp); if (tfp == NULL) return false; diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index b46b79eee5bb..fc265f71d72b 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1934,7 +1934,7 @@ void icl_dsi_init(struct intel_display *display, if (port == PORT_NONE) return; - intel_dsi = kzalloc_obj(*intel_dsi, GFP_KERNEL); + intel_dsi = kzalloc_obj(*intel_dsi); if (!intel_dsi) return; diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 208d6a449edc..71b7325917b6 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -323,7 +323,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_atomic_state * intel_atomic_state_alloc(struct drm_device *dev) { - struct intel_atomic_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct intel_atomic_state *state = kzalloc_obj(*state); if (!state || drm_atomic_state_init(dev, &state->base) < 0) { kfree(state); diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 4731afb418da..85f5f9bdf741 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -852,7 +852,7 @@ parse_lfp_panel_dtd(struct intel_display *display, lfp_data_ptrs, panel_type); - panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode); if (!panel_fixed_mode) return; @@ -968,7 +968,7 @@ parse_generic_dtd(struct intel_display *display, dtd = &generic_dtd->dtd[panel->vbt.panel_type]; - panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode); if (!panel_fixed_mode) return; @@ -1141,7 +1141,7 @@ parse_sdvo_lvds_data(struct intel_display *display, return; } - panel_fixed_mode = kzalloc_obj(*panel_fixed_mode, GFP_KERNEL); + panel_fixed_mode = kzalloc_obj(*panel_fixed_mode); if (!panel_fixed_mode) return; @@ -2929,7 +2929,7 @@ parse_general_definitions(struct intel_display *display) "Found VBT child device with type 0x%x\n", child->device_type); - devdata = kzalloc_obj(*devdata, GFP_KERNEL); + devdata = kzalloc_obj(*devdata); if (!devdata) break; @@ -3010,7 +3010,7 @@ init_vbt_missing_defaults(struct intel_display *display) continue; /* Create fake child device config */ - devdata = kzalloc_obj(*devdata, GFP_KERNEL); + devdata = kzalloc_obj(*devdata); if (!devdata) break; diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index e08e477e882a..fe48949b5880 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -1470,7 +1470,7 @@ int intel_bw_init(struct intel_display *display) { struct intel_bw_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 46375d4972be..f5946e677c93 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -3409,7 +3409,7 @@ int intel_cdclk_init(struct intel_display *display) { struct intel_cdclk_state *cdclk_state; - cdclk_state = kzalloc_obj(*cdclk_state, GFP_KERNEL); + cdclk_state = kzalloc_obj(*cdclk_state); if (!cdclk_state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_colorop.c b/drivers/gpu/drm/i915/display/intel_colorop.c index 8326916ccdc1..a898b8d73dd8 100644 --- a/drivers/gpu/drm/i915/display/intel_colorop.c +++ b/drivers/gpu/drm/i915/display/intel_colorop.c @@ -15,7 +15,7 @@ struct intel_colorop *intel_colorop_alloc(void) { struct intel_colorop *colorop; - colorop = kzalloc_obj(*colorop, GFP_KERNEL); + colorop = kzalloc_obj(*colorop); if (!colorop) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index 8712f6a61778..7ef9338d67ab 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -86,7 +86,7 @@ static int intel_connector_init(struct intel_connector *connector) * need it we'll free the state and allocate a smaller one on the first * successful commit anyway. */ - conn_state = kzalloc_obj(*conn_state, GFP_KERNEL); + conn_state = kzalloc_obj(*conn_state); if (!conn_state) return -ENOMEM; @@ -105,7 +105,7 @@ struct intel_connector *intel_connector_alloc(void) { struct intel_connector *connector; - connector = kzalloc_obj(*connector, GFP_KERNEL); + connector = kzalloc_obj(*connector); if (!connector) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 7be2361e52e7..59d637c6a187 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -1037,7 +1037,7 @@ void intel_crt_init(struct intel_display *display) intel_de_write(display, adpa_reg, adpa); } - crt = kzalloc_obj(struct intel_crt, GFP_KERNEL); + crt = kzalloc_obj(struct intel_crt); if (!crt) return; diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index e41975b34929..53378d2dcbec 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -168,7 +168,7 @@ struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc) { struct intel_crtc_state *crtc_state; - crtc_state = kmalloc_obj(*crtc_state, GFP_KERNEL); + crtc_state = kmalloc_obj(*crtc_state); if (crtc_state) intel_crtc_state_reset(crtc_state, crtc); @@ -196,7 +196,7 @@ static struct intel_crtc *intel_crtc_alloc(void) struct intel_crtc_state *crtc_state; struct intel_crtc *crtc; - crtc = kzalloc_obj(*crtc, GFP_KERNEL); + crtc = kzalloc_obj(*crtc); if (!crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dbuf_bw.c b/drivers/gpu/drm/i915/display/intel_dbuf_bw.c index 73d22de72226..0562d4df6a07 100644 --- a/drivers/gpu/drm/i915/display/intel_dbuf_bw.c +++ b/drivers/gpu/drm/i915/display/intel_dbuf_bw.c @@ -284,7 +284,7 @@ int intel_dbuf_bw_init(struct intel_display *display) { struct intel_dbuf_bw_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4a081b30477c..3b8ba8ab76a1 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -4122,7 +4122,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder) crtc = intel_crtc_for_pipe(display, pipe); - mode = kzalloc_obj(*mode, GFP_KERNEL); + mode = kzalloc_obj(*mode); if (!mode) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 648294f234cc..01e0ae01fc50 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -1663,7 +1663,7 @@ struct intel_display *intel_display_device_probe(struct pci_dev *pdev, const struct subplatform_desc *subdesc; enum intel_step step; - display = kzalloc_obj(*display, GFP_KERNEL); + display = kzalloc_obj(*display); if (!display) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_display_rps.c b/drivers/gpu/drm/i915/display/intel_display_rps.c index f37361f87894..b58281edc563 100644 --- a/drivers/gpu/drm/i915/display/intel_display_rps.c +++ b/drivers/gpu/drm/i915/display/intel_display_rps.c @@ -59,7 +59,7 @@ void intel_display_rps_boost_after_vblank(struct drm_crtc *crtc, if (drm_crtc_vblank_get(crtc)) return; - wait = kmalloc_obj(*wait, GFP_KERNEL); + wait = kmalloc_obj(*wait); if (!wait) { drm_crtc_vblank_put(crtc); return; diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c index 7e51d8873178..1006b060c3f3 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc.c +++ b/drivers/gpu/drm/i915/display/intel_dmc.c @@ -1417,7 +1417,7 @@ void intel_dmc_init(struct intel_display *display) */ intel_dmc_runtime_pm_get(display); - dmc = kzalloc_obj(*dmc, GFP_KERNEL); + dmc = kzalloc_obj(*dmc); if (!dmc) return; diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 96da2f8da8b5..70a21685a3e1 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -1765,7 +1765,7 @@ mst_stream_encoder_create(struct intel_digital_port *dig_port, enum pipe pipe) struct intel_dp_mst_encoder *intel_mst; struct intel_encoder *encoder; - intel_mst = kzalloc_obj(*intel_mst, GFP_KERNEL); + intel_mst = kzalloc_obj(*intel_mst); if (!intel_mst) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index 05e5c8f839a1..da472371c7d7 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -280,7 +280,7 @@ intel_dpt_create(struct intel_framebuffer *fb) return ERR_PTR(ret); } - dpt = kzalloc_obj(*dpt, GFP_KERNEL); + dpt = kzalloc_obj(*dpt); if (!dpt) { i915_gem_object_put(dpt_obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c index d9aff12a0a9b..b5d774706fec 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -974,7 +974,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state, if (!display->params.enable_dsb) return NULL; - dsb = kzalloc_obj(*dsb, GFP_KERNEL); + dsb = kzalloc_obj(*dsb); if (!dsb) goto out; diff --git a/drivers/gpu/drm/i915/display/intel_dsb_buffer.c b/drivers/gpu/drm/i915/display/intel_dsb_buffer.c index 28d63ba2f032..9b6060af250d 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb_buffer.c +++ b/drivers/gpu/drm/i915/display/intel_dsb_buffer.c @@ -46,7 +46,7 @@ struct intel_dsb_buffer *intel_dsb_buffer_create(struct drm_device *drm, size_t u32 *buf; int ret; - dsb_buf = kzalloc_obj(*dsb_buf, GFP_KERNEL); + dsb_buf = kzalloc_obj(*dsb_buf); if (!dsb_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_dsi.c b/drivers/gpu/drm/i915/display/intel_dsi.c index 1ac274964c4c..9005c1f5d857 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi.c +++ b/drivers/gpu/drm/i915/display/intel_dsi.c @@ -87,7 +87,7 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi *intel_dsi, struct intel_dsi_host *host; struct mipi_dsi_device *device; - host = kzalloc_obj(*host, GFP_KERNEL); + host = kzalloc_obj(*host); if (!host) return NULL; @@ -102,7 +102,7 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi *intel_dsi, * devices by ourselves here too. Need to be careful though, because we * don't initialize any of the driver model devices here. */ - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) { kfree(host); return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index d6fbf4fd29d9..405b33aca9dd 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -494,7 +494,7 @@ void intel_dvo_init(struct intel_display *display) struct intel_encoder *encoder; struct intel_dvo *intel_dvo; - intel_dvo = kzalloc_obj(*intel_dvo, GFP_KERNEL); + intel_dvo = kzalloc_obj(*intel_dvo); if (!intel_dvo) return; diff --git a/drivers/gpu/drm/i915/display/intel_encoder.c b/drivers/gpu/drm/i915/display/intel_encoder.c index b02297d56950..d01b081a6074 100644 --- a/drivers/gpu/drm/i915/display/intel_encoder.c +++ b/drivers/gpu/drm/i915/display/intel_encoder.c @@ -108,7 +108,7 @@ struct intel_digital_port *intel_dig_port_alloc(void) { struct intel_digital_port *dig_port; - dig_port = kzalloc_obj(*dig_port, GFP_KERNEL); + dig_port = kzalloc_obj(*dig_port); if (!dig_port) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 3b6d0d4ccff7..38c33f2ca05c 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -2173,7 +2173,7 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, if (ret || !fence) goto flush; - cb = kmalloc_obj(*cb, GFP_KERNEL); + cb = kmalloc_obj(*cb); if (!cb) { dma_fence_put(fence); ret = -ENOMEM; @@ -2361,7 +2361,7 @@ struct intel_framebuffer *intel_framebuffer_alloc(void) { struct intel_framebuffer *intel_fb; - intel_fb = kzalloc_obj(*intel_fb, GFP_KERNEL); + intel_fb = kzalloc_obj(*intel_fb); if (!intel_fb) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index c0dfa65809f9..91de38379282 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -2294,7 +2294,7 @@ static struct intel_fbc *intel_fbc_create(struct intel_display *display, { struct intel_fbc *fbc; - fbc = kzalloc_obj(*fbc, GFP_KERNEL); + fbc = kzalloc_obj(*fbc); if (!fbc) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_global_state.c b/drivers/gpu/drm/i915/display/intel_global_state.c index 49f32828c3f1..9e1369c834e4 100644 --- a/drivers/gpu/drm/i915/display/intel_global_state.c +++ b/drivers/gpu/drm/i915/display/intel_global_state.c @@ -52,7 +52,7 @@ static struct intel_global_commit *commit_new(void) { struct intel_global_commit *commit; - commit = kzalloc_obj(*commit, GFP_KERNEL); + commit = kzalloc_obj(*commit); if (!commit) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c index b27330b95145..a7bce0c6a17e 100644 --- a/drivers/gpu/drm/i915/display/intel_gmbus.c +++ b/drivers/gpu/drm/i915/display/intel_gmbus.c @@ -925,7 +925,7 @@ int intel_gmbus_setup(struct intel_display *display) if (!gmbus_pin) continue; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c index 5b941bfa8c17..c2de48f57f30 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c @@ -633,7 +633,7 @@ int intel_hdcp_gsc_init(struct intel_display *display) struct i915_hdcp_arbiter *arbiter; int ret = 0; - arbiter = kzalloc_obj(*arbiter, GFP_KERNEL); + arbiter = kzalloc_obj(*arbiter); if (!arbiter) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_lpe_audio.c b/drivers/gpu/drm/i915/display/intel_lpe_audio.c index c7f28b537509..117b60656ca1 100644 --- a/drivers/gpu/drm/i915/display/intel_lpe_audio.c +++ b/drivers/gpu/drm/i915/display/intel_lpe_audio.c @@ -87,11 +87,11 @@ lpe_audio_platdev_create(struct intel_display *display) struct platform_device *platdev; struct intel_hdmi_lpe_audio_pdata *pdata; - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return ERR_PTR(-ENOMEM); - rsc = kzalloc_objs(*rsc, 2, GFP_KERNEL); + rsc = kzalloc_objs(*rsc, 2); if (!rsc) { kfree(pdata); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 7f085f475664..cc6d4bfcff10 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -886,7 +886,7 @@ void intel_lvds_init(struct intel_display *display) "LVDS is not present in VBT, but enabled anyway\n"); } - lvds_encoder = kzalloc_obj(*lvds_encoder, GFP_KERNEL); + lvds_encoder = kzalloc_obj(*lvds_encoder); if (!lvds_encoder) return; diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index e968834dc7b7..e25be56e678b 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -898,7 +898,7 @@ int intel_opregion_setup(struct intel_display *display) return -ENOTSUPP; } - opregion = kzalloc_obj(*opregion, GFP_KERNEL); + opregion = kzalloc_obj(*opregion); if (!opregion) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index 8ab5a866fb67..05c7545c49e5 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1409,7 +1409,7 @@ void intel_overlay_setup(struct intel_display *display) if (!engine || !engine->kernel_context) return; - overlay = kzalloc_obj(*overlay, GFP_KERNEL); + overlay = kzalloc_obj(*overlay); if (!overlay) return; diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c index a5d60180cc7a..e06a0618b4c6 100644 --- a/drivers/gpu/drm/i915/display/intel_plane.c +++ b/drivers/gpu/drm/i915/display/intel_plane.c @@ -77,11 +77,11 @@ struct intel_plane *intel_plane_alloc(void) struct intel_plane_state *plane_state; struct intel_plane *plane; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); - plane_state = kzalloc_obj(*plane_state, GFP_KERNEL); + plane_state = kzalloc_obj(*plane_state); if (!plane_state) { kfree(plane); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c b/drivers/gpu/drm/i915/display/intel_pmdemand.c index d12fabbe90de..f3db55710010 100644 --- a/drivers/gpu/drm/i915/display/intel_pmdemand.c +++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c @@ -121,7 +121,7 @@ int intel_pmdemand_init(struct intel_display *display) { struct intel_pmdemand_state *pmdemand_state; - pmdemand_state = kzalloc_obj(*pmdemand_state, GFP_KERNEL); + pmdemand_state = kzalloc_obj(*pmdemand_state); if (!pmdemand_state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_rom.c b/drivers/gpu/drm/i915/display/intel_rom.c index 930b9cb9d1b7..05b6ea764ebb 100644 --- a/drivers/gpu/drm/i915/display/intel_rom.c +++ b/drivers/gpu/drm/i915/display/intel_rom.c @@ -47,7 +47,7 @@ struct intel_rom *intel_rom_spi(struct drm_device *drm) struct intel_rom *rom; u32 static_region; - rom = kzalloc_obj(*rom, GFP_KERNEL); + rom = kzalloc_obj(*rom); if (!rom) return NULL; @@ -92,7 +92,7 @@ struct intel_rom *intel_rom_pci(struct drm_device *drm) { struct intel_rom *rom; - rom = kzalloc_obj(*rom, GFP_KERNEL); + rom = kzalloc_obj(*rom); if (!rom) return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 273487e8ec5c..2e1af9e869de 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -474,7 +474,7 @@ static bool __intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, if (!buf) return false; - msgs = kzalloc_objs(*msgs, args_len + 3, GFP_KERNEL); + msgs = kzalloc_objs(*msgs, args_len + 3); if (!msgs) { kfree(buf); return false; @@ -2774,11 +2774,11 @@ static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void) struct intel_sdvo_connector *sdvo_connector; struct intel_sdvo_connector_state *conn_state; - sdvo_connector = kzalloc_obj(*sdvo_connector, GFP_KERNEL); + sdvo_connector = kzalloc_obj(*sdvo_connector); if (!sdvo_connector) return NULL; - conn_state = kzalloc_obj(*conn_state, GFP_KERNEL); + conn_state = kzalloc_obj(*conn_state); if (!conn_state) { kfree(sdvo_connector); return NULL; @@ -3389,7 +3389,7 @@ bool intel_sdvo_init(struct intel_display *display, if (!assert_sdvo_port_valid(display, port)) return false; - intel_sdvo = kzalloc_obj(*intel_sdvo, GFP_KERNEL); + intel_sdvo = kzalloc_obj(*intel_sdvo); if (!intel_sdvo) return false; diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c index 0f9efe45acf2..bd12148e42f7 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -1977,7 +1977,7 @@ int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) if (drm_WARN_ON(display->drm, tc_port == TC_PORT_NONE)) return -EINVAL; - tc = kzalloc_obj(*tc, GFP_KERNEL); + tc = kzalloc_obj(*tc); if (!tc) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 2036eaf2d1ff..8fbf0adb5699 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1966,7 +1966,7 @@ intel_tv_init(struct intel_display *display) (tv_dac_off & TVDAC_STATE_CHG_EN) != 0) return; - intel_tv = kzalloc_obj(*intel_tv, GFP_KERNEL); + intel_tv = kzalloc_obj(*intel_tv); if (!intel_tv) { return; } diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index edd6ca199106..f5a6fae815d1 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -3366,7 +3366,7 @@ int intel_dbuf_init(struct intel_display *display) { struct intel_dbuf_state *dbuf_state; - dbuf_state = kzalloc_obj(*dbuf_state, GFP_KERNEL); + dbuf_state = kzalloc_obj(*dbuf_state); if (!dbuf_state) return -ENOMEM; @@ -3892,7 +3892,7 @@ void intel_wm_state_verify(struct intel_atomic_state *state, if (DISPLAY_VER(display) < 9 || !new_crtc_state->hw.active) return; - hw = kzalloc_obj(*hw, GFP_KERNEL); + hw = kzalloc_obj(*hw); if (!hw) return; diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index 31625b0070c6..60857d2afdb1 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1919,7 +1919,7 @@ void vlv_dsi_init(struct intel_display *display) else display->dsi.mmio_base = VLV_MIPI_BASE; - intel_dsi = kzalloc_obj(*intel_dsi, GFP_KERNEL); + intel_dsi = kzalloc_obj(*intel_dsi); if (!intel_dsi) return; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c index 50ade188edc5..30cc08583cbd 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c @@ -52,7 +52,7 @@ static struct clflush *clflush_work_create(struct drm_i915_gem_object *obj) GEM_BUG_ON(!obj->cache_dirty); - clflush = kmalloc_obj(*clflush, GFP_KERNEL); + clflush = kmalloc_obj(*clflush); if (!clflush) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index c364423706c6..6ff5dc07b719 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -285,7 +285,7 @@ proto_context_create(struct drm_i915_file_private *fpriv, { struct i915_gem_proto_context *pc, *err; - pc = kzalloc_obj(*pc, GFP_KERNEL); + pc = kzalloc_obj(*pc); if (!pc) return ERR_PTR(-ENOMEM); @@ -442,7 +442,7 @@ set_proto_ctx_engines_balance(struct i915_user_extension __user *base, if (num_siblings == 0) return 0; - siblings = kmalloc_objs(*siblings, num_siblings, GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings); if (!siblings) return -ENOMEM; @@ -644,7 +644,7 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base, return -EINVAL; } - siblings = kmalloc_objs(*siblings, num_siblings * width, GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings * width); if (!siblings) return -ENOMEM; @@ -759,7 +759,7 @@ static int set_proto_ctx_engines(struct drm_i915_file_private *fpriv, if (set.num_engines > I915_EXEC_RING_MASK + 1) return -EINVAL; - set.engines = kmalloc_objs(*set.engines, set.num_engines, GFP_KERNEL); + set.engines = kmalloc_objs(*set.engines, set.num_engines); if (!set.engines) return -ENOMEM; @@ -1609,7 +1609,7 @@ i915_gem_create_context(struct drm_i915_private *i915, int err; int i; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c index db7166784731..b43d34c7d641 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c @@ -36,7 +36,7 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attach, * Make a copy of the object's sgt, so that we can make an independent * mapping */ - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index c2e91eeb7c16..e7918f896a26 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -2006,7 +2006,7 @@ static int eb_capture_stage(struct i915_execbuffer *eb) for_each_batch_create_order(eb, j) { struct i915_capture_list *capture; - capture = kmalloc_obj(*capture, GFP_KERNEL); + capture = kmalloc_obj(*capture); if (!capture) continue; @@ -3190,7 +3190,7 @@ eb_composite_fence_create(struct i915_execbuffer *eb, int out_fence_fd) GEM_BUG_ON(!intel_context_is_parent(eb->context)); - fences = kmalloc_objs(*fences, eb->num_batches, GFP_KERNEL); + fences = kmalloc_objs(*fences, eb->num_batches); if (!fences) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c index e90fe30cc44e..37d286ecb99b 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c @@ -54,7 +54,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) } create_st: - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index e10a9e21e6c8..0644f85c6c8e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -730,7 +730,7 @@ mmap_offset_attach(struct drm_i915_gem_object *obj, if (mmo) goto out; - mmo = kmalloc_obj(*mmo, GFP_KERNEL); + mmo = kmalloc_obj(*mmo); if (!mmo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c index e9b7d76927bb..adba3fa96c05 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.c @@ -32,7 +32,7 @@ i915_gem_object_frontbuffer_get(struct drm_i915_gem_object *obj) if (front) return front; - front = kmalloc_obj(*front, GFP_KERNEL); + front = kmalloc_obj(*front); if (!front) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c index fa6d174987ac..df35bdb755e4 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c @@ -314,7 +314,7 @@ static void *i915_gem_object_map_page(struct drm_i915_gem_object *obj, if (n_pages > ARRAY_SIZE(stack)) { /* Too big for stack -- allocate temporary array instead */ - pages = kvmalloc_objs(*pages, n_pages, GFP_KERNEL); + pages = kvmalloc_objs(*pages, n_pages); if (!pages) return ERR_PTR(-ENOMEM); } @@ -437,7 +437,7 @@ struct intel_panic *i915_gem_object_alloc_panic(void) { struct intel_panic *panic; - panic = kzalloc_obj(*panic, GFP_KERNEL); + panic = kzalloc_obj(*panic); return panic; } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index 71a2c2bb5087..ce2780ef97ef 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c @@ -47,7 +47,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) if (!vaddr) return -ENOMEM; - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) goto err_pci; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index a577f8df7c60..77f85359f279 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -648,7 +648,7 @@ i915_pages_create_for_stolen(struct drm_device *dev, * dma mapping in a single scatterlist. */ - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (st == NULL) return ERR_PTR(-ENOMEM); @@ -783,7 +783,7 @@ static int _i915_gem_object_stolen_init(struct intel_memory_region *mem, !(flags & I915_BO_ALLOC_GPU_ONLY)) return -ENOSPC; - stolen = kzalloc_obj(*stolen, GFP_KERNEL); + stolen = kzalloc_obj(*stolen); if (!stolen) return -ENOMEM; @@ -1074,7 +1074,7 @@ static struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *d struct drm_i915_private *i915 = to_i915(drm); struct intel_stolen_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 46ed4ff8658d..033eda38e4b5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -279,7 +279,7 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, if (i915_ttm_is_ghost_object(bo)) return NULL; - i915_tt = kzalloc_obj(*i915_tt, GFP_KERNEL); + i915_tt = kzalloc_obj(*i915_tt); if (!i915_tt) return NULL; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index ff2e02113fe6..3a7e202ae87d 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -498,7 +498,7 @@ __i915_ttm_move(struct ttm_buffer_object *bo, struct dma_fence *dep = fence; if (!I915_SELFTEST_ONLY(fail_work_allocation)) - copy_work = kzalloc_obj(*copy_work, GFP_KERNEL); + copy_work = kzalloc_obj(*copy_work); if (copy_work) { copy_work->i915 = i915; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 6518a02397c6..043095f93ac6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -109,7 +109,7 @@ static int i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj) return -E2BIG; num_pages = obj->base.size >> PAGE_SHIFT; - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) return -ENOMEM; @@ -258,7 +258,7 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj) if (ret) return ret; - pvec = kvmalloc_objs(struct page *, num_pages, GFP_KERNEL); + pvec = kvmalloc_objs(struct page *, num_pages); if (!pvec) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c index ee661b7d3c6f..1d4d7cfb3f9c 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c @@ -540,7 +540,7 @@ tiled_blits_create(struct intel_engine_cs *engine, struct rnd_state *prng) u64 hole_size; int err; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index 223a9ca32d22..9d405098f9e7 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c @@ -56,7 +56,7 @@ static int live_nop_switch(void *arg) if (IS_ERR(file)) return PTR_ERR(file); - ctx = kzalloc_objs(*ctx, nctx, GFP_KERNEL); + ctx = kzalloc_objs(*ctx, nctx); if (!ctx) { err = -ENOMEM; goto out_file; @@ -317,7 +317,7 @@ static int live_parallel_switch(void *arg) engines = i915_gem_context_lock_engines(ctx); count = engines->num_engines; - data = kzalloc_objs(*data, count, GFP_KERNEL); + data = kzalloc_objs(*data, count); if (!data) { i915_gem_context_unlock_engines(ctx); err = -ENOMEM; @@ -1054,7 +1054,7 @@ __sseu_prepare(const char *name, if (!(flags & (TEST_BUSY | TEST_RESET))) return 0; - *spin = kzalloc_obj(**spin, GFP_KERNEL); + *spin = kzalloc_obj(**spin); if (!*spin) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gem/selftests/mock_context.c b/drivers/gpu/drm/i915/gem/selftests/mock_context.c index 35cf3d0dd08f..24f1437262ec 100644 --- a/drivers/gpu/drm/i915/gem/selftests/mock_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/mock_context.c @@ -17,7 +17,7 @@ mock_context(struct drm_i915_private *i915, struct i915_gem_engines *e; struct intel_sseu null_sseu = {}; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c index 8eabb6aa2f65..4212873c326d 100644 --- a/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c @@ -15,7 +15,7 @@ static struct sg_table *mock_map_dma_buf(struct dma_buf_attachment *attachment, struct scatterlist *sg; int i, err; - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c index 6cbf5dc04d9a..e8fab45759c3 100644 --- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c @@ -431,7 +431,7 @@ struct i915_ppgtt *gen6_ppgtt_create(struct intel_gt *gt) struct gen6_ppgtt *ppgtt; int err; - ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt); if (!ppgtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index 1e1d035a0391..cfa09b250a1b 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -1006,7 +1006,7 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt, struct i915_ppgtt *ppgtt; int err; - ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt); if (!ppgtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c index e18c019b7725..a2b413982ce6 100644 --- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c @@ -279,7 +279,7 @@ intel_breadcrumbs_create(struct intel_engine_cs *irq_engine) { struct intel_breadcrumbs *b; - b = kzalloc_obj(*b, GFP_KERNEL); + b = kzalloc_obj(*b); if (!b) return NULL; diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index 53b7554b78b9..d37966ec7a92 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -471,7 +471,7 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id, if (GEM_DEBUG_WARN_ON(gt->engine_class[info->class][info->instance])) return -EINVAL; - engine = kzalloc_obj(*engine, GFP_KERNEL); + engine = kzalloc_obj(*engine); if (!engine) return -ENOMEM; @@ -1311,7 +1311,7 @@ static int measure_breadcrumb_dw(struct intel_context *ce) GEM_BUG_ON(!engine->gt->scratch); - frame = kzalloc_obj(*frame, GFP_KERNEL); + frame = kzalloc_obj(*frame); if (!frame) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/intel_gsc.c b/drivers/gpu/drm/i915/gt/intel_gsc.c index d0b61fcc6eb7..050d909fb4f8 100644 --- a/drivers/gpu/drm/i915/gt/intel_gsc.c +++ b/drivers/gpu/drm/i915/gt/intel_gsc.c @@ -204,7 +204,7 @@ static void gsc_init_one(struct drm_i915_private *i915, struct intel_gsc *gsc, } add_device: - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) goto fail; diff --git a/drivers/gpu/drm/i915/gt/intel_ring.c b/drivers/gpu/drm/i915/gt/intel_ring.c index 73e342a95dcb..be7eeb95ff12 100644 --- a/drivers/gpu/drm/i915/gt/intel_ring.c +++ b/drivers/gpu/drm/i915/gt/intel_ring.c @@ -152,7 +152,7 @@ intel_engine_create_ring(struct intel_engine_cs *engine, int size) GEM_BUG_ON(!is_power_of_2(size)); GEM_BUG_ON(RING_CTL_SIZE(size) & ~RING_NR_PAGES); - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c index 98a6aadff7dd..7070047bfbaa 100644 --- a/drivers/gpu/drm/i915/gt/intel_timeline.c +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c @@ -151,7 +151,7 @@ __intel_timeline_create(struct intel_gt *gt, struct intel_timeline *timeline; int err; - timeline = kzalloc_obj(*timeline, GFP_KERNEL); + timeline = kzalloc_obj(*timeline); if (!timeline) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c index 67326bc83310..b893a8fde895 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c @@ -72,7 +72,7 @@ static struct pulse *pulse_create(void) { struct pulse *p; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return p; diff --git a/drivers/gpu/drm/i915/gt/selftest_execlists.c b/drivers/gpu/drm/i915/gt/selftest_execlists.c index 1e99179ce32f..8c3b76e71eae 100644 --- a/drivers/gpu/drm/i915/gt/selftest_execlists.c +++ b/drivers/gpu/drm/i915/gt/selftest_execlists.c @@ -3564,7 +3564,7 @@ static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags) unsigned long count; int err = 0; - arg = kmalloc_objs(*arg, I915_NUM_ENGINES, GFP_KERNEL); + arg = kmalloc_objs(*arg, I915_NUM_ENGINES); if (!arg) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c index 2204058849bd..00dfc37221fa 100644 --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c @@ -986,7 +986,7 @@ static int __igt_reset_engines(struct intel_gt *gt, h.ctx->sched.priority = 1024; } - threads = kmalloc_objs(*threads, I915_NUM_ENGINES, GFP_KERNEL); + threads = kmalloc_objs(*threads, I915_NUM_ENGINES); if (!threads) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c index 71f2c2ca71a2..5b986a7687d9 100644 --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c @@ -689,7 +689,7 @@ static int threaded_migrate(struct intel_migrate *migrate, unsigned int i; int err = 0; - thread = kzalloc_objs(*thread, n_cpus, GFP_KERNEL); + thread = kzalloc_objs(*thread, n_cpus); if (!thread) return 0; diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c index 166175f0b19c..90f30b988d68 100644 --- a/drivers/gpu/drm/i915/gt/selftest_rc6.c +++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c @@ -201,7 +201,7 @@ randomised_engines(struct intel_gt *gt, if (!n) return NULL; - engines = kmalloc_objs(*engines, n, GFP_KERNEL); + engines = kmalloc_objs(*engines, n); if (!engines) return NULL; diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c index 6e25d39fa193..c3c918248989 100644 --- a/drivers/gpu/drm/i915/gt/selftest_slpc.c +++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c @@ -499,7 +499,7 @@ static int live_slpc_tile_interaction(void *arg) struct slpc_thread *threads; int i = 0, ret = 0; - threads = kzalloc_objs(*threads, I915_MAX_GT, GFP_KERNEL); + threads = kzalloc_objs(*threads, I915_MAX_GT); if (!threads) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c index 6860b61915b9..351271045d36 100644 --- a/drivers/gpu/drm/i915/gt/selftest_timeline.c +++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c @@ -170,7 +170,7 @@ static int mock_hwsp_freelist(void *arg) state.max = PAGE_SIZE / sizeof(*state.history); state.count = 0; - state.history = kzalloc_objs(*state.history, state.max, GFP_KERNEL); + state.history = kzalloc_objs(*state.history, state.max); if (!state.history) { err = -ENOMEM; goto err_put; diff --git a/drivers/gpu/drm/i915/gt/selftest_workarounds.c b/drivers/gpu/drm/i915/gt/selftest_workarounds.c index 24ee4ec4c287..81cdecd38346 100644 --- a/drivers/gpu/drm/i915/gt/selftest_workarounds.c +++ b/drivers/gpu/drm/i915/gt/selftest_workarounds.c @@ -1204,7 +1204,7 @@ live_gpu_reset_workarounds(void *arg) if (!intel_has_gpu_reset(gt)) return 0; - lists = kzalloc_obj(*lists, GFP_KERNEL); + lists = kzalloc_obj(*lists); if (!lists) return -ENOMEM; @@ -1248,7 +1248,7 @@ live_engine_reset_workarounds(void *arg) if (!intel_has_reset_engine(gt)) return 0; - lists = kzalloc_obj(*lists, GFP_KERNEL); + lists = kzalloc_obj(*lists); if (!lists) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 1db6aa1e32d8..5850adaebf82 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -63,7 +63,7 @@ void *shmem_pin_map(struct file *file) void *vaddr; n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT; - pages = kvmalloc_objs(*pages, n_pages, GFP_KERNEL); + pages = kvmalloc_objs(*pages, n_pages); if (!pages) return NULL; diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c index bb4eb815f0ff..da740bbcd083 100644 --- a/drivers/gpu/drm/i915/gt/sysfs_engines.c +++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c @@ -430,7 +430,7 @@ kobj_engine(struct kobject *dir, struct intel_engine_cs *engine) { struct kobj_engine *ke; - ke = kzalloc_obj(*ke, GFP_KERNEL); + ke = kzalloc_obj(*ke); if (!ke) return NULL; @@ -458,7 +458,7 @@ static void add_defaults(struct kobj_engine *parent) }; struct kobj_engine *ke; - ke = kzalloc_obj(*ke, GFP_KERNEL); + ke = kzalloc_obj(*ke); if (!ke) return; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c index 2e7257f5543b..73b9959119a5 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c @@ -275,7 +275,7 @@ __alloc_ext_regs(struct __guc_mmio_reg_descr_group *newlist, { struct __guc_mmio_reg_descr *list; - list = kzalloc_objs(struct __guc_mmio_reg_descr, num_regs, GFP_KERNEL); + list = kzalloc_objs(struct __guc_mmio_reg_descr, num_regs); if (!list) return -ENOMEM; @@ -985,7 +985,7 @@ guc_capture_alloc_one_node(struct intel_guc *guc) struct __guc_capture_parsed_output *new; int i; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; @@ -1641,7 +1641,7 @@ void intel_guc_capture_destroy(struct intel_guc *guc) int intel_guc_capture_init(struct intel_guc *guc) { - guc->capture = kzalloc_obj(*guc->capture, GFP_KERNEL); + guc->capture = kzalloc_obj(*guc->capture); if (!guc->capture) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 1ba53ff64861..142183d3f7fb 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -2110,7 +2110,7 @@ static int init_tlb_lookup(struct intel_guc *guc) xa_init_flags(&guc->tlb_lookup, XA_FLAGS_ALLOC); - wait = kzalloc_obj(*wait, GFP_KERNEL); + wait = kzalloc_obj(*wait); if (!wait) return -ENOMEM; @@ -4222,7 +4222,7 @@ guc_create_parallel(struct intel_engine_cs **engines, struct intel_context *parent = NULL, *ce, *err; int i, j; - siblings = kmalloc_objs(*siblings, num_siblings, GFP_KERNEL); + siblings = kmalloc_objs(*siblings, num_siblings); if (!siblings) return ERR_PTR(-ENOMEM); @@ -5905,7 +5905,7 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count, unsigned int n; int err; - ve = kzalloc_obj(*ve, GFP_KERNEL); + ve = kzalloc_obj(*ve); if (!ve) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c index 8556a3e1ac3f..477c163d2660 100644 --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c @@ -153,7 +153,7 @@ static int intel_guc_steal_guc_ids(void *arg) struct i915_request *spin_rq = NULL, *rq, *last = NULL; int number_guc_id_stolen = guc->number_guc_id_stolen; - ce = kzalloc_objs(*ce, GUC_MAX_CONTEXT_ID, GFP_KERNEL); + ce = kzalloc_objs(*ce, GUC_MAX_CONTEXT_ID); if (!ce) { guc_err(guc, "Context array allocation failed\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index d5d00cb84f2f..b868a0501886 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -1921,7 +1921,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) if (ret) return ret; - bb = kzalloc_obj(*bb, GFP_KERNEL); + bb = kzalloc_obj(*bb); if (!bb) return -ENOMEM; @@ -3226,7 +3226,7 @@ static int init_cmd_table(struct intel_gvt *gvt) if (!(cmd_info[i].devices & gen_type)) continue; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c index 04ddd4709933..fe4302c8cae5 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c @@ -562,11 +562,11 @@ static int setup_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num, if (drm_WARN_ON(&i915->drm, resolution >= GVT_EDID_NUM)) return -EINVAL; - port->edid = kzalloc_obj(*(port->edid), GFP_KERNEL); + port->edid = kzalloc_obj(*(port->edid)); if (!port->edid) return -ENOMEM; - port->dpcd = kzalloc_obj(*(port->dpcd), GFP_KERNEL); + port->dpcd = kzalloc_obj(*(port->dpcd)); if (!port->dpcd) { kfree(port->edid); return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index 255abb5a849b..8a1d6c5636c2 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -67,7 +67,7 @@ static int vgpu_gem_get_pages(struct drm_i915_gem_object *obj) if (drm_WARN_ON(&dev_priv->drm, !vgpu)) return -ENODEV; - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (unlikely(!st)) return -ENOMEM; @@ -447,14 +447,14 @@ int intel_vgpu_query_plane(struct intel_vgpu *vgpu, void *args) mutex_unlock(&vgpu->dmabuf_lock); /* Need to allocate a new one*/ - dmabuf_obj = kmalloc_obj(struct intel_vgpu_dmabuf_obj, GFP_KERNEL); + dmabuf_obj = kmalloc_obj(struct intel_vgpu_dmabuf_obj); if (unlikely(!dmabuf_obj)) { gvt_vgpu_err("alloc dmabuf_obj failed\n"); ret = -ENOMEM; goto out; } - dmabuf_obj->info = kmalloc_obj(struct intel_vgpu_fb_info, GFP_KERNEL); + dmabuf_obj->info = kmalloc_obj(struct intel_vgpu_fb_info); if (unlikely(!dmabuf_obj->info)) { gvt_vgpu_err("allocate intel vgpu fb info failed\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 8cc24620a32e..5056a5887b31 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -1770,7 +1770,7 @@ static struct intel_vgpu_mm *vgpu_alloc_mm(struct intel_vgpu *vgpu) { struct intel_vgpu_mm *mm; - mm = kzalloc_obj(*mm, GFP_KERNEL); + mm = kzalloc_obj(*mm); if (!mm) return NULL; @@ -2206,7 +2206,7 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, if (!found) { /* the first partial part */ - partial_pte = kzalloc_obj(*partial_pte, GFP_KERNEL); + partial_pte = kzalloc_obj(*partial_pte); if (!partial_pte) return -ENOMEM; partial_pte->offset = off; @@ -2502,7 +2502,7 @@ static int setup_spt_oos(struct intel_gvt *gvt) INIT_LIST_HEAD(>t->oos_page_use_list_head); for (i = 0; i < preallocated_oos_pages; i++) { - oos_page = kzalloc_obj(*oos_page, GFP_KERNEL); + oos_page = kzalloc_obj(*oos_page); if (!oos_page) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c index ade07397a585..b0d8d3e74ae7 100644 --- a/drivers/gpu/drm/i915/gvt/handlers.c +++ b/drivers/gpu/drm/i915/gvt/handlers.c @@ -2892,7 +2892,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset, return -EEXIST; } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 62da85b3f2ca..8cced31d1d96 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -250,7 +250,7 @@ static int __gvt_cache_add(struct intel_vgpu *vgpu, gfn_t gfn, struct gvt_dma *new, *itr; struct rb_node **link, *parent = NULL; - new = kzalloc_obj(struct gvt_dma, GFP_KERNEL); + new = kzalloc_obj(struct gvt_dma); if (!new) return -ENOMEM; @@ -595,7 +595,7 @@ int intel_gvt_set_edid(struct intel_vgpu *vgpu, int port_num) struct vfio_edid_region *base; int ret; - base = kzalloc_obj(*base, GFP_KERNEL); + base = kzalloc_obj(*base); if (!base) return -ENOMEM; @@ -1829,7 +1829,7 @@ static int intel_gvt_init_device(struct drm_i915_private *i915) if (drm_WARN_ON(&i915->drm, i915->gvt)) return -EEXIST; - gvt = kzalloc_obj(struct intel_gvt, GFP_KERNEL); + gvt = kzalloc_obj(struct intel_gvt); if (!gvt) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/page_track.c b/drivers/gpu/drm/i915/gvt/page_track.c index 862e199e5486..3ecac67b0fc4 100644 --- a/drivers/gpu/drm/i915/gvt/page_track.c +++ b/drivers/gpu/drm/i915/gvt/page_track.c @@ -58,7 +58,7 @@ int intel_vgpu_register_page_track(struct intel_vgpu *vgpu, unsigned long gfn, if (track) return -EEXIST; - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (!track) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c index 21e823113543..b353fedc0ba0 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c @@ -282,7 +282,7 @@ static int tbs_sched_init(struct intel_gvt *gvt) struct gvt_sched_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -312,7 +312,7 @@ static int tbs_sched_init_vgpu(struct intel_vgpu *vgpu) { struct vgpu_sched_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c index 003aacd770e9..a437875a30e3 100644 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@ -113,11 +113,11 @@ int intel_gvt_init_vgpu_types(struct intel_gvt *gvt) unsigned int num_types = ARRAY_SIZE(intel_vgpu_configs); unsigned int i; - gvt->types = kzalloc_objs(struct intel_vgpu_type, num_types, GFP_KERNEL); + gvt->types = kzalloc_objs(struct intel_vgpu_type, num_types); if (!gvt->types) return -ENOMEM; - gvt->mdev_types = kzalloc_objs(*gvt->mdev_types, num_types, GFP_KERNEL); + gvt->mdev_types = kzalloc_objs(*gvt->mdev_types, num_types); if (!gvt->mdev_types) goto out_free_types; diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index 4cbbbe8307a8..25c46d7b1ea7 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -650,7 +650,7 @@ static int __await_barrier(struct i915_active *ref, struct i915_sw_fence *fence) { struct wait_barrier *wb; - wb = kmalloc_obj(*wb, GFP_KERNEL); + wb = kmalloc_obj(*wb); if (unlikely(!wb)) return -ENOMEM; @@ -1160,7 +1160,7 @@ struct i915_active *i915_active_create(void) { struct auto_active *aa; - aa = kmalloc_obj(*aa, GFP_KERNEL); + aa = kmalloc_obj(*aa); if (!aa) return NULL; diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c index 2407414c2ff1..82cbb0528ff1 100644 --- a/drivers/gpu/drm/i915/i915_drm_client.c +++ b/drivers/gpu/drm/i915/i915_drm_client.c @@ -21,7 +21,7 @@ struct i915_drm_client *i915_drm_client_alloc(void) { struct i915_drm_client *client; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return NULL; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6e44b4d633f9..160733619a4a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1319,7 +1319,7 @@ int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file) drm_dbg(&i915->drm, "\n"); - file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv); if (!file_priv) goto err_alloc; diff --git a/drivers/gpu/drm/i915/i915_hdcp_gsc.c b/drivers/gpu/drm/i915/i915_hdcp_gsc.c index 988c4cafa7c6..168b9ccbef3e 100644 --- a/drivers/gpu/drm/i915/i915_hdcp_gsc.c +++ b/drivers/gpu/drm/i915/i915_hdcp_gsc.c @@ -94,7 +94,7 @@ static struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_de struct intel_hdcp_gsc_context *gsc_context; int ret; - gsc_context = kzalloc_obj(*gsc_context, GFP_KERNEL); + gsc_context = kzalloc_obj(*gsc_context); if (!gsc_context) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c index 9d87d58d2385..16e64d752e12 100644 --- a/drivers/gpu/drm/i915/i915_hwmon.c +++ b/drivers/gpu/drm/i915/i915_hwmon.c @@ -915,7 +915,7 @@ void i915_hwmon_register(struct drm_i915_private *i915) if (!IS_DGFX(i915)) return; - hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); + hwmon = kzalloc_obj(*hwmon); if (!hwmon) return; diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 1b11442a3a39..2820e8f0f765 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -2200,7 +2200,7 @@ alloc_oa_config_buffer(struct i915_perf_stream *stream, u32 *cs; int err; - oa_bo = kzalloc_obj(*oa_bo, GFP_KERNEL); + oa_bo = kzalloc_obj(*oa_bo); if (!oa_bo) return ERR_PTR(-ENOMEM); @@ -3872,7 +3872,7 @@ i915_perf_open_ioctl_locked(struct i915_perf *perf, goto err_ctx; } - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) { ret = -ENOMEM; goto err_ctx; @@ -4505,7 +4505,7 @@ static struct i915_oa_reg *alloc_oa_regs(struct i915_perf *perf, if (!is_valid) return ERR_PTR(-EINVAL); - oa_regs = kmalloc_objs(*oa_regs, n_regs, GFP_KERNEL); + oa_regs = kmalloc_objs(*oa_regs, n_regs); if (!oa_regs) return ERR_PTR(-ENOMEM); @@ -4614,7 +4614,7 @@ int i915_perf_add_config_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config); if (!oa_config) { drm_dbg(&perf->i915->drm, "Failed to allocate memory for the OA config\n"); @@ -4910,7 +4910,7 @@ static int oa_init_gt(struct intel_gt *gt) struct i915_perf_group *g; intel_engine_mask_t tmp; - g = kzalloc_objs(*g, num_groups, GFP_KERNEL); + g = kzalloc_objs(*g, num_groups); if (!g) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index d52c1ed69b8e..1c3bafda9c70 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -1028,16 +1028,16 @@ create_event_attributes(struct i915_pmu *pmu) } /* Allocate attribute objects and table. */ - i915_attr = kzalloc_objs(*i915_attr, count, GFP_KERNEL); + i915_attr = kzalloc_objs(*i915_attr, count); if (!i915_attr) goto err_alloc; - pmu_attr = kzalloc_objs(*pmu_attr, count, GFP_KERNEL); + pmu_attr = kzalloc_objs(*pmu_attr, count); if (!pmu_attr) goto err_alloc; /* Max one pointer of each attribute type plus a termination entry. */ - attr = kzalloc_objs(*attr, count * 2 + 1, GFP_KERNEL); + attr = kzalloc_objs(*attr, count * 2 + 1); if (!attr) goto err_alloc; diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c index 101df7236d6c..aec1342402ca 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.c +++ b/drivers/gpu/drm/i915/i915_scheduler.c @@ -453,7 +453,7 @@ i915_sched_engine_create(unsigned int subclass) { struct i915_sched_engine *sched_engine; - sched_engine = kzalloc_obj(*sched_engine, GFP_KERNEL); + sched_engine = kzalloc_obj(*sched_engine); if (!sched_engine) return NULL; diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c index cf79995f1a5b..caceef5ab543 100644 --- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c +++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c @@ -48,7 +48,7 @@ static int i915_ttm_buddy_man_alloc(struct ttm_resource_manager *man, if (!lpfn) lpfn = man->size; - bman_res = kzalloc_obj(*bman_res, GFP_KERNEL); + bman_res = kzalloc_obj(*bman_res); if (!bman_res) return -ENOMEM; @@ -289,7 +289,7 @@ int i915_ttm_buddy_man_init(struct ttm_device *bdev, struct i915_ttm_buddy_manager *bman; int err; - bman = kzalloc_obj(*bman, GFP_KERNEL); + bman = kzalloc_obj(*bman); if (!bman) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 39eb1808fd11..afc192d9931b 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -394,7 +394,7 @@ struct i915_vma_work *i915_vma_work(void) { struct i915_vma_work *vw; - vw = kzalloc_obj(*vw, GFP_KERNEL); + vw = kzalloc_obj(*vw); if (!vw) return NULL; @@ -1027,7 +1027,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info, int i; /* Allocate target SG list. */ - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) goto err_st_alloc; @@ -1237,7 +1237,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info, int i; /* Allocate target SG list. */ - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) goto err_st_alloc; @@ -1275,7 +1275,7 @@ intel_partial_pages(const struct i915_gtt_view *view, unsigned int count = view->partial.size; int ret = -ENOMEM; - st = kmalloc_obj(*st, GFP_KERNEL); + st = kmalloc_obj(*st); if (!st) goto err_st_alloc; diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c index 426355f75db8..35f96ce7822f 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.c +++ b/drivers/gpu/drm/i915/intel_memory_region.c @@ -258,7 +258,7 @@ intel_memory_region_create(struct drm_i915_private *i915, struct intel_memory_region *mem; int err; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index b0d7cc7eb98f..bccedd59a114 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -2072,7 +2072,7 @@ static int __fw_domain_init(struct intel_uncore *uncore, GEM_BUG_ON(domain_id >= FW_DOMAIN_ID_COUNT); GEM_BUG_ON(uncore->fw_domain[domain_id]); - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c index d87d58433307..f7ed4e18a3ab 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c @@ -222,7 +222,7 @@ int intel_pxp_init(struct drm_i915_private *i915) * including session and object management, or we will init the backend tee * channel for internal users such as HuC loading by GSC */ - i915->pxp = kzalloc_obj(*i915->pxp, GFP_KERNEL); + i915->pxp = kzalloc_obj(*i915->pxp); if (!i915->pxp) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c index 3eaee7e8cc65..52345073b409 100644 --- a/drivers/gpu/drm/i915/selftests/i915_active.c +++ b/drivers/gpu/drm/i915/selftests/i915_active.c @@ -66,7 +66,7 @@ static struct live_active *__live_alloc(struct drm_i915_private *i915) { struct live_active *active; - active = kzalloc_obj(*active, GFP_KERNEL); + active = kzalloc_obj(*active); if (!active) return NULL; diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c index 3362421467e8..718cddde7e73 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c @@ -421,7 +421,7 @@ static int igt_evict_contexts(void *arg) struct reserved *r; mutex_unlock(&ggtt->vm.mutex); - r = kzalloc_objs(*r, 1, GFP_KERNEL); + r = kzalloc_objs(*r, 1); mutex_lock(&ggtt->vm.mutex); if (!r) { err = -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c index 411d43acd0d8..e9469e27f42a 100644 --- a/drivers/gpu/drm/i915/selftests/i915_perf.c +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c @@ -21,7 +21,7 @@ alloc_empty_config(struct i915_perf *perf) { struct i915_oa_config *oa_config; - oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config); if (!oa_config) return -ENOMEM; @@ -114,7 +114,7 @@ test_stream(struct i915_perf *perf) props.metrics_set = oa_config->id; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) { i915_oa_config_put(oa_config); return NULL; diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index d1d48ea8d264..f2c304d70c17 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -329,7 +329,7 @@ static void __igt_breadcrumbs_smoketest(struct kthread_work *work) * that the fences were marked as signaled. */ - requests = kzalloc_objs(*requests, total, GFP_KERNEL); + requests = kzalloc_objs(*requests, total); if (!requests) { thread->result = -ENOMEM; return; @@ -472,11 +472,11 @@ static int mock_breadcrumbs_smoketest(void *arg) * See __igt_breadcrumbs_smoketest(); */ - threads = kzalloc_objs(*threads, ncpus, GFP_KERNEL); + threads = kzalloc_objs(*threads, ncpus); if (!threads) return -ENOMEM; - t.contexts = kzalloc_objs(*t.contexts, t.ncontexts, GFP_KERNEL); + t.contexts = kzalloc_objs(*t.contexts, t.ncontexts); if (!t.contexts) { ret = -ENOMEM; goto out_threads; @@ -1203,7 +1203,7 @@ static int live_all_engines(void *arg) * block doing so, and that they don't complete too soon. */ - request = kzalloc_objs(*request, nengines, GFP_KERNEL); + request = kzalloc_objs(*request, nengines); if (!request) return -ENOMEM; @@ -1333,7 +1333,7 @@ static int live_sequential_engines(void *arg) * they are running on independent engines. */ - request = kzalloc_objs(*request, nengines, GFP_KERNEL); + request = kzalloc_objs(*request, nengines); if (!request) return -ENOMEM; @@ -1626,7 +1626,7 @@ static int live_parallel_engines(void *arg) * tests that we load up the system maximally. */ - threads = kzalloc_objs(*threads, nengines, GFP_KERNEL); + threads = kzalloc_objs(*threads, nengines); if (!threads) return -ENOMEM; @@ -1754,13 +1754,13 @@ static int live_breadcrumbs_smoketest(void *arg) goto out_rpm; } - smoke = kzalloc_objs(*smoke, nengines, GFP_KERNEL); + smoke = kzalloc_objs(*smoke, nengines); if (!smoke) { ret = -ENOMEM; goto out_file; } - threads = kzalloc_objs(*threads, ncpus * nengines, GFP_KERNEL); + threads = kzalloc_objs(*threads, ncpus * nengines); if (!threads) { ret = -ENOMEM; goto out_smoke; @@ -2837,7 +2837,7 @@ static int perf_series_engines(void *arg) unsigned int idx; int err = 0; - stats = kzalloc_objs(*stats, nengines, GFP_KERNEL); + stats = kzalloc_objs(*stats, nengines); if (!stats) return -ENOMEM; @@ -3193,7 +3193,7 @@ static int perf_parallel_engines(void *arg) struct p_thread *engines; int err = 0; - engines = kzalloc_objs(*engines, nengines, GFP_KERNEL); + engines = kzalloc_objs(*engines, nengines); if (!engines) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c index 34bcdbaac7c3..6c376338bb37 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -47,7 +47,7 @@ static struct i915_sw_fence *alloc_fence(void) { struct i915_sw_fence *fence; - fence = kmalloc_obj(*fence, GFP_KERNEL); + fence = kmalloc_obj(*fence); if (!fence) return NULL; @@ -454,7 +454,7 @@ static int test_chain(void *arg) int ret, i; /* Test a long chain of fences */ - fences = kmalloc_objs(*fences, nfences, GFP_KERNEL); + fences = kmalloc_objs(*fences, nfences); if (!fences) return -ENOMEM; @@ -639,7 +639,7 @@ static struct dma_fence *alloc_dma_fence(void) { struct dma_fence *dma; - dma = kmalloc_obj(*dma, GFP_KERNEL); + dma = kmalloc_obj(*dma); if (dma) dma_fence_init(dma, &mock_fence_ops, &mock_fence_lock, 0, 0); diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index d6b4796fde82..210b9f8f7b61 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -148,7 +148,7 @@ struct drm_i915_private *mock_gem_device(void) struct pci_dev *pdev; int ret; - pdev = kzalloc_obj(*pdev, GFP_KERNEL); + pdev = kzalloc_obj(*pdev); if (!pdev) return NULL; device_initialize(&pdev->dev); diff --git a/drivers/gpu/drm/i915/selftests/mock_gtt.c b/drivers/gpu/drm/i915/selftests/mock_gtt.c index 1b13502add8a..933990a8dc52 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gtt.c +++ b/drivers/gpu/drm/i915/selftests/mock_gtt.c @@ -66,7 +66,7 @@ struct i915_ppgtt *mock_ppgtt(struct drm_i915_private *i915, const char *name) { struct i915_ppgtt *ppgtt; - ppgtt = kzalloc_obj(*ppgtt, GFP_KERNEL); + ppgtt = kzalloc_obj(*ppgtt); if (!ppgtt) return NULL; diff --git a/drivers/gpu/drm/i915/vlv_suspend.c b/drivers/gpu/drm/i915/vlv_suspend.c index b5360ddc34e7..dac4b9bac743 100644 --- a/drivers/gpu/drm/i915/vlv_suspend.c +++ b/drivers/gpu/drm/i915/vlv_suspend.c @@ -464,7 +464,7 @@ int vlv_suspend_init(struct drm_i915_private *i915) return 0; /* we write all the values in the struct, so no need to zero it out */ - i915->vlv_s0ix_state = kmalloc_obj(*i915->vlv_s0ix_state, GFP_KERNEL); + i915->vlv_s0ix_state = kmalloc_obj(*i915->vlv_s0ix_state); if (!i915->vlv_s0ix_state) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_ccb.c b/drivers/gpu/drm/imagination/pvr_ccb.c index 998b9ceb54ca..00c236d24acc 100644 --- a/drivers/gpu/drm/imagination/pvr_ccb.c +++ b/drivers/gpu/drm/imagination/pvr_ccb.c @@ -543,7 +543,7 @@ struct dma_fence *pvr_kccb_fence_alloc(void) { struct pvr_kccb_fence *kccb_fence; - kccb_fence = kzalloc_obj(*kccb_fence, GFP_KERNEL); + kccb_fence = kzalloc_obj(*kccb_fence); if (!kccb_fence) return NULL; diff --git a/drivers/gpu/drm/imagination/pvr_context.c b/drivers/gpu/drm/imagination/pvr_context.c index 1aa4f098f93d..8de70c30b9de 100644 --- a/drivers/gpu/drm/imagination/pvr_context.c +++ b/drivers/gpu/drm/imagination/pvr_context.c @@ -292,7 +292,7 @@ int pvr_context_create(struct pvr_file *pvr_file, struct drm_pvr_ioctl_create_co if (ctx_size < 0) return ctx_size; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c index b6171d10e8ac..268900464ab6 100644 --- a/drivers/gpu/drm/imagination/pvr_drv.c +++ b/drivers/gpu/drm/imagination/pvr_drv.c @@ -1312,7 +1312,7 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file) struct pvr_device *pvr_dev = to_pvr_device(drm_dev); struct pvr_file *pvr_file; - pvr_file = kzalloc_obj(*pvr_file, GFP_KERNEL); + pvr_file = kzalloc_obj(*pvr_file); if (!pvr_file) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_free_list.c b/drivers/gpu/drm/imagination/pvr_free_list.c index cfcfbd89052a..e85cac83834c 100644 --- a/drivers/gpu/drm/imagination/pvr_free_list.c +++ b/drivers/gpu/drm/imagination/pvr_free_list.c @@ -307,7 +307,7 @@ pvr_free_list_grow(struct pvr_free_list *free_list, u32 num_pages) goto err_unlock; } - free_list_node = kzalloc_obj(*free_list_node, GFP_KERNEL); + free_list_node = kzalloc_obj(*free_list_node); if (!free_list_node) { err = -ENOMEM; goto err_unlock; @@ -415,7 +415,7 @@ pvr_free_list_create(struct pvr_file *pvr_file, int err; /* Create and fill out the kernel structure */ - free_list = kzalloc_obj(*free_list, GFP_KERNEL); + free_list = kzalloc_obj(*free_list); if (!free_list) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_fw.c b/drivers/gpu/drm/imagination/pvr_fw.c index 1cbbaff3e7bf..288516dc2560 100644 --- a/drivers/gpu/drm/imagination/pvr_fw.c +++ b/drivers/gpu/drm/imagination/pvr_fw.c @@ -1272,7 +1272,7 @@ pvr_fw_object_create_and_map_common(struct pvr_device *pvr_dev, size_t size, /* %DRM_PVR_BO_PM_FW_PROTECT is implicit for FW objects. */ flags |= DRM_PVR_BO_PM_FW_PROTECT; - fw_obj = kzalloc_obj(*fw_obj, GFP_KERNEL); + fw_obj = kzalloc_obj(*fw_obj); if (!fw_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_fw_trace.c b/drivers/gpu/drm/imagination/pvr_fw_trace.c index f2c92a3b3a94..e154cb35f604 100644 --- a/drivers/gpu/drm/imagination/pvr_fw_trace.c +++ b/drivers/gpu/drm/imagination/pvr_fw_trace.c @@ -455,7 +455,7 @@ static int fw_trace_open(struct inode *inode, struct file *file) struct pvr_fw_trace_seq_data *trace_seq_data; int err; - trace_seq_data = kzalloc_obj(*trace_seq_data, GFP_KERNEL); + trace_seq_data = kzalloc_obj(*trace_seq_data); if (!trace_seq_data) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_gem.c b/drivers/gpu/drm/imagination/pvr_gem.c index 7a4e8ec92e1e..686a3fe22986 100644 --- a/drivers/gpu/drm/imagination/pvr_gem.c +++ b/drivers/gpu/drm/imagination/pvr_gem.c @@ -314,7 +314,7 @@ struct drm_gem_object *pvr_gem_create_object(struct drm_device *drm_dev, size_t struct drm_gem_object *gem_obj; struct pvr_gem_object *pvr_obj; - pvr_obj = kzalloc_obj(*pvr_obj, GFP_KERNEL); + pvr_obj = kzalloc_obj(*pvr_obj); if (!pvr_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_hwrt.c b/drivers/gpu/drm/imagination/pvr_hwrt.c index 93ea3c8ee176..05c68c78da22 100644 --- a/drivers/gpu/drm/imagination/pvr_hwrt.c +++ b/drivers/gpu/drm/imagination/pvr_hwrt.c @@ -457,7 +457,7 @@ pvr_hwrt_dataset_create(struct pvr_file *pvr_file, int err, i = 0; /* Create and fill out the kernel structure */ - hwrt = kzalloc_obj(*hwrt, GFP_KERNEL); + hwrt = kzalloc_obj(*hwrt); if (!hwrt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_job.c b/drivers/gpu/drm/imagination/pvr_job.c index a4e550505504..0c2f511a6178 100644 --- a/drivers/gpu/drm/imagination/pvr_job.c +++ b/drivers/gpu/drm/imagination/pvr_job.c @@ -415,7 +415,7 @@ create_job(struct pvr_device *pvr_dev, (args->hwrt.set_handle || args->hwrt.data_index)) return ERR_PTR(-EINVAL); - job = kzalloc_obj(*job, GFP_KERNEL); + job = kzalloc_obj(*job); if (!job) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_mmu.c b/drivers/gpu/drm/imagination/pvr_mmu.c index 4d35879a344b..2e4da5b2c499 100644 --- a/drivers/gpu/drm/imagination/pvr_mmu.c +++ b/drivers/gpu/drm/imagination/pvr_mmu.c @@ -1828,7 +1828,7 @@ pvr_page_table_l0_get_or_insert(struct pvr_mmu_op_context *op_ctx, */ struct pvr_mmu_context *pvr_mmu_context_create(struct pvr_device *pvr_dev) { - struct pvr_mmu_context *ctx = kzalloc_obj(*ctx, GFP_KERNEL); + struct pvr_mmu_context *ctx = kzalloc_obj(*ctx); int err; if (!ctx) @@ -1877,7 +1877,7 @@ pvr_page_table_l1_alloc(struct pvr_mmu_context *ctx) { int err; - struct pvr_page_table_l1 *table = kzalloc_obj(*table, GFP_KERNEL); + struct pvr_page_table_l1 *table = kzalloc_obj(*table); if (!table) return ERR_PTR(-ENOMEM); @@ -1905,7 +1905,7 @@ pvr_page_table_l0_alloc(struct pvr_mmu_context *ctx) { int err; - struct pvr_page_table_l0 *table = kzalloc_obj(*table, GFP_KERNEL); + struct pvr_page_table_l0 *table = kzalloc_obj(*table); if (!table) return ERR_PTR(-ENOMEM); @@ -2350,7 +2350,7 @@ pvr_mmu_op_context_create(struct pvr_mmu_context *ctx, struct sg_table *sgt, { int err; - struct pvr_mmu_op_context *op_ctx = kzalloc_obj(*op_ctx, GFP_KERNEL); + struct pvr_mmu_op_context *op_ctx = kzalloc_obj(*op_ctx); if (!op_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_power.c b/drivers/gpu/drm/imagination/pvr_power.c index c70a62192d79..0cf7393f89c6 100644 --- a/drivers/gpu/drm/imagination/pvr_power.c +++ b/drivers/gpu/drm/imagination/pvr_power.c @@ -614,11 +614,11 @@ int pvr_power_domains_init(struct pvr_device *pvr_dev) link_count = domain_count + (domain_count - 1); - domain_devs = kzalloc_objs(*domain_devs, domain_count, GFP_KERNEL); + domain_devs = kzalloc_objs(*domain_devs, domain_count); if (!domain_devs) return -ENOMEM; - domain_links = kzalloc_objs(*domain_links, link_count, GFP_KERNEL); + domain_links = kzalloc_objs(*domain_links, link_count); if (!domain_links) return -ENOMEM; diff --git a/drivers/gpu/drm/imagination/pvr_queue.c b/drivers/gpu/drm/imagination/pvr_queue.c index 12f759c17f93..dd88949f6194 100644 --- a/drivers/gpu/drm/imagination/pvr_queue.c +++ b/drivers/gpu/drm/imagination/pvr_queue.c @@ -249,7 +249,7 @@ pvr_queue_fence_alloc(void) { struct pvr_queue_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; @@ -1266,7 +1266,7 @@ struct pvr_queue *pvr_queue_create(struct pvr_context *ctx, if (ctx_state_size < 0) return ERR_PTR(ctx_state_size); - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_sync.c b/drivers/gpu/drm/imagination/pvr_sync.c index b5268c9b885b..3582616ff722 100644 --- a/drivers/gpu/drm/imagination/pvr_sync.c +++ b/drivers/gpu/drm/imagination/pvr_sync.c @@ -64,7 +64,7 @@ pvr_sync_signal_array_add(struct xarray *array, struct drm_file *file, u32 handl int err; u32 id; - sig_sync = kzalloc_obj(*sig_sync, GFP_KERNEL); + sig_sync = kzalloc_obj(*sig_sync); if (!sig_sync) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c index e482bfc00576..e1ec60f34b6e 100644 --- a/drivers/gpu/drm/imagination/pvr_vm.c +++ b/drivers/gpu/drm/imagination/pvr_vm.c @@ -261,9 +261,9 @@ pvr_vm_bind_op_map_init(struct pvr_vm_bind_op *bind_op, if (IS_ERR(bind_op->gpuvm_bo)) return PTR_ERR(bind_op->gpuvm_bo); - bind_op->new_va = kzalloc_obj(*bind_op->new_va, GFP_KERNEL); - bind_op->prev_va = kzalloc_obj(*bind_op->prev_va, GFP_KERNEL); - bind_op->next_va = kzalloc_obj(*bind_op->next_va, GFP_KERNEL); + bind_op->new_va = kzalloc_obj(*bind_op->new_va); + bind_op->prev_va = kzalloc_obj(*bind_op->prev_va); + bind_op->next_va = kzalloc_obj(*bind_op->next_va); if (!bind_op->new_va || !bind_op->prev_va || !bind_op->next_va) { err = -ENOMEM; goto err_bind_op_fini; @@ -310,8 +310,8 @@ pvr_vm_bind_op_unmap_init(struct pvr_vm_bind_op *bind_op, bind_op->type = PVR_VM_BIND_TYPE_UNMAP; - bind_op->prev_va = kzalloc_obj(*bind_op->prev_va, GFP_KERNEL); - bind_op->next_va = kzalloc_obj(*bind_op->next_va, GFP_KERNEL); + bind_op->prev_va = kzalloc_obj(*bind_op->prev_va); + bind_op->next_va = kzalloc_obj(*bind_op->next_va); if (!bind_op->prev_va || !bind_op->next_va) { err = -ENOMEM; goto err_bind_op_fini; @@ -565,7 +565,7 @@ pvr_vm_create_context(struct pvr_device *pvr_dev, bool is_userspace_context) return ERR_PTR(-EINVAL); } - vm_ctx = kzalloc_obj(*vm_ctx, GFP_KERNEL); + vm_ctx = kzalloc_obj(*vm_ctx); if (!vm_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index 07bc2044f76a..c014ef70dfd1 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -381,7 +381,7 @@ struct dcss_plane *dcss_plane_init(struct drm_device *drm, if (zpos > 2) return ERR_PTR(-EINVAL); - dcss_plane = kzalloc_obj(*dcss_plane, GFP_KERNEL); + dcss_plane = kzalloc_obj(*dcss_plane); if (!dcss_plane) { DRM_ERROR("failed to allocate plane\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c index eeff0d535b02..a18b9d1a68b6 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c @@ -117,7 +117,7 @@ static void imx_drm_crtc_reset(struct drm_crtc *crtc) kfree(to_imx_crtc_state(crtc->state)); crtc->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -126,7 +126,7 @@ static struct drm_crtc_state *imx_drm_crtc_duplicate_state(struct drm_crtc *crtc { struct imx_crtc_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c index 0b58871277d7..0ea70b8fd743 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c @@ -308,7 +308,7 @@ static void ipu_plane_state_reset(struct drm_plane *plane) plane->state = NULL; } - ipu_state = kzalloc_obj(*ipu_state, GFP_KERNEL); + ipu_state = kzalloc_obj(*ipu_state); if (ipu_state) __drm_atomic_helper_plane_reset(plane, &ipu_state->base); @@ -322,7 +322,7 @@ ipu_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (state) __drm_atomic_helper_plane_duplicate_state(plane, &state->base); diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index e82cbb92faee..dea85577513a 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -66,7 +66,7 @@ imx_pd_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, } *num_output_fmts = 1; - output_fmts = kmalloc_obj(*output_fmts, GFP_KERNEL); + output_fmts = kmalloc_obj(*output_fmts); if (!output_fmts) return NULL; @@ -117,7 +117,7 @@ imx_pd_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, } *num_input_fmts = 1; - input_fmts = kmalloc_obj(*input_fmts, GFP_KERNEL); + input_fmts = kmalloc_obj(*input_fmts); if (!input_fmts) return NULL; diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 6273058b1bee..6601589339f6 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -923,7 +923,7 @@ ingenic_drm_gem_create_object(struct drm_device *drm, size_t size) struct ingenic_drm *priv = drm_device_get_priv(drm); struct drm_gem_dma_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); @@ -1387,7 +1387,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_devclk_disable; } - private_state = kzalloc_obj(*private_state, GFP_KERNEL); + private_state = kzalloc_obj(*private_state); if (!private_state) { ret = -ENOMEM; goto err_clk_notifier_unregister; diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 88b6b406e796..289274f464ba 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -887,7 +887,7 @@ static int ingenic_ipu_bind(struct device *dev, struct device *master, void *d) return err; } - private_state = kzalloc_obj(*private_state, GFP_KERNEL); + private_state = kzalloc_obj(*private_state); if (!private_state) { err = -ENOMEM; goto err_clk_unprepare; diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c index 1d2ce15d703a..aeb2f9f98f23 100644 --- a/drivers/gpu/drm/kmb/kmb_dsi.c +++ b/drivers/gpu/drm/kmb/kmb_dsi.c @@ -220,14 +220,14 @@ int kmb_dsi_host_bridge_init(struct device *dev) /* Create and register MIPI DSI host */ if (!dsi_host) { - dsi_host = kzalloc_obj(*dsi_host, GFP_KERNEL); + dsi_host = kzalloc_obj(*dsi_host); if (!dsi_host) return -ENOMEM; dsi_host->ops = &kmb_dsi_host_ops; if (!dsi_device) { - dsi_device = kzalloc_obj(*dsi_device, GFP_KERNEL); + dsi_device = kzalloc_obj(*dsi_device); if (!dsi_device) { kfree(dsi_host); return -ENOMEM; diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c index edcd3733dd95..68ede7a725e2 100644 --- a/drivers/gpu/drm/lima/lima_ctx.c +++ b/drivers/gpu/drm/lima/lima_ctx.c @@ -12,7 +12,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id) struct lima_ctx *ctx; int i, err; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c index f2bdf0d1b2fc..9a0eb1092ad3 100644 --- a/drivers/gpu/drm/lima/lima_drv.c +++ b/drivers/gpu/drm/lima/lima_drv.c @@ -215,7 +215,7 @@ static int lima_drm_driver_open(struct drm_device *dev, struct drm_file *file) struct lima_drm_priv *priv; struct lima_device *ldev = to_lima_dev(dev); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index bed7945d8440..0c73860bb501 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -73,7 +73,7 @@ int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm) dma_unmap_sgtable(dev, bo->base.sgt, DMA_BIDIRECTIONAL, 0); sg_free_table(bo->base.sgt); } else { - bo->base.sgt = kmalloc_obj(*bo->base.sgt, GFP_KERNEL); + bo->base.sgt = kmalloc_obj(*bo->base.sgt); if (!bo->base.sgt) { ret = -ENOMEM; goto err_out0; @@ -226,7 +226,7 @@ struct drm_gem_object *lima_gem_create_object(struct drm_device *dev, size_t siz { struct lima_bo *bo; - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/lima/lima_vm.c b/drivers/gpu/drm/lima/lima_vm.c index 5db2a1ad1983..c1b75b15c260 100644 --- a/drivers/gpu/drm/lima/lima_vm.c +++ b/drivers/gpu/drm/lima/lima_vm.c @@ -109,7 +109,7 @@ int lima_vm_bo_add(struct lima_vm *vm, struct lima_bo *bo, bool create) return -ENOENT; } - bo_va = kzalloc_obj(*bo_va, GFP_KERNEL); + bo_va = kzalloc_obj(*bo_va); if (!bo_va) { err = -ENOMEM; goto err_out0; @@ -201,7 +201,7 @@ struct lima_vm *lima_vm_create(struct lima_device *dev) { struct lima_vm *vm; - vm = kzalloc_obj(*vm, GFP_KERNEL); + vm = kzalloc_obj(*vm); if (!vm) return NULL; diff --git a/drivers/gpu/drm/loongson/lsdc_crtc.c b/drivers/gpu/drm/loongson/lsdc_crtc.c index 32ef0f3826ac..587fbe285e9e 100644 --- a/drivers/gpu/drm/loongson/lsdc_crtc.c +++ b/drivers/gpu/drm/loongson/lsdc_crtc.c @@ -397,7 +397,7 @@ static void lsdc_crtc_reset(struct drm_crtc *crtc) if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); - priv_crtc_state = kzalloc_obj(*priv_crtc_state, GFP_KERNEL); + priv_crtc_state = kzalloc_obj(*priv_crtc_state); if (!priv_crtc_state) __drm_atomic_helper_crtc_reset(crtc, NULL); @@ -424,7 +424,7 @@ lsdc_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct lsdc_crtc_state *new_priv_state; struct lsdc_crtc_state *old_priv_state; - new_priv_state = kzalloc_obj(*new_priv_state, GFP_KERNEL); + new_priv_state = kzalloc_obj(*new_priv_state); if (!new_priv_state) return NULL; diff --git a/drivers/gpu/drm/loongson/lsdc_gfxpll.c b/drivers/gpu/drm/loongson/lsdc_gfxpll.c index 984ee165cacb..2daa62e72fda 100644 --- a/drivers/gpu/drm/loongson/lsdc_gfxpll.c +++ b/drivers/gpu/drm/loongson/lsdc_gfxpll.c @@ -178,7 +178,7 @@ int loongson_gfxpll_create(struct drm_device *ddev, struct loongson_gfxpll *this; int ret; - this = kzalloc_obj(*this, GFP_KERNEL); + this = kzalloc_obj(*this); if (IS_ERR_OR_NULL(this)) return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_i2c.c b/drivers/gpu/drm/loongson/lsdc_i2c.c index 5ed314a76dde..b5ff68866f02 100644 --- a/drivers/gpu/drm/loongson/lsdc_i2c.c +++ b/drivers/gpu/drm/loongson/lsdc_i2c.c @@ -124,7 +124,7 @@ int lsdc_create_i2c_chan(struct drm_device *ddev, struct lsdc_i2c *li2c; int ret; - li2c = kzalloc_obj(*li2c, GFP_KERNEL); + li2c = kzalloc_obj(*li2c); if (!li2c) return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_pixpll.c b/drivers/gpu/drm/loongson/lsdc_pixpll.c index d9c9de7b5de0..41131a74056f 100644 --- a/drivers/gpu/drm/loongson/lsdc_pixpll.c +++ b/drivers/gpu/drm/loongson/lsdc_pixpll.c @@ -124,7 +124,7 @@ static int lsdc_pixel_pll_setup(struct lsdc_pixpll * const this) if (!this->mmio) return -ENOMEM; - pparms = kzalloc_obj(*pparms, GFP_KERNEL); + pparms = kzalloc_obj(*pparms); if (!pparms) { iounmap(this->mmio); return -ENOMEM; diff --git a/drivers/gpu/drm/loongson/lsdc_ttm.c b/drivers/gpu/drm/loongson/lsdc_ttm.c index 3404e18e87b4..d7441d96a0dc 100644 --- a/drivers/gpu/drm/loongson/lsdc_ttm.c +++ b/drivers/gpu/drm/loongson/lsdc_ttm.c @@ -96,7 +96,7 @@ lsdc_ttm_tt_create(struct ttm_buffer_object *tbo, uint32_t page_flags) struct ttm_tt *tt; int ret; - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); if (!tt) return NULL; @@ -441,7 +441,7 @@ struct lsdc_bo *lsdc_bo_create(struct drm_device *ddev, enum ttm_bo_type bo_type; int ret; - lbo = kzalloc_obj(*lbo, GFP_KERNEL); + lbo = kzalloc_obj(*lbo); if (!lbo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c index 1c1459a4af13..351d58c50b84 100644 --- a/drivers/gpu/drm/mediatek/mtk_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c @@ -160,7 +160,7 @@ static void mtk_crtc_reset(struct drm_crtc *crtc) kfree(to_mtk_crtc_state(crtc->state)); crtc->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -169,7 +169,7 @@ static struct drm_crtc_state *mtk_crtc_duplicate_state(struct drm_crtc *crtc) { struct mtk_crtc_state *state; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 08d954e412d1..08c4d64b87b9 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2482,7 +2482,7 @@ static u32 *mtk_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, u32 *output_fmts; *num_output_fmts = 0; - output_fmts = kmalloc_obj(*output_fmts, GFP_KERNEL); + output_fmts = kmalloc_obj(*output_fmts); if (!output_fmts) return NULL; *num_output_fmts = 1; diff --git a/drivers/gpu/drm/mediatek/mtk_gem.c b/drivers/gpu/drm/mediatek/mtk_gem.c index 5f7e50ff70ae..f059a1452220 100644 --- a/drivers/gpu/drm/mediatek/mtk_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_gem.c @@ -50,7 +50,7 @@ static struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj) struct sg_table *sgt; int ret; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); @@ -85,7 +85,7 @@ static struct drm_gem_dma_object *mtk_gem_init(struct drm_device *dev, if (size == 0) return ERR_PTR(-EINVAL); - dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj); if (!dma_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c index 60c35d3cbb9b..86c6f60eadb3 100644 --- a/drivers/gpu/drm/mediatek/mtk_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_plane.c @@ -35,7 +35,7 @@ static void mtk_plane_reset(struct drm_plane *plane) state = to_mtk_plane_state(plane->state); memset(state, 0, sizeof(*state)); } else { - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return; } @@ -52,7 +52,7 @@ static struct drm_plane_state *mtk_plane_duplicate_state(struct drm_plane *plane struct mtk_plane_state *old_state = to_mtk_plane_state(plane->state); struct mtk_plane_state *state; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index fe7451ff4ea4..4387d5f5898f 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -697,7 +697,7 @@ void mgag200_crtc_reset(struct drm_crtc *crtc) if (crtc->state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); - mgag200_crtc_state = kzalloc_obj(*mgag200_crtc_state, GFP_KERNEL); + mgag200_crtc_state = kzalloc_obj(*mgag200_crtc_state); if (mgag200_crtc_state) __drm_atomic_helper_crtc_reset(crtc, &mgag200_crtc_state->base); else diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c index 9cf06fd3a21e..d5a5fa9e2cf8 100644 --- a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c @@ -457,7 +457,7 @@ static void a2xx_dump(struct msm_gpu *gpu) static struct msm_gpu_state *a2xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); @@ -509,7 +509,7 @@ static struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) goto fail; } - a2xx_gpu = kzalloc_obj(*a2xx_gpu, GFP_KERNEL); + a2xx_gpu = kzalloc_obj(*a2xx_gpu); if (!a2xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c index 4e8148497295..d77b4774d414 100644 --- a/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +++ b/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c @@ -95,7 +95,7 @@ struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu) { struct a2xx_gpummu *gpummu; - gpummu = kzalloc_obj(*gpummu, GFP_KERNEL); + gpummu = kzalloc_obj(*gpummu); if (!gpummu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index 5d47f8c0b7ea..018183e0ac3f 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -480,7 +480,7 @@ static void a3xx_dump(struct msm_gpu *gpu) static struct msm_gpu_state *a3xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); @@ -533,7 +533,7 @@ static struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) goto fail; } - a3xx_gpu = kzalloc_obj(*a3xx_gpu, GFP_KERNEL); + a3xx_gpu = kzalloc_obj(*a3xx_gpu); if (!a3xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c index e44e45ce0714..8464d89e37f3 100644 --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c @@ -550,7 +550,7 @@ static const unsigned int a405_registers[] = { static struct msm_gpu_state *a4xx_gpu_state_get(struct msm_gpu *gpu) { - struct msm_gpu_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct msm_gpu_state *state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); @@ -645,7 +645,7 @@ static struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) goto fail; } - a4xx_gpu = kzalloc_obj(*a4xx_gpu, GFP_KERNEL); + a4xx_gpu = kzalloc_obj(*a4xx_gpu); if (!a4xx_gpu) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 66e6b828cb84..ef9fd6171af7 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1570,7 +1570,7 @@ static void a5xx_gpu_state_get_hlsq_regs(struct msm_gpu *gpu, static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu) { - struct a5xx_gpu_state *a5xx_state = kzalloc_obj(*a5xx_state, GFP_KERNEL); + struct a5xx_gpu_state *a5xx_state = kzalloc_obj(*a5xx_state); bool stalled = !!(gpu_read(gpu, REG_A5XX_RBBM_STATUS3) & BIT(24)); if (!a5xx_state) @@ -1734,7 +1734,7 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) unsigned int nr_rings; int ret; - a5xx_gpu = kzalloc_obj(*a5xx_gpu, GFP_KERNEL); + a5xx_gpu = kzalloc_obj(*a5xx_gpu); if (!a5xx_gpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index b8cc33fe7279..d6dfe6337bc3 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2648,7 +2648,7 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) bool is_a7xx; int ret, nr_rings = 1; - a6xx_gpu = kzalloc_obj(*a6xx_gpu, GFP_KERNEL); + a6xx_gpu = kzalloc_obj(*a6xx_gpu); if (!a6xx_gpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c index 40933f4d2424..2d56fe0a65b7 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c @@ -1584,7 +1584,7 @@ struct msm_gpu_state *a6xx_gpu_state_get(struct msm_gpu *gpu) struct a6xx_crashdumper _dumper = { 0 }, *dumper = NULL; struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); - struct a6xx_gpu_state *a6xx_state = kzalloc_obj(*a6xx_state, GFP_KERNEL); + struct a6xx_gpu_state *a6xx_state = kzalloc_obj(*a6xx_state); bool stalled; if (!a6xx_state) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 39c1165c93a7..0f4921b1a892 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -887,7 +887,7 @@ static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc) if (!state->gamma_lut) { dspp->ops.setup_gc(dspp, NULL); } else { - gc_lut = kzalloc_obj(*gc_lut, GFP_KERNEL); + gc_lut = kzalloc_obj(*gc_lut); if (!gc_lut) continue; _dpu_crtc_get_gc_lut(state, gc_lut); @@ -1146,7 +1146,7 @@ end: static void dpu_crtc_reset(struct drm_crtc *crtc) { - struct dpu_crtc_state *cstate = kzalloc_obj(*cstate, GFP_KERNEL); + struct dpu_crtc_state *cstate = kzalloc_obj(*cstate); if (crtc->state) dpu_crtc_destroy_state(crtc, crtc->state); @@ -1343,7 +1343,7 @@ static int dpu_crtc_reassign_planes(struct drm_crtc *crtc, struct drm_crtc_state if (!crtc_state->enable) return 0; - states = kzalloc_objs(*states, total_planes, GFP_KERNEL); + states = kzalloc_objs(*states, total_planes); if (!states) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 35986cefbf8b..61d7e65469b3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -385,7 +385,7 @@ static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms) { struct dpu_global_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 59c44cce6753..547d084f2944 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1684,7 +1684,7 @@ static void dpu_plane_reset(struct drm_plane *plane) plane->state = NULL; } - pstate = kzalloc_obj(*pstate, GFP_KERNEL); + pstate = kzalloc_obj(*pstate); if (!pstate) { DPU_ERROR_PLANE(pdpu, "failed to allocate state\n"); return; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 743517e29626..8bb503e0f962 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -133,7 +133,7 @@ static int mdp5_global_obj_init(struct mdp5_kms *mdp5_kms) { struct mdp5_global_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 83088fd8f910..c4624a49b32f 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -89,7 +89,7 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); plane->state = NULL; - mdp5_state = kzalloc_obj(*mdp5_state, GFP_KERNEL); + mdp5_state = kzalloc_obj(*mdp5_state); if (!mdp5_state) return; __drm_atomic_helper_plane_reset(plane, &mdp5_state->base); diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c index 60af5c02973f..d99771684728 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.c @@ -36,7 +36,7 @@ msm_disp_snapshot_state_sync(struct msm_kms *kms) WARN_ON(!mutex_is_locked(&kms->dump_mutex)); - disp_state = kzalloc_obj(struct msm_disp_state, GFP_KERNEL); + disp_state = kzalloc_obj(struct msm_disp_state); if (!disp_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c index fdb8ca642794..427d3ee2b833 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -172,7 +172,7 @@ void msm_disp_snapshot_add_block(struct msm_disp_state *disp_state, u32 len, struct va_format vaf; va_list va; - new_blk = kzalloc_obj(struct msm_disp_state_block, GFP_KERNEL); + new_blk = kzalloc_obj(struct msm_disp_state_block); if (!new_blk) return; diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index 00c36fa75c5c..ef298c7d3e5e 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -921,7 +921,7 @@ static void _dp_ctrl_calc_tu(struct msm_dp_ctrl_private *ctrl, uint EXTRA_PIXCLK_CYCLE_DELAY = 4; uint HBLANK_MARGIN = 4; - tu = kzalloc_obj(*tu, GFP_KERNEL); + tu = kzalloc_obj(*tu); if (!tu) return; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c index c59c7b4c3ee0..8fb5497aac9f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c @@ -1400,7 +1400,7 @@ struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi) return ERR_PTR(-EINVAL); } - hdcp_ctrl = kzalloc_obj(*hdcp_ctrl, GFP_KERNEL); + hdcp_ctrl = kzalloc_obj(*hdcp_ctrl); if (!hdcp_ctrl) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index 020b2f432b38..6b9265159195 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -246,7 +246,7 @@ struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) struct i2c_adapter *i2c = NULL; int ret; - hdmi_i2c = kzalloc_obj(*hdmi_i2c, GFP_KERNEL); + hdmi_i2c = kzalloc_obj(*hdmi_i2c); if (!hdmi_i2c) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 785172f5d74f..1059a9b29d6a 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -76,7 +76,7 @@ static int msm_gpu_open(struct inode *inode, struct file *file) if (!gpu || !gpu->funcs->gpu_state_get) return -ENODEV; - show_priv = kmalloc_obj(*show_priv, GFP_KERNEL); + show_priv = kmalloc_obj(*show_priv); if (!show_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 2fc0fa82a275..e5ab1e28851d 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -247,7 +247,7 @@ static int context_init(struct drm_device *dev, struct drm_file *file) static atomic_t ident = ATOMIC_INIT(0); struct msm_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c index d784d1773dee..b3fdb83202ab 100644 --- a/drivers/gpu/drm/msm/msm_fb.c +++ b/drivers/gpu/drm/msm/msm_fb.c @@ -194,7 +194,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, goto fail; } - msm_fb = kzalloc_obj(*msm_fb, GFP_KERNEL); + msm_fb = kzalloc_obj(*msm_fb); if (!msm_fb) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c index eafd52f03d17..3dca8e09c192 100644 --- a/drivers/gpu/drm/msm/msm_fence.c +++ b/drivers/gpu/drm/msm/msm_fence.c @@ -46,7 +46,7 @@ msm_fence_context_alloc(struct drm_device *dev, volatile uint32_t *fenceptr, struct msm_fence_context *fctx; static int index = 0; - fctx = kzalloc_obj(*fctx, GFP_KERNEL); + fctx = kzalloc_obj(*fctx); if (!fctx) return ERR_PTR(-ENOMEM); @@ -176,7 +176,7 @@ msm_fence_alloc(void) { struct msm_fence *f; - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 5d4ab1900984..b27abaa13926 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -1215,7 +1215,7 @@ static int msm_gem_new_impl(struct drm_device *dev, uint32_t flags, return -EINVAL; } - msm_obj = kzalloc_obj(*msm_obj, GFP_KERNEL); + msm_obj = kzalloc_obj(*msm_obj); if (!msm_obj) return -ENOMEM; @@ -1301,7 +1301,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, msm_obj = to_msm_bo(obj); msm_gem_lock(obj); msm_obj->sgt = sgt; - msm_obj->pages = kvmalloc_objs(struct page *, npages, GFP_KERNEL); + msm_obj->pages = kvmalloc_objs(struct page *, npages); if (!msm_obj->pages) { msm_gem_unlock(obj); ret = -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index 3c43e27ce553..adf88cf8f41a 100644 --- a/drivers/gpu/drm/msm/msm_gem_vma.c +++ b/drivers/gpu/drm/msm/msm_gem_vma.c @@ -375,7 +375,7 @@ msm_gem_vma_new(struct drm_gpuvm *gpuvm, struct drm_gem_object *obj, drm_gpuvm_resv_assert_held(&vm->base); - vma = kzalloc_obj(*vma, GFP_KERNEL); + vma = kzalloc_obj(*vma); if (!vma) return ERR_PTR(-ENOMEM); @@ -465,7 +465,7 @@ struct op_arg { static int vm_op_enqueue(struct op_arg *arg, struct msm_vm_op _op) { - struct msm_vm_op *op = kmalloc_obj(*op, GFP_KERNEL); + struct msm_vm_op *op = kmalloc_obj(*op); if (!op) return -ENOMEM; @@ -819,7 +819,7 @@ msm_gem_vm_create(struct drm_device *drm, struct msm_mmu *mmu, const char *name, if (IS_ERR(mmu)) return ERR_CAST(mmu); - vm = kzalloc_obj(*vm, GFP_KERNEL); + vm = kzalloc_obj(*vm); if (!vm) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 24f164a04f59..84d6c7f50c8d 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -346,7 +346,7 @@ static void crashstate_get_vm_logs(struct msm_gpu_state *state, struct msm_gem_v state->nr_vm_logs = vm_log_len; } - state->vm_logs = kmalloc_objs(vm->log[0], state->nr_vm_logs, GFP_KERNEL); + state->vm_logs = kmalloc_objs(vm->log[0], state->nr_vm_logs); if (!state->vm_logs) { state->nr_vm_logs = 0; } diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index 425ae5eb9af3..7d449e5202c5 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -332,7 +332,7 @@ msm_iommu_pagetable_prealloc_allocate(struct msm_mmu *mmu, struct msm_mmu_preall struct kmem_cache *pt_cache = get_pt_cache(mmu); int ret; - p->pages = kvmalloc_objs(*p->pages, p->count, GFP_KERNEL); + p->pages = kvmalloc_objs(*p->pages, p->count); if (!p->pages) return -ENOMEM; @@ -521,7 +521,7 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent, bool kernel_m if (WARN_ONCE(!ttbr1_cfg, "No per-process page tables")) return ERR_PTR(-ENODEV); - pagetable = kzalloc_obj(*pagetable, GFP_KERNEL); + pagetable = kzalloc_obj(*pagetable); if (!pagetable) return ERR_PTR(-ENOMEM); @@ -734,7 +734,7 @@ struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks) iommu_set_pgtable_quirks(domain, quirks); - iommu = kzalloc_obj(*iommu, GFP_KERNEL); + iommu = kzalloc_obj(*iommu); if (!iommu) { iommu_domain_free(domain); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c index e40f6aa5917d..7768bde6745f 100644 --- a/drivers/gpu/drm/msm/msm_perf.c +++ b/drivers/gpu/drm/msm/msm_perf.c @@ -204,7 +204,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor) if (priv->perf) return 0; - perf = kzalloc_obj(*perf, GFP_KERNEL); + perf = kzalloc_obj(*perf); if (!perf) return -ENOMEM; diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index 3275ce9a4f07..8fab0b4ed8f4 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -245,7 +245,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name) { struct msm_rd_state *rd; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c index 9540a615b7a9..30ddb5351e98 100644 --- a/drivers/gpu/drm/msm/msm_ringbuffer.c +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c @@ -79,7 +79,7 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id, /* We assume everywhere that MSM_GPU_RINGBUFFER_SZ is a power of 2 */ BUILD_BUG_ON(!is_power_of_2(MSM_GPU_RINGBUFFER_SZ)); - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c b/drivers/gpu/drm/msm/msm_submitqueue.c index 04e4a2f2a3b0..2598d674a99d 100644 --- a/drivers/gpu/drm/msm/msm_submitqueue.c +++ b/drivers/gpu/drm/msm/msm_submitqueue.c @@ -151,7 +151,7 @@ get_sched_entity(struct msm_context *ctx, struct msm_ringbuffer *ring, struct drm_gpu_scheduler *sched = &ring->sched; int ret; - entity = kzalloc_obj(*ctx->entities[idx], GFP_KERNEL); + entity = kzalloc_obj(*ctx->entities[idx]); ret = drm_sched_entity_init(entity, sched_prio, &sched, 1, NULL); if (ret) { @@ -207,7 +207,7 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_context *ctx, if (ret) return ret; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); } if (!queue) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index e6ef6e318df9..ef3250a5c54f 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -595,7 +595,7 @@ static void lcdif_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -609,7 +609,7 @@ lcdif_crtc_atomic_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index e8b4f272aa8c..500fd77b87d1 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -1158,7 +1158,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, cli = chan->cli; push = &chan->chan.push; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; @@ -1291,7 +1291,7 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num) struct drm_plane *primary; int ret; - nv_crtc = kzalloc_obj(*nv_crtc, GFP_KERNEL); + nv_crtc = kzalloc_obj(*nv_crtc); if (!nv_crtc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c index 4137e694a7b6..22f903258f96 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c @@ -532,7 +532,7 @@ nv04_dac_create(struct drm_connector *connector, struct dcb_output *entry) struct drm_device *dev = connector->dev; struct drm_encoder *encoder; - nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c index a1cfc8e562d9..c9f96ec8455d 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c @@ -697,7 +697,7 @@ nv04_dfp_create(struct drm_connector *connector, struct dcb_output *entry) return -EINVAL; } - nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c b/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c index 369646b00802..976ed59a86e4 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/i2c/ch7006_drv.c @@ -444,7 +444,7 @@ static int ch7006_encoder_init(struct i2c_client *client, ch7006_dbg(client, "\n"); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c b/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c index 1af644b20b0b..7f402b901977 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c +++ b/drivers/gpu/drm/nouveau/dispnv04/i2c/sil164_drv.c @@ -399,7 +399,7 @@ sil164_encoder_init(struct i2c_client *client, struct sil164_priv *priv; struct i2c_client *slave_client; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c index 3ddcffe5c58e..9e1d4b353680 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c @@ -215,7 +215,7 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry) return type; /* Allocate the necessary memory */ - nv_encoder = kzalloc_obj(*nv_encoder, GFP_KERNEL); + nv_encoder = kzalloc_obj(*nv_encoder); if (!nv_encoder) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 8d252e8013b6..2721a2e0c885 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c @@ -797,7 +797,7 @@ nv17_tv_create(struct drm_connector *connector, struct dcb_output *entry) struct drm_encoder *encoder; struct nv17_tv_encoder *tv_enc = NULL; - tv_enc = kzalloc_obj(*tv_enc, GFP_KERNEL); + tv_enc = kzalloc_obj(*tv_enc); if (!tv_enc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/dispnv50/core507d.c b/drivers/gpu/drm/nouveau/dispnv50/core507d.c index 8997e53fd2be..46c945480522 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/core507d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/core507d.c @@ -162,7 +162,7 @@ core507d_new_(const struct nv50_core_func *func, struct nouveau_drm *drm, struct nv50_core *core; int ret; - if (!(core = *pcore = kzalloc_obj(*core, GFP_KERNEL))) + if (!(core = *pcore = kzalloc_obj(*core))) return -ENOMEM; core->func = func; core->disp = disp; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index c4c5ba876775..6c3a8712d38a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1115,7 +1115,7 @@ nv50_msto_new(struct drm_device *dev, struct nv50_head *head, int id) struct nv50_msto *msto; int ret; - msto = kzalloc_obj(*msto, GFP_KERNEL); + msto = kzalloc_obj(*msto); if (!msto) return ERR_PTR(-ENOMEM); @@ -1267,7 +1267,7 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, struct nv50_mstc *mstc; int ret; - if (!(mstc = *pmstc = kzalloc_obj(*mstc, GFP_KERNEL))) + if (!(mstc = *pmstc = kzalloc_obj(*mstc))) return -ENOMEM; mstc->mstm = mstm; mstc->port = port; @@ -1520,7 +1520,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max, struct nv50_mstm *mstm; int ret; - if (!(mstm = *pmstm = kzalloc_obj(*mstm, GFP_KERNEL))) + if (!(mstm = *pmstm = kzalloc_obj(*mstm))) return -ENOMEM; mstm->outp = outp; mstm->mgr.cbs = &nv50_mstm; @@ -2496,7 +2496,7 @@ nv50_disp_outp_atomic_add(struct nv50_atom *atom, struct drm_encoder *encoder) return outp; } - outp = kzalloc_obj(*outp, GFP_KERNEL); + outp = kzalloc_obj(*outp); if (!outp) return ERR_PTR(-ENOMEM); @@ -2643,7 +2643,7 @@ static struct drm_atomic_state * nv50_disp_atomic_state_alloc(struct drm_device *dev) { struct nv50_atom *atom; - if (!(atom = kzalloc_obj(*atom, GFP_KERNEL)) || + if (!(atom = kzalloc_obj(*atom)) || drm_atomic_state_init(dev, &atom->state) < 0) { kfree(atom); return NULL; @@ -2833,7 +2833,7 @@ nv50_display_create(struct drm_device *dev) int ret, i; bool has_mst = false; - disp = kzalloc_obj(*disp, GFP_KERNEL); + disp = kzalloc_obj(*disp); if (!disp) return -ENOMEM; @@ -2900,7 +2900,7 @@ nv50_display_create(struct drm_device *dev) for_each_set_bit(i, &disp->disp->outp_mask, sizeof(disp->disp->outp_mask) * 8) { struct nouveau_encoder *outp; - outp = kzalloc_obj(*outp, GFP_KERNEL); + outp = kzalloc_obj(*outp); if (!outp) break; @@ -2921,7 +2921,7 @@ nv50_display_create(struct drm_device *dev) outp->base.base.possible_clones = 0; outp->conn = nouveau_connector(connector); - outp->dcb = kzalloc_obj(*outp->dcb, GFP_KERNEL); + outp->dcb = kzalloc_obj(*outp->dcb); if (!outp->dcb) break; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c index 3f1b3c6cc7d9..4ca7700fb784 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -470,7 +470,7 @@ nv50_head_atomic_duplicate_state(struct drm_crtc *crtc) { struct nv50_head_atom *armh = nv50_head_atom(crtc->state); struct nv50_head_atom *asyh; - if (!(asyh = kmalloc_obj(*asyh, GFP_KERNEL))) + if (!(asyh = kmalloc_obj(*asyh))) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); asyh->wndw = armh->wndw; @@ -496,7 +496,7 @@ nv50_head_reset(struct drm_crtc *crtc) { struct nv50_head_atom *asyh; - if (WARN_ON(!(asyh = kzalloc_obj(*asyh, GFP_KERNEL)))) + if (WARN_ON(!(asyh = kzalloc_obj(*asyh)))) return; if (crtc->state) @@ -577,7 +577,7 @@ nv50_head_create(struct drm_device *dev, int index) const struct drm_crtc_funcs *funcs; int ret; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (!head) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/dispnv50/lut.c b/drivers/gpu/drm/nouveau/dispnv50/lut.c index e07060917cc0..d9db2486ef6e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/lut.c +++ b/drivers/gpu/drm/nouveau/dispnv50/lut.c @@ -38,7 +38,7 @@ nv50_lut_load(struct nv50_lut *lut, int buffer, struct drm_property_blob *blob, int i; if (!in) { - in = kvmalloc_objs(*in, 1024, GFP_KERNEL); + in = kvmalloc_objs(*in, 1024); if (!WARN_ON(!in)) { for (i = 0; i < 1024; i++) { in[i].red = diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 54b4252f4f49..9ad4973716f7 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -80,7 +80,7 @@ nv50_wndw_ctxdma_new(struct nv50_wndw *wndw, struct drm_framebuffer *fb) return ctxdma; } - if (!(ctxdma = kzalloc_obj(*ctxdma, GFP_KERNEL))) + if (!(ctxdma = kzalloc_obj(*ctxdma))) return ERR_PTR(-ENOMEM); list_add(&ctxdma->head, &wndw->ctxdma.list); @@ -730,7 +730,7 @@ nv50_wndw_atomic_duplicate_state(struct drm_plane *plane) { struct nv50_wndw_atom *armw = nv50_wndw_atom(plane->state); struct nv50_wndw_atom *asyw; - if (!(asyw = kmalloc_obj(*asyw, GFP_KERNEL))) + if (!(asyw = kmalloc_obj(*asyw))) return NULL; __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); asyw->sema = armw->sema; @@ -757,7 +757,7 @@ nv50_wndw_reset(struct drm_plane *plane) { struct nv50_wndw_atom *asyw; - if (WARN_ON(!(asyw = kzalloc_obj(*asyw, GFP_KERNEL)))) + if (WARN_ON(!(asyw = kzalloc_obj(*asyw)))) return; if (plane->state) @@ -863,7 +863,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, int nformat; int ret; - if (!(wndw = *pwndw = kzalloc_obj(*wndw, GFP_KERNEL))) + if (!(wndw = *pwndw = kzalloc_obj(*wndw))) return -ENOMEM; wndw->func = func; wndw->id = index; diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index 8c0cfab73f8f..f9201f2e73a3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -44,7 +44,7 @@ nouveau_abi16(struct drm_file *file_priv) struct nouveau_cli *cli = nouveau_cli(file_priv); if (!cli->abi16) { struct nouveau_abi16 *abi16; - cli->abi16 = abi16 = kzalloc_obj(*abi16, GFP_KERNEL); + cli->abi16 = abi16 = kzalloc_obj(*abi16); if (cli->abi16) { abi16->cli = cli; INIT_LIST_HEAD(&abi16->channels); @@ -124,7 +124,7 @@ nouveau_abi16_obj_new(struct nouveau_abi16 *abi16, enum nouveau_abi16_obj_type t if (obj) return ERR_PTR(-EEXIST); - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); @@ -397,7 +397,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) return nouveau_abi16_put(abi16, -EINVAL); /* allocate "abi16 channel" data and make up a handle for it */ - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return nouveau_abi16_put(abi16, -ENOMEM); @@ -597,7 +597,7 @@ nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS) if (!oclass) return nouveau_abi16_put(abi16, -EINVAL); - ntfy = kzalloc_obj(*ntfy, GFP_KERNEL); + ntfy = kzalloc_obj(*ntfy); if (!ntfy) return nouveau_abi16_put(abi16, -ENOMEM); @@ -635,7 +635,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) if (!chan) return nouveau_abi16_put(abi16, -ENOENT); - ntfy = kzalloc_obj(*ntfy, GFP_KERNEL); + ntfy = kzalloc_obj(*ntfy); if (!ntfy) return nouveau_abi16_put(abi16, -ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 1ddc8d1817f6..da1ee24a2531 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -314,7 +314,7 @@ nouveau_backlight_init(struct drm_connector *connector) if (!nv_encoder) return 0; - bl = kzalloc_obj(*bl, GFP_KERNEL); + bl = kzalloc_obj(*bl); if (!bl) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 710f0551e091..3c7d2e5b3850 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -222,7 +222,7 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain, return ERR_PTR(-EINVAL); } - nvbo = kzalloc_obj(struct nouveau_bo, GFP_KERNEL); + nvbo = kzalloc_obj(struct nouveau_bo); if (!nvbo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index 5b94aa9c1d9d..598513f60449 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c @@ -149,7 +149,7 @@ nouveau_channel_prep(struct nouveau_cli *cli, u32 target; int ret; - chan = *pchan = kzalloc_obj(*chan, GFP_KERNEL); + chan = *pchan = kzalloc_obj(*chan); if (!chan) return -ENOMEM; @@ -545,7 +545,7 @@ nouveau_channels_init(struct nouveau_drm *drm) drm->chan_nr = drm->chan_total = channels->data; drm->runl_nr = fls64(runlists->data); - drm->runl = kzalloc_objs(*drm->runl, drm->runl_nr, GFP_KERNEL); + drm->runl = kzalloc_objs(*drm->runl, drm->runl_nr); if (!drm->runl) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index a8250d04eaf4..00d4530aea71 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -232,7 +232,7 @@ nouveau_conn_atomic_duplicate_state(struct drm_connector *connector) { struct nouveau_conn_atom *armc = nouveau_conn_atom(connector->state); struct nouveau_conn_atom *asyc; - if (!(asyc = kmalloc_obj(*asyc, GFP_KERNEL))) + if (!(asyc = kmalloc_obj(*asyc))) return NULL; __drm_atomic_helper_connector_duplicate_state(connector, &asyc->state); asyc->dither = armc->dither; @@ -249,7 +249,7 @@ nouveau_conn_reset(struct drm_connector *connector) struct nouveau_conn_atom *asyc; if (drm_drv_uses_atomic_modeset(connector->dev)) { - if (WARN_ON(!(asyc = kzalloc_obj(*asyc, GFP_KERNEL)))) + if (WARN_ON(!(asyc = kzalloc_obj(*asyc)))) return; if (connector->state) @@ -1298,7 +1298,7 @@ nouveau_connector_create(struct drm_device *dev, int index) } drm_connector_list_iter_end(&conn_iter); - nv_connector = kzalloc_obj(*nv_connector, GFP_KERNEL); + nv_connector = kzalloc_obj(*nv_connector); if (!nv_connector) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index cb7c77f5a9a8..47d5579c568d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -295,7 +295,7 @@ nouveau_drm_debugfs_init(struct drm_minor *minor) int nouveau_debugfs_init(struct nouveau_drm *drm) { - drm->debugfs = kzalloc_obj(*drm->debugfs, GFP_KERNEL); + drm->debugfs = kzalloc_obj(*drm->debugfs); if (!drm->debugfs) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index ff51329c5565..d71dcfc6ee66 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -316,7 +316,7 @@ nouveau_framebuffer_new(struct drm_device *dev, } } - if (!(fb = *pfb = kzalloc_obj(*fb, GFP_KERNEL))) + if (!(fb = *pfb = kzalloc_obj(*fb))) return -ENOMEM; drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd); @@ -646,7 +646,7 @@ nouveau_display_create(struct drm_device *dev) struct nouveau_display *disp; int ret; - disp = drm->display = kzalloc_obj(*disp, GFP_KERNEL); + disp = drm->display = kzalloc_obj(*disp); if (!disp) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index dbc87f8e64f9..9442ec6e1f6c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -303,7 +303,7 @@ nouveau_dmem_chunk_alloc(struct nouveau_drm *drm, struct page **ppage, unsigned long i, pfn_first, pfn; int ret; - chunk = kzalloc_obj(*chunk, GFP_KERNEL); + chunk = kzalloc_obj(*chunk); if (chunk == NULL) { ret = -ENOMEM; goto out; @@ -707,7 +707,7 @@ nouveau_dmem_init(struct nouveau_drm *drm) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_PASCAL) return; - if (!(drm->dmem = kzalloc_obj(*drm->dmem, GFP_KERNEL))) + if (!(drm->dmem = kzalloc_obj(*drm->dmem))) return; drm->dmem->drm = drm; @@ -855,7 +855,7 @@ nouveau_dmem_migrate_vma(struct nouveau_drm *drm, if (!args.dst) goto out_free_src; - dma_info = kmalloc_objs(*dma_info, max, GFP_KERNEL); + dma_info = kmalloc_objs(*dma_info, max); if (!dma_info) goto out_free_dst; diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index f5cfac289983..915f73279302 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -739,7 +739,7 @@ nouveau_drm_device_new(const struct drm_driver *drm_driver, struct device *paren struct nouveau_drm *drm; int ret; - drm = kzalloc_obj(*drm, GFP_KERNEL); + drm = kzalloc_obj(*drm); if (!drm) return ERR_PTR(-ENOMEM); @@ -1203,7 +1203,7 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) current->comm, pid_nr(rcu_dereference(fpriv->pid))); rcu_read_unlock(); - if (!(cli = kzalloc_obj(*cli, GFP_KERNEL))) { + if (!(cli = kzalloc_obj(*cli))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.c b/drivers/gpu/drm/nouveau/nouveau_exec.c index b0522e97ebb3..c01a01aee32b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_exec.c +++ b/drivers/gpu/drm/nouveau/nouveau_exec.c @@ -219,7 +219,7 @@ nouveau_exec_job_init(struct nouveau_exec_job **pjob, } } - job = *pjob = kzalloc_obj(*job, GFP_KERNEL); + job = *pjob = kzalloc_obj(*job); if (!job) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 6af37c49913f..903d326927ca 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -408,7 +408,7 @@ nouveau_fence_create(struct nouveau_fence **pfence, if (unlikely(!chan->fence)) return -ENODEV; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 2ef7cb01a0c9..82621ede42e1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -168,7 +168,7 @@ nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nouveau_vma *vma) return; } - if (!(work = kmalloc_obj(*work, GFP_KERNEL))) { + if (!(work = kmalloc_obj(*work))) { WARN_ON(dma_fence_wait_timeout(fence, false, 2 * HZ) <= 0); nouveau_gem_object_delete(vma); return; diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c index a0f018380744..726397ab035d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c @@ -678,7 +678,7 @@ nouveau_hwmon_init(struct drm_device *dev) return 0; } - hwmon = drm->hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); + hwmon = drm->hwmon = kzalloc_obj(*hwmon); if (!hwmon) return -ENOMEM; hwmon->dev = dev; diff --git a/drivers/gpu/drm/nouveau/nouveau_led.c b/drivers/gpu/drm/nouveau/nouveau_led.c index 87397fe57021..19e2110904d1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_led.c +++ b/drivers/gpu/drm/nouveau/nouveau_led.c @@ -89,7 +89,7 @@ nouveau_led_init(struct drm_device *dev) if (nvkm_gpio_find(gpio, 0, DCB_GPIO_LOGO_LED_PWM, 0xff, &logo_led)) return 0; - drm->led = kzalloc_obj(*drm->led, GFP_KERNEL); + drm->led = kzalloc_obj(*drm->led); if (!drm->led) return -ENOMEM; drm->led->dev = dev; diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index b370158ba3f7..b26c521166f1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -176,7 +176,7 @@ nouveau_mem_new(struct nouveau_drm *drm, u8 kind, u8 comp, { struct nouveau_mem *mem; - if (!(mem = kzalloc_obj(*mem, GFP_KERNEL))) + if (!(mem = kzalloc_obj(*mem))) return -ENOMEM; mem->drm = drm; diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c b/drivers/gpu/drm/nouveau/nouveau_sched.c index 402ef5e95ad7..9bd3dc16a467 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sched.c +++ b/drivers/gpu/drm/nouveau/nouveau_sched.c @@ -467,7 +467,7 @@ nouveau_sched_create(struct nouveau_sched **psched, struct nouveau_drm *drm, struct nouveau_sched *sched; int ret; - sched = kzalloc_obj(*sched, GFP_KERNEL); + sched = kzalloc_obj(*sched); if (!sched) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index a22483f68a7c..fa3b4ebf38a8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c @@ -79,7 +79,7 @@ nouveau_sgdma_create_ttm(struct ttm_buffer_object *bo, uint32_t page_flags) else caching = ttm_cached; - nvbe = kzalloc_obj(*nvbe, GFP_KERNEL); + nvbe = kzalloc_obj(*nvbe); if (!nvbe) return NULL; diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index 947601a8955b..72d7290a4394 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -223,7 +223,7 @@ nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst) { struct nouveau_ivmm *ivmm; if (svmm) { - if (!(ivmm = kmalloc_obj(*ivmm, GFP_KERNEL))) + if (!(ivmm = kmalloc_obj(*ivmm))) return -ENOMEM; ivmm->svmm = svmm; ivmm->inst = inst; @@ -326,7 +326,7 @@ nouveau_svmm_init(struct drm_device *dev, void *data, return -ENOSYS; /* Allocate tracking for SVM-enabled VMM. */ - if (!(svmm = kzalloc_obj(*svmm, GFP_KERNEL))) + if (!(svmm = kzalloc_obj(*svmm))) return -ENOMEM; svmm->vmm = &cli->svm; svmm->unmanaged.start = args->unmanaged_addr; @@ -475,7 +475,7 @@ nouveau_svm_fault_cache(struct nouveau_svm *svm, nvif_mask(memory, offset + 0x1c, 0x80000000, 0x00000000); if (!buffer->fault[buffer->fault_nr]) { - fault = kmalloc_obj(*fault, GFP_KERNEL); + fault = kmalloc_obj(*fault); if (WARN_ON(!fault)) { nouveau_svm_fault_cancel(svm, inst, hub, gpc, client); return; diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 89216d0a8e7e..ad01f922aa86 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -181,7 +181,7 @@ static int nouveau_ttm_init_vram(struct nouveau_drm *drm) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) { - struct ttm_resource_manager *man = kzalloc_obj(*man, GFP_KERNEL); + struct ttm_resource_manager *man = kzalloc_obj(*man); if (!man) return -ENOMEM; @@ -229,7 +229,7 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm) return ttm_range_man_init(&drm->ttm.bdev, TTM_PL_TT, true, size_pages); - man = kzalloc_obj(*man, GFP_KERNEL); + man = kzalloc_obj(*man); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index caa26db2b04b..36445915aa58 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -218,7 +218,7 @@ nouveau_uvma_unmap(struct nouveau_uvma *uvma) static int nouveau_uvma_alloc(struct nouveau_uvma **puvma) { - *puvma = kzalloc_obj(**puvma, GFP_KERNEL); + *puvma = kzalloc_obj(**puvma); if (!*puvma) return -ENOMEM; @@ -246,7 +246,7 @@ nouveau_uvma_gem_put(struct nouveau_uvma *uvma) static int nouveau_uvma_region_alloc(struct nouveau_uvma_region **preg) { - *preg = kzalloc_obj(**preg, GFP_KERNEL); + *preg = kzalloc_obj(**preg); if (!*preg) return -ENOMEM; @@ -1020,7 +1020,7 @@ nouveau_uvmm_validate_range(struct nouveau_uvmm *uvmm, u64 addr, u64 range) static int nouveau_uvmm_bind_job_alloc(struct nouveau_uvmm_bind_job **pjob) { - *pjob = kzalloc_obj(**pjob, GFP_KERNEL); + *pjob = kzalloc_obj(**pjob); if (!*pjob) return -ENOMEM; @@ -1618,7 +1618,7 @@ bind_job_op_from_uop(struct bind_job_op **pop, { struct bind_job_op *op; - op = *pop = kzalloc_obj(*op, GFP_KERNEL); + op = *pop = kzalloc_obj(*op); if (!op) return -ENOMEM; @@ -1911,7 +1911,7 @@ nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, goto out_unlock; } - uvmm = kzalloc_obj(*uvmm, GFP_KERNEL); + uvmm = kzalloc_obj(*uvmm); if (!uvmm) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/gpu/drm/nouveau/nouveau_vmm.c b/drivers/gpu/drm/nouveau/nouveau_vmm.c index a5e8efc3042c..5812f27bfecf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_vmm.c @@ -87,7 +87,7 @@ nouveau_vma_new(struct nouveau_bo *nvbo, struct nouveau_vmm *vmm, return 0; } - if (!(vma = *pvma = kmalloc_obj(*vma, GFP_KERNEL))) + if (!(vma = *pvma = kmalloc_obj(*vma))) return -ENOMEM; vma->vmm = vmm; vma->refs = 1; diff --git a/drivers/gpu/drm/nouveau/nv04_fence.c b/drivers/gpu/drm/nouveau/nv04_fence.c index 7fa9eede7c5d..a640430944ee 100644 --- a/drivers/gpu/drm/nouveau/nv04_fence.c +++ b/drivers/gpu/drm/nouveau/nv04_fence.c @@ -76,7 +76,7 @@ nv04_fence_context_del(struct nouveau_channel *chan) static int nv04_fence_context_new(struct nouveau_channel *chan) { - struct nv04_fence_chan *fctx = kzalloc_obj(*fctx, GFP_KERNEL); + struct nv04_fence_chan *fctx = kzalloc_obj(*fctx); if (fctx) { nouveau_fence_context_new(chan, &fctx->base); fctx->base.emit = nv04_fence_emit; @@ -101,7 +101,7 @@ nv04_fence_create(struct nouveau_drm *drm) { struct nv04_fence_priv *priv; - priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c index 0f859251d9db..6e88050f41fb 100644 --- a/drivers/gpu/drm/nouveau/nv10_fence.c +++ b/drivers/gpu/drm/nouveau/nv10_fence.c @@ -70,7 +70,7 @@ nv10_fence_context_new(struct nouveau_channel *chan) { struct nv10_fence_chan *fctx; - fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx); if (!fctx) return -ENOMEM; @@ -96,7 +96,7 @@ nv10_fence_create(struct nouveau_drm *drm) { struct nv10_fence_priv *priv; - priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv17_fence.c b/drivers/gpu/drm/nouveau/nv17_fence.c index 56682cb03d81..1e1a01699935 100644 --- a/drivers/gpu/drm/nouveau/nv17_fence.c +++ b/drivers/gpu/drm/nouveau/nv17_fence.c @@ -83,7 +83,7 @@ nv17_fence_context_new(struct nouveau_channel *chan) u32 limit = start + priv->bo->bo.base.size - 1; int ret = 0; - fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx); if (!fctx) return -ENOMEM; @@ -120,7 +120,7 @@ nv17_fence_create(struct nouveau_drm *drm) struct nv10_fence_priv *priv; int ret = 0; - priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv50_fence.c b/drivers/gpu/drm/nouveau/nv50_fence.c index d64c070fe48b..2dd0ef4e6497 100644 --- a/drivers/gpu/drm/nouveau/nv50_fence.c +++ b/drivers/gpu/drm/nouveau/nv50_fence.c @@ -42,7 +42,7 @@ nv50_fence_context_new(struct nouveau_channel *chan) u32 limit = start + priv->bo->bo.base.size - 1; int ret; - fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx); if (!fctx) return -ENOMEM; @@ -71,7 +71,7 @@ nv50_fence_create(struct nouveau_drm *drm) struct nv10_fence_priv *priv; int ret = 0; - priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nv84_fence.c b/drivers/gpu/drm/nouveau/nv84_fence.c index 7a2ad00870af..6e5eb279b3a8 100644 --- a/drivers/gpu/drm/nouveau/nv84_fence.c +++ b/drivers/gpu/drm/nouveau/nv84_fence.c @@ -131,7 +131,7 @@ nv84_fence_context_new(struct nouveau_channel *chan) struct nv84_fence_chan *fctx; int ret; - fctx = chan->fence = kzalloc_obj(*fctx, GFP_KERNEL); + fctx = chan->fence = kzalloc_obj(*fctx); if (!fctx) return -ENOMEM; @@ -198,7 +198,7 @@ nv84_fence_create(struct nouveau_drm *drm) u32 domain; int ret; - priv = drm->fence = kzalloc_obj(*priv, GFP_KERNEL); + priv = drm->fence = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvif/fifo.c b/drivers/gpu/drm/nouveau/nvif/fifo.c index b42fc34cb5ce..59b3ba3265fe 100644 --- a/drivers/gpu/drm/nouveau/nvif/fifo.c +++ b/drivers/gpu/drm/nouveau/nvif/fifo.c @@ -36,7 +36,7 @@ nvif_fifo_runlists(struct nvif_device *device) if (device->runlist) return 0; - if (!(a = kmalloc_obj(*a, GFP_KERNEL))) + if (!(a = kmalloc_obj(*a))) return -ENOMEM; a->m.version = 1; a->m.count = sizeof(a->v) / sizeof(a->v.runlists); diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mmu.c index eaa96608a264..e1e902750991 100644 --- a/drivers/gpu/drm/nouveau/nvif/mmu.c +++ b/drivers/gpu/drm/nouveau/nvif/mmu.c @@ -69,12 +69,12 @@ nvif_mmu_ctor(struct nvif_object *parent, const char *name, s32 oclass, goto done; mmu->mem = mems[ret].oclass; - mmu->heap = kmalloc_objs(*mmu->heap, mmu->heap_nr, GFP_KERNEL); - mmu->type = kmalloc_objs(*mmu->type, mmu->type_nr, GFP_KERNEL); + mmu->heap = kmalloc_objs(*mmu->heap, mmu->heap_nr); + mmu->type = kmalloc_objs(*mmu->type, mmu->type_nr); if (ret = -ENOMEM, !mmu->heap || !mmu->type) goto done; - mmu->kind = kmalloc_objs(*mmu->kind, mmu->kind_nr, GFP_KERNEL); + mmu->kind = kmalloc_objs(*mmu->kind, mmu->kind_nr); if (!mmu->kind && mmu->kind_nr) goto done; diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c index 93ad63f9021f..6d5018a5e93c 100644 --- a/drivers/gpu/drm/nouveau/nvif/object.c +++ b/drivers/gpu/drm/nouveau/nvif/object.c @@ -81,7 +81,7 @@ nvif_object_sclass_get(struct nvif_object *object, struct nvif_sclass **psclass) return ret; } - *psclass = kzalloc_objs(**psclass, args->sclass.count, GFP_KERNEL); + *psclass = kzalloc_objs(**psclass, args->sclass.count); if (*psclass) { for (i = 0; i < args->sclass.count; i++) { (*psclass)[i].oclass = args->sclass.oclass[i].oclass; diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c index 567cacc04989..8cf4775a0a1e 100644 --- a/drivers/gpu/drm/nouveau/nvif/outp.c +++ b/drivers/gpu/drm/nouveau/nvif/outp.c @@ -438,7 +438,7 @@ nvif_outp_edid_get(struct nvif_outp *outp, u8 **pedid) struct nvif_outp_edid_get_v0 *args; int ret; - args = kmalloc_obj(*args, GFP_KERNEL); + args = kmalloc_obj(*args); if (!args) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvif/vmm.c b/drivers/gpu/drm/nouveau/nvif/vmm.c index 15e5f423c680..65c3e883b119 100644 --- a/drivers/gpu/drm/nouveau/nvif/vmm.c +++ b/drivers/gpu/drm/nouveau/nvif/vmm.c @@ -234,7 +234,7 @@ nvif_vmm_ctor(struct nvif_mmu *mmu, const char *name, s32 oclass, vmm->limit = args->size; vmm->page_nr = args->page_nr; - vmm->page = kmalloc_objs(*vmm->page, vmm->page_nr, GFP_KERNEL); + vmm->page = kmalloc_objs(*vmm->page, vmm->page_nr); if (!vmm->page) { ret = -ENOMEM; goto done; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu/drm/nouveau/nvkm/core/client.c index 637fa5f89dc7..9590834d3777 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/client.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c @@ -109,7 +109,7 @@ nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg, struct nvkm_oclass oclass = { .base = nvkm_uclient_sclass }; struct nvkm_client *client; - if (!(client = *pclient = kzalloc_obj(*client, GFP_KERNEL))) + if (!(client = *pclient = kzalloc_obj(*client))) return -ENOMEM; oclass.client = client; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/engine.c b/drivers/gpu/drm/nouveau/nvkm/core/engine.c index 1b94e0aa0f28..b1453bc4ad79 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/engine.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/engine.c @@ -183,7 +183,7 @@ nvkm_engine_new_(const struct nvkm_engine_func *func, struct nvkm_device *device enum nvkm_subdev_type type, int inst, bool enable, struct nvkm_engine **pengine) { - if (!(*pengine = kzalloc_obj(**pengine, GFP_KERNEL))) + if (!(*pengine = kzalloc_obj(**pengine))) return -ENOMEM; return nvkm_engine_ctor(func, device, type, inst, enable, *pengine); } diff --git a/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c b/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c index a81eddf777ba..8916e31ee210 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c @@ -232,7 +232,7 @@ nvkm_gpuobj_new(struct nvkm_device *device, u32 size, int align, bool zero, struct nvkm_gpuobj *gpuobj; int ret; - if (!(gpuobj = *pgpuobj = kzalloc_obj(*gpuobj, GFP_KERNEL))) + if (!(gpuobj = *pgpuobj = kzalloc_obj(*gpuobj))) return -ENOMEM; ret = nvkm_gpuobj_ctor(device, size, align, zero, parent, gpuobj); @@ -249,7 +249,7 @@ nvkm_gpuobj_new(struct nvkm_device *device, u32 size, int align, bool zero, int nvkm_gpuobj_wrap(struct nvkm_memory *memory, struct nvkm_gpuobj **pgpuobj) { - if (!(*pgpuobj = kzalloc_obj(**pgpuobj, GFP_KERNEL))) + if (!(*pgpuobj = kzalloc_obj(**pgpuobj))) return -ENOMEM; (*pgpuobj)->addr = nvkm_memory_addr(memory); diff --git a/drivers/gpu/drm/nouveau/nvkm/core/intr.c b/drivers/gpu/drm/nouveau/nvkm/core/intr.c index a58de178cdf6..f31aca949e2c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/intr.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/intr.c @@ -239,8 +239,8 @@ nvkm_intr_add(const struct nvkm_intr_func *func, const struct nvkm_intr_data *da intr->data = data; intr->subdev = subdev; intr->leaves = leaves; - intr->stat = kzalloc_objs(*intr->stat, leaves, GFP_KERNEL); - intr->mask = kzalloc_objs(*intr->mask, leaves, GFP_KERNEL); + intr->stat = kzalloc_objs(*intr->stat, leaves); + intr->mask = kzalloc_objs(*intr->mask, leaves); if (!intr->stat || !intr->mask) { kfree(intr->stat); return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/memory.c b/drivers/gpu/drm/nouveau/nvkm/core/memory.c index bf69467e44da..548df7b76f02 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/memory.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/memory.c @@ -69,7 +69,7 @@ nvkm_memory_tags_get(struct nvkm_memory *memory, struct nvkm_device *device, return 0; } - if (!(tags = kmalloc_obj(*tags, GFP_KERNEL))) { + if (!(tags = kmalloc_obj(*tags))) { mutex_unlock(&fb->tags.mutex); return -ENOMEM; } diff --git a/drivers/gpu/drm/nouveau/nvkm/core/mm.c b/drivers/gpu/drm/nouveau/nvkm/core/mm.c index bd47502d82ae..cc32003086a0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/mm.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/mm.c @@ -90,7 +90,7 @@ region_head(struct nvkm_mm *mm, struct nvkm_mm_node *a, u32 size) if (a->length == size) return a; - b = kmalloc_obj(*b, GFP_KERNEL); + b = kmalloc_obj(*b); if (unlikely(b == NULL)) return NULL; @@ -165,7 +165,7 @@ region_tail(struct nvkm_mm *mm, struct nvkm_mm_node *a, u32 size) if (a->length == size) return a; - b = kmalloc_obj(*b, GFP_KERNEL); + b = kmalloc_obj(*b); if (unlikely(b == NULL)) return NULL; @@ -247,7 +247,7 @@ nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) next = prev->offset + prev->length; if (next != offset) { BUG_ON(next > offset); - if (!(node = kzalloc_obj(*node, GFP_KERNEL))) + if (!(node = kzalloc_obj(*node))) return -ENOMEM; node->type = NVKM_MM_TYPE_HOLE; node->offset = next; @@ -262,7 +262,7 @@ nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) mm->heap_nodes = 0; } - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/object.c b/drivers/gpu/drm/nouveau/nvkm/core/object.c index 6e84cf72bfc8..d2f827b9a435 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/object.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/object.c @@ -290,7 +290,7 @@ nvkm_object_new_(const struct nvkm_object_func *func, struct nvkm_object **pobject) { if (size == 0) { - if (!(*pobject = kzalloc_obj(**pobject, GFP_KERNEL))) + if (!(*pobject = kzalloc_obj(**pobject))) return -ENOMEM; nvkm_object_ctor(func, oclass, *pobject); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c index bfa9821b3ac4..27406ac3171a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/oproxy.c @@ -178,7 +178,7 @@ int nvkm_oproxy_new_(const struct nvkm_oproxy_func *func, const struct nvkm_oclass *oclass, struct nvkm_oproxy **poproxy) { - if (!(*poproxy = kzalloc_obj(**poproxy, GFP_KERNEL))) + if (!(*poproxy = kzalloc_obj(**poproxy))) return -ENOMEM; nvkm_oproxy_ctor(func, oclass, *poproxy); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index 97f5db788ba6..aab5a73f467a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -280,7 +280,7 @@ int nvkm_subdev_new_(const struct nvkm_subdev_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_subdev **psubdev) { - if (!(*psubdev = kzalloc_obj(**psubdev, GFP_KERNEL))) + if (!(*psubdev = kzalloc_obj(**psubdev))) return -ENOMEM; nvkm_subdev_ctor(func, device, type, inst, *psubdev); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c index 5295b2b920e6..81ab29fffbf4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/uevent.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/uevent.c @@ -144,7 +144,7 @@ nvkm_uevent_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, if (argc < sizeof(args->v0) || args->v0.version != 0) return -ENOSYS; - if (!(uevent = kzalloc_obj(*uevent, GFP_KERNEL))) + if (!(uevent = kzalloc_obj(*uevent))) return -ENOMEM; *pobject = &uevent->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c index 4d09157fd7c0..f2e9a06263ce 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c @@ -194,7 +194,7 @@ nvkm_control_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, { struct nvkm_control *ctrl; - if (!(ctrl = kzalloc_obj(*ctrl, GFP_KERNEL))) + if (!(ctrl = kzalloc_obj(*ctrl))) return -ENOMEM; *pobject = &ctrl->object; ctrl->device = device; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c index 1e7b4a455049..248623b91e29 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c @@ -1688,7 +1688,7 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg, pcid++; } - if (!(pdev = kzalloc_obj(*pdev, GFP_KERNEL))) { + if (!(pdev = kzalloc_obj(*pdev))) { pci_disable_device(pci_dev); return -ENOMEM; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c index d49d92fa4648..46bb55a1f565 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -253,7 +253,7 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, unsigned long rate; int ret; - if (!(tdev = kzalloc_obj(*tdev, GFP_KERNEL))) + if (!(tdev = kzalloc_obj(*tdev))) return -ENOMEM; tdev->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c index 7dea6bf31b10..23d11d8221cb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c @@ -327,7 +327,7 @@ nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_client *client = oclass->client; struct nvkm_udevice *udev; - if (!(udev = kzalloc_obj(*udev, GFP_KERNEL))) + if (!(udev = kzalloc_obj(*udev))) return -ENOMEM; nvkm_object_ctor(&nvkm_udevice, oclass, &udev->object); *pobject = &udev->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index d25ef27ccf5d..d44c4316a578 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -232,7 +232,7 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, struct nvkm_disp *disp; int ret; - if (!(disp = *pdisp = kzalloc_obj(**pdisp, GFP_KERNEL))) + if (!(disp = *pdisp = kzalloc_obj(**pdisp))) return -ENOMEM; disp->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c index 9b7148ce8d1b..a8f72abbb371 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/chan.c @@ -86,7 +86,7 @@ nvkm_disp_chan_child_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_disp_chan_object *object; int ret; - if (!(object = kzalloc_obj(*object, GFP_KERNEL))) + if (!(object = kzalloc_obj(*object))) return -ENOMEM; nvkm_oproxy_ctor(&nvkm_disp_chan_child_func_, oclass, &object->oproxy); object->disp = disp; @@ -195,7 +195,7 @@ nvkm_disp_chan_new_(struct nvkm_disp *disp, int nr, const struct nvkm_oclass *oc if (args->v0.id >= nr || !args->v0.pushbuf != !user->func->push) return -EINVAL; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; *pobject = &chan->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c index e4cfb172c383..e4e238aa514b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c @@ -78,7 +78,7 @@ int nvkm_conn_new(struct nvkm_disp *disp, int index, struct nvbios_connE *info, struct nvkm_conn **pconn) { - if (!(*pconn = kzalloc_obj(**pconn, GFP_KERNEL))) + if (!(*pconn = kzalloc_obj(**pconn))) return -ENOMEM; nvkm_conn_ctor(disp, index, info, *pconn); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c index bf79076081f6..dbd984da7501 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c @@ -822,7 +822,7 @@ gv100_disp_caps_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_disp *disp = nvkm_udisp(oclass->parent); struct gv100_disp_caps *caps; - if (!(caps = kzalloc_obj(*caps, GFP_KERNEL))) + if (!(caps = kzalloc_obj(*caps))) return -ENOMEM; *pobject = &caps->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c index ffe2ec55a15a..c70cbbe418a3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.c @@ -56,7 +56,7 @@ nvkm_head_new_(const struct nvkm_head_func *func, struct nvkm_disp *disp, int id) { struct nvkm_head *head; - if (!(head = kzalloc_obj(*head, GFP_KERNEL))) + if (!(head = kzalloc_obj(*head))) return -ENOMEM; head->func = func; head->disp = disp; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c index d680ef5355a3..36bce3f75a57 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.c @@ -58,7 +58,7 @@ nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *disp, enum nvkm_ior_type type, int id, bool hda) { struct nvkm_ior *ior; - if (!(ior = kzalloc_obj(*ior, GFP_KERNEL))) + if (!(ior = kzalloc_obj(*ior))) return -ENOMEM; ior->func = func; ior->disp = disp; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index c61453db7597..5360b4e223af 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c @@ -379,7 +379,7 @@ nvkm_outp_new_(const struct nvkm_outp_func *func, struct nvkm_disp *disp, enum nvkm_ior_proto proto; enum nvkm_ior_type type; - if (!(outp = *poutp = kzalloc_obj(*outp, GFP_KERNEL))) + if (!(outp = *poutp = kzalloc_obj(*outp))) return -ENOMEM; outp->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c index 8fcc4c587a28..151da7a0a6ea 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c @@ -108,7 +108,7 @@ nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device, { struct nvkm_dma *dma; - if (!(dma = *pdma = kzalloc_obj(*dma, GFP_KERNEL))) + if (!(dma = *pdma = kzalloc_obj(*dma))) return -ENOMEM; dma->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c index 2c1b14f93fb2..dccf53585c0b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c @@ -78,7 +78,7 @@ gf100_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, user, unkn; int ret; - if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c index c16449eb3c95..89f707ac1657 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf119.c @@ -76,7 +76,7 @@ gf119_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, page; int ret; - if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c index 982ee81fd2bc..1b65a6aa31d7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usergv100.c @@ -75,7 +75,7 @@ gv100_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 kind, page; int ret; - if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c index fcc87163c2d6..2201ca225fe1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c @@ -85,7 +85,7 @@ nv04_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, struct nv04_dmaobj *dmaobj; int ret; - if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c index 5cf0986c7944..e12c9544a856 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv50.c @@ -78,7 +78,7 @@ nv50_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass, u32 user, part, comp, kind; int ret; - if (!(dmaobj = kzalloc_obj(*dmaobj, GFP_KERNEL))) + if (!(dmaobj = kzalloc_obj(*dmaobj))) return -ENOMEM; *pdmaobj = &dmaobj->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c index bf6a225f5673..fa34c223a46f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c @@ -341,7 +341,7 @@ nvkm_falcon_new_(const struct nvkm_falcon_func *func, struct nvkm_device *device { struct nvkm_falcon *falcon; - if (!(falcon = kzalloc_obj(*falcon, GFP_KERNEL))) + if (!(falcon = kzalloc_obj(*falcon))) return -ENOMEM; falcon->func = func; falcon->addr = addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index 7dad0bf10631..9dd924694306 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -377,7 +377,7 @@ nvkm_fifo_new_(const struct nvkm_fifo_func *func, struct nvkm_device *device, { struct nvkm_fifo *fifo; - if (!(fifo = *pfifo = kzalloc_obj(*fifo, GFP_KERNEL))) + if (!(fifo = *pfifo = kzalloc_obj(*fifo))) return -ENOMEM; fifo->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c index 2b852341d8f4..7e2d5711a1cb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/cgrp.c @@ -69,7 +69,7 @@ nvkm_cgrp_ectx_get(struct nvkm_cgrp *cgrp, struct nvkm_engn *engn, struct nvkm_e /* Nope - create a fresh one. */ CGRP_TRACE(cgrp, "ctor ectx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(ectx = *pectx = kzalloc_obj(*ectx, GFP_KERNEL))) + if (!(ectx = *pectx = kzalloc_obj(*ectx))) return -ENOMEM; ectx->engn = engn; @@ -141,7 +141,7 @@ nvkm_cgrp_vctx_get(struct nvkm_cgrp *cgrp, struct nvkm_engn *engn, struct nvkm_c /* Now, create the sub-context. */ CGRP_TRACE(cgrp, "ctor vctx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(vctx = *pvctx = kzalloc_obj(*vctx, GFP_KERNEL))) { + if (!(vctx = *pvctx = kzalloc_obj(*vctx))) { nvkm_cgrp_ectx_put(cgrp, &ectx); return -ENOMEM; } @@ -224,7 +224,7 @@ nvkm_cgrp_new(struct nvkm_runl *runl, const char *name, struct nvkm_vmm *vmm, bo { struct nvkm_cgrp *cgrp; - if (!(cgrp = *pcgrp = kmalloc_obj(*cgrp, GFP_KERNEL))) + if (!(cgrp = *pcgrp = kmalloc_obj(*cgrp))) return -ENOMEM; cgrp->func = runl->fifo->func->cgrp.func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c index 0c6a5220ef80..418a8918bcb8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c @@ -117,7 +117,7 @@ nvkm_chan_cctx_get(struct nvkm_chan *chan, struct nvkm_engn *engn, struct nvkm_c /* Now, create the channel context - to track engine binding. */ CHAN_TRACE(chan, "ctor cctx %d[%s]", engn->id, engn->engine->subdev.name); - if (!(cctx = *pcctx = kzalloc_obj(*cctx, GFP_KERNEL))) { + if (!(cctx = *pcctx = kzalloc_obj(*cctx))) { nvkm_cgrp_vctx_put(cgrp, &vctx); ret = -ENOMEM; goto done; @@ -367,7 +367,7 @@ nvkm_chan_new_(const struct nvkm_chan_func *func, struct nvkm_runl *runl, int ru return -EINVAL; } - if (!(chan = *pchan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = *pchan = kzalloc_obj(*chan))) return -ENOMEM; chan->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c index 42e49781eb21..2092521053ef 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c @@ -349,7 +349,7 @@ nvkm_runl_add(struct nvkm_runl *runl, int engi, const struct nvkm_engn_func *fun return NULL; } - if (!(engn = kzalloc_obj(*engn, GFP_KERNEL))) + if (!(engn = kzalloc_obj(*engn))) return NULL; engn->func = func; @@ -398,7 +398,7 @@ nvkm_runl_new(struct nvkm_fifo *fifo, int runi, u32 addr, int id_nr) struct nvkm_runl *runl; int ret; - if (!(runl = kzalloc_obj(*runl, GFP_KERNEL))) + if (!(runl = kzalloc_obj(*runl))) return ERR_PTR(-ENOMEM); runl->func = fifo->func->runl; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c index e26e0f093755..cc000adbcaf0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runq.c @@ -34,7 +34,7 @@ nvkm_runq_new(struct nvkm_fifo *fifo, int pbid) { struct nvkm_runq *runq; - if (!(runq = kzalloc_obj(*runq, GFP_KERNEL))) + if (!(runq = kzalloc_obj(*runq))) return NULL; runq->func = fifo->func->runq; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c index cea98ea25178..dfa3c7dbdf34 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ucgrp.c @@ -104,7 +104,7 @@ nvkm_ucgrp_new(struct nvkm_fifo *fifo, const struct nvkm_oclass *oclass, void *a return PTR_ERR(vmm); /* Allocate channel group. */ - if (!(ucgrp = kzalloc_obj(*ucgrp, GFP_KERNEL))) { + if (!(ucgrp = kzalloc_obj(*ucgrp))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c index f986dbd14f73..d6a87cec2150 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c @@ -166,7 +166,7 @@ nvkm_uchan_object_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, return -EINVAL; /* Allocate SW object. */ - if (!(uobj = kzalloc_obj(*uobj, GFP_KERNEL))) + if (!(uobj = kzalloc_obj(*uobj))) return -ENOMEM; nvkm_oproxy_ctor(&nvkm_uchan_object, oclass, &uobj->oproxy); @@ -375,7 +375,7 @@ nvkm_uchan_new(struct nvkm_fifo *fifo, struct nvkm_cgrp *cgrp, const struct nvkm } /* Allocate channel. */ - if (!(uchan = kzalloc_obj(*uchan, GFP_KERNEL))) { + if (!(uchan = kzalloc_obj(*uchan))) { ret = -ENOMEM; goto done; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index 910ca0d4aa0f..c2a9dd9018b8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -285,7 +285,7 @@ gf100_gr_object_new(const struct nvkm_oclass *oclass, void *data, u32 size, struct gf100_gr_chan *chan = gf100_gr_chan(oclass->parent); struct gf100_gr_object *object; - if (!(object = kzalloc_obj(*object, GFP_KERNEL))) + if (!(object = kzalloc_obj(*object))) return -ENOMEM; *pobject = &object->object; @@ -384,7 +384,7 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nvkm_device *device = gr->base.engine.subdev.device; int ret; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&gf100_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -2624,7 +2624,7 @@ gf100_gr_new_(const struct gf100_gr_fwif *fwif, struct nvkm_device *device, struct gf100_gr *gr; int ret; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c index 3bf288190cd1..7568b3ddb2b8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c @@ -1188,7 +1188,7 @@ nv04_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv04_gr_chan *chan; unsigned long flags; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv04_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -1417,7 +1417,7 @@ nv04_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, st { struct nv04_gr *gr; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c index 8b724b3acdba..abcf1ffbf66c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.c @@ -1007,7 +1007,7 @@ nv10_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nvkm_device *device = gr->base.engine.subdev.device; unsigned long flags; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv10_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -1177,7 +1177,7 @@ nv10_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv10_gr *gr; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c index f12053d47fcf..66aa6398754b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c @@ -79,7 +79,7 @@ nv20_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv20_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -334,7 +334,7 @@ nv20_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv20_gr *gr; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c index 91c613e00e5e..bcf2a3697e7a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c @@ -25,7 +25,7 @@ nv25_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv25_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c index 4435db568bb4..6526538dfdb0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c @@ -25,7 +25,7 @@ nv2a_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv2a_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c index 6da312944498..00e25d68d72d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c @@ -26,7 +26,7 @@ nv30_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv30_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c index 8cb48adc5d58..ffd1840f0271 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c @@ -25,7 +25,7 @@ nv34_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv34_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c index 4116872fd2d1..22011e3fdbfd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c @@ -25,7 +25,7 @@ nv35_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv20_gr_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv35_gr_chan, oclass, &chan->object); chan->gr = gr; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c index 5af4fa408fb8..c8b97aabcb69 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.c @@ -152,7 +152,7 @@ nv40_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv40_gr_chan *chan; unsigned long flags; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv40_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -433,7 +433,7 @@ nv40_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv40_gr *gr; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; *pgr = &gr->base; INIT_LIST_HEAD(&gr->chan); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c index fae9254fa870..1aff861a845e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c @@ -92,7 +92,7 @@ nv50_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch, struct nv50_gr *gr = nv50_gr(base); struct nv50_gr_chan *chan; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv50_gr_chan, oclass, &chan->object); chan->gr = gr; @@ -765,7 +765,7 @@ nv50_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device, { struct nv50_gr *gr; - if (!(gr = kzalloc_obj(*gr, GFP_KERNEL))) + if (!(gr = kzalloc_obj(*gr))) return -ENOMEM; spin_lock_init(&gr->lock); *pgr = &gr->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c index ee907c2987a6..3652833c7951 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c @@ -89,7 +89,7 @@ nv31_mpeg_chan_new(struct nvkm_chan *fifoch, const struct nvkm_oclass *oclass, unsigned long flags; int ret = -EBUSY; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv31_mpeg_chan, oclass, &chan->object); chan->mpeg = mpeg; @@ -277,7 +277,7 @@ nv31_mpeg_new_(const struct nv31_mpeg_func *func, struct nvkm_device *device, { struct nv31_mpeg *mpeg; - if (!(mpeg = kzalloc_obj(*mpeg, GFP_KERNEL))) + if (!(mpeg = kzalloc_obj(*mpeg))) return -ENOMEM; mpeg->func = func; *pmpeg = &mpeg->engine; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c index c14b6efcaf6d..eeb9f90745b3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv44.c @@ -107,7 +107,7 @@ nv44_mpeg_chan_new(struct nvkm_chan *fifoch, const struct nvkm_oclass *oclass, struct nv44_mpeg_chan *chan; unsigned long flags; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; nvkm_object_ctor(&nv44_mpeg_chan, oclass, &chan->object); chan->mpeg = mpeg; @@ -207,7 +207,7 @@ nv44_mpeg_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct nv44_mpeg *mpeg; - if (!(mpeg = kzalloc_obj(*mpeg, GFP_KERNEL))) + if (!(mpeg = kzalloc_obj(*mpeg))) return -ENOMEM; INIT_LIST_HEAD(&mpeg->chan); *pmpeg = &mpeg->engine; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c index 175a372a1de4..b3b3d0e1efc4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c @@ -43,7 +43,7 @@ nvkm_nvdec_new_(const struct nvkm_nvdec_fwif *fwif, struct nvkm_device *device, struct nvkm_nvdec *nvdec; int ret; - if (!(nvdec = *pnvdec = kzalloc_obj(*nvdec, GFP_KERNEL))) + if (!(nvdec = *pnvdec = kzalloc_obj(*nvdec))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_nvdec, device, type, inst, true, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c index d8e6c8b58643..aeda415a2dd3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c @@ -44,7 +44,7 @@ nvkm_nvenc_new_(const struct nvkm_nvenc_fwif *fwif, struct nvkm_device *device, struct nvkm_nvenc *nvenc; int ret; - if (!(nvenc = *pnvenc = kzalloc_obj(*nvenc, GFP_KERNEL))) + if (!(nvenc = *pnvenc = kzalloc_obj(*nvenc))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_nvenc, device, type, inst, true, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c index f8c0656f74c1..417ed23a6b81 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c @@ -137,7 +137,7 @@ nvkm_sec2_new_(const struct nvkm_sec2_fwif *fwif, struct nvkm_device *device, struct nvkm_sec2 *sec2; int ret; - if (!(sec2 = *psec2 = kzalloc_obj(*sec2, GFP_KERNEL))) + if (!(sec2 = *psec2 = kzalloc_obj(*sec2))) return -ENOMEM; ret = nvkm_engine_ctor(&nvkm_sec2, device, type, inst, true, &sec2->engine); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c index fb5c05e49b80..c119f1415a12 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/r535.c @@ -42,7 +42,7 @@ r535_sec2_new(const struct nvkm_sec2_func *func, struct nvkm_device *device, struct nvkm_sec2 *sec2; int ret; - if (!(sec2 = *psec2 = kzalloc_obj(*sec2, GFP_KERNEL))) + if (!(sec2 = *psec2 = kzalloc_obj(*sec2))) return -ENOMEM; ret = nvkm_engine_ctor(&r535_sec2, device, type, inst, true, &sec2->engine); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c index 3201ab862764..02aac061c1ee 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/base.c @@ -100,7 +100,7 @@ nvkm_sw_new_(const struct nvkm_sw_func *func, struct nvkm_device *device, { struct nvkm_sw *sw; - if (!(sw = *psw = kzalloc_obj(*sw, GFP_KERNEL))) + if (!(sw = *psw = kzalloc_obj(*sw))) return -ENOMEM; INIT_LIST_HEAD(&sw->chan); sw->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c index 42a1fcacb45b..0171cdf6f639 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/gf100.c @@ -110,7 +110,7 @@ gf100_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifoch, struct nv50_sw_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c index d1fc9c58653d..83b93ce06c64 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c @@ -111,7 +111,7 @@ nv04_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifo, { struct nv04_sw_chan *chan; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; atomic_set(&chan->ref, 0); *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c index cac43cedebf9..2ca044861508 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv10.c @@ -41,7 +41,7 @@ nv10_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifo, { struct nvkm_sw_chan *chan; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; *pobject = &chan->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c index 62d719241cf6..0cfb1eaae6de 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.c @@ -106,7 +106,7 @@ nv50_sw_chan_new(struct nvkm_sw *sw, struct nvkm_chan *fifoch, struct nv50_sw_chan *chan; int ret, i; - if (!(chan = kzalloc_obj(*chan, GFP_KERNEL))) + if (!(chan = kzalloc_obj(*chan))) return -ENOMEM; *pobject = &chan->base.object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c index 023b94c7abe0..ff0dd2153052 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.c @@ -64,7 +64,7 @@ nvkm_nvsw_new_(const struct nvkm_nvsw_func *func, struct nvkm_sw_chan *chan, { struct nvkm_nvsw *nvsw; - if (!(nvsw = kzalloc_obj(*nvsw, GFP_KERNEL))) + if (!(nvsw = kzalloc_obj(*nvsw))) return -ENOMEM; *pobject = &nvsw->object; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c b/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c index e1fa755134d5..127657d485b0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c @@ -181,7 +181,7 @@ nvkm_xtensa_new_(const struct nvkm_xtensa_func *func, struct nvkm_device *device { struct nvkm_xtensa *xtensa; - if (!(xtensa = kzalloc_obj(*xtensa, GFP_KERNEL))) + if (!(xtensa = kzalloc_obj(*xtensa))) return -ENOMEM; xtensa->func = func; xtensa->addr = addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c b/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c index 449ef127e56c..a73783fb5557 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c @@ -203,7 +203,7 @@ nvkm_falcon_cmdq_new(struct nvkm_falcon_qmgr *qmgr, const char *name, { struct nvkm_falcon_cmdq *cmdq = *pcmdq; - if (!(cmdq = *pcmdq = kzalloc_obj(*cmdq, GFP_KERNEL))) + if (!(cmdq = *pcmdq = kzalloc_obj(*cmdq))) return -ENOMEM; cmdq->qmgr = qmgr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c b/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c index 4bff735a08df..56d038ce9e6c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c @@ -203,7 +203,7 @@ nvkm_falcon_msgq_new(struct nvkm_falcon_qmgr *qmgr, const char *name, { struct nvkm_falcon_msgq *msgq = *pmsgq; - if (!(msgq = *pmsgq = kzalloc_obj(*msgq, GFP_KERNEL))) + if (!(msgq = *pmsgq = kzalloc_obj(*msgq))) return -ENOMEM; msgq->qmgr = qmgr; diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c b/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c index 4e1518b43fed..96aa621be4ed 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/qmgr.c @@ -73,7 +73,7 @@ nvkm_falcon_qmgr_new(struct nvkm_falcon *falcon, struct nvkm_falcon_qmgr *qmgr; int i; - if (!(qmgr = *pqmgr = kzalloc_obj(*qmgr, GFP_KERNEL))) + if (!(qmgr = *pqmgr = kzalloc_obj(*qmgr))) return -ENOMEM; qmgr->falcon = falcon; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c index 0f83774f31a1..4c7745cd6ae5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c @@ -251,7 +251,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev) nvkm_falcon_put(lsfw->falcon, subdev); - if (!(lsf = kmalloc_obj(*lsf, GFP_KERNEL))) + if (!(lsf = kmalloc_obj(*lsf))) return -ENOMEM; lsf->func = lsfw->func; lsf->falcon = lsfw->falcon; @@ -422,7 +422,7 @@ nvkm_acr_new_(const struct nvkm_acr_fwif *fwif, struct nvkm_device *device, struct nvkm_acr *acr; long wprfw; - if (!(acr = *pacr = kzalloc_obj(*acr, GFP_KERNEL))) + if (!(acr = *pacr = kzalloc_obj(*acr))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_acr, device, type, inst, &acr->subdev); INIT_LIST_HEAD(&acr->hsfw); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c index 70405ba5a87e..b3f84345ee53 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga100.c @@ -37,7 +37,7 @@ ga100_acr_hsfw_ctor(struct nvkm_acr *acr, const char *bl, const char *fw, { struct nvkm_acr_hsfw *hsfw; - if (!(hsfw = kzalloc_obj(*hsfw, GFP_KERNEL))) + if (!(hsfw = kzalloc_obj(*hsfw))) return -ENOMEM; hsfw->falcon_id = fwif->falcon_id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c index 77535b0d1d75..a9f0090b2310 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c @@ -32,7 +32,7 @@ ga102_acr_wpr_patch(struct nvkm_acr *acr, s64 adjust) struct nvkm_acr_lsfw *lsfw; u32 offset = 0; - lsb = kvmalloc_obj(*lsb, GFP_KERNEL); + lsb = kvmalloc_obj(*lsb); if (!lsb) return -ENOMEM; @@ -67,7 +67,7 @@ ga102_acr_wpr_build_lsb(struct nvkm_acr *acr, struct nvkm_acr_lsfw *lsfw) if (WARN_ON(lsfw->sig->size != sizeof(hdr->signature))) return -EINVAL; - hdr = kvzalloc_obj(*hdr, GFP_KERNEL); + hdr = kvzalloc_obj(*hdr); if (!hdr) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c index 5b812bed400d..fd78965d841f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c @@ -247,7 +247,7 @@ gm200_acr_hsfw_ctor(struct nvkm_acr *acr, const char *bl, const char *fw, const { struct nvkm_acr_hsfw *hsfw; - if (!(hsfw = kzalloc_obj(*hsfw, GFP_KERNEL))) + if (!(hsfw = kzalloc_obj(*hsfw))) return -ENOMEM; hsfw->falcon_id = fwif->falcon_id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c index ecf7500dc135..acb5e1dd4744 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c @@ -71,7 +71,7 @@ nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func *func, struct nvkm_acr *acr, } if (!lsfw) { - if (!(lsfw = kzalloc_obj(*lsfw, GFP_KERNEL))) + if (!(lsfw = kzalloc_obj(*lsfw))) return ERR_PTR(-ENOMEM); lsfw->id = id; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c index 8f45161e3f2b..a1fa1b0c8954 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c @@ -165,7 +165,7 @@ gf100_bar_new_(const struct nvkm_bar_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_bar **pbar) { struct gf100_bar *bar; - if (!(bar = kzalloc_obj(*bar, GFP_KERNEL))) + if (!(bar = kzalloc_obj(*bar))) return -ENOMEM; nvkm_bar_ctor(func, device, type, inst, &bar->base); bar->bar2_halve = nvkm_boolopt(device->cfgopt, "NvBar2Halve", false); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c index eb66234bc478..cf3bbaf1a85a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c @@ -223,7 +223,7 @@ nv50_bar_new_(const struct nvkm_bar_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u32 pgd_addr, struct nvkm_bar **pbar) { struct nv50_bar *bar; - if (!(bar = kzalloc_obj(*bar, GFP_KERNEL))) + if (!(bar = kzalloc_obj(*bar))) return -ENOMEM; nvkm_bar_ctor(func, device, type, inst, &bar->base); bar->pgd_addr = pgd_addr; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c index 9edc439ac790..fd3192df452e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c @@ -156,7 +156,7 @@ nvkm_bios_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct bit_entry bit_i; int ret, idx = 0; - if (!(bios = *pbios = kzalloc_obj(*bios, GFP_KERNEL))) + if (!(bios = *pbios = kzalloc_obj(*bios))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_bios, device, type, inst, &bios->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c index f1fec267ebad..5a481fa56fd5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c @@ -73,7 +73,7 @@ nvbios_iccsense_parse(struct nvkm_bios *bios, struct nvbios_iccsense *iccsense) } iccsense->nr_entry = cnt; - iccsense->rail = kmalloc_objs(struct pwr_rail_t, cnt, GFP_KERNEL); + iccsense->rail = kmalloc_objs(struct pwr_rail_t, cnt); if (!iccsense->rail) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c index 02c2551b82cf..e963090f95be 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c @@ -58,7 +58,7 @@ of_init(struct nvkm_bios *bios, const char *name) struct priv *priv; if (!(dn = pci_device_to_OF_node(pdev))) return ERR_PTR(-ENODEV); - if (!(priv = kzalloc_obj(*priv, GFP_KERNEL))) + if (!(priv = kzalloc_obj(*priv))) return ERR_PTR(-ENOMEM); if ((priv->data = of_get_property(dn, "NVDA,BMP", &priv->size))) return priv; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c index 72658f45cdf0..cb07c2a2d362 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c @@ -65,7 +65,7 @@ pcirom_init(struct nvkm_bios *bios, const char *name) if (!(ret = pci_enable_rom(pdev))) { if (ret = -ENOMEM, - (priv = kmalloc_obj(*priv, GFP_KERNEL))) { + (priv = kmalloc_obj(*priv))) { if (ret = -EFAULT, (priv->rom = pci_map_rom(pdev, &priv->size))) { priv->pdev = pdev; @@ -104,7 +104,7 @@ platform_init(struct nvkm_bios *bios, const char *name) if (!pdev->rom || pdev->romlen == 0) return ERR_PTR(-ENODEV); - if ((priv = kmalloc_obj(*priv, GFP_KERNEL))) { + if ((priv = kmalloc_obj(*priv))) { priv->size = pdev->romlen; if (ret = -ENODEV, (priv->rom = ioremap(pdev->rom, pdev->romlen))) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c index 0cae8502301a..d5411d176e3a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c @@ -102,7 +102,7 @@ pramin_init(struct nvkm_bios *bios, const char *name) } /* modify bar0 PRAMIN window to cover the bios image */ - if (!(priv = kmalloc_obj(*priv, GFP_KERNEL))) { + if (!(priv = kmalloc_obj(*priv))) { nvkm_error(subdev, "... out of memory\n"); return ERR_PTR(-ENOMEM); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c index 6c789ef5e341..ca1825b71669 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/base.c @@ -56,7 +56,7 @@ nvkm_bus_new_(const struct nvkm_bus_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_bus **pbus) { struct nvkm_bus *bus; - if (!(bus = *pbus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = *pbus = kzalloc_obj(*bus))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_bus, device, type, inst, &bus->subdev); bus->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c index 8cb4bc5fdedf..7cd19e77f6a1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c @@ -45,7 +45,7 @@ nvkm_hwsq_init(struct nvkm_subdev *subdev, struct nvkm_hwsq **phwsq) { struct nvkm_hwsq *hwsq; - hwsq = *phwsq = kmalloc_obj(*hwsq, GFP_KERNEL); + hwsq = *phwsq = kmalloc_obj(*hwsq); if (hwsq) { hwsq->subdev = subdev; hwsq->addr = ~0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c index 39b88d995411..572e63846315 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c @@ -239,7 +239,7 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate) if (volt && nvkm_volt_map_min(volt, cstepX.voltage) > volt->max_uv) return -EINVAL; - cstate = kzalloc_obj(*cstate, GFP_KERNEL); + cstate = kzalloc_obj(*cstate); if (!cstate) return -ENOMEM; @@ -416,7 +416,7 @@ nvkm_pstate_new(struct nvkm_clk *clk, int idx) if (perfE.pstate == 0xff) return 0; - pstate = kzalloc_obj(*pstate, GFP_KERNEL); + pstate = kzalloc_obj(*pstate); if (!pstate) return -ENOMEM; @@ -710,7 +710,7 @@ int nvkm_clk_new_(const struct nvkm_clk_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, bool allow_reclock, struct nvkm_clk **pclk) { - if (!(*pclk = kzalloc_obj(**pclk, GFP_KERNEL))) + if (!(*pclk = kzalloc_obj(**pclk))) return -ENOMEM; return nvkm_clk_ctor(func, device, type, inst, allow_reclock, *pclk); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c index ec1effd3417b..163c1b2b9b8d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c @@ -473,7 +473,7 @@ gf100_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gf100_clk *clk; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c index 8ef413154f7e..9860a50bb4ca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c @@ -509,7 +509,7 @@ gk104_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gk104_clk *clk; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 4a87023154ec..b1197fa70687 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -649,7 +649,7 @@ gk20a_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gk20a_clk *clk; int ret; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c index 59132544985a..73d696dbb698 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c @@ -919,7 +919,7 @@ gm20b_clk_new_speedo0(struct nvkm_device *device, enum nvkm_subdev_type type, in struct gk20a_clk *clk; int ret; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c index 13fea8f3e5c0..7fa8beb95180 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gp10b.c @@ -165,7 +165,7 @@ gp10b_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gp10b_clk *clk; int ret, i; - clk = kzalloc_obj(*clk, GFP_KERNEL); + clk = kzalloc_obj(*clk); if (!clk) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c index ed792f2b251e..5421200282b9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c @@ -542,7 +542,7 @@ gt215_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gt215_clk *clk; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c index 4960cf6acb2d..3d01de9b892c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c @@ -414,7 +414,7 @@ mcp77_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct mcp77_clk *clk; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c index de429f26fa4f..7fcba24855ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv40.c @@ -223,7 +223,7 @@ nv40_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct nv40_clk *clk; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; clk->base.pll_calc = nv04_clk_pll_calc; clk->base.pll_prog = nv04_clk_pll_prog; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c index aec4bb2b3550..630c4fc26500 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c @@ -513,7 +513,7 @@ nv50_clk_new_(const struct nvkm_clk_func *func, struct nvkm_device *device, struct nv50_clk *clk; int ret; - if (!(clk = kzalloc_obj(*clk, GFP_KERNEL))) + if (!(clk = kzalloc_obj(*clk))) return -ENOMEM; ret = nvkm_clk_ctor(func, device, type, inst, allow_reclock, &clk->base); *pclk = &clk->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c index 92b846d28869..ab97a177ea97 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c @@ -439,7 +439,7 @@ nv04_devinit_new_(const struct nvkm_devinit_func *func, struct nvkm_device *devi { struct nv04_devinit *init; - if (!(init = kzalloc_obj(*init, GFP_KERNEL))) + if (!(init = kzalloc_obj(*init))) return -ENOMEM; *pinit = &init->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c index 1eb0908dcb5c..0983a29a6655 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c @@ -150,7 +150,7 @@ nv50_devinit_new_(const struct nvkm_devinit_func *func, struct nvkm_device *devi { struct nv50_devinit *init; - if (!(init = kzalloc_obj(*init, GFP_KERNEL))) + if (!(init = kzalloc_obj(*init))) return -ENOMEM; *pinit = &init->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c index e226a2e24da5..9921dd3d3fd9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c @@ -36,7 +36,7 @@ r535_devinit_new(const struct nvkm_devinit_func *hw, struct nvkm_devinit_func *rm; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_devinit_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c index 0ebda68c7d96..92e38755c218 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c @@ -76,7 +76,7 @@ nvkm_fault_oneinit_buffer(struct nvkm_fault *fault, int id) struct nvkm_fault_buffer *buffer; int ret; - if (!(buffer = kzalloc_obj(*buffer, GFP_KERNEL))) + if (!(buffer = kzalloc_obj(*buffer))) return -ENOMEM; buffer->fault = fault; buffer->id = id; @@ -156,7 +156,7 @@ nvkm_fault_new_(const struct nvkm_fault_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fault **pfault) { struct nvkm_fault *fault; - if (!(fault = *pfault = kzalloc_obj(*fault, GFP_KERNEL))) + if (!(fault = *pfault = kzalloc_obj(*fault))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_fault, device, type, inst, &fault->subdev); fault->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c index f15635ea99b8..6f521653adaa 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c @@ -296,7 +296,7 @@ int nvkm_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb) { - if (!(*pfb = kzalloc_obj(**pfb, GFP_KERNEL))) + if (!(*pfb = kzalloc_obj(**pfb))) return -ENOMEM; return nvkm_fb_ctor(func, device, type, inst, *pfb); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c index 0c3e52e29baa..dc5cb6c54b13 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c @@ -112,7 +112,7 @@ gf100_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, { struct gf100_fb *fb; - if (!(fb = kzalloc_obj(*fb, GFP_KERNEL))) + if (!(fb = kzalloc_obj(*fb))) return -ENOMEM; nvkm_fb_ctor(func, device, type, inst, &fb->base); *pfb = &fb->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c index c2687ade0d7e..f1413fd193ad 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c @@ -244,7 +244,7 @@ nv50_fb_new_(const struct nv50_fb_func *func, struct nvkm_device *device, { struct nv50_fb *fb; - if (!(fb = kzalloc_obj(*fb, GFP_KERNEL))) + if (!(fb = kzalloc_obj(*fb))) return -ENOMEM; nvkm_fb_ctor(&nv50_fb_, device, type, inst, &fb->base); fb->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c index 167eb70143ce..9db6accc75a8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/r535.c @@ -35,7 +35,7 @@ r535_fb_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct nvkm_ram *ram; int ret; - if (!(ram = *pram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = *pram = kzalloc_obj(*ram))) return -ENOMEM; ram->func = &r535_fb_ram; @@ -71,7 +71,7 @@ r535_fb_new(const struct nvkm_fb_func *hw, struct nvkm_fb_func *rm; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_fb_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c index e3f161f27189..66274083e215 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c @@ -127,7 +127,7 @@ nvkm_ram_wrap(struct nvkm_device *device, u64 addr, u64 size, return -ENODEV; ram = device->fb->ram; - if (!(vram = kzalloc_obj(*vram, GFP_KERNEL))) + if (!(vram = kzalloc_obj(*vram))) return -ENOMEM; nvkm_memory_ctor(&nvkm_vram, &vram->memory); @@ -135,7 +135,7 @@ nvkm_ram_wrap(struct nvkm_device *device, u64 addr, u64 size, vram->page = NVKM_RAM_MM_SHIFT; *pmemory = &vram->memory; - vram->mn = kzalloc_obj(*vram->mn, GFP_KERNEL); + vram->mn = kzalloc_obj(*vram->mn); if (!vram->mn) return -ENOMEM; @@ -163,7 +163,7 @@ nvkm_ram_get(struct nvkm_device *device, u8 heap, u8 type, u8 rpage, u64 size, ram = device->fb->ram; mm = &ram->vram; - if (!(vram = kzalloc_obj(*vram, GFP_KERNEL))) + if (!(vram = kzalloc_obj(*vram))) return -ENOMEM; nvkm_memory_ctor(&nvkm_vram, &vram->memory); vram->ram = ram; @@ -257,7 +257,7 @@ int nvkm_ram_new_(const struct nvkm_ram_func *func, struct nvkm_fb *fb, enum nvkm_ram_type type, u64 size, struct nvkm_ram **pram) { - if (!(*pram = kzalloc_obj(**pram, GFP_KERNEL))) + if (!(*pram = kzalloc_obj(**pram))) return -ENOMEM; return nvkm_ram_ctor(func, fb, type, size, *pram); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c index 1367cb8adb8f..b6b8398eb254 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c @@ -572,7 +572,7 @@ gf100_ram_new_(const struct nvkm_ram_func *func, struct gf100_ram *ram; int ret; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c index 9bcbbe5469a3..f89e7101e65c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c @@ -1371,7 +1371,7 @@ gk104_ram_train_init(struct nvkm_ram *ram) struct gk104_ram_train *train; int ret, i; - if (!(train = kzalloc_obj(*train, GFP_KERNEL))) + if (!(train = kzalloc_obj(*train))) return -ENOMEM; for (i = 0; i < 0x100; i++) { @@ -1446,7 +1446,7 @@ gk104_ram_ctor_data(struct gk104_ram *ram, u8 ramcfg, int i) u32 data; int ret; - if (!(cfg = kmalloc_obj(*cfg, GFP_KERNEL))) + if (!(cfg = kmalloc_obj(*cfg))) return -ENOMEM; p = &list_last_entry(&ram->cfg, typeof(*cfg), head)->bios; n = &cfg->bios; @@ -1530,7 +1530,7 @@ gk104_ram_new_(const struct nvkm_ram_func *func, struct nvkm_fb *fb, u8 ramcfg = nvbios_ramcfg_index(subdev); u32 tmp; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c index fb958bb6c1d1..980aa9f2a7a1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp100.c @@ -91,7 +91,7 @@ gp100_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) { struct nvkm_ram *ram; - if (!(ram = *pram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = *pram = kzalloc_obj(*ram))) return -ENOMEM; return gf100_ram_ctor(&gp100_ram, fb, ram); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c index 6417ee503aaf..3135b46cbfcd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c @@ -942,7 +942,7 @@ gt215_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct gt215_ram *ram; int ret, i; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c index 2e1890ada5f9..56605cbf0130 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/rammcp77.c @@ -66,7 +66,7 @@ mcp77_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct mcp77_ram *ram; int ret; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c index 5dc6012c67cd..53d37c9cc7ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c @@ -192,7 +192,7 @@ nv40_ram_new_(struct nvkm_fb *fb, enum nvkm_ram_type type, u64 size, struct nvkm_ram **pram) { struct nv40_ram *ram; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; return nvkm_ram_ctor(&nv40_ram_func, fb, type, size, &ram->base); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c index d767a6488e4c..be15519d0c96 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c @@ -587,7 +587,7 @@ nv50_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct nv50_ram *ram; int ret, i; - if (!(ram = kzalloc_obj(*ram, GFP_KERNEL))) + if (!(ram = kzalloc_obj(*ram))) return -ENOMEM; *pram = &ram->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c index ba24758d5ed1..b782fef91dca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c @@ -55,7 +55,7 @@ nvkm_fsp_new_(const struct nvkm_fsp_func *func, { struct nvkm_fsp *fsp; - fsp = *pfsp = kzalloc_obj(*fsp, GFP_KERNEL); + fsp = *pfsp = kzalloc_obj(*fsp); if (!fsp) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c index ad5c0de62459..c1318e92e1f4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c @@ -45,7 +45,7 @@ nvkm_fuse_new_(const struct nvkm_fuse_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fuse **pfuse) { struct nvkm_fuse *fuse; - if (!(fuse = *pfuse = kzalloc_obj(*fuse, GFP_KERNEL))) + if (!(fuse = *pfuse = kzalloc_obj(*fuse))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_fuse, device, type, inst, &fuse->subdev); fuse->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c index d8b434a7276d..7a90196d2d09 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c @@ -227,7 +227,7 @@ nvkm_gpio_new_(const struct nvkm_gpio_func *func, struct nvkm_device *device, { struct nvkm_gpio *gpio; - if (!(gpio = *pgpio = kzalloc_obj(*gpio, GFP_KERNEL))) + if (!(gpio = *pgpio = kzalloc_obj(*gpio))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_gpio, device, type, inst, &gpio->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c index 3952b96a5abb..9ba1316831e7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c @@ -132,7 +132,7 @@ nvkm_gsp_new_(const struct nvkm_gsp_fwif *fwif, struct nvkm_device *device, { struct nvkm_gsp *gsp; - if (!(gsp = *pgsp = kzalloc_obj(*gsp, GFP_KERNEL))) + if (!(gsp = *pgsp = kzalloc_obj(*gsp))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_gsp, device, type, inst, &gsp->subdev); @@ -148,7 +148,7 @@ nvkm_gsp_new_(const struct nvkm_gsp_fwif *fwif, struct nvkm_device *device, if (fwif->rm) { nvkm_info(&gsp->subdev, "RM version: %s\n", fwif->ver); - gsp->rm = kzalloc_obj(*gsp->rm, GFP_KERNEL); + gsp->rm = kzalloc_obj(*gsp->rm); if (!gsp->rm) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c index 01c90b592dca..b1a2ebd94a45 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/engine.c @@ -44,7 +44,7 @@ nvkm_rm_engine_obj_new(struct nvkm_gsp_object *chan, int chid, const struct nvkm struct nvkm_rm_engine_obj *obj; int ret; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return -ENOMEM; @@ -130,7 +130,7 @@ nvkm_rm_engine_new_(struct nvkm_rm *rm, enum nvkm_subdev_type type, int inst, u3 struct nvkm_engine *engine; int ret; - engine = kzalloc_obj(*engine, GFP_KERNEL); + engine = kzalloc_obj(*engine); if (!engine) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c index c13aaeb9fc89..a726f44583cb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gr.c @@ -74,7 +74,7 @@ nvkm_rm_gr_new(struct nvkm_rm *rm) func->sclass[i].ctor = nvkm_rm_gr_obj_ctor; } - gr = kzalloc_obj(*gr, GFP_KERNEL); + gr = kzalloc_obj(*gr); if (!gr) { kfree(func); return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c index c0c6695bd547..e2a74973a1e8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvdec.c @@ -17,7 +17,7 @@ nvkm_rm_nvdec_new(struct nvkm_rm *rm, int inst) struct nvkm_nvdec *nvdec; int ret; - nvdec = kzalloc_obj(*nvdec, GFP_KERNEL); + nvdec = kzalloc_obj(*nvdec); if (!nvdec) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c index db1c8b508b08..0da6a3e0c8f9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/nvenc.c @@ -17,7 +17,7 @@ nvkm_rm_nvenc_new(struct nvkm_rm *rm, int inst) struct nvkm_nvenc *nvenc; int ret; - nvenc = kzalloc_obj(*nvenc, GFP_KERNEL); + nvenc = kzalloc_obj(*nvenc); if (!nvenc) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c index 37d0e21905bf..fae08ac3b18c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/bar.c @@ -169,7 +169,7 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device, struct nvkm_bar *bar; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_bar_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c index c0d3d4f66d30..700cea5def35 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c @@ -184,7 +184,7 @@ fbsr_vram(struct fbsr *fbsr, const char *type, u64 addr, u64 size) { struct fbsr_item *item; - if (!(item = kzalloc_obj(*item, GFP_KERNEL))) + if (!(item = kzalloc_obj(*item))) return false; item->type = type; @@ -309,7 +309,7 @@ r535_instmem_new(const struct nvkm_instmem_func *hw, struct nvkm_instmem_func *rm; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_instmem_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c index 3d20574f5f70..76ee938efea3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c @@ -591,7 +591,7 @@ r535_fifo_new(const struct nvkm_fifo_func *hw, struct nvkm_device *device, const struct nvkm_rm_gpu *gpu = device->gsp->rm->gpu; struct nvkm_fifo_func *rm; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_fifo_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c index d9029a87c010..7fe488d4d5ff 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gr.c @@ -147,7 +147,7 @@ r535_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *chan, const struct nvkm struct r535_gr_chan *grc; int ret; - if (!(grc = kzalloc_obj(*grc, GFP_KERNEL))) + if (!(grc = kzalloc_obj(*grc))) return -ENOMEM; nvkm_object_ctor(&r535_gr_chan, oclass, &grc->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c index 9fd073619c38..e10192fe1d0f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c @@ -2003,7 +2003,7 @@ static void r535_gsp_retain_logging(struct nvkm_gsp *gsp) goto exit; } - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) goto error; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c index 8ce33b757589..1ff42f1a8486 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c @@ -171,7 +171,7 @@ r535_mmu_new(const struct nvkm_mmu_func *hw, struct nvkm_mmu_func *rm; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_mmu_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c index 9e523e0d0a10..f01abe193e25 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c @@ -107,7 +107,7 @@ anx9805_bus_new(struct nvkm_i2c_pad *base, int id, u8 drive, struct anx9805_bus *bus; int ret; - if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus))) return -ENOMEM; *pbus = &bus->base; bus->pad = pad; @@ -236,7 +236,7 @@ anx9805_aux_new(struct nvkm_i2c_pad *base, int id, u8 drive, struct anx9805_aux *aux; int ret; - if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux))) return -ENOMEM; *pbus = &aux->base; aux->pad = pad; @@ -267,7 +267,7 @@ anx9805_pad_new(struct nvkm_i2c_bus *bus, int id, u8 addr, { struct anx9805_pad *pad; - if (!(pad = kzalloc_obj(*pad, GFP_KERNEL))) + if (!(pad = kzalloc_obj(*pad))) return -ENOMEM; *ppad = &pad->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c index 62b8b9d2d03b..383af72f006e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c @@ -209,7 +209,7 @@ nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *func, struct nvkm_i2c_pad *pad, int id, struct nvkm_i2c_aux **paux) { - if (!(*paux = kzalloc_obj(**paux, GFP_KERNEL))) + if (!(*paux = kzalloc_obj(**paux))) return -ENOMEM; return nvkm_i2c_aux_ctor(func, pad, id, *paux); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c index 4906dad21347..f41bd332064d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c @@ -171,7 +171,7 @@ g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *func, { struct g94_i2c_aux *aux; - if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux))) return -ENOMEM; *paux = &aux->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c index 3f0ed4057e9c..b8a16eddc553 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c @@ -177,7 +177,7 @@ gm200_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive, { struct gm200_i2c_aux *aux; - if (!(aux = kzalloc_obj(*aux, GFP_KERNEL))) + if (!(aux = kzalloc_obj(*aux))) return -ENOMEM; *paux = &aux->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c index 42b9df6d6825..bd256e99feed 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c @@ -266,7 +266,7 @@ nvkm_i2c_new_(const struct nvkm_i2c_func *func, struct nvkm_device *device, u8 ver, hdr; int ret, i, ids; - if (!(i2c = *pi2c = kzalloc_obj(*i2c, GFP_KERNEL))) + if (!(i2c = *pi2c = kzalloc_obj(*i2c))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_i2c, device, type, inst, &i2c->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c index 84d6c0238be2..5129f692ae1c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c @@ -232,7 +232,7 @@ nvkm_i2c_bus_ctor(const struct nvkm_i2c_bus_func *func, if ( bus->func->drive_scl && !nvkm_boolopt(device->cfgopt, "NvI2C", internal)) { - if (!(bit = kzalloc_obj(*bit, GFP_KERNEL))) + if (!(bit = kzalloc_obj(*bit))) return -ENOMEM; bit->udelay = 10; bit->timeout = usecs_to_jiffies(2200); @@ -258,7 +258,7 @@ nvkm_i2c_bus_new_(const struct nvkm_i2c_bus_func *func, struct nvkm_i2c_pad *pad, int id, struct nvkm_i2c_bus **pbus) { - if (!(*pbus = kzalloc_obj(**pbus, GFP_KERNEL))) + if (!(*pbus = kzalloc_obj(**pbus))) return -ENOMEM; return nvkm_i2c_bus_ctor(func, pad, id, *pbus); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c index 598df4da20b6..a0fdc623d204 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c @@ -85,7 +85,7 @@ gf119_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, { struct gf119_i2c_bus *bus; - if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c index 1a83c872d9d0..04e180257553 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c @@ -85,7 +85,7 @@ nv04_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, u8 sense, { struct nv04_i2c_bus *bus; - if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c index 3019cab91e4b..b9b08860939d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv4e.c @@ -76,7 +76,7 @@ nv4e_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, { struct nv4e_i2c_bus *bus; - if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c index 995abbf8ef61..29db5cae8358 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv50.c @@ -102,7 +102,7 @@ nv50_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8 drive, return -ENODEV; } - if (!(bus = kzalloc_obj(*bus, GFP_KERNEL))) + if (!(bus = kzalloc_obj(*bus))) return -ENOMEM; *pbus = &bus->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c index 7b167b691fc6..b4b9c24b7130 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c @@ -109,7 +109,7 @@ int nvkm_i2c_pad_new_(const struct nvkm_i2c_pad_func *func, struct nvkm_i2c *i2c, int id, struct nvkm_i2c_pad **ppad) { - if (!(*ppad = kzalloc_obj(**ppad, GFP_KERNEL))) + if (!(*ppad = kzalloc_obj(**ppad))) return -ENOMEM; nvkm_i2c_pad_ctor(func, i2c, id, *ppad); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c index 365747909077..3ccdbbe2fad0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c @@ -188,7 +188,7 @@ nvkm_iccsense_create_sensor(struct nvkm_iccsense *iccsense, u8 id) return NULL; } - sensor = kmalloc_obj(*sensor, GFP_KERNEL); + sensor = kmalloc_obj(*sensor); if (!sensor) return NULL; @@ -279,7 +279,7 @@ nvkm_iccsense_oneinit(struct nvkm_subdev *subdev) continue; } - rail = kmalloc_obj(*rail, GFP_KERNEL); + rail = kmalloc_obj(*rail); if (!rail) return -ENOMEM; @@ -322,7 +322,7 @@ int nvkm_iccsense_new_(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_iccsense **iccsense) { - if (!(*iccsense = kzalloc_obj(**iccsense, GFP_KERNEL))) + if (!(*iccsense = kzalloc_obj(**iccsense))) return -ENOMEM; INIT_LIST_HEAD(&(*iccsense)->sensors); INIT_LIST_HEAD(&(*iccsense)->rails); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c index dab22c47d85e..8f85fc88bdb6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c @@ -387,7 +387,7 @@ gk20a_instobj_ctor_dma(struct gk20a_instmem *imem, u32 npages, u32 align, struct nvkm_subdev *subdev = &imem->base.subdev; struct device *dev = subdev->device->dev; - if (!(node = kzalloc_obj(*node, GFP_KERNEL))) + if (!(node = kzalloc_obj(*node))) return -ENOMEM; *_node = &node->base; @@ -577,7 +577,7 @@ gk20a_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int in struct nvkm_device_tegra *tdev = device->func->tegra(device); struct gk20a_instmem *imem; - if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem))) return -ENOMEM; nvkm_instmem_ctor(&gk20a_instmem, device, type, inst, &imem->base); mutex_init(&imem->lock); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c index 247a7bf5fe39..c6859a775085 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv04.c @@ -125,7 +125,7 @@ nv04_instobj_new(struct nvkm_instmem *base, u32 size, u32 align, bool zero, struct nv04_instobj *iobj; int ret; - if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -267,7 +267,7 @@ nv04_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int ins { struct nv04_instmem *imem; - if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem))) return -ENOMEM; nvkm_instmem_ctor(&nv04_instmem, device, type, inst, &imem->base); *pimem = &imem->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c index 5a0f30d94198..ee790d70a92b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c @@ -124,7 +124,7 @@ nv40_instobj_new(struct nvkm_instmem *base, u32 size, u32 align, bool zero, struct nv40_instobj *iobj; int ret; - if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -240,7 +240,7 @@ nv40_instmem_new(struct nvkm_device *device, enum nvkm_subdev_type type, int ins { struct nv40_instmem *imem; - if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem))) return -ENOMEM; nvkm_instmem_ctor(&nv40_instmem, device, type, inst, &imem->base); *pimem = &imem->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c index d6c781ae57e9..6fbaa1e5876d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c @@ -360,7 +360,7 @@ nv50_instobj_wrap(struct nvkm_instmem *base, struct nv50_instmem *imem = nv50_instmem(base); struct nv50_instobj *iobj; - if (!(iobj = kzalloc_obj(*iobj, GFP_KERNEL))) + if (!(iobj = kzalloc_obj(*iobj))) return -ENOMEM; *pmemory = &iobj->base.memory; @@ -431,7 +431,7 @@ nv50_instmem_new_(const struct nvkm_instmem_func *func, { struct nv50_instmem *imem; - if (!(imem = kzalloc_obj(*imem, GFP_KERNEL))) + if (!(imem = kzalloc_obj(*imem))) return -ENOMEM; nvkm_instmem_ctor(func, device, type, inst, &imem->base); INIT_LIST_HEAD(&imem->lru); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c index 7c1652bc28cd..371892c9cf44 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c @@ -133,7 +133,7 @@ nvkm_ltc_new_(const struct nvkm_ltc_func *func, struct nvkm_device *device, { struct nvkm_ltc *ltc; - if (!(ltc = *pltc = kzalloc_obj(*ltc, GFP_KERNEL))) + if (!(ltc = *pltc = kzalloc_obj(*ltc))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_ltc, device, type, inst, <c->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c index 2d7e6d6f8760..5f85c806abd7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c @@ -130,7 +130,7 @@ nvkm_mc_new_(const struct nvkm_mc_func *func, struct nvkm_device *device, struct nvkm_mc *mc; int ret; - if (!(mc = *pmc = kzalloc_obj(*mc, GFP_KERNEL))) + if (!(mc = *pmc = kzalloc_obj(*mc))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_mc, device, type, inst, &mc->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c index 2d9c4d6f9162..df86214183cc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c @@ -68,13 +68,13 @@ nvkm_mmu_ptp_get(struct nvkm_mmu *mmu, u32 size, bool zero) struct nvkm_mmu_ptp *ptp; int slot; - if (!(pt = kzalloc_obj(*pt, GFP_KERNEL))) + if (!(pt = kzalloc_obj(*pt))) return NULL; ptp = list_first_entry_or_null(&mmu->ptp.list, typeof(*ptp), head); if (!ptp) { /* Need to allocate a new parent to sub-allocate from. */ - if (!(ptp = kmalloc_obj(*ptp, GFP_KERNEL))) { + if (!(ptp = kmalloc_obj(*ptp))) { kfree(pt); return NULL; } @@ -126,7 +126,7 @@ nvkm_mmu_ptc_find(struct nvkm_mmu *mmu, u32 size) return ptc; } - ptc = kmalloc_obj(*ptc, GFP_KERNEL); + ptc = kmalloc_obj(*ptc); if (ptc) { INIT_LIST_HEAD(&ptc->item); ptc->size = size; @@ -199,7 +199,7 @@ nvkm_mmu_ptc_get(struct nvkm_mmu *mmu, u32 size, u32 align, bool zero) mutex_unlock(&mmu->ptc.mutex); /* No such luck, we need to allocate. */ - if (!(pt = kmalloc_obj(*pt, GFP_KERNEL))) + if (!(pt = kmalloc_obj(*pt))) return NULL; pt->ptc = ptc; pt->sub = false; @@ -434,7 +434,7 @@ int nvkm_mmu_new_(const struct nvkm_mmu_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mmu **pmmu) { - if (!(*pmmu = kzalloc_obj(**pmmu, GFP_KERNEL))) + if (!(*pmmu = kzalloc_obj(**pmmu))) return -ENOMEM; nvkm_mmu_ctor(func, device, type, inst, *pmmu); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c index 96b620ed07ca..81fecf852e98 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/mem.c @@ -163,7 +163,7 @@ nvkm_mem_new_host(struct nvkm_mmu *mmu, int type, u8 page, u64 size, if (page != PAGE_SHIFT) return -EINVAL; - if (!(mem = kzalloc_obj(*mem, GFP_KERNEL))) + if (!(mem = kzalloc_obj(*mem))) return -ENOMEM; mem->target = target; mem->mmu = mmu; @@ -191,9 +191,9 @@ nvkm_mem_new_host(struct nvkm_mmu *mmu, int type, u8 page, u64 size, nvkm_memory_ctor(&nvkm_mem_dma, &mem->memory); size = ALIGN(size, PAGE_SIZE) >> PAGE_SHIFT; - if (!(mem->mem = kvmalloc_objs(*mem->mem, size, GFP_KERNEL))) + if (!(mem->mem = kvmalloc_objs(*mem->mem, size))) return -ENOMEM; - if (!(mem->dma = kvmalloc_objs(*mem->dma, size, GFP_KERNEL))) + if (!(mem->dma = kvmalloc_objs(*mem->dma, size))) return -ENOMEM; if (mmu->dma_bits > 32) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c index 79ab3a99d98c..456d7356b3e5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c @@ -161,7 +161,7 @@ nvkm_umem_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, if (type >= mmu->type_nr) return -EINVAL; - if (!(umem = kzalloc_obj(*umem, GFP_KERNEL))) + if (!(umem = kzalloc_obj(*umem))) return -ENOMEM; nvkm_object_ctor(&nvkm_umem, oclass, &umem->object); umem->mmu = mmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c index 8de3a707b5c2..cc450e7bb3fd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ummu.c @@ -172,7 +172,7 @@ nvkm_ummu_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, } else return ret; - if (!(ummu = kzalloc_obj(*ummu, GFP_KERNEL))) + if (!(ummu = kzalloc_obj(*ummu))) return -ENOMEM; nvkm_object_ctor(&nvkm_ummu, oclass, &ummu->object); ummu->mmu = mmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c index 1778daa0af3a..fefbe65af9f1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c @@ -551,7 +551,7 @@ nvkm_uvmm_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, } else return ret; - if (!(uvmm = kzalloc_obj(*uvmm, GFP_KERNEL))) + if (!(uvmm = kzalloc_obj(*uvmm))) return -ENOMEM; nvkm_object_ctor(&nvkm_uvmm, oclass, &uvmm->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c index 3a53ce15ea29..958fd78080bd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c @@ -59,7 +59,7 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc, bool sparse, pgt->sparse = sparse; if (desc->type == PGD) { - pgt->pde = kvzalloc_objs(*pgt->pde, pten, GFP_KERNEL); + pgt->pde = kvzalloc_objs(*pgt->pde, pten); if (!pgt->pde) { kfree(pgt); return NULL; @@ -823,7 +823,7 @@ nvkm_vmm_ptes_get_map(struct nvkm_vmm *vmm, const struct nvkm_vmm_page *page, struct nvkm_vma * nvkm_vma_new(u64 addr, u64 size) { - struct nvkm_vma *vma = kzalloc_obj(*vma, GFP_KERNEL); + struct nvkm_vma *vma = kzalloc_obj(*vma); if (vma) { vma->addr = addr; vma->size = size; @@ -1226,7 +1226,7 @@ nvkm_vmm_new_(const struct nvkm_vmm_func *func, struct nvkm_mmu *mmu, struct lock_class_key *key, const char *name, struct nvkm_vmm **pvmm) { - if (!(*pvmm = kzalloc_obj(**pvmm, GFP_KERNEL))) + if (!(*pvmm = kzalloc_obj(**pvmm))) return -ENOMEM; return nvkm_vmm_ctor(func, mmu, hdr, managed, addr, size, key, name, *pvmm); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c index 86f038ebb360..5217ce64d005 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c @@ -346,7 +346,7 @@ nv50_vmm_join(struct nvkm_vmm *vmm, struct nvkm_memory *inst) u64 data; u32 pdei; - if (!(join = kmalloc_obj(*join, GFP_KERNEL))) + if (!(join = kmalloc_obj(*join))) return -ENOMEM; join->inst = inst; list_add_tail(&join->head, &vmm->join); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c index 6d6c4b831a58..26ec50b66e66 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c @@ -238,7 +238,7 @@ nvkm_mxm_new_(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u8 ver, len; u16 data; - if (!(mxm = *pmxm = kzalloc_obj(*mxm, GFP_KERNEL))) + if (!(mxm = *pmxm = kzalloc_obj(*mxm))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_mxm, device, type, inst, &mxm->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c index f357d777bc96..bd421d5b1faf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c @@ -162,7 +162,7 @@ nvkm_pci_new_(const struct nvkm_pci_func *func, struct nvkm_device *device, { struct nvkm_pci *pci; - if (!(pci = *ppci = kzalloc_obj(**ppci, GFP_KERNEL))) + if (!(pci = *ppci = kzalloc_obj(**ppci))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_pci_func, device, type, inst, &pci->subdev); pci->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c index 0d7cfd73ff17..e556b1905702 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c @@ -161,7 +161,7 @@ nvkm_pmu_new_(const struct nvkm_pmu_fwif *fwif, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pmu **ppmu) { struct nvkm_pmu *pmu; - if (!(pmu = *ppmu = kzalloc_obj(*pmu, GFP_KERNEL))) + if (!(pmu = *ppmu = kzalloc_obj(*pmu))) return -ENOMEM; return nvkm_pmu_ctor(fwif, device, type, inst, *ppmu); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c index 46abf56cc830..9831d849e4d7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c @@ -215,7 +215,7 @@ gk20a_pmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct gk20a_pmu *pmu; int ret; - if (!(pmu = kzalloc_obj(*pmu, GFP_KERNEL))) + if (!(pmu = kzalloc_obj(*pmu))) return -ENOMEM; *ppmu = &pmu->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c index 0fed890a8f95..cdbadb5b71d7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c @@ -53,7 +53,7 @@ nvkm_memx_init(struct nvkm_pmu *pmu, struct nvkm_memx **pmemx) if (ret) return ret; - memx = *pmemx = kzalloc_obj(*memx, GFP_KERNEL); + memx = *pmemx = kzalloc_obj(*memx); if (!memx) return -ENOMEM; memx->pmu = pmu; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c index 2613f5872bcd..224222914f1c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c @@ -447,7 +447,7 @@ nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, { struct nvkm_therm *therm; - if (!(therm = *ptherm = kzalloc_obj(*therm, GFP_KERNEL))) + if (!(therm = *ptherm = kzalloc_obj(*therm))) return -ENOMEM; nvkm_therm_ctor(therm, device, type, inst, func); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c index 92737c2770b6..8970422c9eeb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fannil.c @@ -40,7 +40,7 @@ nvkm_fannil_create(struct nvkm_therm *therm) { struct nvkm_fan *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); therm->fan = priv; if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c index aa13cd45785a..7e61be4bcf88 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c @@ -97,7 +97,7 @@ nvkm_fanpwm_create(struct nvkm_therm *therm, struct dcb_gpio_func *func) therm->func->pwm_get(therm, func->line, &divs, &duty) == -ENODEV) return -ENODEV; - fan = kzalloc_obj(*fan, GFP_KERNEL); + fan = kzalloc_obj(*fan); if (!fan) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c index 6cfe7fee54f0..4b8e2c3bef59 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c @@ -99,7 +99,7 @@ nvkm_fantog_create(struct nvkm_therm *therm, struct dcb_gpio_func *func) return ret; } - fan = kzalloc_obj(*fan, GFP_KERNEL); + fan = kzalloc_obj(*fan); if (!fan) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c index f58f4add5ef3..b816fd304238 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c @@ -112,7 +112,7 @@ gk104_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, const struct gf100_idle_filter *idle_filter, struct nvkm_therm **ptherm) { - struct gk104_therm *therm = kzalloc_obj(*therm, GFP_KERNEL); + struct gk104_therm *therm = kzalloc_obj(*therm); if (!therm) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c index dcb4763e1c08..e971b6643483 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c @@ -187,7 +187,7 @@ nvkm_timer_new_(const struct nvkm_timer_func *func, struct nvkm_device *device, { struct nvkm_timer *tmr; - if (!(tmr = *ptmr = kzalloc_obj(*tmr, GFP_KERNEL))) + if (!(tmr = *ptmr = kzalloc_obj(*tmr))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_timer, device, type, inst, &tmr->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c index fb55ff2b2a46..c987c4abe15c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c @@ -26,7 +26,7 @@ struct nvkm_top_device * nvkm_top_device_new(struct nvkm_top *top) { - struct nvkm_top_device *info = kmalloc_obj(*info, GFP_KERNEL); + struct nvkm_top_device *info = kmalloc_obj(*info); if (info) { info->type = NVKM_SUBDEV_NR; info->inst = -1; @@ -152,7 +152,7 @@ nvkm_top_new_(const struct nvkm_top_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_top **ptop) { struct nvkm_top *top; - if (!(top = *ptop = kzalloc_obj(*top, GFP_KERNEL))) + if (!(top = *ptop = kzalloc_obj(*top))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_top, device, type, inst, &top->subdev); top->func = func; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c index 3d584be9e201..c0258bcfe8f5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/base.c @@ -39,7 +39,7 @@ nvkm_vfn_new_(const struct nvkm_vfn_func *func, struct nvkm_device *device, struct nvkm_vfn *vfn; int ret; - if (!(vfn = *pvfn = kzalloc_obj(*vfn, GFP_KERNEL))) + if (!(vfn = *pvfn = kzalloc_obj(*vfn))) return -ENOMEM; nvkm_subdev_ctor(&nvkm_vfn, device, type, inst, &vfn->subdev); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c index e01ea0dcd529..36709c0e3bb4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/r535.c @@ -38,7 +38,7 @@ r535_vfn_new(const struct nvkm_vfn_func *hw, struct nvkm_vfn_func *rm; int ret; - if (!(rm = kzalloc_obj(*rm, GFP_KERNEL))) + if (!(rm = kzalloc_obj(*rm))) return -ENOMEM; rm->dtor = r535_vfn_dtor; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c index 27fd15559796..0004cf642ec6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c @@ -56,7 +56,7 @@ nvkm_uvfn_new(struct nvkm_device *device, const struct nvkm_oclass *oclass, if (argc != 0) return -ENOSYS; - if (!(uvfn = kzalloc_obj(*uvfn, GFP_KERNEL))) + if (!(uvfn = kzalloc_obj(*uvfn))) return -ENOMEM; nvkm_object_ctor(&nvkm_uvfn, oclass, &uvfn->object); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c index 8bb3761e547b..f0c66f9b4b1f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c @@ -321,7 +321,7 @@ int nvkm_volt_new_(const struct nvkm_volt_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_volt **pvolt) { - if (!(*pvolt = kzalloc_obj(**pvolt, GFP_KERNEL))) + if (!(*pvolt = kzalloc_obj(**pvolt))) return -ENOMEM; nvkm_volt_ctor(func, device, type, inst, *pvolt); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c index 5146666ea0f5..7bc264fb753b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c @@ -113,7 +113,7 @@ gk104_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, volt_func = &gk104_volt_pwm; } - if (!(volt = kzalloc_obj(*volt, GFP_KERNEL))) + if (!(volt = kzalloc_obj(*volt))) return -ENOMEM; nvkm_volt_ctor(volt_func, device, type, inst, &volt->base); *pvolt = &volt->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c index 5941a1eeabd9..5aef95c9f20f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c @@ -176,7 +176,7 @@ gk20a_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, { struct gk20a_volt *volt; - volt = kzalloc_obj(*volt, GFP_KERNEL); + volt = kzalloc_obj(*volt); if (!volt) return -ENOMEM; *pvolt = &volt->base; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c index 7348acb147bf..5a2a909b57eb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c @@ -77,7 +77,7 @@ gm20b_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, return -EINVAL; } - volt = kzalloc_obj(*volt, GFP_KERNEL); + volt = kzalloc_obj(*volt); if (!volt) return -ENOMEM; *pvolt = &volt->base; diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index c3cca5234f67..78b74217f952 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -4603,7 +4603,7 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) int r = 0; struct device_node *np = pdev->dev.of_node; - dispc = kzalloc_obj(*dispc, GFP_KERNEL); + dispc = kzalloc_obj(*dispc); if (!dispc) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 1269978ba292..27fe7bca9e2c 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -1041,7 +1041,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p) unsigned long flags; struct dsi_irq_stats *stats; - stats = kmalloc_obj(*stats, GFP_KERNEL); + stats = kmalloc_obj(*stats); if (!stats) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 791d88933084..53b7938a3d05 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -928,7 +928,7 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name, { struct dss_debugfs_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -1419,7 +1419,7 @@ static int dss_probe(struct platform_device *pdev) struct dss_device *dss; int r; - dss = kzalloc_obj(*dss, GFP_KERNEL); + dss = kzalloc_obj(*dss); if (!dss) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index ba730242ad74..ee4c0119d408 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -716,7 +716,7 @@ static void omap_crtc_reset(struct drm_crtc *crtc) kfree(crtc->state); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_crtc_reset(crtc, &state->base); } @@ -731,7 +731,7 @@ omap_crtc_duplicate_state(struct drm_crtc *crtc) current_state = to_omap_crtc_state(crtc->state); - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; @@ -793,7 +793,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev, DBG("%s", channel_names[channel]); - omap_crtc = kzalloc_obj(*omap_crtc, GFP_KERNEL); + omap_crtc = kzalloc_obj(*omap_crtc); if (!omap_crtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index 8312c4d14348..839b8d0092f2 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -536,7 +536,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, unsigned long flags; u32 slot_bytes; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return ERR_PTR(-ENOMEM); @@ -571,7 +571,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, struct tiler_block *tiler_reserve_1d(size_t size) { - struct tiler_block *block = kzalloc_obj(*block, GFP_KERNEL); + struct tiler_block *block = kzalloc_obj(*block); int num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned long flags; @@ -774,7 +774,7 @@ static int omap_dmm_probe(struct platform_device *dev) u32 hwinfo, pat_geom; struct resource *mem; - omap_dmm = kzalloc_obj(*omap_dmm, GFP_KERNEL); + omap_dmm = kzalloc_obj(*omap_dmm); if (!omap_dmm) goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 206018aab88e..bf0bad8c8cf1 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -146,7 +146,7 @@ static int omap_atomic_update_normalize_zpos(struct drm_device *dev, struct drm_plane_state **states; int ret = 0; - states = kmalloc_objs(*states, total_planes, GFP_KERNEL); + states = kmalloc_objs(*states, total_planes); if (!states) return -ENOMEM; @@ -285,7 +285,7 @@ static int omap_global_obj_init(struct drm_device *dev) struct omap_drm_private *priv = dev->dev_private; struct omap_global_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; @@ -798,7 +798,7 @@ static int pdev_probe(struct platform_device *pdev) } /* Allocate and initialize the driver private structure. */ - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 2577ba92b1b9..b02c46d70f29 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -122,7 +122,7 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct drm_encoder *encoder = NULL; struct omap_encoder *omap_encoder; - omap_encoder = kzalloc_obj(*omap_encoder, GFP_KERNEL); + omap_encoder = kzalloc_obj(*omap_encoder); if (!omap_encoder) goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index c3b1bea75f7f..1df232232a64 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -390,7 +390,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, goto fail; } - omap_fb = kzalloc_obj(*omap_fb, GFP_KERNEL); + omap_fb = kzalloc_obj(*omap_fb); if (!omap_fb) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 63c4bfc9a5c0..8e013e4f2c6b 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -254,7 +254,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) * DSS, GPU, etc. are not cache coherent: */ if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { - addrs = kmalloc_objs(*addrs, npages, GFP_KERNEL); + addrs = kmalloc_objs(*addrs, npages); if (!addrs) { ret = -ENOMEM; goto free_pages; @@ -278,7 +278,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) } } } else { - addrs = kzalloc_objs(*addrs, npages, GFP_KERNEL); + addrs = kzalloc_objs(*addrs, npages); if (!addrs) { ret = -ENOMEM; goto free_pages; @@ -989,7 +989,7 @@ struct sg_table *omap_gem_get_sg(struct drm_gem_object *obj, if (sgt) goto out; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto err_unpin; @@ -1319,7 +1319,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, } /* Allocate the initialize the OMAP GEM object. */ - omap_obj = kzalloc_obj(*omap_obj, GFP_KERNEL); + omap_obj = kzalloc_obj(*omap_obj); if (!omap_obj) return NULL; @@ -1410,7 +1410,7 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size, unsigned int ret; npages = DIV_ROUND_UP(size, PAGE_SIZE); - pages = kzalloc_objs(*pages, npages, GFP_KERNEL); + pages = kzalloc_objs(*pages, npages); if (!pages) { omap_gem_free_object(obj); return ERR_PTR(-ENOMEM); @@ -1470,7 +1470,7 @@ void omap_gem_init(struct drm_device *dev) return; } - usergart = kzalloc_objs(*usergart, 3, GFP_KERNEL); + usergart = kzalloc_objs(*usergart, 3); if (!usergart) return; diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c index b1da72838824..d0f895c43ee4 100644 --- a/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/drivers/gpu/drm/omapdrm/omap_irq.c @@ -43,7 +43,7 @@ struct omap_irq_wait * omap_irq_wait_init(struct drm_device *dev, u32 irqmask, int count) { struct omap_drm_private *priv = dev->dev_private; - struct omap_irq_wait *wait = kzalloc_obj(*wait, GFP_KERNEL); + struct omap_irq_wait *wait = kzalloc_obj(*wait); unsigned long flags; init_waitqueue_head(&wait->wq); diff --git a/drivers/gpu/drm/omapdrm/omap_overlay.c b/drivers/gpu/drm/omapdrm/omap_overlay.c index 3b673662bf99..77c1b78d0163 100644 --- a/drivers/gpu/drm/omapdrm/omap_overlay.c +++ b/drivers/gpu/drm/omapdrm/omap_overlay.c @@ -159,7 +159,7 @@ static struct omap_hw_overlay *omap_overlay_init(enum omap_plane_id overlay_id, { struct omap_hw_overlay *overlay; - overlay = kzalloc_obj(*overlay, GFP_KERNEL); + overlay = kzalloc_obj(*overlay); if (!overlay) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index ff2c692c3ede..0e09d8f1fe5e 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -410,7 +410,7 @@ static void omap_plane_reset(struct drm_plane *plane) if (plane->state) drm_atomic_helper_plane_destroy_state(plane, plane->state); - omap_state = kzalloc_obj(*omap_state, GFP_KERNEL); + omap_state = kzalloc_obj(*omap_state); if (!omap_state) return; @@ -427,7 +427,7 @@ omap_plane_atomic_duplicate_state(struct drm_plane *plane) current_state = to_omap_plane_state(plane->state); - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; @@ -533,7 +533,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, if (WARN_ON(idx >= num_planes)) return ERR_PTR(-EINVAL); - omap_plane = kzalloc_obj(*omap_plane, GFP_KERNEL); + omap_plane = kzalloc_obj(*omap_plane); if (!omap_plane) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 191d909f5845..711f5101aa04 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -316,7 +316,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, goto out_put_syncout; } - job = kzalloc_obj(*job, GFP_KERNEL); + job = kzalloc_obj(*job); if (!job) { ret = -ENOMEM; goto out_put_jm_ctx; @@ -597,7 +597,7 @@ static int panfrost_ioctl_sync_bo(struct drm_device *ddev, void *data, if (!args->op_count) return 0; - ops = kvmalloc_objs(*ops, args->op_count, GFP_KERNEL); + ops = kvmalloc_objs(*ops, args->op_count); if (!ops) { DRM_DEBUG("Failed to allocate incoming BO sync ops array\n"); return -ENOMEM; @@ -682,7 +682,7 @@ panfrost_open(struct drm_device *dev, struct drm_file *file) struct panfrost_device *pfdev = to_panfrost_device(dev); struct panfrost_file_priv *panfrost_priv; - panfrost_priv = kzalloc_obj(*panfrost_priv, GFP_KERNEL); + panfrost_priv = kzalloc_obj(*panfrost_priv); if (!panfrost_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index a70847a73f98..822633da741e 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -175,7 +175,7 @@ int panfrost_gem_open(struct drm_gem_object *obj, struct drm_file *file_priv) struct panfrost_file_priv *priv = file_priv->driver_priv; struct panfrost_gem_mapping *mapping; - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) return -ENOMEM; @@ -429,7 +429,7 @@ struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t struct panfrost_device *pfdev = to_panfrost_device(dev); struct panfrost_gem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 862acf9c8422..d59b4863b8ad 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -95,7 +95,7 @@ static struct dma_fence *panfrost_fence_create(struct panfrost_device *pfdev, in struct panfrost_fence *fence; struct panfrost_job_slot *js = pfdev->js; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return ERR_PTR(-ENOMEM); @@ -1053,7 +1053,7 @@ int panfrost_jm_ctx_create(struct drm_file *file, struct panfrost_jm_ctx *jm_ctx; int ret; - jm_ctx = kzalloc_obj(*jm_ctx, GFP_KERNEL); + jm_ctx = kzalloc_obj(*jm_ctx); if (!jm_ctx) return -ENOMEM; diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 71eef57af549..4a3162c3b659 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -794,7 +794,7 @@ struct panfrost_mmu *panfrost_mmu_ctx_create(struct panfrost_device *pfdev) fmt = ARM_MALI_LPAE; } - mmu = kzalloc_obj(*mmu, GFP_KERNEL); + mmu = kzalloc_obj(*mmu); if (!mmu) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c index e1e51daba356..1bcec6a2e3e0 100644 --- a/drivers/gpu/drm/panthor/panthor_drv.c +++ b/drivers/gpu/drm/panthor/panthor_drv.c @@ -382,7 +382,7 @@ panthor_submit_ctx_add_sync_signal(struct panthor_submit_ctx *ctx, u32 handle, u struct dma_fence *cur_fence; int ret; - sig_sync = kzalloc_obj(*sig_sync, GFP_KERNEL); + sig_sync = kzalloc_obj(*sig_sync); if (!sig_sync) return -ENOMEM; @@ -1471,7 +1471,7 @@ panthor_open(struct drm_device *ddev, struct drm_file *file) struct panthor_file *pfile; int ret; - pfile = kzalloc_obj(*pfile, GFP_KERNEL); + pfile = kzalloc_obj(*pfile); if (!pfile) return -ENOMEM; diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c index 3d94f9cc94d6..4b4575dd6e90 100644 --- a/drivers/gpu/drm/panthor/panthor_gem.c +++ b/drivers/gpu/drm/panthor/panthor_gem.c @@ -183,7 +183,7 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm, if (drm_WARN_ON(&ptdev->base, !vm)) return ERR_PTR(-EINVAL); - kbo = kzalloc_obj(*kbo, GFP_KERNEL); + kbo = kzalloc_obj(*kbo); if (!kbo) return ERR_PTR(-ENOMEM); @@ -399,7 +399,7 @@ struct drm_gem_object *panthor_gem_create_object(struct drm_device *ddev, size_t { struct panthor_gem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_heap.c b/drivers/gpu/drm/panthor/panthor_heap.c index ded9cb83842c..1ee30dc7066f 100644 --- a/drivers/gpu/drm/panthor/panthor_heap.c +++ b/drivers/gpu/drm/panthor/panthor_heap.c @@ -145,7 +145,7 @@ static int panthor_alloc_heap_chunk(struct panthor_heap_pool *pool, struct panthor_heap_chunk_header *hdr; int ret; - chunk = kmalloc_obj(*chunk, GFP_KERNEL); + chunk = kmalloc_obj(*chunk); if (!chunk) return -ENOMEM; @@ -303,7 +303,7 @@ int panthor_heap_create(struct panthor_heap_pool *pool, if (!vm) return -EINVAL; - heap = kzalloc_obj(*heap, GFP_KERNEL); + heap = kzalloc_obj(*heap); if (!heap) { ret = -ENOMEM; goto err_put_vm; @@ -541,7 +541,7 @@ panthor_heap_pool_create(struct panthor_device *ptdev, struct panthor_vm *vm) struct panthor_heap_pool *pool; int ret = 0; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index c482bbe6fffd..c5ebe68d5a97 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -1159,7 +1159,7 @@ panthor_vm_op_ctx_prealloc_vmas(struct panthor_vm_op_ctx *op_ctx) } for (u32 i = 0; i < vma_count; i++) { - struct panthor_vma *vma = kzalloc_obj(*vma, GFP_KERNEL); + struct panthor_vma *vma = kzalloc_obj(*vma); if (!vma) return -ENOMEM; @@ -1586,7 +1586,7 @@ void panthor_vm_pool_destroy(struct panthor_file *pfile) */ int panthor_vm_pool_create(struct panthor_file *pfile) { - pfile->vms = kzalloc_obj(*pfile->vms, GFP_KERNEL); + pfile->vms = kzalloc_obj(*pfile->vms); if (!pfile->vms) return -ENOMEM; @@ -2425,7 +2425,7 @@ panthor_vm_create(struct panthor_device *ptdev, bool for_mcu, struct panthor_vm *vm; int ret; - vm = kzalloc_obj(*vm, GFP_KERNEL); + vm = kzalloc_obj(*vm); if (!vm) return ERR_PTR(-ENOMEM); @@ -2608,7 +2608,7 @@ panthor_vm_bind_job_create(struct drm_file *file, if (vm->destroyed || vm->unusable) return ERR_PTR(-EINVAL); - job = kzalloc_obj(*job, GFP_KERNEL); + job = kzalloc_obj(*job); if (!job) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c index e40d7be90bb9..bd703a2904a1 100644 --- a/drivers/gpu/drm/panthor/panthor_sched.c +++ b/drivers/gpu/drm/panthor/panthor_sched.c @@ -3512,7 +3512,7 @@ group_create_queue(struct panthor_group *group, if (args->priority > CSF_MAX_QUEUE_PRIO) return ERR_PTR(-EINVAL); - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return ERR_PTR(-ENOMEM); @@ -3659,7 +3659,7 @@ int panthor_group_create(struct panthor_file *pfile, hweight64(group_args->tiler_core_mask) < group_args->max_tiler_cores) return -EINVAL; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; @@ -3853,7 +3853,7 @@ int panthor_group_pool_create(struct panthor_file *pfile) { struct panthor_group_pool *gpool; - gpool = kzalloc_obj(*gpool, GFP_KERNEL); + gpool = kzalloc_obj(*gpool); if (!gpool) return -ENOMEM; @@ -3979,7 +3979,7 @@ panthor_job_create(struct panthor_file *pfile, if (qsubmit->latest_flush & GENMASK(30, 24)) return ERR_PTR(-EINVAL); - job = kzalloc_obj(*job, GFP_KERNEL); + job = kzalloc_obj(*job); if (!job) return ERR_PTR(-ENOMEM); @@ -4011,7 +4011,7 @@ panthor_job_create(struct panthor_file *pfile, * the previously submitted job. */ if (job->call_info.size) { - job->done_fence = kzalloc_obj(*job->done_fence, GFP_KERNEL); + job->done_fence = kzalloc_obj(*job->done_fence); if (!job->done_fence) { ret = -ENOMEM; goto err_put_job; diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index 47c7f4e68dc6..0be2c4334b74 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -63,7 +63,7 @@ qxl_ring_create(struct qxl_ring_header *header, { struct qxl_ring *ring; - ring = kmalloc_obj(*ring, GFP_KERNEL); + ring = kmalloc_obj(*ring); if (!ring) return NULL; diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 3b6e48b28480..f5bd6e96fb90 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -1008,7 +1008,7 @@ static int qdev_crtc_init(struct drm_device *dev, int crtc_id) struct qxl_device *qdev = to_qxl(dev); int r; - qxl_crtc = kzalloc_obj(struct qxl_crtc, GFP_KERNEL); + qxl_crtc = kzalloc_obj(struct qxl_crtc); if (!qxl_crtc) return -ENOMEM; @@ -1159,7 +1159,7 @@ static int qdev_output_init(struct drm_device *dev, int num_output) struct drm_encoder *encoder; int ret; - qxl_output = kzalloc_obj(struct qxl_output, GFP_KERNEL); + qxl_output = kzalloc_obj(struct qxl_output); if (!qxl_output) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_image.c b/drivers/gpu/drm/qxl/qxl_image.c index 01c56913b582..578e8aa63f24 100644 --- a/drivers/gpu/drm/qxl/qxl_image.c +++ b/drivers/gpu/drm/qxl/qxl_image.c @@ -40,7 +40,7 @@ qxl_allocate_chunk(struct qxl_device *qdev, struct qxl_drm_chunk *chunk; int ret; - chunk = kmalloc_obj(struct qxl_drm_chunk, GFP_KERNEL); + chunk = kmalloc_obj(struct qxl_drm_chunk); if (!chunk) return -ENOMEM; @@ -63,7 +63,7 @@ qxl_image_alloc_objects(struct qxl_device *qdev, struct qxl_drm_image *image; int ret; - image = kmalloc_obj(struct qxl_drm_image, GFP_KERNEL); + image = kmalloc_obj(struct qxl_drm_image); if (!image) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 14b325703034..313f6c30cac8 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -116,7 +116,7 @@ int qxl_bo_create(struct qxl_device *qdev, unsigned long size, else type = ttm_bo_type_device; *bo_ptr = NULL; - bo = kzalloc_obj(struct qxl_bo, GFP_KERNEL); + bo = kzalloc_obj(struct qxl_bo); if (bo == NULL) return -ENOMEM; size = roundup(size, PAGE_SIZE); diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index ec2b1120aef9..b1bf1e798cc6 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -177,7 +177,7 @@ int qxl_release_list_add(struct qxl_release *release, struct qxl_bo *bo) return 0; } - entry = kmalloc_obj(struct qxl_bo_list, GFP_KERNEL); + entry = kmalloc_obj(struct qxl_bo_list); if (!entry) return -ENOMEM; diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 7ac5e40ac851..5d495c4798a3 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -109,7 +109,7 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo, { struct ttm_tt *ttm; - ttm = kzalloc_obj(struct ttm_tt, GFP_KERNEL); + ttm = kzalloc_obj(struct ttm_tt); if (ttm == NULL) return NULL; if (ttm_tt_init(ttm, bo, page_flags, ttm_cached, 0)) { diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 01bbbde30914..dbd192650c69 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -1281,7 +1281,7 @@ struct atom_context *atom_parse(struct card_info *card, void *bios) { int base; struct atom_context *ctx = - kzalloc_obj(struct atom_context, GFP_KERNEL); + kzalloc_obj(struct atom_context); char *str; char name[512]; int i; diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 0ed85b5dd193..eba8618ccbf1 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -218,7 +218,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, return; } - pdata = kmalloc_obj(struct radeon_backlight_privdata, GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_backlight_privdata); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -2678,7 +2678,7 @@ radeon_add_atom_encoder(struct drm_device *dev, } /* add a new one */ - radeon_encoder = kzalloc_obj(struct radeon_encoder, GFP_KERNEL); + radeon_encoder = kzalloc_obj(struct radeon_encoder); if (!radeon_encoder) return; diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index 36486a9c7b06..670cb0683396 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -1992,7 +1992,7 @@ static int btc_initialize_mc_reg_table(struct radeon_device *rdev) struct evergreen_mc_reg_table *eg_table = &eg_pi->mc_reg_table; u8 module_index = rv770_get_memory_module_index(rdev); - table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table); if (!table) return -ENOMEM; @@ -2526,7 +2526,7 @@ int btc_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - eg_pi = kzalloc_obj(struct evergreen_power_info, GFP_KERNEL); + eg_pi = kzalloc_obj(struct evergreen_power_info); if (eg_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = eg_pi; diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index f8de657c3ed0..6814262d2c8f 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -4579,7 +4579,7 @@ static int ci_initialize_mc_reg_table(struct radeon_device *rdev) u8 module_index = rv770_get_memory_module_index(rdev); int ret; - table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table); if (!table) return -ENOMEM; @@ -5533,7 +5533,7 @@ static int ci_parse_power_table(struct radeon_device *rdev) ret = -EINVAL; goto err_free_ps; } - ps = kzalloc_obj(struct ci_ps, GFP_KERNEL); + ps = kzalloc_obj(struct ci_ps); if (ps == NULL) { ret = -ENOMEM; goto err_free_ps; @@ -5637,7 +5637,7 @@ int ci_dpm_init(struct radeon_device *rdev) struct pci_dev *root = rdev->pdev->bus->self; int ret; - pi = kzalloc_obj(struct ci_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct ci_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 1fe0eecb3ea3..aef702ff12ee 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c @@ -2028,7 +2028,7 @@ int cypress_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - eg_pi = kzalloc_obj(struct evergreen_power_info, GFP_KERNEL); + eg_pi = kzalloc_obj(struct evergreen_power_info); if (eg_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = eg_pi; diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 257caf19583a..3142ef4da7f4 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -2769,7 +2769,7 @@ int evergreen_cs_parse(struct radeon_cs_parser *p) if (p->track == NULL) { /* initialize tracker, we are in kms */ - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (track == NULL) return -ENOMEM; evergreen_cs_track_init(track); diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 7c896c24f03d..1544c24f4647 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -2470,7 +2470,7 @@ static int kv_parse_power_table(struct radeon_device *rdev) &non_clock_info_array->nonClockInfo[non_clock_array_index]; if (!rdev->pm.power_state[i].clock_info) return -EINVAL; - ps = kzalloc_obj(struct kv_ps, GFP_KERNEL); + ps = kzalloc_obj(struct kv_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -2519,7 +2519,7 @@ int kv_dpm_init(struct radeon_device *rdev) struct kv_power_info *pi; int ret, i; - pi = kzalloc_obj(struct kv_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct kv_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index c4305bacd47d..05bc2131376c 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -2104,7 +2104,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev) if (ni_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc_obj(SMC_NISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); + spll_table = kzalloc_obj(SMC_NISLANDS_SPLL_DIV_TABLE); if (spll_table == NULL) return -ENOMEM; @@ -2879,7 +2879,7 @@ static int ni_initialize_mc_reg_table(struct radeon_device *rdev) struct ni_mc_reg_table *ni_table = &ni_pi->mc_reg_table; u8 module_index = rv770_get_memory_module_index(rdev); - table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table); if (!table) return -ENOMEM; @@ -3147,7 +3147,7 @@ static int ni_initialize_smc_cac_tables(struct radeon_device *rdev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc_obj(PP_NIslands_CACTABLES, GFP_KERNEL); + cac_tables = kzalloc_obj(PP_NIslands_CACTABLES); if (!cac_tables) return -ENOMEM; @@ -4018,7 +4018,7 @@ static int ni_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc_obj(struct ni_ps, GFP_KERNEL); + ps = kzalloc_obj(struct ni_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -4051,7 +4051,7 @@ int ni_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - ni_pi = kzalloc_obj(struct ni_power_info, GFP_KERNEL); + ni_pi = kzalloc_obj(struct ni_power_info); if (ni_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = ni_pi; diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 53d336b15662..3ac1a79b6f13 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -2063,7 +2063,7 @@ int r100_cs_parse(struct radeon_cs_parser *p) struct r100_cs_track *track; int r; - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (!track) return -ENOMEM; r100_cs_track_clear(p->rdev, track); diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index aad94b49671c..60a784769120 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -1284,7 +1284,7 @@ int r300_cs_parse(struct radeon_cs_parser *p) struct r100_cs_track *track; int r; - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (track == NULL) return -ENOMEM; r100_cs_track_clear(p->rdev, track); diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 5db10ad3fd8b..17b2ff2387aa 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -2282,7 +2282,7 @@ int r600_cs_parse(struct radeon_cs_parser *p) if (p->track == NULL) { /* initialize tracker, we are in kms */ - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (track == NULL) return -ENOMEM; r600_cs_track_init(track); diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index cfe851bf1848..c407db0c26aa 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -1197,7 +1197,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset + le16_to_cpu(ext_hdr->usPPMTableOffset)); rdev->pm.dpm.dyn_state.ppm_table = - kzalloc_obj(struct radeon_ppm_table, GFP_KERNEL); + kzalloc_obj(struct radeon_ppm_table); if (!rdev->pm.dpm.dyn_state.ppm_table) { r600_free_extended_power_table(rdev); return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index fb75d0bb8726..84cf71bc1330 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c @@ -132,7 +132,7 @@ struct radeon_agp_head *radeon_agp_head_init(struct drm_device *dev) struct pci_dev *pdev = to_pci_dev(dev->dev); struct radeon_agp_head *head; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (!head) return NULL; head->bridge = agp_find_bridge(pdev); diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 35c37b6054ad..c4c11d25c636 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -1632,7 +1632,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct lvds_info = (union lvds_info *)(mode_info->atom_context->bios + data_offset); lvds = - kzalloc_obj(struct radeon_encoder_atom_dig, GFP_KERNEL); + kzalloc_obj(struct radeon_encoder_atom_dig); if (!lvds) return NULL; @@ -1961,7 +1961,7 @@ radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) dac_info = (struct _COMPASSIONATE_DATA *) (mode_info->atom_context->bios + data_offset); - tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac, GFP_KERNEL); + tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac); if (!tv_dac) return NULL; diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 6cb0b7cfe510..b96b556b80c8 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -851,7 +851,7 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct struct radeon_encoder_primary_dac *p_dac; int found = 0; - p_dac = kzalloc_obj(struct radeon_encoder_primary_dac, GFP_KERNEL); + p_dac = kzalloc_obj(struct radeon_encoder_primary_dac); if (!p_dac) return NULL; @@ -1001,7 +1001,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct struct radeon_encoder_tv_dac *tv_dac; int found = 0; - tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac, GFP_KERNEL); + tv_dac = kzalloc_obj(struct radeon_encoder_tv_dac); if (!tv_dac) return NULL; @@ -1089,7 +1089,7 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct uint32_t ppll_div_sel, ppll_val; uint32_t lvds_ss_gen_cntl = RREG32(RADEON_LVDS_SS_GEN_CNTL); - lvds = kzalloc_obj(struct radeon_encoder_lvds, GFP_KERNEL); + lvds = kzalloc_obj(struct radeon_encoder_lvds); if (!lvds) return NULL; @@ -1164,7 +1164,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE); if (lcd_info) { - lvds = kzalloc_obj(struct radeon_encoder_lvds, GFP_KERNEL); + lvds = kzalloc_obj(struct radeon_encoder_lvds); if (!lvds) return NULL; @@ -2634,9 +2634,9 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) if (rdev->pm.power_state) { /* allocate 1 clock mode per state */ rdev->pm.power_state[0].clock_info = - kzalloc_objs(struct radeon_pm_clock_info, 1, GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, 1); rdev->pm.power_state[1].clock_info = - kzalloc_objs(struct radeon_pm_clock_info, 1, GFP_KERNEL); + kzalloc_objs(struct radeon_pm_clock_info, 1); if (!rdev->pm.power_state[0].clock_info || !rdev->pm.power_state[1].clock_info) goto pm_failed; diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index e5bf06d7b981..b4377dbc99f0 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1887,7 +1887,7 @@ radeon_add_atom_connector(struct drm_device *dev, } } - radeon_connector = kzalloc_obj(struct radeon_connector, GFP_KERNEL); + radeon_connector = kzalloc_obj(struct radeon_connector); if (!radeon_connector) return; @@ -2385,7 +2385,7 @@ radeon_add_legacy_connector(struct drm_device *dev, } } - radeon_connector = kzalloc_obj(struct radeon_connector, GFP_KERNEL); + radeon_connector = kzalloc_obj(struct radeon_connector); if (!radeon_connector) return; diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 3b2cbd69b58b..f021e58d454f 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -93,7 +93,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) p->dma_reloc_idx = 0; /* FIXME: we assume that each relocs use 4 dwords */ p->nrelocs = chunk->length_dw / 4; - p->relocs = kvzalloc_objs(struct radeon_bo_list, p->nrelocs, GFP_KERNEL); + p->relocs = kvzalloc_objs(struct radeon_bo_list, p->nrelocs); if (p->relocs == NULL) { return -ENOMEM; } diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index c58d24fe74f9..5d523d5dae88 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -974,7 +974,7 @@ static uint32_t cail_ioreg_read(struct card_info *info, uint32_t reg) int radeon_atombios_init(struct radeon_device *rdev) { struct card_info *atom_card_info = - kzalloc_obj(struct card_info, GFP_KERNEL); + kzalloc_obj(struct card_info); if (!atom_card_info) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 4296ebd3dd94..589dc9df34aa 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -494,7 +494,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, unsigned long flags; int r; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (work == NULL) return -ENOMEM; @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index) struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc; - radeon_crtc = kzalloc_obj(*radeon_crtc, GFP_KERNEL); + radeon_crtc = kzalloc_obj(*radeon_crtc); if (radeon_crtc == NULL) return; @@ -1346,7 +1346,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, return ERR_PTR(-EINVAL); } - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index 9d760c221c5a..18d61f3f7344 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -228,7 +228,7 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper *fb_helper, } rbo = gem_to_radeon_bo(gobj); - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) { ret = -ENOMEM; goto err_radeon_fbdev_destroy_pinned_object; diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 6a13299089d5..02a40e4750c7 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -137,7 +137,7 @@ int radeon_fence_emit(struct radeon_device *rdev, u64 seq; /* we are protected by the ring emission mutex */ - *fence = kmalloc_obj(struct radeon_fence, GFP_KERNEL); + *fence = kmalloc_obj(struct radeon_fence); if ((*fence) == NULL) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index 007d9353b1ab..13a091ec797b 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c @@ -912,7 +912,7 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, if (rec->mm_i2c && (radeon_hw_i2c == 0)) return NULL; - i2c = kzalloc_obj(struct radeon_i2c_chan, GFP_KERNEL); + i2c = kzalloc_obj(struct radeon_i2c_chan); if (i2c == NULL) return NULL; diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 9833d77170fc..dc43fd790a9c 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -640,7 +640,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) /* new gpu have virtual address space support */ if (rdev->family >= CHIP_CAYMAN) { - fpriv = kzalloc_obj(*fpriv, GFP_KERNEL); + fpriv = kzalloc_obj(*fpriv); if (unlikely(!fpriv)) { r = -ENOMEM; goto err_suspend; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index f2bb046a595e..1f82e2b57f5d 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -394,7 +394,7 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, return; } - pdata = kmalloc_obj(struct radeon_backlight_privdata, GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_backlight_privdata); if (!pdata) { DRM_ERROR("Memory allocation failed\n"); goto error; @@ -1695,7 +1695,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeon struct radeon_encoder_int_tmds *tmds; bool ret; - tmds = kzalloc_obj(struct radeon_encoder_int_tmds, GFP_KERNEL); + tmds = kzalloc_obj(struct radeon_encoder_int_tmds); if (!tmds) return NULL; @@ -1721,7 +1721,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra if (rdev->is_atom_bios) return NULL; - tmds = kzalloc_obj(struct radeon_encoder_ext_tmds, GFP_KERNEL); + tmds = kzalloc_obj(struct radeon_encoder_ext_tmds); if (!tmds) return NULL; @@ -1752,7 +1752,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_ } /* add a new one */ - radeon_encoder = kzalloc_obj(struct radeon_encoder, GFP_KERNEL); + radeon_encoder = kzalloc_obj(struct radeon_encoder); if (!radeon_encoder) return; diff --git a/drivers/gpu/drm/radeon/radeon_semaphore.c b/drivers/gpu/drm/radeon/radeon_semaphore.c index 28331fef03c5..da0a0b28f2b8 100644 --- a/drivers/gpu/drm/radeon/radeon_semaphore.c +++ b/drivers/gpu/drm/radeon/radeon_semaphore.c @@ -36,7 +36,7 @@ int radeon_semaphore_create(struct radeon_device *rdev, { int r; - *semaphore = kmalloc_obj(struct radeon_semaphore, GFP_KERNEL); + *semaphore = kmalloc_obj(struct radeon_semaphore); if (*semaphore == NULL) { return -ENOMEM; } diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index cab04dccbd1d..0b459f7df23b 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c @@ -60,7 +60,7 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) n = rdev->mc.gtt_size - rdev->gart_pin_size; n /= size; - gtt_obj = kzalloc_objs(*gtt_obj, n, GFP_KERNEL); + gtt_obj = kzalloc_objs(*gtt_obj, n); if (!gtt_obj) { DRM_ERROR("Failed to allocate %d pointers\n", n); r = 1; diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 4cb141b052b6..e7ab8162ac69 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -492,7 +492,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo, #endif rbo = container_of(bo, struct radeon_bo, tbo); - gtt = kzalloc_obj(struct radeon_ttm_tt, GFP_KERNEL); + gtt = kzalloc_obj(struct radeon_ttm_tt); if (gtt == NULL) { return NULL; } @@ -533,7 +533,7 @@ static int radeon_ttm_tt_populate(struct ttm_device *bdev, bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); if (gtt && gtt->userptr) { - ttm->sg = kzalloc_obj(struct sg_table, GFP_KERNEL); + ttm->sg = kzalloc_obj(struct sg_table); if (!ttm->sg) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 5be6cf123d8d..170f1688c211 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c @@ -321,7 +321,7 @@ struct radeon_bo_va *radeon_vm_bo_add(struct radeon_device *rdev, { struct radeon_bo_va *bo_va; - bo_va = kzalloc_obj(struct radeon_bo_va, GFP_KERNEL); + bo_va = kzalloc_obj(struct radeon_bo_va); if (bo_va == NULL) return NULL; @@ -495,7 +495,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, if (bo_va->it.start || bo_va->it.last) { /* add a clone of the bo_va to clear the old address */ struct radeon_bo_va *tmp; - tmp = kzalloc_obj(struct radeon_bo_va, GFP_KERNEL); + tmp = kzalloc_obj(struct radeon_bo_va); if (!tmp) { mutex_unlock(&vm->mutex); r = -ENOMEM; diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c index 813ef291b349..af0a032e3ded 100644 --- a/drivers/gpu/drm/radeon/rs780_dpm.c +++ b/drivers/gpu/drm/radeon/rs780_dpm.c @@ -826,7 +826,7 @@ static int rs780_parse_power_table(struct radeon_device *rdev) le16_to_cpu(power_info->pplib.usClockInfoArrayOffset) + (power_state->v1.ucClockStateIndices[0] * power_info->pplib.ucClockInfoSize)); - ps = kzalloc_obj(struct igp_ps, GFP_KERNEL); + ps = kzalloc_obj(struct igp_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -853,7 +853,7 @@ int rs780_dpm_init(struct radeon_device *rdev) u8 frev, crev; int ret; - pi = kzalloc_obj(struct igp_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct igp_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index 2a4c5d79271b..3cb8842fce65 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c @@ -1905,7 +1905,7 @@ static int rv6xx_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc_obj(struct rv6xx_ps, GFP_KERNEL); + ps = kzalloc_obj(struct rv6xx_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1936,7 +1936,7 @@ int rv6xx_dpm_init(struct radeon_device *rdev) struct rv6xx_power_info *pi; int ret; - pi = kzalloc_obj(struct rv6xx_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct rv6xx_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index 0de4b5171aac..4d6ed9668ad1 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c @@ -2301,7 +2301,7 @@ int rv7xx_parse_power_table(struct radeon_device *rdev) power_info->pplib.ucNonClockSize)); if (power_info->pplib.ucStateEntrySize - 1) { u8 *idx; - ps = kzalloc_obj(struct rv7xx_ps, GFP_KERNEL); + ps = kzalloc_obj(struct rv7xx_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -2348,7 +2348,7 @@ int rv770_dpm_init(struct radeon_device *rdev) struct atom_clock_dividers dividers; int ret; - pi = kzalloc_obj(struct rv7xx_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct rv7xx_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index b7897f89dee8..e4e725e4f4e7 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -2419,7 +2419,7 @@ static int si_initialize_smc_dte_tables(struct radeon_device *rdev) if (dte_data->k <= 0) return -EINVAL; - dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration, GFP_KERNEL); + dte_tables = kzalloc_obj(Smc_SIslands_DTE_Configuration); if (dte_tables == NULL) { si_pi->enable_dte = false; return -ENOMEM; @@ -2599,7 +2599,7 @@ static int si_initialize_smc_cac_tables(struct radeon_device *rdev) if (ni_pi->enable_cac == false) return 0; - cac_tables = kzalloc_obj(PP_SIslands_CacConfig, GFP_KERNEL); + cac_tables = kzalloc_obj(PP_SIslands_CacConfig); if (!cac_tables) return -ENOMEM; @@ -2794,7 +2794,7 @@ static int si_init_smc_spll_table(struct radeon_device *rdev) if (si_pi->spll_table_start == 0) return -EINVAL; - spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE, GFP_KERNEL); + spll_table = kzalloc_obj(SMC_SISLANDS_SPLL_DIV_TABLE); if (spll_table == NULL) return -ENOMEM; @@ -5479,7 +5479,7 @@ static int si_initialize_mc_reg_table(struct radeon_device *rdev) u8 module_index = rv770_get_memory_module_index(rdev); int ret; - table = kzalloc_obj(struct atom_mc_reg_table, GFP_KERNEL); + table = kzalloc_obj(struct atom_mc_reg_table); if (!table) return -ENOMEM; @@ -6791,7 +6791,7 @@ static int si_parse_power_table(struct radeon_device *rdev) &non_clock_info_array->nonClockInfo[non_clock_array_index]; if (!rdev->pm.power_state[i].clock_info) return -EINVAL; - ps = kzalloc_obj(struct ni_ps, GFP_KERNEL); + ps = kzalloc_obj(struct ni_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -6848,7 +6848,7 @@ int si_dpm_init(struct radeon_device *rdev) struct pci_dev *root = rdev->pdev->bus->self; int ret; - si_pi = kzalloc_obj(struct si_power_info, GFP_KERNEL); + si_pi = kzalloc_obj(struct si_power_info); if (si_pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = si_pi; diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index 43d452b65c6a..5f14adeee13e 100644 --- a/drivers/gpu/drm/radeon/sumo_dpm.c +++ b/drivers/gpu/drm/radeon/sumo_dpm.c @@ -1494,7 +1494,7 @@ static int sumo_parse_power_table(struct radeon_device *rdev) kfree(rdev->pm.dpm.ps); return -EINVAL; } - ps = kzalloc_obj(struct sumo_ps, GFP_KERNEL); + ps = kzalloc_obj(struct sumo_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1744,7 +1744,7 @@ int sumo_dpm_init(struct radeon_device *rdev) u32 hw_rev = (RREG32(HW_REV) & ATI_REV_ID_MASK) >> ATI_REV_ID_SHIFT; int ret; - pi = kzalloc_obj(struct sumo_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct sumo_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index a8e8cb8e2b01..34b7beb9cf9a 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -1725,7 +1725,7 @@ static int trinity_parse_power_table(struct radeon_device *rdev) kfree(rdev->pm.dpm.ps); return -EINVAL; } - ps = kzalloc_obj(struct sumo_ps, GFP_KERNEL); + ps = kzalloc_obj(struct sumo_ps); if (ps == NULL) { kfree(rdev->pm.dpm.ps); return -ENOMEM; @@ -1902,7 +1902,7 @@ int trinity_dpm_init(struct radeon_device *rdev) struct trinity_power_info *pi; int ret, i; - pi = kzalloc_obj(struct trinity_power_info, GFP_KERNEL); + pi = kzalloc_obj(struct trinity_power_info); if (pi == NULL) return -ENOMEM; rdev->pm.dpm.priv = pi; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c index dad019714c3e..28a5aa5a14d8 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c @@ -1006,7 +1006,7 @@ static void rcar_du_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c index 6ef11717b2ff..60e6f43b8ab2 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c @@ -381,7 +381,7 @@ struct drm_gem_object *rcar_du_gem_prime_import_sg_table(struct drm_device *dev, return drm_gem_dma_prime_import_sg_table(dev, attach, sgt); /* Create a DMA GEM buffer. */ - dma_obj = kzalloc_obj(*dma_obj, GFP_KERNEL); + dma_obj = kzalloc_obj(*dma_obj); if (!dma_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c index 29d5574a5d8e..01840feabdbe 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c @@ -721,7 +721,7 @@ static void rcar_du_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c index 87eb80cb931e..94c22d2db197 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c @@ -404,7 +404,7 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - copy = kzalloc_obj(*copy, GFP_KERNEL); + copy = kzalloc_obj(*copy); if (copy == NULL) return NULL; @@ -429,7 +429,7 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return; @@ -488,7 +488,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, num_planes = rcdu->info->num_rpf; - vsp->planes = kzalloc_objs(*vsp->planes, num_planes, GFP_KERNEL); + vsp->planes = kzalloc_objs(*vsp->planes, num_planes); if (!vsp->planes) return -ENOMEM; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c index 0d818663b1ce..e5e6e6a156aa 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c @@ -57,7 +57,7 @@ static int rcar_du_wb_prepare_job(struct drm_writeback_connector *connector, if (!job->fb) return 0; - rjob = kzalloc_obj(*rjob, GFP_KERNEL); + rjob = kzalloc_obj(*rjob); if (!rjob) return -ENOMEM; @@ -99,7 +99,7 @@ rcar_du_wb_conn_duplicate_state(struct drm_connector *connector) if (WARN_ON(!connector->state)) return NULL; - copy = kzalloc_obj(*copy, GFP_KERNEL); + copy = kzalloc_obj(*copy); if (!copy) return NULL; @@ -124,7 +124,7 @@ static void rcar_du_wb_conn_reset(struct drm_connector *connector) connector->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return; diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c index e9a95a026a2a..18e2b981b691 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c @@ -336,7 +336,7 @@ static void rzg2l_du_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return; diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c index 525889dba500..bd486377f037 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c @@ -249,7 +249,7 @@ rzg2l_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - copy = kzalloc_obj(*copy, GFP_KERNEL); + copy = kzalloc_obj(*copy); if (!copy) return NULL; @@ -274,7 +274,7 @@ static void rzg2l_du_vsp_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return; diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 931d797c598a..5f460b38596c 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -551,7 +551,7 @@ shmob_drm_connector_init(struct shmob_drm_device *sdev, return ERR_PTR(-EINVAL); } - scon = kzalloc_obj(*scon, GFP_KERNEL); + scon = kzalloc_obj(*scon); if (!scon) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c index 983e4c72002a..b61fda52d17a 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c @@ -260,7 +260,7 @@ static void shmob_drm_plane_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 43688d0322d7..45588b79b3d4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -36,7 +36,7 @@ rockchip_fb_create(struct drm_device *dev, struct drm_file *file, struct drm_afbc_framebuffer *afbc_fb; int ret; - afbc_fb = kzalloc_obj(*afbc_fb, GFP_KERNEL); + afbc_fb = kzalloc_obj(*afbc_fb); if (!afbc_fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index e6216773a6c4..09d14a072d27 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -289,7 +289,7 @@ static struct rockchip_gem_object * size = round_up(size, PAGE_SIZE); - rk_obj = kzalloc_obj(*rk_obj, GFP_KERNEL); + rk_obj = kzalloc_obj(*rk_obj); if (!rk_obj) return ERR_PTR(-ENOMEM); @@ -434,7 +434,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj) if (rk_obj->pages) return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages); - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index b12970bcc588..a195f5c819a2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2140,7 +2140,7 @@ static void vop2_crtc_destroy_state(struct drm_crtc *crtc, static void vop2_crtc_reset(struct drm_crtc *crtc) { - struct rockchip_crtc_state *vcstate = kzalloc_obj(*vcstate, GFP_KERNEL); + struct rockchip_crtc_state *vcstate = kzalloc_obj(*vcstate); if (crtc->state) vop2_crtc_destroy_state(crtc, crtc->state); diff --git a/drivers/gpu/drm/sitronix/st7920.c b/drivers/gpu/drm/sitronix/st7920.c index 21d9369d01c3..18fe7a28ed07 100644 --- a/drivers/gpu/drm/sitronix/st7920.c +++ b/drivers/gpu/drm/sitronix/st7920.c @@ -459,7 +459,7 @@ static void st7920_primary_plane_reset(struct drm_plane *plane) drm_WARN_ON_ONCE(plane->dev, plane->state); - st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state); if (!st7920_state) return; @@ -474,7 +474,7 @@ static struct drm_plane_state *st7920_primary_plane_duplicate_state(struct drm_p if (drm_WARN_ON_ONCE(plane->dev, !plane->state)) return NULL; - st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state); if (!st7920_state) return NULL; @@ -581,7 +581,7 @@ static void st7920_crtc_reset(struct drm_crtc *crtc) drm_WARN_ON_ONCE(crtc->dev, crtc->state); - st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state); if (!st7920_state) return; @@ -595,7 +595,7 @@ static struct drm_crtc_state *st7920_crtc_duplicate_state(struct drm_crtc *crtc) if (drm_WARN_ON_ONCE(crtc->dev, !crtc->state)) return NULL; - st7920_state = kzalloc_obj(*st7920_state, GFP_KERNEL); + st7920_state = kzalloc_obj(*st7920_state); if (!st7920_state) return NULL; diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index aa08e13e4bb7..6ecf9e2ff61b 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -1396,7 +1396,7 @@ static void ssd130x_primary_plane_reset(struct drm_plane *plane) drm_WARN_ON_ONCE(plane->dev, plane->state); - ssd130x_state = kzalloc_obj(*ssd130x_state, GFP_KERNEL); + ssd130x_state = kzalloc_obj(*ssd130x_state); if (!ssd130x_state) return; @@ -1553,7 +1553,7 @@ static void ssd130x_crtc_reset(struct drm_crtc *crtc) drm_WARN_ON_ONCE(crtc->dev, crtc->state); - ssd130x_state = kzalloc_obj(*ssd130x_state, GFP_KERNEL); + ssd130x_state = kzalloc_obj(*ssd130x_state); if (!ssd130x_state) return; diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index b0c73fe2731d..d02d71866f2a 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -151,7 +151,7 @@ static int sti_init(struct drm_device *ddev) { struct sti_private *private; - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 10e8dbdc6a76..63cb8c7c3636 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -29,7 +29,7 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane) plane->state = NULL; } - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) __drm_atomic_helper_plane_reset(plane, &state->state); } @@ -40,7 +40,7 @@ sun4i_backend_layer_duplicate_state(struct drm_plane *plane) struct sun4i_layer_state *orig = state_to_sun4i_layer_state(plane->state); struct sun4i_layer_state *copy; - copy = kzalloc_obj(*copy, GFP_KERNEL); + copy = kzalloc_obj(*copy); if (!copy) return NULL; diff --git a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c index 02c59d401b45..808b1eda871a 100644 --- a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c +++ b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c @@ -427,7 +427,7 @@ void drm_sysfb_plane_reset(struct drm_plane *plane) if (plane->state) drm_sysfb_plane_state_destroy(to_drm_sysfb_plane_state(plane->state)); - sysfb_plane_state = kzalloc_obj(*sysfb_plane_state, GFP_KERNEL); + sysfb_plane_state = kzalloc_obj(*sysfb_plane_state); if (sysfb_plane_state) __drm_gem_reset_shadow_plane(plane, &sysfb_plane_state->base); else @@ -447,7 +447,7 @@ struct drm_plane_state *drm_sysfb_plane_atomic_duplicate_state(struct drm_plane return NULL; sysfb_plane_state = to_drm_sysfb_plane_state(plane_state); - new_sysfb_plane_state = kzalloc_obj(*new_sysfb_plane_state, GFP_KERNEL); + new_sysfb_plane_state = kzalloc_obj(*new_sysfb_plane_state); if (!new_sysfb_plane_state) return NULL; new_shadow_plane_state = &new_sysfb_plane_state->base; @@ -523,7 +523,7 @@ void drm_sysfb_crtc_reset(struct drm_crtc *crtc) if (crtc->state) drm_sysfb_crtc_state_destroy(to_drm_sysfb_crtc_state(crtc->state)); - sysfb_crtc_state = kzalloc_obj(*sysfb_crtc_state, GFP_KERNEL); + sysfb_crtc_state = kzalloc_obj(*sysfb_crtc_state); if (sysfb_crtc_state) { sysfb_crtc_state->format = sysfb->fb_format; __drm_atomic_helper_crtc_reset(crtc, &sysfb_crtc_state->base); @@ -543,7 +543,7 @@ struct drm_crtc_state *drm_sysfb_crtc_atomic_duplicate_state(struct drm_crtc *cr if (drm_WARN_ON(dev, !crtc_state)) return NULL; - new_sysfb_crtc_state = kzalloc_obj(*new_sysfb_crtc_state, GFP_KERNEL); + new_sysfb_crtc_state = kzalloc_obj(*new_sysfb_crtc_state); if (!new_sysfb_crtc_state) return NULL; diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 21cadb50c671..06370b7e0e56 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -812,7 +812,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); @@ -1115,7 +1115,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); @@ -1263,7 +1263,7 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); @@ -1389,7 +1389,7 @@ static void tegra_dc_destroy(struct drm_crtc *crtc) static void tegra_crtc_reset(struct drm_crtc *crtc) { - struct tegra_dc_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct tegra_dc_state *state = kzalloc_obj(*state); if (crtc->state) tegra_crtc_atomic_destroy_state(crtc, crtc->state); @@ -1406,7 +1406,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc) struct tegra_dc_state *state = to_dc_state(crtc->state); struct tegra_dc_state *copy; - copy = kmalloc_obj(*copy, GFP_KERNEL); + copy = kmalloc_obj(*copy); if (!copy) return NULL; diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 1d1bbeae4522..1dcef4e7d104 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -104,7 +104,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) { struct tegra_drm_file *fpriv; - fpriv = kzalloc_obj(*fpriv, GFP_KERNEL); + fpriv = kzalloc_obj(*fpriv); if (!fpriv) return -ENOMEM; @@ -212,7 +212,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, */ num_refs = num_cmdbufs + num_relocs * 2; - refs = kmalloc_objs(*refs, num_refs, GFP_KERNEL); + refs = kmalloc_objs(*refs, num_refs); if (!refs) { err = -ENOMEM; goto put; @@ -465,7 +465,7 @@ static int tegra_open_channel(struct drm_device *drm, void *data, struct tegra_drm_client *client; int err = -ENODEV; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return -ENOMEM; @@ -1147,7 +1147,7 @@ static int host1x_drm_probe(struct host1x_device *dev) if (IS_ERR(drm)) return PTR_ERR(drm); - tegra = kzalloc_obj(*tegra, GFP_KERNEL); + tegra = kzalloc_obj(*tegra); if (!tegra) { err = -ENOMEM; goto put; diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index f28e7bd63508..2c5aefe9621a 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -772,7 +772,7 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi) static void tegra_dsi_connector_reset(struct drm_connector *connector) { - struct tegra_dsi_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct tegra_dsi_state *state = kzalloc_obj(*state); if (!state) return; diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index e795570776fd..1e4803d355dd 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -112,7 +112,7 @@ struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm, unsigned int i; int err; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index c7355b11424c..d2bae88ad545 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -64,7 +64,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ struct host1x_bo_mapping *map; int err; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return ERR_PTR(-ENOMEM); @@ -103,7 +103,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ * If we don't have a mapping for this buffer yet, return an SG table * so that host1x can do the mapping for us via the DMA API. */ - map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt); if (!map->sgt) { err = -ENOMEM; goto free; @@ -240,7 +240,7 @@ static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo) if (bo->mm) return -EBUSY; - bo->mm = kzalloc_obj(*bo->mm, GFP_KERNEL); + bo->mm = kzalloc_obj(*bo->mm); if (!bo->mm) return -ENOMEM; @@ -302,7 +302,7 @@ static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm, struct tegra_bo *bo; int err; - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); @@ -639,7 +639,7 @@ tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach, struct tegra_bo *bo = to_tegra_bo(gem); struct sg_table *sgt; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) return NULL; diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index e0f84efb3b76..a6fa196c2813 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -769,7 +769,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, const u32 *formats; int err; - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); @@ -943,7 +943,7 @@ static int tegra_display_hub_init(struct host1x_client *client) struct tegra_drm *tegra = drm->dev_private; struct tegra_display_hub_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index ce49c2de2c08..0cb30910773f 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -36,7 +36,7 @@ static void tegra_plane_reset(struct drm_plane *plane) kfree(plane->state); plane->state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state) { plane->state = &state->base; plane->state->plane = plane; @@ -55,7 +55,7 @@ tegra_plane_atomic_duplicate_state(struct drm_plane *plane) struct tegra_plane_state *copy; unsigned int i; - copy = kmalloc_obj(*copy, GFP_KERNEL); + copy = kmalloc_obj(*copy); if (!copy) return NULL; diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index a2cb68f42612..de8b2dfc4984 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1721,7 +1721,7 @@ static void tegra_sor_connector_reset(struct drm_connector *connector) { struct tegra_sor_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return; diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c index 7747d5b9f3ca..3009b8b9e619 100644 --- a/drivers/gpu/drm/tegra/submit.c +++ b/drivers/gpu/drm/tegra/submit.c @@ -71,7 +71,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction struct host1x_bo_mapping *map; int err; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return ERR_PTR(-ENOMEM); @@ -80,7 +80,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction map->direction = direction; map->dev = dev; - map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL); + map->sgt = kzalloc_obj(*map->sgt); if (!map->sgt) { err = -ENOMEM; goto free; @@ -193,7 +193,7 @@ static int submit_copy_gather_data(struct gather_bo **pbo, struct device *dev, return -EINVAL; } - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) { SUBMIT_ERR(context, "failed to allocate memory for bo info"); return -ENOMEM; @@ -270,7 +270,7 @@ static int submit_process_bufs(struct tegra_drm_context *context, struct gather_ return PTR_ERR(bufs); } - mappings = kzalloc_objs(*mappings, args->num_bufs, GFP_KERNEL); + mappings = kzalloc_objs(*mappings, args->num_bufs); if (!mappings) { SUBMIT_ERR(context, "failed to allocate memory for mapping info"); err = -ENOMEM; @@ -560,7 +560,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data, if (err) goto unlock; - job_data = kzalloc_obj(*job_data, GFP_KERNEL); + job_data = kzalloc_obj(*job_data); if (!job_data) { SUBMIT_ERR(context, "failed to allocate memory for job data"); err = -ENOMEM; diff --git a/drivers/gpu/drm/tegra/uapi.c b/drivers/gpu/drm/tegra/uapi.c index c4061d0f69a7..c0ac6b45f2d7 100644 --- a/drivers/gpu/drm/tegra/uapi.c +++ b/drivers/gpu/drm/tegra/uapi.c @@ -86,7 +86,7 @@ int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data, struct drm_ if (args->flags) return -EINVAL; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return -ENOMEM; @@ -206,7 +206,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f return -EINVAL; } - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) { err = -ENOMEM; goto unlock; diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c index f401b9c42a9c..44a190109249 100644 --- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c +++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c @@ -80,7 +80,7 @@ static void drm_gem_shmem_test_obj_create_private(struct kunit *test) buf = kunit_kzalloc(test, TEST_SIZE, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, buf); - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); KUNIT_ASSERT_NOT_NULL(test, sgt); ret = kunit_add_action_or_reset(test, kfree_wrapper, sgt); diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c index 6a1a27ee5f36..f4f473f87838 100644 --- a/drivers/gpu/drm/tests/drm_mm_test.c +++ b/drivers/gpu/drm/tests/drm_mm_test.c @@ -252,7 +252,7 @@ static void drm_test_mm_align_pot(struct kunit *test, int max) for (bit = max - 1; bit; bit--) { u64 align, size; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) { KUNIT_FAIL(test, "failed to allocate node"); goto out; diff --git a/drivers/gpu/drm/tests/drm_panic_test.c b/drivers/gpu/drm/tests/drm_panic_test.c index a36f5106c139..ad2f3a2f93b6 100644 --- a/drivers/gpu/drm/tests/drm_panic_test.c +++ b/drivers/gpu/drm/tests/drm_panic_test.c @@ -127,7 +127,7 @@ static void drm_test_panic_screen_user_page(struct kunit *test) fb_size = params->width * params->height * sb->format->cpp[0]; npages = DIV_ROUND_UP(fb_size, PAGE_SIZE); - pages = kmalloc_objs(struct page *, npages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, npages); KUNIT_ASSERT_NOT_NULL(test, pages); for (p = 0; p < npages; p++) { diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index e7fc496e2ce4..a31c21c5f855 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -364,7 +364,7 @@ static void tidss_crtc_reset(struct drm_crtc *crtc) if (crtc->state) tidss_crtc_destroy_state(crtc, crtc->state); - tstate = kzalloc_obj(*tstate, GFP_KERNEL); + tstate = kzalloc_obj(*tstate); if (!tstate) { crtc->state = NULL; return; @@ -382,7 +382,7 @@ static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc) current_state = to_tidss_crtc_state(crtc->state); - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; @@ -425,7 +425,7 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, bool has_ctm = tidss->feat->vp_feat.color.has_ctm; int ret; - tcrtc = kzalloc_obj(*tcrtc, GFP_KERNEL); + tcrtc = kzalloc_obj(*tcrtc); if (!tcrtc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index a8e681c4e03b..aaa02c851c59 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -203,7 +203,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, BIT(DRM_MODE_BLEND_COVERAGE)); int ret; - tplane = kzalloc_obj(*tplane, GFP_KERNEL); + tplane = kzalloc_obj(*tplane); if (!tplane) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index ed0822b3a020..1de3996501f7 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -272,7 +272,7 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) return NULL; } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) goto put_node; diff --git a/drivers/gpu/drm/tiny/appletbdrm.c b/drivers/gpu/drm/tiny/appletbdrm.c index 585c1a0ec025..0b0c058e9013 100644 --- a/drivers/gpu/drm/tiny/appletbdrm.c +++ b/drivers/gpu/drm/tiny/appletbdrm.c @@ -225,7 +225,7 @@ static int appletbdrm_send_msg(struct appletbdrm_device *adev, __le32 msg) struct appletbdrm_msg_simple_request *request; int ret; - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return -ENOMEM; @@ -260,7 +260,7 @@ static int appletbdrm_get_information(struct appletbdrm_device *adev) __le32 pixel_format; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -506,7 +506,7 @@ static void appletbdrm_primary_plane_reset(struct drm_plane *plane) WARN_ON(plane->state); - appletbdrm_state = kzalloc_obj(*appletbdrm_state, GFP_KERNEL); + appletbdrm_state = kzalloc_obj(*appletbdrm_state); if (!appletbdrm_state) return; @@ -521,7 +521,7 @@ static struct drm_plane_state *appletbdrm_primary_plane_duplicate_state(struct d if (WARN_ON(!plane->state)) return NULL; - appletbdrm_state = kzalloc_obj(*appletbdrm_state, GFP_KERNEL); + appletbdrm_state = kzalloc_obj(*appletbdrm_state); if (!appletbdrm_state) return NULL; diff --git a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c b/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c index 5cefc50304e4..5cfe8f3f80d7 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c +++ b/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c @@ -49,7 +49,7 @@ static struct ttm_tt *ttm_tt_simple_create(struct ttm_buffer_object *bo, u32 pag { struct ttm_tt *tt; - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); ttm_tt_init(tt, bo, page_flags, ttm_cached, 0); return tt; diff --git a/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c b/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c index d6558f5c7e48..c97e8b7a4e7a 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c +++ b/drivers/gpu/drm/ttm/tests/ttm_mock_manager.c @@ -35,7 +35,7 @@ static int ttm_mock_manager_alloc(struct ttm_resource_manager *man, u64 lpfn, fpfn, alloc_size; int err; - mock_res = kzalloc_obj(*mock_res, GFP_KERNEL); + mock_res = kzalloc_obj(*mock_res); if (!mock_res) return -ENOMEM; @@ -100,7 +100,7 @@ int ttm_mock_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size) struct ttm_resource_manager *base; int err; - manager = kzalloc_obj(*manager, GFP_KERNEL); + manager = kzalloc_obj(*manager); if (!manager) return -ENOMEM; @@ -194,7 +194,7 @@ int ttm_bad_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size) { struct ttm_resource_manager *man; - man = kzalloc_obj(*man, GFP_KERNEL); + man = kzalloc_obj(*man); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index a973aafd6f7f..147e25ee53ba 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -128,7 +128,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_buffer_object *bo, { struct ttm_agp_backend *agp_be; - agp_be = kmalloc_obj(*agp_be, GFP_KERNEL); + agp_be = kmalloc_obj(*agp_be); if (!agp_be) return NULL; diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 93871aaa33b2..f83b7d5ec6c6 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -233,7 +233,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, struct ttm_transfer_obj *fbo; int ret; - fbo = kmalloc_obj(*fbo, GFP_KERNEL); + fbo = kmalloc_obj(*fbo); if (!fbo) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index b1fa78edad1f..c0d95559197c 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -164,7 +164,7 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags, return p; } - dma = kmalloc_obj(*dma, GFP_KERNEL); + dma = kmalloc_obj(*dma); if (!dma) return NULL; diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c index b223b873d0c6..616978b8d945 100644 --- a/drivers/gpu/drm/ttm/ttm_range_manager.c +++ b/drivers/gpu/drm/ttm/ttm_range_manager.c @@ -184,7 +184,7 @@ int ttm_range_man_init_nocheck(struct ttm_device *bdev, struct ttm_resource_manager *man; struct ttm_range_manager *rman; - rman = kzalloc_obj(*rman, GFP_KERNEL); + rman = kzalloc_obj(*rman); if (!rman) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c b/drivers/gpu/drm/ttm/ttm_sys_manager.c index fb3e9869704a..04398bb9c710 100644 --- a/drivers/gpu/drm/ttm/ttm_sys_manager.c +++ b/drivers/gpu/drm/ttm/ttm_sys_manager.c @@ -12,7 +12,7 @@ static int ttm_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc_obj(**res, GFP_KERNEL); + *res = kzalloc_obj(**res); if (!*res) return -ENOMEM; diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index 27dac7cc50a6..08a0e9480d70 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -218,7 +218,7 @@ retry: udl->urbs.size = size; while (udl->urbs.count * size < wanted_size) { - unode = kzalloc_obj(struct urb_node, GFP_KERNEL); + unode = kzalloc_obj(struct urb_node); if (!unode) break; unode->dev = udl; diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index 146bcb30f37b..a847d2f0ccf5 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -86,7 +86,7 @@ struct drm_gem_object *v3d_create_object(struct drm_device *dev, size_t size) if (size == 0) return ERR_PTR(-EINVAL); - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); obj = &bo->base.base; diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 0ed83100c95a..dd60acdf52c2 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -133,7 +133,7 @@ v3d_open(struct drm_device *dev, struct drm_file *file) struct drm_gpu_scheduler *sched; int i; - v3d_priv = kzalloc_obj(*v3d_priv, GFP_KERNEL); + v3d_priv = kzalloc_obj(*v3d_priv); if (!v3d_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c index 0deaf636387e..3c999f60003c 100644 --- a/drivers/gpu/drm/v3d/v3d_fence.c +++ b/drivers/gpu/drm/v3d/v3d_fence.c @@ -8,7 +8,7 @@ struct dma_fence *v3d_fence_create(struct v3d_dev *v3d, enum v3d_queue q) struct v3d_queue_state *queue = &v3d->queue[q]; struct v3d_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index 86229323eeac..9c11a6b945ff 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -528,7 +528,7 @@ static struct drm_plane *vbox_create_plane(struct vbox_private *vbox, return ERR_PTR(-EINVAL); } - plane = kzalloc_obj(*plane, GFP_KERNEL); + plane = kzalloc_obj(*plane); if (!plane) return ERR_PTR(-ENOMEM); @@ -562,7 +562,7 @@ static struct vbox_crtc *vbox_crtc_init(struct drm_device *dev, unsigned int i) if (ret) return ERR_PTR(ret); - vbox_crtc = kzalloc_obj(*vbox_crtc, GFP_KERNEL); + vbox_crtc = kzalloc_obj(*vbox_crtc); if (!vbox_crtc) return ERR_PTR(-ENOMEM); @@ -622,7 +622,7 @@ static struct drm_encoder *vbox_encoder_init(struct drm_device *dev, { struct vbox_encoder *vbox_encoder; - vbox_encoder = kzalloc_obj(*vbox_encoder, GFP_KERNEL); + vbox_encoder = kzalloc_obj(*vbox_encoder); if (!vbox_encoder) return NULL; @@ -808,7 +808,7 @@ static int vbox_connector_init(struct drm_device *dev, struct vbox_connector *vbox_connector; struct drm_connector *connector; - vbox_connector = kzalloc_obj(*vbox_connector, GFP_KERNEL); + vbox_connector = kzalloc_obj(*vbox_connector); if (!vbox_connector) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 274cad424059..7e86e89360e2 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -205,7 +205,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev, struct list_head *new_list; uint32_t i; - new_list = kmalloc_objs(struct list_head, new_size, GFP_KERNEL); + new_list = kmalloc_objs(struct list_head, new_size); if (!new_list) return NULL; @@ -399,7 +399,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return ERR_PTR(-ENODEV); - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 27a9eab1c2d0..4a606986afcc 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -997,7 +997,7 @@ vc4_async_page_flip_common(struct drm_crtc *crtc, struct drm_plane *plane = crtc->primary; struct vc4_async_flip_state *flip_state; - flip_state = kzalloc_obj(*flip_state, GFP_KERNEL); + flip_state = kzalloc_obj(*flip_state); if (!flip_state) return -ENOMEM; @@ -1105,7 +1105,7 @@ struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) { struct vc4_crtc_state *vc4_state, *old_vc4_state; - vc4_state = kzalloc_obj(*vc4_state, GFP_KERNEL); + vc4_state = kzalloc_obj(*vc4_state); if (!vc4_state) return NULL; @@ -1142,7 +1142,7 @@ void vc4_crtc_reset(struct drm_crtc *crtc) if (crtc->state) vc4_crtc_destroy_state(crtc, crtc->state); - vc4_crtc_state = kzalloc_obj(*vc4_crtc_state, GFP_KERNEL); + vc4_crtc_state = kzalloc_obj(*vc4_crtc_state); if (!vc4_crtc_state) { crtc->state = NULL; return; diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 0677458e28f8..a14ecb769461 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -152,7 +152,7 @@ static int vc4_open(struct drm_device *dev, struct drm_file *file) if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return -ENODEV; - vc4file = kzalloc_obj(*vc4file, GFP_KERNEL); + vc4file = kzalloc_obj(*vc4file); if (!vc4file) return -ENOMEM; vc4file->dev = vc4; diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 42b6dcbaa01b..ad8cbd727b80 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -110,7 +110,7 @@ vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, state->bo = get_state->bo; memcpy(get_state, state, sizeof(*state)); - bo_state = kzalloc_objs(*bo_state, state->bo_count, GFP_KERNEL); + bo_state = kzalloc_objs(*bo_state, state->bo_count); if (!bo_state) { ret = -ENOMEM; goto err_free; @@ -161,7 +161,7 @@ vc4_save_hang_state(struct drm_device *dev) unsigned long irqflags; unsigned int i, j, k, unref_list_count; - kernel_state = kzalloc_objs(*kernel_state, 1, GFP_KERNEL); + kernel_state = kzalloc_objs(*kernel_state, 1); if (!kernel_state) return; @@ -622,7 +622,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec, unsigned long irqflags; struct vc4_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return -ENOMEM; fence->dev = dev; @@ -1043,7 +1043,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - exec = kzalloc_objs(*exec, 1, GFP_KERNEL); + exec = kzalloc_objs(*exec, 1); if (!exec) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index ef5825a00bc3..fda214b5a466 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2941,7 +2941,7 @@ static int vc4_hdmi_build_regset(struct drm_device *drm, unsigned int i; int ret; - regs = kzalloc_objs(*regs, variant->num_registers, GFP_KERNEL); + regs = kzalloc_objs(*regs, variant->num_registers); if (!regs) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index de39992bbaa2..245485e744a5 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -103,7 +103,7 @@ static int vc4_ctm_obj_init(struct vc4_dev *vc4) drm_modeset_lock_init(&vc4->ctm_state_lock); - ctm_state = kzalloc_obj(*ctm_state, GFP_KERNEL); + ctm_state = kzalloc_obj(*ctm_state); if (!ctm_state) return -ENOMEM; @@ -734,7 +734,7 @@ static int vc4_load_tracker_obj_init(struct vc4_dev *vc4) { struct vc4_load_tracker_state *load_state; - load_state = kzalloc_obj(*load_state, GFP_KERNEL); + load_state = kzalloc_obj(*load_state); if (!load_state) return -ENOMEM; @@ -752,7 +752,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) struct vc4_hvs_state *state; unsigned int i; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; @@ -817,7 +817,7 @@ static int vc4_hvs_channels_obj_init(struct vc4_dev *vc4) { struct vc4_hvs_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; @@ -911,7 +911,7 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, * If the layout changes and doesn't give us that in the future, * we will need to have something smarter, but it works so far. */ - sorted_crtcs = kmalloc_objs(*sorted_crtcs, dev->num_crtcs, GFP_KERNEL); + sorted_crtcs = kmalloc_objs(*sorted_crtcs, dev->num_crtcs); if (!sorted_crtcs) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 26392ae43b99..91d499fefba2 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -374,7 +374,7 @@ static void vc4_plane_reset(struct drm_plane *plane) kfree(plane->state); - vc4_state = kzalloc_obj(*vc4_state, GFP_KERNEL); + vc4_state = kzalloc_obj(*vc4_state); if (!vc4_state) return; diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c index 8e2fe5eef1b9..d48cf76983c0 100644 --- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c +++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c @@ -803,7 +803,7 @@ vc4_validate_shader(struct drm_gem_dma_object *shader_obj) if (!validation_state.branch_targets) goto fail; - validated_shader = kzalloc_objs(*validated_shader, 1, GFP_KERNEL); + validated_shader = kzalloc_objs(*validated_shader, 1); if (!validated_shader) goto fail; diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 7dc9e2e422f5..a9f5c247db71 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -60,7 +60,7 @@ static int vgem_open(struct drm_device *dev, struct drm_file *file) struct vgem_file *vfile; int ret; - vfile = kzalloc_obj(*vfile, GFP_KERNEL); + vfile = kzalloc_obj(*vfile); if (!vfile) return -ENOMEM; @@ -94,7 +94,7 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz { struct drm_gem_shmem_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 313e706abe37..0e53ba7db629 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -71,7 +71,7 @@ static struct dma_fence *vgem_fence_create(struct vgem_file *vfile, { struct vgem_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index a4b7761d9250..f1dae9569805 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -334,7 +334,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, if (!obj) return ERR_PTR(-EINVAL); - virtio_gpu_fb = kzalloc_obj(*virtio_gpu_fb, GFP_KERNEL); + virtio_gpu_fb = kzalloc_obj(*virtio_gpu_fb); if (virtio_gpu_fb == NULL) { drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index b1a13946d4db..80ba69b4860b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -316,7 +316,7 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) return 0; /* allocate a virt GPU context for this opener */ - vfpriv = kzalloc_obj(*vfpriv, GFP_KERNEL); + vfpriv = kzalloc_obj(*vfpriv); if (!vfpriv) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index c7381c564492..ec9efacc6919 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -149,7 +149,7 @@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, struct virtio_gpu_object_shmem *shmem; struct drm_gem_shmem_object *dshmem; - shmem = kzalloc_obj(*shmem, GFP_KERNEL); + shmem = kzalloc_obj(*shmem); if (!shmem) return ERR_PTR(-ENOMEM); @@ -177,7 +177,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, else *nents = pages->orig_nents; - *ents = kvmalloc_objs(struct virtio_gpu_mem_entry, *nents, GFP_KERNEL); + *ents = kvmalloc_objs(struct virtio_gpu_mem_entry, *nents); if (!(*ents)) { DRM_ERROR("failed to allocate ent list\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 9b72ece71264..a126d1b25f46 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -79,7 +79,7 @@ drm_plane_state *virtio_gpu_plane_duplicate_state(struct drm_plane *plane) if (WARN_ON(!plane->state)) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index 9cae1f3b18e8..94ad448c35b6 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -314,7 +314,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, if (!vgdev->has_resource_blob || vgdev->has_virgl_3d) return drm_gem_prime_import(dev, buf); - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/virtio/virtgpu_submit.c b/drivers/gpu/drm/virtio/virtgpu_submit.c index 8f171d87545f..dae761fa5788 100644 --- a/drivers/gpu/drm/virtio/virtgpu_submit.c +++ b/drivers/gpu/drm/virtio/virtgpu_submit.c @@ -104,7 +104,7 @@ virtio_gpu_parse_deps(struct virtio_gpu_submit *submit) * internally for allocations larger than a page size, preventing * storm of KMSG warnings. */ - syncobjs = kvzalloc_objs(*syncobjs, num_in_syncobjs, GFP_KERNEL); + syncobjs = kvzalloc_objs(*syncobjs, num_in_syncobjs); if (!syncobjs) return -ENOMEM; @@ -195,7 +195,7 @@ static int virtio_gpu_parse_post_deps(struct virtio_gpu_submit *submit) if (!num_out_syncobjs) return 0; - post_deps = kvzalloc_objs(*post_deps, num_out_syncobjs, GFP_KERNEL); + post_deps = kvzalloc_objs(*post_deps, num_out_syncobjs); if (!post_deps) return -ENOMEM; @@ -277,7 +277,7 @@ static int virtio_gpu_fence_event_create(struct drm_device *dev, struct virtio_gpu_fence_event *e = NULL; int ret; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 9a45a58e9f58..67865810a2e7 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -312,7 +312,7 @@ static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int *sg_ents) if (WARN_ON(!PAGE_ALIGNED(data))) return NULL; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) return NULL; @@ -936,7 +936,7 @@ int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc_obj(struct virtio_gpu_resp_display_info, GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_display_info); if (!resp_buf) return -ENOMEM; @@ -958,7 +958,7 @@ int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) struct virtio_gpu_vbuffer *vbuf; void *resp_buf; - resp_buf = kzalloc_obj(struct virtio_gpu_resp_capset_info, GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_capset_info); if (!resp_buf) return -ENOMEM; @@ -993,7 +993,7 @@ int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, if (version > vgdev->capsets[idx].max_version) return -EINVAL; - cache_ent = kzalloc_obj(*cache_ent, GFP_KERNEL); + cache_ent = kzalloc_obj(*cache_ent); if (!cache_ent) return -ENOMEM; @@ -1061,7 +1061,7 @@ int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev) return -EINVAL; for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) { - resp_buf = kzalloc_obj(struct virtio_gpu_resp_edid, GFP_KERNEL); + resp_buf = kzalloc_obj(struct virtio_gpu_resp_edid); if (!resp_buf) return -ENOMEM; @@ -1338,7 +1338,7 @@ virtio_gpu_cmd_resource_assign_uuid(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_resource_uuid *resp_buf; - resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf); if (!resp_buf) { spin_lock(&vgdev->resource_export_lock); bo->uuid_state = STATE_ERR; @@ -1391,7 +1391,7 @@ int virtio_gpu_cmd_map(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf; struct virtio_gpu_resp_map_info *resp_buf; - resp_buf = kzalloc_obj(*resp_buf, GFP_KERNEL); + resp_buf = kzalloc_obj(*resp_buf); if (!resp_buf) return -ENOMEM; diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio/virtgpu_vram.c index da5d4ee8ddef..084e80227433 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vram.c +++ b/drivers/gpu/drm/virtio/virtgpu_vram.c @@ -79,7 +79,7 @@ struct sg_table *virtio_gpu_vram_map_dma_buf(struct virtio_gpu_object *bo, dma_addr_t addr; int ret; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) return ERR_PTR(-ENOMEM); @@ -193,7 +193,7 @@ int virtio_gpu_vram_create(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_vram *vram; int ret; - vram = kzalloc_obj(*vram, GFP_KERNEL); + vram = kzalloc_obj(*vram); if (!vram) return -ENOMEM; diff --git a/drivers/gpu/drm/vkms/vkms_colorop.c b/drivers/gpu/drm/vkms/vkms_colorop.c index 8aeea73de617..bf8a0e4fc719 100644 --- a/drivers/gpu/drm/vkms/vkms_colorop.c +++ b/drivers/gpu/drm/vkms/vkms_colorop.c @@ -24,7 +24,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr memset(ops, 0, sizeof(ops)); /* 1st op: 1d curve */ - ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i]); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -41,7 +41,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 2nd op: 3x4 matrix */ - ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i]); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -57,7 +57,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 3rd op: 3x4 matrix */ - ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i]); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; @@ -73,7 +73,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr i++; /* 4th op: 1d curve */ - ops[i] = kzalloc_obj(*ops[i], GFP_KERNEL); + ops[i] = kzalloc_obj(*ops[i]); if (!ops[i]) { drm_err(dev, "KMS: Failed to allocate colorop\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c index 8447b654e229..5a654d6dead8 100644 --- a/drivers/gpu/drm/vkms/vkms_config.c +++ b/drivers/gpu/drm/vkms/vkms_config.c @@ -12,7 +12,7 @@ struct vkms_config *vkms_config_create(const char *dev_name) { struct vkms_config *config; - config = kzalloc_obj(*config, GFP_KERNEL); + config = kzalloc_obj(*config); if (!config) return ERR_PTR(-ENOMEM); @@ -388,7 +388,7 @@ struct vkms_config_plane *vkms_config_create_plane(struct vkms_config *config) { struct vkms_config_plane *plane_cfg; - plane_cfg = kzalloc_obj(*plane_cfg, GFP_KERNEL); + plane_cfg = kzalloc_obj(*plane_cfg); if (!plane_cfg) return ERR_PTR(-ENOMEM); @@ -448,7 +448,7 @@ struct vkms_config_crtc *vkms_config_create_crtc(struct vkms_config *config) { struct vkms_config_crtc *crtc_cfg; - crtc_cfg = kzalloc_obj(*crtc_cfg, GFP_KERNEL); + crtc_cfg = kzalloc_obj(*crtc_cfg); if (!crtc_cfg) return ERR_PTR(-ENOMEM); @@ -527,7 +527,7 @@ struct vkms_config_encoder *vkms_config_create_encoder(struct vkms_config *confi { struct vkms_config_encoder *encoder_cfg; - encoder_cfg = kzalloc_obj(*encoder_cfg, GFP_KERNEL); + encoder_cfg = kzalloc_obj(*encoder_cfg); if (!encoder_cfg) return ERR_PTR(-ENOMEM); @@ -591,7 +591,7 @@ struct vkms_config_connector *vkms_config_create_connector(struct vkms_config *c { struct vkms_config_connector *connector_cfg; - connector_cfg = kzalloc_obj(*connector_cfg, GFP_KERNEL); + connector_cfg = kzalloc_obj(*connector_cfg); if (!connector_cfg) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vkms/vkms_configfs.c b/drivers/gpu/drm/vkms/vkms_configfs.c index f6471ee9a58c..7551b8c7766d 100644 --- a/drivers/gpu/drm/vkms/vkms_configfs.c +++ b/drivers/gpu/drm/vkms/vkms_configfs.c @@ -769,7 +769,7 @@ static struct config_group *make_device_group(struct config_group *group, if (strcmp(name, DEFAULT_DEVICE_NAME) == 0) return ERR_PTR(-EINVAL); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index f5b99ebb37e3..92e54c27897e 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -62,7 +62,7 @@ vkms_atomic_crtc_duplicate_state(struct drm_crtc *crtc) if (WARN_ON(!crtc->state)) return NULL; - vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state); if (!vkms_state) return NULL; diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index 73d3c4af7743..ca7aee101a95 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -56,11 +56,11 @@ vkms_plane_duplicate_state(struct drm_plane *plane) struct vkms_plane_state *vkms_state; struct vkms_frame_info *frame_info; - vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state); if (!vkms_state) return NULL; - frame_info = kzalloc_obj(*frame_info, GFP_KERNEL); + frame_info = kzalloc_obj(*frame_info); if (!frame_info) { DRM_DEBUG_KMS("Couldn't allocate frame_info\n"); kfree(vkms_state); @@ -104,7 +104,7 @@ static void vkms_plane_reset(struct drm_plane *plane) plane->state = NULL; /* must be set to NULL here */ } - vkms_state = kzalloc_obj(*vkms_state, GFP_KERNEL); + vkms_state = kzalloc_obj(*vkms_state); if (!vkms_state) { DRM_ERROR("Cannot allocate vkms_plane_state\n"); return; diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 1cd760f75779..908b7e602ffb 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -81,7 +81,7 @@ static int vkms_wb_prepare_job(struct drm_writeback_connector *wb_connector, if (!job->fb) return 0; - vkmsjob = kzalloc_obj(*vkmsjob, GFP_KERNEL); + vkmsjob = kzalloc_obj(*vkmsjob); if (!vkmsjob) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.c b/drivers/gpu/drm/vmwgfx/ttm_object.c index 23ffb7069d01..2421b0dd057c 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.c +++ b/drivers/gpu/drm/vmwgfx/ttm_object.c @@ -318,7 +318,7 @@ int ttm_ref_object_add(struct ttm_object_file *tfile, if (require_existed) return -EPERM; - ref = kmalloc_obj(*ref, GFP_KERNEL); + ref = kmalloc_obj(*ref); if (unlikely(ref == NULL)) { return -ENOMEM; } @@ -404,7 +404,7 @@ void ttm_object_file_release(struct ttm_object_file **p_tfile) struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev) { - struct ttm_object_file *tfile = kmalloc_obj(*tfile, GFP_KERNEL); + struct ttm_object_file *tfile = kmalloc_obj(*tfile); if (unlikely(tfile == NULL)) return NULL; @@ -422,7 +422,7 @@ struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev) struct ttm_object_device * ttm_object_device_init(const struct dma_buf_ops *ops) { - struct ttm_object_device *tdev = kmalloc_obj(*tdev, GFP_KERNEL); + struct ttm_object_device *tdev = kmalloc_obj(*tdev); if (unlikely(tdev == NULL)) return NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index 97290b5d65d0..9c7a73c0b0dc 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -449,7 +449,7 @@ int vmw_bo_create(struct vmw_private *vmw, { int ret; - *p_bo = kmalloc_obj(**p_bo, GFP_KERNEL); + *p_bo = kmalloc_obj(**p_bo); if (unlikely(!*p_bo)) { DRM_ERROR("Failed to allocate a buffer.\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c index cfecea9bfa24..d932e38d7942 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c @@ -103,7 +103,7 @@ struct vmw_fifo_state *vmw_fifo_create(struct vmw_private *dev_priv) if (!dev_priv->fifo_mem) return NULL; - fifo = kzalloc_obj(*fifo, GFP_KERNEL); + fifo = kzalloc_obj(*fifo); if (!fifo) return ERR_PTR(-ENOMEM); fifo->static_buffer_size = VMWGFX_FIFO_STATIC_SIZE; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index 5756af107555..2170b45c30e9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -961,7 +961,7 @@ void *vmw_cmdbuf_alloc(struct vmw_cmdbuf_man *man, *p_header = NULL; - header = kzalloc_obj(*header, GFP_KERNEL); + header = kzalloc_obj(*header); if (!header) return ERR_PTR(-ENOMEM); @@ -1296,7 +1296,7 @@ struct vmw_cmdbuf_man *vmw_cmdbuf_man_create(struct vmw_private *dev_priv) if (!(dev_priv->capabilities & SVGA_CAP_COMMAND_BUFFERS)) return ERR_PTR(-ENOSYS); - man = kzalloc_obj(*man, GFP_KERNEL); + man = kzalloc_obj(*man); if (!man) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c index b8b4834d40fb..fe1ba1a61a68 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c @@ -200,7 +200,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, { struct vmw_cmdbuf_res *cres; - cres = kzalloc_obj(*cres, GFP_KERNEL); + cres = kzalloc_obj(*cres); if (unlikely(!cres)) return -ENOMEM; @@ -284,7 +284,7 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv) { struct vmw_cmdbuf_res_manager *man; - man = kzalloc_obj(*man, GFP_KERNEL); + man = kzalloc_obj(*man); if (!man) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c index 0845c00e777d..bd96f4d5e090 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c @@ -738,7 +738,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, return -EINVAL; } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (unlikely(!ctx)) { ret = -ENOMEM; goto out_ret; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c index 6220a1a0326a..091f1039a052 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c @@ -604,7 +604,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, int ret; u32 num_entries; - vcotbl = kzalloc_obj(*vcotbl, GFP_KERNEL); + vcotbl = kzalloc_obj(*vcotbl); if (unlikely(!vcotbl)) { ret = -ENOMEM; goto out_no_alloc; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index eb5695bcae89..0f101aedb49a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1209,7 +1209,7 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv) struct vmw_fpriv *vmw_fp; int ret = -ENOMEM; - vmw_fp = kzalloc_obj(*vmw_fp, GFP_KERNEL); + vmw_fp = kzalloc_obj(*vmw_fp); if (unlikely(!vmw_fp)) return ret; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index 4500771a8f42..3469e2c9e706 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c @@ -129,7 +129,7 @@ static const struct dma_fence_ops vmw_fence_ops = { struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv) { - struct vmw_fence_manager *fman = kzalloc_obj(*fman, GFP_KERNEL); + struct vmw_fence_manager *fman = kzalloc_obj(*fman); if (unlikely(!fman)) return NULL; @@ -251,7 +251,7 @@ int vmw_fence_create(struct vmw_fence_manager *fman, struct vmw_fence_obj *fence; int ret; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (unlikely(!fence)) return -ENOMEM; @@ -298,7 +298,7 @@ int vmw_user_fence_create(struct drm_file *file_priv, struct vmw_fence_obj *tmp; int ret; - ufence = kzalloc_obj(*ufence, GFP_KERNEL); + ufence = kzalloc_obj(*ufence); if (unlikely(!ufence)) { ret = -ENOMEM; goto out_no_object; @@ -580,7 +580,7 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv, struct vmw_event_fence_action *eaction; struct vmw_fence_manager *fman = fman_from_fence(fence); - eaction = kzalloc_obj(*eaction, GFP_KERNEL); + eaction = kzalloc_obj(*eaction); if (unlikely(!eaction)) return -ENOMEM; @@ -612,7 +612,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv, struct drm_device *dev = &fman->dev_priv->drm; int ret; - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (unlikely(!event)) { DRM_ERROR("Failed to allocate an event.\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index 1a45220d3607..d607452dff6a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man, struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man); int id; - *res = kmalloc_obj(**res, GFP_KERNEL); + *res = kmalloc_obj(**res); if (!*res) return -ENOMEM; @@ -154,7 +154,7 @@ static const struct ttm_resource_manager_func vmw_gmrid_manager_func; int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type) { struct ttm_resource_manager *man; - struct vmwgfx_gmrid_man *gman = kzalloc_obj(*gman, GFP_KERNEL); + struct vmwgfx_gmrid_man *gman = kzalloc_obj(*gman); if (unlikely(!gman)) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 1c4fc5f0d586..d962ef2ef316 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -196,7 +196,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, goto out_clips; } - clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips); if (clips == NULL) { DRM_ERROR("Failed to allocate clip rect list.\n"); ret = -ENOMEM; @@ -273,7 +273,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, goto out_clips; } - clips = kzalloc_objs(*clips, num_clips, GFP_KERNEL); + clips = kzalloc_objs(*clips, num_clips); if (clips == NULL) { DRM_ERROR("Failed to allocate clip rect list.\n"); ret = -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index ca6aec15f113..60306d075428 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -224,7 +224,7 @@ void vmw_du_crtc_reset(struct drm_crtc *crtc) kfree(vmw_crtc_state_to_vcs(crtc->state)); } - vcs = kzalloc_obj(*vcs, GFP_KERNEL); + vcs = kzalloc_obj(*vcs); if (!vcs) { DRM_ERROR("Cannot allocate vmw_crtc_state\n"); @@ -300,7 +300,7 @@ void vmw_du_plane_reset(struct drm_plane *plane) if (plane->state) vmw_du_plane_destroy_state(plane, plane->state); - vps = kzalloc_obj(*vps, GFP_KERNEL); + vps = kzalloc_obj(*vps); if (!vps) { DRM_ERROR("Cannot allocate vmw_plane_state\n"); @@ -382,7 +382,7 @@ void vmw_du_connector_reset(struct drm_connector *connector) kfree(vmw_connector_state_to_vcs(connector->state)); } - vcs = kzalloc_obj(*vcs, GFP_KERNEL); + vcs = kzalloc_obj(*vcs); if (!vcs) { DRM_ERROR("Cannot allocate vmw_connector_state\n"); @@ -543,7 +543,7 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, return -EINVAL; } - vfbs = kzalloc_obj(*vfbs, GFP_KERNEL); + vfbs = kzalloc_obj(*vfbs); if (!vfbs) { ret = -ENOMEM; goto out_err1; @@ -632,7 +632,7 @@ static int vmw_kms_new_framebuffer_bo(struct vmw_private *dev_priv, return -EINVAL; } - vfbd = kzalloc_obj(*vfbd, GFP_KERNEL); + vfbd = kzalloc_obj(*vfbd); if (!vfbd) { ret = -ENOMEM; goto out_err1; @@ -1422,7 +1422,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, } rects_size = arg->num_outputs * sizeof(struct drm_vmw_rect); - rects = kzalloc_objs(struct drm_vmw_rect, arg->num_outputs, GFP_KERNEL); + rects = kzalloc_objs(struct drm_vmw_rect, arg->num_outputs); if (unlikely(!rects)) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index e07ee831064b..f07669b27fba 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -416,7 +416,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - ldu = kzalloc_obj(*ldu, GFP_KERNEL); + ldu = kzalloc_obj(*ldu); if (!ldu) return -ENOMEM; @@ -547,7 +547,7 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv) return -EINVAL; } - dev_priv->ldu_priv = kmalloc_obj(*dev_priv->ldu_priv, GFP_KERNEL); + dev_priv->ldu_priv = kmalloc_obj(*dev_priv->ldu_priv); if (!dev_priv->ldu_priv) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c index d29ac15a742b..de7a504de9ce 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c @@ -390,7 +390,7 @@ static unsigned long vmw_mob_calculate_pt_pages(unsigned long data_pages) */ struct vmw_mob *vmw_mob_create(unsigned long data_pages) { - struct vmw_mob *mob = kzalloc_obj(*mob, GFP_KERNEL); + struct vmw_mob *mob = kzalloc_obj(*mob); if (unlikely(!mob)) return NULL; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c index 9a75a35f605b..679adf7c7183 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c @@ -539,7 +539,7 @@ int vmw_overlay_init(struct vmw_private *dev_priv) if (dev_priv->overlay_priv) return -EINVAL; - overlay = kzalloc_obj(*overlay, GFP_KERNEL); + overlay = kzalloc_obj(*overlay); if (!overlay) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 37bcdfb585ce..605d037d18c6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -811,7 +811,7 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - sou = kzalloc_obj(*sou, GFP_KERNEL); + sou = kzalloc_obj(*sou); if (!sou) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c index d74d9b72f80d..eca4e3e97eb4 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c @@ -595,7 +595,7 @@ int vmw_dx_shader_add(struct vmw_cmdbuf_res_manager *man, if (!vmw_shader_id_ok(user_key, shader_type)) return -EINVAL; - shader = kmalloc_obj(*shader, GFP_KERNEL); + shader = kmalloc_obj(*shader); if (!shader) { return -ENOMEM; } @@ -696,7 +696,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, struct vmw_resource *res, *tmp; int ret; - ushader = kzalloc_obj(*ushader, GFP_KERNEL); + ushader = kzalloc_obj(*ushader); if (unlikely(!ushader)) { ret = -ENOMEM; goto out; @@ -746,7 +746,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv, struct vmw_resource *res; int ret; - shader = kzalloc_obj(*shader, GFP_KERNEL); + shader = kzalloc_obj(*shader); if (unlikely(!shader)) { ret = -ENOMEM; goto out_err; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 14f583ab4bac..dcbacee97f61 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1541,7 +1541,7 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit) struct drm_crtc *crtc; int ret; - stdu = kzalloc_obj(*stdu, GFP_KERNEL); + stdu = kzalloc_obj(*stdu); if (!stdu) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c b/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c index 6805c03ae248..52c6cfa163da 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c @@ -284,7 +284,7 @@ int vmw_dx_streamoutput_add(struct vmw_cmdbuf_res_manager *man, struct vmw_private *dev_priv = ctx->dev_priv; int ret; - so = kmalloc_obj(*so, GFP_KERNEL); + so = kmalloc_obj(*so); if (!so) { return -ENOMEM; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 9ff2d54d548e..865621839d03 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -741,7 +741,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, return -EINVAL; } - user_srf = kzalloc_obj(*user_srf, GFP_KERNEL); + user_srf = kzalloc_obj(*user_srf); if (unlikely(!user_srf)) { ret = -ENOMEM; goto out_unlock; @@ -2144,7 +2144,7 @@ int vmw_gb_surface_define(struct vmw_private *dev_priv, if (req->sizes != NULL) return -EINVAL; - user_srf = kzalloc_obj(*user_srf, GFP_KERNEL); + user_srf = kzalloc_obj(*user_srf); if (unlikely(!user_srf)) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c index 08b492534fe9..585996b6c9b7 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_system_manager.c @@ -37,7 +37,7 @@ static int vmw_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource **res) { - *res = kzalloc_obj(**res, GFP_KERNEL); + *res = kzalloc_obj(**res); if (!*res) return -ENOMEM; @@ -60,7 +60,7 @@ static const struct ttm_resource_manager_func vmw_sys_manager_func = { int vmw_sys_man_init(struct vmw_private *dev_priv) { struct ttm_device *bdev = &dev_priv->bdev; - struct ttm_resource_manager *man = kzalloc_obj(*man, GFP_KERNEL); + struct ttm_resource_manager *man = kzalloc_obj(*man); if (!man) return -ENOMEM; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index 232c2b8ff520..dfd08ee19041 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -404,7 +404,7 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo, int ret; bool external = bo->type == ttm_bo_type_sg; - vmw_be = kzalloc_obj(*vmw_be, GFP_KERNEL); + vmw_be = kzalloc_obj(*vmw_be); if (!vmw_be) return NULL; diff --git a/drivers/gpu/drm/xe/display/intel_bo.c b/drivers/gpu/drm/xe/display/intel_bo.c index 89ee5f3491c6..05d5e5c0a0de 100644 --- a/drivers/gpu/drm/xe/display/intel_bo.c +++ b/drivers/gpu/drm/xe/display/intel_bo.c @@ -57,7 +57,7 @@ struct intel_frontbuffer *intel_bo_frontbuffer_get(struct drm_gem_object *obj) { struct xe_frontbuffer *front; - front = kmalloc_obj(*front, GFP_KERNEL); + front = kmalloc_obj(*front); if (!front) return NULL; diff --git a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c index 1c35eb2def8c..8ffc13855ef7 100644 --- a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c +++ b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c @@ -43,7 +43,7 @@ struct intel_dsb_buffer *intel_dsb_buffer_create(struct drm_device *drm, size_t struct xe_bo *obj; int ret; - dsb_buf = kzalloc_obj(*dsb_buf, GFP_KERNEL); + dsb_buf = kzalloc_obj(*dsb_buf); if (!dsb_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c index 0266deccb31a..29c72aa4b0d2 100644 --- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c @@ -95,7 +95,7 @@ static struct intel_hdcp_gsc_context *intel_hdcp_gsc_context_alloc(struct drm_de struct intel_hdcp_gsc_context *gsc_context; int ret; - gsc_context = kzalloc_obj(*gsc_context, GFP_KERNEL); + gsc_context = kzalloc_obj(*gsc_context); if (!gsc_context) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/display/xe_panic.c b/drivers/gpu/drm/xe/display/xe_panic.c index e68abd9268f2..bebb21d617f0 100644 --- a/drivers/gpu/drm/xe/display/xe_panic.c +++ b/drivers/gpu/drm/xe/display/xe_panic.c @@ -79,7 +79,7 @@ static struct intel_panic *xe_panic_alloc(void) { struct intel_panic *panic; - panic = kzalloc_obj(*panic, GFP_KERNEL); + panic = kzalloc_obj(*panic); return panic; } diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c index fac3d60e8a31..5c7df67be8f9 100644 --- a/drivers/gpu/drm/xe/display/xe_stolen.c +++ b/drivers/gpu/drm/xe/display/xe_stolen.c @@ -86,7 +86,7 @@ static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm) struct xe_device *xe = to_xe_device(drm); struct intel_stolen_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c index acbc7802cc5e..49c95ed67d7e 100644 --- a/drivers/gpu/drm/xe/tests/xe_bo.c +++ b/drivers/gpu/drm/xe/tests/xe_bo.c @@ -482,7 +482,7 @@ static int shrink_test_run_device(struct xe_device *xe) unsigned int mem_type; struct xe_ttm_tt *xe_tt; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) { KUNIT_FAIL(test, "Unexpected link allocation failure\n"); failed = true; diff --git a/drivers/gpu/drm/xe/xe_bb.c b/drivers/gpu/drm/xe/xe_bb.c index 18236fbe8e63..4749aa7f9466 100644 --- a/drivers/gpu/drm/xe/xe_bb.c +++ b/drivers/gpu/drm/xe/xe_bb.c @@ -31,7 +31,7 @@ static int bb_prefetch(struct xe_gt *gt) struct xe_bb *xe_bb_new(struct xe_gt *gt, u32 dwords, bool usm) { struct xe_tile *tile = gt_to_tile(gt); - struct xe_bb *bb = kmalloc_obj(*bb, GFP_KERNEL); + struct xe_bb *bb = kmalloc_obj(*bb); int err; if (!bb) @@ -62,7 +62,7 @@ err: struct xe_bb *xe_bb_ccs_new(struct xe_gt *gt, u32 dwords, enum xe_sriov_vf_ccs_rw_ctxs ctx_id) { - struct xe_bb *bb = kmalloc_obj(*bb, GFP_KERNEL); + struct xe_bb *bb = kmalloc_obj(*bb); struct xe_device *xe = gt_to_xe(gt); struct xe_sa_manager *bb_pool; int err; diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index 31eacbbfe50a..29fffc81f240 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -480,7 +480,7 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo, enum ttm_caching caching = ttm_cached; int err; - xe_tt = kzalloc_obj(*xe_tt, GFP_KERNEL); + xe_tt = kzalloc_obj(*xe_tt); if (!xe_tt) return NULL; @@ -2089,7 +2089,7 @@ static const struct drm_gem_object_funcs xe_gem_object_funcs = { */ struct xe_bo *xe_bo_alloc(void) { - struct xe_bo *bo = kzalloc_obj(*bo, GFP_KERNEL); + struct xe_bo *bo = kzalloc_obj(*bo); if (!bo) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index b58191735e31..c59b1414df22 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -998,7 +998,7 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro if (!match) return ERR_PTR(-ENOENT); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_dep_scheduler.c b/drivers/gpu/drm/xe/xe_dep_scheduler.c index f1620711fbd2..51d99fee9aa5 100644 --- a/drivers/gpu/drm/xe/xe_dep_scheduler.c +++ b/drivers/gpu/drm/xe/xe_dep_scheduler.c @@ -86,7 +86,7 @@ xe_dep_scheduler_create(struct xe_device *xe, }; int err; - dep_scheduler = kzalloc_obj(*dep_scheduler, GFP_KERNEL); + dep_scheduler = kzalloc_obj(*dep_scheduler); if (!dep_scheduler) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index f96d992b2ca4..52ee24e9cd3a 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -86,7 +86,7 @@ static int xe_file_open(struct drm_device *dev, struct drm_file *file) int ret = -ENOMEM; struct task_struct *task = NULL; - xef = kzalloc_obj(*xef, GFP_KERNEL); + xef = kzalloc_obj(*xef); if (!xef) return ret; diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c index b7284acc379c..84b66147bf49 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -88,7 +88,7 @@ struct xe_drm_client *xe_drm_client_alloc(void) { struct xe_drm_client *client; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return NULL; diff --git a/drivers/gpu/drm/xe/xe_eu_stall.c b/drivers/gpu/drm/xe/xe_eu_stall.c index a9fa39bfeca7..36ad47ce22b6 100644 --- a/drivers/gpu/drm/xe/xe_eu_stall.c +++ b/drivers/gpu/drm/xe/xe_eu_stall.c @@ -238,7 +238,7 @@ int xe_eu_stall_init(struct xe_gt *gt) if (!xe_eu_stall_supported_on_platform(xe)) return 0; - gt->eu_stall = kzalloc_obj(*gt->eu_stall, GFP_KERNEL); + gt->eu_stall = kzalloc_obj(*gt->eu_stall); if (!gt->eu_stall) { ret = -ENOMEM; goto exit; @@ -906,7 +906,7 @@ static int xe_eu_stall_stream_open_locked(struct drm_device *dev, return -EBUSY; } - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c index 45b7a7fd7a3b..e05dabfcd43c 100644 --- a/drivers/gpu/drm/xe/xe_exec.c +++ b/drivers/gpu/drm/xe/xe_exec.c @@ -162,7 +162,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file) } if (args->num_syncs) { - syncs = kzalloc_objs(*syncs, args->num_syncs, GFP_KERNEL); + syncs = kzalloc_objs(*syncs, args->num_syncs); if (!syncs) { err = -ENOMEM; goto err_exec_queue; diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 36b0bd32e2a6..c41e7cc13d8a 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -681,7 +681,7 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue * struct xe_exec_queue_group *group; struct xe_bo *bo; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c index 405069c72773..371983c94a1b 100644 --- a/drivers/gpu/drm/xe/xe_execlist.c +++ b/drivers/gpu/drm/xe/xe_execlist.c @@ -352,7 +352,7 @@ static int execlist_exec_queue_init(struct xe_exec_queue *q) drm_info(&xe->drm, "Enabling execlist submission (GuC submission disabled)\n"); - exl = kzalloc_obj(*exl, GFP_KERNEL); + exl = kzalloc_obj(*exl); if (!exl) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c index e2ab22643c63..7fc0bed6ece0 100644 --- a/drivers/gpu/drm/xe/xe_gt_sysfs.c +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c @@ -36,7 +36,7 @@ int xe_gt_sysfs_init(struct xe_gt *gt) struct kobj_gt *kg; int err; - kg = kzalloc_obj(*kg, GFP_KERNEL); + kg = kzalloc_obj(*kg); if (!kg) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index e15a38ff7354..799ef9f48003 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1903,7 +1903,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) xe_gt_assert(guc_to_gt(guc), xe_device_uc_enabled(guc_to_xe(guc))); - ge = kzalloc_obj(*ge, GFP_KERNEL); + ge = kzalloc_obj(*ge); if (!ge) return -ENOMEM; @@ -2057,7 +2057,7 @@ static int guc_exec_queue_set_priority(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -2075,7 +2075,7 @@ static int guc_exec_queue_set_timeslice(struct xe_exec_queue *q, u32 timeslice_u exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -2094,7 +2094,7 @@ static int guc_exec_queue_set_preempt_timeout(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -2115,7 +2115,7 @@ static int guc_exec_queue_set_multi_queue_priority(struct xe_exec_queue *q, exec_queue_killed_or_banned_or_wedged(q)) return 0; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c index 1e0eeb77427c..5af8903e10af 100644 --- a/drivers/gpu/drm/xe/xe_heci_gsc.c +++ b/drivers/gpu/drm/xe/xe_heci_gsc.c @@ -131,7 +131,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def * struct mei_aux_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; adev->irq = heci_gsc->irq; diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c index 4425a1ce140f..d42e263e0611 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c @@ -549,7 +549,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char struct kobj_eclass *keclass; int err = 0; - keclass = kzalloc_obj(*keclass, GFP_KERNEL); + keclass = kzalloc_obj(*keclass); if (!keclass) return NULL; @@ -582,7 +582,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe, struct kobject *kobj; int err = 0; - kobj = kzalloc_obj(*kobj, GFP_KERNEL); + kobj = kzalloc_obj(*kobj); if (!kobj) return -ENOMEM; @@ -629,7 +629,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt) u16 class_mask = 0; int err = 0; - kobj = kzalloc_obj(*kobj, GFP_KERNEL); + kobj = kzalloc_obj(*kobj); if (!kobj) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index 4b2091d552fd..b0f037bc227f 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1616,7 +1616,7 @@ struct xe_lrc *xe_lrc_create(struct xe_hw_engine *hwe, struct xe_vm *vm, struct xe_lrc *lrc; int err; - lrc = kzalloc_obj(*lrc, GFP_KERNEL); + lrc = kzalloc_obj(*lrc); if (!lrc) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 9d463a48a4d4..e58b9b433654 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -2303,7 +2303,7 @@ static struct drm_pagemap_addr *xe_migrate_dma_map(struct xe_device *xe, struct drm_pagemap_addr *pagemap_addr; unsigned long i, npages = DIV_ROUND_UP(len, PAGE_SIZE); - pagemap_addr = kzalloc_objs(*pagemap_addr, npages, GFP_KERNEL); + pagemap_addr = kzalloc_objs(*pagemap_addr, npages); if (!pagemap_addr) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_mmio_gem.c b/drivers/gpu/drm/xe/xe_mmio_gem.c index c4fb55d2dcce..8c803ef233cc 100644 --- a/drivers/gpu/drm/xe/xe_mmio_gem.c +++ b/drivers/gpu/drm/xe/xe_mmio_gem.c @@ -78,7 +78,7 @@ struct xe_mmio_gem *xe_mmio_gem_create(struct xe_device *xe, struct drm_file *fi if ((phys_addr % PAGE_SIZE != 0) || (size % PAGE_SIZE != 0)) return ERR_PTR(-EINVAL); - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_nvm.c b/drivers/gpu/drm/xe/xe_nvm.c index fb5eb9099921..9c4ccd3b39d4 100644 --- a/drivers/gpu/drm/xe/xe_nvm.c +++ b/drivers/gpu/drm/xe/xe_nvm.c @@ -133,7 +133,7 @@ int xe_nvm_init(struct xe_device *xe) if (WARN_ON(xe->nvm)) return -EFAULT; - xe->nvm = kzalloc_obj(*nvm, GFP_KERNEL); + xe->nvm = kzalloc_obj(*nvm); if (!xe->nvm) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c index 283cd72ef40b..e40cfeb64911 100644 --- a/drivers/gpu/drm/xe/xe_oa.c +++ b/drivers/gpu/drm/xe/xe_oa.c @@ -905,7 +905,7 @@ __xe_oa_alloc_config_buffer(struct xe_oa_stream *stream, struct xe_oa_config *oa size_t config_length; struct xe_bb *bb; - oa_bo = kzalloc_obj(*oa_bo, GFP_KERNEL); + oa_bo = kzalloc_obj(*oa_bo); if (!oa_bo) return ERR_PTR(-ENOMEM); @@ -997,7 +997,7 @@ static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config int i, err, num_signal = 0; struct dma_fence *fence; - ofence = kzalloc_obj(*ofence, GFP_KERNEL); + ofence = kzalloc_obj(*ofence); if (!ofence) { err = -ENOMEM; goto exit; @@ -1853,7 +1853,7 @@ static int xe_oa_stream_open_ioctl_locked(struct xe_oa *oa, if (ret) goto exit; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) { ret = -ENOMEM; goto err_syncobj; @@ -2260,7 +2260,7 @@ xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr), int err; u32 i; - oa_regs = kmalloc_objs(*oa_regs, n_regs, GFP_KERNEL); + oa_regs = kmalloc_objs(*oa_regs, n_regs); if (!oa_regs) return ERR_PTR(-ENOMEM); @@ -2362,7 +2362,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi XE_IOCTL_DBG(oa->xe, !arg->n_regs)) return -EINVAL; - oa_config = kzalloc_obj(*oa_config, GFP_KERNEL); + oa_config = kzalloc_obj(*oa_config); if (!oa_config) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c index ac8303509d48..ce1b110f762b 100644 --- a/drivers/gpu/drm/xe/xe_pmu.c +++ b/drivers/gpu/drm/xe/xe_pmu.c @@ -142,7 +142,7 @@ static bool event_gt_forcewake(struct perf_event *event) gt = xe_device_get_gt(xe, config_to_gt_id(config)); - fw_ref = kzalloc_obj(*fw_ref, GFP_KERNEL); + fw_ref = kzalloc_obj(*fw_ref); if (!fw_ref) return false; diff --git a/drivers/gpu/drm/xe/xe_preempt_fence.c b/drivers/gpu/drm/xe/xe_preempt_fence.c index 85c792ee0818..d6427b473ddd 100644 --- a/drivers/gpu/drm/xe/xe_preempt_fence.c +++ b/drivers/gpu/drm/xe/xe_preempt_fence.c @@ -101,7 +101,7 @@ struct xe_preempt_fence *xe_preempt_fence_alloc(void) { struct xe_preempt_fence *pfence; - pfence = kmalloc_obj(*pfence, GFP_KERNEL); + pfence = kmalloc_obj(*pfence); if (!pfence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 5d3a84baa80b..c6ccef09916d 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -109,11 +109,11 @@ struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile, int err; if (level) { - struct xe_pt_dir *dir = kzalloc_obj(*dir, GFP_KERNEL); + struct xe_pt_dir *dir = kzalloc_obj(*dir); pt = (dir) ? &dir->pt : NULL; } else { - pt = kzalloc_obj(*pt, GFP_KERNEL); + pt = kzalloc_obj(*pt); } if (!pt) return ERR_PTR(-ENOMEM); @@ -2573,7 +2573,7 @@ xe_pt_update_ops_run(struct xe_tile *tile, struct xe_vma_ops *vops) } } - rfence = kzalloc_obj(*rfence, GFP_KERNEL); + rfence = kzalloc_obj(*rfence); if (!rfence) { err = -ENOMEM; goto free_ijob; diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c index 80532bbce727..2e5c78940b41 100644 --- a/drivers/gpu/drm/xe/xe_reg_sr.c +++ b/drivers/gpu/drm/xe/xe_reg_sr.c @@ -89,7 +89,7 @@ int xe_reg_sr_add(struct xe_reg_sr *sr, return 0; } - pentry = kmalloc_obj(*pentry, GFP_KERNEL); + pentry = kmalloc_obj(*pentry); if (!pentry) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c index f798404ac337..83374cd57660 100644 --- a/drivers/gpu/drm/xe/xe_shrinker.c +++ b/drivers/gpu/drm/xe/xe_shrinker.c @@ -282,7 +282,7 @@ static void xe_shrinker_fini(struct drm_device *drm, void *arg) */ int xe_shrinker_create(struct xe_device *xe) { - struct xe_shrinker *shrinker = kzalloc_obj(*shrinker, GFP_KERNEL); + struct xe_shrinker *shrinker = kzalloc_obj(*shrinker); if (!shrinker) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_sriov_packet.c b/drivers/gpu/drm/xe/xe_sriov_packet.c index 26905bc61979..968f32496282 100644 --- a/drivers/gpu/drm/xe/xe_sriov_packet.c +++ b/drivers/gpu/drm/xe/xe_sriov_packet.c @@ -89,7 +89,7 @@ struct xe_sriov_packet *xe_sriov_packet_alloc(struct xe_device *xe) { struct xe_sriov_packet *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c index 457676713402..0b88cdade6f1 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c @@ -364,7 +364,7 @@ static struct kobject *create_xe_sriov_kobj(struct xe_device *xe, unsigned int v xe_sriov_pf_assert_vfid(xe, vfid); - vkobj = kzalloc_obj(*vkobj, GFP_KERNEL); + vkobj = kzalloc_obj(*vkobj); if (!vkobj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index ead9a61b1cdb..ca67d0bdbfac 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -109,7 +109,7 @@ xe_svm_range_alloc(struct drm_gpusvm *gpusvm) { struct xe_svm_range *range; - range = kzalloc_obj(*range, GFP_KERNEL); + range = kzalloc_obj(*range); if (!range) return NULL; @@ -1748,7 +1748,7 @@ static struct xe_pagemap *xe_pagemap_create(struct xe_device *xe, struct xe_vram void *addr; int err; - xpagemap = kzalloc_obj(*xpagemap, GFP_KERNEL); + xpagemap = kzalloc_obj(*xpagemap); if (!xpagemap) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index 69a723a8c68e..eb136390dafd 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -59,7 +59,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr, if (get_user(prefetch_val, ptr)) return ERR_PTR(-EFAULT); - ufence = kzalloc_obj(*ufence, GFP_KERNEL); + ufence = kzalloc_obj(*ufence); if (!ufence) return ERR_PTR(-ENOMEM); @@ -343,7 +343,7 @@ xe_sync_in_fence_get(struct xe_sync_entry *sync, int num_sync, num_fence++; } - fences = kmalloc_objs(*fences, num_fence, GFP_KERNEL); + fences = kmalloc_objs(*fences, num_fence); if (!fences) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c index 39f04b309e73..0bfd28422dc2 100644 --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c @@ -36,7 +36,7 @@ int xe_tile_sysfs_init(struct xe_tile *tile) struct kobj_tile *kt; int err; - kt = kzalloc_obj(*kt, GFP_KERNEL); + kt = kzalloc_obj(*kt); if (!kt) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_tlb_inval_job.c b/drivers/gpu/drm/xe/xe_tlb_inval_job.c index 0560605588db..04d21015cd5d 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval_job.c +++ b/drivers/gpu/drm/xe/xe_tlb_inval_job.c @@ -108,7 +108,7 @@ xe_tlb_inval_job_create(struct xe_exec_queue *q, struct xe_tlb_inval *tlb_inval, xe_assert(vm->xe, type == XE_EXEC_QUEUE_TLB_INVAL_MEDIA_GT || type == XE_EXEC_QUEUE_TLB_INVAL_PRIMARY_GT); - job = kmalloc_obj(*job, GFP_KERNEL); + job = kmalloc_obj(*job); if (!job) return ERR_PTR(-ENOMEM); @@ -125,7 +125,7 @@ xe_tlb_inval_job_create(struct xe_exec_queue *q, struct xe_tlb_inval *tlb_inval, xe_exec_queue_get(q); /* Pairs with put in xe_tlb_inval_job_destroy */ xe_vm_get(vm); /* Pairs with put in xe_tlb_inval_job_destroy */ - ifence = kmalloc_obj(*ifence, GFP_KERNEL); + ifence = kmalloc_obj(*ifence); if (!ifence) { err = -ENOMEM; goto err_job; diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c index 93ad02ec76eb..344769d939e0 100644 --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c @@ -64,7 +64,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, if (tbo->base.size >> PAGE_SHIFT > (lpfn - place->fpfn)) return -E2BIG; /* don't trigger eviction for the impossible */ - vres = kzalloc_obj(*vres, GFP_KERNEL); + vres = kzalloc_obj(*vres); if (!vres) return -ENOMEM; @@ -371,7 +371,7 @@ int xe_ttm_vram_mgr_alloc_sgt(struct xe_device *xe, if (vres->used_visible_size < res->size) return -EOPNOTSUPP; - *sgt = kmalloc_obj(**sgt, GFP_KERNEL); + *sgt = kmalloc_obj(**sgt); if (!*sgt) return -ENOMEM; diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index b53d76dc62b2..a82e3a4fb389 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -667,7 +667,7 @@ static int xe_vm_ops_add_rebind(struct xe_vma_ops *vops, struct xe_vma *vma, { struct xe_vma_op *op; - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (!op) return -ENOMEM; @@ -803,7 +803,7 @@ xe_vm_ops_add_range_rebind(struct xe_vma_ops *vops, { struct xe_vma_op *op; - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (!op) return -ENOMEM; @@ -889,7 +889,7 @@ xe_vm_ops_add_range_unbind(struct xe_vma_ops *vops, { struct xe_vma_op *op; - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (!op) return -ENOMEM; @@ -1008,14 +1008,14 @@ static struct xe_vma *xe_vma_create(struct xe_vm *vm, * matches what was allocated. */ if (!bo && !is_null && !is_cpu_addr_mirror) { - struct xe_userptr_vma *uvma = kzalloc_obj(*uvma, GFP_KERNEL); + struct xe_userptr_vma *uvma = kzalloc_obj(*uvma); if (!uvma) return ERR_PTR(-ENOMEM); vma = &uvma->vma; } else { - vma = kzalloc_obj(*vma, GFP_KERNEL); + vma = kzalloc_obj(*vma); if (!vma) return ERR_PTR(-ENOMEM); @@ -1235,7 +1235,7 @@ static struct drm_gpuva_op *xe_vm_op_alloc(void) { struct xe_vma_op *op; - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (unlikely(!op)) return NULL; @@ -3161,7 +3161,7 @@ static struct dma_fence *ops_execute(struct xe_vm *vm, ++n_fence; } - fences = kmalloc_objs(*fences, n_fence, GFP_KERNEL); + fences = kmalloc_objs(*fences, n_fence); if (!fences) { fence = ERR_PTR(-ENOMEM); goto err_trace; @@ -3705,7 +3705,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file) } if (args->num_syncs) { - syncs = kzalloc_objs(*syncs, args->num_syncs, GFP_KERNEL); + syncs = kzalloc_objs(*syncs, args->num_syncs); if (!syncs) { err = -ENOMEM; goto put_obj; diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 79dce72c9bc4..e1890d0c7369 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -171,7 +171,7 @@ int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, if (unlikely(!evtchnl)) return -EIO; - dbuf = kzalloc_obj(*dbuf, GFP_KERNEL); + dbuf = kzalloc_obj(*dbuf); if (!dbuf) return -ENOMEM; @@ -496,7 +496,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) DRM_INFO("Creating %s\n", xen_drm_driver.desc); - drm_info = kzalloc_obj(*drm_info, GFP_KERNEL); + drm_info = kzalloc_obj(*drm_info); if (!drm_info) { ret = -ENOMEM; goto fail; diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c index afad19fe01d2..c80043a6a99f 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c @@ -118,7 +118,7 @@ static struct xen_gem_object *gem_create_obj(struct drm_device *dev, struct xen_gem_object *xen_obj; int ret; - xen_obj = kzalloc_obj(*xen_obj, GFP_KERNEL); + xen_obj = kzalloc_obj(*xen_obj); if (!xen_obj) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index db1053161e35..9a8f38230cb4 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1360,7 +1360,7 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) struct zynqmp_disp *disp; int ret; - disp = kzalloc_obj(*disp, GFP_KERNEL); + disp = kzalloc_obj(*disp); if (!disp) return -ENOMEM; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 4f21dc062170..379180fb3004 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1739,7 +1739,7 @@ static const struct drm_edid *zynqmp_dp_bridge_edid_read(struct drm_bridge *brid static u32 *zynqmp_dp_bridge_default_bus_fmts(unsigned int *num_input_fmts) { - u32 *formats = kzalloc_obj(*formats, GFP_KERNEL); + u32 *formats = kzalloc_obj(*formats); if (formats) *formats = MEDIA_BUS_FMT_FIXED; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index 137d3e85e0fb..53ab1a2a5aaf 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -189,7 +189,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) int ret; /* Allocate private data. */ - dpsub = kzalloc_obj(*dpsub, GFP_KERNEL); + dpsub = kzalloc_obj(*dpsub); if (!dpsub) return -ENOMEM; diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index b0c12d63d7b4..f814eb4941c0 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -43,7 +43,7 @@ static int host1x_subdev_add(struct host1x_device *device, struct host1x_subdev *subdev; int err; - subdev = kzalloc_obj(*subdev, GFP_KERNEL); + subdev = kzalloc_obj(*subdev); if (!subdev) return -ENOMEM; @@ -459,7 +459,7 @@ static int host1x_device_add(struct host1x *host1x, struct host1x_device *device; int err; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return -ENOMEM; diff --git a/drivers/gpu/host1x/context.c b/drivers/gpu/host1x/context.c index 8d7719dab510..d50d41c20561 100644 --- a/drivers/gpu/host1x/context.c +++ b/drivers/gpu/host1x/context.c @@ -35,7 +35,7 @@ int host1x_memory_context_list_init(struct host1x *host1x) return 0; cdl->len = err / 4; - cdl->devs = kzalloc_objs(*cdl->devs, cdl->len, GFP_KERNEL); + cdl->devs = kzalloc_objs(*cdl->devs, cdl->len); if (!cdl->devs) return -ENOMEM; diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c index d8f3aade9b2e..b9a7d0bf91f8 100644 --- a/drivers/gpu/host1x/fence.c +++ b/drivers/gpu/host1x/fence.c @@ -127,7 +127,7 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold, { struct host1x_syncpt_fence *fence; - fence = kzalloc_obj(*fence, GFP_KERNEL); + fence = kzalloc_obj(*fence); if (!fence) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c index 90108d695f63..fea9f491df66 100644 --- a/drivers/gpu/host1x/mipi.c +++ b/drivers/gpu/host1x/mipi.c @@ -219,7 +219,7 @@ struct tegra_mipi_device *tegra_mipi_request(struct device *device, if (err < 0) return ERR_PTR(err); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { err = -ENOMEM; goto out; diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index fa3a8f1f7aa7..5db100bb1e4d 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -183,7 +183,7 @@ struct ipuv3_channel *ipu_idmac_get(struct ipu_soc *ipu, unsigned num) } } - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) { channel = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index e994abcd7a0d..29b6d36c9bb6 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -2082,7 +2082,7 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task, chan = &priv->chan[ic_task]; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); @@ -2402,7 +2402,7 @@ ipu_image_convert(struct ipu_soc *ipu, enum ipu_ic_task ic_task, if (IS_ERR(ctx)) return ERR_CAST(ctx); - run = kzalloc_obj(*run, GFP_KERNEL); + run = kzalloc_obj(*run); if (!run) { ipu_image_convert_unprepare(ctx); return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 1d7d52245197..8fe1ae3c71bb 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -297,7 +297,7 @@ static int register_client(struct pci_dev *pdev, { struct vga_switcheroo_client *client; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; diff --git a/drivers/greybus/bundle.c b/drivers/greybus/bundle.c index f8aee6da89a4..d1831d0986e9 100644 --- a/drivers/greybus/bundle.c +++ b/drivers/greybus/bundle.c @@ -197,7 +197,7 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, return NULL; } - bundle = kzalloc_obj(*bundle, GFP_KERNEL); + bundle = kzalloc_obj(*bundle); if (!bundle) return NULL; diff --git a/drivers/greybus/connection.c b/drivers/greybus/connection.c index 91fd5cbb716d..bd04485decb3 100644 --- a/drivers/greybus/connection.c +++ b/drivers/greybus/connection.c @@ -165,7 +165,7 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id, } hd_cport_id = ret; - connection = kzalloc_obj(*connection, GFP_KERNEL); + connection = kzalloc_obj(*connection); if (!connection) { ret = -ENOMEM; goto err_hd_cport_release; diff --git a/drivers/greybus/control.c b/drivers/greybus/control.c index 8e5c8288bf5a..aec3c8e3802a 100644 --- a/drivers/greybus/control.c +++ b/drivers/greybus/control.c @@ -446,7 +446,7 @@ struct gb_control *gb_control_create(struct gb_interface *intf) struct gb_connection *connection; struct gb_control *control; - control = kzalloc_obj(*control, GFP_KERNEL); + control = kzalloc_obj(*control); if (!control) return ERR_PTR(-ENOMEM); diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c index 5acb238dde17..6ae0ac828afa 100644 --- a/drivers/greybus/es2.c +++ b/drivers/greybus/es2.c @@ -547,7 +547,7 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id, u32 connection_flags; int ret; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -883,7 +883,7 @@ static struct arpc *arpc_alloc(void *payload, u16 size, u8 type) if (size + sizeof(*rpc->req) > ARPC_OUT_SIZE_MAX) return NULL; - rpc = kzalloc_obj(*rpc, GFP_KERNEL); + rpc = kzalloc_obj(*rpc); if (!rpc) return NULL; @@ -892,7 +892,7 @@ static struct arpc *arpc_alloc(void *payload, u16 size, u8 type) if (!rpc->req) goto err_free_rpc; - rpc->resp = kzalloc_obj(*rpc->resp, GFP_KERNEL); + rpc->resp = kzalloc_obj(*rpc->resp); if (!rpc->resp) goto err_free_req; @@ -1203,7 +1203,7 @@ static int apb_get_cport_count(struct usb_device *udev) int retval; __le16 *cport_count; - cport_count = kzalloc_obj(*cport_count, GFP_KERNEL); + cport_count = kzalloc_obj(*cport_count); if (!cport_count) return -ENOMEM; diff --git a/drivers/greybus/interface.c b/drivers/greybus/interface.c index 881eb5e545a0..4ee4bda4a267 100644 --- a/drivers/greybus/interface.c +++ b/drivers/greybus/interface.c @@ -789,7 +789,7 @@ struct gb_interface *gb_interface_create(struct gb_module *module, struct gb_host_device *hd = module->hd; struct gb_interface *intf; - intf = kzalloc_obj(*intf, GFP_KERNEL); + intf = kzalloc_obj(*intf); if (!intf) return NULL; diff --git a/drivers/greybus/manifest.c b/drivers/greybus/manifest.c index 0cb87bea249e..a1b2567895bf 100644 --- a/drivers/greybus/manifest.c +++ b/drivers/greybus/manifest.c @@ -157,7 +157,7 @@ static int identify_descriptor(struct gb_interface *intf, expected_size, desc_size); } - descriptor = kzalloc_obj(*descriptor, GFP_KERNEL); + descriptor = kzalloc_obj(*descriptor); if (!descriptor) return -ENOMEM; diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c index 4efe3dd5bc17..ee79048e3033 100644 --- a/drivers/greybus/svc.c +++ b/drivers/greybus/svc.c @@ -1128,7 +1128,7 @@ static int gb_svc_queue_deferred_request(struct gb_operation *operation) struct gb_svc *svc = gb_connection_get_data(operation->connection); struct gb_svc_deferred_request *dr; - dr = kmalloc_obj(*dr, GFP_KERNEL); + dr = kmalloc_obj(*dr); if (!dr) return -ENOMEM; @@ -1315,7 +1315,7 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd) { struct gb_svc *svc; - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) return NULL; diff --git a/drivers/greybus/svc_watchdog.c b/drivers/greybus/svc_watchdog.c index 2d2171f95822..16e6de5e9eff 100644 --- a/drivers/greybus/svc_watchdog.c +++ b/drivers/greybus/svc_watchdog.c @@ -112,7 +112,7 @@ int gb_svc_watchdog_create(struct gb_svc *svc) if (svc->watchdog) return 0; - watchdog = kmalloc_obj(*watchdog, GFP_KERNEL); + watchdog = kmalloc_obj(*watchdog); if (!watchdog) return -ENOMEM; diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_client.c b/drivers/hid/amd-sfh-hid/amd_sfh_client.c index 8b479441bf90..96ae792beeb6 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -47,7 +47,7 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type) guard(mutex)(&mp2->lock); for (i = 0; i < cli_data->num_hid_devices; i++) { if (cli_data->hid_sensor_hubs[i] == hid) { - struct request_list *new = kzalloc_obj(*new, GFP_KERNEL); + struct request_list *new = kzalloc_obj(*new); if (!new) return -ENOMEM; diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c index 59bc9a2e0cd7..b04f675d49b0 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c @@ -135,7 +135,7 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data) if (IS_ERR(hid)) return PTR_ERR(hid); - hid_data = kzalloc_obj(*hid_data, GFP_KERNEL); + hid_data = kzalloc_obj(*hid_data); if (!hid_data) { rc = -ENOMEM; goto err_hid_data; diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c index c99d81789eb3..f3d15994ca1e 100644 --- a/drivers/hid/bpf/hid_bpf_dispatch.c +++ b/drivers/hid/bpf/hid_bpf_dispatch.c @@ -320,7 +320,7 @@ hid_bpf_allocate_context(unsigned int hid_id) if (IS_ERR(hdev)) return NULL; - ctx_kern = kzalloc_obj(*ctx_kern, GFP_KERNEL); + ctx_kern = kzalloc_obj(*ctx_kern); if (!ctx_kern) { hid_put_device(hdev); return NULL; diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 189baafe2d1e..b949b767cf08 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -794,7 +794,7 @@ static int apple_backlight_set(struct hid_device *hdev, u16 value, u16 rate) int ret = 0; struct apple_backlight_set_report *rep; - rep = kmalloc_obj(*rep, GFP_KERNEL); + rep = kmalloc_obj(*rep); if (rep == NULL) return -ENOMEM; diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index c7dcdffff9e6..3c5c2bf02425 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c @@ -96,7 +96,7 @@ static int axff_init(struct hid_device *hid) return -ENODEV; } - axff = kzalloc_obj(struct axff_device, GFP_KERNEL); + axff = kzalloc_obj(struct axff_device); if (!axff) return -ENOMEM; diff --git a/drivers/hid/hid-betopff.c b/drivers/hid/hid-betopff.c index d739b3746138..8a7fe895926c 100644 --- a/drivers/hid/hid-betopff.c +++ b/drivers/hid/hid-betopff.c @@ -100,7 +100,7 @@ static int betopff_init(struct hid_device *hid) } } - betopff = kzalloc_obj(*betopff, GFP_KERNEL); + betopff = kzalloc_obj(*betopff); if (!betopff) return -ENOMEM; diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c index c81c34e5b41a..6bc50df9b3e1 100644 --- a/drivers/hid/hid-cmedia.c +++ b/drivers/hid/hid-cmedia.c @@ -145,7 +145,7 @@ static int cmhid_probe(struct hid_device *hid, const struct hid_device_id *id) int ret; struct cmhid *cm; - cm = kzalloc_obj(struct cmhid, GFP_KERNEL); + cm = kzalloc_obj(struct cmhid); if (!cm) { ret = -ENOMEM; goto allocfail; diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d1ea455ce3d2..ef307c4c575e 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -93,7 +93,7 @@ struct hid_report *hid_register_report(struct hid_device *device, if (report_enum->report_id_hash[id]) return report_enum->report_id_hash[id]; - report = kzalloc_obj(struct hid_report, GFP_KERNEL); + report = kzalloc_obj(struct hid_report); if (!report) return NULL; @@ -1797,7 +1797,7 @@ static void hid_report_process_ordering(struct hid_device *hid, } /* allocate the memory to process the fields */ - entries = kzalloc_objs(*entries, count, GFP_KERNEL); + entries = kzalloc_objs(*entries, count); if (!entries) return; @@ -2611,7 +2611,7 @@ static ssize_t new_id_store(struct device_driver *drv, const char *buf, if (ret < 3) return -EINVAL; - dynid = kzalloc_obj(*dynid, GFP_KERNEL); + dynid = kzalloc_obj(*dynid); if (!dynid) return -ENOMEM; @@ -2973,7 +2973,7 @@ struct hid_device *hid_allocate_device(void) struct hid_device *hdev; int ret = -ENOMEM; - hdev = kzalloc_obj(*hdev, GFP_KERNEL); + hdev = kzalloc_obj(*hdev); if (hdev == NULL) return ERR_PTR(ret); diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c index 750cac0a2a69..21cd8b12a757 100644 --- a/drivers/hid/hid-corsair.c +++ b/drivers/hid/hid-corsair.c @@ -427,7 +427,7 @@ static int k90_init_backlight(struct hid_device *dev) size_t name_sz; char *name; - drvdata->backlight = kzalloc_obj(struct k90_led, GFP_KERNEL); + drvdata->backlight = kzalloc_obj(struct k90_led); if (!drvdata->backlight) { ret = -ENOMEM; goto fail_backlight_alloc; @@ -471,7 +471,7 @@ static int k90_init_macro_functions(struct hid_device *dev) size_t name_sz; char *name; - k90 = kzalloc_obj(struct k90_drvdata, GFP_KERNEL); + k90 = kzalloc_obj(struct k90_drvdata); if (!k90) { ret = -ENOMEM; goto fail_drvdata; diff --git a/drivers/hid/hid-cougar.c b/drivers/hid/hid-cougar.c index 0b66a7c61ac6..ad027c45f162 100644 --- a/drivers/hid/hid-cougar.c +++ b/drivers/hid/hid-cougar.c @@ -166,7 +166,7 @@ static int cougar_bind_shared_data(struct hid_device *hdev, shared = cougar_get_shared_data(hdev); if (!shared) { - shared = kzalloc_obj(*shared, GFP_KERNEL); + shared = kzalloc_obj(*shared); if (!shared) { error = -ENOMEM; goto out; diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 220b497c573a..f20dc46fd8eb 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -3681,7 +3681,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) struct hid_debug_list *list; unsigned long flags; - if (!(list = kzalloc_obj(struct hid_debug_list, GFP_KERNEL))) { + if (!(list = kzalloc_obj(struct hid_debug_list))) { err = -ENOMEM; goto out; } diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c index 9923b222383a..8a8f68a7feb0 100644 --- a/drivers/hid/hid-dr.c +++ b/drivers/hid/hid-dr.c @@ -104,7 +104,7 @@ static int drff_init(struct hid_device *hid) return -ENODEV; } - drff = kzalloc_obj(struct drff_device, GFP_KERNEL); + drff = kzalloc_obj(struct drff_device); if (!drff) return -ENOMEM; diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c index 465f04ed1a55..b8f5f3eb53a4 100644 --- a/drivers/hid/hid-elo.c +++ b/drivers/hid/hid-elo.c @@ -232,7 +232,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) if (!hid_is_usb(hdev)) return -EINVAL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index 0dbe598f2e48..1b4ad18f6051 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c @@ -76,7 +76,7 @@ static int emsff_init(struct hid_device *hid) return -ENODEV; } - emsff = kzalloc_obj(struct emsff_device, GFP_KERNEL); + emsff = kzalloc_obj(struct emsff_device); if (!emsff) return -ENOMEM; diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c index a9d305a193d2..8b99686b63df 100644 --- a/drivers/hid/hid-gaff.c +++ b/drivers/hid/hid-gaff.c @@ -96,7 +96,7 @@ static int gaff_init(struct hid_device *hid) return -ENODEV; } - gaff = kzalloc_obj(struct gaff_device, GFP_KERNEL); + gaff = kzalloc_obj(struct gaff_device); if (!gaff) return -ENOMEM; diff --git a/drivers/hid/hid-holtekff.c b/drivers/hid/hid-holtekff.c index 56980af08683..32d08f7a660d 100644 --- a/drivers/hid/hid-holtekff.c +++ b/drivers/hid/hid-holtekff.c @@ -149,7 +149,7 @@ static int holtekff_init(struct hid_device *hid) return -ENODEV; } - holtekff = kzalloc_obj(*holtekff, GFP_KERNEL); + holtekff = kzalloc_obj(*holtekff); if (!holtekff) return -ENOMEM; diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c index f092547d08d2..7d2b0063df15 100644 --- a/drivers/hid/hid-hyperv.c +++ b/drivers/hid/hid-hyperv.c @@ -149,7 +149,7 @@ static struct mousevsc_dev *mousevsc_alloc_device(struct hv_device *device) { struct mousevsc_dev *input_dev; - input_dev = kzalloc_obj(struct mousevsc_dev, GFP_KERNEL); + input_dev = kzalloc_obj(struct mousevsc_dev); if (!input_dev) return NULL; diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 6137cc0aeeaf..d5308adb2894 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -531,7 +531,7 @@ static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type, if (quirks & HID_BATTERY_QUIRK_IGNORE) return 0; - psy_desc = kzalloc_obj(*psy_desc, GFP_KERNEL); + psy_desc = kzalloc_obj(*psy_desc); if (!psy_desc) return -ENOMEM; @@ -2023,7 +2023,7 @@ static void report_features(struct hid_device *hid) static struct hid_input *hidinput_allocate(struct hid_device *hid, unsigned int application) { - struct hid_input *hidinput = kzalloc_obj(*hidinput, GFP_KERNEL); + struct hid_input *hidinput = kzalloc_obj(*hidinput); struct input_dev *input_dev = input_allocate_device(); const char *suffix = NULL; size_t suffix_len, name_len; diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 7cdf1e895b69..197c2f3b077f 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -768,7 +768,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) return -ENODEV; } - drv_data = kzalloc_obj(struct lg_drv_data, GFP_KERNEL); + drv_data = kzalloc_obj(struct lg_drv_data); if (!drv_data) { hid_err(hdev, "Insufficient memory, cannot allocate driver data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c index e4a034bd4095..c3e85b079d80 100644 --- a/drivers/hid/hid-lg2ff.c +++ b/drivers/hid/hid-lg2ff.c @@ -66,7 +66,7 @@ int lg2ff_init(struct hid_device *hid) if (!report) return -ENODEV; - lg2ff = kmalloc_obj(struct lg2ff_device, GFP_KERNEL); + lg2ff = kmalloc_obj(struct lg2ff_device); if (!lg2ff) return -ENOMEM; diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 4979f7779de8..e901fdb7d033 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -1288,7 +1288,7 @@ int lg4ff_init(struct hid_device *hid) hid_err(hid, "Cannot add device, private driver data not allocated\n"); return -1; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; spin_lock_init(&entry->report_lock); diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 2fb6a67bede2..d9b6c72fc254 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -733,7 +733,7 @@ static struct dj_receiver_dev *dj_get_receiver_dev(struct hid_device *hdev, djrcv_dev = dj_find_receiver_dev(hdev, type); if (!djrcv_dev) { - djrcv_dev = kzalloc_obj(*djrcv_dev, GFP_KERNEL); + djrcv_dev = kzalloc_obj(*djrcv_dev); if (!djrcv_dev) goto out; @@ -851,7 +851,7 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, snprintf(tmpstr, sizeof(tmpstr), ":%d", device_index); strlcat(dj_hiddev->phys, tmpstr, sizeof(dj_hiddev->phys)); - dj_dev = kzalloc_obj(struct dj_device, GFP_KERNEL); + dj_dev = kzalloc_obj(struct dj_device); if (!dj_dev) { hid_err(djrcv_hdev, "%s: failed allocating dj_dev\n", __func__); @@ -1332,7 +1332,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) goto out; } - dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL); + dj_report = kzalloc_obj(struct dj_report); if (!dj_report) return -ENOMEM; dj_report->report_id = REPORT_ID_DJ_SHORT; @@ -1356,7 +1356,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, u8 *buf; int retval = 0; - dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL); + dj_report = kzalloc_obj(struct dj_report); if (!dj_report) return -ENOMEM; diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 4f3289b8a7c2..d40932809ce1 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -390,7 +390,7 @@ static int hidpp_send_fap_command_sync(struct hidpp_device *hidpp, return -EINVAL; } - message = kzalloc_obj(struct hidpp_report, GFP_KERNEL); + message = kzalloc_obj(struct hidpp_report); if (!message) return -ENOMEM; @@ -443,7 +443,7 @@ static int hidpp_send_rap_command_sync(struct hidpp_device *hidpp_dev, if (param_count > max_count) return -EINVAL; - message = kzalloc_obj(struct hidpp_report, GFP_KERNEL); + message = kzalloc_obj(struct hidpp_report); if (!message) return -ENOMEM; message->report_id = report_id; @@ -2527,7 +2527,7 @@ out: static int hidpp_ff_queue_work(struct hidpp_ff_private_data *data, int effect_id, u8 command, u8 *params, u8 size) { - struct hidpp_ff_work_data *wd = kzalloc_obj(*wd, GFP_KERNEL); + struct hidpp_ff_work_data *wd = kzalloc_obj(*wd); int s; if (!wd) @@ -2853,7 +2853,7 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, data = kmemdup(data, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->effect_ids = kzalloc_objs(int, num_slots, GFP_KERNEL); + data->effect_ids = kzalloc_objs(int, num_slots); if (!data->effect_ids) { kfree(data); return -ENOMEM; diff --git a/drivers/hid/hid-megaworld.c b/drivers/hid/hid-megaworld.c index 62f3e976f6b3..81acdbc3a00f 100644 --- a/drivers/hid/hid-megaworld.c +++ b/drivers/hid/hid-megaworld.c @@ -57,7 +57,7 @@ static int mwctrl_init(struct hid_device *hid) return -ENODEV; } - mwctrl = kzalloc_obj(struct mwctrl_device, GFP_KERNEL); + mwctrl = kzalloc_obj(struct mwctrl_device); if (!mwctrl) return -ENOMEM; diff --git a/drivers/hid/hid-mf.c b/drivers/hid/hid-mf.c index 9a34645e92b6..6ff54a1ec697 100644 --- a/drivers/hid/hid-mf.c +++ b/drivers/hid/hid-mf.c @@ -88,7 +88,7 @@ static int mf_init(struct hid_device *hid) input_ptr = input_ptr->next; input = list_entry(input_ptr, struct hid_input, list); - mf = kzalloc_obj(struct mf_device, GFP_KERNEL); + mf = kzalloc_obj(struct mf_device); if (!mf) return -ENOMEM; diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index f48dc2f34f79..2b31756b549e 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -900,7 +900,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev->quirks |= HID_QUIRK_MULTI_INPUT | HID_QUIRK_NO_INIT_REPORTS; - nd = kmalloc_obj(struct ntrig_data, GFP_KERNEL); + nd = kmalloc_obj(struct ntrig_data); if (!nd) { hid_err(hdev, "cannot allocate N-Trig data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c index 99cae54dc769..2cc01e1bc1a8 100644 --- a/drivers/hid/hid-picolcd_core.c +++ b/drivers/hid/hid-picolcd_core.c @@ -78,7 +78,7 @@ struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev, return NULL; if (data->status & PICOLCD_FAILED) return NULL; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return NULL; @@ -528,7 +528,7 @@ static int picolcd_probe(struct hid_device *hdev, * Let's allocate the picolcd data structure, set some reasonable * defaults, and associate it with the device */ - data = kzalloc_obj(struct picolcd_data, GFP_KERNEL); + data = kzalloc_obj(struct picolcd_data); if (data == NULL) { hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); return -ENOMEM; diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index 967f93d9b46b..c6c2961dd574 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c @@ -140,7 +140,7 @@ static int plff_init(struct hid_device *hid) return -ENODEV; } - plff = kzalloc_obj(struct plff_device, GFP_KERNEL); + plff = kzalloc_obj(struct plff_device); if (!plff) return -ENOMEM; diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 2458c6b61358..3c0db8f93c82 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -1658,7 +1658,7 @@ static int dualsense_reset_leds(struct dualsense *ds) struct dualsense_output_report report; struct dualsense_output_report_bt *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return -ENOMEM; diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index e69b3cb682bc..fba01e4fcab1 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c @@ -797,7 +797,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) intf = to_usb_interface(hdev->dev.parent); ifnum = intf->cur_altsetting->desc.bInterfaceNumber; - pm = kzalloc_obj(*pm, GFP_KERNEL); + pm = kzalloc_obj(*pm); if (pm == NULL) { hid_err(hdev, "can't alloc descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index b6a9cfb71ec9..edc4339adb50 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -1164,11 +1164,11 @@ static int hid_modify_dquirk(const struct hid_device_id *id, int list_edited = 0; int ret = 0; - hdev = kzalloc_obj(*hdev, GFP_KERNEL); + hdev = kzalloc_obj(*hdev); if (!hdev) return -ENOMEM; - q_new = kmalloc_obj(struct quirks_list_struct, GFP_KERNEL); + q_new = kmalloc_obj(struct quirks_list_struct); if (!q_new) { ret = -ENOMEM; goto out; diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c index f7318bc9e1a5..0cf2f0008c7f 100644 --- a/drivers/hid/hid-roccat-arvo.c +++ b/drivers/hid/hid-roccat-arvo.c @@ -299,7 +299,7 @@ static int arvo_init_specials(struct hid_device *hdev) return 0; } - arvo = kzalloc_obj(*arvo, GFP_KERNEL); + arvo = kzalloc_obj(*arvo); if (!arvo) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c index 470c5e47d185..93a49c93ae8c 100644 --- a/drivers/hid/hid-roccat-isku.c +++ b/drivers/hid/hid-roccat-isku.c @@ -279,7 +279,7 @@ static int isku_init_specials(struct hid_device *hdev) return 0; } - isku = kzalloc_obj(*isku, GFP_KERNEL); + isku = kzalloc_obj(*isku); if (!isku) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 9ec3e015acb9..58654cf78f0d 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -704,7 +704,7 @@ static int kone_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - kone = kzalloc_obj(*kone, GFP_KERNEL); + kone = kzalloc_obj(*kone); if (!kone) return -ENOMEM; hid_set_drvdata(hdev, kone); diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 534d67a2617e..f80a60539a96 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -384,7 +384,7 @@ static int koneplus_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - koneplus = kzalloc_obj(*koneplus, GFP_KERNEL); + koneplus = kzalloc_obj(*koneplus); if (!koneplus) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-konepure.c b/drivers/hid/hid-roccat-konepure.c index 1994efc4f26b..7f753dfc2a10 100644 --- a/drivers/hid/hid-roccat-konepure.c +++ b/drivers/hid/hid-roccat-konepure.c @@ -88,7 +88,7 @@ static int konepure_init_specials(struct hid_device *hdev) return 0; } - konepure = kzalloc_obj(*konepure, GFP_KERNEL); + konepure = kzalloc_obj(*konepure); if (!konepure) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index 429d9b86b672..9ec42c218ef9 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c @@ -453,7 +453,7 @@ static int kovaplus_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - kovaplus = kzalloc_obj(*kovaplus, GFP_KERNEL); + kovaplus = kzalloc_obj(*kovaplus); if (!kovaplus) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-lua.c b/drivers/hid/hid-roccat-lua.c index a7ed873f8761..8e35e1a0660b 100644 --- a/drivers/hid/hid-roccat-lua.c +++ b/drivers/hid/hid-roccat-lua.c @@ -119,7 +119,7 @@ static int lua_init_specials(struct hid_device *hdev) struct lua_device *lua; int retval; - lua = kzalloc_obj(*lua, GFP_KERNEL); + lua = kzalloc_obj(*lua); if (!lua) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 35fffc55eb4f..0d515995bb9d 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c @@ -403,7 +403,7 @@ static int pyra_init_specials(struct hid_device *hdev) if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) { - pyra = kzalloc_obj(*pyra, GFP_KERNEL); + pyra = kzalloc_obj(*pyra); if (!pyra) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-ryos.c b/drivers/hid/hid-roccat-ryos.c index 0f4b52ef5404..db83f42457da 100644 --- a/drivers/hid/hid-roccat-ryos.c +++ b/drivers/hid/hid-roccat-ryos.c @@ -96,7 +96,7 @@ static int ryos_init_specials(struct hid_device *hdev) return 0; } - ryos = kzalloc_obj(*ryos, GFP_KERNEL); + ryos = kzalloc_obj(*ryos); if (!ryos) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat-savu.c b/drivers/hid/hid-roccat-savu.c index 90f9b0feb754..679136933560 100644 --- a/drivers/hid/hid-roccat-savu.c +++ b/drivers/hid/hid-roccat-savu.c @@ -68,7 +68,7 @@ static int savu_init_specials(struct hid_device *hdev) return 0; } - savu = kzalloc_obj(*savu, GFP_KERNEL); + savu = kzalloc_obj(*savu); if (!savu) { hid_err(hdev, "can't alloc device descriptor\n"); return -ENOMEM; diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index 5fe16ec1849a..fd0ea52f7cba 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c @@ -152,7 +152,7 @@ static int roccat_open(struct inode *inode, struct file *file) struct roccat_device *device; int error = 0; - reader = kzalloc_obj(struct roccat_reader, GFP_KERNEL); + reader = kzalloc_obj(struct roccat_reader); if (!reader) return -ENOMEM; @@ -301,7 +301,7 @@ int roccat_connect(const struct class *klass, struct hid_device *hid, int report struct roccat_device *device; int temp; - device = kzalloc_obj(struct roccat_device, GFP_KERNEL); + device = kzalloc_obj(struct roccat_device); if (!device) return -ENOMEM; diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c index 75d827c85e14..afffea894021 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -912,7 +912,7 @@ hid_sensor_custom_get_known(struct hid_sensor_hub_device *hsdev, hid_sensor_custom_known_table; struct hid_sensor_custom_properties *prop; - prop = kmalloc_obj(struct hid_sensor_custom_properties, GFP_KERNEL); + prop = kmalloc_obj(struct hid_sensor_custom_properties); if (!prop) return -ENOMEM; diff --git a/drivers/hid/hid-sjoy.c b/drivers/hid/hid-sjoy.c index e567c264aed3..bab93d71b760 100644 --- a/drivers/hid/hid-sjoy.c +++ b/drivers/hid/hid-sjoy.c @@ -83,7 +83,7 @@ static int sjoyff_init(struct hid_device *hid) return -ENODEV; } - sjoyff = kzalloc_obj(struct sjoyff_device, GFP_KERNEL); + sjoyff = kzalloc_obj(struct sjoyff_device); if (!sjoyff) return -ENOMEM; diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c index 15847eef4ac0..48a79c97b7d0 100644 --- a/drivers/hid/hid-thrustmaster.c +++ b/drivers/hid/hid-thrustmaster.c @@ -308,7 +308,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i } // Now we allocate the tm_wheel - tm_wheel = kzalloc_obj(struct tm_wheel, GFP_KERNEL); + tm_wheel = kzalloc_obj(struct tm_wheel); if (!tm_wheel) { ret = -ENOMEM; goto error1; @@ -328,7 +328,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i goto error3; } - tm_wheel->response = kzalloc_obj(struct tm_wheel_response, GFP_KERNEL); + tm_wheel->response = kzalloc_obj(struct tm_wheel_response); if (!tm_wheel->response) { ret = -ENOMEM; goto error4; diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index ddb2629ed9e1..423f395d01ac 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c @@ -132,7 +132,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) hidinput = list_entry(hid->inputs.next, struct hid_input, list); input_dev = hidinput->input; - tmff = kzalloc_obj(struct tmff_device, GFP_KERNEL); + tmff = kzalloc_obj(struct tmff_device); if (!tmff) return -ENOMEM; diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index 21b1d865bd0d..ed16f50f21ed 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -1358,13 +1358,13 @@ static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev, if (!uclogic_params_ugee_v2_has_battery(hdev)) return 0; - p->event_hooks = kzalloc_obj(*p->event_hooks, GFP_KERNEL); + p->event_hooks = kzalloc_obj(*p->event_hooks); if (!p->event_hooks) return -ENOMEM; INIT_LIST_HEAD(&p->event_hooks->list); - event_hook = kzalloc_obj(*event_hook, GFP_KERNEL); + event_hook = kzalloc_obj(*event_hook); if (!event_hook) return -ENOMEM; diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index c24ccfc7c05a..63c4fa8fbb9b 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -1737,7 +1737,7 @@ static struct wiimote_data *wiimote_create(struct hid_device *hdev) { struct wiimote_data *wdata; - wdata = kzalloc_obj(*wdata, GFP_KERNEL); + wdata = kzalloc_obj(*wdata); if (!wdata) return NULL; diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c index 07d7137acfd4..5f74917781f2 100644 --- a/drivers/hid/hid-wiimote-debug.c +++ b/drivers/hid/hid-wiimote-debug.c @@ -174,7 +174,7 @@ int wiidebug_init(struct wiimote_data *wdata) struct wiimote_debug *dbg; unsigned long flags; - dbg = kzalloc_obj(*dbg, GFP_KERNEL); + dbg = kzalloc_obj(*dbg); if (!dbg) return -ENOMEM; diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c index b9d94b3fe8b2..d8e023c8aa84 100644 --- a/drivers/hid/hid-zpff.c +++ b/drivers/hid/hid-zpff.c @@ -71,7 +71,7 @@ static int zpff_init(struct hid_device *hid) return -ENODEV; } - zpff = kzalloc_obj(struct zpff_device, GFP_KERNEL); + zpff = kzalloc_obj(struct zpff_device); if (!zpff) return -ENOMEM; diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index c3cd8521b695..9129fabed181 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -281,7 +281,7 @@ static int hidraw_open(struct inode *inode, struct file *file) unsigned long flags; int err = 0; - if (!(list = kzalloc_obj(struct hidraw_list, GFP_KERNEL))) { + if (!(list = kzalloc_obj(struct hidraw_list))) { err = -ENOMEM; goto out; } @@ -603,7 +603,7 @@ int hidraw_connect(struct hid_device *hid) /* we accept any HID device, all applications */ - dev = kzalloc_obj(struct hidraw, GFP_KERNEL); + dev = kzalloc_obj(struct hidraw); if (!dev) return -ENOMEM; diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c index 48f06c93a07b..6e255b1bc721 100644 --- a/drivers/hid/intel-ish-hid/ishtp-hid.c +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c @@ -214,7 +214,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev, if (IS_ERR(hid)) return PTR_ERR(hid); - hid_data = kzalloc_obj(*hid_data, GFP_KERNEL); + hid_data = kzalloc_obj(*hid_data); if (!hid_data) { rv = -ENOMEM; goto err_hid_data; diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index ff60be49f2b8..44db90ad5495 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -435,7 +435,7 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev, } spin_unlock_irqrestore(&dev->device_list_lock, flags); - device = kzalloc_obj(struct ishtp_cl_device, GFP_KERNEL); + device = kzalloc_obj(struct ishtp_cl_device); if (!device) return NULL; diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c index 717276f8460a..45ddc9a047bc 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c +++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c @@ -66,7 +66,7 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl) for (j = 0; j < cl->tx_ring_size; ++j) { struct ishtp_cl_tx_ring *tx_buf; - tx_buf = kzalloc_obj(struct ishtp_cl_tx_ring, GFP_KERNEL); + tx_buf = kzalloc_obj(struct ishtp_cl_tx_ring); if (!tx_buf) goto out; @@ -183,7 +183,7 @@ struct ishtp_cl_rb *ishtp_io_rb_init(struct ishtp_cl *cl) { struct ishtp_cl_rb *rb; - rb = kzalloc_obj(struct ishtp_cl_rb, GFP_KERNEL); + rb = kzalloc_obj(struct ishtp_cl_rb); if (!rb) return NULL; diff --git a/drivers/hid/intel-ish-hid/ishtp/client.c b/drivers/hid/intel-ish-hid/ishtp/client.c index f22b2f85e70f..4824f3302927 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client.c +++ b/drivers/hid/intel-ish-hid/ishtp/client.c @@ -105,7 +105,7 @@ struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device) { struct ishtp_cl *cl; - cl = kmalloc_obj(struct ishtp_cl, GFP_KERNEL); + cl = kmalloc_obj(struct ishtp_cl); if (!cl) return NULL; diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index a4f57143642c..524b53a3c87b 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -110,7 +110,7 @@ static int uhid_queue_event(struct uhid_device *uhid, __u32 event) unsigned long flags; struct uhid_event *ev; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -129,7 +129,7 @@ static int uhid_hid_start(struct hid_device *hid) struct uhid_event *ev; unsigned long flags; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -240,7 +240,7 @@ static int uhid_hid_get_report(struct hid_device *hid, unsigned char rnum, if (!READ_ONCE(uhid->running)) return -EIO; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -282,7 +282,7 @@ static int uhid_hid_set_report(struct hid_device *hid, unsigned char rnum, if (!READ_ONCE(uhid->running) || count > UHID_DATA_MAX) return -EIO; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -365,7 +365,7 @@ static int uhid_hid_output_raw(struct hid_device *hid, __u8 *buf, size_t count, if (count < 1 || count > UHID_DATA_MAX) return -EINVAL; - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) return -ENOMEM; @@ -433,7 +433,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len, */ struct uhid_create_req_compat *compat; - compat = kzalloc_obj(*compat, GFP_KERNEL); + compat = kzalloc_obj(*compat); if (!compat) return -ENOMEM; @@ -636,7 +636,7 @@ static int uhid_char_open(struct inode *inode, struct file *file) { struct uhid_device *uhid; - uhid = kzalloc_obj(*uhid, GFP_KERNEL); + uhid = kzalloc_obj(*uhid); if (!uhid) return -ENOMEM; diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 922022a9c253..ddd5d77fb5a5 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -858,7 +858,7 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) &usbhid->inbuf_dma); usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->outbuf_dma); - usbhid->cr = kmalloc_obj(*usbhid->cr, GFP_KERNEL); + usbhid->cr = kmalloc_obj(*usbhid->cr); usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->ctrlbuf_dma); if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || @@ -1430,7 +1430,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0) hid->uniq[0] = 0; - usbhid = kzalloc_obj(*usbhid, GFP_KERNEL); + usbhid = kzalloc_obj(*usbhid); if (usbhid == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 6719c976a3c3..fdcf03408f47 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -1528,7 +1528,7 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks) return -ENODEV; } - pidff = kzalloc_obj(*pidff, GFP_KERNEL); + pidff = kzalloc_obj(*pidff); if (!pidff) return -ENOMEM; diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 3a115ea49cd2..6378801b22c6 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -434,7 +434,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, struct hid_field *field; int i; - uref_multi = kmalloc_obj(struct hiddev_usage_ref_multi, GFP_KERNEL); + uref_multi = kmalloc_obj(struct hiddev_usage_ref_multi); if (!uref_multi) return -ENOMEM; uref = &uref_multi->uref; @@ -890,7 +890,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) return -EINVAL; } - if (!(hiddev = kzalloc_obj(struct hiddev, GFP_KERNEL))) + if (!(hiddev = kzalloc_obj(struct hiddev))) return -ENOMEM; init_waitqueue_head(&hiddev->wait); diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index d32a860c6979..6b33e6ad0846 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -241,7 +241,7 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) return -1; if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma))) return -1; - if (!(kbd->cr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL))) + if (!(kbd->cr = kmalloc_obj(struct usb_ctrlrequest))) return -1; if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma))) return -1; @@ -281,7 +281,7 @@ static int usb_kbd_probe(struct usb_interface *iface, pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - kbd = kzalloc_obj(struct usb_kbd, GFP_KERNEL); + kbd = kzalloc_obj(struct usb_kbd); input_dev = input_allocate_device(); if (!kbd || !input_dev) goto fail1; diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index da0d30de1d26..7cc4f9558e5f 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -125,7 +125,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - mouse = kzalloc_obj(struct usb_mouse, GFP_KERNEL); + mouse = kzalloc_obj(struct usb_mouse); input_dev = input_allocate_device(); if (!mouse || !input_dev) goto fail1; diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index e2e9f8afec11..0d1c6d90fe21 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -892,7 +892,7 @@ static int wacom_add_shared_data(struct hid_device *hdev) data = wacom_get_hdev_data(hdev); if (!data) { - data = kzalloc_obj(struct wacom_hdev_data, GFP_KERNEL); + data = kzalloc_obj(struct wacom_hdev_data); if (!data) { mutex_unlock(&wacom_udev_list_lock); return -ENOMEM; diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c index 5918401a4db9..d5aa87833768 100644 --- a/drivers/hsi/clients/cmt_speech.c +++ b/drivers/hsi/clients/cmt_speech.c @@ -273,7 +273,7 @@ static int cs_alloc_cmds(struct cs_hsi_iface *hi) msg = hsi_alloc_msg(1, GFP_KERNEL); if (!msg) goto out; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) { hsi_free_msg(msg); goto out; @@ -985,7 +985,7 @@ static int cs_hsi_start(struct cs_hsi_iface **hi, struct hsi_client *cl, unsigned long mmap_base, unsigned long mmap_size) { int err = 0; - struct cs_hsi_iface *hsi_if = kzalloc_obj(*hsi_if, GFP_KERNEL); + struct cs_hsi_iface *hsi_if = kzalloc_obj(*hsi_if); dev_dbg(&cl->device, "cs_hsi_start\n"); diff --git a/drivers/hsi/clients/hsi_char.c b/drivers/hsi/clients/hsi_char.c index 3258a7cf81ac..a31cc1466dd3 100644 --- a/drivers/hsi/clients/hsi_char.c +++ b/drivers/hsi/clients/hsi_char.c @@ -683,7 +683,7 @@ static int hsc_probe(struct device *dev) int ret; int i; - cl_data = kzalloc_obj(*cl_data, GFP_KERNEL); + cl_data = kzalloc_obj(*cl_data); if (!cl_data) return -ENOMEM; diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c index e7bb2803ace5..7c6ca8391a6b 100644 --- a/drivers/hsi/clients/ssi_protocol.c +++ b/drivers/hsi/clients/ssi_protocol.c @@ -259,7 +259,7 @@ static int ssip_alloc_cmds(struct ssi_protocol *ssi) msg = hsi_alloc_msg(1, GFP_KERNEL); if (!msg) goto out; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) { hsi_free_msg(msg); goto out; @@ -1077,7 +1077,7 @@ static int ssi_protocol_probe(struct device *dev) struct ssi_protocol *ssi; int err; - ssi = kzalloc_obj(*ssi, GFP_KERNEL); + ssi = kzalloc_obj(*ssi); if (!ssi) return -ENOMEM; diff --git a/drivers/hsi/hsi_boardinfo.c b/drivers/hsi/hsi_boardinfo.c index 109b0fb71a9a..8c79e4062798 100644 --- a/drivers/hsi/hsi_boardinfo.c +++ b/drivers/hsi/hsi_boardinfo.c @@ -36,7 +36,7 @@ int __init hsi_register_board_info(struct hsi_board_info const *info, { struct hsi_cl_info *cl_info; - cl_info = kzalloc_objs(*cl_info, len, GFP_KERNEL); + cl_info = kzalloc_objs(*cl_info, len); if (!cl_info) return -ENOMEM; diff --git a/drivers/hsi/hsi_core.c b/drivers/hsi/hsi_core.c index 84792da4caca..7cb2dcb30fdb 100644 --- a/drivers/hsi/hsi_core.c +++ b/drivers/hsi/hsi_core.c @@ -70,7 +70,7 @@ struct hsi_client *hsi_new_client(struct hsi_port *port, struct hsi_client *cl; size_t size; - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) goto err; @@ -203,7 +203,7 @@ static void hsi_add_client_from_dt(struct hsi_port *port, char name[32]; int length, cells, err, i, max_chan, mode; - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return; @@ -253,13 +253,13 @@ static void hsi_add_client_from_dt(struct hsi_port *port, cl->rx_cfg.num_channels = cells; cl->tx_cfg.num_channels = cells; - cl->rx_cfg.channels = kzalloc_objs(channel, cells, GFP_KERNEL); + cl->rx_cfg.channels = kzalloc_objs(channel, cells); if (!cl->rx_cfg.channels) { err = -ENOMEM; goto err; } - cl->tx_cfg.channels = kzalloc_objs(channel, cells, GFP_KERNEL); + cl->tx_cfg.channels = kzalloc_objs(channel, cells); if (!cl->tx_cfg.channels) { err = -ENOMEM; goto err2; diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 29ef1dc5c184..0d73daf745a7 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -134,7 +134,7 @@ kvp_register(int reg_value) struct hv_kvp_msg *kvp_msg; char *version; - kvp_msg = kzalloc_obj(*kvp_msg, GFP_KERNEL); + kvp_msg = kzalloc_obj(*kvp_msg); if (kvp_msg) { version = kvp_msg->body.kvp_register.version; @@ -385,7 +385,7 @@ kvp_send_key(struct work_struct *dummy) if (kvp_transaction.state != HVUTIL_HOSTMSG_RECEIVED) return; - message = kzalloc_obj(*message, GFP_KERNEL); + message = kzalloc_obj(*message); if (!message) return; diff --git a/drivers/hv/hv_proc.c b/drivers/hv/hv_proc.c index 216a0e8fd15b..3cb4b2a3035c 100644 --- a/drivers/hv/hv_proc.c +++ b/drivers/hv/hv_proc.c @@ -40,7 +40,7 @@ int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages) return -ENOMEM; pages = page_address(page); - counts = kzalloc_objs(int, HV_DEPOSIT_MAX, GFP_KERNEL); + counts = kzalloc_objs(int, HV_DEPOSIT_MAX); if (!counts) { free_page((unsigned long)pages); return -ENOMEM; diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index 50f9348789ee..506871aeacf0 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -184,7 +184,7 @@ static void vss_send_op(void) return; } - vss_msg = kzalloc_obj(*vss_msg, GFP_KERNEL); + vss_msg = kzalloc_obj(*vss_msg); if (!vss_msg) return; @@ -424,7 +424,7 @@ int hv_vss_pre_suspend(void) * write() will fail with EINVAL (see vss_on_msg()), and the daemon * will reset the device by closing and re-opening it. */ - vss_msg = kzalloc_obj(*vss_msg, GFP_KERNEL); + vss_msg = kzalloc_obj(*vss_msg); if (!vss_msg) return -ENOMEM; diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c index 43b7ffae8852..c3be5c570263 100644 --- a/drivers/hv/hv_utils_transport.c +++ b/drivers/hv/hv_utils_transport.c @@ -274,7 +274,7 @@ struct hvutil_transport *hvutil_transport_init(const char *name, { struct hvutil_transport *hvt; - hvt = kzalloc_obj(*hvt, GFP_KERNEL); + hvt = kzalloc_obj(*hvt); if (!hvt) return NULL; diff --git a/drivers/hv/mshv_debugfs.c b/drivers/hv/mshv_debugfs.c index 6a080d728836..418b6dc8f3c2 100644 --- a/drivers/hv/mshv_debugfs.c +++ b/drivers/hv/mshv_debugfs.c @@ -511,7 +511,7 @@ static int __init mshv_debugfs_parent_partition_create(void) if (err) goto remove_debugfs_partition; - parent_vp_stats = kzalloc_objs(*parent_vp_stats, nr_cpu_ids, GFP_KERNEL); + parent_vp_stats = kzalloc_objs(*parent_vp_stats, nr_cpu_ids); if (!parent_vp_stats) { err = -ENOMEM; goto remove_debugfs_partition; diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c index 5b3c09f08a1e..d8471546e6a0 100644 --- a/drivers/hv/mshv_eventfd.c +++ b/drivers/hv/mshv_eventfd.c @@ -394,7 +394,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, CLASS(fd, f)(args->fd); - irqfd = kzalloc_obj(*irqfd, GFP_KERNEL); + irqfd = kzalloc_obj(*irqfd); if (!irqfd) return -ENOMEM; @@ -707,7 +707,7 @@ static int mshv_assign_ioeventfd(struct mshv_partition *pt, if (IS_ERR(eventfd)) return PTR_ERR(eventfd); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { ret = -ENOMEM; goto fail; diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index 4715d23d22f2..82ff823ef0ca 100644 --- a/drivers/hv/mshv_root_main.c +++ b/drivers/hv/mshv_root_main.c @@ -713,7 +713,7 @@ mshv_vp_ioctl_get_set_state_pfn(struct mshv_vp *vp, return -EOVERFLOW; /* Pin user pages so hypervisor can copy directly to them */ - pages = kzalloc_objs(struct page *, page_count, GFP_KERNEL); + pages = kzalloc_objs(struct page *, page_count); if (!pages) return -ENOMEM; @@ -1072,7 +1072,7 @@ mshv_partition_ioctl_create_vp(struct mshv_partition *partition, if (ret) goto unmap_ghcb_page; - vp = kzalloc_obj(*vp, GFP_KERNEL); + vp = kzalloc_obj(*vp); if (!vp) goto unmap_stats_pages; @@ -1977,7 +1977,7 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev) if (ret) return ret; - partition = kzalloc_obj(*partition, GFP_KERNEL); + partition = kzalloc_obj(*partition); if (!partition) return -ENOMEM; diff --git a/drivers/hv/mshv_synic.c b/drivers/hv/mshv_synic.c index 49e3a59ffb90..216065e21d28 100644 --- a/drivers/hv/mshv_synic.c +++ b/drivers/hv/mshv_synic.c @@ -605,7 +605,7 @@ mshv_register_doorbell(u64 partition_id, doorbell_cb_t doorbell_cb, void *data, union hv_port_id port_id = { 0 }; int ret; - port_table_info = kmalloc_obj(*port_table_info, GFP_KERNEL); + port_table_info = kmalloc_obj(*port_table_info); if (!port_table_info) return -ENOMEM; diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c index 916021a175f3..5856975f32e1 100644 --- a/drivers/hv/mshv_vtl_main.c +++ b/drivers/hv/mshv_vtl_main.c @@ -117,7 +117,7 @@ mshv_ioctl_create_vtl(void __user *user_arg, struct device *module_dev) struct file *file; int fd; - vtl = kzalloc_obj(*vtl, GFP_KERNEL); + vtl = kzalloc_obj(*vtl); if (!vtl) return -ENOMEM; @@ -393,7 +393,7 @@ static int mshv_vtl_ioctl_add_vtl0_mem(struct mshv_vtl *vtl, void __user *arg) return -EFAULT; } - pgmap = kzalloc_obj(*pgmap, GFP_KERNEL); + pgmap = kzalloc_obj(*pgmap); if (!pgmap) return -ENOMEM; @@ -1344,7 +1344,7 @@ static int __init mshv_vtl_init(void) /* * "mshv vtl mem dev" device is later used to setup VTL0 memory. */ - mem_dev = kzalloc_obj(*mem_dev, GFP_KERNEL); + mem_dev = kzalloc_obj(*mem_dev); if (!mem_dev) { ret = -ENOMEM; goto free_low; diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 3119f68fd27b..bc4fc1951ae1 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -756,7 +756,7 @@ static int vmbus_add_dynid(struct hv_driver *drv, guid_t *guid) { struct vmbus_dynid *dynid; - dynid = kzalloc_obj(*dynid, GFP_KERNEL); + dynid = kzalloc_obj(*dynid); if (!dynid) return -ENOMEM; @@ -2156,7 +2156,7 @@ struct hv_device *vmbus_device_create(const guid_t *type, { struct hv_device *child_device_obj; - child_device_obj = kzalloc_obj(struct hv_device, GFP_KERNEL); + child_device_obj = kzalloc_obj(struct hv_device); if (!child_device_obj) { pr_err("Unable to allocate device object for child device\n"); return NULL; @@ -2672,7 +2672,7 @@ static int vmbus_device_add(struct platform_device *pdev) for_each_of_range(&parser, &range) { struct resource *res; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) { vmbus_mmio_remove(); return -ENOMEM; diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index 1fa3657f4630..2da06524bdb3 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -892,7 +892,7 @@ static int acpi_power_meter_add(struct acpi_device *device) if (!device) return -EINVAL; - resource = kzalloc_obj(*resource, GFP_KERNEL); + resource = kzalloc_obj(*resource); if (!resource) return -ENOMEM; diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 0dbad1d3808c..24f3e86d0ebf 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -586,7 +586,7 @@ static int applesmc_init_smcreg_try(void) s->key_count = count; if (!s->cache) - s->cache = kzalloc_objs(*s->cache, s->key_count, GFP_KERNEL); + s->cache = kzalloc_objs(*s->cache, s->key_count); if (!s->cache) return -ENOMEM; @@ -1141,7 +1141,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num) int ret, i; for (grp = groups; grp->format; grp++) { - grp->nodes = kzalloc_objs(*node, num + 1, GFP_KERNEL); + grp->nodes = kzalloc_objs(*node, num + 1); if (!grp->nodes) { ret = -ENOMEM; goto out; diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index eb00a9f08955..ad9d5c5702b1 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -498,7 +498,7 @@ init_temp_data(struct platform_data *pdata, unsigned int cpu, int pkg_flag) return NULL; } - tdata = kzalloc_obj(struct temp_data, GFP_KERNEL); + tdata = kzalloc_obj(struct temp_data); if (!tdata) return NULL; @@ -625,7 +625,7 @@ static int coretemp_device_add(int zoneid) int err; /* Initialize the per-zone data structures */ - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return -ENOMEM; diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index f2fa7223be7a..002e0660a0b8 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -556,7 +556,7 @@ static int drivetemp_add(struct device *dev) struct drivetemp_data *st; int err; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) return -ENOMEM; diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index 740d46634b4c..1211fa2259e5 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c @@ -1088,7 +1088,7 @@ static int fschmd_probe(struct i2c_client *client) int i, err; enum chips kind = (uintptr_t)i2c_get_match_data(client); - data = kzalloc_obj(struct fschmd_data, GFP_KERNEL); + data = kzalloc_obj(struct fschmd_data); if (!data) return -ENOMEM; diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index a1173ea0b029..9695dca62a7e 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -533,7 +533,7 @@ static struct attribute *hwmon_genattr(const void *drvdata, if ((mode & 0222) && !ops->write) return ERR_PTR(-EINVAL); - hattr = kzalloc_obj(*hattr, GFP_KERNEL); + hattr = kzalloc_obj(*hattr); if (!hattr) return ERR_PTR(-ENOMEM); @@ -879,7 +879,7 @@ __hwmon_create_attrs(const void *drvdata, const struct hwmon_chip_info *chip) if (nattrs == 0) return ERR_PTR(-EINVAL); - attrs = kzalloc_objs(*attrs, nattrs + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, nattrs + 1); if (!attrs) return ERR_PTR(-ENOMEM); @@ -917,7 +917,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, if (id < 0) return ERR_PTR(id); - hwdev = kzalloc_obj(*hwdev, GFP_KERNEL); + hwdev = kzalloc_obj(*hwdev); if (hwdev == NULL) { err = -ENOMEM; goto ida_remove; @@ -933,7 +933,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, for (i = 0; groups[i]; i++) ngroups++; - hwdev->groups = kzalloc_objs(*groups, ngroups, GFP_KERNEL); + hwdev->groups = kzalloc_objs(*groups, ngroups); if (!hwdev->groups) { err = -ENOMEM; goto free_hwmon; diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index f3835606179c..de486e69e6b8 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c @@ -494,7 +494,7 @@ static int i5k_amb_probe(struct platform_device *pdev) struct resource *reso; int i, res; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index e62e7bab0865..0a9c3a29e6f2 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c @@ -517,7 +517,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle) int i; int res = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return res; mutex_init(&data->lock); @@ -657,7 +657,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe, int i; int res = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return res; mutex_init(&data->lock); diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index 331aa8159ab8..949bc2403b2d 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c @@ -438,7 +438,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) struct ibmpex_bmc_data *data; int err; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index 1b0442fe2bf3..a385aae3bb0f 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -330,7 +330,7 @@ struct regmap *devm_regmap_init_sch56xx(struct device *dev, struct mutex *lock, if (config->reg_bits != 16 && config->val_bits != 8) return ERR_PTR(-EOPNOTSUPP); - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c index 72a4f514a78c..a5c03ed59c1f 100644 --- a/drivers/hwmon/via-cputemp.c +++ b/drivers/hwmon/via-cputemp.c @@ -222,7 +222,7 @@ static int via_cputemp_online(unsigned int cpu) goto exit; } - pdev_entry = kzalloc_obj(struct pdev_entry, GFP_KERNEL); + pdev_entry = kzalloc_obj(struct pdev_entry); if (!pdev_entry) { err = -ENOMEM; goto exit_device_put; diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 8081ef3b1592..24772cfbecb3 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c @@ -1650,7 +1650,7 @@ static int w83793_probe(struct i2c_client *client) int files_pwm = ARRAY_SIZE(w83793_left_pwm) / 5; int files_temp = ARRAY_SIZE(w83793_temp) / 6; - data = kzalloc_obj(struct w83793_data, GFP_KERNEL); + data = kzalloc_obj(struct w83793_data); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 4123d4e16bbe..dfd035852b12 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -337,7 +337,7 @@ static int catu_alloc_etr_buf(struct tmc_drvdata *tmc_drvdata, csdev = tmc_etr_get_catu_device(tmc_drvdata); if (!csdev) return -ENODEV; - catu_buf = kzalloc_obj(*catu_buf, GFP_KERNEL); + catu_buf = kzalloc_obj(*catu_buf); if (!catu_buf) return -ENOMEM; diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index b03d228f6bf7..80e26396ad0a 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -821,7 +821,7 @@ out: if (ret) return ret; - node = kzalloc_obj(struct coresight_node, GFP_KERNEL); + node = kzalloc_obj(struct coresight_node); if (!node) return -ENOMEM; @@ -840,7 +840,7 @@ struct coresight_path *coresight_build_path(struct coresight_device *source, if (!sink) return ERR_PTR(-EINVAL); - path = kzalloc_obj(struct coresight_path, GFP_KERNEL); + path = kzalloc_obj(struct coresight_path); if (!path) return ERR_PTR(-ENOMEM); @@ -1327,7 +1327,7 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) struct coresight_device *csdev; bool registered = false; - csdev = kzalloc_obj(*csdev, GFP_KERNEL); + csdev = kzalloc_obj(*csdev); if (!csdev) { ret = -ENOMEM; goto err_out; diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index ecb0bdc2c3e6..4eff96f48594 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -325,7 +325,7 @@ static int cti_plat_process_filter_sigs(struct cti_drvdata *drvdata, if (nr_filter_sigs > drvdata->config.nr_trig_max) return -EINVAL; - tg = kzalloc_obj(*tg, GFP_KERNEL); + tg = kzalloc_obj(*tg); if (!tg) return -ENOMEM; diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 01d4c422fed9..72017dcc3b7f 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -260,7 +260,7 @@ static void *alloc_event_data(int cpu) struct etm_event_data *event_data; /* First get memory for the session's data */ - event_data = kzalloc_obj(struct etm_event_data, GFP_KERNEL); + event_data = kzalloc_obj(struct etm_event_data); if (!event_data) return NULL; diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c b/drivers/hwtracing/coresight/coresight-syscfg.c index de2f6947f521..d7f5037953d6 100644 --- a/drivers/hwtracing/coresight/coresight-syscfg.c +++ b/drivers/hwtracing/coresight/coresight-syscfg.c @@ -756,7 +756,7 @@ static int cscfg_list_add_csdev(struct coresight_device *csdev, struct cscfg_registered_csdev *csdev_item; /* allocate the list entry structure */ - csdev_item = kzalloc_obj(struct cscfg_registered_csdev, GFP_KERNEL); + csdev_item = kzalloc_obj(struct cscfg_registered_csdev); if (!csdev_item) return -ENOMEM; @@ -1190,7 +1190,7 @@ static int cscfg_create_device(void) goto create_dev_exit_unlock; } - cscfg_mgr = kzalloc_obj(struct cscfg_manager, GFP_KERNEL); + cscfg_mgr = kzalloc_obj(struct cscfg_manager); if (!cscfg_mgr) goto create_dev_exit_unlock; diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 7aca22d6e335..5ddd979a1b10 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -208,7 +208,7 @@ static int tmc_pages_alloc(struct tmc_pages *tmc_pages, GFP_KERNEL); if (!tmc_pages->daddrs) return -ENOMEM; - tmc_pages->pages = kzalloc_objs(*tmc_pages->pages, nr_pages, GFP_KERNEL); + tmc_pages->pages = kzalloc_objs(*tmc_pages->pages, nr_pages); if (!tmc_pages->pages) { kfree(tmc_pages->daddrs); tmc_pages->daddrs = NULL; @@ -331,7 +331,7 @@ struct tmc_sg_table *tmc_alloc_sg_table(struct device *dev, long rc; struct tmc_sg_table *sg_table; - sg_table = kzalloc_obj(*sg_table, GFP_KERNEL); + sg_table = kzalloc_obj(*sg_table); if (!sg_table) return ERR_PTR(-ENOMEM); sg_table->data_pages.nr_pages = nr_dpages; @@ -574,7 +574,7 @@ tmc_init_etr_sg_table(struct device *dev, int node, struct tmc_sg_table *sg_table; struct etr_sg_table *etr_table; - etr_table = kzalloc_obj(*etr_table, GFP_KERNEL); + etr_table = kzalloc_obj(*etr_table); if (!etr_table) return ERR_PTR(-ENOMEM); nr_entries = tmc_etr_sg_table_entries(nr_dpages); @@ -611,7 +611,7 @@ static int tmc_etr_alloc_flat_buf(struct tmc_drvdata *drvdata, if (pages) return -EINVAL; - flat_buf = kzalloc_obj(*flat_buf, GFP_KERNEL); + flat_buf = kzalloc_obj(*flat_buf); if (!flat_buf) return -ENOMEM; @@ -709,7 +709,7 @@ static int tmc_etr_alloc_resrv_buf(struct tmc_drvdata *drvdata, if (pages) return -EINVAL; - resrv_buf = kzalloc_obj(*resrv_buf, GFP_KERNEL); + resrv_buf = kzalloc_obj(*resrv_buf); if (!resrv_buf) return -ENOMEM; @@ -941,7 +941,7 @@ static struct etr_buf *tmc_alloc_etr_buf(struct tmc_drvdata *drvdata, struct device *dev = &drvdata->csdev->dev; get_etr_buf_hw(dev, &buf_hw); - etr_buf = kzalloc_obj(*etr_buf, GFP_KERNEL); + etr_buf = kzalloc_obj(*etr_buf); if (!etr_buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 257dd5689c81..1511f8eb95af 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -751,7 +751,7 @@ static void *arm_trbe_alloc_buffer(struct coresight_device *csdev, if (!buf) return NULL; - pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages); if (!pglist) { kfree(buf); return NULL; diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index 641efa0016e0..3924e63e2eee 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -891,7 +891,7 @@ intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata, int err, r, nr_mmios = 0; struct intel_th *th; - th = kzalloc_obj(*th, GFP_KERNEL); + th = kzalloc_obj(*th); if (!th) return ERR_PTR(-ENOMEM); diff --git a/drivers/hwtracing/intel_th/msu-sink.c b/drivers/hwtracing/intel_th/msu-sink.c index d3373be9109b..b809a7f805a9 100644 --- a/drivers/hwtracing/intel_th/msu-sink.c +++ b/drivers/hwtracing/intel_th/msu-sink.c @@ -23,7 +23,7 @@ static void *msu_sink_assign(struct device *dev, int *mode) { struct msu_sink_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c index 33e16c40f0ec..a82cf74f39ad 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c @@ -236,7 +236,7 @@ int intel_th_msu_buffer_register(const struct msu_buffer *mbuf, struct msu_buffer_entry *mbe; int ret = 0; - mbe = kzalloc_obj(*mbe, GFP_KERNEL); + mbe = kzalloc_obj(*mbe); if (!mbe) return -ENOMEM; @@ -450,7 +450,7 @@ static struct msc_iter *msc_iter_install(struct msc *msc) { struct msc_iter *iter; - iter = kzalloc_obj(*iter, GFP_KERNEL); + iter = kzalloc_obj(*iter); if (!iter) return ERR_PTR(-ENOMEM); @@ -1105,7 +1105,7 @@ static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks) if (!nr_blocks) return 0; - win = kzalloc_obj(*win, GFP_KERNEL); + win = kzalloc_obj(*win); if (!win) return -ENOMEM; diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 3d7a80dacce5..94c371c49135 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -384,7 +384,7 @@ hisi_ptt_alloc_add_filter(struct hisi_ptt *hisi_ptt, u16 devid, bool is_port) return NULL; } - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) { pci_err(hisi_ptt->pdev, "failed to add filter for %s\n", filter_name); @@ -1043,11 +1043,11 @@ static void *hisi_ptt_pmu_setup_aux(struct perf_event *event, void **pages, if (nr_pages < HISI_PTT_TRACE_TOTAL_BUF_SIZE / PAGE_SIZE) return NULL; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return NULL; - pagelist = kzalloc_objs(*pagelist, nr_pages, GFP_KERNEL); + pagelist = kzalloc_objs(*pagelist, nr_pages); if (!pagelist) goto err; diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index b3df3104aa3d..37584e786bb5 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -406,7 +406,7 @@ int stm_register_protocol(const struct stm_protocol_driver *pdrv) goto unlock; } - pe = kzalloc_obj(*pe, GFP_KERNEL); + pe = kzalloc_obj(*pe); if (!pe) goto unlock; @@ -493,7 +493,7 @@ static int stm_char_open(struct inode *inode, struct file *file) if (!dev) return -ENODEV; - stmf = kzalloc_obj(*stmf, GFP_KERNEL); + stmf = kzalloc_obj(*stmf); if (!stmf) goto err_put_device; @@ -1229,7 +1229,7 @@ int stm_source_register_device(struct device *parent, if (!stm_core_up) return -EPROBE_DEFER; - src = kzalloc_obj(*src, GFP_KERNEL); + src = kzalloc_obj(*src); if (!src) return -ENOMEM; diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index f0f8876008ed..fabaf4b14889 100644 --- a/drivers/hwtracing/stm/policy.c +++ b/drivers/hwtracing/stm/policy.c @@ -437,7 +437,7 @@ stp_policy_make(struct config_group *group, const char *name) goto unlock_policy; } - stm->policy = kzalloc_obj(*stm->policy, GFP_KERNEL); + stm->policy = kzalloc_obj(*stm->policy); if (!stm->policy) { ret = ERR_PTR(-ENOMEM); goto unlock_policy; diff --git a/drivers/i2c/busses/i2c-cp2615.c b/drivers/i2c/busses/i2c-cp2615.c index b9a86eb10cc2..e2d7cd2390fc 100644 --- a/drivers/i2c/busses/i2c-cp2615.c +++ b/drivers/i2c/busses/i2c-cp2615.c @@ -124,7 +124,7 @@ static int cp2615_check_status(enum cp2615_i2c_status status) static int cp2615_i2c_send(struct usb_interface *usbif, struct cp2615_i2c_transfer *i2c_w) { - struct cp2615_iop_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); + struct cp2615_iop_msg *msg = kzalloc_obj(*msg); struct usb_device *usbdev = interface_to_usbdev(usbif); int res = cp2615_init_i2c_msg(msg, i2c_w); @@ -143,7 +143,7 @@ cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf) struct cp2615_i2c_transfer_result *i2c_r; int res; - msg = kzalloc_obj(*msg, GFP_KERNEL); + msg = kzalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -171,7 +171,7 @@ cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf) /* Checks if the IOP is functional by querying the part's ID */ static int cp2615_check_iop(struct usb_interface *usbif) { - struct cp2615_iop_msg *msg = kzalloc_obj(*msg, GFP_KERNEL); + struct cp2615_iop_msg *msg = kzalloc_obj(*msg); struct cp2615_iop_accessory_info *info = (struct cp2615_iop_accessory_info *)&msg->data; struct usb_device *usbdev = interface_to_usbdev(usbif); int res = cp2615_init_iop_msg(msg, iop_GetAccessoryInfo, NULL, 0); diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index dbe90974167a..2cb6a233d313 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c @@ -636,7 +636,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev) struct cpm_i2c *cpm; const u32 *data; - cpm = kzalloc_obj(struct cpm_i2c, GFP_KERNEL); + cpm = kzalloc_obj(struct cpm_i2c); if (!cpm) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c index c4d3b0ee6f4d..186f9b9f48b4 100644 --- a/drivers/i2c/busses/i2c-designware-amdpsp.c +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c @@ -93,7 +93,7 @@ static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type) int status, ret; /* Allocate command-response buffer */ - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c index ba0a2e03f490..077b093ba834 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c @@ -445,7 +445,7 @@ static int diolan_u2c_probe(struct usb_interface *interface, return -ENODEV; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { ret = -ENOMEM; goto error; diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 65ac713e8a84..f83238868802 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c @@ -720,7 +720,7 @@ static int pch_i2c_probe(struct pci_dev *pdev, pch_pci_dbg(pdev, "Entered.\n"); - adap_info = kzalloc_obj(struct adapter_info, GFP_KERNEL); + adap_info = kzalloc_obj(struct adapter_info); if (adap_info == NULL) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c index 77b4129e1ee6..82c87e04ac6f 100644 --- a/drivers/i2c/busses/i2c-fsi.c +++ b/drivers/i2c/busses/i2c-fsi.c @@ -707,7 +707,7 @@ static int fsi_i2c_probe(struct fsi_device *fsi_dev) if (!of_device_is_available(np)) continue; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { of_node_put(np); break; diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index ddea5847f0c5..a53b4bb7c3c0 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c @@ -365,7 +365,7 @@ static int highlander_i2c_probe(struct platform_device *pdev) return -ENODEV; } - dev = kzalloc_obj(struct highlander_i2c_dev, GFP_KERNEL); + dev = kzalloc_obj(struct highlander_i2c_dev); if (unlikely(!dev)) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index ca2534bba932..7c70e8bda24e 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -687,7 +687,7 @@ static int iic_probe(struct platform_device *ofdev) const u32 *freq; int ret; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index f5c1d2191c98..4c67c5d18f34 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c @@ -415,13 +415,13 @@ iop3xx_i2c_probe(struct platform_device *pdev) struct i2c_adapter *new_adapter; struct i2c_algo_iop3xx_data *adapter_data; - new_adapter = kzalloc_obj(struct i2c_adapter, GFP_KERNEL); + new_adapter = kzalloc_obj(struct i2c_adapter); if (!new_adapter) { ret = -ENOMEM; goto out; } - adapter_data = kzalloc_obj(struct i2c_algo_iop3xx_data, GFP_KERNEL); + adapter_data = kzalloc_obj(struct i2c_algo_iop3xx_data); if (!adapter_data) { ret = -ENOMEM; goto free_adapter; diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index b673206313fc..7064fab81eac 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -359,7 +359,7 @@ static int nforce2_probe(struct pci_dev *dev, const struct pci_device_id *id) int res1, res2; /* we support 2 SMBus adapters */ - smbuses = kzalloc_objs(struct nforce2_smbus, 2, GFP_KERNEL); + smbuses = kzalloc_objs(struct nforce2_smbus, 2); if (!smbuses) return -ENOMEM; pci_set_drvdata(dev, smbuses); diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 5ae1c7f8b9b5..e438ec8175d9 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c @@ -288,7 +288,7 @@ static void i2c_parport_attach(struct parport *port) return; } - adapter = kzalloc_obj(struct i2c_par, GFP_KERNEL); + adapter = kzalloc_obj(struct i2c_par); if (!adapter) return; memset(&i2c_parport_cb, 0, sizeof(i2c_parport_cb)); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index e159a9aed41f..7b6a4e201be4 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -919,7 +919,7 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba, struct i2c_piix4_adapdata *adapdata; int retval; - adap = kzalloc_obj(*adap, GFP_KERNEL); + adap = kzalloc_obj(*adap); if (adap == NULL) { release_region(smba, SMBIOSIZE); return -ENOMEM; @@ -930,7 +930,7 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba, adap->algo = sb800_main ? &piix4_smbus_algorithm_sb800 : &smbus_algorithm; - adapdata = kzalloc_obj(*adapdata, GFP_KERNEL); + adapdata = kzalloc_obj(*adapdata); if (adapdata == NULL) { kfree(adap); release_region(smba, SMBIOSIZE); diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index c80a054fc4e9..dbd542300f80 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c @@ -112,7 +112,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev, dev_err(&dev->dev, "Missing device tree node.\n"); return -EINVAL; } - sds = kzalloc_obj(*sds, GFP_KERNEL); + sds = kzalloc_obj(*sds); if (!sds) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c index c10ad0677949..324a63efa1ab 100644 --- a/drivers/i2c/busses/i2c-scmi.c +++ b/drivers/i2c/busses/i2c-scmi.c @@ -359,7 +359,7 @@ static int smbus_cmi_probe(struct platform_device *device) struct acpi_smbus_cmi *smbus_cmi; int ret; - smbus_cmi = kzalloc_obj(struct acpi_smbus_cmi, GFP_KERNEL); + smbus_cmi = kzalloc_obj(struct acpi_smbus_cmi); if (!smbus_cmi) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index dcdf56398f70..ba0cbb36ab15 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c @@ -443,7 +443,7 @@ static int sh7760_i2c_probe(struct platform_device *pdev) goto out0; } - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { ret = -ENOMEM; goto out0; diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c index 9572357cc177..b4ca256a0aa9 100644 --- a/drivers/i2c/busses/i2c-simtec.c +++ b/drivers/i2c/busses/i2c-simtec.c @@ -64,7 +64,7 @@ static int simtec_i2c_probe(struct platform_device *dev) int size; int ret; - pd = kzalloc_obj(struct simtec_i2c_data, GFP_KERNEL); + pd = kzalloc_obj(struct simtec_i2c_data); if (pd == NULL) return -ENOMEM; diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index e2388862f29e..70cb5822bf17 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -544,7 +544,7 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev, if (((sdadel >= sdadel_min) && (sdadel <= sdadel_max)) && (p != p_prev)) { - v = kmalloc_obj(*v, GFP_KERNEL); + v = kmalloc_obj(*v); if (!v) { ret = -ENOMEM; goto exit; diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c index e8a89b7d2174..debaf5189a83 100644 --- a/drivers/i2c/busses/i2c-taos-evm.c +++ b/drivers/i2c/busses/i2c-taos-evm.c @@ -203,7 +203,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv) char *name; int err; - taos = kzalloc_obj(struct taos_data, GFP_KERNEL); + taos = kzalloc_obj(struct taos_data); if (!taos) { err = -ENOMEM; goto exit; diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index ab021042901b..9ef495f88ef2 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c @@ -55,7 +55,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) struct i2c_msg *pmsg; int i, ret; - pstatus = kmalloc_obj(*pstatus, GFP_KERNEL); + pstatus = kmalloc_obj(*pstatus); if (!pstatus) return -ENOMEM; @@ -123,7 +123,7 @@ static u32 usb_func(struct i2c_adapter *adapter) __le32 *pfunc; u32 ret; - pfunc = kmalloc_obj(*pfunc, GFP_KERNEL); + pfunc = kmalloc_obj(*pfunc); /* get functionality from adapter */ if (!pfunc || usb_read(adapter, CMD_GET_FUNC, 0, 0, pfunc, @@ -233,7 +233,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface, dev_dbg(&interface->dev, "probing usb device\n"); /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto error; diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c index 01ef98e90243..7b0b0bff8000 100644 --- a/drivers/i2c/busses/i2c-virtio.c +++ b/drivers/i2c/busses/i2c-virtio.c @@ -139,7 +139,7 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, struct virtio_i2c_req *reqs; int count; - reqs = kzalloc_objs(*reqs, num, GFP_KERNEL); + reqs = kzalloc_objs(*reqs, num); if (!reqs) return -ENOMEM; diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 1c76aef0a423..0cd0a18a7082 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c @@ -418,7 +418,7 @@ static struct scx200_acb_iface *scx200_create_iface(const char *text, struct scx200_acb_iface *iface; struct i2c_adapter *adapter; - iface = kzalloc_obj(*iface, GFP_KERNEL); + iface = kzalloc_obj(*iface); if (!iface) return NULL; diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c index 8e3fe365caaf..ea6bfa67b518 100644 --- a/drivers/i2c/i2c-atr.c +++ b/drivers/i2c/i2c-atr.c @@ -137,7 +137,7 @@ static struct i2c_atr_alias_pool *i2c_atr_alloc_alias_pool(size_t num_aliases, b struct i2c_atr_alias_pool *alias_pool; int ret; - alias_pool = kzalloc_obj(*alias_pool, GFP_KERNEL); + alias_pool = kzalloc_obj(*alias_pool); if (!alias_pool) return ERR_PTR(-ENOMEM); @@ -183,7 +183,7 @@ static struct i2c_atr_alias_pair *i2c_atr_create_c2a(struct i2c_atr_chan *chan, lockdep_assert_held(&chan->alias_pairs_lock); - c2a = kzalloc_obj(*c2a, GFP_KERNEL); + c2a = kzalloc_obj(*c2a); if (!c2a) return NULL; @@ -800,7 +800,7 @@ int i2c_atr_add_adapter(struct i2c_atr *atr, struct i2c_atr_adap_desc *desc) return -EEXIST; } - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return -ENOMEM; diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c index 31fcc051bf20..735fd13fefc4 100644 --- a/drivers/i2c/i2c-boardinfo.c +++ b/drivers/i2c/i2c-boardinfo.c @@ -61,7 +61,7 @@ int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsig for (status = 0; len; len--, info++) { struct i2c_devinfo *devinfo; - devinfo = kzalloc_obj(*devinfo, GFP_KERNEL); + devinfo = kzalloc_obj(*devinfo); if (!devinfo) { pr_debug("i2c-core: can't register boardinfo!\n"); status = -ENOMEM; diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 5b16d76a5bc2..2cbd31f77667 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -683,7 +683,7 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command, if (ACPI_FAILURE(ret)) return ret; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) { ret = AE_NO_MEMORY; goto err; @@ -793,7 +793,7 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) if (!handle) return -ENODEV; - data = kzalloc_obj(struct i2c_acpi_handler_data, GFP_KERNEL); + data = kzalloc_obj(struct i2c_acpi_handler_data); if (!data) return -ENOMEM; diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 91b388070525..9c46147e3506 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -964,7 +964,7 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf bool need_put = false; int status; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return ERR_PTR(-ENOMEM); @@ -2529,7 +2529,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) return 0; /* Set up a temporary client to help detect callback */ - temp_client = kzalloc_obj(*temp_client, GFP_KERNEL); + temp_client = kzalloc_obj(*temp_client); if (!temp_client) return -ENOMEM; diff --git a/drivers/i2c/i2c-core-of-prober.c b/drivers/i2c/i2c-core-of-prober.c index 8c820d70846a..6a82b03809d4 100644 --- a/drivers/i2c/i2c-core-of-prober.c +++ b/drivers/i2c/i2c-core-of-prober.c @@ -63,7 +63,7 @@ static int i2c_of_probe_enable_node(struct device *dev, struct device_node *node dev_dbg(dev, "Enabling %pOF\n", node); - struct of_changeset *ocs __free(kfree) = kzalloc_obj(*ocs, GFP_KERNEL); + struct of_changeset *ocs __free(kfree) = kzalloc_obj(*ocs); if (!ocs) return -ENOMEM; diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index e4ac9f2df8d5..e0aec8ee2dee 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -74,7 +74,7 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap) return ERR_PTR(-ENODEV); } - i2c_dev = kzalloc_obj(*i2c_dev, GFP_KERNEL); + i2c_dev = kzalloc_obj(*i2c_dev); if (!i2c_dev) return ERR_PTR(-ENOMEM); i2c_dev->adap = adap; @@ -612,7 +612,7 @@ static int i2cdev_open(struct inode *inode, struct file *file) * or I2C core code!! It just holds private copies of addressing * information and maybe a PEC flag. */ - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) { i2c_put_adapter(adap); return -ENOMEM; diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 2e7b4073a4df..681a201c239b 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -277,7 +277,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, return -EINVAL; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 14e45590e97e..bc7bd55e6370 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -319,7 +319,7 @@ struct i2c_client *i2c_new_slave_host_notify_device(struct i2c_adapter *adapter) struct i2c_client *client; int ret; - status = kzalloc_obj(struct i2c_slave_host_notify_status, GFP_KERNEL); + status = kzalloc_obj(struct i2c_slave_host_notify_status); if (!status) return ERR_PTR(-ENOMEM); diff --git a/drivers/i2c/i2c-stub.c b/drivers/i2c/i2c-stub.c index 1d7d105c5643..fbb0db41b10e 100644 --- a/drivers/i2c/i2c-stub.c +++ b/drivers/i2c/i2c-stub.c @@ -372,7 +372,7 @@ static int __init i2c_stub_init(void) /* Allocate memory for all chips at once */ stub_chips_nr = i; - stub_chips = kzalloc_objs(struct stub_chip, stub_chips_nr, GFP_KERNEL); + stub_chips = kzalloc_objs(struct stub_chip, stub_chips_nr); if (!stub_chips) return -ENOMEM; diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 161eab16d17e..9446a56d692f 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -858,7 +858,7 @@ i3c_master_alloc_i2c_dev(struct i3c_master_controller *master, { struct i2c_dev_desc *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); @@ -983,7 +983,7 @@ i3c_master_alloc_i3c_dev(struct i3c_master_controller *master, { struct i3c_dev_desc *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); @@ -1742,7 +1742,7 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) if (desc->dev || !desc->info.dyn_addr || desc == master->this) continue; - desc->dev = kzalloc_obj(*desc->dev, GFP_KERNEL); + desc->dev = kzalloc_obj(*desc->dev); if (!desc->dev) continue; @@ -2848,7 +2848,7 @@ i3c_generic_ibi_alloc_pool(struct i3c_dev_desc *dev, unsigned int i; int ret; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); @@ -2856,7 +2856,7 @@ i3c_generic_ibi_alloc_pool(struct i3c_dev_desc *dev, INIT_LIST_HEAD(&pool->free_slots); INIT_LIST_HEAD(&pool->pending); - pool->slots = kzalloc_objs(*slot, req->num_slots, GFP_KERNEL); + pool->slots = kzalloc_objs(*slot, req->num_slots); if (!pool->slots) { ret = -ENOMEM; goto err_free_pool; @@ -3219,7 +3219,7 @@ int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev, if (dev->ibi) return -EBUSY; - ibi = kzalloc_obj(*ibi, GFP_KERNEL); + ibi = kzalloc_obj(*ibi); if (!ibi) return -ENOMEM; diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c index e60dc306a03e..7894723b8399 100644 --- a/drivers/i3c/master/adi-i3c-master.c +++ b/drivers/i3c/master/adi-i3c-master.c @@ -459,7 +459,7 @@ static int adi_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) int slot; u8 addr; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -531,7 +531,7 @@ static int adi_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c index e4740cd07c66..28c9e37f9b0d 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1044,7 +1044,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1162,7 +1162,7 @@ static int dw_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c index 2f31e7ef3ea8..e806ae292aee 100644 --- a/drivers/i3c/master/i3c-master-cdns.c +++ b/drivers/i3c/master/i3c-master-cdns.c @@ -940,7 +940,7 @@ static int cdns_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) struct cdns_i3c_i2c_dev_data *data; int slot; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -991,7 +991,7 @@ static int cdns_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c index a527e7305c09..5879bba78164 100644 --- a/drivers/i3c/master/mipi-i3c-hci/core.c +++ b/drivers/i3c/master/mipi-i3c-hci/core.c @@ -410,7 +410,7 @@ static int i3c_hci_attach_i3c_dev(struct i3c_dev_desc *dev) struct i3c_hci_dev_data *dev_data; int ret; - dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data); if (!dev_data) return -ENOMEM; if (hci->cmd == &mipi_i3c_hci_cmd_v1) { @@ -460,7 +460,7 @@ static int i3c_hci_attach_i2c_dev(struct i2c_dev_desc *dev) if (hci->cmd != &mipi_i3c_hci_cmd_v1) return 0; - dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data); if (!dev_data) return -ENOMEM; ret = mipi_i3c_hci_dat_v1.alloc_entry(hci); diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c index cdba4c9c839d..e55455369eaa 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -636,7 +636,7 @@ static int hci_dma_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev, struct i3c_generic_ibi_pool *pool; struct hci_dma_dev_ibi_data *dev_ibi; - dev_ibi = kmalloc_obj(*dev_ibi, GFP_KERNEL); + dev_ibi = kmalloc_obj(*dev_ibi); if (!dev_ibi) return -ENOMEM; pool = i3c_generic_ibi_alloc_pool(dev, req); diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h index 7d57ebba0c24..337b7ab1cb06 100644 --- a/drivers/i3c/master/mipi-i3c-hci/hci.h +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h @@ -107,7 +107,7 @@ struct hci_xfer { static inline struct hci_xfer *hci_alloc_xfer(unsigned int n) { - return kzalloc_objs(struct hci_xfer, n, GFP_KERNEL); + return kzalloc_objs(struct hci_xfer, n); } static inline void hci_free_xfer(struct hci_xfer *xfer, unsigned int n) diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c index 4fa3d5cf14d2..30302e4d08e2 100644 --- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c +++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c @@ -242,7 +242,7 @@ static void mipi_i3c_hci_pci_setup_cell(struct mipi_i3c_hci_pci *hci, int idx, cell->resources = &data->res; } -#define mipi_i3c_hci_pci_alloc(h, x) kzalloc_objs(*(x), (h)->info->instance_count, GFP_KERNEL) +#define mipi_i3c_hci_pci_alloc(h, x) kzalloc_objs(*(x), (h)->info->instance_count) static int mipi_i3c_hci_pci_add_instances(struct mipi_i3c_hci_pci *hci) { diff --git a/drivers/i3c/master/mipi-i3c-hci/pio.c b/drivers/i3c/master/mipi-i3c-hci/pio.c index 0c333e40378c..f8825ac81408 100644 --- a/drivers/i3c/master/mipi-i3c-hci/pio.c +++ b/drivers/i3c/master/mipi-i3c-hci/pio.c @@ -977,7 +977,7 @@ static int hci_pio_request_ibi(struct i3c_hci *hci, struct i3c_dev_desc *dev, struct i3c_generic_ibi_pool *pool; struct hci_pio_dev_ibi_data *dev_ibi; - dev_ibi = kmalloc_obj(*dev_ibi, GFP_KERNEL); + dev_ibi = kmalloc_obj(*dev_ibi); if (!dev_ibi) return -ENOMEM; pool = i3c_generic_ibi_alloc_pool(dev, req); diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c index a100bbaabf2d..d7ab232586c7 100644 --- a/drivers/i3c/master/renesas-i3c.c +++ b/drivers/i3c/master/renesas-i3c.c @@ -874,7 +874,7 @@ static int renesas_i3c_attach_i3c_dev(struct i3c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -984,7 +984,7 @@ static int renesas_i3c_attach_i2c_dev(struct i2c_dev_desc *dev) if (pos < 0) return pos; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 0e3b1a7be6a4..b849bc1d5d4c 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -900,7 +900,7 @@ static int svc_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { svc_i3c_master_release_slot(master, slot); return -ENOMEM; @@ -953,7 +953,7 @@ static int svc_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev) if (slot < 0) return slot; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { svc_i3c_master_release_slot(master, slot); return -ENOMEM; diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c index 7a251b030b7e..0c266c216525 100644 --- a/drivers/iio/buffer/industrialio-buffer-cb.c +++ b/drivers/iio/buffer/industrialio-buffer-cb.c @@ -60,7 +60,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, return ERR_PTR(-EINVAL); } - cb_buff = kzalloc_obj(*cb_buff, GFP_KERNEL); + cb_buff = kzalloc_obj(*cb_buff); if (cb_buff == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c index 2425e1113a7d..1daac23087a7 100644 --- a/drivers/iio/buffer/industrialio-buffer-dma.c +++ b/drivers/iio/buffer/industrialio-buffer-dma.c @@ -174,7 +174,7 @@ iio_dma_buffer_alloc_block(struct iio_dma_buffer_queue *queue, size_t size, bool fileio) { struct iio_dma_buffer_block *block __free(kfree) = - kzalloc_obj(*block, GFP_KERNEL); + kzalloc_obj(*block); if (!block) return NULL; diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c index 23b4ac7cca9c..98acce909854 100644 --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c @@ -224,7 +224,7 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct dma_chan *chan) if (ret < 0) return ERR_PTR(ret); - dmaengine_buffer = kzalloc_obj(*dmaengine_buffer, GFP_KERNEL); + dmaengine_buffer = kzalloc_obj(*dmaengine_buffer); if (!dmaengine_buffer) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c index 9745b3bd4ac7..51e3b360584f 100644 --- a/drivers/iio/buffer/industrialio-hw-consumer.c +++ b/drivers/iio/buffer/industrialio-hw-consumer.c @@ -87,7 +87,7 @@ struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev) struct iio_channel *chan; int ret; - hwc = kzalloc_obj(*hwc, GFP_KERNEL); + hwc = kzalloc_obj(*hwc); if (!hwc) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c index 73e2cd7e7313..a6ff9085b8a2 100644 --- a/drivers/iio/buffer/kfifo_buf.c +++ b/drivers/iio/buffer/kfifo_buf.c @@ -204,7 +204,7 @@ struct iio_buffer *iio_kfifo_allocate(void) { struct iio_kfifo *kf; - kf = kzalloc_obj(*kf, GFP_KERNEL); + kf = kzalloc_obj(*kf); if (!kf) return NULL; diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c index 5fd9ef819417..6c81c0385fb5 100644 --- a/drivers/iio/common/ssp_sensors/ssp_spi.c +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c @@ -77,7 +77,7 @@ static struct ssp_msg *ssp_create_msg(u8 cmd, u16 len, u16 opt, u32 data) struct ssp_msg_header h; struct ssp_msg *msg; - msg = kzalloc_obj(*msg, GFP_KERNEL); + msg = kzalloc_obj(*msg); if (!msg) return NULL; diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c index 84bc2281c03a..30f0ae7c5116 100644 --- a/drivers/iio/dummy/iio_dummy_evgen.c +++ b/drivers/iio/dummy/iio_dummy_evgen.c @@ -47,7 +47,7 @@ static int iio_dummy_evgen_create(void) { int ret; - iio_evgen = kzalloc_obj(*iio_evgen, GFP_KERNEL); + iio_evgen = kzalloc_obj(*iio_evgen); if (!iio_evgen) return -ENOMEM; diff --git a/drivers/iio/dummy/iio_simple_dummy.c b/drivers/iio/dummy/iio_simple_dummy.c index cba19b6a23cb..19fcdbbc11c6 100644 --- a/drivers/iio/dummy/iio_simple_dummy.c +++ b/drivers/iio/dummy/iio_simple_dummy.c @@ -588,7 +588,7 @@ static struct iio_sw_device *iio_dummy_probe(const char *name) * parent = &client->dev; */ - swd = kzalloc_obj(*swd, GFP_KERNEL); + swd = kzalloc_obj(*swd); if (!swd) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/dummy/iio_simple_dummy_buffer.c b/drivers/iio/dummy/iio_simple_dummy_buffer.c index 5bbfda407bc2..57f3611a86d9 100644 --- a/drivers/iio/dummy/iio_simple_dummy_buffer.c +++ b/drivers/iio/dummy/iio_simple_dummy_buffer.c @@ -60,7 +60,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p) * - A buffer at the end of the structure accessed via iio_priv() * that is marked __aligned(IIO_DMA_MINALIGN). */ - scan = kzalloc_obj(*scan, GFP_KERNEL); + scan = kzalloc_obj(*scan); if (!scan) goto done; diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c index 222b77781639..501da4eaef69 100644 --- a/drivers/iio/imu/adis_buffer.c +++ b/drivers/iio/imu/adis_buffer.c @@ -33,7 +33,7 @@ static int adis_update_scan_mode_burst(struct iio_dev *indio_dev, else burst_max_length = burst_length; - adis->xfer = kzalloc_objs(*adis->xfer, 2, GFP_KERNEL); + adis->xfer = kzalloc_objs(*adis->xfer, 2); if (!adis->xfer) return -ENOMEM; @@ -81,7 +81,7 @@ int adis_update_scan_mode(struct iio_dev *indio_dev, scan_count = indio_dev->scan_bytes / 2; - adis->xfer = kzalloc_objs(*adis->xfer, scan_count + 1, GFP_KERNEL); + adis->xfer = kzalloc_objs(*adis->xfer, scan_count + 1); if (!adis->xfer) return -ENOMEM; diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index ac141289a2f3..f15a180dc49e 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1024,7 +1024,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer, (*p)->to + (*p)->length == out_loc) { (*p)->length += length; } else { - *p = kmalloc_obj(**p, GFP_KERNEL); + *p = kmalloc_obj(**p); if (!(*p)) return -ENOMEM; (*p)->from = in_loc; @@ -1478,7 +1478,7 @@ static struct attribute *iio_buffer_wrap_attr(struct iio_buffer *buffer, struct device_attribute *dattr = to_dev_attr(attr); struct iio_dev_attr *iio_attr; - iio_attr = kzalloc_obj(*iio_attr, GFP_KERNEL); + iio_attr = kzalloc_obj(*iio_attr); if (!iio_attr) return NULL; @@ -1507,7 +1507,7 @@ static int iio_buffer_register_legacy_sysfs_groups(struct iio_dev *indio_dev, struct attribute **attrs; int ret; - attrs = kzalloc_objs(*attrs, buffer_attrcount + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, buffer_attrcount + 1); if (!attrs) return -ENOMEM; @@ -1521,7 +1521,7 @@ static int iio_buffer_register_legacy_sysfs_groups(struct iio_dev *indio_dev, if (ret) goto error_free_buffer_attrs; - attrs = kzalloc_objs(*attrs, scan_el_attrcount + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, scan_el_attrcount + 1); if (!attrs) { ret = -ENOMEM; goto error_free_buffer_attrs; @@ -1674,7 +1674,7 @@ static int iio_buffer_attach_dmabuf(struct iio_dev_buffer_pair *ib, if (copy_from_user(&fd, user_fd, sizeof(fd))) return -EFAULT; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -1862,7 +1862,7 @@ static int iio_buffer_enqueue_dmabuf(struct iio_dev_buffer_pair *ib, priv = attach->importer_priv; - fence = kmalloc_obj(*fence, GFP_KERNEL); + fence = kmalloc_obj(*fence); if (!fence) { ret = -ENOMEM; goto err_attachment_put; @@ -2035,7 +2035,7 @@ static long iio_device_buffer_getfd(struct iio_dev *indio_dev, unsigned long arg goto error_iio_dev_put; } - ib = kzalloc_obj(*ib, GFP_KERNEL); + ib = kzalloc_obj(*ib); if (!ib) { ret = -ENOMEM; goto error_clear_busy_bit; @@ -2182,7 +2182,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer, } attrn = buffer_attrcount + scan_el_attrcount; - attr = kzalloc_objs(*attr, attrn + 1, GFP_KERNEL); + attr = kzalloc_objs(*attr, attrn + 1); if (!attr) { ret = -ENOMEM; goto error_free_scan_mask; diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 9e3d23368413..d4a9dd889eef 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1192,7 +1192,7 @@ int __iio_add_chan_devattr(const char *postfix, int ret; struct iio_dev_attr *iio_attr, *t; - iio_attr = kzalloc_obj(*iio_attr, GFP_KERNEL); + iio_attr = kzalloc_obj(*iio_attr); if (iio_attr == NULL) return -ENOMEM; ret = __iio_device_attr_init(&iio_attr->dev_attr, @@ -1796,7 +1796,7 @@ static int iio_chrdev_open(struct inode *inode, struct file *filp) iio_device_get(indio_dev); - ib = kmalloc_obj(*ib, GFP_KERNEL); + ib = kmalloc_obj(*ib); if (!ib) { iio_device_put(indio_dev); clear_bit(IIO_BUSY_BIT_POS, &iio_dev_opaque->flags); diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 43043ea897e0..d71cb9fd09a3 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c @@ -583,7 +583,7 @@ int iio_device_register_eventset(struct iio_dev *indio_dev) iio_check_for_dynamic_events(indio_dev))) return 0; - ev_int = kzalloc_obj(*ev_int, GFP_KERNEL); + ev_int = kzalloc_obj(*ev_int); if (!ev_int) return -ENOMEM; diff --git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c index d7b52ca256b2..4f52dc373abf 100644 --- a/drivers/iio/industrialio-gts-helper.c +++ b/drivers/iio/industrialio-gts-helper.c @@ -250,12 +250,12 @@ static int iio_gts_alloc_int_table_array(int ***arr, int num_tables, int num_tab { int i, **tmp; - tmp = kzalloc_objs(**arr, num_tables, GFP_KERNEL); + tmp = kzalloc_objs(**arr, num_tables); if (!tmp) return -ENOMEM; for (i = 0; i < num_tables; i++) { - tmp[i] = kzalloc_objs(int, num_table_items, GFP_KERNEL); + tmp[i] = kzalloc_objs(int, num_table_items); if (!tmp[i]) goto err_free; } @@ -432,7 +432,7 @@ static int iio_gts_build_avail_time_table(struct iio_gts *gts) if (!gts->num_itime) return 0; - times = kzalloc_objs(int, gts->num_itime, GFP_KERNEL); + times = kzalloc_objs(int, gts->num_itime); if (!times) return -ENOMEM; diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 97a808554609..7f34fe7bad07 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -372,7 +372,7 @@ struct iio_poll_func va_list vargs; struct iio_poll_func *pf; - pf = kmalloc_obj(*pf, GFP_KERNEL); + pf = kmalloc_obj(*pf); if (!pf) return NULL; va_start(vargs, fmt); @@ -557,7 +557,7 @@ struct iio_trigger *viio_trigger_alloc(struct device *parent, struct iio_trigger *trig; int i; - trig = kzalloc_obj(*trig, GFP_KERNEL); + trig = kzalloc_obj(*trig); if (!trig) return NULL; diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 44600bc1b879..0df0ab3de270 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -55,7 +55,7 @@ int iio_map_array_register(struct iio_dev *indio_dev, const struct iio_map *maps guard(mutex)(&iio_map_list_lock); while (maps[i].consumer_dev_name) { - mapi = kzalloc_obj(*mapi, GFP_KERNEL); + mapi = kzalloc_obj(*mapi); if (!mapi) { ret = -ENOMEM; goto error_ret; @@ -188,7 +188,7 @@ static struct iio_channel *fwnode_iio_channel_get(struct fwnode_handle *fwnode, return ERR_PTR(-EINVAL); struct iio_channel *channel __free(kfree) = - kzalloc_obj(*channel, GFP_KERNEL); + kzalloc_obj(*channel); if (!channel) return ERR_PTR(-ENOMEM); @@ -302,7 +302,7 @@ static struct iio_channel *fwnode_iio_channel_get_all(struct device *dev) /* NULL terminated array to save passing size */ struct iio_channel *chans __free(kfree) = - kzalloc_objs(*chans, nummaps + 1, GFP_KERNEL); + kzalloc_objs(*chans, nummaps + 1); if (!chans) return ERR_PTR(-ENOMEM); @@ -474,7 +474,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev) /* NULL terminated array to save passing size */ struct iio_channel *chans __free(kfree) = - kzalloc_objs(*chans, nummaps + 1, GFP_KERNEL); + kzalloc_objs(*chans, nummaps + 1); if (!chans) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c index 02f137ace26d..57550b581593 100644 --- a/drivers/iio/trigger/iio-trig-hrtimer.c +++ b/drivers/iio/trigger/iio-trig-hrtimer.c @@ -131,7 +131,7 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name) struct iio_hrtimer_info *trig_info; int ret; - trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info); if (!trig_info) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-interrupt.c b/drivers/iio/trigger/iio-trig-interrupt.c index 432c9b2f2c64..a100c2e3a0d9 100644 --- a/drivers/iio/trigger/iio-trig-interrupt.c +++ b/drivers/iio/trigger/iio-trig-interrupt.c @@ -48,7 +48,7 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev) goto error_ret; } - trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info); if (!trig_info) { ret = -ENOMEM; goto error_free_trigger; diff --git a/drivers/iio/trigger/iio-trig-loop.c b/drivers/iio/trigger/iio-trig-loop.c index 8996aaffb3f8..580a465035d1 100644 --- a/drivers/iio/trigger/iio-trig-loop.c +++ b/drivers/iio/trigger/iio-trig-loop.c @@ -80,7 +80,7 @@ static struct iio_sw_trigger *iio_trig_loop_probe(const char *name) struct iio_loop_info *trig_info; int ret; - trig_info = kzalloc_obj(*trig_info, GFP_KERNEL); + trig_info = kzalloc_obj(*trig_info); if (!trig_info) return ERR_PTR(-ENOMEM); diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c index f242b3209307..b242b050ba18 100644 --- a/drivers/iio/trigger/iio-trig-sysfs.c +++ b/drivers/iio/trigger/iio-trig-sysfs.c @@ -140,7 +140,7 @@ static int iio_sysfs_trigger_probe(int id) ret = -EINVAL; goto err_unlock; } - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (t == NULL) { ret = -ENOMEM; goto err_unlock; diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 0764d71a9dd5..866746695712 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -646,7 +646,7 @@ int rdma_resolve_ip(struct sockaddr *src_addr, const struct sockaddr *dst_addr, struct addr_req *req; int ret = 0; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/infiniband/core/agent.c b/drivers/infiniband/core/agent.c index 8b889cb85c59..7847ede210bf 100644 --- a/drivers/infiniband/core/agent.c +++ b/drivers/infiniband/core/agent.c @@ -162,7 +162,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num) int ret; /* Create new device info */ - port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv); if (!port_priv) { ret = -ENOMEM; goto error1; diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index c3d542187129..c066befec91b 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -296,7 +296,7 @@ alloc_gid_entry(const struct ib_gid_attr *attr) struct ib_gid_table_entry *entry; struct net_device *ndev; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -771,12 +771,12 @@ const struct ib_gid_attr *rdma_find_gid_by_filter( static struct ib_gid_table *alloc_gid_table(int sz) { - struct ib_gid_table *table = kzalloc_obj(*table, GFP_KERNEL); + struct ib_gid_table *table = kzalloc_obj(*table); if (!table) return NULL; - table->data_vec = kzalloc_objs(*table->data_vec, sz, GFP_KERNEL); + table->data_vec = kzalloc_objs(*table->data_vec, sz); if (!table->data_vec) goto err_free_table; @@ -1452,7 +1452,7 @@ ib_cache_update(struct ib_device *device, u32 port, bool update_gids, if (!rdma_is_port_valid(device, port)) return -EINVAL; - tprops = kmalloc_obj(*tprops, GFP_KERNEL); + tprops = kmalloc_obj(*tprops); if (!tprops) return -ENOMEM; diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index c2fb11197d02..9cc26c9d1e47 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -827,7 +827,7 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device, u32 id; int ret; - cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL); + cm_id_priv = kzalloc_obj(*cm_id_priv); if (!cm_id_priv) return ERR_PTR(-ENOMEM); @@ -976,7 +976,7 @@ static struct cm_timewait_info *cm_create_timewait_info(__be32 local_id) { struct cm_timewait_info *timewait_info; - timewait_info = kzalloc_obj(*timewait_info, GFP_KERNEL); + timewait_info = kzalloc_obj(*timewait_info); if (!timewait_info) return ERR_PTR(-ENOMEM); @@ -4366,7 +4366,7 @@ static int cm_add_one(struct ib_device *ib_device) if (!rdma_cap_ib_cm(ib_device, i)) continue; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { ret = -ENOMEM; goto error1; diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index e4bd705cc046..df6f34d5e041 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -490,7 +490,7 @@ static int cma_add_id_to_tree(struct rdma_id_private *node_id_priv) unsigned long flags; int result; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; @@ -1013,7 +1013,7 @@ __rdma_create_id(struct net *net, rdma_cm_event_handler event_handler, { struct rdma_id_private *id_priv; - id_priv = kzalloc_obj(*id_priv, GFP_KERNEL); + id_priv = kzalloc_obj(*id_priv); if (!id_priv) return ERR_PTR(-ENOMEM); @@ -3083,14 +3083,14 @@ static int cma_resolve_ib_route(struct rdma_id_private *id_priv, struct cma_work *work; int ret; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; cma_init_resolve_route_work(work, id_priv); if (!route->path_rec) - route->path_rec = kmalloc_obj(*route->path_rec, GFP_KERNEL); + route->path_rec = kmalloc_obj(*route->path_rec); if (!route->path_rec) { ret = -ENOMEM; goto err1; @@ -3204,7 +3204,7 @@ static int cma_resolve_iw_route(struct rdma_id_private *id_priv) { struct cma_work *work; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; @@ -3311,11 +3311,11 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv) tos = id_priv->tos_set ? id_priv->tos : default_roce_tos; mutex_unlock(&id_priv->qp_mutex); - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; - route->path_rec = kzalloc_obj(*route->path_rec, GFP_KERNEL); + route->path_rec = kzalloc_obj(*route->path_rec); if (!route->path_rec) { ret = -ENOMEM; goto err1; @@ -3560,7 +3560,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv) union ib_gid gid; int ret; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; @@ -3585,7 +3585,7 @@ static int cma_resolve_ib_addr(struct rdma_id_private *id_priv) struct cma_work *work; int ret; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; @@ -3685,7 +3685,7 @@ static int cma_alloc_port(enum rdma_ucm_port_space ps, lockdep_assert_held(&lock); - bind_list = kzalloc_obj(*bind_list, GFP_KERNEL); + bind_list = kzalloc_obj(*bind_list); if (!bind_list) return -ENOMEM; @@ -5100,7 +5100,7 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, if (id_priv->id.qp_type != IB_QPT_UD) return -EINVAL; - mc = kzalloc_obj(*mc, GFP_KERNEL); + mc = kzalloc_obj(*mc); if (!mc) return -ENOMEM; @@ -5166,7 +5166,7 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) { pr_info("RDMA CM addr change for ndev %s used by id %p\n", ndev->name, &id_priv->id); - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; @@ -5373,7 +5373,7 @@ static int cma_add_one(struct ib_device *device) if (!cma_supported(device)) return -EOPNOTSUPP; - cma_dev = kmalloc_obj(*cma_dev, GFP_KERNEL); + cma_dev = kmalloc_obj(*cma_dev); if (!cma_dev) return -ENOMEM; @@ -5570,7 +5570,7 @@ static void cma_query_ib_service_handler(int status, } id_priv->id.route.service_recs = - kmalloc_objs(*recs, num_recs, GFP_KERNEL); + kmalloc_objs(*recs, num_recs); if (!id_priv->id.route.service_recs) { status = -ENOMEM; goto fail; @@ -5610,7 +5610,7 @@ static int cma_resolve_ib_service(struct rdma_id_private *id_priv, ib_sa_comp_mask mask = 0; struct cma_work *work; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c index a914edb8ffef..819927ce4f0e 100644 --- a/drivers/infiniband/core/cma_configfs.c +++ b/drivers/infiniband/core/cma_configfs.c @@ -210,7 +210,7 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group, return -ENODEV; ports_num = ibdev->phys_port_cnt; - ports = kzalloc_objs(*cma_dev_group->ports, ports_num, GFP_KERNEL); + ports = kzalloc_objs(*cma_dev_group->ports, ports_num); if (!ports) return -ENOMEM; @@ -284,7 +284,7 @@ static struct config_group *make_cma_dev(struct config_group *group, if (!cma_dev) goto fail; - cma_dev_group = kzalloc_obj(*cma_dev_group, GFP_KERNEL); + cma_dev_group = kzalloc_obj(*cma_dev_group); if (!cma_dev_group) { err = -ENOMEM; diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index ffe357d01dce..81316228f614 100644 --- a/drivers/infiniband/core/cq.c +++ b/drivers/infiniband/core/cq.c @@ -58,7 +58,7 @@ static void rdma_dim_init(struct ib_cq *cq) cq->poll_ctx == IB_POLL_DIRECT) return; - dim = kzalloc_obj(struct dim, GFP_KERNEL); + dim = kzalloc_obj(struct dim); if (!dim) return; @@ -230,7 +230,7 @@ struct ib_cq *__ib_alloc_cq(struct ib_device *dev, void *private, int nr_cqe, atomic_set(&cq->usecnt, 0); cq->comp_vector = comp_vector; - cq->wc = kmalloc_objs(*cq->wc, IB_POLL_BATCH, GFP_KERNEL); + cq->wc = kmalloc_objs(*cq->wc, IB_POLL_BATCH); if (!cq->wc) goto out_free_cq; diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 8d50ee81a6d1..358ffe6756a4 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -957,7 +957,7 @@ static int add_one_compat_dev(struct ib_device *device, if (ret) goto done; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) { ret = -ENOMEM; goto cdev_err; diff --git a/drivers/infiniband/core/ib_core_uverbs.c b/drivers/infiniband/core/ib_core_uverbs.c index 9e26868e50b6..d3836a62a004 100644 --- a/drivers/infiniband/core/ib_core_uverbs.c +++ b/drivers/infiniband/core/ib_core_uverbs.c @@ -87,7 +87,7 @@ int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma, return -EINVAL; lockdep_assert_held(&ufile->device->disassociate_srcu); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index 73e6849140fb..9761d9365ffd 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c @@ -171,7 +171,7 @@ static int alloc_work_entries(struct iwcm_id_private *cm_id_priv, int count) BUG_ON(!list_empty(&cm_id_priv->work_free_list)); while (count--) { - work = kmalloc_obj(struct iwcm_work, GFP_KERNEL); + work = kmalloc_obj(struct iwcm_work); if (!work) { dealloc_work_entries(cm_id_priv); return -ENOMEM; @@ -242,7 +242,7 @@ struct iw_cm_id *iw_create_cm_id(struct ib_device *device, { struct iwcm_id_private *cm_id_priv; - cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL); + cm_id_priv = kzalloc_obj(*cm_id_priv); if (!cm_id_priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index 96c707a49a71..7817b7dab7f9 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c @@ -113,7 +113,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, unsigned long flags; int ret = -EINVAL; - map_info = kzalloc_obj(struct iwpm_mapping_info, GFP_KERNEL); + map_info = kzalloc_obj(struct iwpm_mapping_info); if (!map_info) return -ENOMEM; diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index a2b2cd4f8e0a..8d19613179e3 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -386,7 +386,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, } /* Allocate structures */ - mad_agent_priv = kzalloc_obj(*mad_agent_priv, GFP_KERNEL); + mad_agent_priv = kzalloc_obj(*mad_agent_priv); if (!mad_agent_priv) { ret = ERR_PTR(-ENOMEM); goto error1; @@ -2612,7 +2612,7 @@ static bool ib_mad_send_error(struct ib_mad_port_private *port_priv, struct ib_qp_attr *attr; /* Transition QP to RTS and fail offending send */ - attr = kmalloc_obj(*attr, GFP_KERNEL); + attr = kmalloc_obj(*attr); if (attr) { attr->qp_state = IB_QPS_RTS; attr->cur_qp_state = IB_QPS_SQE; @@ -3042,7 +3042,7 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv) struct ib_qp *qp; u16 pkey_index; - attr = kmalloc_obj(*attr, GFP_KERNEL); + attr = kmalloc_obj(*attr); if (!attr) return -ENOMEM; @@ -3207,7 +3207,7 @@ static int ib_mad_port_open(struct ib_device *device, return -EFAULT; /* Create new device info */ - port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv); if (!port_priv) return -ENOMEM; diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 7d577d26f3eb..17c4c52a19e4 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c @@ -279,7 +279,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent, struct mad_rmpp_recv *rmpp_recv; struct ib_mad_hdr *mad_hdr; - rmpp_recv = kmalloc_obj(*rmpp_recv, GFP_KERNEL); + rmpp_recv = kmalloc_obj(*rmpp_recv); if (!rmpp_recv) return NULL; diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c index 87a9ac4bf987..ac3688952cab 100644 --- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -25,7 +25,7 @@ int rdma_restrack_init(struct ib_device *dev) struct rdma_restrack_root *rt; int i; - dev->res = kzalloc_objs(*rt, RDMA_RESTRACK_MAX, GFP_KERNEL); + dev->res = kzalloc_objs(*rt, RDMA_RESTRACK_MAX); if (!dev->res) return -ENOMEM; diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 71345ccf1bf8..5a3092abb4e6 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -162,7 +162,7 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, int i, j, ret = 0, count = 0; ctx->nr_ops = DIV_ROUND_UP(sg_cnt, pages_per_mr); - ctx->reg = kzalloc_objs(*ctx->reg, ctx->nr_ops, GFP_KERNEL); + ctx->reg = kzalloc_objs(*ctx->reg, ctx->nr_ops); if (!ctx->reg) { ret = -ENOMEM; goto out; @@ -297,11 +297,11 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, ctx->nr_ops = DIV_ROUND_UP(sg_cnt, max_sge); - ctx->map.sges = sge = kzalloc_objs(*sge, sg_cnt, GFP_KERNEL); + ctx->map.sges = sge = kzalloc_objs(*sge, sg_cnt); if (!ctx->map.sges) goto out; - ctx->map.wrs = kzalloc_objs(*ctx->map.wrs, ctx->nr_ops, GFP_KERNEL); + ctx->map.wrs = kzalloc_objs(*ctx->map.wrs, ctx->nr_ops); if (!ctx->map.wrs) goto out_free_sges; @@ -756,7 +756,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, ctx->type = RDMA_RW_SIG_MR; ctx->nr_ops = 1; - ctx->reg = kzalloc_obj(*ctx->reg, GFP_KERNEL); + ctx->reg = kzalloc_obj(*ctx->reg); if (!ctx->reg) { ret = -ENOMEM; goto out_unmap_prot_sg; diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index cbea6fdd0e75..dbd452efe7aa 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -1607,7 +1607,7 @@ static void ib_sa_service_rec_callback(struct ib_sa_query *sa_query, int status, return; } - rec = kmalloc_objs(*rec, num_services, GFP_KERNEL); + rec = kmalloc_objs(*rec, num_services); if (!rec) { query->callback(-ENOMEM, NULL, 0, query->context); return; @@ -2188,7 +2188,7 @@ static void update_ib_cpi(struct work_struct *work) } spin_unlock_irqrestore(&port->classport_lock, flags); - cb_context = kmalloc_obj(*cb_context, GFP_KERNEL); + cb_context = kmalloc_obj(*cb_context); if (!cb_context) goto err_nomem; @@ -2306,7 +2306,7 @@ static void update_sm_ah(struct work_struct *work) return; } - new_ah = kmalloc_obj(*new_ah, GFP_KERNEL); + new_ah = kmalloc_obj(*new_ah); if (!new_ah) return; diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c index deccd7b7eb51..9af31d1d9d70 100644 --- a/drivers/infiniband/core/security.c +++ b/drivers/infiniband/core/security.c @@ -258,7 +258,7 @@ static int port_pkey_list_insert(struct ib_port_pkey *pp) if (!pkey) { bool found = false; - pkey = kzalloc_obj(*pkey, GFP_KERNEL); + pkey = kzalloc_obj(*pkey); if (!pkey) return -ENOMEM; @@ -335,7 +335,7 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp, struct ib_ports_pkeys *new_pps; struct ib_ports_pkeys *qp_pps = qp->qp_sec->ports_pkeys; - new_pps = kzalloc_obj(*new_pps, GFP_KERNEL); + new_pps = kzalloc_obj(*new_pps); if (!new_pps) return NULL; @@ -428,7 +428,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev) if (!is_ib) return 0; - qp->qp_sec = kzalloc_obj(*qp->qp_sec, GFP_KERNEL); + qp->qp_sec = kzalloc_obj(*qp->qp_sec); if (!qp->qp_sec) return -ENOMEM; diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index c2becb0b39a2..d55f6a98c456 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -515,8 +515,8 @@ static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, if (!dev->ops.process_mad) return -ENOSYS; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kzalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kzalloc_obj(*out_mad); if (!in_mad || !out_mad) { ret = -ENOMEM; goto out; @@ -1054,7 +1054,7 @@ alloc_port_table_group(const char *name, struct attribute_group *group, struct attribute **attr_list; int i; - attr_list = kzalloc_objs(*attr_list, num + 1, GFP_KERNEL); + attr_list = kzalloc_objs(*attr_list, num + 1); if (!attr_list) return -ENOMEM; diff --git a/drivers/infiniband/core/ucaps.c b/drivers/infiniband/core/ucaps.c index d5524f69b981..948093260dbd 100644 --- a/drivers/infiniband/core/ucaps.c +++ b/drivers/infiniband/core/ucaps.c @@ -160,7 +160,7 @@ int ib_create_ucap(enum rdma_user_cap type) return 0; } - ucap = kzalloc_obj(*ucap, GFP_KERNEL); + ucap = kzalloc_obj(*ucap); if (!ucap) { ret = -ENOMEM; goto unlock; diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index f84c6a02eaff..878561fa1cb5 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -195,7 +195,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file) { struct ucma_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -262,7 +262,7 @@ static struct ucma_event *ucma_create_uevent(struct ucma_context *ctx, { struct ucma_event *uevent; - uevent = kzalloc_obj(*uevent, GFP_KERNEL); + uevent = kzalloc_obj(*uevent); if (!uevent) return NULL; @@ -1529,7 +1529,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, if (IS_ERR(ctx)) return PTR_ERR(ctx); - mc = kzalloc_obj(*mc, GFP_KERNEL); + mc = kzalloc_obj(*mc); if (!mc) { ret = -ENOMEM; goto err_put_ctx; @@ -1770,7 +1770,7 @@ static ssize_t ucma_write_cm_event(struct ucma_file *file, event.status = cmd.status; event.param.arg = cmd.param.arg; - uevent = kzalloc_obj(*uevent, GFP_KERNEL); + uevent = kzalloc_obj(*uevent); if (!uevent) { ret = -ENOMEM; goto out; @@ -1885,7 +1885,7 @@ static int ucma_open(struct inode *inode, struct file *filp) { struct ucma_file *file; - file = kmalloc_obj(*file, GFP_KERNEL); + file = kmalloc_obj(*file); if (!file) return -ENOMEM; diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 8863fd1b85d8..cff4fcca2c34 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -189,7 +189,7 @@ struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr, if (access & IB_ACCESS_ON_DEMAND) return ERR_PTR(-EOPNOTSUPP); - umem = kzalloc_obj(*umem, GFP_KERNEL); + umem = kzalloc_obj(*umem); if (!umem) return ERR_PTR(-ENOMEM); umem->ibdev = device; diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c index dc35dbe18951..f5298c33e581 100644 --- a/drivers/infiniband/core/umem_dmabuf.c +++ b/drivers/infiniband/core/umem_dmabuf.c @@ -136,7 +136,7 @@ ib_umem_dmabuf_get_with_dma_device(struct ib_device *device, if (dmabuf->size < end) goto out_release_dmabuf; - umem_dmabuf = kzalloc_obj(*umem_dmabuf, GFP_KERNEL); + umem_dmabuf = kzalloc_obj(*umem_dmabuf); if (!umem_dmabuf) { ret = ERR_PTR(-ENOMEM); goto out_release_dmabuf; diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c index d14bd597a2b7..404fa1cc3254 100644 --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -140,7 +140,7 @@ struct ib_umem_odp *ib_umem_odp_alloc_implicit(struct ib_device *device, if (access & IB_ACCESS_HUGETLB) return ERR_PTR(-EINVAL); - umem_odp = kzalloc_obj(*umem_odp, GFP_KERNEL); + umem_odp = kzalloc_obj(*umem_odp); if (!umem_odp) return ERR_PTR(-ENOMEM); umem = &umem_odp->umem; @@ -181,7 +181,7 @@ ib_umem_odp_alloc_child(struct ib_umem_odp *root, unsigned long addr, if (WARN_ON(!root->is_implicit_odp)) return ERR_PTR(-EINVAL); - odp_data = kzalloc_obj(*odp_data, GFP_KERNEL); + odp_data = kzalloc_obj(*odp_data); if (!odp_data) return ERR_PTR(-ENOMEM); umem = &odp_data->umem; @@ -241,7 +241,7 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *device, if (WARN_ON_ONCE(!(access & IB_ACCESS_ON_DEMAND))) return ERR_PTR(-EINVAL); - umem_odp = kzalloc_obj(struct ib_umem_odp, GFP_KERNEL); + umem_odp = kzalloc_obj(struct ib_umem_odp); if (!umem_odp) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c index 0ff2b7ba6b79..d9991d1f6e9a 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c @@ -247,7 +247,7 @@ static void recv_handler(struct ib_mad_agent *agent, if (mad_recv_wc->wc->status != IB_WC_SUCCESS) goto err1; - packet = kzalloc_obj(*packet, GFP_KERNEL); + packet = kzalloc_obj(*packet); if (!packet) goto err1; @@ -1018,7 +1018,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp) goto out; } - file = kzalloc_obj(*file, GFP_KERNEL); + file = kzalloc_obj(*file); if (!file) { ret = -ENOMEM; goto out; diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 7aa7f1692c73..02abeed9c75d 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -510,7 +510,7 @@ static int xrcd_table_insert(struct ib_uverbs_device *dev, struct rb_node **p = &dev->xrcd_tree.rb_node; struct rb_node *parent = NULL; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1672,8 +1672,8 @@ static int ib_uverbs_query_qp(struct uverbs_attr_bundle *attrs) if (ret) return ret; - attr = kmalloc_obj(*attr, GFP_KERNEL); - init_attr = kmalloc_obj(*init_attr, GFP_KERNEL); + attr = kmalloc_obj(*attr); + init_attr = kmalloc_obj(*init_attr); if (!attr || !init_attr) { ret = -ENOMEM; goto out; @@ -1780,7 +1780,7 @@ static int modify_qp(struct uverbs_attr_bundle *attrs, struct ib_qp *qp; int ret; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return -ENOMEM; @@ -2525,7 +2525,7 @@ static int ib_uverbs_attach_mcast(struct uverbs_attr_bundle *attrs) goto out_put; } - mcast = kmalloc_obj(*mcast, GFP_KERNEL); + mcast = kmalloc_obj(*mcast); if (!mcast) { ret = -ENOMEM; goto out_put; @@ -2595,7 +2595,7 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs) { struct ib_uflow_resources *resources; - resources = kzalloc_obj(*resources, GFP_KERNEL); + resources = kzalloc_obj(*resources); if (!resources) return NULL; @@ -2604,9 +2604,9 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs) goto out; resources->counters = - kzalloc_objs(*resources->counters, num_specs, GFP_KERNEL); + kzalloc_objs(*resources->counters, num_specs); resources->collection = - kzalloc_objs(*resources->collection, num_specs, GFP_KERNEL); + kzalloc_objs(*resources->collection, num_specs); if (!resources->counters || !resources->collection) goto err; @@ -3116,7 +3116,7 @@ static int ib_uverbs_ex_create_rwq_ind_table(struct uverbs_attr_bundle *attrs) if (err) goto err_free; - wqs = kzalloc_objs(*wqs, num_wq_handles, GFP_KERNEL); + wqs = kzalloc_objs(*wqs, num_wq_handles); if (!wqs) { err = -ENOMEM; goto err_free; diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 2a3c8a5ead1c..7b68967a6301 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -737,7 +737,7 @@ static void rdma_umap_open(struct vm_area_struct *vma) if (!ufile->ucontext) goto out_unlock; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) goto out_unlock; rdma_umap_priv_init(priv, vma, opriv->entry); @@ -966,7 +966,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) } } - file = kzalloc_obj(*file, GFP_KERNEL); + file = kzalloc_obj(*file); if (!file) { ret = -ENOMEM; if (module_dependent) @@ -1154,7 +1154,7 @@ static int ib_uverbs_add_one(struct ib_device *device) device->type == RDMA_DEVICE_TYPE_SMI) return -EOPNOTSUPP; - uverbs_dev = kzalloc_obj(*uverbs_dev, GFP_KERNEL); + uverbs_dev = kzalloc_obj(*uverbs_dev); if (!uverbs_dev) return -ENOMEM; diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c index 7e8b04658526..7ed69890d87a 100644 --- a/drivers/infiniband/core/uverbs_uapi.c +++ b/drivers/infiniband/core/uverbs_uapi.c @@ -648,7 +648,7 @@ struct uverbs_api *uverbs_alloc_api(struct ib_device *ibdev) struct uverbs_api *uapi; int rc; - uapi = kzalloc_obj(*uapi, GFP_KERNEL); + uapi = kzalloc_obj(*uapi); if (!uapi) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 2e98f1e2e53f..9b3d7088e3e1 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1186,7 +1186,7 @@ static struct ib_qp *__ib_open_qp(struct ib_qp *real_qp, unsigned long flags; int err; - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return ERR_PTR(-ENOMEM); @@ -2420,7 +2420,7 @@ struct ib_mr *ib_alloc_mr_integrity(struct ib_pd *pd, goto out; } - sig_attrs = kzalloc_obj(struct ib_sig_attrs, GFP_KERNEL); + sig_attrs = kzalloc_obj(struct ib_sig_attrs); if (!sig_attrs) { mr = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/infiniband/hw/bng_re/bng_dev.c b/drivers/infiniband/hw/bng_re/bng_dev.c index d43fa9a5b109..cf3bf08e5f26 100644 --- a/drivers/infiniband/hw/bng_re/bng_dev.c +++ b/drivers/infiniband/hw/bng_re/bng_dev.c @@ -77,7 +77,7 @@ static int bng_re_setup_chip_ctx(struct bng_re_dev *rdev) aux_dev = rdev->aux_dev; rdev->bng_res.pdev = aux_dev->pdev; rdev->rcfw.res = &rdev->bng_res; - chip_ctx = kzalloc_obj(*chip_ctx, GFP_KERNEL); + chip_ctx = kzalloc_obj(*chip_ctx); if (!chip_ctx) return -ENOMEM; chip_ctx->chip_num = aux_dev->chip_num; @@ -85,7 +85,7 @@ static int bng_re_setup_chip_ctx(struct bng_re_dev *rdev) rdev->chip_ctx = chip_ctx; rdev->bng_res.cctx = rdev->chip_ctx; - rdev->dev_attr = kzalloc_obj(*rdev->dev_attr, GFP_KERNEL); + rdev->dev_attr = kzalloc_obj(*rdev->dev_attr); if (!rdev->dev_attr) goto free_chip_ctx; rdev->bng_res.dattr = rdev->dev_attr; @@ -337,7 +337,7 @@ static int bng_re_dev_init(struct bng_re_dev *rdev) } /* Allocate nq record memory */ - rdev->nqr = kzalloc_obj(*rdev->nqr, GFP_KERNEL); + rdev->nqr = kzalloc_obj(*rdev->nqr); if (!rdev->nqr) { bng_re_destroy_chip_ctx(rdev); bnge_unregister_dev(rdev->aux_dev); @@ -464,7 +464,7 @@ static int bng_re_probe(struct auxiliary_device *adev, struct bng_re_en_dev_info *en_info; int rc; - en_info = kzalloc_obj(*en_info, GFP_KERNEL); + en_info = kzalloc_obj(*en_info); if (!en_info) return -ENOMEM; diff --git a/drivers/infiniband/hw/bnxt_re/debugfs.c b/drivers/infiniband/hw/bnxt_re/debugfs.c index e43698156c61..a2ad79c3bbd0 100644 --- a/drivers/infiniband/hw/bnxt_re/debugfs.c +++ b/drivers/infiniband/hw/bnxt_re/debugfs.c @@ -467,7 +467,7 @@ static void bnxt_re_init_cq_coal_debugfs(struct bnxt_re_dev *rdev) if (!_is_cq_coalescing_supported(rdev->dev_attr->dev_cap_flags2)) return; - dbg_cq_coal_params = kzalloc_obj(*dbg_cq_coal_params, GFP_KERNEL); + dbg_cq_coal_params = kzalloc_obj(*dbg_cq_coal_params); if (!dbg_cq_coal_params) return; @@ -497,7 +497,7 @@ void bnxt_re_debugfs_add_pdev(struct bnxt_re_dev *rdev) bnxt_re_debugfs_add_info(rdev); - rdev->cc_config_params = kzalloc_obj(*cc_params, GFP_KERNEL); + rdev->cc_config_params = kzalloc_obj(*cc_params); for (i = 0; i < BNXT_RE_CC_PARAM_GEN0; i++) { struct bnxt_re_cc_param *tmp_params = &rdev->cc_config_params->gen0_parms[i]; diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index ea1518ba5c02..312d8856adb4 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -461,7 +461,7 @@ int bnxt_re_add_gid(const struct ib_gid_attr *attr, void **context) return rc; } - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx_tbl = sgid_tbl->ctx; @@ -593,7 +593,7 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd) fence->dma_addr = dma_addr; /* Allocate a MR */ - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { rc = -ENOMEM; goto fail; @@ -651,7 +651,7 @@ bnxt_re_mmap_entry_insert(struct bnxt_re_ucontext *uctx, u64 mem_offset, struct bnxt_re_user_mmap_entry *entry; int ret; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -1190,7 +1190,7 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah union ib_gid sgid; int rc; - ah = kzalloc_obj(*ah, GFP_KERNEL); + ah = kzalloc_obj(*ah); if (!ah) return NULL; @@ -1237,7 +1237,7 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp struct bnxt_re_qp *qp; int rc; - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return NULL; @@ -2359,7 +2359,7 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, struct bnxt_qplib_qp *qplib_qp; int rc; - qplib_qp = kzalloc_obj(*qplib_qp, GFP_KERNEL); + qplib_qp = kzalloc_obj(*qplib_qp); if (!qplib_qp) return -ENOMEM; @@ -4030,7 +4030,7 @@ struct ib_mr *bnxt_re_get_dma_mr(struct ib_pd *ib_pd, int mr_access_flags) u32 active_mrs; int rc; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -4133,7 +4133,7 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type, if (max_num_sg > MAX_PBL_LVL_1_PGS) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -4185,7 +4185,7 @@ struct ib_mw *bnxt_re_alloc_mw(struct ib_pd *ib_pd, enum ib_mw_type type, u32 active_mws; int rc; - mw = kzalloc_obj(*mw, GFP_KERNEL); + mw = kzalloc_obj(*mw); if (!mw) return ERR_PTR(-ENOMEM); mw->rdev = rdev; @@ -4250,7 +4250,7 @@ static struct ib_mr *__bnxt_re_user_reg_mr(struct ib_pd *ib_pd, u64 length, u64 return ERR_PTR(-EINVAL); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -4507,7 +4507,7 @@ struct ib_flow *bnxt_re_create_flow(struct ib_qp *ib_qp, return ERR_PTR(-EBUSY); } - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (!flow) { mutex_unlock(&rdev->qp_lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index cbb56ba634fc..b576f05e3b26 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -171,7 +171,7 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev) en_dev = rdev->en_dev; rdev->qplib_res.pdev = en_dev->pdev; - chip_ctx = kzalloc_obj(*chip_ctx, GFP_KERNEL); + chip_ctx = kzalloc_obj(*chip_ctx); if (!chip_ctx) return -ENOMEM; chip_ctx->chip_num = en_dev->chip_num; @@ -182,7 +182,7 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev) rdev->qplib_res.cctx = rdev->chip_ctx; rdev->rcfw.res = &rdev->qplib_res; - rdev->dev_attr = kzalloc_obj(*rdev->dev_attr, GFP_KERNEL); + rdev->dev_attr = kzalloc_obj(*rdev->dev_attr); if (!rdev->dev_attr) goto free_chip_ctx; rdev->qplib_res.dattr = rdev->dev_attr; @@ -2033,7 +2033,7 @@ static int bnxt_re_ib_init(struct bnxt_re_dev *rdev) static int bnxt_re_alloc_nqr_mem(struct bnxt_re_dev *rdev) { - rdev->nqr = kzalloc_obj(*rdev->nqr, GFP_KERNEL); + rdev->nqr = kzalloc_obj(*rdev->nqr); if (!rdev->nqr) return -ENOMEM; @@ -2491,7 +2491,7 @@ static int bnxt_re_probe(struct auxiliary_device *adev, en_dev = aux_priv->edev; mutex_lock(&bnxt_re_mutex); - en_info = kzalloc_obj(*en_info, GFP_KERNEL); + en_info = kzalloc_obj(*en_info); if (!en_info) { mutex_unlock(&bnxt_re_mutex); return -ENOMEM; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 9a491e489b2f..5a7cc3b1987e 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -799,7 +799,7 @@ static int bnxt_qplib_alloc_init_swq(struct bnxt_qplib_q *que) { int indx; - que->swq = kzalloc_objs(*que->swq, que->max_sw_wqe, GFP_KERNEL); + que->swq = kzalloc_objs(*que->swq, que->max_sw_wqe); if (!que->swq) return -ENOMEM; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 619947e2f114..2f907246478f 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -556,7 +556,7 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, struct bnxt_qplib_sgid_tbl *sgid_tbl, u16 max) { - sgid_tbl->tbl = kzalloc_objs(*sgid_tbl->tbl, max, GFP_KERNEL); + sgid_tbl->tbl = kzalloc_objs(*sgid_tbl->tbl, max); if (!sgid_tbl->tbl) return -ENOMEM; diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index c891fc3177e9..e31fb9134aa8 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c @@ -1095,10 +1095,10 @@ int c4iw_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, if (ucontext) { ret = -ENOMEM; - mm = kmalloc_obj(*mm, GFP_KERNEL); + mm = kmalloc_obj(*mm); if (!mm) goto err_remove_handle; - mm2 = kmalloc_obj(*mm2, GFP_KERNEL); + mm2 = kmalloc_obj(*mm2); if (!mm2) goto err_free_mm; diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index 95e01f23c7b9..505bf009941e 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c @@ -330,7 +330,7 @@ static int qp_open(struct inode *inode, struct file *file) unsigned long index; int count = 1; - qpd = kmalloc_obj(*qpd, GFP_KERNEL); + qpd = kmalloc_obj(*qpd); if (!qpd) return -ENOMEM; @@ -424,7 +424,7 @@ static int stag_open(struct inode *inode, struct file *file) int ret = 0; int count = 1; - stagd = kmalloc_obj(*stagd, GFP_KERNEL); + stagd = kmalloc_obj(*stagd); if (!stagd) { ret = -ENOMEM; goto out; @@ -675,7 +675,7 @@ static int ep_open(struct inode *inode, struct file *file) int ret = 0; int count = 1; - epd = kmalloc_obj(*epd, GFP_KERNEL); + epd = kmalloc_obj(*epd); if (!epd) { ret = -ENOMEM; goto out; @@ -1078,7 +1078,7 @@ static void *c4iw_uld_add(const struct cxgb4_lld_info *infop) pr_info("Chelsio T4/T5 RDMA Driver - version %s\n", DRV_VERSION); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ctx = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c index caa489c653ce..b8d49abde099 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -282,7 +282,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, if (c4iw_fatal_error(rdev)) return -EIO; - tpt = kmalloc_obj(*tpt, GFP_KERNEL); + tpt = kmalloc_obj(*tpt); if (!tpt) return -ENOMEM; @@ -439,7 +439,7 @@ struct ib_mr *c4iw_get_dma_mr(struct ib_pd *pd, int acc) php = to_c4iw_pd(pd); rhp = php->rhp; - mhp = kzalloc_obj(*mhp, GFP_KERNEL); + mhp = kzalloc_obj(*mhp); if (!mhp) return ERR_PTR(-ENOMEM); mhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); @@ -517,7 +517,7 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, if (mr_exceeds_hw_limits(rhp, length)) return ERR_PTR(-EINVAL); - mhp = kzalloc_obj(*mhp, GFP_KERNEL); + mhp = kzalloc_obj(*mhp); if (!mhp) return ERR_PTR(-ENOMEM); mhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); @@ -618,7 +618,7 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, use_dsgl)) return ERR_PTR(-EINVAL); - mhp = kzalloc_obj(*mhp, GFP_KERNEL); + mhp = kzalloc_obj(*mhp); if (!mhp) { ret = -ENOMEM; goto err; diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 03db946208b6..616019ac1da5 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -92,7 +92,7 @@ static int c4iw_alloc_ucontext(struct ib_ucontext *ucontext, pr_err_once("Warning - downlevel libcxgb4 (non-fatal), device status page disabled\n"); rhp->rdev.flags |= T4_STATUS_PAGE_DISABLED; } else { - mm = kmalloc_obj(*mm, GFP_KERNEL); + mm = kmalloc_obj(*mm); if (!mm) { ret = -ENOMEM; goto err; diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index f942a5428283..1b9104d41b55 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c @@ -2220,25 +2220,25 @@ int c4iw_create_qp(struct ib_qp *qp, struct ib_qp_init_attr *attrs, goto err_destroy_qp; if (udata && ucontext) { - sq_key_mm = kmalloc_obj(*sq_key_mm, GFP_KERNEL); + sq_key_mm = kmalloc_obj(*sq_key_mm); if (!sq_key_mm) { ret = -ENOMEM; goto err_remove_handle; } if (!attrs->srq) { - rq_key_mm = kmalloc_obj(*rq_key_mm, GFP_KERNEL); + rq_key_mm = kmalloc_obj(*rq_key_mm); if (!rq_key_mm) { ret = -ENOMEM; goto err_free_sq_key; } } - sq_db_key_mm = kmalloc_obj(*sq_db_key_mm, GFP_KERNEL); + sq_db_key_mm = kmalloc_obj(*sq_db_key_mm); if (!sq_db_key_mm) { ret = -ENOMEM; goto err_free_rq_key; } if (!attrs->srq) { - rq_db_key_mm = kmalloc_obj(*rq_db_key_mm, GFP_KERNEL); + rq_db_key_mm = kmalloc_obj(*rq_db_key_mm); if (!rq_db_key_mm) { ret = -ENOMEM; goto err_free_sq_db_key; @@ -2550,7 +2550,7 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx, goto err; if (!user) { - wq->sw_rq = kzalloc_objs(*wq->sw_rq, wq->size, GFP_KERNEL); + wq->sw_rq = kzalloc_objs(*wq->sw_rq, wq->size); if (!wq->sw_rq) goto err_put_qpid; wq->pending_wrs = kzalloc_objs(*srq->wq.pending_wrs, @@ -2757,12 +2757,12 @@ int c4iw_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *attrs, srq->flags = T4_SRQ_LIMIT_SUPPORT; if (udata) { - srq_key_mm = kmalloc_obj(*srq_key_mm, GFP_KERNEL); + srq_key_mm = kmalloc_obj(*srq_key_mm); if (!srq_key_mm) { ret = -ENOMEM; goto err_free_queue; } - srq_db_key_mm = kmalloc_obj(*srq_db_key_mm, GFP_KERNEL); + srq_db_key_mm = kmalloc_obj(*srq_db_key_mm); if (!srq_db_key_mm) { ret = -ENOMEM; goto err_free_srq_key_mm; diff --git a/drivers/infiniband/hw/cxgb4/resource.c b/drivers/infiniband/hw/cxgb4/resource.c index 224098e456c6..479d12824c72 100644 --- a/drivers/infiniband/hw/cxgb4/resource.c +++ b/drivers/infiniband/hw/cxgb4/resource.c @@ -126,7 +126,7 @@ u32 c4iw_get_cqid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) rdev->stats.qid.cur += rdev->qpmask + 1; mutex_unlock(&rdev->stats.lock); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = i; @@ -137,13 +137,13 @@ u32 c4iw_get_cqid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) * now put the same ids on the qp list since they all * map to the same db/gts page. */ - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = qid; list_add_tail(&entry->entry, &uctx->qpids); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = i; @@ -165,7 +165,7 @@ void c4iw_put_cqid(struct c4iw_rdev *rdev, u32 qid, { struct c4iw_qid_list *entry; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return; pr_debug("qid 0x%x\n", qid); @@ -200,7 +200,7 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) rdev->stats.qid.cur += rdev->qpmask + 1; mutex_unlock(&rdev->stats.lock); for (i = qid+1; i & rdev->qpmask; i++) { - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = i; @@ -211,13 +211,13 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx) * now put the same ids on the cq list since they all * map to the same db/gts page. */ - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = qid; list_add_tail(&entry->entry, &uctx->cqids); for (i = qid + 1; i & rdev->qpmask; i++) { - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) goto out; entry->qid = i; @@ -239,7 +239,7 @@ void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid, { struct c4iw_qid_list *entry; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return; pr_debug("qid 0x%x\n", qid); diff --git a/drivers/infiniband/hw/cxgb4/restrack.c b/drivers/infiniband/hw/cxgb4/restrack.c index d9fdedce0f21..4f45d961d913 100644 --- a/drivers/infiniband/hw/cxgb4/restrack.c +++ b/drivers/infiniband/hw/cxgb4/restrack.c @@ -209,7 +209,7 @@ int c4iw_fill_res_cm_id_entry(struct sk_buff *msg, epcp = (struct c4iw_ep_common *)iw_cm_id->provider_data; if (!epcp) return 0; - uep = kzalloc_obj(*uep, GFP_KERNEL); + uep = kzalloc_obj(*uep); if (!uep) return 0; diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c index 2e6b37385e5a..c1397086dc47 100644 --- a/drivers/infiniband/hw/efa/efa_main.c +++ b/drivers/infiniband/hw/efa/efa_main.c @@ -332,7 +332,7 @@ static int efa_create_eqs(struct efa_dev *dev) neqs = min_t(u32, neqs, dev->num_irq_vectors - EFA_COMP_EQS_VEC_BASE); dev->neqs = neqs; - dev->eqs = kzalloc_objs(*dev->eqs, neqs, GFP_KERNEL); + dev->eqs = kzalloc_objs(*dev->eqs, neqs); if (!dev->eqs) return -ENOMEM; diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 29a4e51dc015..51130bac3974 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -525,7 +525,7 @@ efa_user_mmap_entry_insert(struct ib_ucontext *ucontext, u64 address, size_t length, u8 mmap_flag, u64 *offset) { - struct efa_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct efa_user_mmap_entry *entry = kzalloc_obj(*entry); int err; if (!entry) @@ -1335,7 +1335,7 @@ static struct scatterlist *efa_vmalloc_buf_to_sg(u64 *buf, int page_cnt) struct page *pg; int i; - sglist = kmalloc_objs(*sglist, page_cnt, GFP_KERNEL); + sglist = kmalloc_objs(*sglist, page_cnt); if (!sglist) return NULL; sg_init_table(sglist, page_cnt); @@ -1681,7 +1681,7 @@ static struct efa_mr *efa_alloc_mr(struct ib_pd *ibpd, int access_flags, return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/erdma/erdma_cm.c b/drivers/infiniband/hw/erdma/erdma_cm.c index 3b164f645e6e..5c7d3a8f8038 100644 --- a/drivers/infiniband/hw/erdma/erdma_cm.c +++ b/drivers/infiniband/hw/erdma/erdma_cm.c @@ -91,7 +91,7 @@ static void erdma_disassoc_listen_cep(struct erdma_cep *cep) static struct erdma_cep *erdma_cep_alloc(struct erdma_dev *dev) { - struct erdma_cep *cep = kzalloc_obj(*cep, GFP_KERNEL); + struct erdma_cep *cep = kzalloc_obj(*cep); unsigned long flags; if (!cep) @@ -217,7 +217,7 @@ static int erdma_cm_alloc_work(struct erdma_cep *cep, int num) struct erdma_cm_work *work; while (num--) { - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) { if (!(list_empty(&cep->work_freelist))) erdma_cm_free_work(cep); @@ -1340,7 +1340,7 @@ int erdma_create_listen(struct iw_cm_id *id, int backlog) if (!id->provider_data) { id->provider_data = - kmalloc_obj(struct list_head, GFP_KERNEL); + kmalloc_obj(struct list_head); if (!id->provider_data) { ret = -ENOMEM; goto error; diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c index 7adf95d1315b..9f74aadc3047 100644 --- a/drivers/infiniband/hw/erdma/erdma_verbs.c +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c @@ -291,7 +291,7 @@ static struct rdma_user_mmap_entry * erdma_user_mmap_entry_insert(struct erdma_ucontext *uctx, void *address, u32 size, u8 mmap_flag, u64 *mmap_offset) { - struct erdma_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct erdma_user_mmap_entry *entry = kzalloc_obj(*entry); int ret; if (!entry) @@ -599,7 +599,7 @@ static struct erdma_mtt *erdma_create_cont_mtt(struct erdma_dev *dev, { struct erdma_mtt *mtt; - mtt = kzalloc_obj(*mtt, GFP_KERNEL); + mtt = kzalloc_obj(*mtt); if (!mtt) return ERR_PTR(-ENOMEM); @@ -724,7 +724,7 @@ static struct erdma_mtt *erdma_create_scatter_mtt(struct erdma_dev *dev, struct erdma_mtt *mtt; int ret = -ENOMEM; - mtt = kzalloc_obj(*mtt, GFP_KERNEL); + mtt = kzalloc_obj(*mtt); if (!mtt) return ERR_PTR(-ENOMEM); @@ -887,7 +887,7 @@ static int erdma_map_user_dbrecords(struct erdma_ucontext *ctx, if (page->va == (dbrecords_va & PAGE_MASK)) goto found; - page = kmalloc_obj(*page, GFP_KERNEL); + page = kmalloc_obj(*page); if (!page) { rv = -ENOMEM; goto out; @@ -1115,7 +1115,7 @@ struct ib_mr *erdma_get_dma_mr(struct ib_pd *ibpd, int acc) u32 stag; int ret; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1159,7 +1159,7 @@ struct ib_mr *erdma_ib_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, if (max_num_sg > ERDMA_MR_MAX_MTT_CNT) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1245,7 +1245,7 @@ struct ib_mr *erdma_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (!len || len > dev->attrs.max_mr_size) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index 28ded5e12b42..a684e25482b2 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -199,7 +199,7 @@ static struct hfi1_affinity_node *node_affinity_allocate(int node) { struct hfi1_affinity_node *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; entry->node = node; diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index b03f39ee1964..6a9db4d17c5a 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -14221,7 +14221,7 @@ static struct rsm_map_table *alloc_rsm_map_table(struct hfi1_devdata *dd) struct rsm_map_table *rmt; u8 rxcontext = is_ax(dd) ? 0 : 0xff; /* 0 is default if a0 ver. */ - rmt = kmalloc_obj(*rmt, GFP_KERNEL); + rmt = kmalloc_obj(*rmt); if (rmt) { memset(rmt->map, rxcontext, sizeof(rmt->map)); rmt->used = 0; @@ -14872,7 +14872,7 @@ static int init_asic_data(struct hfi1_devdata *dd) int ret = 0; /* pre-allocate the asic structure in case we are the first device */ - asic_data = kzalloc_obj(*dd->asic_data, GFP_KERNEL); + asic_data = kzalloc_obj(*dd->asic_data); if (!asic_data) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/efivar.c b/drivers/infiniband/hw/hfi1/efivar.c index f311b2f328a9..c4974c3bea5e 100644 --- a/drivers/infiniband/hw/hfi1/efivar.c +++ b/drivers/infiniband/hw/hfi1/efivar.c @@ -41,7 +41,7 @@ static int read_efi_var(const char *name, unsigned long *size, if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) return -EOPNOTSUPP; - uni_name = kzalloc_objs(efi_char16_t, strlen(name) + 1, GFP_KERNEL); + uni_name = kzalloc_objs(efi_char16_t, strlen(name) + 1); temp_buffer = kzalloc(EFI_DATA_SIZE, GFP_KERNEL); if (!uni_name || !temp_buffer) { diff --git a/drivers/infiniband/hw/hfi1/fault.c b/drivers/infiniband/hw/hfi1/fault.c index 697210b84937..4ab72ef03ba1 100644 --- a/drivers/infiniband/hw/hfi1/fault.c +++ b/drivers/infiniband/hw/hfi1/fault.c @@ -209,7 +209,7 @@ int hfi1_fault_init_debugfs(struct hfi1_ibdev *ibd) struct dentry *parent = ibd->hfi1_ibdev_dbg; struct dentry *fault_dir; - ibd->fault = kzalloc_obj(*ibd->fault, GFP_KERNEL); + ibd->fault = kzalloc_obj(*ibd->fault); if (!ibd->fault) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index 9baedace9ccc..56031becb273 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/drivers/infiniband/hw/hfi1/file_ops.c @@ -158,7 +158,7 @@ static int hfi1_file_open(struct inode *inode, struct file *fp) /* The real work is performed later in assign_ctxt() */ - fd = kzalloc_obj(*fd, GFP_KERNEL); + fd = kzalloc_obj(*fd); if (!fd || init_srcu_struct(&fd->pq_srcu)) goto nomem; diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 5bc8250ffbb2..07333dd37652 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -646,7 +646,7 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd, spin_lock_init(&ppd->cc_state_lock); spin_lock_init(&ppd->cc_log_lock); - cc_state = kzalloc_obj(*cc_state, GFP_KERNEL); + cc_state = kzalloc_obj(*cc_state); RCU_INIT_POINTER(ppd->cc_state, cc_state); if (!cc_state) goto bail; @@ -1282,7 +1282,7 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, goto bail; } - dd->comp_vect = kzalloc_obj(*dd->comp_vect, GFP_KERNEL); + dd->comp_vect = kzalloc_obj(*dd->comp_vect); if (!dd->comp_vect) { ret = -ENOMEM; goto bail; diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c index 41791ade91bd..03467e6c19a0 100644 --- a/drivers/infiniband/hw/hfi1/mad.c +++ b/drivers/infiniband/hw/hfi1/mad.c @@ -3736,7 +3736,7 @@ static void apply_cc_state(struct hfi1_pportdata *ppd) { struct cc_state *old_cc_state, *new_cc_state; - new_cc_state = kzalloc_obj(*new_cc_state, GFP_KERNEL); + new_cc_state = kzalloc_obj(*new_cc_state); if (!new_cc_state) return; diff --git a/drivers/infiniband/hw/hfi1/msix.c b/drivers/infiniband/hw/hfi1/msix.c index 790a4fd79421..3ac50ca4afcc 100644 --- a/drivers/infiniband/hw/hfi1/msix.c +++ b/drivers/infiniband/hw/hfi1/msix.c @@ -38,7 +38,7 @@ int msix_initialize(struct hfi1_devdata *dd) return ret; } - entries = kzalloc_objs(*dd->msix_info.msix_entries, total, GFP_KERNEL); + entries = kzalloc_objs(*dd->msix_info.msix_entries, total); if (!entries) { pci_free_irq_vectors(dd->pcidev); return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/pin_system.c b/drivers/infiniband/hw/hfi1/pin_system.c index d8109b06aa70..e62b4d9c7a0f 100644 --- a/drivers/infiniband/hw/hfi1/pin_system.c +++ b/drivers/infiniband/hw/hfi1/pin_system.c @@ -119,7 +119,7 @@ static int pin_system_pages(struct user_sdma_request *req, int pinned, cleared; struct page **pages; - pages = kzalloc_objs(*pages, npages, GFP_KERNEL); + pages = kzalloc_objs(*pages, npages); if (!pages) return -ENOMEM; @@ -173,7 +173,7 @@ static int add_system_pinning(struct user_sdma_request *req, struct sdma_mmu_node *node; int ret; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/qsfp.c b/drivers/infiniband/hw/hfi1/qsfp.c index 7c133037397c..2b6d45d092bc 100644 --- a/drivers/infiniband/hw/hfi1/qsfp.c +++ b/drivers/infiniband/hw/hfi1/qsfp.c @@ -107,7 +107,7 @@ static struct hfi1_i2c_bus *init_i2c_bus(struct hfi1_devdata *dd, struct hfi1_i2c_bus *bus; int ret; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) return NULL; diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index 04763f50ff60..e5f442938177 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c @@ -937,7 +937,7 @@ ssize_t sdma_set_cpu_to_sde_map(struct sdma_engine *sde, const char *buf, rht_node = rhashtable_lookup_fast(dd->sdma_rht, &cpu, sdma_rht_params); if (!rht_node) { - rht_node = kzalloc_obj(*rht_node, GFP_KERNEL); + rht_node = kzalloc_obj(*rht_node); if (!rht_node) { ret = -ENOMEM; goto out; @@ -1481,7 +1481,7 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) if (ret < 0) goto bail; - tmp_sdma_rht = kzalloc_obj(*tmp_sdma_rht, GFP_KERNEL); + tmp_sdma_rht = kzalloc_obj(*tmp_sdma_rht); if (!tmp_sdma_rht) { ret = -ENOMEM; goto bail; diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c index 1c16d4f9e1ab..95611f725257 100644 --- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c +++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c @@ -169,7 +169,7 @@ static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) } /* Allocate the array of struct page pointers needed for pinning */ - pages = kzalloc_objs(*pages, npages, GFP_KERNEL); + pages = kzalloc_objs(*pages, npages); if (!pages) return -ENOMEM; diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index f2642fef0bf4..8ea5ed918a02 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -120,7 +120,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, dd = uctxt->dd; - pq = kzalloc_obj(*pq, GFP_KERNEL); + pq = kzalloc_obj(*pq); if (!pq) return -ENOMEM; pq->dd = dd; @@ -135,7 +135,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, activate_packet_queue, NULL, NULL); pq->reqidx = 0; - pq->reqs = kzalloc_objs(*pq->reqs, hfi1_sdma_comp_ring_size, GFP_KERNEL); + pq->reqs = kzalloc_objs(*pq->reqs, hfi1_sdma_comp_ring_size); if (!pq->reqs) goto pq_reqs_nomem; @@ -156,7 +156,7 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, goto pq_txreq_nomem; } - cq = kzalloc_obj(*cq, GFP_KERNEL); + cq = kzalloc_obj(*cq); if (!cq) goto cq_nomem; diff --git a/drivers/infiniband/hw/hns/hns_roce_bond.c b/drivers/infiniband/hw/hns/hns_roce_bond.c index e3ffd7e20160..f2b12ae13a58 100644 --- a/drivers/infiniband/hw/hns/hns_roce_bond.c +++ b/drivers/infiniband/hw/hns/hns_roce_bond.c @@ -253,7 +253,7 @@ static struct hns_roce_die_info *alloc_die_info(int bus_num) struct hns_roce_die_info *die_info; int ret; - die_info = kzalloc_obj(*die_info, GFP_KERNEL); + die_info = kzalloc_obj(*die_info); if (!die_info) return NULL; @@ -855,7 +855,7 @@ int hns_roce_alloc_bond_grp(struct hns_roce_dev *hr_dev) return 0; for (i = 0; i < ROCE_BOND_NUM_MAX; i++) { - bond_grp = kvzalloc_obj(*bond_grp, GFP_KERNEL); + bond_grp = kvzalloc_obj(*bond_grp); if (!bond_grp) { ret = -ENOMEM; goto mem_err; diff --git a/drivers/infiniband/hw/hns/hns_roce_cmd.c b/drivers/infiniband/hw/hns/hns_roce_cmd.c index f8a42ea6acac..1943031b0dbe 100644 --- a/drivers/infiniband/hw/hns/hns_roce_cmd.c +++ b/drivers/infiniband/hw/hns/hns_roce_cmd.c @@ -219,7 +219,7 @@ int hns_roce_cmd_use_events(struct hns_roce_dev *hr_dev) int i; hr_cmd->context = - kzalloc_objs(*hr_cmd->context, hr_cmd->max_cmds, GFP_KERNEL); + kzalloc_objs(*hr_cmd->context, hr_cmd->max_cmds); if (!hr_cmd->context) { hr_dev->cmd_mod = 0; return -ENOMEM; @@ -254,7 +254,7 @@ hns_roce_alloc_cmd_mailbox(struct hns_roce_dev *hr_dev) { struct hns_roce_cmd_mailbox *mailbox; - mailbox = kmalloc_obj(*mailbox, GFP_KERNEL); + mailbox = kmalloc_obj(*mailbox); if (!mailbox) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/hns/hns_roce_db.c b/drivers/infiniband/hw/hns/hns_roce_db.c index ad8fcaf613b9..f64023f5cf0a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_db.c +++ b/drivers/infiniband/hw/hns/hns_roce_db.c @@ -21,7 +21,7 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, unsigned long virt, if (page->user_virt == page_addr) goto found; - page = kmalloc_obj(*page, GFP_KERNEL); + page = kmalloc_obj(*page); if (!page) { ret = -ENOMEM; goto out; @@ -72,7 +72,7 @@ static struct hns_roce_db_pgdir *hns_roce_alloc_db_pgdir( { struct hns_roce_db_pgdir *pgdir; - pgdir = kzalloc_obj(*pgdir, GFP_KERNEL); + pgdir = kzalloc_obj(*pgdir); if (!pgdir) return NULL; diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index 11ba69dde716..9b60392afa39 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -262,7 +262,7 @@ static struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, return NULL; } - hem = kmalloc_obj(*hem, GFP_KERNEL); + hem = kmalloc_obj(*hem); if (!hem) return NULL; @@ -737,7 +737,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, obj_per_chunk = table->table_chunk_size / obj_size; num_hem = DIV_ROUND_UP(nobj, obj_per_chunk); - table->hem = kzalloc_objs(*table->hem, num_hem, GFP_KERNEL); + table->hem = kzalloc_objs(*table->hem, num_hem); if (!table->hem) return -ENOMEM; } else { @@ -763,7 +763,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, if (type >= HEM_TYPE_MTT) num_bt_l0 = bt_chunk_num; - table->hem = kzalloc_objs(*table->hem, num_hem, GFP_KERNEL); + table->hem = kzalloc_objs(*table->hem, num_hem); if (!table->hem) goto err_kcalloc_hem_buf; @@ -938,7 +938,7 @@ hem_list_alloc_item(struct hns_roce_dev *hr_dev, int start, int end, int count, { struct hns_roce_hem_item *hem; - hem = kzalloc_obj(*hem, GFP_KERNEL); + hem = kzalloc_obj(*hem); if (!hem) return NULL; diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 3440a6f21c02..fa36700d0db2 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -1948,7 +1948,7 @@ static int hns_roce_hw_v2_query_counter(struct hns_roce_dev *hr_dev, return -EINVAL; desc_num = DIV_ROUND_UP(HNS_ROCE_HW_CNT_TOTAL, CNT_PER_DESC); - desc = kzalloc_objs(*desc, desc_num, GFP_KERNEL); + desc = kzalloc_objs(*desc, desc_num); if (!desc) return -ENOMEM; @@ -2881,7 +2881,7 @@ static struct ib_pd *free_mr_init_pd(struct hns_roce_dev *hr_dev) struct hns_roce_pd *hr_pd; struct ib_pd *pd; - hr_pd = kzalloc_obj(*hr_pd, GFP_KERNEL); + hr_pd = kzalloc_obj(*hr_pd); if (!hr_pd) return NULL; pd = &hr_pd->ibpd; @@ -2912,7 +2912,7 @@ static struct ib_cq *free_mr_init_cq(struct hns_roce_dev *hr_dev) cq_init_attr.cqe = HNS_ROCE_FREE_MR_USED_CQE_NUM; - hr_cq = kzalloc_obj(*hr_cq, GFP_KERNEL); + hr_cq = kzalloc_obj(*hr_cq); if (!hr_cq) return NULL; @@ -2945,7 +2945,7 @@ static int free_mr_init_qp(struct hns_roce_dev *hr_dev, struct ib_cq *cq, struct ib_qp *qp; int ret; - hr_qp = kzalloc_obj(*hr_qp, GFP_KERNEL); + hr_qp = kzalloc_obj(*hr_qp); if (!hr_qp) return -ENOMEM; @@ -5021,7 +5021,7 @@ static int alloc_dip_entry(struct xarray *dip_xa, u32 qpn) if (hr_dip) return 0; - hr_dip = kzalloc_obj(*hr_dip, GFP_KERNEL); + hr_dip = kzalloc_obj(*hr_dip); if (!hr_dip) return -ENOMEM; @@ -5635,8 +5635,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, * we should set all bits of the relevant fields in context mask to * 0 at the same time, else set them to 0x1. */ - context = kvzalloc_obj(*context, GFP_KERNEL); - qpc_mask = kvzalloc_obj(*qpc_mask, GFP_KERNEL); + context = kvzalloc_obj(*context); + qpc_mask = kvzalloc_obj(*qpc_mask); if (!context || !qpc_mask) goto out; @@ -7107,7 +7107,7 @@ static int hns_roce_v2_init_eq_table(struct hns_roce_dev *hr_dev) eq_num = comp_num + aeq_num; irq_num = eq_num + other_num; - eq_table->eq = kzalloc_objs(*eq_table->eq, eq_num, GFP_KERNEL); + eq_table->eq = kzalloc_objs(*eq_table->eq, eq_num); if (!eq_table->eq) return -ENOMEM; @@ -7309,7 +7309,7 @@ static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle) if (!hr_dev) return -ENOMEM; - hr_dev->priv = kzalloc_obj(struct hns_roce_v2_priv, GFP_KERNEL); + hr_dev->priv = kzalloc_obj(struct hns_roce_v2_priv); if (!hr_dev->priv) { ret = -ENOMEM; goto error_failed_kzalloc; diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 349910dd99c6..1d2d0d8bdcdf 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -366,7 +366,7 @@ hns_roce_user_mmap_entry_insert(struct ib_ucontext *ucontext, u64 address, struct hns_user_mmap_entry *entry; int ret; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c index 80917b8926c1..741e4f3c557f 100644 --- a/drivers/infiniband/hw/hns/hns_roce_mr.c +++ b/drivers/infiniband/hw/hns/hns_roce_mr.c @@ -200,7 +200,7 @@ struct ib_mr *hns_roce_get_dma_mr(struct ib_pd *pd, int acc) struct hns_roce_mr *mr; int ret; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -243,7 +243,7 @@ struct ib_mr *hns_roce_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, goto err_out; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { ret = -ENOMEM; goto err_out; @@ -395,7 +395,7 @@ struct ib_mr *hns_roce_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, return ERR_PTR(-EINVAL); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -651,7 +651,7 @@ static int mtr_map_bufs(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr) page_shift = need_split_huge_page(mtr) ? HNS_HW_PAGE_SHIFT : mtr->hem_cfg.buf_pg_shift; /* alloc a tmp array to store buffer's dma address */ - pages = kvzalloc_objs(dma_addr_t, page_count, GFP_KERNEL); + pages = kvzalloc_objs(dma_addr_t, page_count); if (!pages) return -ENOMEM; diff --git a/drivers/infiniband/hw/ionic/ionic_admin.c b/drivers/infiniband/hw/ionic/ionic_admin.c index 850bd40ae3cc..59f22e83c931 100644 --- a/drivers/infiniband/hw/ionic/ionic_admin.c +++ b/drivers/infiniband/hw/ionic/ionic_admin.c @@ -520,7 +520,7 @@ static struct ionic_vcq *ionic_create_rdma_admincq(struct ionic_ibdev *dev, struct ionic_cq *cq; int rc; - vcq = kzalloc_obj(*vcq, GFP_KERNEL); + vcq = kzalloc_obj(*vcq); if (!vcq) return ERR_PTR(-ENOMEM); @@ -558,7 +558,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev, struct ionic_aq *aq; int rc; - aq = kzalloc_obj(*aq, GFP_KERNEL); + aq = kzalloc_obj(*aq); if (!aq) return ERR_PTR(-ENOMEM); @@ -575,7 +575,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev, ionic_queue_dbell_init(&aq->q, aq->aqid); - aq->q_wr = kzalloc_objs(*aq->q_wr, (u32)aq->q.mask + 1, GFP_KERNEL); + aq->q_wr = kzalloc_objs(*aq->q_wr, (u32)aq->q.mask + 1); if (!aq->q_wr) { rc = -ENOMEM; goto err_wr; @@ -983,7 +983,7 @@ static struct ionic_eq *ionic_create_eq(struct ionic_ibdev *dev, int eqid) struct ionic_eq *eq; int rc; - eq = kzalloc_obj(*eq, GFP_KERNEL); + eq = kzalloc_obj(*eq); if (!eq) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c index 9a2b09b783e0..7889d76bf69d 100644 --- a/drivers/infiniband/hw/ionic/ionic_controlpath.c +++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c @@ -343,7 +343,7 @@ ionic_mmap_entry_insert(struct ionic_ctx *ctx, unsigned long size, struct ionic_mmap_entry *entry; int rc; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -852,7 +852,7 @@ struct ib_mr *ionic_get_dma_mr(struct ib_pd *ibpd, int access) struct ionic_pd *pd = to_ionic_pd(ibpd); struct ionic_mr *mr; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -878,7 +878,7 @@ struct ib_mr *ionic_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -945,7 +945,7 @@ struct ib_mr *ionic_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 offset, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1039,7 +1039,7 @@ struct ib_mr *ionic_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type type, if (type != IB_MR_TYPE_MEM_REG) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -2203,7 +2203,7 @@ int ionic_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attr, qp->has_ah = attr->qp_type == IB_QPT_RC; if (qp->has_ah) { - qp->hdr = kzalloc_obj(*qp->hdr, GFP_KERNEL); + qp->hdr = kzalloc_obj(*qp->hdr); if (!qp->hdr) { rc = -ENOMEM; goto err_ah_alloc; diff --git a/drivers/infiniband/hw/ionic/ionic_hw_stats.c b/drivers/infiniband/hw/ionic/ionic_hw_stats.c index 3fbdc007dd05..03fdd2b16c4e 100644 --- a/drivers/infiniband/hw/ionic/ionic_hw_stats.c +++ b/drivers/infiniband/hw/ionic/ionic_hw_stats.c @@ -240,7 +240,7 @@ ionic_counter_alloc_stats(struct rdma_counter *counter) struct ionic_counter *cntr; int err; - cntr = kzalloc_obj(*cntr, GFP_KERNEL); + cntr = kzalloc_obj(*cntr); if (!cntr) return NULL; diff --git a/drivers/infiniband/hw/irdma/cm.c b/drivers/infiniband/hw/irdma/cm.c index aaff968138e2..3627797c6272 100644 --- a/drivers/infiniband/hw/irdma/cm.c +++ b/drivers/infiniband/hw/irdma/cm.c @@ -2969,7 +2969,7 @@ irdma_make_listen_node(struct irdma_cm_core *cm_core, /* create a CM listen node * 1/2 node to compare incoming traffic to */ - listener = kzalloc_obj(*listener, GFP_KERNEL); + listener = kzalloc_obj(*listener); if (!listener) return NULL; cm_core->stats_listen_nodes_created++; diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c index 8da3b2799593..f4ae530f56db 100644 --- a/drivers/infiniband/hw/irdma/hw.c +++ b/drivers/infiniband/hw/irdma/hw.c @@ -1029,7 +1029,7 @@ static int irdma_create_cqp(struct irdma_pci_f *rf) u16 maj_err, min_err; int i, status; - cqp->cqp_requests = kzalloc_objs(*cqp->cqp_requests, sqsize, GFP_KERNEL); + cqp->cqp_requests = kzalloc_objs(*cqp->cqp_requests, sqsize); if (!cqp->cqp_requests) return -ENOMEM; @@ -1039,7 +1039,7 @@ static int irdma_create_cqp(struct irdma_pci_f *rf) goto err_scratch; } - cqp->oop_op_array = kzalloc_objs(*cqp->oop_op_array, sqsize, GFP_KERNEL); + cqp->oop_op_array = kzalloc_objs(*cqp->oop_op_array, sqsize); if (!cqp->oop_op_array) { status = -ENOMEM; goto err_oop; @@ -1365,7 +1365,7 @@ static int irdma_setup_ceq_0(struct irdma_pci_f *rf) u32 num_ceqs; num_ceqs = min(rf->msix_count, rf->sc_dev.hmc_fpm_misc.max_ceqs); - rf->ceqlist = kzalloc_objs(*rf->ceqlist, num_ceqs, GFP_KERNEL); + rf->ceqlist = kzalloc_objs(*rf->ceqlist, num_ceqs); if (!rf->ceqlist) { status = -ENOMEM; goto exit; diff --git a/drivers/infiniband/hw/irdma/i40iw_if.c b/drivers/infiniband/hw/irdma/i40iw_if.c index eea222ae125a..4ff3ad7856aa 100644 --- a/drivers/infiniband/hw/irdma/i40iw_if.c +++ b/drivers/infiniband/hw/irdma/i40iw_if.c @@ -120,7 +120,7 @@ static int i40iw_open(struct i40e_info *cdev_info, struct i40e_client *client) if (!iwdev) return -ENOMEM; - iwdev->rf = kzalloc_obj(*rf, GFP_KERNEL); + iwdev->rf = kzalloc_obj(*rf); if (!iwdev->rf) { ib_dealloc_device(&iwdev->ibdev); return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/icrdma_if.c b/drivers/infiniband/hw/irdma/icrdma_if.c index 60f3c7f1547d..53c60543d748 100644 --- a/drivers/infiniband/hw/irdma/icrdma_if.c +++ b/drivers/infiniband/hw/irdma/icrdma_if.c @@ -258,7 +258,7 @@ static int icrdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary iwdev = ib_alloc_device(irdma_device, ibdev); if (!iwdev) return -ENOMEM; - iwdev->rf = kzalloc_obj(*rf, GFP_KERNEL); + iwdev->rf = kzalloc_obj(*rf); if (!iwdev->rf) { ib_dealloc_device(&iwdev->ibdev); return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/ig3rdma_if.c b/drivers/infiniband/hw/irdma/ig3rdma_if.c index 4d581ec341f3..4035f58efa31 100644 --- a/drivers/infiniband/hw/irdma/ig3rdma_if.c +++ b/drivers/infiniband/hw/irdma/ig3rdma_if.c @@ -175,7 +175,7 @@ static int ig3rdma_core_probe(struct auxiliary_device *aux_dev, struct irdma_pci_f *rf; int err; - rf = kzalloc_obj(*rf, GFP_KERNEL); + rf = kzalloc_obj(*rf); if (!rf) return -ENOMEM; diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 818ea15d5d92..2702825ccb8d 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -157,7 +157,7 @@ static struct rdma_user_mmap_entry* irdma_user_mmap_entry_insert(struct irdma_ucontext *ucontext, u64 bar_offset, enum irdma_mmap_flag mmap_flag, u64 *mmap_offset) { - struct irdma_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct irdma_user_mmap_entry *entry = kzalloc_obj(*entry); int ret; if (!entry) @@ -2111,7 +2111,7 @@ static int irdma_resize_cq(struct ib_cq *ibcq, int entries, info.cq_base = kmem_buf.va; info.cq_pa = kmem_buf.pa; - cq_buf = kzalloc_obj(*cq_buf, GFP_KERNEL); + cq_buf = kzalloc_obj(*cq_buf); if (!cq_buf) { ret = -ENOMEM; goto error; @@ -3153,7 +3153,7 @@ static struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 stag; int err_code; - iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -3370,7 +3370,7 @@ static struct irdma_mr *irdma_alloc_iwmr(struct ib_umem *region, struct irdma_mr *iwmr; unsigned long pgsz_bitmap; - iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -3809,7 +3809,7 @@ struct ib_mr *irdma_reg_phys_mr(struct ib_pd *pd, u64 addr, u64 size, int access u32 stag; int ret; - iwmr = kzalloc_obj(*iwmr, GFP_KERNEL); + iwmr = kzalloc_obj(*iwmr); if (!iwmr) return ERR_PTR(-ENOMEM); @@ -4851,7 +4851,7 @@ static int irdma_attach_mcast(struct ib_qp *ibqp, union ib_gid *ibgid, u16 lid) struct irdma_dma_mem *dma_mem_mc; spin_unlock_irqrestore(&rf->qh_list_lock, flags); - mc_qht_elem = kzalloc_obj(*mc_qht_elem, GFP_KERNEL); + mc_qht_elem = kzalloc_obj(*mc_qht_elem); if (!mc_qht_elem) return -ENOMEM; diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c index 413fde213120..b2749f971cd0 100644 --- a/drivers/infiniband/hw/mana/cq.c +++ b/drivers/infiniband/hw/mana/cq.c @@ -147,7 +147,7 @@ int mana_ib_install_cq_cb(struct mana_ib_dev *mdev, struct mana_ib_cq *cq) if (cq->queue.kmem) gdma_cq = cq->queue.kmem; else - gdma_cq = kzalloc_obj(*gdma_cq, GFP_KERNEL); + gdma_cq = kzalloc_obj(*gdma_cq); if (!gdma_cq) return -ENOMEM; diff --git a/drivers/infiniband/hw/mana/mr.c b/drivers/infiniband/hw/mana/mr.c index b67d94842721..9613b225dad4 100644 --- a/drivers/infiniband/hw/mana/mr.c +++ b/drivers/infiniband/hw/mana/mr.c @@ -137,7 +137,7 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length, if (access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -221,7 +221,7 @@ struct ib_mr *mana_ib_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 start, u64 leng if (access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -286,7 +286,7 @@ struct ib_mr *mana_ib_get_dma_mr(struct ib_pd *ibpd, int access_flags) if (access_flags & ~VALID_DMA_MR_FLAGS) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -360,7 +360,7 @@ struct ib_dm *mana_ib_alloc_dm(struct ib_device *ibdev, struct mana_ib_dm *dm; int err; - dm = kzalloc_obj(*dm, GFP_KERNEL); + dm = kzalloc_obj(*dm); if (!dm) return ERR_PTR(-ENOMEM); @@ -425,7 +425,7 @@ struct ib_mr *mana_ib_reg_dm_mr(struct ib_pd *ibpd, struct ib_dm *ibdm, if (attr->access_flags & ~VALID_MR_FLAGS) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 811b8e0eab67..82f84f7ad37a 100644 --- a/drivers/infiniband/hw/mana/qp.c +++ b/drivers/infiniband/hw/mana/qp.c @@ -164,7 +164,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd, ibdev_dbg(&mdev->ib_dev, "rx_hash_function %d port %d\n", ucmd.rx_hash_function, port); - mana_ind_table = kzalloc_objs(mana_handle_t, ind_tbl_size, GFP_KERNEL); + mana_ind_table = kzalloc_objs(mana_handle_t, ind_tbl_size); if (!mana_ind_table) { ret = -ENOMEM; goto fail; diff --git a/drivers/infiniband/hw/mana/wq.c b/drivers/infiniband/hw/mana/wq.c index 05789069369b..6206244f762e 100644 --- a/drivers/infiniband/hw/mana/wq.c +++ b/drivers/infiniband/hw/mana/wq.c @@ -25,7 +25,7 @@ struct ib_wq *mana_ib_create_wq(struct ib_pd *pd, return ERR_PTR(err); } - wq = kzalloc_obj(*wq, GFP_KERNEL); + wq = kzalloc_obj(*wq); if (!wq) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index 82c01b99b60d..e4c539dd2359 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c @@ -513,7 +513,7 @@ static int set_guid_rec(struct ib_device *ibdev, goto new_schedule; } - callback_context = kmalloc_obj(*callback_context, GFP_KERNEL); + callback_context = kmalloc_obj(*callback_context); if (!callback_context) { err = -ENOMEM; resched_delay = HZ * 5; @@ -754,7 +754,7 @@ static void alias_guid_work(struct work_struct *work) alias_guid); struct mlx4_ib_dev *dev = container_of(ib_sriov, struct mlx4_ib_dev, sriov); - rec = kzalloc_obj(*rec, GFP_KERNEL); + rec = kzalloc_obj(*rec); if (!rec) return; diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c index a71603353dbd..63a868a3822f 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -235,7 +235,7 @@ id_map_alloc(struct ib_device *ibdev, int slave_id, u32 sl_cm_id) struct id_map_entry *ent; struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; - ent = kmalloc_obj(struct id_map_entry, GFP_KERNEL); + ent = kmalloc_obj(struct id_map_entry); if (!ent) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ static int alloc_rej_tmout(struct mlx4_ib_sriov *sriov, u32 rem_pv_cm_id, int sl } xa_unlock(&sriov->xa_rej_tmout); - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index dc05b3d88fe4..d98892283065 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c @@ -300,7 +300,7 @@ static int mlx4_alloc_resize_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq, if (cq->resize_buf) return -EBUSY; - cq->resize_buf = kmalloc_obj(*cq->resize_buf, GFP_KERNEL); + cq->resize_buf = kmalloc_obj(*cq->resize_buf); if (!cq->resize_buf) return -ENOMEM; @@ -328,7 +328,7 @@ static int mlx4_alloc_resize_umem(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) return -EFAULT; - cq->resize_buf = kmalloc_obj(*cq->resize_buf, GFP_KERNEL); + cq->resize_buf = kmalloc_obj(*cq->resize_buf); if (!cq->resize_buf) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/doorbell.c b/drivers/infiniband/hw/mlx4/doorbell.c index 62f9c65ca140..8ba86b1e4e46 100644 --- a/drivers/infiniband/hw/mlx4/doorbell.c +++ b/drivers/infiniband/hw/mlx4/doorbell.c @@ -56,7 +56,7 @@ int mlx4_ib_db_map_user(struct ib_udata *udata, unsigned long virt, if (page->user_virt == (virt & PAGE_MASK)) goto found; - page = kmalloc_obj(*page, GFP_KERNEL); + page = kmalloc_obj(*page); if (!page) { err = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index ac58fc6e3730..723389353116 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -1133,8 +1133,8 @@ static void handle_slaves_guid_change(struct mlx4_ib_dev *dev, u32 port_num, if (!mlx4_is_mfunc(dev->dev) || !mlx4_is_master(dev->dev)) return; - in_mad = kmalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kmalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -1612,7 +1612,7 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, tun_qp = &ctx->qp[qp_type]; - tun_qp->ring = kzalloc_objs(struct mlx4_ib_buf, nmbr_bufs, GFP_KERNEL); + tun_qp->ring = kzalloc_objs(struct mlx4_ib_buf, nmbr_bufs); if (!tun_qp->ring) return -ENOMEM; @@ -1955,7 +1955,7 @@ static int alloc_pv_object(struct mlx4_ib_dev *dev, int slave, int port, struct mlx4_ib_demux_pv_ctx *ctx; *ret_ctx = NULL; - ctx = kzalloc_obj(struct mlx4_ib_demux_pv_ctx, GFP_KERNEL); + ctx = kzalloc_obj(struct mlx4_ib_demux_pv_ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 1dab78eb7a03..1109eac52890 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -461,8 +461,8 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, resp.response_length = offsetof(typeof(resp), response_length) + sizeof(resp.response_length); - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); err = -ENOMEM; if (!in_mad || !out_mad) goto out; @@ -660,8 +660,8 @@ static int ib_link_query_port(struct ib_device *ibdev, u32 port, int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -839,8 +839,8 @@ int __mlx4_ib_query_gid(struct ib_device *ibdev, u32 port, int index, int clear = 0; int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -908,8 +908,8 @@ static int mlx4_ib_query_sl2vl(struct ib_device *ibdev, u32 port, return 0; } - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -962,8 +962,8 @@ int __mlx4_ib_query_pkey(struct ib_device *ibdev, u32 port, u16 index, int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -1267,7 +1267,7 @@ static int add_gid_entry(struct ib_qp *ibqp, union ib_gid *gid) struct mlx4_ib_dev *mdev = to_mdev(ibqp->device); struct mlx4_ib_gid_entry *ge; - ge = kzalloc_obj(*ge, GFP_KERNEL); + ge = kzalloc_obj(*ge); if (!ge) return -ENOMEM; @@ -1707,7 +1707,7 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp, memset(type, 0, sizeof(type)); - mflow = kzalloc_obj(*mflow, GFP_KERNEL); + mflow = kzalloc_obj(*mflow); if (!mflow) { err = -ENOMEM; goto err_free; @@ -1844,7 +1844,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) if (mdev->dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { - ib_steering = kmalloc_obj(*ib_steering, GFP_KERNEL); + ib_steering = kmalloc_obj(*ib_steering); if (!ib_steering) return -ENOMEM; } @@ -1978,8 +1978,8 @@ static int init_node_data(struct mlx4_ib_dev *dev) int mad_ifc_flags = MLX4_MAD_IFC_IGNORE_KEYS; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -2157,7 +2157,7 @@ static int __mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev, if (!port) num_counters += ARRAY_SIZE(diag_device_only); - *pdescs = kzalloc_objs(struct rdma_stat_desc, num_counters, GFP_KERNEL); + *pdescs = kzalloc_objs(struct rdma_stat_desc, num_counters); if (!*pdescs) return -ENOMEM; @@ -2730,7 +2730,7 @@ static int mlx4_ib_probe(struct auxiliary_device *adev, counter_index = mlx4_get_default_counter_index(dev, i + 1); } - new_counter_index = kmalloc_obj(*new_counter_index, GFP_KERNEL); + new_counter_index = kmalloc_obj(*new_counter_index); if (!new_counter_index) { err = -ENOMEM; if (allocated) diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c index ef4ab3bc6ffd..dc7c0daaaba5 100644 --- a/drivers/infiniband/hw/mlx4/mcg.c +++ b/drivers/infiniband/hw/mlx4/mcg.c @@ -824,7 +824,7 @@ static struct mcast_group *acquire_group(struct mlx4_ib_demux_ctx *ctx, if (!create) return ERR_PTR(-ENOENT); - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return ERR_PTR(-ENOMEM); @@ -946,7 +946,7 @@ int mlx4_ib_mcg_multiplex_handler(struct ib_device *ibdev, int port, may_create = 1; fallthrough; case IB_SA_METHOD_DELETE: - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -1150,7 +1150,7 @@ void mlx4_ib_mcg_port_cleanup(struct mlx4_ib_demux_ctx *ctx, int destroy_wq) return; } - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) { ctx->flushing = 0; return; @@ -1211,7 +1211,7 @@ static int push_deleteing_req(struct mcast_group *group, int slave) if (!group->func[slave].join_state) return 0; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 27038065ee67..77a72d2b0dd2 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c @@ -60,7 +60,7 @@ struct ib_mr *mlx4_ib_get_dma_mr(struct ib_pd *pd, int acc) struct mlx4_ib_mr *mr; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -151,7 +151,7 @@ struct ib_mr *mlx4_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -394,7 +394,7 @@ struct ib_mr *mlx4_ib_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, max_num_sg > MLX4_MAX_FAST_REG_PAGES) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index c7dd9d6e4f8f..1cb890d3d93c 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -472,12 +472,12 @@ static int alloc_proxy_bufs(struct ib_device *dev, struct mlx4_ib_qp *qp) int i; qp->sqp_proxy_rcv = - kmalloc_objs(struct mlx4_ib_buf, qp->rq.wqe_cnt, GFP_KERNEL); + kmalloc_objs(struct mlx4_ib_buf, qp->rq.wqe_cnt); if (!qp->sqp_proxy_rcv) return -ENOMEM; for (i = 0; i < qp->rq.wqe_cnt; i++) { qp->sqp_proxy_rcv[i].addr = - kmalloc_obj(struct mlx4_ib_proxy_sqp_hdr, GFP_KERNEL); + kmalloc_obj(struct mlx4_ib_proxy_sqp_hdr); if (!qp->sqp_proxy_rcv[i].addr) goto err; qp->sqp_proxy_rcv[i].map = @@ -681,7 +681,7 @@ static int create_qp_rss(struct mlx4_ib_dev *dev, qp->mtt = (to_mqp( (struct ib_qp *)init_attr->rwq_ind_tbl->ind_tbl[0]))->mtt; - qp->rss_ctx = kzalloc_obj(*qp->rss_ctx, GFP_KERNEL); + qp->rss_ctx = kzalloc_obj(*qp->rss_ctx); if (!qp->rss_ctx) { err = -ENOMEM; goto err_qp_alloc; @@ -791,7 +791,7 @@ static int mlx4_ib_alloc_wqn(struct mlx4_ib_ucontext *context, struct mlx4_wqn_range, list); if (!range || (range->refcount == range->size) || range->dirty) { - range = kzalloc_obj(*range, GFP_KERNEL); + range = kzalloc_obj(*range); if (!range) { err = -ENOMEM; goto out; @@ -1049,7 +1049,7 @@ static int create_qp_common(struct ib_pd *pd, struct ib_qp_init_attr *init_attr, qp_type == MLX4_IB_QPT_GSI || (qp_type & (MLX4_IB_QPT_PROXY_SMI | MLX4_IB_QPT_PROXY_SMI_OWNER | MLX4_IB_QPT_PROXY_GSI | MLX4_IB_QPT_TUN_SMI_OWNER))) { - qp->sqp = kzalloc_obj(struct mlx4_ib_sqp, GFP_KERNEL); + qp->sqp = kzalloc_obj(struct mlx4_ib_sqp); if (!qp->sqp) return -ENOMEM; } @@ -1970,7 +1970,7 @@ static int create_qp_lb_counter(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp) if (err) return err; - new_counter_index = kmalloc_obj(*new_counter_index, GFP_KERNEL); + new_counter_index = kmalloc_obj(*new_counter_index); if (!new_counter_index) { mlx4_counter_free(dev->dev, tmp_idx); return -ENOMEM; @@ -2163,7 +2163,7 @@ static int __mlx4_ib_modify_qp(void *src, enum mlx4_ib_source_type src_type, IB_LINK_LAYER_ETHERNET) return -ENOTSUPP; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return -ENOMEM; @@ -4165,7 +4165,7 @@ struct ib_wq *mlx4_ib_create_wq(struct ib_pd *pd, return ERR_PTR(-EOPNOTSUPP); } - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c index ba0356aa3038..cd9163c5c872 100644 --- a/drivers/infiniband/hw/mlx4/sysfs.c +++ b/drivers/infiniband/hw/mlx4/sysfs.c @@ -500,12 +500,12 @@ alloc_group_attrs(ssize_t (*show)(struct mlx4_port *, struct port_table_attribute *element; int i; - tab_attr = kzalloc_objs(struct attribute *, 1 + len, GFP_KERNEL); + tab_attr = kzalloc_objs(struct attribute *, 1 + len); if (!tab_attr) return NULL; for (i = 0; i < len; i++) { - element = kzalloc_obj(struct port_table_attribute, GFP_KERNEL); + element = kzalloc_obj(struct port_table_attribute); if (!element) goto err; if (snprintf(element->name, sizeof (element->name), @@ -629,7 +629,7 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave) int is_eth = rdma_port_get_link_layer(&dev->ib_dev, port_num) == IB_LINK_LAYER_ETHERNET; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/cong.c b/drivers/infiniband/hw/mlx5/cong.c index fb2bc450f4ff..d0edf83a2f20 100644 --- a/drivers/infiniband/hw/mlx5/cong.c +++ b/drivers/infiniband/hw/mlx5/cong.c @@ -449,7 +449,7 @@ void mlx5_ib_init_cong_debugfs(struct mlx5_ib_dev *dev, u32 port_num) !MLX5_CAP_GEN(mdev, cc_modify_allowed)) goto put_mdev; - dbg_cc_params = kzalloc_obj(*dbg_cc_params, GFP_KERNEL); + dbg_cc_params = kzalloc_obj(*dbg_cc_params); if (!dbg_cc_params) goto err; diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c index 10feeb77d569..d1ad88908634 100644 --- a/drivers/infiniband/hw/mlx5/counters.c +++ b/drivers/infiniband/hw/mlx5/counters.c @@ -863,7 +863,7 @@ skip_non_qcounters: if (!cnts->descs) return -ENOMEM; - cnts->offsets = kzalloc_objs(*cnts->offsets, num_counters, GFP_KERNEL); + cnts->offsets = kzalloc_objs(*cnts->offsets, num_counters); if (!cnts->offsets) goto err; diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index c0e06c05555b..d0cd3f805bcb 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -1210,7 +1210,7 @@ static int resize_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq, { int err; - cq->resize_buf = kzalloc_obj(*cq->resize_buf, GFP_KERNEL); + cq->resize_buf = kzalloc_obj(*cq->resize_buf); if (!cq->resize_buf) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/data_direct.c b/drivers/infiniband/hw/mlx5/data_direct.c index a93e31e23dc2..8e89dbe40c23 100644 --- a/drivers/infiniband/hw/mlx5/data_direct.c +++ b/drivers/infiniband/hw/mlx5/data_direct.c @@ -83,7 +83,7 @@ int mlx5_data_direct_ib_reg(struct mlx5_ib_dev *ibdev, char *vuid) struct mlx5_data_direct_registration *reg; struct mlx5_data_direct_dev *dev; - reg = kzalloc_obj(*reg, GFP_KERNEL); + reg = kzalloc_obj(*reg); if (!reg) return -ENOMEM; @@ -160,7 +160,7 @@ static int mlx5_data_direct_probe(struct pci_dev *pdev, const struct pci_device_ struct mlx5_data_direct_dev *dev; int err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index 5e1cefeaa494..0066b2738ac8 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -1950,7 +1950,7 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table, event = xa_load(&devx_event_table->event_xa, key_level1); if (!event) { - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) return -ENOMEM; @@ -1972,7 +1972,7 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table, obj_event = xa_load(&event->object_ids, key_level2); if (!obj_event) { - obj_event = kzalloc_obj(*obj_event, GFP_KERNEL); + obj_event = kzalloc_obj(*obj_event); if (!obj_event) /* Level1 is valid for future use, no need to free */ return -ENOMEM; @@ -2697,7 +2697,7 @@ void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile) int head = 0; int tail = 0; - async_cmd = kzalloc_objs(*async_cmd, MAX_ASYNC_CMDS, GFP_KERNEL); + async_cmd = kzalloc_objs(*async_cmd, MAX_ASYNC_CMDS); if (!async_cmd) return; diff --git a/drivers/infiniband/hw/mlx5/dm.c b/drivers/infiniband/hw/mlx5/dm.c index db45ff9b64a8..9972f38ba88a 100644 --- a/drivers/infiniband/hw/mlx5/dm.c +++ b/drivers/infiniband/hw/mlx5/dm.c @@ -285,7 +285,7 @@ static struct ib_dm *handle_alloc_dm_memic(struct ib_ucontext *ctx, if (!dm_db || !MLX5_CAP_DEV_MEM(dm_db->dev, memic)) return ERR_PTR(-EOPNOTSUPP); - dm = kzalloc_obj(*dm, GFP_KERNEL); + dm = kzalloc_obj(*dm); if (!dm) return ERR_PTR(-ENOMEM); @@ -382,7 +382,7 @@ static struct ib_dm *handle_alloc_dm_sw_icm(struct ib_ucontext *ctx, return ERR_PTR(-EOPNOTSUPP); } - dm = kzalloc_obj(*dm, GFP_KERNEL); + dm = kzalloc_obj(*dm); if (!dm) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx5/doorbell.c b/drivers/infiniband/hw/mlx5/doorbell.c index 277e16a2c714..bd68fcf011f4 100644 --- a/drivers/infiniband/hw/mlx5/doorbell.c +++ b/drivers/infiniband/hw/mlx5/doorbell.c @@ -58,7 +58,7 @@ int mlx5_ib_db_map_user(struct mlx5_ib_ucontext *context, unsigned long virt, (page->user_virt == (virt & PAGE_MASK))) goto found; - page = kmalloc_obj(*page, GFP_KERNEL); + page = kmalloc_obj(*page); if (!page) { err = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c index 3c23bf34b3ab..2b4de32ad600 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -1021,7 +1021,7 @@ static struct mlx5_per_qp_opfc *get_per_qp_opfc(struct xarray *qpn_opfc_xa, per_qp_opfc = xa_load(qpn_opfc_xa, qp_num); if (per_qp_opfc) return per_qp_opfc; - per_qp_opfc = kzalloc_obj(*per_qp_opfc, GFP_KERNEL); + per_qp_opfc = kzalloc_obj(*per_qp_opfc); if (!per_qp_opfc) return NULL; @@ -1057,7 +1057,7 @@ static int add_op_fc_rules(struct mlx5_ib_dev *dev, opfc->fc = fc_arr[type]; - spec = kzalloc_objs(*spec, MAX_OPFC_RULES, GFP_KERNEL); + spec = kzalloc_objs(*spec, MAX_OPFC_RULES); if (!spec) { err = -ENOMEM; goto null_fc; @@ -1231,7 +1231,7 @@ int mlx5_ib_fs_add_op_fc(struct mlx5_ib_dev *dev, u32 port_num, struct mlx5_ib_flow_prio *prio; struct mlx5_flow_spec *spec; - spec = kzalloc_objs(*spec, MAX_OPFC_RULES, GFP_KERNEL); + spec = kzalloc_objs(*spec, MAX_OPFC_RULES); if (!spec) return -ENOMEM; @@ -1532,8 +1532,8 @@ static struct mlx5_ib_flow_handler *_create_flow_rule(struct mlx5_ib_dev *dev, if (dev->is_rep && is_egress) return ERR_PTR(-EINVAL); - spec = kvzalloc_obj(*spec, GFP_KERNEL); - handler = kzalloc_obj(*handler, GFP_KERNEL); + spec = kvzalloc_obj(*spec); + handler = kzalloc_obj(*handler); if (!handler || !spec) { err = -ENOMEM; goto free; @@ -1792,7 +1792,7 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, goto free_ucmd; } - dst = kzalloc_obj(*dst, GFP_KERNEL); + dst = kzalloc_obj(*dst); if (!dst) { err = -ENOMEM; goto free_ucmd; @@ -2060,8 +2060,8 @@ _create_raw_flow_rule(struct mlx5_ib_dev *dev, struct mlx5_flow_table *ft = ft_prio->flow_table; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); - handler = kzalloc_obj(*handler, GFP_KERNEL); + spec = kvzalloc_obj(*spec); + handler = kzalloc_obj(*handler); if (!handler || !spec) { err = -ENOMEM; goto free; @@ -2153,7 +2153,7 @@ static struct mlx5_ib_flow_handler *raw_fs_rule_add( if (fs_matcher->priority > MLX5_IB_FLOW_LAST_PRIO) return ERR_PTR(-ENOMEM); - dst = kzalloc_objs(*dst, 2, GFP_KERNEL); + dst = kzalloc_objs(*dst, 2); if (!dst) return ERR_PTR(-ENOMEM); @@ -3080,7 +3080,7 @@ mlx5_ib_create_modify_header(struct mlx5_ib_dev *dev, if (ret) return ERR_PTR(-EINVAL); - maction = kzalloc_obj(*maction, GFP_KERNEL); + maction = kzalloc_obj(*maction); if (!maction) return ERR_PTR(-ENOMEM); @@ -3479,7 +3479,7 @@ int mlx5_ib_fs_init(struct mlx5_ib_dev *dev) { int i, j; - dev->flow_db = kzalloc_obj(*dev->flow_db, GFP_KERNEL); + dev->flow_db = kzalloc_obj(*dev->flow_db); if (!dev->flow_db) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c index f572d75f6fd6..ee7463815e77 100644 --- a/drivers/infiniband/hw/mlx5/gsi.c +++ b/drivers/infiniband/hw/mlx5/gsi.c @@ -104,7 +104,7 @@ int mlx5_ib_create_gsi(struct ib_pd *pd, struct mlx5_ib_qp *mqp, } gsi = &mqp->gsi; - gsi->tx_qps = kzalloc_objs(*gsi->tx_qps, num_qps, GFP_KERNEL); + gsi->tx_qps = kzalloc_objs(*gsi->tx_qps, num_qps); if (!gsi->tx_qps) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c index 72c870f4f54b..621834d75205 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.c +++ b/drivers/infiniband/hw/mlx5/ib_rep.c @@ -158,7 +158,7 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) goto release_transport; } - ibdev->port = kzalloc_objs(*ibdev->port, num_ports, GFP_KERNEL); + ibdev->port = kzalloc_objs(*ibdev->port, num_ports); if (!ibdev->port) { ret = -ENOMEM; goto fail_port; diff --git a/drivers/infiniband/hw/mlx5/ib_virt.c b/drivers/infiniband/hw/mlx5/ib_virt.c index beb99db3f76f..2c81a4e6712e 100644 --- a/drivers/infiniband/hw/mlx5/ib_virt.c +++ b/drivers/infiniband/hw/mlx5/ib_virt.c @@ -55,7 +55,7 @@ int mlx5_ib_get_vf_config(struct ib_device *device, int vf, u32 port, struct mlx5_hca_vport_context *rep; int err; - rep = kzalloc_obj(*rep, GFP_KERNEL); + rep = kzalloc_obj(*rep); if (!rep) return -ENOMEM; @@ -98,7 +98,7 @@ int mlx5_ib_set_vf_link_state(struct ib_device *device, int vf, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc_obj(*in, GFP_KERNEL); + in = kzalloc_obj(*in); if (!in) return -ENOMEM; @@ -157,7 +157,7 @@ static int set_vf_node_guid(struct ib_device *device, int vf, u32 port, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc_obj(*in, GFP_KERNEL); + in = kzalloc_obj(*in); if (!in) return -ENOMEM; @@ -181,7 +181,7 @@ static int set_vf_port_guid(struct ib_device *device, int vf, u32 port, struct mlx5_vf_context *vfs_ctx = mdev->priv.sriov.vfs_ctx; int err; - in = kzalloc_obj(*in, GFP_KERNEL); + in = kzalloc_obj(*in); if (!in) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx5/macsec.c b/drivers/infiniband/hw/mlx5/macsec.c index f93ce56d7515..b52abe8c47c4 100644 --- a/drivers/infiniband/hw/mlx5/macsec.c +++ b/drivers/infiniband/hw/mlx5/macsec.c @@ -52,7 +52,7 @@ static struct mlx5_macsec_device *get_macsec_device(void *macdev, if (macsec_device) return macsec_device; - macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device); if (!macsec_device) return NULL; @@ -82,7 +82,7 @@ static void mlx5_macsec_save_roce_gid(struct mlx5_macsec_device *macsec_device, { struct mlx5_roce_gids *roce_gids; - roce_gids = kzalloc_obj(*roce_gids, GFP_KERNEL); + roce_gids = kzalloc_obj(*roce_gids); if (!roce_gids) return; diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c index 41dd186deffd..8925331855ff 100644 --- a/drivers/infiniband/hw/mlx5/mad.c +++ b/drivers/infiniband/hw/mlx5/mad.c @@ -367,8 +367,8 @@ int mlx5_query_ext_port_caps(struct mlx5_ib_dev *dev, unsigned int port) int err = -ENOMEM; u16 packet_error; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -395,7 +395,7 @@ static int mlx5_query_mad_ifc_smp_attr_node_info(struct ib_device *ibdev, struct ib_smp *in_mad; int err; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); if (!in_mad) return -ENOMEM; @@ -415,7 +415,7 @@ int mlx5_query_mad_ifc_system_image_guid(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad); if (!out_mad) return -ENOMEM; @@ -437,7 +437,7 @@ int mlx5_query_mad_ifc_max_pkeys(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad); if (!out_mad) return -ENOMEM; @@ -459,7 +459,7 @@ int mlx5_query_mad_ifc_vendor_id(struct ib_device *ibdev, struct ib_smp *out_mad; int err; - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + out_mad = kmalloc_obj(*out_mad); if (!out_mad) return -ENOMEM; @@ -481,8 +481,8 @@ int mlx5_query_mad_ifc_node_desc(struct mlx5_ib_dev *dev, char *node_desc) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -506,8 +506,8 @@ int mlx5_query_mad_ifc_node_guid(struct mlx5_ib_dev *dev, __be64 *node_guid) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -532,8 +532,8 @@ int mlx5_query_mad_ifc_pkey(struct ib_device *ibdev, u32 port, u16 index, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -561,8 +561,8 @@ int mlx5_query_mad_ifc_gids(struct ib_device *ibdev, u32 port, int index, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -604,8 +604,8 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u32 port, int ext_active_speed; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index a5425f6d5527..ba89b03d36f9 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1460,7 +1460,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u32 port, int err; u16 ib_link_width_oper; - rep = kzalloc_obj(*rep, GFP_KERNEL); + rep = kzalloc_obj(*rep); if (!rep) { err = -ENOMEM; goto out; @@ -4042,7 +4042,7 @@ static int mlx5_ib_init_multiport_master(struct mlx5_ib_dev *dev) /* build a stub multiport info struct for the native port. */ if (i == port_num) { - mpi = kzalloc_obj(*mpi, GFP_KERNEL); + mpi = kzalloc_obj(*mpi); if (!mpi) { mutex_unlock(&mlx5_ib_multiport_mutex); mlx5_nic_vport_disable_roce(dev->mdev); @@ -4148,7 +4148,7 @@ alloc_var_entry(struct mlx5_ib_ucontext *c) int err; var_table = &to_mdev(c->ibucontext.device)->var_table; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -4269,7 +4269,7 @@ alloc_uar_entry(struct mlx5_ib_ucontext *c, u32 uar_index; int err; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -5250,7 +5250,7 @@ static int mlx5r_mp_probe(struct auxiliary_device *adev, bool bound = false; int err; - mpi = kzalloc_obj(*mpi, GFP_KERNEL); + mpi = kzalloc_obj(*mpi); if (!mpi) return -ENOMEM; @@ -5326,7 +5326,7 @@ static int mlx5r_probe(struct auxiliary_device *adev, goto fail; } - dev->port = kzalloc_objs(*dev->port, num_ports, GFP_KERNEL); + dev->port = kzalloc_objs(*dev->port, num_ports); if (!dev->port) { ret = -ENOMEM; goto fail; diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 0444be024ff9..16b48377f825 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -742,7 +742,7 @@ static struct mlx5_ib_mr *_mlx5_mr_cache_alloc(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -867,7 +867,7 @@ static int mlx5r_mkeys_init(struct mlx5_cache_ent *ent) { struct mlx5_mkeys_page *page; - page = kzalloc_obj(*page, GFP_KERNEL); + page = kzalloc_obj(*page); if (!page) return -ENOMEM; INIT_LIST_HEAD(&ent->mkeys_queue.pages_list); @@ -897,7 +897,7 @@ mlx5r_cache_create_ent_locked(struct mlx5_ib_dev *dev, int order; int ret; - ent = kzalloc_obj(*ent, GFP_KERNEL); + ent = kzalloc_obj(*ent); if (!ent) return ERR_PTR(-ENOMEM); @@ -1059,7 +1059,7 @@ struct ib_mr *mlx5_ib_get_dma_mr(struct ib_pd *pd, int acc) u32 *in; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1207,7 +1207,7 @@ reg_create_crossing_vhca_mr(struct ib_pd *pd, u64 iova, u64 length, int access_f if (!MLX5_CAP_GEN(dev->mdev, crossing_vhca_mkey)) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1272,7 +1272,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, struct ib_umem *umem, if (!page_size) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1370,7 +1370,7 @@ static struct ib_mr *mlx5_ib_get_dm_mr(struct ib_pd *pd, u64 start_addr, u32 *in; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -2343,7 +2343,7 @@ static struct mlx5_ib_mr *mlx5_ib_alloc_pi_mr(struct ib_pd *pd, u32 *in; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -2400,7 +2400,7 @@ static int mlx5_alloc_integrity_descs(struct ib_pd *pd, struct mlx5_ib_mr *mr, void *mkc; int err; - mr->sig = kzalloc_obj(*mr->sig, GFP_KERNEL); + mr->sig = kzalloc_obj(*mr->sig); if (!mr->sig) return -ENOMEM; @@ -2480,7 +2480,7 @@ static struct ib_mr *__mlx5_ib_alloc_mr(struct ib_pd *pd, u32 *in; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index ed73d3e82ea5..090a05743e09 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -1092,7 +1092,7 @@ next_mr: continue; } - frame = kzalloc_obj(*frame, GFP_KERNEL); + frame = kzalloc_obj(*frame); if (!frame) { ret = -ENOMEM; goto end; diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 762a2dfc4455..ccb59ac9860c 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -5488,7 +5488,7 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd, dev = to_mdev(pd->device); switch (init_attr->wq_type) { case IB_WQT_RQ: - rwq = kzalloc_obj(*rwq, GFP_KERNEL); + rwq = kzalloc_obj(*rwq); if (!rwq) return ERR_PTR(-ENOMEM); err = prepare_user_rq(pd, init_attr, udata, rwq); diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c index 6e79e7a1015e..17e018554d81 100644 --- a/drivers/infiniband/hw/mlx5/srq.c +++ b/drivers/infiniband/hw/mlx5/srq.c @@ -358,7 +358,7 @@ int mlx5_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) int ret; struct mlx5_srq_attr *out; - out = kzalloc_obj(*out, GFP_KERNEL); + out = kzalloc_obj(*out); if (!out) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c index 2532ea4e1278..005902d47eb6 100644 --- a/drivers/infiniband/hw/mthca/mthca_allocator.c +++ b/drivers/infiniband/hw/mthca/mthca_allocator.c @@ -157,7 +157,7 @@ int mthca_array_init(struct mthca_array *array, int nent) int npage = (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; int i; - array->page_list = kmalloc_objs(*array->page_list, npage, GFP_KERNEL); + array->page_list = kmalloc_objs(*array->page_list, npage); if (!array->page_list) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c index 5f109a116390..70adcd54e20e 100644 --- a/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/drivers/infiniband/hw/mthca/mthca_eq.c @@ -479,7 +479,7 @@ static int mthca_create_eq(struct mthca_dev *dev, eq->nent = roundup_pow_of_two(max(nent, 2)); npages = ALIGN(eq->nent * MTHCA_EQ_ENTRY_SIZE, PAGE_SIZE) / PAGE_SIZE; - eq->page_list = kmalloc_objs(*eq->page_list, npages, GFP_KERNEL); + eq->page_list = kmalloc_objs(*eq->page_list, npages); if (!eq->page_list) goto err_out; diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c index 8df1bdd1a1bf..6d8d436de2f3 100644 --- a/drivers/infiniband/hw/mthca/mthca_mad.c +++ b/drivers/infiniband/hw/mthca/mthca_mad.c @@ -52,7 +52,7 @@ static int mthca_update_rate(struct mthca_dev *dev, u8 port_num) struct ib_port_attr *tprops = NULL; int ret; - tprops = kmalloc_obj(*tprops, GFP_KERNEL); + tprops = kmalloc_obj(*tprops); if (!tprops) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c index e59df6ed0f21..6f4455f123b1 100644 --- a/drivers/infiniband/hw/mthca/mthca_memfree.c +++ b/drivers/infiniband/hw/mthca/mthca_memfree.c @@ -707,7 +707,7 @@ int mthca_init_db_tab(struct mthca_dev *dev) if (!mthca_is_memfree(dev)) return 0; - dev->db_tab = kmalloc_obj(*dev->db_tab, GFP_KERNEL); + dev->db_tab = kmalloc_obj(*dev->db_tab); if (!dev->db_tab) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index eae6c92e7515..38a2fecf33f8 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c @@ -212,7 +212,7 @@ static struct mthca_mtt *__mthca_alloc_mtt(struct mthca_dev *dev, int size, if (size <= 0) return ERR_PTR(-EINVAL); - mtt = kmalloc_obj(*mtt, GFP_KERNEL); + mtt = kmalloc_obj(*mtt); if (!mtt) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c index 230c073dd11f..5a0643ddefdd 100644 --- a/drivers/infiniband/hw/mthca/mthca_profile.c +++ b/drivers/infiniband/hw/mthca/mthca_profile.c @@ -77,7 +77,7 @@ s64 mthca_make_profile(struct mthca_dev *dev, struct mthca_resource *profile; int i, j; - profile = kzalloc_objs(*profile, MTHCA_RES_NUM, GFP_KERNEL); + profile = kzalloc_objs(*profile, MTHCA_RES_NUM); if (!profile) return -ENOMEM; diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 88ce64eb4704..ef0635064fba 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -61,8 +61,8 @@ static int mthca_query_device(struct ib_device *ibdev, struct ib_device_attr *pr if (uhw->inlen || uhw->outlen) return -EINVAL; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -125,8 +125,8 @@ static int mthca_query_port(struct ib_device *ibdev, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -221,8 +221,8 @@ static int mthca_query_pkey(struct ib_device *ibdev, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -250,8 +250,8 @@ static int mthca_query_gid(struct ib_device *ibdev, u32 port, struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; @@ -516,7 +516,7 @@ static int mthca_create_qp(struct ib_qp *ibqp, case IB_QPT_SMI: case IB_QPT_GSI: { - qp->sqp = kzalloc_obj(struct mthca_sqp, GFP_KERNEL); + qp->sqp = kzalloc_obj(struct mthca_sqp); if (!qp->sqp) return -ENOMEM; @@ -806,7 +806,7 @@ static struct ib_mr *mthca_get_dma_mr(struct ib_pd *pd, int acc) struct mthca_mr *mr; int err; - mr = kmalloc_obj(*mr, GFP_KERNEL); + mr = kmalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -853,7 +853,7 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, } else if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) return ERR_PTR(-EFAULT); - mr = kmalloc_obj(*mr, GFP_KERNEL); + mr = kmalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -998,8 +998,8 @@ static int mthca_init_node_data(struct mthca_dev *dev) struct ib_smp *out_mad; int err = -ENOMEM; - in_mad = kzalloc_obj(*in_mad, GFP_KERNEL); - out_mad = kmalloc_obj(*out_mad, GFP_KERNEL); + in_mad = kzalloc_obj(*in_mad); + out_mad = kmalloc_obj(*out_mad); if (!in_mad || !out_mad) goto out; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index c6a55323408a..006ef2e6b5f3 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -355,7 +355,7 @@ static void *ocrdma_init_emb_mqe(u8 opcode, u32 cmd_len) { struct ocrdma_mqe *mqe; - mqe = kzalloc_obj(struct ocrdma_mqe, GFP_KERNEL); + mqe = kzalloc_obj(struct ocrdma_mqe); if (!mqe) return NULL; mqe->hdr.spcl_sge_cnt_emb |= @@ -1289,7 +1289,7 @@ int ocrdma_mbx_rdma_stats(struct ocrdma_dev *dev, bool reset) struct ocrdma_rdma_stats_resp *old_stats; int status; - old_stats = kmalloc_obj(*old_stats, GFP_KERNEL); + old_stats = kmalloc_obj(*old_stats); if (old_stats == NULL) return -ENOMEM; @@ -1332,7 +1332,7 @@ static int ocrdma_mbx_get_ctrl_attribs(struct ocrdma_dev *dev) struct ocrdma_get_ctrl_attribs_rsp *ctrl_attr_rsp; struct mgmt_hba_attribs *hba_attribs; - mqe = kzalloc_obj(struct ocrdma_mqe, GFP_KERNEL); + mqe = kzalloc_obj(struct ocrdma_mqe); if (!mqe) return status; @@ -1592,7 +1592,7 @@ void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev) { int status; - dev->pd_mgr = kzalloc_obj(struct ocrdma_pd_resource_mgr, GFP_KERNEL); + dev->pd_mgr = kzalloc_obj(struct ocrdma_pd_resource_mgr); if (!dev->pd_mgr) return; @@ -3081,7 +3081,7 @@ static int ocrdma_create_eqs(struct ocrdma_dev *dev) if (!num_eq) return -EINVAL; - dev->eq_tbl = kzalloc_objs(struct ocrdma_eq, num_eq, GFP_KERNEL); + dev->eq_tbl = kzalloc_objs(struct ocrdma_eq, num_eq); if (!dev->eq_tbl) return -ENOMEM; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 16e3e0ff97b8..3a88103c1fc4 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -270,7 +270,7 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) return NULL; } - dev->mbx_cmd = kzalloc_obj(struct ocrdma_mqe_emb_cmd, GFP_KERNEL); + dev->mbx_cmd = kzalloc_obj(struct ocrdma_mqe_emb_cmd); if (!dev->mbx_cmd) goto init_err; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index e9840337e694..4498ef7810ff 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -195,7 +195,7 @@ static int ocrdma_add_mmap(struct ocrdma_ucontext *uctx, u64 phy_addr, { struct ocrdma_mm *mm; - mm = kzalloc_obj(*mm, GFP_KERNEL); + mm = kzalloc_obj(*mm); if (mm == NULL) return -ENOMEM; mm->key.phy_addr = phy_addr; @@ -727,7 +727,7 @@ struct ib_mr *ocrdma_get_dma_mr(struct ib_pd *ibpd, int acc) return ERR_PTR(-EINVAL); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -863,7 +863,7 @@ struct ib_mr *ocrdma_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(status); mr->umem = ib_umem_get(ibpd->device, start, len, acc); @@ -1255,7 +1255,7 @@ static void ocrdma_set_qp_db(struct ocrdma_dev *dev, struct ocrdma_qp *qp, static int ocrdma_alloc_wr_id_tbl(struct ocrdma_qp *qp) { qp->wqe_wr_id_tbl = - kzalloc_objs(*(qp->wqe_wr_id_tbl), qp->sq.max_cnt, GFP_KERNEL); + kzalloc_objs(*(qp->wqe_wr_id_tbl), qp->sq.max_cnt); if (qp->wqe_wr_id_tbl == NULL) return -ENOMEM; qp->rqe_wr_id_tbl = @@ -2910,7 +2910,7 @@ struct ib_mr *ocrdma_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, if (max_num_sg > dev->attr.max_pages_per_frmr) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index 8b074d8982e5..8f7f01e8fe08 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -333,7 +333,7 @@ static int qedr_alloc_resources(struct qedr_dev *dev) __le16 *cons_pi; int i, rc; - dev->sgid_tbl = kzalloc_objs(union ib_gid, QEDR_MAX_SGID, GFP_KERNEL); + dev->sgid_tbl = kzalloc_objs(union ib_gid, QEDR_MAX_SGID); if (!dev->sgid_tbl) return -ENOMEM; @@ -350,13 +350,13 @@ static int qedr_alloc_resources(struct qedr_dev *dev) } /* Allocate Status blocks for CNQ */ - dev->sb_array = kzalloc_objs(*dev->sb_array, dev->num_cnq, GFP_KERNEL); + dev->sb_array = kzalloc_objs(*dev->sb_array, dev->num_cnq); if (!dev->sb_array) { rc = -ENOMEM; goto err_destroy_wq; } - dev->cnq_array = kzalloc_objs(*dev->cnq_array, dev->num_cnq, GFP_KERNEL); + dev->cnq_array = kzalloc_objs(*dev->cnq_array, dev->num_cnq); if (!dev->cnq_array) { rc = -ENOMEM; goto err2; @@ -786,7 +786,7 @@ static int qedr_init_hw(struct qedr_dev *dev) int rc = 0; int i; - in_params = kzalloc_obj(*in_params, GFP_KERNEL); + in_params = kzalloc_obj(*in_params); if (!in_params) { rc = -ENOMEM; goto out; diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c index ff1f138ec34f..8d38e74f1b12 100644 --- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c @@ -560,7 +560,7 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) if (!laddr->sin_port || !raddr->sin_port) return -EINVAL; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; @@ -672,7 +672,7 @@ int qedr_iw_create_listen(struct iw_cm_id *cm_id, int backlog) DP_DEBUG(dev, QEDR_MSG_IWARP, "Create Listener address: %pISpc\n", &cm_id->local_addr); - listener = kzalloc_obj(*listener, GFP_KERNEL); + listener = kzalloc_obj(*listener); if (!listener) return -ENOMEM; diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c index f0e0ae154302..c7273ed7aa6c 100644 --- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c @@ -339,10 +339,10 @@ int qedr_create_gsi_qp(struct qedr_dev *dev, struct ib_qp_init_attr *attrs, qp->rq.max_wr = attrs->cap.max_recv_wr; qp->sq.max_wr = attrs->cap.max_send_wr; - qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr, GFP_KERNEL); + qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr); if (!qp->rqe_wr_id) goto err; - qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr, GFP_KERNEL); + qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr); if (!qp->wqe_wr_id) goto err; diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index ed7d4fc20b21..33b4a0e6d3a8 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -296,7 +296,7 @@ int qedr_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata) ctx->dpi_addr = oparams.dpi_addr; ctx->dpi_phys_addr = oparams.dpi_phys_addr; ctx->dpi_size = oparams.dpi_size; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { rc = -ENOMEM; goto err; @@ -761,7 +761,7 @@ static int qedr_init_user_db_rec(struct ib_udata *udata, return -ENOMEM; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) goto err_free_db_data; @@ -820,7 +820,7 @@ static inline int qedr_init_user_queue(struct ib_udata *udata, qedr_populate_pbls(dev, q->umem, q->pbl_tbl, &q->pbl_info, FW_PAGE_SHIFT); } else { - q->pbl_tbl = kzalloc_obj(*q->pbl_tbl, GFP_KERNEL); + q->pbl_tbl = kzalloc_obj(*q->pbl_tbl); if (!q->pbl_tbl) { rc = -ENOMEM; goto err0; @@ -2187,7 +2187,7 @@ static int qedr_create_kernel_qp(struct qedr_dev *dev, qp->sq.max_wr = min_t(u32, attrs->cap.max_send_wr * dev->wq_multiplier, dev->attr.max_sqe); - qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr, GFP_KERNEL); + qp->wqe_wr_id = kzalloc_objs(*qp->wqe_wr_id, qp->sq.max_wr); if (!qp->wqe_wr_id) { DP_ERR(dev, "create qp: failed SQ shadow memory allocation\n"); return -ENOMEM; @@ -2204,7 +2204,7 @@ static int qedr_create_kernel_qp(struct qedr_dev *dev, qp->rq.max_wr = (u16) max_t(u32, attrs->cap.max_recv_wr, 1); /* Allocate driver internal RQ array */ - qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr, GFP_KERNEL); + qp->rqe_wr_id = kzalloc_objs(*qp->rqe_wr_id, qp->rq.max_wr); if (!qp->rqe_wr_id) { DP_ERR(dev, "create qp: failed RQ shadow memory allocation\n"); @@ -2970,7 +2970,7 @@ struct ib_mr *qedr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(rc); @@ -3078,7 +3078,7 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd, "qedr_alloc_frmr pd = %d max_page_list_len= %d\n", pd->pd_id, max_page_list_len); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(rc); @@ -3219,7 +3219,7 @@ struct ib_mr *qedr_get_dma_mr(struct ib_pd *ibpd, int acc) struct qedr_mr *mr; int rc; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_fwd.c b/drivers/infiniband/hw/usnic/usnic_fwd.c index 7dd66ee61a4e..39cdd72eabf6 100644 --- a/drivers/infiniband/hw/usnic/usnic_fwd.c +++ b/drivers/infiniband/hw/usnic/usnic_fwd.c @@ -85,7 +85,7 @@ struct usnic_fwd_dev *usnic_fwd_dev_alloc(struct pci_dev *pdev) { struct usnic_fwd_dev *ufdev; - ufdev = kzalloc_obj(*ufdev, GFP_KERNEL); + ufdev = kzalloc_obj(*ufdev); if (!ufdev) return NULL; diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index 91e91f78f35b..9336dff81cc4 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c @@ -556,7 +556,7 @@ static int usnic_ib_pci_probe(struct pci_dev *pdev, return -EPERM; } - vf = kzalloc_obj(*vf, GFP_KERNEL); + vf = kzalloc_obj(*vf); if (!vf) return -ENOMEM; diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index bbbea014b784..16b269128f52 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -604,7 +604,7 @@ struct ib_mr *usnic_ib_reg_mr(struct ib_pd *pd, u64 start, u64 length, if (dmah) return ERR_PTR(-EOPNOTSUPP); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c index c659c80a37a6..e94aa9608465 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -351,7 +351,7 @@ struct usnic_uiom_reg *usnic_uiom_reg_get(struct usnic_uiom_pd *pd, vpn_start = (addr & PAGE_MASK) >> PAGE_SHIFT; vpn_last = vpn_start + npages - 1; - uiomr = kmalloc_obj(*uiomr, GFP_KERNEL); + uiomr = kmalloc_obj(*uiomr); if (!uiomr) return ERR_PTR(-ENOMEM); @@ -439,7 +439,7 @@ struct usnic_uiom_pd *usnic_uiom_alloc_pd(struct device *dev) struct usnic_uiom_pd *pd; void *domain; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.c b/drivers/infiniband/hw/usnic/usnic_vnic.c index 2565b1e136cf..70517a458926 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.c +++ b/drivers/infiniband/hw/usnic/usnic_vnic.c @@ -311,12 +311,12 @@ static int usnic_vnic_alloc_res_chunk(struct usnic_vnic *vnic, } chunk->cnt = chunk->free_cnt = cnt; - chunk->res = kzalloc_objs(*(chunk->res), cnt, GFP_KERNEL); + chunk->res = kzalloc_objs(*(chunk->res), cnt); if (!chunk->res) return -ENOMEM; for (i = 0; i < cnt; i++) { - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) { err = -ENOMEM; goto fail; @@ -445,7 +445,7 @@ struct usnic_vnic *usnic_vnic_alloc(struct pci_dev *pdev) return ERR_PTR(-EINVAL); } - vnic = kzalloc_obj(*vnic, GFP_KERNEL); + vnic = kzalloc_obj(*vnic); if (!vnic) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c index a4da1b61c27f..0864ad25b9d2 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c @@ -81,7 +81,7 @@ int pvrdma_page_dir_init(struct pvrdma_dev *dev, struct pvrdma_page_dir *pdir, pdir->npages = npages; if (alloc_pages) { - pdir->pages = kzalloc_objs(*pdir->pages, npages, GFP_KERNEL); + pdir->pages = kzalloc_objs(*pdir->pages, npages); if (!pdir->pages) goto err; diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c index b53fb23c3c86..05a6bd991502 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c @@ -72,7 +72,7 @@ struct ib_mr *pvrdma_get_dma_mr(struct ib_pd *pd, int acc) return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -146,7 +146,7 @@ struct ib_mr *pvrdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, goto err_umem; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { ret = -ENOMEM; goto err_umem; @@ -222,7 +222,7 @@ struct ib_mr *pvrdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, max_num_sg > PVRDMA_MAX_FAST_REG_PAGES) return ERR_PTR(-EINVAL); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c index 987e9c0b0466..1fda344d2056 100644 --- a/drivers/infiniband/sw/rdmavt/mcast.c +++ b/drivers/infiniband/sw/rdmavt/mcast.c @@ -34,7 +34,7 @@ static struct rvt_mcast_qp *rvt_mcast_qp_alloc(struct rvt_qp *qp) { struct rvt_mcast_qp *mqp; - mqp = kmalloc_obj(*mqp, GFP_KERNEL); + mqp = kmalloc_obj(*mqp); if (!mqp) goto bail; @@ -66,7 +66,7 @@ static struct rvt_mcast *rvt_mcast_alloc(union ib_gid *mgid, u16 lid) { struct rvt_mcast *mcast; - mcast = kzalloc_obj(*mcast, GFP_KERNEL); + mcast = kzalloc_obj(*mcast); if (!mcast) goto bail; diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 89b1c7410920..add3dde9488f 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c @@ -292,7 +292,7 @@ struct ib_mr *rvt_get_dma_mr(struct ib_pd *pd, int acc) if (ibpd_to_rvtpd(pd)->user) return ERR_PTR(-EPERM); - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { ret = ERR_PTR(-ENOMEM); goto bail; diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 8108660b2d33..c1199ea5d41f 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -2650,7 +2650,7 @@ struct rvt_qp_iter *rvt_qp_iter_init(struct rvt_dev_info *rdi, { struct rvt_qp_iter *i; - i = kzalloc_obj(*i, GFP_KERNEL); + i = kzalloc_obj(*i); if (!i) return NULL; diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index 3a7b1f3c4ac6..0c28b412d81a 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -53,7 +53,7 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports) if (!rdi) return rdi; - rdi->ports = kzalloc_objs(*rdi->ports, nports, GFP_KERNEL); + rdi->ports = kzalloc_objs(*rdi->ports, nports); if (!rdi->ports) ib_dealloc_device(&rdi->ibdev); diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c index 6c3c78ddedc9..5cad72073eca 100644 --- a/drivers/infiniband/sw/rxe/rxe_mcast.c +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c @@ -223,7 +223,7 @@ static struct rxe_mcg *rxe_get_mcg(struct rxe_dev *rxe, union ib_gid *mgid) } /* speculative alloc of new mcg */ - mcg = kzalloc_obj(*mcg, GFP_KERNEL); + mcg = kzalloc_obj(*mcg); if (!mcg) { err = -ENOMEM; goto err_dec; @@ -363,7 +363,7 @@ static int rxe_attach_mcg(struct rxe_mcg *mcg, struct rxe_qp *qp) spin_unlock_bh(&rxe->mcg_lock); /* speculative alloc new mca without using GFP_ATOMIC */ - mca = kzalloc_obj(*mca, GFP_KERNEL); + mca = kzalloc_obj(*mca); if (!mca) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_mmap.c b/drivers/infiniband/sw/rxe/rxe_mmap.c index 6afd158b4b0b..db380302149e 100644 --- a/drivers/infiniband/sw/rxe/rxe_mmap.c +++ b/drivers/infiniband/sw/rxe/rxe_mmap.c @@ -120,7 +120,7 @@ struct rxe_mmap_info *rxe_create_mmap_info(struct rxe_dev *rxe, u32 size, if (!udata) return ERR_PTR(-EINVAL); - ip = kmalloc_obj(*ip, GFP_KERNEL); + ip = kmalloc_obj(*ip); if (!ip) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index e2a4eb72a56e..c696ff874980 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -156,7 +156,7 @@ static int rxe_mr_fill_pages_from_sgt(struct rxe_mr *mr, struct sg_table *sgt) static int __alloc_mr_page_info(struct rxe_mr *mr, int num_pages) { - mr->page_info = kzalloc_objs(struct rxe_mr_page, num_pages, GFP_KERNEL); + mr->page_info = kzalloc_objs(struct rxe_mr_page, num_pages); if (!mr->page_info) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 3e00b1c3db0a..f3dff1aea96a 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -152,7 +152,7 @@ static int alloc_rd_atomic_resources(struct rxe_qp *qp, unsigned int n) { qp->resp.res_head = 0; qp->resp.res_tail = 0; - qp->resp.resources = kzalloc_objs(struct resp_res, n, GFP_KERNEL); + qp->resp.resources = kzalloc_objs(struct resp_res, n); if (!qp->resp.resources) return -ENOMEM; diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c index e27d57ac687f..63a569d8df2b 100644 --- a/drivers/infiniband/sw/rxe/rxe_queue.c +++ b/drivers/infiniband/sw/rxe/rxe_queue.c @@ -63,7 +63,7 @@ struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe, int *num_elem, if (*num_elem < 0) return NULL; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 5d1e0b3228c4..fe41362c5144 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -1245,7 +1245,7 @@ static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access) struct rxe_mr *mr; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1288,7 +1288,7 @@ static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start, return ERR_PTR(-EOPNOTSUPP); } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); @@ -1373,7 +1373,7 @@ static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type, goto err_out; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 22fa54cacab9..f7ac81c0f267 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -205,7 +205,7 @@ static void siw_cep_socket_assoc(struct siw_cep *cep, struct socket *s) static struct siw_cep *siw_cep_alloc(struct siw_device *sdev) { - struct siw_cep *cep = kzalloc_obj(*cep, GFP_KERNEL); + struct siw_cep *cep = kzalloc_obj(*cep); unsigned long flags; if (!cep) @@ -334,7 +334,7 @@ static int siw_cm_alloc_work(struct siw_cep *cep, int num) struct siw_cm_work *work; while (num--) { - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) { if (!(list_empty(&cep->work_freelist))) siw_cm_free_work(cep); @@ -1915,7 +1915,7 @@ int siw_create_listen(struct iw_cm_id *id, int backlog) */ if (!id->provider_data) { id->provider_data = - kmalloc_obj(struct list_head, GFP_KERNEL); + kmalloc_obj(struct list_head); if (!id->provider_data) { rv = -ENOMEM; goto error; diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c index a896b527bcee..9735b75ac933 100644 --- a/drivers/infiniband/sw/siw/siw_main.c +++ b/drivers/infiniband/sw/siw/siw_main.c @@ -128,14 +128,14 @@ static int siw_init_cpulist(void) siw_cpu_info.num_nodes = num_nodes; siw_cpu_info.tx_valid_cpus = - kzalloc_objs(struct cpumask *, num_nodes, GFP_KERNEL); + kzalloc_objs(struct cpumask *, num_nodes); if (!siw_cpu_info.tx_valid_cpus) { siw_cpu_info.num_nodes = 0; return -ENOMEM; } for (i = 0; i < siw_cpu_info.num_nodes; i++) { siw_cpu_info.tx_valid_cpus[i] = - kzalloc_obj(struct cpumask, GFP_KERNEL); + kzalloc_obj(struct cpumask); if (!siw_cpu_info.tx_valid_cpus[i]) goto out_err; diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c index 56d3e5c410ce..acb8b7a17687 100644 --- a/drivers/infiniband/sw/siw/siw_mem.c +++ b/drivers/infiniband/sw/siw/siw_mem.c @@ -58,7 +58,7 @@ int siw_mr_add_mem(struct siw_mr *mr, struct ib_pd *pd, void *mem_obj, u64 start, u64 len, int rights) { struct siw_device *sdev = to_siw_dev(pd->device); - struct siw_mem *mem = kzalloc_obj(*mem, GFP_KERNEL); + struct siw_mem *mem = kzalloc_obj(*mem); struct xa_limit limit = XA_LIMIT(1, SIW_STAG_MAX_INDEX); u32 id, next; @@ -347,12 +347,12 @@ struct siw_umem *siw_umem_get(struct ib_device *base_dev, u64 start, num_pages = PAGE_ALIGN(start + len - first_page_va) >> PAGE_SHIFT; num_chunks = (num_pages >> CHUNK_SHIFT) + 1; - umem = kzalloc_obj(*umem, GFP_KERNEL); + umem = kzalloc_obj(*umem); if (!umem) return ERR_PTR(-ENOMEM); umem->page_chunk = - kzalloc_objs(struct siw_page_chunk, num_chunks, GFP_KERNEL); + kzalloc_objs(struct siw_page_chunk, num_chunks); if (!umem->page_chunk) { rv = -ENOMEM; goto err_out; @@ -376,7 +376,7 @@ struct siw_umem *siw_umem_get(struct ib_device *base_dev, u64 start, for (i = 0; num_pages > 0; i++) { int nents = min_t(int, num_pages, PAGES_PER_CHUNK); struct page **plist = - kzalloc_objs(struct page *, nents, GFP_KERNEL); + kzalloc_objs(struct page *, nents); if (!plist) { rv = -ENOMEM; diff --git a/drivers/infiniband/sw/siw/siw_qp.c b/drivers/infiniband/sw/siw/siw_qp.c index cccfef1e27bf..bb780e3904a2 100644 --- a/drivers/infiniband/sw/siw/siw_qp.c +++ b/drivers/infiniband/sw/siw/siw_qp.c @@ -391,7 +391,7 @@ void siw_send_terminate(struct siw_qp *qp) return; } - term = kzalloc_obj(*term, GFP_KERNEL); + term = kzalloc_obj(*term); if (!term) return; @@ -405,7 +405,7 @@ void siw_send_terminate(struct siw_qp *qp) if ((qp->term_info.layer == TERM_ERROR_LAYER_DDP) || ((qp->term_info.layer == TERM_ERROR_LAYER_RDMAP) && (qp->term_info.etype != RDMAP_ETYPE_CATASTROPHIC))) { - err_hdr = kzalloc_obj(*err_hdr, GFP_KERNEL); + err_hdr = kzalloc_obj(*err_hdr); if (!err_hdr) { kfree(term); return; diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c index 12719394f1ea..ef504db8f2b4 100644 --- a/drivers/infiniband/sw/siw/siw_verbs.c +++ b/drivers/infiniband/sw/siw/siw_verbs.c @@ -274,7 +274,7 @@ siw_mmap_entry_insert(struct siw_ucontext *uctx, void *address, size_t length, u64 *offset) { - struct siw_user_mmap_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct siw_user_mmap_entry *entry = kzalloc_obj(*entry); int rv; *offset = SIW_INVAL_UOBJ_KEY; @@ -1360,7 +1360,7 @@ struct ib_mr *siw_reg_user_mr(struct ib_pd *pd, u64 start, u64 len, umem = NULL; goto err_out; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { rv = -ENOMEM; goto err_out; @@ -1441,7 +1441,7 @@ struct ib_mr *siw_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, pbl = NULL; goto err_out; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { rv = -ENOMEM; goto err_out; @@ -1556,7 +1556,7 @@ struct ib_mr *siw_get_dma_mr(struct ib_pd *pd, int rights) rv = -ENOMEM; goto err_out; } - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { rv = -ENOMEM; goto err_out; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 54de2be1494b..57fec88a1629 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -360,7 +360,7 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i if (!rx->rx_ring) return -ENOMEM; - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) { ret = -ENOMEM; goto err_free_1; @@ -449,7 +449,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, int ret; ipoib_dbg(priv, "REQ arrived\n"); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; p->dev = dev; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 44354d661e65..5061d52a7b12 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -59,7 +59,7 @@ struct ipoib_ah *ipoib_create_ah(struct net_device *dev, struct ipoib_ah *ah; struct ib_ah *vah; - ah = kmalloc_obj(*ah, GFP_KERNEL); + ah = kmalloc_obj(*ah); if (!ah) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 934d8e5a8f11..fb8e70eae383 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -169,7 +169,7 @@ static void ipoib_schedule_ifupdown_task(struct net_device *dev, bool up) (!up && !(dev->flags & IFF_UP))) return; - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) return; work->dev = dev; @@ -673,7 +673,7 @@ struct ipoib_path_iter *ipoib_path_iter_init(struct net_device *dev) { struct ipoib_path_iter *iter; - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return NULL; @@ -1593,11 +1593,11 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv) clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags); ntbl->htbl = NULL; - htbl = kzalloc_obj(*htbl, GFP_KERNEL); + htbl = kzalloc_obj(*htbl); if (!htbl) return -ENOMEM; size = roundup_pow_of_two(arp_tbl.gc_thresh3); - buckets = kvzalloc_objs(*buckets, size, GFP_KERNEL); + buckets = kvzalloc_objs(*buckets, size); if (!buckets) { kfree(htbl); return -ENOMEM; @@ -2277,7 +2277,7 @@ int ipoib_intf_init(struct ib_device *hca, u32 port, const char *name, struct ipoib_dev_priv *priv; int rc; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -2663,7 +2663,7 @@ static int ipoib_add_one(struct ib_device *device) unsigned int p; int count = 0; - dev_list = kmalloc_obj(*dev_list, GFP_KERNEL); + dev_list = kmalloc_obj(*dev_list); if (!dev_list) return -ENOMEM; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 7b04186f659e..6401af2fd548 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -980,7 +980,7 @@ struct ipoib_mcast_iter *ipoib_mcast_iter_init(struct net_device *dev) { struct ipoib_mcast_iter *iter; - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return NULL; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 55a612ad2b07..3ed1ea566690 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c @@ -52,7 +52,7 @@ int ipoib_mcast_attach(struct net_device *dev, struct ib_device *hca, if (set_qkey) { ret = -ENOMEM; - qp_attr = kmalloc_obj(*qp_attr, GFP_KERNEL); + qp_attr = kmalloc_obj(*qp_attr); if (!qp_attr) goto out; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index df98b4936c32..ba3b45152907 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c @@ -274,7 +274,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) priv->child_type == IPOIB_LEGACY_CHILD) { struct ipoib_vlan_delete_work *work; - work = kmalloc_obj(*work, GFP_KERNEL); + work = kmalloc_obj(*work); if (!work) { rc = -ENOMEM; goto out; diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 2e1e97acf342..7df441685780 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -802,7 +802,7 @@ static struct iscsi_endpoint *iscsi_iser_ep_connect(struct Scsi_Host *shost, if (!ep) return ERR_PTR(-ENOMEM); - iser_conn = kzalloc_obj(*iser_conn, GFP_KERNEL); + iser_conn = kzalloc_obj(*iser_conn); if (!iser_conn) { err = -ENOMEM; goto failure; diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index f08dea6721c4..f03b3bb3c0c4 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -105,7 +105,7 @@ iser_create_fastreg_desc(struct iser_device *device, enum ib_mr_type mr_type; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return ERR_PTR(-ENOMEM); @@ -305,7 +305,7 @@ struct iser_device *iser_device_find_by_ib_device(struct rdma_cm_id *cma_id) if (device->ib_device->node_guid == cma_id->device->node_guid) goto inc_refcnt; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) goto out; diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index ab5d8790cf87..84de723cacb4 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -274,7 +274,7 @@ isert_device_get(struct rdma_cm_id *cma_id) } } - device = kzalloc_obj(struct isert_device, GFP_KERNEL); + device = kzalloc_obj(struct isert_device); if (!device) { mutex_unlock(&device_list_mutex); return ERR_PTR(-ENOMEM); @@ -428,7 +428,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) isert_dbg("cma_id: %p, portal: %p\n", cma_id, cma_id->context); - isert_conn = kzalloc_obj(struct isert_conn, GFP_KERNEL); + isert_conn = kzalloc_obj(struct isert_conn); if (!isert_conn) return -ENOMEM; @@ -2268,7 +2268,7 @@ isert_setup_np(struct iscsi_np *np, struct rdma_cm_id *isert_lid; int ret; - isert_np = kzalloc_obj(struct isert_np, GFP_KERNEL); + isert_np = kzalloc_obj(struct isert_np); if (!isert_np) return -ENOMEM; diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c index 6d3dbf45e9f5..53dcf06fbee0 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c @@ -238,7 +238,7 @@ int opa_vnic_update_mac_tbl(struct opa_vnic_adapter *adapter, if (!memcmp(mac_addr, empty_mac, ARRAY_SIZE(empty_mac))) continue; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) { rc = -ENOMEM; goto updt_done; @@ -265,7 +265,7 @@ int opa_vnic_update_mac_tbl(struct opa_vnic_adapter *adapter, (node->index < (loffset + lnum_entries))) continue; - new_node = kzalloc_obj(*new_node, GFP_KERNEL); + new_node = kzalloc_obj(*new_node); if (!new_node) { rc = -ENOMEM; goto updt_done; diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c index 6d5f642ff3d3..1c3e7251f0f4 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c @@ -337,7 +337,7 @@ struct opa_vnic_adapter *opa_vnic_add_netdev(struct ib_device *ibdev, return ERR_CAST(netdev); rn = netdev_priv(netdev); - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) { rc = -ENOMEM; goto adapter_err; diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index 67405a19ea10..c0cd2592dd93 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -1383,7 +1383,7 @@ static int alloc_path_reqs(struct rtrs_clt_path *clt_path) if (!req->iu) goto out; - req->sge = kzalloc_objs(*req->sge, 2, GFP_KERNEL); + req->sge = kzalloc_objs(*req->sge, 2); if (!req->sge) goto out; @@ -1537,7 +1537,7 @@ static struct rtrs_clt_path *alloc_path(struct rtrs_clt_sess *clt, int cpu; size_t total_con; - clt_path = kzalloc_obj(*clt_path, GFP_KERNEL); + clt_path = kzalloc_obj(*clt_path); if (!clt_path) goto err; @@ -1546,14 +1546,14 @@ static struct rtrs_clt_path *alloc_path(struct rtrs_clt_sess *clt, * +1: Extra connection for user messages */ total_con = con_num + nr_poll_queues + 1; - clt_path->s.con = kzalloc_objs(*clt_path->s.con, total_con, GFP_KERNEL); + clt_path->s.con = kzalloc_objs(*clt_path->s.con, total_con); if (!clt_path->s.con) goto err_free_path; clt_path->s.con_num = total_con; clt_path->s.irq_con_num = con_num + 1; - clt_path->stats = kzalloc_obj(*clt_path->stats, GFP_KERNEL); + clt_path->stats = kzalloc_obj(*clt_path->stats); if (!clt_path->stats) goto err_free_con; @@ -1620,7 +1620,7 @@ static int create_con(struct rtrs_clt_path *clt_path, unsigned int cid) { struct rtrs_clt_con *con; - con = kzalloc_obj(*con, GFP_KERNEL); + con = kzalloc_obj(*con); if (!con) return -ENOMEM; @@ -2727,7 +2727,7 @@ static struct rtrs_clt_sess *alloc_clt(const char *sessname, size_t paths_num, if (strlen(sessname) >= sizeof(clt->sessname)) return ERR_PTR(-EINVAL); - clt = kzalloc_obj(*clt, GFP_KERNEL); + clt = kzalloc_obj(*clt); if (!clt) return ERR_PTR(-ENOMEM); diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index c66929b74805..59c8f72b0b34 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -144,7 +144,7 @@ static int rtrs_srv_alloc_ops_ids(struct rtrs_srv_path *srv_path) goto err; for (i = 0; i < srv->queue_depth; ++i) { - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) goto err; @@ -588,7 +588,7 @@ static int map_cont_bufs(struct rtrs_srv_path *srv_path) chunks_per_mr = DIV_ROUND_UP(srv->queue_depth, mrs_num); } - srv_path->mrs = kzalloc_objs(*srv_path->mrs, mrs_num, GFP_KERNEL); + srv_path->mrs = kzalloc_objs(*srv_path->mrs, mrs_num); if (!srv_path->mrs) return -ENOMEM; @@ -836,7 +836,7 @@ static int process_info_req(struct rtrs_srv_con *con, strscpy(srv_path->s.sessname, msg->pathname, sizeof(srv_path->s.sessname)); - rwr = kzalloc_objs(*rwr, srv_path->mrs_num, GFP_KERNEL); + rwr = kzalloc_objs(*rwr, srv_path->mrs_num); if (!rwr) return -ENOMEM; @@ -1435,7 +1435,7 @@ static struct rtrs_srv_sess *get_or_create_srv(struct rtrs_srv_ctx *ctx, } /* need to allocate a new srv */ - srv = kzalloc_obj(*srv, GFP_KERNEL); + srv = kzalloc_obj(*srv); if (!srv) return ERR_PTR(-ENOMEM); @@ -1448,7 +1448,7 @@ static struct rtrs_srv_sess *get_or_create_srv(struct rtrs_srv_ctx *ctx, device_initialize(&srv->dev); srv->dev.release = rtrs_srv_dev_release; - srv->chunks = kzalloc_objs(*srv->chunks, srv->queue_depth, GFP_KERNEL); + srv->chunks = kzalloc_objs(*srv->chunks, srv->queue_depth); if (!srv->chunks) goto err_free_srv; @@ -1713,7 +1713,7 @@ static int create_con(struct rtrs_srv_path *srv_path, u32 cq_num, max_send_wr, max_recv_wr, wr_limit; int err, cq_vector; - con = kzalloc_obj(*con, GFP_KERNEL); + con = kzalloc_obj(*con); if (!con) { err = -ENOMEM; goto err; @@ -1806,11 +1806,11 @@ static struct rtrs_srv_path *__alloc_path(struct rtrs_srv_sess *srv, err = -EEXIST; goto err; } - srv_path = kzalloc_obj(*srv_path, GFP_KERNEL); + srv_path = kzalloc_obj(*srv_path); if (!srv_path) goto err; - srv_path->stats = kzalloc_obj(*srv_path->stats, GFP_KERNEL); + srv_path->stats = kzalloc_obj(*srv_path->stats); if (!srv_path->stats) goto err_free_sess; @@ -1825,7 +1825,7 @@ static struct rtrs_srv_path *__alloc_path(struct rtrs_srv_sess *srv, if (!srv_path->dma_addr) goto err_free_percpu; - srv_path->s.con = kzalloc_objs(*srv_path->s.con, con_num, GFP_KERNEL); + srv_path->s.con = kzalloc_objs(*srv_path->s.con, con_num); if (!srv_path->s.con) goto err_free_dma_addr; @@ -2158,7 +2158,7 @@ static struct rtrs_srv_ctx *alloc_srv_ctx(struct rtrs_srv_ops *ops) { struct rtrs_srv_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/drivers/infiniband/ulp/rtrs/rtrs.c b/drivers/infiniband/ulp/rtrs/rtrs.c index f316cbe5e62c..a642626e0ecb 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs.c @@ -618,7 +618,7 @@ rtrs_ib_dev_find_or_add(struct ib_device *ib_dev, goto out_unlock; } mutex_unlock(&pool->mutex); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto out_err; diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index e1dfc097f774..7e69c0d1bf60 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -274,7 +274,7 @@ static int srp_init_ib_qp(struct srp_target_port *target, struct ib_qp_attr *attr; int ret; - attr = kmalloc_obj(*attr, GFP_KERNEL); + attr = kmalloc_obj(*attr); if (!attr) return -ENOMEM; @@ -533,7 +533,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) const int m = 1 + dev->use_fast_reg * target->mr_per_cmd * 2; int ret; - init_attr = kzalloc_obj(*init_attr, GFP_KERNEL); + init_attr = kzalloc_obj(*init_attr); if (!init_attr) return -ENOMEM; @@ -806,7 +806,7 @@ static int srp_send_req(struct srp_rdma_ch *ch, uint32_t max_iu_len, char *ipi, *tpi; int status; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -2257,10 +2257,10 @@ static int srp_alloc_iu_bufs(struct srp_rdma_ch *ch) struct srp_target_port *target = ch->target; int i; - ch->rx_ring = kzalloc_objs(*ch->rx_ring, target->queue_size, GFP_KERNEL); + ch->rx_ring = kzalloc_objs(*ch->rx_ring, target->queue_size); if (!ch->rx_ring) goto err_no_ring; - ch->tx_ring = kzalloc_objs(*ch->tx_ring, target->queue_size, GFP_KERNEL); + ch->tx_ring = kzalloc_objs(*ch->tx_ring, target->queue_size); if (!ch->tx_ring) goto err_no_ring; @@ -2385,7 +2385,7 @@ static void srp_cm_rep_handler(struct ib_cm_id *cm_id, if (!target->using_rdma_cm) { ret = -ENOMEM; - qp_attr = kmalloc_obj(*qp_attr, GFP_KERNEL); + qp_attr = kmalloc_obj(*qp_attr); if (!qp_attr) goto error; @@ -3822,7 +3822,7 @@ static ssize_t add_target_store(struct device *dev, num_online_cpus()); } - target->ch = kzalloc_objs(*target->ch, target->ch_count, GFP_KERNEL); + target->ch = kzalloc_objs(*target->ch, target->ch_count); if (!target->ch) goto out; @@ -3957,7 +3957,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u32 port) { struct srp_host *host; - host = kzalloc_obj(*host, GFP_KERNEL); + host = kzalloc_obj(*host); if (!host) return NULL; @@ -4007,7 +4007,7 @@ static int srp_add_one(struct ib_device *device) u64 max_pages_per_mr; unsigned int flags = 0; - srp_dev = kzalloc_obj(*srp_dev, GFP_KERNEL); + srp_dev = kzalloc_obj(*srp_dev); if (!srp_dev) return -ENOMEM; diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 6e371b264054..e67f293c40f9 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -127,7 +127,7 @@ static struct kmem_cache *srpt_cache_get(unsigned int object_size) return e->c; } snprintf(name, sizeof(name), "srpt-%u", object_size); - e = kmalloc_obj(*e, GFP_KERNEL); + e = kmalloc_obj(*e); if (!e) return NULL; refcount_set(&e->ref, 1); @@ -790,7 +790,7 @@ static struct srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev, WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx) && ioctx_size != sizeof(struct srpt_send_ioctx)); - ring = kvmalloc_objs(ring[0], ring_size, GFP_KERNEL); + ring = kvmalloc_objs(ring[0], ring_size); if (!ring) goto out; for (i = 0; i < ring_size; ++i) { @@ -1181,7 +1181,7 @@ static int srpt_init_ch_qp(struct srpt_rdma_ch *ch, struct ib_qp *qp) WARN_ON_ONCE(ch->using_rdma_cm); - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return -ENOMEM; @@ -1857,7 +1857,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) WARN_ON(ch->rq_size < 1); ret = -ENOMEM; - qp_init = kzalloc_obj(*qp_init, GFP_KERNEL); + qp_init = kzalloc_obj(*qp_init); if (!qp_init) goto out; @@ -2089,7 +2089,7 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport, if (nexus) break; - tmp_nexus = kzalloc_obj(*nexus, GFP_KERNEL); + tmp_nexus = kzalloc_obj(*nexus); if (!tmp_nexus) { nexus = ERR_PTR(-ENOMEM); break; @@ -2241,9 +2241,9 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, } ret = -ENOMEM; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); - rej = kzalloc_obj(*rej, GFP_KERNEL); - rep_param = kzalloc_obj(*rep_param, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); + rej = kzalloc_obj(*rej); + rep_param = kzalloc_obj(*rep_param); if (!rsp || !rej || !rep_param) goto out; @@ -2273,7 +2273,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, } ret = -ENOMEM; - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) { rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); pr_err("rejected SRP_LOGIN_REQ because out of memory.\n"); @@ -3789,7 +3789,7 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn, struct srpt_tpg *stpg; int res = -ENOMEM; - stpg = kzalloc_obj(*stpg, GFP_KERNEL); + stpg = kzalloc_obj(*stpg); if (!stpg) return ERR_PTR(res); stpg->sport_id = sport_id; @@ -3846,7 +3846,7 @@ static struct se_wwn *srpt_make_tport(struct target_fabric_configfs *tf, WARN_ON_ONCE(true); return &(*papi.port_id)->wwn; } - port_id = kzalloc_obj(*port_id, GFP_KERNEL); + port_id = kzalloc_obj(*port_id); if (!port_id) { srpt_sdev_put(sport->sdev); return ERR_PTR(-ENOMEM); diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c index 211ab2c0793a..028fcaf4c142 100644 --- a/drivers/input/apm-power.c +++ b/drivers/input/apm-power.c @@ -52,7 +52,7 @@ static int apmpower_connect(struct input_handler *handler, struct input_handle *handle; int error; - handle = kzalloc_obj(struct input_handle, GFP_KERNEL); + handle = kzalloc_obj(struct input_handle); if (!handle) return -ENOMEM; diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 884b525e799c..77360def61be 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -1346,7 +1346,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev, return error; } - evdev = kzalloc_obj(struct evdev, GFP_KERNEL); + evdev = kzalloc_obj(struct evdev); if (!evdev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index d6e2c3017435..17061fb2f5b8 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c @@ -307,7 +307,7 @@ int input_ff_create(struct input_dev *dev, unsigned int max_effects) if (!ff) return -ENOMEM; - ff->effects = kzalloc_objs(*ff->effects, max_effects, GFP_KERNEL); + ff->effects = kzalloc_objs(*ff->effects, max_effects); if (!ff->effects) return -ENOMEM; diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index e018ea328dda..937370d04928 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -508,7 +508,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data, int error; int i; - struct ml_device *ml __free(kfree) = kzalloc_obj(*ml, GFP_KERNEL); + struct ml_device *ml __free(kfree) = kzalloc_obj(*ml); if (!ml) return -ENOMEM; diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c index cbb67f97d0ca..ee97621df59d 100644 --- a/drivers/input/gameport/emu10k1-gp.c +++ b/drivers/input/gameport/emu10k1-gp.c @@ -43,7 +43,7 @@ static int emu_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct gameport *port; int error; - emu = kzalloc_obj(*emu, GFP_KERNEL); + emu = kzalloc_obj(*emu); port = gameport_allocate_port(); if (!emu || !port) { printk(KERN_ERR "emu10k1-gp: Memory allocation failed\n"); diff --git a/drivers/input/gameport/fm801-gp.c b/drivers/input/gameport/fm801-gp.c index f5b1a683d1b4..423cccdea34f 100644 --- a/drivers/input/gameport/fm801-gp.c +++ b/drivers/input/gameport/fm801-gp.c @@ -68,7 +68,7 @@ static int fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id) struct gameport *port; int error; - gp = kzalloc_obj(*gp, GFP_KERNEL); + gp = kzalloc_obj(*gp); port = gameport_allocate_port(); if (!gp || !port) { printk(KERN_ERR "fm801-gp: Memory allocation failed\n"); diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index cb04b49a82be..fdece6ec1df3 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c @@ -120,7 +120,7 @@ static int ns558_isa_probe(int io) return -EBUSY; } - ns558 = kzalloc_obj(*ns558, GFP_KERNEL); + ns558 = kzalloc_obj(*ns558); port = gameport_allocate_port(); if (!ns558 || !port) { printk(KERN_ERR "ns558: Memory allocation failed.\n"); @@ -192,7 +192,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did) if (!request_region(ioport, iolen, "ns558-pnp")) return -EBUSY; - ns558 = kzalloc_obj(*ns558, GFP_KERNEL); + ns558 = kzalloc_obj(*ns558); port = gameport_allocate_port(); if (!ns558 || !port) { printk(KERN_ERR "ns558: Memory allocation failed\n"); diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 0d4043797e4c..ad6b1d4242ed 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -84,7 +84,7 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); if (flags & INPUT_MT_TRACK) { unsigned int n2 = num_slots * num_slots; - mt->red = kzalloc_objs(*mt->red, n2, GFP_KERNEL); + mt->red = kzalloc_objs(*mt->red, n2); if (!mt->red) return -ENOMEM; } diff --git a/drivers/input/input-poller.c b/drivers/input/input-poller.c index fa0c7089f3bb..54dc07fcae0b 100644 --- a/drivers/input/input-poller.c +++ b/drivers/input/input-poller.c @@ -71,7 +71,7 @@ int input_setup_polling(struct input_dev *dev, { struct input_dev_poller *poller; - poller = kzalloc_obj(*poller, GFP_KERNEL); + poller = kzalloc_obj(*poller); if (!poller) { /* * We want to show message even though kzalloc() may have diff --git a/drivers/input/input.c b/drivers/input/input.c index 9486a9ea1541..7b7490a1fbc6 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -439,7 +439,7 @@ void input_alloc_absinfo(struct input_dev *dev) if (dev->absinfo) return; - dev->absinfo = kzalloc_objs(*dev->absinfo, ABS_CNT, GFP_KERNEL); + dev->absinfo = kzalloc_objs(*dev->absinfo, ABS_CNT); if (!dev->absinfo) { dev_err(dev->dev.parent ?: &dev->dev, "%s: unable to allocate memory\n", __func__); @@ -1887,7 +1887,7 @@ struct input_dev *input_allocate_device(void) static atomic_t input_no = ATOMIC_INIT(-1); struct input_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -1897,7 +1897,7 @@ struct input_dev *input_allocate_device(void) * when we register the device. */ dev->max_vals = 10; - dev->vals = kzalloc_objs(*dev->vals, dev->max_vals, GFP_KERNEL); + dev->vals = kzalloc_objs(*dev->vals, dev->max_vals); if (!dev->vals) { kfree(dev); return NULL; diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 5c773f94646f..32459fd8a7c1 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -261,7 +261,7 @@ static int joydev_open(struct inode *inode, struct file *file) struct joydev_client *client; int error; - client = kzalloc_obj(struct joydev_client, GFP_KERNEL); + client = kzalloc_obj(struct joydev_client); if (!client) return -ENOMEM; @@ -921,7 +921,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev, return error; } - joydev = kzalloc_obj(struct joydev, GFP_KERNEL); + joydev = kzalloc_obj(struct joydev); if (!joydev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c index 07bd0083d654..48a1457961ef 100644 --- a/drivers/input/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c @@ -249,7 +249,7 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - a3d = kzalloc_obj(*a3d, GFP_KERNEL); + a3d = kzalloc_obj(*a3d); input_dev = input_allocate_device(); if (!a3d || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c index fa7d0b80e7b7..e07b71978509 100644 --- a/drivers/input/joystick/adi.c +++ b/drivers/input/joystick/adi.c @@ -456,7 +456,7 @@ static int adi_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index 79ed2363b8e5..b6f7bce1c14f 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -582,7 +582,7 @@ static int analog_connect(struct gameport *gameport, struct gameport_driver *drv int i; int err; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c index 2d1a23866e64..7b4d61626898 100644 --- a/drivers/input/joystick/as5011.c +++ b/drivers/input/joystick/as5011.c @@ -237,7 +237,7 @@ static int as5011_probe(struct i2c_client *client) return -ENODEV; } - as5011 = kmalloc_obj(*as5011, GFP_KERNEL); + as5011 = kmalloc_obj(*as5011); input_dev = input_allocate_device(); if (!as5011 || !input_dev) { dev_err(&client->dev, diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c index 781cec6b2b24..ffa6d49c81fe 100644 --- a/drivers/input/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c @@ -141,7 +141,7 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv) int i, j; int err; - cobra = kzalloc_obj(*cobra, GFP_KERNEL); + cobra = kzalloc_obj(*cobra); if (!cobra) return -ENOMEM; diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 165096fc0a55..e5d9b71aab99 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -585,7 +585,7 @@ static void db9_attach(struct parport *pp) return; } - db9 = kzalloc_obj(*db9, GFP_KERNEL); + db9 = kzalloc_obj(*db9); if (!db9) goto err_unreg_pardev; diff --git a/drivers/input/joystick/fsia6b.c b/drivers/input/joystick/fsia6b.c index 0bd7d4bd562a..b0d73648477e 100644 --- a/drivers/input/joystick/fsia6b.c +++ b/drivers/input/joystick/fsia6b.c @@ -132,7 +132,7 @@ static int fsia6b_serio_connect(struct serio *serio, struct serio_driver *drv) int i, j; int sw_id = 0; - fsia6b = kzalloc_obj(*fsia6b, GFP_KERNEL); + fsia6b = kzalloc_obj(*fsia6b); if (!fsia6b) return -ENOMEM; diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index 03d0e491b688..d84d453b51af 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -291,7 +291,7 @@ static int gc_n64_init_ff(struct input_dev *dev, int i) struct gc_subdev *sdev; int err; - sdev = kmalloc_obj(*sdev, GFP_KERNEL); + sdev = kmalloc_obj(*sdev); if (!sdev) return -ENOMEM; @@ -948,7 +948,7 @@ static void gc_attach(struct parport *pp) return; } - gc = kzalloc_obj(*gc, GFP_KERNEL); + gc = kzalloc_obj(*gc); if (!gc) { pr_err("Not enough memory\n"); goto err_unreg_pardev; diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index 23dc98146ccd..5a1cdce0bc48 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c @@ -222,7 +222,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) unsigned char data[GF2K_LENGTH]; int i, err; - gf2k = kzalloc_obj(*gf2k, GFP_KERNEL); + gf2k = kzalloc_obj(*gf2k); input_dev = input_allocate_device(); if (!gf2k || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c index f500a32d1ea7..2a3f768a7218 100644 --- a/drivers/input/joystick/grip.c +++ b/drivers/input/joystick/grip.c @@ -284,7 +284,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv) int i, j, t; int err; - grip = kzalloc_obj(*grip, GFP_KERNEL); + grip = kzalloc_obj(*grip); if (!grip) return -ENOMEM; diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 7d90d8e5485b..62fdd0831c83 100644 --- a/drivers/input/joystick/grip_mp.c +++ b/drivers/input/joystick/grip_mp.c @@ -632,7 +632,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv) struct grip_mp *grip; int err; - grip = kzalloc_obj(*grip, GFP_KERNEL); + grip = kzalloc_obj(*grip); if (!grip) return -ENOMEM; diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c index eb7faaf3f020..13f0fa4d3938 100644 --- a/drivers/input/joystick/guillemot.c +++ b/drivers/input/joystick/guillemot.c @@ -163,7 +163,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver * int i, t; int err; - guillemot = kzalloc_obj(*guillemot, GFP_KERNEL); + guillemot = kzalloc_obj(*guillemot); input_dev = input_allocate_device(); if (!guillemot || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index 0ca2f9bfb17b..e235834888d2 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c @@ -185,7 +185,7 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) struct iforce_serio *iforce_serio; int err; - iforce_serio = kzalloc_obj(*iforce_serio, GFP_KERNEL); + iforce_serio = kzalloc_obj(*iforce_serio); if (!iforce_serio) return -ENOMEM; diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index b41d0b962e3d..0482eaaecf39 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -207,7 +207,7 @@ static int iforce_usb_probe(struct usb_interface *intf, if (!usb_endpoint_is_int_out(epout)) return -ENODEV; - iforce_usb = kzalloc_obj(*iforce_usb, GFP_KERNEL); + iforce_usb = kzalloc_obj(*iforce_usb); if (!iforce_usb) goto fail; diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c index 88aa77d1fc36..507cec36b220 100644 --- a/drivers/input/joystick/interact.c +++ b/drivers/input/joystick/interact.c @@ -192,7 +192,7 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d int i, t; int err; - interact = kzalloc_obj(*interact, GFP_KERNEL); + interact = kzalloc_obj(*interact); input_dev = input_allocate_device(); if (!interact || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c index 9feda59dccde..c9cbdcc7f31f 100644 --- a/drivers/input/joystick/joydump.c +++ b/drivers/input/joystick/joydump.c @@ -61,7 +61,7 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr timeout = gameport_time(gameport, 10000); /* 10 ms */ - buf = kmalloc_objs(struct joydump, BUF_SIZE, GFP_KERNEL); + buf = kmalloc_objs(struct joydump, BUF_SIZE); if (!buf) { printk(KERN_INFO "joydump: no memory for testing\n"); goto jd_end; diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c index 3b7f5840caeb..201a049c8c06 100644 --- a/drivers/input/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c @@ -132,7 +132,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - magellan = kzalloc_obj(*magellan, GFP_KERNEL); + magellan = kzalloc_obj(*magellan); input_dev = input_allocate_device(); if (!magellan || !input_dev) goto fail1; diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 2a811f302173..7f36f73844a9 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -102,7 +102,7 @@ static int probe_maple_controller(struct device *dev) struct input_dev *idev; unsigned long data = be32_to_cpu(mdev->devinfo.function_data[0]); - pad = kzalloc_obj(*pad, GFP_KERNEL); + pad = kzalloc_obj(*pad); idev = input_allocate_device(); if (!pad || !idev) { error = -ENOMEM; diff --git a/drivers/input/joystick/n64joy.c b/drivers/input/joystick/n64joy.c index b4203825e9e6..43a02bb99fc2 100644 --- a/drivers/input/joystick/n64joy.c +++ b/drivers/input/joystick/n64joy.c @@ -243,7 +243,7 @@ static int __init n64joy_probe(struct platform_device *pdev) int err = 0; u32 i, j, found = 0; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; mutex_init(&priv->n64joy_mutex); diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 645c822638ad..7f37d18c8477 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -578,7 +578,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) comment[0] = 0; - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); buf = kmalloc(SW_LENGTH, GFP_KERNEL); idbuf = kmalloc(SW_LENGTH, GFP_KERNEL); if (!sw || !buf || !idbuf) { diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index d562275aa4bc..1af299a41d13 100644 --- a/drivers/input/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c @@ -199,7 +199,7 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv) if ((id = serio->id.id) > SPACEBALL_MAX_ID) return -ENODEV; - spaceball = kmalloc_obj(*spaceball, GFP_KERNEL); + spaceball = kmalloc_obj(*spaceball); input_dev = input_allocate_device(); if (!spaceball || !input_dev) goto fail1; diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index 3aee84c19a25..ba5b318993ec 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c @@ -147,7 +147,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - spaceorb = kzalloc_obj(*spaceorb, GFP_KERNEL); + spaceorb = kzalloc_obj(*spaceorb); input_dev = input_allocate_device(); if (!spaceorb || !input_dev) goto fail1; diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c index 81d4d1aa1752..011f9b137dca 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c @@ -118,7 +118,7 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - stinger = kmalloc_obj(*stinger, GFP_KERNEL); + stinger = kmalloc_obj(*stinger); input_dev = input_allocate_device(); if (!stinger || !input_dev) goto fail1; diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c index 8d1367fdc400..d419f41e62ac 100644 --- a/drivers/input/joystick/tmdc.c +++ b/drivers/input/joystick/tmdc.c @@ -264,7 +264,7 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data) int i, j, b = 0; int err; - tmdc->port[idx] = port = kzalloc_obj(struct tmdc_port, GFP_KERNEL); + tmdc->port[idx] = port = kzalloc_obj(struct tmdc_port); input_dev = input_allocate_device(); if (!port || !input_dev) { err = -ENOMEM; @@ -348,7 +348,7 @@ static int tmdc_connect(struct gameport *gameport, struct gameport_driver *drv) int i; int err; - tmdc = kzalloc_obj(*tmdc, GFP_KERNEL); + tmdc = kzalloc_obj(*tmdc); if (!tmdc) return -ENOMEM; diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 90cddb12efbb..4ee45f27290a 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -170,7 +170,7 @@ static void tgfx_attach(struct parport *pp) return; } - tgfx = kzalloc_obj(*tgfx, GFP_KERNEL); + tgfx = kzalloc_obj(*tgfx); if (!tgfx) { printk(KERN_ERR "turbografx.c: Not enough memory\n"); goto err_unreg_pardev; diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c index e8f81d3a4d99..fb452552ceb2 100644 --- a/drivers/input/joystick/twidjoy.c +++ b/drivers/input/joystick/twidjoy.c @@ -171,7 +171,7 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - twidjoy = kzalloc_obj(*twidjoy, GFP_KERNEL); + twidjoy = kzalloc_obj(*twidjoy); input_dev = input_allocate_device(); if (!twidjoy || !input_dev) goto fail1; diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index 45027058a777..2e1c6df98e24 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c @@ -124,7 +124,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - warrior = kzalloc_obj(*warrior, GFP_KERNEL); + warrior = kzalloc_obj(*warrior); input_dev = input_allocate_device(); if (!warrior || !input_dev) goto fail1; diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 58ff39dee70c..bf4accf3f581 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1744,7 +1744,7 @@ static int xpad_led_probe(struct usb_xpad *xpad) if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX360W) return 0; - xpad->led = led = kzalloc_obj(*led, GFP_KERNEL); + xpad->led = led = kzalloc_obj(*led); if (!led) return -ENOMEM; @@ -2077,7 +2077,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id break; } - xpad = kzalloc_obj(*xpad, GFP_KERNEL); + xpad = kzalloc_obj(*xpad); if (!xpad) return -ENOMEM; diff --git a/drivers/input/joystick/zhenhua.c b/drivers/input/joystick/zhenhua.c index 873e71fe6580..8ca1896639de 100644 --- a/drivers/input/joystick/zhenhua.c +++ b/drivers/input/joystick/zhenhua.c @@ -131,7 +131,7 @@ static int zhenhua_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - zhenhua = kzalloc_obj(*zhenhua, GFP_KERNEL); + zhenhua = kzalloc_obj(*zhenhua); input_dev = input_allocate_device(); if (!zhenhua || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index f149ed800a45..840cdf5878dc 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -1277,7 +1277,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *dev; int err = -ENOMEM; - atkbd = kzalloc_obj(*atkbd, GFP_KERNEL); + atkbd = kzalloc_obj(*atkbd); dev = input_allocate_device(); if (!atkbd || !dev) goto fail1; diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index 8f246865a5ee..5ebde20df755 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@ -447,7 +447,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv) uint8_t did, *idd; int error; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); input_dev = input_allocate_device(); if (!dev || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index f0daee8887cb..f5c2267a2c00 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c @@ -608,7 +608,7 @@ static int lkkbd_connect(struct serio *serio, struct serio_driver *drv) int i; int err; - lk = kzalloc_obj(*lk, GFP_KERNEL); + lk = kzalloc_obj(*lk); input_dev = input_allocate_device(); if (!lk || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index b6b9354b3354..6351562ebf8d 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -224,7 +224,7 @@ static int locomokbd_probe(struct locomo_dev *dev) struct input_dev *input_dev; int i, err; - locomokbd = kzalloc_obj(*locomokbd, GFP_KERNEL); + locomokbd = kzalloc_obj(*locomokbd); input_dev = input_allocate_device(); if (!locomokbd || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 52dfdcab55f2..80a5181313e1 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -151,7 +151,7 @@ static int probe_maple_kbd(struct device *dev) mdev = to_maple_dev(dev); mdrv = to_maple_driver(dev->driver); - kbd = kzalloc_obj(*kbd, GFP_KERNEL); + kbd = kzalloc_obj(*kbd); if (!kbd) { error = -ENOMEM; goto fail; diff --git a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c index ee142a2d7c84..e60d1181dad0 100644 --- a/drivers/input/keyboard/newtonkbd.c +++ b/drivers/input/keyboard/newtonkbd.c @@ -68,7 +68,7 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - nkbd = kzalloc_obj(*nkbd, GFP_KERNEL); + nkbd = kzalloc_obj(*nkbd); input_dev = input_allocate_device(); if (!nkbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 7ad799efc539..6937f3576c05 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -184,7 +184,7 @@ static int sh_keysc_probe(struct platform_device *pdev) if (irq < 0) goto err0; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); error = -ENOMEM; diff --git a/drivers/input/keyboard/stowaway.c b/drivers/input/keyboard/stowaway.c index 592801876291..eade05542ed6 100644 --- a/drivers/input/keyboard/stowaway.c +++ b/drivers/input/keyboard/stowaway.c @@ -72,7 +72,7 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - skbd = kzalloc_obj(*skbd, GFP_KERNEL); + skbd = kzalloc_obj(*skbd); input_dev = input_allocate_device(); if (!skbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index d2783e9a5583..5a0020827047 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c @@ -262,7 +262,7 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - sunkbd = kzalloc_obj(*sunkbd, GFP_KERNEL); + sunkbd = kzalloc_obj(*sunkbd); input_dev = input_allocate_device(); if (!sunkbd || !input_dev) goto fail1; diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c index ce061bd76623..c0b4978a8cd5 100644 --- a/drivers/input/keyboard/xtkbd.c +++ b/drivers/input/keyboard/xtkbd.c @@ -70,7 +70,7 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv) int err = -ENOMEM; int i; - xtkbd = kmalloc_obj(*xtkbd, GFP_KERNEL); + xtkbd = kmalloc_obj(*xtkbd); input_dev = input_allocate_device(); if (!xtkbd || !input_dev) goto fail1; diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c index 32d2f4450b7c..fee28e537898 100644 --- a/drivers/input/misc/88pm80x_onkey.c +++ b/drivers/input/misc/88pm80x_onkey.c @@ -57,7 +57,7 @@ static int pm80x_onkey_probe(struct platform_device *pdev) struct pm80x_onkey_info *info; int err; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index faa03c0b8c92..8db2dca84975 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c @@ -772,7 +772,7 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d if (alt->desc.bInterfaceNumber) return -ENODEV; - ar2 = kzalloc_obj(struct ati_remote2, GFP_KERNEL); + ar2 = kzalloc_obj(struct ati_remote2); if (!ar2) return -ENOMEM; diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 3fbdd160fb2c..353d3c1d347d 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -696,7 +696,7 @@ static int cm109_usb_probe(struct usb_interface *intf, if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -721,7 +721,7 @@ static int cm109_usb_probe(struct usb_interface *intf, if (!dev->ctl_data) goto err_out; - dev->ctl_req = kmalloc_obj(*(dev->ctl_req), GFP_KERNEL); + dev->ctl_req = kmalloc_obj(*(dev->ctl_req)); if (!dev->ctl_req) goto err_out; diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c index b5047f74f632..a641453188d9 100644 --- a/drivers/input/misc/cma3000_d0x.c +++ b/drivers/input/misc/cma3000_d0x.c @@ -285,7 +285,7 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq, goto err_out; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); input_dev = input_allocate_device(); if (!data || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/misc/cs40l50-vibra.c b/drivers/input/misc/cs40l50-vibra.c index e6c8c9d165d3..996d6c38cca4 100644 --- a/drivers/input/misc/cs40l50-vibra.c +++ b/drivers/input/misc/cs40l50-vibra.c @@ -276,7 +276,7 @@ static void cs40l50_add_worker(struct work_struct *work) /* Update effect if already uploaded, otherwise create new effect */ effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head); if (!effect) { - effect = kzalloc_obj(*effect, GFP_KERNEL); + effect = kzalloc_obj(*effect); if (!effect) { error = -ENOMEM; goto err_pm; diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c index 49112b3ff445..180b3bc76525 100644 --- a/drivers/input/misc/da9052_onkey.c +++ b/drivers/input/misc/da9052_onkey.c @@ -80,7 +80,7 @@ static int da9052_onkey_probe(struct platform_device *pdev) return -EINVAL; } - onkey = kzalloc_obj(*onkey, GFP_KERNEL); + onkey = kzalloc_obj(*onkey); input_dev = input_allocate_device(); if (!onkey || !input_dev) { dev_err(&pdev->dev, "Failed to allocate memory\n"); diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 52ad6e3a8112..f69de9762c4e 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -286,7 +286,7 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu) struct input_dev *input; int error; - gamepad = kzalloc_obj(*gamepad, GFP_KERNEL); + gamepad = kzalloc_obj(*gamepad); input = input_allocate_device(); if (!gamepad || !input) { dev_err(pcu->dev, @@ -1991,7 +1991,7 @@ static int ims_pcu_probe(struct usb_interface *intf, struct ims_pcu *pcu; int error; - pcu = kzalloc_obj(*pcu, GFP_KERNEL); + pcu = kzalloc_obj(*pcu); if (!pcu) return -ENOMEM; diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 219a7a92e5b6..152633bd2266 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -453,7 +453,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic if (!endpoint) return -ENODEV; - remote = kzalloc_obj(*remote, GFP_KERNEL); + remote = kzalloc_obj(*remote); input_dev = input_allocate_device(); if (!remote || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index 290c03d8b972..975c3ba023f5 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -247,7 +247,7 @@ static int max8997_haptic_probe(struct platform_device *pdev) return -EINVAL; } - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); input_dev = input_allocate_device(); if (!chip || !input_dev) { dev_err(&pdev->dev, "unable to allocate memory\n"); diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c index d75af824033a..cb781ce967ca 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c @@ -108,7 +108,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev) return -ENOMEM; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { err = -ENOMEM; dev_dbg(&pdev->dev, "Can't allocate power button\n"); diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c index c1608cdee7f2..f22083f44d91 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -164,7 +164,7 @@ static int palmas_pwron_probe(struct platform_device *pdev) palmas_pwron_params_ofinit(dev, &config); - pwron = kzalloc_obj(*pwron, GFP_KERNEL); + pwron = kzalloc_obj(*pwron); if (!pwron) return -ENOMEM; diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c index 003bc50f83a6..b19899b50d0b 100644 --- a/drivers/input/misc/pcap_keys.c +++ b/drivers/input/misc/pcap_keys.c @@ -49,7 +49,7 @@ static int pcap_keys_probe(struct platform_device *pdev) struct pcap_keys *pcap_keys; struct input_dev *input_dev; - pcap_keys = kmalloc_obj(*pcap_keys, GFP_KERNEL); + pcap_keys = kmalloc_obj(*pcap_keys); if (!pcap_keys) return err; diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index bcef6a251237..14fc6c6cf699 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c @@ -91,7 +91,7 @@ static int pcf8574_kp_probe(struct i2c_client *client) return -ENODEV; } - lp = kzalloc_obj(*lp, GFP_KERNEL); + lp = kzalloc_obj(*lp); if (!lp) return -ENOMEM; diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index dfcab914d5f3..754379d2625c 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c @@ -275,7 +275,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev if (!pm->data) return -1; - pm->configcr = kmalloc_obj(*(pm->configcr), GFP_KERNEL); + pm->configcr = kmalloc_obj(*(pm->configcr)); if (!pm->configcr) return -ENOMEM; @@ -313,7 +313,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i 0, interface->desc.bInterfaceNumber, NULL, 0, USB_CTRL_SET_TIMEOUT); - pm = kzalloc_obj(*pm, GFP_KERNEL); + pm = kzalloc_obj(*pm); input_dev = input_allocate_device(); if (!pm || !input_dev) goto fail1; diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index f34bda9b1a74..e589060db280 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -379,7 +379,7 @@ static int uinput_open(struct inode *inode, struct file *file) { struct uinput_device *newdev; - newdev = kzalloc_obj(*newdev, GFP_KERNEL); + newdev = kzalloc_obj(*newdev); if (!newdev) return -ENOMEM; diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index b046df24a433..6471d836f6fe 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c @@ -205,7 +205,7 @@ static int xenkbd_probe(struct xenbus_device *dev, struct xenkbd_info *info; struct input_dev *kbd, *ptr, *mtouch; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 10a85f60f6d1..8786ed8b3565 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c @@ -831,7 +831,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - yld = kzalloc_obj(*yld, GFP_KERNEL); + yld = kzalloc_obj(*yld); if (!yld) return -ENOMEM; @@ -854,7 +854,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!yld->ctl_data) return usb_cleanup(yld, -ENOMEM); - yld->ctl_req = kmalloc_obj(*(yld->ctl_req), GFP_KERNEL); + yld->ctl_req = kmalloc_obj(*(yld->ctl_req)); if (yld->ctl_req == NULL) return usb_cleanup(yld, -ENOMEM); diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 700dad83f6d0..f3d3b6b4e02d 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -3206,7 +3206,7 @@ int alps_detect(struct psmouse *psmouse, bool set_properties) */ psmouse_reset(psmouse); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index f9b8a4aa24e3..87d8f5afdfd9 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -852,7 +852,7 @@ static int atp_probe(struct usb_interface *iface, } /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "Out of memory\n"); diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index a193dc4f8b09..8e3cea9db365 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -895,7 +895,7 @@ static int bcm5974_probe(struct usb_interface *iface, cfg = bcm5974_get_config(udev); /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "out of memory\n"); diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c index ec9306e15a07..f5770a3af2f1 100644 --- a/drivers/input/mouse/byd.c +++ b/drivers/input/mouse/byd.c @@ -469,7 +469,7 @@ int byd_init(struct psmouse *psmouse) if (byd_reset_touchpad(psmouse)) return -EIO; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index e96b838afcf7..309063d07b4d 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -624,7 +624,7 @@ int cypress_init(struct psmouse *psmouse) struct cytp_data *cytp; int error; - cytp = kzalloc_obj(*cytp, GFP_KERNEL); + cytp = kzalloc_obj(*cytp); if (!cytp) return -ENOMEM; diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index c7f510fcb04f..f8575b80d19d 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -2074,7 +2074,7 @@ static int elantech_setup_ps2(struct psmouse *psmouse, int error = -EINVAL; struct input_dev *tp_dev; - psmouse->private = etd = kzalloc_obj(*etd, GFP_KERNEL); + psmouse->private = etd = kzalloc_obj(*etd); if (!etd) return -ENOMEM; diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c index 1e8e3f166b47..43f9939b7c63 100644 --- a/drivers/input/mouse/focaltech.c +++ b/drivers/input/mouse/focaltech.c @@ -408,7 +408,7 @@ int focaltech_init(struct psmouse *psmouse) struct focaltech_data *priv; int error; - psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index 23840c8fba32..3c4d16ed88a9 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c @@ -981,7 +981,7 @@ int hgpk_init(struct psmouse *psmouse) struct hgpk_data *priv; int err; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { err = -ENOMEM; goto alloc_fail; diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 6af7153e9dc7..ef11b7b19833 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -273,7 +273,7 @@ static int lifebook_create_relative_device(struct psmouse *psmouse) struct lifebook_data *priv; int error = -ENOMEM; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); dev2 = input_allocate_device(); if (!priv || !dev2) goto err_out; diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index ca4901eb7717..c99f7e234219 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -73,7 +73,7 @@ static int probe_maple_mouse(struct device *dev) struct input_dev *input_dev; struct dc_mouse *mse; - mse = kzalloc_obj(*mse, GFP_KERNEL); + mse = kzalloc_obj(*mse); if (!mse) { error = -ENOMEM; goto fail; diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 46907609d3d4..ff8cd2d68a3c 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1591,7 +1591,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) psmouse_deactivate(parent); } - psmouse = kzalloc_obj(*psmouse, GFP_KERNEL); + psmouse = kzalloc_obj(*psmouse); input_dev = input_allocate_device(); if (!psmouse || !input_dev) goto err_free; diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c index 96df86872017..7fb4cbb2aca2 100644 --- a/drivers/input/mouse/psmouse-smbus.c +++ b/drivers/input/mouse/psmouse-smbus.c @@ -154,7 +154,7 @@ static void psmouse_smbus_schedule_remove(struct i2c_client *client) { struct psmouse_smbus_removal_work *rwork; - rwork = kzalloc_obj(*rwork, GFP_KERNEL); + rwork = kzalloc_obj(*rwork); if (rwork) { INIT_WORK(&rwork->work, psmouse_smbus_remove_i2c_device); rwork->client = client; diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 4d1fc22f9732..cda6febe3faf 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c @@ -1028,7 +1028,7 @@ int fsp_init(struct psmouse *psmouse) "Finger Sensing Pad, hw: %d.%d.%d, sn: %x, sw: %s\n", ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver); - psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index c38779fcff72..c334a488700f 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c @@ -231,7 +231,7 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv) unsigned char c = serio->id.extra; int err = -ENOMEM; - sermouse = kzalloc_obj(*sermouse, GFP_KERNEL); + sermouse = kzalloc_obj(*sermouse); input_dev = input_allocate_device(); if (!sermouse || !input_dev) goto fail1; diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index b9dfcdbefaed..26071128f43a 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -741,7 +741,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) { struct serio *serio; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) { psmouse_err(psmouse, "not enough memory for pass-through port\n"); @@ -1597,7 +1597,7 @@ static int synaptics_init_ps2(struct psmouse *psmouse, synaptics_apply_quirks(psmouse, info); - psmouse->private = priv = kzalloc_obj(*priv, GFP_KERNEL); + psmouse->private = priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/input/mouse/synaptics_usb.c b/drivers/input/mouse/synaptics_usb.c index 296de386fafe..5a86f6f387d8 100644 --- a/drivers/input/mouse/synaptics_usb.c +++ b/drivers/input/mouse/synaptics_usb.c @@ -311,7 +311,7 @@ static int synusb_probe(struct usb_interface *intf, if (!ep) return -ENODEV; - synusb = kzalloc_obj(*synusb, GFP_KERNEL); + synusb = kzalloc_obj(*synusb); input_dev = input_allocate_device(); if (!synusb || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index c2b2cd057ca3..b06c7ad721fe 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -409,7 +409,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) if (!set_properties) return 0; - tp = kzalloc_obj(*tp, GFP_KERNEL); + tp = kzalloc_obj(*tp); if (!tp) return -ENOMEM; diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index eda8f9192423..aaecdd3d50b6 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c @@ -409,7 +409,7 @@ int vmmouse_init(struct psmouse *psmouse) if (error) return error; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); abs_dev = input_allocate_device(); if (!priv || !abs_dev) { error = -ENOMEM; diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 4556c5232a82..042a17fe81db 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c @@ -456,7 +456,7 @@ static int vsxxxaa_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - mouse = kzalloc_obj(*mouse, GFP_KERNEL); + mouse = kzalloc_obj(*mouse); input_dev = input_allocate_device(); if (!mouse || !input_dev) goto fail1; diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 0b842077a7b4..d5c9b0a09fcf 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -543,7 +543,7 @@ static int mousedev_open(struct inode *inode, struct file *file) #endif mousedev = container_of(inode->i_cdev, struct mousedev, cdev); - client = kzalloc_obj(struct mousedev_client, GFP_KERNEL); + client = kzalloc_obj(struct mousedev_client); if (!client) return -ENOMEM; @@ -853,7 +853,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev, goto err_out; } - mousedev = kzalloc_obj(struct mousedev, GFP_KERNEL); + mousedev = kzalloc_obj(struct mousedev); if (!mousedev) { error = -ENOMEM; goto err_free_minor; diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index 0e2bb94e67cc..687cb987bc13 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c @@ -78,7 +78,7 @@ int rmi_register_transport_device(struct rmi_transport_dev *xport) struct rmi_device *rmi_dev; int error; - rmi_dev = kzalloc_obj(struct rmi_device, GFP_KERNEL); + rmi_dev = kzalloc_obj(struct rmi_device); if (!rmi_dev) return -ENOMEM; diff --git a/drivers/input/rmi4/rmi_f03.c b/drivers/input/rmi4/rmi_f03.c index 1c7be2d9df42..04f0e5578861 100644 --- a/drivers/input/rmi4/rmi_f03.c +++ b/drivers/input/rmi4/rmi_f03.c @@ -171,7 +171,7 @@ static int rmi_f03_register_pt(struct f03_data *f03) { struct serio *serio; - serio = kzalloc_obj(struct serio, GFP_KERNEL); + serio = kzalloc_obj(struct serio); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index b2f5fec9290c..4bf37db65b76 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c @@ -100,7 +100,7 @@ static int altera_ps2_probe(struct platform_device *pdev) return error; } - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 5a4ef62fa3d3..046b8f388eb6 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c @@ -114,8 +114,8 @@ static int amba_kmi_probe(struct amba_device *dev, if (ret) return ret; - kmi = kzalloc_obj(*kmi, GFP_KERNEL); - io = kzalloc_obj(*io, GFP_KERNEL); + kmi = kzalloc_obj(*kmi); + io = kzalloc_obj(*io); if (!kmi || !io) { ret = -ENOMEM; goto out; diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 206e6dc3f502..e346bf53eb16 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c @@ -150,7 +150,7 @@ static int ams_delta_serio_init(struct platform_device *pdev) return err; } - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 5828a4e9fe82..0aa4ab00af35 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -165,7 +165,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) /* Set reload register to core freq in kHz/10 */ iowrite32be(freq_hz / 10000, &priv->regs->reload); - priv->io = kzalloc_obj(*priv->io, GFP_KERNEL); + priv->io = kzalloc_obj(*priv->io); if (!priv->io) return -ENOMEM; diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index bce8d6308f8d..2eb069a0f054 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -155,7 +155,7 @@ static int arc_ps2_create_port(struct platform_device *pdev, struct arc_ps2_port *port = &arc_ps2->port[index]; struct serio *io; - io = kzalloc_obj(*io, GFP_KERNEL); + io = kzalloc_obj(*io); if (!io) return -ENOMEM; diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 3a7424bdf877..fe5f9eda4b77 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c @@ -158,7 +158,7 @@ static int __init ct82c710_detect(void) static int ct82c710_probe(struct platform_device *dev) { - ct82c710_port = kzalloc_obj(*ct82c710_port, GFP_KERNEL); + ct82c710_port = kzalloc_obj(*ct82c710_port); if (!ct82c710_port) return -ENOMEM; diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 59c242f97fd3..22b2f57fd91f 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -350,8 +350,8 @@ static int __init gscps2_probe(struct parisc_device *dev) if (dev->id.sversion == 0x96) hpa += GSC_DINO_OFFSET; - ps2port = kzalloc_obj(*ps2port, GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + ps2port = kzalloc_obj(*ps2port); + serio = kzalloc_obj(*serio); if (!ps2port || !serio) { ret = -ENOMEM; goto fail_nomem; diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index f56252d6df5b..2680a816c393 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -939,7 +939,7 @@ int hil_mlc_register(hil_mlc *mlc) for (i = 0; i < HIL_MLC_DEVMEM; i++) { struct serio *mlc_serio; hil_mlc_copy_di_scratch(mlc, i); - mlc_serio = kzalloc_obj(*mlc_serio, GFP_KERNEL); + mlc_serio = kzalloc_obj(*mlc_serio); mlc->serio[i] = mlc_serio; if (!mlc->serio[i]) { for (; i >= 0; i--) diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c index 7cbf726b47a7..13434b9330c8 100644 --- a/drivers/input/serio/hyperv-keyboard.c +++ b/drivers/input/serio/hyperv-keyboard.c @@ -316,8 +316,8 @@ static int hv_kbd_probe(struct hv_device *hv_dev, struct serio *hv_serio; int error; - kbd_dev = kzalloc_obj(*kbd_dev, GFP_KERNEL); - hv_serio = kzalloc_obj(*hv_serio, GFP_KERNEL); + kbd_dev = kzalloc_obj(*kbd_dev); + hv_serio = kzalloc_obj(*hv_serio); if (!kbd_dev || !hv_serio) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 1a5a7f2f0214..8bcce11cb7ce 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -1324,7 +1324,7 @@ static int i8042_create_kbd_port(void) struct serio *serio; struct i8042_port *port = &i8042_ports[I8042_KBD_PORT_NO]; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; @@ -1354,7 +1354,7 @@ static int i8042_create_aux_port(int idx) int port_no = idx < 0 ? I8042_AUX_PORT_NO : I8042_MUX_PORT_NO + idx; struct i8042_port *port = &i8042_ports[port_no]; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/ioc3kbd.c b/drivers/input/serio/ioc3kbd.c index 650758115bf0..4ef60c24e788 100644 --- a/drivers/input/serio/ioc3kbd.c +++ b/drivers/input/serio/ioc3kbd.c @@ -139,11 +139,11 @@ static int ioc3kbd_probe(struct platform_device *pdev) if (!d) return -ENOMEM; - sk = kzalloc_obj(*sk, GFP_KERNEL); + sk = kzalloc_obj(*sk); if (!sk) return -ENOMEM; - sa = kzalloc_obj(*sa, GFP_KERNEL); + sa = kzalloc_obj(*sa); if (!sa) { kfree(sk); return -ENOMEM; diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c index dda52b7d2c1d..fb41e7f5af46 100644 --- a/drivers/input/serio/maceps2.c +++ b/drivers/input/serio/maceps2.c @@ -117,7 +117,7 @@ static struct serio *maceps2_allocate_port(int idx) { struct serio *serio; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (serio) { serio->id.type = SERIO_8042; serio->write = maceps2_write; diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index 14c235b0b4e4..ccc40634f582 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c @@ -188,7 +188,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) return priv->irq; /* KEYBOARD */ - kb_serio = kzalloc_obj(*kb_serio, GFP_KERNEL); + kb_serio = kzalloc_obj(*kb_serio); if (!kb_serio) return -ENOMEM; kb_serio->id.type = SERIO_8042_XL; @@ -203,7 +203,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) serio_register_port(kb_serio); /* TOUCHPAD */ - pad_serio = kzalloc_obj(*pad_serio, GFP_KERNEL); + pad_serio = kzalloc_obj(*pad_serio); if (!pad_serio) { error = -ENOMEM; goto err_pad; diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c index a4b830b499f6..09a24413d940 100644 --- a/drivers/input/serio/parkbd.c +++ b/drivers/input/serio/parkbd.c @@ -165,7 +165,7 @@ static struct serio *parkbd_allocate_serio(void) { struct serio *serio; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (serio) { serio->id.type = parkbd_mode; serio->write = parkbd_write; diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index 9e5d022fa502..78f47b0ca125 100644 --- a/drivers/input/serio/pcips2.c +++ b/drivers/input/serio/pcips2.c @@ -137,8 +137,8 @@ static int pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id) if (ret) goto disable; - ps2if = kzalloc_obj(*ps2if, GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + ps2if = kzalloc_obj(*ps2if); + serio = kzalloc_obj(*serio); if (!ps2if || !serio) { ret = -ENOMEM; goto release; diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index a52ce59952a9..6cde0d88c6f4 100644 --- a/drivers/input/serio/ps2-gpio.c +++ b/drivers/input/serio/ps2-gpio.c @@ -405,7 +405,7 @@ static int ps2_gpio_probe(struct platform_device *pdev) int error; drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!drvdata || !serio) { error = -ENOMEM; goto err_free_serio; diff --git a/drivers/input/serio/ps2mult.c b/drivers/input/serio/ps2mult.c index e0462ac3aa1d..27d554b59658 100644 --- a/drivers/input/serio/ps2mult.c +++ b/drivers/input/serio/ps2mult.c @@ -122,7 +122,7 @@ static int ps2mult_create_port(struct ps2mult *psm, int i) struct serio *mx_serio = psm->mx_serio; struct serio *serio; - serio = kzalloc_obj(*serio, GFP_KERNEL); + serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; @@ -160,7 +160,7 @@ static int ps2mult_connect(struct serio *serio, struct serio_driver *drv) if (!serio->write) return -EINVAL; - psm = kzalloc_obj(*psm, GFP_KERNEL); + psm = kzalloc_obj(*psm); if (!psm) return -ENOMEM; diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index 55c254fbdb24..2f553efbe649 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c @@ -102,8 +102,8 @@ static int q40kbd_probe(struct platform_device *pdev) struct serio *port; int error; - q40kbd = kzalloc_obj(*q40kbd, GFP_KERNEL); - port = kzalloc_obj(*port, GFP_KERNEL); + q40kbd = kzalloc_obj(*q40kbd); + port = kzalloc_obj(*port); if (!q40kbd || !port) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index c097716da53e..4d817850ba3b 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c @@ -108,8 +108,8 @@ static int rpckbd_probe(struct platform_device *dev) if (tx_irq < 0) return tx_irq; - serio = kzalloc_obj(*serio, GFP_KERNEL); - rpckbd = kzalloc_obj(*rpckbd, GFP_KERNEL); + serio = kzalloc_obj(*serio); + rpckbd = kzalloc_obj(*rpckbd); if (!serio || !rpckbd) { kfree(rpckbd); kfree(serio); diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c index 32752d898797..e3a463c157d1 100644 --- a/drivers/input/serio/sa1111ps2.c +++ b/drivers/input/serio/sa1111ps2.c @@ -254,8 +254,8 @@ static int ps2_probe(struct sa1111_dev *dev) struct serio *serio; int ret; - ps2if = kzalloc_obj(*ps2if, GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + ps2if = kzalloc_obj(*ps2if); + serio = kzalloc_obj(*serio); if (!ps2if || !serio) { ret = -ENOMEM; goto free; diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 70df54435a94..a7ccedfa459c 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -270,7 +270,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) struct serio_raw *serio_raw; int err; - serio_raw = kzalloc_obj(*serio_raw, GFP_KERNEL); + serio_raw = kzalloc_obj(*serio_raw); if (!serio_raw) { dev_dbg(&serio->dev, "can't allocate memory for a device\n"); return -ENOMEM; diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 46087c02c340..cabe3876c168 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c @@ -78,7 +78,7 @@ static int serport_ldisc_open(struct tty_struct *tty) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - serport = kzalloc_obj(*serport, GFP_KERNEL); + serport = kzalloc_obj(*serport); if (!serport) return -ENOMEM; @@ -159,7 +159,7 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, if (test_and_set_bit(SERPORT_BUSY, &serport->flags)) return -EBUSY; - serport->serio = serio = kzalloc_obj(*serio, GFP_KERNEL); + serport->serio = serio = kzalloc_obj(*serio); if (!serio) return -ENOMEM; diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index 5b46c66b2100..a9812789771c 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -209,8 +209,8 @@ static int sun4i_ps2_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int error; - drvdata = kzalloc_obj(*drvdata, GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + drvdata = kzalloc_obj(*drvdata); + serio = kzalloc_obj(*serio); if (!drvdata || !serio) { error = -ENOMEM; goto err_free_mem; diff --git a/drivers/input/serio/userio.c b/drivers/input/serio/userio.c index 3bdb17b4dd25..91cb7a177b2d 100644 --- a/drivers/input/serio/userio.c +++ b/drivers/input/serio/userio.c @@ -73,7 +73,7 @@ static int userio_device_write(struct serio *id, unsigned char val) static int userio_char_open(struct inode *inode, struct file *file) { struct userio_device *userio __free(kfree) = - kzalloc_obj(*userio, GFP_KERNEL); + kzalloc_obj(*userio); if (!userio) return -ENOMEM; @@ -81,7 +81,7 @@ static int userio_char_open(struct inode *inode, struct file *file) spin_lock_init(&userio->buf_lock); init_waitqueue_head(&userio->waitq); - userio->serio = kzalloc_obj(*userio->serio, GFP_KERNEL); + userio->serio = kzalloc_obj(*userio->serio); if (!userio->serio) return -ENOMEM; diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index 0c9ddc532c31..411d55ca1a66 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c @@ -247,8 +247,8 @@ static int xps2_of_probe(struct platform_device *ofdev) return -ENODEV; } - drvdata = kzalloc_obj(*drvdata, GFP_KERNEL); - serio = kzalloc_obj(*serio, GFP_KERNEL); + drvdata = kzalloc_obj(*drvdata); + serio = kzalloc_obj(*serio); if (!drvdata || !serio) { error = -ENOMEM; goto failed1; diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index 6f39938d5bbc..ba79dff21aac 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c @@ -129,7 +129,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - acecad = kzalloc_obj(*acecad, GFP_KERNEL); + acecad = kzalloc_obj(*acecad); input_dev = input_allocate_device(); if (!acecad || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index df9ed01dcdb3..6df24cee3c9d 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -1673,7 +1673,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) */ speeds[0] = programmableDelay; - aiptek = kzalloc_obj(*aiptek, GFP_KERNEL); + aiptek = kzalloc_obj(*aiptek); inputdev = input_allocate_device(); if (!aiptek || !inputdev) { dev_warn(&intf->dev, diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c index 264cb9c6e807..fd5a7e761dcc 100644 --- a/drivers/input/tablet/hanwang.c +++ b/drivers/input/tablet/hanwang.c @@ -322,7 +322,7 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id if (intf->cur_altsetting->desc.bNumEndpoints < 1) return -ENODEV; - hanwang = kzalloc_obj(*hanwang, GFP_KERNEL); + hanwang = kzalloc_obj(*hanwang); input_dev = input_allocate_device(); if (!hanwang || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 658cf6c144bb..6ce70c8e2d7c 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -121,7 +121,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i if (!usb_endpoint_is_int_in(endpoint)) return -ENODEV; - kbtab = kzalloc_obj(*kbtab, GFP_KERNEL); + kbtab = kzalloc_obj(*kbtab); input_dev = input_allocate_device(); if (!kbtab || !input_dev) goto fail1; diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c index 8ba71855421b..4ce20befc657 100644 --- a/drivers/input/tablet/pegasus_notetaker.c +++ b/drivers/input/tablet/pegasus_notetaker.c @@ -293,7 +293,7 @@ static int pegasus_probe(struct usb_interface *intf, endpoint = &intf->cur_altsetting->endpoint[0].desc; - pegasus = kzalloc_obj(*pegasus, GFP_KERNEL); + pegasus = kzalloc_obj(*pegasus); input_dev = input_allocate_device(); if (!pegasus || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/tablet/wacom_serial4.c b/drivers/input/tablet/wacom_serial4.c index 218eb157288b..bc0c77e5487f 100644 --- a/drivers/input/tablet/wacom_serial4.c +++ b/drivers/input/tablet/wacom_serial4.c @@ -521,7 +521,7 @@ static int wacom_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err = -ENOMEM; - wacom = kzalloc_obj(*wacom, GFP_KERNEL); + wacom = kzalloc_obj(*wacom); input_dev = input_allocate_device(); if (!wacom || !input_dev) goto free_device; diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 404a4b7f4021..33c5eb522389 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -201,7 +201,7 @@ static int ad7877_read(struct spi_device *spi, u16 reg) struct ser_req *req; int status, ret; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -232,7 +232,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val) struct ser_req *req; int status; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -259,7 +259,7 @@ static int ad7877_read_adc(struct spi_device *spi, unsigned command) int sample; int i; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 656e907bc13d..0963b1a78a0c 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -357,7 +357,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) struct ser_req *req; int status; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -442,7 +442,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command) struct ads7845_ser_req *req; int status; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index ab36ecf2ab3b..a8e3d85eece7 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c @@ -232,7 +232,7 @@ static int da9052_ts_probe(struct platform_device *pdev) if (!da9052) return -EINVAL; - tsi = kzalloc_obj(*tsi, GFP_KERNEL); + tsi = kzalloc_obj(*tsi); input_dev = input_allocate_device(); if (!tsi || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/dynapro.c b/drivers/input/touchscreen/dynapro.c index 6d9a25269639..943ba8c2fb6c 100644 --- a/drivers/input/touchscreen/dynapro.c +++ b/drivers/input/touchscreen/dynapro.c @@ -110,7 +110,7 @@ static int dynapro_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - pdynapro = kzalloc_obj(*pdynapro, GFP_KERNEL); + pdynapro = kzalloc_obj(*pdynapro); input_dev = input_allocate_device(); if (!pdynapro || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/egalax_ts_serial.c b/drivers/input/touchscreen/egalax_ts_serial.c index b741843719ab..e04ea1fea4ad 100644 --- a/drivers/input/touchscreen/egalax_ts_serial.c +++ b/drivers/input/touchscreen/egalax_ts_serial.c @@ -99,7 +99,7 @@ static int egalax_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int error; - egalax = kzalloc_obj(*egalax, GFP_KERNEL); + egalax = kzalloc_obj(*egalax); input_dev = input_allocate_device(); if (!egalax || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index f75ea0caf7f9..434b9b47e964 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c @@ -307,7 +307,7 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - elo = kzalloc_obj(*elo, GFP_KERNEL); + elo = kzalloc_obj(*elo); input_dev = input_allocate_device(); if (!elo || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/fujitsu_ts.c b/drivers/input/touchscreen/fujitsu_ts.c index 3a4f47e37ae7..8ed592294b17 100644 --- a/drivers/input/touchscreen/fujitsu_ts.c +++ b/drivers/input/touchscreen/fujitsu_ts.c @@ -99,7 +99,7 @@ static int fujitsu_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - fujitsu = kzalloc_obj(*fujitsu, GFP_KERNEL); + fujitsu = kzalloc_obj(*fujitsu); input_dev = input_allocate_device(); if (!fujitsu || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c index 0311f80d263e..2baeb4f3b941 100644 --- a/drivers/input/touchscreen/gunze.c +++ b/drivers/input/touchscreen/gunze.c @@ -97,7 +97,7 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - gunze = kzalloc_obj(*gunze, GFP_KERNEL); + gunze = kzalloc_obj(*gunze); input_dev = input_allocate_device(); if (!gunze || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/hampshire.c b/drivers/input/touchscreen/hampshire.c index b6423c982726..394ae8c88d50 100644 --- a/drivers/input/touchscreen/hampshire.c +++ b/drivers/input/touchscreen/hampshire.c @@ -109,7 +109,7 @@ static int hampshire_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - phampshire = kzalloc_obj(*phampshire, GFP_KERNEL); + phampshire = kzalloc_obj(*phampshire); input_dev = input_allocate_device(); if (!phampshire || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/inexio.c b/drivers/input/touchscreen/inexio.c index 72caa754381e..ac3836ff2a30 100644 --- a/drivers/input/touchscreen/inexio.c +++ b/drivers/input/touchscreen/inexio.c @@ -114,7 +114,7 @@ static int inexio_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - pinexio = kzalloc_obj(*pinexio, GFP_KERNEL); + pinexio = kzalloc_obj(*pinexio); input_dev = input_allocate_device(); if (!pinexio || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index f539339ee6a0..4b7e70a4c6d5 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -168,7 +168,7 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) struct input_dev *idev; int ret = -ENOMEM; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); idev = input_allocate_device(); if (!priv || !idev) goto err_free_mem; diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index c7d5ca01beba..993d945dcd23 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c @@ -122,7 +122,7 @@ static int migor_ts_probe(struct i2c_client *client) struct input_dev *input; int error; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); input = input_allocate_device(); if (!priv || !input) { dev_err(&client->dev, "failed to allocate memory\n"); diff --git a/drivers/input/touchscreen/mtouch.c b/drivers/input/touchscreen/mtouch.c index f4e99ccee363..cc2d206d2f3d 100644 --- a/drivers/input/touchscreen/mtouch.c +++ b/drivers/input/touchscreen/mtouch.c @@ -128,7 +128,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - mtouch = kzalloc_obj(*mtouch, GFP_KERNEL); + mtouch = kzalloc_obj(*mtouch); input_dev = input_allocate_device(); if (!mtouch || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c index 05e90b36246f..7b89eb74b9de 100644 --- a/drivers/input/touchscreen/pcap_ts.c +++ b/drivers/input/touchscreen/pcap_ts.c @@ -138,7 +138,7 @@ static int pcap_ts_probe(struct platform_device *pdev) struct pcap_ts *pcap_ts; int err = -ENOMEM; - pcap_ts = kzalloc_obj(*pcap_ts, GFP_KERNEL); + pcap_ts = kzalloc_obj(*pcap_ts); if (!pcap_ts) return err; diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c index c4979ce707b8..4b57b6664e37 100644 --- a/drivers/input/touchscreen/penmount.c +++ b/drivers/input/touchscreen/penmount.c @@ -199,7 +199,7 @@ static int pm_connect(struct serio *serio, struct serio_driver *drv) int max_x, max_y; int err; - pm = kzalloc_obj(*pm, GFP_KERNEL); + pm = kzalloc_obj(*pm); input_dev = input_allocate_device(); if (!pm || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index dbe3ddb1194a..877eae34fb5a 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -672,7 +672,7 @@ static int sur40_probe(struct usb_interface *interface, return -ENODEV; /* Allocate memory for our device state and initialize it. */ - sur40 = kzalloc_obj(*sur40, GFP_KERNEL); + sur40 = kzalloc_obj(*sur40); if (!sur40) return -ENOMEM; diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index d03076da7f04..623546e80668 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -422,7 +422,7 @@ static int titsc_probe(struct platform_device *pdev) int err; /* Allocate memory for device */ - ts_dev = kzalloc_obj(*ts_dev, GFP_KERNEL); + ts_dev = kzalloc_obj(*ts_dev); input_dev = input_allocate_device(); if (!ts_dev || !input_dev) { dev_err(&pdev->dev, "failed to allocate memory.\n"); diff --git a/drivers/input/touchscreen/touchit213.c b/drivers/input/touchscreen/touchit213.c index 6fc1f60fd7a9..6d4a1acf57c9 100644 --- a/drivers/input/touchscreen/touchit213.c +++ b/drivers/input/touchscreen/touchit213.c @@ -139,7 +139,7 @@ static int touchit213_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - touchit213 = kzalloc_obj(*touchit213, GFP_KERNEL); + touchit213 = kzalloc_obj(*touchit213); input_dev = input_allocate_device(); if (!touchit213 || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/touchright.c b/drivers/input/touchscreen/touchright.c index 0493ead34b34..d7fdf201e4d1 100644 --- a/drivers/input/touchscreen/touchright.c +++ b/drivers/input/touchscreen/touchright.c @@ -102,7 +102,7 @@ static int tr_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - tr = kzalloc_obj(*tr, GFP_KERNEL); + tr = kzalloc_obj(*tr); input_dev = input_allocate_device(); if (!tr || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/touchwin.c b/drivers/input/touchscreen/touchwin.c index 687fee4a71b9..099fd88e65d8 100644 --- a/drivers/input/touchscreen/touchwin.c +++ b/drivers/input/touchscreen/touchwin.c @@ -109,7 +109,7 @@ static int tw_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int err; - tw = kzalloc_obj(*tw, GFP_KERNEL); + tw = kzalloc_obj(*tw); input_dev = input_allocate_device(); if (!tw || !input_dev) { err = -ENOMEM; diff --git a/drivers/input/touchscreen/tsc40.c b/drivers/input/touchscreen/tsc40.c index b83b839d7d5e..2a28a309eab5 100644 --- a/drivers/input/touchscreen/tsc40.c +++ b/drivers/input/touchscreen/tsc40.c @@ -83,7 +83,7 @@ static int tsc_connect(struct serio *serio, struct serio_driver *drv) struct input_dev *input_dev; int error; - ptsc = kzalloc_obj(*ptsc, GFP_KERNEL); + ptsc = kzalloc_obj(*ptsc); input_dev = input_allocate_device(); if (!ptsc || !input_dev) { error = -ENOMEM; diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 01dcf448a025..657555c8796c 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -378,7 +378,7 @@ static int mtouch_alloc(struct usbtouch_usb *usbtouch) { struct mtouch_priv *priv; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -938,7 +938,7 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch) struct nexio_priv *priv; int ret = -ENOMEM; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) goto out_buf; @@ -1458,7 +1458,7 @@ static int usbtouch_probe(struct usb_interface *intf, if (!endpoint) return -ENXIO; - usbtouch = kzalloc_obj(*usbtouch, GFP_KERNEL); + usbtouch = kzalloc_obj(*usbtouch); input_dev = input_allocate_device(); if (!usbtouch || !input_dev) goto out_free; diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 4ddca1128d35..45930d731873 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -596,7 +596,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) char basename[64] = "Wacom Serial"; int err, err_pen, err_touch; - w8001 = kzalloc_obj(*w8001, GFP_KERNEL); + w8001 = kzalloc_obj(*w8001); input_dev_pen = input_allocate_device(); input_dev_touch = input_allocate_device(); if (!w8001 || !input_dev_pen || !input_dev_touch) { diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e4e236798357..fde208ebe685 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -408,7 +408,7 @@ struct icc_node_data *of_icc_get_from_provider(const struct of_phandle_args *spe return ERR_CAST(node); if (!data) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); data->node = node; @@ -827,7 +827,7 @@ static struct icc_node *icc_node_create_nolock(int id) if (node) return node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return ERR_PTR(-ENOMEM); diff --git a/drivers/interconnect/debugfs-client.c b/drivers/interconnect/debugfs-client.c index 227235b4b184..5107bff53173 100644 --- a/drivers/interconnect/debugfs-client.c +++ b/drivers/interconnect/debugfs-client.c @@ -86,7 +86,7 @@ static int icc_get_set(void *data, u64 val) goto err_free; } - debugfs_path = kzalloc_obj(*debugfs_path, GFP_KERNEL); + debugfs_path = kzalloc_obj(*debugfs_path); if (!debugfs_path) { ret = -ENOMEM; goto err_put; diff --git a/drivers/interconnect/qcom/icc-common.c b/drivers/interconnect/qcom/icc-common.c index 5f90fcf7b22e..a25564fe1ebd 100644 --- a/drivers/interconnect/qcom/icc-common.c +++ b/drivers/interconnect/qcom/icc-common.c @@ -19,7 +19,7 @@ struct icc_node_data *qcom_icc_xlate_extended(const struct of_phandle_args *spec if (IS_ERR(node)) return ERR_CAST(node); - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index cdda0eb8056f..a05aed1fe5e9 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -1284,7 +1284,7 @@ set_dev_entry_from_acpi_range(struct amd_iommu *iommu, u16 first, u16 last, if (search_ivhd_dte_flags(iommu->pci_seg->id, first, last)) return; - d = kzalloc_obj(struct ivhd_dte_flags, GFP_KERNEL); + d = kzalloc_obj(struct ivhd_dte_flags); if (!d) return; @@ -1356,7 +1356,7 @@ int __init add_special_device(u8 type, u8 id, u32 *devid, bool cmd_line) return 0; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1387,7 +1387,7 @@ static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u32 *devid, return 0; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1720,7 +1720,7 @@ static struct amd_iommu_pci_seg *__init alloc_pci_segment(u16 id, if (last_bdf < 0) return NULL; - pci_seg = kzalloc_obj(struct amd_iommu_pci_seg, GFP_KERNEL); + pci_seg = kzalloc_obj(struct amd_iommu_pci_seg); if (pci_seg == NULL) return NULL; @@ -2040,7 +2040,7 @@ static int __init init_iommu_all(struct acpi_table_header *table) DUMP_printk(" mmio-addr: %016llx\n", h->mmio_phys); - iommu = kzalloc_obj(struct amd_iommu, GFP_KERNEL); + iommu = kzalloc_obj(struct amd_iommu); if (iommu == NULL) return -ENOMEM; @@ -2641,7 +2641,7 @@ static int __init init_unity_map_range(struct ivmd_header *m, if (pci_seg == NULL) return -ENOMEM; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (e == NULL) return -ENOMEM; diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index e26f94feeaa5..81c4d7733872 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -372,7 +372,7 @@ static struct iommu_dev_data *alloc_dev_data(struct amd_iommu *iommu, u16 devid) struct iommu_dev_data *dev_data; struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; - dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data); if (!dev_data) return NULL; @@ -2547,7 +2547,7 @@ struct protection_domain *protection_domain_alloc(void) struct protection_domain *domain; int domid; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; @@ -3248,7 +3248,7 @@ static struct irq_remap_table *__alloc_irq_table(int nid, size_t size) { struct irq_remap_table *table; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return NULL; @@ -3799,14 +3799,14 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, } ret = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto out_free_data; if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir)) - data->entry = kzalloc_obj(union irte, GFP_KERNEL); + data->entry = kzalloc_obj(union irte); else - data->entry = kzalloc_obj(struct irte_ga, GFP_KERNEL); + data->entry = kzalloc_obj(struct irte_ga); if (!data->entry) { kfree(data); goto out_free_data; diff --git a/drivers/iommu/amd/iommufd.c b/drivers/iommu/amd/iommufd.c index 760b3afaaf13..52300b867c1f 100644 --- a/drivers/iommu/amd/iommufd.c +++ b/drivers/iommu/amd/iommufd.c @@ -19,7 +19,7 @@ void *amd_iommufd_hw_info(struct device *dev, u32 *length, enum iommu_hw_info_ty *type != IOMMU_HW_INFO_TYPE_AMD) return ERR_PTR(-EOPNOTSUPP); - hwinfo = kzalloc_obj(*hwinfo, GFP_KERNEL); + hwinfo = kzalloc_obj(*hwinfo); if (!hwinfo) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/nested.c b/drivers/iommu/amd/nested.c index 1a5ff73db628..5b902598e68a 100644 --- a/drivers/iommu/amd/nested.c +++ b/drivers/iommu/amd/nested.c @@ -68,7 +68,7 @@ static void *gdom_info_load_or_alloc_locked(struct xarray *xa, unsigned long ind return elm; xa_unlock(xa); - elm = kzalloc_obj(struct guest_domain_mapping_info, GFP_KERNEL); + elm = kzalloc_obj(struct guest_domain_mapping_info); xa_lock(xa); if (!elm) return ERR_PTR(-ENOMEM); @@ -102,7 +102,7 @@ amd_iommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags, if (user_data->type != IOMMU_HWPT_DATA_AMD_GUEST) return ERR_PTR(-EOPNOTSUPP); - ndom = kzalloc_obj(*ndom, GFP_KERNEL); + ndom = kzalloc_obj(*ndom); if (!ndom) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/amd/pasid.c b/drivers/iommu/amd/pasid.c index 38cf8f519477..67eace9809f1 100644 --- a/drivers/iommu/amd/pasid.c +++ b/drivers/iommu/amd/pasid.c @@ -121,7 +121,7 @@ int iommu_sva_set_dev_pasid(struct iommu_domain *domain, return ret; /* Add PASID to protection domain pasid list */ - pdom_dev_data = kzalloc_obj(*pdom_dev_data, GFP_KERNEL); + pdom_dev_data = kzalloc_obj(*pdom_dev_data); if (pdom_dev_data == NULL) return ret; diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 6b679fa53c3e..17bdadb6b504 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -768,7 +768,7 @@ static struct iommu_domain *apple_dart_domain_alloc_paging(struct device *dev) { struct apple_dart_domain *dart_domain; - dart_domain = kzalloc_obj(*dart_domain, GFP_KERNEL); + dart_domain = kzalloc_obj(*dart_domain); if (!dart_domain) return NULL; @@ -812,7 +812,7 @@ static int apple_dart_of_xlate(struct device *dev, sid = args->args[0]; if (!cfg) { - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; /* Will be ANDed with DART capabilities */ diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c index 973afced466c..ddae0b07c76b 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c @@ -23,7 +23,7 @@ void *arm_smmu_hw_info(struct device *dev, u32 *length, return impl_ops->hw_info(master->smmu, length, type); } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); @@ -121,7 +121,7 @@ int arm_smmu_attach_prepare_vmaster(struct arm_smmu_attach_state *state, return ret; } - vmaster = kzalloc_obj(*vmaster, GFP_KERNEL); + vmaster = kzalloc_obj(*vmaster); if (!vmaster) return -ENOMEM; vmaster->vsmmu = nested_domain->vsmmu; @@ -361,7 +361,7 @@ int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu, struct arm_vsmmu_invalidation_cmd *end; int ret; - cmds = kzalloc_objs(*cmds, array->entry_num, GFP_KERNEL); + cmds = kzalloc_objs(*cmds, array->entry_num); if (!cmds) return -ENOMEM; cur = cmds; diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index bee947ad5640..e1c4bf0775fb 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2524,7 +2524,7 @@ struct arm_smmu_domain *arm_smmu_domain_alloc(void) { struct arm_smmu_domain *smmu_domain; - smmu_domain = kzalloc_obj(*smmu_domain, GFP_KERNEL); + smmu_domain = kzalloc_obj(*smmu_domain); if (!smmu_domain) return ERR_PTR(-ENOMEM); @@ -2965,7 +2965,7 @@ int arm_smmu_attach_prepare(struct arm_smmu_attach_state *state, return ret; } - master_domain = kzalloc_obj(*master_domain, GFP_KERNEL); + master_domain = kzalloc_obj(*master_domain); if (!master_domain) { ret = -ENOMEM; goto err_free_vmaster; @@ -3597,7 +3597,7 @@ static struct iommu_device *arm_smmu_probe_device(struct device *dev) if (!smmu) return ERR_PTR(-ENODEV); - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c index c7892443258d..8dcde926794d 100644 --- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c +++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c @@ -693,7 +693,7 @@ tegra241_vintf_alloc_lvcmdq(struct tegra241_vintf *vintf, u16 lidx) char header[64]; int ret; - vcmdq = kzalloc_obj(*vcmdq, GFP_KERNEL); + vcmdq = kzalloc_obj(*vcmdq); if (!vcmdq) return ERR_PTR(-ENOMEM); @@ -818,7 +818,7 @@ static void *tegra241_cmdqv_hw_info(struct arm_smmu_device *smmu, u32 *length, if (*type != IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV) return ERR_PTR(-EOPNOTSUPP); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); @@ -860,7 +860,7 @@ static int tegra241_cmdqv_init_structures(struct arm_smmu_device *smmu) int lidx; int ret; - vintf = kzalloc_obj(*vintf, GFP_KERNEL); + vintf = kzalloc_obj(*vintf); if (!vintf) return -ENOMEM; @@ -947,7 +947,7 @@ __tegra241_cmdqv_probe(struct arm_smmu_device *smmu, struct resource *res, 1 << FIELD_GET(CMDQV_NUM_SID_PER_VM_LOG2, regval); cmdqv->vintfs = - kzalloc_objs(*cmdqv->vintfs, cmdqv->num_vintfs, GFP_KERNEL); + kzalloc_objs(*cmdqv->vintfs, cmdqv->num_vintfs); if (!cmdqv->vintfs) goto free_irq; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index a31e90fcfefe..0bd21d206eb3 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -927,7 +927,7 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev) * We can't really do anything meaningful until we've added a * master. */ - smmu_domain = kzalloc_obj(*smmu_domain, GFP_KERNEL); + smmu_domain = kzalloc_obj(*smmu_domain); if (!smmu_domain) return NULL; diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 7126431c966d..a1e8cf29f594 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -329,7 +329,7 @@ static struct iommu_domain *qcom_iommu_domain_alloc_paging(struct device *dev) * We can't really do anything meaningful until we've added a * master. */ - qcom_domain = kzalloc_obj(*qcom_domain, GFP_KERNEL); + qcom_domain = kzalloc_obj(*qcom_domain); if (!qcom_domain) return NULL; diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index d1ecb722b546..5dac64be61bb 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -372,7 +372,7 @@ int iommu_get_dma_cookie(struct iommu_domain *domain) if (domain->cookie_type != IOMMU_COOKIE_NONE) return -EEXIST; - cookie = kzalloc_obj(*cookie, GFP_KERNEL); + cookie = kzalloc_obj(*cookie); if (!cookie) return -ENOMEM; @@ -404,7 +404,7 @@ int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base) if (domain->cookie_type != IOMMU_COOKIE_NONE) return -EEXIST; - cookie = kzalloc_obj(*cookie, GFP_KERNEL); + cookie = kzalloc_obj(*cookie); if (!cookie) return -ENOMEM; @@ -480,7 +480,7 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, num_pages = iova_align(iovad, end - start) >> iova_shift(iovad); for (i = 0; i < num_pages; i++) { - msi_page = kmalloc_obj(*msi_page, GFP_KERNEL); + msi_page = kmalloc_obj(*msi_page); if (!msi_page) return -ENOMEM; @@ -880,7 +880,7 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev, if (!order_mask) return NULL; - pages = kvzalloc_objs(*pages, count, GFP_KERNEL); + pages = kvzalloc_objs(*pages, count); if (!pages) return NULL; @@ -2157,7 +2157,7 @@ static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev, if (msi_page->phys == msi_addr) return msi_page; - msi_page = kzalloc_obj(*msi_page, GFP_KERNEL); + msi_page = kzalloc_obj(*msi_page); if (!msi_page) return NULL; diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 2e439699382d..874d05f4b396 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -899,7 +899,7 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev) /* Check if correct PTE offsets are initialized */ BUG_ON(PG_ENT_SHIFT < 0 || !dma_dev); - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; @@ -1451,7 +1451,7 @@ static int exynos_iommu_of_xlate(struct device *dev, return -ENODEV; if (!owner) { - owner = kzalloc_obj(*owner, GFP_KERNEL); + owner = kzalloc_obj(*owner); if (!owner) return -ENOMEM; diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index 8db71fe57894..25aa477a95a9 100644 --- a/drivers/iommu/fsl_pamu.c +++ b/drivers/iommu/fsl_pamu.c @@ -785,7 +785,7 @@ static int fsl_pamu_probe(struct platform_device *pdev) goto error; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { ret = -ENOMEM; goto error; diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c index b776c52aca6b..479103261ae6 100644 --- a/drivers/iommu/hyperv-iommu.c +++ b/drivers/iommu/hyperv-iommu.c @@ -276,7 +276,7 @@ static int hyperv_root_irq_remapping_alloc(struct irq_domain *domain, if (ret < 0) return ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { irq_domain_free_irqs_common(domain, virq, nr_irqs); return -ENOMEM; diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c index e43c93fb9b1d..249ab5886c73 100644 --- a/drivers/iommu/intel/cache.c +++ b/drivers/iommu/intel/cache.c @@ -49,7 +49,7 @@ int cache_tag_assign(struct dmar_domain *domain, u16 did, struct device *dev, struct list_head *prev; unsigned long flags; - tag = kzalloc_obj(*tag, GFP_KERNEL); + tag = kzalloc_obj(*tag); if (!tag) return -ENOMEM; diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index 4a2143036b94..d68c06025cac 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -99,7 +99,7 @@ void *dmar_alloc_dev_scope(void *start, void *end, int *cnt) if (*cnt == 0) return NULL; - return kzalloc_objs(struct dmar_dev_scope, *cnt, GFP_KERNEL); + return kzalloc_objs(struct dmar_dev_scope, *cnt); } void dmar_free_dev_scope(struct dmar_dev_scope **devices, int *cnt) @@ -1046,7 +1046,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) return -EINVAL; } - iommu = kzalloc_obj(*iommu, GFP_KERNEL); + iommu = kzalloc_obj(*iommu); if (!iommu) return -ENOMEM; diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 3505ced050f0..ef7613b177b9 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -1030,7 +1030,7 @@ int domain_attach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu) if (domain->domain.type == IOMMU_DOMAIN_SVA) return 0; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -1926,7 +1926,7 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); } - rmrru = kzalloc_obj(*rmrru, GFP_KERNEL); + rmrru = kzalloc_obj(*rmrru); if (!rmrru) goto out; @@ -2779,7 +2779,7 @@ static struct dmar_domain *paging_domain_alloc(void) { struct dmar_domain *domain; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return ERR_PTR(-ENOMEM); @@ -3237,7 +3237,7 @@ static struct iommu_device *intel_iommu_probe_device(struct device *dev) if (!iommu || !iommu->iommu.ops) return ERR_PTR(-ENODEV); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); @@ -3576,7 +3576,7 @@ domain_add_dev_pasid(struct iommu_domain *domain, unsigned long flags; int ret; - dev_pasid = kzalloc_obj(*dev_pasid, GFP_KERNEL); + dev_pasid = kzalloc_obj(*dev_pasid); if (!dev_pasid) return ERR_PTR(-ENOMEM); @@ -3672,7 +3672,7 @@ static void *intel_iommu_hw_info(struct device *dev, u32 *length, *type != IOMMU_HW_INFO_TYPE_INTEL_VTD) return ERR_PTR(-EOPNOTSUPP); - vtd = kzalloc_obj(*vtd, GFP_KERNEL); + vtd = kzalloc_obj(*vtd); if (!vtd) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c index 105958b4a29e..1cd2101610df 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -533,7 +533,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) if (iommu->ir_table) return 0; - ir_table = kzalloc_obj(struct ir_table, GFP_KERNEL); + ir_table = kzalloc_obj(struct ir_table); if (!ir_table) return -ENOMEM; @@ -1426,7 +1426,7 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, return ret; ret = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto out_free_parent; @@ -1448,7 +1448,7 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, } if (i > 0) { - ird = kzalloc_obj(*ird, GFP_KERNEL); + ird = kzalloc_obj(*ird); if (!ird) goto out_free_data; /* Initialize the common data */ diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index 5ffe84dee862..9d30015b8940 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -50,7 +50,7 @@ int intel_pasid_alloc_table(struct device *dev) if (WARN_ON(info->pasid_table)) return -EEXIST; - pasid_table = kzalloc_obj(*pasid_table, GFP_KERNEL); + pasid_table = kzalloc_obj(*pasid_table); if (!pasid_table) return -ENOMEM; diff --git a/drivers/iommu/intel/perfmon.c b/drivers/iommu/intel/perfmon.c index 76b62f2c8d92..fec51b6036b6 100644 --- a/drivers/iommu/intel/perfmon.c +++ b/drivers/iommu/intel/perfmon.c @@ -591,7 +591,7 @@ int alloc_iommu_pmu(struct intel_iommu *iommu) if (!ecmd_has_pmu_essential(iommu)) return -ENODEV; - iommu_pmu = kzalloc_obj(*iommu_pmu, GFP_KERNEL); + iommu_pmu = kzalloc_obj(*iommu_pmu); if (!iommu_pmu) return -ENOMEM; diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index be165cb9d01e..fea10acd4f02 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -210,7 +210,7 @@ struct iommu_domain *intel_svm_domain_alloc(struct device *dev, if (ret) return ERR_PTR(ret); - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c index a0d8fd7f2e84..cca52a34d0ed 100644 --- a/drivers/iommu/io-pgfault.c +++ b/drivers/iommu/io-pgfault.c @@ -65,7 +65,7 @@ static int report_partial_fault(struct iommu_fault_param *fault_param, { struct iopf_fault *iopf; - iopf = kzalloc_obj(*iopf, GFP_KERNEL); + iopf = kzalloc_obj(*iopf); if (!iopf) return -ENOMEM; @@ -85,7 +85,7 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param, struct iopf_fault *iopf, *next; struct iopf_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) { /* * We always need to construct the group as we need it to abort @@ -400,7 +400,7 @@ int iopf_queue_add_device(struct iopf_queue *queue, struct device *dev) goto done_unlock; } - fault_param = kzalloc_obj(*fault_param, GFP_KERNEL); + fault_param = kzalloc_obj(*fault_param); if (!fault_param) { ret = -ENOMEM; goto done_unlock; @@ -503,7 +503,7 @@ struct iopf_queue *iopf_queue_alloc(const char *name) { struct iopf_queue *queue; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return NULL; diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 67ce99ca82b3..40e33257d3c2 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -692,7 +692,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, !arm_v7s_is_mtk_enabled(cfg)) return NULL; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return NULL; diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index c5076caf17aa..0208e5897c29 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -930,7 +930,7 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg) if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS) return NULL; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return NULL; diff --git a/drivers/iommu/io-pgtable-dart.c b/drivers/iommu/io-pgtable-dart.c index d31f00ff1206..cbc5d6aa2daa 100644 --- a/drivers/iommu/io-pgtable-dart.c +++ b/drivers/iommu/io-pgtable-dart.c @@ -388,7 +388,7 @@ dart_alloc_pgtable(struct io_pgtable_cfg *cfg) if (tbl_bits > max_tbl_bits) return NULL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 6f3b26a823ec..07d64908a05f 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -35,7 +35,7 @@ static struct iommu_mm_data *iommu_alloc_mm_data(struct mm_struct *mm, struct de return iommu_mm; } - iommu_mm = kzalloc_obj(struct iommu_mm_data, GFP_KERNEL); + iommu_mm = kzalloc_obj(struct iommu_mm_data); if (!iommu_mm) return ERR_PTR(-ENOMEM); @@ -108,7 +108,7 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm goto out_unlock; } - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c index cf72d58fcb7c..937d1c749843 100644 --- a/drivers/iommu/iommu-sysfs.c +++ b/drivers/iommu/iommu-sysfs.c @@ -59,7 +59,7 @@ int iommu_device_sysfs_add(struct iommu_device *iommu, va_list vargs; int ret; - iommu->dev = kzalloc_obj(*iommu->dev, GFP_KERNEL); + iommu->dev = kzalloc_obj(*iommu->dev); if (!iommu->dev) return -ENOMEM; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 1a98d65fb35d..42383121657b 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -233,7 +233,7 @@ static int __init iommu_subsys_init(void) (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ? " (set via kernel command line)" : ""); - nb = kzalloc_objs(*nb, ARRAY_SIZE(iommu_buses), GFP_KERNEL); + nb = kzalloc_objs(*nb, ARRAY_SIZE(iommu_buses)); if (!nb) return -ENOMEM; @@ -383,7 +383,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev) if (param) return param; - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) return NULL; @@ -1053,7 +1053,7 @@ struct iommu_group *iommu_group_alloc(void) struct iommu_group *group; int ret; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return ERR_PTR(-ENOMEM); @@ -1244,7 +1244,7 @@ static struct group_device *iommu_group_alloc_device(struct iommu_group *group, int ret, i = 0; struct group_device *device; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index 5a2628854a05..344d620cdecc 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -87,7 +87,7 @@ static struct iommufd_group *iommufd_get_group(struct iommufd_ctx *ictx, } xa_unlock(&ictx->groups); - new_igroup = kzalloc_obj(*new_igroup, GFP_KERNEL); + new_igroup = kzalloc_obj(*new_igroup); if (!new_igroup) { iommu_group_put(group); return ERR_PTR(-ENOMEM); @@ -508,7 +508,7 @@ static int iommufd_hwpt_attach_device(struct iommufd_hw_pagetable *hwpt, if (rc) return rc; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; @@ -575,7 +575,7 @@ static int iommufd_hwpt_replace_device(struct iommufd_device *idev, old_handle = iommufd_device_get_attach_handle(idev, pasid); - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; @@ -619,7 +619,7 @@ int iommufd_hw_pagetable_attach(struct iommufd_hw_pagetable *hwpt, } if (!attach) { - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) { rc = -ENOMEM; goto err_release_pasid; diff --git a/drivers/iommu/iommufd/driver.c b/drivers/iommu/iommufd/driver.c index b71fb2472945..61e6b02601d1 100644 --- a/drivers/iommu/iommufd/driver.c +++ b/drivers/iommu/iommufd/driver.c @@ -202,7 +202,7 @@ iommufd_sw_msi_get_map(struct iommufd_ctx *ictx, phys_addr_t msi_addr, BITS_PER_BYTE * sizeof_field(struct iommufd_sw_msi_maps, bitmap)) return ERR_PTR(-EOVERFLOW); - cur = kzalloc_obj(*cur, GFP_KERNEL); + cur = kzalloc_obj(*cur); if (!cur) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iommufd/iova_bitmap.c b/drivers/iommu/iommufd/iova_bitmap.c index 151285e0521e..dac3e657d498 100644 --- a/drivers/iommu/iommufd/iova_bitmap.c +++ b/drivers/iommu/iommufd/iova_bitmap.c @@ -247,7 +247,7 @@ struct iova_bitmap *iova_bitmap_alloc(unsigned long iova, size_t length, struct iova_bitmap *bitmap; int rc; - bitmap = kzalloc_obj(*bitmap, GFP_KERNEL); + bitmap = kzalloc_obj(*bitmap); if (!bitmap) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/iommufd/pages.c b/drivers/iommu/iommufd/pages.c index 38efabe95dba..9b49f0c5b459 100644 --- a/drivers/iommu/iommufd/pages.c +++ b/drivers/iommu/iommufd/pages.c @@ -1575,7 +1575,7 @@ int iopt_dmabuf_track_domain(struct iopt_pages *pages, struct iopt_area *area, if (WARN_ON(track->domain == domain && track->area == area)) return -EINVAL; - track = kzalloc_obj(*track, GFP_KERNEL); + track = kzalloc_obj(*track); if (!track) return -ENOMEM; track->domain = domain; diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index 530202748016..7823142097d4 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -308,7 +308,7 @@ static void *mock_domain_hw_info(struct device *dev, u32 *length, *type != IOMMU_HW_INFO_TYPE_SELFTEST) return ERR_PTR(-EOPNOTSUPP); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); @@ -353,7 +353,7 @@ __mock_domain_alloc_nested(const struct iommu_user_data *user_data) if (rc) return ERR_PTR(rc); - mock_nested = kzalloc_obj(*mock_nested, GFP_KERNEL); + mock_nested = kzalloc_obj(*mock_nested); if (!mock_nested) return ERR_PTR(-ENOMEM); mock_nested->domain.ops = &domain_nested_ops; @@ -441,7 +441,7 @@ mock_domain_alloc_pgtable(struct device *dev, struct mock_iommu_domain *mock; int rc; - mock = kzalloc_obj(*mock, GFP_KERNEL); + mock = kzalloc_obj(*mock); if (!mock) return ERR_PTR(-ENOMEM); mock->domain.type = IOMMU_DOMAIN_UNMANAGED; @@ -674,7 +674,7 @@ static int mock_viommu_cache_invalidate(struct iommufd_viommu *viommu, return 0; } - cmds = kzalloc_objs(*cmds, array->entry_num, GFP_KERNEL); + cmds = kzalloc_objs(*cmds, array->entry_num); if (!cmds) return -ENOMEM; cur = cmds; @@ -1023,7 +1023,7 @@ static struct mock_dev *mock_dev_create(unsigned long dev_flags) if (dev_flags & ~valid_flags) return ERR_PTR(-EINVAL); - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return ERR_PTR(-ENOMEM); @@ -2032,7 +2032,7 @@ static int iommufd_test_dmabuf_get(struct iommufd_ucmd *ucmd, if (len == 0 || len > PAGE_SIZE * 512) return -EINVAL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index bd18c3a7ee54..9386b752dea2 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -566,7 +566,7 @@ static struct iommu_domain *ipmmu_domain_alloc_paging(struct device *dev) { struct ipmmu_vmsa_domain *domain; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 00b4ea90e500..0ad5ff431d5b 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -306,7 +306,7 @@ static struct iommu_domain *msm_iommu_domain_alloc_paging(struct device *dev) { struct msm_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) goto fail_nomem; diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 6dd60f4a8087..2be990c108de 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -704,7 +704,7 @@ static struct iommu_domain *mtk_iommu_domain_alloc_paging(struct device *dev) { struct mtk_iommu_domain *dom; - dom = kzalloc_obj(*dom, GFP_KERNEL); + dom = kzalloc_obj(*dom); if (!dom) return NULL; mutex_init(&dom->mutex); diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index e5ad7fa6e4e7..ac97dd2868d4 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -284,7 +284,7 @@ static struct iommu_domain *mtk_iommu_v1_domain_alloc_paging(struct device *dev) { struct mtk_iommu_v1_domain *dom; - dom = kzalloc_obj(*dom, GFP_KERNEL); + dom = kzalloc_obj(*dom); if (!dom) return NULL; diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c index b0853f69f98d..34c0a45f73d8 100644 --- a/drivers/iommu/omap-iommu-debug.c +++ b/drivers/iommu/omap-iommu-debug.c @@ -147,7 +147,7 @@ static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s) num = obj->nr_tlb_entries; - cr = kzalloc_objs(*cr, num, GFP_KERNEL); + cr = kzalloc_objs(*cr, num); if (!cr) return 0; diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index f4fd0fba6a8c..8231d7d6bb6a 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -311,7 +311,7 @@ static struct cr_regs *iotlb_alloc_cr(struct omap_iommu *obj, return ERR_PTR(-EINVAL); } - cr = kmalloc_obj(*cr, GFP_KERNEL); + cr = kmalloc_obj(*cr); if (!cr) return ERR_PTR(-ENOMEM); @@ -1563,7 +1563,7 @@ static struct iommu_domain *omap_iommu_domain_alloc_paging(struct device *dev) { struct omap_iommu_domain *omap_domain; - omap_domain = kzalloc_obj(*omap_domain, GFP_KERNEL); + omap_domain = kzalloc_obj(*omap_domain); if (!omap_domain) return NULL; @@ -1655,7 +1655,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev) if (num_iommus < 0) return ERR_PTR(-ENODEV); - arch_data = kzalloc_objs(*arch_data, num_iommus + 1, GFP_KERNEL); + arch_data = kzalloc_objs(*arch_data, num_iommus + 1); if (!arch_data) return ERR_PTR(-ENOMEM); diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c index 26068cefa837..fa2ebfd2f912 100644 --- a/drivers/iommu/riscv/iommu.c +++ b/drivers/iommu/riscv/iommu.c @@ -853,7 +853,7 @@ static int riscv_iommu_bond_link(struct riscv_iommu_domain *domain, struct riscv_iommu_bond *bond; struct list_head *bonds; - bond = kzalloc_obj(*bond, GFP_KERNEL); + bond = kzalloc_obj(*bond); if (!bond) return -ENOMEM; bond->dev = dev; @@ -1380,7 +1380,7 @@ static struct iommu_domain *riscv_iommu_alloc_paging_domain(struct device *dev) return ERR_PTR(-ENODEV); } - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return ERR_PTR(-ENOMEM); @@ -1504,7 +1504,7 @@ static struct iommu_device *riscv_iommu_probe_device(struct device *dev) if (iommu->ddt_mode <= RISCV_IOMMU_DDTP_IOMMU_MODE_BARE) return ERR_PTR(-ENODEV); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); /* diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index e0cfe7bbef8c..0013cf196c57 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1064,7 +1064,7 @@ static struct iommu_domain *rk_iommu_domain_alloc_paging(struct device *dev) struct rk_iommu_domain *rk_domain; struct rk_iommu *iommu; - rk_domain = kzalloc_obj(*rk_domain, GFP_KERNEL); + rk_domain = kzalloc_obj(*rk_domain); if (!rk_domain) return NULL; diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index dcef361f9806..f148f559ac56 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -531,7 +531,7 @@ static struct iommu_domain *s390_domain_alloc_paging(struct device *dev) struct s390_domain *s390_domain; u64 aperture_size; - s390_domain = kzalloc_obj(*s390_domain, GFP_KERNEL); + s390_domain = kzalloc_obj(*s390_domain); if (!s390_domain) return NULL; diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 0164c08ed9dc..c1a34445d244 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -137,7 +137,7 @@ static struct iommu_domain *sprd_iommu_domain_alloc_paging(struct device *dev) { struct sprd_iommu_domain *dom; - dom = kzalloc_obj(*dom, GFP_KERNEL); + dom = kzalloc_obj(*dom); if (!dom) return NULL; diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 30f93e691c09..be3f1ce696ba 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -686,7 +686,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev) { struct sun50i_iommu_domain *sun50i_domain; - sun50i_domain = kzalloc_obj(*sun50i_domain, GFP_KERNEL); + sun50i_domain = kzalloc_obj(*sun50i_domain); if (!sun50i_domain) return NULL; diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 4890a88ac169..67e7a7b925f0 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -289,7 +289,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev) { struct tegra_smmu_as *as; - as = kzalloc_obj(*as, GFP_KERNEL); + as = kzalloc_obj(*as); if (!as) return NULL; @@ -308,7 +308,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev) return NULL; } - as->pts = kzalloc_objs(*as->pts, SMMU_NUM_PDE, GFP_KERNEL); + as->pts = kzalloc_objs(*as->pts, SMMU_NUM_PDE); if (!as->pts) { kfree(as->count); iommu_free_pages(as->pd); diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index ba8a70fdb494..587fc13197f1 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -670,7 +670,7 @@ static struct iommu_domain *viommu_domain_alloc_paging(struct device *dev) return ERR_PTR(-ENODEV); } - vdomain = kzalloc_obj(*vdomain, GFP_KERNEL); + vdomain = kzalloc_obj(*vdomain); if (!vdomain) return ERR_PTR(-ENOMEM); @@ -1028,7 +1028,7 @@ static struct iommu_device *viommu_probe_device(struct device *dev) if (!viommu) return ERR_PTR(-ENODEV); - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c index 6d1058dc8faa..341fde71356e 100644 --- a/drivers/ipack/carriers/tpci200.c +++ b/drivers/ipack/carriers/tpci200.c @@ -209,7 +209,7 @@ static int tpci200_request_irq(struct ipack_device *dev, goto out_unlock; } - slot_irq = kzalloc_obj(struct slot_irq, GFP_KERNEL); + slot_irq = kzalloc_obj(struct slot_irq); if (slot_irq == NULL) { dev_err(&dev->dev, "Slot [%d:%d] unable to allocate memory for IRQ !\n", @@ -487,7 +487,7 @@ static int tpci200_create_device(struct tpci200_board *tpci200, int i) int ret; enum ipack_space space; struct ipack_device *dev = - kzalloc_obj(struct ipack_device, GFP_KERNEL); + kzalloc_obj(struct ipack_device); if (!dev) return -ENOMEM; dev->slot = i; @@ -521,11 +521,11 @@ static int tpci200_pci_probe(struct pci_dev *pdev, struct tpci200_board *tpci200; u32 reg32; - tpci200 = kzalloc_obj(struct tpci200_board, GFP_KERNEL); + tpci200 = kzalloc_obj(struct tpci200_board); if (!tpci200) return -ENOMEM; - tpci200->info = kzalloc_obj(struct tpci200_infos, GFP_KERNEL); + tpci200->info = kzalloc_obj(struct tpci200_infos); if (!tpci200->info) { ret = -ENOMEM; goto err_tpci200; diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index 563fdf197101..1bbefc6de708 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c @@ -688,7 +688,7 @@ static int ipoctal_probe(struct ipack_device *dev) int res; struct ipoctal *ipoctal; - ipoctal = kzalloc_obj(struct ipoctal, GFP_KERNEL); + ipoctal = kzalloc_obj(struct ipoctal); if (ipoctal == NULL) return -ENOMEM; diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index d4ec786bf98d..28214f862ab1 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -203,7 +203,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots, int bus_nr; struct ipack_bus_device *bus; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) return NULL; diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c index 8776f2ba4bae..11d105457798 100644 --- a/drivers/irqchip/exynos-combiner.c +++ b/drivers/irqchip/exynos-combiner.c @@ -176,7 +176,7 @@ static void __init combiner_init(void __iomem *combiner_base, nr_irq = max_nr * IRQ_IN_COMBINER; - combiner_data = kzalloc_objs(*combiner_data, max_nr, GFP_KERNEL); + combiner_data = kzalloc_objs(*combiner_data, max_nr); if (!combiner_data) return; diff --git a/drivers/irqchip/irq-al-fic.c b/drivers/irqchip/irq-al-fic.c index f6b637bebcc0..d10ac9b63c99 100644 --- a/drivers/irqchip/irq-al-fic.c +++ b/drivers/irqchip/irq-al-fic.c @@ -194,7 +194,7 @@ static struct al_fic *al_fic_wire_init(struct device_node *node, int ret; u32 control = CONTROL_MASK_MSI_X; - fic = kzalloc_obj(*fic, GFP_KERNEL); + fic = kzalloc_obj(*fic); if (!fic) return ERR_PTR(-ENOMEM); diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c index e09939e279f6..2b24c82bb0df 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -921,7 +921,7 @@ static void build_fiq_affinity(struct aic_irq_chip *ic, struct device_node *aff) if (WARN_ON(n < 0)) return; - ic->fiq_aff[fiq] = kzalloc_obj(*ic->fiq_aff[fiq], GFP_KERNEL); + ic->fiq_aff[fiq] = kzalloc_obj(*ic->fiq_aff[fiq]); if (!ic->fiq_aff[fiq]) return; @@ -959,7 +959,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p if (WARN_ON(!regs)) return -EIO; - irqc = kzalloc_obj(*irqc, GFP_KERNEL); + irqc = kzalloc_obj(*irqc); if (!irqc) { iounmap(regs); return -ENOMEM; diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 84e8f204edef..1ba82ac0c26b 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -835,7 +835,7 @@ static int __init mpic_of_init(struct device_node *node, struct device_node *par struct mpic *mpic; int err; - mpic = kzalloc_obj(*mpic, GFP_KERNEL); + mpic = kzalloc_obj(*mpic); if (WARN_ON(!mpic)) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c index 35189fd06b3d..7996fd5cbae6 100644 --- a/drivers/irqchip/irq-aspeed-i2c-ic.c +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c @@ -66,7 +66,7 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node, struct aspeed_i2c_ic *i2c_ic; int ret = 0; - i2c_ic = kzalloc_obj(*i2c_ic, GFP_KERNEL); + i2c_ic = kzalloc_obj(*i2c_ic); if (!i2c_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-intc.c b/drivers/irqchip/irq-aspeed-intc.c index f3ae18de3b95..4fb0dd8349da 100644 --- a/drivers/irqchip/irq-aspeed-intc.c +++ b/drivers/irqchip/irq-aspeed-intc.c @@ -89,7 +89,7 @@ static int __init aspeed_intc_ic_of_init(struct device_node *node, struct aspeed_intc_ic *intc_ic; int irq, i, ret = 0; - intc_ic = kzalloc_obj(*intc_ic, GFP_KERNEL); + intc_ic = kzalloc_obj(*intc_ic); if (!intc_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-scu-ic.c b/drivers/irqchip/irq-aspeed-scu-ic.c index 170fc82091da..097cf45b2126 100644 --- a/drivers/irqchip/irq-aspeed-scu-ic.c +++ b/drivers/irqchip/irq-aspeed-scu-ic.c @@ -270,7 +270,7 @@ static int __init aspeed_scu_ic_of_init(struct device_node *node, struct device_ if (!variant) return -ENODEV; - scu_ic = kzalloc_obj(*scu_ic, GFP_KERNEL); + scu_ic = kzalloc_obj(*scu_ic); if (!scu_ic) return -ENOMEM; diff --git a/drivers/irqchip/irq-aspeed-vic.c b/drivers/irqchip/irq-aspeed-vic.c index 35cd50aaed81..6649b893f39c 100644 --- a/drivers/irqchip/irq-aspeed-vic.c +++ b/drivers/irqchip/irq-aspeed-vic.c @@ -196,7 +196,7 @@ static int __init avic_of_init(struct device_node *node, if (WARN_ON(!regs)) return -EIO; - vic = kzalloc_obj(struct aspeed_vic, GFP_KERNEL); + vic = kzalloc_obj(struct aspeed_vic); if (WARN_ON(!vic)) { iounmap(regs); return -ENOMEM; diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index 087eed7ed6db..7a1d60ee0d51 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c @@ -213,7 +213,7 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node, if (!reg_base) return ERR_PTR(-ENOMEM); - aic = kzalloc_objs(*aic, nchips, GFP_KERNEL); + aic = kzalloc_objs(*aic, nchips); if (!aic) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/irqchip/irq-bcm2712-mip.c b/drivers/irqchip/irq-bcm2712-mip.c index 118ab4ac6714..06a6ab6270ad 100644 --- a/drivers/irqchip/irq-bcm2712-mip.c +++ b/drivers/irqchip/irq-bcm2712-mip.c @@ -238,7 +238,7 @@ static int mip_msi_probe(struct platform_device *pdev, struct device_node *paren struct mip_priv *mip; int ret; - mip = kzalloc_obj(*mip, GFP_KERNEL); + mip = kzalloc_obj(*mip); if (!mip) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c index 956c53dffca3..35aab9488edc 100644 --- a/drivers/irqchip/irq-bcm6345-l1.c +++ b/drivers/irqchip/irq-bcm6345-l1.c @@ -296,7 +296,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn, unsigned int idx; int ret; - intc = kzalloc_obj(*intc, GFP_KERNEL); + intc = kzalloc_obj(*intc); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c index 3f838f019f4d..fe56c7b5828b 100644 --- a/drivers/irqchip/irq-bcm7038-l1.c +++ b/drivers/irqchip/irq-bcm7038-l1.c @@ -398,7 +398,7 @@ static int bcm7038_l1_probe(struct platform_device *pdev, struct device_node *pa struct bcm7038_l1_chip *intc; int idx, ret; - intc = kzalloc_obj(*intc, GFP_KERNEL); + intc = kzalloc_obj(*intc); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index 341b4e62b942..dd6df9004ecb 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c @@ -220,7 +220,7 @@ static int bcm7120_l2_intc_probe(struct platform_device *pdev, struct device_nod unsigned int idx, irq, flags; u32 valid_mask[MAX_WORDS] = { }; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c index c5f4c79e7ea9..d336ac822ea0 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c @@ -151,7 +151,7 @@ static int brcmstb_l2_intc_probe(struct platform_device *pdev, struct device_nod int parent_irq; void __iomem *base; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c index 80b9f7bc7bbd..995bbd126f90 100644 --- a/drivers/irqchip/irq-clps711x.c +++ b/drivers/irqchip/irq-clps711x.c @@ -155,7 +155,7 @@ static int __init _clps711x_intc_init(struct device_node *np, { int err; - clps711x_intc = kzalloc_obj(*clps711x_intc, GFP_KERNEL); + clps711x_intc = kzalloc_obj(*clps711x_intc); if (!clps711x_intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index c3ddffc28bbd..cd1134101ace 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -199,7 +199,7 @@ static int __init crossbar_of_init(struct device_node *node) const __be32 *irqsr; int ret = -ENOMEM; - cb = kzalloc_obj(*cb, GFP_KERNEL); + cb = kzalloc_obj(*cb); if (!cb) return ret; @@ -268,7 +268,7 @@ static int __init crossbar_of_init(struct device_node *node) } - cb->register_offsets = kzalloc_objs(int, max, GFP_KERNEL); + cb->register_offsets = kzalloc_objs(int, max); if (!cb->register_offsets) goto err_irq_map; diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index d9215d785bcc..bd85bd344f25 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c @@ -293,7 +293,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode, int ret; struct v2m_data *v2m; - v2m = kzalloc_obj(struct v2m_data, GFP_KERNEL); + v2m = kzalloc_obj(struct v2m_data); if (!v2m) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 4f3212caa1ef..9ac431afdd33 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -2108,7 +2108,7 @@ static struct lpi_range *mk_lpi_range(u32 base, u32 span) { struct lpi_range *range; - range = kmalloc_obj(*range, GFP_KERNEL); + range = kmalloc_obj(*range); if (range) { range->base_id = base; range->span = span; @@ -3493,7 +3493,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, itt = itt_alloc_pool(its->numa_node, sz); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (alloc_lpis) { lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis); @@ -5139,7 +5139,7 @@ static int its_init_domain(struct its_node *its) }; struct msi_domain_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -5169,7 +5169,7 @@ static int its_init_vpe_domain(void) its = list_first_entry(&its_nodes, struct its_node, entry); entries = roundup_pow_of_two(nr_cpu_ids); - vpe_proxy.vpes = kzalloc_objs(*vpe_proxy.vpes, entries, GFP_KERNEL); + vpe_proxy.vpes = kzalloc_objs(*vpe_proxy.vpes, entries); if (!vpe_proxy.vpes) return -ENOMEM; @@ -5513,7 +5513,7 @@ static struct its_node __init *its_node_init(struct resource *res, pr_info("ITS %pR\n", res); - its = kzalloc_obj(*its, GFP_KERNEL); + its = kzalloc_obj(*its); if (!its) goto out_unmap; @@ -5679,7 +5679,7 @@ static void __init acpi_table_parse_srat_its(void) if (count <= 0) return; - its_srat_maps = kmalloc_objs(struct its_srat_map, count, GFP_KERNEL); + its_srat_maps = kmalloc_objs(struct its_srat_map, count); if (!its_srat_maps) return; diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c index 9254a5e92577..62504deb6cd3 100644 --- a/drivers/irqchip/irq-gic-v3-mbi.c +++ b/drivers/irqchip/irq-gic-v3-mbi.c @@ -231,7 +231,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent) return -EINVAL; mbi_range_nr = n / 2; - mbi_ranges = kzalloc_objs(*mbi_ranges, mbi_range_nr, GFP_KERNEL); + mbi_ranges = kzalloc_objs(*mbi_ranges, mbi_range_nr); if (!mbi_ranges) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 602870a2b8f8..20f13b686ab2 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2090,7 +2090,7 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) if (!nr_parts) goto out_put_node; - parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts); if (WARN_ON(!parts)) goto out_put_node; @@ -2218,7 +2218,7 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare if (of_property_read_u32(node, "#redistributor-regions", &nr_redist_regions)) nr_redist_regions = 1; - rdist_regs = kzalloc_objs(*rdist_regs, nr_redist_regions, GFP_KERNEL); + rdist_regs = kzalloc_objs(*rdist_regs, nr_redist_regions); if (!rdist_regs) { err = -ENOMEM; goto out_unmap_dist; diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c index 8379e975a172..e518e5dfede7 100644 --- a/drivers/irqchip/irq-gic-v5-irs.c +++ b/drivers/irqchip/irq-gic-v5-irs.c @@ -727,7 +727,7 @@ static int __init gicv5_irs_of_init(struct device_node *node) u32 idr; int ret; - irs_data = kzalloc_obj(*irs_data, GFP_KERNEL); + irs_data = kzalloc_obj(*irs_data); if (!irs_data) return -ENOMEM; @@ -913,7 +913,7 @@ static int __init gic_acpi_parse_madt_irs(union acpi_subtable_headers *header, int ret; /* Per-IRS data structure */ - irs_data = kzalloc_obj(*irs_data, GFP_KERNEL); + irs_data = kzalloc_obj(*irs_data); if (!irs_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c index 96c67e168e6f..36a8d1368f0e 100644 --- a/drivers/irqchip/irq-gic-v5-its.c +++ b/drivers/irqchip/irq-gic-v5-its.c @@ -757,7 +757,7 @@ static struct gicv5_its_dev *gicv5_its_alloc_device(struct gicv5_its_chip_data * return ERR_PTR(-EBUSY); } - its_dev = kzalloc_obj(*its_dev, GFP_KERNEL); + its_dev = kzalloc_obj(*its_dev); if (!its_dev) return ERR_PTR(-ENOMEM); @@ -1100,7 +1100,7 @@ static int gicv5_its_init_domain(struct gicv5_its_chip_data *its, struct irq_dom }; struct msi_domain_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -1125,7 +1125,7 @@ static int __init gicv5_its_init_bases(void __iomem *its_base, struct fwnode_han bool enabled; int ret; - its_node = kzalloc_obj(*its_node, GFP_KERNEL); + its_node = kzalloc_obj(*its_node); if (!its_node) return -ENOMEM; diff --git a/drivers/irqchip/irq-goldfish-pic.c b/drivers/irqchip/irq-goldfish-pic.c index c2047ccf4360..d458cf898f8e 100644 --- a/drivers/irqchip/irq-goldfish-pic.c +++ b/drivers/irqchip/irq-goldfish-pic.c @@ -61,7 +61,7 @@ static int __init goldfish_pic_of_init(struct device_node *of_node, unsigned int parent_irq; int ret = 0; - gfpic = kzalloc_obj(*gfpic, GFP_KERNEL); + gfpic = kzalloc_obj(*gfpic); if (!gfpic) { ret = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-idt3243x.c b/drivers/irqchip/irq-idt3243x.c index 6812396c6268..8b150c7f7e46 100644 --- a/drivers/irqchip/irq-idt3243x.c +++ b/drivers/irqchip/irq-idt3243x.c @@ -52,7 +52,7 @@ static int idt_pic_init(struct device_node *of_node, struct device_node *parent) unsigned int parent_irq; int ret = 0; - idtpic = kzalloc_obj(*idtpic, GFP_KERNEL); + idtpic = kzalloc_obj(*idtpic); if (!idtpic) { ret = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c index 7fff14c7b917..6ea10d3356a7 100644 --- a/drivers/irqchip/irq-imx-gpcv2.c +++ b/drivers/irqchip/irq-imx-gpcv2.c @@ -231,7 +231,7 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, return -ENXIO; } - cd = kzalloc_obj(struct gpcv2_irqchip_data, GFP_KERNEL); + cd = kzalloc_obj(struct gpcv2_irqchip_data); if (!cd) return -ENOMEM; diff --git a/drivers/irqchip/irq-ingenic-tcu.c b/drivers/irqchip/irq-ingenic-tcu.c index e4028ddeb0e8..eebfdf107bd9 100644 --- a/drivers/irqchip/irq-ingenic-tcu.c +++ b/drivers/irqchip/irq-ingenic-tcu.c @@ -96,7 +96,7 @@ static int __init ingenic_tcu_irq_init(struct device_node *np, if (IS_ERR(map)) return PTR_ERR(map); - tcu = kzalloc_obj(*tcu, GFP_KERNEL); + tcu = kzalloc_obj(*tcu); if (!tcu) return -ENOMEM; diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c index fbbe655fa234..27d8c7f87dad 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -67,7 +67,7 @@ static int __init ingenic_intc_of_init(struct device_node *node, int parent_irq, err = 0; unsigned i; - intc = kzalloc_obj(*intc, GFP_KERNEL); + intc = kzalloc_obj(*intc); if (!intc) { err = -ENOMEM; goto out_err; diff --git a/drivers/irqchip/irq-loongarch-avec.c b/drivers/irqchip/irq-loongarch-avec.c index cbea378c25c3..758262fd5bd6 100644 --- a/drivers/irqchip/irq-loongarch-avec.c +++ b/drivers/irqchip/irq-loongarch-avec.c @@ -276,7 +276,7 @@ static int avecintc_domain_alloc(struct irq_domain *domain, unsigned int virq, { for (unsigned int i = 0; i < nr_irqs; i++) { struct irq_data *irqd = irq_domain_get_irq_data(domain, virq + i); - struct avecintc_data *adata = kzalloc_obj(*adata, GFP_KERNEL); + struct avecintc_data *adata = kzalloc_obj(*adata); int ret; if (!adata) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index b219cd18a8f7..a9e8b481d31d 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -584,7 +584,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, struct eiointc_priv *priv; int node; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -633,7 +633,7 @@ static int __init eiointc_of_init(struct device_node *of_node, struct irq_data *irq_data; int parent_irq, ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-htpic.c b/drivers/irqchip/irq-loongson-htpic.c index f0ea5dad7a1c..2d78112f7fc7 100644 --- a/drivers/irqchip/irq-loongson-htpic.c +++ b/drivers/irqchip/irq-loongson-htpic.c @@ -95,7 +95,7 @@ static int __init htpic_of_init(struct device_node *node, struct device_node *pa return -ENODEV; } - htpic = kzalloc_obj(*htpic, GFP_KERNEL); + htpic = kzalloc_obj(*htpic); if (!htpic) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 4645948222ee..75e40ba6069d 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -192,7 +192,7 @@ static int htvec_init(phys_addr_t addr, unsigned long size, int i; struct htvec *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 44b03de6091a..cf44a333b9c8 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -205,7 +205,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, struct irq_domain *domain; struct liointc_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-lpc.c b/drivers/irqchip/irq-loongson-pch-lpc.c index 7a074077d8ba..3ad46ec94e3c 100644 --- a/drivers/irqchip/irq-loongson-pch-lpc.c +++ b/drivers/irqchip/irq-loongson-pch-lpc.c @@ -183,7 +183,7 @@ int __init pch_lpc_acpi_init(struct irq_domain *parent, struct irq_fwspec fwspec; struct fwnode_handle *irq_handle; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c index 9a2d3804bc6e..99a8dd88c48a 100644 --- a/drivers/irqchip/irq-loongson-pch-msi.c +++ b/drivers/irqchip/irq-loongson-pch-msi.c @@ -177,7 +177,7 @@ static int pch_msi_init(phys_addr_t msg_address, int irq_base, int irq_count, int ret; struct pch_msi_data *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index b50fd928e1f6..98fc1770e2a5 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -329,7 +329,7 @@ static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base, struct pch_pic *priv; int i; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-lpc32xx.c b/drivers/irqchip/irq-lpc32xx.c index 7dfd46d8dab2..6ff93df614f8 100644 --- a/drivers/irqchip/irq-lpc32xx.c +++ b/drivers/irqchip/irq-lpc32xx.c @@ -198,7 +198,7 @@ static int __init lpc32xx_of_ic_init(struct device_node *node, const __be32 *reg = of_get_property(node, "reg", NULL); u32 parent_irq, i, addr = reg ? be32_to_cpu(*reg) : 0; - irqc = kzalloc_obj(*irqc, GFP_KERNEL); + irqc = kzalloc_obj(*irqc); if (!irqc) return -ENOMEM; diff --git a/drivers/irqchip/irq-ls1x.c b/drivers/irqchip/irq-ls1x.c index 5c39e02d40aa..208f9d4cd99f 100644 --- a/drivers/irqchip/irq-ls1x.c +++ b/drivers/irqchip/irq-ls1x.c @@ -108,7 +108,7 @@ static int __init ls1x_intc_of_init(struct device_node *node, struct ls1x_intc_priv *priv; int parent_irq, err = 0; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c index 15f4d17a2612..be007d325e67 100644 --- a/drivers/irqchip/irq-mchp-eic.c +++ b/drivers/irqchip/irq-mchp-eic.c @@ -209,7 +209,7 @@ static int mchp_eic_probe(struct platform_device *pdev, struct device_node *pare struct irq_domain *parent_domain = NULL; int ret, i; - eic = kzalloc_obj(*eic, GFP_KERNEL); + eic = kzalloc_obj(*eic); if (!eic) return -ENOMEM; diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c index a19fa5a5ba3e..f722e9c57e2e 100644 --- a/drivers/irqchip/irq-meson-gpio.c +++ b/drivers/irqchip/irq-meson-gpio.c @@ -601,7 +601,7 @@ static int meson_gpio_irq_probe(struct platform_device *pdev, struct device_node return -ENXIO; } - ctl = kzalloc_obj(*ctl, GFP_KERNEL); + ctl = kzalloc_obj(*ctl); if (!ctl) return -ENOMEM; diff --git a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c index 37a8221be9fa..c5ae8920acda 100644 --- a/drivers/irqchip/irq-mips-cpu.c +++ b/drivers/irqchip/irq-mips-cpu.c @@ -237,7 +237,7 @@ static void mips_cpu_register_ipi_domain(struct device_node *of_node) { struct cpu_ipi_domain_state *ipi_domain_state; - ipi_domain_state = kzalloc_obj(*ipi_domain_state, GFP_KERNEL); + ipi_domain_state = kzalloc_obj(*ipi_domain_state); ipi_domain = irq_domain_create_hierarchy(irq_domain, IRQ_DOMAIN_FLAG_IPI_SINGLE, 2, of_fwnode_handle(of_node), &mips_cpu_ipi_chip_ops, ipi_domain_state); diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c index e4c1281e9ae4..b5335f6fd6d6 100644 --- a/drivers/irqchip/irq-mst-intc.c +++ b/drivers/irqchip/irq-mst-intc.c @@ -263,7 +263,7 @@ static int __init mst_intc_of_init(struct device_node *dn, of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end)) return -EINVAL; - cd = kzalloc_obj(*cd, GFP_KERNEL); + cd = kzalloc_obj(*cd); if (!cd) return -ENOMEM; diff --git a/drivers/irqchip/irq-mtk-cirq.c b/drivers/irqchip/irq-mtk-cirq.c index 1ac2b2ae94cf..914d1d639fe3 100644 --- a/drivers/irqchip/irq-mtk-cirq.c +++ b/drivers/irqchip/irq-mtk-cirq.c @@ -311,7 +311,7 @@ static int __init mtk_cirq_of_init(struct device_node *node, return -EINVAL; } - cirq_data = kzalloc_obj(*cirq_data, GFP_KERNEL); + cirq_data = kzalloc_obj(*cirq_data); if (!cirq_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c index 1988bb02b4d3..d057209e1d15 100644 --- a/drivers/irqchip/irq-mtk-sysirq.c +++ b/drivers/irqchip/irq-mtk-sysirq.c @@ -133,7 +133,7 @@ static int __init mtk_sysirq_of_init(struct device_node *node, return -EINVAL; } - chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data); if (!chip_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index 933511ec6d1f..b99ab9dcc14b 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c @@ -178,7 +178,7 @@ static int __init mvebu_odmi_init(struct device_node *node, if (of_property_read_u32(node, "marvell,odmi-frames", &odmis_count)) return -EINVAL; - odmis = kzalloc_objs(struct odmi_data, odmis_count, GFP_KERNEL); + odmis = kzalloc_objs(struct odmi_data, odmis_count); if (!odmis) return -ENOMEM; diff --git a/drivers/irqchip/irq-owl-sirq.c b/drivers/irqchip/irq-owl-sirq.c index f1985a2dc6a1..cf14780488be 100644 --- a/drivers/irqchip/irq-owl-sirq.c +++ b/drivers/irqchip/irq-owl-sirq.c @@ -288,7 +288,7 @@ static int __init owl_sirq_init(const struct owl_sirq_params *params, return -ENXIO; } - chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data); if (!chip_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evic.c index be99b64bc35d..e85c3e300701 100644 --- a/drivers/irqchip/irq-pic32-evic.c +++ b/drivers/irqchip/irq-pic32-evic.c @@ -221,7 +221,7 @@ static int __init pic32_of_init(struct device_node *node, if (!evic_base) return -ENOMEM; - priv = kzalloc_objs(*priv, nchips, GFP_KERNEL); + priv = kzalloc_objs(*priv, nchips); if (!priv) { ret = -ENOMEM; goto err_iounmap; diff --git a/drivers/irqchip/irq-riscv-imsic-state.c b/drivers/irqchip/irq-riscv-imsic-state.c index 101b871a6014..61f46fd800fc 100644 --- a/drivers/irqchip/irq-riscv-imsic-state.c +++ b/drivers/irqchip/irq-riscv-imsic-state.c @@ -810,7 +810,7 @@ int __init imsic_setup_state(struct fwnode_handle *fwnode, void *opaque) return -ENODEV; } - imsic = kzalloc_obj(*imsic, GFP_KERNEL); + imsic = kzalloc_obj(*imsic); if (!imsic) return -ENOMEM; imsic->fwnode = fwnode; @@ -828,14 +828,14 @@ int __init imsic_setup_state(struct fwnode_handle *fwnode, void *opaque) goto out_free_local; /* Allocate MMIO resource array */ - mmios = kzalloc_objs(*mmios, nr_mmios, GFP_KERNEL); + mmios = kzalloc_objs(*mmios, nr_mmios); if (!mmios) { rc = -ENOMEM; goto out_free_local; } /* Allocate MMIO virtual address array */ - mmios_va = kzalloc_objs(*mmios_va, nr_mmios, GFP_KERNEL); + mmios_va = kzalloc_objs(*mmios_va, nr_mmios); if (!mmios_va) { rc = -ENOMEM; goto out_iounmap; diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 8533a516de1c..85fbe72deda5 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -356,7 +356,7 @@ static int __init riscv_intc_acpi_init(union acpi_subtable_headers *header, } rintc = (struct acpi_madt_rintc *)header; - rintc_acpi_data[nr_rintc] = kzalloc_obj(*rintc_acpi_data[0], GFP_KERNEL); + rintc_acpi_data[nr_rintc] = kzalloc_obj(*rintc_acpi_data[0]); if (!rintc_acpi_data[nr_rintc]) return -ENOMEM; diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c index 39e85561e8b3..686d39254426 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -640,7 +640,7 @@ static int plic_probe(struct fwnode_handle *fwnode) if (error) goto fail_free_regs; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail_free_regs; diff --git a/drivers/irqchip/irq-sni-exiu.c b/drivers/irqchip/irq-sni-exiu.c index 2e5596048988..bfd2adedf8f3 100644 --- a/drivers/irqchip/irq-sni-exiu.c +++ b/drivers/irqchip/irq-sni-exiu.c @@ -199,7 +199,7 @@ static struct exiu_irq_data *exiu_init(const struct fwnode_handle *fwnode, struct exiu_irq_data *data; int err; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip/irq-starfive-jh8100-intc.c index aa0a15f97ccf..bb62ef363d0b 100644 --- a/drivers/irqchip/irq-starfive-jh8100-intc.c +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c @@ -123,7 +123,7 @@ static int starfive_intc_probe(struct platform_device *pdev, struct device_node int parent_irq; int ret; - irqc = kzalloc_obj(*irqc, GFP_KERNEL); + irqc = kzalloc_obj(*irqc); if (!irqc) return -ENOMEM; diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index c27aaf7e506a..983b944ea292 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -269,7 +269,7 @@ stm32_exti_host_data *stm32_exti_host_init(const struct stm32_exti_drv_data *dd, { struct stm32_exti_host_data *host_data; - host_data = kzalloc_obj(*host_data, GFP_KERNEL); + host_data = kzalloc_obj(*host_data); if (!host_data) return NULL; diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c index dde777304171..b095d45da75d 100644 --- a/drivers/irqchip/irq-sun4i.c +++ b/drivers/irqchip/irq-sun4i.c @@ -146,7 +146,7 @@ static int __init sun4i_of_init(struct device_node *node, static int __init sun4i_ic_of_init(struct device_node *node, struct device_node *parent) { - irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data, GFP_KERNEL); + irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data); if (!irq_ic_data) return -ENOMEM; @@ -161,7 +161,7 @@ IRQCHIP_DECLARE(allwinner_sun4i_ic, "allwinner,sun4i-a10-ic", sun4i_ic_of_init); static int __init suniv_ic_of_init(struct device_node *node, struct device_node *parent) { - irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data, GFP_KERNEL); + irq_ic_data = kzalloc_obj(struct sun4i_irq_chip_data); if (!irq_ic_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c index f0cd19f88cf0..b449e9cc4034 100644 --- a/drivers/irqchip/irq-tegra.c +++ b/drivers/irqchip/irq-tegra.c @@ -302,7 +302,7 @@ static int __init tegra_ictlr_init(struct device_node *node, soc = match->data; - lic = kzalloc_obj(*lic, GFP_KERNEL); + lic = kzalloc_obj(*lic); if (!lic) return -ENOMEM; diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c index 93aaf19fc4bc..f1eb2f92f0ca 100644 --- a/drivers/irqchip/irq-ti-sci-inta.c +++ b/drivers/irqchip/irq-ti-sci-inta.c @@ -222,7 +222,7 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom goto free_vint; } - vint_desc = kzalloc_obj(*vint_desc, GFP_KERNEL); + vint_desc = kzalloc_obj(*vint_desc); if (!vint_desc) { ret = -ENOMEM; goto free_vint; diff --git a/drivers/irqchip/irq-vf610-mscm-ir.c b/drivers/irqchip/irq-vf610-mscm-ir.c index 750b3d5b4c1d..415a54b27566 100644 --- a/drivers/irqchip/irq-vf610-mscm-ir.c +++ b/drivers/irqchip/irq-vf610-mscm-ir.c @@ -188,7 +188,7 @@ static int __init vf610_mscm_ir_of_init(struct device_node *node, return -EINVAL; } - mscm_ir_data = kzalloc_obj(*mscm_ir_data, GFP_KERNEL); + mscm_ir_data = kzalloc_obj(*mscm_ir_data); if (!mscm_ir_data) return -ENOMEM; diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c index 48bd0ac5cf63..b159e17ed1df 100644 --- a/drivers/irqchip/irq-vt8500.c +++ b/drivers/irqchip/irq-vt8500.c @@ -203,7 +203,7 @@ static int __init vt8500_irq_init(struct device_node *node, struct vt8500_irq_data *intc; int irq, i, ret = 0; - intc = kzalloc_obj(*intc, GFP_KERNEL); + intc = kzalloc_obj(*intc); if (!intc) return -ENOMEM; diff --git a/drivers/irqchip/irq-wpcm450-aic.c b/drivers/irqchip/irq-wpcm450-aic.c index 22ee3cfbfa03..be585ab0306b 100644 --- a/drivers/irqchip/irq-wpcm450-aic.c +++ b/drivers/irqchip/irq-wpcm450-aic.c @@ -139,7 +139,7 @@ static int __init wpcm450_aic_of_init(struct device_node *node, if (parent) return -EINVAL; - aic = kzalloc_obj(*aic, GFP_KERNEL); + aic = kzalloc_obj(*aic); if (!aic) return -ENOMEM; diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index b922226adbee..bba6f6dc405e 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -171,7 +171,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, struct xintc_irq_chip *irqc; int ret, irq; - irqc = kzalloc_obj(*irqc, GFP_KERNEL); + irqc = kzalloc_obj(*irqc); if (!irqc) return -ENOMEM; irqc->base = of_iomap(intc, 0); diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 10d54ab3ad90..32b77fa93f73 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -318,7 +318,7 @@ static int pdc_setup_pin_mapping(struct device_node *np) return -EINVAL; pdc_region_cnt = n / 3; - pdc_region = kzalloc_objs(*pdc_region, pdc_region_cnt, GFP_KERNEL); + pdc_region = kzalloc_objs(*pdc_region, pdc_region_cnt); if (!pdc_region) { pdc_region_cnt = 0; return -ENOMEM; diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index b1b367353b4f..b7c04036ace5 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -215,7 +215,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) struct device *dev; unsigned int minor; - mp = kzalloc_obj(*mp, GFP_KERNEL); + mp = kzalloc_obj(*mp); if (!mp) { printk(KERN_ERR "capi: can't alloc capiminor\n"); return NULL; @@ -341,7 +341,7 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) { struct capincci *np; - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); if (!np) return NULL; np->ncci = ncci; @@ -981,7 +981,7 @@ static int capi_open(struct inode *inode, struct file *file) { struct capidev *cdev; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return -ENOMEM; diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c index 298029340ba8..eec9b36343b7 100644 --- a/drivers/isdn/capi/capiutil.c +++ b/drivers/isdn/capi/capiutil.c @@ -618,10 +618,10 @@ _cdebbuf *capi_message2str(u8 *msg) int __init cdebug_init(void) { - g_cmsg = kmalloc_obj(_cmsg, GFP_KERNEL); + g_cmsg = kmalloc_obj(_cmsg); if (!g_cmsg) return -ENOMEM; - g_debbuf = kmalloc_obj(_cdebbuf, GFP_KERNEL); + g_debbuf = kmalloc_obj(_cdebbuf); if (!g_debbuf) { kfree(g_cmsg); return -ENOMEM; diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index e833b45834d2..55e0b9efa194 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c @@ -1090,7 +1090,7 @@ fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err = -ENOMEM; struct fritzcard *card; - card = kzalloc_obj(struct fritzcard, GFP_KERNEL); + card = kzalloc_obj(struct fritzcard); if (!card) { pr_info("No kmem for fritzcard\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 23db1ca03fa6..b3d28976b33a 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4777,7 +4777,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m, int pt) char name[MISDN_MAX_IDLEN]; int bcount = 0; - dch = kzalloc_obj(struct dchannel, GFP_KERNEL); + dch = kzalloc_obj(struct dchannel); if (!dch) return -ENOMEM; dch->debug = debug; @@ -4795,7 +4795,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m, int pt) for (ch = 1; ch <= 31; ch++) { if (!((1 << ch) & hc->bmask[pt])) /* skip unused channel */ continue; - bch = kzalloc_obj(struct bchannel, GFP_KERNEL); + bch = kzalloc_obj(struct bchannel); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); @@ -4850,7 +4850,7 @@ init_multi_port(struct hfc_multi *hc, int pt) int ch, i, ret = 0; char name[MISDN_MAX_IDLEN]; - dch = kzalloc_obj(struct dchannel, GFP_KERNEL); + dch = kzalloc_obj(struct dchannel); if (!dch) return -ENOMEM; dch->debug = debug; @@ -4868,7 +4868,7 @@ init_multi_port(struct hfc_multi *hc, int pt) hc->chan[i + 2].port = pt; hc->chan[i + 2].nt_timer = -1; for (ch = 0; ch < dch->dev.nrbchan; ch++) { - bch = kzalloc_obj(struct bchannel, GFP_KERNEL); + bch = kzalloc_obj(struct bchannel); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); @@ -4991,7 +4991,7 @@ hfcmulti_init(struct hm_map *m, struct pci_dev *pdev, type[HFC_cnt]); /* allocate card+fifo structure */ - hc = kzalloc_obj(struct hfc_multi, GFP_KERNEL); + hc = kzalloc_obj(struct hfc_multi); if (!hc) { printk(KERN_ERR "No kmem for HFC-Multi card\n"); return -ENOMEM; diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index 6446eea8d9bb..554a1c640321 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -2225,7 +2225,7 @@ hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct hfc_pci *card; struct _hfc_map *m = (struct _hfc_map *)ent->driver_data; - card = kzalloc_obj(struct hfc_pci, GFP_KERNEL); + card = kzalloc_obj(struct hfc_pci); if (!card) { printk(KERN_ERR "No kmem for HFC card\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 293add6adeaf..227babe83879 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c @@ -1696,7 +1696,7 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel) static int setup_hfcsusb(struct hfcsusb *hw) { - void *dmabuf = kmalloc_obj(u_char, GFP_KERNEL); + void *dmabuf = kmalloc_obj(u_char); u_char b; int ret; @@ -2018,7 +2018,7 @@ hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) return -EIO; iface = iface_used; - hw = kzalloc_obj(struct hfcsusb, GFP_KERNEL); + hw = kzalloc_obj(struct hfcsusb); if (!hw) return -ENOMEM; /* got no mem */ snprintf(hw->name, MISDN_MAX_IDLEN - 1, "%s", DRIVER_NAME); diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c index 09d85c5f2ca5..aaa639ad5526 100644 --- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c +++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c @@ -1074,7 +1074,7 @@ inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err = -ENOMEM; struct inf_hw *card; - card = kzalloc_obj(struct inf_hw, GFP_KERNEL); + card = kzalloc_obj(struct inf_hw); if (!card) { pr_info("No memory for Infineon ISDN card\n"); return err; @@ -1108,7 +1108,7 @@ inf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct inf_hw *sc; for (i = 1; i < 4; i++) { - sc = kzalloc_obj(struct inf_hw, GFP_KERNEL); + sc = kzalloc_obj(struct inf_hw); if (!sc) { release_card(card); pci_disable_device(pdev); diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index e5c28f25d190..8d740d8eacec 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c @@ -1070,7 +1070,7 @@ nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return -ENODEV; } - card = kzalloc_obj(struct tiger_hw, GFP_KERNEL); + card = kzalloc_obj(struct tiger_hw); if (!card) { pr_info("No kmem for Netjet\n"); return err; diff --git a/drivers/isdn/hardware/mISDN/speedfax.c b/drivers/isdn/hardware/mISDN/speedfax.c index 5df9fd5b0c9c..ab24c3c460e6 100644 --- a/drivers/isdn/hardware/mISDN/speedfax.c +++ b/drivers/isdn/hardware/mISDN/speedfax.c @@ -443,7 +443,7 @@ static int sfaxpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int err = -ENOMEM; - struct sfax_hw *card = kzalloc_obj(struct sfax_hw, GFP_KERNEL); + struct sfax_hw *card = kzalloc_obj(struct sfax_hw); if (!card) { pr_info("No memory for Speedfax+ PCI\n"); diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 60bb2f302b1c..a341470c042f 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -1342,7 +1342,7 @@ w6692_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct w6692_hw *card; struct w6692map *m = (struct w6692map *)ent->driver_data; - card = kzalloc_obj(struct w6692_hw, GFP_KERNEL); + card = kzalloc_obj(struct w6692_hw); if (!card) { pr_info("No kmem for w6692 card\n"); return err; diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 2e02a81fe760..6866a0d6b382 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1370,7 +1370,7 @@ init_card(struct l1oip *hc, int pri, int bundle) (hc->remoteip >> 8) & 0xff, hc->remoteip & 0xff, hc->remoteport, hc->ondemand); - dch = kzalloc_obj(struct dchannel, GFP_KERNEL); + dch = kzalloc_obj(struct dchannel); if (!dch) return -ENOMEM; dch->debug = debug; @@ -1391,7 +1391,7 @@ init_card(struct l1oip *hc, int pri, int bundle) for (ch = 0; ch < dch->dev.nrbchan; ch++) { if (ch == 15) i++; - bch = kzalloc_obj(struct bchannel, GFP_KERNEL); + bch = kzalloc_obj(struct bchannel); if (!bch) { printk(KERN_ERR "%s: no memory for bchannel\n", __func__); diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c index ea32330c1612..b75869c9f78f 100644 --- a/drivers/isdn/mISDN/layer2.c +++ b/drivers/isdn/mISDN/layer2.c @@ -2111,7 +2111,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, int tei, struct layer2 *l2; struct channel_req rq; - l2 = kzalloc_obj(struct layer2, GFP_KERNEL); + l2 = kzalloc_obj(struct layer2); if (!l2) { printk(KERN_ERR "kzalloc layer2 failed\n"); return NULL; diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index 4226bae0f8c6..4e96684af0aa 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c @@ -366,7 +366,7 @@ create_stack(struct mISDNdevice *dev) int err; DECLARE_COMPLETION_ONSTACK(done); - newst = kzalloc_obj(struct mISDNstack, GFP_KERNEL); + newst = kzalloc_obj(struct mISDNstack); if (!newst) { printk(KERN_ERR "kmalloc mISDN_stack failed\n"); return -ENOMEM; diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c index e7c1d465cef3..2bad3083be90 100644 --- a/drivers/isdn/mISDN/tei.c +++ b/drivers/isdn/mISDN/tei.c @@ -803,7 +803,7 @@ create_new_tei(struct manager *mgr, int tei, int sapi) printk(KERN_WARNING "%s:no memory for layer2\n", __func__); return NULL; } - l2->tm = kzalloc_obj(struct teimgr, GFP_KERNEL); + l2->tm = kzalloc_obj(struct teimgr); if (!l2->tm) { kfree(l2); printk(KERN_WARNING "%s:no memory for teimgr\n", __func__); @@ -1046,7 +1046,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq) crq->adr.tei, crq->adr.sapi); if (!l2) return -ENOMEM; - l2->tm = kzalloc_obj(struct teimgr, GFP_KERNEL); + l2->tm = kzalloc_obj(struct teimgr); if (!l2->tm) { kfree(l2); printk(KERN_ERR "kmalloc teimgr failed\n"); @@ -1345,7 +1345,7 @@ create_teimanager(struct mISDNdevice *dev) { struct manager *mgr; - mgr = kzalloc_obj(struct manager, GFP_KERNEL); + mgr = kzalloc_obj(struct manager); if (!mgr) return -ENOMEM; INIT_LIST_HEAD(&mgr->layer2); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index 25b9625b1cd8..a18845755633 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -47,7 +47,7 @@ mISDN_open(struct inode *ino, struct file *filep) if (*debug & DEBUG_TIMER) printk(KERN_DEBUG "%s(%p,%p)\n", __func__, ino, filep); - dev = kmalloc_obj(struct mISDNtimerdev, GFP_KERNEL); + dev = kmalloc_obj(struct mISDNtimerdev); if (!dev) return -ENOMEM; dev->next_id = 1; @@ -179,7 +179,7 @@ misdn_add_timer(struct mISDNtimerdev *dev, int timeout) wake_up_interruptible(&dev->wait); id = 0; } else { - timer = kzalloc_obj(struct mISDNtimer, GFP_KERNEL); + timer = kzalloc_obj(struct mISDNtimer); if (!timer) return -ENOMEM; timer->dev = dev; diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 2fdb713307c3..b1223218bda1 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -486,7 +486,7 @@ void led_trigger_register_simple(const char *name, struct led_trigger **tp) struct led_trigger *trig; int err; - trig = kzalloc_obj(struct led_trigger, GFP_KERNEL); + trig = kzalloc_obj(struct led_trigger); if (trig) { trig->name = name; diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 138c8fb3514c..016bf468e094 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -996,7 +996,7 @@ static int lpg_pattern_set(struct lpg_led *led, struct led_pattern *led_pattern, if (len % 2) return -EINVAL; - pattern = kzalloc_objs(*pattern, len / 2, GFP_KERNEL); + pattern = kzalloc_objs(*pattern, len / 2); if (!pattern) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c index 4f0c16b04876..3674bceda718 100644 --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -188,7 +188,7 @@ static int activity_activate(struct led_classdev *led_cdev) { struct activity_data *activity_data; - activity_data = kzalloc_obj(*activity_data, GFP_KERNEL); + activity_data = kzalloc_obj(*activity_data); if (!activity_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-backlight.c b/drivers/leds/trigger/ledtrig-backlight.c index 80b33f13beee..e67bc7c2aecb 100644 --- a/drivers/leds/trigger/ledtrig-backlight.c +++ b/drivers/leds/trigger/ledtrig-backlight.c @@ -102,7 +102,7 @@ static int bl_trig_activate(struct led_classdev *led) { struct bl_trig_notifier *n; - n = kzalloc_obj(struct bl_trig_notifier, GFP_KERNEL); + n = kzalloc_obj(struct bl_trig_notifier); if (!n) return -ENOMEM; led_set_trigger_data(led, n); diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index eec6de5ea3bc..fc911dfec0ef 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -78,7 +78,7 @@ static int gpio_trig_activate(struct led_classdev *led) struct device *dev = led->dev; int ret; - gpio_data = kzalloc_obj(*gpio_data, GFP_KERNEL); + gpio_data = kzalloc_obj(*gpio_data); if (!gpio_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c index 6ad8b486b058..efe0042b3157 100644 --- a/drivers/leds/trigger/ledtrig-heartbeat.c +++ b/drivers/leds/trigger/ledtrig-heartbeat.c @@ -129,7 +129,7 @@ static int heartbeat_trig_activate(struct led_classdev *led_cdev) { struct heartbeat_trig_data *heartbeat_data; - heartbeat_data = kzalloc_obj(*heartbeat_data, GFP_KERNEL); + heartbeat_data = kzalloc_obj(*heartbeat_data); if (!heartbeat_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-input-events.c b/drivers/leds/trigger/ledtrig-input-events.c index dcdea964311d..d057b2a23967 100644 --- a/drivers/leds/trigger/ledtrig-input-events.c +++ b/drivers/leds/trigger/ledtrig-input-events.c @@ -75,7 +75,7 @@ static int input_events_connect(struct input_handler *handler, struct input_dev struct input_handle *handle; int ret; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index e15e7dcdbcd9..12cb3311ea22 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -691,7 +691,7 @@ static int netdev_trig_activate(struct led_classdev *led_cdev) struct device *dev; int rc; - trigger_data = kzalloc_obj(struct led_netdev_data, GFP_KERNEL); + trigger_data = kzalloc_obj(struct led_netdev_data); if (!trigger_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-oneshot.c b/drivers/leds/trigger/ledtrig-oneshot.c index b825e607bb9f..9068e3bb0bdb 100644 --- a/drivers/leds/trigger/ledtrig-oneshot.c +++ b/drivers/leds/trigger/ledtrig-oneshot.c @@ -159,7 +159,7 @@ static int oneshot_trig_activate(struct led_classdev *led_cdev) { struct oneshot_trig_data *oneshot_data; - oneshot_data = kzalloc_obj(*oneshot_data, GFP_KERNEL); + oneshot_data = kzalloc_obj(*oneshot_data); if (!oneshot_data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index 9eaae7757c8e..8f9cbe54e231 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -465,7 +465,7 @@ static int pattern_trig_activate(struct led_classdev *led_cdev) { struct pattern_trig_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 258e5d8db5b2..8d928bb2a0c5 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -164,7 +164,7 @@ static int transient_trig_activate(struct led_classdev *led_cdev) { struct transient_trig_data *tdata; - tdata = kzalloc_obj(struct transient_trig_data, GFP_KERNEL); + tdata = kzalloc_obj(struct transient_trig_data); if (!tdata) return -ENOMEM; diff --git a/drivers/leds/trigger/ledtrig-tty.c b/drivers/leds/trigger/ledtrig-tty.c index 4ce915e417f8..8eb6286b33ac 100644 --- a/drivers/leds/trigger/ledtrig-tty.c +++ b/drivers/leds/trigger/ledtrig-tty.c @@ -312,7 +312,7 @@ static int ledtrig_tty_activate(struct led_classdev *led_cdev) { struct ledtrig_tty_data *trigger_data; - trigger_data = kzalloc_obj(*trigger_data, GFP_KERNEL); + trigger_data = kzalloc_obj(*trigger_data); if (!trigger_data) return -ENOMEM; diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c index b70d203d0b16..ace71ffc0591 100644 --- a/drivers/leds/uleds.c +++ b/drivers/leds/uleds.c @@ -53,7 +53,7 @@ static int uleds_open(struct inode *inode, struct file *file) { struct uleds_device *udev; - udev = kzalloc_obj(*udev, GFP_KERNEL); + udev = kzalloc_obj(*udev); if (!udev) return -ENOMEM; diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 959cfbee7387..fe150125e099 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -674,7 +674,7 @@ static int adb_open(struct inode *inode, struct file *file) ret = -ENXIO; goto out; } - state = kmalloc_obj(struct adbdev_state, GFP_KERNEL); + state = kmalloc_obj(struct adbdev_state); if (!state) { ret = -ENOMEM; goto out; @@ -783,7 +783,7 @@ static ssize_t adb_write(struct file *file, const char __user *buf, if (adb_controller == NULL) return -ENXIO; - req = kmalloc_obj(struct adb_request, GFP_KERNEL); + req = kmalloc_obj(struct adb_request); if (req == NULL) return -ENOMEM; diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index c995f1155a94..6155da58091b 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c @@ -764,7 +764,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id, return -EEXIST; } - adbhid[id] = hid = kzalloc_obj(struct adbhid, GFP_KERNEL); + adbhid[id] = hid = kzalloc_obj(struct adbhid); input_dev = input_allocate_device(); if (!hid || !input_dev) { err = -ENOMEM; diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 37f25b1f68c9..1fdf3855f9bb 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -102,7 +102,7 @@ static int mac_hid_emumouse_connect(struct input_handler *handler, if (dev == mac_hid_emumouse_dev) return -ENODEV; - handle = kzalloc_obj(struct input_handle, GFP_KERNEL); + handle = kzalloc_obj(struct input_handle); if (!handle) return -ENOMEM; diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index b11809c41417..ee3caa3d87d1 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -368,7 +368,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, if (np == NULL) return NULL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index f720c6c64b86..8a1e2c08b096 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -396,7 +396,7 @@ static int rackmeter_probe(struct macio_dev* mdev, } /* Create and initialize our instance data */ - rm = kzalloc_obj(*rm, GFP_KERNEL); + rm = kzalloc_obj(*rm); if (rm == NULL) { printk(KERN_ERR "rackmeter: failed to allocate memory !\n"); rc = -ENOMEM; diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 8f1f57a00981..3e6dfb99a5ce 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -1081,7 +1081,7 @@ static int smu_open(struct inode *inode, struct file *file) struct smu_private *pp; unsigned long flags; - pp = kzalloc_obj(struct smu_private, GFP_KERNEL); + pp = kzalloc_obj(struct smu_private); if (!pp) return -ENOMEM; spin_lock_init(&pp->lock); diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 0f8ac254ecee..1ac29a5cd324 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -498,7 +498,7 @@ static int probe_thermostat(struct i2c_client *client) } } - th = kzalloc_obj(struct thermostat, GFP_KERNEL); + th = kzalloc_obj(struct thermostat); if (!th) return -ENOMEM; diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index e721c84f51c3..8c652c15018c 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -2147,7 +2147,7 @@ pmu_open(struct inode *inode, struct file *file) struct pmu_private *pp; unsigned long flags; - pp = kmalloc_obj(struct pmu_private, GFP_KERNEL); + pp = kmalloc_obj(struct pmu_private); if (!pp) return -ENOMEM; pp->rb_get = pp->rb_put = 0; diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c b/drivers/macintosh/windfarm_ad7417_sensor.c index 40af189795d8..4bae07ca6669 100644 --- a/drivers/macintosh/windfarm_ad7417_sensor.c +++ b/drivers/macintosh/windfarm_ad7417_sensor.c @@ -260,7 +260,7 @@ static int wf_ad7417_probe(struct i2c_client *client) return -ENXIO; } - pv = kzalloc_obj(struct wf_ad7417_priv, GFP_KERNEL); + pv = kzalloc_obj(struct wf_ad7417_priv); if (pv == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 570b5428da1a..13ba7488c5c5 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -94,7 +94,7 @@ static int __init wf_cpufreq_clamp_init(void) goto fail; } - clamp = kmalloc_obj(struct wf_control, GFP_KERNEL); + clamp = kmalloc_obj(struct wf_control); if (clamp == NULL) { ret = -ENOMEM; goto fail; diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c index c3b95f968592..9def86e0cd04 100644 --- a/drivers/macintosh/windfarm_fcu_controls.c +++ b/drivers/macintosh/windfarm_fcu_controls.c @@ -363,7 +363,7 @@ static void wf_fcu_add_fan(struct wf_fcu_priv *pv, const char *name, { struct wf_fcu_fan *fan; - fan = kzalloc_obj(*fan, GFP_KERNEL); + fan = kzalloc_obj(*fan); if (!fan) return; fan->fcu_priv = pv; @@ -518,7 +518,7 @@ static int wf_fcu_probe(struct i2c_client *client) { struct wf_fcu_priv *pv; - pv = kzalloc_obj(*pv, GFP_KERNEL); + pv = kzalloc_obj(*pv); if (!pv) return -ENOMEM; diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 188a1a56e34c..128e9944429a 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -130,7 +130,7 @@ static int wf_lm75_probe(struct i2c_client *client) return -ENXIO; - lm = kzalloc_obj(struct wf_lm75_sensor, GFP_KERNEL); + lm = kzalloc_obj(struct wf_lm75_sensor); if (lm == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c index dcaba5c7bec1..a571035daff6 100644 --- a/drivers/macintosh/windfarm_lm87_sensor.c +++ b/drivers/macintosh/windfarm_lm87_sensor.c @@ -128,7 +128,7 @@ static int wf_lm87_probe(struct i2c_client *client) return -ENODEV; } - lm = kzalloc_obj(struct wf_lm87_sensor, GFP_KERNEL); + lm = kzalloc_obj(struct wf_lm87_sensor); if (lm == NULL) return -ENODEV; diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index be9e75e2d3cf..26b6436e0bb2 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c @@ -85,7 +85,7 @@ static int wf_max6690_probe(struct i2c_client *client) else return -ENXIO; - max = kzalloc_obj(struct wf_6690_sensor, GFP_KERNEL); + max = kzalloc_obj(struct wf_6690_sensor); if (max == NULL) { printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor: " "no memory\n"); diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c index 82e2e4aa6b2e..5e29670d41ff 100644 --- a/drivers/macintosh/windfarm_pm121.c +++ b/drivers/macintosh/windfarm_pm121.c @@ -668,7 +668,7 @@ static void pm121_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - pm121_cpu_state = kmalloc_obj(struct pm121_cpu_state, GFP_KERNEL); + pm121_cpu_state = kmalloc_obj(struct pm121_cpu_state); if (pm121_cpu_state == NULL) goto fail; pm121_cpu_state->ticks = 1; diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index f62a647a66a3..2a4a3746f6a0 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c @@ -283,7 +283,7 @@ static void wf_smu_create_sys_fans(void) } /* Alloc & initialize state */ - wf_smu_sys_fans = kmalloc_obj(struct wf_smu_sys_fans_state, GFP_KERNEL); + wf_smu_sys_fans = kmalloc_obj(struct wf_smu_sys_fans_state); if (wf_smu_sys_fans == NULL) { printk(KERN_WARNING "windfarm: Memory allocation error" " max fan speed\n"); @@ -418,7 +418,7 @@ static void wf_smu_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state, GFP_KERNEL); + wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state); if (wf_smu_cpu_fans == NULL) goto fail; wf_smu_cpu_fans->ticks = 1; diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index 398e61352e16..229be06fda14 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c @@ -168,7 +168,7 @@ static void wf_smu_create_cpu_fans(void) tmax = 0x5e0000; /* 94 degree default */ /* Alloc & initialize state */ - wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state, GFP_KERNEL); + wf_smu_cpu_fans = kmalloc_obj(struct wf_smu_cpu_fans_state); if (wf_smu_cpu_fans == NULL) goto fail; wf_smu_cpu_fans->ticks = 1; diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c index 4cba2b51bd8a..9adceae74345 100644 --- a/drivers/macintosh/windfarm_smu_controls.c +++ b/drivers/macintosh/windfarm_smu_controls.c @@ -162,7 +162,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, const u32 *reg; const char *l; - fct = kmalloc_obj(struct smu_fan_control, GFP_KERNEL); + fct = kmalloc_obj(struct smu_fan_control); if (fct == NULL) return NULL; fct->ctrl.ops = &smu_fan_ops; diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index c613484d7a80..256c1654c295 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -203,7 +203,7 @@ static int wf_sat_probe(struct i2c_client *client) char *name; int vsens[2], isens[2]; - sat = kzalloc_obj(struct wf_sat, GFP_KERNEL); + sat = kzalloc_obj(struct wf_sat); if (sat == NULL) return -ENOMEM; sat->nr = -1; diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c index d7c934c5759d..03fda09deb53 100644 --- a/drivers/macintosh/windfarm_smu_sensors.c +++ b/drivers/macintosh/windfarm_smu_sensors.c @@ -200,7 +200,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) const char *l; const u32 *v; - ads = kmalloc_obj(struct smu_ad_sensor, GFP_KERNEL); + ads = kmalloc_obj(struct smu_ad_sensor); if (ads == NULL) return NULL; l = of_get_property(node, "location", NULL); @@ -338,7 +338,7 @@ smu_cpu_power_create(struct wf_sensor *volts, struct wf_sensor *amps) { struct smu_cpu_power_sensor *pow; - pow = kmalloc_obj(struct smu_cpu_power_sensor, GFP_KERNEL); + pow = kmalloc_obj(struct smu_cpu_power_sensor); if (pow == NULL) return NULL; pow->sens.ops = &smu_cpu_power_ops; diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c index ce17092d5c1f..e6e7c11bac6c 100644 --- a/drivers/mcb/mcb-core.c +++ b/drivers/mcb/mcb-core.c @@ -274,7 +274,7 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier) int bus_nr; int rc; - bus = kzalloc_obj(struct mcb_bus, GFP_KERNEL); + bus = kzalloc_obj(struct mcb_bus); if (!bus) return ERR_PTR(-ENOMEM); @@ -366,7 +366,7 @@ struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus) { struct mcb_device *dev; - dev = kzalloc_obj(struct mcb_device, GFP_KERNEL); + dev = kzalloc_obj(struct mcb_device); if (!dev) return NULL; diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c index 934f8d96922d..7e09a0ea80f8 100644 --- a/drivers/mcb/mcb-parse.c +++ b/drivers/mcb/mcb-parse.c @@ -146,14 +146,14 @@ static int chameleon_get_bar(void __iomem **base, phys_addr_t mapbase, if (bar_count <= 0 || bar_count > CHAMELEON_BAR_MAX) return -ENODEV; - c = kzalloc_objs(struct chameleon_bar, bar_count, GFP_KERNEL); + c = kzalloc_objs(struct chameleon_bar, bar_count); if (!c) return -ENOMEM; chameleon_parse_bar(*base, c, bar_count); *base += BAR_DESC_SIZE(bar_count); } else { - c = kzalloc_obj(struct chameleon_bar, GFP_KERNEL); + c = kzalloc_obj(struct chameleon_bar); if (!c) return -ENOMEM; diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 90cc6ed4bd6d..3ec240ec685d 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -697,7 +697,7 @@ int bch_open_buckets_alloc(struct cache_set *c) spin_lock_init(&c->data_bucket_lock); for (i = 0; i < MAX_OPEN_BUCKETS; i++) { - struct open_bucket *b = kzalloc_obj(*b, GFP_KERNEL); + struct open_bucket *b = kzalloc_obj(*b); if (!b) return -ENOMEM; diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 55f5e202015d..2691a5da3368 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -208,7 +208,7 @@ static int bch_dump_open(struct inode *inode, struct file *file) struct cache_set *c = inode->i_private; struct dump_iterator *i; - i = kzalloc_obj(struct dump_iterator, GFP_KERNEL); + i = kzalloc_obj(struct dump_iterator); if (!i) return -ENOMEM; diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index a304ef80820b..64bb38c95895 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1527,7 +1527,7 @@ static CLOSURE_CALLBACK(flash_dev_flush) static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) { int err = -ENOMEM; - struct bcache_device *d = kzalloc_obj(struct bcache_device, GFP_KERNEL); + struct bcache_device *d = kzalloc_obj(struct bcache_device); if (!d) goto err_ret; @@ -1863,7 +1863,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb) { int iter_size; struct cache *ca = container_of(sb, struct cache, sb); - struct cache_set *c = kzalloc_obj(struct cache_set, GFP_KERNEL); + struct cache_set *c = kzalloc_obj(struct cache_set); if (!c) return NULL; @@ -2542,8 +2542,8 @@ static void register_device_async(struct async_reg_args *args) static void *alloc_holder_object(struct cache_sb *sb) { if (SB_IS_BDEV(sb)) - return kzalloc_obj(struct cached_dev, GFP_KERNEL); - return kzalloc_obj(struct cache, GFP_KERNEL); + return kzalloc_obj(struct cached_dev); + return kzalloc_obj(struct cache); } static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, @@ -2580,7 +2580,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, if (!path) goto out_module_put; - sb = kmalloc_obj(struct cache_sb, GFP_KERNEL); + sb = kmalloc_obj(struct cache_sb); if (!sb) goto out_free_path; @@ -2632,7 +2632,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, if (async_registration) { /* register in asynchronous way */ struct async_reg_args *args = - kzalloc_obj(struct async_reg_args, GFP_KERNEL); + kzalloc_obj(struct async_reg_args); if (!args) { ret = -ENOMEM; @@ -2709,7 +2709,7 @@ static ssize_t bch_pending_bdevs_cleanup(struct kobject *k, mutex_lock(&bch_register_lock); list_for_each_entry_safe(dc, tdc, &uncached_devices, list) { - pdev = kmalloc_obj(struct pdev, GFP_KERNEL); + pdev = kmalloc_obj(struct pdev); if (!pdev) break; pdev->dc = dc; diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index b30424075106..cfac56caa804 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -415,7 +415,7 @@ STORE(__cached_dev) buf, SB_LABEL_SIZE); bch_uuid_write(dc->disk.c); } - env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env); if (!env) return -ENOMEM; add_uevent_var(env, "DRIVER=bcache"); diff --git a/drivers/md/dm-bio-prison-v1.c b/drivers/md/dm-bio-prison-v1.c index fc8bb30dc533..29b916c05082 100644 --- a/drivers/md/dm-bio-prison-v1.c +++ b/drivers/md/dm-bio-prison-v1.c @@ -301,7 +301,7 @@ struct dm_deferred_set *dm_deferred_set_create(void) int i; struct dm_deferred_set *ds; - ds = kmalloc_obj(*ds, GFP_KERNEL); + ds = kmalloc_obj(*ds); if (!ds) return NULL; diff --git a/drivers/md/dm-bio-prison-v2.c b/drivers/md/dm-bio-prison-v2.c index d4daf426c2c7..4e2af53ad99e 100644 --- a/drivers/md/dm-bio-prison-v2.c +++ b/drivers/md/dm-bio-prison-v2.c @@ -36,7 +36,7 @@ static struct kmem_cache *_cell_cache; */ struct dm_bio_prison_v2 *dm_bio_prison_create_v2(struct workqueue_struct *wq) { - struct dm_bio_prison_v2 *prison = kzalloc_obj(*prison, GFP_KERNEL); + struct dm_bio_prison_v2 *prison = kzalloc_obj(*prison); int ret; if (!prison) diff --git a/drivers/md/dm-cache-background-tracker.c b/drivers/md/dm-cache-background-tracker.c index fb5efaab11a3..2ca3a3e2e50e 100644 --- a/drivers/md/dm-cache-background-tracker.c +++ b/drivers/md/dm-cache-background-tracker.c @@ -26,7 +26,7 @@ struct kmem_cache *btracker_work_cache = NULL; struct background_tracker *btracker_create(unsigned int max_work) { - struct background_tracker *b = kmalloc_obj(*b, GFP_KERNEL); + struct background_tracker *b = kmalloc_obj(*b); if (!b) { DMERR("couldn't create background_tracker"); diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 5060a58605a2..57158c02d096 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -760,7 +760,7 @@ static struct dm_cache_metadata *metadata_open(struct block_device *bdev, int r; struct dm_cache_metadata *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { DMERR("could not allocate metadata struct"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c index bec1b5e95170..b328d9601046 100644 --- a/drivers/md/dm-cache-policy-smq.c +++ b/drivers/md/dm-cache-policy-smq.c @@ -1735,7 +1735,7 @@ __smq_create(dm_cblock_t cache_size, sector_t origin_size, sector_t cache_block_ unsigned int i; unsigned int nr_sentinels_per_queue = 2u * NR_CACHE_LEVELS; unsigned int total_sentinels = 2u * nr_sentinels_per_queue; - struct smq_policy *mq = kzalloc_obj(*mq, GFP_KERNEL); + struct smq_policy *mq = kzalloc_obj(*mq); if (!mq) return NULL; diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index be1af992b931..935ab79b1d0c 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2387,7 +2387,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) struct dm_cache_metadata *cmd; bool may_format = ca->features.mode == CM_WRITE; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (!cache) return -ENOMEM; @@ -2612,7 +2612,7 @@ static int cache_ctr(struct dm_target *ti, unsigned int argc, char **argv) struct cache_args *ca; struct cache *cache = NULL; - ca = kzalloc_obj(*ca, GFP_KERNEL); + ca = kzalloc_obj(*ca); if (!ca) { ti->error = "Error allocating memory for cache"; return -ENOMEM; diff --git a/drivers/md/dm-clone-metadata.c b/drivers/md/dm-clone-metadata.c index cb474e852548..e50a5b5a4aea 100644 --- a/drivers/md/dm-clone-metadata.c +++ b/drivers/md/dm-clone-metadata.c @@ -553,7 +553,7 @@ struct dm_clone_metadata *dm_clone_metadata_open(struct block_device *bdev, int r; struct dm_clone_metadata *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { DMERR("Failed to allocate memory for dm-clone metadata"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c index c9b25af70063..c0f9b93983d4 100644 --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -580,7 +580,7 @@ static int hash_table_init(struct clone *clone) sz = 1 << HASH_TABLE_BITS; - clone->ht = kvmalloc_objs(struct hash_table_bucket, sz, GFP_KERNEL); + clone->ht = kvmalloc_objs(struct hash_table_bucket, sz); if (!clone->ht) return -ENOMEM; @@ -1766,7 +1766,7 @@ static int clone_ctr(struct dm_target *ti, unsigned int argc, char **argv) as.argc = argc; as.argv = argv; - clone = kzalloc_obj(*clone, GFP_KERNEL); + clone = kzalloc_obj(*clone); if (!clone) { ti->error = "Failed to allocate clone structure"; return -ENOMEM; diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index a2f9f0f0db5e..9a17b3b603d1 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2363,7 +2363,7 @@ static int crypt_alloc_tfms_aead(struct crypt_config *cc, char *ciphermode) { int err; - cc->cipher_tfm.tfms = kmalloc_obj(struct crypto_skcipher *, GFP_KERNEL); + cc->cipher_tfm.tfms = kmalloc_obj(struct crypto_skcipher *); if (!cc->cipher_tfm.tfms) return -ENOMEM; diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index 5d2dd07a19b0..4864671c2222 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -224,7 +224,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - dc = kzalloc_obj(*dc, GFP_KERNEL); + dc = kzalloc_obj(*dc); if (!dc) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-dust.c b/drivers/md/dm-dust.c index a91f96bad0b9..c7e3077fb1f5 100644 --- a/drivers/md/dm-dust.c +++ b/drivers/md/dm-dust.c @@ -108,7 +108,7 @@ static int dust_add_block(struct dust_device *dd, unsigned long long block, struct badblock *bblock; unsigned long flags; - bblock = kmalloc_obj(*bblock, GFP_KERNEL); + bblock = kmalloc_obj(*bblock); if (bblock == NULL) { if (!dd->quiet_mode) DMERR("%s: badblock allocation failed", __func__); @@ -360,7 +360,7 @@ static int dust_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - dd = kzalloc_obj(struct dust_device, GFP_KERNEL); + dd = kzalloc_obj(struct dust_device); if (dd == NULL) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 4c9a25ae90d6..1e52bde48b91 100644 --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -257,7 +257,7 @@ static int ebs_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - ec = ti->private = kzalloc_obj(*ec, GFP_KERNEL); + ec = ti->private = kzalloc_obj(*ec); if (!ec) { ti->error = "Cannot allocate ebs context"; return -ENOMEM; diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c index 9bec72f04b9b..05285c04ff2c 100644 --- a/drivers/md/dm-era-target.c +++ b/drivers/md/dm-era-target.c @@ -808,7 +808,7 @@ static struct era_metadata *metadata_open(struct block_device *bdev, bool may_format) { int r; - struct era_metadata *md = kzalloc_obj(*md, GFP_KERNEL); + struct era_metadata *md = kzalloc_obj(*md); if (!md) return NULL; @@ -1473,7 +1473,7 @@ static int era_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - era = kzalloc_obj(*era, GFP_KERNEL); + era = kzalloc_obj(*era); if (!era) { ti->error = "Error allocating era structure"; return -ENOMEM; diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index 91d541c66709..58cbc5e5475b 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -204,7 +204,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, return -EINVAL; } - tmp_store = kzalloc_obj(*tmp_store, GFP_KERNEL); + tmp_store = kzalloc_obj(*tmp_store); if (!tmp_store) { ti->error = "Exception store allocation failed"; return -ENOMEM; diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index 922e75bfcf17..572225b0e691 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -277,7 +277,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - fc = kzalloc_obj(*fc, GFP_KERNEL); + fc = kzalloc_obj(*fc); if (!fc) { ti->error = "Cannot allocate context"; return -ENOMEM; diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c index 703250739a8a..7403823384c5 100644 --- a/drivers/md/dm-init.c +++ b/drivers/md/dm-init.c @@ -127,7 +127,7 @@ static char __init *dm_parse_table_entry(struct dm_device *dev, char *str) /* Delimit last field that can be terminated by comma */ next = str_field_delimit(&field[i], ','); - sp = kzalloc_obj(*sp, GFP_KERNEL); + sp = kzalloc_obj(*sp); if (!sp) return ERR_PTR(-ENOMEM); dev->table[n] = sp; @@ -244,7 +244,7 @@ static int __init dm_parse_devices(struct list_head *devices, char *str) DMDEBUG("parsing \"%s\"", str); while (device) { - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; list_add_tail(&dev->list, devices); diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 3da3ce600758..a52ee38dc30c 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4296,7 +4296,7 @@ static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_int n_pages = (end_index - start_index + 1); - s = kvmalloc_objs(struct scatterlist, n_pages, GFP_KERNEL); + s = kvmalloc_objs(struct scatterlist, n_pages); if (!s) { dm_integrity_free_journal_scatterlist(ic, sl); return NULL; @@ -4701,7 +4701,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv return -EINVAL; } - ic = kzalloc_obj(struct dm_integrity_c, GFP_KERNEL); + ic = kzalloc_obj(struct dm_integrity_c); if (!ic) { ti->error = "Cannot allocate integrity context"; return -ENOMEM; diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index d08399b40dac..1db565b37620 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -52,7 +52,7 @@ struct dm_io_client *dm_io_client_create(void) unsigned int min_ios = dm_get_reserved_bio_based_ios(); int ret; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 7ab970430acd..3ab8b4beff86 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -218,7 +218,7 @@ static struct hash_cell *alloc_cell(const char *name, const char *uuid, { struct hash_cell *hc; - hc = kmalloc_obj(*hc, GFP_KERNEL); + hc = kmalloc_obj(*hc); if (!hc) return NULL; @@ -2136,7 +2136,7 @@ static int dm_open(struct inode *inode, struct file *filp) if (unlikely(r)) return r; - priv = filp->private_data = kmalloc_obj(struct dm_file, GFP_KERNEL); + priv = filp->private_data = kmalloc_obj(struct dm_file); if (!priv) return -ENOMEM; diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index 03b81b39c65c..96c8b8ff61c2 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -918,7 +918,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro unsigned int reserve_pages; struct dm_kcopyd_client *kc; - kc = kzalloc_obj(*kc, GFP_KERNEL); + kc = kzalloc_obj(*kc); if (!kc) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 3123227a6e1d..38c17846deb0 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -39,7 +39,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - lc = kmalloc_obj(*lc, GFP_KERNEL); + lc = kmalloc_obj(*lc); if (lc == NULL) { ti->error = "Cannot allocate linear context"; return -ENOMEM; diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c index d1bc7d0c89d9..9d5918eb0a30 100644 --- a/drivers/md/dm-log-userspace-base.c +++ b/drivers/md/dm-log-userspace-base.c @@ -205,7 +205,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti, return -EINVAL; } - lc = kzalloc_obj(*lc, GFP_KERNEL); + lc = kzalloc_obj(*lc); if (!lc) { DMWARN("Unable to allocate userspace log context."); return -ENOMEM; diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index a1040e8049aa..c72e07c3f5a0 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -519,7 +519,7 @@ static int log_writes_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - lc = kzalloc_obj(struct log_writes_c, GFP_KERNEL); + lc = kzalloc_obj(struct log_writes_c); if (!lc) { ti->error = "Cannot allocate context"; return -ENOMEM; @@ -587,7 +587,7 @@ static int log_mark(struct log_writes_c *lc, char *data) struct pending_block *block; size_t maxsize = lc->sectorsize - sizeof(struct log_write_entry); - block = kzalloc_obj(struct pending_block, GFP_KERNEL); + block = kzalloc_obj(struct pending_block); if (!block) { DMERR("Error allocating pending block"); return -ENOMEM; diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 7865002678f5..1aa6a4a7d232 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -153,7 +153,7 @@ struct dm_dirty_log *dm_dirty_log_create(const char *type_name, struct dm_dirty_log_type *type; struct dm_dirty_log *log; - log = kmalloc_obj(*log, GFP_KERNEL); + log = kmalloc_obj(*log); if (!log) return NULL; @@ -402,7 +402,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, region_count = dm_sector_div_up(ti->len, region_size); - lc = kmalloc_obj(*lc, GFP_KERNEL); + lc = kmalloc_obj(*lc); if (!lc) { DMWARN("couldn't allocate core log"); return -ENOMEM; diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index e47cfdf4f5d1..8f4ae2f51545 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -160,7 +160,7 @@ static bool mpath_double_check_test_bit(int MPATHF_bit, struct multipath *m) */ static struct pgpath *alloc_pgpath(void) { - struct pgpath *pgpath = kzalloc_obj(*pgpath, GFP_KERNEL); + struct pgpath *pgpath = kzalloc_obj(*pgpath); if (!pgpath) return NULL; @@ -179,7 +179,7 @@ static struct priority_group *alloc_priority_group(void) { struct priority_group *pg; - pg = kzalloc_obj(*pg, GFP_KERNEL); + pg = kzalloc_obj(*pg); if (pg) INIT_LIST_HEAD(&pg->pgpaths); @@ -216,7 +216,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti) { struct multipath *m; - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (m) { INIT_LIST_HEAD(&m->priority_groups); spin_lock_init(&m->lock); diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c index 28dc759e957a..006a7991f45b 100644 --- a/drivers/md/dm-path-selector.c +++ b/drivers/md/dm-path-selector.c @@ -87,7 +87,7 @@ out: static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst) { - struct ps_internal *psi = kzalloc_obj(*psi, GFP_KERNEL); + struct ps_internal *psi = kzalloc_obj(*psi); if (psi) psi->pst = *pst; diff --git a/drivers/md/dm-pcache/dm_pcache.c b/drivers/md/dm-pcache/dm_pcache.c index c36f2afdadc1..81c795c0400e 100644 --- a/drivers/md/dm-pcache/dm_pcache.c +++ b/drivers/md/dm-pcache/dm_pcache.c @@ -281,7 +281,7 @@ static int dm_pcache_ctr(struct dm_target *ti, unsigned int argc, char **argv) } /* Allocate memory for the cache structure */ - pcache = kzalloc_obj(struct dm_pcache, GFP_KERNEL); + pcache = kzalloc_obj(struct dm_pcache); if (!pcache) return -ENOMEM; diff --git a/drivers/md/dm-ps-historical-service-time.c b/drivers/md/dm-ps-historical-service-time.c index a526b5ab0453..c4755112287a 100644 --- a/drivers/md/dm-ps-historical-service-time.c +++ b/drivers/md/dm-ps-historical-service-time.c @@ -129,7 +129,7 @@ static u64 fixed_ema(u64 last, u64 next, u64 weight) static struct selector *alloc_selector(void) { - struct selector *s = kmalloc_obj(*s, GFP_KERNEL); + struct selector *s = kmalloc_obj(*s); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -289,7 +289,7 @@ static int hst_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc_obj(*pi, GFP_KERNEL); + pi = kmalloc_obj(*pi); if (!pi) { *error = "historical-service-time ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-ps-io-affinity.c b/drivers/md/dm-ps-io-affinity.c index 5d69a4a93684..526d94d138f9 100644 --- a/drivers/md/dm-ps-io-affinity.c +++ b/drivers/md/dm-ps-io-affinity.c @@ -53,7 +53,7 @@ static int ioa_add_path(struct path_selector *ps, struct dm_path *path, return -EINVAL; } - pi = kzalloc_obj(*pi, GFP_KERNEL); + pi = kzalloc_obj(*pi); if (!pi) { *error = "io-affinity ps: Error allocating path context"; return -ENOMEM; @@ -112,11 +112,11 @@ static int ioa_create(struct path_selector *ps, unsigned int argc, char **argv) { struct selector *s; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; - s->path_map = kzalloc_objs(struct path_info *, nr_cpu_ids, GFP_KERNEL); + s->path_map = kzalloc_objs(struct path_info *, nr_cpu_ids); if (!s->path_map) goto free_selector; diff --git a/drivers/md/dm-ps-queue-length.c b/drivers/md/dm-ps-queue-length.c index d2663b1b136c..4afea160afab 100644 --- a/drivers/md/dm-ps-queue-length.c +++ b/drivers/md/dm-ps-queue-length.c @@ -42,7 +42,7 @@ struct path_info { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc_obj(*s, GFP_KERNEL); + struct selector *s = kmalloc_obj(*s); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -142,7 +142,7 @@ static int ql_add_path(struct path_selector *ps, struct dm_path *path, } /* Allocate the path information structure */ - pi = kmalloc_obj(*pi, GFP_KERNEL); + pi = kmalloc_obj(*pi); if (!pi) { *error = "queue-length ps: Error allocating path information"; return -ENOMEM; diff --git a/drivers/md/dm-ps-round-robin.c b/drivers/md/dm-ps-round-robin.c index ec8b9f27d3e7..81c89cda3158 100644 --- a/drivers/md/dm-ps-round-robin.c +++ b/drivers/md/dm-ps-round-robin.c @@ -55,7 +55,7 @@ struct selector { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc_obj(*s, GFP_KERNEL); + struct selector *s = kmalloc_obj(*s); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -144,7 +144,7 @@ static int rr_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc_obj(*pi, GFP_KERNEL); + pi = kmalloc_obj(*pi); if (!pi) { *error = "round-robin ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-ps-service-time.c b/drivers/md/dm-ps-service-time.c index dc119955fadd..83721910e5ea 100644 --- a/drivers/md/dm-ps-service-time.c +++ b/drivers/md/dm-ps-service-time.c @@ -38,7 +38,7 @@ struct path_info { static struct selector *alloc_selector(void) { - struct selector *s = kmalloc_obj(*s, GFP_KERNEL); + struct selector *s = kmalloc_obj(*s); if (s) { INIT_LIST_HEAD(&s->valid_paths); @@ -153,7 +153,7 @@ static int st_add_path(struct path_selector *ps, struct dm_path *path, } /* allocate the path */ - pi = kmalloc_obj(*pi, GFP_KERNEL); + pi = kmalloc_obj(*pi); if (!pi) { *error = "service-time ps: Error allocating path context"; return -ENOMEM; diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index a3489965103c..3ad3aecfdff7 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c @@ -184,7 +184,7 @@ struct dm_region_hash *dm_region_hash_create( ; nr_buckets >>= 1; - rh = kzalloc_obj(*rh, GFP_KERNEL); + rh = kzalloc_obj(*rh); if (!rh) { DMERR("unable to allocate region hash memory"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index c8128af1dcad..2f429ca8e5aa 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -854,7 +854,7 @@ static int persistent_ctr(struct dm_exception_store *store, char *options) int r; /* allocate the pstore */ - ps = kzalloc_obj(*ps, GFP_KERNEL); + ps = kzalloc_obj(*ps); if (!ps) return -ENOMEM; diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c index b7b449db6c34..8680d38cdfcc 100644 --- a/drivers/md/dm-snap-transient.c +++ b/drivers/md/dm-snap-transient.c @@ -77,7 +77,7 @@ static int transient_ctr(struct dm_exception_store *store, char *options) { struct transient_c *tc; - tc = kmalloc_obj(struct transient_c, GFP_KERNEL); + tc = kmalloc_obj(struct transient_c); if (!tc) return -ENOMEM; diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 5a77ccd33232..f31e4b8f4457 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -354,7 +354,7 @@ static int init_origin_hash(void) { int i; - _origins = kmalloc_objs(struct list_head, ORIGIN_HASH_SIZE, GFP_KERNEL); + _origins = kmalloc_objs(struct list_head, ORIGIN_HASH_SIZE); if (!_origins) { DMERR("unable to allocate memory for _origins"); return -ENOMEM; @@ -557,7 +557,7 @@ static int register_snapshot(struct dm_snapshot *snap) struct block_device *bdev = snap->origin->bdev; int r = 0; - new_o = kmalloc_obj(*new_o, GFP_KERNEL); + new_o = kmalloc_obj(*new_o); if (!new_o) return -ENOMEM; @@ -664,7 +664,7 @@ static int dm_exception_table_init(struct dm_exception_table *et, et->hash_shift = hash_shift; et->hash_mask = size - 1; - et->table = kvmalloc_objs(struct dm_hlist_head, size, GFP_KERNEL); + et->table = kvmalloc_objs(struct dm_hlist_head, size); if (!et->table) return -ENOMEM; @@ -1249,7 +1249,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) origin_mode = BLK_OPEN_WRITE; } - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) { ti->error = "Cannot allocate private snapshot structure"; r = -ENOMEM; @@ -2623,7 +2623,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - o = kmalloc_obj(struct dm_origin, GFP_KERNEL); + o = kmalloc_obj(struct dm_origin); if (!o) { ti->error = "Cannot allocate private origin structure"; r = -ENOMEM; diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 4b4712e54797..dc2eff6b739d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -133,7 +133,7 @@ int dm_table_create(struct dm_table **result, blk_mode_t mode, if (num_targets > DM_MAX_TARGETS) return -EOVERFLOW; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) return -ENOMEM; @@ -381,7 +381,7 @@ int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode, dd = find_device(&t->devices, dev); if (!dd) { - dd = kmalloc_obj(*dd, GFP_KERNEL); + dd = kmalloc_obj(*dd); if (!dd) return -ENOMEM; @@ -1391,7 +1391,7 @@ static int dm_table_construct_crypto_profile(struct dm_table *t) unsigned int i; bool empty_profile = true; - dmcp = kmalloc_obj(*dmcp, GFP_KERNEL); + dmcp = kmalloc_obj(*dmcp); if (!dmcp) return -ENOMEM; dmcp->md = t->md; diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c index a138e8a24327..3d294365e3ba 100644 --- a/drivers/md/dm-target.c +++ b/drivers/md/dm-target.c @@ -128,7 +128,7 @@ static int io_err_get_args(struct dm_target *tt, unsigned int argc, char **args) char dummy; int ret; - ioec = kmalloc_obj(*ioec, GFP_KERNEL); + ioec = kmalloc_obj(*ioec); if (!ioec) { tt->error = "Cannot allocate io_err context"; return -ENOMEM; diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index c924ec4d300d..b6a2d2081a24 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -957,7 +957,7 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, int r; struct dm_pool_metadata *pmd; - pmd = kmalloc_obj(*pmd, GFP_KERNEL); + pmd = kmalloc_obj(*pmd); if (!pmd) { DMERR("could not allocate metadata struct"); return ERR_PTR(-ENOMEM); diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 492ead2d9356..59392de7a477 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2949,7 +2949,7 @@ static struct pool *pool_create(struct mapped_device *pool_md, return ERR_CAST(pmd); } - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) { *error = "Error allocating memory for pool"; err_p = ERR_PTR(-ENOMEM); @@ -3354,7 +3354,7 @@ static int pool_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto out; } - pt = kzalloc_obj(*pt, GFP_KERNEL); + pt = kzalloc_obj(*pt); if (!pt) { r = -ENOMEM; goto out; @@ -4193,7 +4193,7 @@ static int thin_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto out_unlock; } - tc = ti->private = kzalloc_obj(*tc, GFP_KERNEL); + tc = ti->private = kzalloc_obj(*tc); if (!tc) { ti->error = "Out of memory"; r = -ENOMEM; diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c index c595d0a138fc..bfcbe6bfa71a 100644 --- a/drivers/md/dm-unstripe.c +++ b/drivers/md/dm-unstripe.c @@ -48,7 +48,7 @@ static int unstripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } - uc = kzalloc_obj(*uc, GFP_KERNEL); + uc = kzalloc_obj(*uc); if (!uc) { ti->error = "Memory allocation for unstriped context failed"; return -ENOMEM; diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 08bb75f00891..14be4d888af3 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -607,7 +607,7 @@ int verity_fec_ctr_alloc(struct dm_verity *v) { struct dm_verity_fec *f; - f = kzalloc_obj(struct dm_verity_fec, GFP_KERNEL); + f = kzalloc_obj(struct dm_verity_fec); if (!f) { v->ti->error = "Cannot allocate FEC structure"; return -ENOMEM; diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 9dd0c195091f..61073cd01d13 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1369,7 +1369,7 @@ static int verity_setup_salt_and_hashstate(struct dm_verity *v, const char *arg) if (likely(v->use_sha256_lib)) { /* Implies version 1: salt at beginning */ v->initial_hashstate.sha256 = - kmalloc_obj(struct sha256_ctx, GFP_KERNEL); + kmalloc_obj(struct sha256_ctx); if (!v->initial_hashstate.sha256) { ti->error = "Cannot allocate initial hash state"; return -ENOMEM; @@ -1430,7 +1430,7 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv) char dummy; char *root_hash_digest_to_validate; - v = kzalloc_obj(struct dm_verity, GFP_KERNEL); + v = kzalloc_obj(struct dm_verity); if (!v) { ti->error = "Cannot allocate verity structure"; return -ENOMEM; diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index bca442478a8d..98bd945f6da7 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2245,7 +2245,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned int argc, char **argv) as.argc = argc; as.argv = argv; - wc = kzalloc_obj(struct dm_writecache, GFP_KERNEL); + wc = kzalloc_obj(struct dm_writecache); if (!wc) { ti->error = "Cannot allocate writecache structure"; r = -ENOMEM; diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index b9a473ffdb70..8d7edd18117d 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -303,7 +303,7 @@ static struct dm_zone *dmz_get(struct dmz_metadata *zmd, unsigned int zone_id) static struct dm_zone *dmz_insert(struct dmz_metadata *zmd, unsigned int zone_id, struct dmz_dev *dev) { - struct dm_zone *zone = kzalloc_obj(struct dm_zone, GFP_KERNEL); + struct dm_zone *zone = kzalloc_obj(struct dm_zone); if (!zone) return ERR_PTR(-ENOMEM); @@ -1311,7 +1311,7 @@ static int dmz_load_sb(struct dmz_metadata *zmd) int i; struct dmz_sb *sb; - sb = kzalloc_obj(struct dmz_sb, GFP_KERNEL); + sb = kzalloc_obj(struct dmz_sb); if (!sb) return -ENOMEM; for (i = 1; i < zmd->nr_devs; i++) { @@ -2868,7 +2868,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev, struct dm_zone *zone; int ret; - zmd = kzalloc_obj(struct dmz_metadata, GFP_KERNEL); + zmd = kzalloc_obj(struct dmz_metadata); if (!zmd) return -ENOMEM; diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c index 8598cc9eb40f..ad9c7bc21d54 100644 --- a/drivers/md/dm-zoned-reclaim.c +++ b/drivers/md/dm-zoned-reclaim.c @@ -556,7 +556,7 @@ int dmz_ctr_reclaim(struct dmz_metadata *zmd, struct dmz_reclaim *zrc; int ret; - zrc = kzalloc_obj(struct dmz_reclaim, GFP_KERNEL); + zrc = kzalloc_obj(struct dmz_reclaim); if (!zrc) return -ENOMEM; diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 0e6ddfb96e03..d55500fc88ef 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -838,18 +838,18 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) } /* Allocate and initialize the target descriptor */ - dmz = kzalloc_obj(struct dmz_target, GFP_KERNEL); + dmz = kzalloc_obj(struct dmz_target); if (!dmz) { ti->error = "Unable to allocate the zoned target descriptor"; return -ENOMEM; } - dmz->dev = kzalloc_objs(struct dmz_dev, argc, GFP_KERNEL); + dmz->dev = kzalloc_objs(struct dmz_dev, argc); if (!dmz->dev) { ti->error = "Unable to allocate the zoned device descriptors"; kfree(dmz); return -ENOMEM; } - dmz->ddev = kzalloc_objs(struct dm_dev *, argc, GFP_KERNEL); + dmz->ddev = kzalloc_objs(struct dm_dev *, argc); if (!dmz->ddev) { ti->error = "Unable to allocate the dm device descriptors"; ret = -ENOMEM; diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index ca833f147c6a..83378c033c72 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -1025,7 +1025,7 @@ static int md_bitmap_storage_alloc(struct bitmap_storage *store, num_pages = DIV_ROUND_UP(bytes, PAGE_SIZE); offset = slot_number * num_pages; - store->filemap = kmalloc_objs(struct page *, num_pages, GFP_KERNEL); + store->filemap = kmalloc_objs(struct page *, num_pages); if (!store->filemap) return -ENOMEM; @@ -2120,7 +2120,7 @@ static struct bitmap *__bitmap_create(struct mddev *mddev, int slot) return ERR_PTR(-EBUSY); } - bitmap = kzalloc_obj(*bitmap, GFP_KERNEL); + bitmap = kzalloc_obj(*bitmap); if (!bitmap) return ERR_PTR(-ENOMEM); @@ -2435,7 +2435,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks, pages = DIV_ROUND_UP(chunks, PAGE_COUNTER_RATIO); - new_bp = kzalloc_objs(*new_bp, pages, GFP_KERNEL); + new_bp = kzalloc_objs(*new_bp, pages); ret = -ENOMEM; if (!new_bp) { md_bitmap_file_unmap(&store); diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index c588c972ad54..856e4b3c2bde 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -196,7 +196,7 @@ static struct dlm_lock_resource *lockres_init(struct mddev *mddev, int ret, namelen; struct md_cluster_info *cinfo = mddev->cluster_info; - res = kzalloc_obj(struct dlm_lock_resource, GFP_KERNEL); + res = kzalloc_obj(struct dlm_lock_resource); if (!res) return NULL; init_waitqueue_head(&res->sync_locking); @@ -886,7 +886,7 @@ static int join(struct mddev *mddev, int nodes) int ret, ops_rv; char str[64]; - cinfo = kzalloc_obj(struct md_cluster_info, GFP_KERNEL); + cinfo = kzalloc_obj(struct md_cluster_info); if (!cinfo) return -ENOMEM; diff --git a/drivers/md/md-llbitmap.c b/drivers/md/md-llbitmap.c index e8d7af0c665a..bf398d7476b3 100644 --- a/drivers/md/md-llbitmap.c +++ b/drivers/md/md-llbitmap.c @@ -982,7 +982,7 @@ static int llbitmap_create(struct mddev *mddev) if (ret) return ret; - llbitmap = kzalloc_obj(*llbitmap, GFP_KERNEL); + llbitmap = kzalloc_obj(*llbitmap); if (!llbitmap) return -ENOMEM; diff --git a/drivers/md/md.c b/drivers/md/md.c index b7ac2440fbbb..3ce6f9e9d38e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -853,7 +853,7 @@ static struct mddev *mddev_alloc(dev_t unit) if (unit && MAJOR(unit) != MD_MAJOR) unit &= ~((1 << MdpMinorShift) - 1); - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return ERR_PTR(-ENOMEM); @@ -1222,8 +1222,8 @@ static int md_sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) int ret; mdp_super_t *tmp1, *tmp2; - tmp1 = kmalloc_obj(*tmp1, GFP_KERNEL); - tmp2 = kmalloc_obj(*tmp2, GFP_KERNEL); + tmp1 = kmalloc_obj(*tmp1); + tmp2 = kmalloc_obj(*tmp2); if (!tmp1 || !tmp2) { ret = 0; @@ -3817,7 +3817,7 @@ static struct md_rdev *md_import_device(dev_t newdev, int super_format, int supe sector_t size; int err; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return ERR_PTR(-ENOMEM); @@ -8541,7 +8541,7 @@ struct md_thread *md_register_thread(void (*run) (struct md_thread *), { struct md_thread *thread; - thread = kzalloc_obj(struct md_thread, GFP_KERNEL); + thread = kzalloc_obj(struct md_thread); if (!thread) return NULL; @@ -10749,7 +10749,7 @@ void md_autodetect_dev(dev_t dev) { struct detected_devices_node *node_detected_dev; - node_detected_dev = kzalloc_obj(*node_detected_dev, GFP_KERNEL); + node_detected_dev = kzalloc_obj(*node_detected_dev); if (node_detected_dev) { node_detected_dev->dev = dev; mutex_lock(&detected_devices_mutex); diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index 43bd64b77a7d..a5003774f8bf 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -388,7 +388,7 @@ struct dm_block_manager *dm_block_manager_create(struct block_device *bdev, int r; struct dm_block_manager *bm; - bm = kmalloc_obj(*bm, GFP_KERNEL); + bm = kmalloc_obj(*bm); if (!bm) { r = -ENOMEM; goto bad; diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c index 1d3cfc87701a..27c0be9c5a37 100644 --- a/drivers/md/persistent-data/dm-space-map-disk.c +++ b/drivers/md/persistent-data/dm-space-map-disk.c @@ -220,7 +220,7 @@ struct dm_space_map *dm_sm_disk_create(struct dm_transaction_manager *tm, int r; struct sm_disk *smd; - smd = kmalloc_obj(*smd, GFP_KERNEL); + smd = kmalloc_obj(*smd); if (!smd) return ERR_PTR(-ENOMEM); @@ -254,7 +254,7 @@ struct dm_space_map *dm_sm_disk_open(struct dm_transaction_manager *tm, int r; struct sm_disk *smd; - smd = kmalloc_obj(*smd, GFP_KERNEL); + smd = kmalloc_obj(*smd); if (!smd) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c index 3c82a715ceed..4bffddeed8ec 100644 --- a/drivers/md/persistent-data/dm-space-map-metadata.c +++ b/drivers/md/persistent-data/dm-space-map-metadata.c @@ -772,7 +772,7 @@ struct dm_space_map *dm_sm_metadata_init(void) { struct sm_metadata *smm; - smm = kvmalloc_obj(*smm, GFP_KERNEL); + smm = kvmalloc_obj(*smm); if (!smm) return ERR_PTR(-ENOMEM); diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 1f50f50665ef..7401add01d12 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.c +++ b/drivers/md/persistent-data/dm-transaction-manager.c @@ -185,7 +185,7 @@ static struct dm_transaction_manager *dm_tm_create(struct dm_block_manager *bm, unsigned int i; struct dm_transaction_manager *tm; - tm = kmalloc_obj(*tm, GFP_KERNEL); + tm = kmalloc_obj(*tm); if (!tm) return ERR_PTR(-ENOMEM); @@ -207,7 +207,7 @@ struct dm_transaction_manager *dm_tm_create_non_blocking_clone(struct dm_transac { struct dm_transaction_manager *tm; - tm = kmalloc_obj(*tm, GFP_KERNEL); + tm = kmalloc_obj(*tm); if (tm) { tm->is_clone = 1; tm->real = real; diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index f316267a2c02..b79d1a0883dc 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -69,7 +69,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) struct md_rdev *smallest, *rdev1, *rdev2, *rdev, **dev; struct strip_zone *zone; int cnt; - struct r0conf *conf = kzalloc_obj(*conf, GFP_KERNEL); + struct r0conf *conf = kzalloc_obj(*conf); unsigned int blksize = 512; if (!mddev_is_dm(mddev)) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d5fd7841dd9f..cef705c5ffd4 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -3069,7 +3069,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) size_t r1bio_size; int err = -ENOMEM; - conf = kzalloc_obj(struct r1conf, GFP_KERNEL); + conf = kzalloc_obj(struct r1conf); if (!conf) goto abort; @@ -3083,11 +3083,11 @@ static struct r1conf *setup_conf(struct mddev *mddev) if (!conf->nr_waiting) goto abort; - conf->nr_queued = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, GFP_KERNEL); + conf->nr_queued = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR); if (!conf->nr_queued) goto abort; - conf->barrier = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR, GFP_KERNEL); + conf->barrier = kzalloc_objs(atomic_t, BARRIER_BUCKETS_NR); if (!conf->barrier) goto abort; diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index bdd3a7feaea7..968bc83b8597 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3852,7 +3852,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) } err = -ENOMEM; - conf = kzalloc_obj(struct r10conf, GFP_KERNEL); + conf = kzalloc_obj(struct r10conf); if (!conf) goto out; diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 3ae22f6aacda..66b10cbda96d 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -2447,7 +2447,7 @@ static int r5l_recovery_log(struct r5l_log *log) int ret; sector_t pos; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -3071,7 +3071,7 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) return -EINVAL; } - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) return -ENOMEM; log->rdev = rdev; diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 9dfa07ed723f..b0c524e920cb 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -1352,7 +1352,7 @@ int ppl_init_log(struct r5conf *conf) return -EINVAL; } - ppl_conf = kzalloc_obj(struct ppl_conf, GFP_KERNEL); + ppl_conf = kzalloc_obj(struct ppl_conf); if (!ppl_conf) return -ENOMEM; diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index ba8381cbb2f1..b785d129ef50 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -513,7 +513,7 @@ init_stripe_shared_pages(struct stripe_head *sh, struct r5conf *conf, int disks) cnt = PAGE_SIZE / conf->stripe_size; nr_pages = (disks + cnt - 1) / cnt; - sh->pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); + sh->pages = kzalloc_objs(struct page *, nr_pages); if (!sh->pages) return -ENOMEM; sh->nr_pages = nr_pages; @@ -7497,7 +7497,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) return ERR_PTR(-EINVAL); } - conf = kzalloc_obj(struct r5conf, GFP_KERNEL); + conf = kzalloc_obj(struct r5conf); if (conf == NULL) goto abort; @@ -7556,7 +7556,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) conf->previous_raid_disks = mddev->raid_disks - mddev->delta_disks; max_disks = max(conf->raid_disks, conf->previous_raid_disks); - conf->disks = kzalloc_objs(struct disk_info, max_disks, GFP_KERNEL); + conf->disks = kzalloc_objs(struct disk_info, max_disks); if (!conf->disks) goto abort; diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c index b81cdf343209..8f7244ac1d43 100644 --- a/drivers/media/cec/core/cec-adap.c +++ b/drivers/media/cec/core/cec-adap.c @@ -95,7 +95,7 @@ void cec_queue_event_fh(struct cec_fh *fh, if (ev_idx < CEC_NUM_CORE_EVENTS) entry = &fh->core_events[ev_idx]; else - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (entry) { if (new_ev->event == CEC_EVENT_LOST_MSGS && fh->queued_events[ev_idx]) { @@ -218,7 +218,7 @@ static void cec_queue_msg_fh(struct cec_fh *fh, const struct cec_msg *msg) struct cec_msg_entry *entry; mutex_lock(&fh->lock); - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (entry) { entry->msg = *msg; /* Add new msg at the end of the queue */ @@ -922,7 +922,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg, return -EBUSY; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/media/cec/core/cec-api.c b/drivers/media/cec/core/cec-api.c index c634185a3446..103ded79526f 100644 --- a/drivers/media/cec/core/cec-api.c +++ b/drivers/media/cec/core/cec-api.c @@ -555,7 +555,7 @@ static int cec_open(struct inode *inode, struct file *filp) struct cec_devnode *devnode = container_of(inode->i_cdev, struct cec_devnode, cdev); struct cec_adapter *adap = to_cec_adapter(devnode); - struct cec_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); + struct cec_fh *fh = kzalloc_obj(*fh); /* * Initial events that are automatically sent when the cec device is * opened. diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index e6d958662d37..1953ce559eca 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -237,7 +237,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, return ERR_PTR(-EINVAL); if (WARN_ON(!available_las || available_las > CEC_MAX_LOG_ADDRS)) return ERR_PTR(-EINVAL); - adap = kzalloc_obj(*adap, GFP_KERNEL); + adap = kzalloc_obj(*adap); if (!adap) return ERR_PTR(-ENOMEM); strscpy(adap->name, name, sizeof(adap->name)); diff --git a/drivers/media/cec/core/cec-notifier.c b/drivers/media/cec/core/cec-notifier.c index 026476ce6bfb..8cf1474d0361 100644 --- a/drivers/media/cec/core/cec-notifier.c +++ b/drivers/media/cec/core/cec-notifier.c @@ -63,7 +63,7 @@ cec_notifier_get_conn(struct device *hdmi_dev, const char *port_name) return n; } } - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) goto unlock; n->hdmi_dev = hdmi_dev; diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c index 5299d944b526..6e1c39102832 100644 --- a/drivers/media/cec/core/cec-pin.c +++ b/drivers/media/cec/core/cec-pin.c @@ -1367,7 +1367,7 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops, void *priv, const char *name, u32 caps) { struct cec_adapter *adap; - struct cec_pin *pin = kzalloc_obj(*pin, GFP_KERNEL); + struct cec_pin *pin = kzalloc_obj(*pin); if (pin == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c index 8249d3bb11e4..3381d86096a1 100644 --- a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c +++ b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c @@ -1494,7 +1494,7 @@ static int extron_setup(struct extron *extron) if (vendor_id) caps &= ~CEC_CAP_LOG_ADDRS; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; @@ -1769,7 +1769,7 @@ static int extron_connect(struct serio *serio, struct serio_driver *drv) manufacturer_name[0] = 0; } - extron = kzalloc_obj(*extron, GFP_KERNEL); + extron = kzalloc_obj(*extron); if (!extron) return -ENOMEM; diff --git a/drivers/media/cec/usb/pulse8/pulse8-cec.c b/drivers/media/cec/usb/pulse8/pulse8-cec.c index d000416d25c4..0df3af152762 100644 --- a/drivers/media/cec/usb/pulse8/pulse8-cec.c +++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c @@ -840,7 +840,7 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv) struct cec_log_addrs log_addrs = {}; u16 pa = CEC_PHYS_ADDR_INVALID; - pulse8 = kzalloc_obj(*pulse8, GFP_KERNEL); + pulse8 = kzalloc_obj(*pulse8); if (!pulse8) return -ENOMEM; diff --git a/drivers/media/cec/usb/rainshadow/rainshadow-cec.c b/drivers/media/cec/usb/rainshadow/rainshadow-cec.c index 5457fe240654..764551e060c5 100644 --- a/drivers/media/cec/usb/rainshadow/rainshadow-cec.c +++ b/drivers/media/cec/usb/rainshadow/rainshadow-cec.c @@ -313,7 +313,7 @@ static int rain_connect(struct serio *serio, struct serio_driver *drv) struct cec_log_addrs log_addrs = {}; u16 pa = CEC_PHYS_ADDR_INVALID; - rain = kzalloc_obj(*rain, GFP_KERNEL); + rain = kzalloc_obj(*rain); if (!rain) return -ENOMEM; diff --git a/drivers/media/common/cypress_firmware.c b/drivers/media/common/cypress_firmware.c index c1c110428928..66274fdf5243 100644 --- a/drivers/media/common/cypress_firmware.c +++ b/drivers/media/common/cypress_firmware.c @@ -75,7 +75,7 @@ int cypress_load_firmware(struct usb_device *udev, struct hexline *hx; int ret, pos = 0; - hx = kmalloc_obj(*hx, GFP_KERNEL); + hx = kmalloc_obj(*hx); if (!hx) return -ENOMEM; diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c index fc0f88b16dc3..c297d019f2b3 100644 --- a/drivers/media/common/saa7146/saa7146_core.c +++ b/drivers/media/common/saa7146/saa7146_core.c @@ -141,7 +141,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) struct page *pg; int i; - sglist = kmalloc_objs(struct scatterlist, nr_pages, GFP_KERNEL); + sglist = kmalloc_objs(struct scatterlist, nr_pages); if (NULL == sglist) return NULL; sg_init_table(sglist, nr_pages); @@ -334,7 +334,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent int err = -ENOMEM; /* clear out mem for sure */ - dev = kzalloc_obj(struct saa7146_dev, GFP_KERNEL); + dev = kzalloc_obj(struct saa7146_dev); if (!dev) { ERR("out of memory\n"); goto out; diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c index f448c0a0e05f..fd12ef10409c 100644 --- a/drivers/media/common/saa7146/saa7146_fops.c +++ b/drivers/media/common/saa7146/saa7146_fops.c @@ -266,7 +266,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) } dev->v4l2_dev.ctrl_handler = hdl; - vv = kzalloc_obj(struct saa7146_vv, GFP_KERNEL); + vv = kzalloc_obj(struct saa7146_vv); if (vv == NULL) { ERR("out of memory. aborting.\n"); v4l2_ctrl_handler_free(hdl); diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 489a8dd0a161..017629e3cf84 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -439,7 +439,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) return entry; } } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (entry) { entry->mode = default_mode; strscpy(entry->devpath, devpath, sizeof(entry->devpath)); @@ -528,7 +528,7 @@ int smscore_register_hotplug(hotplug_t hotplug) int rc = 0; mutex_lock(&g_smscore_deviceslock); - notifyee = kmalloc_obj(*notifyee, GFP_KERNEL); + notifyee = kmalloc_obj(*notifyee); if (notifyee) { /* now notify callback about existing devices */ first = &g_smscore_devices; @@ -617,7 +617,7 @@ smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, { struct smscore_buffer_t *cb; - cb = kzalloc_obj(*cb, GFP_KERNEL); + cb = kzalloc_obj(*cb); if (!cb) return NULL; @@ -647,7 +647,7 @@ int smscore_register_device(struct smsdevice_params_t *params, struct smscore_device_t *dev; u8 *buffer; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -1678,7 +1678,7 @@ static int smscore_validate_client(struct smscore_device_t *coredev, pr_err("The msg ID already registered to another client.\n"); return -EEXIST; } - listentry = kzalloc_obj(*listentry, GFP_KERNEL); + listentry = kzalloc_obj(*listentry); if (!listentry) return -ENOMEM; @@ -1715,7 +1715,7 @@ int smscore_register_client(struct smscore_device_t *coredev, return -EEXIST; } - newclient = kzalloc_obj(*newclient, GFP_KERNEL); + newclient = kzalloc_obj(*newclient); if (!newclient) return -ENOMEM; diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index e5fbc08d4192..c482777e1c60 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -358,7 +358,7 @@ int smsdvb_debugfs_create(struct smsdvb_client_t *client) if (!smsdvb_debugfs_usb_root || !coredev->is_usb_device) return -ENODEV; - debug_data = kzalloc_obj(*client->debug_data, GFP_KERNEL); + debug_data = kzalloc_obj(*client->debug_data); if (!debug_data) return -ENOMEM; diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index f49845a266e5..415c24fbbb65 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1110,7 +1110,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, /* device removal handled by onremove callback */ if (!arrival) return 0; - client = kzalloc_obj(struct smsdvb_client_t, GFP_KERNEL); + client = kzalloc_obj(struct smsdvb_client_t); if (!client) return -ENOMEM; diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index a70181f8d9d9..adf668b213c2 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -841,7 +841,7 @@ static bool verify_coherency_flags(struct vb2_queue *q, bool non_coherent_mem) static int vb2_core_allocated_buffers_storage(struct vb2_queue *q) { if (!q->bufs) - q->bufs = kzalloc_objs(*q->bufs, q->max_num_buffers, GFP_KERNEL); + q->bufs = kzalloc_objs(*q->bufs, q->max_num_buffers); if (!q->bufs) return -ENOMEM; @@ -2861,7 +2861,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, q->fileio_write_immediately); - fileio = kzalloc_obj(*fileio, GFP_KERNEL); + fileio = kzalloc_obj(*fileio); if (fileio == NULL) return -ENOMEM; @@ -3256,7 +3256,7 @@ int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv, if (WARN_ON(q->fileio)) return -EBUSY; - threadio = kzalloc_obj(*threadio, GFP_KERNEL); + threadio = kzalloc_obj(*threadio); if (threadio == NULL) return -ENOMEM; threadio->fnc = fnc; diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index 983de3b99acb..9ce6284cd5f2 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -238,7 +238,7 @@ static void *vb2_dc_alloc(struct vb2_buffer *vb, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -325,7 +325,7 @@ static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dc_buf *buf = dbuf->priv; int ret; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -479,7 +479,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) if (buf->non_coherent_mem) return buf->dma_sgt; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { dev_err(buf->dev, "failed to alloc sg table\n"); return NULL; @@ -587,7 +587,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -624,7 +624,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, goto out; } - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { pr_err("failed to allocate sg table\n"); ret = -ENOMEM; @@ -779,7 +779,7 @@ static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index 76a9301fb85b..982021d547e5 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -109,7 +109,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev) || WARN_ON(!size)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -126,7 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, * there is no memory consistency guarantee, hence dma-sg ignores DMA * attributes passed from the upper layer. */ - buf->pages = kvzalloc_objs(struct page *, buf->num_pages, GFP_KERNEL); + buf->pages = kvzalloc_objs(struct page *, buf->num_pages); if (!buf->pages) goto fail_pages_array_alloc; @@ -230,7 +230,7 @@ static void *vb2_dma_sg_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -375,7 +375,7 @@ static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dma_sg_buf *buf = dbuf->priv; int ret; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -626,7 +626,7 @@ static void *vb2_dma_sg_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dvb.c b/drivers/media/common/videobuf2/videobuf2-dvb.c index e37dd9007b19..ef30a032d9d4 100644 --- a/drivers/media/common/videobuf2/videobuf2-dvb.c +++ b/drivers/media/common/videobuf2/videobuf2-dvb.c @@ -299,7 +299,7 @@ struct vb2_dvb_frontend *vb2_dvb_alloc_frontend( { struct vb2_dvb_frontend *fe; - fe = kzalloc_obj(struct vb2_dvb_frontend, GFP_KERNEL); + fe = kzalloc_obj(struct vb2_dvb_frontend); if (fe == NULL) return NULL; diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index a410e9078626..63f023696f3e 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c @@ -78,7 +78,7 @@ static void *vb2_vmalloc_get_userptr(struct vb2_buffer *vb, struct device *dev, int n_pages, offset, i; int ret = -ENOMEM; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -221,7 +221,7 @@ static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, int ret; int i; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -409,7 +409,7 @@ static void *vb2_vmalloc_attach_dmabuf(struct vb2_buffer *vb, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index 254d56059863..7cfed24054d0 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -892,7 +892,7 @@ static int dvb_dmxdev_add_pid(struct dmxdev *dmxdev, (!list_empty(&filter->feed.ts))) return -EINVAL; - feed = kzalloc_obj(struct dmxdev_feed, GFP_KERNEL); + feed = kzalloc_obj(struct dmxdev_feed); if (feed == NULL) return -ENOMEM; diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index d25d4522240a..1b91ebb8f667 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1880,7 +1880,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, return -EINVAL; /* initialise the system data */ - ca = kzalloc_obj(*ca, GFP_KERNEL); + ca = kzalloc_obj(*ca); if (!ca) { ret = -ENOMEM; goto exit; @@ -1889,7 +1889,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, ca->pub = pubca; ca->flags = flags; ca->slot_count = slot_count; - ca->slot_info = kzalloc_objs(struct dvb_ca_slot, slot_count, GFP_KERNEL); + ca->slot_info = kzalloc_objs(struct dvb_ca_slot, slot_count); if (!ca->slot_info) { ret = -ENOMEM; goto free_ca; diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 6ba5857d280f..d082b6c57c76 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -3021,7 +3021,7 @@ int dvb_register_frontend(struct dvb_adapter *dvb, if (mutex_lock_interruptible(&frontend_mutex)) return -ERESTARTSYS; - fe->frontend_priv = kzalloc_obj(struct dvb_frontend_private, GFP_KERNEL); + fe->frontend_priv = kzalloc_obj(struct dvb_frontend_private); if (!fe->frontend_priv) { mutex_unlock(&frontend_mutex); return -ENOMEM; diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 00476e7ee048..14f7018501cf 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -328,14 +328,14 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev, return 0; } - dvbdev->entity = kzalloc_obj(*dvbdev->entity, GFP_KERNEL); + dvbdev->entity = kzalloc_obj(*dvbdev->entity); if (!dvbdev->entity) return -ENOMEM; dvbdev->entity->name = dvbdev->name; if (npads) { - dvbdev->pads = kzalloc_objs(*dvbdev->pads, npads, GFP_KERNEL); + dvbdev->pads = kzalloc_objs(*dvbdev->pads, npads); if (!dvbdev->pads) { kfree(dvbdev->entity); dvbdev->entity = NULL; @@ -471,7 +471,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, return -ENFILE; } - *pdvbdev = dvbdev = kzalloc_obj(*dvbdev, GFP_KERNEL); + *pdvbdev = dvbdev = kzalloc_obj(*dvbdev); if (!dvbdev) { mutex_unlock(&dvbdev_register_lock); return -ENOMEM; @@ -499,7 +499,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, return -ENOMEM; } - new_node = kzalloc_obj(*new_node, GFP_KERNEL); + new_node = kzalloc_obj(*new_node); if (!new_node) { kfree(dvbdevfops); kfree(dvbdev); @@ -711,12 +711,12 @@ int dvb_create_media_graph(struct dvb_adapter *adap, demod = NULL; if (create_rf_connector) { - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) return -ENOMEM; adap->conn = conn; - adap->conn_pads = kzalloc_obj(*adap->conn_pads, GFP_KERNEL); + adap->conn_pads = kzalloc_obj(*adap->conn_pads); if (!adap->conn_pads) return -ENOMEM; @@ -1026,7 +1026,7 @@ struct i2c_client *dvb_module_probe(const char *module_name, struct i2c_client *client; struct i2c_board_info *board_info; - board_info = kzalloc_obj(*board_info, GFP_KERNEL); + board_info = kzalloc_obj(*board_info); if (!board_info) return NULL; diff --git a/drivers/media/dvb-frontends/a8293.c b/drivers/media/dvb-frontends/a8293.c index c1eeed1d08e6..7c0963054a8f 100644 --- a/drivers/media/dvb-frontends/a8293.c +++ b/drivers/media/dvb-frontends/a8293.c @@ -218,7 +218,7 @@ static int a8293_probe(struct i2c_client *client) int ret; u8 buf[2]; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index d004ec9e94f0..75f3063c193e 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -1447,7 +1447,7 @@ static int af9013_probe(struct i2c_client *client) .val_bits = 8, }; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index 584cc0405e4a..9a3a4d6513dd 100644 --- a/drivers/media/dvb-frontends/af9033.c +++ b/drivers/media/dvb-frontends/af9033.c @@ -1062,7 +1062,7 @@ static int af9033_probe(struct i2c_client *client) }; /* Allocate memory for the internal state */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/as102_fe.c b/drivers/media/dvb-frontends/as102_fe.c index 5b17d0b6f3ea..fecb0735d753 100644 --- a/drivers/media/dvb-frontends/as102_fe.c +++ b/drivers/media/dvb-frontends/as102_fe.c @@ -447,7 +447,7 @@ struct dvb_frontend *as102_attach(const char *name, struct as102_state *state; struct dvb_frontend *fe; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ascot2e.c b/drivers/media/dvb-frontends/ascot2e.c index 0d28a3422cae..3bdb4d12f8b7 100644 --- a/drivers/media/dvb-frontends/ascot2e.c +++ b/drivers/media/dvb-frontends/ascot2e.c @@ -477,7 +477,7 @@ struct dvb_frontend *ascot2e_attach(struct dvb_frontend *fe, u8 data[4]; struct ascot2e_priv *priv = NULL; - priv = kzalloc_obj(struct ascot2e_priv, GFP_KERNEL); + priv = kzalloc_obj(struct ascot2e_priv); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/atbm8830.c b/drivers/media/dvb-frontends/atbm8830.c index 2b9dbd748ebc..9ef8adbf9f7d 100644 --- a/drivers/media/dvb-frontends/atbm8830.c +++ b/drivers/media/dvb-frontends/atbm8830.c @@ -458,7 +458,7 @@ struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config, if (config == NULL || i2c == NULL) return NULL; - priv = kzalloc_obj(struct atbm_state, GFP_KERNEL); + priv = kzalloc_obj(struct atbm_state); if (priv == NULL) goto error_out; diff --git a/drivers/media/dvb-frontends/bcm3510.c b/drivers/media/dvb-frontends/bcm3510.c index 50f43f9c7aef..7f91156d02c7 100644 --- a/drivers/media/dvb-frontends/bcm3510.c +++ b/drivers/media/dvb-frontends/bcm3510.c @@ -800,7 +800,7 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config, bcm3510_register_value v; /* allocate memory for the internal state */ - state = kzalloc_obj(struct bcm3510_state, GFP_KERNEL); + state = kzalloc_obj(struct bcm3510_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/cx22700.c b/drivers/media/dvb-frontends/cx22700.c index 9f36c837fd66..cb1c30aee684 100644 --- a/drivers/media/dvb-frontends/cx22700.c +++ b/drivers/media/dvb-frontends/cx22700.c @@ -376,7 +376,7 @@ struct dvb_frontend* cx22700_attach(const struct cx22700_config* config, struct cx22700_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct cx22700_state, GFP_KERNEL); + state = kzalloc_obj(struct cx22700_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/cx22702.c b/drivers/media/dvb-frontends/cx22702.c index acdc8712d343..cbfe156e018a 100644 --- a/drivers/media/dvb-frontends/cx22702.c +++ b/drivers/media/dvb-frontends/cx22702.c @@ -582,7 +582,7 @@ struct dvb_frontend *cx22702_attach(const struct cx22702_config *config, struct cx22702_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct cx22702_state, GFP_KERNEL); + state = kzalloc_obj(struct cx22702_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/cx24110.c b/drivers/media/dvb-frontends/cx24110.c index a413dd023aa9..fb81a2f264f4 100644 --- a/drivers/media/dvb-frontends/cx24110.c +++ b/drivers/media/dvb-frontends/cx24110.c @@ -588,7 +588,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, int ret; /* allocate memory for the internal state */ - state = kzalloc_obj(struct cx24110_state, GFP_KERNEL); + state = kzalloc_obj(struct cx24110_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/cx24113.c b/drivers/media/dvb-frontends/cx24113.c index 450e9d02e950..22f8544f1907 100644 --- a/drivers/media/dvb-frontends/cx24113.c +++ b/drivers/media/dvb-frontends/cx24113.c @@ -542,7 +542,7 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe, const struct cx24113_config *config, struct i2c_adapter *i2c) { /* allocate memory for the internal state */ - struct cx24113_state *state = kzalloc_obj(*state, GFP_KERNEL); + struct cx24113_state *state = kzalloc_obj(*state); int rc; if (!state) diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c index f7c2d7b165ce..c10053a7cb82 100644 --- a/drivers/media/dvb-frontends/cx24116.c +++ b/drivers/media/dvb-frontends/cx24116.c @@ -1116,7 +1116,7 @@ struct dvb_frontend *cx24116_attach(const struct cx24116_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c index 99555db3c537..eed03276b3b5 100644 --- a/drivers/media/dvb-frontends/cx24117.c +++ b/drivers/media/dvb-frontends/cx24117.c @@ -1184,7 +1184,7 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, } /* allocate memory for the internal state */ - state = kzalloc_obj(struct cx24117_state, GFP_KERNEL); + state = kzalloc_obj(struct cx24117_state); if (state == NULL) goto error2; diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c index 2602fe350d35..438a436762a7 100644 --- a/drivers/media/dvb-frontends/cx24120.c +++ b/drivers/media/dvb-frontends/cx24120.c @@ -268,7 +268,7 @@ struct dvb_frontend *cx24120_attach(const struct cx24120_config *config, int demod_rev; info("Conexant cx24120/cx24118 - DVBS/S2 Satellite demod/tuner\n"); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { err("Unable to allocate memory for cx24120_state\n"); goto error; diff --git a/drivers/media/dvb-frontends/cx24123.c b/drivers/media/dvb-frontends/cx24123.c index ecc1a017cbe1..2706f3831c63 100644 --- a/drivers/media/dvb-frontends/cx24123.c +++ b/drivers/media/dvb-frontends/cx24123.c @@ -1043,7 +1043,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config, { /* allocate memory for the internal state */ struct cx24123_state *state = - kzalloc_obj(struct cx24123_state, GFP_KERNEL); + kzalloc_obj(struct cx24123_state); dprintk("\n"); if (state == NULL) { diff --git a/drivers/media/dvb-frontends/cxd2099.c b/drivers/media/dvb-frontends/cxd2099.c index 80ca00f22d07..f95950a61307 100644 --- a/drivers/media/dvb-frontends/cxd2099.c +++ b/drivers/media/dvb-frontends/cxd2099.c @@ -609,7 +609,7 @@ static int cxd2099_probe(struct i2c_client *client) unsigned int val; int ret; - ci = kzalloc_obj(*ci, GFP_KERNEL); + ci = kzalloc_obj(*ci); if (!ci) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c index ed3f535db949..3deefeff4bd1 100644 --- a/drivers/media/dvb-frontends/cxd2820r_core.c +++ b/drivers/media/dvb-frontends/cxd2820r_core.c @@ -594,7 +594,7 @@ static int cxd2820r_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index db58803c85df..593107f428ce 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -3844,7 +3844,7 @@ static struct dvb_frontend *cxd2841er_attach(struct cxd2841er_config *cfg, struct cxd2841er_priv *priv = NULL; /* allocate memory for the internal state */ - priv = kzalloc_obj(struct cxd2841er_priv, GFP_KERNEL); + priv = kzalloc_obj(struct cxd2841er_priv); if (!priv) return NULL; priv->i2c = i2c; diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c index 1a1ed41f7555..0d058b59a472 100644 --- a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c +++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c @@ -1887,7 +1887,7 @@ struct dvb_frontend *cxd2880_attach(struct dvb_frontend *fe, return NULL; } - priv = kzalloc_obj(struct cxd2880_priv, GFP_KERNEL); + priv = kzalloc_obj(struct cxd2880_priv); if (!priv) return NULL; diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c index f11083a955ec..f77ff444a6b0 100644 --- a/drivers/media/dvb-frontends/dib0090.c +++ b/drivers/media/dvb-frontends/dib0090.c @@ -2606,7 +2606,7 @@ static const struct dib0090_wbd_slope dib0090_wbd_table_default[] = { struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config) { - struct dib0090_state *st = kzalloc_obj(struct dib0090_state, GFP_KERNEL); + struct dib0090_state *st = kzalloc_obj(struct dib0090_state); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib3000mb.c b/drivers/media/dvb-frontends/dib3000mb.c index ab7046a4ff96..251410842b18 100644 --- a/drivers/media/dvb-frontends/dib3000mb.c +++ b/drivers/media/dvb-frontends/dib3000mb.c @@ -746,7 +746,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, struct dib3000_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct dib3000_state, GFP_KERNEL); + state = kzalloc_obj(struct dib3000_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/dib3000mc.c b/drivers/media/dvb-frontends/dib3000mc.c index 12ee8a5d3b6e..544e5a0a5873 100644 --- a/drivers/media/dvb-frontends/dib3000mc.c +++ b/drivers/media/dvb-frontends/dib3000mc.c @@ -861,7 +861,7 @@ int dib3000mc_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 defa static const u8 DIB3000MC_I2C_ADDRESS[] = { 20, 22, 24, 26 }; - dmcst = kzalloc_obj(struct dib3000mc_state, GFP_KERNEL); + dmcst = kzalloc_obj(struct dib3000mc_state); if (dmcst == NULL) return -ENOMEM; @@ -910,7 +910,7 @@ struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr { struct dvb_frontend *demod; struct dib3000mc_state *st; - st = kzalloc_obj(struct dib3000mc_state, GFP_KERNEL); + st = kzalloc_obj(struct dib3000mc_state); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib7000m.c b/drivers/media/dvb-frontends/dib7000m.c index ffbc313915ed..44a78c7539a6 100644 --- a/drivers/media/dvb-frontends/dib7000m.c +++ b/drivers/media/dvb-frontends/dib7000m.c @@ -1403,7 +1403,7 @@ struct dvb_frontend * dib7000m_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, { struct dvb_frontend *demod; struct dib7000m_state *st; - st = kzalloc_obj(struct dib7000m_state, GFP_KERNEL); + st = kzalloc_obj(struct dib7000m_state); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c index 2d0c85fb11a0..48d84a05ddfa 100644 --- a/drivers/media/dvb-frontends/dib7000p.c +++ b/drivers/media/dvb-frontends/dib7000p.c @@ -2081,7 +2081,7 @@ static int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u int k = 0; u8 new_addr = 0; - dpst = kzalloc_obj(struct dib7000p_state, GFP_KERNEL); + dpst = kzalloc_obj(struct dib7000p_state); if (!dpst) return -ENOMEM; @@ -2741,7 +2741,7 @@ static struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 i2c_a { struct dvb_frontend *demod; struct dib7000p_state *st; - st = kzalloc_obj(struct dib7000p_state, GFP_KERNEL); + st = kzalloc_obj(struct dib7000p_state); if (st == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index 2266178f0a22..ebef27bcc989 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -4307,7 +4307,7 @@ static int dib8000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, ret = -ENOMEM; goto error_memory_read; } - client.i2c_buffer_lock = kzalloc_obj(struct mutex, GFP_KERNEL); + client.i2c_buffer_lock = kzalloc_obj(struct mutex); if (!client.i2c_buffer_lock) { dprintk("%s: not enough memory\n", __func__); ret = -ENOMEM; @@ -4448,10 +4448,10 @@ static struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_ad dprintk("dib8000_init\n"); - state = kzalloc_obj(struct dib8000_state, GFP_KERNEL); + state = kzalloc_obj(struct dib8000_state); if (state == NULL) return NULL; - fe = kzalloc_obj(struct dvb_frontend, GFP_KERNEL); + fe = kzalloc_obj(struct dvb_frontend); if (fe == NULL) goto error; diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c index b2e5fe1af78a..cb7c943225bd 100644 --- a/drivers/media/dvb-frontends/dib9000.c +++ b/drivers/media/dvb-frontends/dib9000.c @@ -2474,10 +2474,10 @@ struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, c { struct dvb_frontend *fe; struct dib9000_state *st; - st = kzalloc_obj(struct dib9000_state, GFP_KERNEL); + st = kzalloc_obj(struct dib9000_state); if (st == NULL) return NULL; - fe = kzalloc_obj(struct dvb_frontend, GFP_KERNEL); + fe = kzalloc_obj(struct dvb_frontend); if (fe == NULL) { kfree(st); return NULL; diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index c7a91f90ed10..367acb59b4a3 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -12276,7 +12276,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) int result; /* allocate memory for the internal state */ - state = kzalloc_obj(struct drx39xxj_state, GFP_KERNEL); + state = kzalloc_obj(struct drx39xxj_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c index aefdd620ce2c..4d673a108f61 100644 --- a/drivers/media/dvb-frontends/drxd_hard.c +++ b/drivers/media/dvb-frontends/drxd_hard.c @@ -2910,7 +2910,7 @@ struct dvb_frontend *drxd_attach(const struct drxd_config *config, { struct drxd_state *state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 7fb5f46aa1d4..47786d0610f0 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -6722,7 +6722,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, int status; dprintk(1, "\n"); - state = kzalloc_obj(struct drxk_state, GFP_KERNEL); + state = kzalloc_obj(struct drxk_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index d300c357f177..ce7ae424b27c 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -827,7 +827,7 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 078596bd0361..f8fd23f60e3f 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -820,7 +820,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, fe->ops.i2c_gate_ctrl(fe, 0); } - priv = kzalloc_obj(struct dvb_pll_priv, GFP_KERNEL); + priv = kzalloc_obj(struct dvb_pll_priv); if (!priv) goto out; diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c index 9ed03df364d6..6a34cdc28727 100644 --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c @@ -114,7 +114,7 @@ struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state); if (!state) return NULL; @@ -135,7 +135,7 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state); if (!state) return NULL; @@ -156,7 +156,7 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void) struct dvb_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct dvb_dummy_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct dvb_dummy_fe_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/ec100.c b/drivers/media/dvb-frontends/ec100.c index be9ee1c90434..b7a3572f8a58 100644 --- a/drivers/media/dvb-frontends/ec100.c +++ b/drivers/media/dvb-frontends/ec100.c @@ -276,7 +276,7 @@ struct dvb_frontend *ec100_attach(const struct ec100_config *config, u8 tmp; /* allocate memory for the internal state */ - state = kzalloc_obj(struct ec100_state, GFP_KERNEL); + state = kzalloc_obj(struct ec100_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/gp8psk-fe.c b/drivers/media/dvb-frontends/gp8psk-fe.c index 8893de2758f6..aad311ffd2b5 100644 --- a/drivers/media/dvb-frontends/gp8psk-fe.c +++ b/drivers/media/dvb-frontends/gp8psk-fe.c @@ -332,7 +332,7 @@ struct dvb_frontend *gp8psk_fe_attach(const struct gp8psk_fe_ops *ops, return NULL; } - st = kzalloc_obj(struct gp8psk_fe_state, GFP_KERNEL); + st = kzalloc_obj(struct gp8psk_fe_state); if (!st) return NULL; diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c index 0b68fa8b2664..1402d124544e 100644 --- a/drivers/media/dvb-frontends/helene.c +++ b/drivers/media/dvb-frontends/helene.c @@ -997,7 +997,7 @@ struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe, { struct helene_priv *priv = NULL; - priv = kzalloc_obj(struct helene_priv, GFP_KERNEL); + priv = kzalloc_obj(struct helene_priv); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); @@ -1033,7 +1033,7 @@ struct dvb_frontend *helene_attach(struct dvb_frontend *fe, { struct helene_priv *priv = NULL; - priv = kzalloc_obj(struct helene_priv, GFP_KERNEL); + priv = kzalloc_obj(struct helene_priv); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c index 618301eb26aa..63579d6e24e5 100644 --- a/drivers/media/dvb-frontends/horus3a.c +++ b/drivers/media/dvb-frontends/horus3a.c @@ -339,7 +339,7 @@ struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe, u8 buf[3], val; struct horus3a_priv *priv = NULL; - priv = kzalloc_obj(struct horus3a_priv, GFP_KERNEL); + priv = kzalloc_obj(struct horus3a_priv); if (priv == NULL) return NULL; priv->i2c_address = (config->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/isl6405.c b/drivers/media/dvb-frontends/isl6405.c index 96635db2eabc..2e681e2ba0c3 100644 --- a/drivers/media/dvb-frontends/isl6405.c +++ b/drivers/media/dvb-frontends/isl6405.c @@ -106,7 +106,7 @@ static void isl6405_release(struct dvb_frontend *fe) struct dvb_frontend *isl6405_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, u8 override_set, u8 override_clear) { - struct isl6405 *isl6405 = kmalloc_obj(struct isl6405, GFP_KERNEL); + struct isl6405 *isl6405 = kmalloc_obj(struct isl6405); if (!isl6405) return NULL; diff --git a/drivers/media/dvb-frontends/isl6421.c b/drivers/media/dvb-frontends/isl6421.c index 02d9e3b4e91d..b3c130e7dbe5 100644 --- a/drivers/media/dvb-frontends/isl6421.c +++ b/drivers/media/dvb-frontends/isl6421.c @@ -177,7 +177,7 @@ static void isl6421_release(struct dvb_frontend *fe) struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, u8 override_set, u8 override_clear, bool override_tone) { - struct isl6421 *isl6421 = kmalloc_obj(struct isl6421, GFP_KERNEL); + struct isl6421 *isl6421 = kmalloc_obj(struct isl6421); if (!isl6421) return NULL; diff --git a/drivers/media/dvb-frontends/isl6423.c b/drivers/media/dvb-frontends/isl6423.c index 6bffcc381fed..48f15cca07d3 100644 --- a/drivers/media/dvb-frontends/isl6423.c +++ b/drivers/media/dvb-frontends/isl6423.c @@ -258,7 +258,7 @@ struct dvb_frontend *isl6423_attach(struct dvb_frontend *fe, { struct isl6423_dev *isl6423; - isl6423 = kzalloc_obj(struct isl6423_dev, GFP_KERNEL); + isl6423 = kzalloc_obj(struct isl6423_dev); if (!isl6423) return NULL; diff --git a/drivers/media/dvb-frontends/itd1000.c b/drivers/media/dvb-frontends/itd1000.c index 6c1863efe227..f5f02363917e 100644 --- a/drivers/media/dvb-frontends/itd1000.c +++ b/drivers/media/dvb-frontends/itd1000.c @@ -365,7 +365,7 @@ struct dvb_frontend *itd1000_attach(struct dvb_frontend *fe, struct i2c_adapter struct itd1000_state *state = NULL; u8 i = 0; - state = kzalloc_obj(struct itd1000_state, GFP_KERNEL); + state = kzalloc_obj(struct itd1000_state); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ix2505v.c b/drivers/media/dvb-frontends/ix2505v.c index db0875f65de8..832c998a3d99 100644 --- a/drivers/media/dvb-frontends/ix2505v.c +++ b/drivers/media/dvb-frontends/ix2505v.c @@ -267,7 +267,7 @@ struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe, goto error; } - state = kzalloc_obj(struct ix2505v_state, GFP_KERNEL); + state = kzalloc_obj(struct ix2505v_state); if (NULL == state) return NULL; diff --git a/drivers/media/dvb-frontends/l64781.c b/drivers/media/dvb-frontends/l64781.c index cfec598001db..ff686c132eaf 100644 --- a/drivers/media/dvb-frontends/l64781.c +++ b/drivers/media/dvb-frontends/l64781.c @@ -497,7 +497,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; /* allocate memory for the internal state */ - state = kzalloc_obj(struct l64781_state, GFP_KERNEL); + state = kzalloc_obj(struct l64781_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/lg2160.c b/drivers/media/dvb-frontends/lg2160.c index 5c9ebfec4524..41c4aae0cb49 100644 --- a/drivers/media/dvb-frontends/lg2160.c +++ b/drivers/media/dvb-frontends/lg2160.c @@ -1396,7 +1396,7 @@ struct dvb_frontend *lg2160_attach(const struct lg2160_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc_obj(struct lg216x_state, GFP_KERNEL); + state = kzalloc_obj(struct lg216x_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/lgdt3305.c b/drivers/media/dvb-frontends/lgdt3305.c index 9fcac3361618..e08ee89c4c26 100644 --- a/drivers/media/dvb-frontends/lgdt3305.c +++ b/drivers/media/dvb-frontends/lgdt3305.c @@ -1103,7 +1103,7 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc_obj(struct lgdt3305_state, GFP_KERNEL); + state = kzalloc_obj(struct lgdt3305_state); if (state == NULL) goto fail; diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c index a6d885d951a5..b6a66e122ed5 100644 --- a/drivers/media/dvb-frontends/lgdt3306a.c +++ b/drivers/media/dvb-frontends/lgdt3306a.c @@ -1802,7 +1802,7 @@ struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config, i2c_adap ? i2c_adapter_id(i2c_adap) : 0, config ? config->i2c_addr : 0); - state = kzalloc_obj(struct lgdt3306a_state, GFP_KERNEL); + state = kzalloc_obj(struct lgdt3306a_state); if (state == NULL) goto fail; diff --git a/drivers/media/dvb-frontends/lgdt330x.c b/drivers/media/dvb-frontends/lgdt330x.c index 43e45c2317e0..19a4a05b3499 100644 --- a/drivers/media/dvb-frontends/lgdt330x.c +++ b/drivers/media/dvb-frontends/lgdt330x.c @@ -863,7 +863,7 @@ static int lgdt330x_probe(struct i2c_client *client) u8 buf[1]; /* Allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) goto error; diff --git a/drivers/media/dvb-frontends/lgs8gl5.c b/drivers/media/dvb-frontends/lgs8gl5.c index 07e422cb53da..3ee12a9e4526 100644 --- a/drivers/media/dvb-frontends/lgs8gl5.c +++ b/drivers/media/dvb-frontends/lgs8gl5.c @@ -375,7 +375,7 @@ lgs8gl5_attach(const struct lgs8gl5_config *config, struct i2c_adapter *i2c) dprintk("%s\n", __func__); /* Allocate memory for the internal state */ - state = kzalloc_obj(struct lgs8gl5_state, GFP_KERNEL); + state = kzalloc_obj(struct lgs8gl5_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/lgs8gxx.c b/drivers/media/dvb-frontends/lgs8gxx.c index 8904f767e4ad..285ac9ddd419 100644 --- a/drivers/media/dvb-frontends/lgs8gxx.c +++ b/drivers/media/dvb-frontends/lgs8gxx.c @@ -1012,7 +1012,7 @@ struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config, if (config == NULL || i2c == NULL) return NULL; - priv = kzalloc_obj(struct lgs8gxx_state, GFP_KERNEL); + priv = kzalloc_obj(struct lgs8gxx_state); if (priv == NULL) goto error_out; diff --git a/drivers/media/dvb-frontends/lnbh25.c b/drivers/media/dvb-frontends/lnbh25.c index e4e4c43465cf..8a0b9efd17db 100644 --- a/drivers/media/dvb-frontends/lnbh25.c +++ b/drivers/media/dvb-frontends/lnbh25.c @@ -148,7 +148,7 @@ struct dvb_frontend *lnbh25_attach(struct dvb_frontend *fe, struct lnbh25_priv *priv; dev_dbg(&i2c->dev, "%s()\n", __func__); - priv = kzalloc_obj(struct lnbh25_priv, GFP_KERNEL); + priv = kzalloc_obj(struct lnbh25_priv); if (!priv) return NULL; priv->i2c_address = (cfg->i2c_address >> 1); diff --git a/drivers/media/dvb-frontends/lnbh29.c b/drivers/media/dvb-frontends/lnbh29.c index 2bb9f8b9d325..1fcb7ad16508 100644 --- a/drivers/media/dvb-frontends/lnbh29.c +++ b/drivers/media/dvb-frontends/lnbh29.c @@ -135,7 +135,7 @@ struct dvb_frontend *lnbh29_attach(struct dvb_frontend *fe, { struct lnbh29_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; diff --git a/drivers/media/dvb-frontends/lnbp21.c b/drivers/media/dvb-frontends/lnbp21.c index b68fa4424acd..2007c2713cfb 100644 --- a/drivers/media/dvb-frontends/lnbp21.c +++ b/drivers/media/dvb-frontends/lnbp21.c @@ -113,7 +113,7 @@ static struct dvb_frontend *lnbx2x_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear, u8 i2c_addr, u8 config) { - struct lnbp21 *lnbp21 = kmalloc_obj(struct lnbp21, GFP_KERNEL); + struct lnbp21 *lnbp21 = kmalloc_obj(struct lnbp21); if (!lnbp21) return NULL; diff --git a/drivers/media/dvb-frontends/lnbp22.c b/drivers/media/dvb-frontends/lnbp22.c index 98e54f74f306..9daef48d1569 100644 --- a/drivers/media/dvb-frontends/lnbp22.c +++ b/drivers/media/dvb-frontends/lnbp22.c @@ -96,7 +96,7 @@ static void lnbp22_release(struct dvb_frontend *fe) struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c) { - struct lnbp22 *lnbp22 = kmalloc_obj(struct lnbp22, GFP_KERNEL); + struct lnbp22 *lnbp22 = kmalloc_obj(struct lnbp22); if (!lnbp22) return NULL; diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c index e419551ca46e..be156180e5ef 100644 --- a/drivers/media/dvb-frontends/m88ds3103.c +++ b/drivers/media/dvb-frontends/m88ds3103.c @@ -1775,7 +1775,7 @@ static int m88ds3103_probe(struct i2c_client *client) int ret; unsigned int utmp; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 1804c31ebe0f..9c9f34c6d3a2 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -786,7 +786,7 @@ struct dvb_frontend *m88rs2000_attach(const struct m88rs2000_config *config, struct m88rs2000_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct m88rs2000_state, GFP_KERNEL); + state = kzalloc_obj(struct m88rs2000_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mb86a16.c b/drivers/media/dvb-frontends/mb86a16.c index 0c9bd4a47be4..50737e6f81dc 100644 --- a/drivers/media/dvb-frontends/mb86a16.c +++ b/drivers/media/dvb-frontends/mb86a16.c @@ -1833,7 +1833,7 @@ struct dvb_frontend *mb86a16_attach(const struct mb86a16_config *config, u8 dev_id = 0; struct mb86a16_state *state = NULL; - state = kmalloc_obj(struct mb86a16_state, GFP_KERNEL); + state = kmalloc_obj(struct mb86a16_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index eb596d3b9da5..0d9bfc5b3761 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -2052,7 +2052,7 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, dev_dbg(&i2c->dev, "%s called.\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/mn88472.c b/drivers/media/dvb-frontends/mn88472.c index ce3ae7d8d13f..275c404ce286 100644 --- a/drivers/media/dvb-frontends/mn88472.c +++ b/drivers/media/dvb-frontends/mn88472.c @@ -586,7 +586,7 @@ static int mn88472_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c index 371f9faa3038..40a0cb1d9c67 100644 --- a/drivers/media/dvb-frontends/mn88473.c +++ b/drivers/media/dvb-frontends/mn88473.c @@ -626,7 +626,7 @@ static int mn88473_probe(struct i2c_client *client) goto err; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c index 06d7153f57d8..8fe850a8d914 100644 --- a/drivers/media/dvb-frontends/mt312.c +++ b/drivers/media/dvb-frontends/mt312.c @@ -780,7 +780,7 @@ struct dvb_frontend *mt312_attach(const struct mt312_config *config, struct mt312_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct mt312_state, GFP_KERNEL); + state = kzalloc_obj(struct mt312_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/mt352.c b/drivers/media/dvb-frontends/mt352.c index 3f57ac209654..7ae4d93f1f19 100644 --- a/drivers/media/dvb-frontends/mt352.c +++ b/drivers/media/dvb-frontends/mt352.c @@ -533,7 +533,7 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config, struct mt352_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct mt352_state, GFP_KERNEL); + state = kzalloc_obj(struct mt352_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 43d953c898fd..64d83589dfc4 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -1829,7 +1829,7 @@ struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, struct mxl *state; struct mxl_base *base; - state = kzalloc_obj(struct mxl, GFP_KERNEL); + state = kzalloc_obj(struct mxl); if (!state) return NULL; @@ -1845,7 +1845,7 @@ struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, goto fail; state->base = base; } else { - base = kzalloc_obj(struct mxl_base, GFP_KERNEL); + base = kzalloc_obj(struct mxl_base); if (!base) goto fail; base->i2c = i2c; diff --git a/drivers/media/dvb-frontends/mxl692.c b/drivers/media/dvb-frontends/mxl692.c index 68455628b03d..2d8eaa20723f 100644 --- a/drivers/media/dvb-frontends/mxl692.c +++ b/drivers/media/dvb-frontends/mxl692.c @@ -1314,7 +1314,7 @@ static int mxl692_probe(struct i2c_client *client) struct mxl692_dev *dev; int ret = 0; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; dev_dbg(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c index 5b0762938c86..d1f93ac18888 100644 --- a/drivers/media/dvb-frontends/nxt200x.c +++ b/drivers/media/dvb-frontends/nxt200x.c @@ -1128,7 +1128,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, u8 buf [] = {0,0,0,0,0}; /* allocate memory for the internal state */ - state = kzalloc_obj(struct nxt200x_state, GFP_KERNEL); + state = kzalloc_obj(struct nxt200x_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/nxt6000.c b/drivers/media/dvb-frontends/nxt6000.c index ed12ef9cd9df..99cfa610e263 100644 --- a/drivers/media/dvb-frontends/nxt6000.c +++ b/drivers/media/dvb-frontends/nxt6000.c @@ -560,7 +560,7 @@ struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, struct nxt6000_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct nxt6000_state, GFP_KERNEL); + state = kzalloc_obj(struct nxt6000_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/or51132.c b/drivers/media/dvb-frontends/or51132.c index 4b0063823736..e908d33d7e72 100644 --- a/drivers/media/dvb-frontends/or51132.c +++ b/drivers/media/dvb-frontends/or51132.c @@ -552,7 +552,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config, struct or51132_state* state = NULL; /* Allocate memory for the internal state */ - state = kzalloc_obj(struct or51132_state, GFP_KERNEL); + state = kzalloc_obj(struct or51132_state); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/or51211.c b/drivers/media/dvb-frontends/or51211.c index 2a52b1dc9d0a..8c4aabef2d99 100644 --- a/drivers/media/dvb-frontends/or51211.c +++ b/drivers/media/dvb-frontends/or51211.c @@ -501,7 +501,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config, struct or51211_state* state = NULL; /* Allocate memory for the internal state */ - state = kzalloc_obj(struct or51211_state, GFP_KERNEL); + state = kzalloc_obj(struct or51211_state); if (state == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c index ee6ba9b7c016..f0ee7c38ee79 100644 --- a/drivers/media/dvb-frontends/rtl2830.c +++ b/drivers/media/dvb-frontends/rtl2830.c @@ -807,7 +807,7 @@ static int rtl2830_probe(struct i2c_client *client) } /* allocate memory for the internal state */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 19ec892debb7..d8e1546aea5e 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c @@ -1043,7 +1043,7 @@ static int rtl2832_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); /* allocate memory for the internal state */ - dev = kzalloc_obj(struct rtl2832_dev, GFP_KERNEL); + dev = kzalloc_obj(struct rtl2832_dev); if (dev == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 5a59bdde8f7b..422d1a7b5456 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -1330,7 +1330,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) ret = -EINVAL; goto err; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { ret = -ENOMEM; goto err_module_put; diff --git a/drivers/media/dvb-frontends/s5h1409.c b/drivers/media/dvb-frontends/s5h1409.c index 33f820e2d6d3..370824589ab5 100644 --- a/drivers/media/dvb-frontends/s5h1409.c +++ b/drivers/media/dvb-frontends/s5h1409.c @@ -946,7 +946,7 @@ struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config, u16 reg; /* allocate memory for the internal state */ - state = kzalloc_obj(struct s5h1409_state, GFP_KERNEL); + state = kzalloc_obj(struct s5h1409_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/s5h1411.c b/drivers/media/dvb-frontends/s5h1411.c index c6379da7361e..bffd3a492c65 100644 --- a/drivers/media/dvb-frontends/s5h1411.c +++ b/drivers/media/dvb-frontends/s5h1411.c @@ -861,7 +861,7 @@ struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config, u16 reg; /* allocate memory for the internal state */ - state = kzalloc_obj(struct s5h1411_state, GFP_KERNEL); + state = kzalloc_obj(struct s5h1411_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/s5h1432.c b/drivers/media/dvb-frontends/s5h1432.c index 6261df9f383c..3046ee8cc0bc 100644 --- a/drivers/media/dvb-frontends/s5h1432.c +++ b/drivers/media/dvb-frontends/s5h1432.c @@ -337,7 +337,7 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config, printk(KERN_INFO " Enter s5h1432_attach(). attach success!\n"); /* allocate memory for the internal state */ - state = kmalloc_obj(struct s5h1432_state, GFP_KERNEL); + state = kmalloc_obj(struct s5h1432_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/s921.c b/drivers/media/dvb-frontends/s921.c index 6d38c9742f1d..41ac1d3a64dc 100644 --- a/drivers/media/dvb-frontends/s921.c +++ b/drivers/media/dvb-frontends/s921.c @@ -476,7 +476,7 @@ struct dvb_frontend *s921_attach(const struct s921_config *config, { /* allocate memory for the internal state */ struct s921_state *state = - kzalloc_obj(struct s921_state, GFP_KERNEL); + kzalloc_obj(struct s921_state); dprintk("\n"); if (!state) { diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c index cb6802b81e41..4170696af9f0 100644 --- a/drivers/media/dvb-frontends/si2165.c +++ b/drivers/media/dvb-frontends/si2165.c @@ -1158,7 +1158,7 @@ static int si2165_probe(struct i2c_client *client) }; /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { ret = -ENOMEM; goto error; diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index f7a1d2fc3cfb..c4bbcd127cac 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -681,7 +681,7 @@ static int si2168_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c index ac50df3c40fb..e64ced2d6c21 100644 --- a/drivers/media/dvb-frontends/si21xx.c +++ b/drivers/media/dvb-frontends/si21xx.c @@ -902,7 +902,7 @@ struct dvb_frontend *si21xx_attach(const struct si21xx_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(struct si21xx_state, GFP_KERNEL); + state = kzalloc_obj(struct si21xx_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 50103c4a36f9..071c7371c699 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -371,7 +371,7 @@ static int sp2_probe(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/sp887x.c b/drivers/media/dvb-frontends/sp887x.c index 235ecfd45376..13cb736760d3 100644 --- a/drivers/media/dvb-frontends/sp887x.c +++ b/drivers/media/dvb-frontends/sp887x.c @@ -568,7 +568,7 @@ struct dvb_frontend* sp887x_attach(const struct sp887x_config* config, struct sp887x_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct sp887x_state, GFP_KERNEL); + state = kzalloc_obj(struct sp887x_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c index 19a31a296e0f..4f0f31d248d6 100644 --- a/drivers/media/dvb-frontends/stb0899_drv.c +++ b/drivers/media/dvb-frontends/stb0899_drv.c @@ -1613,7 +1613,7 @@ struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_ad { struct stb0899_state *state = NULL; - state = kzalloc_obj(struct stb0899_state, GFP_KERNEL); + state = kzalloc_obj(struct stb0899_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stb6000.c b/drivers/media/dvb-frontends/stb6000.c index 85900e616490..c66d4ac17f85 100644 --- a/drivers/media/dvb-frontends/stb6000.c +++ b/drivers/media/dvb-frontends/stb6000.c @@ -218,7 +218,7 @@ struct dvb_frontend *stb6000_attach(struct dvb_frontend *fe, int addr, if (ret != 2) return NULL; - priv = kzalloc_obj(struct stb6000_priv, GFP_KERNEL); + priv = kzalloc_obj(struct stb6000_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c index 97238cf98067..ff7b0c780256 100644 --- a/drivers/media/dvb-frontends/stb6100.c +++ b/drivers/media/dvb-frontends/stb6100.c @@ -534,7 +534,7 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, { struct stb6100_state *state = NULL; - state = kzalloc_obj(struct stb6100_state, GFP_KERNEL); + state = kzalloc_obj(struct stb6100_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/stv0288.c b/drivers/media/dvb-frontends/stv0288.c index 40648b74edd4..09992f6f09cc 100644 --- a/drivers/media/dvb-frontends/stv0288.c +++ b/drivers/media/dvb-frontends/stv0288.c @@ -557,7 +557,7 @@ struct dvb_frontend *stv0288_attach(const struct stv0288_config *config, int id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0288_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0288_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0297.c b/drivers/media/dvb-frontends/stv0297.c index c0634e2436b3..dd0ecc050ad5 100644 --- a/drivers/media/dvb-frontends/stv0297.c +++ b/drivers/media/dvb-frontends/stv0297.c @@ -654,7 +654,7 @@ struct dvb_frontend *stv0297_attach(const struct stv0297_config *config, struct stv0297_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0297_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0297_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/media/dvb-frontends/stv0299.c index cc15bb93b7dc..0d0bd076dd32 100644 --- a/drivers/media/dvb-frontends/stv0299.c +++ b/drivers/media/dvb-frontends/stv0299.c @@ -671,7 +671,7 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0299_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0299_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index cf6b1b646b10..592ada5c77fe 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -1698,10 +1698,10 @@ struct dvb_frontend *stv0367ter_attach(const struct stv0367_config *config, struct stv0367ter_state *ter_state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state); if (state == NULL) goto error; - ter_state = kzalloc_obj(struct stv0367ter_state, GFP_KERNEL); + ter_state = kzalloc_obj(struct stv0367ter_state); if (ter_state == NULL) goto error; @@ -2865,10 +2865,10 @@ struct dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, struct stv0367cab_state *cab_state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state); if (state == NULL) goto error; - cab_state = kzalloc_obj(struct stv0367cab_state, GFP_KERNEL); + cab_state = kzalloc_obj(struct stv0367cab_state); if (cab_state == NULL) goto error; @@ -3274,13 +3274,13 @@ struct dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config, struct stv0367cab_state *cab_state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct stv0367_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0367_state); if (state == NULL) goto error; - ter_state = kzalloc_obj(struct stv0367ter_state, GFP_KERNEL); + ter_state = kzalloc_obj(struct stv0367ter_state); if (ter_state == NULL) goto error; - cab_state = kzalloc_obj(struct stv0367cab_state, GFP_KERNEL); + cab_state = kzalloc_obj(struct stv0367cab_state); if (cab_state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c index 3f1edc8559c5..21899b6223b6 100644 --- a/drivers/media/dvb-frontends/stv0900_core.c +++ b/drivers/media/dvb-frontends/stv0900_core.c @@ -85,7 +85,7 @@ static struct stv0900_inode *append_internal(struct stv0900_internal *internal) struct stv0900_inode *new_node = stv0900_first_inode; if (new_node == NULL) { - new_node = kmalloc_obj(struct stv0900_inode, GFP_KERNEL); + new_node = kmalloc_obj(struct stv0900_inode); stv0900_first_inode = new_node; } else { while (new_node->next_inode != NULL) @@ -1903,7 +1903,7 @@ struct dvb_frontend *stv0900_attach(const struct stv0900_config *config, struct stv0900_init_params init_params; enum fe_stv0900_error err_stv0900; - state = kzalloc_obj(struct stv0900_state, GFP_KERNEL); + state = kzalloc_obj(struct stv0900_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c index 16ff5c8cf417..657df713865e 100644 --- a/drivers/media/dvb-frontends/stv090x.c +++ b/drivers/media/dvb-frontends/stv090x.c @@ -85,7 +85,7 @@ static struct stv090x_dev *append_internal(struct stv090x_internal *internal) struct stv090x_dev *new_dev; struct stv090x_dev *temp_dev; - new_dev = kmalloc_obj(struct stv090x_dev, GFP_KERNEL); + new_dev = kmalloc_obj(struct stv090x_dev); if (new_dev != NULL) { new_dev->internal = internal; new_dev->next_dev = NULL; @@ -4906,7 +4906,7 @@ static int stv090x_setup_compound(struct stv090x_state *state) state->internal->num_used++; dprintk(FE_INFO, 1, "Found Internal Structure!"); } else { - state->internal = kmalloc_obj(*state->internal, GFP_KERNEL); + state->internal = kmalloc_obj(*state->internal); if (!state->internal) goto error; temp_int = append_internal(state->internal); @@ -5002,7 +5002,7 @@ static int stv090x_probe(struct i2c_client *client) struct stv090x_state *state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { ret = -ENOMEM; goto error; @@ -5050,7 +5050,7 @@ struct dvb_frontend *stv090x_attach(struct stv090x_config *config, int ret = 0; struct stv090x_state *state = NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) goto error; diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 666562f7ca17..b841f7e9c664 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -1766,7 +1766,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, struct stv *state; struct stv_base *base; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; @@ -1788,7 +1788,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, base->count++; state->base = base; } else { - base = kzalloc_obj(*base, GFP_KERNEL); + base = kzalloc_obj(*base); if (!base) goto fail; base->i2c = i2c; diff --git a/drivers/media/dvb-frontends/stv6110.c b/drivers/media/dvb-frontends/stv6110.c index beb1c832a13d..87019aa57a16 100644 --- a/drivers/media/dvb-frontends/stv6110.c +++ b/drivers/media/dvb-frontends/stv6110.c @@ -408,7 +408,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, if (ret != 1) return NULL; - priv = kzalloc_obj(struct stv6110_priv, GFP_KERNEL); + priv = kzalloc_obj(struct stv6110_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/stv6110x.c b/drivers/media/dvb-frontends/stv6110x.c index 4122f7655b0a..7506f39ead55 100644 --- a/drivers/media/dvb-frontends/stv6110x.c +++ b/drivers/media/dvb-frontends/stv6110x.c @@ -412,7 +412,7 @@ static int stv6110x_probe(struct i2c_client *client) struct stv6110x_state *stv6110x; - stv6110x = kzalloc_obj(*stv6110x, GFP_KERNEL); + stv6110x = kzalloc_obj(*stv6110x); if (!stv6110x) return -ENOMEM; @@ -448,7 +448,7 @@ const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, { struct stv6110x_state *stv6110x; - stv6110x = kzalloc_obj(*stv6110x, GFP_KERNEL); + stv6110x = kzalloc_obj(*stv6110x); if (!stv6110x) return NULL; diff --git a/drivers/media/dvb-frontends/stv6111.c b/drivers/media/dvb-frontends/stv6111.c index d367ee7f3cbe..876e254c6fbb 100644 --- a/drivers/media/dvb-frontends/stv6111.c +++ b/drivers/media/dvb-frontends/stv6111.c @@ -653,7 +653,7 @@ struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, int stat = -ENODEV; int gatestat = 0; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; state->adr = adr; diff --git a/drivers/media/dvb-frontends/tc90522.c b/drivers/media/dvb-frontends/tc90522.c index 3ac0b7a0844f..f1343ba67b97 100644 --- a/drivers/media/dvb-frontends/tc90522.c +++ b/drivers/media/dvb-frontends/tc90522.c @@ -647,7 +647,7 @@ tc90522_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) for (i = 0; i < num; i++) if (msgs[i].flags & I2C_M_RD) rd_num++; - new_msgs = kmalloc_objs(*new_msgs, num + rd_num, GFP_KERNEL); + new_msgs = kmalloc_objs(*new_msgs, num + rd_num); if (!new_msgs) return -ENOMEM; @@ -788,7 +788,7 @@ static int tc90522_probe(struct i2c_client *client) struct i2c_adapter *adap; int ret; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; state->i2c_client = client; diff --git a/drivers/media/dvb-frontends/tda10021.c b/drivers/media/dvb-frontends/tda10021.c index 9a950ee9562e..3c09b7e4a966 100644 --- a/drivers/media/dvb-frontends/tda10021.c +++ b/drivers/media/dvb-frontends/tda10021.c @@ -451,7 +451,7 @@ struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config, u8 id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda10021_state, GFP_KERNEL); + state = kzalloc_obj(struct tda10021_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda10023.c b/drivers/media/dvb-frontends/tda10023.c index c8b1cc0f7abb..3284fc46e97f 100644 --- a/drivers/media/dvb-frontends/tda10023.c +++ b/drivers/media/dvb-frontends/tda10023.c @@ -511,7 +511,7 @@ struct dvb_frontend *tda10023_attach(const struct tda10023_config *config, struct tda10023_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda10023_state, GFP_KERNEL); + state = kzalloc_obj(struct tda10023_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda10048.c b/drivers/media/dvb-frontends/tda10048.c index fe9685cbf7a5..c29eda634c85 100644 --- a/drivers/media/dvb-frontends/tda10048.c +++ b/drivers/media/dvb-frontends/tda10048.c @@ -1097,7 +1097,7 @@ struct dvb_frontend *tda10048_attach(const struct tda10048_config *config, dprintk(1, "%s()\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda10048_state, GFP_KERNEL); + state = kzalloc_obj(struct tda10048_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/tda1004x.c b/drivers/media/dvb-frontends/tda1004x.c index 0a1bf80211d3..7eefc8814243 100644 --- a/drivers/media/dvb-frontends/tda1004x.c +++ b/drivers/media/dvb-frontends/tda1004x.c @@ -1271,7 +1271,7 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda1004x_state, GFP_KERNEL); + state = kzalloc_obj(struct tda1004x_state); if (!state) { printk(KERN_ERR "Can't allocate memory for tda10045 state\n"); return NULL; @@ -1341,7 +1341,7 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, int id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda1004x_state, GFP_KERNEL); + state = kzalloc_obj(struct tda1004x_state); if (!state) { printk(KERN_ERR "Can't allocate memory for tda10046 state\n"); return NULL; diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 430702da6e79..6e6c2e5c427e 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c @@ -1156,7 +1156,7 @@ static int tda10071_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/tda10086.c b/drivers/media/dvb-frontends/tda10086.c index 5e63ded2cfbf..d43d0eb73721 100644 --- a/drivers/media/dvb-frontends/tda10086.c +++ b/drivers/media/dvb-frontends/tda10086.c @@ -737,7 +737,7 @@ struct dvb_frontend* tda10086_attach(const struct tda10086_config* config, dprintk ("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda10086_state, GFP_KERNEL); + state = kzalloc_obj(struct tda10086_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index f10d74ff192c..25005e4359ad 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -1215,7 +1215,7 @@ struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe, { struct tda_state *state; - state = kzalloc_obj(struct tda_state, GFP_KERNEL); + state = kzalloc_obj(struct tda_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda665x.c b/drivers/media/dvb-frontends/tda665x.c index f9dcbb69e949..b2201ec14091 100644 --- a/drivers/media/dvb-frontends/tda665x.c +++ b/drivers/media/dvb-frontends/tda665x.c @@ -207,7 +207,7 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe, struct tda665x_state *state = NULL; struct dvb_tuner_info *info; - state = kzalloc_obj(struct tda665x_state, GFP_KERNEL); + state = kzalloc_obj(struct tda665x_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dvb-frontends/tda8083.c index c9f280cdd7db..5a1b3599afa4 100644 --- a/drivers/media/dvb-frontends/tda8083.c +++ b/drivers/media/dvb-frontends/tda8083.c @@ -417,7 +417,7 @@ struct dvb_frontend* tda8083_attach(const struct tda8083_config* config, struct tda8083_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct tda8083_state, GFP_KERNEL); + state = kzalloc_obj(struct tda8083_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index 73c90442f403..55f898f6a6f7 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -168,7 +168,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, { struct tda8261_state *state = NULL; - if ((state = kzalloc_obj(struct tda8261_state, GFP_KERNEL)) == NULL) + if ((state = kzalloc_obj(struct tda8261_state)) == NULL) goto exit; state->config = config; diff --git a/drivers/media/dvb-frontends/tda826x.c b/drivers/media/dvb-frontends/tda826x.c index b51da4053ef5..9ee6bc4e6637 100644 --- a/drivers/media/dvb-frontends/tda826x.c +++ b/drivers/media/dvb-frontends/tda826x.c @@ -150,7 +150,7 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2 if (!(b1[1] & 0x80)) return NULL; - priv = kzalloc_obj(struct tda826x_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tda826x_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c index 2368214781a6..8b6006635e49 100644 --- a/drivers/media/dvb-frontends/ts2020.c +++ b/drivers/media/dvb-frontends/ts2020.c @@ -566,7 +566,7 @@ static int ts2020_probe(struct i2c_client *client) } fe = pdata->fe; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/tua6100.c b/drivers/media/dvb-frontends/tua6100.c index 2d052bfb8a23..d7ca25afd6a6 100644 --- a/drivers/media/dvb-frontends/tua6100.c +++ b/drivers/media/dvb-frontends/tua6100.c @@ -175,7 +175,7 @@ struct dvb_frontend *tua6100_attach(struct dvb_frontend *fe, int addr, struct i2 if (ret != 2) return NULL; - priv = kzalloc_obj(struct tua6100_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tua6100_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/dvb-frontends/ves1820.c b/drivers/media/dvb-frontends/ves1820.c index 56bbd52d1783..c9461c8c55c7 100644 --- a/drivers/media/dvb-frontends/ves1820.c +++ b/drivers/media/dvb-frontends/ves1820.c @@ -366,7 +366,7 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, struct ves1820_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct ves1820_state, GFP_KERNEL); + state = kzalloc_obj(struct ves1820_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/ves1x93.c b/drivers/media/dvb-frontends/ves1x93.c index 5c8abcebbd88..304d877f966a 100644 --- a/drivers/media/dvb-frontends/ves1x93.c +++ b/drivers/media/dvb-frontends/ves1x93.c @@ -450,7 +450,7 @@ struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, u8 identity; /* allocate memory for the internal state */ - state = kzalloc_obj(struct ves1x93_state, GFP_KERNEL); + state = kzalloc_obj(struct ves1x93_state); if (state == NULL) goto error; /* setup the state */ diff --git a/drivers/media/dvb-frontends/zd1301_demod.c b/drivers/media/dvb-frontends/zd1301_demod.c index 0c244fd17623..13936a311e56 100644 --- a/drivers/media/dvb-frontends/zd1301_demod.c +++ b/drivers/media/dvb-frontends/zd1301_demod.c @@ -470,7 +470,7 @@ static int zd1301_demod_probe(struct platform_device *pdev) goto err; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/dvb-frontends/zl10036.c b/drivers/media/dvb-frontends/zl10036.c index 3d05828e499a..88ca49242925 100644 --- a/drivers/media/dvb-frontends/zl10036.c +++ b/drivers/media/dvb-frontends/zl10036.c @@ -457,7 +457,7 @@ struct dvb_frontend *zl10036_attach(struct dvb_frontend *fe, return NULL; } - state = kzalloc_obj(struct zl10036_state, GFP_KERNEL); + state = kzalloc_obj(struct zl10036_state); if (!state) return NULL; diff --git a/drivers/media/dvb-frontends/zl10039.c b/drivers/media/dvb-frontends/zl10039.c index 54e1e4267c1d..696831d7544b 100644 --- a/drivers/media/dvb-frontends/zl10039.c +++ b/drivers/media/dvb-frontends/zl10039.c @@ -254,7 +254,7 @@ struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, struct zl10039_state *state = NULL; dprintk("%s\n", __func__); - state = kmalloc_obj(struct zl10039_state, GFP_KERNEL); + state = kmalloc_obj(struct zl10039_state); if (state == NULL) goto error; diff --git a/drivers/media/dvb-frontends/zl10353.c b/drivers/media/dvb-frontends/zl10353.c index a9f23b142301..6dd8d95651f6 100644 --- a/drivers/media/dvb-frontends/zl10353.c +++ b/drivers/media/dvb-frontends/zl10353.c @@ -598,7 +598,7 @@ struct dvb_frontend *zl10353_attach(const struct zl10353_config *config, int id; /* allocate memory for the internal state */ - state = kzalloc_obj(struct zl10353_state, GFP_KERNEL); + state = kzalloc_obj(struct zl10353_state); if (state == NULL) goto error; diff --git a/drivers/media/firewire/firedtv-fw.c b/drivers/media/firewire/firedtv-fw.c index 5ee96f290fef..c348526a4c45 100644 --- a/drivers/media/firewire/firedtv-fw.c +++ b/drivers/media/firewire/firedtv-fw.c @@ -135,7 +135,7 @@ int fdtv_start_iso(struct firedtv *fdtv) struct fw_device *device = device_of(fdtv); int i, err; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -255,7 +255,7 @@ static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) char name[MAX_MODEL_NAME_LEN]; int name_len, i, err; - fdtv = kzalloc_obj(*fdtv, GFP_KERNEL); + fdtv = kzalloc_obj(*fdtv); if (!fdtv) return -ENOMEM; diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index c063da7d568d..e6fa2f961177 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1094,7 +1094,7 @@ static int alvium_setup_mipi_fmt(struct alvium_dev *alvium) /* init alvium_csi2_fmt array */ alvium->alvium_csi2_fmt_n = sz; alvium->alvium_csi2_fmt = - kmalloc_objs(struct alvium_pixfmt, sz, GFP_KERNEL); + kmalloc_objs(struct alvium_pixfmt, sz); if (!alvium->alvium_csi2_fmt) return -ENOMEM; diff --git a/drivers/media/i2c/cs3308.c b/drivers/media/i2c/cs3308.c index cc4bd7fd7cdb..3f2f993e16a6 100644 --- a/drivers/media/i2c/cs3308.c +++ b/drivers/media/i2c/cs3308.c @@ -79,7 +79,7 @@ static int cs3308_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - sd = kzalloc_obj(struct v4l2_subdev, GFP_KERNEL); + sd = kzalloc_obj(struct v4l2_subdev); if (sd == NULL) return -ENOMEM; diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index 98f45dcad667..e133127397f4 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -1379,7 +1379,7 @@ static int ub960_parse_dt_txport(struct ub960_data *priv, struct ub960_txport *txport; int ret; - txport = kzalloc_obj(*txport, GFP_KERNEL); + txport = kzalloc_obj(*txport); if (!txport) return -ENOMEM; @@ -4573,7 +4573,7 @@ static int ub960_parse_dt_rxport(struct ub960_data *priv, unsigned int nport, struct ub960_rxport *rxport; int ret; - rxport = kzalloc_obj(*rxport, GFP_KERNEL); + rxport = kzalloc_obj(*rxport); if (!rxport) return -ENOMEM; diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index bf4f7b44d42e..5c6dda5338f5 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2538,7 +2538,7 @@ static int tda1997x_probe(struct i2c_client *client) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; - state = kzalloc_obj(struct tda1997x_state, GFP_KERNEL); + state = kzalloc_obj(struct tda1997x_state); if (!state) return -ENOMEM; diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index eebca7a0fb9b..fef3993f4e2d 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -750,7 +750,7 @@ static int video_i2c_probe(struct i2c_client *client) struct vb2_queue *queue; int ret = -ENODEV; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/media/mc/mc-dev-allocator.c b/drivers/media/mc/mc-dev-allocator.c index b8a170aaee04..b700ea73517e 100644 --- a/drivers/media/mc/mc-dev-allocator.c +++ b/drivers/media/mc/mc-dev-allocator.c @@ -81,7 +81,7 @@ static struct media_device *__media_device_get(struct device *dev, return &mdi->mdev; } - mdi = kzalloc_obj(*mdi, GFP_KERNEL); + mdi = kzalloc_obj(*mdi); if (!mdi) return NULL; diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index a27afa530592..f8ea7cfe10b2 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -737,7 +737,7 @@ int __must_check __media_device_register(struct media_device *mdev, struct media_devnode *devnode; int ret; - devnode = kzalloc_obj(*devnode, GFP_KERNEL); + devnode = kzalloc_obj(*devnode); if (!devnode) return -ENOMEM; diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index a078488874b2..3fa0bc687851 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -587,7 +587,7 @@ static int media_pipeline_add_pad(struct media_pipeline *pipe, } } - ppad = kzalloc_obj(*ppad, GFP_KERNEL); + ppad = kzalloc_obj(*ppad); if (!ppad) return -ENOMEM; @@ -977,7 +977,7 @@ __must_check int media_pipeline_alloc_start(struct media_pad *pad) */ pipe = media_pad_pipeline(pad); if (!pipe) { - new_pipe = kzalloc_obj(*new_pipe, GFP_KERNEL); + new_pipe = kzalloc_obj(*new_pipe); if (!new_pipe) { ret = -ENOMEM; goto out; @@ -1061,7 +1061,7 @@ static struct media_link *media_add_link(struct list_head *head) { struct media_link *link; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (link == NULL) return NULL; @@ -1547,7 +1547,7 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev, { struct media_intf_devnode *devnode; - devnode = kzalloc_obj(*devnode, GFP_KERNEL); + devnode = kzalloc_obj(*devnode); if (!devnode) return NULL; diff --git a/drivers/media/mc/mc-request.c b/drivers/media/mc/mc-request.c index 6668f44359ce..c7c7d4a86c6b 100644 --- a/drivers/media/mc/mc-request.c +++ b/drivers/media/mc/mc-request.c @@ -293,7 +293,7 @@ int media_request_alloc(struct media_device *mdev, int *alloc_fd) if (mdev->ops->req_alloc) req = mdev->ops->req_alloc(mdev); else - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/media/mmc/siano/smssdio.c b/drivers/media/mmc/siano/smssdio.c index 8dc11576f4e8..41dcab816216 100644 --- a/drivers/media/mmc/siano/smssdio.c +++ b/drivers/media/mmc/siano/smssdio.c @@ -244,7 +244,7 @@ static int smssdio_probe(struct sdio_func *func, board_id = id->driver_data; - smsdev = kzalloc_obj(struct smssdio_device, GFP_KERNEL); + smsdev = kzalloc_obj(struct smssdio_device); if (!smsdev) return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 26cc0f6b7571..663469208271 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -3216,7 +3216,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) if (bttv_num == BTTV_MAX) return -ENOMEM; pr_info("Bt8xx card found (%d)\n", bttv_num); - bttvs[bttv_num] = btv = kzalloc_obj(*btv, GFP_KERNEL); + bttvs[bttv_num] = btv = kzalloc_obj(*btv); if (btv == NULL) { pr_err("out of memory\n"); return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c index 5b4c6336d2d5..b79daa2d440f 100644 --- a/drivers/media/pci/bt8xx/bttv-gpio.c +++ b/drivers/media/pci/bt8xx/bttv-gpio.c @@ -73,7 +73,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) struct bttv_sub_device *sub; int err; - sub = kzalloc_obj(*sub, GFP_KERNEL); + sub = kzalloc_obj(*sub); if (NULL == sub) return -ENOMEM; diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c index 45e30ebdc5f8..373b6c6817d7 100644 --- a/drivers/media/pci/bt8xx/bttv-input.c +++ b/drivers/media/pci/bt8xx/bttv-input.c @@ -416,7 +416,7 @@ int bttv_input_init(struct bttv *btv) if (!btv->has_remote) return -ENODEV; - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); rc = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ir || !rc) goto err_out_free; diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index f26ece10d926..6da75c6ed77b 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -454,7 +454,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer; int result = 0; - hw_buffer = kmalloc_obj(*hw_buffer, GFP_KERNEL); + hw_buffer = kmalloc_obj(*hw_buffer); if (!hw_buffer) return -ENOMEM; dprintk(verbose, DST_CA_DEBUG, 1, " "); @@ -535,9 +535,9 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct mutex_lock(&dst_ca_mutex); dvbdev = file->private_data; state = dvbdev->priv; - p_ca_message = kmalloc_obj(struct ca_msg, GFP_KERNEL); - p_ca_slot_info = kmalloc_obj(struct ca_slot_info, GFP_KERNEL); - p_ca_caps = kmalloc_obj(struct ca_caps, GFP_KERNEL); + p_ca_message = kmalloc_obj(struct ca_msg); + p_ca_slot_info = kmalloc_obj(struct ca_slot_info); + p_ca_caps = kmalloc_obj(struct ca_caps); if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { result = -ENOMEM; goto free_mem_and_exit; diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c index b9c712c078d2..935503acab7d 100644 --- a/drivers/media/pci/bt8xx/dvb-bt8xx.c +++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c @@ -657,7 +657,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case BTTV_BOARD_TWINHAN_DST: /* DST is not a frontend driver !!! */ - state = kmalloc_obj(struct dst_state, GFP_KERNEL); + state = kmalloc_obj(struct dst_state); if (!state) { pr_err("No memory\n"); break; @@ -809,7 +809,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub) struct pci_dev* bttv_pci_dev; int ret; - if (!(card = kzalloc_obj(struct dvb_bt8xx_card, GFP_KERNEL))) + if (!(card = kzalloc_obj(struct dvb_bt8xx_card))) return -ENOMEM; mutex_init(&card->lock); diff --git a/drivers/media/pci/cobalt/cobalt-alsa-main.c b/drivers/media/pci/cobalt/cobalt-alsa-main.c index 1b30b44ad112..7bb7f13c70c0 100644 --- a/drivers/media/pci/cobalt/cobalt-alsa-main.c +++ b/drivers/media/pci/cobalt/cobalt-alsa-main.c @@ -45,7 +45,7 @@ static int snd_cobalt_card_create(struct cobalt_stream *s, struct snd_card *sc, struct snd_cobalt_card **cobsc) { - *cobsc = kzalloc_obj(struct snd_cobalt_card, GFP_KERNEL); + *cobsc = kzalloc_obj(struct snd_cobalt_card); if (*cobsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 1c2b00278c55..9b9f69ff4016 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -663,7 +663,7 @@ static int cobalt_probe(struct pci_dev *pci_dev, /* FIXME - module parameter arrays constrain max instances */ i = atomic_inc_return(&cobalt_instance) - 1; - cobalt = kzalloc_obj(struct cobalt, GFP_KERNEL); + cobalt = kzalloc_obj(struct cobalt); if (cobalt == NULL) return -ENOMEM; cobalt->pci_dev = pci_dev; diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c index 6214e29a5cd6..b77f5375f3ff 100644 --- a/drivers/media/pci/cx18/cx18-alsa-main.c +++ b/drivers/media/pci/cx18/cx18-alsa-main.c @@ -77,7 +77,7 @@ static int snd_cx18_card_create(struct v4l2_device *v4l2_dev, struct snd_card *sc, struct snd_cx18_card **cxsc) { - *cxsc = kzalloc_obj(struct snd_cx18_card, GFP_KERNEL); + *cxsc = kzalloc_obj(struct snd_cx18_card); if (*cxsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index bdfdd403a039..f778f79b921d 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -314,7 +314,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) memset(tv, 0, sizeof(*tv)); - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) return; @@ -899,7 +899,7 @@ static int cx18_probe(struct pci_dev *pci_dev, return -ENOMEM; } - cx = kzalloc_obj(*cx, GFP_KERNEL); + cx = kzalloc_obj(*cx); if (!cx) return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-fileops.c b/drivers/media/pci/cx18/cx18-fileops.c index b3d3a6f67ea8..445afcd3092b 100644 --- a/drivers/media/pci/cx18/cx18-fileops.c +++ b/drivers/media/pci/cx18/cx18-fileops.c @@ -732,7 +732,7 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp) CX18_DEBUG_FILE("open %s\n", s->name); /* Allocate memory */ - item = kzalloc_obj(struct cx18_open_id, GFP_KERNEL); + item = kzalloc_obj(struct cx18_open_id); if (NULL == item) { CX18_DEBUG_WARN("nomem on v4l2 open\n"); return -ENOMEM; diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c index b5b969fa9530..5da1a5d69eed 100644 --- a/drivers/media/pci/cx18/cx18-streams.c +++ b/drivers/media/pci/cx18/cx18-streams.c @@ -343,7 +343,7 @@ static int cx18_prep_dev(struct cx18 *cx, int type) /* Allocate the cx18_dvb struct only for the TS on cards with DTV */ if (type == CX18_ENC_STREAM_TYPE_TS) { if (cx->card->hw_all & CX18_HW_DVB) { - s->dvb = kzalloc_obj(struct cx18_dvb, GFP_KERNEL); + s->dvb = kzalloc_obj(struct cx18_dvb); if (s->dvb == NULL) { CX18_ERR("Couldn't allocate cx18_dvb structure for %s\n", s->name); diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 7eae29e002ea..20a3b6c51b35 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -224,14 +224,14 @@ static struct fpga_inode *append_internal(struct fpga_internal *internal) struct fpga_inode *new_node = fpga_first_inode; if (new_node == NULL) { - new_node = kmalloc_obj(struct fpga_inode, GFP_KERNEL); + new_node = kmalloc_obj(struct fpga_inode); fpga_first_inode = new_node; } else { while (new_node->next_inode != NULL) new_node = new_node->next_inode; new_node->next_inode = - kmalloc_obj(struct fpga_inode, GFP_KERNEL); + kmalloc_obj(struct fpga_inode); if (new_node->next_inode != NULL) new_node = new_node->next_inode; else @@ -634,7 +634,7 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) struct fpga_internal *inter = NULL; int ret = 0; - pid_filt = kzalloc_obj(struct netup_hw_pid_filter, GFP_KERNEL); + pid_filt = kzalloc_obj(struct netup_hw_pid_filter); ci_dbg_print("%s\n", __func__); @@ -648,7 +648,7 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) (inter->filts_used)++; ci_dbg_print("%s: Find Internal Structure!\n", __func__); } else { - inter = kzalloc_obj(struct fpga_internal, GFP_KERNEL); + inter = kzalloc_obj(struct fpga_internal); if (!inter) { ret = -ENOMEM; goto err; @@ -706,7 +706,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) int ret = 0; u8 store = 0; - state = kzalloc_obj(struct altera_ci_state, GFP_KERNEL); + state = kzalloc_obj(struct altera_ci_state); ci_dbg_print("%s\n", __func__); @@ -721,7 +721,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) inter->fpga_rw = config->fpga_rw; ci_dbg_print("%s: Find Internal Structure!\n", __func__); } else { - inter = kzalloc_obj(struct fpga_internal, GFP_KERNEL); + inter = kzalloc_obj(struct fpga_internal); if (!inter) { ret = -ENOMEM; goto err; diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c index f0ecc92fc444..154918984534 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c @@ -451,7 +451,7 @@ int netup_ci_init(struct cx23885_tsport *port) int ret; ci_dbg_print("%s\n", __func__); - state = kzalloc_obj(struct netup_ci_state, GFP_KERNEL); + state = kzalloc_obj(struct netup_ci_state); if (!state) { ci_dbg_print("%s: Unable create CI structure!\n", __func__); ret = -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c index e56c5b7d84bc..29f6df0e6de4 100644 --- a/drivers/media/pci/cx23885/cx23885-alsa.c +++ b/drivers/media/pci/cx23885/cx23885-alsa.c @@ -374,7 +374,7 @@ static int snd_cx23885_hw_params(struct snd_pcm_substream *substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods-1)); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (NULL == buf) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index ef2d00db794c..0892a5fd137d 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -2124,7 +2124,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev, struct v4l2_ctrl_handler *hdl; int err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index 9c6e5b360bab..ffbbeca8a8e5 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c @@ -327,7 +327,7 @@ int cx23885_input_init(struct cx23885_dev *dev) } /* cx23885 board instance kernel IR state */ - kernel_ir = kzalloc_obj(struct cx23885_kernel_ir, GFP_KERNEL); + kernel_ir = kzalloc_obj(struct cx23885_kernel_ir); if (kernel_ir == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index 242b47a7d0af..087beb82a1f1 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -1142,7 +1142,7 @@ int cx23888_ir_probe(struct cx23885_dev *dev) struct v4l2_subdev_ir_parameters default_params; int ret; - state = kzalloc_obj(struct cx23888_ir_state, GFP_KERNEL); + state = kzalloc_obj(struct cx23888_ir_state); if (state == NULL) return -ENOMEM; diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c index a8197a9b0abf..3f73391f9098 100644 --- a/drivers/media/pci/cx25821/cx25821-alsa.c +++ b/drivers/media/pci/cx25821/cx25821-alsa.c @@ -512,7 +512,7 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods - 1)); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (NULL == buf) return -ENOMEM; diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c index d64712f3aed4..5acb1dc00ae8 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1266,7 +1266,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev, struct cx25821_dev *dev; int err = 0; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index 3b8622dd056c..dce041a5e47a 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c @@ -465,7 +465,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream *substream, WARN_ON(!chip->dma_size); WARN_ON(chip->num_periods & (chip->num_periods - 1)); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c index 3e11bb066f31..7567c2388d95 100644 --- a/drivers/media/pci/cx88/cx88-cards.c +++ b/drivers/media/pci/cx88/cx88-cards.c @@ -3700,7 +3700,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) struct cx88_core *core; int i; - core = kzalloc_obj(*core, GFP_KERNEL); + core = kzalloc_obj(*core); if (!core) return NULL; diff --git a/drivers/media/pci/cx88/cx88-dsp.c b/drivers/media/pci/cx88/cx88-dsp.c index 1d7049edd252..958e4637fa4a 100644 --- a/drivers/media/pci/cx88/cx88-dsp.c +++ b/drivers/media/pci/cx88/cx88-dsp.c @@ -252,7 +252,7 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N) current_address, current_address - srch->fifo_start, sample_count, cx_read(MO_AUD_INTSTAT)); - samples = kmalloc_objs(*samples, sample_count, GFP_KERNEL); + samples = kmalloc_objs(*samples, sample_count); if (!samples) return NULL; diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index f94d75c64cf9..e958eecb29c5 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -267,7 +267,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) * used with a full-code IR table */ - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); dev = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !dev) goto err_out_free; diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c index 1ed77f812784..676160e9554d 100644 --- a/drivers/media/pci/cx88/cx88-mpeg.c +++ b/drivers/media/pci/cx88/cx88-mpeg.c @@ -619,7 +619,7 @@ int cx8802_register_driver(struct cx8802_driver *drv) dev->core->boardnr); /* Bring up a new struct for each driver instance */ - driver = kzalloc_obj(*drv, GFP_KERNEL); + driver = kzalloc_obj(*drv); if (!driver) { err = -ENOMEM; goto out; @@ -715,7 +715,7 @@ static int cx8802_probe(struct pci_dev *pci_dev, goto fail_core; err = -ENOMEM; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto fail_core; dev->pci = pci_dev; diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 87752ce17df8..c78b156c5cda 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -1261,7 +1261,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, int err; int i; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/pci/cx88/cx88-vp3054-i2c.c b/drivers/media/pci/cx88/cx88-vp3054-i2c.c index e421589edf4c..dbec12588a39 100644 --- a/drivers/media/pci/cx88/cx88-vp3054-i2c.c +++ b/drivers/media/pci/cx88/cx88-vp3054-i2c.c @@ -97,7 +97,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev) if (core->boardnr != CX88_BOARD_DNTV_LIVE_DVB_T_PRO) return 0; - vp3054_i2c = kzalloc_obj(*vp3054_i2c, GFP_KERNEL); + vp3054_i2c = kzalloc_obj(*vp3054_i2c); if (!vp3054_i2c) return -ENOMEM; dev->vp3054 = vp3054_i2c; diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c index 2602256b9f4a..e1d1f277fa9d 100644 --- a/drivers/media/pci/ddbridge/ddbridge-ci.c +++ b/drivers/media/pci/ddbridge/ddbridge-ci.c @@ -155,7 +155,7 @@ static void ci_attach(struct ddb_port *port) { struct ddb_ci *ci; - ci = kzalloc_obj(*ci, GFP_KERNEL); + ci = kzalloc_obj(*ci); if (!ci) return; memcpy(&ci->en, &en_templ, sizeof(en_templ)); @@ -288,7 +288,7 @@ static void ci_xo2_attach(struct ddb_port *port) { struct ddb_ci *ci; - ci = kzalloc_obj(*ci, GFP_KERNEL); + ci = kzalloc_obj(*ci); if (!ci) return; memcpy(&ci->en, &en_xo2_templ, sizeof(en_xo2_templ)); diff --git a/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c b/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c index 57192c5cb9c3..d2e876a2ca71 100644 --- a/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c +++ b/drivers/media/pci/ddbridge/ddbridge-dummy-fe.c @@ -100,7 +100,7 @@ struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void) struct ddbridge_dummy_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct ddbridge_dummy_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct ddbridge_dummy_fe_state); if (!state) return NULL; diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c index 1e1d4bda7c56..de05d8b0f9dc 100644 --- a/drivers/media/pci/dm1105/dm1105.c +++ b/drivers/media/pci/dm1105/dm1105.c @@ -976,7 +976,7 @@ static int dm1105_probe(struct pci_dev *pdev, if (dm1105_devcount >= ARRAY_SIZE(card)) return -ENODEV; - dev = kzalloc_obj(struct dm1105_dev, GFP_KERNEL); + dev = kzalloc_obj(struct dm1105_dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 72ebe4016ca2..32cc95a766b7 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -638,7 +638,7 @@ int ipu_bridge_instantiate_vcm(struct device *sensor) return 0; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { fwnode_handle_put(vcm_fwnode); return -ENOMEM; @@ -851,7 +851,7 @@ int ipu_bridge_init(struct device *dev, return dev_err_probe(dev, -EPROBE_DEFER, "waiting for IVSC to become ready\n"); - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu6/ipu6-bus.c b/drivers/media/pci/intel/ipu6/ipu6-bus.c index 59879e4861ed..173616381f62 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-bus.c +++ b/drivers/media/pci/intel/ipu6/ipu6-bus.c @@ -90,7 +90,7 @@ ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *parent, struct ipu6_device *isp = pci_get_drvdata(pdev); int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/intel/ipu6/ipu6-buttress.c b/drivers/media/pci/intel/ipu6/ipu6-buttress.c index 8b90ecf49e45..e0ecb4c8b081 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-buttress.c +++ b/drivers/media/pci/intel/ipu6/ipu6-buttress.c @@ -552,7 +552,7 @@ int ipu6_buttress_map_fw_image(struct ipu6_bus_device *sys, n_pages = PFN_UP(fw->size); - pages = kmalloc_objs(*pages, n_pages, GFP_KERNEL); + pages = kmalloc_objs(*pages, n_pages); if (!pages) return -ENOMEM; diff --git a/drivers/media/pci/intel/ipu6/ipu6-dma.c b/drivers/media/pci/intel/ipu6/ipu6-dma.c index cefb16040c21..fdcdb15b073c 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-dma.c +++ b/drivers/media/pci/intel/ipu6/ipu6-dma.c @@ -164,7 +164,7 @@ void *ipu6_dma_alloc(struct ipu6_bus_device *sys, size_t size, unsigned int i; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return NULL; diff --git a/drivers/media/pci/intel/ipu6/ipu6-fw-com.c b/drivers/media/pci/intel/ipu6/ipu6-fw-com.c index 13ee09f6d32a..51567c5fc139 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-fw-com.c +++ b/drivers/media/pci/intel/ipu6/ipu6-fw-com.c @@ -170,7 +170,7 @@ void *ipu6_fw_com_prepare(struct ipu6_fw_com_cfg *cfg, if (!cfg || !cfg->cell_start || !cfg->cell_ready) return NULL; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; ctx->dmem_addr = base + cfg->dmem_addr + REGMEM_OFFSET; diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c index 9eadde7142a3..0e6dca36b6ba 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c @@ -549,7 +549,7 @@ static struct ipu6_mmu_info *ipu6_mmu_alloc(struct ipu6_device *isp) struct ipu6_mmu_info *mmu_info; int ret; - mmu_info = kzalloc_obj(*mmu_info, GFP_KERNEL); + mmu_info = kzalloc_obj(*mmu_info); if (!mmu_info) return NULL; @@ -613,7 +613,7 @@ static struct ipu6_dma_mapping *alloc_dma_mapping(struct ipu6_device *isp) { struct ipu6_dma_mapping *dmap; - dmap = kzalloc_obj(*dmap, GFP_KERNEL); + dmap = kzalloc_obj(*dmap); if (!dmap) return NULL; diff --git a/drivers/media/pci/intel/ipu6/ipu6.c b/drivers/media/pci/intel/ipu6/ipu6.c index 57fe13ebb621..34f67f4f1bb5 100644 --- a/drivers/media/pci/intel/ipu6/ipu6.c +++ b/drivers/media/pci/intel/ipu6/ipu6.c @@ -381,7 +381,7 @@ ipu6_isys_init(struct pci_dev *pdev, struct device *parent, return ERR_PTR(ret); } - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return ERR_PTR(-ENOMEM); @@ -425,7 +425,7 @@ ipu6_psys_init(struct pci_dev *pdev, struct device *parent, struct ipu6_psys_pdata *pdata; int ret; - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/ivtv/ivtv-alsa-main.c b/drivers/media/pci/ivtv/ivtv-alsa-main.c index 05d499241c02..59573debd19e 100644 --- a/drivers/media/pci/ivtv/ivtv-alsa-main.c +++ b/drivers/media/pci/ivtv/ivtv-alsa-main.c @@ -74,7 +74,7 @@ static int snd_ivtv_card_create(struct v4l2_device *v4l2_dev, struct snd_card *sc, struct snd_ivtv_card **itvsc) { - *itvsc = kzalloc_obj(struct snd_ivtv_card, GFP_KERNEL); + *itvsc = kzalloc_obj(struct snd_ivtv_card); if (*itvsc == NULL) return -ENOMEM; diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 9d0d4faf9867..e0091a8e5c88 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -953,7 +953,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) int vbi_buf_size; struct ivtv *itv; - itv = kzalloc_obj(struct ivtv, GFP_KERNEL); + itv = kzalloc_obj(struct ivtv); if (itv == NULL) return -ENOMEM; itv->pdev = pdev; diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c index 87c0ef449beb..e7fed9698758 100644 --- a/drivers/media/pci/ivtv/ivtv-fileops.c +++ b/drivers/media/pci/ivtv/ivtv-fileops.c @@ -990,7 +990,7 @@ static int ivtv_open(struct file *filp) } /* Allocate memory */ - item = kzalloc_obj(struct ivtv_open_id, GFP_KERNEL); + item = kzalloc_obj(struct ivtv_open_id); if (NULL == item) { IVTV_DEBUG_WARN("nomem on v4l2 open\n"); return -ENOMEM; diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index 132b5e21868b..050068308c10 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -149,7 +149,7 @@ static int hopper_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err; - mantis = kzalloc_obj(*mantis, GFP_KERNEL); + mantis = kzalloc_obj(*mantis); if (!mantis) { err = -ENOMEM; goto fail0; diff --git a/drivers/media/pci/mantis/mantis_ca.c b/drivers/media/pci/mantis/mantis_ca.c index a0998b16ba9e..96fee641d16e 100644 --- a/drivers/media/pci/mantis/mantis_ca.c +++ b/drivers/media/pci/mantis/mantis_ca.c @@ -137,7 +137,7 @@ int mantis_ca_init(struct mantis_pci *mantis) int ca_flags = 0, result; dprintk(MANTIS_DEBUG, 1, "Initializing Mantis CA"); - ca = kzalloc_obj(struct mantis_ca, GFP_KERNEL); + ca = kzalloc_obj(struct mantis_ca); if (!ca) { dprintk(MANTIS_ERROR, 1, "Out of memory!, exiting .."); result = -ENOMEM; diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index 3c46e1db8e4a..5625260b6aec 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c @@ -158,7 +158,7 @@ static int mantis_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err; - mantis = kzalloc_obj(*mantis, GFP_KERNEL); + mantis = kzalloc_obj(*mantis); if (!mantis) return -ENOMEM; diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c index cd23758fb9b4..a7351a469386 100644 --- a/drivers/media/pci/mgb4/mgb4_core.c +++ b/drivers/media/pci/mgb4/mgb4_core.c @@ -522,7 +522,7 @@ static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id) }; int irqs = pci_msix_vec_count(pdev); - mgbdev = kzalloc_obj(*mgbdev, GFP_KERNEL); + mgbdev = kzalloc_obj(*mgbdev); if (!mgbdev) return -ENOMEM; diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c index 815c87b9210f..74fb00c4a408 100644 --- a/drivers/media/pci/mgb4/mgb4_vin.c +++ b/drivers/media/pci/mgb4/mgb4_vin.c @@ -946,7 +946,7 @@ struct mgb4_vin_dev *mgb4_vin_create(struct mgb4_dev *mgbdev, int id) struct device *dev = &pdev->dev; int vin_irq, err_irq; - vindev = kzalloc_obj(*vindev, GFP_KERNEL); + vindev = kzalloc_obj(*vindev); if (!vindev) return NULL; diff --git a/drivers/media/pci/mgb4/mgb4_vout.c b/drivers/media/pci/mgb4/mgb4_vout.c index cd5a36a41333..7725bcd55e4c 100644 --- a/drivers/media/pci/mgb4/mgb4_vout.c +++ b/drivers/media/pci/mgb4/mgb4_vout.c @@ -761,7 +761,7 @@ struct mgb4_vout_dev *mgb4_vout_create(struct mgb4_dev *mgbdev, int id) struct pci_dev *pdev = mgbdev->pdev; struct device *dev = &pdev->dev; - voutdev = kzalloc_obj(*voutdev, GFP_KERNEL); + voutdev = kzalloc_obj(*voutdev); if (!voutdev) return NULL; diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index 08af6717b1c9..ec08023b5d5e 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c @@ -799,7 +799,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev, } /* allocate device context */ - ndev = kzalloc_obj(*ndev, GFP_KERNEL); + ndev = kzalloc_obj(*ndev); if (!ndev) goto dev_alloc_err; diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c index 38bd167e821d..22c2222d5c4d 100644 --- a/drivers/media/pci/pluto2/pluto2.c +++ b/drivers/media/pci/pluto2/pluto2.c @@ -582,7 +582,7 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct dmx_demux *dmx; int ret = -ENOMEM; - pluto = kzalloc_obj(struct pluto, GFP_KERNEL); + pluto = kzalloc_obj(struct pluto); if (!pluto) goto out; diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c index 21a9a3166588..7cce6576b4cb 100644 --- a/drivers/media/pci/pt1/pt1.c +++ b/drivers/media/pci/pt1/pt1.c @@ -833,7 +833,7 @@ pt1_alloc_adapter(struct pt1 *pt1) struct dmxdev *dmxdev; int ret; - adap = kzalloc_obj(struct pt1_adapter, GFP_KERNEL); + adap = kzalloc_obj(struct pt1_adapter); if (!adap) { ret = -ENOMEM; goto err; @@ -1356,7 +1356,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_pci_release_regions; } - pt1 = kzalloc_obj(struct pt1, GFP_KERNEL); + pt1 = kzalloc_obj(struct pt1); if (!pt1) { ret = -ENOMEM; goto err_pci_iounmap; diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c index f0fb92017e8f..753161889092 100644 --- a/drivers/media/pci/pt3/pt3.c +++ b/drivers/media/pci/pt3/pt3.c @@ -529,7 +529,7 @@ static int pt3_alloc_adapter(struct pt3_board *pt3, int index) struct pt3_adapter *adap; struct dvb_adapter *da; - adap = kzalloc_obj(*adap, GFP_KERNEL); + adap = kzalloc_obj(*adap); if (!adap) return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index ad1a640d7f76..147985bb0261 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c @@ -816,7 +816,7 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) mutex_unlock(&dev->dmasound.lock); - pcm = kzalloc_obj(*pcm, GFP_KERNEL); + pcm = kzalloc_obj(*pcm); if (pcm == NULL) return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index 5acad9554a61..2f5b258d682b 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -1010,7 +1010,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, if (saa7134_devcount == SAA7134_MAXBOARDS) return -ENOMEM; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (NULL == dev) return -ENOMEM; @@ -1018,7 +1018,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, sprintf(dev->name, "saa%x[%d]", pci_dev->device, dev->nr); #ifdef CONFIG_MEDIA_CONTROLLER - dev->media_dev = kzalloc_obj(*dev->media_dev, GFP_KERNEL); + dev->media_dev = kzalloc_obj(*dev->media_dev); if (!dev->media_dev) { err = -ENOMEM; goto err_free_dev; diff --git a/drivers/media/pci/saa7134/saa7134-go7007.c b/drivers/media/pci/saa7134/saa7134-go7007.c index 05f9606b9012..1f4d771793a2 100644 --- a/drivers/media/pci/saa7134/saa7134-go7007.c +++ b/drivers/media/pci/saa7134/saa7134-go7007.c @@ -414,7 +414,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev) if (go == NULL) return -ENOMEM; - saa = kzalloc_obj(struct saa7134_go7007, GFP_KERNEL); + saa = kzalloc_obj(struct saa7134_go7007); if (saa == NULL) { kfree(go); return -ENOMEM; diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index 22fbcc2cb585..5b7101415780 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -768,7 +768,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) return -ENODEV; } - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); rc = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ir || !rc) { err = -ENOMEM; diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index 371beecd92e1..1eef4e102972 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c @@ -250,7 +250,7 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d DEB_EE("\n"); - hexium = kzalloc_obj(*hexium, GFP_KERNEL); + hexium = kzalloc_obj(*hexium); if (!hexium) return -ENOMEM; diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c index f713d543971e..6f1b4bff7596 100644 --- a/drivers/media/pci/saa7146/hexium_orion.c +++ b/drivers/media/pci/saa7146/hexium_orion.c @@ -209,7 +209,7 @@ static int hexium_probe(struct saa7146_dev *dev) return -EFAULT; } - hexium = kzalloc_obj(*hexium, GFP_KERNEL); + hexium = kzalloc_obj(*hexium); if (!hexium) return -ENOMEM; diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c index 1999d45f2986..d931b4e3052f 100644 --- a/drivers/media/pci/saa7146/mxb.c +++ b/drivers/media/pci/saa7146/mxb.c @@ -226,7 +226,7 @@ static int mxb_probe(struct saa7146_dev *dev) V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); if (hdl->error) return hdl->error; - mxb = kzalloc_obj(struct mxb, GFP_KERNEL); + mxb = kzalloc_obj(struct mxb); if (mxb == NULL) { DEB_D("not enough kernel memory\n"); return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-buffer.c b/drivers/media/pci/saa7164/saa7164-buffer.c index 9d1fa04990f7..1f961bdfc041 100644 --- a/drivers/media/pci/saa7164/saa7164-buffer.c +++ b/drivers/media/pci/saa7164/saa7164-buffer.c @@ -68,7 +68,7 @@ struct saa7164_buffer *saa7164_buffer_alloc(struct saa7164_port *port, goto ret; } - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) goto ret; @@ -252,7 +252,7 @@ struct saa7164_user_buffer *saa7164_buffer_alloc_user(struct saa7164_dev *dev, { struct saa7164_user_buffer *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return NULL; diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index eac9bc9f640c..74406d5ea0a5 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1238,7 +1238,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev, int err, i; u32 version; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (NULL == dev) return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index cae31f11d076..64380741b984 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -719,7 +719,7 @@ static int fops_open(struct file *file) dprintk(DBGLVL_ENC, "%s()\n", __func__); /* allocate + initialize per filehandle data */ - fh = kzalloc_obj(*fh, GFP_KERNEL); + fh = kzalloc_obj(*fh); if (NULL == fh) return -ENOMEM; diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c index fcb9f99890e5..bfa6ee295a22 100644 --- a/drivers/media/pci/saa7164/saa7164-vbi.c +++ b/drivers/media/pci/saa7164/saa7164-vbi.c @@ -422,7 +422,7 @@ static int fops_open(struct file *file) dprintk(DBGLVL_VBI, "%s()\n", __func__); /* allocate + initialize per filehandle data */ - fh = kzalloc_obj(*fh, GFP_KERNEL); + fh = kzalloc_obj(*fh); if (NULL == fh) return -ENOMEM; diff --git a/drivers/media/pci/smipcie/smipcie-main.c b/drivers/media/pci/smipcie/smipcie-main.c index 5bfba2721231..387c29958c98 100644 --- a/drivers/media/pci/smipcie/smipcie-main.c +++ b/drivers/media/pci/smipcie/smipcie-main.c @@ -946,7 +946,7 @@ static int smi_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (pci_enable_device(pdev) < 0) return -ENODEV; - dev = kzalloc_obj(struct smi_dev, GFP_KERNEL); + dev = kzalloc_obj(struct smi_dev); if (!dev) { ret = -ENOMEM; goto err_pci_disable_device; diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c index 78335a6838c6..11cddf4b4312 100644 --- a/drivers/media/pci/solo6x10/solo6x10-core.c +++ b/drivers/media/pci/solo6x10/solo6x10-core.c @@ -449,7 +449,7 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) int ret; u8 chip_id; - solo_dev = kzalloc_obj(*solo_dev, GFP_KERNEL); + solo_dev = kzalloc_obj(*solo_dev); if (solo_dev == NULL) return -ENOMEM; diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c index 5906fd47b583..e41b8d90a30e 100644 --- a/drivers/media/pci/solo6x10/solo6x10-g723.c +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c @@ -120,7 +120,7 @@ static int snd_solo_pcm_open(struct snd_pcm_substream *ss) struct solo_dev *solo_dev = snd_pcm_substream_chip(ss); struct solo_snd_pcm *solo_pcm; - solo_pcm = kzalloc_obj(*solo_pcm, GFP_KERNEL); + solo_pcm = kzalloc_obj(*solo_pcm); if (solo_pcm == NULL) goto oom; diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index d7168b9c9e61..91b5c4161930 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c @@ -1208,7 +1208,7 @@ static struct solo_enc_dev *solo_enc_alloc(struct solo_dev *solo_dev, struct v4l2_ctrl_handler *hdl; int ret; - solo_enc = kzalloc_obj(*solo_enc, GFP_KERNEL); + solo_enc = kzalloc_obj(*solo_enc); if (!solo_enc) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c index 482e71c0fdcc..55542cfbc6bb 100644 --- a/drivers/media/pci/ttpci/budget-av.c +++ b/drivers/media/pci/ttpci/budget-av.c @@ -1437,7 +1437,7 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio dprintk(2, "dev: %p\n", dev); - budget_av = kzalloc_obj(struct budget_av, GFP_KERNEL); + budget_av = kzalloc_obj(struct budget_av); if (!budget_av) return -ENOMEM; diff --git a/drivers/media/pci/ttpci/budget-ci.c b/drivers/media/pci/ttpci/budget-ci.c index 86edb4310366..3709c0fb23b0 100644 --- a/drivers/media/pci/ttpci/budget-ci.c +++ b/drivers/media/pci/ttpci/budget-ci.c @@ -1456,7 +1456,7 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio struct budget_ci *budget_ci; int err; - budget_ci = kzalloc_obj(struct budget_ci, GFP_KERNEL); + budget_ci = kzalloc_obj(struct budget_ci); if (!budget_ci) { err = -ENOMEM; goto out1; diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c index ebdc6d2bce4e..95370156aff5 100644 --- a/drivers/media/pci/ttpci/budget.c +++ b/drivers/media/pci/ttpci/budget.c @@ -788,7 +788,7 @@ static int budget_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d struct budget *budget = NULL; int err; - budget = kmalloc_obj(struct budget, GFP_KERNEL); + budget = kmalloc_obj(struct budget); if (budget == NULL) return -ENOMEM; diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c index bcf93f4a5c83..101c7ccc6fd0 100644 --- a/drivers/media/pci/tw686x/tw686x-core.c +++ b/drivers/media/pci/tw686x/tw686x-core.c @@ -243,7 +243,7 @@ static int tw686x_probe(struct pci_dev *pci_dev, struct tw686x_dev *dev; int err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; dev->type = pci_id->driver_data; diff --git a/drivers/media/pci/zoran/videocodec.c b/drivers/media/pci/zoran/videocodec.c index 2874247ad300..85fe60065b4d 100644 --- a/drivers/media/pci/zoran/videocodec.c +++ b/drivers/media/pci/zoran/videocodec.c @@ -73,7 +73,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) res = codec->setup(codec); if (res == 0) { zrdev_dbg(zr, "%s: '%s'\n", __func__, codec->name); - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); if (!ptr) goto out_kfree; ptr->codec = codec; @@ -180,7 +180,7 @@ int videocodec_register(const struct videocodec *codec) "videocodec: register '%s', type: %x, flags %lx, magic %lx\n", codec->name, codec->type, codec->flags, codec->magic); - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); if (!ptr) return -ENOMEM; ptr->codec = codec; diff --git a/drivers/media/pci/zoran/zr36016.c b/drivers/media/pci/zoran/zr36016.c index 4c6a0a00578b..bb2d92743229 100644 --- a/drivers/media/pci/zoran/zr36016.c +++ b/drivers/media/pci/zoran/zr36016.c @@ -344,7 +344,7 @@ static int zr36016_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/pci/zoran/zr36050.c b/drivers/media/pci/zoran/zr36050.c index 701e4ef7ec22..eac4a6c32e93 100644 --- a/drivers/media/pci/zoran/zr36050.c +++ b/drivers/media/pci/zoran/zr36050.c @@ -741,7 +741,7 @@ static int zr36050_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/pci/zoran/zr36060.c b/drivers/media/pci/zoran/zr36060.c index ddd822e4495a..c383dcddf7cd 100644 --- a/drivers/media/pci/zoran/zr36060.c +++ b/drivers/media/pci/zoran/zr36060.c @@ -796,7 +796,7 @@ static int zr36060_setup(struct videocodec *codec) return -ENOSPC; } //mem structure init - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); codec->data = ptr; if (!ptr) return -ENOMEM; diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index a6589cd6359e..eac3bc9af990 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -967,7 +967,7 @@ static int allegro_mbox_notify(struct allegro_mbox *mbox) u32 *tmp; int err; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1551,7 +1551,7 @@ static int allocate_buffers_internal(struct allegro_channel *channel, struct allegro_buffer *buffer, *tmp; for (i = 0; i < n; i++) { - buffer = kmalloc_obj(*buffer, GFP_KERNEL); + buffer = kmalloc_obj(*buffer); if (!buffer) { err = -ENOMEM; goto err; @@ -1632,7 +1632,7 @@ static ssize_t allegro_h264_write_sps(struct allegro_channel *channel, unsigned int cpb_size; unsigned int cpb_size_scale; - sps = kzalloc_obj(*sps, GFP_KERNEL); + sps = kzalloc_obj(*sps); if (!sps) return -ENOMEM; @@ -1729,7 +1729,7 @@ static ssize_t allegro_h264_write_pps(struct allegro_channel *channel, struct nal_h264_pps *pps; ssize_t size; - pps = kzalloc_obj(*pps, GFP_KERNEL); + pps = kzalloc_obj(*pps); if (!pps) return -ENOMEM; @@ -1780,7 +1780,7 @@ static ssize_t allegro_hevc_write_vps(struct allegro_channel *channel, s32 level = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_level); s32 tier = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_tier); - vps = kzalloc_obj(*vps, GFP_KERNEL); + vps = kzalloc_obj(*vps); if (!vps) return -ENOMEM; @@ -1822,7 +1822,7 @@ static ssize_t allegro_hevc_write_sps(struct allegro_channel *channel, s32 level = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_level); s32 tier = v4l2_ctrl_g_ctrl(channel->mpeg_video_hevc_tier); - sps = kzalloc_obj(*sps, GFP_KERNEL); + sps = kzalloc_obj(*sps); if (!sps) return -ENOMEM; @@ -1929,7 +1929,7 @@ static ssize_t allegro_hevc_write_pps(struct allegro_channel *channel, ssize_t size; int i; - pps = kzalloc_obj(*pps, GFP_KERNEL); + pps = kzalloc_obj(*pps); if (!pps) return -ENOMEM; diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c index 0b499ed7795f..c5dc03905ce0 100644 --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c @@ -834,7 +834,7 @@ static int ge2d_open(struct file *file) struct ge2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->ge2d = ge2d; diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index 3302994dbf3f..a9f0521f2e1a 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -1927,11 +1927,11 @@ static int vdec_open(struct file *file) struct vdec_t *vdec; int ret; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; - vdec = kzalloc_obj(*vdec, GFP_KERNEL); + vdec = kzalloc_obj(*vdec); if (!vdec) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index 4f13566fed49..0b3d58b9f2f7 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -858,7 +858,7 @@ static int venc_frame_encoded(struct vpu_inst *inst, void *arg) if (!info) return -EINVAL; venc = inst->priv; - frame = kzalloc_obj(*frame, GFP_KERNEL); + frame = kzalloc_obj(*frame); if (!frame) return -ENOMEM; @@ -1307,11 +1307,11 @@ static int venc_open(struct file *file) struct venc_t *venc; int ret; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; - venc = kzalloc_obj(*venc, GFP_KERNEL); + venc = kzalloc_obj(*venc); if (!venc) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/amphion/vpu_cmds.c b/drivers/media/platform/amphion/vpu_cmds.c index 00eda558a739..615680f1cb94 100644 --- a/drivers/media/platform/amphion/vpu_cmds.c +++ b/drivers/media/platform/amphion/vpu_cmds.c @@ -83,11 +83,11 @@ static struct vpu_cmd_t *vpu_alloc_cmd(struct vpu_inst *inst, u32 id, void *data int i; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return NULL; - cmd->pkt = kzalloc_obj(*cmd->pkt, GFP_KERNEL); + cmd->pkt = kzalloc_obj(*cmd->pkt); if (!cmd->pkt) { kfree(cmd); return NULL; diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index 9d00ea315763..53a342853be6 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2642,7 +2642,7 @@ static int unicam_probe(struct platform_device *pdev) struct unicam_device *unicam; int ret; - unicam = kzalloc_obj(*unicam, GFP_KERNEL); + unicam = kzalloc_obj(*unicam); if (!unicam) return -ENOMEM; diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index df299f29756f..cde690c6fdee 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -824,7 +824,7 @@ static int csi2rx_probe(struct platform_device *pdev) unsigned int i; int ret; - csi2rx = kzalloc_obj(*csi2rx, GFP_KERNEL); + csi2rx = kzalloc_obj(*csi2rx); if (!csi2rx) return -ENOMEM; platform_set_drvdata(pdev, csi2rx); diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index 80aefdbe259b..629b0fa838a2 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -573,7 +573,7 @@ static int csi2tx_probe(struct platform_device *pdev) unsigned int i; int ret; - csi2tx = kzalloc_obj(*csi2tx, GFP_KERNEL); + csi2tx = kzalloc_obj(*csi2tx); if (!csi2tx) return -ENOMEM; platform_set_drvdata(pdev, csi2tx); diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index aab26194ad1b..b0559303c40f 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -397,7 +397,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list) */ src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); - meta = kmalloc_obj(*meta, GFP_KERNEL); + meta = kmalloc_obj(*meta); if (meta) { meta->sequence = src_buf->sequence; meta->timecode = src_buf->timecode; diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index fea7682b2217..be37ea568bfe 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2606,7 +2606,7 @@ static int coda_open(struct file *file) int ret; int idx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/chips-media/coda/coda-jpeg.c b/drivers/media/platform/chips-media/coda/coda-jpeg.c index 487d08491a42..835225383aa1 100644 --- a/drivers/media/platform/chips-media/coda/coda-jpeg.c +++ b/drivers/media/platform/chips-media/coda/coda-jpeg.c @@ -355,7 +355,7 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct vb2_buffer *vb) } huff_tab = ctx->params.jpeg_huff_tab; if (!huff_tab) { - huff_tab = kzalloc_obj(struct coda_huff_tab, GFP_KERNEL); + huff_tab = kzalloc_obj(struct coda_huff_tab); if (!huff_tab) return -ENOMEM; ctx->params.jpeg_huff_tab = huff_tab; @@ -593,7 +593,7 @@ static int coda9_jpeg_gen_enc_huff_tab(struct coda_ctx *ctx, int tab_num, }; int ret = -EINVAL; - huff = kzalloc_obj(*huff, GFP_KERNEL); + huff = kzalloc_obj(*huff); if (!huff) return -ENOMEM; @@ -723,7 +723,7 @@ static int coda9_jpeg_load_huff_tab(struct coda_ctx *ctx) int i, j; int ret; - huff = kzalloc_obj(*huff, GFP_KERNEL); + huff = kzalloc_obj(*huff); if (!huff) return -ENOMEM; diff --git a/drivers/media/platform/chips-media/coda/imx-vdoa.c b/drivers/media/platform/chips-media/coda/imx-vdoa.c index 2e85043a7f01..be874f18a365 100644 --- a/drivers/media/platform/chips-media/coda/imx-vdoa.c +++ b/drivers/media/platform/chips-media/coda/imx-vdoa.c @@ -201,7 +201,7 @@ struct vdoa_ctx *vdoa_context_create(struct vdoa_data *vdoa) struct vdoa_ctx *ctx; int err; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c index 097ab7f595b0..80e1831a42e0 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c @@ -1822,7 +1822,7 @@ static int wave5_vpu_open_dec(struct file *filp) struct v4l2_m2m_ctx *m2m_ctx; int ret = 0; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; @@ -1834,7 +1834,7 @@ static int wave5_vpu_open_dec(struct file *filp) mutex_init(&inst->feed_lock); INIT_LIST_HEAD(&inst->avail_src_bufs); - inst->codec_info = kzalloc_obj(*inst->codec_info, GFP_KERNEL); + inst->codec_info = kzalloc_obj(*inst->codec_info); if (!inst->codec_info) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c index f9373ed9a97b..7613fcdbafed 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c @@ -1571,7 +1571,7 @@ static int wave5_vpu_open_enc(struct file *filp) struct v4l2_ctrl_handler *v4l2_ctrl_hdl; int ret = 0; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; v4l2_ctrl_hdl = &inst->v4l2_ctrl_hdl; @@ -1580,7 +1580,7 @@ static int wave5_vpu_open_enc(struct file *filp) inst->type = VPU_INST_TYPE_ENC; inst->ops = &wave5_vpu_enc_inst_ops; - inst->codec_info = kzalloc_obj(*inst->codec_info, GFP_KERNEL); + inst->codec_info = kzalloc_obj(*inst->codec_info); if (!inst->codec_info) { kfree(inst); return -ENOMEM; diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c index 803470d12bdb..42ad9ee3993b 100644 --- a/drivers/media/platform/imagination/e5010-jpeg-enc.c +++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c @@ -728,7 +728,7 @@ static int e5010_open(struct file *file) struct e5010_context *ctx; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index dbd465708f6f..2269d852ab0e 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -741,7 +741,7 @@ static struct pxa_camera_format_xlate *pxa_mbus_build_fmts_xlate( if (!fmts) return ERR_PTR(-ENXIO); - user_formats = kzalloc_objs(*user_formats, fmts + 1, GFP_KERNEL); + user_formats = kzalloc_objs(*user_formats, fmts + 1); if (!user_formats) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index 568193243869..1d0e70eaea3d 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -835,7 +835,7 @@ static int deinterlace_open(struct file *file) struct deinterlace_dev *pcdev = video_drvdata(file); struct deinterlace_ctx *ctx = NULL; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/marvell/cafe-driver.c b/drivers/media/platform/marvell/cafe-driver.c index a447099b40cc..632c15572aa8 100644 --- a/drivers/media/platform/marvell/cafe-driver.c +++ b/drivers/media/platform/marvell/cafe-driver.c @@ -327,7 +327,7 @@ static int cafe_smbus_setup(struct cafe_camera *cam) struct i2c_adapter *adap; int ret; - adap = kzalloc_obj(*adap, GFP_KERNEL); + adap = kzalloc_obj(*adap); if (adap == NULL) return -ENOMEM; adap->owner = THIS_MODULE; @@ -485,7 +485,7 @@ static int cafe_pci_probe(struct pci_dev *pdev, * Start putting together one of our big camera structures. */ ret = -ENOMEM; - cam = kzalloc_obj(struct cafe_camera, GFP_KERNEL); + cam = kzalloc_obj(struct cafe_camera); if (cam == NULL) goto out; pci_set_drvdata(pdev, cam); diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 7a506b1f03da..c01124a349f6 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1151,7 +1151,7 @@ static int mtk_jpeg_open(struct file *file) struct mtk_jpeg_ctx *ctx; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c index e069e326d2bd..d2813890cceb 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c @@ -1053,7 +1053,7 @@ static int mtk_mdp_m2m_open(struct file *file) int ret; struct v4l2_format default_format; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index d4dd2cad0d7f..d30a05782ab9 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -564,7 +564,7 @@ static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, goto err_uninit; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto err_uninit; @@ -583,13 +583,13 @@ static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, goto err_destroy_pkt; } - comps = kzalloc_objs(*comps, num_comp, GFP_KERNEL); + comps = kzalloc_objs(*comps, num_comp); if (!comps) { ret = -ENOMEM; goto err_destroy_pkt; } - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) { ret = -ENOMEM; goto err_free_comps; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 978bf12cc1d0..8f4da4cf55d2 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -221,7 +221,7 @@ static int mdp_probe(struct platform_device *pdev) struct resource *res; int ret, i, mutex_id; - mdp = kzalloc_obj(*mdp, GFP_KERNEL); + mdp = kzalloc_obj(*mdp); if (!mdp) { ret = -ENOMEM; goto err_return; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c index bb8f70a42f32..ad3ae89c231c 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c @@ -568,7 +568,7 @@ static int mdp_m2m_open(struct file *file) struct v4l2_format default_format = {}; const struct mdp_limit *limit = mdp->mdp_data->def_limit; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c index c4566eb52db8..2da11521fc7b 100644 --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c @@ -149,7 +149,7 @@ void mtk_vcodec_dbgfs_create(struct mtk_vcodec_dec_ctx *ctx) struct mtk_vcodec_dbgfs_inst *dbgfs_inst; struct mtk_vcodec_dec_dev *vcodec_dev = ctx->dev; - dbgfs_inst = kzalloc_obj(*dbgfs_inst, GFP_KERNEL); + dbgfs_inst = kzalloc_obj(*dbgfs_inst); if (!dbgfs_inst) return; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c index 066bb304a34c..e936ed8dffba 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c @@ -200,7 +200,7 @@ static int fops_vcodec_open(struct file *file) struct vb2_queue *src_vq; unsigned long flags; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c index 85b88aa45f5b..ab1894fba0d9 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c @@ -735,7 +735,7 @@ static struct media_request *fops_media_request_alloc(struct media_device *mdev) { struct mtk_vcodec_dec_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); return &req->req; } diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c index a3ea4d2a9fb0..2d622e85f827 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_if.c @@ -1879,7 +1879,7 @@ static int vdec_av1_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_av1_slice_init_vsi *vsi; int ret; - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c index a754b96ae84b..a95327388f57 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c @@ -270,7 +270,7 @@ static int vdec_h264_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_h264_inst *inst = NULL; int err; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c index 9cf7ff35731e..1f691cd2f4c3 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c @@ -273,7 +273,7 @@ static int vdec_h264_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_h264_slice_inst *inst; int err; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c index d761e70f5933..10359ce9b934 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c @@ -1208,7 +1208,7 @@ static int vdec_h264_slice_init(struct mtk_vcodec_dec_ctx *ctx) int err, vsi_size; unsigned char *temp; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c index 1c925deaa721..02f39954a4c2 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_multi_if.c @@ -858,7 +858,7 @@ static int vdec_hevc_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_hevc_slice_inst *inst; int err, vsi_size; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c index af5bd3c24729..fd15d462b168 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c @@ -390,7 +390,7 @@ static int vdec_vp8_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp8_inst *inst; int err; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c index 27d6af7836b9..391e789a5a13 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c @@ -275,7 +275,7 @@ static int vdec_vp8_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp8_slice_inst *inst; int err; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c index 1b4bc0f60b8b..adbacabdbebc 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c @@ -1848,7 +1848,7 @@ static int vdec_vp9_slice_init(struct mtk_vcodec_dec_ctx *ctx) struct vdec_vp9_slice_init_vsi *vsi; int ret; - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c index c02cdb7acd63..c977ed0c09b6 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c @@ -119,7 +119,7 @@ static int fops_vcodec_open(struct file *file) struct vb2_queue *src_vq; unsigned long flags; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c index d7630d9ae305..d2f4d732d2f7 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c @@ -588,7 +588,7 @@ static int h264_enc_init(struct mtk_vcodec_enc_ctx *ctx) int ret = 0; struct venc_h264_inst *inst; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c index b85b177ebcce..f739fd5fafcc 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c @@ -316,7 +316,7 @@ static int vp8_enc_init(struct mtk_vcodec_enc_ctx *ctx) int ret = 0; struct venc_vp8_inst *inst; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c index eccd92774344..b2a562e1ee1c 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -411,7 +411,7 @@ static unsigned int npcm_video_add_rect(struct npcm_video *video, struct rect_list *list = NULL; struct v4l2_rect *r; - list = kzalloc_obj(*list, GFP_KERNEL); + list = kzalloc_obj(*list); if (!list) return 0; @@ -466,7 +466,7 @@ static struct rect_list *npcm_video_new_rect(struct npcm_video *video, struct rect_list *list = NULL; struct v4l2_rect *r; - list = kzalloc_obj(*list, GFP_KERNEL); + list = kzalloc_obj(*list); if (!list) return NULL; @@ -1733,7 +1733,7 @@ static int npcm_video_init(struct npcm_video *video) static int npcm_video_probe(struct platform_device *pdev) { - struct npcm_video *video = kzalloc_obj(*video, GFP_KERNEL); + struct npcm_video *video = kzalloc_obj(*video); int rc; void __iomem *regs; diff --git a/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c b/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c index 4e4b8c09d5be..7752064be783 100644 --- a/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +++ b/drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c @@ -115,7 +115,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unmap; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto err_unmap; diff --git a/drivers/media/platform/nvidia/tegra-vde/vde.c b/drivers/media/platform/nvidia/tegra-vde/vde.c index a1d4a1ab12f9..2b3898828304 100644 --- a/drivers/media/platform/nvidia/tegra-vde/vde.c +++ b/drivers/media/platform/nvidia/tegra-vde/vde.c @@ -61,7 +61,7 @@ int tegra_vde_alloc_bo(struct tegra_vde *vde, struct tegra_vde_bo *bo; int err; - bo = kzalloc_obj(*bo, GFP_KERNEL); + bo = kzalloc_obj(*bo); if (!bo) return -ENOMEM; diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c index cf20f1ffc1d1..bdebbe3f4198 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -601,7 +601,7 @@ static int dw100_open(struct file *file) struct v4l2_pix_format_mplane *pix_fmt; int ret, i; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index 100320ddf545..b442dcba02e7 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -2200,7 +2200,7 @@ static int mxc_jpeg_open(struct file *file) struct mxc_jpeg_ctx *ctx; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index ad31a3459b94..740fcd8fb952 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -1646,7 +1646,7 @@ static int pxp_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto open_unlock; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c index 2cd014a79006..605a45124103 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c @@ -189,7 +189,7 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd, * pipelines by default. */ routing.num_routes = min(xbar->num_sinks - 1, xbar->num_sources); - routes = kzalloc_objs(*routes, routing.num_routes, GFP_KERNEL); + routes = kzalloc_objs(*routes, routing.num_routes); if (!routes) return -ENOMEM; @@ -454,11 +454,11 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi) xbar->num_sources = isi->pdata->num_channels; num_pads = xbar->num_sinks + xbar->num_sources; - xbar->pads = kzalloc_objs(*xbar->pads, num_pads, GFP_KERNEL); + xbar->pads = kzalloc_objs(*xbar->pads, num_pads); if (!xbar->pads) return -ENOMEM; - xbar->inputs = kzalloc_objs(*xbar->inputs, xbar->num_sinks, GFP_KERNEL); + xbar->inputs = kzalloc_objs(*xbar->inputs, xbar->num_sinks); if (!xbar->inputs) { ret = -ENOMEM; goto err_free; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c index e6ad1044b954..a39ad7a1ab18 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c @@ -624,7 +624,7 @@ static int mxc_isi_m2m_open(struct file *file) struct mxc_isi_m2m_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/nxp/mx2_emmaprp.c b/drivers/media/platform/nxp/mx2_emmaprp.c index 8f588688f049..d51a62100778 100644 --- a/drivers/media/platform/nxp/mx2_emmaprp.c +++ b/drivers/media/platform/nxp/mx2_emmaprp.c @@ -718,7 +718,7 @@ static int emmaprp_open(struct file *file) struct emmaprp_dev *pcdev = video_drvdata(file); struct emmaprp_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c index f0fdba0ae987..9151f43bc6b9 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -342,7 +342,7 @@ static int iris_create_internal_buffer(struct iris_inst *inst, if (!buffers->size) return 0; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return -ENOMEM; diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c index abffd20cf25b..e42d17653c2c 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c @@ -1087,5 +1087,5 @@ void iris_hfi_gen1_command_ops_init(struct iris_core *core) struct iris_inst *iris_hfi_gen1_get_instance(void) { - return kzalloc_obj(struct iris_inst, GFP_KERNEL); + return kzalloc_obj(struct iris_inst); } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c index d45cecd5e544..30bfd90d423b 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -1329,7 +1329,7 @@ struct iris_inst *iris_hfi_gen2_get_instance(void) struct iris_inst_hfi_gen2 *out; /* The allocation is intentionally larger than struct iris_inst. */ - out = kzalloc_obj(*out, GFP_KERNEL); + out = kzalloc_obj(*out); return &out->inst; } diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c index 3cfbdc04d3a9..719217399a30 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -21,8 +21,8 @@ int iris_vdec_inst_init(struct iris_inst *inst) struct iris_core *core = inst->core; struct v4l2_format *f; - inst->fmt_src = kzalloc_obj(*inst->fmt_src, GFP_KERNEL); - inst->fmt_dst = kzalloc_obj(*inst->fmt_dst, GFP_KERNEL); + inst->fmt_src = kzalloc_obj(*inst->fmt_src); + inst->fmt_dst = kzalloc_obj(*inst->fmt_dst); inst->fw_min_count = MIN_BUFFERS; diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c index d3531a3cc2a2..aa27b22704eb 100644 --- a/drivers/media/platform/qcom/iris/iris_venc.c +++ b/drivers/media/platform/qcom/iris/iris_venc.c @@ -19,8 +19,8 @@ int iris_venc_inst_init(struct iris_inst *inst) struct iris_core *core = inst->core; struct v4l2_format *f; - inst->fmt_src = kzalloc_obj(*inst->fmt_src, GFP_KERNEL); - inst->fmt_dst = kzalloc_obj(*inst->fmt_dst, GFP_KERNEL); + inst->fmt_src = kzalloc_obj(*inst->fmt_src); + inst->fmt_dst = kzalloc_obj(*inst->fmt_dst); if (!inst->fmt_src || !inst->fmt_dst) { kfree(inst->fmt_src); kfree(inst->fmt_dst); diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index db3536956131..7e639760c41d 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -213,7 +213,7 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) if (core->res->hfi_version != HFI_VERSION_1XX) return 0; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; @@ -329,7 +329,7 @@ static int venus_add_dynamic_nodes(struct venus_core *core) struct device *dev = core->dev; int ret; - core->ocs = kmalloc_obj(*core->ocs, GFP_KERNEL); + core->ocs = kmalloc_obj(*core->ocs); if (!core->ocs) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index f4223470f0dd..747c388fe25f 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -192,7 +192,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) count = hfi_bufreq_get_count_min(&bufreq, ver); for (i = 0; i < count; i++) { - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) { ret = -ENOMEM; goto fail; @@ -248,7 +248,7 @@ static int intbufs_set_buffer(struct venus_inst *inst, u32 type) return 0; for (i = 0; i < bufreq.count_actual; i++) { - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) { ret = -ENOMEM; goto fail; diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index a6cf17e379f7..bd82066bb6e7 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1702,7 +1702,7 @@ int venus_hfi_create(struct venus_core *core) struct venus_hfi_device *hdev; int ret; - hdev = kzalloc_obj(*hdev, GFP_KERNEL); + hdev = kzalloc_obj(*hdev); if (!hdev) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 3f46e2d8ccce..daa8f56610c7 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1684,7 +1684,7 @@ static int vdec_open(struct file *file) struct venus_inst *inst; int ret; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 32185f29eee5..bf53267cb68d 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1466,7 +1466,7 @@ static int venc_open(struct file *file) struct venus_inst *inst; int ret; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c index a02a966d9c3b..8375ed3e97b9 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c @@ -2279,7 +2279,7 @@ static int cfe_probe(struct platform_device *pdev) char debugfs_name[32]; int ret; - cfe = kzalloc_obj(*cfe, GFP_KERNEL); + cfe = kzalloc_obj(*cfe); if (!cfe) return -ENOMEM; diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c index 36421defa598..c8d564aa1eba 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c @@ -128,7 +128,7 @@ static int rvin_group_get(struct rvin_dev *vin, group = rvin_group_data; kref_get(&group->refcount); } else { - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) { ret = -ENOMEM; goto err_group; diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c index 791cff4a48ea..013e0666170a 100644 --- a/drivers/media/platform/renesas/rcar_fdp1.c +++ b/drivers/media/platform/renesas/rcar_fdp1.c @@ -2078,7 +2078,7 @@ static int fdp1_open(struct file *file) if (mutex_lock_interruptible(&fdp1->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto done; diff --git a/drivers/media/platform/renesas/rcar_jpu.c b/drivers/media/platform/renesas/rcar_jpu.c index 3a3aa6bba9d2..93d54325e420 100644 --- a/drivers/media/platform/renesas/rcar_jpu.c +++ b/drivers/media/platform/renesas/rcar_jpu.c @@ -1212,7 +1212,7 @@ static int jpu_open(struct file *file) struct jpu_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index a827a4cf6826..65f7659a9e02 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1616,7 +1616,7 @@ static int ceu_probe(struct platform_device *pdev) int num_subdevs; int ret; - ceudev = kzalloc_obj(*ceudev, GFP_KERNEL); + ceudev = kzalloc_obj(*ceudev); if (!ceudev) return -ENOMEM; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_dl.c b/drivers/media/platform/renesas/vsp1/vsp1_dl.c index f6b5623bf7d5..6c5578d9d2de 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_dl.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_dl.c @@ -259,7 +259,7 @@ vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies, size_t dlb_size; unsigned int i; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -274,7 +274,7 @@ vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies, dlb_size = num_entries * sizeof(struct vsp1_dl_entry) + extra_size; pool->size = dlb_size * num_bodies; - pool->bodies = kzalloc_objs(*pool->bodies, num_bodies, GFP_KERNEL); + pool->bodies = kzalloc_objs(*pool->bodies, num_bodies); if (!pool->bodies) { kfree(pool); return NULL; @@ -434,7 +434,7 @@ vsp1_dl_cmd_pool_create(struct vsp1_device *vsp1, enum vsp1_extcmd_type type, unsigned int i; size_t cmd_size; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -443,7 +443,7 @@ vsp1_dl_cmd_pool_create(struct vsp1_device *vsp1, enum vsp1_extcmd_type type, spin_lock_init(&pool->lock); INIT_LIST_HEAD(&pool->free); - pool->cmds = kzalloc_objs(*pool->cmds, num_cmds, GFP_KERNEL); + pool->cmds = kzalloc_objs(*pool->cmds, num_cmds); if (!pool->cmds) { kfree(pool); return NULL; @@ -557,7 +557,7 @@ static struct vsp1_dl_list *vsp1_dl_list_alloc(struct vsp1_dl_manager *dlm) struct vsp1_dl_list *dl; size_t header_offset; - dl = kzalloc_obj(*dl, GFP_KERNEL); + dl = kzalloc_obj(*dl); if (!dl) return NULL; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c index e1f1c2a933ab..706684f9b86a 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_video.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c @@ -565,7 +565,7 @@ static struct vsp1_pipeline *vsp1_video_pipeline_get(struct vsp1_video *video) * when the last reference is released. */ if (!video->rwpf->entity.pipe) { - pipe = kzalloc_obj(*pipe, GFP_KERNEL); + pipe = kzalloc_obj(*pipe); if (!pipe) return ERR_PTR(-ENOMEM); @@ -1074,7 +1074,7 @@ static int vsp1_video_open(struct file *file) struct v4l2_fh *vfh; int ret = 0; - vfh = kzalloc_obj(*vfh, GFP_KERNEL); + vfh = kzalloc_obj(*vfh); if (vfh == NULL) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c index 736072635ed5..fea63b94c5f3 100644 --- a/drivers/media/platform/rockchip/rga/rga.c +++ b/drivers/media/platform/rockchip/rga/rga.c @@ -370,7 +370,7 @@ static int rga_open(struct file *file) struct rga_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->rga = rga; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c index 377607c94092..d3202cecb988 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-h264.c @@ -375,7 +375,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c index abb695ebe258..ac8b825d080a 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c @@ -528,7 +528,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) struct rkvdec_hevc_priv_tbl *priv_tbl; struct rkvdec_hevc_ctx *hevc_ctx; - hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c index 218377f91a0b..b961fddc8583 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c @@ -383,7 +383,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c index b5f20c8d4285..fe6414a17551 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c @@ -551,7 +551,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) if (ret) return ret; - hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c index bb53163efe41..97f1efde2e47 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-h264.c @@ -447,7 +447,7 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) if (ret) return ret; - h264_ctx = kzalloc_obj(*h264_ctx, GFP_KERNEL); + h264_ctx = kzalloc_obj(*h264_ctx); if (!h264_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c index 0e5a58e48608..96d938ee70b0 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c @@ -559,7 +559,7 @@ static int rkvdec_hevc_start(struct rkvdec_ctx *ctx) if (ret) return ret; - hevc_ctx = kzalloc_obj(*hevc_ctx, GFP_KERNEL); + hevc_ctx = kzalloc_obj(*hevc_ctx); if (!hevc_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c index 1e66333e4589..e4cdd2122873 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c @@ -971,7 +971,7 @@ static int rkvdec_vp9_start(struct rkvdec_ctx *ctx) unsigned char *count_tbl; int ret; - vp9_ctx = kzalloc_obj(*vp9_ctx, GFP_KERNEL); + vp9_ctx = kzalloc_obj(*vp9_ctx); if (!vp9_ctx) return -ENOMEM; diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c index 2d4493434077..1d1e9bfef8e9 100644 --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c @@ -1282,7 +1282,7 @@ static int rkvdec_open(struct file *filp) struct rkvdec_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c b/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c index 9d15a2115c23..3c7cc00c9803 100644 --- a/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c @@ -612,7 +612,7 @@ static int gsc_m2m_open(struct file *file) if (mutex_lock_interruptible(&gsc->lock)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index 0b8327e4a875..d85811f4b8c5 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -1718,7 +1718,7 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, struct fimc_ctx *ctx; int ret = -ENOMEM; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index 2aa9c22df72b..81deafecf1d7 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -616,7 +616,7 @@ static int fimc_m2m_open(struct file *file) if (test_bit(ST_CAPT_BUSY, &fimc->state)) goto unlock; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c index 56d8b7cd3b5a..2e08c4435859 100644 --- a/drivers/media/platform/samsung/exynos4-is/media-dev.c +++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c @@ -373,7 +373,7 @@ static struct exynos_media_pipeline *fimc_md_pipeline_create( { struct fimc_pipeline *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return NULL; diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c index a1d6315d8c4a..a18b13db19d5 100644 --- a/drivers/media/platform/samsung/s5p-g2d/g2d.c +++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c @@ -237,7 +237,7 @@ static int g2d_open(struct file *file) struct g2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c index 68250d7bb02d..fdc9d7e0be66 100644 --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c @@ -953,7 +953,7 @@ static int s5p_jpeg_open(struct file *file) struct s5p_jpeg_fmt *out_fmt, *cap_fmt; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index e79441f01a51..32eb402d439c 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -794,7 +794,7 @@ static int s5p_mfc_open(struct file *file) } dev->num_inst++; /* It is guarded by mfc_mutex in vfd */ /* Allocate memory for context */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c index 6f7b3f0db48e..ee6d686cba49 100644 --- a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c @@ -583,7 +583,7 @@ static int bdisp_open(struct file *file) return -ERESTARTSYS; /* Allocate memory for both context and node */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto unlock; diff --git a/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c b/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c index ed05feac6944..58a529ed8d95 100644 --- a/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c +++ b/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c @@ -324,7 +324,7 @@ static int delta_mjpeg_open(struct delta_ctx *pctx) { struct delta_mjpeg_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; pctx->priv = ctx; diff --git a/drivers/media/platform/st/sti/delta/delta-v4l2.c b/drivers/media/platform/st/sti/delta/delta-v4l2.c index b3fb25bd0f60..7dd27de37b78 100644 --- a/drivers/media/platform/st/sti/delta/delta-v4l2.c +++ b/drivers/media/platform/st/sti/delta/delta-v4l2.c @@ -164,7 +164,7 @@ static void delta_push_dts(struct delta_ctx *ctx, u64 val) { struct delta_dts *dts; - dts = kzalloc_obj(*dts, GFP_KERNEL); + dts = kzalloc_obj(*dts); if (!dts) return; @@ -1629,7 +1629,7 @@ static int delta_open(struct file *file) mutex_lock(&delta->lock); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto err; diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c index 4b2100b7242b..645e4f155dd0 100644 --- a/drivers/media/platform/st/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c @@ -1165,7 +1165,7 @@ static int hva_open(struct file *file) struct hva_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { ret = -ENOMEM; goto out; diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c index fb11794c6b17..a3ad19256859 100644 --- a/drivers/media/platform/st/stm32/dma2d/dma2d.c +++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c @@ -280,7 +280,7 @@ static int dma2d_open(struct file *file) struct dma2d_ctx *ctx = NULL; int ret = 0; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->dev = dev; diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c index ccf3c19883c0..a42f43d19f9e 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c @@ -867,7 +867,7 @@ struct dcmipp_ent_device *dcmipp_bytecap_ent_init(struct device *dev, int ret = 0; /* Allocate the dcmipp_bytecap_device struct */ - vcap = kzalloc_obj(*vcap, GFP_KERNEL); + vcap = kzalloc_obj(*vcap); if (!vcap) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c index 4704cc4d6111..0c7aeb0888f6 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c @@ -581,7 +581,7 @@ dcmipp_byteproc_ent_init(struct device *dev, const char *entity_name, int ret; /* Allocate the byteproc struct */ - byteproc = kzalloc_obj(*byteproc, GFP_KERNEL); + byteproc = kzalloc_obj(*byteproc); if (!byteproc) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c index f6e83e72c940..99bcb2a71f77 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c @@ -20,7 +20,7 @@ struct media_pad *dcmipp_pads_init(u16 num_pads, const unsigned long *pads_flags unsigned int i; /* Allocate memory for the pads */ - pads = kzalloc_objs(*pads, num_pads, GFP_KERNEL); + pads = kzalloc_objs(*pads, num_pads); if (!pads) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c index ac19ed966521..7d3f5857cbfe 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c @@ -527,7 +527,7 @@ struct dcmipp_ent_device *dcmipp_inp_ent_init(struct device *dev, int ret; /* Allocate the inp struct */ - inp = kzalloc_obj(*inp, GFP_KERNEL); + inp = kzalloc_obj(*inp); if (!inp) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index a2e4dae765ee..f4075576ef1d 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -709,7 +709,7 @@ static int deinterlace_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index 05b51e5fc01f..12e438c678f9 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -642,7 +642,7 @@ static int rotate_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/media/platform/ti/cal/cal.c b/drivers/media/platform/ti/cal/cal.c index c0883b948cbc..b7e77b6b8950 100644 --- a/drivers/media/platform/ti/cal/cal.c +++ b/drivers/media/platform/ti/cal/cal.c @@ -1012,7 +1012,7 @@ static struct cal_ctx *cal_ctx_create(struct cal_dev *cal, int inst) struct cal_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c index f0d724efb494..cc0b0b8cdb89 100644 --- a/drivers/media/platform/ti/davinci/vpif.c +++ b/drivers/media/platform/ti/davinci/vpif.c @@ -450,7 +450,7 @@ static int vpif_probe(struct platform_device *pdev) if (IS_ERR(vpif_base)) return PTR_ERR(vpif_base); - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -482,7 +482,7 @@ static int vpif_probe(struct platform_device *pdev) res_irq = DEFINE_RES_IRQ_NAMED(irq, of_node_full_name(pdev->dev.of_node)); res_irq.flags |= irq_get_trigger_type(irq); - pdev_capture = kzalloc_obj(*pdev_capture, GFP_KERNEL); + pdev_capture = kzalloc_obj(*pdev_capture); if (!pdev_capture) { ret = -ENOMEM; goto err_put_rpm; @@ -501,7 +501,7 @@ static int vpif_probe(struct platform_device *pdev) if (ret) goto err_put_pdev_capture; - pdev_display = kzalloc_obj(*pdev_display, GFP_KERNEL); + pdev_display = kzalloc_obj(*pdev_display); if (!pdev_display) { ret = -ENOMEM; goto err_del_pdev_capture; diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index 6b7d19a7529a..15df3ea2f77e 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1335,7 +1335,7 @@ static int initialize_vpif(void) /* Allocate memory for six channel objects */ for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { - vpif_obj.dev[i] = kzalloc_obj(*vpif_obj.dev[i], GFP_KERNEL); + vpif_obj.dev[i] = kzalloc_obj(*vpif_obj.dev[i]); /* If memory allocation fails, return error */ if (!vpif_obj.dev[i]) { free_channel_objects_index = i; @@ -1650,7 +1650,7 @@ static int vpif_probe(struct platform_device *pdev) vpif_obj.config = pdev->dev.platform_data; subdev_count = vpif_obj.config->subdev_count; - vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count, GFP_KERNEL); + vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count); if (!vpif_obj.sd) { err = -ENOMEM; goto probe_subdev_out; diff --git a/drivers/media/platform/ti/davinci/vpif_display.c b/drivers/media/platform/ti/davinci/vpif_display.c index b8349ebcde33..08877ae1513a 100644 --- a/drivers/media/platform/ti/davinci/vpif_display.c +++ b/drivers/media/platform/ti/davinci/vpif_display.c @@ -1089,7 +1089,7 @@ static int initialize_vpif(void) /* Allocate memory for six channel objects */ for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { vpif_obj.dev[i] = - kzalloc_obj(struct channel_obj, GFP_KERNEL); + kzalloc_obj(struct channel_obj); /* If memory allocation fails, return error */ if (!vpif_obj.dev[i]) { free_channel_objects_index = i; @@ -1264,7 +1264,7 @@ static int vpif_probe(struct platform_device *pdev) vpif_obj.config = pdev->dev.platform_data; subdev_count = vpif_obj.config->subdev_count; subdevdata = vpif_obj.config->subdevinfo; - vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count, GFP_KERNEL); + vpif_obj.sd = kzalloc_objs(*vpif_obj.sd, subdev_count); if (!vpif_obj.sd) { err = -ENOMEM; goto vpif_unregister; diff --git a/drivers/media/platform/ti/omap/omap_vout.c b/drivers/media/platform/ti/omap/omap_vout.c index b88c78d724d6..8d0319a37ba8 100644 --- a/drivers/media/platform/ti/omap/omap_vout.c +++ b/drivers/media/platform/ti/omap/omap_vout.c @@ -1452,7 +1452,7 @@ static int __init omap_vout_create_video_devices(struct platform_device *pdev) for (k = 0; k < pdev->num_resources; k++) { - vout = kzalloc_obj(struct omap_vout_device, GFP_KERNEL); + vout = kzalloc_obj(struct omap_vout_device); if (!vout) { dev_err(&pdev->dev, ": could not allocate memory\n"); return -ENOMEM; @@ -1611,7 +1611,7 @@ static int __init omap_vout_probe(struct platform_device *pdev) goto err_dss_init; } - vid_dev = kzalloc_obj(struct omap2video_device, GFP_KERNEL); + vid_dev = kzalloc_obj(struct omap2video_device); if (vid_dev == NULL) { ret = -ENOMEM; goto err_dss_init; diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c index 23a433455459..8214f8ef2da8 100644 --- a/drivers/media/platform/ti/omap3isp/isp.c +++ b/drivers/media/platform/ti/omap3isp/isp.c @@ -2231,7 +2231,7 @@ static int isp_probe(struct platform_device *pdev) int ret; int i, m; - isp = kzalloc_obj(*isp, GFP_KERNEL); + isp = kzalloc_obj(*isp); if (!isp) { dev_err(&pdev->dev, "could not allocate memory\n"); return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispccdc.c b/drivers/media/platform/ti/omap3isp/ispccdc.c index 2e2daadbd575..4708b6303493 100644 --- a/drivers/media/platform/ti/omap3isp/ispccdc.c +++ b/drivers/media/platform/ti/omap3isp/ispccdc.c @@ -419,7 +419,7 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc, return -EINVAL; } - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (req == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/isph3a_aewb.c b/drivers/media/platform/ti/omap3isp/isph3a_aewb.c index 1da1b71773bb..6674718dffc8 100644 --- a/drivers/media/platform/ti/omap3isp/isph3a_aewb.c +++ b/drivers/media/platform/ti/omap3isp/isph3a_aewb.c @@ -291,7 +291,7 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) struct omap3isp_h3a_aewb_config *aewb_recover_cfg = NULL; int ret; - aewb_cfg = kzalloc_obj(*aewb_cfg, GFP_KERNEL); + aewb_cfg = kzalloc_obj(*aewb_cfg); if (!aewb_cfg) return -ENOMEM; @@ -301,7 +301,7 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) aewb->isp = isp; /* Set recover state configuration */ - aewb_recover_cfg = kzalloc_obj(*aewb_recover_cfg, GFP_KERNEL); + aewb_recover_cfg = kzalloc_obj(*aewb_recover_cfg); if (!aewb_recover_cfg) { dev_err(aewb->isp->dev, "AEWB: cannot allocate memory for recover configuration.\n"); diff --git a/drivers/media/platform/ti/omap3isp/isph3a_af.c b/drivers/media/platform/ti/omap3isp/isph3a_af.c index ff806d162529..52fb4122a3b4 100644 --- a/drivers/media/platform/ti/omap3isp/isph3a_af.c +++ b/drivers/media/platform/ti/omap3isp/isph3a_af.c @@ -354,7 +354,7 @@ int omap3isp_h3a_af_init(struct isp_device *isp) struct omap3isp_h3a_af_config *af_recover_cfg = NULL; int ret; - af_cfg = kzalloc_obj(*af_cfg, GFP_KERNEL); + af_cfg = kzalloc_obj(*af_cfg); if (af_cfg == NULL) return -ENOMEM; @@ -364,7 +364,7 @@ int omap3isp_h3a_af_init(struct isp_device *isp) af->isp = isp; /* Set recover state configuration */ - af_recover_cfg = kzalloc_obj(*af_recover_cfg, GFP_KERNEL); + af_recover_cfg = kzalloc_obj(*af_recover_cfg); if (!af_recover_cfg) { dev_err(af->isp->dev, "AF: cannot allocate memory for recover configuration.\n"); diff --git a/drivers/media/platform/ti/omap3isp/isphist.c b/drivers/media/platform/ti/omap3isp/isphist.c index 8459fd9d5fc4..fbfdcbfdb050 100644 --- a/drivers/media/platform/ti/omap3isp/isphist.c +++ b/drivers/media/platform/ti/omap3isp/isphist.c @@ -477,7 +477,7 @@ int omap3isp_hist_init(struct isp_device *isp) struct omap3isp_hist_config *hist_cfg; int ret; - hist_cfg = kzalloc_obj(*hist_cfg, GFP_KERNEL); + hist_cfg = kzalloc_obj(*hist_cfg); if (hist_cfg == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index ad34cc2c6f05..63faa3d305dc 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -1047,7 +1047,7 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name, { int ret; - stat->buf = kzalloc_objs(*stat->buf, STAT_MAX_BUFS, GFP_KERNEL); + stat->buf = kzalloc_objs(*stat->buf, STAT_MAX_BUFS); if (!stat->buf) return -ENOMEM; diff --git a/drivers/media/platform/ti/omap3isp/ispvideo.c b/drivers/media/platform/ti/omap3isp/ispvideo.c index f2a48387d158..64e76e3576a8 100644 --- a/drivers/media/platform/ti/omap3isp/ispvideo.c +++ b/drivers/media/platform/ti/omap3isp/ispvideo.c @@ -1371,7 +1371,7 @@ static int isp_video_open(struct file *file) struct vb2_queue *queue; int ret = 0; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (handle == NULL) return -ENOMEM; diff --git a/drivers/media/platform/ti/vpe/vip.c b/drivers/media/platform/ti/vpe/vip.c index 33805f3b0a81..a4b616a5ece7 100644 --- a/drivers/media/platform/ti/vpe/vip.c +++ b/drivers/media/platform/ti/vpe/vip.c @@ -3035,7 +3035,7 @@ static int alloc_stream(struct vip_port *port, int stream_id, int vfl_type) struct list_head *pos, *tmp; int ret, i; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/drivers/media/platform/ti/vpe/vpe.c b/drivers/media/platform/ti/vpe/vpe.c index 5effa0558f0f..a7e5a85e72a1 100644 --- a/drivers/media/platform/ti/vpe/vpe.c +++ b/drivers/media/platform/ti/vpe/vpe.c @@ -2272,7 +2272,7 @@ static int vpe_open(struct file *file) vpe_dbg(dev, "vpe_open\n"); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 0a14970f0472..2e81877f640f 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -640,7 +640,7 @@ static int hantro_open(struct file *filp) * helper functions used here. */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c index fe8d94906e37..1b81acba7da0 100644 --- a/drivers/media/platform/via/via-camera.c +++ b/drivers/media/platform/via/via-camera.c @@ -1164,7 +1164,7 @@ static int viacam_probe(struct platform_device *pdev) /* * Basic structure initialization. */ - cam = kzalloc_obj(struct via_camera, GFP_KERNEL); + cam = kzalloc_obj(struct via_camera); if (cam == NULL) return -ENOMEM; via_cam_info = cam; diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index dab1deea05ea..b8e0835a1998 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -338,7 +338,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, struct v4l2_device *v4l2_dev; int retval; - radio = kzalloc_obj(struct dsbr100_device, GFP_KERNEL); + radio = kzalloc_obj(struct dsbr100_device); if (!radio) return -ENOMEM; diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 5a477ac9487b..1395f76b01dd 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -67,7 +67,7 @@ struct rtrack { static struct radio_isa_card *rtrack_alloc(void) { - struct rtrack *rt = kzalloc_obj(struct rtrack, GFP_KERNEL); + struct rtrack *rt = kzalloc_obj(struct rtrack); if (rt) rt->curvol = 0xff; diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 4e4721ed61e7..175ef2b0c6f4 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c @@ -82,7 +82,7 @@ static void aztech_set_pins(void *handle, u8 pins) static struct radio_isa_card *aztech_alloc(void) { - struct aztech *az = kzalloc_obj(*az, GFP_KERNEL); + struct aztech *az = kzalloc_obj(*az); return az ? &az->isa : NULL; } diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 5f2637ffabae..3d1d0b46195b 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -179,7 +179,7 @@ static unsigned long gemtek_convfreq(unsigned long freq) static struct radio_isa_card *gemtek_alloc(void) { - struct gemtek *gt = kzalloc_obj(*gt, GFP_KERNEL); + struct gemtek *gt = kzalloc_obj(*gt); if (gt) gt->muted = true; diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index a26da2e9fbab..8cfef3a778cf 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c @@ -311,7 +311,7 @@ static int usb_keene_probe(struct usb_interface *intf, if (dev->product && strcmp(dev->product, "B-LINK USB Audio ")) return -ENODEV; - radio = kzalloc_obj(struct keene_device, GFP_KERNEL); + radio = kzalloc_obj(struct keene_device); if (radio) radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c index e768c40ab73d..11c5d103c4c5 100644 --- a/drivers/media/radio/radio-ma901.c +++ b/drivers/media/radio/radio-ma901.c @@ -346,7 +346,7 @@ static int usb_ma901radio_probe(struct usb_interface *intf, || strncmp(dev->manufacturer, "www.masterkit.ru", 16) != 0)) return -ENODEV; - radio = kzalloc_obj(struct ma901radio_device, GFP_KERNEL); + radio = kzalloc_obj(struct ma901radio_device); if (!radio) { dev_err(&intf->dev, "kzalloc for ma901radio_device failed\n"); retval = -ENOMEM; diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index cfa0568791fd..8ab1dacf89aa 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -122,7 +122,7 @@ static int maxiradio_probe(struct pci_dev *pdev, struct v4l2_device *v4l2_dev; int retval = -ENOMEM; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { dev_err(&pdev->dev, "not enough memory\n"); return -ENOMEM; diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 2e74f915c873..d5a6053e1d53 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -501,7 +501,7 @@ static int usb_amradio_probe(struct usb_interface *intf, struct amradio_device *radio; int retval; - radio = kzalloc_obj(struct amradio_device, GFP_KERNEL); + radio = kzalloc_obj(struct amradio_device); if (!radio) { dev_err(&intf->dev, "kmalloc for amradio_device failed\n"); diff --git a/drivers/media/radio/radio-raremono.c b/drivers/media/radio/radio-raremono.c index 45b491ad1601..6aa7c09780f4 100644 --- a/drivers/media/radio/radio-raremono.c +++ b/drivers/media/radio/radio-raremono.c @@ -301,7 +301,7 @@ static int usb_raremono_probe(struct usb_interface *intf, struct raremono_device *radio; int retval = 0; - radio = kzalloc_obj(*radio, GFP_KERNEL); + radio = kzalloc_obj(*radio); if (!radio) return -ENOMEM; radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index 1e24e2d9cbbc..2891446901a0 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c @@ -47,7 +47,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device numbers"); static struct radio_isa_card *rtrack2_alloc(void) { - return kzalloc_obj(struct radio_isa_card, GFP_KERNEL); + return kzalloc_obj(struct radio_isa_card); } static void zero(struct radio_isa_card *isa) diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index cdd489ca2d9a..2cc91e576fcd 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -252,7 +252,7 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) static int fmr2_isa_match(struct device *pdev, unsigned int ndev) { - struct fmr2 *fmr2 = kzalloc_obj(*fmr2, GFP_KERNEL); + struct fmr2 *fmr2 = kzalloc_obj(*fmr2); if (!fmr2) return 0; @@ -269,7 +269,7 @@ static int fmr2_isa_match(struct device *pdev, unsigned int ndev) static int fmr2_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *id) { int ret; - struct fmr2 *fmr2 = kzalloc_obj(*fmr2, GFP_KERNEL); + struct fmr2 *fmr2 = kzalloc_obj(*fmr2); if (!fmr2) return -ENOMEM; diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c index 381196d6c675..c1f356c5f41e 100644 --- a/drivers/media/radio/radio-shark.c +++ b/drivers/media/radio/radio-shark.c @@ -327,7 +327,7 @@ static int usb_shark_probe(struct usb_interface *intf, return -EINVAL; } - shark = kzalloc_obj(struct shark_device, GFP_KERNEL); + shark = kzalloc_obj(struct shark_device); if (!shark) return retval; diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c index 9e1d00d6bac1..7cc173e21074 100644 --- a/drivers/media/radio/radio-shark2.c +++ b/drivers/media/radio/radio-shark2.c @@ -293,7 +293,7 @@ static int usb_shark_probe(struct usb_interface *intf, return -EINVAL; } - shark = kzalloc_obj(struct shark_device, GFP_KERNEL); + shark = kzalloc_obj(struct shark_device); if (!shark) return retval; diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index ec953b8cb7ab..156cca2866aa 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c @@ -420,7 +420,7 @@ static int tea5764_i2c_probe(struct i2c_client *client) int ret; PDEBUG("probe"); - radio = kzalloc_obj(struct tea5764_device, GFP_KERNEL); + radio = kzalloc_obj(struct tea5764_device); if (!radio) return -ENOMEM; diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index a160bcc2643f..9231a19d5544 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -56,7 +56,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device number"); static struct radio_isa_card *terratec_alloc(void) { - return kzalloc_obj(struct radio_isa_card, GFP_KERNEL); + return kzalloc_obj(struct radio_isa_card); } static int terratec_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol) diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index 31d5e5efafaa..c7b30d430a70 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c @@ -55,7 +55,7 @@ struct trust { static struct radio_isa_card *trust_alloc(void) { - struct trust *tr = kzalloc_obj(*tr, GFP_KERNEL); + struct trust *tr = kzalloc_obj(*tr); return tr ? &tr->isa : NULL; } diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index 4c49d9103135..3454c9a6fda3 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c @@ -75,7 +75,7 @@ struct typhoon { static struct radio_isa_card *typhoon_alloc(void) { - struct typhoon *ty = kzalloc_obj(*ty, GFP_KERNEL); + struct typhoon *ty = kzalloc_obj(*ty); return ty ? &ty->isa : NULL; } diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index cf1a823e0aa9..b92b249737a4 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c @@ -79,7 +79,7 @@ struct zoltrix { static struct radio_isa_card *zoltrix_alloc(void) { - struct zoltrix *zol = kzalloc_obj(*zol, GFP_KERNEL); + struct zoltrix *zol = kzalloc_obj(*zol); return zol ? &zol->isa : NULL; } diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c index 71850c3b02a4..9572a866defb 100644 --- a/drivers/media/radio/saa7706h.c +++ b/drivers/media/radio/saa7706h.c @@ -344,7 +344,7 @@ static int saa7706h_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%02x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc_obj(struct saa7706h_state, GFP_KERNEL); + state = kzalloc_obj(struct saa7706h_state); if (state == NULL) return -ENOMEM; sd = &state->sd; diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 79208c0b5c4a..318b5f6d4202 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -570,7 +570,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, unsigned char version_warning = 0; /* private data allocation and initialization */ - radio = kzalloc_obj(struct si470x_device, GFP_KERNEL); + radio = kzalloc_obj(struct si470x_device); if (!radio) { retval = -ENOMEM; goto err_initial; diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index a4bfda695413..6e6764143e21 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -420,7 +420,7 @@ static int usb_si4713_probe(struct usb_interface *intf, id->idVendor, id->idProduct); /* Initialize local device structure */ - radio = kzalloc_obj(struct si4713_usb_device, GFP_KERNEL); + radio = kzalloc_obj(struct si4713_usb_device); if (radio) radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL); diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c index 7f95498a5551..3a6d7926e856 100644 --- a/drivers/media/radio/tef6862.c +++ b/drivers/media/radio/tef6862.c @@ -153,7 +153,7 @@ static int tef6862_probe(struct i2c_client *client) v4l_info(client, "chip found @ 0x%02x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc_obj(struct tef6862_state, GFP_KERNEL); + state = kzalloc_obj(struct tef6862_state); if (state == NULL) return -ENOMEM; state->freq = TEF6862_LO_FREQ; diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 6bde5c913e99..78abe810a88e 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -839,7 +839,7 @@ static int ati_remote_probe(struct usb_interface *interface, return -ENODEV; } - ati_remote = kzalloc_obj(struct ati_remote, GFP_KERNEL); + ati_remote = kzalloc_obj(struct ati_remote); rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE); if (!ati_remote || !rc_dev) goto exit_free_dev_rdev; diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 6e61173ba233..f8120605501a 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -993,7 +993,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) struct ene_device *dev; /* allocate memory */ - dev = kzalloc_obj(struct ene_device, GFP_KERNEL); + dev = kzalloc_obj(struct ene_device); rdev = rc_allocate_device(RC_DRIVER_IR_RAW); if (!dev || !rdev) goto exit_free_dev_rdev; diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 92a38d04d979..f7cfa8a073eb 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -465,7 +465,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id struct rc_dev *rdev; int ret = -ENOMEM; - fintek = kzalloc_obj(struct fintek_dev, GFP_KERNEL); + fintek = kzalloc_obj(struct fintek_dev); if (!fintek) return ret; diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c index bb5bd62c8645..c508f2536243 100644 --- a/drivers/media/rc/iguanair.c +++ b/drivers/media/rc/iguanair.c @@ -392,7 +392,7 @@ static int iguanair_probe(struct usb_interface *intf, if (idesc->desc.bNumEndpoints < 2) return -ENODEV; - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !rc) { ret = -ENOMEM; diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 0cb2ad180728..7e92161105d5 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -614,7 +614,7 @@ static int send_packet(struct imon_context *ictx) ictx->tx_urb->actual_length = 0; } else { /* fill request into kmalloc'ed space: */ - control_req = kmalloc_obj(*control_req, GFP_KERNEL); + control_req = kmalloc_obj(*control_req); if (control_req == NULL) return -ENOMEM; @@ -2233,7 +2233,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf, struct usb_host_interface *iface_desc; int ret = -ENOMEM; - ictx = kzalloc_obj(*ictx, GFP_KERNEL); + ictx = kzalloc_obj(*ictx); if (!ictx) goto exit; diff --git a/drivers/media/rc/ir_toy.c b/drivers/media/rc/ir_toy.c index cf3b27817131..d6472de5da87 100644 --- a/drivers/media/rc/ir_toy.c +++ b/drivers/media/rc/ir_toy.c @@ -418,7 +418,7 @@ static int irtoy_probe(struct usb_interface *intf, return -ENODEV; } - irtoy = kzalloc_obj(*irtoy, GFP_KERNEL); + irtoy = kzalloc_obj(*irtoy); if (!irtoy) return -ENOMEM; diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 448f5c5db616..bf544517c67a 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c @@ -1304,7 +1304,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id int model_no; int io_rsrc_no; - itdev = kzalloc_obj(struct ite_dev, GFP_KERNEL); + itdev = kzalloc_obj(struct ite_dev); if (!itdev) return ret; diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 735b0630b172..183f1939b941 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -128,7 +128,7 @@ static int lirc_open(struct inode *inode, struct file *file) { struct rc_dev *dev = container_of(inode->i_cdev, struct rc_dev, lirc_cdev); - struct lirc_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); + struct lirc_fh *fh = kzalloc_obj(*fh); unsigned long flags; int retval; @@ -267,7 +267,7 @@ static ssize_t lirc_transmit(struct file *file, const char __user *buf, goto out_unlock; } - raw = kmalloc_objs(*raw, LIRCBUF_SIZE, GFP_KERNEL); + raw = kmalloc_objs(*raw, LIRCBUF_SIZE); if (!raw) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index d35fff006ac9..ed55e9ec3c57 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1715,7 +1715,7 @@ static int mceusb_dev_probe(struct usb_interface *intf, pipe = usb_rcvbulkpipe(dev, ep_in->bEndpointAddress); maxp = usb_maxpacket(dev, pipe); - ir = kzalloc_obj(struct mceusb_dev, GFP_KERNEL); + ir = kzalloc_obj(struct mceusb_dev); if (!ir) goto mem_alloc_fail; diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 4cf74ac2d76c..4e5a0c8dc9a0 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -639,7 +639,7 @@ static int nvt_ir_raw_set_wakeup_filter(struct rc_dev *dev, if (!sc_filter->mask) return 0; - raw = kmalloc_objs(*raw, WAKEUP_MAX_SIZE, GFP_KERNEL); + raw = kmalloc_objs(*raw, WAKEUP_MAX_SIZE); if (!raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index d1f8bb6af874..2e269ef5e26b 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -615,7 +615,7 @@ int ir_raw_event_prepare(struct rc_dev *dev) if (!dev) return -EINVAL; - dev->raw = kzalloc_obj(*dev->raw, GFP_KERNEL); + dev->raw = kzalloc_obj(*dev->raw); if (!dev->raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index 959a1167d376..78ac09b3cbd3 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -185,7 +185,7 @@ static int loop_set_wakeup_filter(struct rc_dev *dev, return 0; /* encode the specified filter and loop it back */ - raw = kmalloc_objs(*raw, max, GFP_KERNEL); + raw = kmalloc_objs(*raw, max); if (!raw) return -ENOMEM; diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index b67af602fbe6..821607504008 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1701,7 +1701,7 @@ struct rc_dev *rc_allocate_device(enum rc_driver_type type) { struct rc_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 2471bb4d66b8..3b917a2a8918 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -502,7 +502,7 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutus) __be32 *timeout; int ret; - timeout = kmalloc_obj(*timeout, GFP_KERNEL); + timeout = kmalloc_obj(*timeout); if (!timeout) return -ENOMEM; @@ -768,11 +768,11 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, /* rr3 will disable rc detector on transmit */ rr3->transmitting = true; - sample_lens = kzalloc_objs(*sample_lens, RR3_DRIVER_MAXLENS, GFP_KERNEL); + sample_lens = kzalloc_objs(*sample_lens, RR3_DRIVER_MAXLENS); if (!sample_lens) return -ENOMEM; - irdata = kzalloc_obj(*irdata, GFP_KERNEL); + irdata = kzalloc_obj(*irdata); if (!irdata) { ret = -ENOMEM; goto out; @@ -1020,7 +1020,7 @@ static int redrat3_dev_probe(struct usb_interface *intf, } /* allocate memory for our device state and initialize it */ - rr3 = kzalloc_obj(*rr3, GFP_KERNEL); + rr3 = kzalloc_obj(*rr3); if (!rr3) goto no_endpoints; diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 38e0db1b4964..5a18603f9a95 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -285,7 +285,7 @@ static int streamzap_probe(struct usb_interface *intf, int pipe, maxp; /* Allocate space for device driver specific data */ - sz = kzalloc_obj(struct streamzap_ir, GFP_KERNEL); + sz = kzalloc_obj(struct streamzap_ir); if (!sz) return -ENOMEM; diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index 8b70c1e809ed..110a46900114 100644 --- a/drivers/media/rc/ttusbir.c +++ b/drivers/media/rc/ttusbir.c @@ -187,7 +187,7 @@ static int ttusbir_probe(struct usb_interface *intf, int i, j, ret; int altsetting = -1; - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!tt || !rc) { ret = -ENOMEM; diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 875ead5240a5..515469dd82d4 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -1017,7 +1017,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) return -ENODEV; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/media/rc/xbox_remote.c b/drivers/media/rc/xbox_remote.c index 79c3bfe60437..3e3da70cf8da 100644 --- a/drivers/media/rc/xbox_remote.c +++ b/drivers/media/rc/xbox_remote.c @@ -213,7 +213,7 @@ static int xbox_remote_probe(struct usb_interface *interface, return -ENODEV; } - xbox_remote = kzalloc_obj(*xbox_remote, GFP_KERNEL); + xbox_remote = kzalloc_obj(*xbox_remote); rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE); if (!xbox_remote || !rc_dev) goto exit_free_dev_rdev; diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c index 352ff42b9121..36207940b689 100644 --- a/drivers/media/spi/cxd2880-spi.c +++ b/drivers/media/spi/cxd2880-spi.c @@ -516,7 +516,7 @@ cxd2880_spi_probe(struct spi_device *spi) return -EINVAL; } - dvb_spi = kzalloc_obj(struct cxd2880_dvb_spi, GFP_KERNEL); + dvb_spi = kzalloc_obj(struct cxd2880_dvb_spi); if (!dvb_spi) return -ENOMEM; diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c index d3d4bb41c8ea..318e8330f16a 100644 --- a/drivers/media/test-drivers/vicodec/vicodec-core.c +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c @@ -1836,7 +1836,7 @@ static int vicodec_open(struct file *file) if (mutex_lock_interruptible(vfd->lock)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto open_unlock; @@ -2105,7 +2105,7 @@ static int vicodec_probe(struct platform_device *pdev) struct vicodec_dev *dev; int ret; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c index 03bb7c79df47..b6203e10e37a 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -490,7 +490,7 @@ static int vidtv_bridge_probe(struct platform_device *pdev) struct vidtv_dvb *dvb; int ret; - dvb = kzalloc_obj(*dvb, GFP_KERNEL); + dvb = kzalloc_obj(*dvb); if (!dvb) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c index 4ba65853c3ed..da20657adc74 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_channel.c +++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c @@ -67,7 +67,7 @@ struct vidtv_channel const u16 s302m_beethoven_event_id = 1; struct vidtv_channel *s302m; - s302m = kzalloc_obj(*s302m, GFP_KERNEL); + s302m = kzalloc_obj(*s302m); if (!s302m) return NULL; @@ -389,7 +389,7 @@ static struct vidtv_psi_desc_service_list_entry s_desc = (struct vidtv_psi_desc_service *)desc; - curr_e = kzalloc_obj(*curr_e, GFP_KERNEL); + curr_e = kzalloc_obj(*curr_e); if (!curr_e) { vidtv_channel_destroy_service_list(head_e); return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_demod.c b/drivers/media/test-drivers/vidtv/vidtv_demod.c index 31ee6d706744..c382e9e94c32 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_demod.c +++ b/drivers/media/test-drivers/vidtv/vidtv_demod.c @@ -418,7 +418,7 @@ static int vidtv_demod_i2c_probe(struct i2c_client *client) struct vidtv_demod_state *state; /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/media/test-drivers/vidtv/vidtv_mux.c b/drivers/media/test-drivers/vidtv/vidtv_mux.c index 01bed6d82437..403fbedb8663 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_mux.c +++ b/drivers/media/test-drivers/vidtv/vidtv_mux.c @@ -50,7 +50,7 @@ static struct vidtv_mux_pid_ctx if (ctx) return ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -480,7 +480,7 @@ struct vidtv_mux *vidtv_mux_init(struct dvb_frontend *fe, { struct vidtv_mux *m; - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (!m) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c index 2cd3f5d7c142..62efe93061ab 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -285,7 +285,7 @@ struct vidtv_psi_desc_service *vidtv_psi_service_desc_init(struct vidtv_psi_desc u32 service_name_len = service_name ? strlen(service_name) : 0; u32 provider_name_len = provider_name ? strlen(provider_name) : 0; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return NULL; @@ -360,7 +360,7 @@ struct vidtv_psi_desc_network_name u32 network_name_len = network_name ? strlen(network_name) : 0; struct vidtv_psi_desc_network_name *desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return NULL; @@ -390,14 +390,14 @@ struct vidtv_psi_desc_service_list struct vidtv_psi_desc_service_list *desc; u16 length = 0; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return NULL; desc->type = SERVICE_LIST_DESCRIPTOR; while (entry) { - curr_e = kzalloc_obj(*curr_e, GFP_KERNEL); + curr_e = kzalloc_obj(*curr_e); if (!curr_e) { while (head_e) { curr_e = head_e; @@ -441,7 +441,7 @@ struct vidtv_psi_desc_short_event struct vidtv_psi_desc_short_event *desc; u32 text_len = text ? strlen(text) : 0; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return NULL; @@ -895,7 +895,7 @@ vidtv_psi_pat_program_init(struct vidtv_psi_table_pat_program *head, struct vidtv_psi_table_pat_program *program; const u16 RESERVED = 0x07; - program = kzalloc_obj(*program, GFP_KERNEL); + program = kzalloc_obj(*program); if (!program) return NULL; @@ -967,7 +967,7 @@ struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id) const u16 ZERO = 0x0; const u16 ONES = 0x03; - pat = kzalloc_obj(*pat, GFP_KERNEL); + pat = kzalloc_obj(*pat); if (!pat) return NULL; @@ -1067,7 +1067,7 @@ vidtv_psi_pmt_stream_init(struct vidtv_psi_table_pmt_stream *head, const u16 ZERO = 0x0; u16 desc_loop_len; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return NULL; @@ -1153,7 +1153,7 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number, const u16 ZERO = 0x0; u16 desc_loop_len; - pmt = kzalloc_obj(*pmt, GFP_KERNEL); + pmt = kzalloc_obj(*pmt); if (!pmt) return NULL; @@ -1298,7 +1298,7 @@ struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 network_id, const u16 ONES = 0x03; const u16 ONE = 0x1; - sdt = kzalloc_obj(*sdt, GFP_KERNEL); + sdt = kzalloc_obj(*sdt); if (!sdt) return NULL; @@ -1438,7 +1438,7 @@ struct vidtv_psi_table_sdt_service { struct vidtv_psi_table_sdt_service *service; - service = kzalloc_obj(*service, GFP_KERNEL); + service = kzalloc_obj(*service); if (!service) return NULL; @@ -1621,11 +1621,11 @@ struct vidtv_psi_table_nit const u16 ONES = 0x03; const u16 ONE = 0x1; - nit = kzalloc_obj(*nit, GFP_KERNEL); + nit = kzalloc_obj(*nit); if (!nit) return NULL; - transport = kzalloc_obj(*transport, GFP_KERNEL); + transport = kzalloc_obj(*transport); if (!transport) goto free_nit; @@ -1856,7 +1856,7 @@ struct vidtv_psi_table_eit const u16 ONE = 0x1; const u16 ONES = 0x03; - eit = kzalloc_obj(*eit, GFP_KERNEL); + eit = kzalloc_obj(*eit); if (!eit) return NULL; @@ -1981,7 +1981,7 @@ struct vidtv_psi_table_eit_event int mjd, l; __be16 mjd_be; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_s302m.c b/drivers/media/test-drivers/vidtv/vidtv_s302m.c index 1a2ffcf0796f..581497644940 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_s302m.c +++ b/drivers/media/test-drivers/vidtv/vidtv_s302m.c @@ -148,7 +148,7 @@ static struct vidtv_access_unit *vidtv_s302m_access_unit_init(struct vidtv_acces { struct vidtv_access_unit *au; - au = kzalloc_obj(*au, GFP_KERNEL); + au = kzalloc_obj(*au); if (!au) return NULL; @@ -445,7 +445,7 @@ struct vidtv_encoder struct vidtv_s302m_ctx *ctx; struct vidtv_encoder *e; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return NULL; diff --git a/drivers/media/test-drivers/vidtv/vidtv_tuner.c b/drivers/media/test-drivers/vidtv/vidtv_tuner.c index 735eb3b6824d..ee55df4029bc 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_tuner.c +++ b/drivers/media/test-drivers/vidtv/vidtv_tuner.c @@ -396,7 +396,7 @@ static int vidtv_tuner_i2c_probe(struct i2c_client *client) struct dvb_frontend *fe = config->fe; struct vidtv_tuner_dev *tuner_dev = NULL; - tuner_dev = kzalloc_obj(*tuner_dev, GFP_KERNEL); + tuner_dev = kzalloc_obj(*tuner_dev); if (!tuner_dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vim2m.c b/drivers/media/test-drivers/vim2m.c index ae091cb67794..bb2dd11eef0e 100644 --- a/drivers/media/test-drivers/vim2m.c +++ b/drivers/media/test-drivers/vim2m.c @@ -1365,7 +1365,7 @@ static int vim2m_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto open_unlock; @@ -1492,7 +1492,7 @@ static int vim2m_probe(struct platform_device *pdev) struct video_device *vfd; int ret; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/vimc/vimc-capture.c b/drivers/media/test-drivers/vimc/vimc-capture.c index e8a91f78a484..e0c6bc9f8f20 100644 --- a/drivers/media/test-drivers/vimc/vimc-capture.c +++ b/drivers/media/test-drivers/vimc/vimc-capture.c @@ -397,7 +397,7 @@ static struct vimc_ent_device *vimc_capture_add(struct vimc_device *vimc, int ret; /* Allocate the vimc_capture_device struct */ - vcapture = kzalloc_obj(*vcapture, GFP_KERNEL); + vcapture = kzalloc_obj(*vcapture); if (!vcapture) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c index 7267766662fa..c2078ea93462 100644 --- a/drivers/media/test-drivers/vimc/vimc-core.c +++ b/drivers/media/test-drivers/vimc/vimc-core.c @@ -354,7 +354,7 @@ static int vimc_probe(struct platform_device *pdev) if (vimc_allocator == VIMC_ALLOCATOR_DMA_CONTIG) dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); - vimc = kzalloc_obj(*vimc, GFP_KERNEL); + vimc = kzalloc_obj(*vimc); if (!vimc) return -ENOMEM; diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c index 9f86944a04a5..0c2e715a8a16 100644 --- a/drivers/media/test-drivers/vimc/vimc-debayer.c +++ b/drivers/media/test-drivers/vimc/vimc-debayer.c @@ -564,7 +564,7 @@ static struct vimc_ent_device *vimc_debayer_add(struct vimc_device *vimc, int ret; /* Allocate the vdebayer struct */ - vdebayer = kzalloc_obj(*vdebayer, GFP_KERNEL); + vdebayer = kzalloc_obj(*vdebayer); if (!vdebayer) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-lens.c b/drivers/media/test-drivers/vimc/vimc-lens.c index 9b7909ded8d6..a08fa3d5c52c 100644 --- a/drivers/media/test-drivers/vimc/vimc-lens.c +++ b/drivers/media/test-drivers/vimc/vimc-lens.c @@ -54,7 +54,7 @@ static struct vimc_ent_device *vimc_lens_add(struct vimc_device *vimc, int ret; /* Allocate the vlens struct */ - vlens = kzalloc_obj(*vlens, GFP_KERNEL); + vlens = kzalloc_obj(*vlens); if (!vlens) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-scaler.c b/drivers/media/test-drivers/vimc/vimc-scaler.c index eb0a45944e4f..e2037c67e423 100644 --- a/drivers/media/test-drivers/vimc/vimc-scaler.c +++ b/drivers/media/test-drivers/vimc/vimc-scaler.c @@ -392,7 +392,7 @@ static struct vimc_ent_device *vimc_scaler_add(struct vimc_device *vimc, int ret; /* Allocate the vscaler struct */ - vscaler = kzalloc_obj(*vscaler, GFP_KERNEL); + vscaler = kzalloc_obj(*vscaler); if (!vscaler) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/vimc/vimc-sensor.c b/drivers/media/test-drivers/vimc/vimc-sensor.c index e53d28e59ac3..69e714d4f228 100644 --- a/drivers/media/test-drivers/vimc/vimc-sensor.c +++ b/drivers/media/test-drivers/vimc/vimc-sensor.c @@ -382,7 +382,7 @@ static struct vimc_ent_device *vimc_sensor_add(struct vimc_device *vimc, int ret; /* Allocate the vsensor struct */ - vsensor = kzalloc_obj(*vsensor, GFP_KERNEL); + vsensor = kzalloc_obj(*vsensor); if (!vsensor) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 5ef662fa6cfa..127ab18bce99 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -332,7 +332,7 @@ static int visl_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto unlock; @@ -437,7 +437,7 @@ static int visl_probe(struct platform_device *pdev) int ret; int rc; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/test-drivers/visl/visl-debugfs.c b/drivers/media/test-drivers/visl/visl-debugfs.c index 8cb75c63aca6..dd0ca5d8126c 100644 --- a/drivers/media/test-drivers/visl/visl-debugfs.c +++ b/drivers/media/test-drivers/visl/visl-debugfs.c @@ -45,7 +45,7 @@ void visl_trace_bitstream(struct visl_ctx *ctx, struct visl_run *run) struct dentry *dentry; char name[32]; - blob = kzalloc_obj(*blob, GFP_KERNEL); + blob = kzalloc_obj(*blob); if (!blob) return; diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 5d73701f9080..c8bf9b4d406c 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -1814,7 +1814,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) int i; /* allocate main vivid state structure */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index 3c2d90fe4349..b83f37a77224 100644 --- a/drivers/media/tuners/e4000.c +++ b/drivers/media/tuners/e4000.c @@ -621,7 +621,7 @@ static int e4000_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c index e982c1834fe4..33a283adad51 100644 --- a/drivers/media/tuners/fc0011.c +++ b/drivers/media/tuners/fc0011.c @@ -485,7 +485,7 @@ struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe, { struct fc0011_priv *priv; - priv = kzalloc_obj(struct fc0011_priv, GFP_KERNEL); + priv = kzalloc_obj(struct fc0011_priv); if (!priv) return NULL; diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c index efe0fd2f4673..89317c88e94a 100644 --- a/drivers/media/tuners/fc0012.c +++ b/drivers/media/tuners/fc0012.c @@ -435,7 +435,7 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); - priv = kzalloc_obj(struct fc0012_priv, GFP_KERNEL); + priv = kzalloc_obj(struct fc0012_priv); if (!priv) { ret = -ENOMEM; dev_err(&i2c->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME); diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c index d0049a302689..70815abdee96 100644 --- a/drivers/media/tuners/fc0013.c +++ b/drivers/media/tuners/fc0013.c @@ -526,7 +526,7 @@ struct dvb_frontend *fc0013_attach(struct dvb_frontend *fe, { struct fc0013_priv *priv = NULL; - priv = kzalloc_obj(struct fc0013_priv, GFP_KERNEL); + priv = kzalloc_obj(struct fc0013_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c index 992e716a0703..75087d9b224f 100644 --- a/drivers/media/tuners/fc2580.c +++ b/drivers/media/tuners/fc2580.c @@ -518,7 +518,7 @@ static int fc2580_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c index a78ce6c76b9c..22e29913d904 100644 --- a/drivers/media/tuners/it913x.c +++ b/drivers/media/tuners/it913x.c @@ -385,7 +385,7 @@ static int it913x_probe(struct platform_device *pdev) int ret; char *chip_ver_str; - dev = kzalloc_obj(struct it913x_dev, GFP_KERNEL); + dev = kzalloc_obj(struct it913x_dev); if (dev == NULL) { ret = -ENOMEM; dev_err(&pdev->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index 16144f4b363e..0a724cdf0f6d 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -612,7 +612,7 @@ static int m88rs6000t_probe(struct i2c_client *client) {0x75, 0xFC}, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/max2165.c b/drivers/media/tuners/max2165.c index 04c25efb3baa..c070cd2161fd 100644 --- a/drivers/media/tuners/max2165.c +++ b/drivers/media/tuners/max2165.c @@ -394,7 +394,7 @@ struct dvb_frontend *max2165_attach(struct dvb_frontend *fe, i2c ? i2c_adapter_id(i2c) : -1, cfg ? cfg->i2c_address : -1); - priv = kzalloc_obj(struct max2165_priv, GFP_KERNEL); + priv = kzalloc_obj(struct max2165_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mc44s803.c b/drivers/media/tuners/mc44s803.c index fb5dc3bef84f..4d5429f916ec 100644 --- a/drivers/media/tuners/mc44s803.c +++ b/drivers/media/tuners/mc44s803.c @@ -315,7 +315,7 @@ struct dvb_frontend *mc44s803_attach(struct dvb_frontend *fe, reg = 0; - priv = kzalloc_obj(struct mc44s803_priv, GFP_KERNEL); + priv = kzalloc_obj(struct mc44s803_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/msi001.c b/drivers/media/tuners/msi001.c index 071847007e65..d7e6d64478d1 100644 --- a/drivers/media/tuners/msi001.c +++ b/drivers/media/tuners/msi001.c @@ -426,7 +426,7 @@ static int msi001_probe(struct spi_device *spi) dev_dbg(&spi->dev, "\n"); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/mt2060.c b/drivers/media/tuners/mt2060.c index 3ae1c4de9dd3..ef3196e6bd30 100644 --- a/drivers/media/tuners/mt2060.c +++ b/drivers/media/tuners/mt2060.c @@ -407,7 +407,7 @@ struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter struct mt2060_priv *priv = NULL; u8 id = 0; - priv = kzalloc_obj(struct mt2060_priv, GFP_KERNEL); + priv = kzalloc_obj(struct mt2060_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mt2063.c b/drivers/media/tuners/mt2063.c index 5e226618321a..3feb19fba4b2 100644 --- a/drivers/media/tuners/mt2063.c +++ b/drivers/media/tuners/mt2063.c @@ -2212,7 +2212,7 @@ struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, dprintk(2, "\n"); - state = kzalloc_obj(struct mt2063_state, GFP_KERNEL); + state = kzalloc_obj(struct mt2063_state); if (!state) return NULL; diff --git a/drivers/media/tuners/mt20xx.c b/drivers/media/tuners/mt20xx.c index 5d89b84e4fb9..6c4333b1d9e4 100644 --- a/drivers/media/tuners/mt20xx.c +++ b/drivers/media/tuners/mt20xx.c @@ -596,7 +596,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe, unsigned char buf[21]; int company_code; - priv = kzalloc_obj(struct microtune_priv, GFP_KERNEL); + priv = kzalloc_obj(struct microtune_priv); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/mt2131.c b/drivers/media/tuners/mt2131.c index 31ada489ba27..fa59f572d515 100644 --- a/drivers/media/tuners/mt2131.c +++ b/drivers/media/tuners/mt2131.c @@ -248,7 +248,7 @@ struct dvb_frontend * mt2131_attach(struct dvb_frontend *fe, dprintk(1, "%s()\n", __func__); - priv = kzalloc_obj(struct mt2131_priv, GFP_KERNEL); + priv = kzalloc_obj(struct mt2131_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mt2266.c b/drivers/media/tuners/mt2266.c index 84bba08ae0a4..68111f7e7917 100644 --- a/drivers/media/tuners/mt2266.c +++ b/drivers/media/tuners/mt2266.c @@ -313,7 +313,7 @@ struct dvb_frontend * mt2266_attach(struct dvb_frontend *fe, struct i2c_adapter struct mt2266_priv *priv = NULL; u8 id = 0; - priv = kzalloc_obj(struct mt2266_priv, GFP_KERNEL); + priv = kzalloc_obj(struct mt2266_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/mxl301rf.c b/drivers/media/tuners/mxl301rf.c index 4cae9d2d37d2..cfc78891ce03 100644 --- a/drivers/media/tuners/mxl301rf.c +++ b/drivers/media/tuners/mxl301rf.c @@ -289,7 +289,7 @@ static int mxl301rf_probe(struct i2c_client *client) struct mxl301rf_config *cfg; struct dvb_frontend *fe; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/media/tuners/mxl5005s.c b/drivers/media/tuners/mxl5005s.c index 5538066a57ed..ba22bf594ac7 100644 --- a/drivers/media/tuners/mxl5005s.c +++ b/drivers/media/tuners/mxl5005s.c @@ -4103,7 +4103,7 @@ struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe, struct mxl5005s_state *state = NULL; dprintk(1, "%s()\n", __func__); - state = kzalloc_obj(struct mxl5005s_state, GFP_KERNEL); + state = kzalloc_obj(struct mxl5005s_state); if (state == NULL) return NULL; diff --git a/drivers/media/tuners/qm1d1b0004.c b/drivers/media/tuners/qm1d1b0004.c index dae101ac56f1..07ad84f42c9f 100644 --- a/drivers/media/tuners/qm1d1b0004.c +++ b/drivers/media/tuners/qm1d1b0004.c @@ -208,7 +208,7 @@ qm1d1b0004_probe(struct i2c_client *client) fe = cfg->fe; i2c_set_clientdata(client, fe); - fe->tuner_priv = kzalloc_obj(struct qm1d1b0004_state, GFP_KERNEL); + fe->tuner_priv = kzalloc_obj(struct qm1d1b0004_state); if (!fe->tuner_priv) { ret = -ENOMEM; goto err_mem; diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners/qm1d1c0042.c index 3a9037a2a74b..db60562ad698 100644 --- a/drivers/media/tuners/qm1d1c0042.c +++ b/drivers/media/tuners/qm1d1c0042.c @@ -407,7 +407,7 @@ static int qm1d1c0042_probe(struct i2c_client *client) struct qm1d1c0042_config *cfg; struct dvb_frontend *fe; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; state->i2c = client; diff --git a/drivers/media/tuners/qt1010.c b/drivers/media/tuners/qt1010.c index 2aee4556ad53..cd6025fc95cd 100644 --- a/drivers/media/tuners/qt1010.c +++ b/drivers/media/tuners/qt1010.c @@ -411,7 +411,7 @@ struct dvb_frontend * qt1010_attach(struct dvb_frontend *fe, struct qt1010_priv *priv = NULL; u8 id; - priv = kzalloc_obj(struct qt1010_priv, GFP_KERNEL); + priv = kzalloc_obj(struct qt1010_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 1239206a0ac4..4ca42114da8a 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -884,7 +884,7 @@ static int si2157_probe(struct i2c_client *client) struct si2157_cmd cmd; int ret; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/tda18212.c b/drivers/media/tuners/tda18212.c index 435189d37655..5f583c010408 100644 --- a/drivers/media/tuners/tda18212.c +++ b/drivers/media/tuners/tda18212.c @@ -186,7 +186,7 @@ static int tda18212_probe(struct i2c_client *client) .val_bits = 8, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { ret = -ENOMEM; dev_err(&client->dev, "kzalloc() failed\n"); diff --git a/drivers/media/tuners/tda18218.c b/drivers/media/tuners/tda18218.c index f3b54e815657..503af47a8e62 100644 --- a/drivers/media/tuners/tda18218.c +++ b/drivers/media/tuners/tda18218.c @@ -292,7 +292,7 @@ struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xf6 }; - priv = kzalloc_obj(struct tda18218_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tda18218_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c index 4e77ebc10114..caaf5e0d0c9b 100644 --- a/drivers/media/tuners/tda18250.c +++ b/drivers/media/tuners/tda18250.c @@ -769,7 +769,7 @@ static int tda18250_probe(struct i2c_client *client) .volatile_table = &tda18250_volatile_table, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/tda827x.c b/drivers/media/tuners/tda827x.c index adc00ee687a1..0ac40f1f13a7 100644 --- a/drivers/media/tuners/tda827x.c +++ b/drivers/media/tuners/tda827x.c @@ -873,7 +873,7 @@ struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr, struct tda827x_priv *priv = NULL; dprintk("%s:\n", __func__); - priv = kzalloc_obj(struct tda827x_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tda827x_priv); if (priv == NULL) return NULL; diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c index f15dca8f5b08..9ff0aa8cb80c 100644 --- a/drivers/media/tuners/tda8290.c +++ b/drivers/media/tuners/tda8290.c @@ -734,7 +734,7 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, struct tda8290_priv *priv = NULL; char *name; - priv = kzalloc_obj(struct tda8290_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tda8290_priv); if (priv == NULL) return NULL; fe->analog_demod_priv = priv; diff --git a/drivers/media/tuners/tea5761.c b/drivers/media/tuners/tea5761.c index 1e3ea4fd7013..3abe7745e80b 100644 --- a/drivers/media/tuners/tea5761.c +++ b/drivers/media/tuners/tea5761.c @@ -315,7 +315,7 @@ struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe, if (tea5761_autodetection(i2c_adap, i2c_addr) != 0) return NULL; - priv = kzalloc_obj(struct tea5761_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tea5761_priv); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c index 81deab8f2b20..97ad85c16775 100644 --- a/drivers/media/tuners/tea5767.c +++ b/drivers/media/tuners/tea5767.c @@ -441,7 +441,7 @@ struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe, { struct tea5767_priv *priv = NULL; - priv = kzalloc_obj(struct tea5767_priv, GFP_KERNEL); + priv = kzalloc_obj(struct tea5767_priv); if (priv == NULL) return NULL; fe->tuner_priv = priv; diff --git a/drivers/media/tuners/tua9001.c b/drivers/media/tuners/tua9001.c index 59bd15ba6280..c0aed1b441e2 100644 --- a/drivers/media/tuners/tua9001.c +++ b/drivers/media/tuners/tua9001.c @@ -178,7 +178,7 @@ static int tua9001_probe(struct i2c_client *client) .val_bits = 16, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/tuners/tuner-i2c.h b/drivers/media/tuners/tuner-i2c.h index ce9a065cde04..4efc825eda9b 100644 --- a/drivers/media/tuners/tuner-i2c.h +++ b/drivers/media/tuners/tuner-i2c.h @@ -132,7 +132,7 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, } \ } \ if (0 == __ret) { \ - state = kzalloc_obj(type, GFP_KERNEL); \ + state = kzalloc_obj(type); \ if (NULL == state) \ goto __fail; \ state->i2c_props.addr = i2caddr; \ diff --git a/drivers/media/tuners/xc2028.c b/drivers/media/tuners/xc2028.c index f0f99142941f..27b18ab0d44f 100644 --- a/drivers/media/tuners/xc2028.c +++ b/drivers/media/tuners/xc2028.c @@ -332,7 +332,7 @@ static int load_all_firmwares(struct dvb_frontend *fe, n_array, priv->fname, name, priv->firm_version >> 8, priv->firm_version & 0xff); - priv->firm = kzalloc_objs(*priv->firm, n_array, GFP_KERNEL); + priv->firm = kzalloc_objs(*priv->firm, n_array); if (priv->firm == NULL) { tuner_err("Not enough memory to load firmware file.\n"); rc = -ENOMEM; diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c index 674e863839c9..900c5f2438fc 100644 --- a/drivers/media/tuners/xc4000.c +++ b/drivers/media/tuners/xc4000.c @@ -763,7 +763,7 @@ static int xc4000_fwupload(struct dvb_frontend *fe) n_array, fname, name, priv->firm_version >> 8, priv->firm_version & 0xff); - priv->firm = kzalloc_objs(*priv->firm, n_array, GFP_KERNEL); + priv->firm = kzalloc_objs(*priv->firm, n_array); if (priv->firm == NULL) { printk(KERN_ERR "Not enough memory to load firmware file.\n"); rc = -ENOMEM; diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 1751a67842bc..8f6b721ba107 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -968,7 +968,7 @@ static int airspy_probe(struct usb_interface *intf, buf = NULL; ret = -ENOMEM; - s = kzalloc_obj(struct airspy, GFP_KERNEL); + s = kzalloc_obj(struct airspy); if (s == NULL) { dev_err(&intf->dev, "Could not allocate memory for state\n"); return -ENOMEM; diff --git a/drivers/media/usb/as102/as102_fw.c b/drivers/media/usb/as102/as102_fw.c index 6c14b2754b83..d2d432789f55 100644 --- a/drivers/media/usb/as102/as102_fw.c +++ b/drivers/media/usb/as102/as102_fw.c @@ -96,7 +96,7 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap, int total_read_bytes = 0, errno = 0; unsigned char addr_has_changed = 0; - fw_pkt = kmalloc_obj(*fw_pkt, GFP_KERNEL); + fw_pkt = kmalloc_obj(*fw_pkt); if (!fw_pkt) return -ENOMEM; diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c index 594dde4578ce..8e480ab78f9b 100644 --- a/drivers/media/usb/as102/as102_usb_drv.c +++ b/drivers/media/usb/as102/as102_usb_drv.c @@ -345,7 +345,7 @@ static int as102_usb_probe(struct usb_interface *intf, return -EINVAL; } - as102_dev = kzalloc_obj(struct as102_dev_t, GFP_KERNEL); + as102_dev = kzalloc_obj(struct as102_dev_t); if (as102_dev == NULL) return -ENOMEM; diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index d99f32d5d06f..445cbeb7abae 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -670,7 +670,7 @@ static int au0828_usb_probe(struct usb_interface *interface, return -ENODEV; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { pr_err("%s() Unable to allocate memory\n", __func__); return -ENOMEM; diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c index 9de5e7fdbbef..7dec1a360da6 100644 --- a/drivers/media/usb/au0828/au0828-input.c +++ b/drivers/media/usb/au0828/au0828-input.c @@ -283,7 +283,7 @@ int au0828_rc_register(struct au0828_dev *dev) if (!i2c_rc_dev_addr) return -ENODEV; - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); rc = rc_allocate_device(RC_DRIVER_IR_RAW); if (!ir || !rc) goto error; diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index 00029ea23c63..b64a37d1acf4 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c @@ -1295,7 +1295,7 @@ void cx231xx_card_setup(struct cx231xx *dev) u8 eeprom[256]; struct i2c_client client; }; - struct eeprom *e = kzalloc_obj(*e, GFP_KERNEL); + struct eeprom *e = kzalloc_obj(*e); if (e == NULL) { dev_err(dev->dev, @@ -1381,7 +1381,7 @@ static int cx231xx_media_device_init(struct cx231xx *dev, #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 913d53abd0e4..472a4405a105 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -627,7 +627,7 @@ static int dvb_init(struct cx231xx *dev) return 0; } - dvb = kzalloc_obj(struct cx231xx_dvb, GFP_KERNEL); + dvb = kzalloc_obj(struct cx231xx_dvb); if (dvb == NULL) { dev_info(dev->dev, diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index acbc951dbdc0..600cff8a4abd 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -392,7 +392,7 @@ static int dvb_usbv2_media_device_init(struct dvb_usb_adapter *adap) struct dvb_usb_device *d = adap_to_d(adap); struct usb_device *udev = d->udev; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; @@ -904,7 +904,7 @@ int dvb_usbv2_probe(struct usb_interface *intf, goto err; } - d = kzalloc_obj(struct dvb_usb_device, GFP_KERNEL); + d = kzalloc_obj(struct dvb_usb_device); if (!d) { dev_err(&udev->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME); ret = -ENOMEM; diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c index 4811f4d1ac87..0b184080565a 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c @@ -577,7 +577,7 @@ struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state, mxl_dbg("()"); - state = kzalloc_obj(struct mxl111sf_demod_state, GFP_KERNEL); + state = kzalloc_obj(struct mxl111sf_demod_state); if (state == NULL) return NULL; diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c index 0cc78fd8e916..cdae66b834a7 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c @@ -482,7 +482,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, mxl_dbg("()"); - state = kzalloc_obj(struct mxl111sf_tuner_state, GFP_KERNEL); + state = kzalloc_obj(struct mxl111sf_tuner_state); if (state == NULL) return NULL; diff --git a/drivers/media/usb/dvb-usb/af9005-fe.c b/drivers/media/usb/dvb-usb/af9005-fe.c index b6fb72c97aef..7f237dfecc3b 100644 --- a/drivers/media/usb/dvb-usb/af9005-fe.c +++ b/drivers/media/usb/dvb-usb/af9005-fe.c @@ -1423,7 +1423,7 @@ struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d) struct af9005_fe_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct af9005_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct af9005_fe_state); if (state == NULL) goto error; diff --git a/drivers/media/usb/dvb-usb/dtt200u-fe.c b/drivers/media/usb/dvb-usb/dtt200u-fe.c index 30d2e6d46b5b..7d827ea83937 100644 --- a/drivers/media/usb/dvb-usb/dtt200u-fe.c +++ b/drivers/media/usb/dvb-usb/dtt200u-fe.c @@ -206,7 +206,7 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d) struct dtt200u_fe_state* state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(struct dtt200u_fe_state, GFP_KERNEL); + state = kzalloc_obj(struct dtt200u_fe_state); if (state == NULL) goto error; diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 94e1e7ce278d..029dad86a059 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -103,7 +103,7 @@ static int dvb_usb_media_device_init(struct dvb_usb_adapter *adap) struct dvb_usb_device *d = adap->dev; struct usb_device *udev = d->udev; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c index 656401276d09..6d2672bcc69b 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c @@ -278,7 +278,7 @@ int dvb_usb_device_init(struct usb_interface *intf, if (du != NULL) *du = NULL; - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) { err("no memory for 'struct dvb_usb_device'"); return -ENOMEM; diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index ca8432d47301..ccff6be5599e 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -750,7 +750,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) if (!dev->adev.transfer_buffer) return -ENOMEM; - dev->adev.urb = kzalloc_objs(*dev->adev.urb, num_urb, GFP_KERNEL); + dev->adev.urb = kzalloc_objs(*dev->adev.urb, num_urb); if (!dev->adev.urb) { kfree(dev->adev.transfer_buffer); return -ENOMEM; diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 2fa43caaa968..59a2e4db75b7 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3488,7 +3488,7 @@ static int em28xx_media_device_init(struct em28xx *dev, #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; @@ -3905,7 +3905,7 @@ static int em28xx_usb_probe(struct usb_interface *intf, } /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { retval = -ENOMEM; goto err; diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index c6151d2a21a6..2eb9a88e595e 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1500,7 +1500,7 @@ static int em28xx_dvb_init(struct em28xx *dev) dev_info(&dev->intf->dev, "Binding DVB extension\n"); - dvb = kzalloc_obj(*dvb, GFP_KERNEL); + dvb = kzalloc_obj(*dvb); if (!dvb) return -ENOMEM; diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index f8de173affd5..20fdd59b5518 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c @@ -724,7 +724,7 @@ static int em28xx_ir_init(struct em28xx *dev) dev_info(&dev->intf->dev, "Registering input extension\n"); - ir = kzalloc_obj(*ir, GFP_KERNEL); + ir = kzalloc_obj(*ir); if (!ir) goto ref_put; rc = rc_allocate_device(RC_DRIVER_SCANCODE); @@ -765,7 +765,7 @@ static int em28xx_ir_init(struct em28xx *dev) goto error; } - ir->i2c_client = kzalloc_obj(*ir->i2c_client, GFP_KERNEL); + ir->i2c_client = kzalloc_obj(*ir->i2c_client); if (!ir->i2c_client) goto error; ir->i2c_client->adapter = &ir->dev->i2c_adap[dev->def_i2c_bus]; diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index ca88b6b13724..b0c184f237a7 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -2529,7 +2529,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) mutex_lock(&dev->lock); - v4l2 = kzalloc_obj(*v4l2, GFP_KERNEL); + v4l2 = kzalloc_obj(*v4l2); if (!v4l2) { mutex_unlock(&dev->lock); return -ENOMEM; diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c index 77f4d9a249ea..25b3ee25aaa4 100644 --- a/drivers/media/usb/go7007/go7007-driver.c +++ b/drivers/media/usb/go7007/go7007-driver.c @@ -694,7 +694,7 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board, { struct go7007 *go; - go = kzalloc_obj(struct go7007, GFP_KERNEL); + go = kzalloc_obj(struct go7007); if (go == NULL) return NULL; go->dev = dev; diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c index 8a42aaac9cba..c0cb92fa6ab9 100644 --- a/drivers/media/usb/go7007/go7007-usb.c +++ b/drivers/media/usb/go7007/go7007-usb.c @@ -1115,7 +1115,7 @@ static int go7007_usb_probe(struct usb_interface *intf, if (go == NULL) return -ENOMEM; - usb = kzalloc_obj(struct go7007_usb, GFP_KERNEL); + usb = kzalloc_obj(struct go7007_usb); if (usb == NULL) { kfree(go); return -ENOMEM; diff --git a/drivers/media/usb/go7007/s2250-board.c b/drivers/media/usb/go7007/s2250-board.c index 23f577b0cfbf..567f851d5896 100644 --- a/drivers/media/usb/go7007/s2250-board.c +++ b/drivers/media/usb/go7007/s2250-board.c @@ -509,7 +509,7 @@ static int s2250_probe(struct i2c_client *client) if (IS_ERR(audio)) return PTR_ERR(audio); - state = kzalloc_obj(struct s2250, GFP_KERNEL); + state = kzalloc_obj(struct s2250); if (state == NULL) { i2c_unregister_device(audio); return -ENOMEM; diff --git a/drivers/media/usb/go7007/snd-go7007.c b/drivers/media/usb/go7007/snd-go7007.c index c294c9486611..e4b9f37be77b 100644 --- a/drivers/media/usb/go7007/snd-go7007.c +++ b/drivers/media/usb/go7007/snd-go7007.c @@ -207,7 +207,7 @@ int go7007_snd_init(struct go7007 *go) dev++; return -ENOENT; } - gosnd = kmalloc_obj(struct go7007_snd, GFP_KERNEL); + gosnd = kmalloc_obj(struct go7007_snd); if (gosnd == NULL) return -ENOMEM; spin_lock_init(&gosnd->lock); diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c index ecb73b0b186b..bd0c62a926b9 100644 --- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c +++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c @@ -368,7 +368,7 @@ static int hdcs_probe_1x00(struct sd *sd) sd->gspca_dev.cam.cam_mode = hdcs1x00_mode; sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode); - hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL); + hdcs = kmalloc_obj(struct hdcs); if (!hdcs) return -ENOMEM; @@ -425,7 +425,7 @@ static int hdcs_probe_1020(struct sd *sd) sd->gspca_dev.cam.cam_mode = hdcs1020_mode; sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode); - hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL); + hdcs = kmalloc_obj(struct hdcs); if (!hdcs) return -ENOMEM; diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c index 984e6283ce83..d30a76df52cf 100644 --- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c @@ -126,7 +126,7 @@ static int pb0100_init_controls(struct sd *sd) .def = 1, }; - ctrls = kzalloc_obj(*ctrls, GFP_KERNEL); + ctrls = kzalloc_obj(*ctrls); if (!ctrls) return -ENOMEM; diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 599ebcad2bcc..94d356fba612 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -1348,7 +1348,7 @@ static int hackrf_probe(struct usb_interface *intf, int ret; u8 u8tmp, buf[BUF_SIZE]; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index eba330e00fb7..d42336836b18 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c @@ -276,7 +276,7 @@ static int hdpvr_probe(struct usb_interface *interface, int retval = -ENOMEM; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { dev_err(&interface->dev, "Out of memory\n"); goto error; diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 54c0484a14d8..4290b2367fa3 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -147,7 +147,7 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) for (i = 0; i < count; i++) { - buf = kzalloc_obj(struct hdpvr_buffer, GFP_KERNEL); + buf = kzalloc_obj(struct hdpvr_buffer); if (!buf) { v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n"); goto exit; @@ -379,7 +379,7 @@ static int hdpvr_stop_streaming(struct hdpvr_device *dev) static int hdpvr_open(struct file *file) { - struct hdpvr_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); + struct hdpvr_fh *fh = kzalloc_obj(*fh); if (fh == NULL) return -ENOMEM; diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 330955ddb703..1ff98956b680 100644 --- a/drivers/media/usb/msi2500/msi2500.c +++ b/drivers/media/usb/msi2500/msi2500.c @@ -1170,7 +1170,7 @@ static int msi2500_probe(struct usb_interface *intf, .max_speed_hz = 12000000, }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto err; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c index ca970f7f4bc0..93f5da65ead9 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-context.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c @@ -204,7 +204,7 @@ struct pvr2_context *pvr2_context_create( void (*setup_func)(struct pvr2_context *)) { struct pvr2_context *mp = NULL; - mp = kzalloc_obj(*mp, GFP_KERNEL); + mp = kzalloc_obj(*mp); if (!mp) goto done; pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (create)",mp); mp->setup_func = setup_func; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c index 064c11b7effe..721075989d57 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c @@ -449,7 +449,7 @@ struct pvr2_dvb_adapter *pvr2_dvb_create(struct pvr2_context *pvr) the DVB side of the driver either. For now. */ return NULL; } - adap = kzalloc_obj(*adap, GFP_KERNEL); + adap = kzalloc_obj(*adap); if (!adap) return adap; pvr2_channel_init(&adap->channel, pvr); adap->channel.check_func = pvr2_dvb_internal_check; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index fe988c6b693f..6b7d1fd18e5d 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2367,7 +2367,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, goto fail; } - hdw = kzalloc_obj(*hdw, GFP_KERNEL); + hdw = kzalloc_obj(*hdw); pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", hdw,hdw_desc->description); pvr2_trace(PVR2_TRACE_INFO, "Hardware description: %s", diff --git a/drivers/media/usb/pvrusb2/pvrusb2-io.c b/drivers/media/usb/pvrusb2/pvrusb2-io.c index 1341967ac666..af192aefef92 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-io.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-io.c @@ -299,7 +299,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt) if (scnt > sp->buffer_slot_count) { struct pvr2_buffer **nb; - nb = kmalloc_objs(*nb, scnt, GFP_KERNEL); + nb = kmalloc_objs(*nb, scnt); if (!nb) return -ENOMEM; if (sp->buffer_slot_count) { memcpy(nb, sp->buffers, @@ -311,7 +311,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt) } while (sp->buffer_total_count < cnt) { struct pvr2_buffer *bp; - bp = kmalloc_obj(*bp, GFP_KERNEL); + bp = kmalloc_obj(*bp); if (!bp) return -ENOMEM; ret = pvr2_buffer_init(bp, sp, sp->buffer_total_count); if (ret) { @@ -460,7 +460,7 @@ static void buffer_complete(struct urb *urb) struct pvr2_stream *pvr2_stream_create(void) { struct pvr2_stream *sp; - sp = kzalloc_obj(*sp, GFP_KERNEL); + sp = kzalloc_obj(*sp); if (!sp) return sp; pvr2_trace(PVR2_TRACE_INIT, "pvr2_stream_create: sp=%p", sp); pvr2_stream_init(sp); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c index d397231f153d..31f9305c0212 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c @@ -73,7 +73,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) struct pvr2_ioread *pvr2_ioread_create(void) { struct pvr2_ioread *cp; - cp = kzalloc_obj(*cp, GFP_KERNEL); + cp = kzalloc_obj(*cp); if (!cp) return NULL; pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); if (pvr2_ioread_init(cp) < 0) { diff --git a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c index f2cb644ca3d7..dba43d4c24f2 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c @@ -289,7 +289,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); if (!cptr) return; - cip = kzalloc_obj(*cip, GFP_KERNEL); + cip = kzalloc_obj(*cip); if (!cip) return; pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); @@ -411,7 +411,7 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) struct pvr2_sysfs_debugifc *dip; int ret; - dip = kzalloc_obj(*dip, GFP_KERNEL); + dip = kzalloc_obj(*dip); if (!dip) return; sysfs_attr_init(&dip->attr_debugcmd.attr); dip->attr_debugcmd.attr.name = "debugcmd"; @@ -615,7 +615,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp) usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); if (!usb_dev) return; - class_dev = kzalloc_obj(*class_dev, GFP_KERNEL); + class_dev = kzalloc_obj(*class_dev); if (!class_dev) return; pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); @@ -748,7 +748,7 @@ static void pvr2_sysfs_internal_check(struct pvr2_channel *chp) void pvr2_sysfs_create(struct pvr2_context *mp) { struct pvr2_sysfs *sfp; - sfp = kzalloc_obj(*sfp, GFP_KERNEL); + sfp = kzalloc_obj(*sfp); if (!sfp) return; pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 6fd0bfb5f699..101b2e9fbaab 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -944,7 +944,7 @@ static int pvr2_v4l2_open(struct file *file) return -EIO; } - fhp = kzalloc_obj(*fhp, GFP_KERNEL); + fhp = kzalloc_obj(*fhp); if (!fhp) { return -ENOMEM; } @@ -1236,7 +1236,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) { struct pvr2_v4l2 *vp; - vp = kzalloc_obj(*vp, GFP_KERNEL); + vp = kzalloc_obj(*vp); if (!vp) return vp; pvr2_channel_init(&vp->channel,mnp); pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp); @@ -1244,12 +1244,12 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) vp->channel.check_func = pvr2_v4l2_internal_check; /* register streams */ - vp->dev_video = kzalloc_obj(*vp->dev_video, GFP_KERNEL); + vp->dev_video = kzalloc_obj(*vp->dev_video); if (!vp->dev_video) goto fail; pvr2_v4l2_dev_init(vp->dev_video,vp,VFL_TYPE_VIDEO); if (pvr2_hdw_get_input_available(vp->channel.mc_head->hdw) & (1 << PVR2_CVAL_INPUT_RADIO)) { - vp->dev_radio = kzalloc_obj(*vp->dev_radio, GFP_KERNEL); + vp->dev_radio = kzalloc_obj(*vp->dev_radio); if (!vp->dev_radio) goto fail; pvr2_v4l2_dev_init(vp->dev_radio,vp,VFL_TYPE_RADIO); } diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index b57502237f3a..c416e2fc5754 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c @@ -1026,7 +1026,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id PWC_WARNING("Warning: more than 1 configuration available.\n"); /* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */ - pdev = kzalloc_obj(struct pwc_device, GFP_KERNEL); + pdev = kzalloc_obj(struct pwc_device); if (pdev == NULL) { PWC_ERROR("Oops, could not allocate memory for pwc_device.\n"); return -ENOMEM; diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 189a356eaf34..2c02873d09b5 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -2207,7 +2207,7 @@ static int s2255_probe(struct usb_interface *interface, int fw_size; /* allocate memory for our device state and initialize it to zero */ - dev = kzalloc_obj(struct s2255_dev, GFP_KERNEL); + dev = kzalloc_obj(struct s2255_dev); if (dev == NULL) { s2255_dev_err(&interface->dev, "out of memory\n"); return -ENOMEM; @@ -2221,7 +2221,7 @@ static int s2255_probe(struct usb_interface *interface, refcount_set(&dev->num_channels, 0); dev->pid = id->idProduct; - dev->fw_data = kzalloc_obj(struct s2255_fw, GFP_KERNEL); + dev->fw_data = kzalloc_obj(struct s2255_fw); if (!dev->fw_data) goto errorFWDATA1; mutex_init(&dev->lock); diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 4d9cb4184ca2..0fdc2e0950b7 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -367,7 +367,7 @@ static void *siano_media_device_register(struct smsusb_device_t *dev, struct sms_board *board = sms_get_board(board_id); int ret; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return NULL; @@ -397,7 +397,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) int align = 0; /* create device object */ - dev = kzalloc_obj(struct smsusb_device_t, GFP_KERNEL); + dev = kzalloc_obj(struct smsusb_device_t); if (!dev) return -ENOMEM; diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c index ec4a9e2f42ab..f9462a9ca761 100644 --- a/drivers/media/usb/stk1160/stk1160-core.c +++ b/drivers/media/usb/stk1160/stk1160-core.c @@ -295,7 +295,7 @@ static int stk1160_probe(struct usb_interface *interface, return rc; } - dev = kzalloc_obj(struct stk1160, GFP_KERNEL); + dev = kzalloc_obj(struct stk1160); if (dev == NULL) { kfree(alt_max_pkt_size); return -ENOMEM; diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c index 9cd0ea41300c..7a4d28cc3242 100644 --- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c @@ -1606,7 +1606,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; - if (!(ttusb = kzalloc_obj(struct ttusb, GFP_KERNEL))) + if (!(ttusb = kzalloc_obj(struct ttusb))) return -ENOMEM; ttusb->dev = udev; diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c index 24ba5c1c48d2..825a3875989d 100644 --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c @@ -1642,7 +1642,7 @@ static int ttusb_dec_probe(struct usb_interface *intf, udev = interface_to_usbdev(intf); - if (!(dec = kzalloc_obj(struct ttusb_dec, GFP_KERNEL))) { + if (!(dec = kzalloc_obj(struct ttusb_dec))) { printk("%s: couldn't allocate memory.\n", __func__); return -ENOMEM; } diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c index df4ade291db4..215221370c19 100644 --- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c +++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c @@ -198,7 +198,7 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf struct ttusbdecfe_state* state = NULL; /* allocate memory for the internal state */ - state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL); + state = kmalloc_obj(struct ttusbdecfe_state); if (state == NULL) return NULL; @@ -218,7 +218,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf struct ttusbdecfe_state* state = NULL; /* allocate memory for the internal state */ - state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL); + state = kmalloc_obj(struct ttusbdecfe_state); if (state == NULL) return NULL; diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c index 12ed28253d0c..c4bfadbe63c9 100644 --- a/drivers/media/usb/usbtv/usbtv-core.c +++ b/drivers/media/usb/usbtv/usbtv-core.c @@ -87,7 +87,7 @@ static int usbtv_probe(struct usb_interface *intf, size = size * usb_endpoint_maxp_mult(&ep->desc); /* Device structure */ - usbtv = kzalloc_obj(struct usbtv, GFP_KERNEL); + usbtv = kzalloc_obj(struct usbtv); if (usbtv == NULL) return -ENOMEM; usbtv->dev = dev; diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 2c511d1d9bf9..b9a3d9257a11 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -600,7 +600,7 @@ static const struct uvc_control_mapping *uvc_ctrl_filter_plf_mapping( u8 init_val; int ret; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) return NULL; @@ -3339,7 +3339,7 @@ static int uvc_ctrl_init_chain(struct uvc_video_chain *chain) if (ncontrols == 0) continue; - entity->controls = kzalloc_objs(*ctrl, ncontrols, GFP_KERNEL); + entity->controls = kzalloc_objs(*ctrl, ncontrols); if (entity->controls == NULL) return -ENOMEM; entity->ncontrols = ncontrols; diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c index 1ea4a4e82662..e8f20dd7eda4 100644 --- a/drivers/media/usb/uvc/uvc_debugfs.c +++ b/drivers/media/usb/uvc/uvc_debugfs.c @@ -29,7 +29,7 @@ static int uvc_debugfs_stats_open(struct inode *inode, struct file *file) struct uvc_streaming *stream = inode->i_private; struct uvc_debugfs_buffer *buf; - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (buf == NULL) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 05c5f70c0a93..b0ca81d924b6 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -200,7 +200,7 @@ static struct uvc_streaming *uvc_stream_new(struct uvc_device *dev, { struct uvc_streaming *stream; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (stream == NULL) return NULL; @@ -1761,7 +1761,7 @@ static struct uvc_video_chain *uvc_alloc_chain(struct uvc_device *dev) { struct uvc_video_chain *chain; - chain = kzalloc_obj(*chain, GFP_KERNEL); + chain = kzalloc_obj(*chain); if (chain == NULL) return NULL; @@ -2193,7 +2193,7 @@ static int uvc_probe(struct usb_interface *intf, int ret; /* Allocate memory for the device and initialize it. */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c index 59e2b05aaf21..0a906ae3f971 100644 --- a/drivers/media/usb/uvc/uvc_metadata.c +++ b/drivers/media/usb/uvc/uvc_metadata.c @@ -181,7 +181,7 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev) * USB requires buffers aligned in a special way, simplest way is to * make sure that query_ctrl will work is to kmalloc() them. */ - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c index 018d25101bb8..65f5356bebb3 100644 --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c @@ -263,7 +263,7 @@ int uvc_status_init(struct uvc_device *dev) if (ep == NULL) return 0; - dev->status = kzalloc_obj(*dev->status, GFP_KERNEL); + dev->status = kzalloc_obj(*dev->status); if (!dev->status) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 98e6c4135dfd..d5860661c115 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -133,7 +133,7 @@ static int uvc_ioctl_xu_ctrl_map(struct uvc_video_chain *chain, return -EINVAL; } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) return -ENOMEM; @@ -572,7 +572,7 @@ static int uvc_v4l2_open(struct file *file) uvc_dbg(stream->dev, CALLS, "%s\n", __func__); /* Create the device handle. */ - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 249a225563f9..40c76c051da2 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -682,7 +682,7 @@ static int uvc_video_clock_init(struct uvc_clock *clock) spin_lock_init(&clock->lock); clock->size = 32; - clock->samples = kmalloc_objs(*clock->samples, clock->size, GFP_KERNEL); + clock->samples = kmalloc_objs(*clock->samples, clock->size); if (clock->samples == NULL) return -ENOMEM; diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index b6e7c11ef7e5..004ec4d7beea 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v4l2-core/tuner-core.c @@ -633,7 +633,7 @@ static int tuner_probe(struct i2c_client *client) int ret; #endif - t = kzalloc_obj(struct tuner, GFP_KERNEL); + t = kzalloc_obj(struct tuner); if (NULL == t) return -ENOMEM; v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops); diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index c04a0e7c6edf..888a2e213b08 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -779,7 +779,7 @@ int v4l2_async_subdev_endpoint_add(struct v4l2_subdev *sd, { struct v4l2_async_subdev_endpoint *ase; - ase = kmalloc_obj(*ase, GFP_KERNEL); + ase = kmalloc_obj(*ase); if (!ase) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-ctrls-api.c b/drivers/media/v4l2-core/v4l2-ctrls-api.c index 03040c8eaa79..93d8d4012d0f 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-api.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-api.c @@ -431,7 +431,7 @@ int v4l2_g_ext_ctrls_common(struct v4l2_ctrl_handler *hdl, return class_check(hdl, cs->which); if (cs->count > ARRAY_SIZE(helper)) { - helpers = kvmalloc_objs(helper[0], cs->count, GFP_KERNEL); + helpers = kvmalloc_objs(helper[0], cs->count); if (!helpers) return -ENOMEM; } @@ -616,7 +616,7 @@ int try_set_ext_ctrls_common(struct v4l2_fh *fh, return class_check(hdl, cs->which); if (cs->count > ARRAY_SIZE(helper)) { - helpers = kvmalloc_objs(helper[0], cs->count, GFP_KERNEL); + helpers = kvmalloc_objs(helper[0], cs->count); if (!helpers) return -ENOMEM; } diff --git a/drivers/media/v4l2-core/v4l2-ctrls-request.c b/drivers/media/v4l2-core/v4l2-ctrls-request.c index e6d7f731d01a..4b7e6981b8d6 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-request.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-request.c @@ -198,7 +198,7 @@ v4l2_ctrls_find_req_obj(struct v4l2_ctrl_handler *hdl, if (!set) return ERR_PTR(-ENOMEM); - new_hdl = kzalloc_obj(*new_hdl, GFP_KERNEL); + new_hdl = kzalloc_obj(*new_hdl); if (!new_hdl) return ERR_PTR(-ENOMEM); @@ -341,7 +341,7 @@ void v4l2_ctrl_request_complete(struct media_request *req, int ret; /* Create a new request so the driver can return controls */ - hdl = kzalloc_obj(*hdl, GFP_KERNEL); + hdl = kzalloc_obj(*hdl); if (!hdl) return; diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 8add56232e84..6ce623a1245a 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -146,7 +146,7 @@ static inline int devnode_find(struct video_device *vdev, int from, int to) struct video_device *video_device_alloc(void) { - return kzalloc_obj(struct video_device, GFP_KERNEL); + return kzalloc_obj(struct video_device); } EXPORT_SYMBOL(video_device_alloc); diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c index 779ae282ab11..67e3073de132 100644 --- a/drivers/media/v4l2-core/v4l2-device.c +++ b/drivers/media/v4l2-core/v4l2-device.c @@ -205,7 +205,7 @@ int __v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev, if (sd->devnode) continue; - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) { err = -ENOMEM; goto clean_up; diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index a6233bdab3d4..3fea06443a65 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c @@ -1237,7 +1237,7 @@ struct v4l2_debugfs_if *v4l2_debugfs_if_alloc(struct dentry *root, u32 if_types, if (IS_ERR_OR_NULL(root) || !if_types || !if_read) return NULL; - infoframes = kzalloc_obj(*infoframes, GFP_KERNEL); + infoframes = kzalloc_obj(*infoframes); if (!infoframes) return NULL; diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c index fdd247b945a3..b184bed8aca9 100644 --- a/drivers/media/v4l2-core/v4l2-fh.c +++ b/drivers/media/v4l2-core/v4l2-fh.c @@ -57,7 +57,7 @@ EXPORT_SYMBOL_GPL(v4l2_fh_add); int v4l2_fh_open(struct file *filp) { struct video_device *vdev = video_devdata(filp); - struct v4l2_fh *fh = kzalloc_obj(*fh, GFP_KERNEL); + struct v4l2_fh *fh = kzalloc_obj(*fh); if (fh == NULL) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index c3ea009b8ffb..03daa8c4ff7a 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -785,7 +785,7 @@ int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode, if (!connector_ep) return -ENOTCONN; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) { err = -ENOMEM; goto err; @@ -1257,7 +1257,7 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd) if (WARN_ON(!sd->dev)) return -ENODEV; - notifier = kzalloc_obj(*notifier, GFP_KERNEL); + notifier = kzalloc_obj(*notifier); if (!notifier) return -ENOMEM; diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index 2c933f4644aa..a65cbb124cfe 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -1190,7 +1190,7 @@ struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops) if (!m2m_ops || WARN_ON(!m2m_ops->device_run)) return ERR_PTR(-EINVAL); - m2m_dev = kzalloc_obj(*m2m_dev, GFP_KERNEL); + m2m_dev = kzalloc_obj(*m2m_dev); if (!m2m_dev) return ERR_PTR(-ENOMEM); @@ -1238,7 +1238,7 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, struct v4l2_m2m_queue_ctx *out_q_ctx, *cap_q_ctx; int ret; - m2m_ctx = kzalloc_obj(*m2m_ctx, GFP_KERNEL); + m2m_ctx = kzalloc_obj(*m2m_ctx); if (!m2m_ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index c358cb40b829..10007cd842cb 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -99,7 +99,7 @@ static int subdev_open(struct file *file) struct v4l2_subdev_fh *subdev_fh; int ret; - subdev_fh = kzalloc_obj(*subdev_fh, GFP_KERNEL); + subdev_fh = kzalloc_obj(*subdev_fh); if (subdev_fh == NULL) return -ENOMEM; @@ -1606,7 +1606,7 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name, struct v4l2_subdev_state *state; int ret; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/samsung/exynos-srom.c b/drivers/memory/samsung/exynos-srom.c index 1863c85642dd..fcef4aed0292 100644 --- a/drivers/memory/samsung/exynos-srom.c +++ b/drivers/memory/samsung/exynos-srom.c @@ -54,7 +54,7 @@ exynos_srom_alloc_reg_dump(const unsigned long *rdump, struct exynos_srom_reg_dump *rd; unsigned int i; - rd = kzalloc_objs(*rd, nr_rdump, GFP_KERNEL); + rd = kzalloc_objs(*rd, nr_rdump); if (!rd) return NULL; diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c index 68496f9012ff..ff26815e51f1 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -1291,7 +1291,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c index 965bfab127f5..991d4f7bc070 100644 --- a/drivers/memory/tegra/tegra124.c +++ b/drivers/memory/tegra/tegra124.c @@ -1182,7 +1182,7 @@ tegra124_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data if (node->id != idx) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c index 48a546315d1c..a1fadefee7fd 100644 --- a/drivers/memory/tegra/tegra20-emc.c +++ b/drivers/memory/tegra/tegra20-emc.c @@ -958,7 +958,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra20.c b/drivers/memory/tegra/tegra20.c index 40bee3ff4a45..4748113bfe9d 100644 --- a/drivers/memory/tegra/tegra20.c +++ b/drivers/memory/tegra/tegra20.c @@ -401,7 +401,7 @@ tegra20_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != idx) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); @@ -615,7 +615,7 @@ static int tegra20_mc_stats_show(struct seq_file *s, void *unused) struct tegra20_mc_client_stat *stats; unsigned int i; - stats = kzalloc_objs(*stats, mc->soc->num_clients + 1, GFP_KERNEL); + stats = kzalloc_objs(*stats, mc->soc->num_clients + 1); if (!stats) return -ENOMEM; diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 8226cadc1f8f..606106dd2b32 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -1476,7 +1476,7 @@ emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != TEGRA_ICC_EMEM) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memory/tegra/tegra30.c b/drivers/memory/tegra/tegra30.c index d9f255da5c0e..a6bcde4b92c0 100644 --- a/drivers/memory/tegra/tegra30.c +++ b/drivers/memory/tegra/tegra30.c @@ -1344,7 +1344,7 @@ tegra30_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) if (node->id != idx) continue; - ndata = kzalloc_obj(*ndata, GFP_KERNEL); + ndata = kzalloc_obj(*ndata); if (!ndata) return ERR_PTR(-ENOMEM); diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index d3641ba53bc9..e03989c4e99e 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c @@ -380,7 +380,7 @@ EXPORT_SYMBOL(memstick_set_rw_addr); static struct memstick_dev *memstick_alloc_card(struct memstick_host *host) { - struct memstick_dev *card = kzalloc_obj(struct memstick_dev, GFP_KERNEL); + struct memstick_dev *card = kzalloc_obj(struct memstick_dev); struct memstick_dev *old_card = host->card; struct ms_id_register id_reg; diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index 6835849bf309..a01fe313558e 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -1203,7 +1203,7 @@ static int msb_read_boot_blocks(struct msb_data *msb) dbg_verbose("Start of a scan for the boot blocks"); if (!msb->boot_page) { - page = kmalloc_objs(struct ms_boot_page, 2, GFP_KERNEL); + page = kmalloc_objs(struct ms_boot_page, 2); if (!page) return -ENOMEM; @@ -2150,7 +2150,7 @@ static int msb_probe(struct memstick_dev *card) struct msb_data *msb; int rc = 0; - msb = kzalloc_obj(struct msb_data, GFP_KERNEL); + msb = kzalloc_obj(struct msb_data); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -2224,7 +2224,7 @@ static int msb_resume(struct memstick_dev *card) #endif mutex_lock(&card->host->lock); - new_msb = kzalloc_obj(struct msb_data, GFP_KERNEL); + new_msb = kzalloc_obj(struct msb_data); if (!new_msb) goto out; diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 57c2b28f88bd..1cd061bb89d9 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -954,7 +954,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card) } for (cnt = 0; cnt < attr_count; ++cnt) { - s_attr = kzalloc_obj(struct mspro_sys_attr, GFP_KERNEL); + s_attr = kzalloc_obj(struct mspro_sys_attr); if (!s_attr) { rc = -ENOMEM; goto out_free_buffer; @@ -1210,7 +1210,7 @@ static int mspro_block_probe(struct memstick_dev *card) struct mspro_block_data *msb; int rc = 0; - msb = kzalloc_obj(struct mspro_block_data, GFP_KERNEL); + msb = kzalloc_obj(struct mspro_block_data); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -1297,7 +1297,7 @@ static int mspro_block_resume(struct memstick_dev *card) unsigned char cnt; mutex_lock(&host->lock); - new_msb = kzalloc_obj(struct mspro_block_data, GFP_KERNEL); + new_msb = kzalloc_obj(struct mspro_block_data); if (!new_msb) { rc = -ENOMEM; goto out_unlock; diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index de771eb6facd..3a431ffd3e2e 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1771,7 +1771,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) struct proc_dir_entry *dent; #endif - ioc = kzalloc_obj(MPT_ADAPTER, GFP_KERNEL); + ioc = kzalloc_obj(MPT_ADAPTER); if (ioc == NULL) { printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); return -ENOMEM; @@ -5700,7 +5700,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) continue; - if ((component_info = kmalloc_obj(*component_info, GFP_KERNEL)) == NULL) + if ((component_info = kmalloc_obj(*component_info)) == NULL) continue; component_info->volumeID = id; diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index b65bc679106a..b55deb988ad9 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -484,7 +484,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) } } if (new_ri) { /* allocate one */ - ri = kzalloc_obj(struct mptfc_rport_info, GFP_KERNEL); + ri = kzalloc_obj(struct mptfc_rport_info); if (!ri) return; list_add_tail(&ri->list, &ioc->fc_rports); @@ -572,7 +572,7 @@ mptfc_target_alloc(struct scsi_target *starget) struct mptfc_rport_info *ri; int rc; - vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget); if (!vtarget) return -ENOMEM; starget->hostdata = vtarget; @@ -650,7 +650,7 @@ mptfc_sdev_init(struct scsi_device *sdev) hd = shost_priv(sdev->host); ioc = hd->ioc; - vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index 0da0d472aaff..a4d0184eeda0 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c @@ -391,7 +391,7 @@ mpt_lan_open(struct net_device *dev) "a moment.\n"); } - priv->mpt_txfidx = kmalloc_objs(int, priv->tx_max_out, GFP_KERNEL); + priv->mpt_txfidx = kmalloc_objs(int, priv->tx_max_out); if (priv->mpt_txfidx == NULL) goto out; priv->mpt_txfidx_tail = -1; @@ -405,7 +405,7 @@ mpt_lan_open(struct net_device *dev) dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); - priv->mpt_rxfidx = kmalloc_objs(int, priv->max_buckets_out, GFP_KERNEL); + priv->mpt_rxfidx = kmalloc_objs(int, priv->max_buckets_out); if (priv->mpt_rxfidx == NULL) goto out_SendCtl; priv->mpt_rxfidx_tail = -1; diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 0b9e787ae3d5..82719241e4c1 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -603,7 +603,7 @@ mptsas_add_device_component(MPT_ADAPTER *ioc, u8 channel, u8 id, } } - sas_info = kzalloc_obj(struct mptsas_device_info, GFP_KERNEL); + sas_info = kzalloc_obj(struct mptsas_device_info); if (!sas_info) goto out; @@ -756,7 +756,7 @@ mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc, } } - sas_info = kzalloc_obj(struct mptsas_device_info, GFP_KERNEL); + sas_info = kzalloc_obj(struct mptsas_device_info); if (sas_info) { sas_info->fw.id = starget->id; sas_info->os.id = starget->id; @@ -1751,7 +1751,7 @@ mptsas_target_alloc(struct scsi_target *starget) int i; MPT_ADAPTER *ioc = hd->ioc; - vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget); if (!vtarget) return -ENOMEM; @@ -1878,7 +1878,7 @@ mptsas_sdev_init(struct scsi_device *sdev) int i; MPT_ADAPTER *ioc = hd->ioc; - vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kzalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); @@ -3309,7 +3309,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) struct mptsas_portinfo *port_info, *hba; int error = -ENOMEM, i; - hba = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); + hba = kzalloc_obj(struct mptsas_portinfo); if (! hba) goto out; @@ -3444,7 +3444,7 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc, int i; __le64 sas_address; - port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo); BUG_ON(!port_info); port_info->num_phys = (expander_data->NumPhys) ? expander_data->NumPhys : 1; @@ -3677,7 +3677,7 @@ mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle) MPI_SAS_EXPAND_PGAD_FORM_SHIFT), handle))) return NULL; - port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo); if (!port_info) { dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "%s: exit at line=%d\n", ioc->name, @@ -3945,7 +3945,7 @@ mptsas_probe_expanders(MPT_ADAPTER *ioc) continue; } - port_info = kzalloc_obj(struct mptsas_portinfo, GFP_KERNEL); + port_info = kzalloc_obj(struct mptsas_portinfo); if (!port_info) { dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "%s: exit at line=%d\n", ioc->name, diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 62cf9d582386..56892b1f3de2 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -405,7 +405,7 @@ static int mptspi_target_alloc(struct scsi_target *starget) return -ENODEV; ioc = hd->ioc; - vtarget = kzalloc_obj(VirtTarget, GFP_KERNEL); + vtarget = kzalloc_obj(VirtTarget); if (!vtarget) return -ENOMEM; @@ -725,7 +725,7 @@ static int mptspi_sdev_init(struct scsi_device *sdev) mptscsih_is_phys_disk(ioc, 0, sdev->id) == 0) return -ENXIO; - vdevice = kzalloc_obj(VirtDevice, GFP_KERNEL); + vdevice = kzalloc_obj(VirtDevice); if (!vdevice) { printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index 777cb2a24983..39430dd44e30 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -188,7 +188,7 @@ static int ec_device_probe(struct platform_device *pdev) struct device_node *node; struct device *dev = &pdev->dev; struct cros_ec_platform *ec_platform = dev_get_platdata(dev); - struct cros_ec_dev *ec = kzalloc_obj(*ec, GFP_KERNEL); + struct cros_ec_dev *ec = kzalloc_obj(*ec); struct ec_response_pchg_count pchg_count; int i; diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c index eb70156e5abf..d12510e391c8 100644 --- a/drivers/mfd/dln2.c +++ b/drivers/mfd/dln2.c @@ -125,7 +125,7 @@ int dln2_register_event_cb(struct platform_device *pdev, u16 id, unsigned long flags; int ret = 0; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -778,7 +778,7 @@ static int dln2_probe(struct usb_interface *interface, if (ret) return ret; - dln2 = kzalloc_obj(*dln2, GFP_KERNEL); + dln2 = kzalloc_obj(*dln2); if (!dln2) return -ENOMEM; diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index d98a02a073ac..24ca140d6a48 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -302,7 +302,7 @@ int pcap_adc_async(struct pcap_chip *pcap, u8 bank, u32 flags, u8 ch[], unsigned long irq_flags; /* This will be freed after we have a result */ - req = kmalloc_obj(struct pcap_adc_request, GFP_KERNEL); + req = kmalloc_obj(struct pcap_adc_request); if (!req) return -ENOMEM; diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index ae6af552f6d2..0ee6d8940e69 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1335,7 +1335,7 @@ static int sm501_plat_probe(struct platform_device *dev) struct sm501_devdata *sm; int ret; - sm = kzalloc_obj(*sm, GFP_KERNEL); + sm = kzalloc_obj(*sm); if (!sm) { ret = -ENOMEM; goto err1; @@ -1518,7 +1518,7 @@ static int sm501_pci_probe(struct pci_dev *dev, struct sm501_devdata *sm; int err; - sm = kzalloc_obj(*sm, GFP_KERNEL); + sm = kzalloc_obj(*sm); if (!sm) { err = -ENOMEM; goto err1; diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index 6bf0bcf49ff4..21a7fcdd2737 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -51,7 +51,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res) WARN_ON(!mutex_is_locked(&syscon_list_lock)); - struct syscon *syscon __free(kfree) = kzalloc_obj(*syscon, GFP_KERNEL); + struct syscon *syscon __free(kfree) = kzalloc_obj(*syscon); if (!syscon) return ERR_PTR(-ENOMEM); @@ -212,7 +212,7 @@ int of_syscon_register_regmap(struct device_node *np, struct regmap *regmap) if (!np || !regmap) return -EINVAL; - syscon = kzalloc_obj(*syscon, GFP_KERNEL); + syscon = kzalloc_obj(*syscon); if (!syscon) return -ENOMEM; diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c index b44af8ca1360..c0a3bc936381 100644 --- a/drivers/mfd/timberdale.c +++ b/drivers/mfd/timberdale.c @@ -649,7 +649,7 @@ static int timb_probe(struct pci_dev *dev, struct msix_entry *msix_entries = NULL; u8 ip_setup; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index 4def9eeb964f..06809f68b007 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c @@ -631,7 +631,7 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base) return status; } - agent = kzalloc_obj(*agent, GFP_KERNEL); + agent = kzalloc_obj(*agent); if (!agent) return -ENOMEM; diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index b2f304984505..16f64e2b2f77 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -395,7 +395,7 @@ static int ucb1x00_add_dev(struct ucb1x00 *ucb, struct ucb1x00_driver *drv) struct ucb1x00_dev *dev; int ret; - dev = kmalloc_obj(struct ucb1x00_dev, GFP_KERNEL); + dev = kmalloc_obj(struct ucb1x00_dev); if (!dev) return -ENOMEM; @@ -513,7 +513,7 @@ static int ucb1x00_probe(struct mcp *mcp) goto out; } - ucb = kzalloc_obj(struct ucb1x00, GFP_KERNEL); + ucb = kzalloc_obj(struct ucb1x00); ret = -ENOMEM; if (!ucb) goto out; diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index ff1b018969d5..39fe187eea1f 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c @@ -367,7 +367,7 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) struct input_dev *idev; int err; - ts = kzalloc_obj(struct ucb1x00_ts, GFP_KERNEL); + ts = kzalloc_obj(struct ucb1x00_ts); idev = input_allocate_device(); if (!ts || !idev) { err = -ENOMEM; diff --git a/drivers/mfd/viperboard.c b/drivers/mfd/viperboard.c index 7c0b1ae0c6bc..f964bcfa0796 100644 --- a/drivers/mfd/viperboard.c +++ b/drivers/mfd/viperboard.c @@ -53,7 +53,7 @@ static int vprbrd_probe(struct usb_interface *interface, int pipe, ret; /* allocate memory for our device state and initialize it */ - vb = kzalloc_obj(*vb, GFP_KERNEL); + vb = kzalloc_obj(*vb); if (!vb) return -ENOMEM; diff --git a/drivers/mfd/wm831x-auxadc.c b/drivers/mfd/wm831x-auxadc.c index 5db027c904ad..744e1d161c5a 100644 --- a/drivers/mfd/wm831x-auxadc.c +++ b/drivers/mfd/wm831x-auxadc.c @@ -35,7 +35,7 @@ static int wm831x_auxadc_read_irq(struct wm831x *wm831x, int ret; bool ena = false; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c index 8024378b4e61..57bead9fba1b 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c @@ -686,7 +686,7 @@ int ad_dpot_probe(struct device *dev, struct dpot_data *data; int i, err = 0; - data = kzalloc_obj(struct dpot_data, GFP_KERNEL); + data = kzalloc_obj(struct dpot_data); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c index 334117d3a214..cf71f8e5448f 100644 --- a/drivers/misc/altera-stapl/altera.c +++ b/drivers/misc/altera-stapl/altera.c @@ -290,13 +290,13 @@ static int altera_execute(struct altera_state *astate, if (sym_count <= 0) goto exit_done; - vars = kzalloc_objs(long, sym_count, GFP_KERNEL); + vars = kzalloc_objs(long, sym_count); if (vars == NULL) status = -ENOMEM; if (status == 0) { - var_size = kzalloc_objs(s32, sym_count, GFP_KERNEL); + var_size = kzalloc_objs(s32, sym_count); if (var_size == NULL) status = -ENOMEM; @@ -2342,7 +2342,7 @@ static int altera_get_act_info(u8 *p, (p[proc_table + (13 * act_proc_id) + 8] & 0x03); procptr = - kzalloc_obj(struct altera_procinfo, GFP_KERNEL); + kzalloc_obj(struct altera_procinfo); if (procptr == NULL) status = -ENOMEM; @@ -2398,7 +2398,7 @@ int altera_init(struct altera_config *config, const struct firmware *fw) retval = -ENOMEM; goto free_key; } - astate = kzalloc_obj(struct altera_state, GFP_KERNEL); + astate = kzalloc_obj(struct altera_state); if (!astate) { retval = -ENOMEM; goto free_value; diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 26d5e002dfa4..fc504bd8d916 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -217,7 +217,7 @@ static int apds9802als_probe(struct i2c_client *client) int res; struct als_data *data; - data = kzalloc_obj(struct als_data, GFP_KERNEL); + data = kzalloc_obj(struct als_data); if (data == NULL) { dev_err(&client->dev, "Memory allocation failed\n"); return -ENOMEM; diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c index b057e659135f..b69c3a1c94d1 100644 --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c @@ -1055,7 +1055,7 @@ static int apds990x_probe(struct i2c_client *client) struct apds990x_chip *chip; int err; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c index cdcf334f0ede..5773ffb46f0f 100644 --- a/drivers/misc/bcm-vk/bcm_vk_dev.c +++ b/drivers/misc/bcm-vk/bcm_vk_dev.c @@ -1289,7 +1289,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) u32 boot_status; /* allocate vk structure which is tied to kref for freeing */ - vk = kzalloc_obj(*vk, GFP_KERNEL); + vk = kzalloc_obj(*vk); if (!vk) return -ENOMEM; diff --git a/drivers/misc/bcm-vk/bcm_vk_sg.c b/drivers/misc/bcm-vk/bcm_vk_sg.c index bd8c726fdc0f..8662bb865129 100644 --- a/drivers/misc/bcm-vk/bcm_vk_sg.c +++ b/drivers/misc/bcm-vk/bcm_vk_sg.c @@ -60,7 +60,7 @@ static int bcm_vk_dma_alloc(struct device *dev, dma->nr_pages = last - first + 1; /* Allocate DMA pages */ - dma->pages = kmalloc_objs(struct page *, dma->nr_pages, GFP_KERNEL); + dma->pages = kmalloc_objs(struct page *, dma->nr_pages); if (!dma->pages) return -ENOMEM; diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c index 707871bc4a50..54742e849d33 100644 --- a/drivers/misc/c2port/core.c +++ b/drivers/misc/c2port/core.c @@ -912,7 +912,7 @@ struct c2port_device *c2port_device_register(char *name, unlikely(!ops->c2d_get) || unlikely(!ops->c2d_set)) return ERR_PTR(-EINVAL); - c2dev = kzalloc_obj(struct c2port_device, GFP_KERNEL); + c2dev = kzalloc_obj(struct c2port_device); if (unlikely(!c2dev)) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c index d7211b305918..2b6a994c6fe1 100644 --- a/drivers/misc/cardreader/rtsx_pcr.c +++ b/drivers/misc/cardreader/rtsx_pcr.c @@ -1385,7 +1385,7 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr) pcr_dbg(pcr, "PID: 0x%04x, IC version: 0x%02x\n", PCI_PID(pcr), pcr->ic_version); - pcr->slots = kzalloc_objs(struct rtsx_slot, pcr->num_slots, GFP_KERNEL); + pcr->slots = kzalloc_objs(struct rtsx_slot, pcr->num_slots); if (!pcr->slots) return -ENOMEM; @@ -1493,13 +1493,13 @@ static int rtsx_pci_probe(struct pci_dev *pcidev, if (ret) goto disable; - pcr = kzalloc_obj(*pcr, GFP_KERNEL); + pcr = kzalloc_obj(*pcr); if (!pcr) { ret = -ENOMEM; goto release_pci; } - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) { ret = -ENOMEM; goto free_pcr; diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index f0bfc6210dab..cdd0e7bda68d 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c @@ -187,7 +187,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain) if (timer_nr < 0) goto done; - timer = kmalloc_obj(*timer, GFP_KERNEL); + timer = kmalloc_obj(*timer); if (!timer) { /* aw hell */ spin_lock_irqsave(&mfgpt->lock, flags); diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index dae682d8c4a7..5731d2dc8a57 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c @@ -144,7 +144,7 @@ static int max6875_probe(struct i2c_client *client) if (client->addr & 1) return -ENODEV; - data = kzalloc_obj(struct max6875_data, GFP_KERNEL); + data = kzalloc_obj(struct max6875_data); if (!data) return -ENOMEM; diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index d212649fe7f9..fcf3a702bdf8 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -424,7 +424,7 @@ static int __fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, { struct fastrpc_buf *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return -ENOMEM; @@ -600,7 +600,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( unsigned long flags; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); @@ -611,7 +611,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc( REMOTE_SCALARS_OUTBUFS(sc); if (ctx->nscalars) { - ctx->maps = kzalloc_objs(*ctx->maps, ctx->nscalars, GFP_KERNEL); + ctx->maps = kzalloc_objs(*ctx->maps, ctx->nscalars); if (!ctx->maps) { kfree(ctx); return ERR_PTR(-ENOMEM); @@ -704,7 +704,7 @@ static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf, struct fastrpc_buf *buffer = dmabuf->priv; int ret; - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) return -ENOMEM; @@ -786,7 +786,7 @@ static int fastrpc_map_attach(struct fastrpc_user *fl, int fd, struct scatterlist *sgl = NULL; int err = 0, sgl_index = 0; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return -ENOMEM; @@ -1432,7 +1432,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl, u32 sc; bool unsigned_module = false; - args = kzalloc_objs(*args, FASTRPC_CREATE_PROCESS_NARGS, GFP_KERNEL); + args = kzalloc_objs(*args, FASTRPC_CREATE_PROCESS_NARGS); if (!args) return -ENOMEM; @@ -1627,7 +1627,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) fdevice = miscdev_to_fdevice(filp->private_data); cctx = fdevice->cctx; - fl = kzalloc_obj(*fl, GFP_KERNEL); + fl = kzalloc_obj(*fl); if (!fl) return -ENOMEM; @@ -1734,7 +1734,7 @@ static int fastrpc_invoke(struct fastrpc_user *fl, char __user *argp) /* nscalars is truncated here to max supported value */ nscalars = REMOTE_SCALARS_LENGTH(inv.sc); if (nscalars) { - args = kzalloc_objs(*args, nscalars, GFP_KERNEL); + args = kzalloc_objs(*args, nscalars); if (!args) return -ENOMEM; @@ -2371,7 +2371,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) else if (!qcom_scm_is_available()) return -EPROBE_DEFER; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c index 75b970d1012e..86bfa82723ff 100644 --- a/drivers/misc/genwqe/card_base.c +++ b/drivers/misc/genwqe/card_base.c @@ -141,7 +141,7 @@ static struct genwqe_dev *genwqe_dev_alloc(void) if (i >= GENWQE_CARD_NO_MAX) return ERR_PTR(-ENODEV); - cd = kzalloc_obj(struct genwqe_dev, GFP_KERNEL); + cd = kzalloc_obj(struct genwqe_dev); if (!cd) return ERR_PTR(-ENOMEM); @@ -403,7 +403,7 @@ static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd) /* currently support only the debug units mentioned here */ cd->ffdc[type].entries = e; cd->ffdc[type].regs = - kmalloc_objs(struct genwqe_reg, e, GFP_KERNEL); + kmalloc_objs(struct genwqe_reg, e); /* * regs == NULL is ok, the using code treats this as no regs, * Printing warning is ok in this case. diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c index 87286ad04a4b..63c7a25a055f 100644 --- a/drivers/misc/genwqe/card_ddcb.c +++ b/drivers/misc/genwqe/card_ddcb.c @@ -194,7 +194,7 @@ struct genwqe_ddcb_cmd *ddcb_requ_alloc(void) { struct ddcb_requ *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; diff --git a/drivers/misc/genwqe/card_debugfs.c b/drivers/misc/genwqe/card_debugfs.c index 7fc0dce42aa7..53cc17306b22 100644 --- a/drivers/misc/genwqe/card_debugfs.c +++ b/drivers/misc/genwqe/card_debugfs.c @@ -53,7 +53,7 @@ static int curr_dbg_uidn_show(struct seq_file *s, void *unused, int uid) if (entries == 0) return 0; - regs = kzalloc_objs(*regs, entries, GFP_KERNEL); + regs = kzalloc_objs(*regs, entries); if (regs == NULL) return -ENOMEM; @@ -122,7 +122,7 @@ static int curr_regs_show(struct seq_file *s, void *unused) unsigned int i; struct genwqe_reg *regs; - regs = kzalloc_objs(*regs, GENWQE_FFDC_REGS, GFP_KERNEL); + regs = kzalloc_objs(*regs, GENWQE_FFDC_REGS); if (regs == NULL) return -ENOMEM; diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 9b5458c10053..5a07e8403e97 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c @@ -301,7 +301,7 @@ static int genwqe_open(struct inode *inode, struct file *filp) struct genwqe_dev *cd; struct genwqe_file *cfile; - cfile = kzalloc_obj(*cfile, GFP_KERNEL); + cfile = kzalloc_obj(*cfile); if (cfile == NULL) return -ENOMEM; @@ -446,7 +446,7 @@ static int genwqe_mmap(struct file *filp, struct vm_area_struct *vma) if (get_order(vsize) > MAX_PAGE_ORDER) return -ENOMEM; - dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL); + dma_map = kzalloc_obj(struct dma_mapping); if (dma_map == NULL) return -ENOMEM; @@ -783,7 +783,7 @@ static int genwqe_pin_mem(struct genwqe_file *cfile, struct genwqe_mem *m) map_addr = (m->addr & PAGE_MASK); map_size = round_up(m->size + (m->addr & ~PAGE_MASK), PAGE_SIZE); - dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL); + dma_map = kzalloc_obj(struct dma_mapping); if (dma_map == NULL) return -ENOMEM; diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 174cabc7307f..ff3f03ea577e 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -570,7 +570,7 @@ static int ilo_open(struct inode *ip, struct file *fp) hw = container_of(ip->i_cdev, struct ilo_hwinfo, cdev); /* new ccb allocation */ - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -798,7 +798,7 @@ static int ilo_probe(struct pci_dev *pdev, /* track global allocations for this device */ error = -ENOMEM; - ilo_hw = kzalloc_obj(*ilo_hw, GFP_KERNEL); + ilo_hw = kzalloc_obj(*ilo_hw); if (!ilo_hw) goto out; diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c index 9e4f45be78d7..6b037675ff45 100644 --- a/drivers/misc/ibmasm/command.c +++ b/drivers/misc/ibmasm/command.c @@ -24,7 +24,7 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s if (buffer_size > IBMASM_CMD_MAX_BUFFER_SIZE) return NULL; - cmd = kzalloc_obj(struct command, GFP_KERNEL); + cmd = kzalloc_obj(struct command); if (cmd == NULL) return NULL; diff --git a/drivers/misc/ibmasm/event.c b/drivers/misc/ibmasm/event.c index 41aabfcd256f..3990bf2b1728 100644 --- a/drivers/misc/ibmasm/event.c +++ b/drivers/misc/ibmasm/event.c @@ -139,7 +139,7 @@ int ibmasm_event_buffer_init(struct service_processor *sp) struct ibmasm_event *event; int i; - buffer = kmalloc_obj(struct event_buffer, GFP_KERNEL); + buffer = kmalloc_obj(struct event_buffer); if (!buffer) return -ENOMEM; diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index f203bc3e8068..f68a8957b98f 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -235,7 +235,7 @@ static int command_file_open(struct inode *inode, struct file *file) if (!inode->i_private) return -ENODEV; - command_data = kmalloc_obj(struct ibmasmfs_command_data, GFP_KERNEL); + command_data = kmalloc_obj(struct ibmasmfs_command_data); if (!command_data) return -ENOMEM; @@ -344,7 +344,7 @@ static int event_file_open(struct inode *inode, struct file *file) sp = inode->i_private; - event_data = kmalloc_obj(struct ibmasmfs_event_data, GFP_KERNEL); + event_data = kmalloc_obj(struct ibmasmfs_event_data); if (!event_data) return -ENOMEM; @@ -430,7 +430,7 @@ static int r_heartbeat_file_open(struct inode *inode, struct file *file) if (!inode->i_private) return -ENODEV; - rhbeat = kmalloc_obj(struct ibmasmfs_heartbeat_data, GFP_KERNEL); + rhbeat = kmalloc_obj(struct ibmasmfs_heartbeat_data); if (!rhbeat) return -ENOMEM; diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index ea625673826b..4509c15a76a8 100644 --- a/drivers/misc/ibmasm/module.c +++ b/drivers/misc/ibmasm/module.c @@ -64,7 +64,7 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* vnc client won't work without bus-mastering */ pci_set_master(pdev); - sp = kzalloc_obj(struct service_processor, GFP_KERNEL); + sp = kzalloc_obj(struct service_processor); if (sp == NULL) { dev_err(&pdev->dev, "Failed to allocate memory\n"); result = -ENOMEM; diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index 78ecc28f00fb..beb18c34f20d 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -830,7 +830,7 @@ static int ibmvmc_open(struct inode *inode, struct file *file) (unsigned long)inode, (unsigned long)file, ibmvmc.state); - session = kzalloc_obj(*session, GFP_KERNEL); + session = kzalloc_obj(*session); if (!session) return -ENOMEM; diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c index df4d36fe46ac..015710762a65 100644 --- a/drivers/misc/ics932s401.c +++ b/drivers/misc/ics932s401.c @@ -433,7 +433,7 @@ static int ics932s401_probe(struct i2c_client *client) struct ics932s401_data *data; int err; - data = kzalloc_obj(struct ics932s401_data, GFP_KERNEL); + data = kzalloc_obj(struct ics932s401_data); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c index ea56dde9183d..95480e16ae5f 100644 --- a/drivers/misc/isl29003.c +++ b/drivers/misc/isl29003.c @@ -383,7 +383,7 @@ static int isl29003_probe(struct i2c_client *client) if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE)) return -EIO; - data = kzalloc_obj(struct isl29003_data, GFP_KERNEL); + data = kzalloc_obj(struct isl29003_data); if (!data) return -ENOMEM; diff --git a/drivers/misc/keba/cp500.c b/drivers/misc/keba/cp500.c index 6039a718d92f..6c65fbf22e75 100644 --- a/drivers/misc/keba/cp500.c +++ b/drivers/misc/keba/cp500.c @@ -335,7 +335,7 @@ static int cp500_register_i2c(struct cp500 *cp500) { int ret; - cp500->i2c = kzalloc_obj(*cp500->i2c, GFP_KERNEL); + cp500->i2c = kzalloc_obj(*cp500->i2c); if (!cp500->i2c) return -ENOMEM; @@ -386,7 +386,7 @@ static int cp500_register_spi(struct cp500 *cp500, u8 esc_type) int info_size; int ret; - cp500->spi = kzalloc_obj(*cp500->spi, GFP_KERNEL); + cp500->spi = kzalloc_obj(*cp500->spi); if (!cp500->spi) return -ENOMEM; @@ -443,7 +443,7 @@ static int cp500_register_fan(struct cp500 *cp500) { int ret; - cp500->fan = kzalloc_obj(*cp500->fan, GFP_KERNEL); + cp500->fan = kzalloc_obj(*cp500->fan); if (!cp500->fan) return -ENOMEM; @@ -491,7 +491,7 @@ static int cp500_register_batt(struct cp500 *cp500) { int ret; - cp500->batt = kzalloc_obj(*cp500->batt, GFP_KERNEL); + cp500->batt = kzalloc_obj(*cp500->batt); if (!cp500->batt) return -ENOMEM; @@ -541,7 +541,7 @@ static int cp500_register_uart(struct cp500 *cp500, { int ret; - *uart = kzalloc_obj(**uart, GFP_KERNEL); + *uart = kzalloc_obj(**uart); if (!*uart) return -ENOMEM; diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c index 6245ea993d1b..0bb90c0943bf 100644 --- a/drivers/misc/lan966x_pci.c +++ b/drivers/misc/lan966x_pci.c @@ -58,7 +58,7 @@ static struct pci_dev_intr_ctrl *pci_dev_create_intr_ctrl(struct pci_dev *pdev) if (!fwnode) return ERR_PTR(-ENODEV); - intr_ctrl = kmalloc_obj(*intr_ctrl, GFP_KERNEL); + intr_ctrl = kmalloc_obj(*intr_ctrl); if (!intr_ctrl) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index f5adec86ca28..9c68f8b1d5d6 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -952,7 +952,7 @@ int lis3lv02d_init_dt(struct lis3lv02d *lis3) if (!lis3->of_node) return 0; - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return -ENOMEM; diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c index 6de369f0ccd2..6b39ee357cef 100644 --- a/drivers/misc/lkdtm/bugs.c +++ b/drivers/misc/lkdtm/bugs.c @@ -533,7 +533,7 @@ static void lkdtm_PTR_BOUNDS(void) { struct lkdtm_cb_ptr *inst; - inst = kzalloc_obj(*inst, GFP_KERNEL); + inst = kzalloc_obj(*inst); if (!inst) { pr_err("FAIL: could not allocate struct lkdtm_cb_ptr!\n"); return; @@ -547,7 +547,7 @@ static void lkdtm_PTR_BOUNDS(void) inst->len = element_count; /* Double element_count */ - inst->extra = kzalloc_objs(*inst->extra, element_count * 2, GFP_KERNEL); + inst->extra = kzalloc_objs(*inst->extra, element_count * 2); inst->nr_extra = element_count * 2; pr_info("Pointer access within bounds ...\n"); diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index fb311b6633d6..f739dbcdb04c 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -1363,7 +1363,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus, struct mei_cl_device *cldev; struct mei_cl *cl; - cldev = kzalloc_obj(*cldev, GFP_KERNEL); + cldev = kzalloc_obj(*cldev); if (!cldev) return NULL; diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 2ad20921ffb7..643b0039cc72 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -370,7 +370,7 @@ static struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, { struct mei_cl_cb *cb; - cb = kzalloc_obj(*cb, GFP_KERNEL); + cb = kzalloc_obj(*cb); if (!cb) return NULL; @@ -605,7 +605,7 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev) { struct mei_cl *cl; - cl = kmalloc_obj(*cl, GFP_KERNEL); + cl = kmalloc_obj(*cl); if (!cl) return NULL; @@ -1273,7 +1273,7 @@ struct mei_cl_vtag *mei_cl_vtag_alloc(struct file *fp, u8 vtag) { struct mei_cl_vtag *cl_vtag; - cl_vtag = kzalloc_obj(*cl_vtag, GFP_KERNEL); + cl_vtag = kzalloc_obj(*cl_vtag); if (!cl_vtag) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c index 00467dc56b9b..a5a15a62a356 100644 --- a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c +++ b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c @@ -141,7 +141,7 @@ static int mei_gsc_proxy_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_master = kzalloc_obj(*comp_master, GFP_KERNEL); + comp_master = kzalloc_obj(*comp_master); if (!comp_master) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 19db57456f2c..a864ac7121b2 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c @@ -409,7 +409,7 @@ static int mei_hbm_me_cl_add(struct mei_device *dev, mei_me_cl_rm_by_uuid(dev, uuid); - me_cl = kzalloc_obj(*me_cl, GFP_KERNEL); + me_cl = kzalloc_obj(*me_cl); if (!me_cl) return -ENOMEM; diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index 68cb4da376f9..d498ef5c2dc4 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -819,7 +819,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_arbiter = kzalloc_obj(*comp_arbiter, GFP_KERNEL); + comp_arbiter = kzalloc_obj(*comp_arbiter); if (!comp_arbiter) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c index b79573c32a4d..7c2629e12819 100644 --- a/drivers/misc/mei/pxp/mei_pxp.c +++ b/drivers/misc/mei/pxp/mei_pxp.c @@ -273,7 +273,7 @@ static int mei_pxp_probe(struct mei_cl_device *cldev, goto enable_err_exit; } - comp_master = kzalloc_obj(*comp_master, GFP_KERNEL); + comp_master = kzalloc_obj(*comp_master); if (!comp_master) { ret = -ENOMEM; goto err_exit; diff --git a/drivers/misc/mei/vsc-fw-loader.c b/drivers/misc/mei/vsc-fw-loader.c index dc32510c9ddb..7b347248921d 100644 --- a/drivers/misc/mei/vsc-fw-loader.c +++ b/drivers/misc/mei/vsc-fw-loader.c @@ -721,7 +721,7 @@ int vsc_tp_init(struct vsc_tp *tp, struct device *dev) void *rx_buf __free(kfree) = NULL; int ret; - fw_loader = kzalloc_obj(*fw_loader, GFP_KERNEL); + fw_loader = kzalloc_obj(*fw_loader); if (!fw_loader) return -ENOMEM; diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index 727d9bbe1a29..ce217b1c3fdd 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -705,7 +705,7 @@ static struct ntsync_obj *ntsync_alloc_obj(struct ntsync_device *dev, { struct ntsync_obj *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; obj->type = type; @@ -1145,7 +1145,7 @@ static int ntsync_char_open(struct inode *inode, struct file *file) { struct ntsync_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/misc/ocxl/afu_irq.c b/drivers/misc/ocxl/afu_irq.c index 3969fc9d58e2..ade7913a35e1 100644 --- a/drivers/misc/ocxl/afu_irq.c +++ b/drivers/misc/ocxl/afu_irq.c @@ -107,7 +107,7 @@ int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id) struct afu_irq *irq; int rc; - irq = kzalloc_obj(struct afu_irq, GFP_KERNEL); + irq = kzalloc_obj(struct afu_irq); if (!irq) return -ENOMEM; diff --git a/drivers/misc/ocxl/context.c b/drivers/misc/ocxl/context.c index 3ca1c442fb39..33f25be46247 100644 --- a/drivers/misc/ocxl/context.c +++ b/drivers/misc/ocxl/context.c @@ -10,7 +10,7 @@ int ocxl_context_alloc(struct ocxl_context **context, struct ocxl_afu *afu, int pasid; struct ocxl_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/misc/ocxl/core.c b/drivers/misc/ocxl/core.c index 608ac6a2d855..92466b7fa954 100644 --- a/drivers/misc/ocxl/core.c +++ b/drivers/misc/ocxl/core.c @@ -17,7 +17,7 @@ static struct ocxl_afu *alloc_afu(struct ocxl_fn *fn) { struct ocxl_afu *afu; - afu = kzalloc_obj(struct ocxl_afu, GFP_KERNEL); + afu = kzalloc_obj(struct ocxl_afu); if (!afu) return NULL; @@ -300,7 +300,7 @@ static struct ocxl_fn *alloc_function(void) { struct ocxl_fn *fn; - fn = kzalloc_obj(struct ocxl_fn, GFP_KERNEL); + fn = kzalloc_obj(struct ocxl_fn); if (!fn) return NULL; diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index fc03b82c3eb6..1abbde33e974 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -526,7 +526,7 @@ int ocxl_file_register_afu(struct ocxl_afu *afu) struct ocxl_fn *fn = afu->fn; struct pci_dev *pci_dev = to_pci_dev(fn->dev.parent); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info == NULL) return -ENOMEM; diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c index c413d065abe7..7749dcd16117 100644 --- a/drivers/misc/ocxl/link.c +++ b/drivers/misc/ocxl/link.c @@ -345,7 +345,7 @@ static int alloc_spa(struct pci_dev *dev, struct ocxl_link *link) { struct spa *spa; - spa = kzalloc_obj(struct spa, GFP_KERNEL); + spa = kzalloc_obj(struct spa); if (!spa) return -ENOMEM; @@ -387,7 +387,7 @@ static int alloc_link(struct pci_dev *dev, int PE_mask, struct ocxl_link **out_l struct ocxl_link *link; int rc; - link = kzalloc_obj(struct ocxl_link, GFP_KERNEL); + link = kzalloc_obj(struct ocxl_link); if (!link) return -ENOMEM; @@ -559,7 +559,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr, goto unlock; } - pe_data = kmalloc_obj(*pe_data, GFP_KERNEL); + pe_data = kmalloc_obj(*pe_data); if (!pe_data) { rc = -ENOMEM; goto unlock; diff --git a/drivers/misc/ocxl/pasid.c b/drivers/misc/ocxl/pasid.c index 677870f49290..c9a50eb926da 100644 --- a/drivers/misc/ocxl/pasid.c +++ b/drivers/misc/ocxl/pasid.c @@ -28,7 +28,7 @@ static int range_alloc(struct list_head *head, u32 size, int max_id, struct id_range *cur, *new; int rc, last_end; - new = kmalloc_obj(struct id_range, GFP_KERNEL); + new = kmalloc_obj(struct id_range); if (!new) return -ENOMEM; diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c index c69a88a09332..fd147fd2800f 100644 --- a/drivers/misc/pch_phub.c +++ b/drivers/misc/pch_phub.c @@ -666,7 +666,7 @@ static int pch_phub_probe(struct pci_dev *pdev, int ret; struct pch_phub_reg *chip; - chip = kzalloc_obj(struct pch_phub_reg, GFP_KERNEL); + chip = kzalloc_obj(struct pch_phub_reg); if (chip == NULL) return -ENOMEM; diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index cb7f7d9243d3..34a5054a6b40 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c @@ -362,7 +362,7 @@ static int phantom_probe(struct pci_dev *pdev, } retval = -ENOMEM; - pht = kzalloc_obj(*pht, GFP_KERNEL); + pht = kzalloc_obj(*pht); if (pht == NULL) { dev_err(&pdev->dev, "unable to allocate device\n"); goto err_reg; diff --git a/drivers/misc/rpmb-core.c b/drivers/misc/rpmb-core.c index 2bd557665d1a..ecf14acf230a 100644 --- a/drivers/misc/rpmb-core.c +++ b/drivers/misc/rpmb-core.c @@ -161,7 +161,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev, !descr->dev_id_len) return ERR_PTR(-EINVAL); - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return ERR_PTR(-ENOMEM); rdev->descr = *descr; diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c index 171d38913dcf..8d749f345246 100644 --- a/drivers/misc/sgi-gru/grumain.c +++ b/drivers/misc/sgi-gru/grumain.c @@ -356,7 +356,7 @@ struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma, int tsid) { struct gru_vma_data *vdata = NULL; - vdata = kmalloc_obj(*vdata, GFP_KERNEL); + vdata = kmalloc_obj(*vdata); if (!vdata) return NULL; diff --git a/drivers/misc/sgi-gru/grutlbpurge.c b/drivers/misc/sgi-gru/grutlbpurge.c index 1bb07781a105..a8121d40be68 100644 --- a/drivers/misc/sgi-gru/grutlbpurge.c +++ b/drivers/misc/sgi-gru/grutlbpurge.c @@ -237,7 +237,7 @@ static struct mmu_notifier *gru_alloc_notifier(struct mm_struct *mm) { struct gru_mm_struct *gms; - gms = kzalloc_obj(*gms, GFP_KERNEL); + gms = kzalloc_obj(*gms); if (!gms) return ERR_PTR(-ENOMEM); STAT(gms_alloc); diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index ccd3047580c5..f23ec2bb03bf 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c @@ -147,7 +147,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, struct xpc_gru_mq_uv *mq; struct uv_IO_APIC_route_entry *mmr_value; - mq = kmalloc_obj(struct xpc_gru_mq_uv, GFP_KERNEL); + mq = kmalloc_obj(struct xpc_gru_mq_uv); if (mq == NULL) { dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() " "a xpc_gru_mq_uv structure\n"); @@ -155,7 +155,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, goto out_0; } - mq->gru_mq_desc = kzalloc_obj(struct gru_message_queue_desc, GFP_KERNEL); + mq->gru_mq_desc = kzalloc_obj(struct gru_message_queue_desc); if (mq->gru_mq_desc == NULL) { dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() " "a gru_message_queue_desc structure\n"); diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 39b38d639638..1919d24c8236 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -191,7 +191,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) * after the reserved blocks from the dt are processed. */ nblocks = (np) ? of_get_available_child_count(np) + 1 : 1; - rblocks = kzalloc_objs(*rblocks, nblocks, GFP_KERNEL); + rblocks = kzalloc_objs(*rblocks, nblocks); if (!rblocks) return -ENOMEM; diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index 96ad091089a7..1a49483297a9 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c @@ -252,7 +252,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, if (!tifm_media_type_name(type, 0)) return sock; - sock = kzalloc_obj(struct tifm_dev, GFP_KERNEL); + sock = kzalloc_obj(struct tifm_dev); if (sock) { spin_lock_init(&sock->lock); sock->type = type; diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 8f592afe1a32..03f19eda641e 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c @@ -343,7 +343,7 @@ static int tsl2550_probe(struct i2c_client *client) goto exit; } - data = kzalloc_obj(struct tsl2550_data, GFP_KERNEL); + data = kzalloc_obj(struct tsl2550_data); if (!data) { err = -ENOMEM; goto exit; diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 55735335ce12..45521d4a56d1 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -158,7 +158,7 @@ static int uacce_fops_open(struct inode *inode, struct file *filep) if (!uacce) return -ENODEV; - q = kzalloc_obj(struct uacce_queue, GFP_KERNEL); + q = kzalloc_obj(struct uacce_queue); if (!q) return -ENOMEM; @@ -251,7 +251,7 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma) else return -EINVAL; - qfr = kzalloc_obj(*qfr, GFP_KERNEL); + qfr = kzalloc_obj(*qfr); if (!qfr) return -ENOMEM; @@ -506,7 +506,7 @@ struct uacce_device *uacce_alloc(struct device *parent, struct uacce_device *uacce; int ret; - uacce = kzalloc_obj(struct uacce_device, GFP_KERNEL); + uacce = kzalloc_obj(struct uacce_device); if (!uacce) return ERR_PTR(-ENOMEM); diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 5ae13779bd1a..3edb934dd7fd 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -1616,7 +1616,7 @@ static int vmballoon_enable_stats(struct vmballoon *b) if (b->stats) goto out; - b->stats = kzalloc_obj(*b->stats, GFP_KERNEL); + b->stats = kzalloc_obj(*b->stats); if (!b->stats) { /* allocation failed */ diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c index 0a87d5430385..19ca00feed6e 100644 --- a/drivers/misc/vmw_vmci/vmci_context.c +++ b/drivers/misc/vmw_vmci/vmci_context.c @@ -104,7 +104,7 @@ struct vmci_ctx *vmci_ctx_create(u32 cid, u32 priv_flags, goto err_out; } - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) { pr_warn("Failed to allocate memory for VMCI context\n"); error = -ENOMEM; @@ -294,7 +294,7 @@ int vmci_ctx_enqueue_datagram(u32 cid, struct vmci_datagram *dg) } /* Allocate guest call entry and add it to the target VM's queue. */ - dq_entry = kmalloc_obj(*dq_entry, GFP_KERNEL); + dq_entry = kmalloc_obj(*dq_entry); if (dq_entry == NULL) { pr_warn("Failed to allocate memory for datagram\n"); vmci_ctx_put(context); @@ -598,7 +598,7 @@ int vmci_ctx_add_notification(u32 context_id, u32 remote_cid) goto out; } - notifier = kmalloc_obj(struct vmci_handle_list, GFP_KERNEL); + notifier = kmalloc_obj(struct vmci_handle_list); if (!notifier) { result = VMCI_ERROR_NO_MEM; goto out; diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c index 1a276717e20a..6193a22c3ab5 100644 --- a/drivers/misc/vmw_vmci/vmci_datagram.c +++ b/drivers/misc/vmw_vmci/vmci_datagram.c @@ -71,7 +71,7 @@ static int dg_create_handle(u32 resource_id, handle = vmci_make_handle(context_id, resource_id); - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { pr_warn("Failed allocating memory for datagram entry\n"); return VMCI_ERROR_NO_MEM; diff --git a/drivers/misc/vmw_vmci/vmci_doorbell.c b/drivers/misc/vmw_vmci/vmci_doorbell.c index c2db2d4ab7f6..30303e0f5f68 100644 --- a/drivers/misc/vmw_vmci/vmci_doorbell.c +++ b/drivers/misc/vmw_vmci/vmci_doorbell.c @@ -402,7 +402,7 @@ int vmci_doorbell_create(struct vmci_handle *handle, priv_flags & ~VMCI_PRIVILEGE_ALL_FLAGS) return VMCI_ERROR_INVALID_ARGS; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (entry == NULL) { pr_warn("Failed allocating memory for datagram entry\n"); return VMCI_ERROR_NO_MEM; diff --git a/drivers/misc/vmw_vmci/vmci_event.c b/drivers/misc/vmw_vmci/vmci_event.c index 85dc12860f17..fffe068a26eb 100644 --- a/drivers/misc/vmw_vmci/vmci_event.c +++ b/drivers/misc/vmw_vmci/vmci_event.c @@ -151,7 +151,7 @@ int vmci_event_subscribe(u32 event, return VMCI_ERROR_INVALID_ARGS; } - sub = kzalloc_obj(*sub, GFP_KERNEL); + sub = kzalloc_obj(*sub); if (!sub) return VMCI_ERROR_NO_MEM; diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c index 88fea05203d5..b71ca1bf0a20 100644 --- a/drivers/misc/vmw_vmci/vmci_host.c +++ b/drivers/misc/vmw_vmci/vmci_host.c @@ -120,7 +120,7 @@ static int vmci_host_open(struct inode *inode, struct file *filp) { struct vmci_host_dev *vmci_host_dev; - vmci_host_dev = kzalloc_obj(struct vmci_host_dev, GFP_KERNEL); + vmci_host_dev = kzalloc_obj(struct vmci_host_dev); if (vmci_host_dev == NULL) return -ENOMEM; diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index d2a7f79f4e8d..872aad355dbe 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -895,7 +895,7 @@ qp_guest_endpoint_create(struct vmci_handle handle, handle = vmci_make_handle(context_id, VMCI_INVALID_ID); } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (entry) { entry->qp.peer = peer; entry->qp.flags = flags; @@ -2722,7 +2722,7 @@ int vmci_qpair_alloc(struct vmci_qp **qpair, return VMCI_ERROR_INVALID_ARGS; } - my_qpair = kzalloc_obj(*my_qpair, GFP_KERNEL); + my_qpair = kzalloc_obj(*my_qpair); if (!my_qpair) return VMCI_ERROR_NO_MEM; diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index b39cd61cea44..05ee76cb0a08 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -422,7 +422,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( struct mmc_blk_ioc_data *idata; int err; - idata = kzalloc_obj(*idata, GFP_KERNEL); + idata = kzalloc_obj(*idata); if (!idata) { err = -ENOMEM; goto out; @@ -737,7 +737,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md, return -EINVAL; n = num_of_cmds; - idata = kzalloc_objs(*idata, n, GFP_KERNEL); + idata = kzalloc_objs(*idata, n); if (!idata) return -ENOMEM; @@ -2562,7 +2562,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, return ERR_PTR(devidx); } - md = kzalloc_obj(*md, GFP_KERNEL); + md = kzalloc_obj(*md); if (!md) { ret = -ENOMEM; goto out; @@ -2794,12 +2794,12 @@ static struct mmc_blk_ioc_data **alloc_idata(struct mmc_rpmb_data *rpmb, struct mmc_blk_ioc_data **idata; unsigned int n; - idata = kzalloc_objs(*idata, cmd_count, GFP_KERNEL); + idata = kzalloc_objs(*idata, cmd_count); if (!idata) return NULL; for (n = 0; n < cmd_count; n++) { - idata[n] = kzalloc_objs(**idata, 1, GFP_KERNEL); + idata[n] = kzalloc_objs(**idata, 1); if (!idata[n]) { free_idata(idata, n); return NULL; @@ -2942,7 +2942,7 @@ static int mmc_blk_alloc_rpmb_part(struct mmc_card *card, if (devidx < 0) return devidx; - rpmb = kzalloc_obj(*rpmb, GFP_KERNEL); + rpmb = kzalloc_obj(*rpmb); if (!rpmb) { ida_free(&mmc_rpmb_ida, devidx); return -ENOMEM; diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 740b082da3e2..be5cf338bdeb 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -279,7 +279,7 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host, const struct device_type { struct mmc_card *card; - card = kzalloc_obj(struct mmc_card, GFP_KERNEL); + card = kzalloc_obj(struct mmc_card); if (!card) return ERR_PTR(-ENOMEM); diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 70cc83a8a1ee..43fdb67d5407 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -348,11 +348,11 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz, if (max_segs > max_page_cnt) max_segs = max_page_cnt; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return NULL; - mem->arr = kzalloc_objs(*mem->arr, max_segs, GFP_KERNEL); + mem->arr = kzalloc_objs(*mem->arr, max_segs); if (!mem->arr) goto out_free; @@ -533,7 +533,7 @@ static void mmc_test_save_transfer_result(struct mmc_test_card *test, if (!test->gr) return; - tr = kmalloc_obj(*tr, GFP_KERNEL); + tr = kmalloc_obj(*tr); if (!tr) return; @@ -765,7 +765,7 @@ static void mmc_test_req_reset(struct mmc_test_req *rq) static struct mmc_test_req *mmc_test_req_alloc(void) { - struct mmc_test_req *rq = kmalloc_obj(*rq, GFP_KERNEL); + struct mmc_test_req *rq = kmalloc_obj(*rq); if (rq) mmc_test_req_reset(rq); @@ -1570,13 +1570,13 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) if (!t->mem) return -ENOMEM; - t->sg = kmalloc_objs(*t->sg, t->max_segs, GFP_KERNEL); + t->sg = kmalloc_objs(*t->sg, t->max_segs); if (!t->sg) { ret = -ENOMEM; goto out_free; } - t->sg_areq = kmalloc_objs(*t->sg_areq, t->max_segs, GFP_KERNEL); + t->sg_areq = kmalloc_objs(*t->sg_areq, t->max_segs); if (!t->sg_areq) { ret = -ENOMEM; goto out_free; @@ -2967,7 +2967,7 @@ static void mmc_test_run(struct mmc_test_card *test, int testcase) } } - gr = kzalloc_obj(*gr, GFP_KERNEL); + gr = kzalloc_obj(*gr); if (gr) { INIT_LIST_HEAD(&gr->tr_lst); @@ -3099,7 +3099,7 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, if (ret) return ret; - test = kzalloc_obj(*test, GFP_KERNEL); + test = kzalloc_obj(*test); if (!test) return -ENOMEM; @@ -3188,7 +3188,7 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card, file = debugfs_create_file(name, mode, card->debugfs_root, card, fops); - df = kmalloc_obj(*df, GFP_KERNEL); + df = kmalloc_obj(*df); if (!df) { debugfs_remove(file); return -ENOMEM; diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 060da5c4ea75..4b07098c33c3 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -337,7 +337,7 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card) { struct sdio_func *func; - func = kzalloc_obj(struct sdio_func, GFP_KERNEL); + func = kzalloc_obj(struct sdio_func); if (!func) return ERR_PTR(-ENOMEM); diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c index a37d91347931..7fd5dedf3ac0 100644 --- a/drivers/mmc/core/sdio_uart.c +++ b/drivers/mmc/core/sdio_uart.c @@ -1021,7 +1021,7 @@ static int sdio_uart_probe(struct sdio_func *func, struct sdio_uart_port *port; int ret; - port = kzalloc_obj(struct sdio_uart_port, GFP_KERNEL); + port = kzalloc_obj(struct sdio_uart_port); if (!port) return -ENOMEM; diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 2a2aee4054f7..4e3423a19bdf 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -306,7 +306,7 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode) return -EIO; } - ranges = kmalloc_objs(*ranges, priv->num_phases / 2 + 1, GFP_KERNEL); + ranges = kmalloc_objs(*ranges, priv->num_phases / 2 + 1); if (!ranges) return -ENOMEM; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 1e0c3904cded..07eb9f23b9d6 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -834,7 +834,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host, static int dw_mci_edmac_init(struct dw_mci *host) { /* Request external dma channel */ - host->dms = kzalloc_obj(struct dw_mci_dma_slave, GFP_KERNEL); + host->dms = kzalloc_obj(struct dw_mci_dma_slave); if (!host->dms) return -ENOMEM; diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 8ab52b4de02e..b471a7795b4d 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1236,7 +1236,7 @@ static int mmc_spi_probe(struct spi_device *spi) } /* Preallocate buffers */ - host->data = kmalloc_obj(*host->data, GFP_KERNEL); + host->data = kmalloc_obj(*host->data); if (!host->data) goto fail_nobuf1; diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index d3137d23533c..8131a1703f28 100644 --- a/drivers/mmc/host/of_mmc_spi.c +++ b/drivers/mmc/host/of_mmc_spi.c @@ -57,7 +57,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) if (dev->platform_data || !dev_fwnode(dev)) return dev->platform_data; - oms = kzalloc_obj(*oms, GFP_KERNEL); + oms = kzalloc_obj(*oms); if (!oms) return NULL; diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c index 6a4274bac5c0..7e8af5a06ac9 100644 --- a/drivers/mmc/host/ushc.c +++ b/drivers/mmc/host/ushc.c @@ -462,7 +462,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->int_data = kzalloc_obj(struct ushc_int_data, GFP_KERNEL); + ushc->int_data = kzalloc_obj(struct ushc_int_data); if (ushc->int_data == NULL) { ret = -ENOMEM; goto err; @@ -479,7 +479,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->cbw = kzalloc_obj(struct ushc_cbw, GFP_KERNEL); + ushc->cbw = kzalloc_obj(struct ushc_cbw); if (ushc->cbw == NULL) { ret = -ENOMEM; goto err; @@ -501,7 +501,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id ret = -ENOMEM; goto err; } - ushc->csw = kzalloc_obj(struct ushc_csw, GFP_KERNEL); + ushc->csw = kzalloc_obj(struct ushc_csw); if (ushc->csw == NULL) { ret = -ENOMEM; goto err; diff --git a/drivers/most/configfs.c b/drivers/most/configfs.c index 03b977a4c070..8f5158d95bc3 100644 --- a/drivers/most/configfs.c +++ b/drivers/most/configfs.c @@ -426,7 +426,7 @@ static struct config_item *most_common_make_item(struct config_group *group, struct mdev_link *mdev_link; struct most_common *mc = to_most_common(group->cg_subsys); - mdev_link = kzalloc_obj(*mdev_link, GFP_KERNEL); + mdev_link = kzalloc_obj(*mdev_link); if (!mdev_link) return ERR_PTR(-ENOMEM); @@ -526,7 +526,7 @@ static struct config_item *most_snd_grp_make_item(struct config_group *group, { struct mdev_link *mdev_link; - mdev_link = kzalloc_obj(*mdev_link, GFP_KERNEL); + mdev_link = kzalloc_obj(*mdev_link); if (!mdev_link) return ERR_PTR(-ENOMEM); @@ -607,7 +607,7 @@ static struct config_group *most_sound_make_group(struct config_group *group, } if (!try_module_get(ms->mod)) return ERR_PTR(-ENOLCK); - most = kzalloc_obj(*most, GFP_KERNEL); + most = kzalloc_obj(*most); if (!most) { module_put(ms->mod); return ERR_PTR(-ENOMEM); diff --git a/drivers/most/core.c b/drivers/most/core.c index 3bbe8bed402a..c2616da8bceb 100644 --- a/drivers/most/core.c +++ b/drivers/most/core.c @@ -880,7 +880,7 @@ static int arm_mbo_chain(struct most_channel *c, int dir, atomic_set(&c->mbo_nq_level, 0); for (i = 0; i < c->cfg.num_buffers; i++) { - mbo = kzalloc_obj(*mbo, GFP_KERNEL); + mbo = kzalloc_obj(*mbo); if (!mbo) goto flush_fifos; @@ -1300,7 +1300,7 @@ int most_register_interface(struct most_interface *iface) return id; } - iface->p = kzalloc_obj(*iface->p, GFP_KERNEL); + iface->p = kzalloc_obj(*iface->p); if (!iface->p) { ida_free(&mdev_id, id); put_device(iface->dev); @@ -1324,7 +1324,7 @@ int most_register_interface(struct most_interface *iface) for (i = 0; i < iface->num_channels; i++) { const char *name_suffix = iface->channel_vector[i].name_suffix; - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) goto err_free_resources; if (!name_suffix) diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c index 87f770b03466..b31dc824466f 100644 --- a/drivers/most/most_cdev.c +++ b/drivers/most/most_cdev.c @@ -429,7 +429,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, if (current_minor < 0) return current_minor; - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) { retval = -ENOMEM; goto err_remove_ida; diff --git a/drivers/most/most_snd.c b/drivers/most/most_snd.c index ffd51f2d0d9b..68b9e6c64033 100644 --- a/drivers/most/most_snd.c +++ b/drivers/most/most_snd.c @@ -542,7 +542,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, adpt->pcm_dev_idx++; goto skip_adpt_alloc; } - adpt = kzalloc_obj(*adpt, GFP_KERNEL); + adpt = kzalloc_obj(*adpt); if (!adpt) return -ENOMEM; @@ -574,7 +574,7 @@ skip_adpt_alloc: capture_count = 1; direction = SNDRV_PCM_STREAM_CAPTURE; } - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) { ret = -ENOMEM; goto err_free_adpt; diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c index 0c61d023ac0a..d2c0875727a3 100644 --- a/drivers/most/most_usb.c +++ b/drivers/most/most_usb.c @@ -142,7 +142,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) __le16 *dma_buf; u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - dma_buf = kzalloc_obj(*dma_buf, GFP_KERNEL); + dma_buf = kzalloc_obj(*dma_buf); if (!dma_buf) return -ENOMEM; @@ -960,7 +960,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) struct usb_endpoint_descriptor *ep_desc; int ret = -ENOMEM; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; @@ -1000,11 +1000,11 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) mdev->dev.init_name = mdev->description; mdev->dev.parent = &interface->dev; mdev->dev.release = release_mdev; - mdev->conf = kzalloc_objs(*mdev->conf, num_endpoints, GFP_KERNEL); + mdev->conf = kzalloc_objs(*mdev->conf, num_endpoints); if (!mdev->conf) goto err_free_mdev; - mdev->cap = kzalloc_objs(*mdev->cap, num_endpoints, GFP_KERNEL); + mdev->cap = kzalloc_objs(*mdev->cap, num_endpoints); if (!mdev->cap) goto err_free_conf; @@ -1015,7 +1015,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) goto err_free_cap; mdev->busy_urbs = - kzalloc_objs(*mdev->busy_urbs, num_endpoints, GFP_KERNEL); + kzalloc_objs(*mdev->busy_urbs, num_endpoints); if (!mdev->busy_urbs) goto err_free_ep_address; @@ -1064,7 +1064,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 || le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81119 || le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81210) { - mdev->dci = kzalloc_obj(*mdev->dci, GFP_KERNEL); + mdev->dci = kzalloc_obj(*mdev->dci); if (!mdev->dci) { mutex_unlock(&mdev->io_mutex); most_deregister_interface(&mdev->iface); diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 9a54e390cd44..277a03924b2f 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -501,7 +501,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary) struct mtd_info *mtd; int i; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) return NULL; mtd->priv = map; diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index efb3ba02432e..63294a99d8fc 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -604,7 +604,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) struct mtd_info *mtd; int i; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) return NULL; mtd->priv = map; @@ -2818,7 +2818,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, for (i = 0; i < mtd->numeraseregions; i++) max_sectors += regions[i].numblocks; - sect = kzalloc_objs(struct ppb_lock, max_sectors, GFP_KERNEL); + sect = kzalloc_objs(struct ppb_lock, max_sectors); if (!sect) return -ENOMEM; diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 5665d3b72da1..a0e7d8a960c5 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c @@ -172,7 +172,7 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map) int i,j; unsigned long devsize = (1<cfiq->DevSize) * cfi->interleave; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); //printk(KERN_DEBUG "number of CFI chips: %d\n", cfi->numchips); if (!mtd) { diff --git a/drivers/mtd/chips/map_absent.c b/drivers/mtd/chips/map_absent.c index 6a9bd84a6def..1804a44b3eab 100644 --- a/drivers/mtd/chips/map_absent.c +++ b/drivers/mtd/chips/map_absent.c @@ -46,7 +46,7 @@ static struct mtd_info *map_absent_probe(struct map_info *map) { struct mtd_info *mtd; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) { return NULL; } diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index f94d20672423..2dde70e742c5 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c @@ -57,7 +57,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map) #endif /* OK. It seems to be RAM. */ - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) return NULL; diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index 644ef8d62cc8..dbc34e886b57 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c @@ -45,7 +45,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map) { struct mtd_info *mtd; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) return NULL; diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index 41b1c1348efe..03e80b2c4f5a 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -271,7 +271,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, if (!devname) return NULL; - dev = kzalloc_obj(struct block2mtd_dev, GFP_KERNEL); + dev = kzalloc_obj(struct block2mtd_dev); if (!dev) return NULL; diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 8db760b2c900..33050a2a80f7 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -1810,10 +1810,10 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev) struct mtd_info *mtd; ret = -ENOMEM; - docg3 = kzalloc_obj(struct docg3, GFP_KERNEL); + docg3 = kzalloc_obj(struct docg3); if (!docg3) goto nomem1; - mtd = kzalloc_obj(struct mtd_info, GFP_KERNEL); + mtd = kzalloc_obj(struct mtd_info); if (!mtd) goto nomem2; mtd->priv = docg3; diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c index 0a5d6ca1fe2f..453b3e05feb7 100644 --- a/drivers/mtd/devices/ms02-nv.c +++ b/drivers/mtd/devices/ms02-nv.c @@ -117,7 +117,7 @@ static int __init ms02nv_init_one(ulong addr) int ret = -ENODEV; /* The module decodes 8MiB of address space. */ - mod_res = kzalloc_obj(*mod_res, GFP_KERNEL); + mod_res = kzalloc_obj(*mod_res); if (!mod_res) return -ENOMEM; @@ -138,10 +138,10 @@ static int __init ms02nv_init_one(ulong addr) } ret = -ENOMEM; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) goto err_out_mod_res_rel; - mp = kzalloc_obj(*mp, GFP_KERNEL); + mp = kzalloc_obj(*mp); if (!mp) goto err_out_mtd; @@ -149,7 +149,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.module = mod_res; /* Firmware's diagnostic NVRAM area. */ - diag_res = kzalloc_obj(*diag_res, GFP_KERNEL); + diag_res = kzalloc_obj(*diag_res); if (!diag_res) goto err_out_mp; @@ -162,7 +162,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.diag_ram = diag_res; /* User-available general-purpose NVRAM area. */ - user_res = kzalloc_obj(*user_res, GFP_KERNEL); + user_res = kzalloc_obj(*user_res); if (!user_res) goto err_out_diag_res; @@ -175,7 +175,7 @@ static int __init ms02nv_init_one(ulong addr) mp->resource.user_ram = user_res; /* Control and status register. */ - csr_res = kzalloc_obj(*csr_res, GFP_KERNEL); + csr_res = kzalloc_obj(*csr_res); if (!csr_res) goto err_out_user_res; diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 3eebca290f50..e766258d76f7 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -627,7 +627,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages, char *otp_tag = ""; int err = 0; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/devices/mtd_intel_dg.c b/drivers/mtd/devices/mtd_intel_dg.c index ed5a07459012..c4c736ead0e5 100644 --- a/drivers/mtd/devices/mtd_intel_dg.c +++ b/drivers/mtd/devices/mtd_intel_dg.c @@ -720,7 +720,7 @@ static int intel_dg_nvm_init_mtd(struct intel_dg_nvm *nvm, struct device *device nvm->mtd.erasesize = SZ_4K; /* 4K bytes granularity */ nvm->mtd.size = nvm->size; - parts = kzalloc_objs(*parts, nvm->nregions, GFP_KERNEL); + parts = kzalloc_objs(*parts, nvm->nregions); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index 5418cfcfb1d9..3fff3cdd9834 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c @@ -158,7 +158,7 @@ static int __init init_mtdram(void) return -EINVAL; /* Allocate some memory */ - mtd_info = kmalloc_obj(struct mtd_info, GFP_KERNEL); + mtd_info = kmalloc_obj(struct mtd_info); if (!mtd_info) return -ENOMEM; diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index d35f43dec8e3..b42cadcd76b1 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c @@ -130,7 +130,7 @@ static int register_device(struct platform_device *pdev, const char *name, struct phram_mtd_list *new; int ret = -ENOMEM; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) goto out0; diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 1d793bf7ad71..dc0ebfeb846e 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -715,11 +715,11 @@ static int __init init_pmc551(void) msize = length; } - mtd = kzalloc_obj(struct mtd_info, GFP_KERNEL); + mtd = kzalloc_obj(struct mtd_info); if (!mtd) break; - priv = kzalloc_obj(struct mypriv, GFP_KERNEL); + priv = kzalloc_obj(struct mypriv); if (!priv) { kfree(mtd); break; diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index 1ac94e837f26..69cb63d99f57 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c @@ -135,17 +135,17 @@ static int register_device(char *name, unsigned long start, unsigned long length curmtd = &(*curmtd)->next; } - *curmtd = kmalloc_obj(slram_mtd_list_t, GFP_KERNEL); + *curmtd = kmalloc_obj(slram_mtd_list_t); if (!(*curmtd)) { E("slram: Cannot allocate new MTD device.\n"); return(-ENOMEM); } - (*curmtd)->mtdinfo = kzalloc_obj(struct mtd_info, GFP_KERNEL); + (*curmtd)->mtdinfo = kzalloc_obj(struct mtd_info); (*curmtd)->next = NULL; if ((*curmtd)->mtdinfo) { (*curmtd)->mtdinfo->priv = - kzalloc_obj(slram_priv_t, GFP_KERNEL); + kzalloc_obj(slram_priv_t); if (!(*curmtd)->mtdinfo->priv) { kfree((*curmtd)->mtdinfo); diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index bc372a0c040d..9b8d40d7aa37 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -201,7 +201,7 @@ static int build_maps(partition_t *part) /* Set up erase unit maps */ part->DataUnits = le16_to_cpu(part->header.NumEraseUnits) - part->header.NumTransferUnits; - part->EUNInfo = kmalloc_objs(struct eun_info_t, part->DataUnits, GFP_KERNEL); + part->EUNInfo = kmalloc_objs(struct eun_info_t, part->DataUnits); if (!part->EUNInfo) goto out; for (i = 0; i < part->DataUnits; i++) @@ -337,7 +337,7 @@ static int erase_xfer(partition_t *part, /* Is there a free erase slot? Always in MTD. */ - erase=kmalloc_obj(struct erase_info, GFP_KERNEL); + erase=kmalloc_obj(struct erase_info); if (!erase) return -ENOMEM; @@ -1005,7 +1005,7 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { partition_t *partition; - partition = kzalloc_obj(partition_t, GFP_KERNEL); + partition = kzalloc_obj(partition_t); if (!partition) { printk(KERN_WARNING "No memory to scan for FTL on %s\n", diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index cde1e3f52a49..1fb924a47227 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c @@ -52,7 +52,7 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) pr_debug("INFTL: add_mtd for %s\n", mtd->name); - inftl = kzalloc_obj(*inftl, GFP_KERNEL); + inftl = kzalloc_obj(*inftl); if (!inftl) return; diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index 97f960af44b4..a4167ee5e415 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -41,7 +41,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) int numchips; int i, j; - mtd = kzalloc_obj(*mtd, GFP_KERNEL); + mtd = kzalloc_obj(*mtd); if (!mtd) return NULL; mtd->priv = map; @@ -65,7 +65,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; mtd->writesize = 1 << lpddr->qinfo->BufSizeShift; - shared = kmalloc_objs(struct flchip_shared, lpddr->numchips, GFP_KERNEL); + shared = kmalloc_objs(struct flchip_shared, lpddr->numchips); if (!shared) { kfree(mtd); return NULL; diff --git a/drivers/mtd/lpddr/qinfo_probe.c b/drivers/mtd/lpddr/qinfo_probe.c index 9339da9f09a1..de05fe31754a 100644 --- a/drivers/mtd/lpddr/qinfo_probe.c +++ b/drivers/mtd/lpddr/qinfo_probe.c @@ -120,7 +120,7 @@ out: static int lpddr_chip_setup(struct map_info *map, struct lpddr_private *lpddr) { - lpddr->qinfo = kzalloc_obj(struct qinfo_chip, GFP_KERNEL); + lpddr->qinfo = kzalloc_obj(struct qinfo_chip); if (!lpddr->qinfo) return 0; diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index 1825f8e2898f..95f9b99ce5fc 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c @@ -188,7 +188,7 @@ static int amd76xrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) goto out; } diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c index 0ac4b26b1dd7..5e44134caa8e 100644 --- a/drivers/mtd/maps/ck804xrom.c +++ b/drivers/mtd/maps/ck804xrom.c @@ -218,7 +218,7 @@ static int __init ck804xrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) goto out; } diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c index 14d050a5629f..fc7f2c3a62b0 100644 --- a/drivers/mtd/maps/esb2rom.c +++ b/drivers/mtd/maps/esb2rom.c @@ -278,7 +278,7 @@ static int __init esb2rom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) goto out; } diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c index b940beb70b65..6608b782149b 100644 --- a/drivers/mtd/maps/ichxrom.c +++ b/drivers/mtd/maps/ichxrom.c @@ -212,7 +212,7 @@ static int __init ichxrom_init_one(struct pci_dev *pdev, int i; if (!map) { - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) goto out; } diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index b70b8edceb1b..4a84ca8aed40 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c @@ -264,7 +264,7 @@ static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) if (err) goto out; - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); err = -ENOMEM; if (!map) goto release; diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 8b7192ff6f04..a2e5a63e5d18 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -674,7 +674,7 @@ static int pcmciamtd_probe(struct pcmcia_device *link) struct pcmciamtd_dev *dev; /* Create new memory card device */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; pr_debug("dev=0x%p\n", dev); diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c index 30b95fd3352d..b0310fddcaa3 100644 --- a/drivers/mtd/maps/pismo.c +++ b/drivers/mtd/maps/pismo.c @@ -218,7 +218,7 @@ static int pismo_probe(struct i2c_client *client) return -EIO; } - pismo = kzalloc_obj(*pismo, GFP_KERNEL); + pismo = kzalloc_obj(*pismo); if (!pismo) return -ENOMEM; diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index d0f9b81ad7c5..816111031cf1 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c @@ -109,7 +109,7 @@ static int platram_probe(struct platform_device *pdev) pdata = dev_get_platdata(&pdev->dev); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info == NULL) { err = -ENOMEM; goto exit_error; diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 5ad7ae7a311c..bc303a9909d4 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -51,7 +51,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev) if (!res) return -ENODEV; - info = kzalloc_obj(struct pxa2xx_flash_info, GFP_KERNEL); + info = kzalloc_obj(struct pxa2xx_flash_info); if (!info) return -ENOMEM; diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index ed69df084352..8a1a0f0365ca 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c @@ -222,7 +222,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev, } else if (info->num_subdev > 1) { struct mtd_info **cdev; - cdev = kmalloc_objs(*cdev, nr, GFP_KERNEL); + cdev = kmalloc_objs(*cdev, nr); if (!cdev) { ret = -ENOMEM; goto err; diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index aebbf2931f1c..cac780cd23f9 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -61,7 +61,7 @@ static int uflash_devinit(struct platform_device *op, struct device_node *dp) return -ENODEV; } - up = kzalloc_obj(struct uflash_dev, GFP_KERNEL); + up = kzalloc_obj(struct uflash_dev); if (!up) return -ENOMEM; diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c index bd4ebcde51db..75e06d249ce9 100644 --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c @@ -73,7 +73,7 @@ static struct vmu_block *ofs_to_block(unsigned long src_ofs, if (num > card->parts[partition].numblocks) goto failed; - vblock = kmalloc_obj(struct vmu_block, GFP_KERNEL); + vblock = kmalloc_obj(struct vmu_block); if (!vblock) goto failed; @@ -539,7 +539,7 @@ static void vmu_queryblocks(struct mapleq *mq) mtd_cur->_sync = vmu_flash_sync; mtd_cur->writesize = card->blocklen; - mpart = kmalloc_obj(struct mdev_part, GFP_KERNEL); + mpart = kmalloc_obj(struct mdev_part); if (!mpart) goto fail_mpart; @@ -548,7 +548,7 @@ static void vmu_queryblocks(struct mapleq *mq) mtd_cur->priv = mpart; mtd_cur->owner = THIS_MODULE; - pcache = kzalloc_obj(struct vmu_cache, GFP_KERNEL); + pcache = kzalloc_obj(struct vmu_cache); if (!pcache) goto fail_cache_create; part_cur->pcache = pcache; @@ -609,7 +609,7 @@ static int vmu_connect(struct maple_device *mdev) basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); - card = kmalloc_obj(struct memcard, GFP_KERNEL); + card = kmalloc_obj(struct memcard); if (!card) { error = -ENOMEM; goto fail_nomem; @@ -627,13 +627,13 @@ static int vmu_connect(struct maple_device *mdev) * Not sure there are actually any multi-partition devices in the * real world, but the hardware supports them, so, so will we */ - card->parts = kmalloc_objs(struct vmupart, card->partitions, GFP_KERNEL); + card->parts = kmalloc_objs(struct vmupart, card->partitions); if (!card->parts) { error = -ENOMEM; goto fail_partitions; } - card->mtd = kmalloc_objs(struct mtd_info, card->partitions, GFP_KERNEL); + card->mtd = kmalloc_objs(struct mtd_info, card->partitions); if (!card->mtd) { error = -ENOMEM; goto fail_mtd_info; diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 470a838cbab7..4d2e7b7774e9 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -324,7 +324,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) new->readonly = 1; ret = -ENOMEM; - new->tag_set = kzalloc_obj(*new->tag_set, GFP_KERNEL); + new->tag_set = kzalloc_obj(*new->tag_set); if (!new->tag_set) goto out_list_del; diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index 80614f218228..c9143711fa39 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c @@ -316,7 +316,7 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev) static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { - struct mtdblk_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct mtdblk_dev *dev = kzalloc_obj(*dev); if (!dev) return; diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c index e82f27eec5ae..e564521d6911 100644 --- a/drivers/mtd/mtdblock_ro.c +++ b/drivers/mtd/mtdblock_ro.c @@ -36,7 +36,7 @@ static int mtdblock_writesect(struct mtd_blktrans_dev *dev, static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { - struct mtd_blktrans_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct mtd_blktrans_dev *dev = kzalloc_obj(*dev); if (!dev) return; diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 35b31fea77f3..55a43682c567 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -72,7 +72,7 @@ static int mtdchar_open(struct inode *inode, struct file *file) goto out1; } - mfi = kzalloc_obj(*mfi, GFP_KERNEL); + mfi = kzalloc_obj(*mfi); if (!mfi) { ret = -ENOMEM; goto out1; @@ -923,7 +923,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) { struct erase_info *erase; - erase=kzalloc_obj(struct erase_info, GFP_KERNEL); + erase=kzalloc_obj(struct erase_info); if (!erase) ret = -ENOMEM; else { @@ -1162,7 +1162,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) if (!master->ooblayout) return -EOPNOTSUPP; - usrlay = kmalloc_obj(*usrlay, GFP_KERNEL); + usrlay = kmalloc_obj(*usrlay); if (!usrlay) return -ENOMEM; diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index c4145ba218df..4ea98e398b30 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -416,7 +416,7 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr) } /* make a local copy of instr to avoid modifying the caller's struct */ - erase = kmalloc_obj(struct erase_info, GFP_KERNEL); + erase = kmalloc_obj(struct erase_info); if (!erase) return -ENOMEM; diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 2c0be153a96e..e016cfbc7224 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -53,7 +53,7 @@ static struct mtd_info *allocate_partition(struct mtd_info *parent, u64 tmp; /* allocate the partition structure */ - child = kzalloc_obj(*child, GFP_KERNEL); + child = kzalloc_obj(*child); name = kstrdup(part->name, GFP_KERNEL); if (!name || !child) { printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n", diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index a2d072da1bbe..866933fc8426 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c @@ -1413,11 +1413,11 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) "%u spare, %u bad blocks\n", MTDSWAP_PREFIX, part, swap_size / 1024, spare_cnt, bad_blocks); - d = kzalloc_obj(struct mtdswap_dev, GFP_KERNEL); + d = kzalloc_obj(struct mtdswap_dev); if (!d) return; - mbd_dev = kzalloc_obj(struct mtd_blktrans_dev, GFP_KERNEL); + mbd_dev = kzalloc_obj(struct mtd_blktrans_dev); if (!mbd_dev) { kfree(d); return; diff --git a/drivers/mtd/nand/ecc-sw-bch.c b/drivers/mtd/nand/ecc-sw-bch.c index 8ed20f176521..26d5f3f10964 100644 --- a/drivers/mtd/nand/ecc-sw-bch.c +++ b/drivers/mtd/nand/ecc-sw-bch.c @@ -227,7 +227,7 @@ int nand_ecc_sw_bch_init_ctx(struct nand_device *nand) return -EINVAL; } - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/ecc-sw-hamming.c b/drivers/mtd/nand/ecc-sw-hamming.c index 65fe971a409d..460acc1029c3 100644 --- a/drivers/mtd/nand/ecc-sw-hamming.c +++ b/drivers/mtd/nand/ecc-sw-hamming.c @@ -496,7 +496,7 @@ int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand) if (conf->step_size != 256 && conf->step_size != 512) conf->step_size = 256; - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/generic.c b/drivers/mtd/nand/onenand/generic.c index 69ca617985c8..3191904ced14 100644 --- a/drivers/mtd/nand/onenand/generic.c +++ b/drivers/mtd/nand/onenand/generic.c @@ -37,7 +37,7 @@ static int generic_onenand_probe(struct platform_device *pdev) unsigned long size = resource_size(res); int err; - info = kzalloc_obj(struct onenand_info, GFP_KERNEL); + info = kzalloc_obj(struct onenand_info); if (!info) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/onenand_bbt.c b/drivers/mtd/nand/onenand/onenand_bbt.c index 380e5051595f..012163fb6add 100644 --- a/drivers/mtd/nand/onenand/onenand_bbt.c +++ b/drivers/mtd/nand/onenand/onenand_bbt.c @@ -231,7 +231,7 @@ int onenand_default_bbt(struct mtd_info *mtd) struct onenand_chip *this = mtd->priv; struct bbm_info *bbm; - this->bbm = kzalloc_obj(struct bbm_info, GFP_KERNEL); + this->bbm = kzalloc_obj(struct bbm_info); if (!this->bbm) return -ENOMEM; diff --git a/drivers/mtd/nand/qpic_common.c b/drivers/mtd/nand/qpic_common.c index 0acd6c65f326..4f3e4dd766da 100644 --- a/drivers/mtd/nand/qpic_common.c +++ b/drivers/mtd/nand/qpic_common.c @@ -156,7 +156,7 @@ int qcom_prepare_bam_async_desc(struct qcom_nand_controller *nandc, enum dma_transfer_direction dir_eng; struct dma_async_tx_descriptor *dma_desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; @@ -364,7 +364,7 @@ int qcom_prep_adm_dma_desc(struct qcom_nand_controller *nandc, bool read, struct scatterlist *sgl; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c index 6b09eb643ed2..f1e99197ab84 100644 --- a/drivers/mtd/nand/raw/au1550nd.c +++ b/drivers/mtd/nand/raw/au1550nd.c @@ -266,7 +266,7 @@ static int au1550nd_probe(struct platform_device *pdev) return -ENODEV; } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/cafe_nand.c b/drivers/mtd/nand/raw/cafe_nand.c index b05a41ce2e35..65a36d5de742 100644 --- a/drivers/mtd/nand/raw/cafe_nand.c +++ b/drivers/mtd/nand/raw/cafe_nand.c @@ -678,7 +678,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, pci_set_master(pdev); - cafe = kzalloc_obj(*cafe, GFP_KERNEL); + cafe = kzalloc_obj(*cafe); if (!cafe) { err = -ENOMEM; goto out_disable_device; diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c index ca2a7e16b5d8..0b872b1e3b04 100644 --- a/drivers/mtd/nand/raw/cs553x_nand.c +++ b/drivers/mtd/nand/raw/cs553x_nand.c @@ -273,7 +273,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) } /* Allocate memory for MTD device structure and private data */ - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c index fdca096d74ba..c655d27bc4cc 100644 --- a/drivers/mtd/nand/raw/fsl_elbc_nand.c +++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c @@ -895,13 +895,13 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev) return -ENODEV; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; mutex_lock(&fsl_elbc_nand_mutex); if (!fsl_lbc_ctrl_dev->nand) { - elbc_fcm_ctrl = kzalloc_obj(*elbc_fcm_ctrl, GFP_KERNEL); + elbc_fcm_ctrl = kzalloc_obj(*elbc_fcm_ctrl); if (!elbc_fcm_ctrl) { mutex_unlock(&fsl_elbc_nand_mutex); ret = -ENOMEM; diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c index 6eb507f6a204..dd88b22a91bd 100644 --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c @@ -1018,7 +1018,7 @@ static int fsl_ifc_nand_probe(struct platform_device *dev) mutex_lock(&fsl_ifc_nand_mutex); if (!fsl_ifc_ctrl_dev->nand) { - ifc_nand_ctrl = kzalloc_obj(*ifc_nand_ctrl, GFP_KERNEL); + ifc_nand_ctrl = kzalloc_obj(*ifc_nand_ctrl); if (!ifc_nand_ctrl) { mutex_unlock(&fsl_ifc_nand_mutex); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 29f603fb2d8f..770c26f9c6ce 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -1062,7 +1062,7 @@ static int nand_choose_interface_config(struct nand_chip *chip) if (!nand_controller_can_setup_interface(chip)) return 0; - iface = kzalloc_obj(*iface, GFP_KERNEL); + iface = kzalloc_obj(*iface); if (!iface) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_bbt.c b/drivers/mtd/nand/raw/nand_bbt.c index 5e500bf2a3c2..b0e7592a2ab7 100644 --- a/drivers/mtd/nand/raw/nand_bbt.c +++ b/drivers/mtd/nand/raw/nand_bbt.c @@ -1375,7 +1375,7 @@ static int nand_create_badblock_pattern(struct nand_chip *this) pr_warn("Bad block pattern already allocated; not replacing\n"); return -EINVAL; } - bd = kzalloc_obj(*bd, GFP_KERNEL); + bd = kzalloc_obj(*bd); if (!bd) return -ENOMEM; bd->options = this->bbt_options & BADBLOCK_SCAN_MASK; diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c index 12f4e5d1038e..0510ceff591d 100644 --- a/drivers/mtd/nand/raw/nand_hynix.c +++ b/drivers/mtd/nand/raw/nand_hynix.c @@ -705,7 +705,7 @@ static int hynix_nand_init(struct nand_chip *chip) else chip->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; - hynix = kzalloc_obj(*hynix, GFP_KERNEL); + hynix = kzalloc_obj(*hynix); if (!hynix) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c index 8b2725863fbf..b523bf65746b 100644 --- a/drivers/mtd/nand/raw/nand_jedec.c +++ b/drivers/mtd/nand/raw/nand_jedec.c @@ -42,7 +42,7 @@ int nand_jedec_detect(struct nand_chip *chip) return 0; /* JEDEC chip: allocate a buffer to hold its parameter page */ - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index b97a2bd606ae..8807b8aade41 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c @@ -484,7 +484,7 @@ static int micron_nand_init(struct nand_chip *chip) int ondie; int ret; - micron = kzalloc_obj(*micron, GFP_KERNEL); + micron = kzalloc_obj(*micron); if (!micron) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c index c4e7304372f1..cd3ad373883e 100644 --- a/drivers/mtd/nand/raw/nand_onfi.c +++ b/drivers/mtd/nand/raw/nand_onfi.c @@ -306,7 +306,7 @@ int nand_onfi_detect(struct nand_chip *chip) if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_READ_CACHE) chip->parameters.supports_read_cache = true; - onfi = kzalloc_obj(*onfi, GFP_KERNEL); + onfi = kzalloc_obj(*onfi); if (!onfi) { ret = -ENOMEM; goto free_model; diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c index 4e7ea6c11a15..fe968037f75a 100644 --- a/drivers/mtd/nand/raw/nandsim.c +++ b/drivers/mtd/nand/raw/nandsim.c @@ -851,7 +851,7 @@ static int ns_parse_weakblocks(void) } if (*w == ',') w += 1; - wb = kzalloc_obj(*wb, GFP_KERNEL); + wb = kzalloc_obj(*wb); if (!wb) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -902,7 +902,7 @@ static int ns_parse_weakpages(void) } if (*w == ',') w += 1; - wp = kzalloc_obj(*wp, GFP_KERNEL); + wp = kzalloc_obj(*wp); if (!wp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -953,7 +953,7 @@ static int ns_parse_gravepages(void) } if (*g == ',') g += 1; - gp = kzalloc_obj(*gp, GFP_KERNEL); + gp = kzalloc_obj(*gp); if (!gp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -2268,7 +2268,7 @@ static int __init ns_init_module(void) return -EINVAL; } - ns = kzalloc_obj(struct nandsim, GFP_KERNEL); + ns = kzalloc_obj(struct nandsim); if (!ns) { NS_ERR("unable to allocate core structures.\n"); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c index 05d3e58c50dc..09409b703d93 100644 --- a/drivers/mtd/nand/raw/pasemi_nand.c +++ b/drivers/mtd/nand/raw/pasemi_nand.c @@ -113,7 +113,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) dev_dbg(dev, "pasemi_nand at %pR\n", &res); /* Allocate memory for MTD device structure and private data */ - ddata = kzalloc_obj(*ddata, GFP_KERNEL); + ddata = kzalloc_obj(*ddata); if (!ddata) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c index 24e702919b87..8a5572b30893 100644 --- a/drivers/mtd/nand/raw/r852.c +++ b/drivers/mtd/nand/raw/r852.c @@ -867,7 +867,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) error = -ENOMEM; /* init nand chip, but register it only on card insert */ - chip = kzalloc_obj(struct nand_chip, GFP_KERNEL); + chip = kzalloc_obj(struct nand_chip); if (!chip) goto error4; @@ -883,7 +883,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) chip->legacy.write_buf = r852_write_buf; /* init our device structure */ - dev = kzalloc_obj(struct r852_device, GFP_KERNEL); + dev = kzalloc_obj(struct r852_device); if (!dev) goto error5; diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c index d74097783036..4154ab74f169 100644 --- a/drivers/mtd/nand/raw/sharpsl.c +++ b/drivers/mtd/nand/raw/sharpsl.c @@ -132,7 +132,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) } /* Allocate memory for MTD device structure and private data */ - sharpsl = kzalloc_obj(struct sharpsl_nand, GFP_KERNEL); + sharpsl = kzalloc_obj(struct sharpsl_nand); if (!sharpsl) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c index e49c38abef68..4cc6e91dbc23 100644 --- a/drivers/mtd/nand/raw/txx9ndfmc.c +++ b/drivers/mtd/nand/raw/txx9ndfmc.c @@ -319,7 +319,7 @@ static int txx9ndfmc_probe(struct platform_device *dev) if (!(plat->ch_mask & (1 << i))) continue; - txx9_priv = kzalloc_obj(struct txx9ndfmc_priv, GFP_KERNEL); + txx9_priv = kzalloc_obj(struct txx9ndfmc_priv); if (!txx9_priv) continue; chip = &txx9_priv->chip; diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 86dee7d13a38..8aa3753aaaa1 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -350,7 +350,7 @@ static int spinand_ondie_ecc_init_ctx(struct nand_device *nand) nand->ecc.ctx.conf.step_size = nand->ecc.requirements.step_size; nand->ecc.ctx.conf.strength = nand->ecc.requirements.strength; - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index 137571093ec0..a6d6d6e0cc37 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -642,7 +642,7 @@ static int gd5fxgm9_spinand_init(struct spinand_device *spinand) { struct gigadevice_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index 2e6b9be9c58b..67cafa1bb8ef 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -499,7 +499,7 @@ static int macronix_spinand_init(struct spinand_device *spinand) { struct macronix_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index 9f3c193fb0c4..6b29b9c7a6a6 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c @@ -45,7 +45,7 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) pr_debug("NFTL: add_mtd for %s\n", mtd->name); - nftl = kzalloc_obj(struct NFTLrecord, GFP_KERNEL); + nftl = kzalloc_obj(struct NFTLrecord); if (!nftl) return; diff --git a/drivers/mtd/parsers/brcm_u-boot.c b/drivers/mtd/parsers/brcm_u-boot.c index 168cd629c277..cd78e432f1de 100644 --- a/drivers/mtd/parsers/brcm_u-boot.c +++ b/drivers/mtd/parsers/brcm_u-boot.c @@ -37,7 +37,7 @@ static int brcm_u_boot_parse(struct mtd_info *mtd, int err; int i = 0; - parts = kzalloc_objs(*parts, BRCM_U_BOOT_MAX_PARTS, GFP_KERNEL); + parts = kzalloc_objs(*parts, BRCM_U_BOOT_MAX_PARTS); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/ofpart_core.c b/drivers/mtd/parsers/ofpart_core.c index 02cf6a539e3f..0029bda165bd 100644 --- a/drivers/mtd/parsers/ofpart_core.c +++ b/drivers/mtd/parsers/ofpart_core.c @@ -102,7 +102,7 @@ static int parse_fixed_partitions(struct mtd_info *master, return 0; } - parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts); if (!parts) { if (dedicated) of_node_put(ofpart_node); @@ -249,7 +249,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master, nr_parts = plen / sizeof(part[0]); - parts = kzalloc_objs(*parts, nr_parts, GFP_KERNEL); + parts = kzalloc_objs(*parts, nr_parts); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c index dd595387946b..d4fdc46a0073 100644 --- a/drivers/mtd/parsers/qcomsmempart.c +++ b/drivers/mtd/parsers/qcomsmempart.c @@ -123,7 +123,7 @@ static int parse_qcomsmem_part(struct mtd_info *mtd, numparts++; } - parts = kzalloc_objs(*parts, numparts, GFP_KERNEL); + parts = kzalloc_objs(*parts, numparts); if (!parts) return -ENOMEM; diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c index 4f3f5145ea83..558905160ddb 100644 --- a/drivers/mtd/parsers/redboot.c +++ b/drivers/mtd/parsers/redboot.c @@ -203,7 +203,7 @@ nogood: if (!redboot_checksum(&buf[i])) break; - new_fl = kmalloc_obj(struct fis_list, GFP_KERNEL); + new_fl = kmalloc_obj(struct fis_list); namelen += strlen(buf[i].name) + 1; if (!new_fl) { ret = -ENOMEM; diff --git a/drivers/mtd/parsers/scpart.c b/drivers/mtd/parsers/scpart.c index 84b89499b200..87432dc99265 100644 --- a/drivers/mtd/parsers/scpart.c +++ b/drivers/mtd/parsers/scpart.c @@ -80,7 +80,7 @@ static int scpart_scan_partmap(struct mtd_info *master, loff_t partmap_offs, if (cnt > 0) { int bytes = cnt * sizeof(*pdesc); - pdesc = kzalloc_objs(*pdesc, cnt, GFP_KERNEL); + pdesc = kzalloc_objs(*pdesc, cnt); if (!pdesc) { res = -ENOMEM; goto free; diff --git a/drivers/mtd/parsers/tplink_safeloader.c b/drivers/mtd/parsers/tplink_safeloader.c index 3a4e9b84277f..b770f41ef874 100644 --- a/drivers/mtd/parsers/tplink_safeloader.c +++ b/drivers/mtd/parsers/tplink_safeloader.c @@ -82,7 +82,7 @@ static int mtd_parser_tplink_safeloader_parse(struct mtd_info *mtd, int idx; int err; - parts = kzalloc_objs(*parts, TPLINK_SAFELOADER_MAX_PARTS, GFP_KERNEL); + parts = kzalloc_objs(*parts, TPLINK_SAFELOADER_MAX_PARTS); if (!parts) { err = -ENOMEM; goto err_out; diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index f7d5591e8858..3199453b3bc9 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -270,7 +270,7 @@ static int erase_block(struct partition *part, int block) struct erase_info *erase; int rc; - erase = kmalloc_obj(struct erase_info, GFP_KERNEL); + erase = kmalloc_obj(struct erase_info); if (!erase) return -ENOMEM; @@ -752,7 +752,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) mtd->size > UINT_MAX) return; - part = kzalloc_obj(struct partition, GFP_KERNEL); + part = kzalloc_obj(struct partition); if (!part) return; diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index 5da82a4612b6..512012fd39f8 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -64,7 +64,7 @@ static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) /* Initialize sysfs attributes */ vendor_attribute = - kzalloc_obj(struct sm_sysfs_attribute, GFP_KERNEL); + kzalloc_obj(struct sm_sysfs_attribute); if (!vendor_attribute) goto error2; @@ -85,7 +85,7 @@ static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) attributes[0] = &vendor_attribute->dev_attr.attr; /* Finally create the attribute group */ - attr_group = kzalloc_obj(struct attribute_group, GFP_KERNEL); + attr_group = kzalloc_obj(struct attribute_group); if (!attr_group) goto error4; attr_group->attrs = attributes; @@ -1134,7 +1134,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) struct sm_ftl *ftl; /* Allocate & initialize our private structure */ - ftl = kzalloc_obj(struct sm_ftl, GFP_KERNEL); + ftl = kzalloc_obj(struct sm_ftl); if (!ftl) goto error1; @@ -1156,7 +1156,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) goto error2; /* Allocate zone array, it will be initialized on demand */ - ftl->zones = kzalloc_objs(struct ftl_zone, ftl->zone_count, GFP_KERNEL); + ftl->zones = kzalloc_objs(struct ftl_zone, ftl->zone_count); if (!ftl->zones) goto error3; @@ -1170,7 +1170,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) /* Allocate upper layer structure and initialize it */ - trans = kzalloc_obj(struct mtd_blktrans_dev, GFP_KERNEL); + trans = kzalloc_obj(struct mtd_blktrans_dev); if (!trans) goto error5; diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index d48170eceec6..8ffeb41c3e08 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1553,7 +1553,7 @@ spi_nor_init_erase_cmd(const struct spi_nor_erase_region *region, { struct spi_nor_erase_command *cmd; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return ERR_PTR(-ENOMEM); diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c index 1514f21c8557..4600983cb579 100644 --- a/drivers/mtd/spi-nor/sfdp.c +++ b/drivers/mtd/spi-nor/sfdp.c @@ -760,7 +760,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt, u8 read_data_mask, map_id; /* Use a kmalloc'ed bounce buffer to guarantee it is DMA-able. */ - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index b4e9a1c11c54..4a5225699a54 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c @@ -295,7 +295,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) if (cis_sector == -1) return; - ssfdc = kzalloc_obj(*ssfdc, GFP_KERNEL); + ssfdc = kzalloc_obj(*ssfdc); if (!ssfdc) return; diff --git a/drivers/mtd/tests/stresstest.c b/drivers/mtd/tests/stresstest.c index ec5d7bd93b77..944f960a4bbf 100644 --- a/drivers/mtd/tests/stresstest.c +++ b/drivers/mtd/tests/stresstest.c @@ -178,7 +178,7 @@ static int __init mtd_stresstest_init(void) err = -ENOMEM; readbuf = vmalloc(bufsize); writebuf = vmalloc(bufsize); - offsets = kmalloc_objs(int, ebcnt, GFP_KERNEL); + offsets = kmalloc_objs(int, ebcnt); if (!readbuf || !writebuf || !offsets) goto out; for (i = 0; i < ebcnt; i++) diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 9823e0bd7a51..0fa115cbf3ad 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c @@ -131,7 +131,7 @@ static struct ubi_ainf_volume *find_or_add_av(struct ubi_attach_info *ai, return NULL; /* The volume is absent - add it */ - av = kzalloc_obj(*av, GFP_KERNEL); + av = kzalloc_obj(*av); if (!av) return ERR_PTR(-ENOMEM); @@ -1451,7 +1451,7 @@ static struct ubi_attach_info *alloc_ai(const char *slab_name) { struct ubi_attach_info *ai; - ai = kzalloc_obj(struct ubi_attach_info, GFP_KERNEL); + ai = kzalloc_obj(struct ubi_attach_info); if (!ai) return ai; diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c index 4428486fb287..8880a783c3bc 100644 --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c @@ -368,7 +368,7 @@ int ubiblock_create(struct ubi_volume_info *vi) goto out_unlock; } - dev = kzalloc_obj(struct ubiblock, GFP_KERNEL); + dev = kzalloc_obj(struct ubiblock); if (!dev) { ret = -ENOMEM; goto out_unlock; diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index d7493b61bee4..674ad87809df 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -930,7 +930,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, } } - ubi = kzalloc_obj(struct ubi_device, GFP_KERNEL); + ubi = kzalloc_obj(struct ubi_device); if (!ubi) return -ENOMEM; diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 0b233b6a2d9c..fd39030dbf89 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -727,7 +727,7 @@ static int rename_volumes(struct ubi_device *ubi, int name_len = req->ents[i].name_len; const char *name = req->ents[i].name; - re = kzalloc_obj(struct ubi_rename_entry, GFP_KERNEL); + re = kzalloc_obj(struct ubi_rename_entry); if (!re) { err = -ENOMEM; goto out_free; @@ -801,7 +801,7 @@ static int rename_volumes(struct ubi_device *ubi, goto out_free; } - re1 = kzalloc_obj(struct ubi_rename_entry, GFP_KERNEL); + re1 = kzalloc_obj(struct ubi_rename_entry); if (!re1) { err = -ENOMEM; ubi_close_volume(desc); @@ -1007,7 +1007,7 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd, struct ubi_rnvol_req *req; dbg_gen("re-name volumes"); - req = kmalloc_obj(struct ubi_rnvol_req, GFP_KERNEL); + req = kmalloc_obj(struct ubi_rnvol_req); if (!req) { err = -ENOMEM; break; diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index dbc448e2b7a6..35e047392d4a 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -124,11 +124,11 @@ struct ubi_eba_table *ubi_eba_create_table(struct ubi_volume *vol, int err = -ENOMEM; int i; - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (!tbl) return ERR_PTR(-ENOMEM); - tbl->entries = kmalloc_objs(*tbl->entries, nentries, GFP_KERNEL); + tbl->entries = kmalloc_objs(*tbl->entries, nentries); if (!tbl->entries) goto err; @@ -1535,11 +1535,11 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap, num_volumes = ubi->vtbl_slots + UBI_INT_VOL_COUNT; - scan_eba = kmalloc_objs(*scan_eba, num_volumes, GFP_KERNEL); + scan_eba = kmalloc_objs(*scan_eba, num_volumes); if (!scan_eba) return -ENOMEM; - fm_eba = kmalloc_objs(*fm_eba, num_volumes, GFP_KERNEL); + fm_eba = kmalloc_objs(*fm_eba, num_volumes); if (!fm_eba) { kfree(scan_eba); return -ENOMEM; diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 30953ff2ff52..3bce1b4d8464 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -889,13 +889,13 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai, down_write(&ubi->fm_protect); memset(ubi->fm_buf, 0, ubi->fm_size); - fmsb = kmalloc_obj(*fmsb, GFP_KERNEL); + fmsb = kmalloc_obj(*fmsb); if (!fmsb) { ret = -ENOMEM; goto out; } - fm = kzalloc_obj(*fm, GFP_KERNEL); + fm = kzalloc_obj(*fm); if (!fm) { ret = -ENOMEM; kfree(fmsb); diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c index e56b4172264c..e3891ae82dfa 100644 --- a/drivers/mtd/ubi/gluebi.c +++ b/drivers/mtd/ubi/gluebi.c @@ -281,7 +281,7 @@ static int gluebi_create(struct ubi_device_info *di, struct gluebi_device *gluebi, *g; struct mtd_info *mtd; - gluebi = kzalloc_obj(struct gluebi_device, GFP_KERNEL); + gluebi = kzalloc_obj(struct gluebi_device); if (!gluebi) return -ENOMEM; diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 7cc239245e42..9626990f67cb 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -140,7 +140,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) goto out_put_ubi; } - desc = kmalloc_obj(struct ubi_volume_desc, GFP_KERNEL); + desc = kmalloc_obj(struct ubi_volume_desc); if (!desc) { err = -ENOMEM; goto out_put_ubi; diff --git a/drivers/mtd/ubi/nvmem.c b/drivers/mtd/ubi/nvmem.c index bc2cfb355d5c..2dade9727cf2 100644 --- a/drivers/mtd/ubi/nvmem.c +++ b/drivers/mtd/ubi/nvmem.c @@ -75,7 +75,7 @@ static int ubi_nvmem_add(struct ubi_volume_info *vi) WARN_ON_ONCE(vi->size <= 0)) return -EINVAL; - unv = kzalloc_obj(struct ubi_nvmem, GFP_KERNEL); + unv = kzalloc_obj(struct ubi_nvmem); if (!unv) return -ENOMEM; diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index ffec2c649698..50192b95b6e4 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -172,7 +172,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) if (ubi->ro_mode) return -EROFS; - vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume); if (!vol) return -ENOMEM; diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 74427a03e896..06d87a3013a5 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -531,7 +531,7 @@ static int init_volumes(struct ubi_device *ubi, if (be32_to_cpu(vtbl[i].reserved_pebs) == 0) continue; /* Empty record */ - vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume); if (!vol) return -ENOMEM; @@ -623,7 +623,7 @@ static int init_volumes(struct ubi_device *ubi, } /* And add the layout volume */ - vol = kzalloc_obj(struct ubi_volume, GFP_KERNEL); + vol = kzalloc_obj(struct ubi_volume); if (!vol) return -ENOMEM; diff --git a/drivers/mux/core.c b/drivers/mux/core.c index 236e4f02f38e..f09ee8782e3d 100644 --- a/drivers/mux/core.c +++ b/drivers/mux/core.c @@ -681,7 +681,7 @@ static struct mux_state *mux_state_get(struct device *dev, const char *mux_name) { struct mux_state *mstate; - mstate = kzalloc_obj(*mstate, GFP_KERNEL); + mstate = kzalloc_obj(*mstate); if (!mstate) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c index a6d9207cfc16..5c3c91677b62 100644 --- a/drivers/net/arcnet/com20020_cs.c +++ b/drivers/net/arcnet/com20020_cs.c @@ -119,7 +119,7 @@ static int com20020_probe(struct pcmcia_device *p_dev) dev_dbg(&p_dev->dev, "com20020_attach()\n"); /* Create new network device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) goto fail_alloc_info; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index cddcbb5883c6..c9bf8ec00a36 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -491,7 +491,7 @@ static int bond_ipsec_add_sa(struct net_device *bond_dev, goto out; } - ipsec = kmalloc_obj(*ipsec, GFP_KERNEL); + ipsec = kmalloc_obj(*ipsec); if (!ipsec) { err = -ENOMEM; goto out; @@ -1387,7 +1387,7 @@ static inline int slave_enable_netpoll(struct slave *slave) struct netpoll *np; int err = 0; - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); err = -ENOMEM; if (!np) goto out; @@ -1711,7 +1711,7 @@ static struct slave *bond_alloc_slave(struct bonding *bond, { struct slave *slave = NULL; - slave = kzalloc_obj(*slave, GFP_KERNEL); + slave = kzalloc_obj(*slave); if (!slave) return NULL; diff --git a/drivers/net/can/ctucanfd/ctucanfd_pci.c b/drivers/net/can/ctucanfd/ctucanfd_pci.c index 2d731a6f0be0..7b847b667973 100644 --- a/drivers/net/can/ctucanfd/ctucanfd_pci.c +++ b/drivers/net/can/ctucanfd/ctucanfd_pci.c @@ -153,7 +153,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev, ntxbufs = 4; - bdata = kzalloc_obj(*bdata, GFP_KERNEL); + bdata = kzalloc_obj(*bdata); if (!bdata) { ret = -ENOMEM; goto err_pci_iounmap_bar0; diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c index 56758ddf939b..ce12fa6df56d 100644 --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -1054,7 +1054,7 @@ static int grcan_open(struct net_device *dev) return err; } - priv->echo_skb = kzalloc_objs(*priv->echo_skb, dma->tx.size, GFP_KERNEL); + priv->echo_skb = kzalloc_objs(*priv->echo_skb, dma->tx.size); if (!priv->echo_skb) { err = -ENOMEM; goto exit_free_dma_buffers; diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c index c4716df2e00f..986fc8786fac 100644 --- a/drivers/net/can/sja1000/ems_pci.c +++ b/drivers/net/can/sja1000/ems_pci.c @@ -260,7 +260,7 @@ static int ems_pci_add_card(struct pci_dev *pdev, } /* Allocating card structures to hold addresses, ... */ - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) { pci_disable_device(pdev); return -ENOMEM; diff --git a/drivers/net/can/sja1000/ems_pcmcia.c b/drivers/net/can/sja1000/ems_pcmcia.c index fad4c51767ed..3cae1cd1a104 100644 --- a/drivers/net/can/sja1000/ems_pcmcia.c +++ b/drivers/net/can/sja1000/ems_pcmcia.c @@ -165,7 +165,7 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base) int err, i; /* Allocating card structures to hold addresses, ... */ - card = kzalloc_obj(struct ems_pcmcia_card, GFP_KERNEL); + card = kzalloc_obj(struct ems_pcmcia_card); if (!card) return -ENOMEM; diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index 4ab825636092..4cc4a1581dd1 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c @@ -452,7 +452,7 @@ static int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev) /* channel is the first one: do the init part */ } else { /* create the bit banging I2C adapter structure */ - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) return -ENOMEM; diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c index 04b37c746620..42a77d435b39 100644 --- a/drivers/net/can/sja1000/peak_pcmcia.c +++ b/drivers/net/can/sja1000/peak_pcmcia.c @@ -650,7 +650,7 @@ static int pcan_probe(struct pcmcia_device *pdev) goto probe_err_1; } - card = kzalloc_obj(struct pcan_pccard, GFP_KERNEL); + card = kzalloc_obj(struct pcan_pccard); if (!card) { err = -ENOMEM; goto probe_err_2; diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c index d1c9427f6a5d..08183833c9bc 100644 --- a/drivers/net/can/sja1000/plx_pci.c +++ b/drivers/net/can/sja1000/plx_pci.c @@ -629,7 +629,7 @@ static int plx_pci_add_card(struct pci_dev *pdev, ci->name, PCI_SLOT(pdev->devfn)); /* Allocate card structures to hold addresses, ... */ - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) { pci_disable_device(pdev); return -ENOMEM; diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c index c37390fa7e6a..3cea14cf055a 100644 --- a/drivers/net/can/softing/softing_cs.c +++ b/drivers/net/can/softing/softing_cs.c @@ -256,7 +256,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia) } /* create softing platform device */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { ret = -ENOMEM; goto mem_failed; diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 4872f636e367..519ab3097f86 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -767,7 +767,7 @@ static int softing_pdev_probe(struct platform_device *pdev) return -EINVAL; } - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) return -ENOMEM; card->pdat = pdat; diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index 6ef8a3fa2f1e..9c86df08c2c5 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -1961,11 +1961,11 @@ mcp251xfd_register_get_dev_id(const struct mcp251xfd_priv *priv, u32 *dev_id, struct spi_transfer xfer[2] = { }; int err; - buf_rx = kzalloc_obj(*buf_rx, GFP_KERNEL); + buf_rx = kzalloc_obj(*buf_rx); if (!buf_rx) return -ENOMEM; - buf_tx = kzalloc_obj(*buf_tx, GFP_KERNEL); + buf_tx = kzalloc_obj(*buf_tx); if (!buf_tx) { err = -ENOMEM; goto out_kfree_buf_rx; diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 029a321bac10..2892a68f510a 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -726,7 +726,7 @@ static int esd_usb_start(struct esd_usb_net_priv *priv) union esd_usb_msg *msg; int err, i; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) { err = -ENOMEM; goto out; @@ -962,7 +962,7 @@ static int esd_usb_stop(struct esd_usb_net_priv *priv) int err; int i; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1068,7 +1068,7 @@ static int esd_usb_2_set_bittiming(struct net_device *netdev) if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) canbtr |= ESD_USB_TRIPLE_SAMPLES; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1130,7 +1130,7 @@ static int esd_usb_3_set_bittiming(struct net_device *netdev) u16 flags = 0; int err; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1302,7 +1302,7 @@ static int esd_usb_probe(struct usb_interface *intf, union esd_usb_msg *msg; int i, err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { err = -ENOMEM; goto done; @@ -1314,7 +1314,7 @@ static int esd_usb_probe(struct usb_interface *intf, usb_set_intfdata(intf, dev); - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) { err = -ENOMEM; goto free_msg; diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c index 435c7d878138..76578063ac82 100644 --- a/drivers/net/can/usb/f81604.c +++ b/drivers/net/can/usb/f81604.c @@ -678,7 +678,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) break; } - frame = kmalloc_obj(*frame, GFP_KERNEL); + frame = kmalloc_obj(*frame); if (!frame) { usb_free_urb(rx_urb); ret = -ENOMEM; @@ -717,7 +717,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) goto error; } - int_data = kmalloc_obj(*int_data, GFP_KERNEL); + int_data = kmalloc_obj(*int_data); if (!int_data) { usb_free_urb(int_urb); ret = -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index e765210626ce..e09d663e362f 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -580,7 +580,7 @@ static int kvaser_usb_hydra_send_simple_cmd(struct kvaser_usb *dev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -742,7 +742,7 @@ static int kvaser_usb_hydra_map_channel(struct kvaser_usb *dev, u16 transid, struct kvaser_cmd *cmd; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -784,7 +784,7 @@ static int kvaser_usb_hydra_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1610,7 +1610,7 @@ static int kvaser_usb_hydra_get_busparams(struct kvaser_usb_net_priv *priv, if (!hydra) return -EINVAL; - cmd = kzalloc_objs(struct kvaser_cmd, 1, GFP_KERNEL); + cmd = kzalloc_objs(struct kvaser_cmd, 1); if (!cmd) return -ENOMEM; @@ -1655,7 +1655,7 @@ static int kvaser_usb_hydra_set_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1685,7 +1685,7 @@ static int kvaser_usb_hydra_set_data_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1842,7 +1842,7 @@ static int kvaser_usb_hydra_get_software_details(struct kvaser_usb *dev) u32 fw_version; struct kvaser_usb_dev_card_data *card_data = &dev->card_data; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1985,7 +1985,7 @@ static int kvaser_usb_hydra_set_led(struct kvaser_usb_net_priv *priv, size_t cmd_len; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -2021,7 +2021,7 @@ static int kvaser_usb_hydra_set_opt_mode(const struct kvaser_usb_net_priv *priv) return -EINVAL; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index 8e32d98ab0a3..fd191ec5738b 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -723,7 +723,7 @@ static int kvaser_usb_leaf_send_simple_cmd(const struct kvaser_usb *dev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -873,7 +873,7 @@ static int kvaser_usb_leaf_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -970,7 +970,7 @@ static int kvaser_usb_leaf_set_led(struct kvaser_usb_net_priv *priv, struct kvaser_cmd *cmd; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1752,7 +1752,7 @@ static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1824,7 +1824,7 @@ static int kvaser_usb_leaf_flush_queue(struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1881,7 +1881,7 @@ static int kvaser_usb_leaf_set_bittiming(const struct net_device *netdev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/nct6694_canfd.c b/drivers/net/can/usb/nct6694_canfd.c index de60c2d1cdd1..e5f7f8849a73 100644 --- a/drivers/net/can/usb/nct6694_canfd.c +++ b/drivers/net/can/usb/nct6694_canfd.c @@ -527,7 +527,7 @@ static int nct6694_canfd_start(struct net_device *ndev) u32 en_tdc; int ret; - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) return -ENOMEM; @@ -596,7 +596,7 @@ static void nct6694_canfd_stop(struct net_device *ndev) * mode allows the device to monitor bus activity without actively * participating in communication. */ - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) return; @@ -707,7 +707,7 @@ static int nct6694_canfd_get_clock(struct nct6694_canfd_priv *priv) }; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index fbdc9b644241..eb4f5884ad73 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c @@ -939,7 +939,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - pdev->usb_if = kzalloc_obj(*pdev->usb_if, GFP_KERNEL); + pdev->usb_if = kzalloc_obj(*pdev->usb_if); if (!pdev->usb_if) goto err_out; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index db5d43bd4220..4bfa8d0fbb32 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c @@ -870,9 +870,9 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - usb_if = kzalloc_obj(struct pcan_usb_pro_interface, GFP_KERNEL); - fi = kmalloc_obj(struct pcan_usb_pro_fwinfo, GFP_KERNEL); - bi = kmalloc_obj(struct pcan_usb_pro_blinfo, GFP_KERNEL); + usb_if = kzalloc_obj(struct pcan_usb_pro_interface); + fi = kmalloc_obj(struct pcan_usb_pro_fwinfo); + bi = kmalloc_obj(struct pcan_usb_pro_blinfo); if (!usb_if || !fi || !bi) { err = -ENOMEM; goto err_out; diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index 8df91e4c1237..50d3a818eb1b 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c @@ -950,7 +950,7 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port, if (ret == 0) return -EEXIST; - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index 1e1917eafd7a..b369c1cc89e8 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1265,7 +1265,7 @@ static int hellcreek_devlink_region_vlan_snapshot(struct devlink *dl, struct hellcreek *hellcreek = ds->priv; int i; - table = kzalloc_objs(*entry, VLAN_N_VID, GFP_KERNEL); + table = kzalloc_objs(*entry, VLAN_N_VID); if (!table) return -ENOMEM; @@ -1293,7 +1293,7 @@ static int hellcreek_devlink_region_fdb_snapshot(struct devlink *dl, struct hellcreek *hellcreek = ds->priv; size_t i; - table = kzalloc_objs(*entry, hellcreek->fdb_entries, GFP_KERNEL); + table = kzalloc_objs(*entry, hellcreek->fdb_entries); if (!table) return -ENOMEM; diff --git a/drivers/net/dsa/microchip/ksz9477_acl.c b/drivers/net/dsa/microchip/ksz9477_acl.c index efd1da08bb45..d3e974602193 100644 --- a/drivers/net/dsa/microchip/ksz9477_acl.c +++ b/drivers/net/dsa/microchip/ksz9477_acl.c @@ -1060,7 +1060,7 @@ int ksz9477_port_acl_init(struct ksz_device *dev, int port) struct ksz9477_acl_priv *acl; int ret, i; - acl = kzalloc_obj(*acl, GFP_KERNEL); + acl = kzalloc_obj(*acl); if (!acl) return -ENOMEM; diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index ddcbb1be4818..c517478cc476 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -4835,7 +4835,7 @@ int ksz_switch_macaddr_get(struct dsa_switch *ds, int port, return 0; } - switch_macaddr = kzalloc_obj(*switch_macaddr, GFP_KERNEL); + switch_macaddr = kzalloc_obj(*switch_macaddr); if (!switch_macaddr) return -ENOMEM; diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 7a43110e74b7..6fcd7181116a 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2024,7 +2024,7 @@ static int mv88e6xxx_mst_get(struct mv88e6xxx_chip *chip, struct net_device *br, if (err) goto err; - mst = kzalloc_obj(*mst, GFP_KERNEL); + mst = kzalloc_obj(*mst); if (!mst) { err = -ENOMEM; goto err; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-6185.c b/drivers/net/dsa/mv88e6xxx/pcs-6185.c index 176480cdee5a..7e52cb88554e 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-6185.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-6185.c @@ -131,7 +131,7 @@ static int mv88e6185_pcs_init(struct mv88e6xxx_chip *chip, int port) dev = chip->dev; - mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs); if (!mpcs) return -ENOMEM; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-6352.c b/drivers/net/dsa/mv88e6xxx/pcs-6352.c index ecd8b5efccf6..9ebf0f89f817 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-6352.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-6352.c @@ -267,7 +267,7 @@ static struct marvell_c22_pcs *marvell_c22_pcs_alloc(struct device *dev, { struct marvell_c22_pcs *mpcs; - mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs); if (!mpcs) return NULL; diff --git a/drivers/net/dsa/mv88e6xxx/pcs-639x.c b/drivers/net/dsa/mv88e6xxx/pcs-639x.c index c7728b00297d..a5fd187a7bf3 100644 --- a/drivers/net/dsa/mv88e6xxx/pcs-639x.c +++ b/drivers/net/dsa/mv88e6xxx/pcs-639x.c @@ -67,7 +67,7 @@ mv88e639x_pcs_alloc(struct device *dev, struct mii_bus *bus, unsigned int addr, { struct mv88e639x_pcs *mpcs; - mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs); if (!mpcs) return NULL; diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 1587dd33a557..0904323b016d 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -109,7 +109,7 @@ static int felix_tag_8021q_vlan_add_rx(struct dsa_switch *ds, int port, key_length = ocelot->vcap[VCAP_ES0].keys[VCAP_ES0_IGR_PORT].length; - outer_tagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); + outer_tagging_rule = kzalloc_obj(struct ocelot_vcap_filter); if (!outer_tagging_rule) return -ENOMEM; @@ -177,11 +177,11 @@ static int felix_tag_8021q_vlan_add_tx(struct dsa_switch *ds, int port, unsigned long cookie; int err; - untagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); + untagging_rule = kzalloc_obj(struct ocelot_vcap_filter); if (!untagging_rule) return -ENOMEM; - redirect_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); + redirect_rule = kzalloc_obj(struct ocelot_vcap_filter); if (!redirect_rule) { kfree(untagging_rule); return -ENOMEM; diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 86b9a24d3e33..8387dd208adb 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -2201,7 +2201,7 @@ static int vsc9959_psfp_sgi_table_add(struct ocelot *ocelot, return 0; } - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/net/dsa/sja1105/sja1105_flower.c b/drivers/net/dsa/sja1105/sja1105_flower.c index c91f7371471c..fba926f85b47 100644 --- a/drivers/net/dsa/sja1105/sja1105_flower.c +++ b/drivers/net/dsa/sja1105/sja1105_flower.c @@ -41,7 +41,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv, int rc; if (!rule) { - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; @@ -112,7 +112,7 @@ static int sja1105_setup_tc_policer(struct sja1105_private *priv, int rc; if (!rule) { - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c index 7ec1ce5edf07..7dd544fe26c6 100644 --- a/drivers/net/dsa/sja1105/sja1105_vl.c +++ b/drivers/net/dsa/sja1105/sja1105_vl.c @@ -16,7 +16,7 @@ static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg, struct sja1105_gate_entry *e; int rc; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; @@ -524,7 +524,7 @@ int sja1105_vl_redirect(struct sja1105_private *priv, int port, } if (!rule) { - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; @@ -622,7 +622,7 @@ int sja1105_vl_gate(struct sja1105_private *priv, int port, } if (!rule) { - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index a2feb30843b6..6f586d3da9d4 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -1664,7 +1664,7 @@ static int vsc73xx_port_vlan_add(struct dsa_switch *ds, int port, vsc73xx_vlan = vsc73xx_bridge_vlan_find(vsc, vlan->vid); if (!vsc73xx_vlan) { - vsc73xx_vlan = kzalloc_obj(*vsc73xx_vlan, GFP_KERNEL); + vsc73xx_vlan = kzalloc_obj(*vsc73xx_vlan); if (!vsc73xx_vlan) return -ENOMEM; diff --git a/drivers/net/eql.c b/drivers/net/eql.c index 3fccbe2a63a0..06083b9841ba 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c @@ -425,7 +425,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user * if ((master_dev->flags & IFF_UP) == IFF_UP) { /* slave is not a master & not already a slave: */ if (!eql_is_master(slave_dev) && !eql_is_slave(slave_dev)) { - slave_t *s = kzalloc_obj(*s, GFP_KERNEL); + slave_t *s = kzalloc_obj(*s); equalizer_t *eql = netdev_priv(master_dev); int ret; diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index 30cc8acd2b8c..0f6e5373029a 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c @@ -1866,10 +1866,10 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) struct fbr_lookup *fbr; /* Alloc memory for the lookup table */ - rx_ring->fbr[0] = kzalloc_obj(*fbr, GFP_KERNEL); + rx_ring->fbr[0] = kzalloc_obj(*fbr); if (rx_ring->fbr[0] == NULL) return -ENOMEM; - rx_ring->fbr[1] = kzalloc_obj(*fbr, GFP_KERNEL); + rx_ring->fbr[1] = kzalloc_obj(*fbr); if (rx_ring->fbr[1] == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c index 84090dee9814..17dbdc832533 100644 --- a/drivers/net/ethernet/airoha/airoha_npu.c +++ b/drivers/net/ethernet/airoha/airoha_npu.c @@ -333,7 +333,7 @@ static int airoha_npu_ppe_init(struct airoha_npu *npu) struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data); if (!ppe_data) return -ENOMEM; @@ -354,7 +354,7 @@ static int airoha_npu_ppe_deinit(struct airoha_npu *npu) struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data); if (!ppe_data) return -ENOMEM; @@ -375,7 +375,7 @@ static int airoha_npu_ppe_flush_sram_entries(struct airoha_npu *npu, struct ppe_mbox_data *ppe_data; int err; - ppe_data = kzalloc_obj(*ppe_data, GFP_KERNEL); + ppe_data = kzalloc_obj(*ppe_data); if (!ppe_data) return -ENOMEM; diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c index a0f4c6e33bfc..42dbe8f93231 100644 --- a/drivers/net/ethernet/airoha/airoha_ppe.c +++ b/drivers/net/ethernet/airoha/airoha_ppe.c @@ -1173,7 +1173,7 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth, return err; } - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; diff --git a/drivers/net/ethernet/alacritech/slicoss.c b/drivers/net/ethernet/alacritech/slicoss.c index 808ee88dcdc8..c1949ca060ca 100644 --- a/drivers/net/ethernet/alacritech/slicoss.c +++ b/drivers/net/ethernet/alacritech/slicoss.c @@ -845,7 +845,7 @@ static int slic_init_tx_queue(struct slic_device *sdev) txq->put_idx = 0; txq->done_idx = 0; - txq->txbuffs = kzalloc_objs(*buff, txq->len, GFP_KERNEL); + txq->txbuffs = kzalloc_objs(*buff, txq->len); if (!txq->txbuffs) return -ENOMEM; @@ -922,7 +922,7 @@ static int slic_init_rx_queue(struct slic_device *sdev) rxq->done_idx = 0; rxq->put_idx = 0; - buff = kzalloc_objs(*buff, rxq->len, GFP_KERNEL); + buff = kzalloc_objs(*buff, rxq->len); if (!buff) return -ENOMEM; diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index 81f57bc6b3a2..455ee8930824 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c @@ -1149,7 +1149,7 @@ static int ace_init(struct net_device *dev) /* * Get the memory for the skb rings. */ - if (!(ap->skb = kzalloc_obj(struct ace_skb, GFP_KERNEL))) { + if (!(ap->skb = kzalloc_obj(struct ace_skb))) { ecode = -EAGAIN; goto init_error; } diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 2893fbaa51ca..4342e2d026f8 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -258,12 +258,12 @@ static int alloc_init_skbufs(struct altera_tse_private *priv) int i; /* Create Rx ring buffer */ - priv->rx_ring = kzalloc_objs(struct tse_buffer, rx_descs, GFP_KERNEL); + priv->rx_ring = kzalloc_objs(struct tse_buffer, rx_descs); if (!priv->rx_ring) goto err_rx_ring; /* Create Tx ring buffer */ - priv->tx_ring = kzalloc_objs(struct tse_buffer, tx_descs, GFP_KERNEL); + priv->tx_ring = kzalloc_objs(struct tse_buffer, tx_descs); if (!priv->tx_ring) goto err_tx_ring; diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c index e0705a54366b..58dc56671fb4 100644 --- a/drivers/net/ethernet/amd/pcnet32.c +++ b/drivers/net/ethernet/amd/pcnet32.c @@ -2035,11 +2035,11 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) return -ENOMEM; } - lp->tx_dma_addr = kzalloc_objs(dma_addr_t, lp->tx_ring_size, GFP_KERNEL); + lp->tx_dma_addr = kzalloc_objs(dma_addr_t, lp->tx_ring_size); if (!lp->tx_dma_addr) return -ENOMEM; - lp->rx_dma_addr = kzalloc_objs(dma_addr_t, lp->rx_ring_size, GFP_KERNEL); + lp->rx_dma_addr = kzalloc_objs(dma_addr_t, lp->rx_ring_size); if (!lp->rx_dma_addr) return -ENOMEM; diff --git a/drivers/net/ethernet/amd/pds_core/auxbus.c b/drivers/net/ethernet/amd/pds_core/auxbus.c index 6f0ffdf14e96..73b3481220b1 100644 --- a/drivers/net/ethernet/amd/pds_core/auxbus.c +++ b/drivers/net/ethernet/amd/pds_core/auxbus.c @@ -140,7 +140,7 @@ static struct pds_auxiliary_dev *pdsc_auxbus_dev_register(struct pdsc *cf, struct pds_auxiliary_dev *padev; int err; - padev = kzalloc_obj(*padev, GFP_KERNEL); + padev = kzalloc_obj(*padev); if (!padev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c index 6ae27bfb3375..2e1d0d01d03a 100644 --- a/drivers/net/ethernet/amd/pds_core/dev.c +++ b/drivers/net/ethernet/amd/pds_core/dev.c @@ -359,7 +359,7 @@ int pdsc_dev_init(struct pdsc *pdsc) nintrs = min_t(unsigned int, num_online_cpus(), nintrs); /* Get intr_info struct array for tracking */ - pdsc->intr_info = kzalloc_objs(*pdsc->intr_info, nintrs, GFP_KERNEL); + pdsc->intr_info = kzalloc_objs(*pdsc->intr_info, nintrs); if (!pdsc->intr_info) return -ENOMEM; diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c index 743b154d2a88..22db78343eb0 100644 --- a/drivers/net/ethernet/amd/pds_core/main.c +++ b/drivers/net/ethernet/amd/pds_core/main.c @@ -146,7 +146,7 @@ static int pdsc_sriov_configure(struct pci_dev *pdev, int num_vfs) int ret = 0; if (num_vfs > 0) { - pdsc->vfs = kzalloc_objs(struct pdsc_vf, num_vfs, GFP_KERNEL); + pdsc->vfs = kzalloc_objs(struct pdsc_vf, num_vfs); if (!pdsc->vfs) return -ENOMEM; pdsc->num_vfs = num_vfs; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c b/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c index 488f96bec1e7..cfdbd4639a1e 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-selftest.c @@ -112,7 +112,7 @@ static int __xgbe_test_loopback(struct xgbe_prv_data *pdata, struct sk_buff *skb = NULL; int ret = 0; - tdata = kzalloc_obj(*tdata, GFP_KERNEL); + tdata = kzalloc_obj(*tdata); if (!tdata) return -ENOMEM; diff --git a/drivers/net/ethernet/apm/xgene-v2/main.c b/drivers/net/ethernet/apm/xgene-v2/main.c index b88764615994..2b2de6e2bc5b 100644 --- a/drivers/net/ethernet/apm/xgene-v2/main.c +++ b/drivers/net/ethernet/apm/xgene-v2/main.c @@ -405,7 +405,7 @@ static struct xge_desc_ring *xge_create_desc_ring(struct net_device *ndev) struct xge_desc_ring *ring; u16 size; - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) return NULL; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c index 4f0b66917ce0..e419c73b32ce 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c @@ -688,7 +688,7 @@ int aq_add_rxnfc_rule(struct aq_nic_s *aq_nic, const struct ethtool_rxnfc *cmd) if (err) goto err_exit; - aq_rx_fltr = kzalloc_obj(*aq_rx_fltr, GFP_KERNEL); + aq_rx_fltr = kzalloc_obj(*aq_rx_fltr); if (unlikely(!aq_rx_fltr)) { err = -ENOMEM; goto err_exit; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c b/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c index a47d5ec74b94..3ca072360ec7 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_macsec.c @@ -1462,7 +1462,7 @@ int aq_macsec_init(struct aq_nic_s *nic) if (!(caps_lo & BIT(CAPS_LO_MACSEC))) return 0; - nic->macsec_cfg = kzalloc_obj(*cfg, GFP_KERNEL); + nic->macsec_cfg = kzalloc_obj(*cfg); if (!nic->macsec_cfg) return -ENOMEM; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index 05d656fb4a27..e9e38af680c3 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -244,7 +244,7 @@ static int aq_pci_probe(struct pci_dev *pdev, if (err) goto err_ioremap; - self->aq_hw = kzalloc_obj(*self->aq_hw, GFP_KERNEL); + self->aq_hw = kzalloc_obj(*self->aq_hw); if (!self->aq_hw) { err = -ENOMEM; goto err_ioremap; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c index 83216657d1d8..05af57750b6a 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -1183,7 +1183,7 @@ int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_vec) aq_ptp_offset_init(&mbox.info.ptp_offset); - aq_ptp = kzalloc_obj(*aq_ptp, GFP_KERNEL); + aq_ptp = kzalloc_obj(*aq_ptp); if (!aq_ptp) { err = -ENOMEM; goto err_exit; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index 62478c605503..e270327e47fd 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -138,7 +138,7 @@ static int aq_ring_alloc(struct aq_ring_s *self, int err = 0; self->buff_ring = - kzalloc_objs(struct aq_ring_buff_s, self->size, GFP_KERNEL); + kzalloc_objs(struct aq_ring_buff_s, self->size); if (!self->buff_ring) { err = -ENOMEM; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c index 90eaf11076d2..2f9033ceed8c 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c @@ -104,7 +104,7 @@ struct aq_vec_s *aq_vec_alloc(struct aq_nic_s *aq_nic, unsigned int idx, { struct aq_vec_s *self = NULL; - self = kzalloc_obj(*self, GFP_KERNEL); + self = kzalloc_obj(*self); if (!self) goto err_exit; diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index 13e3bd7fe82b..a5ab99474179 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -1305,7 +1305,7 @@ static int ag71xx_rings_init(struct ag71xx *ag) ring_size = BIT(tx->order) + BIT(rx->order); tx_size = BIT(tx->order); - tx->buf = kzalloc_objs(*tx->buf, ring_size, GFP_KERNEL); + tx->buf = kzalloc_objs(*tx->buf, ring_size); if (!tx->buf) return -ENOMEM; diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index 9b1923055293..ab262e66f986 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -616,7 +616,7 @@ static int alx_set_mac_address(struct net_device *netdev, void *data) static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq, int offset) { - txq->bufs = kzalloc_objs(struct alx_buffer, txq->count, GFP_KERNEL); + txq->bufs = kzalloc_objs(struct alx_buffer, txq->count); if (!txq->bufs) return -ENOMEM; @@ -630,7 +630,7 @@ static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq, static int alx_alloc_rx_ring(struct alx_priv *alx, struct alx_rx_queue *rxq, int offset) { - rxq->bufs = kzalloc_objs(struct alx_buffer, rxq->count, GFP_KERNEL); + rxq->bufs = kzalloc_objs(struct alx_buffer, rxq->count); if (!rxq->bufs) return -ENOMEM; @@ -746,7 +746,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate alx_napi structures */ for (i = 0; i < alx->num_napi; i++) { - np = kzalloc_obj(struct alx_napi, GFP_KERNEL); + np = kzalloc_obj(struct alx_napi); if (!np) goto err_out; @@ -758,7 +758,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate tx queues */ for (i = 0; i < alx->num_txq; i++) { np = alx->qnapi[i]; - txq = kzalloc_obj(*txq, GFP_KERNEL); + txq = kzalloc_obj(*txq); if (!txq) goto err_out; @@ -775,7 +775,7 @@ static int alx_alloc_napis(struct alx_priv *alx) /* allocate rx queues */ np = alx->qnapi[0]; - rxq = kzalloc_obj(*rxq, GFP_KERNEL); + rxq = kzalloc_obj(*rxq); if (!rxq) goto err_out; diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c index fa1fd5667596..fd2715f84af9 100644 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c @@ -181,7 +181,7 @@ static int bcm4908_dma_alloc_buf_descs(struct bcm4908_enet *enet, goto err_free_buf_descs; } - ring->slots = kzalloc_objs(*ring->slots, ring->length, GFP_KERNEL); + ring->slots = kzalloc_objs(*ring->slots, ring->length); if (!ring->slots) goto err_free_buf_descs; diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index f81392cbedd1..3594496dd5a6 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -1486,7 +1486,7 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv, /* Simple descriptors partitioning for now */ size = 256; - ring->cbs = kzalloc_objs(struct bcm_sysport_cb, size, GFP_KERNEL); + ring->cbs = kzalloc_objs(struct bcm_sysport_cb, size); if (!ring->cbs) { netif_err(priv, hw, priv->netdev, "CB allocation failed\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c index d530046e027d..b942076762ef 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_auxr.c @@ -210,7 +210,7 @@ void bnge_rdma_aux_device_init(struct bnge_dev *bd) if (!bnge_is_roce_en(bd)) return; - aux_priv = kzalloc_obj(*aux_priv, GFP_KERNEL); + aux_priv = kzalloc_obj(*aux_priv); if (!aux_priv) goto exit; @@ -235,13 +235,13 @@ void bnge_rdma_aux_device_init(struct bnge_dev *bd) } bd->aux_priv = aux_priv; - auxr_dev = kzalloc_obj(*auxr_dev, GFP_KERNEL); + auxr_dev = kzalloc_obj(*auxr_dev); if (!auxr_dev) goto aux_dev_uninit; aux_priv->auxr_dev = auxr_dev; - auxr_info = kzalloc_obj(*auxr_info, GFP_KERNEL); + auxr_info = kzalloc_obj(*auxr_info); if (!auxr_info) goto aux_dev_uninit; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c index cf6e503d63a6..80231286d29a 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.c @@ -229,7 +229,7 @@ bnge_hwrm_create_token(struct bnge_dev *bd, enum bnge_hwrm_chnl dst) { struct bnge_hwrm_wait_token *token; - token = kzalloc_obj(*token, GFP_KERNEL); + token = kzalloc_obj(*token); if (!token) return NULL; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c index 579943445b24..c46da3413417 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c @@ -242,7 +242,7 @@ static int bnge_alloc_all_ctx_pg_info(struct bnge_dev *bd, int ctx_max) if (ctxm->instance_bmap) n = hweight32(ctxm->instance_bmap); - ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n, GFP_KERNEL); + ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n); if (!ctxm->pg_info) return -ENOMEM; } @@ -269,7 +269,7 @@ int bnge_hwrm_func_backing_store_qcaps(struct bnge_dev *bd) if (rc) return rc; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; bd->ctx = ctx; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c index 74b552ee1796..8c099682d3db 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c @@ -127,11 +127,11 @@ static void bnge_free_cp_desc_arr(struct bnge_cp_ring_info *cpr) static int bnge_alloc_nq_desc_arr(struct bnge_nq_ring_info *nqr, int n) { - nqr->desc_ring = kzalloc_objs(*nqr->desc_ring, n, GFP_KERNEL); + nqr->desc_ring = kzalloc_objs(*nqr->desc_ring, n); if (!nqr->desc_ring) return -ENOMEM; - nqr->desc_mapping = kzalloc_objs(*nqr->desc_mapping, n, GFP_KERNEL); + nqr->desc_mapping = kzalloc_objs(*nqr->desc_mapping, n); if (!nqr->desc_mapping) goto err_free_desc_ring; return 0; @@ -144,11 +144,11 @@ err_free_desc_ring: static int bnge_alloc_cp_desc_arr(struct bnge_cp_ring_info *cpr, int n) { - cpr->desc_ring = kzalloc_objs(*cpr->desc_ring, n, GFP_KERNEL); + cpr->desc_ring = kzalloc_objs(*cpr->desc_ring, n); if (!cpr->desc_ring) return -ENOMEM; - cpr->desc_mapping = kzalloc_objs(*cpr->desc_mapping, n, GFP_KERNEL); + cpr->desc_mapping = kzalloc_objs(*cpr->desc_mapping, n); if (!cpr->desc_mapping) goto err_free_desc_ring; return 0; @@ -287,7 +287,7 @@ static int bnge_alloc_nq_tree(struct bnge_net *bn) tx = 1; } - nqr->cp_ring_arr = kzalloc_objs(*cpr, cp_count, GFP_KERNEL); + nqr->cp_ring_arr = kzalloc_objs(*cpr, cp_count); if (!nqr->cp_ring_arr) { rc = -ENOMEM; goto err_free_nq_tree; @@ -517,7 +517,7 @@ static int bnge_alloc_tpa_info(struct bnge_net *bn) for (j = 0; j < bn->max_tpa; j++) { struct rx_agg_cmp *agg; - agg = kzalloc_objs(*agg, MAX_SKB_FRAGS, GFP_KERNEL); + agg = kzalloc_objs(*agg, MAX_SKB_FRAGS); if (!agg) goto err_free_tpa_info; rxr->rx_tpa[j].agg_arr = agg; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c index 155b48cd2af8..0e94f092813e 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c @@ -389,7 +389,7 @@ int bnge_alloc_irqs(struct bnge_dev *bd) num_entries = irqs_demand; if (pci_msix_can_alloc_dyn(bd->pdev)) num_entries = max; - bd->irq_tbl = kzalloc_objs(*bd->irq_tbl, num_entries, GFP_KERNEL); + bd->irq_tbl = kzalloc_objs(*bd->irq_tbl, num_entries); if (!bd->irq_tbl) { rc = -ENOMEM; goto err_free_irqs; diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c b/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c index fb89737b481d..2950a804fa02 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_rmem.c @@ -170,7 +170,7 @@ static int bnge_alloc_ctx_pg_tbls(struct bnge_dev *bd, for (i = 0; i < nr_tbls; i++) { struct bnge_ctx_pg_info *pg_tbl; - pg_tbl = kzalloc_obj(*pg_tbl, GFP_KERNEL); + pg_tbl = kzalloc_obj(*pg_tbl); if (!pg_tbl) return -ENOMEM; ctx_pg->ctx_pg_tbl[i] = pg_tbl; diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 97aafe021477..f5722e929833 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -8084,7 +8084,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) bp->phy_flags = 0; bp->temp_stats_blk = - kzalloc_obj(struct statistics_block, GFP_KERNEL); + kzalloc_obj(struct statistics_block); if (!bp->temp_stats_blk) { rc = -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index ea0fc6add87d..942a33ae55ee 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -4598,7 +4598,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) if (!skip_rx_queue(bp, index)) { /* fastpath rx rings: rx_buf rx_desc rx_comp */ bnx2x_fp(bp, index, rx_buf_ring) = - kzalloc_objs(struct sw_rx_bd, NUM_RX_BD, GFP_KERNEL); + kzalloc_objs(struct sw_rx_bd, NUM_RX_BD); if (!bnx2x_fp(bp, index, rx_buf_ring)) goto alloc_mem_err; bnx2x_fp(bp, index, rx_desc_ring) = @@ -4616,7 +4616,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) /* SGE ring */ bnx2x_fp(bp, index, rx_page_ring) = - kzalloc_objs(struct sw_rx_page, NUM_RX_SGE, GFP_KERNEL); + kzalloc_objs(struct sw_rx_page, NUM_RX_SGE); if (!bnx2x_fp(bp, index, rx_page_ring)) goto alloc_mem_err; bnx2x_fp(bp, index, rx_sge_ring) = @@ -4746,7 +4746,7 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) bp->fp_array_size = fp_array_size; BNX2X_DEV_INFO("fp_array_size %d\n", bp->fp_array_size); - fp = kzalloc_objs(*fp, bp->fp_array_size, GFP_KERNEL); + fp = kzalloc_objs(*fp, bp->fp_array_size); if (!fp) goto alloc_err; for (i = 0; i < bp->fp_array_size; i++) { @@ -4783,13 +4783,13 @@ int bnx2x_alloc_mem_bp(struct bnx2x *bp) goto alloc_err; /* msix table */ - tbl = kzalloc_objs(*tbl, msix_table_size, GFP_KERNEL); + tbl = kzalloc_objs(*tbl, msix_table_size); if (!tbl) goto alloc_err; bp->msix_table = tbl; /* ilt */ - ilt = kzalloc_obj(*ilt, GFP_KERNEL); + ilt = kzalloc_obj(*ilt); if (!ilt) goto alloc_err; bp->ilt = ilt; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 745b023e2e08..8120cafdad2f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -6577,7 +6577,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp) if (bp->gunzip_buf == NULL) goto gunzip_nomem1; - bp->strm = kmalloc_obj(*bp->strm, GFP_KERNEL); + bp->strm = kmalloc_obj(*bp->strm); if (bp->strm == NULL) goto gunzip_nomem2; @@ -10660,7 +10660,7 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi) up(&bnx2x_prev_sem); /* Create an entry for this path and add it */ - tmp_list = kmalloc_obj(struct bnx2x_prev_path_list, GFP_KERNEL); + tmp_list = kmalloc_obj(struct bnx2x_prev_path_list); if (!tmp_list) { BNX2X_ERR("Failed to allocate 'bnx2x_prev_path_list'\n"); return -ENOMEM; @@ -12954,7 +12954,7 @@ static int bnx2x_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) DP(NETIF_MSG_IFUP, "Adding VLAN %d\n", vid); - vlan = kmalloc_obj(*vlan, GFP_KERNEL); + vlan = kmalloc_obj(*vlan); if (!vlan) return -ENOMEM; @@ -14841,7 +14841,7 @@ static int bnx2x_get_fc_npiv(struct net_device *dev, DP(BNX2X_MSG_MCP, "About to read the FC-NPIV table\n"); - tbl = kmalloc_obj(*tbl, GFP_KERNEL); + tbl = kmalloc_obj(*tbl); if (!tbl) { BNX2X_ERR("Failed to allocate fc_npiv table\n"); goto out; diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 5aeb5b6a64b5..605a7853e0cf 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c @@ -1218,7 +1218,7 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, } /* allocate the vfs database */ - bp->vfdb = kzalloc_obj(*(bp->vfdb), GFP_KERNEL); + bp->vfdb = kzalloc_obj(*(bp->vfdb)); if (!bp->vfdb) { BNX2X_ERR("failed to allocate vf database\n"); err = -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index ad5035cd8ac3..37c02ed32ad5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3760,12 +3760,12 @@ static int bnxt_alloc_one_tpa_info(struct bnxt *bp, if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS)) return 0; for (i = 0; i < bp->max_tpa; i++) { - agg = kzalloc_objs(*agg, MAX_SKB_FRAGS, GFP_KERNEL); + agg = kzalloc_objs(*agg, MAX_SKB_FRAGS); if (!agg) return -ENOMEM; rxr->rx_tpa[i].agg_arr = agg; } - rxr->rx_tpa_idx_map = kzalloc_obj(*rxr->rx_tpa_idx_map, GFP_KERNEL); + rxr->rx_tpa_idx_map = kzalloc_obj(*rxr->rx_tpa_idx_map); if (!rxr->rx_tpa_idx_map) return -ENOMEM; @@ -4080,7 +4080,7 @@ static void bnxt_free_cp_arrays(struct bnxt_cp_ring_info *cpr) static int bnxt_alloc_cp_arrays(struct bnxt_cp_ring_info *cpr, int n) { - cpr->cp_desc_ring = kzalloc_objs(*cpr->cp_desc_ring, n, GFP_KERNEL); + cpr->cp_desc_ring = kzalloc_objs(*cpr->cp_desc_ring, n); if (!cpr->cp_desc_ring) return -ENOMEM; cpr->cp_desc_mapping = kzalloc_objs(*cpr->cp_desc_mapping, n, @@ -4231,7 +4231,7 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp) tx = 1; } - cpr->cp_ring_arr = kzalloc_objs(*cpr, cp_count, GFP_KERNEL); + cpr->cp_ring_arr = kzalloc_objs(*cpr, cp_count); if (!cpr->cp_ring_arr) return -ENOMEM; cpr->cp_ring_count = cp_count; @@ -5245,7 +5245,7 @@ static int bnxt_alloc_stats(struct bnxt *bp) struct bnxt_napi *bnapi = bp->bnapi[i]; struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; - cpr->sw_stats = kzalloc_obj(*cpr->sw_stats, GFP_KERNEL); + cpr->sw_stats = kzalloc_obj(*cpr->sw_stats); if (!cpr->sw_stats) return -ENOMEM; @@ -8650,7 +8650,7 @@ static int bnxt_alloc_all_ctx_pg_info(struct bnxt *bp, int ctx_max) if (ctxm->instance_bmap) n = hweight32(ctxm->instance_bmap); - ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n, GFP_KERNEL); + ctxm->pg_info = kzalloc_objs(*ctxm->pg_info, n); if (!ctxm->pg_info) return -ENOMEM; } @@ -8677,7 +8677,7 @@ static int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp) return rc; if (!ctx) { - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; bp->ctx = ctx; @@ -8764,7 +8764,7 @@ static int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp) ctx = bp->ctx; if (!ctx) { - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto ctx_err; @@ -9055,7 +9055,7 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, for (i = 0; i < nr_tbls; i++) { struct bnxt_ctx_pg_info *pg_tbl; - pg_tbl = kzalloc_obj(*pg_tbl, GFP_KERNEL); + pg_tbl = kzalloc_obj(*pg_tbl); if (!pg_tbl) return -ENOMEM; ctx_pg->ctx_pg_tbl[i] = pg_tbl; @@ -9564,7 +9564,7 @@ static int bnxt_alloc_crash_dump_mem(struct bnxt *bp) if (bp->fw_crash_mem) bnxt_free_ctx_pg_tbls(bp, bp->fw_crash_mem); else - bp->fw_crash_mem = kzalloc_obj(*bp->fw_crash_mem, GFP_KERNEL); + bp->fw_crash_mem = kzalloc_obj(*bp->fw_crash_mem); if (!bp->fw_crash_mem) return -ENOMEM; @@ -9671,7 +9671,7 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp) goto exit; } if (!ptp) { - ptp = kzalloc_obj(*ptp, GFP_KERNEL); + ptp = kzalloc_obj(*ptp); if (!ptp) { rc = -ENOMEM; goto exit; @@ -9943,7 +9943,7 @@ static int __bnxt_alloc_fw_health(struct bnxt *bp) if (bp->fw_health) return 0; - bp->fw_health = kzalloc_obj(*bp->fw_health, GFP_KERNEL); + bp->fw_health = kzalloc_obj(*bp->fw_health); if (!bp->fw_health) return -ENOMEM; @@ -11454,7 +11454,7 @@ static int bnxt_init_int_mode(struct bnxt *bp) tbl_size = total_vecs; if (pci_msix_can_alloc_dyn(bp->pdev)) tbl_size = max; - bp->irq_tbl = kzalloc_objs(*bp->irq_tbl, tbl_size, GFP_KERNEL); + bp->irq_tbl = kzalloc_objs(*bp->irq_tbl, tbl_size); if (bp->irq_tbl) { for (i = 0; i < total_vecs; i++) bp->irq_tbl[i].vector = pci_irq_vector(bp->pdev, i); @@ -12951,7 +12951,7 @@ static int bnxt_set_xps_mapping(struct bnxt *bp) cpumask_t *q_map; int rc = 0; - q_map = kzalloc_objs(*q_map, bp->tx_nr_rings_per_tc, GFP_KERNEL); + q_map = kzalloc_objs(*q_map, bp->tx_nr_rings_per_tc); if (!q_map) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c index 00e3ef076d93..1ad2143d0e56 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c @@ -529,7 +529,7 @@ static int bnxt_dcbnl_ieee_getets(struct net_device *dev, struct ieee_ets *ets) if (bp->dcbx_cap & DCB_CAP_DCBX_HOST) return 0; - my_ets = kzalloc_obj(*my_ets, GFP_KERNEL); + my_ets = kzalloc_obj(*my_ets); if (!my_ets) return -ENOMEM; rc = bnxt_hwrm_queue_cos2bw_qcfg(bp, my_ets); @@ -568,7 +568,7 @@ static int bnxt_dcbnl_ieee_setets(struct net_device *dev, struct ieee_ets *ets) rc = bnxt_ets_validate(bp, ets, &max_tc); if (!rc) { if (!my_ets) { - my_ets = kzalloc_obj(*my_ets, GFP_KERNEL); + my_ets = kzalloc_obj(*my_ets); if (!my_ets) return -ENOMEM; /* initialize PRI2TC mappings to invalid value */ @@ -604,7 +604,7 @@ static int bnxt_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) if (bp->dcbx_cap & DCB_CAP_DCBX_HOST) return 0; - my_pfc = kzalloc_obj(*my_pfc, GFP_KERNEL); + my_pfc = kzalloc_obj(*my_pfc); if (!my_pfc) return 0; bp->ieee_pfc = my_pfc; @@ -642,7 +642,7 @@ static int bnxt_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc) return -EINVAL; if (!my_pfc) { - my_pfc = kzalloc_obj(*my_pfc, GFP_KERNEL); + my_pfc = kzalloc_obj(*my_pfc); if (!my_pfc) return -ENOMEM; bp->ieee_pfc = my_pfc; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index e7455ef8984a..ba47e8294fff 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1371,7 +1371,7 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, return -EOPNOTSUPP; } - new_fltr = kzalloc_obj(*new_fltr, GFP_KERNEL); + new_fltr = kzalloc_obj(*new_fltr); if (!new_fltr) return -ENOMEM; @@ -5485,7 +5485,7 @@ void bnxt_ethtool_init(struct bnxt *bp) test_info = bp->test_info; if (!test_info) { - test_info = kzalloc_obj(*bp->test_info, GFP_KERNEL); + test_info = kzalloc_obj(*bp->test_info); if (!test_info) return; bp->test_info = test_info; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c index fcb4edb24012..5bfabdca7d0e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c @@ -371,7 +371,7 @@ __hwrm_acquire_token(struct bnxt *bp, enum bnxt_hwrm_chnl dst) { struct bnxt_hwrm_wait_token *token; - token = kzalloc_obj(*token, GFP_KERNEL); + token = kzalloc_obj(*token); if (!token) return NULL; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index d0f5f2ad5b26..7f9829287c49 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -459,7 +459,7 @@ static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs) struct pci_dev *pdev = bp->pdev; u32 nr_pages, size, i, j, k = 0; - bp->pf.vf = kzalloc_objs(struct bnxt_vf_info, num_vfs, GFP_KERNEL); + bp->pf.vf = kzalloc_objs(struct bnxt_vf_info, num_vfs); if (!bp->pf.vf) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c index c678305d588c..c6b4a14c0e6e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c @@ -977,7 +977,7 @@ bnxt_tc_get_l2_node(struct bnxt *bp, struct rhashtable *l2_table, l2_node = rhashtable_lookup_fast(l2_table, l2_key, ht_params); if (!l2_node) { - l2_node = kzalloc_obj(*l2_node, GFP_KERNEL); + l2_node = kzalloc_obj(*l2_node); if (!l2_node) { rc = -ENOMEM; return NULL; @@ -1128,7 +1128,7 @@ bnxt_tc_get_tunnel_node(struct bnxt *bp, struct rhashtable *tunnel_table, tunnel_node = rhashtable_lookup_fast(tunnel_table, tun_key, *ht_params); if (!tunnel_node) { - tunnel_node = kzalloc_obj(*tunnel_node, GFP_KERNEL); + tunnel_node = kzalloc_obj(*tunnel_node); if (!tunnel_node) { rc = -ENOMEM; goto err; @@ -1535,7 +1535,7 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid, int rc; /* allocate memory for the new flow and it's node */ - new_node = kzalloc_obj(*new_node, GFP_KERNEL); + new_node = kzalloc_obj(*new_node); if (!new_node) { rc = -ENOMEM; goto done; @@ -1915,7 +1915,7 @@ static int bnxt_tc_setup_indr_block(struct net_device *netdev, struct Qdisc *sch switch (f->command) { case FLOW_BLOCK_BIND: - cb_priv = kmalloc_obj(*cb_priv, GFP_KERNEL); + cb_priv = kmalloc_obj(*cb_priv); if (!cb_priv) return -ENOMEM; @@ -2018,7 +2018,7 @@ int bnxt_init_tc(struct bnxt *bp) if (bp->hwrm_spec_code < 0x10803) return 0; - tc_info = kzalloc_obj(*tc_info, GFP_KERNEL); + tc_info = kzalloc_obj(*tc_info); if (!tc_info) return -ENOMEM; mutex_init(&tc_info->lock); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c index ca95f6e70dde..e0b9b55c0d3c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c @@ -479,7 +479,7 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp) if (!(bp->flags & BNXT_FLAG_ROCE_CAP)) return; - aux_priv = kzalloc_obj(*bp->aux_priv, GFP_KERNEL); + aux_priv = kzalloc_obj(*bp->aux_priv); if (!aux_priv) goto exit; @@ -509,13 +509,13 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp) * any error unwinding will need to include a call to * auxiliary_device_uninit. */ - edev = kzalloc_obj(*edev, GFP_KERNEL); + edev = kzalloc_obj(*edev); if (!edev) goto aux_dev_uninit; aux_priv->edev = edev; - ulp = kzalloc_obj(*ulp, GFP_KERNEL); + ulp = kzalloc_obj(*ulp); if (!ulp) goto aux_dev_uninit; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c index d0a67616f927..18e33144f345 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c @@ -496,7 +496,7 @@ int bnxt_vf_reps_create(struct bnxt *bp) if (!(bp->flags & BNXT_FLAG_DSN_VALID)) return -ENODEV; - bp->vf_reps = kzalloc_objs(vf_rep, num_vfs, GFP_KERNEL); + bp->vf_reps = kzalloc_objs(vf_rep, num_vfs); if (!bp->vf_reps) return -ENOMEM; diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index bd4238737fef..7fb78df3d8ab 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -1208,7 +1208,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev) if (blks > cp->ethdev->ctx_tbl_len) return -ENOMEM; - cp->ctx_arr = kzalloc_objs(struct cnic_ctx, blks, GFP_KERNEL); + cp->ctx_arr = kzalloc_objs(struct cnic_ctx, blks); if (cp->ctx_arr == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index ec3750f055b8..5018cc5f6393 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -2640,7 +2640,7 @@ bnad_enable_msix(struct bnad *bnad) return; bnad->msix_table = - kzalloc_objs(struct msix_entry, bnad->msix_num, GFP_KERNEL); + kzalloc_objs(struct msix_entry, bnad->msix_num); if (!bnad->msix_table) goto intx_mode; diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c index 8a2eb4504760..ba3c1033a0b0 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c @@ -45,7 +45,7 @@ bnad_debugfs_open_fwtrc(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); + fw_debug = kzalloc_obj(struct bnad_debug_info); if (!fw_debug) return -ENOMEM; @@ -85,7 +85,7 @@ bnad_debugfs_open_fwsave(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); + fw_debug = kzalloc_obj(struct bnad_debug_info); if (!fw_debug) return -ENOMEM; @@ -122,7 +122,7 @@ bnad_debugfs_open_reg(struct inode *inode, struct file *file) { struct bnad_debug_info *reg_debug; - reg_debug = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); + reg_debug = kzalloc_obj(struct bnad_debug_info); if (!reg_debug) return -ENOMEM; @@ -185,7 +185,7 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file) struct bnad_debug_info *drv_info; int rc; - drv_info = kzalloc_obj(struct bnad_debug_info, GFP_KERNEL); + drv_info = kzalloc_obj(struct bnad_debug_info); if (!drv_info) return -ENOMEM; diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 446234e3ca53..466e2ea7a740 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c @@ -285,7 +285,7 @@ bnad_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) strscpy(drvinfo->driver, BNAD_NAME, sizeof(drvinfo->driver)); - ioc_attr = kzalloc_obj(*ioc_attr, GFP_KERNEL); + ioc_attr = kzalloc_obj(*ioc_attr); if (ioc_attr) { spin_lock_irqsave(&bnad->bna_lock, flags); bfa_nw_ioc_get_attr(&bnad->bna.ioceth.ioc, ioc_attr); @@ -900,7 +900,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, u32 i, flash_part = 0, ret; unsigned long flags = 0; - flash_attr = kzalloc_obj(struct bfa_flash_attr, GFP_KERNEL); + flash_attr = kzalloc_obj(struct bfa_flash_attr); if (!flash_attr) return 0; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 86f516563db6..5bc35f651ebd 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3734,7 +3734,7 @@ static int gem_add_flow_filter(struct net_device *netdev, int ret = -EINVAL; bool added = false; - newfs = kmalloc_obj(*newfs, GFP_KERNEL); + newfs = kmalloc_obj(*newfs); if (newfs == NULL) return -ENOMEM; memcpy(&newfs->fs, fs, sizeof(newfs->fs)); diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c index baccb0169068..a74d0205efda 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c @@ -89,12 +89,12 @@ int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) int i, j; lio->glist_lock = - kzalloc_objs(*lio->glist_lock, num_iqs, GFP_KERNEL); + kzalloc_objs(*lio->glist_lock, num_iqs); if (!lio->glist_lock) return -ENOMEM; lio->glist = - kzalloc_objs(*lio->glist, num_iqs, GFP_KERNEL); + kzalloc_objs(*lio->glist, num_iqs); if (!lio->glist) { kfree(lio->glist_lock); lio->glist_lock = NULL; @@ -138,7 +138,7 @@ int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) g = kzalloc_node(sizeof(*g), GFP_KERNEL, numa_node); if (!g) - g = kzalloc_obj(*g, GFP_KERNEL); + g = kzalloc_obj(*g); if (!g) break; diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c index e61f18467a15..e98118e7b9fd 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c @@ -1164,7 +1164,7 @@ octeon_register_dispatch_fn(struct octeon_device *oct, dev_dbg(&oct->pci_dev->dev, "Adding opcode to dispatch list linked list\n"); - dispatch = kmalloc_obj(*dispatch, GFP_KERNEL); + dispatch = kmalloc_obj(*dispatch); if (!dispatch) return 1; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 7ef2a9f606a1..1c183827cb9e 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1465,7 +1465,7 @@ int nicvf_open(struct net_device *netdev) /* Register NAPI handler for processing CQEs */ for (qidx = 0; qidx < qs->cq_cnt; qidx++) { - cq_poll = kzalloc_obj(*cq_poll, GFP_KERNEL); + cq_poll = kzalloc_obj(*cq_poll); if (!cq_poll) { err = -ENOMEM; goto napi_del; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index 12bea0b6a4e6..062ac4a5fa12 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -289,7 +289,7 @@ static int nicvf_init_rbdr(struct nicvf *nic, struct rbdr *rbdr, rbdr->is_xdp = true; } rbdr->pgcnt = roundup_pow_of_two(rbdr->pgcnt); - rbdr->pgcache = kzalloc_objs(*rbdr->pgcache, rbdr->pgcnt, GFP_KERNEL); + rbdr->pgcache = kzalloc_objs(*rbdr->pgcache, rbdr->pgcnt); if (!rbdr->pgcache) return -ENOMEM; rbdr->pgidx = 0; diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 87723e4140b0..b6303999902f 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -1086,7 +1086,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) /* actual number of filters available to exact LMAC */ lmac->dmacs_count = (RX_DMAC_COUNT / bgx->lmac_count); - lmac->dmacs = kzalloc_objs(*lmac->dmacs, lmac->dmacs_count, GFP_KERNEL); + lmac->dmacs = kzalloc_objs(*lmac->dmacs, lmac->dmacs_count); if (!lmac->dmacs) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb/espi.c b/drivers/net/ethernet/chelsio/cxgb/espi.c index a7dd518b6ea9..282409fefd39 100644 --- a/drivers/net/ethernet/chelsio/cxgb/espi.c +++ b/drivers/net/ethernet/chelsio/cxgb/espi.c @@ -280,7 +280,7 @@ void t1_espi_destroy(struct peespi *espi) struct peespi *t1_espi_create(adapter_t *adapter) { - struct peespi *espi = kzalloc_obj(*espi, GFP_KERNEL); + struct peespi *espi = kzalloc_obj(*espi); if (espi) espi->adapter = adapter; diff --git a/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c b/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c index 4c4a43828110..dc412801bd31 100644 --- a/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c +++ b/drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c @@ -358,7 +358,7 @@ static struct cphy *mv88e1xxx_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { struct adapter *adapter = netdev_priv(dev); - struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c b/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c index 8c3d3250b72c..c378c9b2156c 100644 --- a/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c +++ b/drivers/net/ethernet/chelsio/cxgb/mv88x201x.c @@ -203,7 +203,7 @@ static struct cphy *mv88x201x_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { u32 val; - struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/my3126.c b/drivers/net/ethernet/chelsio/cxgb/my3126.c index 9d29f0767dcb..bd1eb3a7bb33 100644 --- a/drivers/net/ethernet/chelsio/cxgb/my3126.c +++ b/drivers/net/ethernet/chelsio/cxgb/my3126.c @@ -171,7 +171,7 @@ static const struct cphy_ops my3126_ops = { static struct cphy *my3126_phy_create(struct net_device *dev, int phy_addr, const struct mdio_ops *mdio_ops) { - struct cphy *cphy = kzalloc_obj(*cphy, GFP_KERNEL); + struct cphy *cphy = kzalloc_obj(*cphy); if (!cphy) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index 21d7f84af72e..d8fca697874a 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c @@ -366,7 +366,7 @@ static int tx_sched_init(struct sge *sge) struct sched *s; int i; - s = kzalloc_obj(struct sched, GFP_KERNEL); + s = kzalloc_obj(struct sched); if (!s) return -ENOMEM; @@ -2095,7 +2095,7 @@ static void espibug_workaround(struct timer_list *t) */ struct sge *t1_sge_create(struct adapter *adapter, struct sge_params *p) { - struct sge *sge = kzalloc_obj(*sge, GFP_KERNEL); + struct sge *sge = kzalloc_obj(*sge); int i; if (!sge) diff --git a/drivers/net/ethernet/chelsio/cxgb/tp.c b/drivers/net/ethernet/chelsio/cxgb/tp.c index 66dfe57b9f01..0d741e374f71 100644 --- a/drivers/net/ethernet/chelsio/cxgb/tp.c +++ b/drivers/net/ethernet/chelsio/cxgb/tp.c @@ -58,7 +58,7 @@ void t1_tp_destroy(struct petp *tp) struct petp *t1_tp_create(adapter_t *adapter, struct tp_params *p) { - struct petp *tp = kzalloc_obj(*tp, GFP_KERNEL); + struct petp *tp = kzalloc_obj(*tp); if (!tp) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index ce9880805a42..88b6d76817e9 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c @@ -3242,7 +3242,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) mmio_len = pci_resource_len(pdev, 0); ai = t3_get_adapter_info(ent->driver_data); - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) { err = -ENOMEM; goto out_release_regions; diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c index cf8916f4e3d6..1e544047fa3a 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c @@ -1185,7 +1185,7 @@ int cxgb3_offload_activate(struct adapter *adapter) unsigned int l2t_capacity; struct l2t_data *l2td; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c index fb958857bfd6..0549265807a1 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c +++ b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c @@ -301,7 +301,7 @@ struct clip_tbl *t4_init_clip_tbl(unsigned int clipt_start, for (i = 0; i < ctbl->clipt_size; ++i) INIT_LIST_HEAD(&ctbl->hash_list[i]); - cl_list = kvzalloc_objs(struct clip_entry, clipt_size, GFP_KERNEL); + cl_list = kvzalloc_objs(struct clip_entry, clipt_size); if (!cl_list) { kvfree(ctbl); return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index 6e2e5644b825..f521737d1275 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c @@ -860,7 +860,7 @@ static int cctrl_tbl_show(struct seq_file *seq, void *v) u16 (*incr)[NCCTRL_WIN]; struct adapter *adap = seq->private; - incr = kmalloc_objs(*incr, NMTUS, GFP_KERNEL); + incr = kmalloc_objs(*incr, NMTUS); if (!incr) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c index 3c66db1f765a..7db3dbc488a7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c @@ -2250,7 +2250,7 @@ int cxgb4_init_ethtool_filters(struct adapter *adap) u32 nentries, i; int ret; - eth_filter = kzalloc_obj(*eth_filter, GFP_KERNEL); + eth_filter = kzalloc_obj(*eth_filter); if (!eth_filter) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c index dad0e72a52ab..657d96b9e2f6 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c @@ -1389,7 +1389,7 @@ static int cxgb4_set_hash_filter(struct net_device *dev, if (iq < 0) return iq; - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 20eeb4deab49..701936b28167 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -478,7 +478,7 @@ int cxgb4_change_mac(struct port_info *pi, unsigned int viid, goto set_hash; } } - new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, addr); @@ -1330,7 +1330,7 @@ static int cxgb4_port_mirror_alloc_queues(struct net_device *dev) if (s->mirror_rxq[pi->port_id]) return 0; - mirror_rxq = kzalloc_objs(*mirror_rxq, pi->nmirrorqsets, GFP_KERNEL); + mirror_rxq = kzalloc_objs(*mirror_rxq, pi->nmirrorqsets); if (!mirror_rxq) return -ENOMEM; @@ -4057,7 +4057,7 @@ static int adap_config_hma(struct adapter *adapter) page_size = HMA_PAGE_SIZE; page_order = HMA_PAGE_ORDER; - adapter->hma.sgt = kzalloc_obj(*adapter->hma.sgt, GFP_KERNEL); + adapter->hma.sgt = kzalloc_obj(*adapter->hma.sgt); if (unlikely(!adapter->hma.sgt)) { dev_err(adapter->pdev_dev, "HMA SG table allocation failed\n"); return -ENOMEM; @@ -4097,7 +4097,7 @@ static int adap_config_hma(struct adapter *adapter) } adapter->hma.flags |= HMA_DMA_MAPPED_FLAG; - adapter->hma.phy_addr = kzalloc_objs(dma_addr_t, sgt->nents, GFP_KERNEL); + adapter->hma.phy_addr = kzalloc_objs(dma_addr_t, sgt->nents); if (unlikely(!adapter->hma.phy_addr)) goto free_hma; @@ -4811,7 +4811,7 @@ static int adap_init0(struct adapter *adap, int vpd_skip) /* allocate memory to read the header of the firmware on the * card */ - card_fw = kvzalloc_obj(*card_fw, GFP_KERNEL); + card_fw = kvzalloc_obj(*card_fw); if (!card_fw) { ret = -ENOMEM; goto bye; @@ -5835,7 +5835,7 @@ static int alloc_msix_info(struct adapter *adap, u32 num_vec) { struct msix_info *msix_info; - msix_info = kzalloc_objs(*msix_info, num_vec, GFP_KERNEL); + msix_info = kzalloc_objs(*msix_info, num_vec); if (!msix_info) return -ENOMEM; @@ -5934,7 +5934,7 @@ static int enable_msix(struct adapter *adap) want += EXTRA_VECS; need += EXTRA_VECS; - entries = kmalloc_objs(*entries, want, GFP_KERNEL); + entries = kmalloc_objs(*entries, want); if (!entries) return -ENOMEM; @@ -6604,7 +6604,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_disable_device; } - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) { err = -ENOMEM; goto out_unmap_bar0; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c index 79db92f3ba62..3307e5042681 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c @@ -145,7 +145,7 @@ static void cxgb4_action_natmode_tweak(struct ch_filter_specification *fs, static struct ch_tc_flower_entry *allocate_flower_entry(void) { - struct ch_tc_flower_entry *new = kzalloc_obj(*new, GFP_KERNEL); + struct ch_tc_flower_entry *new = kzalloc_obj(*new); if (new) spin_lock_init(&new->lock); return new; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c index 4d53744b2130..104d92a3db28 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c @@ -531,7 +531,7 @@ int cxgb4_init_tc_matchall(struct adapter *adap) struct cxgb4_tc_matchall *tc_matchall; int ret; - tc_matchall = kzalloc_obj(*tc_matchall, GFP_KERNEL); + tc_matchall = kzalloc_obj(*tc_matchall); if (!tc_matchall) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c index 9d07540e2955..724cd8be1003 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c @@ -100,7 +100,7 @@ static int cxgb4_init_eosw_txq(struct net_device *dev, memset(eosw_txq, 0, sizeof(*eosw_txq)); - ring = kzalloc_objs(*ring, CXGB4_EOSW_TXQ_DEFAULT_DESC_NUM, GFP_KERNEL); + ring = kzalloc_objs(*ring, CXGB4_EOSW_TXQ_DEFAULT_DESC_NUM); if (!ring) return -ENOMEM; @@ -654,7 +654,7 @@ int cxgb4_init_tc_mqprio(struct adapter *adap) int ret = 0; u8 i; - tc_mqprio = kzalloc_obj(*tc_mqprio, GFP_KERNEL); + tc_mqprio = kzalloc_obj(*tc_mqprio); if (!tc_mqprio) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c index c1fe70fc3286..1b91c3448f22 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c @@ -241,7 +241,7 @@ static int cfg_queues_uld(struct adapter *adap, unsigned int uld_type, struct sge_uld_rxq_info *rxq_info; int i, nrxq, ciq_size; - rxq_info = kzalloc_obj(*rxq_info, GFP_KERNEL); + rxq_info = kzalloc_obj(*rxq_info); if (!rxq_info) return -ENOMEM; @@ -269,7 +269,7 @@ static int cfg_queues_uld(struct adapter *adap, unsigned int uld_type, } nrxq = rxq_info->nrxq + rxq_info->nciq; /* total rxq's */ - rxq_info->uldrxq = kzalloc_objs(struct sge_ofld_rxq, nrxq, GFP_KERNEL); + rxq_info->uldrxq = kzalloc_objs(struct sge_ofld_rxq, nrxq); if (!rxq_info->uldrxq) { kfree(rxq_info); return -ENOMEM; @@ -471,7 +471,7 @@ setup_sge_txq_uld(struct adapter *adap, unsigned int uld_type, (atomic_inc_return(&txq_info->users) > 1)) return 0; - txq_info = kzalloc_obj(*txq_info, GFP_KERNEL); + txq_info = kzalloc_obj(*txq_info); if (!txq_info) return -ENOMEM; if (uld_type == CXGB4_ULD_CRYPTO) { @@ -524,7 +524,7 @@ int t4_uld_mem_alloc(struct adapter *adap) { struct sge *s = &adap->sge; - adap->uld = kzalloc_objs(*adap->uld, CXGB4_ULD_MAX, GFP_KERNEL); + adap->uld = kzalloc_objs(*adap->uld, CXGB4_ULD_MAX); if (!adap->uld) return -ENOMEM; @@ -802,7 +802,7 @@ void cxgb4_register_uld(enum cxgb4_uld type, if (type >= CXGB4_ULD_MAX) return; - uld_entry = kzalloc_obj(*uld_entry, GFP_KERNEL); + uld_entry = kzalloc_obj(*uld_entry); if (!uld_entry) return; diff --git a/drivers/net/ethernet/chelsio/cxgb4/sched.c b/drivers/net/ethernet/chelsio/cxgb4/sched.c index 8e73a5c49529..28b1d5b2bcab 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sched.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sched.c @@ -225,7 +225,7 @@ static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p) if (p->queue < 0 || p->queue >= pi->nqsets) return -ERANGE; - qe = kvzalloc_obj(struct sched_queue_entry, GFP_KERNEL); + qe = kvzalloc_obj(struct sched_queue_entry); if (!qe) return -ENOMEM; @@ -294,7 +294,7 @@ static int t4_sched_flowc_bind(struct port_info *pi, struct ch_sched_flowc *p) if (p->tid < 0 || p->tid >= adap->tids.neotids) return -ERANGE; - fe = kvzalloc_obj(*fe, GFP_KERNEL); + fe = kvzalloc_obj(*fe); if (!fe) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/cxgb4/srq.c b/drivers/net/ethernet/chelsio/cxgb4/srq.c index 1f7e2dece66c..2a110494c363 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/srq.c +++ b/drivers/net/ethernet/chelsio/cxgb4/srq.c @@ -40,7 +40,7 @@ struct srq_data *t4_init_srq(int srq_size) { struct srq_data *s; - s = kvzalloc_obj(*s, GFP_KERNEL); + s = kvzalloc_obj(*s); if (!s) return NULL; diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 592f736f6c85..9eaa9aadee33 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -288,7 +288,7 @@ static int cxgb4vf_change_mac(struct port_info *pi, unsigned int viid, goto set_hash; } } - new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry); if (!new_entry) return -ENOMEM; ether_addr_copy(new_entry->addr, addr); @@ -2935,7 +2935,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, /* * Allocate our adapter data structure and attach it to the device. */ - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) { err = -ENOMEM; goto err_release_regions; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c index e89150c0f2c7..efbe07a3ba07 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c @@ -104,7 +104,7 @@ static void *ch_ipsec_uld_add(const struct cxgb4_lld_info *infop) pr_info_once("%s - version %s\n", CHIPSEC_DRV_DESC, CHIPSEC_DRV_VERSION); - u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; @@ -295,7 +295,7 @@ static int ch_ipsec_xfrm_add_state(struct net_device *dev, return -ENODEV; } - sa_entry = kzalloc_obj(*sa_entry, GFP_KERNEL); + sa_entry = kzalloc_obj(*sa_entry); if (!sa_entry) { res = -ENOMEM; module_put(THIS_MODULE); diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c index eb53e3a3ccf9..f5acd4be1e69 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -442,7 +442,7 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk, if (u_ctx && u_ctx->detach) goto out; - tx_info = kvzalloc_obj(*tx_info, GFP_KERNEL); + tx_info = kvzalloc_obj(*tx_info); if (!tx_info) goto out; @@ -2117,7 +2117,7 @@ static void *chcr_ktls_uld_add(const struct cxgb4_lld_info *lldi) pr_info_once("%s - version %s\n", CHCR_KTLS_DRV_DESC, CHCR_KTLS_DRV_VERSION); - u_ctx = kzalloc_obj(*u_ctx, GFP_KERNEL); + u_ctx = kzalloc_obj(*u_ctx); if (!u_ctx) { u_ctx = ERR_PTR(-ENOMEM); goto out; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c index caa46c191268..0e3e5cf52c2c 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c @@ -548,7 +548,7 @@ static struct listen_info *listen_hash_add(struct chtls_dev *cdev, struct sock *sk, unsigned int stid) { - struct listen_info *p = kmalloc_obj(*p, GFP_KERNEL); + struct listen_info *p = kmalloc_obj(*p); if (p) { int key = listen_hashfn(sk); @@ -666,7 +666,7 @@ int chtls_listen_start(struct chtls_dev *cdev, struct sock *sk) if (listen_hash_find(cdev, sk) >= 0) /* already have it */ return -EADDRINUSE; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c index 511ca3bfce3f..2570575434f9 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c @@ -95,7 +95,7 @@ static int chtls_start_listen(struct chtls_dev *cdev, struct sock *sk) return -EADDRNOTAVAIL; sk->sk_backlog_rcv = listen_backlog_rcv; - clisten = kmalloc_obj(*clisten, GFP_KERNEL); + clisten = kmalloc_obj(*clisten); if (!clisten) return -ENOMEM; clisten->cdev = cdev; @@ -114,7 +114,7 @@ static void chtls_stop_listen(struct chtls_dev *cdev, struct sock *sk) if (sk->sk_protocol != IPPROTO_TCP) return; - clisten = kmalloc_obj(*clisten, GFP_KERNEL); + clisten = kmalloc_obj(*clisten); if (!clisten) return; clisten->cdev = cdev; @@ -238,11 +238,11 @@ static void *chtls_uld_add(const struct cxgb4_lld_info *info) struct chtls_dev *cdev; int i, j; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) goto out; - lldi = kzalloc_obj(*lldi, GFP_KERNEL); + lldi = kzalloc_obj(*lldi); if (!lldi) goto out_lldi; diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 14dc4c5aa825..2b812dd1b9ce 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -2456,15 +2456,15 @@ static void enic_free_enic_resources(struct enic *enic) static int enic_alloc_enic_resources(struct enic *enic) { - enic->wq = kzalloc_objs(struct enic_wq, enic->wq_avail, GFP_KERNEL); + enic->wq = kzalloc_objs(struct enic_wq, enic->wq_avail); if (!enic->wq) goto free_queues; - enic->rq = kzalloc_objs(struct enic_rq, enic->rq_avail, GFP_KERNEL); + enic->rq = kzalloc_objs(struct enic_rq, enic->rq_avail); if (!enic->rq) goto free_queues; - enic->cq = kzalloc_objs(struct vnic_cq, enic->cq_avail, GFP_KERNEL); + enic->cq = kzalloc_objs(struct vnic_cq, enic->cq_avail); if (!enic->cq) goto free_queues; @@ -2737,7 +2737,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) #endif /* Allocate structure for port profiles */ - enic->pp = kzalloc_objs(*enic->pp, num_pps, GFP_KERNEL); + enic->pp = kzalloc_objs(*enic->pp, num_pps); if (!enic->pp) { err = -ENOMEM; goto err_out_disable_sriov_pp; diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c index 5a8a49f8c44f..c72452749f5e 100644 --- a/drivers/net/ethernet/cisco/enic/vnic_dev.c +++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c @@ -371,7 +371,7 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev) if (vdev->devcmd2) return 0; - vdev->devcmd2 = kzalloc_obj(*vdev->devcmd2, GFP_KERNEL); + vdev->devcmd2 = kzalloc_obj(*vdev->devcmd2); if (!vdev->devcmd2) return -ENOMEM; @@ -1053,7 +1053,7 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev, unsigned int num_bars) { if (!vdev) { - vdev = kzalloc_obj(struct vnic_dev, GFP_KERNEL); + vdev = kzalloc_obj(struct vnic_dev); if (!vdev) return NULL; } diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index d5608611cee8..4824232f4890 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -554,7 +554,7 @@ static int gmac_setup_txqs(struct net_device *netdev) rwptr_reg = port->dma_base + GMAC_SW_TX_QUEUE0_PTR_REG; - skb_tab = kzalloc_objs(*skb_tab, len, GFP_KERNEL); + skb_tab = kzalloc_objs(*skb_tab, len); if (!skb_tab) return -ENOMEM; @@ -940,7 +940,7 @@ static int geth_setup_freeq(struct gemini_ethernet *geth) } /* Allocate a mapping to page look-up index */ - geth->freeq_pages = kzalloc_objs(*geth->freeq_pages, pages, GFP_KERNEL); + geth->freeq_pages = kzalloc_objs(*geth->freeq_pages, pages); if (!geth->freeq_pages) goto err_freeq; geth->num_freeq_pages = pages; diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index fb9c9d8bc659..4940b40f472d 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -4207,7 +4207,7 @@ static int be_vf_setup_init(struct be_adapter *adapter) struct be_vf_cfg *vf_cfg; int vf; - adapter->vf_cfg = kzalloc_objs(*vf_cfg, adapter->num_vfs, GFP_KERNEL); + adapter->vf_cfg = kzalloc_objs(*vf_cfg, adapter->num_vfs); if (!adapter->vf_cfg) return -ENOMEM; diff --git a/drivers/net/ethernet/engleder/tsnep_rxnfc.c b/drivers/net/ethernet/engleder/tsnep_rxnfc.c index 9342dff7a073..43c550d3983c 100644 --- a/drivers/net/ethernet/engleder/tsnep_rxnfc.c +++ b/drivers/net/ethernet/engleder/tsnep_rxnfc.c @@ -231,7 +231,7 @@ int tsnep_rxnfc_add_rule(struct tsnep_adapter *adapter, return -EINVAL; } - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c index 0071d9538661..f2c3c5f3b461 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c @@ -421,7 +421,7 @@ static int dpaa_set_coalesce(struct net_device *dev, bool *needs_revert; int cpu, res; - needs_revert = kzalloc_objs(bool, num_possible_cpus(), GFP_KERNEL); + needs_revert = kzalloc_objs(bool, num_possible_cpus()); if (!needs_revert) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c index 0db00bebb268..b65bc54ffc03 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c @@ -237,7 +237,7 @@ int dpaa2_eth_dl_traps_register(struct dpaa2_eth_priv *priv) struct device *dev = net_dev->dev.parent; int err; - dpaa2_eth_trap_data = kzalloc_obj(*dpaa2_eth_trap_data, GFP_KERNEL); + dpaa2_eth_trap_data = kzalloc_obj(*dpaa2_eth_trap_data); if (!dpaa2_eth_trap_data) return -ENOMEM; priv->trap_data = dpaa2_eth_trap_data; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 70691bf85e2d..9335703768a9 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -3125,7 +3125,7 @@ static struct dpaa2_eth_channel *dpaa2_eth_alloc_channel(struct dpaa2_eth_priv * struct device *dev = priv->net_dev->dev.parent; int err; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return NULL; @@ -3392,7 +3392,7 @@ struct dpaa2_eth_bp *dpaa2_eth_allocate_dpbp(struct dpaa2_eth_priv *priv) return ERR_PTR(err); } - bp = kzalloc_obj(*bp, GFP_KERNEL); + bp = kzalloc_obj(*bp); if (!bp) { err = -ENOMEM; goto err_alloc; @@ -4673,7 +4673,7 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv) goto out_put_device; } - mac = kzalloc_obj(struct dpaa2_mac, GFP_KERNEL); + mac = kzalloc_obj(struct dpaa2_mac); if (!mac) { err = -ENOMEM; goto out_put_device; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c index 388f81713f1e..5b0f0ac1518a 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c @@ -505,7 +505,7 @@ dpaa2_switch_cls_flower_replace_acl(struct dpaa2_switch_filter_block *block, return -ENOMEM; } - acl_entry = kzalloc_obj(*acl_entry, GFP_KERNEL); + acl_entry = kzalloc_obj(*acl_entry); if (!acl_entry) return -ENOMEM; @@ -633,7 +633,7 @@ dpaa2_switch_cls_flower_replace_mirror(struct dpaa2_switch_filter_block *block, } } - mirror_entry = kzalloc_obj(*mirror_entry, GFP_KERNEL); + mirror_entry = kzalloc_obj(*mirror_entry); if (!mirror_entry) return -ENOMEM; @@ -708,7 +708,7 @@ dpaa2_switch_cls_matchall_replace_acl(struct dpaa2_switch_filter_block *block, return -ENOMEM; } - acl_entry = kzalloc_obj(*acl_entry, GFP_KERNEL); + acl_entry = kzalloc_obj(*acl_entry); if (!acl_entry) return -ENOMEM; @@ -780,7 +780,7 @@ dpaa2_switch_cls_matchall_replace_mirror(struct dpaa2_switch_filter_block *block } } - mirror_entry = kzalloc_obj(*mirror_entry, GFP_KERNEL); + mirror_entry = kzalloc_obj(*mirror_entry); if (!mirror_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 2b0cac347fec..b91687c55a65 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1456,7 +1456,7 @@ static int dpaa2_switch_port_connect_mac(struct ethsw_port_priv *port_priv) goto out_put_device; } - mac = kzalloc_obj(*mac, GFP_KERNEL); + mac = kzalloc_obj(*mac); if (!mac) { err = -ENOMEM; goto out_put_device; @@ -3385,7 +3385,7 @@ static int dpaa2_switch_probe(struct fsl_mc_device *sw_dev) int i, err; /* Allocate switch core*/ - ethsw = kzalloc_obj(*ethsw, GFP_KERNEL); + ethsw = kzalloc_obj(*ethsw); if (!ethsw) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index d6575a446adf..c220dfdbadfe 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2268,7 +2268,7 @@ enetc_alloc_tx_resources(struct enetc_ndev_priv *priv) struct enetc_bdr_resource *tx_res; int i, err; - tx_res = kzalloc_objs(*tx_res, priv->num_tx_rings, GFP_KERNEL); + tx_res = kzalloc_objs(*tx_res, priv->num_tx_rings); if (!tx_res) return ERR_PTR(-ENOMEM); @@ -2340,7 +2340,7 @@ enetc_alloc_rx_resources(struct enetc_ndev_priv *priv, bool extended) struct enetc_bdr_resource *rx_res; int i, err; - rx_res = kzalloc_objs(*rx_res, priv->num_rx_rings, GFP_KERNEL); + rx_res = kzalloc_objs(*rx_res, priv->num_rx_rings); if (!rx_res) return ERR_PTR(-ENOMEM); @@ -2469,7 +2469,7 @@ static int enetc_setup_default_rss_table(struct enetc_si *si, int num_groups) int *rss_table; int i; - rss_table = kmalloc_objs(*rss_table, si->num_rss, GFP_KERNEL); + rss_table = kmalloc_objs(*rss_table, si->num_rss); if (!rss_table) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index eb3a50a94df7..43b0af59d044 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -814,7 +814,7 @@ static int enetc_init_port_rss_memory(struct enetc_si *si) if (!num_rss) return 0; - rss_table = kzalloc_objs(*rss_table, num_rss, GFP_KERNEL); + rss_table = kzalloc_objs(*rss_table, num_rss); if (!rss_table) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c index dbf35abea7f7..162cbc801730 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c @@ -53,7 +53,7 @@ static int enetc_ptp_probe(struct pci_dev *pdev, pci_set_master(pdev); - ptp_qoriq = kzalloc_obj(*ptp_qoriq, GFP_KERNEL); + ptp_qoriq = kzalloc_obj(*ptp_qoriq); if (!ptp_qoriq) { err = -ENOMEM; goto err_alloc_ptp; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index 6ff65108cc97..7b17bca24f26 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -1153,7 +1153,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, if (!entryg) return -EINVAL; - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; @@ -1266,7 +1266,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, filter->sgi_index = sgi->index; - sfi = kzalloc_obj(*sfi, GFP_KERNEL); + sfi = kzalloc_obj(*sfi); if (!sfi) { err = -ENOMEM; goto free_gate; @@ -1283,7 +1283,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, goto free_sfi; if (entryp->police.burst) { - fmi = kzalloc_obj(*fmi, GFP_KERNEL); + fmi = kzalloc_obj(*fmi); if (!fmi) { err = -ENOMEM; goto free_sfi; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c43539d4bab0..f89aa94ce020 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3952,7 +3952,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev) struct fec_enet_priv_tx_q *txq; for (i = 0; i < fep->num_tx_queues; i++) { - txq = kzalloc_obj(*txq, GFP_KERNEL); + txq = kzalloc_obj(*txq); if (!txq) { ret = -ENOMEM; goto alloc_failed; @@ -3975,7 +3975,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev) } for (i = 0; i < fep->num_rx_queues; i++) { - fep->rx_queue[i] = kzalloc_obj(*fep->rx_queue[i], GFP_KERNEL); + fep->rx_queue[i] = kzalloc_obj(*fep->rx_queue[i]); if (!fep->rx_queue[i]) { ret = -ENOMEM; goto alloc_failed; @@ -4425,7 +4425,7 @@ fec_alloc_new_rxq_xsk(struct fec_enet_private *fep, int queue, union fec_rx_buffer *buf; int i; - rxq = kzalloc_obj(*rxq, GFP_KERNEL); + rxq = kzalloc_obj(*rxq); if (!rxq) return NULL; @@ -4466,7 +4466,7 @@ fec_alloc_new_rxq_pp(struct fec_enet_private *fep, int queue) union fec_rx_buffer *buf; int i = 0; - rxq = kzalloc_obj(*rxq, GFP_KERNEL); + rxq = kzalloc_obj(*rxq); if (!rxq) return NULL; diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c index f182480909f1..d48a1c4d0431 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c @@ -74,7 +74,7 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of) bus = mdiobus_alloc(); if (bus == NULL) return -ENOMEM; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) { err = -ENOMEM; goto out_free; diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index b8d603fb70dc..013273a2de32 100644 --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -1688,12 +1688,12 @@ static int fman_config(struct fman *fman) base_addr = fman->dts_params.base_addr; - fman->state = kzalloc_obj(*fman->state, GFP_KERNEL); + fman->state = kzalloc_obj(*fman->state); if (!fman->state) goto err_fm_state; /* Allocate the FM driver's parameters structure */ - fman->cfg = kzalloc_obj(*fman->cfg, GFP_KERNEL); + fman->cfg = kzalloc_obj(*fman->cfg); if (!fman->cfg) goto err_fm_drv; @@ -2697,7 +2697,7 @@ static struct fman *read_dts_node(struct platform_device *of_dev) struct clk *clk; u32 clk_rate; - fman = kzalloc_obj(*fman, GFP_KERNEL); + fman = kzalloc_obj(*fman); if (!fman) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 12d739808f16..fe35703c509e 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1348,12 +1348,12 @@ static struct fman_mac *dtsec_config(struct mac_device *mac_dev, struct dtsec_cfg *dtsec_drv_param; /* allocate memory for the UCC GETH data structure. */ - dtsec = kzalloc_obj(*dtsec, GFP_KERNEL); + dtsec = kzalloc_obj(*dtsec); if (!dtsec) return NULL; /* allocate memory for the d_tsec driver parameters data structure. */ - dtsec_drv_param = kzalloc_obj(*dtsec_drv_param, GFP_KERNEL); + dtsec_drv_param = kzalloc_obj(*dtsec_drv_param); if (!dtsec_drv_param) goto err_dtsec; diff --git a/drivers/net/ethernet/freescale/fman/fman_keygen.c b/drivers/net/ethernet/freescale/fman/fman_keygen.c index f4b83b5eb018..74641348d49a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_keygen.c +++ b/drivers/net/ethernet/freescale/fman/fman_keygen.c @@ -629,7 +629,7 @@ struct fman_keygen *keygen_init(struct fman_kg_regs __iomem *keygen_regs) int i; /* Allocate memory for KeyGen driver */ - keygen = kzalloc_obj(*keygen, GFP_KERNEL); + keygen = kzalloc_obj(*keygen); if (!keygen) return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 83d53f33abc2..85444f6f8f9d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -224,13 +224,13 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size) struct eth_hash_t *hash; /* Allocate address hash table */ - hash = kmalloc_obj(*hash, GFP_KERNEL); + hash = kmalloc_obj(*hash); if (!hash) return NULL; hash->size = size; - hash->lsts = kmalloc_objs(struct list_head, hash->size, GFP_KERNEL); + hash->lsts = kmalloc_objs(struct list_head, hash->size); if (!hash->lsts) { kfree(hash); return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index f9461bba1a66..e2d8c58deef0 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1086,12 +1086,12 @@ static struct fman_mac *memac_config(struct mac_device *mac_dev, struct memac_cfg *memac_drv_param; /* allocate memory for the m_emac data structure */ - memac = kzalloc_obj(*memac, GFP_KERNEL); + memac = kzalloc_obj(*memac); if (!memac) return NULL; /* allocate memory for the m_emac driver parameters data structure */ - memac_drv_param = kzalloc_obj(*memac_drv_param, GFP_KERNEL); + memac_drv_param = kzalloc_obj(*memac_drv_param); if (!memac_drv_param) { memac_free(memac); return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_muram.c b/drivers/net/ethernet/freescale/fman/fman_muram.c index eb85c54c9408..6ac7c2b0cb19 100644 --- a/drivers/net/ethernet/freescale/fman/fman_muram.c +++ b/drivers/net/ethernet/freescale/fman/fman_muram.c @@ -40,7 +40,7 @@ struct muram_info *fman_muram_init(phys_addr_t base, size_t size) void __iomem *vaddr; int ret; - muram = kzalloc_obj(*muram, GFP_KERNEL); + muram = kzalloc_obj(*muram); if (!muram) return NULL; diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index a3e8c77dbb57..1b8fef69114e 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.c +++ b/drivers/net/ethernet/freescale/fman/fman_port.c @@ -1297,7 +1297,7 @@ int fman_port_config(struct fman_port *port, struct fman_port_params *params) int err; /* Allocate the FM driver's parameters structure */ - port->cfg = kzalloc_obj(*port->cfg, GFP_KERNEL); + port->cfg = kzalloc_obj(*port->cfg); if (!port->cfg) return -EINVAL; @@ -1753,7 +1753,7 @@ static int fman_port_probe(struct platform_device *of_dev) u16 port_speed; u8 port_id; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 05edac07ba6c..23db0bc6656c 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -711,12 +711,12 @@ static struct fman_mac *tgec_config(struct mac_device *mac_dev, struct tgec_cfg *cfg; /* allocate memory for the UCC GETH data structure. */ - tgec = kzalloc_obj(*tgec, GFP_KERNEL); + tgec = kzalloc_obj(*tgec); if (!tgec) return NULL; /* allocate memory for the 10G MAC driver parameters data structure. */ - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) { tgec_free(tgec); return NULL; diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 3ba98561f566..2cbcc29408e3 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -866,7 +866,7 @@ static int fs_enet_probe(struct platform_device *ofdev) if (!ops) return -EINVAL; - fpi = kzalloc_obj(*fpi, GFP_KERNEL); + fpi = kzalloc_obj(*fpi); if (!fpi) return -ENOMEM; diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c index 2a27dc0b5653..33a3eef41723 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c @@ -152,7 +152,7 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev) struct bb_info *bitbang; int ret = -ENOMEM; - bitbang = kzalloc_obj(struct bb_info, GFP_KERNEL); + bitbang = kzalloc_obj(struct bb_info); if (!bitbang) goto out; diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c index 512e897cea08..4774dc49c331 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c +++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c @@ -108,7 +108,7 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev) if (!new_bus) goto out; - fec = kzalloc_obj(struct fec_info, GFP_KERNEL); + fec = kzalloc_obj(struct fec_info); if (!fec) goto out_mii; diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index a58cd09b4c0d..a363817993ab 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -507,7 +507,7 @@ static int gfar_parse_group(struct device_node *np, int i; for (i = 0; i < GFAR_NUM_IRQS; i++) { - grp->irqinfo[i] = kzalloc_obj(struct gfar_irqinfo, GFP_KERNEL); + grp->irqinfo[i] = kzalloc_obj(struct gfar_irqinfo); if (!grp->irqinfo[i]) return -ENOMEM; } diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 528a0717084c..e8edef6505bf 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -1241,7 +1241,7 @@ static int gfar_process_filer_changes(struct gfar_private *priv) s32 ret = 0; /* So index is set to zero, too! */ - tab = kzalloc_obj(*tab, GFP_KERNEL); + tab = kzalloc_obj(*tab); if (tab == NULL) return -ENOMEM; @@ -1293,7 +1293,7 @@ static int gfar_add_cls(struct gfar_private *priv, struct ethtool_flow_spec_container *temp, *comp; int ret = 0; - temp = kmalloc_obj(*temp, GFP_KERNEL); + temp = kmalloc_obj(*temp); if (temp == NULL) return -ENOMEM; memcpy(&temp->fs, flow, sizeof(temp->fs)); diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index b1ced6432f26..684094118117 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2677,7 +2677,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) * allocated resources can be released when the channel is freed. */ if (!(ugeth->p_init_enet_param_shadow = - kzalloc_obj(struct ucc_geth_init_pram, GFP_KERNEL))) { + kzalloc_obj(struct ucc_geth_init_pram))) { if (netif_msg_ifup(ugeth)) pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/fungible/funcore/fun_dev.c b/drivers/net/ethernet/fungible/funcore/fun_dev.c index 1c1e66068fed..a62ae88800f7 100644 --- a/drivers/net/ethernet/fungible/funcore/fun_dev.c +++ b/drivers/net/ethernet/fungible/funcore/fun_dev.c @@ -210,7 +210,7 @@ static int fun_init_cmd_ctx(struct fun_dev *fdev, unsigned int ntags) { unsigned int i; - fdev->cmd_ctx = kvzalloc_objs(*fdev->cmd_ctx, ntags, GFP_KERNEL); + fdev->cmd_ctx = kvzalloc_objs(*fdev->cmd_ctx, ntags); if (!fdev->cmd_ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/fungible/funcore/fun_queue.c b/drivers/net/ethernet/fungible/funcore/fun_queue.c index 200983145606..0eca751a9534 100644 --- a/drivers/net/ethernet/fungible/funcore/fun_queue.c +++ b/drivers/net/ethernet/fungible/funcore/fun_queue.c @@ -405,7 +405,7 @@ void fun_free_queue(struct fun_queue *funq) struct fun_queue *fun_alloc_queue(struct fun_dev *fdev, int qid, const struct fun_queue_alloc_req *req) { - struct fun_queue *funq = kzalloc_obj(*funq, GFP_KERNEL); + struct fun_queue *funq = kzalloc_obj(*funq); if (!funq) return NULL; diff --git a/drivers/net/ethernet/fungible/funeth/funeth_main.c b/drivers/net/ethernet/fungible/funeth/funeth_main.c index 2255f203674a..bad8276d26b0 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_main.c +++ b/drivers/net/ethernet/fungible/funeth/funeth_main.c @@ -424,7 +424,7 @@ static struct funeth_txq **alloc_xdpqs(struct net_device *dev, unsigned int nqs, unsigned int i; int err; - xdpqs = kzalloc_objs(*xdpqs, nqs, GFP_KERNEL); + xdpqs = kzalloc_objs(*xdpqs, nqs); if (!xdpqs) return ERR_PTR(-ENOMEM); @@ -486,7 +486,7 @@ static int fun_alloc_rings(struct net_device *netdev, struct fun_qset *qset) if (err) return err; - rxqs = kzalloc_objs(*rxqs, qset->ntxqs + qset->nrxqs, GFP_KERNEL); + rxqs = kzalloc_objs(*rxqs, qset->ntxqs + qset->nrxqs); if (!rxqs) return -ENOMEM; @@ -1175,7 +1175,7 @@ static int fun_init_vports(struct fun_ethdev *ed, unsigned int n) if (ed->num_vports) return -EINVAL; - ed->vport_info = kvzalloc_objs(*ed->vport_info, n, GFP_KERNEL); + ed->vport_info = kvzalloc_objs(*ed->vport_info, n); if (!ed->vport_info) return -ENOMEM; ed->num_vports = n; @@ -1833,7 +1833,7 @@ static int fun_create_ports(struct fun_ethdev *ed, unsigned int nports) return -EINVAL; } - ed->netdevs = kzalloc_objs(*ed->netdevs, nports, GFP_KERNEL); + ed->netdevs = kzalloc_objs(*ed->netdevs, nports); if (!ed->netdevs) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c index a2b5aeee0831..08f55f437c99 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -185,7 +185,7 @@ gve_get_ethtool_stats(struct net_device *netdev, if (!gve_rx_was_added_to_block(priv, ring)) num_stopped_rxqs++; } - tx_qid_to_stats_idx = kmalloc_objs(int, num_tx_queues, GFP_KERNEL); + tx_qid_to_stats_idx = kmalloc_objs(int, num_tx_queues); if (!tx_qid_to_stats_idx) { kfree(rx_qid_to_stats_idx); return; diff --git a/drivers/net/ethernet/google/gve/gve_flow_rule.c b/drivers/net/ethernet/google/gve/gve_flow_rule.c index f97b124b1c6a..2c80cda28ef3 100644 --- a/drivers/net/ethernet/google/gve/gve_flow_rule.c +++ b/drivers/net/ethernet/google/gve/gve_flow_rule.c @@ -269,7 +269,7 @@ int gve_add_flow_rule(struct gve_priv *priv, struct ethtool_rxnfc *cmd) if (!priv->max_flow_rules) return -EOPNOTSUPP; - rule = kvzalloc_obj(*rule, GFP_KERNEL); + rule = kvzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index 75c4748f9de2..4eebbeb29bee 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -1090,17 +1090,17 @@ struct gve_queue_page_list *gve_alloc_queue_page_list(struct gve_priv *priv, int err; int i; - qpl = kvzalloc_obj(*qpl, GFP_KERNEL); + qpl = kvzalloc_obj(*qpl); if (!qpl) return NULL; qpl->id = id; qpl->num_entries = 0; - qpl->pages = kvzalloc_objs(*qpl->pages, pages, GFP_KERNEL); + qpl->pages = kvzalloc_objs(*qpl->pages, pages); if (!qpl->pages) goto abort; - qpl->page_buses = kvzalloc_objs(*qpl->page_buses, pages, GFP_KERNEL); + qpl->page_buses = kvzalloc_objs(*qpl->page_buses, pages); if (!qpl->page_buses) goto abort; diff --git a/drivers/net/ethernet/google/gve/gve_ptp.c b/drivers/net/ethernet/google/gve/gve_ptp.c index eb836ebcbd60..06b1cf4a5efc 100644 --- a/drivers/net/ethernet/google/gve/gve_ptp.c +++ b/drivers/net/ethernet/google/gve/gve_ptp.c @@ -70,7 +70,7 @@ static int gve_ptp_init(struct gve_priv *priv) struct gve_ptp *ptp; int err; - priv->ptp = kzalloc_obj(*priv->ptp, GFP_KERNEL); + priv->ptp = kzalloc_obj(*priv->ptp); if (!priv->ptp) return -ENOMEM; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index 5a7ce1eea30c..3dab3a271aa6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -800,7 +800,7 @@ hclge_dbg_dump_reg_tqp(struct hclge_dev *hdev, if (ret) return ret; - desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num); if (!desc_src) return -ENOMEM; @@ -852,7 +852,7 @@ hclge_dbg_dump_reg_common(struct hclge_dev *hdev, if (ret) return ret; - desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num); if (!desc_src) return -ENOMEM; @@ -2278,7 +2278,7 @@ static int hclge_dbg_get_imp_stats_info(struct seq_file *s, void *data) return -EINVAL; } - desc_src = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc_src = kzalloc_objs(struct hclge_desc, bd_num); if (!desc_src) return -ENOMEM; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c index 02d21c5e8e0e..dac051e798da 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c @@ -2481,7 +2481,7 @@ static int hclge_handle_all_ras_errors(struct hclge_dev *hdev) return ret; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num); if (!desc) return -ENOMEM; @@ -3038,7 +3038,7 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev, goto out; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num); if (!desc) return -ENOMEM; @@ -3127,7 +3127,7 @@ void hclge_handle_all_hns_hw_errors(struct hnae3_ae_dev *ae_dev) return; bd_num = max_t(u32, mpf_bd_num, pf_bd_num); - desc = kzalloc_objs(struct hclge_desc, bd_num, GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, bd_num); if (!desc) return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 80aa566ad31f..dd4045c773d4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2418,7 +2418,7 @@ int hclge_buffer_alloc(struct hclge_dev *hdev) struct hclge_pkt_buf_alloc *pkt_buf; int ret; - pkt_buf = kzalloc_obj(*pkt_buf, GFP_KERNEL); + pkt_buf = kzalloc_obj(*pkt_buf); if (!pkt_buf) return -ENOMEM; @@ -6582,7 +6582,7 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle, if (ret) return ret; - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; @@ -7410,7 +7410,7 @@ static int hclge_add_cls_flower(struct hnae3_handle *handle, return ret; } - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; @@ -10093,7 +10093,7 @@ static void hclge_add_vport_vlan_table(struct hclge_vport *vport, u16 vlan_id, } } - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) { mutex_unlock(&hdev->vport_lock); return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 7801c39df38d..30e38cb4843a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -212,7 +212,7 @@ static int hclge_get_ring_chain_from_mbx( cur_chain = ring_chain; for (i = 1; i < ring_num; i++) { - new_chain = kzalloc_obj(*new_chain, GFP_KERNEL); + new_chain = kzalloc_obj(*new_chain); if (!new_chain) goto err; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c index 3bd3195d789e..85bac9b27b98 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c @@ -190,7 +190,7 @@ static int hclge_get_32_bit_regs(struct hclge_dev *hdev, u32 regs_num, nodata_num = HCLGE_32_BIT_DESC_NODATA_LEN; cmd_num = DIV_ROUND_UP(regs_num + nodata_num, HCLGE_32_BIT_REG_RTN_DATANUM); - desc = kzalloc_objs(struct hclge_desc, cmd_num, GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, cmd_num); if (!desc) return -ENOMEM; @@ -244,7 +244,7 @@ static int hclge_get_64_bit_regs(struct hclge_dev *hdev, u32 regs_num, nodata_len = HCLGE_64_BIT_DESC_NODATA_LEN; cmd_num = DIV_ROUND_UP(regs_num + nodata_len, HCLGE_64_BIT_REG_RTN_DATANUM); - desc = kzalloc_objs(struct hclge_desc, cmd_num, GFP_KERNEL); + desc = kzalloc_objs(struct hclge_desc, cmd_num); if (!desc) return -ENOMEM; @@ -394,7 +394,7 @@ static int hclge_get_dfx_reg_len(struct hclge_dev *hdev, int *len) int ret; u32 i; - bd_num_list = kzalloc_objs(int, dfx_reg_type_num, GFP_KERNEL); + bd_num_list = kzalloc_objs(int, dfx_reg_type_num); if (!bd_num_list) return -ENOMEM; @@ -455,7 +455,7 @@ static int hclge_get_dfx_reg(struct hclge_dev *hdev, void *data) int ret; u32 i; - bd_num_list = kzalloc_objs(int, dfx_reg_type_num, GFP_KERNEL); + bd_num_list = kzalloc_objs(int, dfx_reg_type_num); if (!bd_num_list) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c b/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c index 39ceba2820bf..bd23c4888a0f 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_debugfs.c @@ -88,7 +88,7 @@ static int hinic_dbg_get_func_table(struct hinic_dev *nic_dev, int idx) int ret = ~0; int err; - read_data = kzalloc_obj(*read_data, GFP_KERNEL); + read_data = kzalloc_obj(*read_data); if (!read_data) return ~0; @@ -182,7 +182,7 @@ static int create_dbg_files(struct hinic_dev *dev, enum hinic_dbg_type type, voi struct hinic_debug_priv *tmp; int i; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c index f4d34fdbc014..c977c43e5d5a 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c @@ -130,7 +130,7 @@ static int hinic_flash_fw(struct hinic_devlink_priv *priv, const u8 *data, int total_len_flag = 0; int err; - fw_update_msg = kzalloc_obj(*fw_update_msg, GFP_KERNEL); + fw_update_msg = kzalloc_obj(*fw_update_msg); if (!fw_update_msg) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c index d4787347d0c5..a8b129ce1b7e 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c @@ -1392,7 +1392,7 @@ static void hinic_get_ethtool_stats(struct net_device *netdev, sizeof(u64)) ? *(u64 *)p : *(u32 *)p; } - port_stats = kzalloc_obj(*port_stats, GFP_KERNEL); + port_stats = kzalloc_obj(*port_stats); if (!port_stats) { memset(&data[i], 0, ARRAY_SIZE(hinic_port_stats) * sizeof(*data)); diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c index f8aef328f8c0..2784127327e6 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c @@ -487,7 +487,7 @@ static void recv_mbox_handler(struct hinic_mbox_func_to_func *func_to_func, if (!rcv_mbox_temp->buf_out) goto err_alloc_rcv_mbox_buf; - mbox_work = kzalloc_obj(*mbox_work, GFP_KERNEL); + mbox_work = kzalloc_obj(*mbox_work); if (!mbox_work) goto err_alloc_mbox_work; @@ -603,7 +603,7 @@ static bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func "The mailbox random id(0x%x) of func_id(0x%x) doesn't match with pf reservation(0x%x)\n", random_id, src, func_to_func->vf_mbx_rand_id[src]); - mbox_work = kzalloc_obj(*mbox_work, GFP_KERNEL); + mbox_work = kzalloc_obj(*mbox_work); if (!mbox_work) return false; @@ -1402,7 +1402,7 @@ int hinic_func_to_func_init(struct hinic_hwdev *hwdev) int err; pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); - func_to_func = kzalloc_obj(*func_to_func, GFP_KERNEL); + func_to_func = kzalloc_obj(*func_to_func); if (!func_to_func) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c index 8bda0a26a345..1a59fcc482d8 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c @@ -441,7 +441,7 @@ static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt, { struct hinic_mgmt_msg_handle_work *mgmt_work = NULL; - mgmt_work = kzalloc_obj(*mgmt_work, GFP_KERNEL); + mgmt_work = kzalloc_obj(*mgmt_work); if (!mgmt_work) return; diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c index 868e666cc392..7bb6eb2a8917 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_port.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c @@ -1032,7 +1032,7 @@ int hinic_get_phy_port_stats(struct hinic_dev *nic_dev, struct pci_dev *pdev = hwif->pdev; int err; - port_stats = kzalloc_obj(*port_stats, GFP_KERNEL); + port_stats = kzalloc_obj(*port_stats); if (!port_stats) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c index ab38da085ae5..11b16799103d 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c @@ -738,7 +738,7 @@ static int init_cmdqs(struct hinic3_hwdev *hwdev) { struct hinic3_cmdqs *cmdqs; - cmdqs = kzalloc_obj(*cmdqs, GFP_KERNEL); + cmdqs = kzalloc_obj(*cmdqs); if (!cmdqs) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c index 78f50dc6513a..13a0c6b07660 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c @@ -648,7 +648,7 @@ int hinic3_aeqs_init(struct hinic3_hwdev *hwdev, u16 num_aeqs, u16 q_id; int err; - aeqs = kzalloc_obj(*aeqs, GFP_KERNEL); + aeqs = kzalloc_obj(*aeqs); if (!aeqs) return -ENOMEM; @@ -720,7 +720,7 @@ int hinic3_ceqs_init(struct hinic3_hwdev *hwdev, u16 num_ceqs, u16 q_id; int err; - ceqs = kzalloc_obj(*ceqs, GFP_KERNEL); + ceqs = kzalloc_obj(*ceqs); if (!ceqs) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c index c65dec383535..ca60cf4b6282 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c @@ -86,7 +86,7 @@ static int hinic3_init_irq_info(struct hinic3_hwdev *hwdev) } irq_info = &cfg_mgmt->irq_info; - irq_info->irq = kzalloc_objs(struct hinic3_irq, intr_num, GFP_KERNEL); + irq_info->irq = kzalloc_objs(struct hinic3_irq, intr_num); if (!irq_info->irq) return -ENOMEM; @@ -129,7 +129,7 @@ int hinic3_init_cfg_mgmt(struct hinic3_hwdev *hwdev) struct hinic3_cfg_mgmt_info *cfg_mgmt; int err; - cfg_mgmt = kzalloc_obj(*cfg_mgmt, GFP_KERNEL); + cfg_mgmt = kzalloc_obj(*cfg_mgmt); if (!cfg_mgmt) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c index f0b402b792b9..0074d0c6dbaf 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c @@ -528,7 +528,7 @@ int hinic3_init_hwdev(struct pci_dev *pdev) struct hinic3_hwdev *hwdev; int err; - hwdev = kzalloc_obj(*hwdev, GFP_KERNEL); + hwdev = kzalloc_obj(*hwdev); if (!hwdev) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c index c1eeedbe0c15..771883174b3b 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c @@ -432,7 +432,7 @@ int hinic3_init_hwif(struct hinic3_hwdev *hwdev) u32 attr1, attr4, attr5; int err; - hwif = kzalloc_obj(*hwif, GFP_KERNEL); + hwif = kzalloc_obj(*hwif); if (!hwif) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c index b5d026c95d39..a8b89eeed753 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c @@ -60,7 +60,7 @@ static struct hinic3_adev *hinic3_add_one_adev(struct hinic3_hwdev *hwdev, const char *svc_name; int ret; - hadev = kzalloc_obj(*hadev, GFP_KERNEL); + hadev = kzalloc_obj(*hadev); if (!hadev) return NULL; @@ -250,7 +250,7 @@ static int hinic3_pci_init(struct pci_dev *pdev) struct hinic3_pcidev *pci_adapter; int err; - pci_adapter = kzalloc_obj(*pci_adapter, GFP_KERNEL); + pci_adapter = kzalloc_obj(*pci_adapter); if (!pci_adapter) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c index 8c7bb38cc57d..826fa8879a11 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c @@ -320,7 +320,7 @@ static int hinic3_init_func_mbox_msg_channel(struct hinic3_hwdev *hwdev) int err; mbox = hwdev->mbox; - mbox->func_msg = kzalloc_obj(*mbox->func_msg, GFP_KERNEL); + mbox->func_msg = kzalloc_obj(*mbox->func_msg); if (!mbox->func_msg) return -ENOMEM; @@ -412,7 +412,7 @@ int hinic3_init_mbox(struct hinic3_hwdev *hwdev) struct hinic3_mbox *mbox; int err; - mbox = kzalloc_obj(*mbox, GFP_KERNEL); + mbox = kzalloc_obj(*mbox); if (!mbox) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c b/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c index 29422ac14bb8..71c6a064d054 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c @@ -120,7 +120,7 @@ static void hinic3_init_mgmt_msg_work(struct hinic3_msg_pf_to_mgmt *pf_to_mgmt, { struct mgmt_msg_handle_work *mgmt_work; - mgmt_work = kmalloc_obj(*mgmt_work, GFP_KERNEL); + mgmt_work = kmalloc_obj(*mgmt_work); if (!mgmt_work) return; @@ -252,7 +252,7 @@ int hinic3_pf_to_mgmt_init(struct hinic3_hwdev *hwdev) struct hinic3_msg_pf_to_mgmt *pf_to_mgmt; int err; - pf_to_mgmt = kzalloc_obj(*pf_to_mgmt, GFP_KERNEL); + pf_to_mgmt = kzalloc_obj(*pf_to_mgmt); if (!pf_to_mgmt) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c index 0ded1000b369..87e736adba02 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c @@ -212,7 +212,7 @@ int hinic3_init_nic_io(struct hinic3_nic_dev *nic_dev) struct hinic3_nic_io *nic_io; int err; - nic_io = kzalloc_obj(*nic_io, GFP_KERNEL); + nic_io = kzalloc_obj(*nic_io); if (!nic_io) return -ENOMEM; @@ -408,13 +408,13 @@ int hinic3_alloc_qps(struct hinic3_nic_dev *nic_dev, if (qp_params->num_qps > nic_io->max_qps || !qp_params->num_qps) return -EINVAL; - sqs = kzalloc_objs(*sqs, qp_params->num_qps, GFP_KERNEL); + sqs = kzalloc_objs(*sqs, qp_params->num_qps); if (!sqs) { err = -ENOMEM; goto err_out; } - rqs = kzalloc_objs(*rqs, qp_params->num_qps, GFP_KERNEL); + rqs = kzalloc_objs(*rqs, qp_params->num_qps); if (!rqs) { err = -ENOMEM; goto err_free_sqs; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c index f2d43beab444..fa3e6b3488fd 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_rx.c @@ -66,7 +66,7 @@ int hinic3_alloc_rxqs(struct net_device *netdev) struct hinic3_rxq *rxq; u16 q_id; - nic_dev->rxqs = kzalloc_objs(*nic_dev->rxqs, num_rxqs, GFP_KERNEL); + nic_dev->rxqs = kzalloc_objs(*nic_dev->rxqs, num_rxqs); if (!nic_dev->rxqs) return -ENOMEM; diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c index 8c988df8963e..3bef50ca4432 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c @@ -48,7 +48,7 @@ int hinic3_alloc_txqs(struct net_device *netdev) struct pci_dev *pdev = nic_dev->pdev; struct hinic3_txq *txq; - nic_dev->txqs = kzalloc_objs(*nic_dev->txqs, num_txqs, GFP_KERNEL); + nic_dev->txqs = kzalloc_objs(*nic_dev->txqs, num_txqs); if (!nic_dev->txqs) return -ENOMEM; diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index a2d7f5468590..ff67c4fd66a3 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -173,7 +173,7 @@ static void ehea_update_firmware_handles(void) num_portres * EHEA_NUM_PORTRES_FW_HANDLES; if (num_fw_handles) { - arr = kzalloc_objs(*arr, num_fw_handles, GFP_KERNEL); + arr = kzalloc_objs(*arr, num_fw_handles); if (!arr) goto out; /* Keep the existing array */ } else @@ -1487,7 +1487,7 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, pr->send_cq->attr.act_nr_of_cqes, pr->recv_cq->attr.act_nr_of_cqes); - init_attr = kzalloc_obj(*init_attr, GFP_KERNEL); + init_attr = kzalloc_obj(*init_attr); if (!init_attr) { ret = -ENOMEM; pr_err("no mem for ehea_qp_init_attr\n"); @@ -2968,7 +2968,7 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, port->msg_enable = netif_msg_init(msg_level, EHEA_MSG_DEFAULT); - port->mc_list = kzalloc_obj(struct ehea_mc_list, GFP_KERNEL); + port->mc_list = kzalloc_obj(struct ehea_mc_list); if (!port->mc_list) { ret = -ENOMEM; goto out_free_ethdev; diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c index e9d51e65efe8..60629a0032b2 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c @@ -114,7 +114,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, int ret; void *vpage; - cq = kzalloc_obj(*cq, GFP_KERNEL); + cq = kzalloc_obj(*cq); if (!cq) goto out_nomem; @@ -235,7 +235,7 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter, void *vpage; struct ehea_eq *eq; - eq = kzalloc_obj(*eq, GFP_KERNEL); + eq = kzalloc_obj(*eq); if (!eq) return NULL; @@ -404,7 +404,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, u32 wqe_size_in_bytes_rq2, wqe_size_in_bytes_rq3; - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return NULL; @@ -542,7 +542,7 @@ static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, { if (!ehea_top_bmap->dir[dir]) { ehea_top_bmap->dir[dir] = - kzalloc_obj(struct ehea_dir_bmap, GFP_KERNEL); + kzalloc_obj(struct ehea_dir_bmap); if (!ehea_top_bmap->dir[dir]) return -ENOMEM; } @@ -553,7 +553,7 @@ static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) { if (!ehea_bmap->top[top]) { ehea_bmap->top[top] = - kzalloc_obj(struct ehea_top_bmap, GFP_KERNEL); + kzalloc_obj(struct ehea_top_bmap); if (!ehea_bmap->top[top]) return -ENOMEM; } @@ -613,7 +613,7 @@ static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add return 0; if (!ehea_bmap) { - ehea_bmap = kzalloc_obj(struct ehea_bmap, GFP_KERNEL); + ehea_bmap = kzalloc_obj(struct ehea_bmap); if (!ehea_bmap) return -ENOMEM; } diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 3108bf50576f..4d6b9e83e341 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -169,7 +169,7 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) if (!pool->free_map) return -1; - pool->dma_addr = kzalloc_objs(dma_addr_t, pool->size, GFP_KERNEL); + pool->dma_addr = kzalloc_objs(dma_addr_t, pool->size); if (!pool->dma_addr) { kfree(pool->free_map); pool->free_map = NULL; diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 1241be315d58..2aeea250a49b 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1117,7 +1117,7 @@ static int init_rx_pools(struct net_device *netdev) rx_pool->index = i; rx_pool->buff_size = ALIGN(buff_size, L1_CACHE_BYTES); - rx_pool->free_map = kzalloc_objs(int, rx_pool->size, GFP_KERNEL); + rx_pool->free_map = kzalloc_objs(int, rx_pool->size); if (!rx_pool->free_map) { dev_err(dev, "Couldn't alloc free_map %d\n", i); rc = -ENOMEM; @@ -1243,7 +1243,7 @@ static int init_one_tx_pool(struct net_device *netdev, if (!tx_pool->tx_buff) return -ENOMEM; - tx_pool->free_map = kzalloc_objs(int, pool_size, GFP_KERNEL); + tx_pool->free_map = kzalloc_objs(int, pool_size); if (!tx_pool->free_map) { kfree(tx_pool->tx_buff); tx_pool->tx_buff = NULL; @@ -1853,7 +1853,7 @@ static int init_resources(struct ibmvnic_adapter *adapter) if (rc) return rc; - adapter->vpd = kzalloc_obj(*adapter->vpd, GFP_KERNEL); + adapter->vpd = kzalloc_obj(*adapter->vpd); if (!adapter->vpd) return -ENOMEM; @@ -4049,7 +4049,7 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter struct ibmvnic_sub_crq_queue *scrq; int rc; - scrq = kzalloc_obj(*scrq, GFP_KERNEL); + scrq = kzalloc_obj(*scrq); if (!scrq) return NULL; @@ -4441,7 +4441,7 @@ static int init_sub_crqs(struct ibmvnic_adapter *adapter) total_queues = adapter->req_tx_queues + adapter->req_rx_queues; - allqueues = kzalloc_objs(*allqueues, total_queues, GFP_KERNEL); + allqueues = kzalloc_objs(*allqueues, total_queues); if (!allqueues) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 321a15a220a6..9074b558de35 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c @@ -2156,7 +2156,7 @@ static int e100_rx_alloc_list(struct nic *nic) nic->rx_to_use = nic->rx_to_clean = NULL; nic->ru_running = RU_UNINITIALIZED; - if (!(nic->rxs = kzalloc_objs(struct rx, count, GFP_KERNEL))) + if (!(nic->rxs = kzalloc_objs(struct rx, count))) return -ENOMEM; for (rx = nic->rxs, i = 0; i < count; rx++, i++) { diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index dacebf773adf..906b8c01f8bc 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -291,7 +291,7 @@ static int i40e_register_auxiliary_dev(struct i40e_info *ldev, const char *name) struct auxiliary_device *aux_dev; int ret; - i40e_aux_dev = kzalloc_obj(*i40e_aux_dev, GFP_KERNEL); + i40e_aux_dev = kzalloc_obj(*i40e_aux_dev); if (!i40e_aux_dev) return -ENOMEM; @@ -337,7 +337,7 @@ static void i40e_client_add_instance(struct i40e_pf *pf) struct i40e_client_instance *cdev = NULL; struct netdev_hw_addr *mac = NULL; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return; @@ -466,7 +466,7 @@ int i40e_lan_add_device(struct i40e_pf *pf) goto out; } } - ldev = kzalloc_obj(*ldev, GFP_KERNEL); + ldev = kzalloc_obj(*ldev); if (!ldev) { ret = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 8056fa9d9cf2..7b9aa330e220 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c @@ -1228,7 +1228,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, struct libie_aq_desc *desc; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) goto command_write_done; cnt = sscanf(&cmd_buf[11], @@ -1276,7 +1276,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, u8 *buff; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) goto command_write_done; cnt = sscanf(&cmd_buf[20], diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 3ddc29db8dc5..4b299142e4b9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -3976,7 +3976,7 @@ static int i40e_add_flex_offset(struct list_head *flex_pit_list, { struct i40e_flex_pit *new_pit, *entry; - new_pit = kzalloc_obj(*entry, GFP_KERNEL); + new_pit = kzalloc_obj(*entry); if (!new_pit) return -ENOMEM; @@ -4867,7 +4867,7 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, q_index = ring; } - input = kzalloc_obj(*input, GFP_KERNEL); + input = kzalloc_obj(*input); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 05dc5ddc918c..7b9e147d7365 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -6686,7 +6686,7 @@ static int i40e_configure_queue_channels(struct i40e_vsi *vsi) vsi->tc_seid_map[0] = vsi->seid; for (i = 1; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (vsi->tc_config.enabled_tc & BIT(i)) { - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) { ret = -ENOMEM; goto err_free; @@ -7962,7 +7962,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, /* Create channels for macvlans */ INIT_LIST_HEAD(&vsi->macvlan_list); for (i = 0; i < macvlan_cnt; i++) { - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) { ret = -ENOMEM; goto err_free; @@ -8074,7 +8074,7 @@ static void *i40e_fwd_add(struct net_device *netdev, struct net_device *vdev) return ERR_PTR(-EBUSY); /* create the fwd struct */ - fwd = kzalloc_obj(*fwd, GFP_KERNEL); + fwd = kzalloc_obj(*fwd); if (!fwd) return ERR_PTR(-ENOMEM); @@ -8835,7 +8835,7 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi, clear_bit(I40E_FLAG_FD_SB_TO_CLOUD_FILTER, vsi->back->flags); } - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; @@ -11540,7 +11540,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type) } pf->next_vsi = ++i; - vsi = kzalloc_obj(*vsi, GFP_KERNEL); + vsi = kzalloc_obj(*vsi); if (!vsi) { ret = -ENOMEM; goto unlock_pf; @@ -11711,7 +11711,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi) /* Set basic values in the rings to be used later during open() */ for (i = 0; i < vsi->alloc_queue_pairs; i++) { /* allocate space for both Tx and Rx in one shot */ - ring = kzalloc_objs(struct i40e_ring, qpv, GFP_KERNEL); + ring = kzalloc_objs(struct i40e_ring, qpv); if (!ring) goto err_out; @@ -11914,7 +11914,7 @@ static int i40e_init_msix(struct i40e_pf *pf) "Calculation of remaining vectors underflowed. This is an accounting bug when determining total MSI-X vectors.\n"); v_budget += pf->num_lan_msix; - pf->msix_entries = kzalloc_objs(struct msix_entry, v_budget, GFP_KERNEL); + pf->msix_entries = kzalloc_objs(struct msix_entry, v_budget); if (!pf->msix_entries) return -ENOMEM; @@ -12027,7 +12027,7 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx) struct i40e_q_vector *q_vector; /* allocate q_vector */ - q_vector = kzalloc_obj(struct i40e_q_vector, GFP_KERNEL); + q_vector = kzalloc_obj(struct i40e_q_vector); if (!q_vector) return -ENOMEM; @@ -14580,7 +14580,7 @@ static int i40e_veb_mem_alloc(struct i40e_pf *pf) goto err_alloc_veb; /* out of VEB slots! */ } - veb = kzalloc_obj(*veb, GFP_KERNEL); + veb = kzalloc_obj(*veb); if (!veb) { ret = -ENOMEM; goto err_alloc_veb; @@ -15440,7 +15440,7 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw) pf->num_alloc_vsi = pf->hw.func_caps.num_vsis; /* Set up the vsi struct and our local tracking of the MAIN PF vsi. */ - pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi, GFP_KERNEL); + pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi); if (!pf->vsi) { err = -ENOMEM; goto err_switch_setup; @@ -15863,7 +15863,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Set up the *vsi struct and our local tracking of the MAIN PF vsi. */ - pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi, GFP_KERNEL); + pf->vsi = kzalloc_objs(struct i40e_vsi *, pf->num_alloc_vsi); if (!pf->vsi) { err = -ENOMEM; goto err_switch_setup; diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c index 416b42743439..e3517490510f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c @@ -1132,7 +1132,7 @@ int i40e_ptp_alloc_pins(struct i40e_pf *pf) return 0; pf->ptp_pins = - kzalloc_obj(struct i40e_ptp_pins_settings, GFP_KERNEL); + kzalloc_obj(struct i40e_ptp_pins_settings); if (!pf->ptp_pins) { dev_warn(&pf->pdev->dev, "Cannot allocate memory for PTP pins structure.\n"); diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index f89927bfa9d1..34db7d8866b0 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -1572,7 +1572,7 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring) rx_ring->xdp_prog = rx_ring->vsi->xdp_prog; rx_ring->rx_bi = - kzalloc_objs(*rx_ring->rx_bi, rx_ring->count, GFP_KERNEL); + kzalloc_objs(*rx_ring->rx_bi, rx_ring->count); if (!rx_ring->rx_bi) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index fb4560cc42f4..fdf40f8fb239 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -1844,7 +1844,7 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) } } /* allocate memory */ - vfs = kzalloc_objs(struct i40e_vf, num_alloc_vfs, GFP_KERNEL); + vfs = kzalloc_objs(struct i40e_vf, num_alloc_vfs); if (!vfs) { ret = -ENOMEM; goto err_alloc; @@ -3956,7 +3956,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) goto err_out; } - cfilter = kzalloc_obj(*cfilter, GFP_KERNEL); + cfilter = kzalloc_obj(*cfilter); if (!cfilter) { aq_ret = -ENOMEM; goto err_out; diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index e0163e2e022b..f3a1b2fb9bf8 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1276,7 +1276,7 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx } spin_unlock_bh(&adapter->fdir_fltr_lock); - fltr = kzalloc_obj(*fltr, GFP_KERNEL); + fltr = kzalloc_obj(*fltr); if (!fltr) return -ENOMEM; @@ -1519,7 +1519,7 @@ iavf_set_rxfh_fields(struct net_device *netdev, if (hash_flds == IAVF_ADV_RSS_HASH_INVALID) return -EINVAL; - rss_new = kzalloc_obj(*rss_new, GFP_KERNEL); + rss_new = kzalloc_obj(*rss_new); if (!rss_new) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 5ee145d9dd0b..9841c65f3790 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -1812,7 +1812,7 @@ static int iavf_alloc_q_vectors(struct iavf_adapter *adapter) struct iavf_q_vector *q_vector; num_q_vectors = adapter->num_msix_vectors - NONQ_VECS; - adapter->q_vectors = kzalloc_objs(*q_vector, num_q_vectors, GFP_KERNEL); + adapter->q_vectors = kzalloc_objs(*q_vector, num_q_vectors); if (!adapter->q_vectors) return -ENOMEM; @@ -4118,7 +4118,7 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter, return -EINVAL; } - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; filter->cookie = cls_flower->cookie; @@ -4233,7 +4233,7 @@ static int iavf_add_cls_u32(struct iavf_adapter *adapter, return -EOPNOTSUPP; } - fltr = kzalloc_obj(*fltr, GFP_KERNEL); + fltr = kzalloc_obj(*fltr); if (!fltr) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index 38081776ce65..6c72bd15db6d 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -285,7 +285,7 @@ static int ice_devlink_info_get(struct devlink *devlink, return err; } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/devlink/port.c b/drivers/net/ethernet/intel/ice/devlink/port.c index ce830213e73a..0a0bd9019cfb 100644 --- a/drivers/net/ethernet/intel/ice/devlink/port.c +++ b/drivers/net/ethernet/intel/ice/devlink/port.c @@ -921,7 +921,7 @@ ice_alloc_dynamic_port(struct ice_pf *pf, if (err) return err; - dyn_port = kzalloc_obj(*dyn_port, GFP_KERNEL); + dyn_port = kzalloc_obj(*dyn_port); if (!dyn_port) { err = -ENOMEM; goto unroll_reserve_sf_num; diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c index d5b857b07f21..cbb57060bd56 100644 --- a/drivers/net/ethernet/intel/ice/ice_adapter.c +++ b/drivers/net/ethernet/intel/ice/ice_adapter.c @@ -55,7 +55,7 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev) { struct ice_adapter *adapter; - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_arfs.c b/drivers/net/ethernet/intel/ice/ice_arfs.c index fe9b40654df2..7f2bef053703 100644 --- a/drivers/net/ethernet/intel/ice/ice_arfs.c +++ b/drivers/net/ethernet/intel/ice/ice_arfs.c @@ -534,7 +534,7 @@ static int ice_init_arfs_cntrs(struct ice_vsi *vsi) if (!vsi || vsi->type != ICE_VSI_PF) return -EINVAL; - vsi->arfs_fltr_cntrs = kzalloc_obj(*vsi->arfs_fltr_cntrs, GFP_KERNEL); + vsi->arfs_fltr_cntrs = kzalloc_obj(*vsi->arfs_fltr_cntrs); if (!vsi->arfs_fltr_cntrs) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index 35089e80e810..eb77dfa934aa 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -107,7 +107,7 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx) int err; /* allocate q_vector */ - q_vector = kzalloc_obj(*q_vector, GFP_KERNEL); + q_vector = kzalloc_obj(*q_vector); if (!q_vector) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 651cd5476f88..9bb07355bf28 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1067,7 +1067,7 @@ int ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_sched; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) { status = -ENOMEM; goto err_unroll_sched; @@ -3630,7 +3630,7 @@ int ice_update_link_info(struct ice_port_info *pi) if (li->link_info & ICE_AQ_MEDIA_AVAILABLE) { struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -3881,7 +3881,7 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update) *aq_failures = 0; hw = pi->hw; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -4020,7 +4020,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, hw = pi->hw; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -4358,7 +4358,7 @@ int ice_get_phy_lane_number(struct ice_hw *hw) hw->device_id == ICE_DEV_ID_E825C_SGMII) return hw->pf_id; - options = kzalloc_objs(*options, ICE_AQC_PORT_OPT_MAX, GFP_KERNEL); + options = kzalloc_objs(*options, ICE_AQC_PORT_OPT_MAX); if (!options) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index 9d0e71598948..bd77f1c001ee 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -399,7 +399,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked) } /* Notify AUX drivers about impending change to TCs */ - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) { ret = -ENOMEM; goto free_cfg; @@ -575,7 +575,7 @@ void ice_dcb_rebuild(struct ice_pf *pf) dcb_error: dev_err(dev, "Disabling DCB until new settings occur\n"); - err_cfg = kzalloc_obj(*err_cfg, GFP_KERNEL); + err_cfg = kzalloc_obj(*err_cfg); if (!err_cfg) { mutex_unlock(&pf->tc_mutex); return; @@ -641,7 +641,7 @@ int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked) hw = &pf->hw; pi = hw->port_info; - dcbcfg = kzalloc_obj(*dcbcfg, GFP_KERNEL); + dcbcfg = kzalloc_obj(*dcbcfg); if (!dcbcfg) return -ENOMEM; @@ -791,7 +791,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked) privd = cdev->iidc_priv; ice_setup_dcb_qos_info(pf, &privd->qos_info); /* Notify the AUX drivers that TC change is finished */ - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) return; diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index 23bbfcbca490..62f75701d652 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -3276,7 +3276,7 @@ static int ice_dpll_pin_notify(struct notifier_block *nb, unsigned long action, if (pin->fwnode != info->fwnode) return NOTIFY_DONE; /* Not this pin */ - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return NOTIFY_DONE; @@ -4145,7 +4145,7 @@ static int ice_dpll_init_info_e825c(struct ice_pf *pf) d->clock_id = ice_generate_clock_id(pf); d->num_inputs = ICE_SYNCE_CLK_NUM; - d->inputs = kzalloc_objs(*d->inputs, d->num_inputs, GFP_KERNEL); + d->inputs = kzalloc_objs(*d->inputs, d->num_inputs); if (!d->inputs) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c index e043e8ddbc9d..1d8a6b95ccda 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c @@ -129,7 +129,7 @@ ice_eswitch_br_fwd_rule_create(struct ice_hw *hw, int vsi_idx, int port_type, lkups_cnt = ice_eswitch_br_get_lkups_cnt(vid); - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return ERR_PTR(-ENOMEM); @@ -190,7 +190,7 @@ ice_eswitch_br_guard_rule_create(struct ice_hw *hw, u16 vsi_idx, lkups_cnt = ice_eswitch_br_get_lkups_cnt(vid); - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) goto err_exit; @@ -233,7 +233,7 @@ ice_eswitch_br_flow_create(struct device *dev, struct ice_hw *hw, int vsi_idx, struct ice_esw_br_flow *flow; int err; - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (!flow) return ERR_PTR(-ENOMEM); @@ -418,7 +418,7 @@ ice_eswitch_br_fdb_entry_create(struct net_device *netdev, if (fdb_entry) ice_eswitch_br_fdb_entry_notify_and_cleanup(bridge, fdb_entry); - fdb_entry = kzalloc_obj(*fdb_entry, GFP_KERNEL); + fdb_entry = kzalloc_obj(*fdb_entry); if (!fdb_entry) { err = -ENOMEM; goto err_exit; @@ -698,7 +698,7 @@ ice_eswitch_br_vlan_create(u16 vid, u16 flags, struct ice_esw_br_port *port) struct ice_esw_br_vlan *vlan; int err; - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return ERR_PTR(-ENOMEM); @@ -916,7 +916,7 @@ ice_eswitch_br_port_init(struct ice_esw_br *bridge) { struct ice_esw_br_port *br_port; - br_port = kzalloc_obj(*br_port, GFP_KERNEL); + br_port = kzalloc_obj(*br_port); if (!br_port) return ERR_PTR(-ENOMEM); @@ -1013,7 +1013,7 @@ ice_eswitch_br_init(struct ice_esw_br_offloads *br_offloads, int ifindex) struct ice_esw_br *bridge; int err; - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return ERR_PTR(-ENOMEM); @@ -1217,7 +1217,7 @@ ice_eswitch_br_offloads_alloc(struct ice_pf *pf) if (pf->eswitch.br_offloads) return ERR_PTR(-EEXIST); - br_offloads = kzalloc_obj(*br_offloads, GFP_KERNEL); + br_offloads = kzalloc_obj(*br_offloads); if (!br_offloads) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index 4cce51840369..0ea64b330614 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -1652,7 +1652,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) break; } - caps = kzalloc_obj(*caps, GFP_KERNEL); + caps = kzalloc_obj(*caps); if (!caps) return -ENOMEM; @@ -2364,7 +2364,7 @@ ice_get_link_ksettings(struct net_device *netdev, /* flow control is symmetric and always supported */ ethtool_link_ksettings_add_link_mode(ks, supported, Pause); - caps = kzalloc_obj(*caps, GFP_KERNEL); + caps = kzalloc_obj(*caps); if (!caps) return -ENOMEM; @@ -2629,7 +2629,7 @@ ice_set_link_ksettings(struct net_device *netdev, pi->phy.link_info.link_info & ICE_AQ_LINK_UP) return -EOPNOTSUPP; - phy_caps = kzalloc_obj(*phy_caps, GFP_KERNEL); + phy_caps = kzalloc_obj(*phy_caps); if (!phy_caps) return -ENOMEM; @@ -3265,7 +3265,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, netdev_info(netdev, "Changing Tx descriptor count from %d to %d\n", vsi->tx_rings[0]->count, new_tx_cnt); - tx_rings = kzalloc_objs(*tx_rings, vsi->num_txq, GFP_KERNEL); + tx_rings = kzalloc_objs(*tx_rings, vsi->num_txq); if (!tx_rings) { err = -ENOMEM; goto done; @@ -3295,7 +3295,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, netdev_info(netdev, "Changing XDP descriptor count from %d to %d\n", vsi->xdp_rings[0]->count, new_tx_cnt); - xdp_rings = kzalloc_objs(*xdp_rings, vsi->num_xdp_txq, GFP_KERNEL); + xdp_rings = kzalloc_objs(*xdp_rings, vsi->num_xdp_txq); if (!xdp_rings) { err = -ENOMEM; goto free_tx; @@ -3325,7 +3325,7 @@ process_rx: netdev_info(netdev, "Changing Rx descriptor count from %d to %d\n", vsi->rx_rings[0]->count, new_rx_cnt); - rx_rings = kzalloc_objs(*rx_rings, vsi->num_rxq, GFP_KERNEL); + rx_rings = kzalloc_objs(*rx_rings, vsi->num_rxq); if (!rx_rings) { err = -ENOMEM; goto done; @@ -3445,7 +3445,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return; @@ -3511,7 +3511,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) * so compare pause->autoneg with SW configured to prevent the user from * using set pause param to chance autoneg. */ - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c index 28516878fa53..bb1d12f952cf 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c @@ -3734,7 +3734,7 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, int status = 0; u16 idx; - attr_used = kzalloc_objs(*attr_used, ICE_MAX_PTG_ATTRS, GFP_KERNEL); + attr_used = kzalloc_objs(*attr_used, ICE_MAX_PTG_ATTRS); if (!attr_used) return -ENOMEM; @@ -4021,7 +4021,7 @@ ice_find_prof_vsig(struct ice_hw *hw, enum ice_block blk, u64 hdl, u16 *vsig) INIT_LIST_HEAD(&lst); - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) return false; diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index 51f718020073..121552c644cd 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -1468,7 +1468,7 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, if (prof_id >= ids->count) return -ENOSPC; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -1661,7 +1661,7 @@ ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, int status; int i, idx; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -2552,7 +2552,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; - segs = kzalloc_objs(*segs, segs_cnt, GFP_KERNEL); + segs = kzalloc_objs(*segs, segs_cnt); if (!segs) return -ENOMEM; @@ -2699,7 +2699,7 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; - segs = kzalloc_objs(*segs, segs_cnt, GFP_KERNEL); + segs = kzalloc_objs(*segs, segs_cnt); if (!segs) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_fw_update.c b/drivers/net/ethernet/intel/ice/ice_fw_update.c index b67fde32577a..c143e546dd8c 100644 --- a/drivers/net/ethernet/intel/ice/ice_fw_update.c +++ b/drivers/net/ethernet/intel/ice/ice_fw_update.c @@ -862,7 +862,7 @@ int ice_get_pending_updates(struct ice_pf *pf, u8 *pending, struct ice_hw *hw = &pf->hw; int err; - dev_caps = kzalloc_obj(*dev_caps, GFP_KERNEL); + dev_caps = kzalloc_obj(*dev_caps); if (!dev_caps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c index e81d46412043..8fd954f1ebd6 100644 --- a/drivers/net/ethernet/intel/ice/ice_gnss.c +++ b/drivers/net/ethernet/intel/ice/ice_gnss.c @@ -174,7 +174,7 @@ static struct gnss_serial *ice_gnss_struct_init(struct ice_pf *pf) struct kthread_worker *kworker; struct gnss_serial *gnss; - gnss = kzalloc_obj(*gnss, GFP_KERNEL); + gnss = kzalloc_obj(*gnss); if (!gnss) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c index 5487edc36260..3572b0e1d49f 100644 --- a/drivers/net/ethernet/intel/ice/ice_idc.c +++ b/drivers/net/ethernet/intel/ice/ice_idc.c @@ -308,7 +308,7 @@ int ice_plug_aux_dev(struct ice_pf *pf) if (!cdev) return -ENODEV; - iadev = kzalloc_obj(*iadev, GFP_KERNEL); + iadev = kzalloc_obj(*iadev); if (!iadev) return -ENOMEM; @@ -376,13 +376,13 @@ int ice_init_rdma(struct ice_pf *pf) return 0; } - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return -ENOMEM; pf->cdev_info = cdev; - privd = kzalloc_obj(*privd, GFP_KERNEL); + privd = kzalloc_obj(*privd); if (!privd) { ret = -ENOMEM; goto err_privd_alloc; diff --git a/drivers/net/ethernet/intel/ice/ice_irq.c b/drivers/net/ethernet/intel/ice/ice_irq.c index 3864fdcdeae0..cd59579568b7 100644 --- a/drivers/net/ethernet/intel/ice/ice_irq.c +++ b/drivers/net/ethernet/intel/ice/ice_irq.c @@ -81,7 +81,7 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf, unsigned int index; int ret; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index af285bba3b1a..310e8fe2925c 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -2310,7 +2310,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event, return NOTIFY_DONE; /* This memory will be freed at the end of ice_lag_process_event */ - lag_work = kzalloc_obj(*lag_work, GFP_KERNEL); + lag_work = kzalloc_obj(*lag_work); if (!lag_work) return -ENOMEM; @@ -2577,7 +2577,7 @@ int ice_init_lag(struct ice_pf *pf) if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) return 0; - pf->lag = kzalloc_obj(*lag, GFP_KERNEL); + pf->lag = kzalloc_obj(*lag); if (!pf->lag) return -ENOMEM; lag = pf->lag; diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index c5695b2e2319..bd0134b6e920 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -290,7 +290,7 @@ static void ice_vsi_delete_from_hw(struct ice_vsi *vsi) int status; ice_fltr_remove_all(vsi); - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return; @@ -396,7 +396,7 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi) ring_stats = tx_ring_stats[i]; if (!ring_stats) { - ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats); if (!ring_stats) goto err_out; @@ -417,7 +417,7 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi) ring_stats = rx_ring_stats[i]; if (!ring_stats) { - ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats); if (!ring_stats) goto err_out; @@ -533,7 +533,7 @@ static int ice_vsi_alloc_stat_arrays(struct ice_vsi *vsi) /* realloc will happen in rebuild path */ return 0; - vsi_stat = kzalloc_obj(*vsi_stat, GFP_KERNEL); + vsi_stat = kzalloc_obj(*vsi_stat); if (!vsi_stat) return -ENOMEM; @@ -1239,7 +1239,7 @@ static int ice_vsi_init(struct ice_vsi *vsi, u32 vsi_flags) int ret = 0; dev = ice_pf_to_dev(pf); - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -1403,7 +1403,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) struct ice_tx_ring *ring; /* allocate with kzalloc(), free with kfree_rcu() */ - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) goto err_out; @@ -1427,7 +1427,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) struct ice_rx_ring *ring; /* allocate with kzalloc(), free with kfree_rcu() */ - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) goto err_out; @@ -3387,7 +3387,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc) vsi->tc_cfg.ena_tc = ena_tc; vsi->tc_cfg.numtc = num_tc; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 45036a066012..ebf48feffb30 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -875,7 +875,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup) an = "False"; /* Get FEC mode requested based on PHY caps last SW configuration */ - caps = kzalloc_obj(*caps, GFP_KERNEL); + caps = kzalloc_obj(*caps); if (!caps) { fec_req = "Unknown"; an_advertised = "Unknown"; @@ -1951,7 +1951,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up) pi = vsi->port_info; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -2010,7 +2010,7 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi) struct ice_pf *pf = pi->hw->back; int err; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -2122,7 +2122,7 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi) if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE)) return -EIO; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -2202,7 +2202,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) if (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags)) return ice_force_phys_link_state(vsi, true); - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; @@ -2236,7 +2236,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) goto done; } - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) { err = -ENOMEM; goto done; @@ -2385,7 +2385,7 @@ static void ice_service_task(struct work_struct *work) if (test_and_clear_bit(ICE_AUX_ERR_PENDING, pf->state)) { struct iidc_rdma_event *event; - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (event) { set_bit(IIDC_RDMA_EVENT_CRIT_ERR, event->type); /* report the entire OICR value to AUX driver */ @@ -2408,7 +2408,7 @@ static void ice_service_task(struct work_struct *work) if (test_and_clear_bit(ICE_FLAG_MTU_CHANGED, pf->flags)) { struct iidc_rdma_event *event; - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (event) { set_bit(IIDC_RDMA_EVENT_AFTER_MTU_CHANGE, event->type); ice_send_event_to_aux(pf, event); @@ -2609,11 +2609,11 @@ static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi) struct ice_ring_stats *ring_stats; struct ice_tx_ring *xdp_ring; - xdp_ring = kzalloc_obj(*xdp_ring, GFP_KERNEL); + xdp_ring = kzalloc_obj(*xdp_ring); if (!xdp_ring) goto free_xdp_rings; - ring_stats = kzalloc_obj(*ring_stats, GFP_KERNEL); + ring_stats = kzalloc_obj(*ring_stats); if (!ring_stats) { ice_free_tx_ring(xdp_ring); goto free_xdp_rings; @@ -4204,7 +4204,7 @@ static void ice_set_safe_mode_vlan_cfg(struct ice_pf *pf) if (!vsi) return; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return; @@ -4910,7 +4910,7 @@ static int ice_init_pf_sw(struct ice_pf *pf) int err; /* create switch struct for the switch element created by FW on boot */ - pf->first_sw = kzalloc_obj(*pf->first_sw, GFP_KERNEL); + pf->first_sw = kzalloc_obj(*pf->first_sw); if (!pf->first_sw) return -ENOMEM; @@ -8096,7 +8096,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc) hfunc != ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ) return -EOPNOTSUPP; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -8168,7 +8168,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode) vsi_props = &vsi->info; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -9142,7 +9142,7 @@ static int ice_create_q_channels(struct ice_vsi *vsi) if (!(vsi->all_enatc & BIT(i))) continue; - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) { ret = -ENOMEM; goto err_free; @@ -9573,7 +9573,7 @@ ice_indr_setup_tc_block(struct net_device *netdev, struct Qdisc *sch, if (indr_priv) return -EEXIST; - indr_priv = kzalloc_obj(*indr_priv, GFP_KERNEL); + indr_priv = kzalloc_obj(*indr_priv); if (!indr_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c index 4dd3f666daa8..f8e69630fb72 100644 --- a/drivers/net/ethernet/intel/ice/ice_parser.c +++ b/drivers/net/ethernet/intel/ice/ice_parser.c @@ -1895,7 +1895,7 @@ static struct ice_xlt_kb *ice_xlt_kb_get(struct ice_hw *hw, u32 sect_type) if (!seg) return ERR_PTR(-EINVAL); - kb = kzalloc_obj(*kb, GFP_KERNEL); + kb = kzalloc_obj(*kb); if (!kb) return ERR_PTR(-ENOMEM); @@ -2000,7 +2000,7 @@ struct ice_parser *ice_parser_create(struct ice_hw *hw) struct ice_parser *p; void *err; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index db2213e0e1b5..094e96219f45 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -706,7 +706,7 @@ ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx) unsigned long *in_use, *stale; struct ice_tx_tstamp *tstamps; - tstamps = kzalloc_objs(*tstamps, tx->len, GFP_KERNEL); + tstamps = kzalloc_objs(*tstamps, tx->len); in_use = bitmap_zalloc(tx->len, GFP_KERNEL); stale = bitmap_zalloc(tx->len, GFP_KERNEL); diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index 7bdcc0e5986b..90f99443a922 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -369,7 +369,7 @@ static struct ice_repr *ice_repr_create(struct ice_vsi *src_vsi) struct ice_repr *repr; int err; - repr = kzalloc_obj(*repr, GFP_KERNEL); + repr = kzalloc_obj(*repr); if (!repr) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.c b/drivers/net/ethernet/intel/ice/ice_sf_eth.c index 93e62050e00a..2cf04bc6edce 100644 --- a/drivers/net/ethernet/intel/ice/ice_sf_eth.c +++ b/drivers/net/ethernet/intel/ice/ice_sf_eth.c @@ -273,7 +273,7 @@ ice_sf_eth_activate(struct ice_dynamic_port *dyn_port, return err; } - sf_dev = kzalloc_obj(*sf_dev, GFP_KERNEL); + sf_dev = kzalloc_obj(*sf_dev); if (!sf_dev) { err = -ENOMEM; NL_SET_ERR_MSG_MOD(extack, "Could not allocate SF memory"); diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index 7c15d62bb14b..7e00e091756d 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -695,7 +695,7 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs) pci_read_config_word(pdev, pos + PCI_SRIOV_VF_DID, &vf_pdev_id); for (u16 vf_id = 0; vf_id < num_vfs; vf_id++) { - vf = kzalloc_obj(*vf, GFP_KERNEL); + vf = kzalloc_obj(*vf); if (!vf) { err = -ENOMEM; goto err_free_entries; diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 515e96c44bfa..bb0f990fa2c6 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -1847,7 +1847,7 @@ ice_cfg_rdma_fltr(struct ice_hw *hw, u16 vsi_handle, bool enable) if (!cached_ctx) return -ENOENT; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -2069,7 +2069,7 @@ ice_update_recipe_lkup_idx(struct ice_hw *hw, u16 num_recps = ICE_MAX_NUM_RECIPES; int status; - rcp_list = kzalloc_objs(*rcp_list, num_recps, GFP_KERNEL); + rcp_list = kzalloc_objs(*rcp_list, num_recps); if (!rcp_list) return -ENOMEM; @@ -2326,7 +2326,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, bitmap_zero(result_bm, ICE_MAX_FV_WORDS); /* we need a buffer big enough to accommodate all the recipes */ - tmp = kzalloc_objs(*tmp, ICE_MAX_NUM_RECIPES, GFP_KERNEL); + tmp = kzalloc_objs(*tmp, ICE_MAX_NUM_RECIPES); if (!tmp) return -ENOMEM; @@ -5096,7 +5096,7 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, if (recp_cnt > ICE_MAX_CHAIN_RECIPE_RES) return -E2BIG; - buf = kzalloc_objs(*buf, recp_cnt, GFP_KERNEL); + buf = kzalloc_objs(*buf, recp_cnt); if (!buf) return -ENOMEM; @@ -5324,7 +5324,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, if (!lkups_cnt) return -EINVAL; - lkup_exts = kzalloc_obj(*lkup_exts, GFP_KERNEL); + lkup_exts = kzalloc_obj(*lkup_exts); if (!lkup_exts) return -ENOMEM; @@ -5346,7 +5346,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, } } - rm = kzalloc_obj(*rm, GFP_KERNEL); + rm = kzalloc_obj(*rm); if (!rm) { status = -ENOMEM; goto err_free_lkup_exts; @@ -5530,7 +5530,7 @@ ice_dummy_packet_add_vlan(const struct ice_dummy_pkt_profile *dummy_pkt, memcpy(pkt + etype_off + off, dummy_pkt->pkt + etype_off, dummy_pkt->pkt_len - etype_off); - profile = kzalloc_obj(*profile, GFP_KERNEL); + profile = kzalloc_obj(*profile); if (!profile) { kfree(offsets); kfree(pkt); diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c index c687da8d950d..d20357c04127 100644 --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c @@ -2191,7 +2191,7 @@ ice_add_tc_fltr(struct net_device *netdev, struct ice_vsi *vsi, /* by default, set output to be INVALID */ *__fltr = NULL; - fltr = kzalloc_obj(*fltr, GFP_KERNEL); + fltr = kzalloc_obj(*fltr); if (!fltr) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 642b761c38a2..a5bbce68f76c 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -397,7 +397,7 @@ static int ice_alloc_tstamp_ring(struct ice_tx_ring *tx_ring) struct ice_tstamp_ring *tstamp_ring; /* allocate with kzalloc(), free with kfree_rcu() */ - tstamp_ring = kzalloc_obj(*tstamp_ring, GFP_KERNEL); + tstamp_ring = kzalloc_obj(*tstamp_ring); if (!tstamp_ring) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index dba56e317b77..c8bc952f05cd 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -1112,7 +1112,7 @@ static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable) struct ice_vsi_ctx *ctx; int err; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c index 79f18e693e04..54984966851d 100644 --- a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c @@ -94,7 +94,7 @@ static int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -141,7 +141,7 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena) if (vsi->info.port_based_inner_vlan) return 0; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -239,7 +239,7 @@ static int __ice_vsi_set_inner_port_vlan(struct ice_vsi *vsi, u16 pvid_info) struct ice_vsi_ctx *ctxt; int ret; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -292,7 +292,7 @@ int ice_vsi_clear_inner_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int ret; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -336,7 +336,7 @@ static int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena) return 0; pf = vsi->back; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -382,7 +382,7 @@ static int ice_cfg_vlan_antispoof(struct ice_vsi *vsi, bool enable) struct ice_vsi_ctx *ctx; int err; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -478,7 +478,7 @@ int ice_vsi_ena_outer_stripping(struct ice_vsi *vsi, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -529,7 +529,7 @@ int ice_vsi_dis_outer_stripping(struct ice_vsi *vsi) if (vsi->info.port_based_outer_vlan) return 0; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -584,7 +584,7 @@ int ice_vsi_ena_outer_insertion(struct ice_vsi *vsi, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -636,7 +636,7 @@ int ice_vsi_dis_outer_insertion(struct ice_vsi *vsi) if (vsi->info.port_based_outer_vlan) return 0; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -694,7 +694,7 @@ __ice_vsi_set_outer_port_vlan(struct ice_vsi *vsi, u16 vlan_info, u16 tpid) if (tpid_to_vsi_outer_vlan_type(tpid, &tag_type)) return -EINVAL; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -767,7 +767,7 @@ int ice_vsi_clear_outer_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; @@ -794,7 +794,7 @@ int ice_vsi_clear_port_vlan(struct ice_vsi *vsi) struct ice_vsi_ctx *ctxt; int err; - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/virt/fdir.c b/drivers/net/ethernet/intel/ice/virt/fdir.c index 8b2c882fb39c..4f1f3442e52c 100644 --- a/drivers/net/ethernet/intel/ice/virt/fdir.c +++ b/drivers/net/ethernet/intel/ice/virt/fdir.c @@ -875,7 +875,7 @@ ice_vc_fdir_parse_raw(struct ice_vf *vf, if (hw->debug_mask & ICE_DBG_PARSER) ice_parser_result_dump(hw, &rslt); - conf->prof = kzalloc_obj(*conf->prof, GFP_KERNEL); + conf->prof = kzalloc_obj(*conf->prof); if (!conf->prof) { status = -ENOMEM; goto err_parser_destroy; @@ -2128,7 +2128,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) goto err_exit; } - stat = kzalloc_obj(*stat, GFP_KERNEL); + stat = kzalloc_obj(*stat); if (!stat) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; dev_dbg(dev, "Alloc stat for VF %d failed\n", vf->vf_id); @@ -2332,7 +2332,7 @@ int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg) goto err_exit; } - stat = kzalloc_obj(*stat, GFP_KERNEL); + stat = kzalloc_obj(*stat); if (!stat) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; dev_dbg(dev, "Alloc stat for VF %d failed\n", vf->vf_id); diff --git a/drivers/net/ethernet/intel/ice/virt/rss.c b/drivers/net/ethernet/intel/ice/virt/rss.c index 2f259b261512..960012ca91b5 100644 --- a/drivers/net/ethernet/intel/ice/virt/rss.c +++ b/drivers/net/ethernet/intel/ice/virt/rss.c @@ -380,7 +380,7 @@ ice_vc_rss_hash_update(struct ice_hw *hw, struct ice_vsi *vsi, u8 hash_type) struct ice_vsi_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ice/virt/virtchnl.c b/drivers/net/ethernet/intel/ice/virt/virtchnl.c index 9abfba8ae6bd..ca8018e3dd42 100644 --- a/drivers/net/ethernet/intel/ice/virt/virtchnl.c +++ b/drivers/net/ethernet/intel/ice/virt/virtchnl.c @@ -1658,7 +1658,7 @@ static int ice_vc_get_offload_vlan_v2_caps(struct ice_vf *vf) goto out; } - caps = kzalloc_obj(*caps, GFP_KERNEL); + caps = kzalloc_obj(*caps); if (!caps) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; goto out; @@ -2477,7 +2477,7 @@ static int ice_vc_get_phc_time(struct ice_vf *vf) v_ret = VIRTCHNL_STATUS_SUCCESS; - phc_time = kzalloc_obj(*phc_time, GFP_KERNEL); + phc_time = kzalloc_obj(*phc_time); if (!phc_time) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; goto err; diff --git a/drivers/net/ethernet/intel/idpf/idpf_controlq.c b/drivers/net/ethernet/intel/idpf/idpf_controlq.c index e3681dedc888..a964828ba46c 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_controlq.c +++ b/drivers/net/ethernet/intel/idpf/idpf_controlq.c @@ -127,7 +127,7 @@ int idpf_ctlq_add(struct idpf_hw *hw, bool is_rxq = false; int err; - cq = kzalloc_obj(*cq, GFP_KERNEL); + cq = kzalloc_obj(*cq); if (!cq) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_dev.c b/drivers/net/ethernet/intel/idpf/idpf_dev.c index c7c38e22c975..1a0c71c95ef1 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_dev.c +++ b/drivers/net/ethernet/intel/idpf/idpf_dev.c @@ -83,7 +83,7 @@ static int idpf_intr_reg_init(struct idpf_vport *vport, u16 total_vecs; total_vecs = idpf_get_reserved_vecs(vport->adapter); - reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs, GFP_KERNEL); + reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs); if (!reg_vals) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c index 8cfb09ff8ebd..cd211c559a59 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c +++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c @@ -204,7 +204,7 @@ static int idpf_add_flow_steer(struct net_device *netdev, if (!rule) return -ENOMEM; - fltr = kzalloc_obj(*fltr, GFP_KERNEL); + fltr = kzalloc_obj(*fltr); if (!fltr) { err = -ENOMEM; goto out_free_rule; diff --git a/drivers/net/ethernet/intel/idpf/idpf_idc.c b/drivers/net/ethernet/intel/idpf/idpf_idc.c index 42fb8659142a..bb2367ab3279 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_idc.c +++ b/drivers/net/ethernet/intel/idpf/idpf_idc.c @@ -60,7 +60,7 @@ static int idpf_plug_vport_aux_dev(struct iidc_rdma_core_dev_info *cdev_info, struct auxiliary_device *adev; int ret; - iadev = kzalloc_obj(*iadev, GFP_KERNEL); + iadev = kzalloc_obj(*iadev); if (!iadev) return -ENOMEM; @@ -120,7 +120,7 @@ static int idpf_idc_init_aux_vport_dev(struct idpf_vport *vport) if (!(le16_to_cpu(vport_msg->vport_flags) & VIRTCHNL2_VPORT_ENABLE_RDMA)) return 0; - vport->vdev_info = kzalloc_obj(*vdev_info, GFP_KERNEL); + vport->vdev_info = kzalloc_obj(*vdev_info); if (!vport->vdev_info) return -ENOMEM; @@ -198,7 +198,7 @@ static int idpf_plug_core_aux_dev(struct iidc_rdma_core_dev_info *cdev_info) struct auxiliary_device *adev; int ret; - iadev = kzalloc_obj(*iadev, GFP_KERNEL); + iadev = kzalloc_obj(*iadev); if (!iadev) return -ENOMEM; @@ -414,12 +414,12 @@ int idpf_idc_init_aux_core_dev(struct idpf_adapter *adapter, struct iidc_rdma_priv_dev_info *privd; int err, i; - adapter->cdev_info = kzalloc_obj(*cdev_info, GFP_KERNEL); + adapter->cdev_info = kzalloc_obj(*cdev_info); if (!adapter->cdev_info) return -ENOMEM; cdev_info = adapter->cdev_info; - privd = kzalloc_obj(*privd, GFP_KERNEL); + privd = kzalloc_obj(*privd); if (!privd) { err = -ENOMEM; goto err_privd_alloc; diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c index a70f8ba7aad2..e17de31bb3bf 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -1239,7 +1239,7 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter, if (idx == IDPF_NO_FREE_SLOT) return NULL; - vport = kzalloc_obj(*vport, GFP_KERNEL); + vport = kzalloc_obj(*vport); if (!vport) return vport; @@ -1248,14 +1248,14 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter, struct idpf_vport_config *vport_config; struct idpf_q_coalesce *q_coal; - vport_config = kzalloc_obj(*vport_config, GFP_KERNEL); + vport_config = kzalloc_obj(*vport_config); if (!vport_config) { kfree(vport); return NULL; } - q_coal = kzalloc_objs(*q_coal, num_max_q, GFP_KERNEL); + q_coal = kzalloc_objs(*q_coal, num_max_q); if (!q_coal) { kfree(vport_config); kfree(vport); @@ -2027,7 +2027,7 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport, * error occurred, the existing vport will be untouched. * */ - new_vport = kzalloc_obj(*vport, GFP_KERNEL); + new_vport = kzalloc_obj(*vport); if (!new_vport) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index be6760249dc8..0dd741dcfcdb 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c @@ -238,7 +238,7 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct idpf_adapter *adapter; int err; - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_ptp.c b/drivers/net/ethernet/intel/idpf/idpf_ptp.c index c098d3f66a34..eec91c4f0a75 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_ptp.c +++ b/drivers/net/ethernet/intel/idpf/idpf_ptp.c @@ -936,7 +936,7 @@ int idpf_ptp_init(struct idpf_adapter *adapter) return -EOPNOTSUPP; } - adapter->ptp = kzalloc_obj(*adapter->ptp, GFP_KERNEL); + adapter->ptp = kzalloc_obj(*adapter->ptp); if (!adapter->ptp) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index 259316af9ec5..3eeac3fa3b89 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -1439,7 +1439,7 @@ static int idpf_vport_init_fast_path_txqs(struct idpf_vport *vport, struct work_struct *tstamp_task = &vport->tstamp_task; int k = 0; - vport->txqs = kzalloc_objs(*vport->txqs, rsrc->num_txq, GFP_KERNEL); + vport->txqs = kzalloc_objs(*vport->txqs, rsrc->num_txq); if (!vport->txqs) return -ENOMEM; @@ -1755,7 +1755,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, idpf_queue_set(FLOW_SCH_EN, q); - q->refillq = kzalloc_obj(*q->refillq, GFP_KERNEL); + q->refillq = kzalloc_obj(*q->refillq); if (!q->refillq) goto err_alloc; @@ -1833,7 +1833,7 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport, for (unsigned int j = 0; j < num_rxq; j++) { rx_qgrp->splitq.rxq_sets[j] = - kzalloc_obj(struct idpf_rxq_set, GFP_KERNEL); + kzalloc_obj(struct idpf_rxq_set); if (!rx_qgrp->splitq.rxq_sets[j]) { err = -ENOMEM; goto err_alloc; diff --git a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c index 57559a2bc9dd..a07d7e808ca9 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c +++ b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c @@ -82,7 +82,7 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport, u16 total_vecs; total_vecs = idpf_get_reserved_vecs(vport->adapter); - reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs, GFP_KERNEL); + reg_vals = kzalloc_objs(struct idpf_vec_regs, total_vecs); if (!reg_vals) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index f1a8ae9d8118..c03810c03f37 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -1059,7 +1059,7 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter) return -EINVAL; hw = &adapter->hw; - hw->lan_regs = kzalloc_objs(*hw->lan_regs, num_regions, GFP_KERNEL); + hw->lan_regs = kzalloc_objs(*hw->lan_regs, num_regions); if (!hw->lan_regs) return -ENOMEM; @@ -1091,7 +1091,7 @@ static int idpf_calc_remaining_mmio_regs(struct idpf_adapter *adapter) struct idpf_hw *hw = &adapter->hw; hw->num_lan_regs = IDPF_MMIO_MAP_FALLBACK_MAX_REMAINING; - hw->lan_regs = kzalloc_objs(*hw->lan_regs, hw->num_lan_regs, GFP_KERNEL); + hw->lan_regs = kzalloc_objs(*hw->lan_regs, hw->num_lan_regs); if (!hw->lan_regs) return -ENOMEM; @@ -1844,7 +1844,7 @@ static int idpf_send_config_tx_queue_set_msg(const struct idpf_queue_set *qs) .chunk_sz = sizeof(*qi), }; - qi = kzalloc_objs(*qi, qs->num, GFP_KERNEL); + qi = kzalloc_objs(*qi, qs->num); if (!qi) return -ENOMEM; @@ -2033,7 +2033,7 @@ static int idpf_send_config_rx_queue_set_msg(const struct idpf_queue_set *qs) .chunk_sz = sizeof(*qi), }; - qi = kzalloc_objs(*qi, qs->num, GFP_KERNEL); + qi = kzalloc_objs(*qi, qs->num); if (!qi) return -ENOMEM; @@ -2160,7 +2160,7 @@ static int idpf_send_ena_dis_queue_set_msg(const struct idpf_queue_set *qs, .num_chunks = qs->num, }; - qc = kzalloc_objs(*qc, qs->num, GFP_KERNEL); + qc = kzalloc_objs(*qc, qs->num); if (!qc) return -ENOMEM; @@ -2327,7 +2327,7 @@ idpf_send_map_unmap_queue_set_vector_msg(const struct idpf_queue_set *qs, }; bool split; - vqv = kzalloc_objs(*vqv, qs->num, GFP_KERNEL); + vqv = kzalloc_objs(*vqv, qs->num); if (!vqv) return -ENOMEM; @@ -3202,11 +3202,11 @@ static int idpf_send_get_rx_ptype_msg(struct idpf_adapter *adapter) if (!singleq_pt_lkup) return -ENOMEM; - splitq_pt_lkup = kzalloc_objs(*splitq_pt_lkup, max_ptype, GFP_KERNEL); + splitq_pt_lkup = kzalloc_objs(*splitq_pt_lkup, max_ptype); if (!splitq_pt_lkup) return -ENOMEM; - get_ptype_info = kzalloc_obj(*get_ptype_info, GFP_KERNEL); + get_ptype_info = kzalloc_obj(*get_ptype_info); if (!get_ptype_info) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c index 2980164ba9fb..1c4ce3ac6bbf 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c @@ -395,7 +395,7 @@ int idpf_ptp_get_vport_tstamps_caps(struct idpf_vport *vport) for (u16 i = 0; i < tstamp_caps->num_entries; i++) { __le32 offset_l, offset_h; - ptp_tx_tstamp = kzalloc_obj(*ptp_tx_tstamp, GFP_KERNEL); + ptp_tx_tstamp = kzalloc_obj(*ptp_tx_tstamp); if (!ptp_tx_tstamp) { err = -ENOMEM; goto err_free_ptp_tx_stamp_list; diff --git a/drivers/net/ethernet/intel/idpf/xdp.c b/drivers/net/ethernet/intel/idpf/xdp.c index a94bde86f84f..6ac9c6624c2a 100644 --- a/drivers/net/ethernet/intel/idpf/xdp.c +++ b/drivers/net/ethernet/intel/idpf/xdp.c @@ -154,7 +154,7 @@ int idpf_xdpsqs_get(const struct idpf_vport *vport) if (!idpf_xdp_enabled(vport)) return 0; - timers = kvzalloc_objs(*timers, vport->num_xdp_txq, GFP_KERNEL); + timers = kvzalloc_objs(*timers, vport->num_xdp_txq); if (!timers) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 117d2a0ca620..f7938c1da835 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2919,7 +2919,7 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter, if ((fsp->flow_type & ~FLOW_EXT) != ETHER_FLOW) return -EINVAL; - input = kzalloc_obj(*input, GFP_KERNEL); + input = kzalloc_obj(*input); if (!input) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 5dc97daf6ac1..223a10cae4a9 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2711,7 +2711,7 @@ static int igb_configure_clsflower(struct igb_adapter *adapter, return -EINVAL; } - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 72ea2e6ce15b..5d04541072b3 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -1017,7 +1017,7 @@ static void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter) int i; /* we allocate 3 vectors, 1 for Tx, 1 for Rx, one for PF messages */ - adapter->msix_entries = kzalloc_objs(struct msix_entry, 3, GFP_KERNEL); + adapter->msix_entries = kzalloc_objs(struct msix_entry, 3); if (adapter->msix_entries) { for (i = 0; i < 3; i++) adapter->msix_entries[i].entry = i; @@ -1097,11 +1097,11 @@ static int igbvf_alloc_queues(struct igbvf_adapter *adapter) { struct net_device *netdev = adapter->netdev; - adapter->tx_ring = kzalloc_obj(struct igbvf_ring, GFP_KERNEL); + adapter->tx_ring = kzalloc_obj(struct igbvf_ring); if (!adapter->tx_ring) return -ENOMEM; - adapter->rx_ring = kzalloc_obj(struct igbvf_ring, GFP_KERNEL); + adapter->rx_ring = kzalloc_obj(struct igbvf_ring); if (!adapter->rx_ring) { kfree(adapter->tx_ring); return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 35b74213ca8b..0122009bedd0 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1395,7 +1395,7 @@ static int igc_ethtool_add_nfc_rule(struct igc_adapter *adapter, return -EINVAL; } - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/igc/igc_leds.c b/drivers/net/ethernet/intel/igc/igc_leds.c index d6e011695adc..fdb9692516e8 100644 --- a/drivers/net/ethernet/intel/igc/igc_leds.c +++ b/drivers/net/ethernet/intel/igc/igc_leds.c @@ -268,7 +268,7 @@ int igc_led_setup(struct igc_adapter *adapter) mutex_init(&adapter->led_mutex); - leds = kzalloc_objs(*leds, IGC_NUM_LEDS, GFP_KERNEL); + leds = kzalloc_objs(*leds, IGC_NUM_LEDS); if (!leds) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c b/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c index 165a8f12745f..b0404f37271a 100644 --- a/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c @@ -318,7 +318,7 @@ static int ixgbe_devlink_info_get(struct devlink *devlink, struct ixgbe_info_ctx *ctx; int err; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c index f8a4331e8fe3..52f73142ff75 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c @@ -1285,7 +1285,7 @@ int ixgbe_update_link_info(struct ixgbe_hw *hw) if (!(li->link_info & IXGBE_ACI_MEDIA_AVAILABLE)) return 0; - pcaps = kzalloc_obj(*pcaps, GFP_KERNEL); + pcaps = kzalloc_obj(*pcaps); if (!pcaps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c index c44c9bf53cc4..ffceaef8502f 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c @@ -516,7 +516,7 @@ int ixgbe_get_pending_updates(struct ixgbe_adapter *adapter, u8 *pending, struct ixgbe_hw *hw = &adapter->hw; int err; - dev_caps = kzalloc_obj(*dev_caps, GFP_KERNEL); + dev_caps = kzalloc_obj(*dev_caps); if (!dev_caps) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c index 6da3e52cea7a..bd397b3d7dea 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c @@ -1233,7 +1233,7 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter) if (t_dis || r_dis) return; - ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec); if (!ipsec) goto err1; hash_init(ipsec->rx_sa_list); diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 59b3acb62134..e0e6234000bc 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -10272,15 +10272,15 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, (__force u32)cls->knode.sel->offmask) return err; - jump = kzalloc_obj(*jump, GFP_KERNEL); + jump = kzalloc_obj(*jump); if (!jump) return -ENOMEM; - input = kzalloc_obj(*input, GFP_KERNEL); + input = kzalloc_obj(*input); if (!input) { err = -ENOMEM; goto free_jump; } - mask = kzalloc_obj(*mask, GFP_KERNEL); + mask = kzalloc_obj(*mask); if (!mask) { err = -ENOMEM; goto free_input; @@ -10304,10 +10304,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, return 0; } - input = kzalloc_obj(*input, GFP_KERNEL); + input = kzalloc_obj(*input); if (!input) return -ENOMEM; - mask = kzalloc_obj(*mask, GFP_KERNEL); + mask = kzalloc_obj(*mask); if (!mask) { err = -ENOMEM; goto free_input; @@ -10785,7 +10785,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) return ERR_PTR(-ENOMEM); } - accel = kzalloc_obj(*accel, GFP_KERNEL); + accel = kzalloc_obj(*accel); if (!accel) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 40dfdf62ab33..e222627b7855 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -37,7 +37,7 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter, if (!num_vf_macvlans) return; - mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans, GFP_KERNEL); + mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans); if (mv_list) { for (i = 0; i < num_vf_macvlans; i++) { mv_list[i].vf = -1; diff --git a/drivers/net/ethernet/intel/ixgbevf/ipsec.c b/drivers/net/ethernet/intel/ixgbevf/ipsec.c index 780ebcdbd4a7..076fd0a24858 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c +++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c @@ -628,7 +628,7 @@ void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter) return; } - ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec); if (!ipsec) goto err1; hash_init(ipsec->rx_sa_list); diff --git a/drivers/net/ethernet/intel/libie/fwlog.c b/drivers/net/ethernet/intel/libie/fwlog.c index 5b69a26ef2bd..5df25e5fbabd 100644 --- a/drivers/net/ethernet/intel/libie/fwlog.c +++ b/drivers/net/ethernet/intel/libie/fwlog.c @@ -153,7 +153,7 @@ static void libie_fwlog_realloc_rings(struct libie_fwlog *fwlog, int index) * old rings and buffers. that way if we don't have enough * memory then we at least have what we had before */ - ring.rings = kzalloc_objs(*ring.rings, ring_size, GFP_KERNEL); + ring.rings = kzalloc_objs(*ring.rings, ring_size); if (!ring.rings) return; @@ -208,7 +208,7 @@ libie_aq_fwlog_set(struct libie_fwlog *fwlog, int status; int i; - fw_modules = kzalloc_objs(*fw_modules, num_entries, GFP_KERNEL); + fw_modules = kzalloc_objs(*fw_modules, num_entries); if (!fw_modules) return -ENOMEM; @@ -978,7 +978,7 @@ static void libie_fwlog_set_supported(struct libie_fwlog *fwlog) fwlog->supported = false; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return; diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 1bc31e0b443d..f9055b3d6fb1 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -1967,7 +1967,7 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) memset(rxq->rx_desc_area, 0, size); rxq->rx_desc_area_size = size; - rxq->rx_skb = kzalloc_objs(*rxq->rx_skb, rxq->rx_ring_size, GFP_KERNEL); + rxq->rx_skb = kzalloc_objs(*rxq->rx_skb, rxq->rx_ring_size); if (rxq->rx_skb == NULL) goto out_free; diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index c058df3bb85f..9ba4aef7080c 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3554,7 +3554,7 @@ static int mvneta_txq_sw_init(struct mvneta_port *pp, txq->last_desc = txq->size - 1; - txq->buf = kmalloc_objs(*txq->buf, txq->size, GFP_KERNEL); + txq->buf = kmalloc_objs(*txq->buf, txq->size); if (!txq->buf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index 83ba45f54180..80d15d7a5ec3 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1367,7 +1367,7 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port, if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW) return -EINVAL; - efs = kzalloc_obj(*efs, GFP_KERNEL); + efs = kzalloc_obj(*efs); if (!efs) return -ENOMEM; @@ -1503,7 +1503,7 @@ static int mvpp22_rss_context_create(struct mvpp2_port *port, u32 *rss_ctx) if (ctx == MVPP22_N_RSS_TABLES) return -EINVAL; - priv->rss_tables[ctx] = kzalloc_obj(*priv->rss_tables[ctx], GFP_KERNEL); + priv->rss_tables[ctx] = kzalloc_obj(*priv->rss_tables[ctx]); if (!priv->rss_tables[ctx]) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c index 2aef0c77f4d6..7adc9cd54bf6 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c @@ -706,7 +706,7 @@ void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name) mvpp2_dir = debugfs_create_dir(name, mvpp2_root); priv->dbgfs_dir = mvpp2_dir; - priv->dbgfs_entries = kzalloc_obj(*priv->dbgfs_entries, GFP_KERNEL); + priv->dbgfs_entries = kzalloc_obj(*priv->dbgfs_entries); if (!priv->dbgfs_entries) goto err; diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index fd9abcfeb4e0..3dab841f64ff 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -1293,7 +1293,7 @@ int octep_device_setup(struct octep_device *oct) int i, ret; /* allocate memory for oct->conf */ - oct->conf = kzalloc_obj(*oct->conf, GFP_KERNEL); + oct->conf = kzalloc_obj(*oct->conf); if (!oct->conf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c index b794b517c304..4bf13cc76a9f 100644 --- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c @@ -952,7 +952,7 @@ int octep_vf_device_setup(struct octep_vf_device *oct) struct pci_dev *pdev = oct->pdev; /* allocate memory for oct->conf */ - oct->conf = kzalloc_obj(*oct->conf, GFP_KERNEL); + oct->conf = kzalloc_obj(*oct->conf); if (!oct->conf) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index dc4537623578..6000795823a3 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1725,7 +1725,7 @@ static int cgx_lmac_init(struct cgx *cgx) cgx->lmac_count = cgx->max_lmac_per_mac; for (i = 0; i < cgx->lmac_count; i++) { - lmac = kzalloc_obj(struct lmac, GFP_KERNEL); + lmac = kzalloc_obj(struct lmac); if (!lmac) return -ENOMEM; lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL); diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c index ad62be730bbc..d343f1704d07 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c @@ -133,7 +133,7 @@ int cn20k_mbox_setup(struct otx2_mbox *mbox, struct pci_dev *pdev, mbox->reg_base = reg_base; mbox->pdev = pdev; - mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs, GFP_KERNEL); + mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs); if (!mbox->dev) { otx2_mbox_destroy(mbox); return -ENOMEM; @@ -211,7 +211,7 @@ static int otx2_mbox_setup(struct otx2_mbox *mbox, struct pci_dev *pdev, mbox->reg_base = reg_base; mbox->pdev = pdev; - mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs, GFP_KERNEL); + mbox->dev = kzalloc_objs(struct otx2_mbox_dev, ndevs); if (!mbox->dev) { otx2_mbox_destroy(mbox); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c index f38b5addd4d8..58e62e955554 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c @@ -520,7 +520,7 @@ static int ptp_probe(struct pci_dev *pdev, struct ptp *ptp; int err; - ptp = kzalloc_obj(*ptp, GFP_KERNEL); + ptp = kzalloc_obj(*ptp); if (!ptp) { err = -ENOMEM; goto error; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 2e3b3345a362..5b1129558e8b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2516,7 +2516,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, if (!pf_bmap) return -ENOMEM; - ng_rvu_mbox = kzalloc_obj(*ng_rvu_mbox, GFP_KERNEL); + ng_rvu_mbox = kzalloc_obj(*ng_rvu_mbox); if (!ng_rvu_mbox) { err = -ENOMEM; goto free_bitmap; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c index b9980253dcb0..4ff3935ed3fe 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c @@ -184,7 +184,7 @@ static int rvu_cgx_send_link_info(int cgx_id, int lmac_id, struct rvu *rvu) unsigned long flags; int err; - qentry = kmalloc_obj(*qentry, GFP_KERNEL); + qentry = kmalloc_obj(*qentry); if (!qentry) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c index 71c411d8eb83..fb15c794efc9 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -494,12 +494,12 @@ static int rvu_nix_register_reporters(struct rvu_devlink *rvu_dl) struct rvu_nix_event_ctx *nix_event_context; struct rvu *rvu = rvu_dl->rvu; - rvu_reporters = kzalloc_obj(*rvu_reporters, GFP_KERNEL); + rvu_reporters = kzalloc_obj(*rvu_reporters); if (!rvu_reporters) return -ENOMEM; rvu_dl->rvu_nix_health_reporter = rvu_reporters; - nix_event_context = kzalloc_obj(*nix_event_context, GFP_KERNEL); + nix_event_context = kzalloc_obj(*nix_event_context); if (!nix_event_context) return -ENOMEM; @@ -1048,12 +1048,12 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl) struct rvu_npa_event_ctx *npa_event_context; struct rvu *rvu = rvu_dl->rvu; - rvu_reporters = kzalloc_obj(*rvu_reporters, GFP_KERNEL); + rvu_reporters = kzalloc_obj(*rvu_reporters); if (!rvu_reporters) return -ENOMEM; rvu_dl->rvu_npa_health_reporter = rvu_reporters; - npa_event_context = kzalloc_obj(*npa_event_context, GFP_KERNEL); + npa_event_context = kzalloc_obj(*npa_event_context); if (!npa_event_context) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 0964a85b536f..98dd68137a09 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -2455,7 +2455,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, } /* XOFF all TL2s whose parent TL1 matches SMQ tree TL1 */ - smq_flush_ctx = kzalloc_obj(*smq_flush_ctx, GFP_KERNEL); + smq_flush_ctx = kzalloc_obj(*smq_flush_ctx); if (!smq_flush_ctx) return -ENOMEM; nix_smq_flush_fill_ctx(rvu, blkaddr, smq, smq_flush_ctx); @@ -3373,7 +3373,7 @@ static int nix_add_mce_list_entry(struct rvu *rvu, mce_list = &elem->mcast_mce_list; for (i = 0; i < num_entry; i++) { - mce = kzalloc_obj(*mce, GFP_KERNEL); + mce = kzalloc_obj(*mce); if (!mce) goto free_mce; @@ -3435,7 +3435,7 @@ static int nix_update_mce_list_entry(struct nix_mce_list *mce_list, return 0; /* Add a new one to the list, at the tail */ - mce = kzalloc_obj(*mce, GFP_KERNEL); + mce = kzalloc_obj(*mce); if (!mce) return -ENOMEM; mce->pcifunc = pcifunc; @@ -6420,7 +6420,7 @@ int rvu_mbox_handler_nix_mcast_grp_create(struct rvu *rvu, return err; mcast_grp = &nix_hw->mcast_grp; - elem = kzalloc_obj(*elem, GFP_KERNEL); + elem = kzalloc_obj(*elem); if (!elem) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c index 1b7dd4e771c7..1930b54e72f2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -1297,7 +1297,7 @@ static int npc_install_flow(struct rvu *rvu, int blkaddr, u16 target, find_rule: rule = rvu_mcam_find_rule(mcam, entry_index); if (!rule) { - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; new = true; @@ -1741,7 +1741,7 @@ int npc_install_mcam_drop_rule(struct rvu *rvu, int mcam_idx, u16 *counter_idx, } /* Add this entry to mcam rules list */ - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 7ed5750435c1..906d712cef19 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -796,7 +796,7 @@ static int rvu_npc_exact_add_to_list(struct rvu *rvu, enum npc_exact_opc_type op return -EFAULT; } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { rvu_npc_exact_free_id(rvu, *seq_id); dev_err(rvu->dev, "%s: Memory allocation failed\n", __func__); @@ -1896,7 +1896,7 @@ int rvu_npc_exact_init(struct rvu *rvu) /* Set capability to true */ rvu->hw->cap.npc_exact_match_enabled = true; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c index 5f90f38071da..4649996dc7da 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c @@ -914,7 +914,7 @@ static struct cn10k_mcs_txsc *cn10k_mcs_create_txsc(struct otx2_nic *pfvf) struct cn10k_mcs_txsc *txsc; int ret; - txsc = kzalloc_obj(*txsc, GFP_KERNEL); + txsc = kzalloc_obj(*txsc); if (!txsc) return ERR_PTR(-ENOMEM); @@ -987,7 +987,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf) struct cn10k_mcs_rxsc *rxsc; int ret; - rxsc = kzalloc_obj(*rxsc, GFP_KERNEL); + rxsc = kzalloc_obj(*rxsc); if (!rxsc) return ERR_PTR(-ENOMEM); @@ -1772,7 +1772,7 @@ int cn10k_mcs_init(struct otx2_nic *pfvf) if (!test_bit(CN10K_HW_MACSEC, &pfvf->hw.cap_flag)) return 0; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 768503b255fb..971fcab1c248 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -1005,7 +1005,7 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura) } sq->sqe_base = sq->sqe->base; - sq->sg = kzalloc_objs(struct sg_list, qset->sqe_cnt, GFP_KERNEL); + sq->sg = kzalloc_objs(struct sg_list, qset->sqe_cnt); if (!sq->sg) return -ENOMEM; @@ -1585,7 +1585,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf) sq = &qset->sq[qidx]; sq->sqb_count = 0; - sq->sqb_ptrs = kzalloc_objs(*sq->sqb_ptrs, num_sqbs, GFP_KERNEL); + sq->sqb_ptrs = kzalloc_objs(*sq->sqb_ptrs, num_sqbs); if (!sq->sqb_ptrs) { err = -ENOMEM; goto err_mem; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c index f61730e8d73a..12c001ee34e2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -1063,7 +1063,7 @@ static int otx2_add_flow_with_pfmac(struct otx2_nic *pfvf, struct otx2_flow *pf_mac; struct ethhdr *eth_hdr; - pf_mac = kzalloc_obj(*pf_mac, GFP_KERNEL); + pf_mac = kzalloc_obj(*pf_mac); if (!pf_mac) return -ENOMEM; @@ -1131,7 +1131,7 @@ int otx2_add_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc) flow = otx2_find_flow(pfvf, fsp->location); if (!flow) { - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (!flow) return -ENOMEM; flow->location = fsp->location; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 333071ac7598..e8334a347960 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1936,7 +1936,7 @@ int otx2_alloc_queue_mem(struct otx2_nic *pf) pf->qset.cq_cnt = pf->hw.rx_queues + otx2_get_total_tx_queues(pf); - qset->napi = kzalloc_objs(*cq_poll, pf->hw.cint_cnt, GFP_KERNEL); + qset->napi = kzalloc_objs(*cq_poll, pf->hw.cint_cnt); if (!qset->napi) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c index de9b90e498cc..95b0a1e7c936 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c @@ -408,7 +408,7 @@ int otx2_ptp_init(struct otx2_nic *pfvf) } mutex_unlock(&pfvf->mbox.lock); - ptp_ptr = kzalloc_obj(*ptp_ptr, GFP_KERNEL); + ptp_ptr = kzalloc_obj(*ptp_ptr); if (!ptp_ptr) { err = -ENOMEM; goto error; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c index 9b569e0d6222..04fcfbdcf69b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c @@ -1271,7 +1271,7 @@ static int otx2_tc_add_flow(struct otx2_nic *nic, } /* allocate memory for the new flow and it's node */ - new_node = kzalloc_obj(*new_node, GFP_KERNEL); + new_node = kzalloc_obj(*new_node); if (!new_node) return -ENOMEM; spin_lock_init(&new_node->lock); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c index 435c176c2643..69c0911e28e9 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/qos.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/qos.c @@ -407,7 +407,7 @@ otx2_qos_alloc_root(struct otx2_nic *pfvf) { struct otx2_qos_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return ERR_PTR(-ENOMEM); @@ -463,7 +463,7 @@ static int otx2_qos_alloc_txschq_node(struct otx2_nic *pfvf, parent = node; for (lvl = node->level - 1; lvl >= NIX_TXSCH_LVL_MDQ; lvl--) { - txschq_node = kzalloc_obj(*txschq_node, GFP_KERNEL); + txschq_node = kzalloc_obj(*txschq_node); if (!txschq_node) goto err_out; @@ -508,7 +508,7 @@ otx2_qos_sw_create_leaf_node(struct otx2_nic *pfvf, struct otx2_qos_node *node; int err; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return ERR_PTR(-ENOMEM); @@ -1045,7 +1045,7 @@ static int otx2_qos_root_add(struct otx2_nic *pfvf, u16 htb_maj_id, u16 htb_defc } /* allocate txschq queue */ - new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); err = -ENOMEM; @@ -1279,7 +1279,7 @@ static int otx2_qos_leaf_alloc_queue(struct otx2_nic *pfvf, u16 classid, set_bit(prio, parent->prio_bmap); /* read current txschq configuration */ - old_cfg = kzalloc_obj(*old_cfg, GFP_KERNEL); + old_cfg = kzalloc_obj(*old_cfg); if (!old_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1308,7 +1308,7 @@ static int otx2_qos_leaf_alloc_queue(struct otx2_nic *pfvf, u16 classid, } /* push new txschq config to hw */ - new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1417,7 +1417,7 @@ static int otx2_qos_leaf_to_inner(struct otx2_nic *pfvf, u16 classid, qid = node->qid; /* read current txschq configuration */ - old_cfg = kzalloc_obj(*old_cfg, GFP_KERNEL); + old_cfg = kzalloc_obj(*old_cfg); if (!old_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1445,7 +1445,7 @@ static int otx2_qos_leaf_to_inner(struct otx2_nic *pfvf, u16 classid, } /* push new txschq config to hw */ - new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); ret = -ENOMEM; @@ -1668,7 +1668,7 @@ static int otx2_qos_leaf_del_last(struct otx2_nic *pfvf, u16 classid, bool force __set_bit(qid, pfvf->qos.qos_sq_bmap); /* push new txschq config to hw */ - new_cfg = kzalloc_obj(*new_cfg, GFP_KERNEL); + new_cfg = kzalloc_obj(*new_cfg); if (!new_cfg) { NL_SET_ERR_MSG_MOD(extack, "Memory allocation error"); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c index 7706ec417d2b..94f155ffb17f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c @@ -40,7 +40,7 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep) int ent, allocated = 0; int count; - rep->flow_cfg = kzalloc_objs(struct otx2_flow_config, 1, GFP_KERNEL); + rep->flow_cfg = kzalloc_objs(struct otx2_flow_config, 1); if (!rep->flow_cfg) return -ENOMEM; @@ -504,7 +504,7 @@ static int rvu_rep_napi_init(struct otx2_nic *priv, int err = 0, qidx, vec; char *irq_name; - qset->napi = kzalloc_objs(*cq_poll, hw->cint_cnt, GFP_KERNEL); + qset->napi = kzalloc_objs(*cq_poll, hw->cint_cnt); if (!qset->napi) return -ENOMEM; @@ -656,7 +656,7 @@ int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack *extack) if (err) return -ENOMEM; - priv->reps = kzalloc_objs(struct rep_dev *, rep_cnt, GFP_KERNEL); + priv->reps = kzalloc_objs(struct rep_dev *, rep_cnt); if (!priv->reps) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_acl.c b/drivers/net/ethernet/marvell/prestera/prestera_acl.c index 02f113f9af9f..31fe63a0a97d 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_acl.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_acl.c @@ -144,7 +144,7 @@ prestera_acl_ruleset_create(struct prestera_acl *acl, if (!prestera_acl_chain_is_supported(chain_index, block->ingress)) return ERR_PTR(-EINVAL); - ruleset = kzalloc_obj(*ruleset, GFP_KERNEL); + ruleset = kzalloc_obj(*ruleset); if (!ruleset) return ERR_PTR(-ENOMEM); @@ -438,7 +438,7 @@ prestera_acl_rule_create(struct prestera_acl_ruleset *ruleset, { struct prestera_acl_rule *rule; - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return ERR_PTR(-ENOMEM); @@ -713,7 +713,7 @@ prestera_acl_rule_entry_create(struct prestera_acl *acl, struct prestera_acl_rule_entry *e; int err; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) goto err_kzalloc; @@ -816,7 +816,7 @@ int prestera_acl_vtcam_id_get(struct prestera_acl *acl, u8 lookup, u8 dir, } /* vtcam not found, try to create new one */ - vtcam = kzalloc_obj(*vtcam, GFP_KERNEL); + vtcam = kzalloc_obj(*vtcam); if (!vtcam) return -ENOMEM; @@ -880,7 +880,7 @@ int prestera_acl_init(struct prestera_switch *sw) struct prestera_acl *acl; int err; - acl = kzalloc_obj(*acl, GFP_KERNEL); + acl = kzalloc_obj(*acl); if (!acl) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_counter.c b/drivers/net/ethernet/marvell/prestera/prestera_counter.c index c59ed115c700..89f0ac592d70 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_counter.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_counter.c @@ -147,7 +147,7 @@ prestera_counter_block_get(struct prestera_counter *counter, u32 client) if (block) return block; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return ERR_PTR(-ENOMEM); @@ -437,11 +437,11 @@ int prestera_counter_init(struct prestera_switch *sw) { struct prestera_counter *counter; - counter = kzalloc_obj(*counter, GFP_KERNEL); + counter = kzalloc_obj(*counter); if (!counter) return -ENOMEM; - counter->block_list = kzalloc_obj(*counter->block_list, GFP_KERNEL); + counter->block_list = kzalloc_obj(*counter->block_list); if (!counter->block_list) { kfree(counter); return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_devlink.c b/drivers/net/ethernet/marvell/prestera/prestera_devlink.c index 981b9e835be7..5fd78abccf25 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_devlink.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_devlink.c @@ -451,7 +451,7 @@ int prestera_devlink_traps_register(struct prestera_switch *sw) struct prestera_trap *prestera_trap; int err, i; - trap_data = kzalloc_obj(*trap_data, GFP_KERNEL); + trap_data = kzalloc_obj(*trap_data); if (!trap_data) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flow.c b/drivers/net/ethernet/marvell/prestera/prestera_flow.c index 21c052bfa6e8..88db1a59a57b 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flow.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flow.c @@ -82,7 +82,7 @@ prestera_flow_block_create(struct prestera_switch *sw, { struct prestera_flow_block *block; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return NULL; @@ -130,7 +130,7 @@ static int prestera_flow_block_bind(struct prestera_flow_block *block, struct prestera_flow_block_binding *binding; int err; - binding = kzalloc_obj(*binding, GFP_KERNEL); + binding = kzalloc_obj(*binding); if (!binding) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c index 28077005efaa..58b116cabd48 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c @@ -495,7 +495,7 @@ int prestera_flower_tmplt_create(struct prestera_flow_block *block, if (err) return err; - template = kmalloc_obj(*template, GFP_KERNEL); + template = kmalloc_obj(*template); if (!template) { err = -ENOMEM; goto err_malloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_hw.c index e20bd0eca18d..7695cbb2ce62 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_hw.c @@ -2256,7 +2256,7 @@ int prestera_hw_event_handler_register(struct prestera_switch *sw, if (eh) return -EEXIST; - eh = kmalloc_obj(*eh, GFP_KERNEL); + eh = kmalloc_obj(*eh); if (!eh) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 0d12ed32586b..41e19e9ad28d 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -1014,7 +1014,7 @@ static int prestera_lag_init(struct prestera_switch *sw) { u16 id; - sw->lags = kzalloc_objs(*sw->lags, sw->lag_max, GFP_KERNEL); + sw->lags = kzalloc_objs(*sw->lags, sw->lag_max); if (!sw->lags) return -ENOMEM; @@ -1209,7 +1209,7 @@ prestera_mdb_entry_create(struct prestera_switch *sw, struct prestera_flood_domain *flood_domain; struct prestera_mdb_entry *mdb_entry; - mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry); if (!mdb_entry) goto err_mdb_alloc; @@ -1247,7 +1247,7 @@ prestera_flood_domain_create(struct prestera_switch *sw) { struct prestera_flood_domain *domain; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; @@ -1279,7 +1279,7 @@ prestera_flood_domain_port_create(struct prestera_flood_domain *flood_domain, bool is_first_port_in_list = false; int err; - flood_domain_port = kzalloc_obj(*flood_domain_port, GFP_KERNEL); + flood_domain_port = kzalloc_obj(*flood_domain_port); if (!flood_domain_port) { err = -ENOMEM; goto err_port_alloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router.c b/drivers/net/ethernet/marvell/prestera/prestera_router.c index a75764610eef..b036b173a308 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_router.c @@ -485,7 +485,7 @@ __prestera_kern_neigh_cache_create(struct prestera_switch *sw, struct prestera_kern_neigh_cache *n_cache; int err; - n_cache = kzalloc_obj(*n_cache, GFP_KERNEL); + n_cache = kzalloc_obj(*n_cache); if (!n_cache) goto err_kzalloc; @@ -623,7 +623,7 @@ prestera_kern_fib_cache_create(struct prestera_switch *sw, struct prestera_kern_fib_cache *fib_cache; int err; - fib_cache = kzalloc_obj(*fib_cache, GFP_KERNEL); + fib_cache = kzalloc_obj(*fib_cache); if (!fib_cache) goto err_kzalloc; @@ -1550,7 +1550,7 @@ int prestera_router_init(struct prestera_switch *sw) struct prestera_router *router; int err, nhgrp_cache_bytes; - router = kzalloc_obj(*sw->router, GFP_KERNEL); + router = kzalloc_obj(*sw->router); if (!router) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c index b94e28d403e7..ccf6cf98920f 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c @@ -127,7 +127,7 @@ static struct prestera_vr *__prestera_vr_create(struct prestera_switch *sw, struct prestera_vr *vr; int err; - vr = kzalloc_obj(*vr, GFP_KERNEL); + vr = kzalloc_obj(*vr); if (!vr) { err = -ENOMEM; goto err_alloc_vr; @@ -252,7 +252,7 @@ prestera_rif_entry_create(struct prestera_switch *sw, struct prestera_rif_entry *e; struct prestera_iface iface; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) goto err_kzalloc; @@ -301,7 +301,7 @@ __prestera_nh_neigh_create(struct prestera_switch *sw, struct prestera_nh_neigh *neigh; int err; - neigh = kzalloc_obj(*neigh, GFP_KERNEL); + neigh = kzalloc_obj(*neigh); if (!neigh) goto err_kzalloc; @@ -397,7 +397,7 @@ __prestera_nexthop_group_create(struct prestera_switch *sw, struct prestera_nh_neigh *nh_neigh; int nh_cnt, err, gid; - nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp); if (!nh_grp) goto err_kzalloc; @@ -628,7 +628,7 @@ prestera_fib_node_create(struct prestera_switch *sw, struct prestera_vr *vr; int err; - fib_node = kzalloc_obj(*fib_node, GFP_KERNEL); + fib_node = kzalloc_obj(*fib_node); if (!fib_node) goto err_kzalloc; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c index 696625d6dcbc..c4ea247d2470 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c @@ -379,7 +379,7 @@ static int prestera_sdma_rx_init(struct prestera_sdma *sdma) struct prestera_sdma_buf *head, *tail, *next, *prev; struct prestera_rx_ring *ring = &sdma->rx_ring[q]; - ring->bufs = kmalloc_objs(*head, bnum, GFP_KERNEL); + ring->bufs = kmalloc_objs(*head, bnum); if (!ring->bufs) return -ENOMEM; @@ -529,7 +529,7 @@ static int prestera_sdma_tx_init(struct prestera_sdma *sdma) INIT_WORK(&sdma->tx_work, prestera_sdma_tx_recycle_work_fn); spin_lock_init(&sdma->tx_lock); - tx_ring->bufs = kmalloc_objs(*head, bnum, GFP_KERNEL); + tx_ring->bufs = kmalloc_objs(*head, bnum); if (!tx_ring->bufs) return -ENOMEM; @@ -784,7 +784,7 @@ int prestera_rxtx_switch_init(struct prestera_switch *sw) struct prestera_rxtx *rxtx; int err; - rxtx = kzalloc_obj(*rxtx, GFP_KERNEL); + rxtx = kzalloc_obj(*rxtx); if (!rxtx) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_span.c b/drivers/net/ethernet/marvell/prestera/prestera_span.c index dd86164e6a19..bb2f74524e1c 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_span.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_span.c @@ -27,7 +27,7 @@ prestera_span_entry_create(struct prestera_port *port, u8 span_id) { struct prestera_span_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -170,7 +170,7 @@ int prestera_span_init(struct prestera_switch *sw) { struct prestera_span *span; - span = kzalloc_obj(*span, GFP_KERNEL); + span = kzalloc_obj(*span); if (!span) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c index 1ca197fb08a6..2012d00fabec 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c @@ -180,7 +180,7 @@ prestera_bridge_vlan_create(struct prestera_bridge_port *br_port, u16 vid) { struct prestera_bridge_vlan *br_vlan; - br_vlan = kzalloc_obj(*br_vlan, GFP_KERNEL); + br_vlan = kzalloc_obj(*br_vlan); if (!br_vlan) return NULL; @@ -263,7 +263,7 @@ prestera_port_vlan_create(struct prestera_port *port, u16 vid, bool untagged) if (err) return ERR_PTR(err); - port_vlan = kzalloc_obj(*port_vlan, GFP_KERNEL); + port_vlan = kzalloc_obj(*port_vlan); if (!port_vlan) { err = -ENOMEM; goto err_port_vlan_alloc; @@ -443,7 +443,7 @@ prestera_bridge_create(struct prestera_switchdev *swdev, struct net_device *dev) return ERR_PTR(-EINVAL); } - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return ERR_PTR(-ENOMEM); @@ -562,7 +562,7 @@ prestera_bridge_port_create(struct prestera_bridge *bridge, { struct prestera_bridge_port *br_port; - br_port = kzalloc_obj(*br_port, GFP_KERNEL); + br_port = kzalloc_obj(*br_port); if (!br_port) return NULL; @@ -1498,7 +1498,7 @@ prestera_br_mdb_entry_create(struct prestera_switch *sw, struct prestera_br_mdb_entry *br_mdb_entry; struct prestera_mdb_entry *mdb_entry; - br_mdb_entry = kzalloc_obj(*br_mdb_entry, GFP_KERNEL); + br_mdb_entry = kzalloc_obj(*br_mdb_entry); if (!br_mdb_entry) return NULL; @@ -1530,7 +1530,7 @@ static int prestera_br_mdb_port_add(struct prestera_br_mdb_entry *br_mdb, if (br_mdb_port->br_port == br_port) return 0; - br_mdb_port = kzalloc_obj(*br_mdb_port, GFP_KERNEL); + br_mdb_port = kzalloc_obj(*br_mdb_port); if (!br_mdb_port) return -ENOMEM; @@ -1873,7 +1873,7 @@ int prestera_switchdev_init(struct prestera_switch *sw) struct prestera_switchdev *swdev; int err; - swdev = kzalloc_obj(*swdev, GFP_KERNEL); + swdev = kzalloc_obj(*swdev); if (!swdev) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c index a2f6622e6ff5..bbbbbba63e15 100644 --- a/drivers/net/ethernet/marvell/pxa168_eth.c +++ b/drivers/net/ethernet/marvell/pxa168_eth.c @@ -1024,7 +1024,7 @@ static int rxq_init(struct net_device *dev) int rx_desc_num = pep->rx_ring_size; /* Allocate RX skb rings */ - pep->rx_skb = kzalloc_objs(*pep->rx_skb, rx_desc_num, GFP_KERNEL); + pep->rx_skb = kzalloc_objs(*pep->rx_skb, rx_desc_num); if (!pep->rx_skb) return -ENOMEM; @@ -1083,7 +1083,7 @@ static int txq_init(struct net_device *dev) int size = 0, i = 0; int tx_desc_num = pep->tx_ring_size; - pep->tx_skb = kzalloc_objs(*pep->tx_skb, tx_desc_num, GFP_KERNEL); + pep->tx_skb = kzalloc_objs(*pep->tx_skb, tx_desc_num); if (!pep->tx_skb) return -ENOMEM; diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 49942779418c..e386c8314e21 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -918,7 +918,7 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base) struct skge_element *e; int i; - ring->start = kzalloc_objs(*e, ring->count, GFP_KERNEL); + ring->start = kzalloc_objs(*e, ring->count); if (!ring->start) return -ENOMEM; diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 61065fb30acb..e5e2ffa9c542 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2647,7 +2647,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) else ring_size = soc->tx.dma_size; - ring->buf = kzalloc_objs(*ring->buf, ring_size, GFP_KERNEL); + ring->buf = kzalloc_objs(*ring->buf, ring_size); if (!ring->buf) goto no_tx_mem; diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c index bc53b08ff205..cb30108f2bf6 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c @@ -469,7 +469,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, if (wed_index >= 0 && (err = mtk_wed_flow_add(wed_index)) < 0) return err; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c index 303e3945b72c..10d9beaae372 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c @@ -656,7 +656,7 @@ mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev) } n_pages = dev->tx_buf_ring.size / MTK_WED_BUF_PER_PAGE; - page_list = kzalloc_objs(*page_list, n_pages, GFP_KERNEL); + page_list = kzalloc_objs(*page_list, n_pages); if (!page_list) return -ENOMEM; @@ -780,7 +780,7 @@ mtk_wed_hwrro_buffer_alloc(struct mtk_wed_device *dev) if (!dev->wlan.hw_rro) return 0; - page_list = kzalloc_objs(*page_list, n_pages, GFP_KERNEL); + page_list = kzalloc_objs(*page_list, n_pages); if (!page_list) return -ENOMEM; @@ -2718,7 +2718,7 @@ mtk_wed_setup_tc_block(struct mtk_wed_hw *hw, struct net_device *dev, return 0; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -2822,7 +2822,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth, if (WARN_ON(hw_list[index])) goto unlock; - hw = kzalloc_obj(*hw, GFP_KERNEL); + hw = kzalloc_obj(*hw); if (!hw) goto unlock; diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c index 7e4d1998fd0d..4ed63950fd9d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/alloc.c +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c @@ -223,7 +223,7 @@ struct mlx4_zone_entry { struct mlx4_zone_allocator *mlx4_zone_allocator_create(enum mlx4_zone_alloc_flags flags) { - struct mlx4_zone_allocator *zones = kmalloc_obj(*zones, GFP_KERNEL); + struct mlx4_zone_allocator *zones = kmalloc_obj(*zones); if (NULL == zones) return NULL; @@ -247,7 +247,7 @@ int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc, { u32 mask = mlx4_bitmap_masked_value(bitmap, (u32)-1); struct mlx4_zone_entry *it; - struct mlx4_zone_entry *zone = kmalloc_obj(*zone, GFP_KERNEL); + struct mlx4_zone_entry *zone = kmalloc_obj(*zone); if (NULL == zone) return -ENOMEM; @@ -642,7 +642,7 @@ static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device) { struct mlx4_db_pgdir *pgdir; - pgdir = kzalloc_obj(*pgdir, GFP_KERNEL); + pgdir = kzalloc_obj(*pgdir); if (!pgdir) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 150ede6eb18f..4872931eb118 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -1674,7 +1674,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, int err = 0; /* Create sw representation of Virtual HCR */ - vhcr = kzalloc_obj(struct mlx4_vhcr, GFP_KERNEL); + vhcr = kzalloc_obj(struct mlx4_vhcr); if (!vhcr) return -ENOMEM; @@ -1873,7 +1873,7 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, vp_admin->default_vlan, vp_admin->default_qos, vp_admin->link_state); - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; @@ -2689,7 +2689,7 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) { struct mlx4_cmd_mailbox *mailbox; - mailbox = kmalloc_obj(*mailbox, GFP_KERNEL); + mailbox = kmalloc_obj(*mailbox); if (!mailbox) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index 2e914a254a16..4ba19470df1e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -1158,7 +1158,7 @@ static int mlx4_en_set_ringparam(struct net_device *dev, tx_size == priv->tx_ring[TX][0]->size) return 0; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; @@ -1452,8 +1452,8 @@ static int add_ip_rule(struct mlx4_en_priv *priv, struct mlx4_spec_list *spec_l3; struct ethtool_usrip4_spec *l3_mask = &cmd->fs.m_u.usr_ip4_spec; - spec_l3 = kzalloc_obj(*spec_l3, GFP_KERNEL); - spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); + spec_l3 = kzalloc_obj(*spec_l3); + spec_l2 = kzalloc_obj(*spec_l2); if (!spec_l2 || !spec_l3) { err = -ENOMEM; goto free_spec; @@ -1491,9 +1491,9 @@ static int add_tcp_udp_rule(struct mlx4_en_priv *priv, struct mlx4_spec_list *spec_l4; struct ethtool_tcpip4_spec *l4_mask = &cmd->fs.m_u.tcp_ip4_spec; - spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); - spec_l3 = kzalloc_obj(*spec_l3, GFP_KERNEL); - spec_l4 = kzalloc_obj(*spec_l4, GFP_KERNEL); + spec_l2 = kzalloc_obj(*spec_l2); + spec_l3 = kzalloc_obj(*spec_l3); + spec_l4 = kzalloc_obj(*spec_l4); if (!spec_l2 || !spec_l3 || !spec_l4) { err = -ENOMEM; goto free_spec; @@ -1564,7 +1564,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev, switch (cmd->fs.flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) { case ETHER_FLOW: - spec_l2 = kzalloc_obj(*spec_l2, GFP_KERNEL); + spec_l2 = kzalloc_obj(*spec_l2); if (!spec_l2) return -ENOMEM; @@ -1833,7 +1833,7 @@ static int mlx4_en_set_channels(struct net_device *dev, if (!channel->tx_count || !channel->rx_count) return -EINVAL; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c index 1374a81945b2..a106c0e1e9ad 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c @@ -271,7 +271,7 @@ static int mlx4_en_probe(struct auxiliary_device *adev, printk_once(KERN_INFO "%s", mlx4_en_version); - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) { err = -ENOMEM; goto err_free_res; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index ee1ea70cdd34..4e151865fa7b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -99,7 +99,7 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc) int port_up = 0; int err = 0; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; @@ -1209,7 +1209,7 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv, } if (!found) { - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { en_err(priv, "Failed adding MAC %pM on port:%d (out of memory)\n", ha->addr, priv->port); @@ -1317,7 +1317,7 @@ static int mlx4_en_set_rss_steer_rules(struct mlx4_en_priv *priv) if (err) goto tunnel_err; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto alloc_err; @@ -2752,7 +2752,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog) if (!mlx4_en_check_xdp_mtu(dev, dev->mtu)) return -EOPNOTSUPP; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; @@ -3521,7 +3521,7 @@ int mlx4_en_reset_config(struct net_device *dev, return -EINVAL; } - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index de45de8fa41b..96f97fa0f548 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -1094,7 +1094,7 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn, struct mlx4_qp_context *context; int err = 0; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return -ENOMEM; @@ -1208,7 +1208,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) return 0; } - rss_map->indir_qp = kzalloc_obj(*rss_map->indir_qp, GFP_KERNEL); + rss_map->indir_qp = kzalloc_obj(*rss_map->indir_qp); if (!rss_map->indir_qp) { err = -ENOMEM; goto rss_err; diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 9891d33c7ecb..2760db75b617 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -987,7 +987,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, */ npages = PAGE_ALIGN(eq->nent * dev->caps.eqe_size) / PAGE_SIZE; - eq->page_list = kmalloc_objs(*eq->page_list, npages, GFP_KERNEL); + eq->page_list = kmalloc_objs(*eq->page_list, npages); if (!eq->page_list) goto err_out; diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index c076d26a0b12..f159eea5ad56 100644 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c @@ -426,7 +426,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, return -EINVAL; num_icm = DIV_ROUND_UP(nobj, obj_per_chunk); - table->icm = kvzalloc_objs(*table->icm, num_icm, GFP_KERNEL); + table->icm = kvzalloc_objs(*table->icm, num_icm); if (!table->icm) return -ENOMEM; table->virt = virt; diff --git a/drivers/net/ethernet/mellanox/mlx4/intf.c b/drivers/net/ethernet/mellanox/mlx4/intf.c index e1db44df72f6..2964334582ea 100644 --- a/drivers/net/ethernet/mellanox/mlx4/intf.c +++ b/drivers/net/ethernet/mellanox/mlx4/intf.c @@ -115,7 +115,7 @@ static struct mlx4_adev *add_adev(struct mlx4_dev *dev, int idx) struct mlx4_adev *madev; int ret; - madev = kzalloc_obj(*madev, GFP_KERNEL); + madev = kzalloc_obj(*madev); if (!madev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 2e5032658fcd..982e9866d8e0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -867,7 +867,7 @@ static int mlx4_slave_special_qp_cap(struct mlx4_dev *dev) struct mlx4_caps *caps = &dev->caps; int i, err = 0; - func_cap = kzalloc_obj(*func_cap, GFP_KERNEL); + func_cap = kzalloc_obj(*func_cap); caps->spec_qps = kzalloc_objs(*caps->spec_qps, caps->num_ports, GFP_KERNEL); @@ -912,9 +912,9 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) struct mlx4_func_cap *func_cap; struct mlx4_init_hca_param *hca_param; - hca_param = kzalloc_obj(*hca_param, GFP_KERNEL); - func_cap = kzalloc_obj(*func_cap, GFP_KERNEL); - dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); + hca_param = kzalloc_obj(*hca_param); + func_cap = kzalloc_obj(*func_cap); + dev_cap = kzalloc_obj(*dev_cap); if (!hca_param || !func_cap || !dev_cap) { mlx4_err(dev, "Failed to allocate memory for slave_cap\n"); err = -ENOMEM; @@ -2324,8 +2324,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev) int err; if (!mlx4_is_slave(dev)) { - dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); - init_hca = kzalloc_obj(*init_hca, GFP_KERNEL); + dev_cap = kzalloc_obj(*dev_cap); + init_hca = kzalloc_obj(*init_hca); if (!dev_cap || !init_hca) { err = -ENOMEM; @@ -2966,7 +2966,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) if (msi_x > 1) nreq = min_t(int, nreq, msi_x); - entries = kzalloc_objs(*entries, nreq, GFP_KERNEL); + entries = kzalloc_objs(*entries, nreq); if (!entries) goto no_msi; @@ -3174,7 +3174,7 @@ static int mlx4_init_steering(struct mlx4_dev *dev) int num_entries = dev->caps.num_ports; int i, j; - priv->steer = kzalloc_objs(struct mlx4_steer, num_entries, GFP_KERNEL); + priv->steer = kzalloc_objs(struct mlx4_steer, num_entries); if (!priv->steer) return -ENOMEM; @@ -3295,7 +3295,7 @@ static u64 mlx4_enable_sriov(struct mlx4_dev *dev, struct pci_dev *pdev, } } - dev->dev_vfs = kzalloc_objs(*dev->dev_vfs, total_vfs, GFP_KERNEL); + dev->dev_vfs = kzalloc_objs(*dev->dev_vfs, total_vfs); if (NULL == dev->dev_vfs) { mlx4_err(dev, "Failed to allocate memory for VFs\n"); goto disable_sriov; @@ -3494,7 +3494,7 @@ slave_start: if (mlx4_is_master(dev)) { /* when we hit the goto slave_start below, dev_cap already initialized */ if (!dev_cap) { - dev_cap = kzalloc_obj(*dev_cap, GFP_KERNEL); + dev_cap = kzalloc_obj(*dev_cap); if (!dev_cap) { err = -ENOMEM; @@ -4034,7 +4034,7 @@ static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) priv = devlink_priv(devlink); dev = &priv->dev; - dev->persist = kzalloc_obj(*dev->persist, GFP_KERNEL); + dev->persist = kzalloc_obj(*dev->persist); if (!dev->persist) { ret = -ENOMEM; goto err_devlink_free; diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index 7ab766a81452..791ef30053b9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c @@ -162,7 +162,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, return -EINVAL; s_steer = &mlx4_priv(dev)->steer[port - 1]; - new_entry = kzalloc_obj(*new_entry, GFP_KERNEL); + new_entry = kzalloc_obj(*new_entry); if (!new_entry) return -ENOMEM; @@ -175,7 +175,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, */ pqp = get_promisc_qp(dev, port, steer, qpn); if (pqp) { - dqp = kmalloc_obj(*dqp, GFP_KERNEL); + dqp = kmalloc_obj(*dqp); if (!dqp) { err = -ENOMEM; goto out_alloc; @@ -274,7 +274,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port, } /* add the qp as a duplicate on this index */ - dqp = kmalloc_obj(*dqp, GFP_KERNEL); + dqp = kmalloc_obj(*dqp); if (!dqp) return -ENOMEM; dqp->qpn = qpn; @@ -443,7 +443,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, goto out_mutex; } - pqp = kmalloc_obj(*pqp, GFP_KERNEL); + pqp = kmalloc_obj(*pqp); if (!pqp) { err = -ENOMEM; goto out_mutex; @@ -479,7 +479,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, /* Entry already exists. * Add to duplicates. */ - dqp = kmalloc_obj(*dqp, GFP_KERNEL); + dqp = kmalloc_obj(*dqp); if (!dqp) { err = -ENOMEM; goto out_mailbox; diff --git a/drivers/net/ethernet/mellanox/mlx4/pd.c b/drivers/net/ethernet/mellanox/mlx4/pd.c index b29e067da2e2..6bf850b07d1c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/pd.c +++ b/drivers/net/ethernet/mellanox/mlx4/pd.c @@ -189,7 +189,7 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) } uar = kmalloc_node(sizeof(*uar), GFP_KERNEL, node); if (!uar) { - uar = kmalloc_obj(*uar, GFP_KERNEL); + uar = kmalloc_obj(*uar); if (!uar) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx4/profile.c b/drivers/net/ethernet/mellanox/mlx4/profile.c index 828c14074f81..1cff4aa13284 100644 --- a/drivers/net/ethernet/mellanox/mlx4/profile.c +++ b/drivers/net/ethernet/mellanox/mlx4/profile.c @@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, struct sysinfo si; int i, j; - profile = kzalloc_objs(*profile, MLX4_RES_NUM, GFP_KERNEL); + profile = kzalloc_objs(*profile, MLX4_RES_NUM); if (!profile) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 50002356697f..436ed587b8b9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c @@ -564,7 +564,7 @@ static int mlx4_create_zones(struct mlx4_dev *dev, if (NULL == qp_table->zones) return -ENOMEM; - bitmap = kmalloc_obj(*bitmap, GFP_KERNEL); + bitmap = kmalloc_obj(*bitmap); if (NULL == bitmap) { err = -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index dba5709ff96f..870f97c79991 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -505,7 +505,7 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) int t; priv->mfunc.master.res_tracker.slave_list = - kzalloc_objs(struct slave_list, dev->num_slaves, GFP_KERNEL); + kzalloc_objs(struct slave_list, dev->num_slaves); if (!priv->mfunc.master.res_tracker.slave_list) return -ENOMEM; @@ -1049,7 +1049,7 @@ static struct res_common *alloc_qp_tr(int id) { struct res_qp *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1067,7 +1067,7 @@ static struct res_common *alloc_mtt_tr(int id, int order) { struct res_mtt *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1083,7 +1083,7 @@ static struct res_common *alloc_mpt_tr(int id, int key) { struct res_mpt *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1098,7 +1098,7 @@ static struct res_common *alloc_eq_tr(int id) { struct res_eq *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1112,7 +1112,7 @@ static struct res_common *alloc_cq_tr(int id) { struct res_cq *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1127,7 +1127,7 @@ static struct res_common *alloc_srq_tr(int id) { struct res_srq *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1142,7 +1142,7 @@ static struct res_common *alloc_counter_tr(int id, int port) { struct res_counter *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1157,7 +1157,7 @@ static struct res_common *alloc_xrcdn_tr(int id) { struct res_xrcdn *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1171,7 +1171,7 @@ static struct res_common *alloc_fs_rule_tr(u64 id, int qpn) { struct res_fs_rule *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -1283,7 +1283,7 @@ static int add_res_range(struct mlx4_dev *dev, int slave, u64 base, int count, struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; struct rb_root *root = &tracker->res_tree[type]; - res_arr = kzalloc_objs(*res_arr, count, GFP_KERNEL); + res_arr = kzalloc_objs(*res_arr, count); if (!res_arr) return -ENOMEM; @@ -2036,7 +2036,7 @@ static int mac_add_to_slave(struct mlx4_dev *dev, int slave, u64 mac, int port, if (mlx4_grant_resource(dev, slave, RES_MAC, 1, port)) return -EINVAL; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) { mlx4_release_resource(dev, slave, RES_MAC, 1, port); return -ENOMEM; @@ -2143,7 +2143,7 @@ static int vlan_add_to_slave(struct mlx4_dev *dev, int slave, u16 vlan, if (mlx4_grant_resource(dev, slave, RES_VLAN, 1, port)) return -EINVAL; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) { mlx4_release_resource(dev, slave, RES_VLAN, 1, port); return -ENOMEM; @@ -4030,7 +4030,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, struct res_gid *res; int err; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c index 058b7b2497ac..202feab1558a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c @@ -79,7 +79,7 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size, buf->size = size; buf->npages = DIV_ROUND_UP(size, PAGE_SIZE); buf->page_shift = PAGE_SHIFT; - buf->frags = kzalloc_objs(struct mlx5_buf_list, buf->npages, GFP_KERNEL); + buf->frags = kzalloc_objs(struct mlx5_buf_list, buf->npages); if (!buf->frags) goto err_out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c index f2aa14e07e92..78e19dbb9f3a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -201,7 +201,7 @@ static const struct file_operations slots_fops = { static struct mlx5_cmd_stats * mlx5_cmdif_alloc_stats(struct xarray *stats_xa, int opcode) { - struct mlx5_cmd_stats *stats = kzalloc_obj(*stats, GFP_KERNEL); + struct mlx5_cmd_stats *stats = kzalloc_obj(*stats); int err; if (!stats) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c index bed0b6bfba7e..4bfbf52a46b4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c @@ -310,7 +310,7 @@ static struct mlx5_adev *add_adev(struct mlx5_core_dev *dev, int idx) struct mlx5_adev *madev; int ret; - madev = kzalloc_obj(*madev, GFP_KERNEL); + madev = kzalloc_obj(*madev); if (!madev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 18cfb7655805..6698ac55a4bf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -294,7 +294,7 @@ static int mlx5_devlink_trap_init(struct devlink *devlink, const struct devlink_ struct mlx5_core_dev *dev = devlink_priv(devlink); struct mlx5_devlink_trap *dl_trap; - dl_trap = kzalloc_obj(*dl_trap, GFP_KERNEL); + dl_trap = kzalloc_obj(*dl_trap); if (!dl_trap) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c index d2e2c9f0f340..adcc73e2a5b3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -412,7 +412,7 @@ static struct tracer_string_format *mlx5_tracer_message_insert(struct mlx5_fw_tr &tracer->hash[mlx5_tracer_message_hash(tracer_event->string_event.tmsn)]; struct tracer_string_format *cur_string; - cur_string = kzalloc_obj(*cur_string, GFP_KERNEL); + cur_string = kzalloc_obj(*cur_string); if (!cur_string) return NULL; @@ -1023,7 +1023,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) return NULL; } - tracer = kvzalloc_obj(*tracer, GFP_KERNEL); + tracer = kvzalloc_obj(*tracer); if (!tracer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c index 9bcc2d8edc76..e770088de129 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/rsc_dump.c @@ -137,7 +137,7 @@ struct mlx5_rsc_dump_cmd *mlx5_rsc_dump_cmd_create(struct mlx5_core_dev *dev, if (!sgmt_type && key->rsc != MLX5_SGMT_TYPE_MENU) return ERR_PTR(-EOPNOTSUPP); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { mlx5_core_err(dev, "Resource dump: Failed to allocate command\n"); return ERR_PTR(-ENOMEM); @@ -255,7 +255,7 @@ struct mlx5_rsc_dump *mlx5_rsc_dump_create(struct mlx5_core_dev *dev) mlx5_core_dbg(dev, "Resource dump: capability not present\n"); return NULL; } - rsc_dump = kzalloc_obj(*rsc_dump, GFP_KERNEL); + rsc_dump = kzalloc_obj(*rsc_dump); if (!rsc_dump) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c index abb678fe3021..bce72e8d1bc3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c @@ -433,7 +433,7 @@ static int mlx5_dpll_probe(struct auxiliary_device *adev, if (err) return err; - mdpll = kzalloc_obj(*mdpll, GFP_KERNEL); + mdpll = kzalloc_obj(*mdpll); if (!mdpll) return -ENOMEM; mdpll->mdev = mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c index 8b418e8538ca..884f1dff0952 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c @@ -90,7 +90,7 @@ mlx5e_fs_tt_redirect_udp_add_rule(struct mlx5e_flow_steering *fs, if (type == FS_UDP_NUM_TYPES) return ERR_PTR(-EINVAL); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -150,7 +150,7 @@ static int fs_udp_create_groups(struct mlx5e_flow_table *ft, enum fs_udp_type ty int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -325,7 +325,7 @@ int mlx5e_fs_tt_redirect_udp_create(struct mlx5e_flow_steering *fs) return 0; } - udp = kzalloc_obj(*udp, GFP_KERNEL); + udp = kzalloc_obj(*udp); if (!udp) return -ENOMEM; mlx5e_fs_set_udp(fs, udp); @@ -372,7 +372,7 @@ mlx5e_fs_tt_redirect_any_add_rule(struct mlx5e_flow_steering *fs, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -432,7 +432,7 @@ static int fs_any_create_groups(struct mlx5e_flow_table *ft) int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_FS_UDP_NUM_GROUPS); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -589,7 +589,7 @@ int mlx5e_fs_tt_redirect_any_create(struct mlx5e_flow_steering *fs) return 0; } - fs_any = kzalloc_obj(*fs_any, GFP_KERNEL); + fs_any = kzalloc_obj(*fs_any); if (!fs_any) return -ENOMEM; mlx5e_fs_set_any(fs, fs_any); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c b/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c index c63b8022fae6..ac27f6260f99 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c @@ -72,7 +72,7 @@ mlx5e_htb_node_create_leaf(struct mlx5e_htb *htb, u16 classid, u16 qid, { struct mlx5e_qos_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return ERR_PTR(-ENOMEM); @@ -93,7 +93,7 @@ static struct mlx5e_qos_node *mlx5e_htb_node_create_root(struct mlx5e_htb *htb) { struct mlx5e_qos_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return ERR_PTR(-ENOMEM); @@ -694,7 +694,7 @@ mlx5e_htb_node_modify(struct mlx5e_htb *htb, u16 classid, u64 rate, u64 ceil, struct mlx5e_htb *mlx5e_htb_alloc(void) { - return kvzalloc_obj(struct mlx5e_htb, GFP_KERNEL); + return kvzalloc_obj(struct mlx5e_htb); } void mlx5e_htb_free(struct mlx5e_htb *htb) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c b/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c index b1a84a01a81c..4bab696b7250 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c @@ -198,7 +198,7 @@ mapping_create(size_t data_size, u32 max_id, bool delayed_removal) { struct mapping_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c index 5f4a7ca15518..1b76647f3194 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c @@ -883,7 +883,7 @@ int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params, c = kvzalloc_node(sizeof(*c), GFP_KERNEL, dev_to_node(mlx5_core_dma_dev(mdev))); - cparams = kvzalloc_obj(*cparams, GFP_KERNEL); + cparams = kvzalloc_obj(*cparams); if (!c || !cparams) { err = -ENOMEM; goto err_free; @@ -988,7 +988,7 @@ int mlx5e_ptp_alloc_rx_fs(struct mlx5e_flow_steering *fs, if (!mlx5e_profile_feature_cap(profile, PTP_RX)) return 0; - ptp_fs = kzalloc_obj(*ptp_fs, GFP_KERNEL); + ptp_fs = kzalloc_obj(*ptp_fs); if (!ptp_fs) return -ENOMEM; mlx5e_fs_set_ptp(fs, ptp_fs); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c index cebcff010eac..d720bcd70373 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c @@ -99,7 +99,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, if (!priv->htb_qos_sq_stats[node_qid]) { struct mlx5e_sq_stats *stats; - stats = kzalloc_obj(*stats, GFP_KERNEL); + stats = kzalloc_obj(*stats); if (!stats) return -ENOMEM; @@ -115,7 +115,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, c = chs->c[ix]; qos_sqs = mlx5e_state_dereference(priv, c->qos_sqs); - sq = kzalloc_obj(*sq, GFP_KERNEL); + sq = kzalloc_obj(*sq); if (!sq) return -ENOMEM; @@ -462,7 +462,7 @@ struct mlx5e_mqprio_rl { struct mlx5e_mqprio_rl *mlx5e_mqprio_rl_alloc(void) { - return kvzalloc_obj(struct mlx5e_mqprio_rl, GFP_KERNEL); + return kvzalloc_obj(struct mlx5e_mqprio_rl); } void mlx5e_mqprio_rl_free(struct mlx5e_mqprio_rl *rl) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c index 8038deae35a7..9799bdd7d8d6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c @@ -92,7 +92,7 @@ int mlx5e_rep_bond_enslave(struct mlx5_eswitch *esw, struct net_device *netdev, mdata = mlx5e_lookup_rep_bond_metadata(&rpriv->uplink_priv, lag_dev); if (!mdata) { /* First netdev becomes slave, no metadata presents the lag_dev. Create one */ - mdata = kzalloc_obj(*mdata, GFP_KERNEL); + mdata = kzalloc_obj(*mdata); if (!mdata) return -ENOMEM; @@ -110,7 +110,7 @@ int mlx5e_rep_bond_enslave(struct mlx5_eswitch *esw, struct net_device *netdev, mdata->metadata_reg_c_0); } - s_entry = kzalloc_obj(*s_entry, GFP_KERNEL); + s_entry = kzalloc_obj(*s_entry); if (!s_entry) { err = -ENOMEM; goto entry_alloc_err; @@ -315,7 +315,7 @@ int mlx5e_rep_bond_init(struct mlx5e_rep_priv *rpriv) if (!mlx5_esw_acl_egress_fwd2vport_supported(priv->mdev->priv.eswitch)) goto out; - uplink_priv->bond = kvzalloc_obj(*uplink_priv->bond, GFP_KERNEL); + uplink_priv->bond = kvzalloc_obj(*uplink_priv->bond); if (!uplink_priv->bond) { ret = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c index cbfb0cc32a3b..d220b045b331 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c @@ -376,7 +376,7 @@ int mlx5e_rep_neigh_entry_create(struct mlx5e_priv *priv, { int err; - *nhe = kzalloc_obj(**nhe, GFP_KERNEL); + *nhe = kzalloc_obj(**nhe); if (!*nhe) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c index 2dc5e139c99c..e1ebc9b2d061 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c @@ -503,7 +503,7 @@ mlx5e_rep_indr_setup_block(struct net_device *netdev, struct Qdisc *sch, if (indr_priv) return -EEXIST; - indr_priv = kmalloc_obj(*indr_priv, GFP_KERNEL); + indr_priv = kmalloc_obj(*indr_priv); if (!indr_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c index c9d141b8650b..a2ec67a122d9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rss.c @@ -93,7 +93,7 @@ void mlx5e_rss_params_indir_modify_actual_size(struct mlx5e_rss *rss, u32 num_ch int mlx5e_rss_params_indir_init(struct mlx5e_rss_params_indir *indir, u32 actual_table_size, u32 max_table_size) { - indir->table = kvmalloc_objs(*indir->table, max_table_size, GFP_KERNEL); + indir->table = kvmalloc_objs(*indir->table, max_table_size); if (!indir->table) return -ENOMEM; @@ -134,7 +134,7 @@ static struct mlx5e_rss *mlx5e_rss_init_copy(const struct mlx5e_rss *from) struct mlx5e_rss *rss; int err; - rss = kvzalloc_obj(*rss, GFP_KERNEL); + rss = kvzalloc_obj(*rss); if (!rss) return ERR_PTR(-ENOMEM); @@ -216,7 +216,7 @@ mlx5e_rss_create_tir(struct mlx5e_rss *rss, enum mlx5_traffic_types tt, if (*tir_p) return -EINVAL; - tir = kvzalloc_obj(*tir, GFP_KERNEL); + tir = kvzalloc_obj(*tir); if (!tir) return -ENOMEM; @@ -372,7 +372,7 @@ mlx5e_rss_init(struct mlx5_core_dev *mdev, struct mlx5e_rss *rss; int err; - rss = kvzalloc_obj(*rss, GFP_KERNEL); + rss = kvzalloc_obj(*rss); if (!rss) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c index a9f55ffb894e..92974b11ec75 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c @@ -325,7 +325,7 @@ static struct mlx5e_rx_res *mlx5e_rx_res_alloc(struct mlx5_core_dev *mdev, unsig { struct mlx5e_rx_res *rx_res; - rx_res = kvzalloc_obj(*rx_res, GFP_KERNEL); + rx_res = kvzalloc_obj(*rx_res); if (!rx_res) return NULL; @@ -359,7 +359,7 @@ static int mlx5e_rx_res_channels_init(struct mlx5e_rx_res *res) if (!builder) return -ENOMEM; - res->channels = kvzalloc_objs(*res->channels, res->max_nch, GFP_KERNEL); + res->channels = kvzalloc_objs(*res->channels, res->max_nch); if (!res->channels) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c b/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c index 4598d922385a..8318a26bc263 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/selq.c @@ -30,11 +30,11 @@ int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock) selq->state_lock = state_lock; - selq->standby = kvzalloc_obj(*selq->standby, GFP_KERNEL); + selq->standby = kvzalloc_obj(*selq->standby); if (!selq->standby) return -ENOMEM; - init_params = kvzalloc_obj(*selq->active, GFP_KERNEL); + init_params = kvzalloc_obj(*selq->active); if (!init_params) { kvfree(selq->standby); selq->standby = NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c index 45ff384b66d4..4b1c6c99c724 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c @@ -36,7 +36,7 @@ mlx5e_tc_act_stats_create(void) struct mlx5e_tc_act_stats_handle *handle; int err; - handle = kvzalloc_obj(*handle, GFP_KERNEL); + handle = kvzalloc_obj(*handle); if (!handle) return ERR_PTR(-ENOMEM); @@ -67,7 +67,7 @@ mlx5e_tc_act_stats_add(struct mlx5e_tc_act_stats_handle *handle, u64 lastused; int err = 0; - act_stats = kvzalloc_obj(*act_stats, GFP_KERNEL); + act_stats = kvzalloc_obj(*act_stats); if (!act_stats) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c index e983da2574ec..52f96010f0d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c @@ -34,7 +34,7 @@ mlx5_ct_fs_dmfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, struct mlx5_ct_fs_dmfs_rule *dmfs_rule; int err; - dmfs_rule = kzalloc_obj(*dmfs_rule, GFP_KERNEL); + dmfs_rule = kzalloc_obj(*dmfs_rule); if (!dmfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c index 59aa6ee5be05..822c79f2de72 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c @@ -203,7 +203,7 @@ mlx5_ct_fs_hmfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, if (!mlx5e_tc_ct_is_valid_flow_rule(fs->netdev, flow_rule)) return ERR_PTR(-EOPNOTSUPP); - hmfs_rule = kzalloc_obj(*hmfs_rule, GFP_KERNEL); + hmfs_rule = kzalloc_obj(*hmfs_rule); if (!hmfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c index 897d8f7ed7f2..5a2c24ef517b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c @@ -92,7 +92,7 @@ mlx5_ct_fs_smfs_matcher_create(struct mlx5_ct_fs *fs, struct mlx5dr_table *tbl, struct mlx5dr_matcher *dr_matcher; struct mlx5_flow_spec *spec; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -234,7 +234,7 @@ mlx5_ct_fs_smfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, if (!mlx5e_tc_ct_is_valid_flow_rule(fs->netdev, flow_rule)) return ERR_PTR(-EOPNOTSUPP); - smfs_rule = kzalloc_obj(*smfs_rule, GFP_KERNEL); + smfs_rule = kzalloc_obj(*smfs_rule); if (!smfs_rule) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c index 11754c8ae986..7f0b7c5560fb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c @@ -69,7 +69,7 @@ mlx5e_int_port_create_rx_rule(struct mlx5_eswitch *esw, struct mlx5_flow_spec *spec; void *misc; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -167,7 +167,7 @@ mlx5e_int_port_add(struct mlx5e_tc_int_port_priv *priv, return ERR_PTR(-ENOSPC); } - int_port = kzalloc_obj(*int_port, GFP_KERNEL); + int_port = kzalloc_obj(*int_port); if (!int_port) return ERR_PTR(-ENOMEM); @@ -313,7 +313,7 @@ mlx5e_tc_int_port_init(struct mlx5e_priv *priv) if (!mlx5e_tc_int_port_supported(esw)) return NULL; - int_port_priv = kzalloc_obj(*int_port_priv, GFP_KERNEL); + int_port_priv = kzalloc_obj(*int_port_priv); if (!int_port_priv) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c index 80ddbe373f97..a62b09dddc01 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c @@ -247,7 +247,7 @@ __mlx5e_flow_meter_alloc(struct mlx5e_flow_meters *flow_meters, bool alloc_aso) int err, pos, total; u32 id; - meter = kzalloc_obj(*meter, GFP_KERNEL); + meter = kzalloc_obj(*meter); if (!meter) return ERR_PTR(-ENOMEM); @@ -526,7 +526,7 @@ mlx5e_flow_meters_init(struct mlx5e_priv *priv, return ERR_PTR(-EOPNOTSUPP); } - flow_meters = kzalloc_obj(*flow_meters, GFP_KERNEL); + flow_meters = kzalloc_obj(*flow_meters); if (!flow_meters) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c index 62184531b3e6..18b6c1360552 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c @@ -42,7 +42,7 @@ mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, goto err_check; } - post_act = kzalloc_obj(*post_act, GFP_KERNEL); + post_act = kzalloc_obj(*post_act); if (!post_act) { err = -ENOMEM; goto err_check; @@ -86,7 +86,7 @@ mlx5e_tc_post_act_offload(struct mlx5e_post_act *post_act, if (IS_ERR(post_act)) return PTR_ERR(post_act); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -117,7 +117,7 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *po if (IS_ERR(post_act)) return ERR_CAST(post_act); - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c index e5467a94e9dc..d03376d7bb31 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c @@ -156,7 +156,7 @@ mlx5e_post_meter_rate_rules_create(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -402,7 +402,7 @@ mlx5e_post_meter_init(struct mlx5e_priv *priv, struct mlx5e_post_meter_priv *post_meter; int err; - post_meter = kzalloc_obj(*post_meter, GFP_KERNEL); + post_meter = kzalloc_obj(*post_meter); if (!post_meter) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c index 938961520f6c..89490f687a9c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c @@ -183,7 +183,7 @@ sampler_get(struct mlx5e_tc_psample *tc_psample, u32 sample_ratio, u32 default_t sample_ratio, default_table_id)) goto add_ref; - sampler = kzalloc_obj(*sampler, GFP_KERNEL); + sampler = kzalloc_obj(*sampler); if (!sampler) { err = -ENOMEM; goto err_alloc; @@ -273,7 +273,7 @@ sample_restore_get(struct mlx5e_tc_psample *tc_psample, u32 obj_id, if (restore->obj_id == obj_id) goto add_ref; - restore = kzalloc_obj(*restore, GFP_KERNEL); + restore = kzalloc_obj(*restore); if (!restore) { err = -ENOMEM; goto err_alloc; @@ -485,7 +485,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, if (IS_ERR_OR_NULL(tc_psample)) return ERR_PTR(-EOPNOTSUPP); - sample_flow = kzalloc_obj(*sample_flow, GFP_KERNEL); + sample_flow = kzalloc_obj(*sample_flow); if (!sample_flow) return ERR_PTR(-ENOMEM); sample_attr = &attr->sample_attr; @@ -619,7 +619,7 @@ mlx5e_tc_sample_init(struct mlx5_eswitch *esw, struct mlx5e_post_act *post_act) struct mlx5e_tc_psample *tc_psample; int err; - tc_psample = kzalloc_obj(*tc_psample, GFP_KERNEL); + tc_psample = kzalloc_obj(*tc_psample); if (!tc_psample) return ERR_PTR(-ENOMEM); if (IS_ERR_OR_NULL(post_act)) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index 2d3654faabfa..6c87a1c7db09 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -812,7 +812,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, zone_rule->nat = nat; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -887,7 +887,7 @@ mlx5_tc_ct_entry_update_rule(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1021,7 +1021,7 @@ mlx5_tc_ct_counter_create(struct mlx5_tc_ct_priv *ct_priv) struct mlx5_ct_counter *counter; int ret; - counter = kzalloc_obj(*counter, GFP_KERNEL); + counter = kzalloc_obj(*counter); if (!counter) return ERR_PTR(-ENOMEM); @@ -1219,7 +1219,7 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, } spin_unlock_bh(&ct_priv->ht_lock); - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1620,7 +1620,7 @@ static int tc_ct_pre_ct_add_rules(struct mlx5_ct_ft *ct_ft, u16 zone; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1856,7 +1856,7 @@ mlx5_tc_ct_add_ft_cb(struct mlx5_tc_ct_priv *ct_priv, u16 zone, return ft; } - ft = kzalloc_obj(*ft, GFP_KERNEL); + ft = kzalloc_obj(*ft); if (!ft) return ERR_PTR(-ENOMEM); @@ -2298,7 +2298,7 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, if (err) goto err_support; - ct_priv = kzalloc_obj(*ct_priv, GFP_KERNEL); + ct_priv = kzalloc_obj(*ct_priv); if (!ct_priv) goto err_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c index 9a7c6df78640..bfd401bee9e8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c @@ -87,7 +87,7 @@ int mlx5e_tc_set_attr_rx_tun(struct mlx5e_tc_flow *flow, void *daddr, *saddr; u8 ip_version; - tun_attr = kvzalloc_obj(*tun_attr, GFP_KERNEL); + tun_attr = kvzalloc_obj(*tun_attr); if (!tun_attr) return -ENOMEM; @@ -864,7 +864,7 @@ int mlx5e_attach_encap(struct mlx5e_priv *priv, goto attach_flow; } - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { err = -ENOMEM; goto out_err; @@ -976,7 +976,7 @@ int mlx5e_attach_decap(struct mlx5e_priv *priv, goto found; } - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) { err = -ENOMEM; goto out_err; @@ -1205,7 +1205,7 @@ mlx5e_route_get_create(struct mlx5e_priv *priv, return r; } - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) return ERR_PTR(-ENOMEM); @@ -1862,7 +1862,7 @@ struct mlx5e_tc_tun_encap *mlx5e_tc_tun_init(struct mlx5e_priv *priv) struct mlx5e_tc_tun_encap *encap; int err; - encap = kvzalloc_obj(*encap, GFP_KERNEL); + encap = kvzalloc_obj(*encap); if (!encap) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c index e02f04a7b211..376ba6b29027 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tir.c @@ -22,7 +22,7 @@ struct mlx5e_tir_builder *mlx5e_tir_builder_alloc(bool modify) { struct mlx5e_tir_builder *builder; - builder = kvzalloc_obj(*builder, GFP_KERNEL); + builder = kvzalloc_obj(*builder); if (!builder) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c index bd0cf822cea9..d39f778ecd85 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c @@ -123,7 +123,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, if (!mlx5e_validate_xsk_param(params, xsk, priv->mdev)) return -EINVAL; - cparam = kvzalloc_obj(*cparam, GFP_KERNEL); + cparam = kvzalloc_obj(*cparam); if (!cparam) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c index 64fe7921f380..e21b7c8f2e81 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c @@ -82,7 +82,7 @@ struct mlx5_flow_handle *mlx5e_accel_fs_add_sk(struct mlx5e_flow_steering *fs, struct mlx5_flow_handle *flow; struct mlx5_flow_spec *spec; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -186,7 +186,7 @@ static int accel_fs_tcp_create_groups(struct mlx5e_flow_table *ft, int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, MLX5E_ACCEL_FS_TCP_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_ACCEL_FS_TCP_NUM_GROUPS); in = kvzalloc(inlen, GFP_KERNEL); if (!in || !ft->g) { kfree(ft->g); @@ -378,7 +378,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs) if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version)) return -EOPNOTSUPP; - accel_tcp = kzalloc_obj(*accel_tcp, GFP_KERNEL); + accel_tcp = kzalloc_obj(*accel_tcp); if (!accel_tcp) return -ENOMEM; mlx5e_fs_set_accel_tcp(fs, accel_tcp); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c index 6ae17d24e64d..415208abf10e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c @@ -712,20 +712,20 @@ static int mlx5_ipsec_create_work(struct mlx5e_ipsec_sa_entry *sa_entry) break; } - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; switch (x->xso.type) { case XFRM_DEV_OFFLOAD_CRYPTO: - data = kzalloc_obj(*sa_entry, GFP_KERNEL); + data = kzalloc_obj(*sa_entry); if (!data) goto free_work; INIT_WORK(&work->work, mlx5e_ipsec_modify_state); break; case XFRM_DEV_OFFLOAD_PACKET: - data = kzalloc_obj(struct mlx5e_ipsec_netevent_data, GFP_KERNEL); + data = kzalloc_obj(struct mlx5e_ipsec_netevent_data); if (!data) goto free_work; @@ -759,7 +759,7 @@ static int mlx5e_ipsec_create_dwork(struct mlx5e_ipsec_sa_entry *sa_entry) x->lft.hard_byte_limit == XFRM_INF) return 0; - dwork = kzalloc_obj(*dwork, GFP_KERNEL); + dwork = kzalloc_obj(*dwork); if (!dwork) return -ENOMEM; @@ -988,7 +988,7 @@ void mlx5e_ipsec_init(struct mlx5e_priv *priv) return; } - ipsec = kzalloc_obj(*ipsec, GFP_KERNEL); + ipsec = kzalloc_obj(*ipsec); if (!ipsec) return; @@ -1276,7 +1276,7 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x, if (err) return err; - pol_entry = kzalloc_obj(*pol_entry, GFP_KERNEL); + pol_entry = kzalloc_obj(*pol_entry); if (!pol_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c index 8139772387f1..197a1c6930c0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c @@ -208,7 +208,7 @@ static int rx_add_rule_drop_auth_trailer(struct mlx5e_ipsec_sa_entry *sa_entry, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -287,7 +287,7 @@ static int rx_add_rule_drop_replay(struct mlx5e_ipsec_sa_entry *sa_entry, struct struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -347,7 +347,7 @@ static int ipsec_rx_status_drop_all_create(struct mlx5e_ipsec *ipsec, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!flow_group_in || !spec) { err = -ENOMEM; goto err_out; @@ -454,7 +454,7 @@ ipsec_rx_status_pass_create(struct mlx5e_ipsec *ipsec, struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -554,7 +554,7 @@ static int ipsec_miss_create(struct mlx5_core_dev *mdev, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!flow_group_in || !spec) { err = -ENOMEM; goto out; @@ -1226,7 +1226,7 @@ static int ipsec_counter_rule_tx(struct mlx5_core_dev *mdev, struct mlx5e_ipsec_ struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1962,7 +1962,7 @@ static int rx_add_rule_sa_selector(struct mlx5e_ipsec_sa_entry *sa_entry, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -2046,7 +2046,7 @@ static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) if (IS_ERR(rx)) return PTR_ERR(rx); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2176,7 +2176,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) if (IS_ERR(tx)) return PTR_ERR(tx); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2267,7 +2267,7 @@ static int tx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) if (IS_ERR(ft)) return PTR_ERR(ft); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2354,7 +2354,7 @@ static int rx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) rx = ipsec_rx(pol_entry->ipsec, attrs->addrs.family, attrs->type); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto err_alloc; @@ -2434,7 +2434,7 @@ static struct mlx5e_ipsec_fc *ipsec_fs_init_single_counter(struct mlx5_core_dev struct mlx5_fc *counter; int err; - fc = kzalloc_obj(*fc, GFP_KERNEL); + fc = kzalloc_obj(*fc); if (!fc) return ERR_PTR(-ENOMEM); @@ -2778,24 +2778,24 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec, if (!ns_esw) return -EOPNOTSUPP; - ipsec->tx_esw = kzalloc_obj(*ipsec->tx_esw, GFP_KERNEL); + ipsec->tx_esw = kzalloc_obj(*ipsec->tx_esw); if (!ipsec->tx_esw) return -ENOMEM; - ipsec->rx_esw = kzalloc_obj(*ipsec->rx_esw, GFP_KERNEL); + ipsec->rx_esw = kzalloc_obj(*ipsec->rx_esw); if (!ipsec->rx_esw) goto err_rx_esw; } - ipsec->tx = kzalloc_obj(*ipsec->tx, GFP_KERNEL); + ipsec->tx = kzalloc_obj(*ipsec->tx); if (!ipsec->tx) goto err_tx; - ipsec->rx_ipv4 = kzalloc_obj(*ipsec->rx_ipv4, GFP_KERNEL); + ipsec->rx_ipv4 = kzalloc_obj(*ipsec->rx_ipv4); if (!ipsec->rx_ipv4) goto err_rx_ipv4; - ipsec->rx_ipv6 = kzalloc_obj(*ipsec->rx_ipv6, GFP_KERNEL); + ipsec->rx_ipv6 = kzalloc_obj(*ipsec->rx_ipv6); if (!ipsec->rx_ipv6) goto err_rx_ipv6; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c index 14d7a63f752e..33344e00719b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c @@ -522,7 +522,7 @@ int mlx5e_ipsec_aso_init(struct mlx5e_ipsec *ipsec) struct device *pdev; int err; - aso = kzalloc_obj(*ipsec->aso, GFP_KERNEL); + aso = kzalloc_obj(*ipsec->aso); if (!aso) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c index ac348aacdb0d..337201f12895 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c @@ -199,7 +199,7 @@ int mlx5e_ktls_init(struct mlx5e_priv *priv) if (!mlx5e_is_ktls_device(priv->mdev)) return 0; - tls = kzalloc_obj(*tls, GFP_KERNEL); + tls = kzalloc_obj(*tls); if (!tls) return -ENOMEM; tls->mdev = priv->mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c index 47de07467e0c..ac8168ebb38c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c @@ -90,7 +90,7 @@ mlx5e_ktls_rx_resync_create_resp_list(void) { struct mlx5e_ktls_resync_resp *resp_list; - resp_list = kvzalloc_obj(*resp_list, GFP_KERNEL); + resp_list = kvzalloc_obj(*resp_list); if (!resp_list) return ERR_PTR(-ENOMEM); @@ -261,7 +261,7 @@ resync_post_get_progress_params(struct mlx5e_icosq *sq, int err; u16 pi; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (unlikely(!buf)) { err = -ENOMEM; goto err_out; @@ -643,7 +643,7 @@ int mlx5e_ktls_add_rx(struct net_device *netdev, struct sock *sk, tls_ctx = tls_get_ctx(sk); priv = netdev_priv(netdev); - priv_rx = kzalloc_obj(*priv_rx, GFP_KERNEL); + priv_rx = kzalloc_obj(*priv_rx); if (unlikely(!priv_rx)) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c index b93f7d41a692..29769fc99c4b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c @@ -196,7 +196,7 @@ mlx5e_tls_priv_tx_init(struct mlx5_core_dev *mdev, struct mlx5e_tls_sw_stats *sw struct mlx5e_ktls_offload_context_tx *priv_tx; int err; - priv_tx = kzalloc_obj(*priv_tx, GFP_KERNEL); + priv_tx = kzalloc_obj(*priv_tx); if (!priv_tx) return ERR_PTR(-ENOMEM); @@ -360,7 +360,7 @@ static struct mlx5e_tls_tx_pool *mlx5e_tls_tx_pool_init(struct mlx5_core_dev *md BUILD_BUG_ON(MLX5E_TLS_TX_POOL_LOW + MLX5E_TLS_TX_POOL_BULK >= MLX5E_TLS_TX_POOL_HIGH); - pool = kvzalloc_obj(*pool, GFP_KERNEL); + pool = kvzalloc_obj(*pool); if (!pool) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index 14db0a2af406..71b3a059c964 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -165,7 +165,7 @@ static int mlx5e_macsec_aso_reg_mr(struct mlx5_core_dev *mdev, struct mlx5e_macs dma_addr_t dma_addr; int err; - umr = kzalloc_obj(*umr, GFP_KERNEL); + umr = kzalloc_obj(*umr); if (!umr) { err = -ENOMEM; return err; @@ -530,7 +530,7 @@ static int mlx5e_macsec_add_txsa(struct macsec_context *ctx) goto out; } - tx_sa = kzalloc_obj(*tx_sa, GFP_KERNEL); + tx_sa = kzalloc_obj(*tx_sa); if (!tx_sa) { err = -ENOMEM; goto out; @@ -701,13 +701,13 @@ static int mlx5e_macsec_add_rxsc(struct macsec_context *ctx) goto out; } - rx_sc = kzalloc_obj(*rx_sc, GFP_KERNEL); + rx_sc = kzalloc_obj(*rx_sc); if (!rx_sc) { err = -ENOMEM; goto out; } - sc_xarray_element = kzalloc_obj(*sc_xarray_element, GFP_KERNEL); + sc_xarray_element = kzalloc_obj(*sc_xarray_element); if (!sc_xarray_element) { err = -ENOMEM; goto destroy_rx_sc; @@ -912,7 +912,7 @@ static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx) goto out; } - rx_sa = kzalloc_obj(*rx_sa, GFP_KERNEL); + rx_sa = kzalloc_obj(*rx_sa); if (!rx_sa) { err = -ENOMEM; goto out; @@ -1093,7 +1093,7 @@ static int mlx5e_macsec_add_secy(struct macsec_context *ctx) goto out; } - macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device); if (!macsec_device) { err = -ENOMEM; goto out; @@ -1730,7 +1730,7 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv) return 0; } - macsec = kzalloc_obj(*macsec, GFP_KERNEL); + macsec = kzalloc_obj(*macsec); if (!macsec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c index ea250eecbed1..6a50b6dec0fa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c @@ -142,7 +142,7 @@ static int accel_psp_fs_rx_err_add_rule(struct mlx5e_psp_fs *fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -344,7 +344,7 @@ static int accel_psp_fs_rx_create_ft(struct mlx5e_psp_fs *fs, int err = 0; flow_group_in = kvzalloc(inlen, GFP_KERNEL); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!flow_group_in || !spec) { err = -ENOMEM; goto out; @@ -560,7 +560,7 @@ static int accel_psp_fs_init_rx(struct mlx5e_psp_fs *fs) enum accel_fs_psp_type i; int err; - accel_psp = kzalloc_obj(*accel_psp, GFP_KERNEL); + accel_psp = kzalloc_obj(*accel_psp); if (!accel_psp) return -ENOMEM; @@ -686,7 +686,7 @@ static int accel_psp_fs_tx_create_ft_table(struct mlx5e_psp_fs *fs) struct mlx5_flow_group *fg; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); in = kvzalloc(inlen, GFP_KERNEL); if (!spec || !in) { err = -ENOMEM; @@ -815,7 +815,7 @@ static int accel_psp_fs_init_tx(struct mlx5e_psp_fs *fs) if (!ns) return -EOPNOTSUPP; - tx_fs = kzalloc_obj(*tx_fs, GFP_KERNEL); + tx_fs = kzalloc_obj(*tx_fs); if (!tx_fs) return -ENOMEM; @@ -896,7 +896,7 @@ static struct mlx5e_psp_fs *mlx5e_accel_psp_fs_init(struct mlx5e_priv *priv) struct mlx5e_psp_fs *fs; int err = 0; - fs = kzalloc_obj(*fs, GFP_KERNEL); + fs = kzalloc_obj(*fs); if (!fs) return ERR_PTR(-ENOMEM); @@ -1127,7 +1127,7 @@ int mlx5e_psp_init(struct mlx5e_priv *priv) return 0; } - psp = kzalloc_obj(*psp, GFP_KERNEL); + psp = kzalloc_obj(*psp); if (!psp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c index dbe824a62f22..c5e62d7d4908 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c @@ -260,7 +260,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, MLX5E_ARFS_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_ARFS_NUM_GROUPS); if (!ft->g) return -ENOMEM; @@ -391,7 +391,7 @@ int mlx5e_arfs_create_tables(struct mlx5e_flow_steering *fs, if (!ntuple) return 0; - arfs = kvzalloc_obj(*arfs, GFP_KERNEL); + arfs = kvzalloc_obj(*arfs); if (!arfs) return -ENOMEM; @@ -522,7 +522,7 @@ static struct mlx5_flow_handle *arfs_add_rule(struct mlx5e_priv *priv, struct mlx5_flow_table *ft; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { priv->channel_stats[arfs_rule->rxq]->rq.arfs_err++; err = -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c index 5da0a13d92f1..c2d4bae533de 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c @@ -179,7 +179,7 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev, bool create_tises) num_doorbells = min(mlx5e_get_devlink_param_num_doorbells(mdev), mlx5e_get_max_num_channels(mdev)); - res->bfregs = kzalloc_objs(*res->bfregs, num_doorbells, GFP_KERNEL); + res->bfregs = kzalloc_objs(*res->bfregs, num_doorbells); if (!res->bfregs) { err = -ENOMEM; goto err_destroy_mkey; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c index 1dd5f916597b..9352e2183312 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -295,7 +295,7 @@ static int mlx5e_add_vlan_rule(struct mlx5e_flow_steering *fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -372,7 +372,7 @@ mlx5e_add_trap_rule(struct mlx5_flow_table *ft, int trap_id, int tir_num) struct mlx5_flow_handle *rule; struct mlx5_flow_spec *spec; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); spec->flow_context.flags |= FLOW_CONTEXT_HAS_TAG; @@ -754,7 +754,7 @@ static int mlx5e_add_promisc_rule(struct mlx5e_flow_steering *fs) struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; @@ -984,7 +984,7 @@ static int mlx5e_add_l2_flow_rule(struct mlx5e_flow_steering *fs, u8 *mc_dmac; u8 *mv_dmac; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1039,7 +1039,7 @@ static int mlx5e_create_l2_table_groups(struct mlx5e_l2_table *l2_table) int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_L2_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_L2_GROUPS); if (!ft->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -1251,7 +1251,7 @@ static int mlx5e_fs_create_vlan_table(struct mlx5e_flow_steering *fs) if (IS_ERR(ft->t)) return PTR_ERR(ft->t); - ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_VLAN_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, MLX5E_NUM_VLAN_GROUPS); if (!ft->g) { err = -ENOMEM; goto err_destroy_vlan_table; @@ -1394,7 +1394,7 @@ void mlx5e_destroy_flow_steering(struct mlx5e_flow_steering *fs, bool ntuple, static int mlx5e_fs_vlan_alloc(struct mlx5e_flow_steering *fs) { - fs->vlan = kvzalloc_obj(*fs->vlan, GFP_KERNEL); + fs->vlan = kvzalloc_obj(*fs->vlan); if (!fs->vlan) return -ENOMEM; return 0; @@ -1466,7 +1466,7 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile, struct mlx5e_flow_steering *fs; int err; - fs = kvzalloc_obj(*fs, GFP_KERNEL); + fs = kvzalloc_obj(*fs); if (!fs) goto err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index d01636af3d02..aecfba7deeb0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -465,7 +465,7 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); err = set_flow_attrs(spec->match_criteria, spec->match_value, @@ -476,7 +476,7 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv, if (fs->ring_cookie == RX_CLS_FLOW_DISC) { flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP; } else { - dst = kzalloc_obj(*dst, GFP_KERNEL); + dst = kzalloc_obj(*dst); if (!dst) { err = -ENOMEM; goto free; @@ -541,7 +541,7 @@ static struct mlx5e_ethtool_rule *get_ethtool_rule(struct mlx5e_priv *priv, if (eth_rule) del_ethtool_rule(priv->fs, eth_rule); - eth_rule = kzalloc_obj(*eth_rule, GFP_KERNEL); + eth_rule = kzalloc_obj(*eth_rule); if (!eth_rule) return ERR_PTR(-ENOMEM); @@ -836,7 +836,7 @@ mlx5e_ethtool_get_all_flows(struct mlx5e_priv *priv, int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool) { - *ethtool = kvzalloc_obj(**ethtool, GFP_KERNEL); + *ethtool = kvzalloc_obj(**ethtool); if (!*ethtool) return -ENOMEM; return 0; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 41edda3d0c70..e844ffa4d6b7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2791,7 +2791,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, return err; c = kvzalloc_node(sizeof(*c), GFP_KERNEL, cpu_to_node(cpu)); - cparam = kvzalloc_obj(*cparam, GFP_KERNEL); + cparam = kvzalloc_obj(*cparam); if (!c || !cparam) { err = -ENOMEM; goto err_free; @@ -2911,7 +2911,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv, chs->num = chs->params.num_channels; - chs->c = kzalloc_objs(struct mlx5e_channel *, chs->num, GFP_KERNEL); + chs->c = kzalloc_objs(struct mlx5e_channel *, chs->num); if (!chs->c) goto err_out; @@ -3415,8 +3415,8 @@ int mlx5e_safe_switch_params(struct mlx5e_priv *priv, if (!reset) return mlx5e_switch_priv_params(priv, params, preactivate, context); - old_chs = kzalloc_obj(*old_chs, GFP_KERNEL); - new_chs = kzalloc_obj(*new_chs, GFP_KERNEL); + old_chs = kzalloc_obj(*old_chs); + new_chs = kzalloc_obj(*new_chs); if (!old_chs || !new_chs) { err = -ENOMEM; goto err_free_chs; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index b0bc37669305..1db4ecb2356f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -476,7 +476,7 @@ static int mlx5e_sqs2vport_add_peers_rules(struct mlx5_eswitch *esw, struct mlx5 struct mlx5e_rep_sq_peer *sq_peer; int err; - sq_peer = kzalloc_obj(*sq_peer, GFP_KERNEL); + sq_peer = kzalloc_obj(*sq_peer); if (!sq_peer) return -ENOMEM; @@ -521,7 +521,7 @@ static int mlx5e_sqs2vport_start(struct mlx5_eswitch *esw, devcom_locked = true; for (i = 0; i < sqns_num; i++) { - rep_sq = kzalloc_obj(*rep_sq, GFP_KERNEL); + rep_sq = kzalloc_obj(*rep_sq); if (!rep_sq) { err = -ENOMEM; goto out_err; @@ -1621,7 +1621,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) struct mlx5e_rep_priv *rpriv; int err; - rpriv = kvzalloc_obj(*rpriv, GFP_KERNEL); + rpriv = kvzalloc_obj(*rpriv); if (!rpriv) return -ENOMEM; @@ -1731,7 +1731,7 @@ static int mlx5e_vport_rep_event_pair(struct mlx5_eswitch *esw, sq_peer->peer = peer_esw; continue; } - sq_peer = kzalloc_obj(*sq_peer, GFP_KERNEL); + sq_peer = kzalloc_obj(*sq_peer); if (!sq_peer) { err = -ENOMEM; goto err_sq_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c index 4066778f702d..accc26d1a872 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c @@ -270,7 +270,7 @@ static int mlx5e_test_loopback(struct mlx5e_priv *priv) return -ENODEV; } - lbtp = kzalloc_obj(*lbtp, GFP_KERNEL); + lbtp = kzalloc_obj(*lbtp); if (!lbtp) return -ENOMEM; lbtp->loopback_ok = false; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 761cfd2d95f1..1434b65d4746 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -153,7 +153,7 @@ struct mlx5e_tc_table *mlx5e_tc_table_alloc(void) { struct mlx5e_tc_table *tc; - tc = kvzalloc_obj(*tc, GFP_KERNEL); + tc = kvzalloc_obj(*tc); return tc ? tc : ERR_PTR(-ENOMEM); } @@ -905,7 +905,7 @@ mlx5e_hairpin_create(struct mlx5e_priv *priv, struct mlx5_hairpin_params *params struct mlx5_hairpin *pair; int err; - hp = kzalloc_obj(*hp, GFP_KERNEL); + hp = kzalloc_obj(*hp); if (!hp) return ERR_PTR(-ENOMEM); @@ -1139,7 +1139,7 @@ static int mlx5e_hairpin_flow_add(struct mlx5e_priv *priv, goto attach_flow; } - hpe = kzalloc_obj(*hpe, GFP_KERNEL); + hpe = kzalloc_obj(*hpe); if (!hpe) { mutex_unlock(&tc->hairpin_tbl_lock); return -ENOMEM; @@ -1794,7 +1794,7 @@ extra_split_attr_dests(struct mlx5e_tc_flow *flow, return PTR_ERR(post_act); attr2 = mlx5_alloc_flow_attr(mlx5e_get_flow_namespace(flow)); - parse_attr2 = kvzalloc_obj(*parse_attr, GFP_KERNEL); + parse_attr2 = kvzalloc_obj(*parse_attr); if (!attr2 || !parse_attr2) { err = -ENOMEM; goto err_free; @@ -2570,7 +2570,7 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, } else if (tunnel) { struct mlx5_flow_spec *tmp_spec; - tmp_spec = kvzalloc_obj(*tmp_spec, GFP_KERNEL); + tmp_spec = kvzalloc_obj(*tmp_spec); if (!tmp_spec) { NL_SET_ERR_MSG_MOD(extack, "Failed to allocate memory for tunnel tmp spec"); netdev_warn(priv->netdev, "Failed to allocate memory for tunnel tmp spec"); @@ -3671,7 +3671,7 @@ mlx5e_clone_flow_attr_for_post_act(struct mlx5_flow_attr *attr, struct mlx5_flow_attr *attr2; attr2 = mlx5_alloc_flow_attr(ns_type); - parse_attr = kvzalloc_obj(*parse_attr, GFP_KERNEL); + parse_attr = kvzalloc_obj(*parse_attr); if (!attr2 || !parse_attr) { kvfree(parse_attr); kfree(attr2); @@ -4448,8 +4448,8 @@ mlx5e_alloc_flow(struct mlx5e_priv *priv, int attr_size, int err = -ENOMEM; int out_index; - flow = kzalloc_obj(*flow, GFP_KERNEL); - parse_attr = kvzalloc_obj(*parse_attr, GFP_KERNEL); + flow = kzalloc_obj(*flow); + parse_attr = kvzalloc_obj(*parse_attr); if (!parse_attr || !flow) goto err_free; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index cc679500b3dc..22a637111aa2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -881,7 +881,7 @@ static int comp_irq_request_sf(struct mlx5_core_dev *dev, u16 vecidx) if (!mlx5_irq_pool_is_sf_pool(pool)) return comp_irq_request_pci(dev, vecidx); - af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc); if (!af_desc) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c index a95d12860fed..ba5cce706ea2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/helper.c @@ -58,7 +58,7 @@ int esw_egress_acl_vlan_create(struct mlx5_eswitch *esw, if (vport->egress.allowed_vlan) return -EEXIST; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c index f8ca68ea685e..4410e57acfc7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c @@ -200,7 +200,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, "vport[%d] configure ingress rules, vlan(%d) qos(%d)\n", vport->vport, vport->info.vlan, vport->info.qos); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c index 4ffaa7b4b5b1..197324788799 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c @@ -29,7 +29,7 @@ static int esw_acl_ingress_prio_tag_create(struct mlx5_eswitch *esw, * required, allow * Unmatched traffic is allowed by default */ - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c index b9e9505ff76e..87b5fd349594 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c @@ -586,7 +586,7 @@ mlx5_esw_bridge_ingress_flow_with_esw_create(u16 vport_num, const unsigned char struct mlx5_flow_handle *handle; u8 *smac_v, *smac_c; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -700,7 +700,7 @@ mlx5_esw_bridge_ingress_filter_flow_create(u16 vport_num, const unsigned char *a struct mlx5_flow_handle *handle; u8 *smac_v, *smac_c; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -753,7 +753,7 @@ mlx5_esw_bridge_egress_flow_create(u16 vport_num, u16 esw_owner_vhca_id, const u struct mlx5_flow_handle *handle; u8 *dmac_v, *dmac_c; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -821,7 +821,7 @@ mlx5_esw_bridge_egress_miss_flow_create(struct mlx5_flow_table *egress_ft, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -844,7 +844,7 @@ static struct mlx5_esw_bridge *mlx5_esw_bridge_create(struct net_device *br_netd struct mlx5_esw_bridge *bridge; int err; - bridge = kvzalloc_obj(*bridge, GFP_KERNEL); + bridge = kvzalloc_obj(*bridge); if (!bridge) return ERR_PTR(-ENOMEM); @@ -1179,7 +1179,7 @@ mlx5_esw_bridge_vlan_create(u16 vlan_proto, u16 vid, u16 flags, struct mlx5_esw_ struct mlx5_esw_bridge_vlan *vlan; int err; - vlan = kvzalloc_obj(*vlan, GFP_KERNEL); + vlan = kvzalloc_obj(*vlan); if (!vlan) return ERR_PTR(-ENOMEM); @@ -1365,7 +1365,7 @@ mlx5_esw_bridge_fdb_entry_init(struct net_device *dev, u16 vport_num, u16 esw_ow if (entry) mlx5_esw_bridge_fdb_entry_notify_and_cleanup(entry, bridge); - entry = kvzalloc_obj(*entry, GFP_KERNEL); + entry = kvzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -1550,7 +1550,7 @@ static int mlx5_esw_bridge_vport_init(u16 vport_num, u16 esw_owner_vhca_id, u16 struct mlx5_esw_bridge_port *port; int err; - port = kvzalloc_obj(*port, GFP_KERNEL); + port = kvzalloc_obj(*port); if (!port) return -ENOMEM; @@ -1924,7 +1924,7 @@ struct mlx5_esw_bridge_offloads *mlx5_esw_bridge_init(struct mlx5_eswitch *esw) ASSERT_RTNL(); - br_offloads = kvzalloc_obj(*br_offloads, GFP_KERNEL); + br_offloads = kvzalloc_obj(*br_offloads); if (!br_offloads) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c index 15e5a05f5dd8..092cd62a9137 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c @@ -65,11 +65,11 @@ mlx5_esw_bridge_mdb_flow_create(u16 esw_owner_vhca_id, struct mlx5_esw_bridge_md u8 *dmac_v, *dmac_c; unsigned long idx; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); - dests = kvzalloc_objs(*dests, num_dests, GFP_KERNEL); + dests = kvzalloc_objs(*dests, num_dests); if (!dests) { kvfree(rule_spec); return ERR_PTR(-ENOMEM); @@ -152,7 +152,7 @@ mlx5_esw_bridge_port_mdb_entry_init(struct mlx5_esw_bridge_port *port, struct mlx5_esw_bridge_mdb_entry *entry; int err; - entry = kvzalloc_obj(*entry, GFP_KERNEL); + entry = kvzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -516,7 +516,7 @@ mlx5_esw_bridge_mcast_flow_with_esw_create(struct mlx5_esw_bridge_port *port, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -584,7 +584,7 @@ mlx5_esw_bridge_mcast_vlan_flow_create(u16 vlan_proto, struct mlx5_esw_bridge_po struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -656,7 +656,7 @@ mlx5_esw_bridge_mcast_fwd_flow_create(struct mlx5_esw_bridge_port *port) struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -890,7 +890,7 @@ mlx5_esw_bridge_ingress_igmp_fh_create(struct mlx5_flow_table *ingress_ft, struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); @@ -922,7 +922,7 @@ mlx5_esw_bridge_ingress_mld_fh_create(u8 type, struct mlx5_flow_table *ingress_f struct mlx5_flow_spec *rule_spec; struct mlx5_flow_handle *handle; - rule_spec = kvzalloc_obj(*rule_spec, GFP_KERNEL); + rule_spec = kvzalloc_obj(*rule_spec); if (!rule_spec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c index 0b8bb42af33f..8bffba85f21f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c @@ -70,7 +70,7 @@ int mlx5_esw_offloads_pf_vf_devlink_port_init(struct mlx5_eswitch *esw, if (!mlx5_esw_devlink_port_supported(esw, vport_num)) return 0; - dl_port = kzalloc_obj(*dl_port, GFP_KERNEL); + dl_port = kzalloc_obj(*dl_port); if (!dl_port) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c index 1a135c3e48df..b80999608f8d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c @@ -46,7 +46,7 @@ struct mlx5_esw_indir_table { struct mlx5_esw_indir_table * mlx5_esw_indir_table_init(void) { - struct mlx5_esw_indir_table *indir = kvzalloc_obj(*indir, GFP_KERNEL); + struct mlx5_esw_indir_table *indir = kvzalloc_obj(*indir); if (!indir) return ERR_PTR(-ENOMEM); @@ -111,7 +111,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw, return 0; } - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return -ENOMEM; @@ -258,7 +258,7 @@ mlx5_esw_indir_table_entry_create(struct mlx5_eswitch *esw, struct mlx5_flow_att if (!root_ns) return ERR_PTR(-ENOENT); - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c index 0ee931bca98b..7c62f7938bfb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c @@ -259,7 +259,7 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw, if (err) return err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c index 2f9e59790584..c490a0287bff 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c @@ -38,7 +38,7 @@ static struct mlx5_qos_domain *esw_qos_domain_alloc(void) { struct mlx5_qos_domain *qos_domain; - qos_domain = kzalloc_obj(*qos_domain, GFP_KERNEL); + qos_domain = kzalloc_obj(*qos_domain); if (!qos_domain) return NULL; @@ -518,7 +518,7 @@ __esw_qos_alloc_node(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_node_type { struct mlx5_esw_sched_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c index 5628182faf57..ad2b9edbc0b9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c @@ -96,7 +96,7 @@ mlx5_esw_vporttbl_get(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr goto out; } - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { fdb = ERR_PTR(-ENOMEM); goto err_alloc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index d31a74ae1dd7..d3af87a94a18 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -221,7 +221,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u16 vport, bool rx_rule, if (rx_rule) match_header |= MLX5_MATCH_MISC_PARAMETERS; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return NULL; @@ -1862,7 +1862,7 @@ int mlx5_esw_vport_alloc(struct mlx5_eswitch *esw, int index, u16 vport_num) struct mlx5_vport *vport; int err; - vport = kzalloc_obj(*vport, GFP_KERNEL); + vport = kzalloc_obj(*vport); if (!vport) return -ENOMEM; @@ -2022,7 +2022,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) if (!MLX5_VPORT_MANAGER(dev) && !MLX5_ESWITCH_MANAGER(dev)) return 0; - esw = kzalloc_obj(*esw, GFP_KERNEL); + esw = kzalloc_obj(*esw); if (!esw) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 1693f2dd5d6a..82d4c14fdca0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -680,7 +680,7 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, if (!esw_flow_dests_fwd_ipsec_check(esw, esw_attr)) return ERR_PTR(-EOPNOTSUPP); - dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1, GFP_KERNEL); + dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1); if (!dest) return ERR_PTR(-ENOMEM); @@ -808,7 +808,7 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw, struct mlx5_flow_handle *rule; int i, err = 0; - dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1, GFP_KERNEL); + dest = kzalloc_objs(*dest, MLX5_MAX_FLOW_FWD_VPORTS + 1); if (!dest) return ERR_PTR(-ENOMEM); @@ -947,7 +947,7 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *on_esw, void *misc; u16 vport; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { flow_rule = ERR_PTR(-ENOMEM); goto out; @@ -1044,7 +1044,7 @@ mlx5_eswitch_add_send_to_vport_meta_rule(struct mlx5_eswitch *esw, u16 vport_num struct mlx5_flow_handle *flow_rule; struct mlx5_flow_spec *spec; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -1198,13 +1198,13 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw, !mlx5_core_is_ecpf_esw_manager(peer_dev)) return 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; peer_miss_rules_setup(esw, peer_dev, spec, &dest); - flows = kvzalloc_objs(*flows, peer_esw->total_vports, GFP_KERNEL); + flows = kvzalloc_objs(*flows, peer_esw->total_vports); if (!flows) { err = -ENOMEM; goto alloc_flows_err; @@ -1368,7 +1368,7 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw) u8 *dmac_c; u8 *dmac_v; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { err = -ENOMEM; goto out; @@ -1430,7 +1430,7 @@ esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag) if (!mlx5_eswitch_reg_c1_loopback_supported(esw)) return ERR_PTR(-EOPNOTSUPP); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -2148,7 +2148,7 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport, struct mlx5_flow_handle *flow_rule; struct mlx5_flow_spec *spec; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { flow_rule = ERR_PTR(-ENOMEM); goto out; @@ -2525,7 +2525,7 @@ int mlx5_esw_offloads_rep_add(struct mlx5_eswitch *esw, int rep_type; int err; - rep = kzalloc_obj(*rep, GFP_KERNEL); + rep = kzalloc_obj(*rep); if (!rep) return -ENOMEM; @@ -2861,7 +2861,7 @@ static int __esw_set_master_egress_rule(struct mlx5_core_dev *master, int err = 0; void *misc; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -4470,7 +4470,7 @@ int mlx5_esw_vport_vhca_id_map(struct mlx5_eswitch *esw, } vhca_id = vport->vhca_id; - vhca_map_entry = kmalloc_obj(*vhca_map_entry, GFP_KERNEL); + vhca_map_entry = kmalloc_obj(*vhca_map_entry); if (!vhca_map_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c index af82232d53ef..19f65d4c4def 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c @@ -132,7 +132,7 @@ mlx5_eswitch_termtbl_get_create(struct mlx5_eswitch *esw, if (found) goto tt_add_ref; - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); if (!tt) { err = -ENOMEM; goto tt_create_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c index 23ecc8e8a219..4d7f35b96876 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/events.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c @@ -374,7 +374,7 @@ static int forward_event(struct notifier_block *nb, unsigned long event, void *d int mlx5_events_init(struct mlx5_core_dev *dev) { - struct mlx5_events *events = kzalloc_obj(*events, GFP_KERNEL); + struct mlx5_events *events = kzalloc_obj(*events); if (!events) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c index 2b029dc3f0c8..3f5d16875b34 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c @@ -814,7 +814,7 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev, if (!attr->recv_cb) return ERR_PTR(-EINVAL); - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c index ae87ca14cae4..4f0046cf6a1a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c @@ -59,7 +59,7 @@ static struct mlx5_fpga_device *mlx5_fpga_device_alloc(void) { struct mlx5_fpga_device *fdev; - fdev = kzalloc_obj(*fdev, GFP_KERNEL); + fdev = kzalloc_obj(*fdev); if (!fdev) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 80950d84d07a..4678c2c93423 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -947,7 +947,7 @@ alloc_flow_table(struct mlx5_flow_table_attr *ft_attr, u16 vport, struct mlx5_flow_table *ft; int ret; - ft = kzalloc_obj(*ft, GFP_KERNEL); + ft = kzalloc_obj(*ft); if (!ft) return ERR_PTR(-ENOMEM); @@ -1530,7 +1530,7 @@ static struct mlx5_flow_rule *alloc_rule(struct mlx5_flow_destination *dest) { struct mlx5_flow_rule *rule; - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return NULL; @@ -2178,7 +2178,7 @@ add_rule_dup_match_fte(struct fs_fte *fte, int i = 0; if (!fte->dup) { - dup = kvzalloc_obj(*dup, GFP_KERNEL); + dup = kvzalloc_obj(*dup); if (!dup) return ERR_PTR(-ENOMEM); /* dup will be freed when the fte is freed @@ -2471,7 +2471,7 @@ mlx5_add_flow_rules(struct mlx5_flow_table *ft, goto unlock; } - gen_dest = kzalloc_objs(*dest, num_dest + 1, GFP_KERNEL); + gen_dest = kzalloc_objs(*dest, num_dest + 1); if (!gen_dest) { handle = ERR_PTR(-ENOMEM); goto unlock; @@ -2848,7 +2848,7 @@ static struct fs_prio *_fs_create_prio(struct mlx5_flow_namespace *ns, { struct fs_prio *fs_prio; - fs_prio = kzalloc_obj(*fs_prio, GFP_KERNEL); + fs_prio = kzalloc_obj(*fs_prio); if (!fs_prio) return ERR_PTR(-ENOMEM); @@ -2888,7 +2888,7 @@ static struct mlx5_flow_namespace *fs_create_namespace(struct fs_prio *prio, { struct mlx5_flow_namespace *ns; - ns = kzalloc_obj(*ns, GFP_KERNEL); + ns = kzalloc_obj(*ns); if (!ns) return ERR_PTR(-ENOMEM); @@ -3019,7 +3019,7 @@ static struct mlx5_flow_root_namespace struct mlx5_flow_namespace *ns; /* Create the root namespace */ - root_ns = kzalloc_obj(*root_ns, GFP_KERNEL); + root_ns = kzalloc_obj(*root_ns); if (!root_ns) return NULL; @@ -3670,7 +3670,7 @@ mlx5_fs_add_vport_acl_root_ns(struct mlx5_flow_steering *steering, if (xa_load(esw_acl_root_ns, vport_idx)) return -EEXIST; - vport_ns = kzalloc_obj(*vport_ns, GFP_KERNEL); + vport_ns = kzalloc_obj(*vport_ns); if (!vport_ns) return -ENOMEM; @@ -3989,7 +3989,7 @@ int mlx5_fs_core_alloc(struct mlx5_core_dev *dev) if (err) goto err; - steering = kzalloc_obj(*steering, GFP_KERNEL); + steering = kzalloc_obj(*steering); if (!steering) { err = -ENOMEM; goto err; @@ -4030,7 +4030,7 @@ int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn) struct mlx5_ft_underlay_qp *new_uqp; int err = 0; - new_uqp = kzalloc_obj(*new_uqp, GFP_KERNEL); + new_uqp = kzalloc_obj(*new_uqp); if (!new_uqp) return -ENOMEM; @@ -4133,7 +4133,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - modify_hdr = kzalloc_obj(*modify_hdr, GFP_KERNEL); + modify_hdr = kzalloc_obj(*modify_hdr); if (!modify_hdr) return ERR_PTR(-ENOMEM); @@ -4174,7 +4174,7 @@ struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - pkt_reformat = kzalloc_obj(*pkt_reformat, GFP_KERNEL); + pkt_reformat = kzalloc_obj(*pkt_reformat); if (!pkt_reformat) return ERR_PTR(-ENOMEM); @@ -4222,7 +4222,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev, if (!root) return ERR_PTR(-EOPNOTSUPP); - definer = kzalloc_obj(*definer, GFP_KERNEL); + definer = kzalloc_obj(*definer); if (!definer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c index b2b3a12493f4..653faec72da5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c @@ -234,11 +234,11 @@ static struct mlx5_fc *mlx5_fc_single_alloc(struct mlx5_core_dev *dev) struct mlx5_fc *counter; int err; - counter = kzalloc_obj(*counter, GFP_KERNEL); + counter = kzalloc_obj(*counter); if (!counter) return ERR_PTR(-ENOMEM); - fc_bulk = kzalloc_obj(*fc_bulk, GFP_KERNEL); + fc_bulk = kzalloc_obj(*fc_bulk); if (!fc_bulk) { err = -ENOMEM; goto free_counter; @@ -328,7 +328,7 @@ int mlx5_init_fc_stats(struct mlx5_core_dev *dev) { struct mlx5_fc_stats *fc_stats; - fc_stats = kzalloc_obj(*fc_stats, GFP_KERNEL); + fc_stats = kzalloc_obj(*fc_stats); if (!fc_stats) return -ENOMEM; dev->priv.fc_stats = fc_stats; @@ -572,10 +572,10 @@ mlx5_fc_local_create(u32 counter_id, u32 offset, u32 bulk_size) struct mlx5_fc_bulk *fc_bulk; struct mlx5_fc *counter; - counter = kzalloc_obj(*counter, GFP_KERNEL); + counter = kzalloc_obj(*counter); if (!counter) return ERR_PTR(-ENOMEM); - fc_bulk = kzalloc_obj(*fc_bulk, GFP_KERNEL); + fc_bulk = kzalloc_obj(*fc_bulk); if (!fc_bulk) { kfree(counter); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c index 847e940d4d70..fbe11d5a1603 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c @@ -26,7 +26,7 @@ int mlx5_ft_pool_init(struct mlx5_core_dev *dev) struct mlx5_ft_pool *ft_pool; int i; - ft_pool = kzalloc_obj(*ft_pool, GFP_KERNEL); + ft_pool = kzalloc_obj(*ft_pool); if (!ft_pool) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c index c0e23bc2d96a..07440c58713a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -899,7 +899,7 @@ int mlx5_fw_reset_init(struct mlx5_core_dev *dev) if (!MLX5_CAP_MCAM_REG(dev, mfrl)) return 0; - fw_reset = kzalloc_obj(*fw_reset, GFP_KERNEL); + fw_reset = kzalloc_obj(*fw_reset); if (!fw_reset) return -ENOMEM; fw_reset->wq = create_singlethread_workqueue("mlx5_fw_reset_events"); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c index ab005d7d184b..189d87bd6de4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c @@ -298,7 +298,7 @@ static struct mlx5_hwmon *mlx5_hwmon_alloc(struct mlx5_core_dev *mdev) u32 sensors_count; int err; - hwmon = kzalloc_obj(*mdev->hwmon, GFP_KERNEL); + hwmon = kzalloc_obj(*mdev->hwmon); if (!hwmon) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c index 96a75b8ef779..4120afd097c3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c @@ -51,7 +51,7 @@ int mlx5i_pkey_qpn_ht_init(struct net_device *netdev) struct mlx5i_priv *ipriv = netdev_priv(netdev); struct mlx5i_pkey_qpn_ht *qpn_htbl; - qpn_htbl = kzalloc_obj(*qpn_htbl, GFP_KERNEL); + qpn_htbl = kzalloc_obj(*qpn_htbl); if (!qpn_htbl) return -ENOMEM; @@ -89,7 +89,7 @@ int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn) u8 key = hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP); struct qpn_to_netdev *new_node; - new_node = kzalloc_obj(*new_node, GFP_KERNEL); + new_node = kzalloc_obj(*new_node); if (!new_node) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c index 0be0b614938c..994fe83da4be 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c @@ -52,7 +52,7 @@ irq_pool_request_irq(struct mlx5_irq_pool *pool, struct irq_affinity_desc *af_de u32 irq_index; int err; - auto_desc = kvzalloc_obj(*auto_desc, GFP_KERNEL); + auto_desc = kvzalloc_obj(*auto_desc); if (!auto_desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c index 0eed75f5ccc2..c326adb0c789 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c @@ -272,7 +272,7 @@ static struct mlx5_lag *mlx5_lag_dev_alloc(struct mlx5_core_dev *dev) struct mlx5_lag *ldev; int err; - ldev = kzalloc_obj(*ldev, GFP_KERNEL); + ldev = kzalloc_obj(*ldev); if (!ldev) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c index d3458adcc1e5..24a91e7a20e2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c @@ -171,7 +171,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev, if (!ldev) return 0; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); if (!work) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c index 63071fcb3a51..16c7d16215c4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c @@ -308,7 +308,7 @@ mlx5_lag_create_definer(struct mlx5_lag *ldev, enum netdev_lag_hash hash, return ERR_PTR(-EINVAL); dev = ldev->pf[first_idx].dev; - lag_definer = kzalloc_obj(*lag_definer, GFP_KERNEL); + lag_definer = kzalloc_obj(*lag_definer); if (!lag_definer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c index 004077710a34..614cd57a40d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c @@ -311,7 +311,7 @@ struct mlx5_aso *mlx5_aso_create(struct mlx5_core_dev *mdev, u32 pdn) struct mlx5_aso *aso; int err; - aso = kzalloc_obj(*aso, GFP_KERNEL); + aso = kzalloc_obj(*aso); if (!aso) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c index 6067d3ac3cb8..6ccffd6bc1f3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -1406,7 +1406,7 @@ static int mlx5_clock_alloc(struct mlx5_core_dev *mdev, bool shared) struct mlx5_clock_priv *cpriv; struct mlx5_clock *clock; - cpriv = kzalloc_obj(*cpriv, GFP_KERNEL); + cpriv = kzalloc_obj(*cpriv); if (!cpriv) return -ENOMEM; @@ -1603,7 +1603,7 @@ int mlx5_init_clock(struct mlx5_core_dev *mdev) return 0; } - clock_state = kzalloc_obj(*clock_state, GFP_KERNEL); + clock_state = kzalloc_obj(*clock_state); if (!clock_state) return -ENOMEM; clock_state->mdev = mdev; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c index b47e828406f9..1c3607c5fa93 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c @@ -293,7 +293,7 @@ mlx5_crypto_dek_bulk_create(struct mlx5_crypto_dek_pool *pool) int num_deks, base_obj_id; int err; - bulk = kzalloc_obj(*bulk, GFP_KERNEL); + bulk = kzalloc_obj(*bulk); if (!bulk) return ERR_PTR(-ENOMEM); @@ -611,7 +611,7 @@ struct mlx5_crypto_dek *mlx5_crypto_dek_create(struct mlx5_crypto_dek_pool *dek_ int obj_offset; int err; - dek = kzalloc_obj(*dek, GFP_KERNEL); + dek = kzalloc_obj(*dek); if (!dek) return ERR_PTR(-ENOMEM); @@ -683,7 +683,7 @@ mlx5_crypto_dek_pool_create(struct mlx5_core_dev *mdev, int key_purpose) { struct mlx5_crypto_dek_pool *pool; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); @@ -748,7 +748,7 @@ struct mlx5_crypto_dek_priv *mlx5_crypto_dek_init(struct mlx5_core_dev *mdev) if (!MLX5_CAP_CRYPTO(mdev, log_dek_max_alloc)) return NULL; - dek_priv = kzalloc_obj(*dek_priv, GFP_KERNEL); + dek_priv = kzalloc_obj(*dek_priv); if (!dek_priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c index d681c063be4e..4b5ac2db55ce 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c @@ -64,7 +64,7 @@ mlx5_devcom_dev_alloc(struct mlx5_core_dev *dev) { struct mlx5_devcom_dev *devc; - devc = kzalloc_obj(*devc, GFP_KERNEL); + devc = kzalloc_obj(*devc); if (!devc) return NULL; @@ -120,7 +120,7 @@ mlx5_devcom_comp_alloc(u64 id, const struct mlx5_devcom_match_attr *attr, { struct mlx5_devcom_comp *comp; - comp = kzalloc_obj(*comp, GFP_KERNEL); + comp = kzalloc_obj(*comp); if (!comp) return NULL; @@ -158,7 +158,7 @@ devcom_alloc_comp_dev(struct mlx5_devcom_dev *devc, { struct mlx5_devcom_comp_dev *devcom; - devcom = kzalloc_obj(*devcom, GFP_KERNEL); + devcom = kzalloc_obj(*devcom); if (!devcom) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c index b6fc7ca4bcc0..c7438b727823 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c @@ -28,7 +28,7 @@ struct mlx5_dm *mlx5_dm_create(struct mlx5_core_dev *dev) if (!(MLX5_CAP_GEN_64(dev, general_obj_types) & MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM)) return NULL; - dm = kzalloc_obj(*dm, GFP_KERNEL); + dm = kzalloc_obj(*dm); if (!dm) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c index d8242edec30f..684cd9b5ffde 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c @@ -314,7 +314,7 @@ mlx5_chains_create_chain(struct mlx5_fs_chains *chains, u32 chain) struct fs_chain *chain_s = NULL; int err; - chain_s = kvzalloc_obj(*chain_s, GFP_KERNEL); + chain_s = kvzalloc_obj(*chain_s); if (!chain_s) return ERR_PTR(-ENOMEM); @@ -481,7 +481,7 @@ mlx5_chains_create_prio(struct mlx5_fs_chains *chains, if (IS_ERR(chain_s)) return ERR_CAST(chain_s); - prio_s = kvzalloc_obj(*prio_s, GFP_KERNEL); + prio_s = kvzalloc_obj(*prio_s); flow_group_in = kvzalloc(inlen, GFP_KERNEL); if (!prio_s || !flow_group_in) { err = -ENOMEM; @@ -728,7 +728,7 @@ mlx5_chains_init(struct mlx5_core_dev *dev, struct mlx5_chains_attr *attr) struct mlx5_fs_chains *chains; int err; - chains = kzalloc_obj(*chains, GFP_KERNEL); + chains = kzalloc_obj(*chains); if (!chains) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c index feed745cddab..14c339d02e99 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c @@ -359,7 +359,7 @@ mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -536,7 +536,7 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc, int err; u8 *mc; - ttc->g = kzalloc_objs(*ttc->g, groups->num_groups, GFP_KERNEL); + ttc->g = kzalloc_objs(*ttc->g, groups->num_groups); if (!ttc->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -630,7 +630,7 @@ mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev, int err = 0; u8 ipv; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -713,7 +713,7 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc, int err; u8 *mc; - ttc->g = kzalloc_objs(*ttc->g, groups->num_groups, GFP_KERNEL); + ttc->g = kzalloc_objs(*ttc->g, groups->num_groups); if (!ttc->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -804,7 +804,7 @@ struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev, return ERR_PTR(-EINVAL); } - ttc = kvzalloc_obj(*ttc, GFP_KERNEL); + ttc = kvzalloc_obj(*ttc); if (!ttc) return ERR_PTR(-ENOMEM); @@ -882,7 +882,7 @@ struct mlx5_ttc_table *mlx5_create_ttc_table(struct mlx5_core_dev *dev, return ERR_PTR(-EINVAL); } - ttc = kvzalloc_obj(*ttc, GFP_KERNEL); + ttc = kvzalloc_obj(*ttc); if (!ttc) return ERR_PTR(-ENOMEM); @@ -1029,7 +1029,7 @@ mlx5_ttc_create_ipsec_outer_rule(struct mlx5_ttc_table *ttc, if (err) return ERR_PTR(err); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); @@ -1070,7 +1070,7 @@ mlx5_ttc_create_ipsec_inner_rule(struct mlx5_ttc_table *ttc, if (err) return ERR_PTR(err); - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c index 7664a74cbf18..b90fea2b5d53 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c @@ -134,7 +134,7 @@ void mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) struct mlx5_geneve *mlx5_geneve_create(struct mlx5_core_dev *mdev) { - struct mlx5_geneve *geneve = kzalloc_obj(*geneve, GFP_KERNEL); + struct mlx5_geneve *geneve = kzalloc_obj(*geneve); if (!geneve) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c index 6b3f906653bd..d6dc7bce855e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c @@ -42,7 +42,7 @@ struct mlx5_hv_vhca *mlx5_hv_vhca_create(struct mlx5_core_dev *dev) { struct mlx5_hv_vhca *hv_vhca; - hv_vhca = kzalloc_obj(*hv_vhca, GFP_KERNEL); + hv_vhca = kzalloc_obj(*hv_vhca); if (!hv_vhca) return ERR_PTR(-ENOMEM); @@ -152,7 +152,7 @@ mlx5_hv_vhca_control_agent_invalidate(struct mlx5_hv_vhca_agent *agent, u32 capabilities = 0; int err; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return; @@ -273,7 +273,7 @@ mlx5_hv_vhca_agent_create(struct mlx5_hv_vhca *hv_vhca, } mutex_unlock(&hv_vhca->agents_lock); - agent = kzalloc_obj(*agent, GFP_KERNEL); + agent = kzalloc_obj(*agent); if (!agent) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c index ddde75bd3012..28cb670ba33e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c @@ -139,7 +139,7 @@ ipsec_fs_roce_rx_rule_setup(struct mlx5_core_dev *mdev, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -242,7 +242,7 @@ static int ipsec_fs_roce_tx_mpv_rule_setup(struct mlx5_core_dev *mdev, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -850,7 +850,7 @@ struct mlx5_ipsec_fs *mlx5_ipsec_fs_roce_init(struct mlx5_core_dev *mdev, return NULL; } - roce_ipsec = kzalloc_obj(*roce_ipsec, GFP_KERNEL); + roce_ipsec = kzalloc_obj(*roce_ipsec); if (!roce_ipsec) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c index eafd6bcf1675..efc5167493c1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c @@ -267,7 +267,7 @@ static int macsec_fs_tx_create_crypto_table_groups(struct mlx5_macsec_flow_table int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, TX_CRYPTO_TABLE_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, TX_CRYPTO_TABLE_NUM_GROUPS); if (!ft->g) return -ENOMEM; in = kvzalloc(inlen, GFP_KERNEL); @@ -404,7 +404,7 @@ static int macsec_fs_tx_create(struct mlx5_macsec_fs *macsec_fs) if (!ns) return -ENOMEM; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -713,7 +713,7 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id, rcu_read_unlock(); } - fs_id_iter = kzalloc_obj(*fs_id_iter, GFP_KERNEL); + fs_id_iter = kzalloc_obj(*fs_id_iter); if (!fs_id_iter) return -ENOMEM; @@ -725,7 +725,7 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id, } if (!macsec_device) { /* first time adding a SA to that device */ - macsec_device = kzalloc_obj(*macsec_device, GFP_KERNEL); + macsec_device = kzalloc_obj(*macsec_device); if (!macsec_device) { err = -ENOMEM; goto err_alloc_dev; @@ -813,7 +813,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs, tx_tables = &tx_fs->tables; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return NULL; @@ -821,7 +821,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs, if (err) goto out_spec; - macsec_rule = kzalloc_obj(*macsec_rule, GFP_KERNEL); + macsec_rule = kzalloc_obj(*macsec_rule); if (!macsec_rule) { macsec_fs_tx_ft_put(macsec_fs); goto out_spec; @@ -931,7 +931,7 @@ static int macsec_fs_tx_init(struct mlx5_macsec_fs *macsec_fs) struct mlx5_fc *flow_counter; int err; - tx_fs = kzalloc_obj(*tx_fs, GFP_KERNEL); + tx_fs = kzalloc_obj(*tx_fs); if (!tx_fs) return -ENOMEM; @@ -1055,7 +1055,7 @@ static int macsec_fs_rx_create_crypto_table_groups(struct mlx5_macsec_flow_table int err; u8 *mc; - ft->g = kzalloc_objs(*ft->g, RX_CRYPTO_TABLE_NUM_GROUPS, GFP_KERNEL); + ft->g = kzalloc_objs(*ft->g, RX_CRYPTO_TABLE_NUM_GROUPS); if (!ft->g) return -ENOMEM; @@ -1327,7 +1327,7 @@ static int macsec_fs_rx_roce_jump_to_rdma_rules_create(struct mlx5_macsec_fs *ma struct mlx5_flow_spec *spec; int err; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1510,7 +1510,7 @@ static int macsec_fs_rx_create(struct mlx5_macsec_fs *macsec_fs) if (!ns) return -ENOMEM; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -1739,7 +1739,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs, struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return NULL; @@ -1747,7 +1747,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs, if (err) goto out_spec; - macsec_rule = kzalloc_obj(*macsec_rule, GFP_KERNEL); + macsec_rule = kzalloc_obj(*macsec_rule); if (!macsec_rule) { macsec_fs_rx_ft_put(macsec_fs); goto out_spec; @@ -1847,7 +1847,7 @@ static int macsec_fs_rx_init(struct mlx5_macsec_fs *macsec_fs) struct mlx5_fc *flow_counter; int err; - rx_fs = kzalloc_obj(*rx_fs, GFP_KERNEL); + rx_fs = kzalloc_obj(*rx_fs); if (!rx_fs) return -ENOMEM; @@ -2132,11 +2132,11 @@ static int mlx5_macsec_fs_add_roce_rule_rx(struct mlx5_macsec_fs *macsec_fs, u32 struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; - rx_rule = kzalloc_obj(*rx_rule, GFP_KERNEL); + rx_rule = kzalloc_obj(*rx_rule); if (!rx_rule) { err = -ENOMEM; goto out; @@ -2201,11 +2201,11 @@ static int mlx5_macsec_fs_add_roce_rule_tx(struct mlx5_macsec_fs *macsec_fs, u32 struct mlx5_flow_spec *spec; int err = 0; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; - tx_rule = kzalloc_obj(*tx_rule, GFP_KERNEL); + tx_rule = kzalloc_obj(*tx_rule); if (!tx_rule) { err = -ENOMEM; goto out; @@ -2361,7 +2361,7 @@ mlx5_macsec_fs_init(struct mlx5_core_dev *mdev) struct mlx5_macsec_fs *macsec_fs; int err; - macsec_fs = kzalloc_obj(*macsec_fs, GFP_KERNEL); + macsec_fs = kzalloc_obj(*macsec_fs); if (!macsec_fs) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c index 5352f9b61415..d408a5e63209 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c @@ -103,7 +103,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) if (!MLX5_ESWITCH_MANAGER(dev) || l2table_size == 1) return 0; - mpfs = kzalloc_obj(*mpfs, GFP_KERNEL); + mpfs = kzalloc_obj(*mpfs); if (!mpfs) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c index ca99b4375b66..954942ad93c5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c @@ -187,7 +187,7 @@ static int sd_init(struct mlx5_core_dev *dev) return 0; } - sd = kzalloc_obj(*sd, GFP_KERNEL); + sd = kzalloc_obj(*sd); if (!sd) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c index 2de8a80415f1..997be91f0a13 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/st.c @@ -59,7 +59,7 @@ struct mlx5_st *mlx5_st_create(struct mlx5_core_dev *dev) if (ret) return NULL; - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) goto end; @@ -124,7 +124,7 @@ int mlx5_st_alloc_index(struct mlx5_core_dev *dev, enum tph_mem_type mem_type, } } - idx_data = kzalloc_obj(*idx_data, GFP_KERNEL); + idx_data = kzalloc_obj(*idx_data); if (!idx_data) { ret = -ENOMEM; goto end; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c index 5c2ebf74b6a5..d9be0d9c9a13 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c @@ -37,7 +37,7 @@ int mlx5_tout_init(struct mlx5_core_dev *dev) { int i; - dev->timeouts = kmalloc_obj(*dev->timeouts, GFP_KERNEL); + dev->timeouts = kmalloc_obj(*dev->timeouts); if (!dev->timeouts) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c index 906d1ce3879f..c2292cab4592 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c @@ -103,7 +103,7 @@ int mlx5_vxlan_add_port(struct mlx5_vxlan *vxlan, u16 port) struct mlx5_vxlan_port *vxlanp; int ret; - vxlanp = kzalloc_obj(*vxlanp, GFP_KERNEL); + vxlanp = kzalloc_obj(*vxlanp); if (!vxlanp) return -ENOMEM; vxlanp->udp_port = port; @@ -151,7 +151,7 @@ struct mlx5_vxlan *mlx5_vxlan_create(struct mlx5_core_dev *mdev) if (!MLX5_CAP_ETH(mdev, tunnel_stateless_vxlan) || !mlx5_core_is_pf(mdev)) return ERR_PTR(-EOPNOTSUPP); - vxlan = kzalloc_obj(*vxlan, GFP_KERNEL); + vxlan = kzalloc_obj(*vxlan); if (!vxlan) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index a6c838cce13c..fdc3ba20912e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1792,7 +1792,7 @@ static int mlx5_hca_caps_alloc(struct mlx5_core_dev *dev) int i; for (i = 0; i < ARRAY_SIZE(types); i++) { - cap = kzalloc_obj(*cap, GFP_KERNEL); + cap = kzalloc_obj(*cap); if (!cap) goto err; type = types[i]; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index 91aa78052462..5ccb3ce98acb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -107,7 +107,7 @@ static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 fun if (root) return root; - root = kzalloc_obj(*root, GFP_KERNEL); + root = kzalloc_obj(*root); if (!root) return ERR_PTR(-ENOMEM); @@ -148,7 +148,7 @@ static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u return -EEXIST; } - nfp = kzalloc_obj(*nfp, GFP_KERNEL); + nfp = kzalloc_obj(*nfp); if (!nfp) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c index c23d2c710256..e051b9a939ee 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c @@ -261,7 +261,7 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i, struct mlx5_irq *irq; int err; - irq = kzalloc_obj(*irq, GFP_KERNEL); + irq = kzalloc_obj(*irq); if (!irq || !zalloc_cpumask_var(&irq->mask, GFP_KERNEL)) { kfree(irq); return ERR_PTR(-ENOMEM); @@ -471,7 +471,7 @@ struct mlx5_irq *mlx5_ctrl_irq_request(struct mlx5_core_dev *dev) struct irq_affinity_desc *af_desc; struct mlx5_irq *irq; - af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc); if (!af_desc) return ERR_PTR(-ENOMEM); @@ -556,7 +556,7 @@ struct mlx5_irq *mlx5_irq_request_vector(struct mlx5_core_dev *dev, u16 cpu, struct irq_affinity_desc *af_desc; struct mlx5_irq *irq; - af_desc = kvzalloc_obj(*af_desc, GFP_KERNEL); + af_desc = kvzalloc_obj(*af_desc); if (!af_desc) return ERR_PTR(-ENOMEM); @@ -578,7 +578,7 @@ static struct mlx5_irq_pool * irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name, u32 min_threshold, u32 max_threshold) { - struct mlx5_irq_pool *pool = kvzalloc_obj(*pool, GFP_KERNEL); + struct mlx5_irq_pool *pool = kvzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c index aebb67a7964d..e372484960ca 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c @@ -41,7 +41,7 @@ static int mlx5_rdma_enable_roce_steering(struct mlx5_core_dev *dev) flow_group_in = kvzalloc(inlen, GFP_KERNEL); if (!flow_group_in) return -ENOMEM; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) { kvfree(flow_group_in); return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c index e41da4da4c4f..e75cbf333898 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c @@ -99,7 +99,7 @@ static void mlx5_sf_dev_add(struct mlx5_core_dev *dev, u16 sf_index, u16 fn_id, goto add_err; } - sf_dev = kzalloc_obj(*sf_dev, GFP_KERNEL); + sf_dev = kzalloc_obj(*sf_dev); if (!sf_dev) { mlx5_adev_idx_free(id); err = -ENOMEM; @@ -280,7 +280,7 @@ static void mlx5_sf_dev_queue_active_works(struct work_struct *_work) continue; sw_func_id = MLX5_GET(query_vhca_state_out, out, vhca_state_context.sw_function_id); - work_ctx = kzalloc_obj(*work_ctx, GFP_KERNEL); + work_ctx = kzalloc_obj(*work_ctx); if (!work_ctx) return; @@ -336,7 +336,7 @@ void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev) if (!mlx5_sf_dev_supported(dev)) return; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) { err = -ENOMEM; goto table_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c index 894567e905b4..8503e532f423 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c @@ -70,7 +70,7 @@ mlx5_sf_alloc(struct mlx5_sf_table *table, struct mlx5_eswitch *esw, goto id_err; } - sf = kzalloc_obj(*sf, GFP_KERNEL); + sf = kzalloc_obj(*sf); if (!sf) { err = -ENOMEM; goto alloc_err; @@ -509,7 +509,7 @@ int mlx5_sf_table_init(struct mlx5_core_dev *dev) if (!mlx5_sf_table_supported(dev) || !mlx5_vhca_event_supported(dev)) return 0; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c index b50a50f7d909..049dfd431618 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c @@ -233,7 +233,7 @@ static int mlx5_sf_hw_table_hwc_init(struct mlx5_sf_hwc_table *hwc, u16 max_fn, if (!max_fn) return 0; - sfs = kzalloc_objs(*sfs, max_fn, GFP_KERNEL); + sfs = kzalloc_objs(*sfs, max_fn); if (!sfs) return -ENOMEM; @@ -298,7 +298,7 @@ int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev) if (!max_fn && !max_ext_fn) return 0; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) { err = -ENOMEM; goto alloc_err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c index 809643870526..9c4a559d268c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/vhca_event.c @@ -153,7 +153,7 @@ int mlx5_vhca_event_init(struct mlx5_core_dev *dev) if (!mlx5_vhca_event_supported(dev)) return 0; - events = kzalloc_obj(*events, GFP_KERNEL); + events = kzalloc_obj(*events); if (!events) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index 143278b70a64..4af82675ffe1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -47,7 +47,7 @@ static int sriov_restore_guids(struct mlx5_core_dev *dev, int vf, u16 func_id) if (sriov->vfs_ctx[vf].node_guid || sriov->vfs_ctx[vf].port_guid || sriov->vfs_ctx[vf].policy != MLX5_POLICY_INVALID) { - in = kzalloc_obj(*in, GFP_KERNEL); + in = kzalloc_obj(*in); if (!in) return -ENOMEM; @@ -305,7 +305,7 @@ int mlx5_sriov_init(struct mlx5_core_dev *dev) sriov->max_vfs = mlx5_get_max_vfs(dev); sriov->num_vfs = pci_num_vf(pdev); sriov->max_ec_vfs = mlx5_core_ec_sriov_enabled(dev) ? pci_sriov_get_totalvfs(dev->pdev) : 0; - sriov->vfs_ctx = kzalloc_objs(*sriov->vfs_ctx, total_vfs, GFP_KERNEL); + sriov->vfs_ctx = kzalloc_objs(*sriov->vfs_ctx, total_vfs); if (!sriov->vfs_ctx) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c index d8a003119be5..f1b117ea1c65 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c @@ -92,7 +92,7 @@ static int hws_action_get_shared_stc_nic(struct mlx5hws_context *ctx, return 0; } - shared_stc = kzalloc_obj(*shared_stc, GFP_KERNEL); + shared_stc = kzalloc_obj(*shared_stc); if (!shared_stc) { ret = -ENOMEM; goto unlock_and_out; @@ -632,7 +632,7 @@ hws_action_create_generic_bulk(struct mlx5hws_context *ctx, if (!hws_action_validate_hws_action(ctx, flags)) return NULL; - action = kzalloc_objs(*action, bulk_sz, GFP_KERNEL); + action = kzalloc_objs(*action, bulk_sz); if (!action) return NULL; @@ -1383,7 +1383,7 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx, size_t num_dest, return NULL; } - dest_list = kzalloc_objs(*dest_list, num_dest, GFP_KERNEL); + dest_list = kzalloc_objs(*dest_list, num_dest); if (!dest_list) return NULL; @@ -1477,7 +1477,7 @@ mlx5hws_action_create_insert_header(struct mlx5hws_context *ctx, if (!action) return NULL; - reformat_hdrs = kzalloc_objs(*reformat_hdrs, num_of_hdrs, GFP_KERNEL); + reformat_hdrs = kzalloc_objs(*reformat_hdrs, num_of_hdrs); if (!reformat_hdrs) goto free_action; @@ -1557,7 +1557,7 @@ hws_action_create_dest_match_range_definer(struct mlx5hws_context *ctx) __be32 *tag; int ret; - definer = kzalloc_obj(*definer, GFP_KERNEL); + definer = kzalloc_obj(*definer); if (!definer) return NULL; @@ -1600,7 +1600,7 @@ hws_action_create_dest_match_range_table(struct mlx5hws_context *ctx, return NULL; } - table_ste = kzalloc_obj(*table_ste, GFP_KERNEL); + table_ste = kzalloc_obj(*table_ste); if (!table_ste) return NULL; @@ -2019,7 +2019,7 @@ __must_hold(&ctx->ctrl_lock) return 0; } - default_stc = kzalloc_obj(*default_stc, GFP_KERNEL); + default_stc = kzalloc_obj(*default_stc); if (!default_stc) return -ENOMEM; @@ -2621,7 +2621,7 @@ mlx5hws_action_template_create(enum mlx5hws_action_type action_type[]) u8 num_actions = 0; int i; - at = kzalloc_obj(*at, GFP_KERNEL); + at = kzalloc_obj(*at); if (!at) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c index f5ab9f3c694b..6145f71442e4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c @@ -141,7 +141,7 @@ hws_action_ste_table_alloc(struct mlx5hws_action_ste_pool_element *parent_elem) MLX5HWS_ACTION_STE_TABLE_INIT_LOG_SZ, MLX5HWS_ACTION_STE_TABLE_MAX_LOG_SZ); - action_tbl = kzalloc_obj(*action_tbl, GFP_KERNEL); + action_tbl = kzalloc_obj(*action_tbl); if (!action_tbl) return ERR_PTR(-ENOMEM); @@ -329,7 +329,7 @@ int mlx5hws_action_ste_pool_init(struct mlx5hws_context *ctx) size_t queues = ctx->queues; int i, err; - pool = kzalloc_objs(*pool, queues, GFP_KERNEL); + pool = kzalloc_objs(*pool, queues); if (!pool) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c index 147e176b6f9a..02736ecf817d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c @@ -54,7 +54,7 @@ struct mlx5hws_buddy_mem *mlx5hws_buddy_create(u32 max_order) { struct mlx5hws_buddy_mem *buddy; - buddy = kzalloc_obj(*buddy, GFP_KERNEL); + buddy = kzalloc_obj(*buddy); if (!buddy) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c index 6f69b97a8c2b..8f0dd304cefa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c @@ -334,7 +334,7 @@ mlx5hws_bwc_matcher_create(struct mlx5hws_table *table, return NULL; } - bwc_matcher = kzalloc_obj(*bwc_matcher, GFP_KERNEL); + bwc_matcher = kzalloc_obj(*bwc_matcher); if (!bwc_matcher) return NULL; @@ -483,11 +483,11 @@ mlx5hws_bwc_rule_alloc(struct mlx5hws_bwc_matcher *bwc_matcher) { struct mlx5hws_bwc_rule *bwc_rule; - bwc_rule = kzalloc_obj(*bwc_rule, GFP_KERNEL); + bwc_rule = kzalloc_obj(*bwc_rule); if (unlikely(!bwc_rule)) goto out_err; - bwc_rule->rule = kzalloc_obj(*bwc_rule->rule, GFP_KERNEL); + bwc_rule->rule = kzalloc_obj(*bwc_rule->rule); if (unlikely(!bwc_rule->rule)) goto free_rule; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c index 25b8ad504acc..e624f5da96c8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c @@ -299,7 +299,7 @@ mlx5hws_cmd_forward_tbl_create(struct mlx5_core_dev *mdev, struct mlx5hws_cmd_forward_tbl *tbl; int ret; - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (!tbl) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c index 6e5b2c1a8b0b..c1a81f78d349 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c @@ -192,7 +192,7 @@ struct mlx5hws_context *mlx5hws_context_open(struct mlx5_core_dev *mdev, struct mlx5hws_context *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -201,7 +201,7 @@ struct mlx5hws_context *mlx5hws_context_open(struct mlx5_core_dev *mdev, mutex_init(&ctx->ctrl_lock); xa_init(&ctx->peer_ctx_xa); - ctx->caps = kzalloc_obj(*ctx->caps, GFP_KERNEL); + ctx->caps = kzalloc_obj(*ctx->caps); if (!ctx->caps) goto free_ctx; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c index d5902cfa8146..bcbd86a88b6b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c @@ -1688,7 +1688,7 @@ hws_definer_alloc_compressed_fc(struct mlx5hws_definer_fc *fc) u32 fc_sz = 0; int i; - compressed_fc = kzalloc_objs(*compressed_fc, definer_size, GFP_KERNEL); + compressed_fc = kzalloc_objs(*compressed_fc, definer_size); if (!compressed_fc) return NULL; @@ -1731,7 +1731,7 @@ hws_definer_alloc_fc(struct mlx5hws_context *ctx, struct mlx5hws_definer_fc *fc; int i; - fc = kzalloc_objs(*fc, len, GFP_KERNEL); + fc = kzalloc_objs(*fc, len); if (!fc) return NULL; @@ -2139,7 +2139,7 @@ int mlx5hws_definer_init_cache(struct mlx5hws_definer_cache **cache) { struct mlx5hws_definer_cache *new_cache; - new_cache = kzalloc_obj(*new_cache, GFP_KERNEL); + new_cache = kzalloc_obj(*new_cache); if (!new_cache) return -ENOMEM; @@ -2183,7 +2183,7 @@ int mlx5hws_definer_get_obj(struct mlx5hws_context *ctx, if (ret) return -1; - cached_definer = kzalloc_obj(*cached_definer, GFP_KERNEL); + cached_definer = kzalloc_obj(*cached_definer); if (!cached_definer) goto free_definer_obj; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c index d684a49900a5..11ceaa97fa4f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c @@ -1239,7 +1239,7 @@ mlx5_fs_get_pr_encap_pool(struct mlx5_core_dev *dev, struct xarray *pr_pools, if (pr_pool) return pr_pool; - pr_pool = kzalloc_obj(*pr_pool, GFP_KERNEL); + pr_pool = kzalloc_obj(*pr_pool); if (!pr_pool) return ERR_PTR(-ENOMEM); err = mlx5_fs_hws_pr_pool_init(pr_pool, dev, size, reformat_type); @@ -1430,7 +1430,7 @@ mlx5_fs_create_mh_pool(struct mlx5_core_dev *dev, struct mlx5_fs_pool *pool; int err; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); err = mlx5_fs_hws_mh_pool_init(pool, dev, pattern); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c index d24eb6723b85..505b25e8da7f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c @@ -186,7 +186,7 @@ int mlx5_fs_hws_pr_pool_init(struct mlx5_fs_pool *pr_pool, reformat_type != MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L2) return -EOPNOTSUPP; - pr_pool_ctx = kzalloc_obj(*pr_pool_ctx, GFP_KERNEL); + pr_pool_ctx = kzalloc_obj(*pr_pool_ctx); if (!pr_pool_ctx) return -ENOMEM; pr_pool_ctx->reformat_type = reformat_type; @@ -331,7 +331,7 @@ int mlx5_fs_hws_mh_pool_init(struct mlx5_fs_pool *fs_hws_mh_pool, { struct mlx5hws_action_mh_pattern *pool_pattern; - pool_pattern = kzalloc_obj(*pool_pattern, GFP_KERNEL); + pool_pattern = kzalloc_obj(*pool_pattern); if (!pool_pattern) return -ENOMEM; pool_pattern->data = kmemdup(pattern->data, pattern->sz, GFP_KERNEL); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c index c78ae73e5411..663224454268 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c @@ -912,7 +912,7 @@ hws_matcher_create_col_matcher(struct mlx5hws_matcher *matcher) !hws_matcher_requires_col_tbl(size_tx->rule.num_log)) return 0; - col_matcher = kzalloc_obj(*matcher, GFP_KERNEL); + col_matcher = kzalloc_obj(*matcher); if (!col_matcher) return -ENOMEM; @@ -1084,7 +1084,7 @@ hws_matcher_set_templates(struct mlx5hws_matcher *matcher, return -EOPNOTSUPP; } - matcher->mt = kzalloc_objs(*matcher->mt, num_of_mt, GFP_KERNEL); + matcher->mt = kzalloc_objs(*matcher->mt, num_of_mt); if (!matcher->mt) return -ENOMEM; @@ -1133,7 +1133,7 @@ mlx5hws_matcher_create(struct mlx5hws_table *tbl, struct mlx5hws_matcher *matcher; int ret; - matcher = kzalloc_obj(*matcher, GFP_KERNEL); + matcher = kzalloc_obj(*matcher); if (!matcher) return NULL; @@ -1179,7 +1179,7 @@ mlx5hws_match_template_create(struct mlx5hws_context *ctx, { struct mlx5hws_match_template *mt; - mt = kzalloc_obj(*mt, GFP_KERNEL); + mt = kzalloc_obj(*mt); if (!mt) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c index 49c8f3c872d9..9af449c2b4d5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c @@ -78,7 +78,7 @@ int mlx5hws_pat_init_pattern_cache(struct mlx5hws_pattern_cache **cache) { struct mlx5hws_pattern_cache *new_cache; - new_cache = kzalloc_obj(*new_cache, GFP_KERNEL); + new_cache = kzalloc_obj(*new_cache); if (!new_cache) return -ENOMEM; @@ -168,7 +168,7 @@ mlx5hws_pat_add_pattern_to_cache(struct mlx5hws_pattern_cache *cache, { struct mlx5hws_pattern_cache_item *cached_pattern; - cached_pattern = kzalloc_obj(*cached_pattern, GFP_KERNEL); + cached_pattern = kzalloc_obj(*cached_pattern); if (!cached_pattern) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c index 4b6642642346..3a549c9db71a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c @@ -41,7 +41,7 @@ hws_pool_create_one_resource(struct mlx5hws_pool *pool, u32 log_range, u32 obj_id = 0; int ret; - resource = kzalloc_obj(*resource, GFP_KERNEL); + resource = kzalloc_obj(*resource); if (!resource) return NULL; @@ -347,7 +347,7 @@ mlx5hws_pool_create(struct mlx5hws_context *ctx, struct mlx5hws_pool_attr *pool_ enum mlx5hws_db_type res_db_type; struct mlx5hws_pool *pool; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c index 3c966476479d..0d4cb2b2393b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c @@ -136,7 +136,7 @@ hws_rule_save_resize_info(struct mlx5hws_rule *rule, /* resize_info might already exist (if we're in update flow) */ if (likely(!rule->resize_info)) { - rule->resize_info = kzalloc_obj(*rule->resize_info, GFP_KERNEL); + rule->resize_info = kzalloc_obj(*rule->resize_info); if (unlikely(!rule->resize_info)) { pr_warn("HWS: resize info isn't allocated for rule\n"); return; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c index 4fef376d63a2..2d34fe465d13 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c @@ -701,7 +701,7 @@ static int hws_send_ring_alloc_sq(struct mlx5_core_dev *mdev, wq->db = &wq->db[MLX5_SND_DBR]; buf_sz = queue->num_entries * MAX_WQES_PER_RULE; - sq->dep_wqe = kzalloc_objs(*sq->dep_wqe, queue->num_entries, GFP_KERNEL); + sq->dep_wqe = kzalloc_objs(*sq->dep_wqe, queue->num_entries); if (!sq->dep_wqe) { err = -ENOMEM; goto destroy_wq_cyc; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c index 2bf42f5df285..bd292485a25b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c @@ -238,7 +238,7 @@ struct mlx5hws_table *mlx5hws_table_create(struct mlx5hws_context *ctx, return NULL; } - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (!tbl) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c index 9889149569fe..2020b5eeb8f4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c @@ -1194,14 +1194,14 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, return NULL; } - hw_dests = kzalloc_objs(*hw_dests, num_of_dests, GFP_KERNEL); + hw_dests = kzalloc_objs(*hw_dests, num_of_dests); if (!hw_dests) return NULL; if (unlikely(check_mul_overflow(num_of_dests, 2u, &ref_act_cnt))) goto free_hw_dests; - ref_actions = kzalloc_objs(*ref_actions, ref_act_cnt, GFP_KERNEL); + ref_actions = kzalloc_objs(*ref_actions, ref_act_cnt); if (!ref_actions) goto free_hw_dests; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c index b276f9e966bc..e1f156448fb0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c @@ -68,7 +68,7 @@ static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool) } for (i = 0; i < num_of_objects; i++) { - arg_obj = kzalloc_obj(*arg_obj, GFP_KERNEL); + arg_obj = kzalloc_obj(*arg_obj); if (!arg_obj) { ret = -ENOMEM; goto clean_arg_obj; @@ -132,7 +132,7 @@ static struct dr_arg_pool *dr_arg_pool_create(struct mlx5dr_domain *dmn, { struct dr_arg_pool *pool; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -235,7 +235,7 @@ mlx5dr_arg_mgr_create(struct mlx5dr_domain *dmn) if (!mlx5dr_domain_is_support_ptrn_arg(dmn)) return NULL; - pool_mgr = kzalloc_obj(*pool_mgr, GFP_KERNEL); + pool_mgr = kzalloc_obj(*pool_mgr); if (!pool_mgr) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c index c8904955ec54..1b08bbb7ad99 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c @@ -60,7 +60,7 @@ mlx5dr_dbg_dump_data_init_new_buff(struct mlx5dr_dbg_dump_data *dump_data) { struct mlx5dr_dbg_dump_buff *new_buff; - new_buff = kzalloc_obj(*new_buff, GFP_KERNEL); + new_buff = kzalloc_obj(*new_buff); if (!new_buff) return NULL; @@ -81,7 +81,7 @@ mlx5dr_dbg_create_dump_data(void) { struct mlx5dr_dbg_dump_data *dump_data; - dump_data = kzalloc_obj(*dump_data, GFP_KERNEL); + dump_data = kzalloc_obj(*dump_data); if (!dump_data) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c index 282088205d4c..ddbb62d8ac96 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c @@ -60,7 +60,7 @@ dr_definer_create_obj(struct mlx5dr_domain *dmn, u16 format_id, struct dr_definer_object *definer_obj; int ret = 0; - definer_obj = kzalloc_obj(*definer_obj, GFP_KERNEL); + definer_obj = kzalloc_obj(*definer_obj); if (!definer_obj) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c index 5c0a8dc6cff0..fedefb565a21 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c @@ -282,7 +282,7 @@ dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport) struct mlx5dr_cmd_vport_cap *vport_caps; int ret; - vport_caps = kvzalloc_obj(*vport_caps, GFP_KERNEL); + vport_caps = kvzalloc_obj(*vport_caps); if (!vport_caps) return NULL; @@ -467,7 +467,7 @@ mlx5dr_domain_create(struct mlx5_core_dev *mdev, enum mlx5dr_domain_type type) if (type > MLX5DR_DOMAIN_TYPE_FDB) return NULL; - dmn = kzalloc_obj(*dmn, GFP_KERNEL); + dmn = kzalloc_obj(*dmn); if (!dmn) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c index df34beefda11..094fcd9cd770 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c @@ -13,7 +13,7 @@ mlx5dr_fw_create_recalc_cs_ft(struct mlx5dr_domain *dmn, u16 vport_num) u64 rx_icm_addr, modify_ttl_action; int ret; - recalc_cs_ft = kzalloc_obj(*recalc_cs_ft, GFP_KERNEL); + recalc_cs_ft = kzalloc_obj(*recalc_cs_ft); if (!recalc_cs_ft) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c index 79f0adecc2aa..1c314df256c9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c @@ -116,7 +116,7 @@ dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool) size_t log_align_base = 0; int err; - icm_mr = kvzalloc_obj(*icm_mr, GFP_KERNEL); + icm_mr = kvzalloc_obj(*icm_mr); if (!icm_mr) return NULL; @@ -269,7 +269,7 @@ static int dr_icm_buddy_create(struct mlx5dr_icm_pool *pool) if (!icm_mr) return -ENOMEM; - buddy = kvzalloc_obj(*buddy, GFP_KERNEL); + buddy = kvzalloc_obj(*buddy); if (!buddy) goto free_mr; @@ -509,7 +509,7 @@ struct mlx5dr_icm_pool *mlx5dr_icm_pool_create(struct mlx5dr_domain *dmn, struct mlx5dr_icm_pool *pool; u32 max_hot_size = 0; - pool = kvzalloc_obj(*pool, GFP_KERNEL); + pool = kvzalloc_obj(*pool); if (!pool) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c index b171fdb5a622..be0c476b1113 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c @@ -996,7 +996,7 @@ mlx5dr_matcher_create(struct mlx5dr_table *tbl, refcount_inc(&tbl->refcount); - matcher = kzalloc_obj(*matcher, GFP_KERNEL); + matcher = kzalloc_obj(*matcher); if (!matcher) goto dec_ref; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c index 094a6bea9a8a..ed7eb0f40b57 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c @@ -94,7 +94,7 @@ dr_ptrn_alloc_pattern(struct mlx5dr_ptrn_mgr *mgr, mgr->dmn->info.caps.hdr_modify_pattern_icm_addr) / DR_ACTION_CACHE_LINE_SIZE; - pattern = kzalloc_obj(*pattern, GFP_KERNEL); + pattern = kzalloc_obj(*pattern); if (!pattern) goto free_chunk; @@ -201,7 +201,7 @@ struct mlx5dr_ptrn_mgr *mlx5dr_ptrn_mgr_create(struct mlx5dr_domain *dmn) if (!mlx5dr_domain_is_support_ptrn_arg(dmn)) return NULL; - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (!mgr) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c index 8d925c3e2b11..00156ceed5ea 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c @@ -593,7 +593,7 @@ static int dr_rule_add_action_members(struct mlx5dr_rule *rule, int i; for (i = 0; i < num_actions; i++) { - action_mem = kvzalloc_obj(*action_mem, GFP_KERNEL); + action_mem = kvzalloc_obj(*action_mem); if (!action_mem) goto free_action_members; @@ -1298,7 +1298,7 @@ dr_rule_create_rule(struct mlx5dr_matcher *matcher, if (!dr_rule_verify(matcher, value, ¶m)) return NULL; - rule = kzalloc_obj(*rule, GFP_KERNEL); + rule = kzalloc_obj(*rule); if (!rule) return NULL; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c index 78d7c83a98b0..79e3c29d1044 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c @@ -72,7 +72,7 @@ static int dr_send_info_pool_fill(struct mlx5dr_send_info_pool *pool) int i; for (i = 0; i < DR_SEND_INFO_POOL_SIZE; i++) { - pool_obj = kzalloc_obj(*pool_obj, GFP_KERNEL); + pool_obj = kzalloc_obj(*pool_obj); if (!pool_obj) goto clean_pool; @@ -114,7 +114,7 @@ static struct mlx5dr_send_info_pool *dr_send_info_pool_create(void) struct mlx5dr_send_info_pool *pool; int ret; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -258,7 +258,7 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev, void *in; int err; - dr_qp = kzalloc_obj(*dr_qp, GFP_KERNEL); + dr_qp = kzalloc_obj(*dr_qp); if (!dr_qp) return NULL; @@ -1063,7 +1063,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, __be64 *pas; u32 i; - cq = kzalloc_obj(*cq, GFP_KERNEL); + cq = kzalloc_obj(*cq); if (!cq) return NULL; @@ -1158,7 +1158,7 @@ static int dr_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, u32 *mkey) static struct mlx5dr_mr *dr_reg_mr(struct mlx5_core_dev *mdev, u32 pdn, void *buf, size_t size) { - struct mlx5dr_mr *mr = kzalloc_obj(*mr, GFP_KERNEL); + struct mlx5dr_mr *mr = kzalloc_obj(*mr); struct device *dma_device; dma_addr_t dma_addr; int err; @@ -1207,7 +1207,7 @@ int mlx5dr_send_ring_alloc(struct mlx5dr_domain *dmn) int size; int ret; - dmn->send_ring = kzalloc_obj(*dmn->send_ring, GFP_KERNEL); + dmn->send_ring = kzalloc_obj(*dmn->send_ring); if (!dmn->send_ring) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c index ab4c360c64e0..740aac71d4cb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c @@ -255,7 +255,7 @@ struct mlx5dr_table *mlx5dr_table_create(struct mlx5dr_domain *dmn, u32 level, refcount_inc(&dmn->refcount); - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (!tbl) goto dec_ref; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c index 3b41a507ea05..4effe37fd455 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c @@ -832,7 +832,7 @@ int mlx5_query_hca_vport_system_image_guid(struct mlx5_core_dev *dev, struct mlx5_hca_vport_context *rep; int err; - rep = kvzalloc_obj(*rep, GFP_KERNEL); + rep = kvzalloc_obj(*rep); if (!rep) return -ENOMEM; @@ -851,7 +851,7 @@ int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev, struct mlx5_hca_vport_context *rep; int err; - rep = kvzalloc_obj(*rep, GFP_KERNEL); + rep = kvzalloc_obj(*rep); if (!rep) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wc.c b/drivers/net/ethernet/mellanox/mlx5/core/wc.c index aa989841f375..7d3d4d739e2c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/wc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/wc.c @@ -366,7 +366,7 @@ static void mlx5_core_test_wc(struct mlx5_core_dev *mdev) if (mdev->wc_state != MLX5_WC_STATE_UNINITIALIZED) return; - sq = kzalloc_obj(*sq, GFP_KERNEL); + sq = kzalloc_obj(*sq); if (!sq) return; diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c index b2335f56b481..002560c46150 100644 --- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c +++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c @@ -267,7 +267,7 @@ struct mlxfw_mfa2_file *mlxfw_mfa2_file_init(const struct firmware *fw) const void *first_tlv_ptr; const void *cb_top_ptr; - mfa2_file = kzalloc_obj(*mfa2_file, GFP_KERNEL); + mfa2_file = kzalloc_obj(*mfa2_file); if (!mfa2_file) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 6d2353324eda..93540e4f3a4b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -2376,7 +2376,7 @@ int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core, rxl_item = __find_rx_listener_item(mlxsw_core, rxl); if (rxl_item) return -EEXIST; - rxl_item = kmalloc_obj(*rxl_item, GFP_KERNEL); + rxl_item = kmalloc_obj(*rxl_item); if (!rxl_item) return -ENOMEM; rxl_item->rxl = *rxl; @@ -2475,7 +2475,7 @@ int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core, el_item = __find_event_listener_item(mlxsw_core, el); if (el_item) return -EEXIST; - el_item = kmalloc_obj(*el_item, GFP_KERNEL); + el_item = kmalloc_obj(*el_item); if (!el_item) return -ENOMEM; el_item->mlxsw_core = mlxsw_core; @@ -2684,7 +2684,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core, struct mlxsw_reg_trans *trans; int err; - trans = kzalloc_obj(*trans, GFP_KERNEL); + trans = kzalloc_obj(*trans); if (!trans) return -ENOMEM; @@ -2785,7 +2785,7 @@ int mlxsw_core_irq_event_handler_register(struct mlxsw_core *mlxsw_core, { struct mlxsw_core_irq_event_handler_item *item; - item = kzalloc_obj(*item, GFP_KERNEL); + item = kzalloc_obj(*item); if (!item) return -ENOMEM; item->cb = cb; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c index 08168f95987a..f03dffc39005 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c @@ -201,7 +201,7 @@ struct mlxsw_afa *mlxsw_afa_create(unsigned int max_acts_per_set, struct mlxsw_afa *mlxsw_afa; int err; - mlxsw_afa = kzalloc_obj(*mlxsw_afa, GFP_KERNEL); + mlxsw_afa = kzalloc_obj(*mlxsw_afa); if (!mlxsw_afa) return ERR_PTR(-ENOMEM); err = rhashtable_init(&mlxsw_afa->set_ht, &mlxsw_afa_set_ht_params); @@ -276,7 +276,7 @@ static struct mlxsw_afa_set *mlxsw_afa_set_create(bool is_first) { struct mlxsw_afa_set *set; - set = kzalloc_obj(*set, GFP_KERNEL); + set = kzalloc_obj(*set); if (!set) return NULL; /* Need to initialize the set to pass by default */ @@ -406,7 +406,7 @@ struct mlxsw_afa_block *mlxsw_afa_block_create(struct mlxsw_afa *mlxsw_afa) { struct mlxsw_afa_block *block; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&block->resource_list); @@ -560,7 +560,7 @@ mlxsw_afa_fwd_entry_create(struct mlxsw_afa *mlxsw_afa, u16 local_port) struct mlxsw_afa_fwd_entry *fwd_entry; int err; - fwd_entry = kzalloc_obj(*fwd_entry, GFP_KERNEL); + fwd_entry = kzalloc_obj(*fwd_entry); if (!fwd_entry) return ERR_PTR(-ENOMEM); fwd_entry->ht_key.local_port = local_port; @@ -653,7 +653,7 @@ mlxsw_afa_fwd_entry_ref_create(struct mlxsw_afa_block *block, u16 local_port) struct mlxsw_afa_fwd_entry *fwd_entry; int err; - fwd_entry_ref = kzalloc_obj(*fwd_entry_ref, GFP_KERNEL); + fwd_entry_ref = kzalloc_obj(*fwd_entry_ref); if (!fwd_entry_ref) return ERR_PTR(-ENOMEM); fwd_entry = mlxsw_afa_fwd_entry_get(block->afa, local_port); @@ -702,7 +702,7 @@ mlxsw_afa_counter_create(struct mlxsw_afa_block *block) struct mlxsw_afa_counter *counter; int err; - counter = kzalloc_obj(*counter, GFP_KERNEL); + counter = kzalloc_obj(*counter); if (!counter) return ERR_PTR(-ENOMEM); @@ -847,7 +847,7 @@ mlxsw_afa_cookie_ref_create(struct mlxsw_afa_block *block, struct mlxsw_afa_cookie *cookie; int err; - cookie_ref = kzalloc_obj(*cookie_ref, GFP_KERNEL); + cookie_ref = kzalloc_obj(*cookie_ref); if (!cookie_ref) return ERR_PTR(-ENOMEM); cookie = mlxsw_afa_cookie_get(block->afa, fa_cookie); @@ -873,7 +873,7 @@ mlxsw_afa_policer_create(struct mlxsw_afa *mlxsw_afa, u32 fa_index, struct mlxsw_afa_policer *policer; int err; - policer = kzalloc_obj(*policer, GFP_KERNEL); + policer = kzalloc_obj(*policer); if (!policer) return ERR_PTR(-ENOMEM); @@ -974,7 +974,7 @@ mlxsw_afa_policer_ref_create(struct mlxsw_afa_block *block, u32 fa_index, struct mlxsw_afa_policer *policer; int err; - policer_ref = kzalloc_obj(*policer_ref, GFP_KERNEL); + policer_ref = kzalloc_obj(*policer_ref); if (!policer_ref) return ERR_PTR(-ENOMEM); @@ -1386,7 +1386,7 @@ mlxsw_afa_mirror_create(struct mlxsw_afa_block *block, u16 local_in_port, struct mlxsw_afa_mirror *mirror; int err; - mirror = kzalloc_obj(*mirror, GFP_KERNEL); + mirror = kzalloc_obj(*mirror); if (!mirror) return ERR_PTR(-ENOMEM); @@ -2187,7 +2187,7 @@ mlxsw_afa_sampler_create(struct mlxsw_afa_block *block, u16 local_port, struct mlxsw_afa_sampler *sampler; int err; - sampler = kzalloc_obj(*sampler, GFP_KERNEL); + sampler = kzalloc_obj(*sampler); if (!sampler) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c index 030eefcd3eda..bbd8b61180eb 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c @@ -86,7 +86,7 @@ struct mlxsw_afk *mlxsw_afk_create(unsigned int max_blocks, { struct mlxsw_afk *mlxsw_afk; - mlxsw_afk = kzalloc_obj(*mlxsw_afk, GFP_KERNEL); + mlxsw_afk = kzalloc_obj(*mlxsw_afk); if (!mlxsw_afk) return NULL; INIT_LIST_HEAD(&mlxsw_afk->key_info_list); @@ -262,7 +262,7 @@ static int mlxsw_afk_picker(struct mlxsw_afk *mlxsw_afk, enum mlxsw_afk_element element; int err; - picker = kzalloc_objs(*picker, mlxsw_afk->blocks_count, GFP_KERNEL); + picker = kzalloc_objs(*picker, mlxsw_afk->blocks_count); if (!picker) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c index a689c79122cf..c4816488e4d7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c @@ -57,7 +57,7 @@ int mlxsw_linecard_bdev_add(struct mlxsw_linecard *linecard) if (id < 0) return id; - linecard_bdev = kzalloc_obj(*linecard_bdev, GFP_KERNEL); + linecard_bdev = kzalloc_obj(*linecard_bdev); if (!linecard_bdev) { mlxsw_linecard_bdev_id_free(id); return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c index ef13fee48b1a..f0659616ad9b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c @@ -531,7 +531,7 @@ int mlxsw_linecards_event_ops_register(struct mlxsw_core *mlxsw_core, if (!linecards) return 0; - item = kzalloc_obj(*item, GFP_KERNEL); + item = kzalloc_obj(*item); if (!item) return -ENOMEM; item->event_ops = ops; @@ -1446,7 +1446,7 @@ static int mlxsw_linecard_types_init(struct mlxsw_core *mlxsw_core, return 0; } - types_info = kzalloc_obj(*types_info, GFP_KERNEL); + types_info = kzalloc_obj(*types_info); if (!types_info) { release_firmware(firmware); return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 9871b9e1d094..6cdbac750cc6 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -398,7 +398,7 @@ static int mlxsw_m_linecards_init(struct mlxsw_m *mlxsw_m) /* Add slot for main board. */ mlxsw_m->num_of_slots += 1; - mlxsw_m->ports = kzalloc_objs(*mlxsw_m->ports, max_ports, GFP_KERNEL); + mlxsw_m->ports = kzalloc_objs(*mlxsw_m->ports, max_ports); if (!mlxsw_m->ports) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 9b378e9d084d..be6b7f9508ed 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -1264,7 +1264,7 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, if (!mem_item->buf) return -ENOMEM; - q->elem_info = kzalloc_objs(*q->elem_info, q->count, GFP_KERNEL); + q->elem_info = kzalloc_objs(*q->elem_info, q->count); if (!q->elem_info) { err = -ENOMEM; goto err_elem_info_alloc; @@ -1316,7 +1316,7 @@ static int mlxsw_pci_queue_group_init(struct mlxsw_pci *mlxsw_pci, char *mbox, int err; queue_group = mlxsw_pci_queue_type_group_get(mlxsw_pci, q_ops->type); - queue_group->q = kzalloc_objs(*queue_group->q, num_qs, GFP_KERNEL); + queue_group->q = kzalloc_objs(*queue_group->q, num_qs); if (!queue_group->q) return -ENOMEM; @@ -2414,7 +2414,7 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct mlxsw_pci *mlxsw_pci; int err; - mlxsw_pci = kzalloc_obj(*mlxsw_pci, GFP_KERNEL); + mlxsw_pci = kzalloc_obj(*mlxsw_pci); if (!mlxsw_pci) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index dbc032ff4963..b405584fa8a0 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -972,7 +972,7 @@ mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid) if (err) return ERR_PTR(err); - mlxsw_sp_port_vlan = kzalloc_obj(*mlxsw_sp_port_vlan, GFP_KERNEL); + mlxsw_sp_port_vlan = kzalloc_obj(*mlxsw_sp_port_vlan); if (!mlxsw_sp_port_vlan) { err = -ENOMEM; goto err_port_vlan_alloc; @@ -1776,7 +1776,7 @@ static int mlxsw_sp_cpu_port_create(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_port *mlxsw_sp_port; int err; - mlxsw_sp_port = kzalloc_obj(*mlxsw_sp_port, GFP_KERNEL); + mlxsw_sp_port = kzalloc_obj(*mlxsw_sp_port); if (!mlxsw_sp_port) return -ENOMEM; @@ -2747,7 +2747,7 @@ mlxsw_sp_sample_trigger_node_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_sample_trigger_node *trigger_node; int err; - trigger_node = kzalloc_obj(*trigger_node, GFP_KERNEL); + trigger_node = kzalloc_obj(*trigger_node); if (!trigger_node) return -ENOMEM; @@ -2893,7 +2893,7 @@ mlxsw_sp_ipv6_addr_init(struct mlxsw_sp *mlxsw_sp, const struct in6_addr *addr6, if (err) goto err_rips_write; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) { err = -ENOMEM; goto err_node_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c index aaaa586e8569..cb232accb296 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c @@ -318,7 +318,7 @@ mlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl, struct mlxsw_sp_acl_rule_info *rulei; int err; - rulei = kzalloc_obj(*rulei, GFP_KERNEL); + rulei = kzalloc_obj(*rulei); if (!rulei) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c index b6e1fc77f0c0..748929287904 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c @@ -74,7 +74,7 @@ mlxsw_sp_acl_atcam_region_generic_init(struct mlxsw_sp_acl_atcam_region *aregion { struct mlxsw_sp_acl_atcam_region_generic *region_generic; - region_generic = kzalloc_obj(*region_generic, GFP_KERNEL); + region_generic = kzalloc_obj(*region_generic); if (!region_generic) return -ENOMEM; @@ -126,7 +126,7 @@ mlxsw_sp_acl_atcam_region_12kb_init(struct mlxsw_sp_acl_atcam_region *aregion) return -EIO; max_lkey_id = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID); - region_12kb = kzalloc_obj(*region_12kb, GFP_KERNEL); + region_12kb = kzalloc_obj(*region_12kb); if (!region_12kb) return -ENOMEM; @@ -179,7 +179,7 @@ mlxsw_sp_acl_atcam_lkey_id_create(struct mlxsw_sp_acl_atcam_region *aregion, else return ERR_PTR(-ENOBUFS); - lkey_id = kzalloc_obj(*lkey_id, GFP_KERNEL); + lkey_id = kzalloc_obj(*lkey_id); if (!lkey_id) { err = -ENOMEM; goto err_lkey_id_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c index 80307d6554a2..cbb272a96359 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c @@ -254,7 +254,7 @@ mlxsw_sp_acl_erp_generic_create(struct mlxsw_sp_acl_erp_table *erp_table, struct mlxsw_sp_acl_erp *erp; int err; - erp = kzalloc_obj(*erp, GFP_KERNEL); + erp = kzalloc_obj(*erp); if (!erp) return ERR_PTR(-ENOMEM); @@ -798,7 +798,7 @@ mlxsw_sp_acl_erp_ctcam_mask_create(struct mlxsw_sp_acl_erp_table *erp_table, struct mlxsw_sp_acl_erp *erp; int err; - erp = kzalloc_obj(*erp, GFP_KERNEL); + erp = kzalloc_obj(*erp); if (!erp) return ERR_PTR(-ENOMEM); @@ -1236,7 +1236,7 @@ static void *mlxsw_sp_acl_erp_delta_create(void *priv, void *parent_obj, if (err) return ERR_PTR(-EINVAL); - delta = kzalloc_obj(*delta, GFP_KERNEL); + delta = kzalloc_obj(*delta); if (!delta) return ERR_PTR(-ENOMEM); delta->start = delta_start; @@ -1309,7 +1309,7 @@ mlxsw_sp_acl_erp_table_create(struct mlxsw_sp_acl_atcam_region *aregion, struct mlxsw_sp_acl_erp_table *erp_table; int err; - erp_table = kzalloc_obj(*erp_table, GFP_KERNEL); + erp_table = kzalloc_obj(*erp_table); if (!erp_table) return ERR_PTR(-ENOMEM); @@ -1563,7 +1563,7 @@ int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_erp_core *erp_core; int err; - erp_core = kzalloc_obj(*erp_core, GFP_KERNEL); + erp_core = kzalloc_obj(*erp_core); if (!erp_core) return -ENOMEM; erp_core->mlxsw_sp = mlxsw_sp; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c index 5a282cb4b52d..3232ff3ad3c3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c @@ -778,7 +778,7 @@ mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_tcam_vregion *vregion; int err; - vregion = kzalloc_obj(*vregion, GFP_KERNEL); + vregion = kzalloc_obj(*vregion); if (!vregion) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&vregion->vchunk_list); @@ -939,7 +939,7 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, if (priority == MLXSW_SP_ACL_TCAM_CATCHALL_PRIO) return ERR_PTR(-EINVAL); - vchunk = kzalloc_obj(*vchunk, GFP_KERNEL); + vchunk = kzalloc_obj(*vchunk); if (!vchunk) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&vchunk->ventry_list); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c index fd6b36c3d475..d1358c716079 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c @@ -628,7 +628,7 @@ static int mlxsw_sp_sb_port_init(struct mlxsw_sp *mlxsw_sp, { struct mlxsw_sp_sb_pm *pms; - pms = kzalloc_objs(*pms, mlxsw_sp->sb_vals->pool_count, GFP_KERNEL); + pms = kzalloc_objs(*pms, mlxsw_sp->sb_vals->pool_count); if (!pms) return -ENOMEM; sb_port->pms = pms; @@ -652,7 +652,7 @@ static int mlxsw_sp_sb_ports_init(struct mlxsw_sp *mlxsw_sp) if (!mlxsw_sp->sb->ports) return -ENOMEM; - prs = kzalloc_objs(*prs, mlxsw_sp->sb_vals->pool_count, GFP_KERNEL); + prs = kzalloc_objs(*prs, mlxsw_sp->sb_vals->pool_count); if (!prs) { err = -ENOMEM; goto err_alloc_prs; @@ -1261,7 +1261,7 @@ int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_HEADROOM_SIZE)) return -EIO; - mlxsw_sp->sb = kzalloc_obj(*mlxsw_sp->sb, GFP_KERNEL); + mlxsw_sp->sb = kzalloc_obj(*mlxsw_sp->sb); if (!mlxsw_sp->sb) return -ENOMEM; mlxsw_sp->sb->cell_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, CELL_SIZE); @@ -1324,7 +1324,7 @@ int mlxsw_sp_port_buffers_init(struct mlxsw_sp_port *mlxsw_sp_port) { int err; - mlxsw_sp_port->hdroom = kzalloc_obj(*mlxsw_sp_port->hdroom, GFP_KERNEL); + mlxsw_sp_port->hdroom = kzalloc_obj(*mlxsw_sp_port->hdroom); if (!mlxsw_sp_port->hdroom) return -ENOMEM; mlxsw_sp_port->hdroom->mtu = mlxsw_sp_port->dev->mtu; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c index 2e9c35f5f992..4f921bbc1e77 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c @@ -1022,7 +1022,7 @@ mlxsw_sp_fid_port_vid_list_add(struct mlxsw_sp_fid *fid, u16 local_port, { struct mlxsw_sp_fid_port_vid *port_vid, *tmp_port_vid; - port_vid = kzalloc_obj(*port_vid, GFP_KERNEL); + port_vid = kzalloc_obj(*port_vid); if (!port_vid) return -ENOMEM; @@ -2295,7 +2295,7 @@ mlxsw_sp_fids_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid_core *fid_core; int err, i; - fid_core = kzalloc_obj(*mlxsw_sp->fid_core, GFP_KERNEL); + fid_core = kzalloc_obj(*mlxsw_sp->fid_core); if (!fid_core) return -ENOMEM; mlxsw_sp->fid_core = fid_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c index 6e341b4a9805..f1b8d2868a22 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c @@ -14,7 +14,7 @@ mlxsw_sp_flow_block_create(struct mlxsw_sp *mlxsw_sp, struct net *net) { struct mlxsw_sp_flow_block *block; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return NULL; INIT_LIST_HEAD(&block->binding_list); @@ -75,7 +75,7 @@ static int mlxsw_sp_flow_block_bind(struct mlxsw_sp *mlxsw_sp, if (err) return err; - binding = kzalloc_obj(*binding, GFP_KERNEL); + binding = kzalloc_obj(*binding); if (!binding) { err = -ENOMEM; goto err_binding_alloc; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c index a5fdc1a7555a..fefd39a96320 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c @@ -243,7 +243,7 @@ int mlxsw_sp_mall_replace(struct mlxsw_sp *mlxsw_sp, return -EOPNOTSUPP; } - mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry); if (!mall_entry) return -ENOMEM; mall_entry->cookie = f->cookie; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c index 1ca8a15a9cb2..e700e9ac33b7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c @@ -172,7 +172,7 @@ static int mlxsw_sp_mr_route_evif_link(struct mlxsw_sp_mr_route *mr_route, { struct mlxsw_sp_mr_route_vif_entry *rve; - rve = kzalloc_obj(*rve, GFP_KERNEL); + rve = kzalloc_obj(*rve); if (!rve) return -ENOMEM; rve->mr_route = mr_route; @@ -305,7 +305,7 @@ mlxsw_sp_mr_route_create(struct mlxsw_sp_mr_table *mr_table, int i; /* Allocate and init a new route and fill it with parameters */ - mr_route = kzalloc_obj(*mr_route, GFP_KERNEL); + mr_route = kzalloc_obj(*mr_route); if (!mr_route) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&mr_route->evif_list); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c index f652630cbac1..34f8a6fabfe7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c @@ -52,7 +52,7 @@ mlxsw_sp_mr_erif_sublist_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_mr_erif_sublist *erif_sublist; int err; - erif_sublist = kzalloc_obj(*erif_sublist, GFP_KERNEL); + erif_sublist = kzalloc_obj(*erif_sublist); if (!erif_sublist) return ERR_PTR(-ENOMEM); err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c index 8068502c8c2b..874659d5eb97 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c @@ -216,7 +216,7 @@ mlxsw_sp_nve_mc_list_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nve_mc_list *mc_list; int err; - mc_list = kmalloc_obj(*mc_list, GFP_KERNEL); + mc_list = kmalloc_obj(*mc_list); if (!mc_list) return ERR_PTR(-ENOMEM); @@ -848,7 +848,7 @@ static int mlxsw_sp_nve_ipv6_ht_insert(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nve *nve = mlxsw_sp->nve; int err; - ipv6_ht_node = kzalloc_obj(*ipv6_ht_node, GFP_KERNEL); + ipv6_ht_node = kzalloc_obj(*ipv6_ht_node); if (!ipv6_ht_node) return -ENOMEM; @@ -1119,7 +1119,7 @@ int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_nve *nve; int err; - nve = kzalloc_obj(*mlxsw_sp->nve, GFP_KERNEL); + nve = kzalloc_obj(*mlxsw_sp->nve); if (!nve) return -ENOMEM; mlxsw_sp->nve = nve; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c index 0b6269a40c5a..0cef30fafddd 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c @@ -116,7 +116,7 @@ mlxsw_sp_pgt_entry_create(struct mlxsw_sp_pgt *pgt, u16 mid, u16 smpe) void *ret; int err; - pgt_entry = kzalloc_obj(*pgt_entry, GFP_KERNEL); + pgt_entry = kzalloc_obj(*pgt_entry); if (!pgt_entry) return ERR_PTR(-ENOMEM); @@ -211,7 +211,7 @@ mlxsw_sp_pgt_entry_port_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_pgt_entry_port *pgt_entry_port; int err; - pgt_entry_port = kzalloc_obj(*pgt_entry_port, GFP_KERNEL); + pgt_entry_port = kzalloc_obj(*pgt_entry_port); if (!pgt_entry_port) return ERR_PTR(-ENOMEM); @@ -315,7 +315,7 @@ int mlxsw_sp_pgt_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, PGT_SIZE)) return -EIO; - pgt = kzalloc_obj(*mlxsw_sp->pgt, GFP_KERNEL); + pgt = kzalloc_obj(*mlxsw_sp->pgt); if (!pgt) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c index a6d849c7bb3d..cbad1af0cd80 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c @@ -243,7 +243,7 @@ int mlxsw_sp_policer_add(struct mlxsw_sp *mlxsw_sp, if (err) return err; - policer = kmalloc_obj(*policer, GFP_KERNEL); + policer = kmalloc_obj(*policer); if (!policer) return -ENOMEM; policer->params = *params; @@ -357,7 +357,7 @@ int mlxsw_sp_policers_init(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_policer_core *policer_core; int i, err; - policer_core = kzalloc_obj(*policer_core, GFP_KERNEL); + policer_core = kzalloc_obj(*policer_core); if (!policer_core) return -ENOMEM; mlxsw_sp->policer_core = policer_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c index 4afcb32e7d14..a330d1c0c47c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_port_range.c @@ -52,7 +52,7 @@ mlxsw_sp_port_range_reg_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_port_range_reg *prr; int err; - prr = kzalloc_obj(*prr, GFP_KERNEL); + prr = kzalloc_obj(*prr); if (!prr) return ERR_PTR(-ENOMEM); @@ -172,7 +172,7 @@ int mlxsw_sp_port_range_init(struct mlxsw_sp *mlxsw_sp) */ WARN_ON(max > BITS_PER_BYTE * sizeof(u16)); - pr_core = kzalloc_obj(*mlxsw_sp->pr_core, GFP_KERNEL); + pr_core = kzalloc_obj(*mlxsw_sp->pr_core); if (!pr_core) return -ENOMEM; mlxsw_sp->pr_core = pr_core; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c index 4025b556b39c..9939749c47bc 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c @@ -277,7 +277,7 @@ mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) struct mlxsw_sp1_ptp_clock *clock; int err; - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) return ERR_PTR(-ENOMEM); @@ -446,7 +446,7 @@ mlxsw_sp2_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) struct mlxsw_sp_ptp_clock *clock; int err; - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) return ERR_PTR(-ENOMEM); @@ -1032,7 +1032,7 @@ struct mlxsw_sp_ptp_state *mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp) if (err) return ERR_PTR(err); - ptp_state = kzalloc_obj(*ptp_state, GFP_KERNEL); + ptp_state = kzalloc_obj(*ptp_state); if (!ptp_state) return ERR_PTR(-ENOMEM); ptp_state->common.mlxsw_sp = mlxsw_sp; @@ -1358,7 +1358,7 @@ struct mlxsw_sp_ptp_state *mlxsw_sp2_ptp_init(struct mlxsw_sp *mlxsw_sp) if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, FID)) return ERR_PTR(-EIO); - ptp_state = kzalloc_obj(*ptp_state, GFP_KERNEL); + ptp_state = kzalloc_obj(*ptp_state); if (!ptp_state) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c index 5e159b326100..a4df29aab39d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c @@ -1332,7 +1332,7 @@ __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, int err; if (!ets_data) { - ets_data = kzalloc_obj(*ets_data, GFP_KERNEL); + ets_data = kzalloc_obj(*ets_data); if (!ets_data) return -ENOMEM; mlxsw_sp_qdisc->ets_data = ets_data; @@ -2021,7 +2021,7 @@ static int mlxsw_sp_qevent_mall_replace(struct mlxsw_sp *mlxsw_sp, return -EOPNOTSUPP; } - mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry); if (!mall_entry) return -ENOMEM; mall_entry->cookie = f->cookie; @@ -2100,7 +2100,7 @@ static struct mlxsw_sp_qevent_block *mlxsw_sp_qevent_block_create(struct mlxsw_s { struct mlxsw_sp_qevent_block *qevent_block; - qevent_block = kzalloc_obj(*qevent_block, GFP_KERNEL); + qevent_block = kzalloc_obj(*qevent_block); if (!qevent_block) return NULL; @@ -2132,7 +2132,7 @@ mlxsw_sp_qevent_binding_create(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, { struct mlxsw_sp_qevent_binding *binding; - binding = kzalloc_obj(*binding, GFP_KERNEL); + binding = kzalloc_obj(*binding); if (!binding) return ERR_PTR(-ENOMEM); @@ -2321,7 +2321,7 @@ int mlxsw_sp_tc_qdisc_init(struct mlxsw_sp_port *mlxsw_sp_port) { struct mlxsw_sp_qdisc_state *qdisc_state; - qdisc_state = kzalloc_obj(*qdisc_state, GFP_KERNEL); + qdisc_state = kzalloc_obj(*qdisc_state); if (!qdisc_state) return -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 417431895268..1124f5feeb23 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -538,7 +538,7 @@ static struct mlxsw_sp_fib *mlxsw_sp_fib_create(struct mlxsw_sp *mlxsw_sp, int err; lpm_tree = mlxsw_sp->router->lpm.proto_trees[proto]; - fib = kzalloc_obj(*fib, GFP_KERNEL); + fib = kzalloc_obj(*fib); if (!fib) return ERR_PTR(-ENOMEM); err = rhashtable_init(&fib->ht, &mlxsw_sp_fib_ht_params); @@ -1095,7 +1095,7 @@ mlxsw_sp_crif_alloc(struct net_device *dev) { struct mlxsw_sp_crif *crif; - crif = kzalloc_obj(*crif, GFP_KERNEL); + crif = kzalloc_obj(*crif); if (!crif) return NULL; @@ -1178,7 +1178,7 @@ mlxsw_sp_ipip_entry_alloc(struct mlxsw_sp *mlxsw_sp, int err; ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; - ipip_entry = kzalloc_obj(*ipip_entry, GFP_KERNEL); + ipip_entry = kzalloc_obj(*ipip_entry); if (!ipip_entry) return ERR_PTR(-ENOMEM); @@ -2261,7 +2261,7 @@ mlxsw_sp_neigh_entry_alloc(struct mlxsw_sp *mlxsw_sp, struct neighbour *n, { struct mlxsw_sp_neigh_entry *neigh_entry; - neigh_entry = kzalloc_obj(*neigh_entry, GFP_KERNEL); + neigh_entry = kzalloc_obj(*neigh_entry); if (!neigh_entry) return NULL; @@ -3172,7 +3172,7 @@ mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp) struct mlxsw_sp_nexthop_counter *nhct; int err; - nhct = kzalloc_obj(*nhct, GFP_KERNEL); + nhct = kzalloc_obj(*nhct); if (!nhct) return ERR_PTR(-ENOMEM); @@ -3404,7 +3404,7 @@ mlxsw_sp_nexthop_group_vr_entry_create(struct mlxsw_sp_nexthop_group *nh_grp, struct mlxsw_sp_nexthop_group_vr_entry *vr_entry; int err; - vr_entry = kzalloc_obj(*vr_entry, GFP_KERNEL); + vr_entry = kzalloc_obj(*vr_entry); if (!vr_entry) return -ENOMEM; @@ -5304,7 +5304,7 @@ mlxsw_sp_nexthop_obj_group_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -5841,7 +5841,7 @@ mlxsw_sp_nexthop4_group_create(struct mlxsw_sp *mlxsw_sp, struct fib_info *fi) struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -6481,7 +6481,7 @@ mlxsw_sp_fib4_entry_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fib_entry *fib_entry; int err; - fib4_entry = kzalloc_obj(*fib4_entry, GFP_KERNEL); + fib4_entry = kzalloc_obj(*fib4_entry); if (!fib4_entry) return ERR_PTR(-ENOMEM); fib_entry = &fib4_entry->common; @@ -6601,7 +6601,7 @@ mlxsw_sp_fib_node_create(struct mlxsw_sp_fib *fib, const void *addr, { struct mlxsw_sp_fib_node *fib_node; - fib_node = kzalloc_obj(*fib_node, GFP_KERNEL); + fib_node = kzalloc_obj(*fib_node); if (!fib_node) return NULL; @@ -6906,7 +6906,7 @@ static struct mlxsw_sp_rt6 *mlxsw_sp_rt6_create(struct fib6_info *rt) { struct mlxsw_sp_rt6 *mlxsw_sp_rt6; - mlxsw_sp_rt6 = kzalloc_obj(*mlxsw_sp_rt6, GFP_KERNEL); + mlxsw_sp_rt6 = kzalloc_obj(*mlxsw_sp_rt6); if (!mlxsw_sp_rt6) return ERR_PTR(-ENOMEM); @@ -7098,7 +7098,7 @@ mlxsw_sp_nexthop6_group_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_nexthop_group *nh_grp; int err; - nh_grp = kzalloc_obj(*nh_grp, GFP_KERNEL); + nh_grp = kzalloc_obj(*nh_grp); if (!nh_grp) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&nh_grp->vr_list); @@ -7377,7 +7377,7 @@ mlxsw_sp_fib6_entry_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_rt6 *mlxsw_sp_rt6; int err, i; - fib6_entry = kzalloc_obj(*fib6_entry, GFP_KERNEL); + fib6_entry = kzalloc_obj(*fib6_entry); if (!fib6_entry) return ERR_PTR(-ENOMEM); fib_entry = &fib6_entry->common; @@ -8541,7 +8541,7 @@ mlxsw_sp_router_hwstats_notify_schedule(struct net_device *dev) * later. */ - hws_work = kzalloc_obj(*hws_work, GFP_KERNEL); + hws_work = kzalloc_obj(*hws_work); if (!hws_work) return; @@ -8946,7 +8946,7 @@ mlxsw_sp_rif_mac_profile_alloc(const char *mac) { struct mlxsw_sp_rif_mac_profile *profile; - profile = kzalloc_obj(*profile, GFP_KERNEL); + profile = kzalloc_obj(*profile); if (!profile) return NULL; @@ -11582,7 +11582,7 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, struct notifier_block *nb; int err; - router = kzalloc_obj(*mlxsw_sp->router, GFP_KERNEL); + router = kzalloc_obj(*mlxsw_sp->router); if (!router) return -ENOMEM; mutex_init(&router->lock); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 79b0ed4e4c71..8ee83d35be9a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -1120,7 +1120,7 @@ mlxsw_sp_span_analyzed_port_create(struct mlxsw_sp_span *span, struct mlxsw_sp_span_analyzed_port *analyzed_port; int err; - analyzed_port = kzalloc_obj(*analyzed_port, GFP_KERNEL); + analyzed_port = kzalloc_obj(*analyzed_port); if (!analyzed_port) return ERR_PTR(-ENOMEM); @@ -1505,7 +1505,7 @@ mlxsw_sp_span_trigger_entry_create(struct mlxsw_sp_span *span, struct mlxsw_sp_span_trigger_entry *trigger_entry; int err; - trigger_entry = kzalloc_obj(*trigger_entry, GFP_KERNEL); + trigger_entry = kzalloc_obj(*trigger_entry); if (!trigger_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 7c386ee2ea74..fe45e533a4b2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -262,7 +262,7 @@ mlxsw_sp_bridge_device_create(struct mlxsw_sp_bridge *bridge, return ERR_PTR(-EINVAL); } - bridge_device = kzalloc_obj(*bridge_device, GFP_KERNEL); + bridge_device = kzalloc_obj(*bridge_device); if (!bridge_device) return ERR_PTR(-ENOMEM); @@ -478,7 +478,7 @@ mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device, struct mlxsw_sp_port *mlxsw_sp_port; int err; - bridge_port = kzalloc_obj(*bridge_port, GFP_KERNEL); + bridge_port = kzalloc_obj(*bridge_port); if (!bridge_port) return ERR_PTR(-ENOMEM); @@ -625,7 +625,7 @@ mlxsw_sp_bridge_vlan_create(struct mlxsw_sp_bridge_port *bridge_port, u16 vid) { struct mlxsw_sp_bridge_vlan *bridge_vlan; - bridge_vlan = kzalloc_obj(*bridge_vlan, GFP_KERNEL); + bridge_vlan = kzalloc_obj(*bridge_vlan); if (!bridge_vlan) return NULL; @@ -1131,7 +1131,7 @@ mlxsw_sp_mdb_entry_port_get(struct mlxsw_sp *mlxsw_sp, if (err) return ERR_PTR(err); - mdb_entry_port = kzalloc_obj(*mdb_entry_port, GFP_KERNEL); + mdb_entry_port = kzalloc_obj(*mdb_entry_port); if (!mdb_entry_port) { err = -ENOMEM; goto err_mdb_entry_port_alloc; @@ -1195,7 +1195,7 @@ mlxsw_sp_mdb_entry_mrouter_port_get(struct mlxsw_sp *mlxsw_sp, if (err) return ERR_PTR(err); - mdb_entry_port = kzalloc_obj(*mdb_entry_port, GFP_KERNEL); + mdb_entry_port = kzalloc_obj(*mdb_entry_port); if (!mdb_entry_port) { err = -ENOMEM; goto err_mdb_entry_port_alloc; @@ -2027,7 +2027,7 @@ mlxsw_sp_mc_mdb_entry_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_mdb_entry *mdb_entry; int err; - mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry); if (!mdb_entry) return ERR_PTR(-ENOMEM); @@ -4169,7 +4169,7 @@ int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp) { struct mlxsw_sp_bridge *bridge; - bridge = kzalloc_obj(*mlxsw_sp->bridge, GFP_KERNEL); + bridge = kzalloc_obj(*mlxsw_sp->bridge); if (!bridge) return -ENOMEM; mlxsw_sp->bridge = bridge; diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index e594ea78b118..4b15fe4c30fb 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -6577,7 +6577,7 @@ static int pcidev_init(struct pci_dev *pdev, const struct pci_device_id *id) result = -ENOMEM; - info = kzalloc_obj(struct platform_info, GFP_KERNEL); + info = kzalloc_obj(struct platform_info); if (!info) goto pcidev_init_dev_err; @@ -6630,7 +6630,7 @@ static int pcidev_init(struct pci_dev *pdev, const struct pci_device_id *id) mib_port_count = SWITCH_PORT_NUM; } hw->mib_port_cnt = TOTAL_PORT_NUM; - hw->ksz_switch = kzalloc_obj(struct ksz_switch, GFP_KERNEL); + hw->ksz_switch = kzalloc_obj(struct ksz_switch); if (!hw->ksz_switch) goto pcidev_init_alloc_err; diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c index 7ab6ad877a3c..a3845edf0e48 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -2141,7 +2141,7 @@ static int lan743x_tx_ring_init(struct lan743x_tx *tx) tx->ring_cpu_ptr = (struct lan743x_tx_descriptor *)cpu_ptr; tx->ring_dma_ptr = dma_ptr; - cpu_ptr = kzalloc_objs(*tx->buffer_info, tx->ring_size, GFP_KERNEL); + cpu_ptr = kzalloc_objs(*tx->buffer_info, tx->ring_size); if (!cpu_ptr) { ret = -ENOMEM; goto cleanup; @@ -2686,7 +2686,7 @@ static int lan743x_rx_ring_init(struct lan743x_rx *rx) rx->ring_cpu_ptr = (struct lan743x_rx_descriptor *)cpu_ptr; rx->ring_dma_ptr = dma_ptr; - cpu_ptr = kzalloc_objs(*rx->buffer_info, rx->ring_size, GFP_KERNEL); + cpu_ptr = kzalloc_objs(*rx->buffer_info, rx->ring_size); if (!cpu_ptr) { ret = -ENOMEM; goto cleanup; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c index cddd5dd35feb..95cbbe5b513a 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdb.c @@ -46,7 +46,7 @@ static void lan966x_fdb_add_entry(struct lan966x *lan966x, return; } - fdb_entry = kzalloc_obj(*fdb_entry, GFP_KERNEL); + fdb_entry = kzalloc_obj(*fdb_entry); if (!fdb_entry) return; diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c b/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c index aef4bc288e05..a4722140675d 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_mdb.c @@ -74,7 +74,7 @@ lan966x_mdb_entry_add(struct lan966x *lan966x, { struct lan966x_mdb_entry *mdb_entry; - mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry); if (!mdb_entry) return ERR_PTR(-ENOMEM); @@ -184,7 +184,7 @@ lan966x_pgid_entry_add(struct lan966x *lan966x, int index, u16 ports) { struct lan966x_pgid_entry *pgid_entry; - pgid_entry = kzalloc_obj(*pgid_entry, GFP_KERNEL); + pgid_entry = kzalloc_obj(*pgid_entry); if (!pgid_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c index cb07178f55fa..72e3b189bac5 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c @@ -611,7 +611,7 @@ lan966x_vcap_admin_alloc(struct lan966x *lan966x, struct vcap_control *ctrl, { struct vcap_admin *admin; - admin = kzalloc_obj(*admin, GFP_KERNEL); + admin = kzalloc_obj(*admin); if (!admin) return ERR_PTR(-ENOMEM); @@ -712,7 +712,7 @@ int lan966x_vcap_init(struct lan966x *lan966x) struct vcap_admin *admin; struct dentry *dir; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c index 57a24cbfb398..c7e0e58ff0f7 100644 --- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c +++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c @@ -186,7 +186,7 @@ static int lan969x_fdma_tx_alloc(struct sparx5 *sparx5) struct fdma *fdma = &tx->fdma; int err; - tx->dbs = kzalloc_objs(struct sparx5_tx_buf, fdma->n_dcbs, GFP_KERNEL); + tx->dbs = kzalloc_objs(struct sparx5_tx_buf, fdma->n_dcbs); if (!tx->dbs) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c index 19321de0712e..8c67ff1d411b 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c @@ -585,7 +585,7 @@ int sparx5_config_dsm_calendar(struct sparx5 *sparx5) struct sparx5_calendar_data *data; int err = 0; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c index 6743c5ef3efd..644458108dd2 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c @@ -465,7 +465,7 @@ static int sparx5_alloc_mdb_entry(struct sparx5 *sparx5, u16 pgid_idx; int err; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index 57d88fe32752..f779a5c00803 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -1464,7 +1464,7 @@ static int sparx5_tc_flower_template_create(struct net_device *ndev, return -EBUSY; } - ftp = kzalloc_obj(*ftp, GFP_KERNEL); + ftp = kzalloc_obj(*ftp); if (!ftp) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c index cd0f44a6c88e..702257979462 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c @@ -60,7 +60,7 @@ static int sparx5_tc_matchall_replace(struct net_device *ndev, } action = &tmo->rule->action.entries[0]; - mall_entry = kzalloc_obj(*mall_entry, GFP_KERNEL); + mall_entry = kzalloc_obj(*mall_entry); if (!mall_entry) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c index 4bf3be00d627..3d64a0448d43 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c @@ -1944,7 +1944,7 @@ sparx5_vcap_admin_alloc(struct sparx5 *sparx5, struct vcap_control *ctrl, { struct vcap_admin *admin; - admin = kzalloc_obj(*admin, GFP_KERNEL); + admin = kzalloc_obj(*admin); if (!admin) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&admin->list); @@ -2047,7 +2047,7 @@ int sparx5_vcap_init(struct sparx5 *sparx5) * - Initialize VCAP blocks * - Configure port keysets */ - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index 29fe5101db4c..0fdb5e363bad 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -1004,7 +1004,7 @@ static struct vcap_rule_internal *vcap_dup_rule(struct vcap_rule_internal *ri, struct vcap_rule_internal *duprule; /* Allocate the client part */ - duprule = kzalloc_obj(*duprule, GFP_KERNEL); + duprule = kzalloc_obj(*duprule); if (!duprule) return ERR_PTR(-ENOMEM); *duprule = *ri; @@ -1309,7 +1309,7 @@ static void vcap_rule_alloc_keyfield(struct vcap_rule_internal *ri, { struct vcap_client_keyfield *field; - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) return; INIT_LIST_HEAD(&field->ctrl.list); @@ -1418,7 +1418,7 @@ static void vcap_rule_alloc_actionfield(struct vcap_rule_internal *ri, { struct vcap_client_actionfield *field; - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) return; INIT_LIST_HEAD(&field->ctrl.list); @@ -2345,7 +2345,7 @@ struct vcap_rule *vcap_alloc_rule(struct vcap_control *vctrl, } /* Create a container for the rule and return it */ - ri = kzalloc_obj(*ri, GFP_KERNEL); + ri = kzalloc_obj(*ri); if (!ri) { err = -ENOMEM; goto out_unlock; @@ -2689,7 +2689,7 @@ static int vcap_rule_add_key(struct vcap_rule *rule, return -EINVAL; } - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) return -ENOMEM; memcpy(&field->data, data, sizeof(field->data)); @@ -2857,7 +2857,7 @@ static int vcap_rule_add_action(struct vcap_rule *rule, return -EINVAL; } - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) return -ENOMEM; memcpy(&field->data, data, sizeof(field->data)); @@ -3125,7 +3125,7 @@ static int vcap_enable(struct vcap_control *vctrl, struct net_device *ndev, if (!admin) return -ENOENT; - eport = kzalloc_obj(*eport, GFP_KERNEL); + eport = kzalloc_obj(*eport); if (!eport) return -ENOMEM; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c index c57919278783..ce26ccbdccdf 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c @@ -2037,7 +2037,7 @@ static void vcap_api_filter_unsupported_keys_test(struct kunit *test) /* Add all keys to the rule */ INIT_LIST_HEAD(&ri.data.keyfields); for (idx = 0; idx < ARRAY_SIZE(keylist); idx++) { - ckf = kzalloc_obj(*ckf, GFP_KERNEL); + ckf = kzalloc_obj(*ckf); if (ckf) { ckf->ctrl.key = keylist[idx]; list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); @@ -2161,7 +2161,7 @@ static void vcap_api_filter_keylist_test(struct kunit *test) /* Add all keys to the rule */ INIT_LIST_HEAD(&ri.data.keyfields); for (idx = 0; idx < ARRAY_SIZE(keylist); idx++) { - ckf = kzalloc_obj(*ckf, GFP_KERNEL); + ckf = kzalloc_obj(*ckf); if (ckf) { ckf->ctrl.key = keylist[idx]; list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index dc7c29240cac..f5deed37567b 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -923,7 +923,7 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd, struct gdma_queue *queue; int err; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return -ENOMEM; @@ -1062,7 +1062,7 @@ int mana_gd_create_mana_eq(struct gdma_dev *gd, if (spec->type != GDMA_EQ) return -EINVAL; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return -ENOMEM; @@ -1115,7 +1115,7 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd, spec->type != GDMA_RQ) return -EINVAL; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return -ENOMEM; @@ -1625,7 +1625,7 @@ static int mana_gd_setup_dyn_irqs(struct pci_dev *pdev, int nvec) bool skip_first_cpu = false; int *irqs, irq, err, i; - irqs = kmalloc_objs(int, nvec, GFP_KERNEL); + irqs = kmalloc_objs(int, nvec); if (!irqs) return -ENOMEM; @@ -1636,7 +1636,7 @@ static int mana_gd_setup_dyn_irqs(struct pci_dev *pdev, int nvec) * further used in irq_setup() */ for (i = 1; i <= nvec; i++) { - gic = kzalloc_obj(*gic, GFP_KERNEL); + gic = kzalloc_obj(*gic); if (!gic) { err = -ENOMEM; goto free_irq; @@ -1707,14 +1707,14 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev, int nvec) unsigned int cpu; int err, i; - irqs = kmalloc_objs(int, nvec, GFP_KERNEL); + irqs = kmalloc_objs(int, nvec); if (!irqs) return -ENOMEM; start_irqs = irqs; for (i = 0; i < nvec; i++) { - gic = kzalloc_obj(*gic, GFP_KERNEL); + gic = kzalloc_obj(*gic); if (!gic) { err = -ENOMEM; goto free_irq; @@ -2071,7 +2071,7 @@ disable_dev: dev_info(&pdev->dev, "Start MANA recovery mode\n"); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return err; diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c index f2221e65a6a3..9ee0f7f110dd 100644 --- a/drivers/net/ethernet/microsoft/mana/hw_channel.c +++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c @@ -407,7 +407,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, if (cq_size < MANA_MIN_QSIZE) cq_size = MANA_MIN_QSIZE; - hwc_cq = kzalloc_obj(*hwc_cq, GFP_KERNEL); + hwc_cq = kzalloc_obj(*hwc_cq); if (!hwc_cq) return -ENOMEM; @@ -426,7 +426,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, } hwc_cq->gdma_cq = cq; - comp_buf = kzalloc_objs(*comp_buf, q_depth, GFP_KERNEL); + comp_buf = kzalloc_objs(*comp_buf, q_depth); if (!comp_buf) { err = -ENOMEM; goto out; @@ -539,7 +539,7 @@ static int mana_hwc_create_wq(struct hw_channel_context *hwc, if (queue_size < MANA_MIN_QSIZE) queue_size = MANA_MIN_QSIZE; - hwc_wq = kzalloc_obj(*hwc_wq, GFP_KERNEL); + hwc_wq = kzalloc_obj(*hwc_wq); if (!hwc_wq) return -ENOMEM; @@ -644,7 +644,7 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth, return err; } - ctx = kzalloc_objs(*ctx, q_depth, GFP_KERNEL); + ctx = kzalloc_objs(*ctx, q_depth); if (!ctx) return -ENOMEM; @@ -750,7 +750,7 @@ int mana_hwc_create_channel(struct gdma_context *gc) u16 q_depth_max; int err; - hwc = kzalloc_obj(*hwc, GFP_KERNEL); + hwc = kzalloc_obj(*hwc); if (!hwc) return -ENOMEM; diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 5c9704f2041a..dad52eaa152f 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -803,7 +803,7 @@ int mana_pre_alloc_rxbufs(struct mana_port_context *mpc, int new_mtu, int num_qu if (!mpc->rxbufs_pre) goto error; - mpc->das_pre = kmalloc_objs(dma_addr_t, num_rxb, GFP_KERNEL); + mpc->das_pre = kmalloc_objs(dma_addr_t, num_rxb); if (!mpc->das_pre) goto error; @@ -995,7 +995,7 @@ static void mana_cleanup_indir_table(struct mana_port_context *apc) static int mana_init_port_context(struct mana_port_context *apc) { - apc->rxqs = kzalloc_objs(struct mana_rxq *, apc->num_queues, GFP_KERNEL); + apc->rxqs = kzalloc_objs(struct mana_rxq *, apc->num_queues); return !apc->rxqs ? -ENOMEM : 0; } @@ -1632,7 +1632,7 @@ static int mana_create_eq(struct mana_context *ac) int err; int i; - ac->eqs = kzalloc_objs(struct mana_eq, gc->max_num_queues, GFP_KERNEL); + ac->eqs = kzalloc_objs(struct mana_eq, gc->max_num_queues); if (!ac->eqs) return -ENOMEM; @@ -3415,7 +3415,7 @@ static int add_adev(struct gdma_dev *gd, const char *name) struct mana_adev *madev; int ret; - madev = kzalloc_obj(*madev, GFP_KERNEL); + madev = kzalloc_obj(*madev); if (!madev) return -ENOMEM; @@ -3559,7 +3559,7 @@ int mana_probe(struct gdma_dev *gd, bool resuming) return err; if (!resuming) { - ac = kzalloc_obj(*ac, GFP_KERNEL); + ac = kzalloc_obj(*ac); if (!ac) return -ENOMEM; diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index a572170506cb..67ecd0e91002 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -576,7 +576,7 @@ static int ocelot_update_vlan_reclassify_rule(struct ocelot *ocelot, int port) } /* Filter doesn't exist, create it */ - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; @@ -682,7 +682,7 @@ static int ocelot_vlan_member_add(struct ocelot *ocelot, int port, u16 vid, return 0; } - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return -ENOMEM; @@ -1664,7 +1664,7 @@ int ocelot_trap_add(struct ocelot *ocelot, int port, trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie, false); if (!trap) { - trap = kzalloc_obj(*trap, GFP_KERNEL); + trap = kzalloc_obj(*trap); if (!trap) return -ENOMEM; @@ -2046,7 +2046,7 @@ static struct ocelot_pgid *ocelot_pgid_alloc(struct ocelot *ocelot, int index, { struct ocelot_pgid *pgid; - pgid = kzalloc_obj(*pgid, GFP_KERNEL); + pgid = kzalloc_obj(*pgid); if (!pgid) return ERR_PTR(-ENOMEM); @@ -2563,7 +2563,7 @@ int ocelot_lag_fdb_add(struct ocelot *ocelot, struct net_device *bond, struct ocelot_lag_fdb *fdb; int lag, err; - fdb = kzalloc_obj(*fdb, GFP_KERNEL); + fdb = kzalloc_obj(*fdb); if (!fdb) return -ENOMEM; @@ -2894,7 +2894,7 @@ struct ocelot_mirror *ocelot_mirror_get(struct ocelot *ocelot, int to, return m; } - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (!m) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c index 4fccc8adad56..844292eb7422 100644 --- a/drivers/net/ethernet/mscc/ocelot_flower.c +++ b/drivers/net/ethernet/mscc/ocelot_flower.c @@ -833,7 +833,7 @@ static struct ocelot_vcap_filter { struct ocelot_vcap_filter *filter; - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return NULL; diff --git a/drivers/net/ethernet/mscc/ocelot_mrp.c b/drivers/net/ethernet/mscc/ocelot_mrp.c index 04ae7a156f22..51e0157c4dac 100644 --- a/drivers/net/ethernet/mscc/ocelot_mrp.c +++ b/drivers/net/ethernet/mscc/ocelot_mrp.c @@ -54,7 +54,7 @@ static int ocelot_mrp_redirect_add_vcap(struct ocelot *ocelot, int src_port, struct ocelot_vcap_filter *filter; int err; - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) return -ENOMEM; diff --git a/drivers/net/ethernet/mscc/ocelot_vcap.c b/drivers/net/ethernet/mscc/ocelot_vcap.c index ec193ed18050..25e533e91d71 100644 --- a/drivers/net/ethernet/mscc/ocelot_vcap.c +++ b/drivers/net/ethernet/mscc/ocelot_vcap.c @@ -910,7 +910,7 @@ int ocelot_vcap_policer_add(struct ocelot *ocelot, u32 pol_ix, return 0; } - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/abm/cls.c b/drivers/net/ethernet/netronome/nfp/abm/cls.c index 5cb4bb03b2a5..f7894c415a2f 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/cls.c +++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c @@ -203,7 +203,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink, } if (!match) { - match = kzalloc_obj(*match, GFP_KERNEL); + match = kzalloc_obj(*match); if (!match) return -ENOMEM; list_add(&match->list, &alink->dscp_map); diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.c b/drivers/net/ethernet/netronome/nfp/abm/main.c index b4c85bb0f787..9b6bda523191 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/main.c +++ b/drivers/net/ethernet/netronome/nfp/abm/main.c @@ -317,7 +317,7 @@ nfp_abm_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id) struct nfp_abm_link *alink; int err; - alink = kzalloc_obj(*alink, GFP_KERNEL); + alink = kzalloc_obj(*alink); if (!alink) return -ENOMEM; nn->app_priv = alink; @@ -461,7 +461,7 @@ static int nfp_abm_init(struct nfp_app *app) return -EINVAL; } - abm = kzalloc_obj(*abm, GFP_KERNEL); + abm = kzalloc_obj(*abm); if (!abm) return -ENOMEM; app->priv = abm; diff --git a/drivers/net/ethernet/netronome/nfp/abm/qdisc.c b/drivers/net/ethernet/netronome/nfp/abm/qdisc.c index a030b59901c9..900d416bcf8b 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/qdisc.c +++ b/drivers/net/ethernet/netronome/nfp/abm/qdisc.c @@ -344,7 +344,7 @@ nfp_abm_qdisc_alloc(struct net_device *netdev, struct nfp_abm_link *alink, struct nfp_qdisc *qdisc; int err; - qdisc = kzalloc_obj(*qdisc, GFP_KERNEL); + qdisc = kzalloc_obj(*qdisc); if (!qdisc) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c index d9591ca44a8f..608c1bcaa641 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c @@ -76,7 +76,7 @@ nfp_bpf_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id) return -EINVAL; } - bv = kzalloc_obj(*bv, GFP_KERNEL); + bv = kzalloc_obj(*bv); if (!bv) return -ENOMEM; nn->app_priv = bv; @@ -458,7 +458,7 @@ static int nfp_bpf_init(struct nfp_app *app) struct nfp_app_bpf *bpf; int err; - bpf = kzalloc_obj(*bpf, GFP_KERNEL); + bpf = kzalloc_obj(*bpf); if (!bpf) return -ENOMEM; bpf->app = app; diff --git a/drivers/net/ethernet/netronome/nfp/bpf/offload.c b/drivers/net/ethernet/netronome/nfp/bpf/offload.c index 2b22725fb8a6..1fcd53af4479 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/offload.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/offload.c @@ -48,7 +48,7 @@ nfp_map_ptr_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, */ bpf_map_inc(map); - record = kmalloc_obj(*record, GFP_KERNEL); + record = kmalloc_obj(*record); if (!record) { err = -ENOMEM; goto err_map_put; @@ -154,7 +154,7 @@ nfp_prog_prepare(struct nfp_prog *nfp_prog, const struct bpf_insn *prog, unsigned int i; for (i = 0; i < cnt; i++) { - meta = kzalloc_obj(*meta, GFP_KERNEL); + meta = kzalloc_obj(*meta); if (!meta) return -ENOMEM; @@ -192,7 +192,7 @@ static int nfp_bpf_verifier_prep(struct bpf_prog *prog) struct nfp_prog *nfp_prog; int ret; - nfp_prog = kzalloc_obj(*nfp_prog, GFP_KERNEL); + nfp_prog = kzalloc_obj(*nfp_prog); if (!nfp_prog) return -ENOMEM; prog->aux->offload->dev_priv = nfp_prog; diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index 178184a68816..c983e8b1799d 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -1355,7 +1355,7 @@ nfp_fl_ct_zone_entry *get_nfp_zone_entry(struct nfp_flower_priv *priv, if (IS_ERR(zt) || zt->priv) return zt; } else { - zt = kzalloc_obj(*zt, GFP_KERNEL); + zt = kzalloc_obj(*zt); if (!zt) return ERR_PTR(-ENOMEM); } @@ -1487,7 +1487,7 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_action_entry *act; int err, i; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); @@ -1501,7 +1501,7 @@ nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt, * to do a full copy instead of just a reference. */ if (is_nft) { - nft_match = kzalloc_obj(*nft_match, GFP_KERNEL); + nft_match = kzalloc_obj(*nft_match); if (!nft_match) { err = -ENOMEM; goto err_pre_ct_act; diff --git a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c index 9b78cc9600fe..1c61d4a83e8b 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c @@ -119,7 +119,7 @@ nfp_fl_lag_group_create(struct nfp_fl_lag *lag, struct net_device *master) return ERR_PTR(id); } - group = kmalloc_obj(*group, GFP_KERNEL); + group = kmalloc_obj(*group); if (!group) { ida_free(&lag->ida_handle, id); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c index 4677183322bc..5c5fc640d65b 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c @@ -182,7 +182,7 @@ nfp_flower_non_repr_priv_get(struct nfp_app *app, struct net_device *netdev) if (entry) goto inc_ref; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -406,7 +406,7 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app, goto err_reprs_clean; } - repr_priv = kzalloc_obj(*repr_priv, GFP_KERNEL); + repr_priv = kzalloc_obj(*repr_priv); if (!repr_priv) { err = -ENOMEM; nfp_repr_free(repr); @@ -524,7 +524,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv) goto err_reprs_clean; } - repr_priv = kzalloc_obj(*repr_priv, GFP_KERNEL); + repr_priv = kzalloc_obj(*repr_priv); if (!repr_priv) { err = -ENOMEM; nfp_repr_free(repr); diff --git a/drivers/net/ethernet/netronome/nfp/flower/metadata.c b/drivers/net/ethernet/netronome/nfp/flower/metadata.c index fbb858a5324b..ca9e5dab2ec7 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/metadata.c +++ b/drivers/net/ethernet/netronome/nfp/flower/metadata.c @@ -214,7 +214,7 @@ nfp_add_mask_table(struct nfp_app *app, char *mask_data, u32 mask_len) if (nfp_mask_alloc(app, &mask_id)) return -ENOENT; - mask_entry = kmalloc_obj(*mask_entry, GFP_KERNEL); + mask_entry = kmalloc_obj(*mask_entry); if (!mask_entry) { nfp_release_mask_id(app, mask_id); return -ENOMEM; @@ -324,7 +324,7 @@ int nfp_compile_flow_metadata(struct nfp_app *app, u32 cookie, nfp_flow->meta.host_cookie = cpu_to_be64(cookie); nfp_flow->ingress_dev = netdev; - ctx_entry = kzalloc_obj(*ctx_entry, GFP_KERNEL); + ctx_entry = kzalloc_obj(*ctx_entry); if (!ctx_entry) { err = -ENOMEM; goto err_release_stats; @@ -573,7 +573,7 @@ int nfp_flower_metadata_init(struct nfp_app *app, u64 host_ctx_count, stats_size = FIELD_PREP(NFP_FL_STAT_ID_STAT, host_ctx_count) | FIELD_PREP(NFP_FL_STAT_ID_MU_NUM, host_num_mems - 1); - priv->stats = kvmalloc_objs(struct nfp_fl_stats, stats_size, GFP_KERNEL); + priv->stats = kvmalloc_objs(struct nfp_fl_stats, stats_size); if (!priv->stats) goto err_free_ring_buf; diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index b6e1e33d3f27..161190200dbd 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -549,7 +549,7 @@ nfp_flower_allocate_new(struct nfp_fl_key_ls *key_layer) { struct nfp_fl_payload *flow_pay; - flow_pay = kmalloc_obj(*flow_pay, GFP_KERNEL); + flow_pay = kmalloc_obj(*flow_pay); if (!flow_pay) return NULL; @@ -979,7 +979,7 @@ static int nfp_flower_link_flows(struct nfp_fl_payload *merge_flow, { struct nfp_fl_payload_link *link; - link = kmalloc_obj(*link, GFP_KERNEL); + link = kmalloc_obj(*link); if (!link) return -ENOMEM; @@ -1067,7 +1067,7 @@ int nfp_flower_merge_offloaded_flows(struct nfp_app *app, if (err) goto err_release_metadata; - merge_info = kmalloc_obj(*merge_info, GFP_KERNEL); + merge_info = kmalloc_obj(*merge_info); if (!merge_info) { err = -ENOMEM; goto err_remove_rhash; @@ -1354,7 +1354,7 @@ nfp_flower_add_offload(struct nfp_app *app, struct net_device *netdev, if (!offload_pre_check(flow)) return -EOPNOTSUPP; - key_layer = kmalloc_obj(*key_layer, GFP_KERNEL); + key_layer = kmalloc_obj(*key_layer); if (!key_layer) return -ENOMEM; @@ -1400,7 +1400,7 @@ nfp_flower_add_offload(struct nfp_app *app, struct net_device *netdev, if (priv->flower_ext_feats & NFP_FL_FEATS_DECAP_V2) { struct nfp_predt_entry *predt; - predt = kzalloc_obj(*predt, GFP_KERNEL); + predt = kzalloc_obj(*predt); if (!predt) { err = -ENOMEM; goto err_remove_rhash; @@ -1901,7 +1901,7 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct Qdisc *sch, str &nfp_block_cb_list)) return -EBUSY; - cb_priv = kmalloc_obj(*cb_priv, GFP_KERNEL); + cb_priv = kmalloc_obj(*cb_priv); if (!cb_priv) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c b/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c index 6a7f806b3fdf..8c7d838920cb 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/qos_conf.c @@ -579,7 +579,7 @@ nfp_flower_add_meter_entry(struct nfp_app *app, u32 meter_id) if (meter_entry) return meter_entry; - meter_entry = kzalloc_obj(*meter_entry, GFP_KERNEL); + meter_entry = kzalloc_obj(*meter_entry); if (!meter_entry) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c index e0d32ddc80c3..0cef0e2b85d0 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -884,7 +884,7 @@ void nfp_tunnel_add_ipv4_off(struct nfp_app *app, __be32 ipv4) } } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { mutex_unlock(&priv->tun.ipv4_off_lock); nfp_flower_cmsg_warn(app, "Mem error when offloading IP address.\n"); @@ -959,7 +959,7 @@ nfp_tunnel_add_ipv6_off(struct nfp_app *app, struct in6_addr *ipv6) return entry; } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { mutex_unlock(&priv->tun.ipv6_off_lock); nfp_flower_cmsg_warn(app, "Mem error when offloading IP address.\n"); @@ -1117,7 +1117,7 @@ nfp_tunnel_add_shared_mac(struct nfp_app *app, struct net_device *netdev, } if (!entry) { - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto err_free_ida; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_app.c b/drivers/net/ethernet/netronome/nfp/nfp_app.c index f53418136c37..ad70c9c2e333 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_app.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_app.c @@ -239,7 +239,7 @@ struct nfp_app *nfp_app_alloc(struct nfp_pf *pf, enum nfp_app_id id) if (WARN_ON(!apps[id]->ctrl_msg_rx && apps[id]->ctrl_msg_rx_raw)) return ERR_PTR(-EINVAL); - app = kzalloc_obj(*app, GFP_KERNEL); + app = kzalloc_obj(*app); if (!app) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index bebf7e7c4a86..a9c7bab489b2 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -1554,7 +1554,7 @@ struct nfp_net_dp *nfp_net_clone_dp(struct nfp_net *nn) { struct nfp_net_dp *new; - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c b/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c index cbb983729f22..3e8222886fe4 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_dp.c @@ -184,7 +184,7 @@ int nfp_net_tx_rings_prepare(struct nfp_net *nn, struct nfp_net_dp *dp) { unsigned int r; - dp->tx_rings = kzalloc_objs(*dp->tx_rings, dp->num_tx_rings, GFP_KERNEL); + dp->tx_rings = kzalloc_objs(*dp->tx_rings, dp->num_tx_rings); if (!dp->tx_rings) return -ENOMEM; @@ -339,7 +339,7 @@ int nfp_net_rx_rings_prepare(struct nfp_net *nn, struct nfp_net_dp *dp) { unsigned int r; - dp->rx_rings = kzalloc_objs(*dp->rx_rings, dp->num_rx_rings, GFP_KERNEL); + dp->rx_rings = kzalloc_objs(*dp->rx_rings, dp->num_rx_rings); if (!dp->rx_rings) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c index 16bf77708b9e..a2a89d48e3ca 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -713,7 +713,7 @@ static int nfp_test_nsp(struct net_device *netdev) goto exit_close_nsp; } - nspi = kzalloc_obj(*nspi, GFP_KERNEL); + nspi = kzalloc_obj(*nspi); if (!nspi) { err = -ENOMEM; goto exit_close_nsp; @@ -1676,7 +1676,7 @@ static int nfp_net_fs_add(struct nfp_net *nn, struct ethtool_rxnfc *cmd) if (unsupp_mask) return -EOPNOTSUPP; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index 061d1ba89760..b5646c884371 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -93,7 +93,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, dev_info = &nfp_dev_info[pci_id->driver_data]; - vf = kzalloc_obj(*vf, GFP_KERNEL); + vf = kzalloc_obj(*vf); if (!vf) return -ENOMEM; pci_set_drvdata(pdev, vf); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c index 1ce12ad44d2f..7f5de6bd7218 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_port.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c @@ -203,7 +203,7 @@ nfp_port_alloc(struct nfp_app *app, enum nfp_port_type type, { struct nfp_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c index ff16af23fc3a..0bc9e517c4fd 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c @@ -1320,7 +1320,7 @@ nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev, const struct nfp_dev_info *dev_i dev_info->chip_names); pcie_print_link_status(pdev); - nfp = kzalloc_obj(*nfp, GFP_KERNEL); + nfp = kzalloc_obj(*nfp); if (!nfp) { err = -ENOMEM; goto err_ret; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c index 06ebad34c00b..85d3554a79a9 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c @@ -802,7 +802,7 @@ int nfp_cpp_area_cache_add(struct nfp_cpp *cpp, size_t size) if (!area) return -ENOMEM; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (!cache) { nfp_cpp_area_free(area); return -ENOMEM; @@ -1170,7 +1170,7 @@ nfp_cpp_from_operations(const struct nfp_cpp_operations *ops, u32 xpbaddr; size_t tgt; - cpp = kzalloc_obj(*cpp, GFP_KERNEL); + cpp = kzalloc_obj(*cpp); if (!cpp) { err = -ENOMEM; goto err_malloc; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c index 93b11eaf7d9f..aa787c502913 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mip.c @@ -101,7 +101,7 @@ const struct nfp_mip *nfp_mip_open(struct nfp_cpp *cpp) struct nfp_mip *mip; int err; - mip = kmalloc_obj(*mip, GFP_KERNEL); + mip = kmalloc_obj(*mip); if (!mip) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c index d017b7779819..f079284c0ecd 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c @@ -140,7 +140,7 @@ struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target, if (tmp != key) return NULL; - mutex = kzalloc_obj(*mutex, GFP_KERNEL); + mutex = kzalloc_obj(*mutex); if (!mutex) return NULL; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c index 4ad0f7586ba1..69c2fb9bea48 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c @@ -163,7 +163,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) u32 info_ver; int err; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c index a874a5f233a6..5a1aadf6e17e 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c @@ -280,7 +280,7 @@ struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp) if (IS_ERR(res)) return ERR_CAST(res); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { nfp_resource_release(res); return ERR_PTR(-ENOMEM); @@ -514,7 +514,7 @@ nfp_nsp_command_buf_dma_sg(struct nfp_nsp *nsp, dma_size = BIT_ULL(dma_order); nseg = DIV_ROUND_UP(max_size, chunk_size); - chunks = kzalloc_objs(*chunks, nseg, GFP_KERNEL); + chunks = kzalloc_objs(*chunks, nseg); if (!chunks) return -ENOMEM; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c index 33ff357b6fc6..d39c8f282199 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_cmds.c @@ -29,7 +29,7 @@ struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp) if (nfp_nsp_get_abi_ver_minor(nsp) < 15) return NULL; - ni = kzalloc_obj(*ni, GFP_KERNEL); + ni = kzalloc_obj(*ni); if (!ni) return NULL; @@ -40,7 +40,7 @@ struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp) goto exit_free; } - nspi = kzalloc_obj(*nspi, GFP_KERNEL); + nspi = kzalloc_obj(*nspi); if (!nspi) goto exit_free; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c index 54089663bbd7..6d5833479d12 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.c @@ -155,7 +155,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name) struct nfp_resource *res; int err; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/netronome/nfp/nic/main.c b/drivers/net/ethernet/netronome/nfp/nic/main.c index 82ec6d9018b0..f7a4d76899c2 100644 --- a/drivers/net/ethernet/netronome/nfp/nic/main.c +++ b/drivers/net/ethernet/netronome/nfp/nic/main.c @@ -51,7 +51,7 @@ static int nfp_nic_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, return err; if (sizeof(*app_pri)) { - nn->app_priv = kzalloc_obj(*app_pri, GFP_KERNEL); + nn->app_priv = kzalloc_obj(*app_pri); if (!nn->app_priv) return -ENOMEM; } diff --git a/drivers/net/ethernet/pensando/ionic/ionic_aux.c b/drivers/net/ethernet/pensando/ionic/ionic_aux.c index 4c9db73cef23..4f193d0ee87a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_aux.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_aux.c @@ -26,7 +26,7 @@ int ionic_auxbus_register(struct ionic_lif *lif) if (!(le64_to_cpu(lif->ionic->ident.lif.capabilities) & IONIC_LIF_CAP_RDMA)) return 0; - ionic_adev = kzalloc_obj(*ionic_adev, GFP_KERNEL); + ionic_adev = kzalloc_obj(*ionic_adev); if (!ionic_adev) return -ENOMEM; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 104e1d35e0be..05f19489ec5c 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -151,7 +151,7 @@ static int ionic_vf_alloc(struct ionic *ionic, int num_vfs) down_write(&ionic->vf_op_lock); - ionic->vfs = kzalloc_objs(struct ionic_vf, num_vfs, GFP_KERNEL); + ionic->vfs = kzalloc_objs(struct ionic_vf, num_vfs); if (!ionic->vfs) { err = -ENOMEM; goto out; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 050dd3168f6b..8d040e611d5a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2694,7 +2694,7 @@ static int ionic_register_rxq_info(struct ionic_queue *q, unsigned int napi_id) struct xdp_rxq_info *rxq_info; int err; - rxq_info = kzalloc_obj(*rxq_info, GFP_KERNEL); + rxq_info = kzalloc_obj(*rxq_info); if (!rxq_info) return -ENOMEM; @@ -3177,7 +3177,7 @@ static int ionic_affinity_masks_alloc(struct ionic *ionic) int nintrs = ionic->nintrs; int i; - affinity_masks = kzalloc_objs(cpumask_var_t, nintrs, GFP_KERNEL); + affinity_masks = kzalloc_objs(cpumask_var_t, nintrs); if (!affinity_masks) return -ENOMEM; @@ -3218,7 +3218,7 @@ int ionic_lif_alloc(struct ionic *ionic) int tbl_sz; int err; - lid = kzalloc_obj(*lid, GFP_KERNEL); + lid = kzalloc_obj(*lid); if (!lid) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index a0466693e2d9..163eabd47f55 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c @@ -185,7 +185,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) struct netxen_cmd_buffer *cmd_buf_arr; struct net_device *netdev = adapter->netdev; - tx_ring = kzalloc_obj(struct nx_host_tx_ring, GFP_KERNEL); + tx_ring = kzalloc_obj(struct nx_host_tx_ring); if (tx_ring == NULL) return -ENOMEM; @@ -451,7 +451,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter) return -EIO; } - buf = kzalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); + buf = kzalloc_objs(struct crb_addr_pair, n); if (buf == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index ddc1f9213a95..4826f44ebced 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c +++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c @@ -1114,7 +1114,7 @@ int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn) struct qed_cxt_mngr *p_mngr; u32 i; - p_mngr = kzalloc_obj(*p_mngr, GFP_KERNEL); + p_mngr = kzalloc_obj(*p_mngr); if (!p_mngr) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index 593931ec7226..3a5c25026858 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -915,7 +915,7 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn, int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn) { - p_hwfn->p_dcbx_info = kzalloc_obj(*p_hwfn->p_dcbx_info, GFP_KERNEL); + p_hwfn->p_dcbx_info = kzalloc_obj(*p_hwfn->p_dcbx_info); if (!p_hwfn->p_dcbx_info) return -ENOMEM; @@ -1244,7 +1244,7 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn, return 0; } - dcbx_info = kzalloc_obj(*dcbx_info, GFP_KERNEL); + dcbx_info = kzalloc_obj(*dcbx_info); if (!dcbx_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c index a869a2a7e918..83d043d62231 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -7535,7 +7535,7 @@ enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn, enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn, void **user_data_ptr) { - *user_data_ptr = kzalloc_obj(struct dbg_tools_user_data, GFP_KERNEL); + *user_data_ptr = kzalloc_obj(struct dbg_tools_user_data); if (!(*user_data_ptr)) return DBG_STATUS_VIRT_MEM_ALLOC_FAILED; diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index 4c2027972347..33ea3a2edeae 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -146,7 +146,7 @@ int qed_db_recovery_add(struct qed_dev *cdev, p_hwfn = qed_db_rec_find_hwfn(cdev, db_addr); /* Create entry */ - db_entry = kzalloc_obj(*db_entry, GFP_KERNEL); + db_entry = kzalloc_obj(*db_entry); if (!db_entry) { DP_NOTICE(cdev, "Failed to allocate a db recovery entry\n"); return -ENOMEM; @@ -383,7 +383,7 @@ static int qed_llh_alloc(struct qed_dev *cdev) struct qed_llh_info *p_llh_info; u32 size, i; - p_llh_info = kzalloc_obj(*p_llh_info, GFP_KERNEL); + p_llh_info = kzalloc_obj(*p_llh_info); if (!p_llh_info) return -ENOMEM; cdev->p_llh_info = p_llh_info; @@ -2155,7 +2155,7 @@ int qed_resc_alloc(struct qed_dev *cdev) return rc; } - cdev->fw_data = kzalloc_obj(*cdev->fw_data, GFP_KERNEL); + cdev->fw_data = kzalloc_obj(*cdev->fw_data); if (!cdev->fw_data) return -ENOMEM; @@ -2345,7 +2345,7 @@ int qed_resc_alloc(struct qed_dev *cdev) goto alloc_err; } - cdev->reset_stats = kzalloc_obj(*cdev->reset_stats, GFP_KERNEL); + cdev->reset_stats = kzalloc_obj(*cdev->reset_stats); if (!cdev->reset_stats) goto alloc_no_mem; @@ -2642,7 +2642,7 @@ static int qed_hw_init_common(struct qed_hwfn *p_hwfn, u32 concrete_fid; int rc = 0; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) { DP_NOTICE(p_hwfn->cdev, "Failed to allocate common init params\n"); diff --git a/drivers/net/ethernet/qlogic/qed/qed_fcoe.c b/drivers/net/ethernet/qlogic/qed/qed_fcoe.c index 9d91e4775b52..5bdbe331ac8e 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_fcoe.c +++ b/drivers/net/ethernet/qlogic/qed/qed_fcoe.c @@ -383,7 +383,7 @@ qed_fcoe_allocate_connection(struct qed_hwfn *p_hwfn, } spin_unlock_bh(&p_hwfn->p_fcoe_info->lock); - p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn); if (!p_conn) return -ENOMEM; @@ -535,7 +535,7 @@ int qed_fcoe_alloc(struct qed_hwfn *p_hwfn) struct qed_fcoe_info *p_fcoe_info; /* Allocate LL2's set struct */ - p_fcoe_info = kzalloc_obj(*p_fcoe_info, GFP_KERNEL); + p_fcoe_info = kzalloc_obj(*p_fcoe_info); if (!p_fcoe_info) { DP_NOTICE(p_hwfn, "Failed to allocate qed_fcoe_info'\n"); return -ENOMEM; @@ -855,7 +855,7 @@ static int qed_fcoe_acquire_conn(struct qed_dev *cdev, int rc; /* Allocate a hashed connection */ - hash_con = kzalloc_obj(*hash_con, GFP_KERNEL); + hash_con = kzalloc_obj(*hash_con); if (!hash_con) { DP_NOTICE(cdev, "Failed to allocate hashed connection\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_hw.c b/drivers/net/ethernet/qlogic/qed/qed_hw.c index 6fff9788101c..77c240d27fe9 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_hw.c +++ b/drivers/net/ethernet/qlogic/qed/qed_hw.c @@ -46,7 +46,7 @@ struct qed_ptt_pool { int qed_ptt_pool_alloc(struct qed_hwfn *p_hwfn) { - struct qed_ptt_pool *p_pool = kmalloc_obj(*p_pool, GFP_KERNEL); + struct qed_ptt_pool *p_pool = kmalloc_obj(*p_pool); int i; if (!p_pool) diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c index 330c75d9ee07..edcaecf5b679 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c +++ b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c @@ -210,7 +210,7 @@ int qed_init_alloc(struct qed_hwfn *p_hwfn) if (IS_VF(p_hwfn->cdev)) return 0; - rt_data->b_valid = kzalloc_objs(bool, RUNTIME_ARRAY_SIZE, GFP_KERNEL); + rt_data->b_valid = kzalloc_objs(bool, RUNTIME_ARRAY_SIZE); if (!rt_data->b_valid) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c index a65827240d00..db3b0bc4ed93 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_int.c +++ b/drivers/net/ethernet/qlogic/qed/qed_int.c @@ -1412,7 +1412,7 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn, void *p_virt; /* SB struct */ - p_sb = kmalloc_obj(*p_sb, GFP_KERNEL); + p_sb = kmalloc_obj(*p_sb); if (!p_sb) return -ENOMEM; @@ -1765,7 +1765,7 @@ static int qed_int_sp_sb_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) void *p_virt; /* SB struct */ - p_sb = kmalloc_obj(*p_sb, GFP_KERNEL); + p_sb = kmalloc_obj(*p_sb); if (!p_sb) return -ENOMEM; @@ -2188,7 +2188,7 @@ int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) u32 min_vf = 0, max_vf = 0; u16 igu_sb_id; - p_hwfn->hw_info.p_igu_info = kzalloc_obj(*p_igu_info, GFP_KERNEL); + p_hwfn->hw_info.p_igu_info = kzalloc_obj(*p_igu_info); if (!p_hwfn->hw_info.p_igu_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c index 758fa97be920..34f1217227bc 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c @@ -710,7 +710,7 @@ static int qed_iscsi_allocate_connection(struct qed_hwfn *p_hwfn, /* Need to allocate a new connection */ p_params = &p_hwfn->pf_params.iscsi_pf_params; - p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn); if (!p_conn) return -ENOMEM; @@ -845,7 +845,7 @@ int qed_iscsi_alloc(struct qed_hwfn *p_hwfn) { struct qed_iscsi_info *p_iscsi_info; - p_iscsi_info = kzalloc_obj(*p_iscsi_info, GFP_KERNEL); + p_iscsi_info = kzalloc_obj(*p_iscsi_info); if (!p_iscsi_info) return -ENOMEM; @@ -1125,7 +1125,7 @@ static int qed_iscsi_start(struct qed_dev *cdev, if (!tasks) return 0; - tid_info = kzalloc_obj(*tid_info, GFP_KERNEL); + tid_info = kzalloc_obj(*tid_info); if (!tid_info) { qed_iscsi_stop(cdev); diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index 3b1ff94a0588..0101b4a7c56c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -546,7 +546,7 @@ qed_iwarp_create_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep **ep_out) struct qed_iwarp_ep *ep; int rc; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; @@ -2602,7 +2602,7 @@ qed_iwarp_ll2_alloc_buffers(struct qed_hwfn *p_hwfn, int i; for (i = 0; i < num_rx_bufs; i++) { - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) { rc = -ENOMEM; break; @@ -3166,7 +3166,7 @@ qed_iwarp_create_listen(void *rdma_cxt, struct qed_hwfn *p_hwfn = rdma_cxt; struct qed_iwarp_listener *listener; - listener = kzalloc_obj(*listener, GFP_KERNEL); + listener = kzalloc_obj(*listener); if (!listener) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index e78f9c2ffc38..0f6905e33df6 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c @@ -58,7 +58,7 @@ int qed_l2_alloc(struct qed_hwfn *p_hwfn) if (!QED_IS_L2_PERSONALITY(p_hwfn)) return 0; - p_l2_info = kzalloc_obj(*p_l2_info, GFP_KERNEL); + p_l2_info = kzalloc_obj(*p_l2_info); if (!p_l2_info) return -ENOMEM; p_hwfn->p_l2_info = p_l2_info; diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 904bb1cd9bdb..572feb68d1d2 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -1195,7 +1195,7 @@ qed_ll2_acquire_connection_rx(struct qed_hwfn *p_hwfn, } capacity = qed_chain_get_capacity(&p_ll2_info->rx_queue.rxq_chain); - p_descq = kzalloc_objs(struct qed_ll2_rx_packet, capacity, GFP_KERNEL); + p_descq = kzalloc_objs(struct qed_ll2_rx_packet, capacity); if (!p_descq) { rc = -ENOMEM; DP_NOTICE(p_hwfn, "Failed to allocate ll2 Rx desc\n"); @@ -1290,7 +1290,7 @@ qed_ll2_acquire_connection_ooo(struct qed_hwfn *p_hwfn, for (buf_idx = 0; buf_idx < p_ll2_info->input.rx_num_ooo_buffers; buf_idx++) { - p_buf = kzalloc_obj(*p_buf, GFP_KERNEL); + p_buf = kzalloc_obj(*p_buf); if (!p_buf) { rc = -ENOMEM; goto out; @@ -2603,7 +2603,7 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params) DP_INFO(cdev, "Allocating %d LL2 buffers of size %08x bytes\n", rx_num_desc, cdev->ll2->rx_size); for (i = 0; i < rx_num_desc; i++) { - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) { DP_INFO(cdev, "Failed to allocate LL2 buffers\n"); rc = -ENOMEM; @@ -2811,7 +2811,7 @@ const struct qed_ll2_ops qed_ll2_ops_pass = { int qed_ll2_alloc_if(struct qed_dev *cdev) { - cdev->ll2 = kzalloc_obj(*cdev->ll2, GFP_KERNEL); + cdev->ll2 = kzalloc_obj(*cdev->ll2); return cdev->ll2 ? 0 : -ENOMEM; } diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 544d790efdea..28a8a2b9d501 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -461,7 +461,7 @@ static struct qed_dev *qed_alloc_cdev(struct pci_dev *pdev) { struct qed_dev *cdev; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return cdev; @@ -612,7 +612,7 @@ static int qed_set_int_mode(struct qed_dev *cdev, bool force_mode) case QED_INT_MODE_MSIX: /* Allocate MSIX table */ cnt = int_params->in.num_vectors; - int_params->msix_table = kzalloc_objs(*tbl, cnt, GFP_KERNEL); + int_params->msix_table = kzalloc_objs(*tbl, cnt); if (!int_params->msix_table) { rc = -ENOMEM; goto out; @@ -1050,7 +1050,7 @@ static int qed_alloc_stream_mem(struct qed_dev *cdev) for_each_hwfn(cdev, i) { struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; - p_hwfn->stream = kzalloc_obj(*p_hwfn->stream, GFP_KERNEL); + p_hwfn->stream = kzalloc_obj(*p_hwfn->stream); if (!p_hwfn->stream) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c index 22802c793d68..9a461ab73bf2 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c @@ -241,7 +241,7 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) u32 size; /* Allocate mcp_info structure */ - p_hwfn->mcp_info = kzalloc_obj(*p_hwfn->mcp_info, GFP_KERNEL); + p_hwfn->mcp_info = kzalloc_obj(*p_hwfn->mcp_info); if (!p_hwfn->mcp_info) goto err; p_info = p_hwfn->mcp_info; diff --git a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c b/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c index 81823f4197f6..b28128c4398c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c @@ -218,7 +218,7 @@ static int qed_nvmetcp_start(struct qed_dev *cdev, if (!tasks) return 0; - tid_info = kzalloc_obj(*tid_info, GFP_KERNEL); + tid_info = kzalloc_obj(*tid_info); if (!tid_info) { qed_nvmetcp_stop(cdev); @@ -477,7 +477,7 @@ static int qed_nvmetcp_allocate_connection(struct qed_hwfn *p_hwfn, /* Need to allocate a new connection */ p_params = &p_hwfn->pf_params.nvmetcp_pf_params; - p_conn = kzalloc_obj(*p_conn, GFP_KERNEL); + p_conn = kzalloc_obj(*p_conn); if (!p_conn) return -ENOMEM; @@ -568,7 +568,7 @@ int qed_nvmetcp_alloc(struct qed_hwfn *p_hwfn) { struct qed_nvmetcp_info *p_nvmetcp_info; - p_nvmetcp_info = kzalloc_obj(*p_nvmetcp_info, GFP_KERNEL); + p_nvmetcp_info = kzalloc_obj(*p_nvmetcp_info); if (!p_nvmetcp_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_ooo.c b/drivers/net/ethernet/qlogic/qed/qed_ooo.c index 23631e18858e..610afab93b3f 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ooo.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ooo.c @@ -107,7 +107,7 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) return -EINVAL; } - p_ooo_info = kzalloc_obj(*p_ooo_info, GFP_KERNEL); + p_ooo_info = kzalloc_obj(*p_ooo_info); if (!p_ooo_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index 8872c9ebcd26..24e2bdf42817 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -119,7 +119,7 @@ int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) { struct qed_rdma_info *p_rdma_info; - p_rdma_info = kzalloc_obj(*p_rdma_info, GFP_KERNEL); + p_rdma_info = kzalloc_obj(*p_rdma_info); if (!p_rdma_info) return -ENOMEM; @@ -168,12 +168,12 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn) p_rdma_info->max_queue_zones = (u16)RESC_NUM(p_hwfn, QED_L2_QUEUE); /* Allocate a struct with device params and fill it */ - p_rdma_info->dev = kzalloc_obj(*p_rdma_info->dev, GFP_KERNEL); + p_rdma_info->dev = kzalloc_obj(*p_rdma_info->dev); if (!p_rdma_info->dev) return rc; /* Allocate a struct with port params and fill it */ - p_rdma_info->port = kzalloc_obj(*p_rdma_info->port, GFP_KERNEL); + p_rdma_info->port = kzalloc_obj(*p_rdma_info->port); if (!p_rdma_info->port) goto free_rdma_dev; @@ -1293,7 +1293,7 @@ qed_rdma_create_qp(void *rdma_cxt, } } - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return NULL; diff --git a/drivers/net/ethernet/qlogic/qed/qed_spq.c b/drivers/net/ethernet/qlogic/qed/qed_spq.c index d0ef2782f5ba..9b1beb5af517 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_spq.c +++ b/drivers/net/ethernet/qlogic/qed/qed_spq.c @@ -407,7 +407,7 @@ int qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem) int ret; /* Allocate EQ struct */ - p_eq = kzalloc_obj(*p_eq, GFP_KERNEL); + p_eq = kzalloc_obj(*p_eq); if (!p_eq) return -ENOMEM; @@ -562,7 +562,7 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn) int ret; /* SPQ struct */ - p_spq = kzalloc_obj(*p_spq, GFP_KERNEL); + p_spq = kzalloc_obj(*p_spq); if (!p_spq) return -ENOMEM; @@ -1013,7 +1013,7 @@ int qed_consq_alloc(struct qed_hwfn *p_hwfn) int ret; /* Allocate ConsQ struct */ - p_consq = kzalloc_obj(*p_consq, GFP_KERNEL); + p_consq = kzalloc_obj(*p_consq); if (!p_consq) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c index cc9087abbacc..96a1d9e01096 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c @@ -543,7 +543,7 @@ int qed_iov_alloc(struct qed_hwfn *p_hwfn) return 0; } - p_sriov = kzalloc_obj(*p_sriov, GFP_KERNEL); + p_sriov = kzalloc_obj(*p_sriov); if (!p_sriov) return -ENOMEM; @@ -600,7 +600,7 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn) } /* Allocate a new struct for IOV information */ - cdev->p_iov_info = kzalloc_obj(*cdev->p_iov_info, GFP_KERNEL); + cdev->p_iov_info = kzalloc_obj(*cdev->p_iov_info); if (!cdev->p_iov_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c index b9ebf91e6b6a..315e313d91b1 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_vf.c +++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c @@ -454,7 +454,7 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) p_hwfn->hw_info.concrete_fid = REG_RD(p_hwfn, reg); /* Allocate vf sriov info */ - p_iov = kzalloc_obj(*p_iov, GFP_KERNEL); + p_iov = kzalloc_obj(*p_iov); if (!p_iov) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index 32bb653c50f7..ab8b818588e2 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -682,7 +682,7 @@ int qede_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) DP_VERBOSE(edev, NETIF_MSG_IFUP, "Adding vlan 0x%04x\n", vid); - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) { DP_INFO(edev, "Failed to allocate struct for vlan\n"); return -ENOMEM; @@ -1916,7 +1916,7 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, goto unlock; } - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) { rc = -ENOMEM; goto unlock; @@ -2059,7 +2059,7 @@ int qede_add_cls_rule(struct qede_dev *edev, struct ethtool_rxnfc *info) goto unlock; } - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) { rc = -ENOMEM; goto unlock; diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index dfa221b30e9e..19319956ca13 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -990,7 +990,7 @@ static int qede_alloc_fp_array(struct qede_dev *edev) for_each_queue(i) { fp = &edev->fp_array[i]; - fp->sb_info = kzalloc_obj(*fp->sb_info, GFP_KERNEL); + fp->sb_info = kzalloc_obj(*fp->sb_info); if (!fp->sb_info) { DP_NOTICE(edev, "sb info struct allocation failed\n"); goto err; @@ -1014,7 +1014,7 @@ static int qede_alloc_fp_array(struct qede_dev *edev) } if (fp->type & QEDE_FASTPATH_RX) { - fp->rxq = kzalloc_obj(*fp->rxq, GFP_KERNEL); + fp->rxq = kzalloc_obj(*fp->rxq); if (!fp->rxq) goto err; diff --git a/drivers/net/ethernet/qlogic/qede/qede_ptp.c b/drivers/net/ethernet/qlogic/qede/qede_ptp.c index 774f77f9a55e..e3fe6306a85c 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ptp.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ptp.c @@ -446,7 +446,7 @@ int qede_ptp_enable(struct qede_dev *edev) struct qede_ptp *ptp; int rc; - ptp = kzalloc_obj(*ptp, GFP_KERNEL); + ptp = kzalloc_obj(*ptp); if (!ptp) { DP_INFO(edev, "Failed to allocate struct for PTP\n"); return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index bae848bd5e26..bc82cecd0fe2 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c @@ -4164,7 +4164,7 @@ int qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *adapter) struct qlcnic_hardware_context *ahw = adapter->ahw; struct qlcnic_mailbox *mbx; - ahw->mailbox = kzalloc_obj(*mbx, GFP_KERNEL); + ahw->mailbox = kzalloc_obj(*mbx); if (!ahw->mailbox) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index 42c8e5490ee7..45ed8705c7ca 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c @@ -2388,7 +2388,7 @@ static int qlcnic_83xx_get_fw_info(struct qlcnic_adapter *adapter) struct qlc_83xx_fw_info *fw_info; int err = 0; - ahw->fw_info = kzalloc_obj(*fw_info, GFP_KERNEL); + ahw->fw_info = kzalloc_obj(*fw_info); if (!ahw->fw_info) { err = -ENOMEM; } else { diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index e56ef10b6a2d..86e9cb04cae8 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c @@ -454,7 +454,7 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter) return -EIO; } - buf = kzalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); + buf = kzalloc_objs(struct crb_addr_pair, n); if (buf == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 00eab09c1710..106cbe12398a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -950,7 +950,7 @@ static int qlcnic_get_act_pci_func(struct qlcnic_adapter *adapter) if (ahw->op_mode == QLCNIC_MGMT_FUNC) return 0; - pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func, GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func); if (!pci_info) return -ENOMEM; @@ -984,7 +984,7 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter) u16 act_pci_func; u8 pfn; - pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func, GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, ahw->max_vnic_func); if (!pci_info) return -ENOMEM; @@ -2055,7 +2055,7 @@ static int qlcnic_alloc_adapter_resources(struct qlcnic_adapter *adapter) struct qlcnic_hardware_context *ahw = adapter->ahw; int err = 0; - adapter->recv_ctx = kzalloc_obj(struct qlcnic_recv_context, GFP_KERNEL); + adapter->recv_ctx = kzalloc_obj(struct qlcnic_recv_context); if (!adapter->recv_ctx) { err = -ENOMEM; goto err_out; @@ -2439,7 +2439,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); - ahw = kzalloc_obj(struct qlcnic_hardware_context, GFP_KERNEL); + ahw = kzalloc_obj(struct qlcnic_hardware_context); if (!ahw) { err = -ENOMEM; goto err_out_free_res; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index c2bf5455092c..44d16a303555 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c @@ -792,7 +792,7 @@ static u32 qlcnic_read_memory_pexdma(struct qlcnic_adapter *adapter, } /* Create DMA descriptor */ - dma_descr = kzalloc_obj(struct qlcnic_pex_dma_descriptor, GFP_KERNEL); + dma_descr = kzalloc_obj(struct qlcnic_pex_dma_descriptor); if (!dma_descr) { *ret = -ENOMEM; return 0; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index c6af69e5a700..e2f1169e05fa 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c @@ -149,7 +149,7 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) if (!qlcnic_sriov_enable_check(adapter)) return -EIO; - sriov = kzalloc_obj(struct qlcnic_sriov, GFP_KERNEL); + sriov = kzalloc_obj(struct qlcnic_sriov); if (!sriov) return -ENOMEM; @@ -201,7 +201,7 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) INIT_WORK(&vf->trans_work, qlcnic_sriov_process_bc_cmd); if (qlcnic_sriov_pf_check(adapter)) { - vp = kzalloc_obj(struct qlcnic_vport, GFP_KERNEL); + vp = kzalloc_obj(struct qlcnic_vport); if (!vp) { err = -ENOMEM; goto qlcnic_destroy_async_wq; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index 406101671602..6f0d6376607d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c @@ -909,7 +909,7 @@ static ssize_t qlcnic_sysfs_read_pci_config(struct file *file, int i, ret; u32 count; - pci_info = kzalloc_objs(*pci_info, size, GFP_KERNEL); + pci_info = kzalloc_objs(*pci_info, size); if (!pci_info) return -ENOMEM; diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c index 723ddbb1a70a..269c0449760c 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c @@ -68,7 +68,7 @@ static int rmnet_register_real_device(struct net_device *real_dev, return 0; } - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; @@ -143,7 +143,7 @@ static int rmnet_newlink(struct net_device *dev, return -ENODEV; } - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; diff --git a/drivers/net/ethernet/realtek/r8169_leds.c b/drivers/net/ethernet/realtek/r8169_leds.c index 5da64cea5eb4..1999e81f0bca 100644 --- a/drivers/net/ethernet/realtek/r8169_leds.c +++ b/drivers/net/ethernet/realtek/r8169_leds.c @@ -154,7 +154,7 @@ struct r8169_led_classdev *rtl8168_init_leds(struct net_device *ndev) struct r8169_led_classdev *leds; int i; - leds = kzalloc_objs(*leds, RTL8168_NUM_LEDS + 1, GFP_KERNEL); + leds = kzalloc_objs(*leds, RTL8168_NUM_LEDS + 1); if (!leds) return NULL; @@ -253,7 +253,7 @@ struct r8169_led_classdev *rtl8125_init_leds(struct net_device *ndev) struct r8169_led_classdev *leds; int i; - leds = kzalloc_objs(*leds, RTL8125_NUM_LEDS + 1, GFP_KERNEL); + leds = kzalloc_objs(*leds, RTL8125_NUM_LEDS + 1); if (!leds) return NULL; diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index ad0e07e2a09d..58788d196c57 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2683,7 +2683,7 @@ static void rtl_request_firmware(struct rtl8169_private *tp) if (tp->rtl_fw || !tp->fw_name) return; - rtl_fw = kzalloc_obj(*rtl_fw, GFP_KERNEL); + rtl_fw = kzalloc_obj(*rtl_fw); if (!rtl_fw) return; diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c index 421677d4b1d7..65b84ea060d1 100644 --- a/drivers/net/ethernet/renesas/rswitch_main.c +++ b/drivers/net/ethernet/renesas/rswitch_main.c @@ -357,7 +357,7 @@ static int rswitch_gwca_queue_alloc(struct net_device *ndev, sizeof(struct rswitch_ext_ts_desc) * (gq->ring_size + 1), &gq->ring_dma, GFP_KERNEL); } else { - gq->skbs = kzalloc_objs(*gq->skbs, gq->ring_size, GFP_KERNEL); + gq->skbs = kzalloc_objs(*gq->skbs, gq->ring_size); if (!gq->skbs) return -ENOMEM; gq->unmap_addrs = kzalloc_objs(*gq->unmap_addrs, gq->ring_size, diff --git a/drivers/net/ethernet/renesas/rtsn.c b/drivers/net/ethernet/renesas/rtsn.c index 2850e76d7f6f..03a2669f0518 100644 --- a/drivers/net/ethernet/renesas/rtsn.c +++ b/drivers/net/ethernet/renesas/rtsn.c @@ -349,8 +349,8 @@ static int rtsn_chain_init(struct rtsn_private *priv, int tx_size, int rx_size) priv->num_tx_ring = tx_size; priv->num_rx_ring = rx_size; - priv->tx_skb = kzalloc_objs(*priv->tx_skb, tx_size, GFP_KERNEL); - priv->rx_skb = kzalloc_objs(*priv->rx_skb, rx_size, GFP_KERNEL); + priv->tx_skb = kzalloc_objs(*priv->tx_skb, tx_size); + priv->rx_skb = kzalloc_objs(*priv->rx_skb, rx_size); if (!priv->rx_skb || !priv->tx_skb) goto error; diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 503a9869e1db..32eb56335c63 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -66,7 +66,7 @@ static struct rocker_wait *rocker_wait_create(void) { struct rocker_wait *wait; - wait = kzalloc_obj(*wait, GFP_KERNEL); + wait = kzalloc_obj(*wait); if (!wait) return NULL; return wait; @@ -435,7 +435,7 @@ static int rocker_dma_ring_create(const struct rocker *rocker, info->type = type; info->head = 0; info->tail = 0; - info->desc_info = kzalloc_objs(*info->desc_info, info->size, GFP_KERNEL); + info->desc_info = kzalloc_objs(*info->desc_info, info->size); if (!info->desc_info) return -ENOMEM; @@ -2848,7 +2848,7 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct rocker *rocker; int err; - rocker = kzalloc_obj(*rocker, GFP_KERNEL); + rocker = kzalloc_obj(*rocker); if (!rocker) return -ENOMEM; diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c index a9795b79d1d4..50ea5f9ef63a 100644 --- a/drivers/net/ethernet/rocker/rocker_ofdpa.c +++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c @@ -838,7 +838,7 @@ static int ofdpa_flow_tbl_ig_port(struct ofdpa_port *ofdpa_port, int flags, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -860,7 +860,7 @@ static int ofdpa_flow_tbl_vlan(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -886,7 +886,7 @@ static int ofdpa_flow_tbl_term_mac(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -976,7 +976,7 @@ static int ofdpa_flow_tbl_ucast4_routing(struct ofdpa_port *ofdpa_port, { struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1006,7 +1006,7 @@ static int ofdpa_flow_tbl_acl(struct ofdpa_port *ofdpa_port, int flags, u32 priority; struct ofdpa_flow_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1150,7 +1150,7 @@ static int ofdpa_group_l2_interface(struct ofdpa_port *ofdpa_port, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1166,7 +1166,7 @@ static int ofdpa_group_l2_fan_out(struct ofdpa_port *ofdpa_port, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1199,7 +1199,7 @@ static int ofdpa_group_l3_unicast(struct ofdpa_port *ofdpa_port, int flags, { struct ofdpa_group_tbl_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1386,7 +1386,7 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port, bool resolved = true; int err = 0; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1904,7 +1904,7 @@ static int ofdpa_port_fdb(struct ofdpa_port *ofdpa_port, bool removing = (flags & OFDPA_OP_FLAG_REMOVE); unsigned long lock_flags; - fdb = kzalloc_obj(*fdb, GFP_KERNEL); + fdb = kzalloc_obj(*fdb); if (!fdb) return -ENOMEM; @@ -2232,7 +2232,7 @@ static __be16 ofdpa_port_internal_vlan_id_get(struct ofdpa_port *ofdpa_port, unsigned long lock_flags; int i; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return 0; diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 437bcf8ad0c8..4f16779f2e3e 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -489,7 +489,7 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no, return -ENOMEM; /* allocate memory for RX skbuff array */ - rx_ring->rx_skbuff_dma = kmalloc_objs(dma_addr_t, rx_rsize, GFP_KERNEL); + rx_ring->rx_skbuff_dma = kmalloc_objs(dma_addr_t, rx_rsize); if (!rx_ring->rx_skbuff_dma) { ret = -ENOMEM; goto err_free_dma_rx; @@ -2006,7 +2006,7 @@ static int sxgbe_hw_init(struct sxgbe_priv_data * const priv) { u32 ctrl_ids; - priv->hw = kmalloc_obj(*priv->hw, GFP_KERNEL); + priv->hw = kmalloc_obj(*priv->hw); if(!priv->hw) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 58d3a381271d..7e04f115bbaa 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -431,7 +431,7 @@ static int efx_ef10_add_vlan(struct efx_nic *efx, u16 vid) } rc = -ENOMEM; - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) goto fail_alloc; @@ -527,7 +527,7 @@ static int efx_ef10_probe(struct efx_nic *efx) struct efx_ef10_nic_data *nic_data; int i, rc; - nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; @@ -3591,7 +3591,7 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx) MCDI_VAR_ARRAY_LEN(outlen, NVRAM_PARTITIONS_OUT_TYPE_ID)) return -EIO; - parts = kzalloc_objs(*parts, n_parts_total, GFP_KERNEL); + parts = kzalloc_objs(*parts, n_parts_total); if (!parts) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ef100.c b/drivers/net/ethernet/sfc/ef100.c index d2f64e049be1..0dd5364506d7 100644 --- a/drivers/net/ethernet/sfc/ef100.c +++ b/drivers/net/ethernet/sfc/ef100.c @@ -453,7 +453,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev, int rc; /* Allocate probe data and struct efx_nic */ - probe_data = kzalloc_obj(*probe_data, GFP_KERNEL); + probe_data = kzalloc_obj(*probe_data); if (!probe_data) return -ENOMEM; probe_data->pci_dev = pci_dev; diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c index da433a94a994..00050f786cae 100644 --- a/drivers/net/ethernet/sfc/ef100_nic.c +++ b/drivers/net/ethernet/sfc/ef100_nic.c @@ -351,7 +351,7 @@ int ef100_phy_probe(struct efx_nic *efx) int rc; /* Probe for the PHY */ - efx->phy_data = kzalloc_obj(struct efx_mcdi_phy_data, GFP_KERNEL); + efx->phy_data = kzalloc_obj(struct efx_mcdi_phy_data); if (!efx->phy_data) return -ENOMEM; @@ -1020,7 +1020,7 @@ static int ef100_probe_main(struct efx_nic *efx) if (WARN_ON(bar_size == 0)) return -EIO; - nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c index 5b3377ca7220..f98f1707d1a9 100644 --- a/drivers/net/ethernet/sfc/ef10_sriov.c +++ b/drivers/net/ethernet/sfc/ef10_sriov.c @@ -189,7 +189,7 @@ static int efx_ef10_sriov_alloc_vf_vswitching(struct efx_nic *efx) unsigned int i; int rc; - nic_data->vf = kzalloc_objs(struct ef10_vf, efx->vf_count, GFP_KERNEL); + nic_data->vf = kzalloc_objs(struct ef10_vf, efx->vf_count); if (!nic_data->vf) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 133a23a9dd5a..8f136a11d396 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -1155,7 +1155,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev, int rc; /* Allocate probe data and struct efx_nic */ - probe_data = kzalloc_obj(*probe_data, GFP_KERNEL); + probe_data = kzalloc_obj(*probe_data); if (!probe_data) return -ENOMEM; probe_data->pci_dev = pci_dev; diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index 84beb79f1969..c3766594d12e 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -534,7 +534,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i) struct efx_channel *channel; int j; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return NULL; @@ -604,7 +604,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) struct efx_channel *channel; int j; - channel = kmalloc_obj(*channel, GFP_KERNEL); + channel = kmalloc_obj(*channel); if (!channel) return NULL; diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index 6b762153c8a4..54f8e4626568 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -133,7 +133,7 @@ void efx_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - efx_tests = kzalloc_obj(*efx_tests, GFP_KERNEL); + efx_tests = kzalloc_obj(*efx_tests); if (!efx_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c index 2852868c1003..0c197b448645 100644 --- a/drivers/net/ethernet/sfc/falcon/efx.c +++ b/drivers/net/ethernet/sfc/falcon/efx.c @@ -423,7 +423,7 @@ ef4_alloc_channel(struct ef4_nic *efx, int i, struct ef4_channel *old_channel) struct ef4_tx_queue *tx_queue; int j; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return NULL; @@ -456,7 +456,7 @@ ef4_copy_channel(const struct ef4_channel *old_channel) struct ef4_tx_queue *tx_queue; int j; - channel = kmalloc_obj(*channel, GFP_KERNEL); + channel = kmalloc_obj(*channel); if (!channel) return NULL; diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c index 069269884396..3d81b3ca61e9 100644 --- a/drivers/net/ethernet/sfc/falcon/ethtool.c +++ b/drivers/net/ethernet/sfc/falcon/ethtool.c @@ -493,7 +493,7 @@ static void ef4_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - ef4_tests = kzalloc_obj(*ef4_tests, GFP_KERNEL); + ef4_tests = kzalloc_obj(*ef4_tests); if (!ef4_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/falcon/falcon.c b/drivers/net/ethernet/sfc/falcon/falcon.c index 1603c5267654..fb1d19b7c419 100644 --- a/drivers/net/ethernet/sfc/falcon/falcon.c +++ b/drivers/net/ethernet/sfc/falcon/falcon.c @@ -929,7 +929,7 @@ static int falcon_mtd_probe(struct ef4_nic *efx) ASSERT_RTNL(); /* Allocate space for maximum number of partitions */ - parts = kzalloc_objs(*parts, 2, GFP_KERNEL); + parts = kzalloc_objs(*parts, 2); if (!parts) return -ENOMEM; n_parts = 0; @@ -2180,7 +2180,7 @@ static int falcon_probe_nvconfig(struct ef4_nic *efx) struct falcon_nvconfig *nvconfig; int rc; - nvconfig = kmalloc_obj(*nvconfig, GFP_KERNEL); + nvconfig = kmalloc_obj(*nvconfig); if (!nvconfig) return -ENOMEM; @@ -2289,7 +2289,7 @@ static int falcon_probe_nic(struct ef4_nic *efx) efx->primary = efx; /* only one usable function per controller */ /* Allocate storage for hardware specific data */ - nic_data = kzalloc_obj(*nic_data, GFP_KERNEL); + nic_data = kzalloc_obj(*nic_data); if (!nic_data) return -ENOMEM; efx->nic_data = nic_data; diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c index 67b62c3a9839..23d507a3820d 100644 --- a/drivers/net/ethernet/sfc/falcon/farch.c +++ b/drivers/net/ethernet/sfc/falcon/farch.c @@ -2701,7 +2701,7 @@ int ef4_farch_filter_table_probe(struct ef4_nic *efx) struct ef4_farch_filter_table *table; unsigned table_id; - state = kzalloc_obj(struct ef4_farch_filter_state, GFP_KERNEL); + state = kzalloc_obj(struct ef4_farch_filter_state); if (!state) return -ENOMEM; efx->filter_state = state; diff --git a/drivers/net/ethernet/sfc/falcon/qt202x_phy.c b/drivers/net/ethernet/sfc/falcon/qt202x_phy.c index dc6383ceb656..2dd7d7ba1559 100644 --- a/drivers/net/ethernet/sfc/falcon/qt202x_phy.c +++ b/drivers/net/ethernet/sfc/falcon/qt202x_phy.c @@ -340,7 +340,7 @@ static int qt202x_phy_probe(struct ef4_nic *efx) { struct qt202x_phy_data *phy_data; - phy_data = kzalloc_obj(struct qt202x_phy_data, GFP_KERNEL); + phy_data = kzalloc_obj(struct qt202x_phy_data); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/falcon/rx.c b/drivers/net/ethernet/sfc/falcon/rx.c index d32bab1b5783..f7cc47b9b234 100644 --- a/drivers/net/ethernet/sfc/falcon/rx.c +++ b/drivers/net/ethernet/sfc/falcon/rx.c @@ -701,7 +701,7 @@ int ef4_probe_rx_queue(struct ef4_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries); if (!rx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c index 8205a08132ae..ddea1e715f00 100644 --- a/drivers/net/ethernet/sfc/falcon/selftest.c +++ b/drivers/net/ethernet/sfc/falcon/selftest.c @@ -635,7 +635,7 @@ static int ef4_test_loopbacks(struct ef4_nic *efx, struct ef4_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/falcon/tenxpress.c b/drivers/net/ethernet/sfc/falcon/tenxpress.c index 4a5e24b4d174..db9d35bde75d 100644 --- a/drivers/net/ethernet/sfc/falcon/tenxpress.c +++ b/drivers/net/ethernet/sfc/falcon/tenxpress.c @@ -165,7 +165,7 @@ static int tenxpress_phy_probe(struct ef4_nic *efx) struct tenxpress_phy_data *phy_data; /* Allocate phy private storage */ - phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/falcon/tx.c b/drivers/net/ethernet/sfc/falcon/tx.c index a295b40342a4..c514d2c65672 100644 --- a/drivers/net/ethernet/sfc/falcon/tx.c +++ b/drivers/net/ethernet/sfc/falcon/tx.c @@ -544,7 +544,7 @@ int ef4_probe_tx_queue(struct ef4_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries); if (!tx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/falcon/txc43128_phy.c b/drivers/net/ethernet/sfc/falcon/txc43128_phy.c index 0025baff6efe..f20f9166d730 100644 --- a/drivers/net/ethernet/sfc/falcon/txc43128_phy.c +++ b/drivers/net/ethernet/sfc/falcon/txc43128_phy.c @@ -323,7 +323,7 @@ static int txc43128_phy_probe(struct ef4_nic *efx) struct txc43128_data *phy_data; /* Allocate phy private storage */ - phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data); if (!phy_data) return -ENOMEM; efx->phy_data = phy_data; diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c index 6e8e90254792..33278d0580aa 100644 --- a/drivers/net/ethernet/sfc/mae.c +++ b/drivers/net/ethernet/sfc/mae.c @@ -1158,7 +1158,7 @@ int efx_mae_enumerate_mports(struct efx_nic *efx) for (i = 0; i < count; i++) { struct mae_mport_desc *d; - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) { rc = -ENOMEM; goto fail; @@ -2313,7 +2313,7 @@ int efx_init_mae(struct efx_nic *efx) if (!nic_data->have_mport) return -EINVAL; - mae = kmalloc_obj(*mae, GFP_KERNEL); + mae = kmalloc_obj(*mae); if (!mae) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 7a19bba484cd..e65db9b70724 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -63,7 +63,7 @@ int efx_mcdi_init(struct efx_nic *efx) bool already_attached; int rc = -ENOMEM; - efx->mcdi = kzalloc_obj(*efx->mcdi, GFP_KERNEL); + efx->mcdi = kzalloc_obj(*efx->mcdi); if (!efx->mcdi) goto fail; diff --git a/drivers/net/ethernet/sfc/mcdi_filters.c b/drivers/net/ethernet/sfc/mcdi_filters.c index 80d53614e4fc..e10c868b987f 100644 --- a/drivers/net/ethernet/sfc/mcdi_filters.c +++ b/drivers/net/ethernet/sfc/mcdi_filters.c @@ -1310,7 +1310,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) if (efx->filter_state) /* already probed */ return 0; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return -ENOMEM; @@ -1586,7 +1586,7 @@ int efx_mcdi_filter_add_vlan(struct efx_nic *efx, u16 vid) return -EALREADY; } - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/mcdi_mon.c b/drivers/net/ethernet/sfc/mcdi_mon.c index 2d6472ec4a02..68eb11117c2d 100644 --- a/drivers/net/ethernet/sfc/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/mcdi_mon.c @@ -350,7 +350,7 @@ int efx_mcdi_mon_probe(struct efx_nic *efx) * value, min, max, crit, alarm and label for each sensor. */ n_attrs = 6 * n_sensors; - hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs, GFP_KERNEL); + hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs); if (!hwmon->attrs) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/ethernet/sfc/mcdi_port_common.c b/drivers/net/ethernet/sfc/mcdi_port_common.c index ba9e29ca9874..8d3d5cdfbdfc 100644 --- a/drivers/net/ethernet/sfc/mcdi_port_common.c +++ b/drivers/net/ethernet/sfc/mcdi_port_common.c @@ -429,7 +429,7 @@ int efx_mcdi_phy_probe(struct efx_nic *efx) int rc; /* Initialise and populate phy_data */ - phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data); if (phy_data == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index 7268f049cf3d..6ca9a75af01d 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c @@ -1263,7 +1263,7 @@ static int efx_ptp_insert_filter(struct efx_nic *efx, return 0; } - rxfilter = kzalloc_obj(*rxfilter, GFP_KERNEL); + rxfilter = kzalloc_obj(*rxfilter); if (!rxfilter) return -ENOMEM; @@ -1565,7 +1565,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) return 0; } - ptp = kzalloc_obj(struct efx_ptp_data, GFP_KERNEL); + ptp = kzalloc_obj(struct efx_ptp_data); efx->ptp_data = ptp; if (!efx->ptp_data) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c index 809faeead09b..aa3647422f83 100644 --- a/drivers/net/ethernet/sfc/rx_common.c +++ b/drivers/net/ethernet/sfc/rx_common.c @@ -204,7 +204,7 @@ int efx_probe_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries); if (!rx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c index ef37de056a19..26bff77f743b 100644 --- a/drivers/net/ethernet/sfc/selftest.c +++ b/drivers/net/ethernet/sfc/selftest.c @@ -628,7 +628,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/siena/efx_channels.c b/drivers/net/ethernet/sfc/siena/efx_channels.c index f2ed3c8b1f5d..1ddab2e2263e 100644 --- a/drivers/net/ethernet/sfc/siena/efx_channels.c +++ b/drivers/net/ethernet/sfc/siena/efx_channels.c @@ -536,7 +536,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i) struct efx_channel *channel; int j; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return NULL; @@ -607,7 +607,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) struct efx_channel *channel; int j; - channel = kmalloc_obj(*channel, GFP_KERNEL); + channel = kmalloc_obj(*channel); if (!channel) return NULL; diff --git a/drivers/net/ethernet/sfc/siena/ethtool_common.c b/drivers/net/ethernet/sfc/siena/ethtool_common.c index cb19af6aafd9..76cbce2b9592 100644 --- a/drivers/net/ethernet/sfc/siena/ethtool_common.c +++ b/drivers/net/ethernet/sfc/siena/ethtool_common.c @@ -355,7 +355,7 @@ void efx_siena_ethtool_self_test(struct net_device *net_dev, bool already_up; int rc = -ENOMEM; - efx_tests = kzalloc_obj(*efx_tests, GFP_KERNEL); + efx_tests = kzalloc_obj(*efx_tests); if (!efx_tests) goto fail; diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c index ab2e36520fb9..7613d7988894 100644 --- a/drivers/net/ethernet/sfc/siena/farch.c +++ b/drivers/net/ethernet/sfc/siena/farch.c @@ -2790,7 +2790,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx) struct efx_farch_filter_table *table; unsigned table_id; - state = kzalloc_obj(struct efx_farch_filter_state, GFP_KERNEL); + state = kzalloc_obj(struct efx_farch_filter_state); if (!state) return -ENOMEM; efx->filter_state = state; diff --git a/drivers/net/ethernet/sfc/siena/mcdi.c b/drivers/net/ethernet/sfc/siena/mcdi.c index 3bee5c0e6edc..4d0d6bd5d3d1 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.c +++ b/drivers/net/ethernet/sfc/siena/mcdi.c @@ -65,7 +65,7 @@ int efx_siena_mcdi_init(struct efx_nic *efx) bool already_attached; int rc = -ENOMEM; - efx->mcdi = kzalloc_obj(*efx->mcdi, GFP_KERNEL); + efx->mcdi = kzalloc_obj(*efx->mcdi); if (!efx->mcdi) goto fail; diff --git a/drivers/net/ethernet/sfc/siena/mcdi_mon.c b/drivers/net/ethernet/sfc/siena/mcdi_mon.c index ddf7d712fb21..9d3df883656b 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/siena/mcdi_mon.c @@ -350,7 +350,7 @@ int efx_siena_mcdi_mon_probe(struct efx_nic *efx) * value, min, max, crit, alarm and label for each sensor. */ n_attrs = 6 * n_sensors; - hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs, GFP_KERNEL); + hwmon->attrs = kzalloc_objs(*hwmon->attrs, n_attrs); if (!hwmon->attrs) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/ethernet/sfc/siena/mcdi_port_common.c b/drivers/net/ethernet/sfc/siena/mcdi_port_common.c index 6154d09f9dde..72d07a2ec553 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi_port_common.c +++ b/drivers/net/ethernet/sfc/siena/mcdi_port_common.c @@ -430,7 +430,7 @@ int efx_siena_mcdi_phy_probe(struct efx_nic *efx) int rc; /* Initialise and populate phy_data */ - phy_data = kzalloc_obj(*phy_data, GFP_KERNEL); + phy_data = kzalloc_obj(*phy_data); if (phy_data == NULL) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/ptp.c b/drivers/net/ethernet/sfc/siena/ptp.c index 2cb1d0fc9daa..0b723a127364 100644 --- a/drivers/net/ethernet/sfc/siena/ptp.c +++ b/drivers/net/ethernet/sfc/siena/ptp.c @@ -1443,7 +1443,7 @@ static int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) int rc = 0; unsigned int pos; - ptp = kzalloc_obj(struct efx_ptp_data, GFP_KERNEL); + ptp = kzalloc_obj(struct efx_ptp_data); efx->ptp_data = ptp; if (!efx->ptp_data) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/rx_common.c b/drivers/net/ethernet/sfc/siena/rx_common.c index 71549c21ebc1..83dfd6aae9fe 100644 --- a/drivers/net/ethernet/sfc/siena/rx_common.c +++ b/drivers/net/ethernet/sfc/siena/rx_common.c @@ -207,7 +207,7 @@ int efx_siena_probe_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->ptr_mask); /* Allocate RX buffers */ - rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries, GFP_KERNEL); + rx_queue->buffer = kzalloc_objs(*rx_queue->buffer, entries); if (!rx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/selftest.c b/drivers/net/ethernet/sfc/siena/selftest.c index 668e6771b8bf..864632a07851 100644 --- a/drivers/net/ethernet/sfc/siena/selftest.c +++ b/drivers/net/ethernet/sfc/siena/selftest.c @@ -633,7 +633,7 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, /* Set the port loopback_selftest member. From this point on * all received packets will be dropped. Mark the state as * "flushing" so all inflight packets are dropped */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return -ENOMEM; BUG_ON(efx->loopback_selftest); diff --git a/drivers/net/ethernet/sfc/siena/siena.c b/drivers/net/ethernet/sfc/siena/siena.c index 4718a31b4d94..dbd1417f803f 100644 --- a/drivers/net/ethernet/sfc/siena/siena.c +++ b/drivers/net/ethernet/sfc/siena/siena.c @@ -266,7 +266,7 @@ static int siena_probe_nic(struct efx_nic *efx) int rc; /* Allocate storage for hardware specific data */ - nic_data = kzalloc_obj(struct siena_nic_data, GFP_KERNEL); + nic_data = kzalloc_obj(struct siena_nic_data); if (!nic_data) return -ENOMEM; nic_data->efx = efx; @@ -923,7 +923,7 @@ static int siena_mtd_probe(struct efx_nic *efx) if (rc) return rc; - parts = kzalloc_objs(*parts, hweight32(nvram_types), GFP_KERNEL); + parts = kzalloc_objs(*parts, hweight32(nvram_types)); if (!parts) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/siena_sriov.c b/drivers/net/ethernet/sfc/siena/siena_sriov.c index bcab299f7204..d9789330f8dc 100644 --- a/drivers/net/ethernet/sfc/siena/siena_sriov.c +++ b/drivers/net/ethernet/sfc/siena/siena_sriov.c @@ -1123,7 +1123,7 @@ static void efx_siena_sriov_peer_work(struct work_struct *data) ++peer_count; if (--peer_space == 0) { if (list_empty(&pages)) { - epp = kmalloc_obj(*epp, GFP_KERNEL); + epp = kmalloc_obj(*epp); if (!epp) break; epp->ptr = dma_alloc_coherent( @@ -1197,7 +1197,7 @@ static int efx_siena_sriov_vf_alloc(struct efx_nic *efx) struct siena_vf *vf; struct siena_nic_data *nic_data = efx->nic_data; - nic_data->vf = kzalloc_objs(*nic_data->vf, efx->vf_count, GFP_KERNEL); + nic_data->vf = kzalloc_objs(*nic_data->vf, efx->vf_count); if (!nic_data->vf) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/siena/tx_common.c b/drivers/net/ethernet/sfc/siena/tx_common.c index ca7f910a4847..6a92543a1c5e 100644 --- a/drivers/net/ethernet/sfc/siena/tx_common.c +++ b/drivers/net/ethernet/sfc/siena/tx_common.c @@ -36,7 +36,7 @@ int efx_siena_probe_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries); if (!tx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c index bf39fb5e4bb6..25341acfb472 100644 --- a/drivers/net/ethernet/sfc/tc.c +++ b/drivers/net/ethernet/sfc/tc.c @@ -2672,7 +2672,7 @@ static int efx_tc_configure_default_rule(struct efx_nic *efx, u32 ing_port, match->value.ingress_port = ing_port; match->mask.ingress_port = ~0; - act = kzalloc_obj(*act, GFP_KERNEL); + act = kzalloc_obj(*act); if (!act) return -ENOMEM; act->deliver = 1; @@ -2745,7 +2745,7 @@ static int efx_tc_configure_fallback_acts(struct efx_nic *efx, u32 eg_port, struct efx_tc_action_set *act; int rc; - act = kzalloc_obj(*act, GFP_KERNEL); + act = kzalloc_obj(*act); if (!act) return -ENOMEM; act->deliver = 1; @@ -2988,10 +2988,10 @@ int efx_init_struct_tc(struct efx_nic *efx) if (efx->type->is_vf) return 0; - efx->tc = kzalloc_obj(*efx->tc, GFP_KERNEL); + efx->tc = kzalloc_obj(*efx->tc); if (!efx->tc) return -ENOMEM; - efx->tc->caps = kzalloc_obj(struct mae_caps, GFP_KERNEL); + efx->tc->caps = kzalloc_obj(struct mae_caps); if (!efx->tc->caps) { rc = -ENOMEM; goto fail_alloc_caps; diff --git a/drivers/net/ethernet/sfc/tc_bindings.c b/drivers/net/ethernet/sfc/tc_bindings.c index c4b187b51a69..5c02aa738239 100644 --- a/drivers/net/ethernet/sfc/tc_bindings.c +++ b/drivers/net/ethernet/sfc/tc_bindings.c @@ -59,7 +59,7 @@ static struct efx_tc_block_binding *efx_tc_create_binding( struct efx_nic *efx, struct efx_rep *efv, struct net_device *otherdev, struct flow_block *block) { - struct efx_tc_block_binding *binding = kmalloc_obj(*binding, GFP_KERNEL); + struct efx_tc_block_binding *binding = kmalloc_obj(*binding); if (!binding) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index 4437e2c424f7..f5bdfa0c31a3 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -36,7 +36,7 @@ int efx_probe_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); /* Allocate software ring */ - tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries, GFP_KERNEL); + tx_queue->buffer = kzalloc_objs(*tx_queue->buffer, entries); if (!tx_queue->buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c index c06387ed3bf1..12ddea514910 100644 --- a/drivers/net/ethernet/sis/sis190.c +++ b/drivers/net/ethernet/sis/sis190.c @@ -1407,7 +1407,7 @@ static int sis190_mii_probe(struct net_device *dev) if (status == 0xffff || status == 0x0000) continue; - phy = kmalloc_obj(*phy, GFP_KERNEL); + phy = kmalloc_obj(*phy); if (!phy) { sis190_free_phy(&tp->first_phy); rc = -ENOMEM; diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index b756eea09513..1349ef50cd26 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c @@ -619,7 +619,7 @@ static int sis900_mii_probe(struct net_device *net_dev) continue; } - if ((mii_phy = kmalloc_obj(struct mii_phy, GFP_KERNEL)) == NULL) { + if ((mii_phy = kmalloc_obj(struct mii_phy)) == NULL) { mii_phy = sis_priv->first_mii; while (mii_phy) { struct mii_phy *phy; diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 3b6008cad3a5..d14a6584473c 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1263,7 +1263,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id) if (!dring->vaddr) goto err; - dring->desc = kzalloc_objs(*dring->desc, DESC_NUM, GFP_KERNEL); + dring->desc = kzalloc_objs(*dring->desc, DESC_NUM); if (!dring->desc) goto err; diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index 3c581d71c00e..84cb2f4f0648 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -1273,13 +1273,13 @@ static int ave_open(struct net_device *ndev) if (ret) return ret; - priv->tx.desc = kzalloc_objs(*priv->tx.desc, priv->tx.ndesc, GFP_KERNEL); + priv->tx.desc = kzalloc_objs(*priv->tx.desc, priv->tx.ndesc); if (!priv->tx.desc) { ret = -ENOMEM; goto out_free_irq; } - priv->rx.desc = kzalloc_objs(*priv->rx.desc, priv->rx.ndesc, GFP_KERNEL); + priv->rx.desc = kzalloc_objs(*priv->rx.desc, priv->rx.ndesc); if (!priv->rx.desc) { kfree(priv->tx.desc); ret = -ENOMEM; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ebda64cd1bf2..3dc05dfaa983 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4013,7 +4013,7 @@ stmmac_setup_dma_desc(struct stmmac_priv *priv, unsigned int mtu) struct stmmac_dma_conf *dma_conf; int chan, bfsize, ret; - dma_conf = kzalloc_obj(*dma_conf, GFP_KERNEL); + dma_conf = kzalloc_obj(*dma_conf); if (!dma_conf) { netdev_err(priv->dev, "%s: DMA conf allocation failed\n", __func__); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 8f18a2eab33e..0a0789aaaa53 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -324,7 +324,7 @@ static int __stmmac_test_loopback(struct stmmac_priv *priv, struct sk_buff *skb = NULL; int ret = 0; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; @@ -434,11 +434,11 @@ static int stmmac_test_eee(struct stmmac_priv *priv) if (!priv->dma_cap.eee || !priv->eee_active) return -EOPNOTSUPP; - initial = kzalloc_obj(*initial, GFP_KERNEL); + initial = kzalloc_obj(*initial); if (!initial) return -ENOMEM; - final = kzalloc_obj(*final, GFP_KERNEL); + final = kzalloc_obj(*final); if (!final) { ret = -ENOMEM; goto out_free_initial; @@ -744,7 +744,7 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv) if (!phydev || (!phydev->pause && !phydev->asym_pause)) return -EOPNOTSUPP; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; @@ -898,7 +898,7 @@ static int __stmmac_test_vlanfilt(struct stmmac_priv *priv) struct sk_buff *skb = NULL; int ret = 0, i; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; @@ -991,7 +991,7 @@ static int __stmmac_test_dvlanfilt(struct stmmac_priv *priv) struct sk_buff *skb = NULL; int ret = 0, i; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; @@ -1099,19 +1099,19 @@ static int stmmac_test_rxp(struct stmmac_priv *priv) if (!sel) return -ENOMEM; - exts = kzalloc_obj(*exts, GFP_KERNEL); + exts = kzalloc_obj(*exts); if (!exts) { ret = -ENOMEM; goto cleanup_sel; } - actions = kzalloc_objs(*actions, nk, GFP_KERNEL); + actions = kzalloc_objs(*actions, nk); if (!actions) { ret = -ENOMEM; goto cleanup_exts; } - gact = kzalloc_objs(*gact, nk, GFP_KERNEL); + gact = kzalloc_objs(*gact, nk); if (!gact) { ret = -ENOMEM; goto cleanup_actions; @@ -1266,7 +1266,7 @@ static int stmmac_test_vlanoff_common(struct stmmac_priv *priv, bool svlan) if (!priv->dma_cap.vlins) return -EOPNOTSUPP; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; @@ -1349,7 +1349,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, priv->plat->rx_queues_to_use); } - dissector = kzalloc_obj(*dissector, GFP_KERNEL); + dissector = kzalloc_obj(*dissector); if (!dissector) { ret = -ENOMEM; goto cleanup_rss; @@ -1358,7 +1358,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_IPV4_ADDRS); dissector->offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] = 0; - cls = kzalloc_obj(*cls, GFP_KERNEL); + cls = kzalloc_obj(*cls); if (!cls) { ret = -ENOMEM; goto cleanup_dissector; @@ -1475,7 +1475,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, priv->plat->rx_queues_to_use); } - dissector = kzalloc_obj(*dissector, GFP_KERNEL); + dissector = kzalloc_obj(*dissector); if (!dissector) { ret = -ENOMEM; goto cleanup_rss; @@ -1486,7 +1486,7 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, dissector->offset[FLOW_DISSECTOR_KEY_BASIC] = 0; dissector->offset[FLOW_DISSECTOR_KEY_PORTS] = offsetof(typeof(keys), key); - cls = kzalloc_obj(*cls, GFP_KERNEL); + cls = kzalloc_obj(*cls); if (!cls) { ret = -ENOMEM; goto cleanup_dissector; @@ -1628,7 +1628,7 @@ static int stmmac_test_arpoffload(struct stmmac_priv *priv) if (!priv->dma_cap.arpoffsel) return -EOPNOTSUPP; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c index c1102acbb1e0..05689e62ca83 100644 --- a/drivers/net/ethernet/sun/ldmvsw.c +++ b/drivers/net/ethernet/sun/ldmvsw.c @@ -202,7 +202,7 @@ static struct vnet *vsw_get_vnet(struct mdesc_handle *hp, } if (!vp) { - vp = kzalloc_obj(*vp, GFP_KERNEL); + vp = kzalloc_obj(*vp); if (unlikely(!vp)) { mutex_unlock(&vnet_list_mutex); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 2d31e6112ca6..88df15e6dd74 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -4341,7 +4341,7 @@ static int niu_alloc_rx_ring_info(struct niu *np, { BUILD_BUG_ON(sizeof(struct rxdma_mailbox) != 64); - rp->rxhash = kzalloc_objs(struct page *, MAX_RBR_RING_SIZE, GFP_KERNEL); + rp->rxhash = kzalloc_objs(struct page *, MAX_RBR_RING_SIZE); if (!rp->rxhash) return -ENOMEM; @@ -4484,7 +4484,7 @@ static int niu_alloc_channels(struct niu *np) num_rx_rings = parent->rxchan_per_port[port]; num_tx_rings = parent->txchan_per_port[port]; - rx_rings = kzalloc_objs(struct rx_ring_info, num_rx_rings, GFP_KERNEL); + rx_rings = kzalloc_objs(struct rx_ring_info, num_rx_rings); err = -ENOMEM; if (!rx_rings) goto out_err; @@ -4523,7 +4523,7 @@ static int niu_alloc_channels(struct niu *np) goto out_err; } - tx_rings = kzalloc_objs(struct tx_ring_info, num_tx_rings, GFP_KERNEL); + tx_rings = kzalloc_objs(struct tx_ring_info, num_tx_rings); err = -ENOMEM; if (!tx_rings) goto out_err; @@ -9511,7 +9511,7 @@ static struct niu_parent *niu_new_parent(struct niu *np, goto fail_unregister; } - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) goto fail_unregister; diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 1984a6de65ee..4c9d5d4dd8a0 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2248,7 +2248,7 @@ static struct quattro *quattro_sbus_find(struct platform_device *child) if (qp) return qp; - qp = kzalloc_obj(*qp, GFP_KERNEL); + qp = kzalloc_obj(*qp); if (!qp) return NULL; @@ -2278,7 +2278,7 @@ static struct quattro *quattro_pci_find(struct pci_dev *pdev) return qp; } - qp = kmalloc_obj(struct quattro, GFP_KERNEL); + qp = kmalloc_obj(struct quattro); if (!qp) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c index 36187e85b7e6..acef22cb9134 100644 --- a/drivers/net/ethernet/sun/sunqe.c +++ b/drivers/net/ethernet/sun/sunqe.c @@ -771,7 +771,7 @@ static struct sunqec *get_qec(struct platform_device *child) qecp = platform_get_drvdata(op); if (!qecp) { - qecp = kzalloc_obj(struct sunqec, GFP_KERNEL); + qecp = kzalloc_obj(struct sunqec); if (qecp) { u32 ctrl; diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 7c756e07eb55..6d477401f179 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -436,7 +436,7 @@ static int vnet_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto err_out_put_mdesc; } - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); err = -ENOMEM; if (!port) goto err_out_put_mdesc; diff --git a/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c b/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c index fa9959ad966d..66866ea37913 100644 --- a/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c +++ b/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c @@ -748,7 +748,7 @@ int icssm_prueth_sw_init_fdb_table(struct prueth *prueth) if (prueth->emac_configured) return 0; - prueth->fdb_tbl = kmalloc_obj(*prueth->fdb_tbl, GFP_KERNEL); + prueth->fdb_tbl = kmalloc_obj(*prueth->fdb_tbl); if (!prueth->fdb_tbl) return -ENOMEM; diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index 58bb394fecdf..36d8244252bd 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -55,7 +55,7 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, const char *pool_name = NULL; int ret = -ENOMEM; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(ret); diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c index 67d96efcb8bc..f20e06985c5e 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c @@ -209,7 +209,7 @@ static struct gelic_eurus_cmd *gelic_eurus_sync_cmd(struct gelic_wl_info *wl, struct gelic_eurus_cmd *cmd; /* allocate cmd */ - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return NULL; diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index f761975aeda8..b71784bacf73 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c @@ -2304,7 +2304,7 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) struct rx_info rx; struct tx_info tx; - tmp_vptr = kzalloc_obj(*tmp_vptr, GFP_KERNEL); + tmp_vptr = kzalloc_obj(*tmp_vptr); if (!tmp_vptr) { ret = -ENOMEM; goto out_0; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index 00c23bebdc72..08dd0e4c3bc3 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -1905,14 +1905,14 @@ static int wx_acquire_msix_vectors(struct wx *wx) nvecs = min_t(int, nvecs, num_online_cpus()); nvecs = min_t(int, nvecs, wx->mac.max_msix_vectors); - wx->msix_q_entries = kzalloc_objs(struct msix_entry, nvecs, GFP_KERNEL); + wx->msix_q_entries = kzalloc_objs(struct msix_entry, nvecs); if (!wx->msix_q_entries) return -ENOMEM; /* One for non-queue interrupts */ nvecs += 1; - wx->msix_entry = kzalloc_objs(struct msix_entry, 1, GFP_KERNEL); + wx->msix_entry = kzalloc_objs(struct msix_entry, 1); if (!wx->msix_entry) { kfree(wx->msix_q_entries); wx->msix_q_entries = NULL; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_mbx.c b/drivers/net/ethernet/wangxun/libwx/wx_mbx.c index d237814cbae5..761aa4f713bd 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_mbx.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_mbx.c @@ -403,7 +403,7 @@ int wx_read_mbx_vf(struct wx *wx, u32 *msg, u16 size) int wx_init_mbx_params_vf(struct wx *wx) { - wx->vfinfo = kzalloc_obj(struct vf_data_storage, GFP_KERNEL); + wx->vfinfo = kzalloc_obj(struct vf_data_storage); if (!wx->vfinfo) return -ENOMEM; diff --git a/drivers/net/ethernet/wangxun/libwx/wx_sriov.c b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c index 70a5b00eb353..a360b06a086a 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_sriov.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c @@ -32,7 +32,7 @@ static int wx_alloc_vf_macvlans(struct wx *wx, u8 num_vfs) if (!num_vf_macvlans) return -EINVAL; - mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans, GFP_KERNEL); + mv_list = kzalloc_objs(struct vf_macvlans, num_vf_macvlans); if (!mv_list) return -ENOMEM; @@ -87,7 +87,7 @@ static int __wx_enable_sriov(struct wx *wx, u8 num_vfs) wx->ring_feature[RING_F_VMDQ].limit = 1; wx->ring_feature[RING_F_VMDQ].offset = num_vfs; - wx->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs, GFP_KERNEL); + wx->vfinfo = kzalloc_objs(struct vf_data_storage, num_vfs); if (!wx->vfinfo) return -ENOMEM; diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c index d42fd6d8d9c8..fc04040957bf 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c @@ -81,7 +81,7 @@ static int ngbe_set_ringparam(struct net_device *netdev, /* allocate temporary buffer to store rings in */ i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); - temp_ring = kvmalloc_objs(struct wx_ring, i, GFP_KERNEL); + temp_ring = kvmalloc_objs(struct wx_ring, i); if (!temp_ring) { err = -ENOMEM; goto clear_reset; diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c index cc0ebc3d030a..9157b8275be1 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c @@ -73,7 +73,7 @@ static int txgbe_set_ringparam(struct net_device *netdev, /* allocate temporary buffer to store rings in */ i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); - temp_ring = kvmalloc_objs(struct wx_ring, i, GFP_KERNEL); + temp_ring = kvmalloc_objs(struct wx_ring, i); if (!temp_ring) { err = -ENOMEM; goto clear_reset; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 8980c965b5fd..cb286ba821db 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1549,7 +1549,7 @@ static int axienet_init_dmaengine(struct net_device *ndev) goto err_dma_release_rx; } for (i = 0; i < TX_BD_NUM_MAX; i++) { - skbuf_dma = kzalloc_obj(*skbuf_dma, GFP_KERNEL); + skbuf_dma = kzalloc_obj(*skbuf_dma); if (!skbuf_dma) { ret = -ENOMEM; goto err_free_tx_skb_ring; @@ -1564,7 +1564,7 @@ static int axienet_init_dmaengine(struct net_device *ndev) goto err_free_tx_skb_ring; } for (i = 0; i < RX_BUF_NUM_DEFAULT; i++) { - skbuf_dma = kzalloc_obj(*skbuf_dma, GFP_KERNEL); + skbuf_dma = kzalloc_obj(*skbuf_dma); if (!skbuf_dma) { ret = -ENOMEM; goto err_free_rx_skb_ring; diff --git a/drivers/net/fjes/fjes_hw.c b/drivers/net/fjes/fjes_hw.c index db40667413b4..774eac1c11c0 100644 --- a/drivers/net/fjes/fjes_hw.c +++ b/drivers/net/fjes/fjes_hw.c @@ -212,7 +212,7 @@ static int fjes_hw_setup(struct fjes_hw *hw) hw->hw_info.max_epid = &hw->max_epid; hw->hw_info.my_epid = &hw->my_epid; - buf = kzalloc_objs(struct ep_share_mem_info, hw->max_epid, GFP_KERNEL); + buf = kzalloc_objs(struct ep_share_mem_info, hw->max_epid); if (!buf) return -ENOMEM; diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index d482e5512fa8..01cdd06102e0 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -980,7 +980,7 @@ static struct geneve_sock *geneve_socket_create(struct net *net, __be16 port, struct udp_tunnel_sock_cfg tunnel_cfg; int h; - gs = kzalloc_obj(*gs, GFP_KERNEL); + gs = kzalloc_obj(*gs); if (!gs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 16220b740b8e..4106f0301ab4 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -386,7 +386,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate, } /* Allocate a new mcs */ - if ((p = kmalloc_obj(struct yam_mcs, GFP_KERNEL)) == NULL) { + if ((p = kmalloc_obj(struct yam_mcs)) == NULL) { release_firmware(fw); return NULL; } diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index d9fa2fc4c43c..59e95341f9b1 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -129,7 +129,7 @@ static struct netvsc_device *alloc_net_device(void) { struct netvsc_device *net_device; - net_device = kzalloc_obj(struct netvsc_device, GFP_KERNEL); + net_device = kzalloc_obj(struct netvsc_device); if (!net_device) return NULL; diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 2fa77dc21d7e..9b6c44979b4e 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -64,7 +64,7 @@ static struct rndis_device *get_rndis_device(void) { struct rndis_device *device; - device = kzalloc_obj(struct rndis_device, GFP_KERNEL); + device = kzalloc_obj(struct rndis_device); if (!device) return NULL; @@ -87,7 +87,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev, struct rndis_set_request *set; unsigned long flags; - request = kzalloc_obj(struct rndis_request, GFP_KERNEL); + request = kzalloc_obj(struct rndis_request); if (!request) return NULL; diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index bb3ff9ce06b2..97c69f522a82 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -3067,7 +3067,7 @@ static int ca8210_probe(struct spi_device *spi_device) ca8210_hw_setup(hw); ieee802154_random_extended_addr(&hw->phy->perm_extended_addr); - pdata = kmalloc_obj(*pdata, GFP_KERNEL); + pdata = kmalloc_obj(*pdata); if (!pdata) { ret = -ENOMEM; goto error; diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c index e449afd8e71f..6daa0f198b9f 100644 --- a/drivers/net/ieee802154/mac802154_hwsim.c +++ b/drivers/net/ieee802154/mac802154_hwsim.c @@ -545,11 +545,11 @@ static struct hwsim_edge *hwsim_alloc_edge(struct hwsim_phy *endpoint, u8 lqi) struct hwsim_edge_info *einfo; struct hwsim_edge *e; - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return NULL; - einfo = kzalloc_obj(*einfo, GFP_KERNEL); + einfo = kzalloc_obj(*einfo); if (!einfo) { kfree(e); return NULL; @@ -713,7 +713,7 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info) return -ENOENT; } - einfo = kzalloc_obj(*einfo, GFP_KERNEL); + einfo = kzalloc_obj(*einfo); if (!einfo) { mutex_unlock(&hwsim_phys_lock); return -ENOMEM; @@ -946,7 +946,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, /* hwsim phy channel 13 as default */ hw->phy->current_channel = 13; - pib = kzalloc_obj(*pib, GFP_KERNEL); + pib = kzalloc_obj(*pib); if (!pib) { err = -ENOMEM; goto err_pib; diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 4ad90264433a..5407d2ed71b3 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -187,7 +187,7 @@ static int ifb_dev_init(struct net_device *dev) struct ifb_q_private *txp; int i; - txp = kzalloc_objs(*txp, dev->num_tx_queues, GFP_KERNEL); + txp = kzalloc_objs(*txp, dev->num_tx_queues); if (!txp) return -ENOMEM; dp->tx_private = txp; diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index f82484de39dd..d0b10a2020ea 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -746,7 +746,7 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) * Each entry in this map records the transaction associated * with a corresponding completed TRE. */ - trans_info->map = kzalloc_objs(*trans_info->map, tre_count, GFP_KERNEL); + trans_info->map = kzalloc_objs(*trans_info->map, tre_count); if (!trans_info->map) { ret = -ENOMEM; goto err_trans_free; diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 9e8d75a98f05..131b9cc94201 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -329,7 +329,7 @@ struct ipa_interrupt *ipa_interrupt_init(struct platform_device *pdev) if (irq <= 0) return ERR_PTR(irq ? : -EINVAL); - interrupt = kzalloc_obj(*interrupt, GFP_KERNEL); + interrupt = kzalloc_obj(*interrupt); if (!interrupt) return ERR_PTR(-ENOMEM); interrupt->irq = irq; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index d09b4723f26c..edead9c48d1f 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -830,7 +830,7 @@ static int ipa_probe(struct platform_device *pdev) } /* No more EPROBE_DEFER. Allocate and initialize the IPA structure */ - ipa = kzalloc_obj(*ipa, GFP_KERNEL); + ipa = kzalloc_obj(*ipa); if (!ipa) { ret = -ENOMEM; goto err_power_exit; diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c index e96bdd9b68a8..2f0ccdd937cc 100644 --- a/drivers/net/ipa/ipa_smp2p.c +++ b/drivers/net/ipa/ipa_smp2p.c @@ -242,7 +242,7 @@ ipa_smp2p_init(struct ipa *ipa, struct platform_device *pdev, bool modem_init) if (enabled_bit >= 32) /* BITS_PER_U32 */ return -EINVAL; - smp2p = kzalloc_obj(*smp2p, GFP_KERNEL); + smp2p = kzalloc_obj(*smp2p); if (!smp2p) return -ENOMEM; diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 6f4ea2234ccb..ed46439a9f4e 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -64,7 +64,7 @@ static int ipvlan_port_create(struct net_device *dev) struct ipvl_port *port; int err, idx; - port = kzalloc_obj(struct ipvl_port, GFP_KERNEL); + port = kzalloc_obj(struct ipvl_port); if (!port) return -ENOMEM; diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 1b523a56e7da..f6cad0746a02 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -1465,7 +1465,7 @@ static struct macsec_rx_sc *create_rx_sc(struct net_device *dev, sci_t sci, return ERR_PTR(-EEXIST); } - rx_sc = kzalloc_obj(*rx_sc, GFP_KERNEL); + rx_sc = kzalloc_obj(*rx_sc); if (!rx_sc) return ERR_PTR(-ENOMEM); @@ -1797,7 +1797,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info) return -EBUSY; } - rx_sa = kmalloc_obj(*rx_sa, GFP_KERNEL); + rx_sa = kmalloc_obj(*rx_sa); if (!rx_sa) { rtnl_unlock(); return -ENOMEM; @@ -2005,7 +2005,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info) return -EBUSY; } - tx_sa = kmalloc_obj(*tx_sa, GFP_KERNEL); + tx_sa = kmalloc_obj(*tx_sa); if (!tx_sa) { rtnl_unlock(); return -ENOMEM; @@ -4013,7 +4013,7 @@ static int register_macsec_dev(struct net_device *real_dev, if (!rxd) { int err; - rxd = kmalloc_obj(*rxd, GFP_KERNEL); + rxd = kmalloc_obj(*rxd); if (!rxd) return -ENOMEM; diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 1b4e327e26e1..a71f058eceef 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -163,7 +163,7 @@ static int macvlan_hash_add_source(struct macvlan_dev *vlan, if (entry) return 0; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1131,7 +1131,7 @@ static int macvlan_dev_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err; - netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll); err = -ENOMEM; if (!netpoll) goto out; @@ -1249,7 +1249,7 @@ static int macvlan_port_create(struct net_device *dev) if (netdev_is_rx_handler_busy(dev)) return -EBUSY; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (port == NULL) return -ENOMEM; diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c index 03f51a66933c..de6bc1736734 100644 --- a/drivers/net/mctp/mctp-i2c.c +++ b/drivers/net/mctp/mctp-i2c.c @@ -154,7 +154,7 @@ static struct mctp_i2c_client *mctp_i2c_new_client(struct i2c_client *client) goto err; } - mcli = kzalloc_obj(*mcli, GFP_KERNEL); + mcli = kzalloc_obj(*mcli); if (!mcli) { rc = -ENOMEM; goto err; diff --git a/drivers/net/mctp/mctp-i3c.c b/drivers/net/mctp/mctp-i3c.c index 0814b65c2843..6d2bbae7477b 100644 --- a/drivers/net/mctp/mctp-i3c.c +++ b/drivers/net/mctp/mctp-i3c.c @@ -259,7 +259,7 @@ __must_hold(&busdevs_lock) struct mctp_i3c_device *mi = NULL; int rc; - mi = kzalloc_obj(*mi, GFP_KERNEL); + mi = kzalloc_obj(*mi); if (!mi) { rc = -ENOMEM; goto err; diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 73604c019b25..37415cad69f5 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -348,7 +348,7 @@ static struct netconsole_target *alloc_and_init(void) { struct netconsole_target *nt; - nt = kzalloc_obj(*nt, GFP_KERNEL); + nt = kzalloc_obj(*nt); if (!nt) return nt; @@ -1270,7 +1270,7 @@ static struct config_item *userdatum_make_item(struct config_group *group, if (count_userdata_entries(nt) >= MAX_USERDATA_ITEMS) return ERR_PTR(-ENOSPC); - udm = kzalloc_obj(*udm, GFP_KERNEL); + udm = kzalloc_obj(*udm); if (!udm) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c index badf08add94f..8eebcc933ddb 100644 --- a/drivers/net/netdevsim/bpf.c +++ b/drivers/net/netdevsim/bpf.c @@ -222,7 +222,7 @@ static int nsim_bpf_create_prog(struct nsim_dev *nsim_dev, char name[16]; int ret; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index 8de96fe6c02a..f85b1c261dfb 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -451,7 +451,7 @@ nsim_bus_dev_new(unsigned int id, unsigned int port_count, unsigned int num_queu struct nsim_bus_dev *nsim_bus_dev; int err; - nsim_bus_dev = kzalloc_obj(*nsim_bus_dev, GFP_KERNEL); + nsim_bus_dev = kzalloc_obj(*nsim_bus_dev); if (!nsim_bus_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index a227c0b9fe4c..bc13df81bfa3 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -935,7 +935,7 @@ static int nsim_dev_traps_init(struct devlink *devlink) struct nsim_trap_data *nsim_trap_data; int err; - nsim_trap_data = kzalloc_obj(*nsim_trap_data, GFP_KERNEL); + nsim_trap_data = kzalloc_obj(*nsim_trap_data); if (!nsim_trap_data) return -ENOMEM; @@ -1348,7 +1348,7 @@ static int nsim_rate_node_new(struct devlink_rate *node, void **priv, return -EOPNOTSUPP; } - nsim_node = kzalloc_obj(*nsim_node, GFP_KERNEL); + nsim_node = kzalloc_obj(*nsim_node); if (!nsim_node) return -ENOMEM; @@ -1464,7 +1464,7 @@ static int __nsim_dev_port_add(struct nsim_dev *nsim_dev, enum nsim_dev_port_typ if (type == NSIM_DEV_PORT_TYPE_VF && !nsim_dev_get_vfs(nsim_dev)) return -EINVAL; - nsim_dev_port = kzalloc_obj(*nsim_dev_port, GFP_KERNEL); + nsim_dev_port = kzalloc_obj(*nsim_dev_port); if (!nsim_dev_port) return -ENOMEM; nsim_dev_port->port_index = nsim_dev_port_index(type, port_index); diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c index b1292a8c0ef1..1a42bdbfaa41 100644 --- a/drivers/net/netdevsim/fib.c +++ b/drivers/net/netdevsim/fib.c @@ -277,7 +277,7 @@ nsim_fib4_rt_create(struct nsim_fib_data *data, { struct nsim_fib4_rt *fib4_rt; - fib4_rt = kzalloc_obj(*fib4_rt, GFP_KERNEL); + fib4_rt = kzalloc_obj(*fib4_rt); if (!fib4_rt) return NULL; @@ -497,7 +497,7 @@ static int nsim_fib6_rt_nh_add(struct nsim_fib6_rt *fib6_rt, { struct nsim_fib6_rt_nh *fib6_rt_nh; - fib6_rt_nh = kzalloc_obj(*fib6_rt_nh, GFP_KERNEL); + fib6_rt_nh = kzalloc_obj(*fib6_rt_nh); if (!fib6_rt_nh) return -ENOMEM; @@ -544,7 +544,7 @@ nsim_fib6_rt_create(struct nsim_fib_data *data, int i = 0; int err; - fib6_rt = kzalloc_obj(*fib6_rt, GFP_KERNEL); + fib6_rt = kzalloc_obj(*fib6_rt); if (!fib6_rt) return ERR_PTR(-ENOMEM); @@ -1116,7 +1116,7 @@ static struct nsim_nexthop *nsim_nexthop_create(struct nsim_fib_data *data, u64 occ = 0; int i; - nexthop = kzalloc_obj(*nexthop, GFP_KERNEL); + nexthop = kzalloc_obj(*nexthop); if (!nexthop) return ERR_PTR(-ENOMEM); @@ -1556,7 +1556,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink, struct nsim_dev *nsim_dev; int err; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); data->devlink = devlink; diff --git a/drivers/net/netdevsim/hwstats.c b/drivers/net/netdevsim/hwstats.c index 57b782aa1046..14234a4cc244 100644 --- a/drivers/net/netdevsim/hwstats.c +++ b/drivers/net/netdevsim/hwstats.c @@ -238,7 +238,7 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats, goto out_unlock_list; } - hwsdev = kzalloc_obj(*hwsdev, GFP_KERNEL); + hwsdev = kzalloc_obj(*hwsdev); if (!hwsdev) { err = -ENOMEM; goto out_put_netdev; diff --git a/drivers/net/netdevsim/psample.c b/drivers/net/netdevsim/psample.c index 39250b9d201f..47d24bc64ee4 100644 --- a/drivers/net/netdevsim/psample.c +++ b/drivers/net/netdevsim/psample.c @@ -200,7 +200,7 @@ int nsim_dev_psample_init(struct nsim_dev *nsim_dev) struct nsim_dev_psample *psample; int err; - psample = kzalloc_obj(*psample, GFP_KERNEL); + psample = kzalloc_obj(*psample); if (!psample) return -ENOMEM; nsim_dev->psample = psample; diff --git a/drivers/net/ovpn/crypto_aead.c b/drivers/net/ovpn/crypto_aead.c index de335ab81948..77be0942a269 100644 --- a/drivers/net/ovpn/crypto_aead.c +++ b/drivers/net/ovpn/crypto_aead.c @@ -328,7 +328,7 @@ ovpn_aead_crypto_key_slot_new(const struct ovpn_key_config *kc) return ERR_PTR(-EINVAL); /* build the key slot */ - ks = kmalloc_obj(*ks, GFP_KERNEL); + ks = kmalloc_obj(*ks); if (!ks) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c index 4554b0f8a409..2e0420febda0 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -57,7 +57,7 @@ static int ovpn_mp_alloc(struct ovpn_priv *ovpn) /* the peer container is fairly large, therefore we allocate it only in * MP mode */ - ovpn->peers = kzalloc_obj(*ovpn->peers, GFP_KERNEL); + ovpn->peers = kzalloc_obj(*ovpn->peers); if (!ovpn->peers) return -ENOMEM; diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index bac34068f0fc..3716a1d82801 100644 --- a/drivers/net/ovpn/peer.c +++ b/drivers/net/ovpn/peer.c @@ -95,7 +95,7 @@ struct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id) int ret; /* alloc and init peer object */ - peer = kzalloc_obj(*peer, GFP_KERNEL); + peer = kzalloc_obj(*peer); if (!peer) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ovpn/socket.c b/drivers/net/ovpn/socket.c index 7be493f78440..517caa64a4fe 100644 --- a/drivers/net/ovpn/socket.c +++ b/drivers/net/ovpn/socket.c @@ -191,7 +191,7 @@ struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer) /* socket is not owned: attach to this ovpn instance */ - ovpn_sock = kzalloc_obj(*ovpn_sock, GFP_KERNEL); + ovpn_sock = kzalloc_obj(*ovpn_sock); if (!ovpn_sock) { ovpn_sock = ERR_PTR(-ENOMEM); goto sock_release; diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index abf521f063cf..a92081560e64 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -288,7 +288,7 @@ static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) struct lynx_pcs *lynx; int i; - lynx = kzalloc_obj(*lynx, GFP_KERNEL); + lynx = kzalloc_obj(*lynx); if (!lynx) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c index 5587d572dcbc..c12f8087af9b 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -334,7 +334,7 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev, dev_dbg(dev, "MediaTek LynxI SGMII PCS (id 0x%08x, ver 0x%04x)\n", id, ver); - mpcs = kzalloc_obj(*mpcs, GFP_KERNEL); + mpcs = kzalloc_obj(*mpcs); if (!mpcs) return NULL; diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c index 4de8c426787e..4652dc7dd604 100644 --- a/drivers/net/pcs/pcs-rzn1-miic.c +++ b/drivers/net/pcs/pcs-rzn1-miic.c @@ -487,7 +487,7 @@ struct phylink_pcs *miic_create(struct device *dev, struct device_node *np) return ERR_PTR(-EINVAL); } - miic_port = kzalloc_obj(*miic_port, GFP_KERNEL); + miic_port = kzalloc_obj(*miic_port); if (!miic_port) { put_device(&pdev->dev); return ERR_PTR(-ENOMEM); diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 8566e6ad64e9..e69fa2f0a0e8 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -1528,7 +1528,7 @@ static struct dw_xpcs *xpcs_create_data(struct mdio_device *mdiodev) { struct dw_xpcs *xpcs; - xpcs = kzalloc_obj(*xpcs, GFP_KERNEL); + xpcs = kzalloc_obj(*xpcs); if (!xpcs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c index d3954ea6b1dd..d5738117eca6 100644 --- a/drivers/net/phy/as21xxx.c +++ b/drivers/net/phy/as21xxx.c @@ -907,7 +907,7 @@ static int as21xxx_match_phy_device(struct phy_device *phydev, return phy_id == phydrv->phy_id; /* Allocate temp priv and load the firmware */ - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index a56f4302840f..be0051ff6420 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -1027,7 +1027,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) if (clock) goto out; - clock = kzalloc_obj(struct dp83640_clock, GFP_KERNEL); + clock = kzalloc_obj(struct dp83640_clock); if (!clock) goto out; @@ -1411,7 +1411,7 @@ static int dp83640_probe(struct phy_device *phydev) if (!clock) goto no_clock; - dp83640 = kzalloc_obj(struct dp83640_private, GFP_KERNEL); + dp83640 = kzalloc_obj(struct dp83640_private); if (!dp83640) goto no_memory; diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index 172fbfcb215c..b8a5a1838196 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -41,7 +41,7 @@ struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr) struct mdio_device *mdiodev; /* We allocate the device, and initialize the default values */ - mdiodev = kzalloc_obj(*mdiodev, GFP_KERNEL); + mdiodev = kzalloc_obj(*mdiodev); if (!mdiodev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 5ef9248c6b49..c6b011a9d636 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -4114,7 +4114,7 @@ static void lan8814_get_rx_ts(struct kszphy_ptp_priv *ptp_priv) u32 reg; do { - rx_ts = kzalloc_obj(*rx_ts, GFP_KERNEL); + rx_ts = kzalloc_obj(*rx_ts); if (!rx_ts) return; diff --git a/drivers/net/phy/microchip_rds_ptp.c b/drivers/net/phy/microchip_rds_ptp.c index 9307df6f6d11..2ad95d5c9d86 100644 --- a/drivers/net/phy/microchip_rds_ptp.c +++ b/drivers/net/phy/microchip_rds_ptp.c @@ -999,7 +999,7 @@ static struct mchp_rds_ptp_rx_ts if (rc < 0) goto error; - rx_ts = kmalloc_obj(*rx_ts, GFP_KERNEL); + rx_ts = kmalloc_obj(*rx_ts); if (!rx_ts) return NULL; diff --git a/drivers/net/phy/mii_timestamper.c b/drivers/net/phy/mii_timestamper.c index 259ed30897c7..3ad10e9e36d0 100644 --- a/drivers/net/phy/mii_timestamper.c +++ b/drivers/net/phy/mii_timestamper.c @@ -28,7 +28,7 @@ int register_mii_tstamp_controller(struct device *device, { struct mii_timestamping_desc *desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c index ed0d445ce1e1..2ae5eed6da1a 100644 --- a/drivers/net/phy/mscc/mscc_macsec.c +++ b/drivers/net/phy/mscc/mscc_macsec.c @@ -610,7 +610,7 @@ static struct macsec_flow *vsc8584_macsec_alloc_flow(struct vsc8531_private *pri if (index == MSCC_MS_MAX_FLOWS) return ERR_PTR(-ENOMEM); - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (!flow) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/nxp-c45-tja11xx-macsec.c b/drivers/net/phy/nxp-c45-tja11xx-macsec.c index 21519a2d9f85..63e3934be653 100644 --- a/drivers/net/phy/nxp-c45-tja11xx-macsec.c +++ b/drivers/net/phy/nxp-c45-tja11xx-macsec.c @@ -431,7 +431,7 @@ static struct nxp_c45_sa *nxp_c45_sa_alloc(struct list_head *sa_list, void *sa, return ERR_PTR(-ENOSPC); } - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return ERR_PTR(-ENOMEM); @@ -991,7 +991,7 @@ static int nxp_c45_mdo_add_secy(struct macsec_context *ctx) if (idx == TX_SC_MAX) return -ENOSPC; - phy_secy = kzalloc_obj(*phy_secy, GFP_KERNEL); + phy_secy = kzalloc_obj(*phy_secy); if (!phy_secy) return -ENOMEM; diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 376bfa923349..1f1039084f51 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -736,7 +736,7 @@ int phy_ethtool_set_plca_cfg(struct phy_device *phydev, goto out; } - curr_plca_cfg = kmalloc_obj(*curr_plca_cfg, GFP_KERNEL); + curr_plca_cfg = kmalloc_obj(*curr_plca_cfg); if (!curr_plca_cfg) { ret = -ENOMEM; goto out; diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 52c2ff7fc6ae..02fc0133428d 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -438,7 +438,7 @@ static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend, static int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, int (*run)(struct phy_device *)) { - struct phy_fixup *fixup = kzalloc_obj(*fixup, GFP_KERNEL); + struct phy_fixup *fixup = kzalloc_obj(*fixup); if (!fixup) return -ENOMEM; @@ -754,7 +754,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, int ret = 0; /* We allocate the device, and initialize the default values */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c index 7821fe19934c..9e24d4ebcb79 100644 --- a/drivers/net/phy/phy_led_triggers.c +++ b/drivers/net/phy/phy_led_triggers.c @@ -93,7 +93,7 @@ int phy_led_triggers_register(struct phy_device *phy) if (!phy->phy_num_led_triggers) return 0; - phy->led_link_trigger = kzalloc_obj(*phy->led_link_trigger, GFP_KERNEL); + phy->led_link_trigger = kzalloc_obj(*phy->led_link_trigger); if (!phy->led_link_trigger) { err = -ENOMEM; goto out_clear; diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c index ed15599dd38d..1f1eb5d59b38 100644 --- a/drivers/net/phy/phy_link_topology.c +++ b/drivers/net/phy/phy_link_topology.c @@ -15,7 +15,7 @@ static int netdev_alloc_phy_link_topology(struct net_device *dev) { struct phy_link_topology *topo; - topo = kzalloc_obj(*topo, GFP_KERNEL); + topo = kzalloc_obj(*topo); if (!topo) return -ENOMEM; @@ -43,7 +43,7 @@ int phy_link_topo_add_phy(struct net_device *dev, topo = dev->link_topo; } - pdn = kzalloc_obj(*pdn, GFP_KERNEL); + pdn = kzalloc_obj(*pdn); if (!pdn) return -ENOMEM; diff --git a/drivers/net/phy/phy_package.c b/drivers/net/phy/phy_package.c index 3137a8fecf21..63e4f862f731 100644 --- a/drivers/net/phy/phy_package.c +++ b/drivers/net/phy/phy_package.c @@ -219,7 +219,7 @@ int phy_package_join(struct phy_device *phydev, int base_addr, size_t priv_size) shared = bus->shared[base_addr]; if (!shared) { ret = -ENOMEM; - shared = kzalloc_obj(*shared, GFP_KERNEL); + shared = kzalloc_obj(*shared); if (!shared) goto err_unlock; if (priv_size) { diff --git a/drivers/net/phy/phy_port.c b/drivers/net/phy/phy_port.c index cae133a25fb0..e56e29d0e9fa 100644 --- a/drivers/net/phy/phy_port.c +++ b/drivers/net/phy/phy_port.c @@ -19,7 +19,7 @@ struct phy_port *phy_port_alloc(void) { struct phy_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return NULL; diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index f21a69e34d1c..aba1b35c7cd7 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1853,7 +1853,7 @@ struct phylink *phylink_create(struct phylink_config *config, return ERR_PTR(-EINVAL); } - pl = kzalloc_obj(*pl, GFP_KERNEL); + pl = kzalloc_obj(*pl); if (!pl) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index 07175bf3ef60..8679d27bf1ba 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c @@ -388,7 +388,7 @@ static struct sfp_bus *sfp_bus_get(const struct fwnode_handle *fwnode) { struct sfp_bus *sfp, *new, *found = NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); mutex_lock(&sfp_mutex); diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 42a9c93f03b3..f4bf53da3d4f 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -3029,7 +3029,7 @@ static struct sfp *sfp_alloc(struct device *dev) { struct sfp *sfp; - sfp = kzalloc_obj(*sfp, GFP_KERNEL); + sfp = kzalloc_obj(*sfp); if (!sfp) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/ppp/bsd_comp.c b/drivers/net/ppp/bsd_comp.c index 26bfa0feb7f5..63a6d251c746 100644 --- a/drivers/net/ppp/bsd_comp.c +++ b/drivers/net/ppp/bsd_comp.c @@ -395,7 +395,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) * Allocate the main control structure for this instance. */ maxmaxcode = MAXCODE(bits); - db = kzalloc_obj(struct bsd_db, GFP_KERNEL); + db = kzalloc_obj(struct bsd_db); if (!db) { return NULL; diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c index ead937d95cd8..b4cf2d09c6bd 100644 --- a/drivers/net/ppp/ppp_async.c +++ b/drivers/net/ppp/ppp_async.c @@ -163,7 +163,7 @@ ppp_asynctty_open(struct tty_struct *tty) return -EOPNOTSUPP; err = -ENOMEM; - ap = kzalloc_obj(*ap, GFP_KERNEL); + ap = kzalloc_obj(*ap); if (!ap) goto out; diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c index 1d8370d2f098..d6d5e656b3f4 100644 --- a/drivers/net/ppp/ppp_deflate.c +++ b/drivers/net/ppp/ppp_deflate.c @@ -97,7 +97,7 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return NULL; @@ -312,7 +312,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return NULL; diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index fdf96999ba18..e9b41777be80 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -2926,7 +2926,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan) struct channel *pch; struct ppp_net *pn; - pch = kzalloc_obj(struct channel, GFP_KERNEL); + pch = kzalloc_obj(struct channel); if (!pch) return -ENOMEM; diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c index eacfe50b6955..3900279b4819 100644 --- a/drivers/net/ppp/ppp_mppe.c +++ b/drivers/net/ppp/ppp_mppe.c @@ -158,7 +158,7 @@ static void *mppe_alloc(unsigned char *options, int optlen) fips_enabled) return NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (state == NULL) return NULL; diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c index f49e60985171..c2063961f395 100644 --- a/drivers/net/ppp/ppp_synctty.c +++ b/drivers/net/ppp/ppp_synctty.c @@ -162,7 +162,7 @@ ppp_sync_open(struct tty_struct *tty) if (tty->ops->write == NULL) return -EOPNOTSUPP; - ap = kzalloc_obj(*ap, GFP_KERNEL); + ap = kzalloc_obj(*ap); err = -ENOMEM; if (!ap) goto out; diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c index ef130eb75212..e923da5c5506 100644 --- a/drivers/net/pse-pd/pd692x0.c +++ b/drivers/net/pse-pd/pd692x0.c @@ -1259,7 +1259,7 @@ static int pd692x0_setup_pi_matrix(struct pse_controller_dev *pcdev) struct pd692x0_manager *manager; int ret; - manager = kzalloc_objs(*manager, PD692X0_MAX_MANAGERS, GFP_KERNEL); + manager = kzalloc_objs(*manager, PD692X0_MAX_MANAGERS); if (!manager) return -ENOMEM; diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index ccbcda0cc4a2..3beaaaeec9e1 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -162,7 +162,7 @@ static int of_load_pse_pis(struct pse_controller_dev *pcdev) if (!np) return -ENODEV; - pcdev->pi = kzalloc_objs(*pcdev->pi, pcdev->nr_lines, GFP_KERNEL); + pcdev->pi = kzalloc_objs(*pcdev->pi, pcdev->nr_lines); if (!pcdev->pi) return -ENOMEM; @@ -1408,7 +1408,7 @@ pse_control_get_internal(struct pse_controller_dev *pcdev, unsigned int index, } } - psec = kzalloc_obj(*psec, GFP_KERNEL); + psec = kzalloc_obj(*psec); if (!psec) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 465b6cfa6253..d40cb35a2547 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -523,7 +523,7 @@ tps23881_pi_get_pw_limit_ranges(struct pse_controller_dev *pcdev, int id, { struct ethtool_c33_pse_pw_limit_range *c33_pw_limit_ranges; - c33_pw_limit_ranges = kzalloc_obj(*c33_pw_limit_ranges, GFP_KERNEL); + c33_pw_limit_ranges = kzalloc_obj(*c33_pw_limit_ranges); if (!c33_pw_limit_ranges) return -ENOMEM; diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 09fbb4ce8e38..64b5d0a8ae4a 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -603,7 +603,7 @@ static int rionet_add_dev(struct device *dev, struct subsys_interface *sif) rnet = netdev_priv(nets[netid].ndev); - peer = kzalloc_obj(*peer, GFP_KERNEL); + peer = kzalloc_obj(*peer); if (!peer) { rc = -ENOMEM; goto out; diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c index 98c4d5925694..e3c785da3eef 100644 --- a/drivers/net/slip/slhc.c +++ b/drivers/net/slip/slhc.c @@ -98,7 +98,7 @@ slhc_init(int rslots, int tslots) if (rslots < 0 || rslots > 255 || tslots < 0 || tslots > 255) return ERR_PTR(-EINVAL); - comp = kzalloc_obj(struct slcompress, GFP_KERNEL); + comp = kzalloc_obj(struct slcompress); if (! comp) goto out_fail; diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index 4019c6b4dafc..820e1a8fc956 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -1297,7 +1297,7 @@ static int __init slip_init(void) printk(KERN_INFO "SLIP linefill/keepalive option.\n"); #endif - slip_devs = kzalloc_objs(struct net_device *, slip_maxdev, GFP_KERNEL); + slip_devs = kzalloc_objs(struct net_device *, slip_maxdev); if (!slip_devs) return -ENOMEM; diff --git a/drivers/net/tap.c b/drivers/net/tap.c index aee69767342e..b8240737dc51 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -1197,7 +1197,7 @@ int tap_queue_resize(struct tap_dev *tap) int n = tap->numqueues; int ret, i = 0; - rings = kmalloc_objs(*rings, n, GFP_KERNEL); + rings = kmalloc_objs(*rings, n); if (!rings) return -ENOMEM; diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index 28c09ffd34b8..937dd6dc070b 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -157,7 +157,7 @@ static int __team_option_inst_add(struct team *team, struct team_option *option, array_size = 1; /* No array but still need one instance */ for (i = 0; i < array_size; i++) { - opt_inst = kmalloc_obj(*opt_inst, GFP_KERNEL); + opt_inst = kmalloc_obj(*opt_inst); if (!opt_inst) return -ENOMEM; opt_inst->option = option; @@ -256,7 +256,7 @@ static int __team_options_register(struct team *team, struct team_option **dst_opts; int err; - dst_opts = kzalloc_objs(struct team_option *, option_count, GFP_KERNEL); + dst_opts = kzalloc_objs(struct team_option *, option_count); if (!dst_opts) return -ENOMEM; for (i = 0; i < option_count; i++, option++) { @@ -433,7 +433,7 @@ int team_mode_register(const struct team_mode *mode) mode->priv_size > TEAM_MODE_PRIV_SIZE) return -EINVAL; - mitem = kmalloc_obj(*mitem, GFP_KERNEL); + mitem = kmalloc_obj(*mitem); if (!mitem) return -ENOMEM; @@ -779,7 +779,7 @@ static int team_queue_override_init(struct team *team) if (!queue_cnt) return 0; - listarr = kmalloc_objs(struct list_head, queue_cnt, GFP_KERNEL); + listarr = kmalloc_objs(struct list_head, queue_cnt); if (!listarr) return -ENOMEM; team->qom_lists = listarr; @@ -1015,7 +1015,7 @@ static int __team_port_enable_netpoll(struct team_port *port) struct netpoll *np; int err; - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); if (!np) return -ENOMEM; diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c index b50c479f06ce..684954c2a8de 100644 --- a/drivers/net/team/team_mode_loadbalance.c +++ b/drivers/net/team/team_mode_loadbalance.c @@ -259,7 +259,7 @@ static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len, if (data_len % sizeof(struct sock_filter)) return -EINVAL; - fprog = kmalloc_obj(*fprog, GFP_KERNEL); + fprog = kmalloc_obj(*fprog); if (!fprog) return -ENOMEM; fprog->filter = kmemdup(filter, data_len, GFP_KERNEL); @@ -594,7 +594,7 @@ static int lb_init(struct team *team) BUG_ON(!func); rcu_assign_pointer(lb_priv->select_tx_port_func, func); - lb_priv->ex = kzalloc_obj(*lb_priv->ex, GFP_KERNEL); + lb_priv->ex = kzalloc_obj(*lb_priv->ex); if (!lb_priv->ex) return -ENOMEM; lb_priv->ex->team = team; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index fcddbeb6d36a..c492fda6fc15 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2228,7 +2228,7 @@ static int __tun_set_ebpf(struct tun_struct *tun, struct tun_prog *old, *new = NULL; if (prog) { - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) return -ENOMEM; new->prog = prog; @@ -3605,7 +3605,7 @@ static int tun_queue_resize(struct tun_struct *tun) int n = tun->numqueues + tun->numdisabled; int ret, i; - rings = kmalloc_objs(*rings, n, GFP_KERNEL); + rings = kmalloc_objs(*rings, n); if (!rings) return -ENOMEM; diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 5ab60f7c90dd..cbffa9ae1bb6 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -703,7 +703,7 @@ static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - aqc111_data = kzalloc_obj(*aqc111_data, GFP_KERNEL); + aqc111_data = kzalloc_obj(*aqc111_data); if (!aqc111_data) return -ENOMEM; diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index ca8a9d04a16b..df0bcfedddbc 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -1314,7 +1314,7 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf) dev->rx_urb_size = 2048; } - dev->driver_priv = kzalloc_obj(struct asix_common_private, GFP_KERNEL); + dev->driver_priv = kzalloc_obj(struct asix_common_private); if (!dev->driver_priv) return -ENOMEM; diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 54c0ba627b50..6b14bce2a552 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -165,7 +165,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) if (ret) return ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 46e6c4dcda47..98f899ea2e94 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1287,7 +1287,7 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) if (ret < 0) return ret; - ax179_data = kzalloc_obj(*ax179_data, GFP_KERNEL); + ax179_data = kzalloc_obj(*ax179_data); if (!ax179_data) return -ENOMEM; diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 39e8063b1f5b..7057c6c0cfc6 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -827,7 +827,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ u8 iface_no; struct usb_cdc_parsed_header hdr; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c index 54199fde1c64..068acb052adb 100644 --- a/drivers/net/usb/cx82310_eth.c +++ b/drivers/net/usb/cx82310_eth.c @@ -173,7 +173,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) if (!dev->partial_data) return -ENOMEM; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto err_partial; diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1da216248896..e7f66e4f63b5 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2313,7 +2313,7 @@ static struct hso_device *hso_create_device(struct usb_interface *intf, { struct hso_device *hso_dev; - hso_dev = kzalloc_obj(*hso_dev, GFP_KERNEL); + hso_dev = kzalloc_obj(*hso_dev); if (!hso_dev) return NULL; @@ -2617,7 +2617,7 @@ static struct hso_device *hso_create_bulk_serial_device( if (!hso_dev) return NULL; - serial = kzalloc_obj(*serial, GFP_KERNEL); + serial = kzalloc_obj(*serial); if (!serial) goto exit; @@ -2626,7 +2626,7 @@ static struct hso_device *hso_create_bulk_serial_device( if ((port & HSO_PORT_MASK) == HSO_PORT_MODEM) { num_urbs = 2; - serial->tiocmget = kzalloc_obj(struct hso_tiocmget, GFP_KERNEL); + serial->tiocmget = kzalloc_obj(struct hso_tiocmget); if (!serial->tiocmget) goto exit; serial->tiocmget->serial_state_notification @@ -2710,7 +2710,7 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface, if (!hso_dev) return NULL; - serial = kzalloc_obj(*serial, GFP_KERNEL); + serial = kzalloc_obj(*serial); if (!serial) goto err_free_dev; @@ -2754,7 +2754,7 @@ static void hso_free_shared_int(struct hso_shared_int *mux) static struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) { - struct hso_shared_int *mux = kzalloc_obj(*mux, GFP_KERNEL); + struct hso_shared_int *mux = kzalloc_obj(*mux); if (!mux) return NULL; diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 92ec3e73edff..8da8e04c3109 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -682,7 +682,7 @@ static int lan78xx_read_stats(struct lan78xx_net *dev, u32 *src; u32 *dst; - stats = kmalloc_obj(*stats, GFP_KERNEL); + stats = kmalloc_obj(*stats); if (!stats) return -ENOMEM; @@ -3728,7 +3728,7 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) int ret; int i; - dev->data[0] = (unsigned long) kzalloc_obj(*pdata, GFP_KERNEL); + dev->data[0] = (unsigned long) kzalloc_obj(*pdata); pdata = (struct lan78xx_priv *)(dev->data[0]); if (!pdata) { diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c index 21f6a4795295..c4ad2d9f6f4f 100644 --- a/drivers/net/usb/lg-vl600.c +++ b/drivers/net/usb/lg-vl600.c @@ -56,7 +56,7 @@ struct vl600_state { static int vl600_bind(struct usbnet *dev, struct usb_interface *intf) { int ret; - struct vl600_state *s = kzalloc_obj(struct vl600_state, GFP_KERNEL); + struct vl600_state *s = kzalloc_obj(struct vl600_state); if (!s) return -ENOMEM; diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c224d2ee107c..4af85728ac4f 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -9647,7 +9647,7 @@ static u8 __rtl_get_hw_ver(struct usb_device *udev) int ret; int i; - tmp = kmalloc_obj(*tmp, GFP_KERNEL); + tmp = kmalloc_obj(*tmp); if (!tmp) return 0; diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 87a10f5ab557..4d3ed642b3e7 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -683,7 +683,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) return -ENODEV; } /* Initialize sierra private data */ - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index df2c4c1f8c0b..42e4048b574b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1157,7 +1157,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) return ret; } - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return -ENOMEM; diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 31ed78712e43..72d6a9c6a5a2 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3732,7 +3732,7 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) goto succ; } - mq = kzalloc_obj(*mq, GFP_KERNEL); + mq = kzalloc_obj(*mq); if (!mq) return -ENOMEM; @@ -3799,7 +3799,7 @@ static void virtnet_rx_mode_work(struct work_struct *work) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc_allmulti = kzalloc_obj(*promisc_allmulti, GFP_KERNEL); + promisc_allmulti = kzalloc_obj(*promisc_allmulti); if (!promisc_allmulti) { dev_warn(&dev->dev, "Failed to set RX mode, no memory.\n"); return; @@ -3885,7 +3885,7 @@ static int virtnet_vlan_rx_add_vid(struct net_device *dev, __virtio16 *_vid __free(kfree) = NULL; struct scatterlist sg; - _vid = kzalloc_obj(*_vid, GFP_KERNEL); + _vid = kzalloc_obj(*_vid); if (!_vid) return -ENOMEM; @@ -3905,7 +3905,7 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev, __virtio16 *_vid __free(kfree) = NULL; struct scatterlist sg; - _vid = kzalloc_obj(*_vid, GFP_KERNEL); + _vid = kzalloc_obj(*_vid); if (!_vid) return -ENOMEM; @@ -4028,7 +4028,7 @@ static int virtnet_send_ctrl_coal_vq_cmd(struct virtnet_info *vi, struct virtio_net_ctrl_coal_vq *coal_vq __free(kfree) = NULL; struct scatterlist sgs; - coal_vq = kzalloc_obj(*coal_vq, GFP_KERNEL); + coal_vq = kzalloc_obj(*coal_vq); if (!coal_vq) return -ENOMEM; @@ -4987,7 +4987,7 @@ static int virtnet_get_hw_stats(struct virtnet_info *vi, qnum += 1; } - req = kzalloc_objs(*req, qnum, GFP_KERNEL); + req = kzalloc_objs(*req, qnum); if (!req) return -ENOMEM; @@ -5127,7 +5127,7 @@ static int virtnet_send_tx_notf_coal_cmds(struct virtnet_info *vi, struct scatterlist sgs_tx; int i; - coal_tx = kzalloc_obj(*coal_tx, GFP_KERNEL); + coal_tx = kzalloc_obj(*coal_tx); if (!coal_tx) return -ENOMEM; @@ -5175,7 +5175,7 @@ static int virtnet_send_rx_notf_coal_cmds(struct virtnet_info *vi, return 0; } - coal_rx = kzalloc_obj(*coal_rx, GFP_KERNEL); + coal_rx = kzalloc_obj(*coal_rx); if (!coal_rx) return -ENOMEM; @@ -5738,7 +5738,7 @@ static int virtnet_set_guest_offloads(struct virtnet_info *vi, u64 offloads) __virtio64 *_offloads __free(kfree) = NULL; struct scatterlist sg; - _offloads = kzalloc_obj(*_offloads, GFP_KERNEL); + _offloads = kzalloc_obj(*_offloads); if (!_offloads) return -ENOMEM; @@ -5882,7 +5882,7 @@ static int virtnet_xsk_pool_enable(struct net_device *dev, size = virtqueue_get_vring_size(rq->vq); - rq->xsk_buffs = kvzalloc_objs(*rq->xsk_buffs, size, GFP_KERNEL); + rq->xsk_buffs = kvzalloc_objs(*rq->xsk_buffs, size); if (!rq->xsk_buffs) return -ENOMEM; @@ -6395,14 +6395,14 @@ static int virtnet_find_vqs(struct virtnet_info *vi) virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); /* Allocate space for find_vqs parameters */ - vqs = kzalloc_objs(*vqs, total_vqs, GFP_KERNEL); + vqs = kzalloc_objs(*vqs, total_vqs); if (!vqs) goto err_vq; - vqs_info = kzalloc_objs(*vqs_info, total_vqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, total_vqs); if (!vqs_info) goto err_vqs_info; if (!vi->big_packets || vi->mergeable_rx_bufs) { - ctx = kzalloc_objs(*ctx, total_vqs, GFP_KERNEL); + ctx = kzalloc_objs(*ctx, total_vqs); if (!ctx) goto err_ctx; } else { @@ -6460,16 +6460,16 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) int i; if (vi->has_cvq) { - vi->ctrl = kzalloc_obj(*vi->ctrl, GFP_KERNEL); + vi->ctrl = kzalloc_obj(*vi->ctrl); if (!vi->ctrl) goto err_ctrl; } else { vi->ctrl = NULL; } - vi->sq = kzalloc_objs(*vi->sq, vi->max_queue_pairs, GFP_KERNEL); + vi->sq = kzalloc_objs(*vi->sq, vi->max_queue_pairs); if (!vi->sq) goto err_sq; - vi->rq = kzalloc_objs(*vi->rq, vi->max_queue_pairs, GFP_KERNEL); + vi->rq = kzalloc_objs(*vi->rq, vi->max_queue_pairs); if (!vi->rq) goto err_rq; @@ -7016,7 +7016,7 @@ static int virtnet_probe(struct virtio_device *vdev) struct scatterlist sg; __le64 v; - stats_cap = kzalloc_obj(*stats_cap, GFP_KERNEL); + stats_cap = kzalloc_obj(*stats_cap); if (!stats_cap) { rtnl_unlock(); err = -ENOMEM; diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index c1cf3eff4c1b..05558b6afecd 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -3578,7 +3578,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, bool ipv6, ASSERT_RTNL(); - vs = kzalloc_obj(*vs, GFP_KERNEL); + vs = kzalloc_obj(*vs); if (!vs) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/vxlan/vxlan_mdb.c b/drivers/net/vxlan/vxlan_mdb.c index 8f53ae776613..055a4969f593 100644 --- a/drivers/net/vxlan/vxlan_mdb.c +++ b/drivers/net/vxlan/vxlan_mdb.c @@ -430,7 +430,7 @@ static int vxlan_mdb_config_src_entry_init(struct vxlan_mdb_config *cfg, extack)) return -EINVAL; - src = kzalloc_obj(*src, GFP_KERNEL); + src = kzalloc_obj(*src); if (!src) return -ENOMEM; @@ -697,7 +697,7 @@ static int vxlan_mdb_remote_rdst_init(const struct vxlan_mdb_config *cfg, struct vxlan_rdst *rd; int err; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; @@ -767,7 +767,7 @@ vxlan_mdb_remote_src_entry_add(struct vxlan_mdb_remote *remote, { struct vxlan_mdb_src_entry *ent; - ent = kzalloc_obj(*ent, GFP_KERNEL); + ent = kzalloc_obj(*ent); if (!ent) return NULL; @@ -1139,7 +1139,7 @@ static int vxlan_mdb_remote_add(const struct vxlan_mdb_config *cfg, return -ENOENT; } - remote = kzalloc_obj(*remote, GFP_KERNEL); + remote = kzalloc_obj(*remote); if (!remote) return -ENOMEM; @@ -1187,7 +1187,7 @@ vxlan_mdb_entry_get(struct vxlan_dev *vxlan, if (mdb_entry) return mdb_entry; - mdb_entry = kzalloc_obj(*mdb_entry, GFP_KERNEL); + mdb_entry = kzalloc_obj(*mdb_entry); if (!mdb_entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index 726a34d16fa2..2042369379ff 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -697,7 +697,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan, { struct vxlan_vni_node *vninode; - vninode = kzalloc_obj(*vninode, GFP_KERNEL); + vninode = kzalloc_obj(*vninode); if (!vninode) return NULL; vninode->stats = netdev_alloc_pcpu_stats(struct vxlan_vni_stats_pcpu); @@ -925,7 +925,7 @@ int vxlan_vnigroup_init(struct vxlan_dev *vxlan) struct vxlan_vni_group *vg; int ret; - vg = kzalloc_obj(*vg, GFP_KERNEL); + vg = kzalloc_obj(*vg); if (!vg) return -ENOMEM; ret = rhashtable_init(&vg->vni_hash, &vxlan_vni_rht_params); diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c index 82ba8dfa979b..f35a15cf5dd9 100644 --- a/drivers/net/wan/c101.c +++ b/drivers/net/wan/c101.c @@ -313,7 +313,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) return -ENODEV; } - card = kzalloc_obj(card_t, GFP_KERNEL); + card = kzalloc_obj(card_t); if (!card) return -ENOBUFS; diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 9f989b2ff558..957e0b272d54 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c @@ -2359,7 +2359,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Allocate driver private data */ - card = kzalloc_obj(struct fst_card_info, GFP_KERNEL); + card = kzalloc_obj(struct fst_card_info); if (!card) return -ENOMEM; diff --git a/drivers/net/wan/framer/framer-core.c b/drivers/net/wan/framer/framer-core.c index 66ed38e97336..d779b03a9e1b 100644 --- a/drivers/net/wan/framer/framer-core.c +++ b/drivers/net/wan/framer/framer-core.c @@ -615,7 +615,7 @@ struct framer *framer_create(struct device *dev, struct device_node *node, if (WARN_ON((ops->flags & FRAMER_FLAG_POLL_STATUS) && !ops->get_status)) return ERR_PTR(-EINVAL); - framer = kzalloc_obj(*framer, GFP_KERNEL); + framer = kzalloc_obj(*framer); if (!framer) return ERR_PTR(-ENOMEM); @@ -771,7 +771,7 @@ __framer_provider_of_register(struct device *dev, struct module *owner, { struct framer_provider *framer_provider; - framer_provider = kzalloc_obj(*framer_provider, GFP_KERNEL); + framer_provider = kzalloc_obj(*framer_provider); if (!framer_provider) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wan/framer/pef2256/pef2256.c b/drivers/net/wan/framer/pef2256/pef2256.c index f7ed6b3dd2d7..6938316bf82b 100644 --- a/drivers/net/wan/framer/pef2256/pef2256.c +++ b/drivers/net/wan/framer/pef2256/pef2256.c @@ -638,7 +638,7 @@ static int pef2256_add_audio_devices(struct pef2256 *pef2256) if (!count) return 0; - audio_devs = kzalloc_objs(*audio_devs, count, GFP_KERNEL); + audio_devs = kzalloc_objs(*audio_devs, count); if (!audio_devs) return -ENOMEM; diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 5e93e204da0c..f26233d4bcbb 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -898,7 +898,7 @@ static int uhdlc_suspend(struct device *dev) priv->gumr = ioread32be(&uf_regs->gumr); priv->guemr = ioread8(&uf_regs->guemr); - priv->ucc_pram_bak = kmalloc_obj(*priv->ucc_pram_bak, GFP_KERNEL); + priv->ucc_pram_bak = kmalloc_obj(*priv->ucc_pram_bak); if (!priv->ucc_pram_bak) return -ENOMEM; @@ -1170,7 +1170,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev) ut_info->uf_info.regs = res.start; ut_info->uf_info.irq = irq_of_parse_and_map(np, 0); - uhdlc_priv = kzalloc_obj(*uhdlc_priv, GFP_KERNEL); + uhdlc_priv = kzalloc_obj(*uhdlc_priv); if (!uhdlc_priv) return -ENOMEM; @@ -1183,7 +1183,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev) uhdlc_priv->hdlc_bus = of_property_read_bool(np, "fsl,hdlc-bus"); if (uhdlc_priv->tsa == 1) { - utdm = kzalloc_obj(*utdm, GFP_KERNEL); + utdm = kzalloc_obj(*utdm); if (!utdm) { ret = -ENOMEM; dev_err(&pdev->dev, "No mem to alloc ucc tdm data\n"); diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 1892ee67bf20..0e405fb307f9 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -340,7 +340,7 @@ static int __init n2_run(unsigned long io, unsigned long irq, return -ENODEV; } - card = kzalloc_obj(card_t, GFP_KERNEL); + card = kzalloc_obj(card_t); if (!card) return -ENOBUFS; diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index 82ae9e1db51d..7e57d289b62c 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c @@ -300,7 +300,7 @@ static int pc300_pci_init_one(struct pci_dev *pdev, return i; } - card = kzalloc_obj(card_t, GFP_KERNEL); + card = kzalloc_obj(card_t); if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index 33f562919923..89f4b4584a33 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c @@ -281,7 +281,7 @@ static int pci200_pci_init_one(struct pci_dev *pdev, return i; } - card = kzalloc_obj(card_t, GFP_KERNEL); + card = kzalloc_obj(card_t); if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c index 994b7c6f0613..9c0a09bf6c95 100644 --- a/drivers/net/wireguard/noise.c +++ b/drivers/net/wireguard/noise.c @@ -97,7 +97,7 @@ void wg_noise_handshake_clear(struct noise_handshake *handshake) static struct noise_keypair *keypair_create(struct wg_peer *peer) { - struct noise_keypair *keypair = kzalloc_obj(*keypair, GFP_KERNEL); + struct noise_keypair *keypair = kzalloc_obj(*keypair); if (unlikely(!keypair)) return NULL; diff --git a/drivers/net/wireguard/peerlookup.c b/drivers/net/wireguard/peerlookup.c index 5ae4e6c5e7c9..99651a86ac95 100644 --- a/drivers/net/wireguard/peerlookup.c +++ b/drivers/net/wireguard/peerlookup.c @@ -21,7 +21,7 @@ static struct hlist_head *pubkey_bucket(struct pubkey_hashtable *table, struct pubkey_hashtable *wg_pubkey_hashtable_alloc(void) { - struct pubkey_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL); + struct pubkey_hashtable *table = kvmalloc_obj(*table); if (!table) return NULL; @@ -82,7 +82,7 @@ static struct hlist_head *index_bucket(struct index_hashtable *table, struct index_hashtable *wg_index_hashtable_alloc(void) { - struct index_hashtable *table = kvmalloc_obj(*table, GFP_KERNEL); + struct index_hashtable *table = kvmalloc_obj(*table); if (!table) return NULL; diff --git a/drivers/net/wireguard/ratelimiter.c b/drivers/net/wireguard/ratelimiter.c index 13d532a44294..2b3867f692ab 100644 --- a/drivers/net/wireguard/ratelimiter.c +++ b/drivers/net/wireguard/ratelimiter.c @@ -176,12 +176,12 @@ int wg_ratelimiter_init(void) (1U << 14) / sizeof(struct hlist_head))); max_entries = table_size * 8; - table_v4 = kvzalloc_objs(*table_v4, table_size, GFP_KERNEL); + table_v4 = kvzalloc_objs(*table_v4, table_size); if (unlikely(!table_v4)) goto err_kmemcache; #if IS_ENABLED(CONFIG_IPV6) - table_v6 = kvzalloc_objs(*table_v6, table_size, GFP_KERNEL); + table_v6 = kvzalloc_objs(*table_v6, table_size); if (unlikely(!table_v6)) { kvfree(table_v4); goto err_kmemcache; diff --git a/drivers/net/wireguard/selftest/allowedips.c b/drivers/net/wireguard/selftest/allowedips.c index 6c7c79e39ad4..2da3008c3a01 100644 --- a/drivers/net/wireguard/selftest/allowedips.c +++ b/drivers/net/wireguard/selftest/allowedips.c @@ -181,7 +181,7 @@ static __init int horrible_allowedips_insert_v4(struct horrible_allowedips *table, struct in_addr *ip, u8 cidr, void *value) { - struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL); + struct horrible_allowedips_node *node = kzalloc_obj(*node); if (unlikely(!node)) return -ENOMEM; @@ -198,7 +198,7 @@ static __init int horrible_allowedips_insert_v6(struct horrible_allowedips *table, struct in6_addr *ip, u8 cidr, void *value) { - struct horrible_allowedips_node *node = kzalloc_obj(*node, GFP_KERNEL); + struct horrible_allowedips_node *node = kzalloc_obj(*node); if (unlikely(!node)) return -ENOMEM; @@ -266,13 +266,13 @@ static __init bool randomized_test(void) wg_allowedips_init(&t); horrible_allowedips_init(&h); - peers = kzalloc_objs(*peers, NUM_PEERS, GFP_KERNEL); + peers = kzalloc_objs(*peers, NUM_PEERS); if (unlikely(!peers)) { pr_err("allowedips random self-test malloc: FAIL\n"); goto free; } for (i = 0; i < NUM_PEERS; ++i) { - peers[i] = kzalloc_obj(*peers[i], GFP_KERNEL); + peers[i] = kzalloc_obj(*peers[i]); if (unlikely(!peers[i])) { pr_err("allowedips random self-test malloc: FAIL\n"); goto free; @@ -447,7 +447,7 @@ static __init inline struct in6_addr *ip6(u32 a, u32 b, u32 c, u32 d) static __init struct wg_peer *init_peer(void) { - struct wg_peer *peer = kzalloc_obj(*peer, GFP_KERNEL); + struct wg_peer *peer = kzalloc_obj(*peer); if (!peer) return NULL; diff --git a/drivers/net/wireguard/selftest/counter.c b/drivers/net/wireguard/selftest/counter.c index 13c5535a1fd6..8595ab697869 100644 --- a/drivers/net/wireguard/selftest/counter.c +++ b/drivers/net/wireguard/selftest/counter.c @@ -10,7 +10,7 @@ bool __init wg_packet_counter_selftest(void) unsigned int test_num = 0, i; bool success = true; - counter = kmalloc_obj(*counter, GFP_KERNEL); + counter = kmalloc_obj(*counter); if (unlikely(!counter)) { pr_err("nonce counter self-test malloc: FAIL\n"); return false; diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index f1567365ac04..66ac396858a5 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c @@ -1512,11 +1512,11 @@ static int ar5523_load_firmware(struct usb_device *dev) return -ENOENT; } - txblock = kzalloc_obj(*txblock, GFP_KERNEL); + txblock = kzalloc_obj(*txblock); if (!txblock) goto out; - rxblock = kmalloc_obj(*rxblock, GFP_KERNEL); + rxblock = kmalloc_obj(*rxblock); if (!rxblock) goto out_free_txblock; diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index bea2cd4e5ee4..25ab945fecef 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -807,7 +807,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) } htt->rx_ring.netbufs_ring = - kzalloc_objs(struct sk_buff *, htt->rx_ring.size, GFP_KERNEL); + kzalloc_objs(struct sk_buff *, htt->rx_ring.size); if (!htt->rx_ring.netbufs_ring) goto err_netbuf; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index ef595a939bde..cf7424be9f4b 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -6431,7 +6431,7 @@ static int ath10k_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) { ret = -ENOMEM; goto exit; @@ -7972,7 +7972,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) { ret = -ENOMEM; goto exit; @@ -8954,7 +8954,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw, if (arg.n_vifs == 0) goto radar; - arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs); if (!arg.vifs) goto radar; diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 62c9ef500ee7..eebd78e7ff6b 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -245,7 +245,7 @@ static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi) const u8 *temp; int ret; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -437,7 +437,7 @@ ath10k_qmi_cfg_send_sync_msg(struct ath10k *ar, int ret; u32 i; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -578,7 +578,7 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) struct qmi_txn txn; int ret; - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) return -ENOMEM; @@ -1075,7 +1075,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size) struct ath10k_qmi *qmi; int ret; - qmi = kzalloc_obj(*qmi, GFP_KERNEL); + qmi = kzalloc_obj(*qmi); if (!qmi) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index ff046cff7399..43a6b1ba8fb8 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -246,7 +246,7 @@ static int ath10k_sdio_writesb32(struct ath10k *ar, u32 addr, u32 val) __le32 *buf; int ret; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return -ENOMEM; @@ -1766,7 +1766,7 @@ static int ath10k_sdio_diag_read32(struct ath10k *ar, u32 address, __le32 *val; int ret; - val = kzalloc_obj(*val, GFP_KERNEL); + val = kzalloc_obj(*val); if (!val) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c index 59969db56048..6661fff326e0 100644 --- a/drivers/net/wireless/ath/ath10k/usb.c +++ b/drivers/net/wireless/ath/ath10k/usb.c @@ -799,7 +799,7 @@ static int ath10k_usb_alloc_pipe_resources(struct ath10k *ar, init_usb_anchor(&pipe->urb_submitted); for (i = 0; i < urb_cnt; i++) { - urb_context = kzalloc_obj(*urb_context, GFP_KERNEL); + urb_context = kzalloc_obj(*urb_context); if (!urb_context) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath10k/wow.c b/drivers/net/wireless/ath/ath10k/wow.c index 8b7f608b5265..78653f257925 100644 --- a/drivers/net/wireless/ath/ath10k/wow.c +++ b/drivers/net/wireless/ath/ath10k/wow.c @@ -301,7 +301,7 @@ static int ath10k_vif_wow_set_wakeups(struct ath10k_vif *arvif, struct wmi_pno_scan_req *pno; int ret; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; @@ -413,7 +413,7 @@ static int ath10k_vif_wow_clean_nlo(struct ath10k_vif *arvif) if (ar->nlo_enabled) { struct wmi_pno_scan_req *pno; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/cfr.c b/drivers/net/wireless/ath/ath11k/cfr.c index 61ac656ece07..a91f25fb6c6b 100644 --- a/drivers/net/wireless/ath/ath11k/cfr.c +++ b/drivers/net/wireless/ath/ath11k/cfr.c @@ -975,7 +975,7 @@ int ath11k_cfr_init(struct ath11k_base *ab) spin_lock_init(&cfr->lut_lock); num_lut_entries = min_t(u32, CFR_MAX_LUT_ENTRIES, db_cap.min_elem); - cfr->lut = kzalloc_objs(*cfr->lut, num_lut_entries, GFP_KERNEL); + cfr->lut = kzalloc_objs(*cfr->lut, num_lut_entries); if (!cfr->lut) { ret = -ENOMEM; goto err; diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c index 9b8660e56a1a..7ec8be82c1c9 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c @@ -1193,7 +1193,7 @@ static int ath11k_debugfs_dbr_dbg_init(struct ath11k *ar, int dbr_id) if (ar->debug.dbr_debug[dbr_id]) return 0; - ar->debug.dbr_debug[dbr_id] = kzalloc_obj(*dbr_debug, GFP_KERNEL); + ar->debug.dbr_debug[dbr_id] = kzalloc_obj(*dbr_debug); if (!ar->debug.dbr_debug[dbr_id]) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 7ec87ea7620f..e4ee2ba1f669 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4221,7 +4221,7 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) { ret = -ENOMEM; @@ -7876,7 +7876,7 @@ ath11k_mac_update_active_vif_chan(struct ath11k *ar, if (arg.n_vifs == 0) return; - arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs); if (!arg.vifs) return; @@ -9729,7 +9729,7 @@ static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) { ret = -ENOMEM; goto exit; @@ -9823,7 +9823,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, arvif->reinstall_group_keys = false; } - arsta->rx_stats = kzalloc_obj(*arsta->rx_stats, GFP_KERNEL); + arsta->rx_stats = kzalloc_obj(*arsta->rx_stats); if (!arsta->rx_stats) { ret = -ENOMEM; goto dec_num_station; @@ -9844,7 +9844,7 @@ static int ath11k_mac_station_add(struct ath11k *ar, sta->addr, arvif->vdev_id); if (ath11k_debugfs_is_extd_tx_stats_enabled(ar)) { - arsta->tx_stats = kzalloc_obj(*arsta->tx_stats, GFP_KERNEL); + arsta->tx_stats = kzalloc_obj(*arsta->tx_stats); if (!arsta->tx_stats) { ret = -ENOMEM; goto free_peer; @@ -10278,7 +10278,7 @@ static void ath11k_mac_setup_mac_address_list(struct ath11k *ar) return; n_addresses = ar->ab->hw_params.num_vdevs; - addresses = kzalloc_objs(*addresses, n_addresses, GFP_KERNEL); + addresses = kzalloc_objs(*addresses, n_addresses); if (!addresses) return; @@ -10310,7 +10310,7 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) else n_combos = 1; - combinations = kzalloc_objs(*combinations, n_combos, GFP_KERNEL); + combinations = kzalloc_objs(*combinations, n_combos); if (!combinations) return -ENOMEM; @@ -10319,7 +10319,7 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar) else n_limits = 2; - limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits); if (!limits) { kfree(combinations); return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c index 7cb91d23362f..f994233df2bb 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c @@ -207,7 +207,7 @@ static int ath11k_mhi_get_msi(struct ath11k_pci *ab_pci) ath11k_dbg(ab, ATH11K_DBG_PCI, "num_vectors %d base_vector %d\n", num_vectors, base_vector); - irq = kzalloc_objs(int, num_vectors, GFP_KERNEL); + irq = kzalloc_objs(int, num_vectors); if (!irq) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index ea6f560abd98..feebbc30f3df 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1799,11 +1799,11 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab) struct qmi_txn txn; int ret; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) { ret = -ENOMEM; goto resp_out; @@ -1878,7 +1878,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) int ret = 0, i; bool delayed; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -2306,7 +2306,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab, int ret = 0; u32 remaining = len; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -2705,7 +2705,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath11k/wow.c b/drivers/net/wireless/ath/ath11k/wow.c index 7b696d1dd0e8..f02edc9b8a9e 100644 --- a/drivers/net/wireless/ath/ath11k/wow.c +++ b/drivers/net/wireless/ath/ath11k/wow.c @@ -381,7 +381,7 @@ static int ath11k_vif_wow_set_wakeups(struct ath11k_vif *arvif, struct wmi_pno_scan_req *pno; int ret; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; @@ -495,7 +495,7 @@ static int ath11k_vif_wow_clean_nlo(struct ath11k_vif *arvif) if (ar->nlo_enabled) { struct wmi_pno_scan_req *pno; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index d9b41fc90dcd..4ed608ba3c30 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -1805,7 +1805,7 @@ static struct ath12k_hw_group *ath12k_core_hw_group_alloc(struct ath12k_base *ab list_for_each_entry(ag, &ath12k_hw_group_list, list) count++; - ag = kzalloc_obj(*ag, GFP_KERNEL); + ag = kzalloc_obj(*ag); if (!ag) return NULL; diff --git a/drivers/net/wireless/ath/ath12k/dp_peer.c b/drivers/net/wireless/ath/ath12k/dp_peer.c index 95b5a4af4b2e..a1100782d45e 100644 --- a/drivers/net/wireless/ath/ath12k/dp_peer.c +++ b/drivers/net/wireless/ath/ath12k/dp_peer.c @@ -233,7 +233,7 @@ static int ath12k_dp_link_peer_rhash_addr_tbl_init(struct ath12k_dp *dp) lockdep_assert_held(&dp->link_peer_rhash_tbl_lock); - rhash_addr_tbl = kzalloc_obj(*dp->rhead_peer_addr, GFP_KERNEL); + rhash_addr_tbl = kzalloc_obj(*dp->rhead_peer_addr); if (!rhash_addr_tbl) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 007c91dbb269..c6d64b467898 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3838,7 +3838,7 @@ static void ath12k_bss_assoc(struct ath12k *ar, lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc_obj(*peer_arg, GFP_KERNEL); + kzalloc_obj(*peer_arg); if (!peer_arg) return; @@ -4217,7 +4217,7 @@ static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, if (vif->type == NL80211_IFTYPE_STATION) arvif->is_sta_assoc_link = true; } else { - arvif = kzalloc_obj(*arvif, GFP_KERNEL); + arvif = kzalloc_obj(*arvif); if (!arvif) return NULL; } @@ -5603,7 +5603,7 @@ static int ath12k_mac_initiate_hw_scan(struct ieee80211_hw *hw, if (ret) goto exit; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) { ret = -ENOMEM; goto exit; @@ -5693,7 +5693,7 @@ int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, lockdep_assert_wiphy(hw->wiphy); - chan_list = kzalloc_objs(*chan_list, hw_req->req.n_channels, GFP_KERNEL); + chan_list = kzalloc_objs(*chan_list, hw_req->req.n_channels); if (!chan_list) return -ENOMEM; @@ -6123,7 +6123,7 @@ static int ath12k_mac_update_key_cache(struct ath12k_vif_cache *cache, } if (cmd == SET_KEY) { - key_conf = kzalloc_obj(*key_conf, GFP_KERNEL); + key_conf = kzalloc_obj(*key_conf); if (!key_conf) return -ENOMEM; @@ -6457,7 +6457,7 @@ static int ath12k_mac_station_assoc(struct ath12k *ar, mask = &arvif->bitrate_mask; struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc_obj(*peer_arg, GFP_KERNEL); + kzalloc_obj(*peer_arg); if (!peer_arg) return -ENOMEM; @@ -6620,7 +6620,7 @@ static void ath12k_sta_rc_update_wk(struct wiphy *wiphy, struct wiphy_work *wk) nss = min(nss, mac_nss); struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = - kzalloc_obj(*peer_arg, GFP_KERNEL); + kzalloc_obj(*peer_arg); if (!peer_arg) return; @@ -7975,7 +7975,7 @@ static struct ath12k_link_sta *ath12k_mac_alloc_assign_link_sta(struct ath12k_hw if (arsta) return NULL; - arsta = kmalloc_obj(*arsta, GFP_KERNEL); + arsta = kmalloc_obj(*arsta); if (!arsta) return NULL; @@ -11550,7 +11550,7 @@ ath12k_mac_update_active_vif_chan(struct ath12k *ar, if (arg.n_vifs == 0) return; - arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs, GFP_KERNEL); + arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs); if (!arg.vifs) return; @@ -13715,7 +13715,7 @@ int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw, scan_time_msec = hw->wiphy->max_remain_on_channel_duration * 2; struct ath12k_wmi_scan_req_arg *arg __free(kfree) = - kzalloc_obj(*arg, GFP_KERNEL); + kzalloc_obj(*arg); if (!arg) return -ENOMEM; @@ -14123,7 +14123,7 @@ ath12k_mac_setup_radio_iface_comb(struct ath12k *ar, max_interfaces = 1; } - limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits); if (!limits) return -ENOMEM; @@ -14187,7 +14187,7 @@ ath12k_mac_setup_global_iface_comb(struct ath12k_hw *ah, else n_limits = 1; - limits = kzalloc_objs(*limits, n_limits, GFP_KERNEL); + limits = kzalloc_objs(*limits, n_limits); if (!limits) return -ENOMEM; @@ -14272,20 +14272,20 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) goto out; } - combinations = kzalloc_objs(*combinations, n_combinations, GFP_KERNEL); + combinations = kzalloc_objs(*combinations, n_combinations); if (!combinations) return -ENOMEM; /* there are multiple radios */ - radio = kzalloc_objs(*radio, ah->num_radio, GFP_KERNEL); + radio = kzalloc_objs(*radio, ah->num_radio); if (!radio) { ret = -ENOMEM; goto err_free_combinations; } for_each_ar(ah, ar, i) { - comb = kzalloc_obj(*comb, GFP_KERNEL); + comb = kzalloc_obj(*comb); if (!comb) { ret = -ENOMEM; goto err_free_radios; diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/ath/ath12k/mhi.c index 8f07c00c51a2..ee87f00bc5de 100644 --- a/drivers/net/wireless/ath/ath12k/mhi.c +++ b/drivers/net/wireless/ath/ath12k/mhi.c @@ -80,7 +80,7 @@ static int ath12k_mhi_get_msi(struct ath12k_pci *ab_pci) ath12k_dbg(ab, ATH12K_DBG_PCI, "Number of assigned MSI for MHI is %d, base vector is %d\n", num_vectors, base_vector); - irq = kzalloc_objs(*irq, num_vectors, GFP_KERNEL); + irq = kzalloc_objs(*irq, num_vectors); if (!irq) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c index ad571a4cf974..2e875176baaa 100644 --- a/drivers/net/wireless/ath/ath12k/peer.c +++ b/drivers/net/wireless/ath/ath12k/peer.c @@ -413,7 +413,7 @@ int ath12k_link_sta_rhash_tbl_init(struct ath12k_base *ab) struct rhashtable *rhash_addr_tbl; int ret; - rhash_addr_tbl = kzalloc_obj(*ab->rhead_sta_addr, GFP_KERNEL); + rhash_addr_tbl = kzalloc_obj(*ab->rhead_sta_addr); if (!rhash_addr_tbl) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index 631041bf1dc1..c11b84b56f8f 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -2344,11 +2344,11 @@ static int ath12k_qmi_fw_ind_register_send(struct ath12k_base *ab) struct qmi_txn txn; int ret; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) { ret = -ENOMEM; goto resp_out; @@ -2416,7 +2416,7 @@ int ath12k_qmi_respond_fw_mem_request(struct ath12k_base *ab) int ret = 0, i; bool delayed; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -2968,7 +2968,7 @@ static int ath12k_qmi_load_file_target_mem(struct ath12k_base *ab, int ret = 0; u32 remaining = len; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -3465,7 +3465,7 @@ static int ath12k_qmi_wlanfw_wlan_cfg_send(struct ath12k_base *ab) ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp.c b/drivers/net/wireless/ath/ath12k/wifi7/dp.c index 8e0b83801346..c72f604661ce 100644 --- a/drivers/net/wireless/ath/ath12k/wifi7/dp.c +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp.c @@ -161,7 +161,7 @@ struct ath12k_dp *ath12k_wifi7_dp_device_alloc(struct ath12k_base *ab) struct ath12k_dp *dp; /* TODO: align dp later if cache alignment becomes a bottleneck */ - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); if (!dp) return NULL; diff --git a/drivers/net/wireless/ath/ath12k/wow.c b/drivers/net/wireless/ath/ath12k/wow.c index bdac483c58cf..d8789104d886 100644 --- a/drivers/net/wireless/ath/ath12k/wow.c +++ b/drivers/net/wireless/ath/ath12k/wow.c @@ -395,7 +395,7 @@ static int ath12k_wow_vif_set_wakeups(struct ath12k_link_vif *arvif, struct wmi_pno_scan_req_arg *pno; int ret; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; @@ -507,7 +507,7 @@ static int ath12k_wow_vdev_clean_nlo(struct ath12k *ar, u32 vdev_id) if (!ar->nlo_enabled) return 0; - pno = kzalloc_obj(*pno, GFP_KERNEL); + pno = kzalloc_obj(*pno); if (!pno) return -ENOMEM; @@ -748,7 +748,7 @@ static int ath12k_wow_arp_ns_offload(struct ath12k *ar, bool enable) lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); - offload = kmalloc_obj(*offload, GFP_KERNEL); + offload = kmalloc_obj(*offload); if (!offload) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 5e30316f4543..25edc35dc7b9 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c @@ -928,7 +928,7 @@ static int open_file_eeprom(struct inode *inode, struct file *file) /* Create private struct and assign to file */ - ep = kmalloc_obj(*ep, GFP_KERNEL); + ep = kmalloc_obj(*ep); if (!ep) { ret = -ENOMEM; goto freebuf; diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c index 8be852e832f3..648110cd313f 100644 --- a/drivers/net/wireless/ath/ath6kl/core.c +++ b/drivers/net/wireless/ath/ath6kl/core.c @@ -311,7 +311,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev) ar->sta_list[ctr].mgmt_psq_len = 0; INIT_LIST_HEAD(&ar->sta_list[ctr].mgmt_psq); ar->sta_list[ctr].aggr_conn = - kzalloc_obj(struct aggr_info_conn, GFP_KERNEL); + kzalloc_obj(struct aggr_info_conn); if (!ar->sta_list[ctr].aggr_conn) { ath6kl_err("Failed to allocate memory for sta aggregation information\n"); ath6kl_core_destroy(ar); diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c index 19dfeb012c04..9ece8f9983f1 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c +++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c @@ -2792,7 +2792,7 @@ static int ath6kl_htc_reset(struct htc_target *target) (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH); for (i = 0; i < NUM_CONTROL_BUFFERS; i++) { - packet = kzalloc_obj(*packet, GFP_KERNEL); + packet = kzalloc_obj(*packet); if (!packet) return -ENOMEM; @@ -2842,13 +2842,13 @@ static void *ath6kl_htc_mbox_create(struct ath6kl *ar) struct htc_target *target = NULL; int status = 0; - target = kzalloc_obj(*target, GFP_KERNEL); + target = kzalloc_obj(*target); if (!target) { ath6kl_err("unable to allocate memory\n"); return NULL; } - target->dev = kzalloc_obj(*target->dev, GFP_KERNEL); + target->dev = kzalloc_obj(*target->dev); if (!target->dev) { ath6kl_err("unable to allocate memory\n"); kfree(target); diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c index ba8a701087c3..5183e3029886 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c @@ -510,7 +510,7 @@ static struct htc_packet *build_htc_txctrl_packet(void) struct htc_packet *packet = NULL; struct sk_buff *skb; - packet = kzalloc_obj(struct htc_packet, GFP_KERNEL); + packet = kzalloc_obj(struct htc_packet); if (packet == NULL) return NULL; @@ -1409,7 +1409,7 @@ static void *ath6kl_htc_pipe_create(struct ath6kl *ar) struct htc_packet *packet; int i; - target = kzalloc_obj(struct htc_target, GFP_KERNEL); + target = kzalloc_obj(struct htc_target); if (target == NULL) { ath6kl_err("htc create unable to allocate memory\n"); status = -ENOMEM; @@ -1423,13 +1423,13 @@ static void *ath6kl_htc_pipe_create(struct ath6kl *ar) reset_endpoint_states(target); for (i = 0; i < HTC_PACKET_CONTAINER_ALLOCATION; i++) { - packet = kzalloc_obj(struct htc_packet, GFP_KERNEL); + packet = kzalloc_obj(struct htc_packet); if (packet != NULL) free_htc_packet_container(target, packet); } - target->dev = kzalloc_obj(*target->dev, GFP_KERNEL); + target->dev = kzalloc_obj(*target->dev); if (!target->dev) { ath6kl_err("unable to allocate memory\n"); status = -ENOMEM; diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index 908cb87842f7..85d6ad53cf94 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -485,7 +485,7 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr, keymgmt, ucipher, auth, apsd_info); /* send event to application */ - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return; diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index c0a895ae882f..56929e965bd6 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -1316,7 +1316,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func, func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize); - ar_sdio = kzalloc_obj(struct ath6kl_sdio, GFP_KERNEL); + ar_sdio = kzalloc_obj(struct ath6kl_sdio); if (!ar_sdio) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index 623d134c4be7..97fdac7237e2 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -1770,13 +1770,13 @@ struct aggr_info *aggr_init(struct ath6kl_vif *vif) { struct aggr_info *p_aggr = NULL; - p_aggr = kzalloc_obj(struct aggr_info, GFP_KERNEL); + p_aggr = kzalloc_obj(struct aggr_info); if (!p_aggr) { ath6kl_err("failed to alloc memory for aggr_node\n"); return NULL; } - p_aggr->aggr_conn = kzalloc_obj(struct aggr_info_conn, GFP_KERNEL); + p_aggr->aggr_conn = kzalloc_obj(struct aggr_info_conn); if (!p_aggr->aggr_conn) { ath6kl_err("failed to alloc memory for connection specific aggr info\n"); kfree(p_aggr); diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c index 9362ab82cc30..852e77e41bde 100644 --- a/drivers/net/wireless/ath/ath6kl/usb.c +++ b/drivers/net/wireless/ath/ath6kl/usb.c @@ -190,7 +190,7 @@ static int ath6kl_usb_alloc_pipe_resources(struct ath6kl_usb_pipe *pipe, init_usb_anchor(&pipe->urb_submitted); for (i = 0; i < urb_cnt; i++) { - urb_context = kzalloc_obj(struct ath6kl_urb_context, GFP_KERNEL); + urb_context = kzalloc_obj(struct ath6kl_urb_context); if (urb_context == NULL) { status = -ENOMEM; goto fail_alloc_pipe_resources; @@ -633,7 +633,7 @@ static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface) int i; /* ath6kl_usb_destroy() needs ar_usb != NULL && ar_usb->wq != NULL. */ - ar_usb = kzalloc_obj(struct ath6kl_usb, GFP_KERNEL); + ar_usb = kzalloc_obj(struct ath6kl_usb); if (ar_usb == NULL) return NULL; ar_usb->wq = alloc_workqueue("ath6kl_wq", 0, 0); diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index c043ba9a2afa..72611a2ceb9d 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -4135,7 +4135,7 @@ void *ath6kl_wmi_init(struct ath6kl *dev) { struct wmi *wmi; - wmi = kzalloc_obj(struct wmi, GFP_KERNEL); + wmi = kzalloc_obj(struct wmi); if (!wmi) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index c7e063482f55..8533b88974b2 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -107,7 +107,7 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev, if (urb == NULL) return -ENOMEM; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) { usb_free_urb(urb); return -ENOMEM; @@ -849,7 +849,7 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev) init_usb_anchor(&hif_dev->mgmt_submitted); for (i = 0; i < MAX_TX_URB_NUM; i++) { - tx_buf = kzalloc_obj(*tx_buf, GFP_KERNEL); + tx_buf = kzalloc_obj(*tx_buf); if (!tx_buf) goto err; @@ -897,7 +897,7 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) for (i = 0; i < MAX_RX_URB_NUM; i++) { - rx_buf = kzalloc_obj(*rx_buf, GFP_KERNEL); + rx_buf = kzalloc_obj(*rx_buf); if (!rx_buf) { ret = -ENOMEM; goto err_rxb; @@ -972,7 +972,7 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) for (i = 0; i < MAX_REG_IN_URB_NUM; i++) { - rx_buf = kzalloc_obj(*rx_buf, GFP_KERNEL); + rx_buf = kzalloc_obj(*rx_buf); if (!rx_buf) { ret = -ENOMEM; goto err_rxb; @@ -1376,7 +1376,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, if (id->driver_info == STORAGE_DEVICE) return send_eject_command(interface); - hif_dev = kzalloc_obj(struct hif_device_usb, GFP_KERNEL); + hif_dev = kzalloc_obj(struct hif_device_usb); if (!hif_dev) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a57b1ca76891..5270d0c0af17 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -611,7 +611,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, struct ath_common *common; int i, ret = 0, csz = 0; - ah = kzalloc_obj(struct ath_hw, GFP_KERNEL); + ah = kzalloc_obj(struct ath_hw); if (!ah) return -ENOMEM; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index 20e1f9b72b16..bed7ea2425a0 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c @@ -1193,7 +1193,7 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv) for (i = 0; i < ATH9K_HTC_RXBUF; i++) { struct ath9k_htc_rxbuf *rxbuf = - kzalloc_obj(struct ath9k_htc_rxbuf, GFP_KERNEL); + kzalloc_obj(struct ath9k_htc_rxbuf); if (rxbuf == NULL) goto err; diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index a2fe131d8c00..efd73f2ffda6 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c @@ -499,7 +499,7 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle, struct htc_endpoint *endpoint; struct htc_target *target; - target = kzalloc_obj(struct htc_target, GFP_KERNEL); + target = kzalloc_obj(struct htc_target); if (!target) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index e7bf63d257b2..a45351afcf6e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -3128,7 +3128,7 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, !AR_SREV_9300_20_OR_LATER(ah)) return NULL; - timer = kzalloc_obj(struct ath_gen_timer, GFP_KERNEL); + timer = kzalloc_obj(struct ath_gen_timer); if (timer == NULL) return NULL; diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index 2f56b9cc0ab8..284e8c13b043 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -92,7 +92,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_htc_priv *priv) { struct wmi *wmi; - wmi = kzalloc_obj(struct wmi, GFP_KERNEL); + wmi = kzalloc_obj(struct wmi); if (!wmi) return NULL; diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index 3262a279746f..af632418fa06 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c @@ -1412,7 +1412,7 @@ static int carl9170_op_ampdu_action(struct ieee80211_hw *hw, if (!sta_info->ht_sta) return -EOPNOTSUPP; - tid_info = kzalloc_obj(struct carl9170_sta_tid, GFP_KERNEL); + tid_info = kzalloc_obj(struct carl9170_sta_tid); if (!tid_info) return -ENOMEM; diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c index a798ff11183d..ce5a6a39c0ad 100644 --- a/drivers/net/wireless/ath/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c @@ -354,7 +354,7 @@ dfs_pattern_detector_init(struct ath_common *common, if (!IS_ENABLED(CONFIG_CFG80211_CERTIFICATION_ONUS)) return NULL; - dpd = kmalloc_obj(*dpd, GFP_KERNEL); + dpd = kmalloc_obj(*dpd); if (dpd == NULL) return NULL; diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index c6ec7a296240..5a0ef2295a3a 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -74,7 +74,7 @@ static int wcn36xx_dxe_allocate_ctl_block(struct wcn36xx_dxe_ch *ch) spin_lock_init(&ch->lock); for (i = 0; i < ch->desc_num; i++) { - cur_ctl = kzalloc_obj(*cur_ctl, GFP_KERNEL); + cur_ctl = kzalloc_obj(*cur_ctl); if (!cur_ctl) goto out_fail; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index f9ebe13d0245..813553edcb78 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -847,7 +847,7 @@ int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, return -EINVAL; mutex_lock(&wcn->hal_mutex); - msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body); if (!msg_body) { ret = -ENOMEM; goto out; @@ -942,7 +942,7 @@ int wcn36xx_smd_update_channel_list(struct wcn36xx *wcn, struct cfg80211_scan_re struct wcn36xx_hal_update_channel_list_req_msg *msg_body; int ret, i; - msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body); if (!msg_body) return -ENOMEM; @@ -1624,7 +1624,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct cfg80211_chan_def *chandef; int ret; - msg_body = kzalloc_obj(*msg_body, GFP_KERNEL); + msg_body = kzalloc_obj(*msg_body); if (!msg_body) return -ENOMEM; @@ -1744,7 +1744,7 @@ static int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct wcn36xx_hal_config_sta_params *sta_params; int ret; - msg = kzalloc_obj(*msg, GFP_KERNEL); + msg = kzalloc_obj(*msg); if (!msg) return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index e0f39ef9ac78..c74f5e66166d 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -691,7 +691,7 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name, return ERR_PTR(-EINVAL); } - p2p_wdev = kzalloc_obj(*p2p_wdev, GFP_KERNEL); + p2p_wdev = kzalloc_obj(*p2p_wdev); if (!p2p_wdev) return ERR_PTR(-ENOMEM); @@ -2394,7 +2394,7 @@ static int wil_cfg80211_probe_client(struct wiphy *wiphy, if (cid < 0) return -ENOLINK; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 2e5c24245e6a..1e796087435d 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -1392,7 +1392,7 @@ static int link_show(struct seq_file *s, void *data) struct station_info *sinfo; int i, rc = 0; - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/rx_reorder.c b/drivers/net/wireless/ath/wil6210/rx_reorder.c index 75bf9dbbf23a..5841098ff8f9 100644 --- a/drivers/net/wireless/ath/wil6210/rx_reorder.c +++ b/drivers/net/wireless/ath/wil6210/rx_reorder.c @@ -241,13 +241,13 @@ out: struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil, int size, u16 ssn) { - struct wil_tid_ampdu_rx *r = kzalloc_obj(*r, GFP_KERNEL); + struct wil_tid_ampdu_rx *r = kzalloc_obj(*r); if (!r) return NULL; r->reorder_buf = - kzalloc_objs(struct sk_buff *, size, GFP_KERNEL); + kzalloc_objs(struct sk_buff *, size); if (!r->reorder_buf) { kfree(r); return NULL; diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index e11f30a7bb48..e8320607603e 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -119,7 +119,7 @@ static int wil_vring_alloc(struct wil6210_priv *wil, struct wil_ring *vring) vring->swhead = 0; vring->swtail = 0; - vring->ctx = kzalloc_objs(vring->ctx[0], vring->size, GFP_KERNEL); + vring->ctx = kzalloc_objs(vring->ctx[0], vring->size); if (!vring->ctx) { vring->va = NULL; return -ENOMEM; diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c index e391951346c2..c4c6b3088a7a 100644 --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c @@ -381,7 +381,7 @@ static int wil_ring_alloc_desc_ring(struct wil6210_priv *wil, ring->swhead = 0; ring->swtail = 0; - ring->ctx = kzalloc_objs(ring->ctx[0], ring->size, GFP_KERNEL); + ring->ctx = kzalloc_objs(ring->ctx[0], ring->size); if (!ring->ctx) goto err; diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 69f9fb19f01b..05b040c684e8 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -1080,7 +1080,7 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len) goto out; } - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) { rc = -ENOMEM; goto out; diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c index 11554306a5f3..6445332801a4 100644 --- a/drivers/net/wireless/atmel/at76c50x-usb.c +++ b/drivers/net/wireless/atmel/at76c50x-usb.c @@ -378,7 +378,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size, return -EINVAL; } - dfu_stat_buf = kmalloc_obj(*dfu_stat_buf, GFP_KERNEL); + dfu_stat_buf = kmalloc_obj(*dfu_stat_buf); if (!dfu_stat_buf) { ret = -ENOMEM; goto exit; @@ -607,7 +607,7 @@ static inline int at76_get_hw_cfg_intersil(struct usb_device *udev, static int at76_get_hw_config(struct at76_priv *priv) { int ret; - union at76_hwcfg *hwcfg = kmalloc_obj(*hwcfg, GFP_KERNEL); + union at76_hwcfg *hwcfg = kmalloc_obj(*hwcfg); if (!hwcfg) return -ENOMEM; @@ -931,7 +931,7 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv) { int i; int ret; - struct mib_mac_addr *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_mac_addr *m = kmalloc_obj(*m); if (!m) return; @@ -959,7 +959,7 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv) int i; int ret; int key_len; - struct mib_mac_wep *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_mac_wep *m = kmalloc_obj(*m); if (!m) return; @@ -994,7 +994,7 @@ exit: static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) { int ret; - struct mib_mac_mgmt *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_mac_mgmt *m = kmalloc_obj(*m); if (!m) return; @@ -1030,7 +1030,7 @@ exit: static void at76_dump_mib_mac(struct at76_priv *priv) { int ret; - struct mib_mac *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_mac *m = kmalloc_obj(*m); if (!m) return; @@ -1067,7 +1067,7 @@ exit: static void at76_dump_mib_phy(struct at76_priv *priv) { int ret; - struct mib_phy *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_phy *m = kmalloc_obj(*m); if (!m) return; @@ -1100,7 +1100,7 @@ exit: static void at76_dump_mib_local(struct at76_priv *priv) { int ret; - struct mib_local *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_local *m = kmalloc_obj(*m); if (!m) return; @@ -1125,7 +1125,7 @@ exit: static void at76_dump_mib_mdomain(struct at76_priv *priv) { int ret; - struct mib_mdomain *m = kmalloc_obj(*m, GFP_KERNEL); + struct mib_mdomain *m = kmalloc_obj(*m); if (!m) return; @@ -2442,7 +2442,7 @@ static int at76_probe(struct usb_interface *interface, udev = usb_get_dev(interface_to_usbdev(interface)); - fwv = kmalloc_obj(*fwv, GFP_KERNEL); + fwv = kmalloc_obj(*fwv); if (!fwv) { ret = -ENOMEM; goto exit; diff --git a/drivers/net/wireless/broadcom/b43/bus.c b/drivers/net/wireless/broadcom/b43/bus.c index b6c8697f782b..3ed329a39daf 100644 --- a/drivers/net/wireless/broadcom/b43/bus.c +++ b/drivers/net/wireless/broadcom/b43/bus.c @@ -74,7 +74,7 @@ void b43_bus_bcma_block_write(struct b43_bus_dev *dev, const void *buffer, struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core) { - struct b43_bus_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct b43_bus_dev *dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -179,7 +179,7 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) { struct b43_bus_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; diff --git a/drivers/net/wireless/broadcom/b43/debugfs.c b/drivers/net/wireless/broadcom/b43/debugfs.c index aa6768a66b03..3d1c94d2d999 100644 --- a/drivers/net/wireless/broadcom/b43/debugfs.c +++ b/drivers/net/wireless/broadcom/b43/debugfs.c @@ -670,7 +670,7 @@ void b43_debugfs_add_device(struct b43_wldev *dev) char devdir[16]; B43_WARN_ON(!dev); - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { b43err(dev->wl, "debugfs: add device OOM\n"); return; diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/broadcom/b43/dma.c index eca39555718f..6eabe78c938a 100644 --- a/drivers/net/wireless/broadcom/b43/dma.c +++ b/drivers/net/wireless/broadcom/b43/dma.c @@ -838,7 +838,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, int i, err; dma_addr_t dma_test; - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) goto out; diff --git a/drivers/net/wireless/broadcom/b43/lo.c b/drivers/net/wireless/broadcom/b43/lo.c index 6fcd7205bda3..f86e8969673f 100644 --- a/drivers/net/wireless/broadcom/b43/lo.c +++ b/drivers/net/wireless/broadcom/b43/lo.c @@ -766,7 +766,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev, loctl.i, loctl.q); } - cal = kmalloc_obj(*cal, GFP_KERNEL); + cal = kmalloc_obj(*cal); if (!cal) { b43warn(dev->wl, "LO calib: out of memory\n"); return NULL; diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index 97e222e9e613..b0e6aeb0b872 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -2555,7 +2555,7 @@ static void b43_request_firmware(struct work_struct *work) int err; const char *errmsg; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return; ctx->dev = dev; @@ -5494,7 +5494,7 @@ static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl) struct b43_wldev *wldev; int err = -ENOMEM; - wldev = kzalloc_obj(*wldev, GFP_KERNEL); + wldev = kzalloc_obj(*wldev); if (!wldev) goto out; diff --git a/drivers/net/wireless/broadcom/b43/phy_ac.c b/drivers/net/wireless/broadcom/b43/phy_ac.c index 85af2d791d91..fe102ea3d1fa 100644 --- a/drivers/net/wireless/broadcom/b43/phy_ac.c +++ b/drivers/net/wireless/broadcom/b43/phy_ac.c @@ -17,7 +17,7 @@ static int b43_phy_ac_op_allocate(struct b43_wldev *dev) { struct b43_phy_ac *phy_ac; - phy_ac = kzalloc_obj(*phy_ac, GFP_KERNEL); + phy_ac = kzalloc_obj(*phy_ac); if (!phy_ac) return -ENOMEM; dev->phy.ac = phy_ac; diff --git a/drivers/net/wireless/broadcom/b43/phy_g.c b/drivers/net/wireless/broadcom/b43/phy_g.c index 94038d427b39..9e292a349674 100644 --- a/drivers/net/wireless/broadcom/b43/phy_g.c +++ b/drivers/net/wireless/broadcom/b43/phy_g.c @@ -2422,14 +2422,14 @@ static int b43_gphy_op_allocate(struct b43_wldev *dev) struct b43_txpower_lo_control *lo; int err; - gphy = kzalloc_obj(*gphy, GFP_KERNEL); + gphy = kzalloc_obj(*gphy); if (!gphy) { err = -ENOMEM; goto error; } dev->phy.g = gphy; - lo = kzalloc_obj(*lo, GFP_KERNEL); + lo = kzalloc_obj(*lo); if (!lo) { err = -ENOMEM; goto err_free_gphy; diff --git a/drivers/net/wireless/broadcom/b43/phy_ht.c b/drivers/net/wireless/broadcom/b43/phy_ht.c index a1a5e699caf1..fab8399c64f7 100644 --- a/drivers/net/wireless/broadcom/b43/phy_ht.c +++ b/drivers/net/wireless/broadcom/b43/phy_ht.c @@ -842,7 +842,7 @@ static int b43_phy_ht_op_allocate(struct b43_wldev *dev) { struct b43_phy_ht *phy_ht; - phy_ht = kzalloc_obj(*phy_ht, GFP_KERNEL); + phy_ht = kzalloc_obj(*phy_ht); if (!phy_ht) return -ENOMEM; dev->phy.ht = phy_ht; diff --git a/drivers/net/wireless/broadcom/b43/phy_lcn.c b/drivers/net/wireless/broadcom/b43/phy_lcn.c index 67b61a915aa2..dd726894738c 100644 --- a/drivers/net/wireless/broadcom/b43/phy_lcn.c +++ b/drivers/net/wireless/broadcom/b43/phy_lcn.c @@ -669,7 +669,7 @@ static int b43_phy_lcn_op_allocate(struct b43_wldev *dev) { struct b43_phy_lcn *phy_lcn; - phy_lcn = kzalloc_obj(*phy_lcn, GFP_KERNEL); + phy_lcn = kzalloc_obj(*phy_lcn); if (!phy_lcn) return -ENOMEM; dev->phy.lcn = phy_lcn; diff --git a/drivers/net/wireless/broadcom/b43/phy_lp.c b/drivers/net/wireless/broadcom/b43/phy_lp.c index 622d4fe3b613..8e0058072242 100644 --- a/drivers/net/wireless/broadcom/b43/phy_lp.c +++ b/drivers/net/wireless/broadcom/b43/phy_lp.c @@ -43,7 +43,7 @@ static int b43_lpphy_op_allocate(struct b43_wldev *dev) { struct b43_phy_lp *lpphy; - lpphy = kzalloc_obj(*lpphy, GFP_KERNEL); + lpphy = kzalloc_obj(*lpphy); if (!lpphy) return -ENOMEM; dev->phy.lp = lpphy; diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c index 768d9576be41..bbc30cbad0bb 100644 --- a/drivers/net/wireless/broadcom/b43/phy_n.c +++ b/drivers/net/wireless/broadcom/b43/phy_n.c @@ -1549,7 +1549,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, len = bw << 1; } - samples = kzalloc_objs(struct cordic_iq, len, GFP_KERNEL); + samples = kzalloc_objs(struct cordic_iq, len); if (!samples) { b43err(dev->wl, "allocation for samples generation failed\n"); return 0; @@ -6417,7 +6417,7 @@ static int b43_nphy_op_allocate(struct b43_wldev *dev) { struct b43_phy_n *nphy; - nphy = kzalloc_obj(*nphy, GFP_KERNEL); + nphy = kzalloc_obj(*nphy); if (!nphy) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/b43/pio.c b/drivers/net/wireless/broadcom/b43/pio.c index 135091bec6c4..8358b1d5c298 100644 --- a/drivers/net/wireless/broadcom/b43/pio.c +++ b/drivers/net/wireless/broadcom/b43/pio.c @@ -127,7 +127,7 @@ static struct b43_pio_txqueue *b43_setup_pioqueue_tx(struct b43_wldev *dev, struct b43_pio_txpacket *p; unsigned int i; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; q->dev = dev; @@ -161,7 +161,7 @@ static struct b43_pio_rxqueue *b43_setup_pioqueue_rx(struct b43_wldev *dev, { struct b43_pio_rxqueue *q; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; q->dev = dev; diff --git a/drivers/net/wireless/broadcom/b43/sdio.c b/drivers/net/wireless/broadcom/b43/sdio.c index 8d19fe48831f..dda8d894aebe 100644 --- a/drivers/net/wireless/broadcom/b43/sdio.c +++ b/drivers/net/wireless/broadcom/b43/sdio.c @@ -139,7 +139,7 @@ static int b43_sdio_probe(struct sdio_func *func, } sdio_release_host(func); - sdio = kzalloc_obj(*sdio, GFP_KERNEL); + sdio = kzalloc_obj(*sdio); if (!sdio) { error = -ENOMEM; dev_err(&func->dev, "failed to allocate ssb bus\n"); diff --git a/drivers/net/wireless/broadcom/b43legacy/debugfs.c b/drivers/net/wireless/broadcom/b43legacy/debugfs.c index ec1f67f6d328..22811359d89d 100644 --- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c +++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c @@ -358,7 +358,7 @@ void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) char devdir[16]; B43legacy_WARN_ON(!dev); - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { b43legacyerr(dev->wl, "debugfs: add device OOM\n"); return; diff --git a/drivers/net/wireless/broadcom/b43legacy/dma.c b/drivers/net/wireless/broadcom/b43legacy/dma.c index aff7e9161ffc..1608fd0a582b 100644 --- a/drivers/net/wireless/broadcom/b43legacy/dma.c +++ b/drivers/net/wireless/broadcom/b43legacy/dma.c @@ -610,7 +610,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, int nr_slots; dma_addr_t dma_test; - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) goto out; ring->type = type; diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c index 0873014a9299..aba1168ab728 100644 --- a/drivers/net/wireless/broadcom/b43legacy/main.c +++ b/drivers/net/wireless/broadcom/b43legacy/main.c @@ -3738,7 +3738,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev, struct b43legacy_wldev *wldev; int err = -ENOMEM; - wldev = kzalloc_obj(*wldev, GFP_KERNEL); + wldev = kzalloc_obj(*wldev); if (!wldev) goto out; diff --git a/drivers/net/wireless/broadcom/b43legacy/pio.c b/drivers/net/wireless/broadcom/b43legacy/pio.c index fd9b79710350..0274fe47ca7e 100644 --- a/drivers/net/wireless/broadcom/b43legacy/pio.c +++ b/drivers/net/wireless/broadcom/b43legacy/pio.c @@ -320,7 +320,7 @@ struct b43legacy_pioqueue *b43legacy_setup_pioqueue(struct b43legacy_wldev *dev, u32 value; u16 qsize; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) goto out; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index cf5cf1dce28d..28e5df04bd43 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -794,7 +794,7 @@ static int brcmf_sdiod_freezer_attach(struct brcmf_sdio_dev *sdiodev) if (!IS_ENABLED(CONFIG_PM_SLEEP)) return 0; - sdiodev->freezer = kzalloc_obj(*sdiodev->freezer, GFP_KERNEL); + sdiodev->freezer = kzalloc_obj(*sdiodev->freezer); if (!sdiodev->freezer) return -ENOMEM; atomic_set(&sdiodev->freezer->thread_count, 0); @@ -1067,10 +1067,10 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, if (func->num != 2) return -ENODEV; - bus_if = kzalloc_obj(*bus_if, GFP_KERNEL); + bus_if = kzalloc_obj(*bus_if); if (!bus_if) return -ENOMEM; - sdiodev = kzalloc_obj(*sdiodev, GFP_KERNEL); + sdiodev = kzalloc_obj(*sdiodev); if (!sdiodev) { kfree(bus_if); return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c index 5aa1dd33bf85..0ca7f8672803 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c @@ -362,7 +362,7 @@ int brcmf_btcoex_attach(struct brcmf_cfg80211_info *cfg) struct brcmf_btcoex_info *btci; brcmf_dbg(TRACE, "enter\n"); - btci = kmalloc_obj(*btci, GFP_KERNEL); + btci = kmalloc_obj(*btci); if (!btci) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index a442c74423a6..cea02b33b798 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2527,7 +2527,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, offsetof(struct brcmf_assoc_params_le, chanspec_list); if (cfg->channel) join_params_size += sizeof(u16); - ext_join_params = kzalloc_obj(*ext_join_params, GFP_KERNEL); + ext_join_params = kzalloc_obj(*ext_join_params); if (ext_join_params == NULL) { err = -ENOMEM; goto done; @@ -4330,7 +4330,7 @@ brcmf_pmksa_v3_op(struct brcmf_if *ifp, struct cfg80211_pmksa *pmksa, int length = offsetof(struct brcmf_pmk_op_v3_le, pmk); int ret; - pmk_op = kzalloc_obj(*pmk_op, GFP_KERNEL); + pmk_op = kzalloc_obj(*pmk_op); if (!pmk_op) return -ENOMEM; @@ -5588,7 +5588,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, err = -EINVAL; goto exit; } - af_params = kzalloc_obj(*af_params, GFP_KERNEL); + af_params = kzalloc_obj(*af_params); if (af_params == NULL) { bphy_err(drvr, "unable to allocate frame\n"); err = -ENOMEM; @@ -6050,7 +6050,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", sizeof(*vif)); - vif = kzalloc_obj(*vif, GFP_KERNEL); + vif = kzalloc_obj(*vif); if (!vif) return ERR_PTR(-ENOMEM); @@ -6540,7 +6540,7 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg, return -EINVAL; } - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return -ENOMEM; @@ -6828,7 +6828,7 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_info *cfg) static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_info *cfg) { - cfg->conf = kzalloc_obj(*cfg->conf, GFP_KERNEL); + cfg->conf = kzalloc_obj(*cfg->conf); if (!cfg->conf) goto init_priv_mem_out; cfg->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); @@ -7486,7 +7486,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) mchan = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN); n_combos = 1 + !!(p2p && !rsdb) + !!mbss; - combo = kzalloc_objs(*combo, n_combos, GFP_KERNEL); + combo = kzalloc_objs(*combo, n_combos); if (!combo) goto err; @@ -7503,7 +7503,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) c = 0; i = 0; n_limits = 1 + mon_flag + (p2p ? 2 : 0) + (rsdb || !p2p); - c0_limits = kzalloc_objs(*c0_limits, n_limits, GFP_KERNEL); + c0_limits = kzalloc_objs(*c0_limits, n_limits); if (!c0_limits) goto err; @@ -7542,7 +7542,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) if (p2p && !rsdb) { c++; i = 0; - p2p_limits = kzalloc_objs(*p2p_limits, 4, GFP_KERNEL); + p2p_limits = kzalloc_objs(*p2p_limits, 4); if (!p2p_limits) goto err; p2p_limits[i].max = 1; @@ -7563,7 +7563,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) c++; i = 0; n_limits = 1 + mon_flag; - mbss_limits = kzalloc_objs(*mbss_limits, n_limits, GFP_KERNEL); + mbss_limits = kzalloc_objs(*mbss_limits, n_limits); if (!mbss_limits) goto err; mbss_limits[i].max = 4; @@ -8321,7 +8321,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, return NULL; } - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) { bphy_err(drvr, "Could not allocate wiphy device\n"); return NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index a3bbbb76dd97..a790f1693b82 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -507,7 +507,7 @@ static struct brcmf_core *brcmf_chip_add_core(struct brcmf_chip_priv *ci, { struct brcmf_core_priv *core; - core = kzalloc_obj(*core, GFP_KERNEL); + core = kzalloc_obj(*core); if (!core) return ERR_PTR(-ENOMEM); @@ -1137,7 +1137,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx, u16 devid, if (err < 0) return ERR_PTR(-EINVAL); - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 99d5fd453cf1..ec170647800d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -879,7 +879,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, if (!drvr->settings->p2p_enable && is_p2pdev) { /* this is P2P_DEVICE interface */ brcmf_dbg(INFO, "allocate non-netdev interface\n"); - ifp = kzalloc_obj(*ifp, GFP_KERNEL); + ifp = kzalloc_obj(*ifp); if (!ifp) return ERR_PTR(-ENOMEM); } else { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index 7b3b0bd1acaf..9d05a0f656f4 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -765,7 +765,7 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req, if (!brcmf_fw_request_is_valid(req)) return -EINVAL; - fwctx = kzalloc_obj(*fwctx, GFP_KERNEL); + fwctx = kzalloc_obj(*fwctx); if (!fwctx) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c index 9184022600d6..df7e3bee19f2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c @@ -360,7 +360,7 @@ struct brcmf_flowring *brcmf_flowring_attach(struct device *dev, u16 nrofrings) struct brcmf_flowring *flow; u32 i; - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (flow) { flow->dev = dev; flow->nrofrings = nrofrings; @@ -369,7 +369,7 @@ struct brcmf_flowring *brcmf_flowring_attach(struct device *dev, u16 nrofrings) flow->addr_mode[i] = ADDR_INDIRECT; for (i = 0; i < ARRAY_SIZE(flow->hash); i++) flow->hash[i].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; - flow->rings = kzalloc_objs(*flow->rings, nrofrings, GFP_KERNEL); + flow->rings = kzalloc_objs(*flow->rings, nrofrings); if (!flow->rings) { kfree(flow); flow = NULL; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index b6fab5eb6002..a43f1a38b0e3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -2342,7 +2342,7 @@ struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr) int rc; u32 mode; - fws = kzalloc_obj(*fws, GFP_KERNEL); + fws = kzalloc_obj(*fws); if (!fws) { rc = -ENOMEM; goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index 7252cdb6d87a..a88abe390aee 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -299,11 +299,11 @@ brcmf_msgbuf_init_pktids(u32 nr_array_entries, struct brcmf_msgbuf_pktid *array; struct brcmf_msgbuf_pktids *pktids; - array = kzalloc_objs(*array, nr_array_entries, GFP_KERNEL); + array = kzalloc_objs(*array, nr_array_entries); if (!array) return NULL; - pktids = kzalloc_obj(*pktids, GFP_KERNEL); + pktids = kzalloc_obj(*pktids); if (!pktids) { kfree(array); return NULL; @@ -1539,7 +1539,7 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr) if_msgbuf->max_flowrings = BRCMF_FLOWRING_HASHSIZE - 1; } - msgbuf = kzalloc_obj(*msgbuf, GFP_KERNEL); + msgbuf = kzalloc_obj(*msgbuf); if (!msgbuf) goto fail; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index d15b98273cd3..beb33003fe54 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1155,7 +1155,7 @@ brcmf_pcie_alloc_dma_and_ring(struct brcmf_pciedev_info *devinfo, u32 ring_id, addr = tcm_ring_phys_addr + BRCMF_RING_LEN_ITEMS_OFFSET; brcmf_pcie_write_tcm16(devinfo, addr, ring_itemsize_array[ring_id]); - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) { dma_free_coherent(&devinfo->pdev->dev, size, dma_buf, dma_handle); @@ -1347,7 +1347,7 @@ static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo) devinfo->shared.max_flowrings = max_flowrings; devinfo->shared.max_submissionrings = max_submissionrings; devinfo->shared.max_completionrings = max_completionrings; - rings = kzalloc_objs(*ring, max_flowrings, GFP_KERNEL); + rings = kzalloc_objs(*ring, max_flowrings); if (!rings) goto fail; @@ -2457,7 +2457,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); ret = -ENOMEM; - devinfo = kzalloc_obj(*devinfo, GFP_KERNEL); + devinfo = kzalloc_obj(*devinfo); if (devinfo == NULL) return ret; @@ -2477,7 +2477,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) else devinfo->reginfo = &brcmf_reginfo_default; - pcie_bus_dev = kzalloc_obj(*pcie_bus_dev, GFP_KERNEL); + pcie_bus_dev = kzalloc_obj(*pcie_bus_dev); if (pcie_bus_dev == NULL) { ret = -ENOMEM; goto fail; @@ -2495,12 +2495,12 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (ret < 0) goto fail; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) { ret = -ENOMEM; goto fail; } - bus->msgbuf = kzalloc_obj(*bus->msgbuf, GFP_KERNEL); + bus->msgbuf = kzalloc_obj(*bus->msgbuf); if (!bus->msgbuf) { ret = -ENOMEM; kfree(bus); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c index 34179e69d77d..d9fc94076791 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c @@ -321,7 +321,7 @@ static int brcmf_pno_prep_fwconfig(struct brcmf_pno_info *pi, } *buckets = NULL; - fw_buckets = kzalloc_objs(*fw_buckets, pi->n_reqs, GFP_KERNEL); + fw_buckets = kzalloc_objs(*fw_buckets, pi->n_reqs); if (!fw_buckets) return -ENOMEM; @@ -517,7 +517,7 @@ int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg) struct brcmf_pno_info *pi; brcmf_dbg(TRACE, "enter\n"); - pi = kzalloc_obj(*pi, GFP_KERNEL); + pi = kzalloc_obj(*pi); if (!pi) return -ENOMEM; diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c index a39985e4a977..e045208e2531 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c @@ -3153,7 +3153,7 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) if (!virts) return -ENOMEM; - phys = kmalloc_objs(dma_addr_t, CB_NUMBER_OF_ELEMENTS_SMALL, GFP_KERNEL); + phys = kmalloc_objs(dma_addr_t, CB_NUMBER_OF_ELEMENTS_SMALL); if (!phys) { kfree(virts); return -ENOMEM; @@ -3722,7 +3722,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv, { struct pci_dev *dev = priv->pci_dev; - q->txb = kmalloc_objs(q->txb[0], count, GFP_KERNEL); + q->txb = kmalloc_objs(q->txb[0], count); if (!q->txb) return -ENOMEM; @@ -5200,7 +5200,7 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv) struct ipw_rx_queue *rxq; int i; - rxq = kzalloc_obj(*rxq, GFP_KERNEL); + rxq = kzalloc_obj(*rxq); if (unlikely(!rxq)) { IPW_ERROR("memory allocation failed\n"); return NULL; @@ -11118,7 +11118,7 @@ static int ipw_up(struct ipw_priv *priv) return -EIO; if (cmdlog && !priv->cmdlog) { - priv->cmdlog = kzalloc_objs(*priv->cmdlog, cmdlog, GFP_KERNEL); + priv->cmdlog = kzalloc_objs(*priv->cmdlog, cmdlog); if (priv->cmdlog == NULL) { IPW_ERROR("Error allocating %d command log entries.\n", cmdlog); diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c b/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c index e39b95f68dd4..af03114fdf6c 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_crypto.c @@ -159,7 +159,7 @@ int libipw_register_crypto_ops(const struct libipw_crypto_ops *ops) unsigned long flags; struct libipw_crypto_alg *alg; - alg = kzalloc_obj(*alg, GFP_KERNEL); + alg = kzalloc_obj(*alg); if (alg == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_wx.c b/drivers/net/wireless/intel/ipw2x00/libipw_wx.c index 3db31b740a0e..122bcbae188f 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_wx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_wx.c @@ -365,7 +365,7 @@ int libipw_wx_set_encode(struct libipw_device *ieee, struct libipw_crypt_data *new_crypt; /* take WEP into use */ - new_crypt = kzalloc_obj(struct libipw_crypt_data, GFP_KERNEL); + new_crypt = kzalloc_obj(struct libipw_crypt_data); if (new_crypt == NULL) return -ENOMEM; new_crypt->ops = libipw_get_crypto_ops("WEP"); @@ -597,7 +597,7 @@ int libipw_wx_set_encodeext(struct libipw_device *ieee, libipw_crypt_delayed_deinit(&ieee->crypt_info, crypt); - new_crypt = kzalloc_obj(*new_crypt, GFP_KERNEL); + new_crypt = kzalloc_obj(*new_crypt); if (new_crypt == NULL) { ret = -ENOMEM; goto done; diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c index c87579e4c7f9..c148654aa953 100644 --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c @@ -269,7 +269,7 @@ il3945_get_free_frame(struct il_priv *il) struct il3945_frame *frame; struct list_head *element; if (list_empty(&il->free_frames)) { - frame = kzalloc_obj(*frame, GFP_KERNEL); + frame = kzalloc_obj(*frame); if (!frame) { IL_ERR("Could not allocate frame!\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index 8429b6f5768b..7921bc45e21d 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c @@ -3027,7 +3027,7 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id) u32 rate_flags = 0; __le32 rate_n_flags; - link_cmd = kzalloc_obj(struct il_link_quality_cmd, GFP_KERNEL); + link_cmd = kzalloc_obj(struct il_link_quality_cmd); if (!link_cmd) { IL_ERR("Unable to allocate memory for LQ cmd.\n"); return NULL; @@ -3709,7 +3709,7 @@ il4965_get_free_frame(struct il_priv *il) struct il_frame *frame; struct list_head *element; if (list_empty(&il->free_frames)) { - frame = kzalloc_obj(*frame, GFP_KERNEL); + frame = kzalloc_obj(*frame); if (!frame) { IL_ERR("Could not allocate frame!\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 4a12703e9b46..c9efb948f6c7 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -907,7 +907,7 @@ il_init_channel_map(struct il_priv *il) D_EEPROM("Parsing data for %d channels.\n", il->channel_count); il->channel_info = - kzalloc_objs(struct il_channel_info, il->channel_count, GFP_KERNEL); + kzalloc_objs(struct il_channel_info, il->channel_count); if (!il->channel_info) { IL_ERR("Could not allocate channel_info\n"); il->channel_count = 0; @@ -3022,9 +3022,9 @@ il_tx_queue_init(struct il_priv *il, u32 txq_id) } txq->meta = - kzalloc_objs(struct il_cmd_meta, actual_slots, GFP_KERNEL); + kzalloc_objs(struct il_cmd_meta, actual_slots); txq->cmd = - kzalloc_objs(struct il_device_cmd *, actual_slots, GFP_KERNEL); + kzalloc_objs(struct il_device_cmd *, actual_slots); if (!txq->meta || !txq->cmd) goto out_free_arrays; @@ -3447,7 +3447,7 @@ il_init_geos(struct il_priv *il) if (!channels) return -ENOMEM; - rates = kzalloc_objs(*rates, RATE_COUNT_LEGACY, GFP_KERNEL); + rates = kzalloc_objs(*rates, RATE_COUNT_LEGACY); if (!rates) { kfree(channels); return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/devices.c b/drivers/net/wireless/intel/iwlwifi/dvm/devices.c index 5c8665b5a1b7..7f83f1bbdaad 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/devices.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/devices.c @@ -567,7 +567,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, }; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c index bc14ed3060dd..2e16799818e4 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c @@ -1056,7 +1056,7 @@ int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan) int ret, i; u16 seq; - key_data.rsc_tsc = kzalloc_obj(*key_data.rsc_tsc, GFP_KERNEL); + key_data.rsc_tsc = kzalloc_obj(*key_data.rsc_tsc); if (!key_data.rsc_tsc) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/main.c b/drivers/net/wireless/intel/iwlwifi/dvm/main.c index ec30b5f3870b..ca5a8140908a 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/main.c @@ -205,7 +205,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) /* Allocate beacon command */ if (!priv->beacon_cmd) - priv->beacon_cmd = kzalloc_obj(*tx_beacon_cmd, GFP_KERNEL); + priv->beacon_cmd = kzalloc_obj(*tx_beacon_cmd); tx_beacon_cmd = priv->beacon_cmd; if (!tx_beacon_cmd) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/sta.c b/drivers/net/wireless/intel/iwlwifi/dvm/sta.c index b29859f9d7c0..b6e3824fcda8 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/sta.c @@ -864,7 +864,7 @@ iwl_sta_alloc_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, { struct iwl_link_quality_cmd *link_cmd; - link_cmd = kzalloc_obj(struct iwl_link_quality_cmd, GFP_KERNEL); + link_cmd = kzalloc_obj(struct iwl_link_quality_cmd); if (!link_cmd) { IWL_ERR(priv, "Unable to allocate memory for LQ cmd.\n"); return NULL; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index a070593e085f..402842e0dad4 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -595,7 +595,7 @@ static struct scatterlist *alloc_sgtable(ssize_t size) nents -= n_fill; } - new = kzalloc_objs(*new, n_alloc, GFP_KERNEL); + new = kzalloc_objs(*new, n_alloc); if (!new) { if (result) _devcd_free_sgtable(result); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c index 21d889344796..ddee7c2deb36 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c @@ -360,7 +360,7 @@ static void *iwl_dbgfs_fw_info_seq_start(struct seq_file *seq, loff_t *pos) if (*pos >= fw->ucode_capa.n_cmd_versions) return NULL; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; state->pos = *pos; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c index a45c3a9c223e..afff8d51ca95 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c @@ -379,7 +379,7 @@ iwl_pnvm_load_pnvm_to_trans(struct iwl_trans *trans, return; } - pnvm_data = kzalloc_obj(*pnvm_data, GFP_KERNEL); + pnvm_data = kzalloc_obj(*pnvm_data); if (!pnvm_data) goto free; @@ -425,7 +425,7 @@ iwl_pnvm_load_reduce_power_to_trans(struct iwl_trans *trans, return; } - pnvm_data = kzalloc_obj(*pnvm_data, GFP_KERNEL); + pnvm_data = kzalloc_obj(*pnvm_data); if (!pnvm_data) goto free; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index a6733224428a..ac8b64fec96d 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -618,7 +618,7 @@ static int iwl_dbg_tlv_alloc_fragments(struct iwl_fw_runtime *fwrt, num_frags = min_t(u32, num_frags, remain_pages); frag_pages = DIV_ROUND_UP(remain_pages, num_frags); - fw_mon->frags = kzalloc_objs(*fw_mon->frags, num_frags, GFP_KERNEL); + fw_mon->frags = kzalloc_objs(*fw_mon->frags, num_frags); if (!fw_mon->frags) return -ENOMEM; @@ -1001,7 +1001,7 @@ static void iwl_dbg_tlv_set_periodic_trigs(struct iwl_fw_runtime *fwrt) collect_interval = le32_to_cpu(trig->data[0]); - timer_node = kzalloc_obj(*timer_node, GFP_KERNEL); + timer_node = kzalloc_obj(*timer_node); if (!timer_node) { IWL_ERR(fwrt, "WRT: Failed to allocate periodic trigger\n"); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c index 39e362df0233..475b3e417efa 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -1459,7 +1459,7 @@ static int iwl_alloc_ucode_mem(struct fw_img *out, struct fw_img_parsing *img) { struct fw_desc *sec; - sec = kzalloc_objs(*sec, img->sec_counter, GFP_KERNEL); + sec = kzalloc_objs(*sec, img->sec_counter); if (!sec) return -ENOMEM; @@ -1622,7 +1622,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) /* dump all fw memory areas by default */ fw->dbg.dump_mask = 0xffffffff; - pieces = kzalloc_obj(*pieces, GFP_KERNEL); + pieces = kzalloc_obj(*pieces); if (!pieces) goto out_free_fw; @@ -1915,7 +1915,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) struct iwl_drv *drv; int ret; - drv = kzalloc_obj(*drv, GFP_KERNEL); + drv = kzalloc_obj(*drv); if (!drv) { ret = -ENOMEM; goto err; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c b/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c index a5e287daf440..0a87deea3474 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c @@ -59,7 +59,7 @@ struct iwl_phy_db_chg_txp { struct iwl_phy_db *iwl_phy_db_init(struct iwl_trans *trans) { - struct iwl_phy_db *phy_db = kzalloc_obj(struct iwl_phy_db, GFP_KERNEL); + struct iwl_phy_db *phy_db = kzalloc_obj(struct iwl_phy_db); if (!phy_db) return phy_db; diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c index eebec9b8c169..89901786fd68 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c @@ -113,7 +113,7 @@ static void iwl_trans_schedule_reprobe(struct iwl_trans *trans, return; } - reprobe = kzalloc_obj(*reprobe, GFP_KERNEL); + reprobe = kzalloc_obj(*reprobe); if (!reprobe) { module_put(THIS_MODULE); return; diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c index f9358cb01103..c5ff1b1b720f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -702,7 +702,7 @@ static void iwl_mei_handle_csme_filters(struct mei_cl_device *cldev, rcu_dereference_protected(mei->filters, lockdep_is_held(&iwl_mei_mutex)); - new_filters = kzalloc_obj(*new_filters, GFP_KERNEL); + new_filters = kzalloc_obj(*new_filters); if (!new_filters) return; @@ -886,7 +886,7 @@ static void iwl_mei_handle_nvm(struct mei_cl_device *cldev, int i; kfree(mei->nvm); - mei->nvm = kzalloc_obj(*mei_nvm, GFP_KERNEL); + mei->nvm = kzalloc_obj(*mei_nvm); if (!mei->nvm) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c index e7849183dff1..5ececb849786 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c @@ -1654,7 +1654,7 @@ iwl_mld_suspend_send_security_cmds(struct iwl_mld *mld, struct iwl_mld_suspend_key_iter_data data = {}; int ret; - data.rsc = kzalloc_obj(*data.rsc, GFP_KERNEL); + data.rsc = kzalloc_obj(*data.rsc); if (!data.rsc) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/iface.c b/drivers/net/wireless/intel/iwlwifi/mld/iface.c index b418cbeb30aa..29df747c8938 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/iface.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/iface.c @@ -542,7 +542,7 @@ void iwl_mld_handle_probe_resp_data_notif(struct iwl_mld *mld, notif->noa_attr.len_low)) return; - new_data = kzalloc_obj(*new_data, GFP_KERNEL); + new_data = kzalloc_obj(*new_data); if (!new_data) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mld/link.c b/drivers/net/wireless/intel/iwlwifi/mld/link.c index 5640de4662d7..b5430e8a73d6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/link.c @@ -468,7 +468,7 @@ int iwl_mld_add_link(struct iwl_mld *mld, if (is_deflink) { link = &mld_vif->deflink; } else { - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; } diff --git a/drivers/net/wireless/intel/iwlwifi/mld/sta.c b/drivers/net/wireless/intel/iwlwifi/mld/sta.c index 0869f2ee7cee..3f0d093f2c5e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/sta.c @@ -539,7 +539,7 @@ iwl_mld_add_link_sta(struct iwl_mld *mld, struct ieee80211_link_sta *link_sta) if (link_sta == &link_sta->sta->deflink) { mld_link_sta = &mld_sta->deflink; } else { - mld_link_sta = kzalloc_obj(*mld_link_sta, GFP_KERNEL); + mld_link_sta = kzalloc_obj(*mld_link_sta); if (!mld_link_sta) return -ENOMEM; } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 8df70323d426..66f4b3c98580 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -460,7 +460,7 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, struct wowlan_key_rsc_v5_data data = {}; int i; - data.rsc = kzalloc_obj(*data.rsc, GFP_KERNEL); + data.rsc = kzalloc_obj(*data.rsc); if (!data.rsc) return -ENOMEM; @@ -483,7 +483,7 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, } else if (ver == 2 || ver == IWL_FW_CMD_VER_UNKNOWN) { struct wowlan_key_rsc_tsc_data data = {}; - data.rsc_tsc = kzalloc_obj(*data.rsc_tsc, GFP_KERNEL); + data.rsc_tsc = kzalloc_obj(*data.rsc_tsc); if (!data.rsc_tsc) return -ENOMEM; @@ -3091,7 +3091,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm) } if (resume_notif_based) { - d3_data.status = kzalloc_obj(*d3_data.status, GFP_KERNEL); + d3_data.status = kzalloc_obj(*d3_data.status); if (!d3_data.status) { IWL_ERR(mvm, "Failed to allocate wowlan status\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index 0a21670a9207..ebc569e94f55 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -1124,7 +1124,7 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm, } if (!resp) { - resp = kzalloc_obj(*resp, GFP_KERNEL); + resp = kzalloc_obj(*resp); if (!resp) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index a633f0d9c821..c523c5e82d4a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1764,7 +1764,7 @@ void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, notif->noa_attr.len_low)) return; - new_data = kzalloc_obj(*new_data, GFP_KERNEL); + new_data = kzalloc_obj(*new_data); if (!new_data) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 00ba47d5f499..896ed9823021 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -905,7 +905,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, if (!(added & BIT(i))) continue; - new_link[i] = kzalloc_obj(*new_link[i], GFP_KERNEL); + new_link[i] = kzalloc_obj(*new_link[i]); if (!new_link[i]) { err = -ENOMEM; goto free; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 8417b76e8fdb..3359e02e151f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -547,7 +547,7 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, if (rcu_access_pointer(sta->link[link_id]) == &sta->deflink) { link = &mvm_sta->deflink; } else { - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index be328607e6f8..ae177477b201 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1097,7 +1097,7 @@ static void iwl_mvm_me_conn_status(void *priv, const struct iwl_mei_conn_info *c */ prev_conn_info = rcu_dereference_protected(mvm->csme_conn_info, true); - curr_conn_info = kzalloc_obj(*curr_conn_info, GFP_KERNEL); + curr_conn_info = kzalloc_obj(*curr_conn_info); if (!curr_conn_info) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 3e39c243ddca..966558885ea6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -547,7 +547,7 @@ iwl_mvm_config_sched_scan_profiles(struct iwl_mvm *mvm, else blocklist_len = IWL_SCAN_MAX_BLACKLIST_LEN; - blocklist = kzalloc_objs(*blocklist, blocklist_len, GFP_KERNEL); + blocklist = kzalloc_objs(*blocklist, blocklist_len); if (!blocklist) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c index 65b54f1e6347..d5eb895144ef 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c @@ -99,10 +99,10 @@ int iwl_pcie_init_fw_sec(struct iwl_trans *trans, /* add 2 due to separators */ paging_cnt = iwl_pcie_get_num_sections(fw, lmac_cnt + umac_cnt + 2); - dram->fw = kzalloc_objs(*dram->fw, umac_cnt + lmac_cnt, GFP_KERNEL); + dram->fw = kzalloc_objs(*dram->fw, umac_cnt + lmac_cnt); if (!dram->fw) return -ENOMEM; - dram->paging = kzalloc_objs(*dram->paging, paging_cnt, GFP_KERNEL); + dram->paging = kzalloc_objs(*dram->paging, paging_cnt); if (!dram->paging) return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c index ec88aefb0913..4560d92d76fe 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c @@ -2748,7 +2748,7 @@ static void *iwl_dbgfs_tx_queue_seq_start(struct seq_file *seq, loff_t *pos) if (*pos >= priv->trans->mac_cfg->base->num_of_queues) return NULL; - state = kmalloc_obj(*state, GFP_KERNEL); + state = kmalloc_obj(*state); if (!state) return NULL; state->pos = *pos; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c index f2752ab4c402..bda9f807321e 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c @@ -928,7 +928,7 @@ iwl_txq_dyn_alloc_dma(struct iwl_trans *trans, int size, unsigned int timeout) if (WARN_ON(size > bc_tbl_entries)) return ERR_PTR(-EINVAL); - txq = kzalloc_obj(*txq, GFP_KERNEL); + txq = kzalloc_obj(*txq); if (!txq) return ERR_PTR(-ENOMEM); @@ -1152,7 +1152,7 @@ int iwl_txq_gen2_init(struct iwl_trans *trans, int txq_id, int queue_size) /* alloc and init the tx queue */ if (!trans_pcie->txqs.txq[txq_id]) { - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) { IWL_ERR(trans, "Not enough memory for tx queue\n"); return -ENOMEM; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c index 0b817e5c5679..0de3f5de237e 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c @@ -750,7 +750,7 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, if (cmd_queue) for (i = 0; i < slots_num; i++) { txq->entries[i].cmd = - kmalloc_obj(struct iwl_device_cmd, GFP_KERNEL); + kmalloc_obj(struct iwl_device_cmd); if (!txq->entries[i].cmd) goto error; } diff --git a/drivers/net/wireless/intersil/p54/eeprom.c b/drivers/net/wireless/intersil/p54/eeprom.c index c338a7a7fc41..1c49aad5d5f8 100644 --- a/drivers/net/wireless/intersil/p54/eeprom.c +++ b/drivers/net/wireless/intersil/p54/eeprom.c @@ -154,7 +154,7 @@ static int p54_generate_band(struct ieee80211_hw *dev, if ((!list->entries) || (!list->band_channel_num[band])) return -EINVAL; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) goto err_out; @@ -335,7 +335,7 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev) max_channel_num = max_t(unsigned int, max_channel_num, priv->curve_data->entries); - list = kzalloc_obj(*list, GFP_KERNEL); + list = kzalloc_obj(*list); if (!list) { ret = -ENOMEM; goto free; diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c index 331b0b69ce62..98517888dba7 100644 --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c @@ -2094,7 +2094,7 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev) int ret = 0; struct wireless_dev *wdev; - wdev = kzalloc_obj(struct wireless_dev, GFP_KERNEL); + wdev = kzalloc_obj(struct wireless_dev); if (!wdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/marvell/libertas/debugfs.c b/drivers/net/wireless/marvell/libertas/debugfs.c index d2dc9128dae2..9ebd69134940 100644 --- a/drivers/net/wireless/marvell/libertas/debugfs.c +++ b/drivers/net/wireless/marvell/libertas/debugfs.c @@ -232,7 +232,7 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask, if (!buf) return -ENOMEM; - subscribed = kzalloc_obj(*subscribed, GFP_KERNEL); + subscribed = kzalloc_obj(*subscribed); if (!subscribed) { ret = -ENOMEM; goto out_page; @@ -288,7 +288,7 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask, ret = -EINVAL; goto out_page; } - events = kzalloc_obj(*events, GFP_KERNEL); + events = kzalloc_obj(*events); if (!events) { ret = -ENOMEM; goto out_page; diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c index b814cf9032ad..dd6756c1242e 100644 --- a/drivers/net/wireless/marvell/libertas/if_sdio.c +++ b/drivers/net/wireless/marvell/libertas/if_sdio.c @@ -1158,7 +1158,7 @@ static int if_sdio_probe(struct sdio_func *func, return -ENODEV; } - card = kzalloc_obj(struct if_sdio_card, GFP_KERNEL); + card = kzalloc_obj(struct if_sdio_card); if (!card) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c index a21f7bba13c5..b22d1e65f552 100644 --- a/drivers/net/wireless/marvell/libertas/if_spi.c +++ b/drivers/net/wireless/marvell/libertas/if_spi.c @@ -1113,7 +1113,7 @@ static int if_spi_probe(struct spi_device *spi) } /* Allocate card structure to represent this specific device */ - card = kzalloc_obj(struct if_spi_card, GFP_KERNEL); + card = kzalloc_obj(struct if_spi_card); if (!card) { err = -ENOMEM; goto teardown; diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c index e02756d7e87a..8a6bf1365cfa 100644 --- a/drivers/net/wireless/marvell/libertas/if_usb.c +++ b/drivers/net/wireless/marvell/libertas/if_usb.c @@ -203,7 +203,7 @@ static int if_usb_probe(struct usb_interface *intf, udev = interface_to_usbdev(intf); - cardp = kzalloc_obj(struct if_usb_card, GFP_KERNEL); + cardp = kzalloc_obj(struct if_usb_card); if (!cardp) goto error; diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c index aa94b777da13..fced7485d015 100644 --- a/drivers/net/wireless/marvell/libertas/mesh.c +++ b/drivers/net/wireless/marvell/libertas/mesh.c @@ -983,7 +983,7 @@ static int lbs_add_mesh(struct lbs_private *priv) int ret = 0; /* Allocate a virtual mesh device */ - mesh_wdev = kzalloc_obj(struct wireless_dev, GFP_KERNEL); + mesh_wdev = kzalloc_obj(struct wireless_dev); if (!mesh_wdev) { lbs_deb_mesh("init mshX wireless device failed\n"); ret = -ENOMEM; diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c index 44c609205422..f49151c18b79 100644 --- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c +++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c @@ -154,7 +154,7 @@ static int if_usb_probe(struct usb_interface *intf, lbtf_deb_enter(LBTF_DEB_USB); udev = interface_to_usbdev(intf); - cardp = kzalloc_obj(struct if_usb_card, GFP_KERNEL); + cardp = kzalloc_obj(struct if_usb_card); if (!cardp) goto error; diff --git a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c index c00b385c0f58..610ec8302adf 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c @@ -344,7 +344,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, return; } /* if !tbl then create one */ - new_node = kzalloc_obj(struct mwifiex_rx_reorder_tbl, GFP_KERNEL); + new_node = kzalloc_obj(struct mwifiex_rx_reorder_tbl); if (!new_node) return; diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index f387b26b086b..63d9ccc5a81c 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -756,7 +756,7 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, return -EINVAL; } - bss_cfg = kzalloc_obj(*bss_cfg, GFP_KERNEL); + bss_cfg = kzalloc_obj(*bss_cfg); if (!bss_cfg) return -ENOMEM; @@ -2073,7 +2073,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) return -1; - bss_cfg = kzalloc_obj(struct mwifiex_uap_bss_param, GFP_KERNEL); + bss_cfg = kzalloc_obj(struct mwifiex_uap_bss_param); if (!bss_cfg) return -ENOMEM; @@ -2683,7 +2683,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, if (!mwifiex_stop_bg_scan(priv)) cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0); - user_scan_cfg = kzalloc_obj(*user_scan_cfg, GFP_KERNEL); + user_scan_cfg = kzalloc_obj(*user_scan_cfg); if (!user_scan_cfg) return -ENOMEM; @@ -2787,7 +2787,7 @@ mwifiex_cfg80211_sched_scan_start(struct wiphy *wiphy, request->n_channels, request->scan_plans->interval, (int)request->ie_len); - bgscan_cfg = kzalloc_obj(*bgscan_cfg, GFP_KERNEL); + bgscan_cfg = kzalloc_obj(*bgscan_cfg); if (!bgscan_cfg) return -ENOMEM; @@ -3452,7 +3452,7 @@ static int mwifiex_set_mef_filter(struct mwifiex_private *priv, if (wowlan->n_patterns || wowlan->magic_pkt) num_entries++; - mef_entry = kzalloc_objs(*mef_entry, num_entries, GFP_KERNEL); + mef_entry = kzalloc_objs(*mef_entry, num_entries); if (!mef_entry) return -ENOMEM; @@ -3989,7 +3989,7 @@ mwifiex_cfg80211_uap_add_station(struct mwifiex_private *priv, const u8 *mac, if (!ret) { struct station_info *sinfo; - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return -ENOMEM; @@ -4161,7 +4161,7 @@ static int mwifiex_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev, if (!tb[MWIFIEX_TM_ATTR_DATA]) return -EINVAL; - hostcmd = kzalloc_obj(*hostcmd, GFP_KERNEL); + hostcmd = kzalloc_obj(*hostcmd); if (!hostcmd) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/ie.c b/drivers/net/wireless/marvell/mwifiex/ie.c index 55af5e9b5bee..6e4074bfc0c8 100644 --- a/drivers/net/wireless/marvell/mwifiex/ie.c +++ b/drivers/net/wireless/marvell/mwifiex/ie.c @@ -149,7 +149,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv, u16 len; int ret; - ap_custom_ie = kzalloc_obj(*ap_custom_ie, GFP_KERNEL); + ap_custom_ie = kzalloc_obj(*ap_custom_ie); if (!ap_custom_ie) return -ENOMEM; @@ -221,7 +221,7 @@ static int mwifiex_update_vs_ie(const u8 *ies, int ies_len, vendor_ie = cfg80211_find_vendor_ie(oui, oui_type, ies, ies_len); if (vendor_ie) { if (!*ie_ptr) { - *ie_ptr = kzalloc_obj(struct mwifiex_ie, GFP_KERNEL); + *ie_ptr = kzalloc_obj(struct mwifiex_ie); if (!*ie_ptr) return -ENOMEM; ie = *ie_ptr; @@ -325,7 +325,7 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv, if (!info->tail || !info->tail_len) return 0; - gen_ie = kzalloc_obj(*gen_ie, GFP_KERNEL); + gen_ie = kzalloc_obj(*gen_ie); if (!gen_ie) return -ENOMEM; @@ -438,7 +438,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) int ret = 0; if (priv->gen_idx != MWIFIEX_AUTO_IDX_MASK) { - gen_ie = kmalloc_obj(*gen_ie, GFP_KERNEL); + gen_ie = kmalloc_obj(*gen_ie); if (!gen_ie) return -ENOMEM; @@ -456,7 +456,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) } if (priv->beacon_idx != MWIFIEX_AUTO_IDX_MASK) { - beacon_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); + beacon_ie = kmalloc_obj(struct mwifiex_ie); if (!beacon_ie) { ret = -ENOMEM; goto done; @@ -466,7 +466,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) beacon_ie->ie_length = 0; } if (priv->proberesp_idx != MWIFIEX_AUTO_IDX_MASK) { - pr_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); + pr_ie = kmalloc_obj(struct mwifiex_ie); if (!pr_ie) { ret = -ENOMEM; goto done; @@ -476,7 +476,7 @@ int mwifiex_del_mgmt_ies(struct mwifiex_private *priv) pr_ie->ie_length = 0; } if (priv->assocresp_idx != MWIFIEX_AUTO_IDX_MASK) { - ar_ie = kmalloc_obj(struct mwifiex_ie, GFP_KERNEL); + ar_ie = kmalloc_obj(struct mwifiex_ie); if (!ar_ie) { ret = -ENOMEM; goto done; diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 28ffcc780eab..5c9a46e64d23 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -25,7 +25,7 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) struct mwifiex_bss_prio_node *bss_prio; struct mwifiex_bss_prio_tbl *tbl = adapter->bss_prio_tbl; - bss_prio = kzalloc_obj(struct mwifiex_bss_prio_node, GFP_KERNEL); + bss_prio = kzalloc_obj(struct mwifiex_bss_prio_node); if (!bss_prio) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index d4c62fad8099..a8eab6b1e63b 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -60,7 +60,7 @@ static int mwifiex_register(void *card, struct device *dev, struct mwifiex_adapter *adapter; int i; - adapter = kzalloc_obj(struct mwifiex_adapter, GFP_KERNEL); + adapter = kzalloc_obj(struct mwifiex_adapter); if (!adapter) return -ENOMEM; @@ -82,7 +82,7 @@ static int mwifiex_register(void *card, struct device *dev, for (i = 0; i < MWIFIEX_MAX_BSS_NUM; i++) { /* Allocate memory for private structure */ adapter->priv[i] = - kzalloc_obj(struct mwifiex_private, GFP_KERNEL); + kzalloc_obj(struct mwifiex_private); if (!adapter->priv[i]) goto error; @@ -1180,7 +1180,7 @@ void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter) p += adapter->if_ops.reg_dump(adapter, p); } p += sprintf(p, "\n=== more debug information\n"); - debug_info = kzalloc_obj(*debug_info, GFP_KERNEL); + debug_info = kzalloc_obj(*debug_info); if (debug_info) { for (i = 0; i < adapter->priv_num; i++) { if (!adapter->priv[i]->netdev) @@ -1346,7 +1346,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv, if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA || GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) { - priv->hist_data = kmalloc_obj(*priv->hist_data, GFP_KERNEL); + priv->hist_data = kmalloc_obj(*priv->hist_data); if (priv->hist_data) mwifiex_hist_data_reset(priv); } diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c index b4858c0002e0..ae9a63d8128d 100644 --- a/drivers/net/wireless/marvell/mwifiex/scan.c +++ b/drivers/net/wireless/marvell/mwifiex/scan.c @@ -1649,7 +1649,7 @@ static int mwifiex_save_hidden_ssid_channels(struct mwifiex_private *priv, int chid; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc_obj(*bss_desc, GFP_KERNEL); + bss_desc = kzalloc_obj(*bss_desc); if (!bss_desc) return -ENOMEM; @@ -1692,7 +1692,7 @@ static int mwifiex_update_curr_bss_params(struct mwifiex_private *priv, int ret; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor, GFP_KERNEL); + bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor); if (!bss_desc) return -ENOMEM; @@ -1931,7 +1931,7 @@ mwifiex_active_scan_req_for_passive_chan(struct mwifiex_private *priv) mwifiex_dbg(adapter, INFO, "No BSS with hidden SSID found on DFS channels\n"); return 0; } - user_scan_cfg = kzalloc_obj(*user_scan_cfg, GFP_KERNEL); + user_scan_cfg = kzalloc_obj(*user_scan_cfg); if (!user_scan_cfg) return -ENOMEM; @@ -2450,7 +2450,7 @@ int mwifiex_stop_bg_scan(struct mwifiex_private *priv) return 0; } - bgscan_cfg = kzalloc_obj(*bgscan_cfg, GFP_KERNEL); + bgscan_cfg = kzalloc_obj(*bgscan_cfg); if (!bgscan_cfg) return -ENOMEM; @@ -2777,7 +2777,7 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv, return -EBUSY; } - scan_cfg = kzalloc_obj(struct mwifiex_user_scan_cfg, GFP_KERNEL); + scan_cfg = kzalloc_obj(struct mwifiex_user_scan_cfg); if (!scan_cfg) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c index b457ed6f18f5..70ce31d7c76e 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -1516,7 +1516,7 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data, struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_ds_misc_cmd *hostcmd __free(kfree) = NULL; - hostcmd = kzalloc_obj(*hostcmd, GFP_KERNEL); + hostcmd = kzalloc_obj(*hostcmd); if (!hostcmd) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index 46476cb752dd..a6550548d3b4 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -330,7 +330,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, return -EINVAL; /* Allocate and fill new bss descriptor */ - bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor, GFP_KERNEL); + bss_desc = kzalloc_obj(struct mwifiex_bssdescriptor); if (!bss_desc) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwifiex/uap_event.c b/drivers/net/wireless/marvell/mwifiex/uap_event.c index 9abd011aa295..703104fd1fbe 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_event.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_event.c @@ -105,7 +105,7 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv) switch (eventcause) { case EVENT_UAP_STA_ASSOC: - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return -ENOMEM; diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c index c505c83f8abc..99321d180f34 100644 --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c @@ -1182,7 +1182,7 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index) return -ENOMEM; } - rxq->buf = kzalloc_objs(*rxq->buf, MWL8K_RX_DESCS, GFP_KERNEL); + rxq->buf = kzalloc_objs(*rxq->buf, MWL8K_RX_DESCS); if (rxq->buf == NULL) { dma_free_coherent(&priv->pdev->dev, size, rxq->rxd, rxq->rxd_dma); @@ -1478,7 +1478,7 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index) return -ENOMEM; } - txq->skb = kzalloc_objs(*txq->skb, MWL8K_TX_DESCS, GFP_KERNEL); + txq->skb = kzalloc_objs(*txq->skb, MWL8K_TX_DESCS); if (txq->skb == NULL) { dma_free_coherent(&priv->pdev->dev, size, txq->txd, txq->txd_dma); @@ -2472,7 +2472,7 @@ static int mwl8k_cmd_get_hw_spec_sta(struct ieee80211_hw *hw) int rc; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2537,7 +2537,7 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw) int rc, i; u32 api_version; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2639,7 +2639,7 @@ static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw) int rc; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2753,7 +2753,7 @@ static int mwl8k_cmd_get_stat(struct ieee80211_hw *hw, struct mwl8k_cmd_get_stat *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2796,7 +2796,7 @@ mwl8k_cmd_radio_control(struct ieee80211_hw *hw, bool enable, bool force) if (enable == priv->radio_on && !force) return 0; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2854,7 +2854,7 @@ static int mwl8k_cmd_rf_tx_power(struct ieee80211_hw *hw, int dBm) struct mwl8k_cmd_rf_tx_power *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2895,7 +2895,7 @@ static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw, int rc; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -2948,7 +2948,7 @@ mwl8k_cmd_rf_antenna(struct ieee80211_hw *hw, int antenna, int mask) struct mwl8k_cmd_rf_antenna *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3066,7 +3066,7 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw) struct mwl8k_cmd_set_pre_scan *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3099,7 +3099,7 @@ mwl8k_cmd_bbp_reg_access(struct ieee80211_hw *hw, struct mwl8k_cmd_bbp_reg_access *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3135,7 +3135,7 @@ mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, const __u8 *mac) struct mwl8k_cmd_set_post_scan *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3228,7 +3228,7 @@ static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw, struct mwl8k_priv *priv = hw->priv; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3314,7 +3314,7 @@ mwl8k_cmd_set_aid(struct ieee80211_hw *hw, u16 prot_mode; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3368,7 +3368,7 @@ mwl8k_cmd_set_rate(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct mwl8k_cmd_set_rate *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3402,7 +3402,7 @@ static int mwl8k_cmd_finalize_join(struct ieee80211_hw *hw, void *frame, int payload_len; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3440,7 +3440,7 @@ mwl8k_cmd_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, struct mwl8k_cmd_set_rts_threshold *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3469,7 +3469,7 @@ static int mwl8k_cmd_set_slot(struct ieee80211_hw *hw, bool short_slot_time) struct mwl8k_cmd_set_slot *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3543,7 +3543,7 @@ mwl8k_cmd_set_edca_params(struct ieee80211_hw *hw, __u8 qnum, struct mwl8k_cmd_set_edca_params *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3583,7 +3583,7 @@ static int mwl8k_cmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable) struct mwl8k_cmd_set_wmm_mode *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3615,7 +3615,7 @@ static int mwl8k_cmd_mimo_config(struct ieee80211_hw *hw, __u8 rx, __u8 tx) struct mwl8k_cmd_mimo_config *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3658,7 +3658,7 @@ static int mwl8k_cmd_use_fixed_rate_sta(struct ieee80211_hw *hw) struct mwl8k_cmd_use_fixed_rate_sta *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3698,7 +3698,7 @@ mwl8k_cmd_use_fixed_rate_ap(struct ieee80211_hw *hw, int mcast, int mgmt) struct mwl8k_cmd_use_fixed_rate_ap *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3727,7 +3727,7 @@ static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable) struct mwl8k_cmd_enable_sniffer *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3782,7 +3782,7 @@ static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw, mac_type = MWL8K_MAC_TYPE_SECONDARY_AP; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3837,7 +3837,7 @@ static int mwl8k_cmd_set_rateadapt_mode(struct ieee80211_hw *hw, __u16 mode) struct mwl8k_cmd_set_rate_adapt_mode *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3865,7 +3865,7 @@ static int mwl8k_cmd_get_watchdog_bitmap(struct ieee80211_hw *hw, u8 *bitmap) struct mwl8k_cmd_get_watchdog_bitmap *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -3954,7 +3954,7 @@ static int mwl8k_cmd_bss_start(struct ieee80211_hw *hw, if (!enable && !(priv->running_bsses & (1 << mwl8k_vif->macid))) return 0; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4046,7 +4046,7 @@ mwl8k_check_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream, struct mwl8k_cmd_bastream *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4078,7 +4078,7 @@ mwl8k_create_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream, struct mwl8k_cmd_bastream *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4121,7 +4121,7 @@ static void mwl8k_destroy_ba(struct ieee80211_hw *hw, { struct mwl8k_cmd_bastream *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return; @@ -4173,7 +4173,7 @@ static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw, u32 rates; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4211,7 +4211,7 @@ static int mwl8k_cmd_set_new_stn_add_self(struct ieee80211_hw *hw, struct mwl8k_cmd_set_new_stn *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4254,7 +4254,7 @@ static int mwl8k_cmd_set_new_stn_del(struct ieee80211_hw *hw, spin_unlock(&priv->stream_lock); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4341,7 +4341,7 @@ static int mwl8k_cmd_update_encryption_enable(struct ieee80211_hw *hw, struct mwl8k_cmd_update_encryption *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4410,7 +4410,7 @@ static int mwl8k_cmd_encryption_set_key(struct ieee80211_hw *hw, u8 idx; struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4467,7 +4467,7 @@ static int mwl8k_cmd_encryption_remove_key(struct ieee80211_hw *hw, int rc; struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4604,7 +4604,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw, u32 rates; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; @@ -4643,7 +4643,7 @@ static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw, struct mwl8k_cmd_update_stadb *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (cmd == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index fee1f5ae0496..f16135f0b7f9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -966,7 +966,7 @@ mt7996_mac_sta_init_link(struct mt7996_dev *dev, mtxq->wcid = idx; } } else { - msta_link = kzalloc_obj(*msta_link, GFP_KERNEL); + msta_link = kzalloc_obj(*msta_link); if (!msta_link) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index edd4e570fe9f..0abf519243f5 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1178,7 +1178,7 @@ static int mgmt_tx(struct wiphy *wiphy, if (!ieee80211_is_mgmt(mgmt->frame_control)) goto out; - mgmt_tx = kmalloc_obj(*mgmt_tx, GFP_KERNEL); + mgmt_tx = kmalloc_obj(*mgmt_tx); if (!mgmt_tx) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index bbd1794acb27..f354b11cb919 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -387,7 +387,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, u64 ies_tsf; int ret; - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) return NULL; @@ -1039,7 +1039,7 @@ int wilc_set_external_auth_param(struct wilc_vif *vif, wid.id = WID_EXTERNAL_AUTH_PARAM; wid.type = WID_BIN_DATA; wid.size = sizeof(*param); - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) return -EINVAL; @@ -1516,7 +1516,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) struct host_if_drv *hif_drv; struct wilc_vif *vif = netdev_priv(dev); - hif_drv = kzalloc_obj(*hif_drv, GFP_KERNEL); + hif_drv = kzalloc_obj(*hif_drv); if (!hif_drv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index 64b1490b793d..67dea1360f0a 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -145,7 +145,7 @@ static int wilc_sdio_probe(struct sdio_func *func, int ret; - sdio_priv = kzalloc_obj(*sdio_priv, GFP_KERNEL); + sdio_priv = kzalloc_obj(*sdio_priv); if (!sdio_priv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index cad1fcf2e14f..e40b829f719d 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -211,7 +211,7 @@ static int wilc_bus_probe(struct spi_device *spi) struct wilc *wilc; int ret; - spi_priv = kzalloc_obj(*spi_priv, GFP_KERNEL); + spi_priv = kzalloc_obj(*spi_priv); if (!spi_priv) return -ENOMEM; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 15a2221892cd..3fa8592eb250 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1209,7 +1209,7 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) offset += size; wilc->rx_buffer_offset = offset; - rqe = kmalloc_obj(*rqe, GFP_KERNEL); + rqe = kmalloc_obj(*rqe); if (!rqe) return; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c index 0163f0b17497..7664403c8d50 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan_cfg.c @@ -390,7 +390,7 @@ int wilc_wlan_cfg_init(struct wilc *wl) if (!wl->cfg.s) goto out_w; - str_vals = kzalloc_obj(*str_vals, GFP_KERNEL); + str_vals = kzalloc_obj(*str_vals); if (!str_vals) goto out_s; diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c index 09303aa6c1d7..5724ec173e64 100644 --- a/drivers/net/wireless/purelifi/plfxlc/usb.c +++ b/drivers/net/wireless/purelifi/plfxlc/usb.c @@ -204,7 +204,7 @@ static int __lf_x_usb_enable_rx(struct plfxlc_usb *usb) int i, r; r = -ENOMEM; - urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT, GFP_KERNEL); + urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT); if (!urbs) goto error; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index b1908fa90cfa..db2e2bbab1b1 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -981,7 +981,7 @@ qtnf_parse_wowlan_info(struct qtnf_wmac *mac, const struct qlink_wowlan_support *data1; struct wiphy_wowlan_support *supp; - supp = kzalloc_obj(*supp, GFP_KERNEL); + supp = kzalloc_obj(*supp); if (!supp) return; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 4cab8dee332b..0c106709ae29 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -212,7 +212,7 @@ static int qtnf_mac_init_single_band(struct wiphy *wiphy, { int ret; - wiphy->bands[band] = kzalloc_obj(*wiphy->bands[band], GFP_KERNEL); + wiphy->bands[band] = kzalloc_obj(*wiphy->bands[band]); if (!wiphy->bands[band]) return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index c16cd1e5286a..2551d74ed56e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -41,7 +41,7 @@ qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif, return -EPROTO; } - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (!sinfo) return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/util.c b/drivers/net/wireless/quantenna/qtnfmac/util.c index 5c1a5a8f87a6..4ad66cc1804d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/util.c +++ b/drivers/net/wireless/quantenna/qtnfmac/util.c @@ -59,7 +59,7 @@ struct qtnf_sta_node *qtnf_sta_list_add(struct qtnf_vif *vif, if (node) goto done; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (unlikely(!node)) goto done; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c index f2b55db0b27b..cac191304bf5 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c @@ -1589,7 +1589,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c index a6b26c5ef4cf..fc35b60e422c 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c @@ -1907,7 +1907,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c index 50f1eeddf913..58728df6666c 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c @@ -1720,7 +1720,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index 6041f029857b..bf2c30d0f5ff 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -11907,7 +11907,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information and survey arrays */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c index d1d94b0b0f31..15de3db12429 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -179,7 +179,7 @@ static int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) u32 fw_mode; int ret; - reg = kmalloc_obj(*reg, GFP_KERNEL); + reg = kmalloc_obj(*reg); if (reg == NULL) return -ENOMEM; /* cannot use rt2x00usb_register_read here as it uses different diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c index edececd89572..e0bca06c7094 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c @@ -639,7 +639,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) struct dentry *queue_folder; struct dentry *register_folder; - intf = kzalloc_obj(struct rt2x00debug_intf, GFP_KERNEL); + intf = kzalloc_obj(struct rt2x00debug_intf); if (!intf) { rt2x00_err(rt2x00dev, "Failed to allocate debug handler\n"); return; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index dee01472747f..82fb230a73bb 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1020,11 +1020,11 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, if (spec->supported_rates & SUPPORT_RATE_OFDM) num_rates += 8; - channels = kzalloc_objs(*channels, spec->num_channels, GFP_KERNEL); + channels = kzalloc_objs(*channels, spec->num_channels); if (!channels) return -ENOMEM; - rates = kzalloc_objs(*rates, num_rates, GFP_KERNEL); + rates = kzalloc_objs(*rates, num_rates); if (!rates) goto exit_free_channels; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c index 8fb336834ced..4b842497653c 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c @@ -1244,7 +1244,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) */ rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim; - queue = kzalloc_objs(*queue, rt2x00dev->data_queues, GFP_KERNEL); + queue = kzalloc_objs(*queue, rt2x00dev->data_queues); if (!queue) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c index aea74b6b28e4..79e1fd0a1fbd 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c @@ -2712,7 +2712,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/ralink/rt2x00/rt73usb.c b/drivers/net/wireless/ralink/rt2x00/rt73usb.c index c47f4689ffdd..d6b7174d087a 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt73usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt73usb.c @@ -2136,7 +2136,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) /* * Create channel information array */ - info = kzalloc_objs(*info, spec->num_channels, GFP_KERNEL); + info = kzalloc_objs(*info, spec->num_channels); if (!info) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c index 7a2a31af9a79..f7e0f6573180 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c @@ -1463,7 +1463,7 @@ static int rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); /* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf = kmalloc_obj(*priv->io_dmabuf, GFP_KERNEL); + priv->io_dmabuf = kmalloc_obj(*priv->io_dmabuf); if (!priv->io_dmabuf) { err = -ENOMEM; goto err_free_dev; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c index 721c95f13ec9..794187d28caa 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c @@ -7381,7 +7381,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) } for (i = 0; i < RTL8XXXU_TX_URBS; i++) { - tx_urb = kmalloc_obj(struct rtl8xxxu_tx_urb, GFP_KERNEL); + tx_urb = kmalloc_obj(struct rtl8xxxu_tx_urb); if (!tx_urb) { if (!i) ret = -ENOMEM; @@ -7402,7 +7402,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) spin_unlock_irqrestore(&priv->rx_urb_lock, flags); for (i = 0; i < RTL8XXXU_RX_URBS; i++) { - rx_urb = kmalloc_obj(struct rtl8xxxu_rx_urb, GFP_KERNEL); + rx_urb = kmalloc_obj(struct rtl8xxxu_rx_urb); if (!rx_urb) { if (!i) ret = -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c index 332f90e4d83f..bcd8bc270180 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c @@ -132,10 +132,10 @@ static void rtl_btc_alloc_variable(struct rtl_priv *rtlpriv, bool wifi_only) { if (wifi_only) rtlpriv->btcoexist.wifi_only_context = - kzalloc_obj(struct wifi_only_cfg, GFP_KERNEL); + kzalloc_obj(struct wifi_only_cfg); else rtlpriv->btcoexist.btc_context = - kzalloc_obj(struct btc_coexist, GFP_KERNEL); + kzalloc_obj(struct btc_coexist); } static void rtl_btc_free_variable(struct rtl_priv *rtlpriv) diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index a3e5b0963cb7..48207052e3f8 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -1331,7 +1331,7 @@ static struct rtw_rsvd_page *rtw_alloc_rsvd_page(struct rtw_dev *rtwdev, { struct rtw_rsvd_page *rsvd_pkt = NULL; - rsvd_pkt = kzalloc_obj(*rsvd_pkt, GFP_KERNEL); + rsvd_pkt = kzalloc_obj(*rsvd_pkt); if (!rsvd_pkt) return NULL; diff --git a/drivers/net/wireless/realtek/rtw89/cam.c b/drivers/net/wireless/realtek/rtw89/cam.c index 949f304216e2..7c62ece137d0 100644 --- a/drivers/net/wireless/realtek/rtw89/cam.c +++ b/drivers/net/wireless/realtek/rtw89/cam.c @@ -420,7 +420,7 @@ static int rtw89_cam_sec_key_install(struct rtw89_dev *rtwdev, return ret; } - sec_cam = kzalloc_obj(*sec_cam, GFP_KERNEL); + sec_cam = kzalloc_obj(*sec_cam); if (!sec_cam) { ret = -ENOMEM; goto err_release_cam; diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 3295f76a0f1c..36e988277b2b 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -4220,7 +4220,7 @@ int rtw89_core_send_nullfunc(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rt if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc) return 0; - wait = kzalloc_obj(*wait, GFP_KERNEL); + wait = kzalloc_obj(*wait); if (!wait) return -ENOMEM; @@ -5657,7 +5657,7 @@ rtw89_wait_for_cond_prep(struct rtw89_wait_info *wait, unsigned int cond) if (cur != RTW89_WAIT_COND_IDLE) return ERR_PTR(-EPERM); - prep = kzalloc_obj(*prep, GFP_KERNEL); + prep = kzalloc_obj(*prep); if (!prep) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index fb89660ba70c..012ead92f5f2 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3524,7 +3524,7 @@ rtw89_debug_priv_early_h2c_set(struct rtw89_dev *rtwdev, goto out; } - early_h2c = kmalloc_obj(*early_h2c, GFP_KERNEL); + early_h2c = kmalloc_obj(*early_h2c); if (!early_h2c) { kfree(h2c); return -EFAULT; diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 97c58a2fa399..c52f9e11a8b2 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -1099,12 +1099,12 @@ int rtw89_build_phy_tbl_from_elm(struct rtw89_dev *rtwdev, else if (*pp) return 1; /* ignore if an element is existing */ - tbl = kzalloc_obj(*tbl, GFP_KERNEL); + tbl = kzalloc_obj(*tbl); if (!tbl) return -ENOMEM; n_regs = le32_to_cpu(elm->size) / sizeof(tbl->regs[0]); - regs = kzalloc_objs(*regs, n_regs, GFP_KERNEL); + regs = kzalloc_objs(*regs, n_regs); if (!regs) goto out; @@ -1141,7 +1141,7 @@ int rtw89_fw_recognize_txpwr_from_elm(struct rtw89_dev *rtwdev, struct rtw89_txpwr_conf *conf; if (!rtwdev->rfe_data) { - rtwdev->rfe_data = kzalloc_obj(*rtwdev->rfe_data, GFP_KERNEL); + rtwdev->rfe_data = kzalloc_obj(*rtwdev->rfe_data); if (!rtwdev->rfe_data) return -ENOMEM; } @@ -1201,7 +1201,7 @@ int rtw89_build_txpwr_trk_tbl_from_elm(struct rtw89_dev *rtwdev, return -ENOENT; } - elm_info->txpwr_trk = kzalloc_obj(*elm_info->txpwr_trk, GFP_KERNEL); + elm_info->txpwr_trk = kzalloc_obj(*elm_info->txpwr_trk); if (!elm_info->txpwr_trk) return -ENOMEM; @@ -1250,7 +1250,7 @@ int rtw89_build_rfk_log_fmt_from_elm(struct rtw89_dev *rtwdev, if (elm_info->rfk_log_fmt) goto allocated; - elm_info->rfk_log_fmt = kzalloc_obj(*elm_info->rfk_log_fmt, GFP_KERNEL); + elm_info->rfk_log_fmt = kzalloc_obj(*elm_info->rfk_log_fmt); if (!elm_info->rfk_log_fmt) return 1; /* this is an optional element, so just ignore this */ @@ -2944,7 +2944,7 @@ static int rtw89_fw_h2c_add_general_pkt(struct rtw89_dev *rtwdev, struct sk_buff *skb; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -8138,7 +8138,7 @@ static int rtw89_append_probe_req_ie(struct rtw89_dev *rtwdev, skb_put_data(new, ies->ies[band], ies->len[band]); skb_put_data(new, ies->common_ies, ies->common_ie_len); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { ret = -ENOMEM; kfree_skb(new); @@ -8234,7 +8234,7 @@ static int rtw89_update_6ghz_rnr_chan_ax(struct rtw89_dev *rtwdev, hdr = (struct ieee80211_hdr *)skb->data; ether_addr_copy(hdr->addr3, params->bssid); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { ret = -ENOMEM; kfree_skb(skb); @@ -8527,7 +8527,7 @@ int rtw89_pno_scan_add_chan_list_ax(struct rtw89_dev *rtwdev, idx < nd_config->n_channels && list_len < RTW89_SCAN_LIST_LIMIT_AX; idx++, list_len++) { channel = nd_config->channels[idx]; - ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8567,7 +8567,7 @@ static int rtw89_hw_scan_add_op_types_ax(struct rtw89_dev *rtwdev, { struct rtw89_mac_chinfo_ax *tmp; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; @@ -8613,7 +8613,7 @@ int rtw89_hw_scan_prep_chan_list_ax(struct rtw89_dev *rtwdev, for (idx = 0; idx < req->n_channels; idx++) { channel = req->channels[idx]; - ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8745,7 +8745,7 @@ int rtw89_pno_scan_add_chan_list_be(struct rtw89_dev *rtwdev, idx < nd_config->n_channels && list_len < RTW89_SCAN_LIST_LIMIT_BE; idx++, list_len++) { channel = nd_config->channels[idx]; - ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info); if (!ch_info) { ret = -ENOMEM; goto out; @@ -8807,7 +8807,7 @@ int rtw89_hw_scan_prep_chan_list_be(struct rtw89_dev *rtwdev, !cfg80211_channel_is_psc(channel) && chan_by_rnr) continue; - ch_info = kzalloc_obj(*ch_info, GFP_KERNEL); + ch_info = kzalloc_obj(*ch_info); if (!ch_info) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c index 594af3b7201b..0ea33743853e 100644 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c @@ -1666,7 +1666,7 @@ int rtw89_ops_change_vif_links(struct ieee80211_hw *hw, return -EOPNOTSUPP; if (removing_links) { - snap = kzalloc_obj(*snap, GFP_KERNEL); + snap = kzalloc_obj(*snap); if (!snap) return -ENOMEM; diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index eb2e2191408a..ee6ab2136b9a 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -1975,7 +1975,7 @@ void rtw89_phy_init_rf_reg(struct rtw89_dev *rtwdev, bool noio) struct rtw89_fw_h2c_rf_reg_info *rf_reg_info; u8 path; - rf_reg_info = kzalloc_obj(*rf_reg_info, GFP_KERNEL); + rf_reg_info = kzalloc_obj(*rf_reg_info); if (!rf_reg_info) return; diff --git a/drivers/net/wireless/realtek/rtw89/sar.c b/drivers/net/wireless/realtek/rtw89/sar.c index 994ebbd8d267..7886ffaf5695 100644 --- a/drivers/net/wireless/realtek/rtw89/sar.c +++ b/drivers/net/wireless/realtek/rtw89/sar.c @@ -501,7 +501,7 @@ static void rtw89_set_sar_from_acpi(struct rtw89_dev *rtwdev) struct rtw89_sar_cfg_acpi *cfg; int ret; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return; diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c index 6954ca8f0b35..368e08826f1e 100644 --- a/drivers/net/wireless/realtek/rtw89/wow.c +++ b/drivers/net/wireless/realtek/rtw89/wow.c @@ -1490,7 +1490,7 @@ static int rtw89_pno_scan_update_probe_req(struct rtw89_dev *rtwdev, skb_put_data(skb, basic_rate_ie, sizeof(basic_rate_ie)); skb_put_data(skb, nd_config->ie, nd_config->ie_len); - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { kfree_skb(skb); rtw89_fw_release_pno_pkt_list(rtwdev, rtwvif_link); diff --git a/drivers/net/wireless/rsi/rsi_91x_coex.c b/drivers/net/wireless/rsi/rsi_91x_coex.c index 5bc8c30f2721..ee603a5173fb 100644 --- a/drivers/net/wireless/rsi/rsi_91x_coex.c +++ b/drivers/net/wireless/rsi/rsi_91x_coex.c @@ -140,7 +140,7 @@ int rsi_coex_attach(struct rsi_common *common) struct rsi_coex_ctrl_block *coex_cb; int cnt; - coex_cb = kzalloc_obj(*coex_cb, GFP_KERNEL); + coex_cb = kzalloc_obj(*coex_cb); if (!coex_cb) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c index ea1766b967ee..34836a200620 100644 --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c @@ -285,7 +285,7 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) int ii; const struct rsi_dbg_files *files; - dev_dbgfs = kzalloc_obj(*dev_dbgfs, GFP_KERNEL); + dev_dbgfs = kzalloc_obj(*dev_dbgfs); if (!dev_dbgfs) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c index 9e65db2f6460..a0c36144eb0b 100644 --- a/drivers/net/wireless/rsi/rsi_91x_hal.c +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c @@ -647,7 +647,7 @@ static int bl_write_header(struct rsi_hw *adapter, u8 *flash_content, u32 write_addr, write_len; int status; - bl_hdr = kzalloc_obj(*bl_hdr, GFP_KERNEL); + bl_hdr = kzalloc_obj(*bl_hdr); if (!bl_hdr) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c index c936e40ac871..662e42d1e5e8 100644 --- a/drivers/net/wireless/rsi/rsi_91x_main.c +++ b/drivers/net/wireless/rsi/rsi_91x_main.c @@ -304,11 +304,11 @@ struct rsi_hw *rsi_91x_init(u16 oper_mode) struct rsi_common *common = NULL; u8 ii = 0; - adapter = kzalloc_obj(*adapter, GFP_KERNEL); + adapter = kzalloc_obj(*adapter); if (!adapter) return NULL; - adapter->priv = kzalloc_obj(*common, GFP_KERNEL); + adapter->priv = kzalloc_obj(*common); if (adapter->priv == NULL) { rsi_dbg(ERR_ZONE, "%s: Failed in allocation of memory\n", __func__); diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 51932a434d89..bfa386b820d8 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@ -828,7 +828,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter, struct rsi_91x_sdiodev *rsi_91x_dev; int status; - rsi_91x_dev = kzalloc_obj(*rsi_91x_dev, GFP_KERNEL); + rsi_91x_dev = kzalloc_obj(*rsi_91x_dev); if (!rsi_91x_dev) return -ENOMEM; diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index b0238103c13b..d83204701e27 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -620,7 +620,7 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter, struct rsi_91x_usbdev *rsi_dev; int status; - rsi_dev = kzalloc_obj(*rsi_dev, GFP_KERNEL); + rsi_dev = kzalloc_obj(*rsi_dev); if (!rsi_dev) return -ENOMEM; diff --git a/drivers/net/wireless/silabs/wfx/debug.c b/drivers/net/wireless/silabs/wfx/debug.c index 6475a4a42afc..454ec59fdc50 100644 --- a/drivers/net/wireless/silabs/wfx/debug.c +++ b/drivers/net/wireless/silabs/wfx/debug.c @@ -291,7 +291,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf, static int wfx_send_hif_msg_open(struct inode *inode, struct file *file) { - struct dbgfs_hif_msg *context = kzalloc_obj(*context, GFP_KERNEL); + struct dbgfs_hif_msg *context = kzalloc_obj(*context); if (!context) return -ENOMEM; diff --git a/drivers/net/wireless/st/cw1200/cw1200_sdio.c b/drivers/net/wireless/st/cw1200/cw1200_sdio.c index b503112d3a3e..2b6afe221268 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_sdio.c +++ b/drivers/net/wireless/st/cw1200/cw1200_sdio.c @@ -287,7 +287,7 @@ static int cw1200_sdio_probe(struct sdio_func *func, if (func->num != 0x01) return -ENODEV; - self = kzalloc_obj(*self, GFP_KERNEL); + self = kzalloc_obj(*self); if (!self) { pr_err("Can't allocate SDIO hwbus_priv.\n"); return -ENOMEM; diff --git a/drivers/net/wireless/st/cw1200/pm.c b/drivers/net/wireless/st/cw1200/pm.c index ed2650b2a40b..120f0379f81d 100644 --- a/drivers/net/wireless/st/cw1200/pm.c +++ b/drivers/net/wireless/st/cw1200/pm.c @@ -207,7 +207,7 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) wsm_set_ether_type_filter(priv, &cw1200_ether_type_filter_on.hdr); /* Allocate state */ - state = kzalloc_obj(struct cw1200_suspend_state, GFP_KERNEL); + state = kzalloc_obj(struct cw1200_suspend_state); if (!state) goto revert3; diff --git a/drivers/net/wireless/st/cw1200/queue.c b/drivers/net/wireless/st/cw1200/queue.c index 717da9c2cad9..dc557ed80910 100644 --- a/drivers/net/wireless/st/cw1200/queue.c +++ b/drivers/net/wireless/st/cw1200/queue.c @@ -153,7 +153,7 @@ int cw1200_queue_stats_init(struct cw1200_queue_stats *stats, spin_lock_init(&stats->lock); init_waitqueue_head(&stats->wait_link_id_empty); - stats->link_map_cache = kzalloc_objs(int, map_capacity, GFP_KERNEL); + stats->link_map_cache = kzalloc_objs(int, map_capacity); if (!stats->link_map_cache) return -ENOMEM; diff --git a/drivers/net/wireless/st/cw1200/wsm.c b/drivers/net/wireless/st/cw1200/wsm.c index 0b669b2f3ef4..d6529e5b73b2 100644 --- a/drivers/net/wireless/st/cw1200/wsm.c +++ b/drivers/net/wireless/st/cw1200/wsm.c @@ -922,7 +922,7 @@ static int wsm_event_indication(struct cw1200_common *priv, struct wsm_buf *buf) return 0; } - event = kzalloc_obj(struct cw1200_wsm_event, GFP_KERNEL); + event = kzalloc_obj(struct cw1200_wsm_event); if (!event) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index b53ac17172c4..bff73be2e6e8 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c @@ -18,7 +18,7 @@ int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod, wl1251_debug(DEBUG_ACX, "acx frame rates"); - rates = kzalloc_obj(*rates, GFP_KERNEL); + rates = kzalloc_obj(*rates); if (!rates) return -ENOMEM; @@ -47,7 +47,7 @@ int wl1251_acx_station_id(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx dot11_station_id"); - mac = kzalloc_obj(*mac, GFP_KERNEL); + mac = kzalloc_obj(*mac); if (!mac) return -ENOMEM; @@ -67,7 +67,7 @@ int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id) wl1251_debug(DEBUG_ACX, "acx dot11_default_key (%d)", key_id); - default_key = kzalloc_obj(*default_key, GFP_KERNEL); + default_key = kzalloc_obj(*default_key); if (!default_key) return -ENOMEM; @@ -95,7 +95,7 @@ int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event, wl1251_debug(DEBUG_ACX, "acx wake up conditions"); - wake_up = kzalloc_obj(*wake_up, GFP_KERNEL); + wake_up = kzalloc_obj(*wake_up); if (!wake_up) return -ENOMEM; @@ -121,7 +121,7 @@ int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth) wl1251_debug(DEBUG_ACX, "acx sleep auth"); - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) return -ENOMEM; @@ -140,7 +140,7 @@ int wl1251_acx_fw_version(struct wl1251 *wl, char *buf, size_t len) wl1251_debug(DEBUG_ACX, "acx fw rev"); - rev = kzalloc_obj(*rev, GFP_KERNEL); + rev = kzalloc_obj(*rev); if (!rev) return -ENOMEM; @@ -167,7 +167,7 @@ int wl1251_acx_tx_power(struct wl1251 *wl, int power) if (power < 0 || power > 25) return -EINVAL; - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -191,7 +191,7 @@ int wl1251_acx_feature_cfg(struct wl1251 *wl, u32 data_flow_options) wl1251_debug(DEBUG_ACX, "acx feature cfg"); - feature = kzalloc_obj(*feature, GFP_KERNEL); + feature = kzalloc_obj(*feature); if (!feature) return -ENOMEM; @@ -233,7 +233,7 @@ int wl1251_acx_data_path_params(struct wl1251 *wl, wl1251_debug(DEBUG_ACX, "acx data path params"); - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -279,7 +279,7 @@ int wl1251_acx_rx_msdu_life_time(struct wl1251 *wl, u32 life_time) wl1251_debug(DEBUG_ACX, "acx rx msdu life time"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -303,7 +303,7 @@ int wl1251_acx_rx_config(struct wl1251 *wl, u32 config, u32 filter) wl1251_debug(DEBUG_ACX, "acx rx config"); - rx_config = kzalloc_obj(*rx_config, GFP_KERNEL); + rx_config = kzalloc_obj(*rx_config); if (!rx_config) return -ENOMEM; @@ -329,7 +329,7 @@ int wl1251_acx_pd_threshold(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx data pd threshold"); - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return -ENOMEM; @@ -353,7 +353,7 @@ int wl1251_acx_slot(struct wl1251 *wl, enum acx_slot_type slot_time) wl1251_debug(DEBUG_ACX, "acx slot"); - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) return -ENOMEM; @@ -379,7 +379,7 @@ int wl1251_acx_group_address_tbl(struct wl1251 *wl, bool enable, wl1251_debug(DEBUG_ACX, "acx group address tbl"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -405,7 +405,7 @@ int wl1251_acx_service_period_timeout(struct wl1251 *wl) struct acx_rx_timeout *rx_timeout; int ret; - rx_timeout = kzalloc_obj(*rx_timeout, GFP_KERNEL); + rx_timeout = kzalloc_obj(*rx_timeout); if (!rx_timeout) return -ENOMEM; @@ -434,7 +434,7 @@ int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold) wl1251_debug(DEBUG_ACX, "acx rts threshold"); - rts = kzalloc_obj(*rts, GFP_KERNEL); + rts = kzalloc_obj(*rts); if (!rts) return -ENOMEM; @@ -458,7 +458,7 @@ int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter) wl1251_debug(DEBUG_ACX, "acx beacon filter opt"); - beacon_filter = kzalloc_obj(*beacon_filter, GFP_KERNEL); + beacon_filter = kzalloc_obj(*beacon_filter); if (!beacon_filter) return -ENOMEM; @@ -485,7 +485,7 @@ int wl1251_acx_beacon_filter_table(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx beacon filter table"); - ie_table = kzalloc_obj(*ie_table, GFP_KERNEL); + ie_table = kzalloc_obj(*ie_table); if (!ie_table) return -ENOMEM; @@ -513,7 +513,7 @@ int wl1251_acx_conn_monit_params(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx connection monitor parameters"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -540,7 +540,7 @@ int wl1251_acx_sg_enable(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx sg enable"); - pta = kzalloc_obj(*pta, GFP_KERNEL); + pta = kzalloc_obj(*pta); if (!pta) return -ENOMEM; @@ -564,7 +564,7 @@ int wl1251_acx_sg_cfg(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx sg cfg"); - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) return -ENOMEM; @@ -616,7 +616,7 @@ int wl1251_acx_cca_threshold(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx cca threshold"); - detection = kzalloc_obj(*detection, GFP_KERNEL); + detection = kzalloc_obj(*detection); if (!detection) return -ENOMEM; @@ -639,7 +639,7 @@ int wl1251_acx_bcn_dtim_options(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx bcn dtim options"); - bb = kzalloc_obj(*bb, GFP_KERNEL); + bb = kzalloc_obj(*bb); if (!bb) return -ENOMEM; @@ -666,7 +666,7 @@ int wl1251_acx_aid(struct wl1251 *wl, u16 aid) wl1251_debug(DEBUG_ACX, "acx aid"); - acx_aid = kzalloc_obj(*acx_aid, GFP_KERNEL); + acx_aid = kzalloc_obj(*acx_aid); if (!acx_aid) return -ENOMEM; @@ -690,7 +690,7 @@ int wl1251_acx_event_mbox_mask(struct wl1251 *wl, u32 event_mask) wl1251_debug(DEBUG_ACX, "acx event mbox mask"); - mask = kzalloc_obj(*mask, GFP_KERNEL); + mask = kzalloc_obj(*mask); if (!mask) return -ENOMEM; @@ -719,7 +719,7 @@ int wl1251_acx_low_rssi(struct wl1251 *wl, s8 threshold, u8 weight, wl1251_debug(DEBUG_ACX, "acx low rssi"); - rssi = kzalloc_obj(*rssi, GFP_KERNEL); + rssi = kzalloc_obj(*rssi); if (!rssi) return -ENOMEM; @@ -743,7 +743,7 @@ int wl1251_acx_set_preamble(struct wl1251 *wl, enum acx_preamble_type preamble) wl1251_debug(DEBUG_ACX, "acx_set_preamble"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -768,7 +768,7 @@ int wl1251_acx_cts_protect(struct wl1251 *wl, wl1251_debug(DEBUG_ACX, "acx_set_ctsprotect"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -790,7 +790,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime) struct acx_tsf_info *tsf_info; int ret; - tsf_info = kzalloc_obj(*tsf_info, GFP_KERNEL); + tsf_info = kzalloc_obj(*tsf_info); if (!tsf_info) return -ENOMEM; @@ -832,7 +832,7 @@ int wl1251_acx_mem_cfg(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx mem cfg"); - mem_conf = kzalloc_obj(*mem_conf, GFP_KERNEL); + mem_conf = kzalloc_obj(*mem_conf); if (!mem_conf) return -ENOMEM; @@ -877,7 +877,7 @@ int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim) wl1251_debug(DEBUG_ACX, "acx tbtt and dtim"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -904,7 +904,7 @@ int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode, wl1251_debug(DEBUG_ACX, "acx bet enable"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -929,7 +929,7 @@ int wl1251_acx_arp_ip_filter(struct wl1251 *wl, bool enable, __be32 address) wl1251_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -957,7 +957,7 @@ int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max, wl1251_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " "aifs %d txop %d", ac, cw_min, cw_max, aifs, txop); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -990,7 +990,7 @@ int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue, "ps_scheme %d ack_policy %d", queue, type, tsid, ps_scheme, ack_policy); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c index 19eb8806651f..a726a809b54a 100644 --- a/drivers/net/wireless/ti/wl1251/cmd.c +++ b/drivers/net/wireless/ti/wl1251/cmd.c @@ -133,7 +133,7 @@ int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity, wl1251_debug(DEBUG_CMD, "cmd vbm"); - vbm = kzalloc_obj(*vbm, GFP_KERNEL); + vbm = kzalloc_obj(*vbm); if (!vbm) return -ENOMEM; @@ -169,7 +169,7 @@ int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable) wl1251_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -203,7 +203,7 @@ int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable) wl1251_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -233,7 +233,7 @@ int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel, int ret, i; u8 *bssid; - join = kzalloc_obj(*join, GFP_KERNEL); + join = kzalloc_obj(*join); if (!join) return -ENOMEM; @@ -276,7 +276,7 @@ int wl1251_cmd_ps_mode(struct wl1251 *wl, u8 ps_mode) wl1251_debug(DEBUG_CMD, "cmd set ps mode"); - ps_params = kzalloc_obj(*ps_params, GFP_KERNEL); + ps_params = kzalloc_obj(*ps_params); if (!ps_params) return -ENOMEM; @@ -342,7 +342,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -409,7 +409,7 @@ int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout) wl1251_debug(DEBUG_CMD, "cmd trigger scan to"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/debugfs.c b/drivers/net/wireless/ti/wl1251/debugfs.c index a68d57555318..60ab923b75db 100644 --- a/drivers/net/wireless/ti/wl1251/debugfs.c +++ b/drivers/net/wireless/ti/wl1251/debugfs.c @@ -444,7 +444,7 @@ void wl1251_debugfs_reset(struct wl1251 *wl) int wl1251_debugfs_init(struct wl1251 *wl) { - wl->stats.fw_stats = kzalloc_obj(*wl->stats.fw_stats, GFP_KERNEL); + wl->stats.fw_stats = kzalloc_obj(*wl->stats.fw_stats); if (!wl->stats.fw_stats) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/event.c b/drivers/net/wireless/ti/wl1251/event.c index 6135d7c6d109..7575590446a3 100644 --- a/drivers/net/wireless/ti/wl1251/event.c +++ b/drivers/net/wireless/ti/wl1251/event.c @@ -208,7 +208,7 @@ int wl1251_event_handle(struct wl1251 *wl, u8 mbox_num) if (mbox_num > 1) return -EINVAL; - mbox = kmalloc_obj(*mbox, GFP_KERNEL); + mbox = kmalloc_obj(*mbox); if (!mbox) { wl1251_error("can not allocate mbox buffer"); return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl1251/init.c b/drivers/net/wireless/ti/wl1251/init.c index 0d7f08f0a41a..9134418ca3f2 100644 --- a/drivers/net/wireless/ti/wl1251/init.c +++ b/drivers/net/wireless/ti/wl1251/init.c @@ -194,7 +194,7 @@ int wl1251_hw_init_mem_config(struct wl1251 *wl) if (ret < 0) return ret; - wl->target_mem_map = kzalloc_obj(struct wl1251_acx_mem_map, GFP_KERNEL); + wl->target_mem_map = kzalloc_obj(struct wl1251_acx_mem_map); if (!wl->target_mem_map) { wl1251_error("couldn't allocate target memory map"); return -ENOMEM; @@ -260,7 +260,7 @@ static int wl1251_hw_init_tx_queue_config(struct wl1251 *wl) wl1251_debug(DEBUG_ACX, "acx tx queue config"); - config = kzalloc_obj(*config, GFP_KERNEL); + config = kzalloc_obj(*config); if (!config) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl1251/io.c b/drivers/net/wireless/ti/wl1251/io.c index 84d497ebc7f2..6660b77f4ebb 100644 --- a/drivers/net/wireless/ti/wl1251/io.c +++ b/drivers/net/wireless/ti/wl1251/io.c @@ -123,7 +123,7 @@ void wl1251_set_partition(struct wl1251 *wl, { struct wl1251_partition_set *partition; - partition = kmalloc_obj(*partition, GFP_KERNEL); + partition = kmalloc_obj(*partition); if (!partition) { wl1251_error("can not allocate partition buffer"); return; diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c index 0a5ec19f8abc..0f3f22e729ce 100644 --- a/drivers/net/wireless/ti/wl1251/main.c +++ b/drivers/net/wireless/ti/wl1251/main.c @@ -878,7 +878,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, wl1251_debug(DEBUG_MAC80211, "mac80211 set key"); - wl_cmd = kzalloc_obj(*wl_cmd, GFP_KERNEL); + wl_cmd = kzalloc_obj(*wl_cmd); if (!wl_cmd) { ret = -ENOMEM; goto out; @@ -1640,7 +1640,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void) wl->tx_mgmt_frm_rate = DEFAULT_HW_GEN_TX_RATE; wl->tx_mgmt_frm_mod = DEFAULT_HW_GEN_MODULATION_TYPE; - wl->rx_descriptor = kmalloc_obj(*wl->rx_descriptor, GFP_KERNEL); + wl->rx_descriptor = kmalloc_obj(*wl->rx_descriptor); if (!wl->rx_descriptor) { wl1251_error("could not allocate memory for rx descriptor"); ieee80211_free_hw(hw); diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c index 1ba35c9fb34b..8fdc7430c008 100644 --- a/drivers/net/wireless/ti/wl1251/sdio.c +++ b/drivers/net/wireless/ti/wl1251/sdio.c @@ -204,7 +204,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl = hw->priv; - wl_sdio = kzalloc_obj(*wl_sdio, GFP_KERNEL); + wl_sdio = kzalloc_obj(*wl_sdio); if (wl_sdio == NULL) { ret = -ENOMEM; goto out_free_hw; diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c index acd4834d8a54..2da8c0d5105b 100644 --- a/drivers/net/wireless/ti/wl1251/tx.c +++ b/drivers/net/wireless/ti/wl1251/tx.c @@ -451,7 +451,7 @@ void wl1251_tx_complete(struct wl1251 *wl) if (unlikely(wl->state != WL1251_STATE_ON)) return; - result = kmalloc_objs(*result, FW_TX_CMPLT_BLOCK_SIZE, GFP_KERNEL); + result = kmalloc_objs(*result, FW_TX_CMPLT_BLOCK_SIZE); if (!result) { wl1251_error("can not allocate result buffer"); return; diff --git a/drivers/net/wireless/ti/wl12xx/acx.c b/drivers/net/wireless/ti/wl12xx/acx.c index 74e16f8c8b22..c669d19b122f 100644 --- a/drivers/net/wireless/ti/wl12xx/acx.c +++ b/drivers/net/wireless/ti/wl12xx/acx.c @@ -17,7 +17,7 @@ int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap) struct wl1271_acx_host_config_bitmap *bitmap_conf; int ret; - bitmap_conf = kzalloc_obj(*bitmap_conf, GFP_KERNEL); + bitmap_conf = kzalloc_obj(*bitmap_conf); if (!bitmap_conf) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl12xx/cmd.c b/drivers/net/wireless/ti/wl12xx/cmd.c index d57f420baa60..1a0755f3f37e 100644 --- a/drivers/net/wireless/ti/wl12xx/cmd.c +++ b/drivers/net/wireless/ti/wl12xx/cmd.c @@ -22,7 +22,7 @@ int wl1271_cmd_ext_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - ext_radio_parms = kzalloc_obj(*ext_radio_parms, GFP_KERNEL); + ext_radio_parms = kzalloc_obj(*ext_radio_parms); if (!ext_radio_parms) return -ENOMEM; @@ -63,7 +63,7 @@ int wl1271_cmd_general_parms(struct wl1271 *wl) return -EINVAL; } - gen_parms = kzalloc_obj(*gen_parms, GFP_KERNEL); + gen_parms = kzalloc_obj(*gen_parms); if (!gen_parms) return -ENOMEM; @@ -130,7 +130,7 @@ int wl128x_cmd_general_parms(struct wl1271 *wl) return -EINVAL; } - gen_parms = kzalloc_obj(*gen_parms, GFP_KERNEL); + gen_parms = kzalloc_obj(*gen_parms); if (!gen_parms) return -ENOMEM; @@ -191,7 +191,7 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - radio_parms = kzalloc_obj(*radio_parms, GFP_KERNEL); + radio_parms = kzalloc_obj(*radio_parms); if (!radio_parms) return -ENOMEM; @@ -235,7 +235,7 @@ int wl128x_cmd_radio_parms(struct wl1271 *wl) if (!wl->nvs) return -ENODEV; - radio_parms = kzalloc_obj(*radio_parms, GFP_KERNEL); + radio_parms = kzalloc_obj(*radio_parms); if (!radio_parms) return -ENOMEM; @@ -280,7 +280,7 @@ int wl12xx_cmd_channel_switch(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "cmd channel switch"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index f766845e2451..30a1da72eb08 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -1882,7 +1882,7 @@ static int wl12xx_setup(struct wl1271 *wl) wl1271_error("Invalid tcxo parameter %s", tcxo_param); } - priv->rx_mem_addr = kmalloc_obj(*priv->rx_mem_addr, GFP_KERNEL); + priv->rx_mem_addr = kmalloc_obj(*priv->rx_mem_addr); if (!priv->rx_mem_addr) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c index 021c547bbab8..ec2fb6ff8860 100644 --- a/drivers/net/wireless/ti/wl12xx/scan.c +++ b/drivers/net/wireless/ti/wl12xx/scan.c @@ -91,8 +91,8 @@ static int wl1271_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (!passive && wl->scan.req->n_ssids == 0) return WL1271_NOTHING_TO_SCAN; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); - trigger = kzalloc_obj(*trigger, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); + trigger = kzalloc_obj(*trigger); if (!cmd || !trigger) { ret = -ENOMEM; goto out; @@ -184,7 +184,7 @@ int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd scan stop"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -317,7 +317,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config"); - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; @@ -348,7 +348,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, wl1271_debug(DEBUG_SCAN, "filter_type = %d", cfg->filter_type); - cfg_channels = kzalloc_obj(*cfg_channels, GFP_KERNEL); + cfg_channels = kzalloc_obj(*cfg_channels); if (!cfg_channels) { ret = -ENOMEM; goto out; @@ -425,7 +425,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif) test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) return -EBUSY; - start = kzalloc_obj(*start, GFP_KERNEL); + start = kzalloc_obj(*start); if (!start) return -ENOMEM; @@ -465,7 +465,7 @@ void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd periodic scan stop"); /* FIXME: what to do if alloc'ing to stop fails? */ - stop = kzalloc_obj(*stop, GFP_KERNEL); + stop = kzalloc_obj(*stop); if (!stop) { wl1271_error("failed to alloc memory to send sched scan stop"); return; diff --git a/drivers/net/wireless/ti/wl18xx/acx.c b/drivers/net/wireless/ti/wl18xx/acx.c index f29dd27814f5..07f3008cf727 100644 --- a/drivers/net/wireless/ti/wl18xx/acx.c +++ b/drivers/net/wireless/ti/wl18xx/acx.c @@ -23,7 +23,7 @@ int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap, host_cfg_bitmap, sdio_blk_size, extra_mem_blks, len_field_size); - bitmap_conf = kzalloc_obj(*bitmap_conf, GFP_KERNEL); + bitmap_conf = kzalloc_obj(*bitmap_conf); if (!bitmap_conf) { ret = -ENOMEM; goto out; @@ -54,7 +54,7 @@ int wl18xx_acx_set_checksum_state(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx checksum state"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -80,7 +80,7 @@ int wl18xx_acx_clear_statistics(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx clear statistics"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -105,7 +105,7 @@ int wl18xx_acx_peer_ht_operation_mode(struct wl1271 *wl, u8 hlid, bool wide) wl1271_debug(DEBUG_ACX, "acx peer ht operation mode hlid %d bw %d", hlid, wide); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -146,7 +146,7 @@ int wl18xx_acx_set_peer_cap(struct wl1271 *wl, "acx set cap ht_supp: %d ht_cap: %d rates: 0x%x", ht_cap->ht_supported, ht_cap->cap, rate_set); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -192,7 +192,7 @@ int wl18xx_acx_interrupt_notify_config(struct wl1271 *wl, struct wl18xx_acx_interrupt_notify *acx; int ret = 0; - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -219,7 +219,7 @@ int wl18xx_acx_rx_ba_filter(struct wl1271 *wl, bool action) struct wl18xx_acx_rx_ba_filter *acx; int ret = 0; - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -247,7 +247,7 @@ int wl18xx_acx_ap_sleep(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx config ap sleep"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -277,7 +277,7 @@ int wl18xx_acx_dynamic_fw_traces(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx dynamic fw traces config %d", wl->dynamic_fw_traces); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -305,7 +305,7 @@ int wl18xx_acx_time_sync_cfg(struct wl1271 *wl) wl->conf.sg.params[WL18XX_CONF_SG_TIME_SYNC], wl->zone_master_mac_addr); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wl18xx/cmd.c b/drivers/net/wireless/ti/wl18xx/cmd.c index 5a1dc648fd57..20fe6b8601fb 100644 --- a/drivers/net/wireless/ti/wl18xx/cmd.c +++ b/drivers/net/wireless/ti/wl18xx/cmd.c @@ -22,7 +22,7 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "cmd channel switch (count=%d)", ch_switch->count); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -78,7 +78,7 @@ int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap) wl1271_debug(DEBUG_CMD, "cmd smart config start group_bitmap=0x%x", group_bitmap); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -105,7 +105,7 @@ int wl18xx_cmd_smart_config_stop(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd smart config stop"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -137,7 +137,7 @@ int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id, return -E2BIG; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -167,7 +167,7 @@ int wl18xx_cmd_set_cac(struct wl1271 *wl, struct wl12xx_vif *wlvif, bool start) wl1271_debug(DEBUG_CMD, "cmd cac (channel %d) %s", wlvif->channel, start ? "start" : "stop"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -198,7 +198,7 @@ int wl18xx_cmd_radar_detection_debug(struct wl1271 *wl, u8 channel) wl1271_debug(DEBUG_CMD, "cmd radar detection debug (chan %d)", channel); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -224,7 +224,7 @@ int wl18xx_cmd_dfs_master_restart(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_CMD, "cmd dfs master restart (role %d)", wlvif->role_id); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c index 7e61403aa374..1f4896eb0434 100644 --- a/drivers/net/wireless/ti/wl18xx/scan.c +++ b/drivers/net/wireless/ti/wl18xx/scan.c @@ -31,7 +31,7 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct wlcore_scan_channels *cmd_channels = NULL; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -67,7 +67,7 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif, /* configure channels */ WARN_ON(req->n_ssids > 1); - cmd_channels = kzalloc_obj(*cmd_channels, GFP_KERNEL); + cmd_channels = kzalloc_obj(*cmd_channels); if (!cmd_channels) { ret = -ENOMEM; goto out; @@ -169,7 +169,7 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl, if (filter_type < 0) return filter_type; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -201,7 +201,7 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl, /* don't stop scanning automatically when something is found */ cmd->terminate_after = 0; - cmd_channels = kzalloc_obj(*cmd_channels, GFP_KERNEL); + cmd_channels = kzalloc_obj(*cmd_channels); if (!cmd_channels) { ret = -ENOMEM; goto out; @@ -301,7 +301,7 @@ static int __wl18xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd periodic scan stop"); - stop = kzalloc_obj(*stop, GFP_KERNEL); + stop = kzalloc_obj(*stop); if (!stop) { wl1271_error("failed to alloc memory to send sched scan stop"); return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c index 65d1df37828d..9efa13638c45 100644 --- a/drivers/net/wireless/ti/wlcore/acx.c +++ b/drivers/net/wireless/ti/wlcore/acx.c @@ -28,7 +28,7 @@ int wl1271_acx_wake_up_conditions(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx wake up conditions (wake_up_event %d listen_interval %d)", wake_up_event, listen_interval); - wake_up = kzalloc_obj(*wake_up, GFP_KERNEL); + wake_up = kzalloc_obj(*wake_up); if (!wake_up) { ret = -ENOMEM; goto out; @@ -57,7 +57,7 @@ int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth) wl1271_debug(DEBUG_ACX, "acx sleep auth %d", sleep_auth); - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) { ret = -ENOMEM; goto out; @@ -90,7 +90,7 @@ int wl1271_acx_tx_power(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (power < 0 || power > 25) return -EINVAL; - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -117,7 +117,7 @@ int wl1271_acx_feature_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx feature cfg"); - feature = kzalloc_obj(*feature, GFP_KERNEL); + feature = kzalloc_obj(*feature); if (!feature) { ret = -ENOMEM; goto out; @@ -162,7 +162,7 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx rx msdu life time"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -189,7 +189,7 @@ int wl1271_acx_slot(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx slot"); - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) { ret = -ENOMEM; goto out; @@ -218,7 +218,7 @@ int wl1271_acx_group_address_tbl(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx group address tbl"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -248,7 +248,7 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl, struct acx_rx_timeout *rx_timeout; int ret; - rx_timeout = kzalloc_obj(*rx_timeout, GFP_KERNEL); + rx_timeout = kzalloc_obj(*rx_timeout); if (!rx_timeout) { ret = -ENOMEM; goto out; @@ -288,7 +288,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx rts threshold: %d", rts_threshold); - rts = kzalloc_obj(*rts, GFP_KERNEL); + rts = kzalloc_obj(*rts); if (!rts) { ret = -ENOMEM; goto out; @@ -316,7 +316,7 @@ int wl1271_acx_dco_itrim_params(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx dco itrim parameters"); - dco = kzalloc_obj(*dco, GFP_KERNEL); + dco = kzalloc_obj(*dco); if (!dco) { ret = -ENOMEM; goto out; @@ -350,7 +350,7 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED) goto out; - beacon_filter = kzalloc_obj(*beacon_filter, GFP_KERNEL); + beacon_filter = kzalloc_obj(*beacon_filter); if (!beacon_filter) { ret = -ENOMEM; goto out; @@ -387,7 +387,7 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx beacon filter table"); - ie_table = kzalloc_obj(*ie_table, GFP_KERNEL); + ie_table = kzalloc_obj(*ie_table); if (!ie_table) { ret = -ENOMEM; goto out; @@ -446,7 +446,7 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx connection monitor parameters: %s", enable ? "enabled" : "disabled"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -482,7 +482,7 @@ int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable) wl1271_debug(DEBUG_ACX, "acx sg enable"); - pta = kzalloc_obj(*pta, GFP_KERNEL); + pta = kzalloc_obj(*pta); if (!pta) { ret = -ENOMEM; goto out; @@ -512,7 +512,7 @@ int wl12xx_acx_sg_cfg(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx sg cfg"); - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) { ret = -ENOMEM; goto out; @@ -541,7 +541,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx cca threshold"); - detection = kzalloc_obj(*detection, GFP_KERNEL); + detection = kzalloc_obj(*detection); if (!detection) { ret = -ENOMEM; goto out; @@ -567,7 +567,7 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx bcn dtim options"); - bb = kzalloc_obj(*bb, GFP_KERNEL); + bb = kzalloc_obj(*bb); if (!bb) { ret = -ENOMEM; goto out; @@ -597,7 +597,7 @@ int wl1271_acx_aid(struct wl1271 *wl, struct wl12xx_vif *wlvif, u16 aid) wl1271_debug(DEBUG_ACX, "acx aid"); - acx_aid = kzalloc_obj(*acx_aid, GFP_KERNEL); + acx_aid = kzalloc_obj(*acx_aid); if (!acx_aid) { ret = -ENOMEM; goto out; @@ -624,7 +624,7 @@ int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask) wl1271_debug(DEBUG_ACX, "acx event mbox mask"); - mask = kzalloc_obj(*mask, GFP_KERNEL); + mask = kzalloc_obj(*mask); if (!mask) { ret = -ENOMEM; goto out; @@ -654,7 +654,7 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx_set_preamble"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -682,7 +682,7 @@ int wl1271_acx_cts_protect(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx_set_ctsprotect"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -727,7 +727,7 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx rate policies"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; @@ -798,7 +798,7 @@ int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, wl1271_debug(DEBUG_ACX, "acx ap rate policy %d rates 0x%x", idx, c->enabled_rates); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -831,7 +831,7 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " "aifs %d txop %d", ac, cw_min, cw_max, aifsn, txop); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; @@ -866,7 +866,7 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx tid config"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; @@ -907,7 +907,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl, u32 frag_threshold) wl1271_debug(DEBUG_ACX, "acx frag threshold: %d", frag_threshold); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; @@ -933,7 +933,7 @@ int wl1271_acx_tx_config_options(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx tx config options"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; @@ -961,7 +961,7 @@ int wl12xx_acx_mem_cfg(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "wl1271 mem cfg"); - mem_conf = kzalloc_obj(*mem_conf, GFP_KERNEL); + mem_conf = kzalloc_obj(*mem_conf); if (!mem_conf) { ret = -ENOMEM; goto out; @@ -998,7 +998,7 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl) { int ret; - wl->target_mem_map = kzalloc_obj(struct wl1271_acx_mem_map, GFP_KERNEL); + wl->target_mem_map = kzalloc_obj(struct wl1271_acx_mem_map); if (!wl->target_mem_map) { wl1271_error("couldn't allocate target memory map"); return -ENOMEM; @@ -1031,7 +1031,7 @@ int wl1271_acx_init_rx_interrupt(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "wl1271 rx interrupt config"); - rx_conf = kzalloc_obj(*rx_conf, GFP_KERNEL); + rx_conf = kzalloc_obj(*rx_conf); if (!rx_conf) { ret = -ENOMEM; goto out; @@ -1065,7 +1065,7 @@ int wl1271_acx_bet_enable(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (enable && wl->conf.conn.bet_enable == CONF_BET_MODE_DISABLE) goto out; - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1094,7 +1094,7 @@ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1127,7 +1127,7 @@ int wl1271_acx_pm_config(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx pm config"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1156,7 +1156,7 @@ int wl1271_acx_keep_alive_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx keep alive mode: %d", enable); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1184,7 +1184,7 @@ int wl1271_acx_keep_alive_config(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx keep alive config"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1216,7 +1216,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx rssi snr trigger"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1258,7 +1258,7 @@ int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx rssi snr avg weights"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1293,7 +1293,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, "sta supp: %d sta cap: %d", ht_cap->ht_supported, ht_cap->cap); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1339,7 +1339,7 @@ int wl1271_acx_set_ht_information(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx ht information setting"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1375,7 +1375,7 @@ int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx ba initiator policy"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1411,7 +1411,7 @@ int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index, wl1271_debug(DEBUG_ACX, "acx ba receiver session setting"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1450,7 +1450,7 @@ int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct wl12xx_acx_fw_tsf_information *tsf_info; int ret; - tsf_info = kzalloc_obj(*tsf_info, GFP_KERNEL); + tsf_info = kzalloc_obj(*tsf_info); if (!tsf_info) { ret = -ENOMEM; goto out; @@ -1482,7 +1482,7 @@ int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx ps rx streaming"); - rx_streaming = kzalloc_obj(*rx_streaming, GFP_KERNEL); + rx_streaming = kzalloc_obj(*rx_streaming); if (!rx_streaming) { ret = -ENOMEM; goto out; @@ -1529,7 +1529,7 @@ int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx ap max tx retry"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -1554,7 +1554,7 @@ int wl12xx_acx_config_ps(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "acx config ps"); - config_ps = kzalloc_obj(*config_ps, GFP_KERNEL); + config_ps = kzalloc_obj(*config_ps); if (!config_ps) { ret = -ENOMEM; goto out; @@ -1585,7 +1585,7 @@ int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, wl1271_debug(DEBUG_ACX, "acx set inconnaction sta %pM", addr); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -1611,7 +1611,7 @@ int wl1271_acx_fm_coex(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx fm coex setting"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1652,7 +1652,7 @@ int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx set rate mgmt params"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; @@ -1694,7 +1694,7 @@ int wl12xx_acx_config_hangover(struct wl1271 *wl) wl1271_debug(DEBUG_ACX, "acx config hangover"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1734,7 +1734,7 @@ int wlcore_acx_average_rssi(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_ACX, "acx roaming statistics"); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) { ret = -ENOMEM; goto out; @@ -1766,7 +1766,7 @@ int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, wl1271_debug(DEBUG_ACX, "acx default rx filter en: %d act: %d", enable, action); - acx = kzalloc_obj(*acx, GFP_KERNEL); + acx = kzalloc_obj(*acx); if (!acx) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index ded64bf9c5a6..04d0bb8460fe 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c @@ -231,7 +231,7 @@ int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 *addr, u8 role_type, if (WARN_ON(*role_id != WL12XX_INVALID_ROLE_ID)) return -EBUSY; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -273,7 +273,7 @@ int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id) if (WARN_ON(*role_id == WL12XX_INVALID_ROLE_ID)) return -ENOENT; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -431,7 +431,7 @@ static int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_cmd_role_start *cmd; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -483,7 +483,7 @@ static int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, if (WARN_ON(wlvif->dev_hlid == WL12XX_INVALID_LINK_ID)) return -EINVAL; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -517,7 +517,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) u32 supported_rates; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -594,7 +594,7 @@ int wl12xx_cmd_role_stop_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) if (WARN_ON(wlvif->sta.hlid == WL12XX_INVALID_LINK_ID)) return -EINVAL; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -641,7 +641,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) } } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -736,7 +736,7 @@ int wl12xx_cmd_role_stop_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) struct wl12xx_cmd_role_stop *cmd; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -769,7 +769,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif) struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -942,7 +942,7 @@ int wl1271_cmd_data_path(struct wl1271 *wl, bool enable) wl1271_debug(DEBUG_CMD, "cmd data path"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -993,7 +993,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd set ps mode"); - ps_params = kzalloc_obj(*ps_params, GFP_KERNEL); + ps_params = kzalloc_obj(*ps_params); if (!ps_params) { ret = -ENOMEM; goto out; @@ -1028,7 +1028,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u8 role_id, WARN_ON(buf_len > WL1271_CMD_TEMPL_MAX_SIZE); buf_len = min_t(size_t, buf_len, WL1271_CMD_TEMPL_MAX_SIZE); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1340,7 +1340,7 @@ int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid) wl1271_debug(DEBUG_CMD, "cmd set_default_wep_key %d", id); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1376,7 +1376,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) return 0; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1442,7 +1442,7 @@ int wl1271_cmd_set_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, int ret = 0; u8 lid_type; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1505,7 +1505,7 @@ int wl12xx_cmd_set_peer_state(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd set peer state (hlid=%d)", hlid); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1540,7 +1540,7 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd add peer %d", (int)hlid); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1599,7 +1599,7 @@ int wl12xx_cmd_remove_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, wl1271_debug(DEBUG_CMD, "cmd remove peer %d", (int)hlid); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1733,7 +1733,7 @@ int wlcore_cmd_regdomain_config_locked(struct wl1271 *wl) if (!memcmp(tmp_ch_bitmap, wl->reg_ch_conf_last, sizeof(tmp_ch_bitmap))) goto out; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1778,7 +1778,7 @@ int wl12xx_cmd_config_fwlog(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd config firmware logger"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1810,7 +1810,7 @@ int wl12xx_cmd_stop_fwlog(struct wl1271 *wl) wl1271_debug(DEBUG_CMD, "cmd stop firmware logger"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1840,7 +1840,7 @@ static int wl12xx_cmd_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (WARN_ON(role_id == WL12XX_INVALID_ROLE_ID)) return -EINVAL; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1882,7 +1882,7 @@ static int wl12xx_cmd_croc(struct wl1271 *wl, u8 role_id) wl1271_debug(DEBUG_CMD, "cmd croc (%d)", role_id); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -1951,7 +1951,7 @@ int wl12xx_cmd_stop_channel_switch(struct wl1271 *wl, struct wl12xx_vif *wlvif) wl1271_debug(DEBUG_ACX, "cmd stop channel switch"); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; @@ -2055,7 +2055,7 @@ int wlcore_cmd_generic_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif, "cmd generic cfg (role %d feature %d enable %d value %d)", wlvif->role_id, feature, enable, value); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c index 3f544a900f67..aa59ddd520f9 100644 --- a/drivers/net/wireless/ti/wlcore/init.c +++ b/drivers/net/wireless/ti/wlcore/init.c @@ -148,7 +148,7 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl, int ret; u32 rate; - tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl); if (!tmpl) { ret = -ENOMEM; goto out; @@ -175,7 +175,7 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl, int ret; u32 rate; - nullfunc = kzalloc_obj(*nullfunc, GFP_KERNEL); + nullfunc = kzalloc_obj(*nullfunc); if (!nullfunc) { ret = -ENOMEM; goto out; @@ -208,7 +208,7 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl, int ret; u32 rate; - qosnull = kzalloc_obj(*qosnull, GFP_KERNEL); + qosnull = kzalloc_obj(*qosnull); if (!qosnull) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 82e035aea874..17dd417756f2 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1070,11 +1070,11 @@ static int wl1271_setup(struct wl1271 *wl) if (!wl->raw_fw_status) goto err; - wl->fw_status = kzalloc_obj(*wl->fw_status, GFP_KERNEL); + wl->fw_status = kzalloc_obj(*wl->fw_status); if (!wl->fw_status) goto err; - wl->tx_res_if = kzalloc_obj(*wl->tx_res_if, GFP_KERNEL); + wl->tx_res_if = kzalloc_obj(*wl->tx_res_if); if (!wl->tx_res_if) goto err; @@ -1477,7 +1477,7 @@ wl1271_validate_wowlan_pattern(struct cfg80211_pkt_pattern *p) struct wl12xx_rx_filter *wl1271_rx_filter_alloc(void) { - return kzalloc_obj(struct wl12xx_rx_filter, GFP_KERNEL); + return kzalloc_obj(struct wl12xx_rx_filter); } void wl1271_rx_filter_free(struct wl12xx_rx_filter *filter) @@ -3346,7 +3346,7 @@ static int wl1271_record_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, if (i == MAX_NUM_KEYS) return -EBUSY; - ap_key = kzalloc_obj(*ap_key, GFP_KERNEL); + ap_key = kzalloc_obj(*ap_key); if (!ap_key) return -ENOMEM; @@ -6459,7 +6459,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size, goto err_fwlog; } - wl->buffer_32 = kmalloc_obj(*wl->buffer_32, GFP_KERNEL); + wl->buffer_32 = kmalloc_obj(*wl->buffer_32); if (!wl->buffer_32) { ret = -ENOMEM; goto err_mbox; diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c index 7cd58bb0efb6..976d96495f28 100644 --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c @@ -389,7 +389,7 @@ wlcore_scan_sched_scan_ssid_list(struct wl1271 *wl, goto out; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out; diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c index caca2786d07c..8437038e4dd0 100644 --- a/drivers/net/wireless/ti/wlcore/testmode.c +++ b/drivers/net/wireless/ti/wlcore/testmode.c @@ -159,7 +159,7 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]) if (ret < 0) goto out; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { ret = -ENOMEM; goto out_sleep; diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index f4f37f71285e..e89173f91637 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -6489,7 +6489,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) if (info->attrs[HWSIM_ATTR_PMSR_SUPPORT]) { struct cfg80211_pmsr_capabilities *pmsr_capa; - pmsr_capa = kmalloc_obj(*pmsr_capa, GFP_KERNEL); + pmsr_capa = kmalloc_obj(*pmsr_capa); if (!pmsr_capa) { ret = -ENOMEM; goto out_free; diff --git a/drivers/net/wireless/virtual/virt_wifi.c b/drivers/net/wireless/virtual/virt_wifi.c index eac81ebf9551..885dc7243e8d 100644 --- a/drivers/net/wireless/virtual/virt_wifi.c +++ b/drivers/net/wireless/virtual/virt_wifi.c @@ -558,7 +558,7 @@ static int virt_wifi_newlink(struct net_device *dev, netif_stacked_transfer_operstate(priv->lowerdev, dev); SET_NETDEV_DEV(dev, &priv->lowerdev->dev); - dev->ieee80211_ptr = kzalloc_obj(*dev->ieee80211_ptr, GFP_KERNEL); + dev->ieee80211_ptr = kzalloc_obj(*dev->ieee80211_ptr); if (!dev->ieee80211_ptr) { err = -ENOMEM; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c index f5063efc8e42..03948f0b4628 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c @@ -722,7 +722,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon, /* Alloc memory for full beacon write at once. */ num_cmds = 1 + zd_chip_is_zd1211b(&mac->chip) + full_len; - ioreqs = kmalloc_objs(struct zd_ioreq32, num_cmds, GFP_KERNEL); + ioreqs = kmalloc_objs(struct zd_ioreq32, num_cmds); if (!ioreqs) { r = -ENOMEM; goto out_nofree; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c b/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c index d15d95ff5aad..50aca6f681bf 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_rf_uw2453.c @@ -518,7 +518,7 @@ int zd_rf_init_uw2453(struct zd_rf *rf) /* we have our own TX integration code */ rf->update_channel_int = 0; - rf->priv = kmalloc_obj(struct uw2453_priv, GFP_KERNEL); + rf->priv = kmalloc_obj(struct uw2453_priv); if (rf->priv == NULL) return -ENOMEM; diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c index e5c3be14ae4e..966d8ccb0dbc 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c @@ -752,7 +752,7 @@ static int __zd_usb_enable_rx(struct zd_usb *usb) dev_dbg_f(zd_usb_dev(usb), "\n"); r = -ENOMEM; - urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT, GFP_KERNEL); + urbs = kzalloc_objs(struct urb *, RX_URBS_COUNT); if (!urbs) goto error; for (i = 0; i < RX_URBS_COUNT; i++) { diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem.c b/drivers/net/wwan/iosm/iosm_ipc_imem.c index f354e4514565..1b7bc7d63a2e 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_imem.c +++ b/drivers/net/wwan/iosm/iosm_ipc_imem.c @@ -1334,7 +1334,7 @@ static int ipc_imem_config(struct iosm_imem *ipc_imem) struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id, void __iomem *mmio, struct device *dev) { - struct iosm_imem *ipc_imem = kzalloc_obj(*pcie->imem, GFP_KERNEL); + struct iosm_imem *ipc_imem = kzalloc_obj(*pcie->imem); enum ipc_mem_exec_stage stage; if (!ipc_imem) @@ -1359,7 +1359,7 @@ struct iosm_imem *ipc_imem_init(struct iosm_pcie *pcie, unsigned int device_id, goto mmio_init_fail; } - ipc_imem->ipc_task = kzalloc_obj(*ipc_imem->ipc_task, GFP_KERNEL); + ipc_imem->ipc_task = kzalloc_obj(*ipc_imem->ipc_task); /* Create tasklet for event handling*/ if (!ipc_imem->ipc_task) diff --git a/drivers/net/wwan/iosm/iosm_ipc_mmio.c b/drivers/net/wwan/iosm/iosm_ipc_mmio.c index 3319d7423101..f8d32b0f95d9 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mmio.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mmio.c @@ -82,7 +82,7 @@ void ipc_mmio_update_cp_capability(struct iosm_mmio *ipc_mmio) struct iosm_mmio *ipc_mmio_init(void __iomem *mmio, struct device *dev) { - struct iosm_mmio *ipc_mmio = kzalloc_obj(*ipc_mmio, GFP_KERNEL); + struct iosm_mmio *ipc_mmio = kzalloc_obj(*ipc_mmio); int retries = IPC_MMIO_EXEC_STAGE_TIMEOUT; enum ipc_mem_exec_stage stage; diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux.c b/drivers/net/wwan/iosm/iosm_ipc_mux.c index d370c7b7810a..17c09221f0dd 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux.c @@ -278,7 +278,7 @@ out: struct iosm_mux *ipc_mux_init(struct ipc_mux_config *mux_cfg, struct iosm_imem *imem) { - struct iosm_mux *ipc_mux = kzalloc_obj(*ipc_mux, GFP_KERNEL); + struct iosm_mux *ipc_mux = kzalloc_obj(*ipc_mux); int i, j, ul_tds, ul_td_size; struct sk_buff_head *free_list; struct sk_buff *skb; diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c index f7f693c2296a..49052eb511ba 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c +++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c @@ -260,7 +260,7 @@ default_ret: static int ipc_pcie_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct iosm_pcie *ipc_pcie = kzalloc_obj(*ipc_pcie, GFP_KERNEL); + struct iosm_pcie *ipc_pcie = kzalloc_obj(*ipc_pcie); int ret; pr_debug("Probing device 0x%X from the vendor 0x%X", pci_id->device, diff --git a/drivers/net/wwan/iosm/iosm_ipc_port.c b/drivers/net/wwan/iosm/iosm_ipc_port.c index bf75d8b94682..021349a78884 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_port.c +++ b/drivers/net/wwan/iosm/iosm_ipc_port.c @@ -48,7 +48,7 @@ static const struct wwan_port_ops ipc_wwan_ctrl_ops = { struct iosm_cdev *ipc_port_init(struct iosm_imem *ipc_imem, struct ipc_chnl_cfg ipc_port_cfg) { - struct iosm_cdev *ipc_port = kzalloc_obj(*ipc_port, GFP_KERNEL); + struct iosm_cdev *ipc_port = kzalloc_obj(*ipc_port); enum wwan_port_type port_type = ipc_port_cfg.wwan_port_type; enum ipc_channel_id chl_id = ipc_port_cfg.id; diff --git a/drivers/net/wwan/iosm/iosm_ipc_task_queue.c b/drivers/net/wwan/iosm/iosm_ipc_task_queue.c index f9c1837781e5..7cb2f6a506d9 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_task_queue.c +++ b/drivers/net/wwan/iosm/iosm_ipc_task_queue.c @@ -174,7 +174,7 @@ int ipc_task_init(struct ipc_task *ipc_task) { struct ipc_task_queue *ipc_queue = &ipc_task->ipc_queue; - ipc_task->ipc_tasklet = kzalloc_obj(*ipc_task->ipc_tasklet, GFP_KERNEL); + ipc_task->ipc_tasklet = kzalloc_obj(*ipc_task->ipc_tasklet); if (!ipc_task->ipc_tasklet) return -ENOMEM; diff --git a/drivers/net/wwan/iosm/iosm_ipc_trace.c b/drivers/net/wwan/iosm/iosm_ipc_trace.c index c6368131d786..7f3d305b3857 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_trace.c +++ b/drivers/net/wwan/iosm/iosm_ipc_trace.c @@ -140,7 +140,7 @@ struct iosm_trace *ipc_trace_init(struct iosm_imem *ipc_imem) ipc_imem_channel_init(ipc_imem, IPC_CTYPE_CTRL, chnl_cfg, IRQ_MOD_OFF); - ipc_trace = kzalloc_obj(*ipc_trace, GFP_KERNEL); + ipc_trace = kzalloc_obj(*ipc_trace); if (!ipc_trace) return NULL; diff --git a/drivers/net/wwan/iosm/iosm_ipc_wwan.c b/drivers/net/wwan/iosm/iosm_ipc_wwan.c index 7a299b6b41c9..21266b599f62 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_wwan.c +++ b/drivers/net/wwan/iosm/iosm_ipc_wwan.c @@ -290,7 +290,7 @@ struct iosm_wwan *ipc_wwan_init(struct iosm_imem *ipc_imem, struct device *dev) { struct iosm_wwan *ipc_wwan; - ipc_wwan = kzalloc_obj(*ipc_wwan, GFP_KERNEL); + ipc_wwan = kzalloc_obj(*ipc_wwan); if (!ipc_wwan) return NULL; diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c b/drivers/net/wwan/mhi_wwan_ctrl.c index 33e0dd11abde..fa73861db6ad 100644 --- a/drivers/net/wwan/mhi_wwan_ctrl.c +++ b/drivers/net/wwan/mhi_wwan_ctrl.c @@ -218,7 +218,7 @@ static int mhi_wwan_ctrl_probe(struct mhi_device *mhi_dev, struct mhi_wwan_dev *mhiwwan; struct wwan_port *port; - mhiwwan = kzalloc_obj(*mhiwwan, GFP_KERNEL); + mhiwwan = kzalloc_obj(*mhiwwan); if (!mhiwwan) return -ENOMEM; diff --git a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c b/drivers/net/wwan/t7xx/t7xx_hif_cldma.c index a32378dcc392..e10cb4f9104e 100644 --- a/drivers/net/wwan/t7xx/t7xx_hif_cldma.c +++ b/drivers/net/wwan/t7xx/t7xx_hif_cldma.c @@ -391,7 +391,7 @@ static struct cldma_request *t7xx_alloc_rx_request(struct cldma_ctrl *md_ctrl, s struct cldma_request *req; int val; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; @@ -451,7 +451,7 @@ static struct cldma_request *t7xx_alloc_tx_request(struct cldma_ctrl *md_ctrl) { struct cldma_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; @@ -1206,7 +1206,7 @@ static int t7xx_cldma_suspend(struct t7xx_pci_dev *t7xx_dev, void *entity_param) static int t7xx_cldma_pm_init(struct cldma_ctrl *md_ctrl) { - md_ctrl->pm_entity = kzalloc_obj(*md_ctrl->pm_entity, GFP_KERNEL); + md_ctrl->pm_entity = kzalloc_obj(*md_ctrl->pm_entity); if (!md_ctrl->pm_entity) return -ENOMEM; diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index ffa222b6dce8..ccce2ad74128 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -250,7 +250,7 @@ static struct wwan_device *wwan_create_dev(struct device *parent) goto done_unlock; } - wwandev = kzalloc_obj(*wwandev, GFP_KERNEL); + wwandev = kzalloc_obj(*wwandev); if (!wwandev) { wwandev = ERR_PTR(-ENOMEM); ida_free(&wwan_dev_ids, id); @@ -639,7 +639,7 @@ struct wwan_port *wwan_create_port(struct device *parent, if (IS_ERR(wwandev)) return ERR_CAST(wwandev); - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { err = -ENOMEM; goto error_wwandev_remove; diff --git a/drivers/net/wwan/wwan_hwsim.c b/drivers/net/wwan/wwan_hwsim.c index 55d3b2bb4061..c3c2d2a68767 100644 --- a/drivers/net/wwan/wwan_hwsim.c +++ b/drivers/net/wwan/wwan_hwsim.c @@ -317,7 +317,7 @@ static struct wwan_hwsim_port *wwan_hwsim_port_new(struct wwan_hwsim_dev *dev, else return ERR_PTR(-EINVAL); - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); @@ -390,7 +390,7 @@ static struct wwan_hwsim_dev *wwan_hwsim_dev_new(void) struct wwan_hwsim_dev *dev; int err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index adb3967f00ee..e020f44ac2c7 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -1007,7 +1007,7 @@ static int netback_probe(struct xenbus_device *dev, int err; int sg; const char *script; - struct backend_info *be = kzalloc_obj(*be, GFP_KERNEL); + struct backend_info *be = kzalloc_obj(*be); if (!be) { xenbus_dev_fatal(dev, -ENOMEM, diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index 5f8c9c2c7c06..0ea28597e6f5 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -373,7 +373,7 @@ struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *cldev) { struct nfc_mei_phy *phy; - phy = kzalloc_obj(struct nfc_mei_phy, GFP_KERNEL); + phy = kzalloc_obj(struct nfc_mei_phy); if (!phy) return NULL; diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c index 60cdf4d09577..4149c5d735bd 100644 --- a/drivers/nfc/microread/microread.c +++ b/drivers/nfc/microread/microread.c @@ -473,7 +473,7 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, pr_info("target discovered to gate 0x%x\n", gate); - targets = kzalloc_obj(struct nfc_target, GFP_KERNEL); + targets = kzalloc_obj(struct nfc_target); if (targets == NULL) { r = -ENOMEM; goto exit; @@ -650,7 +650,7 @@ int microread_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; int r; - info = kzalloc_obj(struct microread_info, GFP_KERNEL); + info = kzalloc_obj(struct microread_info); if (!info) { r = -ENOMEM; goto err_info_alloc; diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index 2065befd3793..c51d22e4579c 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c @@ -101,7 +101,7 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy, int tailroom; u32 protocols; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c index 6b2939e6a7cd..f8e5c4da3b13 100644 --- a/drivers/nfc/nfcsim.c +++ b/drivers/nfc/nfcsim.c @@ -66,7 +66,7 @@ static struct nfcsim_link *nfcsim_link_new(void) { struct nfcsim_link *link; - link = kzalloc_obj(struct nfcsim_link, GFP_KERNEL); + link = kzalloc_obj(struct nfcsim_link); if (!link) return NULL; @@ -373,7 +373,7 @@ static struct nfcsim *nfcsim_device_new(struct nfcsim_link *link_in, struct nfcsim *dev; int rc; - dev = kzalloc_obj(struct nfcsim, GFP_KERNEL); + dev = kzalloc_obj(struct nfcsim); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index 8d62084c3e92..d7bdbc82e2ba 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -444,7 +444,7 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code, dev_dbg(dev->dev, "Sending command 0x%x\n", cmd_code); - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -518,7 +518,7 @@ static int pn533_send_cmd_direct_async(struct pn533 *dev, u8 cmd_code, struct pn533_cmd *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -2019,7 +2019,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target, *next = 0; } - arg = kmalloc_obj(*arg, GFP_KERNEL); + arg = kmalloc_obj(*arg); if (!arg) { dev_kfree_skb(skb); return -ENOMEM; @@ -2266,7 +2266,7 @@ static int pn533_transceive(struct nfc_dev *nfc_dev, goto error; } - arg = kmalloc_obj(*arg, GFP_KERNEL); + arg = kmalloc_obj(*arg); if (!arg) { rc = -ENOMEM; goto error; @@ -2744,7 +2744,7 @@ struct pn533 *pn53x_common_init(u32 device_type, { struct pn533 *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c index 3355736e5e26..6d2f520a5bc8 100644 --- a/drivers/nfc/pn533/uart.c +++ b/drivers/nfc/pn533/uart.c @@ -242,7 +242,7 @@ static int pn532_uart_probe(struct serdev_device *serdev) int err; err = -ENOMEM; - pn532 = kzalloc_obj(*pn532, GFP_KERNEL); + pn532 = kzalloc_obj(*pn532); if (!pn532) goto err_exit; diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index 87803f125f5e..9d0a16ac465e 100644 --- a/drivers/nfc/pn544/pn544.c +++ b/drivers/nfc/pn544/pn544.c @@ -910,7 +910,7 @@ int pn544_hci_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; int r; - info = kzalloc_obj(struct pn544_hci_info, GFP_KERNEL); + info = kzalloc_obj(struct pn544_hci_info); if (!info) { r = -ENOMEM; goto err_info_alloc; diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c index 3dcd13878535..a922569d7b48 100644 --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -859,7 +859,7 @@ static int port100_send_cmd_async(struct port100 *dev, u8 cmd_code, if (!resp) return -ENOMEM; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { dev_kfree_skb(resp); return -ENOMEM; @@ -1211,7 +1211,7 @@ static int port100_in_send_cmd(struct nfc_digital_dev *ddev, struct port100_cb_arg *cb_arg; __le16 timeout; - cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg); if (!cb_arg) return -ENOMEM; @@ -1377,7 +1377,7 @@ static int port100_tg_send_cmd(struct nfc_digital_dev *ddev, struct port100_tg_comm_rf_cmd *hdr; struct port100_cb_arg *cb_arg; - cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg); if (!cb_arg) return -ENOMEM; @@ -1418,7 +1418,7 @@ static int port100_listen_mdaa(struct nfc_digital_dev *ddev, if (rc) return rc; - cb_arg = kzalloc_obj(struct port100_cb_arg, GFP_KERNEL); + cb_arg = kzalloc_obj(struct port100_cb_arg); if (!cb_arg) return -ENOMEM; diff --git a/drivers/nfc/st21nfca/core.c b/drivers/nfc/st21nfca/core.c index 31f6e7c9930f..fd39a05c9622 100644 --- a/drivers/nfc/st21nfca/core.c +++ b/drivers/nfc/st21nfca/core.c @@ -946,7 +946,7 @@ int st21nfca_hci_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, struct nfc_hci_init_data init_data; unsigned long quirks = 0; - info = kzalloc_obj(struct st21nfca_hci_info, GFP_KERNEL); + info = kzalloc_obj(struct st21nfca_hci_info); if (!info) return -ENOMEM; diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c index 81cc2e046ee6..8eeb447ac96e 100644 --- a/drivers/nfc/virtual_ncidev.c +++ b/drivers/nfc/virtual_ncidev.c @@ -135,7 +135,7 @@ static int virtual_ncidev_open(struct inode *inode, struct file *file) int ret = 0; struct virtual_nci_dev *vdev; - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) return -ENOMEM; vdev->ndev = nci_allocate_device(&virtual_nci_ops, diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c index 4d6773ef484e..3ea3d1738eae 100644 --- a/drivers/nubus/proc.c +++ b/drivers/nubus/proc.c @@ -96,7 +96,7 @@ nubus_proc_alloc_pde_data(unsigned char *ptr, unsigned int size) { struct nubus_proc_pde_data *pded; - pded = kmalloc_obj(*pded, GFP_KERNEL); + pded = kmalloc_obj(*pded); if (!pded) return NULL; diff --git a/drivers/nvdimm/badrange.c b/drivers/nvdimm/badrange.c index 7d2422f72e66..551cb0691856 100644 --- a/drivers/nvdimm/badrange.c +++ b/drivers/nvdimm/badrange.c @@ -50,7 +50,7 @@ static int add_badrange(struct badrange *badrange, u64 addr, u64 length) struct badrange_entry *bre, *bre_new; spin_unlock(&badrange->lock); - bre_new = kzalloc_obj(*bre_new, GFP_KERNEL); + bre_new = kzalloc_obj(*bre_new); spin_lock(&badrange->lock); if (list_empty(&badrange->list)) { diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index c47785274d3a..afbefc5f49bc 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -751,7 +751,7 @@ static struct arena_info *alloc_arena(struct btt *btt, size_t size, u64 logsize, mapsize, datasize; u64 available = size; - arena = kzalloc_obj(*arena, GFP_KERNEL); + arena = kzalloc_obj(*arena); if (!arena) return NULL; arena->nd_btt = btt->nd_btt; @@ -854,7 +854,7 @@ static int discover_arenas(struct btt *btt) size_t cur_off = 0; int num_arenas = 0; - struct btt_sb *super __free(kfree) = kzalloc_obj(*super, GFP_KERNEL); + struct btt_sb *super __free(kfree) = kzalloc_obj(*super); if (!super) return -ENOMEM; diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index ab9d0ad53724..d6b2f157368f 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c @@ -180,7 +180,7 @@ static struct device *__nd_btt_create(struct nd_region *nd_region, struct nd_btt *nd_btt; struct device *dev; - nd_btt = kzalloc_obj(*nd_btt, GFP_KERNEL); + nd_btt = kzalloc_obj(*nd_btt); if (!nd_btt) return NULL; diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 767a4f1e27e5..bd9621d3f73c 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -336,7 +336,7 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent, struct nvdimm_bus *nvdimm_bus; int rc; - nvdimm_bus = kzalloc_obj(*nvdimm_bus, GFP_KERNEL); + nvdimm_bus = kzalloc_obj(*nvdimm_bus); if (!nvdimm_bus) return NULL; INIT_LIST_HEAD(&nvdimm_bus->list); @@ -736,7 +736,7 @@ int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus) struct device *dev; int rc; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; device_initialize(dev); diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c index 5c2e4160e6ae..34bd886c04a6 100644 --- a/drivers/nvdimm/core.c +++ b/drivers/nvdimm/core.c @@ -80,7 +80,7 @@ static struct nvdimm_map *alloc_nvdimm_map(struct device *dev, struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev); struct nvdimm_map *nvdimm_map; - nvdimm_map = kzalloc_obj(*nvdimm_map, GFP_KERNEL); + nvdimm_map = kzalloc_obj(*nvdimm_map); if (!nvdimm_map) return NULL; diff --git a/drivers/nvdimm/dax_devs.c b/drivers/nvdimm/dax_devs.c index 6d25a7fbf751..decc70f2fe3f 100644 --- a/drivers/nvdimm/dax_devs.c +++ b/drivers/nvdimm/dax_devs.c @@ -50,7 +50,7 @@ static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region) struct nd_dax *nd_dax; struct device *dev; - nd_dax = kzalloc_obj(*nd_dax, GFP_KERNEL); + nd_dax = kzalloc_obj(*nd_dax); if (!nd_dax) return NULL; diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c index f7c7ecee80a7..addbd149a9c1 100644 --- a/drivers/nvdimm/dimm.c +++ b/drivers/nvdimm/dimm.c @@ -39,7 +39,7 @@ static int nvdimm_probe(struct device *dev) */ nvdimm_clear_locked(dev); - ndd = kzalloc_obj(*ndd, GFP_KERNEL); + ndd = kzalloc_obj(*ndd); if (!ndd) return -ENOMEM; diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c index c0366fd5d6a0..81daeb4d11a9 100644 --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c @@ -575,7 +575,7 @@ struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus, const struct nvdimm_security_ops *sec_ops, const struct nvdimm_fw_ops *fw_ops) { - struct nvdimm *nvdimm = kzalloc_obj(*nvdimm, GFP_KERNEL); + struct nvdimm *nvdimm = kzalloc_obj(*nvdimm); struct device *dev; if (!nvdimm) diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c index e370eaf17099..4218e3ac4a2a 100644 --- a/drivers/nvdimm/label.c +++ b/drivers/nvdimm/label.c @@ -982,7 +982,7 @@ static int init_labels(struct nd_mapping *nd_mapping, int num_labels) * they can be garbage collected after writing the new labels. */ for (i = old_num_labels; i < num_labels; i++) { - label_ent = kzalloc_obj(*label_ent, GFP_KERNEL); + label_ent = kzalloc_obj(*label_ent); if (!label_ent) return -ENOMEM; mutex_lock(&nd_mapping->lock); diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 6f2cd7d32467..557fe0cb43e2 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -1530,11 +1530,11 @@ static struct device **create_namespace_io(struct nd_region *nd_region) struct device *dev, **devs; struct resource *res; - nsio = kzalloc_obj(*nsio, GFP_KERNEL); + nsio = kzalloc_obj(*nsio); if (!nsio) return NULL; - devs = kzalloc_objs(struct device *, 2, GFP_KERNEL); + devs = kzalloc_objs(struct device *, 2); if (!devs) { kfree(nsio); return NULL; @@ -1693,7 +1693,7 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region, nsl_uuid_raw(ndd, nd_label)); } - nspm = kzalloc_obj(*nspm, GFP_KERNEL); + nspm = kzalloc_obj(*nspm); if (!nspm) return ERR_PTR(-ENOMEM); @@ -1797,7 +1797,7 @@ static struct device *nd_namespace_pmem_create(struct nd_region *nd_region) if (!is_memory(&nd_region->dev)) return NULL; - nspm = kzalloc_obj(*nspm, GFP_KERNEL); + nspm = kzalloc_obj(*nspm); if (!nspm) return NULL; @@ -1931,7 +1931,7 @@ static struct device **scan_labels(struct nd_region *nd_region) struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1; - devs = kzalloc_objs(dev, 2, GFP_KERNEL); + devs = kzalloc_objs(dev, 2); if (!devs) return NULL; @@ -1954,7 +1954,7 @@ static struct device **scan_labels(struct nd_region *nd_region) if (i < count) continue; if (count) { - __devs = kzalloc_objs(dev, count + 2, GFP_KERNEL); + __devs = kzalloc_objs(dev, count + 2); if (!__devs) goto err; memcpy(__devs, devs, sizeof(dev) * count); @@ -1984,7 +1984,7 @@ static struct device **scan_labels(struct nd_region *nd_region) /* Publish a zero-sized namespace for userspace to configure. */ nd_mapping_free_labels(nd_mapping); - nspm = kzalloc_obj(*nspm, GFP_KERNEL); + nspm = kzalloc_obj(*nspm); if (!nspm) goto err; dev = &nspm->nsio.common.dev; @@ -2118,7 +2118,7 @@ static int init_active_labels(struct nd_region *nd_region) for (j = 0; j < count; j++) { struct nd_namespace_label *label; - label_ent = kzalloc_obj(*label_ent, GFP_KERNEL); + label_ent = kzalloc_obj(*label_ent); if (!label_ent) break; label = nd_label_active(ndd, j); diff --git a/drivers/nvdimm/nd_perf.c b/drivers/nvdimm/nd_perf.c index 5338a440890b..9bd8dff3d35a 100644 --- a/drivers/nvdimm/nd_perf.c +++ b/drivers/nvdimm/nd_perf.c @@ -184,7 +184,7 @@ static int create_cpumask_attr_group(struct nvdimm_pmu *nd_pmu) struct attribute **attrs_group; struct attribute_group *nvdimm_pmu_cpumask_group; - pmu_events_attr = kzalloc_obj(*pmu_events_attr, GFP_KERNEL); + pmu_events_attr = kzalloc_obj(*pmu_events_attr); if (!pmu_events_attr) return -ENOMEM; diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c index e70aee4ef7a9..4176046627be 100644 --- a/drivers/nvdimm/nd_virtio.c +++ b/drivers/nvdimm/nd_virtio.c @@ -55,7 +55,7 @@ static int virtio_pmem_flush(struct nd_region *nd_region) return -EIO; } - req_data = kmalloc_obj(*req_data, GFP_KERNEL); + req_data = kmalloc_obj(*req_data); if (!req_data) return -ENOMEM; diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index f78aede2aab5..776b7778a12e 100644 --- a/drivers/nvdimm/of_pmem.c +++ b/drivers/nvdimm/of_pmem.c @@ -26,7 +26,7 @@ static int of_pmem_region_probe(struct platform_device *pdev) if (!np) return -ENXIO; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 5d1e1c214847..8fa9c16aba7e 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -311,7 +311,7 @@ static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) struct nd_pfn *nd_pfn; struct device *dev; - nd_pfn = kzalloc_obj(*nd_pfn, GFP_KERNEL); + nd_pfn = kzalloc_obj(*nd_pfn); if (!nd_pfn) return NULL; diff --git a/drivers/nvdimm/ramdax.c b/drivers/nvdimm/ramdax.c index 8d6cfffbb56c..e76fca736d76 100644 --- a/drivers/nvdimm/ramdax.c +++ b/drivers/nvdimm/ramdax.c @@ -40,7 +40,7 @@ static int ramdax_register_region(struct resource *res, struct nd_interleave_set *nd_set; int nid = phys_to_target_node(res->start); - nd_set = kzalloc_obj(*nd_set, GFP_KERNEL); + nd_set = kzalloc_obj(*nd_set); if (!nd_set) return -ENOMEM; @@ -80,7 +80,7 @@ static int ramdax_register_dimm(struct resource *res, void *data) struct ramdax_dimm *dimm; int err; - dimm = kzalloc_obj(*dimm, GFP_KERNEL); + dimm = kzalloc_obj(*dimm); if (!dimm) return -ENOMEM; diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index fe05fb76afe6..f5ebcaa2f859 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1469,7 +1469,7 @@ static int nvme_identify_ctrl(struct nvme_ctrl *dev, struct nvme_id_ctrl **id) c.identify.opcode = nvme_admin_identify; c.identify.cns = NVME_ID_CNS_CTRL; - *id = kmalloc_obj(struct nvme_id_ctrl, GFP_KERNEL); + *id = kmalloc_obj(struct nvme_id_ctrl); if (!*id) return -ENOMEM; @@ -1599,7 +1599,7 @@ int nvme_identify_ns(struct nvme_ctrl *ctrl, unsigned nsid, c.identify.nsid = cpu_to_le32(nsid); c.identify.cns = NVME_ID_CNS_NS; - *id = kmalloc_obj(**id, GFP_KERNEL); + *id = kmalloc_obj(**id); if (!*id) return -ENOMEM; @@ -1663,7 +1663,7 @@ static int nvme_ns_info_from_id_cs_indep(struct nvme_ctrl *ctrl, }; int ret; - id = kmalloc_obj(*id, GFP_KERNEL); + id = kmalloc_obj(*id); if (!id) return -ENOMEM; @@ -1923,7 +1923,7 @@ static int nvme_identify_ns_nvm(struct nvme_ctrl *ctrl, unsigned int nsid, struct nvme_id_ns_nvm *nvm; int ret; - nvm = kzalloc_obj(*nvm, GFP_KERNEL); + nvm = kzalloc_obj(*nvm); if (!nvm) return -ENOMEM; @@ -2784,7 +2784,7 @@ static int nvme_configure_host_options(struct nvme_ctrl *ctrl) if (!acre && !lbafee) return 0; - host = kzalloc_obj(*host, GFP_KERNEL); + host = kzalloc_obj(*host); if (!host) return 0; @@ -2873,7 +2873,7 @@ static int nvme_configure_apst(struct nvme_ctrl *ctrl) return 0; } - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return 0; @@ -3208,7 +3208,7 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) struct nvme_subsystem *subsys, *found; int ret; - subsys = kzalloc_obj(*subsys, GFP_KERNEL); + subsys = kzalloc_obj(*subsys); if (!subsys) return -ENOMEM; @@ -3326,7 +3326,7 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi, if (cel) goto out; - cel = kzalloc_obj(*cel, GFP_KERNEL); + cel = kzalloc_obj(*cel); if (!cel) return -ENOMEM; @@ -3379,7 +3379,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl) test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags)) return 0; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) return -ENOMEM; @@ -3408,7 +3408,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl, { struct nvme_effects_log *effects, *old; - effects = kzalloc_obj(*effects, GFP_KERNEL); + effects = kzalloc_obj(*effects); if (!effects) return -ENOMEM; @@ -4688,7 +4688,7 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl) struct nvme_fw_slot_info_log *log; u8 next_fw_slot, cur_fw_slot; - log = kmalloc_obj(*log, GFP_KERNEL); + log = kmalloc_obj(*log); if (!log) return; diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index b4e4bdea1db0..5fe09e327b3d 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -26,7 +26,7 @@ static struct nvmf_host *nvmf_host_alloc(const char *hostnqn, uuid_t *id) { struct nvmf_host *host; - host = kmalloc_obj(*host, GFP_KERNEL); + host = kmalloc_obj(*host); if (!host) return NULL; @@ -396,7 +396,7 @@ static struct nvmf_connect_data *nvmf_connect_data_prep(struct nvme_ctrl *ctrl, { struct nvmf_connect_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; @@ -1312,7 +1312,7 @@ nvmf_create_ctrl(struct device *dev, const char *buf) struct nvme_ctrl *ctrl; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 0b65d1bab4c1..d839824b4e8d 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1724,15 +1724,15 @@ nvme_fc_rcv_ls_req(struct nvme_fc_remote_port *portptr, goto out_put; } - lsop = kzalloc_obj(*lsop, GFP_KERNEL); + lsop = kzalloc_obj(*lsop); if (!lsop) { nvme_fc_rcv_ls_req_err_msg(lport, w0); ret = -ENOMEM; goto out_put; } - lsop->rqstbuf = kzalloc_obj(*lsop->rqstbuf, GFP_KERNEL); - lsop->rspbuf = kzalloc_obj(*lsop->rspbuf, GFP_KERNEL); + lsop->rqstbuf = kzalloc_obj(*lsop->rqstbuf); + lsop->rspbuf = kzalloc_obj(*lsop->rspbuf); if (!lsop->rqstbuf || !lsop->rspbuf) { nvme_fc_rcv_ls_req_err_msg(lport, w0); ret = -ENOMEM; @@ -3443,7 +3443,7 @@ nvme_fc_alloc_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, goto out_fail; } - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) { ret = -ENOMEM; goto out_fail; diff --git a/drivers/nvme/host/hwmon.c b/drivers/nvme/host/hwmon.c index c60bd960f03a..406203d8b9ad 100644 --- a/drivers/nvme/host/hwmon.c +++ b/drivers/nvme/host/hwmon.c @@ -230,11 +230,11 @@ int nvme_hwmon_init(struct nvme_ctrl *ctrl) struct device *hwmon; int err; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; - data->log = kzalloc_obj(*data->log, GFP_KERNEL); + data->log = kzalloc_obj(*data->log); if (!data->log) { err = -ENOMEM; goto err_free_data; diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 89b5095d1b2e..2f0c05719316 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2447,7 +2447,7 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred, if (!descs) goto out; - bufs = kzalloc_objs(*bufs, max_entries, GFP_KERNEL); + bufs = kzalloc_objs(*bufs, max_entries); if (!bufs) goto out_free_descs; diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 718bbc9b87c1..1bf73073c814 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -215,7 +215,7 @@ static struct nvme_rdma_qe *nvme_rdma_alloc_ring(struct ib_device *ibdev, struct nvme_rdma_qe *ring; int i; - ring = kzalloc_objs(struct nvme_rdma_qe, ib_queue_size, GFP_KERNEL); + ring = kzalloc_objs(struct nvme_rdma_qe, ib_queue_size); if (!ring) return NULL; @@ -300,7 +300,7 @@ static int nvme_rdma_init_request(struct blk_mq_tag_set *set, struct nvme_rdma_queue *queue = &ctrl->queues[queue_idx]; nvme_req(rq)->ctrl = &ctrl->ctrl; - req->sqe.data = kzalloc_obj(struct nvme_command, GFP_KERNEL); + req->sqe.data = kzalloc_obj(struct nvme_command); if (!req->sqe.data) return -ENOMEM; @@ -375,7 +375,7 @@ nvme_rdma_find_get_device(struct rdma_cm_id *cm_id) goto out_unlock; } - ndev = kzalloc_obj(*ndev, GFP_KERNEL); + ndev = kzalloc_obj(*ndev); if (!ndev) goto out_err; @@ -2240,7 +2240,7 @@ static struct nvme_rdma_ctrl *nvme_rdma_alloc_ctrl(struct device *dev, struct nvme_rdma_ctrl *ctrl; int ret; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return ERR_PTR(-ENOMEM); ctrl->ctrl.opts = opts; diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 489102bdd057..62fe19dd2809 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1467,11 +1467,11 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue) u32 maxh2cdata; int ret; - icreq = kzalloc_obj(*icreq, GFP_KERNEL); + icreq = kzalloc_obj(*icreq); if (!icreq) return -ENOMEM; - icresp = kzalloc_obj(*icresp, GFP_KERNEL); + icresp = kzalloc_obj(*icresp); if (!icresp) { ret = -ENOMEM; goto free_icreq; @@ -2891,7 +2891,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev, struct nvme_tcp_ctrl *ctrl; int ret; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 68dbe78c90c4..8ed1b6a33454 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -13,7 +13,7 @@ static int nvme_set_max_append(struct nvme_ctrl *ctrl) struct nvme_id_ctrl_zns *id; int status; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) return -ENOMEM; @@ -64,7 +64,7 @@ int nvme_query_zone_info(struct nvme_ns *ns, unsigned lbaf, return status; } - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) return -ENOMEM; diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 431702ff21fb..b8cf9bbb16d4 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -203,7 +203,7 @@ static void nvmet_execute_get_supported_log_pages(struct nvmet_req *req) struct nvme_supported_log *logs; u16 status; - logs = kzalloc_obj(*logs, GFP_KERNEL); + logs = kzalloc_obj(*logs); if (!logs) { status = NVME_SC_INTERNAL; goto out; @@ -308,7 +308,7 @@ static void nvmet_execute_get_log_page_rmi(struct nvmet_req *req) goto out; } - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) goto out; @@ -334,7 +334,7 @@ static void nvmet_execute_get_log_page_smart(struct nvmet_req *req) if (req->transfer_len != sizeof(*log)) goto out; - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) goto out; @@ -409,7 +409,7 @@ static void nvmet_execute_get_log_cmd_effects_ns(struct nvmet_req *req) struct nvme_effects_log *log; u16 status = NVME_SC_SUCCESS; - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) { status = NVME_SC_INTERNAL; goto out; @@ -504,7 +504,7 @@ static void nvmet_execute_get_log_page_endgrp(struct nvmet_req *req) if (status) goto out; - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) { status = NVME_SC_INTERNAL; goto out; @@ -580,7 +580,7 @@ static void nvmet_execute_get_log_page_features(struct nvmet_req *req) struct nvme_supported_features_log *features; u16 status; - features = kzalloc_obj(*features, GFP_KERNEL); + features = kzalloc_obj(*features); if (!features) { status = NVME_SC_INTERNAL; goto out; @@ -659,7 +659,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req) mutex_unlock(&subsys->lock); } - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -808,7 +808,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req) goto out; } - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -1052,7 +1052,7 @@ static void nvme_execute_identify_ns_nvm(struct nvmet_req *req) if (status) goto out; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -1072,7 +1072,7 @@ static void nvmet_execute_id_cs_indep(struct nvmet_req *req) if (status) goto out; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index 6df2844dcec1..1cb21d74bb56 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -1040,7 +1040,7 @@ static int nvmet_port_subsys_allow_link(struct config_item *parent, return -EINVAL; } subsys = to_subsys(target); - link = kmalloc_obj(*link, GFP_KERNEL); + link = kmalloc_obj(*link); if (!link) return -ENOMEM; link->subsys = subsys; @@ -1120,7 +1120,7 @@ static int nvmet_allowed_hosts_allow_link(struct config_item *parent, } host = to_host(target); - link = kmalloc_obj(*link, GFP_KERNEL); + link = kmalloc_obj(*link); if (!link) return -ENOMEM; link->host = host; @@ -1825,7 +1825,7 @@ static struct config_group *nvmet_referral_make( { struct nvmet_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); @@ -1943,7 +1943,7 @@ static struct config_group *nvmet_ana_groups_make_group( goto out; ret = -ENOMEM; - grp = kzalloc_obj(*grp, GFP_KERNEL); + grp = kzalloc_obj(*grp); if (!grp) goto out; grp->port = port; @@ -2022,7 +2022,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group, if (kstrtou16(name, 0, &portid)) return ERR_PTR(-EINVAL); - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); @@ -2257,7 +2257,7 @@ static struct config_group *nvmet_hosts_make_group(struct config_group *group, { struct nvmet_host *host; - host = kzalloc_obj(*host, GFP_KERNEL); + host = kzalloc_obj(*host); if (!host) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 255a6c9b2548..efc1ad235318 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -194,7 +194,7 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type, { struct nvmet_async_event *aen; - aen = kmalloc_obj(*aen, GFP_KERNEL); + aen = kmalloc_obj(*aen); if (!aen) return; @@ -693,7 +693,7 @@ struct nvmet_ns *nvmet_ns_alloc(struct nvmet_subsys *subsys, u32 nsid) if (subsys->nr_namespaces == NVMET_MAX_NAMESPACES) goto out_unlock; - ns = kzalloc_obj(*ns, GFP_KERNEL); + ns = kzalloc_obj(*ns); if (!ns) goto out_unlock; @@ -1609,7 +1609,7 @@ struct nvmet_ctrl *nvmet_alloc_ctrl(struct nvmet_alloc_ctrl_args *args) up_read(&nvmet_config_sem); args->status = NVME_SC_INTERNAL; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) goto out_put_subsystem; mutex_init(&ctrl->lock); @@ -1828,7 +1828,7 @@ struct nvmet_subsys *nvmet_subsys_alloc(const char *subsysnqn, char serial[NVMET_SN_MAX_SIZE / 2]; int ret; - subsys = kzalloc_obj(*subsys, GFP_KERNEL); + subsys = kzalloc_obj(*subsys); if (!subsys) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c index 8a4a33f82177..e9b35549e254 100644 --- a/drivers/nvme/target/discovery.c +++ b/drivers/nvme/target/discovery.c @@ -263,7 +263,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req) goto out; } - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c index 5c0a1a3dd5b6..7cadd1c9e44c 100644 --- a/drivers/nvme/target/fabrics-cmd.c +++ b/drivers/nvme/target/fabrics-cmd.c @@ -280,7 +280,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) return; - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { args.status = NVME_SC_INTERNAL; goto complete; @@ -344,7 +344,7 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) return; - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { status = NVME_SC_INTERNAL; goto complete; diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 69ab0830313d..a867a16092ea 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1034,7 +1034,7 @@ nvmet_fc_alloc_hostport(struct nvmet_fc_tgtport *tgtport, void *hosthandle) if (match) return match; - newhost = kzalloc_obj(*newhost, GFP_KERNEL); + newhost = kzalloc_obj(*newhost); if (!newhost) return ERR_PTR(-ENOMEM); @@ -1116,7 +1116,7 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle) if (!tgtport->pe) return NULL; - assoc = kzalloc_obj(*assoc, GFP_KERNEL); + assoc = kzalloc_obj(*assoc); if (!assoc) return NULL; @@ -2717,7 +2717,7 @@ nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *target_port, spin_unlock_irqrestore(&queue->qlock, flags); /* Now we need to dynamically allocate one */ - deferfcp = kmalloc_obj(*deferfcp, GFP_KERNEL); + deferfcp = kmalloc_obj(*deferfcp); if (!deferfcp) { /* release the queue lookup reference */ nvmet_fc_tgt_q_put(queue); @@ -2882,7 +2882,7 @@ nvmet_fc_add_port(struct nvmet_port *port) if (ret) return ret; - pe = kzalloc_obj(*pe, GFP_KERNEL); + pe = kzalloc_obj(*pe); if (!pe) return -ENOMEM; diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index 8473e41e5856..866048f07e61 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -559,7 +559,7 @@ fcloop_tgt_discovery_evt(struct nvmet_fc_target_port *tgtport) { struct fcloop_rscn *tgt_rscn; - tgt_rscn = kzalloc_obj(*tgt_rscn, GFP_KERNEL); + tgt_rscn = kzalloc_obj(*tgt_rscn); if (!tgt_rscn) return; @@ -1194,11 +1194,11 @@ fcloop_create_local_port(struct device *dev, struct device_attribute *attr, unsigned long flags; int ret = -ENOMEM; - lport = kzalloc_obj(*lport, GFP_KERNEL); + lport = kzalloc_obj(*lport); if (!lport) return -ENOMEM; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) goto out_free_lport; @@ -1345,7 +1345,7 @@ fcloop_alloc_nport(const char *buf, size_t count, bool remoteport) u32 opts_mask = (remoteport) ? RPORT_OPTS : TGTPORT_OPTS; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return NULL; @@ -1357,7 +1357,7 @@ fcloop_alloc_nport(const char *buf, size_t count, bool remoteport) if ((opts->mask & opts_mask) != opts_mask) goto out_free_opts; - newnport = kzalloc_obj(*newnport, GFP_KERNEL); + newnport = kzalloc_obj(*newnport); if (!newnport) goto out_free_opts; diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index 6e810a91e6c5..0b22d183f927 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -228,7 +228,7 @@ static void nvmet_file_execute_rw(struct nvmet_req *req) } if (nr_bvec > NVMET_MAX_INLINE_BIOVEC) - req->f.bvec = kmalloc_objs(struct bio_vec, nr_bvec, GFP_KERNEL); + req->f.bvec = kmalloc_objs(struct bio_vec, nr_bvec); else req->f.bvec = req->inline_bvec; diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 575c5c31ea29..db09382c38f3 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -565,7 +565,7 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, struct nvme_loop_ctrl *ctrl; int ret; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return ERR_PTR(-ENOMEM); ctrl->ctrl.opts = opts; diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c index bac8b8f864ce..e27f84e3cf2b 100644 --- a/drivers/nvme/target/passthru.c +++ b/drivers/nvme/target/passthru.c @@ -86,7 +86,7 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req) unsigned int max_hw_sectors; int page_shift; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) return NVME_SC_INTERNAL; @@ -178,7 +178,7 @@ static u16 nvmet_passthru_override_id_ns(struct nvmet_req *req) struct nvme_id_ns *id; int i; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) return NVME_SC_INTERNAL; diff --git a/drivers/nvme/target/pr.c b/drivers/nvme/target/pr.c index 254960a844ac..c71ae46244ff 100644 --- a/drivers/nvme/target/pr.c +++ b/drivers/nvme/target/pr.c @@ -230,7 +230,7 @@ static u16 nvmet_pr_register(struct nvmet_req *req, u16 status = NVME_SC_SUCCESS; u64 nrkey = le64_to_cpu(d->nrkey); - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) return NVME_SC_INTERNAL; @@ -380,7 +380,7 @@ static void nvmet_execute_pr_register(struct nvmet_req *req) u8 reg_act = cdw10 & 0x07; /* Reservation Register Action, bit 02:00 */ u16 status; - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { status = NVME_SC_INTERNAL; goto out; @@ -662,7 +662,7 @@ static void nvmet_execute_pr_acquire(struct nvmet_req *req) goto out; } - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { status = NVME_SC_INTERNAL; goto out; @@ -773,7 +773,7 @@ static void nvmet_execute_pr_release(struct nvmet_req *req) goto out; } - d = kmalloc_obj(*d, GFP_KERNEL); + d = kmalloc_obj(*d); if (!d) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index ae2e27d9cc07..2d6eb89f98af 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -222,7 +222,7 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue) if (unlikely(!rsp)) { int ret; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (unlikely(!rsp)) return NULL; ret = nvmet_rdma_alloc_rsp(queue->dev, rsp, @@ -317,7 +317,7 @@ static int nvmet_rdma_alloc_cmd(struct nvmet_rdma_device *ndev, struct nvmet_rdma_cmd *c, bool admin) { /* NVMe command / RDMA RECV */ - c->nvme_cmd = kmalloc_obj(*c->nvme_cmd, GFP_KERNEL); + c->nvme_cmd = kmalloc_obj(*c->nvme_cmd); if (!c->nvme_cmd) goto out; @@ -367,7 +367,7 @@ nvmet_rdma_alloc_cmds(struct nvmet_rdma_device *ndev, struct nvmet_rdma_cmd *cmds; int ret = -EINVAL, i; - cmds = kvzalloc_objs(struct nvmet_rdma_cmd, nr_cmds, GFP_KERNEL); + cmds = kvzalloc_objs(struct nvmet_rdma_cmd, nr_cmds); if (!cmds) goto out; @@ -401,7 +401,7 @@ static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev, struct nvmet_rdma_rsp *r, int tag) { /* NVMe CQE / RDMA SEND */ - r->req.cqe = kmalloc_obj(*r->req.cqe, GFP_KERNEL); + r->req.cqe = kmalloc_obj(*r->req.cqe); if (!r->req.cqe) goto out; @@ -455,7 +455,7 @@ nvmet_rdma_alloc_rsps(struct nvmet_rdma_queue *queue) NUMA_NO_NODE, false, true)) goto out; - queue->rsps = kvzalloc_objs(struct nvmet_rdma_rsp, nr_rsps, GFP_KERNEL); + queue->rsps = kvzalloc_objs(struct nvmet_rdma_rsp, nr_rsps); if (!queue->rsps) goto out_free_sbitmap; @@ -1095,7 +1095,7 @@ nvmet_rdma_init_srq(struct nvmet_rdma_device *ndev) struct ib_srq *srq; int ret, i; - nsrq = kzalloc_obj(*nsrq, GFP_KERNEL); + nsrq = kzalloc_obj(*nsrq); if (!nsrq) return ERR_PTR(-ENOMEM); @@ -1154,7 +1154,7 @@ static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev) ndev->srq_count = min(ndev->device->num_comp_vectors, ndev->device->attrs.max_srq); - ndev->srqs = kzalloc_objs(*ndev->srqs, ndev->srq_count, GFP_KERNEL); + ndev->srqs = kzalloc_objs(*ndev->srqs, ndev->srq_count); if (!ndev->srqs) return -ENOMEM; @@ -1207,7 +1207,7 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id) goto out_unlock; } - ndev = kzalloc_obj(*ndev, GFP_KERNEL); + ndev = kzalloc_obj(*ndev); if (!ndev) goto out_err; @@ -1429,7 +1429,7 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev, struct nvmet_rdma_queue *queue; int ret; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) { ret = NVME_RDMA_CM_NO_RSC; goto out_reject; @@ -1923,7 +1923,7 @@ static int nvmet_rdma_add_port(struct nvmet_port *nport) __kernel_sa_family_t af; int ret; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index ac0a44bfa386..acc71a26733f 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -439,7 +439,7 @@ static int nvmet_tcp_map_data(struct nvmet_tcp_cmd *cmd) cmd->cur_sg = cmd->req.sg; if (nvmet_tcp_has_data_in(cmd)) { - cmd->iov = kmalloc_objs(*cmd->iov, cmd->req.sg_cnt, GFP_KERNEL); + cmd->iov = kmalloc_objs(*cmd->iov, cmd->req.sg_cnt); if (!cmd->iov) goto err; } @@ -1512,7 +1512,7 @@ static int nvmet_tcp_alloc_cmds(struct nvmet_tcp_queue *queue) struct nvmet_tcp_cmd *cmds; int i, ret = -EINVAL, nr_cmds = queue->nr_cmds; - cmds = kvzalloc_objs(struct nvmet_tcp_cmd, nr_cmds, GFP_KERNEL); + cmds = kvzalloc_objs(struct nvmet_tcp_cmd, nr_cmds); if (!cmds) goto out; @@ -1900,7 +1900,7 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port, struct file *sock_file = NULL; int ret; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) { ret = -ENOMEM; goto out_release; @@ -2036,7 +2036,7 @@ static int nvmet_tcp_add_port(struct nvmet_port *nport) __kernel_sa_family_t af; int ret; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c index e895f6b3a308..aeaf73b54c3a 100644 --- a/drivers/nvme/target/zns.c +++ b/drivers/nvme/target/zns.c @@ -73,7 +73,7 @@ void nvmet_execute_identify_ctrl_zns(struct nvmet_req *req) struct nvme_id_ctrl_zns *id; u16 status; - id = kzalloc_obj(*id, GFP_KERNEL); + id = kzalloc_obj(*id); if (!id) { status = NVME_SC_INTERNAL; goto out; @@ -104,7 +104,7 @@ void nvmet_execute_identify_ns_zns(struct nvmet_req *req) goto out; } - id_zns = kzalloc_obj(*id_zns, GFP_KERNEL); + id_zns = kzalloc_obj(*id_zns); if (!id_zns) { status = NVME_SC_INTERNAL; goto out; diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 2c838c0b2b7d..311cb2e5a5c0 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -650,7 +650,7 @@ int nvmem_add_one_cell(struct nvmem_device *nvmem, struct nvmem_cell_entry *cell; int rval; - cell = kzalloc_obj(*cell, GFP_KERNEL); + cell = kzalloc_obj(*cell); if (!cell) return -ENOMEM; @@ -908,7 +908,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (!config->reg_read && !config->reg_write) return ERR_PTR(-EINVAL); - nvmem = kzalloc_obj(*nvmem, GFP_KERNEL); + nvmem = kzalloc_obj(*nvmem); if (!nvmem) return ERR_PTR(-ENOMEM); @@ -1295,7 +1295,7 @@ static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry, struct nvmem_cell *cell; const char *name = NULL; - cell = kzalloc_obj(*cell, GFP_KERNEL); + cell = kzalloc_obj(*cell); if (!cell) return ERR_PTR(-ENOMEM); diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c index 13d5b9941059..b90584e1b99e 100644 --- a/drivers/nvmem/layouts.c +++ b/drivers/nvmem/layouts.c @@ -96,7 +96,7 @@ static int nvmem_layout_create_device(struct nvmem_device *nvmem, struct device *dev; int ret; - layout = kzalloc_obj(*layout, GFP_KERNEL); + layout = kzalloc_obj(*layout); if (!layout) return -ENOMEM; diff --git a/drivers/of/address.c b/drivers/of/address.c index 590d2db007d2..cf4aab11e9b1 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -929,7 +929,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) if (!num_ranges) return -EINVAL; - r = kzalloc_objs(*r, num_ranges + 1, GFP_KERNEL); + r = kzalloc_objs(*r, num_ranges + 1); if (!r) return -ENOMEM; diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 1b3cc351a895..1a06175def37 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -454,7 +454,7 @@ struct device_node *__of_node_dup(const struct device_node *np, { struct device_node *node; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; node->full_name = kstrdup(full_name, GFP_KERNEL); @@ -908,7 +908,7 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action, if (WARN_ON(action >= ARRAY_SIZE(action_names))) return -EINVAL; - ce = kzalloc_obj(*ce, GFP_KERNEL); + ce = kzalloc_obj(*ce); if (!ce) return -ENOMEM; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 55c2de65a13a..6367c67732d2 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -669,7 +669,7 @@ void __init of_irq_init(const struct of_device_id *matches) * Here, we allocate and populate an of_intc_desc with the node * pointer, interrupt-parent device_node etc. */ - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) { of_node_put(np); goto err; diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 0344c55300b6..1fd28f805610 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -646,7 +646,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, if (!rmem || !rmem->ops || !rmem->ops->device_init) return -EINVAL; - rd = kmalloc_obj(struct rmem_assigned_device, GFP_KERNEL); + rd = kmalloc_obj(struct rmem_assigned_device); if (!rd) return -ENOMEM; diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 87faec65c865..c1c5686fc7b1 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -248,7 +248,7 @@ static struct property *dup_and_fixup_symbol_prop( return NULL; target_path_len = strlen(target_path); - new_prop = kzalloc_obj(*new_prop, GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop); if (!new_prop) goto err_free_target_path; @@ -784,7 +784,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, of_node_put(node); } - fragments = kzalloc_objs(*fragments, cnt, GFP_KERNEL); + fragments = kzalloc_objs(*fragments, cnt); if (!fragments) { ret = -ENOMEM; goto err_out; @@ -1009,7 +1009,7 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, if (overlay_fdt_size < size) return -EINVAL; - ovcs = kzalloc_obj(*ovcs, GFP_KERNEL); + ovcs = kzalloc_obj(*ovcs); if (!ovcs) return -ENOMEM; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d9a717c47ad6..ba591fbceb56 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -111,7 +111,7 @@ struct platform_device *of_device_alloc(struct device_node *np, /* Populate the resource table */ if (num_reg) { - res = kzalloc_objs(*res, num_reg, GFP_KERNEL); + res = kzalloc_objs(*res, num_reg); if (!res) { platform_device_put(dev); return NULL; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a8b70b49e780..2940295843e6 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -197,7 +197,7 @@ static void __init of_unittest_dynamic(void) } /* Array of 4 properties for the purpose of testing */ - prop = kzalloc_objs(*prop, 4, GFP_KERNEL); + prop = kzalloc_objs(*prop, 4); if (!prop) { unittest(0, "kzalloc() failed\n"); return; @@ -379,7 +379,7 @@ static void __init of_unittest_check_phandles(void) } } - nh = kzalloc_obj(*nh, GFP_KERNEL); + nh = kzalloc_obj(*nh); if (!nh) return; @@ -1136,7 +1136,7 @@ static void __init of_unittest_dma_ranges_one(const char *path, dma_addr_t dma_addr; struct device *dev_bogus; - dev_bogus = kzalloc_obj(struct device, GFP_KERNEL); + dev_bogus = kzalloc_obj(struct device); if (!dev_bogus) { unittest(0, "kzalloc() failed\n"); kfree(map); @@ -2275,7 +2275,7 @@ static int unittest_gpio_probe(struct platform_device *pdev) unittest_gpio_probe_count++; - devptr = kzalloc_obj(*devptr, GFP_KERNEL); + devptr = kzalloc_obj(*devptr); if (!devptr) return -ENOMEM; diff --git a/drivers/opp/core.c b/drivers/opp/core.c index a109d4dd5316..98893b269679 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1532,7 +1532,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) * Allocate a new OPP table. In the infrequent case where a new * device is needed to be added, we pay this penalty. */ - opp_table = kzalloc_obj(*opp_table, GFP_KERNEL); + opp_table = kzalloc_obj(*opp_table); if (!opp_table) return ERR_PTR(-ENOMEM); @@ -2363,7 +2363,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, if (opp_table->clks) return 0; - opp_table->clks = kmalloc_objs(*opp_table->clks, count, GFP_KERNEL); + opp_table->clks = kmalloc_objs(*opp_table->clks, count); if (!opp_table->clks) return -ENOMEM; @@ -2548,7 +2548,7 @@ int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) unsigned int id; int ret; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c index 9ea7c323a8b9..0ea69c5c5001 100644 --- a/drivers/opp/cpu.c +++ b/drivers/opp/cpu.c @@ -51,7 +51,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, if (max_opps <= 0) return max_opps ? max_opps : -ENODATA; - freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1)); if (!freq_table) return -ENOMEM; diff --git a/drivers/opp/of.c b/drivers/opp/of.c index a6e16f406289..6ea3b1bd6280 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -470,7 +470,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev, } num_paths = count / 2; - paths = kzalloc_objs(*paths, num_paths, GFP_KERNEL); + paths = kzalloc_objs(*paths, num_paths); if (!paths) return -ENOMEM; diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c index b4281f85415b..406ba47e0f0b 100644 --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -127,7 +127,7 @@ static int _store_optimized_voltages(struct device *dev, goto out; } - table = kzalloc_objs(*data->vdd_table, data->num_vdd_table, GFP_KERNEL); + table = kzalloc_objs(*data->vdd_table, data->num_vdd_table); if (!table) { ret = -ENOMEM; goto out; diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 78bee83bcadd..d5b95e63c24e 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1520,7 +1520,7 @@ static int __init ccio_probe(struct parisc_device *dev) struct ioc *ioc, **ioc_p = &ioc_list; struct pci_hba_data *hba; - ioc = kzalloc_obj(struct ioc, GFP_KERNEL); + ioc = kzalloc_obj(struct ioc); if (ioc == NULL) { printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); return -ENOMEM; @@ -1550,7 +1550,7 @@ static int __init ccio_probe(struct parisc_device *dev) } hppa_dma_ops = &ccio_ops; - hba = kzalloc_obj(*hba, GFP_KERNEL); + hba = kzalloc_obj(*hba); /* if this fails, no I/O cards will work, so may as well bug */ BUG_ON(hba == NULL); diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 58c1f5433cbb..4b96d9fda49a 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -990,7 +990,7 @@ static int __init dino_probe(struct parisc_device *dev) */ } - dino_dev = kzalloc_obj(struct dino_device, GFP_KERNEL); + dino_dev = kzalloc_obj(struct dino_device); if (!dino_dev) { printk("dino_init_chip - couldn't alloc dino_device\n"); return 1; diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c index 88cca5035c67..e0a57086a8a8 100644 --- a/drivers/parisc/eisa_enumerator.c +++ b/drivers/parisc/eisa_enumerator.c @@ -86,7 +86,7 @@ static int configure_memory(const unsigned char *buf, for (i=0;iname = name; @@ -178,7 +178,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent, for (i=0;iname = board; res->start = get_16(buf+len+1); res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1; diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c index 72f9e7762cc5..33709eafe291 100644 --- a/drivers/parisc/hppb.c +++ b/drivers/parisc/hppb.c @@ -54,7 +54,7 @@ static int __init hppb_probe(struct parisc_device *dev) } if(card->hpa) { - card->next = kzalloc_obj(struct hppb_card, GFP_KERNEL); + card->next = kzalloc_obj(struct hppb_card); if(!card->next) { printk(KERN_ERR "HP-PB: Unable to allocate memory.\n"); return 1; diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index e8a60a1bfd43..cf629665db8e 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -221,7 +221,7 @@ static size_t irt_num_entry; static struct irt_entry *iosapic_alloc_irt(int num_entries) { - return kzalloc_objs(struct irt_entry, num_entries, GFP_KERNEL); + return kzalloc_objs(struct irt_entry, num_entries); } /** @@ -915,7 +915,7 @@ void *iosapic_register(unsigned long hpa, void __iomem *vaddr) return NULL; } - isi = kzalloc_obj(struct iosapic_info, GFP_KERNEL); + isi = kzalloc_obj(struct iosapic_info); if (!isi) { BUG(); return NULL; diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c index f9cb9bb3af77..ef6125d83878 100644 --- a/drivers/parisc/lasi.c +++ b/drivers/parisc/lasi.c @@ -162,7 +162,7 @@ static int __init lasi_init_chip(struct parisc_device *dev) struct gsc_asic *lasi; int ret; - lasi = kzalloc_obj(*lasi, GFP_KERNEL); + lasi = kzalloc_obj(*lasi); if (!lasi) return -ENOMEM; diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index c608854c2f0d..5197a3c93c70 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1025,11 +1025,11 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */ int i; - pa_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t, GFP_KERNEL); + pa_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t); if (!pa_pdc_cell) return; - io_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t, GFP_KERNEL); + io_pdc_cell = kzalloc_obj(pdc_pat_cell_mod_maddr_block_t); if (!io_pdc_cell) { kfree(pa_pdc_cell); return; @@ -1546,7 +1546,7 @@ lba_driver_probe(struct parisc_device *dev) ** have an IRT entry will get NULL back from iosapic code. */ - lba_dev = kzalloc_obj(struct lba_device, GFP_KERNEL); + lba_dev = kzalloc_obj(struct lba_device); if (!lba_dev) { printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n"); return(1); diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 9eadbfd70663..d9339dd50826 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -1939,7 +1939,7 @@ static int __init sba_driver_callback(struct parisc_device *dev) printk(KERN_INFO "%s found %s at 0x%llx\n", MODULE_NAME, version, (unsigned long long)dev->hpa.start); - sba_dev = kzalloc_obj(struct sba_device, GFP_KERNEL); + sba_dev = kzalloc_obj(struct sba_device); if (!sba_dev) { printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); return -ENOMEM; diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c index 94947be33bd0..a82a5e88ed6d 100644 --- a/drivers/parisc/wax.c +++ b/drivers/parisc/wax.c @@ -70,7 +70,7 @@ static int __init wax_init_chip(struct parisc_device *dev) struct parisc_device *parent; int ret; - wax = kzalloc_obj(*wax, GFP_KERNEL); + wax = kzalloc_obj(*wax); if (!wax) return -ENOMEM; diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 2e3b95ae2718..0f15c5de8df8 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -51,7 +51,7 @@ static int assign_addrs(struct parport *port); static void add_dev(int devnum, struct parport *port, int daisy) { struct daisydev *newdev, **p; - newdev = kmalloc_obj(struct daisydev, GFP_KERNEL); + newdev = kmalloc_obj(struct daisydev); if (newdev) { newdev->port = port; newdev->daisy = daisy; diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index f8318db9a75f..2c1c8253a00b 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -87,7 +87,7 @@ static int parport_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "parport_attach()\n"); /* Create new parport device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; link->priv = info; info->p_dev = link; diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index f442c1fb0d7a..e5e8054a1af8 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -234,7 +234,7 @@ static struct parport *parport_gsc_probe_port(unsigned long base, struct parport tmp; struct parport *p = &tmp; - priv = kzalloc_obj(struct parport_gsc_private, GFP_KERNEL); + priv = kzalloc_obj(struct parport_gsc_private); if (!priv) { printk(KERN_DEBUG "parport (0x%lx): no memory!\n", base); return NULL; diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c index 84c4bba2756e..14a4f4251d5c 100644 --- a/drivers/parport/parport_ip32.c +++ b/drivers/parport/parport_ip32.c @@ -2031,8 +2031,8 @@ static __init struct parport *parport_ip32_probe_port(void) parport_ip32_make_isa_registers(®s, &mace->isa.parallel, &mace->isa.ecp1284, 8 /* regshift */); - ops = kmalloc_obj(struct parport_operations, GFP_KERNEL); - priv = kmalloc_obj(struct parport_ip32_private, GFP_KERNEL); + ops = kmalloc_obj(struct parport_operations); + priv = kmalloc_obj(struct parport_ip32_private); p = parport_register_port(0, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, ops); if (ops == NULL || priv == NULL || p == NULL) { err = -ENOMEM; diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 99d44864b9ff..c75abdd8ef25 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -2056,11 +2056,11 @@ static struct parport *__parport_pc_probe_port(unsigned long int base, } } - ops = kmalloc_obj(struct parport_operations, GFP_KERNEL); + ops = kmalloc_obj(struct parport_operations); if (!ops) goto out1; - priv = kmalloc_obj(struct parport_pc_private, GFP_KERNEL); + priv = kmalloc_obj(struct parport_pc_private); if (!priv) goto out2; @@ -2880,7 +2880,7 @@ static int parport_pc_pci_probe(struct pci_dev *dev, if (err) return err; - data = kmalloc_obj(struct pci_parport_data, GFP_KERNEL); + data = kmalloc_obj(struct pci_parport_data); if (!data) return -ENOMEM; diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 44e5d37afbf8..ba5292828703 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -430,7 +430,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, int device; int ret; - tmp = kzalloc_obj(struct parport, GFP_KERNEL); + tmp = kzalloc_obj(struct parport); if (!tmp) return NULL; @@ -709,11 +709,11 @@ parport_register_dev_model(struct parport *port, const char *name, parport_get_port(port); - par_dev = kzalloc_obj(*par_dev, GFP_KERNEL); + par_dev = kzalloc_obj(*par_dev); if (!par_dev) goto err_put_port; - par_dev->state = kzalloc_obj(*par_dev->state, GFP_KERNEL); + par_dev->state = kzalloc_obj(*par_dev->state); if (!par_dev->state) goto err_put_par_dev; diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index e71aeecba11d..6c1ad1f542d9 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -65,7 +65,7 @@ void pci_bus_add_resource(struct pci_bus *bus, struct resource *res) { struct pci_bus_resource *bus_res; - bus_res = kzalloc_obj(struct pci_bus_resource, GFP_KERNEL); + bus_res = kzalloc_obj(struct pci_bus_resource); if (!bus_res) { dev_err(&bus->dev, "can't add %pR resource\n", res); return; diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 3f106bd9fe7e..2c7a406b4ba8 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -945,7 +945,7 @@ static int hv_pci_irqchip_init(void) struct irq_domain *irq_domain_parent = NULL; int ret = -ENOMEM; - chip_data = kzalloc_obj(*chip_data, GFP_KERNEL); + chip_data = kzalloc_obj(*chip_data); if (!chip_data) return ret; @@ -2592,7 +2592,7 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus, unsigned long flags; int ret; - hpdev = kzalloc_obj(*hpdev, GFP_KERNEL); + hpdev = kzalloc_obj(*hpdev); if (!hpdev) return NULL; @@ -3713,7 +3713,7 @@ static int hv_pci_probe(struct hv_device *hdev, if (!bridge) return -ENOMEM; - hbus = kzalloc_obj(*hbus, GFP_KERNEL); + hbus = kzalloc_obj(*hbus); if (!hbus) return -ENOMEM; diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 44bfe301b557..d4ae250d4bc6 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -270,7 +270,7 @@ static int vmd_msi_alloc(struct irq_domain *domain, unsigned int virq, struct vmd_irq *vmdirq; for (int i = 0; i < nr_irqs; ++i) { - vmdirq = kzalloc_obj(*vmdirq, GFP_KERNEL); + vmdirq = kzalloc_obj(*vmdirq); if (!vmdirq) { vmd_msi_free(domain, virq, i); return -ENOMEM; diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c index 811276ae9b13..7b41da4ec11a 100644 --- a/drivers/pci/doe.c +++ b/drivers/pci/doe.c @@ -167,7 +167,7 @@ static int pci_doe_sysfs_feature_populate(struct pci_dev *pdev, xa_for_each(&doe_mb->feats, i, entry) num_features++; - attrs = kzalloc_objs(*attrs, num_features, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, num_features); if (!attrs) { pci_warn(pdev, "Failed allocating the device_attribute array\n"); return -ENOMEM; @@ -641,7 +641,7 @@ static struct pci_doe_mb *pci_doe_create_mb(struct pci_dev *pdev, struct pci_doe_mb *doe_mb; int rc; - doe_mb = kzalloc_obj(*doe_mb, GFP_KERNEL); + doe_mb = kzalloc_obj(*doe_mb); if (!doe_mb) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c index 8c7559e73bb6..119de32ff07b 100644 --- a/drivers/pci/ecam.c +++ b/drivers/pci/ecam.c @@ -37,7 +37,7 @@ struct pci_config_window *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); @@ -75,7 +75,7 @@ struct pci_config_window *pci_ecam_create(struct device *dev, } if (per_bus_mapping) { - cfg->winp = kzalloc_objs(*cfg->winp, bus_range, GFP_KERNEL); + cfg->winp = kzalloc_objs(*cfg->winp, bus_range); if (!cfg->winp) goto err_exit_malloc; } else { diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index ccee5c6b6ad7..f9cf18aa5b34 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -525,7 +525,7 @@ static int pci_epf_mhi_edma_read_async(struct mhi_ep_cntrl *mhi_cntrl, goto err_unmap; } - transfer = kzalloc_obj(*transfer, GFP_KERNEL); + transfer = kzalloc_obj(*transfer); if (!transfer) { ret = -ENOMEM; goto err_unmap; @@ -604,7 +604,7 @@ static int pci_epf_mhi_edma_write_async(struct mhi_ep_cntrl *mhi_cntrl, goto err_unmap; } - transfer = kzalloc_obj(*transfer, GFP_KERNEL); + transfer = kzalloc_obj(*transfer); if (!transfer) { ret = -ENOMEM; goto err_unmap; diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 69f6ac37cdd0..582938b7b4f1 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -872,7 +872,7 @@ static void pci_epf_test_bar_subrange_setup(struct pci_epf_test *epf_test, sub_size = bar->size / nsub; - submap = kzalloc_objs(*submap, nsub, GFP_KERNEL); + submap = kzalloc_objs(*submap, nsub); if (!submap) goto err; diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c index 6c14cf85d336..0f3921f28f17 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -274,7 +274,7 @@ struct config_group *pci_ep_cfs_add_epc_group(const char *name) struct config_group *group; struct pci_epc_group *epc_group; - epc_group = kzalloc_obj(*epc_group, GFP_KERNEL); + epc_group = kzalloc_obj(*epc_group); if (!epc_group) { ret = -ENOMEM; goto err; @@ -599,7 +599,7 @@ static struct config_group *pci_epf_make(struct config_group *group, char *epf_name; int index, err; - epf_group = kzalloc_obj(*epf_group, GFP_KERNEL); + epf_group = kzalloc_obj(*epf_group); if (!epf_group) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/endpoint/pci-ep-msi.c b/drivers/pci/endpoint/pci-ep-msi.c index 4625dc9827bc..51c19942a81e 100644 --- a/drivers/pci/endpoint/pci-ep-msi.c +++ b/drivers/pci/endpoint/pci-ep-msi.c @@ -67,7 +67,7 @@ int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 num_db) dev_set_msi_domain(epc->dev.parent, domain); - msg = kzalloc_objs(struct pci_epf_doorbell_msg, num_db, GFP_KERNEL); + msg = kzalloc_objs(struct pci_epf_doorbell_msg, num_db); if (!msg) return -ENOMEM; diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index d6998e637d3c..e546b3dbb240 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -982,7 +982,7 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops, goto err_ret; } - epc = kzalloc_obj(*epc, GFP_KERNEL); + epc = kzalloc_obj(*epc); if (!epc) { ret = -ENOMEM; goto err_ret; diff --git a/drivers/pci/endpoint/pci-epc-mem.c b/drivers/pci/endpoint/pci-epc-mem.c index a3b5f8d1767c..6102a4af9d79 100644 --- a/drivers/pci/endpoint/pci-epc-mem.c +++ b/drivers/pci/endpoint/pci-epc-mem.c @@ -62,7 +62,7 @@ int pci_epc_multi_mem_init(struct pci_epc *epc, if (!windows || !num_windows) return -EINVAL; - epc->windows = kzalloc_objs(*epc->windows, num_windows, GFP_KERNEL); + epc->windows = kzalloc_objs(*epc->windows, num_windows); if (!epc->windows) return -ENOMEM; @@ -74,7 +74,7 @@ int pci_epc_multi_mem_init(struct pci_epc *epc, pages = windows[i].size >> page_shift; bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) { ret = -ENOMEM; i--; diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index c44f4ddfd60b..83fd20c11238 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -535,7 +535,7 @@ struct pci_epf *pci_epf_create(const char *name) struct device *dev; int len; - epf = kzalloc_obj(*epf, GFP_KERNEL); + epf = kzalloc_obj(*epf); if (!epf) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 051af60f999a..70c95166e509 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c @@ -260,7 +260,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot, int retval = -ENOMEM; char name[SLOT_NAME_SIZE]; - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) goto error; diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 55620e29b457..78e3effbb32d 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -60,7 +60,7 @@ static struct acpiphp_context *acpiphp_init_context(struct acpi_device *adev) { struct acpiphp_context *context; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return NULL; @@ -279,7 +279,7 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, if (slot->device == device) goto slot_found; - slot = kzalloc_obj(struct acpiphp_slot, GFP_KERNEL); + slot = kzalloc_obj(struct acpiphp_slot); if (!slot) { acpi_lock_hp_context(); acpiphp_put_context(context); @@ -869,7 +869,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) return; handle = adev->handle; - bridge = kzalloc_obj(struct acpiphp_bridge, GFP_KERNEL); + bridge = kzalloc_obj(struct acpiphp_bridge); if (!bridge) return; @@ -889,7 +889,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) if (pci_is_root_bus(bridge->pci_bus)) { struct acpiphp_root_context *root_context; - root_context = kzalloc_obj(*root_context, GFP_KERNEL); + root_context = kzalloc_obj(*root_context); if (!root_context) goto err; diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index f86e39e9dd68..f8016ed24523 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -141,7 +141,7 @@ static union apci_descriptor *ibm_slot_from_id(int id) ibm_slot_done: if (ret) { - ret = kmalloc_obj(union apci_descriptor, GFP_KERNEL); + ret = kmalloc_obj(union apci_descriptor); if (ret) memcpy(ret, des, sizeof(union apci_descriptor)); } diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 50793ca10526..e7cd801a2655 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -189,7 +189,7 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last) * with the pci_hotplug subsystem. */ for (i = first; i <= last; ++i) { - slot = kzalloc_obj(struct slot, GFP_KERNEL); + slot = kzalloc_obj(struct slot); if (!slot) { status = -ENOMEM; goto error; diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 158859352185..76e26b9a9f0d 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -593,7 +593,7 @@ static int ctrl_slot_setup(struct controller *ctrl, slot_number = ctrl->first_slot; while (number_of_slots) { - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) { result = -ENOMEM; goto error; @@ -822,7 +822,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_disable_device; } - ctrl = kzalloc_obj(struct controller, GFP_KERNEL); + ctrl = kzalloc_obj(struct controller); if (!ctrl) { rc = -ENOMEM; goto err_disable_device; diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 2c63bdc61306..040429028402 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -428,7 +428,7 @@ static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **h /* this one isn't an aligned length, so we'll make a new entry * and split it up. */ - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -553,7 +553,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -573,7 +573,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size /* this one is longer than we need * so we'll make a new entry and split it up */ - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -650,7 +650,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz if ((max->length - (temp_dword - max->base)) < size) continue; - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -668,7 +668,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz /* this one isn't end aligned properly at the top * so we'll make a new entry and split it up */ - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -747,7 +747,7 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -767,7 +767,7 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) /* this one is longer than we need * so we'll make a new entry and split it up */ - split_node = kmalloc_obj(*split_node, GFP_KERNEL); + split_node = kmalloc_obj(*split_node); if (!split_node) return NULL; @@ -955,7 +955,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) struct pci_func *new_slot; struct pci_func *next; - new_slot = kzalloc_obj(*new_slot, GFP_KERNEL); + new_slot = kzalloc_obj(*new_slot); if (new_slot == NULL) return new_slot; @@ -2435,10 +2435,10 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func /* Make copies of the nodes we are going to pass down so that * if there is a problem,we can just use these to free resources */ - hold_bus_node = kmalloc_obj(*hold_bus_node, GFP_KERNEL); - hold_IO_node = kmalloc_obj(*hold_IO_node, GFP_KERNEL); - hold_mem_node = kmalloc_obj(*hold_mem_node, GFP_KERNEL); - hold_p_mem_node = kmalloc_obj(*hold_p_mem_node, GFP_KERNEL); + hold_bus_node = kmalloc_obj(*hold_bus_node); + hold_IO_node = kmalloc_obj(*hold_IO_node); + hold_mem_node = kmalloc_obj(*hold_mem_node); + hold_p_mem_node = kmalloc_obj(*hold_p_mem_node); if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { kfree(hold_bus_node); diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 83c97f72ca3b..692d3cafa16d 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c @@ -504,7 +504,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) return 2; while (nummem--) { - mem_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); + mem_node = kmalloc_obj(struct pci_resource); if (!mem_node) break; @@ -561,7 +561,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) } while (numio--) { - io_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); + io_node = kmalloc_obj(struct pci_resource); if (!io_node) break; @@ -589,7 +589,7 @@ int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) } while (numbus--) { - bus_node = kmalloc_obj(struct pci_resource, GFP_KERNEL); + bus_node = kmalloc_obj(struct pci_resource); if (!bus_node) break; diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 03e2391f6786..4ccd5294c545 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c @@ -151,8 +151,8 @@ int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) struct pci_bus *fakebus; u16 temp_word; - fakedev = kmalloc_obj(*fakedev, GFP_KERNEL); - fakebus = kmalloc_obj(*fakebus, GFP_KERNEL); + fakedev = kmalloc_obj(*fakedev); + fakebus = kmalloc_obj(*fakebus); if (!fakedev || !fakebus) { kfree(fakedev); kfree(fakebus); @@ -721,7 +721,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); - bus_node = kmalloc_obj(*bus_node, GFP_KERNEL); + bus_node = kmalloc_obj(*bus_node); if (!bus_node) return -ENOMEM; @@ -736,7 +736,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length); if ((b_base <= b_length) && (save_command & 0x01)) { - io_node = kmalloc_obj(*io_node, GFP_KERNEL); + io_node = kmalloc_obj(*io_node); if (!io_node) return -ENOMEM; @@ -752,7 +752,7 @@ int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (save_command & 0x02)) { - mem_node = kmalloc_obj(*mem_node, GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node); if (!mem_node) return -ENOMEM; @@ -1294,7 +1294,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st temp_dword = io_base + io_length; if ((io_base) && (temp_dword < 0x10000)) { - io_node = kmalloc_obj(*io_node, GFP_KERNEL); + io_node = kmalloc_obj(*io_node); if (!io_node) return -ENOMEM; @@ -1316,7 +1316,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st /* If we've got a valid memory base, use it */ temp_dword = mem_base + mem_length; if ((mem_base) && (temp_dword < 0x10000)) { - mem_node = kmalloc_obj(*mem_node, GFP_KERNEL); + mem_node = kmalloc_obj(*mem_node); if (!mem_node) return -ENOMEM; @@ -1341,7 +1341,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st */ temp_dword = pre_mem_base + pre_mem_length; if ((pre_mem_base) && (temp_dword < 0x10000)) { - p_mem_node = kmalloc_obj(*p_mem_node, GFP_KERNEL); + p_mem_node = kmalloc_obj(*p_mem_node); if (!p_mem_node) return -ENOMEM; @@ -1366,7 +1366,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st * populated slots that don't have PCI-PCI bridges */ if (secondary_bus && (secondary_bus != primary_bus)) { - bus_node = kmalloc_obj(*bus_node, GFP_KERNEL); + bus_node = kmalloc_obj(*bus_node); if (!bus_node) return -ENOMEM; diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index 055fff069ce3..ca153c626942 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c @@ -134,7 +134,7 @@ static int open(struct inode *inode, struct file *file) int retval = -ENOMEM; mutex_lock(&cpqphp_mutex); - dbg = kmalloc_obj(*dbg, GFP_KERNEL); + dbg = kmalloc_obj(*dbg); if (!dbg) goto exit; dbg->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index af4e8b032093..aca86c092d4a 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -624,11 +624,11 @@ static u8 bus_structure_fixup(u8 busno) if (pci_find_bus(0, busno) || !(ibmphp_find_same_bus_num(busno))) return 1; - bus = kmalloc_obj(*bus, GFP_KERNEL); + bus = kmalloc_obj(*bus); if (!bus) return 1; - dev = kmalloc_obj(*dev, GFP_KERNEL); + dev = kmalloc_obj(*dev); if (!dev) { kfree(bus); return 1; @@ -986,7 +986,7 @@ static int enable_slot(struct hotplug_slot *hs) goto error_power; } - slot_cur->func = kzalloc_obj(struct pci_func, GFP_KERNEL); + slot_cur->func = kzalloc_obj(struct pci_func); if (!slot_cur->func) { /* do update_slot_info here? */ rc = -ENOMEM; @@ -1093,7 +1093,7 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) if (slot_cur->func == NULL) { /* We need this for functions that were there on bootup */ - slot_cur->func = kzalloc_obj(struct pci_func, GFP_KERNEL); + slot_cur->func = kzalloc_obj(struct pci_func); if (!slot_cur->func) { rc = -ENOMEM; goto error; @@ -1187,7 +1187,7 @@ static int __init ibmphp_init(void) info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); - ibmphp_pci_bus = kmalloc_obj(*ibmphp_pci_bus, GFP_KERNEL); + ibmphp_pci_bus = kmalloc_obj(*ibmphp_pci_bus); if (!ibmphp_pci_bus) { rc = -ENOMEM; goto exit; diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index bfd9f11c2d39..49575cb2a2dc 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c @@ -57,7 +57,7 @@ static int ebda_rio_table(void); static struct ebda_hpc_list * __init alloc_ebda_hpc_list(void) { - return kzalloc_obj(struct ebda_hpc_list, GFP_KERNEL); + return kzalloc_obj(struct ebda_hpc_list); } static struct controller *alloc_ebda_hpc(u32 slot_count, u32 bus_count) @@ -66,16 +66,16 @@ static struct controller *alloc_ebda_hpc(u32 slot_count, u32 bus_count) struct ebda_hpc_slot *slots; struct ebda_hpc_bus *buses; - controller = kzalloc_obj(struct controller, GFP_KERNEL); + controller = kzalloc_obj(struct controller); if (!controller) goto error; - slots = kzalloc_objs(struct ebda_hpc_slot, slot_count, GFP_KERNEL); + slots = kzalloc_objs(struct ebda_hpc_slot, slot_count); if (!slots) goto error_contr; controller->slots = slots; - buses = kzalloc_objs(struct ebda_hpc_bus, bus_count, GFP_KERNEL); + buses = kzalloc_objs(struct ebda_hpc_bus, bus_count); if (!buses) goto error_slots; controller->buses = buses; @@ -98,12 +98,12 @@ static void free_ebda_hpc(struct controller *controller) static struct ebda_rsrc_list * __init alloc_ebda_rsrc_list(void) { - return kzalloc_obj(struct ebda_rsrc_list, GFP_KERNEL); + return kzalloc_obj(struct ebda_rsrc_list); } static struct ebda_pci_rsrc *alloc_ebda_pci_rsrc(void) { - return kzalloc_obj(struct ebda_pci_rsrc, GFP_KERNEL); + return kzalloc_obj(struct ebda_pci_rsrc); } static void __init print_bus_info(void) @@ -409,7 +409,7 @@ static int __init ebda_rio_table(void) // we do concern about rio details for (i = 0; i < rio_table_ptr->riodev_count; i++) { - rio_detail_ptr = kzalloc_obj(struct rio_detail, GFP_KERNEL); + rio_detail_ptr = kzalloc_obj(struct rio_detail); if (!rio_detail_ptr) return -ENOMEM; rio_detail_ptr->rio_node_id = readb(io_mem + offset); @@ -462,7 +462,7 @@ static int __init combine_wpg_for_chassis(void) list_for_each_entry(rio_detail_ptr, &rio_vg_head, rio_detail_list) { opt_rio_ptr = search_opt_vg(rio_detail_ptr->chassis_num); if (!opt_rio_ptr) { - opt_rio_ptr = kzalloc_obj(struct opt_rio, GFP_KERNEL); + opt_rio_ptr = kzalloc_obj(struct opt_rio); if (!opt_rio_ptr) return -ENOMEM; opt_rio_ptr->rio_type = rio_detail_ptr->rio_type; @@ -843,7 +843,7 @@ static int __init ebda_rsrc_controller(void) // register slots with hpc core as well as create linked list of ibm slot for (index = 0; index < hpc_ptr->slot_count; index++) { - tmp_slot = kzalloc_obj(*tmp_slot, GFP_KERNEL); + tmp_slot = kzalloc_obj(*tmp_slot); if (!tmp_slot) { rc = -ENOMEM; goto error_no_slot; diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index f1ec9ada9faa..c4d28987af3f 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c @@ -816,7 +816,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_io = 1; } else { debug("it wants %x IO behind the bridge\n", amount_needed->io); - io = kzalloc_obj(*io, GFP_KERNEL); + io = kzalloc_obj(*io); if (!io) { retval = -ENOMEM; @@ -838,7 +838,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_mem = 1; } else { debug("it wants %x memory behind the bridge\n", amount_needed->mem); - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) { retval = -ENOMEM; goto error; @@ -859,7 +859,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) flag_pfmem = 1; } else { debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); - pfmem = kzalloc_obj(*pfmem, GFP_KERNEL); + pfmem = kzalloc_obj(*pfmem); if (!pfmem) { retval = -ENOMEM; goto error; @@ -873,7 +873,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ibmphp_add_resource(pfmem); flag_pfmem = 1; } else { - mem_tmp = kzalloc_obj(*mem_tmp, GFP_KERNEL); + mem_tmp = kzalloc_obj(*mem_tmp); if (!mem_tmp) { retval = -ENOMEM; goto error; @@ -903,7 +903,7 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) */ bus = ibmphp_find_res_bus(sec_number); if (!bus) { - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (!bus) { retval = -ENOMEM; goto error; @@ -1076,7 +1076,7 @@ static struct res_needed *scan_behind_bridge(struct pci_func *func, u8 busno) }; struct res_needed *amount; - amount = kzalloc_obj(*amount, GFP_KERNEL); + amount = kzalloc_obj(*amount); if (amount == NULL) return NULL; @@ -1630,7 +1630,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re list_add(&bus->bus_list, &cur_bus->bus_list); } if (io) { - io_range = kzalloc_obj(*io_range, GFP_KERNEL); + io_range = kzalloc_obj(*io_range); if (!io_range) return -ENOMEM; @@ -1641,7 +1641,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re bus->rangeIO = io_range; } if (mem) { - mem_range = kzalloc_obj(*mem_range, GFP_KERNEL); + mem_range = kzalloc_obj(*mem_range); if (!mem_range) return -ENOMEM; @@ -1652,7 +1652,7 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re bus->rangeMem = mem_range; } if (pfmem) { - pfmem_range = kzalloc_obj(*pfmem_range, GFP_KERNEL); + pfmem_range = kzalloc_obj(*pfmem_range); if (!pfmem_range) return -ENOMEM; diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c index c05a2c05e302..e52d4acd1310 100644 --- a/drivers/pci/hotplug/ibmphp_res.c +++ b/drivers/pci/hotplug/ibmphp_res.c @@ -41,7 +41,7 @@ static struct bus_node * __init alloc_error_bus(struct ebda_pci_rsrc *curr, u8 b return NULL; } - newbus = kzalloc_obj(struct bus_node, GFP_KERNEL); + newbus = kzalloc_obj(struct bus_node); if (!newbus) return NULL; @@ -62,7 +62,7 @@ static struct resource_node * __init alloc_resources(struct ebda_pci_rsrc *curr) return NULL; } - rs = kzalloc_obj(struct resource_node, GFP_KERNEL); + rs = kzalloc_obj(struct resource_node); if (!rs) return NULL; @@ -81,7 +81,7 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * u8 num_ranges = 0; if (first_bus) { - newbus = kzalloc_obj(struct bus_node, GFP_KERNEL); + newbus = kzalloc_obj(struct bus_node); if (!newbus) return -ENOMEM; @@ -101,7 +101,7 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * } } - newrange = kzalloc_obj(struct range_node, GFP_KERNEL); + newrange = kzalloc_obj(struct range_node); if (!newrange) { if (first_bus) kfree(newbus); diff --git a/drivers/pci/hotplug/octep_hp.c b/drivers/pci/hotplug/octep_hp.c index 109513822589..a0a7f9ccb8fa 100644 --- a/drivers/pci/hotplug/octep_hp.c +++ b/drivers/pci/hotplug/octep_hp.c @@ -136,7 +136,7 @@ octep_hp_register_slot(struct octep_hp_controller *hp_ctrl, struct octep_hp_slot *hp_slot; int ret; - hp_slot = kzalloc_obj(*hp_slot, GFP_KERNEL); + hp_slot = kzalloc_obj(*hp_slot); if (!hp_slot) return ERR_PTR(-ENOMEM); diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index b344ccb3cbc1..1e9158d7bac7 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -55,7 +55,7 @@ static int init_slot(struct controller *ctrl) int retval; /* Setup hotplug slot ops */ - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (!ops) return -ENOMEM; diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 33396ad0331c..4c62140a3cb4 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -1011,7 +1011,7 @@ struct controller *pcie_init(struct pcie_device *dev) struct pci_dev *pdev = dev->port; struct pci_bus *subordinate = pdev->subordinate; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return NULL; diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 4364f068fb72..5c020831e318 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -791,7 +791,7 @@ static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) if (!bus) return NULL; - php_slot = kzalloc_obj(*php_slot, GFP_KERNEL); + php_slot = kzalloc_obj(*php_slot); if (!php_slot) return NULL; diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 730a3d6c12ba..33ca19200c1b 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c @@ -32,7 +32,7 @@ struct slot *alloc_slot_struct(struct device_node *dn, { struct slot *slot; - slot = kzalloc_obj(struct slot, GFP_KERNEL); + slot = kzalloc_obj(struct slot); if (!slot) goto error_nomem; slot->name = kstrdup(drc_name, GFP_KERNEL); diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 13687b666f7a..8d6f8eea599d 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -66,7 +66,7 @@ static int init_slots(struct controller *ctrl) int i; for (i = 0; i < ctrl->num_slots; i++) { - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) { retval = -ENOMEM; goto error; @@ -259,7 +259,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (acpi_get_hp_hw_control_from_firmware(pdev)) return -ENODEV; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) goto err_out_none; diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 20526c1fa441..a10cdcdcbbdc 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c @@ -418,7 +418,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) struct slot *p_slot = container_of(work, struct slot, work.work); struct pushbutton_work_info *info; - info = kmalloc_obj(*info, GFP_KERNEL); + info = kmalloc_obj(*info); if (!info) { ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n", __func__); diff --git a/drivers/pci/ide.c b/drivers/pci/ide.c index 94c20f35f86f..be74e8f0ae21 100644 --- a/drivers/pci/ide.c +++ b/drivers/pci/ide.c @@ -258,7 +258,7 @@ struct pci_ide *pci_ide_stream_alloc(struct pci_dev *pdev) if (!pdev->ide_cap) return NULL; - struct pci_ide *ide __free(kfree) = kzalloc_obj(*ide, GFP_KERNEL); + struct pci_ide *ide __free(kfree) = kzalloc_obj(*ide); if (!ide) return NULL; diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 99b939f233be..91ac4e37ecb9 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -837,7 +837,7 @@ found: pgsz &= ~(pgsz - 1); pci_write_config_dword(dev, pos + PCI_SRIOV_SYS_PGSIZE, pgsz); - iov = kzalloc_obj(*iov, GFP_KERNEL); + iov = kzalloc_obj(*iov); if (!iov) return -ENOMEM; diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 492ec76da821..9f8eb5df279e 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -696,7 +696,7 @@ void of_pci_make_dev_node(struct pci_dev *pdev) if (!name) return; - cset = kmalloc_obj(*cset, GFP_KERNEL); + cset = kmalloc_obj(*cset); if (!cset) goto out_free_name; of_changeset_init(cset); @@ -784,7 +784,7 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge) if (!name) return; - cset = kmalloc_obj(*cset, GFP_KERNEL); + cset = kmalloc_obj(*cset); if (!cset) goto out_free_name; of_changeset_init(cset); diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c index 9011f890ebf3..75a358f73e69 100644 --- a/drivers/pci/of_property.c +++ b/drivers/pci/of_property.c @@ -119,7 +119,7 @@ static int of_pci_prop_ranges(struct pci_dev *pdev, struct of_changeset *ocs, res = &pdev->resource[PCI_STD_RESOURCES]; } - rp = kzalloc_objs(*rp, num, GFP_KERNEL); + rp = kzalloc_objs(*rp, num); if (!rp) return -ENOMEM; diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 4ab9800c22cc..e0f546166eb8 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -1006,7 +1006,7 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, struct scatterlist *sg; void *addr; - sg = kmalloc_obj(*sg, GFP_KERNEL); + sg = kmalloc_obj(*sg); if (!sg) return NULL; diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 854597fe4eab..4d0f2cb6c695 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -1663,11 +1663,11 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) struct acpi_pci_root_ops *root_ops; struct pci_host_bridge *host; - ri = kzalloc_obj(*ri, GFP_KERNEL); + ri = kzalloc_obj(*ri); if (!ri) return NULL; - root_ops = kzalloc_obj(*root_ops, GFP_KERNEL); + root_ops = kzalloc_obj(*root_ops); if (!root_ops) { kfree(ri); return NULL; diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 206d30324dfd..dd9075403987 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -58,7 +58,7 @@ int pci_add_dynid(struct pci_driver *drv, { struct pci_dynid *dynid; - dynid = kzalloc_obj(*dynid, GFP_KERNEL); + dynid = kzalloc_obj(*dynid); if (!dynid) return -ENOMEM; @@ -203,7 +203,7 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf, return -EINVAL; if (fields != 7) { - struct pci_dev *pdev = kzalloc_obj(*pdev, GFP_KERNEL); + struct pci_dev *pdev = kzalloc_obj(*pdev); if (!pdev) return -ENOMEM; diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 4aa21fe3b13e..8479c2e1f74f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2462,7 +2462,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) if (dev->pme_poll) { struct pci_pme_device *pme_dev; if (enable) { - pme_dev = kmalloc_obj(struct pci_pme_device, GFP_KERNEL); + pme_dev = kmalloc_obj(struct pci_pme_device); if (!pme_dev) { pci_warn(dev, "can't enable PME#\n"); return; diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 068594aa6878..d916378bc707 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -390,7 +390,7 @@ void pci_aer_init(struct pci_dev *dev) if (!dev->aer_cap) return; - dev->aer_info = kzalloc_obj(*dev->aer_info, GFP_KERNEL); + dev->aer_info = kzalloc_obj(*dev->aer_info); if (!dev->aer_info) { dev->aer_cap = 0; return; diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c index 9c8b2dc496b9..09bfc7194ef3 100644 --- a/drivers/pci/pcie/aer_inject.c +++ b/drivers/pci/pcie/aer_inject.c @@ -300,7 +300,7 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus) struct pci_bus_ops *bus_ops; unsigned long flags; - bus_ops = kmalloc_obj(*bus_ops, GFP_KERNEL); + bus_ops = kmalloc_obj(*bus_ops); if (!bus_ops) return -ENOMEM; ops = pci_bus_set_ops(bus, &aer_inj_pci_ops); @@ -360,12 +360,12 @@ static int aer_inject(struct aer_error_inj *einj) goto out_put; } - err_alloc = kzalloc_obj(struct aer_error, GFP_KERNEL); + err_alloc = kzalloc_obj(struct aer_error); if (!err_alloc) { ret = -ENOMEM; goto out_put; } - rperr_alloc = kzalloc_obj(struct aer_error, GFP_KERNEL); + rperr_alloc = kzalloc_obj(struct aer_error); if (!rperr_alloc) { ret = -ENOMEM; goto out_put; diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 83ea061f2eba..21f5d23e0b61 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1063,7 +1063,7 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) { struct pcie_link_state *link; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return NULL; diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index 050d814f6eac..4996cc4789f3 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -335,7 +335,7 @@ static int pcie_pme_probe(struct pcie_device *srv) type != PCI_EXP_TYPE_ROOT_PORT) return -ENODEV; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index f033acbd71a4..2d6aa488fe7b 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -293,7 +293,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq) struct pcie_device *pcie; struct device *device; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return -ENOMEM; pcie->port = pdev; diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index d8727369e6a5..91a598ed534c 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -537,7 +537,7 @@ struct pci_ptm_debugfs *pcie_ptm_create_debugfs(struct device *dev, void *pdata, return NULL; } - ptm_debugfs = kzalloc_obj(*ptm_debugfs, GFP_KERNEL); + ptm_debugfs = kzalloc_obj(*ptm_debugfs); if (!ptm_debugfs) return NULL; diff --git a/drivers/pci/pcie/rcec.c b/drivers/pci/pcie/rcec.c index 531cde54d747..2bf6d9d549ba 100644 --- a/drivers/pci/pcie/rcec.c +++ b/drivers/pci/pcie/rcec.c @@ -160,7 +160,7 @@ void pci_rcec_init(struct pci_dev *dev) if (!rcec) return; - rcec_ea = kzalloc_obj(*rcec_ea, GFP_KERNEL); + rcec_ea = kzalloc_obj(*rcec_ea); if (!rcec_ea) return; diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 013334b53bfb..bccc7a4bdd79 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -53,7 +53,7 @@ static struct resource *get_pci_domain_busn_res(int domain_nr) if (r->domain_nr == domain_nr) return &r->res; - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) return NULL; @@ -620,7 +620,7 @@ static struct pci_bus *pci_alloc_bus(struct pci_bus *parent) { struct pci_bus *b; - b = kzalloc_obj(*b, GFP_KERNEL); + b = kzalloc_obj(*b); if (!b) return NULL; @@ -2502,7 +2502,7 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus) { struct pci_dev *dev; - dev = kzalloc_obj(struct pci_dev, GFP_KERNEL); + dev = kzalloc_obj(struct pci_dev); if (!dev) return NULL; diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 53104f5c6378..ce36e35681e8 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -297,7 +297,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) static int proc_bus_pci_open(struct inode *inode, struct file *file) { - struct pci_filp_private *fpriv = kmalloc_obj(*fpriv, GFP_KERNEL); + struct pci_filp_private *fpriv = kmalloc_obj(*fpriv); if (!fpriv) return -ENOMEM; diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index b641f60a2aa5..61f769aaa2f6 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -73,7 +73,7 @@ int pci_dev_res_add_to_list(struct list_head *head, struct pci_dev *dev, { struct pci_dev_resource *tmp; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return -ENOMEM; @@ -350,7 +350,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head) continue; } - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) panic("%s: kzalloc() failed!\n", __func__); tmp->res = r; diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 15e98de7bdbe..787311614e5b 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c @@ -256,7 +256,7 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, } placeholder: - slot = kzalloc_obj(*slot, GFP_KERNEL); + slot = kzalloc_obj(*slot); if (!slot) { err = -ENOMEM; goto err; diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index c6e97d1af1a0..93ebec94b763 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -86,7 +86,7 @@ static struct switchtec_user *stuser_create(struct switchtec_dev *stdev) { struct switchtec_user *stuser; - stuser = kzalloc_obj(*stuser, GFP_KERNEL); + stuser = kzalloc_obj(*stuser); if (!stuser) return ERR_PTR(-ENOMEM); @@ -895,7 +895,7 @@ static int ioctl_event_summary(struct switchtec_dev *stdev, u32 reg; int ret = 0; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 21204da24e73..d9383bf541e7 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -735,7 +735,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) u16 cmd; /* Allocate structure */ - vgadev = kzalloc_obj(struct vga_device, GFP_KERNEL); + vgadev = kzalloc_obj(struct vga_device); if (vgadev == NULL) { vgaarb_err(&pdev->dev, "failed to allocate VGA arbiter data\n"); /* @@ -1385,7 +1385,7 @@ static int vga_arb_open(struct inode *inode, struct file *file) pr_debug("%s\n", __func__); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return -ENOMEM; spin_lock_init(&priv->lock); diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index bbb43539a2b0..b8aaa292c3e7 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -462,8 +462,8 @@ static int pcifront_scan_root(struct pcifront_device *pdev, dev_info(&pdev->xdev->dev, "Creating PCI Frontend Bus %04x:%02x\n", domain, bus); - bus_entry = kzalloc_obj(*bus_entry, GFP_KERNEL); - sd = kzalloc_obj(*sd, GFP_KERNEL); + bus_entry = kzalloc_obj(*bus_entry); + sd = kzalloc_obj(*sd); if (!bus_entry || !sd) { err = -ENOMEM; goto err_out; @@ -687,7 +687,7 @@ static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev) { struct pcifront_device *pdev; - pdev = kzalloc_obj(struct pcifront_device, GFP_KERNEL); + pdev = kzalloc_obj(struct pcifront_device); if (pdev == NULL) goto out; diff --git a/drivers/pcmcia/bcm63xx_pcmcia.c b/drivers/pcmcia/bcm63xx_pcmcia.c index cfb2a3724252..724fd6ee0fd0 100644 --- a/drivers/pcmcia/bcm63xx_pcmcia.c +++ b/drivers/pcmcia/bcm63xx_pcmcia.c @@ -333,7 +333,7 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev) int ret; int irq; - skt = kzalloc_obj(*skt, GFP_KERNEL); + skt = kzalloc_obj(*skt); if (!skt) return -ENOMEM; spin_lock_init(&skt->lock); diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index e22ebce496d5..d73ec3281b5e 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1393,12 +1393,12 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info) destroy_cis_cache(s); mutex_unlock(&s->ops_mutex); - tuple = kmalloc_obj(*tuple, GFP_KERNEL); + tuple = kmalloc_obj(*tuple); if (tuple == NULL) { dev_warn(&s->dev, "no memory to validate CIS\n"); return -ENOMEM; } - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (p == NULL) { kfree(tuple); dev_warn(&s->dev, "no memory to validate CIS\n"); @@ -1480,11 +1480,11 @@ static ssize_t pccard_extract_cis(struct pcmcia_socket *s, char *buf, u_char *tuplebuffer; u_char *tempbuffer; - tuplebuffer = kmalloc_objs(u_char, 256, GFP_KERNEL); + tuplebuffer = kmalloc_objs(u_char, 256); if (!tuplebuffer) return -ENOMEM; - tempbuffer = kmalloc_objs(u_char, 258, GFP_KERNEL); + tempbuffer = kmalloc_objs(u_char, 258); if (!tempbuffer) { ret = -ENOMEM; goto free_tuple; diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c index 5f80ad72566b..7b896d7dbc9f 100644 --- a/drivers/pcmcia/db1xxx_ss.c +++ b/drivers/pcmcia/db1xxx_ss.c @@ -427,7 +427,7 @@ static int db1x_pcmcia_socket_probe(struct platform_device *pdev) struct resource *r; int ret, bid; - sock = kzalloc_obj(struct db1x_pcmcia_sock, GFP_KERNEL); + sock = kzalloc_obj(struct db1x_pcmcia_sock); if (!sock) return -ENOMEM; diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 9c26aeb39dcf..cc9f74391cf1 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -108,7 +108,7 @@ new_id_store(struct device_driver *driver, const char *buf, size_t count) if (fields < 6) return -EINVAL; - dynid = kzalloc_obj(struct pcmcia_dynid, GFP_KERNEL); + dynid = kzalloc_obj(struct pcmcia_dynid); if (!dynid) return -ENOMEM; @@ -402,7 +402,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) cistpl_vers_1_t *vers1; unsigned int i; - vers1 = kmalloc_obj(*vers1, GFP_KERNEL); + vers1 = kmalloc_obj(*vers1); if (!vers1) return -ENOMEM; @@ -428,7 +428,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) * probably memory cards (from pcmcia-cs) */ cistpl_device_geo_t *devgeo; - devgeo = kmalloc_obj(*devgeo, GFP_KERNEL); + devgeo = kmalloc_obj(*devgeo); if (!devgeo) { kfree(vers1); return -ENOMEM; @@ -488,7 +488,7 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, pr_debug("adding device to %d, function %d\n", s->sock, function); - p_dev = kzalloc_obj(struct pcmcia_device, GFP_KERNEL); + p_dev = kzalloc_obj(struct pcmcia_device); if (!p_dev) goto err_put; @@ -542,7 +542,7 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, if (!p_dev->function_config) { config_t *c; dev_dbg(&p_dev->dev, "creating config_t\n"); - c = kzalloc_obj(struct config_t, GFP_KERNEL); + c = kzalloc_obj(struct config_t); if (!c) { mutex_unlock(&s->ops_mutex); goto err_unreg; diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index 05d78262e408..e9179d0ae234 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -190,7 +190,7 @@ static int electra_cf_probe(struct platform_device *ofdev) if (err) return -EINVAL; - cf = kzalloc_obj(*cf, GFP_KERNEL); + cf = kzalloc_obj(*cf); if (!cf) return -ENOMEM; diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index c43f15557906..49621074a47a 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -218,7 +218,7 @@ static int __init omap_cf_probe(struct platform_device *pdev) if (!res) return -EINVAL; - cf = kzalloc_obj(*cf, GFP_KERNEL); + cf = kzalloc_obj(*cf); if (!cf) return -ENOMEM; timer_setup(&cf->timer, omap_cf_timer, 0); diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c index f84ca5cde76b..0f474629229f 100644 --- a/drivers/pcmcia/pcmcia_cis.c +++ b/drivers/pcmcia/pcmcia_cis.c @@ -264,7 +264,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev, struct pcmcia_cfg_mem *cfg_mem; int ret; - cfg_mem = kzalloc_obj(struct pcmcia_cfg_mem, GFP_KERNEL); + cfg_mem = kzalloc_obj(struct pcmcia_cfg_mem); if (cfg_mem == NULL) return -ENOMEM; diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 3f4fc34d1b54..1b62ca30d08a 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -629,7 +629,7 @@ static int pd6729_pci_probe(struct pci_dev *dev, char configbyte; struct pd6729_socket *socket; - socket = kzalloc_objs(struct pd6729_socket, MAX_SOCKETS, GFP_KERNEL); + socket = kzalloc_objs(struct pd6729_socket, MAX_SOCKETS); if (!socket) { dev_warn(&dev->dev, "failed to kzalloc socket.\n"); return -ENOMEM; diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index f6606b772eff..25b12c585ecb 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -31,7 +31,7 @@ struct resource *pcmcia_make_resource(resource_size_t start, resource_size_t end, unsigned long flags, const char *name) { - struct resource *res = kzalloc_obj(*res, GFP_KERNEL); + struct resource *res = kzalloc_obj(*res); if (res) { res->name = name; diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index 3531d98e5bb1..0679dd434719 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -117,7 +117,7 @@ static int add_interval(struct resource_map *map, u_long base, u_long num) if ((p->next == map) || (p->next->base > base+num-1)) break; } - q = kmalloc_obj(struct resource_map, GFP_KERNEL); + q = kmalloc_obj(struct resource_map); if (!q) { printk(KERN_WARNING "out of memory to update resources\n"); return -ENOMEM; @@ -155,7 +155,7 @@ static int sub_interval(struct resource_map *map, u_long base, u_long num) q->num = base - q->base; } else { /* Split the block into two pieces */ - p = kmalloc_obj(struct resource_map, GFP_KERNEL); + p = kmalloc_obj(struct resource_map); if (!p) { printk(KERN_WARNING "out of memory to update resources\n"); return -ENOMEM; @@ -1022,7 +1022,7 @@ static int nonstatic_init(struct pcmcia_socket *s) { struct socket_data *data; - data = kzalloc_obj(struct socket_data, GFP_KERNEL); + data = kzalloc_obj(struct socket_data); if (!data) return -ENOMEM; diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index b0c08d8a43a8..55ea3ea6851b 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c @@ -153,7 +153,7 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ops->socket_state = sa1111_pcmcia_socket_state; for (i = 0; i < ops->nr; i++) { - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c index 2d7e674d86d6..8a8aae1843b5 100644 --- a/drivers/pcmcia/xxs1500_ss.c +++ b/drivers/pcmcia/xxs1500_ss.c @@ -212,7 +212,7 @@ static int xxs1500_pcmcia_probe(struct platform_device *pdev) struct resource *r; int ret, irq; - sock = kzalloc_obj(struct xxs1500_pcmcia_sock, GFP_KERNEL); + sock = kzalloc_obj(struct xxs1500_pcmcia_sock); if (!sock) return -ENOMEM; diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index ddff589bebc8..54dc1fee57aa 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1171,7 +1171,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENODEV; } - socket = kzalloc_obj(struct yenta_socket, GFP_KERNEL); + socket = kzalloc_obj(struct yenta_socket); if (!socket) return -ENOMEM; diff --git a/drivers/peci/core.c b/drivers/peci/core.c index f54341959769..e14995b1bf7f 100644 --- a/drivers/peci/core.c +++ b/drivers/peci/core.c @@ -52,7 +52,7 @@ static struct peci_controller *peci_controller_alloc(struct device *dev, if (!ops->xfer) return ERR_PTR(-EINVAL); - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) return ERR_PTR(-ENOMEM); diff --git a/drivers/peci/cpu.c b/drivers/peci/cpu.c index 050612e2d3ca..c9fc06c9ff53 100644 --- a/drivers/peci/cpu.c +++ b/drivers/peci/cpu.c @@ -199,7 +199,7 @@ static struct auxiliary_device *adev_alloc(struct peci_cpu *priv, int idx) const char *name; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/peci/device.c b/drivers/peci/device.c index ed4177b72f0e..2b9610216c8b 100644 --- a/drivers/peci/device.c +++ b/drivers/peci/device.c @@ -170,7 +170,7 @@ int peci_device_create(struct peci_controller *controller, u8 addr) return ret; } - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return -ENOMEM; diff --git a/drivers/peci/request.c b/drivers/peci/request.c index 437a59146dff..db2cc30a42a4 100644 --- a/drivers/peci/request.c +++ b/drivers/peci/request.c @@ -203,7 +203,7 @@ struct peci_request *peci_request_alloc(struct peci_device *device, u8 tx_len, u * should be converted to DMA API once support for controllers that do * allow it is added to avoid an extra copy. */ - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c index 3c5ec82f0454..ac49d3b2dad6 100644 --- a/drivers/perf/alibaba_uncore_drw_pmu.c +++ b/drivers/perf/alibaba_uncore_drw_pmu.c @@ -431,7 +431,7 @@ static struct ali_drw_pmu_irq *__ali_drw_pmu_init_irq(struct platform_device return irq; } - irq = kzalloc_obj(*irq, GFP_KERNEL); + irq = kzalloc_obj(*irq); if (!irq) return ERR_PTR(-ENOMEM); diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index dd87d29c395a..40c05c519a1d 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -1700,7 +1700,7 @@ static int arm_cmn_validate_group(struct arm_cmn *cmn, struct perf_event *event) if (event->pmu != leader->pmu && !is_software_event(leader)) return -EINVAL; - val = kzalloc_obj(*val, GFP_KERNEL); + val = kzalloc_obj(*val); if (!val) return -ENOMEM; diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 3354ef908a56..4f6b196160f8 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -432,7 +432,7 @@ static struct dmc620_pmu_irq *__dmc620_pmu_get_irq(int irq_num) if (irq->irq_num == irq_num && refcount_inc_not_zero(&irq->refcount)) return irq; - irq = kzalloc_obj(*irq, GFP_KERNEL); + irq = kzalloc_obj(*irq); if (!irq) return ERR_PTR(-ENOMEM); diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 5e7da5286d2c..939bcbd433aa 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -864,7 +864,7 @@ struct arm_pmu *armpmu_alloc(void) struct arm_pmu *pmu; int cpu; - pmu = kzalloc_obj(*pmu, GFP_KERNEL); + pmu = kzalloc_obj(*pmu); if (!pmu) goto out; diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index eca2955693dc..dbd0da111639 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -1020,7 +1020,7 @@ static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages, if (!buf) return NULL; - pglist = kzalloc_objs(*pglist, nr_pages, GFP_KERNEL); + pglist = kzalloc_objs(*pglist, nr_pages); if (!pglist) goto out_free_buf; diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c index ceb039306bb6..5385401fa9cf 100644 --- a/drivers/perf/dwc_pcie_pmu.c +++ b/drivers/perf/dwc_pcie_pmu.c @@ -649,7 +649,7 @@ static int dwc_pcie_register_dev(struct pci_dev *pdev) if (IS_ERR(plat_dev)) return PTR_ERR(plat_dev); - dev_info = kzalloc_obj(*dev_info, GFP_KERNEL); + dev_info = kzalloc_obj(*dev_info); if (!dev_info) { platform_device_unregister(plat_dev); return -ENOMEM; diff --git a/drivers/perf/riscv_pmu.c b/drivers/perf/riscv_pmu.c index e5e43899ea74..8e3cd0f35336 100644 --- a/drivers/perf/riscv_pmu.c +++ b/drivers/perf/riscv_pmu.c @@ -389,7 +389,7 @@ struct riscv_pmu *riscv_pmu_alloc(void) int cpuid, i; struct cpu_hw_events *cpuc; - pmu = kzalloc_obj(*pmu, GFP_KERNEL); + pmu = kzalloc_obj(*pmu); if (!pmu) goto out; diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 09acac7ae073..87e60297395b 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -873,7 +873,7 @@ static int pmu_sbi_get_ctrinfo(int nctr, unsigned long *mask) int i, num_hw_ctr = 0, num_fw_ctr = 0; union sbi_pmu_ctr_info cinfo; - pmu_ctr_list = kzalloc_objs(*pmu_ctr_list, nctr, GFP_KERNEL); + pmu_ctr_list = kzalloc_objs(*pmu_ctr_list, nctr); if (!pmu_ctr_list) return -ENOMEM; diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index b1b5ddd9e05e..21aaf2f76e53 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -75,7 +75,7 @@ int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id) if (!phy || !dev_id || !con_id) return -EINVAL; - pl = kzalloc_obj(*pl, GFP_KERNEL); + pl = kzalloc_obj(*pl); if (!pl) return -ENOMEM; @@ -1004,7 +1004,7 @@ struct phy *phy_create(struct device *dev, struct device_node *node, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - phy = kzalloc_obj(*phy, GFP_KERNEL); + phy = kzalloc_obj(*phy); if (!phy) return ERR_PTR(-ENOMEM); @@ -1174,7 +1174,7 @@ struct phy_provider *__of_phy_provider_register(struct device *dev, children = dev->of_node; } - phy_provider = kzalloc_obj(*phy_provider, GFP_KERNEL); + phy_provider = kzalloc_obj(*phy_provider); if (!phy_provider) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra124.c b/drivers/phy/tegra/xusb-tegra124.c index f180ef8a8829..70b6213370a8 100644 --- a/drivers/phy/tegra/xusb-tegra124.c +++ b/drivers/phy/tegra/xusb-tegra124.c @@ -430,7 +430,7 @@ tegra124_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -614,7 +614,7 @@ tegra124_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -679,7 +679,7 @@ tegra124_ulpi_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_ulpi_lane *ulpi; int err; - ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi); if (!ulpi) return ERR_PTR(-ENOMEM); @@ -751,7 +751,7 @@ tegra124_ulpi_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi); if (!ulpi) return ERR_PTR(-ENOMEM); @@ -815,7 +815,7 @@ tegra124_hsic_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_hsic_lane *hsic; int err; - hsic = kzalloc_obj(*hsic, GFP_KERNEL); + hsic = kzalloc_obj(*hsic); if (!hsic) return ERR_PTR(-ENOMEM); @@ -967,7 +967,7 @@ tegra124_hsic_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - hsic = kzalloc_obj(*hsic, GFP_KERNEL); + hsic = kzalloc_obj(*hsic); if (!hsic) return ERR_PTR(-ENOMEM); @@ -1035,7 +1035,7 @@ tegra124_pcie_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_pcie_lane *pcie; int err; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return ERR_PTR(-ENOMEM); @@ -1155,7 +1155,7 @@ tegra124_pcie_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return ERR_PTR(-ENOMEM); @@ -1213,7 +1213,7 @@ tegra124_sata_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_sata_lane *sata; int err; - sata = kzalloc_obj(*sata, GFP_KERNEL); + sata = kzalloc_obj(*sata); if (!sata) return ERR_PTR(-ENOMEM); @@ -1351,7 +1351,7 @@ tegra124_sata_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - sata = kzalloc_obj(*sata, GFP_KERNEL); + sata = kzalloc_obj(*sata); if (!sata) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c index eb643af34d68..1ddf11265974 100644 --- a/drivers/phy/tegra/xusb-tegra186.c +++ b/drivers/phy/tegra/xusb-tegra186.c @@ -302,7 +302,7 @@ tegra186_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -1031,7 +1031,7 @@ tegra186_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -1113,7 +1113,7 @@ tegra186_usb3_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb3_lane *usb3; int err; - usb3 = kzalloc_obj(*usb3, GFP_KERNEL); + usb3 = kzalloc_obj(*usb3); if (!usb3) return ERR_PTR(-ENOMEM); @@ -1417,7 +1417,7 @@ tegra186_usb3_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb3 = kzalloc_obj(*usb3, GFP_KERNEL); + usb3 = kzalloc_obj(*usb3); if (!usb3) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c index 872ae93e0722..1abc5913ec49 100644 --- a/drivers/phy/tegra/xusb-tegra210.c +++ b/drivers/phy/tegra/xusb-tegra210.c @@ -1759,7 +1759,7 @@ tegra210_usb2_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_usb2_lane *usb2; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -2185,7 +2185,7 @@ tegra210_usb2_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) return ERR_PTR(-ENOMEM); @@ -2255,7 +2255,7 @@ tegra210_hsic_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_hsic_lane *hsic; int err; - hsic = kzalloc_obj(*hsic, GFP_KERNEL); + hsic = kzalloc_obj(*hsic); if (!hsic) return ERR_PTR(-ENOMEM); @@ -2439,7 +2439,7 @@ tegra210_hsic_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - hsic = kzalloc_obj(*hsic, GFP_KERNEL); + hsic = kzalloc_obj(*hsic); if (!hsic) return ERR_PTR(-ENOMEM); @@ -2688,7 +2688,7 @@ tegra210_pcie_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_pcie_lane *pcie; int err; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return ERR_PTR(-ENOMEM); @@ -2786,7 +2786,7 @@ tegra210_pcie_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - pcie = kzalloc_obj(*pcie, GFP_KERNEL); + pcie = kzalloc_obj(*pcie); if (!pcie) return ERR_PTR(-ENOMEM); @@ -2858,7 +2858,7 @@ tegra210_sata_lane_probe(struct tegra_xusb_pad *pad, struct device_node *np, struct tegra_xusb_sata_lane *sata; int err; - sata = kzalloc_obj(*sata, GFP_KERNEL); + sata = kzalloc_obj(*sata); if (!sata) return ERR_PTR(-ENOMEM); @@ -2955,7 +2955,7 @@ tegra210_sata_pad_probe(struct tegra_xusb_padctl *padctl, struct tegra_xusb_pad *pad; int err; - sata = kzalloc_obj(*sata, GFP_KERNEL); + sata = kzalloc_obj(*sata); if (!sata) return ERR_PTR(-ENOMEM); diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 6667ac08754d..9d74c0ecc31b 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -796,7 +796,7 @@ static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - usb2 = kzalloc_obj(*usb2, GFP_KERNEL); + usb2 = kzalloc_obj(*usb2); if (!usb2) { err = -ENOMEM; goto out; @@ -863,7 +863,7 @@ static int tegra_xusb_add_ulpi_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi); if (!ulpi) { err = -ENOMEM; goto out; @@ -919,7 +919,7 @@ static int tegra_xusb_add_hsic_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - hsic = kzalloc_obj(*hsic, GFP_KERNEL); + hsic = kzalloc_obj(*hsic); if (!hsic) { err = -ENOMEM; goto out; @@ -1004,7 +1004,7 @@ static int tegra_xusb_add_usb3_port(struct tegra_xusb_padctl *padctl, if (!np || !of_device_is_available(np)) goto out; - usb3 = kzalloc_obj(*usb3, GFP_KERNEL); + usb3 = kzalloc_obj(*usb3); if (!usb3) { err = -ENOMEM; goto out; diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 8383c14035ef..17d39c2d454b 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -803,7 +803,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc, return -EINVAL; } - configs = kzalloc_obj(*configs, GFP_KERNEL); + configs = kzalloc_obj(*configs); if (!configs) return -ENOMEM; configs[0] = pinconf_to_config_packed(BCM2835_PINCONF_PARAM_PULL, pull); diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 3d728ed310f4..b5e97689589f 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -215,7 +215,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, return -EINVAL; } - pindesc = kzalloc_obj(*pindesc, GFP_KERNEL); + pindesc = kzalloc_obj(*pindesc); if (!pindesc) return -ENOMEM; @@ -955,7 +955,7 @@ static struct pinctrl_state *create_state(struct pinctrl *p, { struct pinctrl_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); @@ -983,7 +983,7 @@ static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev, if (map->type == PIN_MAP_TYPE_DUMMY_STATE) return 0; - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) return -ENOMEM; @@ -1063,7 +1063,7 @@ static struct pinctrl *create_pinctrl(struct device *dev, * mapping, this is what consumers will get when requesting * a pin control handle with pinctrl_get() */ - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return ERR_PTR(-ENOMEM); p->dev = dev; @@ -1483,7 +1483,7 @@ int pinctrl_register_mappings(const struct pinctrl_map *maps, } } - maps_node = kzalloc_obj(*maps_node, GFP_KERNEL); + maps_node = kzalloc_obj(*maps_node); if (!maps_node) return -ENOMEM; @@ -2076,7 +2076,7 @@ pinctrl_init_controller(const struct pinctrl_desc *pctldesc, struct device *dev, if (!pctldesc->name) return ERR_PTR(-EINVAL); - pctldev = kzalloc_obj(*pctldev, GFP_KERNEL); + pctldev = kzalloc_obj(*pctldev); if (!pctldev) return ERR_PTR(-ENOMEM); diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index ed3671f94463..d0c3e26409a8 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -84,7 +84,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename, } /* Remember the converted mapping table entries */ - dt_map = kzalloc_obj(*dt_map, GFP_KERNEL); + dt_map = kzalloc_obj(*dt_map); if (!dt_map) goto err_free_map; @@ -187,7 +187,7 @@ static int dt_remember_dummy_state(struct pinctrl *p, const char *statename) { struct pinctrl_map *map; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c index 9e3f29e8d993..e14bdbc7bea7 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c +++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c @@ -99,7 +99,7 @@ static int pinctrl_scmi_imx_dt_node_to_map(struct pinctrl_dev *pctldev, num_pins = size / pin_size; map_num = num_pins; - new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 1d892cbb59a6..9a45b376d36f 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -88,7 +88,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, } } - new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c index abffe09bdb83..b36c8a1461b7 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c +++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c @@ -244,7 +244,7 @@ static int imx1_dt_node_to_map(struct pinctrl_dev *pctldev, for (i = 0; i < grp->npins; i++) map_num++; - new_map = kmalloc_objs(struct pinctrl_map, map_num, GFP_KERNEL); + new_map = kmalloc_objs(struct pinctrl_map, map_num); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index e11697efeb47..6280009be3fa 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -92,7 +92,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, if (!purecfg && config) new_num = 2; - new_map = kzalloc_objs(*new_map, new_num, GFP_KERNEL); + new_map = kzalloc_objs(*new_map, new_num); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index 59fede73c31d..5ce3d7fcdd34 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c @@ -430,7 +430,7 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, return 0; } - *map = kmalloc_objs(**map, nmaps, GFP_KERNEL); + *map = kmalloc_objs(**map, nmaps); if (!*map) return -ENOMEM; diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvoton/pinctrl-ma35.c index 9bbf73de5747..f01344201628 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c +++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c @@ -202,7 +202,7 @@ static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev, } map_num += grp->grp.npins; - new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num); if (!new_map) return -ENOMEM; diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index e811803b7cc5..fe7cd641fddd 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -386,7 +386,7 @@ static int s32_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, return ret; /* Save current configuration */ - gpio_pin = kmalloc_obj(*gpio_pin, GFP_KERNEL); + gpio_pin = kmalloc_obj(*gpio_pin); if (!gpio_pin) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-k230.c b/drivers/pinctrl/pinctrl-k230.c index 8aeb540390c8..886577abf0d0 100644 --- a/drivers/pinctrl/pinctrl-k230.c +++ b/drivers/pinctrl/pinctrl-k230.c @@ -211,7 +211,7 @@ static int k230_dt_node_to_map(struct pinctrl_dev *pctldev, map_num += info->groups[grp_id].num_pins + 1; } - new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num); if (!new_map) return -ENOMEM; *map = new_map; diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 7e838a230cfe..d87c0b1de616 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -415,7 +415,7 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev, map_num += grp->npins; - new_map = kzalloc_objs(*new_map, map_num, GFP_KERNEL); + new_map = kzalloc_objs(*new_map, map_num); if (!new_map) return -ENOMEM; @@ -3604,7 +3604,7 @@ static int rockchip_pinconf_defer_pin(struct rockchip_pin_bank *bank, { struct rockchip_pin_deferred *cfg; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c index 15ac2a6625c6..fc4ed68ea5ac 100644 --- a/drivers/pinctrl/pinctrl-rp1.c +++ b/drivers/pinctrl/pinctrl-rp1.c @@ -1158,7 +1158,7 @@ static int rp1_pctl_legacy_map_pull(struct rp1_pinctrl *pc, return -EINVAL; } - configs = kzalloc_obj(*configs, GFP_KERNEL); + configs = kzalloc_obj(*configs); if (!configs) return -ENOMEM; @@ -1233,7 +1233,7 @@ static int rp1_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (num_configs || num_pulls) maps_per_pin++; reserved_maps = num_pins * maps_per_pin; - maps = kzalloc_objs(*maps, reserved_maps, GFP_KERNEL); + maps = kzalloc_objs(*maps, reserved_maps); if (!maps) return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 51434aa4d99f..f4f296e07be5 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -319,7 +319,7 @@ pinctrl_scmi_alloc_configs(struct pinctrl_dev *pctldev, u32 num_configs, if (!*p_config_value) return -ENOMEM; - *p_config_type = kzalloc_objs(**p_config_type, num_configs, GFP_KERNEL); + *p_config_type = kzalloc_objs(**p_config_type, num_configs); if (!*p_config_type) { kfree(*p_config_value); return -ENOMEM; diff --git a/drivers/pinctrl/pinctrl-th1520.c b/drivers/pinctrl/pinctrl-th1520.c index 3539c8b4d107..4d5a99483dee 100644 --- a/drivers/pinctrl/pinctrl-th1520.c +++ b/drivers/pinctrl/pinctrl-th1520.c @@ -447,7 +447,7 @@ static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, nmaps += npins; } - map = kzalloc_objs(*map, nmaps, GFP_KERNEL); + map = kzalloc_objs(*map, nmaps); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c index ec74bc54286b..0840668638d9 100644 --- a/drivers/pinctrl/renesas/core.c +++ b/drivers/pinctrl/renesas/core.c @@ -1273,7 +1273,7 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv) !of_find_matching_node(NULL, pdrv->driver.of_match_table)) return; - sh_pfc_regs = kzalloc_objs(*sh_pfc_regs, SH_PFC_MAX_REGS, GFP_KERNEL); + sh_pfc_regs = kzalloc_objs(*sh_pfc_regs, SH_PFC_MAX_REGS); if (!sh_pfc_regs) return; diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c index 3be4ee9d1419..bc8b9b9ad05b 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1062,7 +1062,7 @@ static int rza1_dt_node_to_map(struct pinctrl_dev *pctldev, /* Create map where to retrieve function and mux settings from */ *num_maps = 0; - *map = kzalloc_obj(**map, GFP_KERNEL); + *map = kzalloc_obj(**map); if (!*map) { ret = -ENOMEM; goto remove_function; diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c index 1d43abc14df7..8618f32ed26a 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -395,7 +395,7 @@ static int rza2_dt_node_to_map(struct pinctrl_dev *pctldev, /* Create map where to retrieve function and mux settings from */ *num_maps = 0; - *map = kzalloc_obj(**map, GFP_KERNEL); + *map = kzalloc_obj(**map); if (!*map) { ret = -ENOMEM; goto remove_function; diff --git a/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c b/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c index 5aef2a1082b5..4dfe16b66188 100644 --- a/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c +++ b/drivers/pinctrl/sophgo/pinctrl-sophgo-common.c @@ -94,7 +94,7 @@ int sophgo_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node if (!grpnames) return -ENOMEM; - map = kzalloc_objs(*map, ngroups * 2, GFP_KERNEL); + map = kzalloc_objs(*map, ngroups * 2); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/spacemit/pinctrl-k1.c b/drivers/pinctrl/spacemit/pinctrl-k1.c index 1b29313ab36d..62cab6f6cd0a 100644 --- a/drivers/pinctrl/spacemit/pinctrl-k1.c +++ b/drivers/pinctrl/spacemit/pinctrl-k1.c @@ -499,7 +499,7 @@ static int spacemit_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, if (!grpnames) return -ENOMEM; - map = kzalloc_objs(*map, ngroups * 2, GFP_KERNEL); + map = kzalloc_objs(*map, ngroups * 2); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index 5af70ec62a76..f92f6efde1dc 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c @@ -173,7 +173,7 @@ static int spear_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, return -ENODEV; } - *map = kzalloc_objs(**map, count, GFP_KERNEL); + *map = kzalloc_objs(**map, count); if (!*map) return -ENOMEM; diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c index a58c7e1362a9..25cb98d9c54e 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c @@ -517,7 +517,7 @@ static int starfive_dt_node_to_map(struct pinctrl_dev *pctldev, if (!pgnames) return -ENOMEM; - map = kzalloc_objs(*map, nmaps, GFP_KERNEL); + map = kzalloc_objs(*map, nmaps); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c index 6822a077d36f..e44480e71ea8 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c @@ -143,7 +143,7 @@ static int jh7110_dt_node_to_map(struct pinctrl_dev *pctldev, if (!pgnames) return -ENOMEM; - map = kzalloc_objs(*map, nmaps, GFP_KERNEL); + map = kzalloc_objs(*map, nmaps); if (!map) return -ENOMEM; diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c index 66575987f34b..67e036d66245 100644 --- a/drivers/pinctrl/sunplus/sppctl.c +++ b/drivers/pinctrl/sunplus/sppctl.c @@ -865,7 +865,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node if (nmG <= 0) nmG = 0; - *map = kzalloc_objs(**map, *num_maps + nmG, GFP_KERNEL); + *map = kzalloc_objs(**map, *num_maps + nmG); if (!(*map)) return -ENOMEM; @@ -882,7 +882,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node (*map)[i].type = PIN_MAP_TYPE_CONFIGS_PIN; (*map)[i].data.configs.num_configs = 1; (*map)[i].data.configs.group_or_pin = pin_get_name(pctldev, pin_num); - configs = kmalloc_obj(*configs, GFP_KERNEL); + configs = kmalloc_obj(*configs); if (!configs) goto sppctl_map_err; *configs = FIELD_GET(GENMASK(7, 0), dt_pin); @@ -897,7 +897,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node (*map)[i].type = PIN_MAP_TYPE_CONFIGS_PIN; (*map)[i].data.configs.num_configs = 1; (*map)[i].data.configs.group_or_pin = pin_get_name(pctldev, pin_num); - configs = kmalloc_obj(*configs, GFP_KERNEL); + configs = kmalloc_obj(*configs); if (!configs) goto sppctl_map_err; *configs = SPPCTL_IOP_CONFIGS; diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index c41b91a5371f..fc9167e784be 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -435,7 +435,7 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, * any configuration. */ nmaps = npins * 2; - *map = kmalloc_objs(struct pinctrl_map, nmaps, GFP_KERNEL); + *map = kmalloc_objs(struct pinctrl_map, nmaps); if (!*map) return -ENOMEM; diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index f67a675acd24..3da2f768f223 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c @@ -251,7 +251,7 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data, return group; } - configs = kzalloc_obj(*configs, GFP_KERNEL); + configs = kzalloc_obj(*configs); if (!configs) return -ENOMEM; diff --git a/drivers/platform/arm64/huawei-gaokun-ec.c b/drivers/platform/arm64/huawei-gaokun-ec.c index 23a727bb230c..a83ddc20b5a3 100644 --- a/drivers/platform/arm64/huawei-gaokun-ec.c +++ b/drivers/platform/arm64/huawei-gaokun-ec.c @@ -680,7 +680,7 @@ static int gaokun_aux_init(struct device *parent, const char *name, struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 7a019827afa5..042f8ca6a463 100644 --- a/drivers/platform/chrome/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c @@ -880,7 +880,7 @@ chromeos_laptop_prepare(const struct chromeos_laptop *src) struct chromeos_laptop *cros_laptop; int error; - cros_laptop = kzalloc_obj(*cros_laptop, GFP_KERNEL); + cros_laptop = kzalloc_obj(*cros_laptop); if (!cros_laptop) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/chrome/cros_ec_chardev.c b/drivers/platform/chrome/cros_ec_chardev.c index a2c919caa220..002be3352100 100644 --- a/drivers/platform/chrome/cros_ec_chardev.c +++ b/drivers/platform/chrome/cros_ec_chardev.c @@ -162,7 +162,7 @@ static int cros_ec_chardev_open(struct inode *inode, struct file *filp) struct chardev_priv *priv; int ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/platform/chrome/wilco_ec/event.c b/drivers/platform/chrome/wilco_ec/event.c index e7f85d6f29f1..3a7ef8e0e0f4 100644 --- a/drivers/platform/chrome/wilco_ec/event.c +++ b/drivers/platform/chrome/wilco_ec/event.c @@ -457,7 +457,7 @@ static int event_device_add(struct acpi_device *adev) return error; } - dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data); if (!dev_data) { error = -ENOMEM; goto free_minor; diff --git a/drivers/platform/chrome/wilco_ec/telemetry.c b/drivers/platform/chrome/wilco_ec/telemetry.c index 6375bbb6d6ce..cadb68fa0a40 100644 --- a/drivers/platform/chrome/wilco_ec/telemetry.c +++ b/drivers/platform/chrome/wilco_ec/telemetry.c @@ -248,7 +248,7 @@ static int telem_open(struct inode *inode, struct file *filp) get_device(&dev_data->dev); - sess_data = kzalloc_obj(*sess_data, GFP_KERNEL); + sess_data = kzalloc_obj(*sess_data); if (!sess_data) { atomic_set(&dev_data->available, 1); return -ENOMEM; @@ -370,7 +370,7 @@ static int telem_device_probe(struct platform_device *pdev) return error; } - dev_data = kzalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kzalloc_obj(*dev_data); if (!dev_data) { ida_free(&telem_ida, minor); return -ENOMEM; diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index 370259ef3bfe..75c86f5688c9 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -699,7 +699,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file) int status; /* Allocate new pipe kernel object */ - struct goldfish_pipe *pipe = kzalloc_obj(*pipe, GFP_KERNEL); + struct goldfish_pipe *pipe = kzalloc_obj(*pipe); if (!pipe) return -ENOMEM; @@ -826,7 +826,7 @@ static int goldfish_pipe_device_init(struct platform_device *pdev, dev->pdev_dev = &pdev->dev; dev->first_signalled_pipe = NULL; dev->pipes_capacity = INITIAL_PIPES_CAPACITY; - dev->pipes = kzalloc_objs(*dev->pipes, dev->pipes_capacity, GFP_KERNEL); + dev->pipes = kzalloc_objs(*dev->pipes, dev->pipes_capacity); if (!dev->pipes) { misc_deregister(&dev->miscdev); return -ENOMEM; diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c index 7fea80d3220c..3c6408581373 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -1203,7 +1203,7 @@ static int mlxbf_tmfifo_create_vdev(struct device *dev, goto fail; } - tm_vdev = kzalloc_obj(*tm_vdev, GFP_KERNEL); + tm_vdev = kzalloc_obj(*tm_vdev); if (!tm_vdev) { ret = -ENOMEM; goto fail; diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c index 6a6f94ee93f4..4a2d36f7331e 100644 --- a/drivers/platform/olpc/olpc-ec.c +++ b/drivers/platform/olpc/olpc-ec.c @@ -408,7 +408,7 @@ static int olpc_ec_probe(struct platform_device *pdev) if (!ec_driver) return -ENODEV; - ec = kzalloc_obj(*ec, GFP_KERNEL); + ec = kzalloc_obj(*ec); if (!ec) return -ENOMEM; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c index 1e72dc819e2a..e78641703252 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c @@ -358,7 +358,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance __func__, i); } - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) { ret = -ENOMEM; goto failed; @@ -618,7 +618,7 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl } } } else { - waiter = kzalloc_obj(*waiter, GFP_KERNEL); + waiter = kzalloc_obj(*waiter); if (!waiter) return -ENOMEM; } @@ -1249,7 +1249,7 @@ vchiq_dump_service_use_state(struct vchiq_state *state) if (!arm_state) return; - service_data = kmalloc_objs(*service_data, MAX_SERVICES, GFP_KERNEL); + service_data = kmalloc_objs(*service_data, MAX_SERVICES); if (!service_data) return; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c index 616e05a36918..011105f1318d 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_bus.c @@ -68,7 +68,7 @@ vchiq_device_register(struct device *parent, const char *name) struct vchiq_device *device; int ret; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) return NULL; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c index 1dac7d1ffaa2..48d6b1d74329 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_core.c @@ -2723,7 +2723,7 @@ vchiq_add_service_internal(struct vchiq_state *state, if (ret) return NULL; - service = kzalloc_obj(*service, GFP_KERNEL); + service = kzalloc_obj(*service); if (!service) return service; diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c index 18bcb8c133d1..f1c9c0d4b96a 100644 --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_dev.c @@ -149,7 +149,7 @@ static int vchiq_ioc_create_service(struct vchiq_instance *instance, if (args->is_open && !instance->connected) return -ENOTCONN; - user_service = kmalloc_obj(*user_service, GFP_KERNEL); + user_service = kmalloc_obj(*user_service); if (!user_service) return -ENOMEM; @@ -298,7 +298,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance, return -EINVAL; if (args->mode == VCHIQ_BULK_MODE_BLOCKING) { - waiter = kzalloc_obj(*waiter, GFP_KERNEL); + waiter = kzalloc_obj(*waiter); if (!waiter) { ret = -ENOMEM; goto out; @@ -1185,7 +1185,7 @@ static int vchiq_open(struct inode *inode, struct file *file) return -ENOTCONN; } - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) return -ENOMEM; diff --git a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c index 79790867c45c..c89c16fb8b33 100644 --- a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c +++ b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c @@ -190,7 +190,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) int handle; /* todo: should this be allocated from a pool to avoid kzalloc */ - msg_context = kzalloc_obj(*msg_context, GFP_KERNEL); + msg_context = kzalloc_obj(*msg_context); if (!msg_context) return ERR_PTR(-ENOMEM); @@ -1898,7 +1898,7 @@ int vchiq_mmal_init(struct device *dev, struct vchiq_mmal_instance **out_instanc goto err_shutdown_vchiq; } - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) { err = -ENOMEM; diff --git a/drivers/platform/surface/aggregator/bus.c b/drivers/platform/surface/aggregator/bus.c index dba8ca379385..4395331be659 100644 --- a/drivers/platform/surface/aggregator/bus.c +++ b/drivers/platform/surface/aggregator/bus.c @@ -83,7 +83,7 @@ struct ssam_device *ssam_device_alloc(struct ssam_controller *ctrl, { struct ssam_device *sdev; - sdev = kzalloc_obj(*sdev, GFP_KERNEL); + sdev = kzalloc_obj(*sdev); if (!sdev) return NULL; diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c index 5f1940a186a1..6a8430cb9cbf 100644 --- a/drivers/platform/surface/aggregator/controller.c +++ b/drivers/platform/surface/aggregator/controller.c @@ -344,7 +344,7 @@ ssam_nf_refcount_inc(struct ssam_nf *nf, struct ssam_event_registry reg, } } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c index 9349a1b14ab7..43d5988fb964 100644 --- a/drivers/platform/surface/aggregator/core.c +++ b/drivers/platform/surface/aggregator/core.c @@ -652,7 +652,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev) } /* Allocate controller. */ - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return -ENOMEM; diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c index b00f52687fa4..94fdddc7f207 100644 --- a/drivers/platform/surface/surface3_power.c +++ b/drivers/platform/surface/surface3_power.c @@ -454,7 +454,7 @@ static int mshw0011_install_space_handler(struct i2c_client *client) if (!adev) return -ENODEV; - data = kzalloc_obj(struct mshw0011_handler_data, GFP_KERNEL); + data = kzalloc_obj(struct mshw0011_handler_data); if (!data) return -ENOMEM; diff --git a/drivers/platform/surface/surface_aggregator_cdev.c b/drivers/platform/surface/surface_aggregator_cdev.c index 2e4746c700c8..8929937ba9dc 100644 --- a/drivers/platform/surface/surface_aggregator_cdev.c +++ b/drivers/platform/surface/surface_aggregator_cdev.c @@ -154,7 +154,7 @@ static int ssam_cdev_notifier_register(struct ssam_cdev_client *client, u8 tc, i } /* Allocate new notifier. */ - nf = kzalloc_obj(*nf, GFP_KERNEL); + nf = kzalloc_obj(*nf); if (!nf) { mutex_unlock(&client->notifier_lock); return -ENOMEM; @@ -685,7 +685,7 @@ static int ssam_dbg_device_probe(struct platform_device *pdev) if (IS_ERR(ctrl)) return PTR_ERR(ctrl) == -ENODEV ? -EPROBE_DEFER : PTR_ERR(ctrl); - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return -ENOMEM; diff --git a/drivers/platform/surface/surface_dtx.c b/drivers/platform/surface/surface_dtx.c index 43a8c23b2bf0..d6cd56970479 100644 --- a/drivers/platform/surface/surface_dtx.c +++ b/drivers/platform/surface/surface_dtx.c @@ -403,7 +403,7 @@ static int surface_dtx_open(struct inode *inode, struct file *file) struct sdtx_client *client; /* Initialize client. */ - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; @@ -1044,7 +1044,7 @@ static struct sdtx_device *sdtx_device_create(struct device *dev, struct ssam_co struct sdtx_device *ddev; int status; - ddev = kzalloc_obj(*ddev, GFP_KERNEL); + ddev = kzalloc_obj(*ddev); if (!ddev) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/surface/surfacepro3_button.c b/drivers/platform/surface/surfacepro3_button.c index 28386780177c..9bd39f09c7db 100644 --- a/drivers/platform/surface/surfacepro3_button.c +++ b/drivers/platform/surface/surfacepro3_button.c @@ -199,7 +199,7 @@ static int surface_button_add(struct acpi_device *device) if (!surface_button_check_MSHW0040(device)) return -ENODEV; - button = kzalloc_obj(struct surface_button, GFP_KERNEL); + button = kzalloc_obj(struct surface_button); if (!button) return -ENOMEM; diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c index de11edb40b04..b8e6b9a421c6 100644 --- a/drivers/platform/wmi/core.c +++ b/drivers/platform/wmi/core.c @@ -1296,7 +1296,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) continue; } - wblock = kzalloc_obj(*wblock, GFP_KERNEL); + wblock = kzalloc_obj(*wblock); if (!wblock) continue; diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 83f4e96ecbc7..fbc30f1f8abd 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -799,7 +799,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) return -ENODEV; } - gmux_data = kzalloc_obj(*gmux_data, GFP_KERNEL); + gmux_data = kzalloc_obj(*gmux_data); if (!gmux_data) return -ENOMEM; pnp_set_drvdata(pnp, gmux_data); diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 2b85315b7bd5..d96f6af26ff7 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1831,7 +1831,7 @@ static int asus_acpi_add(struct acpi_device *device) pr_notice("Asus Laptop Support version %s\n", ASUS_LAPTOP_VERSION); - asus = kzalloc_obj(struct asus_laptop, GFP_KERNEL); + asus = kzalloc_obj(struct asus_laptop); if (!asus) return -ENOMEM; asus->handle = device->handle; diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 93905860fe07..7c0915e097ba 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -5014,7 +5014,7 @@ static int asus_wmi_add(struct platform_device *pdev) int err; u32 result; - asus = kzalloc_obj(struct asus_wmi, GFP_KERNEL); + asus = kzalloc_obj(struct asus_wmi); if (!asus) return -ENOMEM; diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index bc9e26b94c84..e6eed3d65580 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c @@ -400,7 +400,7 @@ static int cmpc_accel_add_v4(struct acpi_device *acpi) struct input_dev *inputdev; struct cmpc_accel *accel; - accel = kmalloc_obj(*accel, GFP_KERNEL); + accel = kmalloc_obj(*accel); if (!accel) return -ENOMEM; @@ -650,7 +650,7 @@ static int cmpc_accel_add(struct acpi_device *acpi) struct input_dev *inputdev; struct cmpc_accel *accel; - accel = kmalloc_obj(*accel, GFP_KERNEL); + accel = kmalloc_obj(*accel); if (!accel) return -ENOMEM; @@ -964,7 +964,7 @@ static int cmpc_ipml_add(struct acpi_device *acpi) struct ipml200_dev *ipml; struct backlight_properties props; - ipml = kmalloc_obj(*ipml, GFP_KERNEL); + ipml = kmalloc_obj(*ipml); if (ipml == NULL) return -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c index dd011e252713..564ff5279797 100644 --- a/drivers/platform/x86/dell/dell-smbios-base.c +++ b/drivers/platform/x86/dell/dell-smbios-base.c @@ -495,7 +495,7 @@ static int build_tokens_sysfs(struct platform_device *dev) int ret; int i, j; - token_entries = kzalloc_objs(*token_entries, da_num_tokens, GFP_KERNEL); + token_entries = kzalloc_objs(*token_entries, da_num_tokens); if (!token_entries) return -ENOMEM; diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c index f2e63be75fb3..cdaa366b5e11 100644 --- a/drivers/platform/x86/dell/dell-wmi-base.c +++ b/drivers/platform/x86/dell/dell-wmi-base.c @@ -586,7 +586,7 @@ static void handle_dmi_entry(const struct dmi_header *dm, void *opaque) return; } - keymap = kzalloc_objs(struct key_entry, hotkey_num, GFP_KERNEL); + keymap = kzalloc_objs(struct key_entry, hotkey_num); if (!keymap) { results->err = -ENOMEM; return; @@ -769,7 +769,7 @@ static int dell_wmi_events_set_enabled(bool enable) struct calling_interface_buffer *buffer; int ret; - buffer = kzalloc_obj(struct calling_interface_buffer, GFP_KERNEL); + buffer = kzalloc_obj(struct calling_interface_buffer); if (!buffer) return -ENOMEM; buffer->cmd_class = CLASS_INFO; diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index 577949ee2e23..9dddab6c9397 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -460,7 +460,7 @@ static int init_bios_attributes(int attr_type, const char *guid) } /* build attribute */ - attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj); if (!attr_name_kobj) { retval = -ENOMEM; goto err_attr_init; diff --git a/drivers/platform/x86/dell/dell_rbu.c b/drivers/platform/x86/dell/dell_rbu.c index daf5df8cbafc..eb50f1d75d0c 100644 --- a/drivers/platform/x86/dell/dell_rbu.c +++ b/drivers/platform/x86/dell/dell_rbu.c @@ -111,7 +111,7 @@ static int create_packet(void *data, size_t length) __must_hold(&rbu_data.lock) spin_unlock(&rbu_data.lock); - newpacket = kzalloc_obj(struct packet_data, GFP_KERNEL); + newpacket = kzalloc_obj(struct packet_data); if (!newpacket) { pr_warn("failed to allocate new packet\n"); diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index e42045494b2c..974f55e0b36f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -1366,7 +1366,7 @@ static int eeepc_acpi_add(struct acpi_device *device) int result; pr_notice(EEEPC_LAPTOP_NAME "\n"); - eeepc = kzalloc_obj(struct eeepc_laptop, GFP_KERNEL); + eeepc = kzalloc_obj(struct eeepc_laptop); if (!eeepc) return -ENOMEM; eeepc->handle = device->handle; diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index bf3d409e5974..27fd6cd21529 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -588,7 +588,7 @@ static int hp_add_other_attributes(int attr_type) int ret; char *attr_name; - attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj); if (!attr_name_kobj) return -ENOMEM; @@ -711,7 +711,7 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type, } /* build attribute */ - attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj); if (!attr_name_kobj) { ret = -ENOMEM; goto pack_attr_exit; @@ -810,7 +810,7 @@ static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type, } /* build attribute */ - attr_name_kobj = kzalloc_obj(*attr_name_kobj, GFP_KERNEL); + attr_name_kobj = kzalloc_obj(*attr_name_kobj); if (!attr_name_kobj) { ret = -ENOMEM; goto buff_attr_exit; diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 64c5543f795d..93cca17fdf58 100644 --- a/drivers/platform/x86/huawei-wmi.c +++ b/drivers/platform/x86/huawei-wmi.c @@ -854,7 +854,7 @@ static __init int huawei_wmi_init(void) struct platform_device *pdev; int err; - huawei_wmi = kzalloc_obj(struct huawei_wmi, GFP_KERNEL); + huawei_wmi = kzalloc_obj(struct huawei_wmi); if (!huawei_wmi) return -ENOMEM; diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 1f4f84217d5e..3dafa28a1010 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -125,7 +125,7 @@ static int __init ifs_init(void) if (rdmsrq_safe(MSR_INTEGRITY_CAPS, &msrval)) return -ENODEV; - ifs_pkg_auth = kmalloc_objs(bool, topology_max_packages(), GFP_KERNEL); + ifs_pkg_auth = kmalloc_objs(bool, topology_max_packages()); if (!ifs_pkg_auth) return -ENOMEM; diff --git a/drivers/platform/x86/intel/int1092/intel_sar.c b/drivers/platform/x86/intel/int1092/intel_sar.c index 568a2722477b..fb26e5a26ffa 100644 --- a/drivers/platform/x86/intel/int1092/intel_sar.c +++ b/drivers/platform/x86/intel/int1092/intel_sar.c @@ -248,7 +248,7 @@ static int sar_probe(struct platform_device *device) int reg; int result; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return -ENOMEM; diff --git a/drivers/platform/x86/intel/pmc/pltdrv.c b/drivers/platform/x86/intel/pmc/pltdrv.c index 6fcf0f85a8d7..71ebb9ea1be2 100644 --- a/drivers/platform/x86/intel/pmc/pltdrv.c +++ b/drivers/platform/x86/intel/pmc/pltdrv.c @@ -65,7 +65,7 @@ static int __init pmc_core_platform_init(void) if (!x86_match_cpu(intel_pmc_core_platform_ids)) return -ENODEV; - pmc_core_device = kzalloc_obj(*pmc_core_device, GFP_KERNEL); + pmc_core_device = kzalloc_obj(*pmc_core_device); if (!pmc_core_device) return -ENOMEM; diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c index 2eee7389dcf9..a52803bfe124 100644 --- a/drivers/platform/x86/intel/pmt/telemetry.c +++ b/drivers/platform/x86/intel/pmt/telemetry.c @@ -107,7 +107,7 @@ static int pmt_telem_add_endpoint(struct intel_vsec_device *ivdev, struct telem_endpoint *ep; /* Endpoint lifetimes are managed by kref, not devres */ - entry->ep = kzalloc_obj(*(entry->ep), GFP_KERNEL); + entry->ep = kzalloc_obj(*(entry->ep)); if (!entry->ep) return -ENOMEM; diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index 33abff1dbe84..fa75eb77e0cb 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -89,7 +89,7 @@ static int isst_store_new_cmd(int cmd, u32 cpu, int mbox_cmd_type, u32 param, { struct isst_cmd *sst_cmd; - sst_cmd = kmalloc_obj(*sst_cmd, GFP_KERNEL); + sst_cmd = kmalloc_obj(*sst_cmd); if (!sst_cmd) return -ENOMEM; diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index 9242e29aac59..a38c278a792b 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -1603,7 +1603,7 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev) * devm_* allocation here as each partition is a * different device, which can be unbound. */ - tpmi_sst = kzalloc_obj(*tpmi_sst, GFP_KERNEL); + tpmi_sst = kzalloc_obj(*tpmi_sst); if (!tpmi_sst) { ret = -ENOMEM; goto unlock_exit; diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index b21a9cfabad4..5059d320edf8 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -299,11 +299,11 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he return -EINVAL; } - intel_vsec_dev = kzalloc_obj(*intel_vsec_dev, GFP_KERNEL); + intel_vsec_dev = kzalloc_obj(*intel_vsec_dev); if (!intel_vsec_dev) return -ENOMEM; - res = kzalloc_objs(*res, header->num_entries, GFP_KERNEL); + res = kzalloc_objs(*res, header->num_entries); if (!res) return -ENOMEM; diff --git a/drivers/platform/x86/intel/vsec_tpmi.c b/drivers/platform/x86/intel/vsec_tpmi.c index 9614fb8584f2..98846e88d3d0 100644 --- a/drivers/platform/x86/intel/vsec_tpmi.c +++ b/drivers/platform/x86/intel/vsec_tpmi.c @@ -622,11 +622,11 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, if (!name) return -EOPNOTSUPP; - res = kzalloc_objs(*res, pfs->pfs_header.num_entries, GFP_KERNEL); + res = kzalloc_objs(*res, pfs->pfs_header.num_entries); if (!res) return -ENOMEM; - feature_vsec_dev = kzalloc_obj(*feature_vsec_dev, GFP_KERNEL); + feature_vsec_dev = kzalloc_obj(*feature_vsec_dev); if (!feature_vsec_dev) { kfree(res); return -ENOMEM; diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 4412e7c2bce0..a2472ad10f37 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -573,7 +573,7 @@ __intel_scu_ipc_register(struct device *parent, if (ipcdev) return ERR_PTR(-EBUSY); - scu = kzalloc_obj(*scu, GFP_KERNEL); + scu = kzalloc_obj(*scu); if (!scu) return ERR_PTR(-ENOMEM); diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c index 59703574e8ce..ae1ebb071fab 100644 --- a/drivers/platform/x86/lenovo/ideapad-laptop.c +++ b/drivers/platform/x86/lenovo/ideapad-laptop.c @@ -1172,7 +1172,7 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv) return -ENODEV; } - priv->dytc = kzalloc_obj(*priv->dytc, GFP_KERNEL); + priv->dytc = kzalloc_obj(*priv->dytc); if (!priv->dytc) return -ENOMEM; diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c index a89f9436a795..e215e86e3db7 100644 --- a/drivers/platform/x86/lenovo/think-lmi.c +++ b/drivers/platform/x86/lenovo/think-lmi.c @@ -1593,7 +1593,7 @@ static struct tlmi_pwd_setting *tlmi_create_auth(const char *pwd_type, { struct tlmi_pwd_setting *new_pwd; - new_pwd = kzalloc_obj(struct tlmi_pwd_setting, GFP_KERNEL); + new_pwd = kzalloc_obj(struct tlmi_pwd_setting); if (!new_pwd) return NULL; @@ -1668,7 +1668,7 @@ static int tlmi_analyze(struct wmi_device *wdev) strreplace(item, ',', '\0'); /* Create a setting entry */ - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) { ret = -ENOMEM; kfree(item); diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 9a5b1d793cb9..f9c736777908 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -873,7 +873,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) BUG_ON(!ibm->acpi); - ibm->acpi->driver = kzalloc_obj(struct acpi_driver, GFP_KERNEL); + ibm->acpi->driver = kzalloc_obj(struct acpi_driver); if (!ibm->acpi->driver) { pr_err("failed to allocate memory for ibm->acpi->driver\n"); return -ENOMEM; @@ -1197,7 +1197,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, BUG_ON(id >= TPACPI_RFK_SW_MAX || tpacpi_rfkill_switches[id]); - atp_rfk = kzalloc_obj(struct tpacpi_rfk, GFP_KERNEL); + atp_rfk = kzalloc_obj(struct tpacpi_rfk); if (atp_rfk) atp_rfk->rfkill = rfkill_alloc(name, &tpacpi_pdev->dev, @@ -5817,7 +5817,7 @@ static int __init led_init(struct ibm_init_struct *iibm) if (led_supported == TPACPI_LED_NONE) return -ENODEV; - tpacpi_leds = kzalloc_objs(*tpacpi_leds, TPACPI_LED_NUMLEDS, GFP_KERNEL); + tpacpi_leds = kzalloc_objs(*tpacpi_leds, TPACPI_LED_NUMLEDS); if (!tpacpi_leds) { pr_err("Out of memory for LED data\n"); return -ENOMEM; diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 9990f6b920c5..d923ddaa4849 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -1017,7 +1017,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) */ num_sifr++; - pcc = kzalloc_obj(struct pcc_acpi, GFP_KERNEL); + pcc = kzalloc_obj(struct pcc_acpi); if (!pcc) { pr_err("Couldn't allocate mem for pcc"); return -ENOMEM; diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index 3b6edd709543..48c2a0e59d18 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -428,7 +428,7 @@ static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap, struct platform_device *clkdev; struct pmc_clk_data *clk_data; - clk_data = kzalloc_obj(*clk_data, GFP_KERNEL); + clk_data = kzalloc_obj(*clk_data); if (!clk_data) return -ENOMEM; diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 50e337a85135..710f3d5bf84c 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -1671,7 +1671,7 @@ static int __init samsung_init(void) if (!force && !dmi_check_system(samsung_dmi_table)) return -ENODEV; - samsung = kzalloc_obj(*samsung, GFP_KERNEL); + samsung = kzalloc_obj(*samsung); if (!samsung) return -ENOMEM; diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index a670473b20ab..477f56385e54 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -829,7 +829,7 @@ static int sony_nc_handles_setup(struct platform_device *pd) { int i, r, result, arg; - handles = kzalloc_obj(*handles, GFP_KERNEL); + handles = kzalloc_obj(*handles); if (!handles) return -ENOMEM; @@ -1902,7 +1902,7 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, } } - kbdbl_ctl = kzalloc_obj(*kbdbl_ctl, GFP_KERNEL); + kbdbl_ctl = kzalloc_obj(*kbdbl_ctl); if (!kbdbl_ctl) return -ENOMEM; @@ -2070,7 +2070,7 @@ static int sony_nc_battery_care_setup(struct platform_device *pd, { int ret = 0; - bcare_ctl = kzalloc_obj(struct battery_care_control, GFP_KERNEL); + bcare_ctl = kzalloc_obj(struct battery_care_control); if (!bcare_ctl) return -ENOMEM; @@ -2222,7 +2222,7 @@ static ssize_t sony_nc_thermal_mode_show(struct device *dev, static int sony_nc_thermal_setup(struct platform_device *pd) { int ret = 0; - th_handle = kzalloc_obj(struct snc_thermal_ctrl, GFP_KERNEL); + th_handle = kzalloc_obj(struct snc_thermal_ctrl); if (!th_handle) return -ENOMEM; @@ -2370,7 +2370,7 @@ static int sony_nc_lid_resume_setup(struct platform_device *pd, if (sony_call_snc_handle(handle, 0x0000, &result)) return -EIO; - lid_ctl = kzalloc_obj(struct snc_lid_resume_control, GFP_KERNEL); + lid_ctl = kzalloc_obj(struct snc_lid_resume_control); if (!lid_ctl) return -ENOMEM; @@ -2497,7 +2497,7 @@ static int sony_nc_gfx_switch_setup(struct platform_device *pd, { unsigned int result; - gfxs_ctl = kzalloc_obj(struct snc_gfx_switch_control, GFP_KERNEL); + gfxs_ctl = kzalloc_obj(struct snc_gfx_switch_control); if (!gfxs_ctl) return -ENOMEM; @@ -2576,7 +2576,7 @@ static int sony_nc_highspeed_charging_setup(struct platform_device *pd) return 0; } - hsc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + hsc_handle = kzalloc_obj(struct device_attribute); if (!hsc_handle) return -ENOMEM; @@ -2642,7 +2642,7 @@ static int sony_nc_lowbatt_setup(struct platform_device *pd) { unsigned int result; - lowbatt_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + lowbatt_handle = kzalloc_obj(struct device_attribute); if (!lowbatt_handle) return -ENOMEM; @@ -2719,11 +2719,11 @@ static int sony_nc_fanspeed_setup(struct platform_device *pd) { unsigned int result; - fan_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + fan_handle = kzalloc_obj(struct device_attribute); if (!fan_handle) return -ENOMEM; - hsf_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + hsf_handle = kzalloc_obj(struct device_attribute); if (!hsf_handle) { result = -ENOMEM; goto out_hsf_handle_alloc; @@ -2823,7 +2823,7 @@ static int sony_nc_usb_charge_setup(struct platform_device *pd) return 0; } - uc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + uc_handle = kzalloc_obj(struct device_attribute); if (!uc_handle) return -ENOMEM; @@ -2870,7 +2870,7 @@ static int sony_nc_panelid_setup(struct platform_device *pd) { unsigned int result; - panel_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + panel_handle = kzalloc_obj(struct device_attribute); if (!panel_handle) return -ENOMEM; @@ -2925,7 +2925,7 @@ static int sony_nc_smart_conn_setup(struct platform_device *pd) { unsigned int result; - sc_handle = kzalloc_obj(struct device_attribute, GFP_KERNEL); + sc_handle = kzalloc_obj(struct device_attribute); if (!sc_handle) return -ENOMEM; @@ -2999,7 +2999,7 @@ static int sony_nc_touchpad_setup(struct platform_device *pd, { int ret = 0; - tp_ctl = kzalloc_obj(struct touchpad_control, GFP_KERNEL); + tp_ctl = kzalloc_obj(struct touchpad_control); if (!tp_ctl) return -ENOMEM; @@ -4192,7 +4192,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) p->interrupts[i]); continue; } - interrupt = kzalloc_obj(*interrupt, GFP_KERNEL); + interrupt = kzalloc_obj(*interrupt); if (!interrupt) return AE_ERROR; diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c index 955021a0ffa4..a7b4b6c8e549 100644 --- a/drivers/platform/x86/topstar-laptop.c +++ b/drivers/platform/x86/topstar-laptop.c @@ -292,7 +292,7 @@ static int topstar_acpi_add(struct acpi_device *device) dmi_check_system(topstar_dmi_ids); - topstar = kzalloc_obj(struct topstar_laptop, GFP_KERNEL); + topstar = kzalloc_obj(struct topstar_laptop); if (!topstar) return -ENOMEM; diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 8e1773f44f64..18fb558115aa 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -3321,7 +3321,7 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) return -ENODEV; } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; dev->acpi_dev = acpi_dev; diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c index 6e71de0abca2..e587beef05b9 100644 --- a/drivers/platform/x86/toshiba_bluetooth.c +++ b/drivers/platform/x86/toshiba_bluetooth.c @@ -242,7 +242,7 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device) pr_info("Toshiba ACPI Bluetooth device driver\n"); - bt_dev = kzalloc_obj(*bt_dev, GFP_KERNEL); + bt_dev = kzalloc_obj(*bt_dev); if (!bt_dev) return -ENOMEM; bt_dev->acpi_dev = device; diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c index bad9c030295f..fee93537aa43 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -1293,7 +1293,7 @@ static int uniwill_add_battery(struct power_supply *battery, struct acpi_battery struct uniwill_battery_entry *entry; int ret; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index fa2e31151923..353f9c6ef214 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -242,14 +242,14 @@ static int uv_hubs_init(void) goto err_enum_objs; } - uv_hubs = kzalloc_objs(*uv_hubs, uv_bios_obj_cnt, GFP_KERNEL); + uv_hubs = kzalloc_objs(*uv_hubs, uv_bios_obj_cnt); if (!uv_hubs) { ret = -ENOMEM; goto err_enum_objs; } for (i = 0; i < uv_bios_obj_cnt; i++) { - uv_hubs[i] = kzalloc_obj(*uv_hubs[i], GFP_KERNEL); + uv_hubs[i] = kzalloc_obj(*uv_hubs[i]); if (!uv_hubs[i]) { i--; ret = -ENOMEM; @@ -368,7 +368,7 @@ static int uv_ports_init(void) s64 biosr; int j = 0, k = 0, ret, sz; - port_buf = kzalloc_objs(*port_buf, uv_bios_obj_cnt, GFP_KERNEL); + port_buf = kzalloc_objs(*port_buf, uv_bios_obj_cnt); if (!port_buf) return -ENOMEM; diff --git a/drivers/platform/x86/wireless-hotkey.c b/drivers/platform/x86/wireless-hotkey.c index bba55c634e2c..e5083c0e1515 100644 --- a/drivers/platform/x86/wireless-hotkey.c +++ b/drivers/platform/x86/wireless-hotkey.c @@ -91,7 +91,7 @@ static int wl_add(struct acpi_device *device) struct wl_button *button; int err; - button = kzalloc_obj(struct wl_button, GFP_KERNEL); + button = kzalloc_obj(struct wl_button); if (!button) return -ENOMEM; diff --git a/drivers/platform/x86/x86-android-tablets/core.c b/drivers/platform/x86/x86-android-tablets/core.c index 15a50ced6867..2656ecea2a2a 100644 --- a/drivers/platform/x86/x86-android-tablets/core.c +++ b/drivers/platform/x86/x86-android-tablets/core.c @@ -463,7 +463,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } } - spi_devs = kzalloc_objs(*spi_devs, dev_info->spi_dev_count, GFP_KERNEL); + spi_devs = kzalloc_objs(*spi_devs, dev_info->spi_dev_count); if (!spi_devs) { x86_android_tablet_remove(pdev); return -ENOMEM; @@ -479,7 +479,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } /* + 1 to make space for the (optional) gpio_keys_button platform device */ - pdevs = kzalloc_objs(*pdevs, dev_info->pdev_count + 1, GFP_KERNEL); + pdevs = kzalloc_objs(*pdevs, dev_info->pdev_count + 1); if (!pdevs) { x86_android_tablet_remove(pdev); return -ENOMEM; @@ -495,7 +495,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) } } - serdevs = kzalloc_objs(*serdevs, dev_info->serdev_count, GFP_KERNEL); + serdevs = kzalloc_objs(*serdevs, dev_info->serdev_count); if (!serdevs) { x86_android_tablet_remove(pdev); return -ENOMEM; diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c index 6bc5cd2abfab..4d1b1b310cc5 100644 --- a/drivers/platform/x86/xo15-ebook.c +++ b/drivers/platform/x86/xo15-ebook.c @@ -86,7 +86,7 @@ static int ebook_switch_add(struct acpi_device *device) struct input_dev *input; int error; - button = kzalloc_obj(struct ebook_switch, GFP_KERNEL); + button = kzalloc_obj(struct ebook_switch); if (!button) return -ENOMEM; diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index a324740b248b..52ea84e548ff 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -1811,7 +1811,7 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, if (ret) return ERR_PTR(ret); - gpd_data = kzalloc_obj(*gpd_data, GFP_KERNEL); + gpd_data = kzalloc_obj(*gpd_data); if (!gpd_data) { ret = -ENOMEM; goto err_put; @@ -1822,7 +1822,7 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, /* Allocate data used by a governor. */ if (has_governor) { - td = kzalloc_obj(*td, GFP_KERNEL); + td = kzalloc_obj(*td); if (!td) { ret = -ENOMEM; goto err_free; @@ -2161,7 +2161,7 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd, return -EINVAL; } - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; @@ -2269,7 +2269,7 @@ static int genpd_set_default_power_state(struct generic_pm_domain *genpd) { struct genpd_power_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; @@ -2295,7 +2295,7 @@ static int genpd_alloc_data(struct generic_pm_domain *genpd) return -ENOMEM; if (genpd->gov) { - gd = kzalloc_obj(*gd, GFP_KERNEL); + gd = kzalloc_obj(*gd); if (!gd) { ret = -ENOMEM; goto free; @@ -2623,7 +2623,7 @@ static int genpd_add_provider(struct device_node *np, genpd_xlate_t xlate, { struct of_genpd_provider *cp; - cp = kzalloc_obj(*cp, GFP_KERNEL); + cp = kzalloc_obj(*cp); if (!cp) return -ENOMEM; @@ -3316,7 +3316,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, return ERR_PTR(-ENODEV); /* Allocate and register device on the genpd bus. */ - virt_dev = kzalloc_obj(*virt_dev, GFP_KERNEL); + virt_dev = kzalloc_obj(*virt_dev); if (!virt_dev) return ERR_PTR(-ENOMEM); @@ -3474,7 +3474,7 @@ int of_genpd_parse_idle_states(struct device_node *dn, return 0; } - st = kzalloc_objs(*st, ret, GFP_KERNEL); + st = kzalloc_objs(*st, ret); if (!st) return -ENOMEM; diff --git a/drivers/pmdomain/renesas/rcar-gen4-sysc.c b/drivers/pmdomain/renesas/rcar-gen4-sysc.c index a62937a9a045..0c6c639a91d0 100644 --- a/drivers/pmdomain/renesas/rcar-gen4-sysc.c +++ b/drivers/pmdomain/renesas/rcar-gen4-sysc.c @@ -324,7 +324,7 @@ static int __init rcar_gen4_sysc_pd_init(void) rcar_gen4_sysc_base = base; - domains = kzalloc_obj(*domains, GFP_KERNEL); + domains = kzalloc_obj(*domains); if (!domains) { error = -ENOMEM; goto out_put; diff --git a/drivers/pmdomain/renesas/rcar-sysc.c b/drivers/pmdomain/renesas/rcar-sysc.c index aa5485876e0a..bd7bb9cbd9da 100644 --- a/drivers/pmdomain/renesas/rcar-sysc.c +++ b/drivers/pmdomain/renesas/rcar-sysc.c @@ -383,7 +383,7 @@ static int __init rcar_sysc_pd_init(void) rcar_sysc_extmask_offs = info->extmask_offs; rcar_sysc_extmask_val = info->extmask_val; - domains = kzalloc_obj(*domains, GFP_KERNEL); + domains = kzalloc_obj(*domains); if (!domains) { error = -ENOMEM; goto out_put; diff --git a/drivers/pmdomain/renesas/rmobile-sysc.c b/drivers/pmdomain/renesas/rmobile-sysc.c index 541f5739c13a..93103ff33d6e 100644 --- a/drivers/pmdomain/renesas/rmobile-sysc.c +++ b/drivers/pmdomain/renesas/rmobile-sysc.c @@ -277,7 +277,7 @@ static int __init rmobile_add_pm_domains(void __iomem *base, /* always-on domain */ } - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return -ENOMEM; diff --git a/drivers/pmdomain/st/ste-ux500-pm-domain.c b/drivers/pmdomain/st/ste-ux500-pm-domain.c index 45ea76b9c7f8..6896cb4a7b71 100644 --- a/drivers/pmdomain/st/ste-ux500-pm-domain.c +++ b/drivers/pmdomain/st/ste-ux500-pm-domain.c @@ -65,7 +65,7 @@ static int ux500_pm_domains_probe(struct platform_device *pdev) if (!np) return -ENODEV; - genpd_data = kzalloc_obj(*genpd_data, GFP_KERNEL); + genpd_data = kzalloc_obj(*genpd_data); if (!genpd_data) return -ENOMEM; diff --git a/drivers/pmdomain/tegra/powergate-bpmp.c b/drivers/pmdomain/tegra/powergate-bpmp.c index 43a46edd1ebc..8cde4f384846 100644 --- a/drivers/pmdomain/tegra/powergate-bpmp.c +++ b/drivers/pmdomain/tegra/powergate-bpmp.c @@ -226,7 +226,7 @@ tegra_bpmp_probe_powergates(struct tegra_bpmp *bpmp, dev_dbg(bpmp->dev, "maximum powergate ID: %u\n", max_id); - powergates = kzalloc_objs(*powergates, max_id + 1, GFP_KERNEL); + powergates = kzalloc_objs(*powergates, max_id + 1); if (!powergates) return -ENOMEM; @@ -260,7 +260,7 @@ static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp, unsigned int i; int err; - domains = kzalloc_objs(*domains, count, GFP_KERNEL); + domains = kzalloc_objs(*domains, count); if (!domains) return -ENOMEM; diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index 226a81cdb664..87f5af454751 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -80,7 +80,7 @@ static int card_probe(struct pnp_card *card, struct pnp_card_driver *drv) if (!id) return 0; - clink = kzalloc_obj(*clink, GFP_KERNEL); + clink = kzalloc_obj(*clink); if (!clink) return 0; clink->card = card; @@ -108,7 +108,7 @@ static struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id) { struct pnp_id *dev_id, *ptr; - dev_id = kzalloc_obj(struct pnp_id, GFP_KERNEL); + dev_id = kzalloc_obj(struct pnp_id); if (!dev_id) return NULL; @@ -159,7 +159,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp struct pnp_card *card; struct pnp_id *dev_id; - card = kzalloc_obj(struct pnp_card, GFP_KERNEL); + card = kzalloc_obj(struct pnp_card); if (!card) return NULL; diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 768388ddaeca..81603327079c 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -122,7 +122,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, struct pnp_dev *dev; struct pnp_id *dev_id; - dev = kzalloc_obj(struct pnp_dev, GFP_KERNEL); + dev = kzalloc_obj(struct pnp_dev); if (!dev) return NULL; diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 731a37002811..6d58b1465081 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -315,7 +315,7 @@ struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id) { struct pnp_id *dev_id, *ptr; - dev_id = kzalloc_obj(struct pnp_id, GFP_KERNEL); + dev_id = kzalloc_obj(struct pnp_id); if (!dev_id) return NULL; diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 108f7c63ddc5..9303fef72df0 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -214,7 +214,7 @@ static ssize_t options_show(struct device *dmdev, struct device_attribute *attr, int ret, dep = 0, set = 0; char *indent; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return -ENOMEM; @@ -257,7 +257,7 @@ static ssize_t resources_show(struct device *dmdev, if (!dev) return -EINVAL; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return -ENOMEM; diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 2afa17c39628..7aaecd137d31 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -29,7 +29,7 @@ static void quirk_awe32_add_ports(struct pnp_dev *dev, { struct pnp_option *new_option; - new_option = kmalloc_obj(struct pnp_option, GFP_KERNEL); + new_option = kmalloc_obj(struct pnp_option); if (!new_option) { dev_err(&dev->dev, "couldn't add ioport region to option set " "%d\n", pnp_option_set(option)); @@ -155,7 +155,7 @@ static struct pnp_option *pnp_clone_dependent_set(struct pnp_dev *dev, list_for_each_entry(option, &dev->options, list) { if (pnp_option_is_dependent(option) && pnp_option_set(option) == set) { - new_option = kmalloc_obj(struct pnp_option, GFP_KERNEL); + new_option = kmalloc_obj(struct pnp_option); if (!new_option) { dev_err(&dev->dev, "couldn't clone dependent " "set %d\n", set); diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index f62544ec5a1f..6792bd023123 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -38,7 +38,7 @@ static struct pnp_option *pnp_build_option(struct pnp_dev *dev, unsigned long ty { struct pnp_option *option; - option = kzalloc_obj(struct pnp_option, GFP_KERNEL); + option = kzalloc_obj(struct pnp_option); if (!option) return NULL; @@ -499,7 +499,7 @@ static struct pnp_resource *pnp_new_resource(struct pnp_dev *dev) { struct pnp_resource *pnp_res; - pnp_res = kzalloc_obj(struct pnp_resource, GFP_KERNEL); + pnp_res = kzalloc_obj(struct pnp_resource); if (!pnp_res) return NULL; diff --git a/drivers/power/sequencing/core.c b/drivers/power/sequencing/core.c index 666bcfd3c655..4dff71be11b6 100644 --- a/drivers/power/sequencing/core.c +++ b/drivers/power/sequencing/core.c @@ -90,7 +90,7 @@ static struct pwrseq_unit *pwrseq_unit_new(const struct pwrseq_unit_data *data) { struct pwrseq_unit *unit; - unit = kzalloc_obj(*unit, GFP_KERNEL); + unit = kzalloc_obj(*unit); if (!unit) return NULL; @@ -138,7 +138,7 @@ static struct pwrseq_unit_dep *pwrseq_unit_dep_new(struct pwrseq_unit *unit) { struct pwrseq_unit_dep *dep; - dep = kzalloc_obj(*dep, GFP_KERNEL); + dep = kzalloc_obj(*dep); if (!dep) return NULL; @@ -195,7 +195,7 @@ pwrseq_target_new(const struct pwrseq_target_data *data) { struct pwrseq_target *target; - target = kzalloc_obj(*target, GFP_KERNEL); + target = kzalloc_obj(*target); if (!target) return NULL; @@ -669,7 +669,7 @@ struct pwrseq_desc *pwrseq_get(struct device *dev, const char *target) struct pwrseq_match_data match_data; int ret; - struct pwrseq_desc *desc __free(kfree) = kzalloc_obj(*desc, GFP_KERNEL); + struct pwrseq_desc *desc __free(kfree) = kzalloc_obj(*desc); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/power/sequencing/pwrseq-thead-gpu.c b/drivers/power/sequencing/pwrseq-thead-gpu.c index ce32201f5a21..a45318b4b2c1 100644 --- a/drivers/power/sequencing/pwrseq-thead-gpu.c +++ b/drivers/power/sequencing/pwrseq-thead-gpu.c @@ -145,7 +145,7 @@ static int pwrseq_thead_gpu_match(struct pwrseq_device *pwrseq, PWRSEQ_MATCH_OK : PWRSEQ_NO_MATCH; ctx->num_clks = ARRAY_SIZE(clk_names); - ctx->clks = kzalloc_objs(*ctx->clks, ctx->num_clks, GFP_KERNEL); + ctx->clks = kzalloc_objs(*ctx->clks, ctx->num_clks); if (!ctx->clks) return -ENOMEM; diff --git a/drivers/power/supply/pmu_battery.c b/drivers/power/supply/pmu_battery.c index 054f75d904a8..b5ffe2da14dc 100644 --- a/drivers/power/supply/pmu_battery.c +++ b/drivers/power/supply/pmu_battery.c @@ -160,7 +160,7 @@ static int __init pmu_bat_init(void) for (i = 0; i < pmu_battery_count; i++) { struct power_supply_config psy_cfg = {}; - struct pmu_battery_dev *pbat = kzalloc_obj(*pbat, GFP_KERNEL); + struct pmu_battery_dev *pbat = kzalloc_obj(*pbat); if (!pbat) break; diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 91e8b18e09ff..a446d3d086fc 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1426,7 +1426,7 @@ int power_supply_register_extension(struct power_supply *psy, const struct power if (power_supply_has_property(psy, ext->properties[i])) return -EEXIST; - reg = kmalloc_obj(*reg, GFP_KERNEL); + reg = kmalloc_obj(*reg); if (!reg) return -ENOMEM; diff --git a/drivers/power/supply/power_supply_leds.c b/drivers/power/supply/power_supply_leds.c index af32dc2e0210..1548aaba3362 100644 --- a/drivers/power/supply/power_supply_leds.c +++ b/drivers/power/supply/power_supply_leds.c @@ -48,7 +48,7 @@ static int power_supply_register_led_trigger(struct power_supply *psy, if (err && *err) return *err; - psy_trig = kzalloc_obj(*psy_trig, GFP_KERNEL); + psy_trig = kzalloc_obj(*psy_trig); if (!psy_trig) goto err_free_trigger; diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c index 798c43e482ae..ab66e9a3b1e2 100644 --- a/drivers/powercap/arm_scmi_powercap.c +++ b/drivers/powercap/arm_scmi_powercap.c @@ -370,7 +370,7 @@ static int scmi_zones_register(struct device *dev, unsigned int sp = 0, reg_zones = 0; struct scmi_powercap_zone *spz, **zones_stack; - zones_stack = kzalloc_objs(spz, pr->num_zones, GFP_KERNEL); + zones_stack = kzalloc_objs(spz, pr->num_zones); if (!zones_stack) return -ENOMEM; diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index afdeecef69ef..b7a65e543f19 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -418,7 +418,7 @@ static struct dtpm *dtpm_setup_virtual(const struct dtpm_node *hierarchy, struct dtpm *dtpm; int ret; - dtpm = kzalloc_obj(*dtpm, GFP_KERNEL); + dtpm = kzalloc_obj(*dtpm); if (!dtpm) return ERR_PTR(-ENOMEM); dtpm_init(dtpm, NULL); diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index 25489b3b03be..21355db6419d 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -212,7 +212,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) goto release_policy; } - dtpm_cpu = kzalloc_obj(*dtpm_cpu, GFP_KERNEL); + dtpm_cpu = kzalloc_obj(*dtpm_cpu); if (!dtpm_cpu) { ret = -ENOMEM; goto release_policy; diff --git a/drivers/powercap/dtpm_devfreq.c b/drivers/powercap/dtpm_devfreq.c index e941bb241986..fa71285dee60 100644 --- a/drivers/powercap/dtpm_devfreq.c +++ b/drivers/powercap/dtpm_devfreq.c @@ -160,7 +160,7 @@ static int __dtpm_devfreq_setup(struct devfreq *devfreq, struct dtpm *parent) } } - dtpm_devfreq = kzalloc_obj(*dtpm_devfreq, GFP_KERNEL); + dtpm_devfreq = kzalloc_obj(*dtpm_devfreq); if (!dtpm_devfreq) return -ENOMEM; diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index e7f538ebab2f..4d5b12ba0eff 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -2216,7 +2216,7 @@ struct rapl_package *rapl_add_package_cpuslocked(int id, struct rapl_if_priv *pr struct rapl_package *rp; int ret; - rp = kzalloc_obj(struct rapl_package, GFP_KERNEL); + rp = kzalloc_obj(struct rapl_package); if (!rp) return ERR_PTR(-ENOMEM); diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c index f68784c7e718..ba956a2571d1 100644 --- a/drivers/powercap/intel_rapl_tpmi.c +++ b/drivers/powercap/intel_rapl_tpmi.c @@ -102,7 +102,7 @@ static struct tpmi_rapl_package *trp_alloc(int pkg_id) } } - trp = kzalloc_obj(*trp, GFP_KERNEL); + trp = kzalloc_obj(*trp); if (!trp) { ret = -ENOMEM; goto err_del_powercap; diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index b32ac11a6c49..b65bb4f4b92a 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c @@ -501,7 +501,7 @@ struct powercap_zone *powercap_register_zone( return ERR_PTR(-EINVAL); memset(power_zone, 0, sizeof(*power_zone)); } else { - power_zone = kzalloc_obj(*power_zone, GFP_KERNEL); + power_zone = kzalloc_obj(*power_zone); if (!power_zone) return ERR_PTR(-ENOMEM); power_zone->allocated = true; @@ -613,7 +613,7 @@ struct powercap_control_type *powercap_register_control_type( return ERR_PTR(-EINVAL); memset(control_type, 0, sizeof(*control_type)); } else { - control_type = kzalloc_obj(*control_type, GFP_KERNEL); + control_type = kzalloc_obj(*control_type); if (!control_type) return ERR_PTR(-ENOMEM); control_type->allocated = true; diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 975d984b0fd5..f5af18bc2971 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c @@ -142,7 +142,7 @@ static void parport_attach(struct parport *port) return; } - device = kzalloc_obj(struct pps_client_pp, GFP_KERNEL); + device = kzalloc_obj(struct pps_client_pp); if (!device) { pr_err("memory allocation failed, not attaching\n"); return; diff --git a/drivers/pps/generators/pps_gen.c b/drivers/pps/generators/pps_gen.c index a91f6871f98a..7143c003366c 100644 --- a/drivers/pps/generators/pps_gen.c +++ b/drivers/pps/generators/pps_gen.c @@ -230,7 +230,7 @@ struct pps_gen_device *pps_gen_register_source(const struct pps_gen_source_info struct pps_gen_device *pps_gen; int err; - pps_gen = kzalloc_obj(struct pps_gen_device, GFP_KERNEL); + pps_gen = kzalloc_obj(struct pps_gen_device); if (pps_gen == NULL) { err = -ENOMEM; goto pps_gen_register_source_exit; diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index de2ce4faf262..1bf0335a1b41 100644 --- a/drivers/pps/kapi.c +++ b/drivers/pps/kapi.c @@ -83,7 +83,7 @@ struct pps_device *pps_register_source(struct pps_source_info *info, } /* Allocate memory for the new PPS source struct */ - pps = kzalloc_obj(struct pps_device, GFP_KERNEL); + pps = kzalloc_obj(struct pps_device); if (pps == NULL) { err = -ENOMEM; goto pps_register_source_exit; diff --git a/drivers/ps3/ps3-lpm.c b/drivers/ps3/ps3-lpm.c index 8f1ee4c748bf..f8d8f607134a 100644 --- a/drivers/ps3/ps3-lpm.c +++ b/drivers/ps3/ps3-lpm.c @@ -1181,7 +1181,7 @@ static int ps3_lpm_probe(struct ps3_system_bus_device *dev) return -EBUSY; } - lpm_priv = kzalloc_obj(*lpm_priv, GFP_KERNEL); + lpm_priv = kzalloc_obj(*lpm_priv); if (!lpm_priv) return -ENOMEM; diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c index 3493a9ef05ce..39ffa2366132 100644 --- a/drivers/ps3/ps3-vuart.c +++ b/drivers/ps3/ps3-vuart.c @@ -914,7 +914,7 @@ static int ps3_vuart_bus_interrupt_get(void) BUG_ON(vuart_bus_priv.bmp); - vuart_bus_priv.bmp = kzalloc_obj(struct ports_bmp, GFP_KERNEL); + vuart_bus_priv.bmp = kzalloc_obj(struct ports_bmp); if (!vuart_bus_priv.bmp) { result = -ENOMEM; @@ -1015,7 +1015,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev) /* Setup dev->driver_priv. */ - dev->driver_priv = kzalloc_obj(struct ps3_vuart_port_priv, GFP_KERNEL); + dev->driver_priv = kzalloc_obj(struct ps3_vuart_port_priv); if (!dev->driver_priv) { result = -ENOMEM; diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 19f2c5b4f8f3..d4b91c480f98 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c @@ -934,7 +934,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev) return -EBUSY; } - ps3av = kzalloc_obj(*ps3av, GFP_KERNEL); + ps3av = kzalloc_obj(*ps3av); if (!ps3av) return -ENOMEM; diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index dc6d9afdd5c6..d6f54ccaf93b 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -328,7 +328,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, return ERR_PTR(-EINVAL); /* Initialize a clock structure. */ - ptp = kzalloc_obj(struct ptp_clock, GFP_KERNEL); + ptp = kzalloc_obj(struct ptp_clock); if (!ptp) { err = -ENOMEM; goto no_memory; @@ -344,7 +344,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, ptp->devid = MKDEV(major, index); ptp->index = index; INIT_LIST_HEAD(&ptp->tsevqs); - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) { err = -ENOMEM; goto no_memory_queue; diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c index 67eda6fb22d1..9e7af6a10261 100644 --- a/drivers/ptp/ptp_ines.c +++ b/drivers/ptp/ptp_ines.c @@ -760,7 +760,7 @@ static int ines_ptp_ctrl_probe(struct platform_device *pld) err = PTR_ERR(addr); goto out; } - clock = kzalloc_obj(*clock, GFP_KERNEL); + clock = kzalloc_obj(*clock); if (!clock) { err = -ENOMEM; goto out; diff --git a/drivers/ptp/ptp_mock.c b/drivers/ptp/ptp_mock.c index 267168e9d0ca..4d66b6147121 100644 --- a/drivers/ptp/ptp_mock.c +++ b/drivers/ptp/ptp_mock.c @@ -120,7 +120,7 @@ struct mock_phc *mock_phc_create(struct device *dev) struct mock_phc *phc; int err; - phc = kzalloc_obj(*phc, GFP_KERNEL); + phc = kzalloc_obj(*phc); if (!phc) { err = -ENOMEM; goto out; diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index 1ed492c12e1d..d88ab2f86b1b 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -2241,7 +2241,7 @@ ptp_ocp_register_ext(struct ptp_ocp *bp, struct ocp_resource *r) struct ptp_ocp_ext_src *ext; int err; - ext = kzalloc_obj(*ext, GFP_KERNEL); + ext = kzalloc_obj(*ext); if (!ext) return -ENOMEM; @@ -2378,7 +2378,7 @@ ptp_ocp_attr_group_add(struct ptp_ocp *bp, if (attr_tbl[i].cap & bp->fw_cap) count++; - bp->attr_group = kzalloc_objs(*bp->attr_group, count + 1, GFP_KERNEL); + bp->attr_group = kzalloc_objs(*bp->attr_group, count + 1); if (!bp->attr_group) return -ENOMEM; @@ -2645,7 +2645,7 @@ ptp_ocp_set_pins(struct ptp_ocp *bp) struct ptp_pin_desc *config; int i; - config = kzalloc_objs(*config, 4, GFP_KERNEL); + config = kzalloc_objs(*config, 4); if (!config) return -ENOMEM; diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c index 71f4de4e8fc3..76272e5ac5b8 100644 --- a/drivers/ptp/ptp_qoriq.c +++ b/drivers/ptp/ptp_qoriq.c @@ -613,7 +613,7 @@ static int ptp_qoriq_probe(struct platform_device *dev) int err = -ENOMEM; void __iomem *base; - ptp_qoriq = kzalloc_obj(*ptp_qoriq, GFP_KERNEL); + ptp_qoriq = kzalloc_obj(*ptp_qoriq); if (!ptp_qoriq) goto no_memory; diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c index f398eac4a263..dc398c6b7528 100644 --- a/drivers/ptp/ptp_sysfs.c +++ b/drivers/ptp/ptp_sysfs.c @@ -443,11 +443,11 @@ int ptp_populate_pin_groups(struct ptp_clock *ptp) if (!n_pins) return 0; - ptp->pin_dev_attr = kzalloc_objs(*ptp->pin_dev_attr, n_pins, GFP_KERNEL); + ptp->pin_dev_attr = kzalloc_objs(*ptp->pin_dev_attr, n_pins); if (!ptp->pin_dev_attr) goto no_dev_attr; - ptp->pin_attr = kzalloc_objs(*ptp->pin_attr, 1 + n_pins, GFP_KERNEL); + ptp->pin_attr = kzalloc_objs(*ptp->pin_attr, 1 + n_pins); if (!ptp->pin_attr) goto no_pin_attr; diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c index b27b25715e1e..915a4f6defc9 100644 --- a/drivers/ptp/ptp_vclock.c +++ b/drivers/ptp/ptp_vclock.c @@ -191,7 +191,7 @@ struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock) { struct ptp_vclock *vclock; - vclock = kzalloc_obj(*vclock, GFP_KERNEL); + vclock = kzalloc_obj(*vclock); if (!vclock) return NULL; diff --git a/drivers/ptp/ptp_vmclock.c b/drivers/ptp/ptp_vmclock.c index 431510435376..8b630eb916b5 100644 --- a/drivers/ptp/ptp_vmclock.c +++ b/drivers/ptp/ptp_vmclock.c @@ -460,7 +460,7 @@ static int vmclock_miscdev_open(struct inode *inode, struct file *fp) { struct vmclock_state *st = container_of(fp->private_data, struct vmclock_state, miscdev); - struct vmclock_file_state *fst = kzalloc_obj(*fst, GFP_KERNEL); + struct vmclock_file_state *fst = kzalloc_obj(*fst); if (!fst) return -ENOMEM; diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 7f54abd61c02..39febc6ccbb7 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1333,7 +1333,7 @@ static int pwm_export_child(struct device *pwmchip_dev, struct pwm_device *pwm) if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags)) return -EBUSY; - export = kzalloc_obj(*export, GFP_KERNEL); + export = kzalloc_obj(*export); if (!export) { clear_bit(PWMF_EXPORTED, &pwm->flags); return -ENOMEM; diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c index 10277dff206e..009b3b595bbf 100644 --- a/drivers/rapidio/devices/rio_mport_cdev.c +++ b/drivers/rapidio/devices/rio_mport_cdev.c @@ -348,7 +348,7 @@ rio_mport_create_outbound_mapping(struct mport_dev *md, struct file *filp, rmcd_debug(OBW, "did=%d ra=0x%llx sz=0x%x", rioid, raddr, size); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) return -ENOMEM; @@ -800,7 +800,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, if (xfer->length == 0) return -EINVAL; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -835,7 +835,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, offset = lower_32_bits(offset_in_page(xfer->loc_addr)); nr_pages = PAGE_ALIGN(xfer->length + offset) >> PAGE_SHIFT; - page_list = kmalloc_objs(*page_list, nr_pages, GFP_KERNEL); + page_list = kmalloc_objs(*page_list, nr_pages); if (page_list == NULL) { ret = -ENOMEM; goto err_req; @@ -1069,7 +1069,7 @@ static int rio_mport_create_dma_mapping(struct mport_dev *md, struct file *filp, { struct rio_mport_mapping *map; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) return -ENOMEM; @@ -1189,7 +1189,7 @@ rio_mport_create_inbound_mapping(struct mport_dev *md, struct file *filp, if (size > 0xffffffff) return -EINVAL; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) return -ENOMEM; @@ -1431,7 +1431,7 @@ static int rio_mport_add_db_filter(struct mport_cdev_priv *priv, return ret; } - db_filter = kzalloc_obj(*db_filter, GFP_KERNEL); + db_filter = kzalloc_obj(*db_filter); if (db_filter == NULL) { rio_release_inb_dbell(md->mport, filter.low, filter.high); return -ENOMEM; @@ -1539,7 +1539,7 @@ static int rio_mport_add_pw_filter(struct mport_cdev_priv *priv, if (copy_from_user(&filter, arg, sizeof(filter))) return -EFAULT; - pw_filter = kzalloc_obj(*pw_filter, GFP_KERNEL); + pw_filter = kzalloc_obj(*pw_filter); if (pw_filter == NULL) return -ENOMEM; @@ -1878,7 +1878,7 @@ static int mport_cdev_open(struct inode *inode, struct file *filp) get_device(&chdev->dev); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { put_device(&chdev->dev); return -ENOMEM; @@ -2348,7 +2348,7 @@ static struct mport_dev *mport_cdev_add(struct rio_mport *mport) struct mport_dev *md; struct rio_mport_attr attr; - md = kzalloc_obj(*md, GFP_KERNEL); + md = kzalloc_obj(*md); if (!md) { rmcd_error("Unable allocate a device object"); return NULL; diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c index 9d3f2577bccb..66331e67cf4e 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -2774,7 +2774,7 @@ static int tsi721_probe(struct pci_dev *pdev, struct tsi721_device *priv; int err; - priv = kzalloc_obj(struct tsi721_device, GFP_KERNEL); + priv = kzalloc_obj(struct tsi721_device); if (!priv) { err = -ENOMEM; goto err_exit; diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index c811cc3ebc5d..0c175e6d424f 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -107,7 +107,7 @@ EXPORT_SYMBOL(rio_query_mport); */ struct rio_net *rio_alloc_net(struct rio_mport *mport) { - struct rio_net *net = kzalloc_obj(*net, GFP_KERNEL); + struct rio_net *net = kzalloc_obj(*net); if (net) { INIT_LIST_HEAD(&net->node); @@ -242,7 +242,7 @@ int rio_request_inb_mbox(struct rio_mport *mport, if (!mport->ops->open_inb_mbox) goto out; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (res) { rio_init_mbox_res(res, mbox, mbox); @@ -326,7 +326,7 @@ int rio_request_outb_mbox(struct rio_mport *mport, if (!mport->ops->open_outb_mbox) goto out; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (res) { rio_init_mbox_res(res, mbox, mbox); @@ -403,7 +403,7 @@ rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res, void (*dinb) (struct rio_mport * mport, void *dev_id, u16 src, u16 dst, u16 info)) { - struct rio_dbell *dbell = kmalloc_obj(*dbell, GFP_KERNEL); + struct rio_dbell *dbell = kmalloc_obj(*dbell); if (!dbell) return -ENOMEM; @@ -438,7 +438,7 @@ int rio_request_inb_dbell(struct rio_mport *mport, u16 dst, u16 info)) { int rc; - struct resource *res = kzalloc_obj(*res, GFP_KERNEL); + struct resource *res = kzalloc_obj(*res); if (res) { rio_init_dbell_res(res, start, end); @@ -515,7 +515,7 @@ EXPORT_SYMBOL_GPL(rio_release_inb_dbell); struct resource *rio_request_outb_dbell(struct rio_dev *rdev, u16 start, u16 end) { - struct resource *res = kzalloc_obj(struct resource, GFP_KERNEL); + struct resource *res = kzalloc_obj(struct resource); if (res) { rio_init_dbell_res(res, start, end); @@ -563,7 +563,7 @@ int rio_add_mport_pw_handler(struct rio_mport *mport, void *context, int (*pwcback)(struct rio_mport *mport, void *context, union rio_pw_msg *msg, int step)) { - struct rio_pwrite *pwrite = kzalloc_obj(*pwrite, GFP_KERNEL); + struct rio_pwrite *pwrite = kzalloc_obj(*pwrite); if (!pwrite) return -ENOMEM; @@ -1865,7 +1865,7 @@ int rio_register_scan(int mport_id, struct rio_scan *scan_ops) /* * Allocate and initialize new scan registration node. */ - scan = kzalloc_obj(*scan, GFP_KERNEL); + scan = kzalloc_obj(*scan); if (!scan) { rc = -ENOMEM; goto err_out; @@ -2000,7 +2000,7 @@ int rio_init_mports(void) goto no_disc; } - work = kzalloc_objs(*work, n, GFP_KERNEL); + work = kzalloc_objs(*work, n); if (!work) { destroy_workqueue(rio_wq); goto no_disc; diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c index d01c749de5fd..c55af5924da2 100644 --- a/drivers/rapidio/rio_cm.c +++ b/drivers/rapidio/rio_cm.c @@ -389,7 +389,7 @@ static int riocm_req_handler(struct cm_dev *cm, void *req_data) return -EINVAL; } - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) { riocm_put_channel(ch); return -ENOMEM; @@ -702,7 +702,7 @@ static int riocm_queue_req(struct cm_dev *cm, struct rio_dev *rdev, unsigned long flags; struct tx_req *treq; - treq = kzalloc_obj(*treq, GFP_KERNEL); + treq = kzalloc_obj(*treq); if (treq == NULL) return -ENOMEM; @@ -965,7 +965,7 @@ static int riocm_ch_connect(u16 loc_ch, struct cm_dev *cm, * Send connect request to the remote RapidIO device */ - hdr = kzalloc_obj(*hdr, GFP_KERNEL); + hdr = kzalloc_obj(*hdr); if (hdr == NULL) { ret = -ENOMEM; goto conn_done; @@ -1022,7 +1022,7 @@ static int riocm_send_ack(struct rio_channel *ch) struct rio_ch_chan_hdr *hdr; int ret; - hdr = kzalloc_obj(*hdr, GFP_KERNEL); + hdr = kzalloc_obj(*hdr); if (hdr == NULL) return -ENOMEM; @@ -1283,7 +1283,7 @@ static struct rio_channel *riocm_ch_alloc(u16 ch_num) int start, end; struct rio_channel *ch; - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (!ch) return ERR_PTR(-ENOMEM); @@ -1396,7 +1396,7 @@ static int riocm_send_close(struct rio_channel *ch) * Send CH_CLOSE notification to the remote RapidIO device */ - hdr = kzalloc_obj(*hdr, GFP_KERNEL); + hdr = kzalloc_obj(*hdr); if (hdr == NULL) return -ENOMEM; @@ -1952,7 +1952,7 @@ static int riocm_add_dev(struct device *dev, struct subsys_interface *sif) riocm_debug(RDEV, "(%s)", rio_name(rdev)); - peer = kmalloc_obj(*peer, GFP_KERNEL); + peer = kmalloc_obj(*peer); if (!peer) return -ENOMEM; @@ -2099,7 +2099,7 @@ static int riocm_add_mport(struct device *dev) riocm_debug(MPORT, "add mport %s", mport->name); - cm = kzalloc_obj(*cm, GFP_KERNEL); + cm = kzalloc_obj(*cm); if (!cm) return -ENOMEM; diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c index c84e26cca724..34ef75af31cb 100644 --- a/drivers/ras/amd/fmpm.c +++ b/drivers/ras/amd/fmpm.c @@ -819,7 +819,7 @@ static int allocate_records(void) { int i, ret = 0; - fru_records = kzalloc_objs(struct fru_rec *, max_nr_fru, GFP_KERNEL); + fru_records = kzalloc_objs(struct fru_rec *, max_nr_fru); if (!fru_records) { ret = -ENOMEM; goto out; diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 386304bc200c..2286bdf6edcb 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1855,7 +1855,7 @@ static int set_consumer_device_supply(struct regulator_dev *rdev, else has_dev = 0; - new_node = kzalloc_obj(struct regulator_map, GFP_KERNEL); + new_node = kzalloc_obj(struct regulator_map); if (new_node == NULL) return -ENOMEM; @@ -2021,7 +2021,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, return NULL; } - regulator = kzalloc_obj(*regulator, GFP_KERNEL); + regulator = kzalloc_obj(*regulator); if (regulator == NULL) { kfree_const(supply_name); return NULL; @@ -2701,7 +2701,7 @@ int regulator_register_supply_alias(struct device *dev, const char *id, struct regulator_supply_alias *map; struct regulator_supply_alias *new_map; - new_map = kzalloc_obj(struct regulator_supply_alias, GFP_KERNEL); + new_map = kzalloc_obj(struct regulator_supply_alias); if (!new_map) return -ENOMEM; @@ -2825,7 +2825,7 @@ static int regulator_ena_gpio_request(struct regulator_dev *rdev, struct gpio_desc *gpiod; gpiod = config->ena_gpiod; - new_pin = kzalloc_obj(*new_pin, GFP_KERNEL); + new_pin = kzalloc_obj(*new_pin); mutex_lock(®ulator_list_mutex); @@ -5913,7 +5913,7 @@ static int regulator_init_coupling(struct regulator_dev *rdev) else n_phandles = of_get_n_coupled(rdev); - coupled = kzalloc_objs(*coupled, n_phandles + 1, GFP_KERNEL); + coupled = kzalloc_objs(*coupled, n_phandles + 1); if (!coupled) return -ENOMEM; @@ -6034,7 +6034,7 @@ regulator_register(struct device *dev, goto rinse; } - rdev = kzalloc_obj(struct regulator_dev, GFP_KERNEL); + rdev = kzalloc_obj(struct regulator_dev); if (rdev == NULL) { ret = -ENOMEM; goto rinse; @@ -6117,7 +6117,7 @@ regulator_register(struct device *dev, sizeof(*rdev->constraints), GFP_KERNEL); else - rdev->constraints = kzalloc_obj(*rdev->constraints, GFP_KERNEL); + rdev->constraints = kzalloc_obj(*rdev->constraints); if (!rdev->constraints) { ret = -ENOMEM; goto wash; diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c index 186a05b00733..ba5551ac034d 100644 --- a/drivers/regulator/fixed-helper.c +++ b/drivers/regulator/fixed-helper.c @@ -34,7 +34,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name, { struct fixed_regulator_data *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index bb6038bf8bd4..6c31140268ac 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -370,7 +370,7 @@ static struct qcom_ssr_subsystem *qcom_ssr_get_subsys(const char *name) if (!strcmp(info->name, name)) goto out; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { info = ERR_PTR(-ENOMEM); goto out; @@ -534,7 +534,7 @@ static int pdm_notify_prepare(struct rproc_subdev *subdev) struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c index bbbe732fe767..cf10e8ecfb8f 100644 --- a/drivers/remoteproc/qcom_sysmon.c +++ b/drivers/remoteproc/qcom_sysmon.c @@ -628,7 +628,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, struct qcom_sysmon *sysmon; int ret; - sysmon = kzalloc_obj(*sysmon, GFP_KERNEL); + sysmon = kzalloc_obj(*sysmon); if (!sysmon) return ERR_PTR(-ENOMEM); diff --git a/drivers/remoteproc/qcom_wcnss_iris.c b/drivers/remoteproc/qcom_wcnss_iris.c index 78cb8150f64b..2b89b4db6c94 100644 --- a/drivers/remoteproc/qcom_wcnss_iris.c +++ b/drivers/remoteproc/qcom_wcnss_iris.c @@ -125,7 +125,7 @@ struct qcom_iris *qcom_iris_probe(struct device *parent, bool *use_48mhz_xo) return ERR_PTR(-EINVAL); } - iris = kzalloc_obj(*iris, GFP_KERNEL); + iris = kzalloc_obj(*iris); if (!iris) { of_node_put(of_node); return ERR_PTR(-ENOMEM); diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index bb5887a9d2ac..b087ed21858a 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -557,7 +557,7 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr, return -EINVAL; } - trace = kzalloc_obj(*trace, GFP_KERNEL); + trace = kzalloc_obj(*trace); if (!trace) return -ENOMEM; @@ -635,7 +635,7 @@ static int rproc_handle_devmem(struct rproc *rproc, void *ptr, return -EINVAL; } - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) return -ENOMEM; @@ -727,7 +727,7 @@ static int rproc_alloc_carveout(struct rproc *rproc, * physical address in this case. */ if (mem->da != FW_RSC_ADDR_ANY && rproc->domain) { - mapping = kzalloc_obj(*mapping, GFP_KERNEL); + mapping = kzalloc_obj(*mapping); if (!mapping) { ret = -ENOMEM; goto dma_free; @@ -917,7 +917,7 @@ rproc_mem_entry_init(struct device *dev, struct rproc_mem_entry *mem; va_list args; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return mem; @@ -960,7 +960,7 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len, struct rproc_mem_entry *mem; va_list args; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return mem; diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index f925c8e775a5..ceff380228c7 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -49,7 +49,7 @@ int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size) { struct rproc_dump_segment *segment; - segment = kzalloc_obj(*segment, GFP_KERNEL); + segment = kzalloc_obj(*segment); if (!segment) return -ENOMEM; @@ -86,7 +86,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, { struct rproc_dump_segment *segment; - segment = kzalloc_obj(*segment, GFP_KERNEL); + segment = kzalloc_obj(*segment); if (!segment) return -ENOMEM; diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index 92c7c0b0ad65..d5e9ff045a28 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -430,7 +430,7 @@ static int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) } /* Allocate virtio device */ - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) { ret = -ENOMEM; goto out; diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 6185343a6d3f..632614013dc6 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -164,7 +164,7 @@ static int stm32_rproc_of_memory_translations(struct platform_device *pdev, p_mems = devm_kcalloc(dev, cnt, sizeof(*p_mems), GFP_KERNEL); if (!p_mems) return -ENOMEM; - mem_range = kzalloc_objs(*mem_range, cnt, GFP_KERNEL); + mem_range = kzalloc_objs(*mem_range, cnt); if (!mem_range) return -ENOMEM; diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index a8b13fb50992..b71ce69afe9f 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -265,7 +265,7 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev) struct mbox_client *mbox_cl; struct mbox_info *ipi; - ipi = kzalloc_obj(*ipi, GFP_KERNEL); + ipi = kzalloc_obj(*ipi); if (!ipi) return NULL; @@ -1337,11 +1337,11 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) core_count = 1; } - child_devs = kzalloc_objs(struct device *, core_count, GFP_KERNEL); + child_devs = kzalloc_objs(struct device *, core_count); if (!child_devs) return -ENOMEM; - r5_cores = kzalloc_objs(struct zynqmp_r5_core *, core_count, GFP_KERNEL); + r5_cores = kzalloc_objs(struct zynqmp_r5_core *, core_count); if (!r5_cores) { kfree(child_devs); return -ENOMEM; @@ -1502,7 +1502,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int ret; - cluster = kzalloc_obj(*cluster, GFP_KERNEL); + cluster = kzalloc_obj(*cluster); if (!cluster) return -ENOMEM; diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c index 323dba59fce8..ef4df1792ece 100644 --- a/drivers/resctrl/mpam_devices.c +++ b/drivers/resctrl/mpam_devices.c @@ -295,7 +295,7 @@ mpam_class_alloc(u8 level_idx, enum mpam_class_types type) lockdep_assert_held(&mpam_list_lock); - class = kzalloc_obj(*class, GFP_KERNEL); + class = kzalloc_obj(*class); if (!class) return ERR_PTR(-ENOMEM); init_garbage(&class->garbage); @@ -343,7 +343,7 @@ mpam_component_alloc(struct mpam_class *class, int id) lockdep_assert_held(&mpam_list_lock); - comp = kzalloc_obj(*comp, GFP_KERNEL); + comp = kzalloc_obj(*comp); if (!comp) return ERR_PTR(-ENOMEM); init_garbage(&comp->garbage); @@ -398,7 +398,7 @@ mpam_vmsc_alloc(struct mpam_component *comp, struct mpam_msc *msc) lockdep_assert_held(&mpam_list_lock); - vmsc = kzalloc_obj(*vmsc, GFP_KERNEL); + vmsc = kzalloc_obj(*vmsc); if (!vmsc) return ERR_PTR(-ENOMEM); init_garbage(&vmsc->garbage); @@ -2419,7 +2419,7 @@ static int __allocate_component_cfg(struct mpam_component *comp) if (comp->cfg) return 0; - comp->cfg = kzalloc_objs(*comp->cfg, mpam_partid_max + 1, GFP_KERNEL); + comp->cfg = kzalloc_objs(*comp->cfg, mpam_partid_max + 1); if (!comp->cfg) return -ENOMEM; diff --git a/drivers/reset/core.c b/drivers/reset/core.c index c224e42e0f6c..ae7996f677bd 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -778,7 +778,7 @@ __reset_control_get_internal(struct reset_controller_dev *rcdev, } } - rstc = kzalloc_obj(*rstc, GFP_KERNEL); + rstc = kzalloc_obj(*rstc); if (!rstc) return ERR_PTR(-ENOMEM); @@ -836,7 +836,7 @@ static int reset_add_gpio_aux_device(struct device *parent, struct auxiliary_device *adev; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; @@ -931,7 +931,7 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args) return id; /* Not freed on success, because it is persisent subsystem data. */ - rgpio_dev = kzalloc_obj(*rgpio_dev, GFP_KERNEL); + rgpio_dev = kzalloc_obj(*rgpio_dev); if (!rgpio_dev) { ret = -ENOMEM; goto err_ida_free; diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c index c28cb4632883..4070a4b6663f 100644 --- a/drivers/reset/reset-npcm.c +++ b/drivers/reset/reset-npcm.c @@ -399,7 +399,7 @@ static struct auxiliary_device *npcm_clock_adev_alloc(struct npcm_rc_data *rst_d struct auxiliary_device *adev; int ret; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index a18cc81e0efa..da208270b787 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -27,7 +27,7 @@ static int a10_reset_init(struct device_node *np) int ret; u32 reg_offset = 0x10; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c index b88d1d001ec3..2544de6576e4 100644 --- a/drivers/reset/reset-sunxi.c +++ b/drivers/reset/reset-sunxi.c @@ -27,7 +27,7 @@ static int sunxi_reset_init(struct device_node *np) resource_size_t size; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c index bbeac30cbc8e..0e03c5336609 100644 --- a/drivers/rpmsg/mtk_rpmsg.c +++ b/drivers/rpmsg/mtk_rpmsg.c @@ -91,7 +91,7 @@ __mtk_create_ept(struct mtk_rpmsg_rproc_subdev *mtk_subdev, struct platform_device *pdev = mtk_subdev->pdev; int ret; - mept = kzalloc_obj(*mept, GFP_KERNEL); + mept = kzalloc_obj(*mept); if (!mept) return NULL; mept->mtk_subdev = mtk_subdev; @@ -201,7 +201,7 @@ static int mtk_rpmsg_register_device(struct mtk_rpmsg_rproc_subdev *mtk_subdev, struct mtk_rpmsg_device *mdev; struct platform_device *pdev = mtk_subdev->pdev; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; @@ -252,7 +252,7 @@ static int mtk_rpmsg_create_device(struct mtk_rpmsg_rproc_subdev *mtk_subdev, { struct mtk_rpmsg_channel_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -380,7 +380,7 @@ mtk_rpmsg_create_rproc_subdev(struct platform_device *pdev, { struct mtk_rpmsg_rproc_subdev *mtk_subdev; - mtk_subdev = kzalloc_obj(*mtk_subdev, GFP_KERNEL); + mtk_subdev = kzalloc_obj(*mtk_subdev); if (!mtk_subdev) return NULL; diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index dd775f955bfe..9ef17c2e45b0 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -227,7 +227,7 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink, { struct glink_channel *channel; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return ERR_PTR(-ENOMEM); @@ -754,7 +754,7 @@ qcom_glink_alloc_intent(struct qcom_glink *glink, int ret; unsigned long flags; - intent = kzalloc_obj(*intent, GFP_KERNEL); + intent = kzalloc_obj(*intent); if (!intent) return NULL; @@ -1669,7 +1669,7 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, complete_all(&channel->open_req); if (create_device) { - rpdev = kzalloc_obj(*rpdev, GFP_KERNEL); + rpdev = kzalloc_obj(*rpdev); if (!rpdev) { ret = -ENOMEM; goto rcid_remove; @@ -1868,7 +1868,7 @@ static int qcom_glink_create_chrdev(struct qcom_glink *glink) struct rpmsg_device *rpdev; struct glink_channel *channel; - rpdev = kzalloc_obj(*rpdev, GFP_KERNEL); + rpdev = kzalloc_obj(*rpdev); if (!rpdev) return -ENOMEM; diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 26727cbb7ce4..62adc4db2317 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -230,7 +230,7 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, size_t size; int ret; - smem = kzalloc_obj(*smem, GFP_KERNEL); + smem = kzalloc_obj(*smem); if (!smem) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 7faed3530888..e1eb450f4fea 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -922,7 +922,7 @@ static struct rpmsg_endpoint *qcom_smd_create_ept(struct rpmsg_device *rpdev, return NULL; } - qsept = kzalloc_obj(*qsept, GFP_KERNEL); + qsept = kzalloc_obj(*qsept); if (!qsept) return NULL; @@ -1077,7 +1077,7 @@ static int qcom_smd_create_device(struct qcom_smd_channel *channel) dev_dbg(&edge->dev, "registering '%s'\n", channel->name); - qsdev = kzalloc_obj(*qsdev, GFP_KERNEL); + qsdev = kzalloc_obj(*qsdev); if (!qsdev) return -ENOMEM; @@ -1104,7 +1104,7 @@ static int qcom_smd_create_chrdev(struct qcom_smd_edge *edge) { struct qcom_smd_device *qsdev; - qsdev = kzalloc_obj(*qsdev, GFP_KERNEL); + qsdev = kzalloc_obj(*qsdev); if (!qsdev) return -ENOMEM; @@ -1132,7 +1132,7 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed void *info; int ret; - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) return ERR_PTR(-ENOMEM); @@ -1484,7 +1484,7 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent, if (!qcom_smem_is_available()) return ERR_PTR(-EPROBE_DEFER); - edge = kzalloc_obj(*edge, GFP_KERNEL); + edge = kzalloc_obj(*edge); if (!edge) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index a368698113eb..ca9cf8858a5e 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -410,7 +410,7 @@ static struct rpmsg_eptdev *rpmsg_chrdev_eptdev_alloc(struct rpmsg_device *rpdev struct rpmsg_eptdev *eptdev; struct device *dev; - eptdev = kzalloc_obj(*eptdev, GFP_KERNEL); + eptdev = kzalloc_obj(*eptdev); if (!eptdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/rpmsg/rpmsg_ctrl.c b/drivers/rpmsg/rpmsg_ctrl.c index 95f8be640dfc..5c19188d0294 100644 --- a/drivers/rpmsg/rpmsg_ctrl.c +++ b/drivers/rpmsg/rpmsg_ctrl.c @@ -141,7 +141,7 @@ static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev) struct device *dev; int ret; - ctrldev = kzalloc_obj(*ctrldev, GFP_KERNEL); + ctrldev = kzalloc_obj(*ctrldev); if (!ctrldev) return -ENOMEM; diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 20ba05917841..8d9e2b4dc7c1 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -210,7 +210,7 @@ static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, struct rpmsg_endpoint *ept; struct device *dev = rpdev ? &rpdev->dev : &vrp->vdev->dev; - ept = kzalloc_obj(*ept, GFP_KERNEL); + ept = kzalloc_obj(*ept); if (!ept) return NULL; @@ -400,7 +400,7 @@ static struct rpmsg_device *__rpmsg_create_channel(struct virtproc_info *vrp, return NULL; } - vch = kzalloc_obj(*vch, GFP_KERNEL); + vch = kzalloc_obj(*vch); if (!vch) return NULL; @@ -779,7 +779,7 @@ static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev struct rpmsg_device *rpdev_ctrl; int err = 0; - vch = kzalloc_obj(*vch, GFP_KERNEL); + vch = kzalloc_obj(*vch); if (!vch) return ERR_PTR(-ENOMEM); @@ -825,7 +825,7 @@ static int rpmsg_probe(struct virtio_device *vdev) size_t total_buf_space; bool notify; - vrp = kzalloc_obj(*vrp, GFP_KERNEL); + vrp = kzalloc_obj(*vrp); if (!vrp) return -ENOMEM; @@ -898,7 +898,7 @@ static int rpmsg_probe(struct virtio_device *vdev) /* if supported by the remote processor, enable the name service */ if (virtio_has_feature(vdev, VIRTIO_RPMSG_F_NS)) { - vch = kzalloc_obj(*vch, GFP_KERNEL); + vch = kzalloc_obj(*vch); if (!vch) { err = -ENOMEM; goto free_ctrldev; diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index eda2d5d46798..c39dc7d3b487 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -208,7 +208,7 @@ static struct rtc_device *rtc_allocate_device(void) { struct rtc_device *rtc; - rtc = kzalloc_obj(*rtc, GFP_KERNEL); + rtc = kzalloc_obj(*rtc); if (!rtc) return NULL; diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 2bc86e8a8a86..9065b437dd8a 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -233,7 +233,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, const char *parents[2]; u32 reg; - rtc = kzalloc_obj(*rtc, GFP_KERNEL); + rtc = kzalloc_obj(*rtc); if (!rtc) return; diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index cc86a2b76a0a..3181c06d91ce 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -868,7 +868,7 @@ int dasd_profile_on(struct dasd_profile *profile) { struct dasd_profile_info *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; spin_lock_bh(&profile->lock); @@ -3180,7 +3180,7 @@ enum blk_eh_timer_return dasd_times_out(struct request *req) static int dasd_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, unsigned int idx) { - struct dasd_queue *dq = kzalloc_obj(*dq, GFP_KERNEL); + struct dasd_queue *dq = kzalloc_obj(*dq); if (!dq) return -ENOMEM; diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index f5f3b6da2d4b..8d6c16d35c22 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -98,7 +98,7 @@ static struct alias_server *_allocate_server(struct dasd_uid *uid) { struct alias_server *server; - server = kzalloc_obj(*server, GFP_KERNEL); + server = kzalloc_obj(*server); if (!server) return ERR_PTR(-ENOMEM); memcpy(server->uid.vendor, uid->vendor, sizeof(uid->vendor)); @@ -117,7 +117,7 @@ static struct alias_lcu *_allocate_lcu(struct dasd_uid *uid) { struct alias_lcu *lcu; - lcu = kzalloc_obj(*lcu, GFP_KERNEL); + lcu = kzalloc_obj(*lcu); if (!lcu) return ERR_PTR(-ENOMEM); lcu->uac = kzalloc_obj(*(lcu->uac), GFP_KERNEL | GFP_DMA); diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index d46274ef2f3e..381d616ad433 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -412,7 +412,7 @@ dasd_add_busid(const char *bus_id, int features) struct dasd_devmap *devmap, *new, *tmp; int hash; - new = kzalloc_obj(struct dasd_devmap, GFP_KERNEL); + new = kzalloc_obj(struct dasd_devmap); if (!new) return ERR_PTR(-ENOMEM); spin_lock(&dasd_devmap_lock); @@ -605,7 +605,7 @@ static int dasd_devmap_get_pprc_status(struct dasd_device *device, dev_warn(&device->cdev->dev, "Unable to query copy relation status\n"); return -EOPNOTSUPP; } - temp = kzalloc_obj(*temp, GFP_KERNEL); + temp = kzalloc_obj(*temp); if (!temp) return -ENOMEM; @@ -2274,7 +2274,7 @@ static ssize_t dasd_copy_pair_store(struct device *dev, } else if (sec_devmap->copy) { copy = sec_devmap->copy; } else { - copy = kzalloc_obj(*copy, GFP_KERNEL); + copy = kzalloc_obj(*copy); if (!copy) return -ENOMEM; } diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index ac15322a1d06..af68c2ee659d 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -325,7 +325,7 @@ dasd_diag_check_device(struct dasd_device *device) int rc; if (private == NULL) { - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (private == NULL) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Allocating memory for private DASD data " @@ -395,7 +395,7 @@ dasd_diag_check_device(struct dasd_device *device) rc = -ENOMEM; goto out; } - bio = kzalloc_obj(*bio, GFP_KERNEL); + bio = kzalloc_obj(*bio); if (bio == NULL) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "No memory to allocate initialization bio"); diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 47ffc255e9b4..cb068d5e2145 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -3729,7 +3729,7 @@ static int dasd_in_copy_relation(struct dasd_device *device) if (!dasd_eckd_pprc_enabled(device)) return 0; - temp = kzalloc_obj(*temp, GFP_KERNEL); + temp = kzalloc_obj(*temp); if (!temp) return -ENOMEM; @@ -6721,7 +6721,7 @@ static void dasd_eckd_check_attention_work(struct work_struct *work) data = container_of(work, struct check_attention_work_data, worker); device = data->device; - messages = kzalloc_obj(*messages, GFP_KERNEL); + messages = kzalloc_obj(*messages); if (!messages) { DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Could not allocate attention message buffer"); diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index 648ab74ae60f..78d66e2711cd 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c @@ -544,7 +544,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) struct eerbuffer *eerb; unsigned long flags; - eerb = kzalloc_obj(struct eerbuffer, GFP_KERNEL); + eerb = kzalloc_obj(struct eerbuffer); if (!eerb) return -ENOMEM; eerb->buffer_page_count = eer_pages; @@ -689,7 +689,7 @@ int __init dasd_eer_init(void) { int rc; - dasd_eer_dev = kzalloc_obj(*dasd_eer_dev, GFP_KERNEL); + dasd_eer_dev = kzalloc_obj(*dasd_eer_dev); if (!dasd_eer_dev) return -ENOMEM; diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index d5534ce25558..c85ee42732a3 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -442,7 +442,7 @@ static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) struct dasd_profile_info_t *data; int rc = 0; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; @@ -560,7 +560,7 @@ static int dasd_ioctl_information(struct dasd_block *block, void __user *argp, struct dasd_information2_t *dasd_info; int error; - dasd_info = kzalloc_obj(*dasd_info, GFP_KERNEL); + dasd_info = kzalloc_obj(*dasd_info); if (!dasd_info) return -ENOMEM; diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 5d7229f39480..e8407338697c 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -309,7 +309,7 @@ dcssblk_load_segment(char *name, struct segment_info **seg_info) return -EEXIST; /* get a struct segment_info */ - *seg_info = kzalloc_obj(struct segment_info, GFP_KERNEL); + *seg_info = kzalloc_obj(struct segment_info); if (*seg_info == NULL) return -ENOMEM; diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index 0781c7e9d913..2ffd47b6a997 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c @@ -331,7 +331,7 @@ static blk_status_t scm_blk_request(struct blk_mq_hw_ctx *hctx, static int scm_blk_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, unsigned int idx) { - struct scm_queue *qd = kzalloc_obj(*qd, GFP_KERNEL); + struct scm_queue *qd = kzalloc_obj(*qd); if (!qd) return -ENOMEM; diff --git a/drivers/s390/block/scm_drv.c b/drivers/s390/block/scm_drv.c index 81b32b44b03c..095d06eeae7c 100644 --- a/drivers/s390/block/scm_drv.c +++ b/drivers/s390/block/scm_drv.c @@ -43,7 +43,7 @@ static int scm_probe(struct scm_device *scmdev) if (scmdev->attrs.oper_state != OP_STATE_GOOD) return -EINVAL; - bdev = kzalloc_obj(*bdev, GFP_KERNEL); + bdev = kzalloc_obj(*bdev); if (!bdev) return -ENOMEM; diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index 1dcf0198d8a7..2fa8ac601778 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -829,7 +829,7 @@ static struct tty3270 *tty3270_alloc_view(void) { struct tty3270 *tp; - tp = kzalloc_obj(*tp, GFP_KERNEL); + tp = kzalloc_obj(*tp); if (!tp) goto out_err; @@ -895,7 +895,7 @@ static struct tty3270_line *tty3270_alloc_screen(struct tty3270 *tp, unsigned in int allocated, lines; allocated = __roundup_pow_of_two(rows) * TTY3270_SCREEN_PAGES; - screen = kzalloc_objs(struct tty3270_line, allocated, GFP_KERNEL); + screen = kzalloc_objs(struct tty3270_line, allocated); if (!screen) goto out_err; for (lines = 0; lines < allocated; lines++) { diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index c601134eee04..f8e2cc17ac53 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -367,7 +367,7 @@ static struct fs3270 *fs3270_alloc_view(void) { struct fs3270 *fp; - fp = kzalloc_obj(*fp, GFP_KERNEL); + fp = kzalloc_obj(*fp); if (!fp) return ERR_PTR(-ENOMEM); fp->init = raw3270_request_alloc(0); diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index 006c381e2417..ecd9ace2b3aa 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -78,7 +78,7 @@ kbd_alloc(void) { struct kbd_data *kbd; int i; - kbd = kzalloc_obj(struct kbd_data, GFP_KERNEL); + kbd = kzalloc_obj(struct kbd_data); if (!kbd) goto out; kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL); @@ -105,7 +105,7 @@ kbd_alloc(void) { } } kbd->fn_handler = - kzalloc_objs(fn_handler_fn *, NR_FN_HANDLER, GFP_KERNEL); + kzalloc_objs(fn_handler_fn *, NR_FN_HANDLER); if (!kbd->fn_handler) goto out_func; kbd->accent_table = kmemdup(ebc_accent_table, diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index 9c1bcc4f35c5..52bc0c95bfbf 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -181,11 +181,11 @@ static struct mon_private *mon_alloc_mem(void) int i; struct mon_private *monpriv; - monpriv = kzalloc_obj(struct mon_private, GFP_KERNEL); + monpriv = kzalloc_obj(struct mon_private); if (!monpriv) return NULL; for (i = 0; i < MON_MSGLIM; i++) { - monpriv->msg_array[i] = kzalloc_obj(struct mon_msg, GFP_KERNEL); + monpriv->msg_array[i] = kzalloc_obj(struct mon_msg); if (!monpriv->msg_array[i]) { mon_free_mem(monpriv); return NULL; diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index d7ef93351a2e..eaeb4a6384d1 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c @@ -58,8 +58,8 @@ static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn) struct appldata_product_id *id; int rc; - id = kmalloc_obj(*id, GFP_KERNEL); - parm_list = kmalloc_obj(*parm_list, GFP_KERNEL); + id = kmalloc_obj(*id); + parm_list = kmalloc_obj(*parm_list); rc = -ENOMEM; if (!id || !parm_list) goto out; @@ -126,7 +126,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv) } else if (monhdr->mon_function != MONWRITE_STOP_INTERVAL) { if (mon_buf_count >= mon_max_bufs) return -ENOSPC; - monbuf = kzalloc_obj(struct mon_buf, GFP_KERNEL); + monbuf = kzalloc_obj(struct mon_buf); if (!monbuf) return -ENOMEM; monbuf->data = kzalloc(monhdr->datalen, @@ -188,7 +188,7 @@ static int monwrite_open(struct inode *inode, struct file *filp) { struct mon_private *monpriv; - monpriv = kzalloc_obj(struct mon_private, GFP_KERNEL); + monpriv = kzalloc_obj(struct mon_private); if (!monpriv) return -ENOMEM; INIT_LIST_HEAD(&monpriv->list); diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index c4a79cf6db86..1dc93d945be6 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c @@ -66,7 +66,7 @@ int sclp_sync_request_timeout(sclp_cmdw_t cmd, void *sccb, int timeout) struct sclp_req *request; int rc; - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return -ENOMEM; if (timeout) diff --git a/drivers/s390/char/sclp_cpi_sys.c b/drivers/s390/char/sclp_cpi_sys.c index ea3ee83bac85..b80f73fa1e01 100644 --- a/drivers/s390/char/sclp_cpi_sys.c +++ b/drivers/s390/char/sclp_cpi_sys.c @@ -81,7 +81,7 @@ static struct sclp_req *cpi_prepare_req(void) struct cpi_sccb *sccb; struct cpi_evbuf *evb; - req = kzalloc_obj(struct sclp_req, GFP_KERNEL); + req = kzalloc_obj(struct sclp_req); if (!req) return ERR_PTR(-ENOMEM); sccb = (struct cpi_sccb *) get_zeroed_page(GFP_KERNEL | GFP_DMA); diff --git a/drivers/s390/char/sclp_ftp.c b/drivers/s390/char/sclp_ftp.c index f9c15f6f8078..853492d53953 100644 --- a/drivers/s390/char/sclp_ftp.c +++ b/drivers/s390/char/sclp_ftp.c @@ -92,7 +92,7 @@ static int sclp_ftp_et7(const struct hmcdrv_ftp_cmdspec *ftp) ssize_t len; int rc; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); sccb = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); if (!req || !sccb) { rc = -ENOMEM; diff --git a/drivers/s390/char/sclp_mem.c b/drivers/s390/char/sclp_mem.c index 9417857ce401..78c054e26d17 100644 --- a/drivers/s390/char/sclp_mem.c +++ b/drivers/s390/char/sclp_mem.c @@ -431,7 +431,7 @@ static int __init sclp_init_mem(void) max_sclp_mems = roundup(sclp.rnmax * sclp.rzm, block_size) / block_size; /* Allocate memory for all blocks ahead of time. */ - sclp_mems = kzalloc_objs(struct sclp_mem, max_sclp_mems, GFP_KERNEL); + sclp_mems = kzalloc_objs(struct sclp_mem, max_sclp_mems); if (!sclp_mems) return -ENOMEM; kset = kset_create_and_add("memory", NULL, firmware_kobj); @@ -453,7 +453,7 @@ static void __init insert_increment(u16 rn, int standby, int assigned) struct list_head *prev; u16 last_rn; - new_incr = kzalloc_obj(*new_incr, GFP_KERNEL); + new_incr = kzalloc_obj(*new_incr); if (!new_incr) return; new_incr->rn = rn; diff --git a/drivers/s390/char/sclp_sd.c b/drivers/s390/char/sclp_sd.c index ee09803db422..c62b2eacdc13 100644 --- a/drivers/s390/char/sclp_sd.c +++ b/drivers/s390/char/sclp_sd.c @@ -518,7 +518,7 @@ static __init struct sclp_sd_file *sclp_sd_file_create(const char *name, u8 di) struct sclp_sd_file *sd_file; int rc; - sd_file = kzalloc_obj(*sd_file, GFP_KERNEL); + sd_file = kzalloc_obj(*sd_file); if (!sd_file) return NULL; sd_file->di = di; diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index b211324b801f..b69430220a81 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -45,7 +45,7 @@ struct tape_class_device *register_tape_dev( int rc; char * s; - tcd = kzalloc_obj(struct tape_class_device, GFP_KERNEL); + tcd = kzalloc_obj(struct tape_class_device); if (!tcd) return ERR_PTR(-ENOMEM); diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index f3270f22a1ef..bd8e3deb1199 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -477,7 +477,7 @@ tape_alloc_device(void) { struct tape_device *device; - device = kzalloc_obj(struct tape_device, GFP_KERNEL); + device = kzalloc_obj(struct tape_device); if (device == NULL) { DBF_EXCEPTION(2, "ti:no mem\n"); return ERR_PTR(-ENOMEM); @@ -678,7 +678,7 @@ tape_alloc_request(int cplength, int datasize) DBF_LH(6, "tape_alloc_request(%d, %d)\n", cplength, datasize); - request = kzalloc_obj(struct tape_request, GFP_KERNEL); + request = kzalloc_obj(struct tape_request); if (request == NULL) { DBF_EXCEPTION(1, "cqra nomem\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/s390/char/uvdevice.c b/drivers/s390/char/uvdevice.c index 83ed0a26e884..e6a264c996ce 100644 --- a/drivers/s390/char/uvdevice.c +++ b/drivers/s390/char/uvdevice.c @@ -196,7 +196,7 @@ static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) goto out; ret = -ENOMEM; - uvio_attest = kzalloc_obj(*uvio_attest, GFP_KERNEL); + uvio_attest = kzalloc_obj(*uvio_attest); if (!uvio_attest) goto out; @@ -216,7 +216,7 @@ static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) goto out; } - uvcb_attest = kzalloc_obj(*uvcb_attest, GFP_KERNEL); + uvcb_attest = kzalloc_obj(*uvcb_attest); if (!uvcb_attest) goto out; diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index 4cf82f83c175..b277f9d0c321 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c @@ -104,7 +104,7 @@ static int vmcp_open(struct inode *inode, struct file *file) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - session = kmalloc_obj(*session, GFP_KERNEL); + session = kmalloc_obj(*session); if (!session) return -ENOMEM; diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index f855774687b2..a47a40fac848 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c @@ -107,7 +107,7 @@ static struct urdev *urdev_alloc(struct ccw_device *cdev) { struct urdev *urd; - urd = kzalloc_obj(struct urdev, GFP_KERNEL); + urd = kzalloc_obj(struct urdev); if (!urd) return NULL; urd->reclen = cdev->id.driver_info; @@ -396,7 +396,7 @@ static struct urfile *urfile_alloc(struct urdev *urd) { struct urfile *urf; - urf = kzalloc_obj(struct urfile, GFP_KERNEL); + urf = kzalloc_obj(struct urfile); if (!urf) return NULL; urf->urd = urd; diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c index ecccd5f24a4e..061ee91e490e 100644 --- a/drivers/s390/cio/airq.c +++ b/drivers/s390/cio/airq.c @@ -130,7 +130,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags, struct airq_iv *iv; unsigned long size; - iv = kzalloc_obj(*iv, GFP_KERNEL); + iv = kzalloc_obj(*iv); if (!iv) goto out; iv->bits = bits; diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index de07d03f1ed4..c890f21a82ce 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c @@ -530,7 +530,7 @@ int chp_new(struct chp_id chpid) if (chp_is_registered(chpid)) goto out; - chp = kzalloc_obj(struct channel_path, GFP_KERNEL); + chp = kzalloc_obj(struct channel_path); if (!chp) { ret = -ENOMEM; goto out; @@ -593,7 +593,7 @@ struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid) chp = chpid_to_chp(chpid); if (!chp) return NULL; - desc = kmalloc_obj(*desc, GFP_KERNEL); + desc = kmalloc_obj(*desc); if (!desc) return NULL; diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index fcbb2906117f..73413417a2ce 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c @@ -81,7 +81,7 @@ static int chsc_subchannel_probe(struct subchannel *sch) CHSC_MSG(6, "Detected chsc subchannel 0.%x.%04x\n", sch->schid.ssid, sch->schid.sch_no); sch->isc = CHSC_SCH_ISC; - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; dev_set_drvdata(&sch->dev, private); @@ -295,7 +295,7 @@ static int chsc_ioctl_start(void __user *user_area) chsc_area = (void *)get_zeroed_page(GFP_KERNEL); if (!chsc_area) return -ENOMEM; - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) { ret = -ENOMEM; goto out_free; @@ -335,7 +335,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area) ret = -EBUSY; goto out_unlock; } - on_close_request = kzalloc_obj(*on_close_request, GFP_KERNEL); + on_close_request = kzalloc_obj(*on_close_request); if (!on_close_request) { ret = -ENOMEM; goto out_unlock; @@ -441,7 +441,7 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd) scpcd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scpcd_area) return -ENOMEM; - cd = kzalloc_obj(*cd, GFP_KERNEL); + cd = kzalloc_obj(*cd); if (!cd) { ret = -ENOMEM; goto out_free; @@ -503,7 +503,7 @@ static int chsc_ioctl_info_cu(void __user *user_cd) scucd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scucd_area) return -ENOMEM; - cd = kzalloc_obj(*cd, GFP_KERNEL); + cd = kzalloc_obj(*cd); if (!cd) { ret = -ENOMEM; goto out_free; @@ -566,7 +566,7 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud) sscud_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sscud_area) return -ENOMEM; - cud = kzalloc_obj(*cud, GFP_KERNEL); + cud = kzalloc_obj(*cud); if (!cud) { ret = -ENOMEM; goto out_free; @@ -628,7 +628,7 @@ static int chsc_ioctl_conf_info(void __user *user_ci) sci_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sci_area) return -ENOMEM; - ci = kzalloc_obj(*ci, GFP_KERNEL); + ci = kzalloc_obj(*ci); if (!ci) { ret = -ENOMEM; goto out_free; @@ -699,7 +699,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl) sccl_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sccl_area) return -ENOMEM; - ccl = kzalloc_obj(*ccl, GFP_KERNEL); + ccl = kzalloc_obj(*ccl); if (!ccl) { ret = -ENOMEM; goto out_free; @@ -755,7 +755,7 @@ static int chsc_ioctl_chpd(void __user *user_chpd) struct chsc_cpd_info *chpd; int ret; - chpd = kzalloc_obj(*chpd, GFP_KERNEL); + chpd = kzalloc_obj(*chpd); scpd_area = (void *)get_zeroed_page(GFP_KERNEL); if (!scpd_area || !chpd) { ret = -ENOMEM; @@ -799,7 +799,7 @@ static int chsc_ioctl_dcal(void __user *user_dcal) sdcal_area = (void *)get_zeroed_page(GFP_KERNEL); if (!sdcal_area) return -ENOMEM; - dcal = kzalloc_obj(*dcal, GFP_KERNEL); + dcal = kzalloc_obj(*dcal); if (!dcal) { ret = -ENOMEM; goto out_free; diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index cbc0efe0d870..92ab3d546fe4 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -483,11 +483,11 @@ static int alloc_cmb(struct ccw_device *cdev) struct cmb_data *cmb_data; /* Allocate private cmb_data. */ - cmb_data = kzalloc_obj(struct cmb_data, GFP_KERNEL); + cmb_data = kzalloc_obj(struct cmb_data); if (!cmb_data) return -ENOMEM; - cmb_data->last_block = kzalloc_obj(struct cmb, GFP_KERNEL); + cmb_data->last_block = kzalloc_obj(struct cmb); if (!cmb_data->last_block) { kfree(cmb_data); return -ENOMEM; @@ -766,11 +766,11 @@ static int alloc_cmbe(struct ccw_device *cdev) if (!cmbe) return ret; - cmb_data = kzalloc_obj(*cmb_data, GFP_KERNEL); + cmb_data = kzalloc_obj(*cmb_data); if (!cmb_data) goto out_free; - cmb_data->last_block = kzalloc_obj(struct cmbe, GFP_KERNEL); + cmb_data->last_block = kzalloc_obj(struct cmbe); if (!cmb_data->last_block) goto out_free; diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index b6f943d6e30c..174a8fa911f0 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -971,7 +971,7 @@ static int __init setup_css(int nr) struct channel_subsystem *css; int ret; - css = kzalloc_obj(*css, GFP_KERNEL); + css = kzalloc_obj(*css); if (!css) return -ENOMEM; diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 4e6efdcf5617..5bbb112b1619 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -686,7 +686,7 @@ static struct ccw_device * io_subchannel_allocate_dev(struct subchannel *sch) struct gen_pool *dma_pool; int ret; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) { ret = -ENOMEM; goto err_cdev; diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c index bbbf89a65445..b35195e7c68a 100644 --- a/drivers/s390/cio/qdio_debug.c +++ b/drivers/s390/cio/qdio_debug.c @@ -81,7 +81,7 @@ int qdio_allocate_dbf(struct qdio_irq *irq_ptr) } debug_set_level(irq_ptr->debug_area, DBF_WARN); DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created"); - new_entry = kzalloc_obj(struct qdio_dbf_entry, GFP_KERNEL); + new_entry = kzalloc_obj(struct qdio_dbf_entry); if (!new_entry) { debug_unregister(irq_ptr->debug_area); return -ENOMEM; diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c index 22da5887e0ab..d13ed1011c03 100644 --- a/drivers/s390/cio/scm.c +++ b/drivers/s390/cio/scm.c @@ -207,7 +207,7 @@ static int scm_add(struct chsc_scm_info *scm_info, size_t num) put_device(&scmdev->dev); continue; } - scmdev = kzalloc_obj(*scmdev, GFP_KERNEL); + scmdev = kzalloc_obj(*scmdev); if (!scmdev) return -ENODEV; scmdev_setup(scmdev, sale, scm_info->is, scm_info->mbc); diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index 62c9c005b542..7561aa7d3e01 100644 --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c @@ -65,11 +65,11 @@ static int page_array_alloc(struct page_array *pa, unsigned int len) pa->pa_nr = len; - pa->pa_iova = kzalloc_objs(*pa->pa_iova, len, GFP_KERNEL); + pa->pa_iova = kzalloc_objs(*pa->pa_iova, len); if (!pa->pa_iova) return -ENOMEM; - pa->pa_page = kzalloc_objs(*pa->pa_page, len, GFP_KERNEL); + pa->pa_page = kzalloc_objs(*pa->pa_page, len); if (!pa->pa_page) { kfree(pa->pa_iova); return -ENOMEM; @@ -319,7 +319,7 @@ static struct ccwchain *ccwchain_alloc(struct channel_program *cp, int len) { struct ccwchain *chain; - chain = kzalloc_obj(*chain, GFP_KERNEL); + chain = kzalloc_obj(*chain); if (!chain) return NULL; @@ -327,7 +327,7 @@ static struct ccwchain *ccwchain_alloc(struct channel_program *cp, int len) if (!chain->ch_ccw) goto out_err; - chain->ch_pa = kzalloc_objs(*chain->ch_pa, len, GFP_KERNEL); + chain->ch_pa = kzalloc_objs(*chain->ch_pa, len); if (!chain->ch_pa) goto out_err; diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index db0bed2db4eb..1a095085bc72 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c @@ -171,7 +171,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch) return -ENODEV; } - parent = kzalloc_obj(*parent, GFP_KERNEL); + parent = kzalloc_obj(*parent); if (!parent) return -ENOMEM; diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c index bf6ae6e099e9..e827fbeb76fb 100644 --- a/drivers/s390/crypto/ap_card.c +++ b/drivers/s390/crypto/ap_card.c @@ -233,7 +233,7 @@ struct ap_card *ap_card_create(int id, struct ap_tapq_hwinfo hwinfo, { struct ap_card *ac; - ac = kzalloc_obj(*ac, GFP_KERNEL); + ac = kzalloc_obj(*ac); if (!ac) return NULL; ac->ap_dev.device.release = ap_card_device_release; diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c index cf349627a19c..3fe2e41c5c6b 100644 --- a/drivers/s390/crypto/ap_queue.c +++ b/drivers/s390/crypto/ap_queue.c @@ -1183,7 +1183,7 @@ struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac) { struct ap_queue *aq; - aq = kzalloc_obj(*aq, GFP_KERNEL); + aq = kzalloc_obj(*aq); if (!aq) return NULL; aq->card = ac; diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c index 0f0938cd96d2..d6b595eb3370 100644 --- a/drivers/s390/crypto/pkey_api.c +++ b/drivers/s390/crypto/pkey_api.c @@ -223,7 +223,7 @@ static int pkey_ioctl_findcard(struct pkey_findcard __user *ufc) return -EFAULT; nr_apqns = MAXAPQNSINLIST; - apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns); if (!apqns) return -ENOMEM; @@ -569,7 +569,7 @@ static int pkey_ioctl_apqns4k(struct pkey_apqns4key __user *uak) return -EFAULT; nr_apqns = kak.apqn_entries; if (nr_apqns) { - apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns); if (!apqns) return -ENOMEM; } @@ -618,7 +618,7 @@ static int pkey_ioctl_apqns4kt(struct pkey_apqns4keytype __user *uat) return -EFAULT; nr_apqns = kat.apqn_entries; if (nr_apqns) { - apqns = kmalloc_objs(struct pkey_apqn, nr_apqns, GFP_KERNEL); + apqns = kmalloc_objs(struct pkey_apqn, nr_apqns); if (!apqns) return -ENOMEM; } diff --git a/drivers/s390/crypto/pkey_uv.c b/drivers/s390/crypto/pkey_uv.c index a21594c64be6..17a914d111ac 100644 --- a/drivers/s390/crypto/pkey_uv.c +++ b/drivers/s390/crypto/pkey_uv.c @@ -291,7 +291,7 @@ static int __init pkey_uv_init(void) if (!test_bit_inv(BIT_UVC_CMD_RETR_SECRET, uv_info.inst_calls_list)) return -ENODEV; - uv_list = kmalloc_obj(*uv_list, GFP_KERNEL); + uv_list = kmalloc_obj(*uv_list); if (!uv_list) return -ENOMEM; diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c index 5146a3db53fd..fd7394d81880 100644 --- a/drivers/s390/crypto/vfio_ap_drv.c +++ b/drivers/s390/crypto/vfio_ap_drv.c @@ -96,7 +96,7 @@ static int vfio_ap_matrix_dev_create(void) if (ret) goto bus_register_err; - matrix_dev = kzalloc_obj(*matrix_dev, GFP_KERNEL); + matrix_dev = kzalloc_obj(*matrix_dev); if (!matrix_dev) { ret = -ENOMEM; goto matrix_alloc_err; diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index b19068ffcdc8..44b3a1dcc1b3 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -2424,7 +2424,7 @@ int vfio_ap_mdev_probe_queue(struct ap_device *apdev) if (ret) return ret; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) { ret = -ENOMEM; goto err_remove_group; diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 75e1d69346ae..c1f3ee5eda5a 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -397,7 +397,7 @@ static int zcdn_create(const char *name) } /* alloc and prepare a new zcdn device */ - zcdndev = kzalloc_obj(*zcdndev, GFP_KERNEL); + zcdndev = kzalloc_obj(*zcdndev); if (!zcdndev) { rc = -ENOMEM; goto unlockout; @@ -1065,7 +1065,7 @@ static long _zcrypt_send_ep11_cprb(u32 xflags, struct ap_perms *perms, rc = -ENOMEM; if (target_num != 0) { if (userspace) { - targets = kzalloc_objs(*targets, target_num, GFP_KERNEL); + targets = kzalloc_objs(*targets, target_num); if (!targets) goto out; if (copy_from_user(targets, xcrb->targets, diff --git a/drivers/s390/crypto/zcrypt_card.c b/drivers/s390/crypto/zcrypt_card.c index f905132ebad4..16f04e65046b 100644 --- a/drivers/s390/crypto/zcrypt_card.c +++ b/drivers/s390/crypto/zcrypt_card.c @@ -138,7 +138,7 @@ struct zcrypt_card *zcrypt_card_alloc(void) { struct zcrypt_card *zc; - zc = kzalloc_obj(*zc, GFP_KERNEL); + zc = kzalloc_obj(*zc); if (!zc) return NULL; INIT_LIST_HEAD(&zc->list); diff --git a/drivers/s390/crypto/zcrypt_queue.c b/drivers/s390/crypto/zcrypt_queue.c index 73a5987499c9..87457cde2c7c 100644 --- a/drivers/s390/crypto/zcrypt_queue.c +++ b/drivers/s390/crypto/zcrypt_queue.c @@ -115,7 +115,7 @@ struct zcrypt_queue *zcrypt_queue_alloc(size_t reply_buf_size) { struct zcrypt_queue *zq; - zq = kzalloc_obj(*zq, GFP_KERNEL); + zq = kzalloc_obj(*zq); if (!zq) return NULL; zq->reply.msg = kmalloc(reply_buf_size, GFP_KERNEL); diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 22fbe94e5a7e..8b0d76a47d9f 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c @@ -1268,7 +1268,7 @@ static int ctcm_probe_device(struct ccwgroup_device *cgdev) if (!get_device(&cgdev->dev)) return -ENODEV; - priv = kzalloc_obj(struct ctcm_priv, GFP_KERNEL); + priv = kzalloc_obj(struct ctcm_priv); if (!priv) { CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, "%s: memory allocation failure", @@ -1307,7 +1307,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, "%s(%s), type %d, proto %d", __func__, dev_name(&cdev->dev), type, priv->protocol); - ch = kzalloc_obj(struct channel, GFP_KERNEL); + ch = kzalloc_obj(struct channel); if (ch == NULL) return -ENOMEM; @@ -1408,7 +1408,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, fsm_newstate(ch->fsm, CTC_STATE_IDLE); - ch->irb = kzalloc_obj(struct irb, GFP_KERNEL); + ch->irb = kzalloc_obj(struct irb); if (ch->irb == NULL) goto nomem_return; diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c index 35662bd25c3c..aeb102537e7f 100644 --- a/drivers/s390/net/ctcm_mpc.c +++ b/drivers/s390/net/ctcm_mpc.c @@ -1259,7 +1259,7 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv) CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_INFO, "Enter %s(%p)", CTCM_FUNTAIL, priv); - grp = kzalloc_obj(struct mpc_group, GFP_KERNEL); + grp = kzalloc_obj(struct mpc_group); if (grp == NULL) return NULL; diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index c9808772d621..7d0479e4e095 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -598,7 +598,7 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct ism_dev *ism; int ret; - ism = kzalloc_obj(*ism, GFP_KERNEL); + ism = kzalloc_obj(*ism); if (!ism) return -ENOMEM; diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 41041abd3d1b..cf5f760d0e02 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -225,7 +225,7 @@ static struct qeth_buffer_pool_entry *qeth_alloc_pool_entry(unsigned int pages) struct qeth_buffer_pool_entry *entry; unsigned int i; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -324,7 +324,7 @@ static void qeth_free_qdio_queue(struct qeth_qdio_q *q) static struct qeth_qdio_q *qeth_alloc_qdio_queue(void) { - struct qeth_qdio_q *q = kzalloc_obj(*q, GFP_KERNEL); + struct qeth_qdio_q *q = kzalloc_obj(*q); int i; if (!q) @@ -930,7 +930,7 @@ static struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel, if (length > QETH_BUFSIZE) return NULL; - iob = kzalloc_obj(*iob, GFP_KERNEL); + iob = kzalloc_obj(*iob); if (!iob) return NULL; @@ -1626,7 +1626,7 @@ static struct qeth_card *qeth_alloc_card(struct ccwgroup_device *gdev) struct qeth_card *card; QETH_DBF_TEXT(SETUP, 2, "alloccrd"); - card = kzalloc_obj(*card, GFP_KERNEL); + card = kzalloc_obj(*card); if (!card) goto out; QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); @@ -2591,7 +2591,7 @@ static void qeth_free_output_queue(struct qeth_qdio_out_q *q) static struct qeth_qdio_out_q *qeth_alloc_output_queue(void) { - struct qeth_qdio_out_q *q = kzalloc_obj(*q, GFP_KERNEL); + struct qeth_qdio_out_q *q = kzalloc_obj(*q); unsigned int i; if (!q) @@ -6249,7 +6249,7 @@ static int qeth_add_dbf_entry(struct qeth_card *card, char *name) } if (debug_register_view(card->debug, &debug_hex_ascii_view)) goto err_dbg; - new_entry = kzalloc_obj(struct qeth_dbf_entry, GFP_KERNEL); + new_entry = kzalloc_obj(struct qeth_dbf_entry); if (!new_entry) goto err_dbg; strscpy(new_entry->dbf_name, name, sizeof(new_entry->dbf_name)); diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index db0985fe35b3..aa2603122e2c 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c @@ -431,7 +431,7 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count, if (rc) return rc; - ipatoe = kzalloc_obj(struct qeth_ipato_entry, GFP_KERNEL); + ipatoe = kzalloc_obj(struct qeth_ipato_entry); if (!ipatoe) return -ENOMEM; diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 645d7edcbf2d..852bb2d5eba2 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -92,7 +92,7 @@ int smsg_register_callback(const char *prefix, { struct smsg_callback *cb; - cb = kmalloc_obj(struct smsg_callback, GFP_KERNEL); + cb = kmalloc_obj(struct smsg_callback); if (!cb) return -ENOMEM; cb->prefix = prefix; diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index f8435ea9a967..8ff7db7921b5 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -344,7 +344,7 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) if (!get_device(&ccw_device->dev)) return ERR_PTR(-ENODEV); - adapter = kzalloc_obj(struct zfcp_adapter, GFP_KERNEL); + adapter = kzalloc_obj(struct zfcp_adapter); if (!adapter) { put_device(&ccw_device->dev); return ERR_PTR(-ENOMEM); @@ -518,7 +518,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, goto err_put; } - port = kzalloc_obj(struct zfcp_port, GFP_KERNEL); + port = kzalloc_obj(struct zfcp_port); if (!port) goto err_put; diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 37938e6903ef..71f625926ae1 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -816,7 +816,7 @@ int zfcp_dbf_adapter_register(struct zfcp_adapter *adapter) char name[DEBUG_MAX_NAME_LEN]; struct zfcp_dbf *dbf; - dbf = kzalloc_obj(struct zfcp_dbf, GFP_KERNEL); + dbf = kzalloc_obj(struct zfcp_dbf); if (!dbf) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_diag.c b/drivers/s390/scsi/zfcp_diag.c index e8c9077b4e96..7be5a1d56263 100644 --- a/drivers/s390/scsi/zfcp_diag.c +++ b/drivers/s390/scsi/zfcp_diag.c @@ -36,7 +36,7 @@ int zfcp_diag_adapter_setup(struct zfcp_adapter *const adapter) struct zfcp_diag_adapter *diag; struct zfcp_diag_header *hdr; - diag = kzalloc_obj(*diag, GFP_KERNEL); + diag = kzalloc_obj(*diag); if (diag == NULL) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index c212ca0924f8..05d081297879 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -1116,7 +1116,7 @@ int zfcp_fc_gs_setup(struct zfcp_adapter *adapter) { struct zfcp_fc_wka_ports *wka_ports; - wka_ports = kzalloc_obj(struct zfcp_fc_wka_ports, GFP_KERNEL); + wka_ports = kzalloc_obj(struct zfcp_fc_wka_ports); if (!wka_ports) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 3febefc80ccf..ce1af72d9b61 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -549,7 +549,7 @@ int zfcp_qdio_setup(struct zfcp_adapter *adapter) { struct zfcp_qdio *qdio; - qdio = kzalloc_obj(struct zfcp_qdio, GFP_KERNEL); + qdio = kzalloc_obj(struct zfcp_qdio); if (!qdio) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_reqlist.h b/drivers/s390/scsi/zfcp_reqlist.h index 2037424f9981..a0fd4739ff4a 100644 --- a/drivers/s390/scsi/zfcp_reqlist.h +++ b/drivers/s390/scsi/zfcp_reqlist.h @@ -42,7 +42,7 @@ static inline struct zfcp_reqlist *zfcp_reqlist_alloc(void) size_t i; struct zfcp_reqlist *rl; - rl = kzalloc_obj(struct zfcp_reqlist, GFP_KERNEL); + rl = kzalloc_obj(struct zfcp_reqlist); if (!rl) return NULL; diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index f78df15b384a..3590113c2b74 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -542,7 +542,7 @@ zfcp_scsi_init_fc_host_stats(struct zfcp_adapter *adapter) struct fc_host_statistics *fc_stats; if (!adapter->fc_stats) { - fc_stats = kmalloc_obj(*fc_stats, GFP_KERNEL); + fc_stats = kmalloc_obj(*fc_stats); if (!fc_stats) return NULL; adapter->fc_stats = fc_stats; /* freed in adapter_release */ @@ -622,7 +622,7 @@ zfcp_scsi_get_fc_host_stats(struct Scsi_Host *host) if (!fc_stats) return NULL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; @@ -651,7 +651,7 @@ static void zfcp_scsi_reset_fc_host_stats(struct Scsi_Host *shost) int ret; adapter = (struct zfcp_adapter *)shost->hostdata[0]; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 33ea87286c35..42423549e511 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c @@ -708,7 +708,7 @@ static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev, if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) return -EOPNOTSUPP; - qtcb_port = kzalloc_obj(struct fsf_qtcb_bottom_port, GFP_KERNEL); + qtcb_port = kzalloc_obj(struct fsf_qtcb_bottom_port); if (!qtcb_port) return -ENOMEM; @@ -733,7 +733,7 @@ static int zfcp_sysfs_adapter_ex_config(struct device *dev, if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) return -EOPNOTSUPP; - qtcb_config = kzalloc_obj(struct fsf_qtcb_bottom_config, GFP_KERNEL); + qtcb_config = kzalloc_obj(struct fsf_qtcb_bottom_config); if (!qtcb_config) return -ENOMEM; diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c index 0f47643cd5d9..510cb248cf83 100644 --- a/drivers/s390/scsi/zfcp_unit.c +++ b/drivers/s390/scsi/zfcp_unit.c @@ -137,7 +137,7 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) goto out; } - unit = kzalloc_obj(struct zfcp_unit, GFP_KERNEL); + unit = kzalloc_obj(struct zfcp_unit); if (!unit) { retval = -ENOMEM; goto out; diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index ae36a1f410a5..bab6cad3fd5c 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -277,7 +277,7 @@ static struct airq_info *new_airq_info(int index) struct airq_info *info; int rc; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return NULL; rwlock_init(&info->lock); @@ -566,7 +566,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev, notify = virtio_ccw_kvm_notify; /* Allocate queue. */ - info = kzalloc_obj(struct virtio_ccw_vq_info, GFP_KERNEL); + info = kzalloc_obj(struct virtio_ccw_vq_info); if (!info) { dev_warn(&vcdev->cdev->dev, "no info\n"); err = -ENOMEM; @@ -1370,7 +1370,7 @@ static int virtio_ccw_online(struct ccw_device *cdev) struct virtio_ccw_device *vcdev; unsigned long flags; - vcdev = kzalloc_obj(*vcdev, GFP_KERNEL); + vcdev = kzalloc_obj(*vcdev); if (!vcdev) { dev_warn(&cdev->dev, "Could not get memory for virtio\n"); ret = -ENOMEM; diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index 9f9cb764d8be..d3083a547aa5 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c @@ -448,7 +448,7 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op, { struct bbc_cpu_temperature *tp; - tp = kzalloc_obj(*tp, GFP_KERNEL); + tp = kzalloc_obj(*tp); if (!tp) return; @@ -496,7 +496,7 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op, { struct bbc_fan_control *fp; - fp = kzalloc_obj(*fp, GFP_KERNEL); + fp = kzalloc_obj(*fp); if (!fp) return; diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 3a4b36514485..1801ba56389c 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -92,7 +92,7 @@ struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_de struct bbc_i2c_client *client; const u32 *reg; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return NULL; client->bp = bp; @@ -298,7 +298,7 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index struct device_node *dp; int entry; - bp = kzalloc_obj(*bp, GFP_KERNEL); + bp = kzalloc_obj(*bp); if (!bp) return NULL; diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 77de0d987d44..0b90a2450429 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -666,7 +666,7 @@ static int openprom_open(struct inode * inode, struct file * file) { DATA *data; - data = kmalloc_obj(DATA, GFP_KERNEL); + data = kmalloc_obj(DATA); if (!data) return -ENOMEM; diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c index ff31511a6c85..45df0b274491 100644 --- a/drivers/sbus/char/oradax.c +++ b/drivers/sbus/char/oradax.c @@ -643,11 +643,11 @@ static int dax_open(struct inode *inode, struct file *f) struct dax_ctx *ctx = NULL; int i; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (ctx == NULL) goto done; - ctx->ccb_buf = kzalloc_objs(struct dax_ccb, DAX_MAX_CCBS, GFP_KERNEL); + ctx->ccb_buf = kzalloc_objs(struct dax_ccb, DAX_MAX_CCBS); if (ctx->ccb_buf == NULL) goto done; diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index e9a28ab02ddb..85aaec5876a7 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -348,7 +348,7 @@ static int uctrl_probe(struct platform_device *op) struct uctrl_driver *p; int err = -ENOMEM; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { printk(KERN_ERR "uctrl: Unable to allocate device struct.\n"); goto out; diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 35bc55f8195d..9b93a2440af8 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -1184,7 +1184,7 @@ static int twa_initialize_device_extension(TW_Device_Extension *tw_dev) } /* Allocate event info space */ - tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH, GFP_KERNEL); + tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH); if (!tw_dev->event_queue[0]) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); goto out; diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index cbc3af2694cb..52dc1aa639f7 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -1052,7 +1052,7 @@ static int twl_initialize_device_extension(TW_Device_Extension *tw_dev) } /* Allocate event info space */ - tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH, GFP_KERNEL); + tw_dev->event_queue[0] = kzalloc_objs(TW_Event, TW_Q_LENGTH); if (!tw_dev->event_queue[0]) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0xc, "Event info memory allocation failed"); goto out; diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 1152a0151545..6545ef855bd1 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -2222,7 +2222,7 @@ static int __init blogic_init(void) return -ENOMEM; } - adapter = kzalloc_obj(struct blogic_adapter, GFP_KERNEL); + adapter = kzalloc_obj(struct blogic_adapter); if (adapter == NULL) { kfree(blogic_probeinfo_list); blogic_err("BusLogic: Unable to allocate Prototype Host Adapter\n", NULL); diff --git a/drivers/scsi/a4000t.c b/drivers/scsi/a4000t.c index cf7d1f867081..a02638b477de 100644 --- a/drivers/scsi/a4000t.c +++ b/drivers/scsi/a4000t.c @@ -47,7 +47,7 @@ static int __init amiga_a4000t_scsi_probe(struct platform_device *pdev) "A4000T builtin SCSI")) return -EBUSY; - hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters); if (!hostdata) { dev_err(&pdev->dev, "Failed to allocate host data\n"); goto out_release; diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 6df882e264f6..2e8119ce4411 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -820,7 +820,7 @@ int aac_probe_container(struct aac_dev *dev, int cid) { struct aac_cmd_priv *cmd_priv; struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd) + sizeof(*cmd_priv), GFP_KERNEL); - struct scsi_device *scsidev = kzalloc_obj(*scsidev, GFP_KERNEL); + struct scsi_device *scsidev = kzalloc_obj(*scsidev); int status; if (!scsicmd || !scsidev) { diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index f7dca5ab3f6d..bd82aeb679ae 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c @@ -169,7 +169,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg) struct aac_fib_context * fibctx; int status; - fibctx = kmalloc_obj(struct aac_fib_context, GFP_KERNEL); + fibctx = kmalloc_obj(struct aac_fib_context); if (fibctx == NULL) { status = -ENOMEM; } else { diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index e425dee827a3..9bd3f5b868bc 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -632,7 +632,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) * Ok now init the communication subsystem */ - dev->queues = kzalloc_obj(struct aac_queue_block, GFP_KERNEL); + dev->queues = kzalloc_obj(struct aac_queue_block); if (dev->queues == NULL) { printk(KERN_ERR "Error could not allocate comm region.\n"); return NULL; diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 3502e5e47539..c4485629f792 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1907,13 +1907,13 @@ static int fillup_pools(struct aac_dev *dev, struct hw_fib **hw_fib_pool, hw_fib_p = hw_fib_pool; fib_p = fib_pool; while (hw_fib_p < &hw_fib_pool[num]) { - *(hw_fib_p) = kmalloc_obj(struct hw_fib, GFP_KERNEL); + *(hw_fib_p) = kmalloc_obj(struct hw_fib); if (!(*(hw_fib_p++))) { --hw_fib_p; break; } - *(fib_p) = kmalloc_obj(struct fib, GFP_KERNEL); + *(fib_p) = kmalloc_obj(struct fib); if (!(*(fib_p++))) { kfree(*(--hw_fib_p)); break; @@ -2101,11 +2101,11 @@ static void aac_process_events(struct aac_dev *dev) if (!num) goto free_fib; - hw_fib_pool = kmalloc_objs(struct hw_fib *, num, GFP_KERNEL); + hw_fib_pool = kmalloc_objs(struct hw_fib *, num); if (!hw_fib_pool) goto free_fib; - fib_pool = kmalloc_objs(struct fib *, num, GFP_KERNEL); + fib_pool = kmalloc_objs(struct fib *, num); if (!fib_pool) goto free_hw_fib_pool; diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index f78448254f99..fcf059bf41e8 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -11314,7 +11314,7 @@ static int advansys_eisa_probe(struct device *dev) struct eisa_scsi_data *data; err = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto fail; ioport = edev->base_addr + 0xc30; diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 243f8d6166a5..4400a3661d90 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -642,9 +642,9 @@ static int asd_register_sas_ha(struct asd_ha_struct *asd_ha) { int i; struct asd_sas_phy **sas_phys = - kzalloc_objs(*sas_phys, ASD_MAX_PHYS, GFP_KERNEL); + kzalloc_objs(*sas_phys, ASD_MAX_PHYS); struct asd_sas_port **sas_ports = - kzalloc_objs(*sas_ports, ASD_MAX_PHYS, GFP_KERNEL); + kzalloc_objs(*sas_ports, ASD_MAX_PHYS); if (!sas_phys || !sas_ports) { kfree(sas_phys); @@ -710,7 +710,7 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) asd_dev = &asd_pcidev_data[asd_id]; - asd_ha = kzalloc_obj(*asd_ha, GFP_KERNEL); + asd_ha = kzalloc_obj(*asd_ha); if (!asd_ha) { asd_printk("out of memory\n"); goto Err_put; diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c index 89d1e385af69..57818393f9f0 100644 --- a/drivers/scsi/aic94xx/aic94xx_sds.c +++ b/drivers/scsi/aic94xx/aic94xx_sds.c @@ -207,7 +207,7 @@ static int asd_get_bios_chim(struct asd_ha_struct *asd_ha, goto out; } err = -ENOMEM; - bc_struct = kmalloc_obj(*bc_struct, GFP_KERNEL); + bc_struct = kmalloc_obj(*bc_struct); if (!bc_struct) { asd_printk("no memory for bios_chim struct\n"); goto out; @@ -341,7 +341,7 @@ int asd_read_ocm(struct asd_ha_struct *asd_ha) if (asd_hwi_check_ocm_access(asd_ha)) return -1; - dir = kmalloc_obj(*dir, GFP_KERNEL); + dir = kmalloc_obj(*dir); if (!dir) { asd_printk("no memory for ocm dir\n"); return -ENOMEM; @@ -1040,7 +1040,7 @@ int asd_read_flash(struct asd_ha_struct *asd_ha) if (err) return err; - flash_dir = kmalloc_obj(*flash_dir, GFP_KERNEL); + flash_dir = kmalloc_obj(*flash_dir); if (!flash_dir) return -ENOMEM; diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c index 734b5a9dcf5e..f972a3c90a2f 100644 --- a/drivers/scsi/am53c974.c +++ b/drivers/scsi/am53c974.c @@ -396,7 +396,7 @@ static int pci_esp_probe_one(struct pci_dev *pdev, goto fail_disable_device; } - pep = kzalloc_obj(struct pci_esp_priv, GFP_KERNEL); + pep = kzalloc_obj(struct pci_esp_priv); if (!pep) { dev_printk(KERN_INFO, &pdev->dev, "failed to allocate esp_priv\n"); diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c index 2849f59b6015..797cf4971f5d 100644 --- a/drivers/scsi/arm/queue.c +++ b/drivers/scsi/arm/queue.c @@ -71,7 +71,7 @@ int queue_initialise (Queue_t *queue) * need to keep free lists or allocate this * memory. */ - queue->alloc = q = kmalloc_objs(QE_t, nqueues, GFP_KERNEL); + queue->alloc = q = kmalloc_objs(QE_t, nqueues); if (q) { for (; nqueues; q++, nqueues--) { SET_MAGIC(q, QUEUE_MAGIC_FREE); diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 1242ae2694c1..6c264def9911 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -2484,7 +2484,7 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba) return -ENOMEM; } - phba->init_mem = kzalloc_objs(*mem_descr, SE_MEM_MAX, GFP_KERNEL); + phba->init_mem = kzalloc_objs(*mem_descr, SE_MEM_MAX); if (!phba->init_mem) { kfree(phwi_ctrlr->wrb_context); kfree(phba->phwi_ctrlr); @@ -2540,7 +2540,7 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba) } while (alloc_size); mem_descr->num_elements = j; mem_descr->size_in_bytes = phba->mem_req[i]; - mem_descr->mem_array = kmalloc_objs(*mem_arr, j, GFP_KERNEL); + mem_descr->mem_array = kmalloc_objs(*mem_arr, j); if (!mem_descr->mem_array) goto free_mem; diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 9285e9922ea8..2df399c537c1 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c @@ -1863,7 +1863,7 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) u8 *curr_ptr; u16 templen, count; - fcs_hba_attr = kzalloc_obj(*fcs_hba_attr, GFP_KERNEL); + fcs_hba_attr = kzalloc_obj(*fcs_hba_attr); if (!fcs_hba_attr) return -ENOMEM; diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 629942abc5ca..448f736457f0 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -640,7 +640,7 @@ bfad_vport_create(struct bfad_s *bfad, u16 vf_id, unsigned long flags; struct completion fcomp; - vport = kzalloc_obj(struct bfad_vport_s, GFP_KERNEL); + vport = kzalloc_obj(struct bfad_vport_s); if (!vport) { rc = BFA_STATUS_ENOMEM; goto ext; @@ -1271,13 +1271,13 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) (PCI_FUNC(pdev->devfn) != 0)) return -ENODEV; - bfad = kzalloc_obj(struct bfad_s, GFP_KERNEL); + bfad = kzalloc_obj(struct bfad_s); if (!bfad) { error = -ENOMEM; goto out; } - bfad->trcmod = kzalloc_obj(struct bfa_trc_mod_s, GFP_KERNEL); + bfad->trcmod = kzalloc_obj(struct bfa_trc_mod_s); if (!bfad->trcmod) { printk(KERN_WARNING "Error alloc trace buffer!\n"); error = -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index 50f975d63c07..9751beff817d 100644 --- a/drivers/scsi/bfa/bfad_attr.c +++ b/drivers/scsi/bfa/bfad_attr.c @@ -264,7 +264,7 @@ bfad_im_get_stats(struct Scsi_Host *shost) bfa_status_t rc; unsigned long flags; - fcstats = kzalloc_obj(union bfa_port_stats_u, GFP_KERNEL); + fcstats = kzalloc_obj(union bfa_port_stats_u); if (fcstats == NULL) return NULL; diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 0a33657e67d5..292bc9aa43f1 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c @@ -3410,7 +3410,7 @@ bfad_im_bsg_els_ct_request(struct bsg_job *job) goto out; } - drv_fcxp = kzalloc_obj(struct bfad_fcxp, GFP_KERNEL); + drv_fcxp = kzalloc_obj(struct bfad_fcxp); if (drv_fcxp == NULL) { kfree(bsg_fcpt); rc = -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c index 335f5f6a96fa..2f9bb8fa7fa7 100644 --- a/drivers/scsi/bfa/bfad_debugfs.c +++ b/drivers/scsi/bfa/bfad_debugfs.c @@ -46,7 +46,7 @@ bfad_debugfs_open_drvtrc(struct inode *inode, struct file *file) struct bfad_s *bfad = port->bfad; struct bfad_debug_info *debug; - debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); + debug = kzalloc_obj(struct bfad_debug_info); if (!debug) return -ENOMEM; @@ -67,7 +67,7 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); + fw_debug = kzalloc_obj(struct bfad_debug_info); if (!fw_debug) return -ENOMEM; @@ -109,7 +109,7 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file *file) unsigned long flags; int rc; - fw_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); + fw_debug = kzalloc_obj(struct bfad_debug_info); if (!fw_debug) return -ENOMEM; @@ -147,7 +147,7 @@ bfad_debugfs_open_reg(struct inode *inode, struct file *file) { struct bfad_debug_info *reg_debug; - reg_debug = kzalloc_obj(struct bfad_debug_info, GFP_KERNEL); + reg_debug = kzalloc_obj(struct bfad_debug_info); if (!reg_debug) return -ENOMEM; diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 1feb2a9517c7..97990b285e17 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -698,7 +698,7 @@ bfad_im_probe(struct bfad_s *bfad) { struct bfad_im_s *im; - im = kzalloc_obj(struct bfad_im_s, GFP_KERNEL); + im = kzalloc_obj(struct bfad_im_s); if (im == NULL) return BFA_STATUS_ENOMEM; @@ -994,7 +994,7 @@ bfad_im_supported_speeds(struct bfa_s *bfa) struct bfa_ioc_attr_s *ioc_attr; u32 supported_speed = 0; - ioc_attr = kzalloc_obj(struct bfa_ioc_attr_s, GFP_KERNEL); + ioc_attr = kzalloc_obj(struct bfa_ioc_attr_s); if (!ioc_attr) return 0; diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 84f7f7ef75b3..c2f2c383b1f4 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -1356,7 +1356,7 @@ static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) struct fcoe_capabilities *fcoe_cap; int rc; - hba = kzalloc_obj(*hba, GFP_KERNEL); + hba = kzalloc_obj(*hba); if (!hba) { printk(KERN_ERR PFX "Unable to allocate hba structure\n"); return NULL; @@ -1492,7 +1492,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface, struct bnx2fc_hba *hba = interface->hba; int rc = 0; - blport = kzalloc_obj(struct bnx2fc_lport, GFP_KERNEL); + blport = kzalloc_obj(struct bnx2fc_lport); if (!blport) { BNX2FC_HBA_DBG(ctlr->lp, "Unable to alloc blport\n"); return NULL; @@ -2200,7 +2200,7 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr) if (!hba->cnic->get_fc_npiv_tbl) goto done; - npiv_tbl = kzalloc_obj(struct cnic_fc_npiv_tbl, GFP_KERNEL); + npiv_tbl = kzalloc_obj(struct cnic_fc_npiv_tbl); if (!npiv_tbl) goto done; diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index ba299196dee9..d8d6afed1575 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -241,7 +241,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) } cmgr->hba = hba; - cmgr->free_list = kzalloc_objs(*cmgr->free_list, arr_sz, GFP_KERNEL); + cmgr->free_list = kzalloc_objs(*cmgr->free_list, arr_sz); if (!cmgr->free_list) { printk(KERN_ERR PFX "failed to alloc free_list\n"); goto mem_err; @@ -271,7 +271,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) xid = BNX2FC_MIN_XID; num_pri_ios = num_ios - hba->elstm_xids; for (i = 0; i < num_ios; i++) { - io_req = kzalloc_obj(*io_req, GFP_KERNEL); + io_req = kzalloc_obj(*io_req); if (!io_req) { printk(KERN_ERR PFX "failed to alloc io_req\n"); diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c index f276f4f4eadf..23301edf100d 100644 --- a/drivers/scsi/bvme6000_scsi.c +++ b/drivers/scsi/bvme6000_scsi.c @@ -44,7 +44,7 @@ bvme6000_probe(struct platform_device *dev) if (!MACH_IS_BVME6000) goto out; - hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters); if (!hostdata) { printk(KERN_ERR "bvme6000-scsi: " "Failed to allocate host data\n"); diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 3a6ab2d09ded..4010fdbf813c 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -364,7 +364,7 @@ ch_readconfig(scsi_changer *ch) } /* look up the devices of the data transfer elements */ - ch->dt = kzalloc_objs(*ch->dt, ch->counts[CHET_DT], GFP_KERNEL); + ch->dt = kzalloc_objs(*ch->dt, ch->counts[CHET_DT]); if (!ch->dt) { kfree(buffer); @@ -903,7 +903,7 @@ static int ch_probe(struct scsi_device *sd) if (sd->type != TYPE_MEDIUM_CHANGER) return -ENODEV; - ch = kzalloc_obj(*ch, GFP_KERNEL); + ch = kzalloc_obj(*ch); if (NULL == ch) return -ENOMEM; diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 03299d5e523a..df9f81f29950 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -2429,7 +2429,7 @@ csio_hw_flash_fw(struct csio_hw *hw, int *reset) /* allocate memory to read the header of the firmware on the * card */ - card_fw = kmalloc_obj(*card_fw, GFP_KERNEL); + card_fw = kmalloc_obj(*card_fw); if (!card_fw) return -ENOMEM; @@ -4389,7 +4389,7 @@ csio_hw_init(struct csio_hw *hw) INIT_LIST_HEAD(&hw->evt_free_q); for (i = 0; i < csio_evtq_sz; i++) { - evt_entry = kzalloc_obj(struct csio_evt_msg, GFP_KERNEL); + evt_entry = kzalloc_obj(struct csio_evt_msg); if (!evt_entry) { rv = -ENOMEM; csio_err(hw, "Failed to initialize eventq"); diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c index 1d2fcccb46c2..238431524801 100644 --- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -516,7 +516,7 @@ static struct csio_hw *csio_hw_alloc(struct pci_dev *pdev) { struct csio_hw *hw; - hw = kzalloc_obj(struct csio_hw, GFP_KERNEL); + hw = kzalloc_obj(struct csio_hw); if (!hw) goto err; diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c index cdd61b990c64..3e201f2c56da 100644 --- a/drivers/scsi/csiostor/csio_lnode.c +++ b/drivers/scsi/csiostor/csio_lnode.c @@ -1837,7 +1837,7 @@ csio_ln_fdmi_init(struct csio_lnode *ln) struct csio_dma_buf *dma_buf; /* Allocate MGMT request required for FDMI */ - ln->mgmt_req = kzalloc_obj(struct csio_ioreq, GFP_KERNEL); + ln->mgmt_req = kzalloc_obj(struct csio_ioreq); if (!ln->mgmt_req) { csio_ln_err(ln, "Failed to alloc ioreq for FDMI\n"); CSIO_INC_STATS(hw, n_err_nomem); @@ -2002,7 +2002,7 @@ csio_ln_init(struct csio_lnode *ln) /* This is the lnode used during initialization */ - ln->fcfinfo = kzalloc_obj(struct csio_fcf_info, GFP_KERNEL); + ln->fcfinfo = kzalloc_obj(struct csio_fcf_info); if (!ln->fcfinfo) { csio_ln_err(ln, "Failed to alloc FCF record\n"); CSIO_INC_STATS(hw, n_err_nomem); diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 2c75c2663f73..b1de615cf316 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -2341,7 +2341,7 @@ csio_scsi_alloc_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw, for (n = 0; n < num_buf; n++) { /* Set unit size to request size */ unit_size = buf_size; - ddp_desc = kzalloc_obj(struct csio_dma_buf, GFP_KERNEL); + ddp_desc = kzalloc_obj(struct csio_dma_buf); if (!ddp_desc) { csio_err(hw, "Failed to allocate ddp descriptors," @@ -2435,7 +2435,7 @@ csio_scsim_init(struct csio_scsim *scm, struct csio_hw *hw) INIT_LIST_HEAD(&scm->ioreq_freelist); for (i = 0; i < csio_scsi_ioreqs; i++) { - ioreq = kzalloc_obj(struct csio_ioreq, GFP_KERNEL); + ioreq = kzalloc_obj(struct csio_ioreq); if (!ioreq) { csio_err(hw, "I/O request element allocation failed, " diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c index 0310fa71ab07..4769e39a8b64 100644 --- a/drivers/scsi/csiostor/csio_wr.c +++ b/drivers/scsi/csiostor/csio_wr.c @@ -1650,12 +1650,12 @@ csio_wrm_init(struct csio_wrm *wrm, struct csio_hw *hw) return -EINVAL; } - wrm->q_arr = kzalloc_objs(struct csio_q *, wrm->num_q, GFP_KERNEL); + wrm->q_arr = kzalloc_objs(struct csio_q *, wrm->num_q); if (!wrm->q_arr) goto err; for (i = 0; i < wrm->num_q; i++) { - wrm->q_arr[i] = kzalloc_obj(struct csio_q, GFP_KERNEL); + wrm->q_arr[i] = kzalloc_obj(struct csio_q); if (!wrm->q_arr[i]) { while (--i >= 0) kfree(wrm->q_arr[i]); diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 842476f131fd..efb08b9b145a 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -219,7 +219,7 @@ static struct alua_port_group *alua_alloc_pg(struct scsi_device *sdev, { struct alua_port_group *pg, *tmp_pg; - pg = kzalloc_obj(struct alua_port_group, GFP_KERNEL); + pg = kzalloc_obj(struct alua_port_group); if (!pg) return ERR_PTR(-ENOMEM); @@ -1137,7 +1137,7 @@ static int alua_activate(struct scsi_device *sdev, struct alua_queue_data *qdata; struct alua_port_group *pg; - qdata = kzalloc_obj(*qdata, GFP_KERNEL); + qdata = kzalloc_obj(*qdata); if (!qdata) { err = SCSI_DH_RES_TEMP_UNAVAIL; goto out; @@ -1239,7 +1239,7 @@ static int alua_bus_attach(struct scsi_device *sdev) struct alua_dh_data *h; int err; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return SCSI_DH_NOMEM; spin_lock_init(&h->pg_lock); diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 5a2f6f09de07..ff41b51ef462 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -478,7 +478,7 @@ static int clariion_bus_attach(struct scsi_device *sdev) struct clariion_dh_data *h; int err; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return SCSI_DH_NOMEM; h->lun_state = CLARIION_LUN_UNINITIALIZED; diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 36d877afff4b..6e8849d7f0a3 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -226,7 +226,7 @@ static int hp_sw_bus_attach(struct scsi_device *sdev) struct hp_sw_dh_data *h; int ret; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return SCSI_DH_NOMEM; h->path_state = HP_SW_PATH_UNINITIALIZED; diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 088dc509d505..88c8e36b221e 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -601,7 +601,7 @@ static int queue_mode_select(struct scsi_device *sdev, struct rdac_queue_data *qdata; struct rdac_controller *ctlr; - qdata = kzalloc_obj(*qdata, GFP_KERNEL); + qdata = kzalloc_obj(*qdata); if (!qdata) return SCSI_DH_RETRY; @@ -741,7 +741,7 @@ static int rdac_bus_attach(struct scsi_device *sdev) char array_name[ARRAY_LABEL_LEN]; char array_id[UNIQUE_ID_LEN]; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return SCSI_DH_NOMEM; h->lun = UNINITIALIZED_LUN; diff --git a/drivers/scsi/elx/efct/efct_driver.c b/drivers/scsi/elx/efct/efct_driver.c index 03c0dbee779f..07c2f453459e 100644 --- a/drivers/scsi/elx/efct/efct_driver.c +++ b/drivers/scsi/elx/efct/efct_driver.c @@ -93,7 +93,7 @@ efct_efclib_config(struct efct *efct, struct libefc_function_template *tt) struct sli4 *sli; int rc = 0; - efc = kzalloc_obj(*efc, GFP_KERNEL); + efc = kzalloc_obj(*efc); if (!efc) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_hw.c b/drivers/scsi/elx/efct/efct_hw.c index aba82cb69459..fd9a980ef502 100644 --- a/drivers/scsi/elx/efct/efct_hw.c +++ b/drivers/scsi/elx/efct/efct_hw.c @@ -487,14 +487,14 @@ efct_hw_setup_io(struct efct_hw *hw) struct efct *efct = hw->os; if (!hw->io) { - hw->io = kmalloc_objs(io, hw->config.n_io, GFP_KERNEL); + hw->io = kmalloc_objs(io, hw->config.n_io); if (!hw->io) return -ENOMEM; memset(hw->io, 0, hw->config.n_io * sizeof(io)); for (i = 0; i < hw->config.n_io; i++) { - hw->io[i] = kzalloc_obj(*io, GFP_KERNEL); + hw->io[i] = kzalloc_obj(*io); if (!hw->io[i]) goto error; } @@ -611,7 +611,7 @@ efct_hw_init_prereg_io(struct efct_hw *hw) struct efc_dma req; struct efct *efct = hw->os; - sgls = kmalloc_objs(*sgls, sgls_per_request, GFP_KERNEL); + sgls = kmalloc_objs(*sgls, sgls_per_request); if (!sgls) return -ENOMEM; @@ -1182,7 +1182,7 @@ efct_hw_rx_buffer_alloc(struct efct_hw *hw, u32 rqindex, u32 count, if (!count) return NULL; - rq_buf = kmalloc_objs(*rq_buf, count, GFP_KERNEL); + rq_buf = kmalloc_objs(*rq_buf, count); if (!rq_buf) return NULL; memset(rq_buf, 0, sizeof(*rq_buf) * count); @@ -2064,7 +2064,7 @@ efct_hw_reqtag_pool_alloc(struct efct_hw *hw) struct reqtag_pool *reqtag_pool; struct hw_wq_callback *wqcb; - reqtag_pool = kzalloc_obj(*reqtag_pool, GFP_KERNEL); + reqtag_pool = kzalloc_obj(*reqtag_pool); if (!reqtag_pool) return NULL; @@ -2072,7 +2072,7 @@ efct_hw_reqtag_pool_alloc(struct efct_hw *hw) /* initialize reqtag pool lock */ spin_lock_init(&reqtag_pool->lock); for (i = 0; i < U16_MAX; i++) { - wqcb = kmalloc_obj(*wqcb, GFP_KERNEL); + wqcb = kmalloc_obj(*wqcb); if (!wqcb) break; @@ -3239,7 +3239,7 @@ efct_hw_async_call(struct efct_hw *hw, efct_hw_async_cb_t callback, void *arg) * we need this to be persistent as the mbox cmd submission may be * queued and executed later execution. */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -3307,7 +3307,7 @@ efct_hw_firmware_write(struct efct_hw *hw, struct efc_dma *dma, u32 size, struct efct_hw_fw_wr_cb_arg *cb_arg; int noc = 0; - cb_arg = kzalloc_obj(*cb_arg, GFP_KERNEL); + cb_arg = kzalloc_obj(*cb_arg); if (!cb_arg) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_hw_queues.c b/drivers/scsi/elx/efct/efct_hw_queues.c index 83d8f2c37569..3c27f927f96c 100644 --- a/drivers/scsi/elx/efct/efct_hw_queues.c +++ b/drivers/scsi/elx/efct/efct_hw_queues.c @@ -127,7 +127,7 @@ efct_hw_map_wq_cpu(struct efct_hw *hw) struct hw_eq * efct_hw_new_eq(struct efct_hw *hw, u32 entry_count) { - struct hw_eq *eq = kzalloc_obj(*eq, GFP_KERNEL); + struct hw_eq *eq = kzalloc_obj(*eq); if (!eq) return NULL; @@ -159,7 +159,7 @@ struct hw_cq * efct_hw_new_cq(struct hw_eq *eq, u32 entry_count) { struct efct_hw *hw = eq->hw; - struct hw_cq *cq = kzalloc_obj(*cq, GFP_KERNEL); + struct hw_cq *cq = kzalloc_obj(*cq); if (!cq) return NULL; @@ -204,7 +204,7 @@ efct_hw_new_cq_set(struct hw_eq *eqs[], struct hw_cq *cqs[], cqs[i] = NULL; for (i = 0; i < num_cqs; i++) { - cq = kzalloc_obj(*cq, GFP_KERNEL); + cq = kzalloc_obj(*cq); if (!cq) goto error; @@ -244,7 +244,7 @@ struct hw_mq * efct_hw_new_mq(struct hw_cq *cq, u32 entry_count) { struct efct_hw *hw = cq->eq->hw; - struct hw_mq *mq = kzalloc_obj(*mq, GFP_KERNEL); + struct hw_mq *mq = kzalloc_obj(*mq); if (!mq) return NULL; @@ -275,7 +275,7 @@ struct hw_wq * efct_hw_new_wq(struct hw_cq *cq, u32 entry_count) { struct efct_hw *hw = cq->eq->hw; - struct hw_wq *wq = kzalloc_obj(*wq, GFP_KERNEL); + struct hw_wq *wq = kzalloc_obj(*wq); if (!wq) return NULL; @@ -324,7 +324,7 @@ efct_hw_new_rq_set(struct hw_cq *cqs[], struct hw_rq *rqs[], * encapsulates 2 SLI queues (for rq pair) */ for (i = 0, q_count = 0; i < num_rq_pairs; i++, q_count += 2) { - rq = kzalloc_obj(*rq, GFP_KERNEL); + rq = kzalloc_obj(*rq); if (!rq) goto error; diff --git a/drivers/scsi/elx/efct/efct_io.c b/drivers/scsi/elx/efct/efct_io.c index dabbe996ab7c..91ab64ce9f97 100644 --- a/drivers/scsi/elx/efct/efct_io.c +++ b/drivers/scsi/elx/efct/efct_io.c @@ -25,7 +25,7 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl) struct efct_io *io; /* Allocate the IO pool */ - io_pool = kzalloc_obj(*io_pool, GFP_KERNEL); + io_pool = kzalloc_obj(*io_pool); if (!io_pool) return NULL; @@ -35,7 +35,7 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl) spin_lock_init(&io_pool->lock); for (i = 0; i < EFCT_NUM_SCSI_IOS; i++) { - io = kzalloc_obj(*io, GFP_KERNEL); + io = kzalloc_obj(*io); if (!io) break; diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c index a6ad6b84fc7a..d6e35ee8fee0 100644 --- a/drivers/scsi/elx/efct/efct_lio.c +++ b/drivers/scsi/elx/efct/efct_lio.c @@ -744,7 +744,7 @@ efct_lio_make_nport(struct target_fabric_configfs *tf, return ERR_PTR(-ENXIO); } - lio_nport = kzalloc_obj(*lio_nport, GFP_KERNEL); + lio_nport = kzalloc_obj(*lio_nport); if (!lio_nport) return ERR_PTR(-ENOMEM); @@ -796,7 +796,7 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, return ERR_PTR(-ENXIO); } - lio_vport = kzalloc_obj(*lio_vport, GFP_KERNEL); + lio_vport = kzalloc_obj(*lio_vport); if (!lio_vport) return ERR_PTR(-ENOMEM); @@ -808,7 +808,7 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, efct_format_wwn(lio_vport->wwpn_str, sizeof(lio_vport->wwpn_str), "naa.", npiv_wwpn); - vport_list = kzalloc_obj(*vport_list, GFP_KERNEL); + vport_list = kzalloc_obj(*vport_list); if (!vport_list) { kfree(lio_vport); return ERR_PTR(-ENOMEM); @@ -895,7 +895,7 @@ efct_lio_make_tpg(struct se_wwn *wwn, const char *name) if (kstrtoul(name + 5, 10, &n) || n > USHRT_MAX) return ERR_PTR(-EINVAL); - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return ERR_PTR(-ENOMEM); @@ -958,7 +958,7 @@ efct_lio_npiv_make_tpg(struct se_wwn *wwn, const char *name) return ERR_PTR(-EINVAL); } - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return ERR_PTR(-ENOMEM); @@ -1069,7 +1069,7 @@ static int efct_session_cb(struct se_portal_group *se_tpg, struct efct_node *tgt_node; struct efct *efct = node->efc->base; - tgt_node = kzalloc_obj(*tgt_node, GFP_KERNEL); + tgt_node = kzalloc_obj(*tgt_node); if (!tgt_node) return -ENOMEM; diff --git a/drivers/scsi/elx/efct/efct_xport.c b/drivers/scsi/elx/efct/efct_xport.c index 66574b8c9f9e..9dcaef6fc188 100644 --- a/drivers/scsi/elx/efct/efct_xport.c +++ b/drivers/scsi/elx/efct/efct_xport.c @@ -28,7 +28,7 @@ efct_xport_alloc(struct efct *efct) { struct efct_xport *xport; - xport = kzalloc_obj(*xport, GFP_KERNEL); + xport = kzalloc_obj(*xport); if (!xport) return xport; diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index fd72946ec41f..290d29bc9682 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -783,7 +783,7 @@ bool esas2r_init_adapter_struct(struct esas2r_adapter *a, /* allocate requests for asynchronous events */ a->first_ae_req = - kzalloc_objs(struct esas2r_request, num_ae_requests, GFP_KERNEL); + kzalloc_objs(struct esas2r_request, num_ae_requests); if (a->first_ae_req == NULL) { esas2r_log(ESAS2R_LOG_CRIT, diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 454807522250..ada278c24c51 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -194,7 +194,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj, int length = min(sizeof(struct atto_ioctl), count); if (!a->local_atto_ioctl) { - a->local_atto_ioctl = kmalloc_obj(struct atto_ioctl, GFP_KERNEL); + a->local_atto_ioctl = kmalloc_obj(struct atto_ioctl); if (a->local_atto_ioctl == NULL) { esas2r_log(ESAS2R_LOG_WARN, "write_hw kzalloc failed for %zu bytes", diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index af46112b4fb0..897a01d3e303 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -2447,7 +2447,7 @@ static int esp_sdev_init(struct scsi_device *dev) struct esp_target_data *tp = &esp->target[dev->id]; struct esp_lun_data *lp; - lp = kzalloc_obj(*lp, GFP_KERNEL); + lp = kzalloc_obj(*lp); if (!lp) return -ENOMEM; dev->hostdata = lp; diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index bc0064da561c..534596c6d76c 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -820,7 +820,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) if (realdev->netdev_ops->ndo_fcoe_get_hbainfo) { struct netdev_fcoe_hbainfo *fdmi; - fdmi = kzalloc_obj(*fdmi, GFP_KERNEL); + fdmi = kzalloc_obj(*fdmi); if (!fdmi) return; diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index a356cf072bf1..02cd4410efca 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -168,7 +168,7 @@ static int fcoe_sysfs_fcf_add(struct fcoe_fcf *new) LIBFCOE_FIP_DBG(fip, "New FCF fab %16.16llx mac %pM\n", new->fabric_name, new->fcf_mac); - temp = kzalloc_obj(*temp, GFP_KERNEL); + temp = kzalloc_obj(*temp); if (!temp) goto out; diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index e1615cc5c092..88d85fc9a52a 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c @@ -638,7 +638,7 @@ static int fcoe_add_netdev_mapping(struct net_device *netdev, { struct fcoe_netdev_mapping *nm; - nm = kmalloc_obj(*nm, GFP_KERNEL); + nm = kmalloc_obj(*nm); if (!nm) { printk(KERN_ERR "Unable to allocate netdev_mapping"); return -ENOMEM; diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c index 69ffc492ec9d..455426564ca0 100644 --- a/drivers/scsi/fnic/fdls_disc.c +++ b/drivers/scsi/fnic/fdls_disc.c @@ -316,7 +316,7 @@ void fdls_schedule_oxid_free_retry_work(struct work_struct *work) FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "Schedule oxid free. oxid idx: %d\n", idx); - reclaim_entry = kzalloc_obj(*reclaim_entry, GFP_KERNEL); + reclaim_entry = kzalloc_obj(*reclaim_entry); if (!reclaim_entry) { schedule_delayed_work(&oxid_pool->schedule_oxid_free_retry, msecs_to_jiffies(SCHEDULE_OXID_FREE_RETRY_TIME)); diff --git a/drivers/scsi/fnic/fip.c b/drivers/scsi/fnic/fip.c index 5072c08e75ad..ccd0da7d490f 100644 --- a/drivers/scsi/fnic/fip.c +++ b/drivers/scsi/fnic/fip.c @@ -139,7 +139,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph) FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num, "process_vlan_resp: FIP VLAN %d\n", vid); - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) { /* retry from timer */ diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index ef5298685054..ba86964fb45e 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -200,7 +200,7 @@ static int fnic_trace_debugfs_open(struct inode *inode, fnic_dbgfs_t *fnic_dbg_prt; u8 *rdata_ptr; rdata_ptr = (u8 *)inode->i_private; - fnic_dbg_prt = kzalloc_obj(fnic_dbgfs_t, GFP_KERNEL); + fnic_dbg_prt = kzalloc_obj(fnic_dbgfs_t); if (!fnic_dbg_prt) return -ENOMEM; @@ -436,7 +436,7 @@ static int fnic_reset_stats_open(struct inode *inode, struct file *file) { struct stats_debug_info *debug; - debug = kzalloc_obj(struct stats_debug_info, GFP_KERNEL); + debug = kzalloc_obj(struct stats_debug_info); if (!debug) return -ENOMEM; @@ -583,7 +583,7 @@ static int fnic_stats_debugfs_open(struct inode *inode, struct stats_debug_info *debug; int buf_size = 2 * PAGE_SIZE; - debug = kzalloc_obj(struct stats_debug_info, GFP_KERNEL); + debug = kzalloc_obj(struct stats_debug_info); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 8a8c008ea2c7..8b551b79e087 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -715,7 +715,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* * Allocate fnic */ - fnic = kzalloc_obj(struct fnic, GFP_KERNEL); + fnic = kzalloc_obj(struct fnic); if (!fnic) { err = -ENOMEM; goto err_out_fnic_alloc; diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c index 590effeb21e6..991c86eb5aff 100644 --- a/drivers/scsi/fnic/vnic_dev.c +++ b/drivers/scsi/fnic/vnic_dev.c @@ -911,7 +911,7 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev, void *priv, struct pci_dev *pdev, struct vnic_dev_bar *bar) { if (!vdev) { - vdev = kzalloc_obj(struct vnic_dev, GFP_KERNEL); + vdev = kzalloc_obj(struct vnic_dev); if (!vdev) return NULL; } diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index ce20f8906ac7..adb3b7d8c6fb 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -1597,7 +1597,7 @@ static void hpsa_monitor_offline_device(struct ctlr_info *h, spin_unlock_irqrestore(&h->offline_device_lock, flags); /* Device is not on the list, add it. */ - device = kmalloc_obj(*device, GFP_KERNEL); + device = kmalloc_obj(*device); if (!device) return; @@ -1936,8 +1936,8 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, } spin_unlock_irqrestore(&h->reset_lock, flags); - added = kzalloc_objs(*added, HPSA_MAX_DEVICES, GFP_KERNEL); - removed = kzalloc_objs(*removed, HPSA_MAX_DEVICES, GFP_KERNEL); + added = kzalloc_objs(*added, HPSA_MAX_DEVICES); + removed = kzalloc_objs(*removed, HPSA_MAX_DEVICES); if (!added || !removed) { dev_warn(&h->pdev->dev, "out of memory in " @@ -2200,7 +2200,7 @@ static int hpsa_allocate_ioaccel2_sg_chain_blocks(struct ctlr_info *h) return 0; h->ioaccel2_cmd_sg_list = - kzalloc_objs(*h->ioaccel2_cmd_sg_list, h->nr_cmds, GFP_KERNEL); + kzalloc_objs(*h->ioaccel2_cmd_sg_list, h->nr_cmds); if (!h->ioaccel2_cmd_sg_list) return -ENOMEM; for (i = 0; i < h->nr_cmds; i++) { @@ -2238,7 +2238,7 @@ static int hpsa_alloc_sg_chain_blocks(struct ctlr_info *h) if (h->chainsize <= 0) return 0; - h->cmd_sg_list = kzalloc_objs(*h->cmd_sg_list, h->nr_cmds, GFP_KERNEL); + h->cmd_sg_list = kzalloc_objs(*h->cmd_sg_list, h->nr_cmds); if (!h->cmd_sg_list) return -ENOMEM; @@ -3465,11 +3465,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, goto out; } - bssbp = kzalloc_obj(*bssbp, GFP_KERNEL); + bssbp = kzalloc_obj(*bssbp); if (!bssbp) goto out; - id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); + id_phys = kzalloc_obj(*id_phys); if (!id_phys) goto out; @@ -3530,7 +3530,7 @@ static u64 hpsa_get_sas_address_from_report_physical(struct ctlr_info *h, u64 sa = 0; int i; - physdev = kzalloc_obj(*physdev, GFP_KERNEL); + physdev = kzalloc_obj(*physdev); if (!physdev) return 0; @@ -3561,7 +3561,7 @@ static void hpsa_get_sas_address(struct ctlr_info *h, unsigned char *scsi3addr, if (is_hba_lunid(scsi3addr)) { struct bmic_sense_subsystem_info *ssi; - ssi = kzalloc_obj(*ssi, GFP_KERNEL); + ssi = kzalloc_obj(*ssi); if (!ssi) return; @@ -3785,7 +3785,7 @@ static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h, return rc; /* REPORT PHYS EXTENDED is not supported */ - lbuf = kzalloc_obj(*lbuf, GFP_KERNEL); + lbuf = kzalloc_obj(*lbuf); if (!lbuf) return -ENOMEM; @@ -4256,7 +4256,7 @@ static bool hpsa_is_disk_spare(struct ctlr_info *h, u8 *lunaddrbytes) bool is_spare = false; int rc; - id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); + id_phys = kzalloc_obj(*id_phys); if (!id_phys) return false; @@ -4341,12 +4341,12 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) int raid_ctlr_position; bool physical_device; - currentsd = kzalloc_objs(*currentsd, HPSA_MAX_DEVICES, GFP_KERNEL); - physdev_list = kzalloc_obj(*physdev_list, GFP_KERNEL); - logdev_list = kzalloc_obj(*logdev_list, GFP_KERNEL); - tmpdevice = kzalloc_obj(*tmpdevice, GFP_KERNEL); - id_phys = kzalloc_obj(*id_phys, GFP_KERNEL); - id_ctlr = kzalloc_obj(*id_ctlr, GFP_KERNEL); + currentsd = kzalloc_objs(*currentsd, HPSA_MAX_DEVICES); + physdev_list = kzalloc_obj(*physdev_list); + logdev_list = kzalloc_obj(*logdev_list); + tmpdevice = kzalloc_obj(*tmpdevice); + id_phys = kzalloc_obj(*id_phys); + id_ctlr = kzalloc_obj(*id_ctlr); if (!currentsd || !physdev_list || !logdev_list || !tmpdevice || !id_phys || !id_ctlr) { @@ -4386,7 +4386,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) break; } - currentsd[i] = kzalloc_obj(*currentsd[i], GFP_KERNEL); + currentsd[i] = kzalloc_obj(*currentsd[i]); if (!currentsd[i]) { h->drv_req_rescan = 1; goto out; @@ -6500,7 +6500,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, status = -ENOMEM; goto cleanup1; } - buff_size = kmalloc_objs(int, SG_ENTRIES_IN_CMD, GFP_KERNEL); + buff_size = kmalloc_objs(int, SG_ENTRIES_IN_CMD); if (!buff_size) { status = -ENOMEM; goto cleanup1; @@ -8490,7 +8490,7 @@ static int hpsa_luns_changed(struct ctlr_info *h) if (!h->lastlogicals) return rc; - logdev = kzalloc_obj(*logdev, GFP_KERNEL); + logdev = kzalloc_obj(*logdev); if (!logdev) return rc; @@ -8631,7 +8631,7 @@ static struct ctlr_info *hpda_alloc_ctlr_info(void) { struct ctlr_info *h; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return NULL; @@ -8852,7 +8852,7 @@ reinit_after_soft_reset: hpsa_hba_inquiry(h); - h->lastlogicals = kzalloc_obj(*(h->lastlogicals), GFP_KERNEL); + h->lastlogicals = kzalloc_obj(*(h->lastlogicals)); if (!h->lastlogicals) dev_info(&h->pdev->dev, "Can't track change to report lun data\n"); @@ -8956,7 +8956,7 @@ static void hpsa_disable_rld_caching(struct ctlr_info *h) if (unlikely(h->lockup_detected)) return; - options = kzalloc_obj(*options, GFP_KERNEL); + options = kzalloc_obj(*options); if (!options) return; @@ -9553,7 +9553,7 @@ static struct hpsa_sas_phy *hpsa_alloc_sas_phy( struct hpsa_sas_phy *hpsa_sas_phy; struct sas_phy *phy; - hpsa_sas_phy = kzalloc_obj(*hpsa_sas_phy, GFP_KERNEL); + hpsa_sas_phy = kzalloc_obj(*hpsa_sas_phy); if (!hpsa_sas_phy) return NULL; @@ -9638,7 +9638,7 @@ static struct hpsa_sas_port struct hpsa_sas_port *hpsa_sas_port; struct sas_port *port; - hpsa_sas_port = kzalloc_obj(*hpsa_sas_port, GFP_KERNEL); + hpsa_sas_port = kzalloc_obj(*hpsa_sas_port); if (!hpsa_sas_port) return NULL; @@ -9686,7 +9686,7 @@ static struct hpsa_sas_node *hpsa_alloc_sas_node(struct device *parent_dev) { struct hpsa_sas_node *hpsa_sas_node; - hpsa_sas_node = kzalloc_obj(*hpsa_sas_node, GFP_KERNEL); + hpsa_sas_node = kzalloc_obj(*hpsa_sas_node); if (hpsa_sas_node) { hpsa_sas_node->parent_dev = parent_dev; INIT_LIST_HEAD(&hpsa_sas_node->port_list_head); diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 2973395badab..e47a954acd43 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -797,7 +797,7 @@ static int ibmvfc_init_event_pool(struct ibmvfc_host *vhost, return 0; pool->size = queue->total_depth; - pool->events = kzalloc_objs(*pool->events, pool->size, GFP_KERNEL); + pool->events = kzalloc_objs(*pool->events, pool->size); if (!pool->events) return -ENOMEM; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index da88b6b125d6..609bda730b3a 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -447,7 +447,7 @@ static int initialize_event_pool(struct event_pool *pool, pool->size = size; pool->next = 0; - pool->events = kzalloc_objs(*pool->events, pool->size, GFP_KERNEL); + pool->events = kzalloc_objs(*pool->events, pool->size); if (!pool->events) return -ENOMEM; diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index a3a6953ba1c7..b395a9d7c640 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -2214,7 +2214,7 @@ static int ibmvscsis_make_nexus(struct ibmvscsis_tport *tport) return 0; } - nexus = kzalloc_obj(*nexus, GFP_KERNEL); + nexus = kzalloc_obj(*nexus); if (!nexus) { dev_err(&vscsi->dev, "Unable to allocate struct ibmvscsis_nexus\n"); return -ENOMEM; @@ -3424,7 +3424,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev, int rc = 0; long hrc = 0; - vscsi = kzalloc_obj(*vscsi, GFP_KERNEL); + vscsi = kzalloc_obj(*vscsi); if (!vscsi) { rc = -ENOMEM; dev_err(&vdev->dev, "probe: allocation of adapter failed\n"); diff --git a/drivers/scsi/ibmvscsi_tgt/libsrp.c b/drivers/scsi/ibmvscsi_tgt/libsrp.c index 8fd0bc7cb429..eef9e452ece5 100644 --- a/drivers/scsi/ibmvscsi_tgt/libsrp.c +++ b/drivers/scsi/ibmvscsi_tgt/libsrp.c @@ -27,10 +27,10 @@ static int srp_iu_pool_alloc(struct srp_queue *q, size_t max, struct iu_entry *iue; int i; - q->pool = kzalloc_objs(struct iu_entry *, max, GFP_KERNEL); + q->pool = kzalloc_objs(struct iu_entry *, max); if (!q->pool) return -ENOMEM; - q->items = kzalloc_objs(struct iu_entry, max, GFP_KERNEL); + q->items = kzalloc_objs(struct iu_entry, max); if (!q->items) goto free_pool; @@ -61,12 +61,12 @@ static struct srp_buf **srp_ring_alloc(struct device *dev, struct srp_buf **ring; int i; - ring = kzalloc_objs(struct srp_buf *, max, GFP_KERNEL); + ring = kzalloc_objs(struct srp_buf *, max); if (!ring) return NULL; for (i = 0; i < max; i++) { - ring[i] = kzalloc_obj(*ring[i], GFP_KERNEL); + ring[i] = kzalloc_obj(*ring[i]); if (!ring[i]) goto out; ring[i]->buf = dma_alloc_coherent(dev, size, &ring[i]->dma, diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 2ed57ea13884..0535252e77e3 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -1158,7 +1158,7 @@ static int __imm_attach(struct parport *pb) init_waitqueue_head(&waiting); - dev = kzalloc_obj(imm_struct, GFP_KERNEL); + dev = kzalloc_obj(imm_struct); if (!dev) return -ENOMEM; diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 3b3f40eb32f4..c93dc8b4fe59 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -3776,7 +3776,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len) order = get_order(sg_size); /* Allocate a scatter/gather list for the DMA */ - sglist = kzalloc_obj(struct ipr_sglist, GFP_KERNEL); + sglist = kzalloc_obj(struct ipr_sglist); if (sglist == NULL) { ipr_trace; return NULL; @@ -4273,7 +4273,7 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg) __be32 **ioa_data; unsigned long lock_flags = 0; - dump = kzalloc_obj(struct ipr_dump, GFP_KERNEL); + dump = kzalloc_obj(struct ipr_dump); if (!dump) { ipr_err("Dump memory allocation failed\n"); diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 6bb87f02b746..41ed73966a48 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -6874,7 +6874,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) } /* found a controller */ - ha = kzalloc_obj(ips_ha_t, GFP_KERNEL); + ha = kzalloc_obj(ips_ha_t); if (ha == NULL) { IPS_PRINTK(KERN_WARNING, pci_dev, "Unable to allocate temporary ha struct\n"); @@ -6947,7 +6947,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) ha->logical_drive_info_dma_addr = dma_address; - ha->conf = kmalloc_obj(IPS_CONF, GFP_KERNEL); + ha->conf = kmalloc_obj(IPS_CONF); if (!ha->conf) { IPS_PRINTK(KERN_WARNING, pci_dev, @@ -6955,7 +6955,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) return ips_abort_init(ha, index); } - ha->nvram = kmalloc_obj(IPS_NVRAM_P5, GFP_KERNEL); + ha->nvram = kmalloc_obj(IPS_NVRAM_P5); if (!ha->nvram) { IPS_PRINTK(KERN_WARNING, pci_dev, @@ -6963,7 +6963,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) return ips_abort_init(ha, index); } - ha->subsys = kmalloc_obj(IPS_SUBSYS, GFP_KERNEL); + ha->subsys = kmalloc_obj(IPS_SUBSYS); if (!ha->subsys) { IPS_PRINTK(KERN_WARNING, pci_dev, diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c index 09fa63fc18f5..0b22197bf8f5 100644 --- a/drivers/scsi/iscsi_boot_sysfs.c +++ b/drivers/scsi/iscsi_boot_sysfs.c @@ -344,7 +344,7 @@ iscsi_boot_create_kobj(struct iscsi_boot_kset *boot_kset, { struct iscsi_boot_kobj *boot_kobj; - boot_kobj = kzalloc_obj(*boot_kobj, GFP_KERNEL); + boot_kobj = kzalloc_obj(*boot_kobj); if (!boot_kobj) return NULL; INIT_LIST_HEAD(&boot_kobj->list); @@ -497,7 +497,7 @@ struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name) { struct iscsi_boot_kset *boot_kset; - boot_kset = kzalloc_obj(*boot_kset, GFP_KERNEL); + boot_kset = kzalloc_obj(*boot_kset); if (!boot_kset) return NULL; diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c index 4663927255ba..6d1fb55cc3ad 100644 --- a/drivers/scsi/lasi700.c +++ b/drivers/scsi/lasi700.c @@ -88,7 +88,7 @@ lasi700_probe(struct parisc_device *dev) struct NCR_700_Host_Parameters *hostdata; struct Scsi_Host *host; - hostdata = kzalloc_obj(*hostdata, GFP_KERNEL); + hostdata = kzalloc_obj(*hostdata); if (!hostdata) { dev_printk(KERN_ERR, &dev->dev, "Failed to allocate host data\n"); return -ENOMEM; diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 5cc10b70b772..7792724d5b97 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -116,7 +116,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp) case ELS_ADDR_FMT_PORT: FC_DISC_DBG(disc, "Port address format for port " "(%6.6x)\n", ntoh24(pp->rscn_fid)); - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); if (!dp) { redisc = 1; break; diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 414bd2e45fec..a5139e43ca4c 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -2298,7 +2298,7 @@ int fc_fcp_init(struct fc_lport *lport) if (!lport->tt.fcp_abort_io) lport->tt.fcp_abort_io = fc_fcp_abort_io; - si = kzalloc_obj(struct fc_fcp_internal, GFP_KERNEL); + si = kzalloc_obj(struct fc_fcp_internal); if (!si) return -ENOMEM; lport->scsi_priv = si; diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 67583e44ad5b..32683ea6953c 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -2049,7 +2049,7 @@ static int fc_lport_els_request(struct bsg_job *job, fh->fh_df_ctl = 0; fh->fh_parm_offset = 0; - info = kzalloc_obj(struct fc_bsg_info, GFP_KERNEL); + info = kzalloc_obj(struct fc_bsg_info); if (!info) { fc_frame_free(fp); return -ENOMEM; @@ -2109,7 +2109,7 @@ static int fc_lport_ct_request(struct bsg_job *job, fh->fh_df_ctl = 0; fh->fh_parm_offset = 0; - info = kzalloc_obj(struct fc_bsg_info, GFP_KERNEL); + info = kzalloc_obj(struct fc_bsg_info); if (!info) { fc_frame_free(fp); return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 0d24d6cc2dd8..61368e55bf86 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -579,7 +579,7 @@ int sas_ata_init(struct domain_device *found_dev) struct ata_port *ap; int rc; - ata_host = kzalloc_obj(*ata_host, GFP_KERNEL); + ata_host = kzalloc_obj(*ata_host); if (!ata_host) { pr_err("ata host alloc failed.\n"); return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index e48b5233c2e9..f471ab464a78 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -433,7 +433,7 @@ static int sas_expander_discover(struct domain_device *dev) struct expander_device *ex = &dev->ex_dev; int res; - ex->ex_phy = kzalloc_objs(*ex->ex_phy, ex->num_phys, GFP_KERNEL); + ex->ex_phy = kzalloc_objs(*ex->ex_phy, ex->num_phys); if (!ex->ex_phy) return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 08e641374c85..0bec236f0fb5 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -505,7 +505,7 @@ static void phy_enable_work(struct work_struct *work) static int sas_phy_setup(struct sas_phy *phy) { - struct sas_phy_data *d = kzalloc_obj(*d, GFP_KERNEL); + struct sas_phy_data *d = kzalloc_obj(*d); if (!d) return -ENOMEM; diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index fafcefcf722a..7dce0f587149 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -192,7 +192,7 @@ static inline void sas_phy_set_target(struct asd_sas_phy *p, struct domain_devic static inline struct domain_device *sas_alloc_device(void) { - struct domain_device *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct domain_device *dev = kzalloc_obj(*dev); if (dev) { INIT_LIST_HEAD(&dev->siblings); diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index fef3f283cfa7..53f41d68e0d8 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -2041,7 +2041,7 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr, struct sff_trasnceiver_codes_byte7 *trasn_code_byte7; /* Get transceiver information */ - rdp_context = kmalloc_obj(*rdp_context, GFP_KERNEL); + rdp_context = kmalloc_obj(*rdp_context); if (!rdp_context) { len = scnprintf(buf, PAGE_SIZE - len, "SPF info NA: alloc failure\n"); diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 8c2b303ff144..7406dfa60016 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -174,7 +174,7 @@ lpfc_alloc_bsg_buffers(struct lpfc_hba *phba, unsigned int size, /* Allocate dma buffer and place in BPL passed */ while (bytes_left) { /* Allocate dma buffer */ - mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf); if (!mp) { if (mlist) lpfc_free_bsg_buffers(phba, mlist); @@ -416,7 +416,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) return -ENODEV; /* allocate our bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2733 Failed allocation of dd_data\n"); @@ -430,7 +430,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) goto free_dd; } - bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf); if (!bmp) { rc = -ENOMEM; goto free_cmdiocbq; @@ -683,7 +683,7 @@ lpfc_bsg_rport_els(struct bsg_job *job) } /* allocate our bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2735 Failed allocation of dd_data\n"); @@ -843,7 +843,7 @@ lpfc_bsg_event_unref(struct lpfc_bsg_event *evt) static struct lpfc_bsg_event * lpfc_bsg_event_new(uint32_t ev_mask, int ev_reg_id, uint32_t ev_req_id) { - struct lpfc_bsg_event *evt = kzalloc_obj(*evt, GFP_KERNEL); + struct lpfc_bsg_event *evt = kzalloc_obj(*evt); if (!evt) return NULL; @@ -939,7 +939,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, lpfc_bsg_event_ref(evt); spin_unlock_irqrestore(&phba->ct_ev_lock, flags); - evt_dat = kzalloc_obj(*evt_dat, GFP_KERNEL); + evt_dat = kzalloc_obj(*evt_dat); if (evt_dat == NULL) { spin_lock_irqsave(&phba->ct_ev_lock, flags); lpfc_bsg_event_unref(evt); @@ -1215,7 +1215,7 @@ lpfc_bsg_hba_set_event(struct bsg_job *job) if (&evt->node == &phba->ct_ev_waiters) { /* no event waiting struct yet - first call */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (dd_data == NULL) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2734 Failed allocation of dd_data\n"); @@ -1477,7 +1477,7 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag, } /* allocate our bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2736 Failed allocation of dd_data\n"); @@ -1605,7 +1605,7 @@ lpfc_bsg_send_mgmt_rsp(struct bsg_job *job) goto send_mgmt_rsp_exit; } - bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf); if (!bmp) { rc = -ENOMEM; goto send_mgmt_rsp_exit; @@ -2628,7 +2628,7 @@ static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi, cmdiocbq = lpfc_sli_get_iocbq(phba); rspiocbq = lpfc_sli_get_iocbq(phba); - dmabuf = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kmalloc_obj(struct lpfc_dmabuf); if (dmabuf) { dmabuf->virt = lpfc_mbuf_alloc(phba, 0, &dmabuf->phys); if (dmabuf->virt) { @@ -2733,7 +2733,7 @@ lpfc_bsg_dma_page_alloc(struct lpfc_hba *phba) struct pci_dev *pcidev = phba->pcidev; /* allocate dma buffer struct */ - dmabuf = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kmalloc_obj(struct lpfc_dmabuf); if (!dmabuf) return NULL; @@ -2829,7 +2829,7 @@ diag_cmd_data_alloc(struct lpfc_hba *phba, cnt = size; /* allocate struct lpfc_dmabufext buffer header */ - dmp = kmalloc_obj(struct lpfc_dmabufext, GFP_KERNEL); + dmp = kmalloc_obj(struct lpfc_dmabufext); if (!dmp) goto out; @@ -2909,7 +2909,7 @@ static int lpfcdiag_sli3_loop_post_rxbufs(struct lpfc_hba *phba, uint16_t rxxri, pring = lpfc_phba_elsring(phba); cmdiocbq = lpfc_sli_get_iocbq(phba); - rxbmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + rxbmp = kmalloc_obj(struct lpfc_dmabuf); if (rxbmp != NULL) { rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys); if (rxbmp->virt) { @@ -3160,7 +3160,7 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) cmdiocbq = lpfc_sli_get_iocbq(phba); if (phba->sli_rev < LPFC_SLI_REV4) rspiocbq = lpfc_sli_get_iocbq(phba); - txbmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + txbmp = kmalloc_obj(struct lpfc_dmabuf); if (txbmp) { txbmp->virt = lpfc_mbuf_alloc(phba, 0, &txbmp->phys); @@ -4074,7 +4074,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, } /* bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4275,7 +4275,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, if (ext_buf_cnt == 1) { /* bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4624,7 +4624,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, "ebuffers received\n", phba->mbox_ext_buf_ctx.numBuf); - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { rc = -ENOMEM; goto job_error; @@ -4896,7 +4896,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, goto job_done; /* must be negative */ /* allocate our bsg tracking structure */ - dd_data = kmalloc_obj(struct bsg_job_data, GFP_KERNEL); + dd_data = kmalloc_obj(struct bsg_job_data); if (!dd_data) { lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC, "2727 Failed allocation of dd_data\n"); diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index a6ae7b7cf99c..d64f4acfcdae 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -165,7 +165,7 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp, u32 tmo; /* fill in BDEs for command */ - mp = kmalloc_obj(*mp, GFP_KERNEL); + mp = kmalloc_obj(*mp); if (!mp) { rc = 1; goto ct_exit; @@ -178,7 +178,7 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp, } /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc_obj(*bmp, GFP_KERNEL); + bmp = kmalloc_obj(*bmp); if (!bmp) { rc = 3; goto ct_free_mpvirt; @@ -498,7 +498,7 @@ lpfc_alloc_ct_rsp(struct lpfc_hba *phba, __be16 cmdcode, struct ulp_bde64 *bpl, while (size) { /* Allocate buffer for rsp payload */ - mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf); if (!mp) { if (mlist) lpfc_free_ct_rsp(phba, mlist); @@ -1924,7 +1924,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - mp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + mp = kmalloc_obj(struct lpfc_dmabuf); if (!mp) { rc=2; goto ns_cmd_exit; @@ -1938,7 +1938,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, } /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + bmp = kmalloc_obj(struct lpfc_dmabuf); if (!bmp) { rc=4; goto ns_cmd_free_mpvirt; @@ -3220,7 +3220,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - rq = kmalloc_obj(*rq, GFP_KERNEL); + rq = kmalloc_obj(*rq); if (!rq) goto fdmi_cmd_exit; @@ -3229,7 +3229,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, goto fdmi_cmd_free_rq; /* Allocate buffer for Buffer ptr list */ - rsp = kmalloc_obj(*rsp, GFP_KERNEL); + rsp = kmalloc_obj(*rsp); if (!rsp) goto fdmi_cmd_free_rqvirt; @@ -3716,7 +3716,7 @@ lpfc_vmid_cmd(struct lpfc_vport *vport, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - mp = kmalloc_obj(*mp, GFP_KERNEL); + mp = kmalloc_obj(*mp); if (!mp) goto vmid_free_mp_exit; @@ -3725,7 +3725,7 @@ lpfc_vmid_cmd(struct lpfc_vport *vport, goto vmid_free_mp_virt_exit; /* Allocate buffer for Buffer ptr list */ - bmp = kmalloc_obj(*bmp, GFP_KERNEL); + bmp = kmalloc_obj(*bmp); if (!bmp) goto vmid_free_bmp_exit; diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index f9f46119f341..1d9b3fcaa27e 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -1951,7 +1951,7 @@ lpfc_debugfs_disc_trc_open(struct inode *inode, struct file *file) goto out; } - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2001,7 +2001,7 @@ lpfc_debugfs_slow_ring_trc_open(struct inode *inode, struct file *file) goto out; } - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2045,7 +2045,7 @@ lpfc_debugfs_hbqinfo_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2087,7 +2087,7 @@ lpfc_debugfs_multixripools_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2132,7 +2132,7 @@ lpfc_debugfs_lockstat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2269,7 +2269,7 @@ lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) phba->cfg_ras_fwlog_buffsize, &size)) goto out; - debug = kzalloc_obj(*debug, GFP_KERNEL); + debug = kzalloc_obj(*debug); if (!debug) goto out; @@ -2316,7 +2316,7 @@ lpfc_debugfs_dumpHBASlim_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2358,7 +2358,7 @@ lpfc_debugfs_dumpHostSlim_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2522,7 +2522,7 @@ lpfc_debugfs_nodelist_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2688,7 +2688,7 @@ lpfc_debugfs_nvmestat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2776,7 +2776,7 @@ lpfc_debugfs_scsistat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2830,7 +2830,7 @@ lpfc_debugfs_ioktime_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -2957,7 +2957,7 @@ lpfc_debugfs_nvmeio_trc_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -3062,7 +3062,7 @@ lpfc_debugfs_hdwqstat_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -3226,7 +3226,7 @@ lpfc_idiag_open(struct inode *inode, struct file *file) { struct lpfc_debug *debug; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) return -ENOMEM; @@ -5471,7 +5471,7 @@ lpfc_cgn_buffer_open(struct inode *inode, struct file *file) struct lpfc_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; @@ -5563,7 +5563,7 @@ lpfc_rx_monitor_open(struct inode *inode, struct file *file) struct lpfc_rx_monitor_debug *debug; int rc = -ENOMEM; - debug = kmalloc_obj(*debug, GFP_KERNEL); + debug = kmalloc_obj(*debug); if (!debug) goto out; diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 5177f0a80670..a6d936150b31 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -216,7 +216,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, /* fill in BDEs for command */ /* Allocate buffer for command payload */ - pcmd = kmalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kmalloc_obj(*pcmd); if (pcmd) pcmd->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pcmd->phys); if (!pcmd || !pcmd->virt) @@ -226,7 +226,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, /* Allocate buffer for response payload */ if (expect_rsp) { - prsp = kmalloc_obj(*prsp, GFP_KERNEL); + prsp = kmalloc_obj(*prsp); if (prsp) prsp->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &prsp->phys); @@ -238,7 +238,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, } /* Allocate buffer for Buffer ptr list */ - pbuflist = kmalloc_obj(*pbuflist, GFP_KERNEL); + pbuflist = kmalloc_obj(*pbuflist); if (pbuflist) pbuflist->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pbuflist->phys); @@ -7537,7 +7537,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, if (RDP_NPORT_ID_SIZE != be32_to_cpu(rdp_req->nport_id_desc.length)) goto rjt_logerr; - rdp_context = kzalloc_obj(struct lpfc_rdp_context, GFP_KERNEL); + rdp_context = kzalloc_obj(struct lpfc_rdp_context); if (!rdp_context) { rjt_err = LSRJT_UNABLE_TPC; goto error; @@ -7842,7 +7842,7 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, goto rjt; } - lcb_context = kmalloc_obj(*lcb_context, GFP_KERNEL); + lcb_context = kmalloc_obj(*lcb_context); if (!lcb_context) { rjt_err = LSRJT_UNABLE_TPC; goto rjt; @@ -9965,7 +9965,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (*payload == ELS_CMD_LOGO) { - logo_data = kmalloc_obj(struct lpfc_logo_event, GFP_KERNEL); + logo_data = kmalloc_obj(struct lpfc_logo_event); if (!logo_data) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "0148 Failed to allocate memory " @@ -9974,7 +9974,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, } els_data = &logo_data->header; } else { - els_data = kmalloc_obj(struct lpfc_els_event_header, GFP_KERNEL); + els_data = kmalloc_obj(struct lpfc_els_event_header); if (!els_data) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "0149 Failed to allocate memory " @@ -12437,7 +12437,7 @@ lpfc_vmid_uvem(struct lpfc_vport *vport, if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) return -ENXIO; - vmid_context = kmalloc_obj(*vmid_context, GFP_KERNEL); + vmid_context = kmalloc_obj(*vmid_context); if (!vmid_context) return -ENOMEM; elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_UVEM_SIZE, 2, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 0e6cc42c61c9..8aaf05d7bb0a 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -3643,7 +3643,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) * defaults. */ if (!test_bit(HBA_FIP_SUPPORT, &phba->hba_flag)) { - fcf_record = kzalloc_obj(struct fcf_record, GFP_KERNEL); + fcf_record = kzalloc_obj(struct fcf_record); if (unlikely(!fcf_record)) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4054,7 +4054,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); mb = &pmb->u.mb; - vport_info = kzalloc_obj(struct static_vport_info, GFP_KERNEL); + vport_info = kzalloc_obj(struct static_vport_info); if (!vport_info) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "0543 lpfc_create_static_vport failed to" @@ -7010,7 +7010,7 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba *phba, for (i = 0; i < record_count; i++) { if (!(conn_rec[i].flags & FCFCNCT_VALID)) continue; - conn_entry = kzalloc_obj(struct lpfc_fcf_conn_entry, GFP_KERNEL); + conn_entry = kzalloc_obj(struct lpfc_fcf_conn_entry); if (!conn_entry) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "2566 Failed to allocate connection" diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 1139fb7dc0fb..ab7e871b679d 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2820,7 +2820,7 @@ lpfc_sli3_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cn /* 2 buffers can be posted per command */ /* Allocate buffer to post */ - mp1 = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + mp1 = kmalloc_obj(struct lpfc_dmabuf); if (mp1) mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &mp1->phys); if (!mp1 || !mp1->virt) { @@ -2833,7 +2833,7 @@ lpfc_sli3_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cn INIT_LIST_HEAD(&mp1->list); /* Allocate buffer to post */ if (cnt > 1) { - mp2 = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + mp2 = kmalloc_obj(struct lpfc_dmabuf); if (mp2) mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &mp2->phys); @@ -3539,7 +3539,7 @@ void lpfc_create_multixri_pools(struct lpfc_hba *phba) count_per_hwq = phba->sli4_hba.io_xri_cnt / hwq_count; for (i = 0; i < hwq_count; i++) { - multixri_pool = kzalloc_obj(*multixri_pool, GFP_KERNEL); + multixri_pool = kzalloc_obj(*multixri_pool); if (!multixri_pool) { lpfc_printf_log(phba, KERN_INFO, LOG_INIT, @@ -4064,7 +4064,7 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba *phba) els_xri_cnt); /* allocate the additional els sgls */ for (i = 0; i < xri_cnt; i++) { - sglq_entry = kzalloc_obj(struct lpfc_sglq, GFP_KERNEL); + sglq_entry = kzalloc_obj(struct lpfc_sglq); if (sglq_entry == NULL) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4183,7 +4183,7 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba) phba->sli4_hba.nvmet_xri_cnt, nvmet_xri_cnt); /* allocate the additional nvmet sgls */ for (i = 0; i < xri_cnt; i++) { - sglq_entry = kzalloc_obj(struct lpfc_sglq, GFP_KERNEL); + sglq_entry = kzalloc_obj(struct lpfc_sglq); if (sglq_entry == NULL) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, @@ -4476,7 +4476,7 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc) phba->sli4_hba.io_xri_cnt = 0; for (bcnt = 0; bcnt < num_to_alloc; bcnt++) { - lpfc_ncmd = kzalloc_obj(*lpfc_ncmd, GFP_KERNEL); + lpfc_ncmd = kzalloc_obj(*lpfc_ncmd); if (!lpfc_ncmd) break; /* @@ -8661,7 +8661,7 @@ lpfc_init_iocb_list(struct lpfc_hba *phba, int iocb_count) /* Initialize and populate the iocb list per host. */ INIT_LIST_HEAD(&phba->lpfc_iocb_list); for (i = 0; i < iocb_count; i++) { - iocbq_entry = kzalloc_obj(struct lpfc_iocbq, GFP_KERNEL); + iocbq_entry = kzalloc_obj(struct lpfc_iocbq); if (iocbq_entry == NULL) { printk(KERN_ERR "%s: only allocated %d iocbs of " "expected %d count. Unloading driver.\n", @@ -8911,7 +8911,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) * First allocate the protocol header region for the port. The * port expects a 4KB DMA-mapped memory region that is 4K aligned. */ - dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf); if (!dmabuf) return NULL; @@ -8929,7 +8929,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) } /* Save the rpi header data for cleanup later. */ - rpi_hdr = kzalloc_obj(struct lpfc_rpi_hdr, GFP_KERNEL); + rpi_hdr = kzalloc_obj(struct lpfc_rpi_hdr); if (!rpi_hdr) goto err_free_coherent; @@ -9002,7 +9002,7 @@ lpfc_hba_alloc(struct pci_dev *pdev) struct lpfc_hba *phba; /* Allocate memory for HBA structure */ - phba = kzalloc_obj(struct lpfc_hba, GFP_KERNEL); + phba = kzalloc_obj(struct lpfc_hba); if (!phba) { dev_err(&pdev->dev, "failed to allocate hba struct\n"); return NULL; @@ -9720,7 +9720,7 @@ lpfc_create_bootstrap_mbox(struct lpfc_hba *phba) uint32_t pa_addr; uint64_t phys_addr; - dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf); if (!dmabuf) return -ENOMEM; @@ -11507,7 +11507,7 @@ lpfc_sli4_cq_event_pool_create(struct lpfc_hba *phba) int i; for (i = 0; i < (4 * phba->sli4_hba.cq_ecount); i++) { - cq_event = kmalloc_obj(struct lpfc_cq_event, GFP_KERNEL); + cq_event = kmalloc_obj(struct lpfc_cq_event); if (!cq_event) goto out_pool_create_fail; list_add_tail(&cq_event->list, @@ -14612,7 +14612,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context) "New Version:%s\n", fwrev, image->revision); for (i = 0; i < LPFC_MBX_WR_CONFIG_MAX_BDE; i++) { - dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf); if (!dmabuf) { rc = -ENOMEM; goto release_out; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index 5f7249e6bda8..e13abb6f925c 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -64,7 +64,7 @@ lpfc_mbox_rsrc_prep(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { struct lpfc_dmabuf *mp; - mp = kmalloc_obj(*mp, GFP_KERNEL); + mp = kmalloc_obj(*mp); if (!mp) return -ENOMEM; diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c index c067d6762ae3..6f5e5d1311e5 100644 --- a/drivers/scsi/lpfc/lpfc_mem.c +++ b/drivers/scsi/lpfc/lpfc_mem.c @@ -510,7 +510,7 @@ lpfc_els_hbq_alloc(struct lpfc_hba *phba) { struct hbq_dmabuf *hbqbp; - hbqbp = kzalloc_obj(struct hbq_dmabuf, GFP_KERNEL); + hbqbp = kzalloc_obj(struct hbq_dmabuf); if (!hbqbp) return NULL; @@ -562,7 +562,7 @@ lpfc_sli4_rb_alloc(struct lpfc_hba *phba) { struct hbq_dmabuf *dma_buf; - dma_buf = kzalloc_obj(struct hbq_dmabuf, GFP_KERNEL); + dma_buf = kzalloc_obj(struct hbq_dmabuf); if (!dma_buf) return NULL; @@ -620,7 +620,7 @@ lpfc_sli4_nvmet_alloc(struct lpfc_hba *phba) { struct rqb_dmabuf *dma_buf; - dma_buf = kzalloc_obj(*dma_buf, GFP_KERNEL); + dma_buf = kzalloc_obj(*dma_buf); if (!dma_buf) return NULL; diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 9e61021edfe1..5e431928de0b 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -564,7 +564,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (!login_mbox) goto out; - save_iocb = kzalloc_obj(*save_iocb, GFP_KERNEL); + save_iocb = kzalloc_obj(*save_iocb); if (!save_iocb) goto out; @@ -764,7 +764,7 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, * registered. */ if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { - elsiocb = kmalloc_obj(*elsiocb, GFP_KERNEL); + elsiocb = kmalloc_obj(*elsiocb); if (elsiocb) { /* Save info from cmd IOCB used in * rsp diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index edddb1e9a353..a6b3b16f870d 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -98,7 +98,7 @@ lpfc_nvme_create_queue(struct nvme_fc_local_port *pnvme_lport, test_bit(HBA_IOQ_FLUSH, &vport->phba->hba_flag)) return -ENODEV; - qhandle = kzalloc_obj(struct lpfc_nvme_qhandle, GFP_KERNEL); + qhandle = kzalloc_obj(struct lpfc_nvme_qhandle); if (qhandle == NULL) return -ENOMEM; @@ -587,7 +587,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, * in the nvme-fc layer. */ - bmp = kmalloc_obj(*bmp, GFP_KERNEL); + bmp = kmalloc_obj(*bmp); if (!bmp) { lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "6044 NVMEx LS REQ: Could not alloc LS buf " diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index 48642f01f2c9..ea5f24e28ef0 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -1567,14 +1567,14 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) idx = 0; cpu = cpumask_first(cpu_present_mask); for (i = 0; i < phba->sli4_hba.nvmet_xri_cnt; i++) { - ctx_buf = kzalloc_obj(*ctx_buf, GFP_KERNEL); + ctx_buf = kzalloc_obj(*ctx_buf); if (!ctx_buf) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "6404 Ran out of memory for NVMET\n"); return -ENOMEM; } - ctx_buf->context = kzalloc_obj(*ctx_buf->context, GFP_KERNEL); + ctx_buf->context = kzalloc_obj(*ctx_buf->context); if (!ctx_buf->context) { kfree(ctx_buf); lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index ca2bd782608d..69bf1ac6f846 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -265,7 +265,7 @@ lpfc_new_scsi_buf_s3(struct lpfc_vport *vport, int num_to_alloc) (int)sizeof(struct fcp_rsp), bpl_size); for (bcnt = 0; bcnt < num_to_alloc; bcnt++) { - psb = kzalloc_obj(struct lpfc_io_buf, GFP_KERNEL); + psb = kzalloc_obj(struct lpfc_io_buf); if (!psb) break; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index b328fc772bd8..dab6b288db51 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -2135,7 +2135,7 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) - LPFC_IOCBQ_LOOKUP_INCREMENT)) { new_len = psli->iocbq_lookup_len + LPFC_IOCBQ_LOOKUP_INCREMENT; spin_unlock_irq(&phba->hbalock); - new_arr = kzalloc_objs(struct lpfc_iocbq *, new_len, GFP_KERNEL); + new_arr = kzalloc_objs(struct lpfc_iocbq *, new_len); if (new_arr) { spin_lock_irq(&phba->hbalock); old_arr = psli->iocbq_lookup; @@ -5893,7 +5893,7 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, struct lpfc_dmabuf *dmabuf; struct lpfc_mqe *mqe; - dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf); if (!dmabuf) return -ENOMEM; @@ -6943,7 +6943,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba, ras_fwlog->fw_buffcount = fwlog_buff_count; for (i = 0; i < ras_fwlog->fw_buffcount; i++) { - dmabuf = kzalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + dmabuf = kzalloc_obj(struct lpfc_dmabuf); if (!dmabuf) { rc = -ENOMEM; lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, @@ -8294,7 +8294,7 @@ lpfc_cmf_setup(struct lpfc_hba *phba) /* Allocate Congestion Information Buffer */ if (!phba->cgn_i) { - mp = kmalloc_obj(*mp, GFP_KERNEL); + mp = kmalloc_obj(*mp); if (mp) mp->virt = dma_alloc_coherent (&phba->pcidev->dev, @@ -8376,7 +8376,7 @@ no_cmf: /* Allocate RX Monitor Buffer */ if (!phba->rx_monitor) { - phba->rx_monitor = kzalloc_obj(*phba->rx_monitor, GFP_KERNEL); + phba->rx_monitor = kzalloc_obj(*phba->rx_monitor); if (!phba->rx_monitor) { lpfc_printf_log(phba, KERN_ERR, LOG_INIT, @@ -17144,7 +17144,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, } else wq->db_regaddr = phba->sli4_hba.WQDBregaddr; } - wq->pring = kzalloc_obj(struct lpfc_sli_ring, GFP_KERNEL); + wq->pring = kzalloc_obj(struct lpfc_sli_ring); if (wq->pring == NULL) { status = -ENOMEM; goto out; @@ -19463,7 +19463,7 @@ lpfc_sli4_handle_mds_loopback(struct lpfc_vport *vport, } /* Allocate buffer for command payload */ - pcmd = kmalloc_obj(struct lpfc_dmabuf, GFP_KERNEL); + pcmd = kmalloc_obj(struct lpfc_dmabuf); if (pcmd) pcmd->virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL, &pcmd->phys); @@ -22294,7 +22294,7 @@ lpfc_read_object(struct lpfc_hba *phba, char *rdobject, uint32_t *datap, read_object->u.request.rd_object_name[j] = cpu_to_le32(rd_object_name[j]); - pcmd = kmalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kmalloc_obj(*pcmd); if (pcmd) pcmd->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &pcmd->phys); if (!pcmd || !pcmd->virt) { diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c index 68923dafee42..a0ceaa2428c2 100644 --- a/drivers/scsi/mac_esp.c +++ b/drivers/scsi/mac_esp.c @@ -323,7 +323,7 @@ static int esp_mac_probe(struct platform_device *dev) host->this_id = esp->scsi_id; esp->scsi_id_mask = 1 << esp->scsi_id; - mep = kzalloc_obj(struct mac_esp_priv, GFP_KERNEL); + mep = kzalloc_obj(struct mac_esp_priv); if (!mep) goto fail_free_command_block; mep->esp = esp; diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index de40a791ed3d..9476a0d2c72d 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4254,7 +4254,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_host_put; } - adapter->scb_list = kmalloc_objs(scb_t, MAX_COMMANDS, GFP_KERNEL); + adapter->scb_list = kmalloc_objs(scb_t, MAX_COMMANDS); if (!adapter->scb_list) { dev_warn(&pdev->dev, "out of RAM\n"); goto out_free_cmd_buffer; diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index fa10a89d7563..06cf94ee4e36 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -429,7 +429,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_master(pdev); // Allocate the per driver initialization structure - adapter = kzalloc_obj(adapter_t, GFP_KERNEL); + adapter = kzalloc_obj(adapter_t); if (adapter == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -713,7 +713,7 @@ megaraid_init_mbox(adapter_t *adapter) * Allocate and initialize the init data structure for mailbox * controllers */ - raid_dev = kzalloc_obj(mraid_device_t, GFP_KERNEL); + raid_dev = kzalloc_obj(mraid_device_t); if (raid_dev == NULL) return -1; @@ -1017,7 +1017,7 @@ megaraid_alloc_cmd_packets(adapter_t *adapter) * since the calling routine does not yet know the number of available * commands. */ - adapter->kscb_list = kzalloc_objs(scb_t, MBOX_MAX_SCSI_CMDS, GFP_KERNEL); + adapter->kscb_list = kzalloc_objs(scb_t, MBOX_MAX_SCSI_CMDS); if (adapter->kscb_list == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -3403,7 +3403,7 @@ megaraid_cmm_register(adapter_t *adapter) int i; // Allocate memory for the base list of scb for management module. - adapter->uscb_list = kzalloc_objs(scb_t, MBOX_MAX_USER_CMDS, GFP_KERNEL); + adapter->uscb_list = kzalloc_objs(scb_t, MBOX_MAX_USER_CMDS); if (adapter->uscb_list == NULL) { con_log(CL_ANN, (KERN_WARNING @@ -3763,9 +3763,9 @@ megaraid_sysfs_alloc_resources(adapter_t *adapter) mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); int rval = 0; - raid_dev->sysfs_uioc = kmalloc_obj(uioc_t, GFP_KERNEL); + raid_dev->sysfs_uioc = kmalloc_obj(uioc_t); - raid_dev->sysfs_mbox64 = kmalloc_obj(mbox64_t, GFP_KERNEL); + raid_dev->sysfs_mbox64 = kmalloc_obj(mbox64_t); raid_dev->sysfs_buffer = dma_alloc_coherent(&adapter->pdev->dev, PAGE_SIZE, &raid_dev->sysfs_buffer_dma, GFP_KERNEL); diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 0b457f691b1e..1532183897ab 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -913,7 +913,7 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) if (lld_adp->drvr_type != DRVRTYPE_MBOX) return (-EINVAL); - adapter = kzalloc_obj(mraid_mmadp_t, GFP_KERNEL); + adapter = kzalloc_obj(mraid_mmadp_t); if (!adapter) return -ENOMEM; diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 074ace2c9790..5b18c7ac6aa2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -2137,7 +2137,7 @@ static int megasas_sdev_init(struct scsi_device *sdev) } scan_target: - mr_device_priv_data = kzalloc_obj(*mr_device_priv_data, GFP_KERNEL); + mr_device_priv_data = kzalloc_obj(*mr_device_priv_data); if (!mr_device_priv_data) return -ENOMEM; @@ -6386,7 +6386,7 @@ static int megasas_init_fw(struct megasas_instance *instance) } for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { fusion->stream_detect_by_ld[i] = - kzalloc_obj(struct LD_STREAM_DETECT, GFP_KERNEL); + kzalloc_obj(struct LD_STREAM_DETECT); if (!fusion->stream_detect_by_ld[i]) { dev_err(&instance->pdev->dev, "unable to allocate stream detect by LD\n"); @@ -8494,7 +8494,7 @@ megasas_compat_iocpacket_get_user(void __user *arg) int err = -EFAULT; int i; - ioc = kzalloc_obj(*ioc, GFP_KERNEL); + ioc = kzalloc_obj(*ioc); if (!ioc) return ERR_PTR(-ENOMEM); size = offsetof(struct megasas_iocpacket, frame) + sizeof(ioc->frame); diff --git a/drivers/scsi/megaraid/megaraid_sas_debugfs.c b/drivers/scsi/megaraid/megaraid_sas_debugfs.c index 43bb218dea13..81698cd83f5a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_debugfs.c +++ b/drivers/scsi/megaraid/megaraid_sas_debugfs.c @@ -65,7 +65,7 @@ megasas_debugfs_raidmap_open(struct inode *inode, struct file *file) fusion = instance->ctrl_context; - debug = kzalloc_obj(struct megasas_debugfs_buffer, GFP_KERNEL); + debug = kzalloc_obj(struct megasas_debugfs_buffer); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index e3de9c95bf4f..f02c93d6a2c9 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1744,7 +1744,7 @@ static int megasas_alloc_ioc_init_frame(struct megasas_instance *instance) fusion = instance->ctrl_context; - cmd = kzalloc_obj(struct megasas_cmd, GFP_KERNEL); + cmd = kzalloc_obj(struct megasas_cmd); if (!cmd) { dev_err(&instance->pdev->dev, "Failed from func: %s line: %d\n", @@ -5298,7 +5298,7 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) { struct fusion_context *fusion; - instance->ctrl_context = kzalloc_obj(struct fusion_context, GFP_KERNEL); + instance->ctrl_context = kzalloc_obj(struct fusion_context); if (!instance->ctrl_context) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index b42c14f1442b..1b938359df08 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1288,7 +1288,7 @@ static void mpi3mr_fault_uevent_emit(struct mpi3mr_ioc *mrioc) struct kobj_uevent_env *env; int ret; - env = kzalloc_obj(*env, GFP_KERNEL); + env = kzalloc_obj(*env); if (!env) return; diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 5e53b200c19b..90f8b9d1c2ac 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -1710,7 +1710,7 @@ static void mpi3mr_encldev_add_chg_evt_bh(struct mpi3mr_ioc *mrioc, encl_handle); if (!enclosure_dev && present) { enclosure_dev = - kzalloc_obj(struct mpi3mr_enclosure_node, GFP_KERNEL); + kzalloc_obj(struct mpi3mr_enclosure_node); if (!enclosure_dev) return; list_add_tail(&enclosure_dev->list, @@ -4897,7 +4897,7 @@ static int mpi3mr_sdev_init(struct scsi_device *sdev) spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags); - scsi_dev_priv_data = kzalloc_obj(*scsi_dev_priv_data, GFP_KERNEL); + scsi_dev_priv_data = kzalloc_obj(*scsi_dev_priv_data); if (!scsi_dev_priv_data) return -ENOMEM; @@ -4928,7 +4928,7 @@ static int mpi3mr_target_alloc(struct scsi_target *starget) int retval = 0; struct sas_rphy *rphy = NULL; - scsi_tgt_priv_data = kzalloc_obj(*scsi_tgt_priv_data, GFP_KERNEL); + scsi_tgt_priv_data = kzalloc_obj(*scsi_tgt_priv_data); if (!scsi_tgt_priv_data) return -ENOMEM; diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c index c79ba5bf56de..be4c14078952 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1022,7 +1022,7 @@ mpi3mr_alloc_hba_port(struct mpi3mr_ioc *mrioc, u16 port_id) { struct mpi3mr_hba_port *hba_port; - hba_port = kzalloc_obj(struct mpi3mr_hba_port, GFP_KERNEL); + hba_port = kzalloc_obj(struct mpi3mr_hba_port); if (!hba_port) return NULL; hba_port->port_id = port_id; @@ -1343,7 +1343,7 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, return NULL; } - mr_sas_port = kzalloc_obj(struct mpi3mr_sas_port, GFP_KERNEL); + mr_sas_port = kzalloc_obj(struct mpi3mr_sas_port); if (!mr_sas_port) return NULL; @@ -1720,7 +1720,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) sas_io_unit_pg0 = kzalloc(sz, GFP_KERNEL); if (!sas_io_unit_pg0) return; - h_port = kzalloc_objs(struct host_port, 64, GFP_KERNEL); + h_port = kzalloc_objs(struct host_port, 64); if (!h_port) goto out; @@ -2097,7 +2097,7 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle) if (sas_expander) return 0; - sas_expander = kzalloc_obj(struct mpi3mr_sas_node, GFP_KERNEL); + sas_expander = kzalloc_obj(struct mpi3mr_sas_node); if (!sas_expander) return -ENOMEM; diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 32e6c1f2f058..8d34d1ca3866 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -3161,7 +3161,7 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index) struct adapter_reply_queue *reply_q; int r, qid; - reply_q = kzalloc_obj(struct adapter_reply_queue, GFP_KERNEL); + reply_q = kzalloc_obj(struct adapter_reply_queue); if (!reply_q) { ioc_err(ioc, "unable to allocate memory %zu!\n", sizeof(struct adapter_reply_queue)); diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 35b78162e8c3..111b23875f4d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -4031,7 +4031,7 @@ diag_trigger_scsi_store(struct device *cdev, sz = min(sizeof(struct SL_WH_SCSI_TRIGGERS_T), count); if (ioc->supports_trigger_pages) { - scsi_tg = kzalloc_obj(struct SL_WH_SCSI_TRIGGERS_T, GFP_KERNEL); + scsi_tg = kzalloc_obj(struct SL_WH_SCSI_TRIGGERS_T); if (!scsi_tg) return -ENOMEM; @@ -4104,7 +4104,7 @@ diag_trigger_mpi_store(struct device *cdev, sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count); if (ioc->supports_trigger_pages) { - mpi_tg = kzalloc_obj(struct SL_WH_MPI_TRIGGERS_T, GFP_KERNEL); + mpi_tg = kzalloc_obj(struct SL_WH_MPI_TRIGGERS_T); if (!mpi_tg) return -ENOMEM; diff --git a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c index d755f58ad7a0..183391f6b8d1 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c +++ b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c @@ -58,7 +58,7 @@ _debugfs_iocdump_open(struct inode *inode, struct file *file) struct MPT3SAS_ADAPTER *ioc = inode->i_private; struct mpt3sas_debugfs_buffer *debug; - debug = kzalloc_obj(struct mpt3sas_debugfs_buffer, GFP_KERNEL); + debug = kzalloc_obj(struct mpt3sas_debugfs_buffer); if (!debug) return -ENOMEM; diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 1bafd51cdcf6..6407d6561d9e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -1940,7 +1940,7 @@ scsih_target_alloc(struct scsi_target *starget) unsigned long flags; struct sas_rphy *rphy; - sas_target_priv_data = kzalloc_obj(*sas_target_priv_data, GFP_KERNEL); + sas_target_priv_data = kzalloc_obj(*sas_target_priv_data); if (!sas_target_priv_data) return -ENOMEM; @@ -2108,7 +2108,7 @@ scsih_sdev_init(struct scsi_device *sdev) struct _pcie_device *pcie_device; unsigned long flags; - sas_device_priv_data = kzalloc_obj(*sas_device_priv_data, GFP_KERNEL); + sas_device_priv_data = kzalloc_obj(*sas_device_priv_data); if (!sas_device_priv_data) return -ENOMEM; @@ -6839,7 +6839,7 @@ _scsih_alloc_vphy(struct MPT3SAS_ADAPTER *ioc, u8 port_id, u8 phy_num) vphy = mpt3sas_get_vphy_by_phy(ioc, port, phy_num); if (!vphy) { - vphy = kzalloc_obj(struct virtual_phy, GFP_KERNEL); + vphy = kzalloc_obj(struct virtual_phy); if (!vphy) return NULL; @@ -6909,7 +6909,7 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc) sas_iounit_pg0->PhyData[0].ControllerDevHandle); port_id = sas_iounit_pg0->PhyData[i].Port; if (!(mpt3sas_get_port_by_id(ioc, port_id, 0))) { - port = kzalloc_obj(struct hba_port, GFP_KERNEL); + port = kzalloc_obj(struct hba_port); if (!port) goto out; @@ -7116,7 +7116,7 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc) port_id = sas_iounit_pg0->PhyData[i].Port; if (!(mpt3sas_get_port_by_id(ioc, port_id, 0))) { - port = kzalloc_obj(struct hba_port, GFP_KERNEL); + port = kzalloc_obj(struct hba_port); if (!port) goto out; @@ -7257,7 +7257,7 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle) if (sas_expander) return 0; - sas_expander = kzalloc_obj(struct _sas_node, GFP_KERNEL); + sas_expander = kzalloc_obj(struct _sas_node); if (!sas_expander) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7780,7 +7780,7 @@ _scsih_report_luns(struct MPT3SAS_ADAPTER *ioc, u16 handle, void *data, int retries; lun_data = NULL; - transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer); if (!transfer_packet) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7867,7 +7867,7 @@ _scsih_start_unit(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 lun, u8 is_pd, enum device_responsive_state rc; int return_code; - transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer); if (!transfer_packet) { pr_info("failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -7928,7 +7928,7 @@ _scsih_test_unit_ready(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 lun, int return_code; int sata_init_failure = 0; - transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer); if (!transfer_packet) { pr_info("failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8000,7 +8000,7 @@ _scsih_ata_pass_thru_idd(struct MPT3SAS_ADAPTER *ioc, u16 handle, u32 data_length; idd_data = NULL; - transfer_packet = kzalloc_obj(struct _scsi_io_transfer, GFP_KERNEL); + transfer_packet = kzalloc_obj(struct _scsi_io_transfer); if (!transfer_packet) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8131,7 +8131,7 @@ _scsih_wait_for_target_to_become_ready(struct MPT3SAS_ADAPTER *ioc, u16 handle, int lun; struct scsi_lun *lunp; - lun_data = kzalloc_objs(struct scsi_lun, MPT3_MAX_LUNS, GFP_KERNEL); + lun_data = kzalloc_objs(struct scsi_lun, MPT3_MAX_LUNS); if (!lun_data) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -8480,7 +8480,7 @@ _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 retry_count, } } - sas_device = kzalloc_obj(struct _sas_device, GFP_KERNEL); + sas_device = kzalloc_obj(struct _sas_device); if (!sas_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -9383,7 +9383,7 @@ _scsih_pcie_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 retry_count) } } - pcie_device = kzalloc_obj(struct _pcie_device, GFP_KERNEL); + pcie_device = kzalloc_obj(struct _pcie_device); if (!pcie_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -9835,7 +9835,7 @@ _scsih_sas_enclosure_dev_status_change_event(struct MPT3SAS_ADAPTER *ioc, case MPI2_EVENT_SAS_ENCL_RC_ADDED: if (!enclosure_dev) { enclosure_dev = - kzalloc_obj(struct _enclosure_node, GFP_KERNEL); + kzalloc_obj(struct _enclosure_node); if (!enclosure_dev) { ioc_info(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -10260,7 +10260,7 @@ _scsih_sas_volume_add(struct MPT3SAS_ADAPTER *ioc, if (raid_device) return; - raid_device = kzalloc_obj(struct _raid_device, GFP_KERNEL); + raid_device = kzalloc_obj(struct _raid_device); if (!raid_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -10678,7 +10678,7 @@ _scsih_sas_ir_volume_event(struct MPT3SAS_ADAPTER *ioc, break; } - raid_device = kzalloc_obj(struct _raid_device, GFP_KERNEL); + raid_device = kzalloc_obj(struct _raid_device); if (!raid_device) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); @@ -11039,7 +11039,7 @@ _scsih_create_enclosure_list_after_reset(struct MPT3SAS_ADAPTER *ioc) enclosure_handle = 0xFFFF; do { enclosure_dev = - kzalloc_obj(struct _enclosure_node, GFP_KERNEL); + kzalloc_obj(struct _enclosure_node); if (!enclosure_dev) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index 09a36e561da5..e74a526efa8d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -698,7 +698,7 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, return NULL; } - mpt3sas_port = kzalloc_obj(struct _sas_port, GFP_KERNEL); + mpt3sas_port = kzalloc_obj(struct _sas_port); if (!mpt3sas_port) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); diff --git a/drivers/scsi/mvme16x_scsi.c b/drivers/scsi/mvme16x_scsi.c index 43c68802d40a..f4db93c13986 100644 --- a/drivers/scsi/mvme16x_scsi.c +++ b/drivers/scsi/mvme16x_scsi.c @@ -49,7 +49,7 @@ static int mvme16x_probe(struct platform_device *dev) goto out; } - hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters); if (hostdata == NULL) { printk(KERN_ERR "mvme16x-scsi: " "Failed to allocate host data\n"); diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 6f5a98572c33..5abc17a2e261 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -401,7 +401,7 @@ static int mvs_prep_sas_ha_init(struct Scsi_Host *shost, sha->sas_port = arr_port; sha->shost = shost; - sha->lldd_ha = kzalloc_obj(struct mvs_prv_info, GFP_KERNEL); + sha->lldd_ha = kzalloc_obj(struct mvs_prv_info); if (!sha->lldd_ha) goto exit_free; @@ -502,7 +502,7 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent) chip = &mvs_chips[ent->driver_data]; SHOST_TO_SAS_HA(shost) = - kzalloc_objs(struct sas_ha_struct, 1, GFP_KERNEL); + kzalloc_objs(struct sas_ha_struct, 1); if (!SHOST_TO_SAS_HA(shost)) { scsi_host_put(shost); rc = -ENOMEM; diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 10b40c434977..5fe066a6c377 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -252,7 +252,7 @@ static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba, { struct mvumi_cmd *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) { dev_err(&mhba->pdev->dev, "failed to create a internal cmd\n"); return NULL; @@ -368,7 +368,7 @@ static int mvumi_alloc_cmds(struct mvumi_hba *mhba) struct mvumi_cmd *cmd; for (i = 0; i < mhba->max_io; i++) { - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) goto err_exit; @@ -2193,7 +2193,7 @@ static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba) mhba->mmio = mhba->base_addr[0]; base = mhba->mmio; if (!mhba->regs) { - mhba->regs = kzalloc_obj(*regs, GFP_KERNEL); + mhba->regs = kzalloc_obj(*regs); if (mhba->regs == NULL) return -ENOMEM; } @@ -2245,7 +2245,7 @@ static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba) mhba->mmio = mhba->base_addr[2]; base = mhba->mmio; if (!mhba->regs) { - mhba->regs = kzalloc_obj(*regs, GFP_KERNEL); + mhba->regs = kzalloc_obj(*regs); if (mhba->regs == NULL) return -ENOMEM; } diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index e24996921e87..3678b66310ed 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -1628,7 +1628,7 @@ static int myrb_ldev_sdev_init(struct scsi_device *sdev) ldev_info = cb->ldev_info_buf + ldev_num; - sdev->hostdata = kzalloc_obj(*ldev_info, GFP_KERNEL); + sdev->hostdata = kzalloc_obj(*ldev_info); if (!sdev->hostdata) return -ENOMEM; dev_dbg(&sdev->sdev_gendev, @@ -1672,7 +1672,7 @@ static int myrb_pdev_sdev_init(struct scsi_device *sdev) if (sdev->id > MYRB_MAX_TARGETS) return -ENXIO; - pdev_info = kzalloc_obj(*pdev_info, GFP_KERNEL); + pdev_info = kzalloc_obj(*pdev_info); if (!pdev_info) return -ENOMEM; diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 77ed566d7b92..afd68225221a 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -538,11 +538,11 @@ static bool myrs_enable_mmio_mbox(struct myrs_hba *cs, cs->fwstat_buf = NULL; goto out_free; } - cs->ctlr_info = kzalloc_obj(struct myrs_ctlr_info, GFP_KERNEL); + cs->ctlr_info = kzalloc_obj(struct myrs_ctlr_info); if (!cs->ctlr_info) goto out_free; - cs->event_buf = kzalloc_obj(struct myrs_event, GFP_KERNEL); + cs->event_buf = kzalloc_obj(struct myrs_event); if (!cs->event_buf) goto out_free; @@ -1803,7 +1803,7 @@ static int myrs_sdev_init(struct scsi_device *sdev) ldev_num = myrs_translate_ldev(cs, sdev); - ldev_info = kzalloc_obj(*ldev_info, GFP_KERNEL); + ldev_info = kzalloc_obj(*ldev_info); if (!ldev_info) return -ENOMEM; @@ -1865,7 +1865,7 @@ static int myrs_sdev_init(struct scsi_device *sdev) } else { struct myrs_pdev_info *pdev_info; - pdev_info = kzalloc_obj(*pdev_info, GFP_KERNEL); + pdev_info = kzalloc_obj(*pdev_info); if (!pdev_info) return -ENOMEM; diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index ae96602a543b..014ae8d42331 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -96,7 +96,7 @@ static int aha152x_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "aha152x_attach()\n"); /* Create new SCSI device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->p_dev = link; link->priv = info; diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 50d2e4ffe037..ae70fda96ae9 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -1520,7 +1520,7 @@ static int nsp_cs_probe(struct pcmcia_device *link) nsp_dbg(NSP_DEBUG_INIT, "in"); /* Create new SCSI device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info == NULL) { return -ENOMEM; } info->p_dev = link; link->priv = info; diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index f24223fc58b8..5d8a434d3f66 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c @@ -152,7 +152,7 @@ static int qlogic_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "qlogic_attach()\n"); /* Create new SCSI device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 2accb2c538f0..1530c1ad5d36 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -849,7 +849,7 @@ SYM53C500_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "SYM53C500_attach()\n"); /* Create new SCSI device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 68b4ddcb7781..fff8d877abb9 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -4371,7 +4371,7 @@ int pm8001_chip_get_nvmd_req(struct pm8001_hba_info *pm8001_ha, struct pm8001_ioctl_payload *ioctl_payload = payload; nvmd_type = ioctl_payload->minor_function; - fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex); if (!fw_control_context) return -ENOMEM; fw_control_context->usrAddr = (u8 *)ioctl_payload->func_specific; @@ -4464,7 +4464,7 @@ int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha, struct pm8001_ioctl_payload *ioctl_payload = payload; nvmd_type = ioctl_payload->minor_function; - fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex); if (!fw_control_context) return -ENOMEM; @@ -4579,7 +4579,7 @@ pm8001_chip_fw_flash_update_req(struct pm8001_hba_info *pm8001_ha, dma_addr_t phys_addr = pm8001_ha->memoryMap.region[FW_FLASH].phys_addr; struct pm8001_ioctl_payload *ioctl_payload = payload; - fw_control_context = kzalloc_obj(struct fw_control_ex, GFP_KERNEL); + fw_control_context = kzalloc_obj(struct fw_control_ex); if (!fw_control_context) return -ENOMEM; fw_control = (struct fw_control_info *)&ioctl_payload->func_specific; diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 631b7fa47fce..e93ea76b565e 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -622,7 +622,7 @@ static int pm8001_prep_sas_ha_init(struct Scsi_Host *shost, sha->sas_phy = arr_phy; sha->sas_port = arr_port; - sha->lldd_ha = kzalloc_obj(struct pm8001_hba_info, GFP_KERNEL); + sha->lldd_ha = kzalloc_obj(struct pm8001_hba_info); if (!sha->lldd_ha) goto exit_free1; @@ -1148,7 +1148,7 @@ static int pm8001_pci_probe(struct pci_dev *pdev, goto err_out_regions; } chip = &pm8001_chips[ent->driver_data]; - sha = kzalloc_obj(struct sas_ha_struct, GFP_KERNEL); + sha = kzalloc_obj(struct sas_ha_struct); if (!sha) { rc = -ENOMEM; goto err_out_free_host; @@ -1264,7 +1264,7 @@ static int pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha) /* Memory region for ccb_info*/ pm8001_ha->ccb_count = ccb_count; pm8001_ha->ccb_info = - kzalloc_objs(struct pm8001_ccb_info, ccb_count, GFP_KERNEL); + kzalloc_objs(struct pm8001_ccb_info, ccb_count); if (!pm8001_ha->ccb_info) { pm8001_dbg(pm8001_ha, FAIL, "Unable to allocate memory for ccb\n"); diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 77ded22a26c7..954f307352e6 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1563,7 +1563,7 @@ void pm80xx_fatal_error_uevent_emit(struct pm8001_hba_info *pm8001_ha, pm8001_dbg(pm8001_ha, FAIL, "emitting fatal error uevent"); - env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env); if (!env) return; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index ff31e12aaba0..ce76c9dd6171 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3468,7 +3468,7 @@ static long pmcraid_chr_ioctl( void __user *argp = (void __user *)arg; int retval = -ENOTTY; - hdr = kmalloc_obj(struct pmcraid_ioctl_header, GFP_KERNEL); + hdr = kmalloc_obj(struct pmcraid_ioctl_header); if (!hdr) { pmcraid_err("failed to allocate memory for ioctl header\n"); diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index 7c8923368edd..8a4e910d5758 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -1042,7 +1042,7 @@ static int __ppa_attach(struct parport *pb) int err = -ENOMEM; struct pardev_cb ppa_cb; - dev = kzalloc_obj(ppa_struct, GFP_KERNEL); + dev = kzalloc_obj(ppa_struct); if (!dev) return -ENOMEM; dev->base = -1; diff --git a/drivers/scsi/qedf/qedf_debugfs.c b/drivers/scsi/qedf/qedf_debugfs.c index 9b2ed9cb6245..a9d109c2cb4d 100644 --- a/drivers/scsi/qedf/qedf_debugfs.c +++ b/drivers/scsi/qedf/qedf_debugfs.c @@ -422,7 +422,7 @@ qedf_offload_stats_show(struct seq_file *s, void *unused) struct qedf_ctx *qedf = s->private; struct qed_fcoe_stats *fw_fcoe_stats; - fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats, GFP_KERNEL); + fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats); if (!fw_fcoe_stats) { QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate memory for " "fw_fcoe_stats.\n"); diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 73a0ce7e5180..af1a34bed2f1 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -254,7 +254,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) } /* Allocate pool of io_bdts - one for each qedf_ioreq */ - cmgr->io_bdt_pool = kmalloc_objs(struct io_bdt *, num_ios, GFP_KERNEL); + cmgr->io_bdt_pool = kmalloc_objs(struct io_bdt *, num_ios); if (!cmgr->io_bdt_pool) { QEDF_WARN(&(qedf->dbg_ctx), "Failed to alloc io_bdt_pool.\n"); @@ -262,7 +262,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) } for (i = 0; i < num_ios; i++) { - cmgr->io_bdt_pool[i] = kmalloc_obj(struct io_bdt, GFP_KERNEL); + cmgr->io_bdt_pool[i] = kmalloc_obj(struct io_bdt); if (!cmgr->io_bdt_pool[i]) { QEDF_WARN(&(qedf->dbg_ctx), "Failed to alloc io_bdt_pool[%d].\n", i); diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index c712fdf86911..f1b6abba81e6 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -2082,7 +2082,7 @@ static struct fc_host_statistics *qedf_fc_get_host_stats(struct Scsi_Host if (lport->vport) goto out; - fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats, GFP_KERNEL); + fw_fcoe_stats = kmalloc_obj(struct qed_fcoe_stats); if (!fw_fcoe_stats) { QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate memory for " "fw_fcoe_stats.\n"); @@ -2778,7 +2778,7 @@ static int qedf_prepare_sb(struct qedf_ctx *qedf) int ret; qedf->fp_array = - kzalloc_objs(struct qedf_fastpath, qedf->num_queues, GFP_KERNEL); + kzalloc_objs(struct qedf_fastpath, qedf->num_queues); if (!qedf->fp_array) { QEDF_ERR(&(qedf->dbg_ctx), "fastpath array allocation " @@ -2789,7 +2789,7 @@ static int qedf_prepare_sb(struct qedf_ctx *qedf) for (id = 0; id < qedf->num_queues; id++) { fp = &(qedf->fp_array[id]); fp->sb_id = QEDF_SB_ID_NULL; - fp->sb_info = kzalloc_objs(*fp->sb_info, 1, GFP_KERNEL); + fp->sb_info = kzalloc_objs(*fp->sb_info, 1); if (!fp->sb_info) { QEDF_ERR(&(qedf->dbg_ctx), "SB info struct " "allocation failed.\n"); diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index 65fdbc07de43..6ab3a989d281 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -440,7 +440,7 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi, qedi_ep = qedi_conn->ep; - conn_info = kzalloc_obj(*conn_info, GFP_KERNEL); + conn_info = kzalloc_obj(*conn_info); if (!conn_info) { QEDI_ERR(&qedi->dbg_ctx, "memory alloc failed\n"); return -ENOMEM; @@ -505,7 +505,7 @@ static int qedi_iscsi_offload_conn(struct qedi_endpoint *qedi_ep) int rval; int i; - conn_info = kzalloc_obj(*conn_info, GFP_KERNEL); + conn_info = kzalloc_obj(*conn_info); if (!conn_info) { QEDI_ERR(&qedi->dbg_ctx, "Failed to allocate memory ep=%p\n", qedi_ep); diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 14ec6cb44316..ddb061ac300b 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -276,7 +276,7 @@ static int qedi_alloc_uio_rings(struct qedi_ctx *qedi) } } - udev = kzalloc_obj(*udev, GFP_KERNEL); + udev = kzalloc_obj(*udev); if (!udev) goto err_udev; @@ -956,7 +956,7 @@ static int qedi_find_boot_info(struct qedi_ctx *qedi, pri_ctrl_flags = !!(block->target[0].ctrl_flags & NVM_ISCSI_CFG_TARGET_ENABLED); if (pri_ctrl_flags) { - pri_tgt = kzalloc_obj(*pri_tgt, GFP_KERNEL); + pri_tgt = kzalloc_obj(*pri_tgt); if (!pri_tgt) return -1; qedi_get_boot_tgt_info(block, pri_tgt, 0); @@ -965,7 +965,7 @@ static int qedi_find_boot_info(struct qedi_ctx *qedi, sec_ctrl_flags = !!(block->target[1].ctrl_flags & NVM_ISCSI_CFG_TARGET_ENABLED); if (sec_ctrl_flags) { - sec_tgt = kzalloc_obj(*sec_tgt, GFP_KERNEL); + sec_tgt = kzalloc_obj(*sec_tgt); if (!sec_tgt) { ret = -1; goto free_tgt; @@ -1066,7 +1066,7 @@ static void qedi_get_protocol_tlv_data(void *dev, void *data) struct qedi_ctx *qedi = dev; int rval = 0; - fw_iscsi_stats = kmalloc_obj(*fw_iscsi_stats, GFP_KERNEL); + fw_iscsi_stats = kmalloc_obj(*fw_iscsi_stats); if (!fw_iscsi_stats) { QEDI_ERR(&qedi->dbg_ctx, "Could not allocate memory for fw_iscsi_stats.\n"); diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 924b07f56c80..5e910b5ca670 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -2395,7 +2395,7 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) !IS_QLA28XX(vha->hw)) return -EPERM; - dd = kmalloc_obj(*dd, GFP_KERNEL); + dd = kmalloc_obj(*dd); if (!dd) { ql_log(ql_log_warn, vha, 0x70db, "Failed to allocate memory for dport.\n"); @@ -2441,7 +2441,7 @@ qla2x00_do_dport_diagnostics_v2(struct bsg_job *bsg_job) if (!IS_DPORT_CAPABLE(vha->hw)) return -EPERM; - dd = kzalloc_obj(*dd, GFP_KERNEL); + dd = kzalloc_obj(*dd); if (!dd) return -ENOMEM; @@ -2598,7 +2598,7 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc_obj(*req_data, GFP_KERNEL); + req_data = kzalloc_obj(*req_data); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2669,7 +2669,7 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc_obj(*req_data, GFP_KERNEL); + req_data = kzalloc_obj(*req_data); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2776,7 +2776,7 @@ qla2x00_get_tgt_stats(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc_obj(*req_data, GFP_KERNEL); + req_data = kzalloc_obj(*req_data); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; @@ -2859,7 +2859,7 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job) return -EIO; } - req_data = kzalloc_obj(*req_data, GFP_KERNEL); + req_data = kzalloc_obj(*req_data); if (!req_data) { ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); return -ENOMEM; diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index a2db229d3af4..eccedb38a515 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -1393,7 +1393,7 @@ qla_edif_add_sa_ctl(fc_port_t *fcport, struct qla_sa_update_frame *sa_frame, int index = sa_frame->fast_sa_index; unsigned long flags = 0; - sa_ctl = kzalloc_obj(*sa_ctl, GFP_KERNEL); + sa_ctl = kzalloc_obj(*sa_ctl); if (!sa_ctl) { /* couldn't get space */ ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, @@ -3381,7 +3381,7 @@ void qla_edif_sadb_release(struct qla_hw_data *ha) int qla_edif_sadb_build_free_pool(struct qla_hw_data *ha) { ha->edif_tx_sa_id_map = - kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX), GFP_KERNEL); + kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX)); if (!ha->edif_tx_sa_id_map) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0009, @@ -3390,7 +3390,7 @@ int qla_edif_sadb_build_free_pool(struct qla_hw_data *ha) } ha->edif_rx_sa_id_map = - kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX), GFP_KERNEL); + kzalloc_objs(long, BITS_TO_LONGS(EDIF_NUM_SA_INDEX)); if (!ha->edif_rx_sa_id_map) { kfree(ha->edif_tx_sa_id_map); ha->edif_tx_sa_id_map = NULL; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 808acf7daf4d..5badce1b8ff5 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -9230,7 +9230,7 @@ qla84xx_get_chip(struct scsi_qla_host *vha) } } - cs84xx = kzalloc_obj(*cs84xx, GFP_KERNEL); + cs84xx = kzalloc_obj(*cs84xx); if (!cs84xx) goto done; @@ -9884,7 +9884,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, } if (ql2xmqsupport || ql2xnvmeenable) { - qpair = kzalloc_obj(struct qla_qpair, GFP_KERNEL); + qpair = kzalloc_obj(struct qla_qpair); if (qpair == NULL) { ql_log(ql_log_warn, vha, 0x0182, "Failed to allocate memory for queue pair.\n"); diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 34928d981677..6dca934b033a 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -707,7 +707,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, device_reg_t *reg; uint32_t cnt; - req = kzalloc_obj(struct req_que, GFP_KERNEL); + req = kzalloc_obj(struct req_que); if (req == NULL) { ql_log(ql_log_fatal, base_vha, 0x00d9, "Failed to allocate memory for request queue.\n"); @@ -834,7 +834,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options, uint16_t que_id = 0; device_reg_t *reg; - rsp = kzalloc_obj(struct rsp_que, GFP_KERNEL); + rsp = kzalloc_obj(struct rsp_que); if (rsp == NULL) { ql_log(ql_log_warn, base_vha, 0x0066, "Failed to allocate memory for response queue.\n"); diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index ec47ef3f0783..298c060c1292 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -1183,7 +1183,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x0072, "%d CRB init values found in ROM.\n", n); - buf = kmalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); + buf = kmalloc_objs(struct crb_addr_pair, n); if (buf == NULL) { ql_log(ql_log_fatal, vha, 0x010c, "Unable to allocate memory.\n"); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 89540254b784..976181464fbb 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -454,7 +454,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, goto fail_rsp_map; } - ha->base_qpair = kzalloc_obj(struct qla_qpair, GFP_KERNEL); + ha->base_qpair = kzalloc_obj(struct qla_qpair); if (ha->base_qpair == NULL) { ql_log(ql_log_warn, vha, 0x00e0, "Failed to allocate base queue pair memory.\n"); @@ -2960,7 +2960,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } - ha = kzalloc_obj(struct qla_hw_data, GFP_KERNEL); + ha = kzalloc_obj(struct qla_hw_data); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, "Unable to allocate memory for ha.\n"); @@ -4336,7 +4336,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, } /* Allocate memory for request ring */ - *req = kzalloc_obj(struct req_que, GFP_KERNEL); + *req = kzalloc_obj(struct req_que); if (!*req) { ql_log_pci(ql_log_fatal, ha->pdev, 0x0028, "Failed to allocate memory for req.\n"); @@ -4352,7 +4352,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, goto fail_req_ring; } /* Allocate memory for response ring */ - *rsp = kzalloc_obj(struct rsp_que, GFP_KERNEL); + *rsp = kzalloc_obj(struct rsp_que); if (!*rsp) { ql_log_pci(ql_log_fatal, ha->pdev, 0x002a, "Failed to allocate memory for rsp.\n"); @@ -6017,7 +6017,7 @@ qla25xx_rdp_rsp_reduce_size(struct scsi_qla_host *vha, ql_dbg(ql_dbg_init, vha, 0x0181, "%s: s_id=%#x\n", __func__, sid); - pdb = kzalloc_obj(*pdb, GFP_KERNEL); + pdb = kzalloc_obj(*pdb); if (!pdb) { ql_dbg(ql_dbg_init, vha, 0x0181, "%s: Failed allocate pdb\n", __func__); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 8062dad21d4e..9c9cb5c97f5c 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -7458,7 +7458,7 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha) BUG_ON(base_vha->vha_tgt.qla_tgt != NULL); - tgt = kzalloc_obj(struct qla_tgt, GFP_KERNEL); + tgt = kzalloc_obj(struct qla_tgt); if (!tgt) { ql_dbg(ql_dbg_tgt, base_vha, 0xe066, "Unable to allocate struct qla_tgt\n"); diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 2eae89aad109..28df9025def0 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1015,7 +1015,7 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg(struct se_wwn *wwn, return ERR_PTR(-ENOSYS); } - tpg = kzalloc_obj(struct tcm_qla2xxx_tpg, GFP_KERNEL); + tpg = kzalloc_obj(struct tcm_qla2xxx_tpg); if (!tpg) { pr_err("Unable to allocate struct tcm_qla2xxx_tpg\n"); return ERR_PTR(-ENOMEM); @@ -1106,7 +1106,7 @@ static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(struct se_wwn *wwn, if (kstrtoul(name + 5, 10, &tpgt) || tpgt > USHRT_MAX) return ERR_PTR(-EINVAL); - tpg = kzalloc_obj(struct tcm_qla2xxx_tpg, GFP_KERNEL); + tpg = kzalloc_obj(struct tcm_qla2xxx_tpg); if (!tpg) { pr_err("Unable to allocate struct tcm_qla2xxx_tpg\n"); return ERR_PTR(-ENOMEM); @@ -1609,7 +1609,7 @@ static struct se_wwn *tcm_qla2xxx_make_lport( if (tcm_qla2xxx_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); - lport = kzalloc_obj(struct tcm_qla2xxx_lport, GFP_KERNEL); + lport = kzalloc_obj(struct tcm_qla2xxx_lport); if (!lport) { pr_err("Unable to allocate struct tcm_qla2xxx_lport\n"); return ERR_PTR(-ENOMEM); @@ -1735,7 +1735,7 @@ static struct se_wwn *tcm_qla2xxx_npiv_make_lport( &npiv_wwpn, &npiv_wwnn) < 0) return ERR_PTR(-EINVAL); - lport = kzalloc_obj(struct tcm_qla2xxx_lport, GFP_KERNEL); + lport = kzalloc_obj(struct tcm_qla2xxx_lport); if (!lport) { pr_err("Unable to allocate struct tcm_qla2xxx_lport for NPIV\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c index 3ec9321f41e2..c40441b12db9 100644 --- a/drivers/scsi/qla4xxx/ql4_iocb.c +++ b/drivers/scsi/qla4xxx/ql4_iocb.c @@ -451,7 +451,7 @@ static struct mrb *qla4xxx_get_new_mrb(struct scsi_qla_host *ha) { struct mrb *mrb; - mrb = kzalloc_obj(*mrb, GFP_KERNEL); + mrb = kzalloc_obj(*mrb); if (!mrb) return mrb; diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 47b9fea0a989..f7340cfc990a 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c @@ -1058,7 +1058,7 @@ qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose) ql4_printk(KERN_INFO, ha, "%s: %d CRB init values found in ROM.\n", DRIVER_NAME, n); - buf = kmalloc_objs(struct crb_addr_pair, n, GFP_KERNEL); + buf = kmalloc_objs(struct crb_addr_pair, n); if (buf == NULL) { ql4_printk(KERN_WARNING, ha, "%s: [ERROR] Unable to malloc memory.\n", DRIVER_NAME); diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index 46fb627f61d6..94f76e358634 100644 --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c @@ -81,7 +81,7 @@ static int raid_setup(struct transport_container *tc, struct device *dev, BUG_ON(dev_get_drvdata(cdev)); - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; @@ -212,7 +212,7 @@ raid_attr_ro_state_fn(state); struct raid_template * raid_class_attach(struct raid_function_template *ft) { - struct raid_internal *i = kzalloc_obj(struct raid_internal, GFP_KERNEL); + struct raid_internal *i = kzalloc_obj(struct raid_internal); int count = 0; if (unlikely(!i)) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index fb609d2db056..91933d2f5159 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1169,7 +1169,7 @@ static ssize_t sdebug_error_write(struct file *file, const char __user *ubuf, return -EINVAL; } - inject = kzalloc_obj(struct sdebug_err_inject, GFP_KERNEL); + inject = kzalloc_obj(struct sdebug_err_inject); if (!inject) { kfree(buf); return -ENOMEM; @@ -1266,7 +1266,7 @@ static int sdebug_target_alloc(struct scsi_target *starget) { struct sdebug_target_info *targetip; - targetip = kzalloc_obj(struct sdebug_target_info, GFP_KERNEL); + targetip = kzalloc_obj(struct sdebug_target_info); if (!targetip) return -ENOMEM; @@ -8791,7 +8791,7 @@ static int sdebug_add_store(void) struct sdeb_store_info *sip = NULL; struct xa_limit xal = { .max = 1 << 16, .min = 0 }; - sip = kzalloc_obj(*sip, GFP_KERNEL); + sip = kzalloc_obj(*sip); if (!sip) return -ENOMEM; @@ -8868,7 +8868,7 @@ static int sdebug_add_host_helper(int per_host_idx) struct sdebug_host_info *sdbg_host; struct sdebug_dev_info *sdbg_devinfo, *tmp; - sdbg_host = kzalloc_obj(*sdbg_host, GFP_KERNEL); + sdbg_host = kzalloc_obj(*sdbg_host); if (!sdbg_host) return -ENOMEM; idx = (per_host_idx < 0) ? sdeb_first_idx : per_host_idx; diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index bb27ae42c594..0dada89d8d99 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -355,7 +355,7 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, if (IS_ERR(devinfo_table)) return PTR_ERR(devinfo_table); - devinfo = kmalloc_obj(*devinfo, GFP_KERNEL); + devinfo = kmalloc_obj(*devinfo); if (!devinfo) { printk(KERN_ERR "%s: no memory\n", __func__); return -ENOMEM; @@ -615,7 +615,7 @@ static int devinfo_seq_show(struct seq_file *m, void *v) static void *devinfo_seq_start(struct seq_file *m, loff_t *ppos) { - struct double_list *dl = kmalloc_obj(*dl, GFP_KERNEL); + struct double_list *dl = kmalloc_obj(*dl); loff_t pos = *ppos; if (!dl) @@ -759,7 +759,7 @@ int scsi_dev_info_add_list(enum scsi_devinfo_key key, const char *name) /* list already exists */ return -EEXIST; - devinfo_table = kmalloc_obj(*devinfo_table, GFP_KERNEL); + devinfo_table = kmalloc_obj(*devinfo_table); if (!devinfo_table) return -ENOMEM; diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 046871351dc0..1799dcae775c 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -162,7 +162,7 @@ int scsi_proc_hostdir_add(const struct scsi_host_template *sht) mutex_lock(&global_host_template_mutex); e = __scsi_lookup_proc_entry(sht); if (!e) { - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) { ret = -ENOMEM; goto unlock; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index ca2bda973aad..60c06fa4ec32 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1954,7 +1954,7 @@ static struct async_scan_data *scsi_prep_async_scan(struct Scsi_Host *shost) goto err; } - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) goto err; data->shost = scsi_host_get(shost); diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 3ec584e65fb4..dce95e361daf 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -2651,7 +2651,7 @@ struct scsi_transport_template * fc_attach_transport(struct fc_function_template *ft) { int count; - struct fc_internal *i = kzalloc_obj(struct fc_internal, GFP_KERNEL); + struct fc_internal *i = kzalloc_obj(struct fc_internal); if (unlikely(!i)) return NULL; diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index af050a2c628e..8aa76f813bcd 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -4848,7 +4848,7 @@ iscsi_register_transport(struct iscsi_transport *tt) if (priv) return NULL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; INIT_LIST_HEAD(&priv->list); diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 9bc00d950f86..12124f9d5ccd 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -712,7 +712,7 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number) struct Scsi_Host *shost = dev_to_shost(parent); struct sas_phy *phy; - phy = kzalloc_obj(*phy, GFP_KERNEL); + phy = kzalloc_obj(*phy); if (!phy) return NULL; @@ -907,7 +907,7 @@ struct sas_port *sas_port_alloc(struct device *parent, int port_id) struct Scsi_Host *shost = dev_to_shost(parent); struct sas_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return NULL; @@ -1467,7 +1467,7 @@ struct sas_rphy *sas_end_device_alloc(struct sas_port *parent) struct Scsi_Host *shost = dev_to_shost(&parent->dev); struct sas_end_device *rdev; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) { return NULL; } @@ -1511,7 +1511,7 @@ struct sas_rphy *sas_expander_alloc(struct sas_port *parent, BUG_ON(type != SAS_EDGE_EXPANDER_DEVICE && type != SAS_FANOUT_EXPANDER_DEVICE); - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) { return NULL; } @@ -1815,7 +1815,7 @@ sas_attach_transport(struct sas_function_template *ft) struct sas_internal *i; int count; - i = kzalloc_obj(struct sas_internal, GFP_KERNEL); + i = kzalloc_obj(struct sas_internal); if (!i) return NULL; diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 1f4299a61e1f..3e3da8c2ff26 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1570,7 +1570,7 @@ static int spi_target_configure(struct transport_container *tc, struct scsi_transport_template * spi_attach_transport(struct spi_function_template *ft) { - struct spi_internal *i = kzalloc_obj(struct spi_internal, GFP_KERNEL); + struct spi_internal *i = kzalloc_obj(struct spi_internal); if (unlikely(!i)) return NULL; diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index ada7e07e5ae0..d71ab5fdb758 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -700,7 +700,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, struct srp_internal *i = to_srp_internal(shost->transportt); int id, ret; - rport = kzalloc_obj(*rport, GFP_KERNEL); + rport = kzalloc_obj(*rport); if (!rport) return ERR_PTR(-ENOMEM); @@ -814,7 +814,7 @@ srp_attach_transport(struct srp_function_template *ft) int count; struct srp_internal *i; - i = kzalloc_obj(*i, GFP_KERNEL); + i = kzalloc_obj(*i); if (!i) return NULL; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 92fbe9caf6be..628a1d0a74ba 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3735,7 +3735,7 @@ static void sd_revalidate_disk(struct gendisk *disk) if (!scsi_device_online(sdp)) return; - lim = kmalloc_obj(*lim, GFP_KERNEL); + lim = kmalloc_obj(*lim); if (!lim) return; @@ -3974,7 +3974,7 @@ static int sd_probe(struct scsi_device *sdp) "sd_probe\n")); error = -ENOMEM; - sdkp = kzalloc_obj(*sdkp, GFP_KERNEL); + sdkp = kzalloc_obj(*sdkp); if (!sdkp) goto out; diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 901956cf3c5b..c096bbf68b2f 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -715,7 +715,7 @@ static int ses_intf_add(struct device *cdev) if (sdev->type != TYPE_ENCLOSURE) sdev_printk(KERN_NOTICE, sdev, "Embedded Enclosure Device\n"); - ses_dev = kzalloc_obj(*ses_dev, GFP_KERNEL); + ses_dev = kzalloc_obj(*ses_dev); hdr_buf = kzalloc(INIT_ALLOC_SIZE, GFP_KERNEL); if (!hdr_buf || !ses_dev) goto err_init_free; diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index b04d8ddeb2eb..37bac49f30f0 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1436,7 +1436,7 @@ sg_alloc(struct scsi_device *scsidp) int error; u32 k; - sdp = kzalloc_obj(Sg_device, GFP_KERNEL); + sdp = kzalloc_obj(Sg_device); if (!sdp) { sdev_printk(KERN_WARNING, scsidp, "%s: kmalloc Sg_device " "failure\n", __func__); @@ -2456,7 +2456,7 @@ struct sg_proc_deviter { static void * dev_seq_start(struct seq_file *s, loff_t *pos) { - struct sg_proc_deviter * it = kmalloc_obj(*it, GFP_KERNEL); + struct sg_proc_deviter * it = kmalloc_obj(*it); s->private = it; if (! it) diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index 16ca6245c51d..408f37003748 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c @@ -87,7 +87,7 @@ static int sim710_probe_common(struct device *dev, unsigned long base_addr, { struct Scsi_Host * host = NULL; struct NCR_700_Host_Parameters *hostdata = - kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); + kzalloc_obj(struct NCR_700_Host_Parameters); printk(KERN_NOTICE "sim710: %s\n", dev_name(dev)); printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n", diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 88b94e611d0f..2fb918677eb6 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -888,7 +888,7 @@ static int pqi_get_advanced_raid_bypass_config(struct pqi_ctrl_info *ctrl_info) struct pqi_raid_path_request request; struct bmic_sense_feature_buffer *buffer; - buffer = kmalloc_obj(*buffer, GFP_KERNEL); + buffer = kmalloc_obj(*buffer); if (!buffer) return -ENOMEM; @@ -953,7 +953,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, int rc; struct bmic_flush_cache *flush_cache; - flush_cache = kzalloc_obj(*flush_cache, GFP_KERNEL); + flush_cache = kzalloc_obj(*flush_cache); if (!flush_cache) return -ENOMEM; @@ -982,7 +982,7 @@ static int pqi_set_diag_rescan(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_diag_options *diag; - diag = kzalloc_obj(*diag, GFP_KERNEL); + diag = kzalloc_obj(*diag); if (!diag) return -ENOMEM; @@ -1164,7 +1164,7 @@ static int pqi_report_phys_logical_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd, void *lun_data = NULL; struct report_lun_header *report_lun_header; - report_lun_header = kmalloc_obj(*report_lun_header, GFP_KERNEL); + report_lun_header = kmalloc_obj(*report_lun_header); if (!report_lun_header) { rc = -ENOMEM; goto out; @@ -1478,7 +1478,7 @@ static int pqi_get_raid_map(struct pqi_ctrl_info *ctrl_info, u32 raid_map_size; struct raid_map *raid_map; - raid_map = kmalloc_obj(*raid_map, GFP_KERNEL); + raid_map = kmalloc_obj(*raid_map); if (!raid_map) return -ENOMEM; @@ -1616,7 +1616,7 @@ static void pqi_get_volume_status(struct pqi_ctrl_info *ctrl_info, u32 volume_flags; struct ciss_vpd_logical_volume_status *vpd; - vpd = kmalloc_obj(*vpd, GFP_KERNEL); + vpd = kmalloc_obj(*vpd); if (!vpd) goto no_buffer; @@ -2447,7 +2447,7 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) * pqi_get_physical_disk_info() because it's a fairly large * buffer. */ - id_phys = kmalloc_obj(*id_phys, GFP_KERNEL); + id_phys = kmalloc_obj(*id_phys); if (!id_phys) { dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg); @@ -2481,7 +2481,7 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) } for (i = 0; i < num_new_devices; i++) { - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (!device) { dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg); @@ -4750,7 +4750,7 @@ static int pqi_report_device_capability(struct pqi_ctrl_info *ctrl_info) struct pqi_device_capability *capability; struct pqi_iu_layer_descriptor *sop_iu_layer_descriptor; - capability = kmalloc_obj(*capability, GFP_KERNEL); + capability = kmalloc_obj(*capability); if (!capability) return -ENOMEM; @@ -7746,7 +7746,7 @@ static int pqi_get_ctrl_serial_number(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_sense_subsystem_info *sense_info; - sense_info = kzalloc_obj(*sense_info, GFP_KERNEL); + sense_info = kzalloc_obj(*sense_info); if (!sense_info) return -ENOMEM; @@ -7769,7 +7769,7 @@ static int pqi_get_ctrl_product_details(struct pqi_ctrl_info *ctrl_info) int rc; struct bmic_identify_controller *identify; - identify = kmalloc_obj(*identify, GFP_KERNEL); + identify = kmalloc_obj(*identify); if (!identify) return -ENOMEM; diff --git a/drivers/scsi/smartpqi/smartpqi_sas_transport.c b/drivers/scsi/smartpqi/smartpqi_sas_transport.c index 093b2ee39e90..b9c56a3816e0 100644 --- a/drivers/scsi/smartpqi/smartpqi_sas_transport.c +++ b/drivers/scsi/smartpqi/smartpqi_sas_transport.c @@ -22,7 +22,7 @@ static struct pqi_sas_phy *pqi_alloc_sas_phy(struct pqi_sas_port *pqi_sas_port) struct pqi_sas_phy *pqi_sas_phy; struct sas_phy *phy; - pqi_sas_phy = kzalloc_obj(*pqi_sas_phy, GFP_KERNEL); + pqi_sas_phy = kzalloc_obj(*pqi_sas_phy); if (!pqi_sas_phy) return NULL; @@ -131,7 +131,7 @@ static struct pqi_sas_port *pqi_alloc_sas_port( struct pqi_sas_port *pqi_sas_port; struct sas_port *port; - pqi_sas_port = kzalloc_obj(*pqi_sas_port, GFP_KERNEL); + pqi_sas_port = kzalloc_obj(*pqi_sas_port); if (!pqi_sas_port) return NULL; @@ -180,7 +180,7 @@ static struct pqi_sas_node *pqi_alloc_sas_node(struct device *parent_dev) { struct pqi_sas_node *pqi_sas_node; - pqi_sas_node = kzalloc_obj(*pqi_sas_node, GFP_KERNEL); + pqi_sas_node = kzalloc_obj(*pqi_sas_node); if (pqi_sas_node) { pqi_sas_node->parent_dev = parent_dev; INIT_LIST_HEAD(&pqi_sas_node->port_list_head); @@ -463,7 +463,7 @@ pqi_build_csmi_smp_passthru_buffer(struct sas_rphy *rphy, u32 req_size; u32 resp_size; - smp_buf = kzalloc_obj(*smp_buf, GFP_KERNEL); + smp_buf = kzalloc_obj(*smp_buf); if (!smp_buf) return NULL; diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c index 0e57e873dc42..b504a2cc5041 100644 --- a/drivers/scsi/sni_53c710.c +++ b/drivers/scsi/sni_53c710.c @@ -64,7 +64,7 @@ static int snirm710_probe(struct platform_device *dev) return -ENODEV; base = res->start; - hostdata = kzalloc_obj(*hostdata, GFP_KERNEL); + hostdata = kzalloc_obj(*hostdata); if (!hostdata) return -ENOMEM; diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c index 064f2d4d0ffc..71d34a702f2a 100644 --- a/drivers/scsi/snic/snic_disc.c +++ b/drivers/scsi/snic/snic_disc.c @@ -244,7 +244,7 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid) return tgt; } - tgt = kzalloc_obj(*tgt, GFP_KERNEL); + tgt = kzalloc_obj(*tgt); if (!tgt) { SNIC_HOST_ERR(snic->shost, "Failure to allocate snic_tgt.\n"); ret = -ENOMEM; diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index f9ee2205407e..82953e6a0915 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -818,7 +818,7 @@ snic_global_data_init(void) struct kmem_cache *cachep; ssize_t len = 0; - snic_glob = kzalloc_obj(*snic_glob, GFP_KERNEL); + snic_glob = kzalloc_obj(*snic_glob); if (!snic_glob) { SNIC_ERR("Failed to allocate Global Context.\n"); diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index f1871d78c30c..7adb2573f50d 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -629,7 +629,7 @@ static int sr_probe(struct scsi_device *sdev) goto fail; error = -ENOMEM; - cd = kzalloc_obj(*cd, GFP_KERNEL); + cd = kzalloc_obj(*cd); if (!cd) goto fail; diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 438c4e50d0fd..f1c3c4946637 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -462,7 +462,7 @@ static struct st_request *st_allocate_request(struct scsi_tape *stp) { struct st_request *streq; - streq = kzalloc_obj(*streq, GFP_KERNEL); + streq = kzalloc_obj(*streq); if (streq) streq->stp = stp; else { @@ -3973,7 +3973,7 @@ static struct st_buffer *new_tape_buffer(int max_sg) { struct st_buffer *tb; - tb = kzalloc_obj(struct st_buffer, GFP_KERNEL); + tb = kzalloc_obj(struct st_buffer); if (!tb) { printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n"); return NULL; @@ -3982,7 +3982,7 @@ static struct st_buffer *new_tape_buffer(int max_sg) tb->use_sg = max_sg; tb->buffer_size = 0; - tb->reserved_pages = kzalloc_objs(struct page *, max_sg, GFP_KERNEL); + tb->reserved_pages = kzalloc_objs(struct page *, max_sg); if (!tb->reserved_pages) { kfree(tb); return NULL; @@ -4373,7 +4373,7 @@ static int st_probe(struct scsi_device *SDp) goto out; } - tpnt = kzalloc_obj(struct scsi_tape, GFP_KERNEL); + tpnt = kzalloc_obj(struct scsi_tape); if (tpnt == NULL) { sdev_printk(KERN_ERR, SDp, "st: Can't allocate device descriptor.\n"); @@ -4456,7 +4456,7 @@ static int st_probe(struct scsi_device *SDp) } tpnt->index = error; sprintf(tpnt->name, "st%d", tpnt->index); - tpnt->stats = kzalloc_obj(struct scsi_tape_stats, GFP_KERNEL); + tpnt->stats = kzalloc_obj(struct scsi_tape_stats); if (tpnt->stats == NULL) { sdev_printk(KERN_ERR, SDp, "st: Can't allocate statistics.\n"); @@ -5006,7 +5006,7 @@ static int sgl_map_user_pages(struct st_buffer *STbp, if (count == 0) return 0; - pages = kmalloc_objs(*pages, max_pages, GFP_KERNEL); + pages = kmalloc_objs(*pages, max_pages); if (pages == NULL) return -ENOMEM; diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 1ff8be01b1b1..6aeeb338633d 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -1757,7 +1757,7 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) } } - hba->ccb = kzalloc_objs(struct st_ccb, ci->rq_count, GFP_KERNEL); + hba->ccb = kzalloc_objs(struct st_ccb, ci->rq_count); if (!hba->ccb) { err = -ENOMEM; printk(KERN_ERR DRV_NAME "(%s): ccb alloc failed\n", diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 4e3ff9e0a794..664ad55728b5 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1970,7 +1970,7 @@ static int storvsc_probe(struct hv_device *device, host_dev->host = host; - stor_device = kzalloc_obj(struct storvsc_device, GFP_KERNEL); + stor_device = kzalloc_obj(struct storvsc_device); if (!stor_device) { ret = -ENOMEM; goto err_out0; diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index b9117acd324d..c554e4158094 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -5655,7 +5655,7 @@ int sym_hcb_attach(struct Scsi_Host *shost, struct sym_fw *fw, struct sym_nvram /* * Allocate the array of lists of CCBs hashed by DSA. */ - np->ccbh = kzalloc_objs(*np->ccbh, CCB_HASH_SIZE, GFP_KERNEL); + np->ccbh = kzalloc_objs(*np->ccbh, CCB_HASH_SIZE); if (!np->ccbh) goto attach_failed; diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 7cccb4e06297..0ed8558dad72 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -853,8 +853,8 @@ static int virtscsi_init(struct virtio_device *vdev, num_req_vqs = vscsi->num_queues; num_vqs = num_req_vqs + VIRTIO_SCSI_VQ_BASE; - vqs = kmalloc_objs(struct virtqueue *, num_vqs, GFP_KERNEL); - vqs_info = kzalloc_objs(*vqs_info, num_vqs, GFP_KERNEL); + vqs = kmalloc_objs(struct virtqueue *, num_vqs); + vqs_info = kzalloc_objs(*vqs_info, num_vqs); if (!vqs || !vqs_info) { err = -ENOMEM; diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c index 392c905726ef..6aca9897b231 100644 --- a/drivers/scsi/zorro7xx.c +++ b/drivers/scsi/zorro7xx.c @@ -95,7 +95,7 @@ static int zorro7xx_init_one(struct zorro_dev *z, return -EBUSY; } - hostdata = kzalloc_obj(struct NCR_700_Host_Parameters, GFP_KERNEL); + hostdata = kzalloc_obj(struct NCR_700_Host_Parameters); if (!hostdata) { printk(KERN_ERR "zorro7xx: Failed to allocate host data\n"); goto out_release; diff --git a/drivers/scsi/zorro_esp.c b/drivers/scsi/zorro_esp.c index 39c0357eb8bd..1622285c9aec 100644 --- a/drivers/scsi/zorro_esp.c +++ b/drivers/scsi/zorro_esp.c @@ -726,7 +726,7 @@ static int zorro_esp_probe(struct zorro_dev *z, pr_info("%s found at address 0x%lx.\n", zdd->name, board); - zep = kzalloc_obj(*zep, GFP_KERNEL); + zep = kzalloc_obj(*zep); if (!zep) { pr_err("Can't allocate device private data!\n"); return -ENOMEM; diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c index 58e64a666b2f..f93b8d9d9ca8 100644 --- a/drivers/sh/clk/cpg.c +++ b/drivers/sh/clk/cpg.c @@ -459,7 +459,7 @@ int __init sh_clk_fsidiv_register(struct clk *clks, int nr) for (i = 0; i < nr; i++) { - map = kzalloc_obj(struct clk_mapping, GFP_KERNEL); + map = kzalloc_obj(struct clk_mapping); if (!map) { pr_err("%s: unable to alloc memory\n", __func__); return -ENOMEM; diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c index c9c3ba77653a..5585f220e495 100644 --- a/drivers/sh/maple/maple.c +++ b/drivers/sh/maple/maple.c @@ -187,7 +187,7 @@ static struct mapleq *maple_allocq(struct maple_device *mdev) { struct mapleq *mq; - mq = kzalloc_obj(*mq, GFP_KERNEL); + mq = kzalloc_obj(*mq); if (!mq) goto failed_nomem; @@ -215,7 +215,7 @@ static struct maple_device *maple_alloc_dev(int port, int unit) /* zero this out to avoid kobj subsystem * thinking it has already been registered */ - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return NULL; diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c index d058f481a39a..3e8f3b6a4555 100644 --- a/drivers/siox/siox-core.c +++ b/drivers/siox/siox-core.c @@ -822,7 +822,7 @@ static struct siox_device *siox_device_add(struct siox_master *smaster, int ret; size_t buf_len; - sdevice = kzalloc_obj(*sdevice, GFP_KERNEL); + sdevice = kzalloc_obj(*sdevice); if (!sdevice) return ERR_PTR(-ENOMEM); diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 4f796e24a6ed..ee6318e247d3 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -180,7 +180,7 @@ static struct slim_device *slim_alloc_device(struct slim_controller *ctrl, struct slim_device *sbdev; int ret; - sbdev = kzalloc_obj(*sbdev, GFP_KERNEL); + sbdev = kzalloc_obj(*sbdev); if (!sbdev) return NULL; diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 0bead6949410..9aa7218b4e8d 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1523,7 +1523,7 @@ static int of_qcom_slim_ngd_register(struct device *parent, if (of_property_read_u32(node, "reg", &id)) continue; - ngd = kzalloc_obj(*ngd, GFP_KERNEL); + ngd = kzalloc_obj(*ngd); if (!ngd) return -ENOMEM; diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c index 48711d4cf110..b4e70a7edd1c 100644 --- a/drivers/slimbus/stream.c +++ b/drivers/slimbus/stream.c @@ -103,7 +103,7 @@ struct slim_stream_runtime *slim_stream_allocate(struct slim_device *dev, { struct slim_stream_runtime *rt; - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return ERR_PTR(-ENOMEM); @@ -214,7 +214,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, } num_ports = hweight32(cfg->port_mask); - rt->ports = kzalloc_objs(*port, num_ports, GFP_KERNEL); + rt->ports = kzalloc_objs(*port, num_ports); if (!rt->ports) return -ENOMEM; diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c index f10aa0aab8d3..c20f685e56f9 100644 --- a/drivers/soc/amlogic/meson-gx-socinfo.c +++ b/drivers/soc/amlogic/meson-gx-socinfo.c @@ -188,7 +188,7 @@ static int __init meson_gx_socinfo_init(void) return -EINVAL; } - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENODEV; diff --git a/drivers/soc/amlogic/meson-mx-socinfo.c b/drivers/soc/amlogic/meson-mx-socinfo.c index e9003fd55294..e1a7795a2733 100644 --- a/drivers/soc/amlogic/meson-mx-socinfo.c +++ b/drivers/soc/amlogic/meson-mx-socinfo.c @@ -146,7 +146,7 @@ static int __init meson_mx_socinfo_init(void) if (ret < 0) return ret; - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENODEV; diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c index 0cde365c75bb..a3fdac8f6f06 100644 --- a/drivers/soc/apple/rtkit.c +++ b/drivers/soc/apple/rtkit.c @@ -667,7 +667,7 @@ struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie, if (!ops) return ERR_PTR(-EINVAL); - rtk = kzalloc_obj(*rtk, GFP_KERNEL); + rtk = kzalloc_obj(*rtk); if (!rtk) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/aspeed/aspeed-p2a-ctrl.c b/drivers/soc/aspeed/aspeed-p2a-ctrl.c index bbab8dabd940..d88abc5f195b 100644 --- a/drivers/soc/aspeed/aspeed-p2a-ctrl.c +++ b/drivers/soc/aspeed/aspeed-p2a-ctrl.c @@ -238,7 +238,7 @@ static int aspeed_p2a_open(struct inode *inode, struct file *file) { struct aspeed_p2a_user *priv; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/soc/aspeed/aspeed-socinfo.c b/drivers/soc/aspeed/aspeed-socinfo.c index b4009164c84c..5e34e01ad26d 100644 --- a/drivers/soc/aspeed/aspeed-socinfo.c +++ b/drivers/soc/aspeed/aspeed-socinfo.c @@ -113,7 +113,7 @@ static int __init aspeed_socinfo_init(void) } of_node_put(np); - attrs = kzalloc_obj(*attrs, GFP_KERNEL); + attrs = kzalloc_obj(*attrs); if (!attrs) return -ENODEV; diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c index 88de5aa41191..d89f9dcade7d 100644 --- a/drivers/soc/atmel/soc.c +++ b/drivers/soc/atmel/soc.c @@ -368,7 +368,7 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs) return NULL; } - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return NULL; diff --git a/drivers/soc/bcm/brcmstb/common.c b/drivers/soc/bcm/brcmstb/common.c index e9cf6897d8bf..2da79bd42930 100644 --- a/drivers/soc/bcm/brcmstb/common.c +++ b/drivers/soc/bcm/brcmstb/common.c @@ -82,7 +82,7 @@ static int __init brcmstb_soc_device_init(void) if (!sun_top_ctrl) return ret; - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) { ret = -ENOMEM; goto out; diff --git a/drivers/soc/cirrus/soc-ep93xx.c b/drivers/soc/cirrus/soc-ep93xx.c index d42813382977..d55cf28ed726 100644 --- a/drivers/soc/cirrus/soc-ep93xx.c +++ b/drivers/soc/cirrus/soc-ep93xx.c @@ -92,7 +92,7 @@ static struct auxiliary_device __init *ep93xx_adev_alloc(struct device *parent, struct auxiliary_device *adev; int ret; - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (!rdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c index 64b05aa80d2c..611caaeed8fc 100644 --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c @@ -311,7 +311,7 @@ int __init dove_init_pmu_legacy(const struct dove_pmu_initdata *initdata) struct pmu_data *pmu; int ret; - pmu = kzalloc_obj(*pmu, GFP_KERNEL); + pmu = kzalloc_obj(*pmu); if (!pmu) return -ENOMEM; @@ -324,7 +324,7 @@ int __init dove_init_pmu_legacy(const struct dove_pmu_initdata *initdata) domain_initdata++) { struct pmu_domain *domain; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (domain) { domain->pmu = pmu; domain->pwr_mask = domain_initdata->pwr_mask; @@ -386,7 +386,7 @@ int __init dove_init_pmu(void) return 0; } - pmu = kzalloc_obj(*pmu, GFP_KERNEL); + pmu = kzalloc_obj(*pmu); if (!pmu) return -ENOMEM; @@ -408,7 +408,7 @@ int __init dove_init_pmu(void) struct of_phandle_args args; struct pmu_domain *domain; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) break; diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c index 841e0510151c..7f2ffe38dc07 100644 --- a/drivers/soc/fsl/dpaa2-console.c +++ b/drivers/soc/fsl/dpaa2-console.c @@ -111,7 +111,7 @@ static int dpaa2_generic_console_open(struct inode *node, struct file *fp, u64 base_addr; int err; - cd = kmalloc_obj(*cd, GFP_KERNEL); + cd = kmalloc_obj(*cd); if (!cd) return -ENOMEM; diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c index 2a73d4e846ff..317ca50b0c2b 100644 --- a/drivers/soc/fsl/dpio/dpio-service.c +++ b/drivers/soc/fsl/dpio/dpio-service.c @@ -133,7 +133,7 @@ static void dpaa2_io_dim_work(struct work_struct *w) struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc, struct device *dev) { - struct dpaa2_io *obj = kmalloc_obj(*obj, GFP_KERNEL); + struct dpaa2_io *obj = kmalloc_obj(*obj); u32 qman_256_cycles_per_ns; if (!obj) @@ -523,7 +523,7 @@ int dpaa2_io_service_enqueue_multiple_desc_fq(struct dpaa2_io *d, struct qbman_eq_desc *ed; int i, ret; - ed = kzalloc_objs(struct qbman_eq_desc, 32, GFP_KERNEL); + ed = kzalloc_objs(struct qbman_eq_desc, 32); if (!ed) return -ENOMEM; @@ -658,7 +658,7 @@ struct dpaa2_io_store *dpaa2_io_store_create(unsigned int max_frames, if (!max_frames || (max_frames > 32)) return NULL; - ret = kmalloc_obj(*ret, GFP_KERNEL); + ret = kmalloc_obj(*ret); if (!ret) return NULL; diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c index b6adc87f473a..278e25d09be2 100644 --- a/drivers/soc/fsl/dpio/qbman-portal.c +++ b/drivers/soc/fsl/dpio/qbman-portal.c @@ -246,7 +246,7 @@ static inline u8 qm_cyc_diff(u8 ringsize, u8 first, u8 last) */ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) { - struct qbman_swp *p = kzalloc_obj(*p, GFP_KERNEL); + struct qbman_swp *p = kzalloc_obj(*p); u32 reg; u32 mask_size; u32 eqcr_pi; diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 055d0b61ea1d..40afb27b582b 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -213,7 +213,7 @@ static int __init fsl_guts_init(void) of_node_put(np); /* Register soc device */ - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index 8993cf2d47b5..f22eff294122 100644 --- a/drivers/soc/fsl/qbman/bman.c +++ b/drivers/soc/fsl/qbman/bman.c @@ -700,7 +700,7 @@ struct bman_pool *bman_new_pool(void) if (bm_alloc_bpid_range(&bpid, 1)) return NULL; - pool = kmalloc_obj(*pool, GFP_KERNEL); + pool = kmalloc_obj(*pool); if (!pool) goto err; diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 210438ea923e..411381f1a1c4 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1270,7 +1270,7 @@ static int qman_create_portal(struct qman_portal *portal, qm_dqrr_set_ithresh(p, QMAN_PIRQ_DQRR_ITHRESH); qm_mr_set_ithresh(p, QMAN_PIRQ_MR_ITHRESH); qm_out(p, QM_REG_ITPR, QMAN_PIRQ_IPERIOD); - portal->cgrs = kmalloc_objs(*portal->cgrs, 2, GFP_KERNEL); + portal->cgrs = kmalloc_objs(*portal->cgrs, 2); if (!portal->cgrs) goto fail_cgrs; /* initial snapshot is no-depletion */ diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 488770405e99..66828f2a3577 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -161,7 +161,7 @@ struct qe_pin *qe_pin_request(struct device *dev, int index) int gpio_num; int err; - qe_pin = kzalloc_obj(*qe_pin, GFP_KERNEL); + qe_pin = kzalloc_obj(*qe_pin); if (!qe_pin) { dev_dbg(dev, "%s: can't allocate memory\n", __func__); return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/fsl/qe/ucc_fast.c b/drivers/soc/fsl/qe/ucc_fast.c index 3cb45090fe74..fa474dfcca13 100644 --- a/drivers/soc/fsl/qe/ucc_fast.c +++ b/drivers/soc/fsl/qe/ucc_fast.c @@ -191,7 +191,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc return -EINVAL; } - uccf = kzalloc_obj(struct ucc_fast_private, GFP_KERNEL); + uccf = kzalloc_obj(struct ucc_fast_private); if (!uccf) { printk(KERN_ERR "%s: Cannot allocate private data\n", __func__); diff --git a/drivers/soc/fsl/qe/ucc_slow.c b/drivers/soc/fsl/qe/ucc_slow.c index 335c8629a316..7c5dc7de54d5 100644 --- a/drivers/soc/fsl/qe/ucc_slow.c +++ b/drivers/soc/fsl/qe/ucc_slow.c @@ -148,7 +148,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc return -EINVAL; } - uccs = kzalloc_obj(struct ucc_slow_private, GFP_KERNEL); + uccs = kzalloc_obj(struct ucc_slow_private); if (!uccs) { printk(KERN_ERR "%s: Cannot allocate private data\n", __func__); diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c index 62e3b86fa42d..2af3bfda313e 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -616,7 +616,7 @@ static int hccs_get_all_port_info_on_die(struct hccs_dev *hdev, int ret; u8 i; - attrs = kzalloc_objs(struct hccs_port_attr, die->port_num, GFP_KERNEL); + attrs = kzalloc_objs(struct hccs_port_attr, die->port_num); if (!attrs) return -ENOMEM; diff --git a/drivers/soc/imx/soc-imx.c b/drivers/soc/imx/soc-imx.c index 5d39cc3f5e7d..504ebce18793 100644 --- a/drivers/soc/imx/soc-imx.c +++ b/drivers/soc/imx/soc-imx.c @@ -40,7 +40,7 @@ static int __init imx_soc_device_init(void) if (!__mxc_cpu_type) 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; diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index a0f14aa28106..f8ee6c9ade89 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -114,7 +114,7 @@ struct cmdq_client *cmdq_mbox_create(struct device *dev, int index) { struct cmdq_client *client; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return (struct cmdq_client *)-ENOMEM; diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c index 4ce94066a5a8..8e7ae3cb92ff 100644 --- a/drivers/soc/microchip/mpfs-sys-controller.c +++ b/drivers/soc/microchip/mpfs-sys-controller.c @@ -132,7 +132,7 @@ static int mpfs_sys_controller_probe(struct platform_device *pdev) struct device_node *np; int i, ret; - sys_controller = kzalloc_obj(*sys_controller, GFP_KERNEL); + sys_controller = kzalloc_obj(*sys_controller); if (!sys_controller) return -ENOMEM; diff --git a/drivers/soc/nuvoton/wpcm450-soc.c b/drivers/soc/nuvoton/wpcm450-soc.c index dc1242bda713..5511bd284773 100644 --- a/drivers/soc/nuvoton/wpcm450-soc.c +++ b/drivers/soc/nuvoton/wpcm450-soc.c @@ -74,7 +74,7 @@ static int __init wpcm450_soc_init(void) return -ENODEV; } - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return -ENOMEM; diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c index 2c46a25abb24..78e72379a6e0 100644 --- a/drivers/soc/qcom/apr.c +++ b/drivers/soc/qcom/apr.c @@ -95,7 +95,7 @@ gpr_port_t *gpr_alloc_port(struct apr_device *gdev, struct device *dev, struct pkt_router_svc *svc; int id; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); @@ -416,7 +416,7 @@ static int apr_add_device(struct device *dev, struct device_node *np, struct pkt_router_svc *svc; int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return -ENOMEM; diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index 84ceba84d51a..ad5899d083f3 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -4447,7 +4447,7 @@ struct llcc_slice_desc *llcc_slice_getd(u32 uid) if (count == sz || !cfg) return ERR_PTR(-ENODEV); - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 0a6094e17e66..6a23f18b0281 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -226,7 +226,7 @@ struct ocmem_buf *ocmem_allocate(struct ocmem *ocmem, enum ocmem_client client, if (test_and_set_bit_lock(BIT(client), &ocmem->active_allocations)) return ERR_PTR(-EBUSY); - struct ocmem_buf *buf __free(kfree) = kzalloc_obj(*buf, GFP_KERNEL); + struct ocmem_buf *buf __free(kfree) = kzalloc_obj(*buf); if (!buf) { ret = -ENOMEM; goto err_unlock; diff --git a/drivers/soc/qcom/pdr_interface.c b/drivers/soc/qcom/pdr_interface.c index cd36f3f0b80f..ba903569f885 100644 --- a/drivers/soc/qcom/pdr_interface.c +++ b/drivers/soc/qcom/pdr_interface.c @@ -322,7 +322,7 @@ static void pdr_indication_cb(struct qmi_handle *qmi, ind_msg->service_path, ind_msg->curr_state, ind_msg->transaction_id); - ind = kzalloc_obj(*ind, GFP_KERNEL); + ind = kzalloc_obj(*ind); if (!ind) return; @@ -520,7 +520,7 @@ struct pdr_service *pdr_add_lookup(struct pdr_handle *pdr, !service_path || strlen(service_path) > SERVREG_NAME_LENGTH) return ERR_PTR(-EINVAL); - struct pdr_service *pds __free(kfree) = kzalloc_obj(*pds, GFP_KERNEL); + struct pdr_service *pds __free(kfree) = kzalloc_obj(*pds); if (!pds) return ERR_PTR(-ENOMEM); @@ -645,7 +645,7 @@ struct pdr_handle *pdr_handle_alloc(void (*status)(int state, if (!status) return ERR_PTR(-EINVAL); - struct pdr_handle *pdr __free(kfree) = kzalloc_obj(*pdr, GFP_KERNEL); + struct pdr_handle *pdr __free(kfree) = kzalloc_obj(*pdr); if (!pdr) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c index cb92c214311b..dc10bc859ff4 100644 --- a/drivers/soc/qcom/qcom_pd_mapper.c +++ b/drivers/soc/qcom/qcom_pd_mapper.c @@ -77,7 +77,7 @@ static int qcom_pdm_add_service_domain(struct qcom_pdm_data *data, return -EBUSY; } } else { - service = kzalloc_obj(*service, GFP_KERNEL); + service = kzalloc_obj(*service); if (!service) return -ENOMEM; @@ -87,7 +87,7 @@ static int qcom_pdm_add_service_domain(struct qcom_pdm_data *data, list_add_tail(&service->list, &data->services); } - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) { if (list_empty(&service->domains)) { list_del(&service->list); @@ -158,7 +158,7 @@ static void qcom_pdm_get_domain_list(struct qmi_handle *qmi, u32 offset; int ret; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) return; @@ -635,7 +635,7 @@ static struct qcom_pdm_data *qcom_pdm_start(void) return ERR_PTR(-ENODEV); } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c index 59a11fa572a7..16e2e24b6096 100644 --- a/drivers/soc/qcom/qmi_interface.c +++ b/drivers/soc/qcom/qmi_interface.c @@ -44,7 +44,7 @@ static void qmi_recv_new_server(struct qmi_handle *qmi, if (!node && !port) return; - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) return; @@ -209,7 +209,7 @@ int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, { struct qmi_service *svc; - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) return -ENOMEM; @@ -273,7 +273,7 @@ int qmi_add_server(struct qmi_handle *qmi, unsigned int service, { struct qmi_service *svc; - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) return -ENOMEM; diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c index cec7912f74dd..342c0845134e 100644 --- a/drivers/soc/qcom/rmtfs_mem.c +++ b/drivers/soc/qcom/rmtfs_mem.c @@ -192,7 +192,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev) } - rmtfs_mem = kzalloc_obj(*rmtfs_mem, GFP_KERNEL); + rmtfs_mem = kzalloc_obj(*rmtfs_mem); if (!rmtfs_mem) return -ENOMEM; diff --git a/drivers/soc/qcom/smem_state.c b/drivers/soc/qcom/smem_state.c index 3d9bc96dfd2d..be52ec4396d1 100644 --- a/drivers/soc/qcom/smem_state.c +++ b/drivers/soc/qcom/smem_state.c @@ -197,7 +197,7 @@ struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, { struct qcom_smem_state *state; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c index d170743d576a..38ff0b823bda 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -487,7 +487,7 @@ static int __init renesas_soc_init(void) chipid = ioremap(family->reg, 4); } - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) { if (chipid) iounmap(chipid); diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index 165fad4f548e..291484595dcf 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -441,7 +441,7 @@ struct device *tegra_soc_device_register(void) struct soc_device_attribute *attr; struct soc_device *dev; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return NULL; diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 8f2f83c4ad90..a1a2966512d1 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -1131,11 +1131,11 @@ int tegra_pmc_powergate_sequence_power_up(struct tegra_pmc *pmc, if (!tegra_powergate_is_available(pmc, id)) return -EINVAL; - pg = kzalloc_obj(*pg, GFP_KERNEL); + pg = kzalloc_obj(*pg); if (!pg) return -ENOMEM; - pg->clk_rates = kzalloc_obj(*pg->clk_rates, GFP_KERNEL); + pg->clk_rates = kzalloc_obj(*pg->clk_rates); if (!pg->clk_rates) { kfree(pg->clks); return -ENOMEM; @@ -1341,7 +1341,7 @@ static int tegra_powergate_of_get_clks(struct tegra_powergate *pg, if (count == 0) return -ENODEV; - pg->clks = kzalloc_objs(clk, count, GFP_KERNEL); + pg->clks = kzalloc_objs(clk, count); if (!pg->clks) return -ENOMEM; @@ -1402,7 +1402,7 @@ static int tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) int id, err = 0; bool off; - pg = kzalloc_obj(*pg, GFP_KERNEL); + pg = kzalloc_obj(*pg); if (!pg) return -ENOMEM; diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 8655f829dc7b..676041879eca 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -163,7 +163,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev) partno_id = (jtag_id & CTRLMMR_WKUP_JTAGID_PARTNO_MASK) >> CTRLMMR_WKUP_JTAGID_PARTNO_SHIFT; - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c index eb26a601643a..f49539d79824 100644 --- a/drivers/soc/ux500/ux500-soc-id.c +++ b/drivers/soc/ux500/ux500-soc-id.c @@ -205,7 +205,7 @@ static int __init ux500_soc_device_init(void) ux500_setup_id(); - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) { of_node_put(backupram); return -ENOMEM; diff --git a/drivers/soc/versatile/soc-integrator.c b/drivers/soc/versatile/soc-integrator.c index 45110efcd4a1..b67a7fd4af25 100644 --- a/drivers/soc/versatile/soc-integrator.c +++ b/drivers/soc/versatile/soc-integrator.c @@ -123,7 +123,7 @@ static int __init integrator_soc_init(void) return -ENODEV; integrator_coreid = val; - soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); + soc_dev_attr = kzalloc_obj(*soc_dev_attr); if (!soc_dev_attr) return -ENOMEM; diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index 6a45b1b53caf..f733dc42b3b1 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -122,7 +122,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons if (!present_in_hash) { /* Add new entry if not present in HASH table */ - eve_data = kmalloc_obj(*eve_data, GFP_KERNEL); + eve_data = kmalloc_obj(*eve_data); if (!eve_data) return -ENOMEM; eve_data->key = key; @@ -130,7 +130,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons eve_data->wake = wake; INIT_LIST_HEAD(&eve_data->cb_list_head); - cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data); if (!cb_data) { kfree(eve_data); return -ENOMEM; @@ -153,7 +153,7 @@ static int xlnx_add_cb_for_notify_event(const u32 node_id, const u32 event, cons } /* Add multiple handler and private data in list */ - cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data); if (!cb_data) return -ENOMEM; cb_data->eve_cb = cb_fun; @@ -179,7 +179,7 @@ static int xlnx_add_cb_for_suspend(event_cb_func_t cb_fun, void *data) } /* Add new entry if not present */ - eve_data = kmalloc_obj(*eve_data, GFP_KERNEL); + eve_data = kmalloc_obj(*eve_data); if (!eve_data) return -ENOMEM; @@ -187,7 +187,7 @@ static int xlnx_add_cb_for_suspend(event_cb_func_t cb_fun, void *data) eve_data->cb_type = PM_INIT_SUSPEND_CB; INIT_LIST_HEAD(&eve_data->cb_list_head); - cb_data = kmalloc_obj(*cb_data, GFP_KERNEL); + cb_data = kmalloc_obj(*cb_data); if (!cb_data) { kfree(eve_data); return -ENOMEM; diff --git a/drivers/soundwire/amd_init.c b/drivers/soundwire/amd_init.c index e71cc23523e1..7db37f044850 100644 --- a/drivers/soundwire/amd_init.c +++ b/drivers/soundwire/amd_init.c @@ -98,7 +98,7 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res) * the parent .probe. * If devm_ was used, the memory might never be freed on errors. */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 91dee9499df2..c2f405785c5f 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -764,7 +764,7 @@ static int amd_set_sdw_stream(struct snd_soc_dai *dai, void *stream, int directi } /* allocate and set dai_runtime info */ - dai_runtime = kzalloc_obj(*dai_runtime, GFP_KERNEL); + dai_runtime = kzalloc_obj(*dai_runtime); if (!dai_runtime) return -ENOMEM; diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index dfdb591c6f6e..f245c3ffb9e9 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -1846,7 +1846,7 @@ int cdns_set_sdw_stream(struct snd_soc_dai *dai, } /* allocate and set dai_runtime info */ - dai_runtime = kzalloc_obj(*dai_runtime, GFP_KERNEL); + dai_runtime = kzalloc_obj(*dai_runtime); if (!dai_runtime) return -ENOMEM; diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c index 0e9c48ca76e9..ccc9670ef77c 100644 --- a/drivers/soundwire/debugfs.c +++ b/drivers/soundwire/debugfs.c @@ -224,7 +224,7 @@ static int do_bpt_sequence(struct sdw_slave *slave, bool write, u8 *buffer) struct sdw_bpt_msg msg = {0}; struct sdw_bpt_section *sec; - sec = kzalloc_objs(*sec, 1, GFP_KERNEL); + sec = kzalloc_objs(*sec, 1); if (!sec) return -ENOMEM; msg.sections = 1; diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c index f5a7f404aacb..fb3970e12dac 100644 --- a/drivers/soundwire/generic_bandwidth_allocation.c +++ b/drivers/soundwire/generic_bandwidth_allocation.c @@ -402,7 +402,7 @@ static int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtim if (group.count == 0) goto out; - params = kzalloc_objs(*params, group.count, GFP_KERNEL); + params = kzalloc_objs(*params, group.count); if (!params) { ret = -ENOMEM; goto out; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 8a37d185cbca..87bde136d234 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -127,7 +127,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave * sconfig.bps = 32; /* this is required for BPT/BRA */ /* Port configuration */ - pconfig = kzalloc_objs(*pconfig, 2, GFP_KERNEL); + pconfig = kzalloc_objs(*pconfig, 2); if (!pconfig) { ret = -ENOMEM; goto remove_slave; diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c index 982d25f92c7c..e180657ae231 100644 --- a/drivers/soundwire/intel_init.c +++ b/drivers/soundwire/intel_init.c @@ -40,7 +40,7 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res * struct auxiliary_device *auxdev; int ret; - ldev = kzalloc_obj(*ldev, GFP_KERNEL); + ldev = kzalloc_obj(*ldev); if (!ldev) return ERR_PTR(-ENOMEM); @@ -186,7 +186,7 @@ static struct sdw_intel_ctx * the parent .probe. * If devm_ was used, the memory might never be freed on errors. */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -198,7 +198,7 @@ static struct sdw_intel_ctx * If some links are disabled, the link pointer will remain NULL. Given that the * number of links is small, this is simpler than using a list to keep track of links. */ - ctx->ldev = kzalloc_objs(*ctx->ldev, ctx->count, GFP_KERNEL); + ctx->ldev = kzalloc_objs(*ctx->ldev, ctx->count); if (!ctx->ldev) { kfree(ctx); return NULL; diff --git a/drivers/soundwire/master.c b/drivers/soundwire/master.c index a0f94877bc91..440bfc52ccba 100644 --- a/drivers/soundwire/master.c +++ b/drivers/soundwire/master.c @@ -133,7 +133,7 @@ int sdw_master_device_add(struct sdw_bus *bus, struct device *parent, if (!parent) return -EINVAL; - md = kzalloc_obj(*md, GFP_KERNEL); + md = kzalloc_obj(*md); if (!md) return -ENOMEM; diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index 45e80b9496f4..f5a3ca3b9dda 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -32,7 +32,7 @@ int sdw_slave_add(struct sdw_bus *bus, int ret; int i; - slave = kzalloc_obj(*slave, GFP_KERNEL); + slave = kzalloc_obj(*slave); if (!slave) return -ENOMEM; diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index c6e3f911371b..b6982f8dcf17 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -748,11 +748,11 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) int ret; u16 addr; - wr_msg = kzalloc_obj(*wr_msg, GFP_KERNEL); + wr_msg = kzalloc_obj(*wr_msg); if (!wr_msg) return -ENOMEM; - wbuf = kzalloc_obj(*wbuf, GFP_KERNEL); + wbuf = kzalloc_obj(*wbuf); if (!wbuf) { ret = -ENOMEM; goto error_1; @@ -956,7 +956,7 @@ static struct sdw_port_runtime *sdw_port_alloc(struct list_head *port_list) { struct sdw_port_runtime *p_rt; - p_rt = kzalloc_obj(*p_rt, GFP_KERNEL); + p_rt = kzalloc_obj(*p_rt); if (!p_rt) return NULL; @@ -1131,7 +1131,7 @@ static struct sdw_slave_runtime { struct sdw_slave_runtime *s_rt; - s_rt = kzalloc_obj(*s_rt, GFP_KERNEL); + s_rt = kzalloc_obj(*s_rt); if (!s_rt) return NULL; @@ -1241,7 +1241,7 @@ static struct sdw_master_runtime } } - m_rt = kzalloc_obj(*m_rt, GFP_KERNEL); + m_rt = kzalloc_obj(*m_rt); if (!m_rt) return NULL; @@ -1875,7 +1875,7 @@ struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name, enum sdw_st { struct sdw_stream_runtime *stream; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return NULL; diff --git a/drivers/spi/spi-amlogic-spifc-a4.c b/drivers/spi/spi-amlogic-spifc-a4.c index 786d66304c3d..2aef528cfc1b 100644 --- a/drivers/spi/spi-amlogic-spifc-a4.c +++ b/drivers/spi/spi-amlogic-spifc-a4.c @@ -986,7 +986,7 @@ static int aml_sfc_ecc_init_ctx(struct nand_device *nand) nand->ecc.ctx.conf.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; - ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c index 40890068d840..76eb3ba75ab1 100644 --- a/drivers/spi/spi-at91-usart.c +++ b/drivers/spi/spi-at91-usart.c @@ -364,7 +364,7 @@ static int at91_usart_spi_setup(struct spi_device *spi) mr &= ~US_MR_LOOP; if (!ausd) { - ausd = kzalloc_obj(*ausd, GFP_KERNEL); + ausd = kzalloc_obj(*ausd); if (!ausd) return -ENOMEM; diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index ff4bf4e6bdb5..445d645585bf 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1300,7 +1300,7 @@ static int atmel_spi_setup(struct spi_device *spi) asd = spi->controller_state; if (!asd) { - asd = kzalloc_obj(struct atmel_spi_device, GFP_KERNEL); + asd = kzalloc_obj(struct atmel_spi_device); if (!asd) return -ENOMEM; diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 123d9d4fb08d..63aa37f19490 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -712,7 +712,7 @@ static int bcm_qspi_setup(struct spi_device *spi) xp = spi_get_ctldata(spi); if (!xp) { - xp = kzalloc_obj(*xp, GFP_KERNEL); + xp = kzalloc_obj(*xp); if (!xp) return -ENOMEM; spi_set_ctldata(spi, xp); diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index d9cfb6e18a4c..9f03ac217319 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -193,7 +193,7 @@ int spi_bitbang_setup(struct spi_device *spi) bitbang = spi_controller_get_devdata(spi->controller); if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 62171cc0d84d..da7f2ae3a570 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -443,7 +443,7 @@ static int davinci_spi_of_setup(struct spi_device *spi) u32 prop; if (spicfg == NULL && np) { - spicfg = kzalloc_obj(*spicfg, GFP_KERNEL); + spicfg = kzalloc_obj(*spicfg); if (!spicfg) return -ENOMEM; *spicfg = davinci_spi_default_cfg; diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index d2aa199bab9d..b47637888c5c 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -797,7 +797,7 @@ static int dw_spi_setup(struct spi_device *spi) struct dw_spi *dws = spi_controller_get_devdata(spi->controller); u32 rx_sample_dly_ns; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; spi_set_ctldata(spi, chip); diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 031d6785ecc4..9f2a7b8163b1 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1290,7 +1290,7 @@ static int dspi_setup(struct spi_device *spi) /* Only alloc on first setup */ chip = spi_get_ctldata(spi); if (chip == NULL) { - chip = kzalloc_obj(struct chip_data, GFP_KERNEL); + chip = kzalloc_obj(struct chip_data); if (!chip) return -ENOMEM; } diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index f46f5c3cc992..56270f8fdc17 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -482,7 +482,7 @@ static int fsl_espi_setup(struct spi_device *spi) struct fsl_espi_cs *cs = spi_get_ctldata(spi); if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; spi_set_ctldata(spi, cs); diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index e2f15998495f..bf3fc3ce0cc2 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -378,7 +378,7 @@ static int fsl_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; spi_set_ctldata(spi, cs); diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 798ba06b86bc..216a0a91fc47 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -426,7 +426,7 @@ static int hisi_spi_setup(struct spi_device *spi) /* Only alloc on first setup */ chip = spi_get_ctldata(spi); if (!chip) { - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; spi_set_ctldata(spi, chip); diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index abb380d2791b..a09371a075d2 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -713,7 +713,7 @@ spi_mem_dirmap_create(struct spi_mem *mem, if (info->op_tmpl.data.dir == SPI_MEM_NO_DATA) return ERR_PTR(-EINVAL); - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index e8383a79cb2e..75d560f6b5cc 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -362,7 +362,7 @@ static int mpc512x_psc_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 03ee5f370382..954f6caceb31 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -222,7 +222,7 @@ static int mpc52xx_psc_spi_setup(struct spi_device *spi) return -EINVAL; if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c index 833f8f8901bf..437edbd658aa 100644 --- a/drivers/spi/spi-mtk-snfi.c +++ b/drivers/spi/spi-mtk-snfi.c @@ -675,7 +675,7 @@ static int mtk_snand_ecc_init_ctx(struct nand_device *nand) if (ret) return ret; - ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 35e4300deff5..b3301c69e2de 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -182,7 +182,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, if (!len) return -EINVAL; - dma_xfer = kzalloc_objs(*dma_xfer, sgs, GFP_KERNEL); + dma_xfer = kzalloc_objs(*dma_xfer, sgs); if (!dma_xfer) return -ENOMEM; diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c index de6de1517554..a579ef33b2d2 100644 --- a/drivers/spi/spi-offload.c +++ b/drivers/spi/spi-offload.c @@ -117,7 +117,7 @@ struct spi_offload *devm_spi_offload_get(struct device *dev, if (!spi->controller->get_offload) return ERR_PTR(-ENODEV); - resource = kzalloc_obj(*resource, GFP_KERNEL); + resource = kzalloc_obj(*resource); if (!resource) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 367a36a1fdc5..83e263eb6069 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -425,7 +425,7 @@ static int uwire_setup(struct spi_device *spi) int status; if (ust == NULL) { - ust = kzalloc_obj(*ust, GFP_KERNEL); + ust = kzalloc_obj(*ust); if (ust == NULL) return -ENOMEM; spi->controller_state = ust; diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 11eca0572733..2207e05c9d06 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1076,7 +1076,7 @@ static int omap2_mcspi_setup(struct spi_device *spi) struct omap2_mcspi_cs *cs = spi->controller_state; if (!cs) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; cs->base = mcspi->base + spi_get_chipselect(spi, 0) * 0x14; diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index f663ea5983d0..051590038895 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -467,7 +467,7 @@ static int ring_desc_ring_alloc(struct pic32_sqi *sqi) } /* allocate software ring descriptors */ - sqi->ring = kzalloc_objs(*rdesc, PESQI_BD_COUNT, GFP_KERNEL); + sqi->ring = kzalloc_objs(*rdesc, PESQI_BD_COUNT); if (!sqi->ring) { dma_free_coherent(&sqi->host->dev, sizeof(*bd) * PESQI_BD_COUNT, diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 87f9d41f0236..c82cc522776d 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -1606,7 +1606,7 @@ static int pl022_setup(struct spi_device *spi) chip = spi_get_ctldata(spi); if (chip == NULL) { - chip = kzalloc_obj(struct chip_data, GFP_KERNEL); + chip = kzalloc_obj(struct chip_data); if (!chip) return -ENOMEM; dev_dbg(&spi->dev, diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c index c4ebef57c991..46ac58dfb3fc 100644 --- a/drivers/spi/spi-ppc4xx.c +++ b/drivers/spi/spi-ppc4xx.c @@ -218,7 +218,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi) } if (cs == NULL) { - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return -ENOMEM; spi->controller_state = cs; diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index b0424ee64b75..f7881a31e4cc 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1184,7 +1184,7 @@ static int setup(struct spi_device *spi) /* Only allocate on the first setup */ chip = spi_get_ctldata(spi); if (!chip) { - chip = kzalloc_obj(struct chip_data, GFP_KERNEL); + chip = kzalloc_obj(struct chip_data); if (!chip) return -ENOMEM; } diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c index eae0edb47652..66f2d1b78ade 100644 --- a/drivers/spi/spi-qpic-snand.c +++ b/drivers/spi/spi-qpic-snand.c @@ -258,7 +258,7 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand) cwperpage = mtd->writesize / NANDC_STEP_SIZE; snandc->qspi->num_cw = cwperpage; - ecc_cfg = kzalloc_obj(*ecc_cfg, GFP_KERNEL); + ecc_cfg = kzalloc_obj(*ecc_cfg); if (!ecc_cfg) return -ENOMEM; diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 2591f1d11a9d..ba85243d6d89 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -961,7 +961,7 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_target_ctrldata( return ERR_PTR(-EINVAL); } - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return ERR_PTR(-ENOMEM); diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index 6983a4567c45..848cb6836bd5 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -920,7 +920,7 @@ static struct tegra_spi_client_data return NULL; } - cdata = kzalloc_obj(*cdata, GFP_KERNEL); + cdata = kzalloc_obj(*cdata); if (!cdata) return NULL; diff --git a/drivers/spi/spi-tle62x0.c b/drivers/spi/spi-tle62x0.c index 0ef65cc689bd..dd8bfb3f3544 100644 --- a/drivers/spi/spi-tle62x0.c +++ b/drivers/spi/spi-tle62x0.c @@ -249,7 +249,7 @@ static int tle62x0_probe(struct spi_device *spi) return -EINVAL; } - st = kzalloc_obj(struct tle62x0_state, GFP_KERNEL); + st = kzalloc_obj(struct tle62x0_state); if (st == NULL) return -ENOMEM; diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 72316aa1aab9..cae2dcefabea 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1527,11 +1527,11 @@ static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id) int i; struct pch_pd_dev_save *pd_dev_save; - pd_dev_save = kzalloc_obj(*pd_dev_save, GFP_KERNEL); + pd_dev_save = kzalloc_obj(*pd_dev_save); if (!pd_dev_save) return -ENOMEM; - board_dat = kzalloc_obj(*board_dat, GFP_KERNEL); + board_dat = kzalloc_obj(*board_dat); if (!board_dat) { retval = -ENOMEM; goto err_no_mem; diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index bd80a8bc8139..61f7bde8c7fb 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -568,7 +568,7 @@ struct spi_device *spi_alloc_device(struct spi_controller *ctlr) if (!spi_controller_get(ctlr)) return NULL; - spi = kzalloc_obj(*spi, GFP_KERNEL); + spi = kzalloc_obj(*spi); if (!spi) { spi_controller_put(ctlr); return NULL; @@ -921,7 +921,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) if (!n) return 0; - bi = kzalloc_objs(*bi, n, GFP_KERNEL); + bi = kzalloc_objs(*bi, n); if (!bi) return -ENOMEM; diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 840347f404b9..638221178384 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -214,7 +214,7 @@ static int spidev_message(struct spidev_data *spidev, int status = -EFAULT; spi_message_init(&msg); - k_xfers = kzalloc_objs(*k_tmp, n_xfers, GFP_KERNEL); + k_xfers = kzalloc_objs(*k_tmp, n_xfers); if (k_xfers == NULL) return -ENOMEM; @@ -777,7 +777,7 @@ static int spidev_probe(struct spi_device *spi) } /* Allocate driver data */ - spidev = kzalloc_obj(*spidev, GFP_KERNEL); + spidev = kzalloc_obj(*spidev); if (!spidev) return -ENOMEM; diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c index 29de3055443d..e889b129f3ac 100644 --- a/drivers/spmi/spmi.c +++ b/drivers/spmi/spmi.c @@ -418,7 +418,7 @@ struct spmi_device *spmi_device_alloc(struct spmi_controller *ctrl) { struct spmi_device *sdev; - sdev = kzalloc_obj(*sdev, GFP_KERNEL); + sdev = kzalloc_obj(*sdev); if (!sdev) return NULL; diff --git a/drivers/ssb/bridge_pcmcia_80211.c b/drivers/ssb/bridge_pcmcia_80211.c index 6e958e403dbe..689ff069ff37 100644 --- a/drivers/ssb/bridge_pcmcia_80211.c +++ b/drivers/ssb/bridge_pcmcia_80211.c @@ -31,7 +31,7 @@ static int ssb_host_pcmcia_probe(struct pcmcia_device *dev) int err = -ENOMEM; int res = 0; - ssb = kzalloc_obj(*ssb, GFP_KERNEL); + ssb = kzalloc_obj(*ssb); if (!ssb) goto out_error; diff --git a/drivers/ssb/driver_gige.c b/drivers/ssb/driver_gige.c index fc2bf4ceedee..0aca0711807b 100644 --- a/drivers/ssb/driver_gige.c +++ b/drivers/ssb/driver_gige.c @@ -173,7 +173,7 @@ static int ssb_gige_probe(struct ssb_device *sdev, struct ssb_gige *dev; u32 base, tmslow, tmshigh; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; dev->dev = sdev; diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index bb52e5197b1f..b2d339eb57d5 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c @@ -481,7 +481,7 @@ static int ssb_devices_register(struct ssb_bus *bus) continue; } - devwrap = kzalloc_obj(*devwrap, GFP_KERNEL); + devwrap = kzalloc_obj(*devwrap); if (!devwrap) { err = -ENOMEM; goto error; diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c index 36011a93f5af..5b6b5e0e4433 100644 --- a/drivers/ssb/pcihost_wrapper.c +++ b/drivers/ssb/pcihost_wrapper.c @@ -71,7 +71,7 @@ static int ssb_pcihost_probe(struct pci_dev *dev, int err = -ENOMEM; u32 val; - ssb = kzalloc_obj(*ssb, GFP_KERNEL); + ssb = kzalloc_obj(*ssb); if (!ssb) goto out; err = pci_enable_device(dev); diff --git a/drivers/staging/greybus/authentication.c b/drivers/staging/greybus/authentication.c index e52e3f043572..97b9937bbdc1 100644 --- a/drivers/staging/greybus/authentication.c +++ b/drivers/staging/greybus/authentication.c @@ -306,7 +306,7 @@ int gb_cap_connection_init(struct gb_connection *connection) if (!connection) return 0; - cap = kzalloc_obj(*cap, GFP_KERNEL); + cap = kzalloc_obj(*cap); if (!cap) return -ENOMEM; diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index bad4091e2433..83921d90c322 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -424,7 +424,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_BOOTROM) return -ENODEV; - bootrom = kzalloc_obj(*bootrom, GFP_KERNEL); + bootrom = kzalloc_obj(*bootrom); if (!bootrom) return -ENOMEM; diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 8ad3785ff467..62b55bb28408 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -791,7 +791,7 @@ static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams, if (gb_nstreams > GB_CAMERA_MAX_STREAMS) return -EINVAL; - gb_streams = kzalloc_objs(*gb_streams, gb_nstreams, GFP_KERNEL); + gb_streams = kzalloc_objs(*gb_streams, gb_nstreams); if (!gb_streams) return -ENOMEM; @@ -932,7 +932,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, return ret; /* For each stream to configure parse width, height and format */ - streams = kzalloc_objs(*streams, nstreams, GFP_KERNEL); + streams = kzalloc_objs(*streams, nstreams); if (!streams) return -ENOMEM; @@ -1244,7 +1244,7 @@ static int gb_camera_probe(struct gb_bundle *bundle, if (!mgmt_cport_id || !data_cport_id) return -ENODEV; - gcam = kzalloc_obj(*gcam, GFP_KERNEL); + gcam = kzalloc_obj(*gcam); if (!gcam) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c index 8a437361302c..2016a74f137f 100644 --- a/drivers/staging/greybus/fw-core.c +++ b/drivers/staging/greybus/fw-core.c @@ -68,7 +68,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle, u16 cport_id; u8 protocol_id; - fw_core = kzalloc_obj(*fw_core, GFP_KERNEL); + fw_core = kzalloc_obj(*fw_core); if (!fw_core) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-download.c b/drivers/staging/greybus/fw-download.c index 0216282f72f2..a0a683447b3d 100644 --- a/drivers/staging/greybus/fw-download.c +++ b/drivers/staging/greybus/fw-download.c @@ -165,7 +165,7 @@ static struct fw_request *find_firmware(struct fw_download *fw_download, struct fw_request *fw_req; int ret, req_count; - fw_req = kzalloc_obj(*fw_req, GFP_KERNEL); + fw_req = kzalloc_obj(*fw_req); if (!fw_req) return ERR_PTR(-ENOMEM); @@ -409,7 +409,7 @@ int gb_fw_download_connection_init(struct gb_connection *connection) if (!connection) return 0; - fw_download = kzalloc_obj(*fw_download, GFP_KERNEL); + fw_download = kzalloc_obj(*fw_download); if (!fw_download) return -ENOMEM; diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c index 012ed95d750e..5d01da6b6eb9 100644 --- a/drivers/staging/greybus/fw-management.c +++ b/drivers/staging/greybus/fw-management.c @@ -577,7 +577,7 @@ int gb_fw_mgmt_connection_init(struct gb_connection *connection) if (!connection) return 0; - fw_mgmt = kzalloc_obj(*fw_mgmt, GFP_KERNEL); + fw_mgmt = kzalloc_obj(*fw_mgmt); if (!fw_mgmt) return -ENOMEM; diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c index 24556c686e62..bdb0f5164a6f 100644 --- a/drivers/staging/greybus/gbphy.c +++ b/drivers/staging/greybus/gbphy.c @@ -229,7 +229,7 @@ static struct gbphy_device *gb_gbphy_create_dev(struct gb_bundle *bundle, if (id < 0) return ERR_PTR(id); - gbphy_dev = kzalloc_obj(*gbphy_dev, GFP_KERNEL); + gbphy_dev = kzalloc_obj(*gbphy_dev); if (!gbphy_dev) { ida_free(&gbphy_id, id); return ERR_PTR(-ENOMEM); @@ -282,7 +282,7 @@ static int gb_gbphy_probe(struct gb_bundle *bundle, if (bundle->num_cports == 0) return -ENODEV; - gbphy_host = kzalloc_obj(*gbphy_host, GFP_KERNEL); + gbphy_host = kzalloc_obj(*gbphy_host); if (!gbphy_host) return -ENOMEM; diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index 5b30841a4205..12185f7a982c 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -485,7 +485,7 @@ static int gb_gpio_controller_setup(struct gb_gpio_controller *ggc) if (ret) return ret; - ggc->lines = kzalloc_objs(*ggc->lines, ggc->line_max + 1, GFP_KERNEL); + ggc->lines = kzalloc_objs(*ggc->lines, ggc->line_max + 1); if (!ggc->lines) return -ENOMEM; @@ -502,7 +502,7 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev, struct irq_chip *irqc; int ret; - ggc = kzalloc_obj(*ggc, GFP_KERNEL); + ggc = kzalloc_obj(*ggc); if (!ggc) return -ENOMEM; diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c index 2b5e6a7b04e6..1f58c907c036 100644 --- a/drivers/staging/greybus/hid.c +++ b/drivers/staging/greybus/hid.c @@ -434,7 +434,7 @@ static int gb_hid_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_HID) return -ENODEV; - ghid = kzalloc_obj(*ghid, GFP_KERNEL); + ghid = kzalloc_obj(*ghid); if (!ghid) return -ENOMEM; diff --git a/drivers/staging/greybus/i2c.c b/drivers/staging/greybus/i2c.c index e6934459c8f6..7b6f42113065 100644 --- a/drivers/staging/greybus/i2c.c +++ b/drivers/staging/greybus/i2c.c @@ -235,7 +235,7 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev, struct i2c_adapter *adapter; int ret; - gb_i2c_dev = kzalloc_obj(*gb_i2c_dev, GFP_KERNEL); + gb_i2c_dev = kzalloc_obj(*gb_i2c_dev); if (!gb_i2c_dev) return -ENOMEM; diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 5b8694d3943b..aa93af873d63 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -269,10 +269,10 @@ static int channel_attr_groups_set(struct gb_channel *channel, return 0; /* Set attributes based in the channel flags */ - channel->attrs = kzalloc_objs(*channel->attrs, size + 1, GFP_KERNEL); + channel->attrs = kzalloc_objs(*channel->attrs, size + 1); if (!channel->attrs) return -ENOMEM; - channel->attr_group = kzalloc_obj(*channel->attr_group, GFP_KERNEL); + channel->attr_group = kzalloc_obj(*channel->attr_group); if (!channel->attr_group) return -ENOMEM; channel->attr_groups = kzalloc_objs(*channel->attr_groups, 2, @@ -1262,7 +1262,7 @@ static int gb_lights_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LIGHTS) return -ENODEV; - glights = kzalloc_obj(*glights, GFP_KERNEL); + glights = kzalloc_obj(*glights); if (!glights) return -ENOMEM; diff --git a/drivers/staging/greybus/log.c b/drivers/staging/greybus/log.c index 77fb9880c695..815d20ba9b6b 100644 --- a/drivers/staging/greybus/log.c +++ b/drivers/staging/greybus/log.c @@ -77,7 +77,7 @@ static int gb_log_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LOG) return -ENODEV; - log = kzalloc_obj(*log, GFP_KERNEL); + log = kzalloc_obj(*log); if (!log) return -ENOMEM; diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 37a8cbf140ad..aa9c73cb0ae5 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -471,7 +471,7 @@ static int gb_loopback_async_operation(struct gb_loopback *gb, int type, struct gb_operation *operation; int ret; - op_async = kzalloc_obj(*op_async, GFP_KERNEL); + op_async = kzalloc_obj(*op_async); if (!op_async) return -ENOMEM; @@ -989,7 +989,7 @@ static int gb_loopback_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_LOOPBACK) return -ENODEV; - gb = kzalloc_obj(*gb, GFP_KERNEL); + gb = kzalloc_obj(*gb); if (!gb) return -ENOMEM; diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index 94e3650a2880..c51efeaee707 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -1063,7 +1063,7 @@ static int gb_power_supply_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_POWER_SUPPLY) return -ENODEV; - supplies = kzalloc_obj(*supplies, GFP_KERNEL); + supplies = kzalloc_obj(*supplies); if (!supplies) return -ENOMEM; diff --git a/drivers/staging/greybus/raw.c b/drivers/staging/greybus/raw.c index 742b3a84cf12..a8b598ed9269 100644 --- a/drivers/staging/greybus/raw.c +++ b/drivers/staging/greybus/raw.c @@ -164,7 +164,7 @@ static int gb_raw_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_RAW) return -ENODEV; - raw = kzalloc_obj(*raw, GFP_KERNEL); + raw = kzalloc_obj(*raw); if (!raw) return -ENOMEM; diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 99eff4b97e7a..7d060b4cd33d 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -823,7 +823,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev, goto exit_connection_destroy; } - gb_tty = kzalloc_obj(*gb_tty, GFP_KERNEL); + gb_tty = kzalloc_obj(*gb_tty); if (!gb_tty) { retval = -ENOMEM; goto exit_connection_destroy; diff --git a/drivers/staging/greybus/vibrator.c b/drivers/staging/greybus/vibrator.c index fc995fe41604..0ec4d317c9db 100644 --- a/drivers/staging/greybus/vibrator.c +++ b/drivers/staging/greybus/vibrator.c @@ -128,7 +128,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle, if (cport_desc->protocol_id != GREYBUS_PROTOCOL_VIBRATOR) return -ENODEV; - vib = kzalloc_obj(*vib, GFP_KERNEL); + vib = kzalloc_obj(*vib); if (!vib) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index a67eeed04b0c..d3414312e1de 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -794,7 +794,7 @@ static int gc2235_probe(struct i2c_client *client) int ret; unsigned int i; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index 38568259bd7f..2c41c496daa6 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -952,7 +952,7 @@ static int ov2722_probe(struct i2c_client *client) void *ovpdev; int ret; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 4584f0ee15f0..fec369575d88 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -2960,7 +2960,7 @@ int atomisp_set_parameters(struct video_device *vdev, * are ready, the parameters will be set to CSS. * per-frame setting only works for the main output frame. */ - param = kvzalloc_obj(*param, GFP_KERNEL); + param = kvzalloc_obj(*param); if (!param) return -ENOMEM; css_param = ¶m->params; diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 27d3c7d83e21..4026e98c5845 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -969,7 +969,7 @@ static int camera_sensor_csi_alloc(struct v4l2_subdev *sd, u32 port, u32 lanes, struct i2c_client *client = v4l2_get_subdevdata(sd); struct camera_mipi_info *csi; - csi = kzalloc_obj(*csi, GFP_KERNEL); + csi = kzalloc_obj(*csi); if (!csi) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c index 8181e988266a..856561e951a5 100644 --- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c +++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c @@ -676,7 +676,7 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, mutex_lock(&bo->mutex); check_bo_status_no_goto(bo, HMM_BO_PAGE_ALLOCED, status_err); - bo->pages = kzalloc_objs(struct page *, bo->pgnr, GFP_KERNEL); + bo->pages = kzalloc_objs(struct page *, bo->pgnr); if (unlikely(!bo->pages)) { ret = -ENOMEM; goto alloc_err; diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index 473e71e1bb59..bd2def6c341a 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c @@ -309,7 +309,7 @@ ia_css_isp_dvs_statistics_allocate( if (!grid->enable) return NULL; - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -350,7 +350,7 @@ ia_css_isp_dvs_statistics_map_allocate( * so we use a local char * instead. */ char *base_ptr; - me = kvmalloc_obj(*me, GFP_KERNEL); + me = kvmalloc_obj(*me); if (!me) { IA_CSS_LOG("cannot allocate memory"); goto err; diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c index f84ee4c683f4..4a38d678f334 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c @@ -274,7 +274,7 @@ ia_css_isp_dvs2_statistics_allocate( if (!grid->enable) return NULL; - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; diff --git a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c index 2217e3623a23..8614efc28b19 100644 --- a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c +++ b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c @@ -650,7 +650,7 @@ static struct ia_css_frame *frame_create(unsigned int width, unsigned int raw_bit_depth, bool valid) { - struct ia_css_frame *me = kvmalloc_obj(*me, GFP_KERNEL); + struct ia_css_frame *me = kvmalloc_obj(*me); if (!me) return NULL; diff --git a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c index 2a1ba0a9c916..0470871f8fff 100644 --- a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +++ b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c @@ -579,7 +579,7 @@ static int pipeline_stage_create( out_frame[i] = stage_desc->out_frame[i]; } - stage = kvzalloc_obj(*stage, GFP_KERNEL); + stage = kvzalloc_obj(*stage); if (!stage) { err = -ENOMEM; goto ERR; diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index abf598b2811f..78ea854d903d 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1880,7 +1880,7 @@ create_pipe(enum ia_css_pipe_mode mode, return -EINVAL; } - me = kmalloc_obj(*me, GFP_KERNEL); + me = kmalloc_obj(*me); if (!me) return -ENOMEM; @@ -7910,7 +7910,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, } /* allocate the stream instance */ - curr_stream = kzalloc_obj(struct ia_css_stream, GFP_KERNEL); + curr_stream = kzalloc_obj(struct ia_css_stream); if (!curr_stream) { err = -ENOMEM; IA_CSS_LEAVE_ERR(err); diff --git a/drivers/staging/media/atomisp/pci/sh_css_host_data.c b/drivers/staging/media/atomisp/pci/sh_css_host_data.c index c9400600c241..d8f8e5e4482c 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_host_data.c +++ b/drivers/staging/media/atomisp/pci/sh_css_host_data.c @@ -12,7 +12,7 @@ struct ia_css_host_data *ia_css_host_data_allocate(size_t size) { struct ia_css_host_data *me; - me = kmalloc_obj(struct ia_css_host_data, GFP_KERNEL); + me = kmalloc_obj(struct ia_css_host_data); if (!me) return NULL; me->size = (uint32_t)size; diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c index 19f1b71a5c06..9ccdb66de2df 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c +++ b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c @@ -22,7 +22,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res, int err = 0; struct ia_css_dvs_6axis_config *dvs_config = NULL; - dvs_config = kvmalloc_obj(struct ia_css_dvs_6axis_config, GFP_KERNEL); + dvs_config = kvmalloc_obj(struct ia_css_dvs_6axis_config); if (!dvs_config) { IA_CSS_ERROR("out of memory"); err = -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c index e9ce4ef6a991..9105334c71b1 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c +++ b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c @@ -328,7 +328,7 @@ ia_css_shading_table_alloc( IA_CSS_ENTER(""); - me = kmalloc_obj(*me, GFP_KERNEL); + me = kmalloc_obj(*me); if (!me) return me; diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index ab9ab7b2f177..424876311da5 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -1369,7 +1369,7 @@ struct ia_css_morph_table *ia_css_morph_table_allocate( IA_CSS_ENTER(""); - me = kvmalloc_obj(*me, GFP_KERNEL); + me = kvmalloc_obj(*me); if (!me) { IA_CSS_ERROR("out of memory"); return me; @@ -1516,7 +1516,7 @@ ia_css_isp_3a_statistics_map_allocate( * so we use a local char * instead. */ char *base_ptr; - me = kvmalloc_obj(*me, GFP_KERNEL); + me = kvmalloc_obj(*me); if (!me) { IA_CSS_LEAVE("cannot allocate memory"); goto err; @@ -2136,7 +2136,7 @@ ia_css_isp_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid) if (!grid->enable) return NULL; - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -2200,7 +2200,7 @@ ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info) if (metadata_info->size == 0) return NULL; - md = kvmalloc_obj(*md, GFP_KERNEL); + md = kvmalloc_obj(*md); if (!md) goto error; @@ -2330,7 +2330,7 @@ sh_css_create_isp_params(struct ia_css_stream *stream, int err; size_t params_size; struct ia_css_isp_parameters *params = - kvmalloc_obj(struct ia_css_isp_parameters, GFP_KERNEL); + kvmalloc_obj(struct ia_css_isp_parameters); if (!params) { *isp_params_out = NULL; @@ -4161,7 +4161,7 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid) assert(grid); - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -4201,7 +4201,7 @@ ia_css_dvs_statistics_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -4239,7 +4239,7 @@ ia_css_dvs_coefficients_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -4280,7 +4280,7 @@ ia_css_dvs2_statistics_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; @@ -4371,7 +4371,7 @@ ia_css_dvs2_coefficients_allocate(const struct ia_css_dvs_grid_info *grid) assert(grid); - me = kvzalloc_objs(*me, 1, GFP_KERNEL); + me = kvzalloc_objs(*me, 1); if (!me) goto err; diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index bdd3cc28e364..607992100baf 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -2424,7 +2424,7 @@ static int av7110_attach(struct saa7146_dev *dev, } /* prepare the av7110 device struct */ - av7110 = kzalloc_obj(*av7110, GFP_KERNEL); + av7110 = kzalloc_obj(*av7110); if (!av7110) { dprintk(1, "out of memory\n"); return -ENOMEM; diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index 2254a5f3a351..29fb4934c039 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -563,7 +563,7 @@ struct dvb_frontend *sp8870_attach(const struct sp8870_config *config, struct sp8870_state *state = NULL; /* allocate memory for the internal state */ - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) goto error; diff --git a/drivers/staging/media/imx/imx-media-csc-scaler.c b/drivers/staging/media/imx/imx-media-csc-scaler.c index f068ead6c088..00fcdd4d0487 100644 --- a/drivers/staging/media/imx/imx-media-csc-scaler.c +++ b/drivers/staging/media/imx/imx-media-csc-scaler.c @@ -124,7 +124,7 @@ static void device_run(void *_ctx) src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); - run = kzalloc_obj(*run, GFP_KERNEL); + run = kzalloc_obj(*run); if (!run) goto err; @@ -756,7 +756,7 @@ static int ipu_csc_scaler_open(struct file *file) struct ipu_csc_scaler_ctx *ctx = NULL; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -880,7 +880,7 @@ imx_media_csc_scaler_device_init(struct imx_media_dev *md) struct video_device *vfd; int ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu3/ipu3-css-fw.c b/drivers/staging/media/ipu3/ipu3-css-fw.c index 0f242dd27288..146e92ce6e4c 100644 --- a/drivers/staging/media/ipu3/ipu3-css-fw.c +++ b/drivers/staging/media/ipu3/ipu3-css-fw.c @@ -236,7 +236,7 @@ int imgu_css_fw_init(struct imgu_css *css) /* Allocate and map fw binaries into IMGU */ - css->binary = kzalloc_objs(*css->binary, binary_nr, GFP_KERNEL); + css->binary = kzalloc_objs(*css->binary, binary_nr); if (!css->binary) { r = -ENOMEM; goto error_out; diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c index 3fb863043c71..8063401246fb 100644 --- a/drivers/staging/media/ipu3/ipu3-css.c +++ b/drivers/staging/media/ipu3/ipu3-css.c @@ -1702,7 +1702,7 @@ int imgu_css_fmt_try(struct imgu_css *css, struct v4l2_pix_format_mplane *in, *out, *vf; int i, s, ret; - q = kzalloc_objs(struct imgu_css_queue, IPU3_CSS_QUEUES, GFP_KERNEL); + q = kzalloc_objs(struct imgu_css_queue, IPU3_CSS_QUEUES); if (!q) return -ENOMEM; diff --git a/drivers/staging/media/ipu3/ipu3-dmamap.c b/drivers/staging/media/ipu3/ipu3-dmamap.c index 9f6025aa8a1f..ef208a059ef6 100644 --- a/drivers/staging/media/ipu3/ipu3-dmamap.c +++ b/drivers/staging/media/ipu3/ipu3-dmamap.c @@ -39,7 +39,7 @@ static struct page **imgu_dmamap_alloc_buffer(size_t size, gfp_t gfp) const gfp_t high_order_gfp = __GFP_NOWARN | __GFP_NORETRY; /* Allocate mem for array of page ptrs */ - pages = kvmalloc_objs(*pages, count, GFP_KERNEL); + pages = kvmalloc_objs(*pages, count); if (!pages) return NULL; diff --git a/drivers/staging/media/ipu3/ipu3-mmu.c b/drivers/staging/media/ipu3/ipu3-mmu.c index 03583d37fdd0..b196a5815903 100644 --- a/drivers/staging/media/ipu3/ipu3-mmu.c +++ b/drivers/staging/media/ipu3/ipu3-mmu.c @@ -429,7 +429,7 @@ struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base) struct imgu_mmu *mmu; u32 pteval; - mmu = kzalloc_obj(*mmu, GFP_KERNEL); + mmu = kzalloc_obj(*mmu); if (!mmu) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu7/ipu7-bus.c b/drivers/staging/media/ipu7/ipu7-bus.c index 583825d15230..7a1b0744b236 100644 --- a/drivers/staging/media/ipu7/ipu7-bus.c +++ b/drivers/staging/media/ipu7/ipu7-bus.c @@ -89,7 +89,7 @@ ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent, struct ipu7_device *isp = pci_get_drvdata(pdev); int ret; - adev = kzalloc_obj(*adev, GFP_KERNEL); + adev = kzalloc_obj(*adev); if (!adev) return ERR_PTR(-ENOMEM); diff --git a/drivers/staging/media/ipu7/ipu7-dma.c b/drivers/staging/media/ipu7/ipu7-dma.c index 4f934e4c930b..9a356ae3b95a 100644 --- a/drivers/staging/media/ipu7/ipu7-dma.c +++ b/drivers/staging/media/ipu7/ipu7-dma.c @@ -164,7 +164,7 @@ void *ipu7_dma_alloc(struct ipu7_bus_device *sys, size_t size, unsigned int i; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return NULL; diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c index dfed9872bdfd..6ded07ccd780 100644 --- a/drivers/staging/media/ipu7/ipu7-mmu.c +++ b/drivers/staging/media/ipu7/ipu7-mmu.c @@ -584,7 +584,7 @@ static struct ipu7_mmu_info *ipu7_mmu_alloc(struct ipu7_device *isp) struct ipu7_mmu_info *mmu_info; int ret; - mmu_info = kzalloc_obj(*mmu_info, GFP_KERNEL); + mmu_info = kzalloc_obj(*mmu_info); if (!mmu_info) return NULL; @@ -654,7 +654,7 @@ static struct ipu7_dma_mapping *alloc_dma_mapping(struct ipu7_device *isp) struct ipu7_dma_mapping *dmap; unsigned long base_pfn; - dmap = kzalloc_obj(*dmap, GFP_KERNEL); + dmap = kzalloc_obj(*dmap); if (!dmap) return NULL; diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c index 47b859e1fa0f..c771e763f8c5 100644 --- a/drivers/staging/media/ipu7/ipu7.c +++ b/drivers/staging/media/ipu7/ipu7.c @@ -2150,7 +2150,7 @@ ipu7_isys_init(struct pci_dev *pdev, struct device *parent, } } - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return ERR_PTR(-ENOMEM); @@ -2197,7 +2197,7 @@ ipu7_psys_init(struct pci_dev *pdev, struct device *parent, struct ipu7_psys_pdata *pdata; int ret; - pdata = kzalloc_obj(*pdata, GFP_KERNEL); + pdata = kzalloc_obj(*pdata); if (!pdata) return ERR_PTR(-ENOMEM); @@ -2271,7 +2271,7 @@ static int ipu7_map_fw_code_region(struct ipu7_bus_device *sys, n_pages = PFN_UP(size); - pages = kmalloc_objs(*pages, n_pages, GFP_KERNEL); + pages = kmalloc_objs(*pages, n_pages); if (!pages) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_h264.c b/drivers/staging/media/meson/vdec/codec_h264.c index bafa7e99abf1..89e0f8624e5b 100644 --- a/drivers/staging/media/meson/vdec/codec_h264.c +++ b/drivers/staging/media/meson/vdec/codec_h264.c @@ -233,7 +233,7 @@ static int codec_h264_load_extended_firmware(struct amvdec_session *sess, if (len < SIZE_EXT_FW) return -EINVAL; - h264 = kzalloc_obj(*h264, GFP_KERNEL); + h264 = kzalloc_obj(*h264); if (!h264) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c index 01adf66fb50a..76e9ca7191ab 100644 --- a/drivers/staging/media/meson/vdec/codec_mpeg12.c +++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c @@ -66,7 +66,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess) struct codec_mpeg12 *mpeg12; int ret; - mpeg12 = kzalloc_obj(*mpeg12, GFP_KERNEL); + mpeg12 = kzalloc_obj(*mpeg12); if (!mpeg12) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/codec_vp9.c b/drivers/staging/media/meson/vdec/codec_vp9.c index c82f7be67bc5..8e80ecf84193 100644 --- a/drivers/staging/media/meson/vdec/codec_vp9.c +++ b/drivers/staging/media/meson/vdec/codec_vp9.c @@ -762,7 +762,7 @@ static int codec_vp9_start(struct amvdec_session *sess) int i; int ret; - vp9 = kzalloc_obj(*vp9, GFP_KERNEL); + vp9 = kzalloc_obj(*vp9); if (!vp9) return -ENOMEM; @@ -1192,7 +1192,7 @@ static struct vp9_frame *codec_vp9_get_new_frame(struct amvdec_session *sess) struct vb2_v4l2_buffer *vbuf; struct vp9_frame *new_frame; - new_frame = kzalloc_obj(*new_frame, GFP_KERNEL); + new_frame = kzalloc_obj(*new_frame); if (!new_frame) return NULL; diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index befd3c3762cc..4b77ec1af5a7 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -132,7 +132,7 @@ vdec_queue_recycle(struct amvdec_session *sess, struct vb2_buffer *vb) { struct amvdec_buffer *new_buf; - new_buf = kmalloc_obj(*new_buf, GFP_KERNEL); + new_buf = kmalloc_obj(*new_buf); if (!new_buf) return; new_buf->vb = vb; @@ -867,7 +867,7 @@ static int vdec_open(struct file *file) struct amvdec_session *sess; int ret; - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (!sess) return -ENOMEM; diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c index 86ed5b8113d2..f02c21d5a9c1 100644 --- a/drivers/staging/media/meson/vdec/vdec_helpers.c +++ b/drivers/staging/media/meson/vdec/vdec_helpers.c @@ -233,7 +233,7 @@ int amvdec_add_ts(struct amvdec_session *sess, u64 ts, struct amvdec_timestamp *new_ts; unsigned long flags; - new_ts = kzalloc_obj(*new_ts, GFP_KERNEL); + new_ts = kzalloc_obj(*new_ts); if (!new_ts) return -ENOMEM; diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index accaee635d21..6600245dff0e 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -359,7 +359,7 @@ static int cedrus_open(struct file *file) if (mutex_lock_interruptible(&dev->dev_mutex)) return -ERESTARTSYS; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { mutex_unlock(&dev->dev_mutex); return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c index 98e3a97ee658..7842104ca933 100644 --- a/drivers/staging/media/tegra-video/csi.c +++ b/drivers/staging/media/tegra-video/csi.c @@ -463,7 +463,7 @@ static int tegra_csi_channel_alloc(struct tegra_csi *csi, struct tegra_csi_channel *chan; int ret = 0, i; - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index a86d0223f6c3..9c0b38585d63 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1209,7 +1209,7 @@ static int tegra_vi_channel_alloc(struct tegra_vi *vi, unsigned int port_num, * be holding the device node open. Channel memory allocated * with kzalloc is freed during video device release callback. */ - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return -ENOMEM; diff --git a/drivers/staging/media/tegra-video/video.c b/drivers/staging/media/tegra-video/video.c index 06d85292c0d2..ae1ae03fa9de 100644 --- a/drivers/staging/media/tegra-video/video.c +++ b/drivers/staging/media/tegra-video/video.c @@ -46,7 +46,7 @@ static int host1x_video_probe(struct host1x_device *dev) struct tegra_video_device *vid; int ret; - vid = kzalloc_obj(*vid, GFP_KERNEL); + vid = kzalloc_obj(*vid); if (!vid) return -ENOMEM; diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c index 16b1aca26333..8d649d920433 100644 --- a/drivers/staging/most/dim2/dim2.c +++ b/drivers/staging/most/dim2/dim2.c @@ -759,7 +759,7 @@ static int dim2_probe(struct platform_device *pdev) enum { MLB_INT_IDX, AHB0_INT_IDX }; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c index b0d7216f5ab5..04351f8ccccf 100644 --- a/drivers/staging/most/video/video.c +++ b/drivers/staging/most/video/video.c @@ -84,7 +84,7 @@ static int comp_vdev_open(struct file *filp) return -EINVAL; } - fh = kzalloc_obj(*fh, GFP_KERNEL); + fh = kzalloc_obj(*fh); if (!fh) return -ENOMEM; @@ -474,7 +474,7 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx, return -EINVAL; } - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c index 3422a5213803..e6234d29e264 100644 --- a/drivers/staging/nvec/nvec_ps2.c +++ b/drivers/staging/nvec/nvec_ps2.c @@ -102,7 +102,7 @@ static int nvec_mouse_probe(struct platform_device *pdev) struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); struct serio *ser_dev; - ser_dev = kzalloc_obj(*ser_dev, GFP_KERNEL); + ser_dev = kzalloc_obj(*ser_dev); if (!ser_dev) return -ENOMEM; diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index a90b117906ce..864cd8b6d1f1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -1229,13 +1229,13 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c); if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para); if (!psetstakey_para) { kfree(ph2c); res = _FAIL; @@ -1269,12 +1269,12 @@ static int rtw_ap_set_key(struct adapter *padapter, struct cmd_priv *pcmdpriv = &padapter->cmdpriv; int res = _SUCCESS; - pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd); if (!pcmd) { res = _FAIL; goto exit; } - psetkeyparm = kzalloc_obj(*psetkeyparm, GFP_KERNEL); + psetkeyparm = kzalloc_obj(*psetkeyparm); if (!psetkeyparm) { kfree(pcmd); res = _FAIL; diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 59f4e12535f9..abb84f8aecbe 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -634,7 +634,7 @@ int rtw_startbss_cmd(struct adapter *padapter, int flags) start_bss_network(padapter); } else { /* need enqueue, prepare cmd_obj and enqueue */ - pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd); if (!pcmd) { res = _FAIL; goto exit; @@ -686,7 +686,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) u32 tmp_len; u8 *ptmp = NULL; - pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd); if (!pcmd) { res = _FAIL; goto exit; @@ -795,7 +795,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu u8 res = _SUCCESS; /* prepare cmd parameter */ - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) { res = _FAIL; goto exit; @@ -804,7 +804,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu if (enqueue) { /* need enqueue, prepare cmd_obj and enqueue */ - cmdobj = kzalloc_obj(*cmdobj, GFP_KERNEL); + cmdobj = kzalloc_obj(*cmdobj); if (!cmdobj) { res = _FAIL; kfree(param); @@ -831,7 +831,7 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrast struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - psetop = kzalloc_obj(*psetop, GFP_KERNEL); + psetop = kzalloc_obj(*psetop); if (!psetop) { res = _FAIL; goto exit; @@ -839,7 +839,7 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrast psetop->mode = (u8)networktype; if (enqueue) { - ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c); if (!ph2c) { kfree(psetop); res = _FAIL; @@ -866,7 +866,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ struct security_priv *psecuritypriv = &padapter->securitypriv; u8 res = _SUCCESS; - psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para); if (!psetstakey_para) { res = _FAIL; goto exit; @@ -888,14 +888,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ padapter->securitypriv.busetkipkey = true; if (enqueue) { - ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c); if (!ph2c) { kfree(psetstakey_para); res = _FAIL; goto exit; } - psetstakey_rsp = kzalloc_obj(*psetstakey_rsp, GFP_KERNEL); + psetstakey_rsp = kzalloc_obj(*psetstakey_rsp); if (!psetstakey_rsp) { kfree(ph2c); kfree(psetstakey_para); @@ -933,20 +933,20 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu rtw_camid_free(padapter, cam_id); } } else { - ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c); if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para = kzalloc_obj(*psetstakey_para, GFP_KERNEL); + psetstakey_para = kzalloc_obj(*psetstakey_para); if (!psetstakey_para) { kfree(ph2c); res = _FAIL; goto exit; } - psetstakey_rsp = kzalloc_obj(*psetstakey_rsp, GFP_KERNEL); + psetstakey_rsp = kzalloc_obj(*psetstakey_rsp); if (!psetstakey_rsp) { kfree(ph2c); kfree(psetstakey_para); @@ -1651,13 +1651,13 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = kzalloc_obj(*ph2c, GFP_KERNEL); + ph2c = kzalloc_obj(*ph2c); if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm, GFP_KERNEL); + pdrvextra_cmd_parm = kzalloc_obj(*pdrvextra_cmd_parm); if (!pdrvextra_cmd_parm) { kfree(ph2c); res = _FAIL; diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 1bc90fa48d36..7df651708381 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -1875,13 +1875,13 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity struct cmd_priv *pcmdpriv = &adapter->cmdpriv; signed int res = _SUCCESS; - pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd); if (!pcmd) { res = _FAIL; /* try again */ goto exit; } - psetauthparm = kzalloc_obj(*psetauthparm, GFP_KERNEL); + psetauthparm = kzalloc_obj(*psetauthparm); if (!psetauthparm) { kfree(pcmd); res = _FAIL; @@ -1912,7 +1912,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp struct cmd_priv *pcmdpriv = &adapter->cmdpriv; signed int res = _SUCCESS; - psetkeyparm = kzalloc_obj(*psetkeyparm, GFP_KERNEL); + psetkeyparm = kzalloc_obj(*psetkeyparm); if (!psetkeyparm) { res = _FAIL; goto exit; @@ -1954,7 +1954,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp } if (enqueue) { - pcmd = kzalloc_obj(*pcmd, GFP_KERNEL); + pcmd = kzalloc_obj(*pcmd); if (!pcmd) { kfree(psetkeyparm); res = _FAIL; /* try again */ diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c index aceb1bfde8a4..3242978da36c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c @@ -1131,7 +1131,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) if (memcmp(cur_network->network.mac_address, pbssid, 6)) return true; - bssid = kzalloc_obj(*bssid, GFP_KERNEL); + bssid = kzalloc_obj(*bssid); if (!bssid) return true; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 64d3cbfb1244..8d259820f103 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -306,10 +306,10 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw) u8 *fwfilepath; u8 tmp_ps; - pFirmware = kzalloc_obj(struct rt_firmware, GFP_KERNEL); + pFirmware = kzalloc_obj(struct rt_firmware); if (!pFirmware) return _FAIL; - pBTFirmware = kzalloc_obj(struct rt_firmware, GFP_KERNEL); + pBTFirmware = kzalloc_obj(struct rt_firmware); if (!pBTFirmware) { kfree(pFirmware); return _FAIL; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 3922c3920bd8..7cb0c6f22bf3 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1248,7 +1248,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy goto check_need_indicate_scan_done; } - ssid = kzalloc_objs(*ssid, RTW_SSID_SCAN_AMOUNT, GFP_KERNEL); + ssid = kzalloc_objs(*ssid, RTW_SSID_SCAN_AMOUNT); if (!ssid) { ret = -ENOMEM; goto check_need_indicate_scan_done; @@ -2145,7 +2145,7 @@ static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *name, str pnpi->sizeof_priv = sizeof(struct adapter); /* wdev */ - mon_wdev = kzalloc_obj(*mon_wdev, GFP_KERNEL); + mon_wdev = kzalloc_obj(*mon_wdev); if (!mon_wdev) { ret = -ENOMEM; goto out; @@ -2726,7 +2726,7 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev) goto free_wiphy; /* wdev */ - wdev = kzalloc_obj(*wdev, GFP_KERNEL); + wdev = kzalloc_obj(*wdev); if (!wdev) { ret = -ENOMEM; goto unregister_wiphy; diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 6260f8f33c6d..29939bf5a156 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -568,7 +568,7 @@ struct dvobj_priv *devobj_init(void) { struct dvobj_priv *pdvobj = NULL; - pdvobj = kzalloc_obj(*pdvobj, GFP_KERNEL); + pdvobj = kzalloc_obj(*pdvobj); if (!pdvobj) return NULL; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index ae9ad7a8815d..bce42bff307f 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -108,7 +108,7 @@ static int snd_bcm2835_playback_open_generic(struct snd_pcm_substream *substream goto out; } - alsa_stream = kzalloc_obj(*alsa_stream, GFP_KERNEL); + alsa_stream = kzalloc_obj(*alsa_stream); if (!alsa_stream) { err = -ENOMEM; goto out; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index d9397ac8faca..3156cb8392f4 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -219,7 +219,7 @@ int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream) int err; /* Allocate memory for this instance */ - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) return -ENOMEM; mutex_init(&instance->vchi_mutex); diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 4ab3b572bbd7..f10a00c05f12 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -287,7 +287,7 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, if (!allocated_image) goto err_image; - resource = kmalloc_obj(*resource, GFP_KERNEL); + resource = kmalloc_obj(*resource); if (!resource) goto err_alloc; @@ -484,7 +484,7 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, goto err_image; } - resource = kmalloc_obj(*resource, GFP_KERNEL); + resource = kmalloc_obj(*resource); if (!resource) goto err_alloc; @@ -854,7 +854,7 @@ struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route) if (!allocated_ctrlr) goto err_ctrlr; - resource = kmalloc_obj(*resource, GFP_KERNEL); + resource = kmalloc_obj(*resource); if (!resource) goto err_alloc; @@ -894,7 +894,7 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource) return NULL; } - dma_list = kmalloc_obj(*dma_list, GFP_KERNEL); + dma_list = kmalloc_obj(*dma_list); if (!dma_list) return NULL; @@ -924,11 +924,11 @@ struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, u32 type) struct vme_dma_attr *attributes; struct vme_dma_pattern *pattern_attr; - attributes = kmalloc_obj(*attributes, GFP_KERNEL); + attributes = kmalloc_obj(*attributes); if (!attributes) goto err_attr; - pattern_attr = kmalloc_obj(*pattern_attr, GFP_KERNEL); + pattern_attr = kmalloc_obj(*pattern_attr); if (!pattern_attr) goto err_pat; @@ -964,11 +964,11 @@ struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t address) /* XXX Run some sanity checks here */ - attributes = kmalloc_obj(*attributes, GFP_KERNEL); + attributes = kmalloc_obj(*attributes); if (!attributes) goto err_attr; - pci_attr = kmalloc_obj(*pci_attr, GFP_KERNEL); + pci_attr = kmalloc_obj(*pci_attr); if (!pci_attr) goto err_pci; @@ -1005,11 +1005,11 @@ struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long address, struct vme_dma_attr *attributes; struct vme_dma_vme *vme_attr; - attributes = kmalloc_obj(*attributes, GFP_KERNEL); + attributes = kmalloc_obj(*attributes); if (!attributes) goto err_attr; - vme_attr = kmalloc_obj(*vme_attr, GFP_KERNEL); + vme_attr = kmalloc_obj(*vme_attr); if (!vme_attr) goto err_vme; @@ -1458,7 +1458,7 @@ struct vme_resource *vme_lm_request(struct vme_dev *vdev) if (!allocated_lm) goto err_lm; - resource = kmalloc_obj(*resource, GFP_KERNEL); + resource = kmalloc_obj(*resource); if (!resource) goto err_alloc; @@ -1810,7 +1810,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv, struct vme_dev *tmp; for (i = 0; i < ndevs; i++) { - vdev = kzalloc_obj(*vdev, GFP_KERNEL); + vdev = kzalloc_obj(*vdev); if (!vdev) { err = -ENOMEM; goto err_devalloc; diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c index 77881a96114f..be4ad47ed526 100644 --- a/drivers/staging/vme_user/vme_fake.c +++ b/drivers/staging/vme_user/vme_fake.c @@ -1073,13 +1073,13 @@ static int __init fake_init(void) /* If we want to support more than one bridge at some point, we need to * dynamically allocate this so we get one per device. */ - fake_bridge = kzalloc_obj(*fake_bridge, GFP_KERNEL); + fake_bridge = kzalloc_obj(*fake_bridge); if (!fake_bridge) { retval = -ENOMEM; goto err_struct; } - fake_device = kzalloc_obj(*fake_device, GFP_KERNEL); + fake_device = kzalloc_obj(*fake_device); if (!fake_device) { retval = -ENOMEM; goto err_driver; @@ -1102,7 +1102,7 @@ static int __init fake_init(void) /* Add master windows to list */ INIT_LIST_HEAD(&fake_bridge->master_resources); for (i = 0; i < FAKE_MAX_MASTER; i++) { - master_image = kmalloc_obj(*master_image, GFP_KERNEL); + master_image = kmalloc_obj(*master_image); if (!master_image) { retval = -ENOMEM; goto err_master; @@ -1128,7 +1128,7 @@ static int __init fake_init(void) /* Add slave windows to list */ INIT_LIST_HEAD(&fake_bridge->slave_resources); for (i = 0; i < FAKE_MAX_SLAVE; i++) { - slave_image = kmalloc_obj(*slave_image, GFP_KERNEL); + slave_image = kmalloc_obj(*slave_image); if (!slave_image) { retval = -ENOMEM; goto err_slave; @@ -1150,7 +1150,7 @@ static int __init fake_init(void) /* Add location monitor to list */ INIT_LIST_HEAD(&fake_bridge->lm_resources); - lm = kmalloc_obj(*lm, GFP_KERNEL); + lm = kmalloc_obj(*lm); if (!lm) { retval = -ENOMEM; goto err_lm; diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c index 123408fffb6f..356f3f5ec69a 100644 --- a/drivers/staging/vme_user/vme_tsi148.c +++ b/drivers/staging/vme_user/vme_tsi148.c @@ -1611,7 +1611,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *s tsi148_bridge = list->parent->parent; /* Descriptor must be aligned on 64-bit boundaries */ - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { retval = -ENOMEM; goto err_mem; @@ -2260,14 +2260,14 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* If we want to support more than one of each bridge, we need to * dynamically generate this so we get one per device */ - tsi148_bridge = kzalloc_obj(*tsi148_bridge, GFP_KERNEL); + tsi148_bridge = kzalloc_obj(*tsi148_bridge); if (!tsi148_bridge) { retval = -ENOMEM; goto err_struct; } vme_init_bridge(tsi148_bridge); - tsi148_device = kzalloc_obj(*tsi148_device, GFP_KERNEL); + tsi148_device = kzalloc_obj(*tsi148_device); if (!tsi148_device) { retval = -ENOMEM; goto err_driver; @@ -2349,7 +2349,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add master windows to list */ for (i = 0; i < master_num; i++) { - master_image = kmalloc_obj(*master_image, GFP_KERNEL); + master_image = kmalloc_obj(*master_image); if (!master_image) { retval = -ENOMEM; goto err_master; @@ -2375,7 +2375,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add slave windows to list */ for (i = 0; i < TSI148_MAX_SLAVE; i++) { - slave_image = kmalloc_obj(*slave_image, GFP_KERNEL); + slave_image = kmalloc_obj(*slave_image); if (!slave_image) { retval = -ENOMEM; goto err_slave; @@ -2396,7 +2396,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Add dma engines to list */ for (i = 0; i < TSI148_MAX_DMA; i++) { - dma_ctrlr = kmalloc_obj(*dma_ctrlr, GFP_KERNEL); + dma_ctrlr = kmalloc_obj(*dma_ctrlr); if (!dma_ctrlr) { retval = -ENOMEM; goto err_dma; @@ -2416,7 +2416,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* Add location monitor to list */ - lm = kmalloc_obj(*lm, GFP_KERNEL); + lm = kmalloc_obj(*lm); if (!lm) { retval = -ENOMEM; goto err_lm; diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c index 00da869a8056..d95dd7d9190a 100644 --- a/drivers/staging/vme_user/vme_user.c +++ b/drivers/staging/vme_user/vme_user.c @@ -464,7 +464,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) return err; } - vma_priv = kmalloc_obj(*vma_priv, GFP_KERNEL); + vma_priv = kmalloc_obj(*vma_priv); if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index 0aa4cb9e494e..146705845fa3 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c @@ -79,7 +79,7 @@ static struct np_info * cxgbit_np_hash_add(struct cxgbit_device *cdev, struct cxgbit_np *cnp, unsigned int stid) { - struct np_info *p = kzalloc_obj(*p, GFP_KERNEL); + struct np_info *p = kzalloc_obj(*p); if (p) { int bucket = cxgbit_np_hashfn(cnp); @@ -431,7 +431,7 @@ int cxgbit_setup_np(struct iscsi_np *np, struct sockaddr_storage *ksockaddr) (ksockaddr->ss_family != AF_INET6)) return -EINVAL; - cnp = kzalloc_obj(*cnp, GFP_KERNEL); + cnp = kzalloc_obj(*cnp); if (!cnp) return -ENOMEM; diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c index e1985e1187b0..b6036820fc95 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_main.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c @@ -57,7 +57,7 @@ static void *cxgbit_uld_add(const struct cxgb4_lld_info *lldi) if (is_t4(lldi->adapter_type)) return ERR_PTR(-ENODEV); - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 6ff807754304..e80449f6ce15 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -121,7 +121,7 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf) return ERR_PTR(-EINVAL); } - tiqn = kzalloc_obj(*tiqn, GFP_KERNEL); + tiqn = kzalloc_obj(*tiqn); if (!tiqn) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ struct iscsi_np *iscsit_add_np( return np; } - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); if (!np) { mutex_unlock(&np_lock); return ERR_PTR(-ENOMEM); @@ -674,7 +674,7 @@ static int __init iscsi_target_init_module(void) int ret = 0, size; pr_debug("iSCSI-Target "ISCSIT_VERSION"\n"); - iscsit_global = kzalloc_obj(*iscsit_global, GFP_KERNEL); + iscsit_global = kzalloc_obj(*iscsit_global); if (!iscsit_global) return -1; @@ -981,7 +981,7 @@ static int iscsit_allocate_iovecs(struct iscsit_cmd *cmd) u32 iov_count = max(1UL, DIV_ROUND_UP(cmd->se_cmd.data_length, PAGE_SIZE)); iov_count += ISCSI_IOV_DATA_BUFFER; - cmd->iov_data = kzalloc_objs(*cmd->iov_data, iov_count, GFP_KERNEL); + cmd->iov_data = kzalloc_objs(*cmd->iov_data, iov_count); if (!cmd->iov_data) return -ENOMEM; @@ -1992,7 +1992,7 @@ iscsit_handle_task_mgt_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, hdr->refcmdsn = cpu_to_be32(ISCSI_RESERVED_TAG); cmd->data_direction = DMA_NONE; - cmd->tmr_req = kzalloc_obj(*cmd->tmr_req, GFP_KERNEL); + cmd->tmr_req = kzalloc_obj(*cmd->tmr_req); if (!cmd->tmr_req) { return iscsit_add_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index d6f3611c0d4b..c46c69a28e97 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c @@ -152,7 +152,7 @@ static struct iscsi_chap *chap_server_open( return NULL; } - conn->auth_protocol = kzalloc_obj(struct iscsi_chap, GFP_KERNEL); + conn->auth_protocol = kzalloc_obj(struct iscsi_chap); if (!conn->auth_protocol) return NULL; diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index 7e7193a40959..bda254a0d4ed 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c @@ -268,7 +268,7 @@ int iscsit_prepare_cmds_for_reallegiance(struct iscsit_conn *conn) * (struct iscsit_cmd->cr) so we need to allocate this before preparing the * connection's command list for connection recovery. */ - cr = kzalloc_obj(struct iscsi_conn_recovery, GFP_KERNEL); + cr = kzalloc_obj(struct iscsi_conn_recovery); if (!cr) { pr_err("Unable to allocate memory for" " struct iscsi_conn_recovery.\n"); diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 8a5a711b505b..aafc94bcb635 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -38,7 +38,7 @@ static struct iscsi_login *iscsi_login_init_conn(struct iscsit_conn *conn) { struct iscsi_login *login; - login = kzalloc_obj(struct iscsi_login, GFP_KERNEL); + login = kzalloc_obj(struct iscsi_login); if (!login) { pr_err("Unable to allocate memory for struct iscsi_login.\n"); return NULL; @@ -219,7 +219,7 @@ static int iscsi_login_zero_tsih_s1( struct iscsi_login_req *pdu = (struct iscsi_login_req *)buf; int ret; - sess = kzalloc_obj(struct iscsit_session, GFP_KERNEL); + sess = kzalloc_obj(struct iscsit_session); if (!sess) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -267,7 +267,7 @@ static int iscsi_login_zero_tsih_s1( */ atomic_set(&sess->max_cmd_sn, be32_to_cpu(pdu->cmdsn)); - sess->sess_ops = kzalloc_obj(struct iscsi_sess_ops, GFP_KERNEL); + sess->sess_ops = kzalloc_obj(struct iscsi_sess_ops); if (!sess->sess_ops) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -1002,7 +1002,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) { struct iscsit_conn *conn; - conn = kzalloc_obj(struct iscsit_conn, GFP_KERNEL); + conn = kzalloc_obj(struct iscsit_conn); if (!conn) { pr_err("Could not allocate memory for new connection\n"); return NULL; @@ -1040,7 +1040,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) if (iscsit_conn_set_transport(conn, np->np_transport) < 0) goto free_conn; - conn->conn_ops = kzalloc_obj(struct iscsi_conn_ops, GFP_KERNEL); + conn->conn_ops = kzalloc_obj(struct iscsi_conn_ops); if (!conn->conn_ops) { pr_err("Unable to allocate memory for struct iscsi_conn_ops.\n"); goto put_transport; diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index fce6c91ac157..4ed578c7b98d 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c @@ -73,7 +73,7 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para { struct iscsi_param *param = NULL; - param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); + param = kzalloc_obj(struct iscsi_param); if (!param) { pr_err("Unable to allocate memory for parameter.\n"); goto out; @@ -148,7 +148,7 @@ int iscsi_create_default_params(struct iscsi_param_list **param_list_ptr) struct iscsi_param *param = NULL; struct iscsi_param_list *pl; - pl = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); + pl = kzalloc_obj(struct iscsi_param_list); if (!pl) { pr_err("Unable to allocate memory for" " struct iscsi_param_list.\n"); @@ -519,7 +519,7 @@ int iscsi_copy_param_list( struct iscsi_param *new_param = NULL; struct iscsi_param_list *param_list = NULL; - param_list = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); + param_list = kzalloc_obj(struct iscsi_param_list); if (!param_list) { pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); return -ENOMEM; @@ -535,7 +535,7 @@ int iscsi_copy_param_list( continue; } - new_param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); + new_param = kzalloc_obj(struct iscsi_param); if (!new_param) { pr_err("Unable to allocate memory for struct iscsi_param.\n"); goto err_out; @@ -670,7 +670,7 @@ static int iscsi_add_notunderstood_response( return -1; } - extra_response = kzalloc_obj(struct iscsi_extra_response, GFP_KERNEL); + extra_response = kzalloc_obj(struct iscsi_extra_response); if (!extra_response) { pr_err("Unable to allocate memory for" " struct iscsi_extra_response.\n"); diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 82463efca798..99772364c88e 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -26,7 +26,7 @@ struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *tiqn, u1 { struct iscsi_portal_group *tpg; - tpg = kzalloc_obj(struct iscsi_portal_group, GFP_KERNEL); + tpg = kzalloc_obj(struct iscsi_portal_group); if (!tpg) { pr_err("Unable to allocate struct iscsi_portal_group\n"); return NULL; @@ -464,7 +464,7 @@ struct iscsi_tpg_np *iscsit_tpg_add_network_portal( } } - tpg_np = kzalloc_obj(struct iscsi_tpg_np, GFP_KERNEL); + tpg_np = kzalloc_obj(struct iscsi_tpg_np); if (!tpg_np) { pr_err("Unable to allocate memory for" " struct iscsi_tpg_np.\n"); diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 94e191809e1c..d668bd19fd4a 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -693,7 +693,7 @@ static int tcm_loop_make_nexus( return -EEXIST; } - tl_nexus = kzalloc_obj(*tl_nexus, GFP_KERNEL); + tl_nexus = kzalloc_obj(*tl_nexus); if (!tl_nexus) return -ENOMEM; @@ -994,7 +994,7 @@ static struct se_wwn *tcm_loop_make_scsi_hba( char *ptr; int ret, off = 0; - tl_hba = kzalloc_obj(*tl_hba, GFP_KERNEL); + tl_hba = kzalloc_obj(*tl_hba); if (!tl_hba) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index ef69c1321dd0..ad1da7edbb08 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -186,7 +186,7 @@ static struct sbp_session *sbp_session_create( snprintf(guid_str, sizeof(guid_str), "%016llx", guid); - sess = kmalloc_obj(*sess, GFP_KERNEL); + sess = kmalloc_obj(*sess); if (!sess) return ERR_PTR(-ENOMEM); @@ -391,7 +391,7 @@ static void sbp_management_request_login( 1 << LOGIN_ORB_RECONNECT(be32_to_cpu(req->orb.misc)), tport->max_reconnect_timeout) - 1; - login = kmalloc_obj(*login, GFP_KERNEL); + login = kmalloc_obj(*login); if (!login) { pr_err("failed to allocate login descriptor\n"); @@ -428,7 +428,7 @@ static void sbp_management_request_login( spin_unlock_bh(&sess->lock); already_logged_in: - response = kzalloc_obj(*response, GFP_KERNEL); + response = kzalloc_obj(*response); if (!response) { pr_err("failed to allocate login response block\n"); @@ -1014,7 +1014,7 @@ static struct sbp_target_agent *sbp_target_agent_register( struct sbp_target_agent *agent; int ret; - agent = kmalloc_obj(*agent, GFP_KERNEL); + agent = kmalloc_obj(*agent); if (!agent) return ERR_PTR(-ENOMEM); @@ -1636,7 +1636,7 @@ static struct sbp_management_agent *sbp_management_agent_register( int ret; struct sbp_management_agent *agent; - agent = kmalloc_obj(*agent, GFP_KERNEL); + agent = kmalloc_obj(*agent); if (!agent) return ERR_PTR(-ENOMEM); @@ -1973,7 +1973,7 @@ static struct se_portal_group *sbp_make_tpg(struct se_wwn *wwn, return ERR_PTR(-EBUSY); } - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return ERR_PTR(-ENOMEM); @@ -2030,7 +2030,7 @@ static struct se_wwn *sbp_make_tport( if (sbp_parse_wwn(name, &guid) < 0) return ERR_PTR(-EINVAL); - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index a63de1b6c2b4..17608ea39d5a 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -475,12 +475,12 @@ int target_register_template(const struct target_core_fabric_ops *fo) if (ret) return ret; - tf = kzalloc_obj(struct target_fabric_configfs, GFP_KERNEL); + tf = kzalloc_obj(struct target_fabric_configfs); if (!tf) { pr_err("%s: could not allocate memory!\n", __func__); return -ENOMEM; } - tfo = kzalloc_obj(struct target_core_fabric_ops, GFP_KERNEL); + tfo = kzalloc_obj(struct target_core_fabric_ops); if (!tfo) { kfree(tf); pr_err("%s: could not allocate memory!\n", __func__); diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index f082cbc79751..74c6383f9eed 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -324,7 +324,7 @@ int core_enable_device_list_for_node( struct se_dev_entry *orig, *new; int ret = 0; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) { pr_err("Unable to allocate se_dev_entry memory\n"); return -ENOMEM; @@ -591,7 +591,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl( *ret = -EOVERFLOW; return NULL; } - lacl = kzalloc_obj(struct se_lun_acl, GFP_KERNEL); + lacl = kzalloc_obj(struct se_lun_acl); if (!lacl) { pr_err("Unable to allocate memory for struct se_lun_acl.\n"); *ret = -ENOMEM; @@ -726,7 +726,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) if (!dev->stats) goto free_device; - dev->queues = kzalloc_objs(*dev->queues, nr_cpu_ids, GFP_KERNEL); + dev->queues = kzalloc_objs(*dev->queues, nr_cpu_ids); if (!dev->queues) goto free_stats; diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 69590c570859..331689b30f85 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -899,7 +899,7 @@ target_fabric_setup_tpg_base_cit(struct target_fabric_configfs *tf) nr_attrs++; /* + 1 for final NULL in the array */ - attrs = kzalloc_objs(*attrs, nr_attrs + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, nr_attrs + 1); if (!attrs) return -ENOMEM; diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 5347800a276d..80cc9196f145 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -38,7 +38,7 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id) { struct fd_host *fd_host; - fd_host = kzalloc_obj(struct fd_host, GFP_KERNEL); + fd_host = kzalloc_obj(struct fd_host); if (!fd_host) { pr_err("Unable to allocate memory for struct fd_host\n"); return -ENOMEM; @@ -73,7 +73,7 @@ static struct se_device *fd_alloc_device(struct se_hba *hba, const char *name) struct fd_dev *fd_dev; struct fd_host *fd_host = hba->hba_ptr; - fd_dev = kzalloc_obj(struct fd_dev, GFP_KERNEL); + fd_dev = kzalloc_obj(struct fd_dev); if (!fd_dev) { pr_err("Unable to allocate memory for struct fd_dev\n"); return NULL; @@ -320,7 +320,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd, loff_t pos = (cmd->t_task_lba * block_size); int ret = 0, i; - bvec = kzalloc_objs(struct bio_vec, sgl_nents, GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, sgl_nents); if (!bvec) { pr_err("Unable to allocate fd_do_readv iov[]\n"); return -ENOMEM; @@ -455,7 +455,7 @@ fd_execute_write_same(struct se_cmd *cmd) return TCM_INVALID_CDB_FIELD; } - bvec = kzalloc_objs(struct bio_vec, nolb, GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, nolb); if (!bvec) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; diff --git a/drivers/target/target_core_hba.c b/drivers/target/target_core_hba.c index deafced2c804..61c54b489b7f 100644 --- a/drivers/target/target_core_hba.c +++ b/drivers/target/target_core_hba.c @@ -39,7 +39,7 @@ int transport_backend_register(const struct target_backend_ops *ops) { struct target_backend *tb, *old; - tb = kzalloc_obj(*tb, GFP_KERNEL); + tb = kzalloc_obj(*tb); if (!tb) return -ENOMEM; tb->ops = ops; @@ -111,7 +111,7 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags) struct se_hba *hba; int ret = 0; - hba = kzalloc_obj(*hba, GFP_KERNEL); + hba = kzalloc_obj(*hba); if (!hba) { pr_err("Unable to allocate struct se_hba\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 8a333c9bd294..c50828eb844a 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -59,7 +59,7 @@ static struct se_device *iblock_alloc_device(struct se_hba *hba, const char *nam { struct iblock_dev *ib_dev = NULL; - ib_dev = kzalloc_obj(struct iblock_dev, GFP_KERNEL); + ib_dev = kzalloc_obj(struct iblock_dev); if (!ib_dev) { pr_err("Unable to allocate struct iblock_dev\n"); return NULL; @@ -523,7 +523,7 @@ iblock_execute_write_same(struct se_cmd *cmd) return 0; } - ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req); if (!ibr) goto fail; cmd->priv = ibr; @@ -783,7 +783,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, miter_dir = SG_MITER_FROM_SG; } - ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req); if (!ibr) goto fail; cmd->priv = ibr; diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 1272c24512fa..24e0667483bd 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -1490,7 +1490,7 @@ core_scsi3_decode_spec_i_port( * local_node_acl pointer and add to struct list_head tid_dest_list * for add registration processing in the loop of tid_dest_list below. */ - tidh_new = kzalloc_obj(struct pr_transport_id_holder, GFP_KERNEL); + tidh_new = kzalloc_obj(struct pr_transport_id_holder); if (!tidh_new) { pr_err("Unable to allocate tidh_new\n"); return TCM_INSUFFICIENT_REGISTRATION_RESOURCES; diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 4f86030c9ad5..9ed2818c3028 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -51,7 +51,7 @@ static int pscsi_attach_hba(struct se_hba *hba, u32 host_id) { struct pscsi_hba_virt *phv; - phv = kzalloc_obj(struct pscsi_hba_virt, GFP_KERNEL); + phv = kzalloc_obj(struct pscsi_hba_virt); if (!phv) { pr_err("Unable to allocate struct pscsi_hba_virt\n"); return -ENOMEM; @@ -247,7 +247,7 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, } pr_debug("T10 VPD Identifier Length: %d\n", ident_len); - vpd = kzalloc_obj(struct t10_vpd, GFP_KERNEL); + vpd = kzalloc_obj(struct t10_vpd); if (!vpd) { pr_err("Unable to allocate memory for" " struct t10_vpd\n"); @@ -334,7 +334,7 @@ static struct se_device *pscsi_alloc_device(struct se_hba *hba, { struct pscsi_dev_virt *pdv; - pdv = kzalloc_obj(struct pscsi_dev_virt, GFP_KERNEL); + pdv = kzalloc_obj(struct pscsi_dev_virt); if (!pdv) { pr_err("Unable to allocate memory for struct pscsi_dev_virt\n"); return NULL; diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c index 90ee036ad5ce..092d9fe0d4e3 100644 --- a/drivers/target/target_core_rd.c +++ b/drivers/target/target_core_rd.c @@ -34,7 +34,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id) { struct rd_host *rd_host; - rd_host = kzalloc_obj(*rd_host, GFP_KERNEL); + rd_host = kzalloc_obj(*rd_host); if (!rd_host) return -ENOMEM; @@ -131,7 +131,7 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table * if (sg_per_table < total_sg_needed) chain_entry = 1; - sg = kmalloc_objs(*sg, sg_per_table + chain_entry, GFP_KERNEL); + sg = kmalloc_objs(*sg, sg_per_table + chain_entry); if (!sg) return -ENOMEM; @@ -191,7 +191,7 @@ static int rd_build_device_space(struct rd_dev *rd_dev) total_sg_needed = rd_dev->rd_page_count; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables); if (!sg_table) return -ENOMEM; @@ -248,7 +248,7 @@ static int rd_build_prot_space(struct rd_dev *rd_dev, int prot_length, int block total_sg_needed = (rd_dev->rd_page_count * prot_length / block_size) + 1; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables); if (!sg_table) return -ENOMEM; @@ -271,7 +271,7 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name) struct rd_dev *rd_dev; struct rd_host *rd_host = hba->hba_ptr; - rd_dev = kzalloc_obj(*rd_dev, GFP_KERNEL); + rd_dev = kzalloc_obj(*rd_dev); if (!rd_dev) return NULL; diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index bb4eaace5e77..ccff9f6e4826 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -610,7 +610,7 @@ struct se_lun *core_tpg_alloc_lun( { struct se_lun *lun; - lun = kzalloc_obj(*lun, GFP_KERNEL); + lun = kzalloc_obj(*lun); if (!lun) { pr_err("Unable to allocate se_lun memory\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4b6899a729f7..a7330c4fedde 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -233,7 +233,7 @@ struct target_cmd_counter *target_alloc_cmd_counter(void) struct target_cmd_counter *cmd_cnt; int rc; - cmd_cnt = kzalloc_obj(*cmd_cnt, GFP_KERNEL); + cmd_cnt = kzalloc_obj(*cmd_cnt); if (!cmd_cnt) return NULL; @@ -2740,7 +2740,7 @@ void *transport_kmap_data_sg(struct se_cmd *cmd) return kmap(sg_page(sg)) + sg->offset; /* >1 page. use vmap */ - pages = kmalloc_objs(*pages, cmd->t_data_nents, GFP_KERNEL); + pages = kmalloc_objs(*pages, cmd->t_data_nents); if (!pages) return NULL; diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 062e93231794..af95531ddd35 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1582,7 +1582,7 @@ static int tcmu_attach_hba(struct se_hba *hba, u32 host_id) { struct tcmu_hba *tcmu_hba; - tcmu_hba = kzalloc_obj(struct tcmu_hba, GFP_KERNEL); + tcmu_hba = kzalloc_obj(struct tcmu_hba); if (!tcmu_hba) return -ENOMEM; @@ -1602,7 +1602,7 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name) { struct tcmu_dev *udev; - udev = kzalloc_obj(struct tcmu_dev, GFP_KERNEL); + udev = kzalloc_obj(struct tcmu_dev); if (!udev) return NULL; kref_init(&udev->kref); diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 2447b4abe2cf..9e5e94f3aa5d 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -898,7 +898,7 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) return TCM_PARAMETER_LIST_LENGTH_ERROR; } - xop = kzalloc_obj(struct xcopy_op, GFP_KERNEL); + xop = kzalloc_obj(struct xcopy_op); if (!xop) goto err; xop->xop_se_cmd = se_cmd; diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index 7643503f739c..88cf1e5a5810 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c @@ -244,7 +244,7 @@ static struct se_portal_group *ft_add_tpg(struct se_wwn *wwn, const char *name) } ft_wwn = container_of(wwn, struct ft_lport_wwn, se_wwn); - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return NULL; tpg->index = index; @@ -334,7 +334,7 @@ static struct se_wwn *ft_add_wwn( pr_debug("add wwn %s\n", name); if (ft_parse_wwn(name, &wwpn, 1) < 0) return NULL; - ft_wwn = kzalloc_obj(*ft_wwn, GFP_KERNEL); + ft_wwn = kzalloc_obj(*ft_wwn); if (!ft_wwn) return NULL; ft_wwn->wwpn = wwpn; diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 584785ada9a6..797be06ab71b 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -59,7 +59,7 @@ static struct ft_tport *ft_tport_get(struct fc_lport *lport) return tport; } - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) return NULL; @@ -219,7 +219,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id, if (sess->port_id == port_id) return sess; - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (!sess) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/tcm_remote/tcm_remote.c b/drivers/target/tcm_remote/tcm_remote.c index 480efdccbf67..03b00f6eca58 100644 --- a/drivers/target/tcm_remote/tcm_remote.c +++ b/drivers/target/tcm_remote/tcm_remote.c @@ -156,7 +156,7 @@ static struct se_wwn *tcm_remote_make_wwn( char *ptr; int ret, off = 0; - remote_hba = kzalloc_obj(*remote_hba, GFP_KERNEL); + remote_hba = kzalloc_obj(*remote_hba); if (!remote_hba) return ERR_PTR(-ENOMEM); diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c index 0cdb255f4f13..ebc835cf1b2b 100644 --- a/drivers/tc/tc.c +++ b/drivers/tc/tc.c @@ -82,7 +82,7 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus) goto out_err; /* Found a board, allocate it an entry in the list */ - tdev = kzalloc_obj(*tdev, GFP_KERNEL); + tdev = kzalloc_obj(*tdev); if (!tdev) { pr_err("tc%x: unable to allocate tc_dev\n", slot); goto out_err; diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c index 3d25cee5c7d0..441b2ceaafc3 100644 --- a/drivers/tee/amdtee/call.c +++ b/drivers/tee/amdtee/call.c @@ -134,7 +134,7 @@ static u32 get_ta_refcount(u32 ta_handle) if (ta_data->ta_handle == ta_handle) return ++ta_data->refcount; - ta_data = kzalloc_obj(*ta_data, GFP_KERNEL); + ta_data = kzalloc_obj(*ta_data); if (ta_data) { ta_data->ta_handle = ta_handle; ta_data->refcount = 1; @@ -293,7 +293,7 @@ int handle_map_shmem(u32 count, struct shmem_desc *start, u32 *buf_id) if (!count || !start || !buf_id) return -EINVAL; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c index 1ff4834722f7..a1347d04b3ac 100644 --- a/drivers/tee/amdtee/core.c +++ b/drivers/tee/amdtee/core.c @@ -38,7 +38,7 @@ static int amdtee_open(struct tee_context *ctx) { struct amdtee_context_data *ctxdata; - ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata); if (!ctxdata) return -ENOMEM; @@ -122,7 +122,7 @@ static struct amdtee_session *alloc_session(struct amdtee_context_data *ctxdata, } /* Allocate a new session and add to list */ - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (sess) { sess->ta_handle = ta_handle; kref_init(&sess->refcount); @@ -351,7 +351,7 @@ int amdtee_map_shmem(struct tee_shm *shm) if (!shm) return -EINVAL; - shmnode = kmalloc_obj(*shmnode, GFP_KERNEL); + shmnode = kmalloc_obj(*shmnode); if (!shmnode) return -ENOMEM; @@ -465,11 +465,11 @@ static int __init amdtee_driver_init(void) return rc; } - drv_data = kzalloc_obj(*drv_data, GFP_KERNEL); + drv_data = kzalloc_obj(*drv_data); if (!drv_data) return -ENOMEM; - amdtee = kzalloc_obj(*amdtee, GFP_KERNEL); + amdtee = kzalloc_obj(*amdtee); if (!amdtee) { rc = -ENOMEM; goto err_kfree_drv_data; diff --git a/drivers/tee/amdtee/shm_pool.c b/drivers/tee/amdtee/shm_pool.c index fcb0d5da4bfd..c330e8e9168a 100644 --- a/drivers/tee/amdtee/shm_pool.c +++ b/drivers/tee/amdtee/shm_pool.c @@ -59,7 +59,7 @@ static const struct tee_shm_pool_ops pool_ops = { struct tee_shm_pool *amdtee_config_shm(void) { - struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index 5fa3edd9b233..9effe88049e9 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -293,7 +293,7 @@ struct optee_msg_arg *optee_get_msg_arg(struct tee_context *ctx, /* * No entry was found, let's allocate a new. */ - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { res = ERR_PTR(-ENOMEM); goto out; @@ -404,7 +404,7 @@ int optee_open_session(struct tee_context *ctx, if (rc) goto out; - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (!sess) { rc = -ENOMEM; goto out; diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index ec07a8e1a585..a52c1f498b99 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -125,7 +125,7 @@ int optee_open(struct tee_context *ctx, bool cap_memref_null) struct tee_device *teedev = ctx->teedev; struct optee *optee = tee_get_drvdata(teedev); - ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata); if (!ctxdata) return -ENOMEM; diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c index 3f272c356ce4..bae954e79fdc 100644 --- a/drivers/tee/optee/device.c +++ b/drivers/tee/optee/device.c @@ -81,7 +81,7 @@ static int optee_register_device(const uuid_t *device_uuid, u32 func) struct tee_client_device *optee_device = NULL; int rc; - optee_device = kzalloc_obj(*optee_device, GFP_KERNEL); + optee_device = kzalloc_obj(*optee_device); if (!optee_device) return -ENOMEM; diff --git a/drivers/tee/optee/ffa_abi.c b/drivers/tee/optee/ffa_abi.c index 53ec3204b075..b4372fa268d0 100644 --- a/drivers/tee/optee/ffa_abi.c +++ b/drivers/tee/optee/ffa_abi.c @@ -78,7 +78,7 @@ static int optee_shm_add_ffa_handle(struct optee *optee, struct tee_shm *shm, struct shm_rhash *r; int rc; - r = kmalloc_obj(*r, GFP_KERNEL); + r = kmalloc_obj(*r); if (!r) return -ENOMEM; r->shm = shm; @@ -404,7 +404,7 @@ static const struct tee_shm_pool_ops pool_ffa_ops = { */ static struct tee_shm_pool *optee_ffa_shm_pool_alloc_pages(void) { - struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ static int optee_ffa_lend_protmem(struct optee *optee, struct tee_shm *protmem, unsigned int n; int rc; - mem_attr = kzalloc_objs(*mem_attr, ma_count, GFP_KERNEL); + mem_attr = kzalloc_objs(*mem_attr, ma_count); for (n = 0; n < ma_count; n++) { mem_attr[n].receiver = mem_attrs[n] & U16_MAX; mem_attr[n].attrs = mem_attrs[n] >> 16; @@ -1077,7 +1077,7 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev) if (sec_caps & OPTEE_FFA_SEC_CAP_ARG_OFFSET) arg_cache_flags |= OPTEE_SHM_ARG_SHARED; - optee = kzalloc_obj(*optee, GFP_KERNEL); + optee = kzalloc_obj(*optee); if (!optee) return -ENOMEM; diff --git a/drivers/tee/optee/notif.c b/drivers/tee/optee/notif.c index 7ce65c8a07cf..6e85f2f5c516 100644 --- a/drivers/tee/optee/notif.c +++ b/drivers/tee/optee/notif.c @@ -38,7 +38,7 @@ int optee_notif_wait(struct optee *optee, u_int key, u32 timeout) if (key > optee->notif.max_key) return -EINVAL; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; init_completion(&entry->c); diff --git a/drivers/tee/optee/protmem.c b/drivers/tee/optee/protmem.c index 086df220f758..be3abf6e8aa6 100644 --- a/drivers/tee/optee/protmem.c +++ b/drivers/tee/optee/protmem.c @@ -294,7 +294,7 @@ struct tee_protmem_pool *optee_protmem_alloc_dyn_pool(struct optee *optee, u_int pa_width; int rc; - rp = kzalloc_obj(*rp, GFP_KERNEL); + rp = kzalloc_obj(*rp); if (!rp) return ERR_PTR(-ENOMEM); rp->use_case = id; diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index ef80f668a6bc..b0ed4cb49452 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c @@ -55,7 +55,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, return; } - params = kmalloc_objs(struct tee_param, arg->num_params, GFP_KERNEL); + params = kmalloc_objs(struct tee_param, arg->num_params); if (!params) { arg->ret = TEEC_ERROR_OUT_OF_MEMORY; return; @@ -191,7 +191,7 @@ static void handle_rpc_supp_cmd(struct tee_context *ctx, struct optee *optee, arg->ret_origin = TEEC_ORIGIN_COMMS; - params = kmalloc_objs(struct tee_param, arg->num_params, GFP_KERNEL); + params = kmalloc_objs(struct tee_param, arg->num_params); if (!params) { arg->ret = TEEC_ERROR_OUT_OF_MEMORY; return; diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c index 3d33b8d6af37..b8a2bdac3208 100644 --- a/drivers/tee/optee/smc_abi.c +++ b/drivers/tee/optee/smc_abi.c @@ -626,7 +626,7 @@ static const struct tee_shm_pool_ops pool_ops = { */ static struct tee_shm_pool *optee_shm_pool_alloc_pages(void) { - struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); @@ -1816,7 +1816,7 @@ static int optee_probe(struct platform_device *pdev) if (IS_ERR(pool)) return PTR_ERR(pool); - optee = kzalloc_obj(*optee, GFP_KERNEL); + optee = kzalloc_obj(*optee); if (!optee) { rc = -ENOMEM; goto err_free_shm_pool; diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c index 3562cb80a95a..a3d11b1f90fa 100644 --- a/drivers/tee/optee/supp.c +++ b/drivers/tee/optee/supp.c @@ -89,7 +89,7 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, if (!supp->ctx && ctx->supp_nowait) return TEEC_ERROR_COMMUNICATION; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return TEEC_ERROR_OUT_OF_MEMORY; diff --git a/drivers/tee/qcomtee/call.c b/drivers/tee/qcomtee/call.c index cd138adb5e17..ba9af41ec8b5 100644 --- a/drivers/tee/qcomtee/call.c +++ b/drivers/tee/qcomtee/call.c @@ -707,7 +707,7 @@ static int qcomtee_probe(struct platform_device *pdev) struct qcomtee *qcomtee; int err; - qcomtee = kzalloc_obj(*qcomtee, GFP_KERNEL); + qcomtee = kzalloc_obj(*qcomtee); if (!qcomtee) return -ENOMEM; diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c index ab477bbc8439..b1cb50e434f0 100644 --- a/drivers/tee/qcomtee/core.c +++ b/drivers/tee/qcomtee/core.c @@ -54,7 +54,7 @@ qcomtee_qtee_object_alloc(struct qcomtee_object_invoke_ctx *oic, struct qcomtee *qcomtee = tee_get_drvdata(oic->ctx->teedev); struct qcomtee_object *object; - object = kzalloc_obj(*object, GFP_KERNEL); + object = kzalloc_obj(*object); if (!object) return NULL_QCOMTEE_OBJECT; diff --git a/drivers/tee/qcomtee/qcomtee_object.h b/drivers/tee/qcomtee/qcomtee_object.h index d763f90c62bb..8b4401ecad48 100644 --- a/drivers/tee/qcomtee/qcomtee_object.h +++ b/drivers/tee/qcomtee/qcomtee_object.h @@ -176,7 +176,7 @@ qcomtee_object_invoke_ctx_alloc(struct tee_context *ctx) { struct qcomtee_object_invoke_ctx *oic; - oic = kzalloc_obj(*oic, GFP_KERNEL); + oic = kzalloc_obj(*oic); if (oic) oic->ctx = ctx; return oic; diff --git a/drivers/tee/qcomtee/shm.c b/drivers/tee/qcomtee/shm.c index 7bef13767e25..b67909ef3f46 100644 --- a/drivers/tee/qcomtee/shm.c +++ b/drivers/tee/qcomtee/shm.c @@ -140,7 +140,7 @@ struct tee_shm_pool *qcomtee_shm_pool_alloc(void) { struct tee_shm_pool *pool; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/qcomtee/user_obj.c b/drivers/tee/qcomtee/user_obj.c index d19c6589574a..10452fcc7ccb 100644 --- a/drivers/tee/qcomtee/user_obj.c +++ b/drivers/tee/qcomtee/user_obj.c @@ -326,7 +326,7 @@ static void qcomtee_user_object_release(struct qcomtee_object *object) if (!uo->notify) goto out_no_notify; - ureq = kzalloc_obj(*ureq, GFP_KERNEL); + ureq = kzalloc_obj(*ureq); if (!ureq) goto out_no_notify; @@ -370,7 +370,7 @@ int qcomtee_user_param_to_object(struct qcomtee_object **object, int err; struct qcomtee_user_object *user_object __free(kfree) = - kzalloc_obj(*user_object, GFP_KERNEL); + kzalloc_obj(*user_object); if (!user_object) return -ENOMEM; diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 29df8cd1efd2..3dafbdc8d2c2 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -51,7 +51,7 @@ struct tee_context *teedev_open(struct tee_device *teedev) if (!tee_device_get(teedev)) return ERR_PTR(-EINVAL); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto err; @@ -844,7 +844,7 @@ static int tee_ioctl_supp_recv(struct tee_context *ctx, if (size_add(sizeof(*uarg), TEE_IOCTL_PARAM_SIZE(num_params)) != buf.buf_len) return -EINVAL; - params = kzalloc_objs(struct tee_param, num_params, GFP_KERNEL); + params = kzalloc_objs(struct tee_param, num_params); if (!params) return -ENOMEM; @@ -958,7 +958,7 @@ static int tee_ioctl_supp_send(struct tee_context *ctx, if (size_add(sizeof(*uarg), TEE_IOCTL_PARAM_SIZE(num_params)) > buf.buf_len) return -EINVAL; - params = kzalloc_objs(struct tee_param, num_params, GFP_KERNEL); + params = kzalloc_objs(struct tee_param, num_params); if (!params) return -ENOMEM; @@ -1052,7 +1052,7 @@ struct tee_device *tee_device_alloc(const struct tee_desc *teedesc, !teedesc->ops->release) return ERR_PTR(-EINVAL); - teedev = kzalloc_obj(*teedev, GFP_KERNEL); + teedev = kzalloc_obj(*teedev); if (!teedev) { ret = ERR_PTR(-ENOMEM); goto err; diff --git a/drivers/tee/tee_heap.c b/drivers/tee/tee_heap.c index 71e50d9573c7..007c00156520 100644 --- a/drivers/tee/tee_heap.c +++ b/drivers/tee/tee_heap.c @@ -94,7 +94,7 @@ static int tee_heap_attach(struct dma_buf *dmabuf, struct tee_heap_attachment *a; int ret; - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) return -ENOMEM; @@ -188,7 +188,7 @@ static struct dma_buf *tee_dma_heap_alloc(struct dma_heap *heap, if (!teedev) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) { dmabuf = ERR_PTR(-ENOMEM); goto err; @@ -260,7 +260,7 @@ static int alloc_dma_heap(struct tee_device *teedev, enum tee_dma_heap_id id, return -ENOMEM; } - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return -ENOMEM; h->id = id; @@ -472,7 +472,7 @@ struct tee_protmem_pool *tee_protmem_static_pool_alloc(phys_addr_t paddr, if (!pfn_valid(PHYS_PFN(paddr))) return ERR_PTR(-EINVAL); - stp = kzalloc_obj(*stp, GFP_KERNEL); + stp = kzalloc_obj(*stp); if (!stp) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index 1ed278fc9e4a..6c5b9e352e5e 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -106,7 +106,7 @@ static struct tee_shm *shm_alloc_helper(struct tee_context *ctx, size_t size, goto err_dev_put; } - shm = kzalloc_obj(*shm, GFP_KERNEL); + shm = kzalloc_obj(*shm); if (!shm) { ret = ERR_PTR(-ENOMEM); goto err_dev_put; @@ -214,7 +214,7 @@ struct tee_shm *tee_shm_register_fd(struct tee_context *ctx, int fd) teedev_ctx_get(ctx); - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) { rc = -ENOMEM; goto err_put_tee; @@ -315,7 +315,7 @@ struct tee_shm *tee_shm_alloc_dma_mem(struct tee_context *ctx, if (!page) goto err_put_teedev; - dma_mem = kzalloc_obj(*dma_mem, GFP_KERNEL); + dma_mem = kzalloc_obj(*dma_mem); if (!dma_mem) goto err_free_pages; @@ -373,7 +373,7 @@ int tee_dyn_shm_alloc_helper(struct tee_shm *shm, size_t size, size_t align, shm->paddr = virt_to_phys(shm->kaddr); shm->size = nr_pages * PAGE_SIZE; - pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages); if (!pages) { rc = -ENOMEM; goto err_pages; @@ -438,7 +438,7 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags, teedev_ctx_get(ctx); - shm = kzalloc_obj(*shm, GFP_KERNEL); + shm = kzalloc_obj(*shm); if (!shm) { ret = ERR_PTR(-ENOMEM); goto err_ctx_put; @@ -456,7 +456,7 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags, goto err_ctx_put; } - shm->pages = kzalloc_objs(*shm->pages, num_pages, GFP_KERNEL); + shm->pages = kzalloc_objs(*shm->pages, num_pages); if (!shm->pages) { ret = ERR_PTR(-ENOMEM); goto err_free_shm; diff --git a/drivers/tee/tee_shm_pool.c b/drivers/tee/tee_shm_pool.c index fc82c689c29e..1a2a7f47e30f 100644 --- a/drivers/tee/tee_shm_pool.c +++ b/drivers/tee/tee_shm_pool.c @@ -65,7 +65,7 @@ struct tee_shm_pool *tee_shm_pool_alloc_res_mem(unsigned long vaddr, if (vaddr & page_mask || paddr & page_mask || size & page_mask) return ERR_PTR(-EINVAL); - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/drivers/tee/tstee/core.c b/drivers/tee/tstee/core.c index 4a4aa2bc5ab6..79ae5d161638 100644 --- a/drivers/tee/tstee/core.c +++ b/drivers/tee/tstee/core.c @@ -59,7 +59,7 @@ static int tstee_open(struct tee_context *ctx) { struct ts_context_data *ctxdata; - ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata); if (!ctxdata) return -ENOMEM; @@ -122,7 +122,7 @@ static int tstee_open_session(struct tee_context *ctx, if (ffa_args[TS_RPC_SERVICE_INFO_IFACE] > U8_MAX) return -EINVAL; - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (!sess) return -ENOMEM; @@ -376,7 +376,7 @@ static const struct tee_shm_pool_ops pool_ops = { static struct tee_shm_pool *tstee_create_shm_pool(void) { - struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); @@ -414,7 +414,7 @@ static int tstee_probe(struct ffa_device *ffa_dev) if (!tstee_check_rpc_compatible(ffa_dev)) return -EINVAL; - tstee = kzalloc_obj(*tstee, GFP_KERNEL); + tstee = kzalloc_obj(*tstee); if (!tstee) return -ENOMEM; diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index d0bb782ff734..3b85f077c364 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -542,7 +542,7 @@ __cpufreq_cooling_register(struct device_node *np, return ERR_PTR(-ENODEV); } - cpufreq_cdev = kzalloc_obj(*cpufreq_cdev, GFP_KERNEL); + cpufreq_cdev = kzalloc_obj(*cpufreq_cdev); if (!cpufreq_cdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/cpuidle_cooling.c b/drivers/thermal/cpuidle_cooling.c index 5a16d4e7e698..425f596614e8 100644 --- a/drivers/thermal/cpuidle_cooling.c +++ b/drivers/thermal/cpuidle_cooling.c @@ -179,7 +179,7 @@ static int __cpuidle_cooling_register(struct device_node *np, char *name; int ret; - idle_cdev = kzalloc_obj(*idle_cdev, GFP_KERNEL); + idle_cdev = kzalloc_obj(*idle_cdev); if (!idle_cdev) { ret = -ENOMEM; goto out; diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index 72fb23de5f55..597e86d16a4e 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -402,7 +402,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, int err, num_opps; - dfc = kzalloc_obj(*dfc, GFP_KERNEL); + dfc = kzalloc_obj(*dfc); if (!dfc) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 696932ecb489..37f2e22a999e 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -622,7 +622,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params, goto clean_state; } - params->power = kzalloc_objs(struct power_actor, num_actors, GFP_KERNEL); + params->power = kzalloc_objs(struct power_actor, num_actors); if (!params->power) { ret = -ENOMEM; goto clean_state; @@ -698,7 +698,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) struct power_allocator_params *params; int ret; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -719,7 +719,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) } if (!tz->tzp) { - tz->tzp = kzalloc_obj(*tz->tzp, GFP_KERNEL); + tz->tzp = kzalloc_obj(*tz->tzp); if (!tz->tzp) { ret = -ENOMEM; goto free_params; diff --git a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c index d1876e76167a..0a548fdc4a7e 100644 --- a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c @@ -89,7 +89,7 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp, } *trt_count = p->package.count; - trts = kzalloc_objs(struct trt, *trt_count, GFP_KERNEL); + trts = kzalloc_objs(struct trt, *trt_count); if (!trts) { result = -ENOMEM; goto end; @@ -165,7 +165,7 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp, /* ignore p->package.elements[0], as this is _ART Revision field */ *art_count = p->package.count - 1; - arts = kzalloc_objs(struct art, *art_count, GFP_KERNEL); + arts = kzalloc_objs(struct art, *art_count); if (!arts) { result = -ENOMEM; goto end; @@ -253,7 +253,7 @@ static int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **ps goto end; } - psvts = kzalloc_objs(*psvts, *psvt_count, GFP_KERNEL); + psvts = kzalloc_objs(*psvts, *psvt_count); if (!psvts) { result = -ENOMEM; goto end; diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 3a97718e2f5c..6742eaf0a447 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -382,7 +382,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv) if (priv->odvp == NULL) { priv->odvp_count = obj->package.count; - priv->odvp = kmalloc_objs(int, priv->odvp_count, GFP_KERNEL); + priv->odvp = kmalloc_objs(int, priv->odvp_count); if (!priv->odvp) { ret = -ENOMEM; goto out_err; @@ -561,7 +561,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) if (!adev) return -ENODEV; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index 7db8fd86c4fd..4c8888fb0a8b 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -123,7 +123,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, acpi_status status; int i, ret; - int34x_zone = kzalloc_obj(*int34x_zone, GFP_KERNEL); + int34x_zone = kzalloc_obj(*int34x_zone); if (!int34x_zone) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index 5100ad1336ed..35df0fd5562f 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -212,7 +212,7 @@ static void update_capabilities(struct hfi_instance *hfi_instance) if (!cpu_count) goto out; - cpu_caps = kzalloc_objs(*cpu_caps, cpu_count, GFP_KERNEL); + cpu_caps = kzalloc_objs(*cpu_caps, cpu_count); if (!cpu_caps) goto out; diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c index 38a0ae14b69d..15476699bdda 100644 --- a/drivers/thermal/intel/intel_quark_dts_thermal.c +++ b/drivers/thermal/intel/intel_quark_dts_thermal.c @@ -336,7 +336,7 @@ static struct soc_sensor_entry *alloc_soc_dts(void) int err; u32 out; - aux_entry = kzalloc_obj(*aux_entry, GFP_KERNEL); + aux_entry = kzalloc_obj(*aux_entry); if (!aux_entry) { err = -ENOMEM; return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index 78123107ac06..93773878398e 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -320,7 +320,7 @@ intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type, if (tj_max < 0) return ERR_PTR(tj_max); - sensors = kzalloc_obj(*sensors, GFP_KERNEL); + sensors = kzalloc_obj(*sensors); if (!sensors) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c index 64cc0361d440..540109761f0a 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -335,7 +335,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) return tj_max; tj_max *= 1000; - zonedev = kzalloc_obj(*zonedev, GFP_KERNEL); + zonedev = kzalloc_obj(*zonedev); if (!zonedev) return -ENOMEM; @@ -492,7 +492,7 @@ static int __init pkg_temp_thermal_init(void) return -ENODEV; max_id = topology_max_packages() * topology_max_dies_per_package(); - zones = kzalloc_objs(struct zone_device *, max_id, GFP_KERNEL); + zones = kzalloc_objs(struct zone_device *, max_id); if (!zones) return -ENOMEM; diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 138a8137f790..6aba00d8b8fd 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -462,7 +462,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) goto err_alloc; } - ref_table = kzalloc_objs(*ref_table, TABLE_SIZE, GFP_KERNEL); + ref_table = kzalloc_objs(*ref_table, TABLE_SIZE); if (!ref_table) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index daaba832b2a0..f0b2a2a340a3 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -844,7 +844,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz, if (cool_spec->lower > cool_spec->upper || cool_spec->upper > cdev->max_state) return -EINVAL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -1070,7 +1070,7 @@ __thermal_cooling_device_register(struct device_node *np, if (!thermal_class) return ERR_PTR(-ENODEV); - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return ERR_PTR(-ENOMEM); @@ -1899,7 +1899,7 @@ static int __init thermal_init(void) if (result) goto unregister_netlink; - thermal_class = kzalloc_obj(*thermal_class, GFP_KERNEL); + thermal_class = kzalloc_obj(*thermal_class); if (!thermal_class) { result = -ENOMEM; goto unregister_governors; diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index 19b050cb4f70..d1b5a09ed684 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -193,7 +193,7 @@ static struct thermal_debugfs *thermal_debugfs_add_id(struct dentry *d, int id) struct thermal_debugfs *thermal_dbg; char ids[IDSLENGTH]; - thermal_dbg = kzalloc_obj(*thermal_dbg, GFP_KERNEL); + thermal_dbg = kzalloc_obj(*thermal_dbg); if (!thermal_dbg) return NULL; @@ -226,7 +226,7 @@ thermal_debugfs_cdev_record_alloc(struct thermal_debugfs *thermal_dbg, { struct cdev_record *cdev_record; - cdev_record = kzalloc_obj(*cdev_record, GFP_KERNEL); + cdev_record = kzalloc_obj(*cdev_record); if (!cdev_record) return NULL; @@ -876,7 +876,7 @@ void thermal_debug_tz_add(struct thermal_zone_device *tz) tz_dbg->tz = tz; - tz_dbg->trips_crossed = kzalloc_objs(int, tz->num_trips, GFP_KERNEL); + tz_dbg->trips_crossed = kzalloc_objs(int, tz->num_trips); if (!tz_dbg->trips_crossed) { thermal_debugfs_remove_id(thermal_dbg); return; diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index f377175b2663..b624892bc6d6 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -145,7 +145,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) goto register_sys_interface; } - hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); + hwmon = kzalloc_obj(*hwmon); if (!hwmon) return -ENOMEM; @@ -160,7 +160,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) } register_sys_interface: - temp = kzalloc_obj(*temp, GFP_KERNEL); + temp = kzalloc_obj(*temp); if (!temp) { result = -ENOMEM; goto unregister_name; diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 057460b2e7bb..46b3b2df935c 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -392,7 +392,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz) struct attribute **attrs; int i; - attrs = kzalloc_objs(*attrs, tz->num_trips * 3 + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, tz->num_trips * 3 + 1); if (!attrs) return -ENOMEM; @@ -465,7 +465,7 @@ int thermal_zone_create_device_groups(struct thermal_zone_device *tz) /* we need one extra for trips and the NULL to terminate the array */ size = ARRAY_SIZE(thermal_zone_attribute_groups) + 2; /* This also takes care of API requirement to be NULL terminated */ - groups = kzalloc_objs(*groups, size, GFP_KERNEL); + groups = kzalloc_objs(*groups, size); if (!groups) return -ENOMEM; diff --git a/drivers/thermal/thermal_thresholds.c b/drivers/thermal/thermal_thresholds.c index 421ddf907b6d..970b8fd33847 100644 --- a/drivers/thermal/thermal_thresholds.c +++ b/drivers/thermal/thermal_thresholds.c @@ -181,7 +181,7 @@ int thermal_thresholds_add(struct thermal_zone_device *tz, t->direction |= direction; } else { - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) return -ENOMEM; diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 3108727c4ef2..b2fd60fc7bcc 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -89,7 +89,7 @@ struct tb_cfg_request *tb_cfg_request_alloc(void) { struct tb_cfg_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; @@ -333,7 +333,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg) static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl) { - struct ctl_pkg *pkg = kzalloc_obj(*pkg, GFP_KERNEL); + struct ctl_pkg *pkg = kzalloc_obj(*pkg); if (!pkg) return NULL; pkg->ctl = ctl; @@ -654,7 +654,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, int index, int timeout_msec, event_cb cb, void *cb_data) { int i; - struct tb_ctl *ctl = kzalloc_obj(*ctl, GFP_KERNEL); + struct tb_ctl *ctl = kzalloc_obj(*ctl); if (!ctl) return NULL; diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index 7e2a59dddbbd..042f6a0d0f7f 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -1657,7 +1657,7 @@ static struct tb_margining *margining_alloc(struct tb_port *port, return NULL; } - margining = kzalloc_obj(*margining, GFP_KERNEL); + margining = kzalloc_obj(*margining); if (!margining) return NULL; diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c index ddbf5f9971fb..334fefe21255 100644 --- a/drivers/thunderbolt/dma_port.c +++ b/drivers/thunderbolt/dma_port.c @@ -209,7 +209,7 @@ struct tb_dma_port *dma_port_alloc(struct tb_switch *sw) if (port < 0) return NULL; - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) return NULL; diff --git a/drivers/thunderbolt/dma_test.c b/drivers/thunderbolt/dma_test.c index 8298f25ef6bd..b4aa79d482a0 100644 --- a/drivers/thunderbolt/dma_test.c +++ b/drivers/thunderbolt/dma_test.c @@ -267,7 +267,7 @@ static int dma_test_submit_rx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc_obj(*tf, GFP_KERNEL); + tf = kzalloc_obj(*tf); if (!tf) return -ENOMEM; @@ -318,7 +318,7 @@ static int dma_test_submit_tx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc_obj(*tf, GFP_KERNEL); + tf = kzalloc_obj(*tf); if (!tf) return -ENOMEM; diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 1e7268e26fc2..317780b99992 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -126,7 +126,7 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr, ssize_t ret; int i; - uuids = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); + uuids = kzalloc_objs(uuid_t, tb->nboot_acl); if (!uuids) return -ENOMEM; @@ -181,7 +181,7 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr, if (!str) return -ENOMEM; - acl = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); + acl = kzalloc_objs(uuid_t, tb->nboot_acl); if (!acl) { ret = -ENOMEM; goto err_free_str; diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index fda1471c7ef8..9d95bf3ab44c 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -427,7 +427,7 @@ static int icm_fr_get_route(struct tb *tb, u8 link, u8 depth, u64 *route) int ret, index; u8 i; - switches = kzalloc_objs(*switches, npackets, GFP_KERNEL); + switches = kzalloc_objs(*switches, npackets); if (!switches) return -ENOMEM; @@ -1769,7 +1769,7 @@ static void icm_handle_event(struct tb *tb, enum tb_cfg_pkg_type type, { struct icm_notification *n; - n = kmalloc_obj(*n, GFP_KERNEL); + n = kmalloc_obj(*n); if (!n) return; @@ -2246,7 +2246,7 @@ static int icm_usb4_switch_nvm_authenticate(struct tb *tb, u64 route) struct tb_cfg_request *req; int ret; - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) return -ENOMEM; diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 6431c411fb17..ccce020a2432 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -587,7 +587,7 @@ static struct tb_ring *tb_ring_alloc(struct tb_nhi *nhi, u32 hop, int size, dev_dbg(&nhi->pdev->dev, "allocating %s ring %d of size %d\n", transmit ? "TX" : "RX", hop, size); - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) return NULL; diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index ac9c5504cfc1..3dfa70ea6570 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -330,7 +330,7 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev) return ERR_PTR(-EOPNOTSUPP); } - nvm = kzalloc_obj(*nvm, GFP_KERNEL); + nvm = kzalloc_obj(*nvm); if (!nvm) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c index 88311c6e599b..22fb4a1e1acd 100644 --- a/drivers/thunderbolt/path.c +++ b/drivers/thunderbolt/path.c @@ -150,7 +150,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, num_hops++; } - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) return NULL; @@ -160,7 +160,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, path->activated = true; path->alloc_hopid = alloc_hopid; - path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops); if (!path->hops) { kfree(path); return NULL; @@ -245,7 +245,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, size_t num_hops; int i, ret; - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) return NULL; @@ -267,7 +267,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, /* Each hop takes two ports */ num_hops = i / 2; - path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops); if (!path->hops) { kfree(path); return NULL; diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index a274c02d71c0..50cbfc92fe65 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -81,7 +81,7 @@ tb_property_alloc(const char *key, enum tb_property_type type) { struct tb_property *property; - property = kzalloc_obj(*property, GFP_KERNEL); + property = kzalloc_obj(*property); if (!property) return NULL; @@ -166,7 +166,7 @@ static struct tb_property_dir *__tb_property_parse_dir(const u32 *block, unsigned int content_offset; struct tb_property_dir *dir; - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return NULL; @@ -247,7 +247,7 @@ struct tb_property_dir *tb_property_create_dir(const uuid_t *uuid) { struct tb_property_dir *dir; - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return NULL; diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index b95f5c19cca5..b1e8d9d6454d 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -410,7 +410,7 @@ static int tb_retimer_add(struct tb_port *port, u8 index, u32 auth_status, } - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return -ENOMEM; diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 90d62141ecd8..b86ccb5b53fd 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -69,7 +69,7 @@ static void nvm_set_auth_status(const struct tb_switch *sw, u32 status) st = __nvm_get_auth_status(sw); if (!st) { - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) goto unlock; @@ -2475,7 +2475,7 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, if (upstream_port < 0) return ERR_PTR(upstream_port); - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); @@ -2577,7 +2577,7 @@ tb_switch_alloc_safe_mode(struct tb *tb, struct device *parent, u64 route) { struct tb_switch *sw; - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 4c3b2d48c4a0..c69c323e6952 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -94,7 +94,7 @@ static void tb_queue_hotplug(struct tb *tb, u64 route, u8 port, bool unplug) { struct tb_hotplug_event *ev; - ev = kmalloc_obj(*ev, GFP_KERNEL); + ev = kmalloc_obj(*ev); if (!ev) return; @@ -2862,7 +2862,7 @@ static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port, { struct tb_hotplug_event *ev; - ev = kmalloc_obj(*ev, GFP_KERNEL); + ev = kmalloc_obj(*ev); if (!ev) return; diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index 2d537ada98e1..89676acf1290 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -180,11 +180,11 @@ static struct tb_tunnel *tb_tunnel_alloc(struct tb *tb, size_t npaths, { struct tb_tunnel *tunnel; - tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel); if (!tunnel) return NULL; - tunnel->paths = kzalloc_objs(tunnel->paths[0], npaths, GFP_KERNEL); + tunnel->paths = kzalloc_objs(tunnel->paths[0], npaths); if (!tunnel->paths) { kfree(tunnel); return NULL; diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c index 642822b58b42..c32d3516e780 100644 --- a/drivers/thunderbolt/usb4_port.c +++ b/drivers/thunderbolt/usb4_port.c @@ -305,7 +305,7 @@ struct usb4_port *usb4_port_device_add(struct tb_port *port) struct usb4_port *usb4; int ret; - usb4 = kzalloc_obj(*usb4, GFP_KERNEL); + usb4 = kzalloc_obj(*usb4); if (!usb4) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 384afd16af72..754808c43f00 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -858,7 +858,7 @@ tb_xdp_schedule_request(struct tb *tb, const struct tb_xdp_header *hdr, { struct xdomain_request_work *xw; - xw = kmalloc_obj(*xw, GFP_KERNEL); + xw = kmalloc_obj(*xw); if (!xw) return false; @@ -1094,7 +1094,7 @@ static void enumerate_services(struct tb_xdomain *xd) continue; } - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) break; @@ -1974,7 +1974,7 @@ struct tb_xdomain *tb_xdomain_alloc(struct tb *tb, struct device *parent, down = tb_port_at(route, parent_sw); tb_port_unlock(down); - xd = kzalloc_obj(*xd, GFP_KERNEL); + xd = kzalloc_obj(*xd); if (!xd) return NULL; diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index 2cbbaed14ee6..2b3ca9f6bf07 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -772,7 +772,7 @@ static int __init ehv_bc_init(void) * array, then you can use pointer math (e.g. "bc - bcs") to get its * tty index. */ - bcs = kzalloc_objs(struct ehv_bc_data, count, GFP_KERNEL); + bcs = kzalloc_objs(struct ehv_bc_data, count); if (!bcs) return -ENOMEM; diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c index 7fd3937d1396..1dcdb9e99bd8 100644 --- a/drivers/tty/hvc/hvc_iucv.c +++ b/drivers/tty/hvc/hvc_iucv.c @@ -1050,7 +1050,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console) char name[9]; int rc; - priv = kzalloc_obj(struct hvc_iucv_private, GFP_KERNEL); + priv = kzalloc_obj(struct hvc_iucv_private); if (!priv) return -ENOMEM; diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 72dfab77890c..402da9e7c534 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -181,7 +181,7 @@ static int hvc_opal_probe(struct platform_device *dev) pv = hvc_opal_privs[termno]; boot = 1; } else if (hvc_opal_privs[termno] == NULL) { - pv = kzalloc_obj(struct hvc_opal_priv, GFP_KERNEL); + pv = kzalloc_obj(struct hvc_opal_priv); if (!pv) return -ENOMEM; pv->proto = proto; diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 8725cc77c557..14c6a5564617 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -338,7 +338,7 @@ static int hvc_vio_probe(struct vio_dev *vdev, pr_devel("->non-boot console, using termno %d\n", termno); if (termno < 0) return -ENODEV; - pv = kzalloc_obj(struct hvterm_priv, GFP_KERNEL); + pv = kzalloc_obj(struct hvterm_priv); if (!pv) return -ENOMEM; pv->termno = vdev->unit_address; diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 138afdf3bbc4..7f0b6262488c 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -264,7 +264,7 @@ static int xen_hvm_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc_obj(struct xencons_info, GFP_KERNEL); + info = kzalloc_obj(struct xencons_info); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); @@ -328,7 +328,7 @@ static int xen_pv_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc_obj(struct xencons_info, GFP_KERNEL); + info = kzalloc_obj(struct xencons_info); if (!info) return -ENOMEM; } else if (info->intf != NULL) { @@ -352,7 +352,7 @@ static int xen_initial_domain_console_init(void) info = vtermno_to_xencons(HVC_COOKIE); if (!info) { - info = kzalloc_obj(struct xencons_info, GFP_KERNEL); + info = kzalloc_obj(struct xencons_info); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); @@ -513,7 +513,7 @@ static int xencons_probe(struct xenbus_device *dev, if (devid == 0) return -ENODEV; - info = kzalloc_obj(struct xencons_info, GFP_KERNEL); + info = kzalloc_obj(struct xencons_info); if (!info) return -ENOMEM; spin_lock_init(&info->ring_lock); diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 7ff3c87354b8..d32b1e3c50bf 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -748,7 +748,7 @@ static int hvcs_probe( return -EFAULT; } - hvcsd = kzalloc_obj(*hvcsd, GFP_KERNEL); + hvcsd = kzalloc_obj(*hvcsd); if (!hvcsd) return -ENODEV; @@ -1394,7 +1394,7 @@ static int hvcs_alloc_index_list(int n) { int i; - hvcs_index_list = kmalloc_objs(hvcs_index_count, n, GFP_KERNEL); + hvcs_index_list = kmalloc_objs(hvcs_index_count, n); if (!hvcs_index_list) return -ENOMEM; hvcs_index_count = n; diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c index 6e6aa90b33ba..0bfcbca6e2df 100644 --- a/drivers/tty/ipwireless/hardware.c +++ b/drivers/tty/ipwireless/hardware.c @@ -1618,7 +1618,7 @@ struct ipw_hardware *ipwireless_hardware_create(void) { int i; struct ipw_hardware *hw = - kzalloc_obj(struct ipw_hardware, GFP_KERNEL); + kzalloc_obj(struct ipw_hardware); if (!hw) return NULL; diff --git a/drivers/tty/ipwireless/main.c b/drivers/tty/ipwireless/main.c index 3bf160d62a1e..a2875823290e 100644 --- a/drivers/tty/ipwireless/main.c +++ b/drivers/tty/ipwireless/main.c @@ -267,7 +267,7 @@ static int ipwireless_attach(struct pcmcia_device *link) struct ipw_dev *ipw; int ret; - ipw = kzalloc_obj(struct ipw_dev, GFP_KERNEL); + ipw = kzalloc_obj(struct ipw_dev); if (!ipw) return -ENOMEM; diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c index cb864142be09..ad2c5157a018 100644 --- a/drivers/tty/ipwireless/network.c +++ b/drivers/tty/ipwireless/network.c @@ -257,7 +257,7 @@ static void do_go_online(struct work_struct *work_go_online) struct ppp_channel *channel; spin_unlock_irqrestore(&network->lock, flags); - channel = kzalloc_obj(struct ppp_channel, GFP_KERNEL); + channel = kzalloc_obj(struct ppp_channel); if (!channel) { printk(KERN_ERR IPWIRELESS_PCCARD_NAME ": unable to allocate PPP channel\n"); @@ -416,7 +416,7 @@ void ipwireless_network_packet_received(struct ipw_network *network, struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw) { struct ipw_network *network = - kzalloc_obj(struct ipw_network, GFP_KERNEL); + kzalloc_obj(struct ipw_network); if (!network) return NULL; diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index 79c01ff49c65..ffdbcdd041a3 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c @@ -437,7 +437,7 @@ static int add_tty(int j, struct ipw_network *network, int channel_idx, int secondary_channel_idx, int tty_type) { - ttys[j] = kzalloc_obj(struct ipw_tty, GFP_KERNEL); + ttys[j] = kzalloc_obj(struct ipw_tty); if (!ttys[j]) return -ENOMEM; ttys[j]->index = j; diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 815e35a24af9..c13e050de83b 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3275,7 +3275,7 @@ static inline unsigned int mux_line_to_num(unsigned int line) static struct gsm_mux *gsm_alloc_mux(void) { int i; - struct gsm_mux *gsm = kzalloc_obj(struct gsm_mux, GFP_KERNEL); + struct gsm_mux *gsm = kzalloc_obj(struct gsm_mux); if (gsm == NULL) return NULL; gsm->buf = kmalloc(MAX_MRU + 1, GFP_KERNEL); diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index 6c685a6d4ddb..bf827ae3e5c8 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -686,7 +686,7 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count, */ static struct n_hdlc *n_hdlc_alloc(void) { - struct n_hdlc *n_hdlc = kzalloc_obj(*n_hdlc, GFP_KERNEL); + struct n_hdlc *n_hdlc = kzalloc_obj(*n_hdlc); if (!n_hdlc) return NULL; diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index b05f4a8553ac..ed99dbc9f990 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c @@ -1298,7 +1298,7 @@ static int nozomi_card_init(struct pci_dev *pdev, goto err; } - dc = kzalloc_obj(struct nozomi, GFP_KERNEL); + dc = kzalloc_obj(struct nozomi); if (unlikely(!dc)) { dev_err(&pdev->dev, "Could not allocate memory\n"); ret = -ENOMEM; diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index ce58997dae93..cb427e93372d 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -364,8 +364,8 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty, if (driver->subtype != PTY_TYPE_MASTER) return -EIO; - ports[0] = kmalloc_obj(**ports, GFP_KERNEL); - ports[1] = kmalloc_obj(**ports, GFP_KERNEL); + ports[0] = kmalloc_obj(**ports); + ports[1] = kmalloc_obj(**ports); if (!ports[0] || !ports[1]) goto err; if (!try_module_get(driver->other->owner)) { diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c index 6ada8e92bbf2..c5fd6d9b380f 100644 --- a/drivers/tty/rpmsg_tty.c +++ b/drivers/tty/rpmsg_tty.c @@ -134,7 +134,7 @@ static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void) struct rpmsg_tty_port *cport; int ret; - cport = kzalloc_obj(*cport, GFP_KERNEL); + cport = kzalloc_obj(*cport); if (!cport) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index aced9d895103..8f25510f89b6 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -442,7 +442,7 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl) { struct serdev_device *serdev; - serdev = kzalloc_obj(*serdev, GFP_KERNEL); + serdev = kzalloc_obj(*serdev); if (!serdev) return NULL; diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c index 84889bb952a2..fb596262b9c7 100644 --- a/drivers/tty/serial/8250/8250_acorn.c +++ b/drivers/tty/serial/8250/8250_acorn.c @@ -44,7 +44,7 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id) unsigned long bus_addr; unsigned int i; - info = kzalloc_obj(struct serial_card_info, GFP_KERNEL); + info = kzalloc_obj(struct serial_card_info); if (!info) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 74a358e7ae03..d2e2c5dfef99 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -140,7 +140,7 @@ static struct irq_info *serial_get_or_create_irq_info(const struct uart_8250_por if (i->irq == up->port.irq) return i; - i = kzalloc_obj(*i, GFP_KERNEL); + i = kzalloc_obj(*i); if (i == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c index 732f1a158e62..59ec0c7377a1 100644 --- a/drivers/tty/serial/8250/8250_hp300.c +++ b/drivers/tty/serial/8250/8250_hp300.c @@ -240,7 +240,7 @@ static int __init hp300_8250_init(void) #endif /* Create new serial device */ - port = kmalloc_obj(struct hp300_port, GFP_KERNEL); + port = kmalloc_obj(struct hp300_port); if (!port) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c index 3f3dac694e20..0935341dd050 100644 --- a/drivers/tty/serial/8250/8250_ni.c +++ b/drivers/tty/serial/8250/8250_ni.c @@ -285,7 +285,7 @@ static int ni16550_probe(struct platform_device *pdev) bool rs232_property; int ret; - uart = kzalloc_obj(*uart, GFP_KERNEL); + uart = kzalloc_obj(*uart); if (!uart) return -ENOMEM; diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 9c721bafbe37..81644d40b09a 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -217,7 +217,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev) if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas")) return -EBUSY; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info == NULL) return -ENOMEM; diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c index 5c372bd7f92a..80483fc7388d 100644 --- a/drivers/tty/serial/8250/serial_cs.c +++ b/drivers/tty/serial/8250/serial_cs.c @@ -305,7 +305,7 @@ static int serial_probe(struct pcmcia_device *link) dev_dbg(&link->dev, "serial_attach()\n"); /* Create new serial device */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->p_dev = link; diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index c0a7f8a0ff55..bcdc07208486 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -1632,7 +1632,7 @@ static int icom_alloc_adapter(struct icom_adapter struct icom_adapter *icom_adapter; struct icom_adapter *cur_adapter_entry; - icom_adapter = kzalloc_obj(struct icom_adapter, GFP_KERNEL); + icom_adapter = kzalloc_obj(struct icom_adapter); if (!icom_adapter) { return -ENOMEM; diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 2a048dc62b96..4b73e51f83fb 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -66,7 +66,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_disable_device; } - brd = kzalloc_obj(*brd, GFP_KERNEL); + brd = kzalloc_obj(*brd); if (!brd) { rc = -ENOMEM; goto out_release_regions; diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 68cef83de47d..475b0a6efce4 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -708,7 +708,7 @@ static int max3100_probe(struct spi_device *spi) return dev_err_probe(dev, -ENOSPC, "too many MAX3100 chips\n"); } - max3100s[i] = kzalloc_obj(struct max3100_port, GFP_KERNEL); + max3100s[i] = kzalloc_obj(struct max3100_port); if (!max3100s[i]) { mutex_unlock(&max3100s_lock); return -ENOMEM; diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 2983d74a5cf1..6729d8e83c3c 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -1651,7 +1651,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, board = &drv_dat[id->driver_data]; port_type = board->port_type; - priv = kzalloc_obj(struct eg20t_port, GFP_KERNEL); + priv = kzalloc_obj(struct eg20t_port); if (priv == NULL) goto init_port_alloc_err; diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 063720ed9716..fea0255067cc 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -811,7 +811,7 @@ static int serial_pxa_probe(struct platform_device *dev) if (irq < 0) return irq; - sport = kzalloc_obj(struct uart_pxa_port, GFP_KERNEL); + sport = kzalloc_obj(struct uart_pxa_port); if (!sport) return -ENOMEM; diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c index ffe331831e22..a12935f6b992 100644 --- a/drivers/tty/serial/serial_base_bus.c +++ b/drivers/tty/serial/serial_base_bus.c @@ -116,7 +116,7 @@ struct serial_ctrl_device *serial_base_ctrl_add(struct uart_port *port, struct serial_ctrl_device *ctrl_dev; int err; - ctrl_dev = kzalloc_obj(*ctrl_dev, GFP_KERNEL); + ctrl_dev = kzalloc_obj(*ctrl_dev); if (!ctrl_dev) return ERR_PTR(-ENOMEM); @@ -156,7 +156,7 @@ struct serial_port_device *serial_base_port_add(struct uart_port *port, int min = 0, max = -1; /* Use -1 for max to apply IDA defaults */ int err; - port_dev = kzalloc_obj(*port_dev, GFP_KERNEL); + port_dev = kzalloc_obj(*port_dev); if (!port_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 2047d73858ec..78bb2a5f1cdf 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2716,7 +2716,7 @@ int uart_register_driver(struct uart_driver *drv) * Maybe we should be using a slab cache for this, especially if * we have a large number of ports to handle. */ - drv->state = kzalloc_objs(struct uart_state, drv->nr, GFP_KERNEL); + drv->state = kzalloc_objs(struct uart_state, drv->nr); if (!drv->state) goto out; diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 219588a8b1ee..35301d6d5bc6 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c @@ -529,7 +529,7 @@ static int hv_probe(struct platform_device *op) if (op->archdata.irqs[0] == 0xffffffff) return -ENODEV; - port = kzalloc_obj(struct uart_port, GFP_KERNEL); + port = kzalloc_obj(struct uart_port); if (unlikely(!port)) return -ENOMEM; diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 884985346226..6505a1930da9 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c @@ -1398,7 +1398,7 @@ static int su_probe(struct platform_device *op) return -EINVAL; up = &sunsu_ports[nr_inst]; } else { - up = kzalloc_obj(*up, GFP_KERNEL); + up = kzalloc_obj(*up); if (!up) return -ENOMEM; } diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 48f1ef5e9bac..7a0326e7102a 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -412,7 +412,7 @@ static int timbuart_probe(struct platform_device *dev) dev_dbg(&dev->dev, "%s\n", __func__); - uart = kzalloc_obj(*uart, GFP_KERNEL); + uart = kzalloc_obj(*uart); if (!uart) { err = -EINVAL; goto err_mem; diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index d7a39e36b53c..6b7dcbbacd13 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1247,7 +1247,7 @@ static int ucc_uart_probe(struct platform_device *ofdev) if (ret) return ret; - qe_port = kzalloc_obj(struct uart_qe_port, GFP_KERNEL); + qe_port = kzalloc_obj(struct uart_qe_port); if (!qe_port) { dev_err(&ofdev->dev, "can't allocate QE port structure\n"); return -ENOMEM; diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 06af5c4349ec..bf4f50e0ce94 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -3477,7 +3477,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev { struct slgt_info *info; - info = kzalloc_obj(struct slgt_info, GFP_KERNEL); + info = kzalloc_obj(struct slgt_info); if (!info) { DBGERR(("%s device alloc failed adapter=%d port=%d\n", diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 4aaa3e04e035..c2e4b31b699a 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -971,7 +971,7 @@ static int sysrq_connect(struct input_handler *handler, struct sysrq_state *sysrq; int error; - sysrq = kzalloc_obj(struct sysrq_state, GFP_KERNEL); + sysrq = kzalloc_obj(struct sysrq_state); if (!sysrq) return -ENOMEM; diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index e7964d319498..d014af6ab060 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -35,7 +35,7 @@ static struct tty_audit_buf *tty_audit_buf_alloc(void) { struct tty_audit_buf *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) goto err; diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 506b6c6329c2..0b9a19afc3e7 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -183,7 +183,7 @@ int tty_alloc_file(struct file *file) { struct tty_file_private *priv; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -1471,7 +1471,7 @@ void tty_save_termios(struct tty_struct *tty) /* Stash the termios data */ tp = tty->driver->termios[idx]; if (tp == NULL) { - tp = kmalloc_obj(*tp, GFP_KERNEL); + tp = kmalloc_obj(*tp); if (tp == NULL) return; tty->driver->termios[idx] = tp; @@ -3244,7 +3244,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver, else tty_line_name(driver, index, name); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); @@ -3333,7 +3333,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, if (!lines || (flags & TTY_DRIVER_UNNUMBERED_NODE && lines > 1)) return ERR_PTR(-EINVAL); - driver = kzalloc_obj(*driver, GFP_KERNEL); + driver = kzalloc_obj(*driver); if (!driver) return ERR_PTR(-ENOMEM); @@ -3343,7 +3343,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, driver->flags = flags; if (!(flags & TTY_DRIVER_DEVPTS_MEM)) { - driver->ttys = kzalloc_objs(*driver->ttys, lines, GFP_KERNEL); + driver->ttys = kzalloc_objs(*driver->ttys, lines); driver->termios = kzalloc_objs(*driver->termios, lines, GFP_KERNEL); if (!driver->ttys || !driver->termios) { @@ -3353,7 +3353,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, } if (!(flags & TTY_DRIVER_DYNAMIC_ALLOC)) { - driver->ports = kzalloc_objs(*driver->ports, lines, GFP_KERNEL); + driver->ports = kzalloc_objs(*driver->ports, lines); if (!driver->ports) { err = -ENOMEM; goto err_free_all; @@ -3361,7 +3361,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, cdevs = lines; } - driver->cdevs = kzalloc_objs(*driver->cdevs, cdevs, GFP_KERNEL); + driver->cdevs = kzalloc_objs(*driver->cdevs, cdevs); if (!driver->cdevs) { err = -ENOMEM; goto err_free_all; diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index cd741fbe6fbe..27a55465bf5e 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -574,7 +574,7 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) return -ENODEV; } - port = kzalloc_obj(struct vcc_port, GFP_KERNEL); + port = kzalloc_obj(struct vcc_port); if (!port) return -ENOMEM; @@ -957,7 +957,7 @@ static int vcc_install(struct tty_driver *driver, struct tty_struct *tty) if (ret) return ret; - port_tty = kzalloc_obj(struct tty_port, GFP_KERNEL); + port_tty = kzalloc_obj(struct tty_port); if (!port_tty) return -ENOMEM; diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 97cf1ceb6709..3fa89a2dbeba 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -539,7 +539,7 @@ static int con_allocate_new(struct vc_data *vc) { struct uni_pagedict *new, *old = *vc->uni_pagedict_loc; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return -ENOMEM; diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 824a74626548..4d2d46c95fef 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -131,7 +131,7 @@ vcs_poll_data_get(struct file *file) if (poll) return poll; - poll = kzalloc_obj(*poll, GFP_KERNEL); + poll = kzalloc_obj(*poll); if (!poll) return NULL; poll->cons_num = console(file_inode(file)); diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index cca7bdf8f2fe..c1f152d8b03b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1065,7 +1065,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ /* although the numbers above are not valid since long ago, the point is still up-to-date and the comment still has its value even if only as a historical artifact. --mj, July 1998 */ - param.vc = vc = kzalloc_obj(struct vc_data, GFP_KERNEL); + param.vc = vc = kzalloc_obj(struct vc_data); if (!vc) return -ENOMEM; diff --git a/drivers/ufs/core/ufs-hwmon.c b/drivers/ufs/core/ufs-hwmon.c index 1ca027b4caa5..aa0b60a0ee8a 100644 --- a/drivers/ufs/core/ufs-hwmon.c +++ b/drivers/ufs/core/ufs-hwmon.c @@ -169,7 +169,7 @@ void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask) struct ufs_hwmon_data *data; struct device *hwmon; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 14d14389164e..5a4998e2caf8 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -306,7 +306,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) goto err_map; } } - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) { ret = -ENOMEM; goto err_map; @@ -335,7 +335,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) goto err_portio; } } - portio = kzalloc_obj(*portio, GFP_KERNEL); + portio = kzalloc_obj(*portio); if (!portio) { ret = -ENOMEM; goto err_portio; @@ -494,7 +494,7 @@ static int uio_open(struct inode *inode, struct file *filep) goto err_module_get; } - listener = kmalloc_obj(*listener, GFP_KERNEL); + listener = kmalloc_obj(*listener); if (!listener) { ret = -ENOMEM; goto err_alloc_listener; @@ -991,7 +991,7 @@ int __uio_register_device(struct module *owner, info->uio_dev = NULL; - idev = kzalloc_obj(*idev, GFP_KERNEL); + idev = kzalloc_obj(*idev); if (!idev) { return -ENOMEM; } diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 909fdb56c09a..f1900c567ba4 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -1130,7 +1130,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, int ret; /* instance init */ - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) return -ENOMEM; diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index d0a2f1361a91..9d28c652bcd8 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -804,7 +804,7 @@ static int speedtch_bind(struct usbatm_data *usbatm, } } - instance = kzalloc_obj(*instance, GFP_KERNEL); + instance = kzalloc_obj(*instance); if (!instance) { ret = -ENOMEM; diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index b27a5f8842b6..f3ae72feb5bf 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c @@ -2516,7 +2516,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, return ret; } - sc = kzalloc_obj(struct uea_softc, GFP_KERNEL); + sc = kzalloc_obj(struct uea_softc); if (!sc) return -ENOMEM; diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index aa4c209cfb91..9600e1ec0993 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -804,7 +804,7 @@ static int usbatm_atm_open(struct atm_vcc *vcc) goto fail; } - new = kzalloc_obj(struct usbatm_vcc_data, GFP_KERNEL); + new = kzalloc_obj(struct usbatm_vcc_data); if (!new) { ret = -ENOMEM; goto fail; diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c index 6b6814c1d557..7ca6682c96c4 100644 --- a/drivers/usb/c67x00/c67x00-drv.c +++ b/drivers/usb/c67x00/c67x00-drv.c @@ -121,7 +121,7 @@ static int c67x00_drv_probe(struct platform_device *pdev) if (!pdata) return -ENODEV; - c67x00 = kzalloc_obj(*c67x00, GFP_KERNEL); + c67x00 = kzalloc_obj(*c67x00); if (!c67x00) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 15b0060ce62d..d59a60a16ec7 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -3287,7 +3287,7 @@ static int cdns3_gadget_start(struct cdns *cdns) u32 max_speed; int ret; - priv_dev = kzalloc_obj(*priv_dev, GFP_KERNEL); + priv_dev = kzalloc_obj(*priv_dev); if (!priv_dev) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdns3-pci-wrap.c b/drivers/usb/cdns3/cdns3-pci-wrap.c index 03c9762ad032..eb5760f75b9d 100644 --- a/drivers/usb/cdns3/cdns3-pci-wrap.c +++ b/drivers/usb/cdns3/cdns3-pci-wrap.c @@ -97,7 +97,7 @@ static int cdns3_pci_probe(struct pci_dev *pdev, if (pci_is_enabled(func)) { wrap = pci_get_drvdata(func); } else { - wrap = kzalloc_obj(*wrap, GFP_KERNEL); + wrap = kzalloc_obj(*wrap); if (!wrap) return -ENOMEM; } diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c index 475ac61ad4c4..6b3815f8a6e5 100644 --- a/drivers/usb/cdns3/cdnsp-gadget.c +++ b/drivers/usb/cdns3/cdnsp-gadget.c @@ -1905,7 +1905,7 @@ static int __cdnsp_gadget_init(struct cdns *cdns) cdns_drd_gadget_on(cdns); - pdev = kzalloc_obj(*pdev, GFP_KERNEL); + pdev = kzalloc_obj(*pdev); if (!pdev) return -ENOMEM; diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c index b6199f98ff77..566d94e49102 100644 --- a/drivers/usb/cdns3/cdnsp-pci.c +++ b/drivers/usb/cdns3/cdnsp-pci.c @@ -82,7 +82,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev, if (pci_is_enabled(func)) { cdnsp = pci_get_drvdata(func); } else { - cdnsp = kzalloc_obj(*cdnsp, GFP_KERNEL); + cdnsp = kzalloc_obj(*cdnsp); if (!cdnsp) { ret = -ENOMEM; goto put_pci; diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 8816c6eaba1d..ad38c746270a 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1350,7 +1350,7 @@ skip_normal_probe: made_compressed_probe: dev_dbg(&intf->dev, "interfaces are valid\n"); - acm = kzalloc_obj(struct acm, GFP_KERNEL); + acm = kzalloc_obj(struct acm); if (!acm) return -ENOMEM; diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 28fc93e0c01d..f2d94cfc70af 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -1027,7 +1027,7 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor int rv = -ENOMEM; struct wdm_device *desc; - desc = kzalloc_obj(struct wdm_device, GFP_KERNEL); + desc = kzalloc_obj(struct wdm_device); if (!desc) goto out; INIT_LIST_HEAD(&desc->device_list); @@ -1050,10 +1050,10 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor desc->wMaxPacketSize = usb_endpoint_maxp(ep); - desc->orq = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); + desc->orq = kmalloc_obj(struct usb_ctrlrequest); if (!desc->orq) goto err; - desc->irq = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); + desc->irq = kmalloc_obj(struct usb_ctrlrequest); if (!desc->irq) goto err; diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 653583dc7a8d..669b9e6879bf 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -1142,7 +1142,7 @@ static int usblp_probe(struct usb_interface *intf, /* Malloc and start initializing usblp structure so we can use it * directly. */ - usblp = kzalloc_obj(struct usblp, GFP_KERNEL); + usblp = kzalloc_obj(struct usblp); if (!usblp) { retval = -ENOMEM; goto abort_ret; diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 20bc86367660..2526a0e03cde 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -172,7 +172,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp) return -ENODEV; } - file_data = kzalloc_obj(*file_data, GFP_KERNEL); + file_data = kzalloc_obj(*file_data); if (!file_data) return -ENOMEM; @@ -2378,7 +2378,7 @@ static int usbtmc_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "%s called\n", __func__); - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index 2f414b7c3e2c..56c9bfaf2ea3 100644 --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -324,7 +324,7 @@ struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi *ulpi; int ret; - ulpi = kzalloc_obj(*ulpi, GFP_KERNEL); + ulpi = kzalloc_obj(*ulpi); if (!ulpi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 129cbfd74f26..8e88ae8d0e71 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -1045,7 +1045,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) return -ENOMSG; } - bos = kzalloc_obj(*bos, GFP_KERNEL); + bos = kzalloc_obj(*bos); if (!bos) return -ENOMEM; @@ -1066,7 +1066,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) if (total_len < length) return -EINVAL; - dev->bos = kzalloc_obj(*dev->bos, GFP_KERNEL); + dev->bos = kzalloc_obj(*dev->bos); if (!dev->bos) return -ENOMEM; diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index d7ac181454f9..e191934623c7 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -245,7 +245,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) if (ret) goto error; - usbm = kzalloc_obj(struct usb_memory, GFP_KERNEL); + usbm = kzalloc_obj(struct usb_memory); if (!usbm) { ret = -ENOMEM; goto error_decrease_mem; @@ -402,7 +402,7 @@ static struct async *alloc_async(unsigned int numisoframes) { struct async *as; - as = kzalloc_obj(struct async, GFP_KERNEL); + as = kzalloc_obj(struct async); if (!as) return NULL; as->urb = usb_alloc_urb(numisoframes, GFP_KERNEL); @@ -970,7 +970,7 @@ static int parse_usbdevfs_streams(struct usb_dev_state *ps, if (num_streams_ret && (num_streams < 2 || num_streams > 65536)) return -EINVAL; - eps = kmalloc_objs(*eps, num_eps, GFP_KERNEL); + eps = kmalloc_objs(*eps, num_eps); if (!eps) return -ENOMEM; @@ -1039,7 +1039,7 @@ static int usbdev_open(struct inode *inode, struct file *file) int ret; ret = -ENOMEM; - ps = kzalloc_obj(struct usb_dev_state, GFP_KERNEL); + ps = kzalloc_obj(struct usb_dev_state); if (!ps) goto out_free_ps; @@ -1670,7 +1670,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb /* min 8 byte setup packet */ if (uurb->buffer_length < 8) return -EINVAL; - dr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); + dr = kmalloc_obj(struct usb_ctrlrequest); if (!dr) return -ENOMEM; if (copy_from_user(dr, uurb->buffer, 8)) { diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index db67874879d8..2574e65bc640 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -57,7 +57,7 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, if (fields < 2) return -EINVAL; - dynid = kzalloc_obj(*dynid, GFP_KERNEL); + dynid = kzalloc_obj(*dynid); if (!dynid) return -ENOMEM; diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index f44f0fffeb41..4137ab47f1cd 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -154,7 +154,7 @@ int usb_create_ep_devs(struct device *parent, struct ep_device *ep_dev; int retval; - ep_dev = kzalloc_obj(*ep_dev, GFP_KERNEL); + ep_dev = kzalloc_obj(*ep_dev); if (!ep_dev) { retval = -ENOMEM; goto exit; diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index f1b2b0e4c437..c0e2fa2bd282 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2193,7 +2193,7 @@ int ehset_single_step_set_feature(struct usb_hcd *hcd, int port) if (!buf) return -ENOMEM; - dr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL); + dr = kmalloc_obj(struct usb_ctrlrequest); if (!dr) { kfree(buf); return -ENOMEM; diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 22a54c632c26..24960ba9caa9 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1461,20 +1461,20 @@ static int hub_configure(struct usb_hub *hub, unsigned full_load; unsigned maxchild; - hub->buffer = kmalloc_obj(*hub->buffer, GFP_KERNEL); + hub->buffer = kmalloc_obj(*hub->buffer); if (!hub->buffer) { ret = -ENOMEM; goto fail; } - hub->status = kmalloc_obj(*hub->status, GFP_KERNEL); + hub->status = kmalloc_obj(*hub->status); if (!hub->status) { ret = -ENOMEM; goto fail; } mutex_init(&hub->status_mutex); - hub->descriptor = kzalloc_obj(*hub->descriptor, GFP_KERNEL); + hub->descriptor = kzalloc_obj(*hub->descriptor); if (!hub->descriptor) { ret = -ENOMEM; goto fail; @@ -1522,7 +1522,7 @@ static int hub_configure(struct usb_hub *hub, dev_info(hub_dev, "%d port%s detected\n", maxchild, str_plural(maxchild)); - hub->ports = kzalloc_objs(struct usb_port *, maxchild, GFP_KERNEL); + hub->ports = kzalloc_objs(struct usb_port *, maxchild); if (!hub->ports) { ret = -ENOMEM; goto fail; @@ -1958,7 +1958,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) /* We found a hub */ dev_info(&intf->dev, "USB hub found\n"); - hub = kzalloc_obj(*hub, GFP_KERNEL); + hub = kzalloc_obj(*hub); if (!hub) return -ENOMEM; @@ -5236,7 +5236,7 @@ check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc_obj(*qual, GFP_KERNEL); + qual = kmalloc_obj(*qual); if (qual == NULL) return; diff --git a/drivers/usb/core/ledtrig-usbport.c b/drivers/usb/core/ledtrig-usbport.c index e7de8864a527..8881644777a7 100644 --- a/drivers/usb/core/ledtrig-usbport.c +++ b/drivers/usb/core/ledtrig-usbport.c @@ -190,7 +190,7 @@ static int usbport_trig_add_port(struct usbport_trig_data *usbport_data, size_t len; int err; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { err = -ENOMEM; goto err_out; @@ -305,7 +305,7 @@ static int usbport_trig_activate(struct led_classdev *led_cdev) struct usbport_trig_data *usbport_data; int err; - usbport_data = kzalloc_obj(*usbport_data, GFP_KERNEL); + usbport_data = kzalloc_obj(*usbport_data); if (!usbport_data) return -ENOMEM; usbport_data->led_cdev = led_cdev; diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index d8f50d468794..ea970ddf8879 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -2287,7 +2287,7 @@ int usb_driver_set_configuration(struct usb_device *udev, int config) { struct set_config_request *req; - req = kmalloc_obj(*req, GFP_KERNEL); + req = kmalloc_obj(*req); if (!req) return -ENOMEM; req->udev = udev; diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 36096973eb59..44e38f922bc5 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -739,11 +739,11 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) struct usb_device *hdev = hub->hdev; int retval; - port_dev = kzalloc_obj(*port_dev, GFP_KERNEL); + port_dev = kzalloc_obj(*port_dev); if (!port_dev) return -ENOMEM; - port_dev->req = kzalloc_obj(*(port_dev->req), GFP_KERNEL); + port_dev->req = kzalloc_obj(*(port_dev->req)); if (!port_dev->req) { kfree(port_dev); return -ENOMEM; diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 135a89ab2bfa..9e7e49712739 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -61,7 +61,7 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp) quirk_list = NULL; } - quirk_list = kzalloc_objs(struct quirk_entry, quirk_count, GFP_KERNEL); + quirk_list = kzalloc_objs(struct quirk_entry, quirk_count); if (!quirk_list) { quirk_count = 0; mutex_unlock(&quirk_mutex); diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index cfb882b86981..e9a10a33534c 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -648,7 +648,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_hcd *usb_hcd = bus_to_hcd(bus); unsigned raw_port = port1; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 55809a83f8f8..1a763ad4f721 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5218,7 +5218,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) memset(&hsotg->hc_ptr_array[0], 0, sizeof(hsotg->hc_ptr_array)); for (i = 0; i < num_channels; i++) { - channel = kzalloc_obj(*channel, GFP_KERNEL); + channel = kzalloc_obj(*channel); if (!channel) goto error3; channel->hc_num = i; diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index a005865862c8..65d909e4b785 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -1003,7 +1003,7 @@ void dwc3_debugfs_init(struct dwc3 *dwc) { struct dentry *root; - dwc->regset = kzalloc_obj(*dwc->regset, GFP_KERNEL); + dwc->regset = kzalloc_obj(*dwc->regset); if (!dwc->regset) return; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7bd60fc7cd74..0a688904ce8c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -3373,7 +3373,7 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum) int ret; u8 num = epnum >> 1; - dep = kzalloc_obj(*dep, GFP_KERNEL); + dep = kzalloc_obj(*dep); if (!dep) return -ENOMEM; @@ -4728,7 +4728,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) } init_completion(&dwc->ep0_in_setup); - dwc->gadget = kzalloc_obj(struct usb_gadget, GFP_KERNEL); + dwc->gadget = kzalloc_obj(struct usb_gadget); if (!dwc->gadget) { ret = -ENOMEM; goto err3; diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 65a16d2cdfd7..1a48329a4e08 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -738,7 +738,7 @@ static struct debug_buffer { struct debug_buffer *buf; - buf = kzalloc_obj(struct debug_buffer, GFP_KERNEL); + buf = kzalloc_obj(struct debug_buffer); if (buf) { buf->bus = bus; diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 79509ec08be9..d9e024873a42 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -1183,7 +1183,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) return irq; /* initialize udc */ - fotg210 = kzalloc_obj(struct fotg210_udc, GFP_KERNEL); + fotg210 = kzalloc_obj(struct fotg210_udc); if (fotg210 == NULL) return -ENOMEM; @@ -1207,7 +1207,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) ret = -ENOMEM; for (i = 0; i < FOTG210_MAX_NUM_EP; i++) { - fotg210->ep[i] = kzalloc_obj(struct fotg210_ep, GFP_KERNEL); + fotg210->ep[i] = kzalloc_obj(struct fotg210_ep); if (!fotg210->ep[i]) goto err_alloc; } diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index aba08d058ff9..a902184bdf82 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -2531,7 +2531,7 @@ static int composite_bind(struct usb_gadget *gadget, struct usb_composite_driver *composite = to_cdriver(gdriver); int status = -ENOMEM; - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return status; diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 5163a994f9e7..06e892beda88 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -727,7 +727,7 @@ static struct config_group *config_desc_make( if (ret) return ERR_PTR(ret); - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return ERR_PTR(-ENOMEM); cfg->c.label = kstrdup(buf, GFP_KERNEL); @@ -870,7 +870,7 @@ static struct config_item *gadget_language_string_make(struct config_group *grou language = to_gadget_language(&group->cg_item); - string = kzalloc_obj(*string, GFP_KERNEL); + string = kzalloc_obj(*string); if (!string) return ERR_PTR(-ENOMEM); @@ -922,7 +922,7 @@ static struct config_group *gadget_language_make(struct config_group *group, int langs = 0; int ret; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return ERR_PTR(-ENOMEM); @@ -1992,7 +1992,7 @@ static struct config_group *gadgets_make( { struct gadget_info *gi; - gi = kzalloc_obj(*gi, GFP_KERNEL); + gi = kzalloc_obj(*gi); if (!gi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index d34b4710f962..c628d02bfb1d 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -748,7 +748,7 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi) struct f_serial_opts *opts; struct f_acm *acm; - acm = kzalloc_obj(*acm, GFP_KERNEL); + acm = kzalloc_obj(*acm); if (!acm) return ERR_PTR(-ENOMEM); @@ -882,7 +882,7 @@ static struct usb_function_instance *acm_alloc_instance(void) struct f_serial_opts *opts; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); opts->protocol = USB_CDC_ACM_PROTO_AT_V25TER; diff --git a/drivers/usb/gadget/function/f_ecm.c b/drivers/usb/gadget/function/f_ecm.c index aa91d705bc8d..e0c02121374e 100644 --- a/drivers/usb/gadget/function/f_ecm.c +++ b/drivers/usb/gadget/function/f_ecm.c @@ -847,7 +847,7 @@ static struct usb_function_instance *ecm_alloc_inst(void) { struct f_ecm_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -927,7 +927,7 @@ static struct usb_function *ecm_alloc(struct usb_function_instance *fi) int status; /* allocate and initialize one new instance */ - ecm = kzalloc_obj(*ecm, GFP_KERNEL); + ecm = kzalloc_obj(*ecm); if (!ecm) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c index acdd6c637c7b..0142a0e487ee 100644 --- a/drivers/usb/gadget/function/f_eem.c +++ b/drivers/usb/gadget/function/f_eem.c @@ -462,7 +462,7 @@ static int eem_unwrap(struct gether *port, goto next; } - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) { kfree(req->buf); usb_ep_free_request(ep, req); @@ -608,7 +608,7 @@ static struct usb_function_instance *eem_alloc_inst(void) { struct f_eem_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -651,7 +651,7 @@ static struct usb_function *eem_alloc(struct usb_function_instance *fi) struct f_eem_opts *opts; /* allocate and initialize one new instance */ - eem = kzalloc_obj(*eem, GFP_KERNEL); + eem = kzalloc_obj(*eem); if (!eem) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 84cfa7a8437a..480d73c220a8 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -814,7 +814,7 @@ static void *ffs_build_sg_list(struct sg_table *sgt, size_t sz) return NULL; n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; - pages = kvmalloc_objs(struct page *, n_pages, GFP_KERNEL); + pages = kvmalloc_objs(struct page *, n_pages); if (!pages) { vfree(vaddr); @@ -1245,7 +1245,7 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from) ssize_t res; if (!is_sync_kiocb(kiocb)) { - p = kzalloc_obj(io_data, GFP_KERNEL); + p = kzalloc_obj(io_data); if (!p) return -ENOMEM; p->aio = true; @@ -1280,7 +1280,7 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) ssize_t res; if (!is_sync_kiocb(kiocb)) { - p = kzalloc_obj(io_data, GFP_KERNEL); + p = kzalloc_obj(io_data); if (!p) return -ENOMEM; p->aio = true; @@ -1503,7 +1503,7 @@ static int ffs_dmabuf_attach(struct file *file, int fd) goto err_dmabuf_put; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { err = -ENOMEM; goto err_dmabuf_detach; @@ -1652,7 +1652,7 @@ static int ffs_dmabuf_transfer(struct file *file, if (ret) goto err_resv_unlock; - fence = kmalloc_obj(*fence, GFP_KERNEL); + fence = kmalloc_obj(*fence); if (!fence) { ret = -ENOMEM; goto err_resv_unlock; @@ -2067,7 +2067,7 @@ static int ffs_fs_init_fs_context(struct fs_context *fc) { struct ffs_sb_fill_data *ctx; - ctx = kzalloc_obj(struct ffs_sb_fill_data, GFP_KERNEL); + ctx = kzalloc_obj(struct ffs_sb_fill_data); if (!ctx) return -ENOMEM; @@ -2183,7 +2183,7 @@ static void ffs_data_closed(struct ffs_data *ffs) static struct ffs_data *ffs_data_new(const char *dev_name) { - struct ffs_data *ffs = kzalloc_obj(*ffs, GFP_KERNEL); + struct ffs_data *ffs = kzalloc_obj(*ffs); if (!ffs) return NULL; @@ -2330,7 +2330,7 @@ static int ffs_epfiles_create(struct ffs_data *ffs) int err; count = ffs->eps_count; - epfiles = kzalloc_objs(*epfiles, count, GFP_KERNEL); + epfiles = kzalloc_objs(*epfiles, count); if (!epfiles) return -ENOMEM; @@ -4031,7 +4031,7 @@ static struct usb_function_instance *ffs_alloc_inst(void) struct f_fs_opts *opts; struct ffs_dev *dev; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -4107,7 +4107,7 @@ static struct usb_function *ffs_alloc(struct usb_function_instance *fi) { struct ffs_function *func; - func = kzalloc_obj(*func, GFP_KERNEL); + func = kzalloc_obj(*func); if (!func) return ERR_PTR(-ENOMEM); @@ -4138,7 +4138,7 @@ static struct ffs_dev *_ffs_alloc_dev(void) if (_ffs_get_single_dev()) return ERR_PTR(-EBUSY); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 93dd678cafe1..8c855c00b887 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -650,7 +650,7 @@ static int f_hidg_get_report(struct file *file, struct usb_hidg_report __user *b struct report_entry *ptr; __u8 report_id; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -1530,7 +1530,7 @@ static struct usb_function_instance *hidg_alloc_inst(void) struct usb_function_instance *ret; int status = 0; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -1596,7 +1596,7 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi) int ret; /* allocate and initialize one new instance */ - hidg = kzalloc_obj(*hidg, GFP_KERNEL); + hidg = kzalloc_obj(*hidg); if (!hidg) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c index b8fa60af9385..d2d07fb49e70 100644 --- a/drivers/usb/gadget/function/f_loopback.c +++ b/drivers/usb/gadget/function/f_loopback.c @@ -425,7 +425,7 @@ static struct usb_function *loopback_alloc(struct usb_function_instance *fi) struct f_loopback *loop; struct f_lb_opts *lb_opts; - loop = kzalloc_obj(*loop, GFP_KERNEL); + loop = kzalloc_obj(*loop); if (!loop) return ERR_PTR(-ENOMEM); @@ -568,7 +568,7 @@ static struct usb_function_instance *loopback_alloc_instance(void) { struct f_lb_opts *lb_opts; - lb_opts = kzalloc_obj(*lb_opts, GFP_KERNEL); + lb_opts = kzalloc_obj(*lb_opts); if (!lb_opts) return ERR_PTR(-ENOMEM); mutex_init(&lb_opts->lock); diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index c894ede6bcd2..6af96e2b44eb 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -2699,7 +2699,7 @@ static void fsg_lun_release(struct device *dev) static struct fsg_common *fsg_common_setup(struct fsg_common *common) { if (!common) { - common = kzalloc_obj(*common, GFP_KERNEL); + common = kzalloc_obj(*common); if (!common) return ERR_PTR(-ENOMEM); common->free_storage_on_release = 1; @@ -2740,7 +2740,7 @@ int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n) struct fsg_buffhd *bh, *buffhds; int i; - buffhds = kzalloc_objs(*buffhds, n, GFP_KERNEL); + buffhds = kzalloc_objs(*buffhds, n); if (!buffhds) return -ENOMEM; @@ -2887,7 +2887,7 @@ int fsg_common_create_lun(struct fsg_common *common, struct fsg_lun_config *cfg, return -EINVAL; } - lun = kzalloc_obj(*lun, GFP_KERNEL); + lun = kzalloc_obj(*lun); if (!lun) return -ENOMEM; @@ -3311,7 +3311,7 @@ static struct config_group *fsg_lun_make(struct config_group *group, goto out; } - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) { ret = -ENOMEM; goto out; @@ -3489,7 +3489,7 @@ static struct usb_function_instance *fsg_alloc_inst(void) struct fsg_lun_config config; int rc; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -3554,7 +3554,7 @@ static struct usb_function *fsg_alloc(struct usb_function_instance *fi) struct fsg_common *common = opts->common; struct fsg_dev *fsg; - fsg = kzalloc_obj(*fsg, GFP_KERNEL); + fsg = kzalloc_obj(*fsg); if (unlikely(!fsg)) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index d98f946b1621..2a81ae9e6cf2 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -1279,7 +1279,7 @@ static struct usb_function_instance *f_midi_alloc_inst(void) { struct f_midi_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index 1a4feca1f083..61ce54c3392b 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -2340,7 +2340,7 @@ static int f_midi2_block_opts_create(struct f_midi2_ep_opts *ep_opts, goto out; } - block_opts = kzalloc_obj(*block_opts, GFP_KERNEL); + block_opts = kzalloc_obj(*block_opts); if (!block_opts) { ret = -ENOMEM; goto out; @@ -2502,7 +2502,7 @@ static int f_midi2_ep_opts_create(struct f_midi2_opts *opts, { struct f_midi2_ep_opts *ep_opts; - ep_opts = kzalloc_obj(*ep_opts, GFP_KERNEL); + ep_opts = kzalloc_obj(*ep_opts); if (!ep_opts) return -ENOMEM; @@ -2652,7 +2652,7 @@ static struct usb_function_instance *f_midi2_alloc_inst(void) struct f_midi2_block_opts *block_opts; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -2813,7 +2813,7 @@ static struct usb_function *f_midi2_alloc(struct usb_function_instance *fi) struct f_midi2_block *bp; int i, num_eps, blk; - midi2 = kzalloc_obj(*midi2, GFP_KERNEL); + midi2 = kzalloc_obj(*midi2); if (!midi2) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 6bbdb10ce3ca..14fc7dce6f39 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1683,7 +1683,7 @@ static struct usb_function_instance *ncm_alloc_inst(void) char *names[1]; struct config_group *ncm_interf_group; - struct f_ncm_opts *opts __free(kfree) = kzalloc_obj(*opts, GFP_KERNEL); + struct f_ncm_opts *opts __free(kfree) = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_obex.c b/drivers/usb/gadget/function/f_obex.c index e9e9fd70c243..715bb0decd3b 100644 --- a/drivers/usb/gadget/function/f_obex.c +++ b/drivers/usb/gadget/function/f_obex.c @@ -426,7 +426,7 @@ static struct usb_function_instance *obex_alloc_inst(void) struct f_serial_opts *opts; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -461,7 +461,7 @@ static struct usb_function *obex_alloc(struct usb_function_instance *fi) struct f_serial_opts *opts; /* allocate and initialize one new instance */ - obex = kzalloc_obj(*obex, GFP_KERNEL); + obex = kzalloc_obj(*obex); if (!obex) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_phonet.c b/drivers/usb/gadget/function/f_phonet.c index b427dcae456c..aea572505ad2 100644 --- a/drivers/usb/gadget/function/f_phonet.c +++ b/drivers/usb/gadget/function/f_phonet.c @@ -623,7 +623,7 @@ static struct usb_function_instance *phonet_alloc_inst(void) { struct f_phonet_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index d0e6435ac7a6..e4f7828ae75d 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1374,7 +1374,7 @@ static struct usb_function_instance *gprinter_alloc_inst(void) struct usb_function_instance *ret; int status = 0; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -1482,7 +1482,7 @@ static struct usb_function *gprinter_alloc(struct usb_function_instance *fi) return ERR_PTR(-ENOENT); } - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { mutex_unlock(&opts->lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index 39a87458bab4..8b11d8d6d89c 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -673,7 +673,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) rndis_opts = container_of(f->fi, struct f_rndis_opts, func_inst); if (cdev->use_os_string) { - os_desc_table = kzalloc_obj(*os_desc_table, GFP_KERNEL); + os_desc_table = kzalloc_obj(*os_desc_table); if (!os_desc_table) return -ENOMEM; } @@ -888,7 +888,7 @@ static struct usb_function_instance *rndis_alloc_inst(void) char *names[1]; struct config_group *rndis_interf_group; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); opts->rndis_os_desc.ext_compat_id = opts->rndis_ext_compat_id; @@ -956,7 +956,7 @@ static struct usb_function *rndis_alloc(struct usb_function_instance *fi) struct rndis_params *params; /* allocate and initialize one new instance */ - rndis = kzalloc_obj(*rndis, GFP_KERNEL); + rndis = kzalloc_obj(*rndis); if (!rndis) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_serial.c b/drivers/usb/gadget/function/f_serial.c index 01fc06b29ab2..ae8813c67bc7 100644 --- a/drivers/usb/gadget/function/f_serial.c +++ b/drivers/usb/gadget/function/f_serial.c @@ -317,7 +317,7 @@ static struct usb_function_instance *gser_alloc_inst(void) struct f_serial_opts *opts; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -376,7 +376,7 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi) struct f_serial_opts *opts; /* allocate and initialize one new instance */ - gser = kzalloc_obj(*gser, GFP_KERNEL); + gser = kzalloc_obj(*gser); if (!gser) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index e77e2e83833f..d2b707e41669 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -844,7 +844,7 @@ static struct usb_function *source_sink_alloc_func( struct f_sourcesink *ss; struct f_ss_opts *ss_opts; - ss = kzalloc_obj(*ss, GFP_KERNEL); + ss = kzalloc_obj(*ss); if (!ss) return ERR_PTR(-ENOMEM); @@ -1297,7 +1297,7 @@ static struct usb_function_instance *source_sink_alloc_inst(void) { struct f_ss_opts *ss_opts; - ss_opts = kzalloc_obj(*ss_opts, GFP_KERNEL); + ss_opts = kzalloc_obj(*ss_opts); if (!ss_opts) return ERR_PTR(-ENOMEM); mutex_init(&ss_opts->lock); diff --git a/drivers/usb/gadget/function/f_subset.c b/drivers/usb/gadget/function/f_subset.c index 4913f60db048..076072386e5e 100644 --- a/drivers/usb/gadget/function/f_subset.c +++ b/drivers/usb/gadget/function/f_subset.c @@ -428,7 +428,7 @@ static struct usb_function_instance *geth_alloc_inst(void) { struct f_gether_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); mutex_init(&opts->lock); @@ -467,7 +467,7 @@ static struct usb_function *geth_alloc(struct usb_function_instance *fi) int status; /* allocate and initialize one new instance */ - geth = kzalloc_obj(*geth, GFP_KERNEL); + geth = kzalloc_obj(*geth); if (!geth) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 29d6fd6ce935..ec050d8f99f1 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1676,7 +1676,7 @@ static struct se_portal_group *usbg_make_tpg(struct se_wwn *wwn, goto unlock_dep; } - tpg = kzalloc_obj(struct usbg_tpg, GFP_KERNEL); + tpg = kzalloc_obj(struct usbg_tpg); ret = -ENOMEM; if (!tpg) goto unref_dep; @@ -1768,7 +1768,7 @@ static struct se_wwn *usbg_make_tport( if (!wnn_name) return ERR_PTR(-EINVAL); - tport = kzalloc_obj(struct usbg_tport, GFP_KERNEL); + tport = kzalloc_obj(struct usbg_tport); if (!(tport)) return ERR_PTR(-ENOMEM); @@ -1861,7 +1861,7 @@ static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name) goto out_unlock; } - tv_nexus = kzalloc_obj(*tv_nexus, GFP_KERNEL); + tv_nexus = kzalloc_obj(*tv_nexus); if (!tv_nexus) { ret = -ENOMEM; goto out_unlock; @@ -2535,7 +2535,7 @@ static struct usb_function_instance *tcm_alloc_inst(void) int i; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -2590,7 +2590,7 @@ static struct usb_function *tcm_alloc(struct usb_function_instance *fi) return ERR_PTR(-ENODEV); } - fu = kzalloc_obj(*fu, GFP_KERNEL); + fu = kzalloc_obj(*fu); if (!fu) { mutex_unlock(&tpg_instances_lock); return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 58ada4855de8..85c502e98f57 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -1748,7 +1748,7 @@ static struct usb_function_instance *f_audio_alloc_inst(void) { struct f_uac1_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -1831,7 +1831,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) struct f_uac1_opts *opts; /* allocate and initialize one new instance */ - uac1 = kzalloc_obj(*uac1, GFP_KERNEL); + uac1 = kzalloc_obj(*uac1); if (!uac1) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c index ed7e1f061784..a0c953a99727 100644 --- a/drivers/usb/gadget/function/f_uac1_legacy.c +++ b/drivers/usb/gadget/function/f_uac1_legacy.c @@ -942,7 +942,7 @@ static struct usb_function_instance *f_audio_alloc_inst(void) { struct f_uac1_legacy_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -985,7 +985,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) struct f_uac1_legacy_opts *opts; /* allocate and initialize one new instance */ - audio = kzalloc_obj(*audio, GFP_KERNEL); + audio = kzalloc_obj(*audio); if (!audio) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index c66908bbe714..897787d0803c 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -2189,7 +2189,7 @@ static struct usb_function_instance *afunc_alloc_inst(void) { struct f_uac2_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); @@ -2278,7 +2278,7 @@ static struct usb_function *afunc_alloc(struct usb_function_instance *fi) struct f_uac2 *uac2; struct f_uac2_opts *opts; - uac2 = kzalloc_obj(*uac2, GFP_KERNEL); + uac2 = kzalloc_obj(*uac2); if (uac2 == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index 4b9846ab99f2..494fdbc4e85b 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -887,7 +887,7 @@ static struct usb_function_instance *uvc_alloc_inst(void) struct uvc_descriptor_header **ctl_cls; int ret; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return ERR_PTR(-ENOMEM); opts->func_inst.free_func_inst = uvc_free_inst; @@ -1042,7 +1042,7 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) struct uvc_descriptor_header **strm_cls; struct config_item *streaming, *header, *h; - uvc = kzalloc_obj(*uvc, GFP_KERNEL); + uvc = kzalloc_obj(*uvc); if (uvc == NULL) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c index 1e168666a3f5..3da54a7d7aba 100644 --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c @@ -892,7 +892,7 @@ struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v) return ERR_PTR(-ENODEV); } - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) { rndis_put_nr(i); diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 24c934bbf0e5..36d2fedbda11 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1191,7 +1191,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, if (!g_audio) return -EINVAL; - uac = kzalloc_obj(*uac, GFP_KERNEL); + uac = kzalloc_obj(*uac); if (!uac) return -ENOMEM; g_audio->uac = uac; diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index e61beaa0c53d..e43ad6373846 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1082,7 +1082,7 @@ static int gs_console_init(struct gs_port *port) if (port->console) return 0; - cons = kzalloc_obj(*port->console, GFP_KERNEL); + cons = kzalloc_obj(*port->console); if (!cons) return -ENOMEM; @@ -1215,7 +1215,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) goto out; } - port = kzalloc_obj(struct gs_port, GFP_KERNEL); + port = kzalloc_obj(struct gs_port); if (port == NULL) { ret = -ENOMEM; goto out; diff --git a/drivers/usb/gadget/function/u_uac1_legacy.c b/drivers/usb/gadget/function/u_uac1_legacy.c index e95c2fc7fc10..01016102fa17 100644 --- a/drivers/usb/gadget/function/u_uac1_legacy.c +++ b/drivers/usb/gadget/function/u_uac1_legacy.c @@ -106,7 +106,7 @@ static int playback_default_hw_params(struct gaudio_snd_dev *snd) snd->channels = 2; snd->rate = 48000; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 553057cbf63a..70a1415ea401 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -158,7 +158,7 @@ static int uvcg_config_create_group(struct config_group *parent, { struct config_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; @@ -270,7 +270,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group, { struct uvcg_control_header *h; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -1273,7 +1273,7 @@ static struct config_item *uvcg_extension_make(struct config_group *group, const opts_item = group->cg_item.ci_parent->ci_parent; opts = to_f_uvc_opts(opts_item); - xu = kzalloc_obj(*xu, GFP_KERNEL); + xu = kzalloc_obj(*xu); if (!xu) return ERR_PTR(-ENOMEM); @@ -1437,7 +1437,7 @@ static int uvcg_control_class_create_children(struct config_group *parent) for (i = 0; i < ARRAY_SIZE(names); ++i) { struct uvcg_control_class_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; @@ -1785,7 +1785,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src, uvcg_format_set_indices(to_config_group(target)); - format_ptr = kzalloc_obj(*format_ptr, GFP_KERNEL); + format_ptr = kzalloc_obj(*format_ptr); if (!format_ptr) { ret = -ENOMEM; goto out; @@ -1899,7 +1899,7 @@ static struct config_item { struct uvcg_streaming_header *h; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -2163,7 +2163,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group, struct config_item *opts_item; struct uvcg_frame_ptr *frame_ptr; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -2197,7 +2197,7 @@ static struct config_item *uvcg_frame_make(struct config_group *group, return ERR_PTR(-EINVAL); } - frame_ptr = kzalloc_obj(*frame_ptr, GFP_KERNEL); + frame_ptr = kzalloc_obj(*frame_ptr); if (!frame_ptr) { mutex_unlock(&opts->lock); kfree(h); @@ -2483,7 +2483,7 @@ static struct config_group *uvcg_uncompressed_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -2675,7 +2675,7 @@ static struct config_group *uvcg_mjpeg_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -2926,7 +2926,7 @@ static struct config_group *uvcg_framebased_make(struct config_group *group, if (!color_match) return ERR_PTR(-EINVAL); - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (!h) return ERR_PTR(-ENOMEM); @@ -3075,7 +3075,7 @@ static struct config_group *uvcg_color_matching_make(struct config_group *group, { struct uvcg_color_matching *color_match; - color_match = kzalloc_obj(*color_match, GFP_KERNEL); + color_match = kzalloc_obj(*color_match); if (!color_match) return ERR_PTR(-ENOMEM); @@ -3097,7 +3097,7 @@ static int uvcg_color_matching_create_children(struct config_group *parent) { struct uvcg_color_matching *color_match; - color_match = kzalloc_obj(*color_match, GFP_KERNEL); + color_match = kzalloc_obj(*color_match); if (!color_match) return -ENOMEM; @@ -3553,7 +3553,7 @@ static int uvcg_streaming_class_create_children(struct config_group *parent) for (i = 0; i < ARRAY_SIZE(names); ++i) { struct uvcg_streaming_class_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c index 574b3a8986a0..ed48d38498fb 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c @@ -667,7 +667,7 @@ uvc_v4l2_open(struct file *file) struct uvc_device *uvc = video_get_drvdata(vdev); struct uvc_file_handle *handle; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (handle == NULL) return -ENOMEM; diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index b2784a57dbcd..7cea641b06b4 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c @@ -559,7 +559,7 @@ uvc_video_alloc_requests(struct uvc_video *video) uvc_video_prep_requests(video); for (i = 0; i < video->uvc_num_requests; i++) { - ureq = kzalloc_obj(struct uvc_request, GFP_KERNEL); + ureq = kzalloc_obj(struct uvc_request); if (ureq == NULL) goto error; diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c index af8968ef9380..03032ea6f701 100644 --- a/drivers/usb/gadget/legacy/dbgp.c +++ b/drivers/usb/gadget/legacy/dbgp.c @@ -298,7 +298,7 @@ static int dbgp_bind(struct usb_gadget *gadget, dbgp.req->length = DBGP_REQ_EP0_LEN; #ifdef CONFIG_USB_G_DBGP_SERIAL - dbgp.serial = kzalloc_obj(struct gserial, GFP_KERNEL); + dbgp.serial = kzalloc_obj(struct gserial); if (!dbgp.serial) { stp = 3; err = -ENOMEM; diff --git a/drivers/usb/gadget/legacy/g_ffs.c b/drivers/usb/gadget/legacy/g_ffs.c index 98a08efe86dd..dc59e625aca8 100644 --- a/drivers/usb/gadget/legacy/g_ffs.c +++ b/drivers/usb/gadget/legacy/g_ffs.c @@ -188,7 +188,7 @@ static int __init gfs_init(void) /* * Allocate in one chunk for easier maintenance */ - f_ffs[0] = kzalloc_objs(*f_ffs[0], func_num * N_CONF, GFP_KERNEL); + f_ffs[0] = kzalloc_objs(*f_ffs[0], func_num * N_CONF); if (!f_ffs[0]) { ret = -ENOMEM; goto no_func; @@ -196,7 +196,7 @@ static int __init gfs_init(void) for (i = 1; i < N_CONF; ++i) f_ffs[i] = f_ffs[0] + i * func_num; - fi_ffs = kzalloc_objs(*fi_ffs, func_num, GFP_KERNEL); + fi_ffs = kzalloc_objs(*fi_ffs, func_num); if (!fi_ffs) { ret = -ENOMEM; goto no_func; diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c index bc25c04daaaf..89722413e5fd 100644 --- a/drivers/usb/gadget/legacy/hid.c +++ b/drivers/usb/gadget/legacy/hid.c @@ -227,7 +227,7 @@ static int hidg_plat_driver_probe(struct platform_device *pdev) return -ENODEV; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 52512fba80ec..d87a8ab51510 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -173,7 +173,7 @@ static struct dev_data *dev_new (void) { struct dev_data *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; dev->state = STATE_DEV_DISABLED; @@ -614,7 +614,7 @@ ep_read_iter(struct kiocb *iocb, struct iov_iter *to) if (value >= 0 && (copy_to_iter(buf, value, to) != value)) value = -EFAULT; } else { - struct kiocb_priv *priv = kzalloc_obj(*priv, GFP_KERNEL); + struct kiocb_priv *priv = kzalloc_obj(*priv); value = -ENOMEM; if (!priv) goto fail; @@ -682,7 +682,7 @@ ep_write_iter(struct kiocb *iocb, struct iov_iter *from) } else if (is_sync_kiocb(iocb)) { value = ep_io(epdata, buf, len); } else { - struct kiocb_priv *priv = kzalloc_obj(*priv, GFP_KERNEL); + struct kiocb_priv *priv = kzalloc_obj(*priv); value = -ENOMEM; if (priv) { value = ep_aio(iocb, priv, epdata, buf, len); @@ -1598,7 +1598,7 @@ static int activate_ep_files (struct dev_data *dev) gadget_for_each_ep (ep, dev->gadget) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto enomem0; data->state = STATE_EP_DISABLED; diff --git a/drivers/usb/gadget/legacy/raw_gadget.c b/drivers/usb/gadget/legacy/raw_gadget.c index 5cb8d262329f..4febf8dac7ca 100644 --- a/drivers/usb/gadget/legacy/raw_gadget.c +++ b/drivers/usb/gadget/legacy/raw_gadget.c @@ -190,7 +190,7 @@ static struct raw_dev *dev_new(void) { struct raw_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; /* Matches kref_put() in raw_release(). */ @@ -1251,7 +1251,7 @@ static int raw_ioctl_eps_info(struct raw_dev *dev, unsigned long value) struct usb_raw_eps_info *info; struct raw_ep *ep; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { ret = -ENOMEM; goto out; diff --git a/drivers/usb/gadget/udc/amd5536udc_pci.c b/drivers/usb/gadget/udc/amd5536udc_pci.c index e709bd4976c5..cd767b1e3fe7 100644 --- a/drivers/usb/gadget/udc/amd5536udc_pci.c +++ b/drivers/usb/gadget/udc/amd5536udc_pci.c @@ -95,7 +95,7 @@ static int udc_pci_probe( } /* init */ - dev = kzalloc_obj(struct udc, GFP_KERNEL); + dev = kzalloc_obj(struct udc); if (!dev) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/aspeed-vhub/dev.c b/drivers/usb/gadget/udc/aspeed-vhub/dev.c index c79522164f18..2ecd049dacc2 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/dev.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/dev.c @@ -560,7 +560,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) * endpoint 0. */ d->max_epns = min_t(u32, vhub->max_epns, 30); - d->epns = kzalloc_objs(*d->epns, d->max_epns, GFP_KERNEL); + d->epns = kzalloc_objs(*d->epns, d->max_epns); if (!d->epns) return -ENOMEM; @@ -569,7 +569,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) * named "parent" devices for each port so we create a sub device * here for that purpose */ - d->port_dev = kzalloc_obj(struct device, GFP_KERNEL); + d->port_dev = kzalloc_obj(struct device); if (!d->port_dev) { rc = -ENOMEM; goto fail_alloc; diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 427535bf35a6..72a2f95ff018 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -40,7 +40,7 @@ static int queue_dbg_open(struct inode *inode, struct file *file) struct usba_request *req, *req_copy; struct list_head *queue_data; - queue_data = kmalloc_obj(*queue_data, GFP_KERNEL); + queue_data = kmalloc_obj(*queue_data); if (!queue_data) return -ENOMEM; INIT_LIST_HEAD(queue_data); diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index a7f2fe29e433..c0ab3347059a 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -1945,7 +1945,7 @@ static int init_ep(struct bdc *bdc, u32 epnum, u32 dir) struct bdc_ep *ep; dev_dbg(bdc->dev, "%s epnum=%d dir=%d\n", __func__, epnum, dir); - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 394ed540c22f..08d2a93b3bba 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -1393,7 +1393,7 @@ int usb_add_gadget(struct usb_gadget *gadget) struct usb_udc *udc; int ret = -ENOMEM; - udc = kzalloc_obj(*udc, GFP_KERNEL); + udc = kzalloc_obj(*udc); if (!udc) goto error; diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index e183f36b2b0b..c9eca90376e2 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -2819,7 +2819,7 @@ static int __init dummy_hcd_init(void) } } for (i = 0; i < mod_data.num; i++) { - dum[i] = kzalloc_obj(struct dummy, GFP_KERNEL); + dum[i] = kzalloc_obj(struct dummy); if (!dum[i]) { retval = -ENOMEM; goto err_add_pdata; diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index edbffafa6fa7..bf87285ad13c 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -2344,7 +2344,7 @@ static struct qe_udc *qe_udc_config(struct platform_device *ofdev) u64 size; u32 offset; - udc = kzalloc_obj(*udc, GFP_KERNEL); + udc = kzalloc_obj(*udc); if (!udc) goto cleanup; diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 961728e92a88..600ce8cc0fef 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2250,7 +2250,7 @@ static int struct_udc_setup(struct fsl_udc *udc, pdata = dev_get_platdata(&pdev->dev); udc->phy_mode = pdata->phy_mode; - udc->eps = kzalloc_objs(struct fsl_ep, udc->max_ep, GFP_KERNEL); + udc->eps = kzalloc_objs(struct fsl_ep, udc->max_ep); if (!udc->eps) { dev_err(&udc->gadget.dev, "kmalloc udc endpoint status failed\n"); goto eps_alloc_failed; @@ -2369,7 +2369,7 @@ static int fsl_udc_probe(struct platform_device *pdev) unsigned int i; u32 dccparams; - udc_controller = kzalloc_obj(struct fsl_udc, GFP_KERNEL); + udc_controller = kzalloc_obj(struct fsl_udc); if (udc_controller == NULL) return -ENOMEM; diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index f9ddf22c57ef..db42a5e3e805 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c @@ -1755,7 +1755,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* alloc, and start init */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { retval = -ENOMEM; goto err; diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 08ae3d5a79ff..d77c11c4eb38 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1571,7 +1571,7 @@ static int m66592_probe(struct platform_device *pdev) } /* initialize ucd */ - m66592 = kzalloc_obj(struct m66592, GFP_KERNEL); + m66592 = kzalloc_obj(struct m66592); if (m66592 == NULL) { ret = -ENOMEM; goto clean_up; diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index aa1a88a2aa3b..d02765bd49ce 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -3625,7 +3625,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id) int retval, i; /* alloc, and start init */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { retval = -ENOMEM; goto done; diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index 8dda63c38ee5..91139ae668f4 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -2627,7 +2627,7 @@ omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv) /* UDC_PULLUP_EN gates the chip clock */ /* OTG_SYSCON_1 |= DEV_IDLE_EN; */ - udc = kzalloc_obj(*udc, GFP_KERNEL); + udc = kzalloc_obj(*udc); if (!udc) return -ENOMEM; diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index cc3f2da39d71..3cf743c81eb4 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c @@ -917,7 +917,7 @@ static struct debug_buffer *alloc_buffer(struct usb_bus *bus, { struct debug_buffer *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (buf) { buf->bus = bus; diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 445847b92f33..271bcbe9b326 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c @@ -193,7 +193,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) { int i; - fhci->hc_list = kzalloc_obj(*fhci->hc_list, GFP_KERNEL); + fhci->hc_list = kzalloc_obj(*fhci->hc_list); if (!fhci->hc_list) goto err; @@ -203,7 +203,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) INIT_LIST_HEAD(&fhci->hc_list->intr_list); INIT_LIST_HEAD(&fhci->hc_list->done_list); - fhci->vroot_hub = kzalloc_obj(*fhci->vroot_hub, GFP_KERNEL); + fhci->vroot_hub = kzalloc_obj(*fhci->vroot_hub); if (!fhci->vroot_hub) goto err; @@ -217,7 +217,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) for (i = 0; i < MAX_TDS; i++) { struct td *td; - td = kmalloc_obj(*td, GFP_KERNEL); + td = kmalloc_obj(*td); if (!td) goto err; fhci_recycle_empty_td(fhci, td); @@ -225,7 +225,7 @@ static int fhci_mem_init(struct fhci_hcd *fhci) for (i = 0; i < MAX_EDS; i++) { struct ed *ed; - ed = kmalloc_obj(*ed, GFP_KERNEL); + ed = kmalloc_obj(*ed); if (!ed) goto err; fhci_recycle_empty_ed(fhci, ed); @@ -264,7 +264,7 @@ static int fhci_usb_init(struct fhci_hcd *fhci) usb->max_frame_usage = FRAME_TIME_USAGE; usb->sw_transaction_time = SW_FIX_TIME_BETWEEN_TRANSACTION; - usb->actual_frame = kzalloc_obj(*usb->actual_frame, GFP_KERNEL); + usb->actual_frame = kzalloc_obj(*usb->actual_frame); if (!usb->actual_frame) { fhci_usb_free(usb); return -ENOMEM; @@ -306,7 +306,7 @@ static struct fhci_usb *fhci_create_lld(struct fhci_hcd *fhci) struct fhci_usb *usb; /* allocate memory for SCC data structure */ - usb = kzalloc_obj(*usb, GFP_KERNEL); + usb = kzalloc_obj(*usb); if (!usb) return NULL; diff --git a/drivers/usb/host/fhci-tds.c b/drivers/usb/host/fhci-tds.c index 6fb4feb4ad7b..d7482dc0604e 100644 --- a/drivers/usb/host/fhci-tds.c +++ b/drivers/usb/host/fhci-tds.c @@ -161,7 +161,7 @@ u32 fhci_create_ep(struct fhci_usb *usb, enum fhci_mem_alloc data_mem, return -EINVAL; } - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; @@ -183,7 +183,7 @@ u32 fhci_create_ep(struct fhci_usb *usb, enum fhci_mem_alloc data_mem, struct packet *pkt; u8 *buff; - pkt = kmalloc_obj(*pkt, GFP_KERNEL); + pkt = kmalloc_obj(*pkt); if (!pkt) { err_for = "frame"; goto err; diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 82e231e05dc2..0e17c988d36a 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1878,10 +1878,10 @@ max3421_probe(struct spi_device *spi) INIT_LIST_HEAD(&max3421_hcd->ep_list); spi_set_drvdata(spi, max3421_hcd); - max3421_hcd->tx = kmalloc_obj(*max3421_hcd->tx, GFP_KERNEL); + max3421_hcd->tx = kmalloc_obj(*max3421_hcd->tx); if (!max3421_hcd->tx) goto error; - max3421_hcd->rx = kmalloc_obj(*max3421_hcd->rx, GFP_KERNEL); + max3421_hcd->rx = kmalloc_obj(*max3421_hcd->rx); if (!max3421_hcd->rx) goto error; diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c index 30e22acd9461..9e0e06bbc570 100644 --- a/drivers/usb/host/ohci-dbg.c +++ b/drivers/usb/host/ohci-dbg.c @@ -667,7 +667,7 @@ static struct debug_buffer *alloc_buffer(struct ohci_hcd *ohci, { struct debug_buffer *buf; - buf = kzalloc_obj(struct debug_buffer, GFP_KERNEL); + buf = kzalloc_obj(struct debug_buffer); if (buf) { buf->ohci = ohci; diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index afdbcac3185c..ada91ca33f65 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c @@ -178,7 +178,7 @@ static int sl811_cs_probe(struct pcmcia_device *link) { local_info_t *local; - local = kzalloc_obj(local_info_t, GFP_KERNEL); + local = kzalloc_obj(local_info_t); if (!local) return -ENOMEM; local->p_dev = link; diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 675107e9bae0..e91ec6a4fa74 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -561,7 +561,7 @@ static int uhci_debug_open(struct inode *inode, struct file *file) struct uhci_debug *up; unsigned long flags; - up = kmalloc_obj(*up, GFP_KERNEL); + up = kmalloc_obj(*up); if (!up) return -ENOMEM; diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 31995b12598f..7e6f7d72f03e 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -1425,7 +1425,7 @@ xhci_alloc_dbc(struct device *dev, void __iomem *base, const struct dbc_driver * struct xhci_dbc *dbc; int ret; - dbc = kzalloc_obj(*dbc, GFP_KERNEL); + dbc = kzalloc_obj(*dbc); if (!dbc) return NULL; diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c index a058277b5ff9..2e7384c6b6ec 100644 --- a/drivers/usb/host/xhci-dbgtty.c +++ b/drivers/usb/host/xhci-dbgtty.c @@ -584,7 +584,7 @@ int xhci_dbc_tty_probe(struct device *dev, void __iomem *base, struct xhci_hcd * if (!dbc_tty_driver) return -ENODEV; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c index 296ff14d4e9a..890fc5e892f1 100644 --- a/drivers/usb/host/xhci-debugfs.c +++ b/drivers/usb/host/xhci-debugfs.c @@ -87,7 +87,7 @@ static struct xhci_regset *xhci_debugfs_alloc_regset(struct xhci_hcd *xhci) { struct xhci_regset *regset; - regset = kzalloc_obj(*regset, GFP_KERNEL); + regset = kzalloc_obj(*regset); if (!regset) return NULL; @@ -468,7 +468,7 @@ void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, if (spriv->eps[ep_index]) return; - epriv = kzalloc_obj(*epriv, GFP_KERNEL); + epriv = kzalloc_obj(*epriv); if (!epriv) return; @@ -608,7 +608,7 @@ void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id) struct xhci_slot_priv *priv; struct xhci_virt_device *dev = xhci->devs[slot_id]; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return; diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index ef255b968ab6..9377fb2bd163 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -193,7 +193,7 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) tt = *ptt; if (!tt) { /* Create the mu3h_sch_tt */ - tt = kzalloc_obj(*tt, GFP_KERNEL); + tt = kzalloc_obj(*tt); if (!tt) { if (allocated_index) { utt->hcpriv = NULL; @@ -891,7 +891,7 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) /* ss IN and OUT are separated */ num_usb_bus = xhci->usb3_rhub.num_ports * 2 + xhci->usb2_rhub.num_ports; - sch_array = kzalloc_objs(*sch_array, num_usb_bus, GFP_KERNEL); + sch_array = kzalloc_objs(*sch_array, num_usb_bus); if (sch_array == NULL) return -ENOMEM; diff --git a/drivers/usb/host/xhci-sideband.c b/drivers/usb/host/xhci-sideband.c index 3ebe22755693..abbcc0e44f1b 100644 --- a/drivers/usb/host/xhci-sideband.c +++ b/drivers/usb/host/xhci-sideband.c @@ -28,11 +28,11 @@ xhci_ring_to_sgtable(struct xhci_sideband *sb, struct xhci_ring *ring) dev = xhci_to_hcd(sb->xhci)->self.sysdev; sz = ring->num_segs * TRB_SEGMENT_SIZE; n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; - pages = kvmalloc_objs(struct page *, n_pages, GFP_KERNEL); + pages = kvmalloc_objs(struct page *, n_pages); if (!pages) return NULL; - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { kvfree(pages); return NULL; diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index 9cb74eb91b07..8d8e79afa600 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -982,7 +982,7 @@ static int __init usb_mdc800_init (void) { int retval = -ENODEV; /* Allocate Memory */ - mdc800=kzalloc_obj(struct mdc800_data, GFP_KERNEL); + mdc800=kzalloc_obj(struct mdc800_data); if (!mdc800) goto cleanup_on_fail; diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 20b0b3736322..45dc209f5fe5 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -723,7 +723,7 @@ static int mts_usb_probe(struct usb_interface *intf, } - new_desc = kzalloc_obj(struct mts_desc, GFP_KERNEL); + new_desc = kzalloc_obj(struct mts_desc); if (!new_desc) goto out; diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 2c311dc92ab9..369d0d2ee2be 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -657,7 +657,7 @@ static int adu_probe(struct usb_interface *interface, int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(struct adu_device, GFP_KERNEL); + dev = kzalloc_obj(struct adu_device); if (!dev) return -ENOMEM; diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c index 8cf08fbda163..339f6cd2e9b2 100644 --- a/drivers/usb/misc/apple-mfi-fastcharge.c +++ b/drivers/usb/misc/apple-mfi-fastcharge.c @@ -184,7 +184,7 @@ static int mfi_fc_probe(struct usb_device *udev) if (!mfi_fc_match(udev)) return -ENODEV; - mfi = kzalloc_obj(struct mfi_device, GFP_KERNEL); + mfi = kzalloc_obj(struct mfi_device); if (!mfi) return -ENOMEM; diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index e9b26cf7bcfc..4beebde59842 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -226,7 +226,7 @@ static int appledisplay_probe(struct usb_interface *iface, int_in_endpointAddr = endpoint->bEndpointAddress; /* allocate memory for our device state and initialize it */ - pdata = kzalloc_obj(struct appledisplay, GFP_KERNEL); + pdata = kzalloc_obj(struct appledisplay); if (!pdata) { retval = -ENOMEM; goto error; diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index 039e2b1bba00..d8016540953f 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c @@ -143,7 +143,7 @@ static int chaoskey_probe(struct usb_interface *interface, /* Looks good, allocate and initialize */ - dev = kzalloc_obj(struct chaoskey, GFP_KERNEL); + dev = kzalloc_obj(struct chaoskey); if (dev == NULL) goto out; diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index ace0ec94506c..99185fc3e9df 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c @@ -211,7 +211,7 @@ static int cypress_probe(struct usb_interface *interface, int retval = -ENOMEM; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto error_mem; diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 6af966118792..2bf082474e9d 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -307,7 +307,7 @@ static int cytherm_probe(struct usb_interface *interface, struct usb_cytherm *dev; int retval = -ENOMEM; - dev = kzalloc_obj(struct usb_cytherm, GFP_KERNEL); + dev = kzalloc_obj(struct usb_cytherm); if (!dev) goto error_mem; diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index 1f649eedfa68..0f6b3464c2d6 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -330,7 +330,7 @@ static int idmouse_probe(struct usb_interface *interface, return -ENODEV; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) return -ENOMEM; diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 5f882cb6ff07..18670dfed2e7 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -777,7 +777,7 @@ static int iowarrior_probe(struct usb_interface *interface, int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(struct iowarrior, GFP_KERNEL); + dev = kzalloc_obj(struct iowarrior); if (!dev) return retval; diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index cb7125a5b27f..c74f142f6637 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -656,7 +656,7 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id * /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto exit; mutex_init(&dev->mutex); diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index a2909dee0d2a..052ffc2e71ee 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -748,7 +748,7 @@ static int tower_probe(struct usb_interface *interface, const struct usb_device_ int result; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto exit; diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c index 52d84e2d8193..9b6e10177f80 100644 --- a/drivers/usb/misc/lvstest.c +++ b/drivers/usb/misc/lvstest.c @@ -260,7 +260,7 @@ static ssize_t get_dev_desc_store(struct device *dev, struct usb_device_descriptor *descriptor; int ret; - descriptor = kmalloc_obj(*descriptor, GFP_KERNEL); + descriptor = kmalloc_obj(*descriptor); if (!descriptor) return -ENOMEM; diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c index 40572d7192f6..ba37eb99efba 100644 --- a/drivers/usb/misc/onboard_usb_dev.c +++ b/drivers/usb/misc/onboard_usb_dev.c @@ -202,7 +202,7 @@ static int onboard_dev_add_usbdev(struct onboard_dev *onboard_dev, goto error; } - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) { err = -ENOMEM; goto error; diff --git a/drivers/usb/misc/onboard_usb_dev_pdevs.c b/drivers/usb/misc/onboard_usb_dev_pdevs.c index 2550108bf73c..cdb6949e18ec 100644 --- a/drivers/usb/misc/onboard_usb_dev_pdevs.c +++ b/drivers/usb/misc/onboard_usb_dev_pdevs.c @@ -109,7 +109,7 @@ void onboard_dev_create_pdevs(struct usb_device *parent_hub, struct list_head *p goto node_put; } - pdle = kzalloc_obj(*pdle, GFP_KERNEL); + pdle = kzalloc_obj(*pdle); if (!pdle) { of_platform_device_destroy(&pdev->dev, NULL); goto node_put; diff --git a/drivers/usb/misc/sisusbvga/sisusbvga.c b/drivers/usb/misc/sisusbvga/sisusbvga.c index be7e7abc47c6..3e75a7c24828 100644 --- a/drivers/usb/misc/sisusbvga/sisusbvga.c +++ b/drivers/usb/misc/sisusbvga/sisusbvga.c @@ -2797,7 +2797,7 @@ static int sisusb_probe(struct usb_interface *intf, dev->devnum); /* Allocate memory for our private */ - sisusb = kzalloc_obj(*sisusb, GFP_KERNEL); + sisusb = kzalloc_obj(*sisusb); if (!sisusb) return -ENOMEM; diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index a43f2ef30433..6aaec2db360b 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -86,7 +86,7 @@ static int tv_probe(struct usb_interface *interface, struct trancevibrator *dev; int retval; - dev = kzalloc_obj(struct trancevibrator, GFP_KERNEL); + dev = kzalloc_obj(struct trancevibrator); if (!dev) { retval = -ENOMEM; goto error; diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c index a959dd824f0e..7e85fd12da56 100644 --- a/drivers/usb/misc/usb-ljca.c +++ b/drivers/usb/misc/usb-ljca.c @@ -529,7 +529,7 @@ static int ljca_new_client_device(struct ljca_adapter *adap, u8 type, u8 id, struct ljca_client *client; int ret; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) { kfree(data); return -ENOMEM; @@ -597,7 +597,7 @@ static int ljca_enumerate_gpio(struct ljca_adapter *adap) return -EINVAL; /* construct platform data */ - gpio_info = kzalloc_obj(*gpio_info, GFP_KERNEL); + gpio_info = kzalloc_obj(*gpio_info); if (!gpio_info) return -ENOMEM; gpio_info->num = gpio_num; @@ -630,7 +630,7 @@ static int ljca_enumerate_i2c(struct ljca_adapter *adap) for (i = 0; i < desc->num; i++) { /* construct platform data */ - i2c_info = kzalloc_obj(*i2c_info, GFP_KERNEL); + i2c_info = kzalloc_obj(*i2c_info); if (!i2c_info) return -ENOMEM; @@ -669,7 +669,7 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap) for (i = 0; i < desc->num; i++) { /* construct platform data */ - spi_info = kzalloc_obj(*spi_info, GFP_KERNEL); + spi_info = kzalloc_obj(*spi_info); if (!spi_info) return -ENOMEM; diff --git a/drivers/usb/misc/usbio.c b/drivers/usb/misc/usbio.c index 50ff9f1ca78f..2e68d48a2cc0 100644 --- a/drivers/usb/misc/usbio.c +++ b/drivers/usb/misc/usbio.c @@ -439,7 +439,7 @@ static int usbio_add_client(struct usbio_device *usbio, char *name, u8 id, void struct auxiliary_device *adev; int ret; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index be798a293904..f794695dea9d 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -323,7 +323,7 @@ static int lcd_probe(struct usb_interface *interface, int retval; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index 97fcb35513ce..b37bf53dd54f 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c @@ -308,7 +308,7 @@ static int sevseg_probe(struct usb_interface *interface, struct usb_sevsegdev *mydev; int rc = -ENOMEM; - mydev = kzalloc_obj(struct usb_sevsegdev, GFP_KERNEL); + mydev = kzalloc_obj(struct usb_sevsegdev); if (!mydev) goto error_mem; diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 689cf82ce47d..98071b25ac07 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -545,7 +545,7 @@ alloc_sglist(int nents, int max, int vary, struct usbtest_dev *dev, int pipe) if (max == 0) return NULL; - sg = kmalloc_objs(*sg, nents, GFP_KERNEL); + sg = kmalloc_objs(*sg, nents); if (!sg) return NULL; sg_init_table(sg, nents); @@ -1221,7 +1221,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param) * as with bulk/intr sglists, sglen is the queue depth; it also * controls which subtests run (more tests than sglen) or rerun. */ - urb = kzalloc_objs(struct urb *, param->sglen, GFP_KERNEL); + urb = kzalloc_objs(struct urb *, param->sglen); if (!urb) return -ENOMEM; for (i = 0; i < param->sglen; i++) { @@ -1370,7 +1370,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param) if (!u) goto cleanup; - reqp = kmalloc_obj(*reqp, GFP_KERNEL); + reqp = kmalloc_obj(*reqp); if (!reqp) goto cleanup; reqp->setup = req; @@ -1572,7 +1572,7 @@ static int unlink_queued(struct usbtest_dev *dev, int pipe, unsigned num, memset(buf, 0, size); /* Allocate and init the urbs we'll queue */ - ctx.urbs = kzalloc_objs(struct urb *, num, GFP_KERNEL); + ctx.urbs = kzalloc_objs(struct urb *, num); if (!ctx.urbs) goto free_buf; for (i = 0; i < num; i++) { @@ -2052,7 +2052,7 @@ test_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param, if (param->sglen > MAX_SGLEN) return -EINVAL; - urbs = kzalloc_objs(*urbs, param->sglen, GFP_KERNEL); + urbs = kzalloc_objs(*urbs, param->sglen); if (!urbs) return -ENOMEM; @@ -2786,7 +2786,7 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id) } #endif - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; info = (struct usbtest_info *) id->driver_info; diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 46356d099d26..ec8bd968c4de 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -701,7 +701,7 @@ static int uss720_probe(struct usb_interface *intf, /* * Allocate parport interface */ - priv = kzalloc_obj(struct parport_uss720_private, GFP_KERNEL); + priv = kzalloc_obj(struct parport_uss720_private); if (!priv) { usb_put_dev(usbdev); return -ENOMEM; diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 2e2057ef5b68..9189e4bb213a 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -197,7 +197,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ int res; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto error; kref_init(&dev->kref); diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index c0c4eb0a166d..d84749829963 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -694,7 +694,7 @@ static int mon_bin_open(struct inode *inode, struct file *file) return -ENODEV; } - rp = kzalloc_obj(struct mon_reader_bin, GFP_KERNEL); + rp = kzalloc_obj(struct mon_reader_bin); if (rp == NULL) { rc = -ENOMEM; goto err_alloc; diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index b3a68ac6fb98..e4fff194fea0 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c @@ -273,7 +273,7 @@ static void mon_bus_init(struct usb_bus *ubus) { struct mon_bus *mbus; - mbus = kzalloc_obj(struct mon_bus, GFP_KERNEL); + mbus = kzalloc_obj(struct mon_bus); if (mbus == NULL) goto err_alloc; kref_init(&mbus->ref); diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index 8329c1fc719e..3ee2e483da57 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c @@ -29,7 +29,7 @@ static int mon_stat_open(struct inode *inode, struct file *file) struct mon_bus *mbus; struct snap *sp; - sp = kmalloc_obj(struct snap, GFP_KERNEL); + sp = kmalloc_obj(struct snap); if (sp == NULL) return -ENOMEM; diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index b55016068b47..4c8e2518e407 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c @@ -330,7 +330,7 @@ static int mon_text_open(struct inode *inode, struct file *file) mutex_lock(&mon_lock); mbus = inode->i_private; - rp = kzalloc_obj(struct mon_reader_text, GFP_KERNEL); + rp = kzalloc_obj(struct mon_reader_text); if (rp == NULL) { rc = -ENOMEM; goto err_alloc; diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 9215373a9738..66dbfe1705d5 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -613,7 +613,7 @@ static int mtu3_mem_alloc(struct mtu3 *mtu) /* one for ep0, another is reserved */ mtu->num_eps = min(in_ep_num, out_ep_num) + 1; - ep_array = kzalloc_objs(*ep_array, mtu->num_eps * 2, GFP_KERNEL); + ep_array = kzalloc_objs(*ep_array, mtu->num_eps * 2); if (ep_array == NULL) return -ENOMEM; diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 240953cdf46d..28e958fcc862 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -756,7 +756,7 @@ cppi41_dma_controller_create(struct musb *musb, void __iomem *base) return NULL; } - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) goto kzalloc_fail; diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 9cd4616d853e..8c6c643fcb2c 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -395,7 +395,7 @@ dma_controller_alloc(struct musb *musb, void __iomem *base) { struct musb_dma_controller *controller; - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) return NULL; diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index ed8fea4738cd..36ee61a52e7e 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -596,7 +596,7 @@ tusb_dma_controller_create(struct musb *musb, void __iomem *base) | TUSB_DMA_REQ_CONF_DMA_REQ_EN(0x3f) | TUSB_DMA_REQ_CONF_DMA_REQ_ASSER(2)); - tusb_dma = kzalloc_obj(struct tusb_omap_dma, GFP_KERNEL); + tusb_dma = kzalloc_obj(struct tusb_omap_dma); if (!tusb_dma) goto out; @@ -615,13 +615,13 @@ tusb_dma_controller_create(struct musb *musb, void __iomem *base) struct dma_channel *ch; struct tusb_omap_dma_ch *chdat; - ch = kzalloc_obj(struct dma_channel, GFP_KERNEL); + ch = kzalloc_obj(struct dma_channel); if (!ch) goto cleanup; dma_channel_pool[i] = ch; - chdat = kzalloc_obj(struct tusb_omap_dma_ch, GFP_KERNEL); + chdat = kzalloc_obj(struct tusb_omap_dma_ch); if (!chdat) goto cleanup; diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index 0621a6c0c6b6..bbb4978c0cd5 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -362,7 +362,7 @@ ux500_dma_controller_create(struct musb *musb, void __iomem *base) struct resource *iomem; int ret; - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) goto kzalloc_fail; diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index f5712dddd1fd..35d79f11b03d 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -779,11 +779,11 @@ static int fsl_otg_conf(struct platform_device *pdev) return 0; /* allocate space to fsl otg device */ - fsl_otg_tc = kzalloc_obj(struct fsl_otg, GFP_KERNEL); + fsl_otg_tc = kzalloc_obj(struct fsl_otg); if (!fsl_otg_tc) return -ENOMEM; - fsl_otg_tc->phy.otg = kzalloc_obj(struct usb_otg, GFP_KERNEL); + fsl_otg_tc->phy.otg = kzalloc_obj(struct usb_otg); if (!fsl_otg_tc->phy.otg) { kfree(fsl_otg_tc); return -ENOMEM; diff --git a/drivers/usb/phy/phy-fsl-usb.h b/drivers/usb/phy/phy-fsl-usb.h index 487a11ff4391..95bfe7f1b83a 100644 --- a/drivers/usb/phy/phy-fsl-usb.h +++ b/drivers/usb/phy/phy-fsl-usb.h @@ -345,7 +345,7 @@ inline struct fsl_otg_timer *otg_timer_initializer { struct fsl_otg_timer *timer; - timer = kmalloc_obj(struct fsl_otg_timer, GFP_KERNEL); + timer = kmalloc_obj(struct fsl_otg_timer); if (!timer) return NULL; timer->function = function; diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index ca96c0164593..1539e8e6901d 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -1084,11 +1084,11 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) int i; int ret; - gpriv = kzalloc_obj(struct usbhsg_gpriv, GFP_KERNEL); + gpriv = kzalloc_obj(struct usbhsg_gpriv); if (!gpriv) return -ENOMEM; - uep = kzalloc_objs(struct usbhsg_uep, pipe_size, GFP_KERNEL); + uep = kzalloc_objs(struct usbhsg_uep, pipe_size); if (!uep) { ret = -ENOMEM; goto usbhs_mod_gadget_probe_err_gpriv; diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index f48a22037f43..e4e897e8256f 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c @@ -822,7 +822,7 @@ int usbhs_pipe_probe(struct usbhs_priv *priv) return -EINVAL; } - info->pipe = kzalloc_objs(struct usbhs_pipe, pipe_size, GFP_KERNEL); + info->pipe = kzalloc_objs(struct usbhs_pipe, pipe_size); if (!info->pipe) return -ENOMEM; diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c index 31c2c3e370dd..b8e28ceca51e 100644 --- a/drivers/usb/roles/class.c +++ b/drivers/usb/roles/class.c @@ -364,7 +364,7 @@ usb_role_switch_register(struct device *parent, if (!desc || !desc->set) return ERR_PTR(-EINVAL); - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 336d199e4994..d974da43fba3 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -126,7 +126,7 @@ static int ark3116_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct ark3116_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 334f59c512d7..38ac910b1082 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -114,7 +114,7 @@ static int belkin_sa_port_probe(struct usb_serial_port *port) struct usb_device *dev = port->serial->dev; struct belkin_sa_private *priv; - priv = kmalloc_obj(struct belkin_sa_private, GFP_KERNEL); + priv = kmalloc_obj(struct belkin_sa_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index ceb2612a9228..569f4aede215 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -381,7 +381,7 @@ static int ch341_port_probe(struct usb_serial_port *port) struct ch341_private *priv; int r; - priv = kzalloc_obj(struct ch341_private, GFP_KERNEL); + priv = kzalloc_obj(struct ch341_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 4b5f56bd01e8..29f09190846e 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -133,7 +133,7 @@ static int usb_console_setup(struct console *co, char *options) * the termios structure, then later call set_termios to * configure according to command line arguments */ - tty = kzalloc_obj(*tty, GFP_KERNEL); + tty = kzalloc_obj(*tty); if (!tty) { retval = -ENOMEM; goto reset_open_count; diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 3c30dd095b32..333b8b463704 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -2006,7 +2006,7 @@ static int cp210x_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct cp210x_port_private *port_priv; - port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv); if (!port_priv) return -ENOMEM; @@ -2163,7 +2163,7 @@ static int cp210x_attach(struct usb_serial *serial) int result; struct cp210x_serial_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 609d3a700b70..4e8ceb23c27d 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -101,7 +101,7 @@ static int cyberjack_port_probe(struct usb_serial_port *port) struct cyberjack_private *priv; int result; - priv = kmalloc_obj(struct cyberjack_private, GFP_KERNEL); + priv = kmalloc_obj(struct cyberjack_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 52d52a92b7ea..afff1a0f4298 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -445,7 +445,7 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) return -ENODEV; } - priv = kzalloc_obj(struct cypress_private, GFP_KERNEL); + priv = kzalloc_obj(struct cypress_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 8a8d4dc899b0..d515df045c4c 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -1209,7 +1209,7 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num) { struct digi_port *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -1231,7 +1231,7 @@ static int digi_startup(struct usb_serial *serial) struct digi_serial *serial_priv; int ret; - serial_priv = kzalloc_obj(*serial_priv, GFP_KERNEL); + serial_priv = kzalloc_obj(*serial_priv); if (!serial_priv) return -ENOMEM; diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 7500e1a85c88..af14548fa03d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2188,7 +2188,7 @@ static int ftdi_port_probe(struct usb_serial_port *port) struct ftdi_private *priv; int result; - priv = kzalloc_obj(struct ftdi_private, GFP_KERNEL); + priv = kzalloc_obj(struct ftdi_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index aa7561aba927..7205483a0115 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -1373,7 +1373,7 @@ static int garmin_port_probe(struct usb_serial_port *port) int status; struct garmin_data *garmin_data_p; - garmin_data_p = kzalloc_obj(struct garmin_data, GFP_KERNEL); + garmin_data_p = kzalloc_obj(struct garmin_data); if (!garmin_data_p) return -ENOMEM; diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index b036fcde63e4..58694b8943d1 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -498,7 +498,7 @@ static int get_epic_descriptor(struct edgeport_serial *ep) ep->is_epic = 0; - epic = kmalloc_obj(*epic, GFP_KERNEL); + epic = kmalloc_obj(*epic); if (!epic) return -ENOMEM; @@ -2714,7 +2714,7 @@ static int edge_startup(struct usb_serial *serial) dev = serial->dev; /* create our private serial structure */ - edge_serial = kzalloc_obj(struct edgeport_serial, GFP_KERNEL); + edge_serial = kzalloc_obj(struct edgeport_serial); if (!edge_serial) return -ENOMEM; @@ -2956,7 +2956,7 @@ static int edge_port_probe(struct usb_serial_port *port) { struct edgeport_port *edge_port; - edge_port = kzalloc_obj(*edge_port, GFP_KERNEL); + edge_port = kzalloc_obj(*edge_port); if (!edge_port) return -ENOMEM; diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index fed02fdf3dcb..cb55370e036f 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -528,7 +528,7 @@ static int tx_active(struct edgeport_port *port) u8 *lsr; int bytes_left = 0; - oedb = kmalloc_obj(*oedb, GFP_KERNEL); + oedb = kmalloc_obj(*oedb); if (!oedb) return -ENOMEM; @@ -680,7 +680,7 @@ static int check_i2c_image(struct edgeport_serial *serial) u8 *buffer; u16 ttype; - rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc); if (!rom_desc) return -ENOMEM; @@ -759,7 +759,7 @@ static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer) struct edge_ti_manuf_descriptor *desc; struct device *dev = &serial->serial->dev->dev; - rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc); if (!rom_desc) return -ENOMEM; @@ -1089,7 +1089,7 @@ static int do_download_mode(struct edgeport_serial *serial, * Validate Hardware version number * Read Manufacturing Descriptor from TI Based Edgeport */ - ti_manuf_desc = kmalloc_obj(*ti_manuf_desc, GFP_KERNEL); + ti_manuf_desc = kmalloc_obj(*ti_manuf_desc); if (!ti_manuf_desc) return -ENOMEM; @@ -1107,7 +1107,7 @@ static int do_download_mode(struct edgeport_serial *serial, return -EINVAL; } - rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc); if (!rom_desc) { kfree(ti_manuf_desc); return -ENOMEM; @@ -1123,7 +1123,7 @@ static int do_download_mode(struct edgeport_serial *serial, dev_dbg(dev, "%s - Found Type FIRMWARE (Type 2) record\n", __func__); - firmware_version = kmalloc_obj(*firmware_version, GFP_KERNEL); + firmware_version = kmalloc_obj(*firmware_version); if (!firmware_version) { kfree(rom_desc); kfree(ti_manuf_desc); @@ -1418,7 +1418,7 @@ static int do_boot_mode(struct edgeport_serial *serial, * Validate Hardware version number * Read Manufacturing Descriptor from TI Based Edgeport */ - ti_manuf_desc = kmalloc_obj(*ti_manuf_desc, GFP_KERNEL); + ti_manuf_desc = kmalloc_obj(*ti_manuf_desc); if (!ti_manuf_desc) return -ENOMEM; @@ -2218,7 +2218,7 @@ static void change_port_settings(struct tty_struct *tty, unsigned cflag; int status; - config = kmalloc_obj(*config, GFP_KERNEL); + config = kmalloc_obj(*config); if (!config) { tty->termios = *old_termios; return; @@ -2457,7 +2457,7 @@ static void edge_heartbeat_work(struct work_struct *work) serial = container_of(work, struct edgeport_serial, heartbeat_work.work); - rom_desc = kmalloc_obj(*rom_desc, GFP_KERNEL); + rom_desc = kmalloc_obj(*rom_desc); /* Descriptor address request is enough to reset the firmware timer */ if (!rom_desc || !get_descriptor_addr(serial, I2C_DESC_TYPE_ION, @@ -2496,7 +2496,7 @@ static int edge_startup(struct usb_serial *serial) u16 product_id; /* create our private serial structure */ - edge_serial = kzalloc_obj(struct edgeport_serial, GFP_KERNEL); + edge_serial = kzalloc_obj(struct edgeport_serial); if (!edge_serial) return -ENOMEM; @@ -2550,7 +2550,7 @@ static int edge_port_probe(struct usb_serial_port *port) struct edgeport_port *edge_port; int ret; - edge_port = kzalloc_obj(*edge_port, GFP_KERNEL); + edge_port = kzalloc_obj(*edge_port); if (!edge_port) return -ENOMEM; diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index ec2b061c0e84..83709d678b3a 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -198,7 +198,7 @@ static int ipw_attach(struct usb_serial *serial) { struct usb_wwan_intf_private *data; - data = kzalloc_obj(struct usb_wwan_intf_private, GFP_KERNEL); + data = kzalloc_obj(struct usb_wwan_intf_private); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 4eeec9c06a11..12e928d25ba1 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -126,7 +126,7 @@ irda_usb_find_class_desc(struct usb_serial *serial, unsigned int ifnum) struct usb_irda_cs_descriptor *desc; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return NULL; diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 6feb886991d6..f8d6aa30a3e1 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c @@ -67,7 +67,7 @@ static int iuu_port_probe(struct usb_serial_port *port) struct iuu_private *priv; int ret; - priv = kzalloc_obj(struct iuu_private, GFP_KERNEL); + priv = kzalloc_obj(struct iuu_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index ba3f80d21e92..46448843541a 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -2789,7 +2789,7 @@ static int keyspan_startup(struct usb_serial *serial) } /* Setup private data for serial driver */ - s_priv = kzalloc_obj(struct keyspan_serial_private, GFP_KERNEL); + s_priv = kzalloc_obj(struct keyspan_serial_private); if (!s_priv) return -ENOMEM; @@ -2886,7 +2886,7 @@ static int keyspan_port_probe(struct usb_serial_port *port) s_priv = usb_get_serial_data(serial); d_details = s_priv->device_details; - p_priv = kzalloc_obj(*p_priv, GFP_KERNEL); + p_priv = kzalloc_obj(*p_priv); if (!p_priv) return -ENOMEM; diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 8a0f993ec7c6..5036600dd334 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -654,7 +654,7 @@ static int keyspan_pda_port_probe(struct usb_serial_port *port) struct keyspan_pda_private *priv; - priv = kmalloc_obj(struct keyspan_pda_private, GFP_KERNEL); + priv = kmalloc_obj(struct keyspan_pda_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index d2960271a1f7..ed8531a64768 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -189,7 +189,7 @@ static int klsi_105_port_probe(struct usb_serial_port *port) { struct klsi_105_private *priv; - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -378,7 +378,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, unsigned long flags; speed_t baud; - cfg = kmalloc_obj(*cfg, GFP_KERNEL); + cfg = kmalloc_obj(*cfg); if (!cfg) return; diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 3f9311b3bdf9..6126afd67a7b 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -130,7 +130,7 @@ static int kobil_port_probe(struct usb_serial_port *port) struct usb_serial *serial = port->serial; struct kobil_private *priv; - priv = kmalloc_obj(struct kobil_private, GFP_KERNEL); + priv = kmalloc_obj(struct kobil_private); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 2bf86c3cc7ff..18844b92bd08 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -385,7 +385,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port) return -ENODEV; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index 7e7fb49fc3d5..bc834cc48550 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c @@ -245,7 +245,7 @@ static int metrousb_port_probe(struct usb_serial_port *port) { struct metrousb_private *metro_priv; - metro_priv = kzalloc_obj(*metro_priv, GFP_KERNEL); + metro_priv = kzalloc_obj(*metro_priv); if (!metro_priv) return -ENOMEM; diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 1495d82bf838..94459408e7fb 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -555,7 +555,7 @@ static int mos7715_parport_init(struct usb_serial *serial) struct mos7715_parport *mos_parport; /* allocate and initialize parallel port control struct */ - mos_parport = kzalloc_obj(struct mos7715_parport, GFP_KERNEL); + mos_parport = kzalloc_obj(struct mos7715_parport); if (!mos_parport) return -ENOMEM; @@ -1703,7 +1703,7 @@ static int mos7720_port_probe(struct usb_serial_port *port) { struct moschip_port *mos7720_port; - mos7720_port = kzalloc_obj(*mos7720_port, GFP_KERNEL); + mos7720_port = kzalloc_obj(*mos7720_port); if (!mos7720_port) return -ENOMEM; diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 065ac3777906..cc663d8191bd 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1532,7 +1532,7 @@ static int mos7840_port_probe(struct usb_serial_port *port) pnum = port->port_number; dev_dbg(&port->dev, "mos7840_startup: configuring port %d\n", pnum); - mos7840_port = kzalloc_obj(struct moschip_port, GFP_KERNEL); + mos7840_port = kzalloc_obj(struct moschip_port); if (!mos7840_port) return -ENOMEM; diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 05f5ab767a53..aa1e9745f967 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -113,7 +113,7 @@ static int omninet_port_probe(struct usb_serial_port *port) { struct omninet_data *od; - od = kzalloc_obj(*od, GFP_KERNEL); + od = kzalloc_obj(*od); if (!od) return -ENOMEM; diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 0ced33c28545..e2bed477ad57 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -354,7 +354,7 @@ static int opticon_port_probe(struct usb_serial_port *port) { struct opticon_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 261d852aaccf..e349ed66d2ac 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -2606,7 +2606,7 @@ static int option_attach(struct usb_serial *serial) struct usb_wwan_intf_private *data; unsigned long device_flags; - data = kzalloc_obj(struct usb_wwan_intf_private, GFP_KERNEL); + data = kzalloc_obj(struct usb_wwan_intf_private); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 70ddda6a300e..3ef5b5d8ce1a 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c @@ -328,7 +328,7 @@ static int oti6858_port_probe(struct usb_serial_port *port) { struct oti6858_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 75fd24019cba..50dc838e8115 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -503,7 +503,7 @@ static int pl2303_startup(struct usb_serial *serial) type = ret; dev_dbg(&serial->interface->dev, "device type: %s\n", pl2303_type_data[type].name); - spriv = kzalloc_obj(*spriv, GFP_KERNEL); + spriv = kzalloc_obj(*spriv); if (!spriv) return -ENOMEM; @@ -555,7 +555,7 @@ static int pl2303_port_probe(struct usb_serial_port *port) { struct pl2303_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index bbc3e33a2d81..1a930dc668e4 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -431,7 +431,7 @@ static int qc_attach(struct usb_serial *serial) struct usb_wwan_intf_private *data; bool sendsetup; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 606beb6e12aa..b05c655b3cc4 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -626,7 +626,7 @@ static int qt2_attach(struct usb_serial *serial) return status; } - serial_priv = kzalloc_obj(*serial_priv, GFP_KERNEL); + serial_priv = kzalloc_obj(*serial_priv); if (!serial_priv) return -ENOMEM; @@ -657,7 +657,7 @@ static int qt2_port_probe(struct usb_serial_port *port) struct qt2_port_private *port_priv; u8 bEndpointAddress; - port_priv = kzalloc_obj(*port_priv, GFP_KERNEL); + port_priv = kzalloc_obj(*port_priv); if (!port_priv) return -ENOMEM; diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 3b6a025cbeb8..6e443aacae07 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -828,7 +828,7 @@ static int sierra_startup(struct usb_serial *serial) { struct sierra_intf_private *intfdata; - intfdata = kzalloc_obj(*intfdata, GFP_KERNEL); + intfdata = kzalloc_obj(*intfdata); if (!intfdata) return -ENOMEM; @@ -861,7 +861,7 @@ static int sierra_port_probe(struct usb_serial_port *port) const struct sierra_iface_list *himemory_list; u8 ifnum; - portdata = kzalloc_obj(*portdata, GFP_KERNEL); + portdata = kzalloc_obj(*portdata); if (!portdata) return -ENOMEM; diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index df1d1eed1236..2fbb48f19efd 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -145,7 +145,7 @@ static int spcp8x5_port_probe(struct usb_serial_port *port) const struct usb_device_id *id = usb_get_serial_data(port->serial); struct spcp8x5_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index f73321fd5dfd..da6316410b77 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -326,7 +326,7 @@ static int ssu100_port_probe(struct usb_serial_port *port) { struct ssu100_port_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 46158cfc546a..7a5aa39172a8 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c @@ -149,7 +149,7 @@ static int symbol_port_probe(struct usb_serial_port *port) { struct symbol_private *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index cb6b0c018809..658b54d8fcef 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -519,7 +519,7 @@ static int ti_startup(struct usb_serial *serial) dev->descriptor.bNumConfigurations, dev->actconfig->desc.bConfigurationValue); - tdev = kzalloc_obj(struct ti_device, GFP_KERNEL); + tdev = kzalloc_obj(struct ti_device); if (!tdev) return -ENOMEM; @@ -598,7 +598,7 @@ static int ti_port_probe(struct usb_serial_port *port) { struct ti_port *tport; - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) return -ENOMEM; @@ -897,7 +897,7 @@ static void ti_set_termios(struct tty_struct *tty, u16 wbaudrate; u16 wflags = 0; - config = kmalloc_obj(*config, GFP_KERNEL); + config = kmalloc_obj(*config); if (!config) return; diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index ecf0ecfceccb..78c4d3c19a8e 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c @@ -161,7 +161,7 @@ static int upd78f0730_port_probe(struct usb_serial_port *port) { struct upd78f0730_port_private *private; - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 26c40f8108e4..0e072fd87c3d 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -688,7 +688,7 @@ static struct usb_serial *create_serial(struct usb_device *dev, { struct usb_serial *serial; - serial = kzalloc_obj(*serial, GFP_KERNEL); + serial = kzalloc_obj(*serial); if (!serial) return NULL; serial->dev = usb_get_dev(dev); @@ -1005,7 +1005,7 @@ static int usb_serial_probe(struct usb_interface *interface, } /* descriptor matches, let's find the endpoints needed */ - epds = kzalloc_obj(*epds, GFP_KERNEL); + epds = kzalloc_obj(*epds); if (!epds) { retval = -ENOMEM; goto err_release_sibling; @@ -1059,7 +1059,7 @@ static int usb_serial_probe(struct usb_interface *interface, dev_dbg(ddev, "setting up %d port structure(s)\n", max_endpoints); for (i = 0; i < max_endpoints; ++i) { - port = kzalloc_obj(struct usb_serial_port, GFP_KERNEL); + port = kzalloc_obj(struct usb_serial_port); if (!port) { retval = -ENOMEM; goto err_free_epds; @@ -1482,7 +1482,7 @@ int __usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers * Suspend/resume support is implemented in the usb-serial core, * so fill in the PM-related fields in udriver. */ - udriver = kzalloc_obj(*udriver, GFP_KERNEL); + udriver = kzalloc_obj(*udriver); if (!udriver) return -ENOMEM; diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index ea529a15c1f6..e752ffa4dc62 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -449,7 +449,7 @@ int usb_wwan_port_probe(struct usb_serial_port *port) if (!port->bulk_in_size || !port->bulk_out_size) return -ENODEV; - portdata = kzalloc_obj(*portdata, GFP_KERNEL); + portdata = kzalloc_obj(*portdata); if (!portdata) return -ENOMEM; diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index c530e7a85cb4..6e2b52b2b5f8 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -278,7 +278,7 @@ static int whiteheat_attach(struct usb_serial *serial) serial->type->description, hw_info->sw_major_rev, hw_info->sw_minor_rev); - command_info = kmalloc_obj(struct whiteheat_command_private, GFP_KERNEL); + command_info = kmalloc_obj(struct whiteheat_command_private); if (!command_info) goto no_command_private; @@ -329,7 +329,7 @@ static int whiteheat_port_probe(struct usb_serial_port *port) { struct whiteheat_private *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 91c0a8d0097a..9fc4082de770 100644 --- a/drivers/usb/serial/xr_serial.c +++ b/drivers/usb/serial/xr_serial.c @@ -756,7 +756,7 @@ static void xr_cdc_set_line_coding(struct tty_struct *tty, struct usb_cdc_line_coding *lc; int ret; - lc = kzalloc_obj(*lc, GFP_KERNEL); + lc = kzalloc_obj(*lc); if (!lc) return; @@ -1020,7 +1020,7 @@ static int xr_port_probe(struct usb_serial_port *port) type_id = (int)(unsigned long)usb_get_serial_data(port->serial); type = &xr_types[type_id]; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c index 5a5f35213c1d..7622bc0426cd 100644 --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -2336,7 +2336,7 @@ static int ene_ub6250_probe(struct usb_interface *intf, return result; /* FIXME: where should the code alloc extra buf ? */ - us->extra = kzalloc_obj(struct ene_ub6250_info, GFP_KERNEL); + us->extra = kzalloc_obj(struct ene_ub6250_info); if (!us->extra) return -ENOMEM; us->extra_destructor = ene_ub6250_info_destructor; diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 92113848913d..a4fd5dda3396 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c @@ -1463,7 +1463,7 @@ static int isd200_init_info(struct us_data *us) { struct isd200_info *info; - info = kzalloc_obj(struct isd200_info, GFP_KERNEL); + info = kzalloc_obj(struct isd200_info); if (!info) return -ENOMEM; diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 083423606ad9..49d281f7bef6 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c @@ -183,7 +183,7 @@ static int onetouch_connect_input(struct us_data *ss) maxp = usb_maxpacket(udev, pipe); maxp = min(maxp, ONETOUCH_PKT_LEN); - onetouch = kzalloc_obj(struct usb_onetouch, GFP_KERNEL); + onetouch = kzalloc_obj(struct usb_onetouch); input_dev = input_allocate_device(); if (!onetouch || !input_dev) goto fail1; diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 12eb1ab224cd..af038b897c6b 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -976,7 +976,7 @@ static int init_realtek_cr(struct us_data *us) struct rts51x_chip *chip; int size, i, retval; - chip = kzalloc_obj(struct rts51x_chip, GFP_KERNEL); + chip = kzalloc_obj(struct rts51x_chip); if (!chip) return -ENOMEM; diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c index 357e5d29da0c..c5e3eeeb2144 100644 --- a/drivers/usb/storage/sierra_ms.c +++ b/drivers/usb/storage/sierra_ms.c @@ -100,7 +100,7 @@ static ssize_t truinst_show(struct device *dev, struct device_attribute *attr, if (swi_tru_install == TRU_FORCE_MS) { result = sysfs_emit(buf, "Forced Mass Storage\n"); } else { - swocInfo = kmalloc_obj(struct swoc_info, GFP_KERNEL); + swocInfo = kmalloc_obj(struct swoc_info); if (!swocInfo) { sysfs_emit(buf, "Error\n"); return -ENOMEM; @@ -149,7 +149,7 @@ int sierra_ms_init(struct us_data *us) else { usb_stor_dbg(us, "SWIMS: Normal SWoC Logic\n"); - swocInfo = kmalloc_obj(struct swoc_info, GFP_KERNEL); + swocInfo = kmalloc_obj(struct swoc_info); if (!swocInfo) return -ENOMEM; diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 0d24d426a176..fa83fe0defe2 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -537,7 +537,7 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) usb_set_intfdata(intf, us); /* Allocate the control/setup and DMA-mapped buffers */ - us->cr = kmalloc_obj(*us->cr, GFP_KERNEL); + us->cr = kmalloc_obj(*us->cr); if (!us->cr) return -ENOMEM; diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 19f793ac6389..831430909471 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -646,7 +646,7 @@ typec_register_altmode(struct device *parent, struct altmode *alt; int ret; - alt = kzalloc_obj(*alt, GFP_KERNEL); + alt = kzalloc_obj(*alt); if (!alt) { altmode_id_remove(parent, id); return ERR_PTR(-ENOMEM); @@ -1113,7 +1113,7 @@ struct typec_partner *typec_register_partner(struct typec_port *port, struct typec_partner *partner; int ret; - partner = kzalloc_obj(*partner, GFP_KERNEL); + partner = kzalloc_obj(*partner); if (!partner) return ERR_PTR(-ENOMEM); @@ -1313,7 +1313,7 @@ struct typec_plug *typec_register_plug(struct typec_cable *cable, char name[8]; int ret; - plug = kzalloc_obj(*plug, GFP_KERNEL); + plug = kzalloc_obj(*plug); if (!plug) return ERR_PTR(-ENOMEM); @@ -1466,7 +1466,7 @@ struct typec_cable *typec_register_cable(struct typec_port *port, struct typec_cable *cable; int ret; - cable = kzalloc_obj(*cable, GFP_KERNEL); + cable = kzalloc_obj(*cable); if (!cable) return ERR_PTR(-ENOMEM); @@ -2703,7 +2703,7 @@ struct typec_port *typec_register_port(struct device *parent, int ret; int id; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/mode_selection.c b/drivers/usb/typec/mode_selection.c index 56c6eced5666..cd376f67e445 100644 --- a/drivers/usb/typec/mode_selection.c +++ b/drivers/usb/typec/mode_selection.c @@ -216,7 +216,7 @@ static int altmode_add_to_list(struct device *dev, void *data) struct mode_state *ms; if (pdev && altmode->ops && altmode->ops->activate) { - ms = kzalloc_obj(*ms, GFP_KERNEL); + ms = kzalloc_obj(*ms); if (!ms) return -ENOMEM; ms->svid = pdev->svid; @@ -240,7 +240,7 @@ int typec_mode_selection_start(struct typec_partner *partner, if (partner->sel) return -EALREADY; - sel = kzalloc_obj(*sel, GFP_KERNEL); + sel = kzalloc_obj(*sel); if (!sel) return -ENOMEM; diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index e09de0d3f32f..58fb97ea6877 100644 --- a/drivers/usb/typec/mux.c +++ b/drivers/usb/typec/mux.c @@ -76,7 +76,7 @@ struct typec_switch *fwnode_typec_switch_get(struct fwnode_handle *fwnode) int err; int i; - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); @@ -171,7 +171,7 @@ typec_switch_register(struct device *parent, if (!desc || !desc->set) return ERR_PTR(-EINVAL); - sw_dev = kzalloc_obj(*sw_dev, GFP_KERNEL); + sw_dev = kzalloc_obj(*sw_dev); if (!sw_dev) return ERR_PTR(-ENOMEM); @@ -301,7 +301,7 @@ struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode) int err; int i; - mux = kzalloc_obj(*mux, GFP_KERNEL); + mux = kzalloc_obj(*mux); if (!mux) return ERR_PTR(-ENOMEM); @@ -415,7 +415,7 @@ typec_mux_register(struct device *parent, const struct typec_mux_desc *desc) if (!desc || !desc->set) return ERR_PTR(-EINVAL); - mux_dev = kzalloc_obj(*mux_dev, GFP_KERNEL); + mux_dev = kzalloc_obj(*mux_dev); if (!mux_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c index e3337ff98ab2..766c76d63328 100644 --- a/drivers/usb/typec/pd.c +++ b/drivers/usb/typec/pd.c @@ -480,7 +480,7 @@ static int add_pdo(struct usb_power_delivery_capabilities *cap, u32 pdo, int pos struct pdo *p; int ret; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; @@ -569,7 +569,7 @@ usb_power_delivery_register_capabilities(struct usb_power_delivery *pd, int ret; int i; - cap = kzalloc_obj(*cap, GFP_KERNEL); + cap = kzalloc_obj(*cap); if (!cap) return ERR_PTR(-ENOMEM); @@ -697,7 +697,7 @@ usb_power_delivery_register(struct device *parent, struct usb_power_delivery_des struct usb_power_delivery *pd; int ret; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/retimer.c b/drivers/usb/typec/retimer.c index 9bc896160af1..bfd80292b22a 100644 --- a/drivers/usb/typec/retimer.c +++ b/drivers/usb/typec/retimer.c @@ -110,7 +110,7 @@ typec_retimer_register(struct device *parent, const struct typec_retimer_desc *d if (!desc || !desc->set) return ERR_PTR(-EINVAL); - retimer = kzalloc_obj(*retimer, GFP_KERNEL); + retimer = kzalloc_obj(*retimer); if (!retimer) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 13b9873ba92e..1d2f3af034c5 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1665,7 +1665,7 @@ static int tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header, u32 *data_cpy; int ret = -ENOMEM; - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) goto err_event; diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c index 7549fef83d85..a4b9a6b51649 100644 --- a/drivers/usb/typec/ucsi/debugfs.c +++ b/drivers/usb/typec/ucsi/debugfs.c @@ -112,7 +112,7 @@ DEFINE_SHOW_ATTRIBUTE(ucsi_vbus_volt); void ucsi_debugfs_register(struct ucsi *ucsi) { - ucsi->debugfs = kzalloc_obj(*ucsi->debugfs, GFP_KERNEL); + ucsi->debugfs = kzalloc_obj(*ucsi->debugfs); if (!ucsi->debugfs) return; diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index fe01a5e915d9..ba2c1e549968 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -293,7 +293,7 @@ static int ucsi_partner_task(struct ucsi_connector *con, if (!con->partner) return 0; - uwork = kzalloc_obj(*uwork, GFP_KERNEL); + uwork = kzalloc_obj(*uwork); if (!uwork) return -ENOMEM; @@ -2044,7 +2044,7 @@ struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops) !ops->read_message_in || !ops->sync_control || !ops->async_control) return ERR_PTR(-EINVAL); - ucsi = kzalloc_obj(*ucsi, GFP_KERNEL); + ucsi = kzalloc_obj(*ucsi); if (!ucsi) return ERR_PTR(-ENOMEM); diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 5fe991baffa2..709a24092104 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -493,7 +493,7 @@ static int skel_probe(struct usb_interface *interface, int retval; /* allocate memory for our device state and initialize it */ - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index e859c51c94e8..34990b7e2d18 100644 --- a/drivers/usb/usbip/stub_dev.c +++ b/drivers/usb/usbip/stub_dev.c @@ -263,7 +263,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev) dev_dbg(&udev->dev, "allocating stub device"); /* yes, it's a new device */ - sdev = kzalloc_obj(struct stub_device, GFP_KERNEL); + sdev = kzalloc_obj(struct stub_device); if (!sdev) return NULL; diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index 7df83464a75f..1e9ae578810d 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers/usb/usbip/stub_rx.c @@ -535,7 +535,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, /* allocate urb array */ priv->num_urbs = num_urbs; - priv->urbs = kmalloc_objs(*priv->urbs, num_urbs, GFP_KERNEL); + priv->urbs = kmalloc_objs(*priv->urbs, num_urbs); if (!priv->urbs) goto err_urbs; diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c index 9e6187c3ddb0..4ffd342250b5 100644 --- a/drivers/usb/usbip/stub_tx.c +++ b/drivers/usb/usbip/stub_tx.c @@ -191,7 +191,7 @@ static int stub_send_ret_submit(struct stub_device *sdev) else iovnum = 2; - iov = kzalloc_objs(struct kvec, iovnum, GFP_KERNEL); + iov = kzalloc_objs(struct kvec, iovnum); if (!iov) { usbip_event_add(&sdev->ud, SDEV_EVENT_ERROR_MALLOC); diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 4dcda9e8316f..39e8faf4c18c 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1537,7 +1537,7 @@ static int __init vhci_hcd_init(void) if (vhci_num_controllers < 1) vhci_num_controllers = 1; - vhcis = kzalloc_objs(struct vhci, vhci_num_controllers, GFP_KERNEL); + vhcis = kzalloc_objs(struct vhci, vhci_num_controllers); if (vhcis == NULL) return -ENOMEM; diff --git a/drivers/usb/usbip/vhci_tx.c b/drivers/usb/usbip/vhci_tx.c index a63805d57d94..32e6fabccf72 100644 --- a/drivers/usb/usbip/vhci_tx.c +++ b/drivers/usb/usbip/vhci_tx.c @@ -82,7 +82,7 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev) else iovnum = 3; - iov = kzalloc_objs(*iov, iovnum, GFP_KERNEL); + iov = kzalloc_objs(*iov, iovnum); if (!iov) { usbip_event_add(&vdev->ud, SDEV_EVENT_ERROR_MALLOC); return -ENOMEM; diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c index 80ab3d019b87..90383107b660 100644 --- a/drivers/usb/usbip/vudc_dev.c +++ b/drivers/usb/usbip/vudc_dev.c @@ -43,7 +43,7 @@ struct urbp *alloc_urbp(void) { struct urbp *urb_p; - urb_p = kzalloc_obj(*urb_p, GFP_KERNEL); + urb_p = kzalloc_obj(*urb_p); if (!urb_p) return urb_p; @@ -491,7 +491,7 @@ struct vudc_device *alloc_vudc_device(int devid) { struct vudc_device *udc_dev; - udc_dev = kzalloc_obj(*udc_dev, GFP_KERNEL); + udc_dev = kzalloc_obj(*udc_dev); if (!udc_dev) return NULL; @@ -518,7 +518,7 @@ static int init_vudc_hw(struct vudc *udc) struct usbip_device *ud = &udc->ud; struct vep *ep; - udc->ep = kzalloc_objs(*udc->ep, VIRTUAL_ENDPOINTS, GFP_KERNEL); + udc->ep = kzalloc_objs(*udc->ep, VIRTUAL_ENDPOINTS); if (!udc->ep) goto nomem_ep; @@ -598,7 +598,7 @@ int vudc_probe(struct platform_device *pdev) struct vudc *udc; int ret = -ENOMEM; - udc = kzalloc_obj(*udc, GFP_KERNEL); + udc = kzalloc_obj(*udc); if (!udc) goto out; diff --git a/drivers/usb/usbip/vudc_tx.c b/drivers/usb/usbip/vudc_tx.c index b4b7796319f1..88edfbcc0035 100644 --- a/drivers/usb/usbip/vudc_tx.c +++ b/drivers/usb/usbip/vudc_tx.c @@ -97,7 +97,7 @@ static int v_send_ret_submit(struct vudc *udc, struct urbp *urb_p) else iovnum = 2; - iov = kzalloc_objs(*iov, iovnum, GFP_KERNEL); + iov = kzalloc_objs(*iov, iovnum); if (!iov) { usbip_event_add(&udc->ud, VUDC_EVENT_ERROR_MALLOC); ret = -ENOMEM; diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index b1b4c6adeef7..d46c1606c97a 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -793,7 +793,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) } pci_set_master(pdev); - ifcvf_mgmt_dev = kzalloc_obj(struct ifcvf_vdpa_mgmt_dev, GFP_KERNEL); + ifcvf_mgmt_dev = kzalloc_obj(struct ifcvf_vdpa_mgmt_dev); if (!ifcvf_mgmt_dev) { IFCVF_ERR(pdev, "Failed to alloc memory for the vDPA management device\n"); return -ENOMEM; diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c index f27316f3fec3..42c2705077a6 100644 --- a/drivers/vdpa/mlx5/core/mr.c +++ b/drivers/vdpa/mlx5/core/mr.c @@ -215,7 +215,7 @@ static int create_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr * int err = 0; int i = 0; - cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs); if (!cmds) return -ENOMEM; @@ -287,8 +287,8 @@ static int destroy_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr int err = 0; int i = 0; - cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, mr->num_directs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs); + cmd_mem = kvzalloc_objs(*cmd_mem, mr->num_directs); if (!cmds || !cmd_mem) return -ENOMEM; @@ -456,7 +456,7 @@ static int add_direct_chain(struct mlx5_vdpa_dev *mvdev, st = start; while (size) { sz = (u32)min_t(u64, MAX_KLM_SIZE, size); - dmr = kzalloc_obj(*dmr, GFP_KERNEL); + dmr = kzalloc_obj(*dmr); if (!dmr) { err = -ENOMEM; goto err_alloc; @@ -817,7 +817,7 @@ struct mlx5_vdpa_mr *mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr *mr; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 15a6c91ec335..4acd61285885 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1229,8 +1229,8 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev, WARN(start_vq + num_vqs > mvdev->max_vqs, "query vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1562,8 +1562,8 @@ static int modify_virtqueues(struct mlx5_vdpa_net *ndev, int start_vq, int num_v WARN(start_vq + num_vqs > mvdev->max_vqs, "modify vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1649,7 +1649,7 @@ static int suspend_vqs(struct mlx5_vdpa_net *ndev, int start_vq, int num_vqs) if (err) return err; - attrs = kzalloc_objs(struct mlx5_virtq_attr, num_vqs, GFP_KERNEL); + attrs = kzalloc_objs(struct mlx5_virtq_attr, num_vqs); if (!attrs) return -ENOMEM; @@ -1922,7 +1922,7 @@ static int mlx5_vdpa_add_mac_vlan_rules(struct mlx5_vdpa_net *ndev, u8 *mac, int err; u16 vid; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -2034,7 +2034,7 @@ static int mac_vlan_add(struct mlx5_vdpa_net *ndev, u8 *mac, u16 vid, bool tagge if (mac_vlan_lookup(ndev, val)) return -EEXIST; - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); if (!ptr) return -ENOMEM; @@ -3902,7 +3902,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, mlx5_cmd_init_async_ctx(mdev, &mvdev->async_ctx); - ndev->vqs = kzalloc_objs(*ndev->vqs, max_vqs, GFP_KERNEL); + ndev->vqs = kzalloc_objs(*ndev->vqs, max_vqs); ndev->event_cbs = kzalloc_objs(*ndev->event_cbs, max_vqs + 1, GFP_KERNEL); if (!ndev->vqs || !ndev->event_cbs) { @@ -4104,7 +4104,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, struct mlx5_vdpa_mgmtdev *mgtdev; int err; - mgtdev = kzalloc_obj(*mgtdev, GFP_KERNEL); + mgtdev = kzalloc_obj(*mgtdev); if (!mgtdev) return -ENOMEM; diff --git a/drivers/vdpa/pds/aux_drv.c b/drivers/vdpa/pds/aux_drv.c index 970eec66b117..61314d56095d 100644 --- a/drivers/vdpa/pds/aux_drv.c +++ b/drivers/vdpa/pds/aux_drv.c @@ -39,7 +39,7 @@ static int pds_vdpa_probe(struct auxiliary_device *aux_dev, struct pds_vdpa_aux *vdpa_aux; int err; - vdpa_aux = kzalloc_obj(*vdpa_aux, GFP_KERNEL); + vdpa_aux = kzalloc_obj(*vdpa_aux); if (!vdpa_aux) return -ENOMEM; diff --git a/drivers/vdpa/solidrun/snet_main.c b/drivers/vdpa/solidrun/snet_main.c index 527efeed912c..28d55315df2a 100644 --- a/drivers/vdpa/solidrun/snet_main.c +++ b/drivers/vdpa/solidrun/snet_main.c @@ -732,7 +732,7 @@ static int psnet_read_cfg(struct pci_dev *pdev, struct psnet *psnet) /* Load device configuration from BAR */ for (i = 0; i < cfg->devices_num; i++) { - cfg->devs[i] = kzalloc_obj(*cfg->devs[i], GFP_KERNEL); + cfg->devs[i] = kzalloc_obj(*cfg->devs[i]); if (!cfg->devs[i]) { snet_free_cfg(cfg); return -ENOMEM; @@ -827,7 +827,7 @@ static int snet_build_vqs(struct snet *snet) /* Allocate the VQs */ for (i = 0; i < snet->cfg->vq_num; i++) { - snet->vqs[i] = kzalloc_obj(*snet->vqs[i], GFP_KERNEL); + snet->vqs[i] = kzalloc_obj(*snet->vqs[i]); if (!snet->vqs[i]) { snet_free_vqs(snet); return -ENOMEM; @@ -902,7 +902,7 @@ static int snet_vdpa_probe_pf(struct pci_dev *pdev) } /* Allocate a PCI physical function device */ - psnet = kzalloc_obj(*psnet, GFP_KERNEL); + psnet = kzalloc_obj(*psnet); if (!psnet) return -ENOMEM; diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c index 44e9babc0b54..806cec32c4bc 100644 --- a/drivers/vdpa/vdpa_user/iova_domain.c +++ b/drivers/vdpa/vdpa_user/iova_domain.c @@ -622,7 +622,7 @@ vduse_domain_create(unsigned long iova_limit, size_t bounce_size) if (iova_limit <= bounce_size) return NULL; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index 7478aa8d5489..6202f6902fcd 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1232,7 +1232,7 @@ static int vduse_dev_reg_umem(struct vduse_dev *dev, npages = size >> PAGE_SHIFT; page_list = __vmalloc(array_size(npages, sizeof(struct page *)), GFP_KERNEL_ACCOUNT); - umem = kzalloc_obj(*umem, GFP_KERNEL); + umem = kzalloc_obj(*umem); if (!page_list || !umem) goto unlock; @@ -1800,12 +1800,12 @@ static int vduse_dev_init_vqs(struct vduse_dev *dev, u32 vq_align, u32 vq_num) dev->vq_align = vq_align; dev->vq_num = vq_num; - dev->vqs = kzalloc_objs(*dev->vqs, dev->vq_num, GFP_KERNEL); + dev->vqs = kzalloc_objs(*dev->vqs, dev->vq_num); if (!dev->vqs) return -ENOMEM; for (i = 0; i < vq_num; i++) { - dev->vqs[i] = kzalloc_obj(*dev->vqs[i], GFP_KERNEL); + dev->vqs[i] = kzalloc_obj(*dev->vqs[i]); if (!dev->vqs[i]) { ret = -ENOMEM; goto err; @@ -1839,7 +1839,7 @@ err: static struct vduse_dev *vduse_dev_create(void) { - struct vduse_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct vduse_dev *dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -2076,7 +2076,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->vendor_id = config->vendor_id; dev->nas = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->nas; - dev->as = kzalloc_objs(dev->as[0], dev->nas, GFP_KERNEL); + dev->as = kzalloc_objs(dev->as[0], dev->nas); if (!dev->as) goto err_as; for (int i = 0; i < dev->nas; i++) @@ -2085,7 +2085,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->ngroups = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->ngroups; - dev->groups = kzalloc_objs(dev->groups[0], dev->ngroups, GFP_KERNEL); + dev->groups = kzalloc_objs(dev->groups[0], dev->ngroups); if (!dev->groups) goto err_vq_groups; for (u32 i = 0; i < dev->ngroups; ++i) { @@ -2226,7 +2226,7 @@ static int vduse_open(struct inode *inode, struct file *file) { struct vduse_control *control; - control = kmalloc_obj(struct vduse_control, GFP_KERNEL); + control = kmalloc_obj(struct vduse_control); if (!control) return -ENOMEM; @@ -2356,7 +2356,7 @@ static int vduse_mgmtdev_init(void) { int ret; - vduse_mgmt = kzalloc_obj(*vduse_mgmt, GFP_KERNEL); + vduse_mgmt = kzalloc_obj(*vduse_mgmt); if (!vduse_mgmt) return -ENOMEM; diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index 102f25ccfddf..51ffc245a038 100644 --- a/drivers/vdpa/virtio_pci/vp_vdpa.c +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c @@ -608,7 +608,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct virtio_device_id *mdev_id = NULL; int err; - vp_vdpa_mgtdev = kzalloc_obj(*vp_vdpa_mgtdev, GFP_KERNEL); + vp_vdpa_mgtdev = kzalloc_obj(*vp_vdpa_mgtdev); if (!vp_vdpa_mgtdev) return -ENOMEM; @@ -616,7 +616,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) mgtdev->ops = &vp_vdpa_mdev_ops; mgtdev->device = dev; - mdev = kzalloc_obj(struct virtio_pci_modern_device, GFP_KERNEL); + mdev = kzalloc_obj(struct virtio_pci_modern_device); if (!mdev) { err = -ENOMEM; goto mdev_err; @@ -626,7 +626,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) * id_table should be a null terminated array, so allocate one additional * entry here, see vdpa_mgmtdev_get_classes(). */ - mdev_id = kzalloc_objs(struct virtio_device_id, 2, GFP_KERNEL); + mdev_id = kzalloc_objs(struct virtio_device_id, 2); if (!mdev_id) { err = -ENOMEM; goto mdev_id_err; diff --git a/drivers/vfio/cdx/intr.c b/drivers/vfio/cdx/intr.c index 0ae39bda7c35..8f4402cec9c5 100644 --- a/drivers/vfio/cdx/intr.c +++ b/drivers/vfio/cdx/intr.c @@ -27,7 +27,7 @@ static int vfio_cdx_msi_enable(struct vfio_cdx_device *vdev, int nvec) struct device *dev = vdev->vdev.dev; int msi_idx, ret; - vdev->cdx_irqs = kzalloc_objs(struct vfio_cdx_irq, nvec, GFP_KERNEL); + vdev->cdx_irqs = kzalloc_objs(struct vfio_cdx_irq, nvec); if (!vdev->cdx_irqs) return -ENOMEM; diff --git a/drivers/vfio/container.c b/drivers/vfio/container.c index 937fc1de5965..003281dbf8bc 100644 --- a/drivers/vfio/container.c +++ b/drivers/vfio/container.c @@ -95,7 +95,7 @@ int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops) if (WARN_ON(!ops->register_device != !ops->unregister_device)) return -EINVAL; - driver = kzalloc_obj(*driver, GFP_KERNEL); + driver = kzalloc_obj(*driver); if (!driver) return -ENOMEM; diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index 868e69053050..4f15016d2a5f 100644 --- a/drivers/vfio/group.c +++ b/drivers/vfio/group.c @@ -515,7 +515,7 @@ static struct vfio_group *vfio_group_alloc(struct iommu_group *iommu_group, struct vfio_group *group; int minor; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 5b6ac30c02bf..3b4aa0632fcc 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -154,7 +154,7 @@ int mdev_device_create(struct mdev_type *type, const guid_t *uuid) atomic_dec(&parent->available_instances); } - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) { mutex_unlock(&mdev_list_lock); return -ENOMEM; diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 68b3c1745609..1d367cff7dcf 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -1498,7 +1498,7 @@ static int hisi_acc_vf_dev_read(struct seq_file *seq, void *data) } mutex_lock(&hisi_acc_vdev->state_mutex); - vf_data = kzalloc_obj(*vf_data, GFP_KERNEL); + vf_data = kzalloc_obj(*vf_data); if (!vf_data) { ret = -ENOMEM; goto mutex_release; @@ -1679,7 +1679,7 @@ static void hisi_acc_vfio_debug_init(struct hisi_acc_vf_core_device *hisi_acc_vd return; } - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) { dput(vfio_dev_migration); return; diff --git a/drivers/vfio/pci/pds/dirty.c b/drivers/vfio/pci/pds/dirty.c index 7a218948c475..32573f6e8cc6 100644 --- a/drivers/vfio/pci/pds/dirty.c +++ b/drivers/vfio/pci/pds/dirty.c @@ -285,7 +285,7 @@ static int pds_vfio_dirty_enable(struct pds_vfio_pci_device *pds_vfio, num_ranges = max_regions; } - region_info = kzalloc_objs(*region_info, num_ranges, GFP_KERNEL); + region_info = kzalloc_objs(*region_info, num_ranges); if (!region_info) return -ENOMEM; len = num_ranges * sizeof(*region_info); @@ -397,7 +397,7 @@ static int pds_vfio_dirty_seq_ack(struct pds_vfio_pci_device *pds_vfio, * will be enough pages to represent the bmp_bytes */ npages = DIV_ROUND_UP_ULL(bmp_bytes + page_offset, PAGE_SIZE); - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); if (!pages) return -ENOMEM; diff --git a/drivers/vfio/pci/pds/lm.c b/drivers/vfio/pci/pds/lm.c index c9a21a049372..08487eab11b0 100644 --- a/drivers/vfio/pci/pds/lm.c +++ b/drivers/vfio/pci/pds/lm.c @@ -24,7 +24,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) return NULL; /* Alloc file structure */ - lm_file = kzalloc_obj(*lm_file, GFP_KERNEL); + lm_file = kzalloc_obj(*lm_file); if (!lm_file) return NULL; @@ -42,7 +42,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) /* Allocate memory for file pages */ npages = DIV_ROUND_UP_ULL(size, PAGE_SIZE); - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); if (!pages) goto out_put_file; diff --git a/drivers/vfio/pci/qat/main.c b/drivers/vfio/pci/qat/main.c index 591349c2edc8..b982d4ae666c 100644 --- a/drivers/vfio/pci/qat/main.c +++ b/drivers/vfio/pci/qat/main.c @@ -261,7 +261,7 @@ qat_vf_save_device_data(struct qat_vf_core_device *qat_vdev, bool pre_copy) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ qat_vf_resume_device_data(struct qat_vf_core_device *qat_vdev) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 10bfa76f06e5..d43745fe4c84 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1291,7 +1291,7 @@ static int vfio_pci_ioctl_get_pci_hot_reset_info( goto header; } - devices = kzalloc_objs(*devices, count, GFP_KERNEL); + devices = kzalloc_objs(*devices, count); if (!devices) return -ENOMEM; @@ -1350,8 +1350,8 @@ vfio_pci_ioctl_pci_hot_reset_groups(struct vfio_pci_core_device *vdev, if (array_count > count) return -EINVAL; - group_fds = kzalloc_objs(*group_fds, array_count, GFP_KERNEL); - files = kzalloc_objs(*files, array_count, GFP_KERNEL); + group_fds = kzalloc_objs(*group_fds, array_count); + files = kzalloc_objs(*files, array_count); if (!group_fds || !files) { kfree(group_fds); kfree(files); @@ -2034,7 +2034,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev) if (!pdev->is_physfn) return 0; - vdev->vf_token = kzalloc_obj(*vdev->vf_token, GFP_KERNEL); + vdev->vf_token = kzalloc_obj(*vdev->vf_token); if (!vdev->vf_token) return -ENOMEM; diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c index abed6508cd83..12234538254c 100644 --- a/drivers/vfio/pci/vfio_pci_dmabuf.c +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c @@ -246,7 +246,7 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags, if (ret) goto err_free_ranges; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto err_free_ranges; diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c index 3867928d2f49..1c0eec228cc6 100644 --- a/drivers/vfio/vfio_iommu_spapr_tce.c +++ b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -159,7 +159,7 @@ static long tce_iommu_register_pages(struct tce_container *container, return ret; } - tcemem = kzalloc_obj(*tcemem, GFP_KERNEL); + tcemem = kzalloc_obj(*tcemem); if (!tcemem) { ret = -ENOMEM; goto put_exit; @@ -322,7 +322,7 @@ static void *tce_iommu_open(unsigned long arg) return ERR_PTR(-EINVAL); } - container = kzalloc_obj(*container, GFP_KERNEL); + container = kzalloc_obj(*container); if (!container) return ERR_PTR(-ENOMEM); @@ -1290,7 +1290,7 @@ static int tce_iommu_attach_group(void *iommu_data, } } - tcegrp = kzalloc_obj(*tcegrp, GFP_KERNEL); + tcegrp = kzalloc_obj(*tcegrp); if (!tcegrp) { ret = -ENOMEM; goto unlock_exit; diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index aedbc2fecb23..03cefdf99a4a 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -388,7 +388,7 @@ static int vfio_add_to_pfn_list(struct vfio_dma *dma, dma_addr_t iova, { struct vfio_pfn *vpfn; - vpfn = kzalloc_obj(*vpfn, GFP_KERNEL); + vpfn = kzalloc_obj(*vpfn); if (!vpfn) return -ENOMEM; @@ -1097,7 +1097,7 @@ static size_t unmap_unpin_fast(struct vfio_domain *domain, struct iommu_iotlb_gather *iotlb_gather) { size_t unmapped = 0; - struct vfio_regions *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct vfio_regions *entry = kzalloc_obj(*entry); if (entry) { unmapped = iommu_unmap_fast(domain->domain, iova, len, @@ -1753,7 +1753,7 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, goto out_unlock; } - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) { ret = -ENOMEM; goto out_unlock; @@ -2017,7 +2017,7 @@ static int vfio_iommu_iova_insert(struct list_head *head, { struct vfio_iova *region; - region = kmalloc_obj(*region, GFP_KERNEL); + region = kmalloc_obj(*region); if (!region) return -ENOMEM; @@ -2259,7 +2259,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, goto out_unlock; ret = -ENOMEM; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) goto out_unlock; group->iommu_group = iommu_group; @@ -2278,7 +2278,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, } ret = -ENOMEM; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) goto out_free_group; @@ -2625,7 +2625,7 @@ static void *vfio_iommu_type1_open(unsigned long arg) { struct vfio_iommu *iommu; - iommu = kzalloc_obj(*iommu, GFP_KERNEL); + iommu = kzalloc_obj(*iommu); if (!iommu) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 0028abdfe3cb..742477546b15 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -82,7 +82,7 @@ int vfio_assign_device_set(struct vfio_device *device, void *set_id) goto found_get_ref; xa_unlock(&vfio_device_set_xa); - new_dev_set = kzalloc_obj(*new_dev_set, GFP_KERNEL); + new_dev_set = kzalloc_obj(*new_dev_set); if (!new_dev_set) return -ENOMEM; mutex_init(&new_dev_set->lock); @@ -1083,7 +1083,7 @@ vfio_ioctl_device_feature_logging_start(struct vfio_device *device, return -E2BIG; ranges = u64_to_user_ptr(control.ranges); - nodes = kmalloc_objs(struct interval_tree_node, nnodes, GFP_KERNEL); + nodes = kmalloc_objs(struct interval_tree_node, nnodes); if (!nodes) return -ENOMEM; diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c index 6528d084f42d..e1414c774c34 100644 --- a/drivers/vhost/iotlb.c +++ b/drivers/vhost/iotlb.c @@ -151,7 +151,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_init); */ struct vhost_iotlb *vhost_iotlb_alloc(unsigned int limit, unsigned int flags) { - struct vhost_iotlb *iotlb = kzalloc_obj(*iotlb, GFP_KERNEL); + struct vhost_iotlb *iotlb = kzalloc_obj(*iotlb); if (!iotlb) return NULL; diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 440d959b6e24..9b2e888a533c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -240,7 +240,7 @@ vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) /* No zero copy backend? Nothing to count. */ if (!zcopy) return NULL; - ubufs = kmalloc_obj(*ubufs, GFP_KERNEL); + ubufs = kmalloc_obj(*ubufs); if (!ubufs) return ERR_PTR(-ENOMEM); atomic_set(&ubufs->refcount, 1); @@ -1330,7 +1330,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) n = kvmalloc_obj(*n, GFP_KERNEL | __GFP_RETRY_MAYFAIL); if (!n) return -ENOMEM; - vqs = kmalloc_objs(*vqs, VHOST_NET_VQ_MAX, GFP_KERNEL); + vqs = kmalloc_objs(*vqs, VHOST_NET_VQ_MAX); if (!vqs) { kvfree(n); return -ENOMEM; @@ -1345,7 +1345,7 @@ static int vhost_net_open(struct inode *inode, struct file *f) } n->vqs[VHOST_NET_VQ_RX].rxq.queue = queue; - xdp = kmalloc_objs(*xdp, VHOST_NET_BATCH, GFP_KERNEL); + xdp = kmalloc_objs(*xdp, VHOST_NET_BATCH); if (!xdp) { kfree(vqs); kvfree(n); diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 36ed704562d7..a3e7930e1ca5 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -548,7 +548,7 @@ vhost_scsi_allocate_evt(struct vhost_scsi *vs, return NULL; } - evt = kzalloc_obj(*evt, GFP_KERNEL); + evt = kzalloc_obj(*evt); if (!evt) { vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); vs->vs_events_missed = true; @@ -896,7 +896,7 @@ vhost_scsi_copy_iov_to_sgl(struct vhost_scsi_cmd *cmd, struct iov_iter *iter, int i, ret; if (data_dir == DMA_FROM_DEVICE) { - cmd->read_iter = kzalloc_obj(*cmd->read_iter, GFP_KERNEL); + cmd->read_iter = kzalloc_obj(*cmd->read_iter); if (!cmd->read_iter) return -ENOMEM; @@ -1263,7 +1263,7 @@ vhost_scsi_setup_resp_iovs(struct vhost_scsi_cmd *cmd, struct iovec *in_iovs, * iov per byte. */ cnt = min(VHOST_SCSI_MAX_RESP_IOVS, in_iovs_cnt); - cmd->tvc_resp_iovs = kzalloc_objs(struct iovec, cnt, GFP_KERNEL); + cmd->tvc_resp_iovs = kzalloc_objs(struct iovec, cnt); if (!cmd->tvc_resp_iovs) return -ENOMEM; @@ -1601,7 +1601,7 @@ vhost_scsi_handle_tmf(struct vhost_scsi *vs, struct vhost_scsi_tpg *tpg, goto send_reject; } - tmf = kzalloc_obj(*tmf, GFP_KERNEL); + tmf = kzalloc_obj(*tmf); if (!tmf) goto send_reject; @@ -1615,7 +1615,7 @@ vhost_scsi_handle_tmf(struct vhost_scsi *vs, struct vhost_scsi_tpg *tpg, tmf->inflight = vhost_scsi_get_inflight(vq); if (unlikely(log && log_num)) { - tmf->tmf_log = kmalloc_objs(*tmf->tmf_log, log_num, GFP_KERNEL); + tmf->tmf_log = kmalloc_objs(*tmf->tmf_log, log_num); if (tmf->tmf_log) { memcpy(tmf->tmf_log, log, sizeof(*tmf->tmf_log) * log_num); tmf->tmf_log_num = log_num; @@ -1933,7 +1933,7 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds) return -ENOMEM; svq->max_cmds = max_cmds; - svq->scsi_cmds = kzalloc_objs(*tv_cmd, max_cmds, GFP_KERNEL); + svq->scsi_cmds = kzalloc_objs(*tv_cmd, max_cmds); if (!svq->scsi_cmds) { sbitmap_free(&svq->scsi_tags); return -ENOMEM; @@ -2279,7 +2279,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) struct vhost_virtqueue **vqs; int r = -ENOMEM, i, nvqs = vhost_scsi_max_io_vqs; - vs = kvzalloc_obj(*vs, GFP_KERNEL); + vs = kvzalloc_obj(*vs); if (!vs) goto err_vs; vs->inline_sg_cnt = vhost_scsi_inline_sg_cnt; @@ -2303,7 +2303,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) if (!vs->vqs) goto err_vqs; - vqs = kmalloc_objs(*vqs, nvqs, GFP_KERNEL); + vqs = kmalloc_objs(*vqs, nvqs); if (!vqs) goto err_local_vqs; @@ -2599,7 +2599,7 @@ static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg, return -EEXIST; } - tv_nexus = kzalloc_obj(*tv_nexus, GFP_KERNEL); + tv_nexus = kzalloc_obj(*tv_nexus); if (!tv_nexus) { mutex_unlock(&tpg->tv_tpg_mutex); pr_err("Unable to allocate struct vhost_scsi_nexus\n"); @@ -2794,7 +2794,7 @@ vhost_scsi_make_tpg(struct se_wwn *wwn, const char *name) if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET) return ERR_PTR(-EINVAL); - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) { pr_err("Unable to allocate struct vhost_scsi_tpg"); return ERR_PTR(-ENOMEM); @@ -2848,7 +2848,7 @@ vhost_scsi_make_tport(struct target_fabric_configfs *tf, /* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) { pr_err("Unable to allocate struct vhost_scsi_tport"); return ERR_PTR(-ENOMEM); diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index fc11a048a620..24514c8fdee4 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -110,13 +110,13 @@ static void handle_vq_kick(struct vhost_work *work) static int vhost_test_open(struct inode *inode, struct file *f) { - struct vhost_test *n = kmalloc_obj(*n, GFP_KERNEL); + struct vhost_test *n = kmalloc_obj(*n); struct vhost_dev *dev; struct vhost_virtqueue **vqs; if (!n) return -ENOMEM; - vqs = kmalloc_objs(*vqs, VHOST_TEST_VQ_MAX, GFP_KERNEL); + vqs = kmalloc_objs(*vqs, VHOST_TEST_VQ_MAX); if (!vqs) { kfree(n); return -ENOMEM; diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index a9f85f05874f..692564b1bcbb 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -110,7 +110,7 @@ static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) if (asid >= v->vdpa->nas) return NULL; - as = kmalloc_obj(*as, GFP_KERNEL); + as = kmalloc_obj(*as); if (!as) return NULL; @@ -1064,7 +1064,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v, !(vma->vm_flags & (VM_IO | VM_PFNMAP)))) goto next; - map_file = kzalloc_obj(*map_file, GFP_KERNEL); + map_file = kzalloc_obj(*map_file); if (!map_file) { ret = -ENOMEM; break; @@ -1420,7 +1420,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) if (r) goto err; - vqs = kmalloc_objs(*vqs, nvqs, GFP_KERNEL); + vqs = kmalloc_objs(*vqs, nvqs); if (!vqs) { r = -ENOMEM; goto err; @@ -1593,7 +1593,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa) v->dev.release = vhost_vdpa_release_dev; v->dev.parent = &vdpa->dev; v->dev.devt = MKDEV(MAJOR(vhost_vdpa_major), minor); - v->vqs = kmalloc_objs(struct vhost_virtqueue, v->nvqs, GFP_KERNEL); + v->vqs = kmalloc_objs(struct vhost_virtqueue, v->nvqs); if (!v->vqs) { r = -ENOMEM; goto err; diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dafbc3dd3805..7260cdb92716 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -516,8 +516,8 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) vq = dev->vqs[i]; vq->indirect = kmalloc_objs(*vq->indirect, UIO_MAXIOV, GFP_KERNEL); - vq->log = kmalloc_objs(*vq->log, dev->iov_limit, GFP_KERNEL); - vq->heads = kmalloc_objs(*vq->heads, dev->iov_limit, GFP_KERNEL); + vq->log = kmalloc_objs(*vq->log, dev->iov_limit); + vq->heads = kmalloc_objs(*vq->heads, dev->iov_limit); vq->nheads = kmalloc_array(dev->iov_limit, sizeof(*vq->nheads), GFP_KERNEL); if (!vq->indirect || !vq->log || !vq->heads || !vq->nheads) @@ -3268,7 +3268,7 @@ EXPORT_SYMBOL_GPL(vhost_disable_notify); struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) { /* Make sure all padding within the structure is initialized. */ - struct vhost_msg_node *node = kzalloc_obj(*node, GFP_KERNEL); + struct vhost_msg_node *node = kzalloc_obj(*node); if (!node) return NULL; diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0bb4e3fdc71c..054f7a718f50 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -680,7 +680,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) if (!vsock) return -ENOMEM; - vqs = kmalloc_objs(*vqs, ARRAY_SIZE(vsock->vqs), GFP_KERNEL); + vqs = kmalloc_objs(*vqs, ARRAY_SIZE(vsock->vqs)); if (!vqs) { ret = -ENOMEM; goto out; diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index c6e155a150a5..a22d0bbb6e63 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -371,7 +371,7 @@ struct backlight_device *backlight_device_register(const char *name, pr_debug("backlight_device_register: name=%s\n", name); - new_bd = kzalloc_obj(struct backlight_device, GFP_KERNEL); + new_bd = kzalloc_obj(struct backlight_device); if (!new_bd) return ERR_PTR(-ENOMEM); diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index d33c4f370075..e918f57608ef 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -197,7 +197,7 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, pr_debug("lcd_device_register: name=%s\n", name); - new_ld = kzalloc_obj(struct lcd_device, GFP_KERNEL); + new_ld = kzalloc_obj(struct lcd_device); if (!new_ld) return ERR_PTR(-ENOMEM); diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index 98df1ddfd1e9..6f58e6a9e76a 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c @@ -186,7 +186,7 @@ static int sticon_set_font(struct vc_data *vc, const struct console_font *op, new_font->underline_height = 0; new_font->underline_pos = 0; - cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font); if (!cooked_font) { kfree(new_font); return -ENOMEM; diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index 908b2be850ac..32d7f32db46a 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c @@ -136,7 +136,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) return; #endif - pdata = kmalloc_obj(struct radeon_bl_privdata, GFP_KERNEL); + pdata = kmalloc_obj(struct radeon_bl_privdata); if (!pdata) { printk("radeonfb: Memory allocation failed\n"); goto error; diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 979e8eb6cda4..cb006484831b 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -1653,7 +1653,7 @@ static int radeonfb_set_par(struct fb_info *info) int depth = var_to_depth(mode); int use_rmx = 0; - newmode = kmalloc_obj(struct radeon_regs, GFP_KERNEL); + newmode = kmalloc_obj(struct radeon_regs); if (!newmode) return -ENOMEM; diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c index 82836c327f05..bd4bff6a2484 100644 --- a/drivers/video/fbdev/carminefb.c +++ b/drivers/video/fbdev/carminefb.c @@ -620,7 +620,7 @@ static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent) return ret; ret = -ENOMEM; - hw = kzalloc_obj(*hw, GFP_KERNEL); + hw = kzalloc_obj(*hw); if (!hw) goto err_enable_pci; diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index b589f46178a2..4bb821d7f284 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -944,7 +944,7 @@ static int __init control_of_init(struct device_node *dp) printk(KERN_ERR "can't get 2 addresses for control\n"); return -ENXIO; } - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; control_fb = p; /* save it for cleanups */ diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index 2b2604255b90..ca48b89a323d 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -307,7 +307,7 @@ int fb_deferred_io_init(struct fb_info *info) npagerefs = DIV_ROUND_UP(info->fix.smem_len, PAGE_SIZE); /* alloc a page ref for each page of the display memory */ - pagerefs = kvzalloc_objs(*pagerefs, npagerefs, GFP_KERNEL); + pagerefs = kvzalloc_objs(*pagerefs, npagerefs); if (!pagerefs) { ret = -ENOMEM; goto err; diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 29ed5b152ac6..666261ae59d8 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -769,7 +769,7 @@ static int fbcon_open(struct fb_info *info) } unlock_fb_info(info); - par = kzalloc_obj(*par, GFP_KERNEL); + par = kzalloc_obj(*par); if (!par) { fbcon_release(info); return -ENOMEM; diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c index 67ccb5607ded..f96b4e7b7f21 100644 --- a/drivers/video/fbdev/core/fbmon.c +++ b/drivers/video/fbdev/core/fbmon.c @@ -388,7 +388,7 @@ static void calc_mode_timings(int xres, int yres, int refresh, { struct fb_var_screeninfo *var; - var = kzalloc_obj(struct fb_var_screeninfo, GFP_KERNEL); + var = kzalloc_obj(struct fb_var_screeninfo); if (var) { var->xres = xres; @@ -626,7 +626,7 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, int num = 0, i, first = 1; int ver, rev; - mode = kzalloc_objs(struct fb_videomode, 50, GFP_KERNEL); + mode = kzalloc_objs(struct fb_videomode, 50); if (mode == NULL) return NULL; @@ -677,7 +677,7 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, } *dbsize = num; - m = kmalloc_objs(struct fb_videomode, num, GFP_KERNEL); + m = kmalloc_objs(struct fb_videomode, num); if (!m) return mode; memmove(m, mode, num * sizeof(struct fb_videomode)); @@ -1224,7 +1224,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf u32 hfmin, hfmax, vfmin, vfmax, dclkmin, dclkmax, err = 0; - timings = kzalloc_obj(struct __fb_timings, GFP_KERNEL); + timings = kzalloc_obj(struct __fb_timings); if (!timings) return -ENOMEM; diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index fda6066eec99..703d0b7aec32 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c @@ -1070,7 +1070,7 @@ int fb_add_videomode(const struct fb_videomode *mode, struct list_head *head) } } if (!found) { - modelist = kmalloc_obj(struct fb_modelist, GFP_KERNEL); + modelist = kmalloc_obj(struct fb_modelist); if (!modelist) return -ENOMEM; diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 172ca6bc2c05..2d12f8e96c7e 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1363,7 +1363,7 @@ static struct cfb_info *cyberpro_alloc_fb_info(unsigned int id, char *name) { struct cfb_info *cfb; - cfb = kzalloc_obj(struct cfb_info, GFP_KERNEL); + cfb = kzalloc_obj(struct cfb_info); if (!cfb) return NULL; diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index fcba50a6f65b..ffe33a36b944 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -180,7 +180,7 @@ static int goldfish_fb_probe(struct platform_device *pdev) u32 width, height; dma_addr_t fbpaddr; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (fb == NULL) { ret = -ENOMEM; goto err_fb_alloc_failed; diff --git a/drivers/video/fbdev/matrox/i2c-matroxfb.c b/drivers/video/fbdev/matrox/i2c-matroxfb.c index 6741028d2d0c..e02dd11b090e 100644 --- a/drivers/video/fbdev/matrox/i2c-matroxfb.c +++ b/drivers/video/fbdev/matrox/i2c-matroxfb.c @@ -144,7 +144,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) { unsigned long flags; struct matroxfb_dh_maven_info* m2info; - m2info = kzalloc_obj(*m2info, GFP_KERNEL); + m2info = kzalloc_obj(*m2info); if (!m2info) return NULL; diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index e7d8e13d1945..e1a4bc7c2318 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -2073,7 +2073,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm return -1; } - minfo = kzalloc_obj(*minfo, GFP_KERNEL); + minfo = kzalloc_obj(*minfo); if (!minfo) return -ENOMEM; diff --git a/drivers/video/fbdev/matrox/matroxfb_crtc2.c b/drivers/video/fbdev/matrox/matroxfb_crtc2.c index 6043ebb2bc96..8de882b09a24 100644 --- a/drivers/video/fbdev/matrox/matroxfb_crtc2.c +++ b/drivers/video/fbdev/matrox/matroxfb_crtc2.c @@ -693,7 +693,7 @@ static void* matroxfb_crtc2_probe(struct matrox_fb_info* minfo) { /* hardware is CRTC2 incapable... */ if (!minfo->devflags.crtc2) return NULL; - m2info = kzalloc_obj(*m2info, GFP_KERNEL); + m2info = kzalloc_obj(*m2info); if (!m2info) return NULL; diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index 63cc77ac74ea..2ea65da6075c 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c @@ -1260,7 +1260,7 @@ static int maven_probe(struct i2c_client *client) I2C_FUNC_NOSTART | I2C_FUNC_PROTOCOL_MANGLING)) goto ERROR0; - if (!(data = kzalloc_obj(*data, GFP_KERNEL))) { + if (!(data = kzalloc_obj(*data))) { err = -ENOMEM; goto ERROR0; } diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 2cd152f7a4be..75bbdc0b4aa6 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -402,7 +402,7 @@ static int path_init(struct mmphw_path_plat *path_plat, dev_info(ctrl->dev, "%s: %s\n", __func__, config->name); /* init driver data */ - path_info = kzalloc_obj(*path_info, GFP_KERNEL); + path_info = kzalloc_obj(*path_info); if (!path_info) return 0; diff --git a/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c b/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c index 40194c60987d..d111ec2a4703 100644 --- a/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c +++ b/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c @@ -144,7 +144,7 @@ static int tpohvga_probe(struct spi_device *spi) return ret; } - plat_data = kzalloc_obj(*plat_data, GFP_KERNEL); + plat_data = kzalloc_obj(*plat_data); if (plat_data == NULL) return -ENOMEM; diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c index 7b7a2b2d1a40..c1cd028b8991 100644 --- a/drivers/video/fbdev/neofb.c +++ b/drivers/video/fbdev/neofb.c @@ -1768,7 +1768,7 @@ static int neo_scan_monitor(struct fb_info *info) int w; // Eventually we will have i2c support. - info->monspecs.modedb = kmalloc_obj(struct fb_videomode, GFP_KERNEL); + info->monspecs.modedb = kmalloc_obj(struct fb_videomode); if (!info->monspecs.modedb) return -ENOMEM; info->monspecs.modedb_len = 1; diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c index f392da4761da..281c7f2ee650 100644 --- a/drivers/video/fbdev/nvidia/nv_setup.c +++ b/drivers/video/fbdev/nvidia/nv_setup.c @@ -283,9 +283,9 @@ int NVCommonSetup(struct fb_info *info) int Television = 0; int err = 0; - var = kzalloc_obj(struct fb_var_screeninfo, GFP_KERNEL); - monitorA = kzalloc_obj(struct fb_monspecs, GFP_KERNEL); - monitorB = kzalloc_obj(struct fb_monspecs, GFP_KERNEL); + var = kzalloc_obj(struct fb_var_screeninfo); + monitorA = kzalloc_obj(struct fb_monspecs); + monitorB = kzalloc_obj(struct fb_monspecs); if (!var || !monitorA || !monitorB) { err = -ENOMEM; diff --git a/drivers/video/fbdev/omap/lcd_mipid.c b/drivers/video/fbdev/omap/lcd_mipid.c index ffe0ce489adb..72c2a56943c2 100644 --- a/drivers/video/fbdev/omap/lcd_mipid.c +++ b/drivers/video/fbdev/omap/lcd_mipid.c @@ -552,7 +552,7 @@ static int mipid_spi_probe(struct spi_device *spi) struct mipid_device *md; int r; - md = kzalloc_obj(*md, GFP_KERNEL); + md = kzalloc_obj(*md); if (md == NULL) { dev_err(&spi->dev, "out of memory\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 8306faf01f40..cafe859d6e5a 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1630,7 +1630,7 @@ static int omapfb_do_probe(struct platform_device *pdev, goto cleanup; } - fbdev = kzalloc_obj(*fbdev, GFP_KERNEL); + fbdev = kzalloc_obj(*fbdev); if (fbdev == NULL) { dev_err(&pdev->dev, "unable to allocate memory for device info\n"); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 19498b7ccb14..330d9fb7d2b0 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -1539,7 +1539,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, unsigned long flags; struct dsi_irq_stats *stats; - stats = kzalloc_obj(*stats, GFP_KERNEL); + stats = kzalloc_obj(*stats); if (!stats) { seq_printf(s, "out of memory\n"); return; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c index 098c02164428..154347e5ddaf 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c @@ -46,7 +46,7 @@ static void __init omapdss_update_prop(struct device_node *node, char *compat, { struct property *prop; - prop = kzalloc_obj(*prop, GFP_KERNEL); + prop = kzalloc_obj(*prop); if (!prop) return; @@ -110,7 +110,7 @@ static void __init omapdss_omapify_node(struct device_node *node) static void __init omapdss_add_to_list(struct device_node *node, bool root) { - struct dss_conv_node *n = kmalloc_obj(struct dss_conv_node, GFP_KERNEL); + struct dss_conv_node *n = kmalloc_obj(struct dss_conv_node); if (n) { n->node = node; n->root = root; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c index cb2a230c57a1..6b04162aa9fc 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/overlay.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay.c @@ -49,7 +49,7 @@ void dss_init_overlays(struct platform_device *pdev) num_overlays = dss_feat_get_num_ovls(); - overlays = kzalloc_objs(struct omap_overlay, num_overlays, GFP_KERNEL); + overlays = kzalloc_objs(struct omap_overlay, num_overlays); BUG_ON(overlays == NULL); diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index 599a7d6a6114..a8b2930290e1 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -2023,19 +2023,19 @@ static int omapfb_mode_to_timings(const char *mode_str, var = NULL; fbops = NULL; - fbi = kzalloc_obj(*fbi, GFP_KERNEL); + fbi = kzalloc_obj(*fbi); if (fbi == NULL) { r = -ENOMEM; goto err; } - var = kzalloc_obj(*var, GFP_KERNEL); + var = kzalloc_obj(*var); if (var == NULL) { r = -ENOMEM; goto err; } - fbops = kzalloc_obj(*fbops, GFP_KERNEL); + fbops = kzalloc_obj(*fbops); if (fbops == NULL) { r = -ENOMEM; goto err; @@ -2244,7 +2244,7 @@ static int omapfb_find_best_mode(struct omap_dss_device *display, if (r < 0) goto err1; - specs = kzalloc_obj(*specs, GFP_KERNEL); + specs = kzalloc_obj(*specs); if (specs == NULL) { r = -ENOMEM; goto err1; diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index d47c173fd8e0..3f6384e631b1 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -652,7 +652,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, nr_pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT; - pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages); if (!pages) return -ENOMEM; diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index c2aec9419ae9..a2320e2fb8f2 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -530,7 +530,7 @@ pxa3xx_gcu_add_buffer(struct device *dev, { struct pxa3xx_gcu_batch *buffer; - buffer = kzalloc_obj(struct pxa3xx_gcu_batch, GFP_KERNEL); + buffer = kzalloc_obj(struct pxa3xx_gcu_batch); if (!buffer) return -ENOMEM; diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c52391f9893b..72969fe8e513 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2512,7 +2512,7 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev) return -ENOENT; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 67f3f2df2064..60e5dcec201f 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -249,7 +249,7 @@ static int simplefb_clocks_get(struct simplefb_par *par, if (!par->clk_count) return 0; - par->clks = kzalloc_objs(struct clk *, par->clk_count, GFP_KERNEL); + par->clks = kzalloc_objs(struct clk *, par->clk_count); if (!par->clks) return -ENOMEM; diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index abc9bcfe579b..fee4b9f84592 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1947,7 +1947,7 @@ static int sm501fb_probe(struct platform_device *pdev) int ret; /* allocate our framebuffers */ - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { dev_err(dev, "failed to allocate state\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index ddc45d9a2ca2..fa0d105841b3 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1038,7 +1038,7 @@ static int ufx_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kzalloc_obj(*fbdefio, GFP_KERNEL); + fbdefio = kzalloc_obj(*fbdefio); if (fbdefio) { fbdefio->delay = UFX_DEFIO_WRITE_DELAY; fbdefio->deferred_io = ufx_dpy_deferred_io; @@ -1595,7 +1595,7 @@ static int ufx_usb_probe(struct usb_interface *interface, usbdev = interface_to_usbdev(interface); BUG_ON(!usbdev); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) { dev_err(&usbdev->dev, "ufx_usb_probe: failed alloc of dev struct\n"); return -ENOMEM; @@ -1852,7 +1852,7 @@ static int ufx_alloc_urb_list(struct ufx_data *dev, int count, size_t size) INIT_LIST_HEAD(&dev->urbs.list); while (i < count) { - unode = kzalloc_obj(*unode, GFP_KERNEL); + unode = kzalloc_obj(*unode); if (!unode) break; unode->dev = dev; diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index ba060af2b09f..db14827aebdd 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -918,7 +918,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kzalloc_obj(struct fb_deferred_io, GFP_KERNEL); + fbdefio = kzalloc_obj(struct fb_deferred_io); if (fbdefio) { fbdefio->delay = DL_DEFIO_WRITE_DELAY; @@ -1607,7 +1607,7 @@ static int dlfb_usb_probe(struct usb_interface *intf, static u8 out_ep[] = {OUT_EP_NUM + USB_DIR_OUT, 0}; /* usb initialization */ - dlfb = kzalloc_obj(*dlfb, GFP_KERNEL); + dlfb = kzalloc_obj(*dlfb); if (!dlfb) { dev_err(&intf->dev, "%s: failed to allocate dlfb\n", __func__); return -ENOMEM; @@ -1853,7 +1853,7 @@ retry: dlfb->urbs.available = 0; while (dlfb->urbs.count * size < wanted_size) { - unode = kzalloc_obj(*unode, GFP_KERNEL); + unode = kzalloc_obj(*unode); if (!unode) break; unode->dlfb = dlfb; diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index c9e299afc02b..610a355dcb05 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -258,9 +258,9 @@ static struct uvesafb_ktask *uvesafb_prep(void) { struct uvesafb_ktask *task; - task = kzalloc_obj(*task, GFP_KERNEL); + task = kzalloc_obj(*task); if (task) { - task->done = kzalloc_obj(*task->done, GFP_KERNEL); + task->done = kzalloc_obj(*task->done); if (!task->done) { kfree(task); task = NULL; @@ -861,7 +861,7 @@ static int uvesafb_vbe_init_mode(struct fb_info *info) * Convert the modelist into a modedb so that we can use it with * fb_find_mode(). */ - mode = kzalloc_objs(*mode, i, GFP_KERNEL); + mode = kzalloc_objs(*mode, i); if (mode) { i = 0; list_for_each(pos, &info->modelist) { @@ -1047,7 +1047,7 @@ static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info) info->cmap.len || cmap->start < info->cmap.start) return -EINVAL; - entries = kmalloc_objs(*entries, cmap->len, GFP_KERNEL); + entries = kmalloc_objs(*entries, cmap->len); if (!entries) return -ENOMEM; @@ -1241,7 +1241,7 @@ setmode: info->var.pixclock != 0) { task->t.regs.ebx |= 0x0800; /* use CRTC data */ task->t.flags = TF_BUF_ESDI; - crtc = kzalloc_obj(struct vbe_crtc_ib, GFP_KERNEL); + crtc = kzalloc_obj(struct vbe_crtc_ib); if (!crtc) { err = -ENOMEM; goto out; diff --git a/drivers/video/fbdev/via/via_aux.c b/drivers/video/fbdev/via/via_aux.c index 11f28a16e9b1..47f88a2c4524 100644 --- a/drivers/video/fbdev/via/via_aux.c +++ b/drivers/video/fbdev/via/via_aux.c @@ -17,7 +17,7 @@ struct via_aux_bus *via_aux_probe(struct i2c_adapter *adap) if (!adap) return NULL; - bus = kmalloc_obj(*bus, GFP_KERNEL); + bus = kmalloc_obj(*bus); if (!bus) return NULL; diff --git a/drivers/video/fbdev/via/via_aux.h b/drivers/video/fbdev/via/via_aux.h index cb28fb21b1c7..6453d6a4fb4e 100644 --- a/drivers/video/fbdev/via/via_aux.h +++ b/drivers/video/fbdev/via/via_aux.h @@ -42,7 +42,7 @@ const struct fb_videomode *via_aux_get_preferred_mode(struct via_aux_bus *bus); static inline bool via_aux_add(struct via_aux_drv *drv) { - struct via_aux_drv *data = kmalloc_obj(*data, GFP_KERNEL); + struct via_aux_drv *data = kmalloc_obj(*data); if (!data) return false; diff --git a/drivers/video/fbdev/via/via_aux_edid.c b/drivers/video/fbdev/via/via_aux_edid.c index 75c40aede6f2..c4abfb1bcf52 100644 --- a/drivers/video/fbdev/via/via_aux_edid.c +++ b/drivers/video/fbdev/via/via_aux_edid.c @@ -24,7 +24,7 @@ static void query_edid(struct via_aux_drv *drv) if (spec) { fb_destroy_modedb(spec->modedb); } else { - spec = kmalloc_obj(*spec, GFP_KERNEL); + spec = kmalloc_obj(*spec); if (!spec) return; } diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c index a432b487bb76..4385976277ac 100644 --- a/drivers/video/fbdev/xen-fbfront.c +++ b/drivers/video/fbdev/xen-fbfront.c @@ -348,7 +348,7 @@ static int xenfb_probe(struct xenbus_device *dev, int val; int ret = 0; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info == NULL) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 54b6595e8758..c1d0a495ea1c 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -157,7 +157,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np) return NULL; } - disp = kzalloc_obj(*disp, GFP_KERNEL); + disp = kzalloc_obj(*disp); if (!disp) { pr_err("%pOF: could not allocate struct disp'\n", np); goto dispfail; @@ -198,7 +198,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np) struct display_timing *dt; int r; - dt = kmalloc_obj(*dt, GFP_KERNEL); + dt = kmalloc_obj(*dt); if (!dt) { pr_err("%pOF: could not allocate display_timing struct\n", np); diff --git a/drivers/video/sticore.c b/drivers/video/sticore.c index 8920c1fa2546..0d37e4b10447 100644 --- a/drivers/video/sticore.c +++ b/drivers/video/sticore.c @@ -558,7 +558,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) dest += sizeof(struct sti_rom_font); memcpy(dest, fbfont->data, bpc * fbfont->charcount); - cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font); if (!cooked_font) { kfree(nf); return NULL; @@ -678,7 +678,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom, struct sti_rom_font *raw_font, *font_start; struct sti_cooked_font *cooked_font; - cooked_font = kzalloc_obj(*cooked_font, GFP_KERNEL); + cooked_font = kzalloc_obj(*cooked_font); if (!cooked_font) return 0; @@ -692,7 +692,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom, while (raw_font->next_font) { raw_font = ((void *)font_start) + (raw_font->next_font); - cooked_font->next_font = kzalloc_obj(*cooked_font, GFP_KERNEL); + cooked_font->next_font = kzalloc_obj(*cooked_font); if (!cooked_font->next_font) return 1; @@ -806,7 +806,7 @@ static int sti_read_rom(int wordmode, struct sti_struct *sti, struct sti_rom *raw = NULL; unsigned long revno; - cooked = kmalloc_obj(*cooked, GFP_KERNEL); + cooked = kmalloc_obj(*cooked); if (!cooked) goto out_err; @@ -915,7 +915,7 @@ static struct sti_struct *sti_try_rom_generic(unsigned long address, return NULL; } - sti = kzalloc_obj(*sti, GFP_KERNEL); + sti = kzalloc_obj(*sti); if (!sti) return NULL; diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c index 0727716cf5fd..6a29d198f62c 100644 --- a/drivers/video/vgastate.c +++ b/drivers/video/vgastate.c @@ -351,7 +351,7 @@ int save_vga(struct vgastate *state) { struct regstate *saved; - saved = kzalloc_obj(struct regstate, GFP_KERNEL); + saved = kzalloc_obj(struct regstate); if (saved == NULL) return 1; diff --git a/drivers/virt/acrn/hsm.c b/drivers/virt/acrn/hsm.c index c73a566d135d..74f2086fa59f 100644 --- a/drivers/virt/acrn/hsm.c +++ b/drivers/virt/acrn/hsm.c @@ -30,7 +30,7 @@ static int acrn_dev_open(struct inode *inode, struct file *filp) { struct acrn_vm *vm; - vm = kzalloc_obj(*vm, GFP_KERNEL); + vm = kzalloc_obj(*vm); if (!vm) return -ENOMEM; @@ -64,7 +64,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr) kfree(pm_info); break; case ACRN_PMCMD_GET_PX_DATA: - px_data = kzalloc_obj(*px_data, GFP_KERNEL); + px_data = kzalloc_obj(*px_data); if (!px_data) return -ENOMEM; @@ -79,7 +79,7 @@ static int pmcmd_ioctl(u64 cmd, void __user *uptr) kfree(px_data); break; case ACRN_PMCMD_GET_CX_DATA: - cx_data = kzalloc_obj(*cx_data, GFP_KERNEL); + cx_data = kzalloc_obj(*cx_data); if (!cx_data) return -ENOMEM; diff --git a/drivers/virt/acrn/ioeventfd.c b/drivers/virt/acrn/ioeventfd.c index 5daccfaa127b..66fe9f3cef99 100644 --- a/drivers/virt/acrn/ioeventfd.c +++ b/drivers/virt/acrn/ioeventfd.c @@ -96,7 +96,7 @@ static int acrn_ioeventfd_assign(struct acrn_vm *vm, if (IS_ERR(eventfd)) return PTR_ERR(eventfd); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { ret = -ENOMEM; goto fail; diff --git a/drivers/virt/acrn/ioreq.c b/drivers/virt/acrn/ioreq.c index 2216e62406e0..584698d30607 100644 --- a/drivers/virt/acrn/ioreq.c +++ b/drivers/virt/acrn/ioreq.c @@ -123,7 +123,7 @@ int acrn_ioreq_range_add(struct acrn_ioreq_client *client, return -EINVAL; } - range = kzalloc_obj(*range, GFP_KERNEL); + range = kzalloc_obj(*range); if (!range) return -ENOMEM; @@ -424,7 +424,7 @@ struct acrn_ioreq_client *acrn_ioreq_client_create(struct acrn_vm *vm, "Cannot create non-default client w/o handler!\n"); return NULL; } - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return NULL; @@ -602,7 +602,7 @@ int acrn_ioreq_init(struct acrn_vm *vm, u64 buf_vma) if (vm->ioreq_buf) return -EEXIST; - set_buffer = kzalloc_obj(*set_buffer, GFP_KERNEL); + set_buffer = kzalloc_obj(*set_buffer); if (!set_buffer) return -ENOMEM; diff --git a/drivers/virt/acrn/irqfd.c b/drivers/virt/acrn/irqfd.c index f0ff5140699f..acf8cd5f8f8c 100644 --- a/drivers/virt/acrn/irqfd.c +++ b/drivers/virt/acrn/irqfd.c @@ -112,7 +112,7 @@ static int acrn_irqfd_assign(struct acrn_vm *vm, struct acrn_irqfd *args) __poll_t events; int ret = 0; - irqfd = kzalloc_obj(*irqfd, GFP_KERNEL); + irqfd = kzalloc_obj(*irqfd); if (!irqfd) return -ENOMEM; diff --git a/drivers/virt/acrn/mm.c b/drivers/virt/acrn/mm.c index 86b386761ee3..757cd84eff3b 100644 --- a/drivers/virt/acrn/mm.c +++ b/drivers/virt/acrn/mm.c @@ -21,7 +21,7 @@ static int modify_region(struct acrn_vm *vm, struct vm_memory_region_op *region) struct vm_memory_region_batch *regions; int ret; - regions = kzalloc_obj(*regions, GFP_KERNEL); + regions = kzalloc_obj(*regions); if (!regions) return -ENOMEM; @@ -55,7 +55,7 @@ int acrn_mm_region_add(struct acrn_vm *vm, u64 user_gpa, u64 service_gpa, struct vm_memory_region_op *region; int ret = 0; - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) return -ENOMEM; @@ -87,7 +87,7 @@ int acrn_mm_region_del(struct acrn_vm *vm, u64 user_gpa, u64 size) struct vm_memory_region_op *region; int ret = 0; - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) return -ENOMEM; diff --git a/drivers/virt/coco/guest/report.c b/drivers/virt/coco/guest/report.c index ab50adfec7ec..b254a1416286 100644 --- a/drivers/virt/coco/guest/report.c +++ b/drivers/virt/coco/guest/report.c @@ -428,7 +428,7 @@ static struct config_item *tsm_report_make_item(struct config_group *group, if (!provider.ops) return ERR_PTR(-ENXIO); - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return ERR_PTR(-ENOMEM); diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-core.c index b783fd36fc7e..98dcf7d836df 100644 --- a/drivers/virt/coco/tsm-core.c +++ b/drivers/virt/coco/tsm-core.c @@ -35,7 +35,7 @@ static struct tsm_dev *alloc_tsm_dev(struct device *parent) int id; struct tsm_dev *tsm_dev __free(kfree) = - kzalloc_obj(*tsm_dev, GFP_KERNEL); + kzalloc_obj(*tsm_dev); if (!tsm_dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c index 541ee3a4909c..f472c94806da 100644 --- a/drivers/virt/fsl_hypervisor.c +++ b/drivers/virt/fsl_hypervisor.c @@ -226,7 +226,7 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p) * 'pages' is an array of struct page pointers that's initialized by * get_user_pages_fast(). */ - pages = kzalloc_objs(struct page *, num_pages, GFP_KERNEL); + pages = kzalloc_objs(struct page *, num_pages); if (!pages) { pr_debug("fsl-hv: could not allocate page list\n"); return -ENOMEM; @@ -660,7 +660,7 @@ static int fsl_hv_open(struct inode *inode, struct file *filp) struct doorbell_queue *dbq; unsigned long flags; - dbq = kzalloc_obj(struct doorbell_queue, GFP_KERNEL); + dbq = kzalloc_obj(struct doorbell_queue); if (!dbq) { pr_err("fsl-hv: out of memory\n"); return -ENOMEM; @@ -845,7 +845,7 @@ static int __init fsl_hypervisor_init(void) continue; } - dbisr = kzalloc_obj(*dbisr, GFP_KERNEL); + dbisr = kzalloc_obj(*dbisr); if (!dbisr) goto out_of_memory; diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index 1ad44e92348a..e96d32f4eef8 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -928,7 +928,7 @@ static int ne_set_user_memory_region_ioctl(struct ne_enclave *ne_enclave, if (rc < 0) return rc; - ne_mem_region = kzalloc_obj(*ne_mem_region, GFP_KERNEL); + ne_mem_region = kzalloc_obj(*ne_mem_region); if (!ne_mem_region) return -ENOMEM; @@ -1616,7 +1616,7 @@ static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 __user *slot_ui mutex_unlock(&ne_cpu_pool.mutex); - ne_enclave = kzalloc_obj(*ne_enclave, GFP_KERNEL); + ne_enclave = kzalloc_obj(*ne_enclave); if (!ne_enclave) return -ENOMEM; diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c index a219657ace80..3e1455d50526 100644 --- a/drivers/virt/nitro_enclaves/ne_pci_dev.c +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c @@ -468,7 +468,7 @@ static int ne_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct ne_pci_dev *ne_pci_dev = NULL; int rc = -EINVAL; - ne_pci_dev = kzalloc_obj(*ne_pci_dev, GFP_KERNEL); + ne_pci_dev = kzalloc_obj(*ne_pci_dev); if (!ne_pci_dev) return -ENOMEM; diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c index 9621606fc5db..b5dc0d01facd 100644 --- a/drivers/virt/vboxguest/vboxguest_core.c +++ b/drivers/virt/vboxguest/vboxguest_core.c @@ -74,7 +74,7 @@ static void vbg_guest_mappings_init(struct vbg_dev *gdev) /* Add 4M so that we can align the vmap to 4MiB as the host requires. */ size = PAGE_ALIGN(req->hypervisor_size) + SZ_4M; - pages = kmalloc_objs(*pages, size >> PAGE_SHIFT, GFP_KERNEL); + pages = kmalloc_objs(*pages, size >> PAGE_SHIFT); if (!pages) goto out; @@ -1080,7 +1080,7 @@ struct vbg_session *vbg_core_open_session(struct vbg_dev *gdev, u32 requestor) { struct vbg_session *session; - session = kzalloc_obj(*session, GFP_KERNEL); + session = kzalloc_obj(*session); if (!session) return ERR_PTR(-ENOMEM); diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4151aeebe766..d1fbc8fe8470 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -927,7 +927,7 @@ static int virtballoon_probe(struct virtio_device *vdev) return -EINVAL; } - vdev->priv = vb = kzalloc_obj(*vb, GFP_KERNEL); + vdev->priv = vb = kzalloc_obj(*vb); if (!vb) { err = -ENOMEM; goto out; diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c index 2386021e6dc5..deec24e8e682 100644 --- a/drivers/virtio/virtio_input.c +++ b/drivers/virtio/virtio_input.c @@ -229,7 +229,7 @@ static int virtinput_probe(struct virtio_device *vdev) if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) return -ENODEV; - vi = kzalloc_obj(*vi, GFP_KERNEL); + vi = kzalloc_obj(*vi); if (!vi) return -ENOMEM; diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 065027783822..48051e9e98ab 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2940,7 +2940,7 @@ static int virtio_mem_probe(struct virtio_device *vdev) BUILD_BUG_ON(sizeof(struct virtio_mem_req) != 24); BUILD_BUG_ON(sizeof(struct virtio_mem_resp) != 10); - vdev->priv = vm = kzalloc_obj(*vm, GFP_KERNEL); + vdev->priv = vm = kzalloc_obj(*vm); if (!vm) return -ENOMEM; diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 7b063ea8b7f1..595c2274fbb5 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -575,7 +575,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) unsigned long magic; int rc; - vm_dev = kzalloc_obj(*vm_dev, GFP_KERNEL); + vm_dev = kzalloc_obj(*vm_dev); if (!vm_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_admin_legacy_io.c b/drivers/virtio/virtio_pci_admin_legacy_io.c index 24733b098703..e3a9d261812a 100644 --- a/drivers/virtio/virtio_pci_admin_legacy_io.c +++ b/drivers/virtio/virtio_pci_admin_legacy_io.c @@ -124,7 +124,7 @@ static int virtio_pci_admin_legacy_io_read(struct pci_dev *pdev, u16 opcode, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -210,7 +210,7 @@ int virtio_pci_admin_legacy_io_notify_info(struct pci_dev *pdev, if (vf_id < 0) return vf_id; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 2749bd6500fb..d3bdd68d4b6a 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -210,7 +210,7 @@ static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned int in struct virtio_pci_vq_info **p_info) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc_obj(*info, GFP_KERNEL); + struct virtio_pci_vq_info *info = kmalloc_obj(*info); struct virtqueue *vq; unsigned long flags; @@ -386,7 +386,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs, bool per_vq_vectors; u16 avq_num = 0; - vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs); if (!vp_dev->vqs) return -ENOMEM; @@ -463,7 +463,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vq; u16 avq_num = 0; - vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs); if (!vp_dev->vqs) return -ENOMEM; @@ -685,7 +685,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, int rc; /* allocate our structure and fill it out */ - vp_dev = kzalloc_obj(struct virtio_pci_device, GFP_KERNEL); + vp_dev = kzalloc_obj(struct virtio_pci_device); if (!vp_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index 041a7fd72835..6d8ae2a6a8ca 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -137,11 +137,11 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev, if (!virtio_has_feature(vdev, VIRTIO_F_ADMIN_VQ)) return -EOPNOTSUPP; - va_status = kzalloc_obj(*va_status, GFP_KERNEL); + va_status = kzalloc_obj(*va_status); if (!va_status) return -ENOMEM; - va_hdr = kzalloc_obj(*va_hdr, GFP_KERNEL); + va_hdr = kzalloc_obj(*va_hdr); if (!va_hdr) { ret = -ENOMEM; goto err_alloc; @@ -204,7 +204,7 @@ static void virtio_pci_admin_cmd_list_init(struct virtio_device *virtio_dev) __le64 *data; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; @@ -246,11 +246,11 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev) u16 set_data_size; int ret; - get_data = kzalloc_obj(*get_data, GFP_KERNEL); + get_data = kzalloc_obj(*get_data); if (!get_data) return; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) goto end; @@ -310,7 +310,7 @@ static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev) struct scatterlist result_sg; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; @@ -929,7 +929,7 @@ int virtio_pci_admin_mode_set(struct pci_dev *pdev, u8 flags) if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1054,7 +1054,7 @@ int virtio_pci_admin_obj_destroy(struct pci_dev *pdev, u16 obj_type, u32 id) if (obj_type != VIRTIO_RESOURCE_OBJ_DEV_PARTS) return -EINVAL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1109,11 +1109,11 @@ int virtio_pci_admin_dev_parts_metadata_get(struct pci_dev *pdev, u16 obj_type, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) { ret = -ENOMEM; goto end; @@ -1173,7 +1173,7 @@ int virtio_pci_admin_dev_parts_get(struct pci_dev *pdev, u16 obj_type, u32 id, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 2cab954906cd..335692d41617 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1209,7 +1209,7 @@ static int vring_alloc_state_extra_split(struct vring_virtqueue_split *vring_spl struct vring_desc_extra *extra; u32 num = vring_split->vring.num; - state = kmalloc_objs(struct vring_desc_state_split, num, GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_split, num); if (!state) goto err_state; @@ -1308,7 +1308,7 @@ static struct virtqueue *__vring_new_virtqueue_split(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc_obj(*vq, GFP_KERNEL); + vq = kmalloc_obj(*vq); if (!vq) return NULL; @@ -2349,7 +2349,7 @@ static struct vring_desc_extra *vring_alloc_desc_extra(unsigned int num) struct vring_desc_extra *desc_extra; unsigned int i; - desc_extra = kmalloc_objs(struct vring_desc_extra, num, GFP_KERNEL); + desc_extra = kmalloc_objs(struct vring_desc_extra, num); if (!desc_extra) return NULL; @@ -2449,7 +2449,7 @@ static int vring_alloc_state_extra_packed(struct vring_virtqueue_packed *vring_p struct vring_desc_extra *extra; u32 num = vring_packed->vring.num; - state = kmalloc_objs(struct vring_desc_state_packed, num, GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_packed, num); if (!state) goto err_desc_state; @@ -2528,7 +2528,7 @@ static struct virtqueue *__vring_new_virtqueue_packed(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc_obj(*vq, GFP_KERNEL); + vq = kmalloc_obj(*vq); if (!vq) return NULL; diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 6c0d2f946817..de2af696de6c 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -287,7 +287,7 @@ create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) if (!affvecs) return NULL; - masks = kzalloc_objs(*masks, nvecs, GFP_KERNEL); + masks = kzalloc_objs(*masks, nvecs); if (!masks) return NULL; @@ -462,7 +462,7 @@ static int virtio_vdpa_probe(struct vdpa_device *vdpa) struct virtio_vdpa_device *vd_dev, *reg_dev = NULL; int ret = -EINVAL; - vd_dev = kzalloc_obj(*vd_dev, GFP_KERNEL); + vd_dev = kzalloc_obj(*vd_dev); if (!vd_dev) return -ENOMEM; diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c index 68501b0a2c4d..35e75d07ef5d 100644 --- a/drivers/w1/masters/ds2490.c +++ b/drivers/w1/masters/ds2490.c @@ -1018,7 +1018,7 @@ static int ds_probe(struct usb_interface *intf, struct ds_device *dev; int i, err, alt; - dev = kzalloc_obj(struct ds_device, GFP_KERNEL); + dev = kzalloc_obj(struct ds_device); if (!dev) return -ENOMEM; diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c index 54d78060d6ff..ff61ea4f2030 100644 --- a/drivers/w1/slaves/w1_ds2433.c +++ b/drivers/w1/slaves/w1_ds2433.c @@ -320,7 +320,7 @@ static int w1_f23_add_slave(struct w1_slave *sl) { struct w1_f23_data *data; - data = kzalloc_obj(struct w1_f23_data, GFP_KERNEL); + data = kzalloc_obj(struct w1_f23_data); if (!data) return -ENOMEM; diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c index cb198414d47b..3b3c0789e1ad 100644 --- a/drivers/w1/slaves/w1_ds28e04.c +++ b/drivers/w1/slaves/w1_ds28e04.c @@ -384,7 +384,7 @@ static int w1_f1C_add_slave(struct w1_slave *sl) struct w1_f1C_data *data = NULL; if (w1_enable_crccheck) { - data = kzalloc_obj(struct w1_f1C_data, GFP_KERNEL); + data = kzalloc_obj(struct w1_f1C_data); if (!data) return -ENOMEM; sl->family_data = data; diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index f72e9b57fe79..d96b224e2215 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c @@ -973,7 +973,7 @@ static int w1_therm_add_slave(struct w1_slave *sl) struct w1_therm_family_converter *sl_family_conv; /* Allocate memory */ - sl->family_data = kzalloc_obj(struct w1_therm_family_data, GFP_KERNEL); + sl->family_data = kzalloc_obj(struct w1_therm_family_data); if (!sl->family_data) return -ENOMEM; diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index a08d5b420f31..486f321eadc8 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -715,7 +715,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn) int err; struct w1_netlink_msg msg; - sl = kzalloc_obj(struct w1_slave, GFP_KERNEL); + sl = kzalloc_obj(struct w1_slave); if (!sl) { dev_err(&dev->dev, "%s: failed to allocate new slave device.\n", diff --git a/drivers/watchdog/exar_wdt.c b/drivers/watchdog/exar_wdt.c index 30fa33a4c08d..db62c9797406 100644 --- a/drivers/watchdog/exar_wdt.c +++ b/drivers/watchdog/exar_wdt.c @@ -342,7 +342,7 @@ static int __init exar_wdt_register(struct wdt_priv *priv, const int idx) { struct wdt_pdev_node *n; - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) return -ENOMEM; diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c index 01c44881608c..db45b53929a9 100644 --- a/drivers/watchdog/mei_wdt.c +++ b/drivers/watchdog/mei_wdt.c @@ -563,7 +563,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev, struct mei_wdt *wdt; int ret; - wdt = kzalloc_obj(struct mei_wdt, GFP_KERNEL); + wdt = kzalloc_obj(struct mei_wdt); if (!wdt) return -ENOMEM; diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index dbefe9a690d7..d7c18c990649 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c @@ -641,7 +641,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); /* allocate memory for our device and initialize it */ - usb_pcwd = kzalloc_obj(struct usb_pcwd_private, GFP_KERNEL); + usb_pcwd = kzalloc_obj(struct usb_pcwd_private); if (usb_pcwd == NULL) goto error; diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index cd4c7342a172..834f65f4b59a 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -1019,7 +1019,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd) struct watchdog_core_data *wd_data; int err; - wd_data = kzalloc_obj(struct watchdog_core_data, GFP_KERNEL); + wd_data = kzalloc_obj(struct watchdog_core_data); if (!wd_data) return -ENOMEM; mutex_init(&wd_data->lock); diff --git a/drivers/watchdog/watchdog_pretimeout.c b/drivers/watchdog/watchdog_pretimeout.c index 3957b6ba63b7..19eb2ed2c7cb 100644 --- a/drivers/watchdog/watchdog_pretimeout.c +++ b/drivers/watchdog/watchdog_pretimeout.c @@ -119,7 +119,7 @@ int watchdog_register_governor(struct watchdog_governor *gov) struct watchdog_pretimeout *p; struct governor_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -183,7 +183,7 @@ int watchdog_register_pretimeout(struct watchdog_device *wdd) if (!watchdog_have_pretimeout(wdd)) return 0; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c index 009c76546d85..7bc0fc400fd1 100644 --- a/drivers/xen/arm-device.c +++ b/drivers/xen/arm-device.c @@ -59,9 +59,9 @@ static int xen_map_device_mmio(const struct resource *resources, if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) continue; - gpfns = kzalloc_objs(xen_pfn_t, nr, GFP_KERNEL); - idxs = kzalloc_objs(xen_ulong_t, nr, GFP_KERNEL); - errs = kzalloc_objs(int, nr, GFP_KERNEL); + gpfns = kzalloc_objs(xen_pfn_t, nr); + idxs = kzalloc_objs(xen_ulong_t, nr); + errs = kzalloc_objs(int, nr); if (!gpfns || !idxs || !errs) { kfree(gpfns); kfree(idxs); diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 6cbff7e90947..e7f1d4ca6d75 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -242,7 +242,7 @@ static struct resource *additional_memory_resource(phys_addr_t size) struct resource *res; int ret; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return NULL; diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 515bb5708e7f..679e807c3663 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -714,7 +714,7 @@ static struct irq_info *xen_irq_init(unsigned int irq) { struct irq_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (info) { info->irq = irq; info->type = IRQT_UNBOUND; diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index 568f1830f3a3..b7665bf2774c 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c @@ -332,7 +332,7 @@ static int evtchn_resize_ring(struct per_user_data *u) else new_size = 2 * u->ring_size; - new_ring = kvmalloc_objs(*new_ring, new_size, GFP_KERNEL); + new_ring = kvmalloc_objs(*new_ring, new_size); if (!new_ring) return -ENOMEM; @@ -386,7 +386,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port, * serialized bind operations.) */ - evtchn = kzalloc_obj(*evtchn, GFP_KERNEL); + evtchn = kzalloc_obj(*evtchn); if (!evtchn) return -ENOMEM; @@ -642,7 +642,7 @@ static int evtchn_open(struct inode *inode, struct file *filp) { struct per_user_data *u; - u = kzalloc_obj(*u, GFP_KERNEL); + u = kzalloc_obj(*u); if (u == NULL) return -ENOMEM; diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index 8204135c31f9..eadedd1e963e 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c @@ -128,7 +128,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE); for (i = 0; i < op->count; i++) { - gref = kzalloc_obj(*gref, GFP_KERNEL); + gref = kzalloc_obj(*gref); if (!gref) { rc = -ENOMEM; goto undo; @@ -229,7 +229,7 @@ static int gntalloc_open(struct inode *inode, struct file *filp) { struct gntalloc_file_private_data *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) goto out_nomem; INIT_LIST_HEAD(&priv->list); @@ -501,7 +501,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma) return -EINVAL; } - vm_priv = kmalloc_obj(*vm_priv, GFP_KERNEL); + vm_priv = kmalloc_obj(*vm_priv); if (!vm_priv) return -ENOMEM; diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 649d3a912d20..4a6f4325ad04 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -95,7 +95,7 @@ dmabuf_exp_wait_obj_new(struct gntdev_dmabuf_priv *priv, { struct gntdev_dmabuf_wait_obj *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return ERR_PTR(-ENOMEM); @@ -198,7 +198,7 @@ dmabuf_pages_to_sgt(struct page **pages, unsigned int nr_pages) struct sg_table *sgt; int ret; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { ret = -ENOMEM; goto out; @@ -222,7 +222,7 @@ static int dmabuf_exp_ops_attach(struct dma_buf *dma_buf, { struct gntdev_dmabuf_attachment *gntdev_dmabuf_attach; - gntdev_dmabuf_attach = kzalloc_obj(*gntdev_dmabuf_attach, GFP_KERNEL); + gntdev_dmabuf_attach = kzalloc_obj(*gntdev_dmabuf_attach); if (!gntdev_dmabuf_attach) return -ENOMEM; @@ -362,7 +362,7 @@ static int dmabuf_exp_from_pages(struct gntdev_dmabuf_export_args *args) if (ret < 0) return ret; - gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL); + gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf); if (!gntdev_dmabuf) return -ENOMEM; @@ -530,7 +530,7 @@ static struct gntdev_dmabuf *dmabuf_imp_alloc_storage(int count) struct gntdev_dmabuf *gntdev_dmabuf; int i; - gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL); + gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf); if (!gntdev_dmabuf) goto fail_no_free; @@ -816,7 +816,7 @@ struct gntdev_dmabuf_priv *gntdev_dmabuf_init(struct file *filp) { struct gntdev_dmabuf_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 1a986cb7324a..a16e21d2ca91 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -141,16 +141,16 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count, struct gntdev_grant_map *add; int i; - add = kzalloc_obj(*add, GFP_KERNEL); + add = kzalloc_obj(*add); if (NULL == add) return NULL; - add->grants = kvmalloc_objs(add->grants[0], count, GFP_KERNEL); - add->map_ops = kvmalloc_objs(add->map_ops[0], count, GFP_KERNEL); - add->unmap_ops = kvmalloc_objs(add->unmap_ops[0], count, GFP_KERNEL); - add->pages = kvzalloc_objs(add->pages[0], count, GFP_KERNEL); + add->grants = kvmalloc_objs(add->grants[0], count); + add->map_ops = kvmalloc_objs(add->map_ops[0], count); + add->unmap_ops = kvmalloc_objs(add->unmap_ops[0], count); + add->pages = kvzalloc_objs(add->pages[0], count); add->being_removed = - kvzalloc_objs(add->being_removed[0], count, GFP_KERNEL); + kvzalloc_objs(add->being_removed[0], count); if (NULL == add->grants || NULL == add->map_ops || NULL == add->unmap_ops || @@ -176,7 +176,7 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count, if (dma_flags & (GNTDEV_DMA_FLAG_WC | GNTDEV_DMA_FLAG_COHERENT)) { struct gnttab_dma_alloc_args args; - add->frames = kvzalloc_objs(add->frames[0], count, GFP_KERNEL); + add->frames = kvzalloc_objs(add->frames[0], count); if (!add->frames) goto err; @@ -583,7 +583,7 @@ static int gntdev_open(struct inode *inode, struct file *flip) { struct gntdev_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -968,7 +968,7 @@ static long gntdev_ioctl_grant_copy(struct gntdev_priv *priv, void __user *u) mutex_lock(&priv->batch_lock); if (!priv->batch) { - batch = kmalloc_obj(*batch, GFP_KERNEL); + batch = kmalloc_obj(*batch); } else { batch = priv->batch; priv->batch = batch->next; diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 6fcd5a7f6605..908d009f70fd 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -831,7 +831,7 @@ int gnttab_setup_auto_xlat_frames(phys_addr_t addr) &addr); return -ENOMEM; } - pfn = kzalloc_objs(pfn[0], max_nr_gframes, GFP_KERNEL); + pfn = kzalloc_objs(pfn[0], max_nr_gframes); if (!pfn) { memunmap(vaddr); return -ENOMEM; @@ -868,7 +868,7 @@ int gnttab_pages_set_private(int nr_pages, struct page **pages) #if BITS_PER_LONG < 64 struct xen_page_foreign *foreign; - foreign = kzalloc_obj(*foreign, GFP_KERNEL); + foreign = kzalloc_obj(*foreign); if (!foreign) return -ENOMEM; diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c index ca8dbb9be419..53a8720f5cae 100644 --- a/drivers/xen/mcelog.c +++ b/drivers/xen/mcelog.c @@ -373,7 +373,7 @@ static int bind_virq_for_mce(void) /* Fetch each CPU Physical Info for later reference*/ ncpus = mc_op.u.mc_physcpuinfo.ncpus; - g_physinfo = kzalloc_objs(struct mcinfo_logical_cpu, ncpus, GFP_KERNEL); + g_physinfo = kzalloc_objs(struct mcinfo_logical_cpu, ncpus); if (!g_physinfo) return -ENOMEM; set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo); diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index 07e6b811c9d3..385d2587bd1b 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -336,7 +336,7 @@ int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain) { struct xen_device_domain_owner *owner; - owner = kzalloc_obj(struct xen_device_domain_owner, GFP_KERNEL); + owner = kzalloc_obj(struct xen_device_domain_owner); if (!owner) return -ENODEV; diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index 1d9f3874d099..0a20bb7c5438 100644 --- a/drivers/xen/pcpu.c +++ b/drivers/xen/pcpu.c @@ -247,7 +247,7 @@ static struct pcpu *create_and_register_pcpu(struct xenpf_pcpuinfo *info) if (info->flags & XEN_PCPU_FLAGS_INVALID) return ERR_PTR(-ENODEV); - pcpu = kzalloc_obj(struct pcpu, GFP_KERNEL); + pcpu = kzalloc_obj(struct pcpu); if (!pcpu) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c index 95d2d5ca5e4f..c0178ea010cf 100644 --- a/drivers/xen/privcmd-buf.c +++ b/drivers/xen/privcmd-buf.c @@ -39,7 +39,7 @@ static int privcmd_buf_open(struct inode *ino, struct file *file) { struct privcmd_buf_private *file_priv; - file_priv = kzalloc_obj(*file_priv, GFP_KERNEL); + file_priv = kzalloc_obj(*file_priv); if (!file_priv) return -ENOMEM; diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index a5d9211f36c3..1759cc18753f 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -433,7 +433,7 @@ static int alloc_empty_pages(struct vm_area_struct *vma, int numpgs) int rc; struct page **pages; - pages = kvzalloc_objs(pages[0], numpgs, GFP_KERNEL); + pages = kvzalloc_objs(pages[0], numpgs); if (pages == NULL) return -ENOMEM; @@ -653,7 +653,7 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) if (kdata.num > privcmd_dm_op_max_num) return -E2BIG; - kbufs = kzalloc_objs(*kbufs, kdata.num, GFP_KERNEL); + kbufs = kzalloc_objs(*kbufs, kdata.num); if (!kbufs) return -ENOMEM; @@ -680,13 +680,13 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) PAGE_SIZE); } - pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages); if (!pages) { rc = -ENOMEM; goto out; } - xbufs = kzalloc_objs(*xbufs, kdata.num, GFP_KERNEL); + xbufs = kzalloc_objs(*xbufs, kdata.num); if (!xbufs) { rc = -ENOMEM; goto out; @@ -1355,7 +1355,7 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd) if (!ioeventfd->vcpus || ioeventfd->vcpus > 4096) return -EINVAL; - kioeventfd = kzalloc_obj(*kioeventfd, GFP_KERNEL); + kioeventfd = kzalloc_obj(*kioeventfd); if (!kioeventfd) return -ENOMEM; @@ -1563,7 +1563,7 @@ static long privcmd_ioctl(struct file *file, static int privcmd_open(struct inode *ino, struct file *file) { - struct privcmd_data *data = kzalloc_obj(*data, GFP_KERNEL); + struct privcmd_data *data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index 8a5dafcaab03..ba62651a7f33 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -324,7 +324,7 @@ static struct sock_mapping *pvcalls_new_active_socket( struct sock_mapping *map; void *page; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { sock_release(sock); return NULL; @@ -632,7 +632,7 @@ static int pvcalls_back_bind(struct xenbus_device *dev, fedata = dev_get_drvdata(&dev->dev); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { ret = -ENOMEM; goto out; @@ -934,7 +934,7 @@ static int backend_connect(struct xenbus_device *dev) grant_ref_t ring_ref; struct pvcalls_fedata *fedata = NULL; - fedata = kzalloc_obj(struct pvcalls_fedata, GFP_KERNEL); + fedata = kzalloc_obj(struct pvcalls_fedata); if (!fedata) return -ENOMEM; diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index c32fd69482e9..50ce4820f7ee 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -291,7 +291,7 @@ int pvcalls_front_socket(struct socket *sock) } bedata = dev_get_drvdata(&pvcalls_front_dev->dev); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { pvcalls_exit(); return -ENOMEM; @@ -820,7 +820,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, } } - map2 = kzalloc_obj(*map2, GFP_KERNEL); + map2 = kzalloc_obj(*map2); if (map2 == NULL) { clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, (void *)&map->passive.flags); @@ -1179,7 +1179,7 @@ static int pvcalls_front_probe(struct xenbus_device *dev, return -ENODEV; pr_info("%s max-page-order is %u\n", __func__, max_page_order); - bedata = kzalloc_obj(struct pvcalls_bedata, GFP_KERNEL); + bedata = kzalloc_obj(struct pvcalls_bedata); if (!bedata) return -ENOMEM; diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c index 25f4e1ff13f6..b1bb01ba82f8 100644 --- a/drivers/xen/sys-hypervisor.c +++ b/drivers/xen/sys-hypervisor.c @@ -182,7 +182,7 @@ static ssize_t compiler_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -200,7 +200,7 @@ static ssize_t compiled_by_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -218,7 +218,7 @@ static ssize_t compile_date_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_compile_info *info; - info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL); + info = kmalloc_obj(struct xen_compile_info); if (info) { ret = HYPERVISOR_xen_version(XENVER_compile_info, info); if (!ret) @@ -291,7 +291,7 @@ static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer) int ret = -ENOMEM; struct xen_platform_parameters *parms; - parms = kmalloc_obj(struct xen_platform_parameters, GFP_KERNEL); + parms = kmalloc_obj(struct xen_platform_parameters); if (parms) { ret = HYPERVISOR_xen_version(XENVER_platform_parameters, parms); diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c index 4cfb6abdc3d8..9cdabf18451e 100644 --- a/drivers/xen/unpopulated-alloc.c +++ b/drivers/xen/unpopulated-alloc.c @@ -43,7 +43,7 @@ static int fill_list(unsigned int nr_pages) struct range mhp_range; int ret; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); if (!res) return -ENOMEM; @@ -65,7 +65,7 @@ static int fill_list(unsigned int nr_pages) * re-using it by someone else. */ if (target_resource != &iomem_resource) { - tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL); + tmp_res = kzalloc_obj(*tmp_res); if (!tmp_res) { ret = -ENOMEM; goto err_insert; @@ -84,7 +84,7 @@ static int fill_list(unsigned int nr_pages) } } - pgmap = kzalloc_obj(*pgmap, GFP_KERNEL); + pgmap = kzalloc_obj(*pgmap); if (!pgmap) { ret = -ENOMEM; goto err_pgmap; diff --git a/drivers/xen/xen-front-pgdir-shbuf.c b/drivers/xen/xen-front-pgdir-shbuf.c index 32e28f044b33..f693b963a2e8 100644 --- a/drivers/xen/xen-front-pgdir-shbuf.c +++ b/drivers/xen/xen-front-pgdir-shbuf.c @@ -205,7 +205,7 @@ static int backend_unmap(struct xen_front_pgdir_shbuf *buf) if (!buf->pages || !buf->backend_map_handles || !buf->grefs) return 0; - unmap_ops = kzalloc_objs(*unmap_ops, buf->num_pages, GFP_KERNEL); + unmap_ops = kzalloc_objs(*unmap_ops, buf->num_pages); if (!unmap_ops) return -ENOMEM; @@ -249,7 +249,7 @@ static int backend_map(struct xen_front_pgdir_shbuf *buf) unsigned char *ptr; int ret, cur_gref, cur_dir_page, cur_page, grefs_left; - map_ops = kzalloc_objs(*map_ops, buf->num_pages, GFP_KERNEL); + map_ops = kzalloc_objs(*map_ops, buf->num_pages); if (!map_ops) return -ENOMEM; @@ -472,7 +472,7 @@ static int grant_references(struct xen_front_pgdir_shbuf *buf) */ static int alloc_storage(struct xen_front_pgdir_shbuf *buf) { - buf->grefs = kzalloc_objs(*buf->grefs, buf->num_grefs, GFP_KERNEL); + buf->grefs = kzalloc_objs(*buf->grefs, buf->num_grefs); if (!buf->grefs) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c index fbc40acd593f..a2ae8de6f9e2 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -401,7 +401,7 @@ int xen_pcibk_config_add_field_offset(struct pci_dev *dev, struct config_field_entry *cfg_entry; void *tmp; - cfg_entry = kmalloc_obj(*cfg_entry, GFP_KERNEL); + cfg_entry = kmalloc_obj(*cfg_entry); if (!cfg_entry) { err = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c index 0efbd85cf7e1..8b50cbcbdfe1 100644 --- a/drivers/xen/xen-pciback/conf_space_header.c +++ b/drivers/xen/xen-pciback/conf_space_header.c @@ -33,7 +33,7 @@ struct pci_bar_info { static void *command_init(struct pci_dev *dev, int offset) { - struct pci_cmd_info *cmd = kmalloc_obj(*cmd, GFP_KERNEL); + struct pci_cmd_info *cmd = kmalloc_obj(*cmd); int err; if (!cmd) @@ -211,7 +211,7 @@ static void *bar_init(struct pci_dev *dev, int offset) { unsigned int pos; const struct resource *res = dev->resource; - struct pci_bar_info *bar = kzalloc_obj(*bar, GFP_KERNEL); + struct pci_bar_info *bar = kzalloc_obj(*bar); if (!bar) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/xen-pciback/conf_space_quirks.c b/drivers/xen/xen-pciback/conf_space_quirks.c index 52c8d38cb434..675519b51287 100644 --- a/drivers/xen/xen-pciback/conf_space_quirks.c +++ b/drivers/xen/xen-pciback/conf_space_quirks.c @@ -97,7 +97,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev) struct xen_pcibk_config_quirk *quirk; int ret = 0; - quirk = kzalloc_obj(*quirk, GFP_KERNEL); + quirk = kzalloc_obj(*quirk); if (!quirk) { ret = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/passthrough.c b/drivers/xen/xen-pciback/passthrough.c index 9d2583a7a19a..7a6df524c071 100644 --- a/drivers/xen/xen-pciback/passthrough.c +++ b/drivers/xen/xen-pciback/passthrough.c @@ -51,7 +51,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, unsigned int domain, bus, devfn; int err; - dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL); + dev_entry = kmalloc_obj(*dev_entry); if (!dev_entry) return -ENOMEM; dev_entry->dev = dev; @@ -101,7 +101,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev) { struct passthrough_dev_data *dev_data; - dev_data = kmalloc_obj(*dev_data, GFP_KERNEL); + dev_data = kmalloc_obj(*dev_data); if (!dev_data) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index ffc70ce61c8f..e4b27aecbf05 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -79,7 +79,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev) dev_dbg(&dev->dev, "pcistub_device_alloc\n"); - psdev = kzalloc_obj(*psdev, GFP_KERNEL); + psdev = kzalloc_obj(*psdev); if (!psdev) return NULL; @@ -623,7 +623,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id) } if (!match) { - pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL); + pci_dev_id = kmalloc_obj(*pci_dev_id); if (!pci_dev_id) { err = -ENOMEM; goto out; @@ -1129,7 +1129,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func) || PCI_FUNC(devfn) != func) return -EINVAL; - pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL); + pci_dev_id = kmalloc_obj(*pci_dev_id); if (!pci_dev_id) return -ENOMEM; @@ -1189,7 +1189,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, } dev = psdev->dev; - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) { err = -ENOMEM; goto out; diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c index 2755ab0b0d85..bfc186bf05bc 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c @@ -219,7 +219,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY)) return -ENXIO; - entries = kmalloc_objs(*entries, op->value, GFP_KERNEL); + entries = kmalloc_objs(*entries, op->value); if (entries == NULL) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c index 391ea1040b16..df292c19effb 100644 --- a/drivers/xen/xen-pciback/vpci.c +++ b/drivers/xen/xen-pciback/vpci.c @@ -81,7 +81,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, goto out; } - dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL); + dev_entry = kmalloc_obj(*dev_entry); if (!dev_entry) { err = -ENOMEM; xenbus_dev_fatal(pdev->xdev, err, @@ -186,7 +186,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev) int slot; struct vpci_dev_data *vpci_dev; - vpci_dev = kmalloc_obj(*vpci_dev, GFP_KERNEL); + vpci_dev = kmalloc_obj(*vpci_dev); if (!vpci_dev) return -ENOMEM; diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c index d5e001ff0489..22ff9cf35fc4 100644 --- a/drivers/xen/xen-pciback/xenbus.c +++ b/drivers/xen/xen-pciback/xenbus.c @@ -38,7 +38,7 @@ static struct xen_pcibk_device *alloc_pdev(struct xenbus_device *xdev) { struct xen_pcibk_device *pdev; - pdev = kzalloc_obj(struct xen_pcibk_device, GFP_KERNEL); + pdev = kzalloc_obj(struct xen_pcibk_device); if (pdev == NULL) goto out; dev_dbg(&xdev->dev, "allocated pdev @ 0x%p\n", pdev); diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 66758c72d5d1..dee1a05fdd44 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -974,7 +974,7 @@ static int scsiback_add_translation_entry(struct vscsibk_info *info, return -ENODEV; } - new = kmalloc_obj(struct v2p_entry, GFP_KERNEL); + new = kmalloc_obj(struct v2p_entry); if (new == NULL) { err = -ENOMEM; goto out_free; @@ -1270,7 +1270,7 @@ static int scsiback_probe(struct xenbus_device *dev, { int err; - struct vscsibk_info *info = kzalloc_obj(struct vscsibk_info, GFP_KERNEL); + struct vscsibk_info *info = kzalloc_obj(struct vscsibk_info); pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id); @@ -1351,7 +1351,7 @@ scsiback_make_tport(struct target_fabric_configfs *tf, u64 wwpn = 0; int off = 0; - tport = kzalloc_obj(struct scsiback_tport, GFP_KERNEL); + tport = kzalloc_obj(struct scsiback_tport); if (!tport) return ERR_PTR(-ENOMEM); @@ -1531,7 +1531,7 @@ static int scsiback_make_nexus(struct scsiback_tpg *tpg, goto out_unlock; } - tv_nexus = kzalloc_obj(struct scsiback_nexus, GFP_KERNEL); + tv_nexus = kzalloc_obj(struct scsiback_nexus); if (!tv_nexus) { ret = -ENOMEM; goto out_unlock; @@ -1758,7 +1758,7 @@ scsiback_make_tpg(struct se_wwn *wwn, const char *name) if (ret) return ERR_PTR(ret); - tpg = kzalloc_obj(struct scsiback_tpg, GFP_KERNEL); + tpg = kzalloc_obj(struct scsiback_tpg); if (!tpg) return ERR_PTR(-ENOMEM); diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 61739961838c..0ab1329e79de 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -535,11 +535,11 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, if (nr_grefs > XENBUS_MAX_RING_GRANTS) return -EINVAL; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; - info->node = kzalloc_obj(*info->node, GFP_KERNEL); + info->node = kzalloc_obj(*info->node); if (!info->node) err = -ENOMEM; else diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index 7b37d80b82ed..417631350eb0 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c @@ -242,7 +242,7 @@ static struct watch_adapter *alloc_watch_adapter(const char *path, { struct watch_adapter *watch; - watch = kzalloc_obj(*watch, GFP_KERNEL); + watch = kzalloc_obj(*watch); if (watch == NULL) goto out_fail; @@ -454,7 +454,7 @@ static int xenbus_write_transaction(unsigned msg_type, } *msg = (void *)u->u.buffer; if (msg_type == XS_TRANSACTION_START) { - trans = kzalloc_obj(*trans, GFP_KERNEL); + trans = kzalloc_obj(*trans); if (!trans) { rc = -ENOMEM; goto out; @@ -655,7 +655,7 @@ static int xenbus_file_open(struct inode *inode, struct file *filp) stream_open(inode, filp); - u = kzalloc_obj(*u, GFP_KERNEL); + u = kzalloc_obj(*u); if (u == NULL) return -ENOMEM; diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c index b40ec40eb9a2..8efd7b55223f 100644 --- a/drivers/xen/xlate_mmu.c +++ b/drivers/xen/xlate_mmu.c @@ -223,11 +223,11 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt, BUG_ON(nr_grant_frames == 0); nr_pages = DIV_ROUND_UP(nr_grant_frames, XEN_PFN_PER_PAGE); - pages = kzalloc_objs(pages[0], nr_pages, GFP_KERNEL); + pages = kzalloc_objs(pages[0], nr_pages); if (!pages) return -ENOMEM; - pfns = kzalloc_objs(pfns[0], nr_grant_frames, GFP_KERNEL); + pfns = kzalloc_objs(pfns[0], nr_grant_frames); if (!pfns) { kfree(pages); return -ENOMEM; diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index b9872016deae..0a1c4f7cb001 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -90,7 +90,7 @@ static int v9fs_get_tree(struct fs_context *fc) p9_debug(P9_DEBUG_VFS, "\n"); - v9ses = kzalloc_obj(struct v9fs_session_info, GFP_KERNEL); + v9ses = kzalloc_obj(struct v9fs_session_info); if (!v9ses) return -ENOMEM; @@ -308,7 +308,7 @@ static int v9fs_init_fs_context(struct fs_context *fc) { struct v9fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 366fb93c7b38..493500f37cb9 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -108,7 +108,7 @@ int adfs_dir_read_buffers(struct super_block *sb, u32 indaddr, if (dir->bhs != dir->bh) return -EINVAL; - bhs = kzalloc_objs(*bhs, num, GFP_KERNEL); + bhs = kzalloc_objs(*bhs, num); if (!bhs) return -ENOMEM; diff --git a/fs/adfs/map.c b/fs/adfs/map.c index 9e24e212b3e1..9d535a2ca2d1 100644 --- a/fs/adfs/map.c +++ b/fs/adfs/map.c @@ -373,7 +373,7 @@ struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_discrecor ((nzones > 1) ? ADFS_DR_SIZE_BITS : 0); map_addr = signed_asl(map_addr, asb->s_map2blk); - dm = kmalloc_objs(*dm, nzones, GFP_KERNEL); + dm = kmalloc_objs(*dm, nzones); if (dm == NULL) { adfs_error(sb, "not enough memory"); return ERR_PTR(-ENOMEM); diff --git a/fs/adfs/super.c b/fs/adfs/super.c index a8e73e980abb..2c5b2076acf9 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -437,7 +437,7 @@ static int adfs_init_fs_context(struct fs_context *fc) { struct adfs_sb_info *asb; - asb = kzalloc_obj(struct adfs_sb_info, GFP_KERNEL); + asb = kzalloc_obj(struct adfs_sb_info); if (!asb) return -ENOMEM; diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 39b6ddc4e4b1..5c8d83387a39 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c @@ -36,7 +36,7 @@ static int affs_dir_open(struct inode *inode, struct file *file) { struct affs_dir_data *data; - data = kzalloc_obj(struct affs_dir_data, GFP_KERNEL); + data = kzalloc_obj(struct affs_dir_data); if (!data) return -ENOMEM; file->private_data = data; diff --git a/fs/affs/super.c b/fs/affs/super.c index 1a2f72fea1ab..8451647f3fea 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -327,7 +327,7 @@ static int affs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_time_min = sys_tz.tz_minuteswest * 60 + AFFS_EPOCH_DELTA; sb->s_time_max = 86400LL * U32_MAX + 86400 + sb->s_time_min; - sbi = kzalloc_obj(struct affs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct affs_sb_info); if (!sbi) return -ENOMEM; @@ -615,7 +615,7 @@ static int affs_init_fs_context(struct fs_context *fc) { struct affs_context *ctx; - ctx = kzalloc_obj(struct affs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct affs_context); if (!ctx) return -ENOMEM; diff --git a/fs/afs/cell.c b/fs/afs/cell.c index 4331bf8e1dbd..9738684dbdd2 100644 --- a/fs/afs/cell.c +++ b/fs/afs/cell.c @@ -134,7 +134,7 @@ static struct afs_cell *afs_alloc_cell(struct afs_net *net, _enter("%*.*s,%s", namelen, namelen, name, addresses); - cell = kzalloc_obj(struct afs_cell, GFP_KERNEL); + cell = kzalloc_obj(struct afs_cell); if (!cell) { _leave(" = -ENOMEM"); return ERR_PTR(-ENOMEM); diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index a32e7c2864d2..322a80b43f32 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c @@ -339,7 +339,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc_obj(struct afs_uuid, GFP_KERNEL); + call->request = kmalloc_obj(struct afs_uuid); if (!call->request) return -ENOMEM; @@ -456,7 +456,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc_obj(struct afs_uuid, GFP_KERNEL); + call->request = kmalloc_obj(struct afs_uuid); if (!call->request) return -ENOMEM; diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 6f7380f25365..e778a575e1ca 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -785,7 +785,7 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry) _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry); - cookie = kzalloc_obj(struct afs_lookup_cookie, GFP_KERNEL); + cookie = kzalloc_obj(struct afs_lookup_cookie); if (!cookie) return ERR_PTR(-ENOMEM); @@ -2094,7 +2094,7 @@ static int afs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto error; ret = -ENOMEM; - op->more_files = kvzalloc_objs(struct afs_vnode_param, 2, GFP_KERNEL); + op->more_files = kvzalloc_objs(struct afs_vnode_param, 2); if (!op->more_files) goto error; diff --git a/fs/afs/dir_silly.c b/fs/afs/dir_silly.c index f77bed45e808..a748fd133faf 100644 --- a/fs/afs/dir_silly.c +++ b/fs/afs/dir_silly.c @@ -69,7 +69,7 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode if (IS_ERR(op)) return PTR_ERR(op); - op->more_files = kvzalloc_objs(struct afs_vnode_param, 2, GFP_KERNEL); + op->more_files = kvzalloc_objs(struct afs_vnode_param, 2); if (!op->more_files) { afs_put_operation(op); return -ENOMEM; diff --git a/fs/afs/file.c b/fs/afs/file.c index 5c429a746d76..f609366fd2ac 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -86,7 +86,7 @@ int afs_cache_wb_key(struct afs_vnode *vnode, struct afs_file *af) { struct afs_wb_key *wbk, *p; - wbk = kzalloc_obj(struct afs_wb_key, GFP_KERNEL); + wbk = kzalloc_obj(struct afs_wb_key); if (!wbk) return -ENOMEM; refcount_set(&wbk->usage, 2); @@ -130,7 +130,7 @@ int afs_open(struct inode *inode, struct file *file) goto error; } - af = kzalloc_obj(*af, GFP_KERNEL); + af = kzalloc_obj(*af); if (!af) { ret = -ENOMEM; goto error_key; diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 0ffd19f5279d..c0dbbc6d3716 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -21,7 +21,7 @@ struct afs_operation *afs_alloc_operation(struct key *key, struct afs_volume *vo _enter(""); - op = kzalloc_obj(*op, GFP_KERNEL); + op = kzalloc_obj(*op); if (!op) return ERR_PTR(-ENOMEM); diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c index 0100ce4c62a0..a91ad1938d07 100644 --- a/fs/afs/fs_probe.c +++ b/fs/afs/fs_probe.c @@ -244,7 +244,7 @@ int afs_fs_probe_fileserver(struct afs_net *net, struct afs_server *server, _enter("%pU", &server->uuid); - estate = kzalloc_obj(*estate, GFP_KERNEL); + estate = kzalloc_obj(*estate); if (!estate) return -ENOMEM; diff --git a/fs/afs/main.c b/fs/afs/main.c index 7e09bf7aa03b..7a883c59976f 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -93,7 +93,7 @@ static int __net_init afs_net_init(struct net *net_ns) atomic_set(&net->servers_outstanding, 1); ret = -ENOMEM; - sysnames = kzalloc_obj(*sysnames, GFP_KERNEL); + sysnames = kzalloc_obj(*sysnames); if (!sysnames) goto error_sysnames; sysnames->subs[0] = (char *)&afs_init_sysname; diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 52e8195ef2b8..a9cc5cdb4ca2 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -572,7 +572,7 @@ static int afs_proc_sysname_write(struct file *file, char *buf, size_t size) char *s, *p, *sub; int ret, len; - sysnames = kzalloc_obj(*sysnames, GFP_KERNEL); + sysnames = kzalloc_obj(*sysnames); if (!sysnames) return -ENOMEM; refcount_set(&sysnames->usage, 1); diff --git a/fs/afs/server.c b/fs/afs/server.c index 8777c566d12d..0fe162ea2a36 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c @@ -117,7 +117,7 @@ static struct afs_server *afs_alloc_server(struct afs_cell *cell, const uuid_t * _enter(""); - server = kzalloc_obj(struct afs_server, GFP_KERNEL); + server = kzalloc_obj(struct afs_server); if (!server) return NULL; diff --git a/fs/afs/super.c b/fs/afs/super.c index 2b567fe5b4cb..942f3e9800d7 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -502,7 +502,7 @@ static struct afs_super_info *afs_alloc_sbi(struct fs_context *fc) struct afs_fs_context *ctx = fc->fs_private; struct afs_super_info *as; - as = kzalloc_obj(struct afs_super_info, GFP_KERNEL); + as = kzalloc_obj(struct afs_super_info); if (as) { as->net_ns = get_net(fc->net_ns); as->flock_mode = ctx->flock_mode; @@ -623,7 +623,7 @@ static int afs_init_fs_context(struct fs_context *fc) struct afs_fs_context *ctx; struct afs_cell *cell; - ctx = kzalloc_obj(struct afs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct afs_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c index 05abd50e4057..a40b43464cfa 100644 --- a/fs/afs/vlclient.c +++ b/fs/afs/vlclient.c @@ -122,7 +122,7 @@ struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc, padsz = (4 - (volnamesz & 3)) & 3; reqsz = 8 + volnamesz + padsz; - entry = kzalloc_obj(struct afs_vldb_entry, GFP_KERNEL); + entry = kzalloc_obj(struct afs_vldb_entry); if (!entry) return ERR_PTR(-ENOMEM); diff --git a/fs/afs/volume.c b/fs/afs/volume.c index 260df046143a..9ae5c8ad2e04 100644 --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -81,7 +81,7 @@ static struct afs_volume *afs_alloc_volume(struct afs_fs_context *params, struct afs_volume *volume; int ret = -ENOMEM, i; - volume = kzalloc_obj(struct afs_volume, GFP_KERNEL); + volume = kzalloc_obj(struct afs_volume); if (!volume) goto error_0; diff --git a/fs/afs/xattr.c b/fs/afs/xattr.c index 2daf23af01e5..af9398d48e39 100644 --- a/fs/afs/xattr.c +++ b/fs/afs/xattr.c @@ -157,7 +157,7 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, else return -EOPNOTSUPP; - yacl = kzalloc_obj(struct yfs_acl, GFP_KERNEL); + yacl = kzalloc_obj(struct yfs_acl); if (!yacl) goto error; diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index 5134a042044c..c53dc551053b 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -13,7 +13,7 @@ struct autofs_info *autofs_new_ino(struct autofs_sb_info *sbi) { struct autofs_info *ino; - ino = kzalloc_obj(*ino, GFP_KERNEL); + ino = kzalloc_obj(*ino); if (ino) { INIT_LIST_HEAD(&ino->active); INIT_LIST_HEAD(&ino->expiring); @@ -242,7 +242,7 @@ static struct autofs_sb_info *autofs_alloc_sbi(void) { struct autofs_sb_info *sbi; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return NULL; @@ -405,7 +405,7 @@ int autofs_init_fs_context(struct fs_context *fc) struct autofs_fs_context *ctx; struct autofs_sb_info *sbi; - ctx = kzalloc_obj(struct autofs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct autofs_fs_context); if (!ctx) goto nomem; diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c index 21ecd0bbc0ca..d46241342dfc 100644 --- a/fs/autofs/waitq.c +++ b/fs/autofs/waitq.c @@ -376,7 +376,7 @@ int autofs_wait(struct autofs_sb_info *sbi, if (!wq) { /* Create a new wait queue */ - wq = kmalloc_obj(struct autofs_wait_queue, GFP_KERNEL); + wq = kmalloc_obj(struct autofs_wait_queue); if (!wq) { kfree(name); mutex_unlock(&sbi->wq_mutex); diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index df54c52d2f19..cecbc92f959a 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -790,7 +790,7 @@ befs_fill_super(struct super_block *sb, struct fs_context *fc) struct befs_mount_options *parsed_opts = fc->fs_private; int silent = fc->sb_flags & SB_SILENT; - sb->s_fs_info = kzalloc_obj(*befs_sb, GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(*befs_sb); if (sb->s_fs_info == NULL) goto unacquire_none; @@ -956,7 +956,7 @@ static int befs_init_fs_context(struct fs_context *fc) { struct befs_mount_options *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 6ed07d892e3d..9da02f5cb6cd 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -334,7 +334,7 @@ static int bfs_fill_super(struct super_block *s, struct fs_context *fc) unsigned long i_sblock, i_eblock, i_eoff, s_size; int silent = fc->sb_flags & SB_SILENT; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; mutex_init(&info->bfs_lock); diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 6ea9681cab33..49a196721cc7 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -916,7 +916,7 @@ static int load_elf_binary(struct linux_binprm *bprm) */ would_dump(bprm, interpreter); - interp_elf_ex = kmalloc_obj(*interp_elf_ex, GFP_KERNEL); + interp_elf_ex = kmalloc_obj(*interp_elf_ex); if (!interp_elf_ex) { retval = -ENOMEM; goto out_free_file; @@ -1798,7 +1798,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, fill_note(&t->notes[0], PRSTATUS, sizeof(t->prstatus), &t->prstatus); info->size += notesize(&t->notes[0]); - fpu = kzalloc_obj(elf_fpregset_t, GFP_KERNEL); + fpu = kzalloc_obj(elf_fpregset_t); if (!fpu || !elf_core_copy_task_fpregs(p, fpu)) { kfree(fpu); return 1; @@ -1824,7 +1824,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, u16 machine; u32 flags; - psinfo = kmalloc_obj(*psinfo, GFP_KERNEL); + psinfo = kmalloc_obj(*psinfo); if (!psinfo) return 0; fill_note(&info->psinfo, PRPSINFO, sizeof(*psinfo), psinfo); @@ -2036,7 +2036,7 @@ static int elf_core_dump(struct coredump_params *cprm) /* For cell spufs and x86 xstate */ sz += elf_coredump_extra_notes_size(); - phdr4note = kmalloc_obj(*phdr4note, GFP_KERNEL); + phdr4note = kmalloc_obj(*phdr4note); if (!phdr4note) goto end_coredump; @@ -2051,7 +2051,7 @@ static int elf_core_dump(struct coredump_params *cprm) e_shoff = offset; if (e_phnum == PN_XNUM) { - shdr4extnum = kmalloc_obj(*shdr4extnum, GFP_KERNEL); + shdr4extnum = kmalloc_obj(*shdr4extnum); if (!shdr4extnum) goto end_coredump; fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index cee0871b0164..526e048e2956 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1391,7 +1391,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ struct elf_thread_status *t; int i, ret; - t = kzalloc_obj(struct elf_thread_status, GFP_KERNEL); + t = kzalloc_obj(struct elf_thread_status); if (!t) return t; @@ -1486,10 +1486,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) struct elf_thread_status *tmp; /* alloc memory for large data structures: too large to be on stack */ - elf = kmalloc_obj(*elf, GFP_KERNEL); + elf = kmalloc_obj(*elf); if (!elf) goto end_coredump; - psinfo = kmalloc_obj(*psinfo, GFP_KERNEL); + psinfo = kmalloc_obj(*psinfo); if (!psinfo) goto end_coredump; @@ -1547,7 +1547,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) offset += segs * sizeof(struct elf_phdr); /* Program headers */ /* Write notes phdr entry */ - phdr4note = kmalloc_obj(*phdr4note, GFP_KERNEL); + phdr4note = kmalloc_obj(*phdr4note); if (!phdr4note) goto end_coredump; @@ -1562,7 +1562,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) e_shoff = offset; if (e_phnum == PN_XNUM) { - shdr4extnum = kmalloc_obj(*shdr4extnum, GFP_KERNEL); + shdr4extnum = kmalloc_obj(*shdr4extnum); if (!shdr4extnum) goto end_coredump; fill_extnum_info(elf, shdr4extnum, e_shoff, segs); diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 4a15e09bc398..b3d8fd70e8b1 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -961,7 +961,7 @@ static int bm_fill_super(struct super_block *sb, struct fs_context *fc) * create their own separate binfmt_misc mounts we should * consider turning this into a kmem cache. */ - misc = kzalloc_obj(struct binfmt_misc, GFP_KERNEL); + misc = kzalloc_obj(struct binfmt_misc); if (!misc) return -ENOMEM; diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index cce7b2610364..e6f33d09497f 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -85,7 +85,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, const char *name, unsigned int flags, int limit_active, int thresh) { - struct btrfs_workqueue *ret = kzalloc_obj(*ret, GFP_KERNEL); + struct btrfs_workqueue *ret = kzalloc_obj(*ret); if (!ret) return NULL; @@ -126,7 +126,7 @@ struct btrfs_workqueue *btrfs_alloc_ordered_workqueue( { struct btrfs_workqueue *ret; - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) return NULL; diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 78bf0cad1d2d..af98421e7922 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1805,7 +1805,7 @@ struct btrfs_backref_share_check_ctx *btrfs_alloc_backref_share_check_ctx(void) { struct btrfs_backref_share_check_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; @@ -2797,7 +2797,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, if (IS_ERR(fspath)) return ERR_CAST(fspath); - ifp = kmalloc_obj(*ifp, GFP_KERNEL); + ifp = kmalloc_obj(*ifp); if (!ifp) { kvfree(fspath); return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 7fde7698c331..790518a8c803 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -662,7 +662,7 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info) { struct heuristic_ws *ws; - ws = kzalloc_obj(*ws, GFP_KERNEL); + ws = kzalloc_obj(*ws); if (!ws) return ERR_PTR(-ENOMEM); @@ -670,11 +670,11 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info) if (!ws->sample) goto fail; - ws->bucket = kzalloc_objs(*ws->bucket, BUCKET_SIZE, GFP_KERNEL); + ws->bucket = kzalloc_objs(*ws->bucket, BUCKET_SIZE); if (!ws->bucket) goto fail; - ws->bucket_b = kzalloc_objs(*ws->bucket_b, BUCKET_SIZE, GFP_KERNEL); + ws->bucket_b = kzalloc_objs(*ws->bucket_b, BUCKET_SIZE); if (!ws->bucket_b) goto fail; @@ -734,7 +734,7 @@ static int alloc_workspace_manager(struct btrfs_fs_info *fs_info, struct list_head *workspace; ASSERT(fs_info->compr_wsm[type] == NULL); - gwsm = kzalloc_obj(*gwsm, GFP_KERNEL); + gwsm = kzalloc_obj(*gwsm); if (!gwsm) return -ENOMEM; diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index a9b0b596429d..8d05f1a58b7c 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -200,7 +200,7 @@ static inline struct extent_changeset *extent_changeset_alloc(void) { struct extent_changeset *ret; - ret = kmalloc_obj(*ret, GFP_KERNEL); + ret = kmalloc_obj(*ret); if (!ret) return NULL; diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 21cb45e23a6f..a4cb9d3cfc4e 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2842,7 +2842,7 @@ static int add_falloc_range(struct list_head *head, u64 start, u64 len) } } - range = kmalloc_obj(*range, GFP_KERNEL); + range = kmalloc_obj(*range); if (!range) return -ENOMEM; range->start = start; @@ -3572,7 +3572,7 @@ static loff_t find_desired_extent(struct file *file, loff_t offset, int whence) */ private = NULL; } else if (!private) { - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); /* * No worries if memory allocation failed. * The private structure is used only for speeding up multiple diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index da4be08d133e..f3ecbca47edb 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3967,7 +3967,7 @@ static int btrfs_init_file_extent_tree(struct btrfs_inode *inode) if (btrfs_is_free_space_inode(inode)) return 0; - inode->file_extent_tree = kmalloc_obj(struct extent_io_tree, GFP_KERNEL); + inode->file_extent_tree = kmalloc_obj(struct extent_io_tree); if (!inode->file_extent_tree) return -ENOMEM; @@ -6221,7 +6221,7 @@ static int btrfs_opendir(struct inode *inode, struct file *file) if (ret) return ret; - private = kzalloc_obj(struct btrfs_file_private, GFP_KERNEL); + private = kzalloc_obj(struct btrfs_file_private); if (!private) return -ENOMEM; private->last_index = last_index; diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index af8a9c698b07..2bd0178c95a2 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -726,7 +726,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir, return -ETXTBSY; } - pending_snapshot = kzalloc_obj(*pending_snapshot, GFP_KERNEL); + pending_snapshot = kzalloc_obj(*pending_snapshot); if (!pending_snapshot) return -ENOMEM; @@ -1958,7 +1958,7 @@ static int btrfs_ioctl_get_subvol_info(struct inode *inode, void __user *argp) if (!path) return -ENOMEM; - subvol_info = kzalloc_obj(*subvol_info, GFP_KERNEL); + subvol_info = kzalloc_obj(*subvol_info); if (!subvol_info) { btrfs_free_path(path); return -ENOMEM; @@ -3423,7 +3423,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) goto out_unlock; } - bctl = kzalloc_obj(*bctl, GFP_KERNEL); + bctl = kzalloc_obj(*bctl); if (!bctl) { ret = -ENOMEM; goto out_unlock; @@ -3604,7 +3604,7 @@ static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) } if (sa->assign) { - prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc); if (!prealloc) { ret = -ENOMEM; goto out; @@ -3924,7 +3924,7 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file, if (IS_ERR(args32)) return PTR_ERR(args32); - args64 = kmalloc_obj(*args64, GFP_KERNEL); + args64 = kmalloc_obj(*args64); if (!args64) { ret = -ENOMEM; goto out; @@ -4234,7 +4234,7 @@ static int _btrfs_ioctl_send(struct btrfs_root *root, void __user *argp, bool co ret = copy_from_user(&args32, argp, sizeof(args32)); if (ret) return -EFAULT; - arg = kzalloc_obj(*arg, GFP_KERNEL); + arg = kzalloc_obj(*arg); if (!arg) return -ENOMEM; arg->send_fd = args32.send_fd; diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index e37d986f26be..049a940ba449 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -88,7 +88,7 @@ struct list_head *lzo_alloc_workspace(struct btrfs_fs_info *fs_info) { struct workspace *workspace; - workspace = kzalloc_obj(*workspace, GFP_KERNEL); + workspace = kzalloc_obj(*workspace); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 6bd8739097d3..3cdd9755dc52 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -495,7 +495,7 @@ int btrfs_read_qgroup_config(struct btrfs_fs_info *fs_info) struct btrfs_qgroup *prealloc; struct btrfs_root *tree_root = fs_info->tree_root; - prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc); if (!prealloc) { ret = -ENOMEM; goto out; @@ -585,7 +585,7 @@ next1: goto next2; } - list = kzalloc_obj(*list, GFP_KERNEL); + list = kzalloc_obj(*list); if (!list) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index dfed8eaf938e..865dc30002cd 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -455,7 +455,7 @@ static noinline_for_stack struct scrub_ctx *scrub_setup_ctx( /* Since sctx has inline 128 stripes, it can go beyond 64K easily. Use * kvzalloc(). */ - sctx = kvzalloc_obj(*sctx, GFP_KERNEL); + sctx = kvzalloc_obj(*sctx); if (!sctx) goto nomem; refcount_set(&sctx->refs, 1); diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 23b0b06ac71c..7b2ea38b62dd 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -450,7 +450,7 @@ static struct fs_path *fs_path_alloc(void) { struct fs_path *p; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return NULL; init_path(p); @@ -2743,7 +2743,7 @@ static int cache_dir_utimes(struct send_ctx *sctx, u64 dir, u64 gen) return 0; /* Caching is optional, don't fail if we can't allocate memory. */ - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return send_utimes(sctx, dir, gen); @@ -2870,7 +2870,7 @@ static void cache_dir_created(struct send_ctx *sctx, u64 dir) int ret; /* Caching is optional, ignore any failures. */ - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return; @@ -2974,7 +2974,7 @@ static struct recorded_ref *recorded_ref_alloc(void) { struct recorded_ref *ref; - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) return NULL; RB_CLEAR_NODE(&ref->node); @@ -3083,7 +3083,7 @@ static struct orphan_dir_info *add_orphan_dir_info(struct send_ctx *sctx, return entry; } - odi = kmalloc_obj(*odi, GFP_KERNEL); + odi = kmalloc_obj(*odi); if (!odi) return ERR_PTR(-ENOMEM); odi->ino = dir_ino; @@ -3284,7 +3284,7 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino, bool orphanized) struct rb_node *parent = NULL; struct waiting_dir_move *entry, *dm; - dm = kmalloc_obj(*dm, GFP_KERNEL); + dm = kmalloc_obj(*dm); if (!dm) return -ENOMEM; dm->ino = ino; @@ -3352,7 +3352,7 @@ static int add_pending_dir_move(struct send_ctx *sctx, int exists = 0; int ret; - pm = kmalloc_obj(*pm, GFP_KERNEL); + pm = kmalloc_obj(*pm); if (!pm) return -ENOMEM; pm->parent_ino = parent_ino; @@ -8035,7 +8035,7 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen goto out; } - sctx = kzalloc_obj(struct send_ctx, GFP_KERNEL); + sctx = kzalloc_obj(struct send_ctx); if (!sctx) { ret = -ENOMEM; goto out; diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 3f9523563259..b4d26ca9220a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2054,7 +2054,7 @@ static int btrfs_get_tree_subvol(struct fs_context *fc) * of the fs_info (locks and such) to make cleanup easier if we find a * superblock with our given fs_devices later on at sget() time. */ - fs_info = kvzalloc_obj(struct btrfs_fs_info, GFP_KERNEL); + fs_info = kvzalloc_obj(struct btrfs_fs_info); if (!fs_info) return -ENOMEM; @@ -2173,7 +2173,7 @@ static int btrfs_init_fs_context(struct fs_context *fc) { struct btrfs_fs_context *ctx; - ctx = kzalloc_obj(struct btrfs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct btrfs_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index f62278f0c191..0d14570c8bc2 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -2597,7 +2597,7 @@ int btrfs_sysfs_add_qgroups(struct btrfs_fs_info *fs_info) if (fs_info->qgroups_kobj) return 0; - fs_info->qgroups_kobj = kzalloc_obj(struct kobject, GFP_KERNEL); + fs_info->qgroups_kobj = kzalloc_obj(struct kobject); if (!fs_info->qgroups_kobj) return -ENOMEM; diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index c5b1bc0f7f91..fa177070d2d0 100644 --- a/fs/btrfs/tests/btrfs-tests.c +++ b/fs/btrfs/tests/btrfs-tests.c @@ -98,7 +98,7 @@ struct btrfs_device *btrfs_alloc_dummy_device(struct btrfs_fs_info *fs_info) { struct btrfs_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); @@ -122,14 +122,14 @@ struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize) if (!fs_info) return fs_info; - fs_info->fs_devices = kzalloc_obj(struct btrfs_fs_devices, GFP_KERNEL); + fs_info->fs_devices = kzalloc_obj(struct btrfs_fs_devices); if (!fs_info->fs_devices) { kfree(fs_info); return NULL; } INIT_LIST_HEAD(&fs_info->fs_devices->devices); - fs_info->super_copy = kzalloc_obj(struct btrfs_super_block, GFP_KERNEL); + fs_info->super_copy = kzalloc_obj(struct btrfs_super_block); if (!fs_info->super_copy) { kfree(fs_info->fs_devices); kfree(fs_info); @@ -206,10 +206,10 @@ btrfs_alloc_dummy_block_group(struct btrfs_fs_info *fs_info, { struct btrfs_block_group *cache; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (!cache) return NULL; - cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl, GFP_KERNEL); + cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl); if (!cache->free_space_ctl) { kfree(cache); return NULL; diff --git a/fs/btrfs/tests/delayed-refs-tests.c b/fs/btrfs/tests/delayed-refs-tests.c index fdc183ebc6da..ccab45d849bb 100644 --- a/fs/btrfs/tests/delayed-refs-tests.c +++ b/fs/btrfs/tests/delayed-refs-tests.c @@ -985,7 +985,7 @@ int btrfs_test_delayed_refs(u32 sectorsize, u32 nodesize) test_std_err(TEST_ALLOC_FS_INFO); return -ENOMEM; } - transaction = kmalloc_obj(*transaction, GFP_KERNEL); + transaction = kmalloc_obj(*transaction); if (!transaction) { test_std_err(TEST_ALLOC_TRANSACTION); ret = -ENOMEM; diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 71ff7006ca6b..6fb0c4cd50ff 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -382,7 +382,7 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid) { struct btrfs_fs_devices *fs_devs; - fs_devs = kzalloc_obj(*fs_devs, GFP_KERNEL); + fs_devs = kzalloc_obj(*fs_devs); if (!fs_devs) return ERR_PTR(-ENOMEM); @@ -7202,7 +7202,7 @@ struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, if (WARN_ON(!devid && !fs_info)) return ERR_PTR(-EINVAL); - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 5a0913a31991..1b7544aa88a2 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -75,7 +75,7 @@ struct list_head *zlib_alloc_workspace(struct btrfs_fs_info *fs_info, unsigned i struct workspace *workspace; int workspacesize; - workspace = kzalloc_obj(*workspace, GFP_KERNEL); + workspace = kzalloc_obj(*workspace); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index fcdfb831b484..a27db827d87b 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -377,7 +377,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) if (device->zone_info) return 0; - zone_info = kzalloc_obj(*zone_info, GFP_KERNEL); + zone_info = kzalloc_obj(*zone_info); if (!zone_info) return -ENOMEM; diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c index a7a41dd320d9..6f076fa8f3f9 100644 --- a/fs/btrfs/zstd.c +++ b/fs/btrfs/zstd.c @@ -185,7 +185,7 @@ int zstd_alloc_workspace_manager(struct btrfs_fs_info *fs_info) struct list_head *ws; ASSERT(fs_info->compr_wsm[BTRFS_COMPRESS_ZSTD] == NULL); - zwsm = kzalloc_obj(*zwsm, GFP_KERNEL); + zwsm = kzalloc_obj(*zwsm); if (!zwsm) return -ENOMEM; zstd_calc_ws_mem_sizes(); @@ -373,7 +373,7 @@ struct list_head *zstd_alloc_workspace(struct btrfs_fs_info *fs_info, int level) const u32 blocksize = fs_info->sectorsize; struct workspace *workspace; - workspace = kzalloc_obj(*workspace, GFP_KERNEL); + workspace = kzalloc_obj(*workspace); if (!workspace) return ERR_PTR(-ENOMEM); diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c index 99795864bcb3..4117b145ac94 100644 --- a/fs/cachefiles/daemon.c +++ b/fs/cachefiles/daemon.c @@ -102,7 +102,7 @@ static int cachefiles_daemon_open(struct inode *inode, struct file *file) return -EBUSY; /* allocate a cache record */ - cache = kzalloc_obj(struct cachefiles_cache, GFP_KERNEL); + cache = kzalloc_obj(struct cachefiles_cache); if (!cache) { cachefiles_open = 0; return -ENOMEM; diff --git a/fs/cachefiles/io.c b/fs/cachefiles/io.c index 7b9d547ecee6..eaf47851c65f 100644 --- a/fs/cachefiles/io.c +++ b/fs/cachefiles/io.c @@ -132,7 +132,7 @@ static int cachefiles_read(struct netfs_cache_resources *cres, } ret = -ENOMEM; - ki = kzalloc_obj(struct cachefiles_kiocb, GFP_KERNEL); + ki = kzalloc_obj(struct cachefiles_kiocb); if (!ki) goto presubmission_error; @@ -298,7 +298,7 @@ int __cachefiles_write(struct cachefiles_object *object, file, file_inode(file)->i_ino, start_pos, len, i_size_read(file_inode(file))); - ki = kzalloc_obj(struct cachefiles_kiocb, GFP_KERNEL); + ki = kzalloc_obj(struct cachefiles_kiocb); if (!ki) { if (term_func) term_func(term_func_priv, -ENOMEM); diff --git a/fs/cachefiles/volume.c b/fs/cachefiles/volume.c index 655de0cef530..6c0da61362ee 100644 --- a/fs/cachefiles/volume.c +++ b/fs/cachefiles/volume.c @@ -28,7 +28,7 @@ void cachefiles_acquire_volume(struct fscache_volume *vcookie) _enter(""); - volume = kzalloc_obj(struct cachefiles_volume, GFP_KERNEL); + volume = kzalloc_obj(struct cachefiles_volume); if (!volume) return; volume->vcookie = vcookie; diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 5d7c2ffae8fa..d51454e995a8 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2395,7 +2395,7 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode) mutex_lock(&mdsc->mutex); max_sessions = mdsc->max_sessions; - sessions = kzalloc_objs(s, max_sessions, GFP_KERNEL); + sessions = kzalloc_objs(s, max_sessions); if (!sessions) { mutex_unlock(&mdsc->mutex); err = -ENOMEM; diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c index 643c8ba28ae7..f3de43ccb470 100644 --- a/fs/ceph/crypto.c +++ b/fs/ceph/crypto.c @@ -50,7 +50,7 @@ static int ceph_crypt_set_context(struct inode *inode, const void *ctx, if (len > FSCRYPT_SET_CONTEXT_MAX_SIZE) return -EINVAL; - cfa = kzalloc_obj(*cfa, GFP_KERNEL); + cfa = kzalloc_obj(*cfa); if (!cfa) return -ENOMEM; @@ -112,7 +112,7 @@ int ceph_fscrypt_prepare_context(struct inode *dir, struct inode *inode, if (!encrypted) return 0; - as->fscrypt_auth = kzalloc_obj(*as->fscrypt_auth, GFP_KERNEL); + as->fscrypt_auth = kzalloc_obj(*as->fscrypt_auth); if (!as->fscrypt_auth) return -ENOMEM; diff --git a/fs/ceph/file.c b/fs/ceph/file.c index fdbf4aeaa408..66bbf6d517a9 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1572,7 +1572,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, */ if (pos == iocb->ki_pos && !is_sync_kiocb(iocb) && (len == count || pos + count <= i_size_read(inode))) { - aio_req = kzalloc_obj(*aio_req, GFP_KERNEL); + aio_req = kzalloc_obj(*aio_req); if (aio_req) { aio_req->iocb = iocb; aio_req->write = write; diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c index 514da29469b8..4dc9426643e8 100644 --- a/fs/ceph/quota.c +++ b/fs/ceph/quota.c @@ -103,7 +103,7 @@ find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino) } if (!qri || (qri->ino != ino)) { /* Not found, create a new one and insert it */ - qri = kmalloc_obj(*qri, GFP_KERNEL); + qri = kmalloc_obj(*qri); if (qri) { qri->ino = ino; qri->inode = NULL; diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 57320e830eda..2aed6b3359b6 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -809,7 +809,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, struct ceph_fs_client *fsc; int err; - fsc = kzalloc_obj(*fsc, GFP_KERNEL); + fsc = kzalloc_obj(*fsc); if (!fsc) { err = -ENOMEM; goto fail; @@ -1429,7 +1429,7 @@ static int ceph_init_fs_context(struct fs_context *fc) struct ceph_parse_opts_ctx *pctx; struct ceph_mount_options *fsopt; - pctx = kzalloc_obj(*pctx, GFP_KERNEL); + pctx = kzalloc_obj(*pctx); if (!pctx) return -ENOMEM; @@ -1437,7 +1437,7 @@ static int ceph_init_fs_context(struct fs_context *fc) if (!pctx->copts) goto nomem; - pctx->opts = kzalloc_obj(*pctx->opts, GFP_KERNEL); + pctx->opts = kzalloc_obj(*pctx->opts); if (!pctx->opts) goto nomem; diff --git a/fs/char_dev.c b/fs/char_dev.c index 49b2641bbe03..00229e25c10f 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -115,7 +115,7 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor, return ERR_PTR(-EINVAL); } - cd = kzalloc_obj(struct char_device_struct, GFP_KERNEL); + cd = kzalloc_obj(struct char_device_struct); if (cd == NULL) return ERR_PTR(-ENOMEM); @@ -636,7 +636,7 @@ static struct kobj_type ktype_cdev_dynamic = { */ struct cdev *cdev_alloc(void) { - struct cdev *p = kzalloc_obj(struct cdev, GFP_KERNEL); + struct cdev *p = kzalloc_obj(struct cdev); if (p) { INIT_LIST_HEAD(&p->list); kobject_init(&p->kobj, &ktype_cdev_dynamic); diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 329cefb16fb5..c64b8cd81568 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -362,7 +362,7 @@ static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx) cii = ITOC(file_inode(coda_file)); - vdir = kmalloc_obj(*vdir, GFP_KERNEL); + vdir = kmalloc_obj(*vdir); if (!vdir) return -ENOMEM; if (!dir_emit_dots(coda_file, ctx)) diff --git a/fs/coda/file.c b/fs/coda/file.c index a40ba8d0b14b..6ca8bfcb58f2 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -175,7 +175,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma) if (ret) return ret; - cvm_ops = kmalloc_obj(struct coda_vm_ops, GFP_KERNEL); + cvm_ops = kmalloc_obj(struct coda_vm_ops); if (!cvm_ops) return -ENOMEM; @@ -231,7 +231,7 @@ int coda_open(struct inode *coda_inode, struct file *coda_file) unsigned short coda_flags = coda_flags_to_cflags(flags); struct coda_file_info *cfi; - cfi = kmalloc_obj(struct coda_file_info, GFP_KERNEL); + cfi = kmalloc_obj(struct coda_file_info); if (!cfi) return -ENOMEM; diff --git a/fs/coda/inode.c b/fs/coda/inode.c index d95ae651f528..ad1654f3adf8 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -381,7 +381,7 @@ static int coda_init_fs_context(struct fs_context *fc) { struct coda_fs_context *ctx; - ctx = kzalloc_obj(struct coda_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct coda_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index 0abde29b4f47..3438119b5dcf 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c @@ -724,7 +724,7 @@ static int coda_upcall(struct venus_comm *vcp, } /* Format the request message. */ - req = kmalloc_obj(struct upc_req, GFP_KERNEL); + req = kmalloc_obj(struct upc_req); if (!req) { error = -ENOMEM; goto exit; @@ -788,10 +788,10 @@ static int coda_upcall(struct venus_comm *vcp, } error = -ENOMEM; - sig_req = kmalloc_obj(struct upc_req, GFP_KERNEL); + sig_req = kmalloc_obj(struct upc_req); if (!sig_req) goto exit; - sig_inputArgs = kvzalloc_obj(*sig_inputArgs, GFP_KERNEL); + sig_inputArgs = kvzalloc_obj(*sig_inputArgs); if (!sig_inputArgs) { kfree(sig_req); goto exit; diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index f437b1ab3b68..362b6ff9b908 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -159,7 +159,7 @@ static struct configfs_fragment *new_fragment(void) { struct configfs_fragment *p; - p = kmalloc_obj(struct configfs_fragment, GFP_KERNEL); + p = kmalloc_obj(struct configfs_fragment); if (p) { atomic_set(&p->frag_count, 1); init_rwsem(&p->frag_sem); @@ -1847,7 +1847,7 @@ configfs_register_default_group(struct config_group *parent_group, int ret; struct config_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return ERR_PTR(-ENOMEM); config_group_init_type_name(group, name, item_type); diff --git a/fs/configfs/file.c b/fs/configfs/file.c index a83d1981e96f..ef8c3cd10cc6 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c @@ -296,7 +296,7 @@ static int __configfs_open_file(struct inode *inode, struct file *file, int type int error; error = -ENOMEM; - buffer = kzalloc_obj(struct configfs_buffer, GFP_KERNEL); + buffer = kzalloc_obj(struct configfs_buffer); if (!buffer) goto out; diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index e7d8500fee7d..bc507b720a01 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -47,7 +47,7 @@ int configfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, sd_iattr = sd->s_iattr; if (!sd_iattr) { /* setting attributes for the first time, allocate now */ - sd_iattr = kzalloc_obj(struct iattr, GFP_KERNEL); + sd_iattr = kzalloc_obj(struct iattr); if (!sd_iattr) return -ENOMEM; /* assign default attributes */ diff --git a/fs/coredump.c b/fs/coredump.c index c5b81cacbabb..55b700517e9f 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -262,7 +262,7 @@ static bool coredump_parse(struct core_name *cn, struct coredump_params *cprm, switch (cn->core_type) { case COREDUMP_PIPE: { int argvs = sizeof(core_pattern) / 2; - (*argv) = kmalloc_objs(**argv, argvs, GFP_KERNEL); + (*argv) = kmalloc_objs(**argv, argvs); if (!(*argv)) return false; (*argv)[(*argc)++] = 0; diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 10403cb81182..e0ba9cd640dc 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -619,7 +619,7 @@ static int cramfs_blkdev_fill_super(struct super_block *sb, struct fs_context *f struct cramfs_super super; int i, err; - sbi = kzalloc_obj(struct cramfs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct cramfs_sb_info); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; @@ -640,7 +640,7 @@ static int cramfs_mtd_fill_super(struct super_block *sb, struct fs_context *fc) struct cramfs_super super; int err; - sbi = kzalloc_obj(struct cramfs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct cramfs_sb_info); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c index e286d9fd17f3..c0852b920dbc 100644 --- a/fs/crypto/inline_crypt.c +++ b/fs/crypto/inline_crypt.c @@ -32,7 +32,7 @@ static struct block_device **fscrypt_get_devices(struct super_block *sb, if (devs) return devs; } - devs = kmalloc_obj(*devs, GFP_KERNEL); + devs = kmalloc_obj(*devs); if (!devs) return ERR_PTR(-ENOMEM); devs[0] = sb->s_bdev; @@ -169,7 +169,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key, unsigned int i; int err; - blk_key = kmalloc_obj(*blk_key, GFP_KERNEL); + blk_key = kmalloc_obj(*blk_key); if (!blk_key) return -ENOMEM; diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c index 855314a28b18..9ec6e5ef0947 100644 --- a/fs/crypto/keyring.c +++ b/fs/crypto/keyring.c @@ -209,7 +209,7 @@ static int allocate_filesystem_keyring(struct super_block *sb) if (sb->s_master_keys) return 0; - keyring = kzalloc_obj(*keyring, GFP_KERNEL); + keyring = kzalloc_obj(*keyring); if (!keyring) return -ENOMEM; spin_lock_init(&keyring->lock); @@ -434,7 +434,7 @@ static int add_new_master_key(struct super_block *sb, struct fscrypt_master_key *mk; int err; - mk = kzalloc_obj(*mk, GFP_KERNEL); + mk = kzalloc_obj(*mk); if (!mk) return -ENOMEM; diff --git a/fs/crypto/keysetup_v1.c b/fs/crypto/keysetup_v1.c index 93fc2ab7ee97..3d673c36b678 100644 --- a/fs/crypto/keysetup_v1.c +++ b/fs/crypto/keysetup_v1.c @@ -221,7 +221,7 @@ fscrypt_get_direct_key(const struct fscrypt_inode_info *ci, const u8 *raw_key) return dk; /* Nope, allocate one. */ - dk = kzalloc_obj(*dk, GFP_KERNEL); + dk = kzalloc_obj(*dk); if (!dk) return ERR_PTR(-ENOMEM); dk->dk_sb = ci->ci_inode->i_sb; diff --git a/fs/crypto/policy.c b/fs/crypto/policy.c index 49309e9da4ea..9915e39362db 100644 --- a/fs/crypto/policy.c +++ b/fs/crypto/policy.c @@ -813,7 +813,7 @@ int fscrypt_parse_test_dummy_encryption(const struct fs_parameter *param, if (param->type == fs_value_is_string && *param->string) arg = param->string; - policy = kzalloc_obj(*policy, GFP_KERNEL); + policy = kzalloc_obj(*policy); if (!policy) return -ENOMEM; diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 70b8dcd3599d..3376ab6a519d 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -82,7 +82,7 @@ static int __debugfs_file_get(struct dentry *dentry, enum dbgfs_get_mode mode) if (WARN_ON(mode == DBGFS_GET_ALREADY)) return -EINVAL; - fsd = kmalloc_obj(*fsd, GFP_KERNEL); + fsd = kmalloc_obj(*fsd); if (!fsd) return -ENOMEM; diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index a9e161f6fb7d..4598142355b9 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -310,7 +310,7 @@ static int debugfs_init_fs_context(struct fs_context *fc) { struct debugfs_fs_info *fsi; - fsi = kzalloc_obj(struct debugfs_fs_info, GFP_KERNEL); + fsi = kzalloc_obj(struct debugfs_fs_info); if (!fsi) return -ENOMEM; diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 93af356408ee..9844dcf354ee 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -420,7 +420,7 @@ static int devpts_init_fs_context(struct fs_context *fc) { struct pts_fs_info *fsi; - fsi = kzalloc_obj(struct pts_fs_info, GFP_KERNEL); + fsi = kzalloc_obj(struct pts_fs_info); if (!fsi) return -ENOMEM; diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 0f80fda98227..53cd33293042 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -602,7 +602,7 @@ static void drop_node(struct config_group *g, struct config_item *i) struct dlm_node *nd = config_item_to_node(i); struct dlm_member_gone *mb_gone; - mb_gone = kzalloc_obj(*mb_gone, GFP_KERNEL); + mb_gone = kzalloc_obj(*mb_gone); if (!mb_gone) return; diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 3b6e6a29eab8..c381e1028446 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -5050,7 +5050,7 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls) int wait_type, local_unlock_result, local_cancel_result; int dir_nodeid; - ms_local = kmalloc_obj(*ms_local, GFP_KERNEL); + ms_local = kmalloc_obj(*ms_local); if (!ms_local) return; diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 812d889f1ce5..f84233a0fe4a 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -511,7 +511,7 @@ void dlm_lsop_recover_done(struct dlm_ls *ls) return; num = ls->ls_num_nodes; - slots = kzalloc_objs(*slots, num, GFP_KERNEL); + slots = kzalloc_objs(*slots, num); if (!slots) return; diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 6ada136f3f3f..3b59346d68c5 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -1793,7 +1793,7 @@ int ecryptfs_encrypt_and_encode_filename( & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) { struct ecryptfs_filename *filename; - filename = kzalloc_obj(*filename, GFP_KERNEL); + filename = kzalloc_obj(*filename); if (!filename) { rc = -ENOMEM; goto out; diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 04b6d296a3fa..e8494903bb42 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -623,7 +623,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, struct key *auth_tok_key = NULL; int rc = 0; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; @@ -860,7 +860,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, (*packet_size) = 0; (*filename_size) = 0; (*filename) = NULL; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index dcfa607fbf15..f4ab387eb4ed 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -610,7 +610,7 @@ static int ecryptfs_init_fs_context(struct fs_context *fc) struct ecryptfs_fs_context *ctx; struct ecryptfs_sb_info *sbi = NULL; - ctx = kzalloc_obj(struct ecryptfs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct ecryptfs_fs_context); if (!ctx) return -ENOMEM; sbi = kmem_cache_zalloc(ecryptfs_sb_info_cache, GFP_KERNEL); diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 6cf3052e9370..30c8e15d87b5 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c @@ -131,7 +131,7 @@ ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file) { int rc = 0; - (*daemon) = kzalloc_obj(**daemon, GFP_KERNEL); + (*daemon) = kzalloc_obj(**daemon); if (!(*daemon)) { rc = -ENOMEM; goto out; diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 14c2752831c8..1c5224cf183e 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -44,7 +44,7 @@ static int efivarfs_ops_notifier(struct notifier_block *nb, unsigned long event, static struct inode *efivarfs_alloc_inode(struct super_block *sb) { - struct efivar_entry *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct efivar_entry *entry = kzalloc_obj(*entry); if (!entry) return NULL; @@ -505,7 +505,7 @@ static int efivarfs_init_fs_context(struct fs_context *fc) if (!efivar_is_available()) return -EOPNOTSUPP; - sfi = kzalloc_obj(*sfi, GFP_KERNEL); + sfi = kzalloc_obj(*sfi); if (!sfi) return -ENOMEM; diff --git a/fs/efs/super.c b/fs/efs/super.c index 54252bccd6a3..11fea3bbce7c 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -243,7 +243,7 @@ static int efs_fill_super(struct super_block *s, struct fs_context *fc) struct buffer_head *bh; struct inode *root; - sb = kzalloc_obj(struct efs_sb_info, GFP_KERNEL); + sb = kzalloc_obj(struct efs_sb_info); if (!sb) return -ENOMEM; s->s_fs_info = sb; diff --git a/fs/erofs/decompressor_deflate.c b/fs/erofs/decompressor_deflate.c index 787eb8fc6262..6167af1ffeb9 100644 --- a/fs/erofs/decompressor_deflate.c +++ b/fs/erofs/decompressor_deflate.c @@ -71,7 +71,7 @@ static int z_erofs_load_deflate_config(struct super_block *sb, ++z_erofs_deflate_avail_strms) { struct z_erofs_deflate *strm; - strm = kzalloc_obj(*strm, GFP_KERNEL); + strm = kzalloc_obj(*strm); if (!strm) goto failed; /* XXX: in-kernel zlib cannot customize windowbits */ diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c index c1c908d7b6ef..f6692d0f2f04 100644 --- a/fs/erofs/decompressor_lzma.c +++ b/fs/erofs/decompressor_lzma.c @@ -54,7 +54,7 @@ static int __init z_erofs_lzma_init(void) z_erofs_lzma_nstrms = num_possible_cpus(); for (i = 0; i < z_erofs_lzma_nstrms; ++i) { - struct z_erofs_lzma *strm = kzalloc_obj(*strm, GFP_KERNEL); + struct z_erofs_lzma *strm = kzalloc_obj(*strm); if (!strm) { z_erofs_lzma_exit(); diff --git a/fs/erofs/decompressor_zstd.c b/fs/erofs/decompressor_zstd.c index 6da93f74431b..ab318a2400f9 100644 --- a/fs/erofs/decompressor_zstd.c +++ b/fs/erofs/decompressor_zstd.c @@ -59,7 +59,7 @@ static int __init z_erofs_zstd_init(void) ++z_erofs_zstd_avail_strms) { struct z_erofs_zstd *strm; - strm = kzalloc_obj(*strm, GFP_KERNEL); + strm = kzalloc_obj(*strm); if (!strm) { z_erofs_zstd_exit(); return -ENOMEM; diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 0a231063b341..685c68774379 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -70,7 +70,7 @@ static void erofs_fscache_req_put(struct erofs_fscache_rq *req) static struct erofs_fscache_rq *erofs_fscache_req_alloc(struct address_space *mapping, loff_t start, size_t len) { - struct erofs_fscache_rq *req = kzalloc_obj(*req, GFP_KERNEL); + struct erofs_fscache_rq *req = kzalloc_obj(*req); if (!req) return NULL; @@ -101,7 +101,7 @@ static void erofs_fscache_req_end_io(void *priv, ssize_t transferred_or_error) static struct erofs_fscache_io *erofs_fscache_req_io_alloc(struct erofs_fscache_rq *req) { - struct erofs_fscache_io *io = kzalloc_obj(*io, GFP_KERNEL); + struct erofs_fscache_io *io = kzalloc_obj(*io); if (!io) return NULL; @@ -417,7 +417,7 @@ static int erofs_fscache_init_domain(struct super_block *sb) struct erofs_domain *domain; struct erofs_sb_info *sbi = EROFS_SB(sb); - domain = kzalloc_obj(struct erofs_domain, GFP_KERNEL); + domain = kzalloc_obj(struct erofs_domain); if (!domain) return -ENOMEM; @@ -482,7 +482,7 @@ static struct erofs_fscache *erofs_fscache_acquire_cookie(struct super_block *sb struct inode *inode; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&ctx->node); diff --git a/fs/erofs/super.c b/fs/erofs/super.c index a333456c7d5d..d4995686ac6c 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -226,7 +226,7 @@ static int erofs_scan_devices(struct super_block *sb, } } else { for (id = 0; id < ondisk_extradevs; id++) { - dif = kzalloc_obj(*dif, GFP_KERNEL); + dif = kzalloc_obj(*dif); if (!dif) { err = -ENOMEM; break; @@ -495,7 +495,7 @@ static int erofs_fc_parse_param(struct fs_context *fc, return -EINVAL; break; case Opt_device: - dif = kzalloc_obj(*dif, GFP_KERNEL); + dif = kzalloc_obj(*dif); if (!dif) return -ENOMEM; dif->path = kstrdup(param->string, GFP_KERNEL); @@ -903,11 +903,11 @@ static int erofs_init_fs_context(struct fs_context *fc) { struct erofs_sb_info *sbi; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; - sbi->devs = kzalloc_obj(struct erofs_dev_context, GFP_KERNEL); + sbi->devs = kzalloc_obj(struct erofs_dev_context); if (!sbi->devs) { kfree(sbi); return -ENOMEM; diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index 5997a7ae19d9..211aa9336e5a 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -498,7 +498,7 @@ int erofs_xattr_prefixes_init(struct super_block *sb) if (!sbi->xattr_prefix_count) return 0; - pfs = kzalloc_objs(*pfs, sbi->xattr_prefix_count, GFP_KERNEL); + pfs = kzalloc_objs(*pfs, sbi->xattr_prefix_count); if (!pfs) return -ENOMEM; diff --git a/fs/erofs/zutil.c b/fs/erofs/zutil.c index 9a15088744f0..0facb0e77e33 100644 --- a/fs/erofs/zutil.c +++ b/fs/erofs/zutil.c @@ -79,7 +79,7 @@ int z_erofs_gbuf_growsize(unsigned int nrpages) for (i = 0; i < z_erofs_gbuf_count; ++i) { gbuf = &z_erofs_gbufpool[i]; - tmp_pages = kzalloc_objs(*tmp_pages, nrpages, GFP_KERNEL); + tmp_pages = kzalloc_objs(*tmp_pages, nrpages); if (!tmp_pages) goto out; @@ -131,7 +131,7 @@ int __init z_erofs_gbuf_init(void) /* The last (special) global buffer is the reserved buffer */ total += !!z_erofs_rsv_nrpages; - z_erofs_gbufpool = kzalloc_objs(*z_erofs_gbufpool, total, GFP_KERNEL); + z_erofs_gbufpool = kzalloc_objs(*z_erofs_gbufpool, total); if (!z_erofs_gbufpool) return -ENOMEM; diff --git a/fs/eventfd.c b/fs/eventfd.c index a0ea7f30c76f..9d33a02757d5 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -388,7 +388,7 @@ static int do_eventfd(unsigned int count, int flags) if (flags & ~EFD_FLAGS_SET) return -EINVAL; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 4d0c0ce43cb3..a8c278c50083 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1147,7 +1147,7 @@ static int ep_alloc(struct eventpoll **pep) { struct eventpoll *ep; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (unlikely(!ep)) return -ENOMEM; diff --git a/fs/exec.c b/fs/exec.c index c367e74cf103..9ea3a775d51e 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1402,7 +1402,7 @@ static struct linux_binprm *alloc_bprm(int fd, struct filename *filename, int fl if (IS_ERR(file)) return ERR_CAST(file); - bprm = kzalloc_obj(*bprm, GFP_KERNEL); + bprm = kzalloc_obj(*bprm); if (!bprm) { do_close_execat(file); return ERR_PTR(-ENOMEM); diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 42a232394afb..83396fd265cd 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -815,7 +815,7 @@ static int exfat_init_fs_context(struct fs_context *fc) { struct exfat_sb_info *sbi; - sbi = kzalloc_obj(struct exfat_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct exfat_sb_info); if (!sbi) return -ENOMEM; diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 2bac6dcb1792..007eee794bd1 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -419,7 +419,7 @@ void ext2_init_block_alloc_info(struct inode *inode) struct ext2_block_alloc_info *block_i; struct super_block *sb = inode->i_sb; - block_i = kmalloc_obj(*block_i, GFP_KERNEL); + block_i = kmalloc_obj(*block_i); if (block_i) { struct ext2_reserve_window_node *rsv = &block_i->rsv_window_node; diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 9bb4c63f5628..b20a6eb6822b 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -893,12 +893,12 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc) __le32 features; int err; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; sbi->s_blockgroup_lock = - kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock); if (!sbi->s_blockgroup_lock) { kfree(sbi); return -ENOMEM; @@ -1669,7 +1669,7 @@ static int ext2_init_fs_context(struct fs_context *fc) { struct ext2_fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c index 75179be4a488..3a31e3d718c9 100644 --- a/fs/ext4/block_validity.c +++ b/fs/ext4/block_validity.c @@ -217,7 +217,7 @@ int ext4_setup_system_zone(struct super_block *sb) ext4_group_t i; int ret; - system_blks = kzalloc_obj(*system_blks, GFP_KERNEL); + system_blks = kzalloc_obj(*system_blks); if (!system_blks) return -ENOMEM; diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index b285ce18b183..36dc53df0fb2 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -672,7 +672,7 @@ static int ext4_dir_open(struct inode *inode, struct file *file) { struct dir_private_info *info; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; file->private_data = info; diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c index 913103089799..7c4690eb7dad 100644 --- a/fs/ext4/extents-test.c +++ b/fs/ext4/extents-test.c @@ -229,7 +229,7 @@ static int extents_kunit_init(struct kunit *test) sb->s_blocksize = 4096; sb->s_blocksize_bits = 12; - sbi = kzalloc_obj(struct ext4_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct ext4_sb_info); if (sbi == NULL) return -ENOMEM; @@ -240,7 +240,7 @@ static int extents_kunit_init(struct kunit *test) sbi->s_extent_max_zeroout_kb = 32; /* setup the mock inode */ - k_ctx.k_ei = kzalloc_obj(struct ext4_inode_info, GFP_KERNEL); + k_ctx.k_ei = kzalloc_obj(struct ext4_inode_info); if (k_ctx.k_ei == NULL) return -ENOMEM; ei = k_ctx.k_ei; diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c index 6b448aad6f63..9fbdf6a09489 100644 --- a/fs/ext4/mballoc-test.c +++ b/fs/ext4/mballoc-test.c @@ -34,7 +34,7 @@ static struct inode *mbt_alloc_inode(struct super_block *sb) { struct ext4_inode_info *ei; - ei = kmalloc_obj(struct ext4_inode_info, GFP_KERNEL); + ei = kmalloc_obj(struct ext4_inode_info); if (!ei) return NULL; @@ -73,11 +73,11 @@ static int mbt_mb_init(struct super_block *sb) int ret; /* needed by ext4_mb_init->bdev_nonrot(sb->s_bdev) */ - sb->s_bdev = kzalloc_obj(*sb->s_bdev, GFP_KERNEL); + sb->s_bdev = kzalloc_obj(*sb->s_bdev); if (sb->s_bdev == NULL) return -ENOMEM; - sb->s_bdev->bd_queue = kzalloc_obj(struct request_queue, GFP_KERNEL); + sb->s_bdev->bd_queue = kzalloc_obj(struct request_queue); if (sb->s_bdev->bd_queue == NULL) { kfree(sb->s_bdev); return -ENOMEM; @@ -137,7 +137,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void) struct super_block *sb; struct ext4_sb_info *sbi; - fsb = kzalloc_obj(*fsb, GFP_KERNEL); + fsb = kzalloc_obj(*fsb); if (fsb == NULL) return NULL; @@ -148,7 +148,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void) sbi = &fsb->sbi; sbi->s_blockgroup_lock = - kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock); if (!sbi->s_blockgroup_lock) goto out_deactivate; @@ -252,7 +252,7 @@ static int mbt_ctx_init(struct super_block *sb) struct mbt_ctx *ctx = MBT_CTX(sb); ext4_group_t i, ngroups = ext4_get_groups_count(sb); - ctx->grp_ctx = kzalloc_objs(struct mbt_grp_ctx, ngroups, GFP_KERNEL); + ctx->grp_ctx = kzalloc_objs(struct mbt_grp_ctx, ngroups); if (ctx->grp_ctx == NULL) return -ENOMEM; diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 4d0bf2fcf2d3..b6d59385e13d 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3754,7 +3754,7 @@ int ext4_mb_init(struct super_block *sb) } while (i < MB_NUM_ORDERS(sb)); sbi->s_mb_avg_fragment_size = - kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL); + kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb)); if (!sbi->s_mb_avg_fragment_size) { ret = -ENOMEM; goto out; @@ -3763,7 +3763,7 @@ int ext4_mb_init(struct super_block *sb) xa_init(&sbi->s_mb_avg_fragment_size[i]); sbi->s_mb_largest_free_orders = - kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL); + kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb)); if (!sbi->s_mb_largest_free_orders) { ret = -ENOMEM; goto out; diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 780679645b6e..2c5b851c552a 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -32,7 +32,7 @@ static void ext4_rcu_ptr_callback(struct rcu_head *head) void ext4_kvfree_array_rcu(void *to_free) { - struct ext4_rcu_ptr *ptr = kzalloc_obj(*ptr, GFP_KERNEL); + struct ext4_rcu_ptr *ptr = kzalloc_obj(*ptr); if (ptr) { ptr->ptr = to_free; diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 63784d9b1874..43f680c750ae 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2016,7 +2016,7 @@ int ext4_init_fs_context(struct fs_context *fc) { struct ext4_fs_context *ctx; - ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct ext4_fs_context); if (!ctx) return -ENOMEM; @@ -2496,11 +2496,11 @@ static int parse_apply_sb_mount_options(struct super_block *sb, if (strscpy_pad(s_mount_opts, sbi->s_es->s_mount_opts) < 0) return -E2BIG; - fc = kzalloc_obj(struct fs_context, GFP_KERNEL); + fc = kzalloc_obj(struct fs_context); if (!fc) return -ENOMEM; - s_ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL); + s_ctx = kzalloc_obj(struct ext4_fs_context); if (!s_ctx) goto out_free; @@ -3962,7 +3962,7 @@ static int ext4_li_info_new(void) { struct ext4_lazy_init *eli = NULL; - eli = kzalloc_obj(*eli, GFP_KERNEL); + eli = kzalloc_obj(*eli); if (!eli) return -ENOMEM; @@ -3981,7 +3981,7 @@ static struct ext4_li_request *ext4_li_request_new(struct super_block *sb, { struct ext4_li_request *elr; - elr = kzalloc_obj(*elr, GFP_KERNEL); + elr = kzalloc_obj(*elr); if (!elr) return NULL; @@ -4328,7 +4328,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb) { struct ext4_sb_info *sbi; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return NULL; @@ -4336,7 +4336,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb) NULL, NULL); sbi->s_blockgroup_lock = - kzalloc_obj(struct blockgroup_lock, GFP_KERNEL); + kzalloc_obj(struct blockgroup_lock); if (!sbi->s_blockgroup_lock) goto err_out; @@ -4879,7 +4879,7 @@ static int ext4_group_desc_init(struct super_block *sb, } } rcu_assign_pointer(sbi->s_group_desc, - kvmalloc_objs(struct buffer_head *, db_count, GFP_KERNEL)); + kvmalloc_objs(struct buffer_head *, db_count)); if (sbi->s_group_desc == NULL) { ext4_msg(sb, KERN_ERR, "not enough memory"); return -ENOMEM; diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c index cdf78da85861..b87d7bdab06a 100644 --- a/fs/ext4/sysfs.c +++ b/fs/ext4/sysfs.c @@ -655,7 +655,7 @@ int __init ext4_init_sysfs(void) if (!ext4_root) return -ENOMEM; - ext4_feat = kzalloc_obj(*ext4_feat, GFP_KERNEL); + ext4_feat = kzalloc_obj(*ext4_feat); if (!ext4_feat) { ret = -ENOMEM; goto root_err; diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2a12fe8eb668..8774c60b4be4 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3725,7 +3725,7 @@ static struct block_device **f2fs_get_devices(struct super_block *sb, if (!f2fs_is_multi_device(sbi)) return NULL; - devs = kmalloc_objs(*devs, sbi->s_ndevs, GFP_KERNEL); + devs = kmalloc_objs(*devs, sbi->s_ndevs); if (!devs) return ERR_PTR(-ENOMEM); @@ -4501,7 +4501,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, struct f2fs_super_block *super; int err = 0; - super = kzalloc_obj(struct f2fs_super_block, GFP_KERNEL); + super = kzalloc_obj(struct f2fs_super_block); if (!super) return -ENOMEM; @@ -4938,7 +4938,7 @@ try_onemore: recovery = 0; /* allocate memory for f2fs-specific super block info */ - sbi = kzalloc_obj(struct f2fs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct f2fs_sb_info); if (!sbi) return -ENOMEM; @@ -5509,7 +5509,7 @@ static int f2fs_init_fs_context(struct fs_context *fc) { struct f2fs_fs_context *ctx; - ctx = kzalloc_obj(struct f2fs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct f2fs_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 175e8e66c29f..3cc5fb01afa1 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1554,7 +1554,7 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc, * the filesystem, since we're only just about to mount * it and have no inodes etc active! */ - sbi = kzalloc_obj(struct msdos_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct msdos_sb_info); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; @@ -1905,7 +1905,7 @@ int fat_init_fs_context(struct fs_context *fc, bool is_vfat) { struct fat_mount_options *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; diff --git a/fs/fcntl.c b/fs/fcntl.c index c9c73305011e..beab8080badf 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -100,7 +100,7 @@ int file_f_owner_allocate(struct file *file) if (f_owner) return 0; - f_owner = kzalloc_obj(struct fown_struct, GFP_KERNEL); + f_owner = kzalloc_obj(struct fown_struct); if (!f_owner) return -ENOMEM; diff --git a/fs/freevxfs/vxfs_fshead.c b/fs/freevxfs/vxfs_fshead.c index c1d90905b7b2..e6ab8bdf7a6c 100644 --- a/fs/freevxfs/vxfs_fshead.c +++ b/fs/freevxfs/vxfs_fshead.c @@ -58,7 +58,7 @@ vxfs_getfsh(struct inode *ip, int which) if (bp) { struct vxfs_fsh *fhp; - if (!(fhp = kmalloc_obj(*fhp, GFP_KERNEL))) + if (!(fhp = kmalloc_obj(*fhp))) goto out; memcpy(fhp, bp->b_data, sizeof(*fhp)); diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index 44b4958277ce..d7d847d75c3d 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c @@ -193,7 +193,7 @@ static int vxfs_fill_super(struct super_block *sbp, struct fs_context *fc) sbp->s_flags |= SB_RDONLY; - infp = kzalloc_obj(*infp, GFP_KERNEL); + infp = kzalloc_obj(*infp); if (!infp) { warnf(fc, "vxfs: unable to allocate incore superblock"); return -ENOMEM; diff --git a/fs/fsopen.c b/fs/fsopen.c index a23f003ae056..ae19e5136598 100644 --- a/fs/fsopen.c +++ b/fs/fsopen.c @@ -102,7 +102,7 @@ static int fscontext_create_fd(struct fs_context *fc, unsigned int o_flags) static int fscontext_alloc_log(struct fs_context *fc) { - fc->log.log = kzalloc_obj(*fc->log.log, GFP_KERNEL); + fc->log.log = kzalloc_obj(*fc->log.log); if (!fc->log.log) return -ENOMEM; refcount_set(&fc->log.log->usage, 1); diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 45a78ee15e3c..d95dfa48483f 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -112,7 +112,7 @@ int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map) if (backing_sb->s_stack_depth >= fc->max_stack_depth) goto out_fput; - fb = kmalloc_obj(struct fuse_backing, GFP_KERNEL); + fb = kmalloc_obj(struct fuse_backing); res = -ENOMEM; if (!fb) goto out_fput; diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index 0aace951541b..dfcb98a654d8 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -362,7 +362,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm, /* devt determined, create device */ rc = -ENOMEM; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto err_region; @@ -443,7 +443,7 @@ static int cuse_send_init(struct cuse_conn *cc) if (!folio) goto err; - ia = kzalloc_obj(*ia, GFP_KERNEL); + ia = kzalloc_obj(*ia); if (!ia) goto err_free_folio; @@ -505,7 +505,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file) int rc; /* set up cuse_conn */ - cc = kzalloc_obj(*cc, GFP_KERNEL); + cc = kzalloc_obj(*cc); if (!cc) return -ENOMEM; diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index 7d11eac4f629..f6cf00a8938c 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -1219,7 +1219,7 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd) __func__, nr_pages, nr_ranges); for (i = 0; i < nr_ranges; i++) { - range = kzalloc_obj(struct fuse_dax_mapping, GFP_KERNEL); + range = kzalloc_obj(struct fuse_dax_mapping); ret = -ENOMEM; if (!range) goto out_err; @@ -1255,7 +1255,7 @@ int fuse_dax_conn_alloc(struct fuse_conn *fc, enum fuse_dax_mode dax_mode, if (!dax_dev) return 0; - fcd = kzalloc_obj(*fcd, GFP_KERNEL); + fcd = kzalloc_obj(*fcd); if (!fcd) return -ENOMEM; diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 3ec0fa236da0..0b0241f47170 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1598,7 +1598,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, if (IS_ERR(fud)) return PTR_ERR(fud); - bufs = kvmalloc_objs(struct pipe_buffer, pipe->max_usage, GFP_KERNEL); + bufs = kvmalloc_objs(struct pipe_buffer, pipe->max_usage); if (!bufs) return -ENOMEM; @@ -2310,7 +2310,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, tail = pipe->tail; count = pipe_occupancy(head, tail); - bufs = kvmalloc_objs(struct pipe_buffer, count, GFP_KERNEL); + bufs = kvmalloc_objs(struct pipe_buffer, count); if (!bufs) { pipe_unlock(pipe); return -ENOMEM; diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 68067eaedda9..3a38b61aac26 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -277,7 +277,7 @@ static struct fuse_ring_queue *fuse_uring_create_queue(struct fuse_ring *ring, queue = kzalloc_obj(*queue, GFP_KERNEL_ACCOUNT); if (!queue) return NULL; - pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE, GFP_KERNEL); + pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE); if (!pq) { kfree(queue); return NULL; diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e29aecdab97e..b1bb7153cb78 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -684,7 +684,7 @@ static struct fuse_io_args *fuse_io_alloc(struct fuse_io_priv *io, { struct fuse_io_args *ia; - ia = kzalloc_obj(*ia, GFP_KERNEL); + ia = kzalloc_obj(*ia); if (ia) { ia->io = io; ia->ap.folios = fuse_folios_alloc(nfolios, GFP_KERNEL, @@ -2834,7 +2834,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter) if ((iov_iter_rw(iter) == READ) && (offset >= i_size)) return 0; - io = kmalloc_obj(struct fuse_io_priv, GFP_KERNEL); + io = kmalloc_obj(struct fuse_io_priv); if (!io) return -ENOMEM; spin_lock_init(&io->lock); diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 3db0fe0d764b..e57b8af06be9 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1618,11 +1618,11 @@ struct fuse_dev *fuse_dev_alloc(void) struct fuse_dev *fud; struct list_head *pq; - fud = kzalloc_obj(struct fuse_dev, GFP_KERNEL); + fud = kzalloc_obj(struct fuse_dev); if (!fud) return NULL; - pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE, GFP_KERNEL); + pq = kzalloc_objs(struct list_head, FUSE_PQ_HASH_SIZE); if (!pq) { kfree(fud); return NULL; @@ -1780,7 +1780,7 @@ static int fuse_get_tree_submount(struct fs_context *fsc) struct super_block *sb; int err; - fm = kzalloc_obj(struct fuse_mount, GFP_KERNEL); + fm = kzalloc_obj(struct fuse_mount); if (!fm) return -ENOMEM; @@ -1981,11 +1981,11 @@ static int fuse_get_tree(struct fs_context *fsc) struct super_block *sb; int err; - fc = kmalloc_obj(*fc, GFP_KERNEL); + fc = kmalloc_obj(*fc); if (!fc) return -ENOMEM; - fm = kzalloc_obj(*fm, GFP_KERNEL); + fm = kzalloc_obj(*fm); if (!fm) { kfree(fc); return -ENOMEM; @@ -2047,7 +2047,7 @@ static int fuse_init_fs_context(struct fs_context *fsc) { struct fuse_fs_context *ctx; - ctx = kzalloc_obj(struct fuse_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct fuse_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index dc96ee0b952a..057e65b51b99 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -947,14 +947,14 @@ static int virtio_fs_setup_vqs(struct virtio_device *vdev, fs->num_request_queues = min_t(unsigned int, fs->num_request_queues, nr_cpu_ids); fs->nvqs = VQ_REQUEST + fs->num_request_queues; - fs->vqs = kzalloc_objs(fs->vqs[VQ_HIPRIO], fs->nvqs, GFP_KERNEL); + fs->vqs = kzalloc_objs(fs->vqs[VQ_HIPRIO], fs->nvqs); if (!fs->vqs) return -ENOMEM; - vqs = kmalloc_objs(vqs[VQ_HIPRIO], fs->nvqs, GFP_KERNEL); + vqs = kmalloc_objs(vqs[VQ_HIPRIO], fs->nvqs); fs->mq_map = kcalloc_node(nr_cpu_ids, sizeof(*fs->mq_map), GFP_KERNEL, dev_to_node(&vdev->dev)); - vqs_info = kzalloc_objs(*vqs_info, fs->nvqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, fs->nvqs); if (!vqs || !vqs_info || !fs->mq_map) { ret = -ENOMEM; goto out; @@ -1120,7 +1120,7 @@ static int virtio_fs_probe(struct virtio_device *vdev) struct virtio_fs *fs; int ret; - fs = kzalloc_obj(*fs, GFP_KERNEL); + fs = kzalloc_obj(*fs); if (!fs) return -ENOMEM; kobject_init(&fs->kobj, &virtio_fs_ktype); @@ -1684,11 +1684,11 @@ static int virtio_fs_get_tree(struct fs_context *fsc) goto out_err; err = -ENOMEM; - fc = kzalloc_obj(struct fuse_conn, GFP_KERNEL); + fc = kzalloc_obj(struct fuse_conn); if (!fc) goto out_err; - fm = kzalloc_obj(struct fuse_mount, GFP_KERNEL); + fm = kzalloc_obj(struct fuse_mount); if (!fm) goto out_err; @@ -1743,7 +1743,7 @@ static int virtio_fs_init_fs_context(struct fs_context *fsc) if (fsc->purpose == FS_CONTEXT_FOR_SUBMOUNT) return fuse_init_fs_context_submount(fsc); - ctx = kzalloc_obj(struct fuse_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct fuse_fs_context); if (!ctx) return -ENOMEM; fsc->fs_private = ctx; diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index f3f649fc5cb1..9b9e70f14d25 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -76,7 +76,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) { struct gfs2_sbd *sdp; - sdp = kzalloc_obj(struct gfs2_sbd, GFP_KERNEL); + sdp = kzalloc_obj(struct gfs2_sbd); if (!sdp) return NULL; @@ -562,7 +562,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh) break; error = -ENOMEM; - jd = kzalloc_obj(struct gfs2_jdesc, GFP_KERNEL); + jd = kzalloc_obj(struct gfs2_jdesc); if (!jd) break; @@ -1637,7 +1637,7 @@ static int gfs2_init_fs_context(struct fs_context *fc) { struct gfs2_args *args; - args = kmalloc_obj(*args, GFP_KERNEL); + args = kmalloc_obj(*args); if (args == NULL) return -ENOMEM; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index af3dfeed62fe..5290865f27f1 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1318,7 +1318,7 @@ int gfs2_quota_sync(struct super_block *sb, int type) if (sb_rdonly(sdp->sd_vfs)) return 0; - qda = kzalloc_objs(struct gfs2_quota_data *, max_qd, GFP_KERNEL); + qda = kzalloc_objs(struct gfs2_quota_data *, max_qd); if (!qda) return -ENOMEM; diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9a655588c0c5..bc191b55b18e 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -336,7 +336,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) */ list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) { - lfcc = kmalloc_obj(struct lfcc, GFP_KERNEL); + lfcc = kmalloc_obj(struct lfcc); if (!lfcc) { error = -ENOMEM; goto out; @@ -860,7 +860,7 @@ static int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host int error = 0, err; memset(sc, 0, sizeof(struct gfs2_statfs_change_host)); - gha = kmalloc_objs(struct gfs2_holder, slots, GFP_KERNEL); + gha = kmalloc_objs(struct gfs2_holder, slots); if (!gha) return -ENOMEM; for (x = 0; x < slots; x++) diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index b5ee0e072935..2eb37a2f64e8 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c @@ -28,7 +28,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke sector_t start_block; loff_t offset; - tree = kzalloc_obj(*tree, GFP_KERNEL); + tree = kzalloc_obj(*tree); if (!tree) return NULL; diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 80277979c09c..f5e7efe924e7 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -148,7 +148,7 @@ static int hfs_readdir(struct file *file, struct dir_context *ctx) } rd = file->private_data; if (!rd) { - rd = kmalloc_obj(struct hfs_readdir_data, GFP_KERNEL); + rd = kmalloc_obj(struct hfs_readdir_data); if (!rd) { err = -ENOMEM; goto out; diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 78dc9dabb0c1..a4f2a2bfa6d3 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -411,7 +411,7 @@ static int hfs_init_fs_context(struct fs_context *fc) { struct hfs_sb_info *hsb; - hsb = kzalloc_obj(struct hfs_sb_info, GFP_KERNEL); + hsb = kzalloc_obj(struct hfs_sb_info); if (!hsb) return -ENOMEM; diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c index 5016d97290c8..1220a2f22737 100644 --- a/fs/hfsplus/btree.c +++ b/fs/hfsplus/btree.c @@ -139,7 +139,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) struct page *page; unsigned int size; - tree = kzalloc_obj(*tree, GFP_KERNEL); + tree = kzalloc_obj(*tree); if (!tree) return NULL; diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 9998b28aa8f7..d559bf8625f8 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -263,7 +263,7 @@ next: } rd = file->private_data; if (!rd) { - rd = kmalloc_obj(struct hfsplus_readdir_data, GFP_KERNEL); + rd = kmalloc_obj(struct hfsplus_readdir_data); if (!rd) { err = -ENOMEM; goto out; diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index f60f37caea65..7229a8ae89f9 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -698,7 +698,7 @@ static int hfsplus_init_fs_context(struct fs_context *fc) { struct hfsplus_sb_info *sbi; - sbi = kzalloc_obj(struct hfsplus_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct hfsplus_sb_info); if (!sbi) return -ENOMEM; diff --git a/fs/hfsplus/unicode_test.c b/fs/hfsplus/unicode_test.c index c162c0fea4a8..26145bf88946 100644 --- a/fs/hfsplus/unicode_test.c +++ b/fs/hfsplus/unicode_test.c @@ -22,7 +22,7 @@ static struct test_mock_string_env *setup_mock_str_env(u32 buf_size) { struct test_mock_string_env *env; - env = kzalloc_obj(struct test_mock_string_env, GFP_KERNEL); + env = kzalloc_obj(struct test_mock_string_env); if (!env) return NULL; @@ -393,7 +393,7 @@ static struct test_mock_sb *setup_mock_sb(void) { struct test_mock_sb *ptr; - ptr = kzalloc_obj(struct test_mock_sb, GFP_KERNEL); + ptr = kzalloc_obj(struct test_mock_sb); if (!ptr) return NULL; diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 2c463a8c0ab4..abe86d72d9ef 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -1047,7 +1047,7 @@ static int hostfs_init_fs_context(struct fs_context *fc) { struct hostfs_fs_info *fsi; - fsi = kzalloc_obj(*fsi, GFP_KERNEL); + fsi = kzalloc_obj(*fsi); if (!fsi) return -ENOMEM; diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 0f17b7710ae5..c16d5d4caead 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -513,7 +513,7 @@ static int hpfs_fill_super(struct super_block *s, struct fs_context *fc) struct hpfs_dirent *de = NULL; struct quad_buffer_head qbh; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) { return -ENOMEM; } @@ -715,7 +715,7 @@ static int hpfs_init_fs_context(struct fs_context *fc) { struct hpfs_fc_context *ctx; - ctx = kzalloc_obj(struct hpfs_fc_context, GFP_KERNEL); + ctx = kzalloc_obj(struct hpfs_fc_context); if (!ctx) return -ENOMEM; diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8e2c1fbdfd86..3f70c47981de 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1407,7 +1407,7 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc) struct hugetlbfs_fs_context *ctx = fc->fs_private; struct hugetlbfs_sb_info *sbinfo; - sbinfo = kmalloc_obj(struct hugetlbfs_sb_info, GFP_KERNEL); + sbinfo = kmalloc_obj(struct hugetlbfs_sb_info); if (!sbinfo) return -ENOMEM; sb->s_fs_info = sbinfo; @@ -1478,7 +1478,7 @@ static int hugetlbfs_init_fs_context(struct fs_context *fc) { struct hugetlbfs_fs_context *ctx; - ctx = kzalloc_obj(struct hugetlbfs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct hugetlbfs_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 438c00e526c6..95254aa1b654 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -677,7 +677,7 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, if (!iomi.len) return NULL; - dio = kmalloc_obj(*dio, GFP_KERNEL); + dio = kmalloc_obj(*dio); if (!dio) return ERR_PTR(-ENOMEM); diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 4aa8f0734456..a17f0f590151 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c @@ -75,7 +75,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start, /* Because zlib is not thread-safe, do all the I/O at the top. */ blocknum = block_start >> bufshift; - bhs = kzalloc_objs(*bhs, needblocks + 1, GFP_KERNEL); + bhs = kzalloc_objs(*bhs, needblocks + 1); if (!bhs) { *errp = -ENOMEM; return 0; diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 6597d0224835..5c01536c5e8f 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -589,7 +589,7 @@ static int isofs_fill_super(struct super_block *s, struct fs_context *fc) unsigned int vol_desc_start; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; s->s_fs_info = sbi; @@ -1557,7 +1557,7 @@ static int isofs_init_fs_context(struct fs_context *fc) { struct isofs_options *opt; - opt = kzalloc_obj(*opt, GFP_KERNEL); + opt = kzalloc_obj(*opt); if (!opt) return -ENOMEM; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 05ea1e5af80d..0fbd9a47ae67 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1175,7 +1175,7 @@ static int jbd2_seq_info_open(struct inode *inode, struct file *file) struct jbd2_stats_proc_session *s; int rc, size; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (s == NULL) return -ENOMEM; size = sizeof(struct transaction_stats_s); @@ -1525,7 +1525,7 @@ static journal_t *journal_init_common(struct block_device *bdev, int err; int n; - journal = kzalloc_obj(*journal, GFP_KERNEL); + journal = kzalloc_obj(*journal); if (!journal) return ERR_PTR(-ENOMEM); @@ -1578,7 +1578,7 @@ static journal_t *journal_init_common(struct block_device *bdev, n = journal->j_blocksize / jbd2_min_tag_size(); journal->j_wbufsize = n; journal->j_fc_wbuf = NULL; - journal->j_wbuf = kmalloc_objs(struct buffer_head *, n, GFP_KERNEL); + journal->j_wbuf = kmalloc_objs(struct buffer_head *, n); if (!journal->j_wbuf) goto err_cleanup; diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index 3aa9f82a8ef7..9016ddb82447 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -231,7 +231,7 @@ struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size) table->hash_size = hash_size; table->hash_shift = shift; table->hash_table = - kvmalloc_objs(struct list_head, hash_size, GFP_KERNEL); + kvmalloc_objs(struct list_head, hash_size); if (!table->hash_table) { kmem_cache_free(jbd2_revoke_table_cache, table); table = NULL; diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index d451c8a1fdac..a99ee831bab8 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c @@ -43,7 +43,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, jffs2_dbg(1, "%s(): erase block %#08x (range %#08x-%#08x)\n", __func__, jeb->offset, jeb->offset, jeb->offset + c->sector_size); - instr = kzalloc_obj(struct erase_info, GFP_KERNEL); + instr = kzalloc_obj(struct erase_info); if (!instr) { pr_warn("kzalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); mutex_lock(&c->erase_free_sem); diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index eeca922d4da4..1caabff9dc91 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -1392,7 +1392,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { struct jffs2_raw_inode n; - struct jffs2_inode_info *f = kzalloc_obj(*f, GFP_KERNEL); + struct jffs2_inode_info *f = kzalloc_obj(*f); int ret; if (!f) diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 39063e2131d6..06e494797724 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -132,7 +132,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) } if (jffs2_sum_active()) { - s = kzalloc_obj(struct jffs2_summary, GFP_KERNEL); + s = kzalloc_obj(struct jffs2_summary); if (!s) { JFFS2_WARNING("Can't allocate memory for summary\n"); ret = -ENOMEM; diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c index b9df829eff56..d0b689ee8d32 100644 --- a/fs/jffs2/summary.c +++ b/fs/jffs2/summary.c @@ -27,7 +27,7 @@ int jffs2_sum_init(struct jffs2_sb_info *c) { uint32_t sum_size = min_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE); - c->summary = kzalloc_obj(struct jffs2_summary, GFP_KERNEL); + c->summary = kzalloc_obj(struct jffs2_summary); if (!c->summary) { JFFS2_WARNING("Can't allocate memory for summary information!\n"); @@ -160,7 +160,7 @@ int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, { struct jffs2_sum_xattr_mem *temp; - temp = kmalloc_obj(struct jffs2_sum_xattr_mem, GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xattr_mem); if (!temp) return -ENOMEM; @@ -178,7 +178,7 @@ int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, u { struct jffs2_sum_xref_mem *temp; - temp = kmalloc_obj(struct jffs2_sum_xref_mem, GFP_KERNEL); + temp = kmalloc_obj(struct jffs2_sum_xref_mem); if (!temp) return -ENOMEM; diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 48fbf1594ce8..81396a092ba8 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -311,7 +311,7 @@ static int jffs2_init_fs_context(struct fs_context *fc) { struct jffs2_sb_info *ctx; - ctx = kzalloc_obj(struct jffs2_sb_info, GFP_KERNEL); + ctx = kzalloc_obj(struct jffs2_sb_info); if (!ctx) return -ENOMEM; diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 9775b9b84504..8ff7a0b6add2 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c @@ -92,7 +92,7 @@ static void jffs2_wbuf_dirties_inode(struct jffs2_sb_info *c, uint32_t ino) if (jffs2_wbuf_pending_for_ino(c, ino)) return; - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) { jffs2_dbg(1, "No memory to allocate inodirty. Fallback to all considered dirty\n"); jffs2_clear_wbuf_ino_list(c); diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 368fcdd8c328..2abe8cc02ee6 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -161,7 +161,7 @@ int dbMount(struct inode *ipbmap) * allocate/initialize the in-memory bmap descriptor */ /* allocate memory for the in-memory bmap descriptor */ - bmp = kmalloc_obj(struct bmap, GFP_KERNEL); + bmp = kmalloc_obj(struct bmap); if (bmp == NULL) return -ENOMEM; diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 739fcb4a6fc8..294a67327c73 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -102,7 +102,7 @@ int diMount(struct inode *ipimap) * allocate/initialize the in-memory inode map control structure */ /* allocate the in-memory inode map control structure. */ - imap = kzalloc_obj(struct inomap, GFP_KERNEL); + imap = kzalloc_obj(struct inomap); if (imap == NULL) return -ENOMEM; diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 204cca8dd5d4..ada00d5bc214 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1087,7 +1087,7 @@ int lmLogOpen(struct super_block *sb) } } - if (!(log = kzalloc_obj(struct jfs_log, GFP_KERNEL))) { + if (!(log = kzalloc_obj(struct jfs_log))) { mutex_unlock(&jfs_log_mutex); return -ENOMEM; } @@ -1156,7 +1156,7 @@ static int open_inline_log(struct super_block *sb) struct jfs_log *log; int rc; - if (!(log = kzalloc_obj(struct jfs_log, GFP_KERNEL))) + if (!(log = kzalloc_obj(struct jfs_log))) return -ENOMEM; INIT_LIST_HEAD(&log->sb_list); init_waitqueue_head(&log->syncwait); @@ -1190,7 +1190,7 @@ static int open_dummy_log(struct super_block *sb) mutex_lock(&jfs_log_mutex); if (!dummy_log) { - dummy_log = kzalloc_obj(struct jfs_log, GFP_KERNEL); + dummy_log = kzalloc_obj(struct jfs_log); if (!dummy_log) { mutex_unlock(&jfs_log_mutex); return -ENOMEM; @@ -1818,7 +1818,7 @@ static int lbmLogInit(struct jfs_log * log) goto error; buffer = page_address(page); for (offset = 0; offset < PAGE_SIZE; offset += LOGPSIZE) { - lbuf = kmalloc_obj(struct lbuf, GFP_KERNEL); + lbuf = kmalloc_obj(struct lbuf); if (lbuf == NULL) { if (offset == 0) __free_page(page); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 4c1510091fe2..61575f7397ae 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -449,7 +449,7 @@ static int jfs_fill_super(struct super_block *sb, struct fs_context *fc) jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); - sbi = kzalloc_obj(struct jfs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct jfs_sb_info); if (!sbi) return -ENOMEM; @@ -912,7 +912,7 @@ static int jfs_init_fs_context(struct fs_context *fc) { struct jfs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 3d0704e21f71..8d40c4b1db9f 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -989,7 +989,7 @@ struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops, struct kernfs_root *root; struct kernfs_node *kn; - root = kzalloc_obj(*root, GFP_KERNEL); + root = kzalloc_obj(*root); if (!root) return ERR_PTR(-ENOMEM); diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index d338875f0258..e32406d62c0d 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -540,7 +540,7 @@ static int kernfs_get_open_node(struct kernfs_node *kn, if (!on) { /* not there, initialize a new one */ - on = kzalloc_obj(*on, GFP_KERNEL); + on = kzalloc_obj(*on); if (!on) { mutex_unlock(mutex); return -ENOMEM; @@ -638,7 +638,7 @@ static int kernfs_fop_open(struct inode *inode, struct file *file) /* allocate a kernfs_open_file for the file */ error = -ENOMEM; - of = kzalloc_obj(struct kernfs_open_file, GFP_KERNEL); + of = kzalloc_obj(struct kernfs_open_file); if (!of) goto err_out; diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index dd38e2e21a17..048f00b73b71 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c @@ -370,7 +370,7 @@ int kernfs_get_tree(struct fs_context *fc) struct kernfs_super_info *info; int error; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; @@ -451,7 +451,7 @@ static void __init kernfs_mutex_init(void) static void __init kernfs_lock_init(void) { - kernfs_locks = kmalloc_obj(struct kernfs_global_locks, GFP_KERNEL); + kernfs_locks = kmalloc_obj(struct kernfs_global_locks); WARN_ON(!kernfs_locks); kernfs_mutex_init(); diff --git a/fs/libfs.c b/fs/libfs.c index 361d5203e464..74134ba2e8d1 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -731,7 +731,7 @@ struct pseudo_fs_context *init_pseudo(struct fs_context *fc, { struct pseudo_fs_context *ctx; - ctx = kzalloc_obj(struct pseudo_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct pseudo_fs_context); if (likely(ctx)) { ctx->magic = magic; fc->fs_private = ctx; @@ -1320,7 +1320,7 @@ int simple_attr_open(struct inode *inode, struct file *file, { struct simple_attr *attr; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) return -ENOMEM; diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index 372fe0cf830f..85bc0f3e91df 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -233,7 +233,7 @@ reclaimer(void *ptr) u32 nsmstate; struct net *net = host->net; - req = kmalloc_obj(*req, GFP_KERNEL); + req = kmalloc_obj(*req); if (!req) return 0; diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index e189b3ddfedf..fb4d0752c9bb 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -105,7 +105,7 @@ static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_ow res = __nlmclnt_find_lockowner(host, owner); if (res == NULL) { spin_unlock(&host->h_lock); - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); spin_lock(&host->h_lock); res = __nlmclnt_find_lockowner(host, owner); if (res == NULL && new != NULL) { @@ -208,7 +208,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) struct nlm_rqst *call; for(;;) { - call = kzalloc_obj(*call, GFP_KERNEL); + call = kzalloc_obj(*call); if (call != NULL) { refcount_set(&call->a_count, 1); locks_init_lock(&call->a_args.lock.fl); diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 12a745a543e0..1a9582a10a86 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -126,7 +126,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, } } - host = kmalloc_obj(*host, GFP_KERNEL); + host = kmalloc_obj(*host); if (unlikely(host == NULL)) { dprintk("lockd: %s failed; no memory\n", __func__); nsm_release(nsm); diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 1dee1da9ee0f..255a847ca0b6 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -233,7 +233,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, return NULL; /* Allocate memory for block, and initialize arguments */ - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (block == NULL) goto failed; kref_init(&block->b_count); @@ -380,7 +380,7 @@ static struct nlm_lockowner *nlmsvc_find_lockowner(struct nlm_host *host, pid_t if (res == NULL) { spin_unlock(&host->h_lock); - new = kmalloc_obj(*res, GFP_KERNEL); + new = kmalloc_obj(*res); spin_lock(&host->h_lock); res = __nlmsvc_find_lockowner(host, pid); if (res == NULL && new != NULL) { diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index fcfeaf6d6855..dd0214dcb695 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -128,7 +128,7 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, nlm_debug_print_fh("creating file for", &lock->fh); nfserr = nlm_lck_denied_nolocks; - file = kzalloc_obj(*file, GFP_KERNEL); + file = kzalloc_obj(*file); if (!file) goto out_free; diff --git a/fs/mbcache.c b/fs/mbcache.c index 19cb8eb6744e..d6707fbdeb50 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -358,7 +358,7 @@ struct mb_cache *mb_cache_create(int bucket_bits) unsigned long bucket_count = 1UL << bucket_bits; unsigned long i; - cache = kzalloc_obj(struct mb_cache, GFP_KERNEL); + cache = kzalloc_obj(struct mb_cache); if (!cache) goto err_out; cache->c_bucket_bits = bucket_bits; diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 495d31b8cd0e..99541c6a5bbf 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -226,7 +226,7 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc) int ret = -EINVAL; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc_obj(struct minix_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct minix_sb_info); if (!sbi) return -ENOMEM; s->s_fs_info = sbi; diff --git a/fs/namespace.c b/fs/namespace.c index 1cb7fa1a02ed..ebe19ded293a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -889,7 +889,7 @@ mountpoint: } if (!mp) - mp = kmalloc_obj(struct mountpoint, GFP_KERNEL); + mp = kmalloc_obj(struct mountpoint); if (!mp) return -ENOMEM; @@ -2226,7 +2226,7 @@ static inline bool extend_array(struct path **res, struct path **to_free, if (likely(n < *count)) return true; - p = kmalloc_objs(struct path, new_count, GFP_KERNEL); + p = kmalloc_objs(struct path, new_count); if (p && *count) memcpy(p, *res, *count * sizeof(struct path)); *count = new_count; diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c index 60073d41a387..88a0d801525f 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -429,7 +429,7 @@ static int netfs_read_gaps(struct file *file, struct folio *folio) * end get copied to, but the middle is discarded. */ ret = -ENOMEM; - bvec = kmalloc_objs(*bvec, nr_bvec, GFP_KERNEL); + bvec = kmalloc_objs(*bvec, nr_bvec); if (!bvec) goto discard; diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index 8fe514447df6..22a4d61631c9 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -302,7 +302,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter, goto copied; } - finfo = kzalloc_obj(*finfo, GFP_KERNEL); + finfo = kzalloc_obj(*finfo); if (!finfo) { iov_iter_revert(iter, copied); ret = -ENOMEM; diff --git a/fs/netfs/fscache_cache.c b/fs/netfs/fscache_cache.c index e709617b64d5..15b54d133633 100644 --- a/fs/netfs/fscache_cache.c +++ b/fs/netfs/fscache_cache.c @@ -25,7 +25,7 @@ static struct fscache_cache *fscache_alloc_cache(const char *name) { struct fscache_cache *cache; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (cache) { if (name) { cache->name = kstrdup(name, GFP_KERNEL); diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c index 90fa1e4440be..9738a1ae92ca 100644 --- a/fs/nfs/cache_lib.c +++ b/fs/nfs/cache_lib.c @@ -96,7 +96,7 @@ struct nfs_cache_defer_req *nfs_cache_defer_req_alloc(void) { struct nfs_cache_defer_req *dreq; - dreq = kzalloc_obj(*dreq, GFP_KERNEL); + dreq = kzalloc_obj(*dreq); if (dreq) { init_completion(&dreq->completion); refcount_set(&dreq->count, 1); diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 1c94a97efd31..4ea9221ded42 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -718,7 +718,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy, struct nfs4_copy_state *copy, *tmp_copy; bool found = false; - copy = kzalloc_obj(struct nfs4_copy_state, GFP_KERNEL); + copy = kzalloc_obj(struct nfs4_copy_state); if (!copy) return cpu_to_be32(NFS4ERR_DELAY); diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 857393803e71..7f317ffa17c2 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -272,7 +272,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, if (n == 0) goto out; - args->devs = kmalloc_objs(*args->devs, n, GFP_KERNEL); + args->devs = kmalloc_objs(*args->devs, n); if (!args->devs) { status = htonl(NFS4ERR_DELAY); goto out; diff --git a/fs/nfs/client.c b/fs/nfs/client.c index be6e3b61735d..be02bb227741 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -150,7 +150,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init) struct nfs_client *clp; int err = -ENOMEM; - if ((clp = kzalloc_obj(*clp, GFP_KERNEL)) == NULL) + if ((clp = kzalloc_obj(*clp)) == NULL) goto error_0; clp->cl_minorversion = cl_init->minorversion; @@ -1044,7 +1044,7 @@ struct nfs_server *nfs_alloc_server(void) { struct nfs_server *server; - server = kzalloc_obj(struct nfs_server, GFP_KERNEL); + server = kzalloc_obj(struct nfs_server); if (!server) return NULL; diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 624ee989929d..2402f57c8e7d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -912,7 +912,7 @@ static struct page **nfs_readdir_alloc_pages(size_t npages) struct page **pages; size_t i; - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); if (!pages) return NULL; for (i = 0; i < npages; i++) { @@ -942,7 +942,7 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc, unsigned int pglen; int status = -ENOMEM; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; entry->cookie = nfs_readdir_folio_last_cookie(folio); @@ -1154,7 +1154,7 @@ static int uncached_readdir(struct nfs_readdir_descriptor *desc) dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %llu\n", (unsigned long long)desc->dir_cookie); - arrays = kzalloc_objs(*arrays, sz, GFP_KERNEL); + arrays = kzalloc_objs(*arrays, sz); if (!arrays) goto out; arrays[0] = nfs_readdir_folio_array_alloc(desc->dir_cookie, GFP_KERNEL); @@ -1245,7 +1245,7 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) nfs_revalidate_mapping(inode, file->f_mapping); res = -ENOMEM; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) goto out; desc->file = file; @@ -3216,7 +3216,7 @@ found: void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set, const struct cred *cred) { - struct nfs_access_entry *cache = kmalloc_obj(*cache, GFP_KERNEL); + struct nfs_access_entry *cache = kmalloc_obj(*cache); if (cache == NULL) return; RB_CLEAR_NODE(&cache->rb_node); diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 9bce45de1cb4..2ed2126201f4 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -120,7 +120,7 @@ static void nfs_dns_ent_put(struct kref *ref) static struct cache_head *nfs_dns_ent_alloc(void) { - struct nfs_dns_ent *item = kmalloc_obj(*item, GFP_KERNEL); + struct nfs_dns_ent *item = kmalloc_obj(*item); if (item != NULL) { item->hostname = NULL; diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c index 2fc851abd187..c105882edd16 100644 --- a/fs/nfs/fs_context.c +++ b/fs/nfs/fs_context.c @@ -1692,7 +1692,7 @@ static int nfs_init_fs_context(struct fs_context *fc) { struct nfs_fs_context *ctx; - ctx = kzalloc_obj(struct nfs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct nfs_fs_context); if (unlikely(!ctx)) return -ENOMEM; diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index ea215fc2ed21..4786343eeee0 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1777,7 +1777,7 @@ struct nfs_fattr *nfs_alloc_fattr(void) { struct nfs_fattr *fattr; - fattr = kmalloc_obj(*fattr, GFP_KERNEL); + fattr = kmalloc_obj(*fattr); if (fattr != NULL) { nfs_fattr_init(fattr); fattr->label = NULL; @@ -1807,7 +1807,7 @@ struct nfs_fh *nfs_alloc_fhandle(void) { struct nfs_fh *fh; - fh = kmalloc_obj(struct nfs_fh, GFP_KERNEL); + fh = kmalloc_obj(struct nfs_fh); if (fh != NULL) fh->size = 0; return fh; diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index eb9cac652550..3e2de45c95fe 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -299,7 +299,7 @@ static struct nfs3_createdata *nfs3_alloc_createdata(void) { struct nfs3_createdata *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (data != NULL) { data->msg.rpc_argp = &data->arg; data->msg.rpc_resp = &data->res; diff --git a/fs/nfs/nfs40proc.c b/fs/nfs/nfs40proc.c index 53f54081942e..b07f2d6ccde4 100644 --- a/fs/nfs/nfs40proc.c +++ b/fs/nfs/nfs40proc.c @@ -320,7 +320,7 @@ nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_state *lsp) if (clp->cl_mvops->minor_version != 0) return; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return; data->lsp = lsp; diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 46298606e509..7b3ca68fb4bb 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -247,7 +247,7 @@ static int handle_async_copy(struct nfs42_copy_res *res, int status = NFS4_OK; u64 copied; - copy = kzalloc_obj(struct nfs4_copy_state, GFP_KERNEL); + copy = kzalloc_obj(struct nfs4_copy_state); if (!copy) return -ENOMEM; @@ -351,7 +351,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst, struct nfs_commitres cres; int status = -ENOMEM; - cres.verf = kzalloc_obj(struct nfs_writeverf, GFP_KERNEL); + cres.verf = kzalloc_obj(struct nfs_writeverf); if (!cres.verf) goto out; @@ -461,7 +461,7 @@ static ssize_t _nfs42_proc_copy(struct file *src, res->commit_res.verf = NULL; if (args->sync) { res->commit_res.verf = - kzalloc_obj(struct nfs_writeverf, GFP_KERNEL); + kzalloc_obj(struct nfs_writeverf); if (!res->commit_res.verf) return -ENOMEM; } @@ -659,7 +659,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst, if (!(dst_server->caps & NFS_CAP_OFFLOAD_CANCEL)) return -EOPNOTSUPP; - data = kzalloc_obj(struct nfs42_offload_data, GFP_KERNEL); + data = kzalloc_obj(struct nfs42_offload_data); if (data == NULL) return -ENOMEM; @@ -756,7 +756,7 @@ nfs42_proc_offload_status(struct file *dst, nfs4_stateid *stateid, u64 *copied) if (!(server->caps & NFS_CAP_OFFLOAD_STATUS)) return -EOPNOTSUPP; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; data->seq_server = server; @@ -838,7 +838,7 @@ int nfs42_proc_copy_notify(struct file *src, struct file *dst, if (!(src_server->caps & NFS_CAP_COPY_NOTIFY)) return -EOPNOTSUPP; - args = kzalloc_obj(struct nfs42_copy_notify_args, GFP_KERNEL); + args = kzalloc_obj(struct nfs42_copy_notify_args); if (args == NULL) return -ENOMEM; @@ -1535,7 +1535,7 @@ static ssize_t _nfs42_proc_listxattrs(struct inode *inode, void *buf, xdrlen = server->lxasize; np = xdrlen / PAGE_SIZE + 1; - pages = kzalloc_objs(struct page *, np, GFP_KERNEL); + pages = kzalloc_objs(struct page *, np); if (!pages) goto out_free_scratch; for (i = 0; i < np; i++) { @@ -1578,7 +1578,7 @@ ssize_t nfs42_proc_getxattr(struct inode *inode, const char *name, struct page **pages; np = nfs_page_array_len(0, buflen ?: XATTR_SIZE_MAX); - pages = kmalloc_objs(*pages, np, GFP_KERNEL); + pages = kmalloc_objs(*pages, np); if (!pages) return -ENOMEM; diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 432cfeebeba4..5c7452ce6e8a 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -1159,7 +1159,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res) if (segments == 0) return 0; - segs = kmalloc_objs(*segs, segments, GFP_KERNEL); + segs = kmalloc_objs(*segs, segments); if (!segs) return -ENOMEM; diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index bd079b4a6523..be40e126c539 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -164,7 +164,7 @@ retry: */ if (sync) return -EOPNOTSUPP; - cn_resp = kzalloc_obj(struct nfs42_copy_notify_res, GFP_KERNEL); + cn_resp = kzalloc_obj(struct nfs42_copy_notify_res); if (unlikely(cn_resp == NULL)) return -ENOMEM; diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index 01fb53132279..bc397110d977 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -445,7 +445,7 @@ nfs_idmap_new(struct nfs_client *clp) struct rpc_pipe *pipe; int error; - idmap = kzalloc_obj(*idmap, GFP_KERNEL); + idmap = kzalloc_obj(*idmap); if (idmap == NULL) return -ENOMEM; @@ -579,7 +579,7 @@ static int nfs_idmap_legacy_upcall(struct key *authkey, void *aux) /* msg and im are freed in idmap_pipe_destroy_msg */ ret = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto out1; diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 7366f2e6bc12..14f72baf3b30 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -415,7 +415,7 @@ static int nfs_do_refmount(struct fs_context *fc, struct rpc_clnt *client) if (!page) return -ENOMEM; - fs_locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); + fs_locations = kmalloc_obj(struct nfs4_fs_locations); if (!fs_locations) goto out_free; fs_locations->fattr = nfs_alloc_fattr(); @@ -490,7 +490,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server, size_t salen; int error; - sap = kmalloc_obj(*sap, GFP_KERNEL); + sap = kmalloc_obj(*sap); if (sap == NULL) return -ENOMEM; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index df9ae871726d..91bcf67bd743 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -4107,7 +4107,7 @@ static int _nfs4_discover_trunking(struct nfs_server *server, page = alloc_page(GFP_KERNEL); if (!page) goto out_put_cred; - locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations); if (!locations) goto out_free; locations->fattr = nfs_alloc_fattr(); @@ -4341,7 +4341,7 @@ static int nfs4_get_referral(struct rpc_clnt *client, struct inode *dir, page = alloc_page(GFP_KERNEL); if (page == NULL) goto out; - locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations); if (locations == NULL) goto out; @@ -5130,7 +5130,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, { struct nfs4_createdata *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (data != NULL) { struct nfs_server *server = NFS_SERVER(dir); @@ -6023,7 +6023,7 @@ static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, acl->cached = 1; _copy_from_pages(acl->data, pages, pgbase, acl_len); } else { - acl = kmalloc_obj(*acl, GFP_KERNEL); + acl = kmalloc_obj(*acl); if (acl == NULL) goto out; acl->cached = 0; @@ -6070,7 +6070,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, buflen = server->rsize; npages = DIV_ROUND_UP(buflen, PAGE_SIZE) + 1; - pages = kmalloc_objs(struct page *, npages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, npages); if (!pages) return -ENOMEM; @@ -6822,7 +6822,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, if (nfs_server_capable(inode, NFS_CAP_MOVEABLE)) task_setup_data.flags |= RPC_TASK_MOVEABLE; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (data == NULL) return -ENOMEM; @@ -7026,7 +7026,7 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl, struct inode *inode = state->inode; struct nfs_lock_context *l_ctx; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (p == NULL) return NULL; l_ctx = nfs_get_lock_context(ctx); @@ -9396,7 +9396,7 @@ static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, goto out_err; ret = ERR_PTR(-ENOMEM); - calldata = kzalloc_obj(*calldata, GFP_KERNEL); + calldata = kzalloc_obj(*calldata); if (calldata == NULL) goto out_put_clp; nfs4_init_sequence(clp, &calldata->args, &calldata->res, 0, is_privileged); @@ -10358,7 +10358,7 @@ static int nfs41_free_stateid(struct nfs_server *server, &task_setup.rpc_client, &msg); dprintk("NFS call free_stateid %p\n", stateid); - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; data->server = server; diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 7e1f14fad898..305a772e5497 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -2054,7 +2054,7 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred clp->cl_hostname); page = alloc_page(GFP_KERNEL); - locations = kmalloc_obj(struct nfs4_fs_locations, GFP_KERNEL); + locations = kmalloc_obj(struct nfs4_fs_locations); fattr = nfs_alloc_fattr(); if (page == NULL || locations == NULL || fattr == NULL) { dprintk("<-- %s: no memory\n", __func__); diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 678f1f6c62bc..9c5895b551a1 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -100,7 +100,7 @@ static int nfs_referral_loop_protect(void) struct nfs_referral_count *p, *new; int ret = -ENOMEM; - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) goto out; new->task = current; diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 523f44a2a416..8c3d2efa2636 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -217,7 +217,7 @@ static struct nfs_createdata *nfs_alloc_createdata(struct inode *dir, { struct nfs_createdata *data; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (data != NULL) { data->arg.fh = NFS_FH(dir); diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c index 2c723d41b7a7..7d8921f524a6 100644 --- a/fs/nfs/sysfs.c +++ b/fs/nfs/sysfs.c @@ -43,7 +43,7 @@ int nfs_sysfs_init(void) { int ret; - nfs_kset = kzalloc_obj(*nfs_kset, GFP_KERNEL); + nfs_kset = kzalloc_obj(*nfs_kset); if (!nfs_kset) return -ENOMEM; @@ -172,7 +172,7 @@ static struct nfs_netns_client *nfs_netns_client_alloc(struct kobject *parent, { struct nfs_netns_client *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (p) { p->net = net; p->kobject.kset = nfs_kset; diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index 2a07899c69af..df3ca4669df6 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -175,7 +175,7 @@ nfs_async_unlink(struct dentry *dentry, const struct qstr *name) int status = -ENOMEM; void *devname_garbage = NULL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (data == NULL) goto out; data->args.name.name = kstrdup(name->name, GFP_KERNEL); @@ -355,7 +355,7 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir, nfs_server_capable(new_dir, NFS_CAP_MOVEABLE)) task_setup_data.flags |= RPC_TASK_MOVEABLE; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (data == NULL) return ERR_PTR(-ENOMEM); task_setup_data.task = &data->task; diff --git a/fs/nfsd/blocklayoutxdr.c b/fs/nfsd/blocklayoutxdr.c index 3c145146a0c8..f80dbc41fd5f 100644 --- a/fs/nfsd/blocklayoutxdr.c +++ b/fs/nfsd/blocklayoutxdr.c @@ -164,7 +164,7 @@ nfsd4_block_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, if (len != expected) return nfserr_bad_xdr; - iomaps = kzalloc_objs(*iomaps, nr_iomaps, GFP_KERNEL); + iomaps = kzalloc_objs(*iomaps, nr_iomaps); if (!iomaps) return nfserr_delay; @@ -258,7 +258,7 @@ nfsd4_scsi_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, if (len != expected) return nfserr_bad_xdr; - iomaps = kzalloc_objs(*iomaps, nr_iomaps, GFP_KERNEL); + iomaps = kzalloc_objs(*iomaps, nr_iomaps); if (!iomaps) return nfserr_delay; diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 8fb394afc3f5..e8441fae01bf 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -234,7 +234,7 @@ static inline void expkey_update(struct cache_head *cnew, static struct cache_head *expkey_alloc(void) { - struct svc_expkey *i = kmalloc_obj(*i, GFP_KERNEL); + struct svc_expkey *i = kmalloc_obj(*i); if (i) return &i->h; else @@ -870,11 +870,11 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem) static struct cache_head *svc_export_alloc(void) { - struct svc_export *i = kmalloc_obj(*i, GFP_KERNEL); + struct svc_export *i = kmalloc_obj(*i); if (!i) return NULL; - i->ex_stats = kmalloc_obj(*(i->ex_stats), GFP_KERNEL); + i->ex_stats = kmalloc_obj(*(i->ex_stats)); if (!i->ex_stats) { kfree(i); return NULL; diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 6b4eeb28c88b..1e2b38ed1d35 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -899,7 +899,7 @@ nfsd_alloc_fcache_disposal(void) { struct nfsd_fcache_disposal *l; - l = kmalloc_obj(*l, GFP_KERNEL); + l = kmalloc_obj(*l); if (!l) return NULL; spin_lock_init(&l->lock); diff --git a/fs/nfsd/flexfilelayout.c b/fs/nfsd/flexfilelayout.c index a65d55bcdc02..6d531285ab43 100644 --- a/fs/nfsd/flexfilelayout.c +++ b/fs/nfsd/flexfilelayout.c @@ -36,7 +36,7 @@ nfsd4_ff_proc_layoutget(struct svc_rqst *rqstp, struct inode *inode, * Zero it out for the stateid - don't want junk in there! */ error = -ENOMEM; - fl = kzalloc_obj(*fl, GFP_KERNEL); + fl = kzalloc_obj(*fl); if (!fl) goto out_error; args->lg_content = fl; @@ -86,7 +86,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, u16 port; char addr[INET6_ADDRSTRLEN]; - da = kzalloc_obj(struct pnfs_ff_device_addr, GFP_KERNEL); + da = kzalloc_obj(struct pnfs_ff_device_addr); if (!da) return nfserrno(-ENOMEM); diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 88782df7c3a1..aea8bdd2fdc4 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1378,7 +1378,7 @@ void nfsd41_cb_referring_call(struct nfsd4_callback *cb, } } if (!found) { - rcl = kmalloc_obj(*rcl, GFP_KERNEL); + rcl = kmalloc_obj(*rcl); if (!rcl) return; memcpy(rcl->rcl_sessionid.data, sessionid->data, @@ -1397,7 +1397,7 @@ void nfsd41_cb_referring_call(struct nfsd4_callback *cb, } } if (!found) { - rc = kmalloc_obj(*rc, GFP_KERNEL); + rc = kmalloc_obj(*rc); if (!rc) goto out; rc->rc_sequenceid = seqno; diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 6415b847a939..ba06d3d3e6dd 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -97,7 +97,7 @@ ent_put(struct kref *ref) static struct cache_head * ent_alloc(void) { - struct ent *e = kmalloc_obj(*e, GFP_KERNEL); + struct ent *e = kmalloc_obj(*e); if (e) return &e->h; else diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 7dbb1dc184db..1d7b50c2cc3d 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -451,7 +451,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, stru int accmode; __be32 status; - *resfh = kmalloc_obj(struct svc_fh, GFP_KERNEL); + *resfh = kmalloc_obj(struct svc_fh); if (!*resfh) return nfserr_jukebox; fh_init(*resfh, NFS4_FHSIZE); @@ -1630,7 +1630,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr, __be32 status = 0; *nsui = NULL; - work = kzalloc_obj(*work, GFP_KERNEL); + work = kzalloc_obj(*work); try_again: spin_lock(&nn->nfsd_ssc_lock); list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) { @@ -2160,7 +2160,7 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, memcpy(©->fh, &cstate->current_fh.fh_handle, sizeof(struct knfsd_fh)); if (nfsd4_copy_is_async(copy)) { - async_copy = kzalloc_obj(struct nfsd4_copy, GFP_KERNEL); + async_copy = kzalloc_obj(struct nfsd4_copy); if (!async_copy) goto out_err; async_copy->cp_nn = nn; diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 87de08c7f405..f72bffca6e0e 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -203,7 +203,7 @@ nfsd4_build_namelist(struct dir_context *__ctx, const char *name, int namlen, if (namlen != HEXDIR_LEN - 1) return true; - entry = kmalloc_obj(struct name_list, GFP_KERNEL); + entry = kmalloc_obj(struct name_list); if (entry == NULL) return false; memcpy(entry->name, name, HEXDIR_LEN - 1); @@ -897,7 +897,7 @@ __nfsd4_init_cld_pipe(struct net *net) if (nn->cld_net) return 0; - cn = kzalloc_obj(*cn, GFP_KERNEL); + cn = kzalloc_obj(*cn); if (!cn) { ret = -ENOMEM; goto err; @@ -959,7 +959,7 @@ alloc_cld_upcall(struct nfsd_net *nn) struct cld_upcall *new, *tmp; struct cld_net *cn = nn->cld_net; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return new; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index fb5b2ff4201e..90dc841c2157 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -299,7 +299,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh, nbl = find_blocked_lock(lo, fh, nn); if (!nbl) { - nbl = kmalloc_obj(*nbl, GFP_KERNEL); + nbl = kmalloc_obj(*nbl); if (nbl) { INIT_LIST_HEAD(&nbl->nbl_list); INIT_LIST_HEAD(&nbl->nbl_lru); @@ -974,7 +974,7 @@ struct nfs4_cpntf_state *nfs4_alloc_init_cpntf_state(struct nfsd_net *nn, { struct nfs4_cpntf_state *cps; - cps = kzalloc_obj(struct nfs4_cpntf_state, GFP_KERNEL); + cps = kzalloc_obj(struct nfs4_cpntf_state); if (!cps) return NULL; cps->cpntf_time = ktime_get_boottime_seconds(); @@ -2047,7 +2047,7 @@ static struct nfsd4_session *alloc_session(struct nfsd4_channel_attrs *fattrs, struct nfsd4_slot *slot; int i; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; xa_init(&new->se_slots); @@ -2108,7 +2108,7 @@ static struct nfsd4_conn *alloc_conn(struct svc_rqst *rqstp, u32 flags) { struct nfsd4_conn *conn; - conn = kmalloc_obj(struct nfsd4_conn, GFP_KERNEL); + conn = kmalloc_obj(struct nfsd4_conn); if (!conn) return NULL; svc_xprt_get(rqstp->rq_xprt); @@ -3308,7 +3308,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, free_client(clp); return NULL; } - clp->cl_ra = kzalloc_obj(*clp->cl_ra, GFP_KERNEL); + clp->cl_ra = kzalloc_obj(*clp->cl_ra); if (!clp->cl_ra) { free_client(clp); return NULL; @@ -8822,7 +8822,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, static inline struct nfs4_client_reclaim * alloc_reclaim(void) { - return kmalloc_obj(struct nfs4_client_reclaim, GFP_KERNEL); + return kmalloc_obj(struct nfs4_client_reclaim); } bool diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index c96d31b7846e..1bee0870d1c7 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2184,7 +2184,7 @@ nfsd4_decode_copy(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u) if (status) return status; - ns_dummy = kmalloc_obj(struct nl4_server, GFP_KERNEL); + ns_dummy = kmalloc_obj(struct nl4_server); if (ns_dummy == NULL) return nfserr_jukebox; for (i = 0; i < count - 1; i++) { @@ -3956,7 +3956,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr, } if ((attrmask[0] & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && !fhp) { - tempfh = kmalloc_obj(struct svc_fh, GFP_KERNEL); + tempfh = kmalloc_obj(struct svc_fh); status = nfserr_jukebox; if (!tempfh) goto out; diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 777b7bb9aeca..e9acd2cd602c 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -477,7 +477,7 @@ static ssize_t write_pool_threads(struct file *file, char *buf, size_t size) return strlen(buf); } - nthreads = kzalloc_objs(int, npools, GFP_KERNEL); + nthreads = kzalloc_objs(int, npools); rv = -ENOMEM; if (nthreads == NULL) goto out_free; @@ -1596,7 +1596,7 @@ int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info) mutex_lock(&nfsd_mutex); - nthreads = kzalloc_objs(int, nrpools, GFP_KERNEL); + nthreads = kzalloc_objs(int, nrpools); if (!nthreads) { ret = -ENOMEM; goto out_unlock; diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 21c5539c7e84..098a3bd103e0 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2701,7 +2701,7 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct super_block *sb, struct the_nilfs *nilfs = sb->s_fs_info; struct nilfs_sc_info *sci; - sci = kzalloc_obj(*sci, GFP_KERNEL); + sci = kzalloc_obj(*sci); if (!sci) return NULL; diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 55fac3f83232..7aa5ef8606cd 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1292,7 +1292,7 @@ static int nilfs_init_fs_context(struct fs_context *fc) { struct nilfs_fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index f481532ea8e9..7b23e373a106 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -56,7 +56,7 @@ struct the_nilfs *alloc_nilfs(struct super_block *sb) { struct the_nilfs *nilfs; - nilfs = kzalloc_obj(*nilfs, GFP_KERNEL); + nilfs = kzalloc_obj(*nilfs); if (!nilfs) return NULL; @@ -877,7 +877,7 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno) if (root) return root; - new = kzalloc_obj(*root, GFP_KERNEL); + new = kzalloc_obj(*root); if (!new) return NULL; diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 691d36104ae2..c2ed5b11b0fe 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -644,7 +644,7 @@ static int fsnotify_attach_info_to_sb(struct super_block *sb) struct fsnotify_sb_info *sbinfo; /* sb info is freed on fsnotify_sb_delete() */ - sbinfo = kzalloc_obj(*sbinfo, GFP_KERNEL); + sbinfo = kzalloc_obj(*sbinfo); if (!sbinfo) return -ENOMEM; diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index ce8ce1470981..344fd4d95fbc 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -1202,7 +1202,7 @@ static int ocfs2_add_branch(handle_t *handle, } /* allocate the number of new eb blocks we need */ - new_eb_bhs = kzalloc_objs(struct buffer_head *, new_blocks, GFP_KERNEL); + new_eb_bhs = kzalloc_objs(struct buffer_head *, new_blocks); if (!new_eb_bhs) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 91fb76a43900..ace7debb2f0d 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -2001,7 +2001,7 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g struct o2hb_region *reg = NULL; int ret; - reg = kzalloc_obj(struct o2hb_region, GFP_KERNEL); + reg = kzalloc_obj(struct o2hb_region); if (reg == NULL) return ERR_PTR(-ENOMEM); @@ -2211,7 +2211,7 @@ struct config_group *o2hb_alloc_hb_set(void) struct o2hb_heartbeat_group *hs = NULL; struct config_group *ret = NULL; - hs = kzalloc_obj(struct o2hb_heartbeat_group, GFP_KERNEL); + hs = kzalloc_obj(struct o2hb_heartbeat_group); if (hs == NULL) goto out; diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index 2cb3162aeb89..f7ab66e70799 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c @@ -380,7 +380,7 @@ static int sc_common_open(struct file *file, int ctxt) struct o2net_sock_debug *sd; struct o2net_sock_container *dummy_sc; - dummy_sc = kzalloc_obj(*dummy_sc, GFP_KERNEL); + dummy_sc = kzalloc_obj(*dummy_sc); if (!dummy_sc) return -ENOMEM; diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index 6fb8bc38c0f7..402563154550 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c @@ -587,7 +587,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group, if (strlen(name) > O2NM_MAX_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); - node = kzalloc_obj(struct o2nm_node, GFP_KERNEL); + node = kzalloc_obj(struct o2nm_node); if (node == NULL) return ERR_PTR(-ENOMEM); @@ -695,8 +695,8 @@ static struct config_group *o2nm_cluster_group_make_group(struct config_group *g if (o2nm_single_cluster) return ERR_PTR(-ENOSPC); - cluster = kzalloc_obj(struct o2nm_cluster, GFP_KERNEL); - ns = kzalloc_obj(struct o2nm_node_group, GFP_KERNEL); + cluster = kzalloc_obj(struct o2nm_cluster); + ns = kzalloc_obj(struct o2nm_node_group); o2hb_group = o2hb_alloc_hb_set(); if (cluster == NULL || ns == NULL || o2hb_group == NULL) goto out; diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index ff4868619d35..70ca79e4bdc3 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -1048,7 +1048,7 @@ static int dlm_send_regions(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qr = kzalloc_obj(struct dlm_query_region, GFP_KERNEL); + qr = kzalloc_obj(struct dlm_query_region); if (!qr) { ret = -ENOMEM; mlog_errno(ret); @@ -1220,7 +1220,7 @@ static int dlm_send_nodeinfo(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qn = kzalloc_obj(struct dlm_query_nodeinfo, GFP_KERNEL); + qn = kzalloc_obj(struct dlm_query_nodeinfo); if (!qn) { ret = -ENOMEM; mlog_errno(ret); @@ -1592,7 +1592,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm) mlog(0, "%p", dlm); - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) { status = -ENOMEM; mlog_errno(status); @@ -1946,7 +1946,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, int ret; struct dlm_ctxt *dlm = NULL; - dlm = kzalloc_obj(*dlm, GFP_KERNEL); + dlm = kzalloc_obj(*dlm); if (!dlm) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 627d488b0148..bd2ddb7d841d 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3030,7 +3030,7 @@ struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void) { struct ocfs2_dlm_debug *dlm_debug; - dlm_debug = kmalloc_obj(struct ocfs2_dlm_debug, GFP_KERNEL); + dlm_debug = kmalloc_obj(struct ocfs2_dlm_debug); if (!dlm_debug) { mlog_errno(-ENOMEM); goto out; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 70879058b0c9..7df9921c1a38 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -54,7 +54,7 @@ static int ocfs2_init_file_private(struct inode *inode, struct file *file) { struct ocfs2_file_private *fp; - fp = kzalloc_obj(struct ocfs2_file_private, GFP_KERNEL); + fp = kzalloc_obj(struct ocfs2_file_private); if (!fp) return -ENOMEM; diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index 872b826979ec..bfed0fb35f9b 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@ -334,7 +334,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *inode_alloc = NULL; - oifi = kzalloc_obj(struct ocfs2_info_freeinode, GFP_KERNEL); + oifi = kzalloc_obj(struct ocfs2_info_freeinode); if (!oifi) { status = -ENOMEM; mlog_errno(status); @@ -620,7 +620,7 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *gb_inode = NULL; - oiff = kzalloc_obj(struct ocfs2_info_freefrag, GFP_KERNEL); + oiff = kzalloc_obj(struct ocfs2_info_freefrag); if (!oiff) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 1b9359304aef..6755f38920bc 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -876,7 +876,7 @@ int ocfs2_journal_alloc(struct ocfs2_super *osb) int status = 0; struct ocfs2_journal *journal; - journal = kzalloc_obj(struct ocfs2_journal, GFP_KERNEL); + journal = kzalloc_obj(struct ocfs2_journal); if (!journal) { mlog(ML_ERROR, "unable to alloc journal\n"); status = -ENOMEM; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 29fa6fb11ea5..82d290cf4432 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -1094,7 +1094,7 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb, { int status; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 85ad1a9db734..268b79339a51 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -1736,7 +1736,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, goto bail; } - bhs = kzalloc_objs(struct buffer_head *, blocks, GFP_KERNEL); + bhs = kzalloc_objs(struct buffer_head *, blocks); if (!bhs) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index 78a97c37398b..7a55b1a071db 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -334,7 +334,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn) goto out; } - priv = kzalloc_obj(struct o2dlm_private, GFP_KERNEL); + priv = kzalloc_obj(struct o2dlm_private); if (!priv) { rc = -ENOMEM; goto out_free; diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 11b34407de36..5803f1dee679 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -593,7 +593,7 @@ static int ocfs2_control_open(struct inode *inode, struct file *file) { struct ocfs2_control_private *p; - p = kzalloc_obj(struct ocfs2_control_private, GFP_KERNEL); + p = kzalloc_obj(struct ocfs2_control_private); if (!p) return -ENOMEM; p->op_this_node = -1; @@ -967,7 +967,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn) BUG_ON(conn == NULL); - lc = kzalloc_obj(struct ocfs2_live_connection, GFP_KERNEL); + lc = kzalloc_obj(struct ocfs2_live_connection); if (!lc) return -ENOMEM; diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 46ff5835da2e..741d6191d871 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -328,7 +328,7 @@ int ocfs2_cluster_connect(const char *stack_name, goto out; } - new_conn = kzalloc_obj(struct ocfs2_cluster_connection, GFP_KERNEL); + new_conn = kzalloc_obj(struct ocfs2_cluster_connection); if (!new_conn) { rc = -ENOMEM; goto out; diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 872c7b303a3c..bb98bd51338e 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -1034,7 +1034,7 @@ int ocfs2_reserve_new_metadata_blocks(struct ocfs2_super *osb, int status; int slot = ocfs2_get_meta_steal_slot(osb); - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1105,7 +1105,7 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, int slot = ocfs2_get_inode_steal_slot(osb); u64 alloc_group; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1221,7 +1221,7 @@ static int ocfs2_reserve_clusters_with_limit(struct ocfs2_super *osb, int status, ret = 0; int retried = 0; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 9779f524ff1a..d7c58fd7d438 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1200,7 +1200,7 @@ static int ocfs2_init_fs_context(struct fs_context *fc) { struct mount_options *mopt; - mopt = kzalloc_obj(struct mount_options, GFP_KERNEL); + mopt = kzalloc_obj(struct mount_options); if (!mopt) return -EINVAL; @@ -1953,7 +1953,7 @@ static int ocfs2_initialize_super(struct super_block *sb, struct ocfs2_super *osb; u64 total_blocks; - osb = kzalloc_obj(struct ocfs2_super, GFP_KERNEL); + osb = kzalloc_obj(struct ocfs2_super); if (!osb) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index ba2a581f7ab7..90ae07c69349 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -464,7 +464,7 @@ static int omfs_fill_super(struct super_block *sb, struct fs_context *fc) int ret = -EINVAL; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc_obj(struct omfs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct omfs_sb_info); if (!sbi) return -ENOMEM; @@ -612,7 +612,7 @@ static int omfs_init_fs_context(struct fs_context *fc) { struct omfs_mount_options *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index 84db9f0db9df..6e2ebc8b9867 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -363,7 +363,7 @@ static int orangefs_dir_iterate(struct file *file, static int orangefs_dir_open(struct inode *inode, struct file *file) { struct orangefs_dir *od; - file->private_data = kmalloc_obj(struct orangefs_dir, GFP_KERNEL); + file->private_data = kmalloc_obj(struct orangefs_dir); if (!file->private_data) return -ENOMEM; od = file->private_data; diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 50836be41cd2..2d4710d0e05e 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -184,16 +184,16 @@ static int orangefs_writepages(struct address_space *mapping, int error; struct folio *folio = NULL; - ow = kzalloc_obj(struct orangefs_writepages, GFP_KERNEL); + ow = kzalloc_obj(struct orangefs_writepages); if (!ow) return -ENOMEM; ow->maxpages = orangefs_bufmap_size_query()/PAGE_SIZE; - ow->folios = kzalloc_objs(struct folio *, ow->maxpages, GFP_KERNEL); + ow->folios = kzalloc_objs(struct folio *, ow->maxpages); if (!ow->folios) { kfree(ow); return -ENOMEM; } - ow->bv = kzalloc_objs(struct bio_vec, ow->maxpages, GFP_KERNEL); + ow->bv = kzalloc_objs(struct bio_vec, ow->maxpages); if (!ow->bv) { kfree(ow->folios); kfree(ow); @@ -328,7 +328,7 @@ static int orangefs_write_begin(const struct kiocb *iocb, } } - wr = kmalloc_obj(*wr, GFP_KERNEL); + wr = kmalloc_obj(*wr); if (!wr) return -ENOMEM; @@ -644,7 +644,7 @@ vm_fault_t orangefs_page_mkwrite(struct vm_fault *vmf) } } } - wr = kmalloc_obj(*wr, GFP_KERNEL); + wr = kmalloc_obj(*wr); if (!wr) { ret = VM_FAULT_LOCKED|VM_FAULT_RETRY; goto out; diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index bad105dd10fa..c54266c75eed 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -205,7 +205,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) { struct orangefs_bufmap *bufmap; - bufmap = kzalloc_obj(*bufmap, GFP_KERNEL); + bufmap = kzalloc_obj(*bufmap); if (!bufmap) goto out; @@ -228,7 +228,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) /* allocate storage to track our page mappings */ bufmap->page_array = - kzalloc_objs(struct page *, bufmap->page_count, GFP_KERNEL); + kzalloc_objs(struct page *, bufmap->page_count); if (!bufmap->page_array) goto out_free_desc_array; diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index 229981c310bd..e82b934ed074 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -560,7 +560,7 @@ static int orangefs_prepare_cdm_array(char *debug_array_string) goto out; } - cdm_array = kzalloc_objs(*cdm_array, cdm_element_count, GFP_KERNEL); + cdm_array = kzalloc_objs(*cdm_array, cdm_element_count); if (!cdm_array) { rc = -ENOMEM; goto out; diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c index 30bc3c17daa4..f591f09531da 100644 --- a/fs/orangefs/orangefs-mod.c +++ b/fs/orangefs/orangefs-mod.c @@ -99,7 +99,7 @@ static int __init orangefs_init(void) goto cleanup_op; orangefs_htable_ops_in_progress = - kzalloc_objs(struct list_head, hash_table_size, GFP_KERNEL); + kzalloc_objs(struct list_head, hash_table_size); if (!orangefs_htable_ops_in_progress) { ret = -ENOMEM; goto cleanup_inode; diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c index 8ea25b71b1fb..a02bfc7b3542 100644 --- a/fs/orangefs/orangefs-sysfs.c +++ b/fs/orangefs/orangefs-sysfs.c @@ -1170,7 +1170,7 @@ int orangefs_sysfs_init(void) gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_init: start\n"); /* create /sys/fs/orangefs. */ - orangefs_obj = kzalloc_obj(*orangefs_obj, GFP_KERNEL); + orangefs_obj = kzalloc_obj(*orangefs_obj); if (!orangefs_obj) goto out; @@ -1185,7 +1185,7 @@ int orangefs_sysfs_init(void) kobject_uevent(orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/acache. */ - acache_orangefs_obj = kzalloc_obj(*acache_orangefs_obj, GFP_KERNEL); + acache_orangefs_obj = kzalloc_obj(*acache_orangefs_obj); if (!acache_orangefs_obj) { rc = -EINVAL; goto ofs_obj_bail; @@ -1202,7 +1202,7 @@ int orangefs_sysfs_init(void) kobject_uevent(acache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/capcache. */ - capcache_orangefs_obj = kzalloc_obj(*capcache_orangefs_obj, GFP_KERNEL); + capcache_orangefs_obj = kzalloc_obj(*capcache_orangefs_obj); if (!capcache_orangefs_obj) { rc = -EINVAL; goto acache_obj_bail; @@ -1218,7 +1218,7 @@ int orangefs_sysfs_init(void) kobject_uevent(capcache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ccache. */ - ccache_orangefs_obj = kzalloc_obj(*ccache_orangefs_obj, GFP_KERNEL); + ccache_orangefs_obj = kzalloc_obj(*ccache_orangefs_obj); if (!ccache_orangefs_obj) { rc = -EINVAL; goto capcache_obj_bail; @@ -1234,7 +1234,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ccache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ncache. */ - ncache_orangefs_obj = kzalloc_obj(*ncache_orangefs_obj, GFP_KERNEL); + ncache_orangefs_obj = kzalloc_obj(*ncache_orangefs_obj); if (!ncache_orangefs_obj) { rc = -EINVAL; goto ccache_obj_bail; @@ -1251,7 +1251,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ncache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/perf_counters. */ - pc_orangefs_obj = kzalloc_obj(*pc_orangefs_obj, GFP_KERNEL); + pc_orangefs_obj = kzalloc_obj(*pc_orangefs_obj); if (!pc_orangefs_obj) { rc = -EINVAL; goto ncache_obj_bail; @@ -1268,7 +1268,7 @@ int orangefs_sysfs_init(void) kobject_uevent(pc_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/stats. */ - stats_orangefs_obj = kzalloc_obj(*stats_orangefs_obj, GFP_KERNEL); + stats_orangefs_obj = kzalloc_obj(*stats_orangefs_obj); if (!stats_orangefs_obj) { rc = -EINVAL; goto pc_obj_bail; diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 3030509ddeaf..4ec7329b41f6 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -578,7 +578,7 @@ int orangefs_init_fs_context(struct fs_context *fc) { struct orangefs_sb_info_s *osi; - osi = kzalloc_obj(struct orangefs_sb_info_s, GFP_KERNEL); + osi = kzalloc_obj(struct orangefs_sb_info_s); if (!osi) return -ENOMEM; diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 44712bcdcef7..1b372189cd10 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -171,7 +171,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, " does not exist!\n", get_khandle_from_ino(inode), (char *)new_op->upcall.req.getxattr.key); - cx = kmalloc_obj(*cx, GFP_KERNEL); + cx = kmalloc_obj(*cx); if (cx) { strscpy(cx->key, name); cx->length = -1; @@ -225,7 +225,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, cx->length = length; cx->timeout = jiffies + HZ; } else { - cx = kmalloc_obj(*cx, GFP_KERNEL); + cx = kmalloc_obj(*cx); if (cx) { strscpy(cx->key, name); memcpy(cx->val, buffer, length); diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 7f7a2c2a7937..97bed2286030 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -96,7 +96,7 @@ struct ovl_file { struct ovl_file *ovl_file_alloc(struct file *realfile) { - struct ovl_file *of = kzalloc_obj(struct ovl_file, GFP_KERNEL); + struct ovl_file *of = kzalloc_obj(struct ovl_file); if (unlikely(!of)) return NULL; diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index f30b81ee0d9b..d8dd4b052984 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -481,7 +481,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, goto invalid; if (!*stackp) - *stackp = kmalloc_obj(struct ovl_path, GFP_KERNEL); + *stackp = kmalloc_obj(struct ovl_path); if (!*stackp) { dput(origin); return -ENOMEM; diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c index af735a0c310a..8111b437ae5d 100644 --- a/fs/overlayfs/params.c +++ b/fs/overlayfs/params.c @@ -790,7 +790,7 @@ int ovl_init_fs_context(struct fs_context *fc) goto out_err; ctx->capacity = 3; - ofs = kzalloc_obj(struct ovl_fs, GFP_KERNEL); + ofs = kzalloc_obj(struct ovl_fs); if (!ofs) goto out_err; diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 953c2cdca1b4..a4271e5fb8e6 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -493,7 +493,7 @@ static struct ovl_dir_cache *ovl_cache_get(struct dentry *dentry) } ovl_set_dir_cache(d_inode(dentry), NULL); - cache = kzalloc_obj(struct ovl_dir_cache, GFP_KERNEL); + cache = kzalloc_obj(struct ovl_dir_cache); if (!cache) return ERR_PTR(-ENOMEM); @@ -706,7 +706,7 @@ static struct ovl_dir_cache *ovl_cache_get_impure(const struct path *path) ovl_dir_cache_free(inode); ovl_set_dir_cache(inode, NULL); - cache = kzalloc_obj(struct ovl_dir_cache, GFP_KERNEL); + cache = kzalloc_obj(struct ovl_dir_cache); if (!cache) return ERR_PTR(-ENOMEM); diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index f3a39b7703f5..d4c12feec039 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1031,7 +1031,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, unsigned int i; size_t nr_merged_lower; - ofs->fs = kzalloc_objs(struct ovl_sb, ctx->nr + 2, GFP_KERNEL); + ofs->fs = kzalloc_objs(struct ovl_sb, ctx->nr + 2); if (ofs->fs == NULL) return -ENOMEM; @@ -1393,7 +1393,7 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb) } err = -ENOMEM; - layers = kzalloc_objs(struct ovl_layer, ctx->nr + 1, GFP_KERNEL); + layers = kzalloc_objs(struct ovl_layer, ctx->nr + 1); if (!layers) return err; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index a28524e83662..4eeafd943fb9 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -113,7 +113,7 @@ bool ovl_verify_lower(struct super_block *sb) struct ovl_path *ovl_stack_alloc(unsigned int n) { - return kzalloc_objs(struct ovl_path, n, GFP_KERNEL); + return kzalloc_objs(struct ovl_path, n); } void ovl_stack_cpy(struct ovl_path *dst, struct ovl_path *src, unsigned int n) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 55438bc0afc8..390547b992ac 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -143,7 +143,7 @@ static int kcore_ram_list(struct list_head *head) { struct kcore_list *ent; - ent = kmalloc_obj(*ent, GFP_KERNEL); + ent = kmalloc_obj(*ent); if (!ent) return -ENOMEM; ent->addr = (unsigned long)__va(0); @@ -178,7 +178,7 @@ get_sparsemem_vmemmap_info(struct kcore_list *ent, struct list_head *head) end = tmp->addr; } if (start < end) { - vmm = kmalloc_obj(*vmm, GFP_KERNEL); + vmm = kmalloc_obj(*vmm); if (!vmm) return 0; vmm->addr = start; @@ -210,7 +210,7 @@ kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg) p = pfn_to_page(pfn); - ent = kmalloc_obj(*ent, GFP_KERNEL); + ent = kmalloc_obj(*ent); if (!ent) return -ENOMEM; ent->addr = (unsigned long)page_to_virt(p); diff --git a/fs/proc/root.c b/fs/proc/root.c index fb0ccacb08e6..0f9100559471 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -249,7 +249,7 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc) struct proc_fs_info *fs_info; int ret; - fs_info = kzalloc_obj(*fs_info, GFP_KERNEL); + fs_info = kzalloc_obj(*fs_info); if (!fs_info) return -ENOMEM; @@ -331,7 +331,7 @@ static int proc_init_fs_context(struct fs_context *fc) { struct proc_fs_context *ctx; - ctx = kzalloc_obj(struct proc_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct proc_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 0418511f69fe..e091931d7ca1 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2981,7 +2981,7 @@ static int pagemap_scan_init_bounce_buffer(struct pagemap_scan_private *p) p->vec_buf_len = min_t(size_t, PAGEMAP_WALK_SIZE >> PAGE_SHIFT, p->arg.vec_len); - p->vec_buf = kmalloc_objs(*p->vec_buf, p->vec_buf_len, GFP_KERNEL); + p->vec_buf = kmalloc_objs(*p->vec_buf, p->vec_buf_len); if (!p->vec_buf) return -ENOMEM; diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index 0c9c8b6fdbb8..12070b6a7b11 100644 --- a/fs/pstore/blk.c +++ b/fs/pstore/blk.c @@ -297,7 +297,7 @@ static int __init __best_effort_init(void) return -EINVAL; } - best_effort_dev = kzalloc_obj(*best_effort_dev, GFP_KERNEL); + best_effort_dev = kzalloc_obj(*best_effort_dev); if (!best_effort_dev) return -ENOMEM; diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 8ebcd231e09a..83fa0bb3435a 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -70,7 +70,7 @@ static void *pstore_ftrace_seq_start(struct seq_file *s, loff_t *pos) struct pstore_private *ps = s->private; struct pstore_ftrace_seq_data *data __free(kfree) = NULL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; @@ -365,7 +365,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) record->psi->name, record->id, record->compressed ? ".enc.z" : ""); - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; @@ -477,7 +477,7 @@ static int pstore_init_fs_context(struct fs_context *fc) { struct pstore_context *ctx; - ctx = kzalloc_obj(struct pstore_context, GFP_KERNEL); + ctx = kzalloc_obj(struct pstore_context); if (!ctx) return -ENOMEM; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index ff9603bb89db..1d76c9d92056 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -683,7 +683,7 @@ void pstore_get_backend_records(struct pstore_info *psi, struct pstore_record *record; int rc; - record = kzalloc_obj(*record, GFP_KERNEL); + record = kzalloc_obj(*record); if (!record) { pr_err("out of memory creating record\n"); break; diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 79f801c913bf..c1cbf2fd1c0f 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -539,7 +539,7 @@ static int ramoops_init_przs(const char *name, goto fail; } - prz_ar = kzalloc_objs(**przs, *cnt, GFP_KERNEL); + prz_ar = kzalloc_objs(**przs, *cnt); if (!prz_ar) goto fail; diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 49d022b85d8a..7930c886dbf5 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -438,7 +438,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size, return NULL; } - pages = kmalloc_objs(struct page *, page_count, GFP_KERNEL); + pages = kmalloc_objs(struct page *, page_count); if (!pages) { pr_err("%s: Failed to allocate array for %u pages\n", __func__, page_count); @@ -605,7 +605,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, struct persistent_ram_zone *prz; int ret = -ENOMEM; - prz = kzalloc_obj(struct persistent_ram_zone, GFP_KERNEL); + prz = kzalloc_obj(struct persistent_ram_zone); if (!prz) { pr_err("failed to allocate persistent ram zone\n"); goto err; diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index 6687d255a36b..a3b003f9a3a0 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -1166,7 +1166,7 @@ static struct pstore_zone *psz_init_zone(enum pstore_type_id type, return ERR_PTR(-ENOMEM); } - zone = kzalloc_obj(struct pstore_zone, GFP_KERNEL); + zone = kzalloc_obj(struct pstore_zone); if (!zone) return ERR_PTR(-ENOMEM); @@ -1218,7 +1218,7 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type, return ERR_PTR(-EINVAL); } - zones = kzalloc_objs(*zones, c, GFP_KERNEL); + zones = kzalloc_objs(*zones, c); if (!zones) { pr_err("allocate for zones %s failed\n", name); return ERR_PTR(-ENOMEM); diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index e8c4de5de7be..8aeb63d397cf 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -197,7 +197,7 @@ static int qnx4_fill_super(struct super_block *s, struct fs_context *fc) struct qnx4_sb_info *qs; int silent = fc->sb_flags & SB_SILENT; - qs = kzalloc_obj(struct qnx4_sb_info, GFP_KERNEL); + qs = kzalloc_obj(struct qnx4_sb_info); if (!qs) return -ENOMEM; s->s_fs_info = qs; diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index de1e1a61810d..c4049bb8bd60 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -302,7 +302,7 @@ static int qnx6_fill_super(struct super_block *s, struct fs_context *fc) int bootblock_offset = QNX6_BOOTBLOCK_SIZE; int silent = fc->sb_flags & SB_SILENT; - qs = kzalloc_obj(struct qnx6_sb_info, GFP_KERNEL); + qs = kzalloc_obj(struct qnx6_sb_info); if (!qs) return -ENOMEM; s->s_fs_info = qs; @@ -645,7 +645,7 @@ static int qnx6_init_fs_context(struct fs_context *fc) { struct qnx6_context *ctx; - ctx = kzalloc_obj(struct qnx6_context, GFP_KERNEL); + ctx = kzalloc_obj(struct qnx6_context); if (!ctx) return -ENOMEM; fc->ops = &qnx6_context_ops; diff --git a/fs/qnx6/super_mmi.c b/fs/qnx6/super_mmi.c index d36ade7fc477..b8afb6f388b2 100644 --- a/fs/qnx6/super_mmi.c +++ b/fs/qnx6/super_mmi.c @@ -100,7 +100,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) goto out; } - qsb = kmalloc_obj(*qsb, GFP_KERNEL); + qsb = kmalloc_obj(*qsb); if (!qsb) { pr_err("unable to allocate memory.\n"); goto out; diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index d022b18782c6..a24fab5f9f80 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -121,7 +121,7 @@ static int v2_read_file_info(struct super_block *sb, int type) ret = -EIO; goto out; } - info->dqi_priv = kmalloc_obj(struct qtree_mem_dqinfo, GFP_KERNEL); + info->dqi_priv = kmalloc_obj(struct qtree_mem_dqinfo); if (!info->dqi_priv) { ret = -ENOMEM; goto out; diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index d084b6804b65..3987639ed132 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -298,7 +298,7 @@ int ramfs_init_fs_context(struct fs_context *fc) { struct ramfs_fs_info *fsi; - fsi = kzalloc_obj(*fsi, GFP_KERNEL); + fsi = kzalloc_obj(*fsi); if (!fsi) return -ENOMEM; diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 6fd5c0e8a0dd..49f3f6b846b2 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -923,7 +923,7 @@ int setup_rmid_lru_list(void) return 0; idx_limit = resctrl_arch_system_num_rmid_idx(); - rmid_ptrs = kzalloc_objs(struct rmid_entry, idx_limit, GFP_KERNEL); + rmid_ptrs = kzalloc_objs(struct rmid_entry, idx_limit); if (!rmid_ptrs) return -ENOMEM; diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c index 55e71d257324..fa3687d69ebd 100644 --- a/fs/resctrl/pseudo_lock.c +++ b/fs/resctrl/pseudo_lock.c @@ -154,7 +154,7 @@ static int pseudo_lock_cstates_constrain(struct pseudo_lock_region *plr) int ret; for_each_cpu(cpu, &plr->d->hdr.cpu_mask) { - pm_req = kzalloc_obj(*pm_req, GFP_KERNEL); + pm_req = kzalloc_obj(*pm_req); if (!pm_req) { rdt_last_cmd_puts("Failure to allocate memory for PM QoS\n"); ret = -ENOMEM; @@ -270,7 +270,7 @@ static int pseudo_lock_init(struct rdtgroup *rdtgrp) { struct pseudo_lock_region *plr; - plr = kzalloc_obj(*plr, GFP_KERNEL); + plr = kzalloc_obj(*plr); if (!plr) return -ENOMEM; diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 1135208adafb..5da305bd36c9 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2686,7 +2686,7 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type const char *suffix = ""; int ret, cl; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; @@ -2966,7 +2966,7 @@ static int rdt_init_fs_context(struct fs_context *fc) { struct rdt_fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; @@ -3117,7 +3117,7 @@ static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid, return priv; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; @@ -3753,7 +3753,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, } /* allocate the rdtgroup. */ - rdtgrp = kzalloc_obj(*rdtgrp, GFP_KERNEL); + rdtgrp = kzalloc_obj(*rdtgrp); if (!rdtgrp) { ret = -ENOSPC; rdt_last_cmd_puts("Kernel out of memory\n"); diff --git a/fs/signalfd.c b/fs/signalfd.c index 0b663f9c1cff..dff53745e352 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -264,7 +264,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags) int fd; struct signalfd_ctx *ctx __free(kfree) = NULL; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c index 94574dab56f6..c327c246a9b4 100644 --- a/fs/smb/client/cached_dir.c +++ b/fs/smb/client/cached_dir.c @@ -813,7 +813,7 @@ struct cached_fids *init_cached_dirs(void) { struct cached_fids *cfids; - cfids = kzalloc_obj(*cfids, GFP_KERNEL); + cfids = kzalloc_obj(*cfids); if (!cfids) return NULL; spin_lock_init(&cfids->cfid_list_lock); diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c index 85ffb8cfe320..6fa12c901c14 100644 --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -805,7 +805,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl, offsetof(struct smb_sid, sub_auth) + sizeof(__le16))) return; - ppace = kmalloc_objs(struct smb_ace *, num_aces, GFP_KERNEL); + ppace = kmalloc_objs(struct smb_ace *, num_aces); if (!ppace) return; @@ -1331,7 +1331,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd, if (uid_valid(uid)) { /* chown */ uid_t id; - nowner_sid_ptr = kzalloc_obj(struct smb_sid, GFP_KERNEL); + nowner_sid_ptr = kzalloc_obj(struct smb_sid); if (!nowner_sid_ptr) { rc = -ENOMEM; goto chown_chgrp_exit; @@ -1359,7 +1359,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd, } if (gid_valid(gid)) { /* chgrp */ gid_t id; - ngroup_sid_ptr = kzalloc_obj(struct smb_sid, GFP_KERNEL); + ngroup_sid_ptr = kzalloc_obj(struct smb_sid); if (!ngroup_sid_ptr) { rc = -ENOMEM; goto chown_chgrp_exit; diff --git a/fs/smb/client/cifsencrypt.c b/fs/smb/client/cifsencrypt.c index b717b348e98e..3d731f3af235 100644 --- a/fs/smb/client/cifsencrypt.c +++ b/fs/smb/client/cifsencrypt.c @@ -500,7 +500,7 @@ calc_seckey(struct cifs_ses *ses) get_random_bytes(sec_key, CIFS_SESS_KEY_SIZE); - ctx_arc4 = kmalloc_obj(*ctx_arc4, GFP_KERNEL); + ctx_arc4 = kmalloc_obj(*ctx_arc4); if (!ctx_arc4) { cifs_dbg(VFS, "Could not allocate arc4 context\n"); return -ENOMEM; diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 85a53cd77f9e..99b04234a08e 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1016,11 +1016,11 @@ cifs_smb3_do_mount(struct file_system_type *fs_type, } else { cifs_info("Attempting to mount %s\n", old_ctx->source); } - cifs_sb = kzalloc_obj(*cifs_sb, GFP_KERNEL); + cifs_sb = kzalloc_obj(*cifs_sb); if (!cifs_sb) return ERR_PTR(-ENOMEM); - cifs_sb->ctx = kzalloc_obj(struct smb3_fs_context, GFP_KERNEL); + cifs_sb->ctx = kzalloc_obj(struct smb3_fs_context); if (!cifs_sb->ctx) { root = ERR_PTR(-ENOMEM); goto out; diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c index ae536aa63ef1..3d1e73f5d9af 100644 --- a/fs/smb/client/compress.c +++ b/fs/smb/client/compress.c @@ -229,7 +229,7 @@ static bool is_compressible(const struct iov_iter *data) if (has_repeated_data(sample, len)) goto out; - bkt = kzalloc_objs(*bkt, bkt_size, GFP_KERNEL); + bkt = kzalloc_objs(*bkt, bkt_size); if (!bkt) { WARN_ON_ONCE(1); ret = false; diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index c7ed2ffb66ee..33dfe116ca52 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -1755,7 +1755,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx, if (tcp_ses) return tcp_ses; - tcp_ses = kzalloc_obj(struct TCP_Server_Info, GFP_KERNEL); + tcp_ses = kzalloc_obj(struct TCP_Server_Info); if (!tcp_ses) { rc = -ENOMEM; goto out_err; @@ -3674,7 +3674,7 @@ static int mount_setup_tlink(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, struct tcon_link *tlink; /* hang the tcon off of the superblock */ - tlink = kzalloc_obj(*tlink, GFP_KERNEL); + tlink = kzalloc_obj(*tlink); if (tlink == NULL) return -ENOMEM; @@ -3798,7 +3798,7 @@ mchan_mount_alloc(struct cifs_ses *ses) { struct mchan_mount *mchan_mount; - mchan_mount = kzalloc_obj(*mchan_mount, GFP_KERNEL); + mchan_mount = kzalloc_obj(*mchan_mount); if (!mchan_mount) return ERR_PTR(-ENOMEM); @@ -4193,7 +4193,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) struct smb3_fs_context *ctx; char *origin_fullpath = NULL; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (ctx == NULL) return ERR_PTR(-ENOMEM); @@ -4367,7 +4367,7 @@ cifs_sb_tlink(struct cifs_sb_info *cifs_sb) spin_unlock(&cifs_sb->tlink_tree_lock); if (tlink == NULL) { - newtlink = kzalloc_obj(*tlink, GFP_KERNEL); + newtlink = kzalloc_obj(*tlink); if (newtlink == NULL) return ERR_PTR(-ENOMEM); newtlink->tl_uid = fsuid; diff --git a/fs/smb/client/dfs.h b/fs/smb/client/dfs.h index 0401c55517b8..16ac2cdd5c82 100644 --- a/fs/smb/client/dfs.h +++ b/fs/smb/client/dfs.h @@ -46,7 +46,7 @@ static inline struct dfs_ref_walk *ref_walk_alloc(void) { struct dfs_ref_walk *rw; - rw = kmalloc_obj(*rw, GFP_KERNEL); + rw = kmalloc_obj(*rw); if (!rw) return ERR_PTR(-ENOMEM); return rw; diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 43b5b48f5a67..18f31d4eb98d 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -489,7 +489,7 @@ int cifs_posix_open(const char *full_path, struct inode **pinode, cifs_dbg(FYI, "posix open %s\n", full_path); - presp_data = kzalloc_obj(FILE_UNIX_BASIC_INFO, GFP_KERNEL); + presp_data = kzalloc_obj(FILE_UNIX_BASIC_INFO); if (presp_data == NULL) return -ENOMEM; @@ -673,11 +673,11 @@ struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file, struct cifs_tcon *tcon = tlink_tcon(tlink); struct TCP_Server_Info *server = tcon->ses->server; - cfile = kzalloc_obj(struct cifsFileInfo, GFP_KERNEL); + cfile = kzalloc_obj(struct cifsFileInfo); if (cfile == NULL) return cfile; - fdlocks = kzalloc_obj(struct cifs_fid_locks, GFP_KERNEL); + fdlocks = kzalloc_obj(struct cifs_fid_locks); if (!fdlocks) { kfree(cfile); return NULL; @@ -1458,7 +1458,7 @@ int cifs_close(struct inode *inode, struct file *file) if (file->private_data != NULL) { cfile = file->private_data; file->private_data = NULL; - dclose = kmalloc_obj(struct cifs_deferred_close, GFP_KERNEL); + dclose = kmalloc_obj(struct cifs_deferred_close); if ((cfile->status_file_deleted == false) && (smb2_can_defer_close(inode, dclose))) { if (test_and_clear_bit(NETFS_ICTX_MODIFIED_ATTR, &cinode->netfs.flags)) { @@ -1582,7 +1582,7 @@ static struct cifsLockInfo * cifs_lock_init(__u64 offset, __u64 length, __u8 type, __u16 flags) { struct cifsLockInfo *lock = - kmalloc_obj(struct cifsLockInfo, GFP_KERNEL); + kmalloc_obj(struct cifsLockInfo); if (!lock) return lock; lock->offset = offset; @@ -1853,7 +1853,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) PAGE_SIZE); max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num, GFP_KERNEL); + buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num); if (!buf) { free_xid(xid); return -ENOMEM; @@ -1945,7 +1945,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) * protects locking operations of this inode. */ for (i = 0; i < count; i++) { - lck = kmalloc_obj(struct lock_to_push, GFP_KERNEL); + lck = kmalloc_obj(struct lock_to_push); if (!lck) { rc = -ENOMEM; goto err_out; @@ -2229,7 +2229,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, PAGE_SIZE); max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num, GFP_KERNEL); + buf = kzalloc_objs(LOCKING_ANDX_RANGE, max_num); if (!buf) return -ENOMEM; diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 4810f926dccb..09fe749e97ee 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1924,7 +1924,7 @@ int smb3_init_fs_context(struct fs_context *fc) char *nodename = utsname()->nodename; int i; - ctx = kzalloc_obj(struct smb3_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct smb3_fs_context); if (unlikely(!ctx)) return -ENOMEM; diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index d40f39f9547c..d4d3cfeb6c90 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -1841,7 +1841,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry, /* set ATTR_HIDDEN and clear ATTR_READONLY, but only if needed */ if (dosattr != origattr) { - info_buf = kzalloc_obj(*info_buf, GFP_KERNEL); + info_buf = kzalloc_obj(*info_buf); if (info_buf == NULL) { rc = -ENOMEM; goto out_close; @@ -2041,7 +2041,7 @@ psx_del_no_retry: } } } else if ((rc == -EACCES) && (dosattr == 0) && inode) { - attrs = kzalloc_obj(*attrs, GFP_KERNEL); + attrs = kzalloc_obj(*attrs); if (attrs == NULL) { rc = -ENOMEM; goto out_reval; @@ -2197,7 +2197,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode, struct inode *newinode = NULL; struct cifs_fattr fattr; - info = kzalloc_obj(FILE_UNIX_BASIC_INFO, GFP_KERNEL); + info = kzalloc_obj(FILE_UNIX_BASIC_INFO); if (info == NULL) { rc = -ENOMEM; goto posix_mkdir_out; @@ -2585,7 +2585,7 @@ cifs_rename2(struct mnt_idmap *idmap, struct inode *source_dir, * with unix extensions enabled. */ info_buf_source = - kmalloc_objs(FILE_UNIX_BASIC_INFO, 2, GFP_KERNEL); + kmalloc_objs(FILE_UNIX_BASIC_INFO, 2); if (info_buf_source == NULL) { rc = -ENOMEM; goto cifs_rename_exit; @@ -3166,7 +3166,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) attrs->ia_valid &= ~ATTR_MODE; - args = kmalloc_obj(*args, GFP_KERNEL); + args = kmalloc_obj(*args); if (args == NULL) { rc = -ENOMEM; goto out; diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c index 6d24184c8735..8dc2651e237f 100644 --- a/fs/smb/client/ioctl.c +++ b/fs/smb/client/ioctl.c @@ -133,7 +133,7 @@ static long smb_mnt_get_fsinfo(unsigned int xid, struct cifs_tcon *tcon, int rc = 0; struct smb_mnt_fs_info *fsinf; - fsinf = kzalloc_obj(struct smb_mnt_fs_info, GFP_KERNEL); + fsinf = kzalloc_obj(struct smb_mnt_fs_info); if (fsinf == NULL) return -ENOMEM; diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 290d0a0bea53..aec6f2c52408 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -67,7 +67,7 @@ sesInfoAlloc(void) { struct cifs_ses *ret_buf; - ret_buf = kzalloc_obj(struct cifs_ses, GFP_KERNEL); + ret_buf = kzalloc_obj(struct cifs_ses); if (ret_buf) { atomic_inc(&sesInfoAllocCount); spin_lock_init(&ret_buf->ses_lock); @@ -118,7 +118,7 @@ tcon_info_alloc(bool dir_leases_enabled, enum smb3_tcon_ref_trace trace) struct cifs_tcon *ret_buf; static atomic_t tcon_debug_id; - ret_buf = kzalloc_obj(*ret_buf, GFP_KERNEL); + ret_buf = kzalloc_obj(*ret_buf); if (!ret_buf) return NULL; diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c index 53e17fb2b6ee..8615a8747b7f 100644 --- a/fs/smb/client/readdir.c +++ b/fs/smb/client/readdir.c @@ -358,7 +358,7 @@ _initiate_cifs_search(const unsigned int xid, struct file *file, if (IS_ERR(tlink)) return PTR_ERR(tlink); - cifsFile = kzalloc_obj(struct cifsFileInfo, GFP_KERNEL); + cifsFile = kzalloc_obj(struct cifsFileInfo); if (cifsFile == NULL) { rc = -ENOMEM; goto error_exit; diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index e32f9e185499..698bd27119ae 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -510,7 +510,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, * the session and server without caring about memory * management. */ - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { rc = -ENOMEM; goto out_free_xid; diff --git a/fs/smb/client/smb1ops.c b/fs/smb/client/smb1ops.c index 689e052c2809..aed49aaef8c4 100644 --- a/fs/smb/client/smb1ops.c +++ b/fs/smb/client/smb1ops.c @@ -506,7 +506,7 @@ cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, int rc; FILE_ALL_INFO *file_info; - file_info = kmalloc_obj(FILE_ALL_INFO, GFP_KERNEL); + file_info = kmalloc_obj(FILE_ALL_INFO); if (file_info == NULL) return -ENOMEM; diff --git a/fs/smb/client/smb1session.c b/fs/smb/client/smb1session.c index f5ef07d24b5f..83bfbf0c068e 100644 --- a/fs/smb/client/smb1session.c +++ b/fs/smb/client/smb1session.c @@ -725,7 +725,7 @@ sess_auth_rawntlmssp_negotiate(struct sess_data *sess_data) * if memory allocation is successful, caller of this function * frees it. */ - ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth, GFP_KERNEL); + ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth); if (!ses->ntlmssp) { rc = -ENOMEM; goto out; @@ -969,7 +969,7 @@ int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses, return -EINVAL; } - sess_data = kzalloc_obj(struct sess_data, GFP_KERNEL); + sess_data = kzalloc_obj(struct sess_data); if (!sess_data) return -ENOMEM; diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index 6dba874156aa..1ab41de2b634 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -281,7 +281,7 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf / sizeof(struct smb2_lock_element); - buf = kzalloc_objs(struct smb2_lock_element, max_num, GFP_KERNEL); + buf = kzalloc_objs(struct smb2_lock_element, max_num); if (!buf) return -ENOMEM; @@ -424,7 +424,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile) BUILD_BUG_ON(sizeof(struct smb2_lock_element) > PAGE_SIZE); max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf / sizeof(struct smb2_lock_element); - buf = kzalloc_objs(struct smb2_lock_element, max_num, GFP_KERNEL); + buf = kzalloc_objs(struct smb2_lock_element, max_num); if (!buf) { free_xid(xid); return -ENOMEM; diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c index efba7cb9fb70..e19674d9b92b 100644 --- a/fs/smb/client/smb2misc.c +++ b/fs/smb/client/smb2misc.c @@ -526,7 +526,7 @@ smb2_queue_pending_open_break(struct tcon_link *tlink, __u8 *lease_key, { struct smb2_lease_break_work *lw; - lw = kmalloc_obj(struct smb2_lease_break_work, GFP_KERNEL); + lw = kmalloc_obj(struct smb2_lease_break_work); if (!lw) { cifs_put_tlink(tlink); return; @@ -798,7 +798,7 @@ __smb2_handle_cancelled_cmd(struct cifs_tcon *tcon, __u16 cmd, __u64 mid, { struct close_cancelled_open *cancelled; - cancelled = kzalloc_obj(*cancelled, GFP_KERNEL); + cancelled = kzalloc_obj(*cancelled); if (!cancelled) return -ENOMEM; diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 071df7465a8b..1ba66e1f6ffa 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -731,7 +731,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, spin_unlock(&ses->iface_lock); /* no match. insert the entry in the list */ - info = kmalloc_obj(struct cifs_server_iface, GFP_KERNEL); + info = kmalloc_obj(struct cifs_server_iface); if (!info) { rc = -ENOMEM; goto out; @@ -1201,7 +1201,7 @@ replay_again: ea = NULL; resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - vars = kzalloc_obj(*vars, GFP_KERNEL); + vars = kzalloc_obj(*vars); if (!vars) { rc = -ENOMEM; goto out_free_path; @@ -2849,7 +2849,7 @@ replay_again: flags |= CIFS_TRANSFORM_REQ; resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - vars = kzalloc_obj(*vars, GFP_KERNEL); + vars = kzalloc_obj(*vars); if (!vars) { rc = -ENOMEM; goto out_free_path; @@ -4220,7 +4220,7 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock, u8 *parent_lease_key, __le32 fla { struct create_lease *buf; - buf = kzalloc_obj(struct create_lease, GFP_KERNEL); + buf = kzalloc_obj(struct create_lease); if (!buf) return NULL; @@ -4246,7 +4246,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 oplock, u8 *parent_lease_key, __le32 fla { struct create_lease_v2 *buf; - buf = kzalloc_obj(struct create_lease_v2, GFP_KERNEL); + buf = kzalloc_obj(struct create_lease_v2); if (!buf) return NULL; @@ -4930,7 +4930,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid, int rc; struct smb2_decrypt_work *dw; - dw = kzalloc_obj(struct smb2_decrypt_work, GFP_KERNEL); + dw = kzalloc_obj(struct smb2_decrypt_work); if (!dw) return -ENOMEM; INIT_WORK(&dw->decrypt, smb2_decrypt_offload); diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 0ebfdfebc5e9..ef655acf673d 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -1009,7 +1009,7 @@ create_posix_buf(umode_t mode) { struct create_posix *buf; - buf = kzalloc_obj(struct create_posix, GFP_KERNEL); + buf = kzalloc_obj(struct create_posix); if (!buf) return NULL; @@ -1785,7 +1785,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) * If memory allocation is successful, caller of this function * frees it. */ - ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth, GFP_KERNEL); + ses->ntlmssp = kmalloc_obj(struct ntlmssp_auth); if (!ses->ntlmssp) { rc = -ENOMEM; goto out_err; @@ -1983,7 +1983,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, return smb_EIO(smb_eio_trace_null_pointers); } - sess_data = kzalloc_obj(struct SMB2_sess_data, GFP_KERNEL); + sess_data = kzalloc_obj(struct SMB2_sess_data); if (!sess_data) return -ENOMEM; @@ -2297,7 +2297,7 @@ create_durable_buf(void) { create_durable_req_t *buf; - buf = kzalloc_obj(create_durable_req_t, GFP_KERNEL); + buf = kzalloc_obj(create_durable_req_t); if (!buf) return NULL; @@ -2320,7 +2320,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid) { create_durable_req_t *buf; - buf = kzalloc_obj(create_durable_req_t, GFP_KERNEL); + buf = kzalloc_obj(create_durable_req_t); if (!buf) return NULL; @@ -2492,7 +2492,7 @@ create_durable_v2_buf(struct cifs_open_parms *oparms) struct cifs_fid *pfid = oparms->fid; struct create_durable_req_v2 *buf; - buf = kzalloc_obj(struct create_durable_req_v2, GFP_KERNEL); + buf = kzalloc_obj(struct create_durable_req_v2); if (!buf) return NULL; @@ -2533,7 +2533,7 @@ create_reconnect_durable_v2_buf(struct cifs_fid *fid) { struct create_durable_handle_reconnect_v2 *buf; - buf = kzalloc_obj(struct create_durable_handle_reconnect_v2, GFP_KERNEL); + buf = kzalloc_obj(struct create_durable_handle_reconnect_v2); if (!buf) return NULL; @@ -2624,7 +2624,7 @@ create_twarp_buf(__u64 timewarp) { struct crt_twarp_ctxt *buf; - buf = kzalloc_obj(struct crt_twarp_ctxt, GFP_KERNEL); + buf = kzalloc_obj(struct crt_twarp_ctxt); if (!buf) return NULL; @@ -2791,7 +2791,7 @@ create_query_id_buf(void) { struct crt_query_id_ctxt *buf; - buf = kzalloc_obj(struct crt_query_id_ctxt, GFP_KERNEL); + buf = kzalloc_obj(struct crt_query_id_ctxt); if (!buf) return NULL; @@ -5843,7 +5843,7 @@ replay_again: if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - iov = kmalloc_objs(struct kvec, num, GFP_KERNEL); + iov = kmalloc_objs(struct kvec, num); if (!iov) return -ENOMEM; diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index e2df73c719fd..77f36d68621b 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -2098,7 +2098,7 @@ static struct smbd_connection *_smbd_get_connection( char wq_name[80]; struct workqueue_struct *workqueue; - info = kzalloc_obj(struct smbd_connection, GFP_KERNEL); + info = kzalloc_obj(struct smbd_connection); if (!info) return NULL; sc = &info->socket; @@ -2786,7 +2786,7 @@ static int allocate_mr_list(struct smbdirect_socket *sc) /* Allocate more MRs (2x) than hardware responder_resources */ for (i = 0; i < sp->responder_resources * 2; i++) { - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) { ret = -ENOMEM; goto kzalloc_mr_failed; diff --git a/fs/splice.c b/fs/splice.c index cad3779fa35c..9d8f63e2fd1a 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -275,8 +275,8 @@ int splice_grow_spd(const struct pipe_inode_info *pipe, struct splice_pipe_desc if (max_usage <= PIPE_DEF_BUFFERS) return 0; - spd->pages = kmalloc_objs(struct page *, max_usage, GFP_KERNEL); - spd->partial = kmalloc_objs(struct partial_page, max_usage, GFP_KERNEL); + spd->pages = kmalloc_objs(struct page *, max_usage); + spd->partial = kmalloc_objs(struct partial_page, max_usage); if (spd->pages && spd->partial) return 0; @@ -675,7 +675,7 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (!out->f_op->write_iter) return -EINVAL; - array = kzalloc_objs(struct bio_vec, nbufs, GFP_KERNEL); + array = kzalloc_objs(struct bio_vec, nbufs); if (unlikely(!array)) return -ENOMEM; @@ -696,7 +696,7 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (unlikely(nbufs < pipe->max_usage)) { kfree(array); nbufs = pipe->max_usage; - array = kzalloc_objs(struct bio_vec, nbufs, GFP_KERNEL); + array = kzalloc_objs(struct bio_vec, nbufs); if (!array) { ret = -ENOMEM; break; diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c index 5d97b22ce297..8e958db5f786 100644 --- a/fs/squashfs/cache.c +++ b/fs/squashfs/cache.c @@ -229,13 +229,13 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries, if (entries == 0) return NULL; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (cache == NULL) { ERROR("Failed to allocate %s cache\n", name); return ERR_PTR(-ENOMEM); } - cache->entry = kzalloc_objs(*(cache->entry), entries, GFP_KERNEL); + cache->entry = kzalloc_objs(*(cache->entry), entries); if (cache->entry == NULL) { ERROR("Failed to allocate %s cache\n", name); goto cleanup; diff --git a/fs/squashfs/decompressor_multi.c b/fs/squashfs/decompressor_multi.c index 4d7bc620bef5..5c1aede1eddb 100644 --- a/fs/squashfs/decompressor_multi.c +++ b/fs/squashfs/decompressor_multi.c @@ -65,7 +65,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, struct decomp_stream *decomp_strm = NULL; int err = -ENOMEM; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) goto out; @@ -80,7 +80,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, * we could always fall back to default decompressor and * file system works. */ - decomp_strm = kmalloc_obj(*decomp_strm, GFP_KERNEL); + decomp_strm = kmalloc_obj(*decomp_strm); if (!decomp_strm) goto out; @@ -148,7 +148,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk, goto wait; /* Let's allocate new decomp */ - decomp_strm = kmalloc_obj(*decomp_strm, GFP_KERNEL); + decomp_strm = kmalloc_obj(*decomp_strm); if (!decomp_strm) goto wait; diff --git a/fs/squashfs/decompressor_single.c b/fs/squashfs/decompressor_single.c index 1f1597104ca8..48501ba55fce 100644 --- a/fs/squashfs/decompressor_single.c +++ b/fs/squashfs/decompressor_single.c @@ -30,7 +30,7 @@ static void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, struct squashfs_stream *stream; int err = -ENOMEM; - stream = kmalloc_obj(*stream, GFP_KERNEL); + stream = kmalloc_obj(*stream); if (stream == NULL) goto out; diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c index e482757d8f2c..1646bbee290e 100644 --- a/fs/squashfs/lz4_wrapper.c +++ b/fs/squashfs/lz4_wrapper.c @@ -54,7 +54,7 @@ static void *lz4_init(struct squashfs_sb_info *msblk, void *buff) int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); struct squashfs_lz4 *stream; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (stream == NULL) goto failed; stream->input = vmalloc(block_size); diff --git a/fs/squashfs/lzo_wrapper.c b/fs/squashfs/lzo_wrapper.c index 961fda720c14..be1df7a25046 100644 --- a/fs/squashfs/lzo_wrapper.c +++ b/fs/squashfs/lzo_wrapper.c @@ -29,7 +29,7 @@ static void *lzo_init(struct squashfs_sb_info *msblk, void *buff) { int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); - struct squashfs_lzo *stream = kzalloc_obj(*stream, GFP_KERNEL); + struct squashfs_lzo *stream = kzalloc_obj(*stream); if (stream == NULL) goto failed; stream->input = vmalloc(block_size); diff --git a/fs/squashfs/page_actor.c b/fs/squashfs/page_actor.c index 3d8f0225e240..79b73e98abab 100644 --- a/fs/squashfs/page_actor.c +++ b/fs/squashfs/page_actor.c @@ -43,7 +43,7 @@ static void cache_finish_page(struct squashfs_page_actor *actor) struct squashfs_page_actor *squashfs_page_actor_init(void **buffer, int pages, int length) { - struct squashfs_page_actor *actor = kmalloc_obj(*actor, GFP_KERNEL); + struct squashfs_page_actor *actor = kmalloc_obj(*actor); if (actor == NULL) return NULL; @@ -110,7 +110,7 @@ static void direct_finish_page(struct squashfs_page_actor *actor) struct squashfs_page_actor *squashfs_page_actor_init_special(struct squashfs_sb_info *msblk, struct page **page, int pages, int length, loff_t start_index) { - struct squashfs_page_actor *actor = kmalloc_obj(*actor, GFP_KERNEL); + struct squashfs_page_actor *actor = kmalloc_obj(*actor); if (actor == NULL) return NULL; diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 69217e752bc5..5dabc5770f1b 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -196,7 +196,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) return -EINVAL; } - sb->s_fs_info = kzalloc_obj(*msblk, GFP_KERNEL); + sb->s_fs_info = kzalloc_obj(*msblk); if (sb->s_fs_info == NULL) { ERROR("Failed to allocate squashfs_sb_info\n"); return -ENOMEM; @@ -549,7 +549,7 @@ static int squashfs_init_fs_context(struct fs_context *fc) { struct squashfs_mount_opts *opts; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; diff --git a/fs/squashfs/xz_wrapper.c b/fs/squashfs/xz_wrapper.c index d258f4726d2e..0a4ff3ec9c8c 100644 --- a/fs/squashfs/xz_wrapper.c +++ b/fs/squashfs/xz_wrapper.c @@ -42,7 +42,7 @@ static void *squashfs_xz_comp_opts(struct squashfs_sb_info *msblk, struct comp_opts *opts; int err = 0, n; - opts = kmalloc_obj(*opts, GFP_KERNEL); + opts = kmalloc_obj(*opts); if (opts == NULL) { err = -ENOMEM; goto out2; @@ -84,7 +84,7 @@ static void *squashfs_xz_init(struct squashfs_sb_info *msblk, void *buff) struct squashfs_xz *stream; int err; - stream = kmalloc_obj(*stream, GFP_KERNEL); + stream = kmalloc_obj(*stream); if (stream == NULL) { err = -ENOMEM; goto failed; diff --git a/fs/squashfs/zlib_wrapper.c b/fs/squashfs/zlib_wrapper.c index 899629c54d97..a29001311939 100644 --- a/fs/squashfs/zlib_wrapper.c +++ b/fs/squashfs/zlib_wrapper.c @@ -23,7 +23,7 @@ static void *zlib_init(struct squashfs_sb_info *dummy, void *buff) { - z_stream *stream = kmalloc_obj(z_stream, GFP_KERNEL); + z_stream *stream = kmalloc_obj(z_stream); if (stream == NULL) goto failed; stream->workspace = vmalloc(zlib_inflate_workspacesize()); diff --git a/fs/squashfs/zstd_wrapper.c b/fs/squashfs/zstd_wrapper.c index 632560e4d6b0..487fbc51d264 100644 --- a/fs/squashfs/zstd_wrapper.c +++ b/fs/squashfs/zstd_wrapper.c @@ -28,7 +28,7 @@ struct workspace { static void *zstd_init(struct squashfs_sb_info *msblk, void *buff) { - struct workspace *wksp = kmalloc_obj(*wksp, GFP_KERNEL); + struct workspace *wksp = kmalloc_obj(*wksp); if (wksp == NULL) goto failed; diff --git a/fs/super.c b/fs/super.c index b8a6e156359d..378e81efe643 100644 --- a/fs/super.c +++ b/fs/super.c @@ -317,7 +317,7 @@ static void destroy_unused_super(struct super_block *s) static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns) { - struct super_block *s = kzalloc_obj(struct super_block, GFP_KERNEL); + struct super_block *s = kzalloc_obj(struct super_block); static const struct super_operations default_op; int i; diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index a6de7d945fba..e65c60158a04 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -62,7 +62,7 @@ static int sysfs_init_fs_context(struct fs_context *fc) return -EPERM; } - kfc = kzalloc_obj(struct kernfs_fs_context, GFP_KERNEL); + kfc = kzalloc_obj(struct kernfs_fs_context); if (!kfc) return -ENOMEM; diff --git a/fs/timerfd.c b/fs/timerfd.c index f379edab7c02..73104f36bcae 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -413,7 +413,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) !capable(CAP_WAKE_ALARM)) return -EPERM; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 81a3a7dcf6ce..8e5ac464b328 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -439,7 +439,7 @@ static inline struct eventfs_inode *init_ei(struct eventfs_inode *ei, const char static inline struct eventfs_inode *alloc_ei(const char *name) { - struct eventfs_inode *ei = kzalloc_obj(*ei, GFP_KERNEL); + struct eventfs_inode *ei = kzalloc_obj(*ei); struct eventfs_inode *result; if (!ei) @@ -454,7 +454,7 @@ static inline struct eventfs_inode *alloc_ei(const char *name) static inline struct eventfs_inode *alloc_root_ei(const char *name) { - struct eventfs_root_inode *rei = kzalloc_obj(*rei, GFP_KERNEL); + struct eventfs_root_inode *rei = kzalloc_obj(*rei); struct eventfs_inode *ei; if (!rei) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 780f38c1b52d..51c00c8fa175 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -522,7 +522,7 @@ static int tracefs_init_fs_context(struct fs_context *fc) { struct tracefs_fs_info *fsi; - fsi = kzalloc_obj(struct tracefs_fs_info, GFP_KERNEL); + fsi = kzalloc_obj(struct tracefs_fs_info); if (!fsi) return -ENOMEM; diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index cb24592753b0..160c16aa7b6e 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -3035,7 +3035,7 @@ void ubifs_assert_failed(struct ubifs_info *c, const char *expr, */ int ubifs_debugging_init(struct ubifs_info *c) { - c->dbg = kzalloc_obj(struct ubifs_debug_info, GFP_KERNEL); + c->dbg = kzalloc_obj(struct ubifs_debug_info); if (!c->dbg) return -ENOMEM; diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 0e088aa661af..4c9f57f3b2ad 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1725,7 +1725,7 @@ static int ubifs_dir_open(struct inode *inode, struct file *file) { struct ubifs_dir_data *data; - data = kzalloc_obj(struct ubifs_dir_data, GFP_KERNEL); + data = kzalloc_obj(struct ubifs_dir_data); if (!data) return -ENOMEM; file->private_data = data; diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index a9cb92e3ee9c..b3986705cfa0 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c @@ -624,9 +624,9 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, if (IS_ERR(desc)) return PTR_ERR(desc); - lsave = kmalloc_objs(int, c->lsave_cnt, GFP_KERNEL); - pnode = kzalloc_obj(struct ubifs_pnode, GFP_KERNEL); - nnode = kzalloc_obj(struct ubifs_nnode, GFP_KERNEL); + lsave = kmalloc_objs(int, c->lsave_cnt); + pnode = kzalloc_obj(struct ubifs_pnode); + nnode = kzalloc_obj(struct ubifs_nnode); buf = vmalloc(c->leb_size); ltab = vmalloc_array(c->lpt_lebs, sizeof(struct ubifs_lpt_lprops)); diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index d92aed9fbad7..5c9dbf0a0806 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -1258,7 +1258,7 @@ static int add_ino(struct ubifs_info *c, ino_t inum, loff_t i_size, p = &(*p)->rb_right; } - e = kzalloc_obj(struct size_entry, GFP_KERNEL); + e = kzalloc_obj(struct size_entry); if (!e) return -ENOMEM; diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 7e5435dab283..a9a568f4a868 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -393,7 +393,7 @@ static int insert_node(struct ubifs_info *c, int lnum, int offs, int len, if (key_inum(c, key) >= c->highest_inum) c->highest_inum = key_inum(c, key); - r = kzalloc_obj(struct replay_entry, GFP_KERNEL); + r = kzalloc_obj(struct replay_entry); if (!r) return -ENOMEM; @@ -443,7 +443,7 @@ static int insert_dent(struct ubifs_info *c, int lnum, int offs, int len, if (key_inum(c, key) >= c->highest_inum) c->highest_inum = key_inum(c, key); - r = kzalloc_obj(struct replay_entry, GFP_KERNEL); + r = kzalloc_obj(struct replay_entry); if (!r) return -ENOMEM; @@ -897,11 +897,11 @@ static int add_replay_bud(struct ubifs_info *c, int lnum, int offs, int jhead, dbg_mnt("add replay bud LEB %d:%d, head %d", lnum, offs, jhead); - bud = kmalloc_obj(struct ubifs_bud, GFP_KERNEL); + bud = kmalloc_obj(struct ubifs_bud); if (!bud) return -ENOMEM; - b = kmalloc_obj(struct bud_entry, GFP_KERNEL); + b = kmalloc_obj(struct bud_entry); if (!b) { err = -ENOMEM; goto out; diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index b86b65fcd615..03bf924756ca 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -819,7 +819,7 @@ static int alloc_wbufs(struct ubifs_info *c) { int i, err; - c->jheads = kzalloc_objs(struct ubifs_jhead, c->jhead_cnt, GFP_KERNEL); + c->jheads = kzalloc_objs(struct ubifs_jhead, c->jhead_cnt); if (!c->jheads) return -ENOMEM; @@ -1245,7 +1245,7 @@ static int mount_ubifs(struct ubifs_info *c) * never exceed 64. */ err = -ENOMEM; - c->bottom_up_buf = kmalloc_objs(int, BOTTOM_UP_HEIGHT, GFP_KERNEL); + c->bottom_up_buf = kmalloc_objs(int, BOTTOM_UP_HEIGHT); if (!c->bottom_up_buf) goto out_free; @@ -2081,7 +2081,7 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) { struct ubifs_info *c; - c = kzalloc_obj(struct ubifs_info, GFP_KERNEL); + c = kzalloc_obj(struct ubifs_info); if (c) { spin_lock_init(&c->cnt_lock); spin_lock_init(&c->cs_lock); @@ -2334,7 +2334,7 @@ static int ubifs_init_fs_context(struct fs_context *fc) { struct ubifs_fs_context *ctx; - ctx = kzalloc_obj(struct ubifs_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct ubifs_fs_context); if (!ctx) return -ENOMEM; diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c index 1c926e865be3..dbf967dcf26e 100644 --- a/fs/ubifs/sysfs.c +++ b/fs/ubifs/sysfs.c @@ -93,7 +93,7 @@ int ubifs_sysfs_register(struct ubifs_info *c) int ret, n; char dfs_dir_name[UBIFS_DFS_DIR_LEN]; - c->stats = kzalloc_obj(struct ubifs_stats_info, GFP_KERNEL); + c->stats = kzalloc_obj(struct ubifs_stats_info); if (!c->stats) { ret = -ENOMEM; goto out_last; diff --git a/fs/udf/super.c b/fs/udf/super.c index 365cb78097d3..e4220ce08742 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -270,7 +270,7 @@ static int udf_init_fs_context(struct fs_context *fc) { struct udf_options *uopt; - uopt = kzalloc_obj(*uopt, GFP_KERNEL); + uopt = kzalloc_obj(*uopt); if (!uopt) return -ENOMEM; @@ -320,7 +320,7 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count) { struct udf_sb_info *sbi = UDF_SB(sb); - sbi->s_partmaps = kzalloc_objs(*sbi->s_partmaps, count, GFP_KERNEL); + sbi->s_partmaps = kzalloc_objs(*sbi->s_partmaps, count); if (!sbi->s_partmaps) { sbi->s_partitions = 0; return -ENOMEM; @@ -1696,7 +1696,7 @@ static struct udf_vds_record *handle_partition_descriptor( struct part_desc_seq_scan_data *new_loc; unsigned int new_size = ALIGN(partnum, PART_DESC_ALLOC_STEP); - new_loc = kzalloc_objs(*new_loc, new_size, GFP_KERNEL); + new_loc = kzalloc_objs(*new_loc, new_size); if (!new_loc) return ERR_PTR(-ENOMEM); memcpy(new_loc, data->part_descs_loc, @@ -2156,7 +2156,7 @@ static int udf_fill_super(struct super_block *sb, struct fs_context *fc) bool lvid_open = false; int silent = fc->sb_flags & SB_SILENT; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 2937221f7942..c4831a8b9b3f 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -743,7 +743,7 @@ static int ufs_fill_super(struct super_block *sb, struct fs_context *fc) } #endif - sbi = kzalloc_obj(struct ufs_sb_info, GFP_KERNEL); + sbi = kzalloc_obj(struct ufs_sb_info); if (!sbi) goto failed_nomem; sb->s_fs_info = sbi; @@ -768,7 +768,7 @@ static int ufs_fill_super(struct super_block *sb, struct fs_context *fc) sbi->s_flavour = UFS_MOUNT_UFSTYPE_OLD; } - uspi = kzalloc_obj(struct ufs_sb_private_info, GFP_KERNEL); + uspi = kzalloc_obj(struct ufs_sb_private_info); sbi->s_uspi = uspi; if (!uspi) goto failed; @@ -1437,7 +1437,7 @@ static int ufs_init_fs_context(struct fs_context *fc) { struct ufs_fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c index 3755b8067ad3..543c60c12461 100644 --- a/fs/unicode/utf8-core.c +++ b/fs/unicode/utf8-core.c @@ -176,7 +176,7 @@ struct unicode_map *utf8_load(unsigned int version) { struct unicode_map *um; - um = kzalloc_obj(struct unicode_map, GFP_KERNEL); + um = kzalloc_obj(struct unicode_map); if (!um) return ERR_PTR(-ENOMEM); um->version = version; diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index e90c4a762917..bdc84e5219cd 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -653,7 +653,7 @@ int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs) } if (!ctx) { - fctx = kmalloc_obj(*fctx, GFP_KERNEL); + fctx = kmalloc_obj(*fctx); if (!fctx) return -ENOMEM; @@ -840,7 +840,7 @@ int userfaultfd_unmap_prep(struct vm_area_struct *vma, unsigned long start, has_unmap_ctx(ctx, unmaps, start, end)) return 0; - unmap_ctx = kzalloc_obj(*unmap_ctx, GFP_KERNEL); + unmap_ctx = kzalloc_obj(*unmap_ctx); if (!unmap_ctx) return -ENOMEM; diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c index 174ede512d30..7a7a3fbb2651 100644 --- a/fs/vboxsf/file.c +++ b/fs/vboxsf/file.c @@ -26,7 +26,7 @@ struct vboxsf_handle *vboxsf_create_sf_handle(struct inode *inode, struct vboxsf_inode *sf_i = VBOXSF_I(inode); struct vboxsf_handle *sf_handle; - sf_handle = kmalloc_obj(*sf_handle, GFP_KERNEL); + sf_handle = kmalloc_obj(*sf_handle); if (!sf_handle) return ERR_PTR(-ENOMEM); diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c index fe048ab05c48..a618cb093e00 100644 --- a/fs/vboxsf/super.c +++ b/fs/vboxsf/super.c @@ -122,7 +122,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) if (!fc->source) return -EINVAL; - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; @@ -427,7 +427,7 @@ static int vboxsf_init_fs_context(struct fs_context *fc) { struct vboxsf_fs_context *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index b95c1e42d073..440e8c50629d 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -478,7 +478,7 @@ static struct vboxsf_dir_buf *vboxsf_dir_buf_alloc(struct list_head *list) { struct vboxsf_dir_buf *b; - b = kmalloc_obj(*b, GFP_KERNEL); + b = kmalloc_obj(*b); if (!b) return NULL; @@ -507,7 +507,7 @@ struct vboxsf_dir_info *vboxsf_dir_info_alloc(void) { struct vboxsf_dir_info *p; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return NULL; diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c index 759da639d386..9c6765cc2d44 100644 --- a/fs/xfs/libxfs/xfs_ag.c +++ b/fs/xfs/libxfs/xfs_ag.c @@ -224,7 +224,7 @@ xfs_perag_alloc( struct xfs_perag *pag; int error; - pag = kzalloc_obj(*pag, GFP_KERNEL); + pag = kzalloc_obj(*pag); if (!pag) return -ENOMEM; diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c index 3b7f4819b85b..c85d50953218 100644 --- a/fs/xfs/libxfs/xfs_rtgroup.c +++ b/fs/xfs/libxfs/xfs_rtgroup.c @@ -98,7 +98,7 @@ xfs_rtgroup_alloc( struct xfs_rtgroup *rtg; int error; - rtg = kzalloc_obj(struct xfs_rtgroup, GFP_KERNEL); + rtg = kzalloc_obj(struct xfs_rtgroup); if (!rtg) return -ENOMEM; diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c index 8cd018bac5d6..ef3f6abdb706 100644 --- a/fs/xfs/scrub/stats.c +++ b/fs/xfs/scrub/stats.c @@ -389,7 +389,7 @@ xchk_mount_stats_alloc( struct xchk_stats *cs; int error; - cs = kvzalloc_obj(struct xchk_stats, GFP_KERNEL); + cs = kvzalloc_obj(struct xchk_stats); if (!cs) return -ENOMEM; diff --git a/fs/xfs/xfs_buf_item_recover.c b/fs/xfs/xfs_buf_item_recover.c index 5f391372f188..02b95b89d1b5 100644 --- a/fs/xfs/xfs_buf_item_recover.c +++ b/fs/xfs/xfs_buf_item_recover.c @@ -1180,7 +1180,7 @@ xlog_alloc_buf_cancel_table( ASSERT(log->l_buf_cancel_table == NULL); - p = kmalloc_objs(struct list_head, XLOG_BC_TABLE_SIZE, GFP_KERNEL); + p = kmalloc_objs(struct list_head, XLOG_BC_TABLE_SIZE); if (!p) return -ENOMEM; diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index 3ecbb4e0f2c8..906221ffe9ba 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -349,7 +349,7 @@ xfs_trim_perag_extents( do { struct xfs_busy_extents *extents; - extents = kzalloc_obj(*extents, GFP_KERNEL); + extents = kzalloc_obj(*extents); if (!extents) { error = -ENOMEM; break; @@ -537,7 +537,7 @@ xfs_trim_gather_rtextent( return 0; } - busyp = kzalloc_obj(struct xfs_rtx_busy, GFP_KERNEL); + busyp = kzalloc_obj(struct xfs_rtx_busy); if (!busyp) return -ENOMEM; @@ -689,7 +689,7 @@ xfs_trim_rtgroup_extents( * trims the extents returned. */ do { - tr.extents = kzalloc_obj(*tr.extents, GFP_KERNEL); + tr.extents = kzalloc_obj(*tr.extents); if (!tr.extents) { error = -ENOMEM; break; diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c index a5f02cac9d31..3efdca3d675b 100644 --- a/fs/xfs/xfs_extent_busy.c +++ b/fs/xfs/xfs_extent_busy.c @@ -717,7 +717,7 @@ xfs_extent_busy_alloc(void) { struct xfs_extent_busy_tree *eb; - eb = kzalloc_obj(*eb, GFP_KERNEL); + eb = kzalloc_obj(*eb); if (!eb) return NULL; spin_lock_init(&eb->eb_lock); diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 3724e64898f3..b6a3bc9f143c 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -1326,11 +1326,11 @@ xfs_ioc_getfsmap( */ count = min_t(unsigned int, head.fmh_count, 131072 / sizeof(struct fsmap)); - recs = kvzalloc_objs(struct fsmap, count, GFP_KERNEL); + recs = kvzalloc_objs(struct fsmap, count); if (!recs) { count = min_t(unsigned int, head.fmh_count, PAGE_SIZE / sizeof(struct fsmap)); - recs = kvzalloc_objs(struct fsmap, count, GFP_KERNEL); + recs = kvzalloc_objs(struct fsmap, count); if (!recs) return -ENOMEM; } diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c index 757a4213b2d0..e37c18cec372 100644 --- a/fs/xfs/xfs_healthmon.c +++ b/fs/xfs/xfs_healthmon.c @@ -1187,7 +1187,7 @@ xfs_ioc_health_monitor( if (!xfs_healthmon_validate(&hmo)) return -EINVAL; - hm = kzalloc_obj(*hm, GFP_KERNEL); + hm = kzalloc_obj(*hm); if (!hm) return -ENOMEM; hm->dev = mp->m_super->s_dev; diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 1074e36fa240..facffdc8dca8 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -896,7 +896,7 @@ xfs_ioc_getbmap( if (bmx.bmv_count >= INT_MAX / recsize) return -ENOMEM; - buf = kvzalloc_objs(*buf, bmx.bmv_count, GFP_KERNEL); + buf = kvzalloc_objs(*buf, bmx.bmv_count); if (!buf) return -ENOMEM; diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 0ce953b45852..011525a2cbc8 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -2235,7 +2235,7 @@ xfs_init_fs_context( struct xfs_mount *mp; int i; - mp = kzalloc_obj(struct xfs_mount, GFP_KERNEL); + mp = kzalloc_obj(struct xfs_mount); if (!mp) return -ENOMEM; #ifdef DEBUG diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c index 5d45d88f1f03..67e0c8f5800f 100644 --- a/fs/xfs/xfs_zone_alloc.c +++ b/fs/xfs/xfs_zone_alloc.c @@ -1196,7 +1196,7 @@ xfs_alloc_zone_info( struct xfs_zone_info *zi; int i; - zi = kzalloc_obj(*zi, GFP_KERNEL); + zi = kzalloc_obj(*zi); if (!zi) return NULL; INIT_LIST_HEAD(&zi->zi_open_zones); diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c index b8b9c72e955a..8604c8a2d86b 100644 --- a/fs/xfs/xfs_zone_gc.c +++ b/fs/xfs/xfs_zone_gc.c @@ -199,7 +199,7 @@ xfs_zone_gc_data_alloc( struct xfs_zone_gc_data *data; int i; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; data->iter.recs = kzalloc_objs(*data->iter.recs, XFS_ZONE_GC_RECS, diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 28be57db6e4b..9b7676553751 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1243,7 +1243,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc) * ZONEFS_F_AGGRCNV which increases the maximum file size of a file * beyond the zone size is taken into account. */ - sbi = kzalloc_obj(*sbi, GFP_KERNEL); + sbi = kzalloc_obj(*sbi); if (!sbi) return -ENOMEM; @@ -1388,7 +1388,7 @@ static int zonefs_init_fs_context(struct fs_context *fc) { struct zonefs_context *ctx; - ctx = kzalloc_obj(struct zonefs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct zonefs_context); if (!ctx) return -ENOMEM; ctx->s_mount_opts = ZONEFS_MNTOPT_ERRORS_RO; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 8b1d8993793d..4d2f0bed7a06 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -66,7 +66,7 @@ static inline struct fwnode_handle *acpi_alloc_fwnode_static(void) { struct fwnode_handle *fwnode; - fwnode = kzalloc_obj(struct fwnode_handle, GFP_KERNEL); + fwnode = kzalloc_obj(struct fwnode_handle); if (!fwnode) return NULL; diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 2cb211617ecc..8315270e27b7 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h @@ -136,7 +136,7 @@ struct vmcore_range { static inline int vmcore_alloc_add_range(struct list_head *list, unsigned long long paddr, unsigned long long size) { - struct vmcore_range *m = kzalloc_obj(*m, GFP_KERNEL); + struct vmcore_range *m = kzalloc_obj(*m); if (!m) return -ENOMEM; diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h index e5f4451a6375..5cd3ba53b4a1 100644 --- a/include/linux/dma-fence-chain.h +++ b/include/linux/dma-fence-chain.h @@ -91,7 +91,7 @@ dma_fence_chain_contained(struct dma_fence *fence) * intentional to enforce typesafety. */ #define dma_fence_chain_alloc() \ - kmalloc_obj(struct dma_fence_chain, GFP_KERNEL) + kmalloc_obj(struct dma_fence_chain) /** * dma_fence_chain_free diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 09a1a59034e0..9625347c7ac0 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -97,7 +97,7 @@ void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) static inline struct gameport *gameport_allocate_port(void) { - struct gameport *gameport = kzalloc_obj(struct gameport, GFP_KERNEL); + struct gameport *gameport = kzalloc_obj(struct gameport); return gameport; } diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index ff9012c6a93a..e5a884e72f29 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h @@ -206,7 +206,7 @@ io_mapping_create_wc(resource_size_t base, { struct io_mapping *iomap; - iomap = kmalloc_obj(*iomap, GFP_KERNEL); + iomap = kmalloc_obj(*iomap); if (!iomap) return NULL; diff --git a/include/net/act_api.h b/include/net/act_api.h index 453d6e18851b..e1e8f0f7dacb 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -159,7 +159,7 @@ int tc_action_net_init(struct net *net, struct tc_action_net *tn, { int err = 0; - tn->idrinfo = kmalloc_obj(*tn->idrinfo, GFP_KERNEL); + tn->idrinfo = kmalloc_obj(*tn->idrinfo); if (!tn->idrinfo) return -ENOMEM; tn->ops = ops; diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h index 171ee6f7aa83..8aca881937da 100644 --- a/include/net/fq_impl.h +++ b/include/net/fq_impl.h @@ -358,7 +358,7 @@ static int fq_init(struct fq *fq, int flows_cnt) fq->limit = 8192; fq->memory_limit = 16 << 20; /* 16 MBytes */ - fq->flows = kvzalloc_objs(fq->flows[0], fq->flows_cnt, GFP_KERNEL); + fq->flows = kvzalloc_objs(fq->flows[0], fq->flows_cnt); if (!fq->flows) return -ENOMEM; diff --git a/init/initramfs.c b/init/initramfs.c index 3d89e31e0d8a..7568e4f3c029 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -102,7 +102,7 @@ static char __init *find_link(int major, int minor, int ino, continue; return (*p)->name; } - q = kmalloc_obj(struct hash, GFP_KERNEL); + q = kmalloc_obj(struct hash); if (!q) panic_show_mem("can't allocate link hash entry"); q->major = major; @@ -517,7 +517,7 @@ char * __init unpack_to_rootfs(char *buf, unsigned long len) char header[CPIO_HDRLEN]; char symlink[PATH_MAX + N_ALIGN(PATH_MAX) + 1]; char name[N_ALIGN(PATH_MAX)]; - } *bufs = kmalloc_obj(*bufs, GFP_KERNEL); + } *bufs = kmalloc_obj(*bufs); if (!bufs) panic_show_mem("can't allocate buffers"); diff --git a/init/initramfs_test.c b/init/initramfs_test.c index 1e75faec678b..2ce38d9a8fd0 100644 --- a/init/initramfs_test.c +++ b/init/initramfs_test.c @@ -403,7 +403,7 @@ static void __init initramfs_test_fname_pad(struct kunit *test) struct test_fname_pad { char padded_fname[4096 - CPIO_HDRLEN]; char cpio_srcbuf[CPIO_HDRLEN + PATH_MAX + 3 + sizeof(fdata)]; - } *tbufs = kzalloc_obj(struct test_fname_pad, GFP_KERNEL); + } *tbufs = kzalloc_obj(struct test_fname_pad); struct initramfs_test_cpio c[] = { { .magic = "070701", .ino = 1, @@ -457,7 +457,7 @@ static void __init initramfs_test_fname_path_max(struct kunit *test) char fname_oversize[PATH_MAX + 1]; char fname_ok[PATH_MAX]; char cpio_src[(CPIO_HDRLEN + PATH_MAX + 3 + sizeof(fdata)) * 2]; - } *tbufs = kzalloc_obj(struct test_fname_path_max, GFP_KERNEL); + } *tbufs = kzalloc_obj(struct test_fname_path_max); struct initramfs_test_cpio c[] = { { .magic = "070701", .ino = 1, diff --git a/io_uring/eventfd.c b/io_uring/eventfd.c index 0120ecd97321..cbea1c289485 100644 --- a/io_uring/eventfd.c +++ b/io_uring/eventfd.c @@ -127,7 +127,7 @@ int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg, if (copy_from_user(&fd, fds, sizeof(*fds))) return -EFAULT; - ev_fd = kmalloc_obj(*ev_fd, GFP_KERNEL); + ev_fd = kmalloc_obj(*ev_fd); if (!ev_fd) return -ENOMEM; diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 2d04ff565920..7a9f94a0ce6f 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -897,7 +897,7 @@ static bool create_io_worker(struct io_wq *wq, struct io_wq_acct *acct) __set_current_state(TASK_RUNNING); - worker = kzalloc_obj(*worker, GFP_KERNEL); + worker = kzalloc_obj(*worker); if (!worker) { fail: atomic_dec(&acct->nr_running); @@ -1255,7 +1255,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) if (WARN_ON_ONCE(!bounded)) return ERR_PTR(-EINVAL); - wq = kzalloc_obj(struct io_wq, GFP_KERNEL); + wq = kzalloc_obj(struct io_wq); if (!wq) return ERR_PTR(-ENOMEM); diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 3c64c458a281..aa95703165f1 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -226,7 +226,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) int hash_bits; bool ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index aea1794dc5f6..2ffa95b1c601 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -265,7 +265,7 @@ static int io_ring_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg, * a speculative peek operation. */ if (arg->mode & KBUF_MODE_EXPAND && nr_avail > nr_iovs && arg->max_len) { - iov = kmalloc_objs(struct iovec, nr_avail, GFP_KERNEL); + iov = kmalloc_objs(struct iovec, nr_avail); if (unlikely(!iov)) return -ENOMEM; if (arg->mode & KBUF_MODE_FREE) diff --git a/io_uring/mock_file.c b/io_uring/mock_file.c index 221b60ad0723..b318ed697998 100644 --- a/io_uring/mock_file.c +++ b/io_uring/mock_file.c @@ -115,7 +115,7 @@ static ssize_t io_mock_delay_rw(struct kiocb *iocb, size_t len) struct io_mock_file *mf = iocb->ki_filp->private_data; struct io_mock_iocb *mio; - mio = kzalloc_obj(*mio, GFP_KERNEL); + mio = kzalloc_obj(*mio); if (!mio) return -ENOMEM; diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 9b799e7ba889..d84f48d90d40 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -683,7 +683,7 @@ static bool io_coalesce_buffer(struct page ***pages, int *nr_pages, unsigned i, j; /* Store head pages only*/ - new_array = kvmalloc_objs(struct page *, nr_folios, GFP_KERNEL); + new_array = kvmalloc_objs(struct page *, nr_folios); if (!new_array) return false; diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index 97e64d7d029f..c6bb938ec5ea 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -153,7 +153,7 @@ static struct io_sq_data *io_get_sq_data(struct io_uring_params *p, return sqd; } - sqd = kzalloc_obj(*sqd, GFP_KERNEL); + sqd = kzalloc_obj(*sqd); if (!sqd) return ERR_PTR(-ENOMEM); diff --git a/io_uring/tctx.c b/io_uring/tctx.c index fa97bc7db6a3..7cbcb82aedfb 100644 --- a/io_uring/tctx.c +++ b/io_uring/tctx.c @@ -23,7 +23,7 @@ static struct io_wq *io_init_wq_offload(struct io_ring_ctx *ctx, mutex_lock(&ctx->uring_lock); hash = ctx->hash_map; if (!hash) { - hash = kzalloc_obj(*hash, GFP_KERNEL); + hash = kzalloc_obj(*hash); if (!hash) { mutex_unlock(&ctx->uring_lock); return ERR_PTR(-ENOMEM); @@ -80,7 +80,7 @@ __cold int io_uring_alloc_task_context(struct task_struct *task, struct io_uring_task *tctx; int ret; - tctx = kzalloc_obj(*tctx, GFP_KERNEL); + tctx = kzalloc_obj(*tctx); if (unlikely(!tctx)) return -ENOMEM; @@ -139,7 +139,7 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx) if (tctx->io_wq) io_wq_set_exit_on_idle(tctx->io_wq, false); if (!xa_load(&tctx->xa, (unsigned long)ctx)) { - node = kmalloc_obj(*node, GFP_KERNEL); + node = kmalloc_obj(*node); if (!node) return -ENOMEM; node->ctx = ctx; diff --git a/io_uring/xattr.c b/io_uring/xattr.c index 28475bf8ed47..5303df3f247f 100644 --- a/io_uring/xattr.c +++ b/io_uring/xattr.c @@ -56,7 +56,7 @@ static int __io_getxattr_prep(struct io_kiocb *req, if (ix->ctx.flags) return -EINVAL; - ix->ctx.kname = kmalloc_obj(*ix->ctx.kname, GFP_KERNEL); + ix->ctx.kname = kmalloc_obj(*ix->ctx.kname); if (!ix->ctx.kname) return -ENOMEM; @@ -133,7 +133,7 @@ static int __io_setxattr_prep(struct io_kiocb *req, ix->ctx.size = READ_ONCE(sqe->len); ix->ctx.flags = READ_ONCE(sqe->xattr_flags); - ix->ctx.kname = kmalloc_obj(*ix->ctx.kname, GFP_KERNEL); + ix->ctx.kname = kmalloc_obj(*ix->ctx.kname); if (!ix->ctx.kname) return -ENOMEM; diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index affb802fa2da..cf5bec065aaf 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -452,7 +452,7 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq, } ret = -ENOMEM; - area = kzalloc_obj(*area, GFP_KERNEL); + area = kzalloc_obj(*area); if (!area) goto err; area->ifq = ifq; @@ -514,7 +514,7 @@ static struct io_zcrx_ifq *io_zcrx_ifq_alloc(struct io_ring_ctx *ctx) { struct io_zcrx_ifq *ifq; - ifq = kzalloc_obj(*ifq, GFP_KERNEL); + ifq = kzalloc_obj(*ifq); if (!ifq) return NULL; diff --git a/ipc/mqueue.c b/ipc/mqueue.c index a90aa6803f1b..4798b375972b 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -449,7 +449,7 @@ static int mqueue_init_fs_context(struct fs_context *fc) { struct mqueue_fs_context *ctx; - ctx = kzalloc_obj(struct mqueue_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct mqueue_fs_context); if (!ctx) return -ENOMEM; @@ -1088,7 +1088,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, * fall back to that if necessary. */ if (!info->node_cache) - new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL); + new_leaf = kmalloc_obj(*new_leaf); spin_lock(&info->lock); @@ -1181,7 +1181,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, * fall back to that if necessary. */ if (!info->node_cache) - new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL); + new_leaf = kmalloc_obj(*new_leaf); spin_lock(&info->lock); diff --git a/ipc/sem.c b/ipc/sem.c index 2a19244cff22..6cdf862b1f5c 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -2234,7 +2234,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, return -EINVAL; if (nsops > SEMOPM_FAST) { - sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL); + sops = kvmalloc_objs(*sops, nsops); if (sops == NULL) return -ENOMEM; } diff --git a/ipc/shm.c b/ipc/shm.c index b94248570304..a95dae447707 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1618,7 +1618,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, rcu_read_unlock(); err = -ENOMEM; - sfd = kzalloc_obj(*sfd, GFP_KERNEL); + sfd = kzalloc_obj(*sfd); if (!sfd) { fput(base); goto out_nattch; diff --git a/ipc/util.c b/ipc/util.c index 59235ffba0d9..9eb89820594e 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -141,7 +141,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header, struct proc_dir_entry *pde; struct ipc_proc_iface *iface; - iface = kmalloc_obj(*iface, GFP_KERNEL); + iface = kmalloc_obj(*iface); if (!iface) return; iface->path = path; diff --git a/kernel/acct.c b/kernel/acct.c index 06e8b79eaf7e..1e19722c64c3 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -255,7 +255,7 @@ static int acct_on(const char __user *name) if (!(file->f_mode & FMODE_CAN_WRITE)) return -EIO; - acct = kzalloc_obj(struct bsd_acct_struct, GFP_KERNEL); + acct = kzalloc_obj(struct bsd_acct_struct); if (!acct) return -ENOMEM; diff --git a/kernel/async.c b/kernel/async.c index 862532ad328a..0e3a783dc991 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -261,7 +261,7 @@ bool async_schedule_dev_nocall(async_func_t func, struct device *dev) { struct async_entry *entry; - entry = kzalloc_obj(struct async_entry, GFP_KERNEL); + entry = kzalloc_obj(struct async_entry); /* Give up if there is no memory or too much work. */ if (!entry || atomic_read(&entry_count) > MAX_WORK) { diff --git a/kernel/audit.c b/kernel/audit.c index 838ca1648f7b..ad46aa11d42c 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -545,7 +545,7 @@ static int auditd_set(struct pid *pid, u32 portid, struct net *net, if (!pid || !net) return -EINVAL; - ac_new = kzalloc_obj(*ac_new, GFP_KERNEL); + ac_new = kzalloc_obj(*ac_new); if (!ac_new) return -ENOMEM; ac_new->pid = get_pid(pid); @@ -1044,7 +1044,7 @@ static void audit_send_reply(struct sk_buff *request_skb, int seq, int type, int struct task_struct *tsk; struct audit_reply *reply; - reply = kzalloc_obj(*reply, GFP_KERNEL); + reply = kzalloc_obj(*reply); if (!reply) return; diff --git a/kernel/audit_fsnotify.c b/kernel/audit_fsnotify.c index 7b89e1ccb5a4..a4401f651060 100644 --- a/kernel/audit_fsnotify.c +++ b/kernel/audit_fsnotify.c @@ -89,7 +89,7 @@ struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, char *pa goto out; } - audit_mark = kzalloc_obj(*audit_mark, GFP_KERNEL); + audit_mark = kzalloc_obj(*audit_mark); if (unlikely(!audit_mark)) { audit_mark = ERR_PTR(-ENOMEM); goto out; diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 6a73b30929c0..096faac2435c 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c @@ -139,7 +139,7 @@ static struct audit_parent *audit_init_parent(const struct path *path) struct audit_parent *parent; int ret; - parent = kzalloc_obj(*parent, GFP_KERNEL); + parent = kzalloc_obj(*parent); if (unlikely(!parent)) return ERR_PTR(-ENOMEM); @@ -161,7 +161,7 @@ static struct audit_watch *audit_init_watch(char *path) { struct audit_watch *watch; - watch = kzalloc_obj(*watch, GFP_KERNEL); + watch = kzalloc_obj(*watch); if (unlikely(!watch)) return ERR_PTR(-ENOMEM); diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index e2d6f9a91a49..2bffaef0011b 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -108,11 +108,11 @@ static inline struct audit_entry *audit_init_entry(u32 field_count) struct audit_entry *entry; struct audit_field *fields; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (unlikely(!entry)) return NULL; - fields = kzalloc_objs(*fields, field_count, GFP_KERNEL); + fields = kzalloc_objs(*fields, field_count); if (unlikely(!fields)) { kfree(entry); return NULL; @@ -1180,7 +1180,7 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq) * happen if we're actually running in the context of auditctl * trying to _send_ the stuff */ - dest = kmalloc_obj(*dest, GFP_KERNEL); + dest = kmalloc_obj(*dest); if (!dest) return -ENOMEM; dest->net = get_net(sock_net(NETLINK_CB(request_skb).sk)); diff --git a/kernel/auditsc.c b/kernel/auditsc.c index e45883de200f..f6af6a8f68c4 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -255,7 +255,7 @@ static int grow_tree_refs(struct audit_context *ctx) { struct audit_tree_refs *p = ctx->trees; - ctx->trees = kzalloc_obj(struct audit_tree_refs, GFP_KERNEL); + ctx->trees = kzalloc_obj(struct audit_tree_refs); if (!ctx->trees) { ctx->trees = p; return 0; @@ -1032,7 +1032,7 @@ static inline struct audit_context *audit_alloc_context(enum audit_state state) { struct audit_context *context; - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) return NULL; context->context = AUDIT_CTX_UNUSED; @@ -2650,7 +2650,7 @@ int __audit_sockaddr(int len, void *a) struct audit_context *context = audit_context(); if (!context->sockaddr) { - void *p = kmalloc_obj(struct sockaddr_storage, GFP_KERNEL); + void *p = kmalloc_obj(struct sockaddr_storage); if (!p) return -ENOMEM; @@ -2743,7 +2743,7 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm, struct audit_context *context = audit_context(); struct cpu_vfs_cap_data vcaps; - ax = kmalloc_obj(*ax, GFP_KERNEL); + ax = kmalloc_obj(*ax); if (!ax) return -ENOMEM; diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c index 5baea15cb07d..144f30e740e8 100644 --- a/kernel/bpf/arena.c +++ b/kernel/bpf/arena.c @@ -324,7 +324,7 @@ static int remember_vma(struct bpf_arena *arena, struct vm_area_struct *vma) { struct vma_list *vml; - vml = kmalloc_obj(*vml, GFP_KERNEL); + vml = kmalloc_obj(*vml); if (!vml) return -ENOMEM; refcount_set(&vml->mmap_count, 1); diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 188b0e35f856..26763df6134a 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -1061,7 +1061,7 @@ static int prog_array_map_poke_track(struct bpf_map *map, goto out; } - elem = kmalloc_obj(*elem, GFP_KERNEL); + elem = kmalloc_obj(*elem); if (!elem) { ret = -ENOMEM; goto out; @@ -1237,7 +1237,7 @@ static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file, { struct bpf_event_entry *ee; - ee = kzalloc_obj(*ee, GFP_KERNEL); + ee = kzalloc_obj(*ee); if (ee) { ee->event = perf_file->private_data; ee->perf_file = perf_file; diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c index b5d16050f7b3..f5eaeb2493d4 100644 --- a/kernel/bpf/bpf_iter.c +++ b/kernel/bpf/bpf_iter.c @@ -295,7 +295,7 @@ int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info) { struct bpf_iter_target_info *tinfo; - tinfo = kzalloc_obj(*tinfo, GFP_KERNEL); + tinfo = kzalloc_obj(*tinfo); if (!tinfo) return -ENOMEM; diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c index 1ff292a6f3ed..05b366b821c3 100644 --- a/kernel/bpf/bpf_struct_ops.c +++ b/kernel/bpf/bpf_struct_ops.c @@ -218,7 +218,7 @@ static int prepare_arg_info(struct btf *btf, args = btf_params(func_proto); stub_args = btf_params(stub_func_proto); - info_buf = kzalloc_objs(*info_buf, nargs, GFP_KERNEL); + info_buf = kzalloc_objs(*info_buf, nargs); if (!info_buf) return -ENOMEM; @@ -378,7 +378,7 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc, if (!is_valid_value_type(btf, value_id, t, value_name)) return -EINVAL; - arg_info = kzalloc_objs(*arg_info, btf_type_vlen(t), GFP_KERNEL); + arg_info = kzalloc_objs(*arg_info, btf_type_vlen(t)); if (!arg_info) return -ENOMEM; @@ -720,7 +720,7 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, if (uvalue->common.state || refcount_read(&uvalue->common.refcnt)) return -EINVAL; - tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX); if (!tlinks) return -ENOMEM; diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index ee9037aa9ab7..319916f8fc64 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -8306,7 +8306,7 @@ static int btf_module_notify(struct notifier_block *nb, unsigned long op, switch (op) { case MODULE_STATE_COMING: - btf_mod = kzalloc_obj(*btf_mod, GFP_KERNEL); + btf_mod = kzalloc_obj(*btf_mod); if (!btf_mod) { err = -ENOMEM; goto out; @@ -8341,7 +8341,7 @@ static int btf_module_notify(struct notifier_block *nb, unsigned long op, if (IS_ENABLED(CONFIG_SYSFS)) { struct bin_attribute *attr; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (!attr) goto out; diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index 5d7a35e476e9..876f6a81a9b6 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -845,7 +845,7 @@ static int __cgroup_bpf_attach(struct cgroup *cgrp, if (pl) { old_prog = pl->prog; } else { - pl = kmalloc_obj(*pl, GFP_KERNEL); + pl = kmalloc_obj(*pl); if (!pl) { bpf_cgroup_storages_free(new_storage); return -ENOMEM; diff --git a/kernel/bpf/crypto.c b/kernel/bpf/crypto.c index 2b0660c32c92..51f89cecefb4 100644 --- a/kernel/bpf/crypto.c +++ b/kernel/bpf/crypto.c @@ -68,7 +68,7 @@ int bpf_crypto_register_type(const struct bpf_crypto_type *type) goto unlock; } - node = kmalloc_obj(*node, GFP_KERNEL); + node = kmalloc_obj(*node); err = -ENOMEM; if (!node) goto unlock; @@ -176,7 +176,7 @@ bpf_crypto_ctx_create(const struct bpf_crypto_params *params, u32 params__sz, goto err_module_put; } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) { *err = -ENOMEM; goto err_module_put; diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 42a692682f18..6eb6c82ed2ee 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -3993,7 +3993,7 @@ __bpf_kfunc struct bpf_key *bpf_lookup_user_key(s32 serial, u64 flags) if (IS_ERR(key_ref)) return NULL; - bkey = kmalloc_obj(*bkey, GFP_KERNEL); + bkey = kmalloc_obj(*bkey); if (!bkey) { key_put(key_ref_to_ptr(key_ref)); return NULL; diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index a111b0e9214e..25c06a011825 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -1044,7 +1044,7 @@ static int bpf_init_fs_context(struct fs_context *fc) { struct bpf_mount_opts *opts; - opts = kzalloc_obj(struct bpf_mount_opts, GFP_KERNEL); + opts = kzalloc_obj(struct bpf_mount_opts); if (!opts) return -ENOMEM; diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c index 7fcbbe0ad925..0ad97d643bf4 100644 --- a/kernel/bpf/offload.c +++ b/kernel/bpf/offload.c @@ -72,7 +72,7 @@ static int __bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev, struct bpf_offload_netdev *ondev; int err; - ondev = kzalloc_obj(*ondev, GFP_KERNEL); + ondev = kzalloc_obj(*ondev); if (!ondev) return -ENOMEM; @@ -777,7 +777,7 @@ bpf_offload_dev_create(const struct bpf_prog_offload_ops *ops, void *priv) { struct bpf_offload_dev *offdev; - offdev = kzalloc_obj(*offdev, GFP_KERNEL); + offdev = kzalloc_obj(*offdev); if (!offdev) return ERR_PTR(-ENOMEM); diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c index b94565843f77..84db9e658e52 100644 --- a/kernel/bpf/trampoline.c +++ b/kernel/bpf/trampoline.c @@ -256,7 +256,7 @@ static int direct_ops_mod(struct bpf_trampoline *tr, void *addr, bool lock_direc */ static int direct_ops_alloc(struct bpf_trampoline *tr) { - tr->fops = kzalloc_obj(struct ftrace_ops, GFP_KERNEL); + tr->fops = kzalloc_obj(struct ftrace_ops); if (!tr->fops) return -ENOMEM; tr->fops->private = tr; @@ -342,7 +342,7 @@ static struct bpf_trampoline *bpf_trampoline_lookup(u64 key, unsigned long ip) goto out; } } - tr = kzalloc_obj(*tr, GFP_KERNEL); + tr = kzalloc_obj(*tr); if (!tr) goto out; if (direct_ops_alloc(tr)) { @@ -446,7 +446,7 @@ bpf_trampoline_get_progs(const struct bpf_trampoline *tr, int *total, bool *ip_a int kind; *total = 0; - tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX); if (!tlinks) return ERR_PTR(-ENOMEM); @@ -569,7 +569,7 @@ static struct bpf_tramp_image *bpf_tramp_image_alloc(u64 key, int size) void *image; int err = -ENOMEM; - im = kzalloc_obj(*im, GFP_KERNEL); + im = kzalloc_obj(*im); if (!im) goto out; diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 63f05d90e708..bb12ba020649 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -22769,7 +22769,7 @@ static int jit_subprogs(struct bpf_verifier_env *env) goto out_undo_insn; err = -ENOMEM; - func = kzalloc_objs(prog, env->subprog_cnt, GFP_KERNEL); + func = kzalloc_objs(prog, env->subprog_cnt); if (!func) goto out_undo_insn; diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 0449b062dd1c..a4337c9b5287 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -317,7 +317,7 @@ static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, return l; /* entry not found; create a new one */ - l = kzalloc_obj(struct cgroup_pidlist, GFP_KERNEL); + l = kzalloc_obj(struct cgroup_pidlist); if (!l) return l; @@ -352,7 +352,7 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, * show up until sometime later on. */ length = cgroup_task_count(cgrp); - array = kvmalloc_objs(pid_t, length, GFP_KERNEL); + array = kvmalloc_objs(pid_t, length); if (!array) return -ENOMEM; /* now, populate the array */ @@ -1237,7 +1237,7 @@ static int cgroup1_root_to_use(struct fs_context *fc) if (ctx->ns != &init_cgroup_ns) return -EPERM; - root = kzalloc_obj(*root, GFP_KERNEL); + root = kzalloc_obj(*root); if (!root) return -ENOMEM; diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 7d220276d019..c14fbdc4cdbe 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1168,7 +1168,7 @@ static int allocate_cgrp_cset_links(int count, struct list_head *tmp_links) INIT_LIST_HEAD(tmp_links); for (i = 0; i < count; i++) { - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) { free_cgrp_cset_links(tmp_links); return -ENOMEM; @@ -1241,7 +1241,7 @@ static struct css_set *find_css_set(struct css_set *old_cset, if (cset) return cset; - cset = kzalloc_obj(*cset, GFP_KERNEL); + cset = kzalloc_obj(*cset); if (!cset) return NULL; @@ -2350,7 +2350,7 @@ static int cgroup_init_fs_context(struct fs_context *fc) { struct cgroup_fs_context *ctx; - ctx = kzalloc_obj(struct cgroup_fs_context, GFP_KERNEL); + ctx = kzalloc_obj(struct cgroup_fs_context); if (!ctx) return -ENOMEM; @@ -4251,7 +4251,7 @@ static int cgroup_file_open(struct kernfs_open_file *of) struct cgroup_file_ctx *ctx; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c index 8e7ffc205c3b..7308e9b02495 100644 --- a/kernel/cgroup/cpuset-v1.c +++ b/kernel/cgroup/cpuset-v1.c @@ -316,7 +316,7 @@ void cpuset1_hotplug_update_tasks(struct cpuset *cs, css_tryget_online(&cs->css)) { struct cpuset_remove_tasks_struct *s; - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (WARN_ON_ONCE(!s)) { css_put(&cs->css); return; @@ -653,7 +653,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, if (!doms) goto done; - dattr = kmalloc_obj(struct sched_domain_attr, GFP_KERNEL); + dattr = kmalloc_obj(struct sched_domain_attr); if (dattr) { *dattr = SD_ATTR_INIT; update_domain_attr_tree(dattr, &top_cpuset); @@ -664,7 +664,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, goto done; } - csa = kmalloc_objs(cp, nr_cpusets(), GFP_KERNEL); + csa = kmalloc_objs(cp, nr_cpusets()); if (!csa) goto done; csn = 0; @@ -727,7 +727,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains, * The rest of the code, including the scheduler, can deal with * dattr==NULL case. No need to abort if alloc fails. */ - dattr = kmalloc_objs(struct sched_domain_attr, ndoms, GFP_KERNEL); + dattr = kmalloc_objs(struct sched_domain_attr, ndoms); for (nslot = 0, i = 0; i < csn; i++) { nslot_update = 0; diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 384d9d6e323b..9faf34377a88 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -536,7 +536,7 @@ static struct cpuset *dup_or_alloc_cpuset(struct cpuset *cs) /* Allocate base structure */ trial = cs ? kmemdup(cs, sizeof(*cs), GFP_KERNEL) : - kzalloc_obj(*cs, GFP_KERNEL); + kzalloc_obj(*cs); if (!trial) return NULL; @@ -791,7 +791,7 @@ static int generate_sched_domains(cpumask_var_t **domains, goto generate_doms; } - csa = kmalloc_objs(cp, nr_cpusets(), GFP_KERNEL); + csa = kmalloc_objs(cp, nr_cpusets()); if (!csa) goto done; @@ -835,7 +835,7 @@ generate_doms: * The rest of the code, including the scheduler, can deal with * dattr==NULL case. No need to abort if alloc fails. */ - dattr = kmalloc_objs(struct sched_domain_attr, ndoms, GFP_KERNEL); + dattr = kmalloc_objs(struct sched_domain_attr, ndoms); /* * Cgroup v2 doesn't support domain attributes, just set all of them @@ -2478,7 +2478,7 @@ static void cpuset_migrate_mm(struct mm_struct *mm, const nodemask_t *from, return; } - mwork = kzalloc_obj(*mwork, GFP_KERNEL); + mwork = kzalloc_obj(*mwork); if (mwork) { mwork->mm = mm; mwork->from = *from; @@ -2500,7 +2500,7 @@ static void schedule_flush_migrate_mm(void) { struct callback_head *flush_cb; - flush_cb = kzalloc_obj(struct callback_head, GFP_KERNEL); + flush_cb = kzalloc_obj(struct callback_head); if (!flush_cb) return; diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c index 78429dd9e9c6..883347b87842 100644 --- a/kernel/cgroup/debug.c +++ b/kernel/cgroup/debug.c @@ -14,7 +14,7 @@ static struct cgroup_subsys_state * debug_css_alloc(struct cgroup_subsys_state *parent_css) { - struct cgroup_subsys_state *css = kzalloc_obj(*css, GFP_KERNEL); + struct cgroup_subsys_state *css = kzalloc_obj(*css); if (!css) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c index 0c8c0a135231..9d95824dc6fa 100644 --- a/kernel/cgroup/dmem.c +++ b/kernel/cgroup/dmem.c @@ -222,7 +222,7 @@ static void dmemcs_free(struct cgroup_subsys_state *css) static struct cgroup_subsys_state * dmemcs_alloc(struct cgroup_subsys_state *parent_css) { - struct dmemcg_state *dmemcs = kzalloc_obj(*dmemcs, GFP_KERNEL); + struct dmemcg_state *dmemcs = kzalloc_obj(*dmemcs); if (!dmemcs) return ERR_PTR(-ENOMEM); @@ -521,7 +521,7 @@ struct dmem_cgroup_region *dmem_cgroup_register_region(u64 size, const char *fmt if (!region_name) return ERR_PTR(-ENOMEM); - ret = kzalloc_obj(*ret, GFP_KERNEL); + ret = kzalloc_obj(*ret); if (!ret) { kfree(region_name); return ERR_PTR(-ENOMEM); @@ -597,7 +597,7 @@ get_cg_pool_unlocked(struct dmemcg_state *cg, struct dmem_cgroup_region *region) if (WARN_ON(allocpool)) continue; - allocpool = kzalloc_obj(*allocpool, GFP_KERNEL); + allocpool = kzalloc_obj(*allocpool); if (allocpool) { pool = NULL; continue; diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c index 85344b107873..8545e0d1ba3d 100644 --- a/kernel/cgroup/legacy_freezer.c +++ b/kernel/cgroup/legacy_freezer.c @@ -81,7 +81,7 @@ freezer_css_alloc(struct cgroup_subsys_state *parent_css) { struct freezer *freezer; - freezer = kzalloc_obj(struct freezer, GFP_KERNEL); + freezer = kzalloc_obj(struct freezer); if (!freezer) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c index 7c3ae3a76c8d..4a9e2557141c 100644 --- a/kernel/cgroup/misc.c +++ b/kernel/cgroup/misc.c @@ -445,7 +445,7 @@ misc_cg_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) { cg = &root_cg; } else { - cg = kzalloc_obj(*cg, GFP_KERNEL); + cg = kzalloc_obj(*cg); if (!cg) return ERR_PTR(-ENOMEM); } diff --git a/kernel/cgroup/pids.c b/kernel/cgroup/pids.c index 6221573fc6ad..ecbb839d2acb 100644 --- a/kernel/cgroup/pids.c +++ b/kernel/cgroup/pids.c @@ -80,7 +80,7 @@ pids_css_alloc(struct cgroup_subsys_state *parent) { struct pids_cgroup *pids; - pids = kzalloc_obj(struct pids_cgroup, GFP_KERNEL); + pids = kzalloc_obj(struct pids_cgroup); if (!pids) return ERR_PTR(-ENOMEM); diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c index 9d3693574b11..09258eebb5c7 100644 --- a/kernel/cgroup/rdma.c +++ b/kernel/cgroup/rdma.c @@ -134,7 +134,7 @@ get_cg_rpool_locked(struct rdma_cgroup *cg, struct rdmacg_device *device) if (rpool) return rpool; - rpool = kzalloc_obj(*rpool, GFP_KERNEL); + rpool = kzalloc_obj(*rpool); if (!rpool) return ERR_PTR(-ENOMEM); @@ -443,7 +443,7 @@ static ssize_t rdmacg_resource_set_max(struct kernfs_open_file *of, goto err; } - new_limits = kzalloc_objs(int, RDMACG_RESOURCE_MAX, GFP_KERNEL); + new_limits = kzalloc_objs(int, RDMACG_RESOURCE_MAX); if (!new_limits) { ret = -ENOMEM; goto err; @@ -566,7 +566,7 @@ rdmacg_css_alloc(struct cgroup_subsys_state *parent) { struct rdma_cgroup *cg; - cg = kzalloc_obj(*cg, GFP_KERNEL); + cg = kzalloc_obj(*cg); if (!cg) return ERR_PTR(-ENOMEM); diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 2146ca0f0ed8..2c1a3791e410 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -368,7 +368,7 @@ static int __crash_shrink_memory(struct resource *old_res, { struct resource *ram_res; - ram_res = kzalloc_obj(*ram_res, GFP_KERNEL); + ram_res = kzalloc_obj(*ram_res); if (!ram_res) return -ENOMEM; diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c index 13191d7c7a32..1f4067fbdb94 100644 --- a/kernel/crash_dump_dm_crypt.c +++ b/kernel/crash_dump_dm_crypt.c @@ -252,7 +252,7 @@ static struct config_item *config_keys_make_item(struct config_group *group, return ERR_PTR(-EINVAL); } - config_key = kzalloc_obj(struct config_key, GFP_KERNEL); + config_key = kzalloc_obj(struct config_key); if (!config_key) return ERR_PTR(-ENOMEM); diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c index d580ab6d2e33..1147497bc512 100644 --- a/kernel/dma/coherent.c +++ b/kernel/dma/coherent.c @@ -49,7 +49,7 @@ static struct dma_coherent_mem *dma_init_coherent_memory(phys_addr_t phys_addr, if (!mem_base) return ERR_PTR(-EINVAL); - dma_mem = kzalloc_obj(struct dma_coherent_mem, GFP_KERNEL); + dma_mem = kzalloc_obj(struct dma_coherent_mem); if (!dma_mem) goto out_unmap_membase; dma_mem->bitmap = bitmap_zalloc(pages, GFP_KERNEL); diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 3be263d7afd6..86f87e43438c 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -900,7 +900,7 @@ void dma_debug_add_bus(const struct bus_type *bus) if (dma_debug_disabled()) return; - nb = kzalloc_obj(struct notifier_block, GFP_KERNEL); + nb = kzalloc_obj(struct notifier_block); if (nb == NULL) { pr_err("dma_debug_add_bus: out of memory\n"); return; diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 280ec952c5e1..8f43a930716d 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -654,7 +654,7 @@ int dma_direct_set_offset(struct device *dev, phys_addr_t cpu_start, if (!offset) return 0; - map = kzalloc_objs(*map, 2, GFP_KERNEL); + map = kzalloc_objs(*map, 2); if (!map) return -ENOMEM; map[0].cpu_start = cpu_start; diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index 48ab3d957960..0f33b3ea7daf 100644 --- a/kernel/dma/map_benchmark.c +++ b/kernel/dma/map_benchmark.c @@ -121,7 +121,7 @@ static int do_map_benchmark(struct map_benchmark_data *map) int ret = 0; int i; - tsk = kmalloc_objs(*tsk, threads, GFP_KERNEL); + tsk = kmalloc_objs(*tsk, threads); if (!tsk) return -ENOMEM; diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c index b53e66417e5f..205c0c0ba2fe 100644 --- a/kernel/dma/remap.c +++ b/kernel/dma/remap.c @@ -45,7 +45,7 @@ void *dma_common_contiguous_remap(struct page *page, size_t size, void *vaddr; int i; - pages = kvmalloc_objs(struct page *, count, GFP_KERNEL); + pages = kvmalloc_objs(struct page *, count); if (!pages) return NULL; for (i = 0; i < count; i++) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index cb8efc059e6a..d8e6f1d889d5 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -1809,18 +1809,18 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem, if (!mem) { struct io_tlb_pool *pool; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return -ENOMEM; pool = &mem->defpool; - pool->slots = kzalloc_objs(*pool->slots, nslabs, GFP_KERNEL); + pool->slots = kzalloc_objs(*pool->slots, nslabs); if (!pool->slots) { kfree(mem); return -ENOMEM; } - pool->areas = kzalloc_objs(*pool->areas, nareas, GFP_KERNEL); + pool->areas = kzalloc_objs(*pool->areas, nareas); if (!pool->areas) { kfree(pool->slots); kfree(mem); diff --git a/kernel/events/core.c b/kernel/events/core.c index 33c84a605799..ac70d68217b6 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5058,7 +5058,7 @@ alloc_perf_context(struct task_struct *task) { struct perf_event_context *ctx; - ctx = kzalloc_obj(struct perf_event_context, GFP_KERNEL); + ctx = kzalloc_obj(struct perf_event_context); if (!ctx) return NULL; @@ -5198,7 +5198,7 @@ find_get_pmu_context(struct pmu *pmu, struct perf_event_context *ctx, return epc; } - new = kzalloc_obj(*epc, GFP_KERNEL); + new = kzalloc_obj(*epc); if (!new) return ERR_PTR(-ENOMEM); @@ -5374,7 +5374,7 @@ alloc_perf_ctx_data(struct kmem_cache *ctx_cache, bool global) { struct perf_ctx_data *cd; - cd = kzalloc_obj(*cd, GFP_KERNEL); + cd = kzalloc_obj(*cd); if (!cd) return NULL; @@ -11111,7 +11111,7 @@ static int swevent_hlist_get_cpu(int cpu) cpumask_test_cpu(cpu, perf_online_mask)) { struct swevent_hlist *hlist; - hlist = kzalloc_obj(*hlist, GFP_KERNEL); + hlist = kzalloc_obj(*hlist); if (!hlist) { err = -ENOMEM; goto exit; @@ -12634,7 +12634,7 @@ static int pmu_dev_alloc(struct pmu *pmu) { int ret = -ENOMEM; - pmu->dev = kzalloc_obj(struct device, GFP_KERNEL); + pmu->dev = kzalloc_obj(struct device); if (!pmu->dev) goto out; @@ -15269,7 +15269,7 @@ perf_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) { struct perf_cgroup *jc; - jc = kzalloc_obj(*jc, GFP_KERNEL); + jc = kzalloc_obj(*jc); if (!jc) return ERR_PTR(-ENOMEM); diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index d39dcc19d21e..923b24b321cc 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -238,7 +238,7 @@ static int delayed_uprobe_add(struct uprobe *uprobe, struct mm_struct *mm) if (delayed_uprobe_check(uprobe, mm)) return 0; - du = kzalloc_obj(*du, GFP_KERNEL); + du = kzalloc_obj(*du); if (!du) return -ENOMEM; @@ -994,7 +994,7 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset, { struct uprobe *uprobe, *cur_uprobe; - uprobe = kzalloc_obj(struct uprobe, GFP_KERNEL); + uprobe = kzalloc_obj(struct uprobe); if (!uprobe) return ERR_PTR(-ENOMEM); @@ -1252,7 +1252,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) } do { - info = kmalloc_obj(struct map_info, GFP_KERNEL); + info = kmalloc_obj(struct map_info); if (!info) { curr = ERR_PTR(-ENOMEM); goto out; @@ -1755,7 +1755,7 @@ static struct xol_area *__create_xol_area(unsigned long vaddr) struct xol_area *area; void *insns; - area = kzalloc_obj(*area, GFP_KERNEL); + area = kzalloc_obj(*area); if (unlikely(!area)) goto out; @@ -2069,7 +2069,7 @@ static struct uprobe_task *alloc_utask(void) { struct uprobe_task *utask; - utask = kzalloc_obj(*utask, GFP_KERNEL); + utask = kzalloc_obj(*utask); if (!utask) return NULL; @@ -2102,7 +2102,7 @@ static struct return_instance *alloc_return_instance(struct uprobe_task *utask) if (ri) return ri; - ri = kzalloc_obj(*ri, GFP_KERNEL); + ri = kzalloc_obj(*ri); if (!ri) return ZERO_SIZE_PTR; diff --git a/kernel/fail_function.c b/kernel/fail_function.c index 18993fcbdbda..2eaf55005f49 100644 --- a/kernel/fail_function.c +++ b/kernel/fail_function.c @@ -57,7 +57,7 @@ static struct fei_attr *fei_attr_new(const char *sym, unsigned long addr) { struct fei_attr *attr; - attr = kzalloc_obj(*attr, GFP_KERNEL); + attr = kzalloc_obj(*attr); if (attr) { attr->kp.symbol_name = kstrdup(sym, GFP_KERNEL); if (!attr->kp.symbol_name) { diff --git a/kernel/futex/pi.c b/kernel/futex/pi.c index a73b6c713d83..bc1f7e83a37e 100644 --- a/kernel/futex/pi.c +++ b/kernel/futex/pi.c @@ -17,7 +17,7 @@ int refill_pi_state_cache(void) if (likely(current->pi_state_cache)) return 0; - pi_state = kzalloc_obj(*pi_state, GFP_KERNEL); + pi_state = kzalloc_obj(*pi_state); if (!pi_state) return -ENOMEM; diff --git a/kernel/futex/syscalls.c b/kernel/futex/syscalls.c index aec0495adabe..743c7a728237 100644 --- a/kernel/futex/syscalls.c +++ b/kernel/futex/syscalls.c @@ -333,7 +333,7 @@ SYSCALL_DEFINE5(futex_waitv, struct futex_waitv __user *, waiters, if (timeout && (ret = futex2_setup_timeout(timeout, clockid, &to))) return ret; - futexv = kzalloc_objs(*futexv, nr_futexes, GFP_KERNEL); + futexv = kzalloc_objs(*futexv, nr_futexes); if (!futexv) { ret = -ENOMEM; goto destroy_timer; diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c index 4cfdeb2c9dc2..fd98ced0e51d 100644 --- a/kernel/gcov/clang.c +++ b/kernel/gcov/clang.c @@ -81,7 +81,7 @@ static LIST_HEAD(clang_gcov_list); void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) { - struct gcov_info *info = kzalloc_obj(*info, GFP_KERNEL); + struct gcov_info *info = kzalloc_obj(*info); if (!info) return; @@ -112,7 +112,7 @@ EXPORT_SYMBOL(llvm_gcda_start_file); void llvm_gcda_emit_function(u32 ident, u32 func_checksum, u32 cfg_checksum) { - struct gcov_fn_info *info = kzalloc_obj(*info, GFP_KERNEL); + struct gcov_fn_info *info = kzalloc_obj(*info); if (!info) return; diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index 8430f5cd21b6..2acf677171b1 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c @@ -482,7 +482,7 @@ static void add_links(struct gcov_node *node, struct dentry *parent) for (num = 0; gcov_link[num].ext; num++) /* Nothing. */; - node->links = kzalloc_objs(struct dentry *, num, GFP_KERNEL); + node->links = kzalloc_objs(struct dentry *, num); if (!node->links) return; for (i = 0; i < num; i++) { @@ -731,7 +731,7 @@ static void add_info(struct gcov_node *node, struct gcov_info *info) * case the new data set is incompatible, the node only contains * unloaded data sets and there's not enough memory for the array. */ - loaded_info = kzalloc_objs(struct gcov_info *, num + 1, GFP_KERNEL); + loaded_info = kzalloc_objs(struct gcov_info *, num + 1); if (!loaded_info) { pr_warn("could not add '%s' (out of memory)\n", gcov_info_filename(info)); diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index cf6729888ee3..85c45cfe7223 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -56,7 +56,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) if (!affvecs) return NULL; - masks = kzalloc_objs(*masks, nvecs, GFP_KERNEL); + masks = kzalloc_objs(*masks, nvecs); if (!masks) return NULL; diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index 59b84a10465c..44747754530d 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -148,7 +148,7 @@ static int irq_sim_domain_map(struct irq_domain *domain, struct irq_sim_work_ctx *work_ctx = domain->host_data; struct irq_sim_irq_ctx *irq_ctx; - irq_ctx = kzalloc_obj(*irq_ctx, GFP_KERNEL); + irq_ctx = kzalloc_obj(*irq_ctx); if (!irq_ctx) return -ENOMEM; @@ -202,7 +202,7 @@ struct irq_domain *irq_domain_create_sim_full(struct fwnode_handle *fwnode, void *data) { struct irq_sim_work_ctx *work_ctx __free(kfree) = - kzalloc_obj(*work_ctx, GFP_KERNEL); + kzalloc_obj(*work_ctx); if (!work_ctx) return ERR_PTR(-ENOMEM); diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index ddc9d01b3091..7173b8b634f2 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -969,7 +969,7 @@ int irq_set_percpu_devid(unsigned int irq) if (!desc || desc->percpu_enabled) return -EINVAL; - desc->percpu_enabled = kzalloc_obj(*desc->percpu_enabled, GFP_KERNEL); + desc->percpu_enabled = kzalloc_obj(*desc->percpu_enabled); if (!desc->percpu_enabled) return -ENOMEM; diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 857fcd74ebda..cc93abf009e8 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -92,7 +92,7 @@ struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, struct irqchip_fwid *fwid; char *n; - fwid = kzalloc_obj(*fwid, GFP_KERNEL); + fwid = kzalloc_obj(*fwid); switch (type) { case IRQCHIP_FWNODE_NAMED: diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 2b05c45be1b3..2e8072437826 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1332,7 +1332,7 @@ static int irq_setup_forced_threading(struct irqaction *new) */ if (new->handler && new->thread_fn) { /* Allocate the secondary action */ - new->secondary = kzalloc_obj(struct irqaction, GFP_KERNEL); + new->secondary = kzalloc_obj(struct irqaction); if (!new->secondary) return -ENOMEM; new->secondary->handler = irq_forced_secondary_handler; @@ -2156,7 +2156,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, handler = irq_default_primary_handler; } - action = kzalloc_obj(struct irqaction, GFP_KERNEL); + action = kzalloc_obj(struct irqaction); if (!action) return -ENOMEM; @@ -2486,7 +2486,7 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f if (!affinity) affinity = cpu_possible_mask; - action = kzalloc_obj(struct irqaction, GFP_KERNEL); + action = kzalloc_obj(struct irqaction); if (!action) return NULL; diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index e4bae8f1c414..3cafa40e6ce3 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -76,7 +76,7 @@ static int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev static struct msi_desc *msi_alloc_desc(struct device *dev, int nvec, const struct irq_affinity_desc *affinity) { - struct msi_desc *desc = kzalloc_obj(*desc, GFP_KERNEL); + struct msi_desc *desc = kzalloc_obj(*desc); if (!desc) return NULL; @@ -530,7 +530,7 @@ static int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc) struct device_attribute *attrs; int ret, i; - attrs = kzalloc_objs(*attrs, desc->nvec_used, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, desc->nvec_used); if (!attrs) return -ENOMEM; diff --git a/kernel/kallsyms_selftest.c b/kernel/kallsyms_selftest.c index d2aeb6b7c393..8f6c4e9b3a1c 100644 --- a/kernel/kallsyms_selftest.c +++ b/kernel/kallsyms_selftest.c @@ -264,7 +264,7 @@ static int test_kallsyms_basic_function(void) char namebuf[KSYM_NAME_LEN]; struct test_stat *stat, *stat2; - stat = kmalloc_objs(*stat, 2, GFP_KERNEL); + stat = kmalloc_objs(*stat, 2); if (!stat) return -ENOMEM; stat2 = stat + 1; diff --git a/kernel/kcov.c b/kernel/kcov.c index b9d4db7ea439..0b369e88c7c9 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -527,7 +527,7 @@ static int kcov_open(struct inode *inode, struct file *filep) { struct kcov *kcov; - kcov = kzalloc_obj(*kcov, GFP_KERNEL); + kcov = kzalloc_obj(*kcov); if (!kcov) return -ENOMEM; guard(spinlock_init)(&kcov->lock); diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index edb062fb43b4..79e655ea4ca1 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -168,7 +168,7 @@ static bool __report_matches(const struct expect_report *r) if (!report_available()) return false; - expect = kmalloc_obj(observed.lines, GFP_KERNEL); + expect = kmalloc_obj(observed.lines); if (WARN_ON(!expect)) return false; @@ -1538,7 +1538,7 @@ static int test_init(struct kunit *test) if (WARN_ON(!nthreads)) goto err; - threads = kzalloc_objs(struct task_struct *, nthreads + 1, GFP_KERNEL); + threads = kzalloc_objs(struct task_struct *, nthreads + 1); if (WARN_ON(!threads)) goto err; diff --git a/kernel/kexec.c b/kernel/kexec.c index 3902e7bb99fe..90756dc6339b 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -284,7 +284,7 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry, if ((flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_DEFAULT) return -EINVAL; - ksegments = kmalloc_objs(ksegments[0], nr_segments, GFP_KERNEL); + ksegments = kmalloc_objs(ksegments[0], nr_segments); if (!ksegments) return -ENOMEM; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 76e4287a4f1d..2fea396d29b9 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -231,7 +231,7 @@ struct kimage *do_kimage_alloc_init(void) struct kimage *image; /* Allocate a controlling structure */ - image = kzalloc_obj(*image, GFP_KERNEL); + image = kzalloc_obj(*image); if (!image) return NULL; @@ -975,7 +975,7 @@ void *kimage_map_segment(struct kimage *image, int idx) * Collect the source pages and map them in a contiguous VA range. */ npages = PFN_UP(eaddr) - PFN_DOWN(addr); - src_pages = kmalloc_objs(*src_pages, npages, GFP_KERNEL); + src_pages = kmalloc_objs(*src_pages, npages); if (!src_pages) { pr_err("Could not allocate ima pages array.\n"); return NULL; diff --git a/kernel/kprobes.c b/kernel/kprobes.c index b6744137b11e..15cc289a6fdf 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -900,7 +900,7 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) { struct optimized_kprobe *op; - op = kzalloc_obj(struct optimized_kprobe, GFP_KERNEL); + op = kzalloc_obj(struct optimized_kprobe); if (!op) return NULL; @@ -1117,7 +1117,7 @@ static void free_aggr_kprobe(struct kprobe *p) static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) { - return kzalloc_obj(struct kprobe, GFP_KERNEL); + return kzalloc_obj(struct kprobe); } #endif /* CONFIG_OPTPROBES */ @@ -2295,7 +2295,7 @@ int register_kretprobe(struct kretprobe *rp) rp->rh = NULL; } #else /* !CONFIG_KRETPROBE_ON_RETHOOK */ - rp->rph = kzalloc_obj(struct kretprobe_holder, GFP_KERNEL); + rp->rph = kzalloc_obj(struct kretprobe_holder); if (!rp->rph) return -ENOMEM; @@ -2499,7 +2499,7 @@ int kprobe_add_ksym_blacklist(unsigned long entry) !kallsyms_lookup_size_offset(entry, &size, &offset)) return -EINVAL; - ent = kmalloc_obj(*ent, GFP_KERNEL); + ent = kmalloc_obj(*ent); if (!ent) return -ENOMEM; ent->start_addr = entry; diff --git a/kernel/kthread.c b/kernel/kthread.c index 0b4f7328096f..20451b624b67 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -122,7 +122,7 @@ bool set_kthread_struct(struct task_struct *p) if (WARN_ON_ONCE(to_kthread(p))) return false; - kthread = kzalloc_obj(*kthread, GFP_KERNEL); + kthread = kzalloc_obj(*kthread); if (!kthread) return false; @@ -511,7 +511,7 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), { DECLARE_COMPLETION_ONSTACK(done); struct task_struct *task; - struct kthread_create_info *create = kmalloc_obj(*create, GFP_KERNEL); + struct kthread_create_info *create = kmalloc_obj(*create); if (!create) return ERR_PTR(-ENOMEM); @@ -1083,7 +1083,7 @@ __kthread_create_worker_on_node(unsigned int flags, int node, struct kthread_worker *worker; struct task_struct *task; - worker = kzalloc_obj(*worker, GFP_KERNEL); + worker = kzalloc_obj(*worker); if (!worker) return ERR_PTR(-ENOMEM); diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 0d52e48918eb..28d15ba58a26 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -525,7 +525,7 @@ static struct klp_object *klp_alloc_object_dynamic(const char *name, { struct klp_object *obj; - obj = kzalloc_obj(*obj, GFP_KERNEL); + obj = kzalloc_obj(*obj); if (!obj) return NULL; @@ -554,7 +554,7 @@ static struct klp_func *klp_alloc_func_nop(struct klp_func *old_func, { struct klp_func *func; - func = kzalloc_obj(*func, GFP_KERNEL); + func = kzalloc_obj(*func); if (!func) return NULL; diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c index 1149840cd538..3f54a017bbf6 100644 --- a/kernel/livepatch/patch.c +++ b/kernel/livepatch/patch.c @@ -179,7 +179,7 @@ static int klp_patch_func(struct klp_func *func) return -EINVAL; } - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (!ops) return -ENOMEM; diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index 23d76678d233..cc68a3692905 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -187,7 +187,7 @@ static int __kho_preserve_order(struct kho_mem_track *track, unsigned long pfn, if (!physxa) { int err; - new_physxa = kzalloc_obj(*physxa, GFP_KERNEL); + new_physxa = kzalloc_obj(*physxa); if (!new_physxa) return -ENOMEM; @@ -1090,7 +1090,7 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation) return NULL; total_pages = preservation->total_pages; - pages = kvmalloc_objs(*pages, total_pages, GFP_KERNEL); + pages = kvmalloc_objs(*pages, total_pages); if (!pages) return NULL; order = preservation->order; diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c index d42fc940d14d..2f93939168ab 100644 --- a/kernel/liveupdate/kexec_handover_debugfs.c +++ b/kernel/liveupdate/kexec_handover_debugfs.c @@ -29,7 +29,7 @@ static int __kho_debugfs_fdt_add(struct list_head *list, struct dentry *dir, struct fdt_debugfs *f; struct dentry *file; - f = kmalloc_obj(*f, GFP_KERNEL); + f = kmalloc_obj(*f); if (!f) return -ENOMEM; diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index ca96edb3b4e5..8c79058253e1 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -289,7 +289,7 @@ int luo_preserve_file(struct luo_file_set *file_set, u64 token, int fd) if (err) goto err_free_files_mem; - luo_file = kzalloc_obj(*luo_file, GFP_KERNEL); + luo_file = kzalloc_obj(*luo_file); if (!luo_file) { err = -ENOMEM; goto err_flb_unpreserve; @@ -780,7 +780,7 @@ int luo_file_deserialize(struct luo_file_set *file_set, return -ENOENT; } - luo_file = kzalloc_obj(*luo_file, GFP_KERNEL); + luo_file = kzalloc_obj(*luo_file); if (!luo_file) return -ENOMEM; diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c index 5f2cdf9caa7b..f52e8114837e 100644 --- a/kernel/liveupdate/luo_flb.c +++ b/kernel/liveupdate/luo_flb.c @@ -343,7 +343,7 @@ int liveupdate_register_flb(struct liveupdate_file_handler *fh, if (WARN_ON(list_empty(&ACCESS_PRIVATE(fh, list)))) return -EINVAL; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return -ENOMEM; diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index c0262ca00533..783677295640 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -119,7 +119,7 @@ static struct luo_session_global luo_session_global = { static struct luo_session *luo_session_alloc(const char *name) { - struct luo_session *session = kzalloc_obj(*session, GFP_KERNEL); + struct luo_session *session = kzalloc_obj(*session); if (!session) return ERR_PTR(-ENOMEM); diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c index 2cc6d1937670..838d631544ed 100644 --- a/kernel/locking/test-ww_mutex.c +++ b/kernel/locking/test-ww_mutex.c @@ -324,7 +324,7 @@ static int __test_cycle(struct ww_class *class, unsigned int nthreads) unsigned int n, last = nthreads - 1; int ret; - cycles = kmalloc_objs(*cycles, nthreads, GFP_KERNEL); + cycles = kmalloc_objs(*cycles, nthreads); if (!cycles) return -ENOMEM; @@ -412,7 +412,7 @@ static int *get_random_order(int count) int *order; int n, r; - order = kmalloc_objs(*order, count, GFP_KERNEL); + order = kmalloc_objs(*order, count); if (!order) return order; @@ -506,7 +506,7 @@ static void stress_reorder_work(struct work_struct *work) return; for (n = 0; n < stress->nlocks; n++) { - ll = kmalloc_obj(*ll, GFP_KERNEL); + ll = kmalloc_obj(*ll); if (!ll) goto out; @@ -582,11 +582,11 @@ static int stress(struct ww_class *class, int nlocks, int nthreads, unsigned int struct stress *stress_array; int n, count; - locks = kmalloc_objs(*locks, nlocks, GFP_KERNEL); + locks = kmalloc_objs(*locks, nlocks); if (!locks) return -ENOMEM; - stress_array = kmalloc_objs(*stress_array, nthreads, GFP_KERNEL); + stress_array = kmalloc_objs(*stress_array, nthreads); if (!stress_array) { kfree(locks); return -ENOMEM; diff --git a/kernel/module/dups.c b/kernel/module/dups.c index bbc72ad93058..1d720a5311ba 100644 --- a/kernel/module/dups.c +++ b/kernel/module/dups.c @@ -125,7 +125,7 @@ bool kmod_dup_request_exists_wait(char *module_name, bool wait, int *dup_ret) * Pre-allocate the entry in case we have to use it later * to avoid contention with the mutex. */ - new_kmod_req = kzalloc_obj(*new_kmod_req, GFP_KERNEL); + new_kmod_req = kzalloc_obj(*new_kmod_req); if (!new_kmod_req) return false; diff --git a/kernel/module/main.c b/kernel/module/main.c index b2ac20299915..2bac4c7cd019 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -3024,7 +3024,7 @@ static noinline int do_init_module(struct module *mod) } #endif - freeinit = kmalloc_obj(*freeinit, GFP_KERNEL); + freeinit = kmalloc_obj(*freeinit); if (!freeinit) { ret = -ENOMEM; goto fail; diff --git a/kernel/module/stats.c b/kernel/module/stats.c index 2fc64f2729e6..3a9672f93a8e 100644 --- a/kernel/module/stats.c +++ b/kernel/module/stats.c @@ -250,7 +250,7 @@ int try_add_failed_module(const char *name, enum fail_dup_mod_reason reason) } } - mod_fail = kzalloc_obj(*mod_fail, GFP_KERNEL); + mod_fail = kzalloc_obj(*mod_fail); if (!mod_fail) return -ENOMEM; memcpy(mod_fail->name, name, strlen(name)); diff --git a/kernel/module/sysfs.c b/kernel/module/sysfs.c index 734ea3180478..768f74e99026 100644 --- a/kernel/module/sysfs.c +++ b/kernel/module/sysfs.c @@ -78,7 +78,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) if (!sect_attrs) return -ENOMEM; - gattr = kzalloc_objs(*gattr, nloaded + 1, GFP_KERNEL); + gattr = kzalloc_objs(*gattr, nloaded + 1); if (!gattr) { kfree(sect_attrs); return -ENOMEM; @@ -170,7 +170,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) if (!notes_attrs) return -ENOMEM; - gattr = kzalloc_objs(*gattr, notes + 1, GFP_KERNEL); + gattr = kzalloc_objs(*gattr, notes + 1); if (!gattr) { kfree(notes_attrs); return -ENOMEM; diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 41425054a97a..9033ff54c4e2 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c @@ -33,7 +33,7 @@ int try_add_tainted_module(struct module *mod) } } - mod_taint = kmalloc_obj(*mod_taint, GFP_KERNEL); + mod_taint = kmalloc_obj(*mod_taint); if (unlikely(!mod_taint)) return -ENOMEM; strscpy(mod_taint->name, mod->name, MODULE_NAME_LEN); diff --git a/kernel/padata.c b/kernel/padata.c index f0bf62e9a1f2..0af32c78ea69 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -540,7 +540,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) struct padata_instance *pinst = ps->pinst; struct parallel_data *pd; - pd = kzalloc_obj(struct parallel_data, GFP_KERNEL); + pd = kzalloc_obj(struct parallel_data); if (!pd) goto err; @@ -952,7 +952,7 @@ struct padata_instance *padata_alloc(const char *name) { struct padata_instance *pinst; - pinst = kzalloc_obj(struct padata_instance, GFP_KERNEL); + pinst = kzalloc_obj(struct padata_instance); if (!pinst) goto err; @@ -1038,7 +1038,7 @@ struct padata_shell *padata_alloc_shell(struct padata_instance *pinst) struct parallel_data *pd; struct padata_shell *ps; - ps = kzalloc_obj(*ps, GFP_KERNEL); + ps = kzalloc_obj(*ps); if (!ps) goto out; diff --git a/kernel/params.c b/kernel/params.c index d26bdfae96e5..5d1cd7d0b51a 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -633,7 +633,7 @@ static __init_or_module int add_sysfs_param(struct module_kobject *mk, if (!mk->mp) { /* First allocation. */ - mk->mp = kzalloc_obj(*mk->mp, GFP_KERNEL); + mk->mp = kzalloc_obj(*mk->mp); if (!mk->mp) return -ENOMEM; mk->mp->grp.name = "parameters"; @@ -766,7 +766,7 @@ lookup_or_create_module_kobject(const char *name) if (kobj) return to_module_kobject(kobj); - mk = kzalloc_obj(struct module_kobject, GFP_KERNEL); + mk = kzalloc_obj(struct module_kobject); if (!mk) return NULL; diff --git a/kernel/power/console.c b/kernel/power/console.c index 5ed9e1be1560..33ace63b1088 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c @@ -58,7 +58,7 @@ int pm_vt_switch_required(struct device *dev, bool required) } } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { ret = -ENOMEM; goto out; diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index 43ddfc11b84a..e610cf8e9a06 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -439,7 +439,7 @@ static int em_create_pd(struct device *dev, int nr_states, cpumask_copy(em_span_cpus(pd), cpus); } else { - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return -ENOMEM; } diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 750b80f45b9f..398b994b73aa 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -341,7 +341,7 @@ static int cpu_latency_qos_open(struct inode *inode, struct file *filp) { struct pm_qos_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; @@ -440,7 +440,7 @@ static int cpu_wakeup_latency_qos_open(struct inode *inode, struct file *filp) { struct pm_qos_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return -ENOMEM; diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index be0b3304339f..6e1321837c66 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1124,7 +1124,7 @@ int create_basic_memory_bitmaps(void) else BUG_ON(forbidden_pages_map || free_pages_map); - bm1 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL); + bm1 = kzalloc_obj(struct memory_bitmap); if (!bm1) return -ENOMEM; @@ -1132,7 +1132,7 @@ int create_basic_memory_bitmaps(void) if (error) goto Free_first_object; - bm2 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL); + bm2 = kzalloc_obj(struct memory_bitmap); if (!bm2) goto Free_first_bitmap; diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 9bc1241259d3..2e64869bb5a0 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -155,7 +155,7 @@ static int swsusp_extents_insert(unsigned long swap_offset) } } /* Add the new node and rebalance the tree. */ - ext = kzalloc_obj(struct swsusp_extent, GFP_KERNEL); + ext = kzalloc_obj(struct swsusp_extent); if (!ext) return -ENOMEM; @@ -577,7 +577,7 @@ static struct crc_data *alloc_crc_data(int nr_threads) { struct crc_data *crc; - crc = kzalloc_obj(*crc, GFP_KERNEL); + crc = kzalloc_obj(*crc); if (!crc) return NULL; @@ -585,7 +585,7 @@ static struct crc_data *alloc_crc_data(int nr_threads) if (!crc->unc) goto err_free_crc; - crc->unc_len = kzalloc_objs(*crc->unc_len, nr_threads, GFP_KERNEL); + crc->unc_len = kzalloc_objs(*crc->unc_len, nr_threads); if (!crc->unc_len) goto err_free_unc; @@ -1016,7 +1016,7 @@ static int get_swap_reader(struct swap_map_handle *handle, last = handle->maps = NULL; offset = swsusp_header->image; while (offset) { - tmp = kzalloc_obj(*handle->maps, GFP_KERNEL); + tmp = kzalloc_obj(*handle->maps); if (!tmp) { release_swap_reader(handle); return -ENOMEM; diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 49712d9e7cfa..fd763da06a87 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -178,7 +178,7 @@ static struct wakelock *wakelock_lookup_add(const char *name, size_t len, return ERR_PTR(-ENOSPC); /* Not found, we have to add a new one. */ - wl = kzalloc_obj(*wl, GFP_KERNEL); + wl = kzalloc_obj(*wl); if (!wl) return ERR_PTR(-ENOMEM); diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index c98241238f2a..d7044a7a214b 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -1801,7 +1801,7 @@ bool nbcon_alloc(struct console *con) */ con->pbufs = &printk_shared_pbufs; } else { - con->pbufs = kmalloc_obj(*con->pbufs, GFP_KERNEL); + con->pbufs = kmalloc_obj(*con->pbufs); if (!con->pbufs) { con_printk(KERN_ERR, con, "failed to allocate printing buffer\n"); return false; diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 599d56300ded..0323149548f6 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -933,7 +933,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) return err; } - user = kvmalloc_obj(struct devkmsg_user, GFP_KERNEL); + user = kvmalloc_obj(struct devkmsg_user); if (!user) return -ENOMEM; diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 5512686be5d0..6c1acf9ba69b 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -1130,7 +1130,7 @@ rcu_scale_init(void) goto unwind; schedule_timeout_uninterruptible(1); } - reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders); if (reader_tasks == NULL) { SCALEOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; @@ -1144,11 +1144,11 @@ rcu_scale_init(void) } while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders) schedule_timeout_uninterruptible(1); - writer_tasks = kzalloc_objs(writer_tasks[0], nrealwriters, GFP_KERNEL); + writer_tasks = kzalloc_objs(writer_tasks[0], nrealwriters); writer_durations = kcalloc(nrealwriters, sizeof(*writer_durations), GFP_KERNEL); writer_n_durations = kzalloc_objs(*writer_n_durations, nrealwriters, GFP_KERNEL); - writer_done = kzalloc_objs(writer_done[0], nrealwriters, GFP_KERNEL); + writer_done = kzalloc_objs(writer_done[0], nrealwriters); if (gp_async) { if (gp_async_max <= 0) { pr_warn("%s: gp_async_max = %d must be greater than zero.\n", diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index d2e673771295..197cea4d1f26 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1626,7 +1626,7 @@ rcu_torture_writer(void *arg) ulo_size = cur_ops->poll_active; } if (cur_ops->poll_active_full > 0) { - rgo = kzalloc_objs(*rgo, cur_ops->poll_active_full, GFP_KERNEL); + rgo = kzalloc_objs(*rgo, cur_ops->poll_active_full); if (!WARN_ON(!rgo)) rgo_size = cur_ops->poll_active_full; } @@ -2558,7 +2558,7 @@ static int rcu_torture_updown_init(void) VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Disabling up/down reader tests due to lack of primitives"); return 0; } - updownreaders = kzalloc_objs(*updownreaders, n_up_down, GFP_KERNEL); + updownreaders = kzalloc_objs(*updownreaders, n_up_down); if (!updownreaders) { VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Out of memory, disabling up/down reader tests"); return -ENOMEM; @@ -2891,7 +2891,7 @@ static void rcu_torture_mem_dump_obj(void) mem_dump_obj(&z); kmem_cache_free(kcp, rhp); kmem_cache_destroy(kcp); - rhp = kmalloc_obj(*rhp, GFP_KERNEL); + rhp = kmalloc_obj(*rhp); if (WARN_ON_ONCE(!rhp)) return; pr_alert("mem_dump_obj() kmalloc test: rcu_torture_stats = %px, &rhp = %px, rhp = %px\n", stats_task, &rhp, rhp); @@ -3399,7 +3399,7 @@ static void rcu_torture_fwd_prog_cr(struct rcu_fwd *rfp) n_launders++; n_launders_sa++; } else if (!cur_ops->cbflood_max || cur_ops->cbflood_max > n_max_cbs) { - rfcp = kmalloc_obj(*rfcp, GFP_KERNEL); + rfcp = kmalloc_obj(*rfcp); if (WARN_ON_ONCE(!rfcp)) { schedule_timeout_interruptible(1); continue; @@ -3587,8 +3587,8 @@ static int __init rcu_torture_fwd_prog_init(void) fwd_progress_holdoff = 1; if (fwd_progress_div <= 0) fwd_progress_div = 4; - rfp = kzalloc_objs(*rfp, fwd_progress, GFP_KERNEL); - fwd_prog_tasks = kzalloc_objs(*fwd_prog_tasks, fwd_progress, GFP_KERNEL); + rfp = kzalloc_objs(*rfp, fwd_progress); + fwd_prog_tasks = kzalloc_objs(*fwd_prog_tasks, fwd_progress); if (!rfp || !fwd_prog_tasks) { kfree(rfp); kfree(fwd_prog_tasks); @@ -3754,9 +3754,9 @@ static int rcu_torture_barrier_init(void) atomic_set(&barrier_cbs_count, 0); atomic_set(&barrier_cbs_invoked, 0); barrier_cbs_tasks = - kzalloc_objs(barrier_cbs_tasks[0], n_barrier_cbs, GFP_KERNEL); + kzalloc_objs(barrier_cbs_tasks[0], n_barrier_cbs); barrier_cbs_wq = - kzalloc_objs(barrier_cbs_wq[0], n_barrier_cbs, GFP_KERNEL); + kzalloc_objs(barrier_cbs_wq[0], n_barrier_cbs); if (barrier_cbs_tasks == NULL || !barrier_cbs_wq) return -ENOMEM; for (i = 0; i < n_barrier_cbs; i++) { @@ -4223,7 +4223,7 @@ static void rcu_test_debug_objects(void) (!cur_ops->call || !cur_ops->cb_barrier))) return; - struct rcu_head *rhp = kmalloc_obj(*rhp, GFP_KERNEL); + struct rcu_head *rhp = kmalloc_obj(*rhp); init_rcu_head_on_stack(&rh1); init_rcu_head_on_stack(&rh2); @@ -4562,7 +4562,7 @@ rcu_torture_init(void) if (torture_init_error(firsterr)) goto unwind; } - reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders); rcu_torture_reader_mbchk = kzalloc_objs(*rcu_torture_reader_mbchk, nrealreaders, GFP_KERNEL); if (!reader_tasks || !rcu_torture_reader_mbchk) { diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 39d679a4c17e..c158b6a947cd 100644 --- a/kernel/rcu/refscale.c +++ b/kernel/rcu/refscale.c @@ -1143,7 +1143,7 @@ static bool typesafe_init(void) else if (si == 0) si = nr_cpu_ids; rtsarray_size = si; - rtsarray = kzalloc_objs(*rtsarray, si, GFP_KERNEL); + rtsarray = kzalloc_objs(*rtsarray, si); if (!rtsarray) return false; for (idx = 0; idx < rtsarray_size; idx++) { @@ -1575,7 +1575,7 @@ ref_scale_init(void) "%s: nreaders * loops will overflow, adjusted loops to %d", __func__, INT_MAX / nreaders)) loops = INT_MAX / nreaders; - reader_tasks = kzalloc_objs(reader_tasks[0], nreaders, GFP_KERNEL); + reader_tasks = kzalloc_objs(reader_tasks[0], nreaders); if (!reader_tasks) { SCALEOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 0faf35f393a3..aef8e91ad33e 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -238,7 +238,7 @@ static bool init_srcu_struct_nodes(struct srcu_struct *ssp, gfp_t gfp_flags) static int init_srcu_struct_fields(struct srcu_struct *ssp, bool is_static) { if (!is_static) - ssp->srcu_sup = kzalloc_obj(*ssp->srcu_sup, GFP_KERNEL); + ssp->srcu_sup = kzalloc_obj(*ssp->srcu_sup); if (!ssp->srcu_sup) return -ENOMEM; if (!is_static) diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 14150f09fd61..d98a5c38e19c 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -614,7 +614,7 @@ static void early_boot_test_call_rcu(void) call_rcu(&head, test_callback); early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu); call_srcu(&early_srcu, &shead, test_callback); - rhp = kmalloc_obj(*rhp, GFP_KERNEL); + rhp = kmalloc_obj(*rhp); if (!WARN_ON_ONCE(!rhp)) kfree_rcu(rhp, rh); } diff --git a/kernel/relay.c b/kernel/relay.c index c28fc5dd3ded..62b059ff2759 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -59,7 +59,7 @@ static const struct vm_operations_struct relay_file_mmap_ops = { */ static struct page **relay_alloc_page_array(unsigned int n_pages) { - return kvzalloc_objs(struct page *, n_pages, GFP_KERNEL); + return kvzalloc_objs(struct page *, n_pages); } /* @@ -150,10 +150,10 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan) if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t)) return NULL; - buf = kzalloc_obj(struct rchan_buf, GFP_KERNEL); + buf = kzalloc_obj(struct rchan_buf); if (!buf) return NULL; - buf->padding = kmalloc_objs(size_t, chan->n_subbufs, GFP_KERNEL); + buf->padding = kmalloc_objs(size_t, chan->n_subbufs); if (!buf->padding) goto free_buf; @@ -489,7 +489,7 @@ struct rchan *relay_open(const char *base_filename, if (!cb || !cb->create_buf_file || !cb->remove_buf_file) return NULL; - chan = kzalloc_obj(struct rchan, GFP_KERNEL); + chan = kzalloc_obj(struct rchan); if (!chan) return NULL; diff --git a/kernel/resource.c b/kernel/resource.c index d591e76c1535..bb966699da31 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -502,7 +502,7 @@ int walk_system_ram_res_rev(u64 start, u64 end, void *arg, int ret = -1; /* create a list */ - rams = kvzalloc_objs(struct resource, rams_size, GFP_KERNEL); + rams = kvzalloc_objs(struct resource, rams_size); if (!rams) return ret; diff --git a/kernel/resource_kunit.c b/kernel/resource_kunit.c index 378218df2427..42785796f1db 100644 --- a/kernel/resource_kunit.c +++ b/kernel/resource_kunit.c @@ -204,7 +204,7 @@ static void resource_test_insert_resource(struct kunit *test, struct resource *p { struct resource *res; - res = kzalloc_obj(*res, GFP_KERNEL); + res = kzalloc_obj(*res); KUNIT_ASSERT_NOT_NULL(test, res); res->name = name; diff --git a/kernel/scftorture.c b/kernel/scftorture.c index 02b3a5d2f0aa..327c315f411c 100644 --- a/kernel/scftorture.c +++ b/kernel/scftorture.c @@ -661,7 +661,7 @@ static int __init scf_torture_init(void) // Worker tasks invoking smp_call_function(). if (nthreads < 0) nthreads = num_online_cpus(); - scf_stats_p = kzalloc_objs(scf_stats_p[0], nthreads, GFP_KERNEL); + scf_stats_p = kzalloc_objs(scf_stats_p[0], nthreads); if (!scf_stats_p) { SCFTORTOUT_ERRSTRING("out of memory"); firsterr = -ENOMEM; diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index c5a1019cbe83..e380cf9372bb 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c @@ -86,7 +86,7 @@ static inline struct autogroup *autogroup_task_get(struct task_struct *p) static inline struct autogroup *autogroup_create(void) { - struct autogroup *ag = kzalloc_obj(*ag, GFP_KERNEL); + struct autogroup *ag = kzalloc_obj(*ag); struct task_group *tg; if (!ag) diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c index 6065cf725eee..73b6b2426911 100644 --- a/kernel/sched/core_sched.c +++ b/kernel/sched/core_sched.c @@ -12,7 +12,7 @@ struct sched_core_cookie { static unsigned long sched_core_alloc_cookie(void) { - struct sched_core_cookie *ck = kmalloc_obj(*ck, GFP_KERNEL); + struct sched_core_cookie *ck = kmalloc_obj(*ck); if (!ck) return 0; diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 6e9a2e067886..ca9d52cb1ebb 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -61,7 +61,7 @@ cpuacct_css_alloc(struct cgroup_subsys_state *parent_css) if (!parent_css) return &root_cpuacct.css; - ca = kzalloc_obj(*ca, GFP_KERNEL); + ca = kzalloc_obj(*ca); if (!ca) goto out; diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index bbb2d68df86a..0a2b7e30fd10 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -252,7 +252,7 @@ int cpudl_init(struct cpudl *cp) raw_spin_lock_init(&cp->lock); cp->size = 0; - cp->elements = kzalloc_objs(struct cpudl_item, nr_cpu_ids, GFP_KERNEL); + cp->elements = kzalloc_objs(struct cpudl_item, nr_cpu_ids); if (!cp->elements) return -ENOMEM; diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index d71d09ed1b3b..153232dd8276 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -638,7 +638,7 @@ static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) { struct sugov_policy *sg_policy; - sg_policy = kzalloc_obj(*sg_policy, GFP_KERNEL); + sg_policy = kzalloc_obj(*sg_policy); if (!sg_policy) return NULL; @@ -722,7 +722,7 @@ static struct sugov_tunables *sugov_tunables_alloc(struct sugov_policy *sg_polic { struct sugov_tunables *tunables; - tunables = kzalloc_obj(*tunables, GFP_KERNEL); + tunables = kzalloc_obj(*tunables); if (tunables) { gov_attr_set_init(&tunables->attr_set, &sg_policy->tunables_hook); if (!have_governor_per_policy()) diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index c2642deeaabc..8f2237e8b484 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -288,7 +288,7 @@ int cpupri_init(struct cpupri *cp) goto cleanup; } - cp->cpu_to_pri = kzalloc_objs(int, nr_cpu_ids, GFP_KERNEL); + cp->cpu_to_pri = kzalloc_objs(int, nr_cpu_ids); if (!cp->cpu_to_pri) goto cleanup; diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index b9fadb2583ea..5a812b510d5d 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4223,11 +4223,11 @@ static struct scx_exit_info *alloc_exit_info(size_t exit_dump_len) { struct scx_exit_info *ei; - ei = kzalloc_obj(*ei, GFP_KERNEL); + ei = kzalloc_obj(*ei); if (!ei) return NULL; - ei->bt = kzalloc_objs(ei->bt[0], SCX_EXIT_BT_LEN, GFP_KERNEL); + ei->bt = kzalloc_objs(ei->bt[0], SCX_EXIT_BT_LEN); ei->msg = kzalloc(SCX_EXIT_MSG_LEN, GFP_KERNEL); ei->dump = kvzalloc(exit_dump_len, GFP_KERNEL); @@ -4824,7 +4824,7 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops) struct scx_sched *sch; int node, ret; - sch = kzalloc_obj(*sch, GFP_KERNEL); + sch = kzalloc_obj(*sch); if (!sch) return ERR_PTR(-ENOMEM); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f6f050f2faec..eea99ec01a3f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3427,7 +3427,7 @@ retry_pids: if (!vma->numab_state) { struct vma_numab_state *ptr; - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); if (!ptr) continue; @@ -13622,10 +13622,10 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) struct cfs_rq *cfs_rq; int i; - tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids, GFP_KERNEL); + tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids); if (!tg->cfs_rq) goto err; - tg->se = kzalloc_objs(se, nr_cpu_ids, GFP_KERNEL); + tg->se = kzalloc_objs(se, nr_cpu_ids); if (!tg->se) goto err; diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index bf8a70598a09..d9c9d9480a45 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1114,7 +1114,7 @@ int psi_cgroup_alloc(struct cgroup *cgroup) if (!static_branch_likely(&psi_cgroups_enabled)) return 0; - cgroup->psi = kzalloc_obj(struct psi_group, GFP_KERNEL); + cgroup->psi = kzalloc_obj(struct psi_group); if (!cgroup->psi) return -ENOMEM; @@ -1340,7 +1340,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, char *buf, if (threshold_us == 0 || threshold_us > window_us) return ERR_PTR(-EINVAL); - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) return ERR_PTR(-ENOMEM); diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index e72df7045592..f69e1f16d923 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -259,10 +259,10 @@ int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent) if (!rt_group_sched_enabled()) return 1; - tg->rt_rq = kzalloc_objs(rt_rq, nr_cpu_ids, GFP_KERNEL); + tg->rt_rq = kzalloc_objs(rt_rq, nr_cpu_ids); if (!tg->rt_rq) goto err; - tg->rt_se = kzalloc_objs(rt_se, nr_cpu_ids, GFP_KERNEL); + tg->rt_se = kzalloc_objs(rt_se, nr_cpu_ids); if (!tg->rt_se) goto err; diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index ac54fcae5de7..32dcddaead82 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -350,7 +350,7 @@ static struct perf_domain *pd_init(int cpu) return NULL; } - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return NULL; pd->em_pd = obj; @@ -589,7 +589,7 @@ static struct root_domain *alloc_rootdomain(void) { struct root_domain *rd; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return NULL; @@ -1998,7 +1998,7 @@ static int sched_record_numa_dist(int offline_node, int (*n_dist)(int, int), */ nr_levels = bitmap_weight(distance_map, NR_DISTANCE_VALUES); - distances = kzalloc_objs(int, nr_levels, GFP_KERNEL); + distances = kzalloc_objs(int, nr_levels); if (!distances) return -ENOMEM; @@ -2734,7 +2734,7 @@ cpumask_var_t *alloc_sched_domains(unsigned int ndoms) int i; cpumask_var_t *doms; - doms = kmalloc_objs(*doms, ndoms, GFP_KERNEL); + doms = kmalloc_objs(*doms, ndoms); if (!doms) return NULL; for (i = 0; i < ndoms; i++) { diff --git a/kernel/seccomp.c b/kernel/seccomp.c index b2297243071d..066909393c38 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -1893,7 +1893,7 @@ static struct file *init_listener(struct seccomp_filter *filter) struct file *ret; ret = ERR_PTR(-ENOMEM); - filter->notif = kzalloc_obj(*(filter->notif), GFP_KERNEL); + filter->notif = kzalloc_obj(*(filter->notif)); if (!filter->notif) goto out; diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c index 864ae2da708f..2b6a0d99cdbe 100644 --- a/kernel/static_call_inline.c +++ b/kernel/static_call_inline.c @@ -255,7 +255,7 @@ static int __static_call_init(struct module *mod, goto do_transform; } - site_mod = kzalloc_obj(*site_mod, GFP_KERNEL); + site_mod = kzalloc_obj(*site_mod); if (!site_mod) return -ENOMEM; @@ -271,7 +271,7 @@ static int __static_call_init(struct module *mod, key->mods = site_mod; - site_mod = kzalloc_obj(*site_mod, GFP_KERNEL); + site_mod = kzalloc_obj(*site_mod); if (!site_mod) return -ENOMEM; } diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c index 3a67e7e4c875..dab37295c8c2 100644 --- a/kernel/time/posix-clock.c +++ b/kernel/time/posix-clock.c @@ -103,7 +103,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp) err = -ENODEV; goto out; } - pccontext = kzalloc_obj(*pccontext, GFP_KERNEL); + pccontext = kzalloc_obj(*pccontext); if (!pccontext) { err = -ENOMEM; goto out; diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c index 21e72318aeb8..a8421f3025cd 100644 --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -1766,7 +1766,7 @@ static int tmigr_setup_groups(unsigned int cpu, unsigned int node, int i, top = 0, err = 0, start_lvl = 0; bool root_mismatch = false; - stack = kzalloc_objs(*stack, tmigr_hierarchy_levels, GFP_KERNEL); + stack = kzalloc_objs(*stack, tmigr_hierarchy_levels); if (!stack) return -ENOMEM; diff --git a/kernel/torture.c b/kernel/torture.c index 27c9bb6122d8..ec3370986976 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -494,7 +494,7 @@ void torture_shuffle_task_register(struct task_struct *tp) if (WARN_ON_ONCE(tp == NULL)) return; - stp = kmalloc_obj(*stp, GFP_KERNEL); + stp = kmalloc_obj(*stp); if (WARN_ON_ONCE(stp == NULL)) return; stp->st_t = tp; diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 5526b141b433..30259dcaa838 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -671,7 +671,7 @@ static struct blk_trace *blk_trace_setup_prepare(struct request_queue *q, return ERR_PTR(-EBUSY); } - bt = kzalloc_obj(*bt, GFP_KERNEL); + bt = kzalloc_obj(*bt); if (!bt) return ERR_PTR(-ENOMEM); @@ -1904,7 +1904,7 @@ static int blk_trace_setup_queue(struct request_queue *q, struct blk_trace *bt = NULL; int ret = -ENOMEM; - bt = kzalloc_obj(*bt, GFP_KERNEL); + bt = kzalloc_obj(*bt); if (!bt) return -ENOMEM; diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index c09268c6e9b7..9bc0dfd235af 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2243,7 +2243,7 @@ static int bpf_event_notify(struct notifier_block *nb, unsigned long op, switch (op) { case MODULE_STATE_COMING: - btm = kzalloc_obj(*btm, GFP_KERNEL); + btm = kzalloc_obj(*btm); if (btm) { btm->module = module; list_add(&btm->list, &bpf_trace_modules); @@ -2819,7 +2819,7 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr goto error; } - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) { err = -ENOMEM; goto error; @@ -3238,8 +3238,8 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr err = -ENOMEM; - link = kzalloc_obj(*link, GFP_KERNEL); - uprobes = kvzalloc_objs(*uprobes, cnt, GFP_KERNEL); + link = kzalloc_obj(*link); + uprobes = kvzalloc_objs(*uprobes, cnt); if (!uprobes || !link) goto error_free; diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 0d649ca71ce0..ec90ba215405 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -805,7 +805,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter if (!addrs) return -ENOMEM; - mods = kzalloc_objs(*mods, num, GFP_KERNEL); + mods = kzalloc_objs(*mods, num); if (!mods) return -ENOMEM; diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index fb3915a67013..827fb9a0bf0d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -702,7 +702,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat->hash = kzalloc_objs(struct hlist_head, size, GFP_KERNEL); + stat->hash = kzalloc_objs(struct hlist_head, size); if (!stat->hash) return -ENOMEM; @@ -1215,7 +1215,7 @@ add_ftrace_hash_entry_direct(struct ftrace_hash *hash, unsigned long ip, unsigne { struct ftrace_func_entry *entry; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return NULL; @@ -1335,12 +1335,12 @@ struct ftrace_hash *alloc_ftrace_hash(int size_bits) struct ftrace_hash *hash; int size; - hash = kzalloc_obj(*hash, GFP_KERNEL); + hash = kzalloc_obj(*hash); if (!hash) return NULL; size = 1 << size_bits; - hash->buckets = kzalloc_objs(*hash->buckets, size, GFP_KERNEL); + hash->buckets = kzalloc_objs(*hash->buckets, size); if (!hash->buckets) { kfree(hash); @@ -1360,7 +1360,7 @@ static int ftrace_add_mod(struct trace_array *tr, struct ftrace_mod_load *ftrace_mod; struct list_head *mod_head = enable ? &tr->mod_trace : &tr->mod_notrace; - ftrace_mod = kzalloc_obj(*ftrace_mod, GFP_KERNEL); + ftrace_mod = kzalloc_obj(*ftrace_mod); if (!ftrace_mod) return -ENOMEM; @@ -3911,7 +3911,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages) if (!num_to_init) return NULL; - start_pg = pg = kzalloc_obj(*pg, GFP_KERNEL); + start_pg = pg = kzalloc_obj(*pg); if (!pg) return NULL; @@ -3929,7 +3929,7 @@ ftrace_allocate_pages(unsigned long num_to_init, unsigned long *num_pages) if (!num_to_init) break; - pg->next = kzalloc_obj(*pg, GFP_KERNEL); + pg->next = kzalloc_obj(*pg); if (!pg->next) goto free_pages; @@ -4686,7 +4686,7 @@ ftrace_regex_open(struct ftrace_ops *ops, int flag, if (tracing_check_open_get_tr(tr)) return -ENODEV; - iter = kzalloc_obj(*iter, GFP_KERNEL); + iter = kzalloc_obj(*iter); if (!iter) goto out; @@ -5334,7 +5334,7 @@ int ftrace_func_mapper_add_ip(struct ftrace_func_mapper *mapper, if (entry) return -EBUSY; - map = kmalloc_obj(*map, GFP_KERNEL); + map = kmalloc_obj(*map); if (!map) return -ENOMEM; @@ -5474,7 +5474,7 @@ register_ftrace_function_probe(char *glob, struct trace_array *tr, } } if (!probe) { - probe = kzalloc_obj(*probe, GFP_KERNEL); + probe = kzalloc_obj(*probe); if (!probe) { mutex_unlock(&ftrace_lock); return -ENOMEM; @@ -7223,7 +7223,7 @@ ftrace_graph_open(struct inode *inode, struct file *file) if (unlikely(ftrace_disabled)) return -ENODEV; - fgd = kmalloc_obj(*fgd, GFP_KERNEL); + fgd = kmalloc_obj(*fgd); if (fgd == NULL) return -ENOMEM; @@ -7251,7 +7251,7 @@ ftrace_graph_notrace_open(struct inode *inode, struct file *file) if (unlikely(ftrace_disabled)) return -ENODEV; - fgd = kmalloc_obj(*fgd, GFP_KERNEL); + fgd = kmalloc_obj(*fgd); if (fgd == NULL) return -ENOMEM; @@ -8041,7 +8041,7 @@ static void save_ftrace_mod_rec(struct ftrace_mod_map *mod_map, if (!ret) return; - mod_func = kmalloc_obj(*mod_func, GFP_KERNEL); + mod_func = kmalloc_obj(*mod_func); if (!mod_func) return; @@ -8068,7 +8068,7 @@ allocate_ftrace_mod_map(struct module *mod, if (ftrace_disabled) return NULL; - mod_map = kmalloc_obj(*mod_map, GFP_KERNEL); + mod_map = kmalloc_obj(*mod_map); if (!mod_map) return NULL; @@ -8241,7 +8241,7 @@ static void add_to_clear_hash_list(struct list_head *clear_list, { struct ftrace_init_func *func; - func = kmalloc_obj(*func, GFP_KERNEL); + func = kmalloc_obj(*func); if (!func) { MEM_FAIL(1, "alloc failure, ftrace filter could be stale\n"); return; diff --git a/kernel/trace/pid_list.c b/kernel/trace/pid_list.c index 6d12855b0277..30e3fdae6a17 100644 --- a/kernel/trace/pid_list.c +++ b/kernel/trace/pid_list.c @@ -423,7 +423,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) /* According to linux/thread.h, pids can be no bigger that 30 bits */ WARN_ON_ONCE(init_pid_ns.pid_max > (1 << 30)); - pid_list = kzalloc_obj(*pid_list, GFP_KERNEL); + pid_list = kzalloc_obj(*pid_list); if (!pid_list) return NULL; @@ -435,7 +435,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) for (i = 0; i < CHUNK_ALLOC; i++) { union upper_chunk *chunk; - chunk = kzalloc_obj(*chunk, GFP_KERNEL); + chunk = kzalloc_obj(*chunk); if (!chunk) break; chunk->next = pid_list->upper_list; @@ -446,7 +446,7 @@ struct trace_pid_list *trace_pid_list_alloc(void) for (i = 0; i < CHUNK_ALLOC; i++) { union lower_chunk *chunk; - chunk = kzalloc_obj(*chunk, GFP_KERNEL); + chunk = kzalloc_obj(*chunk); if (!chunk) break; chunk->next = pid_list->lower_list; diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c index d09d5a204627..5a8bdf88999a 100644 --- a/kernel/trace/rethook.c +++ b/kernel/trace/rethook.c @@ -108,7 +108,7 @@ struct rethook *rethook_alloc(void *data, rethook_handler_t handler, if (!handler || num <= 0 || size < sizeof(struct rethook_node)) return ERR_PTR(-EINVAL); - rh = kzalloc_obj(struct rethook, GFP_KERNEL); + rh = kzalloc_obj(struct rethook); if (!rh) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index e1395834886e..f16f053ef77d 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -6509,7 +6509,7 @@ ring_buffer_alloc_read_page(struct trace_buffer *buffer, int cpu) if (!cpumask_test_cpu(cpu, buffer->cpumask)) return ERR_PTR(-ENODEV); - bpage = kzalloc_obj(*bpage, GFP_KERNEL); + bpage = kzalloc_obj(*bpage); if (!bpage) return ERR_PTR(-ENOMEM); @@ -7190,7 +7190,7 @@ static int __rb_map_vma(struct ring_buffer_per_cpu *cpu_buffer, nr_pages = nr_vma_pages; - pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages); if (!pages) return -ENOMEM; diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 83ae2e8e931c..b44f5ae8958e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1064,7 +1064,7 @@ int tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data, cond_update_fn_t update) { struct cond_snapshot *cond_snapshot __free(kfree) = - kzalloc_obj(*cond_snapshot, GFP_KERNEL); + kzalloc_obj(*cond_snapshot); int ret; if (!cond_snapshot) @@ -5132,7 +5132,7 @@ trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, * where the head holds the module and length of array, and the * tail holds a pointer to the next list. */ - map_array = kmalloc_objs(*map_array, len + 2, GFP_KERNEL); + map_array = kmalloc_objs(*map_array, len + 2); if (!map_array) { pr_warn("Unable to allocate trace eval mapping\n"); return; @@ -5809,7 +5809,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) goto fail_pipe_on_cpu; /* create a buffer to store the information to pass to userspace */ - iter = kzalloc_obj(*iter, GFP_KERNEL); + iter = kzalloc_obj(*iter); if (!iter) { ret = -ENOMEM; goto fail_alloc_iter; @@ -6628,7 +6628,7 @@ static int user_buffer_init(struct trace_user_buf_info **tinfo, size_t size) if (!*tinfo) { alloc = true; - *tinfo = kzalloc_obj(**tinfo, GFP_KERNEL); + *tinfo = kzalloc_obj(**tinfo); if (!*tinfo) return -ENOMEM; } @@ -7153,10 +7153,10 @@ static int tracing_snapshot_open(struct inode *inode, struct file *file) } else { /* Writes still need the seq_file to hold the private data */ ret = -ENOMEM; - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (!m) goto out; - iter = kzalloc_obj(*iter, GFP_KERNEL); + iter = kzalloc_obj(*iter); if (!iter) { kfree(m); goto out; @@ -7545,7 +7545,7 @@ static struct tracing_log_err *alloc_tracing_log_err(int len) { struct tracing_log_err *err; - err = kzalloc_obj(*err, GFP_KERNEL); + err = kzalloc_obj(*err); if (!err) return ERR_PTR(-ENOMEM); @@ -7804,7 +7804,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) if (ret) return ret; - info = kvzalloc_obj(*info, GFP_KERNEL); + info = kvzalloc_obj(*info); if (!info) { trace_array_put(tr); return -ENOMEM; @@ -8065,7 +8065,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, struct page *page; int r; - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) { ret = -ENOMEM; break; @@ -8284,7 +8284,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf, unsigned long long t; unsigned long usec_rem; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; @@ -8878,7 +8878,7 @@ create_trace_option_files(struct trace_array *tr, struct tracer *tracer, for (cnt = 0; opts[cnt].name; cnt++) ; - topts = kzalloc_objs(*topts, cnt + 1, GFP_KERNEL); + topts = kzalloc_objs(*topts, cnt + 1); if (!topts) return 0; @@ -8950,7 +8950,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer) if (!trace_ok_for_array(tracer, tr)) return 0; - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) return -ENOMEM; @@ -8967,7 +8967,7 @@ static int add_tracer(struct trace_array *tr, struct tracer *tracer) * If the tracer defines default flags, it means the flags are * per trace instance. */ - flags = kmalloc_obj(*flags, GFP_KERNEL); + flags = kmalloc_obj(*flags); if (!flags) return -ENOMEM; @@ -9538,7 +9538,7 @@ trace_array_create_systems(const char *name, const char *systems, int ret; ret = -ENOMEM; - tr = kzalloc_obj(*tr, GFP_KERNEL); + tr = kzalloc_obj(*tr); if (!tr) return ERR_PTR(ret); diff --git a/kernel/trace/trace_btf.c b/kernel/trace/trace_btf.c index 1d3c42527736..00172f301f25 100644 --- a/kernel/trace/trace_btf.c +++ b/kernel/trace/trace_btf.c @@ -78,7 +78,7 @@ const struct btf_member *btf_find_struct_member(struct btf *btf, const char *name; int i, top = 0; - anon_stack = kzalloc_objs(*anon_stack, BTF_ANON_STACK_MAX, GFP_KERNEL); + anon_stack = kzalloc_objs(*anon_stack, BTF_ANON_STACK_MAX); if (!anon_stack) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c index 3adc9a8c29a9..3eeaa5df7fc8 100644 --- a/kernel/trace/trace_eprobe.c +++ b/kernel/trace/trace_eprobe.c @@ -529,8 +529,8 @@ new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file) struct eprobe_data *edata; int ret; - edata = kzalloc_obj(*edata, GFP_KERNEL); - trigger = kzalloc_obj(*trigger, GFP_KERNEL); + edata = kzalloc_obj(*edata); + trigger = kzalloc_obj(*trigger); if (!trigger || !edata) { ret = -ENOMEM; goto error; diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 1d5ce0244f8c..9928da636c9d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -976,7 +976,7 @@ static int cache_mod(struct trace_array *tr, const char *mod, int set, if (!set) return remove_cache_mod(tr, mod, match, system, event); - event_mod = kzalloc_obj(*event_mod, GFP_KERNEL); + event_mod = kzalloc_obj(*event_mod); if (!event_mod) return -ENOMEM; @@ -1648,7 +1648,7 @@ static void *s_start(struct seq_file *m, loff_t *pos) struct set_event_iter *iter; loff_t l; - iter = kzalloc_obj(*iter, GFP_KERNEL); + iter = kzalloc_obj(*iter); mutex_lock(&event_mutex); if (!iter) return NULL; @@ -2206,7 +2206,7 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt, if (*ppos) return 0; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; @@ -2320,7 +2320,7 @@ static int system_tr_open(struct inode *inode, struct file *filp) int ret; /* Make a temporary dir that has no system but points to tr */ - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return -ENOMEM; @@ -2366,7 +2366,7 @@ subsystem_filter_read(struct file *filp, char __user *ubuf, size_t cnt, if (*ppos) return 0; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; @@ -2416,7 +2416,7 @@ show_header_page_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t * if (*ppos) return 0; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; @@ -2440,7 +2440,7 @@ show_header_event_file(struct file *filp, char __user *ubuf, size_t cnt, loff_t if (*ppos) return 0; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return -ENOMEM; @@ -2881,7 +2881,7 @@ create_new_subsystem(const char *name) struct event_subsystem *system; /* need to create new entry */ - system = kmalloc_obj(*system, GFP_KERNEL); + system = kmalloc_obj(*system); if (!system) return NULL; @@ -2892,7 +2892,7 @@ create_new_subsystem(const char *name) if (!system->name) goto out_free; - system->filter = kzalloc_obj(struct event_filter, GFP_KERNEL); + system->filter = kzalloc_obj(struct event_filter); if (!system->filter) goto out_free; @@ -2960,7 +2960,7 @@ event_subsystem_dir(struct trace_array *tr, const char *name, } } - dir = kmalloc_obj(*dir, GFP_KERNEL); + dir = kmalloc_obj(*dir); if (!dir) goto out_fail; @@ -3403,7 +3403,7 @@ static void add_str_to_module(struct module *module, char *str) { struct module_string *modstr; - modstr = kmalloc_obj(*modstr, GFP_KERNEL); + modstr = kmalloc_obj(*modstr); /* * If we failed to allocate memory here, then we'll just @@ -4365,7 +4365,7 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash, goto out_put; ret = -ENOMEM; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) goto out_put; diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index b84bdad362e9..609325f57942 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -485,10 +485,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, nr_preds += 2; /* For TRUE and FALSE */ - op_stack = kmalloc_objs(*op_stack, nr_parens, GFP_KERNEL); + op_stack = kmalloc_objs(*op_stack, nr_parens); if (!op_stack) return ERR_PTR(-ENOMEM); - prog_stack = kzalloc_objs(*prog_stack, nr_preds, GFP_KERNEL); + prog_stack = kzalloc_objs(*prog_stack, nr_preds); if (!prog_stack) { parse_error(pe, -ENOMEM, 0); goto out_free; @@ -1213,7 +1213,7 @@ static void append_filter_err(struct trace_array *tr, if (WARN_ON(!filter->filter_string)) return; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (!s) return; trace_seq_init(s); @@ -1394,13 +1394,13 @@ static void try_delay_free_filter(struct event_filter *filter) struct filter_head *head; struct filter_list *item; - head = kmalloc_obj(*head, GFP_KERNEL); + head = kmalloc_obj(*head); if (!head) goto free_now; INIT_LIST_HEAD(&head->list); - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) { kfree(head); goto free_now; @@ -1442,7 +1442,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, struct filter_head *head; struct filter_list *item; - head = kmalloc_obj(*head, GFP_KERNEL); + head = kmalloc_obj(*head); if (!head) goto free_now; @@ -1451,7 +1451,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, list_for_each_entry(file, &tr->events, list) { if (file->system != dir) continue; - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) goto free_now; item->filter = event_filter(file); @@ -1459,7 +1459,7 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir, event_clear_filter(file); } - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) goto free_now; @@ -1708,7 +1708,7 @@ static int parse_pred(const char *str, void *data, s = i; - pred = kzalloc_obj(*pred, GFP_KERNEL); + pred = kzalloc_obj(*pred); if (!pred) return -ENOMEM; @@ -1819,7 +1819,7 @@ static int parse_pred(const char *str, void *data, goto err_free; } - pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL); + pred->regex = kzalloc_obj(*pred->regex); if (!pred->regex) goto err_mem; pred->regex->len = len; @@ -1984,7 +1984,7 @@ static int parse_pred(const char *str, void *data, goto err_free; } - pred->regex = kzalloc_obj(*pred->regex, GFP_KERNEL); + pred->regex = kzalloc_obj(*pred->regex); if (!pred->regex) goto err_mem; pred->regex->len = len; @@ -2261,7 +2261,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, bool fail = true; int err; - filter_list = kmalloc_obj(*filter_list, GFP_KERNEL); + filter_list = kmalloc_obj(*filter_list); if (!filter_list) return -ENOMEM; @@ -2272,7 +2272,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, if (file->system != dir) continue; - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (!filter) goto fail_mem; @@ -2289,7 +2289,7 @@ static int process_system_preds(struct trace_subsystem_dir *dir, event_set_filtered_flag(file); - filter_item = kzalloc_obj(*filter_item, GFP_KERNEL); + filter_item = kzalloc_obj(*filter_item); if (!filter_item) goto fail_mem; @@ -2343,14 +2343,14 @@ static int create_filter_start(char *filter_string, bool set_str, if (WARN_ON_ONCE(*pse || *filterp)) return -EINVAL; - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (filter && set_str) { filter->filter_string = kstrdup(filter_string, GFP_KERNEL); if (!filter->filter_string) err = -ENOMEM; } - pe = kzalloc_obj(*pe, GFP_KERNEL); + pe = kzalloc_obj(*pe); if (!filter || !pe || err) { kfree(pe); diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index da42a087d646..a45cdd05123b 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -732,7 +732,7 @@ static struct track_data *track_data_alloc(unsigned int key_len, struct action_data *action_data, struct hist_trigger_data *hist_data) { - struct track_data *data = kzalloc_obj(*data, GFP_KERNEL); + struct track_data *data = kzalloc_obj(*data); struct hist_elt_data *elt_data; if (!data) @@ -748,7 +748,7 @@ static struct track_data *track_data_alloc(unsigned int key_len, data->action_data = action_data; data->hist_data = hist_data; - elt_data = kzalloc_obj(*elt_data, GFP_KERNEL); + elt_data = kzalloc_obj(*elt_data); if (!elt_data) { track_data_free(data); return ERR_PTR(-ENOMEM); @@ -1086,7 +1086,7 @@ static int save_hist_vars(struct hist_trigger_data *hist_data) if (tracing_check_open_get_tr(tr)) return -ENODEV; - var_data = kzalloc_obj(*var_data, GFP_KERNEL); + var_data = kzalloc_obj(*var_data); if (!var_data) { trace_array_put(tr); return -ENOMEM; @@ -1548,7 +1548,7 @@ parse_hist_trigger_attrs(struct trace_array *tr, char *trigger_str) struct hist_trigger_attrs *attrs; int ret = 0; - attrs = kzalloc_obj(*attrs, GFP_KERNEL); + attrs = kzalloc_obj(*attrs); if (!attrs) return ERR_PTR(-ENOMEM); @@ -1646,7 +1646,7 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt) struct hist_field *hist_field; unsigned int i, n_str; - elt_data = kzalloc_obj(*elt_data, GFP_KERNEL); + elt_data = kzalloc_obj(*elt_data); if (!elt_data) return -ENOMEM; @@ -1962,7 +1962,7 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, if (field && is_function_field(field)) return NULL; - hist_field = kzalloc_obj(struct hist_field, GFP_KERNEL); + hist_field = kzalloc_obj(struct hist_field); if (!hist_field) return NULL; @@ -3049,7 +3049,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, if (!IS_ERR_OR_NULL(event_var)) return event_var; - var_hist = kzalloc_obj(*var_hist, GFP_KERNEL); + var_hist = kzalloc_obj(*var_hist); if (!var_hist) return ERR_PTR(-ENOMEM); @@ -3231,7 +3231,7 @@ static struct hist_field *create_var(struct hist_trigger_data *hist_data, goto out; } - var = kzalloc_obj(struct hist_field, GFP_KERNEL); + var = kzalloc_obj(struct hist_field); if (!var) { var = ERR_PTR(-ENOMEM); goto out; @@ -3292,7 +3292,7 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data, goto err; } - field_var = kzalloc_obj(struct field_var, GFP_KERNEL); + field_var = kzalloc_obj(struct field_var); if (!field_var) { destroy_hist_field(val, 0); kfree_const(var->type); @@ -3831,7 +3831,7 @@ static struct action_data *track_data_parse(struct hist_trigger_data *hist_data, int ret = -EINVAL; char *var_str; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); @@ -4198,7 +4198,7 @@ static struct action_data *onmatch_parse(struct trace_array *tr, char *str) struct action_data *data; int ret = -EINVAL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); @@ -5136,7 +5136,7 @@ create_hist_data(unsigned int map_bits, struct hist_trigger_data *hist_data; int ret = 0; - hist_data = kzalloc_obj(*hist_data, GFP_KERNEL); + hist_data = kzalloc_obj(*hist_data); if (!hist_data) return ERR_PTR(-ENOMEM); @@ -5828,7 +5828,7 @@ static int event_hist_open(struct inode *inode, struct file *file) goto err; } - hist_file = kzalloc_obj(*hist_file, GFP_KERNEL); + hist_file = kzalloc_obj(*hist_file); if (!hist_file) { ret = -ENOMEM; goto err; @@ -6602,7 +6602,7 @@ static int hist_register_trigger(char *glob, data->private_data = named_data->private_data; set_named_trigger_data(data, named_data); /* Copy the command ops and update some of the functions */ - cmd_ops = kmalloc_obj(*cmd_ops, GFP_KERNEL); + cmd_ops = kmalloc_obj(*cmd_ops); if (!cmd_ops) { ret = -ENOMEM; goto out; diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index db74b2c663f8..7303491e299d 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -711,7 +711,7 @@ static struct synth_field *parse_synth_field(int argc, char **argv, *field_version = check_field_version(prefix, field_type, field_name); - field = kzalloc_obj(*field, GFP_KERNEL); + field = kzalloc_obj(*field); if (!field) return ERR_PTR(-ENOMEM); @@ -819,7 +819,7 @@ static struct tracepoint *alloc_synth_tracepoint(char *name) { struct tracepoint *tp; - tp = kzalloc_obj(*tp, GFP_KERNEL); + tp = kzalloc_obj(*tp); if (!tp) return ERR_PTR(-ENOMEM); @@ -973,7 +973,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields, unsigned int i, j, n_dynamic_fields = 0; struct synth_event *event; - event = kzalloc_obj(*event, GFP_KERNEL); + event = kzalloc_obj(*event); if (!event) { event = ERR_PTR(-ENOMEM); goto out; @@ -986,7 +986,7 @@ static struct synth_event *alloc_synth_event(const char *name, int n_fields, goto out; } - event->fields = kzalloc_objs(*event->fields, n_fields, GFP_KERNEL); + event->fields = kzalloc_objs(*event->fields, n_fields); if (!event->fields) { free_synth_event(event); event = ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index 7ba3548a2f60..fecbd679d432 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -914,7 +914,7 @@ struct event_trigger_data *trigger_data_alloc(struct event_command *cmd_ops, { struct event_trigger_data *trigger_data; - trigger_data = kzalloc_obj(*trigger_data, GFP_KERNEL); + trigger_data = kzalloc_obj(*trigger_data); if (!trigger_data) return NULL; @@ -1724,7 +1724,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops, #endif ret = -ENOMEM; - enable_data = kzalloc_obj(*enable_data, GFP_KERNEL); + enable_data = kzalloc_obj(*enable_data); if (!enable_data) return ret; diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index c35182cb7286..c4ba484f7b38 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -370,7 +370,7 @@ static struct user_event_group *user_event_group_create(void) { struct user_event_group *group; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return NULL; diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 7decd8383d67..8cd7eb790071 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -99,7 +99,7 @@ static struct tracepoint_user *__tracepoint_user_init(const char *name, struct t struct tracepoint_user *tuser __free(tuser_free) = NULL; int ret; - tuser = kzalloc_obj(*tuser, GFP_KERNEL); + tuser = kzalloc_obj(*tuser); if (!tuser) return NULL; tuser->name = kstrdup(name, GFP_KERNEL); @@ -1403,7 +1403,7 @@ static int trace_fprobe_create_cb(int argc, const char *argv[]) struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index a7e4ad088acf..f283391a4dc8 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c @@ -61,7 +61,7 @@ int ftrace_allocate_ftrace_ops(struct trace_array *tr) if (tr->flags & TRACE_ARRAY_FL_GLOBAL) return 0; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); if (!ops) return -ENOMEM; diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 73f0479aeac0..3d8239fee004 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -434,7 +434,7 @@ int allocate_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops) { struct fgraph_ops *gops; - gops = kzalloc_obj(*gops, GFP_KERNEL); + gops = kzalloc_obj(*gops); if (!gops) return -ENOMEM; diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 808b91873bd6..84539e1cd27e 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1082,7 +1082,7 @@ static int trace_kprobe_create_cb(int argc, const char *argv[]) struct traceprobe_parse_context *ctx __free(traceprobe_parse_context) = NULL; int ret; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->flags = TPARG_FL_KERNEL; diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index 1c752a691317..226cf66e0d68 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c @@ -101,7 +101,7 @@ static void mmio_pipe_open(struct trace_iterator *iter) trace_seq_puts(s, "VERSION 20070824\n"); - hiter = kzalloc_obj(*hiter, GFP_KERNEL); + hiter = kzalloc_obj(*hiter); if (!hiter) return; diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 51e7b0476a7f..dee610e465b9 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -122,7 +122,7 @@ static int osnoise_register_instance(struct trace_array *tr) */ lockdep_assert_held(&trace_types_lock); - inst = kmalloc_obj(*inst, GFP_KERNEL); + inst = kmalloc_obj(*inst); if (!inst) return -ENOMEM; diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c index 05b61ec67622..5ea5e0d76f00 100644 --- a/kernel/trace/trace_printk.c +++ b/kernel/trace/trace_printk.c @@ -69,7 +69,7 @@ void hold_module_trace_bprintk_format(const char **start, const char **end) } fmt = NULL; - tb_fmt = kmalloc_obj(*tb_fmt, GFP_KERNEL); + tb_fmt = kmalloc_obj(*tb_fmt); if (tb_fmt) { fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL); if (fmt) { diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index fff0879cb0e9..b3ce9bb0b971 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -838,7 +838,7 @@ static int __store_entry_arg(struct trace_probe *tp, int argnum) int i, offset, last_offset = 0; if (!earg) { - earg = kzalloc_obj(*tp->entry_arg, GFP_KERNEL); + earg = kzalloc_obj(*tp->entry_arg); if (!earg) return -ENOMEM; earg->size = 2 * tp->nr_args + 1; @@ -1499,7 +1499,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, if (IS_ERR(type)) return PTR_ERR(type); - code = tmp = kzalloc_objs(*code, FETCH_INSN_MAX, GFP_KERNEL); + code = tmp = kzalloc_objs(*code, FETCH_INSN_MAX); if (!code) return -ENOMEM; code[FETCH_INSN_MAX - 1].op = FETCH_OP_END; @@ -1543,7 +1543,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, if (code->op == FETCH_OP_END) break; /* Shrink down the code buffer */ - parg->code = kzalloc_objs(*code, code - tmp + 1, GFP_KERNEL); + parg->code = kzalloc_objs(*code, code - tmp + 1); if (!parg->code) ret = -ENOMEM; else @@ -2149,7 +2149,7 @@ int trace_probe_add_file(struct trace_probe *tp, struct trace_event_file *file) { struct event_file_link *link; - link = kmalloc_obj(*link, GFP_KERNEL); + link = kmalloc_obj(*link); if (!link) return -ENOMEM; diff --git a/kernel/trace/trace_recursion_record.c b/kernel/trace/trace_recursion_record.c index 852069484060..784fe1fbb866 100644 --- a/kernel/trace/trace_recursion_record.c +++ b/kernel/trace/trace_recursion_record.c @@ -129,7 +129,7 @@ static void *recursed_function_seq_start(struct seq_file *m, loff_t *pos) ret = &recursed_functions[*pos]; } - tseq = kzalloc_obj(*tseq, GFP_KERNEL); + tseq = kzalloc_obj(*tseq); if (!tseq) return ERR_PTR(-ENOMEM); diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index ded84f1d8121..e9f0ff962660 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c @@ -444,7 +444,7 @@ int trace_alloc_tgid_map(void) return 0; tgid_map_max = init_pid_ns.pid_max; - map = kvzalloc_objs(*tgid_map, tgid_map_max + 1, GFP_KERNEL); + map = kvzalloc_objs(*tgid_map, tgid_map_max + 1); if (!map) return -ENOMEM; diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 43ed16b3b160..929c84075315 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c @@ -248,7 +248,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt) goto out; /* Add a dynamic probe */ - dyn_ops = kzalloc_obj(*dyn_ops, GFP_KERNEL); + dyn_ops = kzalloc_obj(*dyn_ops); if (!dyn_ops) { printk("MEMORY ERROR "); goto out; diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index 3fec69e8a6d4..856ece13b7dc 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c @@ -77,7 +77,7 @@ static int insert_stat(struct rb_root *root, void *stat, cmp_func_t cmp) struct rb_node **new = &(root->rb_node), *parent = NULL; struct stat_node *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; data->stat = stat; @@ -322,7 +322,7 @@ int register_stat_tracer(struct tracer_stat *trace) } /* Init the session */ - session = kzalloc_obj(*session, GFP_KERNEL); + session = kzalloc_obj(*session); if (!session) return -ENOMEM; diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 2f495e46034f..6ecae3e6d10a 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c @@ -617,7 +617,7 @@ static int syscall_fault_buffer_enable(void) return 0; } - sbuf = kmalloc_obj(*sbuf, GFP_KERNEL); + sbuf = kmalloc_obj(*sbuf); if (!sbuf) return -ENOMEM; diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 83c17b90daad..00ca63934763 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -699,7 +699,7 @@ static int __trace_uprobe_create(int argc, const char **argv) memset(&path, 0, sizeof(path)); tu->filename = no_free_ptr(filename); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; ctx->flags = (is_return ? TPARG_FL_RETURN : 0) | TPARG_FL_USER; diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index ef28c6c52295..bf1a507695b6 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -324,7 +324,7 @@ static struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, struct tracing_map_array *a; unsigned int i; - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) return NULL; @@ -405,7 +405,7 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map) struct tracing_map_elt *elt; int err = 0; - elt = kzalloc_obj(*elt, GFP_KERNEL); + elt = kzalloc_obj(*elt); if (!elt) return ERR_PTR(-ENOMEM); @@ -417,19 +417,19 @@ static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *map) goto free; } - elt->fields = kzalloc_objs(*elt->fields, map->n_fields, GFP_KERNEL); + elt->fields = kzalloc_objs(*elt->fields, map->n_fields); if (!elt->fields) { err = -ENOMEM; goto free; } - elt->vars = kzalloc_objs(*elt->vars, map->n_vars, GFP_KERNEL); + elt->vars = kzalloc_objs(*elt->vars, map->n_vars); if (!elt->vars) { err = -ENOMEM; goto free; } - elt->var_set = kzalloc_objs(*elt->var_set, map->n_vars, GFP_KERNEL); + elt->var_set = kzalloc_objs(*elt->var_set, map->n_vars); if (!elt->var_set) { err = -ENOMEM; goto free; @@ -777,7 +777,7 @@ struct tracing_map *tracing_map_create(unsigned int map_bits, map_bits > TRACING_MAP_BITS_MAX) return ERR_PTR(-EINVAL); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return ERR_PTR(-ENOMEM); @@ -949,7 +949,7 @@ create_sort_entry(void *key, struct tracing_map_elt *elt) { struct tracing_map_sort_entry *sort_entry; - sort_entry = kzalloc_obj(*sort_entry, GFP_KERNEL); + sort_entry = kzalloc_obj(*sort_entry); if (!sort_entry) return NULL; diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index 8287a4ff3f18..df7ab773c7f3 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -614,7 +614,7 @@ static int tracepoint_module_coming(struct module *mod) if (trace_module_has_bad_taint(mod)) return 0; - tp_mod = kmalloc_obj(struct tp_module, GFP_KERNEL); + tp_mod = kmalloc_obj(struct tp_module); if (!tp_mod) return -ENOMEM; tp_mod->mod = mod; diff --git a/kernel/ucount.c b/kernel/ucount.c index d1f723805c6d..d6dc3e859f12 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -163,7 +163,7 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid) if (ucounts) return ucounts; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c index bf84af48dce8..3f1ed7ef0582 100644 --- a/kernel/vhost_task.c +++ b/kernel/vhost_task.c @@ -132,7 +132,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), struct vhost_task *vtsk; struct task_struct *tsk; - vtsk = kzalloc_obj(*vtsk, GFP_KERNEL); + vtsk = kzalloc_obj(*vtsk); if (!vtsk) return ERR_PTR(-ENOMEM); init_completion(&vtsk->exited); diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index d966b8c99052..765c152f6084 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -278,7 +278,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) pipe->nr_accounted = nr_pages; ret = -ENOMEM; - pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages); if (!pages) goto error; @@ -692,7 +692,7 @@ int watch_queue_init(struct pipe_inode_info *pipe) { struct watch_queue *wqueue; - wqueue = kzalloc_obj(*wqueue, GFP_KERNEL); + wqueue = kzalloc_obj(*wqueue); if (!wqueue) return -ENOMEM; diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ee3e81133f78..399b0375a66a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4714,7 +4714,7 @@ struct workqueue_attrs *alloc_workqueue_attrs_noprof(void) { struct workqueue_attrs *attrs; - attrs = kzalloc_obj(*attrs, GFP_KERNEL); + attrs = kzalloc_obj(*attrs); if (!attrs) goto fail; if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL)) @@ -7486,7 +7486,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq) if (WARN_ON(wq->flags & __WQ_ORDERED)) return -EINVAL; - wq->wq_dev = wq_dev = kzalloc_obj(*wq_dev, GFP_KERNEL); + wq->wq_dev = wq_dev = kzalloc_obj(*wq_dev); if (!wq_dev) return -ENOMEM; @@ -7879,9 +7879,9 @@ void __init workqueue_init_early(void) wq_power_efficient = true; /* initialize WQ_AFFN_SYSTEM pods */ - pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], 1, GFP_KERNEL); - pt->pod_node = kzalloc_objs(pt->pod_node[0], 1, GFP_KERNEL); - pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL); + pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], 1); + pt->pod_node = kzalloc_objs(pt->pod_node[0], 1); + pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids); BUG_ON(!pt->pod_cpus || !pt->pod_node || !pt->cpu_pod); BUG_ON(!zalloc_cpumask_var_node(&pt->pod_cpus[0], GFP_KERNEL, NUMA_NO_NODE)); @@ -8063,7 +8063,7 @@ static void __init init_pod_type(struct wq_pod_type *pt, pt->nr_pods = 0; /* init @pt->cpu_pod[] according to @cpus_share_pod() */ - pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL); + pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids); BUG_ON(!pt->cpu_pod); for_each_possible_cpu(cur) { @@ -8080,8 +8080,8 @@ static void __init init_pod_type(struct wq_pod_type *pt, } /* init the rest to match @pt->cpu_pod[] */ - pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], pt->nr_pods, GFP_KERNEL); - pt->pod_node = kzalloc_objs(pt->pod_node[0], pt->nr_pods, GFP_KERNEL); + pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], pt->nr_pods); + pt->pod_node = kzalloc_objs(pt->pod_node[0], pt->nr_pods); BUG_ON(!pt->pod_cpus || !pt->pod_node); for (pod = 0; pod < pt->nr_pods; pod++) diff --git a/lib/assoc_array.c b/lib/assoc_array.c index 6cd376ad5030..45d24dde71b6 100644 --- a/lib/assoc_array.c +++ b/lib/assoc_array.c @@ -454,7 +454,7 @@ static bool assoc_array_insert_in_empty_tree(struct assoc_array_edit *edit) pr_devel("-->%s()\n", __func__); - new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node); if (!new_n0) return false; @@ -536,11 +536,11 @@ static bool assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit, * those now. We may also need a new shortcut, but we deal with that * when we need it. */ - new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node); if (!new_n0) return false; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); - new_n1 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); + new_n1 = kzalloc_obj(struct assoc_array_node); if (!new_n1) return false; edit->new_meta[1] = assoc_array_node_to_ptr(new_n1); @@ -832,7 +832,7 @@ static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit, edit->excised_meta[0] = assoc_array_shortcut_to_ptr(shortcut); /* Create a new node now since we're going to need it anyway */ - new_n0 = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); + new_n0 = kzalloc_obj(struct assoc_array_node); if (!new_n0) return false; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); @@ -975,7 +975,7 @@ struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, */ BUG_ON(assoc_array_ptr_is_meta(object)); - edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1087,7 +1087,7 @@ struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, pr_devel("-->%s()\n", __func__); - edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1280,7 +1280,7 @@ struct assoc_array_edit *assoc_array_clear(struct assoc_array *array, if (!array->root) return NULL; - edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit); if (!edit) return ERR_PTR(-ENOMEM); edit->array = array; @@ -1468,7 +1468,7 @@ int assoc_array_gc(struct assoc_array *array, if (!array->root) return 0; - edit = kzalloc_obj(struct assoc_array_edit, GFP_KERNEL); + edit = kzalloc_obj(struct assoc_array_edit); if (!edit) return -ENOMEM; edit->array = array; @@ -1503,7 +1503,7 @@ descend: /* Duplicate the node at this position */ node = assoc_array_ptr_to_node(cursor); - new_n = kzalloc_obj(struct assoc_array_node, GFP_KERNEL); + new_n = kzalloc_obj(struct assoc_array_node); if (!new_n) goto enomem; pr_devel("dup node %p -> %p\n", node, new_n); diff --git a/lib/bch.c b/lib/bch.c index 82a363dc73c4..9561c0828802 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -1320,7 +1320,7 @@ struct bch_control *bch_init(int m, int t, unsigned int prim_poly, if (prim_poly == 0) prim_poly = prim_poly_tab[m-min_m]; - bch = kzalloc_obj(*bch, GFP_KERNEL); + bch = kzalloc_obj(*bch); if (bch == NULL) goto fail; diff --git a/lib/codetag.c b/lib/codetag.c index 465952125bcb..304667897ad4 100644 --- a/lib/codetag.c +++ b/lib/codetag.c @@ -193,7 +193,7 @@ static int codetag_module_init(struct codetag_type *cttype, struct module *mod) BUG_ON(range.start > range.stop); - cmod = kmalloc_obj(*cmod, GFP_KERNEL); + cmod = kmalloc_obj(*cmod); if (unlikely(!cmod)) return -ENOMEM; @@ -383,7 +383,7 @@ codetag_register_type(const struct codetag_type_desc *desc) BUG_ON(desc->tag_size <= 0); - cttype = kzalloc_obj(*cttype, GFP_KERNEL); + cttype = kzalloc_obj(*cttype); if (unlikely(!cttype)) return ERR_PTR(-ENOMEM); diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c index dfc6219532b9..c86ab6e55d17 100644 --- a/lib/cpu_rmap.c +++ b/lib/cpu_rmap.c @@ -309,7 +309,7 @@ EXPORT_SYMBOL(irq_cpu_rmap_remove); */ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq) { - struct irq_glue *glue = kzalloc_obj(*glue, GFP_KERNEL); + struct irq_glue *glue = kzalloc_obj(*glue); int rc; if (!glue) diff --git a/lib/crypto/gf128mul.c b/lib/crypto/gf128mul.c index 42c5fdc2d4ca..e5a727b15f07 100644 --- a/lib/crypto/gf128mul.c +++ b/lib/crypto/gf128mul.c @@ -245,12 +245,12 @@ struct gf128mul_64k *gf128mul_init_64k_bbe(const be128 *g) struct gf128mul_64k *t; int i, j, k; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) goto out; for (i = 0; i < 16; i++) { - t->t[i] = kzalloc_obj(*t->t[i], GFP_KERNEL); + t->t[i] = kzalloc_obj(*t->t[i]); if (!t->t[i]) { gf128mul_free_64k(t); t = NULL; @@ -326,7 +326,7 @@ struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g) struct gf128mul_4k *t; int j, k; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) goto out; diff --git a/lib/crypto/mpi/mpih-mul.c b/lib/crypto/mpi/mpih-mul.c index 9cd0843e9d36..29dd80609c47 100644 --- a/lib/crypto/mpi/mpih-mul.c +++ b/lib/crypto/mpi/mpih-mul.c @@ -372,7 +372,7 @@ mpihelp_mul_karatsuba_case(mpi_ptr_t prodp, return -ENOMEM; } else { if (!ctx->next) { - ctx->next = kzalloc_obj(*ctx, GFP_KERNEL); + ctx->next = kzalloc_obj(*ctx); if (!ctx->next) return -ENOMEM; } diff --git a/lib/crypto/mpi/mpiutil.c b/lib/crypto/mpi/mpiutil.c index 4999f756f50e..f4faf7c903f9 100644 --- a/lib/crypto/mpi/mpiutil.c +++ b/lib/crypto/mpi/mpiutil.c @@ -33,7 +33,7 @@ MPI mpi_alloc(unsigned nlimbs) { MPI a; - a = kmalloc_obj(*a, GFP_KERNEL); + a = kmalloc_obj(*a); if (!a) return a; @@ -93,14 +93,14 @@ int mpi_resize(MPI a, unsigned nlimbs) return 0; /* no need to do it */ if (a->d) { - p = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL); + p = kzalloc_objs(mpi_limb_t, nlimbs); if (!p) return -ENOMEM; memcpy(p, a->d, a->alloced * sizeof(mpi_limb_t)); kfree_sensitive(a->d); a->d = p; } else { - a->d = kzalloc_objs(mpi_limb_t, nlimbs, GFP_KERNEL); + a->d = kzalloc_objs(mpi_limb_t, nlimbs); if (!a->d) return -ENOMEM; } diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c index d66940b0c165..d8d4f6553559 100644 --- a/lib/dim/net_dim.c +++ b/lib/dim/net_dim.c @@ -105,7 +105,7 @@ int net_dim_init_irq_moder(struct net_device *dev, u8 profile_flags, struct dim_irq_moder *moder; int len; - dev->irq_moder = kzalloc_obj(*dev->irq_moder, GFP_KERNEL); + dev->irq_moder = kzalloc_obj(*dev->irq_moder); if (!dev->irq_moder) return -ENOMEM; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a5b5e936e2ab..18a71a9108d3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1241,7 +1241,7 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) return 0; } - dt = kzalloc_obj(*dt, GFP_KERNEL); + dt = kzalloc_obj(*dt); if (dt == NULL) { pr_err("error adding module: %s\n", modname); return -ENOMEM; diff --git a/lib/error-inject.c b/lib/error-inject.c index 06c913ec2c1f..f3d1b70be605 100644 --- a/lib/error-inject.c +++ b/lib/error-inject.c @@ -80,7 +80,7 @@ static void populate_error_injection_list(struct error_injection_entry *start, continue; } - ent = kmalloc_obj(*ent, GFP_KERNEL); + ent = kmalloc_obj(*ent); if (!ent) break; ent->start_addr = entry; diff --git a/lib/group_cpus.c b/lib/group_cpus.c index 5d1758a05407..e6e18d7a49bb 100644 --- a/lib/group_cpus.c +++ b/lib/group_cpus.c @@ -47,7 +47,7 @@ static cpumask_var_t *alloc_node_to_cpumask(void) cpumask_var_t *masks; int node; - masks = kzalloc_objs(cpumask_var_t, nr_node_ids, GFP_KERNEL); + masks = kzalloc_objs(cpumask_var_t, nr_node_ids); if (!masks) return NULL; @@ -320,10 +320,10 @@ static int alloc_cluster_groups(unsigned int ncpus, goto no_cluster; /* Allocate memory based on cluster number. */ - clusters = kzalloc_objs(*clusters, ncluster, GFP_KERNEL); + clusters = kzalloc_objs(*clusters, ncluster); if (!clusters) goto no_cluster; - cluster_groups = kzalloc_objs(struct node_groups, ncluster, GFP_KERNEL); + cluster_groups = kzalloc_objs(struct node_groups, ncluster); if (!cluster_groups) goto fail_cluster_groups; @@ -432,7 +432,7 @@ static int __group_cpus_evenly(unsigned int startgrp, unsigned int numgrps, return numgrps; } - node_groups = kzalloc_objs(struct node_groups, nr_node_ids, GFP_KERNEL); + node_groups = kzalloc_objs(struct node_groups, nr_node_ids); if (!node_groups) return -ENOMEM; @@ -506,7 +506,7 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps, unsigned int *nummasks) if (!node_to_cpumask) goto fail_npresmsk; - masks = kzalloc_objs(*masks, numgrps, GFP_KERNEL); + masks = kzalloc_objs(*masks, numgrps); if (!masks) goto fail_node_to_cpumask; @@ -572,7 +572,7 @@ struct cpumask *group_cpus_evenly(unsigned int numgrps, unsigned int *nummasks) if (numgrps == 0) return NULL; - masks = kzalloc_objs(*masks, numgrps, GFP_KERNEL); + masks = kzalloc_objs(*masks, numgrps); if (!masks) return NULL; diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c index d1ab3d40a645..16200feacbf3 100644 --- a/lib/interval_tree_test.c +++ b/lib/interval_tree_test.c @@ -311,7 +311,7 @@ static inline int span_iteration_check(void) {return 0; } static int interval_tree_test_init(void) { - nodes = kmalloc_objs(struct interval_tree_node, nnodes, GFP_KERNEL); + nodes = kmalloc_objs(struct interval_tree_node, nnodes); if (!nodes) return -ENOMEM; diff --git a/lib/iov_iter.c b/lib/iov_iter.c index a9768fae1f44..0a63c7fba313 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -903,7 +903,7 @@ static int want_pages_array(struct page ***res, size_t size, count = maxpages; WARN_ON(!count); // caller should've prevented that if (!*res) { - *res = kvmalloc_objs(struct page *, count, GFP_KERNEL); + *res = kvmalloc_objs(struct page *, count); if (!*res) return 0; } @@ -1318,7 +1318,7 @@ struct iovec *iovec_from_user(const struct iovec __user *uvec, if (nr_segs > UIO_MAXIOV) return ERR_PTR(-EINVAL); if (nr_segs > fast_segs) { - iov = kmalloc_objs(struct iovec, nr_segs, GFP_KERNEL); + iov = kmalloc_objs(struct iovec, nr_segs); if (!iov) return ERR_PTR(-ENOMEM); } diff --git a/lib/kobject.c b/lib/kobject.c index b178d248617b..cfdb2c3f20a2 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -765,7 +765,7 @@ static struct kobject *kobject_create(void) { struct kobject *kobj; - kobj = kzalloc_obj(*kobj, GFP_KERNEL); + kobj = kzalloc_obj(*kobj); if (!kobj) return NULL; @@ -962,7 +962,7 @@ static struct kset *kset_create(const char *name, struct kset *kset; int retval; - kset = kzalloc_obj(*kset, GFP_KERNEL); + kset = kzalloc_obj(*kset); if (!kset) return NULL; retval = kobject_set_name(&kset->kobj, "%s", name); diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 29a28a3b957f..871941c9830c 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -124,7 +124,7 @@ static int kobject_action_args(const char *buf, size_t count, if (!count) return -EINVAL; - env = kzalloc_obj(*env, GFP_KERNEL); + env = kzalloc_obj(*env); if (!env) return -ENOMEM; @@ -537,7 +537,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, } /* environment buffer */ - env = kzalloc_obj(struct kobj_uevent_env, GFP_KERNEL); + env = kzalloc_obj(struct kobj_uevent_env); if (!env) return -ENOMEM; @@ -776,7 +776,7 @@ static int uevent_net_init(struct net *net) .flags = NL_CFG_F_NONROOT_RECV }; - ue_sk = kzalloc_obj(*ue_sk, GFP_KERNEL); + ue_sk = kzalloc_obj(*ue_sk); if (!ue_sk) return -ENOMEM; diff --git a/lib/kunit/attributes.c b/lib/kunit/attributes.c index 6b7803a16e22..6d7a53af94a9 100644 --- a/lib/kunit/attributes.c +++ b/lib/kunit/attributes.c @@ -410,7 +410,7 @@ struct kunit_suite *kunit_filter_attr_tests(const struct kunit_suite *const suit kunit_suite_for_each_test_case(suite, test_case) { n++; } - filtered = kzalloc_objs(*filtered, n + 1, GFP_KERNEL); + filtered = kzalloc_objs(*filtered, n + 1); if (!filtered) { kfree(copy); return ERR_PTR(-ENOMEM); diff --git a/lib/kunit/device.c b/lib/kunit/device.c index 7c18d4ae2de3..85d57ad34045 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -111,7 +111,7 @@ static struct kunit_device *kunit_device_register_internal(struct kunit *test, struct kunit_device *kunit_dev; int err = -ENOMEM; - kunit_dev = kzalloc_obj(*kunit_dev, GFP_KERNEL); + kunit_dev = kzalloc_obj(*kunit_dev); if (!kunit_dev) return ERR_PTR(err); diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 27740d975082..04736a804e4c 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -131,7 +131,7 @@ kunit_filter_glob_tests(const struct kunit_suite *const suite, const char *test_ if (!copy) return ERR_PTR(-ENOMEM); - filtered = kzalloc_objs(*filtered, n + 1, GFP_KERNEL); + filtered = kzalloc_objs(*filtered, n + 1); if (!filtered) { kfree(copy); return ERR_PTR(-ENOMEM); @@ -179,7 +179,7 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set, const size_t max = suite_set->end - suite_set->start; - copy = kzalloc_objs(*copy, max, GFP_KERNEL); + copy = kzalloc_objs(*copy, max); if (!copy) { /* won't be able to run anything, return an empty set */ return filtered; } diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c index f28093153516..4cb119ad8f64 100644 --- a/lib/kunit/executor_test.c +++ b/lib/kunit/executor_test.c @@ -272,7 +272,7 @@ static void free_suite_set_at_end(struct kunit *test, const void *to_free) if (!((struct kunit_suite_set *)to_free)->start) return; - free = kzalloc_obj(struct kunit_suite_set, GFP_KERNEL); + free = kzalloc_obj(struct kunit_suite_set); *free = *(struct kunit_suite_set *)to_free; kunit_add_action(test, free_suite_set, (void *)free); diff --git a/lib/kunit/kunit-example-test.c b/lib/kunit/kunit-example-test.c index 34ba0bd74504..0bae7b7ca0b0 100644 --- a/lib/kunit/kunit-example-test.c +++ b/lib/kunit/kunit-example-test.c @@ -283,7 +283,7 @@ static void example_slow_test(struct kunit *test) */ static int example_resource_init(struct kunit_resource *res, void *context) { - int *info = kmalloc_obj(*info, GFP_KERNEL); + int *info = kmalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index 393b90bd2ec2..126e30879dad 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-test.c @@ -538,7 +538,7 @@ static void kunit_resource_test_action_ordering(struct kunit *test) static int kunit_resource_test_init(struct kunit *test) { - struct kunit_test_resource_context *ctx = kzalloc_obj(*ctx, GFP_KERNEL); + struct kunit_test_resource_context *ctx = kzalloc_obj(*ctx); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); diff --git a/lib/kunit/resource.c b/lib/kunit/resource.c index 08a16622a2c9..45e55238ccf6 100644 --- a/lib/kunit/resource.c +++ b/lib/kunit/resource.c @@ -98,7 +98,7 @@ int kunit_add_action(struct kunit *test, void (*action)(void *), void *ctx) KUNIT_ASSERT_NOT_NULL_MSG(test, action, "Tried to action a NULL function!"); - action_ctx = kzalloc_obj(*action_ctx, GFP_KERNEL); + action_ctx = kzalloc_obj(*action_ctx); if (!action_ctx) return -ENOMEM; diff --git a/lib/kunit/static_stub.c b/lib/kunit/static_stub.c index 29a91129d7a3..d9dd6377aa38 100644 --- a/lib/kunit/static_stub.c +++ b/lib/kunit/static_stub.c @@ -111,7 +111,7 @@ void __kunit_activate_static_stub(struct kunit *test, /* We got an extra reference from find_resource(), so put it. */ kunit_put_resource(res); } else { - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ctx->real_fn_addr = real_fn_addr; ctx->replacement_addr = replacement_addr; diff --git a/lib/logic_iomem.c b/lib/logic_iomem.c index d0ba023f79fb..42a571d05670 100644 --- a/lib/logic_iomem.c +++ b/lib/logic_iomem.c @@ -48,7 +48,7 @@ int logic_iomem_add_region(struct resource *resource, if (WARN_ON((resource->flags & IORESOURCE_TYPE_BITS) != IORESOURCE_MEM)) return -EINVAL; - rreg = kzalloc_obj(*rreg, GFP_KERNEL); + rreg = kzalloc_obj(*rreg); if (!rreg) return -ENOMEM; diff --git a/lib/lru_cache.c b/lib/lru_cache.c index b1ee3b2540c9..82f775044056 100644 --- a/lib/lru_cache.c +++ b/lib/lru_cache.c @@ -94,14 +94,14 @@ struct lru_cache *lc_create(const char *name, struct kmem_cache *cache, if (e_count > LC_MAX_ACTIVE) return NULL; - slot = kzalloc_objs(struct hlist_head, e_count, GFP_KERNEL); + slot = kzalloc_objs(struct hlist_head, e_count); if (!slot) goto out_fail; - element = kzalloc_objs(struct lc_element *, e_count, GFP_KERNEL); + element = kzalloc_objs(struct lc_element *, e_count); if (!element) goto out_fail; - lc = kzalloc_obj(*lc, GFP_KERNEL); + lc = kzalloc_obj(*lc); if (!lc) goto out_fail; diff --git a/lib/lwq.c b/lib/lwq.c index 3a8fc05d9420..c1e11ba6f254 100644 --- a/lib/lwq.c +++ b/lib/lwq.c @@ -110,7 +110,7 @@ static int lwq_test(void) for (i = 0; i < ARRAY_SIZE(threads); i++) threads[i] = kthread_run(lwq_exercise, &q, "lwq-test-%d", i); for (i = 0; i < 100; i++) { - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) break; t->i = i; diff --git a/lib/objagg.c b/lib/objagg.c index c508b78850c0..e00cb6758c31 100644 --- a/lib/objagg.c +++ b/lib/objagg.c @@ -525,7 +525,7 @@ struct objagg *objagg_create(const struct objagg_ops *ops, !ops->delta_destroy)) return ERR_PTR(-EINVAL); - objagg = kzalloc_obj(*objagg, GFP_KERNEL); + objagg = kzalloc_obj(*objagg); if (!objagg) return ERR_PTR(-ENOMEM); objagg->ops = ops; @@ -786,11 +786,11 @@ static struct objagg_tmp_graph *objagg_tmp_graph_create(struct objagg *objagg) struct objagg_obj *objagg_obj; int i, j; - graph = kzalloc_obj(*graph, GFP_KERNEL); + graph = kzalloc_obj(*graph); if (!graph) return NULL; - graph->nodes = kzalloc_objs(*graph->nodes, nodes_count, GFP_KERNEL); + graph->nodes = kzalloc_objs(*graph->nodes, nodes_count); if (!graph->nodes) goto err_nodes_alloc; graph->nodes_count = nodes_count; @@ -930,7 +930,7 @@ struct objagg_hints *objagg_hints_get(struct objagg *objagg, struct objagg_hints *objagg_hints; int err; - objagg_hints = kzalloc_obj(*objagg_hints, GFP_KERNEL); + objagg_hints = kzalloc_obj(*objagg_hints); if (!objagg_hints) return ERR_PTR(-ENOMEM); diff --git a/lib/parman.c b/lib/parman.c index e93b82b73522..0de691c202ab 100644 --- a/lib/parman.c +++ b/lib/parman.c @@ -268,7 +268,7 @@ struct parman *parman_create(const struct parman_ops *ops, void *priv) { struct parman *parman; - parman = kzalloc_obj(*parman, GFP_KERNEL); + parman = kzalloc_obj(*parman); if (!parman) return NULL; INIT_LIST_HEAD(&parman->prio_list); diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c index c1222c11f6a8..e4612ea147bb 100644 --- a/lib/pldmfw/pldmfw.c +++ b/lib/pldmfw/pldmfw.c @@ -287,7 +287,7 @@ pldm_parse_desc_tlvs(struct pldmfw_priv *data, struct pldmfw_record *record, u8 if (err) return err; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; @@ -328,7 +328,7 @@ pldm_parse_one_record(struct pldmfw_priv *data, int i; /* Make a copy and insert it into the record list */ - record = kzalloc_obj(*record, GFP_KERNEL); + record = kzalloc_obj(*record); if (!record) return -ENOMEM; @@ -465,7 +465,7 @@ static int pldm_parse_components(struct pldmfw_priv *data) if (err) return err; - component = kzalloc_obj(*component, GFP_KERNEL); + component = kzalloc_obj(*component); if (!component) return -ENOMEM; @@ -848,7 +848,7 @@ int pldmfw_flash_image(struct pldmfw *context, const struct firmware *fw) struct pldmfw_priv *data; int err; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index 862318e99c9a..768c5e6453f3 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -399,7 +399,7 @@ static int augmented_check(void) static int __init rbtree_test_init(void) { - nodes = kmalloc_objs(*nodes, nnodes, GFP_KERNEL); + nodes = kmalloc_objs(*nodes, nnodes); if (!nodes) return -ENOMEM; diff --git a/lib/reed_solomon/test_rslib.c b/lib/reed_solomon/test_rslib.c index 3c17b04a0a0a..42b856e6c8a8 100644 --- a/lib/reed_solomon/test_rslib.c +++ b/lib/reed_solomon/test_rslib.c @@ -111,7 +111,7 @@ static struct wspace *alloc_ws(struct rs_codec *rs) struct wspace *ws; int nn = rs->nn; - ws = kzalloc_obj(*ws, GFP_KERNEL); + ws = kzalloc_obj(*ws); if (!ws) return NULL; @@ -124,7 +124,7 @@ static struct wspace *alloc_ws(struct rs_codec *rs) ws->s = ws->r + nn; ws->corr = ws->s + nroots; - ws->errlocs = kmalloc_objs(int, nn + nroots, GFP_KERNEL); + ws->errlocs = kmalloc_objs(int, nn + nroots); if (!ws->errlocs) goto err; diff --git a/lib/stackdepot.c b/lib/stackdepot.c index b58f01c2ca7e..dd2717ff94bf 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -260,7 +260,7 @@ int stack_depot_init(void) entries = 1UL << STACK_BUCKET_NUMBER_ORDER_MAX; pr_info("allocating hash table of %lu entries via kvcalloc\n", entries); - stack_table = kvzalloc_objs(struct list_head, entries, GFP_KERNEL); + stack_table = kvzalloc_objs(struct list_head, entries); if (!stack_table) { pr_err("hash table allocation failed, disabling\n"); stack_depot_disabled = true; diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 72a15e7132b9..169eaf583494 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -147,7 +147,7 @@ int parse_int_array(const char *buf, size_t count, int **array) if (!nints) return -ENOENT; - ints = kzalloc_objs(*ints, nints + 1, GFP_KERNEL); + ints = kzalloc_objs(*ints, nints + 1); if (!ints) return -ENOMEM; diff --git a/lib/test_bpf.c b/lib/test_bpf.c index e4cb339f322e..f5b08273c4f3 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -94,7 +94,7 @@ static int bpf_fill_maxinsns1(struct bpf_test *self) __u32 k = ~0; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -113,7 +113,7 @@ static int bpf_fill_maxinsns2(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -133,7 +133,7 @@ static int bpf_fill_maxinsns3(struct bpf_test *self) struct rnd_state rnd; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -159,7 +159,7 @@ static int bpf_fill_maxinsns4(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -178,7 +178,7 @@ static int bpf_fill_maxinsns5(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -201,7 +201,7 @@ static int bpf_fill_maxinsns6(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -223,7 +223,7 @@ static int bpf_fill_maxinsns7(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -249,7 +249,7 @@ static int bpf_fill_maxinsns8(struct bpf_test *self) struct sock_filter *insn; int i, jmp_off = len - 3; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -272,7 +272,7 @@ static int bpf_fill_maxinsns9(struct bpf_test *self) struct bpf_insn *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -298,7 +298,7 @@ static int bpf_fill_maxinsns10(struct bpf_test *self) struct bpf_insn *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -324,7 +324,7 @@ static int __bpf_fill_ja(struct bpf_test *self, unsigned int len, unsigned int rlen; int i, j; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -358,7 +358,7 @@ static int bpf_fill_maxinsns12(struct bpf_test *self) struct sock_filter *insn; int i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -381,7 +381,7 @@ static int bpf_fill_maxinsns13(struct bpf_test *self) struct sock_filter *insn; int i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -410,7 +410,7 @@ static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self) struct sock_filter *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -434,7 +434,7 @@ static int __bpf_fill_stxdw(struct bpf_test *self, int size) struct bpf_insn *insn; int i; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -484,7 +484,7 @@ static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm, bool alu3 int len = S16_MAX + 5; int i; - insns = kmalloc_objs(*insns, len, GFP_KERNEL); + insns = kmalloc_objs(*insns, len); if (!insns) return -ENOMEM; @@ -626,7 +626,7 @@ static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op, int imm, k; int i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -759,7 +759,7 @@ static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op, int i = 0; u64 val; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -1244,7 +1244,7 @@ static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op, bool alu32) u32 imm; int rd; - insns = kmalloc_objs(*insns, len, GFP_KERNEL); + insns = kmalloc_objs(*insns, len); if (!insns) return -ENOMEM; @@ -1426,7 +1426,7 @@ static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32) int rd, rs; int i = 0; - insns = kmalloc_objs(*insns, len, GFP_KERNEL); + insns = kmalloc_objs(*insns, len); if (!insns) return -ENOMEM; @@ -1917,7 +1917,7 @@ static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op) u64 mem, upd, res; int rd, rs, i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -2163,7 +2163,7 @@ static int bpf_fill_ld_imm64_magn(struct bpf_test *self) int bit, adj, sign; int i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -2217,7 +2217,7 @@ static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self, u32 rand = 1; int i = 0; - insn = kmalloc_objs(*insn, len, GFP_KERNEL); + insn = kmalloc_objs(*insn, len); if (!insn) return -ENOMEM; @@ -2724,7 +2724,7 @@ static int __bpf_fill_staggered_jumps(struct bpf_test *self, struct bpf_insn *insns; int off, ind; - insns = kmalloc_objs(*insns, len, GFP_KERNEL); + insns = kmalloc_objs(*insns, len); if (!insns) return -ENOMEM; diff --git a/lib/test_debug_virtual.c b/lib/test_debug_virtual.c index 288d5510406c..518ee8d213cd 100644 --- a/lib/test_debug_virtual.c +++ b/lib/test_debug_virtual.c @@ -29,7 +29,7 @@ static int __init test_debug_virtual_init(void) pr_info("PA: %pa for VA: 0x%lx\n", &pa, (unsigned long)va); - foo = kzalloc_obj(*foo, GFP_KERNEL); + foo = kzalloc_obj(*foo); if (!foo) return -ENOMEM; diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 1a933a874148..b471d720879a 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -1309,7 +1309,7 @@ static ssize_t upload_register_store(struct device *dev, goto free_name; } - tst = kzalloc_obj(*tst, GFP_KERNEL); + tst = kzalloc_obj(*tst); if (!tst) { ret = -ENOMEM; goto free_name; @@ -1526,7 +1526,7 @@ static int __init test_firmware_init(void) { int rc; - test_fw_config = kzalloc_obj(struct test_config, GFP_KERNEL); + test_fw_config = kzalloc_obj(struct test_config); if (!test_fw_config) return -ENOMEM; diff --git a/lib/test_hmm.c b/lib/test_hmm.c index 0f9eb1c16ef0..0964d53365e6 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -166,7 +166,7 @@ static int dmirror_fops_open(struct inode *inode, struct file *filp) int ret; /* Mirror this process address space */ - dmirror = kzalloc_obj(*dmirror, GFP_KERNEL); + dmirror = kzalloc_obj(*dmirror); if (dmirror == NULL) return -ENOMEM; @@ -504,7 +504,7 @@ static int dmirror_allocate_chunk(struct dmirror_device *mdevice, void *ptr; int ret = -ENOMEM; - devmem = kzalloc_obj(*devmem, GFP_KERNEL); + devmem = kzalloc_obj(*devmem); if (!devmem) return ret; diff --git a/lib/test_kho.c b/lib/test_kho.c index 601f2323ef7e..7ef9e4061869 100644 --- a/lib/test_kho.c +++ b/lib/test_kho.c @@ -211,7 +211,7 @@ static int kho_test_save(void) max_mem = PAGE_ALIGN(max_mem); max_nr = max_mem >> PAGE_SHIFT; - folios = kvmalloc_objs(*state->folios, max_nr, GFP_KERNEL); + folios = kvmalloc_objs(*state->folios, max_nr); if (!folios) return -ENOMEM; state->folios = folios; diff --git a/lib/test_memcat_p.c b/lib/test_memcat_p.c index 0f0a15fea6e2..62f1633b30f8 100644 --- a/lib/test_memcat_p.c +++ b/lib/test_memcat_p.c @@ -24,20 +24,20 @@ static int __init test_memcat_p_init(void) struct test_struct **in0, **in1, **out, **p; int err = -ENOMEM, i, r, total = 0; - in0 = kzalloc_objs(*in0, INPUT_MAX, GFP_KERNEL); + in0 = kzalloc_objs(*in0, INPUT_MAX); if (!in0) return err; - in1 = kzalloc_objs(*in1, INPUT_MAX, GFP_KERNEL); + in1 = kzalloc_objs(*in1, INPUT_MAX); if (!in1) goto err_free_in0; for (i = 0, r = 1; i < INPUT_MAX - 1; i++) { - in0[i] = kmalloc_obj(**in0, GFP_KERNEL); + in0[i] = kmalloc_obj(**in0); if (!in0[i]) goto err_free_elements; - in1[i] = kmalloc_obj(**in1, GFP_KERNEL); + in1[i] = kmalloc_obj(**in1); if (!in1[i]) { kfree(in0[i]); goto err_free_elements; diff --git a/lib/test_objagg.c b/lib/test_objagg.c index a391f0b998c9..f21e3ae01395 100644 --- a/lib/test_objagg.c +++ b/lib/test_objagg.c @@ -107,7 +107,7 @@ static void *delta_create(void *priv, void *parent_obj, void *obj) if (!delta_check(priv, parent_obj, obj)) return ERR_PTR(-EINVAL); - delta = kzalloc_obj(*delta, GFP_KERNEL); + delta = kzalloc_obj(*delta); if (!delta) return ERR_PTR(-ENOMEM); delta->key_id_diff = diff; @@ -130,7 +130,7 @@ static void *root_create(void *priv, void *obj, unsigned int id) struct tokey *key = obj; struct root *root; - root = kzalloc_obj(*root, GFP_KERNEL); + root = kzalloc_obj(*root); if (!root) return ERR_PTR(-ENOMEM); memcpy(&root->key, key, sizeof(root->key)); diff --git a/lib/test_parman.c b/lib/test_parman.c index ae5a0a2f63c3..28f0951189ab 100644 --- a/lib/test_parman.c +++ b/lib/test_parman.c @@ -219,7 +219,7 @@ static struct test_parman *test_parman_create(const struct parman_ops *ops) struct test_parman *test_parman; int err; - test_parman = kzalloc_obj(*test_parman, GFP_KERNEL); + test_parman = kzalloc_obj(*test_parman); if (!test_parman) return ERR_PTR(-ENOMEM); err = test_parman_resize(test_parman, TEST_PARMAN_BASE_COUNT); diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index 12de6388cd9b..0b33559a910b 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c @@ -524,7 +524,7 @@ static int __init test_insert_dup(struct test_obj_rhl *rhl_test_objects, const char *key; int err = 0; - rhlt = kmalloc_obj(*rhlt, GFP_KERNEL); + rhlt = kmalloc_obj(*rhlt); if (WARN_ON(!rhlt)) return -EINVAL; diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index 5ed369a92c75..876c72c18a0c 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -396,7 +396,7 @@ vm_map_ram_test(void) int i; map_nr_pages = nr_pages > 0 ? nr_pages:1; - pages = kzalloc_objs(struct page *, map_nr_pages, GFP_KERNEL); + pages = kzalloc_objs(struct page *, map_nr_pages); if (!pages) return -1; @@ -542,7 +542,7 @@ init_test_configuration(void) nr_threads = clamp(nr_threads, 1, (int) USHRT_MAX); /* Allocate the space for test instances. */ - tdriver = kvzalloc_objs(*tdriver, nr_threads, GFP_KERNEL); + tdriver = kvzalloc_objs(*tdriver, nr_threads); if (tdriver == NULL) return -1; diff --git a/lib/tests/kunit_iov_iter.c b/lib/tests/kunit_iov_iter.c index 500565631cbd..bb847e5010eb 100644 --- a/lib/tests/kunit_iov_iter.c +++ b/lib/tests/kunit_iov_iter.c @@ -387,7 +387,7 @@ static void __init iov_kunit_load_folioq(struct kunit *test, for (i = 0; i < npages; i++) { if (folioq_full(p)) { - p->next = kzalloc_obj(struct folio_queue, GFP_KERNEL); + p->next = kzalloc_obj(struct folio_queue); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, p->next); folioq_init(p->next, 0); p->next->prev = p; @@ -403,7 +403,7 @@ static struct folio_queue *iov_kunit_create_folioq(struct kunit *test) { struct folio_queue *folioq; - folioq = kzalloc_obj(struct folio_queue, GFP_KERNEL); + folioq = kzalloc_obj(struct folio_queue); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, folioq); kunit_add_action_or_reset(test, iov_kunit_destroy_folioq, folioq); folioq_init(folioq, 0); @@ -565,7 +565,7 @@ static struct xarray *iov_kunit_create_xarray(struct kunit *test) { struct xarray *xarray; - xarray = kzalloc_obj(struct xarray, GFP_KERNEL); + xarray = kzalloc_obj(struct xarray); xa_init(xarray); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xarray); kunit_add_action_or_reset(test, iov_kunit_destroy_xarray, xarray); diff --git a/lib/xz/xz_dec_bcj.c b/lib/xz/xz_dec_bcj.c index 6e0fa5bef841..cc49a300a5b2 100644 --- a/lib/xz/xz_dec_bcj.c +++ b/lib/xz/xz_dec_bcj.c @@ -591,7 +591,7 @@ enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s, struct xz_dec_lzma2 *lzma2, struct xz_dec_bcj *xz_dec_bcj_create(bool single_call) { - struct xz_dec_bcj *s = kmalloc_obj(*s, GFP_KERNEL); + struct xz_dec_bcj *s = kmalloc_obj(*s); if (s != NULL) s->single_call = single_call; diff --git a/lib/xz/xz_dec_lzma2.c b/lib/xz/xz_dec_lzma2.c index 02fccb7795b5..4b783ac94e71 100644 --- a/lib/xz/xz_dec_lzma2.c +++ b/lib/xz/xz_dec_lzma2.c @@ -1138,7 +1138,7 @@ enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, struct xz_buf *b) struct xz_dec_lzma2 *xz_dec_lzma2_create(enum xz_mode mode, uint32_t dict_max) { - struct xz_dec_lzma2 *s = kmalloc_obj(*s, GFP_KERNEL); + struct xz_dec_lzma2 *s = kmalloc_obj(*s); if (s == NULL) return NULL; @@ -1296,7 +1296,7 @@ struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode, if (dict_size < 4096 || dict_size > (3U << 30)) return NULL; - s = kmalloc_obj(*s, GFP_KERNEL); + s = kmalloc_obj(*s); if (s == NULL) return NULL; diff --git a/lib/xz/xz_dec_stream.c b/lib/xz/xz_dec_stream.c index 0844eb6e990c..59bfd54ffee7 100644 --- a/lib/xz/xz_dec_stream.c +++ b/lib/xz/xz_dec_stream.c @@ -784,7 +784,7 @@ enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b) struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max) { - struct xz_dec *s = kmalloc_obj(*s, GFP_KERNEL); + struct xz_dec *s = kmalloc_obj(*s); if (s == NULL) return NULL; diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c index d5f9a77e41c6..12169aacd3f1 100644 --- a/lib/zlib_inflate/infutil.c +++ b/lib/zlib_inflate/infutil.c @@ -14,7 +14,7 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz, int rc; rc = -ENOMEM; - strm = kmalloc_obj(*strm, GFP_KERNEL); + strm = kmalloc_obj(*strm); if (strm == NULL) goto gunzip_nomem1; strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); diff --git a/mm/cma_debug.c b/mm/cma_debug.c index cb94f897169d..5ae38f5abbcc 100644 --- a/mm/cma_debug.c +++ b/mm/cma_debug.c @@ -131,7 +131,7 @@ static int cma_alloc_mem(struct cma *cma, int count) struct cma_mem *mem; struct page *p; - mem = kzalloc_obj(*mem, GFP_KERNEL); + mem = kzalloc_obj(*mem); if (!mem) return -ENOMEM; diff --git a/mm/cma_sysfs.c b/mm/cma_sysfs.c index ee76baaf843c..f52b696bc46d 100644 --- a/mm/cma_sysfs.c +++ b/mm/cma_sysfs.c @@ -117,7 +117,7 @@ static int __init cma_sysfs_init(void) return -ENOMEM; for (i = 0; i < cma_area_count; i++) { - cma_kobj = kzalloc_obj(*cma_kobj, GFP_KERNEL); + cma_kobj = kzalloc_obj(*cma_kobj); if (!cma_kobj) { err = -ENOMEM; goto out; diff --git a/mm/damon/core.c b/mm/damon/core.c index 2d73d7effa3b..01eba1a547d4 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -273,7 +273,7 @@ struct damos_filter *damos_new_filter(enum damos_filter_type type, { struct damos_filter *filter; - filter = kmalloc_obj(*filter, GFP_KERNEL); + filter = kmalloc_obj(*filter); if (!filter) return NULL; filter->type = type; @@ -332,7 +332,7 @@ struct damos_quota_goal *damos_new_quota_goal( { struct damos_quota_goal *goal; - goal = kmalloc_obj(*goal, GFP_KERNEL); + goal = kmalloc_obj(*goal); if (!goal) return NULL; goal->metric = metric; @@ -385,7 +385,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, { struct damos *scheme; - scheme = kmalloc_obj(*scheme, GFP_KERNEL); + scheme = kmalloc_obj(*scheme); if (!scheme) return NULL; scheme->pattern = *pattern; @@ -473,7 +473,7 @@ struct damon_target *damon_new_target(void) { struct damon_target *t; - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) return NULL; @@ -529,7 +529,7 @@ struct damon_ctx *damon_new_ctx(void) { struct damon_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return NULL; diff --git a/mm/damon/sysfs-common.c b/mm/damon/sysfs-common.c index 2149008135ef..83e24a9b5a0d 100644 --- a/mm/damon/sysfs-common.c +++ b/mm/damon/sysfs-common.c @@ -19,7 +19,7 @@ struct damon_sysfs_ul_range *damon_sysfs_ul_range_alloc( unsigned long min, unsigned long max) { - struct damon_sysfs_ul_range *range = kmalloc_obj(*range, GFP_KERNEL); + struct damon_sysfs_ul_range *range = kmalloc_obj(*range); if (!range) return NULL; diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index ba700da545af..5a12d1103d33 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -210,7 +210,7 @@ struct damon_sysfs_stats { static struct damon_sysfs_stats *damon_sysfs_stats_alloc(void) { - return kzalloc_obj(struct damon_sysfs_stats, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_stats); } static ssize_t nr_tried_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -376,7 +376,7 @@ static struct damon_sysfs_scheme_filter *damon_sysfs_scheme_filter_alloc( { struct damon_sysfs_scheme_filter *filter; - filter = kzalloc_obj(struct damon_sysfs_scheme_filter, GFP_KERNEL); + filter = kzalloc_obj(struct damon_sysfs_scheme_filter); if (filter) filter->handle_layer = layer; return filter; @@ -724,7 +724,7 @@ damon_sysfs_scheme_filters_alloc(enum damos_sysfs_filter_handle_layer layer) { struct damon_sysfs_scheme_filters *filters; - filters = kzalloc_obj(struct damon_sysfs_scheme_filters, GFP_KERNEL); + filters = kzalloc_obj(struct damon_sysfs_scheme_filters); if (filters) filters->handle_layer = layer; return filters; @@ -1045,7 +1045,7 @@ struct damos_sysfs_quota_goal { static struct damos_sysfs_quota_goal *damos_sysfs_quota_goal_alloc(void) { - return kzalloc_obj(struct damos_sysfs_quota_goal, GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_quota_goal); } struct damos_sysfs_qgoal_metric_name { @@ -1263,7 +1263,7 @@ struct damos_sysfs_quota_goals { static struct damos_sysfs_quota_goals *damos_sysfs_quota_goals_alloc(void) { - return kzalloc_obj(struct damos_sysfs_quota_goals, GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_quota_goals); } static void damos_sysfs_quota_goals_rm_dirs( @@ -1383,7 +1383,7 @@ struct damon_sysfs_weights { static struct damon_sysfs_weights *damon_sysfs_weights_alloc(unsigned int sz, unsigned int nr_accesses, unsigned int age) { - struct damon_sysfs_weights *weights = kmalloc_obj(*weights, GFP_KERNEL); + struct damon_sysfs_weights *weights = kmalloc_obj(*weights); if (!weights) return NULL; @@ -1495,7 +1495,7 @@ struct damon_sysfs_quotas { static struct damon_sysfs_quotas *damon_sysfs_quotas_alloc(void) { - return kzalloc_obj(struct damon_sysfs_quotas, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_quotas); } static int damon_sysfs_quotas_add_dirs(struct damon_sysfs_quotas *quotas) @@ -1756,7 +1756,7 @@ struct damos_sysfs_dest { static struct damos_sysfs_dest *damos_sysfs_dest_alloc(void) { - return kzalloc_obj(struct damos_sysfs_dest, GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_dest); } static ssize_t id_show( @@ -1836,7 +1836,7 @@ struct damos_sysfs_dests { static struct damos_sysfs_dests * damos_sysfs_dests_alloc(void) { - return kzalloc_obj(struct damos_sysfs_dests, GFP_KERNEL); + return kzalloc_obj(struct damos_sysfs_dests); } static void damos_sysfs_dests_rm_dirs( @@ -2013,7 +2013,7 @@ static struct damos_sysfs_action_name damos_sysfs_action_names[] = { static struct damon_sysfs_scheme *damon_sysfs_scheme_alloc( enum damos_action action, unsigned long apply_interval_us) { - struct damon_sysfs_scheme *scheme = kmalloc_obj(*scheme, GFP_KERNEL); + struct damon_sysfs_scheme *scheme = kmalloc_obj(*scheme); if (!scheme) return NULL; @@ -2374,7 +2374,7 @@ static const struct kobj_type damon_sysfs_scheme_ktype = { struct damon_sysfs_schemes *damon_sysfs_schemes_alloc(void) { - return kzalloc_obj(struct damon_sysfs_schemes, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_schemes); } void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 9561ad8b7852..f2e7551eea3f 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -22,7 +22,7 @@ struct damon_sysfs_region { static struct damon_sysfs_region *damon_sysfs_region_alloc(void) { - return kzalloc_obj(struct damon_sysfs_region, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_region); } static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, @@ -99,7 +99,7 @@ struct damon_sysfs_regions { static struct damon_sysfs_regions *damon_sysfs_regions_alloc(void) { - return kzalloc_obj(struct damon_sysfs_regions, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_regions); } static void damon_sysfs_regions_rm_dirs(struct damon_sysfs_regions *regions) @@ -217,7 +217,7 @@ struct damon_sysfs_target { static struct damon_sysfs_target *damon_sysfs_target_alloc(void) { - return kzalloc_obj(struct damon_sysfs_target, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_target); } static int damon_sysfs_target_add_dirs(struct damon_sysfs_target *target) @@ -323,7 +323,7 @@ struct damon_sysfs_targets { static struct damon_sysfs_targets *damon_sysfs_targets_alloc(void) { - return kzalloc_obj(struct damon_sysfs_targets, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_targets); } static void damon_sysfs_targets_rm_dirs(struct damon_sysfs_targets *targets) @@ -452,7 +452,7 @@ static struct damon_sysfs_intervals_goal *damon_sysfs_intervals_goal_alloc( unsigned long access_bp, unsigned long aggrs, unsigned long min_sample_us, unsigned long max_sample_us) { - struct damon_sysfs_intervals_goal *goal = kmalloc_obj(*goal, GFP_KERNEL); + struct damon_sysfs_intervals_goal *goal = kmalloc_obj(*goal); if (!goal) return NULL; @@ -760,7 +760,7 @@ struct damon_sysfs_attrs { static struct damon_sysfs_attrs *damon_sysfs_attrs_alloc(void) { - struct damon_sysfs_attrs *attrs = kmalloc_obj(*attrs, GFP_KERNEL); + struct damon_sysfs_attrs *attrs = kmalloc_obj(*attrs); if (!attrs) return NULL; @@ -872,7 +872,7 @@ struct damon_sysfs_context { static struct damon_sysfs_context *damon_sysfs_context_alloc( enum damon_ops_id ops_id) { - struct damon_sysfs_context *context = kmalloc_obj(*context, GFP_KERNEL); + struct damon_sysfs_context *context = kmalloc_obj(*context); if (!context) return NULL; @@ -1094,7 +1094,7 @@ struct damon_sysfs_contexts { static struct damon_sysfs_contexts *damon_sysfs_contexts_alloc(void) { - return kzalloc_obj(struct damon_sysfs_contexts, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_contexts); } static void damon_sysfs_contexts_rm_dirs(struct damon_sysfs_contexts *contexts) @@ -1221,7 +1221,7 @@ struct damon_sysfs_kdamond { static struct damon_sysfs_kdamond *damon_sysfs_kdamond_alloc(void) { - return kzalloc_obj(struct damon_sysfs_kdamond, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_kdamond); } static int damon_sysfs_kdamond_add_dirs(struct damon_sysfs_kdamond *kdamond) @@ -1642,7 +1642,7 @@ static int damon_sysfs_turn_damon_on(struct damon_sysfs_kdamond *kdamond) damon_destroy_ctx(kdamond->damon_ctx); kdamond->damon_ctx = NULL; - repeat_call_control = kmalloc_obj(*repeat_call_control, GFP_KERNEL); + repeat_call_control = kmalloc_obj(*repeat_call_control); if (!repeat_call_control) return -ENOMEM; @@ -1895,7 +1895,7 @@ struct damon_sysfs_kdamonds { static struct damon_sysfs_kdamonds *damon_sysfs_kdamonds_alloc(void) { - return kzalloc_obj(struct damon_sysfs_kdamonds, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_kdamonds); } static void damon_sysfs_kdamonds_rm_dirs(struct damon_sysfs_kdamonds *kdamonds) @@ -2036,7 +2036,7 @@ struct damon_sysfs_ui_dir { static struct damon_sysfs_ui_dir *damon_sysfs_ui_dir_alloc(void) { - return kzalloc_obj(struct damon_sysfs_ui_dir, GFP_KERNEL); + return kzalloc_obj(struct damon_sysfs_ui_dir); } static int damon_sysfs_ui_dir_add_dirs(struct damon_sysfs_ui_dir *ui_dir) diff --git a/mm/dmapool_test.c b/mm/dmapool_test.c index 454952ac9f0e..d829d99aa194 100644 --- a/mm/dmapool_test.c +++ b/mm/dmapool_test.c @@ -67,7 +67,7 @@ static int dmapool_test_block(const struct dmapool_parms *parms) struct dma_pool_pair *p; int i, ret; - p = kzalloc_objs(*p, blocks, GFP_KERNEL); + p = kzalloc_objs(*p, blocks); if (!p) return -ENOMEM; diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 809c99ee81b9..d4ca8cfd7f9d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -718,7 +718,7 @@ static struct thpsize *thpsize_create(int order, struct kobject *parent) struct thpsize *thpsize; int ret = -ENOMEM; - thpsize = kzalloc_obj(*thpsize, GFP_KERNEL); + thpsize = kzalloc_obj(*thpsize); if (!thpsize) goto err; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6793a5b07882..0beb6e22bc26 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -154,7 +154,7 @@ struct hugepage_subpool *hugepage_new_subpool(struct hstate *h, long max_hpages, { struct hugepage_subpool *spool; - spool = kzalloc_obj(*spool, GFP_KERNEL); + spool = kzalloc_obj(*spool); if (!spool) return NULL; @@ -429,7 +429,7 @@ int hugetlb_vma_lock_alloc(struct vm_area_struct *vma) if (vma->vm_private_data) return -EINVAL; - vma_lock = kmalloc_obj(*vma_lock, GFP_KERNEL); + vma_lock = kmalloc_obj(*vma_lock); if (!vma_lock) { /* * If we can not allocate structure, then vma can not @@ -687,7 +687,7 @@ static int allocate_file_region_entries(struct resv_map *resv, spin_unlock(&resv->lock); for (i = 0; i < to_allocate; i++) { - trg = kmalloc_obj(*trg, GFP_KERNEL); + trg = kmalloc_obj(*trg); if (!trg) goto out_of_memory; list_add(&trg->link, &allocated_regions); @@ -891,7 +891,7 @@ retry: if (!nrg) { spin_unlock(&resv->lock); - nrg = kmalloc_obj(*nrg, GFP_KERNEL); + nrg = kmalloc_obj(*nrg); if (!nrg) return -ENOMEM; goto retry; @@ -1105,8 +1105,8 @@ resv_map_set_hugetlb_cgroup_uncharge_info(struct resv_map *resv_map, struct resv_map *resv_map_alloc(void) { - struct resv_map *resv_map = kmalloc_obj(*resv_map, GFP_KERNEL); - struct file_region *rg = kmalloc_obj(*rg, GFP_KERNEL); + struct resv_map *resv_map = kmalloc_obj(*resv_map); + struct file_region *rg = kmalloc_obj(*rg); if (!resv_map || !rg) { kfree(resv_map); @@ -4190,7 +4190,7 @@ static int __init hugetlb_init(void) num_fault_mutexes = 1; #endif hugetlb_fault_mutex_table = - kmalloc_objs(struct mutex, num_fault_mutexes, GFP_KERNEL); + kmalloc_objs(struct mutex, num_fault_mutexes); BUG_ON(!hugetlb_fault_mutex_table); for (i = 0; i < num_fault_mutexes; i++) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index 6e4706d6ee82..12239d5fd042 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -856,10 +856,10 @@ static void __init __hugetlb_cgroup_file_pre_init(void) int cft_count; cft_count = hugetlb_max_hstate * DFL_TMPL_SIZE + 1; /* add terminator */ - dfl_files = kzalloc_objs(struct cftype, cft_count, GFP_KERNEL); + dfl_files = kzalloc_objs(struct cftype, cft_count); BUG_ON(!dfl_files); cft_count = hugetlb_max_hstate * LEGACY_TMPL_SIZE + 1; /* add terminator */ - legacy_files = kzalloc_objs(struct cftype, cft_count, GFP_KERNEL); + legacy_files = kzalloc_objs(struct cftype, cft_count); BUG_ON(!legacy_files); } diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index cb9c95ed7821..32d06cbf6a31 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -511,7 +511,7 @@ static void kmalloc_oob_16(struct kunit *test) ptr1 = RELOC_HIDE(kmalloc(sizeof(*ptr1) - 3, GFP_KERNEL), 0); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr1); - ptr2 = kmalloc_obj(*ptr2, GFP_KERNEL); + ptr2 = kmalloc_obj(*ptr2); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr2); OPTIMIZER_HIDE_VAR(ptr1); @@ -529,10 +529,10 @@ static void kmalloc_uaf_16(struct kunit *test) KASAN_TEST_NEEDS_CHECKED_MEMINTRINSICS(test); - ptr1 = kmalloc_obj(*ptr1, GFP_KERNEL); + ptr1 = kmalloc_obj(*ptr1); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr1); - ptr2 = kmalloc_obj(*ptr2, GFP_KERNEL); + ptr2 = kmalloc_obj(*ptr2); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr2); kfree(ptr2); @@ -859,7 +859,7 @@ static void kasan_atomics(struct kunit *test) */ a1 = kzalloc(48, GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, a1); - a2 = kzalloc_obj(atomic_long_t, GFP_KERNEL); + a2 = kzalloc_obj(atomic_long_t); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, a2); /* Use atomics to access the redzone. */ @@ -954,7 +954,7 @@ static void rcu_uaf(struct kunit *test) { struct kasan_rcu_info *ptr; - ptr = kmalloc_obj(struct kasan_rcu_info, GFP_KERNEL); + ptr = kmalloc_obj(struct kasan_rcu_info); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); global_rcu_ptr = rcu_dereference_protected( @@ -978,7 +978,7 @@ static void workqueue_uaf(struct kunit *test) workqueue = create_workqueue("kasan_workqueue_test"); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, workqueue); - work = kmalloc_obj(struct work_struct, GFP_KERNEL); + work = kmalloc_obj(struct work_struct); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, work); INIT_WORK(work, workqueue_uaf_work); diff --git a/mm/khugepaged.c b/mm/khugepaged.c index f2f95b32317c..1dd3cfca610d 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2769,7 +2769,7 @@ int madvise_collapse(struct vm_area_struct *vma, unsigned long start, if (!thp_vma_allowable_order(vma, vma->vm_flags, TVA_FORCED_COLLAPSE, PMD_ORDER)) return -EINVAL; - cc = kmalloc_obj(*cc, GFP_KERNEL); + cc = kmalloc_obj(*cc); if (!cc) return -ENOMEM; cc->is_khugepaged = false; diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c index 27cc936176ea..31f47cc4dab4 100644 --- a/mm/kmsan/kmsan_test.c +++ b/mm/kmsan/kmsan_test.c @@ -168,7 +168,7 @@ static void test_uninit_kmalloc(struct kunit *test) int *ptr; kunit_info(test, "uninitialized kmalloc test (UMR report)\n"); - ptr = kmalloc_obj(*ptr, GFP_KERNEL); + ptr = kmalloc_obj(*ptr); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); } @@ -182,7 +182,7 @@ static void test_init_kmalloc(struct kunit *test) int *ptr; kunit_info(test, "initialized kmalloc test (no reports)\n"); - ptr = kmalloc_obj(*ptr, GFP_KERNEL); + ptr = kmalloc_obj(*ptr); memset(ptr, 0, sizeof(*ptr)); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); @@ -195,7 +195,7 @@ static void test_init_kzalloc(struct kunit *test) int *ptr; kunit_info(test, "initialized kzalloc test (no reports)\n"); - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); USE(*ptr); KUNIT_EXPECT_TRUE(test, report_matches(&expect)); } @@ -322,7 +322,7 @@ static void test_init_kmsan_vmap_vunmap(struct kunit *test) kunit_info(test, "pages initialized via vmap (no reports)\n"); - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); for (int i = 0; i < npages; i++) pages[i] = alloc_page(GFP_KERNEL); vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL); diff --git a/mm/list_lru.c b/mm/list_lru.c index 16526b9d71b5..26463ae29c64 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -585,7 +585,7 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, struct shrinker *shr memcg_aware = false; #endif - lru->node = kzalloc_objs(*lru->node, nr_node_ids, GFP_KERNEL); + lru->node = kzalloc_objs(*lru->node, nr_node_ids); if (!lru->node) return -ENOMEM; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 63773a0b91f7..a52da3a5e4fd 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -192,7 +192,7 @@ static struct obj_cgroup *obj_cgroup_alloc(void) struct obj_cgroup *objcg; int ret; - objcg = kzalloc_obj(struct obj_cgroup, GFP_KERNEL); + objcg = kzalloc_obj(struct obj_cgroup); if (!objcg) return NULL; diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index c69774c19c88..5c17da3880c5 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -112,7 +112,7 @@ static int memfd_luo_preserve_folios(struct file *file, * up being smaller if there are higher order folios. */ max_folios = PAGE_ALIGN(size) / PAGE_SIZE; - folios = kvmalloc_objs(*folios, max_folios, GFP_KERNEL); + folios = kvmalloc_objs(*folios, max_folios); if (!folios) return -ENOMEM; diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index b05c916fa5f4..631df0614331 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -227,7 +227,7 @@ static struct memory_tier *find_create_memory_tier(struct memory_dev_type *memty } } - new_memtier = kzalloc_obj(struct memory_tier, GFP_KERNEL); + new_memtier = kzalloc_obj(struct memory_tier); if (!new_memtier) return ERR_PTR(-ENOMEM); @@ -625,7 +625,7 @@ struct memory_dev_type *alloc_memory_type(int adistance) { struct memory_dev_type *memtype; - memtype = kmalloc_obj(*memtype, GFP_KERNEL); + memtype = kmalloc_obj(*memtype); if (!memtype) return ERR_PTR(-ENOMEM); diff --git a/mm/memory.c b/mm/memory.c index 144e30d2825f..07778814b4a8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3035,7 +3035,7 @@ static inline struct pfnmap_track_ctx *pfnmap_track_ctx_alloc(unsigned long pfn, if (pfnmap_track(pfn, size, prot)) return ERR_PTR(-EINVAL); - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (unlikely(!ctx)) { pfnmap_untrack(pfn, size); return ERR_PTR(-ENOMEM); diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0835743f6575..3b2d6b77a383 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -3815,7 +3815,7 @@ static int sysfs_wi_node_add(int nid) return -EINVAL; } - new_attr = kzalloc_obj(*new_attr, GFP_KERNEL); + new_attr = kzalloc_obj(*new_attr); if (!new_attr) return -ENOMEM; diff --git a/mm/mempool.c b/mm/mempool.c index c22c63ccbbcd..db23e0eef652 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -371,7 +371,7 @@ int mempool_resize(struct mempool *pool, int new_min_nr) spin_unlock_irqrestore(&pool->lock, flags); /* Grow the pool */ - new_elements = kmalloc_objs(*new_elements, new_min_nr, GFP_KERNEL); + new_elements = kmalloc_objs(*new_elements, new_min_nr); if (!new_elements) return -ENOMEM; diff --git a/mm/page_reporting.c b/mm/page_reporting.c index 7323284d2f7d..f0042d5743af 100644 --- a/mm/page_reporting.c +++ b/mm/page_reporting.c @@ -322,7 +322,7 @@ static void page_reporting_process(struct work_struct *work) atomic_set(&prdev->state, state); /* allocate scatterlist to store pages being reported on */ - sgl = kmalloc_objs(*sgl, PAGE_REPORTING_CAPACITY, GFP_KERNEL); + sgl = kmalloc_objs(*sgl, PAGE_REPORTING_CAPACITY); if (!sgl) goto err_out; diff --git a/mm/shmem.c b/mm/shmem.c index 5f2e8e3d5b75..b40f3cd48961 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -5328,7 +5328,7 @@ int shmem_init_fs_context(struct fs_context *fc) { struct shmem_options *ctx; - ctx = kzalloc_obj(struct shmem_options, GFP_KERNEL); + ctx = kzalloc_obj(struct shmem_options); if (!ctx) return -ENOMEM; diff --git a/mm/shrinker.c b/mm/shrinker.c index 52e7bebe4579..7b61fc0ee78f 100644 --- a/mm/shrinker.c +++ b/mm/shrinker.c @@ -682,7 +682,7 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...) va_list ap; int err; - shrinker = kzalloc_obj(struct shrinker, GFP_KERNEL); + shrinker = kzalloc_obj(struct shrinker); if (!shrinker) return NULL; diff --git a/mm/slub.c b/mm/slub.c index b8e9c0b62435..862642c165ed 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -9139,7 +9139,7 @@ static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si) unsigned long sum = 0; int cpu; int len = 0; - int *data = kmalloc_objs(int, nr_cpu_ids, GFP_KERNEL); + int *data = kmalloc_objs(int, nr_cpu_ids); if (!data) return -ENOMEM; @@ -9510,7 +9510,7 @@ int sysfs_slab_alias(struct kmem_cache *s, const char *name) return sysfs_create_link(&slab_kset->kobj, &s->kobj, name); } - al = kmalloc_obj(struct saved_alias, GFP_KERNEL); + al = kmalloc_obj(struct saved_alias); if (!al) return -ENOMEM; diff --git a/mm/swapfile.c b/mm/swapfile.c index 8a1e2af356ba..a94aa1054fd8 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2575,7 +2575,7 @@ add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, } /* No merge, insert a new extent. */ - new_se = kmalloc_obj(*se, GFP_KERNEL); + new_se = kmalloc_obj(*se); if (new_se == NULL) return -ENOMEM; new_se->start_page = start_page; @@ -3048,7 +3048,7 @@ static struct swap_info_struct *alloc_swap_info(void) struct swap_info_struct *defer = NULL; unsigned int type; - p = kvzalloc_obj(struct swap_info_struct, GFP_KERNEL); + p = kvzalloc_obj(struct swap_info_struct); if (!p) return ERR_PTR(-ENOMEM); @@ -3257,7 +3257,7 @@ static struct swap_cluster_info *setup_clusters(struct swap_info_struct *si, int err = -ENOMEM; unsigned long i; - cluster_info = kvzalloc_objs(*cluster_info, nr_clusters, GFP_KERNEL); + cluster_info = kvzalloc_objs(*cluster_info, nr_clusters); if (!cluster_info) goto err; diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 672c56d8bfe1..61caa55a4402 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4920,14 +4920,14 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, return NULL; } - vms = kzalloc_objs(vms[0], nr_vms, GFP_KERNEL); - vas = kzalloc_objs(vas[0], nr_vms, GFP_KERNEL); + vms = kzalloc_objs(vms[0], nr_vms); + vas = kzalloc_objs(vas[0], nr_vms); if (!vas || !vms) goto err_free2; for (area = 0; area < nr_vms; area++) { vas[area] = kmem_cache_zalloc(vmap_area_cachep, GFP_KERNEL); - vms[area] = kzalloc_obj(struct vm_struct, GFP_KERNEL); + vms[area] = kzalloc_obj(struct vm_struct); if (!vas[area] || !vms[area]) goto err_free; } diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 035e0384e39b..3fbb86996c4d 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -402,7 +402,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, mode = ret; } - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) { ret = -ENOMEM; goto out; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fa0b726dcec7..2c1430bf8d57 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2062,7 +2062,7 @@ struct zs_pool *zs_create_pool(const char *name) struct zs_pool *pool; struct size_class *prev_class = NULL; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -2128,7 +2128,7 @@ struct zs_pool *zs_create_pool(const char *name) } } - class = kzalloc_obj(struct size_class, GFP_KERNEL); + class = kzalloc_obj(struct size_class); if (!class) goto err; diff --git a/mm/zswap.c b/mm/zswap.c index bbfd8a51e4c8..e6ec3295bdb0 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -251,7 +251,7 @@ static struct zswap_pool *zswap_pool_create(char *compressor) if (!zswap_has_pool && !strcmp(compressor, ZSWAP_PARAM_UNSET)) return NULL; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; @@ -1665,7 +1665,7 @@ int zswap_swapon(int type, unsigned long nr_pages) unsigned int nr, i; nr = DIV_ROUND_UP(nr_pages, ZSWAP_ADDRESS_SPACE_PAGES); - trees = kvzalloc_objs(*tree, nr, GFP_KERNEL); + trees = kvzalloc_objs(*tree, nr); if (!trees) { pr_err("alloc failed, zswap disabled for swap type %d\n", type); return -ENOMEM; diff --git a/net/802/garp.c b/net/802/garp.c index ceeb5f5fac02..6f563b6797d9 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -547,7 +547,7 @@ static int garp_init_port(struct net_device *dev) { struct garp_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; rcu_assign_pointer(dev->garp_port, port); @@ -581,7 +581,7 @@ int garp_init_applicant(struct net_device *dev, struct garp_application *appl) } err = -ENOMEM; - app = kzalloc_obj(*app, GFP_KERNEL); + app = kzalloc_obj(*app); if (!app) goto err2; diff --git a/net/802/mrp.c b/net/802/mrp.c index f65c95d43a4e..ff0e80574e6b 100644 --- a/net/802/mrp.c +++ b/net/802/mrp.c @@ -832,7 +832,7 @@ static int mrp_init_port(struct net_device *dev) { struct mrp_port *port; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; rcu_assign_pointer(dev->mrp_port, port); @@ -866,7 +866,7 @@ int mrp_init_applicant(struct net_device *dev, struct mrp_application *appl) } err = -ENOMEM; - app = kzalloc_obj(*app, GFP_KERNEL); + app = kzalloc_obj(*app); if (!app) goto err2; diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index d7849667ddf0..d23965e76c16 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -150,7 +150,7 @@ static struct vlan_info *vlan_info_alloc(struct net_device *dev) { struct vlan_info *vlan_info; - vlan_info = kzalloc_obj(struct vlan_info, GFP_KERNEL); + vlan_info = kzalloc_obj(struct vlan_info); if (!vlan_info) return NULL; @@ -193,7 +193,7 @@ static struct vlan_vid_info *vlan_vid_info_alloc(__be16 proto, u16 vid) { struct vlan_vid_info *vid_info; - vid_info = kzalloc_obj(struct vlan_vid_info, GFP_KERNEL); + vid_info = kzalloc_obj(struct vlan_vid_info); if (!vid_info) return NULL; vid_info->proto = proto; diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 176912c62915..c40f7d5c4fca 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -192,7 +192,7 @@ int vlan_dev_set_egress_priority(const struct net_device *dev, /* Create a new mapping then. */ mp = vlan->egress_priority_map[skb_prio & 0xF]; - np = kmalloc_obj(struct vlan_priority_tci_mapping, GFP_KERNEL); + np = kmalloc_obj(struct vlan_priority_tci_mapping); if (!np) return -ENOBUFS; @@ -708,7 +708,7 @@ static int vlan_dev_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err = 0; - netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll); err = -ENOMEM; if (!netpoll) goto out; diff --git a/net/9p/client.c b/net/9p/client.c index 3e8de85c7f7f..f0dcf252af7e 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -730,7 +730,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) struct p9_fid *fid; p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt); - fid = kzalloc_obj(*fid, GFP_KERNEL); + fid = kzalloc_obj(*fid); if (!fid) return NULL; @@ -859,7 +859,7 @@ struct p9_client *p9_client_create(struct fs_context *fc) char *client_id; char *cache_name; - clnt = kmalloc_obj(*clnt, GFP_KERNEL); + clnt = kmalloc_obj(*clnt); if (!clnt) return ERR_PTR(-ENOMEM); @@ -1615,7 +1615,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid) p9_debug(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid); - ret = kmalloc_obj(*ret, GFP_KERNEL); + ret = kmalloc_obj(*ret); if (!ret) return ERR_PTR(-ENOMEM); @@ -1667,7 +1667,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid, p9_debug(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n", fid->fid, request_mask); - ret = kmalloc_obj(*ret, GFP_KERNEL); + ret = kmalloc_obj(*ret); if (!ret) return ERR_PTR(-ENOMEM); diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 4e0f4a382ac4..dbad3213ba84 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -719,7 +719,7 @@ static int p9_fd_show_options(struct seq_file *m, struct p9_client *clnt) static int p9_fd_open(struct p9_client *client, int rfd, int wfd) { - struct p9_trans_fd *ts = kzalloc_obj(struct p9_trans_fd, GFP_KERNEL); + struct p9_trans_fd *ts = kzalloc_obj(struct p9_trans_fd); if (!ts) return -ENOMEM; @@ -763,7 +763,7 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket) struct p9_trans_fd *p; struct file *file; - p = kzalloc_obj(struct p9_trans_fd, GFP_KERNEL); + p = kzalloc_obj(struct p9_trans_fd); if (!p) { sock_release(csocket); return -ENOMEM; diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index c8e27c08a3a2..aa5bd74d333f 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -460,7 +460,7 @@ static struct p9_trans_rdma *alloc_rdma(struct p9_rdma_opts *opts) { struct p9_trans_rdma *rdma; - rdma = kzalloc_obj(struct p9_trans_rdma, GFP_KERNEL); + rdma = kzalloc_obj(struct p9_trans_rdma); if (!rdma) return NULL; diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c index e167f9f23d65..1ce70338999c 100644 --- a/net/9p/trans_usbg.c +++ b/net/9p/trans_usbg.c @@ -757,7 +757,7 @@ static struct usb_function *usb9pfs_alloc(struct usb_function_instance *fi) struct f_usb9pfs_opts *usb9pfs_opts; struct f_usb9pfs *usb9pfs; - usb9pfs = kzalloc_obj(*usb9pfs, GFP_KERNEL); + usb9pfs = kzalloc_obj(*usb9pfs); if (!usb9pfs) return ERR_PTR(-ENOMEM); @@ -910,7 +910,7 @@ static struct usb_function_instance *usb9pfs_alloc_instance(void) struct f_usb9pfs_opts *usb9pfs_opts; struct f_usb9pfs_dev *dev; - usb9pfs_opts = kzalloc_obj(*usb9pfs_opts, GFP_KERNEL); + usb9pfs_opts = kzalloc_obj(*usb9pfs_opts); if (!usb9pfs_opts) return ERR_PTR(-ENOMEM); @@ -921,7 +921,7 @@ static struct usb_function_instance *usb9pfs_alloc_instance(void) usb9pfs_opts->buflen = DEFAULT_BUFLEN; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { kfree(usb9pfs_opts); return ERR_PTR(-ENOMEM); diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 0577bdcb67bf..4cdab7094b27 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -601,7 +601,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) return -EINVAL; } - chan = kmalloc_obj(struct virtio_chan, GFP_KERNEL); + chan = kmalloc_obj(struct virtio_chan); if (!chan) { pr_err("Failed to allocate virtio 9P channel\n"); err = -ENOMEM; @@ -641,7 +641,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) if (err) { goto out_free_tag; } - chan->vc_wq = kmalloc_obj(wait_queue_head_t, GFP_KERNEL); + chan->vc_wq = kmalloc_obj(wait_queue_head_t); if (!chan->vc_wq) { err = -ENOMEM; goto out_remove_file; diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index fd6ac8658549..47af5a10e921 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -417,11 +417,11 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) if (p9_xen_trans.maxsize > XEN_FLEX_RING_SIZE(max_ring_order)) p9_xen_trans.maxsize = XEN_FLEX_RING_SIZE(max_ring_order) / 2; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; priv->dev = dev; - priv->rings = kzalloc_objs(*priv->rings, XEN_9PFS_NUM_RINGS, GFP_KERNEL); + priv->rings = kzalloc_objs(*priv->rings, XEN_9PFS_NUM_RINGS); if (!priv->rings) { kfree(priv); return -ENOMEM; diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 53c613e36245..30a6dc06291c 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -233,7 +233,7 @@ static void atif_drop_device(struct net_device *dev) static struct atalk_iface *atif_add_device(struct net_device *dev, struct atalk_addr *sa) { - struct atalk_iface *iface = kzalloc_obj(*iface, GFP_KERNEL); + struct atalk_iface *iface = kzalloc_obj(*iface); if (!iface) goto out; diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 8fdc25271708..6580d67c3456 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -538,7 +538,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg) if (copy_from_user(&be, arg, sizeof be)) return -EFAULT; - brvcc = kzalloc_obj(struct br2684_vcc, GFP_KERNEL); + brvcc = kzalloc_obj(struct br2684_vcc); if (!brvcc) return -ENOMEM; /* diff --git a/net/atm/clip.c b/net/atm/clip.c index 40553fcab389..516b2214680b 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c @@ -431,7 +431,7 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout) return -EBADFD; if (vcc->user_back) return -EINVAL; - clip_vcc = kmalloc_obj(struct clip_vcc, GFP_KERNEL); + clip_vcc = kmalloc_obj(struct clip_vcc); if (!clip_vcc) return -ENOMEM; pr_debug("%p vcc %p\n", clip_vcc, vcc); diff --git a/net/atm/lec.c b/net/atm/lec.c index cba26158c4ad..a107375c0629 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -696,7 +696,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg) ioc_data.dev_num = array_index_nospec(ioc_data.dev_num, MAX_LEC_ITF); if (!dev_lec[ioc_data.dev_num]) return -EINVAL; - vpriv = kmalloc_obj(struct lec_vcc_priv, GFP_KERNEL); + vpriv = kmalloc_obj(struct lec_vcc_priv); if (!vpriv) return -ENOMEM; vpriv->xoff = 0; @@ -2125,7 +2125,7 @@ static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) struct lec_vcc_priv *vpriv; int err = 0; - vpriv = kmalloc_obj(struct lec_vcc_priv, GFP_KERNEL); + vpriv = kmalloc_obj(struct lec_vcc_priv); if (!vpriv) return -ENOMEM; vpriv->xoff = 0; diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 3e2b13734fc4..ce8e9780373b 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c @@ -184,7 +184,7 @@ struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos) return entry; } - entry = kmalloc_obj(struct atm_mpoa_qos, GFP_KERNEL); + entry = kmalloc_obj(struct atm_mpoa_qos); if (entry == NULL) { pr_info("mpoa: out of memory\n"); return entry; @@ -282,7 +282,7 @@ static struct mpoa_client *alloc_mpc(void) { struct mpoa_client *mpc; - mpc = kzalloc_obj(struct mpoa_client, GFP_KERNEL); + mpc = kzalloc_obj(struct mpoa_client); if (mpc == NULL) return NULL; rwlock_init(&mpc->ingress_lock); diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index b584ab72ed2f..c8d4e6f2e831 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm/mpoa_caches.c @@ -97,7 +97,7 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc, static in_cache_entry *in_cache_add_entry(__be32 dst_ip, struct mpoa_client *client) { - in_cache_entry *entry = kzalloc_obj(in_cache_entry, GFP_KERNEL); + in_cache_entry *entry = kzalloc_obj(in_cache_entry); if (entry == NULL) { pr_info("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n"); @@ -456,7 +456,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry, static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_client *client) { - eg_cache_entry *entry = kzalloc_obj(eg_cache_entry, GFP_KERNEL); + eg_cache_entry *entry = kzalloc_obj(eg_cache_entry); if (entry == NULL) { pr_info("out of memory\n"); diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 133b0cda7063..2574aae3e066 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c @@ -397,7 +397,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg) if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) return -EINVAL; - pvcc = kzalloc_obj(*pvcc, GFP_KERNEL); + pvcc = kzalloc_obj(*pvcc); if (pvcc == NULL) return -ENOMEM; pvcc->atmvcc = atmvcc; diff --git a/net/atm/resources.c b/net/atm/resources.c index 9849521feaf3..939452a610c0 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c @@ -36,7 +36,7 @@ static struct atm_dev *__alloc_atm_dev(const char *type) { struct atm_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; dev->type = type; diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 855ae9df824d..a76f4793aed2 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1249,7 +1249,7 @@ static int __must_check ax25_connect(struct socket *sock, goto out_release; } - if ((digi = kmalloc_obj(ax25_digi, GFP_KERNEL)) == NULL) { + if ((digi = kmalloc_obj(ax25_digi)) == NULL) { err = -ENOBUFS; goto out_release; } diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c index 56f605ddd88d..3c0544fc4ad5 100644 --- a/net/ax25/ax25_dev.c +++ b/net/ax25/ax25_dev.c @@ -54,7 +54,7 @@ void ax25_dev_device_up(struct net_device *dev) { ax25_dev *ax25_dev; - ax25_dev = kzalloc_obj(*ax25_dev, GFP_KERNEL); + ax25_dev = kzalloc_obj(*ax25_dev); if (!ax25_dev) { printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n"); return; diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 95c5915f1ab9..159ce74273f0 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c @@ -101,7 +101,7 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) } if (sax->sax25_uid == 0) return -EINVAL; - if ((ax25_uid = kmalloc_obj(*ax25_uid, GFP_KERNEL)) == NULL) + if ((ax25_uid = kmalloc_obj(*ax25_uid)) == NULL) return -ENOMEM; refcount_set(&ax25_uid->refcount, 1); diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index acaf7c9e4a69..2f03b780b40d 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -1107,7 +1107,7 @@ static int lowpan_enable_set(void *data, u64 val) { struct set_enable *set_enable; - set_enable = kzalloc_obj(*set_enable, GFP_KERNEL); + set_enable = kzalloc_obj(*set_enable); if (!set_enable) return -ENOMEM; diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c index df4edd43176e..b95413bffa16 100644 --- a/net/bluetooth/cmtp/capi.c +++ b/net/bluetooth/cmtp/capi.c @@ -72,7 +72,7 @@ static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl) { - struct cmtp_application *app = kzalloc_obj(*app, GFP_KERNEL); + struct cmtp_application *app = kzalloc_obj(*app); BT_DBG("session %p application %p appl %u", session, app, appl); diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index ebfa049598dc..261aeeda3236 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c @@ -341,7 +341,7 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) if (req->flags & ~valid_flags) return -EINVAL; - session = kzalloc_obj(struct cmtp_session, GFP_KERNEL); + session = kzalloc_obj(struct cmtp_session); if (!session) return -ENOMEM; diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 02d33fe11042..4719dac07190 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -462,7 +462,7 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) struct conn_handle_t *conn_handle; if (enhanced_sync_conn_capable(conn->hdev)) { - conn_handle = kzalloc_obj(*conn_handle, GFP_KERNEL); + conn_handle = kzalloc_obj(*conn_handle); if (!conn_handle) return false; @@ -726,7 +726,7 @@ static int hci_le_terminate_big(struct hci_dev *hdev, struct hci_conn *conn) bt_dev_dbg(hdev, "big 0x%2.2x bis 0x%2.2x", conn->iso_qos.bcast.big, conn->iso_qos.bcast.bis); - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) return -ENOMEM; @@ -777,7 +777,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn) bt_dev_dbg(hdev, "hcon %p big 0x%2.2x sync_handle 0x%4.4x", conn, conn->iso_qos.bcast.big, conn->sync_handle); - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (!d) return -ENOMEM; @@ -960,7 +960,7 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bt_dev_dbg(hdev, "dst %pMR handle 0x%4.4x", dst, handle); - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) return ERR_PTR(-ENOMEM); @@ -1739,7 +1739,7 @@ static struct hci_link *hci_conn_link(struct hci_conn *parent, if (conn->parent) return NULL; - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) return NULL; @@ -2781,7 +2781,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn) return NULL; } - chan = kzalloc_obj(*chan, GFP_KERNEL); + chan = kzalloc_obj(*chan); if (!chan) return NULL; diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a0cad792be0b..7094f80de24e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -262,7 +262,7 @@ u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, } /* Entry not in the cache. Add new one. */ - ie = kzalloc_obj(*ie, GFP_KERNEL); + ie = kzalloc_obj(*ie); if (!ie) { flags |= MGMT_DEV_FOUND_CONFIRM_NAME; goto done; @@ -1286,7 +1286,7 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, key = old_key; } else { old_key_type = conn ? conn->key_type : 0xff; - key = kzalloc_obj(*key, GFP_KERNEL); + key = kzalloc_obj(*key); if (!key) return NULL; list_add_rcu(&key->list, &hdev->link_keys); @@ -1331,7 +1331,7 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, if (old_key) key = old_key; else { - key = kzalloc_obj(*key, GFP_KERNEL); + key = kzalloc_obj(*key); if (!key) return NULL; list_add_rcu(&key->list, &hdev->long_term_keys); @@ -1356,7 +1356,7 @@ struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type); if (!irk) { - irk = kzalloc_obj(*irk, GFP_KERNEL); + irk = kzalloc_obj(*irk); if (!irk) return NULL; @@ -1550,7 +1550,7 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, data = hci_find_remote_oob_data(hdev, bdaddr, bdaddr_type); if (!data) { - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; @@ -1718,7 +1718,7 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance, instance < 1 || instance > hdev->le_num_of_adv_sets + 1) return ERR_PTR(-EOVERFLOW); - adv = kzalloc_obj(*adv, GFP_KERNEL); + adv = kzalloc_obj(*adv); if (!adv) return ERR_PTR(-ENOMEM); @@ -2107,7 +2107,7 @@ int hci_bdaddr_list_add(struct list_head *list, bdaddr_t *bdaddr, u8 type) if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -2130,7 +2130,7 @@ int hci_bdaddr_list_add_with_irk(struct list_head *list, bdaddr_t *bdaddr, if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -2159,7 +2159,7 @@ int hci_bdaddr_list_add_with_flags(struct list_head *list, bdaddr_t *bdaddr, if (hci_bdaddr_list_lookup(list, bdaddr, type)) return -EEXIST; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -2276,7 +2276,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, if (params) return params; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) { bt_dev_err(hdev, "out of memory"); return NULL; diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index ed5db3eb3df3..44c205ff9fa8 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -711,7 +711,7 @@ int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func, goto unlock; } - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto unlock; @@ -2685,7 +2685,7 @@ static struct conn_params *conn_params_copy(struct list_head *list, size_t *n) rcu_read_unlock(); - p = kvzalloc_objs(struct conn_params, *n, GFP_KERNEL); + p = kvzalloc_objs(struct conn_params, *n); if (!p) return NULL; @@ -7341,7 +7341,7 @@ int hci_past_sync(struct hci_conn *conn, struct hci_conn *le) if (!past_sender_capable(conn->hdev)) return -EOPNOTSUPP; - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; @@ -7473,7 +7473,7 @@ int hci_acl_change_pkt_type(struct hci_conn *conn, u16 pkt_type) struct hci_dev *hdev = conn->hdev; struct hci_cp_change_conn_ptype *cp; - cp = kmalloc_obj(*cp, GFP_KERNEL); + cp = kmalloc_obj(*cp); if (!cp) return -ENOMEM; @@ -7508,7 +7508,7 @@ int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys) struct hci_dev *hdev = conn->hdev; struct hci_cp_le_set_phy *cp; - cp = kmalloc_obj(*cp, GFP_KERNEL); + cp = kmalloc_obj(*cp); if (!cp) return -ENOMEM; diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index a91d5452f24a..6fe815241b01 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -920,7 +920,7 @@ static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr, ctrl = bt_sk(ctrl_sock->sk); intr = bt_sk(intr_sock->sk); - session = kzalloc_obj(*session, GFP_KERNEL); + session = kzalloc_obj(*session); if (!session) return -ENOMEM; diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 693271af6c22..ec61db89936b 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -212,7 +212,7 @@ static struct iso_conn *iso_conn_add(struct hci_conn *hcon) return conn; } - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) return NULL; diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 4804377781b6..2ad1cb4cbde7 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -6902,7 +6902,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon) if (!hchan) return NULL; - conn = kzalloc_obj(*conn, GFP_KERNEL); + conn = kzalloc_obj(*conn); if (!conn) { hci_chan_del(hchan); return NULL; diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index c9725ca3356c..1cfe03260d50 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -2767,7 +2767,7 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) goto failed; } - uuid = kmalloc_obj(*uuid, GFP_KERNEL); + uuid = kmalloc_obj(*uuid); if (!uuid) { err = -ENOMEM; goto failed; @@ -4377,7 +4377,7 @@ static int set_blocked_keys(struct sock *sk, struct hci_dev *hdev, void *data, hci_blocked_keys_clear(hdev); for (i = 0; i < key_count; ++i) { - struct blocked_key *b = kzalloc_obj(*b, GFP_KERNEL); + struct blocked_key *b = kzalloc_obj(*b); if (!b) { err = MGMT_STATUS_NO_RESOURCES; @@ -5490,7 +5490,7 @@ static u8 parse_adv_monitor_pattern(struct adv_monitor *m, u8 pattern_count, (offset + length) > HCI_MAX_AD_LENGTH) return MGMT_STATUS_INVALID_PARAMS; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return MGMT_STATUS_NO_RESOURCES; @@ -5527,7 +5527,7 @@ static int add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev, goto done; } - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (!m) { status = MGMT_STATUS_NO_RESOURCES; goto done; @@ -5564,7 +5564,7 @@ static int add_adv_patterns_monitor_rssi(struct sock *sk, struct hci_dev *hdev, goto done; } - m = kzalloc_obj(*m, GFP_KERNEL); + m = kzalloc_obj(*m); if (!m) { status = MGMT_STATUS_NO_RESOURCES; goto done; diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c index 4ed16ca8771d..4f19654d41a9 100644 --- a/net/bluetooth/mgmt_util.c +++ b/net/bluetooth/mgmt_util.c @@ -266,7 +266,7 @@ struct mgmt_pending_cmd *mgmt_pending_new(struct sock *sk, u16 opcode, { struct mgmt_pending_cmd *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return NULL; @@ -413,7 +413,7 @@ struct mgmt_mesh_tx *mgmt_mesh_add(struct sock *sk, struct hci_dev *hdev, { struct mgmt_mesh_tx *mesh_tx; - mesh_tx = kzalloc_obj(*mesh_tx, GFP_KERNEL); + mesh_tx = kzalloc_obj(*mesh_tx); if (!mesh_tx) return NULL; diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c index 25cde1ea5d23..2f008167cbaa 100644 --- a/net/bluetooth/msft.c +++ b/net/bluetooth/msft.c @@ -276,7 +276,7 @@ static int msft_le_monitor_advertisement_cb(struct hci_dev *hdev, u16 opcode, if (status) goto unlock; - handle_data = kmalloc_obj(*handle_data, GFP_KERNEL); + handle_data = kmalloc_obj(*handle_data); if (!handle_data) { status = HCI_ERROR_UNSPECIFIED; goto unlock; @@ -756,7 +756,7 @@ void msft_register(struct hci_dev *hdev) bt_dev_dbg(hdev, "Register MSFT extension"); - msft = kzalloc_obj(*msft, GFP_KERNEL); + msft = kzalloc_obj(*msft); if (!msft) { bt_dev_err(hdev, "Failed to register MSFT extension"); return; @@ -790,7 +790,7 @@ static void msft_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, { struct monitored_device *dev; - dev = kmalloc_obj(*dev, GFP_KERNEL); + dev = kmalloc_obj(*dev); if (!dev) { bt_dev_err(hdev, "MSFT vendor event %u: no memory", MSFT_EV_LE_MONITOR_DEVICE); @@ -932,7 +932,7 @@ static struct msft_monitor_addr_filter_data *msft_add_address_filter struct msft_data *msft = hdev->msft_data; int err; - address_filter = kzalloc_obj(*address_filter, GFP_KERNEL); + address_filter = kzalloc_obj(*address_filter); if (!address_filter) return NULL; diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index d7718844c520..611a9a94151e 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c @@ -680,7 +680,7 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig) /* ---- RFCOMM sessions ---- */ static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) { - struct rfcomm_session *s = kzalloc_obj(*s, GFP_KERNEL); + struct rfcomm_session *s = kzalloc_obj(*s); if (!s) return NULL; diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 4d8ab1a49e92..b65feeba1b30 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -221,7 +221,7 @@ static struct rfcomm_dev *__rfcomm_dev_add(struct rfcomm_dev_req *req, struct list_head *head = &rfcomm_dev_list; int err = 0; - dev = kzalloc_obj(struct rfcomm_dev, GFP_KERNEL); + dev = kzalloc_obj(struct rfcomm_dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 26c5c5fe7c5a..70a378ff168e 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -204,7 +204,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon) return conn; } - conn = kzalloc_obj(struct sco_conn, GFP_KERNEL); + conn = kzalloc_obj(struct sco_conn); if (!conn) return NULL; diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index e0e66dc95007..e67bf7b34ea7 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1344,7 +1344,7 @@ static void smp_distribute_keys(struct smp_chan *smp) /* Generate a new random key */ get_random_bytes(sign.csrk, sizeof(sign.csrk)); - csrk = kzalloc_obj(*csrk, GFP_KERNEL); + csrk = kzalloc_obj(*csrk); if (csrk) { if (hcon->sec_level > BT_SECURITY_MEDIUM) csrk->type = MGMT_CSRK_LOCAL_AUTHENTICATED; @@ -2664,7 +2664,7 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) skb_pull(skb, sizeof(*rp)); - csrk = kzalloc_obj(*csrk, GFP_KERNEL); + csrk = kzalloc_obj(*csrk); if (csrk) { if (conn->hcon->sec_level > BT_SECURITY_MEDIUM) csrk->type = MGMT_CSRK_REMOTE_AUTHENTICATED; @@ -3293,7 +3293,7 @@ static struct l2cap_chan *smp_add_cid(struct hci_dev *hdev, u16 cid) goto create_chan; } - smp = kzalloc_obj(*smp, GFP_KERNEL); + smp = kzalloc_obj(*smp); if (!smp) return ERR_PTR(-ENOMEM); diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c index 52117422e0f2..ae5a54c350b9 100644 --- a/net/bpf/bpf_dummy_struct_ops.c +++ b/net/bpf/bpf_dummy_struct_ops.c @@ -36,7 +36,7 @@ dummy_ops_init_args(const union bpf_attr *kattr, unsigned int nr) if (size_in != sizeof(u64) * nr) return ERR_PTR(-EINVAL); - args = kzalloc_obj(*args, GFP_KERNEL); + args = kzalloc_obj(*args); if (!args) return ERR_PTR(-ENOMEM); @@ -158,7 +158,7 @@ int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr, if (err) goto out; - tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX, GFP_KERNEL); + tlinks = kzalloc_objs(*tlinks, BPF_TRAMP_MAX); if (!tlinks) { err = -ENOMEM; goto out; diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c index a2276ce350fa..2c70fe47de38 100644 --- a/net/bridge/br_cfm.c +++ b/net/bridge/br_cfm.c @@ -547,7 +547,7 @@ int br_cfm_mep_create(struct net_bridge *br, } } - mep = kzalloc_obj(*mep, GFP_KERNEL); + mep = kzalloc_obj(*mep); if (!mep) return -ENOMEM; @@ -693,7 +693,7 @@ int br_cfm_cc_peer_mep_add(struct net_bridge *br, const u32 instance, return -EEXIST; } - peer_mep = kzalloc_obj(*peer_mep, GFP_KERNEL); + peer_mep = kzalloc_obj(*peer_mep); if (!peer_mep) return -ENOMEM; diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 1a3bcb5dd955..ee01122f466f 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -308,7 +308,7 @@ static int __br_netpoll_enable(struct net_bridge_port *p) struct netpoll *np; int err; - np = kzalloc_obj(*p->np, GFP_KERNEL); + np = kzalloc_obj(*p->np); if (!np) return -ENOMEM; diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 4737ee16bebb..d39571e13744 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -429,7 +429,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, if (index < 0) return ERR_PTR(index); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (p == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 7245ca29c5ea..766c43b327af 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c @@ -204,7 +204,7 @@ int br_dev_siocdevprivate(struct net_device *dev, struct ifreq *rq, if (num > BR_MAX_PORTS) num = BR_MAX_PORTS; - indices = kzalloc_objs(int, num, GFP_KERNEL); + indices = kzalloc_objs(int, num); if (indices == NULL) return -ENOMEM; @@ -357,7 +357,7 @@ static int old_deviceless(struct net *net, void __user *data) if (args[2] >= 2048) return -ENOMEM; - indices = kzalloc_objs(int, args[2], GFP_KERNEL); + indices = kzalloc_objs(int, args[2]); if (indices == NULL) return -ENOMEM; diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c index d587f99afef6..f1aa67f7a051 100644 --- a/net/bridge/br_mrp.c +++ b/net/bridge/br_mrp.c @@ -516,7 +516,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance) !br_mrp_unique_ifindex(br, instance->s_ifindex)) return -EINVAL; - mrp = kzalloc_obj(*mrp, GFP_KERNEL); + mrp = kzalloc_obj(*mrp); if (!mrp) return -ENOMEM; diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index e3a5eb9e6ed1..326933b455b3 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -787,7 +787,7 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags, bool *changed, return br_vlan_add_existing(br, vg, vlan, flags, changed, extack); - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return -ENOMEM; @@ -1224,7 +1224,7 @@ int br_vlan_init(struct net_bridge *br) struct net_bridge_vlan_group *vg; int ret = -ENOMEM; - vg = kzalloc_obj(*vg, GFP_KERNEL); + vg = kzalloc_obj(*vg); if (!vg) goto out; ret = rhashtable_init(&vg->vlan_hash, &br_vlan_rht_params); @@ -1260,7 +1260,7 @@ int nbp_vlan_init(struct net_bridge_port *p, struct netlink_ext_ack *extack) struct net_bridge_vlan_group *vg; int ret = -ENOMEM; - vg = kzalloc_obj(struct net_bridge_vlan_group, GFP_KERNEL); + vg = kzalloc_obj(struct net_bridge_vlan_group); if (!vg) goto out; @@ -1334,7 +1334,7 @@ int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags, return 0; } - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return -ENOMEM; diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index f01efd0b139e..aea3e19875c6 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -1303,7 +1303,7 @@ int ebt_register_template(const struct ebt_table *t, int (*table_init)(struct ne } } - tmpl = kzalloc_obj(*tmpl, GFP_KERNEL); + tmpl = kzalloc_obj(*tmpl); if (!tmpl) { mutex_unlock(&ebt_mutex); return -ENOMEM; diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 18f7769405f9..922de3d611c0 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -94,7 +94,7 @@ static struct caif_device_entry *caif_device_alloc(struct net_device *dev) { struct caif_device_entry *caifd; - caifd = kzalloc_obj(*caifd, GFP_KERNEL); + caifd = kzalloc_obj(*caifd); if (!caifd) return NULL; caifd->pcpu_refcnt = alloc_percpu(int); diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c index 566546da4152..c6cc2bfed65d 100644 --- a/net/caif/cfctrl.c +++ b/net/caif/cfctrl.c @@ -270,7 +270,7 @@ int cfctrl_linkup_request(struct cflayer *layer, cfpkt_destroy(pkt); return -EINVAL; } - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) { cfpkt_destroy(pkt); return -ENOMEM; diff --git a/net/can/af_can.c b/net/can/af_can.c index 6fa0dd649d0c..e80e516bfde9 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -802,7 +802,7 @@ static int can_pernet_init(struct net *net) GFP_KERNEL); if (!net->can.rx_alldev_list) goto out; - net->can.pkg_stats = kzalloc_obj(*net->can.pkg_stats, GFP_KERNEL); + net->can.pkg_stats = kzalloc_obj(*net->can.pkg_stats); if (!net->can.pkg_stats) goto out_free_rx_alldev_list; net->can.rcv_lists_stats = kzalloc_obj(*net->can.rcv_lists_stats, diff --git a/net/can/gw.c b/net/can/gw.c index c6cf4cb72891..8ee4d67a07d3 100644 --- a/net/can/gw.c +++ b/net/can/gw.c @@ -1099,7 +1099,7 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh, if (r->gwtype != CGW_TYPE_CAN_CAN) return -EINVAL; - mod = kmalloc_obj(*mod, GFP_KERNEL); + mod = kmalloc_obj(*mod); if (!mod) return -ENOMEM; diff --git a/net/can/j1939/main.c b/net/can/j1939/main.c index 45b718c680e0..9937c04241bc 100644 --- a/net/can/j1939/main.c +++ b/net/can/j1939/main.c @@ -128,7 +128,7 @@ static struct j1939_priv *j1939_priv_create(struct net_device *ndev) { struct j1939_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return NULL; diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 455787422784..952121849180 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -309,12 +309,12 @@ struct ceph_options *ceph_alloc_options(void) { struct ceph_options *opt; - opt = kzalloc_obj(*opt, GFP_KERNEL); + opt = kzalloc_obj(*opt); if (!opt) return NULL; opt->crush_locs = RB_ROOT; - opt->mon_addr = kzalloc_objs(*opt->mon_addr, CEPH_MAX_MON, GFP_KERNEL); + opt->mon_addr = kzalloc_objs(*opt->mon_addr, CEPH_MAX_MON); if (!opt->mon_addr) { kfree(opt); return NULL; @@ -455,7 +455,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, ceph_crypto_key_destroy(opt->key); kfree(opt->key); - opt->key = kzalloc_obj(*opt->key, GFP_KERNEL); + opt->key = kzalloc_obj(*opt->key); if (!opt->key) return -ENOMEM; err = ceph_crypto_key_unarmor(opt->key, param->string); @@ -468,7 +468,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, ceph_crypto_key_destroy(opt->key); kfree(opt->key); - opt->key = kzalloc_obj(*opt->key, GFP_KERNEL); + opt->key = kzalloc_obj(*opt->key); if (!opt->key) return -ENOMEM; return get_secret(opt->key, param->string, &log); @@ -713,7 +713,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private) if (err < 0) return ERR_PTR(err); - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (client == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index ef8a98c1174f..de7496791c91 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -466,7 +466,7 @@ static int ceph_key_preparse(struct key_preparsed_payload *prep) goto err; ret = -ENOMEM; - ckey = kzalloc_obj(*ckey, GFP_KERNEL); + ckey = kzalloc_obj(*ckey); if (!ckey) goto err; diff --git a/net/core/dev.c b/net/core/dev.c index 525cf5952101..b91aabb18bbe 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -273,7 +273,7 @@ static struct netdev_name_node *netdev_name_node_alloc(struct net_device *dev, { struct netdev_name_node *name_node; - name_node = kmalloc_obj(*name_node, GFP_KERNEL); + name_node = kmalloc_obj(*name_node); if (!name_node) return NULL; INIT_HLIST_NODE(&name_node->hlist); @@ -8693,7 +8693,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev, return 0; } - adj = kmalloc_obj(*adj, GFP_KERNEL); + adj = kmalloc_obj(*adj); if (!adj) return -ENOMEM; @@ -11940,7 +11940,7 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev) #ifdef CONFIG_NET_CLS_ACT if (queue) return queue; - queue = kzalloc_obj(*queue, GFP_KERNEL); + queue = kzalloc_obj(*queue); if (!queue) return NULL; netdev_init_one_queue(dev, queue, NULL); @@ -12857,7 +12857,7 @@ static struct hlist_head * __net_init netdev_create_hash(void) int i; struct hlist_head *hash; - hash = kmalloc_objs(*hash, NETDEV_HASHENTRIES, GFP_KERNEL); + hash = kmalloc_objs(*hash, NETDEV_HASHENTRIES); if (hash != NULL) for (i = 0; i < NETDEV_HASHENTRIES; i++) INIT_HLIST_HEAD(&hash[i]); diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 99f9d4dfb866..da0d231e1952 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -1583,7 +1583,7 @@ static int dropmon_net_event(struct notifier_block *ev_block, case NETDEV_REGISTER: if (WARN_ON_ONCE(rtnl_dereference(dev->dm_private))) break; - stat = kzalloc_obj(*stat, GFP_KERNEL); + stat = kzalloc_obj(*stat); if (!stat) break; diff --git a/net/core/failover.c b/net/core/failover.c index fcc04e6995d0..0eb2e0ec875b 100644 --- a/net/core/failover.c +++ b/net/core/failover.c @@ -247,7 +247,7 @@ struct failover *failover_register(struct net_device *dev, if (dev->type != ARPHRD_ETHER) return ERR_PTR(-EINVAL); - failover = kzalloc_obj(*failover, GFP_KERNEL); + failover = kzalloc_obj(*failover); if (!failover) return ERR_PTR(-ENOMEM); diff --git a/net/core/filter.c b/net/core/filter.c index 6957d3449f2c..0d5d5a17acb2 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -1161,7 +1161,7 @@ static int bpf_prog_store_orig_filter(struct bpf_prog *fp, unsigned int fsize = bpf_classic_proglen(fprog); struct sock_fprog_kern *fkprog; - fp->orig_prog = kmalloc_obj(*fkprog, GFP_KERNEL); + fp->orig_prog = kmalloc_obj(*fkprog); if (!fp->orig_prog) return -ENOMEM; @@ -1481,7 +1481,7 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) { struct sk_filter *fp, *old_fp; - fp = kmalloc_obj(*fp, GFP_KERNEL); + fp = kmalloc_obj(*fp); if (!fp) return -ENOMEM; diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index 630f94e2c2c1..c55bf9d5ac8c 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -263,7 +263,7 @@ struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb, { struct flow_block_cb *block_cb; - block_cb = kzalloc_obj(*block_cb, GFP_KERNEL); + block_cb = kzalloc_obj(*block_cb); if (!block_cb) return ERR_PTR(-ENOMEM); @@ -390,7 +390,7 @@ static struct flow_indr_dev *flow_indr_dev_alloc(flow_indr_block_bind_cb_t *cb, { struct flow_indr_dev *indr_dev; - indr_dev = kmalloc_obj(*indr_dev, GFP_KERNEL); + indr_dev = kmalloc_obj(*indr_dev); if (!indr_dev) return NULL; @@ -570,7 +570,7 @@ static int indir_dev_add(void *data, struct net_device *dev, struct Qdisc *sch, if (info) return -EEXIST; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 64d0d55fa2b2..c34e58c6c3e6 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -154,7 +154,7 @@ int gen_new_estimator(struct gnet_stats_basic_sync *bstats, if (parm->ewma_log == 0 || parm->ewma_log >= 31) return -EINVAL; - est = kzalloc_obj(*est, GFP_KERNEL); + est = kzalloc_obj(*est); if (!est) return -ENOBUFS; diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 7a040a9233e7..1057d16d5dd2 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -492,7 +492,7 @@ static struct net *net_alloc(void) goto out_free; #ifdef CONFIG_KEYS - net->key_domain = kzalloc_obj(struct key_tag, GFP_KERNEL); + net->key_domain = kzalloc_obj(struct key_tag); if (!net->key_domain) goto out_free_2; refcount_set(&net->key_domain->usage, 1); diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c index 9267880a0a17..e1e30f0b60cd 100644 --- a/net/core/netclassid_cgroup.c +++ b/net/core/netclassid_cgroup.c @@ -32,7 +32,7 @@ cgrp_css_alloc(struct cgroup_subsys_state *parent_css) { struct cgroup_cls_state *cs; - cs = kzalloc_obj(*cs, GFP_KERNEL); + cs = kzalloc_obj(*cs); if (!cs) return ERR_PTR(-ENOMEM); diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 70e458893ea5..a8558a52884f 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -565,7 +565,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev) npinfo = rtnl_dereference(ndev->npinfo); if (!npinfo) { - npinfo = kmalloc_obj(*npinfo, GFP_KERNEL); + npinfo = kmalloc_obj(*npinfo); if (!npinfo) { err = -ENOMEM; goto out; diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index fb3cd2886e1f..76c33ab44761 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c @@ -135,7 +135,7 @@ cgrp_css_alloc(struct cgroup_subsys_state *parent_css) { struct cgroup_subsys_state *css; - css = kzalloc_obj(*css, GFP_KERNEL); + css = kzalloc_obj(*css); if (!css) return ERR_PTR(-ENOMEM); diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index da268fc45356..dad4b1054955 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -414,7 +414,7 @@ static int rtnl_register_internal(struct module *owner, if (!link) goto unlock; } else { - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) goto unlock; } @@ -3969,7 +3969,7 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, int ops_srcu_index; int ret; - tbs = kmalloc_obj(*tbs, GFP_KERNEL); + tbs = kmalloc_obj(*tbs); if (!tbs) return -ENOMEM; diff --git a/net/core/selftests.c b/net/core/selftests.c index 248112bd51a8..0a203d3fb9dc 100644 --- a/net/core/selftests.c +++ b/net/core/selftests.c @@ -237,7 +237,7 @@ static int __net_test_loopback(struct net_device *ndev, struct sk_buff *skb = NULL; int ret = 0; - tpriv = kzalloc_obj(*tpriv, GFP_KERNEL); + tpriv = kzalloc_obj(*tpriv); if (!tpriv) return -ENOMEM; diff --git a/net/core/sock.c b/net/core/sock.c index b62e509e06d9..5976100a9d55 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1097,7 +1097,7 @@ sock_devmem_dontneed(struct sock *sk, sockptr_t optval, unsigned int optlen) return -EINVAL; num_tokens = optlen / sizeof(*tokens); - tokens = kvmalloc_objs(*tokens, num_tokens, GFP_KERNEL); + tokens = kvmalloc_objs(*tokens, num_tokens); if (!tokens) return -ENOMEM; diff --git a/net/core/xdp.c b/net/core/xdp.c index 8c65d7dafd89..9890a30584ba 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -214,7 +214,7 @@ static int __mem_id_init_hash_table(void) if (unlikely(mem_id_init)) return 0; - rht = kzalloc_obj(*rht, GFP_KERNEL); + rht = kzalloc_obj(*rht); if (!rht) return -ENOMEM; diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index ff2198133213..35164bfa563d 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1021,7 +1021,7 @@ static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb, */ err = ops->peer_getappinfo(netdev, &info, &app_count); if (!err && app_count) { - table = kmalloc_objs(struct dcb_app, app_count, GFP_KERNEL); + table = kmalloc_objs(struct dcb_app, app_count); if (!table) return -ENOMEM; diff --git a/net/devlink/core.c b/net/devlink/core.c index 44584f3613ca..0b020f69cef1 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -111,7 +111,7 @@ static struct devlink_rel *devlink_rel_alloc(void) static u32 next; int err; - rel = kzalloc_obj(*rel, GFP_KERNEL); + rel = kzalloc_obj(*rel); if (!rel) return ERR_PTR(-ENOMEM); diff --git a/net/devlink/dpipe.c b/net/devlink/dpipe.c index 3b86dc25e7f2..c8d4a4374ae1 100644 --- a/net/devlink/dpipe.c +++ b/net/devlink/dpipe.c @@ -851,7 +851,7 @@ int devl_dpipe_table_register(struct devlink *devlink, devlink)) return -EEXIST; - table = kzalloc_obj(*table, GFP_KERNEL); + table = kzalloc_obj(*table); if (!table) return -ENOMEM; diff --git a/net/devlink/health.c b/net/devlink/health.c index 0578f7b460f5..449c7611c640 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -32,7 +32,7 @@ static struct devlink_fmsg *devlink_fmsg_alloc(void) { struct devlink_fmsg *fmsg; - fmsg = kzalloc_obj(*fmsg, GFP_KERNEL); + fmsg = kzalloc_obj(*fmsg); if (!fmsg) return NULL; @@ -119,7 +119,7 @@ __devlink_health_reporter_create(struct devlink *devlink, if (WARN_ON(ops->default_burst_period && !ops->default_graceful_period)) return ERR_PTR(-EINVAL); - reporter = kzalloc_obj(*reporter, GFP_KERNEL); + reporter = kzalloc_obj(*reporter); if (!reporter) return ERR_PTR(-ENOMEM); @@ -738,7 +738,7 @@ static void devlink_fmsg_nest_common(struct devlink_fmsg *fmsg, int attrtype) if (fmsg->err) return; - item = kzalloc_obj(*item, GFP_KERNEL); + item = kzalloc_obj(*item); if (!item) { fmsg->err = -ENOMEM; return; diff --git a/net/devlink/linecard.c b/net/devlink/linecard.c index 110f1347b9c6..8315d35cb91d 100644 --- a/net/devlink/linecard.c +++ b/net/devlink/linecard.c @@ -404,7 +404,7 @@ static int devlink_linecard_types_init(struct devlink_linecard *linecard) int i; count = linecard->ops->types_count(linecard, linecard->priv); - linecard->types = kmalloc_objs(*linecard_type, count, GFP_KERNEL); + linecard->types = kmalloc_objs(*linecard_type, count); if (!linecard->types) return -ENOMEM; linecard->types_count = count; @@ -450,7 +450,7 @@ devl_linecard_create(struct devlink *devlink, unsigned int linecard_index, if (devlink_linecard_index_exists(devlink, linecard_index)) return ERR_PTR(-EEXIST); - linecard = kzalloc_obj(*linecard, GFP_KERNEL); + linecard = kzalloc_obj(*linecard); if (!linecard) return ERR_PTR(-ENOMEM); diff --git a/net/devlink/param.c b/net/devlink/param.c index 74adb0fdb5f7..cf95268da5b0 100644 --- a/net/devlink/param.c +++ b/net/devlink/param.c @@ -718,7 +718,7 @@ static int devlink_param_register(struct devlink *devlink, else WARN_ON(!param->get || !param->set); - param_item = kzalloc_obj(*param_item, GFP_KERNEL); + param_item = kzalloc_obj(*param_item); if (!param_item) return -ENOMEM; diff --git a/net/devlink/rate.c b/net/devlink/rate.c index 8d8a688ad140..41be2d6c2954 100644 --- a/net/devlink/rate.c +++ b/net/devlink/rate.c @@ -627,7 +627,7 @@ int devlink_nl_rate_new_doit(struct sk_buff *skb, struct genl_info *info) else if (rate_node == ERR_PTR(-EINVAL)) return -EINVAL; - rate_node = kzalloc_obj(*rate_node, GFP_KERNEL); + rate_node = kzalloc_obj(*rate_node); if (!rate_node) return -ENOMEM; @@ -721,7 +721,7 @@ devl_rate_node_create(struct devlink *devlink, void *priv, char *node_name, if (!IS_ERR(rate_node)) return ERR_PTR(-EEXIST); - rate_node = kzalloc_obj(*rate_node, GFP_KERNEL); + rate_node = kzalloc_obj(*rate_node); if (!rate_node) return ERR_PTR(-ENOMEM); @@ -766,7 +766,7 @@ int devl_rate_leaf_create(struct devlink_port *devlink_port, void *priv, if (WARN_ON(devlink_port->devlink_rate)) return -EBUSY; - devlink_rate = kzalloc_obj(*devlink_rate, GFP_KERNEL); + devlink_rate = kzalloc_obj(*devlink_rate); if (!devlink_rate) return -ENOMEM; diff --git a/net/devlink/region.c b/net/devlink/region.c index 654e3766710f..5588e3d560b9 100644 --- a/net/devlink/region.c +++ b/net/devlink/region.c @@ -428,7 +428,7 @@ __devlink_region_snapshot_create(struct devlink_region *region, if (devlink_region_snapshot_get_by_id(region, snapshot_id)) return -EEXIST; - snapshot = kzalloc_obj(*snapshot, GFP_KERNEL); + snapshot = kzalloc_obj(*snapshot); if (!snapshot) return -ENOMEM; @@ -1055,7 +1055,7 @@ struct devlink_region *devl_region_create(struct devlink *devlink, if (devlink_region_get_by_name(devlink, ops->name)) return ERR_PTR(-EEXIST); - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) return ERR_PTR(-ENOMEM); @@ -1128,7 +1128,7 @@ devlink_port_region_create(struct devlink_port *port, goto unlock; } - region = kzalloc_obj(*region, GFP_KERNEL); + region = kzalloc_obj(*region); if (!region) { err = -ENOMEM; goto unlock; diff --git a/net/devlink/resource.c b/net/devlink/resource.c index aa3621c28a00..351835a710b1 100644 --- a/net/devlink/resource.c +++ b/net/devlink/resource.c @@ -347,7 +347,7 @@ int devl_resource_register(struct devlink *devlink, if (resource) return -EEXIST; - resource = kzalloc_obj(*resource, GFP_KERNEL); + resource = kzalloc_obj(*resource); if (!resource) return -ENOMEM; diff --git a/net/devlink/sb.c b/net/devlink/sb.c index bcfeed079433..49fcbfe08f15 100644 --- a/net/devlink/sb.c +++ b/net/devlink/sb.c @@ -943,7 +943,7 @@ int devl_sb_register(struct devlink *devlink, unsigned int sb_index, if (devlink_sb_index_exists(devlink, sb_index)) return -EEXIST; - devlink_sb = kzalloc_obj(*devlink_sb, GFP_KERNEL); + devlink_sb = kzalloc_obj(*devlink_sb); if (!devlink_sb) return -ENOMEM; devlink_sb->index = sb_index; diff --git a/net/devlink/trap.c b/net/devlink/trap.c index e4255c0a6a30..8edb31654a68 100644 --- a/net/devlink/trap.c +++ b/net/devlink/trap.c @@ -1271,7 +1271,7 @@ devlink_trap_register(struct devlink *devlink, if (devlink_trap_item_lookup(devlink, trap->name)) return -EEXIST; - trap_item = kzalloc_obj(*trap_item, GFP_KERNEL); + trap_item = kzalloc_obj(*trap_item); if (!trap_item) return -ENOMEM; @@ -1545,7 +1545,7 @@ devlink_trap_group_register(struct devlink *devlink, if (devlink_trap_group_item_lookup(devlink, group->name)) return -EEXIST; - group_item = kzalloc_obj(*group_item, GFP_KERNEL); + group_item = kzalloc_obj(*group_item); if (!group_item) return -ENOMEM; @@ -1751,7 +1751,7 @@ devlink_trap_policer_register(struct devlink *devlink, if (devlink_trap_policer_item_lookup(devlink, policer->id)) return -EEXIST; - policer_item = kzalloc_obj(*policer_item, GFP_KERNEL); + policer_item = kzalloc_obj(*policer_item); if (!policer_item) return -ENOMEM; diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index b0ae980ca684..9cb732f6b1e3 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -213,7 +213,7 @@ static struct dsa_switch_tree *dsa_tree_alloc(int index) { struct dsa_switch_tree *dst; - dst = kzalloc_obj(*dst, GFP_KERNEL); + dst = kzalloc_obj(*dst); if (!dst) return NULL; @@ -298,7 +298,7 @@ static struct dsa_link *dsa_link_touch(struct dsa_port *dp, if (dl->dp == dp && dl->link_dp == link_dp) return dl; - dl = kzalloc_obj(*dl, GFP_KERNEL); + dl = kzalloc_obj(*dl); if (!dl) return NULL; @@ -844,7 +844,7 @@ static int dsa_tree_setup_lags(struct dsa_switch_tree *dst) if (!len) return 0; - dst->lags = kzalloc_objs(*dst->lags, len, GFP_KERNEL); + dst->lags = kzalloc_objs(*dst->lags, len); if (!dst->lags) return -ENOMEM; @@ -1092,7 +1092,7 @@ static struct dsa_port *dsa_port_touch(struct dsa_switch *ds, int index) if (dp->index == index) return dp; - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); if (!dp) return NULL; diff --git a/net/dsa/port.c b/net/dsa/port.c index 4da911edc512..1f5536c0dffc 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -431,7 +431,7 @@ static int dsa_port_bridge_create(struct dsa_port *dp, return 0; } - bridge = kzalloc_obj(*bridge, GFP_KERNEL); + bridge = kzalloc_obj(*bridge); if (!bridge) return -ENOMEM; @@ -617,7 +617,7 @@ static int dsa_port_lag_create(struct dsa_port *dp, return 0; } - lag = kzalloc_obj(*lag, GFP_KERNEL); + lag = kzalloc_obj(*lag); if (!lag) return -ENOMEM; diff --git a/net/dsa/switch.c b/net/dsa/switch.c index e00997977c93..a670a04edb72 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -182,7 +182,7 @@ static int dsa_port_do_mdb_add(struct dsa_port *dp, goto out; } - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) { err = -ENOMEM; goto out; @@ -280,7 +280,7 @@ static int dsa_port_do_fdb_add(struct dsa_port *dp, const unsigned char *addr, goto out; } - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) { err = -ENOMEM; goto out; @@ -368,7 +368,7 @@ static int dsa_switch_do_lag_fdb_add(struct dsa_switch *ds, struct dsa_lag *lag, goto out; } - a = kzalloc_obj(*a, GFP_KERNEL); + a = kzalloc_obj(*a); if (!a) { err = -ENOMEM; goto out; @@ -719,7 +719,7 @@ static int dsa_port_do_vlan_add(struct dsa_port *dp, goto out; } - v = kzalloc_obj(*v, GFP_KERNEL); + v = kzalloc_obj(*v); if (!v) { err = -ENOMEM; goto out; diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c index c9bea6808da3..f91646e60246 100644 --- a/net/dsa/tag_8021q.c +++ b/net/dsa/tag_8021q.c @@ -158,7 +158,7 @@ static int dsa_port_do_tag_8021q_vlan_add(struct dsa_port *dp, u16 vid, return 0; } - v = kzalloc_obj(*v, GFP_KERNEL); + v = kzalloc_obj(*v); if (!v) return -ENOMEM; @@ -420,7 +420,7 @@ int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto) struct dsa_8021q_context *ctx; int err; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 15aa44478807..d2475c3bbb7d 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -62,7 +62,7 @@ static int ksz_connect(struct dsa_switch *ds) struct ksz_tagger_private *priv; int ret; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/net/dsa/tag_ocelot_8021q.c b/net/dsa/tag_ocelot_8021q.c index b9bf2895309a..e89d9254e90a 100644 --- a/net/dsa/tag_ocelot_8021q.c +++ b/net/dsa/tag_ocelot_8021q.c @@ -106,7 +106,7 @@ static int ocelot_connect(struct dsa_switch *ds) struct ocelot_8021q_tagger_private *priv; int err; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index 4326487c1f29..9e3b429e8b36 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -92,7 +92,7 @@ static int qca_tag_connect(struct dsa_switch *ds) { struct qca_tagger_data *tagger_data; - tagger_data = kzalloc_obj(*tagger_data, GFP_KERNEL); + tagger_data = kzalloc_obj(*tagger_data); if (!tagger_data) return -ENOMEM; diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index 2083ef3b4b90..de6d4ce8668b 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -701,7 +701,7 @@ static int sja1105_connect(struct dsa_switch *ds) struct kthread_worker *xmit_worker; int err; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/net/dsa/user.c b/net/dsa/user.c index 5df8cb69295d..c4bd6fe90b45 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1318,7 +1318,7 @@ static int dsa_user_netpoll_setup(struct net_device *dev) struct netpoll *netpoll; int err = 0; - netpoll = kzalloc_obj(*netpoll, GFP_KERNEL); + netpoll = kzalloc_obj(*netpoll); if (!netpoll) return -ENOMEM; @@ -1430,7 +1430,7 @@ dsa_user_add_cls_matchall_mirred(struct net_device *dev, return -EOPNOTSUPP; } - mall_tc_entry = kzalloc_obj(*mall_tc_entry, GFP_KERNEL); + mall_tc_entry = kzalloc_obj(*mall_tc_entry); if (!mall_tc_entry) return -ENOMEM; @@ -1490,7 +1490,7 @@ dsa_user_add_cls_matchall_police(struct net_device *dev, act = &cls->rule->action.entries[0]; - mall_tc_entry = kzalloc_obj(*mall_tc_entry, GFP_KERNEL); + mall_tc_entry = kzalloc_obj(*mall_tc_entry); if (!mall_tc_entry) return -ENOMEM; @@ -1823,7 +1823,7 @@ static int dsa_user_vlan_rx_add_vid(struct net_device *dev, __be16 proto, !dsa_switch_supports_mc_filtering(ds)) return 0; - v = kzalloc_obj(*v, GFP_KERNEL); + v = kzalloc_obj(*v); if (!v) { ret = -ENOMEM; goto rollback; @@ -2070,7 +2070,7 @@ static void dsa_bridge_mtu_normalization(struct dsa_port *dp) if (min_mtu > user->mtu) min_mtu = user->mtu; - hw_port = kzalloc_obj(*hw_port, GFP_KERNEL); + hw_port = kzalloc_obj(*hw_port); if (!hw_port) goto out; diff --git a/net/ethtool/cmis_cdb.c b/net/ethtool/cmis_cdb.c index 674439bedd49..3670ca42dd40 100644 --- a/net/ethtool/cmis_cdb.c +++ b/net/ethtool/cmis_cdb.c @@ -276,7 +276,7 @@ ethtool_cmis_cdb_init(struct net_device *dev, struct ethtool_cmis_cdb *cdb; int err; - cdb = kzalloc_obj(*cdb, GFP_KERNEL); + cdb = kzalloc_obj(*cdb); if (!cdb) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index b4e7c6ccf9f3..ff4b4780d6af 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -3040,7 +3040,7 @@ ethtool_set_per_queue_coalesce(struct net_device *dev, bitmap_from_arr32(queue_mask, per_queue_opt->queue_mask, MAX_NUM_QUEUE); n_queue = bitmap_weight(queue_mask, MAX_NUM_QUEUE); - tmp = backup = kmalloc_objs(*backup, n_queue, GFP_KERNEL); + tmp = backup = kmalloc_objs(*backup, n_queue); if (!backup) return -ENOMEM; @@ -3554,7 +3554,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *useraddr) if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) return -EFAULT; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return -ENOMEM; diff --git a/net/ethtool/module.c b/net/ethtool/module.c index d033a20aa48c..0a761bf4771e 100644 --- a/net/ethtool/module.c +++ b/net/ethtool/module.c @@ -301,7 +301,7 @@ module_flash_fw_schedule(struct net_device *dev, const char *file_name, struct ethtool_module_fw_flash *module_fw; int err; - module_fw = kzalloc_obj(*module_fw, GFP_KERNEL); + module_fw = kzalloc_obj(*module_fw); if (!module_fw) return -ENOMEM; diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c index acd0477b3a2d..e49e612a68c2 100644 --- a/net/ethtool/tsconfig.c +++ b/net/ethtool/tsconfig.c @@ -202,10 +202,10 @@ static int tsconfig_send_reply(struct net_device *dev, struct genl_info *info) int reply_len = 0; int ret; - req_info = kzalloc_obj(*req_info, GFP_KERNEL); + req_info = kzalloc_obj(*req_info); if (!req_info) return -ENOMEM; - reply_data = kmalloc_obj(*reply_data, GFP_KERNEL); + reply_data = kmalloc_obj(*reply_data); if (!reply_data) { kfree(req_info); return -ENOMEM; @@ -280,7 +280,7 @@ tsconfig_set_hwprov_from_desc(struct net_device *dev, source = HWTSTAMP_SOURCE_PHYLIB; } - hwprov = kzalloc_obj(*hwprov, GFP_KERNEL); + hwprov = kzalloc_obj(*hwprov); if (!hwprov) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c index df9c7de9a640..c0145c752d2f 100644 --- a/net/ethtool/tsinfo.c +++ b/net/ethtool/tsinfo.c @@ -505,10 +505,10 @@ int ethnl_tsinfo_start(struct netlink_callback *cb) BUILD_BUG_ON(sizeof(*ctx) > sizeof(cb->ctx)); - req_info = kzalloc_obj(*req_info, GFP_KERNEL); + req_info = kzalloc_obj(*req_info); if (!req_info) return -ENOMEM; - reply_data = kzalloc_obj(*reply_data, GFP_KERNEL); + reply_data = kzalloc_obj(*reply_data); if (!reply_data) { ret = -ENOMEM; goto free_req_info; diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index d5a742cb77d1..50996f4de7f9 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -80,7 +80,7 @@ int hsr_create_self_node(struct hsr_priv *hsr, { struct hsr_self_node *sn, *old; - sn = kmalloc_obj(*sn, GFP_KERNEL); + sn = kmalloc_obj(*sn); if (!sn) return -ENOMEM; diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index 9a3f3add4b47..44f83c8c56a7 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -198,7 +198,7 @@ int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev, if (port) return -EBUSY; /* This port already exists */ - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index f743d1568f3f..115f43d0e158 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -603,7 +603,7 @@ nl802154_dump_wpan_phy(struct sk_buff *skb, struct netlink_callback *cb) rtnl_lock(); if (!state) { - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { rtnl_unlock(); return -ENOMEM; @@ -1418,7 +1418,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; } - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return -ENOMEM; @@ -1586,7 +1586,7 @@ nl802154_send_beacons(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; } - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return -ENOMEM; diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index f4a207c7cfc6..5fb812443a08 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -484,7 +484,7 @@ static int ah_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) goto error; } - ahp = kzalloc_obj(*ahp, GFP_KERNEL); + ahp = kzalloc_obj(*ahp); if (!ahp) return -ENOMEM; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 9fd41dfbe788..8f4190c7c9ab 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -270,7 +270,7 @@ static struct in_device *inetdev_init(struct net_device *dev) ASSERT_RTNL(); - in_dev = kzalloc_obj(*in_dev, GFP_KERNEL); + in_dev = kzalloc_obj(*in_dev); if (!in_dev) goto out; memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c index 885f3b06f6e9..3baaa4df7e42 100644 --- a/net/ipv4/fou_core.c +++ b/net/ipv4/fou_core.c @@ -581,7 +581,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg, goto error; /* Allocate FOU port structure */ - fou = kzalloc_obj(*fou, GFP_KERNEL); + fou = kzalloc_obj(*fou); if (!fou) { err = -ENOMEM; goto error; diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 89f99c7ee69e..9d215485b5c7 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -845,7 +845,7 @@ static int __inet_diag_dump_start(struct netlink_callback *cb, int hdrlen) struct nlattr *nla; int err; - cb_data = kzalloc_obj(*cb_data, GFP_KERNEL); + cb_data = kzalloc_obj(*cb_data); if (!cb_data) return -ENOMEM; diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index b006606ebb1d..393770920abd 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -188,7 +188,7 @@ static void fqdir_work_fn(struct work_struct *work) int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) { - struct fqdir *fqdir = kzalloc_obj(*fqdir, GFP_KERNEL); + struct fqdir *fqdir = kzalloc_obj(*fqdir); int res; if (!fqdir) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 50bf4ec8213a..fca980772c81 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -1284,7 +1284,7 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, int inet_hashinfo2_init_mod(struct inet_hashinfo *h) { - h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE, GFP_KERNEL); + h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE); if (!h->lhash2) return -ENOMEM; diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index d09377780942..697e18242d6c 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -350,7 +350,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num == IPPROTO_RAW) return -EINVAL; - new_ra = on ? kmalloc_obj(*new_ra, GFP_KERNEL) : NULL; + new_ra = on ? kmalloc_obj(*new_ra) : NULL; if (on && !new_ra) return -ENOMEM; diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 5dcac1fb4209..a35ffedacc7c 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -244,7 +244,7 @@ static int __init ic_open_devs(void) dev->name); continue; } - if (!(d = kmalloc_obj(struct ic_device, GFP_KERNEL))) { + if (!(d = kmalloc_obj(struct ic_device))) { rtnl_unlock(); return -ENOMEM; } diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c index 77b7717b9c14..2d62526406ca 100644 --- a/net/ipv4/ipmr_base.c +++ b/net/ipv4/ipmr_base.c @@ -38,7 +38,7 @@ mr_table_alloc(struct net *net, u32 id, struct mr_table *mrt; int err; - mrt = kzalloc_obj(*mrt, GFP_KERNEL); + mrt = kzalloc_obj(*mrt); if (!mrt) return ERR_PTR(-ENOMEM); mrt->id = id; diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c index 8b88d674a1ea..c1463add48c4 100644 --- a/net/ipv4/metrics.c +++ b/net/ipv4/metrics.c @@ -73,7 +73,7 @@ struct dst_metrics *ip_fib_metrics_init(struct nlattr *fc_mx, if (!fc_mx) return (struct dst_metrics *)&dst_default_metrics; - fib_metrics = kzalloc_obj(*fib_metrics, GFP_KERNEL); + fib_metrics = kzalloc_obj(*fib_metrics); if (unlikely(!fib_metrics)) return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 36b52a92e999..b9873370c69e 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -116,7 +116,7 @@ static int nh_notifier_single_info_init(struct nh_notifier_info *info, struct nh_info *nhi = rtnl_dereference(nh->nh_info); info->type = NH_NOTIFIER_INFO_TYPE_SINGLE; - info->nh = kzalloc_obj(*info->nh, GFP_KERNEL); + info->nh = kzalloc_obj(*info->nh); if (!info->nh) return -ENOMEM; @@ -318,7 +318,7 @@ static int nh_notifier_res_bucket_info_init(struct nh_notifier_info *info, return err; info->type = NH_NOTIFIER_INFO_TYPE_RES_BUCKET; - info->nh_res_bucket = kzalloc_obj(*info->nh_res_bucket, GFP_KERNEL); + info->nh_res_bucket = kzalloc_obj(*info->nh_res_bucket); if (!info->nh_res_bucket) return -ENOMEM; @@ -534,7 +534,7 @@ static struct nexthop *nexthop_alloc(void) { struct nexthop *nh; - nh = kzalloc_obj(struct nexthop, GFP_KERNEL); + nh = kzalloc_obj(struct nexthop); if (nh) { INIT_LIST_HEAD(&nh->fi_list); INIT_LIST_HEAD(&nh->f6i_list); @@ -2895,7 +2895,7 @@ static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg, if (!nh) return ERR_PTR(-ENOMEM); - nhi = kzalloc_obj(*nhi, GFP_KERNEL); + nhi = kzalloc_obj(*nhi); if (!nhi) { kfree(nh); return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/route.c b/net/ipv4/route.c index c75b92f60742..463236e0dc2d 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -315,7 +315,7 @@ static int rt_acct_proc_show(struct seq_file *m, void *v) struct ip_rt_acct *dst, *src; unsigned int i, j; - dst = kzalloc_objs(struct ip_rt_acct, 256, GFP_KERNEL); + dst = kzalloc_objs(struct ip_rt_acct, 256); if (!dst) return -ENOMEM; @@ -3687,7 +3687,7 @@ static __net_initdata struct pernet_operations rt_genid_ops = { static int __net_init ipv4_inetpeer_init(struct net *net) { - struct inet_peer_base *bp = kmalloc_obj(*bp, GFP_KERNEL); + struct inet_peer_base *bp = kmalloc_obj(*bp); if (!bp) return -ENOMEM; diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index b4309dc4b9c5..1b7ba2cf3efe 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c @@ -149,7 +149,7 @@ int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk, struct fastopen_queue *q; int err = 0; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) { err = -ENOMEM; goto out; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5fcf81a833e8..6c6b68a66dcd 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -3859,7 +3859,7 @@ static struct udp_table __net_init *udp_pernet_table_alloc(unsigned int hash_ent unsigned int slot_size; int i; - udptable = kmalloc_obj(*udptable, GFP_KERNEL); + udptable = kmalloc_obj(*udptable); if (!udptable) goto out; diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c index ae674e3ed9b8..75d9b6d3f51a 100644 --- a/net/ipv4/udp_tunnel_nic.c +++ b/net/ipv4/udp_tunnel_nic.c @@ -821,7 +821,7 @@ static int udp_tunnel_nic_register(struct net_device *dev) /* Create UDP tunnel state structures */ if (info->shared) { - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index e3b6b9a3f02e..f4b2618446bd 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c @@ -180,7 +180,7 @@ static struct ip6addrlbl_entry *ip6addrlbl_alloc(const struct in6_addr *prefix, break; } - newp = kmalloc_obj(*newp, GFP_KERNEL); + newp = kmalloc_obj(*newp); if (!newp) return ERR_PTR(-ENOMEM); diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 7ad0c894f2fd..cb26beea4398 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c @@ -691,7 +691,7 @@ static int ah6_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) goto error; } - ahp = kzalloc_obj(*ahp, GFP_KERNEL); + ahp = kzalloc_obj(*ahp); if (!ahp) return -ENOMEM; diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index c5ff34040175..8991805fc3d6 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -220,7 +220,7 @@ static int ila_add_mapping(struct net *net, struct ila_xlat_params *xp) return err; } - ila = kzalloc_obj(*ila, GFP_KERNEL); + ila = kzalloc_obj(*ila); if (!ila) return -ENOMEM; @@ -509,7 +509,7 @@ int ila_xlat_nl_dump_start(struct netlink_callback *cb) struct ila_net *ilan = net_generic(net, ila_net_id); struct ila_dump_iter *iter; - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return -ENOMEM; diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c index b6c9e48891fe..b76f89d92e7b 100644 --- a/net/ipv6/ioam6.c +++ b/net/ipv6/ioam6.c @@ -127,7 +127,7 @@ static int ioam6_genl_addns(struct sk_buff *skb, struct genl_info *info) goto out_unlock; } - ns = kzalloc_obj(*ns, GFP_KERNEL); + ns = kzalloc_obj(*ns); if (!ns) { err = -ENOMEM; goto out_unlock; @@ -245,7 +245,7 @@ static int ioam6_genl_dumpns_start(struct netlink_callback *cb) struct rhashtable_iter *iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return -ENOMEM; @@ -431,7 +431,7 @@ static int ioam6_genl_dumpsc_start(struct netlink_callback *cb) struct rhashtable_iter *iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return -ENOMEM; @@ -975,7 +975,7 @@ static int __net_init ioam6_net_init(struct net *net) struct ioam6_pernet_data *nsdata; int err = -ENOMEM; - nsdata = kzalloc_obj(*nsdata, GFP_KERNEL); + nsdata = kzalloc_obj(*nsdata); if (!nsdata) goto out; diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 6a26d9448395..2029d40a9d2c 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -2464,7 +2464,7 @@ static int __net_init fib6_net_init(struct net *net) INIT_LIST_HEAD(&net->ipv6.fib6_walkers); timer_setup(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, 0); - net->ipv6.rt6_stats = kzalloc_obj(*net->ipv6.rt6_stats, GFP_KERNEL); + net->ipv6.rt6_stats = kzalloc_obj(*net->ipv6.rt6_stats); if (!net->ipv6.rt6_stats) goto out_notifier; diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index f89e0af5a9ed..7c12bf75beed 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -386,7 +386,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, goto done; err = -ENOMEM; - fl = kzalloc_obj(*fl, GFP_KERNEL); + fl = kzalloc_obj(*fl); if (!fl) goto done; @@ -638,7 +638,7 @@ static int ipv6_flowlabel_get(struct sock *sk, struct in6_flowlabel_req *freq, if (!fl) return err; - sfl1 = kmalloc_obj(*sfl1, GFP_KERNEL); + sfl1 = kmalloc_obj(*sfl1); if (freq->flr_label) { err = -EEXIST; diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 152388dc96ec..02c4cab60c69 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -66,7 +66,7 @@ int ip6_ra_control(struct sock *sk, int sel) if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num != IPPROTO_RAW) return -ENOPROTOOPT; - new_ra = (sel >= 0) ? kmalloc_obj(*new_ra, GFP_KERNEL) : NULL; + new_ra = (sel >= 0) ? kmalloc_obj(*new_ra) : NULL; if (sel >= 0 && !new_ra) return -ENOMEM; diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index f982f3b71435..3330adcf26db 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -740,7 +740,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) * for deleted items allows change reports to use common code with * non-deleted or query-response MCA's. */ - pmc = kzalloc_obj(*pmc, GFP_KERNEL); + pmc = kzalloc_obj(*pmc); if (!pmc) return; @@ -868,7 +868,7 @@ static struct ifmcaddr6 *mca_alloc(struct inet6_dev *idev, mc_assert_locked(idev); - mc = kzalloc_obj(*mc, GFP_KERNEL); + mc = kzalloc_obj(*mc); if (!mc) return NULL; @@ -2415,7 +2415,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, psf_prev = psf; } if (!psf) { - psf = kzalloc_obj(*psf, GFP_KERNEL); + psf = kzalloc_obj(*psf); if (!psf) return -ENOBUFS; @@ -2500,7 +2500,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc) &psf->sf_addr)) break; if (!dpsf) { - dpsf = kmalloc_obj(*dpsf, GFP_KERNEL); + dpsf = kmalloc_obj(*dpsf); if (!dpsf) continue; *dpsf = *psf; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index dd50cf2bf6ef..85df25c36409 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -5331,7 +5331,7 @@ static int ip6_route_info_append(struct list_head *rt6_nh_list, return -EEXIST; } - nh = kzalloc_obj(*nh, GFP_KERNEL); + nh = kzalloc_obj(*nh); if (!nh) return -ENOMEM; @@ -6778,7 +6778,7 @@ static struct pernet_operations ip6_route_net_ops = { static int __net_init ipv6_inetpeer_init(struct net *net) { - struct inet_peer_base *bp = kmalloc_obj(*bp, GFP_KERNEL); + struct inet_peer_base *bp = kmalloc_obj(*bp); if (!bp) return -ENOMEM; diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index b53c491079cd..1c3ad25700c4 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c @@ -202,7 +202,7 @@ static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info) secret = (char *)nla_data(info->attrs[SEG6_ATTR_SECRET]); - hinfo = kzalloc_obj(*hinfo, GFP_KERNEL); + hinfo = kzalloc_obj(*hinfo); if (!hinfo) { err = -ENOMEM; goto out_unlock; @@ -339,7 +339,7 @@ static int seg6_genl_dumphmac_start(struct netlink_callback *cb) iter = (struct rhashtable_iter *)cb->args[0]; if (!iter) { - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return -ENOMEM; @@ -421,13 +421,13 @@ static int __net_init seg6_net_init(struct net *net) { struct seg6_pernet_data *sdata; - sdata = kzalloc_obj(*sdata, GFP_KERNEL); + sdata = kzalloc_obj(*sdata); if (!sdata) return -ENOMEM; mutex_init(&sdata->lock); - sdata->tun_src = kzalloc_obj(*sdata->tun_src, GFP_KERNEL); + sdata->tun_src = kzalloc_obj(*sdata->tun_src); if (!sdata->tun_src) { kfree(sdata); return -ENOMEM; diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index ca7955831c28..6a7b8abb0477 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -394,7 +394,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg) goto out; } - p = kzalloc_obj(struct ip_tunnel_prl_entry, GFP_KERNEL); + p = kzalloc_obj(struct ip_tunnel_prl_entry); if (!p) { err = -ENOBUFS; goto out; diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 0c3492c873ca..6641c49b09ac 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -90,7 +90,7 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs, char buf[20]; int rc; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) goto out_error; va_start(vargs, fmt); diff --git a/net/key/af_key.c b/net/key/af_key.c index 83c7697c679a..0756bac62f7c 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1196,7 +1196,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, err = -ENOSYS; goto out; } - x->calg = kmalloc_obj(*x->calg, GFP_KERNEL); + x->calg = kmalloc_obj(*x->calg); if (!x->calg) { err = -ENOMEM; goto out; @@ -1261,7 +1261,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, const struct sadb_x_nat_t_type* n_type; struct xfrm_encap_tmpl *natt; - x->encap = kzalloc_obj(*x->encap, GFP_KERNEL); + x->encap = kzalloc_obj(*x->encap); if (!x->encap) { err = -ENOMEM; goto out; @@ -1855,7 +1855,7 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, const struct sadb_ms mutex_unlock(&pfk->dump_lock); return -EINVAL; } - filter = kmalloc_obj(*filter, GFP_KERNEL); + filter = kmalloc_obj(*filter); if (filter == NULL) { mutex_unlock(&pfk->dump_lock); return -ENOMEM; diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 1b84338f2a90..c89ae52764b8 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1572,7 +1572,7 @@ int l2tp_tunnel_create(int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, if (cfg) encap = cfg->encap; - tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel); if (!tunnel) { err = -ENOMEM; goto err; diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c index 56ea3ed20581..b26986fda9d6 100644 --- a/net/l2tp/l2tp_debugfs.c +++ b/net/l2tp/l2tp_debugfs.c @@ -269,7 +269,7 @@ static int l2tp_dfs_seq_open(struct inode *inode, struct file *file) struct seq_file *seq; int rc = -ENOMEM; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) goto out; diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index e8670a46371c..f301a8622bee 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -395,7 +395,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, } /* prepare A-MPDU MLME for Rx aggregation */ - tid_agg_rx = kzalloc_obj(*tid_agg_rx, GFP_KERNEL); + tid_agg_rx = kzalloc_obj(*tid_agg_rx); if (!tid_agg_rx) goto end; @@ -411,7 +411,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, /* prepare reordering buffer */ tid_agg_rx->reorder_buf = - kzalloc_objs(struct sk_buff_head, buf_size, GFP_KERNEL); + kzalloc_objs(struct sk_buff_head, buf_size); tid_agg_rx->reorder_time = kcalloc(buf_size, sizeof(unsigned long), GFP_KERNEL); if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) { diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d1adbc4984d1..8b76525c56ee 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4742,7 +4742,7 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy, struct mac80211_qos_map *new_qos_map, *old_qos_map; if (qos_map) { - new_qos_map = kzalloc_obj(*new_qos_map, GFP_KERNEL); + new_qos_map = kzalloc_obj(*new_qos_map); if (!new_qos_map) return -ENOMEM; memcpy(&new_qos_map->qos_map, qos_map, sizeof(*qos_map)); diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 60654b0b542d..4447cf03c41b 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -1612,7 +1612,7 @@ static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, lockdep_assert_wiphy(local->hw.wiphy); - vif_chsw = kzalloc_objs(vif_chsw[0], n_vifs, GFP_KERNEL); + vif_chsw = kzalloc_objs(vif_chsw[0], n_vifs); if (!vif_chsw) return -ENOMEM; diff --git a/net/mac80211/led.c b/net/mac80211/led.c index f93fe928c4bc..b5600d223452 100644 --- a/net/mac80211/led.c +++ b/net/mac80211/led.c @@ -298,7 +298,7 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, if (WARN_ON(local->tpt_led_trigger)) return NULL; - tpt_trig = kzalloc_obj(struct tpt_led_trigger, GFP_KERNEL); + tpt_trig = kzalloc_obj(struct tpt_led_trigger); if (!tpt_trig) return NULL; diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 7102d113d89d..f589450754a9 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -295,7 +295,7 @@ static int ieee80211_vif_update_links(struct ieee80211_sub_if_data *sdata, /* allocate new link structures first */ for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { - link = kzalloc_obj(*link, GFP_KERNEL); + link = kzalloc_obj(*link); if (!link) { ret = -ENOMEM; goto free; diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a7bd4dd9aa19..a7e71eef3660 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -178,7 +178,7 @@ int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) { int i; - sdata->u.mesh.rmc = kmalloc_obj(struct mesh_rmc, GFP_KERNEL); + sdata->u.mesh.rmc = kmalloc_obj(struct mesh_rmc); if (!sdata->u.mesh.rmc) return -ENOMEM; sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c1d0808f2545..e8edcee0e08a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -10839,7 +10839,7 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata, if (added_links) { bool uapsd_supported; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 00ef339f7de4..f60f6a58948b 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -579,7 +579,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local, if (!local->emulate_chanctx && !local->ops->remain_on_channel) return -EOPNOTSUPP; - roc = kzalloc_obj(*roc, GFP_KERNEL); + roc = kzalloc_obj(*roc); if (!roc) return -ENOMEM; diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 3ae891be800b..31af7dd6aedc 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -163,7 +163,7 @@ int ieee80211_rate_control_register(const struct rate_control_ops *ops) } } - alg = kzalloc_obj(*alg, GFP_KERNEL); + alg = kzalloc_obj(*alg); if (alg == NULL) { mutex_unlock(&rate_ctrl_mutex); return -ENOMEM; @@ -263,7 +263,7 @@ rate_control_alloc(const char *name, struct ieee80211_local *local) { struct rate_control_ref *ref; - ref = kmalloc_obj(struct rate_control_ref, GFP_KERNEL); + ref = kmalloc_obj(struct rate_control_ref); if (!ref) return NULL; ref->ops = ieee80211_rate_control_ops_get(name); diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 6abcf410a0ca..6dc22f1593be 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -903,7 +903,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) goto out_cleanup; } - sinfo = kzalloc_obj(struct station_info, GFP_KERNEL); + sinfo = kzalloc_obj(struct station_info); if (!sinfo) { err = -ENOMEM; goto out_cleanup; @@ -1545,7 +1545,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta, bool recalc) } } - sinfo = kzalloc_obj(*sinfo, GFP_KERNEL); + sinfo = kzalloc_obj(*sinfo); if (sinfo) sta_set_sinfo(sta, sinfo, true); @@ -3306,7 +3306,7 @@ int ieee80211_sta_allocate_link(struct sta_info *sta, unsigned int link_id) sta->link[link_id])) return -EBUSY; - alloc = kzalloc_obj(*alloc, GFP_KERNEL); + alloc = kzalloc_obj(*alloc); if (!alloc) return -ENOMEM; diff --git a/net/mac80211/tests/util.c b/net/mac80211/tests/util.c index cddc46eeb648..0b01264af577 100644 --- a/net/mac80211/tests/util.c +++ b/net/mac80211/tests/util.c @@ -195,16 +195,16 @@ int t_sdata_init(struct kunit_resource *resource, void *ctx) struct kunit *test = kunit_get_current_test(); struct t_sdata *t_sdata; - t_sdata = kzalloc_obj(*t_sdata, GFP_KERNEL); + t_sdata = kzalloc_obj(*t_sdata); KUNIT_ASSERT_NOT_NULL(test, t_sdata); resource->data = t_sdata; resource->name = "sdata"; - t_sdata->sdata = kzalloc_obj(*t_sdata->sdata, GFP_KERNEL); + t_sdata->sdata = kzalloc_obj(*t_sdata->sdata); KUNIT_ASSERT_NOT_NULL(test, t_sdata->sdata); - t_sdata->wiphy = kzalloc_obj(*t_sdata->wiphy, GFP_KERNEL); + t_sdata->wiphy = kzalloc_obj(*t_sdata->wiphy); KUNIT_ASSERT_NOT_NULL(test, t_sdata->wiphy); strscpy(t_sdata->sdata->name, "kunit"); diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a3113e1d9829..8cdbd417d7be 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1611,7 +1611,7 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local) local->cparams.target = MS2TIME(20); local->cparams.ecn = true; - local->cvars = kvzalloc_objs(local->cvars[0], fq->flows_cnt, GFP_KERNEL); + local->cvars = kvzalloc_objs(local->cvars[0], fq->flows_cnt); if (!local->cvars) { spin_lock_bh(&fq->lock); fq_reset(fq, fq_skb_free_func); diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c index 44ad05726db3..e8484031a390 100644 --- a/net/mac802154/cfg.c +++ b/net/mac802154/cfg.c @@ -339,7 +339,7 @@ static int mac802154_associate(struct wpan_phy *wpan_phy, if (coord->mode == IEEE802154_SHORT_ADDRESSING) return -EINVAL; - parent = kzalloc_obj(*parent, GFP_KERNEL); + parent = kzalloc_obj(*parent); if (!parent) return -ENOMEM; diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c index 0489f2515eb6..e8512578398e 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -117,7 +117,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template) struct mac802154_llsec_key *key; int i; - key = kzalloc_obj(*key, GFP_KERNEL); + key = kzalloc_obj(*key); if (!key) return NULL; @@ -241,7 +241,7 @@ int mac802154_llsec_key_add(struct mac802154_llsec *sec, break; } - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return -ENOMEM; @@ -369,7 +369,7 @@ int mac802154_llsec_dev_add(struct mac802154_llsec *sec, llsec_dev_find_long(sec, dev->hwaddr)) return -EEXIST; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -441,7 +441,7 @@ int mac802154_llsec_devkey_add(struct mac802154_llsec *sec, if (llsec_devkey_find(dev, &key->key_id)) return -EEXIST; - devkey = kmalloc_obj(*devkey, GFP_KERNEL); + devkey = kmalloc_obj(*devkey); if (!devkey) return -ENOMEM; @@ -500,7 +500,7 @@ int mac802154_llsec_seclevel_add(struct mac802154_llsec *sec, if (llsec_find_seclevel(sec, sl)) return -EEXIST; - entry = kmalloc_obj(*entry, GFP_KERNEL); + entry = kmalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index 583178784c9b..0a31ac8d8415 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -798,7 +798,7 @@ int mac802154_process_association_req(struct ieee802154_sub_if_data *sdata, goto unlock; } - child = kzalloc_obj(*child, GFP_KERNEL); + child = kzalloc_obj(*child); if (!child) { ret = -ENOMEM; goto unlock; diff --git a/net/mctp/device.c b/net/mctp/device.c index 08f3d35fa45b..2c84df674669 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -336,7 +336,7 @@ static struct mctp_dev *mctp_add_dev(struct net_device *dev) ASSERT_RTNL(); - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return ERR_PTR(-ENOMEM); diff --git a/net/mctp/neigh.c b/net/mctp/neigh.c index 5894433535eb..87e40db0f078 100644 --- a/net/mctp/neigh.c +++ b/net/mctp/neigh.c @@ -40,7 +40,7 @@ static int mctp_neigh_add(struct mctp_dev *mdev, mctp_eid_t eid, goto out; } - neigh = kzalloc_obj(*neigh, GFP_KERNEL); + neigh = kzalloc_obj(*neigh); if (!neigh) { rc = -ENOMEM; goto out; diff --git a/net/mctp/route.c b/net/mctp/route.c index 349fc650a805..0381377ab760 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -675,7 +675,7 @@ static struct mctp_route *mctp_route_alloc(void) { struct mctp_route *rt; - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return NULL; diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c index 922b2c353a4e..97afe8cd2b05 100644 --- a/net/mctp/test/utils.c +++ b/net/mctp/test/utils.c @@ -106,7 +106,7 @@ static struct mctp_test_route *mctp_route_test_alloc(void) { struct mctp_test_route *rt; - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return NULL; diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 82d885b8478a..ef9e749d5e08 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1470,7 +1470,7 @@ static struct mpls_dev *mpls_add_dev(struct net_device *dev) int err = -ENOMEM; int i; - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return ERR_PTR(err); @@ -1977,7 +1977,7 @@ static int mpls_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, struct mpls_route_config *cfg; int err; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; @@ -2002,7 +2002,7 @@ static int mpls_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, struct mpls_route_config *cfg; int err; - cfg = kzalloc_obj(*cfg, GFP_KERNEL); + cfg = kzalloc_obj(*cfg); if (!cfg) return -ENOMEM; diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index dec9812c3fbb..54d0df0a9efe 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -1697,7 +1697,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) return -ENOSPC; } - vlan = kzalloc_obj(*vlan, GFP_KERNEL); + vlan = kzalloc_obj(*vlan); if (!vlan) return -ENOMEM; diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index c3beef6155b6..a2fe711cb5e3 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -1077,7 +1077,7 @@ static int ip_set_create(struct sk_buff *skb, const struct nfnl_info *info, /* First, and without any locks, allocate and initialize * a normal base set structure. */ - set = kzalloc_obj(*set, GFP_KERNEL); + set = kzalloc_obj(*set); if (!set) return -ENOMEM; spin_lock_init(&set->lock); @@ -1135,7 +1135,7 @@ static int ip_set_create(struct sk_buff *skb, const struct nfnl_info *info, /* Wraparound */ goto cleanup; - list = kvzalloc_objs(struct ip_set *, i, GFP_KERNEL); + list = kvzalloc_objs(struct ip_set *, i); if (!list) goto cleanup; /* nfnl mutex is held, both lists are valid */ @@ -2377,7 +2377,7 @@ ip_set_net_init(struct net *net) if (inst->ip_set_max >= IPSET_INVALID_ID) inst->ip_set_max = IPSET_INVALID_ID - 1; - list = kvzalloc_objs(struct ip_set *, inst->ip_set_max, GFP_KERNEL); + list = kvzalloc_objs(struct ip_set *, inst->ip_set_max); if (!list) return -ENOMEM; inst->is_deleted = false; diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c index 39165c014bd9..98b91b34c314 100644 --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -598,7 +598,7 @@ init_list_set(struct net *net, struct ip_set *set, u32 size) { struct list_set *map; - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (!map) return false; diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index d38867c52180..35642de2a0fe 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -938,7 +938,7 @@ int ip_vs_stats_init_alloc(struct ip_vs_stats *s) struct ip_vs_stats *ip_vs_stats_alloc(void) { - struct ip_vs_stats *s = kzalloc_obj(*s, GFP_KERNEL); + struct ip_vs_stats *s = kzalloc_obj(*s); if (s && ip_vs_stats_init_alloc(s) >= 0) return s; @@ -1079,7 +1079,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest) return -EINVAL; } - dest = kzalloc_obj(struct ip_vs_dest, GFP_KERNEL); + dest = kzalloc_obj(struct ip_vs_dest); if (dest == NULL) return -ENOMEM; @@ -1421,7 +1421,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u, ret_hooks = ret; } - svc = kzalloc_obj(struct ip_vs_service, GFP_KERNEL); + svc = kzalloc_obj(struct ip_vs_service); if (svc == NULL) { IP_VS_DBG(1, "%s(): no memory\n", __func__); ret = -ENOMEM; @@ -4439,7 +4439,7 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) INIT_DELAYED_WORK(&ipvs->est_reload_work, est_reload_work_handler); /* procfs stats */ - ipvs->tot_stats = kzalloc_obj(*ipvs->tot_stats, GFP_KERNEL); + ipvs->tot_stats = kzalloc_obj(*ipvs->tot_stats); if (!ipvs->tot_stats) goto out; if (ip_vs_stats_init_alloc(&ipvs->tot_stats->s) < 0) diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c index ac1d6f5bfe8a..e1f62f6b25e2 100644 --- a/net/netfilter/ipvs/ip_vs_dh.c +++ b/net/netfilter/ipvs/ip_vs_dh.c @@ -153,7 +153,7 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc) struct ip_vs_dh_state *s; /* allocate the DH table for this service */ - s = kzalloc_obj(struct ip_vs_dh_state, GFP_KERNEL); + s = kzalloc_obj(struct ip_vs_dh_state); if (s == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index 06999a17519b..b17de33314da 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c @@ -325,7 +325,7 @@ static int ip_vs_est_add_kthread(struct netns_ipvs *ipvs) id = i; } - kd = kzalloc_obj(*kd, GFP_KERNEL); + kd = kzalloc_obj(*kd); if (!kd) goto out; kd->ipvs = ipvs; @@ -443,7 +443,7 @@ add_est: td = rcu_dereference_protected(kd->ticks[row], 1); if (!td) { - td = kzalloc_obj(*td, GFP_KERNEL); + td = kzalloc_obj(*td); if (!td) { ret = -ENOMEM; goto out; diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 36d91153712c..15ccb2b2fa1f 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -347,7 +347,7 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) /* * Allocate the ip_vs_lblc_table for this service */ - tbl = kmalloc_obj(*tbl, GFP_KERNEL); + tbl = kmalloc_obj(*tbl); if (tbl == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index eba6600decbe..c90ea897c3f7 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c @@ -510,7 +510,7 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) /* * Allocate the ip_vs_lblcr_table for this service */ - tbl = kmalloc_obj(*tbl, GFP_KERNEL); + tbl = kmalloc_obj(*tbl); if (tbl == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_mh.c b/net/netfilter/ipvs/ip_vs_mh.c index 7f5be86bab4d..c029ff6b3eb2 100644 --- a/net/netfilter/ipvs/ip_vs_mh.c +++ b/net/netfilter/ipvs/ip_vs_mh.c @@ -382,7 +382,7 @@ static int ip_vs_mh_init_svc(struct ip_vs_service *svc) struct ip_vs_mh_state *s; /* Allocate the MH table for this service */ - s = kzalloc_obj(*s, GFP_KERNEL); + s = kzalloc_obj(*s); if (!s) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index a62c1e8fc1da..0046aed1fb38 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c @@ -66,7 +66,7 @@ register_ip_vs_proto_netns(struct netns_ipvs *ipvs, struct ip_vs_protocol *pp) { unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); struct ip_vs_proto_data *pd = - kzalloc_obj(struct ip_vs_proto_data, GFP_KERNEL); + kzalloc_obj(struct ip_vs_proto_data); if (!pd) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index a4616433b445..cd67066e3b26 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c @@ -229,7 +229,7 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc) struct ip_vs_sh_state *s; /* allocate the SH table for this service */ - s = kzalloc_obj(struct ip_vs_sh_state, GFP_KERNEL); + s = kzalloc_obj(struct ip_vs_sh_state); if (s == NULL) return -ENOMEM; diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index f83732777228..b2ba3befbd55 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -1827,7 +1827,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, struct ipvs_master_sync_state *ms; result = -ENOMEM; - ipvs->ms = kzalloc_objs(ipvs->ms[0], count, GFP_KERNEL); + ipvs->ms = kzalloc_objs(ipvs->ms[0], count); if (!ipvs->ms) goto out; ms = ipvs->ms; @@ -1841,7 +1841,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, } } result = -ENOMEM; - ti = kzalloc_objs(struct ip_vs_sync_thread_data, count, GFP_KERNEL); + ti = kzalloc_objs(struct ip_vs_sync_thread_data, count); if (!ti) goto out; diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c index 58c65af9830a..2dcff1040da5 100644 --- a/net/netfilter/ipvs/ip_vs_wrr.c +++ b/net/netfilter/ipvs/ip_vs_wrr.c @@ -109,7 +109,7 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc) /* * Allocate the mark variable for WRR scheduling */ - mark = kmalloc_obj(struct ip_vs_wrr_mark, GFP_KERNEL); + mark = kmalloc_obj(struct ip_vs_wrr_mark); if (mark == NULL) return -ENOMEM; diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c index 520781335fc8..00eed5b4d1b1 100644 --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c @@ -632,7 +632,7 @@ struct nf_conncount_data *nf_conncount_init(struct net *net, unsigned int keylen net_get_random_once(&conncount_rnd, sizeof(conncount_rnd)); - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return ERR_PTR(-ENOMEM); diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 42da155ab028..27ce5fda8993 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -2535,7 +2535,7 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls) if (nr_slots > (INT_MAX / sizeof(struct hlist_nulls_head))) return NULL; - hash = kvzalloc_objs(struct hlist_nulls_head, nr_slots, GFP_KERNEL); + hash = kvzalloc_objs(struct hlist_nulls_head, nr_slots); if (hash && nulls) for (i = 0; i < nr_slots; i++) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index cd1ab584fb2f..c9d725fc2d71 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -999,7 +999,7 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family) return ERR_PTR(-EOPNOTSUPP); #endif - filter = kzalloc_obj(*filter, GFP_KERNEL); + filter = kzalloc_obj(*filter); if (filter == NULL) return ERR_PTR(-ENOMEM); diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c index c95a18ca178b..9b677e116487 100644 --- a/net/netfilter/nf_flow_table_offload.c +++ b/net/netfilter/nf_flow_table_offload.c @@ -741,7 +741,7 @@ nf_flow_offload_rule_alloc(struct net *net, struct nf_flow_rule *flow_rule; int err = -ENOMEM; - flow_rule = kzalloc_obj(*flow_rule, GFP_KERNEL); + flow_rule = kzalloc_obj(*flow_rule); if (!flow_rule) goto err_flow; diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c index b4053e5ee07f..3b5434e4ec9c 100644 --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c @@ -1213,7 +1213,7 @@ int nf_nat_register_fn(struct net *net, u8 pf, const struct nf_hook_ops *ops, } for (i = 0; i < ops_count; i++) { - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv) { nat_ops[i].priv = priv; continue; diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 6044f1ec6953..06bd4d6eefeb 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -1104,7 +1104,7 @@ __printf(2, 3) int nft_request_module(struct net *net, const char *fmt, } } - req = kmalloc_obj(*req, GFP_KERNEL); + req = kmalloc_obj(*req); if (!req) return -ENOMEM; @@ -8075,7 +8075,7 @@ static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, struct nft_object *obj; int err = -ENOMEM; - tb = kmalloc_objs(*tb, type->maxattr + 1, GFP_KERNEL); + tb = kmalloc_objs(*tb, type->maxattr + 1); if (!tb) goto err1; @@ -10688,7 +10688,7 @@ static int nf_tables_commit_audit_alloc(struct list_head *adl, if (adp->table == table) return 0; } - adp = kzalloc_obj(*adp, GFP_KERNEL); + adp = kzalloc_obj(*adp); if (!adp) return -ENOMEM; adp->table = table; diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c index 42f11cb0c0f5..9101b1703b52 100644 --- a/net/netfilter/nf_tables_offload.c +++ b/net/netfilter/nf_tables_offload.c @@ -11,7 +11,7 @@ static struct nft_flow_rule *nft_flow_rule_alloc(int num_actions) { struct nft_flow_rule *flow; - flow = kzalloc_obj(struct nft_flow_rule, GFP_KERNEL); + flow = kzalloc_obj(struct nft_flow_rule); if (!flow) return NULL; @@ -111,7 +111,7 @@ struct nft_flow_rule *nft_flow_rule_create(struct net *net, expr = nft_expr_first(rule); - ctx = kzalloc_obj(struct nft_offload_ctx, GFP_KERNEL); + ctx = kzalloc_obj(struct nft_offload_ctx); if (!ctx) { err = -ENOMEM; goto err_out; diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 39c3d54de9f6..e62a0dea24ea 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -325,7 +325,7 @@ static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err, { struct nfnl_err *nfnl_err; - nfnl_err = kmalloc_obj(struct nfnl_err, GFP_KERNEL); + nfnl_err = kmalloc_obj(struct nfnl_err); if (nfnl_err == NULL) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index bd3d960a1adb..2bfaa773d82f 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c @@ -260,7 +260,7 @@ static int nfnl_acct_start(struct netlink_callback *cb) if (!tb[NFACCT_FILTER_MASK] || !tb[NFACCT_FILTER_VALUE]) return -EINVAL; - filter = kzalloc_obj(struct nfacct_filter, GFP_KERNEL); + filter = kzalloc_obj(struct nfacct_filter); if (!filter) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index 1a3d333e45dd..5efffc52d981 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -227,7 +227,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[], if (!tb[NFCTH_TUPLE] || !tb[NFCTH_POLICY] || !tb[NFCTH_PRIV_DATA_LEN]) return -EINVAL; - nfcth = kzalloc_obj(*nfcth, GFP_KERNEL); + nfcth = kzalloc_obj(*nfcth); if (nfcth == NULL) return -ENOMEM; helper = &nfcth->helper; diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c index 6b91f9d3161a..fd8652aa7e88 100644 --- a/net/netfilter/nfnetlink_cttimeout.c +++ b/net/netfilter/nfnetlink_cttimeout.c @@ -74,7 +74,7 @@ ctnl_timeout_parse_policy(void *timeout, struct nlattr **tb; int ret = 0; - tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1, GFP_KERNEL); + tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1); if (!tb) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c index c2a572d86853..531706982859 100644 --- a/net/netfilter/nfnetlink_hook.c +++ b/net/netfilter/nfnetlink_hook.c @@ -408,7 +408,7 @@ static int nfnl_hook_dump_start(struct netlink_callback *cb) if (head && IS_ERR(head)) return PTR_ERR(head); - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c index 1ba43e562a5e..94e3eac5743a 100644 --- a/net/netfilter/nfnetlink_osf.c +++ b/net/netfilter/nfnetlink_osf.c @@ -323,7 +323,7 @@ static int nfnl_osf_add_callback(struct sk_buff *skb, !memchr(f->version, 0, MAXGENRELEN)) return -EINVAL; - kf = kmalloc_obj(struct nf_osf_finger, GFP_KERNEL); + kf = kmalloc_obj(struct nf_osf_finger); if (!kf) return -ENOMEM; diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index 8d7f6c8e8aad..47d3ef109a99 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c @@ -894,7 +894,7 @@ nft_ct_timeout_parse_policy(void *timeouts, struct nlattr **tb; int ret = 0; - tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1, GFP_KERNEL); + tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1); if (!tb) return -ENOMEM; diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index f5d720c9ee32..e594b3b7ad82 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -1742,7 +1742,7 @@ xt_hook_ops_alloc(const struct xt_table *table, nf_hookfn *fn) if (!num_hooks) return ERR_PTR(-EINVAL); - ops = kzalloc_objs(*ops, num_hooks, GFP_KERNEL); + ops = kzalloc_objs(*ops, num_hooks); if (ops == NULL) return ERR_PTR(-ENOMEM); @@ -1775,7 +1775,7 @@ int xt_register_template(const struct xt_table *table, } ret = -ENOMEM; - t = kzalloc_obj(*t, GFP_KERNEL); + t = kzalloc_obj(*t); if (!t) goto out_unlock; @@ -1993,7 +1993,7 @@ static int __init xt_init(void) } } - xt = kzalloc_objs(struct xt_af, NFPROTO_NUMPROTO, GFP_KERNEL); + xt = kzalloc_objs(struct xt_af, NFPROTO_NUMPROTO); if (!xt) return -ENOMEM; diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index 746abeee6775..5d93e225d0f8 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -135,7 +135,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) { int ret; - info->timer = kzalloc_obj(*info->timer, GFP_KERNEL); + info->timer = kzalloc_obj(*info->timer); if (!info->timer) { ret = -ENOMEM; goto out; @@ -184,7 +184,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info) { int ret; - info->timer = kmalloc_obj(*info->timer, GFP_KERNEL); + info->timer = kmalloc_obj(*info->timer); if (!info->timer) { ret = -ENOMEM; goto out; diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index 6b21810e1b97..caaaf4d2c584 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c @@ -111,7 +111,7 @@ static int led_tg_check(const struct xt_tgchk_param *par) } err = -ENOMEM; - ledinternal = kzalloc_obj(struct xt_led_info_internal, GFP_KERNEL); + ledinternal = kzalloc_obj(struct xt_led_info_internal); if (!ledinternal) goto exit_mutex_only; diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c index d75b1e101a5b..91270d467ffd 100644 --- a/net/netfilter/xt_RATEEST.c +++ b/net/netfilter/xt_RATEEST.c @@ -139,7 +139,7 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par) } ret = -ENOMEM; - est = kzalloc_obj(*est, GFP_KERNEL); + est = kzalloc_obj(*est); if (!est) goto err1; diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c index c6044ea31d16..5d34ceb893ed 100644 --- a/net/netfilter/xt_TEE.c +++ b/net/netfilter/xt_TEE.c @@ -106,7 +106,7 @@ static int tee_tg_check(const struct xt_tgchk_param *par) if (info->oif[sizeof(info->oif)-1] != '\0') return -EINVAL; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index 203f8bb28132..87d74da14c0b 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c @@ -115,7 +115,7 @@ static int limit_mt_check(const struct xt_mtchk_param *par) return -ERANGE; } - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (priv == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 7952a4ef4c51..b05c5c8dac78 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c @@ -50,7 +50,7 @@ static int quota_mt_check(const struct xt_mtchk_param *par) if (q->flags & ~XT_QUOTA_MASK) return -EINVAL; - q->master = kmalloc_obj(*q->master, GFP_KERNEL); + q->master = kmalloc_obj(*q->master); if (q->master == NULL) return -ENOMEM; diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c index e80ddc317ca5..334e09771abf 100644 --- a/net/netfilter/xt_statistic.c +++ b/net/netfilter/xt_statistic.c @@ -58,7 +58,7 @@ static int statistic_mt_check(const struct xt_mtchk_param *par) info->flags & ~XT_STATISTIC_MASK) return -EINVAL; - info->master = kzalloc_obj(*info->master, GFP_KERNEL); + info->master = kzalloc_obj(*info->master); if (info->master == NULL) return -ENOMEM; atomic_set(&info->master->count, info->u.nth.count); diff --git a/net/netlabel/netlabel_calipso.c b/net/netlabel/netlabel_calipso.c index fae0bee5c065..e1efd888b4a2 100644 --- a/net/netlabel/netlabel_calipso.c +++ b/net/netlabel/netlabel_calipso.c @@ -95,7 +95,7 @@ static int netlbl_calipso_add_pass(struct genl_info *info, int ret_val; struct calipso_doi *doi_def = NULL; - doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def); if (!doi_def) return -ENOMEM; doi_def->type = CALIPSO_MAP_PASS; diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index 526f3dc3e67a..b080e666523f 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c @@ -139,10 +139,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info, NULL) != 0) return -EINVAL; - doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def); if (doi_def == NULL) return -ENOMEM; - doi_def->map.std = kzalloc_obj(*doi_def->map.std, GFP_KERNEL); + doi_def->map.std = kzalloc_obj(*doi_def->map.std); if (doi_def->map.std == NULL) { kfree(doi_def); return -ENOMEM; @@ -332,7 +332,7 @@ static int netlbl_cipsov4_add_pass(struct genl_info *info, if (!info->attrs[NLBL_CIPSOV4_A_TAGLST]) return -EINVAL; - doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def); if (doi_def == NULL) return -ENOMEM; doi_def->type = CIPSO_V4_MAP_PASS; @@ -371,7 +371,7 @@ static int netlbl_cipsov4_add_local(struct genl_info *info, if (!info->attrs[NLBL_CIPSOV4_A_TAGLST]) return -EINVAL; - doi_def = kmalloc_obj(*doi_def, GFP_KERNEL); + doi_def = kmalloc_obj(*doi_def); if (doi_def == NULL) return -ENOMEM; doi_def->type = CIPSO_V4_MAP_LOCAL; diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index fc014849d6b3..3fe31648ba2d 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c @@ -367,11 +367,11 @@ int __init netlbl_domhsh_init(u32 size) if (size == 0) return -EINVAL; - hsh_tbl = kmalloc_obj(*hsh_tbl, GFP_KERNEL); + hsh_tbl = kmalloc_obj(*hsh_tbl); if (hsh_tbl == NULL) return -ENOMEM; hsh_tbl->size = 1 << size; - hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size, GFP_KERNEL); + hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size); if (hsh_tbl->tbl == NULL) { kfree(hsh_tbl); return -ENOMEM; diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 13f45fbff824..3e89c3b3a1a4 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c @@ -84,7 +84,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct calipso_doi *calipso = NULL; #endif u32 tmp_val; - struct netlbl_dom_map *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct netlbl_dom_map *entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; @@ -148,7 +148,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct in_addr *mask; struct netlbl_domaddr4_map *map; - addrmap = kzalloc_obj(*addrmap, GFP_KERNEL); + addrmap = kzalloc_obj(*addrmap); if (addrmap == NULL) { ret_val = -ENOMEM; goto add_doi_put_def; @@ -169,7 +169,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, addr = nla_data(info->attrs[NLBL_MGMT_A_IPV4ADDR]); mask = nla_data(info->attrs[NLBL_MGMT_A_IPV4MASK]); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { ret_val = -ENOMEM; goto add_free_addrmap; @@ -195,7 +195,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, struct in6_addr *mask; struct netlbl_domaddr6_map *map; - addrmap = kzalloc_obj(*addrmap, GFP_KERNEL); + addrmap = kzalloc_obj(*addrmap); if (addrmap == NULL) { ret_val = -ENOMEM; goto add_doi_put_def; @@ -216,7 +216,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, addr = nla_data(info->attrs[NLBL_MGMT_A_IPV6ADDR]); mask = nla_data(info->attrs[NLBL_MGMT_A_IPV6MASK]); - map = kzalloc_obj(*map, GFP_KERNEL); + map = kzalloc_obj(*map); if (map == NULL) { ret_val = -ENOMEM; goto add_free_addrmap; diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index ab68324c08d9..ca7a9e2a3de7 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c @@ -1413,11 +1413,11 @@ int __init netlbl_unlabel_init(u32 size) if (size == 0) return -EINVAL; - hsh_tbl = kmalloc_obj(*hsh_tbl, GFP_KERNEL); + hsh_tbl = kmalloc_obj(*hsh_tbl); if (hsh_tbl == NULL) return -ENOMEM; hsh_tbl->size = 1 << size; - hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size, GFP_KERNEL); + hsh_tbl->tbl = kzalloc_objs(struct list_head, hsh_tbl->size); if (hsh_tbl->tbl == NULL) { kfree(hsh_tbl); return -ENOMEM; @@ -1532,7 +1532,7 @@ int __init netlbl_unlabel_defconf(void) audit_info.loginuid = GLOBAL_ROOT_UID; audit_info.sessionid = 0; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (entry == NULL) return -ENOMEM; entry->family = AF_UNSPEC; diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 2d91b8b8ba9a..4d609d5cf406 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2927,7 +2927,7 @@ static int __init netlink_proto_init(void) BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > sizeof_field(struct sk_buff, cb)); - nl_table = kzalloc_objs(*nl_table, MAX_LINKS, GFP_KERNEL); + nl_table = kzalloc_objs(*nl_table, MAX_LINKS); if (!nl_table) goto panic; diff --git a/net/netlink/diag.c b/net/netlink/diag.c index 25e930a64d07..1dfc340736b8 100644 --- a/net/netlink/diag.c +++ b/net/netlink/diag.c @@ -107,7 +107,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, num--; if (!hti) { - hti = kmalloc_obj(*hti, GFP_KERNEL); + hti = kmalloc_obj(*hti); if (!hti) return -ENOMEM; diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index ac1fdf7d7327..a23d4c51c089 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -659,7 +659,7 @@ static int genl_sk_privs_alloc(struct genl_family *family) if (!family->sock_priv_size) return 0; - family->sock_privs = kzalloc_obj(*family->sock_privs, GFP_KERNEL); + family->sock_privs = kzalloc_obj(*family->sock_privs); if (!family->sock_privs) return -ENOMEM; xa_init(family->sock_privs); @@ -912,7 +912,7 @@ EXPORT_SYMBOL(genlmsg_put); static struct genl_dumpit_info *genl_dumpit_info_alloc(void) { - return kmalloc_obj(struct genl_dumpit_info, GFP_KERNEL); + return kmalloc_obj(struct genl_dumpit_info); } static void genl_dumpit_info_free(const struct genl_dumpit_info *info) @@ -937,7 +937,7 @@ genl_family_rcv_msg_attrs_parse(const struct genl_family *family, if (!ops->maxattr) return NULL; - attrbuf = kmalloc_objs(struct nlattr *, ops->maxattr + 1, GFP_KERNEL); + attrbuf = kmalloc_objs(struct nlattr *, ops->maxattr + 1); if (!attrbuf) return ERR_PTR(-ENOMEM); @@ -1590,7 +1590,7 @@ static int ctrl_dumppolicy_start(struct netlink_callback *cb) return 0; } - ctx->op_iter = kmalloc_obj(*ctx->op_iter, GFP_KERNEL); + ctx->op_iter = kmalloc_obj(*ctx->op_iter); if (!ctx->op_iter) return -ENOMEM; diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index d7090dad8113..b816c56124ab 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -1401,7 +1401,7 @@ static int __init nr_proto_init(void) goto unregister_proto; } - dev_nr = kzalloc_objs(struct net_device *, nr_ndevs, GFP_KERNEL); + dev_nr = kzalloc_objs(struct net_device *, nr_ndevs); if (!dev_nr) { pr_err("NET/ROM: %s - unable to allocate device array\n", __func__); diff --git a/net/nfc/core.c b/net/nfc/core.c index c39d00b2a0d7..a92a6566e6a0 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -879,7 +879,7 @@ int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type) if (se) return -EALREADY; - se = kzalloc_obj(struct nfc_se, GFP_KERNEL); + se = kzalloc_obj(struct nfc_se); if (!se) return -ENOMEM; @@ -1062,7 +1062,7 @@ struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops, if (!supported_protocols) return NULL; - dev = kzalloc_obj(struct nfc_dev, GFP_KERNEL); + dev = kzalloc_obj(struct nfc_dev); if (!dev) return NULL; diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c index be9a048b583b..3670bb33732e 100644 --- a/net/nfc/digital_core.c +++ b/net/nfc/digital_core.c @@ -231,7 +231,7 @@ int digital_send_cmd(struct nfc_digital_dev *ddev, u8 cmd_type, { struct digital_cmd *cmd; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -279,7 +279,7 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech) struct digital_tg_mdaa_params *params; int rc; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -706,7 +706,7 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target, struct digital_data_exch *data_exch; int rc; - data_exch = kzalloc_obj(*data_exch, GFP_KERNEL); + data_exch = kzalloc_obj(*data_exch); if (!data_exch) return -ENOMEM; @@ -762,7 +762,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(const struct nfc_digital_ops !ops->switch_rf || (ops->tg_listen_md && !ops->tg_get_rf_tech)) return NULL; - ddev = kzalloc_obj(*ddev, GFP_KERNEL); + ddev = kzalloc_obj(*ddev); if (!ddev) return NULL; diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c index df2bfb4734c5..63f1b721c71d 100644 --- a/net/nfc/digital_technology.c +++ b/net/nfc/digital_technology.c @@ -490,7 +490,7 @@ static void digital_in_recv_sens_res(struct nfc_digital_dev *ddev, void *arg, goto exit; } - target = kzalloc_obj(struct nfc_target, GFP_KERNEL); + target = kzalloc_obj(struct nfc_target); if (!target) { rc = -ENOMEM; goto exit; @@ -688,7 +688,7 @@ static void digital_in_recv_sensb_res(struct nfc_digital_dev *ddev, void *arg, else ddev->target_fsc = digital_ats_fsc[fsci]; - target = kzalloc_obj(struct nfc_target, GFP_KERNEL); + target = kzalloc_obj(struct nfc_target); if (!target) { rc = -ENOMEM; goto exit; @@ -863,7 +863,7 @@ static void digital_in_recv_iso15693_inv_res(struct nfc_digital_dev *ddev, goto out_free_skb; } - target = kzalloc_obj(*target, GFP_KERNEL); + target = kzalloc_obj(*target); if (!target) { rc = -ENOMEM; goto out_free_skb; diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 10bcd9d2576a..0d33c81a15fe 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c @@ -291,7 +291,7 @@ int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) pr_debug("from gate %d\n", gate); - targets = kzalloc_obj(struct nfc_target, GFP_KERNEL); + targets = kzalloc_obj(struct nfc_target); if (targets == NULL) return -ENOMEM; @@ -964,7 +964,7 @@ struct nfc_hci_dev *nfc_hci_allocate_device(const struct nfc_hci_ops *ops, if (protocols == 0) return NULL; - hdev = kzalloc_obj(struct nfc_hci_dev, GFP_KERNEL); + hdev = kzalloc_obj(struct nfc_hci_dev); if (hdev == NULL) return NULL; diff --git a/net/nfc/hci/hcp.c b/net/nfc/hci/hcp.c index 903fb134cd80..4d19c697d6ec 100644 --- a/net/nfc/hci/hcp.c +++ b/net/nfc/hci/hcp.c @@ -30,7 +30,7 @@ int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, int hci_len, err; bool firstfrag = true; - cmd = kzalloc_obj(struct hci_msg, GFP_KERNEL); + cmd = kzalloc_obj(struct hci_msg); if (cmd == NULL) return -ENOMEM; diff --git a/net/nfc/hci/llc.c b/net/nfc/hci/llc.c index 12d7940c6217..51dfa0d5dfa2 100644 --- a/net/nfc/hci/llc.c +++ b/net/nfc/hci/llc.c @@ -49,7 +49,7 @@ int nfc_llc_register(const char *name, const struct nfc_llc_ops *ops) { struct nfc_llc_engine *llc_engine; - llc_engine = kzalloc_obj(struct nfc_llc_engine, GFP_KERNEL); + llc_engine = kzalloc_obj(struct nfc_llc_engine); if (llc_engine == NULL) return -ENOMEM; @@ -90,7 +90,7 @@ struct nfc_llc *nfc_llc_allocate(const char *name, struct nfc_hci_dev *hdev, if (llc_engine == NULL) return NULL; - llc = kzalloc_obj(struct nfc_llc, GFP_KERNEL); + llc = kzalloc_obj(struct nfc_llc); if (llc == NULL) return NULL; diff --git a/net/nfc/hci/llc_nop.c b/net/nfc/hci/llc_nop.c index eb940330fd5d..f9c826a138e5 100644 --- a/net/nfc/hci/llc_nop.c +++ b/net/nfc/hci/llc_nop.c @@ -28,7 +28,7 @@ static void *llc_nop_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, *rx_headroom = 0; *rx_tailroom = 0; - llc_nop = kzalloc_obj(struct llc_nop, GFP_KERNEL); + llc_nop = kzalloc_obj(struct llc_nop); if (llc_nop == NULL) return NULL; diff --git a/net/nfc/hci/llc_shdlc.c b/net/nfc/hci/llc_shdlc.c index 7e0d84c29cb1..6819695d993c 100644 --- a/net/nfc/hci/llc_shdlc.c +++ b/net/nfc/hci/llc_shdlc.c @@ -728,7 +728,7 @@ static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, *rx_headroom = SHDLC_LLC_HEAD_ROOM; *rx_tailroom = 0; - shdlc = kzalloc_obj(struct llc_shdlc, GFP_KERNEL); + shdlc = kzalloc_obj(struct llc_shdlc); if (shdlc == NULL) return NULL; diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c index 90f68199ecca..291f26facbf3 100644 --- a/net/nfc/llcp_commands.c +++ b/net/nfc/llcp_commands.c @@ -108,7 +108,7 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdres_tlv(u8 tid, u8 sap) struct nfc_llcp_sdp_tlv *sdres; u8 value[2]; - sdres = kzalloc_obj(struct nfc_llcp_sdp_tlv, GFP_KERNEL); + sdres = kzalloc_obj(struct nfc_llcp_sdp_tlv); if (sdres == NULL) return NULL; @@ -141,7 +141,7 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, const char *uri, if (WARN_ON_ONCE(uri_len > U8_MAX - 4)) return NULL; - sdreq = kzalloc_obj(struct nfc_llcp_sdp_tlv, GFP_KERNEL); + sdreq = kzalloc_obj(struct nfc_llcp_sdp_tlv); if (sdreq == NULL) return NULL; diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c index 98f0c3281281..366d7566308c 100644 --- a/net/nfc/llcp_core.c +++ b/net/nfc/llcp_core.c @@ -1621,7 +1621,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) { struct nfc_llcp_local *local; - local = kzalloc_obj(struct nfc_llcp_local, GFP_KERNEL); + local = kzalloc_obj(struct nfc_llcp_local); if (local == NULL) return -ENOMEM; diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index dc17ed8be242..6e9b76e2cc56 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -1171,7 +1171,7 @@ struct nci_dev *nci_allocate_device(const struct nci_ops *ops, if (!supported_protocols) return NULL; - ndev = kzalloc_obj(struct nci_dev, GFP_KERNEL); + ndev = kzalloc_obj(struct nci_dev); if (!ndev) return NULL; diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index cd3e87b2dd3e..40ae8e5a7ec7 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c @@ -777,7 +777,7 @@ struct nci_hci_dev *nci_hci_allocate(struct nci_dev *ndev) { struct nci_hci_dev *hdev; - hdev = kzalloc_obj(*hdev, GFP_KERNEL); + hdev = kzalloc_obj(*hdev); if (!hdev) return NULL; diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c index 25dc2868fd27..5a3aed7f84f5 100644 --- a/net/nfc/nci/uart.c +++ b/net/nfc/nci/uart.c @@ -113,7 +113,7 @@ static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver) if (!nci_uart_drivers[driver]) return -ENOENT; - nu = kzalloc_obj(*nu, GFP_KERNEL); + nu = kzalloc_obj(*nu); if (!nu) return -ENOMEM; diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index a69322721c31..0c58824cb150 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -604,7 +604,7 @@ static int nfc_genl_dump_devices(struct sk_buff *skb, if (!iter) { first_call = true; - iter = kmalloc_obj(struct class_dev_iter, GFP_KERNEL); + iter = kmalloc_obj(struct class_dev_iter); if (!iter) return -ENOMEM; cb->args[0] = (long) iter; @@ -1370,7 +1370,7 @@ static int nfc_genl_dump_ses(struct sk_buff *skb, if (!iter) { first_call = true; - iter = kmalloc_obj(struct class_dev_iter, GFP_KERNEL); + iter = kmalloc_obj(struct class_dev_iter); if (!iter) return -ENOMEM; cb->args[0] = (long) iter; @@ -1541,7 +1541,7 @@ static int nfc_genl_se_io(struct sk_buff *skb, struct genl_info *info) apdu = nla_data(info->attrs[NFC_ATTR_SE_APDU]); - ctx = kzalloc_obj(struct se_io_ctx, GFP_KERNEL); + ctx = kzalloc_obj(struct se_io_ctx); if (!ctx) { rc = -ENOMEM; goto put_dev; diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index b4fb83c3c0f9..bbb9b52861c0 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1029,7 +1029,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) } /* Extract key. */ - key = kzalloc_obj(*key, GFP_KERNEL); + key = kzalloc_obj(*key); if (!key) { error = -ENOMEM; goto err_kfree_flow; @@ -1827,7 +1827,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) return -ENOMEM; err = -ENOMEM; - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); if (dp == NULL) goto err_destroy_reply; diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 54fd208a1a68..67fbf6e48a30 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -1890,7 +1890,7 @@ int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid, return 0; /* If UFID was not provided, use unmasked key. */ - new_key = kmalloc_obj(*new_key, GFP_KERNEL); + new_key = kmalloc_obj(*new_key); if (!new_key) return -ENOMEM; memcpy(new_key, key, sizeof(*key)); diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index b75236aa4414..61c6a5f77c2e 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -150,13 +150,13 @@ static void __table_instance_destroy(struct table_instance *ti) static struct table_instance *table_instance_alloc(int new_size) { - struct table_instance *ti = kmalloc_obj(*ti, GFP_KERNEL); + struct table_instance *ti = kmalloc_obj(*ti); int i; if (!ti) return NULL; - ti->buckets = kvmalloc_objs(struct hlist_head, new_size, GFP_KERNEL); + ti->buckets = kvmalloc_objs(struct hlist_head, new_size); if (!ti->buckets) { kfree(ti); return NULL; @@ -366,7 +366,7 @@ static struct mask_cache *tbl_mask_cache_alloc(u32 size) (size * sizeof(struct mask_cache_entry)) > PCPU_MIN_UNIT_SIZE) return NULL; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return NULL; @@ -964,7 +964,7 @@ static struct sw_flow_mask *mask_alloc(void) { struct sw_flow_mask *mask; - mask = kmalloc_obj(*mask, GFP_KERNEL); + mask = kmalloc_obj(*mask); if (mask) mask->ref_count = 1; @@ -1109,7 +1109,7 @@ void ovs_flow_masks_rebalance(struct flow_table *table) int i; /* Build array of all current entries with use counters. */ - masks_and_count = kmalloc_objs(*masks_and_count, ma->max, GFP_KERNEL); + masks_and_count = kmalloc_objs(*masks_and_count, ma->max); if (!masks_and_count) return; diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index a78c5122a3d7..753f3bb25970 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1711,7 +1711,7 @@ static int fanout_add(struct sock *sk, struct fanout_args *args) if (type == PACKET_FANOUT_ROLLOVER || (type_flags & PACKET_FANOUT_FLAG_ROLLOVER)) { err = -ENOMEM; - rollover = kzalloc_obj(*rollover, GFP_KERNEL); + rollover = kzalloc_obj(*rollover); if (!rollover) goto out; atomic_long_set(&rollover->num, 0); @@ -3693,7 +3693,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) goto done; err = -ENOBUFS; - i = kmalloc_obj(*i, GFP_KERNEL); + i = kmalloc_obj(*i); if (i == NULL) goto done; diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c index 08decafee7a6..c5c42b5a00d5 100644 --- a/net/psp/psp_main.c +++ b/net/psp/psp_main.c @@ -64,7 +64,7 @@ psp_dev_create(struct net_device *netdev, !psd_ops->get_stats)) return ERR_PTR(-EINVAL); - psd = kzalloc_obj(*psd, GFP_KERNEL); + psd = kzalloc_obj(*psd); if (!psd) return ERR_PTR(-ENOMEM); diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index 70e7a210fd42..55fd2dd37588 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -271,7 +271,7 @@ static int qrtr_tx_wait(struct qrtr_node *node, int dest_node, int dest_port, mutex_lock(&node->qrtr_tx_lock); flow = radix_tree_lookup(&node->qrtr_tx_flow, key); if (!flow) { - flow = kzalloc_obj(*flow, GFP_KERNEL); + flow = kzalloc_obj(*flow); if (flow) { init_waitqueue_head(&flow->resume_tx); if (radix_tree_insert(&node->qrtr_tx_flow, key, flow)) { @@ -589,7 +589,7 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid) if (!ep || !ep->xmit) return -EINVAL; - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index 36b5c1990bf5..3203b2220860 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -78,7 +78,7 @@ static struct qrtr_node *node_get(unsigned int node_id) return node; /* If node didn't exist, allocate and insert it to the tree */ - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; @@ -229,7 +229,7 @@ static struct qrtr_server *server_add(unsigned int service, if (!service || !port) return NULL; - srv = kzalloc_obj(*srv, GFP_KERNEL); + srv = kzalloc_obj(*srv); if (!srv) return NULL; @@ -534,7 +534,7 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from, if (from->sq_node != qrtr_ns.local_node) return -EINVAL; - lookup = kzalloc_obj(*lookup, GFP_KERNEL); + lookup = kzalloc_obj(*lookup); if (!lookup) return -ENOMEM; diff --git a/net/qrtr/tun.c b/net/qrtr/tun.c index 9ad17a773593..9726db31fc7e 100644 --- a/net/qrtr/tun.c +++ b/net/qrtr/tun.c @@ -33,7 +33,7 @@ static int qrtr_tun_open(struct inode *inode, struct file *filp) struct qrtr_tun *tun; int ret; - tun = kzalloc_obj(*tun, GFP_KERNEL); + tun = kzalloc_obj(*tun); if (!tun) return -ENOMEM; diff --git a/net/rds/cong.c b/net/rds/cong.c index e7f019c3a625..3133b91f9e69 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c @@ -143,7 +143,7 @@ static struct rds_cong_map *rds_cong_from_addr(const struct in6_addr *addr) unsigned long i; unsigned long flags; - map = kzalloc_obj(struct rds_cong_map, GFP_KERNEL); + map = kzalloc_obj(struct rds_cong_map); if (!map) return NULL; diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 651f658a6a0a..077f7041df15 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -67,7 +67,7 @@ static int rds_ib_add_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr) { struct rds_ib_ipaddr *i_ipaddr; - i_ipaddr = kmalloc_obj(*i_ipaddr, GFP_KERNEL); + i_ipaddr = kmalloc_obj(*i_ipaddr); if (!i_ipaddr) return -ENOMEM; @@ -585,7 +585,7 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents, if (key_ret) *key_ret = ib_mr->rkey; - ibmr = kzalloc_obj(*ibmr, GFP_KERNEL); + ibmr = kzalloc_obj(*ibmr); if (!ibmr) { ib_dereg_mr(ib_mr); ret = -ENOMEM; @@ -641,7 +641,7 @@ struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_ibdev, { struct rds_ib_mr_pool *pool; - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return ERR_PTR(-ENOMEM); diff --git a/net/rds/info.c b/net/rds/info.c index 696e957c41a9..f1b29994934a 100644 --- a/net/rds/info.c +++ b/net/rds/info.c @@ -187,7 +187,7 @@ int rds_info_getsockopt(struct socket *sock, int optname, char __user *optval, nr_pages = (PAGE_ALIGN(start + len) - (start & PAGE_MASK)) >> PAGE_SHIFT; - pages = kmalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kmalloc_objs(struct page *, nr_pages); if (!pages) { ret = -ENOMEM; goto out; diff --git a/net/rds/message.c b/net/rds/message.c index e367ca4f4f31..eaa6f22601a4 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -415,7 +415,7 @@ static int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter * */ sg = rm->data.op_sg; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; INIT_LIST_HEAD(&info->rs_zcookie_next); diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 0015531aff05..0206492014b7 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -228,13 +228,13 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args, args->vec.addr, args->vec.bytes, nr_pages); /* XXX clamp nr_pages to limit the size of this alloc? */ - pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages); if (!pages) { ret = -ENOMEM; goto out; } - mr = kzalloc_obj(struct rds_mr, GFP_KERNEL); + mr = kzalloc_obj(struct rds_mr); if (!mr) { ret = -ENOMEM; goto out; @@ -269,7 +269,7 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args, goto out; } else { nents = ret; - sg = kmalloc_objs(*sg, nents, GFP_KERNEL); + sg = kmalloc_objs(*sg, nents); if (!sg) { ret = -ENOMEM; goto out; @@ -571,7 +571,7 @@ int rds_rdma_extra_size(struct rds_rdma_args *args, if (args->nr_local > UIO_MAXIOV) return -EMSGSIZE; - iov->iov = kzalloc_objs(struct rds_iovec, args->nr_local, GFP_KERNEL); + iov->iov = kzalloc_objs(struct rds_iovec, args->nr_local); if (!iov->iov) return -ENOMEM; @@ -652,7 +652,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, goto out_ret; } - pages = kzalloc_objs(struct page *, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(struct page *, nr_pages); if (!pages) { ret = -ENOMEM; goto out_ret; @@ -679,7 +679,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, * would have to use GFP_ATOMIC there, and don't want to deal * with failed allocations. */ - op->op_notifier = kmalloc_obj(struct rds_notifier, GFP_KERNEL); + op->op_notifier = kmalloc_obj(struct rds_notifier); if (!op->op_notifier) { ret = -ENOMEM; goto out_pages; @@ -728,7 +728,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, ret = -EOPNOTSUPP; goto out_pages; } - local_odp_mr = kzalloc_obj(*local_odp_mr, GFP_KERNEL); + local_odp_mr = kzalloc_obj(*local_odp_mr); if (!local_odp_mr) { ret = -ENOMEM; goto out_pages; diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 0f64aa4797f7..2444237bc36a 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -279,7 +279,7 @@ static void rfkill_send_events(struct rfkill *rfkill, enum rfkill_operation op) struct rfkill_int_event *ev; list_for_each_entry(data, &rfkill_fds, list) { - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) continue; rfkill_fill_event(&ev->ev, rfkill, op); @@ -1165,7 +1165,7 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) struct rfkill *rfkill; struct rfkill_int_event *ev, *tmp; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1182,7 +1182,7 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) */ list_for_each_entry(rfkill, &rfkill_list, node) { - ev = kzalloc_obj(*ev, GFP_KERNEL); + ev = kzalloc_obj(*ev); if (!ev) goto free; rfkill_sync(rfkill); diff --git a/net/rfkill/input.c b/net/rfkill/input.c index 2be6d13ba6ba..f7cb24ce7754 100644 --- a/net/rfkill/input.c +++ b/net/rfkill/input.c @@ -221,7 +221,7 @@ static int rfkill_connect(struct input_handler *handler, struct input_dev *dev, struct input_handle *handle; int error; - handle = kzalloc_obj(struct input_handle, GFP_KERNEL); + handle = kzalloc_obj(struct input_handle); if (!handle) return -ENOMEM; diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 83c62af80d7c..841d62481048 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -1571,7 +1571,7 @@ static int __init rose_proto_init(void) rose_callsign = null_ax25_address; - dev_rose = kzalloc_objs(struct net_device *, rose_ndevs, GFP_KERNEL); + dev_rose = kzalloc_objs(struct net_device *, rose_ndevs); if (dev_rose == NULL) { printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); rc = -ENOMEM; diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index 4330df1b1b59..e31842e6b3c8 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c @@ -368,7 +368,7 @@ void rose_add_loopback_neigh(void) { struct rose_neigh *sn; - rose_loopback_neigh = kmalloc_obj(struct rose_neigh, GFP_KERNEL); + rose_loopback_neigh = kmalloc_obj(struct rose_neigh); if (!rose_loopback_neigh) return; sn = rose_loopback_neigh; diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index cd65bff97a8e..85078114b2dd 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -75,7 +75,7 @@ static int rxrpc_preparse_xdr_rxkad(struct key_preparsed_payload *prep, prep->quotalen = datalen + plen; plen -= sizeof(*token); - token = kzalloc_obj(*token, GFP_KERNEL); + token = kzalloc_obj(*token); if (!token) return -ENOMEM; @@ -202,7 +202,7 @@ static int rxrpc_preparse_xdr_yfs_rxgk(struct key_preparsed_payload *prep, prep->quotalen = datalen + plen; plen -= sizeof(*token); - token = kzalloc_obj(*token, GFP_KERNEL); + token = kzalloc_obj(*token); if (!token) goto nomem; @@ -500,7 +500,7 @@ static int rxrpc_preparse(struct key_preparsed_payload *prep) prep->quotalen = plen + sizeof(*token); ret = -ENOMEM; - token = kzalloc_obj(*token, GFP_KERNEL); + token = kzalloc_obj(*token); if (!token) goto error; token->kad = kzalloc(plen, GFP_KERNEL); diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 6f799b26d4d5..111f574fe667 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -112,7 +112,7 @@ static struct rxrpc_local *rxrpc_alloc_local(struct net *net, struct rxrpc_local *local; u32 tmp; - local = kzalloc_obj(struct rxrpc_local, GFP_KERNEL); + local = kzalloc_obj(struct rxrpc_local); if (local) { refcount_set(&local->ref, 1); atomic_set(&local->active_users, 1); diff --git a/net/rxrpc/rxgk_kdf.c b/net/rxrpc/rxgk_kdf.c index 6011fa7cf221..677981d1ad79 100644 --- a/net/rxrpc/rxgk_kdf.c +++ b/net/rxrpc/rxgk_kdf.c @@ -213,7 +213,7 @@ struct rxgk_context *rxgk_generate_transport_key(struct rxrpc_connection *conn, _enter(""); - gk = kzalloc_obj(*gk, GFP_KERNEL); + gk = kzalloc_obj(*gk); if (!gk) return ERR_PTR(-ENOMEM); refcount_set(&gk->usage, 1); diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c index 1345ffffb109..b8df6d22314d 100644 --- a/net/rxrpc/rxperf.c +++ b/net/rxrpc/rxperf.c @@ -151,7 +151,7 @@ static void rxperf_charge_preallocation(struct work_struct *work) struct rxperf_call *call; for (;;) { - call = kzalloc_obj(*call, GFP_KERNEL); + call = kzalloc_obj(*call); if (!call) break; diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 389874842982..332fd9695e54 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -985,7 +985,7 @@ static int tcf_pernet_add_id_list(unsigned int id) } } - id_ptr = kzalloc_obj(*id_ptr, GFP_KERNEL); + id_ptr = kzalloc_obj(*id_ptr); if (!id_ptr) { ret = -ENOMEM; goto err_out; @@ -1272,7 +1272,7 @@ errout: static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb) { - struct tc_cookie *c = kzalloc_obj(*c, GFP_KERNEL); + struct tc_cookie *c = kzalloc_obj(*c); if (!c) return NULL; diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 19eea8daa6b5..c634af5edfcd 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c @@ -121,7 +121,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, if (!tb[TCA_CONNMARK_PARMS]) return -EINVAL; - nparms = kzalloc_obj(*nparms, GFP_KERNEL); + nparms = kzalloc_obj(*nparms); if (!nparms) return -ENOMEM; diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 1cd3336eeeea..213e1ce9d2da 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -93,7 +93,7 @@ static int tcf_csum_init(struct net *net, struct nlattr *nla, p = to_tcf_csum(*a); - params_new = kzalloc_obj(*params_new, GFP_KERNEL); + params_new = kzalloc_obj(*params_new); if (unlikely(!params_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 5f45bec69c50..bd51522c7953 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -332,7 +332,7 @@ static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params) if (ct_ft && refcount_inc_not_zero(&ct_ft->ref)) goto out_unlock; - ct_ft = kzalloc_obj(*ct_ft, GFP_KERNEL); + ct_ft = kzalloc_obj(*ct_ft); if (!ct_ft) goto err_alloc; refcount_set(&ct_ft->ref, 1); @@ -1397,7 +1397,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, c = to_ct(*a); - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (unlikely(!params)) { err = -ENOMEM; goto cleanup; diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c index 00e303a01241..1886ffd2ca95 100644 --- a/net/sched/act_ctinfo.c +++ b/net/sched/act_ctinfo.c @@ -236,7 +236,7 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla, ci = to_ctinfo(*a); - cp_new = kzalloc_obj(*cp_new, GFP_KERNEL); + cp_new = kzalloc_obj(*cp_new); if (unlikely(!cp_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index 6895834a929c..79df81d12894 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c @@ -520,7 +520,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, if (parm->flags & ~IFE_ENCODE) return -EINVAL; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index 30c915d43432..1abfaf9d99f1 100644 --- a/net/sched/act_mpls.c +++ b/net/sched/act_mpls.c @@ -279,7 +279,7 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla, m = to_mpls(*a); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 7ca2af5a10c3..abb332dee836 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -81,7 +81,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, if (err < 0) goto release_idr; - nparm = kzalloc_obj(*nparm, GFP_KERNEL); + nparm = kzalloc_obj(*nparm); if (!nparm) { err = -ENOMEM; goto release_idr; diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index fb960a05cbc8..bc20f08a2789 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -51,7 +51,7 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, if (!nla) return NULL; - keys_ex = kzalloc_objs(*k, n, GFP_KERNEL); + keys_ex = kzalloc_objs(*k, n); if (!keys_ex) return ERR_PTR(-ENOMEM); @@ -223,7 +223,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, goto out_release; } - nparms = kzalloc_obj(*nparms, GFP_KERNEL); + nparms = kzalloc_obj(*nparms); if (!nparms) { ret = -ENOMEM; goto out_release; diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 4778c3ebd5db..12ea9e5a6005 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -151,7 +151,7 @@ static int tcf_police_init(struct net *net, struct nlattr *nla, goto failure; } - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (unlikely(!new)) { err = -ENOMEM; goto failure; diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index e3764d9862ad..a778cdba9258 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -242,7 +242,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, if (err < 0) goto release_idr; - params_new = kzalloc_obj(*params_new, GFP_KERNEL); + params_new = kzalloc_obj(*params_new); if (unlikely(!params_new)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index 2eaf82dc2179..23ca46138f04 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c @@ -185,7 +185,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, d = to_skbmod(*a); - p = kzalloc_obj(struct tcf_skbmod_params, GFP_KERNEL); + p = kzalloc_obj(struct tcf_skbmod_params); if (unlikely(!p)) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 51ac783f7d6c..6a375fdc63dd 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -233,7 +233,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, v = to_vlan(*a); - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { err = -ENOMEM; goto put_chain; diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 22e8527657af..a6729e87bc25 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -84,7 +84,7 @@ tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, if (WARN_ON(!handle || !tp->ops->get_exts)) return -EINVAL; - n = kzalloc_obj(*n, GFP_KERNEL); + n = kzalloc_obj(*n); if (!n) return -ENOMEM; @@ -377,7 +377,7 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol, struct tcf_proto *tp; int err; - tp = kzalloc_obj(*tp, GFP_KERNEL); + tp = kzalloc_obj(*tp); if (!tp) return ERR_PTR(-ENOBUFS); @@ -502,7 +502,7 @@ static struct tcf_chain *tcf_chain_create(struct tcf_block *block, ASSERT_BLOCK_LOCKED(block); - chain = kzalloc_obj(*chain, GFP_KERNEL); + chain = kzalloc_obj(*chain); if (!chain) return NULL; list_add_tail_rcu(&chain->list, &block->chain_list); @@ -918,7 +918,7 @@ tcf_chain0_head_change_cb_add(struct tcf_block *block, struct tcf_filter_chain_list_item *item; struct tcf_chain *chain0; - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) { NL_SET_ERR_MSG(extack, "Memory allocation for head change callback item failed"); return -ENOMEM; @@ -1016,7 +1016,7 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, { struct tcf_block *block; - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) { NL_SET_ERR_MSG(extack, "Memory allocation for block failed"); return ERR_PTR(-ENOMEM); @@ -1428,7 +1428,7 @@ static int tcf_block_owner_add(struct tcf_block *block, { struct tcf_block_owner_item *item; - item = kmalloc_obj(*item, GFP_KERNEL); + item = kmalloc_obj(*item); if (!item) return -ENOMEM; item->q = q; diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 5479fd5341b2..492cd9ce8d46 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -77,7 +77,7 @@ static int basic_init(struct tcf_proto *tp) { struct basic_head *head; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (head == NULL) return -ENOBUFS; INIT_LIST_HEAD(&head->flist); @@ -193,7 +193,7 @@ static int basic_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; } - fnew = kzalloc_obj(*fnew, GFP_KERNEL); + fnew = kzalloc_obj(*fnew); if (!fnew) return -ENOBUFS; diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index f42b89ba10a8..9a346b6221b3 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c @@ -242,7 +242,7 @@ static int cls_bpf_init(struct tcf_proto *tp) { struct cls_bpf_head *head; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (head == NULL) return -ENOBUFS; @@ -427,7 +427,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, if (ret < 0) return ret; - prog = kzalloc_obj(*prog, GFP_KERNEL); + prog = kzalloc_obj(*prog); if (!prog) return -ENOBUFS; diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index d177b1cfde60..680a5c308094 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -95,7 +95,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, if (head && handle != head->handle) return -ENOENT; - new = kzalloc_obj(*head, GFP_KERNEL); + new = kzalloc_obj(*head); if (!new) return -ENOBUFS; diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 83d837c4bced..339c664beff6 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -433,7 +433,7 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, return -EOPNOTSUPP; } - fnew = kzalloc_obj(*fnew, GFP_KERNEL); + fnew = kzalloc_obj(*fnew); if (!fnew) return -ENOBUFS; @@ -583,7 +583,7 @@ static int flow_init(struct tcf_proto *tp) { struct flow_head *head; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (head == NULL) return -ENOBUFS; INIT_LIST_HEAD(&head->filters); diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 3c930039bacb..26070c892305 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -363,7 +363,7 @@ static int fl_init(struct tcf_proto *tp) { struct cls_fl_head *head; - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (!head) return -ENOBUFS; @@ -2237,7 +2237,7 @@ static struct fl_flow_mask *fl_create_new_mask(struct cls_fl_head *head, struct fl_flow_mask *newmask; int err; - newmask = kzalloc_obj(*newmask, GFP_KERNEL); + newmask = kzalloc_obj(*newmask); if (!newmask) return ERR_PTR(-ENOMEM); @@ -2376,13 +2376,13 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, goto errout_fold; } - mask = kzalloc_obj(struct fl_flow_mask, GFP_KERNEL); + mask = kzalloc_obj(struct fl_flow_mask); if (!mask) { err = -ENOBUFS; goto errout_fold; } - tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1, GFP_KERNEL); + tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1); if (!tb) { err = -ENOBUFS; goto errout_mask_alloc; @@ -2398,7 +2398,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, goto errout_tb; } - fnew = kzalloc_obj(*fnew, GFP_KERNEL); + fnew = kzalloc_obj(*fnew); if (!fnew) { err = -ENOBUFS; goto errout_tb; @@ -2815,7 +2815,7 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain, if (!tca_opts) return ERR_PTR(-EINVAL); - tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1, GFP_KERNEL); + tb = kzalloc_objs(struct nlattr *, TCA_FLOWER_MAX + 1); if (!tb) return ERR_PTR(-ENOBUFS); err = nla_parse_nested_deprecated(tb, TCA_FLOWER_MAX, @@ -2823,7 +2823,7 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain, if (err) goto errout_tb; - tmplt = kzalloc_obj(*tmplt, GFP_KERNEL); + tmplt = kzalloc_obj(*tmplt); if (!tmplt) { err = -ENOMEM; goto errout_tb; diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 8eb3bea06e3b..be81c108179d 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c @@ -262,7 +262,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, if (f->id != handle && handle) return -EINVAL; - fnew = kzalloc_obj(struct fw_filter, GFP_KERNEL); + fnew = kzalloc_obj(struct fw_filter); if (!fnew) return -ENOBUFS; @@ -308,7 +308,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, if (tb[TCA_FW_MASK]) mask = nla_get_u32(tb[TCA_FW_MASK]); - head = kzalloc_obj(*head, GFP_KERNEL); + head = kzalloc_obj(*head); if (!head) return -ENOBUFS; head->mask = mask; @@ -316,7 +316,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, rcu_assign_pointer(tp->root, head); } - f = kzalloc_obj(struct fw_filter, GFP_KERNEL); + f = kzalloc_obj(struct fw_filter); if (f == NULL) return -ENOBUFS; diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index e78b6da59782..6f126872c14a 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -189,7 +189,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; } - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return -ENOBUFS; diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 6e16819ba91f..bd6f945bd388 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -244,7 +244,7 @@ static int route4_init(struct tcf_proto *tp) { struct route4_head *head; - head = kzalloc_obj(struct route4_head, GFP_KERNEL); + head = kzalloc_obj(struct route4_head); if (head == NULL) return -ENOBUFS; @@ -438,7 +438,7 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp, h1 = to_hash(nhandle); b = rtnl_dereference(head->table[h1]); if (!b) { - b = kzalloc_obj(struct route4_bucket, GFP_KERNEL); + b = kzalloc_obj(struct route4_bucket); if (b == NULL) return -ENOBUFS; @@ -507,7 +507,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; err = -ENOBUFS; - f = kzalloc_obj(struct route4_filter, GFP_KERNEL); + f = kzalloc_obj(struct route4_filter); if (!f) goto errout; diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 2bdc14c5e533..75a1c8c8ace1 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -375,7 +375,7 @@ static int u32_init(struct tcf_proto *tp) idr_init(&root_ht->handle_idr); if (tp_c == NULL) { - tp_c = kzalloc_obj(*tp_c, GFP_KERNEL); + tp_c = kzalloc_obj(*tp_c); if (tp_c == NULL) { kfree(root_ht); return -ENOBUFS; diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index bc47af8a45c6..48bdd77df0a3 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -927,7 +927,7 @@ static int em_meta_change(struct net *net, void *data, int len, TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) goto errout; - meta = kzalloc_obj(*meta, GFP_KERNEL); + meta = kzalloc_obj(*meta); if (meta == NULL) { err = -ENOMEM; goto errout; diff --git a/net/sched/em_text.c b/net/sched/em_text.c index a69889159537..343f1aebeec2 100644 --- a/net/sched/em_text.c +++ b/net/sched/em_text.c @@ -84,7 +84,7 @@ retry: return -EAGAIN; } - tm = kmalloc_obj(*tm, GFP_KERNEL); + tm = kmalloc_obj(*tm); if (tm == NULL) { textsearch_destroy(ts_conf); return -ENOBUFS; diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index bcf82bbc60fd..deb8ebc4401a 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -437,7 +437,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, } } - rtab = kmalloc_obj(*rtab, GFP_KERNEL); + rtab = kmalloc_obj(*rtab); if (rtab) { rtab->rate = *r; rtab->refcnt = 1; @@ -668,7 +668,7 @@ static struct hlist_head *qdisc_class_hash_alloc(unsigned int n) struct hlist_head *h; unsigned int i; - h = kvmalloc_objs(struct hlist_head, n, GFP_KERNEL); + h = kvmalloc_objs(struct hlist_head, n); if (h != NULL) { for (i = 0; i < n; i++) diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index 8d2dd1c4f3dc..94df8e741a97 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c @@ -370,7 +370,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, if (mask != q->tab_mask) { struct sk_buff **ntab; - ntab = kvzalloc_objs(struct sk_buff *, mask + 1, GFP_KERNEL); + ntab = kvzalloc_objs(struct sk_buff *, mask + 1); if (!ntab) return -ENOMEM; diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 80d845dfbe80..01335a49e091 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -105,7 +105,7 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, return 0; } - cl = kzalloc_obj(struct drr_class, GFP_KERNEL); + cl = kzalloc_obj(struct drr_class); if (cl == NULL) return -ENOBUFS; diff --git a/net/sched/sch_fq_pie.c b/net/sched/sch_fq_pie.c index 8784f89619d0..d8ac3519e937 100644 --- a/net/sched/sch_fq_pie.c +++ b/net/sched/sch_fq_pie.c @@ -448,7 +448,7 @@ static int fq_pie_init(struct Qdisc *sch, struct nlattr *opt, if (err) goto init_failure; - q->flows = kvzalloc_objs(struct fq_pie_flow, q->flows_cnt, GFP_KERNEL); + q->flows = kvzalloc_objs(struct fq_pie_flow, q->flows_cnt); if (!q->flows) { err = -ENOMEM; goto init_failure; diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index ec4c8513e617..6706faba95b9 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -359,7 +359,7 @@ static int gred_offload_dump_stats(struct Qdisc *sch) unsigned int i; int ret; - hw_stats = kzalloc_obj(*hw_stats, GFP_KERNEL); + hw_stats = kzalloc_obj(*hw_stats); if (!hw_stats) return -ENOMEM; @@ -700,7 +700,7 @@ static int gred_change(struct Qdisc *sch, struct nlattr *opt, prio = ctl->prio; } - prealloc = kzalloc_obj(*prealloc, GFP_KERNEL); + prealloc = kzalloc_obj(*prealloc); sch_tree_lock(sch); err = gred_change_vq(sch, ctl->DP, ctl, prio, stab, max_P, &prealloc, @@ -757,7 +757,7 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt, * psched_mtu(qdisc_dev(sch)); if (qdisc_dev(sch)->netdev_ops->ndo_setup_tc) { - table->opt = kzalloc_obj(*table->opt, GFP_KERNEL); + table->opt = kzalloc_obj(*table->opt); if (!table->opt) return -ENOMEM; } diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 3f08daae26d8..b5657ffbbf84 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -1025,7 +1025,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, if (rsc == NULL && fsc == NULL) return -EINVAL; - cl = kzalloc_obj(struct hfsc_class, GFP_KERNEL); + cl = kzalloc_obj(struct hfsc_class); if (cl == NULL) return -ENOBUFS; diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 7b34e40d4bd2..0926a9ccfa2d 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1845,7 +1845,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, goto failure; } err = -ENOBUFS; - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) goto failure; diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index e61e53e3711f..9f822fee113d 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -249,7 +249,7 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt, q->max_bands = qdisc_dev(sch)->num_tx_queues; - q->queues = kzalloc_objs(struct Qdisc *, q->max_bands, GFP_KERNEL); + q->queues = kzalloc_objs(struct Qdisc *, q->max_bands); if (!q->queues) return -ENOBUFS; for (i = 0; i < q->max_bands; i++) diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index 6eb71d3f03dd..699e45873f86 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -476,7 +476,7 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, } /* create and init new class */ - cl = kzalloc_obj(struct qfq_class, GFP_KERNEL); + cl = kzalloc_obj(struct qfq_class); if (cl == NULL) return -ENOBUFS; @@ -508,7 +508,7 @@ set_change_agg: new_agg = qfq_find_agg(q, lmax, weight); if (new_agg == NULL) { /* create new aggregate */ sch_tree_unlock(sch); - new_agg = kzalloc_obj(*new_agg, GFP_KERNEL); + new_agg = kzalloc_obj(*new_agg); if (new_agg == NULL) { err = -ENOBUFS; gen_kill_estimator(&cl->rate_est); diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 31ee70314431..503d7d3ca081 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -668,7 +668,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt, ctl_v1->Wlog, ctl_v1->Scell_log, NULL)) return -EINVAL; if (ctl_v1 && ctl_v1->qth_min) { - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (!p) return -ENOMEM; } diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 31e59e875932..2e42a6801d5b 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1103,7 +1103,7 @@ static int parse_sched_list(struct taprio_sched *q, struct nlattr *list, continue; } - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { NL_SET_ERR_MSG(extack, "Not enough memory for entry"); return -ENOMEM; @@ -1870,7 +1870,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, if (err) return err; - new_admin = kzalloc_obj(*new_admin, GFP_KERNEL); + new_admin = kzalloc_obj(*new_admin); if (!new_admin) { NL_SET_ERR_MSG(extack, "Not enough memory for a new schedule"); return -ENOMEM; @@ -2091,7 +2091,7 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, return -EOPNOTSUPP; } - q->qdiscs = kzalloc_objs(q->qdiscs[0], dev->num_tx_queues, GFP_KERNEL); + q->qdiscs = kzalloc_objs(q->qdiscs[0], dev->num_tx_queues); if (!q->qdiscs) return -ENOMEM; diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 0723cbdbc366..828a59b8e7bf 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -1538,7 +1538,7 @@ static __init int sctp_init(void) /* Allocate and initialize the endpoint hash table. */ sctp_ep_hashsize = 64; sctp_ep_hashtable = - kmalloc_objs(struct sctp_hashbucket, 64, GFP_KERNEL); + kmalloc_objs(struct sctp_hashbucket, 64); if (!sctp_ep_hashtable) { pr_err("Failed endpoint_hash alloc\n"); status = -ENOMEM; diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 03636bed60ff..c2247793c88b 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -166,7 +166,7 @@ int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid) struct sctp_stream_out_ext *soute; int ret; - soute = kzalloc_obj(*soute, GFP_KERNEL); + soute = kzalloc_obj(*soute); if (!soute) return -ENOMEM; SCTP_SO(stream, sid)->ext = soute; diff --git a/net/shaper/shaper.c b/net/shaper/shaper.c index ca7a6167702d..005bfc766e22 100644 --- a/net/shaper/shaper.c +++ b/net/shaper/shaper.c @@ -272,7 +272,7 @@ net_shaper_hierarchy_setup(struct net_shaper_binding *binding) if (hierarchy) return hierarchy; - hierarchy = kmalloc_obj(*hierarchy, GFP_KERNEL); + hierarchy = kmalloc_obj(*hierarchy); if (!hierarchy) return NULL; @@ -329,7 +329,7 @@ static int net_shaper_pre_insert(struct net_shaper_binding *binding, id_allocated = true; } - cur = kzalloc_obj(*cur, GFP_KERNEL); + cur = kzalloc_obj(*cur); if (!cur) { ret = -ENOMEM; goto free_id; @@ -1033,7 +1033,7 @@ static int net_shaper_pre_del_node(struct net_shaper_binding *binding, return -EINVAL; } - leaves = kzalloc_objs(struct net_shaper, shaper->leaves, GFP_KERNEL); + leaves = kzalloc_objs(struct net_shaper, shaper->leaves); if (!leaves) return -ENOMEM; diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 242101f269c3..7072556b38f6 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -1195,7 +1195,7 @@ void smc_fill_gid_list(struct smc_link_group *lgr, memset(gidlist, 0, sizeof(*gidlist)); memcpy(gidlist->list[gidlist->len++], known_gid, SMC_GID_SIZE); - alt_ini = kzalloc_obj(*alt_ini, GFP_KERNEL); + alt_ini = kzalloc_obj(*alt_ini); if (!alt_ini) goto out; @@ -1522,7 +1522,7 @@ static int __smc_connect(struct smc_sock *smc) return smc_connect_decline_fallback(smc, SMC_CLC_DECL_IPSEC, version); - ini = kzalloc_obj(*ini, GFP_KERNEL); + ini = kzalloc_obj(*ini); if (!ini) return smc_connect_decline_fallback(smc, SMC_CLC_DECL_MEM, version); @@ -2470,7 +2470,7 @@ static void smc_listen_work(struct work_struct *work) /* do inband token exchange - * wait for and receive SMC Proposal CLC message */ - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) { rc = SMC_CLC_DECL_MEM; goto out_decl; @@ -2490,7 +2490,7 @@ static void smc_listen_work(struct work_struct *work) goto out_decl; } - ini = kzalloc_obj(*ini, GFP_KERNEL); + ini = kzalloc_obj(*ini); if (!ini) { rc = SMC_CLC_DECL_MEM; goto out_decl; diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c index 992fd2b9f05f..c38fc7bf0a7e 100644 --- a/net/smc/smc_clc.c +++ b/net/smc/smc_clc.c @@ -88,7 +88,7 @@ static int smc_clc_ueid_add(char *ueid) return -EINVAL; /* add a new ueid entry to the ueid table if there isn't one */ - new_ueid = kzalloc_obj(*new_ueid, GFP_KERNEL); + new_ueid = kzalloc_obj(*new_ueid); if (!new_ueid) return -ENOMEM; memcpy(new_ueid->eid, ueid, SMC_MAX_EID_LEN); @@ -861,7 +861,7 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini) struct kvec vec[8]; struct msghdr msg; - pclc = kzalloc_obj(*pclc, GFP_KERNEL); + pclc = kzalloc_obj(*pclc); if (!pclc) return -ENOMEM; diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 50d01a573042..e2d083daeb7e 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -905,7 +905,7 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini) } } - lgr = kzalloc_obj(*lgr, GFP_KERNEL); + lgr = kzalloc_obj(*lgr); if (!lgr) { rc = SMC_CLC_DECL_MEM; goto ism_put_vlan; @@ -2320,7 +2320,7 @@ static struct smc_buf_desc *smcr_new_buf_create(struct smc_link_group *lgr, struct smc_buf_desc *buf_desc; /* try to alloc a new buffer */ - buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc); if (!buf_desc) return ERR_PTR(-ENOMEM); @@ -2394,7 +2394,7 @@ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr, int rc; /* try to alloc a new DMB */ - buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc); if (!buf_desc) return ERR_PTR(-ENOMEM); if (is_dmb) { @@ -2578,7 +2578,7 @@ int smcd_buf_attach(struct smc_sock *smc) struct smc_buf_desc *buf_desc; int rc; - buf_desc = kzalloc_obj(*buf_desc, GFP_KERNEL); + buf_desc = kzalloc_obj(*buf_desc); if (!buf_desc) return -ENOMEM; diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index 5a1384126f91..9bb495707445 100644 --- a/net/smc/smc_ib.c +++ b/net/smc/smc_ib.c @@ -944,7 +944,7 @@ static int smc_ib_add_dev(struct ib_device *ibdev) if (ibdev->node_type != RDMA_NODE_IB_CA) return -EOPNOTSUPP; - smcibdev = kzalloc_obj(*smcibdev, GFP_KERNEL); + smcibdev = kzalloc_obj(*smcibdev); if (!smcibdev) return -ENOMEM; diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index 4ee7362e91c5..e0dba2c7b6e3 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c @@ -142,7 +142,7 @@ int smc_ism_get_vlan(struct smcd_dev *smcd, unsigned short vlanid) return -EOPNOTSUPP; /* create new vlan entry, in case we need it */ - new_vlan = kzalloc_obj(*new_vlan, GFP_KERNEL); + new_vlan = kzalloc_obj(*new_vlan); if (!new_vlan) return -ENOMEM; new_vlan->vlanid = vlanid; @@ -467,10 +467,10 @@ static struct smcd_dev *smcd_alloc_dev(const char *name, int max_dmbs) { struct smcd_dev *smcd; - smcd = kzalloc_obj(*smcd, GFP_KERNEL); + smcd = kzalloc_obj(*smcd); if (!smcd) return NULL; - smcd->conn = kzalloc_objs(struct smc_connection *, max_dmbs, GFP_KERNEL); + smcd->conn = kzalloc_objs(struct smc_connection *, max_dmbs); if (!smcd->conn) goto free_smcd; diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index f82d5fc7f068..954b2ff1815c 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c @@ -1040,7 +1040,7 @@ int smc_llc_cli_add_link(struct smc_link *link, struct smc_llc_qentry *qentry) if (!llc->qp_mtu) goto out_reject; - ini = kzalloc_obj(*ini, GFP_KERNEL); + ini = kzalloc_obj(*ini); if (!ini) { rc = -ENOMEM; goto out_reject; @@ -1180,7 +1180,7 @@ static void smc_llc_cli_add_link_invite(struct smc_link *link, if (lgr->type == SMC_LGR_SINGLE && lgr->max_links <= 1) goto out; - ini = kzalloc_obj(*ini, GFP_KERNEL); + ini = kzalloc_obj(*ini); if (!ini) goto out; @@ -1419,7 +1419,7 @@ int smc_llc_srv_add_link(struct smc_link *link, req_qentry->msg.raw.hdr.common.llc_type == SMC_LLC_REQ_ADD_LINK) send_req_add_link_resp = true; - ini = kzalloc_obj(*ini, GFP_KERNEL); + ini = kzalloc_obj(*ini); if (!ini) { rc = -ENOMEM; goto out; diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index 239da54ba01c..63e286e2dfaa 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c @@ -368,7 +368,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, /* add a new netdev entry to the pnet table if there isn't one */ rc = -ENOMEM; - new_pe = kzalloc_obj(*new_pe, GFP_KERNEL); + new_pe = kzalloc_obj(*new_pe); if (!new_pe) goto out_put; new_pe->type = SMC_PNET_ETH; @@ -445,7 +445,7 @@ static int smc_pnet_add_ib(struct smc_pnettable *pnettable, char *ib_name, return -EEXIST; /* add a new ib entry to the pnet table if there isn't one */ - new_pe = kzalloc_obj(*new_pe, GFP_KERNEL); + new_pe = kzalloc_obj(*new_pe); if (!new_pe) return -ENOMEM; new_pe->type = SMC_PNET_IB; @@ -747,7 +747,7 @@ static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid) struct smc_net *sn = net_generic(net, smc_net_id); struct smc_pnetids_ndev_entry *pe, *pi; - pe = kzalloc_obj(*pe, GFP_KERNEL); + pe = kzalloc_obj(*pe); if (!pe) return -ENOMEM; diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c index bde9bc1ed4c0..d833e36f7fd4 100644 --- a/net/smc/smc_rx.c +++ b/net/smc/smc_rx.c @@ -161,17 +161,17 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len, nr_pages = !lgr->is_smcd && smc->conn.rmb_desc->is_vm ? PAGE_ALIGN(len + offset) / PAGE_SIZE : 1; - pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL); + pages = kzalloc_objs(*pages, nr_pages); if (!pages) goto out; - partial = kzalloc_objs(*partial, nr_pages, GFP_KERNEL); + partial = kzalloc_objs(*partial, nr_pages); if (!partial) goto out_page; - priv = kzalloc_objs(*priv, nr_pages, GFP_KERNEL); + priv = kzalloc_objs(*priv, nr_pages); if (!priv) goto out_part; for (i = 0; i < nr_pages; i++) { - priv[i] = kzalloc_obj(**priv, GFP_KERNEL); + priv[i] = kzalloc_obj(**priv); if (!priv[i]) goto out_priv; } diff --git a/net/smc/smc_stats.c b/net/smc/smc_stats.c index aeb462dbbb2c..59db611821f6 100644 --- a/net/smc/smc_stats.c +++ b/net/smc/smc_stats.c @@ -20,7 +20,7 @@ int smc_stats_init(struct net *net) { - net->smc.fback_rsn = kzalloc_obj(*net->smc.fback_rsn, GFP_KERNEL); + net->smc.fback_rsn = kzalloc_obj(*net->smc.fback_rsn); if (!net->smc.fback_rsn) goto err_fback; net->smc.smc_stats = alloc_percpu(struct smc_stats); @@ -285,7 +285,7 @@ int smc_nl_get_stats(struct sk_buff *skb, attrs = nla_nest_start(skb, SMC_GEN_STATS); if (!attrs) goto errnest; - stats = kzalloc_obj(*stats, GFP_KERNEL); + stats = kzalloc_obj(*stats); if (!stats) goto erralloc; size = sizeof(*stats) / sizeof(u64); diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c index bad014f353b3..b423abb4210d 100644 --- a/net/smc/smc_wr.c +++ b/net/smc/smc_wr.c @@ -787,7 +787,7 @@ int smc_wr_alloc_link_mem(struct smc_link *link) goto no_mem_wr_tx_pends; if (link->lgr->smc_version == SMC_V2) { - link->wr_tx_v2_ib = kzalloc_obj(*link->wr_tx_v2_ib, GFP_KERNEL); + link->wr_tx_v2_ib = kzalloc_obj(*link->wr_tx_v2_ib); if (!link->wr_tx_v2_ib) goto no_mem_tx_compl; link->wr_tx_v2_sge = kzalloc_obj(*link->wr_tx_v2_sge, diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index fb33a4d0cdc7..68c0595ea2fd 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -290,12 +290,12 @@ rpcauth_init_credcache(struct rpc_auth *auth) struct rpc_cred_cache *new; unsigned int hashsize; - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) goto out_nocache; new->hashbits = auth_hashbits; hashsize = 1U << new->hashbits; - new->hashtable = kzalloc_objs(new->hashtable[0], hashsize, GFP_KERNEL); + new->hashtable = kzalloc_objs(new->hashtable[0], hashsize); if (!new->hashtable) goto out_nohashtbl; spin_lock_init(&new->lock); diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index f8a0d6386635..932908c1ef67 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -164,7 +164,7 @@ gss_alloc_context(void) { struct gss_cl_ctx *ctx; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (ctx != NULL) { ctx->gc_proc = RPC_GSS_PROC_DATA; ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ @@ -529,7 +529,7 @@ gss_alloc_msg(struct gss_auth *gss_auth, int vers; int err = -ENOMEM; - gss_msg = kzalloc_obj(*gss_msg, GFP_KERNEL); + gss_msg = kzalloc_obj(*gss_msg); if (gss_msg == NULL) goto err; vers = get_pipe_version(gss_auth->net); @@ -914,7 +914,7 @@ static struct gss_pipe *gss_pipe_alloc(struct rpc_clnt *clnt, struct gss_pipe *p; int err = -ENOMEM; - p = kmalloc_obj(*p, GFP_KERNEL); + p = kmalloc_obj(*p); if (p == NULL) goto err; p->pipe = rpc_mkpipe_data(upcall_ops, RPC_PIPE_WAIT_FOR_OPEN); @@ -1029,7 +1029,7 @@ gss_create_new(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) if (!try_module_get(THIS_MODULE)) return ERR_PTR(err); - if (!(gss_auth = kmalloc_obj(*gss_auth, GFP_KERNEL))) + if (!(gss_auth = kmalloc_obj(*gss_auth))) goto out_dec; INIT_HLIST_NODE(&gss_auth->hash); gss_auth->target_name = NULL; @@ -1246,7 +1246,7 @@ gss_dup_cred(struct gss_auth *gss_auth, struct gss_cred *gss_cred) struct gss_cred *new; /* Make a copy of the cred so that we can reference count it */ - new = kzalloc_obj(*gss_cred, GFP_KERNEL); + new = kzalloc_obj(*gss_cred); if (new) { struct auth_cred acred = { .cred = gss_cred->gc_base.cr_cred, diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c index e02e6d4a3185..0fa4778620d9 100644 --- a/net/sunrpc/auth_gss/gss_rpc_upcall.c +++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c @@ -214,7 +214,7 @@ static int gssp_alloc_receive_pages(struct gssx_arg_accept_sec_context *arg) unsigned int i; arg->npages = DIV_ROUND_UP(NGROUPS_MAX * 4, PAGE_SIZE); - arg->pages = kzalloc_objs(struct page *, arg->npages, GFP_KERNEL); + arg->pages = kzalloc_objs(struct page *, arg->npages); if (!arg->pages) return -ENOMEM; for (i = 0; i < arg->npages; i++) { diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c index e1e01965ef58..fceee648d545 100644 --- a/net/sunrpc/auth_gss/gss_rpc_xdr.c +++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c @@ -244,11 +244,11 @@ static int gssx_dec_option_array(struct xdr_stream *xdr, /* we recognize only 1 currently: CREDS_VALUE */ oa->count = 1; - oa->data = kmalloc_obj(struct gssx_option, GFP_KERNEL); + oa->data = kmalloc_obj(struct gssx_option); if (!oa->data) return -ENOMEM; - creds = kzalloc_obj(struct svc_cred, GFP_KERNEL); + creds = kzalloc_obj(struct svc_cred); if (!creds) { err = -ENOMEM; goto free_oa; diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 411297c9527d..161d02cc1c2c 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -197,7 +197,7 @@ static void update_rsi(struct cache_head *cnew, struct cache_head *citem) static struct cache_head *rsi_alloc(void) { - struct rsi *rsii = kmalloc_obj(*rsii, GFP_KERNEL); + struct rsi *rsii = kmalloc_obj(*rsii); if (rsii) return &rsii->h; else @@ -449,7 +449,7 @@ update_rsc(struct cache_head *cnew, struct cache_head *ctmp) static struct cache_head * rsc_alloc(void) { - struct rsc *rsci = kmalloc_obj(*rsci, GFP_KERNEL); + struct rsc *rsci = kmalloc_obj(*rsci); if (rsci) return &rsci->h; else @@ -814,7 +814,7 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) struct auth_domain *test; int stat = -ENOMEM; - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (!new) goto out; kref_init(&new->h.ref); @@ -1069,7 +1069,7 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp, goto out_denied_free; pages = DIV_ROUND_UP(inlen, PAGE_SIZE); - in_token->pages = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); + in_token->pages = kzalloc_objs(struct page *, pages + 1); if (!in_token->pages) goto out_denied_free; in_token->page_base = 0; @@ -1631,7 +1631,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp) rqstp->rq_auth_stat = rpc_autherr_failed; if (!svcdata) - svcdata = kmalloc_obj(*svcdata, GFP_KERNEL); + svcdata = kmalloc_obj(*svcdata); if (!svcdata) goto auth_err; rqstp->rq_auth_data = svcdata; diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 5129f3dace8c..9b27b533a3c0 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1038,7 +1038,7 @@ static int cache_open(struct inode *inode, struct file *filp, return -EACCES; nonseekable_open(inode, filp); if (filp->f_mode & FMODE_READ) { - rp = kmalloc_obj(*rp, GFP_KERNEL); + rp = kmalloc_obj(*rp); if (!rp) { module_put(cd->owner); return -ENOMEM; @@ -1225,7 +1225,7 @@ static int cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) if (!buf) return -EAGAIN; - crq = kmalloc_obj(*crq, GFP_KERNEL); + crq = kmalloc_obj(*crq); if (!crq) { kfree(buf); return -EAGAIN; diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index f6e086b62053..bc8ca470718b 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -374,7 +374,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, goto out_err; err = -ENOMEM; - clnt = kzalloc_obj(*clnt, GFP_KERNEL); + clnt = kzalloc_obj(*clnt); if (!clnt) goto out_err; clnt->cl_parent = parent ? : clnt; @@ -2976,7 +2976,7 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, return -EINVAL; } - data = kmalloc_obj(*data, GFP_KERNEL); + data = kmalloc_obj(*data); if (!data) return -ENOMEM; data->xps = xprt_switch_get(xps); diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index a4b3c51be0f3..9d349cfbc483 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -511,7 +511,7 @@ struct rpc_pipe *rpc_mkpipe_data(const struct rpc_pipe_ops *ops, int flags) { struct rpc_pipe *pipe; - pipe = kzalloc_obj(struct rpc_pipe, GFP_KERNEL); + pipe = kzalloc_obj(struct rpc_pipe); if (!pipe) return ERR_PTR(-ENOMEM); init_pipe(pipe); diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 36308711e0e9..7093e18ac26c 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -126,7 +126,7 @@ struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) struct rpc_iostats *stats; int i; - stats = kzalloc_objs(*stats, clnt->cl_maxproc, GFP_KERNEL); + stats = kzalloc_objs(*stats, clnt->cl_maxproc); if (stats) { for (i = 0; i < clnt->cl_maxproc; i++) spin_lock_init(&stats[i].om_lock); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index bc160368a7dc..d8ccb8e4b5c2 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -488,7 +488,7 @@ __svc_create(struct svc_program *prog, int nprogs, struct svc_stat *stats, unsigned int xdrsize; unsigned int i; - if (!(serv = kzalloc_obj(*serv, GFP_KERNEL))) + if (!(serv = kzalloc_obj(*serv))) return NULL; serv->sv_name = prog->pg_name; serv->sv_programs = prog; @@ -523,7 +523,7 @@ __svc_create(struct svc_program *prog, int nprogs, struct svc_stat *stats, serv->sv_nrpools = npools; serv->sv_pools = - kzalloc_objs(struct svc_pool, serv->sv_nrpools, GFP_KERNEL); + kzalloc_objs(struct svc_pool, serv->sv_nrpools); if (!serv->sv_pools) { kfree(serv); return NULL; diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 7f952d9201f5..3be69c145d2a 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -72,7 +72,7 @@ struct auth_domain *unix_domain_find(char *name) return rv; } - new = kmalloc_obj(*new, GFP_KERNEL); + new = kmalloc_obj(*new); if (new == NULL) return NULL; kref_init(&new->h.ref); @@ -143,7 +143,7 @@ static void update(struct cache_head *cnew, struct cache_head *citem) } static struct cache_head *ip_map_alloc(void) { - struct ip_map *i = kmalloc_obj(*i, GFP_KERNEL); + struct ip_map *i = kmalloc_obj(*i); if (i) return &i->h; else @@ -458,7 +458,7 @@ static void unix_gid_update(struct cache_head *cnew, struct cache_head *citem) } static struct cache_head *unix_gid_alloc(void) { - struct unix_gid *g = kmalloc_obj(*g, GFP_KERNEL); + struct unix_gid *g = kmalloc_obj(*g); if (g) return &g->h; else diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c index ec6ddfa11f86..af8fac9cedd4 100644 --- a/net/sunrpc/sysfs.c +++ b/net/sunrpc/sysfs.c @@ -48,7 +48,7 @@ static struct kobject *rpc_sysfs_object_alloc(const char *name, { struct kobject *kobj; - kobj = kzalloc_obj(*kobj, GFP_KERNEL); + kobj = kzalloc_obj(*kobj); if (kobj) { kobj->kset = kset; if (kobject_init_and_add(kobj, &rpc_sysfs_object_type, @@ -397,7 +397,7 @@ static ssize_t rpc_sysfs_xprt_dstaddr_store(struct kobject *kobj, dst_addr = kstrndup(buf, buf_len, GFP_KERNEL); if (!dst_addr) goto out_err; - saved_addr = kzalloc_obj(*saved_addr, GFP_KERNEL); + saved_addr = kzalloc_obj(*saved_addr); if (!saved_addr) goto out_err_free; saved_addr->addr = @@ -663,7 +663,7 @@ static struct rpc_sysfs_client *rpc_sysfs_client_alloc(struct kobject *parent, { struct rpc_sysfs_client *p; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (p) { p->net = net; p->kobject.kset = rpc_sunrpc_kset; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 16f6989a0a2d..4fbb57a29704 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1829,7 +1829,7 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size, xprt_init(xprt, net); for (i = 0; i < num_prealloc; i++) { - req = kzalloc_obj(struct rpc_rqst, GFP_KERNEL); + req = kzalloc_obj(struct rpc_rqst); if (!req) goto out_free; list_add(&req->rq_list, &xprt->free); diff --git a/net/sunrpc/xprtrdma/ib_client.c b/net/sunrpc/xprtrdma/ib_client.c index e5b6dfaf01aa..de49ad02053d 100644 --- a/net/sunrpc/xprtrdma/ib_client.c +++ b/net/sunrpc/xprtrdma/ib_client.c @@ -108,7 +108,7 @@ static int rpcrdma_add_one(struct ib_device *device) { struct rpcrdma_device *rd; - rd = kzalloc_obj(*rd, GFP_KERNEL); + rd = kzalloc_obj(*rd); if (!rd) return -ENOMEM; diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index c7c7f08eee9a..76a1585d3f6b 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -692,7 +692,7 @@ int tipc_bcast_init(struct net *net) struct tipc_bc_base *bb = NULL; struct tipc_link *l = NULL; - bb = kzalloc_obj(*bb, GFP_KERNEL); + bb = kzalloc_obj(*bb); if (!bb) goto enomem; tn->bcbase = bb; diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index abd191a3ac4a..d3046a39ff72 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -560,7 +560,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey, break; } - tfm_entry = kmalloc_obj(*tfm_entry, GFP_KERNEL); + tfm_entry = kmalloc_obj(*tfm_entry); if (unlikely(!tfm_entry)) { crypto_free_aead(tfm); err = -ENOMEM; diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index ec0ac85ca70b..8e129cf52245 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -888,7 +888,7 @@ int tipc_nametbl_init(struct net *net) struct name_table *nt; int i; - nt = kzalloc_obj(*nt, GFP_KERNEL); + nt = kzalloc_obj(*nt); if (!nt) return -ENOMEM; diff --git a/net/tipc/socket.c b/net/tipc/socket.c index d52f700b5493..4c618c2b871d 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -3595,7 +3595,7 @@ int __tipc_dump_start(struct netlink_callback *cb, struct net *net) struct tipc_net *tn = tipc_net(net); if (!iter) { - iter = kmalloc_obj(*iter, GFP_KERNEL); + iter = kmalloc_obj(*iter); if (!iter) return -ENOMEM; diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 7a85ef064e4c..99c8eff9783e 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -346,7 +346,7 @@ static int tls_create_new_record(struct tls_offload_context_tx *offload_ctx, struct tls_record_info *record; skb_frag_t *frag; - record = kmalloc_obj(*record, GFP_KERNEL); + record = kmalloc_obj(*record); if (!record) return -ENOMEM; @@ -1040,7 +1040,7 @@ static struct tls_offload_context_tx *alloc_offload_ctx_tx(struct tls_context *c struct tls_offload_context_tx *offload_ctx; __be64 rcd_sn; - offload_ctx = kzalloc_obj(*offload_ctx, GFP_KERNEL); + offload_ctx = kzalloc_obj(*offload_ctx); if (!offload_ctx) return NULL; @@ -1110,7 +1110,7 @@ int tls_set_device_offload(struct sock *sk) memcpy(ctx->tx.iv + cipher_desc->salt, iv, cipher_desc->iv); memcpy(ctx->tx.rec_seq, rec_seq, cipher_desc->rec_seq); - start_marker_record = kmalloc_obj(*start_marker_record, GFP_KERNEL); + start_marker_record = kmalloc_obj(*start_marker_record); if (!start_marker_record) { rc = -ENOMEM; goto release_netdev; @@ -1224,7 +1224,7 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) goto release_lock; } - context = kzalloc_obj(*context, GFP_KERNEL); + context = kzalloc_obj(*context); if (!context) { rc = -ENOMEM; goto release_lock; diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 36bacedd6177..7877c238e758 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2698,7 +2698,7 @@ static struct tls_sw_context_tx *init_ctx_tx(struct tls_context *ctx, struct soc struct tls_sw_context_tx *sw_ctx_tx; if (!ctx->priv_ctx_tx) { - sw_ctx_tx = kzalloc_obj(*sw_ctx_tx, GFP_KERNEL); + sw_ctx_tx = kzalloc_obj(*sw_ctx_tx); if (!sw_ctx_tx) return NULL; } else { @@ -2719,7 +2719,7 @@ static struct tls_sw_context_rx *init_ctx_rx(struct tls_context *ctx) struct tls_sw_context_rx *sw_ctx_rx; if (!ctx->priv_ctx_rx) { - sw_ctx_rx = kzalloc_obj(*sw_ctx_rx, GFP_KERNEL); + sw_ctx_rx = kzalloc_obj(*sw_ctx_rx); if (!sw_ctx_rx) return NULL; } else { diff --git a/net/unix/garbage.c b/net/unix/garbage.c index a15e7eb50851..816e8fa2b062 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -288,7 +288,7 @@ int unix_prepare_fpl(struct scm_fp_list *fpl) return 0; for (i = 0; i < fpl->count_unix; i++) { - vertex = kmalloc_obj(*vertex, GFP_KERNEL); + vertex = kmalloc_obj(*vertex); if (!vertex) goto err; diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c index b1bf64b5cc97..069386a74557 100644 --- a/net/vmw_vsock/hyperv_transport.c +++ b/net/vmw_vsock/hyperv_transport.c @@ -444,7 +444,7 @@ static int hvs_sock_init(struct vsock_sock *vsk, struct vsock_sock *psk) struct hvsock *hvs; struct sock *sk = sk_vsock(vsk); - hvs = kzalloc_obj(*hvs, GFP_KERNEL); + hvs = kzalloc_obj(*hvs); if (!hvs) return -ENOMEM; @@ -655,7 +655,7 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg, BUILD_BUG_ON(sizeof(*send_buf) != HV_HYP_PAGE_SIZE); - send_buf = kmalloc_obj(*send_buf, GFP_KERNEL); + send_buf = kmalloc_obj(*send_buf); if (!send_buf) return -ENOMEM; diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index d6c07334bf94..77fe5b7b066c 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -805,7 +805,7 @@ static int virtio_vsock_probe(struct virtio_device *vdev) goto out; } - vsock = kzalloc_obj(*vsock, GFP_KERNEL); + vsock = kzalloc_obj(*vsock); if (!vsock) { ret = -ENOMEM; goto out; diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 925ed086058c..8a9fb23c6e85 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -920,7 +920,7 @@ int virtio_transport_do_socket_init(struct vsock_sock *vsk, { struct virtio_vsock_sock *vvs; - vvs = kzalloc_obj(*vvs, GFP_KERNEL); + vvs = kzalloc_obj(*vvs); if (!vvs) return -ENOMEM; diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 3e80639b7c08..4296ca1183f1 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -262,7 +262,7 @@ vmci_transport_alloc_send_control_pkt(struct sockaddr_vm *src, struct vmci_transport_packet *pkt; int err; - pkt = kmalloc_obj(*pkt, GFP_KERNEL); + pkt = kmalloc_obj(*pkt); if (!pkt) return -ENOMEM; @@ -1583,7 +1583,7 @@ static int vmci_transport_recv_connected(struct sock *sk, static int vmci_transport_socket_init(struct vsock_sock *vsk, struct vsock_sock *psk) { - vsk->trans = kmalloc_obj(struct vmci_transport, GFP_KERNEL); + vsk->trans = kmalloc_obj(struct vmci_transport); if (!vsk->trans) return -ENOMEM; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 33782370fbaf..e25a15b9267d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1615,7 +1615,7 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev, if (!have_key) return NULL; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) return ERR_PTR(-ENOMEM); @@ -3367,7 +3367,7 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, struct netlink_callback *cb, struct nl80211_dump_wiphy_state *state) { - struct nlattr **tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); + struct nlattr **tb = kzalloc_objs(*tb, NUM_NL80211_ATTR); int ret; if (!tb) @@ -3419,7 +3419,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) rtnl_lock(); if (!state) { - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { rtnl_unlock(); return -ENOMEM; @@ -6702,7 +6702,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]) != NL80211_SMPS_OFF) return -EOPNOTSUPP; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -6995,7 +6995,7 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info) if (!wdev->links[link_id].ap.beacon_interval) return -EINVAL; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -7985,7 +7985,7 @@ static int nl80211_dump_station(struct sk_buff *skb, for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { sinfo.links[i] = - kzalloc_obj(*sinfo.links[0], GFP_KERNEL); + kzalloc_obj(*sinfo.links[0]); if (!sinfo.links[i]) { err = -ENOMEM; goto out_err; @@ -8049,7 +8049,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { - sinfo.links[i] = kzalloc_obj(*sinfo.links[0], GFP_KERNEL); + sinfo.links[i] = kzalloc_obj(*sinfo.links[0]); if (!sinfo.links[i]) { cfg80211_sinfo_release_content(&sinfo); return -ENOMEM; @@ -11520,7 +11520,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) if (err) goto free; - csa_attrs = kzalloc_objs(*csa_attrs, NL80211_ATTR_MAX + 1, GFP_KERNEL); + csa_attrs = kzalloc_objs(*csa_attrs, NL80211_ATTR_MAX + 1); if (!csa_attrs) { err = -ENOMEM; goto free; @@ -11780,7 +11780,7 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) bool dump_include_use_data; int err; - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -11920,7 +11920,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) int res; bool radio_stats; - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -13111,7 +13111,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, goto out_err; } } else { - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) { err = -ENOMEM; goto out_err; @@ -14935,7 +14935,7 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev, struct nlattr **tb; int err; - tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); + tb = kzalloc_objs(*tb, NUM_NL80211_ATTR); if (!tb) return -ENOMEM; @@ -15538,7 +15538,7 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info) if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) return -EOPNOTSUPP; - nreg = kzalloc_obj(*nreg, GFP_KERNEL); + nreg = kzalloc_obj(*nreg); if (!nreg) return -ENOMEM; @@ -15895,7 +15895,7 @@ static int handle_nan_filter(struct nlattr *attr_filter, BUILD_BUG_ON(sizeof(*func->rx_filters) != sizeof(*func->tx_filters)); - filter = kzalloc_objs(*func->rx_filters, n_entries, GFP_KERNEL); + filter = kzalloc_objs(*func->rx_filters, n_entries); if (!filter) return -ENOMEM; @@ -15955,7 +15955,7 @@ static int nl80211_nan_add_func(struct sk_buff *skb, if (err) return err; - func = kzalloc_obj(*func, GFP_KERNEL); + func = kzalloc_obj(*func); if (!func) return -ENOMEM; @@ -16597,7 +16597,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, return 0; } - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -16828,7 +16828,7 @@ static int nl80211_set_qos_map(struct sk_buff *skb, if (len % 2) return -EINVAL; - qos_map = kzalloc_obj(struct cfg80211_qos_map, GFP_KERNEL); + qos_map = kzalloc_obj(struct cfg80211_qos_map); if (!qos_map) return -ENOMEM; @@ -17528,7 +17528,7 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info) if (err) return err; - tb = kzalloc_objs(*tb, NL80211_ATTR_MAX + 1, GFP_KERNEL); + tb = kzalloc_objs(*tb, NL80211_ATTR_MAX + 1); if (!tb) return -ENOMEM; diff --git a/net/wireless/of.c b/net/wireless/of.c index 35a3bcd84b6f..60a864465331 100644 --- a/net/wireless/of.c +++ b/net/wireless/of.c @@ -98,7 +98,7 @@ void wiphy_read_of_freq_limits(struct wiphy *wiphy) } n_freq_limits = len / sizeof(u32) / 2; - freq_limits = kzalloc_objs(*freq_limits, n_freq_limits, GFP_KERNEL); + freq_limits = kzalloc_objs(*freq_limits, n_freq_limits); if (!freq_limits) { err = -ENOMEM; goto out_kfree; diff --git a/net/wireless/reg.c b/net/wireless/reg.c index d6f3282fe986..4d7479ffda36 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -509,7 +509,7 @@ static int reg_schedule_apply(const struct ieee80211_regdomain *regdom) { struct reg_regdb_apply_request *request; - request = kzalloc_obj(struct reg_regdb_apply_request, GFP_KERNEL); + request = kzalloc_obj(struct reg_regdb_apply_request); if (!request) { kfree(regdom); return -ENOMEM; @@ -1098,7 +1098,7 @@ int reg_reload_regdb(void) /* reset regulatory domain */ current_regdomain = get_cfg80211_regdom(); - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) { err = -ENOMEM; goto out_unlock; @@ -3222,7 +3222,7 @@ static int regulatory_hint_core(const char *alpha2) { struct regulatory_request *request; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3248,7 +3248,7 @@ int regulatory_hint_user(const char *alpha2, if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2)) return -EINVAL; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3318,7 +3318,7 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3351,7 +3351,7 @@ void regulatory_hint_country_ie(struct wiphy *wiphy, enum nl80211_band band, if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN) return; - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return; diff --git a/net/wireless/sme.c b/net/wireless/sme.c index cb1a75fda5ca..5b21432450d5 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -570,7 +570,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, if (wdev->conn) return -EINPROGRESS; - wdev->conn = kzalloc_obj(*wdev->conn, GFP_KERNEL); + wdev->conn = kzalloc_obj(*wdev->conn); if (!wdev->conn) return -ENOMEM; diff --git a/net/wireless/tests/util.c b/net/wireless/tests/util.c index 6f870b06307d..118f7fb4226d 100644 --- a/net/wireless/tests/util.c +++ b/net/wireless/tests/util.c @@ -17,7 +17,7 @@ int t_wiphy_init(struct kunit_resource *resource, void *ctx) struct wiphy *wiphy; struct t_wiphy_priv *priv; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); KUNIT_ASSERT_NOT_NULL(test, ops); wiphy = wiphy_new_nm(ops, sizeof(*priv), "kunit"); diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 3ce845cd1936..55783a7f51c2 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -414,7 +414,7 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev, * to do it first in case the allocation fails. Don't use wext. */ if (!wdev->wext.keys) { - wdev->wext.keys = kzalloc_obj(*wdev->wext.keys, GFP_KERNEL); + wdev->wext.keys = kzalloc_obj(*wdev->wext.keys); if (!wdev->wext.keys) return -ENOMEM; for (i = 0; i < 4; i++) diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 4c94ec312d75..066ce07c506d 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c @@ -250,7 +250,7 @@ struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr) struct xdp_umem *umem; int err; - umem = kzalloc_obj(*umem, GFP_KERNEL); + umem = kzalloc_obj(*umem); if (!umem) return ERR_PTR(-ENOMEM); diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index a8f932b28ee3..c5015802f946 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -63,7 +63,7 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs, if (!pool) goto out; - pool->heads = kvzalloc_objs(*pool->heads, umem->chunks, GFP_KERNEL); + pool->heads = kvzalloc_objs(*pool->heads, umem->chunks); if (!pool->heads) goto out; @@ -328,7 +328,7 @@ static struct xsk_dma_map *xp_create_dma_map(struct device *dev, struct net_devi { struct xsk_dma_map *dma_map; - dma_map = kzalloc_obj(*dma_map, GFP_KERNEL); + dma_map = kzalloc_obj(*dma_map); if (!dma_map) return NULL; diff --git a/net/xdp/xsk_queue.c b/net/xdp/xsk_queue.c index ef089b9c4fc8..4dd01b7d858e 100644 --- a/net/xdp/xsk_queue.c +++ b/net/xdp/xsk_queue.c @@ -26,7 +26,7 @@ struct xsk_queue *xskq_create(u32 nentries, bool umem_queue) struct xsk_queue *q; size_t size; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index 3f6eda9364ec..61f1cef89bc1 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -465,7 +465,7 @@ static int espintcp_init_sk(struct sock *sk) if (sk->sk_user_data) return -EBUSY; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 35f8236059a7..5f38dff16177 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -336,7 +336,7 @@ int ipcomp_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) } err = -ENOMEM; - ipcd = kzalloc_obj(*ipcd, GFP_KERNEL); + ipcd = kzalloc_obj(*ipcd); if (!ipcd) goto out; diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c index 92b9a5b80804..5c9e56e525f2 100644 --- a/net/xfrm/xfrm_iptfs.c +++ b/net/xfrm/xfrm_iptfs.c @@ -2678,7 +2678,7 @@ static int iptfs_init_state(struct xfrm_state *x) /* We have arrived here from xfrm_state_clone() */ xtfs = x->mode_data; } else { - xtfs = kzalloc_obj(*xtfs, GFP_KERNEL); + xtfs = kzalloc_obj(*xtfs); if (!xtfs) return -ENOMEM; } diff --git a/scripts/livepatch/init.c b/scripts/livepatch/init.c index bbfd2e479099..f14d8c8fb35f 100644 --- a/scripts/livepatch/init.c +++ b/scripts/livepatch/init.c @@ -28,7 +28,7 @@ static int __init livepatch_mod_init(void) goto err; } - patch = kzalloc_obj(*patch, GFP_KERNEL); + patch = kzalloc_obj(*patch); if (!patch) { ret = -ENOMEM; goto err; diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 283e622a7ccc..2f84bd23edb6 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -570,7 +570,7 @@ static ssize_t ns_revision_read(struct file *file, char __user *buf, static int ns_revision_open(struct inode *inode, struct file *file) { - struct aa_revision *rev = kzalloc_obj(*rev, GFP_KERNEL); + struct aa_revision *rev = kzalloc_obj(*rev); if (!rev) return -ENOMEM; diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 92ea1bc7b9e0..c1d42fc72fdb 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -2468,7 +2468,7 @@ static int __init aa_setup_dfa_engine(void) goto fail; } nullpdb->dfa = aa_get_dfa(nulldfa); - nullpdb->perms = kzalloc_objs(struct aa_perms, 2, GFP_KERNEL); + nullpdb->perms = kzalloc_objs(struct aa_perms, 2); if (!nullpdb->perms) goto fail; nullpdb->size = 2; diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 5ee25d4016e0..8fa0a1494acd 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -301,7 +301,7 @@ struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags) int error = -ENOMEM; char *data = blob; struct table_header *table = NULL; - struct aa_dfa *dfa = kzalloc_obj(struct aa_dfa, GFP_KERNEL); + struct aa_dfa *dfa = kzalloc_obj(struct aa_dfa); if (!dfa) goto fail; diff --git a/security/apparmor/policy_compat.c b/security/apparmor/policy_compat.c index 928dbb10cec1..5fc16d56fbf4 100644 --- a/security/apparmor/policy_compat.c +++ b/security/apparmor/policy_compat.c @@ -158,7 +158,7 @@ static struct aa_perms *compute_fperms(struct aa_dfa *dfa, state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - table = kvzalloc_objs(struct aa_perms, state_count * 2, GFP_KERNEL); + table = kvzalloc_objs(struct aa_perms, state_count * 2); if (!table) return NULL; *size = state_count * 2; @@ -182,7 +182,7 @@ static struct aa_perms *compute_xmatch_perms(struct aa_dfa *xmatch, state_count = xmatch->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - perms = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL); + perms = kvzalloc_objs(struct aa_perms, state_count); if (!perms) return NULL; *size = state_count; @@ -257,7 +257,7 @@ static struct aa_perms *compute_perms(struct aa_dfa *dfa, u32 version, state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; /* DFAs are restricted from having a state_count of less than 2 */ - table = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL); + table = kvzalloc_objs(struct aa_perms, state_count); if (!table) return NULL; *size = state_count; diff --git a/security/apparmor/policy_ns.c b/security/apparmor/policy_ns.c index 099b71957ccb..01b653a3609b 100644 --- a/security/apparmor/policy_ns.c +++ b/security/apparmor/policy_ns.c @@ -106,7 +106,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name) { struct aa_ns *ns; - ns = kzalloc_obj(*ns, GFP_KERNEL); + ns = kzalloc_obj(*ns); AA_DEBUG(DEBUG_POLICY, "%s(%p)\n", __func__, ns); if (!ns) return NULL; diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 9001c6ebc235..2b7ccc4e3853 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -145,7 +145,7 @@ struct aa_loaddata *aa_loaddata_alloc(size_t size) { struct aa_loaddata *d; - d = kzalloc_obj(*d, GFP_KERNEL); + d = kzalloc_obj(*d); if (d == NULL) return ERR_PTR(-ENOMEM); d->data = kvzalloc(size, GFP_KERNEL); @@ -528,7 +528,7 @@ static int unpack_strs_table(struct aa_ext *e, const char *name, bool multi, * for size check here */ goto fail; - table = kzalloc_objs(struct aa_str_table_ent, size, GFP_KERNEL); + table = kzalloc_objs(struct aa_str_table_ent, size); if (!table) { error = -ENOMEM; goto fail; @@ -809,7 +809,7 @@ static int unpack_tag_headers(struct aa_ext *e, struct aa_tags_struct *tags) if (!aa_unpack_array(e, "hdrs", &size)) goto fail_reset; - hdrs = kzalloc_objs(struct aa_tags_header, size, GFP_KERNEL); + hdrs = kzalloc_objs(struct aa_tags_header, size); if (!hdrs) { error = -ENOMEM; goto fail_reset; @@ -922,7 +922,7 @@ static ssize_t unpack_perms_table(struct aa_ext *e, struct aa_perms **perms) goto fail_reset; if (!aa_unpack_array(e, NULL, &size)) goto fail_reset; - *perms = kzalloc_objs(struct aa_perms, size, GFP_KERNEL); + *perms = kzalloc_objs(struct aa_perms, size); if (!*perms) { e->pos = pos; return -ENOMEM; @@ -1320,7 +1320,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) error = -EPROTO; if (aa_unpack_nameX(e, AA_STRUCT, "data")) { info = "out of memory"; - profile->data = kzalloc_obj(*profile->data, GFP_KERNEL); + profile->data = kzalloc_obj(*profile->data); if (!profile->data) { error = -ENOMEM; goto fail; @@ -1338,7 +1338,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) } while (aa_unpack_strdup(e, &key, NULL)) { - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { kfree_sensitive(key); error = -ENOMEM; @@ -1583,7 +1583,7 @@ void aa_load_ent_free(struct aa_load_ent *ent) struct aa_load_ent *aa_load_ent_alloc(void) { - struct aa_load_ent *ent = kzalloc_obj(*ent, GFP_KERNEL); + struct aa_load_ent *ent = kzalloc_obj(*ent); if (ent) INIT_LIST_HEAD(&ent->list); return ent; diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 27610fa31b61..cd166dee66b7 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -223,7 +223,7 @@ devcgroup_css_alloc(struct cgroup_subsys_state *parent_css) { struct dev_cgroup *dev_cgroup; - dev_cgroup = kzalloc_obj(*dev_cgroup, GFP_KERNEL); + dev_cgroup = kzalloc_obj(*dev_cgroup); if (!dev_cgroup) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&dev_cgroup->exceptions); diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c index aec350abad86..75c684cce370 100644 --- a/security/integrity/digsig.c +++ b/security/integrity/digsig.c @@ -141,7 +141,7 @@ int __init integrity_init_keyring(const unsigned int id) if (!IS_ENABLED(CONFIG_INTEGRITY_TRUSTED_KEYRING)) return 0; - restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction); if (!restriction) return -ENOMEM; diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index a8893b90a0fa..acd840461902 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c @@ -199,7 +199,7 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, if (!ab && IS_ENABLED(CONFIG_AUDIT)) return -ENOMEM; - xattr = kmalloc_obj(struct xattr_list, GFP_KERNEL); + xattr = kmalloc_obj(struct xattr_list); if (!xattr) { err = -ENOMEM; goto out; diff --git a/security/integrity/ima/ima_mok.c b/security/integrity/ima/ima_mok.c index c647f4fd114d..14d93d573a6a 100644 --- a/security/integrity/ima/ima_mok.c +++ b/security/integrity/ima/ima_mok.c @@ -27,7 +27,7 @@ static __init int ima_mok_init(void) pr_notice("Allocating IMA blacklist keyring.\n"); - restriction = kzalloc_obj(struct key_restriction, GFP_KERNEL); + restriction = kzalloc_obj(struct key_restriction); if (!restriction) panic("Can't allocate IMA blacklist restriction."); diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index c99f52458cd5..420642f96cab 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -1976,7 +1976,7 @@ ssize_t ima_parse_add_rule(char *rule) if (*p == '#' || *p == '\0') return len; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL, op, "-ENOMEM", -ENOMEM, audit_info); diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index 859c83ab5a2b..319522450854 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c @@ -103,7 +103,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry, struct ima_queue_entry *qe; unsigned int key; - qe = kmalloc_obj(*qe, GFP_KERNEL); + qe = kmalloc_obj(*qe); if (qe == NULL) { pr_err("OUT OF MEMORY ERROR creating queue entry\n"); return -ENOMEM; diff --git a/security/integrity/ima/ima_queue_keys.c b/security/integrity/ima/ima_queue_keys.c index da29e5b8f6df..b5ed33cbb272 100644 --- a/security/integrity/ima/ima_queue_keys.c +++ b/security/integrity/ima/ima_queue_keys.c @@ -72,7 +72,7 @@ static struct ima_key_entry *ima_alloc_key_entry(struct key *keyring, const char *audit_cause = "ENOMEM"; struct ima_key_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (entry) { entry->payload = kmemdup(payload, payload_len, GFP_KERNEL); entry->keyring_name = kstrdup(keyring->description, diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c index 9712eb6b4b88..7034573fb41e 100644 --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c @@ -245,7 +245,7 @@ int template_desc_init_fields(const char *template_fmt, } if (fields && num_fields) { - *fields = kmalloc_objs(**fields, i, GFP_KERNEL); + *fields = kmalloc_objs(**fields, i); if (*fields == NULL) return -ENOMEM; @@ -334,7 +334,7 @@ static struct ima_template_desc *restore_template_fmt(char *template_name) goto out; } - template_desc = kzalloc_obj(*template_desc, GFP_KERNEL); + template_desc = kzalloc_obj(*template_desc); if (!template_desc) goto out; diff --git a/security/ipe/digest.c b/security/ipe/digest.c index 747768ba0e52..6e597a6b7633 100644 --- a/security/ipe/digest.c +++ b/security/ipe/digest.c @@ -29,7 +29,7 @@ struct digest_info *ipe_digest_parse(const char *valstr) char *alg = NULL; int rc = 0; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); diff --git a/security/ipe/hooks.c b/security/ipe/hooks.c index b8d677f87845..0ae54a880405 100644 --- a/security/ipe/hooks.c +++ b/security/ipe/hooks.c @@ -287,7 +287,7 @@ int ipe_bdev_setintegrity(struct block_device *bdev, enum lsm_integrity_type typ } digest = value; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/security/ipe/policy.c b/security/ipe/policy.c index c2ff142aed37..827867be4fac 100644 --- a/security/ipe/policy.c +++ b/security/ipe/policy.c @@ -162,7 +162,7 @@ struct ipe_policy *ipe_new_policy(const char *text, size_t textlen, struct ipe_policy *new = NULL; int rc = 0; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) return ERR_PTR(-ENOMEM); diff --git a/security/ipe/policy_parser.c b/security/ipe/policy_parser.c index 180de3e5f200..6fa5bebf8471 100644 --- a/security/ipe/policy_parser.c +++ b/security/ipe/policy_parser.c @@ -30,7 +30,7 @@ static struct ipe_parsed_policy *new_parsed_policy(void) struct ipe_op_table *t = NULL; size_t i = 0; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return ERR_PTR(-ENOMEM); @@ -305,7 +305,7 @@ static int parse_property(char *t, struct ipe_rule *r) int token; char *dup = NULL; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; @@ -373,7 +373,7 @@ static int parse_rule(char *line, struct ipe_parsed_policy *p) if (IS_ERR_OR_NULL(line)) return -EBADMSG; - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) return -ENOMEM; diff --git a/security/keys/key.c b/security/keys/key.c index 8ca0777f22d3..091ee084bc30 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -77,7 +77,7 @@ try_again: spin_unlock(&key_user_lock); user = NULL; - candidate = kmalloc_obj(struct key_user, GFP_KERNEL); + candidate = kmalloc_obj(struct key_user); if (unlikely(!candidate)) goto out; diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 7d8a0de7c7c4..ef855d69c97a 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1796,13 +1796,13 @@ long keyctl_watch_key(key_serial_t id, int watch_queue_fd, int watch_id) if (watch_id >= 0) { ret = -ENOMEM; if (!key->watchers) { - wlist = kzalloc_obj(*wlist, GFP_KERNEL); + wlist = kzalloc_obj(*wlist); if (!wlist) goto err_wqueue; init_watch_list(wlist, NULL); } - watch = kzalloc_obj(*watch, GFP_KERNEL); + watch = kzalloc_obj(*watch); if (!watch) goto err_wlist; diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 9a1685035be5..b39038f7dd31 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -977,7 +977,7 @@ static struct key_restriction *keyring_restriction_alloc( key_restrict_link_func_t check) { struct key_restriction *keyres = - kzalloc_obj(struct key_restriction, GFP_KERNEL); + kzalloc_obj(struct key_restriction); if (!keyres) return ERR_PTR(-ENOMEM); diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c index f0de3e9d9743..a7d7538c1f70 100644 --- a/security/keys/request_key_auth.c +++ b/security/keys/request_key_auth.c @@ -171,7 +171,7 @@ struct key *request_key_auth_new(struct key *target, const char *op, kenter("%d,", target->serial); /* allocate a auth record */ - rka = kzalloc_obj(*rka, GFP_KERNEL); + rka = kzalloc_obj(*rka); if (!rka) goto error; rka->callout_info = kmemdup(callout_info, callout_len, GFP_KERNEL); diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c index fb9ff3d18292..0b142d941cd2 100644 --- a/security/keys/trusted-keys/trusted_core.c +++ b/security/keys/trusted-keys/trusted_core.c @@ -134,7 +134,7 @@ static struct trusted_key_payload *trusted_payload_alloc(struct key *key) ret = key_payload_reserve(key, sizeof(*p)); if (ret < 0) goto err; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) goto err; diff --git a/security/keys/trusted-keys/trusted_pkwm.c b/security/keys/trusted-keys/trusted_pkwm.c index aab8fbc49280..bf42c6679245 100644 --- a/security/keys/trusted-keys/trusted_pkwm.c +++ b/security/keys/trusted-keys/trusted_pkwm.c @@ -62,10 +62,10 @@ static struct trusted_key_options *trusted_options_alloc(void) struct trusted_key_options *options; struct trusted_pkwm_options *pkwm; - options = kzalloc_obj(*options, GFP_KERNEL); + options = kzalloc_obj(*options); if (options) { - pkwm = kzalloc_obj(*pkwm, GFP_KERNEL); + pkwm = kzalloc_obj(*pkwm); if (!pkwm) { kfree_sensitive(options); diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c index ce9b26dd846e..6ea728f1eae6 100644 --- a/security/keys/trusted-keys/trusted_tpm1.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -440,7 +440,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype, int i; /* alloc some work space for all the hashes */ - td = kmalloc_obj(*td, GFP_KERNEL); + td = kmalloc_obj(*td); if (!td) return -ENOMEM; @@ -838,7 +838,7 @@ static struct trusted_key_options *trusted_options_alloc(void) if (tpm2 < 0) return NULL; - options = kzalloc_obj(*options, GFP_KERNEL); + options = kzalloc_obj(*options); if (options) { /* set any non-zero defaults */ options->keytype = SRK_keytype; @@ -946,7 +946,7 @@ static int __init init_digests(void) { int i; - digests = kzalloc_objs(*digests, chip->nr_allocated_banks, GFP_KERNEL); + digests = kzalloc_objs(*digests, chip->nr_allocated_banks); if (!digests) return -ENOMEM; diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index 8cc2bcb07324..a71e548065a9 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -118,7 +118,7 @@ static int verify_ruleset(struct setid_ruleset *pol) res = -EINVAL; /* fix it up */ - nrule = kmalloc_obj(struct setid_rule, GFP_KERNEL); + nrule = kmalloc_obj(struct setid_rule); if (!nrule) return -ENOMEM; if (pol->type == UID){ @@ -146,7 +146,7 @@ static ssize_t handle_policy_update(struct file *file, if (len >= KMALLOC_MAX_SIZE) return -EINVAL; - pol = kmalloc_obj(struct setid_ruleset, GFP_KERNEL); + pol = kmalloc_obj(struct setid_ruleset); if (!pol) return -ENOMEM; pol->policy_str = NULL; @@ -175,7 +175,7 @@ static ssize_t handle_policy_update(struct file *file, } *end = '\0'; - rule = kmalloc_obj(struct setid_rule, GFP_KERNEL); + rule = kmalloc_obj(struct setid_rule); if (!rule) { err = -ENOMEM; goto out_free_buf; diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 584b1d6bdff1..813e82bcfc27 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -794,7 +794,7 @@ int __init avc_add_callback(int (*callback)(u32 event), u32 events) struct avc_callback_node *c; int rc = 0; - c = kmalloc_obj(*c, GFP_KERNEL); + c = kmalloc_obj(*c); if (!c) { rc = -ENOMEM; goto out; diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 58ce110272ef..d8224ea113d1 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1030,7 +1030,7 @@ static int selinux_add_opt(int token, const char *s, void **mnt_opts) } if (!opts) { - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; *mnt_opts = opts; @@ -2822,7 +2822,7 @@ static int selinux_fs_context_submount(struct fs_context *fc, if (!(sbsec->flags & (FSCONTEXT_MNT|CONTEXT_MNT|DEFCONTEXT_MNT))) return 0; - opts = kzalloc_obj(*opts, GFP_KERNEL); + opts = kzalloc_obj(*opts); if (!opts) return -ENOMEM; diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 010499520d38..3245cc531555 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -85,7 +85,7 @@ static int selinux_fs_info_create(struct super_block *sb) { struct selinux_fs_info *fsi; - fsi = kzalloc_obj(*fsi, GFP_KERNEL); + fsi = kzalloc_obj(*fsi); if (!fsi) return -ENOMEM; @@ -380,7 +380,7 @@ static int sel_open_policy(struct inode *inode, struct file *filp) goto err; rc = -ENOMEM; - plm = kzalloc_obj(*plm, GFP_KERNEL); + plm = kzalloc_obj(*plm); if (!plm) goto err; diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index b238fa9756cf..807e464340c7 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -214,7 +214,7 @@ int cond_read_bool(struct policydb *p, struct symtab *s, struct policy_file *fp) u32 len; int rc; - booldatum = kzalloc_obj(*booldatum, GFP_KERNEL); + booldatum = kzalloc_obj(*booldatum); if (!booldatum) return -ENOMEM; @@ -334,7 +334,7 @@ static int cond_read_av_list(struct policydb *p, struct policy_file *fp, if (len == 0) return 0; - list->nodes = kzalloc_objs(*list->nodes, len, GFP_KERNEL); + list->nodes = kzalloc_objs(*list->nodes, len); if (!list->nodes) return -ENOMEM; @@ -383,7 +383,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, struct pol /* expr */ len = le32_to_cpu(buf[1]); - node->expr.nodes = kzalloc_objs(*node->expr.nodes, len, GFP_KERNEL); + node->expr.nodes = kzalloc_objs(*node->expr.nodes, len); if (!node->expr.nodes) return -ENOMEM; @@ -421,7 +421,7 @@ int cond_read_list(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); - p->cond_list = kzalloc_objs(*p->cond_list, len, GFP_KERNEL); + p->cond_list = kzalloc_objs(*p->cond_list, len); if (!p->cond_list) return -ENOMEM; @@ -605,7 +605,7 @@ static int cond_dup_av_list(struct cond_av_list *new, memset(new, 0, sizeof(*new)); - new->nodes = kzalloc_objs(*new->nodes, orig->len, GFP_KERNEL); + new->nodes = kzalloc_objs(*new->nodes, orig->len); if (!new->nodes) return -ENOMEM; diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c index 1eb542725c94..9ffc8a371e23 100644 --- a/security/selinux/ss/hashtab.c +++ b/security/selinux/ss/hashtab.c @@ -149,7 +149,7 @@ int hashtab_duplicate(struct hashtab *new, const struct hashtab *orig, memset(new, 0, sizeof(*new)); - new->htable = kzalloc_objs(*new->htable, orig->size, GFP_KERNEL); + new->htable = kzalloc_objs(*new->htable, orig->size); if (!new->htable) return -ENOMEM; diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index a96c671d0d51..661322ff1669 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -390,7 +390,7 @@ static int roles_init(struct policydb *p) int rc; struct role_datum *role; - role = kzalloc_obj(*role, GFP_KERNEL); + role = kzalloc_obj(*role); if (!role) return -ENOMEM; @@ -1130,7 +1130,7 @@ static int perm_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[2]; u32 len; - perdatum = kzalloc_obj(*perdatum, GFP_KERNEL); + perdatum = kzalloc_obj(*perdatum); if (!perdatum) return -ENOMEM; @@ -1163,7 +1163,7 @@ static int common_read(struct policydb *p, struct symtab *s, struct policy_file u32 i, len, nel; int rc; - comdatum = kzalloc_obj(*comdatum, GFP_KERNEL); + comdatum = kzalloc_obj(*comdatum); if (!comdatum) return -ENOMEM; @@ -1236,7 +1236,7 @@ static int read_cons_helper(struct policydb *p, struct constraint_node **nodep, lc = NULL; for (i = 0; i < ncons; i++) { - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) return -ENOMEM; @@ -1253,7 +1253,7 @@ static int read_cons_helper(struct policydb *p, struct constraint_node **nodep, le = NULL; depth = -1; for (j = 0; j < nexpr; j++) { - e = kzalloc_obj(*e, GFP_KERNEL); + e = kzalloc_obj(*e); if (!e) return -ENOMEM; @@ -1327,7 +1327,7 @@ static int class_read(struct policydb *p, struct symtab *s, struct policy_file * u32 i, len, len2, ncons, nel; int rc; - cladatum = kzalloc_obj(*cladatum, GFP_KERNEL); + cladatum = kzalloc_obj(*cladatum); if (!cladatum) return -ENOMEM; @@ -1425,7 +1425,7 @@ static int role_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[3]; u32 len; - role = kzalloc_obj(*role, GFP_KERNEL); + role = kzalloc_obj(*role); if (!role) return -ENOMEM; @@ -1482,7 +1482,7 @@ static int type_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[4]; u32 len; - typdatum = kzalloc_obj(*typdatum, GFP_KERNEL); + typdatum = kzalloc_obj(*typdatum); if (!typdatum) return -ENOMEM; @@ -1556,7 +1556,7 @@ static int user_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[3]; u32 len; - usrdatum = kzalloc_obj(*usrdatum, GFP_KERNEL); + usrdatum = kzalloc_obj(*usrdatum); if (!usrdatum) return -ENOMEM; @@ -1606,7 +1606,7 @@ static int sens_read(struct policydb *p, struct symtab *s, struct policy_file *f __le32 buf[2]; u32 len; - levdatum = kzalloc_obj(*levdatum, GFP_KERNEL); + levdatum = kzalloc_obj(*levdatum); if (!levdatum) return -ENOMEM; @@ -1642,7 +1642,7 @@ static int cat_read(struct policydb *p, struct symtab *s, struct policy_file *fp __le32 buf[3]; u32 len; - catdatum = kzalloc_obj(*catdatum, GFP_KERNEL); + catdatum = kzalloc_obj(*catdatum); if (!catdatum) return -ENOMEM; @@ -1862,7 +1862,7 @@ static int range_read(struct policydb *p, struct policy_file *fp) for (i = 0; i < nel; i++) { rc = -ENOMEM; - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) goto out; @@ -1887,7 +1887,7 @@ static int range_read(struct policydb *p, struct policy_file *fp) goto out; rc = -ENOMEM; - r = kzalloc_obj(*r, GFP_KERNEL); + r = kzalloc_obj(*r); if (!r) goto out; @@ -1963,7 +1963,7 @@ static int filename_trans_read_helper_compat(struct policydb *p, struct policy_f } if (!datum) { rc = -ENOMEM; - datum = kmalloc_obj(*datum, GFP_KERNEL); + datum = kmalloc_obj(*datum); if (!datum) goto out; @@ -2038,7 +2038,7 @@ static int filename_trans_read_helper(struct policydb *p, struct policy_file *fp dst = &first; for (i = 0; i < ndatum; i++) { rc = -ENOMEM; - datum = kmalloc_obj(*datum, GFP_KERNEL); + datum = kmalloc_obj(*datum); if (!datum) goto out; @@ -2060,7 +2060,7 @@ static int filename_trans_read_helper(struct policydb *p, struct policy_file *fp } rc = -ENOMEM; - ft = kmalloc_obj(*ft, GFP_KERNEL); + ft = kmalloc_obj(*ft); if (!ft) goto out; @@ -2153,7 +2153,7 @@ static int genfs_read(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); rc = -ENOMEM; - newgenfs = kzalloc_obj(*newgenfs, GFP_KERNEL); + newgenfs = kzalloc_obj(*newgenfs); if (!newgenfs) goto out; @@ -2192,7 +2192,7 @@ static int genfs_read(struct policydb *p, struct policy_file *fp) len = le32_to_cpu(buf[0]); rc = -ENOMEM; - newc = kzalloc_obj(*newc, GFP_KERNEL); + newc = kzalloc_obj(*newc); if (!newc) goto out; @@ -2264,7 +2264,7 @@ static int ocontext_read(struct policydb *p, l = NULL; for (j = 0; j < nel; j++) { rc = -ENOMEM; - c = kzalloc_obj(*c, GFP_KERNEL); + c = kzalloc_obj(*c); if (!c) goto out; if (l) @@ -2621,12 +2621,12 @@ int policydb_read(struct policydb *p, struct policy_file *fp) goto bad; for (i = 0; i < nel; i++) { rc = -ENOMEM; - rtk = kmalloc_obj(*rtk, GFP_KERNEL); + rtk = kmalloc_obj(*rtk); if (!rtk) goto bad; rc = -ENOMEM; - rtd = kmalloc_obj(*rtd, GFP_KERNEL); + rtd = kmalloc_obj(*rtd); if (!rtd) goto bad; @@ -2669,7 +2669,7 @@ int policydb_read(struct policydb *p, struct policy_file *fp) lra = NULL; for (i = 0; i < nel; i++) { rc = -ENOMEM; - ra = kzalloc_obj(*ra, GFP_KERNEL); + ra = kzalloc_obj(*ra); if (!ra) goto bad; if (lra) diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 6f20e941c059..e8e7ccbd1e44 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -2312,11 +2312,11 @@ int security_load_policy(void *data, size_t len, int rc = 0; struct policy_file file = { data, len }, *fp = &file; - newpolicy = kzalloc_obj(*newpolicy, GFP_KERNEL); + newpolicy = kzalloc_obj(*newpolicy); if (!newpolicy) return -ENOMEM; - newpolicy->sidtab = kzalloc_obj(*newpolicy->sidtab, GFP_KERNEL); + newpolicy->sidtab = kzalloc_obj(*newpolicy->sidtab); if (!newpolicy->sidtab) { rc = -ENOMEM; goto err_policy; @@ -2360,7 +2360,7 @@ int security_load_policy(void *data, size_t len, * in the new SID table. */ - convert_data = kmalloc_obj(*convert_data, GFP_KERNEL); + convert_data = kmalloc_obj(*convert_data); if (!convert_data) { rc = -ENOMEM; goto err_free_isids; diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index e2add0c8c739..98af9d7b9434 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -562,7 +562,7 @@ static int smack_add_opt(int token, const char *s, void **mnt_opts) struct smack_known *skp; if (!opts) { - opts = kzalloc_obj(struct smack_mnt_opts, GFP_KERNEL); + opts = kzalloc_obj(struct smack_mnt_opts); if (!opts) return -ENOMEM; *mnt_opts = opts; @@ -622,7 +622,7 @@ static int smack_fs_context_submount(struct fs_context *fc, struct smack_mnt_opts *ctx; struct inode_smack *isp; - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; fc->security = ctx; @@ -673,7 +673,7 @@ static int smack_fs_context_dup(struct fs_context *fc, if (!src) return 0; - fc->security = kzalloc_obj(struct smack_mnt_opts, GFP_KERNEL); + fc->security = kzalloc_obj(struct smack_mnt_opts); if (!fc->security) return -ENOMEM; @@ -2817,7 +2817,7 @@ static void smk_ipv6_port_label(struct socket *sock, struct sockaddr *address) /* * A new port entry is required. */ - spp = kzalloc_obj(*spp, GFP_KERNEL); + spp = kzalloc_obj(*spp); if (spp == NULL) return; diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 35b98f11e32d..6e62dcb36f74 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -1249,7 +1249,7 @@ static ssize_t smk_write_net4addr(struct file *file, const char __user *buf, smk_netlabel_audit_set(&audit_info); if (found == 0) { - snp = kzalloc_obj(*snp, GFP_KERNEL); + snp = kzalloc_obj(*snp); if (snp == NULL) rc = -ENOMEM; else { @@ -1526,7 +1526,7 @@ static ssize_t smk_write_net6addr(struct file *file, const char __user *buf, break; } if (found == 0) { - snp = kzalloc_obj(*snp, GFP_KERNEL); + snp = kzalloc_obj(*snp); if (snp == NULL) rc = -ENOMEM; else { @@ -1970,7 +1970,7 @@ static int smk_parse_label_list(char *data, struct list_head *list) if (IS_ERR(skp)) return PTR_ERR(skp); - sklep = kzalloc_obj(*sklep, GFP_KERNEL); + sklep = kzalloc_obj(*sklep); if (sklep == NULL) return -ENOMEM; diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 57fd421f8c31..cef3776cf3b2 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c @@ -143,7 +143,7 @@ static int yama_ptracer_add(struct task_struct *tracer, { struct ptrace_relation *relation, *added; - added = kmalloc_obj(*added, GFP_KERNEL); + added = kmalloc_obj(*added); if (!added) return -ENOMEM; diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 0dda1f4d5cbd..15487837e894 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -104,7 +104,7 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, struct ac97_codec_device *codec; int ret; - codec = kzalloc_obj(*codec, GFP_KERNEL); + codec = kzalloc_obj(*codec); if (!codec) return -ENOMEM; ac97_ctrl->codecs[idx] = codec; @@ -351,7 +351,7 @@ struct ac97_controller *snd_ac97_controller_register( struct ac97_controller *ac97_ctrl; int ret, i; - ac97_ctrl = kzalloc_obj(*ac97_ctrl, GFP_KERNEL); + ac97_ctrl = kzalloc_obj(*ac97_ctrl); if (!ac97_ctrl) return ERR_PTR(-ENOMEM); diff --git a/sound/ac97/snd_ac97_compat.c b/sound/ac97/snd_ac97_compat.c index e6c43556c8f6..1a89286d1b67 100644 --- a/sound/ac97/snd_ac97_compat.c +++ b/sound/ac97/snd_ac97_compat.c @@ -69,7 +69,7 @@ struct snd_ac97 *snd_ac97_compat_alloc(struct ac97_codec_device *adev) struct snd_ac97 *ac97; int ret; - ac97 = kzalloc_obj(struct snd_ac97, GFP_KERNEL); + ac97 = kzalloc_obj(struct snd_ac97); if (ac97 == NULL) return ERR_PTR(-ENOMEM); diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index bce8b35c5c27..3ae8408cd303 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -959,7 +959,7 @@ static int onyx_i2c_probe(struct i2c_client *client) struct onyx *onyx; u8 dummy; - onyx = kzalloc_obj(struct onyx, GFP_KERNEL); + onyx = kzalloc_obj(struct onyx); if (!onyx) return -ENOMEM; diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c index 9c9b35cb5b6a..13da2b159ad0 100644 --- a/sound/aoa/codecs/tas.c +++ b/sound/aoa/codecs/tas.c @@ -845,7 +845,7 @@ static int tas_i2c_probe(struct i2c_client *client) struct device_node *node = client->dev.of_node; struct tas *tas; - tas = kzalloc_obj(struct tas, GFP_KERNEL); + tas = kzalloc_obj(struct tas); if (!tas) return -ENOMEM; diff --git a/sound/aoa/codecs/toonie.c b/sound/aoa/codecs/toonie.c index 19653cf19292..6aaf4c9debdd 100644 --- a/sound/aoa/codecs/toonie.c +++ b/sound/aoa/codecs/toonie.c @@ -121,7 +121,7 @@ static struct toonie *toonie; static int __init toonie_init(void) { - toonie = kzalloc_obj(struct toonie, GFP_KERNEL); + toonie = kzalloc_obj(struct toonie); if (!toonie) return -ENOMEM; diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c index 155a503e1e9b..2995876df534 100644 --- a/sound/aoa/core/gpio-pmf.c +++ b/sound/aoa/core/gpio-pmf.c @@ -173,7 +173,7 @@ static int pmf_set_notify(struct gpio_runtime *rt, notif->gpio_private = NULL; } if (!old && notify) { - irq_client = kzalloc_obj(struct pmf_irq_client, GFP_KERNEL); + irq_client = kzalloc_obj(struct pmf_irq_client); if (!irq_client) return -ENOMEM; irq_client->data = notif; diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 0b73ecda1b1d..c18b55305294 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -1025,7 +1025,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) goto outnodev; } - ldev = kzalloc_obj(struct layout_dev, GFP_KERNEL); + ldev = kzalloc_obj(struct layout_dev); if (!ldev) goto outnodev; diff --git a/sound/aoa/soundbus/i2sbus/control.c b/sound/aoa/soundbus/i2sbus/control.c index 09e5070e0ae2..1e9f258b5e67 100644 --- a/sound/aoa/soundbus/i2sbus/control.c +++ b/sound/aoa/soundbus/i2sbus/control.c @@ -19,7 +19,7 @@ int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c) { - *c = kzalloc_obj(struct i2sbus_control, GFP_KERNEL); + *c = kzalloc_obj(struct i2sbus_control); if (!*c) return -ENOMEM; diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 8941f3266947..f974b96e98cd 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -171,7 +171,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, if (strncmp(node_name, "i2s-", 4)) return 0; - dev = kzalloc_obj(struct i2sbus_dev, GFP_KERNEL); + dev = kzalloc_obj(struct i2sbus_dev); if (!dev) return 0; diff --git a/sound/aoa/soundbus/i2sbus/pcm.c b/sound/aoa/soundbus/i2sbus/pcm.c index ceee3320a932..aff99003d833 100644 --- a/sound/aoa/soundbus/i2sbus/pcm.c +++ b/sound/aoa/soundbus/i2sbus/pcm.c @@ -879,7 +879,7 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card, tmp++; } - cii = kzalloc_obj(struct codec_info_item, GFP_KERNEL); + cii = kzalloc_obj(struct codec_info_item); if (!cii) return -ENOMEM; diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 27d916c8fb29..fdba6e4b25fd 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -519,7 +519,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) return -ENXIO; struct snd_compr_codec_caps *caps __free(kfree) = - kzalloc_obj(*caps, GFP_KERNEL); + kzalloc_obj(*caps); if (!caps) return -ENOMEM; @@ -539,7 +539,7 @@ int snd_compr_malloc_pages(struct snd_compr_stream *stream, size_t size) if (snd_BUG_ON(!(stream) || !(stream)->runtime)) return -EINVAL; - dmab = kzalloc_obj(*dmab, GFP_KERNEL); + dmab = kzalloc_obj(*dmab); if (!dmab) return -ENOMEM; dmab->dev = stream->dma_buffer.dev; @@ -694,7 +694,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg) return -EBADFD; struct snd_codec *params __free(kfree) = - kzalloc_obj(*params, GFP_KERNEL); + kzalloc_obj(*params); if (!params) return -ENOMEM; retval = stream->ops->get_params(stream, params); @@ -1066,7 +1066,7 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_ return -EBUSY; if (utask->origin_seqno != 0 || utask->input_size != 0) return -EINVAL; - task = kzalloc_obj(*task, GFP_KERNEL); + task = kzalloc_obj(*task); if (task == NULL) return -ENOMEM; task->seqno = utask->seqno = snd_compr_seqno_next(stream); diff --git a/sound/core/control.c b/sound/core/control.c index eb4a3c1214fb..ffefc5ec6d6b 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -2057,7 +2057,7 @@ static int _snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn, struct list_head * { struct snd_kctl_ioctl *pn; - pn = kzalloc_obj(struct snd_kctl_ioctl, GFP_KERNEL); + pn = kzalloc_obj(struct snd_kctl_ioctl); if (pn == NULL) return -ENOMEM; pn->fioctl = fcn; diff --git a/sound/core/control_compat.c b/sound/core/control_compat.c index 174395322c51..16bc80555f26 100644 --- a/sound/core/control_compat.c +++ b/sound/core/control_compat.c @@ -82,7 +82,7 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl, struct snd_card *card = ctl->card; int err; struct snd_ctl_elem_info *data __free(kfree) = - kzalloc_obj(*data, GFP_KERNEL); + kzalloc_obj(*data); if (! data) return -ENOMEM; @@ -177,7 +177,7 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id, return -ENOENT; struct snd_ctl_elem_info *info __free(kfree) = - kzalloc_obj(*info, GFP_KERNEL); + kzalloc_obj(*info); if (info == NULL) return -ENOMEM; info->id = *id; @@ -283,7 +283,7 @@ static int __ctl_elem_read_user(struct snd_card *card, { int err, type, count; struct snd_ctl_elem_value *data __free(kfree) = - kzalloc_obj(*data, GFP_KERNEL); + kzalloc_obj(*data); if (data == NULL) return -ENOMEM; @@ -318,7 +318,7 @@ static int __ctl_elem_write_user(struct snd_ctl_file *file, struct snd_card *card = file->card; int err, type, count; struct snd_ctl_elem_value *data __free(kfree) = - kzalloc_obj(*data, GFP_KERNEL); + kzalloc_obj(*data); if (data == NULL) return -ENOMEM; @@ -380,7 +380,7 @@ static int snd_ctl_elem_add_compat(struct snd_ctl_file *file, int replace) { struct snd_ctl_elem_info *data __free(kfree) = - kzalloc_obj(*data, GFP_KERNEL); + kzalloc_obj(*data); if (! data) return -ENOMEM; diff --git a/sound/core/control_led.c b/sound/core/control_led.c index 07eebf849ae3..d92b36ab5ec6 100644 --- a/sound/core/control_led.c +++ b/sound/core/control_led.c @@ -653,7 +653,7 @@ static void snd_ctl_led_sysfs_add(struct snd_card *card) for (group = 0; group < MAX_LED; group++) { led = &snd_ctl_leds[group]; - led_card = kzalloc_obj(*led_card, GFP_KERNEL); + led_card = kzalloc_obj(*led_card); if (!led_card) goto cerr2; led_card->number = card->number; diff --git a/sound/core/device.c b/sound/core/device.c index 80c02914877f..5f2aa476d89b 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -34,7 +34,7 @@ int snd_device_new(struct snd_card *card, enum snd_device_type type, if (snd_BUG_ON(!card || !device_data || !ops)) return -ENXIO; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; INIT_LIST_HEAD(&dev->list); diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c index a98de8d9ce16..9fcd1c03dc5b 100644 --- a/sound/core/hrtimer.c +++ b/sound/core/hrtimer.c @@ -64,7 +64,7 @@ static int snd_hrtimer_open(struct snd_timer *t) { struct snd_hrtimer *stime; - stime = kzalloc_obj(*stime, GFP_KERNEL); + stime = kzalloc_obj(*stime); if (!stime) return -ENOMEM; stime->timer = t; diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index a493db2160ed..973d11732bfd 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -375,7 +375,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, return -ENXIO; if (rhwdep) *rhwdep = NULL; - hwdep = kzalloc_obj(*hwdep, GFP_KERNEL); + hwdep = kzalloc_obj(*hwdep); if (!hwdep) return -ENOMEM; diff --git a/sound/core/info.c b/sound/core/info.c index de8ec34360ee..54834dbe6b59 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -79,7 +79,7 @@ static int alloc_info_private(struct snd_info_entry *entry, return -ENODEV; if (!try_module_get(entry->module)) return -EFAULT; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) { module_put(entry->module); return -ENOMEM; @@ -311,7 +311,7 @@ static ssize_t snd_info_text_entry_write(struct file *file, guard(mutex)(&entry->access); buf = data->wbuffer; if (!buf) { - data->wbuffer = buf = kzalloc_obj(*buf, GFP_KERNEL); + data->wbuffer = buf = kzalloc_obj(*buf); if (!buf) return -ENOMEM; } @@ -355,7 +355,7 @@ static int snd_info_text_entry_open(struct inode *inode, struct file *file) if (err < 0) return err; - data->rbuffer = kzalloc_obj(*data->rbuffer, GFP_KERNEL); + data->rbuffer = kzalloc_obj(*data->rbuffer); if (!data->rbuffer) { err = -ENOMEM; goto error; @@ -663,7 +663,7 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent, struct module *module) { struct snd_info_entry *entry; - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (entry == NULL) return NULL; entry->name = kstrdup(name, GFP_KERNEL); diff --git a/sound/core/init.c b/sound/core/init.c index 84c11bd49a95..2f1bd9cbdbed 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -129,7 +129,7 @@ int snd_device_alloc(struct device **dev_p, struct snd_card *card) struct device *dev; *dev_p = NULL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; device_initialize(dev); @@ -1060,7 +1060,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file) { struct snd_monitor_file *mfile; - mfile = kmalloc_obj(*mfile, GFP_KERNEL); + mfile = kmalloc_obj(*mfile); if (mfile == NULL) return -ENOMEM; mfile->file = file; diff --git a/sound/core/jack.c b/sound/core/jack.c index 7160c260d06c..5e8a2f3f4196 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -440,7 +440,7 @@ static struct snd_jack_kctl * snd_jack_kctl_new(struct snd_card *card, const cha if (err < 0) return NULL; - jack_kctl = kzalloc_obj(*jack_kctl, GFP_KERNEL); + jack_kctl = kzalloc_obj(*jack_kctl); if (!jack_kctl) goto error; @@ -516,7 +516,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, return -ENOMEM; } - jack = kzalloc_obj(struct snd_jack, GFP_KERNEL); + jack = kzalloc_obj(struct snd_jack); if (jack == NULL) return -ENOMEM; diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index bb483a2d7ff2..9320671dfcc8 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -719,12 +719,12 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) unsigned int idx, npages; void *p; - sgbuf = kzalloc_obj(*sgbuf, GFP_KERNEL); + sgbuf = kzalloc_obj(*sgbuf); if (!sgbuf) return NULL; size = PAGE_ALIGN(size); sgbuf->count = size >> PAGE_SHIFT; - sgbuf->pages = kvzalloc_objs(*sgbuf->pages, sgbuf->count, GFP_KERNEL); + sgbuf->pages = kvzalloc_objs(*sgbuf->pages, sgbuf->count); sgbuf->npages = kvcalloc(sgbuf->count, sizeof(*sgbuf->npages), GFP_KERNEL); if (!sgbuf->pages || !sgbuf->npages) goto error; diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 05c8e44cd428..591cff800329 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -47,7 +47,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file) snd_card_unref(card); return err; } - fmixer = kzalloc_obj(*fmixer, GFP_KERNEL); + fmixer = kzalloc_obj(*fmixer); if (fmixer == NULL) { snd_card_file_remove(card, file); snd_card_unref(card); @@ -530,9 +530,9 @@ static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -566,9 +566,9 @@ static void snd_mixer_oss_get_volume1_sw(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -629,9 +629,9 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -669,9 +669,9 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer, return; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return; if (kctl->info(kctl, uinfo)) @@ -798,9 +798,9 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned int err, idx; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return -ENOMEM; guard(rwsem_read)(&card->controls_rwsem); @@ -843,9 +843,9 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned unsigned int idx; struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (uinfo == NULL || uctl == NULL) return -ENOMEM; guard(rwsem_read)(&card->controls_rwsem); @@ -1027,7 +1027,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); if (kctl) { struct snd_ctl_elem_info *uinfo __free(kfree) = - kzalloc_obj(*uinfo, GFP_KERNEL); + kzalloc_obj(*uinfo); if (!uinfo) return -ENOMEM; @@ -1055,7 +1055,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, } } if (slot.present != 0) { - pslot = kmalloc_obj(slot, GFP_KERNEL); + pslot = kmalloc_obj(slot); if (! pslot) return -ENOMEM; *pslot = slot; @@ -1315,7 +1315,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd) if (cmd == SND_MIXER_OSS_NOTIFY_REGISTER) { int idx, err; - mixer = kzalloc_objs(*mixer, 2, GFP_KERNEL); + mixer = kzalloc_objs(*mixer, 2); if (mixer == NULL) return -ENOMEM; mutex_init(&mixer->reg_mutex); diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index cf3509c2be15..d4fd4dfc7fc3 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -398,7 +398,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, } struct snd_pcm_hw_params *save __free(kfree) = - kmalloc_obj(*save, GFP_KERNEL); + kmalloc_obj(*save); if (save == NULL) return -ENOMEM; *save = *params; @@ -411,7 +411,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, goto _end; struct snd_pcm_hw_params *params1 __free(kfree) = - kmalloc_obj(*params1, GFP_KERNEL); + kmalloc_obj(*params1); if (params1 == NULL) return -ENOMEM; *params1 = *save; @@ -786,7 +786,7 @@ static int choose_rate(struct snd_pcm_substream *substream, unsigned int rate, prev; struct snd_pcm_hw_params *save __free(kfree) = - kmalloc_obj(*save, GFP_KERNEL); + kmalloc_obj(*save); if (save == NULL) return -ENOMEM; *save = *params; @@ -861,9 +861,9 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) if (!runtime->oss.params) return 0; - sw_params = kzalloc_obj(*sw_params, GFP_KERNEL); - params = kmalloc_obj(*params, GFP_KERNEL); - sparams = kmalloc_obj(*sparams, GFP_KERNEL); + sw_params = kzalloc_obj(*sw_params); + params = kmalloc_obj(*params); + sparams = kmalloc_obj(*sparams); if (!sw_params || !params || !sparams) { err = -ENOMEM; goto failure; @@ -1859,7 +1859,7 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file) AFMT_S24_PACKED; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc_obj(*params, GFP_KERNEL); + kmalloc_obj(*params); if (!params) return -ENOMEM; _snd_pcm_hw_params_any(params); @@ -2418,7 +2418,7 @@ static int snd_pcm_oss_open_file(struct file *file, if (rpcm_oss_file) *rpcm_oss_file = NULL; - pcm_oss_file = kzalloc_obj(*pcm_oss_file, GFP_KERNEL); + pcm_oss_file = kzalloc_obj(*pcm_oss_file); if (pcm_oss_file == NULL) return -ENOMEM; @@ -3032,7 +3032,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, } } while (*str); if (setup == NULL) { - setup = kmalloc_obj(*setup, GFP_KERNEL); + setup = kmalloc_obj(*setup); if (! setup) { buffer->error = -ENOMEM; return; diff --git a/sound/core/pcm.c b/sound/core/pcm.c index e3c43b365207..bfedf571e021 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -334,7 +334,7 @@ static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, return; struct snd_pcm_info *info __free(kfree) = - kmalloc_obj(*info, GFP_KERNEL); + kmalloc_obj(*info); if (!info) return; @@ -657,7 +657,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) } prev = NULL; for (idx = 0, prev = NULL; idx < substream_count; idx++) { - substream = kzalloc_obj(*substream, GFP_KERNEL); + substream = kzalloc_obj(*substream); if (!substream) return -ENOMEM; substream->pcm = pcm; @@ -713,7 +713,7 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, return -ENXIO; if (rpcm) *rpcm = NULL; - pcm = kzalloc_obj(*pcm, GFP_KERNEL); + pcm = kzalloc_obj(*pcm); if (!pcm) return -ENOMEM; pcm->card = card; @@ -935,7 +935,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, if (substream == NULL) return -EAGAIN; - runtime = kzalloc_obj(*runtime, GFP_KERNEL); + runtime = kzalloc_obj(*runtime); if (runtime == NULL) return -ENOMEM; diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 71c74830083e..e71f393d3b01 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -243,7 +243,7 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, return -ENOTTY; struct snd_pcm_hw_params *data __free(kfree) = - kmalloc_obj(*data, GFP_KERNEL); + kmalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index cc6ce33f4ff7..1306b04be171 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -318,7 +318,7 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, if (ret < 0) return ret; - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (!prtd) return -ENOMEM; diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 70f279865adc..09c421cd9319 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -2601,7 +2601,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, if (WARN_ON(pcm->streams[stream].chmap_kctl)) return -EBUSY; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->pcm = pcm; diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 2ef02871f84f..cfe9f10e7359 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -448,7 +448,7 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) /* dma_max=0 means the fixed size preallocation */ if (substream->dma_buffer.area && !substream->dma_max) return -ENOMEM; - dmab = kzalloc_obj(*dmab, GFP_KERNEL); + dmab = kzalloc_obj(*dmab); if (! dmab) return -ENOMEM; dmab->dev = substream->dma_buffer.dev; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index a7e24be8c7db..67cf6a0e17ba 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -244,7 +244,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, { int err; struct snd_pcm_info *info __free(kfree) = - kmalloc_obj(*info, GFP_KERNEL); + kmalloc_obj(*info); if (! info) return -ENOMEM; @@ -2812,7 +2812,7 @@ static int snd_pcm_open_file(struct file *file, if (err < 0) return err; - pcm_file = kzalloc_obj(*pcm_file, GFP_KERNEL); + pcm_file = kzalloc_obj(*pcm_file); if (pcm_file == NULL) { snd_pcm_release_substream(substream); return -ENOMEM; @@ -4111,7 +4111,7 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream, int err; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc_obj(*params, GFP_KERNEL); + kmalloc_obj(*params); if (!params) return -ENOMEM; @@ -4140,7 +4140,7 @@ static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream, int err; struct snd_pcm_hw_params *params __free(kfree) = - kmalloc_obj(*params, GFP_KERNEL); + kmalloc_obj(*params); if (!params) return -ENOMEM; diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index ae93d968e083..3b1034a44938 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -159,7 +159,7 @@ static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) { struct snd_rawmidi_runtime *runtime; - runtime = kzalloc_obj(*runtime, GFP_KERNEL); + runtime = kzalloc_obj(*runtime); if (!runtime) return -ENOMEM; runtime->substream = substream; @@ -472,7 +472,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) fflags = snd_rawmidi_file_flags(file); if ((file->f_flags & O_APPEND) || maj == SOUND_MAJOR) /* OSS emul? */ fflags |= SNDRV_RAWMIDI_LFLG_APPEND; - rawmidi_file = kmalloc_obj(*rawmidi_file, GFP_KERNEL); + rawmidi_file = kmalloc_obj(*rawmidi_file); if (rawmidi_file == NULL) { err = -ENOMEM; goto __error; @@ -1803,7 +1803,7 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, int idx; for (idx = 0; idx < count; idx++) { - substream = kzalloc_obj(*substream, GFP_KERNEL); + substream = kzalloc_obj(*substream); if (!substream) return -ENOMEM; substream->stream = direction; @@ -1891,7 +1891,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, if (rrawmidi) *rrawmidi = NULL; - rmidi = kzalloc_obj(*rmidi, GFP_KERNEL); + rmidi = kzalloc_obj(*rmidi); if (!rmidi) return -ENOMEM; err = snd_rawmidi_init(rmidi, card, id, device, diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index af8e14325239..d3e6a8a8d823 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -65,7 +65,7 @@ snd_seq_oss_create_client(void) int rc; struct snd_seq_port_callback port_callback; struct snd_seq_port_info *port __free(kfree) = - kzalloc_obj(*port, GFP_KERNEL); + kzalloc_obj(*port); if (!port) return -ENOMEM; @@ -168,7 +168,7 @@ snd_seq_oss_open(struct file *file, int level) int i, rc; struct seq_oss_devinfo *dp; - dp = kzalloc_obj(*dp, GFP_KERNEL); + dp = kzalloc_obj(*dp); if (!dp) return -ENOMEM; diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c index 989e9a7069e3..b50a49ca42ff 100644 --- a/sound/core/seq/oss/seq_oss_midi.c +++ b/sound/core/seq/oss/seq_oss_midi.c @@ -66,9 +66,9 @@ int snd_seq_oss_midi_lookup_ports(int client) { struct snd_seq_client_info *clinfo __free(kfree) = - kzalloc_obj(*clinfo, GFP_KERNEL); + kzalloc_obj(*clinfo); struct snd_seq_port_info *pinfo __free(kfree) = - kzalloc_obj(*pinfo, GFP_KERNEL); + kzalloc_obj(*pinfo); if (!clinfo || !pinfo) return -ENOMEM; @@ -153,7 +153,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo) /* * allocate midi info record */ - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) return -ENOMEM; diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c index 014efc191c71..c880d4771169 100644 --- a/sound/core/seq/oss/seq_oss_readq.c +++ b/sound/core/seq/oss/seq_oss_readq.c @@ -34,11 +34,11 @@ snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen) { struct seq_oss_readq *q; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; - q->q = kzalloc_objs(union evrec, maxlen, GFP_KERNEL); + q->q = kzalloc_objs(union evrec, maxlen); if (!q->q) { kfree(q); return NULL; diff --git a/sound/core/seq/oss/seq_oss_timer.c b/sound/core/seq/oss/seq_oss_timer.c index 32f1ff225cf5..44c04795204e 100644 --- a/sound/core/seq/oss/seq_oss_timer.c +++ b/sound/core/seq/oss/seq_oss_timer.c @@ -34,7 +34,7 @@ snd_seq_oss_timer_new(struct seq_oss_devinfo *dp) { struct seq_oss_timer *rec; - rec = kzalloc_obj(*rec, GFP_KERNEL); + rec = kzalloc_obj(*rec); if (rec == NULL) return NULL; diff --git a/sound/core/seq/oss/seq_oss_writeq.c b/sound/core/seq/oss/seq_oss_writeq.c index dfc20d9bcc30..09239ea4b5ea 100644 --- a/sound/core/seq/oss/seq_oss_writeq.c +++ b/sound/core/seq/oss/seq_oss_writeq.c @@ -27,7 +27,7 @@ snd_seq_oss_writeq_new(struct seq_oss_devinfo *dp, int maxlen) struct seq_oss_writeq *q; struct snd_seq_client_pool pool; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; q->dp = dp; diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c index a771684eac34..22679dca9aae 100644 --- a/sound/core/seq/seq_compat.c +++ b/sound/core/seq/seq_compat.c @@ -33,7 +33,7 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned { int err; struct snd_seq_port_info *data __free(kfree) = - kmalloc_obj(*data, GFP_KERNEL); + kmalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index d8b77385aa3f..af45f328ae99 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c @@ -115,7 +115,7 @@ create_port(int idx, int type) struct snd_seq_port_callback pcb; struct snd_seq_dummy_port *rec; - rec = kzalloc_obj(*rec, GFP_KERNEL); + rec = kzalloc_obj(*rec); if (!rec) return NULL; diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index ad15d001cef7..ebe1394c18a9 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c @@ -19,7 +19,7 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize) { struct snd_seq_fifo *f; - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) return NULL; diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 8a14d6e59c82..48b0aa0c3395 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -517,7 +517,7 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize) struct snd_seq_pool *pool; /* create pool block */ - pool = kzalloc_obj(*pool, GFP_KERNEL); + pool = kzalloc_obj(*pool); if (!pool) return NULL; spin_lock_init(&pool->lock); diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index 72e798ddbe4e..ca3f5fc30992 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c @@ -281,7 +281,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) return -EINVAL; struct snd_rawmidi_info *info __free(kfree) = - kmalloc_obj(*info, GFP_KERNEL); + kmalloc_obj(*info); if (! info) return -ENOMEM; info->device = device; @@ -305,7 +305,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) client = synths[card->number]; if (client == NULL) { newclient = 1; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (client == NULL) return -ENOMEM; client->seq_client = @@ -318,10 +318,10 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev) } } - msynth = kzalloc_objs(struct seq_midisynth, ports, GFP_KERNEL); + msynth = kzalloc_objs(struct seq_midisynth, ports); struct snd_seq_port_info *port __free(kfree) = - kmalloc_obj(*port, GFP_KERNEL); + kmalloc_obj(*port); if (msynth == NULL || port == NULL) goto __nomem; diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 0e9461d0f9f8..fd067c85c524 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -650,7 +650,7 @@ static struct snd_midi_channel *snd_midi_channel_init_set(int n) struct snd_midi_channel *chan; int i; - chan = kmalloc_objs(struct snd_midi_channel, n, GFP_KERNEL); + chan = kmalloc_objs(struct snd_midi_channel, n); if (chan) { for (i = 0; i < n; i++) snd_midi_channel_init(chan+i, i); @@ -688,7 +688,7 @@ struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n) { struct snd_midi_channel_set *chset; - chset = kmalloc_obj(*chset, GFP_KERNEL); + chset = kmalloc_obj(*chset); if (chset) { chset->channels = snd_midi_channel_init_set(n); chset->private_data = NULL; diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index c2a9b0540c09..0d9269b47b59 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c @@ -104,7 +104,7 @@ int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev) struct snd_midi_event *dev; *rdev = NULL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (dev == NULL) return -ENOMEM; if (bufsize > 0) { diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 1b395caaae49..da8d358958f1 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c @@ -129,7 +129,7 @@ int snd_seq_create_port(struct snd_seq_client *client, int port, } /* create a new port */ - new_port = kzalloc_obj(*new_port, GFP_KERNEL); + new_port = kzalloc_obj(*new_port); if (!new_port) return -ENOMEM; /* failure, out of memory */ /* init port data */ @@ -572,7 +572,7 @@ int snd_seq_port_connect(struct snd_seq_client *connector, bool exclusive; int err; - subs = kzalloc_obj(*subs, GFP_KERNEL); + subs = kzalloc_obj(*subs); if (!subs) return -ENOMEM; diff --git a/sound/core/seq/seq_prioq.c b/sound/core/seq/seq_prioq.c index 805c4ebbfdac..25c0ed8f9f0f 100644 --- a/sound/core/seq/seq_prioq.c +++ b/sound/core/seq/seq_prioq.c @@ -43,7 +43,7 @@ struct snd_seq_prioq *snd_seq_prioq_new(void) { struct snd_seq_prioq *f; - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) return NULL; diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index 8c7b24a9421a..2c420d249c96 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c @@ -89,7 +89,7 @@ static struct snd_seq_queue *queue_new(int owner, int locked) { struct snd_seq_queue *q; - q = kzalloc_obj(*q, GFP_KERNEL); + q = kzalloc_obj(*q); if (!q) return NULL; diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c index d7d84576c3d6..f6132a120048 100644 --- a/sound/core/seq/seq_system.c +++ b/sound/core/seq/seq_system.c @@ -130,7 +130,7 @@ int __init snd_seq_system_client_init(void) struct snd_seq_port_info *port; int err; - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) return -ENOMEM; diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index c5728efa05af..9bef2f792498 100644 --- a/sound/core/seq/seq_timer.c +++ b/sound/core/seq/seq_timer.c @@ -43,7 +43,7 @@ struct snd_seq_timer *snd_seq_timer_new(void) { struct snd_seq_timer *tmr; - tmr = kzalloc_obj(*tmr, GFP_KERNEL); + tmr = kzalloc_obj(*tmr); if (!tmr) return NULL; spin_lock_init(&tmr->lock); diff --git a/sound/core/seq/seq_ump_client.c b/sound/core/seq/seq_ump_client.c index 3ca808c787e2..fdc76f23e03f 100644 --- a/sound/core/seq/seq_ump_client.c +++ b/sound/core/seq/seq_ump_client.c @@ -220,7 +220,7 @@ static int seq_ump_group_init(struct seq_ump_client *client, int group_index) return 0; struct snd_seq_port_info *port __free(kfree) = - kzalloc_obj(*port, GFP_KERNEL); + kzalloc_obj(*port); if (!port) return -ENOMEM; @@ -246,9 +246,9 @@ static void update_port_infos(struct seq_ump_client *client) int i, err; struct snd_seq_port_info *old __free(kfree) = - kzalloc_obj(*old, GFP_KERNEL); + kzalloc_obj(*old); struct snd_seq_port_info *new __free(kfree) = - kzalloc_obj(*new, GFP_KERNEL); + kzalloc_obj(*new); if (!old || !new) return; @@ -283,7 +283,7 @@ static int create_ump_endpoint_port(struct seq_ump_client *client) int err; struct snd_seq_port_info *port __free(kfree) = - kzalloc_obj(*port, GFP_KERNEL); + kzalloc_obj(*port); if (!port) return -ENOMEM; @@ -461,7 +461,7 @@ static int snd_seq_ump_probe(struct snd_seq_device *dev) struct snd_seq_client *cptr; int p, err; - client = kzalloc_obj(*client, GFP_KERNEL); + client = kzalloc_obj(*client); if (!client) return -ENOMEM; diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 16d61847c7fe..982828650d41 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -216,7 +216,7 @@ static int snd_virmidi_output_open(struct snd_rawmidi_substream *substream) struct snd_rawmidi_runtime *runtime = substream->runtime; struct snd_virmidi *vmidi; - vmidi = kzalloc_obj(*vmidi, GFP_KERNEL); + vmidi = kzalloc_obj(*vmidi); if (vmidi == NULL) return -ENOMEM; vmidi->substream = substream; @@ -367,7 +367,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) return 0; struct snd_seq_port_info *pinfo __free(kfree) = - kzalloc_obj(*pinfo, GFP_KERNEL); + kzalloc_obj(*pinfo); if (!pinfo) return -ENOMEM; @@ -498,7 +498,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi if (err < 0) return err; strscpy(rmidi->name, rmidi->id); - rdev = kzalloc_obj(*rdev, GFP_KERNEL); + rdev = kzalloc_obj(*rdev); if (rdev == NULL) { snd_device_free(card, rmidi); return -ENOMEM; diff --git a/sound/core/sound.c b/sound/core/sound.c index 876fac770749..93436db24710 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -257,7 +257,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, if (snd_BUG_ON(!device)) return -EINVAL; - preg = kmalloc_obj(*preg, GFP_KERNEL); + preg = kmalloc_obj(*preg); if (preg == NULL) return -ENOMEM; preg->type = type; diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index 6d4e44656e19..7eb49f2cada5 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c @@ -96,7 +96,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, return 0; /* ignore silently */ if (minor < 0) return minor; - preg = kmalloc_obj(struct snd_minor, GFP_KERNEL); + preg = kmalloc_obj(struct snd_minor); if (preg == NULL) return -ENOMEM; preg->type = type; diff --git a/sound/core/timer.c b/sound/core/timer.c index 7d10f079b5b3..6a70df7ae019 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -151,7 +151,7 @@ struct snd_timer_instance *snd_timer_instance_new(const char *owner) { struct snd_timer_instance *timeri; - timeri = kzalloc_obj(*timeri, GFP_KERNEL); + timeri = kzalloc_obj(*timeri); if (timeri == NULL) return NULL; timeri->owner = kstrdup(owner, GFP_KERNEL); @@ -930,7 +930,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, } if (rtimer) *rtimer = NULL; - timer = kzalloc_obj(*timer, GFP_KERNEL); + timer = kzalloc_obj(*timer); if (!timer) return -ENOMEM; timer->tmr_class = tid->dev_class; @@ -1197,7 +1197,7 @@ static int snd_timer_register_system(void) return err; strscpy(timer->name, "system timer"); timer->hw = snd_timer_system; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) { snd_timer_free(timer); return -ENOMEM; @@ -1432,11 +1432,11 @@ static int realloc_user_queue(struct snd_timer_user *tu, int size) struct snd_timer_tread64 *tqueue = NULL; if (tu->tread) { - tqueue = kzalloc_objs(*tqueue, size, GFP_KERNEL); + tqueue = kzalloc_objs(*tqueue, size); if (!tqueue) return -ENOMEM; } else { - queue = kzalloc_objs(*queue, size, GFP_KERNEL); + queue = kzalloc_objs(*queue, size); if (!queue) return -ENOMEM; } @@ -1461,7 +1461,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file) if (err < 0) return err; - tu = kzalloc_obj(*tu, GFP_KERNEL); + tu = kzalloc_obj(*tu); if (tu == NULL) return -ENOMEM; spin_lock_init(&tu->qlock); @@ -2128,7 +2128,7 @@ static int snd_utimer_create(struct snd_timer_uinfo *utimer_info, if (!utimer_info || utimer_info->resolution == 0) return -EINVAL; - utimer = kzalloc_obj(*utimer, GFP_KERNEL); + utimer = kzalloc_obj(*utimer); if (!utimer) return -ENOMEM; diff --git a/sound/core/ump.c b/sound/core/ump.c index 543330c67b69..114ebf8c3a51 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -166,7 +166,7 @@ int snd_ump_endpoint_new(struct snd_card *card, char *id, int device, if (input && output) info_flags |= SNDRV_RAWMIDI_INFO_DUPLEX; - ump = kzalloc_obj(*ump, GFP_KERNEL); + ump = kzalloc_obj(*ump); if (!ump) return -ENOMEM; INIT_LIST_HEAD(&ump->block_list); @@ -408,7 +408,7 @@ int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk, if (snd_ump_get_block(ump, blk)) return -EBUSY; - fb = kzalloc_obj(*fb, GFP_KERNEL); + fb = kzalloc_obj(*fb); if (!fb) return -ENOMEM; diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index e4185c3a2629..fe7683c9c31a 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c @@ -58,7 +58,7 @@ static int follower_update(struct link_follower *follower) { int err, ch; struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (!uctl) return -ENOMEM; @@ -84,7 +84,7 @@ static int follower_init(struct link_follower *follower) } struct snd_ctl_elem_info *uinfo __free(kfree) = - kmalloc_obj(*uinfo, GFP_KERNEL); + kmalloc_obj(*uinfo); if (!uinfo) return -ENOMEM; uinfo->id = follower->follower.id; @@ -341,7 +341,7 @@ static int sync_followers(struct link_master *master, int old_val, int new_val) { struct link_follower *follower; struct snd_ctl_elem_value *uval __free(kfree) = - kmalloc_obj(*uval, GFP_KERNEL); + kmalloc_obj(*uval); if (!uval) return -ENOMEM; @@ -429,7 +429,7 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, knew.name = name; knew.info = master_info; - master = kzalloc_obj(*master, GFP_KERNEL); + master = kzalloc_obj(*master); if (!master) return NULL; INIT_LIST_HEAD(&master->followers); diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 33323c1f8dfe..7283f0f18813 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -329,7 +329,7 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream) { struct dummy_systimer_pcm *dpcm; - dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm); if (!dpcm) return -ENOMEM; substream->runtime->private_data = dpcm; @@ -450,7 +450,7 @@ static int dummy_hrtimer_create(struct snd_pcm_substream *substream) { struct dummy_hrtimer_pcm *dpcm; - dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm); if (!dpcm) return -ENOMEM; substream->runtime->private_data = dpcm; diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index 1b573969918f..6de03d72a908 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -518,7 +518,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device, out_enable, in_enable, &rmidi); if (err < 0) return err; - mpu = kzalloc_obj(*mpu, GFP_KERNEL); + mpu = kzalloc_obj(*mpu); if (!mpu) { err = -ENOMEM; goto free_device; diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index eeaa05ad9e5b..36e9eab204ca 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -75,7 +75,7 @@ static int snd_mts64_create(struct snd_card *card, *rchip = NULL; - mts = kzalloc_obj(struct mts64, GFP_KERNEL); + mts = kzalloc_obj(struct mts64); if (mts == NULL) return -ENOMEM; diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index ce96b0fd1f43..ea9b258b1e4b 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -324,7 +324,7 @@ int snd_opl3_new(struct snd_card *card, int err; *ropl3 = NULL; - opl3 = kzalloc_obj(*opl3, GFP_KERNEL); + opl3 = kzalloc_obj(*opl3); if (!opl3) return -ENOMEM; diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index 7cdd4abb0b7c..47a2486be46d 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c @@ -313,7 +313,7 @@ struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank, if (!create_patch) return NULL; - patch = kzalloc_obj(*patch, GFP_KERNEL); + patch = kzalloc_obj(*patch); if (!patch) return NULL; patch->prog = prog; diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index d476fb7be15e..6364475a368a 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -187,7 +187,7 @@ int snd_opl4_create(struct snd_card *card, if (ropl4) *ropl4 = NULL; - opl4 = kzalloc_obj(*opl4, GFP_KERNEL); + opl4 = kzalloc_obj(*opl4); if (!opl4) return -ENOMEM; diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index 8d3a19b628a2..768bb698adfb 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -377,7 +377,7 @@ static int snd_pcmtst_pcm_open(struct snd_pcm_substream *substream) if (inject_open_err) return -EBUSY; - v_iter = kzalloc_obj(*v_iter, GFP_KERNEL); + v_iter = kzalloc_obj(*v_iter); if (!v_iter) return -ENOMEM; @@ -575,7 +575,7 @@ static int snd_pcmtst_create(struct snd_card *card, struct platform_device *pdev .dev_free = snd_pcmtst_dev_free, }; - pcmtst = kzalloc_obj(*pcmtst, GFP_KERNEL); + pcmtst = kzalloc_obj(*pcmtst); if (!pcmtst) return -ENOMEM; pcmtst->card = card; diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 3dac519c4c45..dcc0899cfb99 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -88,7 +88,7 @@ static int portman_create(struct snd_card *card, *rchip = NULL; - pm = kzalloc_obj(struct portman, GFP_KERNEL); + pm = kzalloc_obj(struct portman); if (pm == NULL) return -ENOMEM; diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 0e7a4cdc1390..d337f5990e5c 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -414,7 +414,7 @@ static int vx_alloc_pipe(struct vx_core *chip, int capture, return err; /* initialize the pipe record */ - pipe = kzalloc_obj(*pipe, GFP_KERNEL); + pipe = kzalloc_obj(*pipe); if (! pipe) { /* release the pipe */ vx_init_rmh(&rmh, CMD_FREE_PIPE); diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 3f9471694b04..f33c08e7c659 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1783,7 +1783,7 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed, // for runtime of PCM substream in the interval equivalent to the size of PCM buffer. It // could take a round over queue of AMDTP packet descriptors and small loss of history. For // safe, keep more 8 elements for the queue, equivalent to 1 ms. - descs = kzalloc_objs(*descs, s->queue_size + 8, GFP_KERNEL); + descs = kzalloc_objs(*descs, s->queue_size + 8); if (!descs) { err = -ENOMEM; goto err_context; diff --git a/sound/firewire/bebob/bebob_proc.c b/sound/firewire/bebob/bebob_proc.c index c5e060728fdc..ad03734afcb1 100644 --- a/sound/firewire/bebob/bebob_proc.c +++ b/sound/firewire/bebob/bebob_proc.c @@ -38,7 +38,7 @@ proc_read_hw_info(struct snd_info_entry *entry, struct snd_bebob *bebob = entry->private_data; struct hw_info *info; - info = kzalloc_obj(struct hw_info, GFP_KERNEL); + info = kzalloc_obj(struct hw_info); if (info == NULL) return; diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 8b6b0e5ba497..d69435722abb 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -76,7 +76,7 @@ get_hardware_info(struct snd_efw *efw) char version[12] = {0}; int err; - hwinfo = kzalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL); + hwinfo = kzalloc_obj(struct snd_efw_hwinfo); if (hwinfo == NULL) return -ENOMEM; diff --git a/sound/firewire/fireworks/fireworks_proc.c b/sound/firewire/fireworks/fireworks_proc.c index 179b7110c8e2..aba544b86b99 100644 --- a/sound/firewire/fireworks/fireworks_proc.c +++ b/sound/firewire/fireworks/fireworks_proc.c @@ -31,7 +31,7 @@ proc_read_hwinfo(struct snd_info_entry *entry, struct snd_info_buffer *buffer) unsigned short i; struct snd_efw_hwinfo *hwinfo; - hwinfo = kmalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL); + hwinfo = kmalloc_obj(struct snd_efw_hwinfo); if (hwinfo == NULL) return; diff --git a/sound/firewire/motu/motu-hwdep.c b/sound/firewire/motu/motu-hwdep.c index ea7f5d215060..56a6f3493f6f 100644 --- a/sound/firewire/motu/motu-hwdep.c +++ b/sound/firewire/motu/motu-hwdep.c @@ -185,7 +185,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP)) return -ENXIO; - meter = kzalloc_obj(*meter, GFP_KERNEL); + meter = kzalloc_obj(*meter); if (!meter) return -ENOMEM; @@ -207,7 +207,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_COMMAND_DSP)) return -ENXIO; - meter = kzalloc_obj(*meter, GFP_KERNEL); + meter = kzalloc_obj(*meter); if (!meter) return -ENOMEM; @@ -229,7 +229,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file, if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP)) return -ENXIO; - param = kzalloc_obj(*param, GFP_KERNEL); + param = kzalloc_obj(*param); if (!param) return -ENOMEM; diff --git a/sound/firewire/packets-buffer.c b/sound/firewire/packets-buffer.c index 3d5c3baf7e48..2093a5fbd81d 100644 --- a/sound/firewire/packets-buffer.c +++ b/sound/firewire/packets-buffer.c @@ -27,7 +27,7 @@ int iso_packets_buffer_init(struct iso_packets_buffer *b, struct fw_unit *unit, void *p; int err; - b->packets = kmalloc_objs(*b->packets, count, GFP_KERNEL); + b->packets = kmalloc_objs(*b->packets, count); if (!b->packets) { err = -ENOMEM; goto error; diff --git a/sound/hda/codecs/analog.c b/sound/hda/codecs/analog.c index 122d14e57313..11b1d30b23fd 100644 --- a/sound/hda/codecs/analog.c +++ b/sound/hda/codecs/analog.c @@ -191,7 +191,7 @@ static int alloc_ad_spec(struct hda_codec *codec) { struct ad198x_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; codec->spec = spec; diff --git a/sound/hda/codecs/ca0110.c b/sound/hda/codecs/ca0110.c index 8638cef4ef20..d17fc38784e1 100644 --- a/sound/hda/codecs/ca0110.c +++ b/sound/hda/codecs/ca0110.c @@ -35,7 +35,7 @@ static int ca0110_probe(struct hda_codec *codec, const struct hda_device_id *id) struct hda_gen_spec *spec; int err; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(spec); diff --git a/sound/hda/codecs/ca0132.c b/sound/hda/codecs/ca0132.c index af9236c56db4..e4f174d0ebb1 100644 --- a/sound/hda/codecs/ca0132.c +++ b/sound/hda/codecs/ca0132.c @@ -3392,11 +3392,11 @@ static int dspxfr_image(struct hda_codec *codec, if (fls_data == NULL) return -EINVAL; - dma_engine = kzalloc_obj(*dma_engine, GFP_KERNEL); + dma_engine = kzalloc_obj(*dma_engine); if (!dma_engine) return -ENOMEM; - dma_engine->dmab = kzalloc_obj(*dma_engine->dmab, GFP_KERNEL); + dma_engine->dmab = kzalloc_obj(*dma_engine->dmab); if (!dma_engine->dmab) { kfree(dma_engine); return -ENOMEM; @@ -9899,7 +9899,7 @@ static int ca0132_codec_probe(struct hda_codec *codec, codec_dbg(codec, "%s\n", __func__); - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs420x.c b/sound/hda/codecs/cirrus/cs420x.c index 454b6946b4a3..52eda0a338ea 100644 --- a/sound/hda/codecs/cirrus/cs420x.c +++ b/sound/hda/codecs/cirrus/cs420x.c @@ -524,7 +524,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) { struct cs_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs421x.c b/sound/hda/codecs/cirrus/cs421x.c index 28f3317a9ffd..c8349a2c5a36 100644 --- a/sound/hda/codecs/cirrus/cs421x.c +++ b/sound/hda/codecs/cirrus/cs421x.c @@ -162,7 +162,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) { struct cs_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cirrus/cs8409.c b/sound/hda/codecs/cirrus/cs8409.c index 24b224c70e9f..fad705092777 100644 --- a/sound/hda/codecs/cirrus/cs8409.c +++ b/sound/hda/codecs/cirrus/cs8409.c @@ -61,7 +61,7 @@ static struct cs8409_spec *cs8409_alloc_spec(struct hda_codec *codec) { struct cs8409_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return NULL; codec->spec = spec; diff --git a/sound/hda/codecs/cm9825.c b/sound/hda/codecs/cm9825.c index a5330cff42ec..eeb9ca38d2d8 100644 --- a/sound/hda/codecs/cm9825.c +++ b/sound/hda/codecs/cm9825.c @@ -488,7 +488,7 @@ static int cm9825_probe(struct hda_codec *codec, const struct hda_device_id *id) struct auto_pin_cfg *cfg; int err = 0; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (spec == NULL) return -ENOMEM; diff --git a/sound/hda/codecs/cmedia.c b/sound/hda/codecs/cmedia.c index 0494bbe15431..e6e12c01339f 100644 --- a/sound/hda/codecs/cmedia.c +++ b/sound/hda/codecs/cmedia.c @@ -24,7 +24,7 @@ static int cmedia_probe(struct hda_codec *codec, const struct hda_device_id *id) bool is_cmi8888 = id->vendor_id == 0x13f68888; int err; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (spec == NULL) return -ENOMEM; diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c index 8f032102e558..aa726eb323eb 100644 --- a/sound/hda/codecs/conexant.c +++ b/sound/hda/codecs/conexant.c @@ -1187,7 +1187,7 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id) codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/generic.c b/sound/hda/codecs/generic.c index 147582c5e51f..092428ada29d 100644 --- a/sound/hda/codecs/generic.c +++ b/sound/hda/codecs/generic.c @@ -1991,7 +1991,7 @@ static int parse_output_paths(struct hda_codec *codec) bool best_wired = true, best_mio = true; bool hp_spk_swapped = false; struct auto_pin_cfg *best_cfg __free(kfree) = - kmalloc_obj(*best_cfg, GFP_KERNEL); + kmalloc_obj(*best_cfg); if (!best_cfg) return -ENOMEM; @@ -6095,7 +6095,7 @@ static int snd_hda_gen_probe(struct hda_codec *codec, struct hda_gen_spec *spec; int err; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(spec); diff --git a/sound/hda/codecs/hdmi/hdmi.c b/sound/hda/codecs/hdmi/hdmi.c index bcc81018fff3..f20d1715da62 100644 --- a/sound/hda/codecs/hdmi/hdmi.c +++ b/sound/hda/codecs/hdmi/hdmi.c @@ -2105,7 +2105,7 @@ int snd_hda_hdmi_generic_alloc(struct hda_codec *codec) { struct hdmi_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; diff --git a/sound/hda/codecs/hdmi/simplehdmi.c b/sound/hda/codecs/hdmi/simplehdmi.c index fe4e73c3d6e6..7bb002113898 100644 --- a/sound/hda/codecs/hdmi/simplehdmi.c +++ b/sound/hda/codecs/hdmi/simplehdmi.c @@ -175,7 +175,7 @@ int snd_hda_hdmi_simple_probe(struct hda_codec *codec, struct hdmi_spec_per_cvt *per_cvt; struct hdmi_spec_per_pin *per_pin; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; diff --git a/sound/hda/codecs/realtek/realtek.c b/sound/hda/codecs/realtek/realtek.c index 3356fd95fb7f..aad265c0a5b6 100644 --- a/sound/hda/codecs/realtek/realtek.c +++ b/sound/hda/codecs/realtek/realtek.c @@ -221,7 +221,7 @@ void alc_update_knob_master(struct hda_codec *codec, return; struct snd_ctl_elem_value *uctl __free(kfree) = - kzalloc_obj(*uctl, GFP_KERNEL); + kzalloc_obj(*uctl); if (!uctl) return; val = snd_hda_codec_read(codec, jack->nid, 0, @@ -1028,7 +1028,7 @@ EXPORT_SYMBOL_NS_GPL(alc_parse_auto_config, "SND_HDA_CODEC_REALTEK"); /* common preparation job for alc_spec */ int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) { - struct alc_spec *spec = kzalloc_obj(*spec, GFP_KERNEL); + struct alc_spec *spec = kzalloc_obj(*spec); int err; if (!spec) diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c index ed3d9cbb3ea6..3a50d4b3a064 100644 --- a/sound/hda/codecs/senarytech.c +++ b/sound/hda/codecs/senarytech.c @@ -170,7 +170,7 @@ static int senary_probe(struct hda_codec *codec, const struct hda_device_id *id) codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/si3054.c b/sound/hda/codecs/si3054.c index 9074c74a0ed0..471260e8deb1 100644 --- a/sound/hda/codecs/si3054.c +++ b/sound/hda/codecs/si3054.c @@ -256,7 +256,7 @@ static void si3054_remove(struct hda_codec *codec) static int si3054_probe(struct hda_codec *codec, const struct hda_device_id *id) { - codec->spec = kzalloc_obj(struct si3054_spec, GFP_KERNEL); + codec->spec = kzalloc_obj(struct si3054_spec); if (!codec->spec) return -ENOMEM; return 0; diff --git a/sound/hda/codecs/sigmatel.c b/sound/hda/codecs/sigmatel.c index 69d75cc63bd6..acbbc7c3508b 100644 --- a/sound/hda/codecs/sigmatel.c +++ b/sound/hda/codecs/sigmatel.c @@ -4456,7 +4456,7 @@ static int alloc_stac_spec(struct hda_codec *codec) { struct sigmatel_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; snd_hda_gen_spec_init(&spec->gen); diff --git a/sound/hda/codecs/via.c b/sound/hda/codecs/via.c index 42cce9f51931..807312cffd35 100644 --- a/sound/hda/codecs/via.c +++ b/sound/hda/codecs/via.c @@ -102,7 +102,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) { struct via_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (spec == NULL) return NULL; diff --git a/sound/hda/common/beep.c b/sound/hda/common/beep.c index 006eef5ceea8..4cb21ec9035c 100644 --- a/sound/hda/common/beep.c +++ b/sound/hda/common/beep.c @@ -220,7 +220,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) return 0; /* disabled by module option */ } - beep = kzalloc_obj(*beep, GFP_KERNEL); + beep = kzalloc_obj(*beep); if (beep == NULL) return -ENOMEM; snprintf(beep->phys, sizeof(beep->phys), diff --git a/sound/hda/common/codec.c b/sound/hda/common/codec.c index 6c787b603179..feebe56cba67 100644 --- a/sound/hda/common/codec.c +++ b/sound/hda/common/codec.c @@ -147,7 +147,7 @@ static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid) len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list)); if (len == -ENOSPC) { len = snd_hda_get_num_raw_conns(codec, nid); - result = kmalloc_objs(hda_nid_t, len, GFP_KERNEL); + result = kmalloc_objs(hda_nid_t, len); if (!result) return -ENOMEM; len = snd_hda_get_raw_connections(codec, nid, result, len); @@ -703,7 +703,7 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec, struct hda_pcm *pcm; va_list args; - pcm = kzalloc_obj(*pcm, GFP_KERNEL); + pcm = kzalloc_obj(*pcm); if (!pcm) return NULL; @@ -895,7 +895,7 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr, if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) return ERR_PTR(-EINVAL); - codec = kzalloc_obj(*codec, GFP_KERNEL); + codec = kzalloc_obj(*codec); if (!codec) return ERR_PTR(-ENOMEM); @@ -1855,7 +1855,7 @@ static int check_follower_present(struct hda_codec *codec, static int put_kctl_with_value(struct snd_kcontrol *kctl, int val) { struct snd_ctl_elem_value *ucontrol __free(kfree) = - kzalloc_obj(*ucontrol, GFP_KERNEL); + kzalloc_obj(*ucontrol); if (!ucontrol) return -ENOMEM; diff --git a/sound/hda/common/controller.c b/sound/hda/common/controller.c index cf8502834484..5934e5cdfdfd 100644 --- a/sound/hda/common/controller.c +++ b/sound/hda/common/controller.c @@ -715,7 +715,7 @@ int snd_hda_attach_pcm_stream(struct hda_bus *_bus, struct hda_codec *codec, if (err < 0) return err; strscpy(pcm->name, cpcm->name, sizeof(pcm->name)); - apcm = kzalloc_obj(*apcm, GFP_KERNEL); + apcm = kzalloc_obj(*apcm); if (apcm == NULL) { snd_device_free(chip->card, pcm); return -ENOMEM; @@ -1283,7 +1283,7 @@ int azx_init_streams(struct azx *chip) * and initialize */ for (i = 0; i < chip->num_streams; i++) { - struct azx_dev *azx_dev = kzalloc_obj(*azx_dev, GFP_KERNEL); + struct azx_dev *azx_dev = kzalloc_obj(*azx_dev); int dir, tag; if (!azx_dev) diff --git a/sound/hda/common/jack.c b/sound/hda/common/jack.c index 87120868d123..98ba1c4d5ba4 100644 --- a/sound/hda/common/jack.c +++ b/sound/hda/common/jack.c @@ -329,7 +329,7 @@ snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid, callback = find_callback_from_list(jack, func); if (func && !callback) { - callback = kzalloc_obj(*callback, GFP_KERNEL); + callback = kzalloc_obj(*callback); if (!callback) return ERR_PTR(-ENOMEM); callback->func = func; diff --git a/sound/hda/common/proc.c b/sound/hda/common/proc.c index 98cad7ea8cf1..ce76b8190b9f 100644 --- a/sound/hda/common/proc.c +++ b/sound/hda/common/proc.c @@ -689,7 +689,7 @@ static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_c if (conn_len <= 0) return; - conn = kmalloc_objs(hda_nid_t, conn_len, GFP_KERNEL); + conn = kmalloc_objs(hda_nid_t, conn_len); if (!conn) return; diff --git a/sound/hda/core/ext/controller.c b/sound/hda/core/ext/controller.c index 0c12ff36d992..b1f1eff1d181 100644 --- a/sound/hda/core/ext/controller.c +++ b/sound/hda/core/ext/controller.c @@ -89,7 +89,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus) dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count); for (idx = 0; idx < link_count; idx++) { - hlink = kzalloc_obj(*hlink, GFP_KERNEL); + hlink = kzalloc_obj(*hlink); if (!hlink) return -ENOMEM; hlink->index = idx; diff --git a/sound/hda/core/sysfs.c b/sound/hda/core/sysfs.c index 443f00d037a3..09d88f22957a 100644 --- a/sound/hda/core/sysfs.c +++ b/sound/hda/core/sysfs.c @@ -339,7 +339,7 @@ static int add_widget_node(struct kobject *parent, hda_nid_t nid, const struct attribute_group *group, struct kobject **res) { - struct kobject *kobj = kzalloc_obj(*kobj, GFP_KERNEL); + struct kobject *kobj = kzalloc_obj(*kobj); int err; if (!kobj) @@ -366,7 +366,7 @@ static int widget_tree_create(struct hdac_device *codec) int i, err; hda_nid_t nid; - tree = codec->widgets = kzalloc_obj(*tree, GFP_KERNEL); + tree = codec->widgets = kzalloc_obj(*tree); if (!tree) return -ENOMEM; @@ -436,7 +436,7 @@ int hda_widget_sysfs_reinit(struct hdac_device *codec, if (!tree) return -ENOMEM; - tree->nodes = kzalloc_objs(*tree->nodes, num_nodes + 1, GFP_KERNEL); + tree->nodes = kzalloc_objs(*tree->nodes, num_nodes + 1); if (!tree->nodes) { kfree(tree); return -ENOMEM; diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c index a4717449cc2f..1de985ba85d9 100644 --- a/sound/i2c/cs8427.c +++ b/sound/i2c/cs8427.c @@ -269,7 +269,7 @@ int snd_cs8427_create(struct snd_i2c_bus *bus, &device); if (err < 0) return err; - chip = device->private_data = kzalloc_obj(*chip, GFP_KERNEL); + chip = device->private_data = kzalloc_obj(*chip); if (chip == NULL) { snd_i2c_device_free(device); return -ENOMEM; diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c index 8bb49f0d97e6..46b201188c56 100644 --- a/sound/i2c/i2c.c +++ b/sound/i2c/i2c.c @@ -72,7 +72,7 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name, }; *ri2c = NULL; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (bus == NULL) return -ENOMEM; mutex_init(&bus->lock_mutex); @@ -104,7 +104,7 @@ int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name, *rdevice = NULL; if (snd_BUG_ON(!bus)) return -EINVAL; - device = kzalloc_obj(*device, GFP_KERNEL); + device = kzalloc_obj(*device); if (device == NULL) return -ENOMEM; device->addr = addr; diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index b1bfc71aab22..6ef5fffda8d7 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c @@ -64,7 +64,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, .dev_free = snd_ak4113_dev_free, }; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index 6d51e2a8db2b..71efb29b6c7c 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c @@ -64,7 +64,7 @@ int snd_ak4114_create(struct snd_card *card, .dev_free = snd_ak4114_dev_free, }; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 8f4657aa6525..7ff3730d2a64 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -57,7 +57,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t .dev_free = snd_ak4117_dev_free, }; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; spin_lock_init(&chip->lock); diff --git a/sound/i2c/tea6330t.c b/sound/i2c/tea6330t.c index b63dfc50c1c2..e8c50a036bea 100644 --- a/sound/i2c/tea6330t.c +++ b/sound/i2c/tea6330t.c @@ -285,7 +285,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card, u8 default_treble, default_bass; unsigned char bytes[7]; - tea = kzalloc_obj(*tea, GFP_KERNEL); + tea = kzalloc_obj(*tea); if (tea == NULL) return -ENOMEM; err = snd_i2c_device_create(bus, "TEA6330T", TEA6330T_ADDR, &device); diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c index 0b6e56c16e38..b2b189c83569 100644 --- a/sound/isa/gus/gus_main.c +++ b/sound/isa/gus/gus_main.c @@ -116,7 +116,7 @@ int snd_gus_create(struct snd_card *card, }; *rgus = NULL; - gus = kzalloc_obj(*gus, GFP_KERNEL); + gus = kzalloc_obj(*gus); if (gus == NULL) return -ENOMEM; spin_lock_init(&gus->reg_lock); diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c index 65e5426a43fd..927a2bc80511 100644 --- a/sound/isa/gus/gus_mem.c +++ b/sound/isa/gus/gus_mem.c @@ -21,7 +21,7 @@ snd_gf1_mem_xalloc(struct snd_gf1_mem *alloc, struct snd_gf1_mem_block *block, { struct snd_gf1_mem_block *pblock, *nblock; - nblock = kmalloc_obj(struct snd_gf1_mem_block, GFP_KERNEL); + nblock = kmalloc_obj(struct snd_gf1_mem_block); if (nblock == NULL) return NULL; *nblock = *block; diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c index fdb14acaddcf..04c212882718 100644 --- a/sound/isa/gus/gus_mem_proc.c +++ b/sound/isa/gus/gus_mem_proc.c @@ -50,7 +50,7 @@ int snd_gf1_mem_proc_init(struct snd_gus_card * gus) for (idx = 0; idx < 4; idx++) { if (gus->gf1.mem_alloc.banks_8[idx].size > 0) { - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return -ENOMEM; priv->gus = gus; @@ -67,7 +67,7 @@ int snd_gf1_mem_proc_init(struct snd_gus_card * gus) } for (idx = 0; idx < 4; idx++) { if (gus->gf1.rom_present & (1 << idx)) { - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (priv == NULL) return -ENOMEM; priv->rom = 1; diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index b5da8d970b3f..caf371897b78 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -638,7 +638,7 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int err; - pcmp = kzalloc_obj(*pcmp, GFP_KERNEL); + pcmp = kzalloc_obj(*pcmp); if (pcmp == NULL) return -ENOMEM; pcmp->gus = gus; diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index a3071cd2e9a8..d2ca70aad162 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -221,7 +221,7 @@ static int emu8k_pcm_open(struct snd_pcm_substream *subs) struct snd_emu8k_pcm *rec; struct snd_pcm_runtime *runtime = subs->runtime; - rec = kzalloc_obj(*rec, GFP_KERNEL); + rec = kzalloc_obj(*rec); if (! rec) return -ENOMEM; diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c index 834b38de9afd..bece60051e41 100644 --- a/sound/isa/sb/sb16_csp.c +++ b/sound/isa/sb/sb16_csp.c @@ -117,7 +117,7 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep) if (err < 0) return err; - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) { snd_device_free(chip->card, hw); return -ENOMEM; diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index 0b91b3b28f7f..33b563707a58 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -1381,7 +1381,7 @@ wavefront_load_patch (snd_wavefront_t *dev, const char __user *addr) wavefront_patch_info *header; int err; - header = kmalloc_obj(*header, GFP_KERNEL); + header = kmalloc_obj(*header); if (! header) return -ENOMEM; diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index c865c7ba3636..2beb6a0dc3b7 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c @@ -773,7 +773,7 @@ static int hal2_create(struct snd_card *card, struct snd_hal2 **rchip) struct hpc3_regs *hpc3 = hpc3c0; int err; - hal2 = kzalloc_obj(*hal2, GFP_KERNEL); + hal2 = kzalloc_obj(*hal2); if (!hal2) return -ENOMEM; diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index af2690d901b4..497d84cff12f 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -788,7 +788,7 @@ static int snd_sgio2audio_create(struct snd_card *card, if (!(readq(&mace->perif.audio.control) & AUDIO_CONTROL_CODEC_PRESENT)) return -ENOENT; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index e9f30201cf4b..fb40476c6c91 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -852,7 +852,7 @@ snd_harmony_create(struct snd_card *card, *rchip = NULL; - h = kzalloc_obj(*h, GFP_KERNEL); + h = kzalloc_obj(*h); if (h == NULL) return -ENOMEM; diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 7392bc15affa..0bb65be021d9 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1957,7 +1957,7 @@ int snd_ac97_bus(struct snd_card *card, int num, if (snd_BUG_ON(!card)) return -EINVAL; - bus = kzalloc_obj(*bus, GFP_KERNEL); + bus = kzalloc_obj(*bus); if (bus == NULL) return -ENOMEM; bus->card = card; @@ -2069,7 +2069,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, return -EBUSY; card = bus->card; - ac97 = kzalloc_obj(*ac97, GFP_KERNEL); + ac97 = kzalloc_obj(*ac97); if (ac97 == NULL) return -ENOMEM; ac97->private_data = template->private_data; diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 9df21c42d624..cbfbabb02818 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -441,7 +441,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus, unsigned int rates; struct snd_ac97 *codec; - rpcms = kzalloc_objs(struct ac97_pcm, pcms_count, GFP_KERNEL); + rpcms = kzalloc_objs(struct ac97_pcm, pcms_count); if (rpcms == NULL) return -ENOMEM; memset(avail_slots, 0, sizeof(avail_slots)); diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index c7f32b1de462..6f35b616efc6 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c @@ -373,7 +373,7 @@ int snd_ak4531_mixer(struct snd_card *card, return -EINVAL; if (rak4531) *rak4531 = NULL; - ak4531 = kzalloc_obj(*ak4531, GFP_KERNEL); + ak4531 = kzalloc_obj(*ak4531); if (ak4531 == NULL) return -ENOMEM; *ak4531 = *_ak4531; diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 5b82777522d8..a73893a2cbd6 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -342,7 +342,7 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream) { struct snd_als300 *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_als300_substream_data *data = kzalloc_obj(*data, GFP_KERNEL); + struct snd_als300_substream_data *data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -369,7 +369,7 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream) { struct snd_als300 *chip = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_als300_substream_data *data = kzalloc_obj(*data, GFP_KERNEL); + struct snd_als300_substream_data *data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index c5f38fc88c86..3a64d0562803 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -975,7 +975,7 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_hardware snd_card_asihpi_playback; int err; - dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm); if (dpcm == NULL) return -ENOMEM; @@ -1145,7 +1145,7 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) struct snd_pcm_hardware snd_card_asihpi_capture; int err; - dpcm = kzalloc_obj(*dpcm, GFP_KERNEL); + dpcm = kzalloc_obj(*dpcm); if (dpcm == NULL) return -ENOMEM; diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c index 41b2892a9312..c8d1518ee3e7 100644 --- a/sound/pci/asihpi/hpi6000.c +++ b/sound/pci/asihpi/hpi6000.c @@ -406,7 +406,7 @@ static void subsys_create_adapter(struct hpi_message *phm, memset(&ao, 0, sizeof(ao)); - ao.priv = kzalloc_obj(struct hpi_hw_obj, GFP_KERNEL); + ao.priv = kzalloc_obj(struct hpi_hw_obj); if (!ao.priv) { HPI_DEBUG_LOG(ERROR, "can't get mem for adapter object\n"); phr->error = HPI_ERROR_MEMORY_ALLOC; diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index c484d929d6da..98e7f7fa75c3 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c @@ -461,7 +461,7 @@ static void subsys_create_adapter(struct hpi_message *phm, memset(&ao, 0, sizeof(ao)); - ao.priv = kzalloc_obj(struct hpi_hw_obj, GFP_KERNEL); + ao.priv = kzalloc_obj(struct hpi_hw_obj); if (!ao.priv) { HPI_DEBUG_LOG(ERROR, "can't get mem for adapter object\n"); phr->error = HPI_ERROR_MEMORY_ALLOC; diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 2378bdeb1f23..d846777e7462 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c @@ -641,12 +641,12 @@ void hpi_cmn_control_cache_sync_to_msg(struct hpi_control_cache *p_cache, struct hpi_control_cache *hpi_alloc_control_cache(const u32 control_count, const u32 size_in_bytes, u8 *p_dsp_control_buffer) { - struct hpi_control_cache *p_cache = kmalloc_obj(*p_cache, GFP_KERNEL); + struct hpi_control_cache *p_cache = kmalloc_obj(*p_cache); if (!p_cache) return NULL; p_cache->p_info = - kzalloc_objs(*p_cache->p_info, control_count, GFP_KERNEL); + kzalloc_objs(*p_cache->p_info, control_count); if (!p_cache->p_info) { kfree(p_cache); return NULL; diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index 8eda87107b28..b1b5a131f626 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c @@ -69,7 +69,7 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, } HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); - dsp_code->pvt = kmalloc_obj(*dsp_code->pvt, GFP_KERNEL); + dsp_code->pvt = kmalloc_obj(*dsp_code->pvt); if (!dsp_code->pvt) { err_ret = HPI_ERROR_MEMORY_ALLOC; goto error2; diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 24c116ab9cf5..9de9ae7032b8 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -105,8 +105,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (cmd != HPI_IOCTL_LINUX) return -EINVAL; - hm = kmalloc_obj(*hm, GFP_KERNEL); - hr = kzalloc_obj(*hr, GFP_KERNEL); + hm = kmalloc_obj(*hm); + hr = kzalloc_obj(*hr); if (!hm || !hr) { err = -ENOMEM; goto out; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index bdf9453939f3..35392f6525b3 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -543,7 +543,7 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr struct snd_pcm_runtime *runtime = substream->runtime; int err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; @@ -638,7 +638,7 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre struct snd_pcm_runtime *runtime = substream->runtime; int err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (!epcm) return -ENOMEM; diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 189948f70d84..cd73b6833639 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -1096,7 +1096,7 @@ static int save_mixer_state(struct cmipci *cm) struct snd_ctl_elem_value *val; unsigned int i; - val = kmalloc_obj(*val, GFP_KERNEL); + val = kmalloc_obj(*val); if (!val) return -ENOMEM; for (i = 0; i < CM_SAVED_MIXERS; i++) { @@ -1130,7 +1130,7 @@ static void restore_mixer_state(struct cmipci *cm) struct snd_ctl_elem_value *val; unsigned int i; - val = kmalloc_obj(*val, GFP_KERNEL); + val = kmalloc_obj(*val); if (!val) return; cm->mixer_insensitive = 0; /* at first clear this; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index d7bed722d939..1c11023184ac 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -401,7 +401,7 @@ static int load_firmware(struct snd_cs46xx *chip, } err = -ENOMEM; - module = kzalloc_obj(*module, GFP_KERNEL); + module = kzalloc_obj(*module); if (!module) goto error; module->module_name = kstrdup(fw_name, GFP_KERNEL); @@ -414,7 +414,7 @@ static int load_firmware(struct snd_cs46xx *chip, if (nums >= 40) goto error_inval; module->symbol_table.symbols = - kzalloc_objs(struct dsp_symbol_entry, nums, GFP_KERNEL); + kzalloc_objs(struct dsp_symbol_entry, nums); if (!module->symbol_table.symbols) goto error; for (i = 0; i < nums; i++) { @@ -434,7 +434,7 @@ static int load_firmware(struct snd_cs46xx *chip, if (nums > 10) goto error_inval; module->segments = - kzalloc_objs(struct dsp_segment_desc, nums, GFP_KERNEL); + kzalloc_objs(struct dsp_segment_desc, nums); if (!module->segments) goto error; for (i = 0; i < nums; i++) { diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index c55ff043d1d7..fd19365026b4 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -234,7 +234,7 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, ins->proc_dsp_dir); if (entry) { - scb_info = kmalloc_obj(struct proc_scb_info, GFP_KERNEL); + scb_info = kmalloc_obj(struct proc_scb_info); if (!scb_info) { snd_info_free_entry(entry); entry = NULL; diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c index c22e3173ec1b..5fc1c922620a 100644 --- a/sound/pci/ctxfi/ctamixer.c +++ b/sound/pci/ctxfi/ctamixer.c @@ -296,7 +296,7 @@ int amixer_mgr_create(struct hw *hw, void **ramixer_mgr) struct amixer_mgr *amixer_mgr; *ramixer_mgr = NULL; - amixer_mgr = kzalloc_obj(*amixer_mgr, GFP_KERNEL); + amixer_mgr = kzalloc_obj(*amixer_mgr); if (!amixer_mgr) return -ENOMEM; @@ -448,7 +448,7 @@ int sum_mgr_create(struct hw *hw, void **rsum_mgr) struct sum_mgr *sum_mgr; *rsum_mgr = NULL; - sum_mgr = kzalloc_obj(*sum_mgr, GFP_KERNEL); + sum_mgr = kzalloc_obj(*sum_mgr); if (!sum_mgr) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index f130a2722a70..f122e396bc55 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1723,7 +1723,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci, *ratc = NULL; - atc = kzalloc_obj(*atc, GFP_KERNEL); + atc = kzalloc_obj(*atc); if (!atc) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 12653f7cd9e8..b8bde27f3a1d 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c @@ -159,7 +159,7 @@ static int dao_set_left_input(struct dao *dao, struct rsc *input) struct daio *daio = &dao->daio; int i; - entry = kzalloc_objs(*entry, daio->rscl.msr, GFP_KERNEL); + entry = kzalloc_objs(*entry, daio->rscl.msr); if (!entry) return -ENOMEM; @@ -188,7 +188,7 @@ static int dao_set_right_input(struct dao *dao, struct rsc *input) struct daio *daio = &dao->daio; int i; - entry = kzalloc_objs(*entry, daio->rscr.msr, GFP_KERNEL); + entry = kzalloc_objs(*entry, daio->rscr.msr); if (!entry) return -ENOMEM; @@ -660,7 +660,7 @@ int daio_mgr_create(struct hw *hw, void **rdaio_mgr) struct imapper *entry; *rdaio_mgr = NULL; - daio_mgr = kzalloc_obj(*daio_mgr, GFP_KERNEL); + daio_mgr = kzalloc_obj(*daio_mgr); if (!daio_mgr) return -ENOMEM; @@ -671,7 +671,7 @@ int daio_mgr_create(struct hw *hw, void **rdaio_mgr) spin_lock_init(&daio_mgr->mgr_lock); spin_lock_init(&daio_mgr->imap_lock); INIT_LIST_HEAD(&daio_mgr->imappers); - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto error2; diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 0851453b8565..06753f555944 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -157,7 +157,7 @@ static int src_get_rsc_ctrl_blk(void **rblk) struct src_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -483,7 +483,7 @@ static int src_mgr_get_ctrl_blk(void **rblk) struct src_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -504,7 +504,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk) struct srcimp_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -691,7 +691,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk) struct amixer_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -898,7 +898,7 @@ static int dai_get_ctrl_blk(void **rblk) struct dai_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -947,7 +947,7 @@ static int dao_get_ctrl_blk(void **rblk) struct dao_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -1141,7 +1141,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk) struct daio_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -2227,7 +2227,7 @@ int create_20k1_hw_obj(struct hw **rhw) struct hw20k1 *hw20k1; *rhw = NULL; - hw20k1 = kzalloc_obj(*hw20k1, GFP_KERNEL); + hw20k1 = kzalloc_obj(*hw20k1); if (!hw20k1) return -ENOMEM; diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 1d558914a26a..07e1490a6d17 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -157,7 +157,7 @@ static int src_get_rsc_ctrl_blk(void **rblk) struct src_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -483,7 +483,7 @@ static int src_mgr_get_ctrl_blk(void **rblk) struct src_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -504,7 +504,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk) struct srcimp_mgr_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -693,7 +693,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk) struct amixer_rsc_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -882,7 +882,7 @@ static int dai_get_ctrl_blk(void **rblk) struct dai_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -932,7 +932,7 @@ static int dao_get_ctrl_blk(void **rblk) struct dao_ctrl_blk *blk; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -1084,7 +1084,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk) int i; *rblk = NULL; - blk = kzalloc_obj(*blk, GFP_KERNEL); + blk = kzalloc_obj(*blk); if (!blk) return -ENOMEM; @@ -2369,7 +2369,7 @@ int create_20k2_hw_obj(struct hw **rhw) struct hw20k2 *hw20k2; *rhw = NULL; - hw20k2 = kzalloc_obj(*hw20k2, GFP_KERNEL); + hw20k2 = kzalloc_obj(*hw20k2); if (!hw20k2) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c index 3c5b89f3eae3..e3ee76bd8482 100644 --- a/sound/pci/ctxfi/ctmixer.c +++ b/sound/pci/ctxfi/ctmixer.c @@ -969,7 +969,7 @@ static int ct_mixer_get_mem(struct ct_mixer **rmixer) *rmixer = NULL; /* Allocate mem for mixer obj */ - mixer = kzalloc_obj(*mixer, GFP_KERNEL); + mixer = kzalloc_obj(*mixer); if (!mixer) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 2b0f4130642c..fea6024f920e 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c @@ -119,7 +119,7 @@ static int ct_pcm_playback_open(struct snd_pcm_substream *substream) struct ct_atc_pcm *apcm; int err; - apcm = kzalloc_obj(*apcm, GFP_KERNEL); + apcm = kzalloc_obj(*apcm); if (!apcm) return -ENOMEM; @@ -265,7 +265,7 @@ static int ct_pcm_capture_open(struct snd_pcm_substream *substream) struct ct_atc_pcm *apcm; int err; - apcm = kzalloc_obj(*apcm, GFP_KERNEL); + apcm = kzalloc_obj(*apcm); if (!apcm) return -ENOMEM; diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index b781201c7f0e..326997bb885d 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c @@ -540,7 +540,7 @@ int src_mgr_create(struct hw *hw, void **rsrc_mgr) struct src_mgr *src_mgr; *rsrc_mgr = NULL; - src_mgr = kzalloc_obj(*src_mgr, GFP_KERNEL); + src_mgr = kzalloc_obj(*src_mgr); if (!src_mgr) return -ENOMEM; @@ -669,7 +669,7 @@ static int srcimp_rsc_init(struct srcimp *srcimp, return err; /* Reserve memory for imapper nodes */ - srcimp->imappers = kzalloc_objs(struct imapper, desc->msr, GFP_KERNEL); + srcimp->imappers = kzalloc_objs(struct imapper, desc->msr); if (!srcimp->imappers) { err = -ENOMEM; goto error1; @@ -810,7 +810,7 @@ int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr) struct imapper *entry; *rsrcimp_mgr = NULL; - srcimp_mgr = kzalloc_obj(*srcimp_mgr, GFP_KERNEL); + srcimp_mgr = kzalloc_obj(*srcimp_mgr); if (!srcimp_mgr) return -ENOMEM; @@ -821,7 +821,7 @@ int srcimp_mgr_create(struct hw *hw, void **rsrcimp_mgr) spin_lock_init(&srcimp_mgr->mgr_lock); spin_lock_init(&srcimp_mgr->imap_lock); INIT_LIST_HEAD(&srcimp_mgr->imappers); - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) { err = -ENOMEM; goto error2; diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c index 53d16f575c38..cc379d880cad 100644 --- a/sound/pci/ctxfi/cttimer.c +++ b/sound/pci/ctxfi/cttimer.c @@ -390,7 +390,7 @@ struct ct_timer *ct_timer_new(struct ct_atc *atc) struct ct_timer *atimer; struct hw *hw; - atimer = kzalloc_obj(*atimer, GFP_KERNEL); + atimer = kzalloc_obj(*atimer); if (!atimer) return NULL; spin_lock_init(&atimer->lock); diff --git a/sound/pci/ctxfi/ctvmem.c b/sound/pci/ctxfi/ctvmem.c index 316072863dbf..25e071cae08b 100644 --- a/sound/pci/ctxfi/ctvmem.c +++ b/sound/pci/ctxfi/ctvmem.c @@ -55,7 +55,7 @@ get_vm_block(struct ct_vm *vm, unsigned int size, struct ct_atc *atc) return entry; } - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (!block) return NULL; @@ -170,7 +170,7 @@ int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci) *rvm = NULL; - vm = kzalloc_obj(*vm, GFP_KERNEL); + vm = kzalloc_obj(*vm); if (!vm) return -ENOMEM; @@ -195,7 +195,7 @@ int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci) vm->get_ptp_phys = ct_get_ptp_phys; INIT_LIST_HEAD(&vm->unused); INIT_LIST_HEAD(&vm->used); - block = kzalloc_obj(*block, GFP_KERNEL); + block = kzalloc_obj(*block); if (NULL != block) { block->addr = 0; block->size = vm->size; diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index fdf309633c8a..214d68657707 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -265,7 +265,7 @@ static int pcm_open(struct snd_pcm_substream *substream, chip = snd_pcm_substream_chip(substream); runtime = substream->runtime; - pipe = kzalloc_obj(struct audiopipe, GFP_KERNEL); + pipe = kzalloc_obj(struct audiopipe); if (!pipe) return -ENOMEM; pipe->index = -1; /* Not configured yet */ diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index e79f773941cd..1b207ca25814 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -367,7 +367,7 @@ static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream) if (err < 0) return err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = chip; @@ -547,7 +547,7 @@ static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream) if (err < 0) return err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index a9c786fe638a..080c5fedc850 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -776,7 +776,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu, if (snd_emu10k1_look_for_ctl(emu, &id) == NULL) return -ENOENT; } - gctl = kmalloc_obj(*gctl, GFP_KERNEL); + gctl = kmalloc_obj(*gctl); if (! gctl) return -ENOMEM; err = 0; @@ -864,9 +864,9 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, struct snd_ctl_elem_value *val; int err = 0; - val = kmalloc_obj(*val, GFP_KERNEL); - gctl = kmalloc_obj(*gctl, GFP_KERNEL); - nctl = kmalloc_obj(*nctl, GFP_KERNEL); + val = kmalloc_obj(*val); + gctl = kmalloc_obj(*gctl); + nctl = kmalloc_obj(*nctl); if (!val || !gctl || !nctl) { err = -ENOMEM; goto __error; @@ -914,7 +914,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, nctl->max = gctl->max; nctl->translation = gctl->translation; if (ctl == NULL) { - ctl = kmalloc_obj(*ctl, GFP_KERNEL); + ctl = kmalloc_obj(*ctl); if (ctl == NULL) { err = -ENOMEM; kfree(knew.tlv.p); @@ -980,7 +980,7 @@ static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu, struct snd_emu10k1_fx8010_ctl *ctl; struct snd_ctl_elem_id *id; - gctl = kmalloc_obj(*gctl, GFP_KERNEL); + gctl = kmalloc_obj(*gctl); if (! gctl) return -ENOMEM; @@ -1282,7 +1282,7 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) u32 *gpr_map; err = -ENOMEM; - icode = kzalloc_obj(*icode, GFP_KERNEL); + icode = kzalloc_obj(*icode); if (!icode) return err; @@ -1290,7 +1290,7 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) GFP_KERNEL); if (!icode->gpr_map) goto __err_gpr; - controls = kzalloc_objs(*controls, SND_EMU10K1_GPR_CONTROLS, GFP_KERNEL); + controls = kzalloc_objs(*controls, SND_EMU10K1_GPR_CONTROLS); if (!controls) goto __err_ctrls; @@ -1799,7 +1799,7 @@ static int _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) u32 *gpr_map; err = -ENOMEM; - icode = kzalloc_obj(*icode, GFP_KERNEL); + icode = kzalloc_obj(*icode); if (!icode) return err; @@ -1813,7 +1813,7 @@ static int _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) if (!controls) goto __err_ctrls; - ipcm = kzalloc_obj(*ipcm, GFP_KERNEL); + ipcm = kzalloc_obj(*ipcm); if (!ipcm) goto __err_ipcm; diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 1a0fd2014691..9023f3444d20 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1132,7 +1132,7 @@ static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int i, j, err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1171,7 +1171,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; int i, err, sample_rate; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1222,7 +1222,7 @@ static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_emu10k1_pcm *epcm; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1259,7 +1259,7 @@ static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream) struct snd_emu10k1_pcm *epcm; struct snd_pcm_runtime *runtime = substream->runtime; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; @@ -1299,7 +1299,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) int nefx = emu->audigy ? 64 : 32; int idx, err; - epcm = kzalloc_obj(*epcm, GFP_KERNEL); + epcm = kzalloc_obj(*epcm); if (epcm == NULL) return -ENOMEM; epcm->emu = emu; diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 6650f0192281..b7282b3fa1b1 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -1307,7 +1307,7 @@ static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size) __found: if (buf->buf.bytes > size) { - struct esm_memory *chunk = kmalloc_obj(*chunk, GFP_KERNEL); + struct esm_memory *chunk = kmalloc_obj(*chunk); if (chunk == NULL) return NULL; chunk->buf = buf->buf; @@ -1385,7 +1385,7 @@ snd_es1968_init_dmabuf(struct es1968 *chip) INIT_LIST_HEAD(&chip->buf_list); /* allocate an empty chunk */ - chunk = kmalloc_obj(*chunk, GFP_KERNEL); + chunk = kmalloc_obj(*chunk); if (chunk == NULL) { snd_es1968_free_dmabuf(chip); return -ENOMEM; @@ -1488,7 +1488,7 @@ static int snd_es1968_playback_open(struct snd_pcm_substream *substream) if (apu1 < 0) return apu1; - es = kzalloc_obj(*es, GFP_KERNEL); + es = kzalloc_obj(*es); if (!es) { snd_es1968_free_apu_pair(chip, apu1); return -ENOMEM; @@ -1529,7 +1529,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream) return apu2; } - es = kzalloc_obj(*es, GFP_KERNEL); + es = kzalloc_obj(*es); if (!es) { snd_es1968_free_apu_pair(chip, apu1); snd_es1968_free_apu_pair(chip, apu2); diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c index e82bfc02599e..bcafa16ce547 100644 --- a/sound/pci/ice1712/ak4xxx.c +++ b/sound/pci/ice1712/ak4xxx.c @@ -115,7 +115,7 @@ int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *t struct snd_ak4xxx_private *priv; if (_priv != NULL) { - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (priv == NULL) return -ENOMEM; *priv = *_priv; diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 92c4950137b0..1191a2686dfd 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c @@ -2076,7 +2076,7 @@ static int aureon_init(struct snd_ice1712 *ice) struct aureon_spec *spec; int i, err; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -2091,7 +2091,7 @@ static int aureon_init(struct snd_ice1712 *ice) } /* to remember the register values of CS8415 */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); if (!ice->akm) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 5ea80bd596e6..897b749c70b5 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c @@ -707,7 +707,7 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) } /* second stage of initialization, analog parts and others */ - ak = ice->akm = kmalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ak = ice->akm = kmalloc_obj(struct snd_akm4xxx); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index 43a0a569de1b..26f5d5528e27 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -431,7 +431,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) break; } - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -530,7 +530,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) } /* analog section */ - ak = ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ak = ice->akm = kzalloc_obj(struct snd_akm4xxx); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c index ab651526aba9..5294c9dd782d 100644 --- a/sound/pci/ice1712/hoontech.c +++ b/sound/pci/ice1712/hoontech.c @@ -156,7 +156,7 @@ static int hoontech_init(struct snd_ice1712 *ice, bool staudio) ice->num_total_dacs = 8; ice->num_total_adcs = 8; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -301,7 +301,7 @@ static int snd_ice1712_value_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; /* analog section */ - ak = ice->akm = kmalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ak = ice->akm = kmalloc_obj(struct snd_akm4xxx); if (! ak) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 10f0eb7b347d..ab1c8ac07160 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -560,7 +560,7 @@ static int juli_init(struct snd_ice1712 *ice) struct juli_spec *spec; struct snd_akm4xxx *ak; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -594,7 +594,7 @@ static int juli_init(struct snd_ice1712 *ice) ice->num_total_dacs = 2; ice->num_total_adcs = 2; - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index b854fec347c4..fd1427d64a7b 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c @@ -668,7 +668,7 @@ static int maya44_init(struct snd_ice1712 *ice) int i; struct snd_maya44 *chip; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; mutex_init(&chip->mutex); diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index 00f97b87b06c..37756d06218d 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c @@ -125,7 +125,7 @@ static int phase22_init(struct snd_ice1712 *ice) } /* Initialize analog chips */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); ak = ice->akm; if (!ak) return -ENOMEM; @@ -411,13 +411,13 @@ static int phase28_init(struct snd_ice1712 *ice) ice->num_total_dacs = 8; ice->num_total_adcs = 2; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; /* Initialize analog chips */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 80f7bb3af420..b2bd64ece862 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -728,7 +728,7 @@ static int pontis_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; /* to remember the register values */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 039ead80dd64..6c4783b9a983 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c @@ -713,7 +713,7 @@ static int prodigy192_init(struct snd_ice1712 *ice) ice->num_total_adcs = 2; ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */ - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index 105409daf071..bb5169a69b18 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c @@ -1060,12 +1060,12 @@ static int prodigy_hifi_init(struct snd_ice1712 *ice) ice->gpio.saved[0] = 0; /* to remember the register values */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -1143,12 +1143,12 @@ static int prodigy_hd2_init(struct snd_ice1712 *ice) ice->gpio.saved[0] = 0; /* to remember the register values */ - ice->akm = kzalloc_obj(struct snd_akm4xxx, GFP_KERNEL); + ice->akm = kzalloc_obj(struct snd_akm4xxx); if (! ice->akm) return -ENOMEM; ice->akm_codecs = 1; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/psc724.c b/sound/pci/ice1712/psc724.c index bb69d5173983..7842bf98af19 100644 --- a/sound/pci/ice1712/psc724.c +++ b/sound/pci/ice1712/psc724.c @@ -383,7 +383,7 @@ static int psc724_init(struct snd_ice1712 *ice) { struct psc724_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index a4f13a3ed6cf..6a44ae969d15 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -969,7 +969,7 @@ static int qtet_init(struct snd_ice1712 *ice) val = inb(ICEMT1724(ice, RATE)); outb(val | VT1724_SPDIF_MASTER, ICEMT1724(ice, RATE)); - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; /* qtet is clocked by Xilinx array */ @@ -1005,7 +1005,7 @@ static int qtet_init(struct snd_ice1712 *ice) ice->num_total_dacs = 2; ice->num_total_adcs = 2; - ice->akm = kzalloc_objs(struct snd_akm4xxx, 2, GFP_KERNEL); + ice->akm = kzalloc_objs(struct snd_akm4xxx, 2); ak = ice->akm; if (!ak) return -ENOMEM; diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 37556ff6fb36..d9723c297d40 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c @@ -147,7 +147,7 @@ static int revo51_i2c_init(struct snd_ice1712 *ice, struct revo51_spec *spec; int err; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -470,7 +470,7 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice) int err; struct revo51_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; @@ -515,7 +515,7 @@ static int revo_init(struct snd_ice1712 *ice) } /* second stage of initialization, analog parts and others */ - ak = ice->akm = kzalloc_objs(struct snd_akm4xxx, 2, GFP_KERNEL); + ak = ice->akm = kzalloc_objs(struct snd_akm4xxx, 2); if (! ak) return -ENOMEM; switch (ice->eeprom.subvendor) { diff --git a/sound/pci/ice1712/se.c b/sound/pci/ice1712/se.c index 09f5085d2dde..d78328288fc6 100644 --- a/sound/pci/ice1712/se.c +++ b/sound/pci/ice1712/se.c @@ -660,7 +660,7 @@ static int se_init(struct snd_ice1712 *ice) { struct se_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c index 0c961b588cd2..c38f1bd1948d 100644 --- a/sound/pci/ice1712/wtm.c +++ b/sound/pci/ice1712/wtm.c @@ -579,7 +579,7 @@ static int wtm_init(struct snd_ice1712 *ice) ice->force_rdma1 = 1; /*init mutex for dac mute conflict*/ - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return -ENOMEM; ice->spec = spec; diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index bcf36b102f6f..a7760a23bfe9 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -255,7 +255,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, "add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); - buf = kmalloc_obj(*buf, GFP_KERNEL); + buf = kmalloc_obj(*buf); if (!buf) return NULL; @@ -1017,7 +1017,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int .dev_free = snd_mixart_chip_dev_free, }; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; @@ -1243,7 +1243,7 @@ static int snd_mixart_probe(struct pci_dev *pci, /* */ - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (! mgr) { pci_disable_device(pci); return -ENOMEM; diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index 9b19c83a26c5..439e3ff05fe1 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c @@ -135,9 +135,9 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) struct mixart_audio_info_req *audio_info_req; struct mixart_audio_info_resp *audio_info; - connector = kmalloc_obj(*connector, GFP_KERNEL); - audio_info_req = kmalloc_obj(*audio_info_req, GFP_KERNEL); - audio_info = kmalloc_obj(*audio_info, GFP_KERNEL); + connector = kmalloc_obj(*connector); + audio_info_req = kmalloc_obj(*audio_info_req); + audio_info = kmalloc_obj(*audio_info); if (! connector || ! audio_info_req || ! audio_info) { err = -ENOMEM; goto __error; diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 66e71bdfbc77..e7d63972c2ca 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1163,7 +1163,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr, .dev_free = pcxhr_chip_dev_free, }; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (!chip) return -ENOMEM; @@ -1488,7 +1488,7 @@ static int pcxhr_probe(struct pci_dev *pci, } /* alloc card manager */ - mgr = kzalloc_obj(*mgr, GFP_KERNEL); + mgr = kzalloc_obj(*mgr); if (! mgr) { pci_disable_device(pci); return -ENOMEM; diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 8217a42c5bb7..99c00e46ce23 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -1595,7 +1595,7 @@ static int snd_riptide_playback_open(struct snd_pcm_substream *substream) chip->playback_substream[sub_num] = substream; runtime->hw = snd_riptide_playback; - data = kzalloc_obj(struct pcmhw, GFP_KERNEL); + data = kzalloc_obj(struct pcmhw); if (data == NULL) return -ENOMEM; data->paths = lbus_play_paths[sub_num]; @@ -1618,7 +1618,7 @@ static int snd_riptide_capture_open(struct snd_pcm_substream *substream) chip->capture_substream = substream; runtime->hw = snd_riptide_capture; - data = kzalloc_obj(struct pcmhw, GFP_KERNEL); + data = kzalloc_obj(struct pcmhw); if (data == NULL) return -ENOMEM; data->paths = lbus_rec_path; @@ -1768,7 +1768,7 @@ static int snd_riptide_initialize(struct snd_riptide *chip) cif = chip->cif; if (!cif) { - cif = kzalloc_obj(struct cmdif, GFP_KERNEL); + cif = kzalloc_obj(struct cmdif); if (!cif) return -ENOMEM; cif->dev = chip->card->dev; diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 2978036aa8c5..d8bbedbc8ff6 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -6671,7 +6671,7 @@ static int snd_hdspm_create(struct snd_card *card, if (hdspm_read(hdspm, HDSPM_statusRegister2) & HDSPM_s2_tco_detect) { hdspm->midiPorts++; - hdspm->tco = kzalloc_obj(*hdspm->tco, GFP_KERNEL); + hdspm->tco = kzalloc_obj(*hdspm->tco); if (hdspm->tco) hdspm_tco_write(hdspm); @@ -6685,7 +6685,7 @@ static int snd_hdspm_create(struct snd_card *card, case AES32: if (hdspm_read(hdspm, HDSPM_statusRegister) & HDSPM_tco_detect) { hdspm->midiPorts++; - hdspm->tco = kzalloc_obj(*hdspm->tco, GFP_KERNEL); + hdspm->tco = kzalloc_obj(*hdspm->tco); if (hdspm->tco) hdspm_tco_write(hdspm); diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index b0f1433e530f..fa8d7f271eaf 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -2888,7 +2888,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) .read = snd_trident_codec_read, }; - uctl = kzalloc_obj(*uctl, GFP_KERNEL); + uctl = kzalloc_obj(*uctl); if (!uctl) return -ENOMEM; diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index dc6f603160ac..b9a09568afc9 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -864,7 +864,7 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream) if (err < 0) return err; - ypcm = kzalloc_obj(*ypcm, GFP_KERNEL); + ypcm = kzalloc_obj(*ypcm); if (ypcm == NULL) return -ENOMEM; ypcm->chip = chip; @@ -990,7 +990,7 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream, if (err < 0) return err; - ypcm = kzalloc_obj(*ypcm, GFP_KERNEL); + ypcm = kzalloc_obj(*ypcm); if (ypcm == NULL) return -ENOMEM; ypcm->chip = chip; diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index c0ae099963c8..f6fdebcff716 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c @@ -142,7 +142,7 @@ struct snd_pdacf *snd_pdacf_create(struct snd_card *card) { struct snd_pdacf *chip; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return NULL; chip->card = card; diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 5d5fccb71d70..ee36ea2842cd 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c @@ -896,7 +896,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf; #ifdef PMAC_AMP_AVAIL if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) { - struct awacs_amp *amp = kzalloc_obj(*amp, GFP_KERNEL); + struct awacs_amp *amp = kzalloc_obj(*amp); if (! amp) return -ENOMEM; chip->mixer_data = amp; diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index 5e5370e83d56..1b03a7961727 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c @@ -208,7 +208,7 @@ int snd_pmac_attach_beep(struct snd_pmac *chip) void *dmabuf; int err = -ENOMEM; - beep = kzalloc_obj(*beep, GFP_KERNEL); + beep = kzalloc_obj(*beep); if (! beep) return -ENOMEM; dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4, diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index 12829f724d86..f35cb870d26d 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -244,7 +244,7 @@ int snd_pmac_daca_init(struct snd_pmac *chip) request_module("i2c-powermac"); - mix = kzalloc_obj(*mix, GFP_KERNEL); + mix = kzalloc_obj(*mix); if (! mix) return -ENOMEM; chip->mixer_data = mix; diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 1384484fd996..ba2048ee6550 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1143,7 +1143,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) *chip_return = NULL; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; chip->card = card; diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 6cc51dcecb7e..139c7b25927a 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -1348,7 +1348,7 @@ int snd_pmac_tumbler_init(struct snd_pmac *chip) request_module("i2c-powermac"); - mix = kzalloc_obj(*mix, GFP_KERNEL); + mix = kzalloc_obj(*mix); if (! mix) return -ENOMEM; mix->headphone_irq = -1; diff --git a/sound/sh/aica.c b/sound/sh/aica.c index f6a80f04d043..9438c3a68ee9 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c @@ -330,7 +330,7 @@ static int snd_aicapcm_pcm_open(struct snd_pcm_substream if (!enable) return -ENOENT; dreamcastcard = substream->pcm->private_data; - channel = kmalloc_obj(struct aica_channel, GFP_KERNEL); + channel = kmalloc_obj(struct aica_channel); if (!channel) return -ENOMEM; /* set defaults for channel */ @@ -559,7 +559,7 @@ static int snd_aica_probe(struct platform_device *devptr) { int err; struct snd_card_aica *dreamcastcard; - dreamcastcard = kzalloc_obj(struct snd_card_aica, GFP_KERNEL); + dreamcastcard = kzalloc_obj(struct snd_card_aica); if (unlikely(!dreamcastcard)) return -ENOMEM; err = snd_card_new(&devptr->dev, index, SND_AICA_DRIVER, diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index e0ba12662da1..2d9a2d5b824e 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c @@ -306,7 +306,7 @@ static int snd_sh_dac_create(struct snd_card *card, *rchip = NULL; - chip = kzalloc_obj(*chip, GFP_KERNEL); + chip = kzalloc_obj(*chip); if (chip == NULL) return -ENOMEM; diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 19c09ba2b510..c76a4bcc9645 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -775,7 +775,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_runtime *runtime = substream->runtime; struct audio_drv_data *intr_data = dev_get_drvdata(component->dev); struct audio_substream_data *adata = - kzalloc_obj(struct audio_substream_data, GFP_KERNEL); + kzalloc_obj(struct audio_substream_data); if (!adata) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 66a30da4b801..88613569fd64 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -196,7 +196,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs struct acp_stream *stream; int ret; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c index c1c28fee0496..c30ccf23005a 100644 --- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c +++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c @@ -395,13 +395,13 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) /* One per DAI link, worst case is a DAI link for every endpoint */ struct asoc_sdw_dailink *soc_dais __free(kfree) = - kzalloc_objs(*soc_dais, num_ends, GFP_KERNEL); + kzalloc_objs(*soc_dais, num_ends); if (!soc_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ struct asoc_sdw_endpoint *soc_ends __free(kfree) = - kzalloc_objs(*soc_ends, num_ends, GFP_KERNEL); + kzalloc_objs(*soc_ends, num_ends); if (!soc_ends) return -ENOMEM; diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index 3319f0996fe6..a0fd8a6f9970 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -288,13 +288,13 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) /* One per DAI link, worst case is a DAI link for every endpoint */ struct asoc_sdw_dailink *sof_dais __free(kfree) = - kzalloc_objs(*sof_dais, num_ends, GFP_KERNEL); + kzalloc_objs(*sof_dais, num_ends); if (!sof_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ struct asoc_sdw_endpoint *sof_ends __free(kfree) = - kzalloc_objs(*sof_ends, num_ends, GFP_KERNEL); + kzalloc_objs(*sof_ends, num_ends); if (!sof_ends) return -ENOMEM; diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 5a4ba65847fd..7c529fc6ba99 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -189,7 +189,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 0c7af398de3a..366d7c4bb07e 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -318,7 +318,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component, runtime = substream->runtime; cpu_dai = snd_soc_rtd_to_cpu(prtd, 0); amd_manager = snd_soc_dai_get_drvdata(cpu_dai); - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 2716c4e18c1f..4529404ebd93 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -218,7 +218,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, prtd = snd_soc_substream_to_rtd(substream); component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); adata = dev_get_drvdata(component->dev); - i2s_data = kzalloc_obj(*i2s_data, GFP_KERNEL); + i2s_data = kzalloc_obj(*i2s_data); if (!i2s_data) return -EINVAL; diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index c2dd512118ad..e832c7c4b96f 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -211,7 +211,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index c52d2bed5c6c..6ce82cd8859b 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -213,7 +213,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); adata = dev_get_drvdata(component->dev); - i2s_data = kzalloc_obj(*i2s_data, GFP_KERNEL); + i2s_data = kzalloc_obj(*i2s_data); if (!i2s_data) return -ENOMEM; diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index b4fece9d3fac..1c8aad849916 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -187,7 +187,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, runtime = substream->runtime; adata = dev_get_drvdata(component->dev); - pdm_data = kzalloc_obj(*pdm_data, GFP_KERNEL); + pdm_data = kzalloc_obj(*pdm_data); if (!pdm_data) return -EINVAL; diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 3b3e6b2b3a50..1a0c584801f0 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -288,7 +288,7 @@ static int atmel_pcm_open(struct snd_soc_component *component, if (ret < 0) goto out; - prtd = kzalloc_obj(struct atmel_runtime_data, GFP_KERNEL); + prtd = kzalloc_obj(struct atmel_runtime_data); if (prtd == NULL) { ret = -ENOMEM; goto out; diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c index d31508419fe3..ec7233ce1f78 100644 --- a/sound/soc/atmel/mchp-pdmc.c +++ b/sound/soc/atmel/mchp-pdmc.c @@ -706,7 +706,7 @@ static int mchp_pdmc_add_chmap_ctls(struct snd_pcm *pcm, struct mchp_pdmc *dd) if (WARN_ON(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].chmap_kctl)) return -EBUSY; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; info->pcm = pcm; diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index 46bcdaa0532c..bf5f2185c526 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -81,7 +81,7 @@ static int au1000_setup_dma_link(struct audio_stream *stream, stream->period_size = period_bytes; stream->periods = periods; - stream->buffer = kmalloc_obj(struct pcm_period, GFP_KERNEL); + stream->buffer = kmalloc_obj(struct pcm_period); if (!stream->buffer) return -ENOMEM; pointer = stream->buffer; diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c index a7bc7060f742..6a3fd0d89365 100644 --- a/sound/soc/bcm/bcm63xx-pcm-whistler.c +++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c @@ -210,7 +210,7 @@ static int bcm63xx_pcm_open(struct snd_soc_component *component, goto out; ret = -ENOMEM; - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (!prtd) goto out; diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index b0383eb47407..c0dc69ce4d0e 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c @@ -346,7 +346,7 @@ static int cx20442_component_probe(struct snd_soc_component *component) { struct cx20442_priv *cx20442; - cx20442 = kzalloc_obj(struct cx20442_priv, GFP_KERNEL); + cx20442 = kzalloc_obj(struct cx20442_priv); if (cx20442 == NULL) return -ENOMEM; diff --git a/sound/soc/codecs/pcm6240.c b/sound/soc/codecs/pcm6240.c index 6911de5a8c7e..9d86793f1958 100644 --- a/sound/soc/codecs/pcm6240.c +++ b/sound/soc/codecs/pcm6240.c @@ -1234,7 +1234,7 @@ static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt, struct pcmdevice_block_data **bk_da; unsigned int config_offset = 0, i; - cfg_info = kzalloc_obj(struct pcmdevice_config_info, GFP_KERNEL); + cfg_info = kzalloc_obj(struct pcmdevice_config_info); if (!cfg_info) { *status = -ENOMEM; goto out; @@ -1276,7 +1276,7 @@ static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt, __func__, i, cfg_info->nblocks); break; } - bk_da[i] = kzalloc_obj(struct pcmdevice_block_data, GFP_KERNEL); + bk_da[i] = kzalloc_obj(struct pcmdevice_block_data); if (!bk_da[i]) { *status = -ENOMEM; break; @@ -1548,7 +1548,7 @@ static int pcmdev_regbin_ready(const struct firmware *fmw, void *ctxt) ret = -EINVAL; goto out; } - cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig, GFP_KERNEL); + cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig); if (!cfg_info) { pcm_dev->fw_state = PCMDEVICE_FW_LOAD_FAILED; ret = -ENOMEM; diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c index d3ded7d5efa1..3304d20ab2ad 100644 --- a/sound/soc/codecs/tas2781-fmwlib.c +++ b/sound/soc/codecs/tas2781-fmwlib.c @@ -176,7 +176,7 @@ static struct tasdevice_config_info *tasdevice_add_config( * of audio cases, flexible configs have been introduced in the * dsp firmware. */ - cfg_info = kzalloc_obj(struct tasdevice_config_info, GFP_KERNEL); + cfg_info = kzalloc_obj(struct tasdevice_config_info); if (!cfg_info) { *status = -ENOMEM; goto out; @@ -232,7 +232,7 @@ static struct tasdevice_config_info *tasdevice_add_config( __func__, i, cfg_info->nblocks); break; } - bk_da[i] = kzalloc_obj(struct tasdev_blk_data, GFP_KERNEL); + bk_da[i] = kzalloc_obj(struct tasdev_blk_data); if (!bk_da[i]) { *status = -ENOMEM; break; @@ -379,7 +379,7 @@ int tasdevice_rca_parser(void *context, const struct firmware *fmw) goto out; } - cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig, GFP_KERNEL); + cfg_info = kzalloc_objs(*cfg_info, fw_hdr->nconfig); if (!cfg_info) { ret = -ENOMEM; tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; @@ -2268,7 +2268,7 @@ static int tasdevice_dspfw_ready(const struct firmware *fmw, return -EINVAL; } - tas_priv->fmw = kzalloc_obj(struct tasdevice_fw, GFP_KERNEL); + tas_priv->fmw = kzalloc_obj(struct tasdevice_fw); if (!tas_priv->fmw) return -ENOMEM; diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c index ab3620761f5d..90008d2d06e2 100644 --- a/sound/soc/codecs/tas2783-sdw.c +++ b/sound/soc/codecs/tas2783-sdw.c @@ -733,8 +733,8 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) s32 img_sz, ret = 0, cur_file = 0; s32 offset = 0; - struct tas_fw_hdr *hdr __free(kfree) = kzalloc_obj(*hdr, GFP_KERNEL); - struct tas_fw_file *file __free(kfree) = kzalloc_obj(*file, GFP_KERNEL); + struct tas_fw_hdr *hdr __free(kfree) = kzalloc_obj(*hdr); + struct tas_fw_file *file __free(kfree) = kzalloc_obj(*file); if (!file || !hdr) { ret = -ENOMEM; goto out; diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c index 1da1a85cbe6b..13d07296916f 100644 --- a/sound/soc/codecs/wcd-clsh-v2.c +++ b/sound/soc/codecs/wcd-clsh-v2.c @@ -883,7 +883,7 @@ struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp, { struct wcd_clsh_ctrl *ctrl; - ctrl = kzalloc_obj(*ctrl, GFP_KERNEL); + ctrl = kzalloc_obj(*ctrl); if (!ctrl) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 56b112946b37..bb0c8478a8eb 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1515,7 +1515,7 @@ struct wcd_mbhc *wcd_mbhc_init(struct snd_soc_component *component, return ERR_PTR(-EINVAL); } - mbhc = kzalloc_obj(*mbhc, GFP_KERNEL); + mbhc = kzalloc_obj(*mbhc); if (!mbhc) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index f6166428a000..2a8c61a72c17 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -396,7 +396,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_component *comp rec->command, rec->length); len = rec->length + 8; - xfer = kzalloc_obj(*xfer, GFP_KERNEL); + xfer = kzalloc_obj(*xfer); if (!xfer) { ret = -ENOMEM; goto abort; diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 8a584fd8f5de..1f4aac4017cf 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -542,7 +542,7 @@ static void wm_adsp_ctl_work(struct work_struct *work) cs_dsp); struct snd_kcontrol_new *kcontrol; - kcontrol = kzalloc_obj(*kcontrol, GFP_KERNEL); + kcontrol = kzalloc_obj(*kcontrol); if (!kcontrol) return; @@ -627,7 +627,7 @@ int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) " %.*s", cs_ctl->subname_len - skip, cs_ctl->subname + skip); } - ctl = kzalloc_obj(*ctl, GFP_KERNEL); + ctl = kzalloc_obj(*ctl); if (!ctl) return -ENOMEM; ctl->cs_ctl = cs_ctl; @@ -1259,7 +1259,7 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream) } } - compr = kzalloc_obj(*compr, GFP_KERNEL); + compr = kzalloc_obj(*compr); if (!compr) { ret = -ENOMEM; goto out; @@ -1477,7 +1477,7 @@ static struct wm_adsp_compr_buf *wm_adsp_buffer_alloc(struct wm_adsp *dsp) { struct wm_adsp_compr_buf *buf; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return NULL; diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 7a16a895cb0e..7d39378c0622 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -155,7 +155,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair, if (buf_len % max_period_size) sg_len += 1; - sg = kmalloc_objs(*sg, sg_len, GFP_KERNEL); + sg = kmalloc_objs(*sg, sg_len); if (!sg) return -ENOMEM; @@ -420,7 +420,7 @@ static struct sg_table *fsl_asrc_m2m_map_dma_buf(struct dma_buf_attachment *atta struct snd_dma_buffer *dmab = attachment->dmabuf->priv; struct sg_table *sgt; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) return NULL; diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 44834dba4cb7..26ddbe867b58 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -848,7 +848,7 @@ static int fsl_soc_dma_probe(struct platform_device *pdev) return ret; } - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) { of_node_put(ssi_np); return -ENOMEM; diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c index 747c8253b77b..43d401ae2d03 100644 --- a/sound/soc/fsl/fsl_qmc_audio.c +++ b/sound/soc/fsl/fsl_qmc_audio.c @@ -316,7 +316,7 @@ static int qmc_audio_pcm_open(struct snd_soc_component *component, if (ret < 0) return ret; - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (!prtd) return -ENOMEM; diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 8a1a7c89781f..d51a3de493cb 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -176,7 +176,7 @@ static int snd_imx_open(struct snd_soc_component *component, struct imx_pcm_runtime_data *iprtd; int ret; - iprtd = kzalloc_obj(*iprtd, GFP_KERNEL); + iprtd = kzalloc_obj(*iprtd); if (iprtd == NULL) return -ENOMEM; runtime->private_data = iprtd; diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 41255ff305b3..a593a95aa532 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -333,7 +333,7 @@ int mpc5200_audio_dma_create(struct platform_device *op) } /* Allocate and initialize the driver private data */ - psc_dma = kzalloc_obj(*psc_dma, GFP_KERNEL); + psc_dma = kzalloc_obj(*psc_dma); if (!psc_dma) { ret = -ENOMEM; goto out_unmap; diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 44b62f5615f2..db07817a8024 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c @@ -211,7 +211,7 @@ static int p1022_ds_probe(struct platform_device *pdev) return -EINVAL; } - mdata = kzalloc_obj(struct machine_data, GFP_KERNEL); + mdata = kzalloc_obj(struct machine_data); if (!mdata) { ret = -ENOMEM; goto error_put; diff --git a/sound/soc/fsl/p1022_rdk.c b/sound/soc/fsl/p1022_rdk.c index 43a95cd590cf..f80d6d04e791 100644 --- a/sound/soc/fsl/p1022_rdk.c +++ b/sound/soc/fsl/p1022_rdk.c @@ -226,7 +226,7 @@ static int p1022_rdk_probe(struct platform_device *pdev) return -EINVAL; } - mdata = kzalloc_obj(struct machine_data, GFP_KERNEL); + mdata = kzalloc_obj(struct machine_data); if (!mdata) { ret = -ENOMEM; goto error_put; diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 965d7bb55929..8a5f41704739 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -553,7 +553,7 @@ int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev) struct snd_soc_card *card = simple_priv_to_card(priv); int ret = -ENOMEM; - struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li); if (!li) goto end; diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 85043bc3c3d3..0202ed0ee78e 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -1305,7 +1305,7 @@ int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev, struct snd_soc_card *card = simple_priv_to_card(priv); int ret; - struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li); if (!li) return -ENOMEM; diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 5bc6d7cd1921..06638f9a74b8 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -726,7 +726,7 @@ static int simple_probe(struct platform_device *pdev) card->driver_name = "simple-card"; ret = -ENOMEM; - struct link_info *li __free(kfree) = kzalloc_obj(*li, GFP_KERNEL); + struct link_info *li __free(kfree) = kzalloc_obj(*li); if (!li) goto end; diff --git a/sound/soc/intel/atom/sst-mfld-platform-compress.c b/sound/soc/intel/atom/sst-mfld-platform-compress.c index 877df5ce156d..b0ba1af0a65f 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-compress.c +++ b/sound/soc/intel/atom/sst-mfld-platform-compress.c @@ -47,7 +47,7 @@ static int sst_platform_compr_open(struct snd_soc_component *component, struct snd_compr_runtime *runtime = cstream->runtime; struct sst_runtime_stream *stream; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index e007db432b49..67caea39b557 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -306,7 +306,7 @@ static int sst_media_open(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; struct sst_runtime_stream *stream; - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; spin_lock_init(&stream->status_lock); diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c index 5313c8ec605e..d9d695ed7cfb 100644 --- a/sound/soc/intel/atom/sst/sst.c +++ b/sound/soc/intel/atom/sst/sst.c @@ -463,7 +463,7 @@ static int intel_sst_suspend(struct device *dev) return -EBUSY; /* save the memories */ - fw_save = kzalloc_obj(*fw_save, GFP_KERNEL); + fw_save = kzalloc_obj(*fw_save); if (!fw_save) return -ENOMEM; fw_save->iram = kvzalloc(ctx->iram_end - ctx->iram_base, GFP_KERNEL); diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c index bdf68d69127f..0d5e71e8a5b5 100644 --- a/sound/soc/intel/atom/sst/sst_ipc.c +++ b/sound/soc/intel/atom/sst/sst_ipc.c @@ -31,7 +31,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx, struct sst_block *msg; dev_dbg(ctx->dev, "Enter\n"); - msg = kzalloc_obj(*msg, GFP_KERNEL); + msg = kzalloc_obj(*msg); if (!msg) return NULL; msg->condition = false; diff --git a/sound/soc/intel/atom/sst/sst_loader.c b/sound/soc/intel/atom/sst/sst_loader.c index 60b73c9c2306..a043443d2887 100644 --- a/sound/soc/intel/atom/sst/sst_loader.c +++ b/sound/soc/intel/atom/sst/sst_loader.c @@ -148,7 +148,7 @@ static int sst_fill_memcpy_list(struct list_head *memcpy_list, { struct sst_memcpy_list *listnode; - listnode = kzalloc_obj(*listnode, GFP_KERNEL); + listnode = kzalloc_obj(*listnode); if (listnode == NULL) return -ENOMEM; listnode->dstn = destn; diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c index a080d85d30a6..2291f9728a54 100644 --- a/sound/soc/intel/avs/path.c +++ b/sound/soc/intel/avs/path.c @@ -880,7 +880,7 @@ avs_path_module_create(struct avs_dev *adev, if (module_id < 0) return ERR_PTR(module_id); - mod = kzalloc_obj(*mod, GFP_KERNEL); + mod = kzalloc_obj(*mod); if (!mod) return ERR_PTR(-ENOMEM); @@ -968,7 +968,7 @@ static struct avs_path_binding *avs_path_binding_create(struct avs_dev *adev, { struct avs_path_binding *binding; - binding = kzalloc_obj(*binding, GFP_KERNEL); + binding = kzalloc_obj(*binding); if (!binding) return ERR_PTR(-ENOMEM); @@ -1043,7 +1043,7 @@ avs_path_pipeline_create(struct avs_dev *adev, struct avs_path *owner, struct avs_tplg_module *tmod; int ret, i; - ppl = kzalloc_obj(*ppl, GFP_KERNEL); + ppl = kzalloc_obj(*ppl); if (!ppl) return ERR_PTR(-ENOMEM); @@ -1173,7 +1173,7 @@ static struct avs_path *avs_path_create_unlocked(struct avs_dev *adev, u32 dma_i struct avs_path *path; int ret; - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index b8f5e1185a1a..d53c2f76fcd4 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -130,7 +130,7 @@ static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_d return -EINVAL; } - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/soc/intel/avs/utils.c b/sound/soc/intel/avs/utils.c index df4d4e2f6c4f..ee36725ac731 100644 --- a/sound/soc/intel/avs/utils.c +++ b/sound/soc/intel/avs/utils.c @@ -124,7 +124,7 @@ avs_module_ida_alloc(struct avs_dev *adev, struct avs_mods_info *newinfo, bool p tocopy_count = oldinfo->count; } - ida_ptrs = kzalloc_objs(*ida_ptrs, newinfo->count, GFP_KERNEL); + ida_ptrs = kzalloc_objs(*ida_ptrs, newinfo->count); if (!ida_ptrs) return -ENOMEM; @@ -132,7 +132,7 @@ avs_module_ida_alloc(struct avs_dev *adev, struct avs_mods_info *newinfo, bool p memcpy(ida_ptrs, adev->mod_idas, tocopy_count * sizeof(*ida_ptrs)); for (i = tocopy_count; i < newinfo->count; i++) { - ida_ptrs[i] = kzalloc_obj(**ida_ptrs, GFP_KERNEL); + ida_ptrs[i] = kzalloc_obj(**ida_ptrs); if (!ida_ptrs[i]) { while (i--) kfree(ida_ptrs[i]); @@ -246,7 +246,7 @@ int avs_request_firmware(struct avs_dev *adev, const struct firmware **fw_p, con } /* FW is not loaded, let's load it now and add to the list */ - entry = kzalloc_obj(*entry, GFP_KERNEL); + entry = kzalloc_obj(*entry); if (!entry) return -ENOMEM; diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 65bc023ab01b..f230991f5f8e 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1251,12 +1251,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) * add one additional to act as a terminator such that code can iterate * until it hits an uninitialised DAI. */ - sof_dais = kzalloc_objs(*sof_dais, num_ends + 1, GFP_KERNEL); + sof_dais = kzalloc_objs(*sof_dais, num_ends + 1); if (!sof_dais) return -ENOMEM; /* One per endpoint, ie. each DAI on each codec/amp */ - sof_ends = kzalloc_objs(*sof_ends, num_ends, GFP_KERNEL); + sof_ends = kzalloc_objs(*sof_ends, num_ends); if (!sof_ends) { ret = -ENOMEM; goto err_dai; diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index b3e8ea4b92b4..2c5ea4e0ff3d 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -263,7 +263,7 @@ static int catpt_dai_startup(struct snd_pcm_substream *substream, template = catpt_get_stream_template(substream); - stream = kzalloc_obj(*stream, GFP_KERNEL); + stream = kzalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c index 8cf0feb64ff9..f26b2951bc9c 100644 --- a/sound/soc/loongson/loongson_dma.c +++ b/sound/soc/loongson/loongson_dma.c @@ -243,7 +243,7 @@ static int loongson_pcm_open(struct snd_soc_component *component, SNDRV_PCM_HW_PARAM_PERIODS); snd_soc_set_runtime_hwparams(substream, &ls_pcm_hardware); - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (!prtd) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c b/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c index 53f30d12195b..642f4fb55ca6 100644 --- a/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c +++ b/sound/soc/mediatek/mt8186/mt8186-audsys-clk.c @@ -135,7 +135,7 @@ int mt8186_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c index 2ef5ed3ee200..972f097a13ca 100644 --- a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c @@ -193,7 +193,7 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return -ENOMEM; diff --git a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c index ec069729253e..e6fefc320443 100644 --- a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c +++ b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c @@ -199,7 +199,7 @@ int mt8195_audsys_clk_register(struct mtk_base_afe *afe) } /* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ - cl = kzalloc_obj(*cl, GFP_KERNEL); + cl = kzalloc_obj(*cl); if (!cl) return -ENOMEM; diff --git a/sound/soc/meson/aiu-fifo.c b/sound/soc/meson/aiu-fifo.c index b17a62727fc7..8b54f9681d00 100644 --- a/sound/soc/meson/aiu-fifo.c +++ b/sound/soc/meson/aiu-fifo.c @@ -196,7 +196,7 @@ int aiu_fifo_dai_probe(struct snd_soc_dai *dai) { struct aiu_fifo *fifo; - fifo = kzalloc_obj(*fifo, GFP_KERNEL); + fifo = kzalloc_obj(*fifo); if (!fifo) return -ENOMEM; diff --git a/sound/soc/meson/axg-tdm-formatter.c b/sound/soc/meson/axg-tdm-formatter.c index 1fd78790c967..f451e4dce442 100644 --- a/sound/soc/meson/axg-tdm-formatter.c +++ b/sound/soc/meson/axg-tdm-formatter.c @@ -368,7 +368,7 @@ struct axg_tdm_stream *axg_tdm_stream_alloc(struct axg_tdm_iface *iface) { struct axg_tdm_stream *ts; - ts = kzalloc_obj(*ts, GFP_KERNEL); + ts = kzalloc_obj(*ts); if (ts) { INIT_LIST_HEAD(&ts->formatter_list); mutex_init(&ts->lock); diff --git a/sound/soc/meson/meson-codec-glue.c b/sound/soc/meson/meson-codec-glue.c index bd9a91d8bc3a..2ff6066e1b6c 100644 --- a/sound/soc/meson/meson-codec-glue.c +++ b/sound/soc/meson/meson-codec-glue.c @@ -122,7 +122,7 @@ int meson_codec_glue_input_dai_probe(struct snd_soc_dai *dai) { struct meson_codec_glue_input *data; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 790e4db9d91b..c34bfa27a446 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -85,7 +85,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, clk_prepare_enable(priv->extclk); - dma = kzalloc_obj(struct snd_dmaengine_dai_dma_data, GFP_KERNEL); + dma = kzalloc_obj(struct snd_dmaengine_dai_dma_data); if (!dma) return -ENOMEM; dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? @@ -749,7 +749,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai) struct ssp_priv *priv; int ret; - priv = kzalloc_obj(struct ssp_priv, GFP_KERNEL); + priv = kzalloc_obj(struct ssp_priv); if (!priv) return -ENOMEM; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 84909af310b4..ce6896cc015d 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -202,7 +202,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component, struct regmap *map; unsigned int dai_id = cpu_dai->driver->id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index b1851dac61fa..43d877322bae 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -1359,7 +1359,7 @@ void q6afe_tdm_port_prepare(struct q6afe_port *port, pcfg->tdm_cfg.slot_width = cfg->slot_width; pcfg->tdm_cfg.slot_mask = cfg->slot_mask; - port->scfg = kzalloc_obj(*port->scfg, GFP_KERNEL); + port->scfg = kzalloc_obj(*port->scfg); if (!port->scfg) return; diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index dcd960aeab2f..de3bdac3e791 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -348,7 +348,7 @@ static int q6apm_dai_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (prtd == NULL) return -ENOMEM; @@ -490,7 +490,7 @@ static int q6apm_dai_compr_open(struct snd_soc_component *component, if (!pdata) return -EINVAL; - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (prtd == NULL) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 99d2dcdfac25..44841fde3856 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -57,7 +57,7 @@ static struct audioreach_graph *q6apm_get_audioreach_graph(struct q6apm *apm, ui if (!info) return ERR_PTR(-ENODEV); - graph = kzalloc_obj(*graph, GFP_KERNEL); + graph = kzalloc_obj(*graph); if (!graph) return ERR_PTR(-ENOMEM); @@ -220,7 +220,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a return 0; } - buf = kzalloc_objs(struct audio_buffer, periods, GFP_KERNEL); + buf = kzalloc_objs(struct audio_buffer, periods); if (!buf) { mutex_unlock(&graph->lock); return -ENOMEM; @@ -615,7 +615,7 @@ struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb, return ERR_CAST(ar_graph); } - graph = kzalloc_obj(*graph, GFP_KERNEL); + graph = kzalloc_obj(*graph); if (!graph) { ret = -ENOMEM; goto put_ar_graph; diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 99c1969d5cdc..9e3d176f50c2 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -378,7 +378,7 @@ static int q6asm_dai_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc_obj(struct q6asm_dai_rtd, GFP_KERNEL); + prtd = kzalloc_obj(struct q6asm_dai_rtd); if (prtd == NULL) return -ENOMEM; @@ -621,7 +621,7 @@ static int q6asm_dai_compr_open(struct snd_soc_component *component, return -EINVAL; } - prtd = kzalloc_obj(*prtd, GFP_KERNEL); + prtd = kzalloc_obj(*prtd); if (!prtd) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 424306da4a25..de0bd8fd08ee 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -850,7 +850,7 @@ struct audio_client *q6asm_audio_client_alloc(struct device *dev, q6asm_cb cb, return ac; } - ac = kzalloc_obj(*ac, GFP_KERNEL); + ac = kzalloc_obj(*ac); if (!ac) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c index 393488c571cd..48825756a7ab 100644 --- a/sound/soc/qcom/qdsp6/q6core.c +++ b/sound/soc/qcom/qdsp6/q6core.c @@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(q6core_is_adsp_ready); static int q6core_probe(struct apr_device *adev) { - g_core = kzalloc_obj(*g_core, GFP_KERNEL); + g_core = kzalloc_obj(*g_core); if (!g_core) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index c3b26b318718..7386226046fa 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -1133,7 +1133,7 @@ static int q6pcm_routing_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - routing_data = kzalloc_obj(*routing_data, GFP_KERNEL); + routing_data = kzalloc_obj(*routing_data); if (!routing_data) return -ENOMEM; diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 076b55c1f729..e87ad2f65e5d 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -42,7 +42,7 @@ static struct audioreach_graph_info *audioreach_tplg_alloc_graph_info(struct q6a } *found = false; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return ERR_PTR(-ENOMEM); @@ -92,7 +92,7 @@ static struct audioreach_sub_graph *audioreach_tplg_alloc_sub_graph(struct q6apm } *found = false; - sg = kzalloc_obj(*sg, GFP_KERNEL); + sg = kzalloc_obj(*sg); if (!sg) return ERR_PTR(-ENOMEM); @@ -134,7 +134,7 @@ static struct audioreach_container *audioreach_tplg_alloc_container(struct q6apm } *found = false; - cont = kzalloc_obj(*cont, GFP_KERNEL); + cont = kzalloc_obj(*cont); if (!cont) return ERR_PTR(-ENOMEM); @@ -176,7 +176,7 @@ static struct audioreach_module *audioreach_tplg_alloc_module(struct q6apm *apm, return mod; } *found = false; - mod = kzalloc_obj(*mod, GFP_KERNEL); + mod = kzalloc_obj(*mod); if (!mod) return ERR_PTR(-ENOMEM); @@ -830,7 +830,7 @@ static int audioreach_widget_load_mixer(struct snd_soc_component *component, w_array = &tplg_w->priv.array[0]; - scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol); if (!scontrol) return -ENOMEM; @@ -1247,7 +1247,7 @@ static int audioreach_control_load(struct snd_soc_component *scomp, int index, struct snd_soc_dobj *dobj; int ret = 0; - scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol); if (!scontrol) return -ENOMEM; diff --git a/sound/soc/renesas/siu_dai.c b/sound/soc/renesas/siu_dai.c index 5e7751c8b1e3..039b1264d90d 100644 --- a/sound/soc/renesas/siu_dai.c +++ b/sound/soc/renesas/siu_dai.c @@ -453,7 +453,7 @@ int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card) struct snd_kcontrol *kctrl; int ret; - *port_info = kzalloc_obj(**port_info, GFP_KERNEL); + *port_info = kzalloc_obj(**port_info); if (!*port_info) return -ENOMEM; diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 58fade080976..beb7e09e9fac 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -290,7 +290,7 @@ static int idma_open(struct snd_soc_component *component, snd_soc_set_runtime_hwparams(substream, &idma_hardware); - prtd = kzalloc_obj(struct idma_ctrl, GFP_KERNEL); + prtd = kzalloc_obj(struct idma_ctrl); if (prtd == NULL) return -ENOMEM; diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c index 51ccaa14b443..a0191e5a5a7d 100644 --- a/sound/soc/sdca/sdca_asoc.c +++ b/sound/soc/sdca/sdca_asoc.c @@ -1349,7 +1349,7 @@ int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap, dev_dbg(dev, "%s: set channel constraint mask: %#x\n", entity->label, channel_mask); - constraint = kzalloc_obj(*constraint, GFP_KERNEL); + constraint = kzalloc_obj(*constraint); if (!constraint) return -ENOMEM; diff --git a/sound/soc/sdca/sdca_function_device.c b/sound/soc/sdca/sdca_function_device.c index dd419f426ba6..feacfbc6a518 100644 --- a/sound/soc/sdca/sdca_function_device.c +++ b/sound/soc/sdca/sdca_function_device.c @@ -39,7 +39,7 @@ static struct sdca_dev *sdca_dev_register(struct device *parent, int ret; int rc; - sdev = kzalloc_obj(*sdev, GFP_KERNEL); + sdev = kzalloc_obj(*sdev); if (!sdev) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/sdca/sdca_jack.c b/sound/soc/sdca/sdca_jack.c index 0ce9cf8f850c..49d317d3b8c8 100644 --- a/sound/soc/sdca/sdca_jack.c +++ b/sound/soc/sdca/sdca_jack.c @@ -99,7 +99,7 @@ int sdca_jack_process(struct sdca_interrupt *interrupt) if (kctl) { struct soc_enum *soc_enum = (struct soc_enum *)kctl->private_value; - ucontrol = kzalloc_obj(*ucontrol, GFP_KERNEL); + ucontrol = kzalloc_obj(*ucontrol); if (!ucontrol) return -ENOMEM; diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index f71413a186b8..5f81e3606655 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -181,7 +181,7 @@ struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *componen { struct snd_ac97 *ac97; - ac97 = kzalloc_obj(struct snd_ac97, GFP_KERNEL); + ac97 = kzalloc_obj(struct snd_ac97); if (ac97 == NULL) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 7c1f2c93d5d3..d0fffef65daf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -507,7 +507,7 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( /* * for rtd->dev */ - dev = kzalloc_obj(struct device, GFP_KERNEL); + dev = kzalloc_obj(struct device); if (!dev) return NULL; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 54ee54dcba87..5abfb183c3b1 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -638,7 +638,7 @@ static int dapm_add_path( if (ret) return ret; - path = kzalloc_obj(struct snd_soc_dapm_path, GFP_KERNEL); + path = kzalloc_obj(struct snd_soc_dapm_path); if (!path) return -ENOMEM; @@ -713,7 +713,7 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, const char *name; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -3977,7 +3977,7 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, if (!params) return -ENOMEM; - runtime = kzalloc_obj(*runtime, GFP_KERNEL); + runtime = kzalloc_obj(*runtime); if (!runtime) return -ENOMEM; diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 1a2b5a8fd198..dbec46703b35 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -437,7 +437,7 @@ int snd_dmaengine_pcm_register(struct device *dev, struct dmaengine_pcm *pcm; int ret; - pcm = kzalloc_obj(*pcm, GFP_KERNEL); + pcm = kzalloc_obj(*pcm); if (!pcm) return -ENOMEM; diff --git a/sound/soc/soc-ops-test.c b/sound/soc/soc-ops-test.c index 0f924a6b0d15..dc83107930e4 100644 --- a/sound/soc/soc-ops-test.c +++ b/sound/soc/soc-ops-test.c @@ -486,7 +486,7 @@ static void soc_ops_test_access(struct kunit *test) /* it is too large struct. use kzalloc() */ struct snd_ctl_elem_value *result; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) return; diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 1d2ebb4f63e4..f966d4e13c7f 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -454,7 +454,7 @@ static int snd_soc_clip_to_platform_max(struct snd_kcontrol *kctl) if (!mc->platform_max) return 0; - uctl = kzalloc_obj(*uctl, GFP_KERNEL); + uctl = kzalloc_obj(*uctl); if (!uctl) return -ENOMEM; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b3e3ffdcce6f..afa9fad4457f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1323,7 +1323,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, be_substream->pcm->nonatomic = 1; } - dpcm = kzalloc_obj(struct snd_soc_dpcm, GFP_KERNEL); + dpcm = kzalloc_obj(struct snd_soc_dpcm); if (!dpcm) return -ENOMEM; diff --git a/sound/soc/soc-usb.c b/sound/soc/soc-usb.c index 57e537edb637..6386404a8db8 100644 --- a/sound/soc/soc-usb.c +++ b/sound/soc/soc-usb.c @@ -189,7 +189,7 @@ struct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *componen { struct snd_soc_usb *usb; - usb = kzalloc_obj(*usb, GFP_KERNEL); + usb = kzalloc_obj(*usb); if (!usb) return ERR_PTR(-ENOMEM); diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index f68fa3551df8..96570121aae0 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -101,7 +101,7 @@ static int sof_compr_open(struct snd_soc_component *component, struct snd_sof_pcm *spcm; int dir; - sstream = kzalloc_obj(*sstream, GFP_KERNEL); + sstream = kzalloc_obj(*sstream); if (!sstream) return -ENOMEM; diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c index 31494c686c72..b0072601181e 100644 --- a/sound/soc/sof/intel/apl.c +++ b/sound/soc/sof/intel/apl.c @@ -54,7 +54,7 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index b55dd9ace41f..660c1475e5a4 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -401,7 +401,7 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c index c9790f37928f..ce603a2343de 100644 --- a/sound/soc/sof/intel/hda-mlink.c +++ b/sound/soc/sof/intel/hda-mlink.c @@ -392,7 +392,7 @@ static int hda_ml_alloc_h2link(struct hdac_bus *bus, int index) struct hdac_ext_link *hlink; int ret; - h2link = kzalloc_obj(*h2link, GFP_KERNEL); + h2link = kzalloc_obj(*h2link); if (!h2link) return -ENOMEM; diff --git a/sound/soc/sof/intel/icl.c b/sound/soc/sof/intel/icl.c index 8079a1363b45..c1018893750c 100644 --- a/sound/soc/sof/intel/icl.c +++ b/sound/soc/sof/intel/icl.c @@ -122,7 +122,7 @@ int sof_icl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c index e46b0fd5746f..9503d00e6002 100644 --- a/sound/soc/sof/intel/mtl.c +++ b/sound/soc/sof/intel/mtl.c @@ -734,7 +734,7 @@ int sof_mtl_set_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *dsp_ops) dsp_ops->core_get = mtl_dsp_core_get; dsp_ops->core_put = mtl_dsp_core_put; - sdev->private = kzalloc_obj(struct sof_ipc4_fw_data, GFP_KERNEL); + sdev->private = kzalloc_obj(struct sof_ipc4_fw_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/skl.c b/sound/soc/sof/intel/skl.c index eb94027a5724..90519ebd3168 100644 --- a/sound/soc/sof/intel/skl.c +++ b/sound/soc/sof/intel/skl.c @@ -62,7 +62,7 @@ int sof_skl_ops_init(struct snd_sof_dev *sdev) /* probe/remove/shutdown */ sof_skl_ops.shutdown = hda_dsp_shutdown; - sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/intel/telemetry.c b/sound/soc/sof/intel/telemetry.c index 2e2cc6e2ea3a..967b5b577f03 100644 --- a/sound/soc/sof/intel/telemetry.c +++ b/sound/soc/sof/intel/telemetry.c @@ -29,7 +29,7 @@ void sof_ipc4_intel_dump_telemetry_state(struct snd_sof_dev *sdev, u32 flags) if (!slot_offset) return; - telemetry_data = kmalloc_obj(*telemetry_data, GFP_KERNEL); + telemetry_data = kmalloc_obj(*telemetry_data); if (!telemetry_data) return; sof_mailbox_read(sdev, slot_offset, telemetry_data, sizeof(*telemetry_data)); @@ -39,7 +39,7 @@ void sof_ipc4_intel_dump_telemetry_state(struct snd_sof_dev *sdev, u32 flags) goto free_telemetry_data; } - block = kmalloc_obj(*block, GFP_KERNEL); + block = kmalloc_obj(*block); if (!block) goto free_telemetry_data; diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c index 1c07f5882e1c..7936361e2e39 100644 --- a/sound/soc/sof/intel/tgl.c +++ b/sound/soc/sof/intel/tgl.c @@ -90,7 +90,7 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; - sdev->private = kzalloc_obj(*ipc4_data, GFP_KERNEL); + sdev->private = kzalloc_obj(*ipc4_data); if (!sdev->private) return -ENOMEM; diff --git a/sound/soc/sof/ipc3-dtrace.c b/sound/soc/sof/ipc3-dtrace.c index d5cb86b2ad08..22053357731a 100644 --- a/sound/soc/sof/ipc3-dtrace.c +++ b/sound/soc/sof/ipc3-dtrace.c @@ -126,7 +126,7 @@ static int trace_filter_parse(struct snd_sof_dev *sdev, char *string, capacity += TRACE_FILTER_ELEMENTS_PER_ENTRY; entry = strchr(entry + 1, entry_delimiter[0]); } - *out = kmalloc_objs(**out, capacity, GFP_KERNEL); + *out = kmalloc_objs(**out, capacity); if (!*out) return -ENOMEM; diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index b4fc27727106..dac8e7ba5981 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -524,7 +524,7 @@ static int sof_ipc3_widget_setup_comp_pipeline(struct snd_sof_widget *swidget) struct snd_sof_widget *comp_swidget; int ret; - pipeline = kzalloc_obj(*pipeline, GFP_KERNEL); + pipeline = kzalloc_obj(*pipeline); if (!pipeline) return -ENOMEM; @@ -589,7 +589,7 @@ static int sof_ipc3_widget_setup_comp_buffer(struct snd_sof_widget *swidget) struct sof_ipc_buffer *buffer; int ret; - buffer = kzalloc_obj(*buffer, GFP_KERNEL); + buffer = kzalloc_obj(*buffer); if (!buffer) return -ENOMEM; @@ -893,7 +893,7 @@ static int sof_process_load(struct snd_soc_component *scomp, /* allocate struct for widget control data sizes and types */ if (widget->num_kcontrols) { - wdata = kzalloc_objs(*wdata, widget->num_kcontrols, GFP_KERNEL); + wdata = kzalloc_objs(*wdata, widget->num_kcontrols); if (!wdata) return -ENOMEM; @@ -1567,7 +1567,7 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget) struct snd_sof_dai_link *slink; int ret; - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index a21dc53e1026..f82b080de4a9 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -939,7 +939,7 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm return -ENOMEM; } - stream_priv = kzalloc_obj(*stream_priv, GFP_KERNEL); + stream_priv = kzalloc_obj(*stream_priv); if (!stream_priv) { sof_ipc4_pcm_free(sdev, spcm); return -ENOMEM; @@ -951,7 +951,7 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm if (!support_info || stream == SNDRV_PCM_STREAM_CAPTURE) continue; - time_info = kzalloc_obj(*time_info, GFP_KERNEL); + time_info = kzalloc_obj(*time_info); if (!time_info) { sof_ipc4_pcm_free(sdev, spcm); return -ENOMEM; diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index 051b02b222f9..a2e9fef2760c 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -629,7 +629,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) int node_type = 0; int ret, dir; - ipc4_copier = kzalloc_obj(*ipc4_copier, GFP_KERNEL); + ipc4_copier = kzalloc_obj(*ipc4_copier); if (!ipc4_copier) return -ENOMEM; @@ -690,7 +690,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) } skip_gtw_cfg: - ipc4_copier->gtw_attr = kzalloc_obj(*ipc4_copier->gtw_attr, GFP_KERNEL); + ipc4_copier->gtw_attr = kzalloc_obj(*ipc4_copier->gtw_attr); if (!ipc4_copier->gtw_attr) { ret = -ENOMEM; goto free_available_fmt; @@ -759,7 +759,7 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) int node_type = 0; int ret; - ipc4_copier = kzalloc_obj(*ipc4_copier, GFP_KERNEL); + ipc4_copier = kzalloc_obj(*ipc4_copier); if (!ipc4_copier) return -ENOMEM; @@ -826,7 +826,7 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget) break; } - blob = kzalloc_obj(*blob, GFP_KERNEL); + blob = kzalloc_obj(*blob); if (!blob) { ret = -ENOMEM; goto free_available_fmt; @@ -933,7 +933,7 @@ static int sof_ipc4_widget_setup_comp_pipeline(struct snd_sof_widget *swidget) struct snd_sof_pipeline *spipe = swidget->spipe; int ret; - pipeline = kzalloc_obj(*pipeline, GFP_KERNEL); + pipeline = kzalloc_obj(*pipeline); if (!pipeline) return -ENOMEM; @@ -992,7 +992,7 @@ static int sof_ipc4_widget_setup_comp_pga(struct snd_sof_widget *swidget) struct sof_ipc4_gain *gain; int ret; - gain = kzalloc_obj(*gain, GFP_KERNEL); + gain = kzalloc_obj(*gain); if (!gain) return -ENOMEM; @@ -1051,7 +1051,7 @@ static int sof_ipc4_widget_setup_comp_mixer(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - mixer = kzalloc_obj(*mixer, GFP_KERNEL); + mixer = kzalloc_obj(*mixer); if (!mixer) return -ENOMEM; @@ -1083,7 +1083,7 @@ static int sof_ipc4_widget_setup_comp_src(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - src = kzalloc_obj(*src, GFP_KERNEL); + src = kzalloc_obj(*src); if (!src) return -ENOMEM; @@ -1126,7 +1126,7 @@ static int sof_ipc4_widget_setup_comp_asrc(struct snd_sof_widget *swidget) dev_dbg(scomp->dev, "Updating IPC structure for %s\n", swidget->widget->name); - asrc = kzalloc_obj(*asrc, GFP_KERNEL); + asrc = kzalloc_obj(*asrc); if (!asrc) return -ENOMEM; @@ -1209,7 +1209,7 @@ static int sof_ipc4_widget_setup_comp_process(struct snd_sof_widget *swidget) void *cfg; int ret; - process = kzalloc_obj(*process, GFP_KERNEL); + process = kzalloc_obj(*process); if (!process) return -ENOMEM; diff --git a/sound/soc/sof/sof-client-probes-ipc4.c b/sound/soc/sof/sof-client-probes-ipc4.c index 2ab282e98a61..88397c7dc4c3 100644 --- a/sound/soc/sof/sof-client-probes-ipc4.c +++ b/sound/soc/sof/sof-client-probes-ipc4.c @@ -327,7 +327,7 @@ static int ipc4_probes_points_add(struct sof_client_dev *cdev, * performance issue I wrote the conversion explicitly open for * future development. */ - points = kzalloc_objs(*points, num_desc, GFP_KERNEL); + points = kzalloc_objs(*points, num_desc); if (!points) return -ENOMEM; diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index 6cc9b7616100..c7bbf09e547f 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -554,7 +554,7 @@ int sof_client_register_ipc_rx_handler(struct sof_client_dev *cdev, return -EINVAL; } - event = kmalloc_obj(*event, GFP_KERNEL); + event = kmalloc_obj(*event); if (!event) return -ENOMEM; @@ -608,7 +608,7 @@ int sof_client_register_fw_state_handler(struct sof_client_dev *cdev, if (!callback) return -EINVAL; - event = kmalloc_obj(*event, GFP_KERNEL); + event = kmalloc_obj(*event); if (!event) return -ENOMEM; diff --git a/sound/soc/sof/stream-ipc.c b/sound/soc/sof/stream-ipc.c index e7541e1976b8..78758cf58f01 100644 --- a/sound/soc/sof/stream-ipc.c +++ b/sound/soc/sof/stream-ipc.c @@ -99,7 +99,7 @@ EXPORT_SYMBOL(sof_set_stream_data_offset); int sof_stream_pcm_open(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream) { - struct sof_stream *stream = kmalloc_obj(*stream, GFP_KERNEL); + struct sof_stream *stream = kmalloc_obj(*stream); if (!stream) return -ENOMEM; diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 46d78de5d9da..18e2401152c8 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -973,7 +973,7 @@ static int sof_control_load(struct snd_soc_component *scomp, int index, dev_dbg(scomp->dev, "tplg: load control type %d name : %s\n", hdr->type, hdr->name); - scontrol = kzalloc_obj(*scontrol, GFP_KERNEL); + scontrol = kzalloc_obj(*scontrol); if (!scontrol) return -ENOMEM; @@ -1233,7 +1233,7 @@ static int sof_widget_parse_tokens(struct snd_soc_component *scomp, struct snd_s num_tuples += token_list[object_token_list[i]].count; /* allocate memory for tuples array */ - swidget->tuples = kzalloc_objs(*swidget->tuples, num_tuples, GFP_KERNEL); + swidget->tuples = kzalloc_objs(*swidget->tuples, num_tuples); if (!swidget->tuples) return -ENOMEM; @@ -1420,7 +1420,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, int token_list_size = 0; int ret = 0; - swidget = kzalloc_obj(*swidget, GFP_KERNEL); + swidget = kzalloc_obj(*swidget); if (!swidget) return -ENOMEM; @@ -1496,7 +1496,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, switch (w->id) { case snd_soc_dapm_dai_in: case snd_soc_dapm_dai_out: - dai = kzalloc_obj(*dai, GFP_KERNEL); + dai = kzalloc_obj(*dai); if (!dai) { ret = -ENOMEM; goto widget_free; @@ -1586,7 +1586,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, if (w->id == snd_soc_dapm_scheduler) { struct snd_sof_pipeline *spipe; - spipe = kzalloc_obj(*spipe, GFP_KERNEL); + spipe = kzalloc_obj(*spipe); if (!spipe) { ret = -ENOMEM; goto free; @@ -1739,7 +1739,7 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, if (!pcm) return 0; - spcm = kzalloc_obj(*spcm, GFP_KERNEL); + spcm = kzalloc_obj(*spcm); if (!spcm) return -ENOMEM; @@ -1906,7 +1906,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ return -EINVAL; } - slink = kzalloc_obj(*slink, GFP_KERNEL); + slink = kzalloc_obj(*slink); if (!slink) return -ENOMEM; @@ -1999,7 +1999,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ } /* allocate memory for tuples array */ - slink->tuples = kzalloc_objs(*slink->tuples, num_tuples, GFP_KERNEL); + slink->tuples = kzalloc_objs(*slink->tuples, num_tuples); if (!slink->tuples) { kfree(slink->hw_configs); kfree(slink); @@ -2094,7 +2094,7 @@ static int sof_route_load(struct snd_soc_component *scomp, int index, int ret = 0; /* allocate memory for sroute and connect */ - sroute = kzalloc_obj(*sroute, GFP_KERNEL); + sroute = kzalloc_obj(*sroute); if (!sroute) return -ENOMEM; @@ -2398,11 +2398,11 @@ static int sof_dspless_widget_ready(struct snd_soc_component *scomp, int index, struct snd_sof_widget *swidget; struct snd_sof_dai *sdai; - swidget = kzalloc_obj(*swidget, GFP_KERNEL); + swidget = kzalloc_obj(*swidget); if (!swidget) return -ENOMEM; - sdai = kzalloc_obj(*sdai, GFP_KERNEL); + sdai = kzalloc_obj(*sdai); if (!sdai) { kfree(swidget); return -ENOMEM; diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c index 0d544ff5a24f..a7d437b49fbf 100644 --- a/sound/soc/sprd/sprd-pcm-compress.c +++ b/sound/soc/sprd/sprd-pcm-compress.c @@ -160,7 +160,7 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component, return -ENODEV; } - sgt = sg = kzalloc_objs(*sg, sg_num, GFP_KERNEL); + sgt = sg = kzalloc_objs(*sg, sg_num); if (!sg) { ret = -ENOMEM; goto sg_err; diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c index 7cfe09fdd2a0..04a4eae1bc92 100644 --- a/sound/soc/xilinx/xlnx_formatter_pcm.c +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c @@ -341,7 +341,7 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component, !adata->s2mm_presence) return -ENODEV; - stream_data = kzalloc_obj(*stream_data, GFP_KERNEL); + stream_data = kzalloc_obj(*stream_data); if (!stream_data) return -ENOMEM; diff --git a/sound/sound_core.c b/sound/sound_core.c index 741e62cffe6e..10db8c699630 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c @@ -238,7 +238,7 @@ static DEFINE_SPINLOCK(sound_loader_lock); static int sound_insert_unit(struct sound_unit **list, const struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev) { - struct sound_unit *s = kmalloc_obj(*s, GFP_KERNEL); + struct sound_unit *s = kmalloc_obj(*s); int r; if (!s) diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index f690e8f812d9..c38903144c72 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -26,7 +26,7 @@ int snd_emux_new(struct snd_emux **remu) struct snd_emux *emu; *remu = NULL; - emu = kzalloc_obj(*emu, GFP_KERNEL); + emu = kzalloc_obj(*emu); if (emu == NULL) return -ENOMEM; diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 9a279d07364d..62d1ba66721c 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -132,7 +132,7 @@ snd_emux_create_port(struct snd_emux *emu, char *name, int i, type, cap; /* Allocate structures for this channel */ - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return NULL; @@ -351,7 +351,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) if (emu->midi_ports <= 0) return 0; - emu->vmidi = kzalloc_objs(*emu->vmidi, emu->midi_ports, GFP_KERNEL); + emu->vmidi = kzalloc_objs(*emu->vmidi, emu->midi_ports); if (!emu->vmidi) return -ENOMEM; diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c index 01996637d257..c172b53b17a4 100644 --- a/sound/synth/emux/soundfont.c +++ b/sound/synth/emux/soundfont.c @@ -230,7 +230,7 @@ newsf(struct snd_sf_list *sflist, int type, char *name) } /* not found -- create a new one */ - sf = kzalloc_obj(*sf, GFP_KERNEL); + sf = kzalloc_obj(*sf); if (sf == NULL) return NULL; sf->id = sflist->fonts_size; @@ -309,7 +309,7 @@ sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) { struct snd_sf_zone *zp; - zp = kzalloc_obj(*zp, GFP_KERNEL); + zp = kzalloc_obj(*zp); if (!zp) return NULL; zp->next = sf->zones; @@ -342,7 +342,7 @@ sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) { struct snd_sf_sample *sp; - sp = kzalloc_obj(*sp, GFP_KERNEL); + sp = kzalloc_obj(*sp); if (!sp) return NULL; @@ -1391,7 +1391,7 @@ snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr) { struct snd_sf_list *sflist; - sflist = kzalloc_obj(*sflist, GFP_KERNEL); + sflist = kzalloc_obj(*sflist); if (!sflist) return NULL; diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c index 36fa4fc9632c..21893e5612fb 100644 --- a/sound/synth/util_mem.c +++ b/sound/synth/util_mem.c @@ -26,7 +26,7 @@ snd_util_memhdr_new(int memsize) { struct snd_util_memhdr *hdr; - hdr = kzalloc_obj(*hdr, GFP_KERNEL); + hdr = kzalloc_obj(*hdr); if (hdr == NULL) return NULL; hdr->size = memsize; diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index b7378a514e21..9a0b85653c61 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c @@ -141,7 +141,7 @@ static int usb6fire_comm_write16(struct comm_runtime *rt, u8 request, int usb6fire_comm_init(struct sfire_chip *chip) { - struct comm_runtime *rt = kzalloc_obj(struct comm_runtime, GFP_KERNEL); + struct comm_runtime *rt = kzalloc_obj(struct comm_runtime); struct urb *urb; int ret; diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index 6707fb8a2d1e..123c1c6539b8 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c @@ -195,7 +195,7 @@ static int usb6fire_fw_ezusb_upload( u8 data; struct usb_device *device = interface_to_usbdev(intf); const struct firmware *fw = NULL; - struct ihex_record *rec = kmalloc_obj(struct ihex_record, GFP_KERNEL); + struct ihex_record *rec = kmalloc_obj(struct ihex_record); if (!rec) return -ENOMEM; diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index 40c935fb7592..6b0bb096f27a 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c @@ -140,7 +140,7 @@ static const struct snd_rawmidi_ops in_ops = { int usb6fire_midi_init(struct sfire_chip *chip) { int ret; - struct midi_runtime *rt = kzalloc_obj(struct midi_runtime, GFP_KERNEL); + struct midi_runtime *rt = kzalloc_obj(struct midi_runtime); struct comm_runtime *comm_rt = chip->comm; if (!rt) diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index abd1338eb972..d2e274b731fe 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c @@ -587,7 +587,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) int ret; struct snd_pcm *pcm; struct pcm_runtime *rt = - kzalloc_obj(struct pcm_runtime, GFP_KERNEL); + kzalloc_obj(struct pcm_runtime); if (!rt) return -ENOMEM; diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 06837b9f8bf8..ba3f73455ebe 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -681,7 +681,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBACK) : usb_rcvisocpipe(usb_dev, ENDPOINT_CAPTURE); - urbs = kmalloc_objs(*urbs, N_URBS, GFP_KERNEL); + urbs = kmalloc_objs(*urbs, N_URBS); if (!urbs) { *ret = -ENOMEM; return NULL; @@ -813,7 +813,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev) NULL, 0, 0); cdev->data_cb_info = - kmalloc_objs(struct snd_usb_caiaq_cb_info, N_URBS, GFP_KERNEL); + kmalloc_objs(struct snd_usb_caiaq_cb_info, N_URBS); if (!cdev->data_cb_info) return -ENOMEM; diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 8a2bb82c1a18..73bce9712dbd 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -621,7 +621,7 @@ iface_ref_find(struct snd_usb_audio *chip, int iface) if (ip->iface == iface) return ip; - ip = kzalloc_obj(*ip, GFP_KERNEL); + ip = kzalloc_obj(*ip); if (!ip) return NULL; ip->iface = iface; @@ -639,7 +639,7 @@ clock_ref_find(struct snd_usb_audio *chip, int clock) if (ref->clock == clock) return ref; - ref = kzalloc_obj(*ref, GFP_KERNEL); + ref = kzalloc_obj(*ref); if (!ref) return NULL; ref->clock = clock; @@ -698,7 +698,7 @@ int snd_usb_add_endpoint(struct snd_usb_audio *chip, int ep_num, int type) usb_audio_dbg(chip, "Creating new %s endpoint #%x\n", ep_type_name(type), ep_num); - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; diff --git a/sound/usb/fcp.c b/sound/usb/fcp.c index 2ca41460aa5b..0fc4d063c48a 100644 --- a/sound/usb/fcp.c +++ b/sound/usb/fcp.c @@ -329,7 +329,7 @@ static int fcp_add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc_obj(*elem, GFP_KERNEL); + elem = kzalloc_obj(*elem); if (!elem) return -ENOMEM; @@ -654,7 +654,7 @@ static int fcp_ioctl_set_meter_map(struct usb_mixer_interface *mixer, if (!private->meter_ctl) { /* Allocate buffer for the map */ s16 *new_map __free(kfree) = - kmalloc_objs(s16, map.map_size, GFP_KERNEL); + kmalloc_objs(s16, map.map_size); if (!new_map) return -ENOMEM; @@ -1045,7 +1045,7 @@ static int fcp_init(struct usb_mixer_interface *mixer, static int fcp_init_private(struct usb_mixer_interface *mixer) { struct fcp_data *private = - kzalloc_obj(struct fcp_data, GFP_KERNEL); + kzalloc_obj(struct fcp_data); if (!private) return -ENOMEM; diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index 2603a88a9d27..cd1a4c871c5d 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c @@ -547,7 +547,7 @@ int hiface_pcm_init(struct hiface_chip *chip, u8 extra_freq) struct snd_pcm *pcm; struct pcm_runtime *rt; - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return -ENOMEM; diff --git a/sound/usb/line6/midi.c b/sound/usb/line6/midi.c index 0e5cb8a86922..af01b649393c 100644 --- a/sound/usb/line6/midi.c +++ b/sound/usb/line6/midi.c @@ -264,7 +264,7 @@ int line6_init_midi(struct usb_line6 *line6) if (err < 0) return err; - line6midi = kzalloc_obj(struct snd_line6_midi, GFP_KERNEL); + line6midi = kzalloc_obj(struct snd_line6_midi); if (!line6midi) return -ENOMEM; diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index ea1cea5d1105..2932eaf157f4 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c @@ -528,7 +528,7 @@ int line6_init_pcm(struct usb_line6 *line6, if (err < 0) return err; - line6pcm = kzalloc_obj(*line6pcm, GFP_KERNEL); + line6pcm = kzalloc_obj(*line6pcm); if (!line6pcm) return -ENOMEM; diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c index abc1a750a921..1df5c0dcd216 100644 --- a/sound/usb/line6/toneport.c +++ b/sound/usb/line6/toneport.c @@ -363,7 +363,7 @@ static int toneport_setup(struct usb_line6_toneport *toneport) struct usb_line6 *line6 = &toneport->line6; struct usb_device *usbdev = line6->usbdev; - ticks = kmalloc_obj(*ticks, GFP_KERNEL); + ticks = kmalloc_obj(*ticks); if (!ticks) return -ENOMEM; diff --git a/sound/usb/media.c b/sound/usb/media.c index 0aab1eb5c4e9..b7497d18ee3f 100644 --- a/sound/usb/media.c +++ b/sound/usb/media.c @@ -49,7 +49,7 @@ int snd_media_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm, return 0; /* allocate media_ctl */ - mctl = kzalloc_obj(*mctl, GFP_KERNEL); + mctl = kzalloc_obj(*mctl); if (!mctl) return -ENOMEM; @@ -188,7 +188,7 @@ static int snd_media_mixer_init(struct snd_usb_audio *chip) continue; /* allocate media_mixer_ctl */ - mctl = kzalloc_obj(*mctl, GFP_KERNEL); + mctl = kzalloc_obj(*mctl); if (!mctl) return -ENOMEM; diff --git a/sound/usb/midi.c b/sound/usb/midi.c index c72434ac581d..a8bddc90c0ed 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1328,7 +1328,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, int err; rep->in = NULL; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; ep->umidi = umidi; @@ -1414,7 +1414,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi, int err; rep->out = NULL; - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; ep->umidi = umidi; @@ -2506,7 +2506,7 @@ int __snd_usbmidi_create(struct snd_card *card, int out_ports, in_ports; int i, err; - umidi = kzalloc_obj(*umidi, GFP_KERNEL); + umidi = kzalloc_obj(*umidi); if (!umidi) return -ENOMEM; umidi->dev = interface_to_usbdev(iface); diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index cf05e4cb97b1..ef602e81576d 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -432,7 +432,7 @@ static int create_midi2_endpoint(struct snd_usb_midi2_interface *umidi, hostep->desc.bEndpointAddress, ms_ep->bNumGrpTrmBlock); - ep = kzalloc_obj(*ep, GFP_KERNEL); + ep = kzalloc_obj(*ep); if (!ep) return -ENOMEM; @@ -693,7 +693,7 @@ static int create_midi2_ump(struct snd_usb_midi2_interface *umidi, char idstr[16]; int err; - rmidi = kzalloc_obj(*rmidi, GFP_KERNEL); + rmidi = kzalloc_obj(*rmidi); if (!rmidi) return -ENOMEM; INIT_LIST_HEAD(&rmidi->list); @@ -1101,7 +1101,7 @@ int snd_usb_midi_v2_create(struct snd_usb_audio *chip, hostif->desc.bInterfaceNumber, hostif->desc.bAlternateSetting); - umidi = kzalloc_obj(*umidi, GFP_KERNEL); + umidi = kzalloc_obj(*umidi); if (!umidi) return -ENOMEM; umidi->chip = chip; diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 62be8a00a826..49b3dd8d827d 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c @@ -1062,7 +1062,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, while (size >= max_packet_size) { if (u >= stream->queue_length) goto bufsize_error; - urb = kmalloc_obj(*urb, GFP_KERNEL); + urb = kmalloc_obj(*urb); if (!urb) return -ENOMEM; usb_init_urb(&urb->urb); diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 1b66f9581b4a..3c3b197de39d 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1684,7 +1684,7 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer, if (check_ignored_ctl(map)) return; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return; snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid); @@ -1894,7 +1894,7 @@ static void build_connector_control(struct usb_mixer_interface *mixer, if (check_ignored_ctl(map)) return; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return; snd_usb_mixer_elem_init_std(&cval->head, mixer, term->id); @@ -1956,7 +1956,7 @@ static int parse_clock_source_unit(struct mixer_build *state, int unitid, UAC2_CS_CONTROL_CLOCK_VALID)) return 0; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return -ENOMEM; @@ -2177,7 +2177,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, if (check_ignored_ctl(map)) return; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return; @@ -2525,7 +2525,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, map = find_map(state->map, unitid, valinfo->control); if (check_ignored_ctl(map)) continue; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid); @@ -2771,7 +2771,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, if (check_ignored_ctl(map)) return 0; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid); @@ -3598,7 +3598,7 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) strscpy(chip->card->mixername, "USB Mixer"); - mixer = kzalloc_obj(*mixer, GFP_KERNEL); + mixer = kzalloc_obj(*mixer); if (!mixer) return -ENOMEM; mixer->chip = chip; diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index dc538450f3b9..9bc449ea9327 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -67,7 +67,7 @@ static int snd_create_std_mono_ctl_offset(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *cval; struct snd_kcontrol *kctl; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return -ENOMEM; @@ -151,7 +151,7 @@ static int add_single_ctl_with_resume(struct usb_mixer_interface *mixer, struct usb_mixer_elem_list *list; struct snd_kcontrol *kctl; - list = kzalloc_obj(*list, GFP_KERNEL); + list = kzalloc_obj(*list); if (!list) return -ENOMEM; if (listp) @@ -617,7 +617,7 @@ static int snd_dualsense_ih_connect(struct input_handler *handler, struct input_handle *handle; int err; - handle = kzalloc_obj(*handle, GFP_KERNEL); + handle = kzalloc_obj(*handle); if (!handle) return -ENOMEM; @@ -714,7 +714,7 @@ static int snd_dualsense_jack_create(struct usb_mixer_interface *mixer, struct snd_kcontrol *kctl; int err; - mei = kzalloc_obj(*mei, GFP_KERNEL); + mei = kzalloc_obj(*mei); if (!mei) return -ENOMEM; @@ -2279,7 +2279,7 @@ static int realtek_add_jack(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *cval; struct snd_kcontrol *kctl; - cval = kzalloc_obj(*cval, GFP_KERNEL); + cval = kzalloc_obj(*cval); if (!cval) return -ENOMEM; snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid); diff --git a/sound/usb/mixer_s1810c.c b/sound/usb/mixer_s1810c.c index f931643db1c5..473cb29efa7f 100644 --- a/sound/usb/mixer_s1810c.c +++ b/sound/usb/mixer_s1810c.c @@ -534,7 +534,7 @@ snd_s1810c_switch_init(struct usb_mixer_interface *mixer, struct snd_kcontrol *kctl; struct usb_mixer_elem_info *elem; - elem = kzalloc_obj(struct usb_mixer_elem_info, GFP_KERNEL); + elem = kzalloc_obj(struct usb_mixer_elem_info); if (!elem) return -ENOMEM; @@ -645,7 +645,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer) if (ret < 0) return ret; - private = kzalloc_obj(struct s1810_mixer_state, GFP_KERNEL); + private = kzalloc_obj(struct s1810_mixer_state); if (!private) return -ENOMEM; diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 8582153cb4a7..1bb01e827654 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -819,7 +819,7 @@ static int add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc_obj(*elem, GFP_KERNEL); + elem = kzalloc_obj(*elem); if (!elem) return -ENOMEM; diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 41a496adcc09..85a0316889d4 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -3197,7 +3197,7 @@ static int scarlett2_add_new_ctl(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *elem; int err; - elem = kzalloc_obj(*elem, GFP_KERNEL); + elem = kzalloc_obj(*elem); if (!elem) return -ENOMEM; @@ -8272,7 +8272,7 @@ static int scarlett2_init_private(struct usb_mixer_interface *mixer, const struct scarlett2_device_entry *entry) { struct scarlett2_data *private = - kzalloc_obj(struct scarlett2_data, GFP_KERNEL); + kzalloc_obj(struct scarlett2_data); if (!private) return -ENOMEM; diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c index c7b63c29cbf6..8a02964e5d7b 100644 --- a/sound/usb/mixer_us16x08.c +++ b/sound/usb/mixer_us16x08.c @@ -969,7 +969,7 @@ static struct snd_us16x08_comp_store *snd_us16x08_create_comp_store(void) int i; struct snd_us16x08_comp_store *tmp; - tmp = kmalloc_obj(*tmp, GFP_KERNEL); + tmp = kmalloc_obj(*tmp); if (!tmp) return NULL; @@ -991,7 +991,7 @@ static struct snd_us16x08_eq_store *snd_us16x08_create_eq_store(void) int i, b_idx; struct snd_us16x08_eq_store *tmp; - tmp = kmalloc_obj(*tmp, GFP_KERNEL); + tmp = kmalloc_obj(*tmp); if (!tmp) return NULL; @@ -1027,7 +1027,7 @@ static struct snd_us16x08_meter_store *snd_us16x08_create_meter_store(void) { struct snd_us16x08_meter_store *tmp; - tmp = kzalloc_obj(*tmp, GFP_KERNEL); + tmp = kzalloc_obj(*tmp); if (!tmp) return NULL; tmp->comp_index = 1; @@ -1059,7 +1059,7 @@ static int add_new_ctl(struct usb_mixer_interface *mixer, usb_audio_dbg(mixer->chip, "us16x08 add mixer %s\n", name); - elem = kzalloc_obj(*elem, GFP_KERNEL); + elem = kzalloc_obj(*elem); if (!elem) return -ENOMEM; diff --git a/sound/usb/power.c b/sound/usb/power.c index 47863b688b4d..c2d708c87fc4 100644 --- a/sound/usb/power.c +++ b/sound/usb/power.c @@ -20,7 +20,7 @@ snd_usb_find_power_domain(struct usb_host_interface *ctrl_iface, struct snd_usb_power_domain *pd; void *p; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) return NULL; diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c index b709b6cb3051..57b803e0c986 100644 --- a/sound/usb/qcom/qc_audio_offload.c +++ b/sound/usb/qcom/qc_audio_offload.c @@ -438,7 +438,7 @@ static unsigned long uaudio_get_iova(unsigned long *curr_iova, } } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { iova = 0; goto done; @@ -1687,7 +1687,7 @@ static struct qmi_msg_handler uaudio_stream_req_handlers = { */ static int qc_usb_audio_offload_init_qmi_dev(void) { - uaudio_qdev = kzalloc_obj(*uaudio_qdev, GFP_KERNEL); + uaudio_qdev = kzalloc_obj(*uaudio_qdev); if (!uaudio_qdev) return -ENOMEM; @@ -1759,7 +1759,7 @@ static void qc_usb_audio_offload_probe(struct snd_usb_audio *chip) guard(mutex)(&qdev_mutex); guard(mutex)(&chip->mutex); if (!uadev[chip->card->number].chip) { - sdev = kzalloc_obj(*sdev, GFP_KERNEL); + sdev = kzalloc_obj(*sdev); if (!sdev) return; @@ -1914,11 +1914,11 @@ static int qc_usb_audio_probe(struct auxiliary_device *auxdev, struct uaudio_qmi_svc *svc; int ret; - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) return -ENOMEM; - svc->uaudio_svc_hdl = kzalloc_obj(*svc->uaudio_svc_hdl, GFP_KERNEL); + svc->uaudio_svc_hdl = kzalloc_obj(*svc->uaudio_svc_hdl); if (!svc->uaudio_svc_hdl) { ret = -ENOMEM; goto free_svc; diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 975b57adf2f4..4cac0dfb0094 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -566,7 +566,7 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac if (err < 0) dev_dbg(&dev->dev, "error sending boot message: %d\n", err); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc_obj(*new_device_descriptor, GFP_KERNEL); + kmalloc_obj(*new_device_descriptor); if (!new_device_descriptor) return -ENOMEM; err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, @@ -944,7 +944,7 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) dev_dbg(&dev->dev, "device initialised!\n"); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc_obj(*new_device_descriptor, GFP_KERNEL); + kmalloc_obj(*new_device_descriptor); if (!new_device_descriptor) return -ENOMEM; @@ -1279,7 +1279,7 @@ static int snd_usb_mbox3_boot_quirk(struct usb_device *dev) dev_dbg(&dev->dev, "MBOX3: device initialised!\n"); struct usb_device_descriptor *new_device_descriptor __free(kfree) = - kmalloc_obj(*new_device_descriptor, GFP_KERNEL); + kmalloc_obj(*new_device_descriptor); if (!new_device_descriptor) return -ENOMEM; diff --git a/sound/usb/stream.c b/sound/usb/stream.c index adf1827807d4..ac4d92065dd9 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -291,7 +291,7 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, if (channels > ARRAY_SIZE(chmap->map)) return NULL; - chmap = kzalloc_obj(*chmap, GFP_KERNEL); + chmap = kzalloc_obj(*chmap); if (!chmap) return NULL; @@ -335,7 +335,7 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor if (channels > ARRAY_SIZE(chmap->map)) return NULL; - chmap = kzalloc_obj(*chmap, GFP_KERNEL); + chmap = kzalloc_obj(*chmap); if (!chmap) return NULL; @@ -526,7 +526,7 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, } /* create a new pcm */ - as = kzalloc_obj(*as, GFP_KERNEL); + as = kzalloc_obj(*as); if (!as) return -ENOMEM; as->pcm_index = chip->pcm_devs; @@ -693,7 +693,7 @@ audio_format_alloc_init(struct snd_usb_audio *chip, struct usb_host_endpoint *ep = &alts->endpoint[0]; struct audioformat *fp; - fp = kzalloc_obj(*fp, GFP_KERNEL); + fp = kzalloc_obj(*fp); if (!fp) return NULL; @@ -927,7 +927,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip, break; } - chmap = kzalloc_obj(*chmap, GFP_KERNEL); + chmap = kzalloc_obj(*chmap); if (!chmap) return ERR_PTR(-ENOMEM); @@ -1078,7 +1078,7 @@ found_clock: fp->rate_max = UAC3_BADD_SAMPLING_RATE; fp->rates = SNDRV_PCM_RATE_CONTINUOUS; - pd = kzalloc_obj(*pd, GFP_KERNEL); + pd = kzalloc_obj(*pd); if (!pd) { audioformat_free(fp); return NULL; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index c8f2f07d7f8d..c913354247c7 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -663,7 +663,7 @@ static int usx2y_rate_set(struct usx2ydev *usx2y, int rate) goto cleanup; } us->len = NOOF_SETRATE_URBS; - usbdata = kmalloc_objs(int, NOOF_SETRATE_URBS, GFP_KERNEL); + usbdata = kmalloc_objs(int, NOOF_SETRATE_URBS); if (!usbdata) { err = -ENOMEM; goto cleanup; diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c index 65abd8510ff4..647190f4d5af 100644 --- a/sound/virtio/virtio_card.c +++ b/sound/virtio/virtio_card.c @@ -137,7 +137,7 @@ static int virtsnd_find_vqs(struct virtio_snd *snd) n = virtqueue_get_vring_size(vqs[VIRTIO_SND_VQ_EVENT]); - snd->event_msgs = kmalloc_objs(*snd->event_msgs, n, GFP_KERNEL); + snd->event_msgs = kmalloc_objs(*snd->event_msgs, n); if (!snd->event_msgs) return -ENOMEM; diff --git a/sound/virtio/virtio_jack.c b/sound/virtio/virtio_jack.c index 2f1ec3ac02f0..68e40c7f5039 100644 --- a/sound/virtio/virtio_jack.c +++ b/sound/virtio/virtio_jack.c @@ -144,7 +144,7 @@ int virtsnd_jack_parse_cfg(struct virtio_snd *snd) if (!snd->jacks) return -ENOMEM; - info = kzalloc_objs(*info, snd->njacks, GFP_KERNEL); + info = kzalloc_objs(*info, snd->njacks); if (!info) return -ENOMEM; diff --git a/sound/virtio/virtio_pcm.c b/sound/virtio/virtio_pcm.c index ef5a8a507b24..eb9cc8131905 100644 --- a/sound/virtio/virtio_pcm.c +++ b/sound/virtio/virtio_pcm.c @@ -354,7 +354,7 @@ int virtsnd_pcm_parse_cfg(struct virtio_snd *snd) spin_lock_init(&vss->lock); } - info = kzalloc_objs(*info, snd->nsubstreams, GFP_KERNEL); + info = kzalloc_objs(*info, snd->nsubstreams); if (!info) return -ENOMEM; diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c index 79af520ef12e..7b27f242bf5f 100644 --- a/sound/virtio/virtio_pcm_msg.c +++ b/sound/virtio/virtio_pcm_msg.c @@ -135,7 +135,7 @@ int virtsnd_pcm_msg_alloc(struct virtio_pcm_substream *vss, struct snd_pcm_runtime *runtime = vss->substream->runtime; unsigned int i; - vss->msgs = kzalloc_objs(*vss->msgs, periods, GFP_KERNEL); + vss->msgs = kzalloc_objs(*vss->msgs, periods); if (!vss->msgs) return -ENOMEM; diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index dc7501c95b99..91dfcf47e979 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -475,7 +475,7 @@ static void had_build_channel_allocation_map(struct snd_intelhad *intelhaddata) kfree(intelhaddata->chmap->chmap); intelhaddata->chmap->chmap = NULL; - chmap = kzalloc_obj(*chmap, GFP_KERNEL); + chmap = kzalloc_obj(*chmap); if (!chmap) return; diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c index e73339295a44..017d84a7adf3 100644 --- a/virt/kvm/guest_memfd.c +++ b/virt/kvm/guest_memfd.c @@ -568,7 +568,7 @@ static int __kvm_gmem_create(struct kvm *kvm, loff_t size, u64 flags) if (fd < 0) return fd; - f = kzalloc_obj(*f, GFP_KERNEL); + f = kzalloc_obj(*f); if (!f) { err = -ENOMEM; goto err_fd; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index b798903540b6..22f8a672e1fd 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4505,7 +4505,7 @@ static long kvm_vcpu_ioctl(struct file *filp, struct kvm_regs *kvm_regs; r = -ENOMEM; - kvm_regs = kzalloc_obj(struct kvm_regs, GFP_KERNEL); + kvm_regs = kzalloc_obj(struct kvm_regs); if (!kvm_regs) goto out; r = kvm_arch_vcpu_ioctl_get_regs(vcpu, kvm_regs); @@ -4532,7 +4532,7 @@ out_free1: break; } case KVM_GET_SREGS: { - kvm_sregs = kzalloc_obj(struct kvm_sregs, GFP_KERNEL); + kvm_sregs = kzalloc_obj(struct kvm_sregs); r = -ENOMEM; if (!kvm_sregs) goto out; @@ -4624,7 +4624,7 @@ out_free1: break; } case KVM_GET_FPU: { - fpu = kzalloc_obj(struct kvm_fpu, GFP_KERNEL); + fpu = kzalloc_obj(struct kvm_fpu); r = -ENOMEM; if (!fpu) goto out; @@ -6326,7 +6326,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm) active = kvm_active_vms; mutex_unlock(&kvm_lock); - env = kzalloc_obj(*env, GFP_KERNEL); + env = kzalloc_obj(*env); if (!env) return; -- cgit v1.2.3